diff --git a/DragonMedia/RedDragonVoice/Dragon.mp3 b/Android/AllData/audio/Dragon.mp3 similarity index 100% rename from DragonMedia/RedDragonVoice/Dragon.mp3 rename to Android/AllData/audio/Dragon.mp3 diff --git a/DragonMedia/RedDragonVoice/Gm.mp3 b/Android/AllData/audio/Gm.mp3 similarity index 100% rename from DragonMedia/RedDragonVoice/Gm.mp3 rename to Android/AllData/audio/Gm.mp3 diff --git a/DragonMedia/RedDragonVoice/Gn.mp3 b/Android/AllData/audio/Gn.mp3 similarity index 100% rename from DragonMedia/RedDragonVoice/Gn.mp3 rename to Android/AllData/audio/Gn.mp3 diff --git a/DragonMedia/RedDragonVoice/Good Morning.mp3 b/Android/AllData/audio/Good Morning.mp3 similarity index 100% rename from DragonMedia/RedDragonVoice/Good Morning.mp3 rename to Android/AllData/audio/Good Morning.mp3 diff --git a/DragonMedia/RedDragonVoice/Good Night.mp3 b/Android/AllData/audio/Good Night.mp3 similarity index 100% rename from DragonMedia/RedDragonVoice/Good Night.mp3 rename to Android/AllData/audio/Good Night.mp3 diff --git a/DragonMedia/RedDragonVoice/I love you.mp3 b/Android/AllData/audio/I Love You.mp3 similarity index 100% rename from DragonMedia/RedDragonVoice/I love you.mp3 rename to Android/AllData/audio/I Love You.mp3 diff --git a/DragonMedia/RedDragonVoice/love.mp3 b/Android/AllData/audio/I love you.mp3 similarity index 100% rename from DragonMedia/RedDragonVoice/love.mp3 rename to Android/AllData/audio/I love you.mp3 diff --git a/DragonMedia/RedDragonVoice/fuck you.mp3 b/Android/AllData/audio/fuck.mp3 similarity index 100% rename from DragonMedia/RedDragonVoice/fuck you.mp3 rename to Android/AllData/audio/fuck.mp3 diff --git a/DragonMedia/RedDragonVoice/info.mp3 b/Android/AllData/audio/info.mp3 similarity index 100% rename from DragonMedia/RedDragonVoice/info.mp3 rename to Android/AllData/audio/info.mp3 diff --git a/DragonMedia/RedDragonVoice/kumuthu.mp3 b/Android/AllData/audio/kumuthu.mp3 similarity index 100% rename from DragonMedia/RedDragonVoice/kumuthu.mp3 rename to Android/AllData/audio/kumuthu.mp3 diff --git "a/DragonMedia/RedDragonVoice/\340\266\205\340\266\261\340\267\232 \340\266\264\340\266\275\340\266\272\340\266\261\340\267\212 \340\266\266\340\266\261\340\267\212 \340\266\272\340\266\261\340\267\212\340\266\261.mp3" "b/Android/AllData/audio/\340\266\205\340\266\261\340\267\232 \340\266\264\340\266\275\340\266\272\340\266\261\340\267\212 \340\266\266\340\266\261\340\267\212 \340\266\272\340\266\261\340\267\212\340\266\261.mp3" similarity index 100% rename from "DragonMedia/RedDragonVoice/\340\266\205\340\266\261\340\267\232 \340\266\264\340\266\275\340\266\272\340\266\261\340\267\212 \340\266\266\340\266\261\340\267\212 \340\266\272\340\266\261\340\267\212\340\266\261.mp3" rename to "Android/AllData/audio/\340\266\205\340\266\261\340\267\232 \340\266\264\340\266\275\340\266\272\340\266\261\340\267\212 \340\266\266\340\266\261\340\267\212 \340\266\272\340\266\261\340\267\212\340\266\261.mp3" diff --git "a/DragonMedia/RedDragonVoice/\340\266\206\340\267\200\340\267\212 \340\266\206\340\267\200\340\267\212.mp3" "b/Android/AllData/audio/\340\266\206\340\267\200\340\267\212 \340\266\206\340\267\200\340\267\212.mp3" similarity index 100% rename from "DragonMedia/RedDragonVoice/\340\266\206\340\267\200\340\267\212 \340\266\206\340\267\200\340\267\212.mp3" rename to "Android/AllData/audio/\340\266\206\340\267\200\340\267\212 \340\266\206\340\267\200\340\267\212.mp3" diff --git "a/DragonMedia/RedDragonVoice/\340\266\211\340\266\270\340\267\212\340\267\204\340\267\222 \340\266\211\340\266\270\340\267\212\340\267\204\340\267\222.mp3" "b/Android/AllData/audio/\340\266\211\340\266\270\340\267\212\340\267\204\340\267\222 \340\266\211\340\266\270\340\267\212\340\267\204\340\267\222.mp3" similarity index 100% rename from "DragonMedia/RedDragonVoice/\340\266\211\340\266\270\340\267\212\340\267\204\340\267\222 \340\266\211\340\266\270\340\267\212\340\267\204\340\267\222.mp3" rename to "Android/AllData/audio/\340\266\211\340\266\270\340\267\212\340\267\204\340\267\222 \340\266\211\340\266\270\340\267\212\340\267\204\340\267\222.mp3" diff --git "a/DragonMedia/RedDragonVoice/\340\267\204\340\267\217\340\266\272\340\267\222.mp3" "b/Android/AllData/audio/\340\267\204\340\267\217\340\266\272\340\267\222.mp3" similarity index 100% rename from "DragonMedia/RedDragonVoice/\340\267\204\340\267\217\340\266\272\340\267\222.mp3" rename to "Android/AllData/audio/\340\267\204\340\267\217\340\266\272\340\267\222.mp3" diff --git "a/DragonMedia/RedDragonVoice/\340\267\204\340\267\224#%.mp3" "b/Android/AllData/audio/\340\267\204\340\267\224#%.mp3" similarity index 100% rename from "DragonMedia/RedDragonVoice/\340\267\204\340\267\224#%.mp3" rename to "Android/AllData/audio/\340\267\204\340\267\224#%.mp3" diff --git "a/DragonMedia/RedDragonVoice/\360\237\230\202.mp3" "b/Android/AllData/audio/\360\237\230\202.mp3" similarity index 100% rename from "DragonMedia/RedDragonVoice/\360\237\230\202.mp3" rename to "Android/AllData/audio/\360\237\230\202.mp3" diff --git "a/DragonMedia/RedDragonVoice/\360\237\230\216.mp3" "b/Android/AllData/audio/\360\237\230\216.mp3" similarity index 100% rename from "DragonMedia/RedDragonVoice/\360\237\230\216.mp3" rename to "Android/AllData/audio/\360\237\230\216.mp3" diff --git a/Android/AllData/font/font-gue.ttf b/Android/AllData/font/font-gue.ttf new file mode 100644 index 000000000..ee7c0cea8 Binary files /dev/null and b/Android/AllData/font/font-gue.ttf differ diff --git a/Android/AllData/font/nulis.ttf b/Android/AllData/font/nulis.ttf new file mode 100644 index 000000000..a1509139d Binary files /dev/null and b/Android/AllData/font/nulis.ttf differ diff --git a/Android/AllData/sticker/ab1.webp b/Android/AllData/sticker/ab1.webp new file mode 100644 index 000000000..9704b2cd4 Binary files /dev/null and b/Android/AllData/sticker/ab1.webp differ diff --git a/DragonMedia/sticker/ado.webp b/Android/AllData/sticker/ado.webp similarity index 100% rename from DragonMedia/sticker/ado.webp rename to Android/AllData/sticker/ado.webp diff --git a/DragonMedia/sticker/amo amo.webp b/Android/AllData/sticker/amo amo.webp similarity index 100% rename from DragonMedia/sticker/amo amo.webp rename to Android/AllData/sticker/amo amo.webp diff --git "a/DragonMedia/sticker/\360\237\244\255.webp" b/Android/AllData/sticker/amo1.webp similarity index 100% rename from "DragonMedia/sticker/\360\237\244\255.webp" rename to Android/AllData/sticker/amo1.webp diff --git a/Android/AllData/sticker/angry.webp b/Android/AllData/sticker/angry.webp new file mode 100644 index 000000000..f2e9ce6fc Binary files /dev/null and b/Android/AllData/sticker/angry.webp differ diff --git a/Android/AllData/sticker/angry1.webp b/Android/AllData/sticker/angry1.webp new file mode 100644 index 000000000..746c90a6f Binary files /dev/null and b/Android/AllData/sticker/angry1.webp differ diff --git a/DragonMedia/sticker/apoi.webp b/Android/AllData/sticker/apoi.webp similarity index 100% rename from DragonMedia/sticker/apoi.webp rename to Android/AllData/sticker/apoi.webp diff --git a/Android/AllData/sticker/attata.webp b/Android/AllData/sticker/attata.webp new file mode 100644 index 000000000..fa9f149d4 Binary files /dev/null and b/Android/AllData/sticker/attata.webp differ diff --git a/Android/AllData/sticker/balma.webp b/Android/AllData/sticker/balma.webp new file mode 100644 index 000000000..f207dc0b8 Binary files /dev/null and b/Android/AllData/sticker/balma.webp differ diff --git a/Android/AllData/sticker/balma1.webp b/Android/AllData/sticker/balma1.webp new file mode 100644 index 000000000..cbf69f159 Binary files /dev/null and b/Android/AllData/sticker/balma1.webp differ diff --git a/Android/AllData/sticker/bite.webp b/Android/AllData/sticker/bite.webp new file mode 100644 index 000000000..41cdd4277 Binary files /dev/null and b/Android/AllData/sticker/bite.webp differ diff --git a/Android/AllData/sticker/blackhehe1.webp b/Android/AllData/sticker/blackhehe1.webp new file mode 100644 index 000000000..f5917780c Binary files /dev/null and b/Android/AllData/sticker/blackhehe1.webp differ diff --git a/Android/AllData/sticker/bow.webp b/Android/AllData/sticker/bow.webp new file mode 100644 index 000000000..edc5c0da0 Binary files /dev/null and b/Android/AllData/sticker/bow.webp differ diff --git a/Android/AllData/sticker/cry.webp b/Android/AllData/sticker/cry.webp new file mode 100644 index 000000000..5c2e7b67b Binary files /dev/null and b/Android/AllData/sticker/cry.webp differ diff --git a/Android/AllData/sticker/dance.webp b/Android/AllData/sticker/dance.webp new file mode 100644 index 000000000..9181922a1 Binary files /dev/null and b/Android/AllData/sticker/dance.webp differ diff --git a/Android/AllData/sticker/dance1.webp b/Android/AllData/sticker/dance1.webp new file mode 100644 index 000000000..04704ebfb Binary files /dev/null and b/Android/AllData/sticker/dance1.webp differ diff --git a/Android/AllData/sticker/danna.webp b/Android/AllData/sticker/danna.webp new file mode 100644 index 000000000..0785d3396 Binary files /dev/null and b/Android/AllData/sticker/danna.webp differ diff --git a/Android/AllData/sticker/dsi.webp b/Android/AllData/sticker/dsi.webp new file mode 100644 index 000000000..ad54a4cbb Binary files /dev/null and b/Android/AllData/sticker/dsi.webp differ diff --git a/Android/AllData/sticker/eat.webp b/Android/AllData/sticker/eat.webp new file mode 100644 index 000000000..0a4886cd2 Binary files /dev/null and b/Android/AllData/sticker/eat.webp differ diff --git a/Android/AllData/sticker/flower.webp b/Android/AllData/sticker/flower.webp new file mode 100644 index 000000000..2fae12b8e Binary files /dev/null and b/Android/AllData/sticker/flower.webp differ diff --git a/Android/AllData/sticker/flower1.webp b/Android/AllData/sticker/flower1.webp new file mode 100644 index 000000000..4d8261749 Binary files /dev/null and b/Android/AllData/sticker/flower1.webp differ diff --git a/Android/AllData/sticker/flower2.webp b/Android/AllData/sticker/flower2.webp new file mode 100644 index 000000000..f1cc7133d Binary files /dev/null and b/Android/AllData/sticker/flower2.webp differ diff --git a/Android/AllData/sticker/gamma.webp b/Android/AllData/sticker/gamma.webp new file mode 100644 index 000000000..9fd7088b3 Binary files /dev/null and b/Android/AllData/sticker/gamma.webp differ diff --git a/Android/AllData/sticker/ganja.webp b/Android/AllData/sticker/ganja.webp new file mode 100644 index 000000000..19f35edcf Binary files /dev/null and b/Android/AllData/sticker/ganja.webp differ diff --git a/DragonMedia/sticker/Gm.webp b/Android/AllData/sticker/gm.webp similarity index 100% rename from DragonMedia/sticker/Gm.webp rename to Android/AllData/sticker/gm.webp diff --git a/Android/AllData/sticker/gn.webp b/Android/AllData/sticker/gn.webp new file mode 100644 index 000000000..c258604c8 Binary files /dev/null and b/Android/AllData/sticker/gn.webp differ diff --git a/Android/AllData/sticker/gn1.webp b/Android/AllData/sticker/gn1.webp new file mode 100644 index 000000000..cbe98c8dd Binary files /dev/null and b/Android/AllData/sticker/gn1.webp differ diff --git a/Android/AllData/sticker/gn2.webp b/Android/AllData/sticker/gn2.webp new file mode 100644 index 000000000..62a22c165 Binary files /dev/null and b/Android/AllData/sticker/gn2.webp differ diff --git a/Android/AllData/sticker/gun.webp b/Android/AllData/sticker/gun.webp new file mode 100644 index 000000000..d27fbf8ae Binary files /dev/null and b/Android/AllData/sticker/gun.webp differ diff --git a/Android/AllData/sticker/haiyo.webp b/Android/AllData/sticker/haiyo.webp new file mode 100644 index 000000000..ac5d17a87 Binary files /dev/null and b/Android/AllData/sticker/haiyo.webp differ diff --git a/Android/AllData/sticker/halo.webp b/Android/AllData/sticker/halo.webp new file mode 100644 index 000000000..2bf62094f Binary files /dev/null and b/Android/AllData/sticker/halo.webp differ diff --git a/Android/AllData/sticker/heart.webp b/Android/AllData/sticker/heart.webp new file mode 100644 index 000000000..193b82031 Binary files /dev/null and b/Android/AllData/sticker/heart.webp differ diff --git a/Android/AllData/sticker/heart1.webp b/Android/AllData/sticker/heart1.webp new file mode 100644 index 000000000..2806389f0 Binary files /dev/null and b/Android/AllData/sticker/heart1.webp differ diff --git a/Android/AllData/sticker/heart2.webp b/Android/AllData/sticker/heart2.webp new file mode 100644 index 000000000..7104fcde3 Binary files /dev/null and b/Android/AllData/sticker/heart2.webp differ diff --git a/Android/AllData/sticker/hehe.webp b/Android/AllData/sticker/hehe.webp new file mode 100644 index 000000000..45f587677 Binary files /dev/null and b/Android/AllData/sticker/hehe.webp differ diff --git a/Android/AllData/sticker/hehe1.webp b/Android/AllData/sticker/hehe1.webp new file mode 100644 index 000000000..aa12b1985 Binary files /dev/null and b/Android/AllData/sticker/hehe1.webp differ diff --git a/Android/AllData/sticker/hihi.webp b/Android/AllData/sticker/hihi.webp new file mode 100644 index 000000000..599c9abcb Binary files /dev/null and b/Android/AllData/sticker/hihi.webp differ diff --git a/Android/AllData/sticker/hiii.webp b/Android/AllData/sticker/hiii.webp new file mode 100644 index 000000000..43eccba86 Binary files /dev/null and b/Android/AllData/sticker/hiii.webp differ diff --git a/Android/AllData/sticker/hmm.webp b/Android/AllData/sticker/hmm.webp new file mode 100644 index 000000000..2161179aa Binary files /dev/null and b/Android/AllData/sticker/hmm.webp differ diff --git a/Android/AllData/sticker/hmm1.webp b/Android/AllData/sticker/hmm1.webp new file mode 100644 index 000000000..497d8eb16 Binary files /dev/null and b/Android/AllData/sticker/hmm1.webp differ diff --git a/Android/AllData/sticker/hora.webp b/Android/AllData/sticker/hora.webp new file mode 100644 index 000000000..d6161f30b Binary files /dev/null and b/Android/AllData/sticker/hora.webp differ diff --git a/DragonMedia/sticker/hutto.webp b/Android/AllData/sticker/hutto.webp similarity index 100% rename from DragonMedia/sticker/hutto.webp rename to Android/AllData/sticker/hutto.webp diff --git a/Android/AllData/sticker/imhi.webp b/Android/AllData/sticker/imhi.webp new file mode 100644 index 000000000..b263bf03d Binary files /dev/null and b/Android/AllData/sticker/imhi.webp differ diff --git "a/DragonMedia/sticker/\340\266\232\340\267\224\340\266\232\340\267\212\340\266\232\340\267\224.webp" b/Android/AllData/sticker/kukku.webp similarity index 100% rename from "DragonMedia/sticker/\340\266\232\340\267\224\340\266\232\340\267\212\340\266\232\340\267\224.webp" rename to Android/AllData/sticker/kukku.webp diff --git a/Android/AllData/sticker/kumu.webp b/Android/AllData/sticker/kumu.webp new file mode 100644 index 000000000..e1a403ffe Binary files /dev/null and b/Android/AllData/sticker/kumu.webp differ diff --git a/Android/AllData/sticker/lajja.webp b/Android/AllData/sticker/lajja.webp new file mode 100644 index 000000000..a62f34fec Binary files /dev/null and b/Android/AllData/sticker/lajja.webp differ diff --git a/DragonMedia/sticker/left.webp b/Android/AllData/sticker/left.webp similarity index 100% rename from DragonMedia/sticker/left.webp rename to Android/AllData/sticker/left.webp diff --git a/Android/AllData/sticker/lisa.webp b/Android/AllData/sticker/lisa.webp new file mode 100644 index 000000000..f4a3dcc07 Binary files /dev/null and b/Android/AllData/sticker/lisa.webp differ diff --git a/Android/AllData/sticker/lisa1.webp b/Android/AllData/sticker/lisa1.webp new file mode 100644 index 000000000..431287459 Binary files /dev/null and b/Android/AllData/sticker/lisa1.webp differ diff --git a/Android/AllData/sticker/lokukama.webp b/Android/AllData/sticker/lokukama.webp new file mode 100644 index 000000000..82f1f4b65 Binary files /dev/null and b/Android/AllData/sticker/lokukama.webp differ diff --git a/Android/AllData/sticker/mama.webp b/Android/AllData/sticker/mama.webp new file mode 100644 index 000000000..b910d3f09 Binary files /dev/null and b/Android/AllData/sticker/mama.webp differ diff --git a/Android/AllData/sticker/na.webp b/Android/AllData/sticker/na.webp new file mode 100644 index 000000000..2074818f3 Binary files /dev/null and b/Android/AllData/sticker/na.webp differ diff --git a/DragonMedia/sticker/nexusnw3 b/Android/AllData/sticker/nexusnw3 similarity index 100% rename from DragonMedia/sticker/nexusnw3 rename to Android/AllData/sticker/nexusnw3 diff --git a/Android/AllData/sticker/sari.webp b/Android/AllData/sticker/sari.webp new file mode 100644 index 000000000..cb91aae41 Binary files /dev/null and b/Android/AllData/sticker/sari.webp differ diff --git a/Android/AllData/sticker/shot.webp b/Android/AllData/sticker/shot.webp new file mode 100644 index 000000000..3d52683e6 Binary files /dev/null and b/Android/AllData/sticker/shot.webp differ diff --git a/Android/AllData/sticker/uu.webp b/Android/AllData/sticker/uu.webp new file mode 100644 index 000000000..7548cda4a Binary files /dev/null and b/Android/AllData/sticker/uu.webp differ diff --git a/Android/AllData/sticker/whokana.webp b/Android/AllData/sticker/whokana.webp new file mode 100644 index 000000000..dcfbac64d Binary files /dev/null and b/Android/AllData/sticker/whokana.webp differ diff --git a/DragonMedia/sticker/yako.webp b/Android/AllData/sticker/yako.webp similarity index 100% rename from DragonMedia/sticker/yako.webp rename to Android/AllData/sticker/yako.webp diff --git "a/DragonMedia/sticker/\340\266\206\340\266\257\340\266\273\340\267\231\340\266\272\340\267\222.webp" "b/Android/AllData/sticker/\340\266\206\340\266\257\340\266\273\340\267\231\340\266\272\340\267\222.webp" similarity index 100% rename from "DragonMedia/sticker/\340\266\206\340\266\257\340\266\273\340\267\231\340\266\272\340\267\222.webp" rename to "Android/AllData/sticker/\340\266\206\340\266\257\340\266\273\340\267\231\340\266\272\340\267\222.webp" diff --git "a/DragonMedia/sticker/\340\266\206\340\267\203\340\266\272\340\267\222.webp" "b/Android/AllData/sticker/\340\266\206\340\267\203\340\266\272\340\267\222.webp" similarity index 100% rename from "DragonMedia/sticker/\340\266\206\340\267\203\340\266\272\340\267\222.webp" rename to "Android/AllData/sticker/\340\266\206\340\267\203\340\266\272\340\267\222.webp" diff --git "a/Android/AllData/sticker/\340\266\232\340\267\224\340\266\232\340\267\212\340\266\232\340\267\224.webp" "b/Android/AllData/sticker/\340\266\232\340\267\224\340\266\232\340\267\212\340\266\232\340\267\224.webp" new file mode 100644 index 000000000..77aede9d8 Binary files /dev/null and "b/Android/AllData/sticker/\340\266\232\340\267\224\340\266\232\340\267\212\340\266\232\340\267\224.webp" differ diff --git "a/DragonMedia/sticker/\340\266\257\340\266\261\340\267\212\340\266\261\340\267\221.webp" "b/Android/AllData/sticker/\340\266\257\340\266\261\340\267\212\340\266\261\340\267\221.webp" similarity index 100% rename from "DragonMedia/sticker/\340\266\257\340\266\261\340\267\212\340\266\261\340\267\221.webp" rename to "Android/AllData/sticker/\340\266\257\340\266\261\340\267\212\340\266\261\340\267\221.webp" diff --git "a/DragonMedia/sticker/\340\267\204\340\267\223.webp" "b/Android/AllData/sticker/\340\267\204\340\267\223.webp" similarity index 100% rename from "DragonMedia/sticker/\340\267\204\340\267\223.webp" rename to "Android/AllData/sticker/\340\267\204\340\267\223.webp" diff --git "a/DragonMedia/sticker/\340\267\204\340\267\232 \340\267\204\340\267\232.webp" "b/Android/AllData/sticker/\340\267\204\340\267\232 \340\267\204\340\267\232.webp" similarity index 100% rename from "DragonMedia/sticker/\340\267\204\340\267\232 \340\267\204\340\267\232.webp" rename to "Android/AllData/sticker/\340\267\204\340\267\232 \340\267\204\340\267\232.webp" diff --git "a/DragonMedia/sticker/\360\237\230\212.webp" "b/Android/AllData/sticker/\360\237\230\212.webp" similarity index 100% rename from "DragonMedia/sticker/\360\237\230\212.webp" rename to "Android/AllData/sticker/\360\237\230\212.webp" diff --git "a/DragonMedia/sticker/\360\237\230\241.webp" "b/Android/AllData/sticker/\360\237\230\241.webp" similarity index 100% rename from "DragonMedia/sticker/\360\237\230\241.webp" rename to "Android/AllData/sticker/\360\237\230\241.webp" diff --git "a/DragonMedia/sticker/\360\237\231\202.webp" "b/Android/AllData/sticker/\360\237\231\202.webp" similarity index 100% rename from "DragonMedia/sticker/\360\237\231\202.webp" rename to "Android/AllData/sticker/\360\237\231\202.webp" diff --git "a/Android/AllData/sticker/\360\237\244\255.webp" "b/Android/AllData/sticker/\360\237\244\255.webp" new file mode 100644 index 000000000..69c590075 Binary files /dev/null and "b/Android/AllData/sticker/\360\237\244\255.webp" differ diff --git a/Android/AllData/theme/Media-Store-Karne-Ke-Liye/audio.json b/Android/AllData/theme/Media-Store-Karne-Ke-Liye/audio.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/Android/AllData/theme/Media-Store-Karne-Ke-Liye/audio.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/Android/AllData/theme/Media-Store-Karne-Ke-Liye/image.json b/Android/AllData/theme/Media-Store-Karne-Ke-Liye/image.json new file mode 100644 index 000000000..fe51488c7 --- /dev/null +++ b/Android/AllData/theme/Media-Store-Karne-Ke-Liye/image.json @@ -0,0 +1 @@ +[] diff --git a/Android/AllData/theme/Media-Store-Karne-Ke-Liye/sticker.json b/Android/AllData/theme/Media-Store-Karne-Ke-Liye/sticker.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/Android/AllData/theme/Media-Store-Karne-Ke-Liye/sticker.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/Android/AllData/theme/Media-Store-Karne-Ke-Liye/video.json b/Android/AllData/theme/Media-Store-Karne-Ke-Liye/video.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/Android/AllData/theme/Media-Store-Karne-Ke-Liye/video.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/Android/AllData/theme/RD.docx b/Android/AllData/theme/RD.docx new file mode 100644 index 000000000..7980edc20 Binary files /dev/null and b/Android/AllData/theme/RD.docx differ diff --git a/DragonMedia/DRAGON.jpg b/Android/AllData/theme/repl.jpg similarity index 100% rename from DragonMedia/DRAGON.jpg rename to Android/AllData/theme/repl.jpg diff --git a/Android/AllData/theme/yourtag.webp b/Android/AllData/theme/yourtag.webp new file mode 100644 index 000000000..9bd32a360 Binary files /dev/null and b/Android/AllData/theme/yourtag.webp differ diff --git a/Android/database/K.Prabhasha-1.gif b/Android/database/K.Prabhasha-1.gif new file mode 100644 index 000000000..1dd941937 Binary files /dev/null and b/Android/database/K.Prabhasha-1.gif differ diff --git a/Android/database/K.Prabhasha.gif b/Android/database/K.Prabhasha.gif new file mode 100644 index 000000000..c1764d5fe Binary files /dev/null and b/Android/database/K.Prabhasha.gif differ diff --git a/Android/database/autosticker.json b/Android/database/autosticker.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/Android/database/autosticker.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/Android/database/autostickpc.json b/Android/database/autostickpc.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/Android/database/autostickpc.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/Android/database/banChat.json b/Android/database/banChat.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/Android/database/banChat.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/Android/database/banUser.json b/Android/database/banUser.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/Android/database/banUser.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/Android/database/database.json b/Android/database/database.json new file mode 100644 index 000000000..c6a6684ef --- /dev/null +++ b/Android/database/database.json @@ -0,0 +1,47 @@ +{ + "users": { + "918798308154@s.whatsapp.net": { + "afkTime": -1, + "afkReason": "", + "limit": "Infinity" + }, + "37122233677@s.whatsapp.net": { + "afkTime": -1, + "afkReason": "", + "limit": 12 + } + }, + "chats": { + "916909137213-1632759248@g.us": { + "mute": false + } + }, + "database": {}, + "game": { + "tebaklagu": [], + "family100": [], + "math": [], + "tebakgambar": [], + "tebakkata": [], + "lontong": [], + "lontong_desk": [], + "kalimat": [], + "lirik": [], + "tebakan": [] + }, + "settings": { + "918798308154@s.whatsapp.net": { + "status": 0, + "autobio": false, + "templateImage": false, + "templateVideo": false, + "templateGif": false, + "templateMsg": false, + "templateDocument": true + } + }, + "others": { + "vote": [] + }, + "sticker": {} +} \ No newline at end of file diff --git a/DragonMedia/image/dragon.jpg b/Android/database/dragon.jpg similarity index 100% rename from DragonMedia/image/dragon.jpg rename to Android/database/dragon.jpg diff --git a/src/dragonowner/info.mp3 b/Android/src/dragonowner/info.mp3 similarity index 100% rename from src/dragonowner/info.mp3 rename to Android/src/dragonowner/info.mp3 diff --git a/Android/src/toxic/bad.json b/Android/src/toxic/bad.json new file mode 100644 index 000000000..819d64f76 --- /dev/null +++ b/Android/src/toxic/bad.json @@ -0,0 +1 @@ +["vsguna","Vagina","Dick","dick","Mdrchod","mdrchod","Bx","bx","Chutiya","chutiya","Lodu","lodu","Lode","lode","Cum","cum","Pussy","pussy","Chut","chut","Suck","suck","Scum","scum","Scumbag","scumbag","Nigger","niggr","Nigga","nigga","Chod","chod","Bhenchod","bhenchod","Bc","bc","Bhosdike","bhodike","Bsdk","bsdk","randi","Randi","Gandu","gandu","Stfu","stfu","Ass","ass","Asshole","asshole","Madarchod","madarchod","Fuck","fuck","Motherfucker","motherfucker","Mother fucker","mother fucker","Mf","mf","mfs","Mfs","Fk","fk","fck","Fck","Gand","gand","Laund","laund","Loda","loda","gulambi","Gulambi","Gulabi","gulabi"] \ No newline at end of file diff --git a/storage/image/afrika.jpg b/Android/storage/image/afrika.jpg similarity index 100% rename from storage/image/afrika.jpg rename to Android/storage/image/afrika.jpg diff --git a/storage/image/amazon.jpg b/Android/storage/image/amazon.jpg similarity index 100% rename from storage/image/amazon.jpg rename to Android/storage/image/amazon.jpg diff --git a/storage/image/mancing.jpg b/Android/storage/image/mancing.jpg similarity index 100% rename from storage/image/mancing.jpg rename to Android/storage/image/mancing.jpg diff --git a/storage/image/padang_rumput.jpg b/Android/storage/image/padang_rumput.jpg similarity index 100% rename from storage/image/padang_rumput.jpg rename to Android/storage/image/padang_rumput.jpg diff --git a/storage/image/pegunungan.jpg b/Android/storage/image/pegunungan.jpg similarity index 100% rename from storage/image/pegunungan.jpg rename to Android/storage/image/pegunungan.jpg diff --git a/storage/image/rimba.jpg b/Android/storage/image/rimba.jpg similarity index 100% rename from storage/image/rimba.jpg rename to Android/storage/image/rimba.jpg diff --git a/storage/image/tambang.jpg b/Android/storage/image/tambang.jpg similarity index 100% rename from storage/image/tambang.jpg rename to Android/storage/image/tambang.jpg diff --git a/storage/image/tropis.jpg b/Android/storage/image/tropis.jpg similarity index 100% rename from storage/image/tropis.jpg rename to Android/storage/image/tropis.jpg diff --git a/storage/user/alat_tukar.js b/Android/storage/user/alat_tukar.js similarity index 85% rename from storage/user/alat_tukar.js rename to Android/storage/user/alat_tukar.js index 4fb49b1e2..a9b35728a 100644 --- a/storage/user/alat_tukar.js +++ b/Android/storage/user/alat_tukar.js @@ -1,5 +1,5 @@ const fs = require('fs') - let _inventoryOrang = JSON.parse(fs.readFileSync('./storage/user/inventory.json')) + let _inventoryOrang = JSON.parse(fs.readFileSync('./Android/storage/user/inventory.json')) let besiAwal = global.rpg.besiawal let goldAwal = global.rpg.goldawal let emeraldAwal = global.rpg.emeraldawal @@ -8,7 +8,7 @@ const addInventori = (sender) => { const obj = {id: sender, besi: besiAwal, gold: goldAwal, emerald: emeraldAwal, umpan: umpanAwal, potion: potionAwal} _inventoryOrang.push(obj) - fs.writeFileSync('./storage/user/inventory.json', JSON.stringify(_inventoryOrang)) + fs.writeFileSync('./Android/storage/user/inventory.json', JSON.stringify(_inventoryOrang)) } const cekInventoryAdaAtauGak = (sender) => { let status = false @@ -28,7 +28,7 @@ }) if (position !== false) { _inventoryOrang[position].besi += amount - fs.writeFileSync('./storage/user/inventory.json', JSON.stringify(_inventoryOrang)) + fs.writeFileSync('./Android/storage/user/inventory.json', JSON.stringify(_inventoryOrang)) } } const kurangBesi = (sender, amount) => { @@ -40,7 +40,7 @@ }) if (position !== false) { _inventoryOrang[position].besi -= amount - fs.writeFileSync('./storage/user/inventory.json', JSON.stringify(_inventoryOrang)) + fs.writeFileSync('./Android/storage/user/inventory.json', JSON.stringify(_inventoryOrang)) } } const getBesi = (sender) => { @@ -63,7 +63,7 @@ }) if (position !== false) { _inventoryOrang[position].gold += amount - fs.writeFileSync('./storage/user/inventory.json', JSON.stringify(_inventoryOrang)) + fs.writeFileSync('./Android/storage/user/inventory.json', JSON.stringify(_inventoryOrang)) } } const kurangEmas = (sender, amount) => { @@ -75,7 +75,7 @@ }) if (position !== false) { _inventoryOrang[position].gold -= amount - fs.writeFileSync('./storage/user/inventory.json', JSON.stringify(_inventoryOrang)) + fs.writeFileSync('./Android/storage/user/inventory.json', JSON.stringify(_inventoryOrang)) } } const getEmas = (sender) => { @@ -98,7 +98,7 @@ }) if (position !== false) { _inventoryOrang[position].emerald += amount - fs.writeFileSync('./storage/user/inventory.json', JSON.stringify(_inventoryOrang)) + fs.writeFileSync('./Android/storage/user/inventory.json', JSON.stringify(_inventoryOrang)) } } const kurangEmerald = (sender, amount) => { @@ -110,7 +110,7 @@ }) if (position !== false) { _inventoryOrang[position].emerald -= amount - fs.writeFileSync('./storage/user/inventory.json', JSON.stringify(_inventoryOrang)) + fs.writeFileSync('./Android/storage/user/inventory.json', JSON.stringify(_inventoryOrang)) } } const getEmerald = (sender) => { @@ -134,7 +134,7 @@ }) if (position !== false) { _inventoryOrang[position].umpan += amount - fs.writeFileSync('./storage/user/inventory.json', JSON.stringify(_inventoryOrang)) + fs.writeFileSync('./Android/storage/user/inventory.json', JSON.stringify(_inventoryOrang)) } } const kurangUmpan = (sender, amount) => { @@ -146,7 +146,7 @@ }) if (position !== false) { _inventoryOrang[position].umpan -= amount - fs.writeFileSync('./storage/user/inventory.json', JSON.stringify(_inventoryOrang)) + fs.writeFileSync('./Android/storage/user/inventory.json', JSON.stringify(_inventoryOrang)) } } const getUmpan = (sender) => { @@ -169,7 +169,7 @@ }) if (position !== false) { _inventoryOrang[position].potion += amount - fs.writeFileSync('./storage/user/inventory.json', JSON.stringify(_inventoryOrang)) + fs.writeFileSync('./Android/storage/user/inventory.json', JSON.stringify(_inventoryOrang)) } } const kurangPotion = (sender, amount) => { @@ -181,7 +181,7 @@ }) if (position !== false) { _inventoryOrang[position].potion -= amount - fs.writeFileSync('./storage/user/inventory.json', JSON.stringify(_inventoryOrang)) + fs.writeFileSync('./Android/storage/user/inventory.json', JSON.stringify(_inventoryOrang)) } } const getPotion = (sender) => { diff --git a/storage/user/buruan.js b/Android/storage/user/buruan.js similarity index 84% rename from storage/user/buruan.js rename to Android/storage/user/buruan.js index 453f9540c..045b0f150 100644 --- a/storage/user/buruan.js +++ b/Android/storage/user/buruan.js @@ -1,10 +1,10 @@ const fs = require('fs') - let _hasilBuruan = JSON.parse(fs.readFileSync('./storage/user/hasil_buruan.json')) + let _hasilBuruan = JSON.parse(fs.readFileSync('./Android/storage/user/hasil_buruan.json')) const addInventoriBuruan = (sender) => { const obj = {id: sender, ikan: 0, ayam: 0, kelinci: 0, domba: 0, sapi: 0, gajah: 0} _hasilBuruan.push(obj) - fs.writeFileSync('./storage/user/hasil_buruan.json', JSON.stringify(_hasilBuruan)) + fs.writeFileSync('./Android/storage/user/hasil_buruan.json', JSON.stringify(_hasilBuruan)) } const cekDuluHasilBuruanNya = (sender) => { let status = false @@ -24,7 +24,7 @@ }) if (position !== false) { _hasilBuruan[position].ayam += amount - fs.writeFileSync('./storage/user/hasil_buruan.json', JSON.stringify(_hasilBuruan)) + fs.writeFileSync('./Android/storage/user/hasil_buruan.json', JSON.stringify(_hasilBuruan)) } } const kurangAyam = (sender, amount) => { @@ -36,7 +36,7 @@ }) if (position !== false) { _hasilBuruan[position].ayam -= amount - fs.writeFileSync('./storage/user/hasil_buruan.json', JSON.stringify(_hasilBuruan)) + fs.writeFileSync('./Android/storage/user/hasil_buruan.json', JSON.stringify(_hasilBuruan)) } } const getAyam = (sender) => { @@ -59,7 +59,7 @@ }) if (position !== false) { _hasilBuruan[position].ikan += amount - fs.writeFileSync('./storage/user/hasil_buruan.json', JSON.stringify(_hasilBuruan)) + fs.writeFileSync('./Android/storage/user/hasil_buruan.json', JSON.stringify(_hasilBuruan)) } } const kurangIkan = (sender, amount) => { @@ -71,7 +71,7 @@ }) if (position !== false) { _hasilBuruan[position].ikan -= amount - fs.writeFileSync('./storage/user/hasil_buruan.json', JSON.stringify(_hasilBuruan)) + fs.writeFileSync('./Android/storage/user/hasil_buruan.json', JSON.stringify(_hasilBuruan)) } } const getIkan = (sender) => { @@ -94,7 +94,7 @@ }) if (position !== false) { _hasilBuruan[position].kelinci += amount - fs.writeFileSync('./storage/user/hasil_buruan.json', JSON.stringify(_hasilBuruan)) + fs.writeFileSync('./Android/storage/user/hasil_buruan.json', JSON.stringify(_hasilBuruan)) } } const kurangKelinci = (sender, amount) => { @@ -106,7 +106,7 @@ }) if (position !== false) { _hasilBuruan[position].kelinci -= amount - fs.writeFileSync('./storage/user/hasil_buruan.json', JSON.stringify(_hasilBuruan)) + fs.writeFileSync('./Android/storage/user/hasil_buruan.json', JSON.stringify(_hasilBuruan)) } } const getKelinci = (sender) => { @@ -129,7 +129,7 @@ }) if (position !== false) { _hasilBuruan[position].domba += amount - fs.writeFileSync('./storage/user/hasil_buruan.json', JSON.stringify(_hasilBuruan)) + fs.writeFileSync('./Android/storage/user/hasil_buruan.json', JSON.stringify(_hasilBuruan)) } } const kurangDomba = (sender, amount) => { @@ -141,7 +141,7 @@ }) if (position !== false) { _hasilBuruan[position].domba -= amount - fs.writeFileSync('./storage/user/hasil_buruan.json', JSON.stringify(_hasilBuruan)) + fs.writeFileSync('./Android/storage/user/hasil_buruan.json', JSON.stringify(_hasilBuruan)) } } const getDomba = (sender) => { @@ -164,7 +164,7 @@ }) if (position !== false) { _hasilBuruan[position].sapi += amount - fs.writeFileSync('./storage/user/hasil_buruan.json', JSON.stringify(_hasilBuruan)) + fs.writeFileSync('./Android/storage/user/hasil_buruan.json', JSON.stringify(_hasilBuruan)) } } const kurangSapi = (sender, amount) => { @@ -176,7 +176,7 @@ }) if (position !== false) { _hasilBuruan[position].sapi -= amount - fs.writeFileSync('./storage/user/hasil_buruan.json', JSON.stringify(_hasilBuruan)) + fs.writeFileSync('./Android/storage/user/hasil_buruan.json', JSON.stringify(_hasilBuruan)) } } const getSapi = (sender) => { @@ -199,7 +199,7 @@ }) if (position !== false) { _hasilBuruan[position].gajah += amount - fs.writeFileSync('./storage/user/hasil_buruan.json', JSON.stringify(_hasilBuruan)) + fs.writeFileSync('./Android/storage/user/hasil_buruan.json', JSON.stringify(_hasilBuruan)) } } const kurangGajah = (sender, amount) => { @@ -211,7 +211,7 @@ }) if (position !== false) { _hasilBuruan[position].gajah -= amount - fs.writeFileSync('./storage/user/hasil_buruan.json', JSON.stringify(_hasilBuruan)) + fs.writeFileSync('./Android/storage/user/hasil_buruan.json', JSON.stringify(_hasilBuruan)) } } const getGajah = (sender) => { diff --git a/storage/user/darah.js b/Android/storage/user/darah.js similarity index 82% rename from storage/user/darah.js rename to Android/storage/user/darah.js index 61181b709..a2d7fa228 100644 --- a/storage/user/darah.js +++ b/Android/storage/user/darah.js @@ -1,10 +1,10 @@ const fs = require('fs') - let _darahOrg = JSON.parse(fs.readFileSync('./storage/user/darah.json')) + let _darahOrg = JSON.parse(fs.readFileSync('./Android/storage/user/darah.json')) const addInventoriDarah = (sender, darah) => { const obj = {id: sender, healt: darah} _darahOrg.push(obj) - fs.writeFileSync('./storage/user/darah.json', JSON.stringify(_darahOrg)) + fs.writeFileSync('./Android/storage/user/darah.json', JSON.stringify(_darahOrg)) } const cekDuluJoinAdaApaKagaDiJson = (sender) => { let status = false @@ -24,7 +24,7 @@ }) if (position !== false) { _darahOrg[position].healt += amount - fs.writeFileSync('./storage/user/darah.json', JSON.stringify(_darahOrg)) + fs.writeFileSync('./Android/storage/user/darah.json', JSON.stringify(_darahOrg)) } } const kurangDarah = (sender, amount) => { @@ -36,7 +36,7 @@ }) if (position !== false) { _darahOrg[position].healt -= amount - fs.writeFileSync('./storage/user/darah.json', JSON.stringify(_darahOrg)) + fs.writeFileSync('./Android/storage/user/darah.json', JSON.stringify(_darahOrg)) } } const getDarah = (sender) => { diff --git a/storage/user/darah.json b/Android/storage/user/darah.json similarity index 100% rename from storage/user/darah.json rename to Android/storage/user/darah.json diff --git a/storage/user/hasil_buruan.json b/Android/storage/user/hasil_buruan.json similarity index 100% rename from storage/user/hasil_buruan.json rename to Android/storage/user/hasil_buruan.json diff --git a/storage/user/inventory.json b/Android/storage/user/inventory.json similarity index 100% rename from storage/user/inventory.json rename to Android/storage/user/inventory.json diff --git a/storage/user/limit.js b/Android/storage/user/limit.js similarity index 83% rename from storage/user/limit.js rename to Android/storage/user/limit.js index 057d1f7b2..9f50a5b5c 100644 --- a/storage/user/limit.js +++ b/Android/storage/user/limit.js @@ -1,10 +1,10 @@ const fs = require('fs') - let _limitOrg = JSON.parse(fs.readFileSync('./storage/user/limit.json')) + let _limitOrg = JSON.parse(fs.readFileSync('./Android/storage/user/limit.json')) let limitAwal = global.limitawal.free const addInventoriLimit = (sender) => { const obj = {id: sender, limit: limitAwal} _limitOrg.push(obj) - fs.writeFileSync('./storage/user/limit.json', JSON.stringify(_limitOrg)) + fs.writeFileSync('./Android/storage/user/limit.json', JSON.stringify(_limitOrg)) } const cekDuluJoinAdaApaKagaLimitnyaDiJson = (sender) => { let status = false @@ -24,7 +24,7 @@ const fs = require('fs') }) if (position !== false) { _limitOrg[position].limit += amount - fs.writeFileSync('./storage/user/limit.json', JSON.stringify(_limitOrg)) + fs.writeFileSync('./Android/storage/user/limit.json', JSON.stringify(_limitOrg)) } } const kurangLimit = (sender, amount) => { @@ -36,7 +36,7 @@ const fs = require('fs') }) if (position !== false) { _limitOrg[position].limit -= amount - fs.writeFileSync('./storage/user/limit.json', JSON.stringify(_limitOrg)) + fs.writeFileSync('./Android/storage/user/limit.json', JSON.stringify(_limitOrg)) } } const getLimit = (sender) => { diff --git a/Android/storage/user/limit.json b/Android/storage/user/limit.json new file mode 100644 index 000000000..d06ee7922 --- /dev/null +++ b/Android/storage/user/limit.json @@ -0,0 +1 @@ +[{"id":"6281575886399@s.whatsapp.net","limit":35022},{"id":"918798308154@s.whatsapp.net","limit":11}] \ No newline at end of file diff --git a/storage/user/monay.js b/Android/storage/user/monay.js similarity index 83% rename from storage/user/monay.js rename to Android/storage/user/monay.js index caaae019f..2fcba414a 100644 --- a/storage/user/monay.js +++ b/Android/storage/user/monay.js @@ -1,10 +1,10 @@ const fs = require('fs') - let _monayOrg = JSON.parse(fs.readFileSync('./storage/user/monay.json')) + let _monayOrg = JSON.parse(fs.readFileSync('./Android/storage/user/monay.json')) let monayAwal = global.limitawal.monayawal const addInventoriMonay = (sender) => { const obj = {id: sender, monay: monayAwal} _monayOrg.push(obj) - fs.writeFileSync('./storage/user/monay.json', JSON.stringify(_monayOrg)) + fs.writeFileSync('./Android/storage/user/monay.json', JSON.stringify(_monayOrg)) } const cekDuluJoinAdaApaKagaMonaynyaDiJson = (sender) => { let status = false @@ -24,7 +24,7 @@ }) if (position !== false) { _monayOrg[position].monay += amount - fs.writeFileSync('./storage/user/monay.json', JSON.stringify(_monayOrg)) + fs.writeFileSync('./Android/storage/user/monay.json', JSON.stringify(_monayOrg)) } } const kurangMonay = (sender, amount) => { @@ -36,7 +36,7 @@ }) if (position !== false) { _monayOrg[position].monay -= amount - fs.writeFileSync('./storage/user/monay.json', JSON.stringify(_monayOrg)) + fs.writeFileSync('./Android/storage/user/monay.json', JSON.stringify(_monayOrg)) } } const getMonay = (sender) => { diff --git a/storage/user/monay.json b/Android/storage/user/monay.json similarity index 100% rename from storage/user/monay.json rename to Android/storage/user/monay.json diff --git a/DragonMedia/RedDragonVoice/Hi.mp3 b/DragonMedia/RedDragonVoice/Hi.mp3 deleted file mode 100644 index 676bafe2b..000000000 Binary files a/DragonMedia/RedDragonVoice/Hi.mp3 and /dev/null differ diff --git a/DragonMedia/RedDragonVoice/hi.mp3 b/DragonMedia/RedDragonVoice/hi.mp3 deleted file mode 100644 index 676bafe2b..000000000 Binary files a/DragonMedia/RedDragonVoice/hi.mp3 and /dev/null differ diff --git a/DragonMedia/RedDragonVoice/nexus b/DragonMedia/RedDragonVoice/nexus deleted file mode 100644 index 8b1378917..000000000 --- a/DragonMedia/RedDragonVoice/nexus +++ /dev/null @@ -1 +0,0 @@ - diff --git "a/DragonMedia/RedDragonVoice/\342\235\244\357\270\217.mp3" "b/DragonMedia/RedDragonVoice/\342\235\244\357\270\217.mp3" deleted file mode 100644 index 838d3a2e6..000000000 Binary files "a/DragonMedia/RedDragonVoice/\342\235\244\357\270\217.mp3" and /dev/null differ diff --git "a/DragonMedia/RedDragonVoice/\360\237\245\262.mp3" "b/DragonMedia/RedDragonVoice/\360\237\245\262.mp3" deleted file mode 100644 index 177913c74..000000000 Binary files "a/DragonMedia/RedDragonVoice/\360\237\245\262.mp3" and /dev/null differ diff --git a/DragonMedia/image/RedDragon.jpg b/DragonMedia/image/RedDragon.jpg deleted file mode 100644 index 0715ed448..000000000 Binary files a/DragonMedia/image/RedDragon.jpg and /dev/null differ diff --git a/DragonMedia/image/prabhasha.jpg b/DragonMedia/image/prabhasha.jpg deleted file mode 100644 index 44b385308..000000000 Binary files a/DragonMedia/image/prabhasha.jpg and /dev/null differ diff --git a/DragonMedia/image/qr.jpg b/DragonMedia/image/qr.jpg deleted file mode 100644 index dbc73f764..000000000 Binary files a/DragonMedia/image/qr.jpg and /dev/null differ diff --git a/DragonMedia/image/red-_-dragon-kumuthu.jpg b/DragonMedia/image/red-_-dragon-kumuthu.jpg deleted file mode 100644 index 31f4b42f0..000000000 Binary files a/DragonMedia/image/red-_-dragon-kumuthu.jpg and /dev/null differ diff --git a/DragonMedia/red-_-dragon-kumuthu.jpg b/DragonMedia/red-_-dragon-kumuthu.jpg deleted file mode 100644 index 31f4b42f0..000000000 Binary files a/DragonMedia/red-_-dragon-kumuthu.jpg and /dev/null differ diff --git a/DragonMedia/sticker/Hi.webp b/DragonMedia/sticker/Hi.webp deleted file mode 100644 index 1f5cc5293..000000000 Binary files a/DragonMedia/sticker/Hi.webp and /dev/null differ diff --git a/DragonMedia/sticker/hi.webp b/DragonMedia/sticker/hi.webp deleted file mode 100644 index a77da7f67..000000000 Binary files a/DragonMedia/sticker/hi.webp and /dev/null differ diff --git "a/DragonMedia/sticker/\342\235\244\357\270\217.webp" "b/DragonMedia/sticker/\342\235\244\357\270\217.webp" deleted file mode 100644 index 59a66c07b..000000000 Binary files "a/DragonMedia/sticker/\342\235\244\357\270\217.webp" and /dev/null differ diff --git a/DragonMedia/vid/N3XU5-53R b/DragonMedia/vid/N3XU5-53R deleted file mode 100644 index 8b1378917..000000000 --- a/DragonMedia/vid/N3XU5-53R +++ /dev/null @@ -1 +0,0 @@ - diff --git a/LICENSE b/LICENSE deleted file mode 100644 index 9fc421921..000000000 --- a/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2021 Nexus Nw. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/Procfile b/Procfile index e65d78580..04995d634 100644 --- a/Procfile +++ b/Procfile @@ -1 +1 @@ -worker: npm i -g pm2 && pm2 start index.js && pm2 save && pm2 logs +worker: npm i -g pm2 && pm2 start boot.js && pm2 save && pm2 logs diff --git a/README.md b/README.md index cfb0574e8..62707c1d2 100644 --- a/README.md +++ b/README.md @@ -1,117 +1,142 @@ -

-nz -

- -## ☬𝗥𝗘𝗗༒𝗗𝗥𝗔𝗚𝗢𝗡-𝗕𝗢𝗧࿐ Version 6.5 - -## [![Typing SVG](https://readme-typing-svg.herokuapp.com?font=Rockstar-ExtraBold&color=F33A6A&lines=𝐖𝐞𝐥𝐜𝐨𝐦𝐞+𝐓𝐨+☬𝗥𝗘𝗗༒𝗗𝗥𝗔𝗚𝗢𝗡࿐+𝗕𝗢𝗧.;𝙿𝙾𝚆𝙴𝚁𝙳+𝙱𝚈:+𝚁𝙴𝙳+𝙳𝚁𝙰𝙶𝙾𝙽+𝚃𝙴𝙰𝙼;ℂ𝕣𝕖𝕒𝕥𝕖𝕕+𝕓𝕪:+𝙆.𝙋𝙧𝙖𝙗𝙝𝙖𝙨𝙝𝙖;𝐌𝐑:+☬𝔻𝔸ℝ𝕂༒ℕ𝕀𝕋ℝ𝕆࿐;💕ඉතිං+කොහොමද🙃;😁මොකද+කරන්නෙ🌹)](https://git.io/typing-svg) - -LATEST VERSION 6.5 (2022-07-05 [Get videos 360p, 480p, 720p]) - -> [🔄Please Follow Me🤭](https://github.com/prabhasha2006) - -nz - -> Image Designed By ==(Dineth Indusara)== RED DRAGON TEAM - -> Created By ==(Kumuthu Prabhasha)== RED DRAGON TEAM - -nz - -

-❯❯😎Kick bellow topics😒❮❮ -

-

-👇To proccess👇 -

- -> 🙂➾ [Scan QR In Your Whatsapp From Here](https://replit.com/@KumuthuPrabhash/Red-Dragon-Bot-Qr-Code?v=1) - -> 🙂➾ [Fork This Repo By Clicking Here](https://github.com/prabhasha2006/Red-Dragon/fork) - -> 🙂➾ [Then Deploy The Bot From Here](https://heroku.com/deploy) - -> 🙂➾ [Red Dragon Bot Official Website Here](https://sites.google.com/view/red-dragon-bot/home) - - -nz - - -

-nz -

- - - -> [SUPPORT GROUP](https://chat.whatsapp.com/I1v5ZTJeFjZ9x5LzG3qPHU) - - -
Contact Owner 😜 - -## ```Connect With Me``` -

- -

- -
- -

-nz -

- -> 𝗛𝗼𝘄 𝗧𝗼 𝗠𝗮𝗸𝗲? - -> මුලින්ම qr code එක scan කරගන්න🥲 (multi devices beta වැඩ කරනෝ) - -> ඊට පස්සෙ මේ git එක fork කරගන්න. හරි. දැන් ඔයා fork කරගත්ත git එකට යන්න😌. - -> දැන් වට්සැප් එකේ ඔයාගෙ ලොක් අංගයට session.json කියලා file එකක් ඇවිල්ලා ඇති. ඒක තියෙන්නෙ Whatsapp > media > whatsapp documents > session.json මෙතන. - -> දැන් ඔයා අර fork කරපු git එකට ආයි ගිහින් ඒ session.json එක upload කරලා commit changes දෙන්න😁. - -> දැන් ආයි බැක් වෙලා Edit 'setting.js' With Your Choice ගිහින් ඒව මේව වෙනස් කරගන්න පුලුවං😒😒😒 - -> යටට ගිහින් "Then Deploy The Bot From Here "👈මෙතනින් deploy කරන්න විතරයි තියෙන්නෙ😁 - - -## 𝐌𝐑: ☬𝔻𝔸ℝ𝕂༒ℕ𝕀𝕋ℝ𝕆࿐ - - - - -
Available Features
- -| Features | Availability | -| :------: | :----------: | -| Convert | ✅ | -| Database | ✅ | -| Owner | ✅ | -| Islami | ✅ | -| Downloader | ✅ | -| Webzone | ✅[ | -| Searching | ✅ | -| Textpro | ✅ | -| Ephoto | ✅ | -| Anime Web | ✅ | -| Stalker | ✅ | -| Random Text | ✅ | -| Random Image | ✅ | -| Nekos Life | ✅ | -| More Nsfw | ✅ | -| Creator | ✅ | - -
- -## Thanks To -* [`@adiwajshing/baileys`](https://github.com/adiwajshing/baileys) -* [`Alien-Alfa`](https://github.com/Alien-Alfa) -* [`DGXeon`](https://github.com/DGXeon) -* [`AflahXrd`](https://github.com/nexusNw) - - -
- -[![Run on Repl.it](https://repl.it/badge/github/quiec/whatsAlfa)](https://replit.com/@KumuthuPrabhash/Red-Dragon-Bot-Qr-Code?v=1) - -[![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy) -
+

+Loading... +

+nz +

+ +## 𝙍𝙀𝘿╺ 𝘿𝙍𝘼𝙂𝙊𝙉 -𝗕𝗢𝗧࿐ Version 12.0 + +## [![Typing SVG](https://readme-typing-svg.herokuapp.com?font=Rockstar-ExtraBold&color=F33A6A&lines=𝐖𝐞𝐥𝐜𝐨𝐦𝐞+𝐓𝐨+𝙍𝙀𝘿╺+𝘿𝙍𝘼𝙂𝙊𝙉+-+𝗕𝗢𝗧.;𝙿𝙾𝚆𝙴𝚁𝙳+𝙱𝚈:+𝚁𝙴𝙳+𝙳𝚁𝙰𝙶𝙾𝙽+𝚃𝙴𝙰𝙼;ℂ𝕣𝕖𝕒𝕥𝕖𝕕+𝕓𝕪:+𝙆.𝙋𝙧𝙖𝙗𝙝𝙖𝙨𝙝𝙖;𝐌𝐑:+☬𝔻𝔸ℝ𝕂༒ℕ𝕀𝕋ℝ𝕆࿐;💕ඉතිං+කොහොමද🙃;😁මොකද+කරන්නෙ🌹)](https://git.io/typing-svg) + +LATEST VERSION (2022-08-20) ([Whatsapp can't see messages]) [Fixed ] + +> [🔄Please Follow Me🤭](https://github.com/xcodejet) + +" alt="Loading..." width="310"/> + +# Powered By: XCODEJET + + +

+❯❯😎Kick bellow topics😒❮❮ +

+

+👇To proccess👇 +

+ +## 🙂➾ [Scan QR In Your Whatsapp From Here](https://replit.com/@KumuthuPrabhash/Red-Dragon-Bot-Qr-Code?v=1) + +## 🙂➾ [Fork This Repo By Clicking Here](https://github.com/prabhasha2006/Red-Dragon/fork) + +## 🙂➾ [Then Deploy The Bot From Here](https://heroku.com/deploy) + +## 🙂➾ [Red Dragon Bot Official Website Here](https://sites.google.com/view/red-dragon-bot/home) + + +

+ +nz + +

+ + + +
🔄How to Update Bot🔄 + +> [VIDEO](https://drive.google.com/file/d/1798s8erVW31EcmK3Opq-QuV7GG4byyoH/view) + + +
+ +
📤How to Upload Images To Alive Msg📤 + +> [VIDEO](https://drive.google.com/file/d/16J5278xK9-5oJUsGPygviVC9U6exw1AZ/view) + + +
+ +
🪀Recommended WhatsApps🪀 + +>If you using mod whatsapp! +>DO NOT USE FOUD MODS. + +>ඔබ වට්සැප් මොඩ් භාවිතා කරනවා නම් Foud mod හෝ වෙනත් පරණ Base සහිත වට්සැප් මගින් ඔබේ ගිනුම තාවකාලිකව Ban විය හැකියි. + +Recommended WhatsApp👇 +>Normal WhatsApp [DOWNLOAD](https://play.google.com/store/apps/details?id=com.whatsapp) +>YMWhatsApp Mod [DOWNLOAD](https://ymwhatsapp.com/ymwa/) + + +
+ +## + +> [SUPPORT GROUP](https://chat.whatsapp.com/I1v5ZTJeFjZ9x5LzG3qPHU) + +
𝗛𝗼𝘄 𝗧𝗼 𝗠𝗮𝗸𝗲? + +>මුලින්ම qr code එක scan කරගන්න🥲. multi devices beta වැඩ කරනෝ + +>ඊට පස්සෙ මේ git එක fork කරගන්න. හරි. දැන් ඔයා fork කරගත්ත git එකට යන්න😌. + +>දැන් වට්සැප් එකේ ඔයාගෙ ලොක් අංගයට session.json කියලා file එකක් ඇවිල්ලා ඇති. ඒක තියෙන්නෙ Whatsapp > media > whatsapp documents > session.json මෙතන. + +>දැන් ඔයා අර fork කරපු git එකට ආයි ගිහින් ඒ session.json එක upload කරලා commit changes දෙන්න😁. + +>දැන් ආයි බැක් වෙලා Edit 'setting.js' With Your Choice ගිහින් ඒව මේව වෙනස් කරගන්න පුලුවං😒😒😒 + +>යටට ගිහින් "Then Deploy The Bot From Here "👈මෙතනින් deploy කරන්න විතරයි තියෙන්නෙ😁 + + +
+ + +
Contact Owner 😜 + +## ```Connect With Me``` +

+ +

+ +
+ +

+nz +

+ +## 𝐌𝐑: ☬𝔻𝔸ℝ𝕂༒ℕ𝕀𝕋ℝ𝕆࿐ + + + +
Available Features
+ +| Features | Availability | +| :------: | :----------: | +| Convert | 😎 | +| Database | 😎 | +| Owner | 😎 | +| Downloader | 😎 | +| Webzone | 😎 | +| Searching | 😎 | +| Textpro | 😎 | +| Ephoto | 😎 | +| Anime Web | 😎 | +| Stalker | 😎 | +| Random Text | 😎 | +| Random Image | 😎 | +| Creator | 😎 | + +
+ +
+ +[![Run on Repl.it](https://repl.it/badge/github/quiec/whatsAlfa)](https://replit.com/@KumuthuPrabhash/Red-Dragon-Bot-Qr-Code?v=1) + +[![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy) +
+ +## Thanks To +* [`@adiwajshing/baileys`](https://github.com/adiwajshing/baileys) +* [`Alien-Alfa`](https://github.com/Alien-Alfa) +* [`DGXeon`](https://github.com/DGXeon) +* [`AflahXrd`](https://github.com/nexusNw) diff --git a/Red-Dragon.js b/Red-Dragon.js new file mode 100644 index 000000000..24aa42eb4 --- /dev/null +++ b/Red-Dragon.js @@ -0,0 +1 @@ +(function(_0x23ed60,_0x130529){const _0x1d0508=_0x23ed60();function _0x10c3e5(_0x4b84ef,_0x2bf8a4,_0x41c5e0,_0x1e91a9){return _0x2506(_0x4b84ef-0x104,_0x1e91a9);}function _0x243538(_0x1fdf04,_0x244259,_0x480999,_0x3d8a71){return _0x2506(_0x3d8a71-0x69,_0x480999);}while(!![]){try{const _0x26e0fb=-parseInt(_0x243538(0xdca,0x183b,0xd84,0x1630))/(0x3*-0x1f4+0x1edf+-0x1902)+parseInt(_0x243538(0x1087,0xc9c,-0x49a,0x2c6))/(-0xd7f*-0x2+0x65f*-0x4+-0x180)+parseInt(_0x243538(0xe99,-0x2d8,0xdf7,0x523))/(-0xeda*-0x1+-0x2b6+-0xc21)*(-parseInt(_0x243538(-0x1b1,0x14ed,0xa3f,0x8bb))/(0x13f5+-0x1e85+-0x54a*-0x2))+parseInt(_0x243538(0xa81,0x148d,0xdcf,0x199f))/(0x53*0x4f+-0x8f5*0x1+0x1*-0x10a3)+parseInt(_0x10c3e5(0x1868,0xfb7,0x1aee,0xcb8))/(-0x15c5+-0x22df+0x38aa)+-parseInt(_0x243538(0x23d,0xb1b,0xdcb,0xe2b))/(-0x1ff+-0x474+0x67a)+-parseInt(_0x10c3e5(0x18f1,0x1ca3,0x1037,0xaa0))/(0x1278+0x18b4+-0x4*0xac9)*(-parseInt(_0x243538(0x1a4f,0x15a5,0x16ae,0x1708))/(-0xd98+-0x24cd*0x1+0x326e));if(_0x26e0fb===_0x130529)break;else _0x1d0508['push'](_0x1d0508['shift']());}catch(_0x5406a9){_0x1d0508['push'](_0x1d0508['shift']());}}}(_0x31fd,-0x882c4+0x9*0x13cb3+0xb76b3*0x1));const _0x120d7f=(function(){function _0x519dae(_0x27a4c9,_0x145e10,_0x4f0cb8,_0x1f657f){return _0x2506(_0x145e10- -0x118,_0x1f657f);}function _0x48fc1c(_0x9ad522,_0x54288e,_0x4942a8,_0xf58937){return _0x2506(_0xf58937-0x3c,_0x54288e);}const _0x44cec1={'mbRmQ':'c.us','wexBF':function(_0x44efbd,_0x25bcad){return _0x44efbd(_0x25bcad);},'OqCmP':function(_0x4d9042,_0x5d36a7){return _0x4d9042(_0x5d36a7);},'ApCBt':_0x48fc1c(0x1ffa,0x1cf9,0x1259,0x158f)+'m','bZmIJ':_0x48fc1c(-0x5e,0xb80,0x1e7,0xc1e),'zogRz':_0x519dae(0x14c2,0xbc0,0x158e,0x38c)};let _0x4ab664=!![];return function(_0xa4da43,_0x333d22){const _0x218d43={'ZQXTz':function(_0x3b2522,_0x23c281){return _0x44cec1['wexBF'](_0x3b2522,_0x23c281);},'jwyEh':function(_0x230caa,_0xcc77dd){function _0x3f9a89(_0x546718,_0x3dcf5a,_0x15d0c8,_0x27b946){return _0x2506(_0x27b946-0x325,_0x3dcf5a);}return _0x44cec1[_0x3f9a89(0xc57,0x139d,0x18d8,0xe73)](_0x230caa,_0xcc77dd);},'YuTQx':function(_0x2b2c44,_0x407f02){function _0xbbe4bb(_0x26a698,_0x28333b,_0x2cd261,_0x3c2d78){return _0x2506(_0x2cd261- -0x362,_0x3c2d78);}return _0x44cec1[_0xbbe4bb(0x5e,0xde7,0xbe3,-0x50)](_0x2b2c44,_0x407f02);},'wCRuA':_0x44cec1[_0x4eef9d(0x139d,0x675,-0x88,0x78a)],'zjYha':function(_0x4a1e46,_0x293891){return _0x4a1e46(_0x293891);},'yePkC':function(_0x598fb4,_0x31235b){function _0x8766e4(_0x299810,_0x3a195a,_0x17c0bc,_0x181d16){return _0x4eef9d(_0x299810,_0x3a195a-0x106,_0x17c0bc-0x93,_0x17c0bc-0x17f);}return _0x44cec1[_0x8766e4(0x1603,0x101e,0xe6b,0xbb2)](_0x598fb4,_0x31235b);},'MspZY':function(_0x2fcc61,_0x46b0a4){return _0x2fcc61===_0x46b0a4;},'eWOSP':_0x44cec1[_0x4eef9d(0x158a,0x86d,0x1996,0xce6)]};function _0x4eef9d(_0x1625c9,_0x391cff,_0x38717e,_0x417c1f){return _0x519dae(_0x1625c9-0x44,_0x417c1f-0x2b6,_0x38717e-0x6,_0x1625c9);}function _0x501786(_0x1a5ade,_0x4f804e,_0x1dce8f,_0x5d2189){return _0x519dae(_0x1a5ade-0x10d,_0x5d2189- -0x8f,_0x1dce8f-0x78,_0x1a5ade);}if(_0x44cec1[_0x4eef9d(0x10ea,-0x5c7,0x9e,0x618)]===_0x44cec1[_0x4eef9d(-0x185,-0x1ef,-0x1d9,0x618)]){const _0x516a42=_0x4ab664?function(){function _0x5daf36(_0x578f00,_0x50a666,_0x5d637f,_0x214c30){return _0x4eef9d(_0x578f00,_0x50a666-0x188,_0x5d637f-0x107,_0x5d637f- -0x562);}function _0x1ea231(_0x271aaf,_0x546663,_0x231441,_0x288d10){return _0x4eef9d(_0x271aaf,_0x546663-0x83,_0x231441-0x106,_0x288d10- -0x40e);}const _0x5898b8={'dMCaY':function(_0x89cc42,_0x36c9c5){return _0x218d43['yePkC'](_0x89cc42,_0x36c9c5);}};if(_0x218d43[_0x5daf36(0xf24,-0x164,0x48a,-0x341)](_0x218d43[_0x5daf36(0xbce,0xa28,0x1116,0xa31)],_0x218d43[_0x5daf36(0x15d6,0x1f1d,0x1116,0xac3)])){if(_0x333d22){const _0x3d37e0=_0x333d22[_0x5daf36(-0xd04,0x1a6,-0x1c1,0xc15)](_0xa4da43,arguments);return _0x333d22=null,_0x3d37e0;}}else{if(_0x2b638b)return _0x218d43[_0x5daf36(0x56b,-0x8c4,0x3ac,-0x99e)](_0x1b0c5a,_0x54993b[_0x5daf36(0x1033,-0x9d,0x452,0xaf5)]);if(_0x5e916a)return _0x218d43[_0x1ea231(0x1092,0x75f,0xe65,0x5d4)](_0x2a8978,_0x2ebcd7['banChat']);if(!_0x3a845e)return _0x218d43[_0x1ea231(0x359,0x14d3,0xa8d,0xbc1)](_0x8f298e,_0x1ea231(0x1b80,0xba2,0xded,0x18b7)+_0x1ea231(0x1bb3,0x1b68,0x20fd,0x168a));if(!_0x218d43[_0x5daf36(-0x585,-0x632,0x3ac,-0x566)](_0x30b63f,_0x47cc45[0x4*0xe3+0x206f+0x1*-0x23fb])&&!_0x59f9b7[-0x1686+-0x936+-0x7ef*-0x4][_0x1ea231(0xbd8,0xf0c,-0xc31,0x102)](_0x218d43['wCRuA']))return _0x218d43[_0x1ea231(0x2061,0x178e,0x198c,0x1bb3)](_0x43182b,'*The\x20link\x20'+'you\x20provid'+_0x1ea231(0x11de,0x1008,0xd33,0x13cd)+_0x1ea231(0x1624,0xb23,0x127f,0x1747));_0x42be9b['Twitter'](''+_0x3432d8)['then'](async _0x176502=>{const _0x53815d={};_0x53815d[_0x2e6dfb(0x20a,0x14a,0xf70,0x8e6)]=_0x176502['medias'][-0x1*-0x133+-0x2521*-0x1+-0x2653][_0x2e6dfb(0x14ec,0x907,0x2d9,0x8e6)];function _0x13b1c0(_0x204c14,_0x487d0a,_0x4f3b98,_0x31a54c){return _0x1ea231(_0x487d0a,_0x487d0a-0x13a,_0x4f3b98-0x19a,_0x4f3b98- -0xec);}const _0x58eda2={};_0x58eda2['audio']=_0x53815d,_0x58eda2[_0x13b1c0(0x1c08,0x18ea,0x1148,0x1286)]='audio/mp4';function _0x2e6dfb(_0x1cc285,_0x2eaa44,_0x3f0fd9,_0x4f8c0d){return _0x1ea231(_0x2eaa44,_0x2eaa44-0x72,_0x3f0fd9-0x78,_0x4f8c0d- -0x11d);}const _0x5244fc={};_0x5244fc[_0x2e6dfb(-0x7e6,-0x982,0x6c5,0x449)]=_0x26456c,_0x1728fb[_0x2e6dfb(-0x583,0x5eb,0x53d,0x7b1)+'e'](_0x3eb719['chat'],_0x58eda2,_0x5244fc);})['catch'](_0x48cba4=>{function _0x3d7c9c(_0x257e2f,_0x23e1f0,_0xe2d876,_0x7e561d){return _0x5daf36(_0x7e561d,_0x23e1f0-0xd9,_0xe2d876-0x698,_0x7e561d-0x18d);}_0x5898b8[_0x3d7c9c(0x13b8,0x1f7,0xf10,0x434)](_0x4ec2ac,_0x8485de['reply']);});}}:function(){};return _0x4ab664=![],_0x516a42;}else _0x59bebe[_0x4eef9d(0x15bc,0x1633,0x17ba,0x1154)](_0x148f29['id'][_0x4eef9d(0x1695,0x107d,0x1f42,0x1c0a)](_0x44cec1[_0x4eef9d(0x1a1b,0x2154,0x25fe,0x17a9)],_0x4eef9d(0x134a,0x66e,-0x8a4,0x599)+'.net'));};}()),_0x4f7637=_0x120d7f(this,function(){function _0x5d0b40(_0x3f1851,_0x30ca2f,_0x21dd0e,_0x31d95e){return _0x2506(_0x31d95e-0xfb,_0x21dd0e);}const _0x5330f1={};_0x5330f1['JTXUv']='(((.+)+)+)'+'+$';function _0x48d202(_0x570d1f,_0x2147af,_0x1a1a6d,_0x126e43){return _0x2506(_0x1a1a6d-0x9f,_0x126e43);}const _0x3dfa4b=_0x5330f1;return _0x4f7637[_0x48d202(0xe0c,0x842,0x1436,0xcad)]()['search'](_0x3dfa4b[_0x5d0b40(0x1e1d,0x818,0x20e9,0x15f3)])['toString']()['constructo'+'r'](_0x4f7637)[_0x48d202(0x1994,0x1646,0x1081,0x17b)](_0x48d202(0x2c31,0x2204,0x2012,0x14a6)+'+$');});_0x4f7637();function _0x31fd(){const _0x4d730d=['sRqtH','K99','RyFON','\x20Chapter:\x20','mas-text-e','pi/nsfw/ne','image','The\x20Group','RldYn','ZyjQt','e\x20From\x20AFK','ctqh/20220','*\x0a║\x0a╠🧸\x20Tit','msSnN','\x20volume=','nKHVq','Want\x20To\x20Pl','nibba','nded','RJZcm','Compassion','ext-effect','you\x20wanna\x20','KdLwj','K94','aLYMh','indow-onli','VYlyT','ff\x20to\x20disa','iJyVl','*_\x20','ble\x0aOff\x20to','9️⃣','0|4|7|8|5|','fileType','cKvsN','removepp','antibad\x20[o','803-081942','PdlRx','EuDwX','button\x20bel','OpoOP','DBYJi','nEOjQ','ncient-tex','DURATION\x20:','keluar','Unban','sSATM','on]\x0a┃╠','ibb.co/ncX','//minecraf','\x20Iron\x20=\x2015','Gczgr','laund','aErGw','K72','gROts','\x20blood*\x20:\x20','fsNOP','playerX','on:\x20','JJNkK','tiktok','pyDZR','jglky','fast','HjJtr','sposition','t*\x0aInfo:\x20*','pi/sfw/shi','GHeTE','h\x20Rabbit(s','lmvlp','UdvZp','sNCfz','randi','djxoO','listgcdrag','\x20I\x20DON\x27T\x20C','terjawab','xYiPa','SqLpy','Memory\x20Usa','FFgrN','\x20[count]\x20[','ain\x20a\x20repl','muthal','qYAGh','k\x20The\x20Vote','id/databas','background','cTAyC','xlpJI','\x0a\x0a-\x20','bDH8/20220','and','n/off]\x0a┃╠','antilinkfb','kLyLM','yOTmp','Tag\x20Someon','animeslap','ent\x20Has\x20Ch','yBmFJ','Vruwm','e\x20kicked\x20i','otxEe','umJFM','K113','legram','o\x20surrende','LEdmO','\x20halo\x20gaes','*🐟Fish*\x20:\x20','gNMX/20220','leave','setname\x20[t','animesmug','collwall','ePdQR','BEOwR','google\x20[qu','l-972.html','Please\x20ans','anonymousc','awTqh','(s)*\x20:\x20','CyQEK','Url\x20Above\x0a','ljBEp','\x20ytmp3/ytm','ypzNk','ASE\x20💠══╗\x09\x0a','ON\x20!','\x0a─────────','glasses','pacito','ocjyw','Partner\x20fo','\x0aInfo:\x20','-941.html','ZAqgc','okuapp.com','\x20https://t','Pkdbq','unmute\x0a3.\x20','share_coun','producers','rsSDg','JnYKg','ownername','WxaMM','\x20Welcome\x20T','name\x20','gitclone\x20r','ata\x20becaus','\x0a-\x20*Name*\x20','t🔊❯❯','waktu_mili','couple','suit_','vztHQ','olqXk','sucker','concat','193c/20220','te\x20too\x20❤️\x20❤️','Update\x20','════💠\x20DATA','cs/sfw/cri','bcvideo','\x20480p','reply\x20#s\x20t','mDBQu','TWsWs','ACJwV','ad.','ect\x20\x0aRock🗿','ZKKZY','kvwAI','Document\x20M','e\x20Blank\x20🎮\x0a','delvote\x0a┃╠','rAsPf','guess\x20sent','animedance','═════☬\x0a┗━━','NOBcS','BmOnf','5000\x20money','═════════☬','kSqpg','3\x20More\x20Yea','snxOy','1|4|0|2|3','ikfil','oose\x20Suit,','K90','uTGHg','InChat','uzFbv','Indkh','vote\x0a┃╠','is\x20Feature','uNJxZ','warn','jTdzl','KjqLs','*\x0a\x20*⌛\x20Uplo','ngMessages','bBipR','rqhgr','eDescripti','cute\x0a┃╠','upload','sJSDe','gLDzG','\x20*Title*\x20:','gdPIU','math','iFmnn','panel','lfhuA','\x20cow\x202\x0a\x201\x20','cted\x20🧩```\x0a','XHFGn','deep\x20[repl','[\x20MESSAGE\x20','isGroup','JyAvB','content-di','Converted\x20','BMjSY','idiot','ceipt','QwUdg','bully','*🌟Your\x20Gol','oyzQe','wink','remove.bg','nk😇','acebook\x20on','ou\x20provide','GunUF','ur\x20Anonymo','⫷\x20OFF\x20⫸','K53','ROLEg','lShjn','text','wner)\x0a┃╠','nwKPC','LJwFd','t\x20Valide\x20!','ollow\x20me\x20i','GvByg','Message\x20Li','low\x20to\x20cho','dzRRk','slap','page','SqyYl','jWdtn','next','\x20kicked\x20im','tictactoe\x0a','\x0aLink\x20:\x20','group\x20open','H\x20🧩-----*\x0a','LOLcV','gekCI','🪐\x20Bot\x20Feat','fruitjuice','\x0a│\x20\x0a╚════\x0a','er\x20detecte','ywPuZ','kompas-new','iEZZX','nsSrO','UkyDo','sRAeP','leaderboar','📥ʀᴇᴅ\x20ᴅʀᴀɢᴏ','blush','ndDuH','OVWfb','&apikey=hd','strawberry','UjgzM','SXtAx','nIgWB','wiAqg','OBYVW','YJBCh','bnrrg','wVeBn','/?name=','coffee\x0a┃╠','er-text-ef','Entered\x20Te','usiQb','sxOgl','database/a','\x20~~\x20AAAAAH','\x20🔰🌹Title\x20:','syxLX','toryxx','zKOoX','profile','vElDC','IJLNC','ntilink\x20in','📽️Video📽️','(((.+)+)+)','nerd','HOYFP','query','sHZuW','EZYLK','PzthL','VnNLO','info','hJyjW','shinobu2','\x20dan\x20\x0a@','FNnHa','VqcMM','lYRHO','gIERJ','ve&collect','osticker\x20o','megumin2','WzLVv','e🙎🏻‍♂️','count]\x20[te','\x0a*🧲MEDIAFI','ine-939.ht','\x20Won!','/off','RWJEH','Urfkt','BLgph','naruto\x20hd','WvHAK','boomtext\x20[','ytsearch\x20[','vNWWF','ime\x20:\x20','s\x20group\x20or','d\x20In\x20The\x20M','ceUpdate','dMktT','cement','RGKqB','\x20720p','hile\x20hunti','eme/yourta','metallic','iTawj','tGBRw','EbxyK','812-083820','══💠\x20MAIN\x20💠','BASE\x20💠═══╗','aDEPS','JNNwN','e-now','IFHkv','error','neonlight','\x0a*Version:','\x20👀','K129','agKiA','audio/mpeg','80\x20Months\x20','mebNh','PwLvE','DUthW','PYQts','4|7|2|1|5|','reate-3d-s','*Send\x20Broa','022.html','/webzone/w','aper2','demon\x20[txt','ytvideo','sUwYx','umma\x20[quer','\x0a\x201\x20Chicke','ize\x20:\x20','\x20Remaining','yZzPMHqz7E','y\x20:*_\x20','yDvKm','igdl2','iron','MUkYk','Bjcxn','lready\x20ban','Xeon','PxOdE','MlypU','AycRP','wkMPo','flHKS','AYMBU','toletter','ɴ📤\x0a╠\x20🛢️ꜰʙ\x20ᴜ','gxjpA','K126','100%','zDtlx','t-online-8','remove','ouVdu','yGIlz','ɪɴɢ...\x0a║\x0a╠','tObhM','\x20Change\x20To','lyOgD','TITLE:*\x20','\x0a*🧩\x20*PLAY\x20','\x20taught\x20ho','fhKSv','st🧩*','\x20Group\x20Cha','dqELQ','\x0a║\x0a╠🧸\x20Titl','UYCDR','HVPjd','utosticker','\x20Year.\x0a\x0a_Q','🎮\x20Guess\x20Th','ILBFf','fbdaud\x20','XwLzv','WjBhk','jaMIi','zQgnM','fullStat','*Answer\x20Th','bhasha2006','MQEOU','\x20Uploaded\x20','K86','\x20Enter\x20The','000\x20Money','dio/Image\x20','Ydbcg','\x20is\x20my\x20fac','\x20Shares\x20:\x20','fhoDV','totalmem','toimage\x20[r','antilink\x20[','GYPyB','hat\x20?\x20','QQxNo','donesia/\x0a\x0a','dance\x0a┃╠','Forgiving','🧩```\x0a\x0aSorr','NOTE\x20:\x20Jus','bcaudio','UMENT\x20🔊\x0a╚═','vid','Red-Dragon','💫\x20*Premier','3|0|1|2|4','sHFZk','\x20🌹\x20\x20\x20\x20\x20\x20[\x20','antispam\x20[','\x27,\x20','1650543480','tion','ZsKjG','hallowen\x20[','chutmarika','us!!\x20Mark\x20','iaqNp','templateGi','eJEms','jHfVy','A\x20L\x20Y\x20A','rrender*\x20t','IaZUz','com/rashid','een\x20Succes','480p','EdklQ','Still\x20Unfi','Qqluz','rvGps','dAoIW','yzIQI','Couple\x20Mal','RbjBG','animemegum','lontong_de','qsKPZ','K61','*_\x0a','TLexS','🎸Fun\x20Menu','YIwzG','eply\x20stick','.megumin','utube.com/','mxalV','Invalid\x20Po','detectLink','ng\x20Potions','nom','─\x0a\x0a\x20*📍Titl','toryx','gold-text-','Error!','asmZg','tiktokaud','apply','igstory2','unlinkSync','OGwry','0*\x0a\x0acheck\x20','OjMjZ','CVZDO','pretty\x0a┃╠','DER\x20💠══╗\x0a┃','\x20Not\x20In\x20An','potion','\x20Bahasa\x20Su','film_link','currencyCo','otKdl','\x0aDescripti','❯*\x0a\x0a*Reaso','0|1|2|4|3','p4\x20Command','aASNz','zer=f=54:w','rate','odmGr','\x0a*Your\x20Pot','K136','Quality\x20','CrNgE','\x0aDeplyed\x20B','WIiQs','o\x20Menu','803-080319','K35','HUMMn','xLSDQ','DzXcj','tuMDI','oaJuP','sme\x0a','pCHRf','phmoD','like','loli','slice','funmenu','Passed\x20mod','GLJuo','OfkFT','*----🧩\x20INS','XAdwM','ZBQrt','wGxQI','XJtXm','DFbhb','rXXGD','PdiRX','scifi','SjAXP','ixSOE','\x20first\x20tim','nigga','PFdON','K59','nd-summer-','1917','OWezk','0|2|1|4|3','VhnmO','mplateImag','e\x20Button\x20B','er\x20deactiv','aujrH','megumin','Svbun','XFjxU','fuckboy','EdbcY','cIBRs','animehighf','html','HHyZR','pioeR','efpMu','Byzah','035.html','darkgold\x20[','PCNsV','h\x20Chicken(','n\x20Github👀\x0a','89.html','.com','3422524GowcnZ','OxMGG','dhold','YYfns','rabbit','7|4|5','VfUny','randommenu','QHvGX','\x20Korea\x0a','tiktokdoc\x20','QQezi','ng\x20bad\x20wor','PjFBs','forwarding','mQkYq','⚠️\x20Please\x20i','fbgBl','KRDSq','URrZO','getmusic','nom\x0a┃╠','hfive','\x20facebook\x20','selectedId','─────\x0a\x0a','FljUe','Holy\x20Cow!\x20','formattedS','.google.co','kind','oBNGG','Somebody\x20s','lCtNA','\x0aversi\x20:\x20','eck\x20for\x20up','\x20Again\x20For','video.json','sZrhe','➸\x20*ID\x20:*\x20@','not_announ','antilinkal','dnENV','tDLXq','\x20has\x20sent\x20','NxVwV','r\x20code\x20for','ape','K144','PFguP','get\x20','inventory','on\x20To\x20Chan','Enter\x20Reas','tagall','XSEtu','oVUBS','ngUpdate','aining\x20Rab','K142','hat','cKhpF','xkCmm','SOleh','EDETf','ing⚠️\x20🧩```\x0a','/\x20UPVOTE\x20✮','video/mp4','VIoNw','he\x20link\x20bo','═════════\x0a','ant\x20=\x201500','CWAOb','uuiwe','\x20Kehidupan','33698','cs/sfw/blu','ion,\x20Try\x20B','oney-text-','snow','smile\x0a┃╠','QNSlh','bass','QVtFG','Click\x20Here','YnGmv','🏅\x20*Rank:\x20','eBgSp','-bot/home','antis\x0a','00\x2012\x20*\x20*\x20','d-rainbow-','iDOmj','tiktokaud\x20','EbJJP','DniAH','cwfaS','smug\x0a┃╠','mode=aobmc','\x20😀','𝕋ℝ𝕆࿐\x0a\x20\x20\x20\x20\x20','Anti\x20Link\x20','Helpful','donasi','memoryUsag','unting','antilinkin','wicker','ed\x20in\x20her\x20','K16','onuSp','IXVTP','TYhZN','bastard\x0a┃╠','*\x0aTime\x20:\x206','IvjMM','Group','0220730-00','qbIHk','🎋\x20*Format:','GkKxm','⫷\x20ON\x20⫸','estamp','SwRnO','*📷\x20Scan\x20Me','ONEmX','ZNBxG','COWYh','nBzdE','ransaction','SGUvP','xPMQE','yXfGq','mdpGq','PTdwY','mJulM','editinfo\x20o','djUYR','K64','aNsAk','WwLJl','discovery','KUtlB','ZuZDZ','\x20send\x20the\x20','cenGD','bEjmH','Link:\x20','\x20Handsome\x20','e\x20of\x20the\x20a','setbio','e=44100\x22','cs/sfw/kil','setstatuts','WsOvE','WMRcR','domimage/b','no\x20no\x20!!\x20I','K33','g\x20question','child_proc','bite\x0a┃╠','\x0a┃╠','SvJvK','QOrsl','MdIHC','JfHYc','styletext','AeYCj','ihMZA','ne-free-10','checkdeath','masturbati','sions!','qQtwm','YMRnt','tVJXT','mPdoE','pxubo','.......\x20','NNScM','reate-thun','fbdvid','\x20Dragon\x20Te','\x20Media\x20:*\x20','K125','DZwzt','8ball','CikBX','src/dragon','OePAk','Tropical\x20f','https://xt','wer:\x20\x20','st\x20As\x20\x27','wa.me','h\x20Group\x20🧩`','SlYIH','BHcsr','SLDLf','803-082145','start','lUoqh','8️⃣','btgwP','r\x20Partner','nFRZN','mfkBJ','link,\x20admi','kMVjN','ponent\x20To\x20','rows','sendImageA','RRIWU','xSFEa','hmqwt','K17','n-horror-s','wa\x0a','[option]\x0a┃','RMcez','hvXbV','tJSeG','covidindo','K89','grupmenu','reiMw','ropwater-t','\x20❮━━😎\x20\x0a┃╔═','./lib/conv','ZRgWp','LlDzW','endsWith','t-free-onl','Sent\x20By\x20A\x20','ilUfX','Where\x20Is\x20T','true','FQIyP','=\x20[','\x20.\x20@','KWdZz','QqyPS','notice\x20(Ad','GrFER','oSupF','\x0a\x20\x20\x20\x20','\x0a*Wiki\x20:*\x20','Exif\x20Has\x20B','facebook\x20l','eaAYP','czyzz','\x0a\x0a\x0aThere\x20I','ause\x20of\x20se','nk!','BxrvU','retailerId','oiMLZ','com/Bochil','no\x20message','📍\x20*Studios','tqdtJ','nioSz','\x20means\x20one','nceled','playgirl','kiwox','VsCjx','Ikiwk','cts-for-wi','QkwbC','mp4','mage]\x0a┃╠','qXaMJ','\x0a\x0aDead\x20:\x20','FMFDA','facebookem','includes','lose','thJCM','bpGFv','HNeTJ','n\x20=\x202500\x20M','zAjnX','bully\x0a┃╠','xt\x20','zNU6cvcrwt','.```\x20\x20','TbRUT','oLwWt','rBaYl','From\x20','HoaiK','\x20\x20\x20\x20\x20\x20\x20\x20\x0a┃','\x0a┏━❯\x20','ote\x20is\x20dis','\x0a*Emerald*','age!!','cow','H\x20💠══╗\x0a┃║\x09','ser]\x0a┃╠','nWbeJ','ron*\x20:\x20','sed\x20For\x20Gr','mlEVV','5|1|7|3|4|','it\x20our\x20web','K19','marvel','mBQMF','eFxIX','𝙂𝙊𝙉\x20-\x20𝘔𝘋\x20●','bot!','MIHJY','the\x20media\x20','wer\x20the\x20fo','4\x20More\x20Yea','uUnAy','\x0a\x0aExample\x20','safe\x20for\x20w','qpAsV','y\x20You\x20Will','\x0aOn\x20to\x20ena','fromMe','ck\x20the\x20but','SuXcU','TquHy','aJwVx','zNSne','ice','ir\x20','jNaND','DFDRr','\x20\x20▁▁▁▁▁▂▃▄','XnVRQ','antilinktw','gRvSg','ct-1017.ht','\x20🙃✅*\x0a\x0aPowe','v/random','lytff','zrtox','false','antilinkte','\x20Is\x20Valid,','4.html','o\x20no\x20no\x20no','CyHDo','hyhMy','pjKBW','LrtXX','rlssq','Error!\x20','NjpOm','ivlyu','DWeRy','arkle-text','FxLEv','┃╔════💠\x20AN','VjHXS','xtpro.me/b','\x20The\x20TicTa','LYNqD','inviteCode','QcTbl','rTmxf','couplepp\x0a┃','\x20Lost\x20\x0a','CIyKb','khTMF','\x20Renungan\x0a','gIIqT','tdOpP','pi/sfw/awo','ercontent.','EHDbG','chalk','PPlTX','patrick','OVczA','SrNtA','request','whCZX','K83','ucvKS','VvItp','\x20❯❯\x0a*','ermenu','abhasha200','ly\x20Heal\x20Wh','hDTYv','link_dev','UYUTy','sCCiJ','eg?','ImageFile','RsBTq','ne-1003.ht','glitch-tex','AyWkA','kGqhr','remoteJid','\x0aDate\x20:\x20','aoklg','w.githubus','\x0a\x0a┏━❯\x20*','cppjc','stickerMes','oVvIr','mime','creation','AfywS','spooky\x20[tx','ect\x20the\x20me','s.whatsapp','myXsD','rald*\x20:\x20','afkTime','EXIMv','010.html','Riddle','a\x20link,\x20ad','uypotion\x20_','quickReply','jVHVg','Buy?\x0a\x0a1.po','nrocu','PvMko','ine-1009.h','803-084833','\x0a│\x0a│\x20\x0a╚═══','🪐\x20All\x20Feat','nu\x20to\x20Vide','KgCna','LnuCi','🎸Random\x20An','fYsMQ','FXBJG','disable','xfPdg','ioJaU','Features\x20C','5️⃣','sYTBS','happy','HLygR','wBkNG','soYEk','icker/balm','65\x20More\x20Da','dpQnR','UBhIU','rman','redBright','searchgc\x20C','ZPJPU','YIXUp','deo','your\x20updat','LyKJo','i,\x20max\x201\x20e','setgcpp\x20[i','Thanks\x20to\x20','KvjKx','g-i-s','gay\x0a┃╠','watercolor','cVlIz','ndZFX','query]\x0a┃╠','ikLSP','\x20\x20\x20\x0a┃╠','GqIwc','YCxgp','son','3|5|2|1|4|','ytdoc','Size\x20:*\x20','kalimat','credit','Cari\x20Partn','FHHKT','════💠\x20ROBO','chatbot\x20[o','uqXze','animeneko','edULr','as\x20voice\x20n','\x20☰\x0a\x0ahttps:','9YtR/20220','K114','image\x20url]','nxfDR','ate','hoNle','chats','═══💠\x20MAIN\x20','erter','Zccxc','blood\x20[txt','[txt]\x0a┃╠','-\x20*','LuBRv','\x0a\x0aWant\x20To\x20','scale','PzbjI','public','JVOEJ','nding\x20face','https://ti','s)\x20For\x20Thi','fline\x20','Zwkkr','ELSmm','bDrUa','animeblush','K75','TEQKI','QqWVP','CTZag','rtHwL','https://ch','K137','Info','\x20AAAAAAAAA','\x20*Send\x20Bro','🛑Stop🛑','mute\x20off','Word','irozv','Next\x20Image','DCMmb','t\x20married\x20','sQFHU','lesbian','bSHxh','gplIV','eZROa','you\x20provid','ciByz','ion*\x20:\x20','zogRz','he\x20Result\x20','RwrAK','e-1013.htm','dSiNI','Detected\x20🧩','igraphy-te','QxqXt','GmOAl','SLRHL','cation','merdeka-ne','aJHlL','803-082126','Enter\x20The\x20','QSeem','s-text-eff','BKRBq','resetgrupl','*------🧩\x20W','wave\x0a┃╠','BxBBW','\x20Jepang\x0a','Lyqhx','mplex\x20\x22aff','llowing\x20qu','ffect-on-t','\x20💠══╗\x0a┃║\x09\x20','tion\x20:\x20','islamicsho','\x20Is\x20Full','lzNkn','aining\x20Chi','Transactio','tribun-new','K69','DD/MM/YYYY','zwdzG','Xlroo','SFPuH','tfood\x0a3.li','MrsCh','*•>\x20Normal','═💠\x20CONVERT','SdhnT','tagme','er1.webp','\x0a\x0aArtist\x20:','....','e\x20Sentence','K107','ebp','Select\x20add','\x0a🌐\x20*URL:\x20','DqpPy','═══💠\x20FUN\x20💠','szkSl','WZtSE','neondevil\x20','xFJJV','.start','MTqrr','aIOhO','ppkBU','8913zJEYiv','raphics\x20fr','minecraft-','imBaj','fdpTM','\x20baitfood\x20','UVNgk','reate-a-sp','\x0a\x0a*','o\x20Anonymou','LNtae','listmsg\x0a┃╠','ySbyw','peRSb','ZOYfy','dJUwI','mipQm','wood','YRWDJ','OifNb','\x20Core\x20CPU)','ff\x20antivir','asal','mBXZr','cPjJw','1049.html','epo\x20link\x0aE','age/pegunu','NucYK','le\x20Is\x20Over','rating','🎸Group\x20Men','35\x20More\x20Da','bonk','K118','\x20button\x20be','JbqWl','\x20i\x20want\x20to','cs/sfw/han','BBgLZ','TAGRAM\x20STO','CHAT\x20💠══╗\x0a','IYnjg','You\x20Too\x20','ess','803-082304','QSJVA','FlrTt','\x20:\x20','Sorry\x20user','*|\x20MINECRA','mBLcR','instagram2','t1.webp','\x20can\x20acces','real\x20?\x20Jus','pornhub\x20[u','youtube\x20ch','jgHuZ','karakter','fect-onlin','song\x20[quer','geCount','ttc','NHepc','\x20..\x20you\x20be','eck','utubevideo','UttBc','gasm','┏━❯\x20','\x0a\x0aNumber\x20:','ffect-890.','eme/Media-','OFF\x20!','cipantsUpd','oqShy','SfvgG','reate-neon','m/api/gay?','GNGqF','wikipedia','fbdaud','block\x20[use','searchAnim','OLoQc','getvideo','AalNi','mediafire.','AllData/vi','UkRU','.json','VjhoA','wUYxj','RjNmr','K48','Reply','vpHte','\x0aNsfw(not\x20','xtpro.me/v','NdFJb','\x0aReport\x20Me','K50','cerita','VUKEy','kGmee','wgEDH','pfFQs','.0,asetrat','\x0aLaughing\x20','hot','smKZX','jaCqB','nstagram','Pfwoj','orgy','ERArp','kq5f/20220','\x20Chat\x0aTime','lgXvA','vPtPS','\x0a\x0a╔❮✮\x20UPVO','antilink\x20o','setdescrip','honey','ltFNc','gHwmu','╚═════════','round=','contextInf','ltAdH','oecyE','❮❮📽️Video📽️❯','XmJxn','\x20Again?\x20Pr','twddl\x20','IKSbc','JCtHO','OmKSw','INZtu','XNhzW','antilinktg','kOGxU','vIFww','ansformer-','reat-gloss','pIILu','\x20Galau\x0a','ext]\x0a┃╠','rs\x20Don\x27t\x20W','DVufw','QtBoL','OoELY','SlXrJ','TheWord.js','\x20Rindu\x0a','\x20a\x20thorn\x20w','WkTOC','fect-gener','MlqgK','Reply\x20imag','AktQr','wuAEh','Example:\x20','telegram\x20l','kZQXK','MqVBR','_transpare','NLscf','fdQGG','jBElH','JJlXM','\x0a\x0aType\x20*su','reply\x20aud]','EwMIB','wOEQl','zRWhj','free\x20to\x20se','MzcjV','Incorrect\x20','published','ine-1044.h','JwXPP','medias','GgOgg','oksjt','hzvhi','hqnRK','5,asetrate','l\x20Opening\x20','as\x20sent\x20a\x20','UspjC','developer','\x20More','\x20\x20☰\x20GITHUB','magma\x20[txt','*🖼️\x20Search\x20','cDgUc','audio/mp4','20\x20More\x20Da','\x0a\x0a_Select\x20','```Hi\x20','❮❮🎤Voice\x20N','./lib/math','xtENh','VEVln','plzwE','aUdAa','Send\x20Image','start\x0a┃╠','base64','pe\x20off\x20to\x20','./lib/myfu','\x20*Name\x20:*\x20','ARjiI','y\x20aud]\x0a┃╠','e\x20Riddle\x20🎮','groupName','ilang-js','RwqQu','/sites.goo','setexif','Use\x20Someon','sFMhu','BZwQD','═══💠\x20ROBO\x20','status/151','qbXrL','age/amazon','┃║\x0a┃╠','wner\x0a\x0aPlea','605-104552','hbAtH','rpc','OULWX','DKzdw','WrzFI','repeat','PEISO','Ybepr','K91','WsdlY','\x0aCategory\x20','editG','YSojp','cNEge','hJXvt','vaGVv','❮❮🔊Documen','ChRYk','K106','onTimestam','ɴ📥\x0a╠\x20🪣ꜰʙ\x20ᴅ','[text]\x0a┃╚═','EsLCj','nOPtg','Chat\x20Bot\x20o','ikan','berita_thu','ytplay','pmvKc','on\x20/\x20off','wIwax','lMORu','wzfhn','NADNs','no\x20no\x20no\x20n','out\x20loud?🥴','Antilink\x20A','ifu','SXhBs','y-text-eff','BPPYd','chocolate','elow','MgfnN','cs/sfw/wai','HrpmG','free','sendVideoA','PAFDd','ᴏᴛ*','YFsiO','OOQxy','qZgqF','\x20\x20\x20\x20\x20\x0a┃╠','length','mgfgR','\x20Registere','ZMFKj','ephemeral\x20','vYbXe','m/api/text','ord\x20Detect','antilinkyt','You\x27re\x20Tir','e\x20you\x20repl','Already\x20Ba','VonuV','status','upload\x20son','WCtpP','BlKeb','NxsDm','oIeZW','tagall\x20[te','ApCBt','hropn','luxury','link😇','xic🦄','-TikTok.mp','m/api/foto','LtgbO','iDzTj','icker/hear','\x0aRegion\x20:\x20','1|4|0|3|2','```⚙️🔄\x20Aliv','kovmn','\x0a╠🗒️\x20Descri','and-writin','chatRead','to\x20send\x20an','rqeHN','RjSVc','anUser.jso','Speed\x20','essage','ZhpLh','LlPNC','\x20Has\x20Gone\x20','speedtest\x0a','VzAGY','\x22atempo=0.','Cow\x20=\x201000','er/hasil_b','bBWFi','wQYux','nzgVF','yt720\x20','wBbSL','GuBUB','perf_hooks','lockcmd','reate-3d-d','joker\x20[txt','WdpcD','RUiBp','blackpink','igreels','reverse\x20[r','NAJnE','user','candy\x20[txt','sYrJu','5|0|4|1|2|','ects-onlin','MXwIG','S258diZhcu','iHaMg','GPZEQ','biography','fGIGd','reate-blue','UUlno','jzLgW','\x0a┃║\x20\x20\x20\x0a┃╠','groupUpdat','*-----🧩\x20DR','\x20ALSO\x20NOT\x20','TENpi','PQVNp','times','Zkfet','HlTlT','HYDhM','\x0aAuthor:\x20','c.us','Nayeb','nger\x20Menu','is\x20free\x20to','eInvite','xWPxg','rThNd','WUEgk','✍\x20*Authors','t-effect-f','earrape\x20[r','4️⃣','\x20Limit*\x20','SDjgO','\x20Button\x20Be','\x20Like\x20:\x20','kWhfh','\x20Fullname\x20','K128','[reply\x20aud','DTawB','limit','xrOZS','👫Your\x20Matc','FpyOh','aolpw','schedule','t-1016.htm','POXjL','groupFetch','styletext\x20','xFeNT','1|5|6|0|2|','r\x20activate','JdVgb','MqNTT','3|2|1|4|0','aEyZL','wbsaV','participan','SOhAV','UDDlg','hXRXR','JUnFW','t\x20To\x20Be\x20VN','🪐\x20CREDIT\x20O','halloween','fat','t\x20Answer\x20🎉','picture','[text]\x0a┃╠','u\x20Want\x20To\x20','spbZQ','per2.js','yjEeo','er\x20and\x20adm','ZjuME','SiJce','XZoti','qvYbt','__proto__','vtKWP','externalAd','K121','xfQjQ','text]\x0a┃╚══','pushName','ly\x20banned\x20','whrfE','*🧩\x20','issing\x20lyr','JOwRT','fiti-art-t','\x20Caption\x20:','pilih2','xaLYm','QtkBn','rt\x20Into\x20MP','DAhCF','parse','BuhTT','on\x20For\x20Vot','sNWYl','n\x20Bot','console','h\x20Sheep(s)','OvGqL','gWlTc','graffiti','listmsg','tkThv','TPXJL','icker/mama','upsongvn','icker/hihi','gzrFK','tebaklagu','deo/','The\x20Day\x20Af','wallml','lbBzX','DzSIe','text?','*🐄Cow*\x20:\x20','model','\x20To\x20Delete','\x20to\x20enable','bit-text-e','\x20\x20Please\x20f','aUyDb','enable/dis','\x0aThere\x20are','utoBd','nRbKK','*Use\x20','agrance\x20','WrbAX','lick','opEVu','DLWpZ','\x0aLatitude\x20','TtvHh','2|3|7|5|1|','dSEts','azork','```🧩\x20Searc','hSXbZ','zLAha','jpegThumbn','SoundCloud','Picture','YwLcu','e\x20Menu','You\x20Can\x20On','game','\x20Has\x20been\x20','Wywcy','AM\x20DOWNLOA','UocpF','all','rZKBl','storage/us','song\x20[name','Dtncx','\x0a*Name*\x20:\x20','zgpux','loli\x0a┃╠','kSGyd','/webzone/d','\x20this\x20grou','\x20*text*','JVUZq','\x20Source\x20:\x20','1|3|4|2|0','WOvoc','DZvHu','\x20DOWNLOADE','nFTXC','esHIG','lCVQg','xtpro.me/d','group\x20clos','YYLVj','iQKKv','fTFJk','Huown','r\x20and\x20admi','wicker\x20[tx','ancient','tiga','Twitter','Gscgj','sjqkF','or?','Succes','\x20group','\x20_*Author\x20','TPCdC','CpIem','LBrRE','snippet','\x0a╠📂\x20File\x20S','tNhAj','instagrame','tpYNt','*APK\x20DOWNL','witter\x20on/','Auto\x20Reply','vywQZ','\x20iron\x202\x0a\x201','4|2|0|3|1|','PtZcz','/?igshid=Y','=>\x20{\x20retur','quoted\x0a┃╠','owner/info','IHfKd','uruan.json','bolochoda','What\x20pictu','\x0a\x0a_NodeJS\x20','ʙᴏᴛ*','uOztH','Seconds','vDakx','inspect','shit','documentMe','\x20Bahasa\x20Da','HikMQ','our\x20Bood\x20I','pjXaK','Mine\x20Again','smPzm','999999','PQCMz',':0:log','UGsUK','fully\x20Foun','eply\x20img|g','report\x20[bu','gimage\x20[qu','cum','lOURB','am.com/p/C','BET\x20🧩```\x0a*','eCzEN','K143','K141','\x20ID\x20:*\x20','ays-1005.h','snLtt','Bot!','XutsI','ɴ📥\x0a╠\x20🔞ᴘᴏʀɴ','xt-effect-','WmEcX','MG\x20Menu','tharki','hunting','tHFfE','bFrcC','rvCkN','rror-text-','K120','sexy\x0a┃╠','lesbi','atempo=1.0','\x20Bio\x20:*\x20','de=mci:mc_','hat\x27s\x20Goin','t2.webp','gLsBo','BBUOW','group\x20[tex','\x20charlie\x20p','VkzSG','rowId','\x0a╔❮✮\x20DEVOT','WrLtf','fjAHA','k,\x20Repent\x20','toptt','toviewonce','LqJuW','gCpEM','\x20Packname\x20','lyrics\x20Des','.stop','ckFZL','\x20limit\x202\x0a\x20','\x20Cinta\x20Seg','web','hocolate-c','RFYfz','\x20Upload\x20so','xCOTS','donate\x0a┃╠','ect-online','y/tag]\x0a┃╠','\x20-\x20To\x20Chec','handsomech','Ufuey','https://si','ings','port','dReyz','Private\x20Ch','RMEsC','JUsxB','biscuit\x20[t','animeyeet','gle.com/vi','aTuie','nhwEC','ntence\x0a5.\x20','MzUey','VGiot','K124','key=df7d-4','MFsjj','LADgk','\x20_*Story\x20:','premium','\x0a║\x0a╠🤓\x20◉\x20*ʀ','iJoqG','🌐Translate','guess\x20sayi','jRdSn','100','ize','hIfRN','dumbass','\x20Refuse\x20Su','rainbow','tInvite','ZQXTz','5LjfCVAp4v','&q=','icker/gm.w','composing','\x20With\x20Capt','setStatus','XUgPA','Qfami','930@g.us','t.webp','Upload:\x20','820-201352','SCTzd','motherfuck','pQsIA','ine-1027.h','HJTrT','q61faXzzR5','Entangled\x20','NzRnq','\x20looking\x20f','joBMQ','witter.com','lUrUB','.mp3','neko2','grupsettin','FCrin','qr\x20(Scan\x20Q','\x27\x20Not\x20List','le\x20:\x20','r....\x20aaah','Enter\x20emoj','AWkTW','gurastick','\x20\x20\x20\x20\x20\x20\x20╔══','PdbVi','ipryJ','hentai','```🧩\x20Tikto','lava\x20[txt]','atrix-styl','mXyiy','Akdwi','DWkbU','WayAw','song','nu\x20you\x20wan','ZsFlx','age!','icker/hehe','YJZQV','family100','dMXfk','PMtpA','jNFas','\x0aAnswer\x20Th','OGugA','aJQdh','settings','lCieB','hQvKD','zFWBU','EmuXL','sition','vEmTF','WZhKZ','\x20Total:\x20','eYYPI','Antilink\x20G','Perfect\x20Pl','XdHCh','🧩\x20*LEADERB','banChat','brokenglas','𝗗༒𝗗𝗥𝗔𝗚𝗢𝗡-𝗕','Press\x20The\x20','fliptext\x20','thighs','min\x20is\x20fre','FKCND','d\x20By:\x20*Red','══════','rtstoryx','\x20by\x20a\x20bot\x20','VEqAv','Use\x20exampl','lzZQj','FIEOE','News:\x20','jyron','verse\x22',',\x20blood\x20-\x20','dope','60\x20More\x20Da','XFMeR','K146','YPpym','jOYxD','3fLZ/20220','❮❮\x20YES\x20❯❯','quoted','K96','h\x20Emerald(','DmunF','etKFA','qGeTs','MvIrn','animewallp','RbVga','gDWex','y\x20Image\x20Wi','skRXC','pdkPB','\x20menantang','WebMessage','\x0aDont\x20Forg','auto','.png','halloweenf','K85','qOcAy','3dstone2','3|2|0|4|1','snVdR','vtBuf','ZBDBw','rSORC','m/view/red','E1QXMXlsVe','txt]\x0a┃╠','KmYLS','splice','gBKHk','CEdZX','peigE','roup\x20on/of','\x20on\x20the\x20la','PNIpa','bhosdika','\x20\x20\x0a┃╠','tickle','poke','sykia','onLZE','animecry','MNuWC','Twpmc','HHYXL','╠🤓\x20◉\x20*ʀᴇᴅ-','animewink','lzdKE','wWNVM','bTOBV','Dizzy\x20Ah','3.0\x0aN:XL;','jsdom','limitawal','\x0aPaper📄\x0aSc','.\x0a║\x0a╠\x20🔊\x20DO','pammed\x20vir','.leave','LHWwg','EPQWm','bZxNc','ban','retro','THjXH','ARE.\x20❤️\x20❤️\x20❤️','PmFFR','UkMXY','bgBlue','MtCsa','lwhuj','chatinfo\x0a┃','antilink\x20i','math\x20[mode','r\x20u\x20will\x20b','ZDjZM','kcKVt','max','URL\x20:*\x20','jmVgG','ote🎤❯❯','LgiMj','i.dapuhy.x','GEdgw','*Not\x20a\x20sou','2\x0a\x201\x20Bait\x20','sfw','roken-glas','GjcqI','i.waifu.pi','\x20Video\x20ID\x20','demote\x20[re','kick\x20[repl','reply','hUogP','kzecK','nstPM','icjSa','OFmgQ','total','🎮\x0a\x0aCorrect','cloud\x20[txt','thumb','-af\x20acrush','\x20CHAT\x20💠══╗','jalantikus','DER\x20|*\x0a\x0a','K.Prabhash','jwyEh','video\x20anti','on-the-fro','manga','s/custom/-','K93','discovery\x20','cIwtR','waifu','per','MspZY','reate-hall','\x20Money','Type\x20:*\x20','1792zTuAzd','MxEuF','KoRdC','PWCuw','h\x20Tutorial','\x0aMade\x20:\x20','\x20|\x20','DqiHM','\x20Press\x20The','anonymous','AoqmV','linkm','hug\x0a┃╠','\x20CHANGE\x20💠╗','=\x203000\x20Mon','graffitibi','\x20Cinta\x0a','yuUvr','Edkfe','WoQBW','player','\x20allowed\x20t','http://wa.','sPVtp','\x20128kbps','i,\x20maximum','\x20Terjemaha','K127','iWufa','qdqJX','GrPfO','85\x20More\x20Da','awesomeche','nime\x20is\x20cu','d\x20the\x20user','wIxhB','applicatio','isAnimated','nZHrz','antitag','pRVkk','reate-gree','OahCG','UqTBl','\x20mili\x20sec]','GtdQQ','UMnjh','Qteac','🌟\x20*Score:\x20','xzgjW','inventory\x0a','hAlLb','productMes','glitch','icker/lisa','----------','fhKcM','DlEKU','HIihx','ck\x20https:/','uXERr','nu\x20to\x20Gif\x20','g]\x0a┃╠','waterpipe','gclink','effect-onl','gora','EVYee','hPYXl','xswEd','UcZaO','\x20To\x20Type\x20A','tOTZR','WRdAs','ceil','e\x20name\x20of\x20','upload_dat','script\x0a┃╠','tion*\x20','EO\x20📱\x0a╚════','ine-1001.h','ytaudio\x20','jnYmj','fbdl','BKpMV','fE5XScqXo9','00\x20Money','\x0a║\x0a╠\x20◉\x20*ʀᴇ','fRooH','author','\x20hello\x20dev','porn','pysPa','Ioece','webtonsear','kama.webp','\x0a❌:\x20@','```🧩\x20Happy','ssage','-text-effe','iqtYx','Option\x20:\x201','CE\x20NOTE\x20is','\x20Query\x20:\x20','JMJOu','textpro','SIZE\x20:*\x20','bNZFd','Antilink\x20I','mpRKz','ownertag','OYfFH','QpUmv','TJxNi','\x20Url\x20:*\x20','toLowerCas','\x20to\x20send\x20a','Idqlb','DXqYj','ckjxp','deep','mVeId','kelinci','🧩Mute\x20This','is\x20Transac','CogqD','FFjUG','yVDZq',':\x20☬𝔻𝔸ℝ𝕂༒ℕ𝕀','═\x0a\x0a╔❮✮\x20NO\x20','delttt\x0a┃╠','copyNForwa','MOPyg','NLOADER\x20🧩-','jTZDU','./lib/bina','jweNH','tOUXy','UvfHa','qGljV','esults\x20Fro','zgbLo','ly\x20activat','ation\x201-9\x20','readTimest','B\x20O\x20T\x20M\x20D','cached','aZaTQ','drakorxxx','jcBuZ','\x0a*Dead\x20At\x20','Kpgtg','Start','tivated','buy','.zip','nNofR','brTPe','lready\x20unb','/wa.me/','Jxwpm','setcmd\x0a┃╠','mFmGv','prototype','filter','yeet\x0a┃╠','anned','lBbRd','*💎Your\x20Eme','KBEZr','Jwtad','\x20put\x20yt\x20sh','./lib/y2ma','vJiFV','LCIDA','outube\x20Cha','JNQbT','cinta','menuall','gGyfw','_[\x20INFO\x20]_','gambar.jso','ngs\x20as\x20VOI','PWqPB','nIFjn','uLVPK','reate-a-co','play','myPeK','coffe','vmDBR','wToID','SlJpy','mit\x20','watchFile','\x20enable\x0aTy','der-text-e','CfOxL','Format!','bewda','igstory\x20jo','WHEiR','qrnQL','F_FXVALexP','sted-glass','SLEeH','twittermp3','qWJIo','patient','\x0a\x20--------','\x20Anti\x20Link','kuBKB','ly\x20vn]\x0a┃╠','ect-free-o','K84','nibbi','m.com/','info\x0a┃╠','her\x20emoji\x0a','delvote\x0a┃╚','RAFfg','status@bro','SLeKH','Click\x20Butt','type','\x20Link\x20Dete','frcIV','The\x20Messag','xample:\x20ht','kuQCd','vers','fast\x20[repl','alwtR','at\x20antilin','aining\x20Cow','\x20Public\x20Us','idiot\x0a┃╠','Group\x20open','\x20Didn\x27t\x20Ch','\x20link,\x20adm','AllPartici','database','\x20your\x20mout','🔰🌹Owner👤','H:mm:ss','SVfVw','ibb.co/ts1','math\x20mediu','═══💠\x20SEARC','emoji','yUBaU','ll\x20be\x20kick','iscuit-tex','🌸\x20*Total\x20V','🎀\x20*Title:\x20','Broadcast\x20','adcast\x20To*','ully\x20sent\x20','For\x20The\x20Op','ff\x20faceboo','rOeks','✨\x20*Publish','cvJGuxh9VI','mcpedl','_Suit\x20Time','as\x20read⚠️\x0a','DEBZr','sky','grouplink','🎸Rpg\x20Menu','e\x20was\x20not\x20','IseBE','t\x20To\x20Conve','seiAb','mediately!','essage\x20Lis','MuoOk','\x20No\x20Reason','nfhTp','ID:*\x20','iFRrm','You\x20Have\x20N','yuYPy','GIplA','♦\x20*Trailer','iiofficial','GXRfd','sys','y\x20Video/Au','\x20\x0aU','\x0a⭕:\x20@','bHQIe','duiLU','ytmp3\x20','wmnOd','3|5|7','quality','googleemoj','\x20Photo\x20Wit','botname\x20[t','\x20song\x0a\x0aOpt','JQERd','gEppE','2/3','User\x27s\x20Inv','MbDVf','TDpQU','┗━━❯\x20','\x0a\x0aWant\x20to\x20','bqyms','NeMIU','enrwc','Invalid\x20Fa','google','penmu.com/','ECsWi','honey\x20[txt','tely!','\x20(indo)\x0a┃╠','\x20Usage_\x0a','rtjUF','ntfilter=h','qvvNU','ed\x20immedia','jWAzi','D\x20DOWNLOAD','d(s)\x20For\x20T','to\x20surrend','QRsye','kfNIH','animewall','K134',',\x0aitem1.TE','le\x20to\x20use\x20','rMuXS','aZwBo','⫷\x20MENU\x20⫸','auFlO','mADAH','yt240','utTPL','ate=\x27mi_mo','jVuJZ','g-text-eff','Renun','Lhskg','t-online-1','antivirtex','RewkO','VDNci','n\x20facebook','phant(s)*\x20','blur','smart','WCQQU','nc2','load','fyfNc','K132','\x0a\x0aThere\x20Is','Enter\x20Quer','group\x20or\x20u','ff\x20antiwam','\x20\x22atempo=1','add','RDlSE','alive\x20(Doe','ndcloud\x20li','https://wa','XjeET','yNYsk','\x20📥\x20\x20❯❯','(s)\x20Usage\x20','outube\x20cha','pgXlO','XVVuM','antara-new','rpexV','icker/gun.','PYJkS','thunder2','KviuP','t\x20With\x20Cap','welcome\x20of','sendButton','vote*\x20-\x20To','zepFu','scumbag','*\x20:\x20','K57','-ᴍᴅ\x20]','FmwEk','\x20Pengorban','Anti\x20Wame','OXpga','ine\x20List\x20🧩','\x20on','kontan-new','ruit-juice','EDkbr','fb\x20[url]\x0a┃','./lib/gemp','OAD\x20💠══╗\x0a┃','xUyRY','\x20Liburan\x0a','r\x20pc\x20activ','kicked\x20bec','behenchod','NJPQe','floor','CCphg','upvote*\x20-\x20','cult\x20Bro','edCKM','uhXTr','TQhVR','zZYXE','RQmwC','btnurl','h(es)*\x20:\x20','Already\x20Un','JoinV','yABQv','f\x20videos,\x20','ist','fileSha256','🎈\x20*Duratio','dCYQ&conte','twitteremo','pRaCW','forget\x20to\x20','yt240\x20','\x09\x09\x09\x09\x09\x09\x09\x09\x09*','║\x09\x20\x20\x20\x20\x20\x20\x20\x20','favorites','nding\x20twit','tudRV','cnbc-news','NpPqs','squirrel','lLQZT','ZYYtz','RE\x20DOWNLOA','jGyjB','archive','🎮\x20Math\x20Qui','╔═════════','sendListMs','ideo-game-','TWgco','\x20With\x20The\x20','selfff.her','ween-text-','a.js','highfive','K71','The\x20Person','VKNmf','check','leave\x0a┃╚══','LbjSY','subname','eon-light-','reate-a-me','ew/red-dra','-990.html','ApkDown','vVBRi','65\x20Months\x20','JnqQN','XLnSY','Damaged','K63','gAkzT','href','erful-graf','ZPfBi','keleton-te','devote\x0a┃╠','KglSS','Type:\x20','nvKHx','aWTGD','listcmd\x0a┃╠','Ban','packname','K13','addmsg\x0a┃╠','lWcMD','vJDLA','User\x20was\x20a','bAgaf','TbuDL','KXyMS','RmkUw','database/d','extension','what\x20[text','\x20*Search\x20R','LRaEd','rStWt','yQqnv','803-082059','JECOF','lDuyj','playstore','\x20Money*\x20:\x20','```🧩\x20Virus','isWtb','frVJP','snxoj','aenPy','MTFzq','JnhRc','happy\x0a┃╠','Anti\x20Toxic','WlwLr','45\x20More\x20Da','gayaa.hero','oTxEd','GZMqX','outputFile','animewave','DCfNG','WWFhV','eUWRu','\x20Not\x20found','YBLbN','agHsN','\x20Username\x20','https://fa','EXazE','oletics.pw','xQSCz','bts','\x20turning\x20o','igstoryxx','YRZpj','mmdue','robot\x20[rep','HAGpb','krJCy','alid','════════☬\x0a','Ohhh\x20I\x20See','berita_diu','25.html','when','EsUSV','vaKCA','film','ul\x20✔️\x0a*Your','of\x20using\x20b','IO\x20🎶\x0a╚════','\x20❮━😎','K102','DKHCR','Inactive','antibad','ʟᴏᴀᴅɪɴɢ...','to\x20activat','LxSvj','XhvWV','tube\x20video','roup\x20setti','\x20ON\x20!','FhqUW','paper-cut-','Foayy','\x20•\x0a','nEJim','\x20Session,\x20','\x20Video/Aud','asshole\x0a┃╠','toFixed','═💠\x20DOWNLOA','site🥲💔\x0a','💠══╗\x0a┃║\x0a┃╠','rKybW','eAUnG','outu.be/oi','om/prabhas','btkMH','ebsite\x20her','.\x0a║\x0a╠\x20📱VID','IbnLG','uick,\x20Quic','trawberry-','ceeQR','ZMOXE','kQzmB','aQixK','QYEWL','aRtNi','FWqwD','nge\x20bot\x20me','wait','╚»\x20TAG\x20ALL','guess\x20lyri','\x0aSERIES','adhIe','Choose\x20on\x20','SEARCH\x20|*','abled\x20by\x20o','iwesk','awoo\x0a┃╠','There\x20Are\x20','Drakor\x20Sea','\x20Fish\x20=\x2015','IRIAM','naruto\x20aes','dwund','clBLO','WJtRF','why\x20i\x20won\x27','kIVrq','sand\x20[txt]','xBYVg','bKsiV','CDxxL','TeZcs','JwpAY','nding\x20tele','siregar28/','syNHM','https://vi','https://','@adiwajshi','Lvofx','vygUG','hunting\x0a┃╠','jLnVN','devote*\x20-\x20','MdaCB','chicken','boka','yzNCD','lava','Auto\x20stick','ownload_','wRspz','\x20Perpisaha','h\x20Gold(s)\x20','antilinkig','VITBn','eply/tag]\x0a','.me\x20link,\x20','```Success','XHJaD','\x20The\x20Vote\x20','tHWyQ','\x22minterpol','python\x20spe','./lib/uplo','osaYw','data/main/','CbqeE','i-text-on-','hat\x20antili','ᴅ-ᴅʀᴀɢᴏɴ-ʙ','K51','gajah','aining\x20Ele','rvLSP','African\x20fo','antitoxic\x20','HgpwD','Short\x20Stor','NVpOv','ZkRuF','nt\x20To\x20Save','zmdRn','iuLqM','rcBuV','HZqIF','oEinC','ZLdyk','nding\x20tikt','mNhOf','elow\x20To\x20Te','jpeg','\x0aFor\x20Examp','cnn-news','═════','DhrDE','GNntl','oknOo','JWHF','🌹Owner\x20*','ElfcP','VWgAU','Time\x20:\x20','sent\x20a\x20you','ur\x20ip?','OurtE','vzoRh','PqbXY','\x0aResponse\x20','YxOsY','4HHF','lovelychec','ecmPX','qJhfw','https://i.','FKZHo','g\x20In\x20This\x20','mute\x20on','kVwyC','LECUR','Mod\x20Search','am*\x0aDon\x27t\x20','?)\x0a┃╠','ICsps','suEDW','tHITm','bass\x20[repl','ff\x20all\x20ant','-filter:a\x20','SXpOm','\x20Change\x20Wi','FicFK','LabBy','UjOrv','YhSeZ','end\x20any\x20li','Antilink\x20F','Link\x20Is\x20No','baitfood','ydiyP','CUTaW','JSjAl','BjOoK','catch','FOsEv','awoo','zdGZ','nline-free','\x20\x20\x20\x20\x20\x20\x20','decodeJid','./lib/anti','60\x20Months\x20','genre','ava-text-e','*🐔Chicken*','/audio','ZLnAQ','Vperf','\x0aChat\x20:\x20','sendMessag','RuAXo','Maximum\x2010','QIHIy','Enkgz','Complete\x20Y','QQkmA','ytmp3btn','oCnYl','ffect-940.','bZmIJ','key','VuxXR','handsome','hkweQ','trailer','wexBF','bcall\x20[tex','BJzSq','KwAWj','gma-hot-te','fUBqC','yuJfV','\x20potion\x202\x0a','Already\x20de','CVnzW','wangy\x20[tex','numve','aining\x20Gol','fiction\x20[t','LBjgl','tPAEC','=\x27hypot(re','fbdvid\x20','lFfaS','Cinta\x20segi','caption','icker/uu.w','ption\x20:\x20','qTCaB','botname','ZaqaH','Iitmd','he\x20Button\x20','70\x20More\x20Da','*\x0a\x0a*_https','./lib/medi','🧩\x20DATABASE','lilitan.he','stickermem','e-text-eff','ɴ📤\x0a╠\x20🪣ᴛɪᴋᴛ','zkSGY','EsNKv','aption\x20*','HnTwd','dWmka','yfHqK','K133','quality👇*','y-potter-t','source','pp.net','PKnSQ','EEINF','irq','icker/cry.','at.whatsap','bot','uto\x20downlo','ed.py','Team/Andro','```🧩\x20YoutT','Bro,\x20Becau','rts!\x0a\x0a*','squirrel\x20[','ibb.co/smj','zTnXC','c\x20in\x20this\x20','rjEJE','pilih','his\x20group','\x20Years:\x20','iktok\x20link','\x20was\x20kicke','🎉\x0a\x0aWant\x20To','Answer\x20🎉\x0a\x0a','KezgS','RoOPn','Dtiib','coffee','VHqqg','RyvDa','cekbot','ed!,\x20Try\x20T','jdemp','delcmd','take','lpyOi','UPYou','jZXLM','HGwrx','hXLLc','steel','Time\x20has\x20r','Pierced\x20by','LkOxk','HCbSx','UXMXb','tfYeg','ect-by-nam','--help','QjNEg','l\x20:\x20','crackhead','ilQAh','setexif\x0a┃╠','eCode','\x20Lingkunga','textInfo','mQrJM','kTaiH','wLRbW','\x20|*','ton\x20below\x0a','TShhp','auodO','vuPzo','hEjmb','VZOwg','\x20Image\x20Wit','sparklechr','dVHFN','yellow','aabbcc','JkrDl','kOllA','style','K81','zUwxn','IpiNq','\x20Genre:\x20','icker/haiy','WJlGy','jLoFA','icker/bite','Person..\x0a\x0a','pi/nsfw/wa','IhGui','\x0aAnswer\x20:\x20','scrape-pri','/visits','VOyZU','fajar-news','tpocket-se','sCIib','35000\x20Mone','amount_','```\x0a\x0aAdmin','𝗢𝗧࿐\x0aCreate','IME\x20💠════╗','sendPresen','indexOf','dio/','grdNB','skeleton','HsIHq','UBwiD','VYLEu','update','EHqBF','lide\x20link\x20','zFKbf','ufySp','\x20Vote\x20Sess','nPrnt','wlStO','te\x20This\x20St','olumes:\x20','fromObject','an),\x20For\x20E','UTxcv','═══💠\x20RANDO','Name\x20:\x20','gend','OYHfM','pKUAS','timestamp','ce-cold-te','t]\x0a┃╠','6|5|4|0|1|','on\x20:\x20','nsupp','yeget','he\x20title?','templateDo','magenta','y\x20Again?\x20P','no\x20reason','authors','dropwater\x20','ngc','ICbZx','ebinary','6|0|2','UNQAi','It\x27s\x20Diffi','\x20Thriller','QOthd','Url','WLXUt','\x20Info','oney','yCiqQ','qOSXL','\x20Chat\x22\x0aCli','\x20❤️\x20❤️\x20❤️\x20WAN','vPGAl','\x20Bahasa\x20Ja','sdagN','\x0a*Your\x20Lim','rst4BVMD9d','tSSFi','nk*\x20:\x20','Not\x20Found_','rpxNY','the\x20bot\x20in','tiktokdoc','cloud','heck\x20[tag]','WdhOr','LcwNB','E\x20✮❯\x0a│\x20\x0a╠\x20','dQyrV','dhBWG','JjSqm','hosen\x20','awuef','hapusvote','kategori','rOxJx','math\x20mode','ZIClK','oEVZm','uoMHa','spxlr','y\x20Title','mNMNM','Reply\x20Vide','wGKvw','alivepic','\x20text*','\x20Bot','se*','dMCaY','vlHgs','══╗\x09\x0a┃║\x20\x20\x20','```🧩\x20Teleg','e/master/g','eVIZr','pcygP','up\x20Chat\x20🧩\x0a','QdOap','clHCq','productIma','messages.u','gaycheck','KRbYy','qAeIk','ddtxE','date','more?teks=','templateIm','cs/sfw/smi','y\x20Text!','HAhAJ','ringtone\x20[','--*\x0a\x0a','msdxj','kmPoy','ommand?','zVRzu','xwXmq','AxVpN','ivated','rank','13-1616169','1048.html','\x0a╠🤓\x20◉\x20*ʀᴇᴅ','sWMrN','ews','═☬\x0a┗━━❯\x20','wallcode','K97','cPyhH','3|7|2','getQuotedO','now','30\x20More\x20Da','RlAcJ','our\x20Previo','uto','ifKaL','wDfmd','dvXWn','anjlJ','p.com/','2|5|4|3|0|','SiBed','url','ban\x20add*\x20t','VzZWW','icker/danc','ied\x20to\x20doe','ufRKA','tyle-text-',',\x20now\x20no\x20o','1|5','FPnet','OoaLt','off','idgka','ɴ📥\x0a╠\x20🪣ᴛɪᴋᴛ','togif\x20[rep','0|1|3|2|5|','YWJdW','sended','characterc','\x20shader','ion\x20','ses\x20:\x20','En4T','n\x20this\x20gro','\x20users\x20usi','*?\x0a\x0aTime:\x20','phAde','wycyN','lWcEB','error..','wnTUR','y\x20link😇','s\x20Answered','xtpro.me/l','\x0a\x20\x20\x20\x20\x20\x20😋MR','3dchristma','Alive\x20Text','yts','esVaf','WvJvE','QfFrO','oxic-text-','nlYwn','icker/gn.w','when\x20[text','``\x0a\x0a@','scdl','wMJXd','The\x20Patien','episodes','XeGpQ','idle','QgNIT','XTnmK','NPdvF','\x20Started\x20M','eCNlh','e-1055.htm','locationMe','\x20Read:\x20','wibu','\x20will\x20i\x20ge','uwoUf','bgNgR','6\x0a\x20Dont\x20Fo','igemoji','fuckgirl','ZWEeR','kcZoC','WJYJW','smug','QIfcc','inews-news','/close','eration\x20on','thunder\x20[t','\x20Started\x20H','QBAlm','s\x20*#tvsche','fnFkM','ps://sites','vodSx','zOZfc','i.github.c','in\x20this\x20gr','LvcUQ','hasOwnProp','groupInvit','wmxvY','roadcast\x20T','ephemeral','\x20Detected\x20','\x20:*\x20','utostickpc','YKpWB','roup','6️⃣','ufSJW','liZgA','autostiker','EvAnX','NIFUD','GhwDp','kar.js','imagenobgx','WFRPz','hidetag','views','```🧩\x20YouTu','delete','ood\x20Is\x200','tLeCA','K25','GroTh','antivirus','Image\x20Menu','ᴏᴋ\x20ᴜᴘʟᴏᴀᴅɪ','\x20Cinta\x20Sej','zFeQG','subject','═══════\x0a┃╔','vRmHR','ZUWea','r\x20pc\x20deact','hNwaH','caNxG','xJofo','\x2010','surface','K101','hYOei','═\x0a┗━❯\x20*','\x20Author\x20:\x20','K45','Example\x20:\x0a','smart\x0a┃╠','LITPn','crZPx','nUTHE','QpxFh','OrAgc','Jungle','jiOoq','gFPxK','savefrom','MiGKB','═══\x0a┃╔════','RT\x20💠══╗\x09\x0a┃','words\x20in\x20t','voicechang','ibb.co/c3F','\x20Cinta\x20Per','cheerio','FITbe','gimage\x20','this\x20song?','Caxnh','map','IcXJI','CIhsJ','fileName','xtpro.me/w','./Android/','editinfo','JuMAq','45\x20Months\x20','\x20antilink\x20','\x20aaaaaah\x20❤️','pBQxF','dxuoY','pInzB','K55','kopi','Lanjut','Words\x20ON\x20!','LINK:*\x20','VzBtw','vuEwR','ymkJe','stPQZ','XvAqi','VCbeA','XHSas','-af\x20volume','d\x20To\x20The\x20O','\x20Lyrics\x20:\x20','hosting','tourl','KWTDs','DUacl','akgpu','[url]\x0a┃╠','UmRjm','een\x20Sent\x20T','color-call','aSvxM','jpg','listcmd','KELTg','K139','uBlcW','IvjSq','CuEBU','tovideo\x20[r','CMpii','JEWLL','ant\x20to\x20giv','tZHVO','BWoOv','CIHfN','NwgKD','803-081800','bad.json','padEnd','lue-text-e','TEtef','cebook','\x20Answer\x20🎉\x0a','orts\x20link*','✮❯\x0a│\x20\x0a╠\x20To','e\x20Followin','\x0a\x0aWaiting\x20','ER*\x0a\x0a','RvsZu','lyrics','═\x0a\x0a*','\x20whatsapp','papercut\x20[','util','```Partner','rite-text-','ggzLb','y-cane-tex','803-080914','BSssY','JTKVg','dlink','lZcfh','ion\x20:\x20','reate-scie','ᴅʀᴀɢᴏɴ-ᴍᴅ\x20','```\x0a\x0a@','\x0a\x0a💻\x20Info\x20S','bwOdG','TWSnn','twitter\x20li','CwYzF','═💠\x20SEARCH\x20','K21','startsWith','ummadl','\x0aType\x20:\x20','iyGQc','trace','what\x20are\x20y','HhMWn','IsbtG','ApCTf','ake-text-e','YSbEG','play?\x20pres','═══════','cfGHi','EbNxQ','horny\x0a┃╠','jRUIg','und:*\x20','Antilink\x20T','chatModify','wLcPh','ipumN','cTQGv','Active','mzXyQ','knsAL','yYqeH','KMPZh','search?\x0aEx','icker/sari','ose*','noobra','sticker.js','s-ver-meta','FgfAR','obiLn','reverse','════💠\x20FUN\x20','listpcdrag','Your\x20Remai','Smlsy','K92','VNVTa','dNbQU','\x20Is\x20','yGamt','RVyub','sXMfD','to\x20owner',',\x20admin\x20is','groupMetad','qvxui','kill\x0a┃╠','groupSetti','CHATTING','gvzDT','An\x20Anonymo','Time\x20Out\x0aA','beli','e\x20to\x20send\x20','nslJy','outube\x20Vid','atabase.js','ny\x20link😇','Deactivate','icker/blac','K49','e\x20Was\x20Not\x20','\x20*Type\x20:*\x20','ynVrb','nsVuk','K43','_Who\x20Do\x20Yo','VAbWf','Rate\x20:\x20','giySE','ilNKj','CjlEP','Uploading\x20','from','LREaC','AnlOo','antilinkti','\x20Win\x20\x0a','log','ownername\x20','9961203DMzQVs','r\x20on','manga\x20naru','lVpqR','MzECx','PlfTf','close','\x20you\x20fuck\x20','erver\x0aRAM:','25a-3bc8&u','woxIz','YARph','yts\x20[query','RVWEL','EzXyy','CVHpz','\x20no\x20no\x20no\x20','ptt','ion\x20is\x2012.','-online-10','be\x20Channel','rjGKu','🪐\x20Other\x20Li','ODuYE','[tag]\x0a┃╠','vPvDM','patricksti','has\x20sent\x20a','AAAAAAAAAA','ipCzO','\x20u\x20want\x20to','tch-text-e','IQgmN','\x20on/off','utubevid','k\x20[tag]\x0a┃╠','guess\x20pict','ckRRN','55\x20More\x20Da','owner\x0a┃╠','CsNwM','est','tiharridho','OdnGW','nice','vxLfg','\x0a*•>\x20Flip\x20','apkmod','rock','cbXBm','jBbYs','ZDBAr','Q&s=19','vpPda','\x20unarchive','oEYvf','OPDZk','ffect-856.','RHxUb','IcFPI','patrik','JuSFE','hilih','Off','tags','iktok','Store-Karn','ITE\x20☰\x0a\x0ahtt','\x20*Time\x20:*\x20','FNGVr','document','image]\x0a┃╠','fullName','kmpvP','afWfT','zXZao','toaudio','shorystory','zHLTC','Activated','K103','AKOR-SEARC','You\x20Have\x20C','15\x20Months\x20','╗\x0a┃║\x09\x20\x20\x20\x20\x20','\x20*Status\x20:','scan','cutecheck','deskripsi','TekBV','ANGY\x20WANGY','\x20AAAAAAAAH','\x20Thumbnail','z\x20🎮\x0a\x0aCorre','toxic\x20[txt','viFVU','to\x20the\x20aby','L;waid=','nda\x0a','or\x20This\x20Pu','inventori','RiybS','gon-bot/ho','Ekyol','Mdweq','vXbit','jgPpp','\x0a*Link*\x20:\x20','\x20Name\x20Succ','reate-a-sk','-872.html','YuTQx','tiktokvid','FOHYp','buttons','\x20unban','ibb.co/pwV','get','reate-logo','CMYkY','DURATION*\x20','dcrlY','egfAf','\x0aTime\x20:\x2060','qXRkd','nXsdX','K40','XiINO','----\x0a','RJlav','jfpmv','iCJTm','attr','aded\x20:*\x20','rminate\x20Yo','\x27\x20Has\x20Been','OnFhC','antilinkyo','rup','zGMae','uglycheck','qcEmp','803-080446','QHXuM','stickerwm','wattpad','Wavfl','NMECB','wfMtj','d\x20is\x20inval','5|6','delete\x0a┃╠','toonce','Can\x27t\x20Answ','JISkc','wGmfK','us\x20Session','OJXvo','iofYS','\x20Cinta\x20Isl','ion\x20:\x20\x0a1.s','textpromen','userJid','IImEw','ditch','om/','lqYhN','uINpb','d\x20any\x20link','ss\x20while\x20h','apk','cekupdate','For\x20❮❮\x20YES','PPJhM','zINtq','videos','pload','PvbWy','Raxlt','XhOHP','UOuRt','paper','https://co','🏐🏈🏉🔥','════💠\x20RAND','NLmAk','NIAuQ','results','owner','nding\x20inst','ed\x20On\x20:\x20','vel-studio','groupParti','fOmQK','blown\x20[rep','se\x20No\x20One\x20','I\x20Don\x27t\x20Kn','er\x27s\x20name?','category/c','LxUwt','woHne','dGUfz','4|3|1|0|2','\x20or\x20del(ad','audio.json','QkQAd','femdom','ymHsK','aining\x20She','footerText','s\x20Below\x20Or','guess\x20blan',')\x20For\x20This','aired','OXCWz','VwwdM','yEedJ','pXzJH','HUvYa','groupJid','\x20*Here\x20is\x20','lDJyU','bloodglas','\x20Don\x27t\x20for','GovwE','iQZxD','Reply\x20Mess','hIFZA','NLWfb','\x20emerald\x202','fAlxp','Surrender!','basicStat','yMjnc','qWXgC','TttEU','gXPUD','\x0a*Your\x20Bai','wloXW','OBQsP','icker/kumu','\x20_*Categor','═══💠\x20VOICE','dwARB','ayam','WwrEO','*⏺️Your\x20Lim','\x20him!\x0aHe\x27s','pKOjg','\x27s\x20Broadca','IVbMZ','MEYVP','o\x20Permissi','\x20say\x20?\x20no,','\x20name?','siDyu','nPoQB','cfDau','filesizeF','STORE*\x20🧩*\x0a','-style-986','K110','ter\x20Tomorr','split','\x20Server\x20To','dnDql','it,\x20Suit\x20C','tVBFn','FXWGq','khehe1.web','eo\x20on/off','knR5/20220','kStatus','ses\x20your\x20d','SoUzo','Antilink\x20Y','rmEDf','glue','sellerJid','TKcRQ','AxYvS','aVOHx','ining🎣','720p','mplateVide','\x20Nexus','mplateDocu','stringify','3|5|6|0|1|','cEASz','_[\x20!\x20]\x20Err','ZZUcE','║\x0a┃╠','VhDvd','ZDviZ','DyesE','\x0a\x0a────────','umoxo','GnosS','playboy','ibb.co/CW6','Where\x27s\x20th','igdl','unting\x20In\x20','3|5|2|0|1|','m\x20antilink','MrEJL','kQAjX','IbGdC','cker','VE\x20','vKPoL','lqsCf','e?\x0aExample','\x20Game','BccQH','rch\x20From\x20:','TYPE\x20:*\x20','lEaaR','utubechann','ffect-with','*\x0aI\x20am\x20','fSwje','kos.life/a','swer\x20🎉\x0a\x0aWa','dMUzf','AAAH','bbGox','Fydsy','ail','/docs/nsfw','ick\x20The\x20Bu','❖\x20𝙍𝙀𝘿╺\x20𝘿𝙍𝘼','𝙊𝙉\x20-\x20𝘉𝘖𝘛','swm','disappeari','0|1|4|3|6|','bind','ownermenu','TiRBF','tzajj','sEwXt','sFhvW','ᴅᴇʀ\x0a╚═════','0|4|1|5|2|','AnXcM','VDcJA','moji+moji]','LINxA','etch-text-','Next\x20✨','0@s.whatsa','YaxCN','\x20OFF\x20!','WSegQ','\x20_Second_\x20','trap','ube\x20Channe','\x20was\x20not\x20f','CLzYY','FiKWu','jxWKp','mvRqm','ZUSFx','Read','\x20Click\x20the','toxic','25\x20More\x20Da','ydKXj','ves-text-e','friendship','eyHjG','YDCrJ','dNQyo','es\x0ahttps:/','YaSXE','aHxVo','y]\x0a┃╠','niMlZ','FJk7/20220','ve\x20Star\x0a\x0aY','qDOxx','\x0a╚💠𝚃𝙸𝙼𝙴\x20\x20\x20','tected\x20🧩``','TsOfo','xtpro.me/i','\x0a\x0aName\x20:\x20','OqCmP','LPauw','add\x20[user]','cjdQT','UVjzD','lf\x20!','nyurl.com/','803-085849','vgoos','EKzUw','HlvOo','PHWDc','yehpF','an-logo-on','herts','ce\x20Book\x20Li','TEXT\x20🧩```\x0a','\x20For??\x20','E\x20ABOUT\x20TH','K98','=>\x20In','y.webp','fagot','detik-news','IfGge','EKVeC','WHQVU','guess\x20[opt','rqgWy','n13','\x20ban','nama','online-929','ugh\x20Emeral','yoezF','Invalid\x20Li','82.html','brOoY','quotesanim','hKvVQ','UJCNw','```You\x20Are','\x20CHANGE\x20💠═','DsVcd','wzDAs','AsjuI','ment','st\x20(3)\x20🪐','LRWFy','UnWDB','K37','eGtvx','kicked\x20imm','❯\x0a│\x20\x0a╠\x20Tot','ag]\x0a┃╚════','DYLij','JyVHN','zNAZN','ytmp4\x20','a.webp','TvRKF','zjnrT','HthOk','TGVXa','d\x20a\x20downlo','WAlRf','ViPcY','P\x20💠════╗\x20\x20','lMrHx','gvgOX','2|0|4','cSKvG','SWoVw','lflBt','pinterest\x20','-free-1033','ader2','sewa','mCskr','NRSqk','hzuVf','bhosdk','UBcGP','kXgIC','HhyEj','LAwVg','hentaivid','genres','mtype','jMWIM','Example\x20:\x20','icker/gamm','ant\x20to\x20sea','AM\x20STORY\x20|','sage\x20List\x20','▁▁▁▁▁\x0a╔💠𝗛𝗶','10\x0a','bnLvQ','metalic\x20[t','autoreadpm','ibb.co/SKj','alivepic\x20[','\x20*Chats*','nce-fictio','or\x20This\x20Tr','yKYKB','sci_fi','JkxBH','\x0a\x0aView\x20Lis','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20','resolve','\x0a\x0a-\x20*Dev*\x20','vpPYI','push','e\x20Lyrics\x20🎮','❄\x20*Descrip','THE\x20SAME\x20A','13-1613049','dragonemoj','mhEXT','AMpQJ','KCUFO','AfjDj','Try\x20Search','wkwKo','k\x20Link\x20Det','DVEpm','QXWRh','classic','whitebear','gmguF','group\x20chat','downloadAn','bold*\x20hash','eMessage','uJLMN','smile','VfqZw','gold','NRMLw','vid\x20on','leave\x0a┃╠','WHrVf','mdYqT','\x20off','s\x20group,\x20m','VLbWm','AhFBY','ood','alive','animecuddl','ibb.co/4NG','xROYx','message','FxUvD','══════\x0a┃╔═','animebonk','search','JsgTc','mBrel','ges\x20With\x20','LPUld','K130','\x20Gokil\x0a','_Total\x20CPU','icker/hmm1','nhQGZ','iOBQO','bcloc\x20text','dNCid','BvThH','RBWak','MzqVd','JDpIr','\x0aRequest\x20:','pencil\x20[tx','aWSwc','com','xSrZB','TAivz','waterpipe\x20','25\x20Months\x20','burn','HwQdG','K15','scoundrel','d\x0a┃╠','TWVZY','https://my','mivIT','RHUvx','*❒🧩\x20\x20Film\x20','RrsEI','searchgc','e\x20Music\x20🎮\x0a','nPgQN','Reply\x20Imag','g\x20Question','ZcWLY','yJjpZ','tovn\x20[repl','Message','ook\x20Link\x20D','FFwYg','data','xZnEO','-style-mar','═══💠\x20CONVE','AlnFY','instagram.','text-effec','Fill\x20the\x20m','*?\x0aTime\x20:\x20','FT\x20SERVER\x20','IqmDi','zyWLg','*📆\x20Years\x20:','🙋‍♂️','w\x20to\x20speak','TCFBx','tzIZm','match','this\x20group','\x20unbanning','wsYYb','ant\x20To\x20Pla','videoMessa','QQFAQ','gle','others','ceBook\x20Lin','jkXgZ','❮❮\x20\x20📤\x20360p','What\x20Do\x20Yo','jIToh','DsBUJ','ed\x20In\x20The\x20','2\x0a\x201\x20Eleph','limituser\x0a','webp','🍥\x20*Total\x20e','MnJhf','biscuit','afkReason','qWmhU','HAsYB','yhPke','kJljp','FRQIQ','pEuXX','ujHud','delmsg\x0a┃╚═','xzqpw','dSaveMedia','brpUz','fjTAM','GxAkB','*|\x20TWITTER','url=','kzxja','old','fGnBS','cuddle','YqDTA','QLOKM','EOFVo','ly\x20media]\x0a','mTIuj','gALSn','GMtTt','E\x20NOTE\x20✅','ZIFmC','kNGGC','MtmkE','🎆\x20*Backgro','gTAem','autoreply','hoorror','gSFnc','pOWXH','ube\x20Video\x20','greatcheck','bcgc','\x0aSize\x20:\x20','pdXcl','Guess\x20The\x20','PXngs','QgnOX','rokuapp.co','dTjwT','Zcdxp','QFzYO','jVExf','RwvXD','hYQgQ','elegram','gs\x20as\x20VOIC','Smm2/20220','n?\x20Send\x20','bhULx','803-082420','ZPNEI','iosSB','OWNLOADER*','\x20SEARCH\x20|*','UYBKc','oVMuN','```🧩\x20Wa.me','kdJnL','nBMYm','n\x20Successf','HdyQK','cxtjY','jCMer','large_imag','SjatV','autosticke','Auto-Stick','sta','LSlRD','\x0aEND:VCARD','ram\x20Link\x20D','sgif','WPyqs','gaIJV','DUBlV','Gclgv','oQwxh','AuuPJ','NEXT\x20IMG','pTKdg','male','100\x20More\x20D','(s)\x20For\x20Th','y1.webp','HPntt','SVVPZ','UXdAl','GLyHU','rvers.com/','cs/sfw/','botstatus','io\x20You\x20Wan','RdEVx','UVkpG','WxVuW','RY\x20🧩----*\x0a','erOeQ','\x201\x20Potion\x20','\x20Be\x20Kicked','unblock\x20[u','deepsea\x20[t','\x20Chat\x20Bot\x20','IJFWS','\x20LIST\x20🧩\x0a\x0a','togif','ngan.jpg','emojimix\x20[','-style-onl','K26','5\x20More\x20Yea','😛CHANGE\x20BO','suitpvp\x20[t','wiki','XehQm','HGtCo','\x0a\x0aProfile\x20','utu.be/','angka-terb','state','resetgroup','khwGA','anceled','iCWVg','SopUs','BrEwD','5|0|2|4|1|','update\x20(Ch','CeHNH','wEXFo','amp','3|4|0|1|2','K11','\x20[url]\x0a┃╠','ck\x20One\x20Of\x20','yLWyQ','K44','aYDwz','🛍️','xtpro.me/n','sendMedia','vebje','rmhdY','st\x20(2)\x20🪐','oLjgH','values','low\x20by\x20cli','yDSlc','INLYy','┃║\x20\x20\x20\x20\x20\x20\x20\x20','wNLMc','mjRjV','1\x20More\x20Yea','Of:\x20','ying\x0a4.\x20se','t\x20To\x20Use\x20A','2/featured','mediaType','•>\x20Number\x20','OGMen','\x20mobile\x20le','Tuopp','3️⃣','animal','heemsBot/v','\x20ip|port\x0aU','eUCgv','dcast\x20To*\x20','because\x20wh','fqTVW','fWcdc','PlaTl','SavDB','oup,\x20which','uDJzI','SCuQs','eNuQY','u\x20want?','mining','reZdk','eply\x20vid]\x0a','creator','ess\x20With\x20','shortstory','.com|19132','\x20Ready\x20to\x20','i.agify.io','wood\x20[txt]','ne-1053.ht','kjbUa','════════','eJHec','CIOPC','Done!','YjbGk','tps://gith','ySAeB','NlBSd','*The\x20link\x20','ragon.jpg','Send/Reply','t-effect-8','There\x20are\x20','o.webp','slow\x20[repl','cs/sfw/meg','OQFsq','lanjut','s\x20not\x20cont','low','lontong','.\x20unread\x0a7','are\x20an\x20adm','website🥲💔\x0a','halah','pYtgs','imagesketc','KrjuV','Asia/Kolka','lockcmd\x0a┃╠','CvSNV','qPCNG','aJuES','Tap\x20to\x20cha','@s.whatsap','s\x20not\x20a\x20zi','wmqms','MDsNm','wOqZl','HYgpK','ngpHO','IjqfM','OM\x20💠════╗\x0a','Amazon\x20for','JHUvu','\x20\x20\x20\x20\x20\x20\x20\x0a┃╠','enluE','CYXFs','HOIOc','gram\x20link\x20','ANxGl','1.html','old-text-e','jxjSj','JLBmx','kVoMv','reate-cool','DKkkJ','UIzHg','re\x20The\x20Bug','hpInL','ted\x20🧩```\x0a\x0a','CPKzp','qBUSn','Example:\x0a','stubble\x0a┃╠','LOrtq','━❯\x20','guess\x20song','Jkmrg','oVIJK','jsgze','entries','Film','b?,\x20Exampl','\x0a║\x0a╠\x20🎶\x20AUD','ou\x20Looking','Please\x20sel','hug','.\x20@','Title\x20:*\x20','cunt','setdesc\x20[t','Choose','ly\x20deactiv','animequote','\x0a*You\x20Don\x27','BuqCX','K145','4|0|3|1|2|','\x20Chat!_\x0a\x0a*','803-081859','e\x20:*\x20','\x0aYou\x20won\x27t','(Some\x20Answ','unbEB','rainbow\x20[t','GUPuV','fdEXO','\x20link','text2','WuhxZ','VrwNa','VBTYO','istmas\x20[tx','FsKZe','hZvIe','pinterest','TpSly','nerJid','berry','NAdwJ','hit','qzbLs','agram\x20link','Use','NtwAG','Please\x20Cli','ago','how\x20[text\x0a','ge\x20This\x20St','lSdCd','\x20Answer\x20','filter=png','OOpcN','\x20})()','icked\x20imme','urrender*\x20','qzChC','sfully\x20Cha','\x0a_CPU\x20Core','nematic-ho','tloNj','UQhls','Use\x20','XFfFU','HWKwB','jRmYs','essfully\x20U','\x0aAdmin\x20has','badwords','K60','PUYlT','aosiA','he\x20Text?\x0a\x0a','WbKpi','pbexC','uying\x20It\x20T','ihkMI','jOnWH','WfhdU','\x20Text\x20With','SAUeu','\x20Self\x20Usag','?file&text','PkJGi','dbinary','IT\x20USER*\x20🧩','XfKTw','MEuZX','Anti\x20Wame\x20','803-081843','VXhQv','JLyep','s\x20allowed\x20','cYrZn','📱VIDEO\x20📱\x0a╚','Character\x20','\x0aYou\x20Came\x20','berita_url','aEXsf','line-1050.','1|4|7','animepoke','otGbI','is\x20group','dule\x20[chan','PhUGU','K65','mwnJ/20220','h\x20Fish(es)','nyIOl','zxWad','🎵Audio🎵','jeeCL','\x20If\x20You\x20Pl','neko','ITvDr','\x20🔰🌹Media\x20U','\x20Patah\x20Hat','eUsha','KwzBJ','Correct\x20An','PyMcG','Where\x27s\x20yo','nnel/video','aZbTZ','╠🙂','K24','VlhAH','JWdnn','Ytuwo','o\x20send\x20wa.','.jpg','rus\x20in\x20thi','PFwqo','Total:\x20','xlHJo','aHomg','Twitter\x20Do','Google\x20Sea','t\x20enter\x201\x20','s\x20:*\x0a','\x0a---------','UsaMR','vmLoD','You\x27ve\x20Vot','the\x20video\x20','════\x0a┃╔═══','read','fcihS','OTsVW','Keluar','\x20secs*','ExIes','n\x20antiviru','KfCKb','ilePicture','synopsis','oFmcg','HOuIe','SxBXa','WXTNe','nADAU','MgAAZ','Hairi','databaseme','reate-spac','hAxFA','\x20Jumlah\x20Me','asSticker','ixlIz','checkvote','foolish\x0a┃╠','3|0|5|6|4|','berita_jen','\x20Kristen\x0a','sticker','VWvmh','tovn','gFSve','image/jpeg','\x20Type\x20:*\x20','ke\x20[txt]\x0a┃',':*_\x20','══☬\x0a┗━━❯\x20','\x0a╠🪣\x20Ext\x20:\x20','paper/','oader/zipp','DVlkd','\x20Group\x20Lin','```🧩\x20ALPHA','SCUeX','Have\x20A\x20Pot','d\x20=\x20100000','OXjOV','menu\x0a┃╠','JyJCI','exports','versi','LSMCo','NPKxn','\x20Has\x20Left\x20','k😇','\x20Remaja\x0a','spYls','ch\x20on','mTYVi','sPZxI','mUMJg','tqtt','RdpyZ','Bfepx','ffect-1037','csonU','erty','\x0a\x0a╔💠𝚂𝙿𝙴𝙴𝙳\x20','qZlLZ','ng\x20bot\x20in\x20','lTVly','ong\x0a2.\x20pic','═══════\x0a╠\x20','fliptext','rl?','yblKm','wqAkU','ᴀᴅᴇʀ\x0a╚════','AMeBy','cs/nsfw/bl','MDZwG','---*\x0a\x0a*','\x20Malaysia\x0a','viewOnce','K73','jKroF','Button','pcruc','oqbgJ','*|\x20MCPEDL\x20','uHlZi','t\x20Food*\x20:\x20','XzWPW','bWdIO','bEifl','PRIHq','inYxK','\x0a\x0a@','h\x20Someone\x20','vfePQ','LASFh','ses\x20:\x20\x0a','twitteraud','uRDeD','ow,\x20Ask\x20Yo','CXLsI','low\x20',',\x20Press\x20Th','d\x20For\x20Sure','locked','return\x20(fu','updatebot','2000','n\x20tiktok\x20a','VONJY','pTSDH','Desc:*\x20','UFawx','QQLnG','zzLUh','darahawal','can\x20[text]','_*\x0a\x0a🥇','ehUlW','xjLQF','fmSjM','EkydS','version','mcnUF','rCqsQ','alEAS','icker/amo1','ediately!','MbzVw','s\x20sexual\x20g','er\x27s\x20Name\x20','\x20Title:\x20','bWXPg','gaycheck\x20[','uglycheck\x20','allmenu','Guess\x20the\x20','NnWLI','neduC','footer','bal','K135','vegUk','cSKNb','cENYa','[\x20◉\x20ʀᴇᴅ-ᴅʀ','video\x20[nam','HdhvD','uIIRn','WOqWd','WcSsP','xGIBT','K36','kBKZP','fGHHC','ng/baileys','JkqmH','gvxlb','domba','ftaaA','ou\x20Want\x20To','le.png','ss?','TAGRAM\x20DOW','Waiting\x20Fo','FbqqN','ok\x20link\x20in','lovesticke','LdCPv','mediaUrl','anonymous\x0a','linkgc','endLimit','moment-tim','EfeuT','src/hremo-','an\x20Send\x20Me','Ngrqa','ck\x20[tag]\x0a┃','IWPzN','matrix','uqWPu','360p','WCZhV','UYman','s\x20the\x20butt','nt\x20To\x20Play','fVdhW','ujGol','activated','online-103','elephant','\x20disable','VEyif','RcnhP','iftdu','DRfnv','KDVBn','icker/bow.','TWNwB','tml','flPQx','aining\x20Iro','VzOXO','tallic-tex','ElYJc','ami\x0a','iNaDw','botAdmin','To\x20Video','\x20Type\x20The\x20','toaudio\x20[r','ypivN','n?\x20Press\x20T','@develoka/','antispam','dJLkU','xzeCH','📤ʀᴇᴅ\x20ᴅʀᴀɢᴏ','xFOvN','bPpXd','\x20\x0a┃╠','dogesticke','tion\x0a2.bai','PUxmq','tZDkB','\x20sticker\x20o','ery]\x0a┃╠','Your\x20Blood','msg','ames/caklo','``\x0a\x0aAdmin\x20','ckJiJ','K46','kqbZP','ybe\x20he/she','available','audio/mp3','lirik.json','jkOBN','HeCJU','zuCLF','at\x20you\x20sen','jnAcE','n\x20Pribadi\x0a','dyUjf','atues?apik','YzzGs','EeLvS','ply\x20*','ZNYlH','pat\x0a┃╠','PFhZP','Set\x20your\x20g','KEAmZ','MCcjS','san\x20','rmyhz','rd\x20by:\x20◉\x20*','ound\x20In\x20Da','com/DGXeon','K70','9999999999','YLWDq','cache','VAZUb','nVWXZ','JZEJI','ibb.co/M7T','gqZYT','oIMbK','BzfmE','on/off]\x0a┃╠','\x20Can\x20','ccept/Reje','Reply\x20stic','\x0a\x0a╔❮✮\x20YES\x20','chatbot','AwNNd','n\x20is\x20free\x20','archive\x0a4.','mlJZn','UTPOD','ESULT\x20]\x0a*I','hentai-nek','NjJAX','icker/angr','VpfNh','Food\x20=\x20250','NUiCV','yt480\x20','xtpro.me/c','SPsfm','eoQGW','ures\x20🪐','zcsLS','fakeObj','UViBg','\x20Misteri\x0a','kala','table','filesize','🌐\x20*URL:\x20','age/afrika','glue\x20[txt]','AHVmy','*\x0a\x0a','reply\x20in\x20t','For\x20This\x20T','green','following','Text','.php?url=','\x0a*Mime*\x20:\x20','KUBda','\x0a╠💡\x20Durati','/api/downl','popularity','\x0aIt\x27s\x20been','webtoon','sAVaz','GJvvG','xvldc','sbtTQ','listaktif','own.js','RMNqt','skop\x20From\x20','cry\x0a┃╠','UXsXj','igtv','ound\x20or\x20ma','lick\x0a┃╠','\x20Title\x20:\x20','shorts','delvote*\x20-','rFFGG','krHHl','mczIN','0|4|1|5|3|','\x20Menu\x20Erro','circuit','rGZSD','OZyYo','sacrifices','nu\x20to\x20Docu','wGLng','-circuit-s','VvKnJ','K42','xzxzf','KdQfn','sonal\x20Chat','Uqvte','xqyZy','prettychec','-dragon-bo','ioPlR','╠🧸\x20Title\x20:','miwRl','icker/eat.','eed...','currentTur','0.html','stRDR','IDGSo','K80','uery]\x0a┃╚══','tDbWo','constructo','eCKKF','Meadow','ulgeu','OKLbH','cpus','mute\x20[on/o','yt720','😒ERROR:\x20Fi','Hey,\x20watch','randomanim','tCxyl','WAnqN','zZgzC','animehandh','───❉','o\x20Heal\x20Usi','JqqBI','InyTf','gWQeM','wallpaper','R\x20|*\x0a\x0aCapt','bxRkc','n\x20youtube\x20','y-metalic-','\x20Is\x20Not\x20Su','QboXf','xz7c/20220','\x20Inspirati','-filter_co','mute','diately!','t-generato','VbLNI','VNYiTjq9mX','IFMRR','Good','ZkrXt','bPOIu','${dragonem','Tomorrow','ytdoc\x20','Bjifn','6|5|1|0|2|','deletemsg','OlbSD','FfMIQ','yWFNa','```Please\x20','candy','l\x20Link\x20Det','\x20aud]\x0a┃╠','ckThW','chat\x20[opti','BuOQz','dzEzf','chat','t1000','jlNEH','ep(s)*\x20:\x20','Scratched\x20','rebAI','readmore','setppbot\x20[','etected\x20🧩`','rvGKA','```🧩\x20Faceb','BQTTv','FfkzU','mple\x20:\x20','From\x20Webp\x20','xPhBS','1917\x20[txt]','toString','s\x20will\x20be\x20','10\x20More\x20Da','reate-3d-n','*📫\x20Title\x20:','lieve\x20in\x20m',',im)*sin(0','VpCra','MTUnq','ufixD','etjnN','rNJCy','iktok\x20on/o','\x0a\x0aView\x20Mes','bqbOl','Kind-Heart','ntUrl','────\x0a','KxIeB','mining\x0a┃╠','ytaudio','he\x20image\x20u','xKYkQ','Url\x20Source','eaabI','LgPiZ','ed\x20🧩```\x0a\x0aY','VWyXJ','gFHHe','jvAuv','K108','gura','Can','moji,\x20eg?','nWCiP','i.memegen.','ZmoBo','lesbianche','═══💠\x20TEXT\x20','perW','twdlxx','group','sHjvH','blush\x0a┃╠','[\x20MINING\x20R','isits','tMQEt','demote','\x20in\x20AFK/Of','iMcbu','RsiPm','twitterxx','DSohh','play\x20[quer','Slipped\x20in','RIyOb','*Location*','qZUvK','singleSele',']\x0a┃╠','HQruJ','wpyNU','ejXDp','okbyxeon','Hello,\x20','_[\x20🐺HUNT\x20R','gJsNv','.hneko','addmsg','gecg','reate-wond','TUNVy','❮❮🎶Audio🎶❯','By\x20','RmECz','jkFDL','JkvZO','TITLE\x20:*\x20','conversati','\x20[tag]\x0a┃╠','KIVbr','poNIT','uGQctUWRUR','yIgtp','RUDwt','🎸TEXT-to-I','803-082344','iTITd','downloadme','❯❯\x0a*','Next➡️','hNYds','sSticker','auhxj','aLUrW','qpUtV','igh&media_','category','rCQeK','uZOxm','zoFKW','fAXFr','/zipball','HRrmQ','ig\x20','SWvvm','\x22atempo=1.','\x20smelly\x20i\x20','vote','*🐘Elephant','kFJSW','ringtone','nCVTK','BASBJ','reate-blac','pGPFM','his\x20Transa','DpyMK','speed','OKowG','ffect-gene','LQTfk','cnNyh','YsUrY','hpfBO','KXbiV','alivemsg','ence','sfzro','JqSBZ','e-Ke-Liye/','apikey=hdi','tag]\x0a┃╠','iMMqq','tner```','➡️Next\x20Imag','tMLUp','NXqfO','ibb.co/tqT','806-112256','What\x20Are\x20Y','\x20Media\x20Url','m/api/','neondevil','-883.html','Delete\x20Suc','buttonsRes','nFhmp','After\x20This','goose','K122','issors✂️','wFyjaPZ9eo','K111','zNFQJ','bHOCU','rpgmenu','Have\x20Enoug','sPOSw','if]\x0a┃╠','dWbCoCb3Ta','icker/hmm.','JnGwy','*🐇Rabbit*\x20','//github.c','hClyd','is\x20group\x20o','date)\x0a┃╠','adcast','PgYXf','2|3|0|5|4|','-effect-on','ee-online-','snow\x20[txt]','Ask\x20Your\x20G','oup','=\x20100000\x20M','Lyrics','nnel','path','dEEox','antiwame','toUpperCas','JrPGZ','NxVqf','./lib/xeon','sENwW','updateProf','haOdR','eibDN','d\x20to\x20ban,\x20','\x20Message\x20l','fLFHq','-ᴅʀᴀɢᴏɴ-ʙᴏ','ity:\x20','WQUMl','lPjcd','\x20Penantian','leaves\x20[tx','antitags','tqAdO','Kclyf','\x20has\x20no\x20st','undefined','vQXZK','phvid\x20','NhYJu','host','convertmen','`\x0a\x0aAdmin\x20h','NOuyJ','The\x20link\x20i','rainbow2','wyGFa','90\x20More\x20Da','mmZsc','tabase','fbddoc\x20','Unbyqwh4vA','deZwi','ftfsw','ults*_','Generous','h\x20Iron(s)\x20','UGJrC','https://yo','okQKn','ck\x20to\x20chat','rTagv','xtpro.me/s','hortstoryx','\x20Is\x20Gone,\x20','emit','watermark','kwpIN','KWsYV','XcTcz','\x20instagram','\x20HERE🎉\x20🧩\x0a\x0a','K82','SggtS','NQotl','QZMDq','ɴɢ...\x0a║\x0a╠\x20','enable','free-1073.','Cidlc','.github.io','JcVyR','images','WrITe','suit','icker/imhi','════════\x0a┃','\x20Be\x20Blocke','vwiwR','KjuSf','ta\x0a','yqqUs','yaVgk','UeZkw','yoOvx','\x20*Link*\x20:\x20','presences','ine-1004.h','TSXqo','dNaGN','preview','QHvLW','mimetype','RyjyL','ALIVE','rPInw','what','zdXWO','udHfr','2|4|1|0|5|','6,asetrate','classic-8-','banchat','TAXwx','videoId','\x20fish\x202','tsiXp','winner','e_url','dDywG','XgVkh','\x20This\x20Grou','8bit','MnAfQ','YfMau','\x20«╝\x20\x0a\x20\x0a\x20➲\x20','tSUEQ','DD/MM/YY\x20H','oRjaR','UISCa','CxXLC','posHj','vjmXv','\x20channel\x20a','d-underwat','\x20Is\x20Playin','BBqIm','uDSDn','ly\x20stick]\x0a','nged\x20to\x0a\x0a','lWMgR','t,\x20Finish\x20','ync','Send\x20order','https://te','OARD*\x20🧩\x0a\x0a','What\x20film\x20','Session```','xrzgs','utton\x20Belo','_\x0aTag\x20The\x20','antilinkgc','HsgRH','bQHQs','Reply\x20Text','other','eWOSP','ited\x20defea','oud-text-e','\x0aIn\x20','aper','🚶Start🚶','trans','YBZvi','xvUao','adGdO','```🧩\x20Link\x20','Urfik','as\x20been\x20di','/Video\x20Wit','s\x20Transact','qBunB','hornycheck','yaoi','PHBJb','ion','tal:\x20','Mmdx/20220','GrvbH','pRPyV','n\x20enabled\x20','ZIRMy','nt=proacti','rbBhJ','prLKf','CUMENT\x20🔊\x0a╚','JTXUv','ymoQM','GVCDo','upsongvn\x20[','K88','\x20Nasihat\x0a','end\x20audio\x20','orror-bloo','avalD','Already\x20ac','FsLEV','EdNZm','disturbing','yaRVX','ZNoMi','@bochiltea','YXstK','cked\x20immed','XClcm','HAHYW','Uquvg','ly\x20Updated','kpink-logo','KRxJr','KqNLb','AaLNm','templateVi','MXnXs','nk,\x20admin\x20','mit\x0a\x0aExamp','etJZI','RHVRL','qfwiS','uOECk','setcmd','zychw','\x0a┃║\x0a┃╠','║\x20\x20\x20\x20\x20\x20\x20\x20\x0a','VJOqb','\x20Budaya\x0a','\x20video\x20ant','Case\x20:\x20','audio','POLZU','LdDsh','qNOUq','uEVhh','HA\x20HU\x20HA,\x20','PCVEB','list','link\x20in\x20th','BuxNg','vauOr','Link\x20error','ibb.co/nRt','*List*\x0a','ping\x0a┃╠','vHJai','PyLzl','OGqZo','dvsJK','2️⃣','cUuvs','CFmGw','\x0a\x201\x20Emeral','attp2','heowJ','cToe\x20Sessi','cDbXW','zRhvD','any\x20link','YBNPl','moji','cCP93imNEc','wYmdc','Error\x20link','cken*\x20:\x20','JWJcH','g.webp','desc','shift','tinyurl','\x20apa\x20arti\x20','gWuUA','Both\x20Playe','jfLWs','ber-kecewa','ayZxU','cVYwZ','nsfw','er\x20on/off','twitter.co','AAndQ','=>\x20From','═══💠\x20DOWNL','fat\x20[reply','SxbbY','zmXZJ','K30','🧩\x20HERE\x20🎉🧩\x0a','metalic','PyDoD','TEJNk','wEhjy','*\x20❮\x0a┃\x0a┃╔══','HqBUF','uDqmu','ngs\x20here..','reate-a-tr','\x20Category\x20','ticker\x20on\x20','nter-holid','WrBZd','\x0a\x0aAdmin\x20ha','meow','nYeGk','0|4|1|6|5|','ff]\x0a┃╠','\x0a*Hash\x20Lis','next\x0a┃╠','he-sky-onl','ipCtj','vrPne','eDYxv','ress\x20The\x20B','\x0a╠🎞️\x20Resolu','BkwGR','ueeQh','gqxYn','nRKlq','rZMKn','https://ap','wfiPL','Fall\x20while','l]\x0a┃╠','──❉\x0a','\x0a*Gold*\x20:\x20','Official\x20w','```🧩\x20⚠️Warn','spooky','it\x20on','T\x20PRO\x20💠═══','WAITING','\x20_*Pass\x20Mo','.com/view/','quoteanime','node-cron','wallrandom','hentai-wai','tnswH','DUBoL','cixbn','\x20*👇Select\x20','rSjHn','gcShc','OKaPI','jJsTF','jAimV','UzbkX','=12','ffect-onli','img','get\x20to\x20vis','ZdAan','vYdbZ','tempo-news','SULT\x20]_\x0a','SRBCS','iuhpF','getmsg\x0a┃╠','nsert\x20a\x20va','nswer:\x20','AlIof','profile\x0a┃╠','filename','Edit\x20Group','DBdtJ','IYwoy','WsyFM','RKiWE','vise\x20For\x20O','IkHls','ILnnx','mumaker','nsfpY','KWpLB','*Example\x20:','oDmca','rMUfE','r]\x0a┃╠','hDXNF','readFileSy','searchmenu','xjvSb','ine-1043.h','pKwcb','\x0aport\x20:\x20','\x20can\x20send\x20','NyhHp','\x20💠══╗\x09\x20\x20\x20\x0a','Eycdf','tebakan','descriptio','\x20Developer','src/remobg','handsome\x0a┃','icker/flow','1726503eYNpEL','13\x20-161495','FBDFz','ly\x20Reporte','text]\x0a┃╠','KQITu','twmp4xx','XEliy','\x20🧩```','*Bug\x20Repor','t]\x0a┃╚═════','3|7|4','ZjRDD','en\x20Your\x20Bl','K116','\x20gold\x202\x0a\x201','om\x20query\x0a\x0a','h\x20Caption\x20','dFznR','FDMzZ','daWRR','editinfo\x20[','The\x20Most\x20*','wink\x0a┃╠','OBQGt','handhold\x0a┃','am\x20antilin','adwalbiosk','MvGIW','PUORV','lxUqf','XVNaT','\x20Followers','n]\x0a┃╠','VaNFQ','nswer\x20🎉\x0a\x0aW','cessfully\x20','YgFDq','ff\x20antitox','displayTex','To\x20Gif','🎸Database\x20','JAcME','tiktok\x20lin','UlUMN','beautifulc','Limit\x20Rese','1|0|2|3|4','SgQAt','Urpoi','hcUMd','mfitk','UAaCJ','nXUyU','leaves','\x20(@','\x20Bahasa\x20In','ᴘʟᴏᴀᴅɪɴɢ..','kind\x0a┃╠','JNppJ','\x20Start\x20Vot','tcDQd','poke\x0a┃╠','yUetX','wangy','XxkDd','XYhgI','YFiSt','mbRmQ','USSJJ','EqNeu','Category:\x20','MtTgY','\x20/\x20','njQue','m/scraper','\x20Url\x20:\x20','ale🙎🏻‍♀️','orderMessa','pokCR','abric-text','HmaQY','Rpmof','KAzzN','YGTmL','🧩\x20','e,\x20Example','BGLAZ','4|1|2|3|0','zaTTI','jeHGz','git','sendImage','alivemsg\x20[','performanc','\x0a\x20*🌍\x20Sourc','UHHRT','gucci','ing\x20On\x20Goo','KLArq','groupRevok','soundcloud','XgneE','ero','bXhxZ','_[\x20HUNT\x20RE','ZfSvm','\x20he\x20marrie','hentaivide','pen','lvCmJ','ktDxN','wekSR','K28','\x20sticker','VeywB','tZuIf','tion:*\x20','ed\x20is\x20not\x20','beautiful\x0a','KcmZA','tourl\x20[rep','QOOAu','fHehD','https://ze','2|5','earthquake','0|5|4|3|2|','weONr','WMnyK','googleimag','4|5|3|2|0|','name','\x0aIf\x20you\x27re','ime\x20Menu','erest',':\x20*','LgObI','reate-a-cl','FsLIr','uavLE','sfrpv','GVBGH','age/tropis','-ʙᴏᴛ*','anime-wall','806-115940','fGdSx','JscLd','setppbot','ill\x20In\x20The','aqFPV','media','*Message\x20:','eAyIR','sketch','tmkbD','priceAmoun','CLICK\x20HERE','DDXWk','NUvlD','LYvGY','57.html','will\x20be\x20ki','Successful','gUDrJ','\x0a5.\x20read\x0a6','rLGam','bcRwO','IgIcy','6|3|1|2','nobu','entory','15\x20More\x20Da','Sent','\x20chicken\x202','K123','\x20ajg\x20|\x20ea','clIrJ','Ubhie','KjGnQ','bcTox','EOVcd','aUuQn','YboDa','pdRrU','PzefW','Bxbii','cuckold','fiction','hoJxf','gAJcl','*Wounded*\x20','GvvDA','pi/sfw/nek','nished\x20ses','wVuSa','min,\x20don\x27t','o\x20this\x20ima','CzCgs','klRdV','IaSCr','Anti\x20Virus','\x0a➸\x20*Limit*','For\x20What\x20C','report','yivYw','\x20https://u','BVuAP','searchMang','g\x20On❤️💖👀','Kfxdt','qvtsc','me/','line-932.h','upgAL','2732337itAuga','dercc','ytsearch','tjXWK','/\x20DEVOTE\x20\x20','https://me','sbImQ','K147','dEekz','-1011.html','DDMMYYYY','┃╚════════','ers\x20Have\x20S','admin','mainmenu','vQGFz','pat','un\x20out\x0aAns','ggsCW','\x20@Xeon','zEUYt','th\x20Caption','n\x20twitter\x20','rakor?quer','\x20is\x20Locked','vAMLI','cs/sfw/lic','leavegroup','\x20Now\x20You\x20C','aSEHS','801-195323','ly\x20Deleted','lzDjU','ibb.co/CP8','ibb.co/WxG','he\x20new\x20own','HgyBP','nd\x20any\x20lin','xNpbT','🎸Convert\x20M','lolos','sender','n\x20all\x20anti','Yes','userlimit','PjKmr','templateBu','to\x20send\x20vi','success','alEIb','e\x20:\x20',')*\x0a','═══💠\x20ANIME','cutecheck\x20','lFhae','translate','prefix','SIsnB','ctReply','══════════','tRskY','ofrnl','wallpubg','ply/tag]\x0a┃','groupAccep','admin\x20is\x20f','cBBET','od*\x20:\x20','eme/repl.j','yGQVI','tqto','jgCwK','GTsbT','MsTbs','donate','wERrS','\x20Rohani\x0a','board','KNDFS','\x20Anonymous','*Answer\x20th','\x20Whatsapp\x20','le\x20','visit\x20our\x20','rite-in-sa','e]\x0a┃╠','option]\x0a┃╠','fKgPE','SIZE:*\x20','JTBGJ','rHaaQ','headers','eRfSF','Answer:\x20','\x20Anak\x0a','iately','vGWFr','jijVY','ly\x20Opened\x20','qPAKf','ʜᴜʙ\x20ᴅᴏᴡɴʟᴏ','profilePic','PxcL','qxWCv','lipnote.de','attp\x20hello','9169091372','gpoXm','EeeWK','skypeemoji','a\x20do\x20you\x20w','ytmp3','bet\x20:*\x0a','pgzcI','.\x20mute\x0a2.\x20','deration\x20:','cRvDE','RMwtu','sgOPO','fQmEJ','e\x20Message\x20','BLabel:Cli','/post/gus-','https://ci','Image\x20🔍*\x0a\x0a','deo\x20link\x20i','iVNZD','nSBhc','jWrBK','DwDCq','LeGeV','wVnPk','6|3','fgCHO','friend🤢','KFtpH','\x20text','icker/lajj','KdrdX','mentionedJ','\x20Following','er2.webp','kfkeB','OTQNW','\x20Nexus\x20Han','facebook.c','ge\x20to\x20make','neonlight\x20','juice','tomp3\x20[rep','.neko','D\x0aVERSION:','dOxuD','ment\x20Menu','ueuDP','IUxBu','nge','tyqmA','MP4\x0a╠🤓\x20◉\x20*','Mode\x20Edit\x20','delcmd\x0a┃╠','eels','JPziX','jVKaP','hwSss','icker/gn1.','K41','still\x20unfi','\x20play.xeon','5.html','CIfVU','-effect-93','mojiemoji','ArOSD','\x20u\x20will\x20be','ube\x20video\x20','ljhSd','apiKey','s\x20Chat\x0a\x0aCl','wnloader','\x20admin\x20is\x20','AUmAc','matrix\x20[tx','sheep','KNrLA','resetgclin','ibb.co/fHP','n\x20group\x20ch','eGYOi','FfQlc','join\x20[link','rock\x20[txt]','SfhjI','CqjkY','4|3|1|2|0','WwtNx','unarchive','4819368ofOMkf','n\x20the\x20auto','AcQLc','Success','pisodes:\x20','dMMfP','7|4|3','VmeGb','AIlZZ','URCgE','sendText','XXodH','K47','SCYug','gXYjg','HGRTU','ed\x20🧩```\x0a\x0a@','COroG','T\x20MENU😛','LsEJW','.next','\x20Ramadhan\x0a','SXIno','n\x20nsfw\x20in\x20','\x20MHZ)\x0a','slap\x0a┃╠','iomuz','Success!\x20Y','\x20Views\x20:\x20','ffect','\x20send\x20any\x20','KKPiS','fEVVv','mKpPQ','twddlxx','gram\x20Link\x20','KHAjy','rl]\x0a┃╚════','TDcbF','Hdfju','TuYZk','teel-text-','can','nction()\x20','pXsno','kitchen_v5','bXCKx','6|0|4','gewYk','YIIEP','buttonText','xdpVR','XxXvg','❮❮\x20\x20\x20🎶Audi','wOBDb','transforme','pQwFn','\x201\x20emoji,\x20','ne\x20will\x20ab','063.html','swm\x20','lassy\x20Edit','Menu','mine','nk,\x20admins','years','phvid','⫷\x20ALL\x20MENU','getmsg\x20','umin','DgBbO','ibb.co/gtB','VyueL','pornd','lhffD','dBkSY','n\x20antitoxi','fish','apis.com/v','yyTAa','Else\x20:(','cbxsk','chocolate\x20','qpLuI','volume','ypYAN','BTrOO','ble','script','Bjaxo','eSubject','fbzUl','DjKsE','You\x20Are\x20St','ZtZsK','743@g.us','ibb.co/tZX','pediaemoji','IAqBi','-af\x20atempo','chatbot\x20on','fpInQ','MCjPT','cljuw','kKina','happymod','ember\x20who\x20','cument','rDBML','DfodS','jHtYu','wallneon','judul','⫷\x20UNMUTE\x20⫸','═══💠\x20GROUP','hZFPS','jmvVa','dog\x0a┃╠','mzWvp','o:width=2:','body','ZNzJD','stupid','\x20packname|','Question\x20:','h\x20Missing','zbIOF','upvote\x0a┃╠','\x20article\x20>','CM6K/20220','-realistic','storage/im','FfwgI','d\x20is\x20a\x20lin','pmJSz','K119','ff\x20nsfw\x20in','56BrIFVA','.shinobu','cuddle\x0a┃╠','w.instagra','Score','GGYqs','azNLA','exec','wDOPw','uAdLz','username','the\x20user','o/Audio\x20Th','AoifM','us\x20Suit','oji}\x20Media','ODlzH','devote','3|6','deepsea','hoose\x20A\x20Su','mysoulmate','══╗\x20\x0a┃║\x20\x20\x20','zMuHX','qUsnn','ice\x20[txt]\x0a','antiwame\x20o','lay\x20Again?','NAlzu','\x20baitfood','🎐\x20*Popular','sYSGt','AllData/st','NrRnB','bug','Mode:\x20','0|2|3|4|1','QdKRm','kyCNV','PZDMN','VolwB','ata','4|0|2|3|6|','DUFBr','gMNBH','Suit\x20Has\x20B','MhjHi','ion=emoji_','iately!','loveshorts','LFZPd','mediafire\x20','F6Yj/20220','le\x20Over\x20Li','LFegi','5\x20More\x20Day','\x20I\x20don\x27t\x20w','\x20-filter:a','pqMVp','aLwqO','▅▆▇█▇▆▅▄▃▂','ff\x20tiktok\x20','unmute','Activate\x20','bloodglas\x20','\x0a*Size:*\x20','_currentTu','\x20\x20\x20\x20\x20🧩\x20Onl','kwHGu','jCyuC','age/rimba.','Gif\x20Menu','IaaWD','aPbaU','aKsZW','Nnxqg','nLWop','on/off','linkwa','dGRlK','wKzZu','OGAcA','\x20Session\x20D','UEzAm','JGZTf','blueBright','ifu.pics/a','underwater','fTnhI','ine-1047.h','SER👨🏻‍💼\x20]_\x0a\x0a','he\x20gc','nk\x20in\x20this','noob\x0a┃╠','append','t\x20to\x20chang','ire-text-e','atnm','ator-onlin','⫷\x20OWNER\x20⫸','nerd\x0a┃╠','dog','XBpvy','-ʙᴏᴛ*\x0a║\x0a╠📥','YxQxJ','QtXqz','?teks=','13-1604595','ᴏᴋ\x20ᴅᴏᴡɴʟᴏᴀ','*Instagram','p.com','\x20:*\x0a','#content\x20>','oween-skel','K10','PdORl','it*\x20:\x20','\x20Sejarah\x0a','You\x20Don\x27t\x20','reate-berr','FfGvr','lJSzU','ine-934.ht','WEIuR','uptime','\x0a*YOUTUBE\x20','zJlkQ','https://ne','wtoPd','oFzQv','nKqKf','qIcrw','tiktok\x20[ur','pYKWQ','.\x20delete','ou\x20are\x20usi','sZheB','snbIq','-free-1038','framed','highfive\x0a┃','fWcbq','QEyer','QUALITY:*\x20','editinfo\x20c','OdRKc','_*No\x20Votin','hnlnL','kNdxh','xtpro.me/3','eHBtF','mdsDV','IzAeB','xSChK','Failed\x20to\x20','mediafire','couple\x0a┃╠','K109','*🐑Sheep*\x20:','t/home\x0a\x0a\x0a\x20','NasJb','Video\x20Menu','\x27\x20From\x20The','BaOUh','320kbps','Infinity','ZuyJX','qEocR','upvote','ff\x20twitter','OUHju','xdSsg','re\x20are\x20you','ader\x20featu','kmygl','AllData/im','UqERc','UjmOS','DkSdV','kvvCW','K117','NDVjl','he\x20link\x20br','YlGZe','qCmac','tlCfK','OQwxb','pi/sfw/nom','jajTx','FKpbV','iMXba','gCoOt','s\x20Audio\x20Wi','Type\x20on\x20to','lBvfC','\x0aip\x20:\x20','psBVn','cGjea','LArlu','.webp','rs:*\x0a','wymwK','IontG','UZAIQ','\x20article','here\x20are\x20','nu\x20to\x20Imag','businessOw','*Story\x20','r\x20[txt]\x0a┃╠','find','glomp\x0a┃╠','tod-api','\x09\x09\x09\x09\x09\x09\x09\x09*','bOyGN','bcimage','\x20not\x20an\x20ad','aper\x20do\x20yo','Menu🥀','bNYZF','nwaifu','thanksto','animebully','Session\x20In','Tflfi','aLiSU','THEia','Limit\x20','fKUDM','ad\x20Media,\x20','UaZOY','gKUjY','KLtQA','\x20be\x20kicked','\x20banning\x20t','CFeQG','ll\x20on/off','qQuIh','oxBNC','ikGDn','YHddC','hBukA','hQquX','Please\x20cli','ree-text-e','thunder','thumbnail','\x0a\x0aSuccessf','DFrus','instagramr','\x20[txt]\x0a┃╠','Pwdmv','hIFkS','HUzjz','Next\x20⚡','juqZT','hunt','zJNbN','NaBBk','\x20Sending\x20B','*🎥\x20Genre\x20:','IRyjV','a\x20]\x0a\x0a\x20\x20\x20\x20\x20','how\x20[text]','\x20DON\x27T\x20CAR','\x20disabled\x20','\x0a\x0a\x20Result\x20','tiktokvid\x20','\x20To\x20Play\x20S','he\x20link?','NaFJg','UWWtd','qTrgz','toaud','\x0aTo\x20Downlo','GIGPG','tGYwd','*🤴🏻\x20Creator','fnQom','SrtYq','ig2','JTufT','JmkPP','ne-914.htm','YWsjr','MTWNO','spank','oESpC','100\x20Months','\x0a\x0a•>\x20Group','number','DFpgd','\x0aSource:\x20','fibBQ','UjZAG','lHDvR','yoFJI','═══💠\x20OWNER','ff\x20instagr','studios','vQyof','K54','eYClI','er/limit.j','earrape','oqGDQ','sephxeon13','animespank','rate\x20[text','gsLgF','Invalid','NFpsx','d\x20Partner,','\x0a║\x0a╠\x20🔊\x20DOC','NIjtN','jooXp','ccLGp','OkQJj','MyAPK','OADER,*','nfmOV','uEOGq','lCVQi','ader','ol-graffit','ning\x20Money','t\x20From:*\x20w','kcpDa','okOPD','3820465fLEONW','*Hi,\x20','jTQvH','whZmw','foxgirl','WBBuR','hFgbU','YQfAP','1|2','HyPfw','4|0|3|1|2','eSvKR','SRjAv','animewlp','\x20Duration\x20','kTJmk','rch?\x0aExamp','FcIdX','oes\x20Not\x20Ex','LQqew','toimg','*❤️Your\x20Blo','RDREJ','GitHub\x20:\x20h','*SOUNDCLOU','Group\x20Sett','thiccy','ByiYG','o\x20Chat\x0a\x0a@','stubble','berry\x20[txt','Media\x20','icker/loku','bnFH6CxbI','smug2','s\x20Full','.html','mma.id/cha','video','tfBEV','5|3|6','Use\x20Text,\x20','8W7R/IMG-2','xfarr-api','WdOBo','afk','HwjoI','🎏\x20*Favorit','groundFrom','in\x20roots','\x20_*Title\x20:','dogla','spEdC','[query]\x0a┃╠','Turn\x20','chatinfo','Which\x20anim','wCkw/20220','rkInh','gqMjD','065.html','WxOps','random','ytmp3btn\x20','K100','gteny','remove1','IUTEW','XWvTE','\x20For??','oUMDo','hbZGr','VYfNG','k\x20!','film_title','mYaaT','Emoji\x20erro','Jgnna','Life\x0a','nuDXO','yaoi\x20hd','extendedTe','CBNJo','bABWQ','block','cQrUo','lizard','updateBloc','Group\x20Link','selectedBu','jBuJy','pretty','ymRRI','olution\x20:\x20','cLyCu','\x20in\x20this\x20g','\x0a┗━━❯\x20','gqHoF','https://tw','Sell??\x0aExa','nVrVO','.```\x0a\x0a[\x20◉\x20','fUxNb','(async\x20()\x20','gXNuo','\x0aNo\x20body\x20i','3|4|1|2|0','enu','nnzjU','SVZaO','VkfOp','SHA256\x20Has','K31','Wait,\x20Look','black','setbotpp','age','wMQHH','fficient\x20F','KkMWj','ralYb','HeBBw','on\x20below','JNVfB','yFYwz','ory\x20upload','\x20will\x20be\x20k','SHfDh','TafLL','valid*','Zwoxu','K68','Hunt\x20Again️','oqvOH','sendTextWi','Link\x20Detec','removeBack','lKaTG','.net','Group!*_\x0a\x0a','VrbBr','fuck','MSDZM','HCPfI','qgWmU','SXDsX','kamBL','VsouW','|*\x0a\x0ahttps:','ames/tebak','💠════╗\x0a┃║\x0a','wikimedia\x20','xaKml','PSMvW','XRmjI','gBwGE','groupmenu','title','ytshorts','the\x20list\x20o','followers','BBnVI','WnEbu','NESgB','K77','0|4|3|1|2|','ker\x20with\x20c','5|1|0','bKsxA','NlNlh','l\x20link\x20in\x20','setmenu','e-free-104','════💠\x20GROU','rpOPA','on*\x20:\x20','Knows\x20Abou','\x0a\x0a_Choose\x20','cDTOW','t\x20Have\x20Eno','sourceUrl','QySoN','JzGhm','seMessage','XBjcZ','gSshv','his\x20group,','sections','ytmp4\x20[url','Anonymous\x20','s\x20[txt]\x0a┃╠','\x20\x20\x20\x20☰\x20WEBS','cissors✂️','vooub','ay\x20With\x20Th','altv','ff\x20autorep','Not\x20carefu','er/darah.j','MpEbt','harrypotte','1|2|3|0|5|','format','bit(s)*\x20:\x20','BWKPY','rAZcI','getmsg','age/','JCdiM','MhsOn','skeleton\x20[','eDiRf','-844646129','ssEJT','What\x20wallp','whatsappem','vdPIo','an\x0a','users','IUSaz','How\x20','yQMUC','daily-news','guess','IzumS','*◻️️Your\x20Ir','AOoKe','k-and-whit','K66','XqFde','dMxDN','\x0aDon\x27t\x20for','RfQWl','icker\x20Comm','YLdGv','BUdUR','erah\x0a','ine-1040.h','xbSRX','BeOmw','dWaIs','triggeredw','gyxvI','y100.json','./lib/jadw','selectedRo','hBcTh','s\x20:\x0a','\x0aplayer\x20:\x20','vbWBd','MqvmQ','35\x20Months\x20','jmomM','\x20_miliseco','```🧩\x20Group','xrSKS','UNzzG','pPsPl','envTk','\x20Gold\x20=\x2050','TpaTx','spam','IorPv','avXta','\x0aLastchat\x20','QAeiA','dropwater','nightcore\x20','ʀᴇᴅ-ᴅʀᴀɢᴏɴ','/fungames/','\x20Penyesala','DacWE','WUCCi','IZoKT','servermc','Partner```','NTHgi','QRylU','JuoJu','pPRhr','https://ra','ccykr','autobio','joox\x20[quer','```🧩\x20Bad\x20W','mqvjB','\x20💠════╗\x0a┃║','tes.google','mHEWi','dYPAc','DEErd','e\x20who\x20send','a.me/','orest','kdQCI','open','IFEbl','QUWeT','below\x20to\x20d','dQIYb','unreadCoun','MmnRQ','animebite','OuKWN','le:\x20','e\x20followin','bGxbb','xtpyY','JQiDe','TVgQq','replace','command','anChat.jso','VQenC','paces)','*|\x20REQUEST','Grjdk','jfecr','❮❮\x20\x20📤\x20240p','RvfTz','emojimix','AAAH\x20','*Wrong\x20Ans','qnzeG','All\x20Answer','./lib/pint','e\x20up\x20','OuIHp','tJnOr','film\x20Spide','duration','hidetag\x20[t','K62','WokSC','kvQAZ','bKYAw','You\x20Want\x20t','banned','sendReadRe','SKlYI','ssage:\x20','-filter:v\x20','wfojx','Below','age/tamban','ft\x20on/off','NhgAR','hbpTB','FJooAtHTaP','naruto','waktu','{}.constru','xXBVN','MKZER','UzUlF','uke','The\x20link\x20y','hKwbW','click\x20the\x20','aT7ibfUsGS','obGhY','\x20My\x20Dp','xtpro.me/m','ACBqS','HtbbQ','*\x0a\x0aNama\x20:\x20','mcserver','y,\x0aSuit\x20Ca','FPBQU','rl=','QjXgx','=0.75\x22','boQom','-joker-onl','pi/v2/img/','lesbian\x0a┃╠','tsCbA','TbQVC','YxCpD','K140','ibb.co/ZcV','nswer:\x20\x20','xt]\x0a┃╠','BiDgO','IXCQz','240p','IBxHU','SHdUY','PJfSZ','LtnEn','Song','iQGcg','rchase','uPSFb','exnlM','K39','ts-online-','\x20rabbit\x202\x0a','PRO\x20💠══╗\x0a┃','ink','DdJLv','\x20Sedih\x0a','1|3|5|4|0|','annel\x20link','he\x20Text?','seconds','Bshwj','\x20please\x20ad','\x20*Group\x20Ch','CSyLf','CvHpN','quotes','K38','lovestick','BQhMR','1️⃣','kbZEw','tWNXt','──────\x0a\x0a','oUeEr','K52','jpqxF','IFoWb','upsongvoic','\x20hinata','QQtqj','KErmN','-wall-graf','YLuvJ','delttc','Youtube','pornhub.co','e\x20port??','75\x20Months\x20','tuvOf','uGEzs','emNRt','zDFge','BY63t7Vx2t','animenom','age_\x0a','*Remaining','RWDUu','CIFpq','ajQJC','nline-1023','PrsPV','cWURE','nk\x20!','result','ACybr','ly\x20aud]\x0a┃╠','uAqAT','AeeRP','rDUvv','Disable','OpytU','\x20sec','nding\x20yout','YloLn','attp','K79','blackpink\x20','fXwwO','````⚙️🔄\x20Bot','IWTzI','test','itYpe','UBZUB','fKtAP','n\x20telegram','top,\x20anywa','CRlLV','\x0a╠📍\x20Channe','bkOcn','arBYA','AeJZt','ic\x20in\x20this','\x20For\x20This\x20','age/padang','d(s)*\x20:\x20','ovwzw','GcYHz','cRBQT','AllData/th','t\x20Death_','cs/sfw/glo','0|3|4|6|2|','fbemoji','del','HZszt','OqlJR','soal','d-text-eff','sMUoH','Gahld','WDtel','Where\x20is\x20t','meta','❮❮\x20NO\x20❯❯','ater-pipe-','he\x20Audio\x20Y','it\x20In\x20The\x20','lGPFt','20\x20Months\x20','*\x0aI\x20am\x20☬𝗥𝗘','emenu','MtuHh','gpMgV','guess\x20ridd','bcall','CcMbr','-devil-win','*Query\x20:*\x20','e\x20name\x20noo','\x20|\x20Runtime','RngBs','VXgaR','indozone-n','pGiNs','Red\x20Dragon','*\x20Is\x20@','userlimit\x0a','.mp4','\x20hello*','istmas','USD','\x0a•\x20','n/off','dXoZz','jawaban','dYWbV','KwKFg','DApVf','FXknf','ty\x20:*\x20','S68YZFY6AJ','──────────','diNqx','owjob','GY\x20WANGY\x20W','IQwyF','zMEuw','kpyqU','officialwe','\x0aWant\x20To\x20P','cdCmO','wuCvH','stshT','?\x20Press\x20Th','eKJmJ','XbbUY','GNXbe','Jeoys','ZHikh','vfiCA','mentions','0\x20Money','EUqkY','\x20codecs=op','DsAYx','icolor-3d-','regular','fkUkx','n\x20/\x20off','FVzwA','templateMs','ShQNs','FfGrI','thMentions','sPVkO','bdsm','ttt','heck','icker/','SWZIk','Ioetv','\x20What\x20','com/iamriz','r,\x20please\x20','holoh','essive-gli','ponseMessa','lit','value','cREsP','🎸Search\x20Me','UNJRQ','dBfFs','═╗\x0a┃║\x0a┃╠','PiEEW','BAnxb','jahy','GCzmJ','imageMessa','xfluj','3\x20With\x20Cap','.xyz/hit/C','SCGnK','uNyps','antilink','is\x20[text]\x0a','Unzvy','hSqMx','RPWNc','OaJGK','dogeemoji','QUALITY\x20:*','arafat-sum','ibb.co/gRk','⫷\x20ALIVE\x20⫸','autoreply\x20','firework\x20[','K105','qPcFx','pencil','IPgNX','ter\x20link\x20i','OmLxM','dklQF','tmoIx','NrhCG','K20','wrssp','ytmp3\x20[url','K115','s\x20sent\x20a\x20y','LKqph','writeFileS','hqUZG','hot\x0a┃╠','\x20web)\x0a┃╠','tECOH','ISUhn','\x20Type\x20:\x20','\x20┗━','VAalU','download','react','🎸Voice\x20Cha','Which\x20mang','wikimedia','nurl}','ing','\x20List\x20🧩\x0a\x0aT','yRLAk','UnXIY','3|4|2|0|1','ssage```','HiHOM','VwEee','qwzdq','EVSRF','ZBwCK','ZVSLJ','glitch\x20[tx','ayer','/page/','d\x20because\x20','red-dragon','\x20Url:\x20','k\x20antilink','animecring','AllData/au',',\x20You\x20Will','tion\x20','\x20Group(s)','jRNkm','checkvote*','textmaker-','cvKIN','iBiqS','EdJaS','📈\x20*Status:','_\x0a\x0aBy\x20\x27','scifi\x20[txt','hneko','AMSdK','bgWhite','site🪐\x0a\x20\x20\x20\x20','ᴀɢᴏɴ-ᴍᴅ\x20]','cast\x20To\x20','pesan','NQLTL','ly\x20img]\x0a┃╠','Kudbl','YgcoD','\x20Anti\x20Bad\x20','ow\x20to\x20choo','ames/famil','getName','cunt\x0a┃╠','sapi','le:*\x20','zippyshare','xtpro.me/h','donlod\x20','\x20To\x20Find\x20A','yshare?api','PLAYING','DppJi','Hash\x20Not\x20F','\x20360p','znZRa','gZmpZ','meusC','wFMGU','vTTMR','resetlinkg','turn','OIdwj','CdxOF','rget\x20To\x20Gi','2|5|0|1|3|','\x20You\x20Are\x20C','iVzaR','msyM/20220','ibb.co/Cwf','⏩Skip⏩','kiss','anime','es:\x20','💠\x20RPG\x20💠═══','\x20Play\x20Agai','menu','FzxiF','pdated.```','nZKcX','EbVyq','wId','ff\x20youtube','iTWWF','-1060.html','JbfVw','wSzNN','XPSbg','op?kota=','twitter','cot-logo-c','dZaBz','```🧩\x20Twitt','antilinktt','zaHOX','reate-a-ma','\x20❤️\x20@','ping','AMgfZ','witter','dl_link','12:overlap','ffmpeg\x20-i\x20','gXmRC','lNSVu','nds_\x0a\x0aRunt','BYBjZ','rWkZS','fPaMw','xtMessage','xImaJ','\x20Filetype\x20','Menu\x20🐥','kSmHd','igstory','rgSlg','PHOTO','iIfhf','ics\x20below\x20','\x0aQuotes:\x0a','SBTHM','*|\x20INSTAGR','delvote','\x20Chat\x20Menu','vKrEA','IQnfl','yXaMp','a\x20instagra','FMEll','Back\x20Onlin','g.jpg','ibb.co/Bzv','ZsPHP','ppfkH','VhHvT','\x20𝙍𝙀𝘿╺\x20𝘿𝙍𝘼𝙂','n/off]\x0a┃╚═','TigiB','./lib/scra','behnchoda','mumu','XDIBT','y:\x20','dLWAf','audioMessa','File\x20Over\x20','ff\x20telegra','cs/sfw/hap','buy\x20[optio','══════☬\x0a┗━','er\x20Link\x20De','\x0aDesc\x20:\x20','ha2006','PaDkG','1418.png','wFVuq','OlUOs','cs/sfw/wav','UuGoa','checkvote\x0a','SdtnI','Welcome/Le','sabled\x20in\x20','iiFAX','\x20File\x20Name','YjmZy','s\x20bot\x20work','ouagP','FBlbV','eply\x20aud]\x0a','😂💔','./lib/text','Please\x20Sel','t-effect-o','reate-3d-g','yt-search','TE\x20✮❯\x0a│\x20\x0a╠','render','e1.webp','sticker\x20[r','dBTtd','ctor(\x22retu','Olzzb','textrepeat','rJurh','ftEYn','\x0a-\x20*Link*\x20','reation-10','volumes','SJCEG','EiGHd','-884.html','pPkzw','bonk\x0a┃╠','cs/sfw/yee','HhQOu','kNWrI','antivirus\x20','unwatchFil','\x20*Descript','object','Sentence','XjRhJ','woof','\x20domba\x202\x0a\x20','jatoh?url=','??\x20*Ended\x20','🧧\x20*Genres:','MevTG','OHJFR','dule','\x20Game\x20Over','❮❮\x20\x20📤\x20720p','ing\x20For\x20A\x20','keys','aFWVk','IoVSB','nEwVp','YGCze','zDJNt','horror','XfGEb','3|4|2|1|0','aXabX','tebakgamba','KtfPs','rGPRq','reate-a-fr','85\x20Months\x20','DOdaQ','ooky-hallo','nding\x20link','ree\x20to\x20sen','hatmenu','ᴇᴅ-ᴅʀᴀɢᴏɴ-','./lib/tikt','stGqH','krYFa','heal\x0a┃╠','ljwEe','ated','JqAGM','BEGIN:VCAR','rIoMk','setdesc','Words\x20OFF\x20','annot\x20Be\x20U','nned','g\x20Suit\x20Wit','ected\x20🧩```','iOHvs','st\x20(1)\x20🪐','dance','yOQHg','ibb.co/4f3','morou','ppyshare\x20l','ywiki.js','\x20Lucu\x0a','cMZaN','DFFKq',')*cos(0)\x27:','\x20Anti\x20Spam','MahtO','dragonchat','UduSc','iYuSI','nHThU','CJELu','\x20Seconds','Afk/Offlin','reYPO','AAAAAAAAH\x20','Bug\x0a\x0aExamp','uajDU','pixelate','WoiOA','XTyTb','k\x20to\x20this\x20','xtpro.me/f','webtoon\x20[q','3dstone\x20[t','*Send/Repl','_*Suit\x20Res','\x20❤️\x20❤️\x20YEAAA','YOypD','\x20second','NolqL','e\x20Picture\x20','chatbot\x20of','K67','Nyiqa','_rumput.jp','loda','\x0a╠🔗\x20Url\x20:\x20','ucVei','➸\x20*ID\x20:*\x20','EFHDu','promote\x20[r','tton\x20Below','icker/whok','KVZtV','XkhVn','JfPzI','LefOE','Film:\x20','````⚙️🔄\x20Own','pi/nsfw/','link','More','dbinary\x20[r','┃║\x09\x20\x20\x20\x20\x20\x20\x20','cs/sfw/smu','ihXMW','\x20Command,\x20','IICRx','wQnQV','kick','XSWEw','ebinary\x20[r','wer!*','STLuZ','K138','receiptTim','Age\x20:*\x20','kiss\x0a┃╠','fQMvM','darkgold','buttonId','OmRZx','7|8|3|0','*Your\x20Vers','RpgFP','lNeBi','═══💠\x20RPG\x20💠','TicTacToe🎮','M\x20💠══╗\x0a┃║\x09','\x20jakarta','gmpUP','iaxya','zgNUG','headerType','xtpro.me/o','ggvlZ','IFurs','each','Geebz','ses\x20will\x20b','JjgcX','rRTFF','Success\x20in','PrGtW','ion]\x0a┃╠','XhaQd','mell\x20of\x20ha','whatsapp.c','jOJhj','OhugJ','MTbEw','⫷\x20INFO\x20⫸','by\x20a\x20wild\x20','doge','jkSBY','SXbpk','ry=$text}&','animewall2','\x0a\x0aCorrect\x20','EOkxM','rry-christ','\x0a\x20*📟\x20Quali','ated\x20antit','google-it','reduce','audio/ogg;','igs2','gambar','er.webp','PQznM','VIEGY','e-archive','rLbxR','lRzgi','FXDkl','OnWhG','t\x20Of\x20Messa','d\x20is\x20not\x20a','The\x20messag','t\x20HELL\x20you','\x20Pendidika','berita','osen_\x0aNow\x20','*TWITTER\x20D',':*\x20','string','emEjc','wallpaper\x20','EFkAh','\x20hunting','yoxJp','ly\x20Closed\x20','k\x20in\x20this\x20','K104','SwuFN','\x20💠═══╗\x0a\x20\x20🤩','nlKTr','JoOZf','eton-text-','\x0a\x0aHealed\x20:','Open','glue2','markRead','WXuMz','tomp4','then','DWEcv',':*\x0a','nstagram\x20o','yt360','n:*\x20','cmROr','word','ree-online','3|2','BgCEi','chutiya','ulTbm','RIJpt','TAzqF','0|3|1|2|4','*👍🏻\x20Like\x20:*','emoji-api','ct-861.htm','nnJXa','Drakor','wBzZC','Find\x20A\x20Par','WcNHf','in\x20is\x20free','HZTcm','VUZgM','Uejli','WFzzY','JhajQ','70\x20Months\x20','Welcome','028.html','gKtMi','ineqF','VljgG','QUhTe','ing\x20me,\x20','Stop\x20being','vJPKe','CFCPB','598@g.us','xrEHr','iQRld','MTDcX','ive','🎴\x20*Produce','persahabat','ubBQk','gODUs','ess\x20The\x20Bu','DKitz','mnAik','ksLbh','JPApQ','lkAGq','cringe\x0a┃╚═','lTchk','ᴏᴡɴʟᴏᴀᴅᴇʀ\x0a','XfdQb','DVjXe','writing','UqomV','http','\x20seconds!','oKzfh','./settings','cry','o\x20Broadcas','e\x20out\x20in\x20a','icon','MOizD','K12','setgcname','NpwbO','liHgL','\x0atype\x20auto','kfkyY','*SAVE\x20FROM','ffect-1054','\x20Cinta\x20Rom','ttps://git','IMVfV','ZqyAJ','wOiJF','●\x20𝙍𝙀𝘿╺\x20𝘿𝙍𝘼','Nfi8','gifPlaybac','VqMyp','wibu\x0a┃╠','link/image','🪣ᴛɪᴋᴛᴏᴋ\x20ᴜᴘ','wHHgA',':\x20@','HAJAJ','icker/hiii','XiFaY','samsungemo','main/Guess','\x0a*Your\x20Rem','ube\x20channe','size','\x0a╠📧\x20ID\x20:\x20','nzHnr','und!','yFDZQ','mLfiN','grouplink\x0a','kuapp.com/','vtsWc','send5ButIm','LpEHT','0|5|3|4|1|','ielzh','h\x20Elephant','YXGJo','wYrte','nZCrd','oHeVe','rpjNb','ifeun','want\x20to\x20sm','CuVSX','The\x20Button','couplepp','KnYzW','IHsDw','isForwarde','multicolor','mogPy','tkDFH','listRespon','views_coun','*🧪Your\x20Pot','api/transl','at\x20You\x20Wan','\x20Persahaba','FQyIZ','JvFdX','qAOlb','egOCW','EueAH','```','iielV','qaTpp','on\x20To\x20Dele','tzLnI','nnel\x20link,','kvRJS','rNeEn','UvKrg','oji','RCaWd','hKozp','bFgSs','on-foggy-w','rIeQK','SLiWR','ag!','qcykY','toimage','FjwTp','setmenu\x20te','\x20Partner``','ZkzBN','0G8P/20220','trim','unlocked','\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','http://cer','cute','WUaVF','iofficial','GjrDC','re\x20has\x20bee','tictactoe','K112','*📚\x20Url\x20:*\x20','\x0aPublish:\x20','NAKhz','xtpro.me/t','join','Send\x20video','d\x20but\x20you\x20','sgUEn','dtAhu','cXFEp','Enable','lKJBb','2|5|3|0|6|','p.net','tiful?url=','playerO','ana.webp','✨\x20*Based\x20o','bbzEH','christmas\x20','doqKm','sell\x20[opti','K56','zjYha','ample:\x20','removebgxx','NWGrT','SsOzI','\x0a┃╚═══════','K14','ilink\x20in\x20t','diOsP','cXBOi','86h6d6u4AX','gGzrT','XXaex','ted','cNHDf','eply\x20txt]\x0a','circuit\x20[t','*❮❮\x20VOTE\x20❯','VIXtP','K18'];_0x31fd=function(){return _0x4d730d;};return _0x31fd();}const _0xb485fa=(function(){const _0x10acf0={};_0x10acf0['jijVY']=function(_0x1b025d,_0x397763){return _0x1b025d===_0x397763;};function _0x8dde2f(_0x43c430,_0x3e18bc,_0x558b3f,_0x13ccc8){return _0x2506(_0x43c430-0x97,_0x558b3f);}_0x10acf0[_0x5517da(0x15ec,0xce2,0xd4a,0x4c3)]=_0x8dde2f(0xc81,0x14a6,0xfdb,0x506);const _0x34d948=_0x10acf0;function _0x5517da(_0x7aa836,_0x4051e9,_0x7aff16,_0x4778a9){return _0x2506(_0x4051e9- -0x5b,_0x7aa836);}let _0x427c01=!![];return function(_0x46b157,_0xb4446){const _0x44a364={'oEYvf':function(_0x17b095,_0x15761b){function _0x13a4b9(_0x33ed6c,_0x39d20e,_0x4072f1,_0x51a45b){return _0x2506(_0x4072f1-0x126,_0x33ed6c);}return _0x34d948[_0x13a4b9(0x21ab,0xc5d,0x1826,0xe3a)](_0x17b095,_0x15761b);},'envTk':_0x34d948['CuEBU'],'NxVqf':_0x530ad4(0x28b9,0x1ad7,0x2aed,0x1cb8)},_0x3279e2=_0x427c01?function(){function _0x167626(_0x48c1ce,_0x446c35,_0x527194,_0x3c7915){return _0x530ad4(_0x446c35,_0x446c35-0x1d1,_0x527194-0x1bb,_0x527194-0x23);}function _0x18c4b5(_0x550360,_0x250a09,_0x466103,_0x4425da){return _0x530ad4(_0x466103,_0x250a09-0xdc,_0x466103-0x9c,_0x4425da- -0x9f);}if(_0xb4446){if(_0x44a364[_0x18c4b5(0x1793,0x1127,0x1aea,0xc18)](_0x44a364[_0x18c4b5(0xb3c,0x1755,0x239f,0x1857)],_0x44a364[_0x18c4b5(0xb1c,0x3ca,0x39e,0x126e)])){const _0x4958ee={};_0x4958ee[_0x167626(0x2840,0x1c45,0x1e14,0x27f2)]=''+_0xddde59[_0x18c4b5(0x68a,0x19c,-0x6c1,0x11a)];const _0x52f62f={};_0x52f62f[_0x167626(0x61a,0xb68,0x6b7,0x1491)]=_0x56d8be,_0xe1c5f7[_0x18c4b5(0x922,0x146a,0x17ba,0x95d)+'e'](_0x283d39[_0x167626(0x388,0x16a4,0x1267,0xb13)],_0x4958ee,_0x52f62f);}else{const _0x4ac3b8=_0xb4446[_0x18c4b5(-0x891,-0x74b,0xa3,0x22)](_0x46b157,arguments);return _0xb4446=null,_0x4ac3b8;}}}:function(){};function _0x530ad4(_0xd7e9ec,_0x618603,_0x469af4,_0x4feefd){return _0x8dde2f(_0x4feefd- -0x1d9,_0x618603-0xd4,_0xd7e9ec,_0x4feefd-0x1a5);}return _0x427c01=![],_0x3279e2;};}()),_0xea37a3=_0xb485fa(this,function(){function _0x462626(_0x152e59,_0x44ed53,_0x46ecf1,_0x1a922e){return _0x2506(_0x152e59-0x3cc,_0x1a922e);}const _0x2cef05={'dWaIs':function(_0x1f7729,_0x339d5a){return _0x1f7729+_0x339d5a;},'cbxsk':'Surrender!','vkXVD':function(_0x44cc4e,_0x746d8e){return _0x44cc4e(_0x746d8e);},'onuSp':function(_0x149aca,_0x12472a){return _0x149aca+_0x12472a;},'hMZUM':'family100','WwVxN':function(_0x2749bf,_0xf7e134){return _0x2749bf(_0xf7e134);},'vQXZK':function(_0x3559c3,_0x55eed4){return _0x3559c3!==_0x55eed4;},'yGQVI':'IaaWD','LPUld':function(_0x5e0338){return _0x5e0338();},'VhDvd':_0xe93839(0xd99,0x7d8,0xbea,0xe13),'oTxEd':_0xe93839(0x2076,0xf48,0x24af,0x1dfc),'WxVuW':_0x462626(0x22d2,0x2e43,0x2873,0x31d2),'lYHbM':'info','PyDoD':'exception','Hdfju':_0x462626(0x16d5,0x246b,0x1c22,0x1848),'xSrZB':_0xe93839(0xcbd,0x1c36,-0x7b,0xde9),'adhIe':function(_0x54e80f,_0x1dbba3){return _0x54e80f===_0x1dbba3;},'vJDLA':_0x462626(0x2302,0x2ed0,0x2be0,0x1ac8)};let _0x13d32c;try{if(_0x2cef05[_0x462626(0x182f,0x1e44,0x22a7,0x1223)](_0x462626(0x1c01,0x1bf5,0x1a8f,0x2942),_0x2cef05[_0xe93839(0x126f,0xa8b,0x2149,0x175d)])){const _0x53b4a0={};_0x53b4a0[_0x462626(0x22ff,0x246e,0x2d95,0x1723)]=''+_0x2396e8[_0xe93839(0x101e,0xdfa,0x246e,0x16b1)];const _0x1df464={};_0x1df464['quoted']=_0x40adda,_0x5f595f[_0xe93839(0xf45,0x1acb,0xf6f,0xbb7)+'e'](_0x586ae7['chat'],_0x53b4a0,_0x1df464);}else{const _0x36691d=Function(_0x2cef05[_0x462626(0x697,0x951,0x7bc,-0x83c)](_0xe93839(0x205d,0x17d4,0xe14,0x12bf)+_0x462626(0x1b5b,0x21e5,0x1cd6,0x1975)+(_0xe93839(0xd9a,0xf16,0x1dc3,0x1b0e)+_0x462626(0x203f,0x2397,0x1ef3,0x163c)+'rn\x20this\x22)('+'\x20)'),');'));_0x13d32c=_0x2cef05[_0xe93839(0xd70,0xaef,0xff6,0x105f)](_0x36691d);}}catch(_0x1273e3){if(_0x2cef05[_0x462626(0x182f,0x12f1,0x16f7,0xea3)](_0x2cef05[_0xe93839(0x69c,0x109a,0x3a8,0xf60)],_0x2cef05[_0xe93839(-0x10a,0x75a,0x3cb,0xad2)]))_0x13d32c=window;else{const _0x371a1c={};_0x371a1c[_0xe93839(0x100a,0x2dd3,0x14c1,0x1f0d)]=function(_0x2a786d,_0x551ca7){return _0x2a786d+_0x551ca7;};const _0x32ebd7=_0x371a1c;_0x2d6501=!![];let _0x232677=_0xe9df36[_0x2cef05['dWaIs']('family100',_0x275d21['chat'])],_0x3f9b67=_0x38a786[_0xe93839(0x16be,0xa38,0x1029,0x93e)+'e']()[_0xe93839(0xdee,0x1d6e,0x2477,0x1ae5)](/[^\w\s\-]+/,''),_0x13aaf5=/^((me)?give up|surr?ender)$/i[_0x462626(0x1ed4,0x27e9,0x1521,0x1db5)](_0x506e43[_0x462626(0x22ff,0x2274,0x1fd5,0x21f4)]);if(!_0x13aaf5){let _0x2e3e91=_0x232677[_0x462626(0x1f14,0x10c2,0x258d,0x16cb)]['findIndex'](_0x20937a=>_0x20937a[_0x462626(0xc91,0x1010,0x5a,0x886)+'e']()[_0x462626(0x1e38,0x2a42,0x28c7,0x1e5d)](/[^\w\s\-]+/,'')===_0x3f9b67);if(_0x232677[_0x462626(0x2254,0x2091,0x1456,0x21a5)][_0x2e3e91])return!(-0x4*0x5dd+0x419*-0x3+0x23bf);_0x232677[_0x462626(0x2254,0x2760,0x2daa,0x2ee7)][_0x2e3e91]=_0x9654d9[_0xe93839(0x1340,0x2426,0x25f3,0x1741)];}let _0x1c3531=_0x232677[_0x462626(0x2254,0x27a2,0x19c1,0x25c8)][_0xe93839(0x7f5,0x1480,0x113a,0x651)]===_0x232677[_0xe93839(0x19da,0x1238,0x198e,0x1f01)]['filter'](_0x56ba8a=>_0x56ba8a)['length'],_0x62afb4=(_0xe93839(0xade,0x1732,-0x3df,0x822)+'e\x20Followin'+'g\x20Question'+_0xe93839(0x15e9,0x1610,0x1069,0x1aa6)+_0x232677[_0xe93839(0x1bea,0x1030,0x21e5,0x1b9b)]+(_0xe93839(0xb15,0x91d,0xfaf,0x3d2)+'s\x20')+_0x232677['jawaban'][_0xe93839(0x390,0x45f,0x1009,0x651)]+_0x462626(0x1543,0x10ed,0x1fd9,0x175a)+(_0x232677[_0xe93839(0x27a1,0xeac,0x154a,0x1bc1)][_0x462626(0x1c8b,0x1d2a,0x17e4,0x187d)](_0x2381b5=>_0x2381b5[_0x462626(0x73e,0xb26,0x1594,0x7a0)]('\x20'))?_0xe93839(0xdbb,0x1237,0x1dc4,0x11d4)+_0x462626(0x1a77,0x16e7,0x17bb,0x2403)+_0x462626(0x1e3c,0x2a32,0x2920,0x1eab):'')+'\x0a'+(_0x1c3531?_0xe93839(0x22c0,0x2813,0x2645,0x1af3)+_0xe93839(0x194b,0x12ca,0x1a6e,0xd0c):_0x13aaf5?_0x2cef05[_0xe93839(0x171d,0x1e5c,0x18a8,0x182e)]:'')+'\x0a'+_0x32d66f['from'](_0x232677[_0x462626(0x1f14,0x21e0,0x2dbe,0x2c37)],(_0x5e8497,_0x9f11f0)=>{function _0x6cf060(_0x270d8b,_0x4f77ce,_0x29d255,_0x5aa749){return _0x462626(_0x5aa749- -0x518,_0x4f77ce-0x111,_0x29d255-0x1c4,_0x270d8b);}function _0x353283(_0x327874,_0x3bbbc1,_0x51b0f2,_0x1a83c7){return _0xe93839(_0x327874-0x15e,_0x3bbbc1-0x17,_0x1a83c7,_0x327874- -0x390);}return _0x13aaf5||_0x232677[_0x353283(0x1b71,0x20e6,0x1028,0xefa)][_0x9f11f0]?('('+(_0x9f11f0+(-0x3*0x3bd+-0x1a7c+0x13*0x1fc))+')\x20'+_0x5e8497+'\x20'+(_0x232677['terjawab'][_0x9f11f0]?_0x32ebd7[_0x6cf060(0x1c2f,0x148d,0x2492,0x1d48)]('@',_0x232677[_0x353283(0x1b71,0x12ff,0x2131,0x1b4b)][_0x9f11f0]['split']('@')[-0x23e9+0x43d*-0x5+0x391a]):''))['trim']():![];})['filter'](_0x189f6f=>_0x189f6f)[_0x462626(0x21dc,0x23fc,0x3046,0x1e8e)]('\x0a')+_0xe93839(-0x9b0,-0x3ec,0xd81,0x3cc)+(_0x13aaf5?'':_0x462626(0xb83,0x7a5,0x1209,0x7f1)+_0xe93839(0x233d,0x2158,0x1d74,0x1c3f)))[_0x462626(0x21cd,0x14e8,0x15af,0x1bd6)]();_0x41391d[_0xe93839(0x2427,0x263b,0xc6d,0x17e7)](_0x37668e[_0xe93839(0x1849,0x18b6,0x1cf9,0x13ff)],_0x62afb4,_0x36a2b1,{'contextInfo':{'mentionedJid':_0x2cef05['vkXVD'](_0x190caf,_0x62afb4)}})[_0x462626(0x2127,0x2fe7,0x1afb,0x28c0)](_0x16a459=>{function _0x16f335(_0x59c174,_0x55262e,_0x18becb,_0x416cfe){return _0xe93839(_0x59c174-0x2a,_0x55262e-0x13e,_0x59c174,_0x416cfe- -0x36);}function _0x1321d8(_0x42c167,_0x34664a,_0x47b73b,_0xf7bb1c){return _0x462626(_0x34664a- -0x167,_0x34664a-0x90,_0x47b73b-0x1eb,_0x47b73b);}return _0x37f007[_0x2cef05[_0x1321d8(0xf50,0x1c8b,0x1166,0x27b0)](_0x16f335(0x491,-0x39b,0xcba,0x7e8),_0x13fd8e['chat'])][_0x1321d8(0x186c,0x1e45,0x18a5,0x225e)]=_0x538f4b;})['catch'](_0x376f20=>_0x376f20);if(_0x1c3531||_0x13aaf5)delete _0x380f0d[_0x2cef05['onuSp'](_0x2cef05['hMZUM'],_0x3073fa['chat'])];}}const _0x2c073b=_0x13d32c[_0x462626(0xa54,0xc22,0x3e,0x195)]=_0x13d32c['console']||{},_0x2b0068=[_0x462626(0x118c,0xe61,0x3e0,0x1131),_0x2cef05[_0xe93839(0x61d,0x1e4d,0x135d,0x1117)],_0x2cef05['lYHbM'],_0x462626(0x2376,0x267b,0x16f3,0x2e4b),_0x2cef05[_0xe93839(0x1b80,0x169a,0x20e1,0x15d6)],_0x2cef05[_0xe93839(0x1035,0x2171,0xbf8,0x1804)],_0x2cef05[_0x462626(0x13c3,0x100d,0x11dc,0xd6c)]];function _0xe93839(_0x5c7cca,_0x406cf0,_0x5bc097,_0x10d2c8){return _0x2506(_0x10d2c8-0x79,_0x5bc097);}for(let _0x1c2a60=0x3*0x451+0xc84+-0x1977;_0x1c2a60<_0x2b0068[_0x462626(0x9a4,0x6b6,0x439,0x1177)];_0x1c2a60++){if(_0x2cef05[_0x462626(0xe76,0xea0,0x6d2,0x426)](_0x2cef05[_0xe93839(0xe3b,0x1447,0xaa6,0xab4)],_0x2cef05['vJDLA'])){const _0x31afac=_0xb485fa['constructo'+'r'][_0xe93839(0xb6d,-0x16f,-0x50b,0x96e)][_0x462626(0x12df,0x787,0x83b,0x121f)](_0xb485fa),_0x3ef037=_0x2b0068[_0x1c2a60],_0x87422c=_0x2c073b[_0x3ef037]||_0x31afac;_0x31afac['__proto__']=_0xb485fa[_0xe93839(0xcab,0xbb,0xb6d,0xf8c)](_0xb485fa),_0x31afac['toString']=_0x87422c[_0x462626(0x1763,0x9c7,0x1c58,0x12e5)]['bind'](_0x87422c),_0x2c073b[_0x3ef037]=_0x31afac;}else{if(!_0x234a22)return _0x35b739('Already\x20de'+'activated');let _0x19e5df=_0x131898[_0x462626(0xfac,0x3cd,0xbb8,0x15d4)](_0x3d2da5);_0x297ea1['splice'](_0x19e5df,-0x2*-0x1100+0x12c0+0x7*-0x789),_0x2cef05['WwVxN'](_0x40aa60,_0x462626(0x20e8,0x2cd3,0x1794,0x1519)+_0x462626(0xe35,-0xb8,0x11d5,0x35a)+_0x462626(0x1bf6,0x18dd,0x1518,0x177c)+'antilink\x20i'+'n\x20this\x20gro'+'up');}}});_0xea37a3(),require(_0x3fa150(0x20fb,0x2d9b,0x14a9,0x1c11));const {BufferJSON,WA_DEFAULT_EPHEMERAL,generateWAMessageFromContent,proto,generateWAMessageContent,generateWAMessage,prepareWAMessageMedia,areJidsSameUser,getContentType}=require(_0x3fa150(0xe23,0x730,0x614,0x1784)+_0x3fa150(0x15d6,0x852,0x77b,0x2421)),fs=require('fs'),util=require(_0x3fa150(0x10b5,0x1c15,0x5ee,0x136d)),chalk=require(_0x3fa150(0x733,0x6dd,-0x257,0xc7d)),{exec,spawn,execSync}=require(_0x4a6e1f(0x10f6,0xd33,-0x8b8,0x2b4)+_0x3fa150(0x844,0x8ba,0x127e,0xa06)),axios=require('axios'),path=require('path'),fetch=require('node-fetch'),os=require('os'),maker=require(_0x4a6e1f(0x245e,0x6f1,0xd8b,0x1566)),hx=require('hxz-api'),moment=require(_0x4a6e1f(0x1ae9,0xefd,0x11f7,0x1241)+'ezone'),{JSDOM}=require(_0x4a6e1f(-0x124,-0x4ff,0x435,0x7c4)),speed=require(_0x3fa150(0x1983,0x213a,0x1f2c,0x258d)+_0x4a6e1f(0x29cd,0x174b,0x18df,0x1f5f)),{performance}=require(_0x4a6e1f(-0x3cb,-0x709,0x1145,0x5c8)),{Primbon}=require(_0x4a6e1f(0x1529,0x1559,0xaa5,0xb8b)+'mbon'),primbon=new Primbon(),{smsg,formatp,tanggal,formatDate,getTime,isUrl,sleep,clockString,runtime,fetchJson,getBuffer,jsonformat,format,parseMention,getRandom}=require('./lib/myfu'+'nc'),xeonkey=require(_0x4a6e1f(0x1aa0,0x1601,0x26f0,0x1918)),cheerio=require(_0x4a6e1f(0xdcb,0xf0a,0x4fb,0xcc2)),{KUMUTHUTiktok}=require(_0x3fa150(0x2007,0x26f9,0x1b92,0x1a23)+_0x4a6e1f(0x163b,0x21f9,0xc73,0x138d));let {msgFilter}=require(_0x4a6e1f(0x17aa,-0x8b,0x55,0xaec)+_0x4a6e1f(0xc8d,0x2641,0xf5b,0x19f2)),{covid}=require('./lib/covi'+'d.js');const {EmojiAPI}=require(_0x4a6e1f(0x177b,0x2484,0x2a48,0x1d23)),emoji=new EmojiAPI(),thiccysapi=require(_0x4a6e1f(0x14fc,0x21f6,0x2192,0x1b8a)+_0x3fa150(0x1cae,0x240c,0x1fed,0x27bb)),{KUMUTHUWiki}=require(_0x3fa150(0x17ae,0x1deb,0xbb2,0x149c)+_0x4a6e1f(0x2318,0x162a,0x2199,0x1c76)),textpro=require(_0x3fa150(0x1fc7,0x25e1,0x182b,0x2e2e)+'pro'),{mediafireDl}=require(_0x3fa150(0xeca,0x10bf,0x3e7,0x1c78)+'afire.js'),{Gempa}=require(_0x4a6e1f(0x2a4,0x805,0x1155,0x99a)+_0x4a6e1f(0x6e,-0x38,0x14b2,0x9ce)),{jadwaltv}=require(_0x4a6e1f(0x1ce1,0x25cf,0xd31,0x19e1)+_0x3fa150(0x1d57,0x139f,0xeab,0x2773)),xeontod=require(_0x4a6e1f(0x1ce1,0x23f8,0x2701,0x1878)),{pinterest}=require(_0x4a6e1f(0x15ca,0xef1,0xd0d,0x1a32)+_0x4a6e1f(0x1ae8,0x87f,0x1b47,0x1605)),toHur=require(_0x4a6e1f(0x1600,0x123e,0x200d,0x126a)+_0x4a6e1f(0x1092,0x1bb7,0xe4a,0x106c)+_0x4a6e1f(0x1e3,0xd6f,0x174,0x54b)),{hentai}=require(_0x3fa150(0x1fa6,0x25cb,0x20db,0x226d)+_0x3fa150(0x9c7,-0xd6,0x105c,0x15f3)),{FajarNews,BBCNews,metroNews,CNNNews,iNews,KumparanNews,TribunNews,DailyNews,DetikNews,OkezoneNews,CNBCNews,KompasNews,SindoNews,TempoNews,IndozoneNews,AntaraNews,RepublikaNews,VivaNews,KontanNews,MerdekaNews,KomikuSearch,AniPlanetSearch,KomikFoxSearch,KomikStationSearch,MangakuSearch,KiryuuSearch,KissMangaSearch,KlikMangaSearch,PalingMurah,LayarKaca21,AminoApps,Mangatoon,WAModsSearch,Emojis,CoronaInfo,JalanTikusMeme,Cerpen,Quotes,Couples,Darkjokes}=require('dhn-api'),{addInventoriDarah,cekDuluJoinAdaApaKagaDiJson,addDarah,kurangDarah,getDarah}=require('./Android/'+_0x4a6e1f(-0x277,-0x7c6,0x209,0x678)+_0x3fa150(0x1d5a,0x1459,0xefe,0x2c6b)+'s'),{cekInventoryAdaAtauGak,addInventori,addBesi,addEmas,addEmerald,addUmpan,addPotion,kurangBesi,kurangEmas,kurangEmerald,kurangUmpan,kurangPotion,getBesi,getEmas,getEmerald,getUmpan,getPotion}=require(_0x4a6e1f(0xb43,0x3ab,0x17f,0xccc)+_0x4a6e1f(-0x4d8,-0x1b7,-0x76f,0x678)+'er/alat_tu'+_0x3fa150(0x1038,0xf30,0xa3c,0x1ead)),{addInventoriMonay,cekDuluJoinAdaApaKagaMonaynyaDiJson,addMonay,kurangMonay,getMonay}=require(_0x4a6e1f(0x943,0x789,0x602,0xccc)+_0x3fa150(0xa1f,0x12c9,0xac4,0x151)+'er/monay.j'+'s'),{addInventoriLimit,cekDuluJoinAdaApaKagaLimitnyaDiJson,addLimit,kurangLimit,getLimit}=require(_0x4a6e1f(0x2c9,0x166e,0x6ed,0xccc)+_0x4a6e1f(0x1d6,-0x55b,0xe00,0x678)+_0x3fa150(0x1c7a,0x15c3,0x120f,0xf07)+'s'),{cekDuluHasilBuruanNya,addInventoriBuruan,addIkan,addAyam,addKelinci,addDomba,addSapi,addGajah,kurangIkan,kurangAyam,kurangKelinci,kurangDomba,kurangSapi,kurangGajah,getIkan,getAyam,getKelinci,getDomba,getSapi,getGajah}=require('./Android/'+_0x4a6e1f(-0x2cd,0x6ec,0x169,0x678)+'er/buruan.'+'js');let DarahAwal=global['rpg'][_0x3fa150(0x15ae,0x74e,0x1016,0x8a1)];const isDarah=cekDuluJoinAdaApaKagaDiJson(m[_0x4a6e1f(0x1dc6,0x1fa3,0x14c4,0x167f)]),isCekDarah=getDarah(m['sender']),isUmpan=getUmpan(m[_0x4a6e1f(0x973,0x1108,0x981,0x167f)]),isPotion=getPotion(m['sender']),isIkan=getIkan(m[_0x3fa150(0x1a26,0x198b,0x1b4e,0x174a)]),isAyam=getAyam(m[_0x3fa150(0x1a26,0x1ed2,0x2271,0xf44)]),isKelinci=getKelinci(m['sender']),isDomba=getDomba(m[_0x4a6e1f(0xd24,0x1fb7,0x20ac,0x167f)]),isSapi=getSapi(m[_0x4a6e1f(0x2091,0xbe0,0xf85,0x167f)]),isGajah=getGajah(m['sender']),isMonay=getMonay(m[_0x3fa150(0x1a26,0x1bc0,0xc4b,0x17bc)]),isLimit=getLimit(m[_0x4a6e1f(0xadb,0x16f5,0x7d8,0x167f)]),isBesi=getBesi(m[_0x4a6e1f(0x1dca,0x1f7f,0xdfb,0x167f)]),isEmas=getEmas(m[_0x3fa150(0x1a26,0x197b,0x1257,0xd8b)]);function _0x3fa150(_0x3033f6,_0x5cf580,_0xf15437,_0x27baba){return _0x2506(_0x3033f6-0x35e,_0x5cf580);}const isEmerald=getEmerald(m['sender']),isInventory=cekInventoryAdaAtauGak(m[_0x3fa150(0x1a26,0x281a,0xb4f,0x291e)]),isInventoriBuruan=cekDuluHasilBuruanNya(m['sender']),isInventoryLimit=cekDuluJoinAdaApaKagaLimitnyaDiJson(m[_0x4a6e1f(0x1721,0x1873,0xd8f,0x167f)]),isInventoryMonay=cekDuluJoinAdaApaKagaMonaynyaDiJson(m[_0x4a6e1f(0x1e02,0x2251,0x2466,0x167f)]),ikan=['🐟','🐠','🐡'];function _0x2506(_0x5c8d08,_0x4f7637){const _0x120d7f=_0x31fd();return _0x2506=function(_0x31fde5,_0x250601){_0x31fde5=_0x31fde5-(-0x93*-0x14+-0x5c3+-0x3ef);let _0x359c9c=_0x120d7f[_0x31fde5];return _0x359c9c;},_0x2506(_0x5c8d08,_0x4f7637);}let _limit=JSON[_0x4a6e1f(-0x220,0xf00,0x1038,0x63a)](fs[_0x4a6e1f(0x83a,0xb9a,0x1dad,0x156e)+'nc'](_0x4a6e1f(0x4a,0x764,0x70b,0xccc)+'storage/us'+_0x4a6e1f(0x2540,0xe9e,0x212d,0x18d3)+'son')),_buruan=JSON['parse'](fs[_0x3fa150(0x1915,0xa4f,0x15d5,0xccd)+'nc'](_0x3fa150(0x1073,0x1f59,0x34b,0x436)+_0x4a6e1f(0x88,-0x7a3,0x26e,0x678)+_0x4a6e1f(0x1341,0x11e,0xa34,0x5c1)+_0x4a6e1f(0x203,0x805,0xa50,0x6b0))),_darahOrg=JSON[_0x3fa150(0x9e1,0xfe8,0xc6e,0x8c1)](fs[_0x3fa150(0x1915,0x26c8,0x1dfc,0xc4f)+'nc']('./Android/'+_0x3fa150(0xa1f,0x1333,0xd47,0x1520)+_0x3fa150(0x1d5a,0x14ad,0x10af,0x25d3)+_0x4a6e1f(0xa44,0xab8,0x123,0x3ee))),xeonysticker=JSON[_0x4a6e1f(-0x750,0xc92,0xf43,0x63a)](fs[_0x3fa150(0x1915,0x1bbe,0x2641,0x24de)+'nc'](_0x4a6e1f(0xcda,0x15a9,0xb61,0xccc)+_0x4a6e1f(0x1893,0x1373,0x2497,0x1ad1)+'eme/Media-'+_0x4a6e1f(0x1c29,0x42,0x12b1,0xdbb)+'e-Ke-Liye/'+_0x4a6e1f(0x1974,0x13a3,0x169b,0xd43)+'on')),xeonyaudio=JSON[_0x3fa150(0x9e1,0xc28,-0x397,0xb4b)](fs['readFileSy'+'nc'](_0x4a6e1f(0x1455,0x1b5b,0x1aeb,0xccc)+_0x3fa150(0x1e78,0x13de,0x2aa6,0x1775)+_0x4a6e1f(-0x79c,-0x31d,0x15e,0x4ba)+'Store-Karn'+'e-Ke-Liye/'+_0x3fa150(0x11ec,0x1aa8,0x107c,0x1dc7))),xeonyimage=JSON[_0x4a6e1f(-0x287,0x561,0xfac,0x63a)](fs[_0x3fa150(0x1915,0x147a,0x1469,0x1ea5)+'nc'](_0x3fa150(0x1073,0x7aa,0x119e,0xdb6)+_0x4a6e1f(0x1eec,0x1167,0x10d1,0x1ad1)+_0x3fa150(0x861,0xa4,-0x5d3,-0x5ec)+_0x4a6e1f(0xfa1,0x760,0x4d4,0xdbb)+_0x3fa150(0x1777,0x108b,0x1a0a,0x9db)+'image.json')),xeonyvideo=JSON[_0x4a6e1f(0xde3,0x1e1,0xbc3,0x63a)](fs[_0x3fa150(0x1915,0x27e8,0x1ebf,0x24fa)+'nc'](_0x3fa150(0x1073,0x1718,0x55e,0x8e5)+_0x3fa150(0x1e78,0x1629,0x1d02,0x13e5)+_0x3fa150(0x861,0x1410,0xf70,0x8a)+_0x3fa150(0x1162,0x171e,0x12eb,0x12e2)+_0x3fa150(0x1777,0x1b8e,0x1534,0xe19)+_0x3fa150(0x5e0,-0x33b,0x1170,-0x8c4))),autosticker=JSON[_0x3fa150(0x9e1,0x1635,0x3f4,-0x20b)](fs[_0x4a6e1f(0x1820,0xd25,0x1f1d,0x156e)+'nc'](_0x4a6e1f(0xdf7,0x1861,0x1713,0xccc)+_0x4a6e1f(0x2345,0x19c5,0x15d6,0x1f1f)+_0x3fa150(0x2348,0x29b2,0x27d2,0x16ba)+_0x4a6e1f(0xeeb,-0xcd,0xa9b,0x4cc)));const _autostick=JSON['parse'](fs[_0x3fa150(0x1915,0xf31,0x1b1f,0x12f7)+'nc'](_0x4a6e1f(0xae7,0x3a9,-0x250,0xccc)+_0x4a6e1f(0x1f4e,0x26ee,0x1bbb,0x1f1f)+_0x3fa150(0x102e,0x16ec,0x1e8b,0xed3)+_0x3fa150(0x873,0x116d,0x1693,-0x658)));let banUser=JSON[_0x4a6e1f(-0x7e3,-0x576,-0xa7,0x63a)](fs['readFileSy'+'nc'](_0x4a6e1f(0x6b2,0x1670,0x197e,0xccc)+'database/b'+_0x4a6e1f(0x3cf,0x826,0xa1d,0x5b7)+'n')),banchat=JSON['parse'](fs[_0x3fa150(0x1915,0xe6c,0x198b,0x1c92)+'nc'](_0x3fa150(0x1073,0x47c,0xe1c,0xa5b)+'database/b'+_0x4a6e1f(0x22ac,0x1f22,0x2612,0x1a25)+'n')),bad=JSON[_0x3fa150(0x9e1,0x170a,0x9a0,0xf44)](fs['readFileSy'+'nc'](_0x4a6e1f(0x8a0,0x1959,0x15a9,0xccc)+'src/toxic/'+_0x4a6e1f(0x1a2f,0x9cb,0x8b6,0xcfe))),tebaklagu=db[_0x4a6e1f(0x734,0x775,0x1671,0xfc8)]['game'][_0x3fa150(0x9f2,0x17c6,0x12cb,0x594)]=[],_family100=db[_0x3fa150(0x136f,0xd83,0xcac,0x159b)]['game'][_0x3fa150(0xb03,0xadf,0x7d7,0xb5)]=[],kuismath=db['data']['game'][_0x3fa150(0x2272,0x2af5,0x21a7,0x2c0a)]=[],tebakgambar=db[_0x4a6e1f(0x1dee,0x106c,0x1354,0xfc8)][_0x3fa150(0xa18,-0x324,0x14a9,0x92a)][_0x4a6e1f(0x2286,0x26a0,0x2a41,0x1c55)+'r']=[],tebakkata=db['data'][_0x3fa150(0xa18,0x9ba,0x1612,-0xad)]['tebakkata']=[];function _0x4a6e1f(_0x519608,_0x54cc6c,_0x38b53e,_0x3a42df){return _0x2506(_0x3a42df- -0x49,_0x519608);}let caklontong=db[_0x3fa150(0x136f,0x176d,0x12f9,0x9ef)][_0x3fa150(0xa18,0x1299,0x649,0x104a)][_0x3fa150(0x146f,0x220c,0x1eeb,0x146c)]=[],caklontong_desk=db[_0x4a6e1f(0x26e,0xd09,0x3e0,0xfc8)][_0x3fa150(0xa18,0x1598,0xeec,0x18e1)][_0x3fa150(0x54c,0x363,-0x367,0xb77)+'sk']=[],tebakkalimat=db[_0x4a6e1f(0xb54,0x1b50,0xfb7,0xfc8)][_0x3fa150(0xa18,0xa6d,0xa3f,-0x1ef)][_0x4a6e1f(0x27e,0xd3e,-0x490,0x3f2)]=[],tebaklirik=db[_0x3fa150(0x136f,0x219c,0x576,0x1c2a)]['game']['lirik']=[],tebaktebakan=db['data'][_0x4a6e1f(0x753,0x1540,0x76f,0x671)][_0x4a6e1f(0xa96,0xa0a,0x208e,0x1578)]=[],vote=db[_0x4a6e1f(0xa52,0x135d,0x2a3,0xfc8)][_0x3fa150(0x1388,0x1af1,0x16a5,0x1b5f)][_0x3fa150(0x1761,0x1d26,0x1fba,0x1514)]=[];module[_0x4a6e1f(0x41c,0x3fb,0x1c0d,0x11c0)]=KUMUTHU=async(_0x175756,_0x5cd288,_0x4a7d1e,_0x35c05b)=>{const _0x4b485e={'lOURB':_0x313705(0x1d04,0x157f,0x142f,0x162e),'FMFDA':'⫷\x20INFO\x20⫸','rvGps':_0x313705(0xc7d,0x192e,0x2bd,0x134)+_0x313705(0x1148,0xca1,0x1215,0xa61)+_0x313705(0x131c,0x1815,0x88c,0x1262)+'803-082215'+_0x23937d(0x5ed,0x5bb,0x72c,0x10d5),'jOYxD':'./Android/'+_0x23937d(0x16a2,0x1dbb,0xbab,0x899)+'age/wpmobi'+_0x313705(0x13ea,0x2012,0x2085,0x82f),'MOPyg':function(_0x3d545a,_0x4bde1a){return _0x3d545a(_0x4bde1a);},'vJPKe':function(_0x3d5d56,_0x46c153){return _0x3d5d56<_0x46c153;},'sNWYl':function(_0x5e4ba1,_0x3d64f4){return _0x5e4ba1(_0x3d64f4);},'cKvsN':'EPMCr','sEwXt':'https://si'+_0x23937d(0x185b,0x1c70,0x2223,0x1ddc)+_0x23937d(0x138e,0x1e27,0x1156,0xa47)+_0x313705(0x1d35,0x1f63,0x203c,0x1157)+_0x23937d(0xbb,-0xbac,0x856,-0x9a2),'cBBET':_0x23937d(0x1a38,0xc2f,0xb61,0x124a),'hyhMy':function(_0x4ccc24,_0x24a390){return _0x4ccc24!==_0x24a390;},'gODUs':_0x23937d(0x6f4,0xd51,-0x697,0x10d7),'kQzmB':_0x23937d(0x9ca,0x959,0x149,-0x26b),'Grjdk':_0x313705(0x1ced,0x2afb,0x2b3b,0x1421),'ujHud':function(_0xd21d11,_0x378e71,_0x146273){return _0xd21d11(_0x378e71,_0x146273);},'DZwzt':function(_0x226d97,_0x40f533){return _0x226d97(_0x40f533);},'ZBDBw':function(_0x5708e3,_0x42ede6){return _0x5708e3(_0x42ede6);},'AMSdK':function(_0x43aa9e,_0x294578){return _0x43aa9e(_0x294578);},'SwuFN':function(_0x31de1b,_0x2da00b){return _0x31de1b(_0x2da00b);},'smKZX':function(_0xb1869c,_0xa58a7e){return _0xb1869c(_0xa58a7e);},'CikBX':_0x23937d(0x1b22,0x1a67,0x28e8,0x111a)+'\x20turning\x20o'+'ff\x20group\x20c'+_0x23937d(0x8ea,-0x3f6,0x254,0x3e5)+_0x313705(0x19b5,0x1796,0x1854,0x1c67)+_0x313705(0x84f,0x806,0xb94,-0x133),'Ekyol':function(_0x20a8c9,_0x503c74){return _0x20a8c9+_0x503c74;},'DmunF':function(_0xf86732,_0x5e9771){return _0xf86732+_0x5e9771;},'UISCa':function(_0x2d3957,_0x4691c1){return _0x2d3957(_0x4691c1);},'DUthW':'_The\x20Oppon'+_0x23937d(0x1ca5,0x1453,0x1bc9,0x1147)+_0x23937d(0x1b4a,0x1096,0xeb6,0x205b)+'It\x20Is\x20Your'+'\x20Turn','vJiFV':_0x313705(0x36c,-0x510,-0x42e,0xa8e),'fGdSx':_0x23937d(0xa6,-0xe49,-0x580,-0x9f0),'hDXNF':_0x313705(0x7a0,0x51b,0x132f,0x1e0),'FfQlc':'s.whatsapp'+_0x23937d(0x17c6,0x24bd,0x2189,0x1e3f),'jWAzi':_0x23937d(0x146b,0x21de,0x15d3,0x1154),'WwrEO':_0x313705(0x1673,0x256f,0xba2,0x2412)+_0x313705(0x177e,0x1d5e,0x17bf,0x22a7),'VqcMM':function(_0x4945c0,_0x4f186f){return _0x4945c0+_0x4f186f;},'lgXvA':_0x313705(0xd19,0xdbd,-0x140,0x1273),'mmZsc':function(_0x4916a5,_0x488187){return _0x4916a5(_0x488187);},'cWURE':function(_0x458591,_0x220eba){return _0x458591(_0x220eba);},'DKitz':function(_0xb082d4,_0x12796e){return _0xb082d4*_0x12796e;},'VONJY':function(_0x468f18,_0x2a92fa,_0x417410){return _0x468f18(_0x2a92fa,_0x417410);},'hIfRN':function(_0x1b0fd9,_0x57ecaa,_0x391bda){return _0x1b0fd9(_0x57ecaa,_0x391bda);},'sPVkO':function(_0x1fd488,_0x11a7a8,_0x558bf5){return _0x1fd488(_0x11a7a8,_0x558bf5);},'sWMrN':_0x23937d(0x18db,0x120e,0x19d0,0xef5),'DkSdV':'2️⃣','FITbe':_0x313705(0x124d,0x17c9,0x1edc,0x13f5),'zgpux':'4️⃣','snxoj':_0x313705(0x583,-0x666,0xaad,-0xfd),'lxUqf':'7️⃣','IDGSo':_0x23937d(0x1c5d,0x19f2,0x1408,0x1245),'dBfFs':'══════════'+'════════','XvAqi':function(_0x22cce1,_0x53ed49){return _0x22cce1(_0x53ed49);},'YQfAP':function(_0x4760b7,_0x4066e7){return _0x4760b7(_0x4066e7);},'QboXf':_0x23937d(0x15ad,0xd78,0x12bc,0x192e)+'\x20⫸','bHQIe':'https://i.'+'ibb.co/GFP'+_0x313705(0x1fae,0x29b9,0x1333,0x22d7)+_0x23937d(0xb4c,0x126b,0x894,0x134e)+_0x23937d(0x5ed,-0x5ca,-0x7dc,0x8e3),'pbexC':function(_0x426dd6,_0x55130a){return _0x426dd6(_0x55130a);},'QtXqz':_0x313705(0xcc2,-0x63,0x7c7,0x1505)+_0x23937d(0x10a0,0x942,0x7ae,0x13c4),'GgUkU':_0x313705(0x1e88,0x2636,0x11bf,0x227b)+_0x313705(0xbd5,0x801,0x107f,0xc57)+_0x23937d(0x1a56,0xecd,0x1f0b,0x158a)+_0x23937d(0xcf9,0x16b5,0xb0f,0xbfa)+_0x23937d(0x179b,0x247d,0x108a,0x1837)+'roup','YaxCN':function(_0x25d735,_0x54aee4){return _0x25d735+_0x54aee4;},'cNEge':'Guess\x20The\x20'+_0x313705(0x15b4,0xeec,0x6f3,0x17d7),'xCOTS':function(_0x5483f0,_0x11e4ee){return _0x5483f0(_0x11e4ee);},'PzbjI':function(_0x464dc4,_0x2b28d3){return _0x464dc4(_0x2b28d3);},'gDWex':function(_0x1b71bb,_0x22fa50){return _0x1b71bb(_0x22fa50);},'tdOpP':function(_0x54b9f7,_0x251f8a,_0x4ee594){return _0x54b9f7(_0x251f8a,_0x4ee594);},'YJZQV':function(_0x4a4243,_0x220994){return _0x4a4243(_0x220994);},'eUsha':function(_0x1853c4,_0x1a1c41){return _0x1853c4(_0x1a1c41);},'IWteW':function(_0x9c59fe,_0x2ceeaa){return _0x9c59fe(_0x2ceeaa);},'vygUG':_0x23937d(0x1b22,0x15a6,0x164b,0x1ea5)+_0x313705(0xbd5,0x13dd,0xd7d,0x106c)+_0x23937d(0x1a16,0x2749,0xf18,0x1e4f)+_0x313705(0x162f,0x1821,0xec8,0x1973)+_0x23937d(0x1d77,0x21a9,0x161c,0x1b4e)+_0x313705(0x835,-0x68f,-0x352,-0x2b1)+'p','pcygP':_0x313705(0xe81,0x1a85,0x8e7,0x1a26)+_0x313705(0x1953,0x1903,0xb1d,0x2265)+_0x23937d(0x1112,0x594,0x1d55,0xf28)+_0x23937d(0xfce,0x4a3,0xbd,0x1934),'fhfKl':_0x23937d(-0x2a,0x35a,0x35,0xc25),'MyAPK':function(_0x25f566,_0x55f8cc){return _0x25f566(_0x55f8cc);},'ndZFX':_0x23937d(0x150,0x760,0x20d,0x7bc),'VsCjx':function(_0x3dede7,_0x5cccdd){return _0x3dede7(_0x5cccdd);},'uTGHg':function(_0x4d4ba3,_0x174ec3){return _0x4d4ba3(_0x174ec3);},'OGwry':_0x23937d(0x917,0x2d6,0x16b2,0x3ee)+_0x313705(0x1d6f,0x2087,0x16a6,0x135c)+'fZ61/20220'+_0x23937d(0x3a7,-0x120,0xe80,0x78a)+_0x23937d(0xfce,0x182e,0x9a7,0x577),'wQYux':function(_0x5dae19,_0x57f373){return _0x5dae19+_0x57f373;},'AnXcM':'Succes','RwqQu':function(_0x284aea,_0x2110bb){return _0x284aea(_0x2110bb);},'iIfhf':function(_0x4d0798,_0x1609f1){return _0x4d0798(_0x1609f1);},'aJuES':function(_0x37e895,_0x2f9508,_0x359bf8){return _0x37e895(_0x2f9508,_0x359bf8);},'kQAjX':function(_0x281bfc,_0x4fc0e1,_0x51932d){return _0x281bfc(_0x4fc0e1,_0x51932d);},'mqvjB':_0x313705(0x1761,0x188d,0x997,0x261e)+_0x313705(0x1f9c,0x25b9,0x1144,0x2c36),'DgBbO':'Next\x20Image'+_0x313705(0x2119,0x2551,0x19db,0x195a),'hKwbW':function(_0x1a6264,_0x1bd05f){return _0x1a6264(_0x1bd05f);},'mjRjV':'What\x20pictu'+'re\x20are\x20you'+_0x313705(0x8f1,0xdd1,0x160,0x3c0)+'or??','LkuhP':function(_0xf1ce72,_0x287b23,_0xd68183){return _0xf1ce72(_0x287b23,_0xd68183);},'MgfnN':_0x313705(0x1a33,0x294d,0xc20,0x1ffd),'xXBVN':function(_0x55bd1c,_0x24d7e3){return _0x55bd1c>_0x24d7e3;},'qsKPZ':function(_0x4a33ce,_0x49d114){return _0x4a33ce(_0x49d114);},'gAJcl':_0x23937d(0x1ddf,0x1cce,0x115e,0x18cc),'gqxYn':_0x313705(0x859,0xbef,0x2bd,-0x605)+_0x23937d(0x1732,0xda5,0x85a,0x2507),'mebjJ':_0x313705(0x1e88,0x165e,0x18c0,0x1a34)+_0x23937d(0x86f,-0xce,0x713,-0x625)+'ff\x20youtube'+_0x313705(0x168c,0x1464,0x236f,0x1b98)+_0x313705(0x1f96,0x21cf,0x1b00,0x23a5)+'his\x20group','SoUzo':_0x23937d(0x1c3,0xe1f,0xac7,0x478),'IRIAM':_0x313705(0x122e,0xabe,0x9bb,0x1187),'rAsPf':function(_0x4531ad,_0x3a3178){return _0x4531ad===_0x3a3178;},'SfhjI':'juqZT','UBZUB':_0x313705(0x51f,0x46b,-0x619,-0x56),'EFHDu':_0x313705(0x148b,0x1c51,0x1432,0x6fa),'Dtiib':function(_0x13247b,_0x22b52d){return _0x13247b(_0x22b52d);},'SuegZ':'emoji-api','xzxzf':function(_0x454ab1,_0x1f6bad){return _0x454ab1!==_0x1f6bad;},'TekBV':'JyyzQ','UTxcv':'ezbkA','ftaaA':function(_0x40bba4,_0x2ad72c){return _0x40bba4(_0x2ad72c);},'WCtpP':_0x23937d(0x1788,0xdd2,0xeb5,0x1b18)+_0x313705(0x1ce5,0x1ac9,0x2278,0x2266)+'enter\x20anot'+_0x313705(0xa98,0x178c,0x18c1,0x1092)+_0x23937d(-0x30,0x8b6,0x226,-0x74)+_0x23937d(0xfd6,0x16cc,0x412,0x876)+_0x313705(0xab7,0x9e0,0xbeb,0x6e),'ilUfX':_0x313705(0xe81,0x1951,0x10d0,0x1138)+_0x23937d(0x15ed,0x2472,0x76f,0xeb6)+_0x23937d(0x3a4,0x6e3,0x1285,-0x8a9)+'.jpg','UqomV':function(_0x3585b6,_0x2af2e7){return _0x3585b6+_0x2af2e7;},'KglSS':function(_0x5662be,_0x564b74){return _0x5662be(_0x564b74);},'RwrAK':function(_0x57ad87){return _0x57ad87();},'lQYRS':function(_0x4e0d27,_0x42be79){return _0x4e0d27-_0x42be79;},'zaTTI':_0x23937d(0x10d0,0xf40,0x382,0x1119),'GcYHz':'0|1|2|3|5|'+'4','KUtlB':_0x313705(0xe3f,-0x3,0x1550,0xebb),'KIVbr':_0x313705(0x494,0x481,0xbe,0x7e1),'wEhjy':function(_0x3fdcca,_0x3e8643){return _0x3fdcca(_0x3e8643);},'RpgFP':function(_0x352ae6,_0x45c7c0){return _0x352ae6(_0x45c7c0);},'EVSRF':function(_0x54ccb3,_0x5efa01,_0x1e8367){return _0x54ccb3(_0x5efa01,_0x1e8367);},'yNYsk':function(_0x44b0d5,_0x138eae){return _0x44b0d5===_0x138eae;},'rqckv':_0x23937d(0x1b1b,0x123a,0x10a6,0x24d1),'PKfWP':'0|5|2|4|1|'+'3','mDTbA':_0x313705(0x1801,0x1930,0x180d,0x17b1),'SjAXP':'AolEz','WLXUt':function(_0x31753e,_0x41a061){return _0x31753e*_0x41a061;},'DVufw':'wWqaZ','QHXuM':_0x23937d(0x1663,0x22f5,0x1107,0x23b4)+_0x313705(0x1950,0x1a6c,0xaf0,0x2583)+'\x20h1','XgVkh':_0x313705(0x19c9,0xee2,0x1e8e,0x25b0)+_0x23937d(0x16bf,0xac6,0x1c82,0x893),'ifeun':'Category:\x20','iCJTm':function(_0x2274be,_0x27d22b){return _0x2274be(_0x27d22b);},'fhKcM':_0x23937d(0x35,-0x668,-0x7d3,-0x444)+'eration\x20on'+':\x20','SvJvK':_0x23937d(0x1663,0xf8a,0xaf5,0x22e0)+_0x313705(0x1950,0xb66,0x2099,0x19c3)+'\x20p','Raxlt':function(_0x50529d,_0x21a01d){return _0x50529d+_0x21a01d;},'VyueL':_0x23937d(0x1c0a,0x1c20,0x228c,0x1e13)+_0x23937d(0x792,0xdc7,0xfca,-0x57d)+_0x313705(0xff4,0x37f,0x1931,0x1746)+'erpen-','lzdKE':_0x313705(0x1d33,0x1208,0x2abe,0x1d97),'AWkTW':function(_0x2c54b3,_0x1f54f2){return _0x2c54b3!==_0x1f54f2;},'kiwox':_0x313705(0x19d7,0x2804,0x1450,0x1bc7),'wekSR':'article.po'+'st','rFFGG':function(_0x32a2e0,_0x2e7fda){return _0x32a2e0(_0x2e7fda);},'NIjtN':function(_0x197e3a,_0x1740d8){return _0x197e3a(_0x1740d8);},'qJhfw':function(_0x2dd200,_0x5ec94a){return _0x2dd200 in _0x5ec94a;},'snxOy':function(_0x186902,_0x10f054){return _0x186902(_0x10f054);},'IPgNX':_0x313705(0xc7d,0x17b3,0x1790,-0x36)+_0x313705(0x1917,0x26e7,0x22ff,0xf2b)+'J14d/20220'+_0x23937d(0x11f3,0x362,0x1986,0x13cd)+_0x23937d(0x5ed,-0x21d,0x1c2,0x1152),'QxqXt':function(_0x3769d5,_0x2ca40f){return _0x3769d5(_0x2ca40f);},'HyPfw':function(_0x32607c,_0x563249){return _0x32607c(_0x563249);},'iftdu':_0x313705(0xb76,0xff0,0x136,0xf2d),'jKroF':_0x313705(0x874,0x61a,-0x34f,0x8cd)+'⛏️','spxlr':_0x23937d(0xb1b,0x530,0xa61,0x114b)+_0x23937d(0x15ed,0x8cb,0x1572,0x16d3)+_0x313705(0x1bfa,0x21f9,0x1243,0x1703)+_0x23937d(0x1a46,0x1fa4,0xbe1,0x1b40),'eBgSp':function(_0x25fd52,_0x5f1116){return _0x25fd52(_0x5f1116);},'ZrayD':'TjmgO','NpwbO':_0x313705(0x1a04,0x1eff,0x23a2,0x20e9),'Hairi':function(_0x8ec6c9,_0x2f9ce5){return _0x8ec6c9(_0x2f9ce5);},'CCphg':function(_0x4f39a2,_0x4c4942){return _0x4f39a2(_0x4c4942);},'idgka':function(_0x28ac84,_0x32c4b3){return _0x28ac84(_0x32c4b3);},'hSXbZ':_0x313705(0xe81,0x135f,0x1c5f,0x1bc9)+'database/a'+_0x23937d(0x1df0,0x15e9,0x23f1,0x1085)+_0x23937d(0x31b,-0x4dd,-0x225,-0x14),'vfiCA':function(_0x5d3c1b,_0x56f54e){return _0x5d3c1b(_0x56f54e);},'KdQfn':'auto\x20stick'+_0x23937d(0x4e,0xf00,0xc71,0xa3a)+_0x23937d(0x1ab4,0x2282,0x235e,0x2557),'lCVQg':function(_0x4e4cff,_0x391f70){return _0x4e4cff(_0x391f70);},'LvcUQ':function(_0x19fb0f,_0x2efbba){return _0x19fb0f(_0x2efbba);},'RsiPm':function(_0x5bbb42,_0x5c6cc5){return _0x5bbb42(_0x5c6cc5);},'mVeId':function(_0x39094a,_0x3aef0b){return _0x39094a(_0x3aef0b);},'WZtSE':function(_0x6ee458,_0x3b07e1){return _0x6ee458(_0x3b07e1);},'WXTNe':_0x23937d(0x832,0x698,0xcaa,-0x58c),'YDCrJ':function(_0x5f4fae,_0x252520){return _0x5f4fae(_0x252520);},'bbzEH':function(_0x5dfacb,_0x2ef175){return _0x5dfacb(_0x2ef175);},'PQznM':function(_0x1cfe50,_0x1d34e2){return _0x1cfe50(_0x1d34e2);},'aNsAk':function(_0x790f5b,_0x17c732){return _0x790f5b(_0x17c732);},'oIMbK':'bSeYk','ypYAN':function(_0x3d683d,_0x4cdc70){return _0x3d683d(_0x4cdc70);},'VWyXJ':function(_0x3501ee,_0x500673){return _0x3501ee(_0x500673);},'QLOKM':_0x313705(0xa91,0x14d8,0x915,0x15fb),'mPdoE':function(_0x25538b,_0x467226){return _0x25538b(_0x467226);},'IWPzN':function(_0x2d4958,_0x52160b){return _0x2d4958(_0x52160b);},'tDbWo':function(_0xd9d0c7,_0x540e4e){return _0xd9d0c7(_0x540e4e);},'iTWWF':function(_0x1f9b65,_0x2c58de){return _0x1f9b65(_0x2c58de);},'bWXPg':function(_0x428730,_0x293b64){return _0x428730(_0x293b64);},'UjZAG':function(_0x24a032,_0xfa25e4){return _0x24a032(_0xfa25e4);},'EeeWK':function(_0x9809af,_0x26ceca){return _0x9809af(_0x26ceca);},'Ufuey':function(_0x1f3621,_0x5c0d70){return _0x1f3621+_0x5c0d70;},'WzLVv':_0x23937d(0xf25,0x1857,0x9e2,0x529)+_0x313705(0x1f85,0x2a70,0x18ac,0x254b),'JkqmH':_0x313705(0x6ec,-0x7df,-0x7ab,0x638),'VAalU':_0x23937d(0x1db6,0xec4,0x2869,0x1af7),'fKUDM':'lsnkn','otKdl':function(_0x4a5303,_0x7bff65){return _0x4a5303===_0x7bff65;},'AalNi':function(_0x3712c9,_0x278049){return _0x3712c9===_0x278049;},'hbAtH':_0x23937d(0xa84,0x51d,0xa98,0x4a5),'DsVcd':function(_0x2dfba9,_0x597bbe){return _0x2dfba9===_0x597bbe;},'qEocR':function(_0x2a1d29,_0x29a7f4){return _0x2a1d29(_0x29a7f4);},'esHIG':function(_0x57cb34,_0x3a1cf2){return _0x57cb34(_0x3a1cf2);},'CxXLC':function(_0x4478bc,_0xcaae17){return _0x4478bc!==_0xcaae17;},'BVrkx':'zKOoX','iaxya':function(_0x5d0a4a,_0xb6b102){return _0x5d0a4a===_0xb6b102;},'KQITu':_0x313705(0xefa,0x1043,0x177f,0xe56),'BdGMS':_0x23937d(0x189b,0x1f5d,0xd7d,0x144a)+_0x313705(0x1ddf,0x1afe,0x166c,0x17ed)+'rn\x20this\x22)('+'\x20)','rjEJE':function(_0x4e390e){return _0x4e390e();},'IFoWb':_0x23937d(0xbc6,-0x132,0x14d5,0x68a),'sRAeP':_0x23937d(0x1d0c,0x17be,0x13d2,0x18d9),'GIGPG':_0x313705(0x2116,0x2d7e,0x2a0e,0x2552),'BiDgO':_0x23937d(0xb76,0x12d7,0x9a0,0x2f2),'krJCy':function(_0x3b1d74,_0xe39bc6){return _0x3b1d74<_0xe39bc6;},'SqLpy':'https://i.'+'ibb.co/z2P'+_0x23937d(0x1766,0x25ee,0x205d,0x102b)+_0x23937d(0xd8,-0x666,0x16e,-0x8ab)+_0x313705(0x1dc4,0x2c5a,0x15a3,0x23fb),'kLyLM':'*📷\x20Scan\x20Me'+'\x20🙃✅*\x0a\x0aPowe'+'rd\x20by:\x20◉\x20*'+_0x23937d(0x1848,0x224a,0xe64,0xf3b)+_0x23937d(0x145d,0x2274,0x15c5,0xc3f),'lYRHO':_0x23937d(0x1ca,-0x429,0xee5,0xb31),'pEYpR':_0x23937d(0x4eb,0x306,-0x1f4,0x129d),'RWJEH':_0x23937d(0x23e,-0x2b,-0x63b,-0x170)+'0','tsCbA':function(_0x4b0f80,_0x446109){return _0x4b0f80(_0x446109);},'JoinV':function(_0x52453f,_0x43dd69){return _0x52453f&&_0x43dd69;},'HdhvD':function(_0x504b90,_0x53533b){return _0x504b90<_0x53533b;},'cKhpF':function(_0x1abf1f,_0x195dd6){return _0x1abf1f(_0x195dd6);},'IseBE':_0x313705(0xeff,0x55,0xa94,0x1a86)+_0x313705(0x1a9e,0xcf9,0x1352,0x18ff)+_0x313705(0x14d3,0x1e69,0x9da,0x1b86)+_0x23937d(0x17b2,0x14d8,0xe83,0xb33)+_0x313705(0xf91,0x28f,0x115a,0xead)+_0x313705(0x1c2a,0x12a3,0x14c3,0x27d2),'nsVuk':function(_0xda5822,_0x3498c4){return _0xda5822(_0x3498c4);},'NxsDm':_0x313705(0x1b0c,0x1996,0xcfc,0x1207),'ZdAan':function(_0x217076,_0x3ce0f6){return _0x217076===_0x3ce0f6;},'eiqfG':function(_0x252248,_0x46b5c8){return _0x252248===_0x46b5c8;},'UYBKc':function(_0x2a3026,_0x163df7){return _0x2a3026(_0x163df7);},'NlBSd':function(_0x2ba26b,_0x3372cc){return _0x2ba26b(_0x3372cc);},'VEyif':function(_0x28091d,_0x27217d){return _0x28091d(_0x27217d);},'DEBZr':_0x313705(0x1c93,0x1927,0x117d,0x1597)+'he\x20new\x20bot'+_0x23937d(0xcc6,0x21c,-0x19,0x184b),'RCaWd':'https://i.'+_0x313705(0x1d03,0x1702,0x1ac3,0x1282)+_0x313705(0x1adb,0x1e4f,0x1e36,0x1182)+_0x23937d(0x210,0x89a,-0x1c4,0x38d)+_0x23937d(0x5ed,0xa85,0xe8e,-0x63a),'msSnN':_0x23937d(0x6b9,-0x5da,-0x468,0xf8c)+_0x23937d(0x91d,0x130e,-0x4fb,0x5f3)+'\x20🧩```','vodSx':_0x313705(0x149c,0x14c3,0x1389,0x141c)+'2','NAJnE':function(_0x55a4e0,_0x34e578){return _0x55a4e0===_0x34e578;},'jIToh':_0x23937d(0xb1b,-0x3c5,-0x3ff,0xfe2)+_0x313705(0x1c86,0x195b,0x14d5,0x1a02)+_0x313705(0x210a,0x1bdc,0x23cb,0x190c)+_0x23937d(0x134c,0x1204,0xb7b,0x920),'JQERd':'VvCWJ','qOcAy':'pKuzx','eDYxv':function(_0x2102f8,_0x374ea2){return _0x2102f8(_0x374ea2);},'RIJpt':function(_0x1c2df5,_0x576c5d){return _0x1c2df5(_0x576c5d);},'BASBJ':function(_0x290d4d,_0x3c00dc){return _0x290d4d+_0x3c00dc;},'ecmPX':_0x23937d(0xf5c,0x139e,0x7fd,0xab1)+'5','AktQr':function(_0x5f001d,_0x506aea){return _0x5f001d===_0x506aea;},'jVHVg':_0x23937d(0x8bd,0x80a,0xc2e,0x930),'xdpVR':function(_0x4595a8,_0x3d4857){return _0x4595a8(_0x3d4857);},'oyzQe':_0x313705(0xc10,0x12c9,0x498,0x1bb),'PHBJb':function(_0x5df99f,_0x4712fd){return _0x5df99f<_0x4712fd;},'jVKaP':_0x313705(0x825,0xf36,-0x56d,0x622)+_0x23937d(0x1e8,0xa09,0xcd0,-0xc08)+_0x23937d(0x13da,0x1092,0x1a46,0x1d9d)+_0x313705(0xe4d,0xb9,0x669,0xd46),'gXYjg':_0x23937d(0x10c7,0x17a0,0x1167,0x428)+_0x23937d(0x29e,0x479,0xe09,0xb3),'XTyTb':function(_0x35cfbd,_0x29186d){return _0x35cfbd(_0x29186d);},'nEOjQ':function(_0x39892f,_0x49ca2a){return _0x39892f!==_0x49ca2a;},'LdCPv':'XoLdA','KoRdC':function(_0x1cc088,_0x9058af){return _0x1cc088(_0x9058af);},'nnzjU':_0x313705(0x6f8,0xd76,0x67a,-0x318),'ddtxE':function(_0x372ead,_0xa06542){return _0x372ead(_0xa06542);},'OkrfI':function(_0x17b5db,_0x4bb7a3){return _0x17b5db(_0x4bb7a3);},'ZIClK':_0x23937d(0x1a34,0x1e78,0x19a6,0x278c),'BZwQD':_0x313705(0x126c,0x12d0,0xc2b,0xe85),'hpfBO':_0x23937d(0xfd4,0x1c74,0x151c,0xed0)+'wnloader','LKqph':_0x313705(0x1e08,0x1b2e,0x2a2d,0x171d),'uRDeD':'KNjeC','UnWDB':_0x313705(0x425,-0x88b,0x91f,-0x2aa),'pqMVp':function(_0x57678c,_0x35378e){return _0x57678c===_0x35378e;},'DUBlV':_0x313705(0xf39,0x1a01,0x1604,0x955),'cMZaN':function(_0x2bf3af,_0x4cc656){return _0x2bf3af(_0x4cc656);},'GVCDo':function(_0x6bbb8,_0x259dbf){return _0x6bbb8(_0x259dbf);},'YYfns':_0x313705(0xc59,0xac2,-0x1f7,0x402)+_0x313705(0x1db8,0x2495,0x13cd,0x220a),'PzthL':function(_0x45b89c,_0x345fef){return _0x45b89c(_0x345fef);},'gCpEM':function(_0x48f858,_0x38adb3){return _0x48f858(_0x38adb3);},'iJoqG':_0x313705(0x11ed,0x10da,0x13c9,0x9bc)+_0x23937d(0x45b,0x748,0x1db,-0x247)+'d','GZMqX':function(_0x21482f,_0x3c6800){return _0x21482f(_0x3c6800);},'jzgkS':'Success','eKJmJ':function(_0x3052e9,_0x319b79){return _0x3052e9(_0x319b79);},'ZYYtz':function(_0xa9d16e,_0x5cfa61){return _0xa9d16e+_0x5cfa61;},'brOoY':'Answer:\x20','dNQyo':'guess\x20word','QjXgx':function(_0x182c5f,_0xfbbe6){return _0x182c5f(_0xfbbe6);},'FCrin':function(_0xb6aeec,_0x2c5218){return _0xb6aeec+_0x2c5218;},'dQPKt':'.m4a','QQezi':_0x313705(0x1450,0xc1c,0x147c,0x1f7a),'QNSlh':_0x313705(0x1285,0x1c85,0x16f2,0x1b93)+'ta','Jkmrg':'HH:mm:ss','GJvvG':function(_0x5a592e,_0x1b76c3){return _0x5a592e(_0x1b76c3);},'PjyVO':function(_0x31b78b){return _0x31b78b();},'hIFkS':_0x23937d(0xd14,0xca8,0x1002,0xd96)+'𝙂𝙊𝙉\x20-\x20𝘔𝘋\x20❖','VGiot':'⫷\x20MENU\x20⫸','AoqmV':function(_0x972628,_0x271ffa){return _0x972628(_0x271ffa);},'kSjhg':'EnjNf','MtmkE':'cBTJA','bXhxZ':function(_0x364016,_0x265f3b){return _0x364016(_0x265f3b);},'DRHas':_0x313705(0xdfc,0x1884,0xfd9,0x28a),'HhxYu':_0x313705(0xe81,0xd0f,0x170a,0xf4a)+_0x313705(0x1953,0xe16,0x1096,0x10fc)+_0x313705(0x199f,0x1601,0x1075,0x1435)+_0x313705(0xea3,0x11ed,0x982,0x1d9b),'EdNZm':_0x313705(0x13ba,0x1ceb,0x1982,0xaf8),'RJZcm':_0x23937d(0x321,0x116d,0xd27,-0x8bc),'TAzqF':function(_0x488c92,_0x5a9e80){return _0x488c92(_0x5a9e80);},'nwXCS':function(_0x2fd5a1,_0x4a74f7){return _0x2fd5a1(_0x4a74f7);},'KEAmZ':function(_0x8f615e,_0x3d70ed){return _0x8f615e(_0x3d70ed);},'pRrLs':_0x313705(0x5cb,0xfae,-0x130,-0x522),'emNRt':_0x23937d(0x202,0x3b2,-0x15c,0xc83),'PPlTX':_0x23937d(0x8a4,0x12fd,0x81d,0x49f),'CFeQG':_0x23937d(-0x11,-0x680,-0x458,-0xe31),'uLVPK':_0x313705(0x10cd,0x140c,0x308,0x329),'zRhvD':function(_0x15b205,_0xc2940a){return _0x15b205+_0xc2940a;},'ralYb':_0x23937d(0x6c3,0xce,-0xa8,0x679),'BccQH':function(_0x4e9019,_0x291938){return _0x4e9019===_0x291938;},'DsAYx':function(_0x2f03ad,_0x265ac6){return _0x2f03ad(_0x265ac6);},'XWvTE':function(_0x520757,_0x284c7e){return _0x520757!==_0x284c7e;},'BWoOv':'XEQpb','nyIOl':_0x23937d(0x4cd,0x743,0x5ea,0x3bb),'YqDTA':_0x23937d(0x344,-0x908,-0x1d3,0xa8b)+'❯','rpxNY':_0x23937d(0x11e5,0x17fa,0x3ce,0x1aaf)+'❯','PCNsV':_0x23937d(0x3b8,-0x507,0x48a,0xf3f)+_0x313705(0x2042,0x1b48,0x2b65,0x2a05),'ZglxT':_0x23937d(0x917,0x10a4,0x624,-0x503)+_0x313705(0x1e28,0x2092,0x295f,0x202e)+'F6Yj/20220'+'803-080446'+_0x23937d(0xfce,0x1d3b,0x381,0x1a63),'lhffD':_0x23937d(0x15d1,0x1b8a,0x1f2c,0xa27),'yOyNM':_0x313705(0xaa3,0x159f,0x16a,0x8c2),'gBcsp':function(_0x24b1dd,_0x345356){return _0x24b1dd===_0x345356;},'IImEw':'NimSg','pPsPl':function(_0xd4d5c7,_0x11afe5){return _0xd4d5c7+_0x11afe5;},'KFaPb':'YoCIt','GuBUB':'User\x20was\x20a'+_0x313705(0xa5c,0x1265,-0xf9,-0x45d)+_0x23937d(0x6fe,0x12c5,0xc94,-0x19f),'wBkNG':_0x313705(0x7db,0x1582,0x56a,0x786),'fAlxp':_0x23937d(0xb78,0x1884,0x1496,0x2f1),'QIHIy':'bweDO','FbqqN':function(_0x37a004,_0x3b1678){return _0x37a004(_0x3b1678);},'rKybW':function(_0x581cb1,_0x4d7248){return _0x581cb1(_0x4d7248);},'kvQAZ':function(_0x183d87,_0x1efeb4){return _0x183d87(_0x1efeb4);},'SWvvm':_0x313705(0x1292,0x1513,0xe9f,0x1f52),'XmJxn':function(_0x488f4e,_0x1c4b24){return _0x488f4e!==_0x1c4b24;},'zHLTC':_0x23937d(0xb03,-0x7a,0xf35,0xbfb),'tkThv':'zJIWE','XNhzW':_0x313705(0x1a3b,0x2627,0x2244,0x1073),'CVnzW':function(_0x241cca,_0x11fcef){return _0x241cca(_0x11fcef);},'yEedJ':_0x313705(0xe81,0x41c,0x159d,0xe99)+_0x313705(0xbad,0xa78,0x13e6,-0x11f)+_0x313705(0xf16,0xdd,0xbfa,0x79e)+'on','ckJiJ':_0x23937d(0x973,0xa55,0xdd6,0x654)+_0x313705(0x1213,0x80c,0xeeb,0x384),'CbqeE':function(_0x31da7e,_0x456361){return _0x31da7e(_0x456361);},'OKaPI':function(_0x1012ee,_0x3bebee){return _0x1012ee(_0x3bebee);},'Geebz':function(_0xeaefd2,_0x5895e2){return _0xeaefd2!==_0x5895e2;},'AaLNm':_0x23937d(0x1b9d,0x1fee,0x2773,0x27f7),'RyvDa':'*SAVE\x20FROM'+'*','RvfTz':function(_0x2f3ad4,_0x1958a2){return _0x2f3ad4===_0x1958a2;},'bcjJP':_0x23937d(0xf6c,0xa43,0x153d,0xd2f),'oSupF':_0x313705(0x84b,-0x1ab,0x1f0,0x16b2),'gpoXm':function(_0x2e5672,_0x30ce05){return _0x2e5672(_0x30ce05);},'gBwGE':function(_0x4095cf,_0x2b7e68){return _0x4095cf(_0x2b7e68);},'sFyot':_0x23937d(0x1a05,0x1813,0x150d,0x235b)+'4','SjatV':function(_0x35ee15,_0x5351fd){return _0x35ee15+_0x5351fd;},'RldYn':function(_0x3cca03,_0x452ca6){return _0x3cca03+_0x452ca6;},'zUwxn':'tictactoe-','RUiBp':'WAITING','wzDAs':_0x23937d(0x1087,0x8f0,0x260,0x16a)+_0x313705(0x496,0x89d,0x40c,0x2c7),'esVaf':function(_0x524f6c,_0x4b2a8f){return _0x524f6c(_0x4b2a8f);},'yeget':function(_0x5a5fd6,_0x13976e){return _0x5a5fd6(_0x13976e);},'JqhLr':function(_0x2a6911,_0x3c68b2){return _0x2a6911<_0x3c68b2;},'IcXJI':function(_0x5753f8,_0x2f1428){return _0x5753f8*_0x2f1428;},'GLJuo':function(_0x42c005,_0x1ea9bf,_0x49322f){return _0x42c005(_0x1ea9bf,_0x49322f);},'oIeZW':function(_0x2f20d8,_0x59982c){return _0x2f20d8(_0x59982c);},'tObhM':function(_0x1bca91,_0x4bd5d5){return _0x1bca91(_0x4bd5d5);},'yXfGq':function(_0x4412b0,_0x2e85ec){return _0x4412b0(_0x2e85ec);},'iofYS':function(_0x33c9cf,_0x4ddfd2){return _0x33c9cf<_0x4ddfd2;},'FfGrI':function(_0x2b7d37,_0x371323){return _0x2b7d37(_0x371323);},'fqTVW':function(_0x4766b5,_0x427d51,_0x25e5b7){return _0x4766b5(_0x427d51,_0x25e5b7);},'iVNZD':_0x313705(0x1d85,0x2314,0x205d,0x1125),'mTYVi':_0x23937d(0x1226,0x1710,0x1168,0x511),'VUKEy':_0x23937d(0x1ceb,0xfeb,0x1542,0x21a4)+_0x313705(0x17f9,0x1953,0x2257,0x20f8)+_0x313705(0x189d,0x131b,0x14d0,0x26f4)+_0x23937d(0x143f,0xa22,0xc06,0x15b3),'fbgBl':function(_0x2fb791,_0x326632){return _0x2fb791!==_0x326632;},'ujGol':'RQFhU','hUogP':_0x313705(0xee5,0x1928,0xf54,0x1046),'OGAcA':function(_0x580dce,_0x5634a1){return _0x580dce(_0x5634a1);},'umJFM':function(_0x3fde88,_0xa82321){return _0x3fde88===_0xa82321;},'JvFdX':_0x23937d(0x21e,-0x729,-0x201,-0xaf6),'WrzFI':_0x313705(0x168a,0x193f,0x1d4b,0x202e),'eCKKF':function(_0x5b19b5,_0x3982b4){return _0x5b19b5*_0x3982b4;},'bTOBV':function(_0x3a947b,_0x1e07c3){return _0x3a947b!==_0x1e07c3;},'rCqsQ':_0x313705(0x15a1,0x12e9,0xa71,0x1b52),'NzRnq':'undefined','dzRRk':function(_0x489073,_0x2ab291){return _0x489073===_0x2ab291;},'HgyBP':_0x313705(0xd88,-0xe4,0x10d6,0x40b),'wxXmC':'jBbPT','jCWkv':function(_0x12a244,_0x3a5f16){return _0x12a244===_0x3a5f16;},'dpQnR':function(_0x325284,_0x4c13d0){return _0x325284(_0x4c13d0);},'EDETf':function(_0xc26172,_0x5dcbcd){return _0xc26172!==_0x5dcbcd;},'NrRnB':_0x313705(0xbc2,0xd7a,0x5f2,0x1db),'gLDzG':function(_0x56587e,_0x51b6c5){return _0x56587e(_0x51b6c5);},'yYqeH':'mp4','VzZWW':function(_0x173598,_0x299122){return _0x173598!==_0x299122;},'CIOPC':_0x313705(0x1d0e,0xf02,0x157e,0x10d6),'KdrdX':'ZQbUU','pavDS':_0x313705(0x1a94,0x22eb,0x2652,0x2160),'WIwkg':'XEuln','Ybepr':function(_0xabe655,_0x3a420d){return _0xabe655===_0x3a420d;},'lWxYR':_0x313705(0x1cb8,0x1396,0xdca,0x2a8e),'KlqnQ':'yTxPT','gvxlb':function(_0x53df72,_0x2d71eb){return _0x53df72===_0x2d71eb;},'GjcqI':_0x23937d(0xb60,0x38e,-0x21a,0x90f),'SVZaO':'jvuVk','GGYqs':function(_0x582283,_0x9ab3e6){return _0x582283(_0x9ab3e6);},'wpyNU':'https://i.'+_0x313705(0x182c,0xd3e,0x14f9,0x24bb)+_0x23937d(0x1c06,0xf10,0x11b6,0x1e12)+_0x23937d(0x84e,0x8cb,-0x14a,-0x278)+_0x313705(0x953,0x1220,0x161d,0x15c8),'aErGw':_0x23937d(0x1074,0x1d5,0x1829,0x1f01)+_0x23937d(0x19e4,0x1b34,0x2047,0xf21),'WXuMz':_0x23937d(0x1c2c,0x1a39,0x1c0d,0x1b11),'YHddC':_0x23937d(0xfba,0x1e3f,0x3d3,0x1db5),'eGtvx':_0x23937d(0x1d78,0x26ea,0x2120,0x254c),'seiAb':function(_0x349427,_0x5a58da){return _0x349427 in _0x5a58da;},'tfYeg':function(_0x3c9f49,_0x32c8cc){return _0x3c9f49(_0x32c8cc);},'DdJLv':_0x313705(0x17d7,0xa1a,0x1125,0x1c6c)+_0x313705(0x182a,0x1291,0x1bdd,0x1588)+'\x20The\x20Vote\x20'+_0x23937d(0x16d2,0x177d,0x14da,0x1df0)+'\x20This\x20Grou'+'p','gZmpZ':function(_0x3a7f80,_0x3782ae){return _0x3a7f80(_0x3782ae);},'oxBNC':_0x313705(0x1832,0x2168,0xac0,0x236a)+_0x23937d(0x17a7,0x245c,0x19d2,0x213a),'Bxbii':_0x23937d(0x13f6,0x98d,0x16e5,0x1f26)+_0x313705(0x190e,0x1ac1,0x24c0,0x1d2b),'xvUao':_0x313705(0x1d21,0xe90,0x10bc,0x17e6)+_0x23937d(0x43c,0x29a,0xca2,-0x1a),'YloLn':_0x313705(0x20ab,0x2d75,0x2991,0x14b3),'EeLvS':function(_0x5a6fba,_0x307d43){return _0x5a6fba(_0x307d43);},'NjJAX':_0x313705(0x1d29,0x29d4,0x1cf9,0x27a0),'zNSne':_0x313705(0x17d7,0xcfb,0x1f6b,0x1e66)+_0x313705(0x214a,0x1eee,0x154f,0x1888)+_0x313705(0x1302,0x15a2,0xa06,0x1f43)+'e','ikLSP':function(_0x59167a,_0x5f5c36){return _0x59167a(_0x5f5c36);},'WsOvE':function(_0x5b8bf3,_0x133634){return _0x5b8bf3(_0x133634);},'FFgrN':function(_0x557171,_0xe60682){return _0x557171(_0xe60682);},'vdPIo':_0x313705(0x15ee,0x1615,0x1d12,0x162e),'plzwE':_0x23937d(0x710,-0x132,0x6e0,0x22),'NIAuQ':_0x313705(0x1b84,0x1f01,0x1edd,0x1a16),'AVLEn':_0x23937d(0x5f2,0xb3a,-0x88d,-0xb9),'gGyfw':function(_0x34705c,_0x24ad8f){return _0x34705c(_0x24ad8f);},'udHfr':function(_0x250802,_0x156f60){return _0x250802(_0x156f60);},'sgUEn':function(_0x326aa4,_0x49dd43){return _0x326aa4(_0x49dd43);},'JdVgb':_0x23937d(0x1b22,0xe69,0x1c75,0x1ca3)+_0x313705(0xbd5,0xf0c,0x763,0x1267)+_0x313705(0x63b,0xeba,0x64a,-0x1cc)+'us\x20this\x20gr'+'oup','NFpsx':function(_0x2f67c0,_0x378b71){return _0x2f67c0!==_0x378b71;},'AsjuI':'EjzNO','qwzdq':function(_0x1f9cf4,_0x218b04){return _0x1f9cf4(_0x218b04);},'wGxQI':function(_0x40ef38,_0x373749,_0x4a6d57){return _0x40ef38(_0x373749,_0x4a6d57);},'IpiNq':function(_0x47b232,_0x36d2e3){return _0x47b232===_0x36d2e3;},'NjpOm':_0x23937d(0x7a0,0x13cc,0x661,0xa68),'ZkrXt':function(_0x319b17,_0x4d7f96){return _0x319b17+_0x4d7f96;},'bFgSs':_0x23937d(0x1cf7,0x1f08,0x12c0,0x2272)+_0x313705(0x1582,0xf2b,0x1068,0x2010),'VYulw':_0x313705(0x13d1,0xdd2,0x1e01,0x13a7)+'Sentence','AxYvS':function(_0x4ab6ad,_0x571816){return _0x4ab6ad(_0x571816);},'Nnxqg':function(_0x437cd0,_0x4926ba){return _0x437cd0===_0x4926ba;},'jNSQd':_0x23937d(0x11ab,0xd48,0x4f2,0x1e40),'XJLDv':_0x313705(0x128d,0x168d,0x1b4e,0x1d3c),'eOUyJ':_0x23937d(0x1617,0x16de,0x1ddd,0x24b2),'JPApQ':function(_0x1ae73b,_0x27e851){return _0x1ae73b!==_0x27e851;},'CeWPX':_0x23937d(0xbae,0x1728,0x4a4,0x9ea),'szkSl':function(_0x4dfcdc,_0x382f67){return _0x4dfcdc(_0x382f67);},'qCmac':function(_0x33fbbd,_0x379882){return _0x33fbbd===_0x379882;},'Urpoi':_0x313705(0x1dae,0x2486,0x21b2,0x21e1),'fGHHC':function(_0x84c740,_0x4f9e19){return _0x84c740(_0x4f9e19);},'DniAH':function(_0x423095,_0x50d598){return _0x423095(_0x50d598);},'brTPe':function(_0x3c590c,_0x3d3ec3){return _0x3c590c(_0x3d3ec3);},'DVlkd':_0x23937d(0x1126,0x1e71,0x865,0x1bac),'JyVHN':'2|4|0|3|1','ZpSbZ':function(_0x277923,_0x52fa3e){return _0x277923(_0x52fa3e);},'Akdwi':_0x313705(0x1e88,0x2193,0x21cb,0x25d6)+'\x20turning\x20o'+_0x313705(0x1a83,0x2669,0x24ff,0x2304)+_0x23937d(0x13e7,0xd33,0x1293,0x9dc)+'k\x20in\x20this\x20'+_0x23937d(0x11c6,0x1c96,0x1e6b,0xcd3),'AYMBU':function(_0x23b49c,_0x1ceb78){return _0x23b49c!==_0x1ceb78;},'OnWhG':_0x313705(0x1ecd,0x1173,0x2bad,0x1103),'PFpWg':function(_0x17e2d2,_0x2d31ff){return _0x17e2d2(_0x2d31ff);},'lUrUB':'3|1|5|4|0|'+'2','RfQWl':_0x23937d(0xd1c,0x350,0x18c5,0x16f7),'aPbaU':function(_0xbaefe1,_0x1e735e){return _0xbaefe1(_0x1e735e);},'xZnEO':function(_0x534a83,_0x35d509){return _0x534a83(_0x35d509);},'KNDFS':_0x313705(0x165c,0x13e5,0x12da,0x20e8),'Cidlc':function(_0x2e4b56,_0xbbf4f5){return _0x2e4b56>=_0xbbf4f5;},'OjMjZ':function(_0x548758,_0x16089d){return _0x548758+_0x16089d;},'UqERc':'*File\x20Over'+_0x23937d(0x446,0x53e,-0x99e,-0x55b),'tmkbD':function(_0x5d09cf,_0x3d67fb){return _0x5d09cf!==_0x3d67fb;},'KopPp':_0x23937d(0x13e5,0x2289,0x16ee,0x1acb),'VDcJA':function(_0x18adba,_0x53e34c){return _0x18adba!==_0x53e34c;},'LFegi':_0x313705(0x1dd1,0x1c9f,0x251e,0x1ecb),'ATulh':_0x313705(0xacb,0xa64,0x1942,0x19b8),'KEfEC':'lHHeJ','VfyIv':function(_0x169b22,_0x5385d7){return _0x169b22(_0x5385d7);},'JfHYc':_0x313705(0xc7d,0x12a4,0xa80,0xbd8)+_0x313705(0x1455,0x1a69,0xf90,0x1f43)+_0x313705(0x14d5,0x7df,0x16f4,0x1787)+_0x23937d(0x12b,-0x838,0x291,-0x36e)+'.png','WvHAK':function(_0xab66ce,_0x3505d8){return _0xab66ce(_0x3505d8);},'PEISO':function(_0x1ddaf8,_0x2a1914){return _0x1ddaf8!==_0x2a1914;},'QcTbl':_0x313705(0x150a,0xdd0,0xca0,0x11f4),'jnYmj':function(_0x58044a,_0x328ea5){return _0x58044a!==_0x328ea5;},'VbbUc':_0x313705(0x1fa3,0x1131,0x1de9,0x1df0),'aWhcO':_0x23937d(0x1de0,0x1dfc,0x23ce,0x2a08),'WwLJl':function(_0x335c5f,_0x31a089){return _0x335c5f(_0x31a089);},'iQRld':function(_0x2f25e2,_0x450894){return _0x2f25e2(_0x450894);},'RAFfg':function(_0x1e568d,_0x1f3bef){return _0x1e568d+_0x1f3bef;},'uoMHa':_0x313705(0x764,0x5b6,0xec8,0x64e)+_0x23937d(0x151d,0xcec,0x1c6a,0x14cf)+_0x313705(0x17d7,0xe78,0x2280,0xf3a)+'ly\x20Updated'+'.```\x0a\x0a[\x20◉\x20'+_0x313705(0x1bae,0x2958,0x1055,0xe46)+_0x23937d(0x7de,0xb59,0xab0,0xc1b),'LiYda':_0x313705(0xdef,0x62a,-0x69,0xda3),'kTJmk':_0x23937d(0x1a3,0xbe5,-0xc9b,-0x7c),'jarZF':'rsxco','hlMxu':_0x23937d(0x3e,-0x92f,-0xa58,-0xa91),'mDYGK':_0x23937d(0x1d22,0x2315,0x2829,0x15b8)+']','CzCgs':function(_0x133a36,_0x41d1d3){return _0x133a36+_0x41d1d3;},'xYiPa':_0x23937d(0x135b,0x2264,0x11d6,0x1bb3),'MdaCB':function(_0x1a57e9,_0x3b37c4){return _0x1a57e9+_0x3b37c4;},'THjXH':_0x23937d(0xd5f,0x8a2,0x1408,0x1692),'RJlav':_0x313705(0x8bf,0x4b8,-0x54d,0x1763)+'at','ggsCW':function(_0x3d878b,_0x5d1efd){return _0x3d878b===_0x5d1efd;},'WWFhV':_0x23937d(0xae2,0x70e,0xa0c,0x1276),'GMtTt':_0x23937d(0x1a30,0x1bbb,0xea4,0x162a),'mDBQu':_0x23937d(0x2f2,-0x745,0x592,-0x984)+'FT\x20SERVER\x20'+_0x23937d(0x17d0,0x26c2,0xc88,0x13e2)+_0x313705(0x1fd7,0x1be2,0x2165,0x1375)+'tpocket-se'+'rvers.com/'+'country/in'+_0x313705(0x2172,0x1a02,0x27ed,0x2c1a),'OXjOV':function(_0x619572,_0x389c25){return _0x619572!==_0x389c25;},'DjKsE':'GYShr','PKnSQ':_0x313705(0x17b6,0x231c,0x11dd,0x2552)+'1','zoFKW':function(_0x1d9f4e,_0x5a3e58){return _0x1d9f4e(_0x5a3e58);},'iKhCj':function(_0x138230,_0x2d9571){return _0x138230!==_0x2d9571;},'aYDwz':'ojbVz','nLWop':_0x313705(0x16b9,0x921,0xeea,0x1ed2),'uEuIm':'WgoYJ','nsupp':'0|2|3|1|4|'+'5','hBukA':function(_0x43cbe1,_0x1dc371){return _0x43cbe1!==_0x1dc371;},'FfGvr':_0x23937d(0x14d2,0x1b7f,0xfdf,0x1415),'rWOFA':'3|5|4|2|0|'+'1','cbXBm':_0x23937d(0x1c2,-0xb9d,0xe82,0x78a),'uIIRn':_0x23937d(0x4d3,-0x288,-0x6b4,0xf9e),'fHehD':function(_0x187449,_0x28e80d){return _0x187449(_0x28e80d);},'jlNEH':_0x313705(0x1c93,0x246d,0x1eac,0x29a3)+_0x313705(0x1a66,0x12be,0x10ff,0x164e),'njNbF':'tik','jzLgW':'https://i.'+'ibb.co/s1L'+_0x23937d(0x1ce4,0x29b8,0x1299,0x2be2)+_0x23937d(0x27,0xa1f,0x998,0xcbc)+_0x313705(0x1334,0xe4b,0x1aed,0x1559),'rmEDf':function(_0x1e6aae,_0x66c845){return _0x1e6aae!==_0x66c845;},'mTIuj':_0x313705(0x1cb3,0x268e,0x13b4,0x242b),'lbBzX':'WrLtf','rKhxD':_0x23937d(0x12b1,0x16fd,0x645,0x1a75)+'3','WUEgk':'Where\x20is\x20t'+_0x313705(0x1518,0x1953,0x123a,0x1874)+_0x313705(0x138e,0x79a,0x13ec,0xbdc),'OKLbH':'```⚙️🔄\x20Aliv'+_0x313705(0x1e4a,0x10f9,0x17e8,0x23dd)+_0x313705(0x17d7,0x907,0xac5,0xd7d)+_0x313705(0x1679,0x1fd2,0x11ff,0x96c)+_0x23937d(0x17a1,0xc8d,0x17b2,0x11d6)+_0x23937d(0x1848,0x17d7,0x2362,0x2760)+'-ᴍᴅ\x20]','qvVjR':function(_0x59fb02,_0x495527){return _0x59fb02(_0x495527);},'tuMDI':'Error','RlAcJ':_0x313705(0x1efc,0x1cf5,0x1920,0x1640),'xWPxg':_0x23937d(0x1b62,0x11a9,0xcfa,0x12eb),'LmDhD':'4|1|0|2|3','SLEeH':function(_0x3f7152,_0x5315d3){return _0x3f7152(_0x5315d3);},'rOxJx':function(_0x5023e0,_0x308492){return _0x5023e0*_0x308492;},'bcTox':'DD/MM/YYYY'+'\x20HH:mm:ss','JGZTf':function(_0x232e0d,_0x268b11){return _0x232e0d===_0x268b11;},'OXCWz':_0x23937d(0xe41,0x1beb,0x1836,0x456),'BeOmw':_0x23937d(0x11d6,0xe00,0x169f,0x1c76),'ZmoBo':_0x313705(0xe13,0x11c4,0x36c,0x2c),'IbGdC':_0x313705(0x1aac,0x244e,0x21e3,0x1eb2),'oVUBS':function(_0x412896,_0xf698d4){return _0x412896===_0xf698d4;},'PmFFR':'iDwgM','PNIpa':_0x313705(0x15ad,0xab4,0x118a,0x110b)+'1','XTnmK':_0x23937d(0x708,0x14ab,0xbc9,0x5d),'pcruc':_0x23937d(0xa77,0x1ec,0x124,0x18db)+'1','INZtu':function(_0xb89ea6,_0x5ed1fc){return _0xb89ea6(_0x5ed1fc);},'LgPiZ':function(_0x13d91c,_0x1a44f6){return _0x13d91c(_0x1a44f6);},'rThNd':function(_0xfa43e7,_0x16c324){return _0xfa43e7(_0x16c324);},'zWmMC':_0x23937d(0xcea,0xd14,0x1388,0x44e)+'or\x20Result\x20'+_0x23937d(0xa24,-0x60,0x2b1,0x28c),'WRdAs':_0x313705(0x6d9,0x4fe,-0x17e,0xebd)+_0x23937d(0x71e,0x5aa,0x13f8,-0x30e),'OXpga':_0x313705(0x15e5,0x240a,0x243a,0x11a2),'MNuWC':function(_0x13b09c,_0x1406cf){return _0x13b09c(_0x1406cf);},'tECOH':function(_0x28373c,_0x540fc6){return _0x28373c===_0x540fc6;},'rNJCy':_0x23937d(0xd0a,-0x1ac,0x103b,0x1a36),'VBTYO':function(_0x53278a,_0x26abf0){return _0x53278a(_0x26abf0);},'LQTfk':function(_0x25a9af,_0xa6423d){return _0x25a9af(_0xa6423d);},'dyUjf':function(_0x251fc0,_0x2d0a0a){return _0x251fc0===_0x2d0a0a;},'wFMGU':_0x23937d(0xe9d,0x18f6,0xc33,0x186f),'lBbRd':'3|1|0|4|2','KLtQA':function(_0x3e8538,_0x483a70){return _0x3e8538+_0x483a70;},'alwtR':function(_0x50637b,_0x42b40a){return _0x50637b+_0x42b40a;},'gqZYT':'kvCgC','jiOoq':function(_0x1c752b,_0x53cdcd){return _0x1c752b(_0x53cdcd);},'WMnyK':_0x313705(0x11fa,0x9b4,0x1db1,0x9aa),'xNAAZ':_0x313705(0x763,0x455,0x12a1,0xe0),'efpMu':function(_0x22e155,_0x291a63){return _0x22e155(_0x291a63);},'dcrlY':function(_0x4b97fe,_0x3aed1f){return _0x4b97fe(_0x3aed1f);},'MrEJL':_0x23937d(0x166,0x6d0,-0xb2f,0x5ff),'UrZxt':_0x313705(0x960,0xc41,0xe88,0x6bb),'SWoVw':_0x313705(0x72e,0x75a,0x1022,0x45e),'Caxnh':function(_0x27136f,_0x402122){return _0x27136f(_0x402122);},'EXazE':_0x313705(0x18cd,0x1832,0x1dcc,0x1197),'VkzSG':_0x313705(0x1699,0x1cb6,0x2096,0x182f),'YsUrY':_0x313705(0x7c4,0x1312,0x9c3,0x150),'rsSDg':function(_0x33ca3f,_0x4d8da6){return _0x33ca3f(_0x4d8da6);},'mzWvp':_0x23937d(0x16b9,0xd2c,0x1b86,0x8b5),'qYAGh':_0x23937d(0x1bd1,0x2a89,0x2457,0x1c0f)+'2','IZoKT':function(_0xa0cc42,_0x5e74b9){return _0xa0cc42(_0x5e74b9);},'KezgS':_0x313705(0x1c93,0xe98,0xe1a,0x28c4)+'he\x20new\x20tex'+'t?','ODuYE':_0x313705(0xe03,0x328,0x12c0,0x1385),'EbVyq':function(_0x33c6fd,_0x2ed4b0){return _0x33c6fd(_0x2ed4b0);},'UWWtd':'1|5|3|2|0|'+'4','gdPIU':function(_0x516f67,_0x3527f6){return _0x516f67(_0x3527f6);},'VmeGb':function(_0x4d3716,_0x7a2cf0){return _0x4d3716(_0x7a2cf0);},'UAaCJ':function(_0x2bf762,_0x432655){return _0x2bf762!==_0x432655;},'afWfT':'Dlbid','qvvNU':function(_0x251150,_0x127555){return _0x251150===_0x127555;},'DpyMK':function(_0x526b22,_0x477f41){return _0x526b22===_0x477f41;},'ixlIz':function(_0x10e92d,_0x266649){return _0x10e92d===_0x266649;},'nlKTr':_0x23937d(0x8b6,-0xf2,0xdd9,-0x31d)+_0x313705(0x352,0xf66,-0xb9b,-0x7e6)+'nished\x20Ses'+'sions!','yoFJI':function(_0x45f4dc,_0x5d07cf){return _0x45f4dc(_0x5d07cf);},'SKlYI':function(_0x1c32e1,_0x186466){return _0x1c32e1(_0x186466);},'ZKKZY':function(_0x2b9ec7,_0x48e4a6){return _0x2b9ec7(_0x48e4a6);},'Nayeb':_0x313705(0x941,0x17ea,-0x12c,0x887),'TLexS':_0x23937d(0x192f,0x189c,0xcf7,0x1a5f),'Renun':function(_0x2252f,_0x5a9629){return _0x2252f(_0x5a9629);},'SGUvP':function(_0x36c46c,_0x333d37){return _0x36c46c!==_0x333d37;},'JnGwy':_0x313705(0x4f9,0xce4,0x196,0xdca),'nDReH':'mNMNM','wyGFa':function(_0x25836c,_0x236761){return _0x25836c/_0x236761;},'ZaqaH':'guess\x20song','IFurs':_0x313705(0x13d1,0x622,0x574,0x1d44)+'song','rtjUF':function(_0x4c81ef,_0x19900f){return _0x4c81ef(_0x19900f);},'MmnRQ':function(_0x14678b,_0x3c80b8){return _0x14678b(_0x3c80b8);},'BEOwR':function(_0x405cc3,_0x45b349){return _0x405cc3(_0x45b349);},'azNLA':function(_0x35e274,_0x1a917d,_0x5e775b){return _0x35e274(_0x1a917d,_0x5e775b);},'hBcTh':function(_0x23c295,_0x35a81f){return _0x23c295*_0x35a81f;},'qAkHu':'recording','EfeuT':_0x313705(0x1df2,0x2c06,0x1af7,0x1737),'eSvKR':function(_0x10c93a,_0x315b12){return _0x10c93a in _0x315b12;},'UFawx':_0x23937d(0xe3e,0x6ef,0x843,0x1c42),'reYPO':function(_0x17dabf,_0x576f33){return _0x17dabf(_0x576f33);},'RuAXo':function(_0x296a5b,_0x233d2c){return _0x296a5b!==_0x233d2c;},'JhajQ':function(_0x35a914,_0x178a8c){return _0x35a914 in _0x178a8c;},'sYSGt':'mute','LFZPd':_0x23937d(0x1923,0x1dd2,0x16ba,0x20b3)+_0x313705(0xde7,0x935,0x5c,0x20f),'uAqAT':_0x313705(0x1cd8,0x1fc7,0x174b,0x29a5)+'g','BKRBq':function(_0x3bb0dc,_0x3f6f1e){return _0x3bb0dc in _0x3f6f1e;},'lMrHx':'templateGi'+'f','okiBK':_0x313705(0x1bbc,0x1dc9,0x2a4c,0x2706),'xSFEa':_0x313705(0xdba,0x12f2,0x49f,0x19cb)+'age','XFMeR':function(_0x5baf3e,_0x5c6396){return _0x5baf3e in _0x5c6396;},'RIyOb':function(_0x2fc313,_0x29a7b1){return _0x2fc313 in _0x29a7b1;},'XcTcz':_0x313705(0x167e,0x1b0b,0x1c0d,0x1143)+_0x23937d(0x22c,-0xc00,0x77a,-0x4d),'CBNJo':function(_0x2f469e,_0x232d98){return _0x2f469e(_0x232d98);},'WvNYt':function(_0x1048a4,_0x33caf1){return _0x1048a4===_0x33caf1;},'lkAGq':function(_0x4577a7,_0x10cbf3){return _0x4577a7===_0x10cbf3;},'syNHM':'https://i.'+'ibb.co/8b6'+'tYnT/20220'+_0x23937d(0xd52,0x1366,0x1a08,0x312)+_0x23937d(0x5ed,0x1408,0x7e7,0x68f),'clBLO':_0x313705(0x121a,0x1510,0x1acc,0x1530)+_0x313705(0x18e2,0xd4d,0x170a,0xfb6),'hClyd':_0x313705(0x19a0,0x21f5,0xf6f,0x1a2b),'iMXba':_0x313705(0x19fa,0x16af,0x2158,0x2454),'WDbTC':_0x313705(0x2059,0x22a0,0x2ce5,0x2b30)+_0x313705(0x1b0d,0x1265,0x1747,0x2732),'ndDuH':'3|1|0|2|4','OuKWN':function(_0x5cb3dc,_0x2f7066){return _0x5cb3dc(_0x2f7066);},'Uejli':function(_0x286ed5,_0x50b557){return _0x286ed5(_0x50b557);},'hXRXR':function(_0x5eaa76,_0x1973ea){return _0x5eaa76 in _0x1973ea;},'uGEzs':function(_0xa972cf,_0x358bb1){return _0xa972cf(_0x358bb1);},'yehpF':function(_0x260032,_0x2c0844){return _0x260032+_0x2c0844;},'FFwYg':function(_0x41dbe8,_0x10d56b){return _0x41dbe8(_0x10d56b);},'nPrnt':_0x313705(0x1629,0x1706,0x2395,0xf09)+_0x313705(0xab2,0xb87,0xbd,0x1079),'reiMw':_0x313705(0x109a,0x1eed,0x1ef6,0xff2),'zIPrz':function(_0x2b3369,_0x4f5dfe){return _0x2b3369(_0x4f5dfe);},'VAbWf':function(_0x5dac16,_0x3a62a4){return _0x5dac16(_0x3a62a4);},'SJCEG':function(_0x2156fd,_0x5ae25e){return _0x2156fd(_0x5ae25e);},'gUDrJ':'https://i.'+'ibb.co/c3F'+_0x313705(0x69b,-0x746,-0x6e0,-0x398)+_0x313705(0x11dd,0x4d7,0xe48,0x14dd)+'.png','wlStO':_0x23937d(0x917,0x1403,0x729,0x143a)+_0x313705(0x1930,0x2633,0x1420,0x1bf7)+'cCWc/20220'+'803-082009'+'.png','IFHkv':function(_0x5929c1,_0xeb8ffc){return _0x5929c1!==_0xeb8ffc;},'yoxJp':function(_0x529f0e,_0x5895cf){return _0x529f0e==_0x5895cf;},'snVdR':function(_0x1b7027,_0x27ba4b){return _0x1b7027(_0x27ba4b);},'IYwoy':_0x313705(0x139e,0x1562,0x11a7,0x1e67),'GYPyB':function(_0xb9257a,_0x2c2fce){return _0xb9257a(_0x2c2fce);},'YJBCh':function(_0x1150ed,_0x1fb987){return _0x1150ed(_0x1fb987);},'SXhBs':_0x23937d(0x1656,0x2414,0x1d55,0x9b1),'XCbWj':_0x313705(0xdc4,0x1af2,0x52f,0x3),'WcNHf':_0x313705(0x1cf4,0x2923,0x1632,0xe58)+'ge','vmDBR':function(_0x134c57,_0x1458de){return _0x134c57==_0x1458de;},'zkSGY':_0x23937d(0xe2d,0x17b,0x62,0x426)+'ge','nhwEC':function(_0x1b6398,_0x39434a){return _0x1b6398==_0x39434a;},'VfUny':_0x23937d(0x178d,0x1ede,0x12ec,0x134f)+_0x23937d(0x1a31,0x101b,0xe55,0x1ce2),'wMQHH':function(_0x4f75bc,_0x2f99c8){return _0x4f75bc==_0x2f99c8;},'ftEYn':_0x23937d(0x122f,0x1e9e,0x37f,0x1f08)+_0x23937d(0x1982,0x14ab,0x219d,0x1c16)+'ge','VIoNw':_0x313705(0x1f4a,0x1d76,0x2c6f,0x163d)+_0x23937d(0x17f3,0xa19,0x1307,0x255e),'qGeTs':_0x23937d(0x14d3,0x18c1,0x1a33,0xb5e)+'ttonReplyM'+_0x23937d(0x408,0x1d7,0x995,-0xe5),'RMwtu':function(_0x3e165f,_0x18f9c4){return _0x3e165f===_0x18f9c4;},'qTrgz':'messageCon'+_0x23937d(0x9bb,0xc97,0x211,0x10fb),'qfwiS':_0x23937d(0x1b4d,0x1f22,0x101d,0xe87),'OePAk':function(_0x51e4f6,_0x27e4c0){return _0x51e4f6*_0x27e4c0;},'MnAfQ':function(_0x200bd9,_0x37d595){return _0x200bd9 in _0x37d595;},'kfkeB':_0x23937d(0x566,0xc93,0x1bd,0xac2),'oCnYl':function(_0x554c64,_0x4c1532){return _0x554c64!==_0x4c1532;},'aRknL':function(_0x1b3d05,_0x5eac6b){return _0x1b3d05(_0x5eac6b);},'mhEXT':function(_0xa67c0e,_0x21619d){return _0xa67c0e in _0x21619d;},'uacht':_0x23937d(0xa07,-0x381,0x74f,0x167a)+_0x23937d(0x15d5,0x1522,0x12fd,0x2248),'yyTAa':_0x23937d(-0x25,-0x794,0x478,-0x703)+'0@s.whatsa'+_0x313705(0xce8,0x300,0x1667,-0x34),'qWmhU':_0x313705(0x1364,0x505,0x17f5,0xa95),'FDMzZ':_0x313705(0x13b4,0x1456,0x217c,0x1d26),'xFeNT':'0@s.whatsa'+_0x23937d(0x982,-0x157,0x118d,0x42d),'BkwGR':_0x23937d(0x150f,0x8f9,0xe29,0x11bb)+_0x23937d(0xdc0,0x126c,0x1cac,0xb08)+'930@g.us','iFRrm':_0x313705(0x1e9f,0x1292,0x1c63,0x2216)+_0x23937d(0x196b,0xe67,0x1aa0,0x1fa7)+'us','THUra':_0x313705(0x144f,0x5da,0xd4e,0x1284)+_0x23937d(0x510,-0x6df,0xee2,0x648),'Enkgz':function(_0x3a5f74,_0x5452a8){return _0x3a5f74>=_0x5452a8;},'KWpLB':function(_0x5558d9,_0x48fa49){return _0x5558d9!==_0x48fa49;},'pLWkR':'TXgwV','NESgB':_0x313705(0x1e70,0x17a9,0x1527,0x2477),'QSeem':_0x313705(0x1af6,0x2754,0x297f,0x1907),'VYLEu':'CIfVU','bKsxA':function(_0x46e897,_0x2021a6){return _0x46e897===_0x2021a6;},'GrPfO':function(_0x722330,_0x218339){return _0x722330===_0x218339;},'KxrwR':_0x23937d(0x1748,0x9f8,0x156e,0x25dc),'mzXyQ':_0x313705(0xa22,0x18f6,-0x4cb,0x2ed),'NcSgz':_0x23937d(0x1ba0,0x25a7,0x253b,0x1b19),'VrCbs':'2|5|4|0|3|'+'1','EPQWm':_0x313705(0x1c99,0x1247,0x1b35,0x125b),'cSKNb':_0x23937d(0x138,-0x5b0,0xb76,-0x953),'HOYFP':function(_0x3ae1b4,_0x1c8c88){return _0x3ae1b4===_0x1c8c88;},'xReEp':_0x313705(0xd24,0x9ee,0x31c,0x1a13),'zXZao':function(_0x154991,_0x93b06e){return _0x154991!==_0x93b06e;},'jxWKp':_0x313705(0xb39,0x1183,0x1632,0x8cc),'PFXQN':function(_0x3ded1b,_0x52da91){return _0x3ded1b===_0x52da91;},'icjSa':_0x313705(0x1bc3,0x1708,0x20df,0x1975),'editG':_0x23937d(0x88e,-0x29a,0xc86,0x70e),'LECUR':function(_0x2984dc,_0x4ee92e){return _0x2984dc!==_0x4ee92e;},'vtKWP':_0x313705(0xa46,0xc71,0xc09,0xd74),'LsEJW':'Xctad','GroTh':function(_0x244795,_0x4e29c2){return _0x244795!==_0x4e29c2;},'vaGVv':'KRduI','VIXtP':_0x313705(0x856,0xf17,-0x458,0x8fc),'SXtAx':_0x23937d(0x1d62,0x274b,0x1629,0x220d),'Clncy':_0x313705(0x1de0,0x12c6,0x1917,0x2c3a),'fdQGG':_0x23937d(0x17cc,0x1b2b,0xa7f,0x122c),'lTVly':function(_0x15d1c7,_0x54e50c){return _0x15d1c7!==_0x54e50c;},'eSNSa':_0x23937d(0x8a5,-0x2a2,0xd86,0x1720),'DZvHu':'FAHjH','sNCfz':_0x23937d(0xa2b,0x154,0x191a,0x1382),'BAnxb':_0x23937d(0x17ea,0x2504,0x1ff9,0x25c9),'KexQH':_0x313705(0xdee,0xa8a,0x15ff,0x14d7)+'4','wfMtj':_0x313705(0xa2b,0x2ae,0xd40,0x17b8),'MgAAZ':_0x23937d(0x906,0x12b8,-0x5bb,0x10b6),'ipCzO':_0x313705(0x1d41,0x12f0,0x1b17,0x268b),'aIOhO':_0x23937d(0x1b70,0x22a9,0x229d,0x1283),'HJTrT':_0x23937d(0xc92,0x950,0x353,0x171b),'vVBRi':function(_0x312d31,_0x48461d){return _0x312d31!==_0x48461d;},'tMQEt':'yAiDt','KrjuV':function(_0x32c7fc,_0x32d79f){return _0x32c7fc===_0x32d79f;},'NrhCG':'mDPTY','VUZgM':_0x313705(0x18db,0xe9f,0x112e,0x1cc5),'JkrDl':_0x23937d(0x1480,0x7af,0x1e8f,0x20ef),'ZcWLY':function(_0x3433fa,_0x43f429){return _0x3433fa===_0x43f429;},'KDVBn':_0x313705(0x10ea,0x18d2,0x1113,0x1b2f),'NaBBk':_0x23937d(0x4fe,-0x334,-0x68b,0x2dd),'dSiNI':'WkdUm','yFDZQ':_0x23937d(0x1bee,0x1caf,0x2177,0x22f4),'iEZZX':function(_0x5eeece,_0x19cd8d){return _0x5eeece!==_0x19cd8d;},'tGBRw':_0x313705(0x1b9e,0x29b4,0x218e,0x228a),'WAlRf':_0x23937d(0x1734,0x15a9,0xabc,0xf0d),'bAgaf':_0x23937d(0x447,-0x955,0xd4b,0x5dc),'glFcG':'IZIIX','UaZOY':function(_0x2e6ca0,_0x4516be){return _0x2e6ca0!==_0x4516be;},'WvJvE':_0x23937d(0x1011,0x1c8f,0xc9a,0xe10),'hXHyS':_0x313705(0x11f0,0x1e6d,0x193c,0x2f3),'nwaSY':function(_0x5b364a,_0x24a4fb){return _0x5b364a===_0x24a4fb;},'GrFER':'LRjRW','djVMq':function(_0x29deec,_0x92c7c5){return _0x29deec!==_0x92c7c5;},'IJFWS':_0x313705(0x158b,0x2074,0x1811,0x1b42),'oHeVe':_0x313705(0xc76,0x11b9,-0x41,0xa86),'LnZDB':_0x23937d(0x12e9,0x10bd,0x1a17,0x14f7),'vSBWG':_0x313705(0x837,-0x1d4,0x1d6,0x15c2),'uqWPu':function(_0x3e747d,_0x396a13){return _0x3e747d===_0x396a13;},'SLeKH':'VkJeK','MSNlM':_0x313705(0x555,0xf12,0x10cb,0xa06),'SVVPZ':'nWYjL','nVrVO':_0x23937d(0xb6c,0x13f1,0x1724,0x1400),'SLRHL':_0x313705(0x1ba9,0x24df,0x261e,0x14a8),'peRSb':'szIee','jLoFA':_0x23937d(0x174f,0xb0b,0x261d,0x1408),'Zkfet':'uUTHP','FXWGq':function(_0x36aba6,_0x48083e){return _0x36aba6!==_0x48083e;},'vYdbZ':_0x313705(0x20cc,0x27a7,0x2c49,0x14b4),'rLGam':_0x23937d(0x15bd,0xbb5,0x1bfb,0xfec),'YIIEP':_0x313705(0x36d,0x35f,-0x84,0x1b7),'JLBmx':'qAOlb','DXqYj':_0x23937d(0xe42,0xd8f,0x1963,-0xa9),'DDnvq':_0x313705(0x14f1,0x147a,0x677,0x18fe),'lOKKk':_0x23937d(0x2a7,0xd57,0x99c,0x98c),'MfkBA':_0x313705(0x1db0,0x27a5,0x22b3,0x1589),'dQIYb':function(_0x1e8e5b,_0x587f46){return _0x1e8e5b===_0x587f46;},'RwvXD':'DxSlI','zRWhj':function(_0x4bfc53,_0x4a4557){return _0x4bfc53!==_0x4a4557;},'ArOSD':_0x313705(0x1938,0x2451,0x1fa8,0xecd),'pOWXH':'gecbE','WrBZd':function(_0x164d14,_0x8390a5){return _0x164d14!==_0x8390a5;},'DNlWp':_0x23937d(0x156f,0x123f,0xc1f,0x19f9),'Kpgtg':function(_0x34da15,_0x21d62d){return _0x34da15===_0x21d62d;},'lPjcd':function(_0x355fd3,_0x44238e){return _0x355fd3===_0x44238e;},'PAFDd':_0x23937d(0xf33,0xc3,0x17aa,0x15c9),'OlUOs':_0x313705(0x113f,0x17f7,0x19ff,0x59a),'FMEll':'dDywG','ywKOl':_0x313705(0x2067,0x2806,0x1d1b,0x247d),'LEdmO':function(_0x3fe709,_0x2516ed){return _0x3fe709===_0x2516ed;},'AfywS':_0x313705(0xd05,0x1048,0x42d,0x14cd),'BBUOW':_0x313705(0xbb1,0xced,0x4ec,-0x2f6),'fEWEi':_0x313705(0x1f48,0x2e2b,0x210c,0x2137),'JPziX':_0x313705(0x107e,0x197f,0x19df,0x1c7c)+_0x313705(0x17b0,0xc59,0x1343,0x1d00),'lzZQj':function(_0x2c3a8a,_0x5a5e28){return _0x2c3a8a===_0x5a5e28;},'JWdnn':_0x313705(0xf23,0x128a,0xaa7,0xb37),'gHwmu':_0x313705(0x178b,0x15c4,0x1023,0xd71),'SdtnI':_0x313705(0x1321,0x692,0x7ba,0x55b),'WSegQ':_0x313705(0x1a1e,0x1421,0xd91,0x26b4),'TeZcs':_0x23937d(0x1a9,0x4d3,0x8fb,-0x63),'stjKn':_0x23937d(0x1390,0x1e0f,0x1200,0x13d4),'fOmQK':_0x313705(0x423,0xb0d,0xbb,0xf2a)+'*','YIMsM':_0x23937d(0x1381,0xc5b,0x18d9,0xb91)+'i.countapi'+_0x23937d(0x1991,0xd40,0xaed,0x26be)+_0x23937d(0xee9,0x1f7,0x130d,0x1762)+_0x23937d(0x11ca,0x1a24,0x11b4,0x188e),'pXsno':_0x23937d(0x14af,0x1995,0x173b,0x170d),'NMECB':function(_0x293663,_0x5c2cfe){return _0x293663*_0x5c2cfe;},'ufixD':function(_0x446742,_0x389dae){return _0x446742(_0x389dae);},'wSzNN':'PIKjl','VYlyT':_0x313705(0xf8d,0x11b0,0x1dd,0x1501),'TbQVC':_0x313705(0x7b6,-0x74e,0x5e3,0xf38),'tlCfK':'fQqKd','AhFBY':_0x313705(0x8c0,0x804,0x154d,0xd4a),'LtgbO':_0x313705(0x17b3,0x10b0,0x1990,0x1de9),'cpPEE':_0x23937d(0x2e7,0xa60,-0x574,0x253),'XAdwM':_0x23937d(0x132a,0x203f,0x1402,0x1c39),'XBjcZ':function(_0x5f1017,_0x4db479){return _0x5f1017===_0x4db479;},'YjbGk':_0x313705(0x15c3,0x1825,0x212b,0xfe6),'CdxOF':function(_0x32a8b2,_0x49efa0){return _0x32a8b2>_0x49efa0;},'hIFZA':function(_0x57a66f,_0x10572e){return _0x57a66f===_0x10572e;},'lfhuA':_0x23937d(0x30c,-0x50b,0x3e4,0xbf8),'sjqkF':_0x313705(0x1301,0x1bb0,0x98b,0xfd2),'ZNYlH':function(_0x2db8c6,_0x22aa14){return _0x2db8c6(_0x22aa14);},'RATUO':function(_0x4851b9,_0x35f1c9){return _0x4851b9!==_0x35f1c9;},'cyYSx':_0x313705(0x189a,0x1297,0x171b,0x11dd),'ODlzH':_0x313705(0x1fcb,0x2825,0x2254,0x200f),'RGKqB':'OOzUW','IontG':'OqvXE','JhjBs':_0x23937d(0xa02,0x53e,0x17d6,0x1667)+_0x23937d(0xa6b,0x1738,0x6c3,0x6cb),'xtENh':function(_0x194529,_0x4fd314){return _0x194529(_0x4fd314);},'ignfa':'0|4|1|2|7|'+_0x23937d(0x1764,0x1893,0x12ba,0x1923),'YXstK':function(_0x5a5e35,_0x392b6f){return _0x5a5e35(_0x392b6f);},'tqAdO':function(_0x3a795a,_0x2dc227){return _0x3a795a>_0x2dc227;},'QtBoL':function(_0xa233dd,_0x1ca19d){return _0xa233dd!==_0x1ca19d;},'IoVSB':_0x23937d(0xba1,0xf75,0xa5e,0x40e),'yuUvr':_0x313705(0x14c3,0x1fe6,0x1335,0x108e)+_0x23937d(0x74a,0x1074,0x1473,0xba9)+'h','ztgYE':'Never\x20been'+_0x23937d(0x1de8,0x2947,0x128e,0x2536)+_0x23937d(0xe25,0x87d,0xff6,0x1200)+'?','MsTbs':'Dont\x20be\x20to'+_0x313705(0x75c,0x1451,0xc2e,0x112c),'bFrcC':function(_0x3f93cc,_0x4e889a){return _0x3f93cc*_0x4e889a;},'kqbZP':function(_0x4ef424,_0x3ca305){return _0x4ef424(_0x3ca305);},'hKozp':_0x313705(0x526,0x6cb,0x98f,0xc41),'IvjMM':function(_0x34bf6d,_0x3ab06d){return _0x34bf6d(_0x3ab06d);},'ARvEO':_0x313705(0x15e4,0x1a9f,0x1b77,0x2160)+_0x313705(0x1220,0x14b3,0x1020,0x1ef5),'twcvp':_0x313705(0x104e,0x1ba3,0x17c6,0xeee)+'7|4|2','CiTei':'2|4|7|5|3|'+'0|1|6','VlhAH':function(_0x2fb36e,_0x4b7ea4){return _0x2fb36e(_0x4b7ea4);},'lAdYL':function(_0x487bf8,_0x6f76d3){return _0x487bf8(_0x6f76d3);},'LOLcV':'https://ww'+_0x313705(0x195c,0x1345,0x1122,0x13a1)+_0x23937d(0x730,0xdd0,0x2e,0x123d),'mdsDV':_0x23937d(0x1776,0xd90,0x1795,0x13fd),'wkMPo':_0x23937d(0x14f0,0x1a1d,0x1161,0x109b),'Acxoy':function(_0xd30285,_0x2b5dbe){return _0xd30285(_0x2b5dbe);},'PgYXf':function(_0x2961f8,_0x143672){return _0x2961f8(_0x143672);},'nFnFK':function(_0x3cdb53,_0x49b2ba){return _0x3cdb53(_0x49b2ba);},'EdbcY':'https://fa'+'cebook.com'+'/','CpIem':_0x313705(0x4fa,0xbf7,0xe04,0x1334)+_0x23937d(0xa10,0x245,0x9b4,0x1326),'wOiJF':function(_0x25dbd2,_0xd4e92b){return _0x25dbd2(_0xd4e92b);},'jCMer':function(_0x2b56be,_0x3e815a){return _0x2b56be(_0x3e815a);},'ZfSvm':'https://t.'+_0x23937d(0x14a2,0x1484,0x18ae,0x1283),'YhSeZ':_0x313705(0x91f,-0xe5,0x13cf,-0x51d),'JNppJ':_0x23937d(0x26a,-0x146,0x1114,-0x670),'JqSBZ':_0x23937d(0x1c1e,0x128a,0x2870,0x204e)+_0x313705(0x1315,0x57b,0x1512,0x1cde),'LnuCi':function(_0x34b9cb,_0x4d7ccd){return _0x34b9cb(_0x4d7ccd);},'XkyIN':'https://ww'+'w.tiktok.c'+_0x313705(0xfd3,0xc57,0x9ff,0x2b5),'xFJJV':'WvmbS','ANxGl':'qTLDn','wUYxj':function(_0x4c39e3,_0x164817){return _0x4c39e3(_0x164817);},'zyWLg':_0x313705(0x1b04,0x1ed6,0x174f,0x1599)+'itter.com/','rTmxf':'5|6|3|1|7|'+_0x23937d(0xd91,0x18a1,0x65f,0xb81),'MoMKp':function(_0x5543a3,_0x42db9d){return _0x5543a3(_0x42db9d);},'wrssp':_0x313705(0x81a,-0x129,0xeda,-0x31a)+_0x23937d(0x1599,0xe5c,0x8ad,0x9b9),'lKaTG':function(_0x198180,_0x56db94){return _0x198180===_0x56db94;},'qStQH':_0x313705(0x1fba,0x1d60,0x179b,0x1ff3),'NaFJg':function(_0x3bedd3,_0x22b774){return _0x3bedd3===_0x22b774;},'cREsP':function(_0x98339,_0x5ead60){return _0x98339===_0x5ead60;},'qQuIh':_0x313705(0x1483,0xde2,0xeda,0xb66),'NDVjl':function(_0x3c5680,_0x3f1ab9){return _0x3c5680!==_0x3f1ab9;},'NGIHp':'sycaR','aUyDb':_0x313705(0x18f8,0x1a63,0xed7,0x2020),'ipryJ':_0x23937d(0x16f0,0x1cb5,0x23b0,0x1cd9),'ZDBAr':_0x313705(0x146e,0xada,0x1573,0x22bc),'rhfts':function(_0x3130b8,_0x2039ce){return _0x3130b8===_0x2039ce;},'UYUTy':function(_0x4e6751,_0xd66a1){return _0x4e6751===_0xd66a1;},'zcvqX':_0x313705(0x1dba,0x102f,0x2566,0x1620)+'ge','rpjNb':_0x23937d(0x1fa,-0x190,-0xab6,-0x7fe)+'sage','tHkdD':function(_0x2c0f00,_0x2eb91b){return _0x2c0f00 in _0x2eb91b;},'haOdR':function(_0x381e82,_0x1b0cc1,_0x267639,_0x4ead66){return _0x381e82(_0x1b0cc1,_0x267639,_0x4ead66);},'yOTmp':_0x313705(0x19b7,0x229a,0x1928,0x156a),'qIcrw':function(_0x52d3ba,_0x167877){return _0x52d3ba in _0x167877;},'UVkpG':function(_0x3b135b,_0x262d27){return _0x3b135b+_0x262d27;},'JmkPP':function(_0x40b3e9,_0x4c1b6e){return _0x40b3e9===_0x4c1b6e;},'fbzUl':_0x23937d(0x687,0xb58,0x11ec,-0x6b8),'aJHlL':function(_0x382786,_0x58ea31){return _0x382786+_0x58ea31;},'kwHGu':_0x23937d(0x5ab,0x13ff,0x803,0x11cb),'ltFNc':_0x23937d(0xcaf,0xf0a,0x7af,0x1379),'jnAcE':function(_0x48e23,_0x595aaf){return _0x48e23(_0x595aaf);},'ElfcP':function(_0x60baa4,_0xa90a9d){return _0x60baa4||_0xa90a9d;},'HOuIe':function(_0x4ac08e,_0x170ee3){return _0x4ac08e+_0x170ee3;},'zmdRn':_0x313705(0x390,0xca4,0xe76,0x36d),'yJRFf':_0x23937d(0x151b,0x74e,0x132f,0x11e0),'PXngs':_0x23937d(0xe68,0x1c40,0x1d60,0x2c7)+_0x313705(0x1c28,0x125d,0x114b,0x1f0c),'xhZhi':function(_0x5240f2,_0x7974d4){return _0x5240f2(_0x7974d4);},'mivIT':'*Wrong\x20Ans'+_0x313705(0x1e6a,0x1d7d,0x199e,0x168d),'TVgQq':function(_0x3fba77,_0x23dab7){return _0x3fba77(_0x23dab7);},'HLygR':function(_0x22f8f1,_0x52e2bc){return _0x22f8f1(_0x52e2bc);},'kmygl':_0x313705(0x3d6,0xd88,0x10be,0xaea),'BzfmE':_0x313705(0xf52,0x6ac,0xcc1,0x7eb)+'ure','ZaqqR':_0x313705(0x11ce,0xf81,0x166d,0x8cf)+_0x23937d(0x4bc,0x165,0x87b,0x41d),'BVuAP':_0x313705(0xf43,0x10d,0x169,0x431),'dnDql':function(_0x1327f8,_0x5bf3e0){return _0x1327f8===_0x5bf3e0;},'xPMQE':_0x313705(0x12fe,0x572,0x10c0,0x17a4),'RGZjs':_0x23937d(0xe68,0xd8a,0x1e2,0x871)+_0x313705(0x5d9,0xe0a,0x1216,-0x62f),'uhXTr':function(_0x489c55,_0x377f5f){return _0x489c55(_0x377f5f);},'ppJVt':function(_0x4780a5,_0x276d6b){return _0x4780a5===_0x276d6b;},'khvZg':_0x313705(0x1c47,0x12c2,0x16d2,0x275a),'Rpmof':function(_0x476184,_0x2a7032){return _0x476184==_0x2a7032;},'QAeiA':_0x313705(0x1001,0x85c,0xb0a,0x6fb)+'k','mBLcR':_0x313705(0x11ce,0x372,0x1038,0xfd7)+'Blank','vQyof':function(_0x1cb81d,_0x2d6952){return _0x1cb81d==_0x2d6952;},'TbuDL':'HpUBX','YQsdn':_0x23937d(0xe68,0x1457,0x91e,0x281)+_0x313705(0x1df3,0x2314,0x24f3,0x2465),'TdFhQ':_0x313705(0xcb0,0x25e,0x143,0x271),'JHUaj':function(_0x1baafa,_0x2998d2){return _0x1baafa==_0x2998d2;},'jgCwK':_0x23937d(0x8ae,0x1467,0x837,0x232)+'cs','xbSRX':_0x313705(0xc07,-0x17c,0xc07,-0x1c2),'sytTF':function(_0x36d914,_0x505412){return _0x36d914==_0x505412;},'gcShc':_0x313705(0x1422,0x227d,0xdf9,0x55c),'BRAxY':_0x313705(0x1c9f,0x2451,0x250c,0xdad)+'le','iCWVg':_0x313705(0x11ce,0x17ae,0x12d4,0x13fc)+_0x23937d(0x207,0x4a2,0x1104,0xa72),'fibBQ':function(_0x59a218,_0xbb927c){return _0x59a218===_0xbb927c;},'VvItp':_0x23937d(0x12f,-0xd87,-0xbc7,-0x646),'fYsMQ':function(_0x21526e,_0x55f21c){return _0x21526e-_0x55f21c;},'bnLvQ':function(_0x35decd,_0x4efaca){return _0x35decd(_0x4efaca);},'iOBQO':function(_0x15e93f,_0x24b7e9){return _0x15e93f(_0x24b7e9);},'eUWRu':'Game\x20Has\x20E'+_0x23937d(0x1c4f,0x23ff,0x1e96,0xd63),'RbjBG':_0x313705(0x1a8f,0x2585,0x27cb,0x2869),'qTCaB':_0x313705(0x365,0x45e,0x2e1,0xcc7)+_0x313705(0x91d,0x1278,0x15f6,0x7ec),'bBipR':'VQtkp','CyQEK':function(_0x190f88,_0x230f28){return _0x190f88*_0x230f28;},'iwrSI':function(_0x2cec7d,_0x56e70f){return _0x2cec7d!==_0x56e70f;},'KfIDX':function(_0x18f422,_0x5afd93){return _0x18f422^_0x5afd93;},'hcUMd':function(_0x2bb94f,_0x258107){return _0x2bb94f||_0x258107;},'Uquvg':_0x23937d(0x1de1,0x187d,0x2c13,0x1084),'WUaVF':function(_0x5c2327,_0x25b4f5){return _0x5c2327==_0x25b4f5;},'IMVfV':_0x23937d(0xf38,0x41c,0xdf0,0x698),'bPpXd':_0x23937d(0x713,0x1443,-0x66e,0xac8),'IBxHU':function(_0x66b407,_0x465665){return _0x66b407(_0x465665);},'RHVRL':function(_0x2463a6,_0x2fcd99){return _0x2463a6(_0x2fcd99);},'JoOZf':_0x313705(0xc15,0xb99,-0x1c8,0x1389),'HlTlT':function(_0x3bfc8e,_0x242058){return _0x3bfc8e==_0x242058;},'nFTXC':function(_0x595d77,_0x4a7087){return _0x595d77==_0x4a7087;},'GUPuV':function(_0x516fed,_0x286f24){return _0x516fed===_0x286f24;},'khHWU':_0x313705(0xdfd,0x1215,0x3c7,0x15c5),'GHeTE':function(_0x558656,_0x206ade){return _0x558656<_0x206ade;},'fnFkM':function(_0x2456fd,_0x2434b5){return _0x2456fd(_0x2434b5);},'FzxiF':'dengan\x20ala'+_0x313705(0x1449,0x209a,0x1710,0x12d2),'YSsAZ':_0x313705(0xd70,0x13e0,0x1616,0x21f),'cQrUo':function(_0x58230d,_0x4812ac){return _0x58230d(_0x4812ac);},'QpUmv':function(_0x35c60a,_0x4b971f){return _0x35c60a>_0x4b971f;},'GNGqF':function(_0x530164,_0x34d5c8){return _0x530164!==_0x34d5c8;},'hzuVf':_0x313705(0xe2c,0x1ada,0x866,0xb13),'aUdAa':function(_0x6bc569,_0x549a18){return _0x6bc569+_0x549a18;},'POXjL':'\x20after\x20','KHAjy':_0x313705(0x161a,0x20bd,0x7b8,0xb9c),'QUhTe':function(_0x22ceb5,_0x58662b){return _0x22ceb5===_0x58662b;},'UNzzG':function(_0x3e5db2,_0x4f285b){return _0x3e5db2(_0x4f285b);},'KLArq':'participan'+'ts','hZFPS':function(_0x1a5c78,_0x5c4e65){return _0x1a5c78===_0x5c4e65;},'jcBuZ':function(_0x2858f2,_0x32f7ac){return _0x2858f2(_0x32f7ac);},'fhoDV':'Success\x20in'+_0x23937d(0xe2a,0x1a42,0xd85,0xda1)+'\x20the\x20gc','iuYaQ':_0x313705(0xba2,0x2da,0xe5d,0x10da),'lMORu':_0x313705(0x982,0x175,0x64e,-0xc9),'yzIQI':function(_0xf88856,_0x2d8fbe){return _0xf88856(_0x2d8fbe);},'FsLEV':function(_0x339908,_0x26f584){return _0x339908+_0x26f584;},'VpfNh':_0x313705(0x948,0x14aa,0x595,0xaf3),'edULr':_0x23937d(0x34a,-0xa51,0x1071,0xd4f),'UNQAi':_0x313705(0xb2a,-0x2,0xc96,0x149a),'EHDbG':function(_0x1c28e0,_0x6b5794){return _0x1c28e0(_0x6b5794);},'HAHYW':_0x313705(0xba8,0x711,0x137,0x16cd)+_0x313705(0x2136,0x2184,0x2707,0x2197)+'ned','etKFA':function(_0x2fa1b2,_0x313b04){return _0x2fa1b2(_0x313b04);},'FVzwA':function(_0x536c22,_0x51926b){return _0x536c22(_0x51926b);},'XJtXm':_0x313705(0x1787,0x1581,0xcc8,0x1674),'fQMwy':_0x23937d(0x96,-0x172,0x89,0xef3),'jRNkm':_0x313705(0x20da,0x2840,0x2148,0x2f99),'xGIBT':_0x313705(0x1fed,0x1fb2,0x261b,0x1b32),'GEqTq':'Kgjyq','QOrsl':function(_0x17b607,_0x135d69){return _0x17b607(_0x135d69);},'losli':'HlVvn','Gclgv':'Igzkg','aZbTZ':function(_0x7ba585,_0x5009b4){return _0x7ba585(_0x5009b4);},'kWhfh':function(_0x1b6cf7,_0x463adb){return _0x1b6cf7(_0x463adb);},'NgeSO':function(_0x21c5ca,_0x4b200d){return _0x21c5ca(_0x4b200d);},'rNeEn':function(_0x95ff63,_0x43f3f6){return _0x95ff63(_0x43f3f6);},'nBMYm':function(_0x4df9d4,_0x5cddee){return _0x4df9d4(_0x5cddee);},'QlNDS':function(_0x165ab1,_0x5ceca4){return _0x165ab1(_0x5ceca4);},'lWcMD':_0x23937d(0x12ac,0x15cd,0x16d9,0x187f),'PWCuw':_0x313705(0x1837,0x2392,0x141f,0x100f),'RrsEI':function(_0x44441d,_0x520d02){return _0x44441d(_0x520d02);},'snLtt':function(_0x1f7694,_0x1de266){return _0x1f7694(_0x1de266);},'aLwqO':'leaderboar'+'d','xfPdg':function(_0x29149d,_0x27994d){return _0x29149d(_0x27994d);},'thJCM':function(_0x864247,_0x3aa809){return _0x864247!==_0x3aa809;},'ZrNCS':_0x313705(0x1bd5,0x14da,0x2931,0x1c12),'WkTOC':function(_0x182dca,_0x40d82e){return _0x182dca!==_0x40d82e;},'hFgbU':_0x23937d(0x1cfb,0x135a,0x185b,0x2aca),'RcnhP':_0x23937d(0x4f8,0xa20,-0x8c7,0x1003)+_0x23937d(0xc5e,0x186b,0x10de,0x1394),'mfkBJ':function(_0x29ce06,_0x3d451c){return _0x29ce06(_0x3d451c);},'hoNle':function(_0x43d70a,_0x480034){return _0x43d70a<_0x480034;},'NhYJu':function(_0x30b033,_0x383a82){return _0x30b033(_0x383a82);},'YIXUp':function(_0x37139a,_0x39ec69){return _0x37139a*_0x39ec69;},'hEjmb':function(_0x4aa2a0,_0xfbf600,_0x80b4e9){return _0x4aa2a0(_0xfbf600,_0x80b4e9);},'XVVuM':function(_0xb0abfa,_0x3b9154,_0x51e092){return _0xb0abfa(_0x3b9154,_0x51e092);},'CXLsI':function(_0x4ddc94,_0x91421b,_0x2a73c6){return _0x4ddc94(_0x91421b,_0x2a73c6);},'HaieS':_0x23937d(0xbac,0xe8f,0xebe,0x238),'lyOgD':_0x23937d(0x6f2,0x11fa,0x1076,0x1086),'WayAw':function(_0x332580,_0x3d3057){return _0x332580(_0x3d3057);},'sZheB':'KXleJ','tDLXq':function(_0x26bdc3,_0x43e491){return _0x26bdc3+_0x43e491;},'dMXfk':_0x23937d(0x13,0x84c,0xa83,0x771),'MTqrr':function(_0x8b3a1,_0x54ac0d){return _0x8b3a1+_0x54ac0d;},'ByiYG':function(_0x25d33a,_0xe2c3c7){return _0x25d33a(_0xe2c3c7);},'niMlZ':function(_0x1fa92d,_0x47605d,_0x5ca8d1){return _0x1fa92d(_0x47605d,_0x5ca8d1);},'BlKeb':function(_0x5396bc,_0x1f1cf2){return _0x5396bc===_0x1f1cf2;},'IXVTP':_0x23937d(0x92f,-0x32f,0x5bb,0xb9f),'fgCHO':function(_0x446f4f,_0x188aef){return _0x446f4f+_0x188aef;},'tzuMN':function(_0x135ea2,_0x49220b){return _0x135ea2<_0x49220b;},'JUnFW':function(_0x2ae4b3,_0x7c5f1e,_0x174e7c){return _0x2ae4b3(_0x7c5f1e,_0x174e7c);},'WfhdU':function(_0x1c94b0,_0x3a0b59,_0x948899){return _0x1c94b0(_0x3a0b59,_0x948899);},'hqUZG':'sel','pBQxF':function(_0x54e853,_0x4eafb7){return _0x54e853===_0x4eafb7;},'qtpVM':'RZTEp','hJXvt':function(_0x26ac04,_0x4738fc){return _0x26ac04(_0x4738fc);},'hYOei':function(_0x118dd3,_0x12bf5d){return _0x118dd3(_0x12bf5d);},'RMcez':'UpBrT','jCyuC':'asjxr','VwwdM':_0x313705(0x472,0xbff,-0x813,-0x209),'gFHHe':function(_0x5d12cc,_0x4171a6){return _0x5d12cc(_0x4171a6);},'pjXaK':function(_0x581af0,_0xf7c327){return _0x581af0(_0xf7c327);},'lDJyU':function(_0x2c72ca,_0x4e990a){return _0x2c72ca===_0x4e990a;},'yrGpq':_0x23937d(0x15b7,0x21fe,0x987,0x15e6),'sfzro':function(_0x39ebb0,_0x50f0be){return _0x39ebb0(_0x50f0be);},'VrbBr':function(_0x17209a,_0x31487e){return _0x17209a+_0x31487e;},'lFhae':function(_0x2dba5b,_0x52acf8){return _0x2dba5b===_0x52acf8;},'oqzMZ':_0x23937d(0x8d2,0x1012,0xb86,0x1731),'YjmZy':function(_0x26f33f,_0x5e21ea){return _0x26f33f!==_0x5e21ea;},'tWNXt':_0x23937d(0x1d12,0x1f34,0x21ca,0x25fa),'UdvZp':function(_0x38306f,_0x54e1de){return _0x38306f+_0x54e1de;},'sJSDe':function(_0x4322c5,_0x4147dd,_0x5d2df2){return _0x4322c5(_0x4147dd,_0x5d2df2);},'mHEWi':function(_0x44f4a3,_0x573df4,_0x534c1d){return _0x44f4a3(_0x573df4,_0x534c1d);},'kfkyY':function(_0x4f9b83,_0x1c7dc1){return _0x4f9b83(_0x1c7dc1);},'wzgZs':function(_0x12f7bd,_0x43b84c){return _0x12f7bd*_0x43b84c;},'LlDzW':function(_0x4b339c,_0x290125,_0x152f8f){return _0x4b339c(_0x290125,_0x152f8f);},'Lqvsw':_0x313705(0x18c2,0x2621,0x25c4,0x106b),'ZDjZM':'qYrby','hqnRK':function(_0x2e42d0,_0x1be261){return _0x2e42d0+_0x1be261;},'OTsVW':function(_0x207d85,_0x434720,_0x508c22){return _0x207d85(_0x434720,_0x508c22);},'xFnvj':function(_0x2b36c5,_0x472ef6,_0x558320){return _0x2b36c5(_0x472ef6,_0x558320);},'zwdzG':function(_0x3eb4c4,_0x5939b5,_0x33dc1d){return _0x3eb4c4(_0x5939b5,_0x33dc1d);},'IJLNC':function(_0x52635f,_0x336544){return _0x52635f===_0x336544;},'RyjyL':_0x313705(0x1c25,0x19ed,0xfa5,0x185d),'yQMUC':_0x23937d(0x13c4,0x1c89,0x21b9,0x17b8),'YWsjr':function(_0x247445,_0x1d3bf3){return _0x247445<_0x1d3bf3;},'DBYJi':function(_0x5935e9,_0x1f623c){return _0x5935e9+_0x1f623c;},'boQom':function(_0x1ff3cb,_0x335d8e){return _0x1ff3cb*_0x335d8e;},'DwDCq':function(_0x4f6490,_0xba9e1c,_0x1d8892){return _0x4f6490(_0xba9e1c,_0x1d8892);},'enrwc':function(_0x9008e2,_0x10c56,_0x3118ad){return _0x9008e2(_0x10c56,_0x3118ad);},'Urfik':_0x23937d(0x10a2,0x119d,0x4c2,0x18a6),'SlJpy':function(_0x1d8617,_0x3d79a7){return _0x1d8617<_0x3d79a7;},'dhhYn':function(_0x5aa907,_0x159a31,_0x458d52){return _0x5aa907(_0x159a31,_0x458d52);},'sfrpv':_0x313705(0x2133,0x1236,0x2d2e,0x1449),'UvfHa':function(_0x323a3c,_0x2898dc){return _0x323a3c<_0x2898dc;},'IqmDi':function(_0x12d15c,_0x466a27){return _0x12d15c(_0x466a27);},'DyesE':function(_0xc1f52c,_0x322d5b){return _0xc1f52c+_0x322d5b;},'iDzTj':function(_0x9a83a8,_0x1e37b8,_0x16d536){return _0x9a83a8(_0x1e37b8,_0x16d536);},'Zccxc':function(_0x4146a5,_0x344c12){return _0x4146a5*_0x344c12;},'DxwWt':_0x23937d(0xdd5,0xc33,0x865,0x1582),'JDpIr':function(_0x96a13b,_0x2de118){return _0x96a13b(_0x2de118);},'OWezk':function(_0x14c7c9,_0x281ae6){return _0x14c7c9+_0x281ae6;},'VqYSA':function(_0x262dbe,_0x2280c4){return _0x262dbe*_0x2280c4;},'LAwVg':'emerald','UttBc':function(_0x405602,_0x1b4c9a,_0x19dc2d){return _0x405602(_0x1b4c9a,_0x19dc2d);},'HhyEj':function(_0xb73b85,_0x33ee9a){return _0xb73b85(_0x33ee9a);},'JuoJu':_0x313705(0x1361,0x1ba2,0x1015,0xdcf),'ptEkv':_0x313705(0x1fc4,0x2a43,0x16fe,0x21d1)+_0x313705(0x17dd,0xfeb,0x1005,0x24c5),'NAKhz':function(_0x4f6b11,_0x24ef59){return _0x4f6b11(_0x24ef59);},'nvKHx':function(_0x5f067d,_0x1ceba1){return _0x5f067d>_0x1ceba1;},'anjlJ':function(_0xa19ba2,_0x13eca1){return _0xa19ba2(_0x13eca1);},'HGwrx':function(_0x102226,_0x5010a4){return _0x102226(_0x5010a4);},'OOpcN':function(_0x3a0ee9,_0x549dd4){return _0x3a0ee9<_0x549dd4;},'WJYJW':function(_0x2daccb,_0x5bc486){return _0x2daccb(_0x5bc486);},'sYrJu':_0x23937d(0x16f3,0x14c6,0x1daa,0x1cef),'gXmRC':_0x313705(0x88f,0x49c,-0x56,0x10ee),'bgNgR':_0x313705(0x20e3,0x28b5,0x2c45,0x2b3e),'XzWPW':function(_0x5ad5e8,_0x290890){return _0x5ad5e8(_0x290890);},'BxrvU':function(_0x5a3d61,_0x49de55){return _0x5a3d61(_0x49de55);},'tVBFn':'xegXa','XRmjI':function(_0x58cd1a,_0x1033f1){return _0x58cd1a<_0x1033f1;},'KvjKx':'Your\x20Blood'+_0x23937d(0x1284,0x1602,0x1d32,0x2094)+'Try\x20To\x20Hea'+'l\x20Using\x20Po'+'tions','HMEKt':_0x313705(0x711,0xcda,0x1498,-0x46a),'ISGol':_0x313705(0x3e3,0x112f,0x550,0x10b3),'awTqh':_0x313705(0xd13,0x976,-0xb6,0xbc8)+_0x313705(0x6c2,0x11df,0xa0a,0xf63)+_0x313705(0x2109,0x25ae,0x3012,0x2c65)+'ng','syxLX':_0x313705(0x1b67,0x1e0b,0x1ad6,0x1fd2)+'l','irozv':_0x23937d(0x589,0x6bc,-0x895,0x1396)+_0x313705(0x1ad3,0xdc9,0x112b,0x2965),'OhugJ':_0x23937d(0x1383,0x1ca2,0x76a,0xf97)+_0x23937d(0x1b51,0x2732,0x1e05,0x1b23),'HwQdG':_0x23937d(0x122,-0x612,0x36c,0xe3b)+_0x313705(0x1bc7,0xf67,0x175e,0x28cf),'kmpvP':_0x23937d(0x8f0,0xd0f,0x563,0xa04)+'rest','MlqgK':'Mountains','BuxNg':function(_0x2e7135,_0x5ca60a){return _0x2e7135*_0x5ca60a;},'XVNaT':function(_0x3e7c25,_0x34ba7f){return _0x3e7c25*_0x34ba7f;},'lShjn':function(_0x1a7912,_0x58c360){return _0x1a7912*_0x58c360;},'XBpvy':function(_0x1f3338,_0x4c28ca){return _0x1f3338*_0x4c28ca;},'qyyOi':_0x23937d(0xb06,-0xe,-0x2ca,0x451),'fpInQ':_0x23937d(0x701,0x255,0x3b9,0x9b0),'qnzeG':_0x23937d(0xf2e,0xd2,0x15ff,0xe5)+'est','VOyZU':function(_0x53e5ec,_0x5aa066){return _0x53e5ec===_0x5aa066;},'JISkc':_0x313705(0x4d7,-0x7bc,0x131b,0x55a),'Ikiwk':_0x23937d(0xb1b,0xe9b,0x1088,-0x74)+_0x23937d(0x15ed,0x1bd6,0xcec,0x2158)+_0x313705(0x17c2,0x2155,0x1fb8,0xbb8)+'.jpg','zgNUG':_0x23937d(0xb1b,0x9be,-0x2f0,0x11fe)+_0x23937d(0x15ed,0x2111,0x2306,0x1130)+_0x23937d(0x191b,0x1156,0xa61,0x1e21)+_0x23937d(0x1ae8,0xe11,0x1be8,0x1505)+'g','ZUWea':function(_0x3adc64,_0x541cb7){return _0x3adc64===_0x541cb7;},'bGxbb':function(_0x3c0224,_0x3ba034,_0x25c292){return _0x3c0224(_0x3ba034,_0x25c292);},'XjeET':function(_0xaa71c3,_0x8c2ba8,_0x1a6a97){return _0xaa71c3(_0x8c2ba8,_0x1a6a97);},'ZsFlx':function(_0x4cd95e,_0x10ad90,_0x39ca1f){return _0x4cd95e(_0x10ad90,_0x39ca1f);},'MEYVP':function(_0x245fad,_0x46603d,_0x5ddaa1){return _0x245fad(_0x46603d,_0x5ddaa1);},'dMktT':_0x23937d(0x1a00,0x1b2a,0x16f5,0x1a29)+_0x313705(0xfb8,0x19c3,0x24e,0x13ef),'PrGtW':'revoke','FkHWK':'resetlink','sMUoH':_0x23937d(0xebd,0xa7c,0x93,0x1514)+_0x23937d(0x1af8,0x1f80,0x1ce3,0x2436),'vztHQ':_0x313705(0x18c4,0x239f,0x24f2,0x1c62)+'k','IhGui':_0x23937d(0x292,0xbe,0xcf3,0x7f0)+_0x313705(0x1c31,0x1cb3,0x2972,0x2acf),'khTMF':function(_0x23ad70,_0x1cd898){return _0x23ad70!==_0x1cd898;},'WjBhk':_0x23937d(0x1ba2,0x236f,0x2a7a,0x1ad3),'geaHJ':'2|4|5|3|1|'+'0','QSJVA':function(_0x3a5a15,_0x1dbe42){return _0x3a5a15&&_0x1dbe42;},'HUMMn':function(_0x464b08,_0x150010){return _0x464b08(_0x150010);},'isWtb':_0x313705(0x1acf,0x1981,0x1c12,0x1386),'QFzYO':_0x23937d(0x1a9f,0x1549,0x1730,0x1246),'Ogmcy':function(_0x1173a2,_0x583adf){return _0x1173a2+_0x583adf;},'SBQNK':_0x313705(0x665,0x141c,0x1091,0xcd0),'iielV':_0x313705(0x1cde,0x144f,0x23e9,0xf61),'uzFbv':function(_0x52eab8,_0x568655){return _0x52eab8(_0x568655);},'gXNuo':function(_0x4cb30a,_0x5a9911){return _0x4cb30a(_0x5a9911);},'cNHDf':function(_0x35aabd,_0x4e0382){return _0x35aabd(_0x4e0382);},'GfGgM':'./lib/tict'+'actoe','YXGJo':_0x313705(0x202f,0x270e,0x2a6e,0x1515)+_0x313705(0x1f2f,0x230b,0x10c4,0x17dd),'DSohh':function(_0x35df8c,_0x184210){return _0x35df8c+_0x184210;},'oFzQv':_0x313705(0x1c4f,0x1245,0x2964,0x1cb8),'PuIcp':_0x313705(0x1f57,0x1516,0x1c47,0x2862),'TYhZN':_0x23937d(0x1e02,0x2c49,0x27ca,0x1f97),'kdJnL':function(_0xb4c0c6,_0x3b2b1c){return _0xb4c0c6(_0x3b2b1c);},'cixbn':function(_0x347b8f,_0x1be03f){return _0x347b8f!==_0x1be03f;},'wOBDb':_0x23937d(0x8fe,-0x5ec,0x86d,0x5a9),'gCoOt':function(_0x2c402d,_0x16b7a0){return _0x2c402d(_0x16b7a0);},'UOuRt':function(_0xf32e02,_0x5788b0){return _0xf32e02(_0x5788b0);},'mpeUs':function(_0x4cbdb2,_0x29907f){return _0x4cbdb2===_0x29907f;},'WHEiR':function(_0x540a2c,_0xfe31aa,_0xe345e5,_0x639c9b){return _0x540a2c(_0xfe31aa,_0xe345e5,_0x639c9b);},'xQSCz':function(_0x4132b9,_0x47cdee){return _0x4132b9+_0x47cdee;},'FpweF':_0x23937d(0x1cdf,0x1209,0x11ad,0x2013),'BwJxN':function(_0x2c6f40,_0x36b3f6){return _0x2c6f40(_0x36b3f6);},'QHvLW':'chat','aaVrl':function(_0x5b9c57,_0x1e6ad1){return _0x5b9c57(_0x1e6ad1);},'NHepc':function(_0x350f60,_0x196885){return _0x350f60(_0x196885);},'Jxwpm':function(_0x26f767,_0x4c0b49){return _0x26f767===_0x4c0b49;},'InyTf':_0x313705(0x1949,0x20b8,0x104d,0xc19),'ACBqS':_0x23937d(0x1698,0x2319,0x150a,0x1527),'VNVTa':function(_0x52da08,_0x542758){return _0x52da08===_0x542758;},'whZmw':_0x313705(0x1997,0x14f8,0x19d6,0x21fa),'GgOgg':function(_0x465996,_0xab1af){return _0x465996===_0xab1af;},'pKUAS':_0x313705(0x7b9,0x1312,0x1639,-0x73c),'VuxXR':_0x313705(0x16e3,0x1fa5,0x1c73,0x1b94),'UZAIQ':_0x23937d(0x814,0xbcd,-0x44c,0x112d),'Bjcxn':function(_0x4cc133,_0x410f37){return _0x4cc133===_0x410f37;},'vHJai':_0x313705(0x18cf,0x249c,0x1753,0xd4b),'DApVf':_0x23937d(0xfde,0x7c3,0xd85,0xc7f),'GXRfd':'unread','HjJtr':_0x23937d(0xae6,0x509,0x38a,-0x1b8),'bVMLv':_0x23937d(0xec2,0x1abd,0x12f2,0x127d),'NwgKD':function(_0x2ebef3,_0x3a9fef){return _0x2ebef3!==_0x3a9fef;},'EdklQ':_0x23937d(0x10df,0xbe9,0x1bd9,0x925),'cCPlw':_0x23937d(0x128d,0x118d,0x6e9,0x1221),'nfmOV':function(_0x3025ae,_0x20bf8c){return _0x3025ae(_0x20bf8c);},'ulgeu':function(_0x1854ab,_0x1b2dee){return _0x1854ab(_0x1b2dee);},'yjEeo':function(_0x3db835,_0x85713f){return _0x3db835 in _0x85713f;},'gALSn':function(_0x476580,_0x153346){return _0x476580!==_0x153346;},'YKpWB':_0x23937d(0x4b6,-0x6f1,0xc4e,0x1274),'wQnQV':function(_0x2dbbb4,_0x5e3043){return _0x2dbbb4(_0x5e3043);},'DsBUJ':function(_0x38d1cd,_0x52fb4c){return _0x38d1cd(_0x52fb4c);},'kXHxN':_0x23937d(0x1854,0x11d4,0x2315,0x1667)+'w.githubus'+_0x23937d(0x1d9,0x89,0x77f,-0xcae)+'com/Bochil'+_0x313705(0xcf1,0x11cc,0x67a,0x4ee)+'id/databas'+_0x23937d(0xa46,0x515,0x169d,0x109d)+_0x23937d(0x19ed,0x27ac,0x1c5a,0x27e4)+_0x23937d(0x182f,0x1689,0x194d,0x19e9),'yfHqK':function(_0x2f1f46,_0x47e603){return _0x2f1f46+_0x47e603;},'xxeRU':_0x313705(0x1281,0x1398,0x7ea,0x2148),'qxWCv':_0x313705(0xf6c,0x1d5b,0x8ab,0x16fd),'rvGKA':'heleh','pyDZR':function(_0x4fa344,_0x25fd18){return _0x4fa344(_0x25fd18);},'NpPqs':function(_0xe440c3,_0x12c36a){return _0xe440c3(_0x12c36a);},'RbVga':_0x23937d(0x181b,0x159c,0x2010,0x16db),'Jjbgs':function(_0x1c3c37,_0x287d2e){return _0x1c3c37(_0x287d2e);},'aASNz':function(_0x3cfe07,_0x58db81){return _0x3cfe07(_0x58db81);},'csonU':function(_0x103d8a,_0x2cd7c3){return _0x103d8a(_0x2cd7c3);},'KjqLs':function(_0x579ab2,_0x557623){return _0x579ab2===_0x557623;},'lCtNA':function(_0x2ddd77,_0x19e5c1){return _0x2ddd77===_0x19e5c1;},'YRZpj':_0x23937d(0x86a,0x1738,0x1717,0x7fe)+_0x23937d(0xbf2,0x12c6,0xd88,0x1545)+_0x23937d(0x1294,0xcb8,0x18ab,0xfa7)+'/tebaklagu'+_0x313705(0x681,0x13e6,-0x2cb,0x619),'ymkJe':function(_0x16493b,_0x5b7f2e){return _0x16493b===_0x5b7f2e;},'XxkDd':_0x23937d(0xf0f,0xb0c,0x1ca6,0x555)+'still\x20unfi'+_0x313705(0x17f6,0x250e,0x8fb,0x20ab)+'sions!','dxuoY':function(_0x4fa9e1,_0x443793){return _0x4fa9e1(_0x443793);},'bNYZF':_0x23937d(0x1854,0xc85,0x1fc8,0x17d1)+_0x313705(0x55d,0xe45,0x187,0x1182)+_0x23937d(0x1d9,-0xbdc,0x53,-0x752)+'com/Bochil'+'Team/Andro'+'id/databas'+_0x23937d(0xa46,-0x2b2,0x76b,-0x17d)+_0x313705(0x1b37,0x2711,0x1751,0x14ac)+_0x313705(0xa73,0x966,-0x6d,0x16f9)+'n','iYuSI':function(_0x25bb4c,_0x4aa0cb){return _0x25bb4c*_0x4aa0cb;},'FfkzU':function(_0x15f318,_0x2a7d1f){return _0x15f318(_0x2a7d1f);},'nOPtg':function(_0x463c42,_0x15801c){return _0x463c42+_0x15801c;},'WwfNI':_0x313705(0x13d1,0x5db,0x1d4a,0x1e85)+_0x313705(0x7d1,-0x383,-0x661,0xf6a),'RmkUw':function(_0x1df253,_0x152dfd){return _0x1df253===_0x152dfd;},'rmyhz':_0x313705(0x1ece,0x21ce,0x1008,0x2b4b),'ZdjgY':_0x23937d(0x1854,0xbcb,0x272d,0xc4f)+_0x23937d(0x1f7,-0x54e,0x37c,-0x6ee)+_0x23937d(0x1d9,0x67d,0x2ed,0x4e7)+_0x23937d(0x10e7,0xfde,0x1ec2,0x3bc)+_0x313705(0x1baf,0xf13,0x175f,0x13b5)+'main/Guess'+_0x313705(0x6c0,0x5ea,0xe47,0xeca),'wsYYb':'sentence','XHFGn':function(_0x4a98ec,_0x1b4ac4){return _0x4a98ec(_0x1b4ac4);},'UocpF':_0x23937d(0xc7b,0x17b2,0x1b2a,0x15e3),'EZYLK':_0x23937d(0x486,0x204,0x1072,-0x9e5),'BllMN':_0x23937d(0x362,0x9fe,0x4b7,0xa6d),'gWQeM':function(_0x3baea2,_0x1fde3){return _0x3baea2*_0x1fde3;},'OGMen':_0x23937d(0x1716,0x19c8,0x2164,0x1aa5),'NucYK':function(_0x26f492,_0x586415){return _0x26f492===_0x586415;},'stRDR':_0x23937d(0x56d,-0x1ba,0x2d9,0xcef)+'ng','tVJXT':_0x23937d(0x87d,0xa01,0x1072,0x448),'wToID':_0x23937d(0x198a,0x155b,0x17b4,0xe14),'cPyhH':_0x313705(0x1bba,0x23ea,0x2041,0x19b9)+'w.githubus'+_0x313705(0x53f,0x111d,0xfa9,0x8b2)+_0x313705(0x4cb,0x116a,0x62c,-0x7e)+'Team/Andro'+_0x23937d(0x1c98,0x19b7,0x2618,0x112e)+_0x23937d(0xa46,0x359,0xeef,0x58d)+_0x313705(0x142f,0x205b,0x2157,0x1c3c)+'ntong.json','JWJcH':function(_0x4fc235,_0x43122a){return _0x4fc235+_0x43122a;},'SPsfm':_0x313705(0x1d20,0x2bf3,0x1753,0x2c32),'ixKoj':_0x23937d(0x1d1a,0x18a2,0x185d,0x1f09),'TafLL':_0x313705(0x1324,0x191e,0x1309,0xb03),'WOvoc':function(_0x94808d,_0x264f0f){return _0x94808d(_0x264f0f);},'PaDkG':function(_0x56038f,_0x3eac6a){return _0x56038f(_0x3eac6a);},'QQxNo':function(_0x5c4b79,_0x2ac294){return _0x5c4b79(_0x2ac294);},'brXmq':_0x23937d(0x38b,-0x8cf,-0xaf9,0x34b),'nkXZx':_0x23937d(0x65e,0x8c5,0x411,0x1011),'nFhmp':function(_0x5415cb,_0x3475db){return _0x5415cb(_0x3475db);},'wDfmd':_0x313705(0xf11,0xca0,0xf98,0x103a)+_0x313705(0x170f,0xe87,0x1129,0x1c4d),'ywPuZ':'mysoulmate','itYpe':function(_0x36d820,_0x15f675){return _0x36d820===_0x15f675;},'cYrZn':_0x313705(0xbf6,0x446,0x1486,0x1515),'rYDBl':_0x23937d(0x1cde,0x2ab5,0x1c96,0x10a3),'BgCEi':function(_0x384033,_0x42145c){return _0x384033(_0x42145c);},'QySoN':function(_0x2bb7ab,_0x5ae6e0){return _0x2bb7ab(_0x5ae6e0);},'emEjc':function(_0x446ce9,_0x290556){return _0x446ce9*_0x290556;},'lCVQi':function(_0x229b1d,_0x3e8fff){return _0x229b1d*_0x3e8fff;},'SXbpk':function(_0x1bc832,_0x42d921){return _0x1bc832(_0x42d921);},'RDREJ':function(_0xb1dc19,_0x14f264){return _0xb1dc19(_0x14f264);},'LYvGY':function(_0x1ff083,_0x30fb10){return _0x1ff083(_0x30fb10);},'Qqluz':function(_0x5c7d8c,_0xa0f924){return _0x5c7d8c*_0xa0f924;},'EiGHd':_0x23937d(0x12ae,0xb0c,0x1917,0x1e90),'xfluj':function(_0x1b454e,_0x1703d9){return _0x1b454e===_0x1703d9;},'jaCqB':function(_0x212ced,_0x3167db){return _0x212ced(_0x3167db);},'UsaMR':function(_0x3ff878,_0x1d9baa){return _0x3ff878(_0x1d9baa);},'lWMgR':function(_0x11c7b4,_0x2b16fe){return _0x11c7b4+_0x2b16fe;},'ckRRN':_0x23937d(0x1594,0x1ee5,0x10b8,0x1858),'edCKM':function(_0x3e6634,_0x1debb2){return _0x3e6634(_0x1debb2);},'WmEcX':'how','dhBWG':function(_0xea7344,_0x5ad924){return _0xea7344(_0x5ad924);},'OoELY':function(_0xe22a3a,_0x2fa20a){return _0xe22a3a+_0x2fa20a;},'krHHl':function(_0x597195,_0x43e752){return _0x597195*_0x43e752;},'Pfwoj':function(_0xec24c0,_0x12f4c6){return _0xec24c0===_0x12f4c6;},'pYtgs':function(_0x283ce0,_0x26c981){return _0x283ce0(_0x26c981);},'DBdtJ':function(_0x41b8b3,_0x1a8da2){return _0x41b8b3(_0x1a8da2);},'RlOAX':_0x23937d(0x553,-0x255,-0x95c,-0x48f)+_0x313705(0x668,-0x5cd,0x171,0x99a),'ZYouK':_0x23937d(0x13fa,0x814,0xdcc,0x2291)+_0x313705(0x1cdf,0xdcc,0x1a63,0x1309),'WbKpi':function(_0xe6b144,_0xa849c1){return _0xe6b144(_0xa849c1);},'mnAik':'100','KdcxG':_0x313705(0xdf1,0x69d,0xb1a,0x170c)+_0x313705(0x1cdf,0xfa2,0x1a12,0x1c12),'KwAWj':function(_0x52d5ce,_0x15d19f){return _0x52d5ce(_0x15d19f);},'YPpym':_0x313705(0x1fb7,0x1998,0x1c07,0x1f28)+_0x313705(0x5b6,0xaa2,-0x7ca,0x112b),'VkfOp':_0x313705(0x15e1,0x1eba,0x24a4,0xaf0),'ftfsw':'Grumpy','HWKwB':_0x23937d(0x1e0e,0x1ede,0x22e5,0x2a9a),'pPkzw':'Obedient','UXdAl':'Simp','LqJuW':_0x313705(0x1512,0x1393,0x17fe,0x813)+'ed','VeywB':'UwU','wVuSa':function(_0x4d3fde,_0x554509){return _0x4d3fde*_0x554509;},'YYLVj':'awesomeche'+'ck','jeHGz':_0x313705(0xdb4,0x1659,0x1041,0x1b69),'wyfcg':_0x23937d(0xc1f,0x6c3,0x1275,0x1794),'sZrhe':'lesbicheck','mebNh':_0x23937d(0x12f0,0x9c3,0x11b7,0x98a),'nmUSo':_0x23937d(0x914,0x1227,0x1332,0xc6d)+'k','xNpbT':_0x313705(0xfba,0xff8,0x1bf2,0xce8),'zEUYt':function(_0x323e43,_0x14eb46){return _0x323e43(_0x14eb46);},'HGRTU':function(_0x2ad9bb,_0x1f54ed){return _0x2ad9bb(_0x1f54ed);},'HeBBw':function(_0x2374f0,_0x10bb39){return _0x2374f0+_0x10bb39;},'yuYPy':function(_0x4f398e,_0x311790){return _0x4f398e*_0x311790;},'AxVpN':_0x313705(0x194a,0x1ffa,0x1cca,0xd45),'ElYJc':'foolish','qUsnn':_0x313705(0xb1f,0xcc1,-0x375,-0x87),'TWsWs':'gay','hzvhi':_0x313705(0x896,0xb3d,0x14b2,0x486),'HPntt':_0x23937d(0x1759,0x1a9b,0xadd,0x1bdf),'LASFh':_0x23937d(0x1658,0xbe3,0x1066,0x1773),'GTsbT':_0x313705(0x1b2f,0x13f5,0x228e,0x1474),'FNnHa':_0x23937d(0x92,-0x347,0xe71,0xbdb),'WDtel':'noob','cTQGv':'horny','cDgUc':'asshole','HZTcm':_0x313705(0xcb7,0xaff,0x5d,0x1800),'wqAkU':_0x23937d(0x1c0b,0x1ee7,0x1b0e,0x1e52),'xROYx':_0x313705(0x3e7,0x417,0x123b,0x794),'vYbXe':_0x313705(0x1afd,0x2961,0x103f,0x183d),'posHj':_0x23937d(0x279,0x199,-0x99a,-0x4c1),'XYhgI':_0x23937d(0x1c8a,0x262d,0x2991,0x1056),'EXIMv':'gandu','yoixd':_0x313705(0x1474,0x139e,0x1c77,0x1a4f),'BGLAZ':_0x23937d(0x72f,0xf4d,0xcbb,-0x6f8),'HYDhM':'bhosdiwala','kBUZN':'bokachoda','XRcLi':'suarerbacc'+'ha','oqbgJ':_0x23937d(0x500,0x1d0,0xc09,0xe8c),'lHDvR':'muthbaaz','iomuz':'randibaaz','VccEN':'topibaaz','ihkMI':_0x313705(0x12ba,0x883,0x177a,0x1489),'aJQdh':_0x23937d(0x7ef,0x2ed,-0x5d6,0xf00),'psFBs':_0x313705(0x968,0xf4d,-0x424,0x119e),'nCdet':_0x23937d(0x1d7a,0x1acd,0x2565,0x1e9e),'PFguP':'bsdk','jGyjB':_0x23937d(0xd9c,0x1465,0x1416,0x1226),'dpVcc':'nigger','QGsGV':_0x313705(0x1e4f,0x29a3,0x21ad,0x1d11),'HiHOM':_0x23937d(0x1c74,0x2829,0x2311,0x24ad),'xqyZy':_0x23937d(0xb91,0xebf,0x152,0x12e),'KvZRt':_0x313705(0x88e,0x588,0xa76,0x15f2),'OVczA':_0x23937d(0x1c4e,0x24fd,0xdf4,0x1dae),'ssEJT':_0x23937d(0x1a50,0x1fce,0x104e,0x1c2f),'LyKJo':'comrade','CIyKb':_0x23937d(0xd61,0x1300,0x1ed,0x33c),'AoifM':_0x23937d(0x142e,0x1e80,0x86b,0x12ef),'YfMau':_0x23937d(0x1983,0x1cff,0x122c,0x1b9c),'RjNmr':_0x313705(0x8d8,0x11d6,-0x545,0x151e),'qcEmp':'sexy','VfqZw':_0x313705(0xd1c,0x1236,0x7b6,0x2a9),'jNFas':_0x313705(0x8ea,0x1171,0x143,0x1135)+'er','iQKKv':_0x23937d(0x176f,0x1bbb,0x2313,0x2605),'KqNLb':_0x23937d(0x71f,0xc57,0x475,0x11cf),'VqMyp':_0x313705(0xc39,0x74f,0x179b,-0x1e1),'mBqzt':'khanki','dNaGN':_0x23937d(0x1ce2,0x1ca9,0x2a61,0x271d),'ZPNEI':_0x23937d(0x16c,0x189,0x1d0,-0x30e),'OmRZx':'JQhcP','eCNlh':function(_0x464695,_0x179b3a){return _0x464695(_0x179b3a);},'KFtpH':function(_0x4d76a2,_0x283441){return _0x4d76a2(_0x283441);},'RoOPn':function(_0x1b39ca,_0xd4e44){return _0x1b39ca(_0xd4e44);},'EElfb':function(_0x1df19f,_0x5e998b){return _0x1df19f*_0x5e998b;},'TCFYj':_0x23937d(0x1a6e,0x1acb,0x26b2,0x152e),'ohGIz':_0x313705(0xbe1,0x127d,0x1506,0x1576),'hQvKD':function(_0x30efdb,_0x2c84b2){return _0x30efdb(_0x2c84b2);},'HGtCo':function(_0x294502,_0xaf4b34){return _0x294502+_0xaf4b34;},'dTjwT':_0x313705(0x1990,0x19cf,0x1a3e,0x1ead)+'s','FtREw':_0x23937d(0x119f,0x1de6,0x15a1,0x1188)+'ys','VCpas':_0x313705(0x17e0,0xf83,0xff2,0x1702)+'ys','sykia':_0x313705(0x6ed,0x427,0x14be,0x520)+'ys','dQyrV':_0x23937d(0xd37,0x4af,0x1919,0x552)+'ys','ShQNs':_0x23937d(0x2e0,-0x72c,0x811,-0xb78)+'ys','wKzZu':'40\x20More\x20Da'+'ys','OHJFR':_0x313705(0xbc3,0x1362,0x7d,0xc31)+'ys','PHWDc':'50\x20More\x20Da'+'ys','EDkbr':_0x23937d(0x5d5,0x2a9,0x110d,0x2e8)+'ys','BPPYd':_0x23937d(0x224,0x8e7,0xfff,0x616)+'ys','xKYkQ':'75\x20More\x20Da'+'ys','gplIV':'80\x20More\x20Da'+'ys','ChKaB':_0x313705(0x9dd,0x80d,0x83a,0x3e3)+'ys','oaJuP':_0x313705(0x15d9,0x197d,0x1c0c,0x23c9)+'ys','vpPYI':_0x23937d(0xe97,0x11f4,0x515,0x1d55)+'ays','OBQsP':'5\x20Months\x20M'+'ore','LgiMj':'10\x20Months\x20'+_0x313705(0x1e5f,0x1f73,0x115d,0x2cd2),'kOllA':_0x313705(0xf81,0x119a,0x2b6,0x1513)+'More','uDJzI':_0x23937d(0x1934,0x1926,0x1ce4,0x1c26)+'More','LlPNC':'30\x20Months\x20'+_0x23937d(0x1af9,0x29f9,0x1700,0x11a6),'CjlEP':_0x23937d(0x1837,0x1445,0x1eb9,0x21b3)+_0x23937d(0x1af9,0x2666,0x1946,0x1d98),'utTPL':'40\x20Months\x20'+_0x23937d(0x1af9,0x24c5,0x19d2,0x205a),'rUGwP':_0x23937d(0xb1e,-0x1ff,0xfa0,0xb27)+'More','NJPQe':'50\x20Months\x20'+_0x23937d(0x1af9,0xfaa,0x1529,0x247b),'cIwtR':_0x23937d(0x93c,0x16ba,-0x29e,-0x34f)+_0x23937d(0x1af9,0x15f1,0x246e,0x1409),'HnTwd':_0x313705(0x1ee5,0x1ca0,0x2501,0x2a44)+_0x23937d(0x1af9,0x1eb1,0x2746,0x2353),'STkbs':'90\x20Months\x20'+_0x23937d(0x1af9,0x2070,0x2510,0xeac),'JqAGM':_0x313705(0x1a79,0x253a,0x13af,0x1ae3)+_0x313705(0x6e7,-0x345,0x103e,-0x59b),'LkOxk':_0x23937d(0xedd,0x18ed,0x5a3,0x12e7)+'r','XgneE':_0x313705(0x505,-0x9ba,-0x9d4,-0x7e2)+'rs','JTKVg':_0x313705(0x1219,0x16ed,0x3d9,0x995)+'rs','NVpOv':_0x313705(0x14e2,0x1f5e,0x1627,0x8ff),'zQgnM':_0x23937d(0x49c,-0x525,-0x6db,0xc0d)+_0x23937d(0xcce,0x1893,0x309,0x132b)+'ow','gMNBH':_0x23937d(0x140d,0x2321,0x9f1,0xee9),'ckFZL':function(_0x361567,_0x214484){return _0x361567(_0x214484);},'TjvKv':function(_0x1d3969,_0x518031){return _0x1d3969+_0x518031;},'wYmdc':function(_0x3c5087,_0x136533){return _0x3c5087(_0x136533);},'JmInV':_0x23937d(0x1c16,0x2ab4,0x1ae1,0x261c),'nBzdE':function(_0x1ffa6e,_0x175c8f){return _0x1ffa6e(_0x175c8f);},'GAcLS':function(_0x568836,_0x479ec5){return _0x568836(_0x479ec5);},'zdXWO':_0x23937d(0x1b27,0x1a38,0x14f7,0xdea)+'om','aUuQn':function(_0x343df7,_0x4f47fe){return _0x343df7(_0x4f47fe);},'EKzUw':_0x23937d(0x14c0,0x1eae,0xb2d,0x1236),'aKfGX':_0x313705(0x1762,0x1b57,0x224e,0x1549),'rHaaQ':function(_0x431f6b,_0x2a947){return _0x431f6b(_0x2a947);},'nwKPC':_0x23937d(0x39d,0xbdc,0x117e,0xf85),'RdpyZ':function(_0x43191a,_0x11f671){return _0x43191a===_0x11f671;},'BSssY':_0x313705(0xdbd,0x16c0,0xf11,0x140d),'nstPM':_0x313705(0x16d8,0x1f84,0x2397,0x20d7)+_0x23937d(0x1b6a,0x204c,0x18c4,0xe87),'KKPiS':function(_0x5593b8,_0x3f36b1){return _0x5593b8(_0x3f36b1);},'FBGCT':function(_0x2a517a,_0x589a9a){return _0x2a517a(_0x589a9a);},'OPDZk':function(_0xb935c8,_0x51af31){return _0xb935c8(_0x51af31);},'kTaiH':function(_0xb9e454,_0x154060){return _0xb9e454+_0x154060;},'hwSss':function(_0x232ae3,_0x558040){return _0x232ae3+_0x558040;},'MxEuF':_0x313705(0xf3d,0x9d3,0x16bd,0x52e),'VzBtw':function(_0x5864be,_0x41d49a){return _0x5864be(_0x41d49a);},'KXbiV':function(_0xf0db77,_0x5a6279){return _0xf0db77(_0x5a6279);},'fmSjM':'promote','eAyIR':function(_0x2d4aba,_0x128b0b){return _0x2d4aba(_0x128b0b);},'aQixK':function(_0x20fc05,_0x4ddc24){return _0x20fc05(_0x4ddc24);},'CWAOb':function(_0x39139e,_0x4642ca){return _0x39139e(_0x4642ca);},'Ptwpm':function(_0x19be6b,_0x467c48){return _0x19be6b(_0x467c48);},'nsSrO':_0x313705(0x1532,0x1f00,0xdea,0x827),'GLVNa':_0x313705(0x1018,0x1612,0x62b,0x12bd),'vywQZ':function(_0x401044,_0x1af613){return _0x401044(_0x1af613);},'KCUFO':function(_0xdbe0ce,_0x2a1200){return _0xdbe0ce(_0x2a1200);},'HsIHq':function(_0x4fed13,_0x55104b){return _0x4fed13+_0x55104b;},'tsiXp':function(_0x54be91,_0x1e438c){return _0x54be91+_0x1e438c;},'yqqUs':'unblock','VZOwg':function(_0x1ad347,_0x273d79){return _0x1ad347(_0x273d79);},'uXERr':function(_0x2b8398,_0x2041b2){return _0x2b8398(_0x2041b2);},'pfSNA':function(_0x3654cc,_0x3bf1d1){return _0x3654cc+_0x3bf1d1;},'tHFfE':'setsubject','JTufT':function(_0x3da558,_0x4ea19c){return _0x3da558(_0x4ea19c);},'FOsEv':function(_0x4c183a,_0x5d6499){return _0x4c183a(_0x5d6499);},'ppkBU':function(_0x538f97,_0x3fcf03){return _0x538f97(_0x3fcf03);},'YSbEG':_0x23937d(0x1ab8,0x2231,0x20f6,0x133d),'rStWt':_0x23937d(0x33b,-0x54c,-0x1f7,-0x200)+_0x23937d(-0x24,-0xad2,-0xda4,-0x6d2),'lflBt':_0x313705(0x524,0xd71,0xdc1,0xcac),'oRjaR':_0x23937d(0x16da,0x1125,0x1530,0xffb),'yJPQF':_0x313705(0x1086,0x1771,0x8fb,0x1946)+_0x23937d(0x1605,0x1f6b,0x1f65,0x963),'MvGIW':function(_0xfe332c,_0x3abd94){return _0xfe332c(_0x3abd94);},'wfojx':_0x23937d(0x17af,0x1925,0xc12,0x8bd),'QEyer':function(_0xe159fa,_0x424318){return _0xe159fa(_0x424318);},'zzLUh':function(_0x1d0490,_0x21f8fb){return _0x1d0490+_0x21f8fb;},'YpNJl':'setgrouppp','Eycdf':'groupdp','VvAbz':'setgcpp','YsZuI':function(_0x4bb8f9,_0x1587af){return _0x4bb8f9===_0x1587af;},'vIFww':'Orqsz','frVJP':function(_0x43b2bd,_0x328153){return _0x43b2bd(_0x328153);},'fGnBS':function(_0x22528a,_0x5c85bf){return _0x22528a(_0x5c85bf);},'GvvDA':function(_0x123dbb,_0x4882c5){return _0x123dbb(_0x4882c5);},'XfdQb':function(_0x1522c4,_0x5b498f){return _0x1522c4(_0x5b498f);},'dFznR':function(_0x5cfa12,_0x16e2e5){return _0x5cfa12(_0x16e2e5);},'NGAcm':_0x313705(0xbbf,-0x134,0x11da,0x6b9),'wMJXd':_0x313705(0x1c42,0x1ec4,0x1d1c,0xe3e),'MqNTT':_0x23937d(0xae3,-0x3b8,0x1906,0xcf6),'oUeEr':_0x23937d(0x18ce,0x9e3,0x1cb4,0x1ca5)+'2','DYyYd':function(_0x2087d6,_0x48af85){return _0x2087d6(_0x48af85);},'CVZDO':function(_0x8e042,_0x147e14){return _0x8e042(_0x147e14);},'kVwyC':function(_0x28c311,_0x30994a){return _0x28c311(_0x30994a);},'RupbJ':_0x313705(0xd33,0x9d1,0x762,0x160a),'xlpJI':_0x23937d(0x10a,-0xa3c,-0x367,-0xc07),'sdagN':function(_0x4d502b,_0x4d59ee){return _0x4d502b(_0x4d59ee);},'FxUvD':function(_0x16b363,_0x52c5bd){return _0x16b363<_0x52c5bd;},'njQue':function(_0x2aa516,_0x26ead8){return _0x2aa516(_0x26ead8);},'pgXlO':function(_0x16c455,_0x3ebe5b){return _0x16c455(_0x3ebe5b);},'BlnyC':function(_0x4c8523,_0x3f3059){return _0x4c8523(_0x3f3059);},'Npymq':'vuPzo','HtbbQ':function(_0x1aaf29,_0x5c55d9){return _0x1aaf29 in _0x5c55d9;},'WHQVU':function(_0x3c2c16,_0x78300){return _0x3c2c16(_0x78300);},'SxBXa':function(_0x5d1d09,_0x87d06b){return _0x5d1d09(_0x87d06b);},'GnBTw':function(_0xd66b7b,_0x38da72){return _0xd66b7b(_0x38da72);},'kIVrq':'upvote','kvwAI':function(_0x17fd5c,_0x16d0fb){return _0x17fd5c(_0x16d0fb);},'KkMWj':_0x313705(0x196a,0x2003,0x2440,0xae9),'wGKvw':function(_0x2b8247,_0x58721d){return _0x2b8247!==_0x58721d;},'NlNlh':_0x23937d(0xfdf,0xf95,0x14c2,0x1521),'aZaTQ':function(_0x7035fd,_0x1696cd){return _0x7035fd(_0x1696cd);},'msdxj':function(_0xd824c,_0xbddfa3){return _0xd824c(_0xbddfa3);},'nPoQB':'deletevote','pRaCW':_0x313705(0x1da4,0x12dc,0x21fc,0x1b42),'mnVdY':function(_0xb826f0,_0x4f4e73){return _0xb826f0===_0x4f4e73;},'xZOvc':_0x313705(0xcf7,0x6bf,-0x1e7,0xdfb),'aDEPS':_0x23937d(0x2ca,0x8e3,-0x436,-0xadd),'BuhTT':function(_0x1c1dc1,_0x422fe9){return _0x1c1dc1(_0x422fe9);},'HRrmQ':function(_0x4647ec,_0x16513e){return _0x4647ec(_0x16513e);},'Bshwj':_0x313705(0xe82,0x13a6,0x12e6,0x1054),'wfiPL':function(_0x38e75c,_0x2e6a11){return _0x38e75c(_0x2e6a11);},'SLiWR':function(_0x4661c6,_0x1c8f54){return _0x4661c6===_0x1c8f54;},'mAqgq':_0x23937d(0x1c08,0x1fb0,0x1ee1,0x15bd),'yIgtp':function(_0x452835,_0x27ec93){return _0x452835===_0x27ec93;},'spbZQ':'xUhRE','VbLNI':_0x23937d(0xc91,0x134,0x18d9,0x1a2),'iTITd':function(_0x32a751,_0x2a53ed){return _0x32a751===_0x2a53ed;},'JLyep':_0x23937d(0x1041,0x671,0x236,0x180a),'kZQXK':_0x23937d(0xeb,-0x6b5,0xba2,-0xd00)+_0x23937d(0x143a,0xb36,0xd4a,0x1f21),'yLWyQ':_0x23937d(0x1b5c,0x2813,0xf4b,0x1555),'rLbxR':_0x313705(0x19e9,0x1f9f,0x2842,0x1128)+_0x313705(0x4df,0x89,0xde7,0x463),'wloXW':'Close','aDkAs':_0x313705(0xe42,0x106e,0xeee,0x1a53),'OFmgQ':function(_0x5a0861,_0x396727){return _0x5a0861(_0x396727);},'gmguF':function(_0x3d73c0,_0x8851d0){return _0x3d73c0(_0x8851d0);},'nsfpY':function(_0x50fef2,_0x1a9be3){return _0x50fef2(_0x1a9be3);},'sbImQ':function(_0xe0878b,_0x197f8a){return _0xe0878b(_0x197f8a);},'joPrK':'type\x20auto\x20'+'sticker\x20on'+_0x313705(0x80a,0x1724,-0x1ea,0x119c)+_0x23937d(0x1bad,0x1a9e,0xe1a,0x162a)+_0x23937d(0x10c5,0xbb7,0x167d,0x879)+'ff\x20to\x20disa'+_0x313705(0x1927,0x1e47,0x21af,0x14c8),'MTFzq':function(_0x24ed5c,_0x34fff3){return _0x24ed5c===_0x34fff3;},'yDSlc':function(_0x31c28b,_0x59bff8){return _0x31c28b===_0x59bff8;},'IICRx':'autosticke'+_0x23937d(0x3a9,-0x48a,0xb7d,-0x9b5),'pmJSz':_0x23937d(0xadc,0xbf5,0x5e4,0x5ae)+'pc','bjxIw':function(_0x246547,_0x2fa448){return _0x246547(_0x2fa448);},'eZROa':function(_0x2e3bbe,_0x160306){return _0x2e3bbe(_0x160306);},'PUxmq':function(_0x5f5542,_0x2296c2){return _0x5f5542(_0x2296c2);},'EwMIB':function(_0x31837c,_0x4ff770){return _0x31837c<_0x4ff770;},'YLuvJ':'type\x20autos'+_0x313705(0x16d2,0xae2,0x23a0,0x1a48)+_0x313705(0xbee,0x310,0x1336,0x940)+'e\x0atype\x20aut'+_0x313705(0x20f0,0x2e4d,0x2b7c,0x2cb7)+_0x313705(0x1fbf,0x2c10,0x257e,0x1922)+_0x313705(0x1927,0x17d6,0x2749,0x1493),'jTQvH':_0x313705(0xe81,0x19ca,0xa10,0x1a58)+'database/a'+'utostickpc'+_0x313705(0x681,0xfb6,0xe17,0x7ea),'NADNs':function(_0x5c3ca5,_0x4fc979){return _0x5c3ca5(_0x4fc979);},'WABHD':'autosticke'+_0x313705(0xb53,0x198a,0xb1a,0x55b)+_0x23937d(0x1ab4,0x13f5,0x1f16,0x16c8),'uEVhh':function(_0x224dab,_0x4a5dad){return _0x224dab===_0x4a5dad;},'gqkDR':function(_0x4baf75,_0x304c6e){return _0x4baf75(_0x304c6e);},'ucVei':_0x313705(0x11ed,0x207b,0x1486,0x1f3e)+_0x23937d(0xaf4,-0x1bf,0x3ae,0xaec)+_0x23937d(0xa60,0x407,0x1ec,0x188),'YeTHp':_0x313705(0x1641,0x226e,0x233d,0x247f),'Ysams':_0x23937d(0x11ee,0x1987,0xd10,0x582),'obiLn':function(_0x7093d6,_0x545dd7){return _0x7093d6(_0x545dd7);},'spEdC':function(_0x114a0a,_0x55192b){return _0x114a0a===_0x55192b;},'lqYhN':_0x23937d(0xe0e,0xabe,0xd68,0x5d0),'vKrEA':'Already\x20ac'+'tivated','clIrJ':_0x23937d(0x1b22,0x2709,0x23f5,0x1577)+'\x20turning\x20o'+_0x23937d(0x1560,0x23cc,0x22a2,0x1dd1)+_0x23937d(0x741,-0x63e,0xa3d,0xd0c)+'k\x20in\x20this\x20'+_0x313705(0x152c,0x12d5,0xd00,0x1f7d),'PTdwY':function(_0x4c9597,_0xd71d5e){return _0x4c9597(_0xd71d5e);},'gqMjD':function(_0x18a723,_0x2e20f3){return _0x18a723!==_0x2e20f3;},'odmGr':_0x313705(0x1dde,0x1e22,0x2336,0x1ad3),'kFJSW':'pMdtM','FjwTp':'antilinkyo'+_0x313705(0xf50,0x1926,0x1089,0x175a),'dvsJK':function(_0x8dd305,_0xa0ea4a){return _0x8dd305(_0xa0ea4a);},'dYWbV':function(_0x270632,_0x3e393e){return _0x270632(_0x3e393e);},'PwLvE':function(_0x102248,_0x57a66a){return _0x102248===_0x57a66a;},'XnRcZ':'4|6|1|0|2|'+_0x313705(0xae5,0x12ab,0x1050,0x18a1),'WEIuR':_0x313705(0x1e88,0x1b5e,0x174b,0x1534)+_0x23937d(0x86f,-0xc5,-0x2e7,0xea5)+_0x313705(0x14d1,0x1ed2,0xa59,0x1cf8)+_0x23937d(0x64b,0x914,-0x4ae,-0x842)+_0x23937d(0x1330,0x1f39,0x1f18,0xbfd)+'is\x20group','tzIZm':function(_0x24d2fc,_0x388dec){return _0x24d2fc(_0x388dec);},'sQFHU':function(_0x5247db,_0x43c112){return _0x5247db(_0x43c112);},'NdFJb':_0x23937d(0xc07,0x101f,0xaaa,0x27b),'fVdhW':_0x313705(0xfb7,0xabd,0x139b,0xe4)+'utubech','hbZGr':'antilinkyo'+_0x313705(0x106d,0x1b20,0x80f,0x199a)+'el','bLxhG':_0x313705(0x74c,-0x448,0x108,0x119)+'ch','inFUn':function(_0x35d618,_0x2ff9b9){return _0x35d618===_0x2ff9b9;},'XdvQx':_0x23937d(0x1496,0xf18,0x216b,0x1e59),'BjOoK':function(_0x2077c1,_0x3ae11d){return _0x2077c1(_0x3ae11d);},'pQzAc':function(_0x1a1393,_0xea33ee){return _0x1a1393===_0xea33ee;},'Jwtad':_0x23937d(0x45a,-0x899,0xefa,-0x442)+_0x313705(0x173e,0x1ea2,0x15c5,0x2577),'QQtqj':'Success\x20in'+_0x23937d(0x86f,0x15e0,-0x512,-0x499)+_0x313705(0x14d1,0x1c11,0x107f,0x648)+'channel\x20an'+'tilink\x20in\x20'+_0x23937d(0xe29,0x868,0xb0b,0x177c),'Gomod':function(_0x553a8a,_0x3a5555){return _0x553a8a!==_0x3a5555;},'Huown':_0x23937d(0x126f,0xbdb,0x75c,0x13ec),'BvThH':function(_0x57958d,_0x2c5306){return _0x57958d(_0x2c5306);},'Indkh':_0x23937d(0x97c,-0x147,0x959,0x637),'DFDyp':_0x313705(0x114f,0x1caf,0x1649,0x1005),'jAimV':_0x23937d(0xcd,0x465,-0x365,0x38a)+'stagram','MAFit':_0x313705(0xc41,0x13a2,-0x123,0xd48),'gxjpA':_0x313705(0x433,0x863,0x101d,-0x7c4)+_0x313705(0x11ef,0x190a,0x751,0x103f),'oUMDo':_0x313705(0x1755,0x1640,0x1667,0xb58),'zDBQB':_0x23937d(0x19fb,0x16f5,0xbef,0x1a9d),'PtZcz':function(_0x2b375d,_0x3845ab){return _0x2b375d&&_0x3845ab;},'yzDNV':function(_0x2d4af3,_0x47b089){return _0x2d4af3(_0x47b089);},'FNGVr':_0x313705(0x1e88,0x2da7,0x2093,0x26c4)+_0x23937d(0x86f,0x957,-0x5ff,0x150a)+'n\x20instagra'+_0x23937d(0xcf9,0x45,0x1a61,0x83a)+_0x313705(0x1b01,0x1c2b,0x24d4,0x1511)+_0x23937d(0xad8,0x25d,0xb3,0x3c0),'ucvKS':function(_0x48786f,_0xc225fe){return _0x48786f===_0xc225fe;},'Ioece':_0x23937d(0x1df,-0xd30,0xcd2,-0x4f3),'vAMLI':function(_0x1268cc,_0xaf6ab3){return _0x1268cc(_0xaf6ab3);},'CwVib':'antilinkfa'+_0x23937d(0xb51,0xc76,0x1203,0x35b),'HCPfI':_0x313705(0x1fd4,0x298d,0x18f4,0x1346),'gzrFK':function(_0x351b3a,_0x33285f){return _0x351b3a(_0x33285f);},'zepFu':function(_0x28ef85,_0x16982d){return _0x28ef85(_0x16982d);},'uINpb':function(_0x4cdb14,_0x5a49a8){return _0x4cdb14(_0x5a49a8);},'NQotl':_0x313705(0x11c1,0xa01,0x114b,0x876),'EsUSV':function(_0x4737cd,_0x3c48e6){return _0x4737cd(_0x3c48e6);},'UlUMN':function(_0x4afd6b,_0x171a4c){return _0x4afd6b(_0x171a4c);},'SXpOm':_0x23937d(0x1b22,0xc5c,0x11e2,0x178d)+_0x23937d(0x86f,0xe3e,0x1226,-0x288)+_0x23937d(0x7b6,-0x6de,0x10eb,0x34c)+_0x23937d(0xb1f,0x181e,0x140a,0x12d2)+_0x313705(0xe33,-0x83,0x1661,0x5db)+_0x313705(0x15b2,0xefa,0x6db,0x1610),'RjSVc':function(_0x2be27d,_0x72f1d3){return _0x2be27d===_0x72f1d3;},'nHThU':function(_0x552f92,_0x3bada1){return _0x552f92(_0x3bada1);},'gQGfl':_0x23937d(0x1b22,0x1135,0x1e98,0x10bc)+_0x313705(0xbd5,0xec0,0xb13,0x47e)+_0x313705(0xac1,0x133b,0x120c,0x177e)+_0x313705(0x1d37,0x176c,0x11d0,0x10d4)+_0x23937d(0x179b,0x20b0,0x97e,0x22fa)+'roup','vEmTF':_0x313705(0x520,-0x5d4,-0x3a2,-0x432)+_0x313705(0x2012,0x2c7d,0x11e0,0x1432),'DlEKU':_0x313705(0x6b3,-0x77f,-0x83a,0x1189),'aenPy':function(_0x471db0,_0x492937){return _0x471db0(_0x492937);},'IaZUz':function(_0x504cec,_0x555bfe){return _0x504cec===_0x555bfe;},'FXBJG':'OYbIw','LWeti':_0x23937d(0xe95,0xbd0,0x6ee,0x7e6),'VEVln':'6|3|2|1|0|'+_0x313705(0x3ce,-0x7bb,-0xaca,-0x1),'wRspz':function(_0x64871,_0x5ab0a9){return _0x64871(_0x5ab0a9);},'YgcoD':function(_0x4ca949,_0x49d2a0){return _0x4ca949(_0x49d2a0);},'qDOxx':_0x313705(0xfb9,0xe3d,0xca3,0x1b85),'jgPpp':_0x313705(0xf2a,0x948,0x20e,0x13d4)+'ktok','XLCaW':_0x23937d(0x1a21,0x2644,0x1f0b,0xc1f),'fUBqC':function(_0x14e81a,_0x3d1000){return _0x14e81a(_0x3d1000);},'WIiQs':function(_0x3b3ab7,_0x4d071b){return _0x3b3ab7&&_0x4d071b;},'fWcbq':'Success\x20in'+_0x313705(0xbd5,0x286,0x13bb,0x18e2)+_0x23937d(0x104f,0x16f6,0x14af,0xea4)+'ntilink\x20in'+'\x20this\x20grou'+'p','AnlOo':_0x23937d(0x1b22,0x1318,0x1164,0x167a)+_0x23937d(0x86f,0x164e,0x244,-0x541)+'ff\x20tiktok\x20'+_0x23937d(0x626,0x3cb,0x968,-0x8c)+'n\x20this\x20gro'+'up','EzXyy':'oERhA','lwhuj':_0x23937d(0x1b2,-0x18f,-0x7ba,0x36a)+'it','bBWFi':_0x313705(0xbd8,0x369,0xf5,0x424),'EmuXL':function(_0x3c867c,_0x356e00){return _0x3c867c(_0x356e00);},'LTLVF':function(_0x175420,_0x5c66bb){return _0x175420&&_0x5c66bb;},'ayZxU':function(_0xae6b03,_0x129aa0){return _0xae6b03(_0x129aa0);},'fplbd':_0x313705(0x1e88,0x139b,0x2397,0x20fb)+_0x23937d(0x86f,0xdbf,0x801,0x96)+_0x313705(0x1821,0x2649,0x1683,0x2521)+_0x23937d(0x626,0xe8d,-0x762,0x12cb)+_0x313705(0xdf6,0x1f6,0xf05,0x16f2)+'up','ymRRI':function(_0x2a1b4b,_0x3d82a2){return _0x2a1b4b===_0x3d82a2;},'pBvoL':function(_0x48ad88,_0x5a2d2a){return _0x48ad88===_0x5a2d2a;},'kOGxU':'ILBFf','DOdaQ':function(_0x5dbcd5,_0x523e21){return _0x5dbcd5(_0x523e21);},'IgIcy':_0x23937d(0x1b22,0x249f,0x28fd,0xffc)+'\x20turning\x20o'+_0x23937d(0x169c,0x9dd,0x218e,0x24db)+_0x23937d(0xb1f,0x861,0x310,0x142)+_0x23937d(0xacd,0xe1d,0xde,0x13b6)+_0x23937d(0x124c,0x1813,0x1761,0x1bde),'PdbVi':_0x23937d(0x8c,-0x294,-0x3a0,-0x846)+'l','WsyFM':function(_0x280faa,_0x184f82){return _0x280faa(_0x184f82);},'mcnUF':function(_0x188109,_0x4075dd){return _0x188109(_0x4075dd);},'fAtHJ':function(_0x2626b2,_0x56925a){return _0x2626b2&&_0x56925a;},'kvRJS':function(_0x3ce65a,_0x4d3de1){return _0x3ce65a(_0x4d3de1);},'FXDkl':function(_0x5c448,_0x3c4e18){return _0x5c448===_0x3c4e18;},'dnENV':'Success\x20in'+'\x20turning\x20o'+_0x313705(0x1835,0x1518,0x1426,0x1906)+_0x23937d(0x1330,0x1950,0xab5,0x1fa6)+'is\x20group','ITdMs':function(_0x185184,_0x1c04c0){return _0x185184(_0x1c04c0);},'GVBGH':_0x313705(0x1e88,0x251e,0x1600,0x2a2b)+_0x313705(0xbd5,0xbb4,0x7e3,0xe1a)+_0x23937d(0x924,0xf6,0x610,0x12de)+_0x313705(0x1f96,0x22d6,0x2876,0x24ae)+_0x313705(0xcfb,-0x194,-0x1f2,0x735),'WrbAX':'EsLCj','pdkPB':_0x313705(0xe51,0xa61,0x18a4,0x2b4),'RFYfz':_0x23937d(0x7b3,0x4e5,0xbab,0x632),'vLnLf':_0x23937d(0x134,-0xdb4,0xd93,0xda6),'mBrel':function(_0x1bb62e,_0x3511f0){return _0x1bb62e(_0x3511f0);},'tqdtJ':function(_0xec6eaf,_0x36f334){return _0xec6eaf(_0x36f334);},'MXnXs':function(_0x3313f3,_0x59351a){return _0x3313f3(_0x59351a);},'JECOF':function(_0x3412ce,_0x2e6d83){return _0x3412ce(_0x2e6d83);},'oLwWt':_0x313705(0x14cb,0x16e1,0xba9,0x1472),'cVlIz':_0x313705(0x1608,0x20f0,0x1d5d,0xf0c),'HmaQY':function(_0x4efe7a,_0x132e11){return _0x4efe7a(_0x132e11);},'utoBd':function(_0x35ef03,_0x2c1b48){return _0x35ef03(_0x2c1b48);},'fRrtd':_0x313705(0x11c5,0xc3e,0x1dfd,0xb6e),'IFMRR':function(_0x5e253c,_0xb4a5ee){return _0x5e253c(_0xb4a5ee);},'OurtE':function(_0xc27657,_0x575626){return _0xc27657(_0x575626);},'hNwaH':function(_0x2907a6,_0x3458ba){return _0x2907a6(_0x3458ba);},'jTdzl':function(_0x202ea1,_0x46d090){return _0x202ea1(_0x46d090);},'fRooH':function(_0x4ac6f6,_0x402fc5){return _0x4ac6f6&&_0x402fc5;},'HCbSx':function(_0x57e7e0,_0x108c45){return _0x57e7e0===_0x108c45;},'wBbSL':'Success\x20in'+_0x23937d(0x86f,0x440,0x8a0,-0x5c7)+_0x23937d(0x156b,0x93a,0x1016,0xb62)+_0x23937d(0x1116,0x662,0x648,0x1fe3)+_0x313705(0xcfb,0x9eb,0x1065,0x1a72),'bpGFv':function(_0x6c0c18,_0x2e44f7){return _0x6c0c18===_0x2e44f7;},'MevTG':_0x23937d(0x1b22,0x1d1b,0x1604,0x20eb)+_0x313705(0xbd5,0xb42,0x172a,0x14b9)+_0x313705(0x1b66,0x1b05,0x163f,0x21ab)+'ly\x20in\x20this'+'\x20group','pfFQs':'antitoxic','nLwhe':function(_0x34d29a,_0x1b6b43){return _0x34d29a(_0x1b6b43);},'cfDau':'6|1|0|5|2|'+'7|4|3','EkydS':_0x23937d(0x1b22,0x141c,0x1b8e,0x2886)+_0x23937d(0x86f,-0x167,0x149a,-0x1f0)+_0x23937d(0x15b6,0x1be3,0x1f7c,0x1102)+_0x313705(0xcf8,0xec3,0x992,-0x16f)+_0x23937d(0x11c6,0xb4b,0x1967,0x6c6),'HqBUF':function(_0x4e61d2,_0x39d78d){return _0x4e61d2(_0x39d78d);},'ZjRDD':function(_0x5a9953,_0x5af7c8){return _0x5a9953(_0x5af7c8);},'eWfEu':_0x23937d(0x1b22,0x12f8,0x18d9,0x27c8)+_0x313705(0xbd5,0xd70,0xd7d,0x1844)+_0x313705(0x1759,0x266e,0x1f5a,0x1bbe)+_0x23937d(0x1919,0x2054,0x21db,0x1a49)+'\x20group','DCfNG':_0x23937d(0x1252,0x649,0x1b42,0x4c9),'JtPJr':function(_0x4ded31,_0x389d02){return _0x4ded31(_0x389d02);},'erOeQ':function(_0x228894,_0xc4f4a4){return _0x228894(_0xc4f4a4);},'sHjvH':function(_0x546443,_0x1a72d4){return _0x546443(_0x1a72d4);},'NNScM':function(_0x10ae55,_0x74718e){return _0x10ae55(_0x74718e);},'MzqVd':_0x23937d(0x1b22,0x244a,0x117a,0x18c1)+_0x23937d(0x86f,0x127e,0x1161,0xb58)+_0x313705(0xb28,0x905,0x17cb,-0x11)+'e\x20in\x20this\x20'+_0x313705(0x152c,0x21c0,0x1dac,0x1d77),'fdEXO':_0x313705(0x1cc4,0x12a6,0x147a,0x140d),'gEppE':_0x313705(0x116f,0x190e,0x2c9,0x1889),'fyfNc':'nsfw','jaMIi':_0x23937d(0x831,0x12ca,0x10f0,0x83),'TbRUT':function(_0x54b586,_0xda180f){return _0x54b586(_0xda180f);},'OrAgc':_0x313705(0xe31,-0xbd,0x37d,0x1af8),'AQcdC':_0x23937d(0x1b22,0xed0,0x1445,0x11ed)+_0x23937d(0x86f,0x6c4,0x320,0x1675)+_0x313705(0x1958,0x1ec4,0x1fb5,0xacb)+_0x23937d(0x4cf,-0xbd,0x138b,-0x7ad)+'p','UcZaO':function(_0xe81623,_0x18c3f7){return _0xe81623===_0x18c3f7;},'zNFQJ':_0x23937d(0x1a35,0x20aa,0xfc1,0xe0d),'uETpK':function(_0x589af7,_0x278e71){return _0x589af7!==_0x278e71;},'jHfVy':_0x313705(0xe94,0xfe1,0x108f,0xe5a),'HthOk':function(_0x5ab853,_0x1b1299){return _0x5ab853(_0x1b1299);},'mfitk':function(_0x5f05d6,_0x596c7c){return _0x5f05d6(_0x596c7c);},'CRlLV':function(_0x1b700d,_0x4c7a64){return _0x1b700d(_0x4c7a64);},'hpInL':'announceme'+'nt','uDJxo':_0x313705(0x167b,0x992,0x1f4c,0xda9),'KwzBJ':_0x313705(0xaf0,0x9c5,0x3f3,0x157f),'Lhskg':_0x23937d(0x91a,0x2f5,0xa26,0x63c),'UeZkw':'⫷\x20MUTE\x20⫸','nlYwn':_0x313705(0x17c8,0xb8d,0x233f,0x125a),'OuIHp':'liYpc','arBYA':function(_0x339306,_0x31227b){return _0x339306(_0x31227b);},'KMPZh':function(_0x4cd48b,_0x483695){return _0x4cd48b(_0x483695);},'hQquX':function(_0xd50333,_0x578301){return _0xd50333(_0x578301);},'Smlsy':'linkgroup','GjmLG':_0x313705(0x13f4,0x108d,0xb35,0x2141),'nEdHY':_0x313705(0x9fe,0x4eb,0x16d8,0x17b6),'jRdSn':_0x313705(0xaca,0x54b,0x41c,0x1534),'inYxK':_0x23937d(0xad3,0xf01,0x124d,0x11ef),'NPdvF':_0x23937d(0xd55,-0xc4,0x1b26,-0x5e),'nnJXa':function(_0x37901a,_0x43db2a){return _0x37901a(_0x43db2a);},'UGJrC':function(_0x56ce6e,_0x911f1d){return _0x56ce6e===_0x911f1d;},'slLWl':_0x313705(0x1e47,0x173d,0x261b,0x2803),'NolqL':function(_0x1e5472,_0x508385){return _0x1e5472===_0x508385;},'fmCfP':_0x313705(0x57f,0x7e9,0x81a,0xac5),'CjtJC':_0x313705(0x8f7,0x13d,0x9b4,0x1540)+'g','jRmYs':'groupsetti'+'ng','pGPFM':function(_0x54581d,_0x4fb3d6){return _0x54581d!==_0x4fb3d6;},'qbXrL':'lyZYy','jVuJZ':function(_0x26d8d1,_0x363950){return _0x26d8d1(_0x363950);},'hPYXl':_0x23937d(0x1755,0x1eaa,0x20f7,0x25e2)+_0x313705(0x8bc,0x15c,0x34,0xb4b),'IcFPI':_0x313705(0xa9d,0x7c2,0xe35,-0x54)+'on','QpxFh':_0x23937d(0x1925,0xb07,0xfc3,0x133e),'nxfDR':'bcgroup','wmnOd':_0x23937d(0x83a,-0x1f3,0xc61,0x204),'bkOcn':'menu','qXaMJ':_0x313705(0xab1,0xa62,0x21e,0xc74),'LINxA':_0x313705(0xfea,0xb77,0x18e4,0x158f),'psBVn':function(_0x122256,_0x20823b){return _0x122256(_0x20823b);},'MlypU':'broadcast','nSBhc':function(_0x1994e6,_0x54435d){return _0x1994e6*_0x54435d;},'jMWIM':'🔮Menu🔮','pxubo':function(_0x301aa0,_0x5c9831){return _0x301aa0(_0x5c9831);},'QqWVP':_0x23937d(0x757,0x15ea,0x11a2,-0x310)+'Success','gFSve':_0x23937d(0x16ca,0x2170,0x2505,0xccd),'jHtYu':_0x23937d(0x1ce9,0x2037,0x242f,0x13ec),'ovwzw':_0x23937d(-0x2f,-0x7b3,0x9e4,0xed3),'HHYXL':function(_0x33c7a7,_0x1423e3){return _0x33c7a7(_0x1423e3);},'PdORl':_0x23937d(0x150f,0xd79,0x1658,0x1463)+_0x313705(0x19c4,0xe6c,0x1126,0x282c)+_0x23937d(0x1b8a,0x26f4,0x1f49,0x2234),'MhsOn':function(_0x430df4,_0x377f71){return _0x430df4*_0x377f71;},'JnYKg':function(_0x38a849,_0x274d14){return _0x38a849!==_0x274d14;},'IdofL':_0x313705(0x1fa5,0x2134,0x2551,0x225d),'vtsWc':_0x23937d(0xd30,0x4b2,0xdfe,-0x185),'QRmEu':_0x313705(0x1bb9,0x10e5,0xe34,0xdf6),'ngpHO':'RneKj','Kclyf':function(_0x34e786,_0x55b6e3){return _0x34e786===_0x55b6e3;},'AfjDj':_0x313705(0x165f,0x13ef,0x106c,0xaeb),'diOsP':function(_0x112daa,_0x5bba70){return _0x112daa(_0x5bba70);},'BUdUR':function(_0x258791,_0x255256){return _0x258791+_0x255256;},'oqGDQ':function(_0x4c1bae,_0x39b297){return _0x4c1bae(_0x39b297);},'TFGyG':'bcloc','Fydsy':function(_0x52655c,_0x1e0177){return _0x52655c!==_0x1e0177;},'rWkZS':_0x313705(0x464,0xcc5,0x1192,0x48),'hDTYv':function(_0x5a395f,_0x21e646){return _0x5a395f(_0x21e646);},'unbEB':function(_0xaf6189,_0x2f9b2d){return _0xaf6189(_0x2f9b2d);},'FmwEk':function(_0x3d691b,_0x395711){return _0x3d691b+_0x395711;},'jWrBK':function(_0x3dfd88,_0x323107){return _0x3dfd88+_0x323107;},'NeqPk':function(_0x4b397b,_0x599e3a){return _0x4b397b!==_0x599e3a;},'PFdON':_0x313705(0x547,0x20d,-0x34c,-0x222),'MCcjS':_0x313705(0x1eac,0x1a2b,0x1bee,0x1506)+_0x23937d(0x766,0x51d,-0x1,0x10fd)+'sent\x20by\x20a\x20'+_0x23937d(0x19b,0x481,0xb49,0xf5b),'kwpIN':function(_0x39b128,_0x55b931){return _0x39b128(_0x55b931);},'LPauw':function(_0x3511da,_0xecc08b){return _0x3511da*_0xecc08b;},'kzyET':'Sent','ZkRuF':_0x313705(0x942,0x1ef,0xaa7,0x83d),'oDmca':function(_0x3362d8,_0x5db726){return _0x3362d8===_0x5db726;},'PyMcG':function(_0x28d712,_0x29a531){return _0x28d712(_0x29a531);},'PWqPB':function(_0x350f96,_0x25fd4f){return _0x350f96(_0x25fd4f);},'Ytuwo':_0x23937d(0x1b46,0x1b0c,0x1571,0x11d6)+_0x23937d(0x3e8,0x7f8,0x9ff,-0x7b9)+_0x313705(0xde3,0x8ed,0x22f,0x1825)+_0x313705(0x127b,0x68e,0x1c5d,0x1ff8)+_0x313705(0x1ffa,0x209b,0x279d,0x22e8)+'y','NxVwV':_0x23937d(0xb98,-0x160,0xd37,0x3e2)+'on','kNdxh':'TJkOb','YlGZe':function(_0x3ab273,_0x17221c){return _0x3ab273(_0x17221c);},'rCQeK':function(_0x166736,_0x4d10c8){return _0x166736*_0x4d10c8;},'yoyvp':function(_0x43808b,_0x171404){return _0x43808b===_0x171404;},'liZgA':_0x313705(0x18c3,0x1243,0x19a8,0x1fcd),'JkvZO':_0x313705(0x16fd,0x216f,0x23e5,0x12a6),'KcmZA':'BvrCU','DqiHM':function(_0x38cbd1,_0x6c74e8){return _0x38cbd1+_0x6c74e8;},'ntUrl':function(_0x5017c2,_0x3b02ad){return _0x5017c2*_0x3b02ad;},'tCxyl':'listonline','XwLzv':function(_0x17cec3,_0xed3c82){return _0x17cec3(_0xed3c82);},'MzcjV':function(_0x394b8a,_0x395b93){return _0x394b8a+_0x395b93;},'ikGDn':'\x20\x20\x20\x20\x20🧩\x20Onl'+_0x23937d(0x7e3,0x972,0x98a,-0x3e1)+'\x0a\x0a','XrxVS':_0x23937d(0x1dd,0x9a0,-0x84b,0x64),'iNaDw':_0x313705(0xf48,0x12a8,0x8c7,0xbb8)+_0x23937d(0xcfd,0x1802,0xc7b,0x449),'URCgE':function(_0x31d8df,_0x20e447){return _0x31d8df!==_0x20e447;},'rebAI':'hFXmE','BZygD':function(_0x24a13c,_0x3df860){return _0x24a13c(_0x3df860);},'xFOvN':function(_0xc564b9,_0x15a3b3){return _0xc564b9(_0x15a3b3);},'rJNNJ':_0x313705(0x1bba,0x1c78,0x1a47,0x2abc)+_0x313705(0x55d,0xc90,0xdaa,0x123e)+'ercontent.'+_0x23937d(-0x18,0x69,0x3a,-0x80)+_0x23937d(0x8c7,-0x378,0x172f,0x8d7)+_0x313705(0xc4d,0x13ca,0x158d,0x148a)+_0x313705(0xf6a,0x1683,0xf20,0xfb9),'DYLij':function(_0x378e33,_0x50a91e){return _0x378e33(_0x50a91e);},'CMYkY':_0x313705(0x16a5,0x18ab,0x2393,0xaa7),'kxTUI':function(_0x5b5e67,_0x511304){return _0x5b5e67!==_0x511304;},'iuLqM':_0x313705(0x2152,0x169f,0x2db3,0x28aa),'qbIHk':'hisoka','jkXgZ':function(_0x5c384a,_0x24c1be){return _0x5c384a(_0x24c1be);},'mlJZn':function(_0x296e19,_0x367fe3){return _0x296e19(_0x367fe3);},'DWkbU':'ttp','hbpTB':function(_0x5a75fc,_0x26fcf7){return _0x5a75fc===_0x26fcf7;},'EFkAh':_0x313705(0x14d0,0x15b3,0x695,0x7db),'YzzGs':_0x23937d(0x9b7,0xc74,0x131a,0xd4d),'GtdQQ':function(_0x1227f9,_0x54707d){return _0x1227f9(_0x54707d);},'MdIHC':_0x313705(0x34b,0x9ba,0x207,0xe86),'nioSz':_0x313705(0x1798,0xf88,0x20f6,0x1b7d),'vQCWv':_0x313705(0xe0d,0xa46,0x1182,0x8dc),'sRBlT':_0x23937d(0x1432,0x52a,0x18d6,0x1750)+_0x313705(0x3c8,0x644,0x1fc,0x476),'EEFJf':function(_0xdcce74,_0x1fd4e4){return _0xdcce74(_0x1fd4e4);},'zuCLF':_0x313705(0x1427,0xe10,0x5b8,0x6cc)+'r','uOECk':_0x23937d(0x1b2d,0xe21,0x1952,0x1cf1),'WnEbu':_0x23937d(0x424,0x8c9,-0xcc,0x332)+_0x23937d(0x1605,0x1a02,0x185e,0x121a),'tkDFH':_0x313705(0x1bba,0xf9f,0x2555,0x19a8)+_0x313705(0x55d,0xdfc,0x399,0x112d)+'ercontent.'+_0x313705(0x34e,-0x32f,0xdbc,-0x311)+_0x313705(0xc2d,0x8ae,0x8a4,0xe55)+'data/main/'+'anjing','ljwEe':_0x313705(0x1fca,0x2eea,0x2e25,0x2579),'mmfsF':_0x313705(0x135d,0x800,0xf52,0x8b3)+_0x23937d(0x1744,0x1306,0xe2c,0xe49),'knsAL':function(_0x4f6eb2,_0x42ec55){return _0x4f6eb2(_0x42ec55);},'ZBQrt':_0x23937d(0x1854,0x14a0,0x112d,0x1982)+_0x23937d(0x1f7,0xe2a,0x75f,0x59e)+_0x313705(0x53f,-0x35a,0xe0a,0x33e)+'com/rashid'+'siregar28/'+_0x313705(0xc4d,0x1712,0x1a9b,-0xb6)+'bucin','MtuHh':_0x23937d(0x11bc,0x20c4,0x49d,0x112c),'rNgZc':_0x23937d(0x599,-0x32,0xcb8,0x121),'fWcdc':'4|0|1|2|5|'+_0x23937d(0x1529,0x7dd,0x241d,0x81c),'flPQx':function(_0x40fdaa,_0x5e30fa){return _0x40fdaa(_0x5e30fa);},'czyzz':_0x23937d(0x1854,0x1785,0xa8e,0x1321)+_0x23937d(0x1f7,0x6eb,0x62b,-0x17b)+_0x313705(0x53f,0xe4b,0xdde,0x30b)+_0x23937d(-0x18,-0x648,-0xe89,-0xe5b)+_0x23937d(0x8c7,0xb68,0x895,0xebd)+'data/main/'+_0x313705(0x1522,0x60a,0x1834,0xb57),'zcsLS':function(_0x39ab7d,_0x4ab4f2){return _0x39ab7d(_0x4ab4f2);},'yJjpZ':'stickergif','oVvIr':_0x313705(0x11f3,0x1a13,0x1a70,0xdbd),'pCuKP':function(_0x51df76,_0x3bd50e){return _0x51df76===_0x3bd50e;},'uJLMN':_0x23937d(0x129d,0x8b3,0x1354,0x41b),'IvjSq':_0x23937d(0x946,0xe17,0x1234,0x32)+_0x313705(0x1f07,0x1750,0x19e5,0x295a),'JUsxB':function(_0x2f2bc9,_0x30f8d5){return _0x2f2bc9(_0x30f8d5);},'NRSqk':_0x313705(0xd0b,0xa8b,0x210,0xa95),'ccLGp':function(_0x17a26d,_0x8fa783){return _0x17a26d(_0x8fa783);},'EdJaS':'gifee','zAjnX':'gifee.webp','QjNEg':function(_0xa6dcf8,_0x17f8a0){return _0xa6dcf8(_0x17f8a0);},'XxXvg':function(_0x3e36ed,_0x691c7e){return _0x3e36ed+_0x691c7e;},'ueuDP':'smeme','PzefW':function(_0x1c8601,_0x343f63){return _0x1c8601(_0x343f63);},'Zcdxp':function(_0x3ba673,_0x53a037){return _0x3ba673(_0x53a037);},'hnlnL':_0x313705(0xc4b,0xed8,0x12f8,0x19f2)+_0x23937d(0x1736,0xa40,0x109a,0x1519),'fKgPE':function(_0x12e5de,_0x8da9d7){return _0x12e5de(_0x8da9d7);},'gyxvI':_0x313705(0xd75,0x129a,0x6fb,0x9d8),'SOleh':_0x313705(0x16ca,0x114f,0x21ba,0xf69),'TEQKI':function(_0x55c3e7,_0x21a31e){return _0x55c3e7(_0x21a31e);},'mvRqm':_0x23937d(0x6df,0x101b,-0x170,0x7db)+'ry','DgLVy':_0x23937d(0xf9f,0xfce,0x1a9c,0xc0c),'JNNwN':function(_0x369a58,_0x29daf0){return _0x369a58===_0x29daf0;},'EbxyK':'aoXUd','FIEOE':function(_0x419177,_0x41d852){return _0x419177(_0x41d852);},'xzqpw':function(_0xc4b6e,_0x5b42ec){return _0xc4b6e+_0x5b42ec;},'eHBtF':function(_0x3155f7,_0x484f29){return _0x3155f7(_0x484f29);},'RvsZu':function(_0xf08ab0,_0x4702de){return _0xf08ab0(_0x4702de);},'nRTjO':_0x23937d(0x86e,0xbee,0x1218,-0x1ff),'XUgPA':function(_0x2e915e,_0x3768a4){return _0x2e915e(_0x3768a4);},'ufRKA':_0x313705(0x193f,0x2234,0x1c66,0x168d),'CvSNV':_0x23937d(0xa68,-0x1a8,-0x404,0x899),'xswEd':_0x23937d(0x14e3,0x1038,0x142c,0x169c),'IHsDw':_0x23937d(0x49d,-0x792,0x740,0x65b),'zFeQG':_0x23937d(0x244,-0xc51,-0x58d,0xa6c),'XEliy':_0x23937d(0x144c,0x1319,0x89e,0x71e)+'1','vYnfv':_0x23937d(0x1a8f,0x1776,0x14ec,0x257d),'XqFde':_0x23937d(0x11e,0x876,0xd19,-0x6bf),'mMFGN':'feed','rPxkb':'avatar','JfAPN':_0x313705(0x16d6,0x1157,0xb48,0x14c4),'Kudbl':_0x23937d(0x604,0x1229,-0x2e8,0xd86),'XHJaD':function(_0x4dbf85,_0x35da5c){return _0x4dbf85(_0x35da5c);},'lVpqR':_0x313705(0x475,0x291,-0x4be,0x1047)+'on','FsLIr':'gangbang','lqsCf':_0x313705(0xffc,0x65e,0x1963,0x10eb),'nKqKf':_0x313705(0x87e,0xd23,0xbf8,0xde3),'klRdV':_0x23937d(0x1434,0x85a,0x1889,0xa3d),'ZLdyk':_0x313705(0x17ef,0x1e9f,0xcc3,0x2558),'wmxvY':_0x313705(0x1cdd,0x161c,0x2a66,0x2416),'eRfSF':'ahegao','PdiRX':'ass','DUBoL':_0x313705(0x699,0x49,-0x86,0x6ca),'aRtNi':'panties','dwARB':_0x313705(0x92b,0x562,0x268,-0x5a8),'fsNOP':'yuri','WOBDm':'tentacles','dOxuD':function(_0x14f9e7,_0xf1c4bf){return _0x14f9e7(_0xf1c4bf);},'BYBjZ':function(_0x4ff49c,_0x12d78e){return _0x4ff49c!==_0x12d78e;},'IWTzI':_0x313705(0x1e68,0x236a,0x1331,0x2662),'vElDC':'spank','jdemp':function(_0x37309b,_0x1583bb){return _0x37309b(_0x1583bb);},'OJXvo':function(_0x66fcfa,_0x18a58a){return _0x66fcfa(_0x18a58a);},'ZjuME':'blowjobgif','lyqEb':function(_0x4f3a63,_0xf7791c){return _0x4f3a63(_0xf7791c);},'ymoQM':function(_0x5d5b1c,_0x1a2b05){return _0x5d5b1c(_0x1a2b05);},'VITBn':_0x23937d(0xda1,0x39e,0xff0,0x169c),'eJEms':function(_0x5dd837,_0x4a939){return _0x5dd837!==_0x4a939;},'mipQm':_0x23937d(0x58c,0x1178,0xb5b,0x998),'SLDLf':'aPGvo','XSEtu':function(_0x37d749,_0x949601){return _0x37d749(_0x949601);},'FQyIZ':function(_0x1dd917,_0x47e6a3){return _0x1dd917(_0x47e6a3);},'GPZEQ':function(_0x5139f0,_0x9dd8){return _0x5139f0(_0x9dd8);},'LsHvl':_0x313705(0x1092,0x508,0x14a1,0xaad),'KMcve':function(_0x5ddce6,_0xe1ddb7){return _0x5ddce6(_0xe1ddb7);},'GnNIP':_0x23937d(0x19e0,0x1235,0x19df,0x18c3),'TtvHh':function(_0x4fb790,_0x506c43){return _0x4fb790(_0x506c43);},'PPJhM':_0x313705(0x16f8,0x139c,0x1843,0xcbc)+'fu','SlYIH':_0x313705(0x1a35,0x13c6,0x1832,0x230d),'MDsNm':function(_0x23a933,_0x531755){return _0x23a933(_0x531755);},'JjgcX':function(_0x5eb1ee,_0x31f74b){return _0x5eb1ee(_0x31f74b);},'tZDkB':function(_0x2cde0e,_0x19da6e){return _0x2cde0e(_0x19da6e);},'ZUSFx':_0x313705(0x66b,0x1080,0x40e,0xe97),'Lyqhx':function(_0x2b1e8b,_0x324c77){return _0x2b1e8b(_0x324c77);},'ilNKj':_0x23937d(0x175e,0x22a8,0x8a3,0x186f),'VZWFS':function(_0x2d4ecc,_0x131aeb){return _0x2d4ecc(_0x131aeb);},'JwpAY':_0x23937d(0x1740,0x13d1,0x234b,0x16f3),'kBKZP':function(_0x5bd746,_0x38de05){return _0x5bd746(_0x38de05);},'ZNBxG':_0x313705(0x1c59,0x2a95,0x1491,0x1db1),'UPYou':function(_0x4d4702,_0x4472d4){return _0x4d4702(_0x4472d4);},'uTPho':'waifu3','YLdGv':function(_0x17b60a,_0x2556d5){return _0x17b60a(_0x2556d5);},'fTnhI':_0x313705(0x8f6,-0x5aa,0x1125,-0x2e9),'hvXbV':function(_0x534728,_0x450425){return _0x534728(_0x450425);},'SXIno':_0x23937d(0x7c8,0x503,-0x1d4,0x885)+'ifu.pics/a'+_0x23937d(0x148f,0x1b92,0x166f,0xe7d)+'o','EoxfV':_0x23937d(0xde1,0x1025,0x19f4,0x9d1)+'e','WoiOA':function(_0x38a888,_0x444690){return _0x38a888(_0x444690);},'QdKRm':function(_0x529d62,_0x2d0f9b){return _0x529d62(_0x2d0f9b);},'SfvgG':_0x313705(0x200a,0x14de,0x19a8,0x28e2),'NPKxn':'animepat','IUTEW':function(_0x35b24a,_0x2b8175){return _0x35b24a(_0x2b8175);},'Bjaxo':function(_0x52730a,_0x5b9819){return _0x52730a(_0x5b9819);},'djxoO':'animehug','hCcoI':function(_0x212cdc,_0x5884cb){return _0x212cdc(_0x5884cb);},'VLbWm':'animekiss','ofrnl':function(_0x9ed8da,_0x209920){return _0x9ed8da(_0x209920);},'tJnOr':function(_0xe410d0,_0x3cadb6){return _0xe410d0(_0x3cadb6);},'vwiwR':_0x23937d(0x1749,0x9b5,0x159c,0x2331),'RmECz':_0x23937d(0x1726,0x1f31,0x1ced,0x1c7d),'HAsYB':function(_0x4f85ad,_0x4aa6fc){return _0x4f85ad(_0x4aa6fc);},'tnswH':function(_0x2bdadb,_0x5357b9){return _0x2bdadb(_0x5357b9);},'ZMFKj':_0x313705(0x96e,0xf81,0x908,0x1480),'nWCiP':function(_0x4bcc3c,_0x24ff3e){return _0x4bcc3c(_0x24ff3e);},'nDZfw':'animekill','fGIGd':'animelick','jCPsa':function(_0xaa125b,_0x118020){return _0xaa125b(_0x118020);},'ibgHF':_0x23937d(0x55d,-0x174,0x99c,-0x595),'BHcsr':function(_0x4441c9,_0x36e6a2){return _0x4441c9(_0x36e6a2);},'GrBxd':_0x313705(0x1a37,0x1260,0xd59,0x1b83),'BLgph':_0x313705(0x114d,0xc35,0x1d2f,0x4a6),'smPzm':function(_0x3d1cbc,_0x3114bd){return _0x3d1cbc(_0x3114bd);},'KVZtV':_0x313705(0x973,0x1210,0x17e6,0x10b1),'Jeoys':function(_0x1c33e6,_0x5132f6){return _0x1c33e6(_0x5132f6);},'BJNpN':_0x313705(0x1316,0xecd,0xcbc,0x133d),'yblKm':function(_0x229309,_0x57c2d0){return _0x229309(_0x57c2d0);},'XciKP':_0x23937d(0x862,0xaa5,0x6e2,0x16a9),'VsouW':function(_0x395d9d,_0x43a389){return _0x395d9d(_0x43a389);},'wEXFo':'animeawoo','UYman':function(_0x5c6d05,_0x340859){return _0x5c6d05(_0x340859);},'UMnjh':_0x313705(0x5cc,-0x230,0xf52,-0x2e4),'XKlLT':_0x313705(0x201a,0x2d99,0x2529,0x138d),'qvxui':function(_0x272c94,_0x596531){return _0x272c94(_0x596531);},'HAJAJ':'animeglomp','ENlIm':function(_0x47cfb4,_0xd8bdfb){return _0x47cfb4(_0xd8bdfb);},'oEVZm':'animehappy','yCiqQ':function(_0x321c07,_0x154313){return _0x321c07(_0x154313);},'VQenC':function(_0x13a431,_0x37c7be){return _0x13a431(_0x37c7be);},'XxbiY':_0x313705(0x205e,0x2297,0x1c36,0x1b53),'onLZE':function(_0xeae16f,_0x28ceab){return _0xeae16f(_0x28ceab);},'ikfil':function(_0x497dc7,_0x36fb29){return _0x497dc7(_0x36fb29);},'MUkYk':function(_0x4fdcbe,_0x231495){return _0x4fdcbe(_0x231495);},'xaLYm':_0x23937d(0x56,-0x746,-0x442,-0x719)+_0x313705(0x1ef4,0x171b,0x28fc,0x2d66),'lPctf':_0x23937d(0x1162,0x181d,0xb4e,0x1f2f)+_0x313705(0x11b5,0x1cf6,0x1fce,0x1f77),'zJNbN':function(_0x14a503,_0x3317c6){return _0x14a503(_0x3317c6);},'OLoQc':function(_0x248c64,_0x3d3a19){return _0x248c64(_0x3d3a19);},'kGmee':_0x23937d(-0xd,-0x7e8,0xb85,-0x3aa)+'in','ynVrb':_0x313705(0x20e9,0x1644,0x1207,0x2bc3),'jajTx':function(_0x58a9dc,_0x246921){return _0x58a9dc(_0x246921);},'cOcaF':function(_0x2ca732,_0x4c723f){return _0x2ca732(_0x4c723f);},'MIztE':_0x23937d(0x1d8b,0x128f,0x1795,0x2309),'FPBQU':function(_0x3c1f70,_0x4721d2){return _0x3c1f70(_0x4721d2);},'dbUtC':'https://wa'+_0x313705(0x19af,0xddd,0x203e,0x1734)+'pi/sfw/meg'+'umin','ltAdH':function(_0x7af9f0,_0x3a95e1){return _0x7af9f0(_0x3a95e1);},'wDOPw':_0x313705(0x949,0x11a8,0x8d,0x946)+_0x313705(0x2127,0x3039,0x2198,0x2f72),'rAZcI':function(_0x790413,_0x4731d9){return _0x790413(_0x4731d9);},'yFYwz':function(_0x5e869e,_0x49341d){return _0x5e869e(_0x49341d);},'vNWWF':function(_0x8a12d9,_0x3f8b2c){return _0x8a12d9(_0x3f8b2c);},'AcQLc':_0x313705(0x1b78,0x23a2,0x1232,0x1ce3)+_0x23937d(0x16cc,0x1833,0x1e7d,0x20e4)+_0x313705(0x125c,0x1774,0x1e4e,0xbb8),'cxqcb':_0x23937d(0x634,0x557,0x3da,-0x1ce),'pgzcI':function(_0x570346,_0x50a464){return _0x570346*_0x50a464;},'LHWwg':_0x23937d(0x1ba4,0x2764,0x2abb,0x1b9b),'TSXqo':'kill','prLKf':_0x313705(0x12b7,0x840,0x556,0x18e6),'DFFKq':_0x313705(0x181b,0xf27,0xde5,0xc77),'LxSvj':_0x23937d(0x4af,-0x83f,0x55e,0x13),'IfGge':_0x23937d(0x1a0b,0x1e7b,0xb32,0x27af),'aDSIm':'bite','TAivz':'yeet','VrwNa':_0x313705(0x2091,0x152b,0x14b7,0x2427),'HrpmG':_0x23937d(0x2e1,0xe79,-0x4d1,0xb52),'wIwax':_0x313705(0x96b,0x6c2,0x76e,0x1338),'GCzmJ':_0x313705(0x1139,0x10f2,0x898,0x1d39),'uqXze':'wave','MTWNO':_0x23937d(0x936,0xa47,0xab5,0xb5f),'wNLMc':'glomp','FlrTt':_0x313705(0x585,0x475,0x129c,0xe49),'hZvIe':_0x313705(0x1e26,0x2c8c,0x236f,0x21dd),'eibDN':'cringe','PJfSZ':_0x313705(0x11b7,0x1ad2,0x1c99,0x1f07),'OZmPD':_0x313705(0xb84,0x983,0x186,0x100f),'FOHYp':'shinobu','AaaWG':_0x23937d(0x50,0x140,0x8ce,0x9c0),'LIulG':'handhold','GqIwc':function(_0x442385,_0x31ff58){return _0x442385(_0x31ff58);},'SMoHH':'waifu','ICbZx':_0x23937d(0x32,0x6ff,-0x4b5,0xd3d),'pmvKc':function(_0x5cb243,_0x51412c){return _0x5cb243(_0x51412c);},'qPAKf':'naruto','WcSsP':_0x313705(0x20fc,0x24d3,0x28bd,0x2564),'PYQts':'naruto\x20bor'+_0x313705(0xdd7,0xaac,0x1b7e,0x3a4),'aNcik':'naruto\x20sas'+_0x313705(0x1c05,0xea0,0x1b31,0xf02),'JVOEJ':_0x23937d(0x8ba,0x851,0xa8d,0xdb6)+'thetic','aKBoh':function(_0x3bc3aa,_0x11cf40){return _0x3bc3aa(_0x11cf40);},'gKtMi':_0x23937d(0x12f1,0x407,0x17bc,0x898),'dXwif':'yaoi\x20aesth'+'etic','PlfTf':_0x313705(0x1af2,0x14d3,0xefa,0x1aa2),'egfAf':'yaoi\x20gante'+'ng','JHUvu':function(_0x5c701c,_0xca71b4){return _0x5c701c(_0xca71b4);},'NduuR':function(_0x3dcedf,_0xf801fb){return _0x3dcedf(_0xf801fb);},'fhKSv':'Next➡️','DzSIe':_0x313705(0xd04,0xbed,0xbf4,0xde9),'lEaaR':_0x23937d(0xb25,0x41b,0x7e7,0x501),'JEWLL':function(_0x44dc1f,_0x1ea554){return _0x44dc1f!==_0x1ea554;},'JQiDe':_0x23937d(0x1377,0xf7d,0xd65,0x1c49),'jyron':function(_0x5cefcb,_0x1de7c3){return _0x5cefcb(_0x1de7c3);},'IzAeB':_0x23937d(0xc7e,0x2f7,0x381,0x18e2)+'ffee.alexf'+_0x313705(0x1873,0xe61,0xcf8,0x1157)+_0x313705(0x51c,0xc44,-0x4ef,0xcf3),'suEDW':'zippyshare','xPhBS':function(_0x24110a,_0x25b4fe){return _0x24110a(_0x25b4fe);},'YCdyy':function(_0x2e8703,_0xa2743){return _0x2e8703(_0xa2743);},'FFJwO':_0x23937d(0x19f2,0x1237,0x229e,0x2302)+_0x23937d(0x62,0xd33,0x37f,-0x44d),'JNVfB':function(_0x227d4a,_0x3c7bb4){return _0x227d4a(_0x3c7bb4);},'rIeQK':'applicatio'+'n/zip','oESpC':function(_0x18df6f,_0x32f7a0){return _0x18df6f(_0x32f7a0);},'EHqBF':function(_0x57bf3c,_0x2b46a0){return _0x57bf3c(_0x2b46a0);},'HNeTJ':'jail','LOrtq':_0x313705(0xb1e,-0x1c4,0x5fd,0x1990),'WdhOr':_0x313705(0x1b93,0x1443,0xe47,0x2951)+'ebp','lwQSG':_0x23937d(0xe01,0x14fc,0x7c2,0x1074),'ULAwg':'invert','UXsXj':'wanted','LBXNP':'rip','tHITm':function(_0x4eac34,_0x5b2bfc){return _0x4eac34(_0x5b2bfc);},'gjDkG':function(_0x5df5ff,_0x275197){return _0x5df5ff(_0x275197);},'LRWFy':function(_0x8f99b6,_0x5e1ab0){return _0x8f99b6(_0x5e1ab0);},'wtoPd':'gayeffect','vzoRh':_0x23937d(0x334,-0x592,0x8aa,0x6b),'nfhTp':function(_0x56d8fb,_0x119f8d){return _0x56d8fb(_0x119f8d);},'IUSaz':function(_0x44dd50,_0x119b61){return _0x44dd50(_0x119b61);},'AMeBy':_0x23937d(0x8e5,0x1687,0x11c,0x30b)+_0x23937d(0xd97,0x86d,0x79a,0xa9a),'ckjxp':function(_0x1d18ca,_0x20d435){return _0x1d18ca(_0x20d435);},'lzDjU':_0x313705(0x19e4,0x1a4b,0x2614,0x10c2),'uavLE':function(_0x62aedf,_0x523b42){return _0x62aedf(_0x523b42);},'nCVTK':function(_0x2de3d3,_0x9683fb){return _0x2de3d3(_0x9683fb);},'gEDEv':function(_0x1b9370,_0x3de0ad){return _0x1b9370(_0x3de0ad);},'enluE':'beautifule'+_0x313705(0x18ed,0x147d,0x1cc6,0x2690),'uajDU':function(_0x16c137,_0x2da93b){return _0x16c137(_0x2da93b);},'NLscf':function(_0x1ccdcc,_0x20f91c){return _0x1ccdcc(_0x20f91c);},'uBlcW':_0x23937d(0x1192,0xdd6,0xff0,0x17d5),'rZMKn':_0x313705(0x9e6,-0x203,0x143f,0x13a0),'TWgco':function(_0x3a69b2,_0x1d0602){return _0x3a69b2(_0x1d0602);},'kNWrI':function(_0x56677a,_0x3e27a2){return _0x56677a(_0x3e27a2);},'DAhCF':function(_0x297d0b,_0x39035a){return _0x297d0b(_0x39035a);},'Svbun':function(_0x151585,_0x31ca9f){return _0x151585(_0x31ca9f);},'BKpMV':_0x23937d(0x541,0xbf,0xb6a,0x1dd),'CUTaW':_0x313705(0xfc6,0x1d64,0x858,0x790),'gSFnc':function(_0x4be835,_0x304ac0){return _0x4be835(_0x304ac0);},'ohrKB':function(_0x1fa2ab,_0x24d1b2){return _0x1fa2ab===_0x24d1b2;},'UIzHg':_0x23937d(0xa82,0x3cb,-0x13b,-0x284),'Gahld':function(_0x3fe1b4,_0x1c50b6){return _0x3fe1b4!==_0x1c50b6;},'FicFK':_0x23937d(0xd38,0x195d,0x677,0x1883),'uKKTk':_0x23937d(0x19a2,0x12a7,0x2051,0x164f),'ZywuT':_0x23937d(0x3db,0x1276,0xfd5,0xd2b),'AHVmy':function(_0x39e95f,_0x580a52){return _0x39e95f(_0x580a52);},'tuvOf':function(_0x1e9fb5,_0xa3006b){return _0x1e9fb5(_0xa3006b);},'OYHfM':function(_0xd87326,_0x1a156a){return _0xd87326(_0x1a156a);},'nZCrd':_0x313705(0x138d,0x1940,0x1dde,0x209d),'MbDVf':_0x23937d(0x1dd8,0x2247,0x29bd,0x2087),'cxtjY':'DchkP','PvMko':function(_0x488bf5,_0x26eb4b){return _0x488bf5===_0x26eb4b;},'NAdwJ':function(_0x5bdc78,_0x5f51e8){return _0x5bdc78(_0x5f51e8);},'aosiA':'translate','OYfFH':_0x23937d(0x12e6,0x6f6,0x1cbb,0xf3a),'OfkFT':_0x23937d(0xae8,0x18b3,0x17a3,0x36a),'LYNqD':_0x23937d(0x1a2c,0x112c,0xdf0,0x1802),'JYUUI':function(_0xdf96fc,_0xaceb26){return _0xdf96fc(_0xaceb26);},'dZaCg':_0x23937d(0x1185,0x18e3,0x13d4,0x1de4),'HIihx':_0x313705(0x3a6,0x45d,0x80,-0x4fb),'frJET':_0x23937d(0x697,-0x3f7,0x41c,0x154d),'bZxNc':_0x23937d(0x1389,0x1715,0x7ed,0xb99),'Bhlfp':_0x313705(0x149e,0xde8,0x2335,0x1f07),'SrtYq':_0x23937d(0xf0,0xca1,0x6d8,-0x36d),'aSvxM':_0x23937d(0x1362,0x2193,0xf18,0x15c9),'YboDa':'demon','wNCJS':_0x23937d(0x15a1,0x1d17,0x1645,0x1c1c)+'r','SiJce':_0x23937d(0x16e8,0x2163,0x244a,0x1b6e),'jucGq':_0x23937d(0x5f1,0xa03,0x2c0,0x55),'lBvfC':_0x313705(0x2117,0x135d,0x1327,0x16f3),'frcIV':_0x313705(0x9f3,0xf43,-0x1f5,0x787),'uDqmu':_0x313705(0x1b6a,0x12f6,0x1572,0x18df)+'r','bGaFN':_0x313705(0x927,0x15d6,0x17ce,-0x41a)+'s','ttNgQ':_0x313705(0x59b,-0x8c9,0xa70,0x4e8),'EbJJP':_0x23937d(0x164a,0x2096,0x1392,0x17c2),'sxOgl':_0x313705(0x9cd,-0x133,0x8fa,0xb54)+'ke','NRMLw':_0x313705(0x418,0x2e2,0xa41,0x4cc),'LADgk':_0x23937d(0xa28,-0x277,0x1351,0x193),'fkqQw':_0x23937d(0x1ac,0x7a1,0x6c6,0x582),'OmLxM':_0x313705(0x20b6,0x2e65,0x2f2e,0x1869),'AAndQ':_0x23937d(0xe3d,0x10fa,0x1482,0x9c3),'VmRle':_0x313705(0x637,0x52e,0x66a,-0x319),'kdQCI':_0x23937d(0x3d1,-0xe4,-0xa14,0x990),'AlIof':_0x313705(0x20c5,0x139c,0x2841,0x1454),'tZuIf':'blood','rPInw':_0x23937d(0x1846,0x10f9,0x17d9,0xd67),'obGhY':_0x23937d(0xd36,0x1b51,0x73d,0x17de),'UduSc':_0x313705(0xc3b,0x1b1b,0xe01,0x17cd),'dRoVe':_0x23937d(0xbf8,0xbd0,-0x1f3,0xad1),'oiMLZ':_0x23937d(0xca6,-0x4,0x1341,0x1212),'MzUey':_0x313705(0x1e71,0x2ad1,0x28a7,0x1e7e),'ajCqk':'joker','kzxja':_0x313705(0x434,0xf2e,-0x55e,0xdb6),'oFmcg':'firework','myYLC':_0x313705(0xd4f,0x91,0x22a,0xa76),'vpPda':_0x313705(0x783,0x4b,-0x548,0x1165),'QIfcc':_0x313705(0x1769,0x1dce,0x1dec,0x1c9b),'zaHOX':_0x23937d(0x1181,0x1484,0x6b4,0x15b1),'pokCR':_0x23937d(0x962,-0x3d4,0xf3c,0x5d0),'JkxBH':function(_0x8613c6,_0x5ca90d){return _0x8613c6(_0x5ca90d);},'AIlZZ':function(_0x4bfcf3,_0x4cef69){return _0x4bfcf3+_0x4cef69;},'AuuPJ':function(_0x58945d,_0x2366dc){return _0x58945d(_0x2366dc);},'rmhdY':_0x313705(0x163a,0x1032,0x177b,0xe8f)+_0x23937d(0x1106,0x14d0,0x2f9,0xda9)+'hristmas-t'+_0x313705(0x1a4d,0x15b2,0x288f,0x11e5)+_0x23937d(0x139e,0x2190,0x1ecd,0xe38)+_0x23937d(0x10d,0xa6d,0x3fb,0xae5)+_0x313705(0x17d5,0x2130,0x1432,0xfa7),'iiFAX':_0x313705(0x163a,0xdd2,0x1d7f,0x947)+_0x313705(0x19ee,0x249c,0x1eda,0x1c42)+'d-christma'+_0x23937d(0x290,0xd73,-0x96f,0x74f)+_0x23937d(0x9b2,-0x348,0x1732,0xb00)+_0x313705(0xe18,-0x60,0x142a,0x878)+'l','QgnOX':'https://te'+_0x313705(0x15e8,0x1ebc,0x6eb,0xc30)+'parkles-me'+_0x23937d(0x1b34,0x1f5a,0x170e,0x1b62)+_0x313705(0x1fa7,0x2c46,0x112b,0x1b5d)+_0x313705(0x1f16,0x2d9e,0x1d29,0x1ef1)+'.html','lRzgi':_0x23937d(0x12d4,0x20c8,0x19dd,0x5ff)+_0x313705(0x146c,0x1314,0x603,0x1eaf)+_0x313705(0x77f,0xe71,0x671,0x10f6)+'eep-sea-me'+'tal-text-e'+_0x23937d(0x139e,0x1d11,0x12ca,0x9d3)+_0x313705(0x1267,0x1de7,0x113b,0x1345)+'ml','reZdk':_0x23937d(0x12d4,0xaae,0xba3,0xd2f)+_0x313705(0x146c,0x7ec,0x1907,0x18c1)+'reate-3d-s'+'ci-fi-text'+'-effect-on'+'line-1050.'+'html','TENpi':_0x23937d(0x12d4,0x1413,0x12c4,0x1cee)+'xtpro.me/3'+_0x23937d(0xbe,-0x835,0x7d7,-0x25f)+_0x313705(0xea1,0x48e,0x1a5e,0x3f)+_0x313705(0x5ec,0xfdc,0x84b,-0x39d)+_0x23937d(0x525,0x147,-0x5ef,-0x1c8)+_0x23937d(0x2d9,0xac6,0x27f,-0x780),'JZEJI':_0x23937d(0x12d4,0x1496,0x12fc,0x9b8)+_0x23937d(0x1106,0x1235,0x15ff,0x150f)+_0x313705(0x9bb,-0x9c,0x215,0x1bb)+'oween-skel'+_0x313705(0x1ec0,0x2d71,0x26c9,0x283b)+'effect-onl'+_0x23937d(0x164c,0xac7,0x1557,0x1c3a)+_0x313705(0x1411,0x88d,0x1b57,0xe20),'OjkTv':_0x23937d(0x12d4,0x1ec4,0x1239,0x1fb9)+_0x23937d(0x1106,0xae5,0x106c,0x9fc)+_0x23937d(0x42c,-0x285,-0x199,0x741)+_0x23937d(0x113e,0x10cc,0xb87,0x1a67)+_0x23937d(0xa7f,0x577,0x11dc,0xeb0)+_0x23937d(0x699,0x732,0x9c6,0x1372)+_0x313705(0x1726,0x8ca,0x243d,0x17a5)+_0x313705(0x1411,0x1481,0x2138,0xabf),'aKsZW':_0x23937d(0x12d4,0xfe6,0xc25,0xfbd)+_0x23937d(0x1106,0x16da,0x44d,0x691)+_0x313705(0x1356,0x1a93,0x21cb,0x14f7)+_0x23937d(0x976,0xa2e,0x1533,0x1754)+_0x23937d(0x425,-0x41e,-0x342,-0x301)+_0x313705(0x1b4e,0xe4d,0x2401,0x1968)+'2.html','agKiA':_0x313705(0x163a,0x1f03,0x22e1,0xf0d)+_0x313705(0x146c,0xa44,0x14a2,0x122e)+_0x23937d(0x351,0x858,0x1018,0x6c9)+_0x313705(0x14d2,0x1d5a,0x752,0x1eab)+_0x23937d(0xe1d,-0x3,0x45f,0x126)+_0x313705(0x4b2,0x5b1,0xeb5,0x7f6)+_0x23937d(0x1829,0x1b58,0xa46,0xf17)+_0x313705(0x1411,0x1842,0xb74,0x1504),'JKPFU':'https://te'+_0x23937d(0x1106,0x12b3,0x1e78,0x1018)+_0x313705(0xece,0x16da,0x56a,0x1cf5)+_0x313705(0x1118,0xfeb,0x93e,0x1acb)+'n-text-eff'+_0x313705(0x8b6,0x143a,0xd7d,0x605)+_0x313705(0x19e3,0x1f96,0x167b,0x1188)+_0x23937d(0x1760,0x19f7,0x1dec,0x1f86),'Edkfe':_0x313705(0x163a,0x2095,0x1b7c,0xc46)+'xtpro.me/c'+_0x23937d(0x681,0x17f,0x10b,0x128c)+_0x23937d(0x13c,0xa21,-0x78b,0xb12)+_0x23937d(0xa7f,0x10cb,0x1af,0x312)+_0x23937d(0x699,0xa79,-0x38,0x1183)+'ine-1036.h'+_0x313705(0x1411,0xa6c,0x1d4d,0x1bc9),'VmOvb':'https://te'+_0x23937d(0x1106,0x5a1,0x17d1,0x52d)+_0x313705(0x16d0,0xcd2,0x1531,0x25bb)+_0x313705(0x6b6,-0x846,-0x6e,-0x671)+'text-effec'+_0x23937d(0x7b2,0x310,-0x3af,-0x4c)+_0x313705(0x3c2,0x8e8,0xcbf,0x685),'skRXC':_0x313705(0x163a,0x1df4,0x1f80,0x18d8)+'xtpro.me/o'+'nline-thun'+_0x23937d(0x71c,0x683,0xcdd,0x31b)+_0x313705(0x157b,0xe92,0xcb2,0x10bb)+'rator-1031'+_0x313705(0x1ac6,0xe30,0x14ad,0x1e59),'EqNeu':_0x313705(0x163a,0x2074,0x1778,0x22d0)+_0x313705(0x146c,0x16d5,0x917,0xe53)+_0x23937d(0x1a23,0x1981,0x1925,0x1ad6)+'gma-hot-te'+_0x313705(0x88b,0x12df,0xa89,0x787)+_0x313705(0x1407,0x1139,0x1739,0x20e2)+_0x313705(0x14b4,0x11cd,0x238e,0x991),'eaabI':'https://te'+_0x313705(0x146c,0x1516,0xada,0x161e)+'reate-a-3d'+'-stone-tex'+_0x23937d(0x1a71,0x1945,0x1560,0x1a27)+'nline-for-'+_0x23937d(0x1292,0x1d9c,0xb78,0x947)+_0x23937d(0x57,0x873,-0x520,0xe5f),'zychw':'https://te'+_0x23937d(0x1106,0x1116,0x985,0x1737)+_0x23937d(0x11a0,0x1fcd,0xd93,0x1e8e)+_0x313705(0xb8c,0x55b,-0x2cf,0x6b6)+_0x313705(0x1183,0x125f,0x146e,0x461)+'t-online-1'+_0x313705(0x1ee7,0x1de8,0x14b9,0x2ca2),'PhUGU':_0x23937d(0x12d4,0x1fc9,0x1e76,0x16e9)+_0x23937d(0x1106,0x10ad,0xd80,0xd4b)+'reate-harr'+_0x23937d(0x980,0x8e4,0x1784,0x6a3)+'ext-effect'+'-online-10'+_0x313705(0xbe0,0x1022,0x1710,0x345),'ulTbm':_0x23937d(0x12d4,0x19b9,0x5d9,0x1dd1)+_0x313705(0x531,-0x4e8,-0x11f,0xf4c)+_0x23937d(0x635,0x422,0x192,0xf47)+_0x23937d(0x290,-0x113,0x459,0x3f3)+_0x23937d(0x72d,-0x208,0x704,0x583)+_0x23937d(0x18f9,0x1afa,0x2303,0x1f07)+_0x313705(0x1ac6,0x1fb3,0x289b,0x24f1),'tpYNt':_0x23937d(0x12d4,0xe6c,0xa09,0x128e)+_0x23937d(0x1106,0x1ec1,0xfca,0x27a)+_0x313705(0x1e0d,0x18bd,0x2ad6,0xf5c)+'ee-online-'+_0x313705(0x59b,-0x838,0x92a,0x317)+_0x23937d(0x6bb,0x838,0x5f9,0x14a9)+_0x23937d(0x1b4,0x11c,-0xc6a,-0x58d)+'ml','FBDFz':_0x313705(0x163a,0xf37,0xb71,0x21b4)+_0x23937d(0x1b1a,0x132b,0x25fb,0x1e89)+'nline-mult'+'icolor-3d-'+'paper-cut-'+'text-effec'+'t-1016.htm'+'l','akgpu':_0x313705(0x163a,0x1568,0xd93,0xd3b)+_0x313705(0x146c,0x1582,0x640,0x62c)+_0x23937d(0x30e,0x9e2,-0x477,0xb45)+_0x23937d(0x193c,0xe51,0xede,0x1a6e)+'gs-text-ef'+_0x313705(0x662,-0x466,0xc52,-0x5d3)+'e-free-101'+_0x23937d(0x1bc,-0x747,-0xce8,0x7d8),'NtwAG':_0x23937d(0x12d4,0xff9,0xeed,0xe4a)+_0x313705(0x19ee,0x1db0,0x1808,0x1f4f)+_0x23937d(0x12ca,0x1d25,0x1648,0x607)+_0x313705(0x20d0,0x278e,0x277f,0x24ea)+_0x313705(0x6c4,0x99e,0xc68,0x9fc)+_0x313705(0x19bb,0x1dab,0x1398,0xde7)+_0x313705(0x5e9,0x9ba,0xe23,-0x20a)+'l','lfHqN':'https://te'+_0x313705(0x146c,0x1ea2,0x1ea1,0x1c84)+'reate-wond'+_0x23937d(0x833,0x1753,-0x42f,0x910)+_0x23937d(0x482,-0x352,-0x69f,-0x687)+'ext-effect'+_0x23937d(0x14ae,0x978,0x1534,0x1b85),'iHQCf':_0x313705(0x163a,0x22e4,0x1c67,0x15c3)+_0x23937d(0x1106,0x1310,0x62b,0x327)+_0x23937d(0x1457,0x1cf1,0x95f,0x697)+_0x23937d(0x12e2,0xda6,0xb89,0xe2d)+_0x313705(0x600,0xe5f,0x6f6,-0x26d)+_0x313705(0x16dc,0x1a22,0x106c,0x15b6)+_0x23937d(0x12a5,0x217d,0x14d7,0x7d3)+'tml','KfCKb':_0x313705(0x163a,0xbd9,0x14ea,0x2348)+'xtpro.me/h'+_0x313705(0x417,0xc61,0x8a1,0x2e6)+'effect-868'+_0x23937d(0x1760,0xa46,0xc55,0x1b16),'wKzye':_0x313705(0x163a,0x212d,0x2280,0x2331)+_0x313705(0x1e41,0x2215,0x115b,0x1a3e)+_0x313705(0xb4c,-0x1af,0x10fd,0x13c9)+'-text-effe'+_0x313705(0x1ed9,0x1357,0x1f7c,0x1785)+'l','SxbbY':'https://te'+_0x313705(0xe80,0x123a,0x10ec,0x657)+'ood-text-e'+_0x313705(0xf67,0x1aa5,0x5c6,0xdb2)+_0x23937d(0x57,-0x463,-0xac5,-0x9c6),'tjXWK':_0x313705(0x163a,0x1e9f,0x1c51,0xfea)+'xtpro.me/c'+_0x313705(0x8b1,0x1560,0xd3e,0xd04)+_0x313705(0xee1,0x18b6,0x1ca3,0x11e)+_0x313705(0x66e,0xba9,0x7ac,0x1b0)+_0x23937d(0x57,0x76e,0x5f7,0x43c),'TsOfo':_0x23937d(0x12d4,0xa30,0x109f,0x1fcd)+_0x313705(0x15e8,0xc60,0xb62,0x113e)+_0x313705(0xc09,0x13a,0x845,0x1510)+_0x313705(0x1183,0x1e62,0xad8,0x1944)+_0x313705(0x2144,0x153d,0x2985,0x2039)+_0x23937d(0x61,-0xd98,0x778,0xeeb),'aTuie':_0x313705(0x163a,0x143c,0xc27,0x1ead)+_0x313705(0x1c0c,0xdea,0x26cc,0x1f26)+_0x23937d(0x5a0,-0x69f,0xb6,0x1052)+'e-text-eff'+_0x23937d(0x550,0x7be,0x87c,0x9ea)+_0x313705(0x1de9,0x1798,0x2c01,0xf1f),'IZpnF':_0x313705(0x163a,0xdb6,0x227b,0xbfc)+_0x313705(0x1d59,0x2489,0x2376,0x28d6)+_0x23937d(0x1305,0x44d,0x1652,0x8dc)+'d-text-eff'+_0x23937d(0x550,-0x17c,0x310,-0x293)+_0x313705(0x1593,0x16d5,0x1f52,0x2030),'waKMc':_0x23937d(0x12d4,0x113e,0x99a,0x7ce)+'xtpro.me/t'+_0x313705(0xe08,0x580,0x12ea,0x8f1)+_0x313705(0x9ff,0x80f,-0xde,0x15ee)+'ine-901.ht'+'ml','Rrwur':_0x23937d(0x12d4,0x1208,0x88a,0x21da)+_0x23937d(0xa9a,0x188b,0xe9c,0x95d)+_0x23937d(0x93e,0x1f4,0x5b4,0x9ca)+_0x313705(0x1704,0xf20,0x96e,0x12e1)+_0x313705(0x1a74,0xee2,0x1b42,0x231f)+'l','LrtXX':'https://te'+'xtpro.me/r'+'ock-text-e'+_0x313705(0x1704,0xdee,0xa3e,0x138f)+'ne-915.htm'+'l','oVIJK':_0x23937d(0x12d4,0x1097,0x1d02,0x1496)+'xtpro.me/b'+'lood-text-'+_0x313705(0x9b2,0xf7a,0x46,0xb65)+_0x23937d(0x724,0xd1a,0x35a,0x1309)+_0x313705(0x2031,0x1e5d,0x20de,0x183e),'IywxJ':_0x313705(0x163a,0x79b,0x950,0xc94)+_0x23937d(0x18a6,0x19fd,0x23c2,0x1059)+'etal-dark-'+_0x313705(0x36b,-0x333,0xee1,-0xa85)+_0x313705(0x9ff,0x1145,0x136c,-0x2d8)+_0x313705(0x20f6,0x136a,0x12ab,0x2a84)+'ml','qBunB':_0x23937d(0x12d4,0xef0,0x21a7,0x1ec8)+_0x313705(0x146c,0x1f4a,0x1e25,0x55c)+_0x23937d(0xc3e,0xe7e,0x2b6,0x123)+_0x23937d(0x18b1,0x106a,0xdf7,0x1e62)+_0x313705(0x19d3,0x1d83,0x1813,0x110c)+'ml','wbhFI':'https://te'+_0x23937d(0xb1a,0x13e2,0x4d9,0xd51)+'icker-text'+_0x313705(0x15ae,0xae1,0x1476,0x1768)+_0x313705(0x1809,0xfb9,0x25be,0x16e9)+_0x313705(0x1411,0xc0b,0x1fb7,0x229c),'rxTRt':_0x313705(0x163a,0x24d9,0x108b,0x1fcb)+'xtpro.me/f'+'irework-sp'+_0x313705(0x52d,0x91c,0x1033,0x4b4)+_0x23937d(0x1550,0x721,0x2465,0x17a6)+_0x313705(0x14b4,0x152d,0xdf6,0x6d4),'hZsJw':_0x313705(0x163a,0xc54,0x1b37,0x1656)+'xtpro.me/s'+_0x23937d(0x835,-0x1b1,0x652,0xc42)+_0x23937d(0x525,0xb1,0xacb,0xe0d)+_0x23937d(0xd6b,0x629,0x979,0x16ba)+'.html','xBYVg':'https://te'+'xtpro.me/w'+_0x313705(0x185f,0x2537,0x1a2d,0x235c)+_0x23937d(0x47,0x9e7,-0x54a,-0x462)+'beach-free'+'-online-99'+_0x23937d(0xf36,0x94e,0x7f2,0x1b1f),'pXzJH':_0x23937d(0x12d4,0xf7e,0x1c9c,0x1aca)+'xtpro.me/c'+'reate-3d-g'+_0x313705(0xeb5,0x151f,0xb30,0x17d6)+_0x23937d(0xd08,-0x1b7,0x9b,0xdb6)+_0x313705(0x1952,0x1d0c,0x1345,0x27be)+_0x313705(0x1032,0x962,0x1606,0x3c3)+_0x313705(0x1ac6,0x2223,0xcab,0x1153),'USSJJ':_0x23937d(0x12d4,0x61b,0xd1d,0x7c5)+_0x23937d(0xed0,0x1a2d,0x1327,0x1919)+'atural-lea'+_0x23937d(0xd39,0x1249,0x427,0xc76)+'ffect-931.'+_0x23937d(0x57,0xa51,0x6ba,0xc73),'mXyiy':_0x313705(0x11c6,0xaca,0x1245,0x1224),'JwXPP':function(_0xc3d05e,_0x3b4409,_0x4b6ba9){return _0xc3d05e(_0x3b4409,_0x4b6ba9);},'JJNkK':function(_0x5575b9,_0xfe904){return _0x5575b9(_0xfe904);},'YVngV':_0x23937d(0xdcc,0x8bf,0x244,0x1ec),'kGqhr':function(_0x31230b,_0x52927e,_0x54be4d){return _0x31230b(_0x52927e,_0x54be4d);},'qWmYa':_0x313705(0xb3a,0x18eb,0x125d,0x197e),'ppfkH':'neon','YxOsY':function(_0x59ccac,_0x1f75fa){return _0x59ccac(_0x1f75fa);},'sBhXn':function(_0x574dee,_0x35cf17,_0x424939){return _0x574dee(_0x35cf17,_0x424939);},'vebje':'matrix2','oTydp':function(_0x7658ea,_0x22be99){return _0x7658ea(_0x22be99);},'DWeRy':function(_0x3203cc,_0xcc3a56){return _0x3203cc(_0xcc3a56);},'qvtsc':function(_0x4878c6,_0x40c405){return _0x4878c6(_0x40c405);},'pEuXX':function(_0x546e68,_0x457d25,_0x36fb85){return _0x546e68(_0x457d25,_0x36fb85);},'gFPxK':'magma','clHCq':function(_0x407f51,_0x252668){return _0x407f51(_0x252668);},'GEdgw':'sand','aEyZL':_0x313705(0x7f8,0x16e7,-0x2de,0xef5),'wNaQJ':function(_0x48b84b,_0x2463f8){return _0x48b84b(_0x2463f8);},'xjvSb':function(_0x5391a6,_0x4d09b7){return _0x5391a6(_0x4d09b7);},'aKlAZ':_0x313705(0x210b,0x228b,0x1bfc,0x2097),'IQnfl':function(_0x1bbe70,_0x280954){return _0x1bbe70(_0x280954);},'Hobpj':function(_0x1c5d22,_0x1e4dbc){return _0x1c5d22(_0x1e4dbc);},'gpMgV':function(_0x46a650,_0x596c49,_0x389aad){return _0x46a650(_0x596c49,_0x389aad);},'VljgG':function(_0x17eee1,_0x4446c1){return _0x17eee1(_0x4446c1);},'HXSaL':function(_0x10938e,_0x36f2d9){return _0x10938e(_0x36f2d9);},'kVNpB':_0x313705(0x1338,0x1c27,0x1f95,0x96f),'fjAHA':function(_0x1f23c4,_0x43fd7a){return _0x1f23c4(_0x43fd7a);},'kyCNV':_0x313705(0x1d79,0x28a0,0x26f6,0x1b00),'WCQQU':_0x313705(0x12a7,0x3cd,0x1115,0x20e6),'JrKGy':function(_0x3b2ac0,_0x4731ed){return _0x3b2ac0(_0x4731ed);},'tloNj':function(_0x43b3c1,_0x3f0f2d){return _0x43b3c1(_0x3f0f2d);},'tudRV':function(_0x2ee314,_0x4dd7a3){return _0x2ee314(_0x4dd7a3);},'Krzhh':_0x23937d(0x3f4,-0x31e,-0xb0f,-0x1ea),'xSChK':_0x313705(0x1a87,0xca3,0x2400,0xc84),'yUBaU':function(_0x46462a,_0x48bef7){return _0x46462a(_0x48bef7);},'wLcPh':_0x313705(0x1ec3,0x17f4,0x184f,0x18d5),'ZtZsK':_0x23937d(0xd9e,0xb2f,0x210,0x1446),'Bjifn':_0x313705(0x1f80,0x117f,0x1738,0x188d),'lJSzU':function(_0x3ac602,_0x29b614){return _0x3ac602(_0x29b614);},'lSdCd':'fabric','kjbUa':function(_0x31a1a6,_0x5a0ab5,_0x4e8bcc){return _0x31a1a6(_0x5a0ab5,_0x4e8bcc);},'RVWEL':function(_0x5b5979,_0x145d67){return _0x5b5979(_0x145d67);},'mJaGI':function(_0x267e73,_0x59c5bf,_0x32803f){return _0x267e73(_0x59c5bf,_0x32803f);},'phAde':_0x313705(0x115c,0x1173,0xe2d,0xb1e),'deZwi':function(_0x4dbf32,_0x4378ca){return _0x4dbf32(_0x4378ca);},'ICWcV':function(_0x276a0a,_0x538c18){return _0x276a0a(_0x538c18);},'SNVEA':_0x23937d(0x4e2,0xb3d,0x9e3,0x1237),'OaJGK':'christmas2','rZKBl':function(_0x3f2362,_0x3fe03f){return _0x3f2362(_0x3fe03f);},'IUtWp':_0x313705(0x111b,0xc50,0xced,0xf97),'ZPfBi':function(_0x32c930,_0x3f70a2){return _0x32c930(_0x3f70a2);},'OTpjH':_0x23937d(0x574,-0x6cd,0x520,0x718),'TKcRQ':function(_0x83c43,_0x4daa27,_0x4e36f9){return _0x83c43(_0x4daa27,_0x4e36f9);},'FvHez':function(_0x2138da,_0x5ad27f){return _0x2138da(_0x5ad27f);},'MMLUH':_0x23937d(0x506,-0x236,0xcbe,0x47f),'rDBML':_0x23937d(0x8f9,0xae4,0xf94,0x125b),'ielzh':function(_0x112a57,_0x2ee298){return _0x112a57(_0x2ee298);},'cPjJw':function(_0x3ccb83,_0x2f9c8c,_0x392f8d){return _0x3ccb83(_0x2f9c8c,_0x392f8d);},'hAlLb':function(_0x4cd6e8,_0x380c25){return _0x4cd6e8(_0x380c25);},'ypivN':function(_0x5a7787,_0x3bb034){return _0x5a7787(_0x3bb034);},'ppWRa':'halloween2','XZpDT':function(_0x3e80dc,_0x2d6f71){return _0x3e80dc(_0x2d6f71);},'AMvMq':_0x313705(0x954,0x1297,0x1566,0x14d9)+'ire','CuVSX':_0x313705(0x194e,0xc0e,0xf05,0x1800),'JuMAq':function(_0x309263,_0x36eab6){return _0x309263(_0x36eab6);},'VvKnJ':function(_0xeb9e5,_0x342f4c){return _0xeb9e5(_0x342f4c);},'meusC':function(_0x57c402,_0x536988){return _0x57c402(_0x536988);},'OqlJR':_0x23937d(0x1b9e,0x13f6,0x2251,0x284e),'TiRBF':function(_0x4071b8,_0x45e971){return _0x4071b8(_0x45e971);},'HikMQ':'foggy','pKOjg':function(_0x1ecd5c,_0x1247db){return _0x1ecd5c(_0x1247db);},'kcZoC':_0x23937d(0x197,0x24,0x514,-0x849),'BDUik':function(_0x1204aa,_0x110ccd){return _0x1204aa(_0x110ccd);},'ZOYfy':function(_0x298a37,_0x5281d4,_0x344894){return _0x298a37(_0x5281d4,_0x344894);},'lWcEB':function(_0x3c9727,_0x1f299c){return _0x3c9727(_0x1f299c);},'WQUMl':_0x23937d(0x1468,0x9e0,0x1372,0xc31),'lKJBb':function(_0x5ea6bb,_0x4ac57d){return _0x5ea6bb(_0x4ac57d);},'PQCMz':'wonderful','HsgRH':'JmKnb','jGsoh':_0x23937d(0x1378,0xec7,0xf99,0x757),'QwldS':function(_0x64b8dd,_0x683940){return _0x64b8dd(_0x683940);},'wOqZl':'cool','cRvDE':_0x23937d(0x1cb5,0x2384,0x2543,0x2a6c),'nVWXZ':function(_0x35d5c2,_0x3d8d30){return _0x35d5c2(_0x3d8d30);},'LxUwt':function(_0x126bb9,_0x311f0f){return _0x126bb9(_0x311f0f);},'ZLnAQ':function(_0x52ba39,_0x4aa5a6){return _0x52ba39(_0x4aa5a6);},'sFhvW':_0x313705(0x189f,0x14d1,0x1c88,0xa00),'KtfPs':function(_0x2343e7,_0x4b069c,_0x98bf40){return _0x2343e7(_0x4b069c,_0x98bf40);},'IAqBi':function(_0x78123c,_0x417c4f){return _0x78123c(_0x417c4f);},'pRPyV':function(_0x24caf1,_0x2eadc6){return _0x24caf1+_0x2eadc6;},'lFfaS':function(_0x3119e2,_0x4ae0c5){return _0x3119e2(_0x4ae0c5);},'nWbeJ':function(_0x584d76,_0x12acc9,_0x4e1bc0){return _0x584d76(_0x12acc9,_0x4e1bc0);},'lKrkn':function(_0x51c88c,_0x379a79){return _0x51c88c(_0x379a79);},'gaIJV':function(_0x2f743e,_0x50b9bc){return _0x2f743e(_0x50b9bc);},'UvKrg':_0x23937d(0x12d4,0x944,0x1d90,0x4ea)+_0x313705(0x146c,0x229f,0x22ba,0x1180)+'reate-a-ci'+_0x23937d(0xf86,0x13ab,0x2eb,0x1dc0)+_0x313705(0x893,-0x549,0xcea,0x63e)+'effect-104'+_0x23937d(0x154e,0x900,0x83f,0x1d22),'fPqiN':function(_0x45f8cd,_0x5bd906){return _0x45f8cd(_0x5bd906);},'uwoUf':function(_0x429bfa,_0xd0c6ea){return _0x429bfa(_0xd0c6ea);},'wGmfK':function(_0x36b717,_0x261baf){return _0x36b717(_0x261baf);},'pQwFn':function(_0x625d3,_0x1fb9eb){return _0x625d3(_0x1fb9eb);},'YuJxl':_0x23937d(0x12d4,0x1e02,0x131a,0xdef)+_0x23937d(0x323,0x1d0,-0x525,0xffc)+_0x313705(0xb7e,0x499,0xc4e,0x263)+_0x23937d(0x12b3,0x14d6,0x1fc6,0x171f)+'bit-text-e'+'ffect-1037'+_0x23937d(0x1760,0x1d28,0x15b6,0x1c5c),'ZGDLI':'emoji','dEekz':_0x23937d(0x1566,0x18cf,0x1d75,0x23f3),'MKdOa':_0x23937d(0x1bac,0x25bc,0x24bf,0x1c9a),'DKkkJ':function(_0x557326,_0x26bb81){return _0x557326(_0x26bb81);},'QYEWL':'Where\x20is\x20t'+'he\x20emoji?','RrQVF':_0x23937d(0xaba,0x16a3,-0x2e5,0x2f3),'SsOzI':function(_0x6ed4ee,_0x4c1ae9){return _0x6ed4ee(_0x4c1ae9);},'cvKIN':function(_0x3eb50b,_0x448006){return _0x3eb50b+_0x448006;},'TUNVy':'iphoneemoj'+'i','VjwPj':function(_0x5a5b59,_0xca9c2a){return _0x5a5b59(_0xca9c2a);},'btkMH':_0x313705(0xae7,0x1114,0x595,-0x15d)+'i','EOVcd':function(_0x4a0013,_0x542e8c){return _0x4a0013+_0x542e8c;},'CogqD':function(_0x4b0a59,_0x2f4187,_0x2d4f42){return _0x4b0a59(_0x2f4187,_0x2d4f42);},'EOFVo':function(_0x3dacbf,_0x298a98){return _0x3dacbf(_0x298a98);},'lmQqK':function(_0x35198d,_0xd986de){return _0x35198d(_0xd986de);},'XhvWV':function(_0x23a872,_0x56b2ee){return _0x23a872+_0x56b2ee;},'WFzzY':_0x313705(0x8fd,0x782,0x4b6,0x537)+_0x313705(0x595,0x705,-0x399,0x3be)+'moji,\x20eg?','DKCiT':'microsofte'+_0x313705(0x16ac,0xb19,0x1026,0x14ca),'stshT':function(_0x5e181b,_0x983032){return _0x5e181b+_0x983032;},'GkvKG':function(_0x1fde3e,_0x6b72e8){return _0x1fde3e(_0x6b72e8);},'DFrus':function(_0x2faf37,_0x31b215){return _0x2faf37(_0x31b215);},'MrsCh':function(_0x802cda,_0x334d08){return _0x802cda+_0x334d08;},'dSEts':function(_0x3bfb9d,_0x14a1df){return _0x3bfb9d(_0x14a1df);},'WBBuR':function(_0x131ce3,_0x1c565f){return _0x131ce3(_0x1c565f);},'krYFa':function(_0x282a31,_0x89a453){return _0x282a31+_0x89a453;},'fjTAM':function(_0xdf1a70,_0x4ff7cd){return _0xdf1a70(_0x4ff7cd);},'gvgOX':_0x313705(0x4dd,-0x263,-0x948,0x215)+'oji','Gczgr':_0x313705(0x1c8a,0x1884,0x1b21,0x18bc),'yZCPC':function(_0x150bad,_0x16cf7e){return _0x150bad+_0x16cf7e;},'UDDlg':function(_0xb92319,_0x3d5f4d,_0x3f2999){return _0xb92319(_0x3d5f4d,_0x3f2999);},'gXPUD':function(_0x4b0c68,_0x3947fe){return _0x4b0c68(_0x3947fe);},'Iitmd':function(_0x4fc9c1,_0x27793d){return _0x4fc9c1+_0x27793d;},'XrYCT':function(_0x53aa73,_0x5eeac0){return _0x53aa73+_0x5eeac0;},'KuFbr':'joyemoji','Urfkt':function(_0x4a01a7,_0x3cc9f1){return _0x4a01a7(_0x3cc9f1);},'iQGcg':function(_0x3e5155,_0x80b90b){return _0x3e5155+_0x80b90b;},'VXdpK':_0x313705(0x18b7,0x2027,0xe4e,0xc15),'ufySp':function(_0x4c2de2,_0x573418){return _0x4c2de2+_0x573418;},'nzgVF':function(_0x94ca93,_0x465184){return _0x94ca93+_0x465184;},'IYXQq':function(_0x170297,_0xd4b279,_0x27af3f){return _0x170297(_0xd4b279,_0x27af3f);},'sFMhu':_0x313705(0x1931,0xd5a,0xbf5,0x1bb9),'cOojt':function(_0x55cb48,_0x3800c2){return _0x55cb48(_0x3800c2);},'iTawj':function(_0x431659,_0x146c4f){return _0x431659+_0x146c4f;},'mBXZr':function(_0x4c1251,_0x43a671){return _0x4c1251+_0x43a671;},'zwfTF':function(_0x1150a7,_0x317072){return _0x1150a7(_0x317072);},'LMTnC':function(_0x4c40b8,_0x3710f9,_0x4bb3f1){return _0x4c40b8(_0x3710f9,_0x4bb3f1);},'KrLfh':_0x313705(0x1be2,0x1e30,0x14a4,0x22f5),'yKYKB':function(_0x2f9a87,_0x372506){return _0x2f9a87+_0x372506;},'oyyPs':function(_0x1d842d,_0x445db2){return _0x1d842d(_0x445db2);},'QXWRh':_0x313705(0x1ab6,0x159b,0x1726,0x1f0e),'OQFsq':function(_0xa38853,_0x2669bc){return _0xa38853(_0x2669bc);},'VnNLO':'Reply\x20Imag'+'e','qAeIk':function(_0x4aa6f9,_0xff3fa9){return _0x4aa6f9+_0xff3fa9;},'gekCI':function(_0x120a9f,_0x3ae34f){return _0x120a9f(_0x3ae34f);},'CfbNa':function(_0x233cdc,_0x13ee86){return _0x233cdc(_0x13ee86);},'ciByz':_0x23937d(0x5ed,0x112c,0x102c,-0x356),'UBwiD':_0x23937d(0x1b60,0xda4,0x1d2a,0x1a4f),'yTwyT':'tovideo','XnVRQ':function(_0x11a6b4,_0x339f4c){return _0x11a6b4===_0x339f4c;},'KELTg':_0x23937d(0x1577,0x9b4,0x21c7,0x739),'PyLzl':_0x23937d(0x17ca,0x1cae,0x1dd4,0x131e),'LITPn':function(_0x3986cc,_0x46cdeb){return _0x3986cc(_0x46cdeb);},'kcpDa':function(_0x354657,_0x17dc24){return _0x354657(_0x17dc24);},'yDvKm':function(_0x5a7c9d,_0x11958d){return _0x5a7c9d(_0x11958d);},'Taidi':function(_0x5d4fc6,_0x28829c){return _0x5d4fc6(_0x28829c);},'DacWE':function(_0x2334ca,_0x41dc01){return _0x2334ca(_0x41dc01);},'cbpXK':_0x23937d(0x1d26,0x1c14,0x221b,0x19d3)+_0x313705(0x1500,0x172c,0x172c,0x1392)+_0x313705(0x141a,0x720,0x17b0,0x22d7),'IgBdT':_0x313705(0x1a6a,0x2527,0x1a44,0xf65),'XHxiS':_0x23937d(0xc14,0x10c4,0x716,0x9d7),'jsgze':function(_0x21706c,_0x59ae01){return _0x21706c(_0x59ae01);},'uNyps':function(_0x1b99e5,_0x54e91d){return _0x1b99e5(_0x54e91d);},'JPezJ':function(_0x3b4830,_0xc7bae5){return _0x3b4830(_0xc7bae5);},'vXbit':_0x313705(0x4ae,0x581,0x1189,-0x866)+_0x23937d(0x254,-0x6d0,-0x594,0x5ff),'nKHVq':'tomp3','numve':function(_0x2e6b0a,_0x403b02){return _0x2e6b0a(_0x403b02);},'eNuQY':function(_0x3d05e2,_0x279cdf){return _0x3d05e2(_0x279cdf);},'ITZqM':function(_0x982a83,_0x432b70){return _0x982a83(_0x432b70);},'nzHnr':function(_0x151658,_0xdac171){return _0x151658+_0xdac171;},'lvCmJ':function(_0x26cfb8,_0x1213f2){return _0x26cfb8(_0x1213f2);},'aEXsf':function(_0x2335d9,_0x141ce1){return _0x2335d9+_0x141ce1;},'daWRR':function(_0x2fbcad,_0x2a5f2a){return _0x2fbcad(_0x2a5f2a);},'iJsxG':function(_0x389358,_0xab802f){return _0x389358(_0xab802f);},'rIoMk':function(_0x2ba8da,_0x188123,_0x3cf4b7){return _0x2ba8da(_0x188123,_0x3cf4b7);},'sCCiJ':_0x313705(0x1362,0x1a92,0x1399,0x1293),'gWlTc':_0x23937d(0xf88,0xfc7,0x16bc,0x1c63),'Pspzu':function(_0x3aabe2,_0x28e00a){return _0x3aabe2(_0x28e00a);},'HEVSJ':_0x23937d(0xeae,0x16ea,0x1a67,0xe56),'ICwro':function(_0x85a8f1,_0x206ffb){return _0x85a8f1!==_0x206ffb;},'tfBEV':'SgwBy','lzNkn':function(_0x30a813,_0x215553){return _0x30a813(_0x215553);},'ajQJC':function(_0x5d54f6,_0x3a01ec){return _0x5d54f6(_0x3a01ec);},'YwLcu':function(_0x14283c,_0xe616f8){return _0x14283c(_0xe616f8);},'lTchk':_0x313705(0x208c,0x25b1,0x2d6b,0x1494)+'From\x20Webp\x20'+_0x313705(0x175b,0x1e6b,0xfd5,0x9a4),'OnFhC':_0x23937d(0xb34,0x2ca,0xb28,0x1133),'OdnGW':_0x313705(0x140d,0xa58,0x22de,0x818),'kamBL':function(_0x46db03,_0x3eb87e){return _0x46db03(_0x3eb87e);},'mUMJg':function(_0x3b7e1e,_0x30913d){return _0x3b7e1e===_0x30913d;},'OrhnY':'gcWfJ','BXHKb':_0x313705(0x6b8,-0x22a,0x10b9,0x4df),'vTTMR':function(_0x3e8457,_0x128cd3){return _0x3e8457(_0x128cd3);},'BBnVI':function(_0x594143,_0x570c5f){return _0x594143(_0x570c5f);},'gvzDT':_0x23937d(0xae1,0x54,0x5d5,-0x36)+'xx','IXCQz':'remove-bgx'+'xx','SsZgy':function(_0x490af4,_0x154980){return _0x490af4+_0x154980;},'xUyRY':function(_0x5a7d77,_0x3c2e8e){return _0x5a7d77(_0x3c2e8e);},'CMpii':function(_0x3b7421,_0x198cd4){return _0x3b7421+_0x198cd4;},'vPtPS':_0x313705(0x2095,0x173a,0x1290,0x1ead),'OdRKc':_0x313705(0x8ee,0x76,0x6af,-0x56d)+_0x23937d(0x181,0x5e6,0x104c,0xe3e)+_0x313705(0x680,0xaaf,-0x534,0x10d7),'PSMvW':_0x23937d(0x427,0x70e,-0xa8,0x495)+_0x23937d(0x1898,0xb71,0x1a97,0x10f0)+_0x313705(0xdf5,0xa2c,0x120d,0x40e),'hAxFA':_0x23937d(0x18a3,0x1f7b,0x242d,0xa64)+_0x313705(0x159b,0x184b,0xa51,0x158a)+'Jc61','SavDB':'5Gdq1sSWSe'+_0x313705(0x212f,0x1ccc,0x1df1,0x1fa5)+_0x23937d(0x1bb7,0x1aad,0x19c8,0x14c6),'gWuUA':_0x23937d(0x1c33,0x27ca,0x22f3,0x2224)+_0x23937d(0xa21,0x59c,0x1558,0xd79)+_0x23937d(0x937,0xef6,0x2de,0x4b0),'sFgBo':'xp8pSDavAg'+_0x23937d(0x6ad,-0x56d,-0x13b,0x1199)+'UKHF','BTrOO':_0x313705(0x15a3,0xcc5,0x2491,0x726)+_0x23937d(0x1347,0xfe4,0xc04,0x1958)+_0x313705(0x1871,0x2264,0x17cf,0x1281),'HZqIF':_0x23937d(0xb1b,0x338,0xe87,0xd9b)+_0x313705(0x1730,0x22fb,0x158f,0x1042)+'-','POLZU':_0x23937d(0xb1b,-0xc6,0x13d0,-0x3a5)+_0x313705(0x13f8,0x19bb,0x2003,0xe59),'YaSXE':_0x23937d(0x196e,0x152f,0x1299,0x2420),'yiQwt':_0x23937d(0x1ddc,0x1a7b,0x29a6,0x1ad2),'YxQxJ':_0x313705(0xe04,0x2ec,0x940,-0xba),'alEAS':_0x313705(0x180d,0x200d,0x1e76,0x20cc),'nQkmP':function(_0x5af694,_0x4e728e){return _0x5af694!==_0x4e728e;},'zLAha':_0x23937d(0xb2c,0x176f,0x5c5,-0x20f),'mLfiN':'MHGtV','fNKdf':function(_0x576095,_0x18e969){return _0x576095+_0x18e969;},'yQqnv':'*|\x20YOUTUBE'+_0x23937d(0xe7b,0xb14,0x121d,0x1926)+_0x313705(0x1a63,0x1d05,0x2571,0x2843)+_0x313705(0x4ec,0x1c7,0xb44,0xe48),'OifNb':_0x23937d(0x791,0x90a,0x9f3,0x7b2),'iMMqq':_0x313705(0x1e09,0x1062,0x250c,0x2945),'iOHvs':function(_0x3713f2,_0x3fb68b){return _0x3713f2(_0x3fb68b);},'sAVaz':function(_0x481c3e,_0x4193f6){return _0x481c3e(_0x4193f6);},'qOolT':_0x313705(0x1e9d,0x22c6,0x17fe,0x258e),'mCskr':function(_0x26759c,_0x188801){return _0x26759c(_0x188801);},'KkIKT':'gimage','AycRP':_0x313705(0x17b5,0x1015,0x211d,0x1776)+'e','YSojp':_0x23937d(0x1168,0x1b8a,0xff2,0x1393),'PkJGi':_0x23937d(0x5e3,0x91c,-0x615,-0x3a4)+_0x23937d(0x12e4,0x501,0xf59,0x1664),'olqXk':_0x23937d(0x7a2,0x16bc,0x1656,-0x2af),'CrNgE':'img','PlaTl':function(_0x21ab35,_0x521c70){return _0x21ab35(_0x521c70);},'zVheE':function(_0x33685e,_0x190418){return _0x33685e(_0x190418);},'xfISx':_0x23937d(0x233,0x5c5,-0x83,0x8ba),'sHFZk':'instagrams'+_0x313705(0x20d8,0x2a0a,0x2cb8,0x1c52),'sCIib':function(_0xb51cac,_0x321cd8){return _0xb51cac+_0x321cd8;},'IXbVH':_0x23937d(0x1dee,0x246e,0x1778,0x2905),'vxLfg':function(_0x4f793f,_0x1b2c15){return _0x4f793f(_0x1b2c15);},'RQmwC':function(_0x47c986,_0xcd19ae){return _0x47c986(_0xcd19ae);},'YgFDq':_0x313705(0x1ea0,0x2845,0x1291,0x11cb),'mKpPQ':_0x23937d(0xa,-0x881,0x634,-0x92a),'ZqyAJ':'instagrams'+'tory2','aFWVk':function(_0x135bb6,_0x2c1fd7){return _0x135bb6(_0x2c1fd7);},'PgOvi':function(_0x16c3cc,_0x1fa385){return _0x16c3cc(_0x1fa385);},'ccykr':_0x313705(0x1a71,0x2315,0x2941,0x2017),'lyHdz':_0x23937d(0x1dcc,0x1b3f,0x1ab6,0x269c),'denmq':function(_0x5476ee,_0x506a0a){return _0x5476ee(_0x506a0a);},'twpFb':function(_0x3f6cd5,_0x2a04a5){return _0x3f6cd5(_0x2a04a5);},'MGwWj':function(_0x45f8ef,_0x1fcc77){return _0x45f8ef(_0x1fcc77);},'ZRgWp':_0x23937d(0xcf6,0x1076,0xb7,0x11d),'ZCeyC':'instagram','cWYGT':_0x23937d(0x16ec,0x1bdb,0x19b4,0x902)+_0x313705(0x18ac,0x1abe,0x21e9,0x15b3),'xfQjQ':_0x313705(0x784,-0x23b,0x114e,0x155d),'hYQgQ':function(_0x40f819,_0x97619){return _0x40f819!==_0x97619;},'UjOrv':_0x313705(0x1472,0x1cd8,0x113d,0xcab),'lFnwl':function(_0x5a9338,_0x1d37d5){return _0x5a9338(_0x1d37d5);},'FqOvv':function(_0x2d4e6d,_0x652176){return _0x2d4e6d(_0x652176);},'yWFNa':function(_0x37db6d,_0x1eb344){return _0x37db6d===_0x1eb344;},'psYem':_0x313705(0xea3,0xbd6,0xda9,0xd5d),'jqfIK':_0x23937d(0xcf2,0xffb,0x2f,0x331),'RUDwt':_0x313705(0x1cfe,0x2487,0x29c3,0x1b0a),'ySAPn':_0x313705(0x1699,0x126f,0x19c7,0x22da)+'!','diNqx':_0x313705(0xc66,0x148,0x12d4,0x114e),'mJulM':function(_0x48abc8,_0x105c03){return _0x48abc8===_0x105c03;},'IsbtG':_0x23937d(0x15fc,0xa41,0xbf7,0xa17),'ugyaU':'IUteB','vuEwR':function(_0x5f3812,_0x36000c){return _0x5f3812(_0x36000c);},'BfkIp':function(_0x5cf86a,_0x5e2870){return _0x5cf86a(_0x5e2870);},'kovmn':function(_0x56be25,_0x25f8e7){return _0x56be25(_0x25f8e7);},'neduC':'instagram.'+_0x23937d(0xdfc,0x140d,0x180e,0x83),'bEjmH':_0x23937d(0xf0b,0x18ef,0x1526,0x1438)+_0x23937d(0x27d,-0x46e,-0x762,0xaf1)+_0x313705(0x17a9,0x123b,0x2456,0x1bf5)+_0x23937d(0x17bd,0xca1,0x1765,0x2092),'XbbUY':function(_0x2132ae,_0x23960b){return _0x2132ae(_0x23960b);},'ubBQk':_0x23937d(0x1a1d,0x22b7,0x220d,0x1cd8),'CYXFs':'twitterdl','PPYVe':function(_0x4cd691,_0x256282){return _0x4cd691(_0x256282);},'TCFBx':function(_0x91a6c5,_0x502a85){return _0x91a6c5(_0x502a85);},'MTUnq':_0x313705(0x16bf,0xa7d,0x1f45,0x212f)+'m','OcJiA':_0x23937d(0x1044,0x11a2,0x1d55,0xd68)+'io','zUQNV':'uShtk','jkSBY':function(_0x15bac2,_0x52cc33){return _0x15bac2(_0x52cc33);},'vPGAl':function(_0x123c07,_0x123b59){return _0x123c07(_0x123b59);},'AMgfZ':function(_0x5ba781,_0x461cd5){return _0x5ba781(_0x461cd5);},'aLibC':_0x23937d(0x11d0,0x9ca,0x1b15,0x13d2),'MtTgY':_0x23937d(0x11c5,0xa2a,0x2ec,0x1250),'KviuP':function(_0xaf6613,_0x3aa283){return _0xaf6613+_0x3aa283;},'AeeRP':_0x313705(0x16af,0x11bc,0x1405,0x1ce1)+'!','GNntl':_0x23937d(0x11fb,0x1fe4,0x1f12,0x1c36),'QUWeT':'pornhub','UmRjm':_0x313705(0x1919,0x1c39,0x2679,0x225b),'QwUdg':function(_0x471c5b,_0x11bb1f){return _0x471c5b(_0x11bb1f);},'jkOBN':function(_0x5ef8bd,_0x13a99d){return _0x5ef8bd(_0x13a99d);},'WPzAq':_0x23937d(0x917,0x1266,0x15bb,0x16f2)+_0x23937d(0x1227,0x1521,0x1225,0x316)+'fxqv/20220'+_0x313705(0x1829,0x2727,0x10a0,0x24fe)+'.jpg','vauOr':'facebook','XiFaY':'fbvideo','UBhIU':function(_0x33aedd,_0x1a0031){return _0x33aedd(_0x1a0031);},'qZlLZ':function(_0x3173b8,_0xfbbcfc){return _0x3173b8(_0xfbbcfc);},'sUOYB':_0x313705(0x47f,0x302,0x1053,0xb93),'bHOCU':function(_0x21c604,_0xde6684){return _0x21c604===_0xde6684;},'KjGnQ':'yhQHr','antgg':_0x23937d(0x1851,0x22c5,0x12fa,0x2288),'wWNVM':_0x23937d(0x1902,0xd77,0x24c9,0x1c5b),'CIFpq':'fbddoc','IAOvG':_0x23937d(0x176a,0x140b,0xae5,0x1bfe),'okOPD':function(_0x3b098a,_0x169f24){return _0x3b098a(_0x169f24);},'kONWx':'pinterest2','SCuQs':'tOUXy','UEzAm':function(_0x37e707,_0x12f525){return _0x37e707(_0x12f525);},'LtnEn':'./lib/scra'+_0x313705(0x9b9,0xd8b,0xc26,0xafe),'UjmOS':function(_0xd7ff92,_0x4e3611){return _0xd7ff92*_0x4e3611;},'zDtlx':_0x23937d(0x117b,0x12a8,0xfee,0x17f6)+_0x313705(0x1968,0x1151,0x13b6,0x2616)+_0x23937d(0x1419,0xc64,0x744,0x21d6),'dNbQU':_0x23937d(0x6b6,0x993,-0x34,-0x502)+'ch','TWSnn':_0x313705(0x1488,0x19c2,0x1bc9,0x21d1),'OIdwj':function(_0x6143a3,_0x261ed9){return _0x6143a3(_0x261ed9);},'MEuZX':function(_0x597e82,_0x3a6071){return _0x597e82(_0x3a6071);},'pdXcl':function(_0x436e96,_0xaac3a8){return _0x436e96(_0xaac3a8);},'DKHCR':'UtuUe','VhnmO':function(_0x583dfd,_0x1a1f65){return _0x583dfd(_0x1a1f65);},'aZwBo':function(_0xf2034,_0x2eee6c){return _0xf2034(_0x2eee6c);},'JscLd':function(_0x3b97bd,_0x531112){return _0x3b97bd+_0x531112;},'cSKvG':_0x23937d(0xbf7,0x809,0xd7d,-0xb6),'HHyZR':'apkdl','eCzEN':_0x23937d(0x193b,0x185f,0x1f8d,0x1f7b),'yVDZq':_0x23937d(0x1992,0x12f5,0x1016,0x18b6),'COWYh':function(_0x213187,_0x4a3aa1){return _0x213187(_0x4a3aa1);},'ljhSd':function(_0x7fb323,_0x5c26d6){return _0x7fb323(_0x5c26d6);},'nrocu':function(_0x424158,_0x254246){return _0x424158(_0x254246);},'mQkYq':function(_0xef76c8,_0x3263ec){return _0xef76c8(_0x3263ec);},'sZxtd':function(_0x583fca,_0x518d8d){return _0x583fca(_0x518d8d);},'gAazw':_0x23937d(0xf0b,0x166e,0xc88,0x1854)+_0x23937d(0x27d,0xac,0x115d,0x40c)+'ed\x20is\x20inva'+'lid*','BDmSR':function(_0xa9c714,_0x42c33e){return _0xa9c714(_0x42c33e);},'jTZDU':'./lib/ApkD'+_0x23937d(0x1128,0x1fa6,0x921,0x7a7),'UXMXb':_0x23937d(0x2ad,0x256,-0x397,0xa89),'vmLoD':function(_0x24ab9d,_0x2b7e00){return _0x24ab9d(_0x2b7e00);},'KeWoO':_0x23937d(0x1428,0x1a9b,0x1d12,0x125d),'iMcbu':'gitclone','SRBCS':function(_0x44c4a4,_0x26aa61){return _0x44c4a4(_0x26aa61);},'jcPyf':function(_0x124529,_0x100c1e){return _0x124529(_0x100c1e);},'iIUzS':_0x23937d(0x1d25,0x132f,0x27c4,0x169f)+_0x313705(0x1fe8,0x1e80,0x2808,0x1820),'gcADn':function(_0x13b305,_0x1046ee){return _0x13b305+_0x1046ee;},'lbnIt':_0x23937d(0x6f3,0x11cf,0x1496,0x1024),'JJlXM':_0x313705(0xa52,0x4fa,0xbad,-0x1b1),'JjSqm':function(_0x10bb34,_0x1e8d7f){return _0x10bb34(_0x1e8d7f);},'cEASz':'What\x20Are\x20Y'+_0x23937d(0xf4f,0x16ea,0xbd0,0x44b)+_0x23937d(0x1781,0x1a94,0x14a0,0xdd3),'eyHjG':'drakor','cgdBb':function(_0x1f2097,_0x3d1e6d){return _0x1f2097(_0x3d1e6d);},'VXhQv':function(_0x25ecff,_0x56c03e){return _0x25ecff(_0x56c03e);},'auFlO':function(_0x41167a,_0x517754){return _0x41167a+_0x517754;},'AlnFY':function(_0x2b65a8,_0x41ab89){return _0x2b65a8(_0x41ab89);},'TWNwB':_0x23937d(0x4a,0x445,-0xc85,0x396),'vGWFr':_0x23937d(0x1a0c,0x14e5,0x20d6,0x18cf),'lDKdb':function(_0x17b806,_0x11b407){return _0x17b806(_0x11b407);},'sUwYx':function(_0x3794f9,_0x51afa8){return _0x3794f9(_0x51afa8);},'NQLTL':function(_0x329891,_0x4657e6){return _0x329891<_0x4657e6;},'XfKTw':function(_0x3f716a,_0x3fc82e){return _0x3f716a!==_0x3fc82e;},'oqvOH':_0x23937d(0x101d,0xd26,0x521,0x417),'rAdot':function(_0x117e0f,_0x50a150){return _0x117e0f!==_0x50a150;},'XfGEb':function(_0x1ff0b4,_0x296592){return _0x1ff0b4!==_0x296592;},'qZgqF':_0x23937d(0x64d,-0x313,-0x17,0x1344),'OKowG':function(_0x4dd158,_0x45dd43){return _0x4dd158(_0x45dd43);},'FRQIQ':'@shineiich'+'ijo/marika','DSEWr':function(_0x4fb6dd,_0x2ef330){return _0x4fb6dd<_0x2ef330;},'FcIdX':function(_0xd7470,_0x29af66){return _0xd7470(_0x29af66);},'vtBuf':function(_0x16abf0,_0x402f03){return _0x16abf0(_0x402f03);},'cHUKm':_0x23937d(0x144b,0x1e94,0x1542,0x213b),'QOthd':function(_0x2521d9,_0x52cd37){return _0x2521d9(_0x52cd37);},'cXFEp':'covid','KErfs':function(_0x14d73b,_0x33999f){return _0x14d73b(_0x33999f);},'PUORV':'tvschedule','qCuaw':_0x313705(0x1639,0xd28,0xcf9,0xbc4)+_0x23937d(0xac7,-0x13f,0x5bf,0xd8d)+_0x313705(0x1319,0x1aef,0xc70,0xdb9)+'nel]*','PMtpA':_0x313705(0xfd8,0x654,0x7cc,0x1949),'wCvdJ':function(_0x27e138,_0x235849){return _0x27e138(_0x235849);},'JcVyR':_0x313705(0xedd,0x1d52,0xa07,0xb62)+'ou\x20looking'+'\x20for?','IFEbl':'❉─────────'+_0x313705(0x1cbb,0x1c4d,0xfc1,0x148b)+_0x313705(0x16eb,0xb3a,0x2106,0x24c3),'LREaC':function(_0x50bfa4,_0x574a3d){return _0x50bfa4===_0x574a3d;},'oBNGG':_0x313705(0x970,0x1094,0xf38,0x774),'MuoOk':_0x313705(0x1a6f,0x18e7,0x105d,0x15af),'ZPJPU':_0x313705(0xbe4,0xa2b,0x18c5,0x126c),'wHHgA':function(_0x3881c6,_0x2b4964){return _0x3881c6(_0x2b4964);},'ktnxO':_0x23937d(0x18aa,0x11ce,0x1e71,0x19c2),'yzNCD':'mcquery','yKchY':function(_0x2a9351,_0x4d1bf3){return _0x2a9351!==_0x4d1bf3;},'PZDMN':_0x313705(0x1b3a,0x132f,0x15ce,0x1442),'JOwRT':function(_0x270006,_0x1dbefa){return _0x270006+_0x1dbefa;},'dMUzf':function(_0x58b2d9,_0x545068){return _0x58b2d9(_0x545068);},'uPSFb':function(_0x33ac0e,_0x8492a7){return _0x33ac0e(_0x8492a7);},'wycyN':_0x23937d(0x75f,0x7d1,0x1451,0x8e5),'iosSB':function(_0x4af134,_0x179a0b){return _0x4af134(_0x179a0b);},'dMxDN':function(_0xd39a64,_0x1a1cf7){return _0xd39a64(_0x1a1cf7);},'WsGJU':function(_0x390b52,_0x5f3eb6){return _0x390b52(_0x5f3eb6);},'OBYVW':_0x313705(0x446,0xf0,0xdd2,0x664),'TPXJL':_0x313705(0x1bb4,0x2429,0x14c0,0x1197),'aSEHS':_0x23937d(0xaab,0x149,-0x1a4,0x1032),'FBlbV':function(_0x586e2e,_0x5a168b){return _0x586e2e(_0x5a168b);},'Wavfl':_0x23937d(0x9dd,0x18ad,0x279,0x214),'YzBBt':function(_0x53a715,_0x389163){return _0x53a715(_0x389163);},'QhoPq':function(_0x2038b8){return _0x2038b8();},'avalD':'quotes','DzXcj':'darkjoke','DVEpm':function(_0xc99702,_0x2bcb80){return _0xc99702(_0x2bcb80);},'ySbyw':'\x0aDarkjokes'+'*','dqDOv':_0x313705(0xc68,0x5d7,0xc68,0x299),'nXUyU':_0x23937d(0x192d,0x1f62,0x17c6,0xd70)+_0x23937d(0xa06,0x680,0x2fe,-0xa7),'bbGox':function(_0x9dcf77,_0x43a54a){return _0x9dcf77(_0x43a54a);},'IRyjV':_0x23937d(0x80d,0x660,0x318,-0x312),'LBrRE':function(_0x499f07,_0x27d2cf){return _0x499f07(_0x27d2cf);},'ofUYZ':function(_0x42f33c){return _0x42f33c();},'WuhxZ':function(_0x356fe1,_0x54eb8a){return _0x356fe1(_0x54eb8a);},'Kfxdt':function(_0xd4a473,_0x3d7ec6){return _0xd4a473(_0x3d7ec6);},'ACybr':function(_0x5ab637){return _0x5ab637();},'wYrte':function(_0x7a6405,_0x117ded){return _0x7a6405(_0x117ded);},'HdyQK':_0x313705(0x20ba,0x1e36,0x1e50,0x2d02)+'s','Vruwm':function(_0x35b525,_0x15fef8){return _0x35b525(_0x15fef8);},'uuiwe':function(_0x15a4e4){return _0x15a4e4();},'ljBEp':_0x313705(0x10c8,0x1100,0x1cb9,0x1059),'sPZxI':function(_0x233446,_0x5cad4f){return _0x233446(_0x5cad4f);},'zlNzH':_0x23937d(0x181a,0x1556,0x1233,0x269e),'EOkxM':_0x23937d(0xac1,0xf25,0x17b5,0xdeb),'aWSwc':'okezone-ne'+'ws','VKNmf':'sindo-news','JzGhm':_0x23937d(0x13a3,0x2002,0x16cf,0xaf3),'aHhNv':function(_0x41e723,_0x48323c){return _0x41e723(_0x48323c);},'siDyu':function(_0x428cfa,_0x4e5632){return _0x428cfa(_0x4e5632);},'uLXgN':function(_0x453be6){return _0x453be6();},'LeGeV':function(_0x273a24){return _0x273a24();},'YBLbN':_0x23937d(0x28b,-0x39d,-0x704,0x529)+'ws','jNaND':function(_0xf2a590){return _0xf2a590();},'doqKm':_0x313705(0x9ad,0x949,0x1d4,0x76b)+'-meme','CEdZX':function(_0x34025c,_0x3aafee){return _0x34025c(_0x3aafee);},'nYeGk':_0x313705(0x693,0x36c,-0x433,0xf35)+_0x23937d(0x3cb,-0x723,0x86,-0x40a)+'\x0a','yuJfV':'cinemasche'+_0x23937d(0x1a96,0x1ce0,0x1578,0x228b),'coykF':function(_0x4cacda,_0x45cf73){return _0x4cacda(_0x45cf73);},'glecI':function(_0x4d9e66,_0x4bd08c){return _0x4d9e66(_0x4bd08c);},'cDTOW':function(_0x1c291f,_0x5d57b2){return _0x1c291f(_0x5d57b2);},'fJXaD':function(_0x51ccba,_0x343719){return _0x51ccba(_0x343719);},'UBcGP':function(_0x36b45c,_0x2ab8de){return _0x36b45c(_0x2ab8de);},'oYQjt':'wULgj','TXEeE':function(_0x13fcac,_0x4fdbc0){return _0x13fcac(_0x4fdbc0);},'DEErd':function(_0x575a92,_0xeb8572){return _0x575a92(_0xeb8572);},'ZEtxZ':function(_0x10756a,_0x2319e4){return _0x10756a(_0x2319e4);},'COroG':function(_0x1b0ed3,_0x585c0d){return _0x1b0ed3(_0x585c0d);},'rMUfE':_0x23937d(0xd3a,0x492,0x1d0,0x13ab)+'shortstory'+'x','MXwIG':function(_0xdcbcee,_0x285ea6){return _0xdcbcee(_0x285ea6);},'GovwE':_0x23937d(0x113b,0x82f,0x343,0x3d1)+_0x23937d(0x1283,0x1612,0x1425,0x179c),'NnWLI':function(_0xfebbe6,_0xed8ed8){return _0xfebbe6(_0xed8ed8);},'dReyz':function(_0x32d01b,_0x2c033b){return _0x32d01b(_0x2c033b);},'fxtRT':_0x313705(0x1f43,0x2318,0x1ee8,0x1a98),'GXFhi':'ppcouple','rOeks':_0x313705(0x1bba,0x285d,0xd5a,0x20a7)+_0x23937d(0x1f7,0xe82,-0x978,-0xb6a)+_0x23937d(0x1d9,-0xc68,0x214,0xd8a)+_0x23937d(0x197e,0x19fd,0x2060,0x220b)+'7/kopel_/m'+'ain/kopel.'+'json','wIxhB':_0x23937d(0xf58,0xdbb,0xc32,0x17ca)+'s','TigiB':'animequote','AMFuL':_0x313705(0x364,0x17d,0xe00,0x78e),'ELSmm':function(_0x12a199,_0x48f981){return _0x12a199(_0x48f981);},'lpyOi':_0x23937d(0x1a4e,0x1469,0x1b18,0xca8)+_0x313705(0x152a,0x1e3e,0x216d,0xd52),'etJZI':function(_0x400ced){return _0x400ced();},'SopUs':'Next','zZYXE':_0x313705(0x929,0x6a9,0x11fd,0x1010)+'Button\x20Bel'+'ow','iwesk':_0x23937d(0xeb6,0x205,0xb3b,0x51e),'YIwzG':function(_0x118b83,_0x35f855){return _0x118b83<_0x35f855;},'Mwzir':_0x23937d(0x1229,0x204a,0x118e,0x13c0)+_0x313705(0x12b5,0x1d4d,0x910,0x17fd)+_0x23937d(0xd5c,0x334,0xa0a,0x6d6),'otxEe':_0x23937d(0x19bd,0x1249,0xfcd,0x1c87),'nEJim':function(_0x25e585,_0xc78140){return _0x25e585(_0xc78140);},'DqpPy':_0x313705(0x158a,0x172d,0xdad,0x1b85)+'e➡️','BBqIm':'quotesanim'+'e','OoaLt':_0x313705(0x16f5,0xf72,0x1601,0x235e),'JbqWl':function(_0x393cc3,_0x17e38f){return _0x393cc3(_0x17e38f);},'herts':function(_0x1d2b34,_0x8227f6){return _0x1d2b34(_0x8227f6);},'exnlM':function(_0x38a03c,_0x5b1969){return _0x38a03c(_0x5b1969);},'YFsiO':function(_0x1aa800){return _0x1aa800();},'JbfVw':'dgtlN','KWdZz':function(_0x1acf67,_0x3f57d3){return _0x1acf67(_0x3f57d3);},'PRIHq':function(_0x59148a,_0x33a027){return _0x59148a(_0x33a027);},'VAZUb':_0x313705(0x36e,0x118,0xe8,-0xf8),'ROLEg':function(_0x384c3f,_0x386a25){return _0x384c3f(_0x386a25);},'crtXg':_0x23937d(0xa27,0x1256,0x1882,0x118f),'sSNfr':_0x313705(0x90b,0x1193,-0x332,0xb16),'QiufF':_0x23937d(0x3c3,0x1037,0x430,0x3ed),'EUqkY':_0x313705(0x1ac8,0x1d1a,0x150d,0x1fe8),'OQwxb':_0x23937d(0x5b0,-0x78f,0xd29,0xe0d),'UeyRP':'eRIoR','sPVtp':function(_0xf70fb6,_0x59474d){return _0xf70fb6(_0x59474d);},'FQIyP':function(_0x27dcf0,_0x4cfa6a){return _0x27dcf0+_0x4cfa6a;},'nADAU':function(_0x3b4dc3,_0x208cd8){return _0x3b4dc3(_0x208cd8);},'INLYy':_0x313705(0xcb1,0xbc7,0x874,0x1497),'wgNEN':_0x23937d(0x103b,0x6cd,0x13e4,0x1341),'Pkdbq':_0x23937d(0xbe8,0xaa,0x134e,0x155f),'ixSOE':_0x23937d(0x704,-0x1f6,-0x636,0x8e5)+'te','ChRYk':function(_0x4188a6,_0x700c1b){return _0x4188a6(_0x700c1b);},'RHxUb':_0x23937d(0x1697,0x7c5,0x200b,0x1b06),'Jgnna':function(_0x1d3ab2,_0x29c7a1){return _0x1d3ab2+_0x29c7a1;},'bXCKx':_0x313705(0x1dbb,0x115a,0x27fd,0x210a)+'Limit\x20','eGYOi':_0x23937d(0x159f,0x186b,0x1830,0x1ec7)+'o🎶\x20\x20\x20❯❯','GhwDp':_0x23937d(0x38a,0xe20,0x11ce,-0x1be)+_0x23937d(0x62e,0x129,-0x534,-0x2ff),'GkKxm':_0x23937d(0x11b1,0x1747,0x4ee,0x124e),'nEzdv':function(_0x1193aa,_0x2fb51b){return _0x1193aa(_0x2fb51b);},'alEIb':function(_0x181981,_0x3608b2){return _0x181981(_0x3608b2);},'EvAnX':_0x23937d(0x23f,0x73d,0xd3b,-0xc69),'otGbI':function(_0x2c2dc4,_0x12bdbf,_0x4b5ca7){return _0x2c2dc4(_0x12bdbf,_0x4b5ca7);},'vegUk':'ytvoice','ZDviZ':function(_0x511372,_0x2a495d){return _0x511372>=_0x2a495d;},'PWqyn':_0x23937d(0x1514,0xeaf,0x2359,0x7dc),'pInzB':_0x23937d(0x77,0x344,0xa6a,-0x250),'rpexV':function(_0x22401f,_0x3dfe2d){return _0x22401f(_0x3dfe2d);},'mCTZp':function(_0x5659f3,_0x37f390){return _0x5659f3+_0x37f390;},'xJofo':function(_0x115878,_0x178601){return _0x115878>=_0x178601;},'yEFwA':function(_0x21fa38,_0x21c487){return _0x21fa38(_0x21c487);},'rTagv':'ytmp4','GxAkB':_0x23937d(0x316,0x863,0xef8,-0x964),'ipumN':_0x313705(0x2129,0x2f8e,0x21d9,0x2e70),'mOytH':_0x313705(0xdde,0x7a9,0x1ccf,0x1c79),'sXLCS':function(_0x4f05bd,_0x49c234){return _0x4f05bd(_0x49c234);},'ILnnx':function(_0x38a1c5,_0x238f45){return _0x38a1c5+_0x238f45;},'CJELu':_0x313705(0x1049,0x4d4,0x194,0x1e97),'dercc':function(_0x18a606,_0x228725){return _0x18a606>=_0x228725;},'UnXIY':_0x23937d(0x115c,0xd0c,0x1e0f,0xf4d)+_0x313705(0x643,0xcd1,-0x822,0x369)+'\x20Limit\x20','OvGqL':_0x23937d(0x1a98,0x2243,0x116c,0x247b)+_0x23937d(0x7cb,0x5f3,0xf6d,0xfcc),'JyJCI':'❮❮\x20\x20📤\x20480p'+_0x313705(0xb31,0x1699,0xd19,0x1966),'yUetX':_0x313705(0x1199,0x1fe8,0x962,0x1b0c)+'\x20📥\x20\x20❯❯','wVnPk':function(_0x8ba7b9,_0x569c07){return _0x8ba7b9(_0x569c07);},'Dtncx':_0x23937d(0x7ab,-0x721,0x115,0x610),'IQwyF':function(_0x31a9fd,_0x541fbd){return _0x31a9fd+_0x541fbd;},'dGRlK':_0x23937d(0x18bd,0x1fa1,0x179b,0x23a1),'ZWEeR':function(_0x2be4ce,_0x554318,_0x2d4420){return _0x2be4ce(_0x554318,_0x2d4420);},'QOOAu':function(_0x4ff903,_0x47864f){return _0x4ff903+_0x47864f;},'wBzZC':_0x313705(0x14c2,0x1d29,0xa7a,0x1732)+_0x23937d(0x1628,0xf2b,0x236d,0x207a)+_0x23937d(0x719,0x14ac,-0x31f,0x2db),'OpytU':function(_0x2362ca,_0x589d0f){return _0x2362ca===_0x589d0f;},'pdRrU':_0x313705(0x7b8,-0xa2,0x455,0x13f7),'hgNpI':'yt480','SWZIk':function(_0x2df9d9,_0x1375cf){return _0x2df9d9!==_0x1375cf;},'UJCNw':_0x23937d(0x930,0x2ce,0x1758,0xb01),'jBElH':function(_0x73fc39,_0x4eee97){return _0x73fc39(_0x4eee97);},'fEVVv':_0x23937d(-0x16,0xb73,-0xd12,0x19f),'rBaYl':function(_0x33402c,_0x56b343,_0x4e187a){return _0x33402c(_0x56b343,_0x4e187a);},'Dpsfl':function(_0x4ebc50,_0x252f91){return _0x4ebc50(_0x252f91);},'nvVGe':function(_0x50eecc,_0x20762f){return _0x50eecc+_0x20762f;},'XFfFU':_0x313705(0x14c1,0xf2e,0x19b0,0x1d08),'EbNxQ':function(_0xf94d73,_0x12e0f0){return _0xf94d73!==_0x12e0f0;},'iyGQc':'dERTj','lZcfh':_0x313705(0x1439,0x18fb,0x924,0x1243),'WxOps':function(_0x504c39,_0x40cd71){return _0x504c39(_0x40cd71);},'opEVu':function(_0xd0896e,_0x2002e9){return _0xd0896e+_0x2002e9;},'ApCTf':function(_0x365252,_0x4ddb50){return _0x365252+_0x4ddb50;},'sCyoE':_0x23937d(0x17da,0x200c,0x23a5,0x1829),'XHSas':'dgpFI','etjnN':function(_0x50b7c5,_0x4247a1){return _0x50b7c5(_0x4247a1);},'GvByg':function(_0x5b7795,_0x25021a){return _0x5b7795(_0x25021a);},'BbsMl':function(_0x32b0a5,_0xb81b83){return _0x32b0a5(_0xb81b83);},'Xkuew':function(_0x201cf2,_0x60258b){return _0x201cf2(_0x60258b);},'ufSJW':'youtube','MKZER':function(_0x5bb741,_0x5d082b){return _0x5bb741(_0x5d082b);},'Zyxoi':'pin','KRDSq':_0x23937d(0x501,0x8b,0x8d2,-0x34f)+_0x23937d(0x169f,0x2345,0x1a8c,0x24b0)+_0x23937d(0x58b,-0x638,0xdca,0x4fc)+_0x313705(0x84d,0xfcc,0x6c7,0xc6),'dzgVf':function(_0x2bfedf,_0x2db0c2){return _0x2bfedf!==_0x2db0c2;},'ARjiI':_0x313705(0x1672,0x1443,0x140e,0x854),'ajYDc':'RRMOi','woHne':_0x313705(0x19f4,0x1a78,0x1f2d,0x2742),'nhQGZ':function(_0x5cabe9,_0x26e400){return _0x5cabe9(_0x26e400);},'QHvGX':function(_0x5b1afb,_0x318f79){return _0x5b1afb(_0x318f79);},'bciWo':_0x23937d(0x318,-0xa43,0xe0e,-0x7cc)+_0x23937d(0xdfc,0x81c,0x133,0x912),'WfOAk':function(_0x19f615,_0x231277){return _0x19f615(_0x231277);},'aVOHx':function(_0x1e4a65,_0x4342af){return _0x1e4a65(_0x4342af);},'eUCgv':function(_0x5c168c,_0x1718f4){return _0x5c168c+_0x1718f4;},'bEifl':'umma','BQTTv':function(_0x12d0cb,_0x222fda){return _0x12d0cb(_0x222fda);},'ljaYg':function(_0x1465d3,_0x1f0188){return _0x1465d3(_0x1f0188);},'OaArt':function(_0x31369a,_0x44ec21){return _0x31369a(_0x44ec21);},'XDIBT':function(_0x3afdca,_0x489fbb){return _0x3afdca==_0x489fbb;},'MIHJY':_0x313705(0x1fa9,0x108f,0x16b6,0x24b5),'bSHxh':function(_0x2e4008,_0x3810e4){return _0x2e4008!==_0x3810e4;},'HQruJ':_0x313705(0x5bf,0x874,0x64a,0xf07),'LabBy':_0x313705(0x1572,0x1dd0,0x17aa,0x155c),'ZyjQt':function(_0x360f75,_0x421979){return _0x360f75(_0x421979);},'ineqF':function(_0x25e0bb,_0x4c2c30){return _0x25e0bb(_0x4c2c30);},'gteny':function(_0x130271,_0x1f810c){return _0x130271+_0x1f810c;},'iVzaR':function(_0x5c9fd7,_0x5754fd){return _0x5c9fd7(_0x5754fd);},'UUlno':function(_0x32dc9a,_0x1daf59){return _0x32dc9a(_0x1daf59);},'vjmXv':'tempo','DFbhb':'.mp3','yOQHg':function(_0x213401,_0x3776d7){return _0x213401!==_0x3776d7;},'rbBhJ':'PSpUk','ctZRS':'Send\x20video'+_0x23937d(0x940,0x140a,-0x369,0x17f0),'arKLa':function(_0x265b63,_0x633479){return _0x265b63(_0x633479);},'OVjQg':function(_0x3b6d24,_0x34a0a9){return _0x3b6d24(_0x34a0a9);},'IUxBu':function(_0x571f09,_0x5a39af){return _0x571f09+_0x5a39af;},'uNJxZ':function(_0x4df348,_0x11b377){return _0x4df348(_0x11b377);},'XkhVn':'IsdOo','jmVgG':_0x313705(0x41b,-0x2f1,-0x1b1,0x494),'fdpTM':'blown','rMuXS':_0x313705(0xa36,0x58d,-0x2ae,0x159b),'ePdQR':_0x23937d(0x1723,0x15ae,0xed8,0x190e),'EEINF':_0x23937d(0x1c80,0x160c,0x2a7e,0x14d3),'ZhpLh':_0x313705(0x7cf,0x26d,0x110d,0xbca),'FxLEv':'reverse','fDOlf':'robot','ymHsK':'slow','JTBGJ':'smooth','jBuJy':_0x23937d(0x80f,-0x23f,0xb5c,0xddf),'cenGD':'-af\x20equali'+_0x23937d(0x1d,-0x23d,-0x826,0x47e)+'idth_type='+_0x23937d(0x15e1,0x2011,0x17be,0x209a)+'g=20','MzECx':_0x23937d(0x645,0xbf7,0x135,0xfb5)+'er=.1:1:64'+_0x313705(0x878,-0x41f,0x11f5,0x135),'ocjyw':_0x23937d(0x15cd,0x1ff8,0x1c4e,0x7c6)+'=4/4,asetr'+'ate=44500*'+_0x313705(0xaed,0x1767,0x862,0x2d6),'nZHrz':_0x313705(0xc8b,0xe94,0x7c8,0x16bb)+_0x313705(0x156d,0x13a5,0x1fde,0x1494)+'63,asetrat'+_0x313705(0x460,-0x1c2,0xf54,0x6dd),'QKsgO':_0x23937d(0x925,0xcfc,0x1206,0x30b)+_0x313705(0x897,0x464,0x11ac,0x12e8)+_0x313705(0x1618,0x23fb,0xcfd,0xa2b)+'=44100*1.2'+'5','OpoOP':_0x313705(0x14d7,0xf1e,0xd52,0x1954)+'mplex\x20\x22are'+_0x23937d(0x5d2,0x1223,0x9c,0x2ad),'jfecr':_0x313705(0x14d7,0x95e,0x203d,0x924)+_0x23937d(0x298,0xfef,0x2ec,-0x227)+'tfilt=real'+_0x23937d(0x964,0x52b,0x45d,0x894)+_0x313705(0x1509,0xb49,0x2289,0x1c69)+')\x27:imag=\x27h'+'ypot(re,im'+_0x313705(0x1e2f,0x1553,0x2698,0x28f3)+'win_size=5'+_0x313705(0x1d8f,0x22f9,0x27d6,0x1e26)+_0x313705(0x1c15,0xf46,0x164a,0x1ef5),'dLWAf':_0x313705(0x1bf7,0x1483,0x2116,0x2abd)+_0x23937d(0x8e3,0xed4,0xfed,0x49c)+_0x23937d(0x7ad,0xd5c,-0xa9,0xb7b)+_0x313705(0x899,-0x1e5,0x9ac,-0x5a5)+_0x23937d(0xc5,0xbb7,-0x550,-0xd4e)+':vsbmc=1:f'+'ps=120\x27\x22','WoQBW':_0x313705(0xc8b,0xde,0x1688,0xfd1)+_0x23937d(0x40e,0x2e1,-0x467,-0x672)+_0x23937d(0x37c,0x15f,0x88,0x448)+'=65100\x22','qPCNG':'zGetg','EKVeC':function(_0x5529bd,_0xf5e380){return _0x5529bd(_0xf5e380);},'ACJwV':function(_0x47b053,_0x410bed,_0x1e5794){return _0x47b053(_0x410bed,_0x1e5794);},'dnclx':function(_0x2cee06,_0x52ee6d){return _0x2cee06(_0x52ee6d);},'vgoos':_0x313705(0x1e03,0x2992,0x1f91,0x1e27),'KRbYy':_0x313705(0x20ac,0x257f,0x2768,0x1617),'yGamt':_0x313705(0xd22,-0x17b,0x917,0x1236),'PQVNp':function(_0x2cf1a7,_0xa05d41){return _0x2cf1a7(_0xa05d41);},'Kynpu':function(_0x4b820d,_0xdcde87){return _0x4b820d(_0xdcde87);},'vbWBd':function(_0x57290b,_0x51821d){return _0x57290b(_0x51821d);},'XhaQd':function(_0x111576,_0x4f71ac){return _0x111576(_0x4f71ac);},'NMwEk':_0x23937d(0x9a4,0x2c5,0x1227,0x6ba),'RMQaT':function(_0x51a85c,_0x3064e2){return _0x51a85c===_0x3064e2;},'oEinC':'rxqKq','DUFBr':function(_0x4ab3eb,_0x130df7){return _0x4ab3eb(_0x130df7);},'dJLkU':function(_0x170cfd,_0x78396){return _0x170cfd(_0x78396);},'dwund':_0x313705(0xea4,0x3df,0x3be,0x988),'sHQHN':_0x313705(0x77e,0x4f8,0xb0e,0xd0d),'LCIDA':function(_0x35b1d3,_0x40c01d){return _0x35b1d3===_0x40c01d;},'MhjHi':_0x23937d(0x8e6,0xa3c,0x16c7,0x137c),'dEEox':_0x313705(0x635,0x139c,-0x4db,0x1302),'ZVSLJ':function(_0x13d163,_0x23484a){return _0x13d163(_0x23484a);},'TGVXa':function(_0x350cc2,_0x595eb1){return _0x350cc2(_0x595eb1);},'yrzcp':function(_0x1b5988,_0xfc5176){return _0x1b5988 in _0xfc5176;},'dBkSY':function(_0x470f28,_0x55d0d7){return _0x470f28(_0x55d0d7);},'RiybS':function(_0x14f011,_0x4b0fc7){return _0x14f011 in _0x4b0fc7;},'DTawB':_0x313705(0x213c,0x14a3,0x2094,0x1960),'VolwB':'bjKrX','sMaXp':function(_0x3e3e94,_0x230191){return _0x3e3e94(_0x230191);},'mczIN':'listmsg','RDlSE':function(_0x351e14,_0x15d911){return _0x351e14(_0x15d911);},'VIEGY':_0x23937d(0xb82,-0x1dd,0x1284,0x7cd),'LpEHT':'delmsg','iaqNp':_0x23937d(0x1180,0x16e2,0x1c37,0x12bc),'Vperf':'anonymous','fkUkx':function(_0x224757,_0x5a1fb9){return _0x224757(_0x5a1fb9);},'vQYxq':function(_0x413ac2,_0x3478bd){return _0x413ac2(_0x3478bd);},'IKSbc':_0x23937d(0x6f0,0x9df,0x13aa,-0x4d3),'woxIz':_0x23937d(0x12e5,0x16df,0xa0b,0x96e),'cppjc':_0x313705(0x1fd2,0x2915,0x2805,0x15c1),'JAcME':_0x23937d(0x1cb2,0x2b5f,0x2245,0x29aa),'CSyLf':_0x23937d(0x21c,-0xc1f,-0x304,0x9ff)+_0x23937d(0x1aba,0x186b,0xefd,0x1723)+_0x313705(0x4f8,-0xa9,0xea2,-0x978)+'oups!','rnYti':'COBHu','AeJZt':_0x313705(0x492,0x130d,0x113f,0x109a),'MKQDw':function(_0x36db24,_0x11d357){return _0x36db24(_0x11d357);},'jOJhj':function(_0x5be6ac,_0x1432e5){return _0x5be6ac===_0x1432e5;},'tcDQd':'mulai','JWxps':_0x313705(0x148f,0x11b0,0xf19,0x1f38),'zMuHX':function(_0x230d3a,_0x3394c9){return _0x230d3a(_0x3394c9);},'UzbkX':_0x23937d(0x271,0x8a8,0x983,-0xf0),'gLsBo':function(_0x1fe488,_0x5343f0){return _0x1fe488!==_0x5343f0;},'OGqZo':_0x313705(0x1e5a,0x25fb,0x29ef,0x1b1f),'AUmAc':_0x313705(0x20ad,0x25dd,0x29be,0x28fa),'YCxgp':_0x313705(0x1d70,0x1acd,0xff7,0x1ffb),'pGiNs':_0x23937d(0xba8,0x1278,0xff3,0x50f),'hSqMx':_0x23937d(0xf14,0x146a,0x333,0xbe1),'rGPRq':_0x23937d(0x8e2,0xeb5,0x5f5,0x187),'HAGpb':_0x313705(0x660,0x14fc,-0x8b6,0x75d),'yBmFJ':_0x23937d(0xb50,-0x1e4,0x1306,0x9c7),'ICsps':_0x313705(0x1224,0x743,0x2014,0x14d6),'bPOIu':'0|3|4|2|1','XRZmu':_0x23937d(0x1471,0x1efc,0x1b3e,0x7e5)+_0x313705(0x214a,0x1484,0x17d7,0x1acd)+_0x23937d(0x743,0xb63,0xcdf,0x4ed)+_0x313705(0x1b16,0x26f1,0x107f,0x2081),'cnNyh':function(_0x4e5f23,_0x595293){return _0x4e5f23(_0x595293);},'kvgMP':function(_0x485cce,_0x21ab63){return _0x485cce(_0x21ab63);},'IzumS':function(_0x4f6829,_0x56ae32){return _0x4f6829(_0x56ae32);},'gqLuj':function(_0x15f40f,_0x220b7f){return _0x15f40f(_0x220b7f);},'awyyB':_0x23937d(0xfc,-0x48b,0x96,-0x202),'YQGtR':_0x313705(0x45f,-0x4f0,0x96d,0x870),'wiAqg':function(_0x4736fc,_0x26fb1b){return _0x4736fc(_0x26fb1b);},'xrEHr':function(_0x1c9564,_0x41ba21){return _0x1c9564(_0x41ba21);},'wuCvH':_0x313705(0x9e5,0x16d1,-0x173,0x11c0),'gqHoF':'EbQLd','gIERJ':_0x23937d(0x1850,0x18ab,0x2130,0xd87),'CeHNH':function(_0x46d7ca,_0x564285){return _0x46d7ca(_0x564285);},'KgCna':function(_0x2459a6,_0x3f7d31){return _0x2459a6<_0x3f7d31;},'KXyMS':function(_0x561d81,_0x5469d5){return _0x561d81(_0x5469d5);},'gMazs':function(_0xcf44d7,_0x361695){return _0xcf44d7===_0x361695;},'xXcZE':function(_0x512baf,_0x20a590){return _0x512baf===_0x20a590;},'xrzgs':function(_0x45e9d6,_0x2db2b2){return _0x45e9d6(_0x2db2b2);},'FEZkh':function(_0x7f8ce3,_0x4657ef){return _0x7f8ce3!==_0x4657ef;},'uIbao':function(_0x5047ea,_0x577892){return _0x5047ea(_0x577892);},'rGZSD':_0x23937d(0xea0,0xb41,0x580,0x8a),'JnqQN':_0x313705(0x18a8,0x1c59,0xa49,0xa6b),'XLtnL':_0x23937d(0x13a,0xb01,0xd40,0xdb3),'Wywcy':function(_0x2c6bd8,_0x47cfdd){return _0x2c6bd8(_0x47cfdd);},'pTSDH':function(_0x2e60ae,_0x363f42){return _0x2e60ae(_0x363f42);},'yoezF':function(_0x221f80,_0x545267){return _0x221f80(_0x545267);},'XFjxU':function(_0x26f35d,_0x274782){return _0x26f35d(_0x274782);},'wgEDH':'Testing\x20Sp'+_0x313705(0x14b2,0x22c2,0x1669,0x19b3),'mgfgR':function(_0x480549,_0x40d7b8){return _0x480549(_0x40d7b8);},'KErmN':_0x23937d(0x103,0x21b,0x575,0xca2)+_0x313705(0x652,-0x798,0xa51,-0x22d),'zINtq':function(_0x1a1a2e,_0xe99351){return _0x1a1a2e(_0xe99351);},'LMkBh':_0x23937d(0x8e4,0x13be,0x532,0x266)+_0x313705(0xcf0,0x1427,0x7a2,0x19b),'WokSC':_0x313705(0x1a2f,0x25c4,0x18ba,0x25b2),'fXwwO':_0x313705(0x1ccc,0x1a9d,0x1f27,0x1a15),'UkyDo':function(_0x52f206,_0x233259){return _0x52f206(_0x233259);},'wFVuq':_0x313705(0x1260,0x202b,0xacd,0x2133),'GNXbe':_0x23937d(0xb1b,0x821,0x40,0x938)+_0x313705(0x486,0x76c,0x1354,0xfe6)+_0x313705(0x863,-0x362,0x10fb,0x14c3)+'.mp3','hAKfB':_0x23937d(0x54a,0x60b,0x5f9,0x37c),'VXgaR':_0x23937d(0x15c2,0x13c3,0x1107,0x17d0),'WwtNx':_0x313705(0xf84,0xd72,0xfbd,0x18a4),'STLuZ':_0x23937d(0x1340,0x17fd,0x172a,0x1962),'XQUQR':_0x23937d(0x180f,0x1cc4,0x1247,0x1919),'dXFdM':_0x23937d(0x17e7,0x1053,0x13fd,0x1832),'MahtO':_0x313705(0x10b4,0x1414,0x116c,0xb23),'QZMDq':function(_0x39e7d8,_0x3d889f){return _0x39e7d8(_0x3d889f);},'VYfNG':function(_0x470a0b,_0x3768cd){return _0x470a0b(_0x3768cd);},'MCjPT':function(_0xd9eb9c,_0x3d12a7){return _0xd9eb9c===_0x3d12a7;},'BxBBW':'hUnvd','FFjUG':'hEqOb','OULWX':_0x313705(0x1229,0xd52,0x1ded,0xc8a)+'3','aJwVx':function(_0x69df37,_0x1aa74d){return _0x69df37(_0x1aa74d);},'SOhAV':function(_0x4fba32,_0x174006){return _0x4fba32!==_0x174006;},'jglky':'JVvJv','GmOAl':_0x313705(0xe52,0x959,0x120a,0xf3),'oXvAV':_0x23937d(0x1e0,0xcc5,-0xa97,-0x11),'OrZPP':function(_0x140868,_0x17067f){return _0x140868(_0x17067f);},'gGzrT':function(_0x4f0793,_0x64ea4b){return _0x4f0793(_0x64ea4b);},'nFRZN':'4|0|1|2|3','JrPGZ':function(_0x256a89,_0x502a28){return _0x256a89(_0x502a28);},'NUiCV':_0x313705(0x1855,0xe70,0xb3f,0x25e7),'KJugt':_0x313705(0xfd9,0x1802,0x1ced,0x1651),'wbsaV':_0x313705(0x13b3,0x14b6,0x203b,0x1636),'SlXrJ':_0x23937d(0x9a1,-0x333,0x142,0xb76),'PCVEB':'sourcecode','CjJGl':function(_0x12bf19,_0x19bc5a){return _0x12bf19(_0x19bc5a);},'wkwKo':_0x23937d(0x96c,0x3a3,-0x18,0x16ad),'dNCid':_0x313705(0x1d98,0x2643,0x26de,0x23d2),'ZuyJX':_0x23937d(0x1cd5,0xfa0,0xe55,0x1ef2),'iHaMg':_0x313705(0xaf9,0x33b,0x185,0xdd),'VjhoA':'kYRgr','XehQm':function(_0x42f1ea,_0x6c467d){return _0x42f1ea(_0x6c467d);},'SgQAt':'BzwuB','ZfodA':_0x313705(0xda4,0x992,0x2c4,0xb60),'vKPoL':function(_0x298328,_0x526f6c){return _0x298328===_0x526f6c;},'zMEuw':_0x23937d(0x130b,0x1d4c,0x1e0c,0x9a1),'vlHgs':function(_0xd7fc7,_0x56dd6b){return _0xd7fc7(_0x56dd6b);},'XClcm':_0x23937d(0xaf2,-0xd1,0x1454,0xdb5),'nXsdX':'nhnZF','AziYs':function(_0x1a2cff,_0x1a1fa2){return _0x1a2cff===_0x1a1fa2;},'IkHls':_0x313705(0x1cc1,0x164d,0x1510,0x270c),'UVjzD':function(_0x4cb017,_0x59c75e){return _0x4cb017(_0x59c75e);},'CsNwM':function(_0x272b9a,_0x2759a5){return _0x272b9a===_0x2759a5;},'rNtxr':_0x23937d(0x714,0xc9b,0xe0,-0x1ce),'nRKlq':_0x23937d(0x1950,0x137b,0xf83,0x12a9),'PrsPV':function(_0x134ff7,_0x1cbd88){return _0x134ff7===_0x1cbd88;},'Mdweq':_0x313705(0x1c3c,0x1aa0,0x26bb,0x1ffa),'rqeHN':function(_0x4a8bcd,_0x295328){return _0x4a8bcd===_0x295328;},'WAnqN':'ADDSV','kuHRL':_0x23937d(0x1cfe,0x1e96,0x13c0,0x22ad),'eFxIX':function(_0x1bd007,_0x54d25a){return _0x1bd007===_0x54d25a;},'qQtwm':function(_0xfa6fc0,_0x285147){return _0xfa6fc0===_0x285147;},'YBZvi':function(_0x5d985a,_0x1e3199){return _0x5d985a(_0x1e3199);},'xkfGP':function(_0x1bff7d,_0x35b057){return _0x1bff7d(_0x35b057);},'lUoqh':'antibad','fOWrL':_0x23937d(0x11fc,0xcd1,0x1449,0x1e1f),'lytff':function(_0x283a65,_0x25500f){return _0x283a65===_0x25500f;},'gsFZQ':function(_0xde56af,_0xa56d5c){return _0xde56af===_0xa56d5c;},'yMjnc':function(_0x1d4d7c,_0x51a913){return _0x1d4d7c(_0x51a913);},'Idqlb':_0x313705(0x145e,0x1c76,0x1c2c,0x1bc9),'nPynO':function(_0x414829,_0x333523){return _0x414829===_0x333523;},'qrnQL':'QHeIa','cENYa':_0x313705(0x1c57,0x154e,0x24b4,0x156a),'gewYk':function(_0x2da277,_0x14acc1){return _0x2da277===_0x14acc1;},'HhQOu':function(_0x4a9c48,_0x54ebbf){return _0x4a9c48===_0x54ebbf;},'kzecK':function(_0x148639,_0x5850c8){return _0x148639(_0x5850c8);},'JaGgR':function(_0x550992,_0x35aaeb){return _0x550992===_0x35aaeb;},'uKavP':function(_0x5d5e28,_0x3c26a3){return _0x5d5e28(_0x3c26a3);},'umoxo':function(_0x5a6a03,_0x3d0006){return _0x5a6a03(_0x3d0006);},'ftNMF':function(_0xa2554e,_0x5c6d48){return _0xa2554e!==_0x5c6d48;},'JOAnY':'lKRyb','ejXDp':_0x313705(0x1934,0x12c0,0x22c4,0x1d34),'dklQF':_0x23937d(0xdc,0x807,0x36a,-0x193),'iQZxD':_0x23937d(0x1d35,0x10a1,0x1479,0x1f27),'iWufa':function(_0x30349a,_0x591e5c){return _0x30349a===_0x591e5c;},'hNYds':_0x23937d(0x198,0x153,0xb07,-0x485),'IorPv':function(_0x2b4a29,_0x14fb20){return _0x2b4a29===_0x14fb20;},'awuef':function(_0x1b9a06,_0x17258d){return _0x1b9a06(_0x17258d);},'WrITe':function(_0x4b8555,_0x17c869){return _0x4b8555===_0x17c869;},'AMbOX':function(_0x1d0363,_0x229d88){return _0x1d0363!==_0x229d88;},'rvLSP':_0x23937d(0xea2,0x8ed,0x1657,0x190a),'HgpwD':function(_0x40a94a,_0x95b446){return _0x40a94a(_0x95b446);},'tSUEQ':function(_0x5b00cf,_0x3ea620){return _0x5b00cf!==_0x3ea620;},'VWgAU':_0x313705(0x1349,0x1218,0x1798,0x1a81),'RWDUu':function(_0x546c19,_0x4a7404){return _0x546c19===_0x4a7404;},'OUHju':_0x313705(0x11a2,0xd3a,0x8f2,0x1ae4),'tRskY':function(_0xd8c7b4,_0x2386cb){return _0xd8c7b4(_0x2386cb);},'OCpdu':function(_0x4c2694,_0x31a2a7){return _0x4c2694(_0x31a2a7);},'BMjSY':function(_0x5e660b,_0x40b488){return _0x5e660b===_0x40b488;},'zmXZJ':_0x313705(0x1717,0x1352,0x17be,0x14fe),'VEqAv':_0x313705(0x1e4b,0x10ce,0x2488,0x2221)+'f','WJlGy':function(_0x3d8d33,_0x577e32){return _0x3d8d33!==_0x577e32;},'jZXLM':_0x313705(0xaf4,-0x219,0x9ef,0x607),'SXDsX':function(_0x5e3158,_0x53c530){return _0x5e3158===_0x53c530;},'eYYPI':function(_0xdae6e4,_0x9d53f9){return _0xdae6e4===_0x9d53f9;},'kwXUb':_0x23937d(0x1994,0x1650,0xfba,0x1a3e),'mADAH':function(_0x458d1d,_0x1a7092){return _0x458d1d(_0x1a7092);},'SVfVw':function(_0x55052b,_0x5a8216){return _0x55052b(_0x5a8216);},'UGsUK':_0x23937d(0xb35,0x654,0xe22,0x128a),'OxMGG':function(_0xa2fdfa,_0xb0df62){return _0xa2fdfa===_0xb0df62;},'gjUJO':_0x23937d(0xe7d,0x126,0x577,0x68e),'Uqvte':_0x23937d(0x33a,0xf41,0x3d0,0xc6)+'n','URrZO':function(_0x327f5c,_0x3a1e97){return _0x327f5c===_0x3a1e97;},'Lvofx':function(_0x5ddf62,_0x2b27d1){return _0x5ddf62(_0x2b27d1);},'JuSFE':_0x23937d(0x33a,0xfe9,0xa3c,0xeae)+'ff','ioPlR':function(_0x261a50,_0x10a059){return _0x261a50===_0x10a059;},'HzSDm':function(_0x46d6ae,_0x162953){return _0x46d6ae===_0x162953;},'CEXgR':_0x313705(0x781,0xa97,0x1460,0x3a7),'PZwVi':function(_0x43017a,_0x536b62){return _0x43017a===_0x536b62;},'xVTuz':function(_0x23376d,_0x4e26f6){return _0x23376d(_0x4e26f6);},'NLWfb':function(_0x392910,_0x1e92ab){return _0x392910===_0x1e92ab;},'XnxCk':function(_0x3acb13,_0x752262){return _0x3acb13(_0x752262);},'aHomg':function(_0x371ae0,_0x73fee9){return _0x371ae0(_0x73fee9);},'lNeBi':_0x23937d(0xde0,0x178a,0xb85,0xc42),'gsLgF':_0x23937d(0x132f,0x1437,0xcff,0x1643),'SJZkU':'help','cVYwZ':function(_0x3328da,_0x3a3e94){return _0x3328da===_0x3a3e94;},'YRWDJ':_0x23937d(0x2ac,0x8ae,0xf5f,0x6f8),'WOqWd':_0x313705(0x2155,0x1e60,0x1a88,0x1b61),'MtCsa':function(_0x49678d){return _0x49678d();},'TpSly':'command','gIIqT':'🎸◉-All\x20Men'+'u🎸📑','ifKaL':function(_0x2cd3b0,_0x5b4504){return _0x2cd3b0===_0x5b4504;},'lDuyj':_0x23937d(0x5fe,0xfc3,0xd34,-0x38b),'rJurh':'OjDWp','nwWlk':'🎸Main\x20Menu','TttEU':_0x313705(0x645,0x14f5,-0x79,0xd72)+'u','UjgzM':'🎸Owner\x20Men'+'u','jBbYs':function(_0x18f7a6,_0x2322e1){return _0x18f7a6!==_0x2322e1;},'DFDRr':_0x313705(0x1f44,0x1413,0x10a2,0x11e7),'KNleo':_0x23937d(0x37f,0xca3,-0x505,0x84e),'gBKHk':'🎸Download\x20'+'Menu','dbrYw':_0x23937d(0x1986,0x165d,0x12dc,0xd47)+'nu','kvvCW':'🎸Random\x20Me'+'nu','nRbKK':_0x313705(0x35f,0x789,-0xb91,-0xba),'jfpmv':_0x313705(0x9db,0x158a,0x1371,0x819),'WHznO':_0x23937d(0x11f2,0x103c,0x1805,0x1150)+_0x23937d(0x527,0x220,-0x748,-0x5c8),'ISUhn':'🎸Anonymous'+_0x23937d(0x1a3f,0x1fc0,0x1345,0x19cc),'UzUlF':_0x313705(0xfad,0xb37,0x1735,0x17c2),'usiQb':'⚙️DEVELOPER'+'⚙️','CLzYY':'sewabot','PQDrF':_0x23937d(0xd98,0x7d4,0x1b47,0x1c3),'rvCkN':function(_0xa1d300,_0x3dbc6a){return _0xa1d300(_0x3dbc6a);},'ZIFmC':_0x23937d(0x9ed,0x14de,0xfed,0x9cc),'XdHCh':'checkupdat'+'e','xzgjW':_0x313705(0x13c3,0x1f3b,0x4e3,0x15f2),'eaAYP':_0x313705(0x13d0,0x16b1,0x554,0xeb8),'snbIq':_0x23937d(0x70a,0x822,0x114f,0x91b),'zZgzC':_0x313705(0x1819,0x2054,0x1b37,0xf06),'trZco':_0x313705(0xd2e,0x1977,0x7cd,0x110),'jLnVN':_0x23937d(0x144,-0xc3f,0xcba,-0x8e4),'TEIzU':'groupmenu','XPSbg':_0x23937d(0x917,0x22f,0xcb6,-0x1de)+_0x313705(0xcf6,0x1240,0x1475,0x290)+'0qHS/20220'+_0x313705(0x12c4,0x1277,0x7d6,0x19ac)+_0x313705(0x953,0x1193,0x71d,0x15f5),'pCHRf':_0x313705(0xc7d,0x15e4,0x8a7,0x798)+_0x23937d(0x1a47,0x1b3a,0x217a,0x1a6a)+_0x23937d(0xcd7,0x14b0,0xc3b,0x1282)+_0x23937d(0x1c63,0x1af7,0xf6a,0x2ad9)+_0x23937d(0x5ed,0x334,-0x59f,0x1f2),'TDcbF':_0x23937d(0x34,0x143,0xee8,-0xca8),'EVYee':_0x23937d(0xd1a,0x9ab,0x66b,0x3a),'bhULx':_0x313705(0xc7d,0x86c,-0xe4,0x15bd)+_0x313705(0x18c5,0x2424,0x22b6,0xe46)+_0x23937d(0x5da,0x88b,0x672,-0x254)+_0x23937d(0xfa4,0xe14,0x24d,0xcc7)+_0x23937d(0x5ed,0xdca,0xe39,0xa8a),'dvXWn':'VMBTc','XLnSY':'searchmenu','CfOxL':_0x313705(0x3d0,0x3a9,0x2d7,0xff),'CIHfN':'https://i.'+_0x313705(0x182d,0x1cde,0x1a7b,0x1df5)+_0x23937d(0xd43,0x1945,0x410,0x1a5a)+'803-082037'+_0x23937d(0x5ed,0xcfb,0x58,0x53),'WCZhV':_0x23937d(0x115e,0xe59,0x10d9,0x1b42)+_0x23937d(0x1936,0x1cc2,0x2737,0x136f),'SBTHM':'textpromen'+'u','QqyPS':_0x23937d(0x917,0xdfb,-0x421,0x14b3)+_0x23937d(0x1c70,0x2658,0x1346,0x1caa)+'80ry/20220'+_0x313705(0x653,0x138f,0xff8,0x119a)+_0x313705(0x953,-0x1b9,0x179,-0x45c),'AwNNd':_0x23937d(0xb36,0x1999,0xcc6,0x1490),'KAzzN':_0x23937d(0x917,0x657,0xcfa,-0x18e)+'ibb.co/zSz'+_0x23937d(0x24c,-0xcc,0xd36,0x3b)+_0x23937d(0x28d,-0x999,-0xa1a,-0xaa)+'.png','HoaiK':_0x313705(0x1355,0xe4e,0x1431,0x688)+'nu','UqTBl':'CIhsJ','SxXwF':_0x313705(0x1a36,0xfce,0x1b7d,0x1bd0),'wGLng':_0x313705(0x1851,0x13ec,0x2352,0x25d0),'VxkzA':_0x313705(0x1381,0xa9c,0x1f4a,0x4b6),'EeUBl':function(_0xb87689,_0x2f3798){return _0xb87689===_0x2f3798;},'QVtFG':_0x313705(0x51e,-0x22d,0x7e6,-0x97b),'gOTIN':function(_0x588627,_0x691b71){return _0x588627(_0x691b71);},'soYEk':_0x23937d(0x133c,0x1684,0x16e9,0x5ec),'JyAvB':_0x313705(0x16a8,0x207c,0xcf4,0x1b85),'AMpQJ':function(_0xc1398e,_0x2be154){return _0xc1398e(_0x2be154);},'nwJlL':function(_0x4f1bae,_0xcbe59b){return _0x4f1bae(_0xcbe59b);},'sENwW':function(_0x15cb1f,_0x1f8a48){return _0x15cb1f(_0x1f8a48);},'DlOhb':_0x23937d(0xe5e,0x6d8,0x16f7,0x41c),'ZwcSZ':function(_0xf8b606,_0x4a5b97){return _0xf8b606(_0x4a5b97);},'YFiSt':_0x23937d(0x379,-0x356,-0x548,0x480),'QfFrO':_0x313705(0x1b6e,0x123c,0x1e7c,0xcc0),'SwRnO':_0x313705(0x18e4,0x183c,0xe48,0x1ffc),'rSORC':_0x313705(0x8ac,0x432,0x1156,-0x135),'gRvSg':_0x23937d(0x2bc,0x5ad,0x11bb,-0x3ff),'DLWpZ':_0x23937d(0x243,0x4ac,-0xa4f,0xd7a)+'er','JSjAl':_0x313705(0xe8c,0x1b0e,0x49a,0xf9f),'GfzDi':'Stop','ieexd':function(_0x1e1b0f,_0x1b11f3){return _0x1e1b0f===_0x1b11f3;},'Qfami':_0x313705(0x1f53,0x2612,0x1205,0x2a30),'XXaex':_0x313705(0x1b47,0x21e4,0x20ed,0xe7e)+'5','kEvKy':function(_0x5d4d67,_0x32919a){return _0x5d4d67!=_0x32919a;},'YMRnt':_0x313705(0x19fc,0xe7f,0xd97,0x2631),'ckThW':_0x23937d(0x47e,0xd37,0x4f8,0xb9e),'YCXPM':function(_0x219cd6,_0x1b2beb){return _0x219cd6 in _0x1b2beb;}};function _0x23937d(_0x72a922,_0x232ceb,_0x3d7247,_0x463a65){return _0x3fa150(_0x72a922- -0x558,_0x232ceb,_0x3d7247-0x70,_0x463a65-0x1ca);}function _0x313705(_0x1279e9,_0x1197cc,_0x812be2,_0x522b46){return _0x3fa150(_0x1279e9- -0x1f2,_0x1197cc,_0x812be2-0x11b,_0x522b46-0x71);}try{if(_0x4b485e['XCbWj']===_0x4b485e['XCbWj']){var _0x504796=_0x4b485e[_0x313705(0x19a4,0xecf,0xb99,0x2231)](_0x5cd288[_0x23937d(0xda3,0x10b1,0x10c5,0x174e)],_0x23937d(0x11eb,0x1e1d,0x1742,0x487)+'on')?_0x5cd288[_0x23937d(0xde4,0xcb0,0x1519,0x189d)][_0x313705(0x1551,0x73f,0x1d4f,0x1fde)+'on']:_0x5cd288['mtype']==_0x4b485e[_0x23937d(0x1b78,0x1ac5,0x23d6,0x1362)]?_0x5cd288[_0x313705(0x114a,0xd9a,0xe96,0x15a4)]['imageMessa'+'ge'][_0x313705(0xcce,0x1aba,0xfea,0xa57)]:_0x4b485e[_0x313705(0xa7c,0xec8,0x1704,0x1917)](_0x5cd288[_0x23937d(0xda3,0x1cb9,0xd18,0x712)],_0x4b485e[_0x23937d(0x978,0xd9,0x90,0x453)])?_0x5cd288[_0x23937d(0xde4,0x15e0,0xdf3,0x48b)][_0x313705(0x1193,0x1fa1,0x360,0xa77)+'ge'][_0x23937d(0x968,0x164c,0x1428,0x211)]:_0x4b485e['nhwEC'](_0x5cd288['mtype'],_0x4b485e['VfUny'])?_0x5cd288[_0x313705(0x114a,0x90f,0x16f0,0x17f0)][_0x313705(0x1af3,0x154f,0x18da,0x172c)+_0x23937d(0x1a31,0xb70,0x1fef,0x268c)]['text']:_0x4b485e[_0x23937d(0x17b1,0xa1f,0x1e30,0x1bd5)](_0x5cd288['mtype'],_0x4b485e[_0x23937d(0x1a7d,0x12f7,0x25da,0xf69)])?_0x5cd288[_0x313705(0x114a,0xa97,0xab4,0x14fb)][_0x23937d(0x122f,0x1dc1,0x933,0x105b)+'ponseMessa'+'ge'][_0x23937d(0x1795,0xca0,0x13a3,0x1893)+'ttonId']:_0x5cd288[_0x23937d(0xda3,0x924,0xc83,0x1b2d)]==_0x4b485e[_0x313705(0x40d,0xf06,0x7f9,0x31a)]?_0x5cd288['message'][_0x313705(0x1f4a,0x181f,0x274e,0x17fe)+_0x313705(0x1b59,0x1b66,0x23a2,0x2346)]['singleSele'+'ctReply'][_0x23937d(0x1831,0x24e3,0x11b0,0x12fe)+_0x23937d(0x1a15,0x1ccb,0xe42,0x1ed2)]:_0x4b485e['nhwEC'](_0x5cd288[_0x23937d(0xda3,-0x109,0x406,0x11f8)],_0x4b485e[_0x313705(0x947,0x487,0x3a3,-0x57b)])?_0x5cd288[_0x313705(0x114a,0x1f56,0x3d3,0x1cc8)]['templateBu'+'ttonReplyM'+_0x23937d(0x408,-0x879,-0x41c,-0xada)][_0x313705(0x3e1,-0xb04,0x123f,-0x1ea)]:_0x4b485e['RMwtu'](_0x5cd288['mtype'],_0x4b485e[_0x23937d(0x1703,0xc05,0x1f24,0x2077)])?_0x5cd288[_0x313705(0x114a,0xeb0,0x1ec1,0x1cc7)][_0x23937d(0x122f,0x858,0x1e69,0x1b48)+_0x23937d(0x1982,0x1bc7,0x24d3,0xcbe)+'ge']?.[_0x313705(0x1afb,0x21c8,0xe93,0x1a75)+'ttonId']||_0x5cd288[_0x23937d(0xde4,0x48f,0x192f,0x1a7d)][_0x313705(0x1f4a,0x1e77,0x2519,0x2bba)+_0x23937d(0x17f3,0x17e4,0xed7,0x1385)]?.[_0x313705(0x153d,0xf63,0x1a90,0x23f0)+_0x23937d(0x14df,0x11b7,0x1492,0xab7)][_0x313705(0x1b97,0xda3,0x1460,0xc7e)+_0x313705(0x1d7b,0x1972,0xf76,0x1eab)]||_0x5cd288[_0x313705(0x209f,0x2dd9,0x12b1,0x23e0)]:'',_0x169e0a=typeof _0x5cd288[_0x313705(0x209f,0x24c3,0x2ac7,0x14f7)]==_0x4b485e[_0x23937d(0x131e,0x71a,0x1cd1,0xbaf)]?_0x5cd288['text']:'',_0xe1d953=prefa?/^[°•π÷׶∆£¢€¥®™+✓_=|~!?@#$%^&.©^]/gi[_0x313705(0x1c74,0x2381,0x2a76,0x27b1)](_0x504796)?_0x504796[_0x23937d(0xe28,0x294,0x16e,0x670)](/^[°•π÷׶∆£¢€¥®™+✓_=|~!?@#$%^&.©^]/gi)[0x11c3*0x2+0x1f*-0x10d+0x97*-0x5]:'':prefa??global[_0x23937d(0x14dd,0x21f1,0x23ba,0x11f5)];const _0x338f49=_0x504796['startsWith'](_0xe1d953),_0x1354e9=_0x504796[_0x313705(0x1bd8,0x134b,0x2677,0x2913)](_0xe1d953,'')[_0x313705(0x1f6d,0x2aeb,0x2c2e,0x2b43)]()[_0x313705(0x1035,0x1423,0x1ad2,0x114e)](/ +/)[_0x23937d(0x134e,0x1ae3,0x168f,0xeb0)]()[_0x313705(0xa31,-0x3e7,-0x20d,0xf53)+'e'](),_0x1ba32f=_0x504796['trim']()['split'](/ +/)[_0x313705(0x399,-0x16e,-0x2fc,0xa50)](0x1eab+0x3ba+-0x2264),_0xa43395=_0x5cd288['pushName']||'No\x20Name',_0x4b45af=await _0x175756[_0x313705(0xca0,0x5d7,0x9f9,0x5)](_0x175756[_0x23937d(0x421,-0x8bc,0x1229,-0x8ac)]['id']),_0x24aa58=[_0x4b45af,...global[_0x313705(0xfea,0x4be,0x1b40,0xd80)]][_0x313705(0xe7c,0x1751,0xbab,0x102e)](_0x747a5f=>_0x747a5f[_0x313705(0x1bd8,0x13f0,0x1725,0x17ec)](/[^0-9]/g,'')+(_0x313705(0x128b,0x184f,0xcca,0xb31)+_0x23937d(0x1c1f,0xfd6,0x1ce8,0x1560)))[_0x313705(0x4de,0x13ad,-0x75f,-0xa2c)](_0x5cd288['sender']),_0x1de162=_0x4b485e[_0x313705(0xa7c,0x17ed,0x76d,0xeb3)](_0x5cd288[_0x23937d(0x14ce,0x11ab,0x14a7,0x19be)],_0x4b45af)?!![]:![],_0x494254=q=_0x1ba32f[_0x23937d(0x1c16,0x24a2,0xfc4,0x1416)]('\x20'),_0x3e5ec4=_0x5cd288['quoted']?_0x5cd288['quoted']:_0x5cd288,_0x2a2351=(_0x3e5ec4['msg']||_0x3e5ec4)[_0x313705(0x1610,0x75f,0x2454,0x13ca)]||'',_0x2193ff=/image|video|sticker|audio/['test'](_0x2a2351),_0x423161=mek['key'][_0x313705(0x55a,-0x956,-0x531,-0x939)],_0x2f2fac=Object[_0x23937d(0x1a9a,0x1068,0xbc5,0x1ae9)](mek[_0x23937d(0xde4,0x2ad,0x1782,0x196)])[-0xec6+0x11*-0xb1+0x1a87*0x1],_0x395ebf=JSON[_0x23937d(0xce7,0x1aa4,0x10a,0xc7f)](mek[_0x313705(0x114a,0x4eb,0x29d,0x33b)]),_0x49c697=_0x504796[_0x313705(0x399,0x312,0xe8b,-0x8d5)](0x197e+0xc23+-0xc8b*0x3)[_0x23937d(0x1c07,0x13da,0x1e54,0x2abd)]()[_0x23937d(0xccf,0x18a8,0x6e5,0x13b1)](/ +/)['shift']()[_0x313705(0xa31,0x5c6,0xbac,0x555)+'e'](),_0x1a4803=_0x5cd288[_0x313705(0x2089,0x20c6,0x1826,0x2fa0)]?await _0x175756['groupMetad'+_0x23937d(0x161c,0x1376,0x232c,0x82c)](_0x5cd288['chat'])[_0x313705(0xc9a,0x12c9,0x3c0,0x1eb)](_0x17cc2c=>{}):'',_0x2c5b09=_0x5cd288['isGroup']?_0x1a4803['subject']:'',_0x2e12a2=_0x5cd288[_0x23937d(0x1d23,0x1622,0x29e8,0x2b4f)]?await _0x1a4803[_0x23937d(0x461,-0x19,-0xaa3,-0x8f5)+'ts']:'',_0x28f5aa=_0x5cd288[_0x313705(0x2089,0x26e6,0x11b5,0x1c96)]?await _0x2e12a2[_0x313705(0xa62,0x734,0x7f,0x14e2)](_0x5db949=>_0x5db949[_0x313705(0x1818,0xa77,0x201c,0x20f4)]!==null)['map'](_0x1e1c4c=>_0x1e1c4c['id']):'',_0x168461=_0x5cd288[_0x313705(0x2089,0x1784,0x16d4,0x2b59)]?_0x1a4803['owner']:'',_0x424adc=_0x5cd288[_0x313705(0x2089,0x2cbf,0x1223,0x1c81)]?_0x28f5aa[_0x23937d(0x178,0xbbd,-0xd85,0xe46)](_0x4b45af):![],_0x17ccaf=_0x5cd288[_0x313705(0x2089,0x2755,0x1f89,0x299f)]?_0x28f5aa['includes'](_0x5cd288[_0x23937d(0x14ce,0x9bd,0x1fe5,0x9c9)]):![],_0x4f8765=_0x24aa58||global['premium'][_0x313705(0xe7c,0x378,0x6be,0xdb3)](_0x5ca0ef=>_0x5ca0ef['replace'](/[^0-9]/g,'')+(_0x313705(0x128b,0x1fe4,0x6f4,0x1274)+'p.net'))['includes'](_0x5cd288[_0x313705(0x1834,0x1cda,0x15cd,0xd1f)])||![],_0x353ad6=_0x5cd288[_0x23937d(0x1d23,0xfe9,0x259a,0x1a0e)]?ntilink[_0x23937d(0x178,0xc77,0x649,0x489)](_0x423161):![],_0x5a7bc9=_0x5cd288[_0x23937d(0x1d23,0x284e,0x249a,0x1b2b)]?ntilinkytvid[_0x313705(0x4de,0x38e,0xe47,-0x34c)](_0x423161):![],_0x5b4f82=_0x5cd288[_0x313705(0x2089,0x1ded,0x20f1,0x1d60)]?ntilinkytch[_0x313705(0x4de,0xdda,0x111e,0x5e0)](_0x423161):![],_0x3fb991=_0x5cd288[_0x23937d(0x1d23,0x129a,0x2aa0,0x148c)]?ntilinkig[_0x313705(0x4de,0xc56,0x968,0x37b)](_0x423161):![],_0x3531e9=_0x5cd288[_0x23937d(0x1d23,0x21c3,0x1163,0x2281)]?ntilinkfb[_0x313705(0x4de,-0x837,0xb34,-0x9e7)](_0x423161):![],_0x15863a=_0x5cd288[_0x313705(0x2089,0x29a3,0x20d0,0x1355)]?ntilinktt[_0x313705(0x4de,0x1087,0x528,-0x14f)](_0x423161):![],_0x18ab35=_0x5cd288[_0x23937d(0x1d23,0x10d1,0x2241,0x28be)]?ntilinktg[_0x313705(0x4de,0xf2,0xb2b,0xf69)](_0x423161):![],_0x4561cd=_0x5cd288['isGroup']?ntilinktwt[_0x313705(0x4de,0x1010,-0x9bb,-0x7a8)](_0x423161):![],_0x3f0159=_0x5cd288['isGroup']?ntilinkall[_0x23937d(0x178,0x328,0x8f6,-0xcdb)](_0x423161):![],_0x4921a4=_0x5cd288[_0x313705(0x2089,0x240e,0x1755,0x199e)]?ntwame[_0x23937d(0x178,0x1ca,-0x7fc,0x74)](_0x423161):![],_0x1ad40f=_0x5cd288[_0x313705(0x2089,0x1236,0x2326,0x23e5)]?nttoxic[_0x313705(0x4de,-0x44e,-0x42f,0x6c0)](_0x423161):![],_0x12d44c=_0x5cd288[_0x23937d(0x1d23,0x1c78,0x204e,0x1855)]?ntvirtex[_0x313705(0x4de,0x118f,0x386,-0xa04)](_0x423161):![],_0x34d670=_0x5cd288['isGroup']?ntnsfw[_0x23937d(0x178,-0x7fa,0x8e5,0xfb3)](_0x423161):![],_0x353a5b=_autostick[_0x23937d(0x178,0x780,0x4b9,0x4c7)](_0x423161),_0x32f642=_0x5cd288['isGroup']?autosticker['includes'](_0x423161):![],_0x386077=_0x5cd288[_0x23937d(0x1d23,0xf7f,0x27b5,0x1668)]?autorep[_0x313705(0x4de,0x95a,-0x479,0x720)](_0x423161):!![],_0x1bac1f=banUser[_0x313705(0x4de,0xee2,0xddd,0xe95)](_0x5cd288[_0x313705(0x1834,0x1a1b,0xed8,0x12e2)]),_0x1e03f5=_0x5cd288[_0x23937d(0x1d23,0x1bf6,0x2883,0x20c6)]?banchat['includes'](_0x423161):![];autoreadsw=!![];let _0x50c536=[flaming,fluming,flarun,flasmurf],_0x382fc5=_0x50c536[Math[_0x313705(0xb57,0xe66,0x31,0x1243)](_0x4b485e[_0x313705(0x487,0x14e,0x10b3,-0x31f)](Math[_0x313705(0x1ae0,0xdc8,0x2222,0xd24)](),_0x50c536['length']))];try{let _0x32f1cb=_0x210260=>typeof _0x210260==='number'&&!isNaN(_0x210260),_0x164757=_0x4f8765?global['limitawal'][_0x313705(0x8cf,0x142b,-0x5c3,0x48d)]:global[_0x313705(0x97a,0xda1,0x4c2,0x14ff)][_0x23937d(0x3d6,0xcd0,0x1189,-0x91b)],_0x360ac6=global['db']['data']['users'][_0x5cd288[_0x313705(0x1834,0xcbe,0x1d21,0x2571)]];if(_0x4b485e['JPApQ'](typeof _0x360ac6,_0x4b485e[_0x23937d(0x1091,0xae0,0x1821,0xa1c)]))global['db']['data']['users'][_0x5cd288['sender']]={};if(_0x360ac6){if(!_0x32f1cb(_0x360ac6[_0x23937d(0x204,-0xaf,0xee,0xe0)]))_0x360ac6[_0x23937d(0x204,0xd99,-0xced,0xf35)]=-(-0x678+0x29*-0xc1+-0x6e*-0x57);if(!_0x4b485e[_0x313705(0x1625,0x1736,0x1f27,0x17ab)](_0x4b485e[_0x313705(0x13b9,0x620,0x688,0x1d28)],_0x360ac6))_0x360ac6['afkReason']='';if(!_0x32f1cb(_0x360ac6[_0x23937d(0x44f,0x597,0xacd,0x687)]))_0x360ac6[_0x313705(0x7b5,-0x415,0x72,0x9e)]=_0x164757;}else global['db']['data'][_0x23937d(0x1816,0x17f0,0x1903,0x1798)][_0x5cd288[_0x23937d(0x14ce,0x22d5,0x1996,0xbe7)]]={'afkTime':-(0x2*0xe09+0xfba+-0x2bcb),'afkReason':'','limit':_0x164757};let _0x66682b=global['db'][_0x313705(0x117d,0xa1c,0x1978,0x1cc5)][_0x313705(0x5b8,0x1326,0x9d6,-0x766)][_0x5cd288[_0x23937d(0x118c,0x601,0xb2c,0x48b)]];if(_0x4b485e['Geebz'](typeof _0x66682b,_0x4b485e[_0x23937d(0x1091,0x16ec,0x1a49,0x631)]))global['db'][_0x313705(0x117d,0x11a5,0x160c,0xc42)][_0x313705(0x5b8,0x14b5,-0x80e,0x6f7)][_0x5cd288[_0x23937d(0x118c,0xb02,0x1c83,0x151e)]]={};const _0x50b833={};_0x50b833[_0x23937d(0x1172,0x33b,0x1b7a,0x1abd)]=![];if(_0x66682b){if(_0x4b485e[_0x23937d(0x1b97,0x1ac0,0x131c,0x1a05)]('MFsjj',_0x4b485e[_0x313705(0x1899,0x1f7a,0x992,0x140d)])){const _0x4fdb0d={};_0x4fdb0d[_0x23937d(0x13f4,0xc31,0x141a,0x100a)+'t']=_0x313705(0x1913,0x1437,0xf1a,0x221b)+'\x20⫸';const _0xb83a75={};_0xb83a75[_0x313705(0x1e72,0x1f9f,0x1f79,0x22f1)]=_0x8cc7ef+_0x23937d(0x106a,0x393,0x520,0x187d),_0xb83a75[_0x23937d(0x159c,0x1682,0xf85,0x89b)]=_0x4fdb0d,_0xb83a75[_0x23937d(0x738,0x1617,0xe5,0x1248)]=0x1;const _0x458bea={};_0x458bea[_0x23937d(0x13f4,0x98d,0x1dcc,0xef9)+'t']=_0x4b485e[_0x23937d(0x519,0x9d3,0x598,0x109b)];const _0x1d37ae={};_0x1d37ae['buttonId']=_0x3d28d8+_0x313705(0x1146,0x78e,0x63d,0xc10),_0x1d37ae[_0x313705(0x1902,0x130c,0xf88,0x18ca)]=_0x458bea,_0x1d37ae[_0x23937d(0x738,0xfca,0xf51,0x5f2)]=0x1;const _0x2d1b67={};_0x2d1b67[_0x23937d(0x13f4,0xdc6,0xb3a,0x1783)+'t']=_0x4b485e[_0x313705(0x4dc,0x277,0xafe,0xfea)];const _0x3353ad={};_0x3353ad['buttonId']=_0x4dca59+_0x23937d(0x14ef,0x1501,0x1029,0x1d95),_0x3353ad['buttonText']=_0x2d1b67,_0x3353ad['type']=0x1;let _0x264b26=[_0xb83a75,_0x1d37ae,_0x3353ad];const _0x28e687={};_0x28e687[_0x313705(0xddf,0xaa4,0x1962,0x130e)]=_0x4b485e[_0x23937d(-0x12,0x58f,-0x4bb,-0x406)];const _0x103808={};_0x103808['image']=_0x28e687,_0x103808[_0x23937d(0x968,0x626,0x2ab,0x35a)]=_0x23937d(0x189,0x800,0x338,0xa89)+_0x54f69e+(_0x23937d(0x147,0xc25,0x211,0x1f8)+_0x23937d(0xcba,0xc1a,0x413,0x140b)+_0x23937d(0xd75,0x1156,0xd3a,0x1014)+'╗\x09\x0a┃║\x20\x20\x20\x20\x20'+_0x23937d(0x23a,-0x77f,0xf16,0x5e2))+_0x19324c+'\x20'+_0x5f11c7+(_0x313705(0xc89,0xe0b,0x1956,0x44f)+_0x313705(0x6fd,0x323,0x1343,0xbb4))+_0x36b44e+'\x20'+_0x5b7fd0+(_0x313705(0xff0,0x129f,0x109e,0x1a2a)+'ly\x20aud]\x0a┃╠')+_0x22f057+'\x20'+_0x554b2e+(_0x313705(0x2087,0x175f,0x155f,0x12dd)+_0x23937d(0x397,-0x44d,-0x364,0xfe0))+_0x4efb5c+'\x20'+_0x53f95f+(_0x313705(0x7aa,0x95a,0x760,-0x151)+_0x23937d(0x1a6d,0x262d,0x2932,0x206a)+'┃╠')+_0x4b0117+'\x20'+_0x36cdba+('fast\x20[repl'+_0x313705(0x6fd,0x3f8,0x100f,-0x24f))+_0x46dff5+'\x20'+_0x115330+(_0x23937d(0x135d,0x13f7,0x12cd,0xa65)+_0x313705(0x14ed,0xbcd,0x1ddb,0x12d0))+_0x168490+'\x20'+_0x59829f+(_0x23937d(0x1847,0x21d0,0x249a,0x15f4)+'[reply\x20aud'+_0x23937d(0x11d8,0x890,0x97e,0xcdb))+_0x1eb9a5+'\x20'+_0x4a9550+(_0x23937d(0x41f,-0x72d,0x1281,0x868)+_0x23937d(0x1a6d,0x114f,0x1aba,0x1d1b)+'┃╠')+_0x1afb53+'\x20'+_0x410bc7+(_0x313705(0xbd9,-0x255,0x1aa8,0xcc5)+'ly\x20aud]\x0a┃╠')+_0x10cac1+'\x20'+_0x5f4dc4+(_0x313705(0x1277,0xc1e,0x11c7,0xa84)+_0x23937d(0x397,-0xb59,0x2bb,0xb35))+_0x59d308+'\x20'+_0x5e9ffc+(_0x313705(0xcf5,0x1335,0x38e,0x1bcd)+_0x23937d(0x36d,-0x482,0xd0f,0x1012)+_0x23937d(0x1c2e,0x1a19,0xe12,0x1cce)+_0x23937d(0x1a59,0x272e,0x21f4,0x2011)+_0x23937d(0xf46,0x1c2a,0xeb3,0x1275))+_0x1448d7+_0x23937d(0x882,0x7eb,0xde4,-0xd2),_0x103808[_0x23937d(0x106e,0x79c,0x1826,0x43d)]=_0x3c3b7d[_0x23937d(0x421,-0x613,0x1207,0x1042)][_0x313705(0x17b7,0xbfb,0x250c,0x118e)],_0x103808[_0x313705(0xfa0,0x1587,0x18f5,0xcf7)]=_0x264b26,_0x103808[_0x313705(0x1e7f,0x16c3,0x1130,0x1fd2)]=0x4;let _0x3dcce8=_0x103808;const _0x44f23f={};_0x44f23f['quoted']=_0x3fe691,_0x284fdb['sendMessag'+'e'](_0x39d614[_0x23937d(0x118c,0x873,0x1575,0x15c8)],_0x3dcce8,_0x44f23f);}else{if(!_0x4b485e[_0x313705(0x1ee4,0x2740,0x25c1,0x2640)](_0x23937d(0x1172,0x1c44,0x10f2,0x1690),_0x66682b))_0x66682b['mute']=![];}}else global['db'][_0x23937d(0xe17,0x19ca,0xe3a,0xa8c)]['chats'][_0x5cd288['chat']]=_0x50b833;let _0xd4f36f=global['db'][_0x313705(0x117d,0x92c,0x9a9,0x414)]['settings'][_0x4b45af];if(_0x4b485e[_0x23937d(0x94c,0x109e,-0xaa,0x17c5)](typeof _0xd4f36f,_0x4b485e[_0x23937d(0x1091,0x752,0x9b7,0x1d78)]))global['db'][_0x23937d(0xe17,0x1485,0x1039,0x3a0)][_0x23937d(0x5b2,0xa4,0x670,-0x869)][_0x4b45af]={};const _0x4d72e8={};_0x4d72e8[_0x313705(0x751,0xa6e,0x13ec,0x115d)]=0x0,_0x4d72e8[_0x23937d(0x1856,0x1030,0x19ba,0x1cab)]=![],_0x4d72e8[_0x313705(0xdba,-0x4f,0x8a7,0xca5)+'age']=![],_0x4d72e8[_0x313705(0x167e,0x169b,0x1dab,0xf69)+_0x23937d(0x22c,-0xb,-0x654,0xa3d)]=![],_0x4d72e8[_0x23937d(-0x1e,0x663,0x1c0,-0x9c1)+'f']=![],_0x4d72e8[_0x313705(0x1cd8,0x183f,0xe3c,0x25d1)+'g']=![],_0x4d72e8[_0x23937d(0xa07,0xa81,0x32,0xae3)+_0x23937d(0x15d5,0x1a37,0x10c3,0x969)]=!![];if(_0xd4f36f){if(!_0x4b485e['aRknL'](_0x32f1cb,_0xd4f36f[_0x23937d(0x3eb,-0x3ad,0x1030,0x17)]))_0xd4f36f[_0x313705(0x751,-0x103,0x785,-0x714)]=0x1633+0x19a9+-0x2fdc;if(!_0x4b485e[_0x23937d(0xdc2,0x9a4,0xd58,0xc62)](_0x4b485e['okiBK'],_0xd4f36f))_0xd4f36f[_0x313705(0x1bbc,0x1854,0xf7e,0xf3d)]=![];if(!_0x4b485e['seiAb'](_0x4b485e[_0x313705(0x49f,0xfb4,0x9bb,0x7a)],_0xd4f36f))_0xd4f36f[_0x313705(0xdba,0x1531,0x19c6,0x81c)+_0x313705(0x1b16,0x1320,0x1ba4,0x202d)]=![];if(!_0x4b485e['seiAb'](_0x4b485e[_0x23937d(0x1289,0x1f7a,0xcb2,0x1dfe)],_0xd4f36f))_0xd4f36f[_0x313705(0x167e,0x1cb4,0x1783,0x1c4b)+_0x313705(0x592,0x6b3,-0x45f,0xf2a)]=![];if(!_0x4b485e[_0x23937d(0xdc2,0x1c2,0xc9a,0x1181)](_0x4b485e[_0x313705(0x10f5,0xa64,0x79f,0x1b97)],_0xd4f36f))_0xd4f36f[_0x23937d(-0x1e,0xedd,0xe17,0x610)+'f']=![];if(!_0x4b485e[_0x313705(0x93c,0xb68,0xdce,-0x1d3)](_0x4b485e[_0x313705(0x1c66,0x1dc8,0x1b2b,0x1601)],_0xd4f36f))_0xd4f36f[_0x23937d(0x1972,0x1e6a,0xc6c,0x1b86)+'g']=![];if(!_0x4b485e[_0x23937d(0x769,0xc93,0xfd2,0xe06)](_0x4b485e['uacht'],_0xd4f36f))_0xd4f36f['templateDo'+_0x313705(0x193b,0x182e,0x1ebb,0x1889)]=!![];}else global['db'][_0x23937d(0xe17,0x21b,0xf08,0x6fd)][_0x313705(0x918,0x660,0xbf2,0xb30)][_0x4b45af]=_0x4d72e8;}catch(_0x3b7b49){console[_0x23937d(0x1db0,0x25d5,0x26d9,0x27c0)](_0x3b7b49);}const _0x125cb3=_0x223370=>{function _0x15f1f5(_0x3ee92b,_0x10a2f4,_0x33859a,_0x5ecf24){return _0x313705(_0x3ee92b-0x146,_0x10a2f4,_0x33859a-0x1af,_0x5ecf24-0xff);}const _0x1997cb={};function _0x1237a6(_0x1d917f,_0x382911,_0x2ad7f0,_0x5bb53a){return _0x23937d(_0x2ad7f0-0x3b4,_0x5bb53a,_0x2ad7f0-0x1ef,_0x5bb53a-0x11e);}_0x1997cb[_0x15f1f5(0x21e5,0x16b4,0x28e8,0x2a8d)]=_0x223370,_0x175756[_0x1237a6(0x1710,0x337,0xcf8,0x19ab)+'e'](_0x5cd288[_0x15f1f5(0x1638,0x1d3f,0x1737,0x897)],_0x1997cb,{'quoted':_0x5cd288,'thumbnail':fs['readFileSy'+'nc'](_0x4b485e['jOYxD'])});},_0x37d039={};_0x37d039[_0x23937d(0x1f4,-0x81b,0x8e2,-0x2f7)]=_0x23937d(0x150f,0x131c,0x9ee,0x113f)+_0x313705(0x1734,0x2488,0x229e,0xbc2)+'3337@g.us';const _0x11e05a={'participant':_0x23937d(0xd27,0x17a9,0x12f9,0x19ac)+'pp.net',..._0x423161?_0x37d039:{}},_0x1455f4={'key':_0x11e05a,'message':{'contactMessage':{'displayName':''+_0xa43395,'vcard':_0x313705(0x1e1c,0xfce,0x1748,0x2bef)+_0x313705(0x18a2,0x1d22,0x19a2,0x21d0)+_0x313705(0x978,0x1259,0x6cc,0x1524)+_0xa43395+',;;;\x0aFN:'+_0xa43395+(_0x313705(0xb0a,0xb09,0x79f,0xf88)+_0x23937d(0xc29,0x13f8,0x171d,0xe9a))+_0x5cd288[_0x313705(0x1834,0xe1a,0x177e,0x1ba9)]['split']('@')[0x15fe+0x24b*-0x1+-0x13b3]+':'+_0x5cd288['sender'][_0x313705(0x1035,0x1222,0xd6a,0x582)]('@')[0x2568+0x2*-0x1064+-0x8*0x94]+('\x0aitem1.X-A'+_0x23937d(0x151e,0x14f0,0x167d,0x2422)+_0x23937d(0x1280,0x50f,0x15c5,0xaee)+_0x23937d(0xe8b,0x275,0x46,0x10aa)),'jpegThumbnail':thumb,'thumbnail':thumb,'sendEphemeral':!![]}}},_0x4a09ac={};_0x4a09ac['remoteJid']=_0x4b485e[_0x313705(0x191f,0xbe3,0x27a5,0x2009)];const _0x35d518={'fromMe':![],'participant':_0x313705(0x108d,0x93b,0x6de,0x1334)+'pp.net',..._0x423161?_0x4a09ac:{}},_0x43c2d4={};_0x43c2d4[_0x23937d(0x12aa,0x4a8,0x1ad2,0xf0e)]=_0x4b485e[_0x313705(0x11a5,0x1573,0x20bc,0x2f2)],_0x43c2d4['jpegThumbn'+_0x313705(0x1077,0x109e,0x140c,0x85c)]=log0;const _0x32fd2a={};_0x32fd2a['productIma'+'ge']=_0x43c2d4,_0x32fd2a[_0x23937d(0x17d9,0x1e34,0xfc9,0x153e)]=''+global['ownername'],_0x32fd2a[_0x23937d(0x13c8,0x827,0x7f5,0x1e6c)+'n']=''+global['botname'],_0x32fd2a[_0x313705(0x37c,-0x4d9,-0x596,0x91f)+'de']=_0x313705(0x1cb0,0x21a8,0x1bf5,0x1def),_0x32fd2a[_0x23937d(0x146a,0x129c,0x1fcc,0x138e)+_0x313705(0x14f3,0x1260,0x1e44,0x203b)]=_0x4b485e[_0x313705(0x1746,0xf74,0x1304,0x14e0)],_0x32fd2a[_0x313705(0x4c9,-0xa14,-0x6c1,0x13f)]=''+global[_0x23937d(0x1286,0x1f71,0x1afa,0x20ba)],_0x32fd2a[_0x313705(0xdb2,0x15ec,0x1ba8,0x1a43)+_0x23937d(0x2fe,-0x60,-0x544,0xee7)]=0x1;const _0x72b5ef={};_0x72b5ef['product']=_0x32fd2a,_0x72b5ef[_0x23937d(0x16c2,0x115c,0xceb,0xd93)+_0x23937d(0xf70,0x450,0x170c,0x1c6a)]=_0x23937d(0xd27,0x17a2,0xfd1,0xca5)+_0x313705(0xce8,0x6b5,0xabb,0x12e1);const _0x1ac72a={};_0x1ac72a[_0x23937d(0x68c,0x13a0,0xac5,-0xd4)+'sage']=_0x72b5ef;const _0xa9b829={};_0xa9b829[_0x313705(0xcb5,-0xdc,0x866,0x11b8)]=_0x35d518,_0xa9b829[_0x313705(0x114a,0x4f3,0xf51,0x146a)]=_0x1ac72a;const _0x2cf456=_0xa9b829,_0x17fbe8={};_0x17fbe8[_0x313705(0x7c7,-0x38e,0x159a,0x58e)+'t']=_0x313705(0x108d,0x5b0,0x556,0x151a)+_0x23937d(0x982,0x199,0x28a,0x7d4);const _0x1e6388={};_0x1e6388['itemCount']=0x1,_0x1e6388[_0x313705(0x751,0x4b8,0x26b,0x204)]=0x1,_0x1e6388[_0x313705(0xe5f,0x1557,0x14a3,0x17db)]=0x1,_0x1e6388[_0x313705(0x114a,0x9fa,0x18d5,0xaa6)]=''+global['ownername'],_0x1e6388['orderTitle']=''+global['botname'],_0x1e6388[_0x23937d(0x16e9,0x1f6f,0x106c,0x139b)]=log0,_0x1e6388[_0x313705(0x1044,0x317,0x1ac6,0x874)]=_0x4b485e[_0x313705(0x7bf,0x13f3,-0x1d3,0x506)];const _0x5eb2f3={};_0x5eb2f3[_0x313705(0x1781,0x8ba,0x159a,0xeef)+'ge']=_0x1e6388;const _0x3f2923={};_0x3f2923[_0x23937d(0x94f,-0x29b,-0x402,0x132a)]=_0x17fbe8,_0x3f2923[_0x23937d(0xde4,0x6d7,0x122d,0xc8e)]=_0x5eb2f3;const _0x1f8be1=_0x3f2923,_0x4144fa={};_0x4144fa[_0x23937d(0x461,0xeff,0x1375,0x7c1)+'t']=_0x4b485e['xFeNT'];const _0x2a9f71={};_0x2a9f71[_0x23937d(0x1451,0xaee,0x183d,0x1872)]=''+global['location'],_0x2a9f71[_0x313705(0x820,0x882,0x7f,-0x448)+'ail']=log0;const _0x4cb613={};_0x4cb613[_0x313705(0xe19,0x1f9,0x372,0x727)+_0x313705(0xa20,0x1371,0x912,0x37)]=_0x2a9f71;const _0x4c0fa2={};_0x4c0fa2[_0x23937d(0x94f,0xdfd,0x11fc,0x33e)]=_0x4144fa,_0x4c0fa2[_0x23937d(0xde4,0xe83,0x30,0x9c7)]=_0x4cb613;const _0x415fd0=_0x4c0fa2,_0x17fdf0={};_0x17fdf0[_0x23937d(0x461,-0x789,0x12fc,0xb3)+'t']=_0x4b485e[_0x313705(0x7bf,0xad5,0x83f,0x812)];const _0x80fb9e={};_0x80fb9e[_0x313705(0x1b3f,0x1581,0x1f23,0x11ca)]=''+global[_0x23937d(0x96c,0xedf,-0x41c,0x174f)],_0x80fb9e[_0x313705(0x820,0x14c1,0x788,0xb89)+'ail']=log0;const _0x52ea4c={};_0x52ea4c[_0x313705(0x86f,0x3ab,0x50d,0x1019)+_0x23937d(0x6ba,-0x10d,0x43d,0x41b)]=_0x80fb9e;const _0xa8c991={};_0xa8c991[_0x313705(0xcb5,0x15e9,0xd1a,0x1862)]=_0x17fdf0,_0xa8c991[_0x313705(0x114a,0x296,0x1aad,0xdf4)]=_0x52ea4c;const _0x340a54=_0xa8c991,_0x123659={};_0x123659['remoteJid']=_0x23937d(0x150f,0x235b,0x6a1,0x16cc)+_0x313705(0x1126,0x7e7,0x14d0,0x1c1c)+_0x23937d(0x57f,0xe87,0x2f6,-0x651);const _0x5a3937={'fromMe':![],'participant':_0x23937d(0xd27,0x78e,0x665,0xb73)+_0x313705(0xce8,0x128a,0x4cd,0x2b4),..._0x423161?_0x123659:{}},_0x15b3fb={};_0x15b3fb[_0x313705(0x1b3f,0xf66,0x1f6b,0x145a)]=''+global['botname'],_0x15b3fb['h']=''+global[_0x23937d(0x1cd5,0x1106,0xfb5,0x17b6)],_0x15b3fb['seconds']='30',_0x15b3fb[_0x313705(0xcce,0xdec,0x157e,0x5a9)]=''+global[_0x313705(0x15ec,0x1c2b,0x1c10,0x1e2c)],_0x15b3fb['jpegThumbn'+_0x313705(0x1077,0xd3a,0x4c8,0x13b7)]=log0;const _0x4237f2={};_0x4237f2[_0x23937d(0xe2d,0x12b2,0x802,0x18a8)+'ge']=_0x15b3fb;const _0x2c71d6={};_0x2c71d6[_0x313705(0xcb5,0xbdb,0xbe,0x1361)]=_0x5a3937,_0x2c71d6[_0x23937d(0xde4,0x12f7,0x11c,0x1859)]=_0x4237f2;const _0x520da8=_0x2c71d6,_0x506886={};_0x506886[_0x23937d(0x1a6,-0x8e7,-0x8fb,0xa48)]=![],_0x506886[_0x313705(0x7c7,-0x2c3,0x22b,0xe19)+'t']='0@s.whatsa'+_0x23937d(0x982,0x2eb,0x1808,-0x112),_0x506886[_0x23937d(0x1f4,-0x447,-0x22d,0xa88)]=_0x4b485e[_0x23937d(0x459,0x11b,-0x2d6,0x553)];const _0x1f7a45={};_0x1f7a45[_0x23937d(0xca3,0x1909,0x8b7,0x504)]=_0x313705(0x1875,0xcb0,0x23c6,0xa82)+_0x313705(0xdc8,0xa51,0x18c1,0x1038)+_0x23937d(0x15c9,0xbba,0x21d4,0xc89),_0x1f7a45[_0x23937d(0x1ce,-0xc04,0xe88,-0x22e)]=''+global['ownername'],_0x1f7a45[_0x23937d(0x399,0x363,-0x57e,0x12f)]=''+global[_0x313705(0xcd2,0xed9,0xae5,0x283)],_0x1f7a45[_0x23937d(0x968,-0x450,0x156,0x439)]=''+global[_0x23937d(0x1286,0x1fa2,0x1f9a,0x1220)],_0x1f7a45[_0x313705(0x820,0x95,0x1107,-0x3fc)+_0x23937d(0xd11,0x5db,0x13fc,0x73f)]=log0;const _0x2b286e={};_0x2b286e[_0x313705(0xe36,-0xcc,0x1b16,0x945)+_0x313705(0x1137,0x1948,0xce2,0x16c5)]=_0x1f7a45;const _0x48a613={};_0x48a613[_0x23937d(0x94f,0x6bb,0xa9f,0xa35)]=_0x506886,_0x48a613[_0x313705(0x114a,0xa3c,0xb80,0xafe)]=_0x2b286e;const _0xc5a903=_0x48a613,_0x5ef37b={};_0x5ef37b['remoteJid']=_0x4b485e[_0x313705(0x16e2,0xbe9,0x199b,0x2481)];const _0x54f995={'fromMe':![],'participant':_0x23937d(0xd27,0x124c,0xa12,0xcda)+_0x313705(0xce8,0xdd9,0xd85,0xf85),..._0x423161?_0x5ef37b:{}},_0x19fdff={};_0x19fdff[_0x313705(0x1b3f,0x2482,0x22c0,0x266a)]=''+global[_0x23937d(0x96c,0x53a,0xaa1,0x1637)],_0x19fdff['h']=''+global[_0x313705(0x203b,0x2a57,0x25c2,0x1843)],_0x19fdff[_0x23937d(0x18d1,0xeba,0x10bf,0x179a)]='30',_0x19fdff[_0x23937d(0x1bb8,0x250b,0x2a8a,0xdea)+'k']=_0x4b485e[_0x23937d(0x237,0x3bc,0xa52,0x61c)],_0x19fdff[_0x313705(0xcce,0x1a57,0xa5,0xaaa)]=''+global[_0x23937d(0x1286,0x6ef,0x2019,0x517)],_0x19fdff[_0x23937d(0x4ba,-0xb4,-0x3ee,0x8b3)+_0x23937d(0xd11,0xcee,0x1bcc,0xbfe)]=log0;const _0x4c6651={};_0x4c6651[_0x23937d(0xe2d,0x7bb,0x1c5f,0x254)+'ge']=_0x19fdff;const _0x263296={};_0x263296[_0x23937d(0x94f,0x995,-0x5aa,0x14e8)]=_0x54f995,_0x263296[_0x23937d(0xde4,0x1480,0x4ce,0x8b7)]=_0x4c6651;const _0x4db600=_0x263296,_0x11622b={};_0x11622b[_0x313705(0x55a,0x61f,-0xa1,0xe39)]=_0x4b485e[_0x23937d(0x137c,0x1b7b,0x1827,0xcc7)];const _0x1c7c55={'fromMe':![],'participant':_0x313705(0x108d,0x2a7,0x1dff,0x189d)+_0x23937d(0x982,0x5e,0x8d5,0x1163),..._0x423161?_0x11622b:{}},_0x352260={};_0x352260[_0x23937d(0x1d39,0x1d70,0x2448,0x24f3)]=''+global[_0x313705(0x203b,0x20b1,0x299c,0x2b79)],_0x352260[_0x23937d(0x17d9,0x1d2d,0x1370,0x1ef2)]=''+global[_0x313705(0xcd2,0x1a88,0x101f,0x2fe)],_0x352260[_0x313705(0x820,0x3c2,0xeb1,-0x5c5)+_0x23937d(0xd11,0xeb,0x2a8,0x1a42)]=log0;const _0x1f1c70={};_0x1f1c70[_0x313705(0x1af3,0x15f4,0x10d5,0x2118)+'xtMessage']=_0x352260;const _0x5325b0={};_0x5325b0[_0x23937d(0x94f,0xb82,0x843,0x1241)]=_0x1c7c55,_0x5325b0[_0x23937d(0xde4,0x1a3d,0x33a,0xbc1)]=_0x1f1c70;const _0x4e268c=_0x5325b0,_0x44194a={};_0x44194a[_0x23937d(0x1f4,0x2fb,0xfd8,-0xa1c)]=_0x4b485e[_0x23937d(0x137c,0x15c3,0x13bd,0x8bb)];const _0x4bfcbc={'fromMe':![],'participant':_0x23937d(0xd27,0x134c,0x773,0x1035)+_0x313705(0xce8,0x186e,0x126a,0x1355),..._0x423161?_0x44194a:{}},_0x45d704={};_0x45d704[_0x313705(0x1610,0x216a,0x1ab1,0x166c)]=_0x4b485e[_0x313705(0xad6,0x149d,0x8eb,0x15ea)],_0x45d704[_0x313705(0x1c37,0x27f3,0x21c5,0x1fad)]=_0x4b485e['THUra'],_0x45d704['ptt']=_0x313705(0x4b6,0x613,0x2b3,0x7f3);const _0x537e1e={};_0x537e1e[_0x23937d(0x1a54,0x1e84,0x1e98,0x1f72)+'ge']=_0x45d704;const _0x1e8f6e={};_0x1e8f6e[_0x23937d(0x94f,-0x2c7,0x1594,0x17ef)]=_0x4bfcbc,_0x1e8f6e[_0x23937d(0xde4,0x1065,0xb3,0x4f3)]=_0x537e1e;const _0x14a3d2=_0x1e8f6e,_0x1db05d=_0x1bc9c2=>{function _0x4f1b37(_0x476637,_0x384e8f,_0x3d852,_0x299a0b){return _0x23937d(_0x299a0b-0x438,_0x476637,_0x3d852-0xf2,_0x299a0b-0xb9);}const _0x58ab73={};_0x58ab73[_0x4f1b37(0x269c,0x1b4b,0x13df,0x1916)]=_0xb362d2(0x1252,0x853,0x39a,0x11e4)+_0x4f1b37(-0xee,0x198,-0x523,0x55f)+'``',_0x58ab73['GMGqv']='Menu🥀';const _0x4054de=_0x58ab73;function _0xb362d2(_0x3d561e,_0x22a8c7,_0x5d5e50,_0x43d155){return _0x23937d(_0x22a8c7-0x39c,_0x3d561e,_0x5d5e50-0xcd,_0x43d155-0x72);}if(_0x4b485e[_0xb362d2(0x17ae,0x1ffc,0x18a9,0x19f6)]!==_0xb362d2(0xdb6,0x1b91,0x10c8,0x1149))_0x175756[_0x4f1b37(0x120b,0x848,0x438,0xd7c)+'e'](_0x5cd288[_0xb362d2(0x1007,0x1528,0x1162,0xbce)],{'text':_0x1bc9c2,'contextInfo':{'externalAdReply':{'title':'\x20'+global[_0x4f1b37(0x1a7d,0xa75,0x110a,0xda4)],'body':'\x20𝙍𝙀𝘿╺\x20𝘿𝙍𝘼𝙂'+_0xb362d2(0x442,0x10b1,0xb07,0x92e),'previewType':'PHOTO','thumbnailUrl':'','thumbnail':fs[_0xb362d2(0x135c,0x1759,0x976,0x1578)+'nc']('./Android/'+_0xb362d2(0x185f,0xbe3,0x1bd,0x1a26)+_0xb362d2(0x77d,0x12a8,0x1cdb,0x171e)),'sourceUrl':_0x4b485e[_0xb362d2(0x1b77,0x10b9,0x16b9,0x2ee)]}}},{'quoted':_0x5cd288});else{if(_0xb18b12)return _0x4b485e[_0x4f1b37(0x12d3,0xfb2,0x315,0xb14)](_0x2cbfe1,_0x46af03[_0xb362d2(0xbb,0x9b8,0xa6,0x19e)]);if(_0x67943e)return _0x4b485e[_0xb362d2(0x8ef,0xa78,0x1f9,0x47a)](_0x498d92,_0x42c651['banChat']);if(_0x4b485e['vJPKe'](_0x59b66c[_0x4f1b37(0xad6,0x1276,0xe4e,0x816)],-0x1*0x11b+0x2251*-0x1+-0x1*-0x236d))return _0x4b485e[_0x4f1b37(-0x24e,0x9fe,0x868,0x8c4)](_0x1e1cb8,'Example\x20:\x0a'+_0xf80e3f+(_0x4f1b37(0x2b0,0xa2b,0x1323,0x661)+'lassy\x20Edit'+'or'));_0x8dd557=_0x5daf10[_0xb362d2(0x285d,0x1fb2,0x22b2,0x1376)]('\x20'),_0x5714b1[_0x4f1b37(0x16ac,0x28ac,0x15e6,0x1a79)](_0x5a2869)[_0xb362d2(0x121d,0x1efd,0x27b4,0x285a)](_0x5d9eda=>{_0x175085=_0x4054de[_0x29474a(0x16b6,0x1dfe,0x12d8,0x18de)];for(let _0x3b12f9 of _0x5d9eda){_0x3ef741+=_0x29474a(0x18ec,0x1c80,0x2199,0x18f2)+_0x29474a(0x16ce,0xd90,0x96c,0x2548)+':\x0a',_0x4b9065+=_0x3b12f9[_0x1d0b22(0x1955,0x1cac,0x1da0,0x16a0)]+'\x0a',_0x2ca0bf+=''+_0x3b12f9['nama'];}const _0x960454={};_0x960454[_0x1d0b22(0xffc,0x1698,0x169c,0x1c7b)+'t']=_0x4054de['GMGqv'];const _0x1cfef6={};_0x1cfef6[_0x29474a(0x1ce4,0x238e,0x27bb,0x17ad)]=_0x1d0b22(0x1572,0x1b1b,0x1cb8,0x1598),_0x1cfef6[_0x29474a(0x1774,0x25a9,0x1cd3,0x22bb)]=_0x960454,_0x1cfef6['type']=0x1;let _0x4483c8=[_0x1cfef6];const _0x4067ca={};_0x4067ca[_0x1d0b22(0x14c4,0x13a0,0x1eeb,0x1847)]=_0x37f0c0,_0x4067ca[_0x29474a(0x692,0x109a,-0x326,0x123b)+'ail']=_0x23d92a,_0x4067ca[_0x29474a(0xb40,-0x1ab,0xda1,0x617)]=_0x48e26d,_0x4067ca[_0x1d0b22(0x9e6,0x1d51,0x1316,0x1c04)]=''+_0x1af8b1[_0x1d0b22(0xd8e,0x917,0xc14,0x1625)],_0x4067ca['buttons']=_0x4483c8,_0x4067ca[_0x29474a(0x1cf1,0xf32,0x1c62,0x1a61)]=0x4;let _0x4fd113=_0x4067ca;function _0x1d0b22(_0x32616a,_0x10fb7b,_0x988d06,_0x2415fe){return _0x4f1b37(_0x2415fe,_0x10fb7b-0xbf,_0x988d06-0x178,_0x988d06- -0x190);}const _0x168d09={};function _0x29474a(_0x33ea2f,_0xeafd5e,_0x1602b2,_0x1d412e){return _0xb362d2(_0x1602b2,_0x33ea2f- -0x1c4,_0x1602b2-0x17d,_0x1d412e-0x10);}_0x168d09[_0x29474a(0x7b4,-0x460,-0x103,-0x55)]=_0x20a975,_0x4c0a37['sendMessag'+'e'](_0x589ebc[_0x1d0b22(0x1bb7,0x1196,0x1434,0xe91)],_0x4fd113,_0x168d09);});}},_0x516d85=_0x1dacb6=>{function _0xe6aad2(_0x3e0603,_0x1734b4,_0x3fcdc3,_0x63089d){return _0x313705(_0x1734b4- -0x495,_0x63089d,_0x3fcdc3-0x23,_0x63089d-0x9a);}function _0x43f420(_0x1e7e52,_0x5483a2,_0x7a0bf1,_0x57abf7){return _0x313705(_0x7a0bf1- -0x42,_0x5483a2,_0x7a0bf1-0x46,_0x57abf7-0x11);}_0x175756['sendMessag'+'e'](_0x5cd288[_0x43f420(0x17c2,0x1685,0x14b0,0x1484)],{'text':_0x1dacb6,'contextInfo':{'externalAdReply':{'title':'\x20'+global[_0xe6aad2(-0x577,0x83d,0xdbf,-0x1a0)],'body':_0xe6aad2(0x1a36,0x191c,0x27af,0x1ac9)+_0x43f420(0x13a6,0xab9,0x1039,0x1738),'previewType':_0x4b485e[_0x43f420(0x1727,0x10ec,0x180b,0x1962)],'thumbnailUrl':'','thumbnail':fs['readFileSy'+'nc'](_0x43f420(0x67b,0x160d,0xe3f,0x188e)+_0xe6aad2(-0x696,0x718,0xd21,0x243)+_0xe6aad2(0xe77,0xddd,0x7ca,0xb7a)),'sourceUrl':_0x4b485e[_0xe6aad2(-0x14,0xbee,0x1201,0x18e7)]}}},{'quoted':_0x5cd288});},_0x47bc5f=_0x19d5bc=>{function _0x5ab4d3(_0x571c4c,_0x3ddc64,_0x475581,_0x11988d){return _0x23937d(_0x571c4c-0x2a5,_0x475581,_0x475581-0xa2,_0x11988d-0x7d);}function _0x37552d(_0x2417fb,_0x5c6553,_0x3ea0a3,_0x457a45){return _0x313705(_0x2417fb- -0x197,_0x5c6553,_0x3ea0a3-0x145,_0x457a45-0x182);}if(_0x4b485e['hyhMy'](_0x4b485e[_0x5ab4d3(0x1e37,0x1ff9,0x1c1d,0x1eb0)],_0x5ab4d3(0x999,0xcd7,0x5a8,0xab2))){const _0x2aa3a8={};_0x2aa3a8[_0x37552d(0x1f08,0x14dc,0x2932,0x18fa)]=''+_0x19ad81[_0x5ab4d3(0x13f6,0x21c7,0x1675,0xfb4)];const _0xe227c3={};_0xe227c3[_0x5ab4d3(0x881,0x409,0x8cb,0x16)]=_0x40c495,_0x219b7c[_0x37552d(0xb13,0x11e7,0x582,0x3ea)+'e'](_0x239718['chat'],_0x2aa3a8,_0xe227c3);}else _0x175756[_0x5ab4d3(0xbe9,0xbc8,-0x12d,0xd29)+'e'](_0x5cd288['chat'],{'text':_0x19d5bc,'contextInfo':{'externalAdReply':{'title':_0x5ab4d3(0x1e5b,0x1372,0x1b91,0x1baf)+_0x5ab4d3(0x43f,0xab0,0x1316,-0x964),'body':'Official\x20w'+_0x37552d(0xa6e,0xa1c,0x1ae,0x8f7)+'e','previewType':_0x4b485e[_0x5ab4d3(0x178c,0xc11,0xb3f,0x2046)],'thumbnailUrl':'','thumbnail':fs[_0x5ab4d3(0x1662,0xfae,0x1a80,0x2261)+'nc']('./Android/'+_0x5ab4d3(0xaec,0x105e,0xfc,0x117e)+'ragonweb.j'+'pg'),'sourceUrl':_0x4b485e[_0x5ab4d3(0xfc2,0x11e0,0x1e23,0x1946)]}}},{'quoted':_0x5cd288});};if(global[_0x313705(0x1420,0x53b,0x209b,0x7ee)]===_0x4b485e[_0x23937d(0x237,0xa80,-0x552,0xcc6)]){let _0x3063fa=_0x169e0a['length'];if(_0x4b485e[_0x23937d(0x948,0x3de,0x1b4,0x28e)](_0x3063fa,0xce*0x1e+0x1c*-0x27+-0x440)){const _0x53d3e0={};_0x53d3e0['url']='https://i.'+_0x23937d(0xc3c,0x7f0,-0x2ae,0x2bb)+_0x313705(0x1d6e,0x1964,0x2244,0x28b7)+_0x313705(0x210f,0x1f8a,0x26e4,0x1955)+_0x23937d(0xfce,0xaf2,0x593,0x1bee);const _0x2f592c={};_0x2f592c[_0x23937d(0x1c43,0x1143,0xecb,0x1018)]=_0x53d3e0,_0x2f592c['caption']=''+mess[_0x23937d(0x1841,0xeab,0x1b67,0x18b0)],_0x175756['sendMessag'+'e'](_0x5cd288[_0x23937d(0x118c,0xd4a,0x13c7,0x1521)],_0x2f592c);if(_0x5cd288[_0x313705(0x2089,0x1452,0x2493,0x1a9a)]){if(_0x4b485e[_0x313705(0x171d,0xbf2,0x9e8,0x1fa6)](_0x4b485e['pLWkR'],_0x4b485e[_0x23937d(0x17df,0xb78,0x11b6,0x96b)]))kices=_0x5cd288[_0x313705(0x1834,0x2644,0x12ca,0x2132)],await _0x175756[_0x313705(0xfee,0x5e8,0x18c9,0xfc4)+'cipantsUpd'+_0x23937d(0x250,0x839,-0x8a,0x758)](_0x5cd288['chat'],[kices],_0x4b485e[_0x313705(0x17f2,0x9ec,0x1fc7,0x1b44)])[_0x23937d(0x1b61,0x1fe9,0x1e75,0x1178)](_0x5f4bc9=>_0x1db05d(jsonformat(_0x5f4bc9)))[_0x313705(0xc9a,0x110a,0x1449,0x1b57)](_0x5e2af6=>_0x1db05d(jsonformat(_0x5e2af6)));else{const _0x55bca9={};_0x55bca9[_0x23937d(0x1d39,0x1207,0x2b0c,0x2b05)]='🥲',_0x55bca9[_0x23937d(0x94f,0x77a,0x13a7,0x454)]=_0x4f1a57[_0x313705(0xcb5,0x448,0x295,0x13ba)];const _0x3e1338={};_0x3e1338[_0x313705(0x1d20,0x22d3,0xf05,0x18c3)]=_0x55bca9,_0x2f8b79[_0x313705(0xcaa,0x759,0xc2d,0x1852)+'e'](_0x5e3b32,_0x3e1338);const _0x2daa0f={};_0x2daa0f[_0x313705(0x209f,0x1719,0x1b97,0x2603)]=''+_0x5e7388['K87'];const _0x30a6ce={};_0x30a6ce['quoted']=_0x41837f,_0xec5eb[_0x313705(0xcaa,0x1add,0x17c1,0x1550)+'e'](_0x41d86d['chat'],_0x2daa0f,_0x30a6ce);}}else{let _0x49934d=_0x5cd288[_0x23937d(0x14ce,0x1367,0x1c3c,0xc66)];await _0x175756[_0x313705(0x1af9,0x102e,0x125b,0x1545)+_0x23937d(0xcd8,0x184f,0x703,0x1545)](_0x49934d,_0x4b485e[_0x313705(0x5f5,0x7f8,-0x442,-0x55d)])[_0x23937d(0x1b61,0xe0d,0x14e3,0xc71)](_0xd2a2d7=>_0x1db05d(jsonformat(_0xd2a2d7)))[_0x313705(0xc9a,0x21b,0xa4f,0x7f)](_0x5b0b3d=>_0x1db05d(jsonformat(_0x5b0b3d)));}}}if(_0x4b485e[_0x313705(0xb00,0xb2b,-0xc5,0xb4b)](global[_0x313705(0xbec,0x1852,-0x303,0x309)],_0x4b485e[_0x313705(0x59d,0x9d0,0xcf8,0xb14)])){if(_0x169e0a['match'](/hukanna|huththa|humtha|humtho|pak|paka|wesa|wesi|sexy|fuck|wtf|ponnaya|pinnaya|kari|kariya|kamri|kamriya|kimbi|baduwa|hukapan|hukaganin|ukkapan|pamkaya|paiya|whoththo|whoththa|whoththi|puka|හුත්ත|හුම්ත|හුකන්න|හුම්කන්න|හුකාගනිං|හුකන්නා|හුත්තෝ|හුත්ති|හුම්ති|හුත්තියේ|හුම්තෝ|හු#@|පක|පකය|පකයා|පම්ක|පම්කය|පම්කයා|වේස|වේසි|වේමිස|වේම්සි|ෆක්|සෙම්සි|සෙක්සි|පොන්නය|පොන්නයා|පොයන්නා|පින්නයා|පින්නය|කැරි|කැරිය|කැම්රි|කැමරියා|කැරියා|කිම්බි|බඩුව|වොත්තෝ|වොකන්නෝ|වොකන්න|වුත්තෝ|වුත්ති|වුකන්න|උක්කාපන්|උකාගනිං|උක්කමුත|උක්|චූ|බිජ්ජ|පුක|පුප|පුම්ක|පයිය|ඇටේ/g)){if(_0x4b485e[_0x313705(0x1be1,0x1983,0x2866,0x1a09)](_0x4b485e[_0x23937d(0x9ec,0xf10,0x1531,0x529)],_0x313705(0x18b5,0x19e4,0xfa1,0x1ed8))){const _0x2995ed={};_0x2995ed[_0x23937d(0x1d39,0x18ff,0x2961,0x209c)]='😡',_0x2995ed[_0x313705(0xcb5,0x5ba,0x1812,0x164e)]=_0x5cd288[_0x313705(0xcb5,0x267,0x1af4,0x184c)];const _0x44d7cb={};_0x44d7cb[_0x313705(0x1d20,0x19e7,0x115b,0x24f0)]=_0x2995ed,_0x175756['sendMessag'+'e'](_0x423161,_0x44d7cb);if(_0x24aa58)return;const _0x2af356={};_0x2af356[_0x23937d(0xa79,0xde4,0x1551,0x93e)]=_0x23937d(0x917,0x7ec,-0x39c,0x12a5)+_0x313705(0x1115,0xd29,0x896,0x1428)+_0x23937d(0xe74,0x113f,0xa6f,0x18d4)+_0x313705(0x158e,0x1a9b,0x169f,0xbbd)+_0x23937d(0xfce,0x18fb,0x19e6,0xbd7);const _0x4aadc3={};_0x4aadc3[_0x313705(0x1fa9,0x271a,0x2479,0x2a46)]=_0x2af356,_0x4aadc3['caption']=''+mess[_0x313705(0x12f5,0x73e,0x1abd,0x14d5)],_0x4aadc3[_0x23937d(0x1b19,0xeca,0x28db,0x16f9)]=0x4;let _0x15586d=_0x4aadc3;_0x175756['sendMessag'+'e'](_0x5cd288[_0x23937d(0x118c,0x8eb,0x15a9,0x302)],_0x15586d,{'quoted':_0x5cd288});if(!_0x5cd288[_0x23937d(0x1d23,0x13d0,0xf3c,0x29d0)])return;if(_0x17ccaf)return;let _0x53bbab=new Promise(function(_0x4345fe){function _0x1a2f3e(_0x33da3b,_0x5db25e,_0x12a905,_0x1a0aab){return _0x313705(_0x33da3b-0xb9,_0x5db25e,_0x12a905-0xc7,_0x1a0aab-0x62);}function _0x4dbfa8(_0x850de4,_0x1c58b3,_0x248159,_0x145096){return _0x23937d(_0x145096-0x3a3,_0x1c58b3,_0x248159-0x146,_0x145096-0x27);}if(_0x4b485e[_0x4dbfa8(0x11e2,-0x8f6,-0xdd,0x562)](_0x1a2f3e(0x1da6,0x14a5,0x1791,0x28ed),_0x4b485e[_0x4dbfa8(0x1fa5,0x2180,0x15b4,0x1c1b)])){const _0xae9ce4={};_0xae9ce4[_0x1a2f3e(0x2158,0x1a6b,0x2afc,0x1999)]='🥲',_0xae9ce4[_0x4dbfa8(0x77b,0x1062,0x109,0xcf2)]=_0x9e8f5a[_0x1a2f3e(0xd6e,0x16dd,0x72e,0xa3f)];const _0x59ab4f={};_0x59ab4f[_0x1a2f3e(0x1dd9,0x1a72,0x1170,0x184d)]=_0xae9ce4,_0x33c37c[_0x4dbfa8(0x121c,0xbe2,0x889,0xce7)+'e'](_0x126f40,_0x59ab4f);const _0x2f9a73={};_0x2f9a73['text']=''+_0x1a5874[_0x4dbfa8(0x19f4,0x177b,0x24e9,0x1a33)];const _0x5e33cc={};_0x5e33cc[_0x1a2f3e(0x9fb,-0x2e9,0x696,0x179f)]=_0x25f5b1,_0x12e72c[_0x1a2f3e(0xd63,0xb51,0x6f4,0x17ab)+'e'](_0x126ea0[_0x1a2f3e(0x15ab,0x1975,0x893,0x1689)],_0x2f9a73,_0x5e33cc);}else _0x4b485e[_0x1a2f3e(0x1264,0x1c05,0x1d4e,0x1505)](setTimeout,function(){function _0x572e76(_0x235601,_0x55669b,_0x435aea,_0x555ce0){return _0x4dbfa8(_0x235601-0x79,_0x235601,_0x435aea-0x146,_0x435aea- -0x13e);}function _0x26f636(_0x4c234d,_0xb82a7d,_0x5e59bc,_0x4371dd){return _0x4dbfa8(_0x4c234d-0x1e9,_0x5e59bc,_0x5e59bc-0x95,_0x4c234d- -0x33c);}_0x4b485e[_0x26f636(0x4f3,0x154,0x5ba,-0x595)](_0x4345fe,_0x4b485e[_0x572e76(0xd08,0x49d,0xb0b,0xdd7)]);},0x1*0x343+0xecd+-0x290*0x4);});global['remove1']=_0x5cd288['sender'],global['removepp']=await _0x53bbab;}else _0x4b485e['DZwzt'](_0x201288,_0x23937d(0x2a1,-0xa6a,-0x614,-0x8c)+_0x23937d(0xe81,0x14b8,0x1248,0x1082)+'ul\x20✔️\x0a*Your'+_0x23937d(0x1dc8,0x17e9,0x1820,0x2280)+_0x313705(0xbb8,0x1334,0x1010,0x15b9)+_0x4b485e[_0x313705(0x95b,0x118b,0x10bd,0x31d)](_0x2e4034,_0x3deb8e['sender'])+(_0x313705(0x1f2a,0x217c,0x2245,0x1f37)+_0x23937d(0x742,-0x7ca,0x86d,0x73d)+'(s)*\x20:\x20')+_0x4b485e[_0x23937d(0x19e1,0x218b,0x25b3,0x275d)](_0x14b17c,_0x543eb2['sender']));}}if(_0x4b485e[_0x313705(0x1b4a,0x1f95,0x2969,0x12bb)](global[_0x313705(0x1fc7,0x1602,0x2a3d,0x219c)],_0x313705(0xd30,0x14f6,-0xc4,0x455))){let _0x4a4889=global[_0x23937d(0x177e,0x10ac,0x103f,0x1e67)];await _0x175756[_0x23937d(0xc88,0x115e,0x3be,0x1630)+_0x313705(0x671,0x4d6,0x600,0xb0f)+_0x313705(0x5b6,0xa52,0xb86,0x10e9)](_0x5cd288['chat'],[_0x4a4889],_0x4b485e['gAJcl'])[_0x23937d(0x1b61,0x1a84,0x1483,0x1723)](_0x1f0218=>_0x1db05d(jsonformat(_0x1f0218)))['catch'](_0x553270=>_0x1db05d(jsonformat(_0x553270))),global[_0x23937d(0x177e,0x1655,0x210c,0x14b2)]=[],global[_0x23937d(0x1c61,0x296a,0xed3,0x2949)]='';}if(_0x4b485e[_0x23937d(0x1d42,0x27a0,0x2c3d,0x264f)](global['dragonchat'],_0x4b485e[_0x313705(0x59d,0x37e,-0x679,0x584)])){if(_0x4b485e[_0x313705(0x9dc,0x10b7,0x1659,0x1590)](_0x4b485e['KxrwR'],_0x4b485e[_0x313705(0xef0,0x5b6,0xebb,0xd90)])){if(!_0x4eedf8)return _0x4b485e[_0x23937d(0x1b56,0x2686,0x1509,0x254c)](_0x181c7b,'Already\x20de'+_0x313705(0x1406,0x1fef,0x111f,0x18a0));let _0x3a96e1=_0x59d3f2[_0x23937d(0x9e6,0x110e,0xdc2,-0x3b6)](_0x3e07f8);_0x1d10a3['splice'](_0x3a96e1,0xf52+-0x1f1a+0xfc9),_0x4b485e[_0x23937d(0x32f,0x593,0x6c6,-0x1e4)](_0x4cb210,_0x4b485e['CikBX']);}else{if(_0x169e0a[_0x313705(0x118e,0x1523,0x1ad4,0xedc)](_0x4b485e['NcSgz']))return;else{if(_0x169e0a['match'](/හායි/gi)){if(_0x4b485e[_0x23937d(0x1401,0x11d2,0xdac,0x1adb)]('ZZUcE',_0x313705(0x1051,0x174f,0x4f8,0x183c))){const _0x4546a5={};_0x4546a5['text']='🥲',_0x4546a5[_0x313705(0xcb5,0x13bd,0xa7d,0x39f)]=_0x4bbd60[_0x23937d(0x94f,0x9a,0x774,0x1567)];const _0x2e198a={};_0x2e198a[_0x313705(0x1d20,0x2210,0x28de,0x2560)]=_0x4546a5,_0x85cfa0[_0x313705(0xcaa,0x19a8,-0x6f,0x1a7a)+'e'](_0x5f4f99,_0x2e198a);const _0x152921={};_0x152921['text']=''+_0x4cb5d8[_0x313705(0x1fa4,0x2312,0x1640,0x13e3)];const _0x2b5633={};_0x2b5633[_0x23937d(0x5dc,0xcf1,0x9e8,-0xe2)]=_0x15a40e,_0x2e5991['sendMessag'+'e'](_0x1cce5b[_0x313705(0x14f2,0xf5f,0x20ec,0xb9a)],_0x152921,_0x2b5633),_0x4adcb7=_0x483959[_0x313705(0x1723,0x184f,0x1846,0xba3)+'nc'](_0x313705(0xe81,0xb86,0xe94,0x6d1)+'AllData/st'+'icker/bite'+_0x313705(0x1a20,0x26db,0x1a95,0xe76));const _0x23057e={};_0x23057e[_0x23937d(0xffa,0x17dc,0xf08,0xd05)]=_0x484fc6,_0x235f4c[_0x23937d(0x944,0x1e3,-0x45d,0x39e)+'e'](_0x5b893f['chat'],_0x23057e);}else{const _0x10675a=_0x4b485e['VrCbs'][_0x313705(0x1035,0x1119,0x6b8,0x273)]('|');let _0x214d93=-0xcc8+0xd12+0x4a*-0x1;while(!![]){switch(_0x10675a[_0x214d93++]){case'0':const _0x470c37={};_0x470c37[_0x23937d(0xffa,0x191b,0xf66,0x1ebe)]=result,_0x175756[_0x23937d(0x944,-0x3c,0x844,-0x14)+'e'](_0x5cd288[_0x23937d(0x118c,0x7c7,0x1800,0x5d7)],_0x470c37);continue;case'1':const _0x1ff885={};_0x1ff885[_0x23937d(0xffa,0x781,0x18f3,0x1975)]=result,_0x175756[_0x313705(0xcaa,0x481,0x1634,0x19e8)+'e'](_0x5cd288[_0x313705(0x14f2,0x782,0x21db,0x231c)],_0x1ff885);continue;case'2':const _0x4988c6={};_0x4988c6[_0x313705(0x209f,0x11ab,0x2026,0x2920)]='💘',_0x4988c6[_0x23937d(0x94f,-0x4bc,0xedc,-0x4ae)]=_0x5cd288[_0x23937d(0x94f,0xc82,0x1504,0x166a)];const _0x2de34e={};_0x2de34e[_0x23937d(0x19ba,0xb89,0x183c,0xed5)]=_0x4988c6,_0x175756[_0x23937d(0x944,0x41,0x9c1,0x4c2)+'e'](_0x423161,_0x2de34e);continue;case'3':result=fs[_0x23937d(0x13bd,0x855,0x1b85,0x1b2a)+'nc'](_0x313705(0xe81,0x766,0x3c2,0x1ba5)+'AllData/st'+_0x313705(0x589,0xd30,0x10e2,0xda3)+_0x313705(0x10ec,0x2b2,0x3cb,0x556));continue;case'4':result=fs[_0x313705(0x1723,0xc00,0x1950,0xb37)+'nc']('./Android/'+_0x23937d(0x1613,0xf6b,0x1453,0xf0e)+_0x313705(0x589,-0x787,0x10e9,0x14a)+_0x23937d(0xd86,0x133,0xcb6,0x101b));continue;case'5':const _0x13d388={};_0x13d388[_0x23937d(0x1d39,0x1394,0x1dfd,0x1bbb)]=''+rep['K2'],_0x175756[_0x313705(0xcaa,-0xdd,0x868,0xd52)+'e'](_0x5cd288[_0x313705(0x14f2,0x11c1,0x7f7,0x1d73)],_0x13d388,{'quoted':_0x5cd288});continue;}break;}}}if(_0x169e0a[_0x23937d(0xe28,0x1630,0xe94,0x4d)](/hui/gi)){if(_0x4b485e[_0x23937d(0xff4,0xcf2,0x1754,0xc85)](_0x4b485e[_0x23937d(0x61a,-0x121,0x1131,0xd29)],_0x4b485e[_0x23937d(0x61a,0xd71,0xe0f,0x7c9)])){const _0x504e31={};_0x504e31['text']='💘',_0x504e31[_0x23937d(0x94f,0x955,0x6e3,-0x4b0)]=_0x5cd288['key'];const _0x64bed1={};_0x64bed1[_0x23937d(0x19ba,0x18cb,0x1f6c,0x237a)]=_0x504e31,_0x175756['sendMessag'+'e'](_0x423161,_0x64bed1),result=fs[_0x313705(0x1723,0x1afc,0x1134,0x1921)+'nc'](_0x23937d(0xb1b,0x15af,0x1320,0xe8d)+_0x23937d(0x1613,0xe66,0x224b,0x1570)+'icker/flow'+'er.webp');const _0x488b46={};_0x488b46[_0x23937d(0xffa,0x1903,0x190b,0x10d0)]=result,_0x175756[_0x23937d(0x944,0x1555,0x7f9,0x180f)+'e'](_0x5cd288[_0x23937d(0x118c,0xe97,0x1010,0x9e0)],_0x488b46);const _0x1ecd76={};_0x1ecd76['text']=''+rep['K3'],_0x175756[_0x23937d(0x944,0x10c1,0x1610,0x3cd)+'e'](_0x5cd288[_0x23937d(0x118c,0xfd5,0x44f,0x1800)],_0x1ecd76,{'quoted':_0x5cd288});}else return _0x2c2447||_0x1c1969[_0x313705(0x1ff4,0x2795,0x29c0,0x2ef5)][_0xc8640e]?('('+_0x4b485e['Ekyol'](_0x22d0b2,-0x1686+-0x2204+0x388b)+')\x20'+_0x5c0500+'\x20'+(_0x2485da[_0x313705(0x1ff4,0x2c4e,0x1465,0x281d)][_0x2a6924]?_0x4b485e[_0x313705(0x945,0xc2f,-0x4f2,0x13)]('@',_0x4bab6d['terjawab'][_0xb03e01][_0x23937d(0xccf,0xc98,0x8e7,0x1864)]('@')[0x15eb+-0xa2*-0xf+-0x1f69]):''))['trim']():![];}if(_0x169e0a[_0x23937d(0xe28,0x165f,0x105b,0x8e0)](/හූයි/gi)){const _0x1fc100={};_0x1fc100[_0x313705(0x209f,0x25eb,0x188f,0x2fa1)]='😎',_0x1fc100[_0x23937d(0x94f,0x1116,-0x1b3,0xe4)]=_0x5cd288[_0x23937d(0x94f,0x8eb,0x1031,0x16a)];const _0x561809={};_0x561809[_0x23937d(0x19ba,0x120b,0xc5d,0x25a4)]=_0x1fc100,_0x175756[_0x23937d(0x944,0xf09,0x497,0x154f)+'e'](_0x423161,_0x561809);const _0x9bb574={};_0x9bb574[_0x313705(0x209f,0x25a2,0x180d,0x1563)]=''+rep['K4'],_0x175756['sendMessag'+'e'](_0x5cd288[_0x23937d(0x118c,0xd0c,0x946,0x758)],_0x9bb574,{'quoted':_0x5cd288}),result=fs[_0x313705(0x1723,0x111a,0x1281,0x209e)+'nc'](_0x23937d(0xb1b,0x57c,0xd,0x466)+_0x313705(0x1979,0x27f5,0x23b6,0x1ee5)+'icker/flow'+_0x23937d(0x1b3c,0x1ad5,0x26af,0x21f0));const _0xa5a6ed={};_0xa5a6ed['sticker']=result,_0x175756['sendMessag'+'e'](_0x5cd288[_0x313705(0x14f2,0x239b,0x875,0x2318)],_0xa5a6ed);}if(_0x169e0a['match'](/හේයි/gi)){const _0x12a2d6={};_0x12a2d6[_0x313705(0x209f,0x17d6,0x23aa,0x2c01)]='🤪',_0x12a2d6['key']=_0x5cd288['key'];const _0x49c3f7={};_0x49c3f7[_0x23937d(0x19ba,0x20ac,0x20cf,0x22b4)]=_0x12a2d6,_0x175756[_0x23937d(0x944,0x7f7,0x28b,0x11d1)+'e'](_0x423161,_0x49c3f7);const _0x1ee56c={};_0x1ee56c[_0x23937d(0x1d39,0x1543,0x1e88,0x1b89)]=''+rep['K5'],_0x175756['sendMessag'+'e'](_0x5cd288[_0x23937d(0x118c,0x1903,0x4bc,0x6a9)],_0x1ee56c,{'quoted':_0x5cd288}),result=fs[_0x23937d(0x13bd,0x1280,0xbbb,0xdc6)+'nc'](_0x23937d(0xb1b,0x1372,0xb19,0xd8c)+_0x313705(0x1979,0x1373,0x12bd,0x1465)+_0x313705(0x1f26,0x14b1,0x1c09,0x22bd)+_0x313705(0x1a20,0x123d,0x15d9,0x1add));const _0x3a008c={};_0x3a008c[_0x23937d(0xffa,0x670,0x234,0x5a3)]=result,_0x175756[_0x23937d(0x944,0xc45,-0x24c,0x852)+'e'](_0x5cd288[_0x313705(0x14f2,0x1045,0x1bc6,0xac6)],_0x3a008c);}if(_0x169e0a[_0x313705(0x118e,0x1cbc,0x1d6e,0x1f0a)](/hey/gi)){const _0x35ae56={};_0x35ae56['text']=''+rep['K6'],_0x175756[_0x313705(0xcaa,0x11f9,0x1253,0x3ea)+'e'](_0x5cd288[_0x23937d(0x118c,0x11dc,0x4e6,0xc99)],_0x35ae56,{'quoted':_0x5cd288}),result=fs[_0x23937d(0x13bd,0x1d2d,0x186d,0x19b9)+'nc'](_0x313705(0xe81,0x20d,0xd53,-0xb)+_0x313705(0x1979,0xe5e,0x202a,0x1a24)+_0x313705(0x1f26,0x1d3c,0x1c52,0x158c)+_0x23937d(0x16ba,0x1f3c,0x1fd3,0x1e3c));const _0x5bb60a={};_0x5bb60a[_0x313705(0x1360,0x8ee,0x1d3b,0x124c)]=result,_0x175756[_0x313705(0xcaa,0x67e,0x56c,0xa0b)+'e'](_0x5cd288['chat'],_0x5bb60a);}if(_0x169e0a['match'](/හලෝ|halo|හලො|හලු/gi)){const _0x16d129={};_0x16d129['text']='🤪',_0x16d129[_0x313705(0xcb5,0x150f,0xd52,-0x24)]=_0x5cd288[_0x23937d(0x94f,0x350,0x4ba,0xab2)];const _0x30b2c9={};_0x30b2c9[_0x313705(0x1d20,0x104e,0x1a96,0x140d)]=_0x16d129,_0x175756[_0x23937d(0x944,0x46a,0xbbd,0x16cd)+'e'](_0x423161,_0x30b2c9),result=fs['readFileSy'+'nc'](_0x313705(0xe81,0x1452,0x19ce,0xffe)+_0x23937d(0x1613,0x2282,0x24e9,0x11f1)+_0x23937d(0x5a9,-0x354,0x403,0x2de)+'1.webp');const _0x9eef39={};_0x9eef39[_0x23937d(0xffa,0x1d52,0xa1d,0x11cb)]=result,_0x175756['sendMessag'+'e'](_0x5cd288[_0x23937d(0x118c,0x1575,0x471,0x435)],_0x9eef39);const _0x569612={};_0x569612[_0x313705(0x209f,0x1224,0x1ecf,0x228b)]=''+rep['K7'],_0x175756['sendMessag'+'e'](_0x5cd288[_0x313705(0x14f2,0x1f73,0x174d,0xda3)],_0x569612,{'quoted':_0x5cd288});}if(_0x169e0a[_0x313705(0x118e,0x751,0x1930,0x18d7)](/hello/gi)){if(_0x4b485e[_0x313705(0x8fe,0x275,0x66,-0x41)](_0x4b485e[_0x313705(0x13d8,0x1c03,0x1126,0x586)],_0x313705(0x49e,0x130,0x46d,0x1ae))){const _0x352117={};_0x352117[_0x23937d(0x1d39,0x1484,0x20c9,0x1a25)]=''+_0x1fa4a8[_0x23937d(0xb9b,0x19c,0xb05,0xa72)];const _0x46701d={};_0x46701d['quoted']=_0x2c4108,_0x383df5[_0x23937d(0x944,0x5ef,-0x5db,0xb5)+'e'](_0x570ee7[_0x23937d(0x118c,0x1358,0x1d7d,0x17cc)],_0x352117,_0x46701d);}else{const _0x107bbe={};_0x107bbe[_0x313705(0x209f,0x12ad,0x2ba3,0x19b4)]=''+rep['K8'],_0x175756[_0x23937d(0x944,0xaf0,0x10e,-0x3cf)+'e'](_0x5cd288[_0x23937d(0x118c,0x2ec,0x18a8,0x7c0)],_0x107bbe,{'quoted':_0x5cd288});}}if(_0x169e0a[_0x313705(0x118e,0x131f,0x7c2,0xab6)](/ane |amne/gi)){if(_0x4b485e['HOYFP'](_0x4b485e['xReEp'],'pqrHT')){const _0x342012={};_0x342012[_0x313705(0x942,0x17db,0x35,0x34b)]=_0x49d1d4,_0x370f24[_0x313705(0xcaa,0x19d0,0x1a5d,0xb00)+'e'](_0x1b42ef[_0x313705(0x14f2,0x10bf,0x1894,0x22e7)],{'text':_0x2201a9,'contextInfo':{'externalAdReply':{'title':_0x23937d(0x1bb6,0x1e92,0x13b8,0xcdd)+_0x313705(0x500,0x108e,0x91a,-0x4bc),'body':_0x23937d(0x1387,0x8f7,0x1fb4,0x531)+_0x23937d(0x89f,0xca4,0x244,0x11e2)+'e','previewType':_0x23937d(0x1a38,0x1840,0x10fb,0xc92),'thumbnailUrl':'','thumbnail':_0x553b77['readFileSy'+'nc'](_0x23937d(0xb1b,-0x23b,0x1157,0xad4)+'database/d'+'ragonweb.j'+'pg'),'sourceUrl':_0x4b485e[_0x23937d(0xd1d,0xe13,0x6ac,0x4b9)]}}},_0x342012);}else{const _0x1edacb={};_0x1edacb[_0x23937d(0x1d39,0x1ca6,0x1888,0x1f56)]=''+rep['K9'],_0x175756['sendMessag'+'e'](_0x5cd288[_0x23937d(0x118c,0x1572,0x151e,0x613)],_0x1edacb,{'quoted':_0x5cd288}),result=fs[_0x23937d(0x13bd,0x582,0xc23,0x1e71)+'nc']('./Android/'+_0x23937d(0x1613,0x2313,0x824,0x2320)+'icker/angr'+_0x313705(0x11ff,0x9a8,0x1759,0x1abc));const _0x162169={};_0x162169[_0x23937d(0xffa,0x17ff,0x994,0x18a2)]=result,_0x175756[_0x313705(0xcaa,0x247,0x1a03,0x14eb)+'e'](_0x5cd288[_0x23937d(0x118c,0xa86,0x4eb,0xde7)],_0x162169);}}if(_0x169e0a['match'](/අනේ|අනෙ|අම්නේ/gi)){const _0x2b45e9={};_0x2b45e9['text']='😒',_0x2b45e9[_0x23937d(0x94f,0x701,-0x2df,-0x552)]=_0x5cd288[_0x313705(0xcb5,0x1b3d,0xdd1,0x1b4a)];const _0x1a5ef4={};_0x1a5ef4[_0x23937d(0x19ba,0x1707,0x23c5,0x1719)]=_0x2b45e9,_0x175756['sendMessag'+'e'](_0x423161,_0x1a5ef4);const _0x15e38e={};_0x15e38e[_0x23937d(0x1d39,0x2b17,0xe23,0x2778)]=''+rep[_0x23937d(0x1665,0x130c,0x110d,0x10f6)],_0x175756[_0x313705(0xcaa,0xaf8,0x1bae,0x5cf)+'e'](_0x5cd288[_0x313705(0x14f2,0x1ede,0x850,0xa72)],_0x15e38e,{'quoted':_0x5cd288}),result=fs[_0x313705(0x1723,0x1c1c,0x99a,0x2367)+'nc'](_0x313705(0xe81,0x13d6,0x9a1,0xf45)+'AllData/st'+'icker/angr'+_0x313705(0x10c6,0x18c6,0x2ed,0x16c3));const _0x520f5c={};_0x520f5c[_0x313705(0x1360,0x606,0xc70,0x5b5)]=result,_0x175756[_0x23937d(0x944,0x1cb,0x1b,0x258)+'e'](_0x5cd288['chat'],_0x520f5c);}if(_0x169e0a['match'](/පනෙ |පනේ|පණේ|පන |පණ/gi)){const _0x15dcfe={};_0x15dcfe['text']=''+rep[_0x23937d(0xec9,0x1dd4,0x12e8,0x5c4)],_0x175756['sendMessag'+'e'](_0x5cd288[_0x23937d(0x118c,0x11c3,0x12b1,0x1452)],_0x15dcfe,{'quoted':_0x5cd288}),result=fs[_0x23937d(0x13bd,0x15b7,0x19b4,0xc2d)+'nc']('./Android/'+_0x313705(0x1979,0x2211,0x2010,0x229b)+'icker/hear'+_0x23937d(0x580,0x76e,-0x263,-0x250));const _0x3f5024={};_0x3f5024['sticker']=result,_0x175756[_0x313705(0xcaa,0x719,0x4c1,0xcf2)+'e'](_0x5cd288[_0x23937d(0x118c,0x875,0x202a,0x2099)],_0x3f5024);}if(_0x169e0a[_0x23937d(0xe28,0xcf5,0xd0d,0x197e)](/හේහේ|හේ /gi)){const _0x3e9330={};_0x3e9330[_0x313705(0x209f,0x22d6,0x1d55,0x201d)]=''+rep[_0x23937d(0x1ba9,0x195e,0x11ba,0xd2c)],_0x175756[_0x23937d(0x944,0x136c,0x12a0,-0x56d)+'e'](_0x5cd288[_0x313705(0x14f2,0x1633,0xdcc,0x6bd)],_0x3e9330,{'quoted':_0x5cd288}),result=fs['readFileSy'+'nc']('./Android/'+'AllData/st'+'icker/flow'+_0x23937d(0x1532,0x2145,0x1b21,0x237c));const _0x435f92={};_0x435f92[_0x23937d(0xffa,0x1510,0xa95,0x1f1)]=result,_0x175756[_0x23937d(0x944,0x177c,-0x1af,0xcc9)+'e'](_0x5cd288[_0x23937d(0x118c,0x1779,0x18a8,0x195e)],_0x435f92);}if(_0x169e0a[_0x313705(0x118e,0x1a9a,0x1105,0x50b)](/he he/gi)){const _0xcd2e77={};_0xcd2e77[_0x313705(0x209f,0x178d,0x2993,0x2841)]=''+rep[_0x23937d(0x83e,0xa01,0xecc,0xa16)],_0x175756['sendMessag'+'e'](_0x5cd288[_0x23937d(0x118c,0x994,0x16e3,0xcc4)],_0xcd2e77,{'quoted':_0x5cd288}),result=fs['readFileSy'+'nc'](_0x313705(0xe81,0x83c,0x30d,0xc1b)+'AllData/st'+_0x313705(0x1732,0x1631,0x12ca,0x1e0d)+'er2.webp');const _0x26fd76={};_0x26fd76['sticker']=result,_0x175756['sendMessag'+'e'](_0x5cd288['chat'],_0x26fd76);}if(_0x169e0a[_0x23937d(0xe28,0x1130,0x11d,0x574)](/හී/gi)){const _0x3fa71b={};_0x3fa71b['text']=''+rep[_0x313705(0x1f95,0x2cf4,0x158b,0x28da)],_0x175756[_0x23937d(0x944,0x1018,0x1162,0x1571)+'e'](_0x5cd288[_0x23937d(0x118c,0x1ac1,0x1fcb,0x1069)],_0x3fa71b,{'quoted':_0x5cd288});}if(_0x169e0a[_0x23937d(0xe28,0x816,0x65b,0x1902)](/ammo|amo/gi)){if(_0x4b485e['zXZao']('hKvVQ',_0x313705(0x10d8,0xb78,0x11c3,0x4de))){_0x58464d[_0x313705(0x7ea,0xfec,0x5c5,0x15d5)]=_0x29295c[_0x313705(0x1960,0x1afa,0xd57,0x1510)](_0x511d88[_0x313705(0x209f,0x1373,0x1366,0x1cb9)][_0x313705(0xa31,0xfac,0x13a1,0x131)+'e']())[0x1093+0x11c*-0x8+-0x49*0x1b],_0x22fa79[_0x313705(0x12cd,0x108a,0x12f2,0x11d0)]=_0x31d1df[_0x313705(0x209f,0x1f72,0x1d77,0x2e01)],_0x4b485e[_0x23937d(0x12c5,0x149c,0x1d30,0x1147)](_0x18ffbf,'You\x20Have\x20C'+'hosen\x20'+_0x6b431a[_0x23937d(0x1d39,0x1069,0x1d67,0x29c9)]+'\x20'+(!_0x54dcd1['pilih']?_0x313705(0xebc,0x1d18,0x1d2d,0x9e1)+_0x23937d(0x75a,0x1583,-0x52a,0x1134)+_0x23937d(0x135,-0xa55,-0x44e,0x19c)+'Choose':''));if(!_0x4eee1e[_0x313705(0xcfa,0xffb,0x1a0f,0x1369)])_0x55768e[_0x313705(0x18da,0x1142,0x1537,0x1b9c)](_0x12177b['p'],_0x4b485e[_0x313705(0x2120,0x2426,0x1a19,0x2c8f)],0xed*0xc+-0x2d*-0x5d+-0x927*0x3);}else{const _0x484be5={};_0x484be5[_0x313705(0x209f,0x2788,0x16c1,0x2cbd)]=''+rep[_0x313705(0x1169,0x1209,0x518,0x1d33)],_0x175756['sendMessag'+'e'](_0x5cd288[_0x313705(0x14f2,0x7e6,0x7d7,0x1f49)],_0x484be5,{'quoted':_0x5cd288});}}if(_0x169e0a[_0x313705(0x118e,0x1914,0x1bda,0x9b2)](/අමො|අමෝ|අම්මෝ/gi)){const _0x18c6b1={};_0x18c6b1[_0x313705(0x209f,0x2e62,0x1291,0x2e83)]=''+rep[_0x23937d(0xd0,-0x661,-0x3cb,0x666)],_0x175756[_0x313705(0xcaa,0x12ee,0x119b,0x599)+'e'](_0x5cd288['chat'],_0x18c6b1,{'quoted':_0x5cd288}),result=fs[_0x23937d(0x13bd,0x1977,0x1003,0x8d6)+'nc']('./Android/'+_0x313705(0x1979,0x1afe,0x1b5c,0x11a4)+_0x23937d(0x175c,0x2037,0x1d55,0x1180)+_0x23937d(0x6b7,0x1318,0xccf,-0x47c));const _0x10ab17={};_0x10ab17[_0x313705(0x1360,0xc3e,0x1f44,0x1332)]=result,_0x175756['sendMessag'+'e'](_0x5cd288[_0x313705(0x14f2,0x1686,0x1f17,0x12ac)],_0x10ab17);}if(_0x169e0a[_0x313705(0x118e,0xd82,0x1345,0xfc6)](/බුදු|බුදා/gi)){const _0x10247c={};_0x10247c[_0x23937d(0x1d39,0x26dd,0x2b07,0x1311)]=''+rep[_0x23937d(0x13b,-0x3e,-0xbdf,0x2d6)],_0x175756[_0x313705(0xcaa,0x19c4,0x79a,0x1a35)+'e'](_0x5cd288[_0x313705(0x14f2,0x1bda,0x10cc,0x11fa)],_0x10247c,{'quoted':_0x5cd288});}if(_0x169e0a[_0x313705(0x118e,0x199e,0x65b,0x680)](/චූටි|chooti/gi)){const _0x57b65f={};_0x57b65f[_0x23937d(0x1d39,0x1531,0x1cb9,0x1f6a)]=''+rep[_0x23937d(0x1c3c,0x224d,0x10bb,0xf76)],_0x175756['sendMessag'+'e'](_0x5cd288['chat'],_0x57b65f,{'quoted':_0x5cd288});}if(_0x169e0a[_0x313705(0x118e,0x8ce,0x109d,0x743)](/sudu|සුදූ|තුදූ|ශුඩු/gi)){if(_0x4b485e[_0x313705(0x213d,0x2af2,0x2adb,0x2bcc)]('PYJkS',_0x4b485e[_0x23937d(0xd31,0x128d,0x925,0xeda)]))return _0x4b485e[_0x313705(0xa6b,0xddc,-0x45b,0x17ba)];else{const _0x21c1c1={};_0x21c1c1['text']=''+rep[_0x23937d(0x196,0x1000,-0x5fd,0x1f9)],_0x175756[_0x23937d(0x944,0x4f4,0x515,0x102e)+'e'](_0x5cd288[_0x23937d(0x118c,0x1b4f,0x1a11,0xaeb)],_0x21c1c1,{'quoted':_0x5cd288}),result=fs[_0x23937d(0x13bd,0x94f,0x223a,0xd35)+'nc'](_0x313705(0xe81,0x1985,0x7d9,0x1bd1)+_0x23937d(0x1613,0x2381,0x15bb,0x827)+_0x313705(0x9f4,0xa04,0x14bd,-0x380)+_0x313705(0x1a20,0x1f82,0x1574,0x2609));const _0x54b448={};_0x54b448[_0x313705(0x1360,0xe7d,0x6ce,0x18bf)]=result,_0x175756[_0x23937d(0x944,0xca3,0x14df,0xf48)+'e'](_0x5cd288['chat'],_0x54b448);}}if(_0x169e0a['match'](/kohomei|komei/gi)){const _0x44453c={};_0x44453c[_0x313705(0x209f,0x2d51,0x2652,0x2a7c)]=''+rep['K20'],_0x175756[_0x313705(0xcaa,0x743,0x154a,0xfee)+'e'](_0x5cd288[_0x313705(0x14f2,0x10cb,0x187c,0x165f)],_0x44453c,{'quoted':_0x5cd288}),result=fs[_0x313705(0x1723,0x1308,0x23b8,0x189e)+'nc'](_0x313705(0xe81,0x1644,0x1773,0xa72)+'AllData/st'+_0x23937d(0x3fb,0xa06,0xbd0,-0x9bd)+_0x313705(0x89b,0x14be,0x263,0x69d));const _0x52e389={};_0x52e389[_0x23937d(0xffa,0x1136,0x963,0x985)]=result,_0x175756[_0x23937d(0x944,0x12c4,0x1693,0x6ae)+'e'](_0x5cd288[_0x313705(0x14f2,0x9cf,0x1edb,0xf79)],_0x52e389);}if(_0x169e0a['match'](/කොහොමෙයි |කෝමද|කොහොමද/gi)){if(_0x4b485e['PFXQN'](_0x4b485e[_0x23937d(0x63f,-0x2b5,0x14fd,-0x117)],_0x4b485e[_0x23937d(0x63f,0x292,0x2c3,0x13c2)])){const _0x3b8971={};_0x3b8971[_0x23937d(0x1d39,0x122f,0x1f19,0x1408)]=''+rep[_0x23937d(0xb71,0x7e,0x163,0xb41)],_0x175756['sendMessag'+'e'](_0x5cd288[_0x23937d(0x118c,0xb5f,0x1502,0x669)],_0x3b8971,{'quoted':_0x5cd288}),result=fs[_0x313705(0x1723,0x244c,0x24e6,0xdac)+'nc'](_0x23937d(0xb1b,0x8b4,-0x3eb,0x1195)+_0x23937d(0x1613,0x1f24,0x1863,0xcc6)+_0x313705(0x761,-0x5a3,-0xdb,-0x1a)+_0x313705(0x65b,0x6db,0x340,0x14f1));const _0x59d7a5={};_0x59d7a5[_0x313705(0x1360,0x2177,0xea0,0x2158)]=result,_0x175756[_0x23937d(0x944,0xc37,0xd6c,0x17ec)+'e'](_0x5cd288['chat'],_0x59d7a5);}else{const _0x14c497={};_0x14c497[_0x23937d(0xa79,0x12c7,-0x239,0x1485)]=_0x2d4cd4[_0x23937d(0xa79,-0x222,0xe87,-0x1b0)][0x74d*0x5+0x6e9*-0x1+0x1*-0x1d98][_0x313705(0xddf,0x57a,0xb41,0xd0c)];const _0x3371cc={};_0x3371cc[_0x23937d(0x1762,0x19e8,0x21d0,0x213e)]=_0x14c497,_0x3371cc[_0x313705(0x1610,0x1b69,0x137c,0x1742)]=_0x4b485e[_0x313705(0x17c6,0x15f0,0x24a0,0xac3)];const _0x4dd614={};_0x4dd614[_0x313705(0x942,0x1627,-0x7f,0x12c3)]=_0x5632fa,_0x5eb238[_0x313705(0xcaa,0x1436,0x1241,0x19b3)+'e'](_0x5c054c[_0x23937d(0x118c,0x1289,0x376,0xd0b)],_0x3371cc,_0x4dd614);}}if(_0x169e0a[_0x23937d(0xe28,0x6bd,0xd92,0x10d0)](/hodai|hondai|හොදයි|හොඳා/gi)){if(_0x23937d(0x151c,0x1bc2,0xb14,0x13c6)===_0x4b485e[_0x23937d(0x3b3,-0x6ac,-0x3c4,0xc83)])_0x31fa08('@'+_0x117b0b[_0x313705(0x1834,0x23a2,0x2730,0x22c1)][_0x23937d(0xccf,0xd6e,0x75f,0x1be3)]('@')[0x2f*0x1+0x14*0xe0+0x3*-0x5e5]+('\x20Started\x20M'+_0x23937d(0xce2,0x94e,0xaf6,0x111b)));else{const _0x2b4c98={};_0x2b4c98[_0x23937d(0x1d39,0x1a47,0x1fb1,0x19e9)]=''+rep['K22'],_0x175756[_0x313705(0xcaa,0xf41,0x14b6,0x244)+'e'](_0x5cd288[_0x23937d(0x118c,0x20a2,0x93a,0x1132)],_0x2b4c98,{'quoted':_0x5cd288});}}if(_0x169e0a[_0x313705(0x118e,0x7b6,0x17b3,0x1c7f)](/maru|hebei|මරු/gi)){const _0x268fc4={};_0x268fc4[_0x23937d(0x1d39,0x21cc,0x12de,0x2834)]=''+rep['K23'],_0x175756[_0x23937d(0x944,-0x5a1,0xa13,0x26)+'e'](_0x5cd288[_0x313705(0x14f2,0x1a2e,0xd4c,0x2203)],_0x268fc4,{'quoted':_0x5cd288}),result=fs[_0x23937d(0x13bd,0x651,0xe31,0x18bf)+'nc'](_0x313705(0xe81,0x13d4,0x29f,0x173a)+'AllData/st'+_0x313705(0x7fe,0xa95,0xc91,-0x56e)+_0x23937d(0x16ba,0x1f8f,0x91d,0x2425));const _0x42062a={};_0x42062a['sticker']=result,_0x175756[_0x313705(0xcaa,0x688,-0x1ec,0x173c)+'e'](_0x5cd288['chat'],_0x42062a);}if(_0x169e0a[_0x313705(0x118e,0x1ff2,0x309,0x1ad0)](/මලු/gi)){const _0xbe0e06={};_0xbe0e06['text']=''+rep[_0x313705(0x132f,0x1c15,0xafe,0x1b31)],_0x175756['sendMessag'+'e'](_0x5cd288[_0x23937d(0x118c,0x141d,0xfb1,0x1750)],_0xbe0e06,{'quoted':_0x5cd288});}if(_0x169e0a['match'](/umma/gi)){if(_0x4b485e[_0x313705(0xc82,0x1b9e,0x17f7,0x62b)](_0x4b485e[_0x313705(0x7dd,-0x2ac,0xf78,0xaf3)],_0x313705(0xaf3,0x16dc,0x399,-0xed))){const _0xf2c0fa={};_0xf2c0fa['text']=''+rep[_0x313705(0xe4f,0x1cc6,0xd93,0x9dc)],_0x175756['sendMessag'+'e'](_0x5cd288[_0x23937d(0x118c,0x1c1f,0x16b1,0x700)],_0xf2c0fa,{'quoted':_0x5cd288});}else _0x500752(_0x408233['format'](_0x371e50(_0x313705(0x1b09,0x1854,0x1b07,0x205f)+_0x23937d(0x4fb,-0x903,0x372,0x93)+'n\x20'+_0x3b0f97[_0x23937d(0x33,0xe58,-0x116,0x6e)](-0x5c3+-0x13b2+-0x8*-0x32f)+'\x20})()')));}if(_0x169e0a[_0x23937d(0xe28,0x15a,0x2b3,0xcfd)](/උම්ම|උම්මා/gi)){if(_0x4b485e['gvxlb'](_0x4b485e[_0x313705(0x18e3,0x23d1,0x1ac5,0xa3b)],_0x4b485e['LsEJW'])){const _0x2f88ee={};_0x2f88ee[_0x313705(0x209f,0x241e,0x293f,0x157d)]=''+rep['K26'],_0x175756[_0x313705(0xcaa,0x1b02,0x5d1,0x1086)+'e'](_0x5cd288[_0x23937d(0x118c,0x617,0x11a8,0x1317)],_0x2f88ee,{'quoted':_0x5cd288});}else{if(_0x288f53)return _0x4b485e[_0x23937d(0x48c,-0x95a,0x47f,0xead)](_0x1a3e79,_0x23937d(0x1307,0x109b,0x1e18,0x1781)+_0x23937d(0x6f1,0xbc0,0xa58,-0x190));_0x4ad435[_0x313705(0x1122,0x167c,0x4e9,0x659)](_0x870a8b),_0x3941a1['writeFileS'+_0x23937d(0x12d2,0x1a65,0x1020,0x13be)](_0x23937d(0xb1b,0x43,0xf48,0xc7f)+_0x313705(0x20d4,0x13c5,0x1b5f,0x2f23)+_0x313705(0xe3c,0x18aa,0xf62,0x1926)+_0x313705(0x681,-0x42d,0x11f,-0x2ee),_0x1d3adf[_0x313705(0x104d,0x1081,0x12b3,0x133b)](_0x43d1a1)),_0x4b485e[_0x23937d(0x5f5,0x14f,0x138f,0x2b3)](_0x21b5a3,_0x23937d(0xe87,0x75c,0x16a0,0x1d64)+'r\x20pc\x20activ'+_0x23937d(0x1ab4,0x1d70,0x1f8b,0x1eb8));}}if(_0x169e0a[_0x23937d(0xe28,0x1653,0x2e3,0x1563)](/ආදරෙ/gi)){const _0x45e863={};_0x45e863['text']=''+rep['K27'],_0x175756[_0x23937d(0x944,0x1862,0x276,0x139)+'e'](_0x5cd288[_0x313705(0x14f2,0xd7c,0x7a5,0x15ed)],_0x45e863,{'quoted':_0x5cd288});}if(_0x169e0a[_0x313705(0x118e,0x1815,0xa0a,0x1fa1)](/කැමතී/gi)){if(_0x4b485e[_0x23937d(0xaea,0x177e,-0x223,0x1184)](_0x4b485e[_0x313705(0x71d,-0x1e2,-0x6e4,0x981)],_0x4b485e[_0x23937d(0x1c3b,0x2ab9,0x1efd,0x20f9)])){const _0x5a1c88={};_0x5a1c88[_0x23937d(0x1d39,0x2795,0x2997,0x1814)]=''+rep[_0x313705(0x17a4,0x1878,0x9fa,0x228c)],_0x175756[_0x313705(0xcaa,0xdae,0xdd9,0x6fa)+'e'](_0x5cd288['chat'],_0x5a1c88,{'quoted':_0x5cd288});}else _0x25c230[_0x313705(0x1122,0x1b2d,0x1e38,0x6ed)](_0x1c9a3b['id']['replace'](_0x4b485e[_0x313705(0x1722,0x98d,0x1c61,0xef5)],_0x4b485e[_0x313705(0x18c8,0x1e99,0x23f0,0x13d4)]));}if(_0x169e0a['match'](/uwa/gi)){if(_0x4b485e[_0x23937d(0x7ca,0x1371,0x150f,-0x380)](_0x4b485e[_0x23937d(0x1d61,0x1c39,0x2159,0x176a)],_0x4b485e['Clncy'])){let _0x293eb4=[];for(let _0x28636c of _0x15b488['url']){const _0x10f8d0={};_0x10f8d0[_0x23937d(0x17d9,0x24bc,0x15ba,0x11f4)]=''+_0x28636c['type'],_0x10f8d0[_0x313705(0x49c,-0x357,-0x2d0,0x67a)]=[{'title':'Quality\x20'+_0x28636c[_0x23937d(0x825,0xd0e,0x144f,0x7dc)],'rowId':_0xe692aa+_0x313705(0x3fb,0x277,0xf9c,0x1141)+_0x1636bc,'description':''+_0x3ddebc['hosting']}];const _0x3edbb5=_0x10f8d0;_0x293eb4[_0x23937d(0xdbc,0x314,0x185,0x8e9)](_0x3edbb5);}const _0x286050={};_0x286050[_0x313705(0x209f,0x1618,0x137a,0x1941)]=_0x2d16b7[_0x313705(0x1c94,0x10a1,0x2b81,0x261a)]['title']+(_0x313705(0x100a,0x13d9,0x1980,0x19b3)+_0x313705(0x1b41,0x1392,0xda7,0xecd)+_0x313705(0xb65,-0x73,0x107c,0xd56)+_0x23937d(0x18a2,0x171f,0x1918,0x1c0c)+'button\x20bel'+_0x23937d(0x19ec,0x1b7d,0xfc9,0xc5a)+_0x313705(0xda7,0xf3b,0x1a2b,0xd0d)),_0x286050[_0x23937d(0x106e,0xbbd,0x259,0x132c)]=''+_0x54e5ac,_0x286050['title']=_0x313705(0x1f15,0x16b8,0x2720,0x2482)+'*',_0x286050['buttonText']=_0x4b485e[_0x313705(0xb02,0x4f1,0x1424,0x17d4)],_0x286050[_0x23937d(0x17f7,0xce5,0x15d9,0x978)]=_0x293eb4;const _0x31761e={};_0x31761e[_0x23937d(0x5dc,-0x4f3,0x58b,0x658)]=_0x18f9c2;const _0x258fa8=_0x57da3f[_0x313705(0xcaa,0xfd0,0x5e2,0x96)+'e'](_0x55d722[_0x313705(0x14f2,0x15f1,0x1022,0x2047)],_0x286050,_0x31761e);}else{const _0x3ee8e9={};_0x3ee8e9[_0x313705(0x209f,0x15a2,0x258e,0x169a)]=''+rep['K29'],_0x175756[_0x313705(0xcaa,0xcc3,0x884,0x4ae)+'e'](_0x5cd288[_0x23937d(0x118c,0xa05,0xff8,0x109a)],_0x3ee8e9,{'quoted':_0x5cd288});}}if(_0x169e0a['match'](/ඌයි/gi)){const _0x12ba87={};_0x12ba87[_0x313705(0x209f,0x168f,0x2451,0x138d)]=''+rep['K30'],_0x175756[_0x23937d(0x944,0xfc4,0xe1d,0xd0)+'e'](_0x5cd288[_0x23937d(0x118c,0x207a,0x5e7,0xdca)],_0x12ba87,{'quoted':_0x5cd288});}if(_0x169e0a[_0x23937d(0xe28,0x1acf,0x17d9,0x1239)](/aaw|Aaw/gi)){if(_0x4b485e[_0x23937d(0xcdc,0x11b7,0x1a13,0x1330)](_0x4b485e[_0x313705(0x6cf,-0x175,-0x129,0x8f4)],_0x4b485e[_0x23937d(0x369,-0x3b4,0x5c1,0xd91)])){const _0x375e49={};_0x375e49[_0x23937d(0x1d39,0x13df,0x2763,0x2105)]=''+_0x41d074[_0x313705(0x1f77,0x1573,0x2732,0x2bee)];const _0x20fa19={};_0x20fa19['quoted']=_0x50376e,_0x48fa31[_0x313705(0xcaa,0x110e,0x850,0xbf0)+'e'](_0x547c05['chat'],_0x375e49,_0x20fa19),_0x3ce67d=_0x5269c3[_0x313705(0x1723,0x1ff3,0x229b,0x19c3)+'nc'](_0x313705(0xe81,0xbed,0xaad,0x9ec)+_0x23937d(0x1613,0x162f,0xaa0,0x9fc)+'icker/whok'+_0x23937d(0x1c22,0xdb1,0x1f4b,0x11b0));const _0x228f25={};_0x228f25[_0x23937d(0xffa,0x1ada,0x99a,0x10b)]=_0x945832,_0x45ab62['sendMessag'+'e'](_0x1c923e[_0x313705(0x14f2,0xccf,0x1507,0x22b4)],_0x228f25);}else{const _0x1566ae={};_0x1566ae['text']=''+rep[_0x313705(0x1b12,0x1c16,0x1c3e,0x21e2)],_0x175756[_0x313705(0xcaa,0xdb2,0x18c9,0x5b2)+'e'](_0x5cd288[_0x23937d(0x118c,0x16eb,0x1b90,0x14a9)],_0x1566ae,{'quoted':_0x5cd288}),result=fs[_0x23937d(0x13bd,0x1abd,0x1492,0x1f2b)+'nc'](_0x313705(0xe81,0x1323,0x1512,0x7f8)+_0x23937d(0x1613,0x1714,0x17f0,0x733)+_0x313705(0xb38,-0xe5,0x5ba,0x1744)+_0x23937d(0xe3a,0xbae,0x54f,0x9cb));const _0x2057ab={};_0x2057ab['sticker']=result,_0x175756[_0x23937d(0x944,0x1649,-0x4cd,0x184d)+'e'](_0x5cd288['chat'],_0x2057ab);}}if(_0x169e0a[_0x23937d(0xe28,0x196b,0x182a,0xc25)](/ආව්/gi)){if(_0x4b485e[_0x313705(0x138a,0x18f7,0x20a8,0x152b)](_0x4b485e['eSNSa'],_0x4b485e[_0x23937d(0x4d5,0x30a,0x137f,0xf7d)])){const _0x6c08e3={};_0x6c08e3[_0x313705(0x209f,0x12d8,0x27fc,0x12cf)]=''+rep['K32'],_0x175756[_0x23937d(0x944,0xda6,0xb1d,0x13ec)+'e'](_0x5cd288['chat'],_0x6c08e3,{'quoted':_0x5cd288}),result=fs[_0x23937d(0x13bd,0x1ac3,0xea3,0xd94)+'nc']('./Android/'+'AllData/st'+'icker/cry.'+_0x313705(0x11a0,0x2a2,0x1912,0x8cf));const _0x2da763={};_0x2da763['sticker']=result,_0x175756[_0x23937d(0x944,0x1198,0xb6c,0xad5)+'e'](_0x5cd288['chat'],_0x2da763);}else{let _0x45473d=_0x4b485e[_0x313705(0xa42,-0x1e6,0x14a,0xd09)](_0x33ba5e,_0x4b485e[_0x313705(0x1023,0xb02,0x7b8,0x1945)]);_0x45473d['savefrom'](''+_0x2a882d)[_0x313705(0x1ec7,0x1076,0x21c8,0x25b8)](async _0x5b997a=>{const _0x3ba7c3={};_0x3ba7c3[_0x399f7d(0x114d,0x2e17,0x2694,0x1f62)]=_0x399f7d(-0x363,0xb2,0x5a1,0xa3f)+_0x4cc55e(0xd7c,0x1145,0x162f,0x14a4)+_0x4cc55e(0x2097,0x1cdb,0x25e8,0x1b72)+_0x399f7d(-0x6d,-0x2e8,0x13c8,0xab0)+_0x399f7d(0x17d7,0x9df,0x4de,0x1177)+'IO\x20🎶\x0a╚════'+'══════════'+'══';const _0x596f44={};_0x596f44[_0x399f7d(0xb10,0x1694,-0x547,0x805)]=_0x22a858,_0x4fc430[_0x4cc55e(0x8e0,0xa63,0x588,0x8a5)+'e'](_0x2d348a['chat'],_0x3ba7c3,_0x596f44);const _0x38ce92={};_0x38ce92[_0x399f7d(0x4c7,0x1039,-0x219,0xca2)]=_0x5b997a[_0x4cc55e(0x1233,0xb98,0x1132,0x119d)][0x45*0x2c+-0x2*-0xf07+-0x29ea][_0x4cc55e(0x1970,0xb98,0x1523,-0x330)];function _0x399f7d(_0xbaef80,_0x5f7d5f,_0x3a431d,_0x2e8438){return _0x23937d(_0x2e8438-0x229,_0x3a431d,_0x3a431d-0x8f,_0x2e8438-0x123);}function _0x4cc55e(_0x388766,_0x5b75ae,_0xc0711e,_0x53bf70){return _0x23937d(_0x5b75ae-0x11f,_0x53bf70,_0xc0711e-0x157,_0x53bf70-0x1e9);}const _0x45c616={};_0x45c616['audio']=_0x38ce92,_0x45c616[_0x4cc55e(0x161c,0x13c9,0x20af,0x7c9)]='audio/mpeg',_0x45c616[_0x4cc55e(0x747,0xc38,-0x3d,0x12c1)]=_0x399f7d(0x333,0x93f,-0xa7b,0x1fd)+_0x399f7d(0xe9d,0xf59,0x78e,0x620)+'3';const _0x500ddd={};_0x500ddd[_0x4cc55e(0xcfc,0x6fb,0x7b6,0x5eb)]=_0xf31b89,_0x3a9538[_0x399f7d(0x365,0x14a7,0x1ca,0xb6d)+'e'](_0x3c520f[_0x399f7d(0x100d,0x214a,0xc36,0x13b5)],_0x45c616,_0x500ddd);})[_0x313705(0xc9a,0x796,0x134c,0x8d1)](_0x3cfe80=>{function _0x2ba8a6(_0x32d6d9,_0x5033c4,_0x1764eb,_0x45d82d){return _0x313705(_0x32d6d9-0x23b,_0x1764eb,_0x1764eb-0x51,_0x45d82d-0x183);}function _0x6fe424(_0x24d786,_0x349aa1,_0x2769a6,_0x4bd300){return _0x313705(_0x2769a6- -0x396,_0x349aa1,_0x2769a6-0x88,_0x4bd300-0xbc);}_0x6cf715(_0x6fe424(-0xa25,-0xa73,0x43,-0x54f)+_0x2ba8a6(0x1949,0x12b3,0xbfb,0xe79)+'lide\x20link\x20'+'!');});}}if(_0x169e0a[_0x23937d(0xe28,0x7a2,0xece,0x19cd)](/හොරගෙ|හොර ගෙ|හොල/gi)){const _0x1b84a3={};_0x1b84a3[_0x23937d(0x1d39,0x206d,0x106b,0x16c6)]=''+rep[_0x313705(0x467,0x1de,-0xa8c,0xc44)],_0x175756[_0x313705(0xcaa,0x282,0x1c3,0x139)+'e'](_0x5cd288[_0x313705(0x14f2,0x1846,0x9db,0x23fc)],_0x1b84a3,{'quoted':_0x5cd288});}if(_0x169e0a[_0x23937d(0xe28,0x1259,0x19eb,0xb44)](/hm|හ්ම්/gi)){if(_0x4b485e[_0x313705(0xc82,0x16ac,0x183f,0xc05)](_0x4b485e[_0x313705(0x1fef,0x213d,0x1c75,0x14b5)],_0x4b485e[_0x313705(0x1fef,0x2e78,0x154f,0x135e)])){const _0x32985b={'aLYMh':function(_0x1f0c79,_0x2e878c){function _0x53c167(_0x54851d,_0x30c9d5,_0x51e210,_0x5ddfe3){return _0x23937d(_0x5ddfe3-0xe,_0x30c9d5,_0x51e210-0x13d,_0x5ddfe3-0x0);}return _0x4b485e[_0x53c167(0xf90,0x182b,0x25fb,0x1d94)](_0x1f0c79,_0x2e878c);}};if(_0x47d675)return _0xb006c9(_0x590d50['ban']);if(_0x52aad5)return _0x4b485e['SwuFN'](_0x2ece6c,_0x103af3[_0x23937d(0x5c0,0x1f0,0x994,-0x3ff)]);if(_0x3eda4d[_0x313705(0x4de,0x9b3,0x11a0,0x2bd)](_0x4b485e[_0x23937d(0x337,0x444,0x92,-0xb52)]))return _0x4b485e[_0x23937d(0x1274,0x3c1,0x83a,0x11d8)](_0x231832,_0x2af296);!_0x460a6&&_0x4b485e[_0x313705(0x1c61,0x1899,0x2556,0x1014)](_0x21317c,_0x9e478b['sender']);if(_0x5ee6bb<-0x20c2*-0x1+0x57e*0x5+-0x3c37*0x1)return _0x3ad802('You\x27re\x20Tir'+_0x313705(0xd08,-0x1cf,0x1a24,0x1a64)+_0x23937d(0x1164,0x1946,0x1fde,0x1958)+_0x23937d(0x1,-0x7f2,-0x699,-0xc83));let _0xb61c7f=[0xc67+0x2203+-0x2e69,0x25b2*0x1+0x4d5*0x3+-0x1*0x342f,0x1de0+-0x140d+-0x9ce*0x1,0x1*-0xaa1+-0x15d8+0x2079,-0x6e6*0x4+0x2077*0x1+0x4dc*-0x1,-0x1*-0x207e+0x1005+0xb*-0x469,-0x1e56*-0x1+0x1*-0x199+-0x1cbc,-0x4d8+0x1722+-0x1*0x1249,-0x2429+0xa31+0x19fc,0x10e9+-0x23*-0x71+-0xac9*0x3,0x7*0x17e+0x17e3+-0x2250,-0x1*-0x97a+-0x266c*0x1+-0x13*-0x186,-0xd61+0xeec*0x1+-0x18b],_0x1f404f=[0x392*0x1+-0x55*-0xb+-0x1*0x739,0xaf9*-0x1+0x1127+-0x62d,0x1f41+0x7*0x361+-0x1*0x36e6,-0x1101+0x19*0x3e+0xaf6,0x406*0x1+0x24a5+-0x28ab,0xb*0x2cc+0x917+-0xd49*0x3,-0xd59*0x1+0x18b7+-0xb5e,0x6*-0x363+0x1e17+-0x9c4,-0xd92+-0x1cf*-0x4+0x657,0xd53*-0x1+0x8b6+0x49d,0x293*0x4+0xeb1*-0x1+0x177*0x3,-0xc2*-0xf+0x4*-0x93+-0x488*0x2],_0x1fb9ba=[-0x1*0x22f4+0xeb0+-0x2*-0xa22,-0x5*-0x3c3+0x483+-0x1752,0x141a+-0xd01+-0x4*0x1c6,-0x3*0xa99+0x1ecb*0x1+0x100,-0xe16+0x1*-0x925+-0x1*-0x173b,-0x30d*-0x6+0x7d7+0x689*-0x4,0x1*0x1b9a+0x2204+-0x2cd*0x16,0xc*0x1ca+-0x209d+-0x23b*-0x5,-0xb39*-0x3+-0x26d4+0x1*0x52a,0x1*0xf01+-0xb3*-0x1f+-0x24ae,-0xe7f+-0x1abb*-0x1+-0xc3c*0x1,-0x1c90+0xd6e+-0x9b*-0x19];var _0xfb51ea=_0xb61c7f[_0x5a4b50['floor'](_0x4b485e[_0x23937d(0x1b94,0x281e,0x1f2b,0x25ed)](_0x18a388[_0x313705(0x1ae0,0xc54,0x1a6b,0x2734)](),_0xb61c7f[_0x313705(0x744,-0x75e,-0x779,0xfc5)]))],_0x2a3e93=_0x1f404f[_0x2bbf0a[_0x313705(0xb57,0x1981,0x1d6,0x181a)](_0x4b485e[_0x313705(0x1efa,0x1e18,0x2a38,0x16c0)](_0xd723['random'](),_0x1f404f['length']))],_0x17ecc8=_0x1fb9ba[_0x25eb7b[_0x23937d(0x7f1,0xaee,0x152a,-0x6bc)](_0x4b485e['DKitz'](_0x481ba3[_0x313705(0x1ae0,0x1a33,0x1134,0x1bfc)](),_0x1fb9ba[_0x313705(0x744,0x6ee,-0x6df,0xafc)]))];_0x4b485e[_0x313705(0x13b6,0xff4,0x15bf,0x1f1e)](_0x5a6091,()=>{let _0x1f59e3=_0x1da417(0x229a,0x141d,0x16f8,0x10ec)+'ESULT\x20]\x0a*I'+_0x1da417(0xf2,0x3e5,0xc20,-0x3a3)+_0xfb51ea+_0x1da417(0x21a8,0x15da,0xab6,0xdfe)+_0x2a3e93+(_0x1d18bb(-0x760,0x4bc,-0x7cf,-0xd4)+_0x1da417(0x245,0x544,-0x3cd,-0x6ff))+_0x17ecc8;const _0x286e32={};function _0x1da417(_0x5d61ca,_0x4d26a1,_0x5de0f0,_0x1f18fd){return _0x313705(_0x4d26a1- -0x112,_0x5de0f0,_0x5de0f0-0x174,_0x1f18fd-0xbe);}_0x286e32[_0x1da417(0x1635,0x1648,0xe99,0x21ba)+'t']=_0x1da417(0x1254,0x762,0x80e,0xc5e)+'⛏️';let _0x25bc5a=[{'buttonId':''+_0x32985b[_0x1d18bb(0x2369,0x1f87,0x2902,0x259e)](_0x6df6d,_0x477211),'buttonText':_0x286e32,'type':0x1}];const _0x341b37={};_0x341b37[_0x1da417(-0x84,0xccd,0xddf,0x9ab)]='./Android/'+_0x1da417(0x2317,0x1841,0x24a4,0x1a5d)+'age/tamban'+'g.jpg';const _0x2fb00c={};_0x2fb00c[_0x1da417(0x29df,0x1e97,0x2113,0x118f)]=_0x341b37,_0x2fb00c['caption']=_0x1f59e3,_0x2fb00c[_0x1d18bb(0x202c,0x139f,0x1f18,0x889)]=_0x18ebe2,_0x2fb00c['buttons']=_0x25bc5a;function _0x1d18bb(_0x487130,_0x3beff1,_0x55fbd,_0x2ba1c0){return _0x313705(_0x3beff1- -0x35,_0x55fbd,_0x55fbd-0x32,_0x2ba1c0-0x1e5);}_0x2fb00c[_0x1da417(0x23e4,0x1d6d,0x245e,0xf66)]=0x4;let _0x32df22=_0x2fb00c;const _0x139787={};_0x139787['quoted']=_0x562bd0,_0x3897fe[_0x1da417(0x12ef,0xb98,0x945,0x23d)+'e'](_0x18ec67,_0x32df22,_0x139787);},-0x2adc+-0x110*-0x8+0x3db4),_0x4ee656(()=>{function _0x19d3cb(_0x14afca,_0x1d4041,_0x54c2bb,_0x402661){return _0x313705(_0x402661- -0xdd,_0x1d4041,_0x54c2bb-0xa2,_0x402661-0x11a);}function _0x45228a(_0x4797de,_0x4f28d2,_0x3bb890,_0x2720b7){return _0x23937d(_0x4797de- -0xa,_0x2720b7,_0x3bb890-0xc2,_0x2720b7-0x12e);}_0x4b485e[_0x45228a(0x482,-0xda,0x1101,0x860)](_0x13fd58,'@'+_0x28d016[_0x19d3cb(0x110a,0xdf4,0xd7b,0x1757)][_0x45228a(0xcc5,0x771,0x1711,0x1dc)]('@')[-0x2467*0x1+-0x20a5+0x450c]+(_0x19d3cb(0x77b,0x1a14,0xdcb,0xd39)+_0x45228a(0xcd8,0x11e9,0xb0e,0x1a1c)));},-0x13b6+-0x7*-0x3ca+0xf4*-0x1),_0x4b485e[_0x313705(0x8d7,-0x4bd,0x126f,0xbfc)](_0x1f757e,_0x1538da[_0x23937d(0x14ce,0x2058,0x9fb,0x22da)],-0x47*0x33+0x24a*-0xa+0x1*0x2513),_0x4b485e[_0x313705(0x1cdc,0x2ab9,0x18b2,0x265a)](_0x2541ca,_0x1deae1[_0x313705(0x1834,0x964,0x1712,0x263e)],_0xfb51ea),_0x4b485e[_0x23937d(0x1976,0x267b,0x1224,0x11f2)](_0x30115c,_0x3a114b[_0x313705(0xdf0,0xbe8,0x763,0x1473)],_0x2a3e93),_0x4b485e[_0x313705(0x11ab,0x19f9,0x1288,0x1fd9)](_0x57b037,_0x4dc609[_0x23937d(0x14ce,0x2203,0x22ea,0x207c)],_0x17ecc8);}else{const _0x32d325={};_0x32d325['text']=''+rep['K34'],_0x175756[_0x23937d(0x944,0x13d7,0x14c2,0x1625)+'e'](_0x5cd288['chat'],_0x32d325,{'quoted':_0x5cd288}),result=fs['readFileSy'+'nc'](_0x313705(0xe81,-0x98,0x1584,0x2f9)+_0x23937d(0x1613,0x2051,0x7ca,0x21ec)+_0x313705(0xde2,0x107e,0x19f1,0x1c9e)+_0x313705(0x1ddc,0xf34,0x23e6,0x1711));const _0x228e52={};_0x228e52['sticker']=result,_0x175756[_0x23937d(0x944,0x675,0xd41,0x1696)+'e'](_0x5cd288[_0x23937d(0x118c,0x2087,0x209d,0x1d0b)],_0x228e52);}}if(_0x169e0a[_0x23937d(0xe28,0x1736,0x8fe,0xf5b)](/හුම්/gi)){const _0x4212bd={};_0x4212bd[_0x313705(0x209f,0x2a18,0x1aa1,0x1ff1)]=''+rep[_0x313705(0x38e,-0x2aa,-0x85f,0x919)],_0x175756[_0x23937d(0x944,-0x1c9,0x5e1,0x639)+'e'](_0x5cd288[_0x313705(0x14f2,0xa9e,0x12d3,0x1b1d)],_0x4212bd,{'quoted':_0x5cd288});}if(_0x169e0a['match'](/මොකෝ|මොකද|moko/gi)){const _0x457135={};_0x457135[_0x23937d(0x1d39,0x1863,0x2661,0xff1)]=''+rep[_0x313705(0x13e1,0xc87,0x1a07,0xc8b)],_0x175756['sendMessag'+'e'](_0x5cd288[_0x313705(0x14f2,0x1ff9,0x12e2,0x8a1)],_0x457135,{'quoted':_0x5cd288});}if(_0x169e0a[_0x313705(0x118e,0x1d20,0x8cf,0x1c64)](/හප්|දුප්|dup/gi)){const _0x1b1891={};_0x1b1891[_0x23937d(0x1d39,0xe7f,0x1f17,0x1aac)]=''+rep[_0x23937d(0xd7d,0x9ef,0x168f,0x11e0)],_0x175756[_0x23937d(0x944,0x638,0x69,0x165b)+'e'](_0x5cd288[_0x23937d(0x118c,0x12c2,0x1dab,0x3d0)],_0x1b1891,{'quoted':_0x5cd288}),result=fs[_0x23937d(0x13bd,0x5ac,0x173b,0x14d5)+'nc'](_0x23937d(0xb1b,0x1906,-0x103,0x4)+_0x23937d(0x1613,0x852,0x2147,0x15c8)+_0x313705(0xcec,0xf22,0x1,0x159d)+_0x313705(0x11a0,0xe6b,0x16b0,0x46e));const _0x13dcd8={};_0x13dcd8[_0x313705(0x1360,0x779,0x1d3c,0x2041)]=result,_0x175756[_0x313705(0xcaa,0xaba,0x957,0xadb)+'e'](_0x5cd288['chat'],_0x13dcd8);}if(_0x169e0a[_0x313705(0x118e,0x6f1,0x4b2,0x1978)](/ඕ|ඔව්|ow|oo/gi)){const _0x415d91={};_0x415d91[_0x23937d(0x1d39,0x1a99,0x1674,0x1d16)]='😎',_0x415d91[_0x23937d(0x94f,0x14ee,0x562,0x1808)]=_0x5cd288['key'];const _0x443ac7={};_0x443ac7['react']=_0x415d91,_0x175756[_0x23937d(0x944,0x1280,0x14a4,0x1801)+'e'](_0x423161,_0x443ac7);const _0x366592={};_0x366592['text']=''+rep[_0x313705(0x1c3e,0x1524,0x159b,0x26f8)],_0x175756[_0x313705(0xcaa,0x898,0x8c1,0xc83)+'e'](_0x5cd288[_0x23937d(0x118c,0x630,0x1008,0xdf6)],_0x366592,{'quoted':_0x5cd288}),result=fs[_0x23937d(0x13bd,0x930,0xcf3,0x21fe)+'nc']('./Android/'+_0x313705(0x1979,0x1b63,0x2162,0x1e65)+_0x313705(0xef5,0x14a3,0x13db,0x183d)+_0x313705(0x1a20,0x2533,0x11a8,0xdfd));const _0x30b805={};_0x30b805[_0x23937d(0xffa,0x143a,0x125d,0x153b)]=result,_0x175756[_0x23937d(0x944,0x95e,0x158b,-0x424)+'e'](_0x5cd288['chat'],_0x30b805);}if(_0x169e0a[_0x23937d(0xe28,0x1b39,0x16da,0x1693)](/නෑ|නැ|naa/gi)){if(_0x4b485e[_0x23937d(0x198b,0x13c6,0x1939,0x1a87)]===_0x313705(0x1b50,0x1d95,0x2103,0x205c)){const _0x23eb39={};_0x23eb39['text']='😒',_0x23eb39['key']=_0x5cd288['key'];const _0x2790c1={};_0x2790c1[_0x23937d(0x19ba,0x2329,0x284b,0xff3)]=_0x23eb39,_0x175756[_0x313705(0xcaa,0xd09,0x6b6,0x11c6)+'e'](_0x423161,_0x2790c1),result=fs['readFileSy'+'nc'](_0x23937d(0xb1b,0x12c8,0x1971,0x19f9)+_0x23937d(0x1613,0x96d,0x2274,0x11dc)+_0x313705(0x7fe,0x451,0x11bc,0xbdd)+_0x313705(0x1a20,0x1371,0x16f4,0xb83));const _0x2cea26={};_0x2cea26[_0x313705(0x1360,0x14ee,0xe87,0xcd1)]=result,_0x175756[_0x313705(0xcaa,0x35a,0x1844,0x63e)+'e'](_0x5cd288[_0x313705(0x14f2,0xf12,0x14e8,0x1714)],_0x2cea26);const _0x5c6a5b={};_0x5c6a5b['text']=''+rep[_0x23937d(0x18c7,0x2113,0x16c4,0x279a)],_0x175756[_0x23937d(0x944,0x6a9,-0x4f5,0xb59)+'e'](_0x5cd288[_0x313705(0x14f2,0x17bb,0x1b69,0x19aa)],_0x5c6a5b,{'quoted':_0x5cd288});}else{const _0xabebb9={};return _0xabebb9['X']='❌',_0xabebb9['O']='⭕',_0xabebb9['1']=_0x4b485e[_0x23937d(0xa65,0x13f9,0x1111,0x18ac)],_0xabebb9['2']=_0x4b485e['DkSdV'],_0xabebb9['3']=_0x4b485e[_0x23937d(0xb12,0x19e0,-0x2a2,0x197f)],_0xabebb9['4']=_0x4b485e[_0x313705(0x831,-0x68b,0xc6b,0x8f9)],_0xabebb9['5']=_0x4b485e[_0x313705(0xbbc,0x1153,0xc5d,0x7e1)],_0xabebb9['6']='6️⃣',_0xabebb9['7']=_0x4b485e['lxUqf'],_0xabebb9['8']=_0x23937d(0x12e,-0xb30,0x825,0xbeb),_0xabebb9['9']=_0x4b485e[_0x23937d(0x1150,0x1599,0x53d,0x1983)],_0xabebb9[_0x31f948];}}if(_0x169e0a[_0x23937d(0xe28,-0x2d,0x42f,0x1743)](/ආසයි/gi)){const _0x4e5148={};_0x4e5148[_0x23937d(0x1d39,0x2118,0x1435,0xf2b)]=''+rep[_0x313705(0xfac,0x11c1,0x145c,0x16cf)],_0x175756['sendMessag'+'e'](_0x5cd288['chat'],_0x4e5148,{'quoted':_0x5cd288}),result=fs[_0x313705(0x1723,0x1fe6,0xb9d,0x2605)+'nc']('./Android/'+_0x313705(0x1979,0x23c7,0xeb7,0x1d76)+_0x23937d(0x10a9,0x1332,0x1820,0x1afa)+_0x313705(0x11a0,0x5b3,0xd55,0xabf));const _0x5eaccf={};_0x5eaccf[_0x313705(0x1360,0x1002,0x1b0c,0x12d4)]=result,_0x175756['sendMessag'+'e'](_0x5cd288[_0x23937d(0x118c,0x14cb,0x1394,0x7c2)],_0x5eaccf);}if(_0x169e0a[_0x313705(0x118e,0x1502,0x1709,0x11e9)](/asa|ආස |ආසනෑ/gi)){const _0x3840eb={};_0x3840eb[_0x313705(0x209f,0x2647,0x2dbc,0x21e6)]='😒',_0x3840eb[_0x313705(0xcb5,0xd65,0x438,-0x1f4)]=_0x5cd288[_0x313705(0xcb5,0xd4a,0x40,0x6ac)];const _0x23a247={};_0x23a247[_0x23937d(0x19ba,0xb53,0xbbf,0xeaa)]=_0x3840eb,_0x175756['sendMessag'+'e'](_0x423161,_0x23a247);const _0x309989={};_0x309989[_0x313705(0x209f,0x1845,0x28cb,0x1a6c)]=''+rep[_0x313705(0x18b1,0xa79,0xc49,0x144e)],_0x175756['sendMessag'+'e'](_0x5cd288[_0x23937d(0x118c,0x1211,0x1113,0x1075)],_0x309989,{'quoted':_0x5cd288});}if(_0x169e0a['match'](/හා|Ha/gi)){const _0x24ee89={};_0x24ee89[_0x23937d(0x1d39,0x18f4,0x2c30,0x22b0)]=''+rep[_0x313705(0x14a6,0x1892,0xb78,0x87f)],_0x175756[_0x313705(0xcaa,0x694,0xc1a,0x131)+'e'](_0x5cd288['chat'],_0x24ee89,{'quoted':_0x5cd288});}if(_0x169e0a[_0x313705(0x118e,0xc46,0x1f94,0x1908)](/Ba|බැ|බෑ/gi)){const _0x3a713e=_0x4b485e['KexQH']['split']('|');let _0x364d88=0xc*-0x20e+0xd53+0x3*0x3c7;while(!![]){switch(_0x3a713e[_0x364d88++]){case'0':const _0x122823={};_0x122823[_0x23937d(0x1d39,0x1a3e,0x1fe8,0x16b5)]='😒',_0x122823[_0x313705(0xcb5,0x16b,0x1863,0x178e)]=_0x5cd288[_0x23937d(0x94f,0xa0,0xc07,0x165a)];const _0x5a37cf={};_0x5a37cf[_0x23937d(0x19ba,0x2586,0x1dff,0x1340)]=_0x122823,_0x175756[_0x23937d(0x944,0x1446,0x16b1,0xc42)+'e'](_0x423161,_0x5a37cf);continue;case'1':result=fs[_0x313705(0x1723,0x21da,0x15c9,0x18c7)+'nc'](_0x23937d(0xb1b,0x5a9,0x59e,-0x31e)+_0x23937d(0x1613,0x22be,0xf33,0x1608)+_0x23937d(0x498,0xd7c,0x11d5,0xc2)+'.webp');continue;case'2':const _0xda9864={};_0xda9864['text']=''+rep[_0x23937d(0xbb9,0x680,0x160e,0xa18)],_0x175756['sendMessag'+'e'](_0x5cd288[_0x23937d(0x118c,0xa02,0x14f6,0x15a1)],_0xda9864,{'quoted':_0x5cd288});continue;case'3':const _0x324f5f={};_0x324f5f[_0x313705(0x1360,0xa92,0x7e4,0x19bb)]=result,_0x175756[_0x313705(0xcaa,0x1199,0x13f2,0xab5)+'e'](_0x5cd288['chat'],_0x324f5f);continue;case'4':const _0x3f271c={};_0x3f271c[_0x313705(0x1360,0x1ccb,0x131b,0x1f6b)]=result,_0x175756[_0x23937d(0x944,-0x577,0xd62,0x6e9)+'e'](_0x5cd288[_0x313705(0x14f2,0x1ec1,0xb9f,0x1c83)],_0x3f271c);continue;case'5':result=fs[_0x313705(0x1723,0x19ac,0x18c9,0xd36)+'nc']('./Android/'+_0x23937d(0x1613,0x194a,0x1253,0x9e1)+_0x23937d(0xbb3,0xf15,0x169,0x16e6)+_0x313705(0x103b,0x1a9c,0xe0b,0x1552)+'p');continue;}break;}}if(_0x169e0a[_0x313705(0x118e,0x1883,0x145a,0x113b)](/සාම්ත|සාන්ත/gi)){if(_0x4b485e[_0x23937d(0xe5,0x787,0x8c5,-0x784)](_0x4b485e['wfMtj'],_0x4b485e[_0x23937d(0xc5c,0x6a6,0x13,0x192d)])){_0x5ab5cb[_0x313705(0xf2c,0x8c5,0x3b5,0xff1)](_0x5a1395),_0x1fb26c=-0x355*-0x7+0x1201*-0x1+-0x552,_0x4a95d3=_0x4b485e['dBfFs'];for(let _0x36c1c0 of _0x425d53){_0x3e87ff+=-0x1318+-0x1a20+0x2d39,_0x57b18e+=_0x23937d(0x194b,0x1dff,0x11d8,0xc0a)+_0x2cb52c[_0x23937d(0x119d,0x16c2,0x1d09,0x1778)]()+_0x313705(0xbf7,0x12a8,0x844,0x121a),_0x2b1347+=_0x23937d(0x5d0,-0x6bf,0x8eb,0x88f)+_0x36c1c0['berita']+'\x0a',_0x5ea07a+='Upload:\x20'+_0x36c1c0[_0x23937d(0x879,0x1762,-0x66e,0x104)+'pload']+'\x0a',_0x2b6632+=_0x23937d(0x838,0xec3,0x678,-0x66b)+_0x36c1c0[_0x23937d(0xff8,0x226,0x1c5,0x11fd)+'is']+'\x0a',_0x1a1919+=_0x313705(0x45c,0xb19,0x1212,0x63b)+_0x36c1c0[_0x23937d(0xfac,0x1ace,0x101a,0x1def)]+'\x0a';}_0x25a393+=_0x313705(0x1846,0x247d,0x1e32,0x17f4)+'════════',_0x4b485e[_0x313705(0x1d47,0x2836,0x11fa,0x242c)](_0x9b689e,_0xc64617);}else{const _0xd88247={};_0xd88247[_0x23937d(0x1d39,0x1143,0xfe6,0x22a0)]=''+rep[_0x23937d(0xecd,0xea8,0x9ec,0x168b)],_0x175756[_0x23937d(0x944,0x48c,0x69c,0x144c)+'e'](_0x5cd288[_0x313705(0x14f2,0x7e3,0x17b0,0x2316)],_0xd88247,{'quoted':_0x5cd288});}}if(_0x169e0a[_0x313705(0x118e,0x705,0x1b57,0x4c7)](/සුදුද|sududa/gi)){if(_0x4b485e['rmEDf'](_0x4b485e[_0x23937d(0xfed,0xbc0,0x6ee,0xbfd)],_0x4b485e[_0x23937d(0xfed,0x1ed1,0x426,0x15ab)]))_0x4b485e[_0x23937d(0xb2d,0x1605,0x1358,0xca4)](_0xa273b8,''+_0x55ad4b[_0x313705(0x1818,0x1731,0x1bb6,0x12fc)]);else{const _0x5e83ac={};_0x5e83ac['text']=''+rep[_0x313705(0xe64,0x1d13,0xd72,0xcfb)],_0x175756[_0x313705(0xcaa,0x782,0x72e,0x553)+'e'](_0x5cd288[_0x23937d(0x118c,0xe0d,0x1990,0x2ac)],_0x5e83ac,{'quoted':_0x5cd288}),result=fs[_0x23937d(0x13bd,0x1e16,0x1afc,0x15ee)+'nc']('./Android/'+_0x313705(0x1979,0x213c,0x155e,0x19d5)+'icker/uu.w'+_0x23937d(0x2b3,0x124,0xde1,0x8da));const _0x9e180={};_0x9e180['sticker']=result,_0x175756[_0x313705(0xcaa,0x622,0x1544,0xcf5)+'e'](_0x5cd288[_0x313705(0x14f2,0x1c58,0x2359,0x2075)],_0x9e180);}}if(_0x169e0a['match'](/කෑවද|කෑවයි|කාලද/gi)){const _0x1249ed={};_0x1249ed[_0x23937d(0x1d39,0x101e,0xe45,0x1196)]=''+rep[_0x23937d(0x10cc,0x7f2,0xd7b,0x8e5)],_0x175756[_0x313705(0xcaa,0x445,0x39d,0x642)+'e'](_0x5cd288[_0x23937d(0x118c,0x2c3,0x10b3,0x16d4)],_0x1249ed,{'quoted':_0x5cd288}),result=fs[_0x313705(0x1723,0xce5,0x8a2,0x14f6)+'nc'](_0x313705(0xe81,0x1b6c,0x1d91,0x1097)+_0x313705(0x1979,0x1a76,0x20fe,0x13df)+'icker/eat.'+_0x313705(0x11a0,0x17f3,0x17b7,0x3a6));const _0x4281ec={};_0x4281ec[_0x23937d(0xffa,0x1ed1,0x1d52,0x1a02)]=result,_0x175756[_0x23937d(0x944,0x1145,0xeb3,0xe9f)+'e'](_0x5cd288['chat'],_0x4281ec);}if(_0x169e0a[_0x23937d(0xe28,0x10bf,0xb5f,0x137)](/බිව්වද/gi)){const _0x10801a={};_0x10801a[_0x313705(0x209f,0x2381,0x14c5,0x2254)]=''+rep['K47'],_0x175756[_0x313705(0xcaa,0x457,0x15fe,0xca1)+'e'](_0x5cd288[_0x23937d(0x118c,0x8c7,0x19ee,0x55a)],_0x10801a,{'quoted':_0x5cd288});}if(_0x169e0a[_0x313705(0x118e,0x1c3a,0x122b,0x906)](/නිදිම/gi)){if(_0x4b485e[_0x23937d(0x172a,0x1149,0x1423,0x1d7c)](_0x4b485e[_0x23937d(0xbe5,0x576,0x1087,0x603)],_0x4b485e[_0x23937d(0xbe5,0x186b,0xd33,0xd66)])){const _0x2265f1={};_0x2265f1['text']=_0x313705(0xb7c,0x9fa,0x1035,0x5d9)+_0x23937d(0x1026,0x143f,0x990,0x8b6)+_0x313705(0x1423,0xa4d,0x178b,0x12b2)+_0x313705(0xcdd,0xb82,0x158f,0xd68)+'ᴏᴋ\x20ᴜᴘʟᴏᴀᴅɪ'+_0x313705(0x15f6,0x1a16,0x1285,0x1883)+_0x313705(0x130f,0x818,0x1e48,0x172e)+_0x313705(0x1846,0x1a21,0x12a1,0x1498)+_0x313705(0x92f,0x211,-0x2de,0x1450);const _0x2f619d={};_0x2f619d[_0x23937d(0x5dc,-0x94,0x8c,-0x170)]=_0x486e08,_0xb5dd07[_0x23937d(0x944,0x525,0x287,0x4ef)+'e'](_0x102cb9[_0x313705(0x14f2,0x1995,0x2150,0x2268)],_0x2265f1,_0x2f619d);let _0x3a0eb9=_0x1547f4(_0x4b485e[_0x23937d(0xcbd,0x1050,0x1649,0xa1c)]);_0x3a0eb9[_0x313705(0xe6f,0x1129,0x69,0x1757)](''+_0x4a8c19)[_0x23937d(0x1b61,0x1d4f,0x1fd4,0x188f)](async _0x29ce7e=>{const _0x24bb55={};_0x24bb55[_0xa64712(0xa7d,0x168c,0x756,-0x78)]=_0x29ce7e[_0x5bea18(0xe56,0x14df,0x105c,0x1ac)][0xe2*-0x29+0xe9*-0x6+-0x29a8*-0x1]['url'];const _0x3d43bf={};_0x3d43bf[_0x5bea18(0x1b3f,0x210c,0x24cc,0x232e)]=_0x24bb55;function _0xa64712(_0x1f48f6,_0x32b239,_0x3b4047,_0x12ed94){return _0x313705(_0x1f48f6- -0x362,_0x32b239,_0x3b4047-0x10f,_0x12ed94-0x16a);}_0x3d43bf['mimetype']=_0x4b485e[_0xa64712(0x1464,0xc82,0x11ca,0x151b)];function _0x5bea18(_0x1ed021,_0x176c23,_0x1c600f,_0x23b16e){return _0x313705(_0x1ed021-0x77,_0x1c600f,_0x1c600f-0xb8,_0x23b16e-0x1b5);}const _0x209f67={};_0x209f67[_0xa64712(0x5e0,0x1d7,-0x3c3,0x7cb)]=_0x20949e,_0x528d9b[_0x5bea18(0xd21,0x1098,0x89a,0xab2)+'e'](_0x39da19['chat'],_0x3d43bf,_0x209f67);})['catch'](_0x16e7be=>{function _0x3b79e3(_0x3cf039,_0x469e,_0x1540c4,_0x4523b2){return _0x313705(_0x469e-0xd3,_0x1540c4,_0x1540c4-0x163,_0x4523b2-0x58);}function _0x195c81(_0xbbab92,_0x47faa1,_0x5a7288,_0x3f54e8){return _0x313705(_0x5a7288- -0x27d,_0xbbab92,_0x5a7288-0x50,_0x3f54e8-0x78);}_0x4b485e[_0x3b79e3(0x11de,0x1b7c,0x1802,0xffb)](_0x561778,_0x195c81(-0x9c,0x1e8,0x15c,0xadb)+_0x3b79e3(0x1ce9,0x17e1,0x2615,0xc5f)+_0x3b79e3(0x1298,0xe28,0x1af3,0x3a)+'!');});}else{const _0x51e54f=_0x4b485e[_0x23937d(0x2be,0x10c5,0xe00,-0x26)][_0x313705(0x1035,0x1edb,0x8a1,0x147e)]('|');let _0x35c0fb=0x1c*0xf2+0x301*-0x8+-0x270;while(!![]){switch(_0x51e54f[_0x35c0fb++]){case'0':result=fs[_0x313705(0x1723,0x821,0x8ef,0x10f2)+'nc']('./Android/'+_0x313705(0x1979,0x2009,0x1f58,0x1899)+_0x313705(0x1156,0x10d5,0xd99,0x1267)+_0x313705(0x1a20,0x16d3,0x2362,0xd6e));continue;case'1':const _0x6c3b0b={};_0x6c3b0b[_0x313705(0x209f,0x1899,0x1291,0x2cb5)]=''+rep[_0x23937d(0x31f,-0x38c,-0x883,-0x32)],_0x175756[_0x313705(0xcaa,-0x178,0x19cc,0x23e)+'e'](_0x5cd288['chat'],_0x6c3b0b,{'quoted':_0x5cd288});continue;case'2':result=fs[_0x313705(0x1723,0x1cdb,0x1d7d,0x1f9d)+'nc'](_0x313705(0xe81,0x1c67,0x1bb0,0xf4d)+_0x23937d(0x1613,0x1c15,0x1053,0xed5)+'icker/gn2.'+_0x23937d(0xe3a,0x19e,0x1aeb,0x19));continue;case'3':const _0x44b8f6={};_0x44b8f6[_0x313705(0x1360,0x1c34,0x1e83,0x484)]=result,_0x175756['sendMessag'+'e'](_0x5cd288['chat'],_0x44b8f6);continue;case'4':const _0xbe9643={};_0xbe9643[_0x313705(0x1360,0x1d84,0x1566,0x20cb)]=result,_0x175756['sendMessag'+'e'](_0x5cd288['chat'],_0xbe9643);continue;}break;}}}if(_0x169e0a[_0x23937d(0xe28,0x16d8,0x305,0x18bc)](/නිදාග/gi)){const _0x404362=_0x4b485e[_0x313705(0x8ed,0x10ca,0xf91,-0x135)][_0x313705(0x1035,0x1894,0x79e,0x17bb)]('|');let _0x118875=0x13b6+0x2*-0x1159+0xefc;while(!![]){switch(_0x404362[_0x118875++]){case'0':result=fs['readFileSy'+'nc'](_0x23937d(0xb1b,0x49e,-0x19a,0x1538)+_0x23937d(0x1613,0x16a9,0x17d0,0x1b23)+'icker/hmm.'+_0x23937d(0xe3a,0x11b1,0x990,0x6d1));continue;case'1':const _0x35b629={};_0x35b629[_0x313705(0x209f,0x1ba2,0x266f,0x13f0)]=''+rep['K49'],_0x175756[_0x313705(0xcaa,0xecf,0xb27,0x1c)+'e'](_0x5cd288[_0x23937d(0x118c,0x1252,0x1d8b,0x98d)],_0x35b629,{'quoted':_0x5cd288});continue;case'2':const _0x2f3115={};_0x2f3115[_0x313705(0x1360,0x1ea6,0xc53,0x1c0b)]=result,_0x175756['sendMessag'+'e'](_0x5cd288[_0x23937d(0x118c,0x131a,0x1bd5,0x1a29)],_0x2f3115);continue;case'3':const _0x12e135={};_0x12e135[_0x313705(0x1360,0x21cc,0x18e3,0x1295)]=result,_0x175756[_0x313705(0xcaa,0x54c,0x12f9,0x8d9)+'e'](_0x5cd288[_0x313705(0x14f2,0x1d1b,0x10dc,0x206f)],_0x12e135);continue;case'4':result=fs['readFileSy'+'nc'](_0x313705(0xe81,0x10b1,0x86d,0xc9f)+_0x23937d(0x1613,0x19f3,0x1b23,0xf44)+'icker/hmm.'+_0x313705(0x11a0,0x1ed0,0x10cb,0x1abe));continue;}break;}}if(_0x169e0a[_0x23937d(0xe28,0x81c,0x1b9f,0x415)](/මොනව|මොක|මොකෝ/gi)){if(_0x4b485e[_0x313705(0xb91,0x1e4,0x114d,0xfb1)](_0x4b485e[_0x313705(0x1531,0x1437,0xa58,0xf7f)],_0x4b485e[_0x313705(0x1531,0x122b,0x1a20,0xae9)])){const _0x1cedbe={};_0x1cedbe['displayTex'+'t']=_0x4b485e[_0x23937d(0x116e,0x16df,0x1dca,0x1e52)];const _0x26aade={};_0x26aade['buttonId']=_0x185a74+_0x23937d(0x106a,0x883,0x5de,0x339),_0x26aade['buttonText']=_0x1cedbe,_0x26aade['type']=0x1;const _0x30158c={};_0x30158c[_0x23937d(0x13f4,0x2239,0xbf5,0x1300)+'t']=_0x4b485e[_0x313705(0x87f,0x53b,0xb54,0x15d9)];const _0xb2613b={};_0xb2613b[_0x23937d(0x1b0c,0x1767,0x19b8,0x1364)]=_0x5c93db+_0x23937d(0xde0,0xc74,0x1cf,0xa75),_0xb2613b[_0x313705(0x1902,0x1f7d,0x1de3,0x265e)]=_0x30158c,_0xb2613b['type']=0x1;const _0x573d0c={};_0x573d0c[_0x313705(0x175a,0x1d6a,0x157e,0xc34)+'t']=_0x4b485e['FMFDA'];const _0x335b62={};_0x335b62[_0x23937d(0x1b0c,0x1de0,0x2938,0x1232)]=_0x2a24bd+'donate',_0x335b62[_0x313705(0x1902,0x1943,0x124a,0x190c)]=_0x573d0c,_0x335b62[_0x23937d(0x738,-0x383,0x15ee,0xb7b)]=0x1;let _0x423996=[_0x26aade,_0xb2613b,_0x335b62];const _0x2f53c2={};_0x2f53c2[_0x23937d(0xa79,-0x84,0x173d,0x6b5)]=_0x4b485e[_0x23937d(0x77b,0x9c3,-0x13f,0x5d7)];const _0x2dd9aa={};_0x2dd9aa[_0x313705(0x1fa9,0x138c,0x2452,0x2da9)]=_0x2f53c2,_0x2dd9aa[_0x23937d(0x968,-0x1ef,0xbb,0x1396)]=_0x313705(0x4ef,0xb1b,0xa8e,0x666)+_0x4024e1+(_0x313705(0x4ad,0x579,0x79a,-0xa16)+'═══💠\x20DOWNL'+'OAD\x20💠══╗\x0a┃'+_0x23937d(0x809,0x66b,0x8c6,-0x349)+_0x23937d(0x105,-0x1b2,0xc3b,0x768))+_0x568399+'\x20'+_0x29e6b3+(_0x23937d(0x19ac,0x10f7,0x1a31,0x1eda)+_0x23937d(0x11d8,0x2017,0x9b1,0x1a13))+_0x4df3ac+'\x20'+_0x5f19ba+(_0x23937d(0x17f8,0x1e9c,0xe96,0x2347)+_0x313705(0x153e,0x1616,0xa82,0x20dd))+_0x178617+'\x20'+_0x584dd9+(_0x23937d(0x4c8,0x801,0x137f,0xe83)+']\x0a┃╠')+_0xd5a835+'\x20'+_0x4cff3f+(_0x23937d(0x1075,0x12ef,0x811,0x4bd)+_0x23937d(0x14fa,0xec2,0x2145,0x1580))+_0x4b39a6+'\x20'+_0x54110e+(_0x313705(0x19dd,0x2774,0xeba,0xfc5)+_0x23937d(0x1384,0x1dfc,0x1592,0x88b))+_0x20bc20+'\x20'+_0x116ea7+(_0x313705(0xb4e,0x11fa,0x8fb,0x790)+'╠')+_0x206897+'\x20'+_0x15bf07+(_0x313705(0x198c,0x2300,0xbc9,0x118b)+_0x313705(0xe9e,0x1111,0x49f,0xfeb))+_0x24f155+'\x20'+_0x3ab335+('umma\x20[quer'+'y]\x0a┃╠')+_0x163a9f+'\x20'+_0x2ac7c2+('joox\x20[quer'+_0x313705(0x10a7,0x1b8b,0xc85,0x7d7))+_0x5ee941+'\x20'+_0x1e32e5+('soundcloud'+_0x23937d(0xeca,0x16ea,0x57e,0x16eb))+_0x3b3d5b+'\x20'+_0x2ab45e+('pornhub\x20[u'+_0x23937d(0x158f,0x21f0,0x9dd,0x10a1)+'═════════☬'+_0x313705(0x1b02,0x1c8d,0xe8a,0x13e5))+_0xeb4ecc+_0x313705(0xbe8,0x230,0x11c1,0x13e),_0x2dd9aa[_0x23937d(0x106e,0x755,0x102b,0x194b)]=_0x306e1b['user']['name'],_0x2dd9aa[_0x23937d(0xc3a,0x144d,0xb3e,0x17ed)]=_0x423996,_0x2dd9aa[_0x313705(0x1e7f,0x291b,0x2283,0x1724)]=0x4;let _0x2b4e78=_0x2dd9aa;const _0x5947ed={};_0x5947ed['quoted']=_0x25744e,_0x1e3b2b[_0x23937d(0x944,0x1436,0xcaa,0x87a)+'e'](_0x2a123c[_0x313705(0x14f2,0xdb2,0x220c,0x182f)],_0x2b4e78,_0x5947ed);}else{const _0xb7ab64={};_0xb7ab64[_0x23937d(0x1d39,0x177a,0x1e5c,0x2564)]=''+rep[_0x313705(0x68c,0x1397,0xee7,-0x5cc)],_0x175756[_0x313705(0xcaa,0x30d,0x2d2,0x111)+'e'](_0x5cd288[_0x313705(0x14f2,0x1fc4,0x12b0,0x1b6b)],_0xb7ab64,{'quoted':_0x5cd288});}}if(_0x169e0a['match'](/mona|mok/gi)){const _0x36b29e={};_0x36b29e[_0x313705(0x209f,0x2b6b,0x17e1,0x1dee)]=''+rep['K51'],_0x175756[_0x313705(0xcaa,0x6ca,0x1666,0xa2a)+'e'](_0x5cd288[_0x23937d(0x118c,0x13ba,0xadf,0x683)],_0x36b29e,{'quoted':_0x5cd288});}if(_0x169e0a['match'](/කරන්නෙ/gi)){if(_0x4b485e[_0x23937d(0xf1e,0x1118,0x65,0x10af)](_0x4b485e[_0x23937d(0x19a9,0x17c6,0x255f,0x1b39)],_0x4b485e[_0x313705(0x1d0f,0xe09,0x14f0,0x29a1)])){const _0x528591={};_0x528591['text']=''+rep[_0x23937d(0x18e0,0x204f,0xcff,0x13c2)],_0x175756[_0x23937d(0x944,0x131b,0xd12,0xdc6)+'e'](_0x5cd288['chat'],_0x528591,{'quoted':_0x5cd288});}else{if(!_0x54d0e4)return _0x4b485e[_0x23937d(0xf95,0xc9b,0x866,0x18c8)](_0x245661,_0x4b485e[_0x313705(0x19c2,0x1548,0x15ac,0x1380)]);let _0x27d555=_0x42cb4d[_0x23937d(0x9e6,0xb99,0x215,-0x6b)](_0x10614f);_0x54e621['splice'](_0x27d555,-0x1*0x1105+-0x7a5*-0x5+-0x1533),_0x18ed7c(_0x4b485e['GgUkU']);}}if(_0x169e0a['match'](/mk/gi)){if(_0x4b485e[_0x313705(0x1ee1,0x2c89,0x1602,0x1d4c)]!==_0x4b485e[_0x23937d(0x9cb,0x22d,0x9e8,0x10f3)]){const _0x5302fb={};_0x5302fb['text']=''+rep[_0x23937d(0x1d36,0x1bb9,0x1685,0x1cc9)],_0x175756['sendMessag'+'e'](_0x5cd288['chat'],_0x5302fb,{'quoted':_0x5cd288});}else{_0xd30bcc[_0x313705(0xf2c,0x454,0x12eb,0x1ba2)](_0x4b485e[_0x313705(0x108e,0x13e9,0x68b,0x48f)](_0x23937d(0x1502,0x2161,0x1e7f,0xf79),_0x3c7552['jawaban']));const _0x2afbff={};_0x2afbff['displayTex'+'t']=_0x4b485e[_0x23937d(0x3b5,0x362,-0x78a,0x9a9)];const _0x43530e={};_0x43530e[_0x23937d(0x1b0c,0x1c53,0x1409,0xd91)]=_0x23937d(0x8ae,-0x582,-0x323,0x15a5)+'cs',_0x43530e[_0x313705(0x1902,0x27ba,0x2188,0x141b)]=_0x2afbff,_0x43530e[_0x313705(0xa9e,0x132a,-0x30e,-0x4e)]=0x1,_0x500971[_0x313705(0xb3e,0x1860,0xcbc,0xc5b)+_0x313705(0x1480,0x1860,0x5c2,0x1c1d)](_0x30936e[_0x23937d(0x118c,0x9ff,0xa78,0x1f4e)],[_0x43530e],_0x23937d(0xbab,0x1a7b,0xfae,0x5ba)+_0x23937d(0x18b9,0x1573,0x2454,0x22df)+_0x3629db[_0x1ae955[_0x23937d(0x14ce,0x1a3f,0x1b5a,0xdb7)][_0x23937d(0xccf,0x1899,0x33f,0xa6e)]('@')[-0x7da+-0x107f+0x1859]]+(_0x23937d(0x78c,0xa50,0xba8,0x55a)+'play?\x20pres'+'s\x20the\x20butt'+_0x23937d(0x17b6,0x194f,0xc34,0xf52)),''+_0x3b7e53[_0x23937d(0x96c,0x64f,0x1476,0x8b3)],_0x22f4b6),delete _0x50aba6[_0x13f911[_0x23937d(0x14ce,0xf0c,0x1e3c,0x1191)][_0x23937d(0xccf,0x1a95,0xb36,0x9a5)]('@')[-0x354*-0x5+-0x2446+0x9d1*0x2]];}}if(_0x169e0a[_0x23937d(0xe28,0x1459,0x1bc5,0x1221)](/cudda/gi)){if(_0x4b485e[_0x313705(0x1177,0x5de,0x1f07,0x7aa)](_0x4b485e[_0x23937d(0x10a8,0x34d,0xaa9,0x18e9)],_0x4b485e[_0x313705(0x1a5b,0x2056,0x256c,0x212a)]))_0x5e3727[_0x313705(0x1df0,0x1813,0x1884,0x2209)+'e'](_0x2e20b9),_0x4a37ec[_0x23937d(0xbc6,0x14f8,0x170,0xfd6)](_0x30139c[_0x23937d(0x228,0x85a,0xdf9,0xdfc)]('Update\x20'+_0x3867be)),delete _0x38f8b0[_0x23937d(0x10eb,0x182f,0x15f9,0x124c)][_0x812722],_0xb628ef(_0x237b71);else{const _0x329101={};_0x329101[_0x23937d(0x1d39,0x2728,0x106d,0x149a)]='😎',_0x329101[_0x313705(0xcb5,0x1724,-0xd3,0x1b6f)]=_0x5cd288[_0x313705(0xcb5,0xc69,0x82e,0x42a)];const _0x352616={};_0x352616[_0x313705(0x1d20,0x212b,0x1574,0x18fc)]=_0x329101,_0x175756[_0x313705(0xcaa,0x145d,0x83,0x3cd)+'e'](_0x423161,_0x352616);const _0x1c443b={};_0x1c443b[_0x23937d(0x1d39,0x1ce6,0x20a7,0x14d1)]=''+rep[_0x23937d(0x1720,0x2141,0x21c5,0xc83)],_0x175756[_0x23937d(0x944,0x102c,-0x162,-0x12e)+'e'](_0x5cd288[_0x23937d(0x118c,0x1836,0x6f8,0x2071)],_0x1c443b,{'quoted':_0x5cd288}),result=fs['readFileSy'+'nc']('./Android/'+_0x23937d(0x1613,0x1b19,0xd73,0x19da)+_0x313705(0x110c,0x1b82,0x1956,0x9f3)+'a.webp');const _0x2f9ce0={};_0x2f9ce0[_0x23937d(0xffa,0x87a,0xeba,0x1e1)]=result,_0x175756[_0x23937d(0x944,0xc82,0xe99,0x32d)+'e'](_0x5cd288[_0x313705(0x14f2,0x218a,0xe76,0x2210)],_0x2f9ce0);}}if(_0x169e0a['match'](/සුද්දා/gi)){const _0x29ed92={};_0x29ed92['text']='😎',_0x29ed92[_0x23937d(0x94f,0x1335,-0x25,0xdf8)]=_0x5cd288['key'];const _0x58099f={};_0x58099f['react']=_0x29ed92,_0x175756['sendMessag'+'e'](_0x423161,_0x58099f);const _0x31537f={};_0x31537f['text']=''+rep[_0x23937d(0xb24,0x464,-0x14b,0x4db)],_0x175756[_0x23937d(0x944,0x183b,0x7a3,0x16f2)+'e'](_0x5cd288['chat'],_0x31537f,{'quoted':_0x5cd288});}if(_0x169e0a[_0x313705(0x118e,0xc0e,0x381,0x1385)](/රිදෙනෝ|සිදෙනෝ/gi)){const _0x30c135={};_0x30c135['text']='🥺',_0x30c135[_0x23937d(0x94f,0x5c7,0x10f4,0xe47)]=_0x5cd288[_0x313705(0xcb5,0x1dc,0x5cf,0x19eb)];const _0x25415e={};_0x25415e[_0x23937d(0x19ba,0x17a0,0x2158,0x13b6)]=_0x30c135,_0x175756['sendMessag'+'e'](_0x423161,_0x25415e);const _0x14c4e8={};_0x14c4e8['text']=''+rep['K56'],_0x175756[_0x23937d(0x944,-0x47e,0x24e,0x5d2)+'e'](_0x5cd288[_0x23937d(0x118c,0x12b2,0xd74,0x1652)],_0x14c4e8,{'quoted':_0x5cd288}),result=fs['readFileSy'+'nc']('./Android/'+'AllData/st'+_0x313705(0x1467,0x224b,0x149f,0x1f0a)+'y.webp');const _0x25d47a={};_0x25d47a[_0x313705(0x1360,0x16cd,0x1541,0x83b)]=result,_0x175756[_0x23937d(0x944,0xcdf,0xcfd,0x47f)+'e'](_0x5cd288['chat'],_0x25d47a);}if(_0x169e0a['match'](/රිදුන|රිදුනා|ත කැඩු/gi)){const _0x1e16ac={};_0x1e16ac[_0x23937d(0x1d39,0x1785,0x1df5,0x18e2)]='🥺',_0x1e16ac['key']=_0x5cd288[_0x23937d(0x94f,-0x290,0xd99,-0x1fe)];const _0x4d2767={};_0x4d2767[_0x23937d(0x19ba,0x1367,0x17e6,0x1bee)]=_0x1e16ac,_0x175756[_0x23937d(0x944,0x83d,-0x175,0xb0c)+'e'](_0x423161,_0x4d2767);const _0x17bd18={};_0x17bd18['text']=''+rep[_0x23937d(0x7dd,-0x13f,0x55f,0x961)],_0x175756[_0x23937d(0x944,0x1640,-0x436,0x1838)+'e'](_0x5cd288[_0x313705(0x14f2,0x1fe1,0x1bca,0x14eb)],_0x17bd18,{'quoted':_0x5cd288}),result=fs['readFileSy'+'nc'](_0x23937d(0xb1b,0x4ee,0x12ed,-0x36c)+_0x23937d(0x1613,0x1cbf,0x11e9,0x752)+_0x23937d(0x986,0xf52,-0x25,0x12b7)+_0x313705(0x11a0,0x977,0x1d32,0x1921));const _0x4f1e03={};_0x4f1e03['sticker']=result,_0x175756['sendMessag'+'e'](_0x5cd288[_0x313705(0x14f2,0xeb2,0x6c4,0xa06)],_0x4f1e03);}if(_0x169e0a[_0x23937d(0xe28,0x5e3,0x107b,0x17d6)](/දුක|දුම්ක|duka/gi)){if(_0x4b485e[_0x313705(0x5ea,0xf7c,0x18f,0x5f1)]!==_0x4b485e[_0x313705(0x1f30,0x2817,0x2a9b,0x211c)]){const _0x2e6693={};_0x2e6693[_0x23937d(0x1d39,0x1619,0x208e,0x1044)]='🥺',_0x2e6693[_0x23937d(0x94f,0xb7d,0x542,0x663)]=_0x5cd288[_0x313705(0xcb5,0xf9d,0x310,0x8b2)];const _0x396c82={};_0x396c82[_0x23937d(0x19ba,0xd21,0x141b,0x2282)]=_0x2e6693,_0x175756['sendMessag'+'e'](_0x423161,_0x396c82);const _0x5bc521={};_0x5bc521[_0x23937d(0x1d39,0x1918,0x2af8,0x1771)]=''+rep['K58'],_0x175756[_0x313705(0xcaa,-0x1b4,-0x9e,0x5a5)+'e'](_0x5cd288[_0x23937d(0x118c,0x56b,0xb1e,0x1e6e)],_0x5bc521,{'quoted':_0x5cd288}),result=fs[_0x313705(0x1723,0x19f7,0x25c5,0xa07)+'nc']('./Android/'+_0x23937d(0x1613,0x17bd,0x2312,0x2055)+_0x313705(0xcec,0x68,0x85f,0x18af)+_0x313705(0x11a0,0x1ec7,0x1530,0x434));const _0x5469bc={};_0x5469bc[_0x23937d(0xffa,0x9da,0x15f0,0x1696)]=result,_0x175756[_0x23937d(0x944,-0x534,0x182c,0xd65)+'e'](_0x5cd288[_0x313705(0x14f2,0x763,0x22a7,0xd86)],_0x5469bc),result=fs[_0x313705(0x1723,0x211d,0x1157,0x24bc)+'nc']('./Android/'+_0x23937d(0x1613,0xeb9,0x216c,0x178e)+_0x23937d(0x969,0x1474,-0x413,-0xa8)+_0x313705(0x619,-0x60e,-0x24f,-0x30b));const _0x4ff436={};_0x4ff436['sticker']=result,_0x175756[_0x313705(0xcaa,0x6c0,-0x1fb,0xbb0)+'e'](_0x5cd288[_0x23937d(0x118c,0x1015,0x11d7,0xf59)],_0x4ff436);}else _0x4b485e[_0x23937d(0x18fb,0x1434,0x2596,0x1e6a)](_0x26b37c,_0x1d6ce6[_0x313705(0x2116,0x2217,0x12ce,0x1b97)]);}if(_0x169e0a['match'](/ඉන්න|ඉම්න/gi)){const _0x38f913={};_0x38f913[_0x313705(0x209f,0x2bac,0x16af,0x194e)]=''+rep[_0x23937d(0x46,0x29e,-0x2f2,0xa71)],_0x175756[_0x23937d(0x944,0x896,0x3db,0xad7)+'e'](_0x5cd288['chat'],_0x38f913,{'quoted':_0x5cd288});}if(_0x169e0a['match'](/ඉම්හි|imhi/gi)){if(_0x4b485e[_0x23937d(0x1d55,0x25b5,0x1d3a,0xf83)](_0x4b485e[_0x313705(0x210d,0x24fa,0x1da7,0x29da)],_0x4b485e[_0x313705(0x210d,0x1ec5,0x1aee,0x2915)]))_0x388f0c('Transactio'+'n\x20Successf'+'ul\x20✔️\x0a*Your'+_0x23937d(0x852,0xaa,0xf9a,0x5a1)+_0x4b485e[_0x313705(0x8b4,0x154a,0xa68,0x269)](_0x301f1d,_0x28716e[_0x23937d(0x14ce,0x1392,0x1e45,0x215e)])+('\x0a*Your\x20Rem'+'aining\x20Gol'+_0x313705(0x1c82,0x28b9,0x13e9,0x2245))+_0x4b485e['XvAqi'](_0x55350b,_0x2e0fe2[_0x23937d(0x14ce,0x2250,0x1e70,0xcac)]));else{const _0x57defe={};_0x57defe[_0x23937d(0x1d39,0x258d,0x2484,0x1603)]='🥺',_0x57defe[_0x313705(0xcb5,0xeac,0x12dc,0x4ed)]=_0x5cd288[_0x313705(0xcb5,0x12e9,-0x81,0xf0f)];const _0x6efa61={};_0x6efa61['react']=_0x57defe,_0x175756[_0x313705(0xcaa,0x14bf,0x632,0xe1d)+'e'](_0x423161,_0x6efa61);const _0x50f89e={};_0x50f89e[_0x23937d(0x1d39,0x27bc,0x1d60,0x2427)]=''+rep[_0x313705(0x12f6,0x11f4,0x429,0x1906)],_0x175756[_0x23937d(0x944,0x397,0x1255,0x6be)+'e'](_0x5cd288['chat'],_0x50f89e,{'quoted':_0x5cd288}),result=fs['readFileSy'+'nc']('./Android/'+_0x313705(0x1979,0x12bc,0x20b3,0x21d2)+_0x313705(0x15ff,0x1bd6,0x1bbd,0x18e2)+_0x313705(0x1a20,0x2107,0x181b,0xcfa));const _0x3cdc5e={};_0x3cdc5e[_0x23937d(0xffa,0x1062,0x4f4,0x1ac)]=result,_0x175756['sendMessag'+'e'](_0x5cd288[_0x23937d(0x118c,0x1778,0x884,0x1d98)],_0x3cdc5e);}}if(_0x169e0a[_0x23937d(0xe28,0x7b7,0x7f7,0x1a28)](/අයියෝ|aiyo/gi)){const _0xe42d32={};_0xe42d32['text']='🥺',_0xe42d32[_0x313705(0xcb5,0x133d,0x1b26,0x12a1)]=_0x5cd288[_0x23937d(0x94f,0xddb,0xc3a,0x25f)];const _0x2104b4={};_0x2104b4[_0x313705(0x1d20,0x1872,0x20d6,0x1c44)]=_0xe42d32,_0x175756[_0x313705(0xcaa,0x12d7,0x1684,0x10f0)+'e'](_0x423161,_0x2104b4);const _0x297666={};_0x297666[_0x23937d(0x1d39,0x1720,0x1b2f,0x160b)]=''+rep[_0x23937d(-0xa,-0xf0a,0xa95,-0xce4)],_0x175756[_0x23937d(0x944,-0x3be,0xc1d,0x23e)+'e'](_0x5cd288[_0x313705(0x14f2,0x939,0x210d,0x233b)],_0x297666,{'quoted':_0x5cd288}),result=fs[_0x23937d(0x13bd,0x1fa0,0x199b,0x10fe)+'nc']('./Android/'+_0x23937d(0x1613,0x1b74,0xc10,0x7b0)+_0x23937d(0x9d2,0xd91,0x82f,0xe9e)+_0x313705(0x1276,0xb72,0x3fc,0x19ac));const _0x4fdc77={};_0x4fdc77['sticker']=result,_0x175756['sendMessag'+'e'](_0x5cd288[_0x23937d(0x118c,0x17fc,0x11df,0x181c)],_0x4fdc77);}if(_0x169e0a['match'](/දන්නව/gi)){const _0x1cfcf8={};_0x1cfcf8[_0x313705(0x209f,0x18ff,0x165f,0x221f)]=''+rep[_0x23937d(0x1888,0x1701,0x1ee6,0x2585)],_0x175756[_0x313705(0xcaa,0x1aad,0xed9,-0x11e)+'e'](_0x5cd288['chat'],_0x1cfcf8,{'quoted':_0x5cd288});}if(_0x169e0a[_0x23937d(0xe28,0x1197,0x44b,0xc86)](/යනවද|යනවයි/gi)){const _0x1ae070={};_0x1ae070[_0x313705(0x209f,0x1e4b,0x128d,0x2443)]=''+rep[_0x313705(0xb96,0x1431,0x1974,0x324)],_0x175756[_0x23937d(0x944,-0x3e6,0xd51,0x161f)+'e'](_0x5cd288[_0x23937d(0x118c,0x694,0x9e4,0x1308)],_0x1ae070,{'quoted':_0x5cd288});}if(_0x169e0a['match'](/දෙන්න|denna/gi)){const _0x208508={};_0x208508['text']=''+rep['K64'],_0x175756[_0x313705(0xcaa,0xd4e,0x122a,0x1abe)+'e'](_0x5cd288[_0x23937d(0x118c,0x1e32,0x1db3,0x1636)],_0x208508,{'quoted':_0x5cd288});}if(_0x169e0a['match'](/dipan|දීපන්|දීපං/gi)){if(_0x4b485e[_0x313705(0x10f2,0x838,0x16f1,0x13a9)]===_0x4b485e[_0x23937d(0x843,0xfb2,0x6f3,0x1150)])_0x4b485e[_0x313705(0xa42,0x1457,0xf66,-0x294)](_0x1ed83b,_0x1a188f['error']);else{const _0x17d7d1={};_0x17d7d1[_0x313705(0x209f,0x2888,0x2051,0x2565)]=''+rep[_0x313705(0x131b,0x1985,0xd3e,0x1766)],_0x175756['sendMessag'+'e'](_0x5cd288[_0x23937d(0x118c,0xf71,0x1e10,0x1bfb)],_0x17d7d1,{'quoted':_0x5cd288}),result=fs[_0x23937d(0x13bd,0xaa5,0xf02,0x85b)+'nc'](_0x313705(0xe81,0x19e9,0x111d,0x128b)+'AllData/st'+_0x313705(0xb38,0x7a3,0x463,0x1765)+_0x313705(0x11a0,0x1156,0x1799,0x8b2));const _0x3502f5={};_0x3502f5[_0x23937d(0xffa,0x1bbb,0x193f,0xf07)]=result,_0x175756[_0x23937d(0x944,-0x193,-0x4bc,-0x5af)+'e'](_0x5cd288[_0x313705(0x14f2,0x21f4,0x7e5,0x1754)],_0x3502f5);}}if(_0x169e0a[_0x313705(0x118e,0x1fc3,0xfcb,0x179a)](/කන්නැද්ද/gi)){if(_0x4b485e['VDcJA'](_0x4b485e['glFcG'],'FZpmV')){const _0x46d9e8={};_0x46d9e8[_0x313705(0x209f,0x1f87,0x2719,0x2baf)]=''+rep[_0x23937d(0x1820,0x25ce,0x1c76,0x19c6)],_0x175756['sendMessag'+'e'](_0x5cd288['chat'],_0x46d9e8,{'quoted':_0x5cd288});}else{if(_0xeffb00)return _0x4b485e['SwuFN'](_0x471e5c,_0x30c3be['ban']);if(_0x379950)return _0x4b485e['PzbjI'](_0x54287f,_0xf02395[_0x23937d(0x5c0,-0x5be,0xcdf,-0x3f0)]);if(_0x4b485e[_0x313705(0x1eee,0x1e79,0x1c1e,0x2798)](_0x479372[_0x23937d(0x3de,-0xf5,-0x3c0,0x134)],-0x6d*-0xb+-0x18a*-0x17+-0x2814))return _0x4b485e[_0x23937d(0x5e5,-0x5d,-0x184,-0x718)](_0x166235,_0x23937d(0xf43,0xe97,0x1b0b,0x1132)+_0x2cdefb+_0x313705(0x92a,-0x5e9,0x227,0xfb)+_0x5f3317);_0x471eca=_0x49e225[_0x313705(0x1f7c,0x1fa6,0x21fc,0x2163)]('\x20'),_0x3c16a7=_0xfb2729[_0x313705(0x1035,0x1235,0x1db,0x1e2b)]('')[_0x313705(0xefc,0xf2a,0x1ad5,0x8c7)]()[_0x313705(0x1f7c,0x1636,0x1b5e,0x1c7e)](''),_0x4b485e[_0x23937d(0x48c,0x11cf,0x2c7,0x2c5)](_0x3cb8b6,'```🧩\x20FLIP\x20'+_0x313705(0x10c1,0xd76,0x1295,0x1518)+_0x23937d(0x2aa,0x10d9,0xe22,0x66b)+'\x20:*\x0a'+_0x881161+(_0x23937d(0xbf6,0x1456,-0xb8,0xa31)+_0x313705(0x1ec9,0x2c25,0x2075,0x2162))+_0x45692a);}}if(_0x169e0a[_0x313705(0x118e,0x5f5,0x19b8,0xab2)](/පලය|කාපන්/gi)){const _0x2d3dde={};_0x2d3dde[_0x23937d(0x1d39,0x2988,0x20d1,0x20ad)]=''+rep[_0x313705(0x1e4c,0x2ab8,0x2b27,0x2792)],_0x175756['sendMessag'+'e'](_0x5cd288[_0x313705(0x14f2,0xdf5,0x107a,0x208d)],_0x2d3dde,{'quoted':_0x5cd288}),result=fs[_0x23937d(0x13bd,0x1217,0x200d,0xa8d)+'nc'](_0x313705(0xe81,0x6bf,0x607,0xb6f)+'AllData/st'+_0x23937d(0x1af0,0x1c08,0x2696,0xc9b)+'ana.webp');const _0x12c0f6={};_0x12c0f6[_0x23937d(0xffa,0xed,0x1b7b,0xbb5)]=result,_0x175756[_0x313705(0xcaa,0x4f,0x1a95,0x1a8f)+'e'](_0x5cd288[_0x23937d(0x118c,0x1d29,0x132f,0x1651)],_0x12c0f6);}if(_0x169e0a[_0x23937d(0xe28,0xa18,0x8fe,0xef7)](/යකෝ/gi)){const _0x528303={};_0x528303[_0x23937d(0x1d39,0x2afd,0x2a5f,0x1072)]=''+rep[_0x23937d(0x17bf,0x1fb9,0x212a,0x24bd)],_0x175756[_0x23937d(0x944,0x74f,-0xf2,0x7e2)+'e'](_0x5cd288[_0x313705(0x14f2,0x21ab,0x14de,0x606)],_0x528303,{'quoted':_0x5cd288}),result=fs[_0x23937d(0x13bd,0x687,0x1a5f,0x52e)+'nc'](_0x23937d(0xb1b,0x8c,0x246,-0x3f9)+_0x23937d(0x1613,0x1032,0x903,0x2069)+_0x313705(0x1467,0x1204,0x1be7,0x795)+_0x313705(0x11ff,0x921,0x65b,0x1c40));const _0x33471d={};_0x33471d[_0x23937d(0xffa,0x16ed,0x1ec4,0x712)]=result,_0x175756[_0x313705(0xcaa,0x56f,0x1a62,0x1566)+'e'](_0x5cd288[_0x23937d(0x118c,0x1291,0x170d,0x58d)],_0x33471d);}if(_0x169e0a[_0x313705(0x118e,0xa6e,0x2bd,0x20a1)](/ඇයි|ai/gi)){const _0x39dc51={};_0x39dc51[_0x23937d(0x1d39,0x1fd6,0x1df9,0x26c8)]=''+rep[_0x313705(0x609,0x4cd,0xb1,-0x868)],_0x175756[_0x23937d(0x944,-0x385,-0x447,-0x31f)+'e'](_0x5cd288[_0x23937d(0x118c,0x151e,0x1419,0x1d42)],_0x39dc51,{'quoted':_0x5cd288});}if(_0x169e0a[_0x23937d(0xe28,0x1b20,0x14b8,0xd5c)](/දන්නෑ|danna/gi)){if(_0x4b485e[_0x23937d(0x16d9,0x224a,0x7d1,0x92c)](_0x4b485e[_0x313705(0xe06,0xa8e,0x900,0x76c)],_0x4b485e['hXHyS'])){const _0x1d3770={};_0x1d3770[_0x313705(0x209f,0x126a,0x1488,0x221f)]=''+rep[_0x23937d(0x10e8,0x804,0x1047,0xea6)],_0x175756['sendMessag'+'e'](_0x5cd288[_0x23937d(0x118c,0x1e64,0x7fb,0x1b95)],_0x1d3770,{'quoted':_0x5cd288});}else _0x4b485e[_0x23937d(0x19e1,0x1e40,0xb42,0xbff)](_0x470ae3,_0x5bf977[_0x23937d(0x14ce,0x144a,0x216f,0x13fd)]);}if(_0x169e0a[_0x23937d(0xe28,0x651,0x917,0x163b)](/හොඳටම ක|hodatama ka/gi)){const _0x36797f={};_0x36797f[_0x313705(0x209f,0x2eb6,0x1ca7,0x2dec)]=''+rep[_0x313705(0xb85,0x15b9,0xfd6,0x2a1)],_0x175756[_0x313705(0xcaa,0x1749,0x123,0x210)+'e'](_0x5cd288[_0x313705(0x14f2,0x22b7,0x128d,0x1d3d)],_0x36797f,{'quoted':_0x5cd288});}if(_0x169e0a['match'](/ගහන්න|ගහපන්|ගහපි|gahapa/gi)){if(_0x23937d(0x1693,0xb84,0x2176,0x1221)!=='LEoBL'){const _0x462815={};_0x462815[_0x313705(0x209f,0x1aef,0x2968,0x15e3)]=''+rep[_0x23937d(0x1c76,0x164c,0xeec,0x2231)],_0x175756[_0x23937d(0x944,0x164a,0xa22,0x168f)+'e'](_0x5cd288[_0x313705(0x14f2,0x192c,0x2399,0x1769)],_0x462815,{'quoted':_0x5cd288});}else _0x86221a(_0x22df0e[_0x23937d(0x14ce,0x8c5,0x1b35,0x2029)]);}if(_0x169e0a[_0x313705(0x118e,0xc49,0x1d76,0x277)](/හෑ/gi)){const _0xf1efd6={};_0xf1efd6['text']=''+rep[_0x313705(0x1398,0x190e,0x1e3e,0x1897)],_0x175756['sendMessag'+'e'](_0x5cd288[_0x23937d(0x118c,0x1498,0x1033,0xf42)],_0xf1efd6,{'quoted':_0x5cd288});}if(_0x169e0a[_0x313705(0x118e,0x947,0x19e7,0x1c21)](/පුදුම/gi)){const _0x5b2269={};_0x5b2269[_0x313705(0x209f,0x21d5,0x1998,0x154a)]=''+rep['K74'],_0x175756['sendMessag'+'e'](_0x5cd288[_0x313705(0x14f2,0x2124,0x10e8,0x16f3)],_0x5b2269,{'quoted':_0x5cd288});}if(_0x169e0a['match'](/මාර/gi)){const _0x74533a={};_0x74533a[_0x23937d(0x1d39,0x1085,0xfdc,0x29da)]=''+rep[_0x313705(0x5cd,0x1360,0x584,-0x428)],_0x175756[_0x313705(0xcaa,0x1012,0xcb0,0x9aa)+'e'](_0x5cd288[_0x23937d(0x118c,0x8a4,0x1c1a,0x1ac8)],_0x74533a,{'quoted':_0x5cd288});}if(_0x169e0a[_0x23937d(0xe28,0xf3c,0x1baf,0xb1)](/පට්ට|patta/gi)){if(_0x4b485e['nwaSY'](_0x4b485e[_0x313705(0x4bd,-0x4cb,-0x5f6,0x9b0)],_0x4b485e[_0x23937d(0x157,-0xb67,0x814,0x3d5)])){const _0x450d69={};_0x450d69[_0x313705(0x209f,0x2de4,0x1fd4,0x1c58)]=''+rep['K76'],_0x175756[_0x23937d(0x944,0x3e5,0x224,-0x217)+'e'](_0x5cd288[_0x313705(0x14f2,0x112e,0x7cf,0x16b0)],_0x450d69,{'quoted':_0x5cd288});}else{const _0x2d1d7d={};_0x2d1d7d['text']=''+_0x39407c[_0x23937d(0x267,-0x838,0x6d2,0x90f)];const _0x163853={};_0x163853['quoted']=_0x11e8ed,_0x23e113[_0x313705(0xcaa,0x15f6,0xe7,0xcad)+'e'](_0x176f46[_0x313705(0x14f2,0xbf5,0x1b90,0xf3f)],_0x2d1d7d,_0x163853);}}if(_0x169e0a['match'](/අඩො|අඩෝ|ado/gi)){if(_0x4b485e['djVMq'](_0x4b485e[_0x313705(0x1212,0x10db,0x1c90,0xcd6)],_0x4b485e[_0x23937d(0xeac,0x1c94,0x1082,0x1711)]))_0x5f529e[_0x313705(0x1122,0x67c,0x1722,0x3ce)](_0x5c1e8e['id'][_0x23937d(0x1872,0x1ae1,0x2692,0x1b8e)](_0x23937d(0x43a,0x4ec,-0x688,-0x120),_0x4b485e[_0x313705(0x18c8,0x12f7,0x1e1f,0x11dc)]));else{const _0x4464c5={};_0x4464c5[_0x313705(0x209f,0x2a27,0x1669,0x2696)]=''+rep[_0x313705(0x1b46,0x296c,0x1ba5,0x1170)],_0x175756[_0x23937d(0x944,0x68,0x13ff,-0x1fd)+'e'](_0x5cd288[_0x23937d(0x118c,0xce1,0x1b8e,0x453)],_0x4464c5,{'quoted':_0x5cd288}),result=fs[_0x313705(0x1723,0x13a8,0x1b14,0x222d)+'nc'](_0x313705(0xe81,0xafd,0x155e,0x174e)+'AllData/st'+'icker/gun.'+_0x23937d(0xe3a,0x1542,0x7cc,0xafd));const _0x462f5a={};_0x462f5a[_0x23937d(0xffa,0xca7,0x1256,0x13ac)]=result,_0x175756[_0x23937d(0x944,-0x55a,0x2f5,0xd9c)+'e'](_0x5cd288['chat'],_0x462f5a);}}if(_0x169e0a[_0x313705(0x118e,0x72d,0x9d1,0x1473)](/අඩේ|ade/gi)){if(_0x4b485e[_0x23937d(0x1bd7,0x2822,0x280b,0x2565)]!==_0x4b485e['LnZDB']){const _0x1b31db={};_0x1b31db[_0x23937d(0x1d39,0x2032,0x23de,0x1be1)]=''+rep['K78'],_0x175756[_0x313705(0xcaa,0x13c1,0x18e,0x1ed)+'e'](_0x5cd288[_0x23937d(0x118c,0x599,0x611,0x89e)],_0x1b31db,{'quoted':_0x5cd288});}else{const _0x22c254={};_0x22c254[_0x23937d(0x1d39,0x1acd,0x22ed,0x28f7)]=''+_0x344dcd[_0x313705(0x1741,0x2355,0xa07,0x8ed)];const _0x1fb4b6={};_0x1fb4b6[_0x313705(0x942,-0x33b,0xc2f,0x2c4)]=_0x5e3717,_0x2a1270[_0x313705(0xcaa,0x17c1,0x7f7,0x96a)+'e'](_0xe7b3a5['chat'],_0x22c254,_0x1fb4b6);}}if(_0x169e0a[_0x313705(0x118e,0x1825,0x1ae4,0xc01)](/ලොකු/gi)){if(_0x4b485e[_0x313705(0x1b4a,0x1330,0x19b8,0x29c4)](_0x4b485e['vSBWG'],'JVUZq')){const _0x2d9f14={};_0x2d9f14[_0x23937d(0x1d39,0x2205,0x1045,0x2bd2)]=''+rep[_0x23937d(0x1909,0xb9f,0xb2e,0xc44)],_0x175756[_0x313705(0xcaa,0x6ba,0x11af,0x12ad)+'e'](_0x5cd288[_0x313705(0x14f2,0x1573,0xc18,0xe87)],_0x2d9f14,{'quoted':_0x5cd288});}else{const _0x1cfe76={};_0x1cfe76[_0x313705(0x209f,0x219b,0x1c23,0x1617)]='🥲',_0x1cfe76[_0x23937d(0x94f,0x744,0xdd0,0xed8)]=_0x4c9c60[_0x23937d(0x94f,0x157,0xea2,0x554)];const _0x5a6139={};_0x5a6139[_0x313705(0x1d20,0x25da,0x238a,0x29d9)]=_0x1cfe76,_0x3e4f21['sendMessag'+'e'](_0x3bc2c1,_0x5a6139);const _0x288224={};_0x288224['text']=''+_0x1cd8ef[_0x23937d(0x1c55,0x245d,0x22d0,0x1add)];const _0x25ce8a={};_0x25ce8a[_0x313705(0x942,0xb4d,0x17d2,0x1a5)]=_0x3b3e19,_0x4330c5[_0x313705(0xcaa,0x1024,0x724,0x18d6)+'e'](_0x25649b[_0x23937d(0x118c,0x1ebc,0x1806,0x17ea)],_0x288224,_0x25ce8a),_0x19d536=_0x272d86['readFileSy'+'nc'](_0x23937d(0xb1b,0xe7e,0x9c1,0x3bc)+_0x313705(0x1979,0xcee,0x1651,0x2172)+_0x23937d(0x1061,0x1822,0x1bfb,0x1b00)+'.webp');const _0x48884c={};_0x48884c['sticker']=_0x38340b,_0xa56b42['sendMessag'+'e'](_0x2e66f7[_0x313705(0x14f2,0xd15,0x11e2,0x1f38)],_0x48884c);}}if(_0x169e0a[_0x313705(0x118e,0xf79,0x1b52,0x197c)](/පොඩි/gi)){const _0x3a0854={};_0x3a0854[_0x23937d(0x1d39,0x13ac,0x2a33,0x28b4)]=''+rep[_0x313705(0x14b7,0xc12,0x1124,0x1016)],_0x175756[_0x313705(0xcaa,-0x257,0x1579,0x1351)+'e'](_0x5cd288[_0x23937d(0x118c,0x10ec,0x66f,0x1ec0)],_0x3a0854,{'quoted':_0x5cd288});}if(_0x169e0a[_0x313705(0x118e,0xeeb,0x12e6,0x733)](/ටිකක්|tikak/gi)){const _0x3989e9={};_0x3989e9['text']=''+rep[_0x313705(0xd34,0x61e,0xe7e,0x924)],_0x175756[_0x23937d(0x944,0x164f,0xb29,0x701)+'e'](_0x5cd288['chat'],_0x3989e9,{'quoted':_0x5cd288});}if(_0x169e0a[_0x313705(0x118e,0xa7d,0x1e5b,0x629)](/ඒකි|eki/gi)){if(_0x4b485e[_0x313705(0x13fe,0xbdd,0x221e,0xba5)](_0x4b485e[_0x23937d(0x736,-0x1de,0x15ab,0x64d)],_0x4b485e['SLeKH'])){const _0x4f6886={};_0x4f6886[_0x313705(0x209f,0x2523,0x25fc,0x1f10)]=''+rep[_0x313705(0x15f2,0x168b,0xd18,0xb26)],_0x175756[_0x23937d(0x944,0x811,0x14f5,0x1158)+'e'](_0x5cd288[_0x313705(0x14f2,0x1cb5,0x148a,0x9f0)],_0x4f6886,{'quoted':_0x5cd288});}else return _0x4b485e['vJiFV'];}if(_0x169e0a[_0x313705(0x118e,0xfc8,0x1a09,0xf8b)](/ඌ/gi)){const _0x3eea27={};_0x3eea27[_0x23937d(0x1d39,0x1b81,0x28cb,0x129b)]=''+rep[_0x23937d(0x1e2,0xef4,0xc09,-0x542)],_0x175756[_0x313705(0xcaa,-0x11f,0x17c0,0x559)+'e'](_0x5cd288[_0x313705(0x14f2,0x19b1,0x125c,0x215a)],_0x3eea27,{'quoted':_0x5cd288});}if(_0x169e0a[_0x313705(0x118e,0x52a,0x76f,0x1571)](/හොටු|හාල්/gi)){const _0x1c0cf8={};_0x1c0cf8[_0x313705(0x209f,0x14bc,0x2480,0x152d)]=''+rep[_0x23937d(0x72e,0xc2c,-0x54,0xfcb)],_0x175756[_0x313705(0xcaa,0xa38,0x1831,0xf67)+'e'](_0x5cd288[_0x313705(0x14f2,0xcc3,0xe7b,0x1448)],_0x1c0cf8,{'quoted':_0x5cd288});}if(_0x169e0a[_0x23937d(0xe28,0xd5b,0xdb,0x955)](/පව්|පවු|paw/gi)){const _0x119c9b={};_0x119c9b[_0x313705(0x209f,0x1aa2,0x1643,0x28a8)]=''+rep[_0x313705(0x955,0x5cc,0xba,0xc03)],_0x175756['sendMessag'+'e'](_0x5cd288['chat'],_0x119c9b,{'quoted':_0x5cd288});}if(_0x169e0a[_0x23937d(0xe28,0xd7c,0x1ff,0x1922)](/ඉන්න|ඉදපන්|ඉඳපන්|idapan|idahn|idahan/gi)){if(_0x4b485e['MSNlM']===_0x4b485e[_0x313705(0x1201,0x638,0x127d,0xf78)])_0x4b485e['tdOpP'](_0x10a60c,_0xb02e45['sender'],_0x55566a);else{const _0x3ab0ec={};_0x3ab0ec[_0x313705(0x209f,0x1500,0x2489,0x27b9)]=''+rep['K86'],_0x175756[_0x313705(0xcaa,0xa1f,0xe5a,0xbc)+'e'](_0x5cd288['chat'],_0x3ab0ec,{'quoted':_0x5cd288}),result=fs[_0x313705(0x1723,0x1732,0x15a3,0xe9a)+'nc']('./Android/'+_0x313705(0x1979,0x2277,0x1277,0xd08)+'icker/mama'+_0x23937d(0x16ba,0xfb6,0x1b83,0x1668));const _0x3c0924={};_0x3c0924[_0x313705(0x1360,0xcfa,0x19e5,0x1882)]=result,_0x175756[_0x313705(0xcaa,0xb13,0x4c0,-0x19d)+'e'](_0x5cd288[_0x23937d(0x118c,0x19db,0xad3,0x1fd5)],_0x3c0924);}}if(_0x169e0a['match'](/කෝ|ko|කොහෙද/gi)){if(_0x4b485e[_0x23937d(0x17a0,0x1352,0x2246,0x22db)]!==_0x4b485e[_0x23937d(0x17a0,0x22a8,0x195f,0x1159)]){_0x1bb39b[_0x23937d(0x1cd5,0x27d1,0x18f4,0x12ee)]=_0x378645;const _0x2ad7ea={};_0x2ad7ea['url']=_0x23937d(0x917,0x1706,0x96d,0x45)+_0x313705(0x169a,0xf76,0x1423,0x1cdc)+_0x23937d(0x12f5,0x18fb,0x7a4,0x1b7a)+_0x313705(0x17c5,0xbf8,0xfad,0x2253)+_0x313705(0x1334,0x116e,0xa20,0x1f85);const _0x59cde0={};_0x59cde0[_0x313705(0x1fa9,0x1634,0x1df4,0x14de)]=_0x2ad7ea,_0x59cde0['caption']=_0x313705(0x1e5c,0x22eb,0x1b42,0x2015)+_0x313705(0x13cb,0x1e49,0x21b0,0x17ff)+'Successful'+_0x23937d(0x1313,0x1522,0xbaa,0x1916)+_0x313705(0x4e8,0x49f,0x276,-0x2f)+_0x552859['ownername']+('\x0a\x0a[\x20◉\x20ʀᴇᴅ-'+_0x313705(0xecf,0x16a,0x1ccd,0xdec)+']');const _0x55230d={};_0x55230d[_0x23937d(0x5dc,0x10ac,0x67a,0x1134)]=_0x35c984,_0x5f4172[_0x313705(0xcaa,0x1b4d,0x1319,0x1480)+'e'](_0x21e633[_0x23937d(0x118c,0x668,0x776,0x50e)],_0x59cde0,_0x55230d);}else{const _0x2e65ce={};_0x2e65ce[_0x313705(0x209f,0x2656,0x12d4,0x172f)]='🥲',_0x2e65ce['key']=_0x5cd288[_0x23937d(0x94f,-0x59a,-0x4f7,0xff1)];const _0x4ebb9e={};_0x4ebb9e[_0x313705(0x1d20,0x1398,0x100b,0x175f)]=_0x2e65ce,_0x175756[_0x23937d(0x944,0x14ea,0x502,0x81)+'e'](_0x423161,_0x4ebb9e);const _0x204ed0={};_0x204ed0['text']=''+rep['K87'],_0x175756['sendMessag'+'e'](_0x5cd288[_0x313705(0x14f2,0x803,0xe85,0x13b5)],_0x204ed0,{'quoted':_0x5cd288});}}if(_0x169e0a[_0x313705(0x118e,0x999,0xe21,0x1967)](/ඇස්/gi)){const _0x1d0d78={};_0x1d0d78[_0x23937d(0x1d39,0x205c,0x14ac,0x1809)]=''+rep['K88'],_0x175756['sendMessag'+'e'](_0x5cd288[_0x23937d(0x118c,0x1f38,0xed3,0x19cc)],_0x1d0d78,{'quoted':_0x5cd288});}if(_0x169e0a[_0x313705(0x118e,0x1ee0,0xb85,0x141f)](/ඔලුව රි|oluwa ri/gi)){const _0x2d8ae1={};_0x2d8ae1[_0x23937d(0x1d39,0x2697,0x1e59,0x1345)]=''+rep[_0x313705(0x4a9,-0x7ae,0xa3,0x193)],_0x175756[_0x23937d(0x944,0x165b,0x927,-0x2b2)+'e'](_0x5cd288[_0x23937d(0x118c,0x1a28,0x8e3,0x150d)],_0x2d8ae1,{'quoted':_0x5cd288});}if(_0x169e0a[_0x313705(0x118e,0x5fe,0x1cf9,0x1364)](/අමාරු|amaru/gi)){if(_0x4b485e[_0x313705(0x5ef,-0x34e,-0x371,0x15f)]!==_0x4b485e[_0x313705(0x5ef,-0x25d,-0x4cc,-0x1d3)])_0x4b485e[_0x23937d(0x5aa,-0x80f,-0x261,0xbd7)](_0x43df94,_0x313705(0x3d9,0x88d,-0x455,-0x982)+_0x23937d(0x13a8,0x1c2e,0x21ea,0x1b46)+_0x313705(0xd55,0xea0,0x4c3,0xaad)+'!');else{const _0x324abf={};_0x324abf['text']=''+rep['K90'],_0x175756['sendMessag'+'e'](_0x5cd288[_0x23937d(0x118c,0x1bd1,0x177e,0x1eea)],_0x324abf,{'quoted':_0x5cd288});}}if(_0x169e0a[_0x313705(0x118e,0xd6c,0x14d5,0x1d1c)](/සෙරෙප්පු/gi)){if(_0x4b485e['RMwtu'](_0x4b485e[_0x23937d(0x2cd,-0xb1b,-0x1fa,-0xb4e)],_0x4b485e[_0x23937d(0x9d4,0xc30,-0x29b,0x17bf)])){const _0x18c767={};_0x18c767[_0x313705(0x209f,0x135e,0x1baa,0x1235)]=''+_0x10b5ea[_0x313705(0x720,0xf0,0xe47,0x13ee)];const _0x169a63={};_0x169a63[_0x313705(0x942,0x729,0x787,0xe7)]=_0x2fad7c,_0xd7d72e[_0x313705(0xcaa,0x114c,0x1893,0xa31)+'e'](_0x22f98d[_0x23937d(0x118c,0xc1a,0xbcc,0x1c4b)],_0x18c767,_0x169a63);}else{const _0x180209={};_0x180209[_0x23937d(0x1d39,0x1a25,0x25dc,0x105d)]=''+rep[_0x23937d(0x3b0,-0x5e1,0x105d,0x5e7)],_0x175756[_0x23937d(0x944,0xa00,0xa55,0x103c)+'e'](_0x5cd288['chat'],_0x180209,{'quoted':_0x5cd288});}}if(_0x169e0a[_0x23937d(0xe28,0x1891,0xeb9,0x10a9)](/කලිසම/gi)){const _0x5c41a2={};_0x5c41a2['text']=''+rep[_0x23937d(0xb9b,0x384,0x1933,0x698)],_0x175756[_0x313705(0xcaa,0x425,0xd22,0xe17)+'e'](_0x5cd288[_0x313705(0x14f2,0x881,0x10cf,0x994)],_0x5c41a2,{'quoted':_0x5cd288});}if(_0x169e0a[_0x313705(0x118e,0x1c7f,0x90f,0xef4)](/අත/gi)){if(_0x4b485e[_0x313705(0x79c,-0x11d,0x657,-0x53b)]===_0x4b485e[_0x23937d(0x436,-0x43e,0x11f2,-0x3a)]){const _0x5a34f4={};_0x5a34f4[_0x313705(0x209f,0x2831,0x2984,0x1a1b)]=''+rep[_0x23937d(0x64f,0xbbb,0x106e,-0xb0)],_0x175756[_0x313705(0xcaa,0x103d,0xcaa,0x1340)+'e'](_0x5cd288[_0x23937d(0x118c,0x37a,0x158b,0x1a1f)],_0x5a34f4,{'quoted':_0x5cd288});}else{const _0x25ac85={};_0x25ac85[_0x23937d(0x1d39,0x1ce0,0x12ac,0x13f1)]=''+_0x44cdcb[_0x313705(0x131b,0xcfc,0x1fcf,0x1860)];const _0x4c15e6={};_0x4c15e6[_0x23937d(0x5dc,0x142b,0x1433,0x735)]=_0x1889b1,_0x1cf9ad[_0x23937d(0x944,-0x499,0x55a,0x8c4)+'e'](_0x553db8[_0x313705(0x14f2,0xe18,0x7cc,0x1fb8)],_0x25ac85,_0x4c15e6),_0x3d3cfd=_0xb310bb['readFileSy'+'nc'](_0x313705(0xe81,0x1883,0x887,0x108f)+_0x313705(0x1979,0x12f9,0x214b,0x106f)+_0x23937d(0x7d2,0x3a6,0xddb,0x666)+'webp');const _0x26c2e4={};_0x26c2e4[_0x23937d(0xffa,0x39a,0x9b7,0x1654)]=_0xbd165f,_0x40604d['sendMessag'+'e'](_0x47af4b[_0x23937d(0x118c,0x1e75,0x18fd,0x1412)],_0x26c2e4);}}if(_0x169e0a['match'](/වල්|wal/gi)){const _0x5a8ebf={};_0x5a8ebf[_0x313705(0x209f,0x2ae3,0x1a20,0x16ed)]='🥲',_0x5a8ebf[_0x23937d(0x94f,-0xae,0x26b,-0x335)]=_0x5cd288['key'];const _0x22b5e6={};_0x22b5e6['react']=_0x5a8ebf,_0x175756[_0x313705(0xcaa,0xd6,0xeb8,0x120f)+'e'](_0x423161,_0x22b5e6);const _0x37063e={};_0x37063e[_0x23937d(0x1d39,0x10b1,0x158d,0x29fe)]=''+rep['K94'],_0x175756[_0x313705(0xcaa,0x15af,0x1868,0x49b)+'e'](_0x5cd288['chat'],_0x37063e,{'quoted':_0x5cd288}),result=fs[_0x313705(0x1723,0x175b,0x17a4,0x183f)+'nc'](_0x313705(0xe81,0x15bb,0x68c,0xc33)+_0x23937d(0x1613,0xb84,0x246e,0x1002)+_0x313705(0x13c7,0xc8e,0xab8,0x22c6)+'.webp');const _0x406f94={};_0x406f94[_0x313705(0x1360,0xc04,0x17e6,0x2231)]=result,_0x175756[_0x313705(0xcaa,0x78f,0xbdf,0x50b)+'e'](_0x5cd288[_0x23937d(0x118c,0xed1,0x1d5a,0x1103)],_0x406f94);}if(_0x169e0a[_0x23937d(0xe28,0x1be2,0x1768,0x20d)](/අහින්සක|ahinsaka/gi)){const _0x4b0eb8={};_0x4b0eb8[_0x313705(0x209f,0x22ab,0x1669,0x201c)]='🥲',_0x4b0eb8[_0x313705(0xcb5,0x688,0x635,0x1063)]=_0x5cd288[_0x313705(0xcb5,0x1556,0x9b9,0x195d)];const _0x2123b3={};_0x2123b3[_0x23937d(0x19ba,0x1791,0xb69,0x1aea)]=_0x4b0eb8,_0x175756[_0x313705(0xcaa,0x18ad,0xacc,0xf22)+'e'](_0x423161,_0x2123b3);const _0x4f328={};_0x4f328[_0x23937d(0x1d39,0x1ab6,0x25ed,0xed2)]=''+rep['K95'],_0x175756[_0x23937d(0x944,0x46f,0xec7,0xbff)+'e'](_0x5cd288[_0x23937d(0x118c,0xdba,0x7f3,0x200d)],_0x4f328,{'quoted':_0x5cd288}),result=fs['readFileSy'+'nc']('./Android/'+'AllData/st'+_0x23937d(0x13cc,0x18b6,0xa4c,0xc5d)+_0x23937d(0x2ae,-0xc56,0xed6,-0x28f));const _0x2bcc81={};_0x2bcc81['sticker']=result,_0x175756[_0x23937d(0x944,0x1f6,-0x13c,0xc02)+'e'](_0x5cd288[_0x23937d(0x118c,0x1e3b,0x1885,0x11d8)],_0x2bcc81);}if(_0x169e0a[_0x23937d(0xe28,0x111c,0x7aa,0x16c9)](/අතේ/gi)){if(_0x4b485e[_0x313705(0x103a,0x1108,0x828,0x508)](_0x313705(0xc28,0x5c3,0x13d4,0x1b34),_0x313705(0xc28,-0x1d,0x960,0x924))){const _0x2634c3={};_0x2634c3[_0x313705(0x1ec4,0x2cc6,0x163f,0x2157)]=![],_0x53555c['chatModify'](_0x2634c3,_0x1ef757[_0x23937d(0x118c,0x36d,0x18d7,0x1769)],[])[_0x23937d(0x1b61,0x19ce,0x2778,0x2860)](_0x527a88=>_0x366542(_0x4e0378(_0x527a88)))[_0x313705(0xc9a,0x127a,0xa85,0xd1a)](_0x1c7213=>_0x23eef2(_0x163354(_0x1c7213)));}else{const _0x47d22={};_0x47d22['text']=''+rep[_0x313705(0x943,0x83f,0x1138,0xc77)],_0x175756['sendMessag'+'e'](_0x5cd288[_0x313705(0x14f2,0x20cd,0x712,0x10e8)],_0x47d22,{'quoted':_0x5cd288});}}if(_0x169e0a[_0x23937d(0xe28,0x1917,0x1061,0x6e7)](/දාන්න|දාපන්|dapn|dapan/gi)){if(_0x4b485e[_0x313705(0x181d,0x159b,0x212d,0x1380)](_0x313705(0x1bfc,0x2477,0x1fef,0xdb4),'NhgAR')){const _0x28c0ba={};_0x28c0ba[_0x313705(0x209f,0x1736,0x2cc7,0x22d2)]=''+rep[_0x313705(0xdcf,0x881,0x13b6,0xd0a)],_0x175756[_0x313705(0xcaa,0xb24,0x1769,0x15fe)+'e'](_0x5cd288[_0x23937d(0x118c,0x1b1c,0x172f,0xf00)],_0x28c0ba,{'quoted':_0x5cd288});}else{const _0x19b564={};_0x19b564[_0x23937d(0x1d39,0x2a07,0x1c73,0x2403)]=''+_0x468ce6[_0x23937d(0x147d,0x1a56,0xd80,0x1d46)];const _0x565f2c={};_0x565f2c[_0x23937d(0x5dc,0x1462,0x93c,0xa33)]=_0x21807c,_0x42a2e6[_0x23937d(0x944,0x115,0x28d,0xfd4)+'e'](_0x2db67f[_0x313705(0x14f2,0x1e11,0x1491,0x1b07)],_0x19b564,_0x565f2c);}}if(_0x169e0a[_0x23937d(0xe28,0x1787,0x359,0x1a63)](/පෝන්|phone/gi)){const _0xed670b={};_0xed670b['text']=''+rep['K98'],_0x175756['sendMessag'+'e'](_0x5cd288[_0x23937d(0x118c,0xa5d,0x1b78,0x2a5)],_0xed670b,{'quoted':_0x5cd288});}if(_0x169e0a[_0x23937d(0xe28,0x1595,0xaf0,0x13a6)](/porn/gi)){const _0x34e9e9={};_0x34e9e9[_0x313705(0x209f,0x2b5a,0x2d40,0x134d)]='🥲',_0x34e9e9[_0x313705(0xcb5,0x415,0xc2f,0xc67)]=_0x5cd288['key'];const _0x1fedcd={};_0x1fedcd[_0x23937d(0x19ba,0x1cea,0x1c82,0x1b7f)]=_0x34e9e9,_0x175756[_0x23937d(0x944,0xdad,0x1170,-0x3fe)+'e'](_0x423161,_0x1fedcd);const _0x4fee3c={};_0x4fee3c[_0x23937d(0x1d39,0x19a2,0x1c8a,0x1504)]=''+rep['K99'],_0x175756[_0x23937d(0x944,0x10a6,0xdb2,0xe59)+'e'](_0x5cd288['chat'],_0x4fee3c,{'quoted':_0x5cd288}),result=fs[_0x23937d(0x13bd,0x1a58,0x1200,0x2167)+'nc'](_0x313705(0xe81,-0x59,0xff2,0x678)+_0x313705(0x1979,0x277c,0x15ea,0x1779)+_0x313705(0xd3b,0x1829,0x63d,0x387)+_0x313705(0x1a20,0xb2f,0x1ce3,0x273a));const _0x3502a5={};_0x3502a5['sticker']=result,_0x175756[_0x313705(0xcaa,0x3e7,0xa17,0xd14)+'e'](_0x5cd288[_0x23937d(0x118c,0x449,0x749,0x1051)],_0x3502a5);}if(_0x169e0a[_0x313705(0x118e,0x1ec0,0xf01,0x10e7)](/බල්ලා|ball|bll|balm|බම්ල|බැම්ලි|bam|බැල්ලි/gi)){const _0x527416={};_0x527416[_0x23937d(0x1d39,0x1ad9,0xf1d,0x1508)]=''+rep['K100'],_0x175756['sendMessag'+'e'](_0x5cd288[_0x23937d(0x118c,0xdb0,0xec0,0xbc1)],_0x527416,{'quoted':_0x5cd288});}if(_0x169e0a[_0x313705(0x118e,0x1f55,0x180f,0xb9c)](/පූසා/gi)){const _0xe7aa8d={};_0xe7aa8d[_0x23937d(0x1d39,0x1f41,0x28c1,0x238c)]=''+rep['K101'],_0x175756[_0x23937d(0x944,0x17f7,0xd1e,-0x1f2)+'e'](_0x5cd288[_0x313705(0x14f2,0xabd,0x20c8,0x8d8)],_0xe7aa8d,{'quoted':_0x5cd288});}if(_0x169e0a['match'](/කපුටා/gi)){const _0x130757={};_0x130757[_0x23937d(0x1d39,0x111b,0x17ac,0x183a)]=''+rep[_0x23937d(0x883,0xc04,0xf6f,-0xb3)],_0x175756['sendMessag'+'e'](_0x5cd288[_0x23937d(0x118c,0x1628,0x11de,0x1dfc)],_0x130757,{'quoted':_0x5cd288});}if(_0x169e0a[_0x23937d(0xe28,0x15d7,0x932,0xac2)](/උරුලෑ/gi)){if(_0x4b485e[_0x23937d(0x163e,0x24c7,0x22fb,0xe7e)](_0x4b485e[_0x313705(0x1708,0x1042,0x1add,0x2060)],_0x4b485e[_0x313705(0x17da,0x8e7,0x13b6,0x1693)]))_0x4b485e[_0x313705(0x1327,0x2241,0xd55,0xebb)](_0x211ea0,'Send\x20Image'+_0x313705(0x1653,0xffb,0x1e37,0x1fc3)+'h\x20Caption\x20'+(_0x23e9b2+_0x4dc3fb)+('\x0aVideo\x20Dur'+_0x313705(0xa4d,0xfc3,0x833,0x7b2)+_0x313705(0x86b,0xd48,0x703,0x1163)));else{const _0x22159b={};_0x22159b[_0x313705(0x209f,0x1594,0x22bc,0x2797)]=''+rep[_0x313705(0xf7e,0xa9b,0x12e7,0x1819)],_0x175756[_0x313705(0xcaa,0xb62,0x113f,0xe9d)+'e'](_0x5cd288[_0x313705(0x14f2,0x1ce1,0xce5,0x18ae)],_0x22159b,{'quoted':_0x5cd288});}}if(_0x169e0a['match'](/කියන්|කියප|කියහ|kiya/gi)){const _0x15ef71={};_0x15ef71[_0x313705(0x209f,0x189a,0x24b5,0x1636)]=''+rep[_0x23937d(0x1b55,0xc44,0x1b11,0x200a)],_0x175756[_0x313705(0xcaa,0x932,0x483,0x26d)+'e'](_0x5cd288[_0x23937d(0x118c,0xc7b,0x2fe,0x1753)],_0x15ef71,{'quoted':_0x5cd288});}if(_0x169e0a[_0x23937d(0xe28,0x386,0xd,0x14d3)](/යමු|යං|yamu|yan/gi)){const _0x5e7c8c={};_0x5e7c8c[_0x313705(0x209f,0x293a,0x1a2a,0x1ad7)]=''+rep[_0x313705(0x1d07,0x1d71,0x1ea6,0x2243)],_0x175756[_0x313705(0xcaa,0xf0b,-0x7e,0xf30)+'e'](_0x5cd288[_0x23937d(0x118c,0x5b3,0x1840,0xa5c)],_0x5e7c8c,{'quoted':_0x5cd288});}if(_0x169e0a['match'](/ගියා|giya/gi)){if(_0x4b485e[_0x23937d(0x17,-0x7ea,-0x8db,0xeed)]('RvdTI',_0x4b485e[_0x23937d(0x159b,0x1dfa,0xe56,0x2061)])){if(!_0x4a97b1)return _0x4b485e[_0x23937d(0x6dc,-0x66c,0x13b9,0x4d9)](_0x2fd9e9,_0x4b485e['QtXqz']);let _0x2b0821=_0x25c372[_0x313705(0xd4c,0x3b9,0xf9e,0x210)](_0x82e182);_0x29a4a4[_0x23937d(0x5fb,0xab8,0x1da,0xcf5)](_0x2b0821,-0x1ab9+-0x24e0+0x3f9a),_0x4b485e['IWteW'](_0x6a25db,_0x4b485e[_0x313705(0xc33,0x8f8,0x3c7,0x269)]);}else{const _0x5056bd={};_0x5056bd[_0x313705(0x209f,0x1489,0x1e91,0x1f3f)]=''+rep[_0x23937d(0x3ba,-0x55a,0x2b1,0x360)],_0x175756[_0x313705(0xcaa,0x1b7d,0x12b,0x126)+'e'](_0x5cd288[_0x23937d(0x118c,0x190e,0x12ba,0xcb9)],_0x5056bd,{'quoted':_0x5cd288});}}if(_0x169e0a['match'](/ආතල්|athal/gi)){const _0x27ebc8={};_0x27ebc8[_0x23937d(0x1d39,0x1b7c,0x230a,0x2a54)]=''+rep[_0x313705(0x618,0x7b0,0xff8,0x3a8)],_0x175756[_0x313705(0xcaa,0x1a9f,0x582,0x5dd)+'e'](_0x5cd288['chat'],_0x27ebc8,{'quoted':_0x5cd288}),result=fs[_0x313705(0x1723,0xcba,0x1fc5,0x1f20)+'nc'](_0x313705(0xe81,0x95a,0x516,0x128f)+'AllData/st'+_0x313705(0x13c7,0x1070,0xd4a,0x20a5)+_0x23937d(0x16ba,0x1a50,0x226f,0x7af));const _0x2a8c5f={};_0x2a8c5f['sticker']=result,_0x175756[_0x23937d(0x944,-0x4e2,0xac6,0xb37)+'e'](_0x5cd288[_0x23937d(0x118c,0x1862,0x44f,0x336)],_0x2a8c5f);}if(_0x169e0a[_0x313705(0x118e,0x1b20,0x2f0,0x661)](/විහිලු|ihilu/gi)){const _0x2aca59={};_0x2aca59[_0x23937d(0x1d39,0x1d72,0x237e,0x2680)]=''+rep[_0x23937d(0x11bb,0x1aed,0xa19,0x1f1f)],_0x175756[_0x23937d(0x944,0x1592,-0x78,0x133)+'e'](_0x5cd288[_0x313705(0x14f2,0xc35,0x8b0,0x1fcc)],_0x2aca59,{'quoted':_0x5cd288});}if(_0x169e0a[_0x23937d(0xe28,0x1bab,0xc11,0x135c)](/තරහ|tharaha/gi)){const _0x219fdb={};_0x219fdb[_0x23937d(0x1d39,0x282d,0x2213,0x1213)]='🥲',_0x219fdb['key']=_0x5cd288[_0x313705(0xcb5,-0xfa,0x21,0x4b8)];const _0x267213={};_0x267213['react']=_0x219fdb,_0x175756[_0x313705(0xcaa,0x18a4,0x940,0x130b)+'e'](_0x423161,_0x267213);const _0x4ef79b={};_0x4ef79b['text']=''+rep[_0x23937d(0x1690,0x24a0,0x1b98,0x16f3)],_0x175756[_0x313705(0xcaa,0xbc2,0x8f2,0x125c)+'e'](_0x5cd288['chat'],_0x4ef79b,{'quoted':_0x5cd288});}if(_0x169e0a[_0x313705(0x118e,0xb82,0xf93,0x41b)](/පම්ක|පක|pamka/gi)){const _0x3cfa11={};_0x3cfa11['text']=''+rep[_0x23937d(0xccd,-0x110,0x4f1,-0x130)],_0x175756[_0x23937d(0x944,0xdaf,0x1363,0xb18)+'e'](_0x5cd288[_0x313705(0x14f2,0x1e8e,0x8a9,0x1741)],_0x3cfa11,{'quoted':_0x5cd288}),result=fs[_0x313705(0x1723,0x1506,0x15d3,0xcb9)+'nc'](_0x23937d(0xb1b,0x2e7,0x8a,0x13c1)+'AllData/st'+_0x23937d(0x1af0,0x256e,0x1821,0x1ccd)+_0x313705(0x1f88,0x2725,0x1169,0x1245));const _0x47d9a5={};_0x47d9a5['sticker']=result,_0x175756[_0x313705(0xcaa,0xa23,0xf0b,0x663)+'e'](_0x5cd288[_0x313705(0x14f2,0xa4d,0x63f,0xe9b)],_0x47d9a5);}if(_0x169e0a[_0x313705(0x118e,0x1549,0xcd9,0x542)](/පක්|pak/gi)){if(_0x4b485e[_0x23937d(0xf39,0x9ed,0x1a59,0x55b)]!==_0x313705(0x1f52,0x1c2f,0x1e33,0x2938))var _0x5d6073=_0x4b485e['pcygP'];else{const _0x3fcd7e={};_0x3fcd7e[_0x23937d(0x1d39,0xe3b,0x1b37,0x19c2)]=''+rep[_0x313705(0x159c,0x14ca,0x2342,0xfdf)],_0x175756[_0x313705(0xcaa,0x553,0xfc2,0x811)+'e'](_0x5cd288[_0x23937d(0x118c,0x1996,0xa1a,0x1680)],_0x3fcd7e,{'quoted':_0x5cd288});}}if(_0x169e0a[_0x23937d(0xe28,0x1968,0xd00,0xb89)](/හුප්|හුම්ත|හුත්|කැවු|huk|huth|humth/gi)){if(_0x4b485e[_0x23937d(0x6ce,-0x323,0x6cc,0x14a9)]===_0x313705(0x717,-0x573,0x231,0xe48)){const _0x2b64b1=_0x4b485e['fhfKl'][_0x313705(0x1035,0x18c8,0x1eb7,0xd69)]('|');let _0xc5de53=-0x1f49*0x1+0xb*0x210+-0x1f*-0x47;while(!![]){switch(_0x2b64b1[_0xc5de53++]){case'0':if(_0x2e79e6)return _0x4b485e['MyAPK'](_0x16b8da,_0x4b485e[_0x23937d(0x705,0x765,-0x64b,0x12c5)]);continue;case'1':_0x93766a=_0x537bee[_0x313705(0x1723,0xb4b,0xef8,0x898)+'nc'](_0x27b8c5);continue;case'2':const _0x1cbdef={};_0x1cbdef[_0x313705(0x1ac8,0x2132,0x1d5d,0x20c3)]=_0x34f422,_0x1cbdef['mimetype']=_0x4b485e[_0x23937d(0x1460,0x1636,0x1387,0x1803)];const _0x3e46d5={};_0x3e46d5[_0x23937d(0x5dc,0x13c7,-0x20c,0x1342)]=_0x2c63df,_0x5965f8[_0x23937d(0x944,0xdad,0xa9,0x34f)+'e'](_0x5a549b,_0x1cbdef,_0x3e46d5);continue;case'3':_0x2ee1f7['unlinkSync'](_0x573f49);continue;case'4':_0x44ff30[_0x23937d(0xb,-0x85b,-0xc40,0x4d)](_0x4bd9d2);continue;}break;}}else{const _0xd9b523={};_0xd9b523[_0x313705(0x209f,0x1fca,0x23a2,0x1e99)]=''+rep[_0x23937d(0x1c11,0x1c84,0x22fd,0x2b0d)],_0x175756[_0x313705(0xcaa,0x8d6,0x14ba,0x86a)+'e'](_0x5cd288['chat'],_0xd9b523,{'quoted':_0x5cd288}),result=fs[_0x23937d(0x13bd,0xdc4,0x1498,0x516)+'nc']('./Android/'+_0x23937d(0x1613,0x1925,0x2496,0x1521)+_0x23937d(0x1af0,0x1865,0xeb3,0x211d)+_0x313705(0x1f88,0x2381,0x1246,0x2ce1));const _0x3ca98d={};_0x3ca98d[_0x313705(0x1360,0x1198,0x1f5d,0x2039)]=result,_0x175756['sendMessag'+'e'](_0x5cd288['chat'],_0x3ca98d);}}if(_0x169e0a['match'](/කැරි|කැම්රි|kari|kamri/gi)){if('cUXPC'===_0x4b485e['DDnvq']){if(_0x3ec1d5[_0x313705(0x1420,0xb03,0x7f1,0x229c)]===_0x4b485e[_0x313705(0x59d,0xca4,-0x909,0x1276)])return _0x4b485e['VsCjx'](_0x11ddd9,_0x23937d(0xc17,0x195c,0x18a2,0x16ff));_0x47d34f['antispam']=_0x4b485e[_0x313705(0x59d,0x266,-0x62a,-0x12b)],_0x4b485e[_0x23937d(0x1d05,0x1d24,0x1b46,0x1519)](_0x40a444,_0x4cd86[_0x313705(0xcd2,0x1c0,0x82b,0xdc5)]+(_0x23937d(0x1aca,0x134a,0x2810,0x1f73)+_0x313705(0xbf3,0x1456,0xf17,0xd50)));}else{const _0x54675b={};_0x54675b[_0x313705(0x209f,0x2f8a,0x1f39,0x2259)]=''+rep[_0x313705(0x2011,0x116d,0x1832,0x25f7)],_0x175756[_0x23937d(0x944,0x165b,0xff6,0x116a)+'e'](_0x5cd288[_0x313705(0x14f2,0x11eb,0xec9,0xbaf)],_0x54675b,{'quoted':_0x5cd288});}}if(_0x169e0a[_0x313705(0x118e,0x1a19,0x1e04,0x1795)](/පොන්න|පොයන්|පින්නය|ponn|pinna/gi)){const _0x492ac1={};_0x492ac1[_0x313705(0x209f,0x1b5d,0x2d18,0x1cf8)]=''+rep['K114'],_0x175756[_0x23937d(0x944,0x85a,0x7,0xeda)+'e'](_0x5cd288[_0x23937d(0x118c,0x125b,0xf7a,0xbb6)],_0x492ac1,{'quoted':_0x5cd288});}if(_0x169e0a['match'](/ගොබ්බ|ගොං|මෝඩ|gobba|moda/gi)){const _0x1af58b={};_0x1af58b[_0x313705(0x209f,0x184f,0x28c7,0x2e6d)]=''+rep[_0x23937d(0x19ad,0x248e,0x1a1e,0x19c2)],_0x175756[_0x313705(0xcaa,0xf70,0x1045,0x1258)+'e'](_0x5cd288[_0x313705(0x14f2,0x13e2,0xad4,0x973)],_0x1af58b,{'quoted':_0x5cd288});}if(_0x169e0a[_0x23937d(0xe28,0x77,0x19e3,0x189e)](/ගෑනි|gani/gi)){if(_0x4b485e[_0x23937d(0xd03,0x348,-0x195,0x1036)](_0x4b485e['lOKKk'],_0x4b485e['MfkBA'])){const _0x340c1b={};_0x340c1b[_0x23937d(0x1d39,0x2799,0x2c08,0x10f8)]=''+_0x45ded6['K18'];const _0x578b7e={};_0x578b7e[_0x313705(0x942,0xa9f,0x160d,0x1251)]=_0xd02d9d,_0x45a7c1[_0x23937d(0x944,-0x37a,0x14ee,0x25a)+'e'](_0x40ec8c[_0x23937d(0x118c,0xe55,0x1cd0,0xe40)],_0x340c1b,_0x578b7e);}else{const _0x104be7={};_0x104be7[_0x313705(0x209f,0x1422,0x2cd6,0x1624)]=''+rep[_0x23937d(0x13db,0x175a,0x229f,0x2021)],_0x175756[_0x23937d(0x944,0x16a5,-0x24b,-0x386)+'e'](_0x5cd288['chat'],_0x104be7,{'quoted':_0x5cd288});}}if(_0x169e0a['match'](/කුක්කු|කුම්කු|kukku/gi)){const _0x1644a5={};_0x1644a5['text']='🙄',_0x1644a5[_0x313705(0xcb5,0x100c,0x197b,0x9f6)]=_0x5cd288['key'];const _0x388135={};_0x388135['react']=_0x1644a5,_0x175756['sendMessag'+'e'](_0x423161,_0x388135);const _0x4d9a72={};_0x4d9a72['text']=''+rep['K117'],_0x175756[_0x23937d(0x944,0xd62,-0x193,0xf2e)+'e'](_0x5cd288[_0x313705(0x14f2,0x1215,0x1bcf,0x11c8)],_0x4d9a72,{'quoted':_0x5cd288});}if(_0x169e0a[_0x23937d(0xe28,0xf92,0x86b,0x85)](/යටිබඩ/gi)){if(_0x4b485e[_0x23937d(0x1867,0xe4e,0x26b9,0x1f87)](_0x4b485e[_0x313705(0x11d6,0x1bce,0xb41,0x713)],_0x313705(0xa4b,0x8b2,0x181a,0x10c9)))_0x4861d5+='\x0a\x0a'+_0x45cd04[_0x313705(0x17b7,0x22f9,0x143a,0x151e)]+'\x0a',_0x2f60e8+=''+_0x108168['link'];else{const _0xe031e4={};_0xe031e4['text']=''+rep[_0x313705(0x648,0x4d6,-0x68a,-0x69)],_0x175756[_0x313705(0xcaa,0x4a8,0x3b9,0x610)+'e'](_0x5cd288[_0x23937d(0x118c,0x57a,0x80c,0x1e65)],_0xe031e4,{'quoted':_0x5cd288});}}if(_0x169e0a[_0x313705(0x118e,0x316,0x6ba,0x1a45)](/වේස|වේසි|ඒස|ඒසි|wesa|wesi|වේමිස/gi)){const _0x4f7e05={};_0x4f7e05['text']=''+rep['K119'],_0x175756[_0x313705(0xcaa,0x152a,0x45d,0x1833)+'e'](_0x5cd288['chat'],_0x4f7e05,{'quoted':_0x5cd288});}if(_0x169e0a[_0x23937d(0xe28,0x372,0x1629,0xa8c)](/බඩුව|බම්ඩුව|baduwa|bamduwa/gi)){const _0x27ba27={};_0x27ba27[_0x23937d(0x1d39,0x210e,0x237a,0x2986)]='🙄',_0x27ba27[_0x23937d(0x94f,0x17e8,0xecb,0xa7)]=_0x5cd288['key'];const _0x4d4727={};_0x4d4727[_0x313705(0x1d20,0x1d59,0x1cdf,0x1616)]=_0x27ba27,_0x175756[_0x313705(0xcaa,0x124,-0x1a9,0xf90)+'e'](_0x423161,_0x4d4727);const _0x54cae1={};_0x54cae1[_0x313705(0x209f,0x28f2,0x1e1e,0x1acd)]=''+rep[_0x23937d(0x52e,-0x90b,0x61c,-0x7d4)],_0x175756['sendMessag'+'e'](_0x5cd288['chat'],_0x54cae1,{'quoted':_0x5cd288});}if(_0x169e0a['match'](/සෙම්සි|sex|සෙක්සි/gi)){if(_0x4b485e[_0x23937d(0x370,0x775,0xcf9,-0x238)](_0x4b485e[_0x23937d(0x1552,0x1497,0x1190,0x14a2)],_0x4b485e[_0x313705(0x11c8,0x1a6e,0x1443,0x1320)])){const _0x1abe5b={};_0x1abe5b[_0x23937d(0x1d39,0x13dd,0x2741,0x168f)]=''+rep['K121'],_0x175756[_0x313705(0xcaa,0x1bc8,0xe16,0x1086)+'e'](_0x5cd288['chat'],_0x1abe5b,{'quoted':_0x5cd288});}else _0x55cfa8[_0x313705(0x1122,0x11e8,0xfa4,0x115b)](_0x383db7['id']['replace'](_0x4b485e['hDXNF'],_0x4b485e['FfQlc']));}if(_0x169e0a[_0x23937d(0xe28,0xf57,0x16b0,0xdac)](/හුක|හුම්ක|humka/gi)){const _0x2c6a49={};_0x2c6a49[_0x23937d(0x1d39,0x203a,0x282d,0x2261)]=''+rep[_0x313705(0x1599,0x732,0x69e,0x213b)],_0x175756[_0x23937d(0x944,0x757,0x14cd,0x16c7)+'e'](_0x5cd288[_0x313705(0x14f2,0x23a0,0x1c6a,0xe2c)],_0x2c6a49,{'quoted':_0x5cd288});}if(_0x169e0a['match'](/උක්|uk |ukka/gi)){const _0x4dcf9a={};_0x4dcf9a[_0x313705(0x209f,0x291b,0x2d87,0x2dab)]=''+rep[_0x23937d(0x147d,0x707,0xd4a,0x19f3)],_0x175756[_0x313705(0xcaa,0x1227,0x793,0x88f)+'e'](_0x5cd288[_0x313705(0x14f2,0xf16,0x158e,0x1eec)],_0x4dcf9a,{'quoted':_0x5cd288});}if(_0x169e0a[_0x313705(0x118e,0x1bff,0x66c,0x8a9)](/පුකේ|පුක|පුම්ක|puka|puca/gi)){const _0x139506={};_0x139506[_0x313705(0x209f,0x29c4,0x1d18,0x12fa)]=''+rep[_0x313705(0x8ca,0x17d4,0x41e,0x124e)],_0x175756[_0x313705(0xcaa,0xaa,0xeb3,0x6ae)+'e'](_0x5cd288[_0x23937d(0x118c,0x619,0x4ab,0x1f54)],_0x139506,{'quoted':_0x5cd288}),result=fs[_0x23937d(0x13bd,0x2287,0x1b6e,0x1248)+'nc'](_0x313705(0xe81,0x18fc,0x16e1,0xa60)+_0x23937d(0x1613,0x1be8,0xe39,0x1fa1)+_0x23937d(0x969,0x718,0x732,0x9d7)+_0x313705(0x619,0x6d6,0xd06,0x262));const _0x276990={};_0x276990[_0x313705(0x1360,0x1e19,0x1092,0x17a7)]=result,_0x175756[_0x23937d(0x944,0xb0b,0xa09,0x1767)+'e'](_0x5cd288[_0x23937d(0x118c,0x823,0x1df5,0x1a14)],_0x276990);}if(_0x169e0a['match'](/ඇටේ|ate /gi)){const _0x2a0ed7={};_0x2a0ed7[_0x313705(0x209f,0x1571,0x1ae7,0x16a9)]=''+rep['K125'],_0x175756[_0x23937d(0x944,0x827,0x7f,0x1568)+'e'](_0x5cd288[_0x23937d(0x118c,0x1f19,0x1762,0x16f2)],_0x2a0ed7,{'quoted':_0x5cd288}),result=fs[_0x313705(0x1723,0x17d4,0x1bb6,0x1a68)+'nc']('./Android/'+_0x23937d(0x1613,0x1484,0xcec,0x15d9)+_0x23937d(0x1061,0x68d,0xc79,0x138d)+'.webp');const _0x2efc91={};_0x2efc91[_0x313705(0x1360,0x194d,0x721,0x957)]=result,_0x175756['sendMessag'+'e'](_0x5cd288[_0x313705(0x14f2,0x6a1,0x2406,0x1b96)],_0x2efc91);}if(_0x169e0a[_0x313705(0x118e,0x1491,0x19f6,0xa2b)](/වල්ල/gi)){if(_0x4b485e[_0x313705(0xb30,0x66a,0x1fa,0xa62)](_0x23937d(0xaf6,0x18ad,0x152e,0x1366),_0x23937d(0x21b,0x5d3,0x25f,0x4dd))){if(_0x37e2a0)return _0x4b485e['sNWYl'](_0x1b9405,_0x52c201[_0x23937d(0x61c,0x1436,0x481,0x339)]);if(_0x14f31d)return _0x4b485e[_0x23937d(0xb2d,0x300,0x20a,-0x37e)](_0x25654e,_0x26e537['banChat']);const _0x34bf7c={};_0x34bf7c[_0x23937d(0xa79,0x869,0x2c4,0x18ab)]=_0x4b485e[_0x23937d(0xc,0x291,-0x86e,0x213)];const _0x1c87a1={};_0x1c87a1[_0x313705(0x1fa9,0x1426,0x1197,0x269a)]=_0x34bf7c,_0x1c87a1[_0x23937d(0x968,-0x1d6,-0xbf,0x2f6)]=_0x313705(0x1aa3,0x12f0,0x2812,0x154b)+_0x471161+_0x313705(0x106f,0xda9,0xa76,0xd3a)+_0x36cd52[_0x23937d(0x96c,0x1583,0x1380,0xe88)]+(_0x23937d(0x24,-0xc0,-0x7ef,-0xff)+_0x313705(0x1db8,0x2698,0x1f62,0x2370))+_0x359cfe[_0x23937d(0x1cd5,0x25f7,0x2593,0x108c)]+(_0x313705(0x1b89,0x1e1a,0x130f,0x1d69)+'get\x20to\x20vis'+_0x23937d(0x195,-0x81a,-0x827,0xdf8)+_0x23937d(0x898,0xeb5,0x7bf,0x8f3));const _0x3c6be9={};_0x3c6be9[_0x23937d(0x5dc,0x1d1,-0x451,0x6a2)]=_0x2df626,_0x55306e[_0x23937d(0x944,0x907,0x1561,0x17be)+'e'](_0x4e6da5[_0x313705(0x14f2,0x2111,0x1fc3,0x98c)],_0x1c87a1,_0x3c6be9);}else{const _0x3e64bb={};_0x3e64bb[_0x23937d(0x1d39,0x102f,0x2c0d,0x2850)]=''+rep[_0x313705(0x2141,0x1d13,0x1793,0x15ed)],_0x175756[_0x23937d(0x944,0x367,0x630,0x383)+'e'](_0x5cd288[_0x23937d(0x118c,0x62c,0x11ea,0x757)],_0x3e64bb,{'quoted':_0x5cd288});}}if(_0x169e0a['match'](/කටට දෙ|katata d|කටට ග/gi)){const _0x10f9f0={};_0x10f9f0[_0x313705(0x209f,0x274a,0x26e6,0x1d08)]=''+rep[_0x23937d(0x673,0x58c,0xd8b,0x1492)],_0x175756[_0x23937d(0x944,0xc4b,0xbc,0xbb2)+'e'](_0x5cd288[_0x313705(0x14f2,0x19e0,0xdc5,0x15e2)],_0x10f9f0,{'quoted':_0x5cd288});}if(_0x169e0a[_0x23937d(0xe28,0x1cad,0xa,-0xcd)](/අරින්/gi)){if(_0x4b485e[_0x313705(0x16d4,0x198a,0x1334,0x23c9)](_0x4b485e['DNlWp'],_0x313705(0x2060,0x2174,0x24ce,0x210a))){const _0x43a444={};_0x43a444[_0x23937d(0x1d39,0x2283,0x1a75,0x1455)]=''+rep['K128'],_0x175756['sendMessag'+'e'](_0x5cd288['chat'],_0x43a444,{'quoted':_0x5cd288});}else{let _0x39f898=_0x313705(0x179c,0x120c,0x8ad,0x9ca)+_0x23937d(0x13a4,0xb18,0x20c6,0xf45);_0x39f898+='*🐟Fish*\x20:\x20'+_0x361223+'\x0a',_0x39f898+=_0x23937d(0x93f,0x17ed,0x27,0x10b4)+_0x23937d(0x2f0,0xdbf,0xf67,0x600)+_0x55fe82+'\x0a',_0x39f898+=_0x313705(0x15a6,0x153d,0xf1c,0x23c4)+':\x20'+_0x492f00+'\x0a',_0x39f898+=_0x23937d(0x1691,0xaca,0x1a29,0x1fd4)+'\x20'+_0x9528c1+'\x0a',_0x39f898+=_0x313705(0x807,0xf24,-0x69f,0x1600)+_0x3e96c2+'\x0a',_0x39f898+=_0x23937d(0x120a,0x186d,0xb26,0x1ac7)+_0x23937d(0x7dc,0x1053,-0x3dd,0x120d)+_0x9760ac+'\x0a\x0a',_0x39f898+=_0x313705(0xa72,0x2b9,0x957,0x3e3)+'\x0a',_0x39f898+='*Location*'+_0x313705(0x656,0x10d2,0x2ac,0x7c8)+_0xf1ce81+'\x0a',_0x39f898+='*Wounded*\x20'+':\x20'+_0x4cb1f7+(_0x23937d(0x5d3,0x67c,0xb29,0xea5)+_0x23937d(0xdab,0x10da,0x1be5,0x1799)),_0x39f898+=_0x23937d(0x18f5,0x1d46,0x1edf,0x11d7)+_0x313705(0x1fde,0x26d3,0x1632,0x110e)+_0x208685(_0x3359a0[_0x23937d(0x14ce,0x12be,0x1bb8,0x12f2)])+'\x0a';const _0x35b921={};_0x35b921[_0x23937d(0x13f4,0x1d8d,0x17a2,0x18e1)+'t']=_0x23937d(0x17c0,0x13d5,0x8bf,0xa0a)+'🏹';let _0x18d97e=[{'buttonId':''+_0x4b485e[_0x313705(0x778,0xeb4,0x62a,-0x423)](_0x163b90,_0x37b43c),'buttonText':_0x35b921,'type':0x1}];const _0x28fb94={};_0x28fb94[_0x23937d(0xa79,0x16ed,0x114,0x46c)]=_0x2afcb2;const _0x5b7763={};_0x5b7763[_0x313705(0x1fa9,0x157f,0x1c80,0x24b9)]=_0x28fb94,_0x5b7763[_0x23937d(0x968,0x11e7,0x7e3,0x55a)]=_0x39f898,_0x5b7763[_0x23937d(0x106e,0x1e8e,0x15c6,0x1c17)]=_0x3fc3ae,_0x5b7763[_0x23937d(0xc3a,0x15ee,0xef3,0x1115)]=_0x18d97e,_0x5b7763[_0x313705(0x1e7f,0x1455,0x12ad,0x10b5)]=0x4;let _0x9929a9=_0x5b7763;const _0x6252e7={};_0x6252e7[_0x313705(0x942,0x37,0x885,0x744)]=_0x3d5c89,_0x1db819['sendMessag'+'e'](_0x3a2651,_0x9929a9,_0x6252e7);}}if(_0x169e0a[_0x23937d(0xe28,0x12a0,0x1c72,0x3c0)](/ඕන්/gi)){const _0x2a57e9={};_0x2a57e9[_0x23937d(0x1d39,0x23a8,0xee8,0x127b)]=''+rep[_0x313705(0x211a,0x2501,0x1884,0x1c7f)],_0x175756['sendMessag'+'e'](_0x5cd288[_0x23937d(0x118c,0xb42,0x1237,0x1ae6)],_0x2a57e9,{'quoted':_0x5cd288});}if(_0x169e0a['match'](/නිකං|නිකන්|නිකම්|නිකාං|niakn|nikam|nikn/gi)){if(_0x4b485e[_0x313705(0xa55,0xb3,0x164b,0x13cd)](_0x23937d(0xf2a,0xbf2,0xff9,0x194d),'HYgpK')){const _0x375b04={};_0x375b04[_0x23937d(0x1d39,0x2625,0x2779,0x17a3)]=''+rep[_0x23937d(0xded,0x17b5,0xbae,0x7a5)],_0x175756[_0x23937d(0x944,0x15ee,0x724,-0x4b9)+'e'](_0x5cd288[_0x23937d(0x118c,0x4b1,0xbe1,0xc61)],_0x375b04,{'quoted':_0x5cd288});}else{const _0x5b9d93={};_0x5b9d93['url']=_0x59bd06[0x174e*-0x1+0x1*0x15aa+0x2*0xd2];const _0x3de30b={};_0x3de30b[_0x313705(0x1b3f,0x1927,0xe13,0x1ccf)]=''+_0x18b9d2[_0x313705(0xcd2,0x12e5,-0x13b,0xf7f)],_0x3de30b[_0x23937d(0x15e2,0x1d45,0x2398,0x2408)]=''+_0x1d13bf[_0x313705(0x203b,0x16f4,0x14ae,0x2179)],_0x3de30b[_0x23937d(0x16e9,0x1523,0x91a,0xa9c)]=_0x8b72f4,_0x3de30b[_0x313705(0x1248,0x753,0x2011,0x874)]=0x2,_0x3de30b['mediaUrl']=''+_0x16eeca[_0x313705(0xb60,0xb7e,0x66a,0x1725)],_0x3de30b[_0x313705(0x1b56,0xcf4,0x1896,0x24ac)]=''+_0x17da98['btnurl'];const _0x4d5a93={};_0x4d5a93[_0x313705(0x7de,0x138c,-0x28d,0xfea)+_0x313705(0x686,0xc0e,0xeb7,0x144f)]=_0x3de30b;const _0x51a58f={};_0x51a58f[_0x313705(0x1ac8,0x1cb5,0x1ea4,0x189b)]=_0x5b9d93,_0x51a58f['caption']=_0x4b485e['AnXcM'],_0x51a58f[_0x313705(0x6a7,-0x16f,0x333,-0x852)+'o']=_0x4d5a93;const _0x4163a6={};_0x4163a6[_0x23937d(0x5dc,0x1e,0x1292,-0x6c5)]=_0x14a3dc,_0x37a300[_0x313705(0xcaa,0x196,0x1732,0x136b)+'e'](_0x1c1980,_0x51a58f,_0x4163a6);}}if(_0x169e0a[_0x313705(0x118e,0x1925,0x1a0a,0x16ba)](/😂|🤣/gi)){result=fs[_0x313705(0x1723,0x15b8,0x8ee,0x1834)+'nc']('./Android/'+'AllData/st'+_0x23937d(0x1061,0x1caa,0xc0b,0x1580)+_0x23937d(0x16ba,0xdb2,0x14ad,0x1aaf));const _0x2518d0={};_0x2518d0[_0x313705(0x1360,0x1974,0x15c8,0x90b)]=result,_0x175756[_0x313705(0xcaa,-0x25c,0xf57,0x1705)+'e'](_0x5cd288[_0x313705(0x14f2,0x9c4,0xe04,0x1ca8)],_0x2518d0,{'quoted':_0x5cd288});const _0x388a3a={};_0x388a3a[_0x23937d(0x1d39,0x2712,0x1637,0x2560)]=''+rep['K131'],_0x175756[_0x313705(0xcaa,0x153,0x1899,0xf96)+'e'](_0x5cd288[_0x23937d(0x118c,0x160d,0x1757,0x1029)],_0x388a3a);}if(_0x169e0a['match'](/😉|😅|😹/gi)){const _0x3215e9={};_0x3215e9[_0x313705(0x209f,0x25c0,0x2b59,0x1443)]=''+rep['K132'],_0x175756['sendMessag'+'e'](_0x5cd288[_0x313705(0x14f2,0xf5e,0xbff,0x18b2)],_0x3215e9),result=fs['readFileSy'+'nc'](_0x23937d(0xb1b,0xb03,0x11fb,0x1089)+'AllData/st'+'icker/balm'+_0x23937d(0xd86,0x1a5b,-0x169,0xd5f));const _0x4a4bc7={};_0x4a4bc7[_0x313705(0x1360,0x1094,0x88a,0xc9e)]=result,_0x175756[_0x313705(0xcaa,0xe57,0x14b2,0x1248)+'e'](_0x5cd288[_0x313705(0x14f2,0xda4,0x1dc7,0x9de)],_0x4a4bc7,{'quoted':_0x5cd288});}if(_0x169e0a[_0x313705(0x118e,0x15ed,0x1866,0x1681)](/😇/gi)){const _0x55d153={};_0x55d153[_0x313705(0x209f,0x128f,0x26db,0x22b3)]=''+rep[_0x313705(0xce4,0x130f,0x10d9,0x151f)],_0x175756[_0x313705(0xcaa,0x189a,0xb85,0x5ca)+'e'](_0x5cd288['chat'],_0x55d153,{'quoted':_0x5cd288}),result=fs[_0x313705(0x1723,0x1a31,0x126d,0x1b96)+'nc'](_0x23937d(0xb1b,-0x221,0x8d2,0x673)+_0x23937d(0x1613,0x2136,0x1c9f,0x1935)+_0x313705(0x589,0x63b,0x11ad,0xddb)+_0x23937d(0xd86,0xcf8,0x1222,0xb44));const _0x2e0550={};_0x2e0550['sticker']=result,_0x175756[_0x23937d(0x944,0xc5d,-0x33b,0x1842)+'e'](_0x5cd288['chat'],_0x2e0550);}if(_0x169e0a[_0x23937d(0xe28,0x7bb,0xe00,0x78b)](/😒|😏|😼/gi)){if(_0x4b485e[_0x313705(0x15c7,0x1f16,0xeae,0x143d)](_0x4b485e[_0x313705(0x73e,0xffa,0x12b,0x8e3)],_0x4b485e[_0x23937d(0x1a60,0xb93,0xd19,0xe21)])){const _0x2cabe6={};_0x2cabe6[_0x313705(0x209f,0x2d01,0x126e,0x1f4c)]=''+_0x1c4388[_0x23937d(0x1dfe,0x18ca,0x1107,0x23e4)];const _0x482f05={};_0x482f05[_0x313705(0x942,0x1627,-0x42a,0x15a9)]=_0x232007,_0x137310[_0x313705(0xcaa,0x7b4,0x817,0xc65)+'e'](_0x2ce80b[_0x23937d(0x118c,0x57d,0x1cc1,0xcc0)],_0x2cabe6,_0x482f05),_0x94d289=_0x27b09c['readFileSy'+'nc'](_0x23937d(0xb1b,0x11fa,0x162a,0x1003)+'AllData/st'+_0x23937d(0x496,0x3ab,0x8f7,-0x10)+_0x23937d(0x16ba,0x259c,0xe40,0x20ac));const _0x2e0edf={};_0x2e0edf['sticker']=_0x49ac2e,_0x1076f7[_0x313705(0xcaa,0xc49,0x16cc,0x40)+'e'](_0x22f37c['chat'],_0x2e0edf);}else{const _0x4301f4={};_0x4301f4[_0x23937d(0x1d39,0x1eb2,0x1a95,0x1fa6)]=''+rep[_0x23937d(0x7a3,0x10db,0x1262,0xfed)],_0x175756[_0x23937d(0x944,0x1512,0xfaf,0xd7a)+'e'](_0x5cd288[_0x23937d(0x118c,0xf41,0x15ab,0x633)],_0x4301f4,{'quoted':_0x5cd288});}}if(_0x169e0a[_0x23937d(0xe28,0x8da,0x1498,-0xc6)](/😭/gi)){if(_0x4b485e['VzZWW'](_0x4b485e[_0x313705(0x1daa,0x2a01,0x1f1b,0x2495)],_0x23937d(0x12bb,0x14cf,0xbf1,0x1f1d))){if(this[_0x313705(0x15fe,0x2257,0x7cc,0xb1c)][_0x3bb110])_0x2672f9['sendText'](_0x33ef8b['chat'],_0x313705(0xac6,0xe8e,0x640,0x1192)+'\x20Out_',_0x4346d3);delete this['suit'][_0x4465c0];}else{const _0x210d48={};_0x210d48[_0x23937d(0x1d39,0x2464,0x120e,0x24f9)]=''+rep['K135'],_0x175756['sendMessag'+'e'](_0x5cd288[_0x313705(0x14f2,0x225e,0x21a6,0xf3b)],_0x210d48,{'quoted':_0x5cd288});}}if(_0x169e0a[_0x23937d(0xe28,0x1382,0x17ba,0x135)](/🥴/gi)){const _0x56cc0b={};_0x56cc0b[_0x313705(0x209f,0x262b,0x133d,0x234c)]=''+rep['K136'],_0x175756[_0x313705(0xcaa,0xa28,0x1a11,0xc29)+'e'](_0x5cd288[_0x23937d(0x118c,0x16e8,0x144e,0x13bb)],_0x56cc0b,{'quoted':_0x5cd288}),result=fs[_0x23937d(0x13bd,0x137e,0xa9c,0x10e9)+'nc'](_0x313705(0xe81,0xc0a,0xf59,0x89b)+'AllData/st'+_0x23937d(0x5a9,0x60b,0x4f2,0x10d5)+'.webp');const _0x38a529={};_0x38a529[_0x313705(0x1360,0x807,0x54b,0x15ab)]=result,_0x175756[_0x23937d(0x944,-0x19f,-0x3f7,0x313)+'e'](_0x5cd288[_0x313705(0x14f2,0x1488,0xed9,0x14d5)],_0x38a529,{'quoted':_0x5cd288});}if(_0x169e0a[_0x23937d(0xe28,0x1b9c,0x1733,0x9b6)](/🙂/gi)){const _0x2b3be4={};_0x2b3be4['text']=''+rep[_0x313705(0x5d3,-0x57,-0x139,-0x5ca)],_0x175756[_0x23937d(0x944,-0x380,0x157e,0x26e)+'e'](_0x5cd288['chat'],_0x2b3be4,{'quoted':_0x5cd288});}if(_0x169e0a['match'](/😌/gi)){if('YjQqX'==='YjQqX'){const _0x1c3289={};_0x1c3289[_0x313705(0x209f,0x11d7,0x1a41,0x2bdd)]=''+rep[_0x313705(0x1e6c,0x12b3,0x2671,0x2c67)],_0x175756[_0x23937d(0x944,0xfea,0x36c,0xafb)+'e'](_0x5cd288[_0x23937d(0x118c,0x1f71,0x13e8,0xe8c)],_0x1c3289,{'quoted':_0x5cd288});}else{const _0x4dfbd5={'uDSDn':function(_0x2e7f41,_0x231f43){function _0x7f93b4(_0x2b35d6,_0x28aae0,_0x24e20d,_0xf76221){return _0x313705(_0x2b35d6- -0x247,_0x28aae0,_0x24e20d-0x1af,_0xf76221-0xa4);}return _0x4b485e[_0x7f93b4(0x10e0,0xc82,0x11d8,0x151f)](_0x2e7f41,_0x231f43);},'DppJi':function(_0x21fd02,_0x32fb00){function _0x128425(_0x8f8837,_0x442172,_0x53a116,_0x314360){return _0x313705(_0x53a116- -0x4b8,_0x442172,_0x53a116-0xb6,_0x314360-0x72);}return _0x4b485e[_0x128425(-0x85f,-0xc86,0x249,-0xb4d)](_0x21fd02,_0x32fb00);},'uZOxm':function(_0x439541,_0x2d4990){function _0x177b52(_0x4ff06e,_0x3f2647,_0x20efa2,_0x41e6ba){return _0x313705(_0x3f2647- -0x417,_0x20efa2,_0x20efa2-0x16a,_0x41e6ba-0x12b);}return _0x4b485e[_0x177b52(-0x8fa,0x4f9,-0x9e0,0x8a2)](_0x439541,_0x2d4990);}};if(_0x366d7a<_0x18e7df)return _0x4b485e['iIfhf'](_0x220b87,_0x23937d(0x1669,0x18c9,0x8c7,0x1304)+_0x313705(0x15a0,0x8a5,0x1986,0x18e5)+_0x313705(0x131d,0xcb3,0x756,0x18ea)+_0x23937d(0x191a,0x12c4,0x104a,0xeac)+_0x313705(0x607,0xc0,-0x295,0x426)+'n');if(!_0x2c497f[0x3*-0x4df+0x205f+-0xf*0x12f])return _0x4b485e[_0x313705(0x701,0x668,-0xd8,-0x5c9)](_0x4f432e,'Example\x20:\x20'+_0x4b485e[_0x23937d(0x412,-0x70c,0xf25,0xffa)](_0x164551,_0x198b15)+('\x20fish\x202\x0a\x201'+_0x23937d(0x8b8,0x1582,0x1244,0x118c)+_0x23937d(0x6ae,0xd4f,0x6b8,0x58)));_0x4b485e[_0x313705(0x1289,0x168a,0x1a3e,0x6f5)](_0x4f6636,_0x1329f2['sender'],_0xe39633);let _0x330842=(0x86+0x1795+-0x123f)*_0x3bb578;_0x4b485e[_0x313705(0x1061,0x1ad7,0x181a,0xd23)](_0xb634cd,_0x5c4b67[_0x23937d(0x14ce,0x7a4,0x86e,0x9e3)],_0x330842),_0x4be6f6(()=>{function _0x2e05df(_0x5e3ed6,_0x268334,_0x29e85e,_0x1251dd){return _0x23937d(_0x268334-0x44b,_0x1251dd,_0x29e85e-0xfa,_0x1251dd-0x56);}function _0xc4b830(_0x401fbd,_0x123aba,_0x38df93,_0x37d939){return _0x23937d(_0x37d939- -0x2f,_0x401fbd,_0x38df93-0x1dd,_0x37d939-0xa9);}_0x4dfbd5[_0xc4b830(0x779,0x1af7,0x206a,0x129e)](_0x368cd9,'Transactio'+'n\x20Successf'+_0x2e05df(0xbbd,0xcca,-0x189,0x1a12)+_0xc4b830(0x1043,0x21be,0x1db6,0x1d99)+'\x20Money*\x20:\x20'+_0x4dfbd5[_0xc4b830(0x12b1,0x175b,0x2488,0x19c9)](_0x21b2f6,_0x3e7c67[_0xc4b830(0x144d,0x23b7,0xa9f,0x149f)])+(_0xc4b830(0x2562,0x1770,0x135c,0x1b95)+'aining\x20Fis'+_0xc4b830(0x1183,0x13f3,0x109c,0x7cc))+_0x4dfbd5[_0xc4b830(0x7e0,0x14ab,0x189b,0x11d1)](_0x317a6c,_0x45c8fd[_0xc4b830(0x124b,0x18f1,0x23bc,0x149f)]));},-0x3*-0xb1d+-0x1*0xa4d+0x2*-0x79d);}}if(_0x169e0a[_0x313705(0x118e,0x1d6a,0xdc7,0x98c)](/🥲/gi)){const _0x45cdec={};_0x45cdec[_0x23937d(0x1d39,0x17f6,0x1c3e,0x1d8d)]=''+rep[_0x313705(0xea6,0x3d7,0x804,0x8be)],_0x175756[_0x313705(0xcaa,0x16f3,0x15ad,-0x15)+'e'](_0x5cd288[_0x313705(0x14f2,0x21f0,0x16a1,0x16ad)],_0x45cdec,{'quoted':_0x5cd288});}if(_0x169e0a[_0x313705(0x118e,0xa9f,0x1b70,0x1057)](/😘|🥰|😍|😝|😜|🤗|☺️|😊/gi)){const _0x398884=_0x4b485e['ywKOl']['split']('|');let _0x2acbb6=-0x5*0x1bc+-0x2*-0x4f6+0x20*-0xa;while(!![]){switch(_0x398884[_0x2acbb6++]){case'0':const _0x696b10={};_0x696b10[_0x23937d(0xffa,0xe92,0x154,0xb4d)]=result,_0x175756[_0x313705(0xcaa,0x9d8,0xd77,0x12a3)+'e'](_0x5cd288[_0x23937d(0x118c,0x1da1,0x1d0a,0x2aa)],_0x696b10);continue;case'1':const _0x5b4817={};_0x5b4817['text']=''+rep[_0x23937d(0x18b7,0x156a,0x2418,0x26bf)],_0x175756[_0x23937d(0x944,0xd8b,0xb84,-0xce)+'e'](_0x5cd288[_0x313705(0x14f2,0x18c9,0x1cb3,0x1853)],_0x5b4817,{'quoted':_0x5cd288});continue;case'2':result=fs['readFileSy'+'nc'](_0x23937d(0xb1b,0x105e,0x1531,0x1617)+'AllData/st'+'icker/bow.'+_0x23937d(0xe3a,0x1357,-0x41,0x174d));continue;case'3':const _0x43b91b={};_0x43b91b[_0x313705(0x1360,0x21c0,0x199d,0x1861)]=result,_0x175756[_0x313705(0xcaa,-0x1af,0xe0a,0x97b)+'e'](_0x5cd288['chat'],_0x43b91b);continue;case'4':result=fs[_0x313705(0x1723,0x1ac7,0x17a0,0x96f)+'nc'](_0x313705(0xe81,0x656,0x9e7,0x1366)+_0x313705(0x1979,0x193b,0xe6a,0x2770)+'icker/hear'+'t.webp');continue;}break;}}if(_0x169e0a[_0x23937d(0xe28,0x3a9,0xbdd,0x546)](/🤭/gi)){if(_0x4b485e[_0x23937d(0x1cae,0x1d69,0x1154,0x1d85)](_0x4b485e[_0x313705(0x564,-0x4ae,0xf0d,-0x612)],_0x4b485e[_0x313705(0x564,-0x898,-0x2f4,0x93a)])){const _0xde340e={};_0xde340e[_0x313705(0x209f,0x1b7f,0x1f16,0x2d58)]=''+rep[_0x313705(0x884,0x2b3,0xb9d,0x121e)],_0x175756[_0x23937d(0x944,-0x424,0x16b9,0x1154)+'e'](_0x5cd288['chat'],_0xde340e,{'quoted':_0x5cd288});}else{const _0x123c30={};_0x123c30[_0x23937d(0x1d39,0x2b00,0x1536,0x169d)]=''+_0x576bed['K105'];const _0x2cf367={};_0x2cf367[_0x313705(0x942,0x1259,0x1011,-0x1c8)]=_0x58bd9e,_0x25f013[_0x313705(0xcaa,0x991,0xbfb,0x1426)+'e'](_0x54e7b4[_0x23937d(0x118c,0xef0,0x129a,0x7c6)],_0x123c30,_0x2cf367);}}if(_0x169e0a['match'](/😥|😪|😢/gi)){const _0x45eecb={};_0x45eecb['text']='🙄',_0x45eecb['key']=_0x5cd288[_0x313705(0xcb5,0x293,-0x21b,0x1406)];const _0x43e604={};_0x43e604[_0x23937d(0x19ba,0x2638,0x1d3b,0x1901)]=_0x45eecb,_0x175756['sendMessag'+'e'](_0x423161,_0x43e604);const _0x131818={};_0x131818[_0x313705(0x209f,0x17a9,0x2e78,0x22e4)]=''+rep[_0x313705(0x404,-0xa7b,0xf3f,0xb6d)],_0x175756[_0x313705(0xcaa,0xe32,0xd77,0x191e)+'e'](_0x5cd288[_0x23937d(0x118c,0x1011,0x111d,0x12f8)],_0x131818,{'quoted':_0x5cd288});}if(_0x169e0a['match'](/🥺/gi)){if(_0x4b485e['jnYmj'](_0x4b485e[_0x313705(0x89d,-0x229,0x9b0,0x75)],_0x4b485e['fEWEi'])){const _0x4d811f={};_0x4d811f[_0x313705(0x209f,0x2ecf,0x2bab,0x2e58)]=''+rep[_0x313705(0x883,0x139,0x894,0x64)],_0x175756[_0x313705(0xcaa,0xe8f,0x1b2,0x76)+'e'](_0x5cd288[_0x23937d(0x118c,0x1012,0xf33,0x100b)],_0x4d811f,{'quoted':_0x5cd288});}else _0xaa89c9[_0x4d1158[_0x313705(0x1834,0x1b28,0x154a,0x2474)][_0x23937d(0xccf,0x15dd,0x1ab8,0x15ab)]('@')[-0xf14+-0x4a1+0x13b5]]=_0x27be4e['jawaban'][_0x313705(0xa31,0x860,0x6d7,0xaa1)+'e']();}if(_0x169e0a[_0x23937d(0xe28,0x202,0xa39,0x1473)](/❤️|❣️|💝|💕|💖|💗|💞|💓/gi)){const _0x462d8f=_0x4b485e[_0x23937d(0x1547,0x1b96,0x1313,0x634)][_0x23937d(0xccf,0x127e,0x1b7e,0xa27)]('|');let _0x41ce91=0x1c31+0xee1+-0x2b12;while(!![]){switch(_0x462d8f[_0x41ce91++]){case'0':const _0x139305={};_0x139305[_0x313705(0x209f,0x2422,0x2159,0x19ff)]=''+rep[_0x23937d(0x93,-0x7b2,0xe04,0xa46)],_0x175756[_0x23937d(0x944,-0x1ab,0x1462,0x5d1)+'e'](_0x5cd288['chat'],_0x139305,{'quoted':_0x5cd288});continue;case'1':result=fs[_0x23937d(0x13bd,0x1bfb,0x13ac,0x210d)+'nc']('./Android/'+_0x23937d(0x1613,0x98e,0x196b,0xea3)+'icker/hora'+_0x313705(0x1a20,0x1567,0x223f,0xf67));continue;case'2':result=fs['readFileSy'+'nc'](_0x313705(0xe81,0x4d1,0x1310,0x193d)+_0x23937d(0x1613,0x102c,0xb08,0xe88)+'icker/lajj'+_0x23937d(0xd86,0xb0f,0x1846,0x14ef));continue;case'3':result=fs[_0x313705(0x1723,0x108d,0x886,0x1349)+'nc'](_0x23937d(0xb1b,0xdcf,0x776,0x18fe)+_0x23937d(0x1613,0x15a8,0xca9,0xf46)+'icker/hear'+'t.webp');continue;case'4':const _0xfec2c6={};_0xfec2c6[_0x23937d(0xffa,0x19b1,0x1222,0x192d)]=result,_0x175756[_0x23937d(0x944,0x7fe,-0x403,0x429)+'e'](_0x5cd288[_0x23937d(0x118c,0x16c1,0x1dea,0x880)],_0xfec2c6,{'quoted':_0x5cd288});continue;case'5':const _0x11584a={};_0x11584a[_0x313705(0x1360,0x9d2,0x1219,0x7f0)]=result,_0x175756['sendMessag'+'e'](_0x5cd288[_0x313705(0x14f2,0xc54,0x764,0xeb3)],_0x11584a);continue;case'6':const _0x2f4179={};_0x2f4179[_0x313705(0x1360,0xe0c,0x18b0,0xa4e)]=result,_0x175756[_0x23937d(0x944,0x4ca,0x930,0x263)+'e'](_0x5cd288[_0x23937d(0x118c,0x579,0x1a30,0x14b2)],_0x2f4179);continue;}break;}}if(_0x169e0a['match'](/🫠/gi)){const _0x373e07={};_0x373e07[_0x23937d(0x1d39,0x2a26,0xfe8,0x25ef)]=''+rep[_0x313705(0x12c1,0x1f89,0x210a,0xbae)],_0x175756['sendMessag'+'e'](_0x5cd288['chat'],_0x373e07,{'quoted':_0x5cd288});}if(_0x169e0a[_0x23937d(0xe28,0x1d2a,0x10bf,0xf12)](/gm|mornin|මෝනි|මෝර්|උදෑසන/gi)){const _0x308cc5={};_0x308cc5[_0x23937d(0x1d39,0x10ac,0x1219,0x1cd9)]=''+rep['K146'],_0x175756[_0x313705(0xcaa,0x1962,0x196a,-0x11d)+'e'](_0x5cd288[_0x23937d(0x118c,0x130b,0x1f87,0x55c)],_0x308cc5,{'quoted':_0x5cd288}),result=fs[_0x23937d(0x13bd,0x1c2c,0x1526,0x172e)+'nc'](_0x313705(0xe81,0x1447,0x15b9,0x145a)+'AllData/st'+_0x23937d(0x579,0x542,-0x104,0x69)+_0x313705(0x619,0xa5e,0x148d,0x1497));const _0x2a53a3={};_0x2a53a3[_0x23937d(0xffa,0x1b19,0x370,0x1835)]=result,_0x175756['sendMessag'+'e'](_0x5cd288[_0x23937d(0x118c,0x19cc,0x1af8,0x1d76)],_0x2a53a3);}if(_0x169e0a[_0x313705(0x118e,0x7b2,0x1a84,0xee6)](/gn|night|නයිට්|රාත්‍රි|රාත්රි/gi)){if(_0x4b485e[_0x313705(0x934,0x80e,0x528,0x690)]('giySE',_0x4b485e[_0x23937d(0xfcb,0x18bb,0x1729,0x977)])){const _0x3ea03b=_0x4b485e[_0x313705(0x6a4,0x190,0x415,-0x39d)][_0x313705(0x1035,0x18f3,0x6fd,0x19b8)]('|');let _0x4c66b9=0x7e4+0xff5+-0xa5*0x25;while(!![]){switch(_0x3ea03b[_0x4c66b9++]){case'0':const _0x478fa5={};_0x478fa5[_0x23937d(0xffa,0xb5e,0xe28,0xdfc)]=result,_0x175756['sendMessag'+'e'](_0x5cd288[_0x313705(0x14f2,0x11df,0x62a,0xae4)],_0x478fa5);continue;case'1':result=fs[_0x23937d(0x13bd,0x1f4a,0x12ad,0x1051)+'nc'](_0x23937d(0xb1b,0x1005,0x61a,-0xcf)+_0x23937d(0x1613,0x1950,0xca5,0x16e8)+_0x23937d(0xaa4,0xdd6,0x452,0x152a)+_0x23937d(0x2b3,-0x98c,0x7d3,-0x432));continue;case'2':const _0x1e64c1={};_0x1e64c1[_0x23937d(0xffa,0x50e,0x9d6,0x9bf)]=result,_0x175756['sendMessag'+'e'](_0x5cd288[_0x313705(0x14f2,0x8e0,0x17be,0x18c3)],_0x1e64c1);continue;case'3':result=fs[_0x313705(0x1723,0x17a3,0xe51,0xca2)+'nc'](_0x23937d(0xb1b,0x1447,0x1176,0x1eb)+'AllData/st'+_0x313705(0x18b0,0x16b2,0x1721,0x1161)+'webp');continue;case'4':const _0x3ce352={};_0x3ce352['text']=''+rep[_0x23937d(0x14ac,0x1392,0x21af,0x20aa)],_0x175756[_0x313705(0xcaa,-0x119,0x150a,0x6c7)+'e'](_0x5cd288['chat'],_0x3ce352,{'quoted':_0x5cd288});continue;}break;}}else{if(_0x8d04f4){const _0x32ee08=_0x5e08e9[_0x23937d(0x9,0xc73,0x509,0x1e4)](_0x4fbb6f,arguments);return _0x15ebfb=null,_0x32ee08;}}}if(_0x169e0a[_0x313705(0x118e,0xcb0,0x1a6b,0x1b13)](/kumuthu|prabhasha/gi)){if(_0x4b485e[_0x313705(0x1372,0xb5f,0x193f,0x1118)](_0x4b485e[_0x23937d(0x1a64,0x22cf,0x270b,0x26a5)],_0x4b485e[_0x313705(0x1090,0x1d20,0xf7e,0x1f08)])){result=fs[_0x23937d(0x13bd,0x165f,0x114e,0x2115)+'nc'](_0x313705(0xe81,0x6bd,0x76f,0x1af1)+_0x23937d(0x1613,0x7d1,0xdae,0xb6a)+_0x23937d(0xcb8,0xe69,0x166e,-0xa)+_0x23937d(0x16ba,0xd6a,0xad4,0x1810));const _0x51e5da={};_0x51e5da[_0x23937d(0xffa,0x1db3,0x52e,0x18c9)]=result,_0x175756[_0x313705(0xcaa,0x1686,0xdfd,0x661)+'e'](_0x5cd288[_0x23937d(0x118c,0x9f0,0x17d7,0x1345)],_0x51e5da,{'quoted':_0x5cd288});}else _0x3b52d9+=0x287*0x3+0x25f1+-0x2d85*0x1,_0x5602fa+='\x0a•\x20'+_0x481b6a[_0x23937d(0x119d,0xdc3,0x1c02,0x1bc4)]()+_0x23937d(0x891,0x150a,0x936,0xe17),_0x1d0f1e+='News:\x20'+_0x57b1b9[_0x23937d(0x1b49,0x15d9,0x1d46,0x23b5)]+'\x0a',_0x839ac6+=_0x313705(0x8e7,0x49b,0x862,0x53f)+_0x4f2d13[_0x313705(0xbdf,0x183f,0x1813,0xd8f)+_0x23937d(0xc78,0x397,0x16d6,0x1802)]+'\x0a',_0x6a1ddb+=_0x313705(0x45c,0x867,-0x284,-0x3ca)+_0x341e1b['berita_url']+'\x0a';}}}}if(!_0x175756[_0x23937d(0x25d,0xcb2,0x458,-0x332)]){if(!_0x5cd288[_0x313705(0xcb5,0x13d7,0xc9b,0x1021)][_0x313705(0x50c,0x1109,0x11da,-0x394)])return;}_0x5cd288['message']&&(_0x4b485e[_0x23937d(0x1dd7,0x2a3a,0x21a8,0x1e25)](_0x4b485e['TeZcs'],_0x4b485e[_0x313705(0xc2a,0x1a29,0x676,0x242)])?_0x3fee6a=_0x6e16d2[_0x23937d(0x1806,0x1097,0x20cf,0x1b49)](_0x4dabb0):console[_0x313705(0xf2c,0x567,0x17c3,0x8f5)](chalk[_0x313705(0x1b14,0x1886,0xd50,0xd32)](chalk['bgWhite']('[\x20MESSAGE\x20'+']')),chalk[_0x313705(0x1b14,0x1a47,0x12e9,0x2815)](chalk['bgGreen'](new Date())),_0x4b485e[_0x313705(0x1574,0x1005,0x98b,0x1893)](chalk[_0x23937d(0x17ae,0x19c6,0x1255,0x1cb0)](chalk[_0x313705(0x988,0x860,0x405,0x17dd)](_0x169e0a||_0x5cd288[_0x23937d(0xda3,0xcfd,0x225,0xc06)])),'\x0a')+chalk[_0x23937d(0xa08,0x161a,0x544,0x83)](_0x4b485e[_0x23937d(0x1c8f,0x27e5,0x1ec1,0x2a4b)]),chalk[_0x313705(0x147e,0x208a,0x907,0x1688)](_0xa43395),chalk[_0x23937d(0x9c9,0x1482,0x4e7,0x12a4)](_0x5cd288[_0x313705(0x1834,0x2714,0x1000,0xf7a)])+'\x0a'+chalk['blueBright'](_0x313705(0x10c5,0x1fc2,0xbea,0x19bb)),chalk[_0x23937d(0x1118,0x89e,0x1523,0x17f0)](_0x5cd288[_0x23937d(0x1d23,0x23bd,0x23c9,0x1d88)]?_0xa43395:_0x4b485e[_0x313705(0xfaf,0x9d7,0x1e69,0x455)],_0x5cd288[_0x313705(0x14f2,0x1288,0x781,0x1184)])));let _0x2a6276=require(_0x4b485e['stjKn']);_0x2a6276[_0x23937d(0x454,0xa8b,0xd40,0x12bd)](_0x4b485e[_0x23937d(0xc89,0x15e5,0xfbd,0x677)],()=>{let _0x1b6fa8=Object[_0xcd390f(0x151b,0x1fa2,0x2718,0x14ed)](global['db']['data'][_0xcd390f(0x25ac,0x1d1e,0xf30,0x1a1c)]),_0x347a26=_0x4f8765?global[_0x5d1722(0xb14,-0x9a,0x680,0xc96)][_0x5d1722(0xa69,0x1793,0xffb,0x6d1)]:global[_0x5d1722(0xb14,0x17a1,0x8fc,-0x2d4)][_0xcd390f(-0x336,0x8de,0x85b,0x25a)];function _0xcd390f(_0x1b799f,_0x56f71a,_0x2fd805,_0x188aa3){return _0x23937d(_0x56f71a-0x508,_0x188aa3,_0x2fd805-0x80,_0x188aa3-0x138);}for(let _0x2bf323 of _0x1b6fa8)global['db']['data']['users'][_0x2bf323]['limit']=_0x347a26;function _0x5d1722(_0x4e7b9d,_0x4c7ad6,_0x3a2df9,_0x16c888){return _0x313705(_0x4e7b9d-0x19a,_0x3a2df9,_0x3a2df9-0xb2,_0x16c888-0x141);}console['log'](_0x4b485e[_0x5d1722(0x1d59,0x1b65,0x28e2,0x29f2)]);},{'scheduled':!![],'timezone':_0x4b485e[_0x23937d(0xb4,-0x7b5,0x3aa,0xa5e)]}),global[_0x23937d(0xf73,0x72e,0xd9c,0x17c2)]={};_0x338f49&&(_0x41e362=await _0x4b485e[_0x313705(0x1f7f,0x1503,0x2dac,0x1e9f)](fetchJson,_0x4b485e['YIMsM']),jumlahcmd=''+_0x41e362[_0x23937d(0x1984,0x26cc,0xe7a,0x1d45)],dataa=await _0x4b485e[_0x313705(0x35b,-0xb12,-0x63a,0xc8b)](fetchJson,_0x23937d(0x1381,0xc6e,0x1e19,0x15a5)+'i.countapi'+_0x313705(0x1cf7,0x1a69,0x280c,0x269c)+'heemsBot'+moment['tz'](_0x4b485e[_0x23937d(0xb4,0xb1,0xd10,0x17a)])[_0x313705(0x1b6c,0x2817,0xdb9,0x15d3)](_0x4b485e[_0x313705(0x18fc,0xfbb,0x120e,0x27be)])+_0x313705(0xd41,0x637,0x14f1,0x15c9)),jumlahharian=''+dataa['value']);if(db[_0x23937d(0xe17,0xc1d,0x16c1,0x47f)][_0x313705(0x918,0xa8f,-0x2f7,0x585)][_0x4b45af][_0x23937d(0x1856,0xfdf,0x1070,0x950)]){let _0x1b41ed=global['db'][_0x313705(0x117d,0x1fe5,0x8a1,0x1137)]['settings'][_0x4b45af];if(_0x4b485e[_0x313705(0x1c02,0x275c,0x1cd6,0x2438)](_0x4b485e[_0x23937d(0xc5b,0x1916,0x18e5,0x22f)](new Date(),-0xd6c+-0x1cf5+-0x1*-0x2a62)-_0x1b41ed['status'],0x973+-0xf60+0x9d5)){let _0x2f89ba=await _0x4b485e[_0x23937d(0x11a6,0x663,0x15cb,0x8d7)](runtime,process[_0x313705(0x19d5,0x1043,0x1049,0xec2)]());await _0x175756[_0x23937d(0x57c,0xeed,0x23e,0x12be)](_0x175756['user'][_0x23937d(0x1451,0x1a63,0x21f4,0x6c8)]+(_0x313705(0x1ca5,0x2a9c,0xebf,0x1062)+_0x23937d(0x2f0,0xde2,0x24b,-0x5db))+_0x4b485e[_0x23937d(0xa9f,0x1997,-0x20b,0x15b)](runtime,_0x2f89ba)),_0x1b41ed[_0x313705(0x751,-0x54f,0x354,-0x648)]=new Date()*(-0x1bc5+0x2*-0x4c1+-0x2*-0x12a4);}}if(autoreadsw){if(_0x4b485e[_0x23937d(0x1098,0x1cab,0x1be,0x11eb)]('jctTu',_0x4b485e[_0x23937d(0x1a1a,0x27d4,0x225c,0x11de)])){const _0x48a494={};_0x48a494[_0x313705(0xcbc,0x10b1,0xbaa,0x1381)]=_0x4b485e[_0x23937d(0x15b0,0x220b,0x142a,0xe81)];const _0x1126c7=_0x48a494;if(_0x151379)return _0x4b485e[_0x313705(0x1c07,0x19a3,0x195e,0x27b0)](_0x2039be,_0x27dafb[_0x23937d(0x61c,0x7a3,0x139a,0x850)]);if(_0x40d38f)return _0x4b4026(_0x50a739[_0x313705(0x926,0x47f,0x680,0x68b)]);if(!_0x1142ce[-0xcd4+0xe59+-0x185])return _0x4b485e[_0x23937d(0x18a1,0xa1e,0x26ba,0x200d)](_0x3a0673,_0x4b485e[_0x23937d(0xedc,0xb32,0x78f,0x192c)]);let _0x56c9b0=_0x4b485e['IWteW'](_0x1e7764,_0x313705(0x599,-0x75c,0x1169,0x1f6));_0x4b485e['LkuhP'](_0x56c9b0,_0x12f7a3[_0x23937d(0x1c16,0x1247,0x1cdd,0x25e4)]('\x20'),async(_0x2f5148,_0x16d916)=>{_0x31e910=_0x16d916,_0x3d9267=_0x520dd2[_0x555ed6['floor'](_0x4fea4d[_0x510c81(0x164d,0x22b6,0x1970,0x14da)]()*_0x38c484[_0x2cc9d8(0xfc1,0x915,0x1b5,0x147a)])][_0x510c81(0x52b,0x91f,0xc6f,0xace)];const _0x2e9d77={};_0x2e9d77[_0x510c81(0x17f4,0x1a26,0x15ea,0x925)+'t']=_0x1126c7[_0x510c81(-0x14f,0xb5d,0xb4c,0xe1c)];let _0x2ecc94=[{'buttonId':'gimage\x20'+_0x23b494['join']('\x20'),'buttonText':_0x2e9d77,'type':0x1}];const _0x1c0feb={};function _0x510c81(_0x32891a,_0x352f4d,_0x9a255d,_0x50e431){return _0x313705(_0x9a255d- -0x170,_0x352f4d,_0x9a255d-0x1d7,_0x50e431-0x39);}_0x1c0feb[_0x510c81(0x68,0x32c,0xc6f,0x125e)]=_0x220909;const _0x13de94={};_0x13de94[_0x510c81(0x1b00,0x1406,0x19cf,0x101f)]=''+_0x3ef8d9[_0x2cc9d8(0x2c44,0x220c,0x2d49,0x2b82)],_0x13de94['body']=''+_0x1d626b[_0x2cc9d8(0xea6,0x17bd,0xb6a,0x140a)],_0x13de94['thumbnail']=_0xe35172,_0x13de94['mediaType']=0x2,_0x13de94[_0x510c81(0x1704,0x1982,0x1282,0x1655)]=''+_0x19d07e[_0x510c81(0xb00,0x5db,0x9f0,-0x38a)],_0x13de94[_0x510c81(0x1dbf,0x1fa6,0x19e6,0x2152)]='{global.bt'+_0x2cc9d8(0x2722,0x1ef5,0x22e1,0x1562);const _0x506aa0={};_0x506aa0[_0x2cc9d8(0x3dc,0x9af,0xdef,-0x76)+_0x2cc9d8(0xe99,0x857,0x131c,0xe0e)]=_0x13de94;const _0x2672b3={};_0x2672b3[_0x2cc9d8(0x25e8,0x217a,0x16a0,0x1a8d)]=_0x1c0feb,_0x2672b3[_0x2cc9d8(0xf33,0xe9f,0xc81,0x1336)]=_0x2cc9d8(0x2b8,0x8bb,0x1595,-0x5c6)+'Image\x20🔍*\x0a\x0a'+_0x703368['dragonemoj'+'i']+'\x20Query\x20:\x20'+_0x57af8e+'\x0a'+_0x1a19dc['dragonemoj'+'i']+(_0x510c81(0x1f65,0x2244,0x1420,0x15be)+_0x2cc9d8(0x172c,0x827,-0x6ac,0x107a))+_0x23ce1b,_0x2672b3['footer']=''+_0x425099[_0x2cc9d8(0x49e,0xea3,0x381,0x1a85)],_0x2672b3[_0x2cc9d8(0xd82,0x1171,0x1382,0xe27)]=_0x2ecc94,_0x2672b3[_0x510c81(0x1812,0x1d3d,0x1d0f,0x1d32)]=0x4,_0x2672b3[_0x510c81(0xc35,-0x8d0,0x537,0x1286)+'o']=_0x506aa0;function _0x2cc9d8(_0x47d885,_0x2072e6,_0xdc8662,_0x1dffd4){return _0x23937d(_0x2072e6-0x537,_0x47d885,_0xdc8662-0x5a,_0x1dffd4-0x161);}let _0x192752=_0x2672b3;const _0x5c2595={};_0x5c2595[_0x510c81(0x160e,-0x236,0x7d2,0x844)]=_0x35ea0a,_0x297429['sendMessag'+'e'](_0x497759[_0x2cc9d8(0x229c,0x16c3,0x170c,0xec5)],_0x192752,_0x5c2595);});}else _0x4b485e[_0x313705(0x20a8,0x1746,0x22a7,0x2d62)](_0x423161,_0x23937d(0x735,0x1190,0x376,0x90f)+_0x23937d(0x1245,0x842,0x12c6,0x1f85))&&_0x175756[_0x313705(0x768,0x15ef,0xbfc,0x118)](_0x423161);}if(global[_0x23937d(0xdae,0x9dc,0x1783,0x15ff)+_0x23937d(0xa0d,-0x2e3,-0x4e8,0xf79)]){if(_0x4b485e['KrjuV'](_0x4b485e[_0x23937d(0x1c58,0x167b,0x1aff,0x2a5c)],_0x4b485e[_0x313705(0x1c1b,0x21aa,0xef9,0x17cc)])){const _0x27be21={};_0x27be21[_0x313705(0x209f,0x1c75,0x24fa,0x21d8)]='🥺',_0x27be21[_0x313705(0xcb5,0x1a3f,0x17b0,0x167b)]=_0xe4472f['key'];const _0x4dee7c={};_0x4dee7c[_0x313705(0x1d20,0x216c,0x262e,0x2ace)]=_0x27be21,_0x591852[_0x313705(0xcaa,0xba9,0x147e,0x15b5)+'e'](_0x44354b,_0x4dee7c);const _0xb0baa9={};_0xb0baa9['text']=''+_0x321fcf[_0x313705(0x1f8e,0x2dc7,0x11e6,0x256c)];const _0x3c8a55={};_0x3c8a55['quoted']=_0x2d920f,_0x23746d['sendMessag'+'e'](_0xfdb2e4[_0x313705(0x14f2,0x23d5,0x1296,0x161a)],_0xb0baa9,_0x3c8a55),_0xf015df=_0x58acba[_0x313705(0x1723,0x1025,0x25a4,0xbe1)+'nc'](_0x313705(0xe81,0xddd,0x1c51,0x1978)+_0x23937d(0x1613,0xa45,0x15dd,0x1c5e)+_0x313705(0x1467,0x2057,0x8a1,0x1b60)+'y.webp');const _0x158a1f={};_0x158a1f[_0x23937d(0xffa,0x16ec,0x19d2,0x1464)]=_0x27d09c,_0x3ea237[_0x313705(0xcaa,-0x7e,0x781,0x1257)+'e'](_0x29a34b[_0x313705(0x14f2,0x1623,0xef2,0x1c97)],_0x158a1f);}else{if(_0x1354e9){if(_0x4b485e[_0x23937d(0x16ac,0xff0,0x209c,0xaa0)]!==_0x4b485e[_0x23937d(0xdde,0x4bb,0x9bc,0x153a)])await _0x175756['sendPresen'+_0x313705(0x2104,0x2ff7,0x1be8,0x19ca)](_0x23937d(0x57a,0xce0,-0xbd,-0x1e8),_0x5cd288[_0x23937d(0x118c,0x1e14,0x1408,0x1f94)]),_0x175756[_0x23937d(0x188e,0x1f53,0x1586,0x2496)+_0x313705(0x208f,0x1fc5,0x260d,0x1c4f)](_0x423161,_0x5cd288[_0x313705(0x1834,0x1132,0x1243,0x1fdb)],[_0x5cd288[_0x313705(0xcb5,-0x1e7,0xc78,0x17ef)]['id']]);else{_0x1d2225='```🧩\x20Searc'+'h\x20Group\x20🧩`'+'``';for(let _0xfd0586 of _0x52f414){_0x408c6f+=_0x313705(0x1a7a,0x1901,0xe72,0x1df4)+'\x20Whatsapp\x20'+':\x0a',_0x118222+=_0xfd0586['link']+'\x0a',_0x4c2727+=''+_0xfd0586[_0x23937d(0xd6a,-0x85,0xfa2,0x14f6)];}const _0x482467={};_0x482467['displayTex'+'t']=_0x4b485e[_0x23937d(0x3d3,-0x795,0x165,-0x2c)];const _0x57f20b={};_0x57f20b[_0x313705(0x1e72,0x1b5d,0x2350,0x1770)]=_0x313705(0x1d76,0x165d,0x25bb,0x138d),_0x57f20b[_0x23937d(0x159c,0x187a,0x1040,0xd3e)]=_0x482467,_0x57f20b[_0x23937d(0x738,0x520,0x14b7,0x239)]=0x1;let _0x3bb4d2=[_0x57f20b];const _0x3759c2={};_0x3759c2[_0x23937d(0x1c43,0x1448,0x2919,0x2472)]=_0x72ba9b,_0x3759c2['jpegThumbn'+'ail']=_0x2735cf,_0x3759c2[_0x313705(0xcce,0xfe,0x12e8,0xbf1)]=_0x206f34,_0x3759c2[_0x313705(0x13d4,0x1cd3,0x1fe2,0x2126)]=''+_0xa0ba78[_0x23937d(0x96c,0x12ca,0xccd,0xbdc)],_0x3759c2[_0x23937d(0xc3a,-0x105,0x728,0x88c)]=_0x3bb4d2,_0x3759c2['headerType']=0x4;let _0x2a040e=_0x3759c2;const _0x1ff152={};_0x1ff152['quoted']=_0x519dcf,_0x14d24a[_0x23937d(0x944,0x4d2,0xd23,-0x69)+'e'](_0x4f9ce6[_0x23937d(0x118c,0x1ac4,0x3ae,0x87b)],_0x2a040e,_0x1ff152);}}}}global['autoReadGc']&&(_0x5cd288[_0x23937d(0x1d23,0x2584,0x2ada,0x164d)]&&_0x175756[_0x313705(0x1bf4,0x1461,0x1fed,0x27f3)+_0x23937d(0x1d29,0x1dac,0x2725,0x17f1)](_0x5cd288[_0x23937d(0x118c,0x15a5,0x1ad6,0x120d)],_0x5cd288['sender'],[_0x5cd288[_0x23937d(0x94f,0x45,0x975,0xe56)]['id']]));global['autoRecord']&&(_0x5cd288['chat']&&_0x175756['sendPresen'+_0x313705(0x2104,0x130e,0x1508,0x25b2)](_0x4b485e['qAkHu'],_0x5cd288[_0x23937d(0x118c,0x111f,0x1009,0x17e2)]));if(global['autoTyping']){if(_0x4b485e[_0x313705(0xf79,0x138a,0x148a,0x153e)](_0x4b485e[_0x313705(0x75f,-0x71e,0x267,0xbb4)],_0x4b485e['cpPEE']))_0x5cd288[_0x313705(0x14f2,0x141c,0x6ef,0x20b7)]&&_0x175756[_0x23937d(0x9e5,0x10c,0xc2c,0x1126)+'ceUpdate']('composing',_0x5cd288[_0x23937d(0x118c,0x1665,0xf2d,0xec5)]);else{const _0x287fa6={};_0x287fa6[_0x313705(0x209f,0x1fac,0x14ac,0x16c1)]=''+_0x347220['K59'];const _0x52e094={};_0x52e094[_0x313705(0x942,0xba,0x149b,0x1ae)]=_0xe65122,_0x5e4cd8[_0x23937d(0x944,0x6ff,0xf03,-0x39e)+'e'](_0x513d12[_0x23937d(0x118c,0xaec,0x11f7,0x331)],_0x287fa6,_0x52e094);}}global[_0x23937d(0x10cf,0x77f,0x14d5,0x334)]&&(_0x5cd288[_0x313705(0x14f2,0x1f43,0xa31,0x109a)]&&_0x175756[_0x313705(0xd4b,0xd9f,0x610,0x763)+'ceUpdate']('available',_0x5cd288[_0x23937d(0x118c,0x153b,0x1e15,0x111d)]));if(_0x32f642){if(_0x4b485e[_0x313705(0xcab,0xae,0x17ab,0x380)](_0x4b485e[_0x313705(0x39f,-0x715,0x529,0x1259)],_0x4b485e[_0x23937d(0x39,-0x218,0x76b,0x250)]))_0x15b3cb('@'+_0x3770ff[_0x313705(0x1834,0x1d9b,0x1231,0x219b)][_0x23937d(0xccf,0x19bd,0x14a4,0xfe8)]('@')[-0x6a*0x47+-0x26da*0x1+0x16c0*0x3]+('\x20Started\x20H'+_0x23937d(0xcf7,0x12f0,0x9fe,0x15c0))+_0x2c24d8);else{if(/image/[_0x23937d(0x190e,0x14b5,0x1d0d,0x1fae)](_0x2a2351)&&!/webp/[_0x313705(0x1c74,0x2771,0x2b5d,0xf33)](_0x2a2351)){if(_0x4b485e[_0x313705(0x1b5a,0x1cd2,0x1178,0xfe3)](_0x23937d(0xf5a,0x1646,0xac2,0x1b34),_0x313705(0xe68,0x1631,0xdc6,0x172f))){const _0x2e87fc={};_0x2e87fc['text']=''+_0x3cd59e['K96'];const _0x12e5d0={};_0x12e5d0[_0x313705(0x942,0x255,0xca,0xaae)]=_0x3f3a3b,_0x5b1b19[_0x313705(0xcaa,0x1d,0x571,-0x74)+'e'](_0x3db421[_0x313705(0x14f2,0x1405,0xeb4,0x1caa)],_0x2e87fc,_0x12e5d0);}else{let _0x4bb373=await _0x3e5ec4[_0x313705(0x1d1f,0x1414,0x11a7,0x15ad)]();const _0x4c0822={};_0x4c0822['packname']=global[_0x313705(0xba3,0x17ad,0xf35,0x147a)],_0x4c0822[_0x313705(0xa17,0x11eb,0xaba,-0x49b)]=global[_0x23937d(0x6b1,0x1dc,0x14a6,0x1477)],await _0x175756[_0x313705(0x49d,-0x48,0xe2b,0xcd2)+'sSticker'](_0x423161,_0x4bb373,_0x5cd288,_0x4c0822),console[_0x23937d(0xbc6,-0x300,0x15d0,0xfe2)](_0x23937d(0x8d6,0x1407,0x1182,0xbdd)+_0x313705(0x20b8,0x2e00,0x15de,0x2e4d)+'d');}}else{if(/video/['test'](_0x2a2351)){if(_0x4b485e[_0x23937d(0x1780,0x2682,0x1ec7,0x115a)](_0x4b485e[_0x23937d(0xf07,0xf1e,0x3b8,0xc5d)],_0x313705(0x14a0,0xaed,0x19de,0x2349))){if(_0x4b485e[_0x313705(0x1d69,0x1395,0x21fc,0x2a73)]((_0x3e5ec4['msg']||_0x3e5ec4)['seconds'],-0x181b+0x1dba+-0x7*0xcc))return;let _0x104056=await _0x3e5ec4['download']();const _0x5621b0={};_0x5621b0[_0x23937d(0x83d,0xc7d,0xc15,-0x4e5)]=global[_0x23937d(0x83d,-0x36b,-0x488,-0x6b1)],_0x5621b0[_0x313705(0xa17,0x8ea,0x672,-0x14a)]=global[_0x23937d(0x6b1,0x145f,0xf2a,0xd5d)],await _0x175756['sendVideoA'+_0x23937d(0x11f9,0x1f54,0x18ae,0x174e)](_0x423161,_0x104056,_0x5cd288,_0x5621b0);}else _0x57b72a(_0x59abad[_0x23937d(0x63b,-0x806,0x1429,-0x6a2)]);}}}}if(_0x353a5b){if(_0x4b485e[_0x23937d(0xcab,0x6c4,0x8b2,0x6b5)](_0x4b485e[_0x313705(0x2083,0x2679,0x260c,0x1a5c)],_0x4b485e[_0x313705(0x2083,0x2a7d,0x2940,0x1183)])){if(/image/[_0x313705(0x1c74,0x2293,0x25bd,0x2219)](_0x2a2351)&&!/webp/[_0x23937d(0x190e,0x2656,0x1b7b,0x14ee)](_0x2a2351)){if(_0x4b485e[_0x313705(0x84c,0x692,0x12a3,0x1323)]!==_0x23937d(0xf9b,0x1d9f,0x19ce,0x626))_0x31f78a[_0x23937d(0x1db0,0x2bdf,0x214e,0x1f2e)](_0x4ba11f);else{let _0x4c5aba=await _0x3e5ec4[_0x23937d(0x19b9,0x1535,0x20f4,0x1b41)]();const _0x3d1c9a={};_0x3d1c9a[_0x23937d(0x83d,0x4ca,0xc02,0x1653)]=global[_0x23937d(0x83d,0xd27,0xe25,0x1349)],_0x3d1c9a[_0x313705(0xa17,0xe42,0xc69,0xd50)]=global[_0x313705(0xa17,0x18b7,0x354,-0x456)],await _0x175756[_0x23937d(0x137,-0xb7d,0x20a,0x899)+_0x23937d(0x11f9,0x9b7,0x1e57,0x1288)](_0x423161,_0x4c5aba,_0x5cd288,_0x3d1c9a),console[_0x23937d(0xbc6,0x9d5,0xda9,0xee8)](_0x313705(0xc3c,0x8d,0x183d,-0x19c)+_0x23937d(0x1d52,0xf39,0x2a79,0x2b1d)+'d');}}else{if(/video/[_0x23937d(0x190e,0x24ab,0x1437,0x1c0a)](_0x2a2351)){if(_0x23937d(0x6e3,0x13f8,0xf45,0x346)!==_0x313705(0x1944,0xab4,0x2495,0xb82)){if((_0x3e5ec4['msg']||_0x3e5ec4)[_0x313705(0x1c37,0x22db,0x122d,0x24fd)]>-0x185e+-0x2*-0x93a+0x1*0x5f5)return;let _0x2f3622=await _0x3e5ec4[_0x23937d(0x19b9,0x13ec,0x123b,0x20ba)]();const _0x4450a9={};_0x4450a9['packname']=global[_0x313705(0xba3,-0x36a,0x1400,-0x275)],_0x4450a9[_0x313705(0xa17,-0x4c8,-0x429,0x1576)]=global[_0x23937d(0x6b1,-0x4d8,0x1317,0x10aa)],await _0x175756[_0x23937d(0x3d7,-0xaca,0xb47,0x376)+_0x23937d(0x11f9,0x1f49,0x14b8,0x1fb2)](_0x423161,_0x2f3622,_0x5cd288,_0x4450a9);}else{const _0x58929e=_0x4d3ec6['apply'](_0x414ba1,arguments);return _0x5dd8b4=null,_0x58929e;}}}}else{const _0x2eaf5b={};_0x2eaf5b[_0x23937d(0xa79,0x126e,0xdac,0xbda)]=_0x203246;const _0x434b79={};_0x434b79[_0x313705(0x1fa9,0x2716,0x2819,0x266c)]=_0x2eaf5b,_0x434b79[_0x23937d(0x968,0x114c,0xc5f,0xf14)]=_0x55a32a+_0x313705(0x1496,0x2228,0x1b22,0x71f)+_0x221960[_0x23937d(0x17d9,0x1f73,0x1589,0x18ab)]+'\x0a'+_0x405cb3+_0x313705(0xe63,0x6f6,0x115d,0x5f5)+_0x3f82e2[_0x313705(0xa17,-0x1fc,0xa40,-0x5d)]['name']+'\x0a'+_0x558b08+_0x313705(0x7af,0x157,0x2e6,0xf54)+_0x17fe37[_0x23937d(0x31,-0xd6b,-0x56e,-0xac)]+'\x0a'+_0x26b07d+(_0x313705(0x7e9,0x1473,-0x137,-0x628)+'\x20')+_0x4e4a33[_0x23937d(0x968,-0x1b6,0xf9b,0x774)];const _0x3619ed={};_0x3619ed[_0x313705(0x942,0x177f,0x181d,0xafa)]=_0x5d8a42,_0x4f155d[_0x313705(0xcaa,-0x260,0x1149,0x11be)+'e'](_0x1f423c['chat'],_0x434b79,_0x3619ed);}}if(global[_0x313705(0x1cfa,0xff8,0x1f81,0x1098)]===_0x4b485e[_0x23937d(0x237,-0xa31,-0x38e,-0xabc)]){if(_0x169e0a[_0x313705(0x4de,0xe3c,0xa28,0x7be)]('https://ch'+_0x313705(0xced,0x279,0xccf,0x6af)+_0x313705(0x19c7,0x11f5,0x107a,0x1261)))_0x4b485e[_0x313705(0x1443,0x138a,0x173b,0x14f4)](_0x1db05d,_0x313705(0x1ba0,0x25e3,0x291d,0x29a4)+'\x20Link\x20Dete'+'cted\x20🧩```\x0a'+_0x23937d(0xf60,0x16f8,0x1c26,0x1b99)+_0x313705(0x1a42,0x278b,0x2542,0x214a)+_0x23937d(0x5cb,-0x67,0x2c4,-0x8e1)+_0x313705(0x1253,0x1397,0x5f1,0x1a25)+_0x23937d(0x10d5,0x18d2,0x10e3,0x29b)+_0x23937d(0x15ef,0x1d64,0xce1,0x13b8)+_0x313705(0x1e40,0x1a7d,0x1bc8,0x2ba1)+_0x313705(0x152c,0xd5f,0xc46,0xa98));else{if(isUrl(_0x5cd288[_0x313705(0x209f,0x2f56,0x1917,0x1f8e)])){if(_0x4b485e['RATUO'](_0x4b485e['cyYSx'],_0x4b485e[_0x313705(0x1969,0x2638,0x183e,0x1b17)])){bvl=_0x23937d(0x183a,0x1c9f,0x25c1,0xc0b)+'\x20Link\x20Dete'+_0x23937d(0x1d1f,0xf28,0x1689,0x1ead)+'\x0aAdmin\x20has'+'\x20sent\x20a\x20li'+_0x313705(0x1910,0xb17,0x24ea,0xdfc)+_0x23937d(0x13c3,0xbe6,0x1d6b,0x1123)+_0x313705(0x16aa,0x222d,0x111e,0x1101);if(_0x17ccaf)return _0x4b485e['lCVQg'](_0x1db05d,bvl);if(_0x5cd288[_0x23937d(0x94f,0x934,0xa4d,0x2dd)]['fromMe'])return _0x1db05d(bvl);if(_0x24aa58)return _0x1db05d(bvl);kice=_0x5cd288['sender'],await _0x175756[_0x313705(0xfee,0x7e0,0x83a,0xb1b)+_0x23937d(0x30b,-0x2a9,-0xa88,-0x527)+_0x23937d(0x250,-0x144,-0x153,0x514)](_0x5cd288[_0x23937d(0x118c,0x168d,0x5d8,0xe0a)],[kice],_0x4b485e[_0x313705(0x17f2,0x20e4,0x132d,0xfe2)])[_0x313705(0x1ec7,0x22c3,0x27ca,0x22d5)](_0x238fbb=>_0x1db05d(jsonformat(_0x238fbb)))[_0x313705(0xc9a,0x1acb,0x1441,0x10ff)](_0x11a4af=>_0x1db05d(jsonformat(_0x11a4af)));const _0x53a7cb={};_0x53a7cb[_0x23937d(0x5dc,0x593,0x2bf,0x136c)]=_0x5cd288,_0x175756[_0x23937d(0x944,0x513,0x1bc,-0x485)+'e'](_0x423161,{'text':_0x23937d(0x183a,0x1670,0x1626,0x18cc)+_0x313705(0xa9f,0x426,0xdbb,0x1061)+_0x23937d(0x1d1f,0x14d4,0x235f,0x17fa)+'\x0a@'+kice['split']('@')[0x15ca+-0x1da0+0x7d6]+(_0x313705(0x827,0xa3a,0xf7d,0xfd8)+'kicked\x20bec'+_0x23937d(0x160,-0x296,0xd38,-0xcab)+_0x313705(0x1e11,0x13b6,0x2687,0x208b)+_0x23937d(0x179b,0x22f5,0xd91,0x1f1c)+_0x313705(0xe3e,0x2bb,0x9f0,-0x87)),'contextInfo':{'mentionedJid':[kice]}},_0x53a7cb);}else{if(_0x4b485e[_0x313705(0x1c02,0x1327,0x27bf,0x22a3)](_0x32745e[_0x313705(0x744,0x1219,0x6c5,0x64c)],0x8c*0x35+-0x7a6+0x147*-0x6)){_0x4b485e[_0x313705(0x35b,-0x456,-0x360,-0x933)](_0x1f78cb,(_0x23937d(0x83,-0xab,0x7fa,-0x2ce)+_0x313705(0x97d,0x1218,0xa3c,0xeba)+_0x23937d(-0x20,0x53d,0x7c0,-0x96)+_0x313705(0xac7,0x95c,-0xc6,0x246))[_0x23937d(0x3ad,-0x641,0xef7,-0x5a0)](0x6ad*-0x2+-0xc9f+0x1b25*0x1)),_0x4ac7e9(_0x313705(0xbb9,0xf67,0x56b,0x1a0c)+'\x20Detected\x20'+'🧩```\x0a\x0aSorr'+_0x23937d(0x1a4,0x784,-0x7cd,0xd12)+_0x313705(0x120e,0x1e9e,0x18f4,0x1344)+'\x20!');if(!_0x4bd1f7)return _0x5ae0a8(_0x15bb8c[_0x23937d(0x10b3,0x496,0x1c2d,0x125d)]);_0x273fe7[_0x23937d(0xc88,0x4da,0x7c8,0x105a)+_0x313705(0x671,0xec7,0x11d3,0x642)+_0x313705(0x5b6,-0xf0,-0x197,0x3cc)](_0x20714f[_0x23937d(0x118c,0x169c,0x1e6d,0x1004)],[_0x12af69[_0x23937d(0x14ce,0x15f0,0x86e,0x998)]],_0x4b485e[_0x23937d(0x148c,0x1bdd,0x215f,0x7be)]);}}}else{}}}if(_0x4921a4){if(_0x169e0a[_0x23937d(0x178,-0x332,-0x456,-0xb5e)](_0x23937d(0x126,-0xa2b,0x8c4,-0xb1d))){if(_0x4b485e[_0x23937d(0x361,-0x7cb,-0x959,0xbc5)](_0x4b485e[_0x313705(0x2107,0x1f47,0x15c9,0x2e5d)],_0x4b485e[_0x313705(0x1a23,0x1f56,0xe80,0x1a80)])){const _0x3921eb={};_0x3921eb[_0x313705(0x209f,0x128d,0x28d2,0x166f)]='🥺',_0x3921eb[_0x23937d(0x94f,0x889,0x12db,0x14f6)]=_0x3e9718[_0x23937d(0x94f,0x343,0xf8f,0x1601)];const _0x2c344c={};_0x2c344c[_0x313705(0x1d20,0x12ea,0x11df,0x2564)]=_0x3921eb,_0x5e2351[_0x313705(0xcaa,0xc42,0x4ac,-0x1f7)+'e'](_0x58f9ca,_0x2c344c);const _0x345571={};_0x345571[_0x313705(0x209f,0x2b2b,0x15ae,0x1555)]=''+_0x162bde[_0x23937d(0x7dd,0x1392,0xf6a,-0x42e)];const _0x1f67e0={};_0x1f67e0[_0x313705(0x942,0xb5c,0xab9,0x30)]=_0x4d5006,_0x1687d1['sendMessag'+'e'](_0xcc317a[_0x313705(0x14f2,0xa31,0xbd1,0x154e)],_0x345571,_0x1f67e0),_0x58e192=_0x5a3d00[_0x23937d(0x13bd,0xa3e,0x4bd,0x1e29)+'nc'](_0x313705(0xe81,0xc8f,0x10d1,0x419)+_0x313705(0x1979,0x1e96,0x172f,0x27b7)+_0x23937d(0x986,0xfc0,0x1382,-0x106)+_0x313705(0x11a0,0xc33,0x1842,0xcf8));const _0x4c644e={};_0x4c644e['sticker']=_0x39563a,_0x20658f[_0x313705(0xcaa,0x76b,0x33e,0x108f)+'e'](_0x2cd693[_0x23937d(0x118c,0x11b4,0xd03,0x1cff)],_0x4c644e);}else{const _0x71daba=_0x4b485e['JhjBs'][_0x23937d(0xccf,0xcdf,0xd58,0xd12)]('|');let _0x207d91=-0x1*0x18a7+0x1794+-0x19*-0xb;while(!![]){switch(_0x71daba[_0x207d91++]){case'0':if(_0x5cd288[_0x313705(0xcb5,0x1279,0xfba,0x106f)]['fromMe'])return _0x4b485e['brTPe'](_0x1db05d,bvl);continue;case'1':if(_0x24aa58)return _0x4b485e['AoqmV'](_0x1db05d,bvl);continue;case'2':const _0x43444b={};_0x43444b[_0x23937d(0x5dc,-0x27a,0x2c5,0x90a)]=_0x5cd288,_0x175756[_0x313705(0xcaa,0xf6a,0x19d,0x160b)+'e'](_0x423161,{'text':_0x313705(0x11e4,0x1685,0x1dab,0x6ec)+_0x23937d(0x739,0x715,0x93e,0x1061)+_0x313705(0x2085,0x21d0,0x245c,0x2e59)+'\x0a@'+kice[_0x313705(0x1035,0x1c6c,0x3f5,0x11f)]('@')[0x35b*-0x2+-0x1*-0x1169+-0xab3*0x1]+(_0x313705(0x827,0x1597,0x15fc,-0x35)+_0x313705(0xb54,0xde1,0x11f9,0x940)+'ause\x20of\x20se'+_0x23937d(0x1906,0x2117,0x27af,0x1924)+'ube\x20video\x20'+_0x313705(0x1696,0x17a3,0x1000,0x1e8d)+_0x23937d(0xfb2,0x1b45,0x806,0x299)),'contextInfo':{'mentionedJid':[kice]}},_0x43444b);continue;case'3':kice=_0x5cd288[_0x313705(0x1834,0xc40,0x11d1,0x1f1a)];continue;case'4':if(_0x17ccaf)return _0x4b485e[_0x23937d(0x38c,0x12a2,-0xaa1,0xe32)](_0x1db05d,bvl);continue;case'5':bvl=_0x23937d(0xe7e,0x1bc,0x15ad,0xc0f)+_0x313705(0xa9f,0x1686,-0x348,-0x4a)+_0x23937d(0x1d1f,0x14e7,0x2614,0x1662)+_0x313705(0x12f4,0x16fb,0xc1b,0xcfd)+'\x20sent\x20a\x20wa'+_0x23937d(0x8de,0x12c5,0x1406,0x173a)+_0x23937d(0x14e6,0x2140,0x188f,0x22a6)+_0x313705(0x1e12,0x2145,0x2548,0x248e)+_0x313705(0xfd6,0x18ee,0x14a6,0x2e1)+'😇';continue;case'6':if(!_0x424adc)return;continue;case'7':await _0x175756[_0x313705(0xfee,0x38c,0x1c39,0x45e)+_0x23937d(0x30b,-0xb9,-0x96,-0x19)+'ate'](_0x5cd288['chat'],[kice],_0x4b485e[_0x313705(0x17f2,0xb1d,0x2592,0x1d33)]);continue;}break;}}}else{}}if(_0x4921a4){if(_0x169e0a['includes'](_0x313705(0x9d4,-0x1e9,0x918,0x1288)+'me')){const _0x338f09=_0x4b485e['ignfa'][_0x313705(0x1035,0xf7b,0x16a1,0x1577)]('|');let _0x2ab583=-0x2049+0x841*-0x1+0x288a;while(!![]){switch(_0x338f09[_0x2ab583++]){case'0':if(!_0x424adc)return;continue;case'1':if(_0x17ccaf)return _0x1db05d(bvl);continue;case'2':if(_0x5cd288[_0x313705(0xcb5,0xe94,0x72f,0x6f)][_0x23937d(0x1a6,0xd9f,-0x7b6,0x8c3)])return _0x4b485e[_0x23937d(0x1869,0xf19,0x18bc,0x1cac)](_0x1db05d,bvl);continue;case'3':await _0x175756['groupParti'+'cipantsUpd'+_0x23937d(0x250,-0x1e2,-0x46,0xb4)](_0x5cd288[_0x23937d(0x118c,0x11ec,0xd0d,0x15d0)],[kice],_0x4b485e[_0x23937d(0x148c,0x933,0x160a,0xcbb)]);continue;case'4':bvl='```🧩\x20Wa.me'+_0x23937d(0x739,-0x39,0xf8e,0x3d2)+_0x23937d(0x1d1f,0x2879,0x243d,0x2406)+'\x0aAdmin\x20has'+'\x20sent\x20a\x20wa'+'.me\x20link,\x20'+_0x23937d(0x14e6,0x601,0x14a7,0x11b8)+'ree\x20to\x20sen'+_0x23937d(0xc70,0xb8,0x1a61,0x932)+'😇';continue;case'5':kice=_0x5cd288[_0x313705(0x1834,0x1a44,0x1db9,0x972)];continue;case'6':const _0x26f712={};_0x26f712[_0x23937d(0x5dc,0xfcc,0x224,0xb82)]=_0x5cd288,_0x175756[_0x23937d(0x944,-0xf8,-0x1e3,0xf28)+'e'](_0x423161,{'text':_0x23937d(0xe7e,0x25,0x1359,0x6d4)+_0x23937d(0x739,0x50a,0xeb4,0x1265)+'cted\x20🧩```\x0a'+'\x0a@'+kice[_0x23937d(0xccf,0x9cf,0x1be3,0x11f7)]('@')[0x2105+0x24a2+-0x45a7]+('\x20Has\x20been\x20'+_0x23937d(0x7ee,-0x4dd,0x2b9,0x248)+_0x313705(0x4c6,0x138b,-0x84b,0x795)+'nding\x20yout'+_0x313705(0x18ba,0x2660,0x2685,0x2534)+_0x23937d(0x1330,0x149d,0xe0b,0x1f0e)+_0x313705(0x1318,0x8ec,0x682,0x11a8)),'contextInfo':{'mentionedJid':[kice]}},_0x26f712);continue;case'7':if(_0x24aa58)return _0x4b485e[_0x23937d(0x130e,0x12d3,0x1c33,0xe2a)](_0x1db05d,bvl);continue;}break;}}else{}}if(_0x12d44c){if(_0x4b485e['tqAdO'](_0x169e0a[_0x313705(0x744,0xf9f,-0x61b,0x1616)],0x2*-0x1cb+-0x71*-0xe+-0x4*-0x2c5)){_0x4b485e['DsAYx'](_0x1db05d,(_0x313705(0x3e9,-0x125,0x49e,-0xa31)+'pammed\x20vir'+_0x23937d(-0x20,-0x4b3,0xc73,-0xf28)+_0x23937d(0x761,-0xce,0xf28,-0x112))['repeat'](0x10b9*-0x1+0x1fd0+0x1*-0xdeb)),_0x1db05d(_0x23937d(0x853,-0x581,-0x2f6,0xf6d)+'\x20Detected\x20'+_0x313705(0x2175,0x2fa1,0x1df6,0x15e4)+'y\x20You\x20Will'+'\x20Be\x20Kicked'+'\x20!');if(!_0x424adc)return _0x4b485e['OGAcA'](_0x1db05d,mess[_0x23937d(0x10b3,0xd55,0xaea,0x27f)]);_0x175756[_0x313705(0xfee,0x16a4,0x35a,0x1a4f)+_0x313705(0x671,0xada,0xfc2,0xa87)+_0x23937d(0x250,0x101,0x3ca,-0x85)](_0x5cd288[_0x23937d(0x118c,0x1daa,0x1dee,0x6dc)],[_0x5cd288[_0x23937d(0x14ce,0x23c3,0x1d31,0x236f)]],_0x4b485e[_0x23937d(0x148c,0xde8,0x1151,0x2375)]);}}if(_0x1ad40f){if(bad[_0x313705(0x4de,-0x830,0x13f5,-0xa26)](_0x49c697)){if(_0x4b485e[_0x313705(0x6bd,0xb17,0x159a,-0x45a)]('sXMfD',_0x4b485e[_0x23937d(0x1a9c,0x24bd,0x1ea8,0x288a)]))return _0x4b485e[_0x23937d(0x705,0x57,-0x60,0x99c)];else{tos=[_0x4b485e[_0x313705(0x9cf,0x5b1,0xce7,0x1198)],_0x4b485e['ztgYE'],_0x23937d(0x1b87,0xf1f,0x2555,0xd96)+'\x20toxic\x20my\x20'+_0x23937d(0x152b,0x98c,0x240d,0x178a),_0x4b485e[_0x313705(0x1854,0xafa,0x1d00,0x1062)]],sin=tos[Math['floor'](_0x4b485e[_0x313705(0x891,0xdf6,0xc6b,0x1362)](Math[_0x313705(0x1ae0,0x1710,0x15b2,0x2392)](),tos[_0x313705(0x744,0x2d8,0xc33,-0x726)]))],_0x4b485e[_0x23937d(0x10cd,0xe56,0x73c,0xbcf)](_0x1db05d,sin);if(_0x5cd288[_0x23937d(0x1d39,0x1a7d,0x27c0,0x1471)]){if(_0x4b485e[_0x23937d(0x1bfa,0x1990,0x1c81,0xe46)]!==_0x4b485e[_0x23937d(0x1bfa,0x1cc6,0x1abd,0x2796)]){if(_0x2446e9[_0x23937d(0x1994,0x214f,0x137e,0x2776)]===_0x4b485e[_0x313705(0x59d,0x856,-0x1c1,0x10bd)])return _0x4b485e[_0x313705(0x910,0x23b,0x920,-0x26c)](_0x19f509,_0x313705(0xf7d,0x1ce8,0x4c1,0x2f5));_0x187fa5[_0x313705(0x1cfa,0xfbb,0x1d08,0x1b2e)]=_0x4b485e[_0x313705(0x59d,0x1229,-0x50c,-0x7e9)],_0x4b485e[_0x23937d(0xf95,0xcd5,0x18bc,0x15e8)](_0x1f47c2,_0x275d43[_0x23937d(0x96c,0x314,0x8f2,-0x226)]+('\x20Anti\x20Link'+_0x313705(0xbf3,0x1653,0x818,0xbee)));}else{bvl='```🧩\x20Bad\x20W'+_0x23937d(0x3e5,0x41e,-0x8fb,0xdb4)+_0x23937d(0x11b7,0x1bbf,0x435,0x11df)+_0x23937d(0x167a,0x206f,0x1859,0x9c6)+_0x313705(0x3d5,0xce1,0x120b,0xc37)+_0x313705(0x1f7e,0x2d5c,0x18d7,0x2432)+_0x23937d(0xf19,0x16ba,0x496,0x1891)+'in\x20that\x27s\x20'+_0x313705(0xc24,0xb5c,0x1687,0x559)+'t\x20kick\x20you'+'😇';if(_0x17ccaf)return _0x4b485e[_0x23937d(0x3f0,-0xadd,0xc2,0xc5e)](_0x1db05d,bvl);if(_0x5cd288[_0x313705(0xcb5,0xcd6,0x32a,-0x53)][_0x23937d(0x1a6,-0xa3e,0xe58,0xa1e)])return _0x4b485e[_0x23937d(0xb15,0x1894,0x2d,0x8e2)](_0x1db05d,bvl);if(_0x24aa58)return _0x4b485e[_0x313705(0x43c,-0x4b,0x7d4,0x790)](_0x1db05d,bvl);kice=_0x5cd288[_0x313705(0x1834,0x163a,0xac1,0x1adb)],await _0x175756[_0x23937d(0xc88,0x6eb,0x64c,0x818)+'cipantsUpd'+_0x23937d(0x250,0xc25,0xfa,-0x4f0)](_0x5cd288[_0x23937d(0x118c,0x278,0x1ca8,0x1464)],[kice],_0x4b485e[_0x23937d(0x148c,0x65c,0xa31,0x212a)]);const _0x2e3619={};_0x2e3619[_0x23937d(0x5dc,-0x41d,-0x1df,-0x58)]=_0x5cd288,_0x175756[_0x313705(0xcaa,0x1bb8,-0x24b,0x107a)+'e'](_0x423161,{'text':_0x313705(0x1bbe,0x185d,0x1afe,0xf6b)+_0x23937d(0x3e5,-0x6b6,-0x2fa,-0x629)+_0x23937d(0x157a,0x225a,0x21f5,0x2402)+kice[_0x23937d(0xccf,0x190f,0x46b,0x51)]('@')[0x1*0x76b+-0x265*-0x2+-0x7d*0x19]+(_0x313705(0xcfe,-0x14a,0x993,0x595)+_0x313705(0x1d34,0x1254,0x1e56,0x2b35)+_0x313705(0xbe6,-0x333,0xce7,0xdb7)+'ad\x20words\x20i'+_0x23937d(0xa90,0x39e,0xa65,0x385)+'up'),'contextInfo':{'mentionedJid':[kice]}},_0x2e3619);}}}}}if(_0x5a7bc9){if(_0x169e0a[_0x23937d(0x178,-0xbfd,-0xc18,0xa04)](_0x4b485e['ARvEO'])){const _0x2bd59e=_0x4b485e['twcvp']['split']('|');let _0x17b4ba=0x1*0x1c9b+-0x2493+0x7f8;while(!![]){switch(_0x2bd59e[_0x17b4ba++]){case'0':if(_0x5cd288[_0x23937d(0x94f,0x13ba,0x403,-0x1fd)][_0x313705(0x50c,0xa85,-0x2a1,0x715)])return _0x4b485e[_0x23937d(0x130e,0x1fa3,0x91b,0x640)](_0x1db05d,bvl);continue;case'1':if(_0x24aa58)return _0x4b485e[_0x23937d(0xc2,0x99c,-0x9ac,0xae0)](_0x1db05d,bvl);continue;case'2':const _0x1905eb={};_0x1905eb[_0x23937d(0x5dc,0xfc5,0x1035,0xc7d)]=_0x5cd288,_0x175756[_0x23937d(0x944,0x10a,0xb64,-0x1c0)+'e'](_0x423161,{'text':_0x313705(0xe4b,0x1c9c,0x320,0x443)+'be\x20Video\x20L'+'ink\x20Detect'+_0x23937d(0x157a,0x1e8c,0x14a5,0x153b)+kice[_0x313705(0x1035,0x4d9,0x1d44,0x747)]('@')[-0x1e78+-0x4e*0x40+0x6*0x854]+('\x20Has\x20been\x20'+'kicked\x20bec'+_0x23937d(0x160,0x638,0x6c9,0x676)+'nding\x20yout'+_0x313705(0x18ba,0x1e41,0x1a48,0x1f22)+'link\x20in\x20th'+_0x313705(0x1318,0x149d,0x2170,0xc0a)),'contextInfo':{'mentionedJid':[kice]}},_0x1905eb);continue;case'3':if(!_0x424adc)return;continue;case'4':await _0x175756[_0x313705(0xfee,0xd28,0x1a6a,0x364)+_0x23937d(0x30b,0x4e4,0x212,0xe73)+_0x23937d(0x250,-0xcb4,0x708,-0x27d)](_0x5cd288[_0x313705(0x14f2,0x2085,0x21f0,0x1d9d)],[kice],_0x4b485e[_0x23937d(0x148c,0xae2,0x1b0c,0x197d)]);continue;case'5':bvl='```🧩\x20YoutT'+_0x23937d(0xe63,0x546,0xdd4,0xf63)+_0x23937d(0x17c3,0x1564,0x1f6f,0x19c5)+_0x23937d(0xf40,0x10d9,0x98,0xd86)+'Admin\x20has\x20'+_0x23937d(0x90c,0x13e3,0xe2c,-0x125)+_0x23937d(0x88b,0x14da,0x5aa,0x10f1)+_0x23937d(0x747,0xbe9,0x890,0x15e1)+_0x313705(0x1edf,0x251b,0x1ce9,0x2bc0)+_0x23937d(0x6cc,0xbe6,0xd6f,0xb78)+_0x313705(0xf17,0x16e1,0x1756,0xddd);continue;case'6':if(_0x17ccaf)return _0x4b485e[_0x313705(0xa8b,0x1186,0x1052,0x10e3)](_0x1db05d,bvl);continue;case'7':kice=_0x5cd288[_0x23937d(0x14ce,0xc85,0xf1f,0x1b6a)];continue;}break;}}else{}}if(_0x5b4f82){if(_0x169e0a[_0x313705(0x4de,0x7b0,0x26f,-0x675)]('https://yo'+_0x23937d(-0x3,0xcbb,-0x5c,-0x1e5))){const _0x1a9d8e=_0x4b485e['CiTei'][_0x313705(0x1035,0x1f2c,0x91b,0x301)]('|');let _0x5d6baf=0x1d8b+-0x842+-0x1549;while(!![]){switch(_0x1a9d8e[_0x5d6baf++]){case'0':kice=_0x5cd288[_0x313705(0x1834,0x1ce9,0xef1,0x1f4b)];continue;case'1':await _0x175756[_0x313705(0xfee,0xcb4,0x987,0x1510)+_0x23937d(0x30b,-0x2a1,-0x441,-0x533)+_0x23937d(0x250,-0x206,-0x7a3,-0x71b)](_0x5cd288['chat'],[kice],_0x4b485e['gAJcl']);continue;case'2':if(!_0x424adc)return;continue;case'3':if(_0x24aa58)return _0x4b485e['VlhAH'](_0x1db05d,bvl);continue;case'4':bvl=_0x23937d(0x98c,0x17af,-0x61,0x15b8)+_0x313705(0x1093,0x98d,0x309,0x19b)+_0x23937d(0x1186,0xf56,0xfac,0x2c1)+'ected\x20🧩```'+_0x313705(0x16d5,0x1381,0x2160,0x2322)+_0x23937d(0x19ae,0xb4e,0x101f,0x23b9)+_0x313705(0xb33,0xaf6,0x60f,0xf21)+_0x23937d(0x1bf4,0x24d8,0x1b4a,0x1292)+_0x313705(0x18bf,0x18d5,0x1d7a,0x1805)+_0x23937d(0x371,0xdf4,0xb1f,0x1013)+_0x313705(0x1830,0x966,0x923,0x23af)+_0x313705(0x137a,0x61e,0xb2b,0x17a0);continue;case'5':if(_0x5cd288[_0x23937d(0x94f,0x7fd,0xe89,-0x445)][_0x23937d(0x1a6,0x447,0x423,0xf93)])return _0x4b485e['lAdYL'](_0x1db05d,bvl);continue;case'6':const _0x182699={};_0x182699[_0x23937d(0x5dc,0x651,-0x297,0x4ab)]=_0x5cd288,_0x175756[_0x313705(0xcaa,0x1282,-0xfc,0xe53)+'e'](_0x423161,{'text':'```🧩\x20YouTu'+_0x23937d(0xbdc,0x3d0,0x108d,0xc07)+_0x23937d(0x739,0x12,0x781,-0x5e8)+'cted\x20🧩```\x0a'+'\x0a@'+kice[_0x313705(0x1035,0xcfc,0x104f,0x1215)]('@')[-0x4f*0x49+0x1d48+-0x7*0xf7]+(_0x23937d(0x4c1,0x13d1,0x2f3,0x100)+_0x313705(0xb54,0x3be,0xe5d,0x13a1)+'ause\x20of\x20se'+'nding\x20yout'+_0x23937d(0x1bc5,0x21cf,0x1e7b,0x10a9)+_0x23937d(0x17e6,0x9a4,0xf0e,0x1efb)+_0x23937d(0xe29,0x162,0xce0,0x15da)),'contextInfo':{'mentionedJid':[kice]}},_0x182699);continue;case'7':if(_0x17ccaf)return _0x4b485e[_0x23937d(0x10a4,0x15c1,0x6a4,0xb27)](_0x1db05d,bvl);continue;}break;}}else{}}if(_0x3fb991){if(_0x169e0a[_0x23937d(0x178,0xe9c,0x76d,-0xb76)](_0x4b485e[_0x23937d(0x1d4d,0x211a,0x1852,0x2c56)])){if(_0x4b485e[_0x23937d(0x1c69,0x17c4,0x26a0,0x1f16)](_0x4b485e[_0x23937d(0x168a,0x1996,0xed6,0x1003)],_0x4b485e[_0x23937d(0x1dd5,0x2a29,0x1ebd,0x11e9)])){if(!_0x424adc)return;bvl='```🧩\x20Insta'+'gram\x20Link\x20'+_0x23937d(0x285,0x5e1,0xb82,0xa91)+_0x23937d(0x9e2,0x34d,0xd80,0x17b7)+'\x20has\x20sent\x20'+_0x23937d(0x1a43,0x1c06,0x291f,0x13d3)+'m\x20link,\x20ad'+_0x313705(0x92c,-0x3f7,0x153e,0x16b9)+_0x313705(0xf13,0xcd1,0x1888,0x12e4)+'any\x20link😇';if(_0x17ccaf)return _0x4b485e['Acxoy'](_0x1db05d,bvl);if(_0x5cd288['key'][_0x313705(0x50c,0x1201,0x6e0,0x22a)])return _0x4b485e['PgYXf'](_0x1db05d,bvl);if(_0x24aa58)return _0x4b485e['nFnFK'](_0x1db05d,bvl);kice=_0x5cd288[_0x313705(0x1834,0x1675,0x1b05,0x217e)],await _0x175756['groupParti'+_0x313705(0x671,-0x1c8,0xc3,-0xa8)+_0x313705(0x5b6,-0x26b,0x9a9,0xf0e)](_0x5cd288['chat'],[kice],_0x313705(0x2145,0x2bac,0x24ab,0x2c75));const _0x1fb68e={};_0x1fb68e['quoted']=_0x5cd288,_0x175756[_0x23937d(0x944,0xfb0,0x95b,0xc88)+'e'](_0x423161,{'text':'```🧩\x20Insta'+_0x313705(0x18f3,0x20af,0x20f0,0x1e5f)+'Detected\x20🧩'+_0x313705(0xed0,0x66d,0x1c64,0xc15)+kice[_0x23937d(0xccf,0x6ae,0xba8,0x154d)]('@')[-0x233a+0x1*0xf17+0x1423]+(_0x313705(0x827,0x6e1,0x9d5,0x1097)+_0x23937d(0x7ee,-0x5df,0x297,0x10da)+_0x23937d(0x160,0xb09,0x5ce,0xc37)+_0x23937d(0xc85,0x44d,0xe38,0x1a52)+_0x313705(0x12db,0x126a,0xb4b,0x1ae6)+_0x313705(0x1b01,0x2459,0x23db,0x16a8)+'roup'),'contextInfo':{'mentionedJid':[kice]}},_0x1fb68e);}else{let _0x2dade8=[];for(let _0x5f1076 of _0x2dbe95){const _0x349606={};_0x349606[_0x23937d(0x17d9,0x185c,0x1974,0xb27)]=''+_0x5f1076[_0x313705(0x1940,0xb68,0xc74,0x11ff)],_0x349606[_0x313705(0x49c,0x233,0x2a3,0xeff)]=[{'title':''+_0x5f1076['judul'],'rowId':_0x541896+_0x23937d(0x19f4,0x273d,0x145e,0x194e)+_0x5f1076['link'],'description':_0x313705(0x177a,0x1965,0x196e,0x255e)+_0x5f1076[_0x313705(0xd99,0x489,0xd82,0x1394)]+_0x313705(0x1f79,0x14c5,0x2a71,0x1cb6)+_0x5f1076[_0x23937d(0x6a4,-0x2b5,0x340,-0x68b)+'e']+_0x313705(0x2030,0x2601,0x2bfd,0x2dd3)+_0x5f1076[_0x313705(0xf86,0xa10,0x101f,0x299)]}];const _0x2aaec5=_0x349606;_0x2dade8[_0x313705(0x1122,0x4b4,0x19e4,0x30e)](_0x2aaec5);}const _0x339c39={};_0x339c39[_0x23937d(0x1d39,0x177a,0x27a8,0xf53)]=_0x20a539+'\x20'+_0x211141+(_0x313705(0xbb0,-0xc2,0x197c,0xb33)+_0x313705(0xa4a,0x14f2,0x636,0x3b7)+'m\x20')+_0x197b4d+(_0x313705(0x109b,0x15fc,0xbd2,0x901)+_0x23937d(0x2e3,-0x921,-0x256,-0x945)+_0x23937d(0x1d41,0x11a0,0xf3c,0x1dbe)+'ose*'),_0x339c39[_0x313705(0x13d4,0x83b,0x6bc,0x18d9)]=''+_0x2600b1,_0x339c39[_0x23937d(0x17d9,0xea5,0x23db,0x1111)]=_0x4b485e[_0x23937d(0x137e,0x1a55,0xc55,0x1029)],_0x339c39[_0x313705(0x1902,0x1305,0x11d6,0xede)]=_0x4b485e[_0x313705(0xb02,0x431,0x151e,-0x19a)],_0x339c39[_0x23937d(0x17f7,0x1c69,0x1344,0x1d17)]=_0x2dade8;const _0x2a42b0={};_0x2a42b0[_0x23937d(0x5dc,0x335,-0x1f8,0xdd)]=_0x11e7fd;const _0x3d5dc0=_0x5bc250[_0x313705(0xcaa,0x1e5,0x1aaa,0x5e1)+'e'](_0xb251eb['chat'],_0x339c39,_0x2a42b0);}}else{}}if(_0x3531e9){if(_0x169e0a[_0x23937d(0x178,0xe1b,-0x4d6,0x874)](_0x4b485e[_0x23937d(0x54,0x393,-0xa13,0x683)])){const _0x3dd845=_0x4b485e[_0x313705(0x852,-0x2cc,0x14fe,0xb3b)]['split']('|');let _0x392ce5=0x2486+-0x2dd+0x7*-0x4cf;while(!![]){switch(_0x3dd845[_0x392ce5++]){case'0':await _0x175756[_0x313705(0xfee,0x150d,0x470,0x1a6b)+_0x313705(0x671,-0x73,-0x7ce,-0x36a)+_0x23937d(0x250,-0x59,0xd0c,0x17)](_0x5cd288[_0x313705(0x14f2,0x7c1,0x2375,0x1e6d)],[kice],_0x4b485e[_0x23937d(0x148c,0xf6f,0x1551,0x14ef)]);continue;case'1':bvl=_0x313705(0x14fc,0x1400,0xe5e,0x10e7)+_0x313705(0x117b,0x6e0,0x32f,0x1a91)+_0x313705(0x14fa,0x1bb0,0x15a2,0x13c3)+'``\x0a\x0aAdmin\x20'+_0x313705(0xf49,0xde3,0x18c3,0x174f)+_0x313705(0x3e0,0x11c3,-0xa2,-0x995)+_0x313705(0x499,-0x10d,0xf2,0xbaf)+_0x23937d(0x10fa,0x184f,0x13d7,0x560)+_0x23937d(0x403,0x1250,0x968,-0x4c9)+_0x23937d(0xa98,0xee3,0x12d2,-0x81);continue;case'2':const _0x41ad15={};_0x41ad15['quoted']=_0x5cd288,_0x175756[_0x23937d(0x944,0x10f3,0x16a9,0x157d)+'e'](_0x423161,{'text':_0x23937d(0x1196,0x16d7,0x1954,0x1327)+_0x23937d(0xe15,0x187,0x1826,0x1b6d)+_0x313705(0x14fa,0x9d4,0x1b87,0x17e2)+'``\x0a\x0a@'+kice[_0x23937d(0xccf,0x386,0x16ad,0x420)]('@')[-0x164*-0x7+-0x7e6+0xa*-0x2f]+(_0x313705(0x827,0x6f2,0x930,0x6ff)+'kicked\x20bec'+_0x23937d(0x160,-0x585,-0xf,-0x66b)+_0x23937d(0x25f,0x357,0xa46,0x29d)+'book\x20link\x20'+_0x313705(0xe33,0x133f,0x198b,0x1892)+_0x313705(0x15b2,0x89e,0xe80,0xa1c)),'contextInfo':{'mentionedJid':[kice]}},_0x41ad15);continue;case'3':if(_0x5cd288[_0x313705(0xcb5,0x439,0x3e3,0x1022)][_0x23937d(0x1a6,0x1074,-0x190,-0x8a2)])return _0x4b485e[_0x313705(0x1433,0xc9f,0x21f6,0x1301)](_0x1db05d,bvl);continue;case'4':if(_0x24aa58)return _0x4b485e['wOiJF'](_0x1db05d,bvl);continue;case'5':if(!_0x424adc)return;continue;case'6':kice=_0x5cd288[_0x23937d(0x14ce,0xfb7,0x15c4,0xb7b)];continue;case'7':if(_0x17ccaf)return _0x4b485e[_0x23937d(0xe84,0x3d,0x7b1,0x8b6)](_0x1db05d,bvl);continue;}break;}}else{}}if(_0x18ab35){if(_0x169e0a[_0x23937d(0x178,0xfb0,0xb9f,0x41b)](_0x4b485e[_0x23937d(0x1437,0x9fc,0x2061,0x1287)])){if(_0x4b485e[_0x23937d(0x92b,0x1731,0x1316,0x12a2)]!==_0x4b485e[_0x313705(0x176e,0xf1e,0x1ac2,0xd87)]){const _0x493f97=_0x4b485e[_0x313705(0x1584,0x146a,0x12ab,0x1905)][_0x313705(0x1035,0x1222,0x178b,0x4d5)]('|');let _0x265ec8=-0x1cfe+0x2fa+-0x12*-0x172;while(!![]){switch(_0x493f97[_0x265ec8++]){case'0':if(_0x5cd288[_0x313705(0xcb5,0x1253,0x68d,0xd65)][_0x23937d(0x1a6,-0x3f8,-0x9ca,-0x452)])return _0x4b485e[_0x313705(0x19aa,0x1cad,0x24a7,0x1620)](_0x1db05d,bvl);continue;case'1':kice=_0x5cd288['sender'];continue;case'2':if(_0x18ab35){if(!_0x424adc)return;}continue;case'3':if(_0x17ccaf)return _0x4b485e[_0x23937d(0x215,-0x718,-0x7e4,-0x412)](_0x1db05d,bvl);continue;case'4':await _0x175756[_0x313705(0xfee,0x1476,0x16fb,0xd7f)+_0x313705(0x671,0x587,-0xf,-0x6f3)+'ate'](_0x5cd288['chat'],[kice],'remove');continue;case'5':bvl=_0x313705(0xdab,0x1f1,0x728,0xef)+'ram\x20Link\x20D'+'etected\x20🧩`'+_0x313705(0x1430,0xabf,0x18ba,0x205e)+_0x23937d(0xbe3,0x96a,-0x251,0x10be)+'\x20telegram\x20'+_0x23937d(0x133,-0x8e5,0xb76,0x950)+_0x313705(0x1460,0x1cef,0x1b8c,0x18db)+_0x23937d(0x403,-0x826,-0xa12,-0x657)+_0x313705(0xdfe,0x12f7,0x171,0x1436);continue;case'6':if(_0x24aa58)return _0x4b485e[_0x313705(0x1ea3,0x21e8,0x1373,0x2c6a)](_0x1db05d,bvl);continue;case'7':const _0x3c359b={};_0x3c359b[_0x23937d(0x5dc,0xea2,0x12b9,-0x8f9)]=_0x5cd288,_0x175756[_0x313705(0xcaa,-0x12b,0x2bf,0x119c)+'e'](_0x423161,{'text':_0x313705(0xdab,0x108d,0xebc,-0x41)+_0x23937d(0xe8c,0x1a19,0x540,0x7bd)+_0x23937d(0x1194,0x177d,0x1387,0x52d)+_0x313705(0xe0c,0x1c48,0xa33,0x1608)+kice[_0x313705(0x1035,0x1a25,0x760,0x819)]('@')[0x1d40+-0x603+-0x173d]+(_0x23937d(0x4c1,-0x73b,0xf94,0x4cb)+'kicked\x20bec'+_0x23937d(0x160,-0x1b0,-0x8c7,0x9e0)+_0x313705(0xc2c,0x1829,0xa7c,0x412)+_0x313705(0x129a,0xfd4,0x148c,0x1386)+'in\x20this\x20gr'+_0x313705(0x15b2,0x1b39,0x2372,0x232a)),'contextInfo':{'mentionedJid':[kice]}},_0x3c359b);continue;}break;}}else{_0x571461=_0x2fb892[_0x23937d(0x13bd,0x15a9,0x165a,0xf55)+'nc'](_0x23937d(0xb1b,0xe1e,0x3f3,0xd02)+'AllData/st'+_0x23937d(0xcb8,0xc0e,0x1a44,0x3b9)+_0x313705(0x1a20,0xc80,0x2582,0x1163));const _0x4b61ab={};_0x4b61ab[_0x313705(0x1360,0xeb2,0x20ea,0xedc)]=_0x17514d;const _0x25c1db={};_0x25c1db['quoted']=_0x5c340a,_0x3c78bb[_0x23937d(0x944,0x25e,0x48c,0xd8f)+'e'](_0x52c71d['chat'],_0x4b61ab,_0x25c1db);}}else{}}if(_0x15863a){if(_0x169e0a[_0x23937d(0x178,0x1015,-0x764,0x3a6)](_0x4b485e['XkyIN'])){if(_0x4b485e[_0x313705(0x1e7d,0x1f80,0x2caf,0x18a5)](_0x4b485e[_0x23937d(0x2bb,0xf08,0xdaf,0xdf9)],_0x4b485e[_0x23937d(0xf35,0x1156,0xee9,0x1a41)]))_0xe662e2[_0x23937d(0x63b,0x105e,-0x288,0x2c6)](_0x5d9c44['format'](_0xa79162));else{if(!_0x424adc)return;bvl=_0x313705(0x904,0xfb,-0x12,0x1360)+'k\x20Link\x20Det'+_0x313705(0x1e23,0x17d0,0xfea,0x13db)+'\x0a\x0aAdmin\x20ha'+'s\x20sent\x20a\x20t'+_0x313705(0xcfd,0x1eb,0x167e,-0x56)+_0x23937d(0xba3,0x17d5,0xfc6,0x697)+'\x20free\x20to\x20s'+_0x313705(0xc92,0x202,0x89,0x94)+_0x23937d(0x1d30,0x1fc9,0x16ad,0x14cd);if(_0x17ccaf)return _0x4b485e[_0x23937d(0x31d,-0x9ad,0x54d,0x11a5)](_0x1db05d,bvl);if(_0x5cd288['key'][_0x23937d(0x1a6,-0x2c1,-0x9c0,0x8ed)])return _0x1db05d(bvl);if(_0x24aa58)return _0x4b485e[_0x313705(0x5c2,0x14c8,0x980,-0x2c)](_0x1db05d,bvl);kice=_0x5cd288[_0x23937d(0x14ce,0xd57,0x1601,0x214f)],await _0x175756[_0x23937d(0xc88,0xb2e,0x1460,0x14d0)+_0x23937d(0x30b,0xed7,-0x7f5,0x6c7)+_0x313705(0x5b6,0x117d,0x684,0xad0)](_0x5cd288[_0x313705(0x14f2,0x144c,0x197a,0x1ed0)],[kice],_0x4b485e[_0x313705(0x17f2,0x24d2,0x245b,0x2322)]);const _0x71c0c6={};_0x71c0c6[_0x313705(0x942,-0x5ac,-0x2f4,0x657)]=_0x5cd288,_0x175756[_0x23937d(0x944,0xdf1,0x3,0x149e)+'e'](_0x423161,{'text':'```🧩\x20Tikto'+'k\x20Link\x20Det'+_0x313705(0x1e23,0xfe7,0x2c0e,0x1fd4)+'\x0a\x0a@'+kice[_0x23937d(0xccf,0x132,0x1332,0xe04)]('@')[-0x25f5+-0xd97*0x2+0x4123]+('\x20Has\x20been\x20'+_0x23937d(0x7ee,-0x634,0x96f,0xaf5)+'ause\x20of\x20se'+_0x23937d(0x8fd,-0x45a,0x146d,0xfc7)+_0x313705(0x13ef,0xe34,0x19d8,0xbe7)+_0x313705(0x835,-0xdb,-0x3ee,0x978)+'p'),'contextInfo':{'mentionedJid':[kice]}},_0x71c0c6);}}else{}}if(_0x4561cd){if(_0x169e0a[_0x313705(0x4de,-0x480,-0x914,0xaa)](_0x4b485e[_0x313705(0x1188,0x1c63,0x141d,0x12e8)])){const _0x973327=_0x4b485e[_0x23937d(0x1d0,0x42b,-0x689,-0x98)][_0x313705(0x1035,0x538,0x1d59,0x1370)]('|');let _0x3db4d8=0x1*0x26d1+-0x700+-0x1fd1;while(!![]){switch(_0x973327[_0x3db4d8++]){case'0':await _0x175756[_0x23937d(0xc88,0xb46,0x14ad,0x27d)+_0x23937d(0x30b,-0x17e,-0x6f9,-0x3f7)+_0x23937d(0x250,0x5e6,-0xc26,-0x106)](_0x5cd288[_0x23937d(0x118c,0x19e5,0x39e,0x769)],[kice],_0x313705(0x2145,0x1679,0x2895,0x21ab));continue;case'1':if(_0x5cd288[_0x23937d(0x94f,0xe88,0x11d2,0xf54)]['fromMe'])return _0x4b485e['MoMKp'](_0x1db05d,bvl);continue;case'2':kice=_0x5cd288[_0x23937d(0x14ce,0x87e,0x72a,0x1a05)];continue;case'3':if(_0x17ccaf)return _0x4b485e[_0x313705(0x8a9,0x33e,0x134f,0x1387)](_0x1db05d,bvl);continue;case'4':const _0x59a151={};_0x59a151[_0x313705(0x942,0x1017,0x123f,0x617)]=_0x5cd288,_0x175756['sendMessag'+'e'](_0x423161,{'text':_0x23937d(0x59e,-0x109,-0x877,-0x85c)+_0x23937d(0xdc8,0x4c4,0xd55,0x12fc)+_0x313705(0x1e23,0x20e1,0x1b49,0x162f)+_0x23937d(0x103f,0xfb7,0x1e6e,0x1d4f)+kice[_0x23937d(0xccf,0xb63,0x13d2,0x1623)]('@')[-0x125*0x13+-0x383+0x1942]+(_0x313705(0x827,0x7c2,0x14f9,0x13a2)+'kicked\x20bec'+_0x23937d(0x160,0x2ef,0x108,0x918)+_0x313705(0xb71,0xd19,-0xc8,0x1019)+_0x23937d(0x19a5,0x2476,0x1f0a,0xf2b)+_0x313705(0xdf6,0x1263,0xa0c,0x82)+'up'),'contextInfo':{'mentionedJid':[kice]}},_0x59a151);continue;case'5':if(!_0x424adc)return;continue;case'6':bvl=_0x313705(0x1d86,0x234f,0x22f7,0x1c89)+_0x23937d(0x1a5a,0x19af,0x1175,0x2187)+_0x23937d(0xd47,0xa5a,0xc85,0xb3)+_0x23937d(0x126e,0x214d,0x1ba4,0xe24)+_0x23937d(0x37e,-0x716,0x31b,0x401)+_0x23937d(0xb6e,0x86,0xe12,0xae4)+_0x23937d(0x131a,0x186d,0xbda,0x1502)+_0x313705(0x7a3,0xc8f,0x10a2,-0x34a)+_0x23937d(0x1588,0x175b,0xdbe,0x21b4)+_0x313705(0x75b,0x1516,-0x503,0xd30);continue;case'7':if(_0x24aa58)return _0x1db05d(bvl);continue;}break;}}else{}}if(_0x3f0159){if(_0x169e0a[_0x313705(0x4de,0xe5d,0xc8d,0xd39)](_0x313705(0xc30,0xcd7,0x112f,0x0))){const _0x1ae54e=_0x4b485e[_0x313705(0x1d11,0x2834,0x21fd,0xf7c)][_0x313705(0x1035,0xf47,0x1694,0xced)]('|');let _0xd6ca93=0x698+-0x5b*0x4f+0x157d;while(!![]){switch(_0x1ae54e[_0xd6ca93++]){case'0':await _0x175756[_0x23937d(0xc88,0xb12,0x11bb,0x18e3)+'cipantsUpd'+_0x313705(0x5b6,0x921,0xa98,0xc28)](_0x5cd288[_0x313705(0x14f2,0xee7,0xd9b,0x733)],[kice],_0x4b485e[_0x23937d(0x148c,0x194c,0x1ff3,0x652)]);continue;case'1':if(_0x24aa58)return _0x1db05d(bvl);continue;case'2':if(!_0x424adc)return;continue;case'3':bvl='```🧩\x20Link\x20'+_0x23937d(0x285,-0x1e5,-0x714,-0x37c)+_0x23937d(0x9e2,-0x238,0x11c1,-0x87)+_0x313705(0x3f5,0xfe7,0x5c4,0x11f)+_0x23937d(0x208,0xa6d,-0x513,-0xbe2)+_0x23937d(0x5c6,0x7fd,0x505,0x455)+'e\x20to\x20send\x20'+'any\x20link😇';continue;case'4':const _0x2eb19e={};_0x2eb19e[_0x23937d(0x5dc,0x96f,0xf81,0x4ab)]=_0x5cd288,_0x175756[_0x313705(0xcaa,0x914,0x18ae,0x78c)+'e'](_0x423161,{'text':_0x23937d(0x12ea,0x470,0x1e7d,0x209b)+'Detected\x20🧩'+'```\x0a\x0a@'+kice[_0x23937d(0xccf,0x299,-0x55,0x154c)]('@')[-0xf8+-0x127b+0xd*0x17f]+('\x20Has\x20been\x20'+_0x313705(0xb54,0xacb,0x975,0x394)+'ause\x20of\x20se'+_0x313705(0x1e11,0x26a2,0x1da0,0x2229)+'\x20in\x20this\x20g'+_0x23937d(0xad8,0x562,0xf26,0xb52)),'contextInfo':{'mentionedJid':[kice]}},_0x2eb19e);continue;case'5':if(_0x5cd288[_0x313705(0xcb5,0x120e,-0x13e,0xb9e)][_0x23937d(0x1a6,0x68a,0x2cc,0xe3a)])return _0x1db05d(bvl);continue;case'6':kice=_0x5cd288[_0x313705(0x1834,0x1dd2,0xbe7,0xf9d)];continue;case'7':if(_0x17ccaf)return _0x1db05d(bvl);continue;}break;}}else{}}for(let _0x24b04b of xeonysticker){if(_0x4b485e[_0x23937d(0x1d7b,0x2972,0x1ad8,0x1651)](_0x169e0a,_0x24b04b)){result=fs['readFileSy'+'nc'](_0x23937d(0xb1b,0x83,0xdb4,0x7d5)+_0x313705(0x1979,0x212d,0xe85,0xffa)+_0x23937d(0x197a,0x1006,0x166b,0x1e5f)+_0x24b04b+_0x313705(0x1a20,0x1b9a,0x2104,0x1082));const _0x237c8c={};_0x237c8c[_0x23937d(0xffa,0xe3d,0xab4,0xe1e)]=result,_0x175756[_0x23937d(0x944,0x12cc,-0x3a5,-0x16)+'e'](_0x5cd288['chat'],_0x237c8c,{'quoted':_0x5cd288});}}for(let _0x48eb7a of xeonyaudio){if(_0x4b485e[_0x313705(0x1b2b,0x1cc8,0x2645,0x251b)](_0x313705(0x1d2f,0x19c5,0x1d3d,0x26ca),_0x4b485e['qStQH'])){if(!_0x5d76ad)return _0x4b485e[_0x23937d(0x5aa,-0x36e,0x108a,0xe24)](_0x34cd39,_0x4b485e['QtXqz']);let _0x3a0787=_0x6be644[_0x23937d(0x9e6,0x16c,0xebd,0xb2e)](_0x152f47);_0x42fe21[_0x313705(0x961,0xe09,-0xcf,0x90a)](_0x3a0787,-0xc26+0x626*-0x5+0x2ae5),_0x4a8929(_0x4b485e['mebjJ']);}else{if(_0x4b485e['NaFJg'](_0x169e0a,_0x48eb7a)){if(_0x4b485e[_0x313705(0x1ceb,0x2098,0x1702,0x2355)](_0x4b485e[_0x313705(0x1a46,0x1e38,0x1e64,0x2726)],_0x313705(0xa8d,-0x182,0x763,0x8b1)))_0x4a1c77(_0x4b485e[_0x23937d(0xcda,0x1b82,0x13b5,0x55b)]);else{result=fs[_0x23937d(0x13bd,0x220c,0x6ff,0x4d8)+'nc'](_0x313705(0xe81,0x1bf6,0x16a2,0x12cb)+_0x313705(0x1d39,0x2706,0x2a97,0x2aed)+'dio/'+_0x48eb7a+_0x23937d(0x58f,0x1351,-0x56a,0x123));const _0x2fd4b3={};_0x2fd4b3['audio']=result,_0x2fd4b3['mimetype']=_0x4b485e[_0x23937d(0x107f,0xd25,0x404,0x4e2)],_0x2fd4b3['ptt']=!![],_0x175756[_0x313705(0xcaa,0x2db,0xf68,0x14b9)+'e'](_0x5cd288[_0x313705(0x14f2,0xaa9,0x1f0c,0x1b1c)],_0x2fd4b3,{'quoted':_0x5cd288});}}}}for(let _0x136dc2 of xeonyimage){if(_0x4b485e[_0x313705(0x1a0e,0x2291,0x2315,0xfe2)](_0x4b485e['NGIHp'],_0x4b485e[_0x313705(0x80d,0x150c,0xddf,-0x5b8)])){if(_0x4b485e[_0x313705(0x1be1,0xcc8,0x1e04,0xd70)](_0x169e0a,_0x136dc2)){result=fs['readFileSy'+'nc'](_0x313705(0xe81,0x3d1,0x14e7,0xb32)+_0x313705(0x1a08,0x26df,0xca8,0x137c)+_0x313705(0x1b71,0x2242,0x1d48,0x1a6b)+_0x136dc2+_0x313705(0x1334,0x1775,0xa25,0x836));const _0x3e5e7d={};_0x3e5e7d[_0x23937d(0x1c43,0x2844,0x26b0,0xf48)]=result,_0x175756[_0x313705(0xcaa,0x59c,0x119,0x317)+'e'](_0x5cd288['chat'],_0x3e5e7d,{'quoted':_0x5cd288});}}else _0x4b485e[_0x313705(0x162b,0xa64,0xd26,0x1d1f)](_0x184fd1,_0x172292['sender']);}for(let _0x185b3f of xeonyvideo){if(_0x4b485e[_0x23937d(0x676,0x8f5,0xede,-0x1ca)](_0x169e0a,_0x185b3f)){if(_0x4b485e[_0x313705(0x902,0xc21,0x57d,0xa4d)]!==_0x4b485e[_0x313705(0xf61,0x7de,0x1c9f,0x1736)]){result=fs['readFileSy'+'nc'](_0x23937d(0xb1b,0x11ff,0x16c6,-0x112)+_0x23937d(0x319,0xc96,0x9b1,0x311)+_0x23937d(0x49b,0x5be,0x114,0x832)+_0x185b3f+_0x23937d(0x1947,0x22b9,0xe15,0x24d9));const _0x434823={};_0x434823[_0x23937d(0x1762,0x2378,0x2055,0x8dc)]=result,_0x175756[_0x23937d(0x944,0xeb4,0x1e1,0x3db)+'e'](_0x5cd288[_0x23937d(0x118c,0x1ed2,0x10c4,0x1d9f)],_0x434823,{'quoted':_0x5cd288});}else{const _0x4b4e10={};_0x4b4e10['url']=_0xc482ec[_0x313705(0xddf,-0xa5,0x1022,0x156b)][0xecf+0x1a44+0x3*-0xdb1][_0x313705(0xddf,0x1699,0x1900,0x1ade)];const _0x4e4540={};_0x4e4540['video']=_0x4b4e10,_0x4e4540[_0x313705(0x1610,0x1669,0x19ae,0x199c)]=_0x23937d(0xa6,-0x7ac,0x55c,0x6be);const _0x16e6ce={};_0x16e6ce[_0x23937d(0x5dc,0x6e4,0x37f,0xb85)]=_0x7a4092,_0x505237[_0x23937d(0x944,0x27b,0x7ee,-0x544)+'e'](_0x818f1a[_0x23937d(0x118c,0x172e,0x895,0xe37)],_0x4e4540,_0x16e6ce);}}}const _0x4e6285=(_0x3dac0c,_0x402cd3)=>{const _0xb51b15={'uOztH':function(_0x2357e0,_0x1efb9c){return _0x4b485e['rAsPf'](_0x2357e0,_0x1efb9c);},'Zwkkr':_0x4b485e['UBZUB'],'FfMIQ':function(_0xa3d2c4,_0x4439cf){return _0x4b485e['ZBDBw'](_0xa3d2c4,_0x4439cf);}};function _0xf83002(_0x41f18d,_0x390bd1,_0xe802ab,_0x51ba31){return _0x313705(_0x51ba31-0x154,_0x41f18d,_0xe802ab-0x37,_0x51ba31-0xe4);}function _0x4f57f9(_0x20b55a,_0x54c485,_0x1a6e1d,_0x26c478){return _0x313705(_0x26c478-0x2,_0x1a6e1d,_0x1a6e1d-0xb3,_0x26c478-0xcc);}try{if(_0x4b485e[_0x4f57f9(0x1397,0x1a92,0x16fb,0x1e55)]!==_0x4f57f9(0x8c8,0x1d5b,0x165e,0x148d)){const _0x579186=_0x4b485e[_0x4f57f9(0x171e,0xf7c,-0x283,0xc21)]['split']('|');let _0x3139d0=-0xdf4*0x1+-0x1eac+0x54*0x88;while(!![]){switch(_0x579186[_0x3139d0++]){case'0':_0x1cf850+=_0x4f57f9(0xd45,0x6e0,-0x3de,0x938)+_0xf59b78[_0x4f57f9(0x1afb,0x1b45,0x1d0d,0x1eb1)]+'\x0a';continue;case'1':_0x1009e2+=_0x4f57f9(0x409,0xd48,0xd40,0x8e9)+_0x318b67[_0x4f57f9(-0x204,0x1463,0x3e0,0xbe1)+'pload']+'\x0a';continue;case'2':_0x1a77be+=_0xf83002(0x36b,0x7b0,0xf27,0x5b0)+_0x4c595e[_0xf83002(0xb43,0x223a,0x11a9,0x1466)]+'\x0a';continue;case'3':_0x5e0529+=0x18aa+-0xf19+0x44*-0x24;continue;case'4':_0x5af55d+=_0x4f57f9(0x12fe,0x15af,0x1ef4,0x1cb3)+_0xcce028[_0x4f57f9(0xd23,0x16e7,0x1180,0x1505)]()+_0xf83002(0xf68,0xa16,0xac6,0xd4b);continue;}break;}}else{const {EmojiAPI:_0xf0bf68}=_0x4b485e['Dtiib'](require,_0x4b485e['SuegZ']),_0x1a2b2f=new _0xf0bf68();_0x1a2b2f[_0x4f57f9(0x58a,0x1840,0x1c2d,0xfa5)](_0x3dac0c)[_0x4f57f9(0x157d,0x1667,0x16cd,0x1ec9)](_0x1b6a1e=>{function _0x1ac540(_0x124aca,_0x3d047d,_0x34f661,_0x452529){return _0x4f57f9(_0x124aca-0x33,_0x3d047d-0x6a,_0x34f661,_0x3d047d- -0x15d);}function _0x276eb8(_0x406352,_0x275b0e,_0x3b9047,_0x10a136){return _0x4f57f9(_0x406352-0x1f1,_0x275b0e-0x11a,_0x10a136,_0x3b9047- -0x2b);}if(_0x4b485e['rAsPf'](_0x276eb8(0x2032,0x210a,0x1a2f,0x1c93),_0x4b485e[_0x276eb8(0x1522,0x15be,0x18a2,0x2737)])){const _0x45fd68={};_0x45fd68[_0x276eb8(0x2387,0x146b,0x1731,0xf89)+'t']=_0x3dac0c;const _0x5dc993={};_0x5dc993[_0x1ac540(0x1fde,0x1d17,0x1c1e,0x17d3)]='y',_0x5dc993[_0x276eb8(0x2785,0x1b22,0x18d9,0xf67)]=_0x45fd68,_0x5dc993[_0x276eb8(0xf60,0x12eb,0xa75,0xd10)]=0x1;const _0x17f785=[_0x5dc993],_0x4af8ce={};_0x4af8ce[_0x1ac540(0x1a6c,0xc84,0x19bf,0x13ae)]=_0x1b6a1e['images'][_0x402cd3][_0x1ac540(0x194c,0xc84,0xeb,0x7ea)];const _0x202dca={};_0x202dca[_0x276eb8(0x2abd,0x2174,0x1f80,0x2982)]=_0x4af8ce,_0x202dca[_0x1ac540(0xc5a,0xb73,0x5ff,0x9a0)]=''+mess[_0x276eb8(0x285,0x7d0,0xca5,0xad6)],_0x202dca[_0x1ac540(0x1761,0xea4,0x680,0xbbd)]=''+botname,_0x202dca[_0x1ac540(-0xa9,0xe45,0xd12,0xaca)]=_0x17f785,_0x202dca['headerType']=0x4;const _0x4c46ca=_0x202dca,_0x3b4f3e={};_0x3b4f3e['quoted']=_0x5cd288,_0x175756[_0x1ac540(0xc97,0xb4f,0x382,0x13fe)+'e'](_0x423161,_0x4c46ca,_0x3b4f3e);}else{const _0x1c4b28={};_0x1c4b28[_0x276eb8(0x1b5b,0x2b1d,0x2076,0x19c8)]=''+_0x3f3634[_0x276eb8(0x199b,0xf2,0xd0b,0x114a)];const _0x411b5e={};_0x411b5e[_0x276eb8(0x173a,0x10c0,0x919,0x106)]=_0x8ccb6c,_0x5cc893['sendMessag'+'e'](_0x5dc9b2[_0x1ac540(0x1933,0x1397,0x21d6,0x18a7)],_0x1c4b28,_0x411b5e);}});}}catch(_0x13efde){if(_0x4b485e['xzxzf'](_0x4b485e[_0xf83002(0x13cc,0xe60,0x1447,0x10db)],_0x4b485e[_0xf83002(0x138d,0x3b8,0x11fd,0xeb3)]))_0x4b485e[_0xf83002(0xd9d,0x2314,0x212c,0x153c)](_0x1db05d,_0x4b485e[_0xf83002(0x1788,0x7c1,-0x3fd,0x8a7)]);else{if(_0xb51b15[_0x4f57f9(-0x3bd,-0x15b,-0x17a,0x86c)](_0x437c75['antilink'],_0xb51b15[_0xf83002(0xb86,0x14bf,0x145,0x71d)]))return _0x4e78fd(_0x4f57f9(0x992,0x4cd,0x84f,0xf1a)+'d');_0x4a9710[_0x4f57f9(0x1b46,0x1182,0x1b9f,0x1cfc)]=_0xb51b15[_0x4f57f9(0x9cc,-0xc1,0x5f3,0x5cb)],_0xb51b15[_0xf83002(0x11f5,0x1777,0x1c15,0x163c)](_0x43f6a3,_0x3afeea[_0xf83002(0xc60,0x1ab5,0x171b,0xe26)]+(_0xf83002(0xacd,0x1292,0xd6d,0xbe4)+_0xf83002(0x1a70,0x17e6,0x201e,0x11e3)));}}};if(db[_0x23937d(0xe17,0xd66,0x365,0x298)][_0x23937d(0x252,-0x8a1,-0x1fc,0x4dd)][_0x5cd288[_0x23937d(0x118c,0xcff,0xaf7,0x1079)]][_0x23937d(0x1172,0x1064,0x1ebc,0x5db)]&&!_0x17ccaf&&!_0x24aa58)return;const _0xcc3657=_0x4b485e['rhfts'](_0x2f2fac,_0x4b485e[_0x313705(0x3cf,0xf1c,0xd49,-0x466)])&&_0x395ebf[_0x23937d(0x178,-0x84f,0xd5f,0x5bb)](_0x4b485e[_0x23937d(0x1b78,0x1ad2,0x1460,0xe12)]),_0x3a23df=_0x4b485e[_0x23937d(0x3af,0x193,0x58e,-0xa9a)](_0x2f2fac,_0x4b485e[_0x23937d(0x69,-0x651,-0x399,0x805)])&&_0x395ebf[_0x313705(0x4de,-0x22f,-0xd1,0x110d)](_0x4b485e[_0x313705(0xcde,0x3f8,0xc3e,-0x6f)]),_0x385e1b=_0x4b485e[_0x23937d(0x1eb,-0xbac,0x863,0x10ca)](_0x2f2fac,'extendedTe'+'xtMessage')&&_0x395ebf['includes'](_0x4b485e['zcvqX']),_0x2b46de=_0x4b485e[_0x23937d(0x1cf6,0x2272,0x1671,0x22fd)](_0x2f2fac,_0x4b485e[_0x313705(0x3cf,0x4af,0x4cb,0x363)])&&_0x395ebf['includes'](_0x4b485e[_0x313705(0x1f3e,0x276d,0x27ab,0x2c66)]);if(_0x2193ff&&_0x5cd288[_0x23937d(0x10c8,0x1d2b,0x15c6,0xcfb)][_0x313705(0xb67,0x9e2,0x418,0x188e)]&&_0x4b485e['tHkdD'](_0x5cd288[_0x313705(0x142e,0x118a,0x1b58,0x1b5b)][_0x23937d(0x801,0x754,0x1705,0x12cf)]['toString'](_0x313705(0x6f8,0x19f,-0x297,0xb67)),global['db'][_0x313705(0x117d,0x19dc,0x1096,0x9c1)][_0x23937d(0xffa,0x14b8,0xf20,0x1e6e)])){let _0x2482b6=global['db'][_0x313705(0x117d,0x1b01,0x889,0x15a6)][_0x23937d(0xffa,0x1625,0x1d12,0x1259)][_0x5cd288['msg'][_0x313705(0xb67,-0x35d,0x8d9,0x128d)][_0x23937d(0x119d,0x17ec,0x1f73,0x1b3b)](_0x4b485e['nnzjU'])],{text:_0xc6b259,mentionedJid:_0x3ce97a}=_0x2482b6;const _0x562ef5={};_0x562ef5[_0x313705(0x209f,0x17ad,0x25ff,0x128e)]=_0xc6b259,_0x562ef5[_0x313705(0x1cce,0x2ba0,0x1f13,0x1865)]=_0x3ce97a;let _0x50f588=await _0x4b485e[_0x23937d(0x1259,0x402,0x1078,0x13b1)](generateWAMessage,_0x5cd288[_0x23937d(0x118c,0x1d0d,0x208d,0xe8e)],_0x562ef5,{'userJid':_0x175756[_0x23937d(0x421,0xf48,0xecd,0x345)]['id'],'quoted':_0x5cd288[_0x313705(0x942,-0x175,0xe04,-0x34)]&&_0x5cd288['quoted']['fakeObj']});_0x50f588['key'][_0x23937d(0x1a6,-0x65f,-0x604,0x3ec)]=areJidsSameUser(_0x5cd288[_0x23937d(0x14ce,0xf95,0x20f7,0x1694)],_0x175756[_0x313705(0x787,0xbe8,0xd5d,-0x2e0)]['id']),_0x50f588[_0x313705(0xcb5,0xb4a,0x187b,0x343)]['id']=_0x5cd288['key']['id'],_0x50f588['pushName']=_0x5cd288[_0x23937d(0x47c,0x11ef,-0x93,-0x55b)];if(_0x5cd288[_0x23937d(0x1d23,0x1a14,0x1038,0x201e)])_0x50f588['participan'+'t']=_0x5cd288['sender'];let _0x26ce26={..._0x4a7d1e,'messages':[proto[_0x23937d(0x5ea,-0x8d2,0x145c,-0x15d)+'Info'][_0x23937d(0x9f7,0x1128,0x9a0,0xdef)](_0x50f588)],'type':_0x4b485e[_0x313705(0x2008,0x2e47,0x214d,0x283a)]};_0x175756['ev'][_0x23937d(0x1285,0x1a72,0xefa,0x20a3)](_0x313705(0xdb3,0x1bc1,0x1080,0xe0f)+'psert',_0x26ce26);}if(_0x4b485e[_0x23937d(0x1676,0xd79,0xacd,0x1f03)](_0x4b485e[_0x313705(0x1209,0x7c6,0x1300,0x1bcb)]('family100',_0x5cd288[_0x23937d(0x118c,0x482,0x98d,0xe04)]),_family100)&&_0x338f49){if(_0x4b485e[_0x23937d(0x170d,0x210b,0x80b,0x25c4)](_0x4b485e[_0x23937d(0x15c5,0x1785,0x1756,0x725)],_0x4b485e[_0x23937d(0x15c5,0x18ab,0xbfd,0x22fe)])){kuis=!![];let _0xa43d75=_family100[_0x4b485e[_0x313705(0x5f2,-0x738,0xe9a,0x105f)](_0x4b485e['kwHGu'],_0x5cd288[_0x23937d(0x118c,0x4e1,0xd96,0xa68)])],_0xa22e6=_0x169e0a[_0x23937d(0x6cb,0xaf6,-0x30c,0xeb6)+'e']()[_0x313705(0x1bd8,0x11bf,0xf98,0x10d5)](/[^\w\s\-]+/,''),_0x44a110=/^((me)?give up|surr?ender)$/i[_0x313705(0x1c74,0x18c9,0x1480,0x1d74)](_0x5cd288[_0x313705(0x209f,0x20ce,0x2500,0x2a7a)]);if(!_0x44a110){let _0x4dd9f1=_0xa43d75[_0x313705(0x1cb4,0x1b15,0x1e33,0x174c)]['findIndex'](_0x21d012=>_0x21d012[_0x313705(0xa31,-0x382,0x2d5,0x51c)+'e']()[_0x23937d(0x1872,0x1901,0x170d,0x15d9)](/[^\w\s\-]+/,'')===_0xa22e6);if(_0xa43d75[_0x313705(0x1ff4,0x2702,0x2c95,0x2450)][_0x4dd9f1])return!(-0x6*-0x62+-0x1ac5+0x1879);_0xa43d75[_0x23937d(0x1c8e,0x1ff9,0x144d,0x17f5)][_0x4dd9f1]=_0x5cd288[_0x313705(0x1834,0x16d2,0x2145,0x208b)];}let _0x2f8b92=_0x4b485e[_0x23937d(0x5ce,0x1298,0x17f,0xb81)](_0xa43d75[_0x313705(0x1ff4,0x1216,0x26e8,0x2311)]['length'],_0xa43d75[_0x23937d(0x1c8e,0x2996,0x11cc,0xefd)][_0x313705(0xa62,-0x3df,0x8c4,0x1311)](_0x513461=>_0x513461)[_0x313705(0x744,-0x495,0xba4,0xe6b)]),_0x3f3b25=('\x0aAnswer\x20Th'+_0x23937d(0xb55,0xa0b,0x1878,0xb81)+_0x23937d(0xe10,0x8b,0x94,0x688)+'s\x20:\x0a'+_0xa43d75['soal']+(_0x313705(0x4c5,0x119,-0x24c,0x9bd)+'s\x20')+_0xa43d75['jawaban'][_0x23937d(0x3de,0x758,0xbb8,0x639)]+_0x23937d(0xf7d,0xe3f,0x1504,0x1c28)+(_0xa43d75[_0x23937d(0x194e,0x282b,0x1126,0x235c)][_0x23937d(0x16c5,0x11c2,0x16d5,0x136d)](_0x353289=>_0x353289['includes']('\x20'))?_0x23937d(0xf61,0x1df9,0x1776,0x1a4d)+_0x23937d(0x14b1,0x1965,0x1912,0x1477)+_0x23937d(0x1876,0x1b4e,0x12a3,0xb6d):'')+'\x0a'+(_0x2f8b92?_0x23937d(0x1880,0x1f13,0x170b,0xecd)+'s\x20Answered':_0x44a110?_0x4b485e[_0x313705(0x6a3,0x1ba,-0x7f2,-0x476)]:'')+'\x0a'+Array[_0x313705(0xf27,0x16ad,0x188e,0xa56)](_0xa43d75[_0x313705(0x1cb4,0xe41,0x135e,0x1b89)],(_0x406cef,_0x17d43b)=>{function _0x1c498f(_0x4febec,_0x28c619,_0x1af7c9,_0x4a4fb3){return _0x313705(_0x4febec- -0x526,_0x1af7c9,_0x1af7c9-0x1ed,_0x4a4fb3-0x9b);}function _0x44f35e(_0x27149f,_0x56eb3b,_0x277eb2,_0x1b2bb3){return _0x23937d(_0x277eb2-0x9e,_0x1b2bb3,_0x277eb2-0xa3,_0x1b2bb3-0x11e);}return _0x44a110||_0xa43d75[_0x44f35e(0x1c9c,0x249c,0x1d2c,0xf63)][_0x17d43b]?('('+(_0x17d43b+(-0x6*-0x449+0x3e8+-0x1d9d))+')\x20'+_0x406cef+'\x20'+(_0xa43d75[_0x1c498f(0x1ace,0x2336,0x20bc,0x1054)][_0x17d43b]?_0x4b485e[_0x44f35e(0xfb,0x90b,0x67d,0x1495)]('@',_0xa43d75[_0x44f35e(0x1a55,0x10e6,0x1d2c,0x124e)][_0x17d43b][_0x1c498f(0xb0f,0x1518,-0x1a2,0x19ae)]('@')[-0x9a6+-0x1eb6*-0x1+-0x1*0x1510]):''))[_0x44f35e(0x266b,0x1039,0x1ca5,0x2217)]():![];})[_0x23937d(0x6fc,0x6d2,0x1134,0x1150)](_0x35c8af=>_0x35c8af)[_0x23937d(0x1c16,0x1c21,0x1e95,0x111b)]('\x0a')+_0x313705(0x4bf,0x711,-0x2a9,0x341)+(_0x44a110?'':_0x313705(0x923,0x9b9,0xbe,0xd74)+_0x313705(0x1d32,0x17df,0x2967,0x22e9)))[_0x23937d(0x1c07,0x1d39,0x182c,0x1964)]();_0x175756['sendText'](_0x5cd288[_0x313705(0x14f2,0x1820,0xb68,0xfd1)],_0x3f3b25,_0x5cd288,{'contextInfo':{'mentionedJid':_0x4b485e[_0x313705(0x143c,0x12de,0x1bc2,0x757)](parseMention,_0x3f3b25)}})['then'](_0x8ac37a=>{function _0x2419d3(_0x2331c4,_0x53fc98,_0x2f204b,_0x4a41b2){return _0x23937d(_0x2f204b- -0x55,_0x53fc98,_0x2f204b-0x73,_0x4a41b2-0x154);}function _0x1449e8(_0x1dd3eb,_0x339899,_0x503212,_0x575a64){return _0x313705(_0x1dd3eb- -0x2b3,_0x503212,_0x503212-0x184,_0x575a64-0x1af);}return _family100[_0x2419d3(0x1cc,0x6ea,0x556,-0x5a0)+_0x5cd288[_0x1449e8(0x123f,0x121a,0x1e38,0x12ad)]]['pesan']=mesg;})['catch'](_0xd93112=>_0xd93112);if(_0x4b485e[_0x23937d(0x909,0xe43,0x740,0x1000)](_0x2f8b92,_0x44a110))delete _family100[_0x4b485e[_0x313705(0x134f,0x1dee,0x1ac2,0x1ece)](_0x4b485e[_0x313705(0x199d,0xe5a,0x2419,0x1c1f)],_0x5cd288[_0x313705(0x14f2,0xfcf,0x1d4c,0x1403)])];}else{_0x323b1b[_0x313705(0x371,0x5a4,-0xb7c,0xd44)](_0x451249);if(_0xfbadde)throw _0x20728b;let _0x15a310=_0x74330d[_0x313705(0x1723,0x1886,0xcdd,0x2059)+'nc'](_0x52e503);const _0xd5db43={};_0xd5db43[_0x313705(0x1fa9,0x1c7e,0x2bb4,0x2a4d)]=_0x15a310;const _0x35dbb6={};_0x35dbb6[_0x23937d(0x5dc,-0x820,0x11bb,0xbda)]=_0x37bbcd,_0x5d7d0e[_0x313705(0xcaa,0xdba,0xdfc,0xea4)+'e'](_0x39661f[_0x23937d(0x118c,0x333,0xc82,0x5d2)],_0xd5db43,_0x35dbb6),_0x137f56[_0x313705(0x371,-0x256,0x137,-0xab0)](_0x34cf9d);}}if(tebaklagu['hasOwnProp'+'erty'](_0x5cd288['sender'][_0x313705(0x1035,0x199a,0x1c8d,0x16e4)]('@')[0x2*-0x888+-0x63b+-0x174b*-0x1])&&_0x338f49){if(_0x4b485e[_0x23937d(0x8f7,0x722,0x164f,0x443)]===_0x4b485e['yJRFf'])_0x1de603[_0xe697b0[_0x313705(0x1834,0x14f8,0x1d8f,0x10cd)][_0x313705(0x1035,0x500,0x444,0x2d6)]('@')[-0x2*-0x6b9+0x209*0xe+-0x29f0]]=_0x11e572[_0x23937d(0x194e,0x152f,0x1f0d,0x1aa7)][_0x23937d(0x6cb,-0x3a9,0xc90,-0x80d)+'e'](),_0x499e35[_0x5612e4['sender']['split']('@')[0xcf8*-0x2+0x2*-0x2a5+0x1f3a]]=_0x5d2c24[_0x313705(0xf86,0xb5b,0x58b,0x803)];else{kuis=!![],jawaban=tebaklagu[_0x5cd288[_0x313705(0x1834,0x197b,0x25fc,0x1e69)][_0x313705(0x1035,0xc2a,0xa82,0x875)]('@')[-0x3*-0x2ef+-0x1928+0x105b]];if(_0x169e0a['toLowerCas'+'e']()==jawaban){const _0x2e3496={};_0x2e3496[_0x313705(0x175a,0xb57,0x15ec,0x19d5)+'t']=_0x4b485e[_0x313705(0x11cf,0x209f,0x1e61,0x1990)];const _0x268523={};_0x268523[_0x23937d(0x1b0c,0x2a0a,0x29de,0x162a)]=_0x313705(0x12ad,0xbc9,0xf82,0x1780),_0x268523['buttonText']=_0x2e3496,_0x268523['type']=0x1,await _0x175756['sendButton'+_0x23937d(0x111a,0xe78,0x1a22,0xb2e)](_0x5cd288[_0x23937d(0x118c,0x486,0x129a,0x8b9)],[_0x268523],_0x313705(0x2158,0x16a6,0x2f19,0x2c0c)+_0x23937d(0xe0d,0x1915,0x17eb,0x183a)+'\x0aCorrect\x20A'+_0x313705(0x1756,0x16c0,0x1329,0x1b4c)+'ant\x20To\x20Pla'+_0x313705(0xd6f,0xa6c,0xe29,0x526)+_0x23937d(0x137a,0x12a9,0x1b40,0x1185)+_0x23937d(0x12d9,0x16f7,0x15a8,0x7be)+'w',_0x175756['user'][_0x313705(0x17b7,0x10fd,0x1628,0x12ac)],_0x5cd288),delete tebaklagu[_0x5cd288[_0x313705(0x1834,0x11ca,0x26fd,0x1516)]['split']('@')[-0x4d*-0x81+-0x6e*-0x7+0xb*-0x3cd]];}else _0x4b485e['xhZhi'](_0x1db05d,_0x4b485e[_0x313705(0x116e,0xf0b,0x16c2,0x201d)]);}}if(kuismath[_0x313705(0xe35,0x40e,0x1017,0xc95)+_0x23937d(0x1020,0x16b2,0x7aa,0x574)](_0x5cd288['sender'][_0x313705(0x1035,0x3ad,0x92c,0x16e)]('@')[0x52d*0x5+0xc80*-0x1+-0xd61])&&_0x338f49){kuis=!![],jawaban=kuismath[_0x5cd288[_0x23937d(0x14ce,0x2116,0x887,0x13e3)]['split']('@')[0xb72+-0x3*-0x5fb+0x1d63*-0x1]];if(_0x169e0a[_0x313705(0xa31,0x353,-0xfa,0x15a2)+'e']()==jawaban)await _0x4b485e[_0x313705(0x1bd7,0x1d29,0xdfe,0x16d1)](_0x1db05d,_0x23937d(0x815,0x1402,0x2a0,0x681)+_0x313705(0xf8b,0x11d1,0x45e,0xbb1)+'ct\x20Answer\x20'+_0x23937d(0x999,0x4b3,-0x551,0xb92)+_0x313705(0x1d75,0x1a39,0x19a5,0x28f8)+_0x23937d(0xe75,0xe3f,0x13e2,0x3d7)+_0xe1d953+_0x313705(0xd9b,0x63,0x377,0x1b42)),delete kuismath[_0x5cd288[_0x313705(0x1834,0x2345,0x1c54,0x16c5)][_0x313705(0x1035,0x2f4,0x1724,0x12ef)]('@')[0x7e8+0x23fc+-0x2be4]];else _0x4b485e[_0x313705(0x586,0x592,0x5b6,-0x647)](_0x1db05d,_0x4b485e[_0x23937d(0xe08,0xe1a,0x1bc6,0x599)]);}if(tebakgambar[_0x23937d(0xacf,0x119f,0x11a1,0x1156)+_0x23937d(0x1020,0x1716,0x1ad7,0x1dc1)](_0x5cd288[_0x313705(0x1834,0x178f,0x12ea,0x1ba8)][_0x23937d(0xccf,0x1090,0x598,0x7e1)]('@')[0x603+0xd76*-0x2+0x14e9])&&_0x338f49){kuis=!![],jawaban=tebakgambar[_0x5cd288[_0x313705(0x1834,0xb7f,0x1895,0x2116)]['split']('@')[-0x9*-0x2e+0x2064+-0x2202]];if(_0x4b485e[_0x23937d(0x716,0x13ab,0xd31,0x810)](_0x169e0a['toLowerCas'+'e'](),jawaban)){if(_0x4b485e[_0x23937d(0x1024,0xa72,0x1752,0x1268)](_0x4b485e[_0x23937d(0x16a1,0xea8,0x7f1,0x181a)],_0x4b485e[_0x23937d(0x16a1,0x21c7,0xe82,0x1b1d)]))var _0x2d5cc1=_0x4b485e[_0x313705(0x4b4,0x8dd,0x1237,0xd27)];else{const _0x1622a4={};_0x1622a4[_0x313705(0x1e72,0x1480,0x257c,0x183f)]=_0x4b485e['BzfmE'],_0x1622a4[_0x23937d(0x159c,0x16b6,0x177c,0x1bcd)]={},_0x1622a4[_0x313705(0xa9e,0x17de,-0x12d,0x118b)]=0x1,_0x1622a4[_0x23937d(0x159c,0x16b6,0x177c,0x1bcd)][_0x23937d(0x13f4,0xa7e,0xe53,0x17ee)+'t']=_0x4b485e['ZaqqR'],await _0x175756['sendButton'+_0x313705(0x1480,0x137a,0x17d7,0x1cfb)](_0x5cd288[_0x23937d(0x118c,0x14c6,0x10ba,0x1220)],[_0x1622a4],'🎮\x20Guess\x20Th'+_0x23937d(0x1ae4,0x1eab,0x2080,0x23fa)+_0x23937d(0x642,0x12c3,-0x73d,0x4d0)+_0x313705(0xeb8,0x3b,0x980,0x908)+_0x23937d(0x195d,0xb15,0xb45,0x2358)+_0x23937d(0x160e,0x18be,0x1c49,0xf90)+_0x313705(0x9c6,0x15a1,0x17f,-0x24d)+_0x313705(0x7ae,-0xe3,0xa9f,0x12a1)+_0x313705(0x127c,0x1bad,0x11ed,0x1958),_0x175756[_0x23937d(0x421,-0x423,0xcda,0xc34)][_0x23937d(0x1451,0x205e,0x17c4,0x82f)],_0x5cd288),delete tebakgambar[_0x5cd288[_0x23937d(0x14ce,0x206c,0x12b7,0xb6b)]['split']('@')[0x2511+0x5e6+-0x2af7]];}}else _0x4b485e[_0x23937d(0x89a,0x2b4,0xb70,-0x4fc)](_0x1db05d,_0x4b485e['mivIT']);}if(tebakkata[_0x313705(0xe35,0x55d,0x1581,0x1d18)+'erty'](_0x5cd288['sender'][_0x23937d(0xccf,0x11c6,0x6cd,0xc02)]('@')[-0x7ad+-0x5de+-0x1*-0xd8b])&&_0x338f49){if(_0x4b485e[_0x313705(0x1803,0x141e,0x2000,0x1ef2)]!==_0x313705(0x1f0e,0x2daa,0x1d99,0x2a55)){kuis=!![],jawaban=tebakkata[_0x5cd288['sender'][_0x313705(0x1035,0x5ed,0xdde,0xc0f)]('@')[-0x200*-0xd+0xe98+-0x2898]];if(_0x4b485e[_0x23937d(0x560,-0x80b,0x25c,0x6bc)](_0x169e0a[_0x313705(0xa31,0x310,0x16bd,0xe31)+'e'](),jawaban)){if(_0x4b485e[_0x313705(0x1037,0x1e5f,0x11d0,0x6fa)](_0x4b485e['xPMQE'],_0x4b485e[_0x23937d(0xe6,-0x208,-0xd1a,0x6b1)])){const _0x1b10ec={};_0x1b10ec[_0x313705(0x1e72,0x1fa1,0x175b,0x2c3d)]=_0x4b485e[_0x313705(0x10a3,0x506,0xf27,0x113f)],_0x1b10ec[_0x313705(0x1902,0xfab,0x24b3,0xe78)]={},_0x1b10ec['type']=0x1,_0x1b10ec[_0x313705(0x1902,0xfab,0x24b3,0xe78)][_0x23937d(0x13f4,0xab6,0x1e92,0x6be)+'t']=_0x4b485e['RGZjs'],await _0x175756[_0x23937d(0x7d8,0x1c2,0xca3,-0x6de)+_0x23937d(0x111a,0x547,0x1315,0x1c08)](_0x5cd288[_0x313705(0x14f2,0x1b64,0x698,0x1535)],[_0x1b10ec],_0x313705(0x2158,0x2dd7,0x292f,0x2cf5)+'e\x20Word\x20🎮\x0a\x0a'+_0x23937d(0xfc3,0xef2,0x15d8,0x208)+_0x23937d(0xd0c,0x18,0xfde,-0x185)+_0x313705(0x1403,0x17dd,0x16ea,0x1b07)+_0x23937d(0x346,0x952,-0x415,0x932)+_0x23937d(0x1b93,0xfdd,0x1d4e,0x2061)+_0x313705(0x1e55,0x243f,0x1f97,0x1315),_0x175756[_0x313705(0x787,0xdac,-0x114,-0x3b7)][_0x313705(0x17b7,0x1dfc,0x940,0x21d3)],_0x5cd288),delete tebakkata[_0x5cd288['sender'][_0x313705(0x1035,0x146e,0x893,0x1be2)]('@')[0x2599+-0x2415+0x184*-0x1]];}else{if(_0xa1048)return _0x390543(_0x1993d7[_0x313705(0x982,0x1ad,0xd1f,-0x208)]);if(_0x5613a2)return _0x466401(_0x14c935[_0x313705(0x926,-0x286,0xb32,0x4f9)]);if(!_0x55f28f[_0x23937d(0x1c16,0x1aae,0x2227,0x1e96)]('\x20'))return _0x3050fd(_0x23937d(0xda5,0x1947,0x92c,0x77f)+_0x4b485e['UqomV'](_0x3e7424,_0x37a899)+_0x313705(0xdf2,0x1444,0x121e,0x1884));_0x2ef67a[_0x313705(0xac5,0x1639,0xe91,0x11cd)](_0x25b4a1[_0x23937d(0x1c16,0x1acb,0x2149,0x1d0a)]('\x20'))['then'](async _0x242269=>{_0x5e78bf=_0x56bfc5(0x14c0,0xe86,0x8f7,0xe73)+_0x56bfc5(0xdfc,0x701,-0x7c0,0x10d6);for(let _0x1ce848 of _0x242269){_0x44ea26+=_0x4a1f4b(0x10fb,0x109c,0x1e7b,0xd19)+_0x1ce848[_0x56bfc5(0x1ba7,0x12a0,0xdf7,0xa3d)]+('\x0aCategory\x20'+':\x20')+_0x1ce848[_0x4a1f4b(0x15af,0xa62,0x1d62,0x14a5)]+_0x4a1f4b(0x5a6,0x329,0x390,0x8ef)+_0x1ce848[_0x56bfc5(0x119,0x8a1,0x8d6,0xeb3)]+_0x4a1f4b(0x1e0c,0x2552,0x1d58,0x1831)+_0x1ce848[_0x4a1f4b(0x16fe,0x17b5,0x23d9,0x155e)]+_0x56bfc5(0x25bd,0x1b99,0x18e3,0x1a33)+_0x1ce848[_0x56bfc5(0x21da,0x1947,0x13a1,0x195e)];}const _0x27ce8a={};function _0x56bfc5(_0x1251e9,_0x64f11b,_0x4c10bf,_0x4b999a){return _0x313705(_0x64f11b- -0x517,_0x4b999a,_0x4c10bf-0x40,_0x4b999a-0x1c8);}_0x27ce8a[_0x56bfc5(0xf39,0x1243,0x1ad8,0x1d9d)+'t']=_0x4b485e[_0x56bfc5(0xddc,0x222,-0x9b9,0x1b)];const _0x4b03c4={};_0x4b03c4[_0x56bfc5(0x1701,0x195b,0x1b4f,0xdf8)]=_0x4a1f4b(0x1dc1,0x118e,0xfdf,0x2984),_0x4b03c4['buttonText']=_0x27ce8a,_0x4b03c4['type']=0x1;let _0x290462=[_0x4b03c4];const _0x173e6b={};_0x173e6b[_0x56bfc5(0x254f,0x1a92,0xdef,0x1295)]=_0x26d1c3,_0x173e6b[_0x56bfc5(0xc78,0x309,0x42d,-0xadf)+_0x56bfc5(-0x1d0,0xb60,0x1164,0x997)]=_0xd593dd,_0x173e6b[_0x56bfc5(0x1be,0x7b7,0x201,-0x733)]=_0x3c7885;function _0x4a1f4b(_0x13427a,_0x26e9ca,_0x4582ac,_0x31c4d1){return _0x313705(_0x13427a-0x4b,_0x4582ac,_0x4582ac-0xd1,_0x31c4d1-0x12d);}_0x173e6b[_0x4a1f4b(0x141f,0x660,0x1dcc,0x2097)]=''+_0x109a81['botname'],_0x173e6b[_0x4a1f4b(0xfeb,0x614,0x1db9,0x1be2)]=_0x290462,_0x173e6b[_0x56bfc5(0x1731,0x1968,0xa9e,0x23c7)]=0x4;let _0x49a414=_0x173e6b;const _0x2e7ec1={};_0x2e7ec1[_0x56bfc5(-0x3a0,0x42b,-0x72e,-0xa7)]=_0x7777d8,_0x308a3c[_0x56bfc5(0x1665,0x793,0xed3,0x64b)+'e'](_0x4169cc[_0x4a1f4b(0x153d,0xf99,0x168d,0x13c1)],_0x49a414,_0x2e7ec1);});}}else _0x4b485e['uhXTr'](_0x1db05d,_0x4b485e[_0x23937d(0xe08,0x1615,0x66,0x19cd)]);}else{const _0x9b75a3=(_0x23937d(0x1805,0x1286,0xdab,0x2430)+'4')[_0x313705(0x1035,0x164b,0xbfc,0x1043)]('|');let _0x1a2f8e=0x15f9+-0x1*-0xef9+-0x24f2;while(!![]){switch(_0x9b75a3[_0x1a2f8e++]){case'0':_0x178dc0+='Upload:\x20'+_0x16115c[_0x23937d(0x879,0xa17,0x1529,-0x251)+_0x23937d(0xc78,0x1b31,0x1907,0x16e8)]+'\x0a';continue;case'1':_0xf89e6b+=-0x389+0x313+0x1*0x77;continue;case'2':_0x146194+=_0x313705(0x1cb1,0x25b9,0x24ab,0x2395)+_0x1d61c3[_0x313705(0x1503,0xa25,0x1d85,0x1623)]()+_0x313705(0xbf7,0x52a,0x5b3,0x507);continue;case'3':_0xb0961f+=_0x313705(0x936,0xead,-0x1c6,-0x2f5)+_0x1ceff2[_0x313705(0x1eaf,0x1799,0x22ed,0x1985)]+'\x0a';continue;case'4':_0x437833+=_0x313705(0x45c,-0x2bc,-0x4d5,0xaf)+_0x99cab0['berita_url']+'\x0a';continue;case'5':_0x1d56db+='Type:\x20'+_0x31b26c[_0x23937d(0xff8,0x6ec,0x1477,0x69b)+'is']+'\x0a';continue;}break;}}}if(caklontong['hasOwnProp'+_0x23937d(0x1020,0x1c03,0xedc,0xd8a)](_0x5cd288[_0x313705(0x1834,0xf3b,0x2740,0x225f)][_0x23937d(0xccf,0xdcd,0x8a8,0x7b4)]('@')[-0x22ea+-0x17a0+0x3b*0xfe])&&_0x338f49){if(_0x4b485e['ppJVt'](_0x23937d(0x16ee,0xd44,0x1d46,0x16a8),_0x4b485e['khvZg'])){const _0x10ffcb={};_0x10ffcb[_0x313705(0x209f,0x13a1,0x2483,0x1c65)]=''+_0x3e031f[_0x313705(0x5b3,0x83a,-0x88d,0x732)];const _0x429e72={};_0x429e72['quoted']=_0x1fda2a,_0x216668[_0x23937d(0x944,0x18b,-0x100,0x978)+'e'](_0x43df15[_0x313705(0x14f2,0xe7c,0x1009,0x714)],_0x10ffcb,_0x429e72);}else{kuis=!![],jawaban=caklontong[_0x5cd288[_0x23937d(0x14ce,0x1aa9,0x1d0d,0x8b4)][_0x313705(0x1035,0xaf6,0x1479,0x1083)]('@')[-0x864+0x18c1*0x1+-0x105d]],deskripsi=caklontong_desk[_0x5cd288[_0x23937d(0x14ce,0x1f49,0xd50,0x1e94)]['split']('@')[-0xd*-0x18d+0x1459+-0x2882]];if(_0x4b485e[_0x23937d(0x141f,0x1018,0xddc,0x10d2)](_0x169e0a[_0x23937d(0x6cb,-0xf9,0xf23,0x2b2)+'e'](),jawaban)){const _0x4f4c70={};_0x4f4c70[_0x313705(0x1e72,0x1c77,0x1e27,0x1c3d)]=_0x4b485e[_0x313705(0x1bab,0x1932,0x1ccf,0x20aa)],_0x4f4c70[_0x313705(0x1902,0x1082,0x1a23,0x1d32)]={},_0x4f4c70[_0x23937d(0x738,0x977,-0x414,0x6ca)]=0x1,_0x4f4c70[_0x313705(0x1902,0x1082,0x1a23,0x1d32)]['displayTex'+'t']=_0x4b485e[_0x23937d(0x2f3,0x1035,-0xad6,-0x728)],await _0x175756['sendButton'+_0x23937d(0x111a,0xb6f,0x18b2,0xad2)](_0x5cd288[_0x313705(0x14f2,0x134f,0xca7,0xc90)],[_0x4f4c70],_0x23937d(0x1df2,0x19ed,0x23b3,0x2bf3)+_0x23937d(0x1cf4,0x10fd,0x1fb5,0x15a2)+'\x0aCorrect\x20A'+'nswer\x20🎉\x0a*'+deskripsi+('*\x0a\x0aWant\x20To'+'\x20Play\x20Agai'+_0x23937d(0x10b8,0x142a,0x1833,0x1585)+_0x23937d(0x96f,0xedd,0x106f,0x7f)+_0x23937d(0x1893,0x1642,0x126c,0x17b8)),_0x175756[_0x313705(0x787,0xdde,0x1291,0x112f)][_0x313705(0x17b7,0x24d7,0x1456,0xda4)],_0x5cd288),delete caklontong[_0x5cd288[_0x313705(0x1834,0x25a6,0x2492,0x13b1)][_0x313705(0x1035,0x19d,0x1b45,0x6a4)]('@')[0x12d2+0x5*0x18b+-0x1a89]],delete caklontong_desk[_0x5cd288[_0x23937d(0x14ce,0x788,0xc5a,0x7fc)][_0x23937d(0xccf,0x4b5,0x266,0x6f1)]('@')[0x1fd0+0x11*-0xdd+0x1*-0x1123]];}else _0x4b485e[_0x23937d(0x9b1,0x23c,0x683,0x20f)](_0x1db05d,_0x4b485e[_0x313705(0x116e,0x50a,0x8a9,0x14fb)]);}}if(tebakkalimat[_0x23937d(0xacf,-0x3d2,-0x2d7,0x13e2)+_0x23937d(0x1020,0x4f0,0x15ab,0xe51)](_0x5cd288[_0x23937d(0x14ce,0x8ca,0x1f4e,0xa07)]['split']('@')[-0x1fc6+-0x2b5+0x227b])&&_0x338f49){kuis=!![],jawaban=tebakkalimat[_0x5cd288[_0x313705(0x1834,0x17ae,0x2228,0x1f53)][_0x23937d(0xccf,-0x103,0x8c4,0x1068)]('@')[-0x5c*-0x11+0x2f5+-0x911]];if(_0x4b485e[_0x23937d(0x171f,0xf7d,0x19eb,0x1834)](_0x169e0a[_0x313705(0xa31,0x8bc,0x1902,0x14af)+'e'](),jawaban)){if(_0x313705(0x13c0,0x1d41,0x157f,0x1fd0)!==_0x4b485e[_0x313705(0xbaa,-0x2b8,0x1524,0x94b)]){const _0x1bf21c={};_0x1bf21c[_0x313705(0x175a,0x235e,0xe43,0x1e63)+'t']=_0x4b485e['YQsdn'];const _0x4c9ada={};_0x4c9ada['buttonId']=_0x23937d(0x1cf7,0xff1,0xe87,0x2119)+_0x313705(0x1582,0x1616,0x2379,0x1504),_0x4c9ada[_0x313705(0x1902,0x1467,0x256d,0x24ad)]=_0x1bf21c,_0x4c9ada[_0x23937d(0x738,0x102a,0x233,0x1259)]=0x1,await _0x175756[_0x313705(0xb3e,0x704,0x6ec,0x18f7)+_0x313705(0x1480,0x1733,0x1651,0x102d)](_0x5cd288['chat'],[_0x4c9ada],_0x313705(0x2158,0x172b,0x1818,0x1d24)+_0x313705(0x617,-0x1a4,0xa39,0x630)+'\x20🎮\x0a\x0aCorrec'+_0x313705(0x7d0,0xc3b,-0x3a1,-0x15e)+_0x313705(0x5c0,-0x4e6,-0x682,-0x705)+'Play\x20Again'+_0x313705(0x1cc7,0x1fc3,0x2131,0x1cf9)+_0x23937d(0x4d,-0xa95,-0xbcb,-0x127)+_0x23937d(0x3d2,0xd7,-0x23c,-0x31a),_0x175756[_0x313705(0x787,0x2af,-0x653,-0x53)][_0x23937d(0x1451,0x19a6,0xf7b,0x145b)],_0x5cd288),delete tebakkalimat[_0x5cd288[_0x313705(0x1834,0x1855,0x218e,0x145b)][_0x23937d(0xccf,0x574,0x8be,-0xa5)]('@')[-0x818+-0xc*-0xe2+-0x280]];}else{if(_0x42a261===_0x256b40){_0x5a7388=_0x674317[_0x23937d(0x13bd,0x929,0x1484,0x1d83)+'nc']('./Android/'+_0x313705(0x1a08,0xf7b,0x1401,0x18f4)+_0x313705(0x1b71,0x247a,0xcd3,0x1bfa)+_0x162abc+'.jpg');const _0x343360={};_0x343360['image']=_0x2f83b9;const _0x43b092={};_0x43b092[_0x313705(0x942,0x11e,0x47c,0x9f7)]=_0x5771e4,_0x3dbc76['sendMessag'+'e'](_0xd41d28[_0x313705(0x14f2,0x116d,0x192b,0x23fb)],_0x343360,_0x43b092);}}}else _0x1db05d(_0x4b485e[_0x313705(0x116e,0x867,0x104f,0x75c)]);}if(tebaklirik['hasOwnProp'+_0x23937d(0x1020,0x17f1,0x3ef,0x69b)](_0x5cd288[_0x313705(0x1834,0x1c37,0x1d72,0x11c3)][_0x313705(0x1035,0x1a2a,0xaef,0x198e)]('@')[0x14b6+0xb81+-0x1*0x2037])&&_0x338f49){if(_0x4b485e[_0x23937d(0x370,-0x9b4,0xfd7,0x21a)](_0x4b485e['TdFhQ'],_0x23937d(0xf42,0x1396,0x23e,0x1351))){kuis=!![],jawaban=tebaklirik[_0x5cd288['sender']['split']('@')[0x3b*-0x95+0x1857+0xa00]];if(_0x4b485e['JHUaj'](_0x169e0a['toLowerCas'+'e'](),jawaban)){const _0x2e19c7={};_0x2e19c7['buttonId']=_0x4b485e[_0x23937d(0x14ec,0x1a26,0x1e69,0x7d5)],_0x2e19c7[_0x313705(0x1902,0x26bc,0x15eb,0xba8)]={},_0x2e19c7[_0x313705(0xa9e,0x5a5,0x1062,0x1367)]=0x1,_0x2e19c7[_0x313705(0x1902,0x26bc,0x15eb,0xba8)][_0x23937d(0x13f4,0x21e9,0x16b3,0xd1a)+'t']=_0x4b485e[_0x23937d(0x3b5,-0x82f,0xad3,0x298)],await _0x175756[_0x23937d(0x7d8,-0x51e,0x2bb,-0x33)+_0x313705(0x1480,0xf63,0x91e,0x119c)](_0x5cd288[_0x23937d(0x118c,0x19c5,0xc83,0xd90)],[_0x2e19c7],_0x23937d(0x1df2,0x2434,0x2b49,0x2204)+_0x313705(0x1123,0x18f3,0x120e,0xa22)+_0x313705(0x1e98,0x1ba5,0x1e3c,0x1cff)+'Answer\x20🎉\x0a\x0a'+_0x313705(0x1fb3,0x1888,0x1ca1,0x2038)+'ay\x20Again?\x20'+'Press\x20The\x20'+'Button\x20Bel'+'ow',_0x175756[_0x313705(0x787,0x350,0xaaf,0x69)]['name'],_0x5cd288),delete tebaklirik[_0x5cd288[_0x23937d(0x14ce,0x609,0x20d4,0x23a3)][_0x23937d(0xccf,0x134e,0x6b1,0xca7)]('@')[0x17f6+-0x24b3+0xcbd*0x1]];}else _0x1db05d(_0x4b485e[_0x23937d(0xe08,0x19dd,0x199c,0x166e)]);}else _0x458772[_0x2a03da[_0x23937d(0x14ce,0x1960,0x16a2,0x1129)][_0x23937d(0xccf,0x775,0x62e,0x11b5)]('@')[0x1dc1+-0x823+-0x159e]]=_0x4881b6[_0x23937d(0x194e,0x1d07,0x18d7,0x1092)]['toLowerCas'+'e']();}if(tebaktebakan['hasOwnProp'+'erty'](_0x5cd288[_0x23937d(0x14ce,0x19e5,0xd78,0x12d8)][_0x23937d(0xccf,0x19f5,0x11da,0x13ca)]('@')[-0x74+-0xa31+0x6d*0x19])&&_0x338f49){if(_0x4b485e[_0x23937d(0xaea,0xb6c,0x12e9,0x17d3)](_0x23937d(0x19c1,0xdc1,0x16b5,0x2058),_0x4b485e[_0x313705(0x1b90,0x15bb,0x20d4,0x2373)])){kuis=!![],jawaban=tebaktebakan[_0x5cd288[_0x23937d(0x14ce,0x665,0x200c,0x150d)][_0x23937d(0xccf,0x1aad,0xfbe,0xaad)]('@')[0xe1c+-0x5*-0x4e3+0x21*-0x12b]];if(_0x4b485e['sytTF'](_0x169e0a['toLowerCas'+'e'](),jawaban)){if(_0x4b485e[_0x23937d(0x16d9,0x1d3e,0x1418,0x19df)](_0x4b485e[_0x313705(0x16fe,0x213a,0x24f5,0x2579)],_0x313705(0xd80,0x166b,0x1aec,0xf20))){const _0xfeaab4={};_0xfeaab4[_0x23937d(0x1b0c,0x1931,0x1893,0x1864)]=_0x4b485e['BRAxY'],_0xfeaab4['buttonText']={},_0xfeaab4['type']=0x1,_0xfeaab4['buttonText'][_0x313705(0x175a,0xb81,0xa56,0x1d72)+'t']=_0x4b485e[_0x23937d(0xec0,0x18c4,0x1cb5,0xf94)],await _0x175756[_0x23937d(0x7d8,-0x735,-0x231,0x10e)+_0x313705(0x1480,0x1658,0x7bb,0x1487)](_0x5cd288['chat'],[_0xfeaab4],_0x23937d(0x1df2,0x1076,0x2b60,0x13a9)+_0x23937d(0x398,0xb26,-0xa72,0xe45)+_0x23937d(0x1b32,0x2a2d,0x1a4f,0x179a)+_0x313705(0xd00,0x65b,0x76d,0x888)+_0x23937d(0x1c4d,0x1640,0x1b4b,0x1e4c)+'ay\x20Again?\x20'+_0x23937d(0x5c3,0x1df,0x114c,0xd39)+'Button\x20Bel'+'ow',_0x175756[_0x313705(0x787,0xa61,0x107b,0xbb4)][_0x23937d(0x1451,0x603,0xe18,0x151f)],_0x5cd288),delete tebaktebakan[_0x5cd288[_0x23937d(0x14ce,0x1900,0x974,0x22bd)][_0x313705(0x1035,0x1a65,0x17fa,0xee8)]('@')[0x1658+0x3ef*0x9+-0x39bf]];}else{if(_0x16b5ad)return _0x4b485e[_0x23937d(0x18a1,0xc58,0x216c,0xfcb)](_0x53ee5f,_0xa234f5[_0x23937d(0x61c,0xf39,0x1083,0x139e)]);if(_0x457aba)return _0x4b485e['KglSS'](_0x13f437,_0x5dc2b9[_0x23937d(0x5c0,0x1095,-0x41a,0xb83)]);const _0x1489da=_0xdaf83c[_0x23937d(0xcb,-0x579,0x133,-0x409)+'e'](),_0x2df4b4=_0x4b5e23['cpus']()['map'](_0xa0fb6a=>{function _0x18ab34(_0x226893,_0x3da8a4,_0x22b9db,_0x5c951d){return _0x313705(_0x3da8a4- -0x123,_0x22b9db,_0x22b9db-0x21,_0x5c951d-0x11e);}function _0x2943da(_0x589a90,_0x53ddf4,_0x3d0dbc,_0x1bb1ae){return _0x313705(_0x3d0dbc- -0x4c5,_0x53ddf4,_0x3d0dbc-0x11b,_0x1bb1ae-0x1af);}return _0xa0fb6a['total']=_0x5b63e8['keys'](_0xa0fb6a[_0x18ab34(0x10c5,0x678,0x76b,0xa78)])['reduce']((_0x44aa51,_0x3e0221)=>_0x44aa51+_0xa0fb6a[_0x18ab34(0x114a,0x678,0x87c,0xa51)][_0x3e0221],-0x89*0x15+-0x271+0x11*0xce),_0xa0fb6a;}),_0x1a54ee={};_0x1a54ee[_0x23937d(0x421,-0x9ff,0x6ea,-0x804)]=0x0,_0x1a54ee[_0x23937d(0xbf4,0x200,0x12a,0x11)]=0x0,_0x1a54ee['sys']=0x0,_0x1a54ee[_0x23937d(0xaac,0x1392,0x1449,0xb31)]=0x0,_0x1a54ee['irq']=0x0;const _0x23b841={};_0x23b841[_0x313705(0x1579,0xbe2,0x2098,0x90f)]=0x0,_0x23b841[_0x313705(0x9a7,0xa47,-0x4bf,0x15bd)]=0x0,_0x23b841[_0x23937d(0x435,0x30d,0x113b,0xd23)]=_0x1a54ee;const _0x37e272=_0x2df4b4[_0x23937d(0x1b38,0x1594,0x25cd,0x19ee)]((_0x1ef13b,_0xfd3aac,_0x4f277c,{length:_0x5428dd})=>{const _0x2ef36f=(_0x3fafee(0x1439,0x18ec,0x1dd5,0xdba)+_0x456dd7(0xab0,0x1916,0x17df,0x1df7))[_0x3fafee(0xf89,0x14e2,0x116,0x963)]('|');function _0x3fafee(_0x49d745,_0x32155c,_0x29ab30,_0x25f68a){return _0x23937d(_0x49d745-0x2ba,_0x29ab30,_0x29ab30-0x1c3,_0x25f68a-0x104);}let _0x590026=-0x10ab+0x180c+-0x1*0x761;function _0x456dd7(_0x59b6e0,_0x44cb9d,_0x5574af,_0x2a15b7){return _0x23937d(_0x44cb9d-0x3a6,_0x5574af,_0x5574af-0xbf,_0x2a15b7-0x155);}while(!![]){switch(_0x2ef36f[_0x590026++]){case'0':_0x1ef13b['times'][_0x3fafee(0xeae,0x692,0x17d1,0x74d)]+=_0xfd3aac[_0x456dd7(0xbef,0x7db,0x16c7,-0x600)][_0x456dd7(0x1cd2,0xf9a,0x135e,0xdd8)];continue;case'1':_0x1ef13b[_0x456dd7(0x1b,0x7db,0x7d5,-0x539)][_0x3fafee(0x6db,0x97f,0xb04,-0x513)]+=_0xfd3aac[_0x3fafee(0x6ef,0x47d,0x145c,0xb57)][_0x456dd7(-0x4b6,0x7c7,0x886,0x11d2)];continue;case'2':_0x1ef13b['times']['sys']+=_0xfd3aac[_0x456dd7(-0x5d6,0x7db,0x40d,0xd97)][_0x3fafee(0xa31,0x5c5,0x793,0xebc)];continue;case'3':return _0x1ef13b;case'4':_0x1ef13b[_0x456dd7(-0xd9,0x7db,0x1a0,0x679)][_0x456dd7(0x170,0xd2b,0x5ea,0x1d5)]+=_0xfd3aac[_0x3fafee(0x6ef,0xb95,0xfd8,0x1030)][_0x456dd7(-0x75,0xd2b,0x15e2,0x1b74)];continue;case'5':_0x1ef13b[_0x3fafee(0x14cd,0x1146,0x72b,0x1579)]+=_0xfd3aac['speed']/_0x5428dd;continue;case'6':_0x1ef13b[_0x3fafee(0x8fb,0x504,0xa5a,0x5ef)]+=_0xfd3aac[_0x3fafee(0x8fb,0xb77,-0x379,-0x451)];continue;case'7':_0x1ef13b['times'][_0x456dd7(0x3e9,0xe52,0x1b6a,0x1106)]+=_0xfd3aac[_0x456dd7(0x2fd,0x7db,0x140c,0xe18)][_0x456dd7(0xf9c,0xe52,0x1100,0x1517)];continue;}break;}},_0x23b841);let _0x22e914=_0x4b485e[_0x23937d(0x282,0x983,0xf3,0x861)](_0x3ded77),_0x23f9a4=_0x4b485e['lQYRS'](_0x4b485e[_0x313705(0x5e8,0x63a,0xec5,0xbf)](_0x191fa6),_0x22e914);_0x48cc8d=_0x2f2383[_0x23937d(0xa6d,0x1367,0x9d9,-0xf6)](),_0xf2c1c6=_0x1adf28[_0x313705(0xdd3,0x4c1,0x1931,0x157)](),_0x17eac3=(_0x23937d(0x911,0x1116,0x14cb,-0x23a)+'Speed\x20'+_0x23f9a4[_0x313705(0xbfc,0x62a,-0x1ee,0x13eb)](0x8*0x3d6+-0x1365+0xb47*-0x1)+('\x20_Second_\x20'+'\x0a\x20')+_0x4b485e['lQYRS'](_0x40841b,_0x5d4d96)+(_0x23937d(0x1839,0x240d,0x21ea,0xee4)+'nds_\x0a\x0aRunt'+'ime\x20:\x20')+_0x4b485e[_0x313705(0x162b,0x24d7,0x976,0x14dd)](_0x3150c6,_0x121ca5['uptime']())+(_0x23937d(0xb6b,0x4da,-0x2da,0xce4)+_0x313705(0xf36,0xf31,0x16ff,0x1508)+'\x20')+_0x4ca79e(_0x9d24ed['totalmem']()-_0x5ce69f['freemem']())+_0x313705(0x177c,0x1da0,0xdd1,0x1e5f)+_0x4b8c2a(_0x3e8739['totalmem']())+(_0x23937d(0x502,-0x506,0x89b,0x7f5)+_0x23937d(0x1c91,0xf9d,0x1adc,0x1a3c)+_0x313705(0x1c5a,0x14c4,0x27b9,0x2995))+_0x49ed8c[_0x313705(0x1e00,0x1407,0x26d9,0x1cf3)](_0x1489da)[_0x313705(0xe7c,0x5c7,0x1d5,0xa3d)]((_0x5ef549,_0x947a50,_0x5bbaa8)=>_0x5ef549[_0x313705(0xeb4,0x16b6,0x1b51,0x1837)](_0x242894[_0x23937d(0x62b,0x13fd,0x1522,0x16d)](..._0x5bbaa8[_0x313705(0xe7c,0x1c49,0xd33,0x1bdc)](_0x587beb=>_0x587beb[_0x313705(0x744,-0x3d8,-0xe9,-0x607)])),'\x20')+':\x20'+_0x513606(_0x1489da[_0x5ef549]))[_0x313705(0x1f7c,0x10c1,0x2cd9,0x2d8d)]('\x0a')+'\x0a\x0a'+(_0x2df4b4[0x148a+-0xc5*-0xc+0x2*-0xee3]?_0x313705(0x1155,0xb61,0xdb0,0x1ab1)+_0x313705(0xafd,0x1090,-0xc3,0x1840)+_0x2df4b4[0x312*0xb+0x2667+-0x482d][_0x313705(0x808,0x1073,0xf6b,0xfd2)][_0x313705(0x1f6d,0x2cb2,0x25e0,0x2379)]()+'\x20('+_0x37e272[_0x23937d(0x1213,0x1a65,0x1a8a,0xef2)]+'\x20MHZ)\x0a'+_0x47caad[_0x313705(0x1e00,0x14fb,0x25ac,0x2ca2)](_0x37e272[_0x23937d(0x435,-0xa10,0x9c,0xc00)])[_0x23937d(0xb16,0x1538,0x8ee,0x3b7)](_0x2eb7f3=>_0x23937d(0x258,0x80,-0x870,0x372)+(_0x2eb7f3+'*')[_0x313705(0xeb4,0x1855,0xfa8,0xa5a)](-0x130*0x1c+0x1209*-0x1+0xa43*0x5)+':\x20'+((0x4cb*0x1+0x1569+-0x19d0)*_0x37e272['times'][_0x2eb7f3]/_0x37e272[_0x23937d(0x641,0x1474,0x740,-0x2bb)])[_0x313705(0xbfc,0x77e,0x61d,0xf64)](-0x1*0x1e99+-0x1de7*-0x1+-0x3*-0x3c)+'%')['join']('\x0a')+(_0x23937d(0xf85,0xf20,0x325,0x1a24)+_0x23937d(0x7cc,0x15be,0x68a,-0x3b9)+'(')+_0x2df4b4[_0x23937d(0x3de,-0xa7a,0x913,0x850)]+(_0x313705(0x63a,0x207,0x148,-0x543)+'_\x0a')+_0x2df4b4[_0x313705(0xe7c,0x73b,0x14c8,0x1327)]((_0x57a41b,_0x3732eb)=>_0x3732eb+(-0x2e*0xb1+-0x135e+0x1*0x332d)+'.\x20'+_0x57a41b[_0x313705(0x808,0x1060,0x1703,0x549)][_0x23937d(0x1c07,0x25ce,0x26a7,0x143a)]()+'\x20('+_0x57a41b[_0x313705(0x1579,0xdcc,0xd40,0x12b9)]+'\x20MHZ)\x0a'+_0x10f817[_0x23937d(0x1a9a,0x1235,0xdb3,0x12bd)](_0x57a41b['times'])['map'](_0x7c5885=>_0x23937d(0x258,-0x5b7,-0xb0a,-0xa73)+(_0x7c5885+'*')[_0x23937d(0xb4e,0xdc2,0x3ef,-0x50)](0x1*0x82f+-0x5*-0x5c6+-0x2507)+':\x20'+((-0xe2b+0x320*-0xa+0x9*0x517)*_0x57a41b[_0x313705(0x79b,-0x5bd,0x10fc,0x980)][_0x7c5885]/_0x57a41b[_0x23937d(0x641,0x123e,0x9be,0xf3d)])[_0x23937d(0x896,0x5dc,0x16b1,0x1314)](-0x1b5a+-0x22e4+0x3e40)+'%')[_0x23937d(0x1c16,0x11d6,0xfe0,0xf02)]('\x0a'))[_0x23937d(0x1c16,0x1c68,0xf86,0x1054)]('\x0a\x0a'):'')+('\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20'+_0x23937d(0x939,-0x414,0x3dd,0xf3e)))[_0x23937d(0x1c07,0x13ab,0x26aa,0x2426)](),_0x4b485e[_0x313705(0x1aa9,0xe5c,0x2535,0x29ad)](_0x3ba6f9,_0x15db15);}}else _0x1db05d(_0x23937d(0x187e,0x26eb,0x22e7,0x1c97)+_0x23937d(0x1b04,0x264f,0x21b3,0x1520));}else{const _0x193b36={};_0x193b36[_0x313705(0x209f,0x1bd1,0x2042,0x20f7)]=_0x313705(0xb7c,0xbd0,0x288,0x16ca)+_0x23937d(0x1026,0xaef,0x1d94,0x1edf)+'📤ʀᴇᴅ\x20ᴅʀᴀɢᴏ'+_0x23937d(0x1dd9,0x1b89,0x10ad,0x25ac)+_0x313705(0x176c,0x1e43,0x1a54,0x248d)+_0x23937d(0x616,-0x761,0x40d,0xf19)+_0x313705(0x1663,0xdaa,0x12a5,0x2216)+'══════════'+'══════';const _0x3dee75={};_0x3dee75['quoted']=_0x4481b9,_0x1f14b3[_0x313705(0xcaa,0x903,0xfa,0x2f7)+'e'](_0x1ed313[_0x23937d(0x118c,0xf67,0xebe,0x19f5)],_0x193b36,_0x3dee75);let _0x43e7a8=_0x576e6a(_0x4b485e['WwrEO']);_0x43e7a8[_0x23937d(0xb09,0x4a0,0x11aa,0x16ac)](''+_0x29eb98)[_0x23937d(0x1b61,0x20d3,0x15e2,0x2063)](async _0x51cac5=>{const _0x543862={};_0x543862['url']=_0x51cac5[_0x219b92(0x5eb,0x1862,0xaed,0x1629)][0xdb*-0x4+0x1*0x23ae+-0x2042][_0x219b92(0x1579,0x22c,0xaed,0x13c1)];const _0x492225={};_0x492225['document']=_0x543862,_0x492225[_0x219b92(0x219d,0x1ecc,0x131e,0x1a0a)]=_0x4b485e['zaTTI'],_0x492225[_0x430a46(0x1e43,0x10de,0x1608,0x1adb)]='Red-Dragon'+_0x219b92(-0x2cf,-0x8d1,0x46b,0xf13)+'3';function _0x219b92(_0x1f3472,_0x258f65,_0x4d22b8,_0x4316d5){return _0x313705(_0x4d22b8- -0x2f2,_0x258f65,_0x4d22b8-0x6d,_0x4316d5-0xf9);}const _0x45ec01={};function _0x430a46(_0x154792,_0x1fa11e,_0x47314c,_0x29745d){return _0x23937d(_0x1fa11e-0x5c5,_0x47314c,_0x47314c-0x64,_0x29745d-0x122);}_0x45ec01['quoted']=_0x4980f1,_0x42d4ea[_0x219b92(0x1ea,-0x24,0x9b8,0x3d3)+'e'](_0x59713d[_0x219b92(0xf10,0xa4c,0x1200,0x942)],_0x492225,_0x45ec01);})[_0x313705(0xc9a,0xcdd,0x1b79,0x1b9b)](_0x26c9ee=>{function _0x5382a3(_0x1efc1f,_0x53e060,_0x485d2b,_0xb0ab5b){return _0x313705(_0x1efc1f- -0x316,_0x485d2b,_0x485d2b-0x18f,_0xb0ab5b-0x9d);}function _0x1fbe29(_0x369046,_0x424c8b,_0x4455fd,_0x2cc9b2){return _0x23937d(_0x2cc9b2-0x3eb,_0x369046,_0x4455fd-0xbd,_0x2cc9b2-0x17d);}_0x4b485e[_0x5382a3(0x37f,0x1099,0x11a0,-0x39d)](_0x509a4a,_0x5382a3(0xc3,-0xb08,0x9d4,-0x356)+_0x5382a3(0x13f8,0x1002,0x1f97,0x22e2)+_0x5382a3(0xa3f,-0x2fb,0x695,0x7ba)+'!');});}}this[_0x23937d(0x4c0,-0x5e5,-0x397,0x480)]=this[_0x23937d(0x4c0,0xce2,0x7fb,-0x6dd)]?this['game']:{};let _0xd4ddc8=Object[_0x313705(0x123c,0x54d,0x1894,0xe04)](this['game'])[_0x23937d(0x16c5,0xba0,0x1918,0xca8)](_0x1e2894=>_0x1e2894['id']&&_0x1e2894[_0x23937d(0x4c0,-0x6e3,0xa16,0xc89)]&&_0x1e2894[_0x23937d(0xebc,0xcc9,0xe44,0x1ab6)]&&_0x1e2894['id'][_0x313705(0xed8,0x1234,0x1c00,0x128d)](_0x23937d(0x1c10,0x1e11,0x16b1,0x19b4))&&[_0x1e2894['game'][_0x313705(0x1fe0,0x2691,0x1856,0x1bf8)],_0x1e2894[_0x313705(0x826,0xa11,0xe5f,0xdf2)]['playerO']][_0x313705(0x4de,-0x738,-0x55,0x437)](_0x5cd288[_0x23937d(0x14ce,0x1324,0xae7,0x15c4)])&&_0x1e2894[_0x23937d(0xebc,0xd88,0x10e8,0xb12)]=='PLAYING');if(_0xd4ddc8){let _0x3893fd,_0x59551e=!(0x6b8+0xeed+0x14*-0x115),_0x324c25=!(-0x1d8+-0x3*0x113+0x512),_0x351da8=!(0x1260+-0xecf+-0x390);if(!/^([1-9]|(me)?give up|surr?ender|off|skip)$/i[_0x313705(0x1c74,0x2761,0x1f23,0x1913)](_0x5cd288[_0x313705(0x209f,0x15f3,0x2580,0x209b)]))return;_0x351da8=!/^[1-9]$/[_0x23937d(0x190e,0x1f90,0xca2,0x15b4)](_0x5cd288['text']);if(_0x4b485e[_0x313705(0x103a,0xa6d,0x1c76,0x6ca)](_0x5cd288[_0x313705(0x1834,0x11ea,0xe76,0x20a2)],_0xd4ddc8[_0x23937d(0x4c0,0x7e,-0x87e,-0x6b8)]['currentTur'+'n'])){if(_0x4b485e[_0x23937d(0x1718,0x1d60,0x17b7,0x2423)](_0x313705(0x495,0x22,0x135,0xb3a),_0x4b485e[_0x23937d(0x1e4,-0x6eb,-0x867,0xdfc)])){if(!_0x351da8)return!(0x101*0x1e+0x10aa+-0x5d9*0x8);}else{const _0x3cb215=_0x4b485e[_0x23937d(0x191e,0x1c25,0x23de,0x1206)]['split']('|');let _0xf2be52=-0x10f1*-0x1+0xb7b*0x1+-0x1c6c;while(!![]){switch(_0x3cb215[_0xf2be52++]){case'0':_0x504a74+=0x1878+-0x2*-0x2+-0x3*0x829;continue;case'1':_0x3aaf0b+=_0x313705(0x1cb1,0x22c2,0x19d3,0x1bf5)+_0xd672d4[_0x313705(0x1503,0x16fc,0x1309,0xaef)]()+'\x20•\x0a';continue;case'2':_0x2b7395+='News:\x20'+_0x1cfa06[_0x313705(0x1eaf,0x137a,0xf9f,0x2695)]+'\x0a';continue;case'3':_0x53246f+=_0x313705(0x8e7,0xc54,0x4d0,0x10c)+_0x3261c9[_0x23937d(0x879,0xd4d,0x1689,0x20a)+_0x23937d(0xc78,0xa68,0x19c,0x82)]+'\x0a';continue;case'4':_0x4f851a+=_0x23937d(0xf6,-0x382,-0x4ae,0x5ae)+_0x1edffd[_0x23937d(0xfac,0x705,0x1ab1,0xc63)]+'\x0a';continue;case'5':_0x5abc7b+=_0x313705(0xb9e,-0x170,0x1182,0x1924)+_0x24afa4[_0x23937d(0xff8,0x14cf,0x11bd,0x917)+'is']+'\x0a';continue;}break;}}}if(!_0x351da8&&_0x4b485e[_0x313705(0x15cb,0xadf,0x7f7,0x104c)](0x213+0x3*0xc65+0xd*-0x305,_0x3893fd=_0xd4ddc8[_0x23937d(0x4c0,0x50c,0x1063,-0x1dc)][_0x313705(0x1d67,0x2b89,0x2b8c,0x1b95)](_0x4b485e['cREsP'](_0x5cd288[_0x23937d(0x14ce,0x1878,0x13d1,0xa80)],_0xd4ddc8['game'][_0x313705(0x1f87,0x29ed,0x26ef,0x201b)]),_0x4b485e[_0x313705(0x57d,0x5f5,-0x504,-0x41a)](_0x4b485e[_0x313705(0x1112,0x2dd,0x13b3,0x44b)](parseInt,_0x5cd288[_0x23937d(0x1d39,0x107c,0x1769,0x1097)]),0x1c71+-0x2030+0x3c0))))return _0x4b485e[_0x313705(0x1158,0x16ef,0x1add,0x26a)](_0x1db05d,{'-3':_0x4b485e[_0x313705(0xbcb,0x1412,0xb8e,0x501)],'-2':_0x4b485e[_0x313705(0x358,-0xa94,0x253,0x3c)],'-1':_0x4b485e[_0x23937d(0x96b,0x935,-0x473,0x101e)],0x0:_0x4b485e['qTCaB']}[_0x3893fd]),!(0x3*-0xa12+0x3*-0xb32+0x3fcc);if(_0x5cd288['sender']===_0xd4ddc8[_0x23937d(0x4c0,0xe9f,-0x87a,-0x38)][_0x313705(0x161f,0xe8f,0x863,0xad8)])_0x59551e=!![];else{if(_0x4b485e[_0x23937d(0x6ef,0xe62,0xac0,-0x48b)](_0xd4ddc8['game'][_0x23937d(0x14f2,0xa5f,0x1932,0x14e9)],0x17*0xc5+-0x24ce+0x151a))_0x324c25=!![];}let _0x16ced8=_0xd4ddc8['game'][_0x23937d(0x1a75,0x1bd6,0x1758,0x177e)]()[_0x313705(0xe7c,0x16b4,0x63f,0xf7e)](_0x3956e5=>{const _0x194bc5={};_0x194bc5['X']='❌';function _0xe3b2ba(_0x3dab7b,_0x1c0d15,_0x9e417c,_0x8536bc){return _0x23937d(_0x3dab7b- -0xb7,_0x1c0d15,_0x9e417c-0x156,_0x8536bc-0x16d);}_0x194bc5['O']='⭕';function _0x38977b(_0x13710a,_0x3f583d,_0xda3ac5,_0x44e526){return _0x313705(_0x3f583d- -0x3f2,_0x13710a,_0xda3ac5-0x1ed,_0x44e526-0x128);}return _0x194bc5['1']=_0x4b485e['sWMrN'],_0x194bc5['2']=_0x4b485e[_0xe3b2ba(0x15ee,0xdd8,0xd8f,0x18ad)],_0x194bc5['3']=_0x4b485e[_0xe3b2ba(0xa5b,0x48d,0x806,0xefc)],_0x194bc5['4']=_0x38977b(0x9cc,0x3b9,0x1104,0xf46),_0x194bc5['5']=_0x38977b(-0xa63,0x191,0x609,0xa4e),_0x194bc5['6']=_0x4b485e[_0x38977b(0x8d9,0x65,-0x404,-0xe81)],_0x194bc5['7']=_0x4b485e[_0xe3b2ba(0x1334,0x1018,0xe69,0x12af)],_0x194bc5['8']=_0x4b485e[_0x38977b(0x2a2,0x1161,0x1da5,0x1316)],_0x194bc5['9']=_0xe3b2ba(0x1ba6,0x247e,0x24d0,0xd4a),_0x194bc5[_0x3956e5];});if(_0x351da8){if(_0x4b485e[_0x313705(0x1b4a,0x22f1,0x1402,0x1e60)](_0x4b485e[_0x23937d(0x1d11,0x12e7,0x2bf7,0x12ce)],_0x4b485e[_0x23937d(0x1d11,0x1f1e,0x11e5,0x29d8)]))_0xd4ddc8[_0x23937d(0x4c0,-0x85a,0xdfc,0x4bc)]['_currentTu'+'rn']=_0x4b485e[_0x23937d(0x676,0xc75,0x38e,0x1283)](_0x5cd288[_0x23937d(0x14ce,0x13dd,0x2088,0x18c5)],_0xd4ddc8['game'][_0x23937d(0x1c7a,0x2700,0x2221,0x217b)]),_0x59551e=!![];else{if(_0x1b84cc<_0x431e61)return _0x4b485e[_0x313705(0x16cb,0x98f,0x24a9,0x11e6)](_0x558874,_0x313705(0x19cf,0x23a2,0x2072,0x1dd8)+_0x23937d(0x123a,0xdea,0xba8,0xb42)+_0x313705(0x3c5,-0x515,0x473,0x126d)+_0x313705(0x5c7,0x97d,-0x94e,0x103b)+_0x313705(0x1654,0x1b45,0x12b6,0xcd7)+'ion');if(!_0xb6a6eb[-0x4*0x332+-0x22d4+0x2f9d])return _0x4b485e[_0x313705(0x1e76,0x11b6,0x16f2,0x1fcd)](_0x3dec88,_0x313705(0x110b,0x3f9,0x1c8e,0x1b9a)+_0x4b485e[_0x313705(0x945,0x5e0,0x5e7,0xbef)](_0x38e71d,_0x382cc1)+(_0x23937d(0x147c,0x90a,0x1d82,0x80b)+_0x23937d(0x1dc6,0x16d7,0x1965,0x165f)+'n\x20=\x202500\x20M'+_0x23937d(0xa18,0x5b0,0xd8,0xd65)));_0x2b49a8(_0x51a2f3[_0x313705(0x1834,0x1e96,0x1cce,0x1e7c)],_0x48d2ab);let _0xe53c6d=_0x4b485e['DKitz'](0x14*0x19a+0x2*-0xa0d+-0x2*0x115,_0x5be643);_0xdb25a3(_0x1457bd[_0x313705(0x1834,0x1327,0x14c9,0x1f2d)],_0xe53c6d),_0x4b485e[_0x313705(0x1d2e,0x11c4,0x2ac0,0x284e)](_0x414a89,()=>{function _0x15c11c(_0x3b0e7f,_0x5053a9,_0x4e16db,_0x31c7be){return _0x23937d(_0x3b0e7f-0x125,_0x31c7be,_0x4e16db-0x3,_0x31c7be-0xa8);}function _0xe84292(_0x55e756,_0x4e3d8d,_0xe38cc7,_0x4722af){return _0x23937d(_0x55e756-0x4a1,_0x4e3d8d,_0xe38cc7-0x128,_0x4722af-0xbf);}_0x4b485e['smKZX'](_0x2a6f63,_0x15c11c(0x3c6,-0xa4e,0x9f4,-0x1ab)+_0xe84292(0x1322,0x13f5,0x10c2,0x1813)+_0xe84292(0xd20,0x3c3,0x12ea,0xfb6)+_0x15c11c(0x1eed,0x15fe,0x25db,0x2031)+_0x15c11c(0x977,0x1419,0x1079,0x4d8)+_0x4b485e[_0xe84292(0x1d9c,0x1cef,0x12e0,0x1db6)](_0x154b38,_0x34b867[_0x15c11c(0x15f3,0xd05,0x90c,0x192d)])+('\x0a*Your\x20Rem'+_0x15c11c(0x3c5,-0x8cd,0x19f,-0x247)+_0xe84292(0x17eb,0x1ac5,0x20ed,0x1c6e))+_0x4b485e[_0xe84292(0x6fd,0x271,-0x6a,0x1531)](_0x130ab8,_0x471993['sender']));},-0x1*0x1ecf+-0xa3*-0x1d+0x2*0xa14);}}let _0x50049b=_0x351da8?_0xd4ddc8[_0x23937d(0x4c0,0x945,0x3f4,-0x20a)][_0x23937d(0x114d,0x1e9d,0x17fe,0xdf4)+'n']:_0xd4ddc8[_0x313705(0x826,0xcce,0x130b,-0x2eb)][_0x313705(0x161f,0xf79,0x1dbd,0x210c)],_0x26f8ac='Room\x20ID:\x20'+_0xd4ddc8['id']+'\x0a\x0a'+_0x16ced8[_0x313705(0x399,-0x8ac,0x1231,-0x3ba)](-0x1c3d+-0x4*0x88+0x1e5d,-0xfef+0x1cf*0x5+0x6e7)[_0x23937d(0x1c16,0x2a53,0x1a9e,0xe9c)]('')+'\x0a'+_0x16ced8['slice'](0x1*-0x161b+-0xc37+0x2255,0x100*0x1+0x1*-0x178d+0x1693)['join']('')+'\x0a'+_0x16ced8[_0x23937d(0x33,0x177,-0xa19,0xa01)](-0xb*0xb7+-0x2*-0xe9+0x611)[_0x23937d(0x1c16,0x2a76,0xe51,0x1417)]('')+'\x0a\x0a'+(_0x59551e?'@'+_0x50049b[_0x313705(0x1035,0x13e7,0x14fd,0x22f)]('@')[-0x1*0x8bd+0x8f7+-0x3a]+_0x313705(0x20f7,0x1c88,0x1a41,0x1d7d):_0x324c25?'Game\x20Over':_0x313705(0x1ad8,0x23f1,0x26c2,0x1fc1)+['❌','⭕'][_0x4b485e[_0x313705(0x2024,0x1f4b,0x1fd8,0x25e5)](-0x1bf1+-0xfed*-0x1+0x1*0xc05,_0xd4ddc8[_0x313705(0x826,0x1295,0x516,-0x6c3)][_0x313705(0x199b,0x267d,0x18f3,0x1701)+'rn'])]+_0x23937d(0x1404,0x8a9,0x1849,0x1650)+_0xd4ddc8[_0x313705(0x826,-0x435,0x139e,0x51b)][_0x23937d(0x114d,0x65d,0xd8a,0x1f5c)+'n'][_0x23937d(0xccf,0xf76,0x1be4,0x41a)]('@')[0x2710*-0x1+0xaa2+0x1c6e]+')')+_0x23937d(0x6b8,0x23d,0x4b1,0x95b)+_0xd4ddc8[_0x313705(0x826,-0x2e7,-0x3cf,0xc6b)][_0x313705(0x1fe0,0x2bec,0x166c,0x27dc)][_0x313705(0x1035,0xe6a,0x1bc2,0xbe6)]('@')[-0x259*-0x3+-0x1321+0xc16]+_0x23937d(0x77a,0x1085,0x774,-0x37)+_0xd4ddc8[_0x313705(0x826,0xbd,0x15b5,0xfd7)]['playerO'][_0x313705(0x1035,0x756,0x1513,0x127d)]('@')[-0x1*0x9c2+0x1*0x2197+0x17d5*-0x1]+('\x0a\x0aTyped\x20*s'+_0x313705(0x12e8,0x2034,0x10e4,0x209a)+_0x313705(0xb05,0xd,-0x23d,-0x295)+_0x313705(0x7d7,0x57c,0x1621,0x878)+_0x23937d(0x12e1,0x985,0x17a6,0x8c0)+'t');if(_0x4b485e['iwrSI'](_0x4b485e['KfIDX'](_0xd4ddc8[_0x23937d(0x4c0,0x78f,0x646,-0x54a)][_0x313705(0x199b,0x11f9,0x1fb1,0x15c8)+'rn'],_0x351da8)?_0xd4ddc8['x']:_0xd4ddc8['o'],_0x5cd288[_0x313705(0x14f2,0x21cf,0x6d6,0x1191)]))_0xd4ddc8[_0x4b485e['KfIDX'](_0xd4ddc8[_0x313705(0x826,0x7fe,0x423,0xc56)][_0x23937d(0x1635,0x1e60,0x1ddc,0x18f3)+'rn'],_0x351da8)?'x':'o']=_0x5cd288[_0x313705(0x14f2,0x1290,0x1330,0x23a2)];if(_0xd4ddc8['x']!==_0xd4ddc8['o'])await _0x175756[_0x23937d(0x1574,0x1cc0,0x989,0xd1d)](_0xd4ddc8['x'],_0x26f8ac,_0x5cd288,{'mentions':_0x4b485e[_0x23937d(0x25c,-0x84f,-0xf2,-0xa9f)](parseMention,_0x26f8ac)});await _0x175756[_0x313705(0x18da,0x12b7,0x1749,0x1331)](_0xd4ddc8['o'],_0x26f8ac,_0x5cd288,{'mentions':_0x4b485e[_0x313705(0xfb1,0x4a3,0x9c,0x938)](parseMention,_0x26f8ac)});if(_0x4b485e[_0x313705(0x1765,0x1fa7,0xab6,0x1738)](_0x324c25,_0x59551e)){if(_0x4b485e[_0x313705(0x715,-0x32f,-0x6dd,-0x3e3)](_0x4b485e['Uquvg'],_0x4b485e[_0x313705(0x1678,0x13f2,0x1db7,0xaa8)]))delete this['game'][_0xd4ddc8['id']];else{const _0x5160b1={};_0x5160b1[_0x23937d(0x1d39,0x1cde,0x2054,0x2182)]=''+_0x2608ad[_0x313705(0xed7,0x573,0xf33,0x17d)];const _0x5b6592={};_0x5b6592[_0x23937d(0x5dc,0x9b8,0xace,0x46)]=_0x208251,_0x5aeac6[_0x23937d(0x944,0x6b6,-0x5a9,-0x17c)+'e'](_0x9c3481[_0x23937d(0x118c,0x952,0x177e,0x1a63)],_0x5160b1,_0x5b6592),_0x533fa8=_0x4134af[_0x313705(0x1723,0x1d2b,0x19a8,0x11e6)+'nc']('./Android/'+_0x23937d(0x1613,0x15ab,0x1330,0x15b1)+_0x23937d(0x3fb,0xdf3,-0x271,-0x73b)+_0x23937d(0x2f5,-0x1f0,-0x8f7,0x2f7));const _0x11452c={};_0x11452c['sticker']=_0x1afc09,_0xea323f['sendMessag'+'e'](_0xc7524e['chat'],_0x11452c);}}}this['suit']=this[_0x23937d(0x1298,0x1064,0x126c,0x10e9)]?this[_0x313705(0x15fe,0x12ad,0x16d3,0x1f3d)]:{};let _0x22e9b7=Object[_0x313705(0x123c,0xee6,0x148d,0x1eab)](this[_0x23937d(0x1298,0x21a9,0xdde,0x1ad8)])['find'](_0x36da6e=>_0x36da6e['id']&&_0x36da6e[_0x313705(0x751,0x5f7,0x86c,-0x3dc)]&&[_0x36da6e['p'],_0x36da6e['p2']][_0x313705(0x4de,-0x318,0xef0,-0x69c)](_0x5cd288[_0x313705(0x1834,0x2255,0x2738,0x2565)]));if(_0x22e9b7){let _0xbaeea='',_0xedd75a=![];if(_0x4b485e['WUaVF'](_0x5cd288[_0x313705(0x1834,0x1df3,0xd4e,0x2751)],_0x22e9b7['p2'])&&/^(acc(ept)?|accept|yes|okay?|reject|no|later|nope(k.)?yes|y)/i['test'](_0x5cd288[_0x313705(0x209f,0x11c9,0x28b9,0x2181)])&&_0x5cd288[_0x23937d(0x1d23,0x191a,0x25d5,0x2277)]&&_0x4b485e[_0x23937d(0x560,-0x5f2,0xb92,-0x371)](_0x22e9b7[_0x313705(0x751,0x5e9,-0xa7,0x12dd)],_0x313705(0xc12,-0x193,-0xbd,0x858))){if(_0x4b485e['NaFJg'](_0x4b485e[_0x313705(0x1f19,0x2bbc,0x213a,0x1f0e)],_0x4b485e[_0x23937d(0x1bb3,0x1a72,0x1f8d,0x144d)])){if(/^(reject|no|later|n|nope(k.)?yes)/i[_0x23937d(0x190e,0xa48,0x1a1b,0xd69)](_0x5cd288[_0x313705(0x209f,0x182c,0x1b87,0x189d)]))return _0x175756['sendTextWi'+'thMentions'](_0x5cd288[_0x313705(0x14f2,0x1160,0x1ea4,0x1152)],'@'+_0x22e9b7['p2'][_0x313705(0x1035,0x1c8c,0x11bd,0x125b)]`@`[-0x2251*0x1+0x1622+-0xc2f*-0x1]+(_0x23937d(0x573,-0x49a,0x4a5,-0x1e7)+'it,\x20Suit\x20C'+'anceled'),_0x5cd288),delete this['suit'][_0x22e9b7['id']],!(-0xc0*-0x31+-0x6e*-0xf+-0x2b32);_0x22e9b7['status']=_0x4b485e[_0x23937d(0x10bf,0x1487,0xb7b,0x183e)],_0x22e9b7[_0x313705(0x63c,-0xd3,0x13fd,-0x836)]=_0x5cd288[_0x23937d(0x118c,0x5ce,0x2e4,0x1dd6)],_0x4b485e[_0x23937d(0x18be,0x1729,0x1339,0x1434)](clearTimeout,_0x22e9b7[_0x313705(0x1c00,0x204d,0x1318,0x1d88)]),_0x175756['sendText'](_0x5cd288[_0x313705(0x14f2,0x1879,0x1ca9,0x23ca)],_0x23937d(0x1620,0xeb5,0x1df7,0xe63)+_0x313705(0xea0,0x189e,0x1463,0x10ff)+_0x313705(0x1abe,0x1ebd,0xc2c,0x19f2)+_0x22e9b7['p'][_0x313705(0x1035,0x143d,0x88a,0x798)]`@`[-0x1cdf+-0x5a5+0x2284]+_0x313705(0x20ea,0x1e61,0x2563,0x1ea5)+_0x22e9b7['p2'][_0x23937d(0xccf,0x1a76,0x3dc,0x1589)]`@`[0x4af*-0x4+0x6*0x38c+-0x146*0x2]+('\x0a\x0aPlease\x20C'+_0x313705(0x196d,0x105c,0x2876,0xe7c)+_0x313705(0x1c98,0x12ac,0x1895,0x25ca)+'Respective'+_0x23937d(0xa1b,0x183,0x109e,0x4f9)+_0x313705(0x9f9,0xbb8,0x297,0x57)+_0x23937d(0x6f7,0x755,-0x3a,0xd52))+_0x4b45af[_0x23937d(0xccf,0x824,0x162b,0x1db)]`@`[0x291+0x3*0x35+-0x330],_0x5cd288,{'mentions':[_0x22e9b7['p'],_0x22e9b7['p2']]});if(!_0x22e9b7[_0x23937d(0x994,0xe04,0x753,0x9d5)])_0x175756[_0x23937d(0x1574,0x18ad,0x76b,0xcd9)](_0x22e9b7['p'],_0x23937d(0x1a70,0x10b9,0x26dd,0x1ecb)+_0x313705(0x2056,0x27e5,0x169f,0x2c0d)+_0x23937d(0x615,0x2a1,-0x8ab,0x1073)+_0x23937d(0x1234,0x1002,0x1b81,0x1cf0),_0x5cd288);if(!_0x22e9b7[_0x313705(0x7ea,0x121b,0x1206,0x68b)])_0x175756[_0x313705(0x18da,0xd75,0x1e07,0x17a1)](_0x22e9b7['p2'],_0x313705(0x1dd6,0x1336,0x233b,0x221a)+'ect\x20\x0a\x0aRock'+'🗿\x0aPaper📄\x0aS'+_0x23937d(0x17fc,0x195e,0xce7,0xdc9),_0x5cd288);_0x22e9b7[_0x23937d(0x1cdd,0x2243,0x2412,0x2b30)+'h']=_0x4b485e[_0x313705(0x8d7,-0x247,0xab2,-0x262)](setTimeout,()=>{function _0xbd0714(_0x2305dd,_0x261a01,_0x48bc14,_0x2e7a34){return _0x23937d(_0x2e7a34-0x2bc,_0x2305dd,_0x48bc14-0xad,_0x2e7a34-0x8c);}function _0x585207(_0x4736a3,_0x5b204a,_0x134374,_0x4824b9){return _0x23937d(_0x5b204a-0x37f,_0x4736a3,_0x134374-0xcb,_0x4824b9-0xaa);}if(_0x4b485e[_0xbd0714(0x900,0x11de,0x571,0xa86)](_0x4b485e['rqckv'],_0x585207(0x2822,0x1e9a,0x29ee,0x2a53))){if(!_0x22e9b7[_0xbd0714(0x1521,0x4b5,0xfb6,0xc50)]&&!_0x22e9b7[_0xbd0714(0xc4f,0x1490,0xfb3,0x740)])_0x175756[_0xbd0714(0xfdf,0x1ee0,0x1a22,0x1830)](_0x5cd288['chat'],_0xbd0714(0x21bd,0x1253,0x24a1,0x160e)+_0xbd0714(0x11d8,0x9e6,-0x12c,0x611)+_0x585207(0x173d,0x11ab,0x4c3,0x6b5)+'y,\x0aSuit\x20Ca'+_0xbd0714(0x451,0x9f7,-0x374,0x427));else(!_0x22e9b7[_0xbd0714(0x1939,0xf00,0x1b4,0xc50)]||!_0x22e9b7[_0x585207(0xe3d,0x803,0x7aa,0xf50)])&&(_0xbaeea=!_0x22e9b7[_0x585207(0x301,0xd13,0x4b7,0x1d2)]?_0x22e9b7['p2']:_0x22e9b7['p'],_0x175756[_0x585207(0x12ff,0x1b41,0x237b,0x18a9)+_0xbd0714(0x107a,0x2988,0x2510,0x1c31)](_0x5cd288[_0x585207(0x678,0x150b,0x2401,0xdd6)],'@'+(_0x22e9b7[_0xbd0714(0x150e,0x1b1f,0x138b,0xc50)]?_0x22e9b7['p2']:_0x22e9b7['p'])[_0x585207(0x14fd,0x104e,0x19d7,0xf33)]`@`[0x6f*0x49+0x39d+0x1*-0x2344]+(_0x585207(0x7ac,0xac5,0x14a8,0x194d)+_0xbd0714(0x28f7,0x1c88,0x29c4,0x1fbf)+_0xbd0714(0x10e2,0x14d7,0xfbc,0x1d53)+'!'),_0x5cd288));return delete this[_0xbd0714(0x1a2e,0x1e1a,0x1f3d,0x1554)][_0x22e9b7['id']],!(0x1*0x1bf4+0xe4d*-0x1+-0xda7);}else _0x4e0736+=-0xa3*0x11+0x1*-0x295+-0xd69*-0x1,_0x4cd5c0+='\x0a•\x20'+_0x318748[_0xbd0714(0x1b2a,0x1020,0x223b,0x1459)]()+_0x585207(0x5df,0xc10,0x1afe,0x10e3),_0xe82acd+=_0x585207(0x1273,0x94f,0x678,0x103e)+_0x4cddf5['berita']+'\x0a',_0x1e01d5+='Link:\x20'+_0x39c91d[_0x585207(0x20bd,0x132b,0x1bbf,0x205c)]+'\x0a';},_0x22e9b7['timeout']);}else{const _0x4a7c61=_0x4b485e['PKfWP'][_0x23937d(0xccf,0x48c,0x37e,0x74)]('|');let _0x2b4c71=-0xe09+-0x312*0x6+0x2075*0x1;while(!![]){switch(_0x4a7c61[_0x2b4c71++]){case'0':_0x3461aa+=0xe33+0x4d*0x74+-0x3116;continue;case'1':_0x5a68a4+=_0x313705(0xb9e,0x1966,0xdbf,0x1736)+_0x33e894[_0x23937d(0xff8,0x166b,0x1248,0x1c97)+'is']+'\x0a';continue;case'2':_0x365c7b+=_0x313705(0x936,0x1191,0xd84,-0x32d)+_0x2c5104[_0x313705(0x1eaf,0x270e,0x26f1,0x12d8)]+'\x0a';continue;case'3':_0x4457c1+='Link:\x20'+_0x174c31[_0x23937d(0xfac,0x1c2c,0x1b04,0x7c2)]+'\x0a';continue;case'4':_0x4f2538+=_0x313705(0x8e7,0x703,-0x1bf,0x156e)+_0x45dcf2['berita_diu'+_0x313705(0xfde,0x1551,0xe19,0x6f9)]+'\x0a';continue;case'5':_0x1bbcd+=_0x313705(0x1cb1,0x139e,0x1123,0x13a5)+_0x586815[_0x313705(0x1503,0x791,0x5fc,0x19ad)]()+'\x20•\x0a';continue;}break;}}}let _0x335c9b=_0x4b485e['nhwEC'](_0x5cd288[_0x313705(0x1834,0x225c,0x1ada,0x159f)],_0x22e9b7['p']),_0x3875a8=_0x5cd288[_0x23937d(0x14ce,0x8cc,0x198c,0xf81)]==_0x22e9b7['p2'],_0x4b7555=/scissors/i,_0x47a66d=/rock/i,_0x18af7c=/paper/i,_0x2ade86=/^(scissors|rock|paper)/i;if(_0x335c9b&&_0x2ade86[_0x23937d(0x190e,0xc45,0x155c,0x1d25)](_0x5cd288[_0x23937d(0x1d39,0x2481,0x2ab6,0x26bd)])&&!_0x22e9b7[_0x313705(0xcfa,0x132b,0xc11,0xb65)]&&!_0x5cd288[_0x313705(0x2089,0x24e6,0x1817,0x2b6b)]){_0x22e9b7['pilih']=_0x2ade86[_0x23937d(0x15fa,0x16bc,0x20e1,0x20ba)](_0x5cd288['text']['toLowerCas'+'e']())[-0x1*-0x11b+0x5*0x527+-0x16a*0x13],_0x22e9b7[_0x313705(0x209f,0x2908,0x2df8,0x17a2)]=_0x5cd288[_0x23937d(0x1d39,0x24ef,0x226f,0x1887)],_0x1db05d('You\x20Have\x20C'+_0x313705(0xd96,0x3bc,0x1c62,0x1485)+_0x5cd288[_0x313705(0x209f,0x200b,0x2235,0x2091)]+'\x20'+(!_0x22e9b7['pilih2']?_0x313705(0xebc,0x1b08,0x1743,0x1d92)+_0x23937d(0x75a,0xdbb,0x11db,0xd28)+_0x313705(0x49b,-0x5fb,-0x5f4,-0x2ce)+'Choose':''));if(!_0x22e9b7[_0x313705(0x7ea,0xf07,0x44d,0x103c)])_0x175756['sendText'](_0x22e9b7['p2'],_0x4b485e['DUthW'],-0x134e+-0xa*-0x3d6+-0x130e);}if(_0x3875a8&&_0x2ade86[_0x313705(0x1c74,0x1c1d,0x1660,0x29a4)](_0x5cd288[_0x313705(0x209f,0x285c,0x1fd4,0x27ff)])&&!_0x22e9b7['pilih2']&&!_0x5cd288[_0x23937d(0x1d23,0x2395,0x130c,0x295f)]){_0x22e9b7[_0x23937d(0x484,0xb0d,0xa13,0x7bb)]=_0x2ade86[_0x23937d(0x15fa,0x79c,0x1935,0x1bf9)](_0x5cd288[_0x313705(0x209f,0x290f,0x1b0a,0x225d)][_0x23937d(0x6cb,0xec1,0x13c5,0x571)+'e']())[0xf47*-0x1+-0x1b9c+0x2ae3],_0x22e9b7[_0x313705(0x12cd,0x8be,0x553,0x602)]=_0x5cd288[_0x313705(0x209f,0x2271,0x22a8,0x2f0a)],_0x4b485e[_0x313705(0x1683,0x14ce,0xf39,0x18ab)](_0x1db05d,'You\x20Have\x20C'+_0x23937d(0xa30,0xa53,-0x369,0x1a1)+_0x5cd288[_0x313705(0x209f,0x2820,0x20fb,0x2b5a)]+'\x20'+(!_0x22e9b7[_0x23937d(0x994,0x881,0xdbe,0x1519)]?_0x23937d(0xb56,0x1956,0xbaa,0x14ec)+_0x23937d(0x75a,0x96a,-0x5d,0x10a8)+_0x313705(0x49b,-0x34e,0x82,-0xb2)+_0x23937d(0xf56,0x17dd,0x152d,0x1147):''));if(!_0x22e9b7['pilih'])_0x175756[_0x313705(0x18da,0x12d5,0xd28,0x25d6)](_0x22e9b7['p'],_0x4b485e[_0x313705(0x2120,0x1e71,0x29e2,0x1e1f)],0x338+-0x1*0x1f0d+0x19*0x11d);}let _0x109d38=_0x22e9b7[_0x313705(0xcfa,0x72,0xd6d,0x539)],_0x417d39=_0x22e9b7[_0x313705(0x7ea,0x13b7,0x89c,0xd3a)];if(_0x22e9b7[_0x313705(0xcfa,0xd9c,0xbc2,0x58a)]&&_0x22e9b7[_0x313705(0x7ea,0x3b2,0x186,0xef0)]){clearTimeout(_0x22e9b7[_0x23937d(0x1cdd,0x1a7a,0xe05,0x1bb1)+'h']);if(_0x47a66d[_0x23937d(0x190e,0x1f7f,0x1603,0x1bfc)](_0x109d38)&&_0x4b7555['test'](_0x417d39))_0xbaeea=_0x22e9b7['p'];else{if(_0x47a66d[_0x313705(0x1c74,0x162c,0x1381,0x1d0c)](_0x109d38)&&_0x18af7c[_0x23937d(0x190e,0x1f5d,0x1b54,0xce9)](_0x417d39))_0xbaeea=_0x22e9b7['p2'];else{if(_0x4b7555[_0x313705(0x1c74,0xe81,0x1dbb,0x18ab)](_0x109d38)&&_0x18af7c[_0x313705(0x1c74,0x2393,0x23aa,0x25db)](_0x417d39))_0xbaeea=_0x22e9b7['p'];else{if(_0x4b7555['test'](_0x109d38)&&_0x47a66d['test'](_0x417d39))_0xbaeea=_0x22e9b7['p2'];else{if(_0x18af7c[_0x23937d(0x190e,0x1234,0xea9,0x2061)](_0x109d38)&&_0x47a66d[_0x313705(0x1c74,0xe77,0x1d5f,0x26a7)](_0x417d39))_0xbaeea=_0x22e9b7['p'];else{if(_0x18af7c[_0x313705(0x1c74,0x292e,0x17e0,0x11e1)](_0x109d38)&&_0x4b7555[_0x313705(0x1c74,0x18a7,0x21e0,0xe71)](_0x417d39))_0xbaeea=_0x22e9b7['p2'];else{if(_0x4b485e[_0x23937d(0x1c0c,0x20f3,0xdf0,0x1e55)](_0x109d38,_0x417d39))_0xedd75a=!![];}}}}}}_0x175756['sendText'](_0x22e9b7[_0x23937d(0x2d6,0x1bc,0xf1c,-0xb3f)],(_0x313705(0x1e45,0x15cf,0x1dbb,0x1c3b)+_0x23937d(0x127a,0xb94,0x8fb,0x45b)+(_0xedd75a?_0x4b485e[_0x23937d(0x1b59,0x1835,0x1ddb,0x1ee1)]:'')+_0x313705(0x13a5,0x13ac,0x16d3,0x21c6)+_0x22e9b7['p'][_0x313705(0x1035,0x324,0x1143,0x8b0)]`@`[0x13d0*0x1+-0x6fd+0x43*-0x31]+'\x20('+_0x22e9b7[_0x23937d(0x1d39,0x161f,0x1cb0,0x23d2)]+')\x20'+(_0xedd75a?'':_0x4b485e[_0x313705(0x79d,0x1551,0x15ef,-0x8f)](_0x22e9b7['p'],_0xbaeea)?_0x313705(0xf2b,0x198e,0xa39,0x1947):_0x313705(0x538,-0x30d,0xfec,-0x1e1))+'\x0a@'+_0x22e9b7['p2'][_0x23937d(0xccf,-0xf,0x72,0x6df)]`@`[-0xc9d+-0x226+0xec3]+'\x20('+_0x22e9b7[_0x23937d(0xf67,0x46c,0x216,0xd3c)]+')\x20'+(_0xedd75a?'':_0x4b485e[_0x313705(0x83d,0xd57,-0x6d0,0x62a)](_0x22e9b7['p2'],_0xbaeea)?_0x313705(0xf2b,0x10e7,0x153b,0x622):_0x23937d(0x1d2,0xf2b,-0x782,-0x823))+'\x0a')['trim'](),_0x5cd288,{'mentions':[_0x22e9b7['p'],_0x22e9b7['p2']]}),delete this[_0x23937d(0x1298,0x2044,0xcd3,0x10b3)][_0x22e9b7['id']];}}let _0x146652=[...new Set([..._0x5cd288[_0x313705(0x1896,0x175e,0x1979,0x1ed1)+'id']||[],..._0x5cd288[_0x23937d(0x5dc,-0x874,0x500,0xf1e)]?[_0x5cd288['quoted'][_0x313705(0x1834,0x1b5b,0xc3e,0x15df)]]:[]])];for(let _0x44e619 of _0x146652){if(_0x4b485e['GUPuV'](_0x23937d(0xa97,0x317,-0x88,0x8b8),_0x4b485e['khHWU'])){let _0x1b4d73=global['db'][_0x23937d(0xe17,0x10c9,0x498,0x1d04)][_0x313705(0x1b7c,0x221f,0x16c5,0x15cb)][_0x44e619];if(!_0x1b4d73)continue;let _0x4bc069=_0x1b4d73[_0x313705(0x56a,-0x722,0xe00,0xda6)];if(!_0x4bc069||_0x4b485e[_0x313705(0x1feb,0x1577,0x2490,0x2002)](_0x4bc069,-0x1b6b+0x9a*-0x16+-0x3*-0xd8d))continue;let _0x546dce=_0x1b4d73[_0x23937d(0xe3e,0x1cc4,0x1689,0xb7e)]||'';_0x4b485e[_0x23937d(0xac8,0x195d,0xc8b,0xca7)](_0x1db05d,('\x0aDon\x27t\x20tag'+_0x313705(0x1025,0x19c6,0xd30,0x979)+_0x313705(0x1533,0x1111,0x2030,0x7b1)+_0x23937d(0x262,-0x4ee,0xdc2,0xae)+(_0x546dce?_0x4b485e[_0x313705(0x1d77,0x1d68,0x231f,0x1135)]+_0x546dce:_0x4b485e['YSsAZ'])+(_0x313705(0x1487,0x813,0x1eeb,0x1035)+'\x20')+_0x4b485e[_0x313705(0x1af7,0x123f,0x2667,0x1991)](clockString,new Date()-_0x4bc069)+'\x0a')[_0x313705(0x1f6d,0x1315,0x1b6f,0x1fda)]());}else{const _0x3444b0={};_0x3444b0['text']=''+_0x469393[_0x23937d(0x28,-0x106,-0xb25,0x626)];const _0x5da605={};_0x5da605[_0x23937d(0x5dc,0xbcf,0x986,-0x12d)]=_0x2d7ded,_0x1957b9[_0x313705(0xcaa,0x169e,0xaff,0x416)+'e'](_0x2ee42d[_0x23937d(0x118c,0xa7a,0x1330,0x86a)],_0x3444b0,_0x5da605);}}if(_0x4b485e[_0x23937d(0x6c8,-0x72d,0x8eb,-0xa8)](db[_0x313705(0x117d,0x75c,0x141b,0x1fcc)][_0x23937d(0x1816,0x250b,0xdae,0x96f)][_0x5cd288[_0x23937d(0x14ce,0x16f0,0xe88,0x1a8a)]][_0x313705(0x56a,0xa6f,0x41e,-0x7f4)],-(-0x19d8+-0x704+0x20dd))){if(_0x4b485e['GNGqF'](_0x4b485e[_0x313705(0x1101,0x140c,0x26c,0x965)],_0x4b485e['hzuVf']))_0x4b485e[_0x313705(0x1e76,0x16e2,0x1722,0x21d8)](_0x39bc1f,_0x4b485e['RpgFP'](_0x38e177,_0x2b712e));else{let _0x237ca0=global['db'][_0x313705(0x117d,0xd2c,0x156e,0x1401)]['users'][_0x5cd288['sender']];_0x4b485e['eUsha'](_0x1db05d,(_0x23937d(0xfab,0xffa,0x1844,0xc37)+_0x23937d(0x1a45,0xf6e,0x27c5,0x2259)+_0x313705(0x1fad,0x2b0f,0x1931,0x1996)+(_0x237ca0[_0x313705(0x11a4,0xa01,0x1917,0x9a4)]?_0x4b485e['aUdAa'](_0x4b485e[_0x313705(0x7bc,0xd42,-0x34e,0x149b)],_0x237ca0['afkReason']):'')+_0x23937d(0x12e3,0x4a6,0x1266,0xc70)+clockString(new Date()-_0x237ca0[_0x23937d(0x204,0x24d,0x1021,-0x493)])+'\x0a')[_0x23937d(0x1c07,0xebf,0x2a9b,0x2316)]()),_0x237ca0[_0x313705(0x56a,0xdb,0x12cf,0x11bd)]=-(0x12d*0x1f+0xba9+0x335*-0xf),_0x237ca0[_0x23937d(0xe3e,0x6e,0x1a1b,0x152e)]='';}}const _0x5005a3={};_0x5005a3['remoteJid']=_0x5cd288['chat'],_0x5005a3[_0x313705(0x50c,0x156,0xf29,0x135e)]=!![],_0x5005a3['id']=_0x3e5ec4['id'];const _0x53ee9d={};_0x53ee9d[_0x313705(0x209f,0x28c4,0x1fdc,0x1c97)]=_0x1ba32f[0x1c7d+-0x17df+-0x49e*0x1],_0x53ee9d[_0x23937d(0x94f,-0x1dd,0x11ad,0x100)]=_0x5005a3;const _0x178b7f={};_0x178b7f[_0x23937d(0x19ba,0x2698,0x1d97,0x13fd)]=_0x53ee9d;const _0x4fe8e5=_0x178b7f;function _0xd03f49(_0x581414){const _0x5a1ec9={};function _0x1f8c95(_0x189112,_0xb7af67,_0x4d5831,_0x50c116){return _0x313705(_0x189112- -0xe6,_0xb7af67,_0x4d5831-0x1c,_0x50c116-0x1e4);}function _0x9dfffb(_0x53f5c3,_0x5e134a,_0xe0d3b9,_0x493ea5){return _0x23937d(_0x5e134a- -0x18d,_0xe0d3b9,_0xe0d3b9-0x13a,_0x493ea5-0x17d);}_0x5a1ec9[_0x9dfffb(0xd34,0x11b8,0x3ab,0x12b8)]=_0x4b485e[_0x9dfffb(0x1091,0x578,-0x2b8,0xc87)];const _0x498cdb=_0x5a1ec9;return _0x4b485e['mDTbA']!==_0x4b485e[_0x9dfffb(-0x357,-0x14c,-0x45d,0xd7e)]?_0x581414[Math['floor'](_0x4b485e[_0x9dfffb(0x162e,0x889,0x73d,0x982)](_0x581414[_0x9dfffb(0x880,0x251,0x813,0x7e3)],Math[_0x1f8c95(0x19fa,0x1537,0x1309,0x1b01)]()))]:_0x498cdb[_0x9dfffb(0x17db,0x11b8,0x1ee9,0x80d)];}let _0x1ddecd=[doc1,doc2,doc3,doc4,doc5,doc6],_0x579b72=_0xd03f49(_0x1ddecd);async function _0x1ae8f0(_0x41b8f0){function _0x43871c(_0x5c8a23,_0xf20428,_0x140ded,_0x11a753){return _0x23937d(_0x140ded-0x81,_0x5c8a23,_0x140ded-0x94,_0x11a753-0xa4);}function _0x119eac(_0x5e0914,_0x227b4f,_0x4a530a,_0x37fd55){return _0x23937d(_0x4a530a-0x268,_0x227b4f,_0x4a530a-0x1f2,_0x37fd55-0x182);}const _0x4e3802={'gurAE':function(_0x2aa863,_0x1249c8){function _0x4ce950(_0x585030,_0x3ffecf,_0x46a5dd,_0x330bbf){return _0x2506(_0x46a5dd-0x37f,_0x3ffecf);}return _0x4b485e[_0x4ce950(0x1d22,0x1ce6,0x16ba,0x1fb1)](_0x2aa863,_0x1249c8);},'XIFUu':'Qwwws','CFmGw':_0x119eac(0xaa8,0xe9b,0xa9a,0x167e),'qzbLs':function(_0x54924c,_0x24cf65){function _0x1d1423(_0x1d8f50,_0xd8c33f,_0x14073d,_0x20be78){return _0x119eac(_0x1d8f50-0x149,_0xd8c33f,_0x14073d-0x4b,_0x20be78-0x116);}return _0x4b485e[_0x1d1423(0x1078,0xb0a,0x84b,-0x5fb)](_0x54924c,_0x24cf65);},'fTFJk':_0x4b485e[_0x43871c(0x823,-0x340,0x1ee,0x9b3)],'rtHwL':function(_0x5ca121,_0x11381f){return _0x5ca121(_0x11381f);},'RngBs':_0x4b485e[_0x119eac(0x1f05,0x1c40,0x16a5,0xe61)]};return new Promise((_0x35b5ec,_0x5f5b42)=>{const _0x2567cf={'WUNny':function(_0x7e5fb5,_0x4aa74f){function _0x36c953(_0x533137,_0x49e410,_0x16c661,_0x22b482){return _0x2506(_0x22b482-0x7e,_0x49e410);}return _0x4b485e[_0x36c953(-0x7c9,0x5ff,0x1239,0x437)](_0x7e5fb5,_0x4aa74f);},'GjrDC':_0x4b485e[_0x5ccda3(0x123d,0x48c,0x9f7,0x79f)],'zjnrT':function(_0x3798eb,_0x5d0172){return _0x4b485e['mmZsc'](_0x3798eb,_0x5d0172);},'mFmGv':_0x4b485e[_0x5ccda3(0x4eb,0xd8d,0x1a9a,0x16df)],'jVExf':function(_0x466fb7,_0x411629){function _0x51b607(_0x2f6e2b,_0x112403,_0x294d66,_0x5dc370){return _0x5ccda3(_0x2f6e2b-0xbe,_0x5dc370-0x347,_0x294d66-0x3,_0x294d66);}return _0x4b485e[_0x51b607(0x17af,0xbcb,0xe45,0x1412)](_0x466fb7,_0x411629);},'ZsKjG':_0x4b485e[_0x5b2430(0xba5,0x1555,0x120c,0xbcb)],'BQhMR':_0x5ccda3(-0x4d3,0xa29,-0x14e,0x157a)+'y:\x20','OkQJj':_0x4b485e[_0x5ccda3(0x166e,0x1d0f,0x14d1,0x28d8)],'PxOdE':function(_0x6be60c,_0x389974){return _0x4b485e['iCJTm'](_0x6be60c,_0x389974);},'LgObI':_0x4b485e[_0x5ccda3(0x1309,0x7c6,0x1112,-0x627)],'ySAeB':_0x4b485e[_0x5b2430(0x2c1,0x39f,0x299,-0x6d0)]};let _0x5ecc90=_0x41b8f0['toLowerCas'+'e']()[_0x5b2430(0x155e,0x1b0b,0x1b40,0x1321)](/[()*]/g,''),_0x38a112=_0x5ecc90[_0x5ccda3(0x166f,0x19a8,0x2734,0x16e2)](/\s/g,'-');function _0x5ccda3(_0x651dd9,_0x446ec7,_0x1e517b,_0x597e9f){return _0x43871c(_0x597e9f,_0x446ec7-0x1e7,_0x446ec7-0xb5,_0x597e9f-0x8a);}function _0x5b2430(_0x37a49b,_0x53c449,_0xb3b96d,_0x432b48){return _0x43871c(_0xb3b96d,_0x53c449-0x8d,_0x53c449-0x218,_0x432b48-0x72);}let _0x39ac90=Math[_0x5b2430(0x15cf,0xa8a,0x16e3,0x364)](Math[_0x5b2430(0x151f,0x1a13,0x277a,0x28dd)]()*(0x25eb+0x1*0xe0a+-0x115*0x30));axios[_0x5ccda3(0x7b3,0xd73,0xf91,0x11a9)](_0x4b485e['Raxlt'](_0x4b485e['YaxCN'](_0x4b485e['VyueL']+_0x38a112,_0x4b485e[_0x5ccda3(-0x500,0x744,-0x238,0x46b)]),_0x39ac90))[_0x5ccda3(0x142b,0x1c97,0x111e,0x12b7)](_0x24b7c7=>{function _0x5e5088(_0xd0ca5b,_0x2faeb0,_0x511c13,_0x458483){return _0x5ccda3(_0xd0ca5b-0x1,_0xd0ca5b-0x1b3,_0x511c13-0x1c6,_0x511c13);}function _0x4d7a17(_0x18be57,_0x5af030,_0x5c2c77,_0x43ae9e){return _0x5ccda3(_0x18be57-0x2a,_0x43ae9e- -0x1a2,_0x5c2c77-0x109,_0x18be57);}const _0x4d108d={'fUxNb':function(_0x11c658,_0x59f908){return _0x4e3802['gurAE'](_0x11c658,_0x59f908);},'KxIeB':_0x4e3802['XIFUu'],'fQYJS':_0x4e3802[_0x4d7a17(0x7c4,0x7da,0x17e9,0x12d1)]};if(_0x4e3802[_0x4d7a17(0x47a,0xf1d,0x872,0xf08)]('HkTeV',_0x4e3802[_0x5e5088(0x7c7,0xc33,-0x3c5,0x1e1)])){let _0xbdde8b=cheerio[_0x4d7a17(-0x2a2,-0x676,0x123d,0x750)](_0x24b7c7[_0x4d7a17(0x583,0xdb8,-0x13c,0xdab)]),_0x48d65c=[];_0x4e3802[_0x4d7a17(0x8f2,-0xada,-0x667,0x1ff)](_0xbdde8b,_0x4e3802[_0x4d7a17(0x103a,0x1311,0x2670,0x18d4)])[_0x5e5088(0x1e06,0x1aed,0x1fdb,0x1c74)](function(_0x4bdbed,_0x3f3577){function _0x54daff(_0x20ed18,_0xe3901f,_0x31345e,_0x2c575d){return _0x4d7a17(_0x20ed18,_0xe3901f-0x1b4,_0x31345e-0x1ce,_0x31345e-0x1a3);}function _0x489ba5(_0x295d6d,_0x1253d5,_0x559345,_0x121f17){return _0x5e5088(_0x1253d5- -0x232,_0x1253d5-0xe1,_0x121f17,_0x121f17-0x39);}_0x4d108d[_0x489ba5(0x1f52,0x1859,0x12d2,0x23ab)](_0x54daff(0x1c88,0x1398,0x17af,0xff3),_0x4d108d[_0x489ba5(0x187e,0x1266,0x1334,0x1d79)])?_0x48d65c[_0x54daff(0xe50,0x401,0xef3,0xfb4)](_0xbdde8b(_0x3f3577)['find']('a')[_0x54daff(0x14c6,0x11d8,0xd83,0x1946)](_0x4d108d['fQYJS'])):_0x2a7a72+=_0x45dee1+_0x489ba5(0x741,0x44c,0x9c1,-0x79f)+_0xd69b00['nama']+'\x0a'+_0x207761+_0x54daff(0x12a8,-0x2a,0xced,-0x116)+_0x461a5a(_0x411a52[_0x54daff(0x1516,0x1749,0xf1b,0xae6)])[_0x54daff(0x25cb,0x1733,0x19a9,0x2562)](/Message/i,'')+(_0x489ba5(0x1ff7,0x1d7c,0x1a6a,0xf15)+_0x489ba5(0x187f,0x1a0c,0x17fe,0xe60)+_0x54daff(-0xb64,-0x370,0x1b3,0x120));});let _0x33c84d=_0x48d65c[Math[_0x4d7a17(0x1226,0x546,-0x51a,0x785)](Math[_0x5e5088(0x1a63,0x1568,0x1cea,0x23a2)]()*_0x48d65c[_0x5e5088(0x6c7,-0x205,0x71e,-0x48a)])];axios['get'](_0x33c84d)[_0x4d7a17(0x1c05,0xe06,0x1e52,0x1af5)](_0x45eaa3=>{function _0x504817(_0x3d2b8e,_0x208d19,_0x3a3ab5,_0x3f64c6){return _0x5e5088(_0x208d19- -0x28c,_0x208d19-0x9d,_0x3a3ab5,_0x3f64c6-0xd6);}function _0x5198bb(_0xbddc7c,_0x5a65a4,_0x19401b,_0x33b327){return _0x4d7a17(_0x33b327,_0x5a65a4-0x9e,_0x19401b-0x11,_0x5a65a4-0xc3);}if(_0x2567cf['WUNny'](_0x2567cf['GjrDC'],_0x2567cf[_0x504817(0x1022,0x1c6b,0x2405,0x1a88)])){const _0xd87feb={};_0xd87feb[_0x5198bb(0x1aec,0x1d90,0x295d,0x120b)]=''+_0x162742[_0x5198bb(0x315,0x37d,0xb9c,0x278)];const _0x2e8e2e={};_0x2e8e2e[_0x504817(0xcb,0x639,0x1279,0x3cf)]=_0x87cfca,_0x47bcd0[_0x5198bb(0x1016,0x99b,0x16b6,0x16f7)+'e'](_0x11e2f4['chat'],_0xd87feb,_0x2e8e2e);}else{let _0x396a0=cheerio['load'](_0x45eaa3[_0x504817(0xbfe,0xe74,0x1852,0x1a18)]),_0x4b9da3={'title':_0x2567cf[_0x5198bb(0x1aeb,0xddf,0x1540,0xa85)](_0x396a0,_0x2567cf[_0x5198bb(0x23,0x751,0x2bd,-0x33c)])['text'](),'author':_0x2567cf[_0x5198bb(0xf4c,0xec6,0x15f7,0x322)](_0x396a0,_0x2567cf[_0x5198bb(-0x9c9,0x34,0x2b,-0xe35)])[_0x504817(0x1134,0x1d96,0x1f0b,0x24a7)]()[_0x504817(0x12bd,0xd2c,0x1581,0xc98)](_0x2567cf[_0x504817(0x1cf9,0x1937,0x1aec,0x1c20)])[-0x110b*0x2+0x1f*-0x27+0x26d0][_0x5198bb(0xa0c,0xd26,0x100,0x138f)](_0x2567cf['OkQJj'])[0x1*0x5d9+0x4*0x6b9+0x1d*-0x121],'kategori':_0x396a0(_0x2567cf[_0x5198bb(0x6ea,0x34,0x569,0xb32)])[_0x504817(0x1ac7,0x1d96,0x1103,0x1a6b)]()[_0x504817(0x8e7,0xd2c,0xf25,0x1a19)](_0x2567cf[_0x5198bb(0x170d,0x1787,0x1f8f,0xd16)])[0x2659+0x5*-0x359+-0x159b*0x1][_0x5198bb(0xbf9,0xd26,0xdb2,0x14b9)]('\x0a')[-0x1*0x206d+-0x4c1*0x3+0x2eb0],'lolos':_0x2567cf[_0x5198bb(0x1e31,0x1e29,0x20f6,0x1d55)](_0x396a0,'#content\x20>'+_0x5198bb(0x149a,0x1716,0xe5d,0x8a7))[_0x504817(0x1f3e,0x1d96,0x1041,0x2a7e)]()[_0x504817(0x1446,0xd2c,0xe31,0x1328)](_0x2567cf[_0x504817(0x1104,0x14b3,0x8bc,0xfb5)])[-0x17*0x15d+0x117d*-0x2+0xe*0x4bd][_0x5198bb(0x946,0xd26,0x3e9,0x1c2a)]('\x0a')[-0x2102+0x35*-0x8f+0x14df*0x3],'cerita':_0x396a0(_0x2567cf[_0x504817(0x143a,0xf66,0x9d3,0xc4d)])[_0x504817(0x16dc,0x1d96,0x1dba,0x1157)]()};_0x35b5ec(_0x4b9da3);}});}else{const _0x379141={};_0x379141[_0x5e5088(0x2022,0x28d4,0x17f4,0x1aa9)]=''+_0x2a5c18['K124'];const _0x17791e={};_0x17791e[_0x5e5088(0x8c5,0x1415,0x114a,-0x4b5)]=_0x120719,_0x49a770[_0x4d7a17(0xb84,-0x1f8,0x2bc,0x8d8)+'e'](_0xa41c93[_0x4d7a17(0x170e,0x1240,0xfd2,0x1120)],_0x379141,_0x17791e),_0x22e869=_0x5927fb['readFileSy'+'nc'](_0x4d7a17(0x642,0xe37,0xb,0xaaf)+_0x5e5088(0x18fc,0x19e7,0x27f0,0x2320)+_0x4d7a17(0xc35,-0x196,0x4c,0x8fd)+_0x5e5088(0x59c,0xc4d,0xb6f,0x6ca));const _0x39cfcc={};_0x39cfcc[_0x5e5088(0x12e3,0x1ae5,0x1c88,0x18b8)]=_0x378126,_0x4201bc[_0x5e5088(0xc2d,0xaff,0x1262,0x1447)+'e'](_0x5479b4['chat'],_0x39cfcc);}});});}switch(_0x1354e9){case _0x4b485e[_0x313705(0x18f4,0x24ae,0x1fbb,0x266c)]:{if(_0x1bac1f)return _0x4b485e[_0x23937d(0xace,0x110a,0x193f,-0x6a)](_0x1db05d,mess[_0x313705(0x982,0x1bd,0x1236,0x21e)]);if(!_0x24aa58)return _0x516d85(mess[_0x23937d(0xc84,0x25,0x1695,0xfeb)]);if(_0x4b485e[_0x313705(0x1eeb,0x27c3,0x14e2,0x2425)](_0x1ba32f[0x23ad+-0x1f13*0x1+-0x49a],'on')){if(_0x1e03f5)return _0x4b485e[_0x23937d(0x183c,0x1a17,0x10e3,0x1745)](_0x516d85,_0x313705(0x74f,-0xc9,0x8eb,-0x54b)+_0x313705(0x1e21,0x1b17,0xfaa,0x1698));banchat[_0x313705(0x1122,0xf9c,0x882,0x18a4)](_0x423161),_0x516d85('Success\x20in'+_0x23937d(0x16dd,0x18f4,0x253f,0x1993)+_0x23937d(0x164e,0x1da1,0x1a2c,0x1629));var _0x1d198c=await _0x175756['groupMetad'+_0x23937d(0x161c,0x1b7b,0x2234,0x1b3c)](_0x423161),_0x184ad9=_0x1d198c[_0x4b485e[_0x23937d(0x1430,0x101a,0x204e,0x105d)]],_0x3c9da9=[];_0x184ad9[_0x23937d(0xb16,0x11b3,0x592,0x145d)](async _0x2fb1b3=>{function _0x5a988a(_0x9b3b10,_0x2c8224,_0x3c2bda,_0x310bd2){return _0x313705(_0x9b3b10-0x11c,_0x2c8224,_0x3c2bda-0x128,_0x310bd2-0x17b);}function _0x5f0e0a(_0x52451a,_0x13b493,_0xebfa6a,_0x4c7b74){return _0x23937d(_0x4c7b74- -0x11d,_0x13b493,_0xebfa6a-0x140,_0x4c7b74-0x29);}_0x3c9da9[_0x5f0e0a(0x1074,0x1329,0x13bf,0xc9f)](_0x2fb1b3['id'][_0x5f0e0a(0x23bb,0x1d7e,0x8fc,0x1755)](_0x5a988a(0x8bc,0x1553,0x1755,0x332),_0x4b485e[_0x5f0e0a(0x963,0x1504,0x1716,0x1445)]));});const _0xb36f63={};_0xb36f63[_0x313705(0x1896,0x2327,0xc38,0x24d1)+'id']=_0x3c9da9;const _0x35ee4a={};_0x35ee4a[_0x313705(0x209f,0x273e,0x25b7,0x22ff)]=_0x23937d(0x1388,0x844,0x1266,0xd23)+_0x23937d(0xa4,0xd44,0xf6c,0x6ff)+'\x0aThe\x20bot\x20h'+_0x313705(0x1652,0x137f,0x1158,0x8da)+_0x23937d(0x1a66,0x19fb,0x20de,0x1a4f)+'this\x20group'+_0x313705(0xde6,0x3a6,0x974,0x1527)+_0x313705(0x190a,0x17d6,0x1e37,0x10c0)+_0x313705(0xb0b,0x557,0x192e,0xce5)+_0x313705(0xd8c,0x617,0x1209,0x1ba0)+_0x23937d(0x4cf,0x6f1,0xa1d,-0x3f2)+'p!',_0x35ee4a['contextInf'+'o']=_0xb36f63;const _0x5285b8={};_0x5285b8[_0x23937d(0x5dc,0x2fd,-0x8b9,0x2d0)]=_0x5cd288,_0x175756[_0x23937d(0x944,0x15e8,0x11a5,0x4fb)+'e'](_0x423161,_0x35ee4a,_0x5285b8);}else{if(_0x4b485e[_0x23937d(0x15dd,0x1030,0x1e8c,0x2285)](_0x1ba32f[0x19c1+0x221b+-0x3bdc],_0x4b485e[_0x313705(0x70e,0x8c2,0x103f,0xdc3)])){if(!_0x1e03f5)return _0x4b485e[_0x313705(0xa53,-0x148,0x272,0x1257)](_0x516d85,_0x23937d(0x7fc,-0x143,0x1506,0x124d)+_0x23937d(0x188d,0x1631,0x99d,0x12fe));let _0x29336b=banchat[_0x23937d(0x9e6,-0x4fc,-0xdb,0x8fa)](_0x423161);banchat[_0x23937d(0x5fb,0x5cd,-0x217,-0x233)](_0x29336b,-0x7a1+0x5*0x191+0x11*-0x3),_0x4b485e[_0x23937d(0x17d7,0x2664,0x12ba,0x2624)](_0x516d85,_0x4b485e[_0x313705(0x216b,0x247c,0x2627,0x29ac)]);}else{const _0x603e34={};_0x603e34['displayTex'+'t']=_0x4b485e['iuYaQ'];const _0x5d0c05={};_0x5d0c05[_0x313705(0x1e72,0x1477,0x1b70,0x2aab)]=_0x1354e9+'\x20on',_0x5d0c05[_0x23937d(0x159c,0x11fd,0x1038,0x1a72)]=_0x603e34,_0x5d0c05[_0x23937d(0x738,0xb9b,-0x3bb,-0x6ab)]=0x1;const _0x21cf10={};_0x21cf10[_0x23937d(0x13f4,0x1b69,0x5b7,0x1086)+'t']=_0x313705(0x1fd3,0x211d,0x292e,0x1188);const _0x4afb1e={};_0x4afb1e['buttonId']=_0x1354e9+_0x23937d(0xddb,0x1b0e,0x3dd,0xf66),_0x4afb1e['buttonText']=_0x21cf10,_0x4afb1e[_0x23937d(0x738,0x703,0x1271,0x1624)]=0x1;let _0xa9dee6=[_0x5d0c05,_0x4afb1e];await _0x175756[_0x313705(0xb3e,0x4ae,0xf03,0x1958)+_0x313705(0x1480,0xc3c,0x14ec,0x1093)](_0x5cd288[_0x313705(0x14f2,0x1fbb,0x171e,0x1d2c)],_0xa9dee6,_0x313705(0x1a4c,0xb78,0x26eb,0x1db3)+'ck\x20the\x20but'+_0x23937d(0x9c0,0xf40,0x1742,0x6d9)+'\x0aBan\x20to\x20Ba'+'n\x0aUnban\x20to'+_0x313705(0xfa1,0x10aa,0x1a63,0xea5),''+global['botname'],_0x5cd288);}}}break;case _0x4b485e[_0x313705(0x72d,-0x2fd,0x51a,0x866)]:{if(_0x1bac1f)return _0x4b485e[_0x313705(0x356,-0x34b,0xc1f,-0x7fd)](_0x1db05d,mess[_0x23937d(0x61c,0x134d,0xb8a,0xbeb)]);if(_0x1e03f5)return _0x4b485e[_0x23937d(0x1c24,0x2a40,0x119e,0x1c5a)](_0x1db05d,mess[_0x23937d(0x5c0,0x17d,0xc3c,0xfc4)]);if(!_0x24aa58)return _0x4b485e[_0x313705(0x1f7f,0x1ec3,0x2e9f,0x2171)](_0x516d85,mess['owner']);if(!_0x1ba32f[0xc1*0x1d+-0x17c9+0x1ec])return _0x516d85(_0x313705(0x61a,0x986,-0x1ce,0xd93)+_0x23937d(0xc93,0x19e3,0x1a52,0x12c0)+_0x23937d(0x125b,0x965,0x1d7f,0x17c7)+'del\x20to\x20unb'+_0x23937d(0x9f8,0x572,0x17af,0x84)+'xample:\x20Re'+_0x23937d(0x10dc,0x15eb,0x1d35,0xc6c)+_0xe1d953+(_0x23937d(0xa7a,0x1500,0x12d9,0x10af)+'o\x20the\x20user'+_0x23937d(0xbe6,0x90a,-0x23,0x1625)+_0x313705(0x10cf,0x1c63,0x1fbc,0x1d83)));if(_0x1ba32f[0x18fb+-0x252f+0x5*0x271])orgnye=_0x4b485e[_0x313705(0x166e,0x9ff,0x209a,0x91e)](_0x1ba32f[-0x23b8+-0x1*-0x47d+-0x4*-0x7cf],_0x4b485e[_0x23937d(0x1d8c,0x1c2b,0x1482,0x12ea)]);else _0x5cd288['quoted']&&(_0x4b485e[_0x23937d(0x1102,0x1f6c,0xa0f,0x1688)]===_0x4b485e[_0x23937d(0x249,0x643,0x96b,0x5b7)]?_0x4b485e[_0x23937d(0x1133,0x592,0x496,0x1bdc)](_0x436a55,_0x4b485e[_0x313705(0xa6b,0x25c,0x9dc,0x1798)]):orgnye=_0x5cd288[_0x23937d(0x5dc,0x146,-0x62b,0x51d)][_0x23937d(0x14ce,0x1c9c,0x181b,0x670)]);const _0x36717a=banUser[_0x23937d(0x178,-0x3b2,-0x787,0x653)](orgnye);if(_0x4b485e[_0x313705(0x1a7e,0x271d,0x21d2,0x225c)](_0x1ba32f[-0x2*-0x38b+-0x1f95+0x187f],_0x4b485e[_0x313705(0xd77,0x1114,0x1b7c,0x26f)])){if(_0x36717a)return _0x4b485e['EHDbG'](ads,_0x4b485e[_0x313705(0x1677,0x1bab,0xad9,0x214d)]);banUser['push'](orgnye),_0x4b485e[_0x23937d(0x5e0,0xd8b,0xcf1,-0x143)](_0x516d85,'Successful'+_0x313705(0x7e3,0x633,0xb1,0xf9f)+_0x23937d(0x15fe,0xc1f,0x1d8b,0x1b4d));}else{if(_0x1ba32f[0x9c+-0x150d+0x1*0x1471]===_0x313705(0x1c8b,0x1015,0x220e,0x228b)){if(!_0x36717a)return ads(_0x4b485e['GuBUB']);let _0x30acf9=banUser[_0x313705(0xd4c,0x1c5e,0x1c62,0x1bb0)](orgnye);banUser[_0x313705(0x961,0xfd3,0x8d0,0x14a)](_0x30acf9,0x96c+0x463+-0xdce),_0x4b485e[_0x313705(0x1cd7,0x2751,0x23d8,0x1800)](_0x516d85,_0x23937d(0x1471,0xcf4,0x149a,0x1c17)+'ly\x20unbanne'+_0x23937d(0x67a,0x4fe,0xeb0,-0x768));}else{if(_0x4b485e[_0x313705(0x8fe,0xd48,0x177a,0x91b)](_0x4b485e[_0x313705(0x3a2,-0x315,0x9ac,-0x16d)],_0x23937d(0x1421,0xa24,0x6d0,0x1790))){const _0x5a61fd={};_0x5a61fd[_0x23937d(0x1d39,0x1897,0x2973,0x2b8d)]=''+_0x27a35e[_0x313705(0x18dc,0x2768,0x1219,0x1e34)];const _0x994963={};_0x994963[_0x313705(0x942,0x70,0x8d4,0x4e0)]=_0x207dc5,_0x51318e[_0x23937d(0x944,0x7de,0x7c6,0x289)+'e'](_0x315d88[_0x313705(0x14f2,0x1d89,0x133c,0x1b37)],_0x5a61fd,_0x994963);}else _0x4b485e[_0x23937d(0xf0a,0x14ea,0xda4,0x9cc)](_0x516d85,_0x4b485e[_0x313705(0x392,0x1f5,-0x81,0x11af)]);}}}break;case _0x23937d(0xc2c,0x143a,-0x65,0xc4d):case _0x4b485e['fQMwy']:case _0x4b485e[_0x313705(0x1d3d,0x1c34,0x1194,0x25dc)]:{if(_0x4b485e[_0x313705(0x13e0,0x1ff3,0x7a7,0x4c3)]!==_0x4b485e['GEqTq']){if(_0x1bac1f)return _0x1db05d(mess[_0x23937d(0x61c,0x11b2,-0x195,-0x5c3)]);if(_0x1e03f5)return _0x4b485e[_0x23937d(0xac8,0x7d,-0x292,0x630)](_0x1db05d,mess[_0x313705(0x926,0x1751,0x4d5,0xaa9)]);if(q[_0x23937d(0x178,-0x12e,-0x3dd,0x75f)]('--help'))return _0x4b485e[_0x313705(0x46d,0xf8d,-0x372,-0x85f)](_0x1db05d,examkosong);if(!isDarah){if(_0x4b485e['losli']==='wuKma'){const _0x48d308={};_0x48d308[_0x313705(0x209f,0x1b21,0x22ba,0x2740)]=''+_0x333872[_0x23937d(0x128c,0x1df7,0x5fb,0x36d)];const _0x361bd5={};_0x361bd5[_0x313705(0x942,0x686,-0x99,0x12ac)]=_0x23be51,_0x3d8135[_0x23937d(0x944,0x1123,0xcaa,0x166a)+'e'](_0x1feecb['chat'],_0x48d308,_0x361bd5);}else addInventoriDarah(_0x5cd288[_0x313705(0x1834,0x1867,0x12f4,0xff4)],DarahAwal);}if(!isInventory){if(_0x4b485e[_0x23937d(0x14b7,0x84b,0x1acc,0x1266)](_0x4b485e[_0x23937d(0xe91,0x563,0xb94,0x236)],_0x4b485e[_0x313705(0x11f7,0x16fb,0x61d,0x1a1e)]))_0x4b485e[_0x313705(0x683,0xb08,-0x3e7,0x12d7)](addInventori,_0x5cd288[_0x313705(0x1834,0x1a24,0xb11,0x2462)]);else{const _0x1eff91={};_0x1eff91['kcKVt']=_0x313705(0x36c,0xe7b,-0xa79,0x116b),_0x1eff91[_0x313705(0x136f,0x91a,0x97c,0x8e1)]=_0x4b485e[_0x23937d(0x1460,0x1af8,0xdeb,0x1f1d)];const _0x5d52a3=_0x1eff91;_0x24172a=_0x4b485e['YQfAP'](_0x48546a,_0x23937d(0x1947,0x251c,0xd7e,0x11dc)),_0x2df446(_0x23937d(0x1a2a,0x17ea,0x18c0,0x1dbd)+_0x5ad1e4+(_0x313705(0x1992,0x192a,0x1965,0x284c)+_0x23937d(0x7c3,0x6ec,0x100e,-0x496)+_0x313705(0x692,0x15a1,0x780,-0x6be)+'e=')+_0x1c39e3+'\x22\x20'+_0x599a67,(_0x3c7b3e,_0x2d8f94,_0x3fce6d)=>{_0x341ab2['unlinkSync'](_0x3d2fd4);if(_0x3c7b3e)return _0x5815ce(_0x5d52a3[_0x352726(-0x245,0x1a4,0x1552,0x978)]);function _0x48faf1(_0xce9a14,_0x2f3245,_0x59ff45,_0x416f90){return _0x313705(_0x59ff45-0x23f,_0xce9a14,_0x59ff45-0x1ec,_0x416f90-0x1cd);}_0x3d50e7=_0x44a1d3[_0x48faf1(0x10b5,0x232c,0x1962,0x1eb0)+'nc'](_0xf76967);const _0xdc95a8={};_0xdc95a8[_0x352726(0x26c9,0xebc,0x2890,0x1ab0)]=_0x237def,_0xdc95a8[_0x352726(0x1656,0x867,0x23a7,0x15f8)]=_0x5d52a3[_0x352726(0x1526,0x924,0x164c,0x1357)];const _0x235060={};function _0x352726(_0x23ec02,_0x2640bd,_0x5b4340,_0x330526){return _0x23937d(_0x330526-0x34e,_0x5b4340,_0x5b4340-0xf5,_0x330526-0xbf);}_0x235060['quoted']=_0x5e8a4e,_0xf53391[_0x48faf1(0x1737,0x2ec,0xee9,0xfc8)+'e'](_0x329a04,_0xdc95a8,_0x235060),_0x2b41bc[_0x352726(-0x4bf,0x347,-0x9e8,0x359)](_0x48488d);});}}!isInventoriBuruan&&_0x4b485e[_0x23937d(0xfc7,0x1ea,0x95f,0x16f6)](addInventoriBuruan,_0x5cd288[_0x313705(0x1834,0x2122,0xa2c,0xb82)]);var _0x175756=await _0x4b485e[_0x313705(0x7b0,0x957,0xaf8,0xeaa)](getBuffer,_0x4b485e[_0x313705(0x20ec,0x1253,0x273e,0x2313)](_0x382fc5,_0x23937d(0x788,0x640,0x86b,0x443)+_0x313705(0x17df,0x1ef1,0x1d8e,0x20a4)));let _0x627726='_[\x20👩🏻‍💼INFO\x20U'+_0x313705(0x19b3,0x266c,0x1f1b,0x189b);_0x627726+=_0x23937d(0x1751,0x177f,0x217c,0x158a)+_0x313705(0x184e,0x1e4b,0x2416,0x1597)+getDarah(_0x5cd288[_0x313705(0x1834,0x12cc,0x15fe,0x932)])+'\x0a',_0x627726+=_0x313705(0x1b83,0x2a14,0xf74,0xfd6)+_0x23937d(0x17eb,0x2429,0x24a6,0x194e)+_0x4b485e[_0x23937d(0x1e09,0xf7f,0x16cd,0x1345)](getBesi,_0x5cd288['sender'])+'\x0a',_0x627726+=_0x313705(0x2092,0x175e,0x2052,0x2568)+'d*\x20:\x20'+_0x4b485e[_0x313705(0x946,0x46d,0x12d,0x37b)](getEmas,_0x5cd288[_0x23937d(0x14ce,0x1838,0x23db,0x670)])+'\x0a',_0x627726+=_0x23937d(0x700,0xd12,0x1411,0x6ff)+_0x23937d(0x203,0xcb8,0xb5b,0x89b)+_0x4b485e['NgeSO'](getEmerald,_0x5cd288[_0x313705(0x1834,0x914,0x964,0xa2d)])+'\x0a',_0x627726+=_0x313705(0x1024,0x1ea6,0x142d,0xe05)+_0x313705(0x19cd,0x25de,0x23a5,0x1483)+_0x4b485e[_0x23937d(0x1bf6,0x2645,0x1eb8,0x1579)](getLimit,_0x5cd288['sender'])+'\x0a',_0x627726+=_0x23937d(0x1be6,0x29b1,0x2a3b,0x2773)+_0x313705(0x5e5,0x6e4,-0x759,0x4f2)+_0x4b485e[_0x23937d(0x1b6f,0xd8d,0x20af,0x2713)](getPotion,_0x5cd288[_0x23937d(0x14ce,0x9d0,0x118c,0x150d)])+'\x0a\x0a',_0x627726+=_0x313705(0x1544,0x1539,0x19ba,0xfd2)+'ESULT🐺\x20]_\x0a',_0x627726+='*🐟Fish*\x20:\x20'+_0x4b485e[_0x313705(0x11e6,0x2e4,0x1485,0xd9e)](getIkan,_0x5cd288[_0x313705(0x1834,0x18c4,0xfa2,0x1910)])+'\x0a',_0x627726+='*🐔Chicken*'+_0x313705(0x656,-0x78e,0x133e,0xc64)+_0x4b485e['ypYAN'](getAyam,_0x5cd288['sender'])+'\x0a',_0x627726+='*🐇Rabbit*\x20'+':\x20'+_0x4b485e['rKybW'](getKelinci,_0x5cd288[_0x313705(0x1834,0x1049,0x11fe,0x1d68)])+'\x0a',_0x627726+=_0x23937d(0x1691,0x2455,0x14da,0xa24)+'\x20'+_0x4b485e['QlNDS'](getDomba,_0x5cd288['sender'])+'\x0a',_0x627726+=_0x23937d(0x4a1,0x22,-0x102,0x1357)+_0x4b485e[_0x23937d(0x114,0xdc,0x5d8,-0xb3a)](getSapi,_0x5cd288[_0x23937d(0x14ce,0x1a38,0x1456,0x748)])+'\x0a',_0x627726+='*🐘Elephant'+_0x23937d(0x7dc,0xc53,0x107b,0x1608)+_0x4b485e[_0x313705(0x117e,0x15d8,0x4e9,0xfb6)](getGajah,_0x5cd288['sender'])+'\x0a\x0a',_0x627726+='_*'+_0xa43395+'*_',await _0x175756[_0x23937d(0x1bcf,0x285c,0x29e5,0x10ca)+'g'](_0x423161,_0x4b485e['KLtQA'](_0x4b485e['Ufuey']('',''),_0x627726),'©\x20'+botname,_0x175756,[{'quickReplyButton':{'displayText':_0x4b485e[_0x313705(0xba6,0x1234,0x4e5,0x4ac)],'id':_0x313705(0x1146,0xdd1,0xce7,0x171e)}}]);}else{if(_0x3f5db0)return _0x4b485e[_0x313705(0x1a93,0x1de7,0x1456,0x1d58)](_0x30521d,_0x179cc6[_0x23937d(0x61c,0xdad,0x874,0x6da)]);if(_0x20a09f)return _0x4b485e[_0x23937d(0xf95,0xa06,0xf79,0x1a4a)](_0x3204d2,_0x43582e[_0x313705(0x926,-0x3b1,-0x8c,-0x245)]);let _0x3538d8=_0x36dda0['db'][_0x23937d(0xe17,0xd61,0x10e8,0x93f)]['database'];if(!_0x4b485e[_0x313705(0xc7c,0x4a2,0x752,-0x93)](_0x58b096[_0x313705(0xa31,0x1498,-0x239,-0xaf)+'e'](),_0x3538d8))return _0x4b485e['iCJTm'](_0x2a2c7b,'\x27'+_0x395372+('\x27\x20Not\x20List'+'ed\x20In\x20The\x20'+_0x313705(0x20a6,0x23e1,0x16bd,0x21de)+'st'));delete _0x3538d8[_0x26b9d8[_0x23937d(0x6cb,-0x221,-0x52e,-0x6e8)+'e']()],_0x4b485e[_0x313705(0x2066,0x2e80,0x2292,0x2547)](_0x2d3363,_0x23937d(0x122e,0x909,0x192d,0x1d00)+_0x313705(0x1757,0xedd,0x18a7,0xfa5)+'\x27'+_0x32360e+(_0x23937d(0x1695,0x1524,0xd64,0x112a)+_0x313705(0x15c2,0x2194,0xe70,0x7d3)+_0x23937d(0x800,0xc47,0x7f9,0x934)));}}break;case _0x4b485e[_0x23937d(0x65b,0x12c0,-0x3c5,0x417)]:if(_0x1bac1f)return _0x4b485e[_0x23937d(0xe0b,0x16d,0xe3d,0x569)](_0x1db05d,mess['ban']);if(_0x1e03f5)return _0x4b485e[_0x23937d(0x5e5,-0x401,0x937,0x8d2)](_0x1db05d,mess[_0x23937d(0x5c0,-0x140,-0x36e,-0x465)]);{let _0xe29367='🧩\x20*ALL\x20LIM'+_0x23937d(0xfa0,0x14c1,0x137c,0x143b)+'\x0a\x0a';for(let _0x155ddb of _limit){_0xe29367+=_0x23937d(0x8a,-0x752,0x894,0xa60)+_0x155ddb['id']['split']('@')[0x5*-0x144+0x15ed+0xb*-0x16b]+(_0x23937d(0x1498,0xb8b,0x1aec,0x1c93)+_0x313705(0x656,-0x66e,0xb04,0xd0e))+_0x155ddb[_0x23937d(0x44f,0x2db,0x2a4,-0x741)]+'\x0a';}_0x4b485e[_0x23937d(0x521,-0x254,-0x619,-0x884)](_0x1db05d,_0xe29367);}break;case _0x4b485e[_0x313705(0x1994,0xf20,0x215e,0x1ce1)]:if(_0x1bac1f)return _0x1db05d(mess[_0x23937d(0x61c,-0xb2,0x113c,0xa8c)]);if(_0x1e03f5)return _0x4b485e[_0x313705(0x580,0xcbb,0x46a,0xed)](_0x1db05d,mess[_0x313705(0x926,0x16bd,0xc5,0x5f9)]);{if(_0x4b485e[_0x313705(0x4e0,-0x2f1,0x84a,-0x8d0)](_0x4b485e['ZrNCS'],_0x23937d(0xc3,0xf42,0xcd2,-0x4d7))){let _0x97b44a=_0x313705(0x925,0x1763,0x9b0,0x103b)+_0x313705(0x163b,0x191c,0xc84,0x11f6);for(let _0x4a9f72 of _buruan){if(_0x4b485e['WkTOC']('dHPnW',_0x4b485e[_0x313705(0x1aa8,0x18f2,0x1db6,0x150c)])){const _0x26ff30=_0x4b485e[_0x23937d(0x10a5,0x1948,0x15eb,0x23a)][_0x23937d(0xccf,0x4a1,0x111a,0x60b)]('|');let _0x2bd900=-0x21b8+0x71+0x2147;while(!![]){switch(_0x26ff30[_0x2bd900++]){case'0':_0x97b44a+=_0x313705(0xca5,0xc36,0xf78,0x1857)+_0x23937d(0x2f0,0x10ca,0xce,-0x86e)+_0x4a9f72[_0x23937d(0xcbc,0x959,-0x18b,0x1124)]+'\x0a';continue;case'1':_0x97b44a+=_0x313705(0x19f7,0x24e6,0xea0,0xcd1)+'\x20'+_0x4a9f72[_0x313705(0x13e7,0x1958,0x1514,0x12d7)]+'\x0a';continue;case'2':_0x97b44a+=_0x313705(0x2016,0x2167,0x16a3,0x1d43)+_0x4a9f72[_0x313705(0x727,0xa83,-0x652,0x451)]+'\x0a';continue;case'3':_0x97b44a+=_0x23937d(0x1240,0xe50,0x1ae7,0xc30)+':\x20'+_0x4a9f72[_0x23937d(0x6d2,0x1146,0xc96,0x9a8)]+'\x0a';continue;case'4':_0x97b44a+='➸\x20*ID\x20:*\x20'+_0x4a9f72['id']+'\x0a';continue;case'5':_0x97b44a+=_0x23937d(0x4a1,0x804,0x725,0x3b8)+_0x4a9f72[_0x313705(0x1d56,0x1493,0x17ad,0x294c)]+'\x0a';continue;case'6':_0x97b44a+=_0x313705(0x1570,0x978,0x2249,0xd4b)+_0x23937d(0x7dc,0x81e,0x9be,-0x283)+_0x4a9f72[_0x23937d(0x8ed,0x163f,0xd8,0xe80)]+'\x0a\x0a';continue;}break;}}else{const _0xc98540={};_0xc98540[_0x23937d(0x13f4,0x213b,0xc4b,0x1f21)+'t']=_0x4b485e[_0x23937d(0x116e,0x1846,0x18cb,0x1a03)];const _0x29eebf={};_0x29eebf['buttonId']=_0x963577+_0x23937d(0x106a,0xf12,0x1bf0,0x1562),_0x29eebf[_0x23937d(0x159c,0x1857,0x1e4c,0xc94)]=_0xc98540,_0x29eebf[_0x313705(0xa9e,0x13d8,0x131e,0xf81)]=0x1;const _0x2230c2={};_0x2230c2[_0x23937d(0x13f4,0x1d03,0x1bfa,0xb62)+'t']=_0x4b485e[_0x23937d(0x519,-0x5e9,0x4b4,0x10f0)];const _0x1923d1={};_0x1923d1[_0x23937d(0x1b0c,0x116c,0x158f,0x2173)]=_0x26cc6d+'alive',_0x1923d1[_0x23937d(0x159c,0xd48,0x1837,0x864)]=_0x2230c2,_0x1923d1[_0x23937d(0x738,0x7d,0x10a5,0xb61)]=0x1;const _0x3270b8={};_0x3270b8[_0x313705(0x175a,0x2634,0x25d2,0x1b70)+'t']=_0x4b485e['FMFDA'];const _0x54e4f6={};_0x54e4f6['buttonId']=_0x48c21d+_0x23937d(0x14ef,0x1ea0,0xf56,0x1e23),_0x54e4f6['buttonText']=_0x3270b8,_0x54e4f6['type']=0x1;let _0x4ac50b=[_0x29eebf,_0x1923d1,_0x54e4f6];const _0x4d303b={};_0x4d303b[_0x313705(0xddf,0xefe,0x1926,0xb33)]=_0x4b485e[_0x23937d(0x19a4,0x1e10,0x1892,0x1596)];const _0x5d53f7={};_0x5d53f7[_0x23937d(0x1c43,0x1c82,0x1c7b,0x1530)]=_0x4d303b,_0x5d53f7[_0x313705(0xcce,0x1ac2,-0x10d,0x1573)]='\x0a┏━❯\x20'+_0xb0ca99+(_0x23937d(0x147,0xb13,-0x3e0,-0x51a)+_0x23937d(0x3a1,0x4a7,-0x30e,0xa0b)+_0x23937d(0x2e9,0x3b2,0xb68,-0x19d)+'┃║\x09\x20\x20\x20\x20\x20\x20\x20'+_0x23937d(0x10c0,0x1a12,0x1a30,0x1d7e))+_0x59363d+'\x20'+_0x2b7c+(_0x23937d(0x108d,0x1d09,0x1726,0x1d43)+'┃╠')+_0x201b9a+'\x20'+_0x58e059+'start\x0a┃╠'+_0x5e7f50+'\x20'+_0x297e56+_0x23937d(0x1375,0x1566,0x19af,0xb2f)+_0x4f8929+'\x20'+_0x2c5a3a+('leave\x0a┃╚══'+_0x313705(0x1846,0x210f,0x19d1,0xbbb)+_0x23937d(0xa67,0x505,0x1262,0x6a6))+_0xe29535+_0x313705(0xbe8,0x141a,-0x51,0xab1),_0x5d53f7[_0x23937d(0x106e,0x1a8,0x949,0x1413)]=_0x11da3c[_0x23937d(0x421,0x7f4,-0x8d4,-0x5f8)]['name'],_0x5d53f7[_0x313705(0xfa0,0x1e3b,0x22d,0x4d4)]=_0x4ac50b,_0x5d53f7[_0x23937d(0x1b19,0x1d25,0x1bcf,0x1e71)]=0x4;let _0x2b96ed=_0x5d53f7;const _0x9684c5={};_0x9684c5[_0x23937d(0x5dc,0x6de,-0x68c,0xfd4)]=_0x1c09c8,_0x294abb[_0x23937d(0x944,-0x481,0x17a6,-0x63)+'e'](_0x42b3c4['chat'],_0x2b96ed,_0x9684c5);}}_0x4b485e[_0x23937d(0x1871,0x2147,0x10fd,0x12a3)](_0x1db05d,_0x97b44a);}else{if(!_0xfeb91e)return _0x4b485e[_0x23937d(0x287,-0x93,0x295,-0x85b)](_0x6d3c67,'Already\x20Un'+'banned');let _0x34c732=_0xfc8241['indexOf'](_0xe05eb2);_0x47439b[_0x313705(0x961,0x1696,0x1425,-0x57d)](_0x34c732,0xca9*-0x1+-0x1*-0x1241+-0x597),_0x4b485e[_0x23937d(0x1745,0x211c,0xf5b,0x2426)](_0xc237c3,_0x313705(0x1e88,0x27b9,0x2212,0x2669)+_0x313705(0x1190,0x832,0x1601,0x28a)+'\x20the\x20gc');}}break;case _0x23937d(0xef7,0xff2,0xc33,0x77c):case _0x313705(0x190f,0x192f,0x16fe,0x2617):{if(_0x1bac1f)return _0x4b485e[_0x23937d(0x132,0x43d,-0x4b,0xcb1)](_0x1db05d,mess['ban']);if(_0x1e03f5)return _0x4b485e[_0x313705(0x1a00,0x1ff5,0x189b,0x230a)](_0x1db05d,mess[_0x23937d(0x5c0,0xfab,0x1370,0x640)]);if(q[_0x23937d(0x178,-0x4c7,-0x25c,0xb41)](_0x4b485e[_0x23937d(0x337,0xf57,0xaf3,0x11d0)]))return _0x4b485e[_0x23937d(0x440,0x6a2,-0xb0,0xda3)](_0x1db05d,examkosong);!isInventory&&addInventori(_0x5cd288['sender']);if(_0x4b485e[_0x313705(0x5b7,0x10b3,0xf82,0xb08)](isCekDarah,-0x2075+0x5*0x3b+0x1f4f))return _0x4b485e[_0x23937d(0x126b,0x13cd,0xacc,0x59c)](_0x1db05d,_0x313705(0x74d,0x7be,-0x14d,0xc03)+'ed!,\x20Try\x20T'+_0x313705(0x14ca,0xb3c,0xcfb,0xa07)+_0x313705(0x367,-0xa4d,0x5e,0xc17));let _0x19d0eb=[0x97*0x37+-0x1714*0x1+-0x95c,0x966+0x183f+0x1*-0x21a3,0x196d+0x6f0*0x3+0xcc*-0x3a,-0xbaa+0x4d5*-0x2+0x1554,-0x25c4+-0x63e*0x2+0x1*0x3243,-0x7*-0xb2+0xa60*0x3+-0x23fe,-0x1511+0x24f1*0x1+0xef*-0x11,0x1d73+0x370*-0x1+-0x1a02,-0x5f*-0x28+0x332*-0xb+0x22*0x99,0x209*-0x9+-0x840*-0x4+-0xeae,0x2149+-0x119a+-0xfaa,-0x2476+-0x2*-0xde7+0x8a8,0x42a+-0x1*0x8a5+-0x47b*-0x1],_0x42c829=[0x1107+-0x342+-0xdc5,-0x1*-0x1baa+0x13aa+-0x977*0x5,-0x12*-0xf9+0x12b8+-0x487*0x8,0x2*0x224+-0x2*0x218+-0x1*0x15,0x16e0+0x1*-0x11db+-0x505*0x1,0xd79+0x4*0x41b+-0x1de5,0x26f0+0x1*0x1d31+-0x4421,0xb2e+-0x1aa*-0x6+0x1529*-0x1,0x1cb5*-0x1+-0x7ec+-0x412*-0x9,-0x7f6+0x1064+-0x86e,0x1bf0+0x175d*-0x1+0x1*-0x493,0x20e2+0x68+-0x852*0x4],_0x37eebc=[-0x2193+-0xeae+-0x3041*-0x1,0x19a*-0x11+-0x1650+-0x175*-0x22,-0x1df9+-0x23ee+-0x25*-0x1c8,0x874+0xa8f+-0x1303,-0x1b08+-0x16ce+0x31d6,-0x2f6*-0x7+-0x772+0x3*-0x46d,0x1321+-0x61c+0x21*-0x65,0x15f5*-0x1+0x1735+-0x13e,0x1*0x889+0x1*0x207e+0x2*-0x1483,0x1*0x12ca+-0xc22+-0x6a8,-0x16f*-0x2+0x7*-0x1ad+0x8dd,0x3*-0xa9d+-0x8e4*0x1+0x16*0x1da];var _0x22116c=_0x19d0eb[Math['floor'](_0x4b485e[_0x23937d(0x52b,0x2bf,0x39c,-0x87a)](Math[_0x23937d(0x177a,0x1106,0x21cf,0x1274)](),_0x19d0eb[_0x23937d(0x3de,0x67d,0x11e0,-0x8bb)]))],_0x396156=_0x42c829[Math[_0x23937d(0x7f1,0xd06,-0x426,0x1508)](_0x4b485e[_0x23937d(0x52b,0x4a5,0xa67,-0x323)](Math[_0x23937d(0x177a,0x168a,0x1ba8,0x1124)](),_0x42c829[_0x23937d(0x3de,0x1a9,-0x28,-0x8bf)]))],_0x563c9e=_0x37eebc[Math[_0x313705(0xb57,0x1856,0x1dd,-0x8e)](_0x4b485e[_0x23937d(0x22b,-0xa8b,0x29c,-0xc30)](Math[_0x23937d(0x177a,0x1d50,0x2295,0x1aad)](),_0x37eebc[_0x313705(0x744,0xee,0x14a3,0xa16)]))];_0x4b485e[_0x23937d(0x9c4,0xe91,0x75,0xae4)](setTimeout,()=>{function _0x4c5151(_0x36d9fd,_0x1b50eb,_0xf9f62f,_0x20ef3e){return _0x23937d(_0x20ef3e-0x3ce,_0x1b50eb,_0xf9f62f-0x90,_0x20ef3e-0x162);}function _0x41b506(_0x3bb714,_0x27ddd2,_0x3a4dae,_0x1ad5dd){return _0x23937d(_0x3bb714-0x1b6,_0x1ad5dd,_0x3a4dae-0x123,_0x1ad5dd-0x26);}if(_0x4b485e[_0x41b506(0x1eac,0x1a7e,0x1e5a,0x215f)](_0x4b485e[_0x4c5151(0x12a1,0x1810,0x562,0x1474)],_0x4b485e[_0x4c5151(0x1e1c,0x1096,0xff2,0x1474)])){let _0x1d4619=_0x41b506(0x137f,0x4cb,0xa5e,0x1991)+_0x4c5151(0x96a,0x1d90,0x1403,0x14cc)+_0x4c5151(-0x278,0x1272,0x143b,0x55f)+_0x22116c+_0x41b506(0x153c,0x137f,0x1d1c,0x1ea6)+_0x396156+(_0x41b506(0x341,0xa83,-0x38b,0x4f1)+_0x4c5151(-0x332,-0x38f,-0x680,0x6be))+_0x563c9e,_0x5a4684=[{'buttonId':''+_0x4b485e[_0x41b506(0x5c8,0x2fe,0xba8,0x1126)](_0xe1d953,_0x1354e9),'buttonText':{'displayText':_0x4b485e[_0x4c5151(0x21fc,0x18e1,0x7d8,0x1401)]},'type':0x1}];const _0x440cf4={};_0x440cf4[_0x4c5151(0x1f1,0x113a,0x1705,0xe47)]=_0x4b485e[_0x41b506(0xbef,-0x273,0xcc,-0x290)];const _0x3d4851={};_0x3d4851['image']=_0x440cf4,_0x3d4851[_0x4c5151(0xf59,0x1186,0xf8c,0xd36)]=_0x1d4619,_0x3d4851['footer']=_0xa43395,_0x3d4851[_0x4c5151(0x1ea6,0x18e7,0xa67,0x1008)]=_0x5a4684,_0x3d4851['headerType']=0x4;let _0x54a93e=_0x3d4851;const _0x3e77b6={};_0x3e77b6[_0x41b506(0x792,0x5e6,0x4f4,0x22b)]=_0x5cd288,_0x175756[_0x41b506(0xafa,0x129d,0xc7c,-0x3c6)+'e'](_0x423161,_0x54a93e,_0x3e77b6);}else return _0x4b485e['vJiFV'];},0x1021+-0xdf8+0x192f),_0x4b485e[_0x313705(0x1254,0xe15,0xd2f,0x1516)](setTimeout,()=>{function _0x1f0c59(_0x52a3b2,_0x25873e,_0x4fe7de,_0x53c2a1){return _0x23937d(_0x25873e- -0xc5,_0x4fe7de,_0x4fe7de-0x1c3,_0x53c2a1-0x7d);}function _0x38e6ee(_0x375b9e,_0x1d6069,_0x3327d1,_0x486fdc){return _0x23937d(_0x375b9e- -0x130,_0x1d6069,_0x3327d1-0xe,_0x486fdc-0x192);}_0x4b485e['eBgSp'](_0x1db05d,'@'+_0x5cd288[_0x38e6ee(0x139e,0xc22,0x76e,0xeb5)][_0x1f0c59(0x1238,0xc0a,0x991,0x1494)]('@')[0x3b+0x1*0x1b1f+-0x1b5a]+(_0x1f0c59(0xa95,0x9eb,-0x479,0x933)+_0x1f0c59(0x11c8,0xc1d,0x10dd,0x54c)));},0x16*-0x137+-0xee8+0x2f7e),kurangDarah(_0x5cd288[_0x23937d(0x14ce,0x198f,0x93c,0x1209)],-0x18ef*0x1+0x1*-0xeaf+-0x8*-0x4f5),_0x4b485e[_0x23937d(0x7cf,0x1526,0xaa5,0x4fd)](addBesi,_0x5cd288[_0x313705(0x1834,0x1010,0x22ae,0x26f9)],_0x22116c),_0x4b485e[_0x313705(0x13ad,0xa01,0xa17,0x141a)](addEmas,_0x5cd288['sended'],_0x396156),addEmerald(_0x5cd288[_0x23937d(0x14ce,0x5f5,0x12d7,0x1a66)],_0x563c9e);}break;case _0x4b485e['HaieS']:case _0x4b485e[_0x23937d(0x1de5,0x20e4,0x2bef,0x1f04)]:{if(_0x1bac1f)return _0x1db05d(mess['ban']);if(_0x1e03f5)return _0x4b485e[_0x313705(0x90a,0x139d,-0xa7,0x60a)](_0x1db05d,mess['banChat']);if(q['includes'](_0x4b485e[_0x313705(0x69d,-0x33e,0x491,-0x4b)]))return _0x1db05d(examkosong);!isInventoriBuruan&&_0x4b485e['MOPyg'](addInventoriBuruan,_0x5cd288[_0x23937d(0x14ce,0x177f,0xe9d,0x1a48)]);!isInventoryMonay&&_0x4b485e[_0x23937d(0x34b,0xfc9,0x1179,0xf52)](addInventoriMonay,_0x5cd288[_0x23937d(0x14ce,0x1330,0x17cd,0x2386)]);if(!isInventory){if(_0x4b485e[_0x313705(0x19e1,0x1b81,0x248d,0x1e76)]!==_0x4b485e['sZheB']){const _0x1bb04d={};_0x1bb04d['text']=''+_0x1fd5fe[_0x313705(0x16c6,0xb12,0x1932,0x96e)];const _0x4f7ac9={};_0x4f7ac9[_0x313705(0x942,0x1293,0x1645,0x1760)]=_0x3998af,_0x5ab019['sendMessag'+'e'](_0x65b16a[_0x313705(0x14f2,0xfa7,0x103e,0x7d9)],_0x1bb04d,_0x4f7ac9);}else _0x4b485e[_0x23937d(0xfca,0xeeb,0x299,0x185a)](addInventori,_0x5cd288[_0x23937d(0x14ce,0x156b,0x9b9,0x9b9)]);}if(!q)return _0x4b485e[_0x313705(0x406,-0x559,0xbed,0x102c)](_0x1db05d,_0x23937d(0xe34,0x94c,0x1c3f,0x890)+_0x313705(0x7d3,0x223,0x15de,0x1697)+_0x23937d(0x20c,0x1c4,0x741,0xd98)+_0x23937d(0x10c2,0xf6f,0x1624,0x2ab)+_0x313705(0x60e,-0x1fd,-0x9d,0x589)+_0x313705(0x1681,0x1cf6,0x1399,0x2520)+_0x313705(0x1bd2,0x299d,0x1a46,0x232b)+_0x4b485e[_0x313705(0x3f4,0x11a8,0x2b2,-0xade)](_0xe1d953,_0x1354e9)+_0x313705(0x1976,0x1723,0xe35,0x25f3));var _0x12b240=_0x1ba32f[-0x2600*-0x1+-0x1d03*0x1+0x64*-0x17];if(_0x1ba32f[0x1163+0x8*-0x2fd+0x685*0x1]===_0x4b485e[_0x313705(0x912,0xff7,0xbb2,0x12ee)]){let _0x4e6500=_0x4b485e[_0x23937d(0x22b,-0x62,-0xa6,-0x37d)](0x2ca14+-0x2494c+0x105d8,_0x12b240);if(!_0x1ba32f[0x937+0x1*-0x270d+-0x1*-0x1dd7])return _0x4b485e['jiOoq'](_0x1db05d,_0x23937d(0xda5,0xbc0,0x1547,-0x45)+_0x4b485e[_0x23937d(0x2bd,0xa3e,0x9c4,0xf4b)](_0xe1d953,_0x1354e9)+(_0x313705(0xcc1,0x1ae6,0x1176,0xdd8)+_0x313705(0x120d,0x1d28,0xec0,0xb8f)+_0x313705(0x15b3,0xfa7,0x240b,0x73c)+_0x313705(0xd7e,0xfbd,0x1d7,0x489)));if(_0x4b485e[_0x313705(0x1feb,0x2c49,0x2897,0x14d8)](isMonay,_0x4e6500))return _0x4b485e[_0x313705(0x1abd,0x1620,0xc9d,0x1b79)](_0x1db05d,_0x4b485e[_0x23937d(0x767,-0x42d,-0x256,0x318)]);kurangMonay(_0x5cd288['sender'],_0x4e6500);var _0x107703=_0x4b485e[_0x23937d(0xc5b,0x65e,0x1265,0x1209)](_0x12b240,0x1*-0xa67+0x737*-0x1+0x119f*0x1);_0x4b485e[_0x313705(0x10a8,0x1505,0x22b,0x177f)](addPotion,_0x5cd288[_0x313705(0x1834,0x1588,0x1ec9,0x20e9)],_0x107703),setTimeout(()=>{function _0x223119(_0x1a9e7d,_0x3cf1c9,_0x27cb5a,_0x541f6c){return _0x23937d(_0x1a9e7d-0x2c2,_0x541f6c,_0x27cb5a-0x12b,_0x541f6c-0x17a);}function _0x2d7507(_0x26cef0,_0x450d32,_0x5304d9,_0x1230e0){return _0x23937d(_0x26cef0-0x396,_0x1230e0,_0x5304d9-0xae,_0x1230e0-0x12);}_0x4b485e['YQfAP'](_0x1db05d,_0x2d7507(0x637,0x7ce,0x5b0,0xa18)+_0x2d7507(0x1217,0x12ba,0x15f1,0xeb4)+_0x2d7507(0xc15,0x9f9,0x1b1f,0x412)+_0x2d7507(0x215e,0x2f5b,0x2e9c,0x14dd)+_0x223119(0xb14,0x1c9,0xad2,0x6a7)+_0x4b485e[_0x223119(0xf0d,0x1047,0xcfc,0x13b1)](getMonay,_0x5cd288[_0x2d7507(0x1864,0xe84,0x1377,0x1d9d)])+(_0x223119(0x2e2,0x11db,0x6a5,0xfb5)+_0x2d7507(0x615,0xbd5,0xc27,0xb67))+_0x4b485e[_0x223119(0x2b7,0x8aa,0x615,0x4bf)](getPotion,_0x5cd288['sender']));},-0x8b9*-0x2+0x1*0x22f1+-0x2c93);}else{if(_0x4b485e['BlKeb'](_0x1ba32f[0x174e+-0x1*-0x236b+-0x3ab9*0x1],_0x4b485e[_0x23937d(0xd2,-0x81b,-0x81,0x3e1)])){let _0x13e782=_0x4b485e['WLXUt'](-0x1b7d*-0x1+0x2*-0x830+0x86b,_0x12b240);if(!_0x1ba32f[0x29*0x2b+0x2123+0x5*-0x801])return _0x4b485e[_0x23937d(0x1124,0x740,0xf16,0x280)](_0x1db05d,_0x23937d(0xda5,0x89c,0x8e4,0x4c8)+_0x4b485e['fgCHO'](_0xe1d953,_0x1354e9)+(_0x23937d(0x2c5,0x33f,0x31,0x1cb)+_0x313705(0x999,0x6ac,-0x46,0x12b6)+'Food\x20=\x20250'+_0x23937d(0x1969,0x26c0,0x1676,0x16f6)));if(_0x4b485e['tzuMN'](isMonay,_0x13e782))return _0x1db05d(_0x4b485e['IseBE']);_0x4b485e[_0x313705(0x7cb,0x4e0,0x49c,0xf91)](kurangMonay,_0x5cd288['sender'],_0x13e782);var _0x107703=_0x12b240*(0x5*0x161+-0x1*-0x107b+-0x1*0x175f);_0x4b485e[_0x313705(0x13b6,0x1f6a,0x13e9,0x2154)](addUmpan,_0x5cd288['sender'],_0x107703),_0x4b485e[_0x23937d(0xf99,0x1432,0x5f6,0x13dd)](setTimeout,()=>{function _0x397ba4(_0x417ba7,_0xd5c3ec,_0x2872b6,_0x2c3dc4){return _0x313705(_0x2c3dc4- -0x1ab,_0xd5c3ec,_0x2872b6-0x130,_0x2c3dc4-0xda);}const _0x557367={'imBaj':function(_0x1a791d,_0x386f87){function _0x4e6287(_0x294ec2,_0x57db7d,_0x4dcb7e,_0x3e6876){return _0x2506(_0x57db7d- -0x235,_0x4dcb7e);}return _0x4b485e[_0x4e6287(0x20c8,0x1cbb,0x2b3a,0x1ada)](_0x1a791d,_0x386f87);},'eVIZr':_0x3bd193(-0x8b3,0xb8,0xf4d,-0xa4c),'wymwK':function(_0x25d3a0,_0xfc2478){return _0x25d3a0(_0xfc2478);},'djUYR':function(_0x2a9d98,_0x495eee){return _0x4b485e['uTGHg'](_0x2a9d98,_0x495eee);}};function _0x3bd193(_0x25139e,_0x551e3d,_0xe90aef,_0x428d07){return _0x23937d(_0x551e3d- -0x98,_0xe90aef,_0xe90aef-0x127,_0x428d07-0x19d);}if(_0x4b485e['rAsPf'](_0x4b485e['ZrayD'],_0x4b485e[_0x3bd193(0x2039,0x1b13,0x1515,0x16d2)])){if(_0x557367[_0x3bd193(0xbad,0x22b,0x240,0x3b)](_0xb68507['upsongvoic'+'e'],_0x557367[_0x397ba4(0x32a,0x15fa,0x1627,0xc02)]))return _0x557367[_0x3bd193(0xe5d,0x1624,0x1bf1,0x12e9)](_0x36608c,_0x397ba4(0x1506,0x4cb,0xd44,0xdd2));_0x5e978c['upsongvoic'+'e']=_0x3bd193(0xe0e,0xb8,0xe69,0xf18),_0x557367[_0x397ba4(0x1aa,0x908,-0x1f7,0x2a7)](_0x165ed4,_0x1ffa72[_0x3bd193(0x174a,0x8d4,0xbfe,0x4d1)]+(_0x3bd193(0x16aa,0xe66,0x1c69,0x1796)+_0x397ba4(0x4c4,0x8bd,0xa22,0x5a7)+'gs\x20as\x20VOIC'+_0x3bd193(0x1c80,0xdc1,0x1096,0xe59)));}else _0x4b485e[_0x397ba4(0x1b85,0x1576,0x233d,0x1ccb)](_0x1db05d,_0x397ba4(0x1008,0x898,0x99f,0x45c)+_0x397ba4(0x192b,0x107a,0x14d8,0x103c)+_0x397ba4(0xa30,0x17c,0x102,0xa3a)+_0x3bd193(0x16b3,0x1d30,0x1fb1,0x2635)+_0x397ba4(0xd6d,0x2d7,0xa4c,0xa0d)+_0x4b485e[_0x3bd193(0xf9e,0xf56,0xf11,0x283)](getMonay,_0x5cd288[_0x397ba4(0x170b,0x1292,0xa79,0x1689)])+(_0x3bd193(0xcf,0xc1d,0xd,0x19b5)+'t\x20Food*\x20:\x20')+getUmpan(_0x5cd288[_0x3bd193(0x1ad8,0x1436,0x122f,0x1fcc)]));},-0x8bc*0x4+-0x1*0x1b78+0x8c7*0x8);}else{if(_0x1ba32f[-0x1e89*0x1+-0x2e*0xc7+0x424b]===_0x313705(0x7b5,0x1046,0x1000,0xa46)){let _0x5018ca=_0x4b485e[_0x313705(0x14bb,0x7eb,0x18ca,0x19a2)](-0xd264+0xf4*-0x56+0x2*0xd68a,_0x12b240);if(!_0x1ba32f[-0x1047+-0xd*0xe9+0x1c1d])return _0x4b485e[_0x313705(0x13e8,0x1f26,0x70c,0x6bb)](_0x1db05d,'Example\x20:\x20'+(_0xe1d953+_0x1354e9)+(_0x23937d(0x548,-0x23f,0x109a,0x59d)+'1\x20Limit\x20=\x20'+_0x313705(0xd46,0x72f,0x1967,0x12ee)+'y'));if(isMonay<_0x5018ca)return _0x4b485e[_0x313705(0x117c,0x1ccd,0x15f3,0x274)](_0x1db05d,_0x23937d(0xb99,-0x311,0x401,0x56a)+'ning\x20Money'+'\x20Is\x20Not\x20Su'+_0x23937d(0x17b2,0xc52,0x2491,0x1c28)+_0x313705(0xf91,0x7a3,0xda3,0x42d)+_0x313705(0x1c2a,0x1fc9,0x1779,0xd4b));_0x4b485e[_0x313705(0x11ab,0x1af7,0x1fac,0x18bb)](kurangMonay,_0x5cd288[_0x313705(0x1834,0xff0,0xbcb,0xadd)],_0x5018ca);var _0x107703=_0x12b240*(-0x61*-0x4+-0x4e1+-0x35e*-0x1);_0x4b485e[_0x23937d(0x36,-0x702,-0x95c,0x5a3)](addLimit,_0x5cd288[_0x313705(0x1834,0x22bc,0x2596,0x2473)],_0x107703),_0x4b485e[_0x23937d(0xeee,0x11b0,0x117d,0x19be)](setTimeout,()=>{function _0x10e1d9(_0x15723e,_0x2ab6ac,_0x1919c2,_0x545dec){return _0x23937d(_0x1919c2- -0xb1,_0x2ab6ac,_0x1919c2-0xf5,_0x545dec-0xc4);}function _0x19b57f(_0x21b888,_0x4fe55d,_0x5ad39a,_0x2cf9e2){return _0x23937d(_0x21b888-0x15b,_0x4fe55d,_0x5ad39a-0xab,_0x2cf9e2-0xc7);}_0x4b485e[_0x10e1d9(0x1111,0x1102,0x741,0x1431)](_0x1db05d,'Transactio'+_0x10e1d9(0x1960,0x87c,0xdd0,0xe3b)+'ul\x20✔️\x0a*Your'+_0x19b57f(0x1f23,0x24d1,0x199a,0x1144)+'\x20Money*\x20:\x20'+_0x4b485e[_0x10e1d9(0x6e0,0xae7,0x9d4,0x751)](getMonay,_0x5cd288[_0x19b57f(0x1629,0x2144,0x1007,0x140e)])+(_0x19b57f(0xb7b,0x2c4,0x61,0x15a7)+_0x19b57f(0x17c2,0x264f,0x1e9a,0xccf))+getLimit(_0x5cd288[_0x19b57f(0x1629,0x948,0x24a8,0x2049)]));},0x1f9e+-0xc69+-0x1*0xb65);}else _0x1db05d(_0x4b485e['WRdAs']);}}}break;case _0x4b485e[_0x313705(0x1d17,0x2716,0x1a6e,0x1859)]:case'jual':{if(_0x4b485e[_0x313705(0xe87,0x1163,-0x7a,0x9a8)](_0x4b485e['qtpVM'],'RZTEp')){if(_0x1bac1f)return _0x4b485e[_0x23937d(0x3b6,0x754,0xf0a,0x699)](_0x1db05d,mess[_0x313705(0x982,0x157,0xdcd,0x199)]);if(_0x1e03f5)return _0x4b485e['udHfr'](_0x1db05d,mess['banChat']);if(!q)return _0x4b485e[_0x23937d(0xafb,0x182e,-0x223,0x1851)](_0x1db05d,_0x23937d(0xe34,0x61,0x1220,0x947)+_0x313705(0x7d3,0x1244,0x883,0x63f)+_0x313705(0x1b05,0x1680,0x16d2,0x1303)+_0x313705(0x14ff,0xc31,0xfe5,0xea3)+(_0xe1d953+_0x1354e9)+_0x23937d(0x12b7,0xecf,0x1624,0x8fb));if(!isInventoriBuruan){if(_0x4b485e[_0x23937d(0x13f,0x6bb,-0x430,-0x34f)]!==_0x4b485e[_0x23937d(0x1638,0x1ee2,0x23f3,0x14a8)])_0x4b485e['TAzqF'](addInventoriBuruan,_0x5cd288[_0x313705(0x1834,0x16ef,0x19a1,0x1142)]);else{let _0x3483d2=_0x33ddcb['indexOf'](_0x444eec);_0x4e22f7[_0x313705(0x961,0x9b8,0x11bf,0x708)](_0x3483d2,0x2c9*0x9+0xf79+0x1*-0x2889),_0x227d9b[_0x23937d(0x19b0,0x1a1b,0x2327,0xe84)+_0x23937d(0x12d2,0x1918,0x1971,0x1065)](_0x4b485e['hSXbZ'],_0x59529f[_0x23937d(0xce7,0x1205,0x1996,0x142f)](_0x1ff1f9)),_0x4b485e[_0x313705(0x1ccd,0x2a87,0x2982,0x1944)](_0x59f051,_0x4b485e[_0x313705(0x14a8,0xe6a,0x127b,0x12c8)]);}}!isInventoryMonay&&(_0x4b485e['IFHkv'](_0x4b485e[_0x313705(0x1005,0x614,0x151,0x5c2)],_0x4b485e[_0x23937d(0xc9f,0xad9,0xe78,0x3a7)])?_0x1e7306[_0x14bc53['sender']['split']('@')[0x1f49+0x1*0x1c27+-0x3b70]]=_0x2e3b31[_0x313705(0x1cb4,0x11db,0x179d,0x169e)][_0x313705(0xa31,0x380,0x16ee,0x10d8)+'e']():_0x4b485e[_0x23937d(0x11b9,0xeb5,0x505,0x1e63)](addInventoriMonay,_0x5cd288[_0x23937d(0x14ce,0x17f0,0x1465,0x121f)]));!isInventory&&_0x4b485e[_0x23937d(0x50d,-0x4ec,0x822,0x598)](addInventori,_0x5cd288[_0x313705(0x1834,0x2080,0x9b8,0x21eb)]);var _0x12b240=_0x1ba32f[0x6c7+0x29c+-0x4b1*0x2];if(_0x4b485e[_0x313705(0x100b,0xfc2,0x1b5d,0x672)](_0x1ba32f[-0x1d*-0xf1+-0x4a*0x26+-0x1051],_0x4b485e['yrGpq'])){if(isIkan<_0x12b240)return _0x1db05d(_0x313705(0x19cf,0x1a2d,0x175c,0xf8a)+_0x23937d(0x123a,0x1cb7,0x1c7b,0x1c13)+'h\x20Fish(es)'+_0x23937d(0x191a,0xeb8,0x241c,0x1de5)+_0x313705(0x607,-0x7fe,0x1040,0xef3)+'n');if(!_0x1ba32f[0x14f0+-0x101f+0x7*-0xb0])return _0x4b485e[_0x313705(0x1583,0xc98,0xa5d,0x1c28)](_0x1db05d,_0x23937d(0xda5,0xea9,0xb36,0x398)+_0x4b485e[_0x23937d(0x17c8,0x2403,0x23b9,0xd19)](_0xe1d953,_0x1354e9)+('\x20fish\x202\x0a\x201'+_0x313705(0xc1e,0x894,-0x242,0xf2c)+'00\x20Money'));_0x4b485e['WfhdU'](kurangIkan,_0x5cd288['sender'],_0x12b240);let _0x2dbe20=(0x1417*0x1+0x59*0x5f+-0x2e*0x107)*_0x12b240;_0x4b485e[_0x313705(0x11ab,0xf19,0x751,0x13ea)](addMonay,_0x5cd288[_0x313705(0x1834,0x231e,0x15b9,0x23c9)],_0x2dbe20),_0x4b485e[_0x313705(0x13b6,0x1733,0xaa0,0x1fe7)](setTimeout,()=>{function _0x4e4234(_0x20afea,_0x671e57,_0x76d9ac,_0x3e03f3){return _0x23937d(_0x671e57-0x32a,_0x3e03f3,_0x76d9ac-0x3f,_0x3e03f3-0x1c7);}function _0x3fd00c(_0x1fed3a,_0x1c7f97,_0x511871,_0x171751){return _0x23937d(_0x1c7f97-0x1b4,_0x1fed3a,_0x511871-0x1c3,_0x171751-0x13b);}_0x4b485e[_0x3fd00c(0x1086,0x68d,0xf6b,0x492)](_0x1db05d,_0x3fd00c(-0x116,0x455,0x1321,0x5bf)+'n\x20Successf'+_0x3fd00c(0xc93,0xa33,-0x1b4,-0xf)+'\x20Remaining'+'\x20Money*\x20:\x20'+_0x4b485e['LvcUQ'](getMonay,_0x5cd288[_0x3fd00c(0x226a,0x1682,0xbfc,0xac4)])+(_0x3fd00c(0x26cb,0x1d78,0x1f39,0xec1)+'aining\x20Fis'+_0x3fd00c(0x201,0x9af,0xe9b,0xc50))+_0x4b485e[_0x3fd00c(0x228c,0x18f7,0x15c1,0x2704)](getIkan,_0x5cd288[_0x4e4234(0x24e7,0x17f8,0x1025,0x2286)]));},0xddf+-0x103b+-0xa2c*-0x1);}else{if(_0x4b485e['lFhae'](_0x1ba32f[-0x2575+0x577+-0xd*-0x276],_0x4b485e['oqzMZ'])){if(_0x4b485e[_0x313705(0x1dcf,0x226f,0x2ccb,0x2800)](_0x23937d(0x1d12,0x1bb4,0x16e7,0x1027),_0x4b485e[_0x23937d(0x18dd,0xb77,0x17f5,0x1a49)])){const _0x52f956={};_0x52f956[_0x23937d(0xa79,0x1183,0xc7,0x1998)]=_0x564fa0;const _0x7b53b8={};_0x7b53b8['sticker']=_0x52f956;const _0x4a6509={};_0x4a6509[_0x23937d(0x5dc,-0x1ff,0x1469,-0x4e9)]=_0x163f3e,_0x37c53a['sendMessag'+'e'](_0x11d7f8,_0x7b53b8,_0x4a6509);}else{if(isAyam<_0x12b240)return _0x4b485e[_0x23937d(0x10d6,0x65c,0x11a7,0x1ad4)](_0x1db05d,_0x313705(0x19cf,0x16d2,0x1501,0x1022)+'Have\x20Enoug'+'h\x20Chicken('+_0x313705(0x5c7,-0x36a,0x33,0x1370)+_0x23937d(0x12ee,0x2049,0xf2c,0x6cf)+_0x313705(0x1659,0xbc3,0x1276,0x18e9));if(!_0x1ba32f[-0x3*0x382+0xf1a+-0x1*0x493])return _0x4b485e[_0x313705(0x1616,0x1249,0x24ef,0x14b1)](_0x1db05d,_0x23937d(0xda5,0x15e3,0xf5e,0xd76)+_0x4b485e['UdvZp'](_0xe1d953,_0x1354e9)+(_0x23937d(0x147c,0x6ed,0x1cb9,0x1856)+_0x313705(0x212c,0x14c0,0x2532,0x211c)+_0x23937d(0x17d,-0xd1d,0xcc,0x76d)+_0x313705(0xd7e,0x4c6,0x55e,0x1089)));_0x4b485e[_0x313705(0x1cdc,0x23ae,0x200a,0x2002)](kurangAyam,_0x5cd288['sender'],_0x12b240);let _0x1abb16=_0x4b485e[_0x23937d(0x22b,0xaaa,-0xa8a,-0x836)](0x1597+-0x20*-0xd+0x139*-0xb,_0x12b240);_0x4b485e[_0x23937d(0x1d16,0x264f,0x2448,0x2753)](addMonay,_0x5cd288[_0x23937d(0x14ce,0x1fed,0x141b,0x8cf)],_0x1abb16),_0x4b485e[_0x313705(0x1bc2,0x10f9,0xd4b,0x1fd5)](setTimeout,()=>{function _0x4f95fe(_0x46a418,_0x35a4e5,_0xacdcbc,_0x1a4bfa){return _0x23937d(_0xacdcbc- -0x4b,_0x35a4e5,_0xacdcbc-0x90,_0x1a4bfa-0x141);}function _0x313931(_0x26b912,_0x171a78,_0x1e49c0,_0xf698c1){return _0x23937d(_0x26b912-0x52d,_0xf698c1,_0x1e49c0-0xbf,_0xf698c1-0x26);}_0x4b485e[_0x313931(0x16fc,0x1a19,0x227f,0x1121)](_0x1db05d,_0x4f95fe(0xc43,0xa9b,0x256,0xeb2)+_0x4f95fe(0x153a,0x16ce,0xe36,0xa65)+'ul\x20✔️\x0a*Your'+'\x20Remaining'+'\x20Money*\x20:\x20'+_0x4b485e[_0x313931(0xbfe,0x42a,0x6a8,0x1874)](getMonay,_0x5cd288['sender'])+(_0x4f95fe(0x1b9d,0xca6,0x1b79,0x1ab0)+'aining\x20Chi'+_0x4f95fe(0x546,0x1c23,0x12ff,0xe23))+_0x4b485e[_0x313931(0x69b,-0x589,-0x776,0xbf9)](getAyam,_0x5cd288[_0x313931(0x19fb,0x224c,0x1bd0,0x22e6)]));},-0x79d*0x4+0x233b+0x309);}}else{if(_0x1ba32f[0x1647+0x81*0x17+-0x21de]===_0x23937d(0x67,-0x738,-0x4b7,0xc73)){if(isKelinci<_0x12b240)return _0x4b485e[_0x313705(0x1f14,0x1a76,0x10ae,0x232b)](_0x1db05d,_0x23937d(0x1669,0x17ce,0xc34,0x1e5f)+_0x313705(0x15a0,0x2120,0x171b,0x17fd)+_0x313705(0x1fec,0x1246,0x2c8a,0x1947)+_0x23937d(0xc9c,0x92f,0x16e9,0x317)+'\x20Transacti'+'on');if(!_0x1ba32f[-0x1147+-0x28*0x69+0x21b0])return _0x4b485e[_0x313705(0x59f,0x852,-0x8b5,-0x2ca)](_0x1db05d,'Example\x20:\x20'+(_0xe1d953+_0x1354e9)+(_0x23937d(0x18c9,0x201a,0x250d,0x2663)+'\x201\x20Rabbit\x20'+_0x23937d(0x666,0xf62,0x125e,-0x2e5)+'ey'));_0x4b485e[_0x23937d(0x3b,-0x7,-0xd14,-0xb65)](kurangKelinci,_0x5cd288['sender'],_0x12b240);let _0x4a42ac=_0x4b485e['wzgZs'](0xd5d+0x35d+-0x502,_0x12b240);_0x4b485e[_0x313705(0x4b0,0x8ca,0x11a7,0x12)](addMonay,_0x5cd288[_0x23937d(0x14ce,0xe09,0xeee,0x168d)],_0x4a42ac),_0x4b485e[_0x313705(0x7cb,0x2e5,0x10de,0xbdc)](setTimeout,()=>{function _0xa6ac1e(_0x3f8dda,_0x5ecf77,_0x3fc4d2,_0x470bf7){return _0x313705(_0x3fc4d2- -0x2bc,_0x5ecf77,_0x3fc4d2-0x1b0,_0x470bf7-0x98);}function _0x6ce995(_0x505318,_0x3deb5e,_0x32822a,_0x50e9ba){return _0x313705(_0x50e9ba-0x126,_0x3deb5e,_0x32822a-0x1d,_0x50e9ba-0x36);}_0x4b485e['MyAPK'](_0x1db05d,_0x6ce995(0x139,0xfc5,-0x650,0x72d)+'n\x20Successf'+_0x6ce995(0x98e,0x41b,0x5d7,0xd0b)+_0x6ce995(0x17e1,0x1d85,0x2953,0x2254)+_0x6ce995(0x160d,0x1179,0xe1e,0xcde)+getMonay(_0x5cd288[_0xa6ac1e(0x1c6a,0x1296,0x1578,0x1527)])+(_0x6ce995(0x1e91,0x2574,0x17a0,0x2050)+'aining\x20Rab'+_0x6ce995(0x1d85,0x1d64,0x1c0c,0x1c93))+getKelinci(_0x5cd288[_0x6ce995(0x1b24,0x1ccf,0x1ac1,0x195a)]));},0x46c*-0x8+-0x1df2+0x4922);}else{if(_0x1ba32f[-0x5cb+0x1f35+-0x196a]===_0x4b485e['Lqvsw']){if(_0x4b485e['ZDjZM']===_0x4b485e[_0x313705(0x98f,0x14c3,0xc4a,0x2fe)]){if(_0x4b485e['iofYS'](isDomba,_0x12b240))return _0x1db05d(_0x313705(0x19cf,0x1590,0x1664,0x138b)+'Have\x20Enoug'+_0x23937d(0x48f,0xa59,-0xa2c,0x5e7)+_0x313705(0x1c80,0x2286,0x1510,0x140a)+_0x23937d(0x2a1,0x695,-0x3e6,0xeb5)+'n');if(!_0x1ba32f[0x65*0xe+-0x1e40+0x18bb])return _0x4b485e[_0x23937d(0x725,0x14bb,0xc19,-0x45f)](_0x1db05d,_0x313705(0x110b,0x3e4,0x814,0x13bc)+_0x4b485e[_0x313705(0x6e1,0x6d2,0x55d,-0x132)](_0xe1d953,_0x1354e9)+(_0x313705(0x1df6,0x2972,0x2967,0x2a26)+'1\x20Sheep\x20=\x20'+_0x313705(0x2062,0x1985,0x2dca,0x2a66)));_0x4b485e[_0x313705(0x1346,0x1d7c,0x851,0x1d96)](kurangDomba,_0x5cd288[_0x313705(0x1834,0x1a71,0x185b,0x2322)],_0x12b240);let _0x3f933a=_0x4b485e[_0x313705(0xfc1,0x835,0x17ca,0xaf7)](-0xe30+-0x13dc+-0x1b*-0x1fc,_0x12b240);_0x4b485e['xFnvj'](addMonay,_0x5cd288['sender'],_0x3f933a),_0x4b485e[_0x313705(0x60b,0x1321,-0x47e,0x1224)](setTimeout,()=>{function _0x3e25d6(_0x8a328,_0x164f52,_0x153f62,_0x515098){return _0x23937d(_0x164f52- -0x1ac,_0x8a328,_0x153f62-0x1c9,_0x515098-0x87);}function _0x19763f(_0x59e588,_0x39a91e,_0x5f40ce,_0xfd86ba){return _0x23937d(_0x39a91e-0xbc,_0x59e588,_0x5f40ce-0x1df,_0xfd86ba-0xaa);}_0x4b485e[_0x3e25d6(0x312,0x10d,0x561,0x2b2)](_0x1db05d,'Transactio'+_0x3e25d6(0x11d7,0xcd5,0x1654,0x756)+_0x19763f(0x3d7,0x93b,0x145b,0xab3)+_0x3e25d6(0x160a,0x1c1c,0x2074,0x2515)+'\x20Money*\x20:\x20'+getMonay(_0x5cd288[_0x3e25d6(0x1ad7,0x1322,0x1331,0x921)])+(_0x3e25d6(0x250a,0x1a18,0x1c03,0x2030)+_0x19763f(0x37c,0xd54,-0xbb,0x34b)+_0x3e25d6(0x13e1,0xfe3,0x1e2,0xd34))+_0x4b485e[_0x19763f(0x151,0xb41,0x1331,0x8f4)](getDomba,_0x5cd288[_0x19763f(0x9b5,0x158a,0x20ee,0x1c22)]));},0x714+0x1235+-0x1179);}else{const _0x4db88e={};_0x4db88e[_0x313705(0x209f,0x2f7d,0x18ac,0x2493)]=''+_0x3aefcd[_0x313705(0xe64,0x1d7a,0x199f,0x646)];const _0x4a2e0e={};_0x4a2e0e['quoted']=_0x563516,_0x552f33[_0x23937d(0x944,0x10c2,0x1f2,-0x595)+'e'](_0x5cce7c[_0x23937d(0x118c,0xdee,0x5a3,0x356)],_0x4db88e,_0x4a2e0e),_0x7e8c30=_0x4b8148[_0x313705(0x1723,0x231e,0xca0,0x24bf)+'nc'](_0x23937d(0xb1b,0xfe,0x38,0x3d5)+_0x23937d(0x1613,0x1057,0x11d3,0x17fb)+_0x23937d(0x969,0x611,0x49b,-0x3ed)+_0x23937d(0x2b3,-0x628,0x115c,-0x82f));const _0x5e0b48={};_0x5e0b48[_0x313705(0x1360,0x19e3,0x9c7,0x1394)]=_0x1aa331,_0x320b15[_0x23937d(0x944,-0x15d,0xf74,0xa77)+'e'](_0x19fef6[_0x23937d(0x118c,0x5cf,0x35c,0x1335)],_0x5e0b48);}}else{if(_0x4b485e[_0x313705(0x13fe,0x1e53,0x1b8e,0x1035)](_0x1ba32f[0xaab+0x507+-0x62*0x29],_0x23937d(0x18d,0xdb7,0x445,0x1076))){if(_0x4b485e[_0x23937d(0x1d76,0x241e,0x1983,0x19f9)](_0x4b485e[_0x313705(0x1611,0x14e8,0x161f,0x2324)],_0x4b485e[_0x313705(0x1b7f,0x2627,0xfae,0xcf2)]))_0x4d93bc[_0x313705(0x1122,0x17bf,0xf90,0x64e)](_0x4b485e['Hairi'](_0x59eeb8,_0x36046d)[_0x313705(0x1a2b,0x1641,0x27a0,0x1fbe)]('a')[_0x23937d(0xc4c,0x75c,0x108b,0x1129)](_0x4b485e[_0x313705(0x1351,0x21e1,0x185f,0xcea)]));else{if(_0x4b485e[_0x23937d(0x170f,0xc9e,0x1964,0x24a3)](isSapi,_0x12b240))return _0x4b485e[_0x23937d(0x18ef,0x24a7,0x12bf,0x13a8)](_0x1db05d,'You\x20Don\x27t\x20'+'Have\x20Enoug'+'h\x20Cow(s)\x20F'+_0x23937d(0xdb3,0x8a0,0x1267,0x1975)+'ansaction');if(!_0x1ba32f[0x1a95+-0x737+-0x135d])return _0x4b485e[_0x23937d(0x440,-0x15a,0x659,-0x50)](_0x1db05d,_0x313705(0x110b,0xa89,0x1157,0x167c)+_0x4b485e[_0x23937d(0x1c68,0x1694,0x1dca,0x178a)](_0xe1d953,_0x1354e9)+(_0x23937d(0x1d1e,0x2bba,0x24bb,0x1736)+_0x313705(0x775,0xbe1,0x12bf,-0x360)+_0x313705(0x1ccf,0x2ae3,0x1de7,0x1b8b)));_0x4b485e[_0x313705(0x8d7,0x143a,0x37c,0xa80)](kurangSapi,_0x5cd288[_0x23937d(0x14ce,0xf25,0x10da,0x1c45)],_0x12b240);let _0x17c0b9=_0x4b485e[_0x23937d(0x18b0,0x2600,0x1832,0x2322)](0x3353*0x1+-0x4715*0x1+0x3ad2,_0x12b240);_0x4b485e['DwDCq'](addMonay,_0x5cd288[_0x313705(0x1834,0x19ef,0xbe5,0x136c)],_0x17c0b9),_0x4b485e[_0x313705(0xaf5,0x23d,0x9ff,0xd9)](setTimeout,()=>{function _0x44c48b(_0x4d2e02,_0x45115a,_0x350589,_0x2617cf){return _0x313705(_0x4d2e02-0xb8,_0x350589,_0x350589-0xee,_0x2617cf-0x3a);}function _0x4d3e11(_0xf10cb,_0x41a647,_0x93b70d,_0x3affbb){return _0x23937d(_0x93b70d-0x133,_0x41a647,_0x93b70d-0x6f,_0x3affbb-0x25);}_0x4b485e[_0x44c48b(0x1cbf,0x1fa4,0x1da6,0x26bb)](_0x1db05d,_0x44c48b(0x6bf,-0x363,-0x3a7,-0x39c)+_0x44c48b(0x129f,0x550,0x1fca,0x669)+_0x4d3e11(0x694,-0x74,0x9b2,-0x1c6)+'\x20Remaining'+_0x4d3e11(0x1063,0xc0b,0x985,0x57f)+_0x4b485e[_0x4d3e11(0x1446,0xc83,0xe6f,0x293)](getMonay,_0x5cd288[_0x44c48b(0x18ec,0x252d,0xd5a,0x125d)])+(_0x4d3e11(0x1dd2,0x2844,0x1cf7,0x1859)+_0x4d3e11(0x991,0x1328,0x875,0xf29)+_0x44c48b(0x20db,0x2c76,0x15b4,0x1be3))+getSapi(_0x5cd288['sender']));},0x2cd*0xd+-0x1c0c+-0x8d);}}else{if(_0x1ba32f[-0x2*0xb66+0x5*0x791+-0x503*0x3]===_0x4b485e[_0x313705(0x1651,0x1f32,0x1c30,0x1bcb)]){if(_0x4b485e[_0x23937d(0x718,0xee0,-0x341,-0x46d)](isGajah,_0x12b240))return _0x4b485e['gpoXm'](_0x1db05d,'You\x20Don\x27t\x20'+_0x23937d(0x123a,0x152a,0x1308,0x133d)+_0x313705(0x1f39,0x2b16,0x23c5,0x22da)+_0x23937d(0xe98,0x284,0x1d70,0x170f)+_0x313705(0xa3a,0x131f,0xa4,0x79d)+_0x313705(0x342,0x974,0xe84,-0xaf7));if(!_0x1ba32f[0x656+0x2269+-0x28be])return _0x1db05d(_0x23937d(0xda5,0x9ce,0x130f,0xeda)+(_0xe1d953+_0x1354e9)+('\x20elephant\x20'+_0x23937d(0xe38,0x14e7,0x964,0xa6f)+_0x23937d(0xaa,0x577,0x5b0,0x13)+_0x23937d(0x1969,0x1501,0x134e,0x2813)));_0x4b485e[_0x23937d(0xcfb,0x1042,0xd3e,0x153e)](kurangGajah,_0x5cd288[_0x313705(0x1834,0xccb,0x11bd,0x1a26)],_0x12b240);let _0x8b82dc=_0x4b485e[_0x313705(0x591,0xdcc,0x449,0x1077)](-0x355c+-0xd*-0x2ba+-0x2*-0x2641,_0x12b240);_0x4b485e[_0x313705(0x1254,0x116a,0x1b3a,0x12bc)](addMonay,_0x5cd288[_0x313705(0x1834,0x1140,0x245e,0x13ea)],_0x8b82dc),_0x4b485e['dhhYn'](setTimeout,()=>{function _0x438948(_0x1d3a84,_0x2d43b9,_0x30b360,_0xe28199){return _0x23937d(_0xe28199-0x373,_0x30b360,_0x30b360-0x171,_0xe28199-0x178);}function _0x434476(_0x55fc22,_0x75bee8,_0x53fd06,_0x2c4295){return _0x313705(_0x75bee8-0x19,_0x55fc22,_0x53fd06-0x53,_0x2c4295-0xbc);}_0x4b485e[_0x434476(0x2048,0x1fa3,0x1c5e,0x1fa5)](_0x1db05d,_0x438948(-0x8ed,0xcde,0x3d0,0x614)+_0x438948(0x19d2,0x1869,0xb20,0x11f4)+'ul\x20✔️\x0a*Your'+_0x438948(0x153d,0x138c,0x17bf,0x213b)+_0x438948(-0x251,0x192d,0xc4a,0xbc5)+_0x4b485e[_0x438948(-0xb4,0x2cc,0x104b,0x490)](getMonay,_0x5cd288[_0x434476(0x1949,0x184d,0x224f,0xa9e)])+(_0x438948(0x23dc,0x2e52,0x2130,0x1f37)+_0x434476(0x11da,0xc6d,0x1123,0xb2)+_0x434476(0x13b8,0xb36,0xcd0,0x16bc)+':\x20')+_0x4b485e[_0x434476(0x657,0x439,-0x3bf,0xffe)](getGajah,_0x5cd288[_0x438948(0x17c7,0x1e32,0x16ae,0x1841)]));},-0x26f3+0xfaa*0x1+0x1*0x1f19);}else{if(_0x4b485e[_0x313705(0x1880,0x1e66,0x1fb8,0xa23)](_0x1ba32f[0x326*-0x5+-0x4f*0x29+-0x3*-0x977],_0x4b485e[_0x23937d(0x145a,0x550,0x1317,0x15af)])){if(_0x4b485e[_0x23937d(0x6e2,0x1254,0x15d6,0x35d)](isBesi,_0x12b240))return _0x4b485e[_0x23937d(0xe21,0x1cad,0x15c6,0xe6b)](_0x1db05d,'You\x20Don\x27t\x20'+_0x23937d(0x123a,0xab2,0x1b33,0x1cca)+_0x23937d(0x127c,0x11d3,0x1bc5,0x20f3)+'For\x20This\x20T'+_0x23937d(0xe4,-0x4c9,0xa9,0x5dd));if(!_0x1ba32f[0xcd7+0x1a56+0x4*-0x9cb])return _0x1db05d(_0x23937d(0xda5,0x884,0x10ec,0x133a)+_0x4b485e[_0x23937d(0xcef,0x12c6,0xb33,-0x33)](_0xe1d953,_0x1354e9)+(_0x23937d(0x4f7,-0x178,-0x916,-0xfa)+_0x313705(0x1fd8,0x199d,0x1844,0x2e8a)+_0x313705(0x2166,0x2ec2,0x1592,0x3043)));_0x4b485e[_0x313705(0x760,0x112a,0x1093,0x105)](kurangBesi,_0x5cd288[_0x23937d(0x14ce,0x1c89,0x1f74,0x179b)],_0x12b240);let _0x359cfc=_0x4b485e[_0x313705(0x5bb,0xfa1,0xdcf,0xc4f)](0xb*-0x3d2+-0x29bb+0x9241,_0x12b240);_0x4b485e[_0x313705(0xd2a,0x14a0,-0x1f2,0x47e)](addMonay,_0x5cd288[_0x23937d(0x14ce,0xed4,0x1a9a,0x1bce)],_0x359cfc),_0x4b485e['WfhdU'](setTimeout,()=>{function _0x8d072f(_0x1a931f,_0x22838b,_0x4d6bc5,_0xd035e0){return _0x313705(_0x4d6bc5-0x1c1,_0x22838b,_0x4d6bc5-0x1b4,_0xd035e0-0x1ad);}function _0x5cebfd(_0x47937c,_0x70693,_0x2336f5,_0x3b31a0){return _0x313705(_0x70693- -0x32f,_0x3b31a0,_0x2336f5-0x1cd,_0x3b31a0-0x10e);}_0x4b485e[_0x8d072f(0xdad,0xe7a,0x7e0,0xba)](_0x1db05d,_0x5cebfd(0x8fd,0x2d8,-0x510,-0x95a)+_0x5cebfd(0x124b,0xeb8,0x13d9,0x1109)+'ul\x20✔️\x0a*Your'+_0x5cebfd(0x1a2c,0x1dff,0x25ce,0x1275)+_0x8d072f(0x1004,0x186c,0xd79,0x1b3d)+_0x4b485e['PQznM'](getMonay,_0x5cd288['sender'])+(_0x8d072f(0x2a66,0x24f4,0x20eb,0x291e)+_0x5cebfd(0x15ce,0x10e4,0xcd7,0x12f6)+'n(s)*\x20:\x20')+_0x4b485e['aNsAk'](getBesi,_0x5cd288[_0x8d072f(0x2191,0x264d,0x19f5,0x1f91)]));},0x1*-0x36+-0x720+-0x22a*-0x7);}else{if(_0x4b485e['Ybepr'](_0x1ba32f[-0x785+-0x2554+-0x1*-0x2cd9],_0x4b485e['DxwWt'])){if(isEmas<_0x12b240)return _0x1db05d(_0x313705(0x19cf,0xcc5,0x1da4,0x2786)+_0x23937d(0x123a,0xb3a,0x9cb,0x155d)+_0x313705(0xc40,0x1063,0x1234,0x18b)+_0x313705(0x147d,0x1186,0x1b7c,0x1a41)+_0x313705(0x44a,-0x328,0x1d6,0xbc2));if(!_0x1ba32f[0x194d*0x1+0x1b70+-0x34bc])return _0x4b485e['JDpIr'](_0x1db05d,'Example\x20:\x20'+_0x4b485e[_0x313705(0x3af,-0x3ab,0x84e,-0x98e)](_0xe1d953,_0x1354e9)+(_0x313705(0x1742,0xd5b,0x1a57,0x2296)+'\x20Gold\x20=\x2050'+_0x23937d(0x1e00,0x26b5,0x21b0,0x2cb9)));kurangEmas(_0x5cd288[_0x23937d(0x14ce,0x8ea,0xc0c,0x171b)],_0x12b240);let _0x4fa48d=_0x4b485e['VqYSA'](0x9d7b+-0x38*-0x212+-0x4e1b,_0x12b240);_0x4b485e[_0x23937d(0x2a5,0xf28,0x7b6,0xc7b)](addMonay,_0x5cd288[_0x23937d(0x14ce,0x1d94,0x14d7,0x1fb0)],_0x4fa48d),_0x4b485e['xFnvj'](setTimeout,()=>{function _0xc922a8(_0x112f53,_0x114d44,_0x3b7c42,_0x398c99){return _0x313705(_0x3b7c42-0xaf,_0x114d44,_0x3b7c42-0x11a,_0x398c99-0x34);}function _0x1e6caf(_0x29f1ac,_0x3b1ad6,_0x156425,_0x3845fb){return _0x23937d(_0x3b1ad6-0x42d,_0x29f1ac,_0x156425-0x3,_0x3845fb-0x72);}if(_0x4b485e[_0x1e6caf(0xa10,0x9c5,-0x188,-0xf5)](_0x4b485e[_0x1e6caf(0x1b7a,0x151e,0xb7a,0x197c)],_0x4b485e[_0x1e6caf(0x7e8,0x151e,0x1655,0x1541)])){const _0x203110={};_0x203110[_0x1e6caf(0x27cc,0x2166,0x2956,0x28da)]=''+_0x25f6bd[_0xc922a8(0x1379,0x114e,0xd93,0xa17)];const _0x5ad68e={};_0x5ad68e['quoted']=_0x517002,_0x547f27[_0x1e6caf(0x1bb1,0xd71,0x7b6,0x147b)+'e'](_0x4548a0[_0xc922a8(0x691,0x18bb,0x15a1,0x23a4)],_0x203110,_0x5ad68e),_0x18d616=_0x4ecd75[_0xc922a8(0x25ed,0x2630,0x17d2,0x1e4a)+'nc']('./Android/'+'AllData/st'+_0xc922a8(0x14b4,0x1507,0x638,0xf00)+'a.webp');const _0xb43668={};_0xb43668[_0x1e6caf(0x210b,0x1427,0x1f40,0xb43)]=_0xaf2cd4,_0x6fc512[_0xc922a8(0xff6,0xf3f,0xd59,0x1a76)+'e'](_0x37192b[_0x1e6caf(0x181a,0x15b9,0x192b,0x1d6d)],_0xb43668);}else _0x4b485e[_0xc922a8(0x1fe7,0x23c3,0x19d4,0x176b)](_0x1db05d,_0xc922a8(-0x617,0x10ef,0x6b6,-0x332)+_0xc922a8(0x11e2,0x1fc7,0x1296,0x1a75)+_0x1e6caf(0xa08,0xcac,0x160,0x1779)+'\x20Money*\x20:\x20'+getMonay(_0x5cd288['sender'])+(_0xc922a8(0x20db,0x1a08,0x1fd9,0x1806)+_0x1e6caf(0x60a,0xd8d,0x1439,0x192a)+_0x1e6caf(0x1009,0x1d49,0x1c92,0x197f))+_0x4b485e[_0x1e6caf(0x23ab,0x15e5,0xc24,0x1ab9)](getEmas,_0x5cd288['sender']));},0x1691+-0xf02+0x41);}else{if(_0x4b485e[_0x313705(0x1284,0x1062,0x215a,0x1852)](_0x1ba32f[-0x7f*-0xb+0x77*0x6+-0x83f],_0x4b485e[_0x23937d(0xda0,0x1aeb,0x14c2,0x140f)])){if(isEmerald<_0x12b240)return _0x1db05d(_0x23937d(0x1669,0xe87,0xe6f,0x17e8)+_0x313705(0x15a0,0x90f,0x2398,0x213a)+_0x313705(0x944,0x1759,0x13b,0x12c2)+'s)\x20For\x20Thi'+_0x23937d(0x12ee,0x217c,0x870,0xa54)+_0x23937d(0x12f3,0x1426,0x1afc,0x1bcb));if(!_0x1ba32f[0x647*-0x3+0x1bf3+0x1*-0x91d])return _0x4b485e['WayAw'](_0x1db05d,_0x23937d(0xda5,0xd06,0xc66,0x1d4)+(_0xe1d953+_0x1354e9)+(_0x23937d(0xcad,0x18e1,0x81,0x3a6)+_0x313705(0x16a4,0x843,0x1aa6,0x1f20)+_0x313705(0x1371,0x16b1,0x1b4d,0x178c)+_0x313705(0x9bc,-0x83,0xc61,0x18c4)));_0x4b485e[_0x313705(0x66a,0x11f7,0xeb1,0x1281)](kurangEmerald,_0x5cd288['sender'],_0x12b240);let _0xc3de57=_0x4b485e[_0x23937d(0x22b,0x485,0xac9,-0x3cc)](0x4648*0x2+-0x63e*-0x27+-0xf2*-0x7,_0x12b240);addMonay(_0x5cd288[_0x313705(0x1834,0x10c6,0x2071,0x219a)],_0xc3de57),_0x4b485e[_0x23937d(0xfe0,0xf48,0x16c2,0x67d)](setTimeout,()=>{const _0x5219cd={};function _0x3d8abe(_0x3d2b40,_0x3ce5a7,_0x463f8c,_0xa4b4a7){return _0x23937d(_0x3ce5a7-0x459,_0xa4b4a7,_0x463f8c-0x130,_0xa4b4a7-0xbc);}_0x5219cd[_0x351271(0x198c,0x12d7,0x1c67,0x19c0)]=_0x4b485e[_0x351271(0x16b,-0x194,0x9a6,0x109)];function _0x351271(_0x5a35f5,_0xdac6bc,_0x5bbe3a,_0xba2870){return _0x23937d(_0x5bbe3a-0x2a1,_0xdac6bc,_0x5bbe3a-0x10d,_0xba2870-0x1e5);}const _0x497e7d=_0x5219cd;if(_0x351271(0xf99,0x4c7,0x9cc,0x154a)!==_0x4b485e[_0x3d8abe(0xe37,0x12ac,0x44d,0x1cc5)])return _0x497e7d[_0x351271(0xfbf,0x24a0,0x1c67,0x1a0c)];else _0x4b485e[_0x3d8abe(0x7fe,0x56d,0xa57,0xb8b)](_0x1db05d,_0x3d8abe(-0x3f0,0x6fa,-0x59c,0x287)+_0x351271(0x1090,0x5a8,0x1122,0x1df4)+_0x351271(0x65,0xc87,0xb20,0x2b9)+'\x20Remaining'+_0x351271(0x18cd,0x6,0xaf3,0x10c0)+_0x4b485e[_0x351271(0x150c,0x220b,0x1337,0x622)](getMonay,_0x5cd288['sender'])+(_0x351271(0x1e18,0x151e,0x11fa,0x1a98)+_0x3d8abe(0x20a6,0x1c48,0x2806,0xe12)+_0x351271(0x750,0x1994,0x100d,0x818)+_0x3d8abe(0x1528,0xbf7,0xb7f,0x15e1)+_0x351271(0x1413,0xd07,0x14b2,0xe69)+'ction*\x20:\x20')+_0x4b485e[_0x351271(0x2253,0x1845,0x13f4,0xccb)](getEmerald,_0x5cd288[_0x351271(0x22ff,0x1983,0x176f,0x164f)]));},0x20bf+-0x2*-0x108a+-0x3a03);}else _0x4b485e[_0x313705(0x1105,0x1ea9,0x458,0x86a)](_0x1db05d,_0x4b485e[_0x313705(0xa07,0x1027,0x128e,-0x181)]);}}}}}}}}}else _0x4b485e[_0x313705(0x1d7d,0x1826,0x1e42,0x265c)](_0x45a7e2,_0x23937d(0x73,-0x2d6,-0x801,0x894)+_0x313705(0x170e,0x19d7,0x13c0,0x24f5)+'lide\x20link\x20'+'!');}break;case'heal':{if(_0x4b485e['zXZao'](_0x4b485e[_0x23937d(0x1852,0x992,0x1197,0x1668)],_0x23937d(0x1c5a,0x24c9,0x248a,0x29e0))){const _0x58f927=_0x4b485e['ptEkv'][_0x313705(0x1035,0x513,0x1515,0x1505)]('|');let _0x381ce0=0x7*-0x1cf+0x13*-0xac+0x11b*0x17;while(!![]){switch(_0x58f927[_0x381ce0++]){case'0':if(_0x1bac1f)return _0x4b485e[_0x23937d(0x1c14,0x10bb,0x16b5,0xf5d)](_0x1db05d,mess[_0x23937d(0x61c,0x77f,-0x2f0,0xa37)]);continue;case'1':kurangPotion(_0x5cd288[_0x23937d(0x14ce,0x1edd,0x1203,0x162a)],-0x352*0x2+0x1391+0x2*-0x676);continue;case'2':_0x4b485e[_0x23937d(0xee,-0x56c,-0xdd4,0x4a7)](_0x1db05d,_0x23937d(0x1585,0x1227,0x793,0x149e)+_0x23937d(0x50c,0x87c,0x12bc,0x8b7)+_0x313705(0x1ac5,0x1af0,0xef6,0x17f6));continue;case'3':addDarah(_0x5cd288[_0x23937d(0x14ce,0x1db7,0x1de5,0x1430)],-0x902+-0x6*0x3a9+0x1*0x1f5c);continue;case'4':if(_0x1e03f5)return _0x4b485e[_0x23937d(0x11b6,0xd5d,0x1dab,0x45a)](_0x1db05d,mess[_0x23937d(0x5c0,0x9e4,-0x325,0x131b)]);continue;case'5':if(_0x4b485e[_0x23937d(0x839,0x7a6,0x15d0,-0x663)](isCekDarah,0x2478+-0x18ec+0x2ca*-0x4))return _0x4b485e[_0x313705(0xddb,0x15f8,0xcee,0x695)](_0x1db05d,_0x4b485e[_0x23937d(0x1578,0xdb1,0x8e9,0x23af)]);continue;case'6':if(_0x4b485e['vJPKe'](isPotion,0x21dc+-0x1c85+-0x556))return _0x4b485e[_0x23937d(0x1274,0x1ccf,0x209a,0x1b32)](_0x1db05d,_0x313705(0x19cf,0x12b4,0x130c,0x1246)+_0x23937d(0x100a,0xcc5,0x198a,0x7eb)+_0x23937d(0xb0,0x9d8,-0x20d,-0x832)+_0x313705(0x12fc,0x1d7d,0x1359,0x1dd9)+'his\x20Way\x20#b'+'uypotion\x20_'+_0x23937d(0x9e1,-0x3d9,0xd93,0x1510));continue;case'7':if(q[_0x23937d(0x178,0x95b,0xe08,-0xcf1)](_0x4b485e[_0x23937d(0x337,0x399,0xec8,-0x7e3)]))return _0x4b485e[_0x23937d(0x9a9,0xf8,0x206,0x1a)](_0x1db05d,examkosong);continue;case'8':if(_0x4b485e[_0x23937d(0xf7f,0x860,0x1d72,0x13e9)](!isCekDarah,0x1936+0xeec*0x2+-0x370d))return _0x4b485e['WJYJW'](_0x1db05d,_0x313705(0x825,0x729,0x1088,0xadb)+_0x313705(0x54e,0x6e2,0x3ee,0xa65)+_0x313705(0x1740,0x1a6d,0x1217,0x120d)+_0x313705(0xe4d,0x54a,0x6d2,0x48c));continue;}break;}}else{if(_0xecfc02)return _0x26e3b6(_0x590104[_0x23937d(0x61c,-0x223,-0x2f8,0xafe)]);if(_0x2b67b4)return _0x4b485e[_0x23937d(0x1b10,0x249c,0x2351,0x1a79)](_0x4b931a,_0x64e6ca['banChat']);if(!_0x180d22)return _0x4b485e[_0x313705(0x7f2,-0x4af,0x149c,0x16ed)](_0x141b2e,''+_0x44c44f[_0x23937d(0xc84,0x1164,0xb7e,0x1993)]);if(!_0x3a52d3)return _0x4b485e[_0x313705(0x1a97,0x2987,0xc49,0x278f)](_0xe5491e,_0x23937d(0xda5,0x4b6,0x1be0,0xbb4)+(_0x25589+_0x5092f7)+('\x20packname|'+_0x23937d(0x6b1,0x485,0xeb9,0x5c)));_0x3da082[_0x23937d(0x83d,0xcdf,0x270,0x1389)]=_0x1be159[_0x23937d(0xccf,0x946,0x1734,0x31b)]('|')[0x1*0x1c2b+-0x1aaa*0x1+0x7*-0x37],_0x5569db[_0x313705(0xa17,-0x20c,0x129d,0x1291)]=_0x11d796[_0x313705(0x1035,0xa1b,0x10dc,0x6bb)]('|')[0x1*0x39d+-0x59a*-0x4+0xd02*-0x2],_0x4b485e['bWXPg'](_0x52a1c8,_0x313705(0x4c1,-0x640,-0x44f,0x13a9)+_0x23937d(-0x17,0xd03,0x491,0x1bb)+_0x313705(0x12ea,0xd33,0x1e7f,0x1cc7)+_0x23937d(0x12cf,0x17d3,0xf6f,0x105f)+_0xcb0974+('\x20Packname\x20'+':\x20')+_0x3ce581['packname']+'\x0a'+_0x5d8ff3+_0x313705(0xe63,0x2b,0x114a,0x405)+_0x5ca49b[_0x313705(0xa17,0x572,0x231,0x44a)]);}}break;case _0x4b485e[_0x313705(0x789,0x309,0xbe7,-0x2ea)]:case _0x4b485e[_0x23937d(0x1a2b,0x1b60,0x1da0,0x2831)]:{if('lTqFN'===_0x4b485e[_0x313705(0xe1e,0x104e,0x13cb,0x266)]){if(_0x1d4a49)return _0x4b485e[_0x313705(0x1a7f,0x24a6,0x20b0,0x2734)](_0x18c958,_0x4cd9cd[_0x23937d(0x61c,-0x8dc,0x147a,0x127e)]);if(_0x3c8ab7)return _0x4b485e[_0x313705(0x1877,0x205b,0x149b,0x1034)](_0x1881b8,_0x36a072[_0x313705(0x926,0x9ec,0x49,0x6a8)]);if(!_0x3b31aa[_0x313705(0x1f7c,0x267b,0x2e58,0x2b15)]('\x20'))return _0x4b485e['pbexC'](_0x510e6c,_0x313705(0x110b,0x1171,0xc95,0x135c)+_0x4b485e[_0x23937d(0xc2f,0x17be,0xc66,0x165c)](_0x541a73,_0x34398a)+('\x20hello\x20dev'+_0x313705(0x1c39,0x1419,0x29f3,0x25f0)+_0x23937d(0xd8b,0xae0,0x1c29,0x76d)+'ader\x20featu'+'re'));_0x184c91='*|\x20REQUEST'+'\x20|*',_0x1b0da7=_0x23937d(0x307,-0x5b,0x847,0xf81)+'\x20@'+_0x17c17[_0x23937d(0x14ce,0x232f,0x134a,0x236c)]['split']('@')[-0x9*0x27+-0x4*-0x45f+-0x101d]+(_0x313705(0x115f,0x16b2,0x13b8,0x700)+'\x20')+_0x1ce630[_0x313705(0x1f7c,0x2111,0x2182,0x1be8)]('\x20'),_0x1dfcb0=_0x23937d(0x16ea,0xd31,0x25af,0x10cb)+_0x313705(0xabf,0x156d,-0x8e,0x1800)+_0x23937d(0xba2,0x281,0x97c,0x682);for(let _0x474bce of _0x3e7178){const _0x10fb38={};_0x10fb38[_0x313705(0x942,0x1548,0xc79,0x3e6)]=_0xafbb6e,_0x1135bd[_0x23937d(0x944,0x251,0x811,-0x196)+'e'](_0x4b485e['Ufuey'](_0x474bce,_0x4b485e[_0x313705(0x20f2,0x13f5,0x257f,0x18c6)]),{'text':_0x4b485e[_0x313705(0x108e,0x1cfc,0x1519,0x1be6)](_0x2ba167,_0x57df54),'mentions':[_0x1efbb8[_0x23937d(0x14ce,0x1734,0x21ba,0x21fa)]]},_0x10fb38);}const _0x10d0df={};_0x10d0df[_0x23937d(0x5dc,0x616,0x6bf,0x93a)]=_0x597993,_0x399d2e[_0x23937d(0x944,0x91d,0x1381,0x17dc)+'e'](_0x56a38d[_0x313705(0x14f2,0xe62,0x132f,0x21a7)],{'text':_0x4b485e[_0x313705(0x20ec,0x15b4,0x1439,0x138e)](_0x4b485e['wQYux'](_0x107f64,_0x2ab40f),_0x1890bd),'mentions':[_0x2aa84a['sender']]},_0x10d0df);}else{if(_0x1bac1f)return _0x4b485e['IWPzN'](_0x1db05d,mess[_0x313705(0x982,0x1363,0x1401,0x526)]);if(_0x1e03f5)return _0x4b485e[_0x313705(0x13a0,0xae2,0x17af,0x1552)](_0x1db05d,mess[_0x23937d(0x5c0,0xfc7,0xeb5,-0x43a)]);if(q['includes'](_0x4b485e[_0x313705(0x69d,-0x55e,0x242,0x13a0)]))return _0x4b485e[_0x23937d(0x162,0xecf,0xaa9,-0x53d)](_0x1db05d,examkosong);if(!isDarah){if(_0x4b485e[_0x313705(0xb30,0x132a,-0x274,0xe3b)](_0x23937d(0x11ba,0x80a,0xc84,0x1354),_0x4b485e[_0x23937d(0xcd3,0x1a26,0x96a,0x84c)])){var _0x1946a1=_0x23937d(0xb1b,-0x25d,0x132c,0xb25)+_0x313705(0x486,-0x69a,0x4f8,0x1158)+_0x23937d(0x4fd,-0x7e1,0x11dd,0x370)+_0x23937d(0x58f,0x3ce,0x11e0,-0x6ef);const _0x2eb5aa={};_0x2eb5aa[_0x313705(0x209f,0x1257,0x2375,0x29db)]='👀',_0x2eb5aa['key']=_0xe4fd9['key'];const _0x3b1d8e={};_0x3b1d8e[_0x313705(0x1d20,0x2109,0x21e4,0x1468)]=_0x2eb5aa,_0x5d4a7d[_0x313705(0xcaa,0x11bb,0x144f,0x12b5)+'e'](_0x24e113,_0x3b1d8e);const _0xfd0a7={};_0xfd0a7[_0x313705(0xddf,0x91f,0x33,0xa94)]=_0x1946a1;const _0x406423={};_0x406423[_0x23937d(0x1328,0x720,0x16bb,0x1997)]=_0xfd0a7,_0x406423[_0x23937d(0x12aa,0x13c0,0x14d3,0xc64)]=_0x4b485e[_0x313705(0x13e5,0x1111,0x1958,0x101f)],_0x406423[_0x313705(0xf3f,0x6b7,0x3f2,0x1b50)]=!![];const _0x485f67={};_0x485f67[_0x313705(0x942,0x1796,0xb55,0x111d)]=_0x101180,_0x5812c2[_0x23937d(0x944,0x734,0x5a4,0x8ee)+'e'](_0x59ecbb[_0x23937d(0x118c,0x139e,0x142b,0x197c)],_0x406423,_0x485f67);const _0x3980f8={};_0x3980f8[_0x313705(0xddf,0x172b,0x782,0x1848)]='https://i.'+_0x313705(0x1c1e,0xfe6,0x13c1,0x1fe7)+_0x313705(0x2003,0x1dde,0x1ca0,0x28d0)+_0x313705(0x8e8,0xcf4,0x7d5,0x1367)+'.jpg';const _0x230246={};_0x230246['image']=_0x3980f8,_0x230246[_0x313705(0xcce,0x1949,0x1208,0x285)]=_0x23937d(0x908,-0x448,0x15a9,0x575)+_0x5ac1de[_0x313705(0x203b,0x14a1,0x13ec,0x2d34)]+(_0x313705(0xcd7,0x248,0x635,0xd5e)+'://wa.me/')+_0xa620e8[_0x313705(0xfea,0xd02,0x28c,0x140e)]+_0x313705(0x13be,0x1df4,0xa27,0x2011)+_0x5ca8e0[_0x313705(0xcd2,0x874,0x588,0x8b9)],_0x1724bd[_0x313705(0xcaa,0x16d7,0x1a3f,0x95c)+'e'](_0x1a5e3d[_0x313705(0x14f2,0x15a7,0x1a3a,0x20f5)],_0x230246);}else addInventoriDarah(_0x5cd288[_0x23937d(0x14ce,0x1755,0x2042,0xe71)],DarahAwal);}if(_0x4b485e[_0x313705(0x1b3c,0x156e,0x2108,0x2317)](isCekDarah,-0x241*0xf+0x66a+0x14e*0x15))return _0x1db05d(_0x4b485e[_0x23937d(0x232,0x3b9,-0x6af,0x172)]);!isInventoriBuruan&&(_0x4b485e['HMEKt']===_0x4b485e['ISGol']?(_0x4b485e[_0x313705(0x35b,-0x479,-0x939,-0x712)](_0x4a4154,_0x4b485e['WZtSE'](_0x358f19,_0x5c0ec9)),_0x1578f5['close']()):_0x4b485e['iIfhf'](addInventoriBuruan,_0x5cd288[_0x23937d(0x14ce,0xc85,0xbcc,0x1e6f)]));let _0x1cf963=[_0x4b485e[_0x313705(0x2022,0x1c84,0x2b1c,0x1e2e)],_0x313705(0x1539,0xe4b,0x1b02,0x1013)+_0x23937d(0xc28,0x17be,0x1e,0x1818)+_0x313705(0xfd7,0x296,0x136a,0xa21)+_0x313705(0x432,-0x80d,0x126,0x5af),_0x23937d(0x1190,0x1e1b,0xb6f,0xbf2)+_0x23937d(0x1b2c,0x2750,0x22aa,0x1d74)+_0x23937d(0xee8,0xe1f,0xf55,0x12a3),_0x4b485e[_0x23937d(0x1d71,0x280e,0x1e75,0x1d68)],_0x4b485e[_0x23937d(0x274,-0xa55,0x713,0xf4e)],_0x4b485e[_0x23937d(0x1b29,0x22a9,0xecc,0xcaa)]],_0x51097b=[_0x23937d(0xb06,0xe6e,0x29b,0xd21),_0x23937d(0xf2e,0xf3,0x113f,0x1a90)+_0x23937d(0xbf1,0x944,0x1421,0x6e4),_0x4b485e[_0x313705(0x1168,0x1742,0x1ab0,0x19bf)],_0x23937d(0x1156,0xa4d,0x13a0,0x11eb),_0x4b485e[_0x313705(0xf77,0xe69,0x1476,0x62)],_0x4b485e[_0x23937d(0x35f,-0x6bd,-0x5d,-0x63f)]];var _0x1f36a6=Math[_0x23937d(0x6a2,0xe7f,0xa1a,0x74)](_0x4b485e['boQom'](Math[_0x313705(0x1ae0,0x1fc8,0x1fc5,0x16b8)](),0xf2b+-0x1*-0x1dd+-0x10fe)),_0xb82d72=Math[_0x313705(0xa08,0x13d0,-0xa3,0x12fa)](_0x4b485e[_0x313705(0xfc1,0x11e2,0xbdb,0x17a0)](Math[_0x23937d(0x177a,0x1ba0,0x17b2,0x16d5)](),-0x1f2f+-0x5a7*-0x4+0x1*0x89b)),_0x18b418=Math[_0x313705(0xa08,-0x306,0xda7,0xfe0)](_0x4b485e[_0x23937d(0x1331,0x4b0,0x66b,0xe8a)](Math[_0x313705(0x1ae0,0x2117,0x141a,0x1f51)](),0x1603+0xcb1*0x2+-0x2f*0x102)),_0x257b43=[0x1a00+0x1ddc+-0x37d9,-0x2589+-0x368+0x28f1,0x12a5+0x188*0x7+-0x1d59,-0x1aa7*0x1+0x7*0x575+-0xb8c,0x14e9+0xf72+-0x1*0x2456,0x5*0x676+0x2*0x10e4+-0x2109*0x2,0x2*0x1057+0x178*0x5+-0x2800,0x1b7e+0x20*-0x40+-0x137e,-0x3*-0x377+0x1687+-0x20eb,-0x159e+-0x17e*-0x10+-0x242,-0x1daa+-0x1*-0x1be9+-0x1c3*-0x1,-0x181a+-0x2*0xb66+-0x3*-0xfa3,-0x4db*0x6+0x295*0x1+0x7*0x3cb,0x1*0x1fdf+-0x619*-0x5+-0x3e59,0xb*0xb3+-0x6ba+-0x1*0xf7,-0x1*-0x1b26+0xb1+-0x1bd6],_0x4bc0a8=[0x11ce+-0xa98+-0x1cd*0x4,0x150b*-0x1+0x1813*-0x1+0x2d1e,0xab4+0xf1a+-0x19cb,0x50f+-0x17*-0x133+-0x829*0x4,0x667*-0x3+-0x19fc+0x1*0x2d35,0x8*-0x41e+0x1c6a+0x486,0x54f+0x647*-0x4+0x13d2,-0xf87+-0x270a+0x3691,0x3*-0xb2c+-0x1770+0x38f5,0x2f*-0x39+0x25de+-0x1b67,-0x1984+-0x11a0+0x2b26,0x361*0x1+0xcac+-0x100d*0x1,-0x869*-0x1+-0x172b+-0x13*-0xc7,-0x4b6+-0x230e+0x27c4,0x2bc+0x1bd8+-0x1e93],_0x593e34=[-0x4ff*0x1+-0xb44+-0x822*-0x2,0x2b4*0x5+-0x4*-0x98f+-0x33c0,-0x925*-0x1+0x1ac2+-0x23e3,-0x219c+0xce+-0xd*-0x286,-0xf86*-0x1+0x19ae+-0x1*0x2932,-0x1464+0x1*-0x20d7+0x353b,-0xb7f+-0x2613*-0x1+-0x1a93,0xa2*0x2f+-0x1*0x57e+-0x1840,-0x57*0x6e+0x141f+0x1145*0x1,-0x8a1*0x1+-0x675*-0x1+0x22d,0x2683+0x1f97+0x4617*-0x1,-0x2651+-0x2*0xcaa+0x3fa5*0x1,0x4eb*-0x3+0x1ad6+-0xc14],_0x26e334=_0x257b43[Math[_0x313705(0xb57,-0x2c6,0xa32,0x18b5)](_0x4b485e['boQom'](Math[_0x313705(0x1ae0,0x1fee,0x1f59,0x1f35)](),_0x257b43['length']))],_0x378d93=_0x4bc0a8[Math['floor'](_0x4b485e[_0x23937d(0x1cbe,0x1b9d,0x1652,0x1840)](Math[_0x23937d(0x177a,0x1b0b,0x1617,0x1be7)](),_0x4bc0a8[_0x23937d(0x3de,0x7fe,0x33f,0xbe4)]))],_0x1dea61=_0x593e34[Math[_0x313705(0xb57,0x1747,0x1725,0xfc1)](_0x4b485e[_0x23937d(0x13ec,0x185d,0x1cac,0x1bf1)](Math[_0x313705(0x1ae0,0x2420,0x26fa,0x1493)](),_0x593e34[_0x313705(0x744,0xe,-0x721,0x14ae)]))],_0x749f56=_0x1cf963[Math[_0x23937d(0x7f1,0xf5f,0xee1,-0x678)](_0x4b485e['lShjn'](Math[_0x23937d(0x177a,0x2394,0xb7f,0x18a2)](),_0x1cf963['length']))],_0x2814c0=_0x51097b[Math[_0x23937d(0x7f1,-0x23e,0xfda,-0x401)](_0x4b485e[_0x23937d(0x1659,0x1f3a,0x253a,0x1b92)](Math[_0x23937d(0x177a,0x953,0x1d09,0x1d75)](),_0x51097b[_0x313705(0x744,0xb5c,0x7ab,0x5a5)]))];if(_0x2814c0===_0x4b485e['qyyOi']){if(_0x4b485e[_0x313705(0x1935,0x22f9,0x1eb9,0x22fa)]!=='KBEZr')_0x4d4c21(_0x3d49e4['sender']);else var _0x40996c='./Android/'+_0x23937d(0x15ed,0x11f1,0x75b,0x1028)+_0x313705(0x199f,0x205b,0x1c85,0x1e9b)+_0x313705(0xea3,0x3ee,0xbe3,0x182a);}else{if(_0x4b485e[_0x23937d(0xb21,0xce6,0xc66,0x12ed)](_0x2814c0,_0x4b485e[_0x23937d(0x187f,0x19f6,0xec6,0x235e)]))var _0x40996c=_0x4b485e[_0x23937d(0x14e,-0xb99,-0x179,0x977)];else{if(_0x4b485e[_0x23937d(0x9dc,0x7e0,-0x2c,0x182e)](_0x2814c0,_0x4b485e[_0x23937d(0xe02,0x164a,0x374,0x683)])){if(_0x4b485e[_0x23937d(0x9b,0x272,0x17e,0x265)](_0x4b485e[_0x313705(0xfc8,0x53e,0xb8d,0x16fa)],_0x4b485e[_0x313705(0xfc8,0x5f5,0x2d1,0x8ab)]))var _0x40996c=_0x4b485e[_0x313705(0x4d5,0x174,0xbc5,0x1346)];else{const _0x3aa6e5={};_0x3aa6e5[_0x23937d(0xa79,0x5ce,0xa32,0x170d)]=_0x4b485e[_0x23937d(0xc,0x6cc,0xcd,-0xe6d)];const _0x388106={};_0x388106[_0x313705(0x1fa9,0x1b7e,0x2467,0x1cd0)]=_0x3aa6e5,_0x388106[_0x23937d(0x968,0xfb2,-0x1d8,0x1427)]=_0x23937d(0x173d,0x2061,0x1644,0xc53)+_0x5e3d9e[_0x313705(0x7e2,0x510,0x348,0x412)]+(_0x313705(0x1c9b,0x1056,0x1730,0x1d0e)+'𝗗༒𝗗𝗥𝗔𝗚𝗢𝗡-𝗕'+'𝗢𝗧࿐\x0aCreate'+_0x313705(0x92e,0x26f,0x47,-0x5e6)+_0x23937d(0x11a,0xf0c,0xf34,0xd24)+_0x313705(0xc84,0x945,-0x219,-0x1b)+_0x23937d(0x806,0x10d5,-0x50d,-0x6b8)+_0x313705(0x185e,0x1719,0x1e47,0x1634)+_0x23937d(0xf1a,0xe7f,0x13b5,0xa35));const _0x6b4408={};_0x6b4408[_0x313705(0x942,0xe50,0x107b,0x2df)]=_0x587fe8,_0x17239d[_0x313705(0xcaa,-0x274,0x18db,0x110)+'e'](_0x50001f[_0x23937d(0x118c,0x1a08,0x20a2,0x188a)],_0x388106,_0x6b4408);}}else{if(_0x4b485e[_0x23937d(0x3af,-0x23e,-0x895,0x673)](_0x2814c0,'Meadow'))var _0x40996c=_0x4b485e[_0x313705(0x1e7e,0x2d69,0x14dd,0x2bf5)];else{if(_0x4b485e[_0x23937d(0xaf3,0x2b6,-0x27a,0x17ad)](_0x2814c0,_0x4b485e['kmpvP']))var _0x40996c=_0x4b485e[_0x23937d(0xa48,0xdb9,-0x13a,-0x1c7)];else{if(_0x4b485e[_0x23937d(0xf64,0xce3,0xab5,0xb15)](_0x2814c0,_0x4b485e[_0x23937d(0x35f,-0x6e8,-0x48,0x5a7)]))var _0x40996c=_0x313705(0xe81,0x1d02,0xd97,0x166d)+'storage/im'+_0x23937d(0x2db,0xadf,-0x4fe,0xdff)+_0x313705(0x1215,0x985,0x1611,0xfbf);}}}}}_0x4b485e['kQAjX'](setTimeout,()=>{let _0x134e29=_0x4137dc(0x1285,0x1de8,0x1ed7,0xa05)+'SULT\x20]_\x0a';_0x134e29+=_0xe886bf(0x2011,0x1166,0x1e28,0x25b1)+_0x1f36a6+'\x0a',_0x134e29+=_0x4137dc(0x78e,0x997,0x6bb,-0x5cf)+_0xe886bf(0x651,0xa0a,-0x274,0x384)+_0xb82d72+'\x0a';function _0xe886bf(_0x1db6df,_0x3167d0,_0x59dde8,_0x2f143f){return _0x313705(_0x1db6df- -0x5,_0x3167d0,_0x59dde8-0x1c3,_0x2f143f-0x66);}_0x134e29+='*🐇Rabbit*\x20'+':\x20'+_0x18b418+'\x0a';function _0x4137dc(_0x30a5a5,_0x4bedee,_0x3c6ce2,_0x1ff9d9){return _0x313705(_0x30a5a5- -0x517,_0x4bedee,_0x3c6ce2-0x136,_0x1ff9d9-0x1eb);}_0x134e29+='*🐑Sheep*\x20:'+'\x20'+_0x26e334+'\x0a',_0x134e29+='*🐄Cow*\x20:\x20'+_0x378d93+'\x0a',_0x134e29+=_0xe886bf(0x156b,0x10cf,0x10c6,0x8f9)+'*\x20:\x20'+_0x1dea61+'\x0a\x0a',_0x134e29+=_0xe886bf(0xa6d,0xbb5,0xa14,0x346)+'\x0a',_0x134e29+=_0xe886bf(0x1536,0x2309,0x9aa,0x1930)+_0x4137dc(0x13f,0xa1b,0x41f,0xe17)+_0x2814c0+'\x0a',_0x134e29+=_0x4137dc(0x12dc,0x1a98,0xf04,0x1826)+':\x20'+_0x749f56+(',\x20blood\x20-\x20'+_0x4137dc(0xbfa,0x3b5,0x8d3,0x4c1)),_0x134e29+=_0xe886bf(0x1c56,0x213f,0x292a,0x1852)+'\x20blood*\x20:\x20'+_0x4b485e[_0x4137dc(0x2db,0xe51,0xb49,0x6c0)](getDarah,_0x5cd288['sender'])+'\x0a';const _0x3f7306={};_0x3f7306[_0x4137dc(0x1243,0x1e64,0x1b3a,0x1303)+'t']=_0xe886bf(0x1b21,0x1777,0xf54,0x24f0)+'🏹';let _0x576003=[{'buttonId':''+_0x4b485e['UqomV'](_0xe1d953,_0x1354e9),'buttonText':_0x3f7306,'type':0x1}];const _0x1dcaeb={};_0x1dcaeb[_0x4137dc(0x8c8,0xd93,0x1008,0x12b8)]=_0x40996c;const _0x48915f={};_0x48915f[_0x4137dc(0x1a92,0xe54,0xdea,0x157b)]=_0x1dcaeb,_0x48915f['caption']=_0x134e29,_0x48915f['footer']=_0xa43395,_0x48915f[_0x4137dc(0xa89,0x14a8,0xb16,0x801)]=_0x576003,_0x48915f[_0x4137dc(0x1968,0x2513,0xf7a,0x16e5)]=0x4;let _0x42cef7=_0x48915f;const _0x34e59f={};_0x34e59f[_0x4137dc(0x42b,-0x54c,0x7e0,0xd81)]=_0x5cd288,_0x175756[_0x4137dc(0x793,0x15b6,0x5c3,0x573)+'e'](_0x423161,_0x42cef7,_0x34e59f);},0x18cd*-0x1+-0x26*0xe6+0x4e79*0x1),setTimeout(()=>{function _0x108dd1(_0x5b0d24,_0x59603f,_0x3bf954,_0x39bd08){return _0x23937d(_0x59603f-0x11a,_0x3bf954,_0x3bf954-0xf,_0x39bd08-0x12a);}const _0x8cbf68={};_0x8cbf68[_0x1371a7(0x1777,0x23a3,0x174e,0x21af)]=_0x4b485e[_0x1371a7(0x18a4,0x167e,0x2396,0x26a7)];function _0x1371a7(_0x598ddf,_0x35a73a,_0x3a5566,_0x50b9ba){return _0x313705(_0x598ddf- -0x47a,_0x3a5566,_0x3a5566-0x1c4,_0x50b9ba-0x1d);}const _0x5c4455=_0x8cbf68;if(_0x1371a7(0x1286,0x20f9,0xde1,0xe6e)!==_0x4b485e[_0x1371a7(0x15c3,0xfb8,0xbb3,0x120e)])_0x1db05d('@'+_0x5cd288[_0x1371a7(0x13ba,0x1c4b,0x17c1,0x963)]['split']('@')[0x1*-0x24a1+0x5*-0x457+0x3a54*0x1]+(_0x108dd1(0x1018,0xbdf,0x11cb,0x1a07)+_0x1371a7(0xbe3,0x4ab,0x1816,0x65f))+_0x2814c0);else{let _0x4096cc=_0x2b995b(_0x4b485e[_0x1371a7(0xba9,0x1643,0x150a,0x1885)]);_0x4096cc[_0x108dd1(0x1521,0xc23,0xd98,0xfdf)](''+_0x2cf890)[_0x108dd1(0x296b,0x1c7b,0x1280,0x234f)](async _0x24fba2=>{const _0x45b037={};_0x45b037['text']=_0x5e6206(0x154d,-0x518,0x6ce,0x786)+_0x415c07(0x20c8,0x16a0,0x1e32,0x13e3)+_0x415c07(0x256a,0x11ba,0x122e,0x1f79)+_0x415c07(0x115d,0x9f4,0xd7b,0xc44)+_0x415c07(0x1c21,0x225a,0x2158,0x1ae9)+_0x415c07(-0x9f5,0x63c,-0x29c,0x38f)+_0x5e6206(0xf27,0x1553,0xb5d,0x1450)+_0x5e6206(-0x36d,-0xe3,-0x4ba,0x873);const _0x183606={};_0x183606[_0x415c07(0x594,0x178b,0xb4c,0x999)]=_0x3ff25e,_0x1765e5[_0x5e6206(0x650,0x14b9,0x78,0x8b4)+'e'](_0x213ea6[_0x415c07(0x1404,0xd48,0x17d7,0x1549)],_0x45b037,_0x183606);const _0xb4b467={};_0xb4b467['url']=_0x24fba2[_0x5e6206(0x71c,0x15fc,0xcea,0x9e9)][-0x101*0x11+0xb3*0x1d+-0x336][_0x5e6206(0xe93,0x64c,0x111c,0x9e9)];const _0x352471={};function _0x415c07(_0x46765b,_0xc631a3,_0x2f126c,_0x348b96){return _0x108dd1(_0x46765b-0x10a,_0x348b96-0x2a3,_0xc631a3,_0x348b96-0x11e);}_0x352471['document']=_0xb4b467,_0x352471['mimetype']=_0x5c4455[_0x5e6206(0x265a,0xcb6,0xfc3,0x17fb)],_0x352471[_0x5e6206(0x134c,0xabf,0x18,0xa89)]=_0x415c07(0x66b,-0x1ac,-0x13b,0x391)+_0x415c07(0xfc1,0x6f,0x2de,0x7b4)+'3';const _0x1b1fb8={};function _0x5e6206(_0x1d4db0,_0x220172,_0x450bf9,_0x56c0a8){return _0x1371a7(_0x56c0a8-0x84,_0x220172-0x1,_0x1d4db0,_0x56c0a8-0x8);}_0x1b1fb8['quoted']=_0x489c5f,_0x4c4e2f[_0x5e6206(0x1629,-0x334,0x1a8,0x8b4)+'e'](_0x3ee1fd['chat'],_0x352471,_0x1b1fb8);})['catch'](_0x55303e=>{function _0x1c9dff(_0xf4367f,_0x35ea63,_0x2d4855,_0x503455){return _0x108dd1(_0xf4367f-0x1ee,_0x35ea63- -0x2b6,_0x2d4855,_0x503455-0x18a);}function _0x2be00b(_0x48865c,_0x5d6581,_0x57a230,_0x223859){return _0x1371a7(_0x223859- -0x4c,_0x5d6581-0x13c,_0x57a230,_0x223859-0x9b);}_0x10ecf8(_0x2be00b(0x914,-0xef2,0xb91,-0xed)+_0x2be00b(0x564,0x17fb,0x1df8,0x1248)+'lide\x20link\x20'+'!');});}},-0x29*-0x2f+-0xc*-0xd3+-0x481*0x3),_0x4b485e[_0x23937d(0x186e,0x1159,0x23af,0x2734)](addIkan,_0x5cd288[_0x23937d(0x14ce,0x140f,0xcad,0x1586)],_0x1f36a6),_0x4b485e[_0x313705(0x1bd4,0x254d,0x1d23,0x185a)](addAyam,_0x5cd288[_0x313705(0x1834,0x1315,0xca1,0x262b)],_0xb82d72),_0x4b485e[_0x23937d(0x7c9,0x1577,0x8ed,0x1417)](addKelinci,_0x5cd288[_0x313705(0x1834,0x10aa,0xc3d,0xcba)],_0x18b418),_0x4b485e[_0x23937d(0x2a5,0x1e9,-0x50,-0xa14)](addDomba,_0x5cd288['sender'],_0x26e334),_0x4b485e[_0x23937d(0x465,0x9df,-0x21a,-0x141)](addSapi,_0x5cd288[_0x313705(0x1834,0x1ebf,0x159c,0x1ef6)],_0x378d93),_0x4b485e['ZsFlx'](addGajah,_0x5cd288[_0x313705(0x1834,0x185d,0xad4,0x25e8)],_0x1dea61),_0x4b485e[_0x23937d(0xcc3,0x1210,0x34b,0xd19)](kurangDarah,_0x5cd288[_0x313705(0x1834,0x194c,0x1b67,0x96b)],-0x204c+-0x4b8+0x250e);}}break;case'resetlinkg'+'c':case _0x313705(0x1d66,0x179c,0x17a4,0x2871)+_0x23937d(0xad8,0x13b6,-0x264,0xb0b):case _0x4b485e[_0x23937d(0x1d9f,0x258c,0x24a0,0x277a)]:case _0x4b485e[_0x23937d(0x1b23,0x19c8,0x1fc4,0x1a2d)]:case _0x4b485e['FkHWK']:case _0x4b485e[_0x23937d(0x192a,0x11ca,0x191a,0xd6b)]:case _0x4b485e[_0x23937d(0x1ce0,0x24f3,0xf47,0x15d6)]:case _0x4b485e[_0x313705(0xd3e,0xed4,0x1988,0xe91)]:{if(_0x4b485e[_0x23937d(0x1d4,0xc71,-0x160,-0x871)](_0x4b485e[_0x313705(0x215c,0x1c7c,0x2eb2,0x27d5)],_0x4b485e[_0x23937d(0x1df6,0x1842,0x1009,0x1445)])){if(_0x4b485e[_0x23937d(0x17,-0x883,-0x5d,0xc9d)](_0x45407a[0x80*-0x3+-0x263+0x1*0x3e3],'on')){if(_0x4b485e['AalNi'](_0x33e36c['antispam'],_0x4b485e[_0x23937d(0x237,-0x3d3,0xa22,0xdea)]))return _0x5d5637(_0x23937d(0xc17,0x66d,0x1868,-0xba));_0x22e065[_0x313705(0x1420,0x6c4,0x16c4,0xbc1)]=_0x4b485e['ndZFX'],_0x4b485e[_0x23937d(0x1067,0x14a6,0x918,0xb80)](_0x4e6c1c,_0x4f31da[_0x23937d(0x96c,0x185a,0xdbd,0x1214)]+('\x20Anti\x20Spam'+_0x313705(0xbf3,0x252,0x902,-0x36)));}else{if(_0x4b485e[_0x23937d(0x1cf6,0x1959,0x247c,0x19b2)](_0x329a62[0x79c+-0x1*-0x21e2+-0x2*0x14bf],_0x4b485e[_0x313705(0x70e,-0x49d,0x685,0xbeb)])){if(_0x4b485e[_0x313705(0x10dc,0x17b0,0x770,0xd94)](_0x1f1054[_0x313705(0x1420,0x13c4,0x1dfd,0x660)],_0x4b485e['UBZUB']))return _0x5906c3(_0x313705(0xf18,0x1879,0x6d4,0xa66)+'d');_0x368b6e[_0x23937d(0x10ba,0xcc6,0xf40,0x1d8b)]=_0x4b485e[_0x313705(0x1c76,0x17ee,0x21dc,0x1b40)],_0x4b485e[_0x313705(0x13cd,0x2028,0x1f7f,0x1a69)](_0x1b7767,_0x103a04[_0x313705(0xcd2,0x7bf,0x10ff,0x1178)]+(_0x23937d(0x1aca,0x20b8,0x1dfe,0x1020)+_0x313705(0x108f,0x605,0x1922,0x1ac0)));}}}else{const _0xa3df70=_0x4b485e['geaHJ']['split']('|');let _0x5c7db2=-0x7cd+0x2*0x107b+-0x1929;while(!![]){switch(_0xa3df70[_0x5c7db2++]){case'0':_0x175756[_0x313705(0x1797,0xfe1,0x17a4,0x23af)+_0x313705(0x7a4,0x1474,0xcf4,0x1071)](_0x5cd288[_0x313705(0x14f2,0xe1a,0xe30,0x78a)]);continue;case'1':if(_0x4b485e[_0x313705(0x654,0xf9e,0x958,0x292)](!_0x17ccaf,!_0x24aa58))return _0x4b485e[_0x313705(0x2149,0x137c,0x2573,0x2162)](_0x516d85,mess[_0x313705(0x1818,0x20d2,0x144d,0x1b2d)]);continue;case'2':if(_0x1bac1f)return _0x4b485e[_0x313705(0x4d4,0xcca,0xd8e,-0x6fc)](_0x1db05d,mess[_0x313705(0x982,0xbde,0xb6b,0x41c)]);continue;case'3':if(!_0x424adc)return _0x4b485e[_0x23937d(0x29,0x1b0,-0x407,0x182)](_0x516d85,mess[_0x23937d(0x10b3,0x10c3,0x184a,0x1a4d)]);continue;case'4':if(_0x1e03f5)return _0x1db05d(mess[_0x313705(0x926,0xc4,0xcf5,0x111d)]);continue;case'5':if(!_0x5cd288[_0x23937d(0x1d23,0x1973,0xef9,0x16cf)])return _0x4b485e['aRknL'](_0x516d85,mess[_0x313705(0x152c,0x1007,0x1b61,0x2400)]);continue;}break;}}}break;case _0x4b485e[_0x313705(0xbba,-0x6e,0xcaa,0x122f)]:{if(_0x4b485e[_0x23937d(0x1701,0x1d3c,0x1e16,0x1ca1)](_0x313705(0x7da,0xc0a,-0x1b9,0x9ef),_0x4b485e[_0x313705(0x11d4,0x118c,0xfe0,0x1ad9)])){const _0xad4816={};_0xad4816[_0x313705(0x209f,0x1456,0x17f1,0x2965)]=''+_0x56a008[_0x313705(0xb85,0x16fc,0x441,0xf3)];const _0x4bd48c={};_0x4bd48c[_0x23937d(0x5dc,0xb66,-0x7ee,0xcab)]=_0x5966dc,_0x205975[_0x313705(0xcaa,0xed9,0x16f6,0x1a0d)+'e'](_0x48c3f6[_0x313705(0x14f2,0x1658,0x101a,0xc6b)],_0xad4816,_0x4bd48c);}else{if(_0x1bac1f)return _0x1db05d(mess[_0x23937d(0x61c,-0x51b,0x1387,-0xd)]);if(_0x1e03f5)return _0x4b485e[_0x313705(0x1af4,0x162a,0x261d,0x2607)](_0x1db05d,mess[_0x313705(0x926,-0x355,-0x2d3,0x101a)]);let _0x1a4ab5=global['db'][_0x313705(0x117d,0x1975,0x1c3a,0xd99)][_0x313705(0x1b7c,0xf13,0x1ed7,0x1a57)][_0x5cd288[_0x23937d(0x14ce,0xe4e,0xb93,0x226b)]];_0x1a4ab5['afkTime']=+new Date(),_0x1a4ab5[_0x23937d(0xe3e,0x615,0x192f,0xfc6)]=_0x494254,_0x4b485e[_0x313705(0x701,-0xdd,0x634,-0x1b4)](_0x1db05d,_0x5cd288[_0x23937d(0x47c,0xddf,0xeab,0x12f8)]+('\x20Has\x20Gone\x20'+_0x313705(0x1e38,0x23e1,0x10c1,0x1c45)+'e')+(_0x494254?_0x4b485e['Ogmcy'](':\x20',_0x494254):''));}}break;case _0x4b485e['SBQNK']:case _0x4b485e[_0x23937d(0x1bf0,0x2185,0x19ac,0x1e6f)]:case'tictactoe':{if(_0x1bac1f)return _0x4b485e[_0x313705(0x206d,0x2510,0x24bf,0x2541)](_0x1db05d,mess['ban']);if(_0x1e03f5)return _0x4b485e[_0x313705(0x1b0a,0x222c,0x275b,0x2570)](_0x1db05d,mess['banChat']);let _0x28c9dc=_0x4b485e['cNHDf'](require,_0x4b485e['GfGgM']);this[_0x23937d(0x4c0,0x66d,-0x237,0x9a8)]=this['game']?this[_0x313705(0x826,0x7fb,0x1114,0x1022)]:{};if(Object[_0x313705(0x123c,0x1380,0x5b5,0x1670)](this[_0x23937d(0x4c0,0x990,-0x444,0x6e0)])[_0x313705(0x1a2b,0xe77,0x144c,0x1e4a)](_0x29ad14=>_0x29ad14['id'][_0x23937d(0xb72,0x184d,0x84e,0xe88)]('tictactoe')&&[_0x29ad14[_0x23937d(0x4c0,-0x94b,0x1f7,0x67)][_0x23937d(0x1c7a,0x1dcc,0x103b,0x2b13)],_0x29ad14[_0x313705(0x826,-0x174,0x84a,0xc28)][_0x313705(0x1f87,0x25c2,0x2dac,0x2d87)]][_0x23937d(0x178,-0x8c0,0xa6b,0xf37)](_0x5cd288[_0x23937d(0x14ce,0x1f1d,0x8c4,0x1ab8)])))return _0x4b485e[_0x23937d(0x1cd3,0x1906,0x1ec7,0x2879)](_0x516d85,_0x23937d(0x15c7,0x1554,0xea9,0xbd9)+_0x23937d(0x1463,0xee7,0x763,0xcfa)+_0x313705(0x1068,0x131f,0x1bd4,0x387));let _0x96df1f=Object[_0x23937d(0xed6,0x507,0x134b,0x7be)](this[_0x23937d(0x4c0,-0x10e,-0x73e,-0x9c)])[_0x23937d(0x16c5,0x13df,0x2531,0x8a2)](_0x5695ee=>_0x5695ee[_0x23937d(0xebc,0x140f,0xe4f,0x167c)]==='WAITING'&&(_0x494254?_0x5695ee[_0x313705(0x17b7,0x1789,0xb72,0xd28)]===_0x494254:!![]));if(_0x96df1f){_0x4b485e[_0x23937d(0x70b,-0x51,0x46c,0x1d5)](_0x1db05d,_0x4b485e[_0x23937d(0x1bd4,0x155e,0x18ce,0xd8f)]),_0x96df1f['o']=_0x5cd288[_0x313705(0x14f2,0x1f18,0x64a,0x20c9)],_0x96df1f['game']['playerO']=_0x5cd288['sender'],_0x96df1f['state']=_0x313705(0x1d5d,0x18b8,0x11e7,0x21ad);let _0x948827=_0x96df1f[_0x23937d(0x4c0,0xc40,0xd68,-0x828)][_0x23937d(0x1a75,0x1afd,0xd55,0x1e7a)]()[_0x313705(0xe7c,0x1c21,0x560,0x11d1)](_0x1befc5=>{const _0x3eb548={};function _0x2fa142(_0x75c474,_0x5845ca,_0x12999d,_0x295989){return _0x23937d(_0x12999d-0x47e,_0x295989,_0x12999d-0x172,_0x295989-0xf4);}_0x3eb548['X']='❌',_0x3eb548['O']='⭕',_0x3eb548['1']=_0x4b485e[_0x2fa142(0xfda,0xd51,0xee3,0x1a69)],_0x3eb548['2']=_0x4b485e[_0x2fa142(0x1dc9,0xd5b,0x1b23,0x268a)],_0x3eb548['3']=_0x4b485e[_0x5d4a0e(0xa74,0x844,0xf7e,0xdcf)],_0x3eb548['4']=_0x5d4a0e(0x96b,0x15d6,-0xdd,0x702),_0x3eb548['5']=_0x4b485e[_0x2fa142(0x75d,0x204,0xcd4,0xe07)],_0x3eb548['6']=_0x4b485e['KUtlB'],_0x3eb548['7']='7️⃣',_0x3eb548['8']=_0x4b485e[_0x5d4a0e(0x1685,0x77c,0xcf6,0x14aa)];function _0x5d4a0e(_0x588413,_0x44138c,_0x140532,_0x81786d){return _0x313705(_0x81786d- -0xa9,_0x44138c,_0x140532-0x9f,_0x81786d-0x12b);}return _0x3eb548['9']=_0x4b485e[_0x2fa142(0x170b,0x1db2,0x15ce,0x15f2)],_0x3eb548[_0x1befc5];}),_0x193aec='Room\x20ID:\x20'+_0x96df1f['id']+'\x0a\x0a'+_0x948827[_0x23937d(0x33,0x5f9,0x9ec,0xd44)](-0x16d6+-0x30*0x8e+-0x3176*-0x1,-0x1*-0x235e+0x127a+-0x35d5)[_0x23937d(0x1c16,0xedf,0x2908,0x15a4)]('')+'\x0a'+_0x948827[_0x23937d(0x33,-0x69e,-0x68b,0xa43)](-0x3*0x8e9+-0xb2+-0x6dc*-0x4,-0x21f+0x15f1+-0x13cc)[_0x313705(0x1f7c,0x2add,0x1a1a,0x1bf4)]('')+'\x0a'+_0x948827[_0x313705(0x399,0x6b0,0x3c5,0x861)](0x1*0xa72+-0xd1*0x6+-0xca*0x7)[_0x23937d(0x1c16,0xe27,0x2665,0x2812)]('')+(_0x23937d(0xb56,0x18f,0x14bf,0x19c8)+'@')+_0x96df1f[_0x313705(0x826,0x1429,0x83,-0x18d)][_0x313705(0x14b3,0x132e,0x16bf,0x14ee)+'n'][_0x23937d(0xccf,0x589,-0x50,0x1ac4)]('@')[-0x3*-0xa4a+-0x1040+-0x2*0x74f]+(_0x313705(0x6d2,0xcef,0x78c,-0x378)+_0x313705(0x34c,0x774,-0x6ea,0xae5)+_0x23937d(0x1cad,0x29b8,0x1bee,0x19c3)+_0x23937d(0x4e0,0x1121,0x1321,0xe78)+'t\x20defeat');if(_0x96df1f['x']!==_0x96df1f['o'])await _0x175756[_0x313705(0x18da,0xcdb,0x1997,0x1a1a)](_0x96df1f['x'],_0x193aec,_0x5cd288,{'mentions':_0x4b485e['eDYxv'](parseMention,_0x193aec)});await _0x175756[_0x23937d(0x1574,0xdd9,0x1115,0x22c5)](_0x96df1f['o'],_0x193aec,_0x5cd288,{'mentions':parseMention(_0x193aec)});}else{_0x96df1f={'id':_0x4b485e[_0x313705(0x1fce,0x1c62,0x2812,0x2104)](_0x4b485e['zUwxn'],+new Date()),'x':_0x5cd288[_0x23937d(0x118c,0x1f30,0xbdf,0x16b2)],'o':'','game':new _0x28c9dc(_0x5cd288[_0x313705(0x1834,0x2566,0x2738,0x1f6c)],'o'),'state':_0x4b485e[_0x313705(0x782,-0x197,0x22d,0x11cf)]};if(_0x494254)_0x96df1f['name']=_0x494254;_0x4b485e[_0x23937d(0x287,-0x592,0x1014,0xc28)](_0x1db05d,_0x4b485e['DSohh'](_0x4b485e['wzDAs'],_0x494254?_0x23937d(0x10b5,0xb64,0x67f,0x9d9)+'Command\x20Be'+_0x313705(0x13ae,0x1ade,0x1ec6,0x1338)+_0xe1d953+_0x1354e9+'\x20'+_0x494254:'')),this[_0x313705(0x826,-0x372,0x660,0xf5e)][_0x96df1f['id']]=_0x96df1f;}}break;case _0x4b485e[_0x23937d(0x1674,0xe6c,0x885,0x110e)]:case'delttt':{if(_0x4b485e['PuIcp']===_0x4b485e[_0x23937d(0xd3,-0x507,-0xdd,0x297)])_0x4b485e[_0x313705(0xfb1,0x8a8,0x4dd,0x41e)](_0x5ab299,''+_0xfa9871[_0x313705(0x1818,0x1b1c,0xb5e,0x1ec3)]);else{if(_0x1bac1f)return _0x4b485e[_0x23937d(0xe7f,0x80a,0x18a3,0x181a)](_0x1db05d,mess['ban']);if(_0x1e03f5)return _0x4b485e['SwuFN'](_0x1db05d,mess[_0x23937d(0x5c0,0x489,0x879,-0x672)]);this[_0x313705(0x826,0x1ef,-0x46,-0x485)]=this[_0x313705(0x826,0x2b1,-0x4ea,0x9f0)]?this[_0x313705(0x826,-0x29f,0x904,-0x310)]:{};try{if(this[_0x313705(0x826,-0x5cc,0xbaf,0x121c)])delete this[_0x313705(0x826,-0x54e,0x1163,0x46b)],_0x175756[_0x23937d(0x1574,0xdc4,0x135b,0x1760)](_0x5cd288[_0x313705(0x14f2,0x11b3,0x224d,0x1355)],_0x23937d(0x1471,0x1b30,0x1897,0x14bf)+_0x23937d(0x14c4,0x93f,0x18c9,0x1382)+'\x20The\x20TicTa'+_0x23937d(0x1341,0x18e8,0x160f,0xb4b)+'on',_0x5cd288);else{if(!this[_0x313705(0x826,0x1069,0x1253,0x285)]){if(_0x4b485e[_0x313705(0x16fb,0xd8a,0x164c,0x1ca5)](_0x4b485e[_0x23937d(0x15a0,0x16d6,0xdec,0x2260)],_0x23937d(0x8fe,-0x497,0xb65,0x410)))return _0x4b485e[_0x23937d(0x705,-0x724,0x4d3,0x13fa)];else _0x4b485e[_0x313705(0x16ff,0x2412,0xd7d,0x1ee5)](_0x1db05d,_0x313705(0x1e79,0x1bc2,0x21be,0x1166)+_0x23937d(0x1645,0x1018,0x1148,0x1388)+_0x23937d(0x174e,0x24a0,0x218e,0xe80)+_0x313705(0xb66,0xad1,0x616,0x1170));}else _0x4b485e[_0x313705(0x1f7f,0x16ca,0x1ebf,0x2d8e)](_0x1db05d,'?');}}catch(_0x3800a2){_0x4b485e[_0x313705(0x1a18,0x1aca,0x1dc5,0x1d92)](_0x1db05d,_0x23937d(0x82f,0xcbf,0x9dd,-0x63b));}}}break;case'suitpvp':case _0x23937d(0x1298,0xd37,0x659,0x206f):{if(_0x1bac1f)return _0x4b485e[_0x313705(0x216f,0x1a5e,0x2ce3,0x1fb6)](_0x1db05d,mess[_0x313705(0x982,0x1239,0xf3a,0xd9b)]);if(_0x1e03f5)return _0x1db05d(mess[_0x313705(0x926,0x59d,0x1609,0x11a1)]);this['suit']=this['suit']?this[_0x23937d(0x1298,0x97f,0x19fb,0xe20)]:{};let _0x2fea58=0x1a+-0x1b*0x3d+0x65f,_0x141ee8=-0x2*0x793+0x160f*-0x1+-0x253f*-0x1,_0x44d745=0x93cc+-0x125c2+-0x17c56*-0x1;if(Object[_0x23937d(0xed6,0x1d02,0x72f,0x143)](this[_0x23937d(0x1298,0xd6b,0x1e67,0xc5e)])[_0x313705(0x1a2b,0x1832,0x1243,0x1bfb)](_0x4ed1e0=>_0x4ed1e0['id'][_0x313705(0xed8,0x21a,0x3ac,0x101)](_0x23937d(0x1298,0x6c0,0x59f,0x410))&&[_0x4ed1e0['p'],_0x4ed1e0['p2']][_0x313705(0x4de,0x44c,0x68e,0x1098)](_0x5cd288[_0x23937d(0x14ce,0x219c,0x1994,0x17e9)])))return _0x4b485e[_0x313705(0xfe2,0x8c9,0x1be,0x1358)](_0x516d85,_0x313705(0xcaf,0x198f,0xe0d,0x945)+_0x313705(0xdd6,0x11fe,0x1696,0x1958)+_0x313705(0x1967,0x21a3,0xd5d,0x257d));if(_0x4b485e['mpeUs'](_0x5cd288[_0x313705(0x1896,0x1c0c,0x1039,0x18d1)+'id'][0x1cd2+0xbe3+-0x11*0x265],_0x5cd288[_0x23937d(0x14ce,0x5f1,0x12a0,0x1b13)]))return _0x1db05d('Can\x27t\x20Play'+'\x20With\x20Myse'+_0x23937d(0xd50,0x727,0x4f5,0x275));if(!_0x5cd288[_0x23937d(0x1530,0x2261,0x22b9,0x11d5)+'id'][0x1b57+0x7*0x53+0x5*-0x5ec])return _0x4b485e[_0x313705(0xa87,-0x6f,0x156c,-0x3ef)](_0x1db05d,_0x313705(0xf20,0xd45,0x8d2,0x771)+_0x23937d(0x46d,-0x51c,0xd4,0xa80)+'Challenge?'+_0x313705(0x1640,0x766,0x1710,0x103f)+_0x23937d(0x9d6,0x817,0x705,-0x3ff)+_0x23937d(0xda5,0x2d0,0x1af6,0x1226)+_0xe1d953+'suit\x20@'+owner[-0x7e3*0x4+-0x20c9+0x4056],_0x5cd288[_0x313705(0x14f2,0xeec,0x5f1,0x820)],{'mentions':[_0x4b485e[_0x313705(0xbd3,0x124d,0x165e,0x1645)](owner[0x1414+-0x31*-0x9d+-0x3220*0x1],_0x4b485e[_0x313705(0x20f2,0x1c42,0x1d16,0x1f00)])]});if(Object[_0x313705(0x123c,0xc6e,0x7f5,0x1051)](this['suit'])[_0x313705(0x1a2b,0xfd5,0x2940,0x17e3)](_0x185403=>_0x185403['id'][_0x313705(0xed8,0x6e3,0x1ca0,0x1088)](_0x23937d(0x1298,0x1c07,0x1f23,0x1106))&&[_0x185403['p'],_0x185403['p2']][_0x313705(0x4de,0x13a7,0x19c,0x435)](_0x5cd288[_0x23937d(0x1530,0x71e,0x10c9,0x12ef)+'id'][-0x58*-0x61+-0x1f5*0xf+-0x3fd])))_0x4b485e[_0x23937d(0x6f5,0x8b4,0x125f,-0x636)](_0x1db05d,_0x313705(0xb86,0xf02,0x1cf,0xdf3)+_0x23937d(0x1a06,0xf32,0xce4,0x1fa7)+'hallenging'+_0x313705(0x1631,0x2264,0x91a,0xa03)+_0x313705(0x1e22,0x20f8,0x15f9,0x1f0e)+_0x23937d(0x1040,0x1f15,0x19ac,0xf23)+_0x313705(0x1920,0xecc,0x1b75,0x1de6));let _0x51efcb=_0x4b485e[_0x313705(0x6e1,-0xe1,0x476,0x704)](_0x4b485e['FpweF'],_0x4b485e[_0x313705(0x1b98,0x19e1,0x2553,0x1136)](new Date(),-0x17b4+0x2353+-0xb9e)),_0x595f87='_*SUIT\x20PvP'+'*_\x0a\x0a@'+_0x5cd288['sender'][_0x313705(0x1035,0x18fa,0x4e4,0x165)]`@`[0x1689+0x1*-0x1cc3+0x63a]+(_0x23937d(0x5e9,-0x293,0x462,0x94c)+'\x20@')+_0x5cd288[_0x23937d(0x1530,0xa70,0x1013,0x943)+'id'][0x3*0x2bb+0xc7d*0x1+-0x14ae][_0x313705(0x1035,0x286,0xe92,0x712)]`@`[0x140f+-0xd7*0x10+-0x69f]+(_0x313705(0x1a65,0xf23,0x10ed,0x19cc)+'uit\x0a\x0aPleas'+'e\x20@')+_0x5cd288[_0x313705(0x1896,0x1448,0x1047,0x251d)+'id'][0x119b*-0x2+-0x1983+0x3cb9][_0x313705(0x1035,0x620,0x88e,0x4e3)]`@`[-0x21a7+-0xa4e+0xb*0x3ff]+(_0x23937d(0x69f,-0x4f3,0x7e3,0x137e)+_0x313705(0x145b,0xe9e,0xdf4,0x1ec7)+'ct');this[_0x23937d(0x1298,0xcfd,0x663,0x7df)][_0x51efcb]={'chat':await _0x175756[_0x313705(0x18da,0x11bc,0xb1a,0x1723)](_0x5cd288[_0x313705(0x14f2,0x2206,0xf6d,0x15ed)],_0x595f87,_0x5cd288,{'mentions':_0x4b485e['BwJxN'](parseMention,_0x595f87)}),'id':_0x51efcb,'p':_0x5cd288['sender'],'p2':_0x5cd288[_0x313705(0x1896,0x123b,0x1154,0xf75)+'id'][-0x527+-0x4*0x85f+0x26a3],'status':'wait','waktu':_0x4b485e['XjeET'](setTimeout,()=>{if(this['suit'][_0x51efcb])_0x175756['sendText'](_0x5cd288[_0x2c15db(0x13f3,0x112f,0x1053,0xbaa)],_0x2c15db(0x62a,0x703,0x1cf,0xb37)+'\x20Out_',_0x5cd288);function _0x2c15db(_0x1afe16,_0x2c42b3,_0xd3f7b6,_0x4dccc4){return _0x313705(_0x2c42b3- -0x3c3,_0x4dccc4,_0xd3f7b6-0x126,_0x4dccc4-0x51);}function _0x54d098(_0x333e24,_0x3761f1,_0x27687e,_0x1fd354){return _0x313705(_0x333e24-0x203,_0x1fd354,_0x27687e-0x7e,_0x1fd354-0x198);}delete this['suit'][_0x51efcb];},0x1cf4e+-0x74f0+0x5e*-0x131),'poin':_0x2fea58,'poin_lose':_0x141ee8,'timeout':_0x44d745};}break;case _0x4b485e[_0x313705(0x160f,0x1070,0x1d57,0x2317)]:{if(_0x1bac1f)return _0x4b485e['reYPO'](_0x1db05d,mess[_0x313705(0x982,0x322,-0x11b,0x15e1)]);if(_0x1e03f5)return _0x4b485e['aaVrl'](_0x1db05d,mess['banChat']);if(!_0x24aa58)return _0x516d85(''+mess[_0x313705(0xfea,0x1b18,0x838,0x2cf)]);if(!q)return _0x4b485e[_0x313705(0x666,0x64,0x1480,-0x1ff)](_0x516d85,_0x313705(0xa23,0xf0a,0x1d4,0x911)+_0x23937d(0x1517,0x18d6,0x10f7,0x1667)+_0x313705(0x2036,0x199c,0x1949,0x1a8e)+_0x23937d(0x10fb,0x1a1f,0x1b88,0xf0e)+_0x313705(0xf64,0x16bd,0x52f,0xef5)+_0x23937d(0x1473,0xc56,0x1186,0xb1c)+_0x313705(0x127e,0x1d0a,0x1d67,0x1483)+_0x313705(0x19df,0x2716,0x1a3f,0x14a1));if(_0x1ba32f[0x162d+0x21dc+0x13*-0x2f3]===_0x4b485e['sYSGt']){if(_0x4b485e['Jxwpm'](_0x4b485e[_0x313705(0x14cc,0x98e,0x1224,0x5f1)],_0x4b485e['InyTf'])){const _0xbb7413={};_0xbb7413['mute']=_0x4b485e[_0x23937d(0x18a7,0x1398,0x1fb4,0xcd7)],_0x175756[_0x313705(0xeeb,0xb56,0x1597,0x1dca)](_0xbb7413,_0x5cd288['chat'],[])[_0x313705(0x1ec7,0x24ec,0x175b,0x2d5b)](_0x4a6f77=>_0x1db05d(jsonformat(_0x4a6f77)))['catch'](_0x30c278=>_0x1db05d(jsonformat(_0x30c278)));}else _0x11b013+=_0x5507cc[_0x313705(0x1127,0x5f3,0x461,0x911)+'i']+(_0x313705(0x207e,0x225b,0x1606,0x1be4)+'\x20')+_0x5f0754[_0x23937d(0x17d9,0x1497,0xaea,0x2392)]+'\x0a',_0x2ef93a+=_0x3bbd82[_0x313705(0x1127,0x1c5d,0xf50,0xd1e)+'i']+(_0x23937d(0x1a8b,0x1324,0xb79,0x2136)+_0x23937d(0x27f,0x1ce,0xccb,0xf85))+_0x1e11b9['snippet']+'\x0a',_0x42e9d5+=_0x4f7fa4[_0x23937d(0xdc1,0x83e,0x10b3,0x659)+'i']+_0x313705(0x1609,0x1cc7,0x748,0x201c)+_0x1ed09b[_0x313705(0x1e5e,0x1e67,0x1aca,0x20fd)]+(_0x23937d(0xcf0,0x1a93,0x1b73,0x1463)+_0x23937d(0x1955,0xd09,0x11ad,0x1f3f)+_0x23937d(0x18de,0x17be,0x219f,0x2294));}else{if(_0x4b485e[_0x23937d(0xb9c,0x526,0xb7b,-0x77)](_0x1ba32f[0x9c0*0x4+-0x1*0x500+-0x2200*0x1],_0x4b485e[_0x313705(0x1aa5,0x29bd,0xd96,0x2197)])){if(_0x4b485e[_0x313705(0x6de,0x462,0x1339,0x12c3)](_0x4b485e[_0x23937d(0x9fe,0x1280,0x607,-0x38d)],_0x4b485e[_0x313705(0xcb6,0xb,0x192f,0x24a)]))_0x402e4d(_0x4b485e['WCtpP']);else{const _0x48dda3={};_0x48dda3['mute']=null,_0x175756[_0x23937d(0xb85,-0x34a,0x506,0x7bb)](_0x48dda3,_0x5cd288[_0x313705(0x14f2,0xdbf,0xc77,0x17db)],[])[_0x313705(0x1ec7,0x177e,0xfe0,0x20b6)](_0x321284=>_0x1db05d(jsonformat(_0x321284)))['catch'](_0x5b7593=>_0x1db05d(jsonformat(_0x5b7593)));}}else{if(_0x1ba32f[-0x1e3+-0xb*-0x33+0x1*-0x4e]===_0x4b485e[_0x313705(0x1a24,0x1d38,0xbf3,0x1cb5)]){const _0xc0b674={};_0xc0b674[_0x23937d(0x814,0x762,0x1655,0x10b7)]=!![],_0x175756[_0x23937d(0xb85,-0x27a,0xeb6,0xe7d)](_0xc0b674,_0x5cd288[_0x23937d(0x118c,0xadf,0x84d,0x4ea)],[])[_0x23937d(0x1b61,0x27fa,0xd8c,0x2723)](_0x403bbc=>_0x1db05d(jsonformat(_0x403bbc)))[_0x23937d(0x934,-0x204,0x861,0x86c)](_0x3f7877=>_0x1db05d(jsonformat(_0x3f7877)));}else{if(_0x4b485e[_0x313705(0x2135,0x185b,0x19d1,0x2ff3)](_0x1ba32f[-0x5*-0x6fb+0x646+-0x292d],_0x4b485e[_0x313705(0x169d,0x1649,0x2184,0x853)])){const _0x11b98f={};_0x11b98f['archive']=![],_0x175756[_0x313705(0xeeb,0x1f9,0x18be,0x1b59)](_0x11b98f,_0x5cd288[_0x23937d(0x118c,0x1fab,0x1699,0x274)],[])[_0x313705(0x1ec7,0x2a26,0x2945,0x22eb)](_0x1d9dc6=>_0x1db05d(jsonformat(_0x1d9dc6)))[_0x23937d(0x934,0x2ae,0x10c,0x1822)](_0xb1a6f7=>_0x1db05d(jsonformat(_0xb1a6f7)));}else{if(_0x4b485e[_0x313705(0x20a8,0x261b,0x2c3f,0x2b8a)](_0x1ba32f[-0x1*-0xe61+0x26a9+0xba*-0x49],_0x4b485e[_0x313705(0x1cb7,0x26b1,0x1c57,0xe0b)])){const _0x3db01e={};_0x3db01e[_0x23937d(0x1b5e,0x1033,0x2303,0x1360)]=!![],_0x175756['chatModify'](_0x3db01e,_0x5cd288[_0x23937d(0x118c,0x1bcf,0xf7c,0x1c55)],[])[_0x23937d(0x1b61,0xf0a,0xdee,0x2186)](_0x4b69b2=>_0x1db05d(jsonformat(_0x4b69b2)))['catch'](_0x4a0493=>_0x1db05d(jsonformat(_0x4a0493)));}else{if(_0x1ba32f[0x80*-0x44+-0x1*-0x2333+-0x133]===_0x4b485e[_0x23937d(0x776,0xe1e,-0x715,-0x116)]){const _0x49785d={};_0x49785d[_0x313705(0x1ec4,0x1884,0x155f,0x1809)]=![],_0x175756['chatModify'](_0x49785d,_0x5cd288[_0x23937d(0x118c,0xae2,0x1744,0x573)],[])[_0x23937d(0x1b61,0x1353,0x1173,0x1ce0)](_0x4f0e5d=>_0x1db05d(jsonformat(_0x4f0e5d)))[_0x313705(0xc9a,0x544,0x17f5,0x1698)](_0x33f9b3=>_0x1db05d(jsonformat(_0x33f9b3)));}else{if(_0x4b485e[_0x23937d(0x1212,0x16bb,0x1ee3,0x19a8)](_0x1ba32f[0xad*0x2f+0x1cae+-0x1*0x3c71],_0x4b485e[_0x313705(0x1fe7,0x248d,0x2d70,0x1cc9)])){if(_0x4b485e[_0x313705(0x786,0xfa6,0xa33,0x1624)](_0x4b485e['bVMLv'],_0x23937d(0x12b5,0x415,0x1f66,0x1625))){const _0x44dcc3={};_0x44dcc3[_0x313705(0x209f,0x156d,0x1fa2,0x26cf)]=''+_0x4050df[_0x23937d(0x19aa,0x112a,0xc12,0x1c96)];const _0x6b1025={};_0x6b1025[_0x313705(0x942,-0x19f,0xd22,0xe7)]=_0x22d2be,_0x4307de[_0x313705(0xcaa,0xd0a,0x1328,0x1218)+'e'](_0xd0427f[_0x313705(0x14f2,0x17c9,0x11d3,0xae7)],_0x44dcc3,_0x6b1025),_0x305802=_0x3be092[_0x23937d(0x13bd,0x2041,0x500,0x217e)+'nc'](_0x23937d(0xb1b,0x1055,-0x195,0x1232)+'AllData/st'+_0x23937d(0x3fb,0x2ea,-0x3c7,0xad6)+_0x313705(0x89b,0x8ff,0x251,-0x566));const _0x275c7d={};_0x275c7d[_0x313705(0x1360,0xe65,0xc6c,0xf4d)]=_0x4d19be,_0xf05752[_0x23937d(0x944,0x197,0xec4,0x159a)+'e'](_0x323c7b[_0x23937d(0x118c,0x593,0x12fb,0x1f16)],_0x275c7d);}else{const _0x376f21={};_0x376f21['id']=_0x5cd288[_0x23937d(0x5dc,-0x8f4,0xcd9,0x131)]['id'],_0x376f21[_0x313705(0x50c,-0x425,0xdf4,0x129c)]=!![];const _0x230374={};_0x230374[_0x23937d(0xde4,0xa10,0xdc2,0x794)]=_0x376f21;const _0xa77fd1={};_0xa77fd1['clear']=_0x230374,_0x175756['chatModify'](_0xa77fd1,_0x5cd288[_0x23937d(0x118c,0x1dfb,0x9a3,0x551)],[])[_0x23937d(0x1b61,0x1850,0x288f,0x24d8)](_0x299230=>_0x1db05d(jsonformat(_0x299230)))['catch'](_0x3e785c=>_0x1db05d(jsonformat(_0x3e785c)));}}}}}}}}}break;case _0x23937d(0x5ab,0x99d,-0x916,-0x684):{if(_0x4b485e[_0x313705(0xeb1,0xc2f,0x10bc,0x27c)](_0x4b485e[_0x23937d(-0x15,0x786,-0x6ad,0xebc)],_0x4b485e['cCPlw'])){if(_0x1bac1f)return _0x4b485e[_0x313705(0x1a99,0x2915,0x21bb,0x2443)](_0x1db05d,mess[_0x23937d(0x61c,0x81,0xca0,0x443)]);if(_0x1e03f5)return _0x4b485e[_0x23937d(0x1157,0x2bb,0x1283,0x873)](_0x1db05d,mess[_0x313705(0x926,-0x45d,0xca8,0xece)]);if(_0x4b485e[_0x313705(0x7d6,0x16de,-0x747,0x773)](_0x313705(0x911,0x1df,0x7f9,0x858)+_0x5cd288[_0x313705(0x14f2,0x733,0x1322,0x1c91)],_family100)){if(_0x4b485e[_0x23937d(0xe57,0x1d0,0x824,0x97)](_0x4b485e[_0x23937d(0xad7,0x520,0x381,0x13b6)],_0x4b485e['YKpWB'])){const _0xbcd086={};_0xbcd086['archive']=!![],_0x279c04[_0x23937d(0xb85,0x1693,0x461,0x230)](_0xbcd086,_0x2ce327['chat'],[])['then'](_0x325ac0=>_0x4a4989(_0x50c101(_0x325ac0)))[_0x23937d(0x934,-0x443,0x302,0x199)](_0x1913be=>_0x1d8dd5(_0x256e75(_0x1913be)));}else _0x4b485e[_0x23937d(0x1b00,0x1f80,0x1b1e,0x1372)](_0x1db05d,_0x4b485e['nlKTr']),_0x4b485e['DsBUJ'](_0x1db05d,![]);}let _0x5055b2=await _0x4b485e[_0x23937d(0x25c,0xe32,0xd54,0x84a)](fetchJson,_0x4b485e['kXHxN']),_0x1d41b4=_0x5055b2[Math[_0x313705(0xb57,0x138f,0x1809,0x18ed)](_0x4b485e['CyQEK'](Math[_0x313705(0x1ae0,0x294a,0x1b59,0x1cd3)](),_0x5055b2[_0x23937d(0x3de,0x6a,0x951,0xfc3)]))],_0x21f958=(_0x23937d(0x1dfa,0x2bfe,0x1405,0x2953)+'e\x20Followin'+_0x23937d(0xe10,0x1496,0x16dc,0x1ae8)+_0x23937d(0xfd7,0x1979,0x88c,0xd4d)+_0x1d41b4[_0x313705(0x1c8e,0x23ee,0x18a9,0x20c8)]+(_0x23937d(0x7bf,-0x3cd,0xea1,-0x51)+'\x20*')+_0x1d41b4[_0x313705(0x1cb4,0x1d78,0x1e52,0x171d)][_0x313705(0x744,-0x619,-0x3c8,-0x2b3)]+'*\x20Answer\x20'+(_0x1d41b4[_0x313705(0x1cb4,0x2774,0x16fd,0x137f)][_0x313705(0x1a2b,0x1d61,0x1dea,0x1c64)](_0x5a39ce=>_0x5a39ce[_0x313705(0x4de,0x7bb,-0x25e,0x159)]('\x20'))?'(Some\x20Answ'+_0x23937d(0x14b1,0xc9b,0x928,0x1ea1)+_0x313705(0x1bdc,0x1b3f,0x2731,0x2a29):''))['trim']();_family100[_0x4b485e[_0x313705(0xce3,0x44d,0x17a,0x536)]('family100',_0x5cd288[_0x313705(0x14f2,0x220a,0x15f9,0xb7c)])]={'id':_0x4b485e[_0x23937d(0x1637,0x117a,0x1afd,0x1c1f)]+_0x5cd288[_0x313705(0x14f2,0x124f,0xa8d,0x229a)],'pesan':await _0x175756['sendText'](_0x5cd288['chat'],_0x21f958,_0x5cd288),..._0x1d41b4,'terjawab':Array['from'](_0x1d41b4[_0x313705(0x1cb4,0x1e74,0xf2e,0x2a79)],()=>![]),'hadiah':0x6};}else return _0x313705(0x36c,0xd,0x3e0,-0xa48);}break;case _0x4b485e['xxeRU']:case _0x4b485e[_0x313705(0x1872,0x183e,0x9e4,0xc78)]:case'huluh':case _0x4b485e[_0x23937d(0x1195,0x15eb,0x154f,0x29f)]:case _0x23937d(0x1980,0x1f89,0x259f,0x19a0):if(_0x1bac1f)return _0x4b485e[_0x313705(0x1fe4,0x2331,0x12e8,0x2b2d)](_0x1db05d,mess[_0x313705(0x982,0xf4e,0xb74,0x1688)]);if(_0x1e03f5)return _0x4b485e[_0x313705(0xb74,0x590,0x2fd,0x1297)](_0x1db05d,mess[_0x313705(0x926,0x1093,0x6ff,0xb9b)]);if(!_0x5cd288['quoted']&&!_0x494254)return _0x516d85('Send/Reply'+_0x23937d(0xf9a,0x1c0f,0xc26,0x9e0)+'\x20Caption\x20'+(_0xe1d953+_0x1354e9));ter=_0x1354e9[-0x48*0x31+0x1*0x7b7+0x612]['toLowerCas'+'e'](),tex=_0x5cd288[_0x313705(0x942,0x4d9,0x15e1,0xf80)]?_0x5cd288[_0x23937d(0x5dc,0x1482,0x99a,0x661)][_0x23937d(0x1d39,0x1d7e,0x1850,0x19cb)]?_0x5cd288[_0x23937d(0x5dc,0xb8e,-0x937,-0x828)][_0x313705(0x209f,0x1d8e,0x1cb0,0x2886)]:q?q:_0x5cd288['text']:q?q:_0x5cd288[_0x23937d(0x1d39,0x1b0b,0x121c,0x17af)],_0x1db05d(tex[_0x313705(0x1bd8,0x1105,0x27d0,0x12a2)](/[aiueo]/g,ter)['replace'](/[AIUEO]/g,ter['toUpperCas'+'e']()));break;case _0x4b485e[_0x313705(0x94a,0x134a,0xb72,0x111c)]:{if(_0x1bac1f)return _0x4b485e['Jjbgs'](_0x1db05d,mess[_0x23937d(0x61c,0x356,0x5a9,0x27)]);if(_0x1e03f5)return _0x4b485e[_0x23937d(0x1c,0xbba,0x36e,0xc7b)](_0x1db05d,mess[_0x313705(0x926,0x117b,0x1355,0x526)]);if(!_0x1ba32f[_0x23937d(0x1c16,0x1182,0x118a,0x10c6)]('\x20'))return _0x4b485e[_0x23937d(0x101f,0x268,0x1b83,0xd87)](_0x516d85,'Example\x20:\x20'+_0x4b485e['hqnRK'](_0xe1d953,_0x1354e9)+(_0x23937d(0x784,0xd84,0x469,0x1127)+_0x23937d(0xc68,0x1780,0x1555,-0x292)+_0x23937d(0x1025,0x1de,0xb63,0x1c99)+'ture\x0a3.\x20sa'+_0x23937d(0xedf,0x13b5,0xbf5,0x14c7)+_0x313705(0x8c7,-0x3c5,0x1c6,0xc91)+'lyrics\x0a6.f'+_0x23937d(0xddf,0xc83,0xb5a,0xf1)));if(_0x4b485e['KjqLs'](_0x1ba32f[-0x1*-0x787+-0xfd1+0x84a],_0x313705(0x90b,-0x2e5,0x141c,0x11e4))){if(_0x4b485e[_0x313705(0x3ea,0x12c,-0x2f6,-0x3c6)]('mJsRT',_0x313705(0xcc9,0x1706,0x16ce,0x642))){const _0x50e4fa={};_0x50e4fa['cRBQT']=_0x4b485e['fGdSx'];const _0x27376f=_0x50e4fa,_0x1b6f10={};_0x1b6f10[_0x313705(0x209f,0x2330,0x1b9a,0x1426)]=_0x23937d(0x816,-0x605,0x93b,0xdf8)+_0x23937d(0x1026,0x1681,0x164c,0xef3)+_0x23937d(0x10bd,0x1822,0x1b49,0x1177)+_0x23937d(0x1dd9,0x1c95,0x1a0c,0x219e)+'ᴘʟᴏᴀᴅɪɴɢ..'+_0x23937d(0x8a0,0x155f,0x3f5,-0x361)+'EO\x20📱\x0a╚════'+_0x313705(0x1846,0x1c59,0x1581,0xe25)+'══';const _0x517bb8={};_0x517bb8['quoted']=_0x3c723d,_0x17bc39[_0x23937d(0x944,-0x403,0x1840,0xc66)+'e'](_0x59cbca[_0x23937d(0x118c,0x523,0x6cf,0xdb8)],_0x1b6f10,_0x517bb8);let _0xf757a=_0x4b485e[_0x23937d(0x4d8,0xe7,0x121e,0x916)](_0x246da5,_0x4b485e[_0x23937d(0xcbd,0x97d,0x1865,0x263)]);_0xf757a[_0x23937d(0xb09,0x4be,0xe37,0x9af)](''+_0x2cb046)[_0x313705(0x1ec7,0x2dcf,0x2591,0x1c71)](async _0x4f8264=>{const _0x1ef3e0={};function _0x29a988(_0x36a497,_0x4df7b1,_0x570b9f,_0x348235){return _0x23937d(_0x36a497-0x368,_0x4df7b1,_0x570b9f-0x100,_0x348235-0xd4);}_0x1ef3e0[_0x4e803f(0x17e8,0xaf,0xf07,0x1067)]=_0x4f8264['url'][0xd7+-0x2*0x869+-0xffb*-0x1]['url'];const _0x189fd0={};_0x189fd0[_0x4e803f(0x23d8,0x237a,0x1bf0,0x12b3)]=_0x1ef3e0,_0x189fd0[_0x4e803f(0xd46,0x2597,0x1738,0xd55)]=_0x27376f[_0x29a988(0x1c87,0xf45,0x208d,0x186e)];const _0x43840a={};function _0x4e803f(_0x54f9f5,_0x536cd7,_0x31c403,_0x173b48){return _0x23937d(_0x31c403-0x48e,_0x536cd7,_0x31c403-0x1c,_0x173b48-0x112);}_0x43840a[_0x4e803f(0x16bf,0x12aa,0xa6a,0x1078)]=_0x7bf620,_0x2f70d2[_0x29a988(0xcac,0xeee,0x245,0x1169)+'e'](_0x845ac4['chat'],_0x189fd0,_0x43840a);})[_0x23937d(0x934,0x1791,0x1182,0x133b)](_0x5844dd=>{function _0x5ac1ef(_0x4665f4,_0x3d9a4a,_0x402381,_0xe98686){return _0x313705(_0xe98686- -0x161,_0x4665f4,_0x402381-0x195,_0xe98686-0x108);}function _0x448a14(_0x258e1b,_0x23ee16,_0x436472,_0x4994e2){return _0x23937d(_0x23ee16-0x50e,_0x4994e2,_0x436472-0x96,_0x4994e2-0x9a);}_0x4b485e[_0x5ac1ef(0x1df4,0x1115,0x1531,0x189f)](_0x26e597,'⚠️\x20Please\x20i'+'nsert\x20a\x20va'+_0x448a14(0x770,0xefd,0x1a97,0x1dc3)+'!');});}else{if(tebaklagu[_0x313705(0xe35,0x8d6,0x352,0x13)+_0x313705(0x1386,0x1adc,0x1de3,0xfea)](_0x5cd288[_0x313705(0x1834,0x1460,0x1ead,0x1834)]['split']('@')[0x67*0x3b+0x3*-0x82f+-0x1a*-0x8]))return _0x4b485e[_0x23937d(0xba,-0x96d,0x8e7,0xc91)](_0x516d85,_0x313705(0x1275,0x782,0x803,0x11bb)+_0x313705(0x18b2,0x1539,0x2007,0x1ae8)+_0x23937d(0x1490,0x62b,0x1058,0x19a6)+_0x23937d(0x110,0xf03,-0x66c,0x195));let _0x18371d=await _0x4b485e['pyDZR'](fetchJson,_0x4b485e[_0x313705(0xbd7,-0xc1,0xef5,0x7ed)]),_0x4439e9=_0x18371d[Math[_0x23937d(0x7f1,0xfcd,0xcc5,-0x323)](_0x4b485e[_0x313705(0x891,0x309,-0x481,0x764)](Math[_0x23937d(0x177a,0x1b3d,0x13bf,0xebe)](),_0x18371d['length']))];const _0x13e71e={};_0x13e71e[_0x23937d(0xa79,0x18c7,0x15bc,0x10ac)]=_0x4439e9['link_song'];const _0x491a9f={};_0x491a9f[_0x313705(0x168e,0xcb0,0x2149,0x219c)]=_0x13e71e,_0x491a9f[_0x23937d(0x12aa,0x1aad,0x607,0xf7a)]=_0x313705(0x211c,0x25c0,0x2e6a,0x292a);let _0x78f923=await _0x175756[_0x313705(0xcaa,0x185f,-0x12b,0x12e6)+'e'](_0x5cd288['chat'],_0x491a9f,{'quoted':_0x5cd288});_0x175756['sendText'](_0x5cd288['chat'],'What\x20is\x20th'+_0x313705(0xa09,-0x40a,0x441,0x1fc)+_0x23937d(0xb14,0x10bb,0x1444,0x145c)+_0x313705(0x615,-0x2f1,0xf8d,0x13f1)+'\x20'+_0x4439e9['artist']+(_0x23937d(0xc43,0x1013,0xd1c,-0x1bb)+'s'),_0x78f923)[_0x23937d(0x1b61,0xd69,0x2a7f,0x1249)](()=>{function _0x2f03af(_0x292471,_0x1772e8,_0x58ac1d,_0x44ef30){return _0x23937d(_0x1772e8-0xad,_0x58ac1d,_0x58ac1d-0xb4,_0x44ef30-0x1a2);}function _0x2ae0f3(_0x2bceab,_0x4e6f31,_0xa2fe3b,_0x2d96be){return _0x313705(_0xa2fe3b-0x1b6,_0x4e6f31,_0xa2fe3b-0xb,_0x2d96be-0x1e4);}tebaklagu[_0x5cd288[_0x2f03af(0x1615,0x157b,0x1f96,0xbbd)][_0x2ae0f3(0x73f,0x1eaf,0x11eb,0x20ce)]('@')[-0xbc*-0x1+0x40f*0x2+-0x8da]]=_0x4439e9[_0x2ae0f3(0x1e2d,0x156b,0x1e6a,0x2937)][_0x2f03af(0x81a,0x778,-0x560,0x4c3)+'e']();}),await sleep(-0x10f3*0x11+0x95e*-0xc+0xd*0x30d7);if(tebaklagu[_0x313705(0xe35,0xaa3,0x1bfe,0x169c)+_0x23937d(0x1020,0x18df,0x1064,0x132a)](_0x5cd288[_0x23937d(0x14ce,0x108a,0x1f7b,0x18d3)][_0x23937d(0xccf,0x18f,0x1001,0xdf)]('@')[-0x38b*0xb+0x1deb+0x90e])){console[_0x23937d(0xbc6,0x1482,0x1969,-0x2c6)](_0x4b485e[_0x313705(0x10d6,0xaa0,0x1705,0xc1a)]+_0x4439e9[_0x313705(0x1cb4,0x2b8a,0x290e,0x25e3)]);const _0xc5ff79={};_0xc5ff79[_0x23937d(0x1b0c,0x2328,0x2187,0x141f)]=_0x4b485e[_0x313705(0xcd3,0x78a,0xc45,0xe3e)],_0xc5ff79[_0x313705(0x1902,0x230e,0x1bf2,0x2247)]={},_0xc5ff79['type']=0x1,_0xc5ff79[_0x313705(0x1902,0x230e,0x1bf2,0x2247)]['displayTex'+'t']=_0x4b485e[_0x313705(0x1e82,0x181a,0x1d16,0x1f8d)],_0x175756[_0x313705(0xb3e,0x9e4,0x1275,0x80f)+_0x23937d(0x111a,0x140a,0x908,0x10d2)](_0x5cd288['chat'],[_0xc5ff79],_0x313705(0xd12,0x14fd,0x8d1,0x3c8)+_0x23937d(0x14b6,0xb67,0xfc4,0x1bfb)+_0x23937d(0x124,0xe45,-0x10a,-0x46e)+tebaklagu[_0x5cd288[_0x313705(0x1834,0xd99,0xba5,0x2409)][_0x313705(0x1035,0xd31,0x1d50,0x612)]('@')[-0x2*0x57a+-0x15a3+0x2097]]+('\x0a\x0aWant\x20to\x20'+'play?\x20pres'+_0x313705(0x1402,0xe3b,0xbe5,0x2235)+_0x23937d(0x17b6,0x1e98,0x997,0x134a)),''+global[_0x313705(0xcd2,0x228,0xa10,0x457)],_0x5cd288),delete tebaklagu[_0x5cd288[_0x313705(0x1834,0xf53,0xd45,0x1481)][_0x313705(0x1035,0x1f6,0x503,0x7b1)]('@')[0x1533*-0x1+-0xb6a*-0x2+0x1a1*-0x1]];}}}else{if(_0x4b485e[_0x313705(0xe91,0x1a5f,0x962,0x19bb)](_0x1ba32f[-0x1975+0x1e74+-0x4ff],_0x313705(0x7d1,0x1359,-0x4b6,0xd09))){if(tebakgambar[_0x23937d(0xacf,0x188b,0x1362,-0x17a)+_0x313705(0x1386,0x93c,0x1fff,0xc41)](_0x5cd288[_0x23937d(0x14ce,0x712,0x1888,0x11bd)]['split']('@')[0xed1+0x4*0x6cb+-0x3*0xdff]))return _0x516d85(_0x4b485e[_0x23937d(0x140e,0xcac,0x143d,0x1df8)]);let _0x4d1f3b=await _0x4b485e[_0x313705(0xe88,0x77b,0x2f4,0x15b0)](fetchJson,_0x4b485e[_0x23937d(0x16ce,0x15df,0x2295,0x9e9)]),_0x37849c=_0x4d1f3b[Math[_0x313705(0xb57,0x71f,0x4db,0xb2c)](_0x4b485e['iYuSI'](Math[_0x313705(0x1ae0,0x1a4c,0x1f5b,0x276b)](),_0x4d1f3b['length']))];_0x175756['sendImage'](_0x5cd288[_0x23937d(0x118c,0x1c0b,0xf41,0x1738)],_0x37849c[_0x313705(0x1705,0x1d4f,0xfca,0x2142)],_0x23937d(0x1cba,0xe9e,0x224a,0xee5)+'wer\x20the\x20qu'+'estion\x20abo'+'ve\x0a\x0aDescri'+_0x23937d(0x96a,0xb16,-0x366,0x287)+_0x37849c[_0x313705(0xf86,0x1bb6,0x33e,0x1a84)]+(_0x23937d(0xc43,0xf44,-0x270,0x110c)+'s'),_0x5cd288)[_0x313705(0x1ec7,0x2257,0x1574,0x2a29)](()=>{function _0x580972(_0x58d97d,_0xdb158e,_0x45b85d,_0x286991){return _0x23937d(_0xdb158e-0x2b6,_0x58d97d,_0x45b85d-0x13,_0x286991-0x1ef);}function _0xe2486e(_0x18ec6e,_0x3f76cf,_0x65a573,_0x325be0){return _0x23937d(_0x18ec6e-0x56c,_0x65a573,_0x65a573-0x1e7,_0x325be0-0x5f);}if(_0x4b485e[_0x580972(0x1c9a,0x157c,0x1580,0x1b35)](_0xe2486e(0x22df,0x2f86,0x27a7,0x1d7d),_0x4b485e['BVrkx'])){_0x59e8b5=-0x1003+0x24+0xef*0x11,_0x3e7694=_0x4b485e[_0x580972(0x248e,0x1c3e,0x1bc0,0x168c)];for(let _0xb05fbe of _0x4209fc){_0x2311a5+=0x15cf*0x1+-0x1f3*0x5+-0x3f*0x31,_0x39f02f+=_0xe2486e(0x1eb7,0x1c6d,0x1816,0x1e40)+_0x373584[_0x580972(0x8e8,0x1453,0x1b8d,0xe8a)]()+_0x580972(-0x17e,0xb47,0x490,0x17d),_0x19c9f4+=_0xe2486e(0xb3c,-0x314,0xab5,0x556)+_0xb05fbe['berita']+'\x0a',_0x95d0+=_0x580972(0x15e3,0x837,0x190,-0x578)+_0xb05fbe['berita_diu'+'pload']+'\x0a',_0x169ac3+=_0xe2486e(0x662,0x83d,0x1195,-0x38a)+_0xb05fbe[_0xe2486e(0x1518,0xb23,0x21cf,0x153d)]+'\x0a';}_0x2fa5a4+=_0x4b485e['dBfFs'];const _0x34641b={};_0x34641b[_0xe2486e(0xfe5,0x178b,0x98e,0x10c7)]=_0xcc9dc0[-0x1606+0x8*-0x2b0+0x741*0x6]['berita_thu'+'mb'];const _0x5ef3de={};_0x5ef3de[_0x580972(0x1cdc,0x1ef9,0x1025,0x246e)]=_0x34641b,_0x5ef3de[_0xe2486e(0xed4,0xd5a,0x1c2,0x700)]=_0x3f5e67;const _0x1c329d={};_0x1c329d[_0xe2486e(0xb48,0xecb,0x10b,0x38a)]=_0x166ddb,_0x57fe18[_0xe2486e(0xeb0,0x698,0xd46,0x1285)+'e'](_0x2ce48f['chat'],_0x5ef3de,_0x1c329d);}else tebakgambar[_0x5cd288[_0xe2486e(0x1a3a,0x1622,0x1a37,0x266f)]['split']('@')[-0x1af7+0x1*0x30+0x1ac7]]=_0x37849c['jawaban'][_0xe2486e(0xc37,0x7f5,0x14d4,0xb9b)+'e']();}),await _0x4b485e[_0x23937d(0x1198,0x139f,0xaa4,0x13ff)](sleep,0x9c99+0x1c40a*0x1+-0x3*0x7cc1);if(tebakgambar[_0x313705(0xe35,0xd36,0x12e7,0x1427)+_0x313705(0x1386,0x85f,0xb38,0x170e)](_0x5cd288[_0x313705(0x1834,0x191c,0x20db,0xf21)]['split']('@')[-0xcd6+-0x1*0x1fdf+0x2cb5])){console['log'](_0x4b485e[_0x23937d(0x3bf,0x6df,-0xa3e,0xd80)](_0x4b485e[_0x313705(0x10d6,0x1db6,0x1bb6,0x1b58)],_0x37849c['jawaban']));const _0x152d5b={};_0x152d5b[_0x313705(0x1e72,0x1903,0x15b2,0x23ad)]=_0x4b485e[_0x23937d(0x10f2,0x16c0,0x1f84,0xc02)],_0x152d5b[_0x313705(0x1902,0x20b6,0x1deb,0x159c)]={},_0x152d5b['type']=0x1,_0x152d5b[_0x313705(0x1902,0x20b6,0x1deb,0x159c)][_0x313705(0x175a,0x1d44,0x221b,0x9db)+'t']=_0x4b485e['WwfNI'],_0x175756[_0x23937d(0x7d8,-0x84,0x1641,0x6bf)+_0x23937d(0x111a,0xcc4,0x30b,0x4e6)](_0x5cd288[_0x23937d(0x118c,0x1334,0x1328,0x39a)],[_0x152d5b],_0x313705(0xd12,0x22,0x1a49,0x13a1)+'un\x20out\x0aAns'+_0x313705(0x48a,-0x55d,0xa05,0x120)+tebakgambar[_0x5cd288['sender'][_0x313705(0x1035,0x17f2,0x348,0xe42)]('@')[-0x25*-0x2f+0xa*-0x37d+0x8d*0x33]]+(_0x313705(0xaf2,0x1964,0x1243,0x1796)+_0x313705(0xee3,0x1da1,0x2c5,0x189e)+_0x313705(0x1402,0x14ba,0x578,0x2089)+_0x23937d(0x17b6,0x2581,0xc5e,0x17b4)),''+global[_0x23937d(0x96c,0x146e,0x52e,-0x3fe)],_0x5cd288),delete tebakgambar[_0x5cd288[_0x23937d(0x14ce,0x9c4,0x1bdb,0xe98)][_0x23937d(0xccf,0x185,0x167c,0x12b4)]('@')[0x1808+-0x1ffc+0x2*0x3fa]];}}else{if(_0x4b485e[_0x313705(0xbac,0x9cf,0x18a4,0x1319)](_0x1ba32f[0x1310+0x1366+-0x2676],_0x4b485e[_0x23937d(0x10e4,0x1cdd,0x11f8,0x15c7)])){if(tebakkata['hasOwnProp'+'erty'](_0x5cd288['sender'][_0x313705(0x1035,0x24d,0x5c7,0x507)]('@')[0x1*-0x17b6+-0x1f*-0x1d+0x1433]))return _0x4b485e[_0x313705(0xe34,0x2e1,0x61b,0xce)](_0x516d85,_0x4b485e[_0x313705(0x1774,0x12b2,0x9b6,0x1e6e)]);let _0x9a849f=await fetchJson(_0x4b485e['ZdjgY']),_0x356dfd=_0x9a849f[Math[_0x23937d(0x7f1,0x3a2,0x413,0x359)](_0x4b485e[_0x23937d(0x18b0,0x10a1,0x1522,0x196a)](Math[_0x313705(0x1ae0,0x2263,0x1ab6,0x1a4f)](),_0x9a849f[_0x313705(0x744,0xcd7,0x148,0x401)]))];_0x175756[_0x23937d(0x1574,0x98d,0x2017,0xd1d)](_0x5cd288[_0x313705(0x14f2,0x1478,0x12fa,0x14b4)],_0x313705(0x2020,0x29ae,0x1812,0x25a3)+_0x313705(0x504,0xce7,0x16a,0x1339)+_0x313705(0x5ff,0x68a,-0x7a6,0x564)+'estion\x0a\x0a'+_0x356dfd['soal']+(_0x23937d(0xc43,0x1484,0xe64,0x18f4)+'s'),_0x5cd288)[_0x313705(0x1ec7,0x2646,0x1208,0x2527)](()=>{function _0x528593(_0x5ef826,_0x4db58b,_0x558af6,_0x41c2a3){return _0x23937d(_0x4db58b-0x503,_0x5ef826,_0x558af6-0x177,_0x41c2a3-0x1ef);}function _0x4b5e10(_0x2dfa24,_0x42b69d,_0x49b657,_0x220621){return _0x313705(_0x2dfa24-0x216,_0x49b657,_0x49b657-0x90,_0x220621-0x94);}tebakkata[_0x5cd288['sender'][_0x528593(0x742,0x11d2,0x524,0x2035)]('@')[-0x53*0x6+0x157f+-0x138d]]=_0x356dfd[_0x528593(0x2a42,0x1e51,0x1a2c,0x2576)][_0x528593(0x97e,0xbce,0x531,0xc40)+'e']();}),await _0x4b485e[_0x23937d(0x1300,0x11ae,0xc5a,0x1180)](sleep,0x1abb3+0x2e*0x17+-0x1*0xc575);if(tebakkata[_0x23937d(0xacf,0x1865,0x129a,0x51a)+_0x313705(0x1386,0x13af,0x1c00,0x1ff9)](_0x5cd288[_0x23937d(0x14ce,0x2006,0x1562,0x2212)][_0x313705(0x1035,0x101e,0xaaa,0x1357)]('@')[-0x8*0x198+0x179e+-0xade])){console[_0x23937d(0xbc6,0xc38,0xd6b,0x1a9c)](_0x4b485e[_0x23937d(0xd70,0x96e,0x1271,0xe5e)]+_0x356dfd[_0x313705(0x1cb4,0x157b,0x22a8,0x2532)]);const _0x27e3e3={};_0x27e3e3[_0x23937d(0x13f4,0x142b,0x1f32,0x132c)+'t']=_0x313705(0x11ce,0x836,0x4f8,0x586)+_0x23937d(0x273,0x1008,0x13,0x145);const _0x3e860b={};_0x3e860b[_0x23937d(0x1b0c,0x1fc5,0x26a5,0x2773)]=_0x4b485e[_0x313705(0x10a3,0x11c9,0x1e00,0xc82)],_0x3e860b[_0x313705(0x1902,0xe60,0x10d4,0xfe2)]=_0x27e3e3,_0x3e860b[_0x313705(0xa9e,-0x8,0x12d4,0x4d3)]=0x1,_0x175756[_0x313705(0xb3e,0x1508,0x4b7,0xb5a)+'Text'](_0x5cd288[_0x23937d(0x118c,0x2af,0x1f9b,0xaed)],[_0x3e860b],_0x313705(0xf11,0x1221,0x19be,0x1b79)+_0x313705(0x1c1f,0xd6f,0x2020,0x148a)+tebakkata[_0x5cd288[_0x23937d(0x14ce,0xc18,0x8c1,0x1efb)][_0x313705(0x1035,0x2ae,0x15d5,0x9df)]('@')[-0x206d+0x13c+0x1f31]]+('\x0a\x0aWant\x20to\x20'+'play?\x20pres'+_0x23937d(0x109c,0x19e6,0x169c,0x1ea1)+_0x313705(0x1b1c,0x2203,0x20d6,0x2526)),''+global[_0x313705(0xcd2,0x1b0e,0x0,-0x2)],_0x5cd288),delete tebakkata[_0x5cd288[_0x313705(0x1834,0x16bf,0x177f,0x17a9)]['split']('@')[0x3*-0x927+0x913*-0x3+-0x123a*-0x3]];}}else{if(_0x1ba32f[-0xedb*-0x2+-0x475*-0x2+-0x26a0]===_0x4b485e[_0x313705(0x1191,0x17cb,0x976,0x3ad)]){if(tebakkalimat[_0x313705(0xe35,0x1174,0x38d,0x702)+_0x313705(0x1386,0x79f,0x20c6,0x187b)](_0x5cd288[_0x23937d(0x14ce,0x12d7,0x6c3,0xa18)]['split']('@')[-0x43f*0x5+0x11ba*0x2+-0xb*0x14b]))return _0x4b485e['XHFGn'](_0x516d85,_0x313705(0x1275,0x1ac1,0xa4f,0xbae)+_0x313705(0x18b2,0x1e52,0xe3d,0x127a)+'nished\x20ses'+_0x23937d(0x110,0x479,-0xdb7,-0xcf8));let _0xb98b97=await fetchJson('https://ra'+_0x23937d(0x1f7,0x1061,-0x272,0x7b9)+_0x313705(0x53f,0xd1a,0x7e1,0x742)+_0x313705(0x144d,0x124b,0x22fd,0x2285)+_0x313705(0x1baf,0x213b,0x2412,0x2a51)+_0x23937d(0x1bc3,0x2626,0x293e,0x2183)+'TheSentenc'+'e.js'),_0x12467f=_0xb98b97[Math['floor'](Math['random']()*_0xb98b97[_0x313705(0x744,0x90c,0x30,0x1046)])];_0x175756['sendText'](_0x5cd288[_0x313705(0x14f2,0x23b5,0x195c,0xf0a)],_0x23937d(0x1cba,0x2af5,0x2a3d,0x2a58)+_0x313705(0x504,0x483,0xdf7,0x2ea)+_0x23937d(0x299,0x66d,-0x60,0xc76)+'estion\x0a\x0a'+_0x12467f[_0x23937d(0x1928,0x11c3,0x1750,0x17bc)]+(_0x23937d(0xc43,0x19f8,0x12a0,0x1050)+'s'),_0x5cd288)[_0x23937d(0x1b61,0x2390,0x14f5,0x145c)](()=>{function _0x4a239e(_0x34ccc2,_0x31c3d1,_0x25ec0b,_0x1eccf8){return _0x313705(_0x34ccc2-0x11b,_0x1eccf8,_0x25ec0b-0x40,_0x1eccf8-0x150);}function _0x37d5dc(_0xd43278,_0x304b4d,_0x298743,_0x16fad3){return _0x313705(_0x304b4d- -0x220,_0x16fad3,_0x298743-0x1cb,_0x16fad3-0x51);}tebakkalimat[_0x5cd288[_0x37d5dc(0x8ad,0x1614,0x768,0x1ad1)][_0x37d5dc(0x1a82,0xe15,-0x51,0x18f0)]('@')[0x135e+-0x10fe+-0x130*0x2]]=_0x12467f['jawaban'][_0x37d5dc(0x2,0x811,0xabb,0x1117)+'e']();}),await sleep(-0x1*0xbdf7+-0x4254+0x1eaab);if(tebakkalimat[_0x313705(0xe35,0x1c66,-0x95,0x593)+'erty'](_0x5cd288[_0x313705(0x1834,0xbda,0xd9f,0x1095)][_0x313705(0x1035,0x1c69,0x91c,0x606)]('@')[-0x2*0x1093+0x5*-0x135+0x272f])){if(_0x4b485e[_0x313705(0x10dc,0x11fb,0x75c,0x1d1e)](_0x313705(0x1af1,0x15ff,0x10ad,0x1097),_0x4b485e[_0x313705(0x82a,-0x8b,0x122f,0xd0f)])){let _0x54d346=_0x3b3ccb['keys'](_0x16b8af['db'][_0x313705(0x117d,0x534,0xfb5,0x11bd)]['users']),_0x5208de=_0x4f3c6d?_0x4c84ef[_0x23937d(0x614,-0x723,0xaca,0x30)][_0x313705(0x8cf,-0x23f,0x8ad,0x102a)]:_0x400e9f[_0x23937d(0x614,0x684,0xd3f,-0x50c)]['free'];for(let _0x2a7387 of _0x54d346)_0x1fb8c4['db'][_0x313705(0x117d,0xf2a,0xbea,0x1cbe)][_0x313705(0x1b7c,0x2233,0x2107,0x1a89)][_0x2a7387][_0x313705(0x7b5,0x959,0x358,0xa92)]=_0x5208de;_0x37c0c8['log'](_0x4b485e[_0x313705(0x1bbf,0x25c6,0x26bc,0x2149)]);}else{console[_0x23937d(0xbc6,-0x306,0x740,0x563)](_0x4b485e[_0x23937d(0xd70,0x92f,0x4a0,0x881)]+_0x12467f[_0x23937d(0x194e,0x14cc,0x1390,0x25bc)]);const _0xc604b2={};_0xc604b2[_0x313705(0x175a,0x10d9,0x2364,0x1862)+'t']=_0x4b485e['VYulw'];const _0x14e445={};_0x14e445['buttonId']=_0x313705(0x205d,0x21ae,0x1d2d,0x2cf8)+'ence',_0x14e445[_0x313705(0x1902,0x2251,0xfeb,0x134b)]=_0xc604b2,_0x14e445[_0x23937d(0x738,-0x555,-0x48e,0x1374)]=0x1,_0x175756[_0x23937d(0x7d8,-0x5a4,0xe97,0xc5d)+_0x23937d(0x111a,0xbe4,0x1a89,0x1e1c)](_0x5cd288[_0x313705(0x14f2,0x224a,0x9a9,0x170b)],[_0x14e445],_0x23937d(0xbab,0xcf,0x69a,0xef)+_0x313705(0x1c1f,0x27bb,0xda0,0x2644)+tebakkalimat[_0x5cd288[_0x23937d(0x14ce,0x119b,0x98a,0x126f)]['split']('@')[0x21*0x92+-0x3*-0xccf+0xf*-0x3d1]]+(_0x313705(0xaf2,0x723,0xa55,0x1372)+'play?\x20pres'+'s\x20the\x20butt'+'on\x20below'),''+global[_0x313705(0xcd2,0x216,0xc56,0x1aab)],_0x5cd288),delete tebakkalimat[_0x5cd288['sender'][_0x23937d(0xccf,0x18ae,0x114a,0x98b)]('@')[0xa37*0x3+-0x329*-0xc+-0x4491]];}}}else{if(_0x1ba32f[-0xca0+0x1*-0xe5+-0xd85*-0x1]===_0x313705(0xebf,0xa71,0x37b,0x69d)){if(_0x4b485e[_0x23937d(0x1d7e,0x1ca9,0x1628,0x111a)]===_0x4b485e['BllMN']){if(_0x3be3f7)return _0x437bf5(_0x3f4f1d[_0x313705(0x982,0x102d,0x441,0x1474)]);if(_0x56a141)return _0x4b485e[_0x313705(0x454,0x114a,0x273,-0xa2c)](_0xe14455,_0x55dd70[_0x23937d(0x5c0,0x13a7,0x10ee,0xe94)]);const _0x22bdf6={};_0x22bdf6['mentionedJ'+'id']=[_0x43973b['sender']];const _0x426bf7={};_0x426bf7[_0x23937d(0x5dc,-0x892,-0x277,-0xf4)]=_0x4f1c80,_0x4f9598[_0x313705(0xcaa,0x8a6,0xdb4,0x137b)+'e'](_0x5100d0['chat'],{'text':'@'+_0xd9e3d7[_0x23937d(0x14ce,0xcec,0x98f,0x1f16)][_0x23937d(0xccf,0x6f2,0x11d7,0x50f)]('@')[-0xb6d+0x7*0x4f8+0x1*-0x175b],'contextInfo':_0x22bdf6},_0x426bf7);}else{if(tebaklirik[_0x313705(0xe35,0x6fe,0x44b,0x1e2)+_0x313705(0x1386,0xf31,0x14a8,0x126b)](_0x5cd288[_0x313705(0x1834,0x1ede,0xba7,0xb8d)][_0x23937d(0xccf,-0x1e3,0x2aa,0xec7)]('@')[0x3*-0x3c1+-0x249f+0x552*0x9]))return _0x4b485e[_0x23937d(0x107d,0xc9b,0x1722,0x13bf)](_0x516d85,_0x4b485e[_0x313705(0x1774,0x2459,0x265e,0x1f2b)]);let _0x28ff46=await fetchJson(_0x23937d(0x1854,0x1a68,0x1c2b,0x1b19)+_0x313705(0x55d,0x373,-0x325,-0x1aa)+_0x23937d(0x1d9,-0x5b3,0x319,0xa1c)+_0x23937d(0x165,0x71a,0x13d,-0x27b)+_0x23937d(0x98b,-0x334,-0xfb,0x1239)+_0x23937d(0x1c98,0x193d,0x207b,0x2074)+_0x313705(0xdac,0x60b,0x15f5,0xafd)+'ames/tebak'+_0x313705(0x1437,0x87b,0x116f,0x10bd)),_0x2e4c67=_0x28ff46[Math[_0x23937d(0x7f1,0x162c,0xfa0,0xbff)](_0x4b485e[_0x313705(0x14cd,0x1532,0x18d7,0xe98)](Math[_0x313705(0x1ae0,0x1f5f,0x2723,0x1ba0)](),_0x28ff46[_0x23937d(0x3de,-0x315,-0x5aa,0xb84)]))];_0x175756[_0x23937d(0x1574,0x2235,0x1406,0x1f69)](_0x5cd288[_0x313705(0x14f2,0x165c,0x1df1,0x1226)],_0x23937d(0xe1e,0xade,0x191a,0x5f6)+_0x23937d(0x480,-0x8c8,0x74e,0x297)+_0x313705(0x1da0,0x1317,0x2933,0x1b7d)+_0x313705(0x17bb,0x1f82,0x21f8,0x1fc8)+_0x2e4c67[_0x313705(0x1c8e,0x1a43,0x192f,0x24cd)]+(_0x23937d(0xe1f,0xf14,0x1a49,0x6f6)+'60s'),_0x5cd288)['then'](()=>{function _0x572dd4(_0x190fca,_0x30972d,_0x2e0366,_0x3f4397){return _0x313705(_0x2e0366- -0x1a7,_0x30972d,_0x2e0366-0xb1,_0x3f4397-0x6b);}function _0x33d5e8(_0x3ab83f,_0xcc9239,_0x29a4bc,_0xea2830){return _0x23937d(_0xcc9239-0xcf,_0xea2830,_0x29a4bc-0xec,_0xea2830-0xa);}if(_0x4b485e[_0x33d5e8(0x2150,0x1be6,0x1f12,0x130d)](_0x4b485e[_0x572dd4(0x14cc,0x17a1,0x1591,0x19c1)],_0x4b485e[_0x33d5e8(0xb14,0x14a1,0x1c70,0xb5c)]))tebaklirik[_0x5cd288[_0x33d5e8(0x1caa,0x159d,0x1c56,0x2296)]['split']('@')[-0x15+0x1*-0x19fc+-0x1a11*-0x1]]=_0x2e4c67[_0x33d5e8(0xe3e,0x1a1d,0x1936,0x1998)]['toLowerCas'+'e']();else return _0x4b485e[_0x572dd4(0x725,0x9fe,0x8c4,0x30)];}),await sleep(0x24*-0x95f+0x7ace+0x1c0ee);if(tebaklirik[_0x23937d(0xacf,-0x1ef,0x17e0,0x1286)+_0x313705(0x1386,0x630,0x18c3,0x19d2)](_0x5cd288['sender'][_0x313705(0x1035,0x1ce9,0xc7d,0x1c5b)]('@')[0xe53+0x1*-0x1c5d+0xe0a])){if(_0x4b485e[_0x23937d(0xee4,0x19dd,0x87,0xa2c)]!==_0x4b485e[_0x313705(0x124a,0xa16,0x6e9,0x834)]){const _0x3b9c5b={};_0x3b9c5b[_0x313705(0x209f,0x1b75,0x2033,0x201b)]=''+_0x4e5bb2[_0x313705(0x1668,0x19bb,0x1e6b,0x24e3)];const _0x24f506={};_0x24f506[_0x23937d(0x5dc,0xf31,0xefd,0x8ae)]=_0xc4f824,_0x3899bf['sendMessag'+'e'](_0x2a5af3[_0x313705(0x14f2,0x194d,0xe75,0x2078)],_0x3b9c5b,_0x24f506);}else{console[_0x23937d(0xbc6,-0xc1,0x11ce,0xcfc)](_0x4b485e[_0x313705(0xfe0,0xc6a,0x1501,0x1d71)](_0x4b485e[_0x313705(0x10d6,0x1684,0x14ac,0xe15)],_0x2e4c67[_0x23937d(0x194e,0x2809,0x252c,0x1d1f)]));const _0x514f9d={};_0x514f9d[_0x313705(0x1e72,0x1831,0x2a7f,0x2a3a)]=_0x4b485e[_0x23937d(0x14ec,0x15c5,0x1437,0xb85)],_0x514f9d[_0x313705(0x1902,0x19a9,0x1453,0x2315)]={},_0x514f9d[_0x23937d(0x738,0xba7,0x10fe,0x2f6)]=0x1,_0x514f9d[_0x313705(0x1902,0x19a9,0x1453,0x2315)][_0x23937d(0x13f4,0x1e87,0x19ce,0xbbc)+'t']=_0x4b485e[_0x313705(0x71b,0x245,0x11ee,0x35d)],_0x175756[_0x313705(0xb3e,0x1695,0x1501,0x1535)+_0x23937d(0x111a,0xe3f,0xbe5,0x48e)](_0x5cd288[_0x23937d(0x118c,0x111b,0x436,0xea9)],[_0x514f9d],_0x23937d(0xbab,-0x51,-0xbf,0x306)+'nswer:\x20\x20'+tebaklirik[_0x5cd288[_0x313705(0x1834,0x1cb4,0x26ce,0x21bc)][_0x313705(0x1035,0x150,0x17a,0x1ad2)]('@')[-0x151*-0x11+-0x313+-0x134e]]+(_0x23937d(0x78c,0x94c,0x6aa,0xfa0)+_0x23937d(0xb7d,0x1487,0xc33,-0x1ad)+_0x313705(0x1402,0x1996,0xb4a,0xd4f)+_0x23937d(0x17b6,0x177e,0x18df,0x1943)),''+global['botname'],_0x5cd288),delete tebaklirik[_0x5cd288[_0x23937d(0x14ce,0x16b4,0x19c7,0x5c7)][_0x23937d(0xccf,0x1be5,0xa12,0x666)]('@')[0x8a9*-0x3+0x7ba*-0x1+0x21b5]];}}}}else{if(_0x4b485e[_0x23937d(0x2dc,-0x47c,-0x398,-0x718)](_0x1ba32f[-0x2078+0x3f*-0x75+0x3d43],_0x4b485e[_0x313705(0x14b5,0xeaf,0x235c,0x14fa)])){if(_0x4b485e[_0x23937d(0x113,0xdb3,-0x54c,0x948)]!==_0x4b485e[_0x313705(0xa7d,0xc98,0x9c,0x79)]){if(caklontong['hasOwnProp'+_0x313705(0x1386,0x1bd4,0x103d,0x210c)](_0x5cd288[_0x23937d(0x14ce,0xfad,0xf23,0xe94)][_0x23937d(0xccf,0x1212,0x12a6,-0x5d)]('@')[-0x1594*0x1+0x1*-0xf48+0x24dc]))return _0x4b485e[_0x313705(0xa42,0x480,0x157,0x100d)](_0x516d85,_0x23937d(0xf0f,0x17d3,0xe9d,0xb7a)+_0x313705(0x18b2,0x2544,0xa6a,0x267a)+_0x313705(0x17f6,0x159b,0x1764,0x1fac)+'sions!');let _0x12f977=await fetchJson(_0x4b485e[_0x313705(0xdd0,0x18be,0x18fb,0x1461)]),_0x30a2e7=_0x12f977[Math['floor'](_0x4b485e['DKitz'](Math[_0x313705(0x1ae0,0x27a7,0x1567,0x1c07)](),_0x12f977[_0x313705(0x744,0x83,0xb35,-0x6d)]))];_0x175756[_0x23937d(0x1574,0xb3f,0x7a6,0x187a)](_0x5cd288[_0x23937d(0x118c,0x41b,0x1d80,0x1138)],_0x313705(0x185b,0xe9f,0x163c,0xefc)+_0x23937d(0x186d,0x11b3,0x1c08,0x1d21)+_0x23937d(0x102,0x0,0x8f1,0x8ed)+_0x23937d(0xfd7,0x10ab,0x185a,0x1ea9)+_0x30a2e7[_0x313705(0x1c8e,0xf6b,0x1ff0,0xe83)]+(_0x313705(0x43b,0x28f,-0xad2,-0x3b7)+'0s'),_0x5cd288)[_0x23937d(0x1b61,0x16bd,0x26ce,0x271c)](()=>{function _0x90ccbe(_0x58c03d,_0x150d8c,_0x3a9a0b,_0x362c08){return _0x23937d(_0x362c08-0x271,_0x58c03d,_0x3a9a0b-0xe0,_0x362c08-0x16c);}caklontong[_0x5cd288[_0x90ccbe(0x1d7d,0xdd6,0x17ba,0x173f)]['split']('@')[-0x1882+-0x3*-0x403+0xc79]]=_0x30a2e7[_0x90ccbe(0x1b33,0x2a47,0x1438,0x1bbf)][_0x481c09(0xb33,0x53d,0xa23,-0x895)+'e']();function _0x481c09(_0x54e7c5,_0xe5a236,_0x473d59,_0x346ccd){return _0x313705(_0xe5a236- -0x4f4,_0x54e7c5,_0x473d59-0x7e,_0x346ccd-0x4a);}caklontong_desk[_0x5cd288[_0x481c09(0xad4,0x1340,0x1adb,0x1efb)][_0x481c09(0xb94,0xb41,-0x3c5,-0x309)]('@')[0xf32+-0xd*0x167+0x309]]=_0x30a2e7['deskripsi'];}),await _0x4b485e[_0x23937d(0x18be,0xf21,0x1486,0x26c9)](sleep,0x1d111+-0x1c503+0x1436*0xb);if(caklontong[_0x23937d(0xacf,0xf49,0x6f1,0x1844)+'erty'](_0x5cd288[_0x313705(0x1834,0x1d94,0x1662,0xa68)][_0x313705(0x1035,0x1920,0x680,0x8ef)]('@')[0x1*0x851+-0x1e2b+0x15da])){console[_0x23937d(0xbc6,0x5cd,0x12d2,0x106e)](_0x4b485e[_0x23937d(0x134b,0x193c,0x55f,0xed1)](_0x4b485e['brOoY'],_0x30a2e7[_0x313705(0x1cb4,0x2815,0x1cd7,0x2ba4)]));const _0x4cbb09={};_0x4cbb09[_0x313705(0x175a,0x1ea7,0x215d,0xe0e)+'t']=_0x313705(0x11ce,0x1298,0x109d,0x1ff4)+'Saying';const _0x4e1ae4={};_0x4e1ae4['buttonId']=_0x4b485e[_0x23937d(0x114f,0x79a,0xd86,0x191b)],_0x4e1ae4['buttonText']=_0x4cbb09,_0x4e1ae4[_0x23937d(0x738,-0x4f1,0x603,0x1060)]=0x1,_0x175756[_0x23937d(0x7d8,-0x684,0x1251,-0x487)+'Text'](_0x5cd288[_0x23937d(0x118c,0x43c,0xc09,0x1ffc)],[_0x4e1ae4],_0x313705(0xf11,0x117a,0x11db,0x864)+_0x313705(0x1c1f,0x26a2,0x26a9,0x14e2)+caklontong[_0x5cd288[_0x23937d(0x14ce,0x23e6,0x976,0x2271)][_0x313705(0x1035,0x571,0x1cb8,0x1999)]('@')[-0x88e+0x44*0x1+0x84a]]+(_0x23937d(0x18,-0x6bc,-0x812,-0x93f)+_0x313705(0xd69,0xa1b,0x16df,-0xe4))+caklontong_desk[_0x5cd288[_0x313705(0x1834,0xbbf,0x1123,0xcd0)][_0x313705(0x1035,0x112b,0x13c2,0x14f)]('@')[-0xe*0x1ba+0x7f*-0x8+0x1c24]]+(_0x313705(0xaf2,0x3e0,0x91e,-0x394)+_0x23937d(0xb7d,0x2a9,0x12b4,0x6a4)+_0x313705(0x1402,0x15c1,0x22c4,0x227c)+_0x313705(0x1b1c,0x183e,0x26ec,0x201a)),''+global[_0x313705(0xcd2,-0x2a,0x1685,0xefd)],_0x5cd288),delete caklontong[_0x5cd288[_0x23937d(0x14ce,0x1313,0x1ebb,0x9c0)][_0x313705(0x1035,0xd00,0xc06,0x14c9)]('@')[-0x923+-0xb*-0x59+0x550]],delete caklontong_desk[_0x5cd288[_0x23937d(0x14ce,0x2262,0x18c4,0xcb3)][_0x313705(0x1035,0xd12,0xdcd,0x1e19)]('@')[0x1f46*0x1+0x1e71+-0x8d1*0x7]];}}else{let _0x32233c;try{const _0xf75596=whUOZw[_0x23937d(0x169a,0x1be9,0x9d3,0xea4)](_0x1d8208,whUOZw['Ufuey']('return\x20(fu'+_0x23937d(0x1595,0x1c5d,0xc78,0x225c)+whUOZw['BdGMS'],');'));_0x32233c=whUOZw[_0x23937d(0x993,0x46d,-0x3d7,0x12ae)](_0xf75596);}catch(_0x481c91){_0x32233c=_0x25c4f5;}const _0x23883d=_0x32233c['console']=_0x32233c['console']||{},_0x5c8c39=[whUOZw[_0x313705(0x1c48,0x1dc9,0x189d,0x2658)],whUOZw[_0x313705(0x20be,0x25f3,0x1f70,0x15d3)],_0x313705(0x20e7,0x16be,0x2b28,0x1640),whUOZw[_0x313705(0x1a6c,0xe94,0x1aae,0xe09)],'exception',_0x23937d(0x110f,0x4ee,0xf68,0x2b8),whUOZw[_0x23937d(0x18bb,0x1a6f,0x1795,0x1917)]];for(let _0x267dee=-0xc8f+-0x4c7*-0x7+-0x14e2;whUOZw[_0x313705(0xbdb,0x809,0x17f0,-0x2b6)](_0x267dee,_0x5c8c39[_0x23937d(0x3de,-0xa02,0x9c0,-0x649)]);_0x267dee++){const _0x1431e6=_0x1a789d[_0x313705(0x14ba,0x1784,0x1c8d,0x171d)+'r'][_0x23937d(0x6fb,0xd0c,0xe6f,0xbdd)][_0x23937d(0xd19,0x1bf,0xa7e,0x82f)](_0x30c472),_0x6c544f=_0x5c8c39[_0x267dee],_0x108567=_0x23883d[_0x6c544f]||_0x1431e6;_0x1431e6[_0x313705(0x7dc,-0x718,-0x144,0x1b7)]=_0x4f2664['bind'](_0x5bedf1),_0x1431e6[_0x23937d(0x119d,0x3bf,0x4eb,0x1d42)]=_0x108567['toString'][_0x23937d(0xd19,0x55e,0x298,0x336)](_0x108567),_0x23883d[_0x6c544f]=_0x1431e6;}}}}}}}}}break;case _0x4b485e[_0x23937d(0x1107,0x1724,0x199c,0x1757)]:{if(_0x1bac1f)return _0x1db05d(mess[_0x313705(0x982,-0xbe,0x266,0xd8)]);if(_0x1e03f5)return _0x4b485e[_0x23937d(0x1448,0x1948,0x1986,0x2327)](_0x1db05d,mess[_0x23937d(0x5c0,0x1481,0x60e,0xd4)]);_0x175756['sendMessag'+'e'](_0x5cd288[_0x23937d(0x118c,0x1ae8,0x1add,0x1e6a)],_0x4fe8e5);}break;case'kuismath':case _0x4b485e['ixKoj']:{if(_0x23937d(0x7b5,-0x602,-0x3c0,0x1132)===_0x4b485e[_0x23937d(0x17bc,0x1475,0x1953,0x1dea)]){const _0x3fb748={};_0x3fb748[_0x23937d(0x1d39,0x2bcb,0x29f0,0x18be)]='📱',_0x3fb748[_0x23937d(0x94f,0xfe3,0x13d1,0x89b)]=_0x2a3739[_0x313705(0xcb5,0x6d2,0xdbd,0x12c3)];const _0x115702={};_0x115702[_0x23937d(0x19ba,0x2513,0x22c8,0x1640)]=_0x3fb748,_0xb864fe[_0x23937d(0x944,0x3b2,0x184c,0x146f)+'e'](_0x236efe,_0x115702);const _0x42946={};_0x42946[_0x23937d(0xa79,0x308,0x13bc,0x16e)]=_0x4b485e[_0x23937d(0x1c90,0x17e1,0x19eb,0xe46)];const _0x20c69a={};_0x20c69a[_0x23937d(0x1c43,0x11ea,0x2372,0x1b82)]=_0x42946;const _0x358a2e={};_0x358a2e[_0x23937d(0x968,0xed5,0x12cc,0x92d)]=_0x4b485e[_0x313705(0x2007,0x17fd,0x1b12,0x28b3)];const _0x1eddea={};_0x1eddea['quoted']=_0x275d20,_0x562f0d[_0x313705(0xcaa,0x13ea,0x17db,0xb1c)+'e'](_0x50ed22[_0x23937d(0x118c,0x32a,0x1394,0x136c)],_0x20c69a,_0x358a2e,_0x1eddea);}else{if(_0x1bac1f)return _0x4b485e[_0x23937d(0x188a,0x165d,0x10e3,0xd61)](_0x1db05d,mess[_0x23937d(0x61c,-0x122,0x171,0xa3b)]);if(_0x1e03f5)return _0x4b485e[_0x23937d(0x4d4,-0x8fc,-0xa28,0x1350)](_0x1db05d,mess[_0x313705(0x926,0x3f2,0x1,0x1318)]);if(kuismath[_0x23937d(0xacf,0x1423,0x381,0x101)+_0x23937d(0x1020,0x748,0x182d,0x1ab6)](_0x5cd288[_0x23937d(0x14ce,0x1eca,0x8c4,0xc06)][_0x23937d(0xccf,0x1874,0x1363,0x11d2)]('@')[0x591+0x18d0+0x65*-0x4d]))return _0x4b485e[_0x23937d(0x1a5d,0x2636,0x2626,0xfc2)](_0x516d85,_0x23937d(0x8b6,0x65d,0xd35,0x1721)+'Still\x20Unfi'+'nished\x20Ses'+_0x23937d(0x110,-0x91e,-0x495,-0x708));let {genMath:_0x5e701e,modes:_0x158568}=_0x4b485e[_0x23937d(0x1e0b,0x146a,0x13f7,0x1dab)](require,_0x4b485e['brXmq']);if(!_0x494254)return _0x516d85(_0x313705(0x197c,0x27ed,0x2218,0x236d)+Object['keys'](_0x158568)[_0x313705(0x1f7c,0x1a87,0x24b5,0x26f6)](_0x4b485e['nkXZx'])+(_0x313705(0xc67,0xb1f,0x58d,0x7a8)+'les:\x20')+_0xe1d953+(_0x313705(0xab5,0x17ba,0x19a1,0x1906)+'m'));let _0x3793b6=await _0x5e701e(_0x494254[_0x23937d(0x6cb,0xfd8,0x13b8,0x12a5)+'e']());_0x175756[_0x313705(0x18da,0xb78,0x1b11,0x2489)](_0x5cd288[_0x23937d(0x118c,0x752,0x4c1,0x1a77)],'*What\x20Is\x20T'+_0x313705(0x5e7,0x14e1,0x5f1,0x1378)+_0x313705(0x1244,0x2126,0x1e74,0x3c5)+_0x3793b6[_0x23937d(0x1928,0x1a8a,0xc47,0x212d)]['toLowerCas'+'e']()+_0x313705(0xdf8,0xcce,0x151e,0x4a8)+_0x4b485e[_0x313705(0x15d8,0x15c3,0x14f0,0xefe)](_0x3793b6[_0x23937d(0x189a,0x1c27,0x26b3,0x2647)],0x11af+0x39+-0xe00)[_0x23937d(0x896,0x300,0x1418,0xfee)](-0x1*-0x23f5+0x270*0xf+-0x4883)+_0x313705(0x1e48,0x24a1,0x2a7e,0x10f2),_0x5cd288)[_0x23937d(0x1b61,0x1147,0x1cce,0x1a52)](()=>{function _0x560ecc(_0x5b53b0,_0x36edb4,_0x42b83b,_0x245c51){return _0x313705(_0x245c51- -0x333,_0x42b83b,_0x42b83b-0xe6,_0x245c51-0x63);}function _0x3bf91a(_0x528f53,_0x4d7b60,_0x3a0769,_0x1a28a2){return _0x313705(_0x3a0769-0x96,_0x1a28a2,_0x3a0769-0x16,_0x1a28a2-0x129);}const _0x26e614={};_0x26e614['cIBRs']=_0x4b485e[_0x3bf91a(0x1087,0x8fe,0xb01,0xfb5)];const _0x5897b7=_0x26e614;if(_0x4b485e[_0x3bf91a(0x304d,0x2821,0x2183,0x1888)]===_0x4b485e['pEYpR'])return _0x5897b7[_0x560ecc(-0xab4,-0x3a,-0x294,0x88)];else kuismath[_0x5cd288[_0x560ecc(0xad3,0x1da2,0xc11,0x1501)][_0x3bf91a(0x1c03,0x131d,0x10cb,0xef7)]('@')[-0x4*0x1+0xd81*-0x2+0x1b06]]=_0x3793b6['jawaban'];}),await _0x4b485e[_0x23937d(0x1088,0x1e56,0x1f91,0x11d7)](sleep,_0x3793b6[_0x313705(0x1c00,0x190a,0x197e,0x1f23)]),kuismath[_0x23937d(0xacf,0x111f,0xbed,0x19d1)+_0x313705(0x1386,0xd16,0x108d,0x57b)](_0x5cd288[_0x313705(0x1834,0x1e1e,0x166f,0x1b48)][_0x23937d(0xccf,0x10cb,0xf93,0x1822)]('@')[0x280+-0xd15+0x3*0x387])&&(console[_0x23937d(0xbc6,0x10c6,0x5b2,0x1a3a)](_0x4b485e['ZkrXt'](_0x4b485e[_0x23937d(0xd70,0xd5f,0x148c,0x1022)],_0x3793b6[_0x23937d(0x194e,0x1f24,0x17ff,0x2774)])),_0x4b485e['nFhmp'](_0x1db05d,_0x4b485e[_0x23937d(0x17c8,0x23e1,0x1cfd,0x25ed)](_0x4b485e[_0x313705(0xdd9,0x758,0x17ed,0x1abe)],kuismath[_0x5cd288[_0x23937d(0x14ce,0x1d20,0x5b9,0x18e6)][_0x23937d(0xccf,0x695,0xd8f,0x1967)]('@')[-0x1e76+-0x2510+0x4386]])),delete kuismath[_0x5cd288[_0x23937d(0x14ce,0x1719,0x219a,0x13b5)][_0x313705(0x1035,0xbc4,0x1a7,0x8c9)]('@')[0x3*-0x1eb+0x6df+-0x11e]]);}}break;case _0x4b485e[_0x23937d(0x1d53,0x2a31,0x2a3f,0xe5a)]:{if(_0x4b485e[_0x313705(0x1c75,0x276b,0x246a,0x1623)]('Foayy',_0x4b485e[_0x23937d(0xfa8,0x3e2,0x13a7,0x1dd2)])){if(_0x1bac1f)return _0x4b485e[_0x313705(0x1cda,0x22ae,0x103f,0x23dc)](_0x1db05d,mess[_0x313705(0x982,0x793,0x12e9,0x510)]);if(_0x1e03f5)return _0x1db05d(mess[_0x313705(0x926,0x1013,0x387,0xf38)]);if(!_0x5cd288[_0x313705(0x2089,0x2972,0x1a3f,0x1ff4)])return _0x516d85(''+mess[_0x23937d(0x11c6,0x1c49,0x16b4,0x1d43)]);let _0x3e2329=_0x2e12a2[_0x23937d(0xb16,0x162a,0x72e,0xd76)](_0x662b74=>_0x662b74['id']),_0x479e89=_0x5cd288[_0x23937d(0x14ce,0xc8f,0x1fb4,0xadb)],_0x192fd5=_0x3e2329[Math['floor'](_0x4b485e[_0x313705(0x1697,0x22df,0xe94,0x202d)](Math[_0x23937d(0x177a,0x1336,0xff7,0x1d91)](),_0x3e2329['length']))],_0x14d127=_0x23937d(0x451,-0x486,0x31f,0x117c)+'h\x20Is\x0a\x0a@'+_0x479e89['split']('@')[0x1*0x1529+-0xcc5+-0x864]+_0x23937d(0x1a24,0x189a,0x249b,0x15b7)+_0x192fd5[_0x23937d(0xccf,0xadc,0x169c,0x1167)]('@')[-0x44*0x77+0x313+-0x5b5*-0x5],_0x4cb950=[_0x479e89,_0x192fd5];const _0x42bb5e={};_0x42bb5e[_0x23937d(0x13f4,0x511,0x1c74,0x1535)+'t']='❤️';const _0xe9ad7c={};_0xe9ad7c[_0x313705(0x1e72,0x13e4,0x2216,0x2197)]='❤️',_0xe9ad7c[_0x313705(0x1902,0x264f,0x21cf,0x23f6)]=_0x42bb5e,_0xe9ad7c['type']=0x1;let _0xe60a97=[_0xe9ad7c];const _0x2e59f8={};_0x2e59f8[_0x313705(0x1cce,0x1c7c,0x1a81,0x195a)]=_0x4cb950,await _0x175756[_0x23937d(0x7d8,0x15eb,0x105,0x509)+_0x313705(0x1480,0xe31,0x8fb,0xefa)](_0x5cd288[_0x23937d(0x118c,0x1127,0x6f9,0x1861)],_0xe60a97,_0x14d127,_0x175756[_0x23937d(0x421,0x76a,0xc3,-0x404)][_0x23937d(0x1451,0x18be,0x1d69,0x1d5b)],_0x5cd288,_0x2e59f8);}else{const _0x18c84a=_0x4b485e[_0x313705(0x20f9,0x16fa,0x17e6,0x280b)]['split']('|');let _0x3c2238=-0x44*0x44+-0x1*0x15af+-0x7f3*-0x5;while(!![]){switch(_0x18c84a[_0x3c2238++]){case'0':_0x1983f9[_0x23937d(0x1431,0x16ec,0x679,0x653)+_0x313705(0x7a4,0x1579,0x57e,0x120c)](_0x2da937[_0x23937d(0x118c,0xd5d,0x1371,0x2002)]);continue;case'1':if(!_0x38e112)return _0x4b485e['tsCbA'](_0x2d7832,_0x261d3c[_0x313705(0x1419,0x21b4,0x10fb,0x1006)]);continue;case'2':if(!_0x211106['isGroup'])return _0x4b485e[_0x313705(0x1a97,0x28ea,0x2679,0x1d28)](_0x14f325,_0x6dc7f8['group']);continue;case'3':if(_0x45eb3f)return _0xb9c621(_0x59227e[_0x23937d(0x61c,-0x3a3,-0x341,-0x7ca)]);continue;case'4':if(_0x4b485e[_0x23937d(0x7fd,-0x70,0x656,-0x5b7)](!_0x4762ba,!_0x489f4f))return _0x4b485e['hKwbW'](_0x30833c,_0x1a2b97[_0x313705(0x1818,0x10ab,0xe82,0xaf2)]);continue;case'5':if(_0x437252)return _0x4b485e[_0x23937d(0x2b9,0xf5,0x1190,0xa9b)](_0x4ccc12,_0x1747a0[_0x23937d(0x5c0,0xd72,0x10a8,0xb39)]);continue;}break;}}}break;case _0x4b485e['rYDBl']:{if(_0x1bac1f)return _0x4b485e[_0x313705(0x1ed1,0x1791,0x169d,0x26d0)](_0x1db05d,mess['ban']);if(_0x1e03f5)return _0x4b485e[_0x23937d(0x17f1,0xf94,0x1628,0x244a)](_0x1db05d,mess['banChat']);if(!_0x5cd288['isGroup'])return _0x4b485e['YDCrJ'](_0x516d85,''+mess[_0x23937d(0x11c6,0x472,0x1bd5,0x921)]);let _0x535d76=_0x2e12a2[_0x313705(0xe7c,0x75b,0xf58,0x1715)](_0x312cce=>_0x312cce['id']),_0xb789ec=_0x535d76[Math['floor'](_0x4b485e[_0x23937d(0x1b4e,0x28a9,0xed6,0x2222)](Math['random'](),_0x535d76[_0x23937d(0x3de,0x990,0x970,-0x67a)]))],_0x244612=_0x535d76[Math['floor'](_0x4b485e[_0x313705(0x1a9b,0x186b,0x298b,0xc36)](Math[_0x313705(0x1ae0,0x2651,0x241e,0x1bba)](),_0x535d76[_0x313705(0x744,0x13b7,0x1005,0xf67)]))],_0x3e4343='@'+_0xb789ec[_0x313705(0x1035,0xc53,0x3df,0xec8)]('@')[0x133*-0x18+0xd7f+0xf49]+_0x23937d(0x1a24,0x1936,0xe51,0x1f19)+_0x244612[_0x313705(0x1035,0xc73,0x1ead,0x1a23)]('@')[-0x1652*-0x1+0x35*0x27+-0x1e65]+('\x0aCieeee,\x20W'+_0x313705(0x89a,-0x1ae,0x1098,0xfb5)+_0x23937d(0x149f,0x18c0,0xce2,0x15b1)),_0x447752=[_0xb789ec,_0x244612];const _0x36a059={};_0x36a059[_0x313705(0x175a,0x25b4,0x263a,0xb2f)+'t']='❤️';const _0x4e1a61={};_0x4e1a61[_0x313705(0x1e72,0x19fd,0x2658,0x1515)]='❤️',_0x4e1a61[_0x313705(0x1902,0x1108,0x1529,0x1806)]=_0x36a059,_0x4e1a61[_0x313705(0xa9e,0x155a,0xbdb,-0x2d1)]=0x1;let _0x2df61a=[_0x4e1a61];const _0x3addf3={};_0x3addf3[_0x23937d(0x1968,0x2314,0x1d3c,0x1234)]=_0x447752,await _0x175756[_0x23937d(0x7d8,0x86e,-0x59,0x99)+_0x23937d(0x111a,0xee9,0x627,0x943)](_0x5cd288[_0x313705(0x14f2,0x645,0x22af,0x19d1)],_0x2df61a,_0x3e4343,_0x175756[_0x313705(0x787,0x435,0x7de,-0x295)][_0x313705(0x17b7,0x1d67,0x1146,0x111e)],_0x5cd288,_0x3addf3);}break;case'is':if(global[_0x23937d(0x1acc,0x112c,0x2062,0xff0)]===_0x4b485e[_0x23937d(0x1910,0x1d94,0xb69,0x1b9e)])return;if(_0x1bac1f)return _0x4b485e[_0x23937d(0x1b2f,0x2041,0x2143,0x1df4)](_0x1db05d,mess['ban']);if(_0x1e03f5)return _0x4b485e[_0x313705(0x1ab8,0xd92,0x247a,0xed5)](_0x1db05d,mess[_0x23937d(0x5c0,0x133,0xa0,-0x5cb)]);if(!_0x494254)return _0x4b485e[_0x313705(0x17d4,0x9fe,0x14fc,0x1b84)](_0x516d85,_0x23937d(0x1765,0x1b80,0xa0c,0xc28)+_0x23937d(0xda5,0x19f1,0x164f,0x5c3)+(_0xe1d953+_0x1354e9)+(_0x313705(0x179e,0x1bc9,0x1917,0x1eb6)+'d\x20'));const _0x54acf2=[_0x23937d(0x14d0,0xf89,0xc27,0x7b0),'No','It\x20Could\x20B'+'e','Thats\x20righ'+'t'],_0x2350d9=_0x54acf2[Math['floor'](_0x4b485e['Qqluz'](Math['random'](),_0x54acf2[_0x313705(0x744,0x14ad,0x490,0xce)]))],_0x3cd22b={};_0x3cd22b[_0x313705(0x209f,0x26af,0x2a9e,0x2d56)]=_0x23937d(0x15e6,0x1ede,0xb2f,0x1b3e)+_0x313705(0xf04,0x4bd,0xd75,0x1183)+q+'\x0aAnswer\x20:\x20'+_0x2350d9;const _0xfe87d9={};_0xfe87d9['quoted']=_0x5cd288,_0x175756[_0x23937d(0x944,-0x4f9,-0x524,0x141b)+'e'](_0x423161,_0x3cd22b,_0xfe87d9);break;case _0x4b485e[_0x23937d(0x1a82,0x19f8,0x1a11,0x1bb1)]:if(_0x4b485e[_0x23937d(0x198f,0x1d52,0x25d5,0x271b)](global[_0x313705(0x1e32,0x2750,0x131c,0x1362)],_0x4b485e['UBZUB']))return;if(_0x1bac1f)return _0x4b485e['jaCqB'](_0x1db05d,mess[_0x23937d(0x61c,0x13f1,0xec6,0xc87)]);if(_0x1e03f5)return _0x4b485e['QxqXt'](_0x1db05d,mess[_0x313705(0x926,0x18f,0x170f,-0x1ff)]);if(!_0x494254)return _0x4b485e[_0x23937d(0xfd9,0x14bc,0x10fd,0x1069)](_0x516d85,_0x313705(0x1acb,0x2429,0x2322,0x1cd2)+_0x313705(0x110b,0xd7f,0xb4b,0x145a)+_0x4b485e[_0x313705(0x1636,0x9fc,0xea5,0x821)](_0xe1d953,_0x1354e9)+(_0x313705(0x179e,0xc51,0xbb9,0x14b3)+'d\x20'));const _0x46db7d=[_0x313705(0x15b1,0x14c8,0x1ff8,0x11a0)+'f','I\x20Dont\x20Kno'+'w',_0x313705(0xff2,0x17a6,0x83a,0x123)+_0x23937d(0x1046,0x1a3d,0x1a77,0x1769)+'ur\x20Father'],_0x33cc0e=_0x46db7d[Math[_0x23937d(0x7f1,0x93c,0xc36,0xbbc)](_0x4b485e[_0x23937d(0x1832,0x13f2,0x12ee,0xb1b)](Math[_0x313705(0x1ae0,0x1f46,0x28a2,0x15d0)](),_0x46db7d[_0x313705(0x744,0xbd,-0x249,0xbae)]))],_0x1f1fce={};_0x1f1fce['text']=_0x23937d(0x15e6,0xb5e,0x727,0x896)+_0x23937d(0x197d,0x1946,0x212b,0x1b56)+q+'\x0aAnswer\x20:\x20'+_0x33cc0e;const _0x64d175={};_0x64d175['quoted']=_0x5cd288,_0x175756[_0x313705(0xcaa,0x841,0x5f8,0xdd)+'e'](_0x423161,_0x1f1fce,_0x64d175);break;case _0x4b485e[_0x313705(0xf53,0x17e1,0x138e,0x9d)]:if(global[_0x23937d(0x1acc,0x16c3,0x2627,0x29e9)]==='false')return;if(_0x1bac1f)return _0x4b485e[_0x23937d(0x7f5,0xcb2,0xfd4,0x242)](_0x1db05d,mess[_0x23937d(0x61c,0xccc,0x8d6,0xe6b)]);if(_0x1e03f5)return _0x1db05d(mess[_0x23937d(0x5c0,0x140c,-0x71d,-0x931)]);if(!_0x494254)return _0x516d85(_0x23937d(0x1765,0x255a,0xae7,0x25ac)+_0x313705(0x110b,0x12ed,0x1316,0x1580)+(_0xe1d953+_0x1354e9)+(_0x313705(0xf35,0x52e,0x95d,0xc4b)+'her\x20lol\x20'));const _0x383ee7=[_0x313705(0x1523,0x2165,0x2078,0x1e1f),'Can\x27t','Cannot','Of\x20Course\x20'+'You\x20Can!!!'],_0x2e6564=_0x383ee7[Math['floor'](_0x4b485e[_0x23937d(0x1d38,0x2094,0x1579,0x1c48)](Math[_0x313705(0x1ae0,0xd2a,0x1e83,0xfe4)](),_0x383ee7[_0x313705(0x744,0x739,-0x67f,-0x7a)]))],_0x28f71c={};_0x28f71c[_0x23937d(0x1d39,0x2bdc,0x23e9,0xf84)]=_0x313705(0x194c,0x21fc,0x20d9,0x2292)+_0x23937d(0x10f4,0x625,0x61d,0xac1)+q+_0x313705(0xd3f,0x14b5,0xc7c,0x782)+_0x2e6564;const _0x1ab2a4={};_0x1ab2a4[_0x313705(0x942,0xcd5,0x16d3,0xebe)]=_0x5cd288,_0x175756[_0x313705(0xcaa,0x172a,0x1b21,0x12d8)+'e'](_0x423161,_0x28f71c,_0x1ab2a4);break;case _0x4b485e[_0x23937d(0x526,0x2ee,0xaff,0xb78)]:if(global[_0x23937d(0x1acc,0x2218,0x2432,0x1378)]===_0x313705(0x51f,-0x477,0xee1,-0x6f0))return;if(_0x1bac1f)return _0x4b485e[_0x23937d(0xa2e,0xc02,0x28a,0x1938)](_0x1db05d,mess[_0x313705(0x982,0xead,-0x1d,0x82f)]);if(_0x1e03f5)return _0x1db05d(mess[_0x313705(0x926,0xad9,0x15d1,0x17de)]);if(!_0x494254)return _0x516d85(_0x23937d(0x1765,0x22ee,0x2438,0x193d)+_0x23937d(0xda5,0x386,0x1542,0xd3b)+_0x4b485e[_0x23937d(0x358,0x16a,0xfe5,0xb2d)](_0xe1d953,_0x1354e9)+(_0x313705(0x2169,0x18a8,0x13d9,0x19a5)+'e'));const _0x16da65=['It\x27s\x20Okay',_0x313705(0xd78,0x1711,0x27a,0x6a5)+_0x23937d(0x7f4,0x511,0x109b,0x25e),'Sorry\x20Bot\x20'+_0x23937d(0xc61,0x48,0xff5,0x13fb)+'er',_0x23937d(0xdc6,0x501,0x10ba,0x1ca0)+_0x23937d(0x142f,0x187d,0x1c6d,0x1f2b)+_0x23937d(0xe2f,0x284,0x16f1,0xc72),_0x313705(0x3e4,0x469,-0x55b,-0x5af)+'Really???',_0x313705(0x977,0x10f3,-0x524,-0x4a2),_0x313705(0xbde,0x1099,0xfd2,0x410)+':(',_0x313705(0xe0f,0xe04,0x8dc,0x1b87)+'t,\x20Boss:(','How\x20Are\x20Yo'+'u?'],_0x3e623d=_0x16da65[Math[_0x313705(0xb57,0x138b,0x1699,0x128c)](_0x4b485e[_0x313705(0x149a,0x1451,0x2257,0xc33)](Math[_0x313705(0x1ae0,0xfd9,0x1b02,0x17e0)](),_0x16da65[_0x313705(0x744,0x19a,0x63f,0x3e9)]))],_0x1444a8={};_0x1444a8[_0x23937d(0x1d39,0x243d,0x1e0a,0x16b0)]=_0x313705(0x194c,0xb2e,0xe98,0x1b15)+'\x20'+q+(_0x313705(0xd3f,0x159d,0x1491,0x1075)+_0x23937d(0x1818,0x1d36,0x2047,0x100b))+_0x3e623d;const _0x5dbd9b={};_0x5dbd9b['quoted']=_0x5cd288,_0x175756[_0x313705(0xcaa,0x14d8,0x8d8,0x1879)+'e'](_0x423161,_0x1444a8,_0x5dbd9b);break;case _0x23937d(0x1e,0x9be,-0xcf0,0x4d9):if(_0x4b485e[_0x313705(0x698,0x15aa,0x411,-0x7ce)](global[_0x313705(0x1e32,0x2c07,0xff0,0x16e3)],_0x4b485e[_0x313705(0x1c76,0x1ee3,0x16c5,0x25e4)]))return;if(_0x1bac1f)return _0x4b485e[_0x23937d(0xf1c,0x1ccf,0x9ea,0x299)](_0x1db05d,mess[_0x313705(0x982,0x7da,0xeea,0x473)]);if(_0x1e03f5)return _0x4b485e[_0x313705(0x1714,0xa44,0x1589,0x1c91)](_0x1db05d,mess[_0x313705(0x926,0x158b,0x787,0x1336)]);if(!_0x494254)return _0x516d85(_0x313705(0x1acb,0x252f,0x2059,0x19d1)+'Example\x20:\x20'+(_0xe1d953+_0x1354e9)+_0x313705(0x1c0b,0x24be,0x2917,0x23de));const _0x322702=['1','2','3','4','5','6','7','8','9','10','11','12','13','14','15','16','17','18','19','20','21','22','23','24','25','26','27','28','29','30','31','32','33','34','35','36','37','38','39','40','41','42','43','44','45','46','47','48','49','50','51','52','53','54','55','56','57','58','59','60','61','62','63','64','65','66','67','68','69','70','71','72','73','74','75','76','77','78','79','80','81','82','83','84','85','86','87','88','89','90','91','92','93','94','95','96','97','98','99',_0x313705(0x8d5,0x43e,0x1da,0xb31)],_0x31c18e=_0x322702[Math[_0x23937d(0x7f1,0x1578,0x6a4,0x124f)](_0x4b485e[_0x313705(0x209e,0x19b9,0x2d03,0x1eef)](Math[_0x313705(0x1ae0,0x16ed,0xdfa,0x1e6a)](),_0x322702['length']))],_0x380257={};_0x380257['text']=_0x23937d(0xbbc,0xa8a,0xfab,0x12e9)+q+(_0x313705(0xd3f,0xddd,0x1771,0x650)+'*')+_0x31c18e+'%*';const _0x473783={};_0x473783[_0x313705(0x942,-0x2c7,0x1705,0x1105)]=_0x5cd288,_0x175756[_0x313705(0xcaa,0x984,0x1121,0xfa0)+'e'](_0x423161,_0x380257,_0x473783);break;case _0x4b485e['RlOAX']:if(_0x1bac1f)return _0x4b485e['WsOvE'](_0x1db05d,mess[_0x313705(0x982,0x1a4,-0x3b6,0x1268)]);if(_0x1e03f5)return _0x1db05d(mess['banChat']);if(!_0x494254)return _0x516d85('Tag\x20Someon'+_0x313705(0x1789,0x1447,0x1a3c,0x924)+_0x313705(0x656,0xcb7,0x6e0,0x21c)+(_0xe1d953+_0x1354e9)+_0x313705(0x181e,0xe09,0xb9e,0x2443));const _0x3ed137=['1','2','3','4','5','6','7','8','9','10','11','12','13','14','15','16','17','18','19','20','21','22','23','24','25','26','27','28','29','30','31','32','33','34','35','36','37','38','39','40','41','42','43','44','45','46','47','48','49','50','51','52','53','54','55','56','57','58','59','60','61','62','63','64','65','66','67','68','69','70','71','72','73','74','75','76','77','78','79','80','81','82','83','84','85','86','87','88','89','90','91','92','93','94','95','96','97','98','99',_0x313705(0x8d5,0xc4f,0x199,0x13ae)],_0x309a57=_0x3ed137[Math['floor'](_0x4b485e[_0x313705(0x1752,0x234c,0x1b1d,0x1c3a)](Math[_0x23937d(0x177a,0x1807,0xd93,0x1b6c)](),_0x3ed137[_0x23937d(0x3de,0xc8d,-0x7b8,-0x4b9)]))],_0x20c38c={};_0x20c38c[_0x23937d(0x1d39,0x2b8e,0xf7e,0x17e6)]='*'+_0x1354e9+'*\x0a\x0aName\x20:\x20'+q+(_0x23937d(0x9d9,0x52f,0x81f,0x1f0)+'*')+_0x309a57+'%*';const _0x339221={};_0x339221[_0x23937d(0x5dc,-0x1b8,0x11e3,-0x1ba)]=_0x5cd288,_0x175756[_0x313705(0xcaa,0x7c5,0x1ab6,0xaac)+'e'](_0x423161,_0x20c38c,_0x339221);break;case _0x4b485e['ZYouK']:if(_0x1bac1f)return _0x4b485e[_0x313705(0x1bd7,0x29d0,0x279d,0x21bc)](_0x1db05d,mess[_0x313705(0x982,0x9a9,0x9fb,0xe7d)]);if(_0x1e03f5)return _0x1db05d(mess['banChat']);if(!_0x494254)return _0x4b485e[_0x313705(0x12fa,0x73e,0x812,0xa86)](_0x516d85,_0x23937d(0x1ca3,0x1c7d,0x10e1,0xe1c)+_0x23937d(0x1423,0x170f,0x14c0,0x233d)+'\x20:\x20'+(_0xe1d953+_0x1354e9)+_0x313705(0x181e,0x17d6,0xb6d,0x2035));const _0x545e97=['1','2','3','4','5','6','7','8','9','10','11','12','13','14','15','16','17','18','19','20','21','22','23','24','25','26','27','28','29','30','31','32','33','34','35','36','37','38','39','40','41','42','43','44','45','46','47','48','49','50','51','52','53','54','55','56','57','58','59','60','61','62','63','64','65','66','67','68','69','70','71','72','73','74','75','76','77','78','79','80','81','82','83','84','85','86','87','88','89','90','91','92','93','94','95','96','97','98','99',_0x4b485e[_0x313705(0x1efb,0x2171,0x263a,0x269b)]],_0x32d340=_0x545e97[Math[_0x313705(0xb57,0x607,0xee9,0x1235)](_0x4b485e['hBcTh'](Math[_0x313705(0x1ae0,0x174c,0x1efd,0x269d)](),_0x545e97['length']))],_0x112d82={};_0x112d82[_0x23937d(0x1d39,0x253a,0x26d3,0x2bf4)]='*'+_0x1354e9+_0x313705(0x1c0f,0x1522,0x21a2,0xdf8)+q+(_0x313705(0xd3f,0x39c,0xa22,0x435)+'*')+_0x32d340+'%*';const _0xdc4822={};_0xdc4822[_0x313705(0x942,0xe3c,0x166a,0x201)]=_0x5cd288,_0x175756['sendMessag'+'e'](_0x423161,_0x112d82,_0xdc4822);break;case _0x4b485e['KdcxG']:if(_0x1bac1f)return _0x4b485e[_0x313705(0x1b0a,0x10af,0x151f,0x1d93)](_0x1db05d,mess[_0x23937d(0x61c,-0x403,-0x4d9,-0x7fd)]);if(_0x1e03f5)return _0x4b485e[_0x23937d(0xe16,0x178b,0x1353,0x13f0)](_0x1db05d,mess[_0x313705(0x926,0xabc,0x9a3,0x116b)]);if(!_0x494254)return _0x4b485e[_0x313705(0xcbd,0x946,0x196e,0x51e)](_0x516d85,_0x23937d(0x1ca3,0xf29,0xec2,0x238b)+_0x23937d(0x1423,0x1323,0x13de,0x2275)+'\x20:\x20'+_0x4b485e['aUdAa'](_0xe1d953,_0x1354e9)+_0x23937d(0x14b8,0x13ee,0xff4,0x2099));const _0x42ee4f=[_0x4b485e[_0x313705(0x93e,-0x37b,0x1e7,0x137f)],_0x4b485e[_0x23937d(0x17aa,0xcd5,0x1ef5,0x1530)],_0x4b485e[_0x313705(0x15df,0x110a,0x16cd,0x10a4)],_0x4b485e[_0x313705(0x12f1,0x147e,0xa64,0x1e96)],_0x4b485e[_0x23937d(0x1a84,0x1838,0x1f4b,0x1668)],_0x313705(0x14de,0x2066,0x17c1,0x139f),_0x4b485e[_0x313705(0x1202,0x1f08,0x1b30,0x1a77)],_0x4b485e[_0x23937d(0x542,0x153,0xb4f,-0x661)],_0x23937d(0x728,0xe80,-0x1ed,0x6a5),_0x4b485e[_0x23937d(0x1440,0x1b2a,0x1e65,0xd34)],_0x313705(0x1c79,0x23fb,0xe96,0x1fec)+'y',_0x23937d(0xc9,-0x36c,-0x1ed,0xd50)],_0x3b7989=_0x42ee4f[Math[_0x23937d(0x7f1,0x1528,0xeb6,-0x4bf)](_0x4b485e[_0x313705(0x17f7,0x2547,0x1f8b,0x1327)](Math[_0x313705(0x1ae0,0x191e,0x1681,0x259d)](),_0x42ee4f[_0x23937d(0x3de,-0x1f3,0x2ba,-0x87e)]))],_0x344250={};_0x344250['text']=_0x23937d(0xfaa,0xd71,0x79d,0xa39)+'Check\x20:\x20'+q+(_0x23937d(0x9d9,0xf02,0xca0,0x1120)+'*')+_0x3b7989+'*';const _0x2ed742={};_0x2ed742['quoted']=_0x5cd288,_0x175756[_0x313705(0xcaa,0xa41,0xed8,0x5f)+'e'](_0x423161,_0x344250,_0x2ed742);break;case _0x4b485e[_0x23937d(0x4dc,0x1266,0x137f,0x12b1)]:case _0x23937d(0xe64,0xf15,0x1487,0x44d):case _0x4b485e[_0x23937d(0x1427,0x1af3,0x20fe,0x21dc)]:case _0x4b485e['wyfcg']:case _0x4b485e[_0x23937d(0x89,0xe3d,-0x5d3,-0x6ef)]:case _0x23937d(0x11c2,0xa85,0x101e,0xd69)+'ck':case _0x4b485e[_0x313705(0x211e,0x1af9,0x1fc4,0x23af)]:case _0x313705(0x14ac,0x223a,0x139f,0x18da)+'k':case _0x4b485e['nmUSo']:case _0x4b485e[_0x23937d(0x14cb,0x768,0x2201,0x12f3)]:if(_0x1bac1f)return _0x4b485e[_0x313705(0x181f,0x10f1,0x140b,0x10bd)](_0x1db05d,mess['ban']);if(_0x1e03f5)return _0x4b485e[_0x23937d(0x1579,0x1edb,0x21ad,0x1062)](_0x1db05d,mess[_0x313705(0x926,0xdb1,-0x1e5,-0xb6)]);if(!_0x494254)return _0x4b485e[_0x313705(0xdb7,0x1953,0x762,0xd11)](_0x516d85,_0x23937d(0x1ca3,0x2037,0x1381,0x25f2)+'e,\x20Example'+_0x313705(0x656,0x109a,0xd7e,0xc04)+_0x4b485e[_0x313705(0x1b1b,0x12d9,0x17bd,0x1c91)](_0xe1d953,_0x1354e9)+_0x313705(0x181e,0x2200,0x18da,0x118e));const _0x4402a6=['1','2','3','4','5','6','7','8','9','10','11','12','13','14','15','16','17','18','19','20','21','22','23','24','25','26','27','28','29','30','31','32','33','34','35','36','37','38','39','40','41','42','43','44','45','46','47','48','49','50','51','52','53','54','55','56','57','58','59','60','61','62','63','64','65','66','67','68','69','70','71','72','73','74','75','76','77','78','79','80','81','82','83','84','85','86','87','88','89','90','91','92','93','94','95','96','97','98','99',_0x4b485e['mnAik']],_0x73da9=_0x4402a6[Math['floor'](_0x4b485e[_0x23937d(0x772,0xfbb,0x345,0x4a1)](Math[_0x23937d(0x177a,0x1836,0x2387,0x1d86)](),_0x4402a6[_0x23937d(0x3de,0x12e6,0x1a4,0xe24)]))],_0x2e6195={};_0x2e6195['text']='*'+_0x1354e9+'*\x0a\x0aName\x20:\x20'+q+(_0x23937d(0x9d9,0xff3,-0x4ec,0xc83)+'*')+_0x73da9+'%*';const _0x4c0d0f={};_0x4c0d0f['quoted']=_0x5cd288,_0x175756[_0x23937d(0x944,-0x151,0xe45,0xc2b)+'e'](_0x423161,_0x2e6195,_0x4c0d0f);break;case _0x4b485e[_0x313705(0xdc5,0x15ec,-0xa1,0x1b2d)]:case _0x4b485e[_0x313705(0x1416,0xb23,0x1b3f,0x698)]:case _0x4b485e[_0x23937d(0x160b,0x2202,0x2052,0x1620)]:case _0x23937d(0x1d28,0x29ef,0x1f99,0xf04):case _0x4b485e[_0x313705(0x2053,0x207a,0x2c2b,0x2d71)]:case _0x4b485e[_0x23937d(0x37a,0x580,-0x889,-0x4bc)]:case'bastard':case _0x4b485e[_0x23937d(0xe9a,0x1a1d,0x489,0x195a)]:case _0x4b485e[_0x23937d(0x1042,0x82a,0x503,0x157e)]:case _0x4b485e[_0x23937d(0x14ed,0xb1a,0x801,0x76e)]:case _0x4b485e[_0x23937d(0x1d85,0x1fb8,0x19fd,0x1c3f)]:case _0x4b485e[_0x23937d(0x192c,0x1657,0x2095,0x1b49)]:case'great':case _0x4b485e[_0x313705(0xeee,0x1a84,0x15d2,0x1688)]:case _0x23937d(0xab5,0x19ce,0x1172,0xe75):case _0x4b485e[_0x313705(0x6eb,0xc6d,-0x5ec,-0x33a)]:case _0x4b485e[_0x23937d(0x1b7a,0x227e,0x206e,0x1a15)]:case'beautiful':case _0x4b485e[_0x23937d(0x102a,0x1673,0x2ab,0x13df)]:case _0x4b485e[_0x23937d(0xde3,0x1a04,0x1964,0x17e9)]:case'ugly':case _0x4b485e[_0x313705(0x749,0xb66,0x7b4,0xb0f)]:case _0x4b485e[_0x23937d(0x12c7,0x1512,0x1dab,0x484)]:case _0x4b485e[_0x313705(0x1775,0x149c,0x1b83,0x14eb)]:case _0x4b485e[_0x313705(0x56b,0x930,-0x338,-0x7)]:case'madarchod':case _0x4b485e['yoixd']:case _0x313705(0xa00,-0x43a,0x18f8,0xc83):case _0x23937d(0x1b6c,0x14d4,0x104b,0x1f6d):case _0x313705(0x1fb4,0x175e,0x24a6,0x16c6):case _0x4b485e[_0x313705(0x178a,0x1d57,0xa68,0x1d18)]:case _0x4b485e[_0x313705(0x79e,0xcf6,0xf52,0x1144)]:case _0x23937d(-0x21,-0x1f6,0x966,-0x45e):case _0x4b485e['kBUZN']:case _0x4b485e['XRcLi']:case _0x4b485e[_0x313705(0x139c,0x7fd,0x10f8,0x839)]:case _0x23937d(0x1c95,0x11b0,0x19f2,0x1f45):case _0x4b485e[_0x313705(0x1a80,0x218a,0x1323,0x1130)]:case _0x4b485e[_0x23937d(0x1584,0xc9e,0x1734,0x168b)]:case _0x4b485e['VccEN']:case _0x4b485e[_0x23937d(0xf97,0x1bd0,0x1520,0x349)]:case _0x23937d(0x1d7a,0x233b,0x18e5,0x1dfc):case _0x4b485e[_0x313705(0x917,-0x5bb,0xd6b,0x332)]:case _0x23937d(0x1a4f,0x28f7,0x22a4,0x104d):case _0x4b485e['psFBs']:case _0x4b485e['nCdet']:case'mc':case _0x4b485e[_0x313705(0x3fa,0x3f0,-0x357,0x7d6)]:case _0x4b485e[_0x313705(0xb79,0x173d,0x15d3,0xf93)]:case _0x4b485e['dpVcc']:case _0x4b485e['QGsGV']:case _0x4b485e[_0x23937d(0x19c5,0x238f,0x132d,0x188b)]:case _0x313705(0x3aa,0xa8f,-0xa7b,0x102d):case _0x4b485e[_0x23937d(0x1145,0x16aa,0x281,0x5fe)]:case _0x4b485e['KvZRt']:case _0x4b485e[_0x23937d(0x1de,-0xd6,0xae1,0xff5)]:case _0x4b485e[_0x313705(0x178a,0x17be,0x1a96,0x1b75)]:case _0x4b485e[_0x313705(0x1b77,0x1798,0x2a3a,0x2232)]:case'rascal':case _0x313705(0xb41,0x1858,0x126b,0xa7e):case'nuts':case _0x4b485e[_0x313705(0x594,-0x5e5,0x8ce,-0x1ac)]:case _0x4b485e[_0x23937d(0x1d3,-0x36c,0x80c,-0xec)]:case _0x313705(0x116a,0x1d4c,0x65b,0x1066):case _0x313705(0xfd2,0x1814,0x5be,0xf03):case _0x23937d(0x5d4,0xe0b,-0x1fe,0xa47):case _0x4b485e[_0x313705(0x1966,0x226c,0x1abb,0xb4d)]:case _0x4b485e[_0x23937d(0x12c0,0x4a1,0x45c,0x979)]:case _0x4b485e[_0x23937d(0x31e,0x1172,-0x1c2,0x47f)]:case _0x4b485e[_0x23937d(0xc55,0xf8e,0x1209,0x157c)]:case _0x4b485e[_0x313705(0x113a,0x1468,0x15de,0x63a)]:case'mf':case _0x4b485e[_0x23937d(0x5ae,-0x843,0x4b8,0x9fc)]:case _0x4b485e[_0x313705(0x843,0x862,0x14ec,-0x259)]:case _0x4b485e[_0x23937d(0x1316,0x1199,0x11a5,0x77f)]:case _0x4b485e[_0x313705(0x1f1f,0x1771,0x2ac1,0x1dce)]:case _0x4b485e['mBqzt']:case _0x23937d(0x106f,0x323,0x12f9,0x1c93):case _0x4b485e[_0x23937d(0x12a7,0x1f5a,0xb72,0x1cd8)]:case _0x23937d(0x53,-0x7e0,-0x391,-0x1c4):case _0x23937d(0xcf3,0x9cb,0x17a8,0x1bd3):case _0x313705(0xe21,0x342,0xf43,0x1267):case _0x4b485e[_0x23937d(0xe78,0x2c8,0x3b6,0x4ae)]:case _0x313705(0x694,0x83e,0x5ab,0x1147):{if(_0x4b485e[_0x23937d(0x1b0d,0x152a,0x17e0,0x2096)]===_0x23937d(0x1768,0xcae,0x1256,0x1337)){const _0xa3295d={'fKtAP':function(_0x419e1f,_0x1ae406){function _0x5973a3(_0x1f6b5b,_0x404b5d,_0x370ea7,_0x397d4d){return _0x23937d(_0x397d4d-0x4f2,_0x1f6b5b,_0x370ea7-0x142,_0x397d4d-0x99);}return _0x4b485e[_0x5973a3(0x1eba,0x1a9e,0x1b3b,0x1a03)](_0x419e1f,_0x1ae406);}};let _0xecb7ab=_0x4b485e[_0x23937d(0xa16,0x292,0x88f,-0x462)](0x2ae59*0x1+-0x746a+-0xb34f,_0x1ebb95);if(!_0x4441d1[0x213+0x2616+-0x404*0xa])return _0x4b485e['KglSS'](_0x2cadfc,_0x313705(0x110b,0x507,0x514,0x1e2b)+_0x4b485e[_0x23937d(0x1b9f,0x260b,0x2697,0xe5e)](_0x4d1dcb,_0x428ea7)+(_0x313705(0xcc1,0x18ac,-0x123,0x1a17)+_0x23937d(0xea7,0x729,0x8a6,0x1c00)+_0x313705(0x15b3,0xf76,0xa4a,0x17f2)+_0x313705(0xd7e,0xe34,0x844,0x1a56)));if(_0x4b485e[_0x23937d(0x1076,0x2a6,0x364,0x122f)](_0x535b5c,_0xecb7ab))return _0x4b485e[_0x23937d(0xa0,-0x81,0xfba,0x930)](_0x4aa994,_0x4b485e[_0x313705(0xacd,0x19d7,0x1264,0x10ba)]);_0x4b485e[_0x23937d(0xf23,0x854,0x4e3,0x1a75)](_0x3bf7cb,_0x3bba57[_0x23937d(0x14ce,0x1f5d,0xd77,0x7b6)],_0xecb7ab);var _0x3dfc2e=_0x4b485e[_0x313705(0xd7c,0x1536,0x319,0x152f)](_0x15e1cd,0x23bc+-0x205e+-0x35d);_0x291405(_0x41af5d[_0x313705(0x1834,0x15e1,0x168c,0x1e4e)],_0x3dfc2e),_0x30e056(()=>{function _0x4fc401(_0x490e39,_0x38e9c5,_0x339ec0,_0x4bd323){return _0x23937d(_0x4bd323-0x64,_0x38e9c5,_0x339ec0-0xe9,_0x4bd323-0x162);}function _0x48bda7(_0x20e7cd,_0x560fdd,_0x494772,_0x54097a){return _0x313705(_0x560fdd-0xa,_0x494772,_0x494772-0x162,_0x54097a-0x1e);}_0xa3295d[_0x48bda7(0x209b,0x1c81,0x1627,0x2152)](_0x4ffe7e,_0x4fc401(0x910,0xf9,-0xb0c,0x305)+_0x48bda7(0x97c,0x11f1,0x317,0xacf)+_0x4fc401(0x88f,0x1102,0x1623,0x8e3)+'\x20Remaining'+_0x48bda7(0x1a58,0xbc2,0x18a2,0xb5b)+_0xa3295d[_0x4fc401(0xd6e,0xabd,0xbea,0x1975)](_0x26f073,_0x213244[_0x48bda7(0x1359,0x183e,0xb1a,0x1b63)])+(_0x48bda7(0x118c,0x390,0xc20,0x450)+_0x48bda7(0xa4e,0x5ef,0x45b,0x49f))+_0xa3295d[_0x48bda7(0x1ed3,0x1c81,0x19cd,0x1c23)](_0x5a27e9,_0x1af844[_0x4fc401(0x1c9b,0x2024,0xbf2,0x1532)]));},-0x1a9c+0x5*0x668+0xcc*0x3);}else{if(_0x1bac1f)return _0x4b485e[_0x313705(0xe17,0x11b0,0x1bcd,0x157c)](_0x1db05d,mess[_0x23937d(0x61c,-0x4ca,0x4aa,0x114f)]);if(_0x1e03f5)return _0x4b485e['KFtpH'](_0x1db05d,mess[_0x313705(0x926,-0x346,0x141d,-0x1d)]);if(!_0x5cd288[_0x313705(0x2089,0x1b2c,0x1944,0x1ea5)])return _0x4b485e[_0x23937d(0x99c,-0x3ad,0x13cf,0xab0)](_0x516d85,''+mess[_0x313705(0x152c,0xe17,0x2405,0x23a0)]);let _0x1ef74d=_0x2e12a2[_0x313705(0xe7c,0xfc9,0x18f9,0x11b8)](_0x25121d=>_0x25121d['id']),_0x2c870c=_0x5cd288['sender'],_0x1d0e9e=_0x1ef74d[Math['floor'](_0x4b485e['EElfb'](Math['random'](),_0x1ef74d['length']))],_0x563a64=_0x313705(0x1749,0x2504,0x1c46,0x1075)+_0x1354e9+_0x23937d(0x1945,0x244b,0x1c62,0x20dd)+_0x1d0e9e['split']('@')[-0x221*0x12+-0x94d*0x2+0x38ec],_0x5b1568=[_0x2c870c,_0x1d0e9e];const _0x20fcb5={};_0x20fcb5[_0x23937d(0x13f4,0x723,0x1b01,0x1cc3)+'t']=_0x4b485e['TCFYj'];const _0x59ff32={};_0x59ff32['buttonId']='👀',_0x59ff32[_0x313705(0x1902,0x1d9d,0x1136,0x2541)]=_0x20fcb5,_0x59ff32['type']=0x1;let _0x4691d4=[_0x59ff32];const _0x492b4b={};_0x492b4b['mentions']=_0x5b1568,await _0x175756[_0x23937d(0x7d8,0x1410,-0x484,0x115b)+_0x23937d(0x111a,0x54e,0x12a3,0x9e1)](_0x5cd288[_0x313705(0x14f2,0x20d7,0x20ac,0xb91)],_0x4691d4,_0x563a64,botname,_0x5cd288,_0x492b4b);}}break;case _0x4b485e['ohGIz']:if(_0x1bac1f)return _0x1db05d(mess['ban']);if(_0x1e03f5)return _0x4b485e[_0x313705(0x91a,0x1190,0x167a,0xe8c)](_0x1db05d,mess[_0x313705(0x926,0x10d6,0xdb3,0x981)]);if(!_0x494254)return _0x516d85(_0x23937d(0x1765,0x1e9a,0x1021,0x265e)+_0x23937d(0xda5,0x123c,0x1421,0x4bd)+_0x4b485e[_0x313705(0x121e,0x1af3,0xb28,0x1849)](_0xe1d953,_0x1354e9)+(_0x313705(0xe1c,0x1cb7,0xe90,0xbdb)+_0x23937d(0x277,0xc47,-0x311,-0x2c)));const _0x5a7979=[_0x4b485e[_0x313705(0x11d2,0x1188,0x583,0xdda)],_0x4b485e['FtREw'],_0x4b485e['VCpas'],_0x4b485e[_0x23937d(0x606,0x11c3,0xef7,-0x337)],_0x4b485e[_0x313705(0xd93,0x4f1,0xf04,0x1ae5)],_0x313705(0xdd4,0xfb6,0x11dc,0xfa2)+'ys',_0x4b485e[_0x313705(0x1cd9,0x2979,0xf7e,0x2050)],_0x4b485e[_0x23937d(0x1643,0x104c,0x1daf,0x1d24)],_0x4b485e[_0x23937d(0x1a95,0x1a9b,0x1a15,0x290b)],_0x4b485e[_0x313705(0x10bc,0x1d43,0x523,0x1325)],_0x313705(0xf54,0xd2b,0x15be,0x1404)+'ys',_0x4b485e[_0x313705(0xb4d,0x134a,0x17a2,0x192)],_0x4b485e[_0x313705(0x736,0x73d,0x73e,0x11fd)],_0x23937d(0x970,0x16bf,0x1164,-0x50d)+'ys',_0x4b485e[_0x23937d(0x11b3,0x2014,0x60c,0x1af7)],_0x4b485e[_0x23937d(0x27b,-0x6ee,-0x3f6,-0x482)],_0x4b485e['ChKaB'],_0x4b485e[_0x313705(0x393,-0x1,-0xb12,-0xa40)],_0x4b485e[_0x313705(0x1121,0x18d1,0xa9a,0x1054)],_0x4b485e[_0x23937d(0xcb7,0x9d9,0x921,0x6ae)],_0x4b485e[_0x313705(0x995,0x1336,0x6fd,0xb5d)],_0x4b485e[_0x313705(0xd32,0x1396,0x1901,0x8f)],_0x4b485e[_0x23937d(0xef3,0x1402,0x1955,0x1c09)],_0x23937d(0xe00,0x7d6,0x817,0x7bc)+'More',_0x4b485e[_0x313705(0x770,0x153b,0xe90,-0x60d)],_0x4b485e[_0x23937d(0xbbf,0x1754,0x449,0x3a9)],_0x4b485e[_0x313705(0xb12,0x140,0x3a9,0x131)],_0x4b485e['rUGwP'],_0x4b485e[_0x23937d(0x7f0,0xe98,0x267,0x302)],'55\x20Months\x20'+_0x313705(0x1e5f,0x289b,0x121f,0x2052),_0x4b485e[_0x23937d(0x651,0x54b,0x744,0xdc6)],_0x313705(0xb92,0x10c3,0x21c,0x9a1)+_0x313705(0x1e5f,0x1f84,0x1a17,0x2a27),_0x4b485e[_0x313705(0xce1,0x1b04,0x165,-0x20c)],_0x313705(0x1c53,0x2122,0x26b5,0x156f)+_0x23937d(0x1af9,0x144f,0xe71,0x1f34),_0x313705(0x211d,0x18a5,0x1424,0x17f1)+_0x23937d(0x1af9,0xd87,0x2106,0x1814),_0x313705(0x1e0e,0x1552,0x204a,0x19ee)+'More',_0x4b485e['STkbs'],_0x4b485e[_0x313705(0x1e1b,0x297a,0xf5b,0x1a33)],_0x4b485e[_0x313705(0xd14,0xa38,-0xa3,0x1bce)],'2\x20More\x20Yea'+'rs',_0x23937d(0x1cff,0x23c6,0x25a0,0x278d)+'rs',_0x4b485e[_0x23937d(0x1433,0x21ef,0x7c6,0x573)],_0x4b485e[_0x23937d(0xb64,0x178c,0x895,0xeb7)],_0x4b485e[_0x313705(0xc5a,0x1604,0x1874,0x15dd)],_0x4b485e[_0x313705(0x215e,0x2001,0x2416,0x2011)],_0x23937d(0x1231,0xe00,0x1512,0xce5)+_0x23937d(0x1afe,0x28e3,0x18f1,0x155d)+_0x313705(0x651,-0x726,-0x2f1,0x56d)+q],_0x4e45cc=_0x5a7979[Math['floor'](Math[_0x313705(0x1ae0,0x1107,0x225d,0x14e6)]()*_0x5a7979[_0x313705(0x744,0x13b9,-0x20d,-0x268)])],_0x18302f={};_0x18302f[_0x313705(0x209f,0x18ae,0x2931,0x1dfe)]=_0x313705(0x194c,0x1b1e,0xfc1,0xc1c)+'\x20'+q+('\x0aAnswer\x20:\x20'+'*')+_0x4e45cc+'*';const _0x5cc5fc={};_0x5cc5fc['quoted']=_0x5cd288,_0x175756['sendMessag'+'e'](_0x423161,_0x18302f,_0x5cc5fc);break;case _0x4b485e[_0x23937d(0x161f,0x2320,0x1d13,0x1fea)]:if(_0x1bac1f)return _0x1db05d(mess[_0x23937d(0x61c,0xb26,-0x4ae,0x4a8)]);if(_0x1e03f5)return _0x4b485e[_0x313705(0x8ad,-0x368,0xbe3,0x179d)](_0x1db05d,mess[_0x23937d(0x5c0,-0x15c,0x7,-0x57b)]);if(!_0x494254)return _0x516d85(_0x313705(0x1acb,0x155c,0x1ac2,0x1eeb)+_0x23937d(0xda5,0x1998,0x128e,0x1109)+_0x4b485e['TjvKv'](_0xe1d953,_0x1354e9)+_0x23937d(0x18e4,0x1f2c,0x1661,0x17b8));qq=q[_0x313705(0x15b9,0x810,0xead,0x1714)+'e'](),awikwok=qq+'\x20'+qq+'\x20'+qq+(_0x313705(0xd82,0x15c8,0xe3f,0x1757)+_0x23937d(0x1958,0x1636,0x25ae,0x16e1)+_0x313705(0xf88,0xb00,0xe6a,0xc3d)+'\x20HU\x20HA\x20HU\x20'+_0x23937d(0x132d,0x1d6d,0x214a,0xf65)+'aaah\x20the\x20s'+_0x23937d(0x1b26,0x1d16,0x1e8a,0x1c05)+_0x23937d(0x1ad,-0x4a3,-0x33f,0xb7d))+qq+(_0x313705(0x156e,0x17a0,0x212e,0x195d)+_0x313705(0x1f40,0x1d9c,0x10eb,0x1e98)+'ell\x20the\x20fr'+_0x23937d(0x4ad,0x84e,0xa17,0x2b2))+qq+(_0x313705(0xf89,0x11a9,0x1a69,0x1a4b)+'\x20~\x20Her\x20hai'+_0x23937d(0x596,0x59f,0x48e,0x938)+_0x313705(0x64b,-0x726,0x38c,0xc3f)+'\x20stroke\x20he'+'r\x20hair\x20too'+_0x313705(0x20d5,0x1cc7,0x240d,0x1b6f)+'\x20')+qq+(_0x23937d(0x43,-0x1cf,-0xbb8,-0x3a5)+_0x23937d(0x1ba6,0xe16,0x185c,0xcbd)+_0x313705(0x9df,-0x45c,0x128,0x6fb)+_0x313705(0x204b,0x28fc,0x2eaf,0x2b84)+'\x20❤️\x20so\x20AAAA'+_0x23937d(0x187d,0x1287,0x239d,0x17a5))+qq+('\x20AAAAAA\x20LU'+'CCUUUUUUUU'+'UUUUU.....'+_0x23937d(0x116,-0x2c1,-0xccc,-0xadc))+qq+(_0x313705(0x5d5,-0x4d8,0x115,-0x57f)+'AAAAAAAAAA'+'AGH\x20❤️\x20❤️\x20❤️w'+_0x23937d(0x1e0a,0x2ac3,0x2c14,0x1b66))+qq+('\x20it\x27s\x20not\x20'+_0x313705(0x65d,0x518,-0x1d5,0x14dd)+_0x313705(0x1ead,0x2d9f,0x27b4,0x2add)+_0x313705(0x102b,0xdfc,0x128d,0x1c8a)+'\x20no\x20no\x20no\x20'+_0x313705(0x730,-0x417,-0x31a,-0x7bd)+_0x313705(0x523,0xec3,-0x265,0x1ac)+_0x313705(0xf3e,0xf79,0x1953,0x38d)+_0x313705(0x466,0xc20,0x57b,0x904)+_0x23937d(0x16fb,0x83a,0xa20,0x24f1)+_0x313705(0x10c3,0x13a6,0x1160,0x1a39)+'E\x20REALITY,'+_0x313705(0x1ff3,0x25e0,0x2c3c,0x2470)+_0x313705(0x985,0x4de,0x1187,0xa96)+'\x20')+qq+'\x20me\x20...\x20'+qq+(_0x23937d(0x600,0x95a,-0x8be,-0x44b)+'ptop\x20watch'+_0x23937d(0x1b86,0x1faf,0x1805,0xdaa))+qq+(_0x313705(0x667,-0x285,0xa52,0xaf6)+_0x313705(0x1508,0xabc,0xdae,0x8de)+'e\x20?\x20aaaaaa'+'aaaaah\x20tha'+'nks\x20')+q+(_0x23937d(0x162b,0x1c88,0x1257,0x1232)+_0x313705(0xead,0xd13,0x1153,0x1ae9)+_0x313705(0x1be8,0x133c,0x1309,0x2464))+qq+(_0x313705(0xe86,0xb03,0xafc,0xe5f)+_0x23937d(0x1ae0,0xe23,0x1a5a,0x23fa)+_0x313705(0x1e3a,0x201c,0x288b,0x250d)+'I\x20STILL\x20HA'+_0x23937d(0xcfe,0x136c,0xac8,0x6c7))+qq+(_0x313705(0x798,0xa0b,0xb02,-0x6a)+_0x23937d(0xdbf,0xfa5,0x6b9,0x1cb6)+_0x23937d(0xbe4,0x1148,0x157d,0x1514)+_0x313705(0x1074,0x19a0,0x2e6,0x3b9)),_0x1db05d(awikwok);break;case _0x313705(0x474,0x6ad,0xb05,0x5e9):if(_0x1bac1f)return _0x4b485e[_0x23937d(0x1348,0xf07,0x113f,0x1e9e)](_0x1db05d,mess[_0x313705(0x982,-0x2cb,-0x28a,0xede)]);if(_0x1e03f5)return _0x4b485e[_0x313705(0x483,0xa91,0xc9d,0x18d)](_0x1db05d,mess['banChat']);if(!_0x494254)return _0x4b485e['eBgSp'](_0x516d85,_0x313705(0x704,0x71e,-0x7d7,-0x77b)+'e\x27s\x20Name,\x20'+_0x313705(0x110b,0xfe8,0x1b6b,0xc20)+_0x4b485e[_0x23937d(0x97d,0x9a6,0x8b2,0xc3f)](_0xe1d953,_0x1354e9)+_0x313705(0xda6,0x625,0x18fe,0x4bf));predea=await axios[_0x313705(0xfa3,0x1b0a,0x52a,0x19df)](_0x313705(0x16e7,0x1713,0x23ed,0xdc1)+_0x23937d(0xeff,0x60,0x64d,0x15dd)+_0x313705(0x20ce,0x225f,0x1e4f,0x24b5)+q),_0x4b485e[_0x313705(0x1112,0x1901,0x64e,0x196e)](_0x1db05d,_0x23937d(0x9fb,-0x336,0x4e6,0xe9d)+predea[_0x23937d(0xe17,0x92e,0x196d,0x18bd)][_0x23937d(0x1451,0x1335,0x1a77,0x1ff0)]+(_0x23937d(0x6ee,0xd8a,0x1423,0x5c8)+_0x23937d(0x1b08,0x1928,0xbf6,0x1fcb))+predea[_0x313705(0x117d,0xd0d,0xb26,0x118d)][_0x313705(0x1b16,0xc17,0x215e,0xc6d)]+(_0x313705(0x2157,0x292b,0x2113,0x1f15)+_0x313705(0xc08,0xc79,0x14a,0xfb6)+_0x23937d(0x53f,-0x49a,-0x16d,0x895)+_0x23937d(0x98d,0x1457,0x1582,-0x560)+_0x313705(0xff1,0xb8f,0x733,0x1269)+_0x23937d(0x17ec,0xe93,0x25d1,0xf98)+_0x313705(0x1c87,0x2875,0x25aa,0x1c0b)));break;case _0x4b485e['JmInV']:{if(_0x1bac1f)return _0x1db05d(mess[_0x23937d(0x61c,0x7cc,0x1026,0xa8b)]);if(_0x1e03f5)return _0x4b485e[_0x23937d(0xe3,0xa38,0xf40,-0x20f)](_0x1db05d,mess[_0x23937d(0x5c0,-0x32d,0x1f6,-0x8e0)]);if(!_0x24aa58)return _0x516d85(''+mess[_0x313705(0xfea,0x761,0x106f,0xd86)]);if(!_0x494254)return _0x4b485e[_0x313705(0x1447,0x1b01,0x1b73,0x202b)](_0x516d85,_0x313705(0x5f4,-0x720,0x6ae,0xbe5)+_0x23937d(0x1794,0x17cc,0x20a1,0x2417)+'!');if(!_0x4b485e['GAcLS'](isUrl,_0x1ba32f[-0x1bb+0x12e9+-0x897*0x2])&&!_0x1ba32f[-0x152*-0xd+-0x346+-0xde4][_0x23937d(0x178,0x21d,0x64,-0x3f0)](_0x4b485e[_0x23937d(0x12af,0x69e,0x8a1,0xc23)]))return _0x4b485e['aUuQn'](_0x516d85,_0x313705(0x10d4,0x99f,0x6a8,0x879)+_0x313705(0x4c7,-0x94,-0x51b,0x8ea));_0x4b485e[_0x313705(0x1433,0x2034,0x5e0,0x1fcb)](_0x1db05d,mess['wait']);let _0x1dccfa=_0x1ba32f[0xa*0x62+0x8c6*-0x1+0x4f2*0x1][_0x313705(0x1035,0x1340,0x1736,0xdf1)](_0x23937d(0x26c,0x4cc,0x2de,0x919)+_0x23937d(0x987,0x677,0xb5f,0x824)+'p.com/')[0xcc1+-0x1f1b+0x125b];await _0x175756[_0x23937d(0x14e5,0x21a3,0x936,0x1023)+_0x23937d(0x575,0x2f7,-0x662,0xac9)](_0x1dccfa)[_0x313705(0x1ec7,0x20f8,0x2209,0x2469)](_0x99d3bb=>_0x1db05d(jsonformat(_0x99d3bb)))[_0x23937d(0x934,-0x45e,0x58c,0x120e)](_0x4bd330=>_0x1db05d(jsonformat(_0x4bd330)));}break;case'leavegc':case _0x4b485e[_0x23937d(0xd54,-0xb1,0x15b4,0x1b1d)]:{const _0x26398a=_0x4b485e['aKfGX'][_0x23937d(0xccf,0x15b6,0x16b6,0x1892)]('|');let _0x4a3e62=-0x1aac+0x731+-0x1*-0x137b;while(!![]){switch(_0x26398a[_0x4a3e62++]){case'0':if(_0x1e03f5)return _0x1db05d(mess[_0x313705(0x926,-0x166,0x1573,0x10c3)]);continue;case'1':if(_0x1bac1f)return _0x1db05d(mess[_0x313705(0x982,0x154d,0x445,0x10a6)]);continue;case'2':_0x4b485e[_0x313705(0x1865,0x1e30,0x1252,0x22c7)](_0x1db05d,mess[_0x313705(0xc12,0x97f,0x16a8,0x2cd)]);continue;case'3':if(!_0x24aa58)return _0x4b485e[_0x313705(0x1674,0x77f,0x128f,0xe77)](_0x516d85,''+mess[_0x313705(0xfea,0xf75,0x538,0x542)]);continue;case'4':await _0x175756['groupLeave'](_0x5cd288[_0x23937d(0x118c,0x684,0x1bdd,0x1100)])['then'](_0x380ad3=>_0x1db05d(jsonformat(_0x380ad3)))['catch'](_0x28fc11=>_0x1db05d(jsonformat(_0x28fc11)));continue;}break;}}break;case _0x4b485e[_0x313705(0x20a1,0x163f,0x224f,0x212d)]:{if(_0x4b485e[_0x313705(0x1382,0x1b70,0x1e5a,0xd17)](_0x23937d(0xc44,0xdd5,0x196e,0x1346),_0x4b485e[_0x23937d(0xb63,0x1894,0x3a4,-0x122)]))return _0x4b485e[_0x313705(0xa6b,0xdeb,-0x32,0x5a0)];else{const _0x528d9a=_0x4b485e[_0x313705(0x9a4,0xbad,-0x1a0,0xea3)]['split']('|');let _0x3bd5b1=-0x1de7+-0x1661+0x3448;while(!![]){switch(_0x528d9a[_0x3bd5b1++]){case'0':if(_0x1bac1f)return _0x4b485e['cMZaN'](_0x1db05d,mess[_0x23937d(0x61c,-0x7b7,-0x63f,-0x5df)]);continue;case'1':if(!_0x24aa58)return _0x4b485e[_0x23937d(0x1589,0x1d2d,0x1b73,0x1e18)](_0x516d85,''+mess[_0x23937d(0xc84,0x825,0xf6f,0x93d)]);continue;case'2':_0x1db05d(_0x313705(0x4c1,0x15a,0x599,0x6da)+_0x313705(0x34f,-0x220,0xaab,-0x980)+'sfully\x20Cha'+_0x23937d(0x12cf,0x1d0a,0x1869,0xa2c)+dragonemoji+(_0x313705(0x8aa,-0x4c4,-0x4f3,0xc90)+':\x20')+global[_0x313705(0xba3,0x16eb,0xeed,0x680)]+'\x0a'+dragonemoji+_0x313705(0xe63,-0xa1,0x591,0xcae)+global['author']);continue;case'3':global['author']=_0x494254[_0x313705(0x1035,0x1281,0x151f,0x1f48)]('|')[-0x1648+0x1*0xcf2+0x957];continue;case'4':if(_0x1e03f5)return _0x4b485e['FBGCT'](_0x1db05d,mess['banChat']);continue;case'5':global['packname']=_0x494254[_0x23937d(0xccf,0x533,0x699,0x1a8e)]('|')[0x1*0x12ae+-0x7*-0x1cf+-0x71*0x47];continue;case'6':if(!_0x494254)return _0x4b485e[_0x313705(0xf66,0xae6,0xbc4,0xbce)](_0x516d85,_0x23937d(0xda5,0xab,-0x105,0x758)+_0x4b485e[_0x23937d(0x9bd,0x1491,0xf8c,0x11b9)](_0xe1d953,_0x1354e9)+(_0x313705(0x194b,0x25d0,0x1bc5,0x1e3c)+_0x313705(0xa17,0x1b6,-0x358,-0xc6)));continue;}break;}}}break;case _0x23937d(0x1b01,0x29d4,0x177f,0x15ba):{if(_0x1bac1f)return _0x4b485e[_0x313705(0xfa7,0x77e,0x1575,0x1019)](_0x1db05d,mess[_0x23937d(0x61c,0xf64,-0x3d9,0x6d2)]);if(_0x1e03f5)return _0x4b485e[_0x23937d(0x18b4,0x2420,0x1646,0xccc)](_0x1db05d,mess['banChat']);if(!_0x5cd288[_0x23937d(0x1d23,0x16cf,0x1cb5,0xe9c)])return _0x516d85(''+mess[_0x23937d(0x11c6,0x11ff,0x200a,0x302)]);if(!_0x424adc)return _0x4b485e['WvHAK'](_0x516d85,''+mess['botAdmin']);if(!_0x17ccaf)return _0x516d85(''+mess[_0x23937d(0x14b2,0x18c7,0x10b5,0xfcd)]);let _0x286640=_0x5cd288[_0x313705(0x1896,0x2590,0x1567,0x1079)+'id'][-0x148*0x5+-0x1*0x1189+0x1b*0xe3]?_0x5cd288[_0x23937d(0x1530,0x13c4,0x8d6,0x21ee)+'id'][0x2b4*0x7+0x3*-0xbc3+-0x3b*-0x47]:_0x5cd288[_0x313705(0x942,0x2ad,0xbf7,0x17f7)]?_0x5cd288['quoted'][_0x23937d(0x14ce,0x21c8,0x1597,0x20f9)]:_0x4b485e[_0x313705(0x18af,0xfc2,0x217e,0x2712)](_0x494254['replace'](/[^0-9]/g,''),_0x4b485e[_0x313705(0x20f2,0x2a3a,0x276e,0x1fb5)]);await _0x175756[_0x23937d(0xc88,0xe9,0x102f,0x43)+'cipantsUpd'+'ate'](_0x5cd288['chat'],[_0x286640],_0x4b485e[_0x313705(0x17f2,0x173e,0x2333,0xac6)])[_0x313705(0x1ec7,0x14c7,0x1b9e,0x1c0c)](_0x12eb86=>_0x1db05d(jsonformat(_0x12eb86)))[_0x23937d(0x934,0x11bc,0x1735,0x1705)](_0x354c55=>_0x1db05d(jsonformat(_0x354c55)));}break;case _0x4b485e[_0x313705(0xd77,0xf0b,0xb41,0x16e3)]:{if(_0x23937d(0xbd7,0xcd0,-0x150,0x14a5)!==_0x4b485e[_0x23937d(0x659,-0x24b,0x15e,0x72f)]){if(_0x1b81a4)return _0x4b485e[_0x313705(0xf1e,0x1a78,0x153a,0xfb7)](_0x4ec24b,_0x1dc95a[_0x313705(0x982,-0x515,0xeb0,-0x1c5)]);if(_0x37a1bb)return _0x4b485e[_0x313705(0x1c61,0x1ad1,0x1093,0x1c5d)](_0x514b6c,_0x1468f6[_0x23937d(0x5c0,-0x278,-0x1a6,0x9e7)]);let _0x1fce8c=('\x0a*Hash\x20Lis'+_0x23937d(0x1c83,0x2031,0xdb5,0x14c5)+_0x313705(0x1136,0x5da,0x1c6b,0x19ce)+_0x23937d(0x14bd,0xbdf,0x1d36,0x1ba2)+'\x0a'+_0x1c79d2[_0x23937d(0xf4b,0x159d,0x1aa2,0xeda)](_0x3e435f['db'][_0x313705(0x117d,0x146f,0x1e49,0xdca)][_0x23937d(0xffa,0x1ee,0x1669,0x377)])[_0x313705(0xe7c,0x1c48,0x8d9,0x1289)](([_0x2ea982,_0xec9f8f],_0x3be7e3)=>_0x3be7e3+(-0x175e+0x1*0x1457+0x8*0x61)+'.\x20'+(_0xec9f8f[_0x313705(0x13b1,0x13f7,0x20e9,0x18bd)]?'*'+_0x2ea982+'*':_0x2ea982)+_0x313705(0x656,0x122e,-0x121,0x1136)+_0xec9f8f[_0x23937d(0x1d39,0x1a4c,0x2c2e,0x16b1)])[_0x23937d(0x1c16,0x1ba5,0x12c0,0xdf9)]('\x0a')+'\x0a')[_0x23937d(0x1c07,0xffa,0x1f28,0x1e45)]();_0x38910c[_0x313705(0x18da,0x24cf,0x108a,0x27f9)](_0x18d87c['chat'],_0x1fce8c,_0x529318,{'mentions':_0x9bb7b5['values'](_0x4115d0['db'][_0x313705(0x117d,0x7db,0x4b3,0x6b2)][_0x313705(0x1360,0xd14,0xa31,0xc6d)])[_0x23937d(0xb16,0xa81,0xdf,0x8ea)](_0x530d12=>_0x530d12[_0x23937d(0x1530,0x633,0x16c9,0x83a)+'id'])[_0x313705(0x1e9e,0x28b5,0x2532,0x15d4)]((_0x2b114b,_0x16e5a4)=>[..._0x2b114b,..._0x16e5a4],[])});}else{if(_0x1bac1f)return _0x4b485e[_0x313705(0xe8f,0x1128,0x1164,0x328)](_0x1db05d,mess['ban']);if(_0x1e03f5)return _0x4b485e[_0x313705(0x1596,0x19aa,0x678,0x24a4)](_0x1db05d,mess['banChat']);if(!_0x5cd288['isGroup'])return _0x4b485e[_0x313705(0xe24,0xe0f,0x10c1,0x2ba)](_0x516d85,''+mess[_0x23937d(0x11c6,0x1c75,0x1fa2,0x1ab2)]);if(!_0x424adc)return _0x516d85(''+mess[_0x23937d(0x10b3,0xcb7,0x239,0x1d9d)]);if(!_0x17ccaf)return _0x4b485e['KXbiV'](_0x516d85,''+mess[_0x23937d(0x14b2,0xef1,0x16f0,0xfd3)]);let _0x2831f7=_0x5cd288[_0x313705(0x942,-0x62,0x2ac,0x51)]?_0x5cd288[_0x23937d(0x5dc,0xd4b,-0x66b,-0x65d)][_0x23937d(0x14ce,0x10ed,0x11f0,0x1a97)]:_0x4b485e['Ogmcy'](_0x494254[_0x313705(0x1bd8,0x140f,0x1163,0xd0d)](/[^0-9]/g,''),_0x4b485e['WzLVv']);await _0x175756['groupParti'+_0x23937d(0x30b,-0x686,0x3f1,0x1161)+_0x23937d(0x250,0x1b2,0xba1,0x6c2)](_0x5cd288['chat'],[_0x2831f7],_0x313705(0xb2a,0x14eb,0x505,0x114c))['then'](_0x532410=>_0x1db05d(jsonformat(_0x532410)))[_0x313705(0xc9a,0x6f8,0x198b,0xe7d)](_0x2cfa1e=>_0x1db05d(jsonformat(_0x2cfa1e)));}}break;case _0x4b485e[_0x313705(0x13c1,0x1faf,0x1cd0,0x13ab)]:{if(_0x1bac1f)return _0x4b485e[_0x23937d(0x1467,0x156c,0x5ee,0x161e)](_0x1db05d,mess[_0x313705(0x982,-0x1b4,-0x59d,0x15ec)]);if(_0x1e03f5)return _0x4b485e['aQixK'](_0x1db05d,mess['banChat']);if(!_0x5cd288[_0x313705(0x2089,0x1b0c,0x2423,0x1aa8)])return _0x4b485e[_0x313705(0x411,0x18a,0x65f,0xca9)](_0x516d85,''+mess[_0x23937d(0x11c6,0x1a5c,0x1b8e,0x3cc)]);if(!_0x424adc)return _0x4b485e['Ptwpm'](_0x516d85,''+mess['botAdmin']);if(!_0x17ccaf)return _0x516d85(''+mess['admin']);let _0x4c76e7=_0x5cd288[_0x23937d(0x1530,0x1e09,0x922,0x2115)+'id'][-0xdfa+0x1264+-0x46a]?_0x5cd288[_0x23937d(0x1530,0x23a5,0x6c0,0x1c76)+'id'][0x2488+-0x1*0x1eb2+-0x5d6]:_0x5cd288[_0x313705(0x942,0xe7c,-0x42b,-0x15b)]?_0x5cd288[_0x23937d(0x5dc,0xc30,0x9c0,-0xe0)][_0x23937d(0x14ce,0x2084,0x1073,0x1c39)]:_0x494254['replace'](/[^0-9]/g,'')+_0x4b485e[_0x313705(0x20f2,0x12b2,0x1784,0x1386)];await _0x175756[_0x23937d(0xc88,0x190b,0x108,0x23e)+'cipantsUpd'+_0x23937d(0x250,-0xb57,0x9cd,0x64a)](_0x5cd288['chat'],[_0x4c76e7],_0x4b485e[_0x23937d(0x105b,0x161e,0x144a,0x32b)])[_0x23937d(0x1b61,0x15dc,0x20a0,0xd78)](_0x379ed7=>_0x1db05d(jsonformat(_0x379ed7)))['catch'](_0x464387=>_0x1db05d(jsonformat(_0x464387)));}break;case _0x4b485e[_0x23937d(0x1d56,0x120a,0x191f,0x18f8)]:{if(_0x4b485e[_0x23937d(0x1469,0x2305,0xc9b,0x1fa3)](_0x4b485e['GLVNa'],_0x23937d(0xc95,0x131b,0x17c1,0x6a3))){if(_0x1bac1f)return _0x1db05d(mess['ban']);if(_0x1e03f5)return _0x4b485e['vywQZ'](_0x1db05d,mess['banChat']);if(!_0x5cd288[_0x23937d(0x1d23,0x19a8,0x191d,0x1119)])return _0x4b485e[_0x313705(0x112a,0x1171,0x145d,0x1c91)](_0x516d85,''+mess['group']);if(!_0x424adc)return _0x516d85(''+mess[_0x313705(0x1419,0x1b16,0xe28,0x1c1c)]);if(!_0x17ccaf)return _0x516d85(''+mess['admin']);let _0x34c284=_0x5cd288[_0x313705(0x1896,0x1fb4,0x1332,0x109c)+'id'][-0x1b3f+-0x1741+0x3280]?_0x5cd288[_0x313705(0x1896,0x1e1d,0x16ac,0x10cb)+'id'][-0x2655+0xd8e+0x18c7]:_0x5cd288['quoted']?_0x5cd288['quoted'][_0x23937d(0x14ce,0x200a,0x9ef,0x139d)]:_0x4b485e[_0x313705(0xd50,0xf28,0x5f6,0x1681)](_0x494254['replace'](/[^0-9]/g,''),_0x4b485e[_0x313705(0x20f2,0x1df8,0x1588,0x2e7d)]);await _0x175756['groupParti'+_0x23937d(0x30b,0x5d7,-0x5f2,0x21)+_0x313705(0x5b6,0xc66,0x79,0x9dc)](_0x5cd288[_0x23937d(0x118c,0x1947,0x797,0xd39)],[_0x34c284],_0x4b485e[_0x313705(0x20bc,0x226d,0x2bfb,0x1a95)])[_0x313705(0x1ec7,0x1911,0x241e,0x1004)](_0x3ba405=>_0x1db05d(jsonformat(_0x3ba405)))[_0x23937d(0x934,-0x17c,0x1266,0xc0c)](_0x32a276=>_0x1db05d(jsonformat(_0x32a276)));}else{const _0x30c2ca=_0x4b485e[_0x23937d(0x3ef,0xf15,0x5bd,0xfce)][_0x23937d(0xccf,0xe77,0x1952,0x146)]('|');let _0x25a390=-0x957+0x24f7*0x1+-0x1ba0;while(!![]){switch(_0x30c2ca[_0x25a390++]){case'0':if(_0x4b485e[_0x313705(0x1707,0x250c,0x8d9,0x1b0d)](_0x4d8b0a[-0x56*-0x2+0x17b*-0x1+0x1*0xcf],'on')){if(_0x4b485e['eiqfG'](_0xd00386,!![]))return;_0x1590b8[_0x23937d(0x1264,0x8c5,0x1c16,0x1ea8)]=!![],_0x5c8692(_0x313705(0x17d7,0x119c,0x11fe,0x124b)+'ly\x20activat'+'ed\x20antitag'+'!');}else{if(_0x18de34[-0x93*-0x3c+0xf2d+-0x31a1]==='off'){if(_0x4a35f4===![])return;_0x58b098['antitags']=![],_0x4b485e[_0x313705(0xa42,0x922,0x1136,0x1048)](_0x19b91c,_0x23937d(0x1471,0x195e,0xe27,0xd4a)+_0x23937d(0xf57,0x1806,0xa61,0x151f)+_0x23937d(0x1b36,0x23e3,0x2644,0x1aaa)+_0x313705(0x1f65,0x11cc,0x1890,0x16c8));}else _0x4b485e['UYBKc'](_0x3f4b68,_0x313705(0xc17,-0x1a4,0x1297,-0xde)+'or\x20off');}continue;case'1':if(!_0x5e5c60)return;continue;case'2':if(_0x1af140[_0x313705(0x744,0x276,0xaf4,-0x53a)]<0xc31+0xbed+0x181d*-0x1)return _0x4b485e[_0x23937d(0xf0a,0x1586,0x1e25,0x807)](_0x2bd769,_0x313705(0x1a1a,0x1a86,0x2436,0x1451)+_0x313705(0xa81,0x612,0x29b,0x990)+_0x23937d(0x393,0x111d,0x2b2,-0xb1b)+_0x23937d(0x219,-0x7e5,-0xbbe,0x1058));continue;case'3':if(_0x1b1e6f)return _0x4b485e[_0x23937d(0x99d,0xb8b,0x4e5,0x13a5)](_0x2cc822,_0x366a4b[_0x313705(0x982,0x638,0x405,0x15bc)]);continue;case'4':if(_0x144bad)return _0x4b485e[_0x313705(0x12fb,0x1c69,0x1b77,0x1809)](_0x2f64a5,_0x3b913b[_0x313705(0x926,-0x18a,0x14f7,-0x553)]);continue;}break;}}}break;case _0x4b485e[_0x313705(0x5f5,-0x545,-0x519,0xa62)]:{if(_0x1bac1f)return _0x4b485e['Ptwpm'](_0x1db05d,mess[_0x23937d(0x61c,0x13a2,-0x884,0x1174)]);if(_0x1e03f5)return _0x4b485e[_0x23937d(0x1a5d,0x1063,0x2669,0x15c0)](_0x1db05d,mess[_0x313705(0x926,-0x589,-0x180,0x90f)]);if(!_0x24aa58)return _0x516d85(''+mess[_0x23937d(0xc84,0x8f7,0x172a,0x98d)]);let _0x59ceb4=_0x5cd288[_0x23937d(0x1530,0x7ea,0x1a21,0x2186)+'id'][-0x14*0xb2+-0x1322*-0x1+0x6*-0xdf]?_0x5cd288[_0x23937d(0x1530,0x1ab1,0xb20,0x1217)+'id'][-0x1cc*0x13+-0x1a*0x6d+0x2d36]:_0x5cd288['quoted']?_0x5cd288['quoted'][_0x23937d(0x14ce,0x1f28,0x1474,0xab0)]:_0x4b485e[_0x313705(0x161e,0x22ee,0x2479,0x19d8)](_0x494254['replace'](/[^0-9]/g,''),_0x23937d(0xf25,0x51a,0xa68,0x265)+'p.net');await _0x175756['updateBloc'+_0x313705(0x103e,0x1ad6,0x1a07,0x9ca)](_0x59ceb4,_0x4b485e[_0x313705(0x5f5,-0x7c2,0x2e5,0x1146)])[_0x23937d(0x1b61,0x1fd0,0x17ae,0x26b9)](_0x4e8e1b=>_0x1db05d(jsonformat(_0x4e8e1b)))['catch'](_0x8f584=>_0x1db05d(jsonformat(_0x8f584)));}break;case _0x4b485e[_0x23937d(0x129f,0x1cdd,0x1bb1,0x1246)]:{if(_0x1bac1f)return _0x4b485e['VZOwg'](_0x1db05d,mess[_0x313705(0x982,0x108e,0x1642,-0x587)]);if(_0x1e03f5)return _0x4b485e[_0x23937d(0x694,0x3c9,-0x47c,0x463)](_0x1db05d,mess['banChat']);if(!_0x24aa58)return _0x4b485e['HGRTU'](_0x516d85,''+mess[_0x23937d(0xc84,0x89a,0x16aa,0x77f)]);let _0x43238c=_0x5cd288['mentionedJ'+'id'][0x1362+0x1086+-0x23e8]?_0x5cd288['mentionedJ'+'id'][0xeca+-0x19bb+0xaf1]:_0x5cd288[_0x23937d(0x5dc,-0x1a5,0xe99,0x672)]?_0x5cd288['quoted']['sender']:_0x4b485e['pfSNA'](_0x494254[_0x23937d(0x1872,0x18d3,0x2773,0x259d)](/[^0-9]/g,''),_0x23937d(0xf25,0x156d,0x379,0xb88)+'p.net');await _0x175756[_0x23937d(0x1793,0x1546,0x1776,0x12e6)+_0x23937d(0xcd8,0x21e,0x19b9,0x165f)](_0x43238c,_0x4b485e['yqqUs'])[_0x23937d(0x1b61,0x167a,0x2868,0x1910)](_0x5b4ccb=>_0x1db05d(jsonformat(_0x5b4ccb)))[_0x23937d(0x934,0x94,0xea0,0x118)](_0x133e6d=>_0x1db05d(jsonformat(_0x133e6d)));}break;case'setname':case _0x313705(0x1f10,0x2976,0x1738,0x1356):case _0x4b485e[_0x23937d(0x52a,-0x39a,-0x558,-0x3fb)]:{if(_0x1bac1f)return _0x1db05d(mess['ban']);if(_0x1e03f5)return _0x4b485e[_0x313705(0x1a72,0xe4e,0x2376,0xc63)](_0x1db05d,mess[_0x313705(0x926,0x15cc,-0x353,0x1410)]);if(!_0x5cd288['isGroup'])return _0x4b485e[_0x23937d(0x935,0x5e5,-0xe3,-0x56e)](_0x516d85,''+mess['group']);if(!_0x424adc)return _0x4b485e[_0x23937d(0x2bf,-0x23,0x5c9,-0xb24)](_0x516d85,''+mess[_0x313705(0x1419,0xa2a,0x18a6,0x1741)]);if(!_0x17ccaf)return _0x4b485e[_0x23937d(0x121a,0x1c76,0x10a2,0x196e)](_0x516d85,''+mess[_0x313705(0x1818,0x11e2,0x1dcc,0x130e)]);if(!_0x494254)return _0x4b485e[_0x23937d(0x1b2f,0x1563,0x1db6,0x2001)](_0x516d85,_0x313705(0x4b5,0x124c,-0x3a1,0x29d)+_0x313705(0x1c36,0x148b,0x1e98,0x12bc));await _0x175756[_0x313705(0x796,0xe0e,-0x779,0x15d8)+_0x23937d(0x15c4,0x19ff,0xcae,0xe0a)](_0x5cd288[_0x23937d(0x118c,0x515,0x782,0xd8f)],_0x494254)['then'](_0x127732=>_0x1db05d(mess[_0x313705(0x183b,0x1620,0x1819,0x1f8f)]))[_0x313705(0xc9a,0x19cf,0xaee,0x3c1)](_0x35be0e=>_0x1db05d(jsonformat(_0x35be0e)));}break;case _0x4b485e[_0x313705(0xee2,0xd0e,0x756,0xb48)]:case _0x4b485e[_0x313705(0xbb2,0x74d,0xec3,0x1405)]:{if(_0x4b485e[_0x313705(0x1993,0x2499,0x19bd,0x1f48)](_0x4b485e[_0x313705(0x10fa,0x170a,0x1486,0xc9a)],_0x4b485e[_0x313705(0x162a,0xbba,0x983,0x1603)]))_0x2e03b3['game'][_0x313705(0x199b,0x1002,0x212a,0x262d)+'rn']=_0x4b485e[_0x23937d(0x317,-0xb57,0xa12,-0x68d)](_0x1296ce['sender'],_0x1ecf01[_0x23937d(0x4c0,0x145,-0xa60,0x686)][_0x313705(0x1fe0,0x157c,0x1bb9,0x242d)]),_0x2274e9=!![];else{const _0xc07e20=_0x4b485e['yJPQF'][_0x313705(0x1035,0x14dd,0xcb4,0x1ae)]('|');let _0x3118c6=-0x1cbb+-0x2476+0x4131*0x1;while(!![]){switch(_0xc07e20[_0x3118c6++]){case'0':if(_0x1bac1f)return _0x4b485e[_0x313705(0x47a,0x8fb,-0x356,0xb66)](_0x1db05d,mess[_0x313705(0x982,0x3f5,0xe6b,-0x531)]);continue;case'1':if(!_0x5cd288[_0x313705(0x2089,0x28e2,0x1854,0x17fd)])return _0x516d85(''+mess['group']);continue;case'2':if(!_0x17ccaf)return _0x516d85(''+mess[_0x313705(0x1818,0x1f45,0x1b53,0x2078)]);continue;case'3':if(!_0x494254)return _0x4b485e[_0x313705(0x174f,0xe54,0xf0b,0x1bfc)](_0x516d85,_0x313705(0x4b5,0xe59,-0x6f,-0x3cb)+_0x23937d(0x18d0,0x2265,0x17ce,0x1faf));continue;case'4':if(_0x1e03f5)return _0x4b485e['bnLvQ'](_0x1db05d,mess['banChat']);continue;case'5':if(!_0x424adc)return _0x4b485e['FFgrN'](_0x516d85,''+mess[_0x313705(0x1419,0x10f7,0x980,0x75a)]);continue;case'6':await _0x175756['groupUpdat'+_0x23937d(0x1d13,0x1fa2,0x1ae2,0xe8a)+'on'](_0x5cd288[_0x313705(0x14f2,0x1846,0x12c4,0x1f3c)],_0x494254)['then'](_0x4ffa7d=>_0x1db05d(mess['success']))[_0x313705(0xc9a,0x140e,0xe9f,0x103b)](_0x27ff97=>_0x1db05d(jsonformat(_0x27ff97)));continue;}break;}}}break;case _0x4b485e[_0x23937d(0x1892,0x2757,0x2735,0x1e1f)]:{if(_0x1bac1f)return _0x4b485e[_0x23937d(0x1681,0x1802,0x2238,0xc0f)](_0x1db05d,mess[_0x313705(0x982,0xb72,-0x4b4,0x1433)]);if(_0x1e03f5)return _0x1db05d(mess['banChat']);if(!_0x24aa58)return _0x4b485e[_0x23937d(0x169a,0xc02,0x1d9d,0xd93)](_0x516d85,''+mess[_0x313705(0xfea,0x819,0x37b,0x1d25)]);if(!_0x3e5ec4)return _0x516d85(_0x23937d(0xf0d,0x1ca,0x16ea,0xda3)+'\x20Image\x20Wit'+_0x313705(0x1744,0x212b,0x829,0x23ba)+_0x4b485e[_0x23937d(0x1179,0x1927,0x136b,0x201d)](_0xe1d953,_0x1354e9));if(!/image/['test'](_0x2a2351))return _0x516d85('Send/Reply'+_0x313705(0xd2c,0x135c,0x123d,-0x183)+_0x23937d(0x13de,0x568,0x746,0x1e54)+_0x4b485e[_0x313705(0x13bb,0x1478,0x1e5d,0x1ab3)](_0xe1d953,_0x1354e9));if(/webp/[_0x23937d(0x190e,0x26b3,0x1e2c,0xa84)](_0x2a2351))return _0x4b485e['yeget'](_0x516d85,_0x23937d(0xf0d,0x8f4,0x557,0x1a83)+_0x23937d(0x9c6,0x183f,0x1297,0x13b1)+'h\x20Caption\x20'+_0x4b485e[_0x23937d(0x17b5,0xc6a,0x9e5,0x1df0)](_0xe1d953,_0x1354e9));let _0x486834=await _0x175756['downloadAn'+_0x313705(0x11ae,0x1d72,0x1c63,0x81a)+'Message'](_0x3e5ec4);const _0x1d934c={};_0x1d934c[_0x313705(0xddf,0xaf8,0x193,0x1c51)]=_0x486834,await _0x175756[_0x23937d(0x1258,0x213c,0x691,0x18eb)+_0x313705(0x134c,0xbec,0x1a40,0xf5f)](_0x4b45af,_0x1d934c)[_0x313705(0xc9a,0xef0,0x80c,0xc6)](_0x29b825=>fs[_0x23937d(0xb,0xf1e,-0xbf8,-0x8ed)](_0x486834)),_0x4b485e[_0x23937d(0x1571,0x2488,0x117d,0xfef)](_0x1db05d,mess['success']);}break;case _0x4b485e['YpNJl']:case _0x4b485e[_0x23937d(0x13c6,0x1660,0x609,0x8c7)]:case _0x4b485e['VvAbz']:{if(_0x4b485e['YsZuI'](_0x4b485e[_0x23937d(0x34f,-0x8e3,-0x904,-0x73e)],'Orqsz')){if(_0x1bac1f)return _0x4b485e[_0x23937d(0x855,0x1267,0x813,0xff4)](_0x1db05d,mess[_0x313705(0x982,-0x11b,0xf9c,0x960)]);if(_0x1e03f5)return _0x4b485e['fGnBS'](_0x1db05d,mess[_0x313705(0x926,0x14c6,-0x229,0x1273)]);if(!_0x5cd288[_0x313705(0x2089,0x1e64,0x1431,0x2e2c)])return _0x4b485e[_0x313705(0x463,0xab6,0x90d,-0x18b)](_0x516d85,''+mess[_0x23937d(0x11c6,0xd9c,0xcf5,0x1c25)]);if(!_0x17ccaf)return _0x4b485e['NlBSd'](_0x516d85,''+mess[_0x313705(0x1818,0xe65,0x14b8,0x16bc)]);if(!_0x3e5ec4)return _0x4b485e[_0x313705(0x17f4,0xa50,0x1f39,0x1664)](_0x516d85,_0x23937d(0xf0d,0x110f,0xa9b,0xc23)+_0x23937d(0x9c6,-0x3b1,-0x9,0xdf9)+_0x313705(0x1744,0x18f9,0xa3d,0x1713)+_0x4b485e[_0x313705(0x6be,0x1d1,0xea,-0x614)](_0xe1d953,_0x1354e9));if(!/image/['test'](_0x2a2351))return _0x4b485e[_0x23937d(0x1b9c,0x1f36,0x1dbf,0x17a1)](_0x516d85,_0x313705(0x1273,0x1dfe,0x1e2c,0x36a)+_0x313705(0xd2c,0x4a1,0x1090,-0xa5)+_0x23937d(0x13de,0x548,0x1e14,0x1f6e)+_0x4b485e[_0x313705(0x1537,0x7b8,0x7b8,0x934)](_0xe1d953,_0x1354e9));if(/webp/[_0x313705(0x1c74,0x1eee,0x2b69,0x1d37)](_0x2a2351))return _0x4b485e[_0x313705(0x1745,0x25cf,0xe1b,0x190c)](_0x516d85,_0x313705(0x1273,0x1a47,0x80f,0x178e)+_0x23937d(0x9c6,0x1814,0xe18,-0x17d)+_0x23937d(0x13de,0x866,0x100a,0xd63)+(_0xe1d953+_0x1354e9));let _0x4d2d9f=await _0x175756[_0x313705(0x1135,0x1039,0x1747,0x185e)+_0x313705(0x11ae,0x6ce,0x8ed,0x1ea5)+_0x313705(0x117a,0x37b,0x9c8,0xdef)](_0x3e5ec4);const _0x4a4c95={};_0x4a4c95[_0x23937d(0xa79,0x13ba,0x1016,-0x297)]=_0x4d2d9f,await _0x175756[_0x313705(0x15be,0x209a,0x213a,0x16ca)+_0x313705(0x134c,0xc99,0x98b,0x21ad)](_0x5cd288[_0x23937d(0x118c,0xaab,0x164c,0x152c)],_0x4a4c95)[_0x23937d(0x934,0x12ca,-0x46c,0x12af)](_0x877113=>fs[_0x313705(0x371,0xafe,0xef1,-0x49a)](_0x4d2d9f)),_0x4b485e[_0x23937d(0x798,0x1059,0xb0d,-0x36a)](_0x1db05d,mess[_0x313705(0x183b,0x1b7f,0x1ca1,0x1069)]);}else _0x4b485e[_0x23937d(0x1745,0x12e9,0x1406,0x1a1b)](_0x3f0ddc,'⚠️\x20Please\x20i'+_0x23937d(0x13a8,0x1d9b,0x890,0xf76)+'lide\x20link\x20'+'!');}break;case _0x313705(0x3ff,-0x2a0,0x1304,-0x25b):{if(_0x313705(0x170c,0x16a4,0x1213,0x21e7)===_0x4b485e['NGAcm']){const _0x58a1ab={};_0x58a1ab[_0x23937d(0x1d39,0x177e,0x2844,0x11d0)]=''+_0x3a2a84['K85'];const _0x2471ca={};_0x2471ca[_0x23937d(0x5dc,0xb27,-0x78d,0x1432)]=_0x1573cb,_0xc38e2d['sendMessag'+'e'](_0x5674df[_0x23937d(0x118c,0x19d3,0xebc,0x1a8b)],_0x58a1ab,_0x2471ca);}else{if(_0x1bac1f)return _0x4b485e['WsOvE'](_0x1db05d,mess[_0x313705(0x982,0xf52,0xaf4,-0x27c)]);if(_0x1e03f5)return _0x4b485e[_0x313705(0x132d,0x17f3,0x9fc,0x1236)](_0x1db05d,mess['banChat']);if(!_0x5cd288['isGroup'])return _0x516d85(''+mess['group']);if(!_0x424adc)return _0x516d85(''+mess['botAdmin']);if(!_0x17ccaf)return _0x4b485e['FFgrN'](_0x516d85,''+mess[_0x313705(0x1818,0x2505,0x21fe,0x1647)]);let _0x18e188='╚»\x20TAG\x20ALL'+_0x313705(0x1627,0xee2,0x1370,0xdd9)+_0x313705(0x17cc,0x1c22,0x17cd,0x1acd)+'\x20'+(q?q:_0x4b485e['MrEJL'])+_0x313705(0x147b,0x590,0x1bc2,0x1da1);for(let _0xc5ca4e of _0x2e12a2){_0x4b485e[_0x23937d(0x1eb,-0x102,-0xc76,0x4f)](_0x4b485e[_0x313705(0xe0e,0x165a,-0x5d,0xa04)],_0x313705(0x1c42,0x126e,0x20c3,0x1ea7))?_0x18e188+=dragonemoji+'\x20@'+_0xc5ca4e['id']['split']('@')[-0x17*-0x10f+0x1e97+-0x36f0]+'\x0a':_0xd4b388[_0x313705(0x1122,0x947,0x1040,0x814)](_0x594722['id']['replace'](_0x4b485e[_0x23937d(0x13bc,0x1a5a,0x71f,0x10ba)],_0x4b485e[_0x23937d(0x1562,0x20f2,0xb3d,0x1df3)]));}_0x175756['sendMessag'+'e'](_0x5cd288[_0x23937d(0x118c,0xea3,0xe61,0xfc6)],{'text':_0x18e188,'mentions':_0x2e12a2['map'](_0x3c6e44=>_0x3c6e44['id'])},{'quoted':_0x5cd288});}}break;case _0x4b485e[_0x23937d(0x45d,-0x8bc,-0x6cd,-0x76)]:{const _0x2b8fe4=_0x4b485e[_0x23937d(0x18df,0x27a0,0x11b4,0x1902)]['split']('|');let _0x59a412=0x2*-0x1316+-0x10cd+0x36f9*0x1;while(!![]){switch(_0x2b8fe4[_0x59a412++]){case'0':if(!_0x17ccaf)return _0x4b485e[_0x313705(0xd02,0x8e1,-0x1a2,0x14d3)](_0x516d85,''+mess[_0x313705(0x1818,0x1b49,0xc90,0x13c1)]);continue;case'1':if(_0x1bac1f)return _0x4b485e['DYyYd'](_0x1db05d,mess[_0x23937d(0x61c,-0x164,0xfa7,0x10b7)]);continue;case'2':_0x175756[_0x23937d(0x944,0x538,0x1040,0xf66)+'e'](_0x5cd288['chat'],{'text':q?q:'','mentions':_0x2e12a2[_0x313705(0xe7c,0x189,0x1b6c,0xde5)](_0x49e968=>_0x49e968['id'])},{'quoted':_0x5cd288});continue;case'3':if(_0x1e03f5)return _0x4b485e[_0x313705(0x1d9f,0x2277,0x227d,0x15bb)](_0x1db05d,mess[_0x313705(0x926,-0x572,0x1551,0x748)]);continue;case'4':if(!_0x424adc)return _0x4b485e[_0x23937d(0xf,-0x649,-0x5c3,-0xebe)](_0x516d85,''+mess[_0x313705(0x1419,0x22e3,0x1125,0xd5f)]);continue;case'5':if(!_0x5cd288[_0x23937d(0x1d23,0x10f8,0x29e4,0x2ac3)])return _0x4b485e[_0x313705(0xc81,-0xb,0x14ea,0xa58)](_0x516d85,''+mess['group']);continue;}break;}}break;case _0x4b485e['RupbJ']:case _0x4b485e[_0x313705(0x2001,0x154a,0x1390,0x1322)]:{if(_0x1bac1f)return _0x4b485e[_0x313705(0x143c,0xac3,0xe70,0x2146)](_0x1db05d,mess[_0x23937d(0x61c,0x1a8,-0x454,-0x7db)]);if(_0x1e03f5)return _0x4b485e[_0x23937d(0xa1f,0x1386,0x6c8,0x7f0)](_0x1db05d,mess[_0x23937d(0x5c0,0xd9,-0x706,0x147e)]);if(!_0x4f8765&&_0x4b485e[_0x23937d(0xde5,0x568,0x19bf,0x176a)](global['db']['data'][_0x313705(0x1b7c,0x199a,0x1e6e,0xd2f)][_0x5cd288['sender']][_0x23937d(0x44f,-0xa,0x3bb,0x54)],-0x6ef*-0x1+-0x2*0x3b2+0x76))return _0x4b485e[_0x23937d(0x1417,0x606,0x6d8,0x1a61)](_0x1db05d,mess[_0x23937d(0x108f,0x1993,0x1dfc,0x1c8c)]);db['data']['users'][_0x5cd288[_0x23937d(0x14ce,0xbcc,0x10e2,0x1c81)]][_0x23937d(0x44f,0x569,0x108c,0x3ce)]-=0x1*0x1dfd+0x12c6+-0x4f*0x9e;let {styletext:_0x2aba30}=_0x4b485e['RrsEI'](require,'./lib/scra'+_0x23937d(0x653,0x414,0x1565,0x1317));if(!_0x494254)return _0x516d85(_0x23937d(0x7c0,0x32,0xe24,0x1054)+_0x23937d(0xa56,0x1319,0x2cd,0xd96));let _0x47f235=await _0x4b485e[_0x313705(0xb34,0x1079,-0x2d8,0xab4)](_0x2aba30,_0x494254),_0x145c72=_0x313705(0x20d1,0x2e57,0x2c1f,0x2bf2)+_0x23937d(0x180,-0x509,0xed4,-0x549)+_0x494254+'\x0a\x0a';for(let _0x330ccd of _0x47f235){_0x145c72+=dragonemoji+'\x20*'+_0x330ccd[_0x313705(0x17b7,0x2691,0x14b2,0x11f1)]+_0x313705(0xb42,0x530,0x18d5,0x8ae)+_0x330ccd[_0x23937d(0x18fd,0xfc0,0xba5,0x1ae5)]+'\x0a\x0a';}_0x4b485e['BlnyC'](_0x1db05d,_0x145c72);}break;case'vote':{if(_0x4b485e['Npymq']===_0x23937d(0x9c3,0x1414,0x3b9,0xb1f)){if(!_0x5cd288[_0x313705(0x2089,0x1607,0x12a5,0x2a21)])return _0x4b485e[_0x313705(0x1385,0x1c77,0x1446,0x20ed)](_0x516d85,''+mess[_0x313705(0x152c,0xb4f,0xf05,0x1c2b)]);if(_0x4b485e[_0x23937d(0x18a8,0xb18,0x27a3,0x2698)](_0x5cd288[_0x23937d(0x118c,0x1aef,0x1ee6,0x4ff)],vote))_0x4b485e[_0x313705(0x10cb,0x5c6,0x10cc,0x1912)](_0x516d85,'_There\x20Are'+'\x20Still\x20Vot'+'es\x20In\x20This'+_0x313705(0x12c3,0x190d,0x21b1,0x1589)+_0xe1d953+(_0x23937d(0x1132,0x1db3,0x17e5,0x90f)+_0x313705(0x809,0xd99,0x35b,0xfd0)+'\x20Vote\x20Sess'+_0x23937d(0x12f3,0x516,0x105c,0x15a3)));if(!_0x494254)return _0x4b485e[_0x23937d(0xfea,0x474,0xa5d,0xc7d)](_0x516d85,_0x23937d(0x98,0x7c5,-0x625,-0x398)+_0x23937d(0x48b,-0x4e6,0x630,0xb25)+_0x313705(0x1789,0x1d07,0x1fa1,0xc7d)+_0x23937d(0x1455,0x180e,0xe44,0x8d0)+(_0xe1d953+_0x1354e9)+(_0x23937d(0xf7,0x7de,-0xcbe,0x2ea)+'Owner*'));_0x4b485e[_0x313705(0x12d0,0xc91,0x1340,0x1977)](_0x1db05d,'Voting\x20Sta'+_0x23937d(0x98e,0xcd6,0xc00,0xf2b)+_0xe1d953+(_0x313705(0xb59,0x1649,0xd54,0x19e0)+_0x23937d(0xc74,0x1562,0x1679,0x96e)+_0x23937d(0x1e5,-0xbe8,0xdc8,-0x97e))+_0xe1d953+(_0x313705(0xc36,0x114c,0x2b9,0x176a)+'For\x20❮❮\x20NO\x20'+_0x23937d(0x11f6,0x416,0xd6f,0xe09))+_0xe1d953+(_0x313705(0x1d3e,0x186a,0x1dcd,0x2c07)+_0x23937d(0x552,0x140f,0x7bf,0x2a2)+_0x313705(0x1ffd,0x2f10,0x20af,0x16b6)+'\x0a*')+_0xe1d953+('delvote*\x20-'+_0x23937d(0x4a3,0x2ee,-0x94b,0x16e)+_0x313705(0xd58,0x10d2,0x583,0x1438)+_0x23937d(0x12f3,0x1105,0x7ca,0x199c))),vote[_0x5cd288[_0x23937d(0x118c,0x1aa7,0xcfb,0x9af)]]=[q,[],[]],await _0x4b485e['GnBTw'](sleep,0x17cc+0x19*-0x56+-0xb7e*0x1),upvote=vote[_0x5cd288[_0x23937d(0x118c,0x16ed,0x16d9,0x8ac)]][0x1*-0x1831+0xe48+-0x12*-0x8d],devote=vote[_0x5cd288[_0x313705(0x14f2,0x1da6,0xd66,0x1fa3)]][-0x711+-0x1dfe+0x2511],teks_vote='*❮❮\x20VOTE\x20❯'+_0x23937d(0x19,-0x329,-0xc6f,0x747)+'n:*\x20'+vote[_0x5cd288[_0x313705(0x14f2,0xc22,0x79c,0x7d5)]][-0x1502*-0x1+0x2405+-0x3907]+(_0x23937d(0x10f7,0xf80,0x1488,0x1435)+_0x23937d(0xa5,-0x55b,-0x94,0x611)+_0x313705(0x10e6,0x168a,0x1c86,0x28f)+'al:\x20')+vote[_0x5cd288[_0x313705(0x14f2,0x2367,0x1607,0x1b54)]][-0x1ff5+0x349+-0x1*-0x1cad]['length']+(_0x23937d(0x211,0x566,0xfe0,0x1e3)+_0x23937d(0x6d9,0xf94,0x1110,0x7b9)+_0x313705(0x180f,0xe33,0x17d5,0x204c)+_0x313705(0xeba,0x4cd,0xda4,0xe3c)+_0x23937d(0x12f4,0x70a,0x1916,0xb34))+vote[_0x5cd288[_0x23937d(0x118c,0x8de,0x1bf3,0x1db0)]][-0x208e+-0xfb*-0x15+0xbf9][_0x23937d(0x3de,0x44a,-0x128,0x4a2)]+(_0x313705(0x577,0x13ec,0x117d,0x43c)+_0x313705(0xec0,0xc15,0x68d,0x18d5))+_0xe1d953+(_0x313705(0x1498,0x6f2,0x807,0x226f)+_0x23937d(0x4a3,-0x522,-0x509,0xdf2)+_0x313705(0xd58,0xb2a,0xbcf,0x1306)+_0x313705(0x1659,0x189d,0x1441,0x1f43));const _0x3bca45={};_0x3bca45['displayTex'+'t']='❮❮\x20YES\x20❯❯';const _0x102a5f={};_0x102a5f[_0x313705(0x1e72,0x1ced,0x2052,0x14b9)]=_0xe1d953+_0x313705(0x1a01,0xf3c,0xd04,0x191a),_0x102a5f[_0x23937d(0x159c,0x18b2,0xcd9,0x1d22)]=_0x3bca45,_0x102a5f[_0x23937d(0x738,0x1282,0x10ad,0x142f)]=0x1;const _0x4abe6c={};_0x4abe6c['displayTex'+'t']=_0x4b485e[_0x313705(0x35e,0x61c,0x1066,0x287)];const _0x413ad7={};_0x413ad7[_0x23937d(0x1b0c,0x238d,0xde9,0x20a9)]=_0xe1d953+_0x23937d(0x1604,0x22b2,0x15ea,0x1f33),_0x413ad7[_0x313705(0x1902,0x17a7,0x136a,0x27aa)]=_0x4abe6c,_0x413ad7[_0x23937d(0x738,0xe57,-0x310,-0x485)]=0x1;let _0x1e9aa8=[_0x102a5f,_0x413ad7];const _0x4b9e6e={};_0x4b9e6e[_0x313705(0x209f,0x2ee9,0x2e67,0x29f2)]=teks_vote,_0x4b9e6e[_0x313705(0x13d4,0x13c9,0x1063,0x20ed)]=_0x175756[_0x313705(0x787,0x48a,0xa4e,-0x329)]['name'],_0x4b9e6e[_0x313705(0xfa0,0x17e7,0x8d3,0xf53)]=_0x1e9aa8,_0x4b9e6e[_0x23937d(0x1b19,0x1bad,0x2a12,0xc65)]=0x1;let _0x3f085b=_0x4b9e6e;_0x175756[_0x23937d(0x944,0x453,-0x27f,0x70f)+'e'](_0x5cd288['chat'],_0x3f085b);}else{if(_0x4b485e['ZdAan'](_0x5b4641,!![]))return;_0x6bbc79[_0x313705(0x15ca,0x10e1,0x10e2,0x109c)]=!![],_0x4b485e['RpgFP'](_0xf18208,_0x23937d(0x1471,0xdf3,0x6c6,0x2364)+_0x23937d(0x6e6,-0x45d,0x61a,0x11d8)+'ed\x20antitag'+'!');}}break;case _0x4b485e[_0x313705(0xc25,0x48b,0x6a3,0x1164)]:{if(!_0x5cd288['isGroup'])return _0x4b485e[_0x23937d(0x1cf2,0x2951,0x1212,0x1a28)](_0x516d85,''+mess[_0x313705(0x152c,0x191d,0x1dda,0x17ec)]);if(!_0x4b485e[_0x23937d(0x916,0x50e,0x10b2,0x1496)](_0x5cd288[_0x313705(0x14f2,0x9a1,0x1da1,0x107b)],vote))return _0x516d85('_*No\x20Votin'+_0x23937d(0x919,-0x106,0x13b9,0x7aa)+_0x23937d(0x17c7,0x1627,0x1144,0x16c3)+'*'+_0xe1d953+(_0x313705(0xb3f,0x160d,0x13aa,0x170f)+_0x23937d(0x1409,0x1a13,0x1a3d,0x735)+_0x313705(0x1d25,0x27c2,0x1632,0x2a30)));isVote=vote[_0x5cd288[_0x313705(0x14f2,0x1752,0x6f4,0x1a86)]][-0x2201+0x3*0xa7b+0x291][_0x23937d(0x1ce3,0x2737,0x1109,0x17a3)](vote[_0x5cd288[_0x313705(0x14f2,0x204d,0x9d7,0x8c5)]][0x25b7+0x10a9+-0x1b2f*0x2]),wasVote=isVote['includes'](_0x5cd288[_0x23937d(0x14ce,0xe0b,0x2228,0x11b1)]);if(wasVote)_0x4b485e[_0x313705(0x1f1b,0x1aa5,0x1835,0x192b)](_0x516d85,_0x23937d(0xfdb,0x8ce,0x17a7,0x1af4)+'ed');vote[_0x5cd288[_0x23937d(0x118c,0x1932,0x149f,0x720)]][0x3*0x976+-0x586*0x2+0x5c7*-0x3]['push'](_0x5cd288[_0x313705(0x1834,0x245b,0x1c2e,0x205c)]),menvote=vote[_0x5cd288['chat']][0x1*-0x40e+0x157*-0x1+0x566][_0x23937d(0x1ce3,0x187f,0x1813,0x15dd)](vote[_0x5cd288[_0x23937d(0x118c,0x1f49,0x1200,0x1822)]][0x53*-0x46+0x16*0x11c+-0x1b4]),teks_vote=_0x313705(0x1fa0,0x12ee,0x1a31,0x1c42)+_0x23937d(0x19,0x91e,-0xe2b,0x39b)+_0x23937d(0x1b66,0x130f,0x2936,0x1f9b)+vote[_0x5cd288['chat']][0x1ba*-0xc+-0x191b+0x2dd3]+('\x0a\x0a╔❮✮\x20UPVO'+_0x23937d(0x1a74,0x1a0d,0x2480,0x2466)+_0x313705(0x920,0x11f7,-0x202,0x87f))+vote[_0x5cd288[_0x313705(0x14f2,0x1b80,0x746,0x2196)]][0x221e+-0x1f46+-0x2d7][_0x23937d(0x3de,0x202,0x7f3,-0x999)]+'\x0a'+vote[_0x5cd288[_0x23937d(0x118c,0xe53,0xa34,0x196a)]][-0x1*0x258d+-0x1b8e+-0x56d*-0xc][_0x313705(0xe7c,0xc9f,0x551,0x1430)]((_0x12d480,_0x45312a)=>'╠\x20'+(_0x45312a+(0x1048+-0x2c9+-0xd7e))+'.\x20@'+_0x12d480['split']`@`[0x1*0x25bf+0x1f89+-0x1*0x4548])[_0x313705(0x1f7c,0x177c,0x14c2,0x28ab)]('\x0a')+(_0x313705(0x20b7,0x2ab2,0x139d,0x2afa)+_0x23937d(0x53c,-0x2f6,-0x91d,0x4f0)+_0x23937d(0xa2c,0x16de,0xde1,0xc5a)+_0x23937d(0xfd1,0xd4d,0x6f7,0x4ca))+vote[_0x5cd288[_0x23937d(0x118c,0x1311,0x1b99,0xe7c)]][0xf9e+-0x1d48+0x32*0x46][_0x313705(0x744,0xa7b,-0x57c,-0x7bd)]+'\x0a'+vote[_0x5cd288['chat']][-0x779*0x1+0x280+0x4fb][_0x313705(0xe7c,0x1a2d,0x1b14,0x4ca)]((_0x1bb446,_0x146ca0)=>'╠\x20'+(_0x146ca0+(0x7*0x71+0x272+0x76*-0xc))+_0x313705(0x12b8,0x17c1,0x156f,0xe57)+_0x1bb446[_0x23937d(0xccf,0xbc4,0x49,0x19bc)]`@`[-0x106+-0x2385+0x248b])[_0x313705(0x1f7c,0x1caa,0x2baa,0x10d1)]('\x0a')+(_0x23937d(0x1d51,0x240d,0x11dd,0x1d3d)+'\x0a*')+_0xe1d953+(_0x313705(0x1498,0xa98,0x236a,0x7fe)+_0x23937d(0x4a3,0x1131,-0x2cf,-0x68c)+_0x23937d(0x9f2,0xe1a,0x654,0x6cb)+_0x313705(0x1659,0x99e,0x94b,0x9b7));const _0x35cdcb={};_0x35cdcb[_0x23937d(0x13f4,0x1d34,0xd98,0x70d)+'t']=_0x4b485e['Nayeb'];const _0x454352={};_0x454352[_0x313705(0x1e72,0x107a,0x166d,0x2d7e)]=_0xe1d953+'upvote',_0x454352['buttonText']=_0x35cdcb,_0x454352[_0x23937d(0x738,0x10f,-0x640,0x194)]=0x1;const _0x3c9865={};_0x3c9865['displayTex'+'t']=_0x4b485e[_0x313705(0x35e,0x9ad,-0x312,-0x90a)];const _0x3e0d79={};_0x3e0d79[_0x313705(0x1e72,0x19c9,0x2a0a,0x2c78)]=_0xe1d953+_0x23937d(0x1604,0x11d2,0xc4b,0x1920),_0x3e0d79[_0x313705(0x1902,0x2205,0x1f50,0x165b)]=_0x3c9865,_0x3e0d79[_0x313705(0xa9e,0x150c,0x1783,0x9c8)]=0x1;let _0x44cc54=[_0x454352,_0x3e0d79];const _0x36f682={};_0x36f682[_0x23937d(0x1d39,0x2962,0x1a18,0x1a8d)]=teks_vote,_0x36f682[_0x23937d(0x106e,0x1bc0,0xf91,0xc36)]=_0x175756['user'][_0x313705(0x17b7,0x2022,0x1afa,0x1c24)],_0x36f682[_0x313705(0xfa0,0x1e28,0x1d6f,0x1cef)]=_0x44cc54,_0x36f682[_0x313705(0x1e7f,0x15f0,0x261e,0x2078)]=0x1,_0x36f682['mentions']=menvote;let _0x23c10c=_0x36f682;_0x175756[_0x23937d(0x944,0xc3d,0x699,-0x142)+'e'](_0x5cd288['chat'],_0x23c10c);}break;case _0x4b485e[_0x313705(0x1b19,0x21a7,0x17a5,0x267d)]:{if(_0x4b485e[_0x23937d(0xa3d,0x1069,0xdf2,0x4a9)](_0x4b485e['NlNlh'],_0x4b485e[_0x23937d(0x17e5,0x16ad,0x1734,0xd51)])){if(!_0x262124[_0x23937d(0x94f,0xb1f,0x137a,0x6af)][_0x23937d(0x1a6,-0x741,-0x8c2,-0x6b3)])return;}else{if(!_0x5cd288[_0x23937d(0x1d23,0x2a3f,0x1a24,0x120d)])return _0x4b485e[_0x313705(0xa51,0xd50,-0x3e9,0x1339)](_0x516d85,''+mess['group']);if(!_0x4b485e[_0x23937d(0x18a8,0x1f7c,0xacf,0x16c7)](_0x5cd288[_0x313705(0x14f2,0x6bb,0x75f,0x6b4)],vote))return _0x4b485e[_0x313705(0xdc0,0x1c2d,0x10c2,0xd)](_0x516d85,_0x313705(0x19eb,0x13e1,0x11bb,0x28f0)+'g\x20In\x20This\x20'+_0x313705(0x1b2d,0xc19,0x1563,0x14aa)+'*'+_0xe1d953+('vote*\x20-\x20To'+_0x23937d(0x1409,0x1b9e,0x6c9,0xe46)+'ing'));isVote=vote[_0x5cd288[_0x23937d(0x118c,0x1c10,0x120a,0xfb2)]][0x293*-0xd+-0xed*-0x1+-0xad9*-0x3][_0x313705(0x2049,0x20dc,0x279f,0x2c5c)](vote[_0x5cd288['chat']][0x16b9+-0x1423+-0x294]),wasVote=isVote[_0x23937d(0x178,-0xc6b,-0x9f1,0x3)](_0x5cd288['sender']);if(wasVote)return _0x516d85(_0x313705(0x1341,0x2251,0xe13,0x631)+'ed');vote[_0x5cd288[_0x313705(0x14f2,0x11a3,0x1b11,0x1f85)]][-0x25ab*-0x1+-0x1a0+0xcd*-0x2d][_0x313705(0x1122,0xe48,0xc14,0x1a76)](_0x5cd288[_0x313705(0x1834,0xc0e,0x2592,0x1a50)]),menvote=vote[_0x5cd288['chat']][-0x1c5b+0x1*0xf09+0xd53][_0x23937d(0x1ce3,0x26f3,0x16a7,0x110a)](vote[_0x5cd288[_0x23937d(0x118c,0x8ec,0x802,0x466)]][-0x54d*0x7+0x1859+0xcc4]),teks_vote=_0x313705(0x1fa0,0x2931,0x1f24,0x153e)+_0x23937d(0x19,0xb9e,0xe84,-0x241)+_0x313705(0x1ecc,0x2cc9,0x291c,0x2a57)+vote[_0x5cd288['chat']][0x1*0x46d+-0xb*0x3b+-0x1e4]+(_0x23937d(0x339,-0x983,0xd53,0xfa7)+_0x313705(0x1dda,0x2143,0x13bb,0x206e)+_0x23937d(0x5ba,0x10fb,0xb4d,0xfc8))+vote[_0x5cd288[_0x313705(0x14f2,0x1d94,0x71c,0x14c3)]][-0x1c6b+-0x208c+-0x4*-0xf3e][_0x23937d(0x3de,-0xa7c,-0x401,0x8f1)]+'\x0a'+vote[_0x5cd288[_0x313705(0x14f2,0x2284,0x16f7,0x10b6)]][-0x1de3*-0x1+0x1313+0x53*-0x97][_0x23937d(0xb16,0xbae,0x1837,0x186)]((_0xc88684,_0xc221ca)=>'╠\x20'+(_0xc221ca+(-0x1b0b+0x181a+0x2f2))+_0x313705(0x12b8,0xb81,0xd8a,0x1a0f)+_0xc88684[_0x313705(0x1035,0x1c94,0x1498,0x90c)]`@`[-0x1ae4+-0x14b*-0xd+0x1*0xa15])[_0x313705(0x1f7c,0x1722,0x2345,0x13e3)]('\x0a')+(_0x23937d(0x1d51,0x1028,0x1b13,0x294f)+_0x313705(0x8a2,-0x2b,-0x5fa,0x81d)+_0x313705(0xd92,0xaed,0x146c,0xc5c)+_0x23937d(0xfd1,0xc17,0x1592,0xfed))+vote[_0x5cd288[_0x313705(0x14f2,0x11d3,0x161d,0x158c)]][0x1*0x2566+-0x33a*0x3+0x1bb6*-0x1]['length']+'\x0a'+vote[_0x5cd288[_0x313705(0x14f2,0x1b43,0xf75,0xbb0)]][-0x2524+0x2*-0x4a0+0x2*0x1733][_0x23937d(0xb16,0x742,0x112,0xd3f)]((_0x140a2b,_0x1feb9a)=>'╠\x20'+(_0x1feb9a+(-0x9*-0x14b+-0x9e6+-0x1bc))+_0x313705(0x12b8,0xdbc,0x1784,0x5d4)+_0x140a2b['split']`@`[-0x1*-0x6fb+0x33*-0x6a+0xe23])[_0x23937d(0x1c16,0x1d3f,0xef6,0x20b7)]('\x0a')+(_0x313705(0x20b7,0x2fce,0x2d4f,0x2e68)+'\x0a*')+_0xe1d953+(_0x313705(0x1498,0x20ea,0x1e77,0xab6)+'\x20To\x20Delete'+_0x23937d(0x9f2,0x1012,0xfac,0x1262)+'ion');const _0x29d92d={};_0x29d92d['displayTex'+'t']=_0x4b485e[_0x313705(0x7a1,0x7b9,0xc02,0x4f0)];const _0x3dbfb5={};_0x3dbfb5[_0x23937d(0x1b0c,0x20d1,0x237e,0x1ff8)]=_0xe1d953+_0x23937d(0x169b,0x1f29,0x213f,0x176a),_0x3dbfb5[_0x23937d(0x159c,0x183b,0x1939,0x17f1)]=_0x29d92d,_0x3dbfb5[_0x23937d(0x738,0x254,0x130,0xe4d)]=0x1;const _0xa18de8={};_0xa18de8[_0x313705(0x175a,0xdc2,0x1fe1,0x2426)+'t']=_0x4b485e['TLexS'];const _0x5ac5ee={};_0x5ac5ee[_0x23937d(0x1b0c,0xe9c,0x1f9b,0x26f9)]=_0xe1d953+_0x23937d(0x1604,0xfaf,0xafc,0x23fa),_0x5ac5ee['buttonText']=_0xa18de8,_0x5ac5ee[_0x23937d(0x738,0x15b7,0x2a9,0xb8c)]=0x1;let _0x4d79f6=[_0x3dbfb5,_0x5ac5ee];const _0x2e283d={};_0x2e283d[_0x23937d(0x1d39,0x190e,0x2b5e,0x2aaa)]=teks_vote,_0x2e283d['footer']=_0x175756[_0x23937d(0x421,0x9b6,0xdfa,0xe7)]['name'],_0x2e283d[_0x313705(0xfa0,0x116a,0x14de,0x9b)]=_0x4d79f6,_0x2e283d[_0x313705(0x1e7f,0x23bb,0x1131,0x1809)]=0x1,_0x2e283d[_0x313705(0x1cce,0x2bdb,0x1a90,0x12f1)]=menvote;let _0x281631=_0x2e283d;_0x175756[_0x313705(0xcaa,0x1587,0x971,0x518)+'e'](_0x5cd288[_0x23937d(0x118c,0x1b31,0x15d5,0x170d)],_0x281631);}}break;case _0x23937d(0xff5,0x9a1,0x2a4,0xedd):if(!_0x5cd288[_0x23937d(0x1d23,0x12c9,0x10f2,0x2269)])return _0x516d85(''+mess[_0x23937d(0x11c6,0x18d6,0x1b46,0x18ef)]);if(!_0x4b485e[_0x23937d(0x916,0x6db,0x102,0xce8)](_0x5cd288[_0x313705(0x14f2,0x1698,0x1dfc,0x1678)],vote))return _0x4b485e[_0x313705(0x1ed4,0x1fcc,0x2790,0x2a8d)](_0x516d85,_0x313705(0x19eb,0xf9b,0x17e6,0xcca)+'g\x20In\x20This\x20'+_0x313705(0x1b2d,0x258f,0x29ff,0x2a45)+'*'+_0xe1d953+(_0x313705(0xb3f,-0x2c1,-0x9b,0x18d4)+_0x313705(0x176f,0xafe,0x24b7,0x1603)+_0x23937d(0x19bf,0xc52,0x169e,0x1dac)));teks_vote=_0x313705(0x1fa0,0x1f5d,0x23c8,0x151a)+_0x313705(0x37f,0xa39,0xbb6,0x4bd)+_0x313705(0x1ecc,0x1f28,0x1a36,0x1457)+vote[_0x5cd288[_0x23937d(0x118c,0x11ed,0x1f26,0xabe)]][-0x1d8e+0x158f+0x17*0x59]+(_0x313705(0x69f,0xfa6,0x102e,-0x4c4)+_0x23937d(0x1a74,0xd3c,0x2231,0xfa9)+_0x313705(0x920,0x93f,0x9e1,0xcfa))+upvote[_0x313705(0x744,0x1563,-0x282,0x4c)]+'\x0a'+vote[_0x5cd288[_0x313705(0x14f2,0x1faa,0xd50,0x140a)]][-0x1d*-0xb5+0x687*0x3+-0x1f*0x14b][_0x23937d(0xb16,-0x147,0x169f,0x1a2f)]((_0x344044,_0x500736)=>'╠\x20'+(_0x500736+(0x533+0x165*-0x1+-0x3cd))+'.\x20@'+_0x344044['split']`@`[-0x26ca+-0x17*0x113+0x3f7f])[_0x23937d(0x1c16,0x1a1f,0xd15,0x2487)]('\x0a')+(_0x313705(0x20b7,0x2164,0x2651,0x135e)+_0x23937d(0x53c,0xbde,0xb28,0xbe5)+_0x313705(0xd92,0x1c35,0x10ae,0xf1f)+_0x23937d(0xfd1,0x17fb,0xca8,0x1d10))+devote[_0x23937d(0x3de,0x2bf,0x698,0xd21)]+'\x0a'+vote[_0x5cd288[_0x313705(0x14f2,0x121d,0x19ea,0xd7e)]][-0x1*-0xacf+-0x25b5*-0x1+0x1*-0x3082][_0x23937d(0xb16,-0x384,0x1236,0x187c)]((_0x245b1d,_0x392716)=>'╠\x20'+(_0x392716+(0xe*-0x162+-0x4*0x61f+0x2bd9))+_0x313705(0x12b8,0x2194,0x1787,0xe73)+_0x245b1d[_0x23937d(0xccf,0x1ba2,0x1c6,0x1acd)]`@`[0x16ff+0x22d8+-0x39d7])[_0x313705(0x1f7c,0x19a1,0x28d1,0x1f28)]('\x0a')+(_0x23937d(0x1d51,0x21c9,0xfcb,0x197d)+'\x0a*')+_0xe1d953+(_0x313705(0x1498,0x1eb9,0x183b,0x9dd)+_0x23937d(0x4a3,0x39a,0x72d,0xe9e)+_0x313705(0xd58,0x13e9,0x181b,0x7d8)+'ion\x0a\x0a\x0a©')+_0x175756[_0x313705(0x787,0x167,-0x6,0x15de)]['id']+'\x0a',_0x175756['sendTextWi'+_0x313705(0x1cdb,0xf17,0xf04,0x23a4)](_0x5cd288[_0x313705(0x14f2,0x1081,0x1eb6,0x1841)],teks_vote,_0x5cd288);break;case _0x4b485e[_0x23937d(0xcc8,0x1baf,0x111a,0x7a8)]:case _0x4b485e[_0x313705(0xb6b,0x5f9,0x198a,-0x324)]:case _0x313705(0xd98,-0x28,0xe90,0xd66):{if(_0x4b485e['mnVdY'](_0x4b485e['xZOvc'],_0x4b485e[_0x23937d(0x1dac,0x2acd,0x1ea0,0x2462)]))return _0x4b485e[_0x23937d(0x705,0x1a4,-0x1b3,0x1068)];else{if(!_0x5cd288[_0x313705(0x2089,0x1e33,0x22b8,0x27a2)])return _0x4b485e[_0x23937d(0x48a,-0x6e3,0x1350,0x333)](_0x516d85,''+mess[_0x23937d(0x11c6,0x124b,0x76b,0x1889)]);if(!(_0x5cd288[_0x313705(0x14f2,0x1669,0x90a,0x21e8)]in vote))return _0x516d85(_0x23937d(0x1685,0x2270,0x2331,0x2561)+_0x23937d(0x919,0xfcc,-0x4e3,0x14f8)+_0x313705(0x1b2d,0xc12,0xf64,0xde7)+'*'+_0xe1d953+('vote*\x20-\x20To'+_0x313705(0x176f,0x117e,0x2331,0x215e)+_0x313705(0x1d25,0x1833,0x1187,0x2aa8)));delete vote[_0x5cd288[_0x23937d(0x118c,0xb41,0xe71,0x1010)]],_0x4b485e[_0x313705(0x156a,0x1102,0x9a8,0xacf)](_0x1db05d,'Successful'+'ly\x20Deleted'+_0x313705(0xc47,0xf88,0x9c0,0x2b0)+_0x23937d(0x16d2,0xc98,0x9ec,0x1131)+_0x313705(0x1623,0x1548,0x1478,0x836)+'p');}}break;case _0x4b485e[_0x23937d(0x18d2,0x1432,0x1a2e,0x9c0)]:{if(_0x1bac1f)return _0x4b485e[_0x23937d(0x1382,0x782,0xb6c,0x1ac7)](_0x1db05d,mess['ban']);if(_0x1e03f5)return _0x4b485e['GVCDo'](_0x1db05d,mess[_0x23937d(0x5c0,0x7d4,0x2f5,0x30d)]);if(!_0x5cd288[_0x313705(0x2089,0x16b5,0x1edb,0x158a)])return _0x516d85(''+mess['group']);if(!_0x424adc)return _0x516d85(''+mess['botAdmin']);if(!_0x17ccaf)return _0x4b485e[_0x23937d(0x1379,0x1465,0x1cfd,0x1b4d)](_0x516d85,''+mess[_0x313705(0x1818,0xfda,0xb3c,0x1488)]);if(_0x4b485e['SLiWR'](_0x1ba32f[-0x24c2+0x1*0x15ef+0x2f7*0x5],_0x23937d(0x1863,0x1a1b,0xb63,0x1dc9)))await _0x175756[_0x23937d(0xba7,0x2bb,0x18ad,0xe51)+_0x23937d(0x9c,0xab6,0x58c,0x375)](_0x5cd288['chat'],_0x4b485e['mAqgq'])[_0x313705(0x1ec7,0x23ed,0x248c,0x2d7c)](_0x585cb0=>_0x1db05d(_0x23937d(0x1471,0x207e,0x2201,0xc50)+_0x23937d(0x1507,0x19fe,0xd73,0x720)+_0x313705(0x1713,0x1b03,0x235c,0xc5b)+_0x23937d(0xa17,0x152c,0x14cd,0x171a)))[_0x23937d(0x934,0x1126,0x17f9,0x16e0)](_0x52d295=>_0x1db05d(jsonformat(_0x52d295)));else{if(_0x4b485e[_0x313705(0x1556,0x7d4,0x1df8,0xd2c)](_0x1ba32f[-0x9cc+0x487*0x1+-0x1*-0x545],_0x23937d(0xbce,0x45,0x1287,0x628))){if(_0x4b485e[_0x23937d(0x46e,-0x593,0x2ba,-0x5b5)]!==_0x4b485e[_0x23937d(0x1175,0x1cbc,0x11f0,0x1e0c)])await _0x175756[_0x23937d(0xba7,0x1254,0x1891,0x1376)+_0x23937d(0x9c,-0x4b5,0x48f,-0x4fe)](_0x5cd288[_0x23937d(0x118c,0xa1b,0xa36,0xe98)],_0x23937d(0x104b,0x16bb,0x830,0x22c))[_0x23937d(0x1b61,0x1289,0x2368,0x2914)](_0x220771=>_0x1db05d(_0x23937d(0x1471,0x1892,0x180a,0x1028)+_0x313705(0x1eb9,0x11b6,0x10d5,0x15c6)+'Edit\x20Group'+_0x313705(0xd7d,0x11e2,0x1c57,-0x14b)))['catch'](_0x376aa1=>_0x1db05d(jsonformat(_0x376aa1)));else{const _0x2714b6={};_0x2714b6[_0x23937d(0x1d39,0x2486,0x2795,0x2a48)]=''+_0x38c57f['K74'];const _0x5bd158={};_0x5bd158[_0x23937d(0x5dc,0xe0,0x4a2,0xaf4)]=_0x2c5b79,_0x227922[_0x23937d(0x944,0xfb2,0x10d8,0x176b)+'e'](_0xb339be[_0x313705(0x14f2,0x1799,0x1c47,0xded)],_0x2714b6,_0x5bd158);}}else{if(_0x4b485e[_0x23937d(0x11f4,0x1b16,0x118b,0x524)](_0x4b485e[_0x23937d(0xfa6,0x892,0x18a6,0x9ad)],_0x4b485e[_0x313705(0x130c,0x2012,0x157f,0x15f0)])){const _0x2b4c38={};_0x2b4c38['buttonId']=_0x4b485e[_0x23937d(0x365,0x83b,-0x7c,0x4b)],_0x2b4c38[_0x23937d(0x159c,0xbce,0x1abd,0x90f)]={},_0x2b4c38['type']=0x1,_0x2b4c38[_0x23937d(0x159c,0xbce,0x1abd,0x90f)]['displayTex'+'t']=_0x4b485e[_0x23937d(0xecc,0x87a,0x1c0d,0x1b1c)];const _0x5aba70={};_0x5aba70['buttonId']=_0x4b485e[_0x313705(0x1ea6,0x220a,0x262d,0x2470)],_0x5aba70[_0x23937d(0x159c,0x991,0x1802,0x99e)]={},_0x5aba70[_0x23937d(0x738,0x846,0x2cc,0xa27)]=0x1,_0x5aba70[_0x23937d(0x159c,0x991,0x1802,0x99e)][_0x23937d(0x13f4,0xc97,0x57e,0x20fa)+'t']=_0x4b485e[_0x313705(0x101c,0x1450,0x1ec0,0x1c1f)];let _0x3fbc06=[_0x2b4c38,_0x5aba70];await _0x175756[_0x23937d(0x7d8,0x171,0x14a0,-0x537)+_0x313705(0x1480,0x1b56,0x75b,0x8c5)](_0x5cd288['chat'],_0x3fbc06,_0x23937d(0x1544,0x1413,0x2364,0x1e40)+_0x23937d(0x26e,-0x47b,0x29b,0x4db),_0x175756[_0x23937d(0x421,0xdd,0xbf4,-0x8d4)][_0x313705(0x17b7,0xc89,0x25f1,0x1462)],_0x5cd288);}else{const _0x4da5c9={};_0x4da5c9[_0x23937d(0x13f4,0x5a6,0x13cb,0x148c)+'t']=_0x23937d(0x175b,0x261a,0x1851,0x1304)+_0xc4b614++;const _0x50413c={};_0x50413c[_0x23937d(0x1b0c,0x1659,0x29e5,0x2458)]=_0x23937d(0x1205,0x1799,0xfbf,0x1ece)+_0x490c05[_0x23937d(0x738,0x1471,-0x47,0x15a6)]+'\x20'+_0x49e1a8[_0x23937d(0xa79,0xcd8,-0x37,0x677)],_0x50413c[_0x23937d(0x159c,0x8aa,0x10d0,0xacf)]=_0x4da5c9,_0x50413c['type']=0x1,_0x577d8d[_0x23937d(0xdbc,0x153d,0xd12,0x159d)](_0x50413c);}}}}break;case _0x23937d(0xe87,0x578,0xc2d,0x196c)+'r':case _0x4b485e['aDkAs']:if(_0x1bac1f)return _0x4b485e[_0x23937d(0x640,0xc43,0x44d,-0x897)](_0x1db05d,mess[_0x313705(0x982,0x117b,0xa36,0x8d9)]);if(_0x1e03f5)return _0x4b485e['gmguF'](_0x1db05d,mess[_0x23937d(0x5c0,0x38,0x7dc,0x13c5)]);if(!_0x5cd288[_0x23937d(0x1d23,0x2794,0x2429,0x23c0)])return _0x4b485e['EbVyq'](_0x516d85,mess[_0x23937d(0x11c6,0x12d1,0x13d9,0x1250)]);if(!_0x424adc)return _0x4b485e['nsfpY'](_0x1db05d,mess[_0x313705(0x1419,0x172a,0x1533,0x60b)]);if(!_0x17ccaf&&!_0x24aa58)return _0x1db05d(mess['admin']);if(_0x4b485e[_0x313705(0x1b3c,0x21c8,0x277b,0x2625)](_0x1ba32f['length'],0x2*-0xa49+-0x179*-0x1a+-0x11b7*0x1))return _0x4b485e[_0x23937d(0x14ab,0xa14,0xd23,0x1df3)](_0x1db05d,_0x4b485e['joPrK']);if(_0x4b485e[_0x23937d(0x858,0xf55,0x1083,-0x545)](_0x1ba32f[0x6ce+-0x1*-0xce+0x1e7*-0x4],'on')){if(_0x32f642)return _0x4b485e[_0x313705(0x1e2d,0x21c8,0x21db,0x23a2)](_0x1db05d,_0x23937d(0x1307,0x879,0xfb1,0x1d25)+_0x23937d(0x6f1,0x906,-0x734,0xbb1));autosticker['push'](_0x423161),fs['writeFileS'+_0x23937d(0x12d2,0x1f0e,0x62e,0x1ff3)](_0x313705(0xe81,0x169d,0x12e6,0x1b1a)+_0x313705(0x20d4,0x1248,0x19de,0x2706)+_0x23937d(0x1df0,0x248e,0x23fc,0x1cec)+'.json',JSON['stringify'](autosticker)),_0x1db05d(_0x4b485e[_0x313705(0x8d1,-0x45b,-0x540,0x163c)]);}else{if(_0x4b485e[_0x23937d(0xed8,0x1061,0xb09,0x4e8)](_0x1ba32f[0x8*-0x45f+-0x1*-0x1466+0xe92],_0x23937d(0xa84,0x1439,0x1a5,-0x491))){let _0x24b4f1=autosticker[_0x23937d(0x9e6,-0x2dd,0x17d4,-0x439)](_0x423161);autosticker['splice'](_0x24b4f1,0x1*0xd29+-0x743*0x4+0xfe4),fs[_0x23937d(0x19b0,0x1c5f,0x1561,0xfd7)+'ync'](_0x4b485e['hSXbZ'],JSON[_0x313705(0x104d,0x11d0,0xb41,0x13e6)](autosticker)),_0x4b485e[_0x313705(0x20e5,0x1909,0x14cc,0x24cb)](_0x1db05d,_0x4b485e[_0x23937d(0x1142,0x1083,0x166c,0xb3f)]);}}break;case _0x4b485e[_0x23937d(0x1aff,0x11f5,0x1b41,0x19e6)]:case _0x4b485e[_0x313705(0x1956,0x2533,0x1cbb,0x222e)]:if(_0x1bac1f)return _0x4b485e['bjxIw'](_0x1db05d,mess['ban']);if(_0x1e03f5)return _0x4b485e[_0x313705(0x5e2,0xee5,-0x2c8,0xd74)](_0x1db05d,mess[_0x23937d(0x5c0,0x1336,0xbc2,0xcda)]);if(!_0x5cd288[_0x313705(0x2089,0x25d3,0x2385,0x1d5a)])return _0x4b485e[_0x313705(0x1429,0x2247,0x22a7,0x1f42)](_0x516d85,mess[_0x23937d(0x11c6,0x16ad,0x1225,0x15eb)]);if(_0x4b485e[_0x313705(0x6d4,-0x1e6,-0x714,0xc8e)](_0x1ba32f[_0x23937d(0x3de,0x2f2,0xd1d,-0x3bf)],-0x4c1*0x6+-0x1295+-0x43*-0xb4))return _0x1db05d(_0x4b485e[_0x23937d(0x18e8,0x1766,0x13ac,0x1085)]);if(_0x4b485e['HOYFP'](_0x1ba32f[0xb30+0xfce*-0x2+0x1*0x146c],'on')){if(_0x353a5b)return _0x4b485e[_0x23937d(0x1d97,0x12e4,0x1965,0x24ad)](_0x1db05d,_0x313705(0x166d,0x2192,0x23e0,0x21f2)+'tivated');_autostick[_0x23937d(0xdbc,0x17a1,0x1891,0x1096)](_0x423161),fs['writeFileS'+_0x23937d(0x12d2,0x944,0x1655,0x626)](_0x4b485e[_0x23937d(0x173e,0xa2b,0x2327,0x246f)],JSON[_0x23937d(0xce7,0xf59,0x9c9,0x12a2)](autosticker)),_0x4b485e[_0x23937d(0x3c9,0x1172,-0x770,0x9c7)](_0x1db05d,_0x4b485e['WABHD']);}else{if(_0x4b485e[_0x313705(0x1692,0x11ce,0x77d,0xc99)](_0x1ba32f[0x1d3f+-0xa3+-0x1c9c],_0x4b485e['hbAtH'])){let _0x586ec4=autosticker[_0x313705(0xd4c,0xd60,0x16cb,0x79f)](_0x423161);_autostick[_0x313705(0x961,0xc5f,0x1009,-0x44e)](_0x586ec4,0x1a6b*0x1+-0x21c5+-0x75b*-0x1),fs[_0x23937d(0x19b0,0x1b81,0x1990,0x217f)+_0x23937d(0x12d2,0x78d,0xe45,0x1f83)]('./Android/'+_0x23937d(0x1d6e,0x13fd,0x14ec,0x1519)+_0x313705(0xe3c,0x341,0xd74,0x122c)+'.json',JSON[_0x313705(0x104d,0x1e5e,0x1735,0x19cf)](autosticker)),_0x4b485e['gqkDR'](_0x1db05d,_0x4b485e[_0x23937d(0x1aeb,0x1730,0x1dd0,0x1fa1)]);}}break;case _0x4b485e['YeTHp']:{if(_0x4b485e['MTFzq']('NZXDd',_0x4b485e['Ysams'])){if(!_0x5bc4ec)return _0x4b485e['VEyif'](_0x59a5da,_0x4b485e[_0x313705(0xac8,0x11c7,0x6ee,0x17be)]);if(_0x3ccaac){_0x618d62[_0x313705(0xcd2,0x1b41,0xaef,0x80)]=_0x4b136d;const _0x3be488={};_0x3be488[_0x313705(0xddf,0xb51,0x196f,0x7c6)]='https://i.'+_0x23937d(0x1334,0x1c97,0xe13,0x1abd)+'Mmdx/20220'+_0x23937d(0x145f,0x15bc,0x1d4a,0x645)+'.jpg';const _0x43a0de={};_0x43a0de[_0x23937d(0x1c43,0x23d8,0x14f3,0x225c)]=_0x3be488,_0x43a0de['caption']=_0x23937d(0x190c,0xc7a,0x2313,0x1ef0)+_0x23937d(0xc34,0x53a,0x712,0x1385)+_0x313705(0x12f3,0x63d,0x10a5,0x1b37)+_0x23937d(0x1a12,0x177a,0x144d,0x261c)+'\x20\x20'+_0x3a5c21[_0x313705(0xcd2,0x1264,0x527,0x465)]+('\x0a\x0a[\x20◉\x20ʀᴇᴅ-'+_0x313705(0xecf,0x1250,0x64f,0xc55)+']');const _0x28d68d={};_0x28d68d['quoted']=_0x329287,_0x338255['sendMessag'+'e'](_0xe0eb80['chat'],_0x43a0de,_0x28d68d);}}else{if(_0x1bac1f)return _0x1db05d(mess[_0x23937d(0x61c,0x1326,0xdd6,0x75a)]);if(_0x1e03f5)return _0x4b485e[_0x313705(0xd2b,0x20b,0xcbc,0xae7)](_0x1db05d,mess[_0x313705(0x926,-0x44d,0x4e9,0x2de)]);if(!_0x5cd288[_0x313705(0x2089,0x1460,0x2678,0x2c76)])return _0x4b485e[_0x313705(0x7a6,0x1076,0x5c5,0x125a)](_0x516d85,mess[_0x23937d(0x11c6,0x1840,0x207b,0x1854)]);if(!_0x424adc)return _0x4b485e[_0x313705(0xefb,0x6d8,0x3a,0x9e6)](_0x516d85,mess[_0x313705(0x1419,0x16be,0x1824,0x1a32)]);if(!_0x17ccaf&&!_0x24aa58)return _0x4b485e['NlBSd'](_0x516d85,mess[_0x313705(0x1818,0x26c5,0x1a5d,0x191e)]);if(_0x4b485e[_0x23937d(0x3ee,0x6c2,-0x2f5,0x1dc)](_0x1ba32f[-0xd69+0x4c0+0x8a9],'on')){if(_0x4b485e[_0x313705(0x1ad6,0x27e8,0x2756,0x1210)](_0x4b485e[_0x23937d(0xc6e,0xd22,0x3ba,0x4a8)],_0x4b485e[_0x23937d(0xc6e,0xc93,0x13ac,0x11af)])){if(_0x353ad6)return _0x4b485e[_0x313705(0x1af7,0x205b,0x1d9b,0x2559)](_0x516d85,_0x4b485e[_0x313705(0x1da6,0x27af,0x2c71,0x19af)]);ntilink['push'](_0x423161),_0x4b485e[_0x23937d(0xf94,0xfaf,0x1a74,0x1d1f)](_0x516d85,_0x4b485e[_0x23937d(0x147f,0xe32,0xf6a,0xfae)]);var _0x1d198c=await _0x175756[_0x23937d(0xba4,-0x258,0xb98,0x19d9)+_0x23937d(0x161c,0x237c,0x7d4,0x1f3e)](_0x423161),_0x184ad9=_0x1d198c[_0x4b485e[_0x23937d(0x1430,0x104c,0x6c7,0x973)]],_0x3c9da9=[];_0x184ad9['map'](async _0x11ef0d=>{function _0x3ab2e0(_0x3fd9db,_0x240363,_0x59aff2,_0x42cb18){return _0x23937d(_0x42cb18- -0xb9,_0x240363,_0x59aff2-0x157,_0x42cb18-0x2d);}function _0x450cea(_0x1c8331,_0x4c2bd9,_0xbce955,_0x4a148a){return _0x313705(_0x4c2bd9-0xd8,_0xbce955,_0xbce955-0x134,_0x4a148a-0x177);}_0x3c9da9[_0x3ab2e0(0x69c,0x40c,0x793,0xd03)](_0x11ef0d['id'][_0x450cea(0x223d,0x1cb0,0x1e46,0x163e)](_0x3ab2e0(0xd07,0x16,0x3b6,0x381),_0x4b485e[_0x3ab2e0(0x1d87,0x1416,0xa8d,0x14a9)]));});const _0x5af11a={};_0x5af11a['mentionedJ'+'id']=_0x3c9da9;const _0xd58233={};_0xd58233[_0x23937d(0x1d39,0x23d0,0x1ca2,0xfb8)]=_0x313705(0x16ee,0xad3,0x11cb,0x207e)+_0x313705(0x40a,0xf49,0x71e,0x1ed)+_0x23937d(0x1452,0x2165,0x16dc,0x120b)+_0x23937d(0x16cb,0x1795,0x18bf,0x1d26)+_0x313705(0x17f8,0x141a,0x1ab4,0xf44)+_0x313705(0x459,0x2e8,0x12d1,0x1150)+'group\x20link'+'\x20in\x20this\x20g'+'roup\x20or\x20u\x20'+_0x313705(0x17d6,0x107b,0x1b04,0x1155)+_0x23937d(0x130f,0xe25,0xeda,0x203e)+_0x313705(0x186a,0x117b,0x1a05,0x143c),_0xd58233['contextInf'+'o']=_0x5af11a;const _0x4e3e92={};_0x4e3e92[_0x23937d(0x5dc,-0x5e7,0x1397,0x14b7)]=_0x5cd288,_0x175756['sendMessag'+'e'](_0x423161,_0xd58233,_0x4e3e92);}else _0x4b485e[_0x23937d(0xace,0x18b,0x59,0x3b2)](_0x33a395,_0x313705(0x16af,0x1185,0xccc,0x1369)+'!');}else{if(_0x4b485e[_0x23937d(0xd03,0x117f,0x14af,0xe58)](_0x1ba32f[-0x20a0+-0x1*-0x1ffd+0xa3],_0x4b485e['hbAtH'])){if(!_0x353ad6)return _0x4b485e[_0x313705(0x1ccd,0x151b,0x1204,0x1c6c)](_0x516d85,_0x4b485e[_0x23937d(0x165c,0xc55,0x895,0x2334)]);let _0x15b898=ntilink[_0x23937d(0x9e6,-0x528,0xf11,0x4b)](_0x423161);ntilink[_0x313705(0x961,0x11cc,0x869,0x14e3)](_0x15b898,-0x1*-0x166f+0x1155+-0x15f*0x1d),_0x4b485e['PTdwY'](_0x516d85,_0x4b485e[_0x313705(0x485,0xffb,-0x709,-0x1a1)]);}else{if(_0x4b485e[_0x23937d(0x1777,0x1f9e,0xc40,0xcf0)](_0x4b485e[_0x313705(0x385,0x364,-0xa81,-0x25d)],_0x4b485e[_0x313705(0x1571,0xd40,0x236b,0x1282)])){const _0x3459b0={};_0x3459b0[_0x313705(0x175a,0x1b28,0x1806,0x1536)+'t']='On';const _0x31337a={};_0x31337a[_0x23937d(0x1b0c,0x2715,0x10f7,0x18b8)]=_0x1354e9+'\x20on',_0x31337a[_0x23937d(0x159c,0x1333,0x7dc,0x6cf)]=_0x3459b0,_0x31337a[_0x23937d(0x738,-0x2ba,-0x35d,0x4e4)]=0x1;const _0x547357={};_0x547357[_0x23937d(0x13f4,0x2218,0x227c,0x2141)+'t']=_0x313705(0xf6d,0x1f0,0xe05,0x5cf);const _0x251718={};_0x251718[_0x313705(0x1e72,0x293d,0x14f3,0x1448)]=_0x1354e9+_0x313705(0x1141,0x4c5,0x8db,0x99c),_0x251718[_0x23937d(0x159c,0xe9e,0x21dc,0xce1)]=_0x547357,_0x251718[_0x23937d(0x738,0x11d6,0x94d,0xca3)]=0x1;let _0x4c8666=[_0x31337a,_0x251718];await _0x175756[_0x23937d(0x7d8,0x489,0x16d5,0x11a2)+_0x313705(0x1480,0xafa,0x1ff1,0x17ba)](_0x5cd288[_0x23937d(0x118c,0x1341,0x17d0,0x1ba7)],_0x4c8666,'Please\x20cli'+_0x23937d(0x1a7,0xaf7,0x6c1,0x3cc)+_0x313705(0xd26,0x10f5,0x536,0xcad)+'\x0aOn\x20to\x20ena'+'ble\x0aOff\x20to'+'\x20disable',''+global[_0x313705(0xcd2,0x1425,0x27e,0x9a0)],_0x5cd288);}else{const _0x2cfb4a={};_0x2cfb4a[_0x23937d(0x13f4,0x1a82,0x554,0x1ac5)+'t']=_0x4b485e[_0x313705(0x14d4,0x135d,0x1910,0xd36)];const _0xfdf8e={};_0xfdf8e[_0x313705(0x1e72,0x1906,0xfea,0x2857)]=_0xdfd43a+'allmenu',_0xfdf8e[_0x313705(0x1902,0x236e,0x1164,0xc92)]=_0x2cfb4a,_0xfdf8e['type']=0x1;const _0x1b5afe={};_0x1b5afe[_0x313705(0x175a,0x18e6,0x1b39,0x235d)+'t']=_0x23937d(0x199e,0x1f80,0xc2f,0x2299);const _0x86b0a2={};_0x86b0a2[_0x23937d(0x1b0c,0x1933,0x10a2,0x10ee)]=_0xba52f5+_0x23937d(0xde0,0x1a4,0xfd9,0x16e4),_0x86b0a2['buttonText']=_0x1b5afe,_0x86b0a2[_0x23937d(0x738,0xbcd,0x358,0x12e2)]=0x1;const _0x264dd5={};_0x264dd5[_0x23937d(0x13f4,0x1ed1,0x1323,0x1f3e)+'t']=_0x4b485e['FMFDA'];const _0x2f7aad={};_0x2f7aad['buttonId']=_0x51afbd+_0x313705(0x1855,0x1462,0x138d,0xfc6),_0x2f7aad[_0x23937d(0x159c,0x2499,0x1386,0xd39)]=_0x264dd5,_0x2f7aad[_0x23937d(0x738,0xecf,0xfc0,0xb99)]=0x1;let _0x378e06=[_0xfdf8e,_0x86b0a2,_0x2f7aad];const _0x5dd497={};_0x5dd497['url']=_0x4b485e[_0x23937d(0x1bf9,0x27fc,0x290a,0x1b98)];const _0x355c96={};_0x355c96[_0x313705(0x1fa9,0x27ab,0x2b14,0x1aad)]=_0x5dd497,_0x355c96[_0x23937d(0x968,0x684,0x175d,0x17a0)]='\x0a┏━❯\x20'+_0x5e7f68+(_0x23937d(0x147,-0xd37,0x65c,0x640)+_0x313705(0x183f,0x1bf9,0x2340,0xab1)+_0x313705(0x601,0x28d,0x1328,0x429)+'\x20\x20\x20\x20\x20\x20\x20\x0a┃╠')+_0x41fbbc+'\x20'+_0x20a198+_0x23937d(0x4cc,0x388,0x12f2,0x5e9)+_0x226f0a+'\x20'+_0x5171fc+_0x23937d(0x17f,0x446,-0xd80,-0xb9c)+_0x329adc+'\x20'+_0x22a064+_0x23937d(0x15f5,0x208d,0x2449,0x1232)+_0x1d6bf8+'\x20'+_0x508d76+_0x313705(0x1491,0xa6f,0x2307,0x1175)+_0x131865+'\x20'+_0xbfe909+_0x313705(0x9ca,0x14f3,0xd36,0x1645)+_0x5381c0+'\x20'+_0x1bd0ef+_0x23937d(0x8b5,0x299,0x16b7,0x118a)+_0xa83806+'\x20'+_0x45d83e+_0x313705(0x1e6f,0x123a,0x2cfe,0x2b83)+_0x29549b+'\x20'+_0x35bf23+_0x23937d(0x112f,0x1a32,0x19bc,0x1024)+_0x5e64a3+'\x20'+_0x529958+_0x313705(0x1444,0x11e6,0x79d,0xf6b)+_0x18b349+'\x20'+_0x33b691+'smug\x0a┃╠'+_0x2e383f+'\x20'+_0x5d5d58+_0x23937d(0x1a85,0x23cd,0xcb5,0x1294)+_0x1c9559+'\x20'+_0x2c9186+'yeet\x0a┃╠'+_0x214ad0+'\x20'+_0xbb9346+_0x313705(0x152e,0x2234,0x17f6,0x1534)+_0x3f5779+'\x20'+_0x1c847b+'smile\x0a┃╠'+_0x54c9d4+'\x20'+_0x42846c+_0x313705(0x5fa,0x4a1,0x121,0x47b)+_0x2adb61+'\x20'+_0x25aafd+(_0x23937d(0x167f,0x116e,0x170e,0x1d6b)+'╠')+_0xb1c46d+'\x20'+_0x3aa180+('handhold\x0a┃'+'╠')+_0x2f5a9b+'\x20'+_0x32f37f+_0x23937d(0x78,0x413,0x8eb,-0x167)+_0x4b7bee+'\x20'+_0x2df8e5+_0x313705(0x1a2c,0xf31,0x1d77,0x1840)+_0x3c6ec9+'\x20'+_0x29de48+_0x313705(0x46a,0x100c,0x37,0xab2)+_0x55f183+'\x20'+_0x2cc93a+_0x23937d(0x1583,0xe3e,0x1a11,0x2053)+_0x5e4ab2+'\x20'+_0x2bea86+'kill\x0a┃╠'+_0x4a62a1+'\x20'+_0x449cdf+_0x23937d(0x85a,0xc58,0xe46,0x7f3)+_0x427348+'\x20'+_0x3f342a+_0x313705(0x174a,0x9a5,0xce9,0xadf)+_0x322850+'\x20'+_0x3b09be+_0x313705(0x1771,0x1c63,0x2064,0x232f)+_0x14bbd2+'\x20'+_0x3a6db4+'dance\x0a┃╠'+_0x517464+'\x20'+_0x236d8e+(_0x23937d(0x1b99,0x21ba,0x1cc0,0x271f)+_0x313705(0x1846,0x2122,0xc9f,0xa6d)+'══☬\x0a┗━━❯\x20')+_0x41f5dc+'\x20❮━😎',_0x355c96[_0x313705(0x13d4,0x1be9,0x1d06,0x1a4d)]=_0x2942fc[_0x23937d(0x421,-0x257,0xa40,0x1165)][_0x313705(0x17b7,0x1190,0x2609,0x2208)],_0x355c96['buttons']=_0x378e06,_0x355c96[_0x23937d(0x1b19,0x2326,0xd3f,0xdea)]=0x4;let _0x416db4=_0x355c96;const _0x249998={};_0x249998[_0x23937d(0x5dc,0x1011,0x2a3,-0xac)]=_0x3d1de6,_0x62f756[_0x313705(0xcaa,0xf0a,0xd82,0x127f)+'e'](_0x2c03ac[_0x23937d(0x118c,0x1165,0x1c24,0x1d11)],_0x416db4,_0x249998);}}}}}break;case _0x313705(0xfb7,0x1838,0x192f,0x8e6)+_0x23937d(0x303,0xf8f,0xbd1,-0xa77):case _0x4b485e[_0x313705(0x1f68,0x2501,0x2433,0x1d62)]:case _0x313705(0x74c,0x1463,0x160d,-0x9a)+_0x313705(0x339,0xa12,0xe0e,0x890):{if(_0x1bac1f)return _0x4b485e[_0x23937d(0x133a,0x1c9d,0x9ce,0x2142)](_0x1db05d,mess[_0x23937d(0x61c,-0x6a,-0x29f,0x712)]);if(_0x1e03f5)return _0x4b485e[_0x313705(0x207d,0x2e0f,0x1167,0x1472)](_0x1db05d,mess[_0x23937d(0x5c0,-0x21b,0xa89,0xbaa)]);if(!_0x5cd288[_0x23937d(0x1d23,0x26ab,0x1310,0x14df)])return _0x4b485e['dYWbV'](_0x516d85,mess[_0x313705(0x152c,0x1fd3,0xf49,0x76e)]);if(!_0x424adc)return _0x4b485e[_0x313705(0x1133,0x1faa,0x19e6,0xe47)](_0x516d85,mess[_0x23937d(0x10b3,0x176c,0x1b91,0x1c80)]);if(!_0x17ccaf&&!_0x24aa58)return _0x516d85(mess[_0x313705(0x1818,0x1d27,0x22fa,0x185f)]);if(_0x4b485e['PwLvE'](_0x1ba32f[0x1a82+0x1830+0x12*-0x2d1],'on')){const _0x210e47=_0x4b485e['XnRcZ'][_0x313705(0x1035,0x1810,0xca1,0x1aa)]('|');let _0x2a3aaa=-0x24df+-0x67*0x4e+0x4441;while(!![]){switch(_0x210e47[_0x2a3aaa++]){case'0':var _0x1d198c=await _0x175756[_0x313705(0xf0a,0x1a66,0xaa6,0x1a7a)+'ata'](_0x423161);continue;case'1':_0x4b485e[_0x313705(0x17d4,0x1f96,0xb78,0x16cb)](_0x516d85,_0x4b485e[_0x23937d(0x166e,0x8a6,0x161a,0x811)]);continue;case'2':var _0x184ad9=_0x1d198c['participan'+'ts'];continue;case'3':var _0x3c9da9=[];continue;case'4':if(_0x5a7bc9)return _0x4b485e[_0x313705(0x91a,0x3d8,0x1297,0x670)](_0x516d85,'Already\x20ac'+_0x23937d(0x6f1,0x1017,0xe3e,0xf66));continue;case'5':_0x184ad9[_0x23937d(0xb16,0x19aa,0x827,0xb7c)](async _0x544ccf=>{function _0x24f6ec(_0x4200f4,_0x5d67f8,_0x2396ac,_0x133325){return _0x23937d(_0x4200f4-0x19f,_0x5d67f8,_0x2396ac-0x29,_0x133325-0x147);}function _0x28b30b(_0x36156c,_0x2c90d8,_0x347c19,_0x245c5b){return _0x313705(_0x245c5b-0xe7,_0x36156c,_0x347c19-0x36,_0x245c5b-0xb3);}_0x3c9da9[_0x28b30b(0x14f3,0x16e7,0x20be,0x1209)](_0x544ccf['id']['replace'](_0x4b485e[_0x28b30b(0x170a,0x1f97,0x176e,0x1809)],_0x24f6ec(0x3a0,-0x30e,0x7fd,0x629)+'.net'));});continue;case'6':ntilinkytvid[_0x313705(0x1122,0x145a,0x235,0x19cf)](_0x423161);continue;case'7':const _0x6aaa3d={};_0x6aaa3d['mentionedJ'+'id']=_0x3c9da9;const _0x55084d={};_0x55084d[_0x23937d(0x1d39,0x2133,0x2c12,0x185d)]=_0x23937d(0x1388,0x1188,0xba9,0x5ad)+_0x313705(0x40a,0x1b8,0x1317,0x10b0)+_0x313705(0x17b8,0x1187,0x26bd,0xd9e)+_0x23937d(0x16cb,0xe62,0x2308,0x7c0)+'min,\x20don\x27t'+'\x20send\x20the\x20'+'youtube\x20vi'+_0x23937d(0x1522,0x7c3,0x22a3,0xe36)+_0x313705(0xdf6,0x13df,0x62a,0x52d)+'up\x20or\x20u\x20wi'+_0x23937d(0x753,0xc72,0xcec,0xcac)+_0x313705(0xb01,-0x1c2,0xc9,0x1557)+_0x313705(0xafb,0xad7,0x920,0xa),_0x55084d[_0x23937d(0x341,0x1df,-0x7d6,0xe37)+'o']=_0x6aaa3d;const _0x3c72b0={};_0x3c72b0[_0x23937d(0x5dc,-0x3a0,-0x724,0x26a)]=_0x5cd288,_0x175756[_0x313705(0xcaa,-0x164,0x668,0x1a30)+'e'](_0x423161,_0x55084d,_0x3c72b0);continue;}break;}}else{if(_0x4b485e[_0x23937d(0xcd1,-0x1e5,0x67a,0x5dc)](_0x1ba32f[0x2660+-0x1*-0xb5d+-0x1*0x31bd],'off')){if(!_0x5a7bc9)return _0x4b485e[_0x313705(0x118d,0x4db,0x1366,0x7f6)](_0x516d85,_0x313705(0xcc2,0x96d,0x8bb,-0x239)+'activated');let _0x5dbb7f=ntilinkytvid[_0x23937d(0x9e6,0x54c,0x1517,0x186c)](_0x423161);ntilinkytvid['splice'](_0x5dbb7f,0xfa7+0x109*0x13+-0x2351),_0x4b485e[_0x23937d(0x278,-0xa6e,-0x61d,0x103e)](_0x516d85,_0x23937d(0x1b22,0x15d8,0x22f9,0x2903)+_0x313705(0xbd5,0x5ce,0x369,0x1050)+_0x313705(0x1d7c,0x1d86,0x246a,0x2c8c)+_0x23937d(0x1326,0x1b36,0x1fe5,0x1b02)+'ilink\x20in\x20t'+_0x313705(0xcfb,0x1a60,0x675,0x1924));}else{const _0x48bb98={};_0x48bb98[_0x313705(0x175a,0x2438,0x1f02,0x25be)+'t']='On';const _0x234f1a={};_0x234f1a[_0x23937d(0x1b0c,0x15e0,0x2597,0x1b1a)]=_0x1354e9+_0x23937d(0x7e4,-0x5cb,0xa05,0x15a),_0x234f1a[_0x23937d(0x159c,0x10b7,0xe2b,0x21c4)]=_0x48bb98,_0x234f1a['type']=0x1;const _0x25c977={};_0x25c977['displayTex'+'t']=_0x4b485e['NdFJb'];const _0x4e8b1c={};_0x4e8b1c['buttonId']=_0x1354e9+_0x23937d(0xddb,0xf56,0x37,0x88f),_0x4e8b1c[_0x23937d(0x159c,0x1117,0x1805,0x1e2c)]=_0x25c977,_0x4e8b1c[_0x313705(0xa9e,0x5ed,-0x175,0x72e)]=0x1;let _0x4efa09=[_0x234f1a,_0x4e8b1c];await _0x175756[_0x23937d(0x7d8,0xa6d,-0x180,0x361)+_0x23937d(0x111a,0xfbc,0x1418,0x1701)](_0x5cd288[_0x23937d(0x118c,0x11c4,0x324,0x1822)],_0x4efa09,_0x23937d(0x16e6,0x1ce4,0x1557,0x1ce2)+_0x313705(0x50d,0x91b,-0x48e,0xb6)+_0x23937d(0x9c0,0x669,0x324,0xcd7)+_0x313705(0x50b,0x9c,0x41c,0x1a)+'ble\x0aOff\x20to'+'\x20disable',''+global[_0x23937d(0x96c,0x16ca,0x906,0x13)],_0x5cd288);}}}break;case _0x4b485e[_0x313705(0x1404,0x230b,0x1fe5,0xb4e)]:case _0x4b485e[_0x23937d(0x1783,0x938,0x217a,0x2240)]:case _0x4b485e['bLxhG']:{if(_0x4b485e['inFUn'](_0x313705(0x17fc,0x1561,0x226d,0xbfd),_0x4b485e['XdvQx'])){if(_0x1bac1f)return _0x1db05d(mess['ban']);if(_0x1e03f5)return _0x4b485e[_0x313705(0x1433,0x174b,0x174c,0xf8d)](_0x1db05d,mess[_0x313705(0x926,-0x26a,0x183c,0xcfd)]);if(!_0x5cd288[_0x23937d(0x1d23,0x22a8,0x270e,0x158a)])return _0x4b485e[_0x23937d(0x1745,0x1d0c,0x188b,0x1bee)](_0x516d85,mess[_0x313705(0x152c,0x1b11,0x938,0x22a1)]);if(!_0x424adc)return _0x4b485e[_0x313705(0xc99,0x12df,0x1713,0xe97)](_0x516d85,mess['botAdmin']);if(!_0x17ccaf&&!_0x24aa58)return _0x4b485e['vfiCA'](_0x516d85,mess[_0x23937d(0x14b2,0x1605,0x919,0x2378)]);if(_0x4b485e['pQzAc'](_0x1ba32f[-0x127b+-0xed9+0x2154],'on')){const _0x2491f9=_0x4b485e[_0x313705(0xa68,0xd36,0x10cf,0x1085)]['split']('|');let _0x4b0f88=0x1c1b+-0x1d42+0x127;while(!![]){switch(_0x2491f9[_0x4b0f88++]){case'0':var _0x1d198c=await _0x175756[_0x313705(0xf0a,0x771,0x100a,0x6ea)+_0x313705(0x1982,0x18f5,0x13a2,0x27c7)](_0x423161);continue;case'1':if(_0x5b4f82)return _0x4b485e[_0x313705(0x498,0x772,0xce4,0x4bf)](_0x516d85,_0x313705(0x166d,0x1bf7,0x1692,0x1e36)+'tivated');continue;case'2':var _0x184ad9=_0x1d198c[_0x313705(0x7c7,0xab9,0xa11,0x4f6)+'ts'];continue;case'3':var _0x3c9da9=[];continue;case'4':const _0x55064d={};_0x55064d[_0x23937d(0x1530,0x995,0xec4,0x204b)+'id']=_0x3c9da9;const _0x2858ce={};_0x2858ce[_0x313705(0x209f,0x1bf8,0x151a,0x1742)]=_0x313705(0x16ee,0xafa,0x1f5b,0x10f1)+'ing⚠️\x20🧩```\x0a'+_0x23937d(0x1452,0xb1e,0x185c,0x216f)+_0x23937d(0x16cb,0x1218,0x94b,0x10a0)+_0x23937d(0x1492,0x19cc,0x13e8,0xad9)+'\x20send\x20the\x20'+_0x313705(0x65f,0x1376,0xf6a,0x1510)+_0x313705(0x1c35,0x1fca,0x28ba,0x151c)+_0x23937d(0x179b,0x14d4,0xe14,0xc51)+'roup\x20or\x20u\x20'+_0x23937d(0x1470,0x904,0x86f,0x237f)+'cked\x20immed'+_0x23937d(0x1623,0x239f,0x1146,0x1b55),_0x2858ce[_0x313705(0x6a7,0x964,0x73e,0xbdc)+'o']=_0x55064d;const _0x3ced2f={};_0x3ced2f['quoted']=_0x5cd288,_0x175756['sendMessag'+'e'](_0x423161,_0x2858ce,_0x3ced2f);continue;case'5':ntilinkytch[_0x23937d(0xdbc,0x1305,0xa63,0x902)](_0x423161);continue;case'6':_0x516d85(_0x4b485e[_0x313705(0x1c4b,0xf38,0x11b4,0x1c79)]);continue;case'7':_0x184ad9['map'](async _0x2b1586=>{function _0x19fbd7(_0x27fae5,_0xe168bd,_0x44ba4f,_0x39941d){return _0x313705(_0x27fae5- -0x16,_0xe168bd,_0x44ba4f-0x102,_0x39941d-0x13f);}function _0x579e5a(_0x362927,_0x15c618,_0x449929,_0xae15fe){return _0x23937d(_0x15c618-0x34,_0x362927,_0x449929-0x1ce,_0xae15fe-0xa6);}_0x3c9da9['push'](_0x2b1586['id'][_0x579e5a(0xf5f,0x18a6,0x24e9,0xc67)]('c.us',_0x4b485e[_0x19fbd7(0x18b2,0xad3,0x1666,0xc86)]));});continue;}break;}}else{if(_0x4b485e[_0x23937d(0xe11,0x3f,0xed3,0x7a7)](_0x1ba32f[0x5*0x6d7+0x2*0xf0b+0x7*-0x92f],_0x4b485e['hbAtH'])){if(_0x4b485e['Gomod'](_0x4b485e[_0x313705(0x845,0xd63,-0x37d,0x121)],_0x4b485e['Huown'])){_0x3b87de=_0x22b996[_0x313705(0x1723,0x131c,0x1db7,0x2213)+'nc'](_0x23937d(0xb1b,0x3cb,0x2a4,0x16de)+_0x313705(0x67f,-0x94,0x3aa,0xad3)+_0x313705(0x801,0x922,0x96,0x1568)+_0x3c3af4+_0x313705(0x1cad,0x1d18,0x23ad,0x1f0f));const _0x4ee2f1={};_0x4ee2f1[_0x23937d(0x1762,0x1a01,0x1669,0x18fb)]=_0x457eb9;const _0x18155b={};_0x18155b['quoted']=_0x5633f8,_0x557d1f[_0x313705(0xcaa,-0x12d,0x17af,0x1592)+'e'](_0x431cc9[_0x23937d(0x118c,0xbae,0x1f8c,0x1a75)],_0x4ee2f1,_0x18155b);}else{if(!_0x5b4f82)return _0x4b485e['BvThH'](_0x516d85,'Already\x20de'+_0x23937d(0x10a0,0xed9,0x150f,0x16fb));let _0x264422=ntilinkytch[_0x313705(0xd4c,-0x166,0xeef,-0x6f)](_0x423161);ntilinkytch[_0x23937d(0x5fb,0x15,0x1dc,0x84a)](_0x264422,0x22d2*-0x1+0x476+-0x1*-0x1e5d),_0x516d85(_0x4b485e[_0x23937d(0x8cd,-0x3d3,0xeaf,0x879)]);}}else{if(_0x4b485e[_0x23937d(0x1d08,0x294a,0x2a3d,0x14a0)]!==_0x4b485e['DFDyp']){const _0x49b78a={};_0x49b78a[_0x23937d(0x13f4,0x15c4,0x1405,0xff5)+'t']='On';const _0x514f72={};_0x514f72[_0x313705(0x1e72,0x20c1,0x1426,0x29f4)]=_0x1354e9+'\x20on',_0x514f72[_0x313705(0x1902,0x23fe,0x1886,0x1902)]=_0x49b78a,_0x514f72[_0x313705(0xa9e,0x15e0,-0x448,0x464)]=0x1;const _0x40f146={};_0x40f146['displayTex'+'t']=_0x4b485e[_0x23937d(0x324,0x7da,-0xbd1,0x259)];const _0x53d8c6={};_0x53d8c6[_0x23937d(0x1b0c,0x2a08,0x1b35,0xe18)]=_0x1354e9+_0x23937d(0xddb,0x4bd,0x44a,0x17b2),_0x53d8c6['buttonText']=_0x40f146,_0x53d8c6[_0x23937d(0x738,-0x666,0x197,0x6a1)]=0x1;let _0xca707b=[_0x514f72,_0x53d8c6];await _0x175756[_0x313705(0xb3e,0x132d,0x1a,0x146e)+_0x23937d(0x111a,0x18db,0x94d,0x1ad2)](_0x5cd288[_0x23937d(0x118c,0x1a51,0x2fb,0x966)],_0xca707b,_0x313705(0x1a4c,0x2393,0x2221,0x1f06)+_0x23937d(0x1a7,0xc5f,-0x122,-0xb8)+_0x23937d(0x9c0,0x5a4,-0xea,0x2fc)+_0x23937d(0x1a5,0x77e,-0x776,0xa31)+_0x313705(0x1fc2,0x2601,0x2b05,0x26a0)+_0x23937d(0x10a3,0x16dd,0x1ae6,0x2f6),''+global['botname'],_0x5cd288);}else{_0x192988=_0x4b485e[_0x23937d(0x1c4a,0x21dd,0x10e7,0x1ccb)];for(let _0x3a6cd2 of _0x14b3d8){_0x1c11a3+='\x0a\x0a'+_0x3a6cd2['name']+'\x0a',_0x2bfa69+=''+_0x3a6cd2[_0x23937d(0x1af8,0x1c63,0x1bea,0x19e8)];}const _0x31ac72={};_0x31ac72[_0x23937d(0x13f4,0x1d78,0x1d08,0x1326)+'t']=_0x23937d(0x16cd,0x1c31,0x25ce,0x1e01);const _0x5e97ed={};_0x5e97ed[_0x23937d(0x1b0c,0x152c,0x2a0a,0x1d88)]=_0x313705(0x1d76,0x1dd4,0x260b,0x127c),_0x5e97ed[_0x313705(0x1902,0x1747,0x168a,0xfb5)]=_0x31ac72,_0x5e97ed['type']=0x1;let _0x53d7a0=[_0x5e97ed];const _0xf10cc9={};_0xf10cc9['url']=_0x1302e3[-0xc25*-0x2+0x20f6+-0x3940][_0x23937d(0x1ba7,0x1723,0x21d3,0x1126)];const _0xf17f12={};_0xf17f12[_0x23937d(0x1c43,0x2747,0x2451,0x1314)]=_0xf10cc9,_0xf17f12['jpegThumbn'+_0x313705(0x1077,0x47c,0x223,0x1688)]=_0xaf1a57,_0xf17f12[_0x23937d(0x968,-0x11c,0x16a8,0x1d9)]=_0x377ec3,_0xf17f12[_0x313705(0x13d4,0x842,0x1a33,0x1d27)]=''+_0x55254c[_0x23937d(0x96c,0x16ff,-0x1ab,-0x14a)],_0xf17f12[_0x313705(0xfa0,0x1585,0xf74,0x185f)]=_0x53d7a0,_0xf17f12[_0x313705(0x1e7f,0x21ba,0x2966,0x1eb9)]=0x4;let _0x3c2649=_0xf17f12;const _0x1cce14={};_0x1cce14['quoted']=_0x3a3d5a,_0x54818b[_0x23937d(0x944,-0xf0,0xc25,0x17eb)+'e'](_0x3a5a8e[_0x23937d(0x118c,0x17f9,0x943,0x141e)],_0x3c2649,_0x1cce14);}}}}else{_0x3f19d9=_0x251254['readFileSy'+'nc']('./Android/'+_0x23937d(0x16a2,0x24e7,0xd32,0x1009)+_0x313705(0x1b71,0x1a65,0x1b28,0x1bc8)+_0x527e4f+'.jpg');const _0x5eac44={};_0x5eac44[_0x313705(0x1fa9,0x2cf0,0x23ca,0x1e11)]=_0x115576;const _0x4c755f={};_0x4c755f[_0x313705(0x942,0xc0e,0x1477,0x9c9)]=_0x195e1b,_0x596a9a[_0x313705(0xcaa,0x1015,0x16dd,0xf52)+'e'](_0x14124e['chat'],_0x5eac44,_0x4c755f);}}break;case _0x4b485e[_0x23937d(0x139b,0x1437,0x18ca,0xa9d)]:case _0x4b485e['MAFit']:case _0x4b485e[_0x23937d(0x1dda,0x2cec,0x18af,0x2494)]:{if(_0x4b485e[_0x23937d(0x1782,0xb42,0xf9c,0xa9b)]===_0x4b485e['zDBQB']){const _0x1eaaa7=_0x4b485e[_0x23937d(0xaca,0x104c,0x133c,0xa91)]['split']('|');let _0x5cdfc3=0x1*-0x773+-0xbbc+0x132f;while(!![]){switch(_0x1eaaa7[_0x5cdfc3++]){case'0':if(_0x4b485e[_0x313705(0x786,-0x49d,0x12ab,0x2be)](_0x33ee0d,![]))return;continue;case'1':if(_0x50c886['key'][_0x23937d(0x1a6,-0x682,0x7a5,0x39e)])return;continue;case'2':const _0x2a50c2={};_0x2a50c2[_0x313705(0x3d7,0x9b2,-0x437,-0x4ef)+'Score']=0x320,_0x2a50c2[_0x23937d(0x1be0,0x28da,0x1c35,0x260e)+'d']=!![];const _0x181b89={};_0x181b89[_0x313705(0x1360,0x1b83,0x21fc,0xadf)]=_0x5ec604,_0x181b89['contextInf'+'o']=_0x2a50c2;const _0x47c0cc={};_0x47c0cc[_0x23937d(0x5dc,0xd48,0x1126,0x1c9)]=_0x5c869e,_0x2d3613[_0x313705(0xcaa,0x9dc,0x1677,0x7cd)+'e'](_0x3bd9c6,_0x181b89,_0x47c0cc);continue;case'3':_0xe3830d[_0x313705(0x1bf4,0x25e7,0x29f3,0x1b14)+_0x23937d(0x1d29,0x2056,0x226a,0x264c)](_0x23294e['chat'],_0x5c0223['sender'],[_0x520955['key']['id']]);continue;case'4':if(!_0x4c2a80[_0x313705(0x2089,0x26ee,0x27f8,0x1c4a)])return;continue;case'5':_0x542268=_0x589ece['readFileSy'+'nc'](_0x4b485e['jIToh']);continue;}break;}}else{if(_0x1bac1f)return _0x4b485e[_0x313705(0x5c2,-0x331,-0x5a5,0x81f)](_0x1db05d,mess[_0x313705(0x982,0x10b1,-0x317,0x435)]);if(_0x1e03f5)return _0x4b485e[_0x313705(0xe17,0x1283,0x1903,0x1c69)](_0x1db05d,mess['banChat']);if(!_0x5cd288[_0x313705(0x2089,0x2321,0x2485,0x2ec7)])return _0x4b485e[_0x313705(0x179b,0xe11,0x1ce2,0x19b1)](_0x516d85,mess[_0x23937d(0x11c6,0x12c1,0x1ef6,0x1f8c)]);if(!_0x424adc)return _0x4b485e[_0x313705(0xe7b,0x6e9,0x15a2,0x1ac1)](_0x516d85,mess[_0x23937d(0x10b3,0x126a,0x1a35,0xdd0)]);if(_0x4b485e[_0x23937d(0x4f9,0x1295,-0x6ac,0x790)](!_0x17ccaf,!_0x24aa58))return _0x4b485e['yzDNV'](_0x516d85,mess['admin']);if(_0x1ba32f[0x40+-0xc5*0x11+0x3*0x447]==='on'){if(_0x3fb991)return _0x4b485e['sNWYl'](_0x516d85,_0x4b485e[_0x313705(0x1da6,0x20ee,0x1338,0xf57)]);ntilinkig[_0x313705(0x1122,0x1c3f,0x387,0x1691)](_0x423161),_0x516d85(_0x4b485e[_0x313705(0xf73,0x1736,0x1e27,0x1a91)]);var _0x1d198c=await _0x175756[_0x313705(0xf0a,0x13e6,0x13ba,0x1e16)+_0x313705(0x1982,0x1982,0x13d9,0x1d46)](_0x423161),_0x184ad9=_0x1d198c[_0x4b485e[_0x23937d(0x1430,0x1e65,0x154a,0x837)]],_0x3c9da9=[];_0x184ad9[_0x23937d(0xb16,0xc33,-0xe0,0x1a2a)](async _0x30b523=>{const _0x5cda0f={'mdYqT':function(_0x4b3c9f,_0x22c74b){function _0x55b82a(_0x17fa28,_0x55c12a,_0x54fa72,_0x26cec){return _0x2506(_0x54fa72-0x27e,_0x55c12a);}return _0x4b485e[_0x55b82a(0x863,0x46e,0x904,0xcf2)](_0x4b3c9f,_0x22c74b);}};function _0x5dfb57(_0x212233,_0x30d6b1,_0xc2a568,_0x3fdcbc){return _0x313705(_0x30d6b1- -0x38e,_0x3fdcbc,_0xc2a568-0xbe,_0x3fdcbc-0xc1);}function _0x1cd814(_0x4defed,_0x169415,_0x3d7e3c,_0xea3b90){return _0x23937d(_0x3d7e3c-0x121,_0x169415,_0x3d7e3c-0x1a4,_0xea3b90-0xf6);}_0x4b485e[_0x1cd814(-0x613,0xcfd,0x138,-0x2e3)](_0x4b485e[_0x5dfb57(0x95b,0x75d,0x152e,0x1554)],_0x4b485e[_0x5dfb57(-0x26e,0x5c8,0xfb7,-0x49f)])?_0x5cda0f[_0x1cd814(0x1280,0x400,0xefb,0x361)](_0x316f7a,_0x1cd814(-0xa7b,-0x709,0x3c2,0x10c3)+_0x5dfb57(0x186d,0xe59,0xf2f,0x1154)+_0x5dfb57(0x12d8,0x857,-0x33,0x17a)+_0x5dfb57(0x2629,0x1da0,0x111c,0x1790)+'\x20Money*\x20:\x20'+_0x5cda0f[_0x1cd814(0x53f,0x17f,0xefb,0xfcd)](_0x16af7b,_0x5356ab[_0x5dfb57(0x213f,0x14a6,0x15ef,0x63e)])+(_0x1cd814(0x25f4,0xf77,0x1ce5,0x2a48)+_0x1cd814(0xe68,-0x145,0x1be,-0x9b3)+'bit(s)*\x20:\x20')+_0x410a7f(_0xdd57b0[_0x5dfb57(0x220f,0x14a6,0x190e,0x1214)])):_0x3c9da9[_0x5dfb57(0x574,0xd94,0xbec,0x77f)](_0x30b523['id'][_0x1cd814(0x25e9,0x247e,0x1993,0xd8e)](_0x1cd814(-0x6ce,0xa12,0x55b,0x155),_0x4b485e['FfQlc']));});const _0x40666e={};_0x40666e[_0x313705(0x1896,0xdc7,0xd1e,0xa5e)+'id']=_0x3c9da9;const _0x5099c1={};_0x5099c1[_0x313705(0x209f,0x17be,0x192c,0x25d9)]=_0x23937d(0x1388,0x135c,0x10c3,0x19ca)+_0x313705(0x40a,-0xaae,-0x891,-0x106)+_0x313705(0x17b8,0xf20,0x1c76,0x113d)+_0x23937d(0x16cb,0xb06,0x1549,0xe81)+_0x23937d(0x1492,0x1fd3,0x7e7,0x6b0)+_0x313705(0x459,0xa65,0x24d,0x728)+'instagram\x20'+_0x23937d(0x1330,0xb37,0x13c7,0xc0e)+_0x313705(0x15a9,0x23c7,0x140b,0x1c18)+'r\x20u\x20will\x20b'+_0x23937d(0x1ca8,0xfbb,0x2715,0x26ab)+'mmediately'+'!',_0x5099c1['contextInf'+'o']=_0x40666e;const _0x8f55f0={};_0x8f55f0[_0x23937d(0x5dc,-0x8a1,0x490,0xebe)]=_0x5cd288,_0x175756[_0x23937d(0x944,0xf4a,0x307,0xdc1)+'e'](_0x423161,_0x5099c1,_0x8f55f0);}else{if(_0x4b485e[_0x313705(0xa5e,0xb7,-0x4b0,0x4d)](_0x1ba32f[-0x4*0x757+0x1e96+-0x9d*0x2],_0x4b485e[_0x313705(0x70e,-0x59e,0x922,0x3f4)])){if(_0x4b485e[_0x23937d(0x1e3,0x3b1,-0xa5c,-0x65b)](_0x4b485e[_0x313705(0xa1b,0x1241,0xc66,0x13e4)],_0x4b485e[_0x23937d(0x6b5,-0x20,-0xa5,0x787)])){if(!_0x3fb991)return _0x4b485e[_0x313705(0x1ee2,0x220c,0x1a9f,0x216a)](_0x516d85,_0x23937d(0x95c,0xafe,0x1299,-0x590)+_0x313705(0x1406,0x17e8,0x1e78,0x1732));let _0x2daf62=ntilinkig[_0x23937d(0x9e6,0x7ee,-0xc3,0x5a5)](_0x423161);ntilinkig[_0x23937d(0x5fb,0x124,0x143a,0x9b5)](_0x2daf62,0x11ec+0x6c6*0x3+-0x263d),_0x4b485e[_0x313705(0x1824,0x24bb,0x225b,0x1d69)](_0x516d85,'Success\x20in'+_0x23937d(0x86f,0x13e7,0x170b,0x1412)+_0x313705(0x1a83,0x1848,0x17ed,0x18a3)+_0x313705(0x174d,0x2131,0xf1f,0x1ddd)+_0x23937d(0x1b54,0x297a,0x1165,0x278a)+_0x313705(0x152c,0x14ef,0x17ef,0x1f63));}else{const _0x10ae07={'oecyE':function(_0x360e76,_0x2efe7f){function _0x91838e(_0x2667e0,_0x5dbe48,_0x332445,_0x1801ec){return _0x313705(_0x5dbe48- -0x94,_0x1801ec,_0x332445-0x178,_0x1801ec-0x74);}return _0x4b485e[_0x91838e(0x1e75,0x164b,0xc7d,0xff6)](_0x360e76,_0x2efe7f);},'pioeR':_0x4b485e['QHXuM'],'yXaMp':function(_0x2083a7,_0xab15d9){function _0x1de710(_0x1cf209,_0x5dd314,_0x3e2790,_0x2720e1){return _0x313705(_0x5dd314-0x63,_0x1cf209,_0x3e2790-0x1d8,_0x2720e1-0x26);}return _0x4b485e[_0x1de710(0x5b1,0x650,0x67c,0x5b0)](_0x2083a7,_0xab15d9);},'JCdiM':_0x4b485e['XgVkh'],'hXLLc':_0x4b485e[_0x23937d(0x1bd9,0x2628,0xe98,0x228a)],'aHxVo':_0x313705(0x39b,-0x391,0x715,0x1163)+_0x23937d(0xac3,0x13a0,0x61d,0x1280)+':\x20','Ioetv':function(_0xd6baf,_0x356ba9){return _0x4b485e['sNWYl'](_0xd6baf,_0x356ba9);},'sbuGs':_0x4b485e['SvJvK'],'gROts':function(_0x369c16,_0x8c00a9){function _0x175081(_0x33d1a2,_0x229a3a,_0x9c49d4,_0x1cdb5a){return _0x313705(_0x33d1a2-0x13b,_0x1cdb5a,_0x9c49d4-0x1e0,_0x1cdb5a-0xc9);}return _0x4b485e[_0x175081(0x200f,0x2687,0x2c53,0x261e)](_0x369c16,_0x8c00a9);},'NLmAk':_0x313705(0xb98,0x583,0x6a0,-0xb0),'YSfZI':function(_0x1c794f,_0x2c77a9){return _0x1c794f(_0x2c77a9);},'mdpGq':_0x4b485e[_0x23937d(0x143d,0x1522,0xdf4,0x101d)],'NAlzu':function(_0x147f9d,_0x5c6585){return _0x147f9d*_0x5c6585;}};let _0x349279=_0x3fd3ea[_0x313705(0xa31,0x1da,0x12ec,0x975)+'e']()[_0x23937d(0x1872,0x1d49,0x1a8e,0x24cd)](/[()*]/g,''),_0x7f30cb=_0x349279['replace'](/\s/g,'-'),_0x3f3fc9=_0x4d6cee[_0x23937d(0x7f1,0xcab,0x1112,0x137)](_0x4b485e[_0x313705(0x1efa,0x15bb,0x24fe,0x216d)](_0x2d44fc[_0x313705(0x1ae0,0x102e,0x1a8a,0x28f4)](),-0x2705*-0x1+0x2de+0x17*-0x1d2));_0x59eb98[_0x313705(0xfa3,0x14ca,0x1df5,0x1083)](_0x4b485e[_0x313705(0xf95,0x590,0xbaf,0x640)](_0x4b485e['BASBJ'](_0x4b485e[_0x23937d(0x15b2,0x1dfa,0x1714,0x1fd7)],_0x7f30cb)+_0x4b485e[_0x23937d(0x60e,0x151,-0x38f,0xc7b)],_0x3f3fc9))[_0x23937d(0x1b61,0x1e4e,0x2622,0x1291)](_0x381bfe=>{const _0x2a1e18={};_0x2a1e18[_0x155dda(0x1115,-0x49b,-0xba6,0x214)]=_0x10ae07[_0x155dda(0x1ab5,0xce9,0x15d9,0xcd0)];function _0x5f1321(_0x33e488,_0x2959be,_0x539219,_0x293e0f){return _0x313705(_0x539219- -0x27c,_0x33e488,_0x539219-0x183,_0x293e0f-0x185);}const _0x23afe7=_0x2a1e18;let _0x141aed=_0x2ac569[_0x155dda(0x1345,-0x3e8,0xcc,0x80b)](_0x381bfe[_0x155dda(0x1236,0x17ac,0x1b47,0xe66)]);function _0x155dda(_0x2d32c8,_0x56fdbf,_0x1c82a5,_0x249b50){return _0x313705(_0x249b50- -0x317,_0x2d32c8,_0x1c82a5-0xa2,_0x249b50-0x1b1);}let _0x100d74=[];_0x10ae07['YSfZI'](_0x141aed,_0x10ae07[_0x155dda(0xf3b,0x11c,0x51c,0x137)])['each'](function(_0x5c0a46,_0x13016d){function _0x1b176b(_0xa4e1c3,_0x5bcd83,_0x3ca234,_0x2d73c3){return _0x5f1321(_0xa4e1c3,_0x5bcd83-0xe5,_0x5bcd83-0x244,_0x2d73c3-0x3c);}function _0x1feec2(_0x26cd3b,_0x22f89a,_0x4709ce,_0x444870){return _0x5f1321(_0x4709ce,_0x22f89a-0x4c,_0x22f89a- -0x27c,_0x444870-0xc2);}_0x100d74['push'](_0x141aed(_0x13016d)['find']('a')[_0x1b176b(0x1cd,0xf7a,0x154c,0xab6)](_0x23afe7[_0x1feec2(0x78c,0x33,-0x32f,0x20b)]));});let _0x4d65ee=_0x100d74[_0x1b5e26[_0x155dda(0x903,0xf4,0xb97,0x840)](_0x10ae07[_0x5f1321(0x195d,0x20fa,0x16f9,0x15b9)](_0x3f8457[_0x155dda(0x1bc5,0x1f81,0xfbe,0x17c9)](),_0x100d74[_0x155dda(-0x5b4,0x211,-0x952,0x42d)]))];_0x21da4d[_0x155dda(0xae8,0xdda,0xf02,0xc8c)](_0x4d65ee)[_0x5f1321(0x1305,0x2356,0x1c4b,0x2815)](_0x18337a=>{function _0x2c8b7f(_0x1bec0e,_0x5cc153,_0x431983,_0x50bda5){return _0x5f1321(_0x1bec0e,_0x5cc153-0x12d,_0x5cc153-0x3ec,_0x50bda5-0x1ac);}function _0x3f6cf9(_0x1e764d,_0x523070,_0x4d783d,_0x115047){return _0x5f1321(_0x1e764d,_0x523070-0x1ec,_0x523070- -0x20a,_0x115047-0x7a);}let _0x59318e=_0x1ba7c5[_0x2c8b7f(0x1b1c,0xc92,0x103f,0xcfe)](_0x18337a['data']),_0x8df638={'title':_0x10ae07['oecyE'](_0x59318e,_0x10ae07[_0x2c8b7f(-0x36c,0x52f,-0x285,0xb0)])[_0x3f6cf9(0xeee,0x1c19,0x2472,0x162b)](),'author':_0x10ae07[_0x3f6cf9(0x1ec0,0x1922,0x23f8,0x18e9)](_0x59318e,_0x10ae07[_0x3f6cf9(0x217a,0x16ec,0x13ed,0x1bb8)])[_0x2c8b7f(0x2261,0x220f,0x14dc,0x2113)]()[_0x2c8b7f(0x769,0x11a5,0x151a,0x1322)](_0x2c8b7f(0xead,0xdc9,0x1128,0x1b4e)+_0x3f6cf9(0x23a6,0x1932,0x1bbe,0x193c))[0x70d+0x2ea*0xa+-0x2430][_0x2c8b7f(0x3dc,0x11a5,0x297,0xb57)](_0x10ae07[_0x3f6cf9(0x13f9,0x88a,-0x2e2,0x7ae)])[-0x3*-0x10c+-0x2b*-0xcb+-0x253d],'kategori':_0x10ae07[_0x3f6cf9(0xfb9,0x223,0x6b6,0xc01)](_0x59318e,_0x10ae07[_0x3f6cf9(0xea8,0x16ec,0x12cf,0x1f0a)])[_0x3f6cf9(0x104d,0x1c19,0x1c02,0x19f3)]()[_0x3f6cf9(0x141c,0xbaf,0x874,0x1260)](_0x10ae07[_0x2c8b7f(0x1aa7,0xe80,0xc3b,0x12d)])[-0x5f0+-0x1*-0xf17+-0x926*0x1][_0x3f6cf9(0x11ed,0xbaf,0x171a,0xecd)]('\x0a')[0x321+-0x10fe+-0xddd*-0x1],'lolos':_0x10ae07[_0x3f6cf9(0xc97,0x223,-0x8e2,-0x8cc)](_0x59318e,_0x10ae07[_0x2c8b7f(0x2b1c,0x1ce2,0x1b23,0x2908)])[_0x3f6cf9(0x2723,0x1c19,0x1474,0x1fe7)]()[_0x2c8b7f(0x1500,0x11a5,0x1f7d,0xbcb)](_0x10ae07[_0x2c8b7f(0x1baf,0x1216,0x14e4,0xa89)])[0x3*0xab4+-0x102d*0x1+-0x1*0xfee][_0x3f6cf9(0x3dd,0xbaf,0x844,0x9c4)]('\x0a')[-0x17f2+0x19e5+-0x1f3],'cerita':_0x10ae07[_0x2c8b7f(0x1cde,0x1e52,0x1926,0x1db9)](_0x59318e,_0x10ae07['sbuGs'])[_0x3f6cf9(0x250f,0x1c19,0x27eb,0xe59)]()};_0x10ae07[_0x2c8b7f(0x1ba4,0x214d,0x1e6a,0x2bb1)](_0xebd5dc,_0x8df638);});});}}else{const _0x24a082={};_0x24a082[_0x23937d(0x13f4,0x10f0,0xe7b,0xe7a)+'t']='On';const _0xaae439={};_0xaae439[_0x23937d(0x1b0c,0x15f9,0x1c14,0x1a21)]=_0x1354e9+_0x313705(0xb4a,0xed5,0x1148,0x4d5),_0xaae439[_0x23937d(0x159c,0x1269,0xbe7,0x1dc5)]=_0x24a082,_0xaae439[_0x23937d(0x738,-0x73e,-0x75b,0x6cf)]=0x1;const _0x13d41b={};_0x13d41b[_0x313705(0x175a,0x9ac,0xb12,0x121b)+'t']=_0x4b485e[_0x23937d(0x324,0x664,-0x170,0x521)];const _0x3d412a={};_0x3d412a[_0x313705(0x1e72,0x12c2,0x1a65,0x26f9)]=_0x1354e9+_0x313705(0x1141,0x1be5,0x18fc,0x7c8),_0x3d412a['buttonText']=_0x13d41b,_0x3d412a['type']=0x1;let _0x3c1484=[_0xaae439,_0x3d412a];await _0x175756['sendButton'+_0x23937d(0x111a,0x1c8c,0x1c3c,0x1606)](_0x5cd288[_0x313705(0x14f2,0x9c0,0x147e,0x1161)],_0x3c1484,_0x313705(0x1a4c,0x2853,0x14dd,0xd6e)+_0x23937d(0x1a7,0x4b3,0xdc,-0xb21)+'ton\x20below\x0a'+'\x0aOn\x20to\x20ena'+_0x23937d(0x1c5c,0x13d5,0x1ff7,0x2107)+'\x20disable',''+global[_0x313705(0xcd2,0x1600,0x3ad,0x1bad)],_0x5cd288);}}}}break;case _0x4b485e['CwVib']:case'antilinkfb':{if(_0x313705(0xc29,0x1034,0x10e2,0x1291)===_0x4b485e[_0x313705(0x1b31,0x1efa,0x1673,0x28ef)]){_0x5c581c=-0x2b*-0x2f+-0x5b*-0x67+-0x2c82,_0x41855e=_0x4b485e[_0x23937d(0x1988,0x1d39,0x23d0,0x1dde)];for(let _0x48f899 of _0x2abb4e){const _0x29bfa8=_0x4b485e[_0x23937d(0x915,0x8fa,-0xd2,0x11f0)][_0x23937d(0xccf,0x83d,0x12b7,0x127f)]('|');let _0x1359c7=-0xf7f*-0x2+0x18ce+-0x1*0x37cc;while(!![]){switch(_0x29bfa8[_0x1359c7++]){case'0':_0x227950+='\x0a•\x20'+_0x16078d[_0x23937d(0x119d,0x1248,0x1097,0x402)]()+_0x23937d(0x891,0xc53,0x1482,-0x24b);continue;case'1':_0x42e038+=_0x313705(0x8e7,-0x5d2,0x3e7,-0x4f)+_0x48f899[_0x313705(0xbdf,0xe06,0x14a9,0xa02)+_0x313705(0xfde,0x1345,0x3a8,0x44c)]+'\x0a';continue;case'2':_0x4b0fe2+=_0x313705(0xb9e,-0xe,0x1869,0x1960)+_0x48f899['berita_jen'+'is']+'\x0a';continue;case'3':_0x106d95+=_0x313705(0x936,0x153e,-0x15,0x851)+_0x48f899[_0x23937d(0x1b49,0x1a77,0x237e,0x150b)]+'\x0a';continue;case'4':_0xfeee22+=0x21f9+0x151a*-0x1+0x1b*-0x7a;continue;case'5':_0xf49100+='Link:\x20'+_0x48f899[_0x23937d(0xfac,0x146e,0x37b,0x157b)]+'\x0a';continue;}break;}}_0x261f51+=_0x4b485e[_0x313705(0x1cee,0x1d6d,0x27a2,0x20b3)];const _0x636d70={};_0x636d70['url']=_0x3b3281[-0x5*0x269+0x23cd+-0x17c0]['berita_thu'+'mb'];const _0x1cea9b={};_0x1cea9b[_0x313705(0x1fa9,0x21b7,0x160c,0x11ec)]=_0x636d70,_0x1cea9b['caption']=_0x3c8bdf;const _0x94ce8f={};_0x94ce8f[_0x313705(0x942,0x36c,0x80e,0xd14)]=_0x2f4c76,_0x353e9c[_0x313705(0xcaa,0xf40,0x1ad,0x2cb)+'e'](_0x6a0703[_0x313705(0x14f2,0x8f4,0x1a8a,0x1c13)],_0x1cea9b,_0x94ce8f);}else{if(_0x1bac1f)return _0x4b485e[_0x313705(0x7ff,0x10f9,0xb87,0x87f)](_0x1db05d,mess[_0x313705(0x982,0x14a,-0x2e8,0xe3d)]);if(_0x1e03f5)return _0x4b485e[_0x23937d(0x7da,0xe95,0xe46,0xc5a)](_0x1db05d,mess['banChat']);if(!_0x5cd288[_0x23937d(0x1d23,0xf91,0x196d,0x28e9)])return _0x4b485e[_0x23937d(0xc6f,0x1842,0x1627,0x15b)](_0x516d85,mess[_0x23937d(0x11c6,0x1a21,0x2049,0x8b4)]);if(!_0x424adc)return _0x516d85(mess['botAdmin']);if(!_0x17ccaf&&!_0x24aa58)return _0x516d85(mess[_0x23937d(0x14b2,0x1819,0x20a4,0x1f9b)]);if(_0x1ba32f[-0xfe9*-0x1+-0x99a*-0x1+0x7*-0x3a5]==='on'){if(_0x4b485e[_0x23937d(0x128e,0x1d58,0x1020,0x8e7)]!==_0x23937d(0x143c,0x1f39,0x1e1e,0x2196)){if(_0x3531e9)return _0x4b485e[_0x313705(0xbe2,0x6fe,0x8a1,0xa12)](_0x516d85,_0x4b485e[_0x23937d(0x1a40,0x144d,0xd2a,0x1ba4)]);ntilinkfb[_0x313705(0x1122,0x6bd,0x171e,0x24b)](_0x423161),_0x4b485e[_0x313705(0x175f,0xfd6,0x1d89,0x1746)](_0x516d85,_0x4b485e[_0x23937d(0x926,0x111,0x17bc,-0x4)]);var _0x1d198c=await _0x175756[_0x23937d(0xba4,0xb4d,0x1c7,0x1569)+_0x23937d(0x161c,0x245b,0x1b51,0xd4e)](_0x423161),_0x184ad9=_0x1d198c[_0x23937d(0x461,-0x5dc,-0x7f4,-0x36b)+'ts'],_0x3c9da9=[];_0x184ad9[_0x23937d(0xb16,0x36b,0x6c2,0x1a14)](async _0x545bfb=>{const _0x5628af={};_0x5628af[_0xcc8c3f(0xbf,0x9f0,-0x320,0x910)]=_0x4b485e[_0x1143a1(0x2221,0x1211,0x1b17,0x15e1)];function _0xcc8c3f(_0xd6df35,_0x384cb4,_0x57436e,_0x1dbf49){return _0x313705(_0x384cb4-0xc3,_0x57436e,_0x57436e-0x1e0,_0x1dbf49-0x1ea);}const _0x481499=_0x5628af;function _0x1143a1(_0x3d534f,_0x157ea6,_0x526593,_0x55a816){return _0x23937d(_0x55a816-0x225,_0x3d534f,_0x526593-0xf,_0x55a816-0x126);}_0x4b485e[_0xcc8c3f(-0x3a8,0x78a,0x861,0x703)](_0x4b485e[_0xcc8c3f(0x11d7,0x634,0x10bf,0x434)],_0x1143a1(0x327,0x158c,0x583,0xae2))?_0x3c9da9[_0x1143a1(0x1bf8,0x1dcb,0x67c,0xfe1)](_0x545bfb['id'][_0xcc8c3f(0x291e,0x1c9b,0x27a0,0x1ad9)](_0x1143a1(0xfe7,0x1498,0x12dc,0x65f),_0xcc8c3f(0x4c2,0x62a,0xf02,0x9f7)+_0x1143a1(0x1c4e,0x1a40,0x1b05,0x19eb))):_0x1bdeea[_0xcc8c3f(0x174a,0x11e5,0x824,0x765)](_0x51e513['id'][_0xcc8c3f(0x1c14,0x1c9b,0xe7f,0x1172)](_0x481499[_0x1143a1(0x1508,0x634,0xdd9,0x7ec)],'s.whatsapp'+'.net'));});const _0x13f2e1={};_0x13f2e1['mentionedJ'+'id']=_0x3c9da9;const _0x5601d4={};_0x5601d4[_0x313705(0x209f,0x22a1,0x2a17,0x29ce)]=_0x23937d(0x1388,0x1d82,0x1489,0x188e)+'ing⚠️\x20🧩```\x0a'+'\x0aIf\x20you\x27re'+_0x313705(0x1a31,0x27b9,0x2835,0x1097)+'min,\x20don\x27t'+_0x23937d(0xf3,0xeec,0x11d,-0x8fb)+_0x23937d(0x15c,-0x9fc,-0x34e,-0x94a)+'ink\x20in\x20thi'+'s\x20group\x20or'+_0x313705(0x18b9,0x1882,0x278c,0xe60)+_0x23937d(0x1d48,0x100d,0x2c1b,0x182f)+_0x23937d(0x76a,0x886,-0x4fd,-0x12),_0x5601d4['contextInf'+'o']=_0x13f2e1;const _0x2b908c={};_0x2b908c['quoted']=_0x5cd288,_0x175756['sendMessag'+'e'](_0x423161,_0x5601d4,_0x2b908c);}else{const _0x3ca01b={};_0x3ca01b[_0x313705(0x209f,0x24e3,0x28eb,0x1943)]=''+_0xc59236['K66'];const _0x3a7dcd={};_0x3a7dcd['quoted']=_0x66467e,_0x4cdade[_0x313705(0xcaa,0x898,0xf76,0xc74)+'e'](_0x3e3a2c[_0x313705(0x14f2,0xf29,0x905,0x22dd)],_0x3ca01b,_0x3a7dcd);}}else{if(_0x4b485e[_0x23937d(0x405,0x570,0xb8c,-0x4c7)](_0x1ba32f[-0x8a3+0xef*0xc+-0x291],_0x4b485e[_0x23937d(0x3a8,0x1003,0xda2,0xbfe)])){if(!_0x3531e9)return _0x4b485e[_0x23937d(0x152c,0x13df,0x1b4b,0xaac)](_0x516d85,_0x4b485e[_0x313705(0x19c2,0x1c4b,0x1b0a,0x1171)]);let _0x37666c=ntilinkfb[_0x23937d(0x9e6,-0x4fa,0x1395,0xbb5)](_0x423161);ntilinkfb[_0x313705(0x961,0xa50,-0x65,0x1308)](_0x37666c,0x7aa+-0x1ecb+-0x15*-0x11a),_0x4b485e[_0x313705(0x1e35,0x2939,0x2489,0x2bd6)](_0x516d85,_0x4b485e['gQGfl']);}else{if(_0x4b485e[_0x313705(0x2014,0x2946,0x2530,0x1fc5)]('MqVBR',_0x23937d(0x366,0x7b9,0x897,0x707))){const _0x57c06e={};_0x57c06e['displayTex'+'t']='On';const _0x368f03={};_0x368f03[_0x313705(0x1e72,0xfcd,0x185c,0x284e)]=_0x1354e9+_0x313705(0xb4a,-0x21c,0x1635,0x182c),_0x368f03[_0x313705(0x1902,0x15ac,0xbd8,0x1a4b)]=_0x57c06e,_0x368f03[_0x313705(0xa9e,-0x462,-0x367,0x1784)]=0x1;const _0x3832cb={};_0x3832cb[_0x23937d(0x13f4,0x1f83,0x1f01,0xaf4)+'t']=_0x4b485e[_0x313705(0x68a,0xf6b,0x1556,-0x37e)];const _0x440e36={};_0x440e36[_0x23937d(0x1b0c,0xd4d,0x2502,0x2124)]=_0x1354e9+_0x23937d(0xddb,0x1b67,0x108e,0x1bb2),_0x440e36['buttonText']=_0x3832cb,_0x440e36[_0x23937d(0x738,0x1090,0x18f,0x7a2)]=0x1;let _0x247a1c=[_0x368f03,_0x440e36];await _0x175756[_0x23937d(0x7d8,-0x309,0x658,0x91c)+_0x313705(0x1480,0x18f7,0x1e08,0x19c9)](_0x5cd288[_0x313705(0x14f2,0x1fef,0xe93,0x87e)],_0x247a1c,'Please\x20cli'+_0x313705(0x50d,0xadc,-0x377,0x52e)+_0x23937d(0x9c0,0x6fa,0x134a,-0x84)+_0x313705(0x50b,-0x351,0x5e8,0x27e)+_0x313705(0x1fc2,0x2736,0x1df1,0x2ca2)+'\x20disable',''+global['botname'],_0x5cd288);}else _0x177ab9(_0x328c6c['error']);}}}}break;case _0x4b485e[_0x23937d(0x5b8,-0x6c3,0x62,-0x4bd)]:case _0x4b485e[_0x23937d(0x691,0x12e3,0x235,0x1514)]:{if(_0x1bac1f)return _0x4b485e[_0x313705(0x12fb,0x1fde,0x1173,0x663)](_0x1db05d,mess[_0x23937d(0x61c,-0x644,0xe40,0x1114)]);if(_0x1e03f5)return _0x1db05d(mess[_0x313705(0x926,0x17a5,0xa88,0x144a)]);if(!_0x5cd288[_0x23937d(0x1d23,0x1d2d,0x1314,0x1553)])return _0x4b485e[_0x313705(0xbbd,0x8e4,0x509,0x14ac)](_0x516d85,mess['group']);if(!_0x424adc)return _0x516d85(mess[_0x313705(0x1419,0x703,0x114a,0x507)]);if(_0x4b485e[_0x313705(0x654,0xef1,0x483,0x3af)](!_0x17ccaf,!_0x24aa58))return _0x4b485e['ZNYlH'](_0x516d85,mess[_0x23937d(0x14b2,0x21a1,0xc38,0x1c53)]);if(_0x4b485e['IaZUz'](_0x1ba32f[-0x1*0x217c+0x2f7+0x1e85],'on')){if(_0x4b485e[_0x313705(0x57e,0x98,0x5c3,-0x335)]===_0x4b485e['LWeti']){const _0x133f07={};_0x133f07[_0x313705(0x209f,0x2921,0x2220,0x1e1b)]=''+_0x597dc4[_0x313705(0x13d6,0x19d2,0xef2,0x1431)];const _0x41eb76={};_0x41eb76['quoted']=_0x44e8b2,_0x78a062['sendMessag'+'e'](_0x52591e[_0x313705(0x14f2,0xfdb,0xdfc,0xfd2)],_0x133f07,_0x41eb76);}else{const _0x4dd24d=_0x4b485e[_0x23937d(0x38d,-0xa51,0x46a,0x19c)][_0x313705(0x1035,0x18ec,0xb68,0xe4d)]('|');let _0x3ece2e=0x1*-0x2c3+0x121*0xf+-0xe2c;while(!![]){switch(_0x4dd24d[_0x3ece2e++]){case'0':var _0x184ad9=_0x1d198c[_0x4b485e[_0x23937d(0x1430,0x1627,0x1e79,0xfe9)]];continue;case'1':var _0x1d198c=await _0x175756['groupMetad'+_0x313705(0x1982,0xe20,0x2243,0x1998)](_0x423161);continue;case'2':_0x4b485e[_0x313705(0xc3e,0x31f,-0x278,0x2a2)](_0x516d85,_0x23937d(0x1b22,0x2602,0x2620,0x2582)+'\x20turning\x20o'+_0x23937d(0x1912,0x127b,0x1ee9,0x17ba)+_0x23937d(0xb1f,-0x8c,-0x2ce,0x906)+'in\x20this\x20gr'+_0x23937d(0x124c,0x16b0,0x2157,0xf0e));continue;case'3':ntilinktg['push'](_0x423161);continue;case'4':_0x184ad9['map'](async _0x5351c4=>{function _0x15bfea(_0x91b3c4,_0x22f39c,_0x1b6f5d,_0x340900){return _0x23937d(_0x1b6f5d-0x4c9,_0x22f39c,_0x1b6f5d-0x142,_0x340900-0x1b2);}function _0x16e0fc(_0x1360d0,_0x18fdfd,_0x101ac4,_0x1900bd){return _0x23937d(_0x101ac4-0x22e,_0x1360d0,_0x101ac4-0x1c,_0x1900bd-0x8);}_0x3c9da9[_0x15bfea(0x1472,0x1fdb,0x1285,0x124b)](_0x5351c4['id'][_0x15bfea(0x1e7c,0x1a10,0x1d3b,0x1cd1)](_0x4b485e[_0x16e0fc(0x14c6,0x225a,0x15ea,0x1216)],_0x4b485e[_0x15bfea(0xcc1,0x1cbe,0x1a2b,0x1bfd)]));});continue;case'5':const _0x155334={};_0x155334[_0x23937d(0x1530,0x12df,0x93b,0x2295)+'id']=_0x3c9da9;const _0x586a61={};_0x586a61[_0x23937d(0x1d39,0x2675,0x1d7a,0x2859)]='```🧩\x20⚠️Warn'+'ing⚠️\x20🧩```\x0a'+'\x0aIf\x20you\x27re'+_0x313705(0x1a31,0x1535,0x2336,0xc8d)+'min,\x20don\x27t'+_0x313705(0x459,-0x597,0x497,0xd13)+_0x23937d(0x364,0x1051,-0xa36,-0x4b7)+'ink\x20in\x20thi'+_0x313705(0x2102,0x2480,0x2a25,0x1250)+_0x23937d(0x1553,0xfd6,0x15e9,0x1cb5)+_0x313705(0x20ae,0x2afb,0x1f84,0x23f3)+'mediately!',_0x586a61['contextInf'+'o']=_0x155334;const _0x1cd75e={};_0x1cd75e['quoted']=_0x5cd288,_0x175756[_0x313705(0xcaa,0x34c,0x10a1,0xf39)+'e'](_0x423161,_0x586a61,_0x1cd75e);continue;case'6':if(_0x18ab35)return _0x4b485e[_0x313705(0x1d50,0x2439,0x1454,0x1007)](_0x516d85,_0x4b485e['vKrEA']);continue;case'7':var _0x3c9da9=[];continue;}break;}}}else{if(_0x4b485e[_0x23937d(0x1985,0x1ee8,0xbab,0x1d77)](_0x1ba32f[-0xa13*-0x3+0x2*-0x67f+-0x113b],_0x4b485e[_0x23937d(0x3a8,0x115,-0x9e4,0x2bb)])){if(_0x4b485e[_0x313705(0x10ab,0x1616,0x8aa,0xbae)]!==_0x313705(0xfb9,0x18d9,0x1ce8,0x12ed)){const _0x5861ca={};_0x5861ca['text']=''+_0x19a987['K9'];const _0x33f5b1={};_0x33f5b1[_0x313705(0x942,0x8d,0xe9,0x8d0)]=_0x4f677f,_0x11c601[_0x23937d(0x944,0x1519,0x177b,0x12dd)+'e'](_0x4f6985['chat'],_0x5861ca,_0x33f5b1),_0x15eb26=_0x39031f[_0x23937d(0x13bd,0x1338,0xa17,0x7bf)+'nc']('./Android/'+_0x313705(0x1979,0x1964,0xf70,0x1c68)+_0x23937d(0x1101,0x1453,0x1053,0x19cf)+_0x313705(0x11ff,0x1a60,0x5e1,0x13fa));const _0x3fed5f={};_0x3fed5f[_0x313705(0x1360,0x1bfa,0x1bfa,0x1fba)]=_0x208118,_0x28c93d[_0x23937d(0x944,-0x1a4,0x169e,-0x4db)+'e'](_0x2fbc90[_0x23937d(0x118c,0x11bf,0xc54,0xe90)],_0x3fed5f);}else{if(!_0x18ab35)return _0x4b485e[_0x313705(0x171c,0xa29,0x1759,0x1c06)](_0x516d85,_0x4b485e['QtXqz']);let _0x19c839=ntilinkig[_0x23937d(0x9e6,-0x330,0xdd6,0x2ce)](_0x423161);ntilinkig[_0x313705(0x961,0x458,0x1249,0x11b3)](_0x19c839,-0xcd7+0x8d9+-0x5d*-0xb),_0x4b485e[_0x313705(0xd02,0x75b,0x1280,-0x1ae)](_0x516d85,_0x313705(0x1e88,0x29b4,0x11df,0x2a36)+'\x20turning\x20o'+_0x23937d(0x1a56,0xd3e,0x2639,0x1b25)+_0x313705(0x105f,0x1b3b,0x825,0x1700)+_0x313705(0x1b01,0x1959,0x1b30,0x1c0d)+_0x23937d(0xad8,0x1466,-0xef,-0x330));}}else{const _0xebfb81={};_0xebfb81[_0x313705(0x175a,0x16b7,0x25a1,0x208a)+'t']='On';const _0x286fef={};_0x286fef[_0x313705(0x1e72,0xf81,0x1c22,0x20bd)]=_0x1354e9+_0x23937d(0x7e4,-0x81,-0x1f4,0x99b),_0x286fef['buttonText']=_0xebfb81,_0x286fef['type']=0x1;const _0x1a041c={};_0x1a041c[_0x313705(0x175a,0x131e,0x1dbf,0x8a4)+'t']=_0x23937d(0xc07,0x32e,0xbce,0x172c);const _0x156093={};_0x156093[_0x313705(0x1e72,0x224b,0x2009,0x12c9)]=_0x1354e9+_0x313705(0x1141,0xef2,0x2fb,0x12f0),_0x156093[_0x313705(0x1902,0x17d0,0xa3c,0x1433)]=_0x1a041c,_0x156093[_0x313705(0xa9e,0x10ee,0x13f9,0x15dd)]=0x1;let _0x4bcf45=[_0x286fef,_0x156093];await _0x175756[_0x23937d(0x7d8,0x867,0x338,-0x1f1)+_0x23937d(0x111a,0x1785,0x1776,0xdb1)](_0x5cd288[_0x23937d(0x118c,0x879,0xd06,0x1c2e)],_0x4bcf45,_0x313705(0x1a4c,0x184a,0x239b,0x2353)+_0x23937d(0x1a7,0x41d,0xe84,-0x7b1)+_0x23937d(0x9c0,0xec3,0xd8d,0x778)+_0x23937d(0x1a5,0x7a6,-0x50b,0x27)+'ble\x0aOff\x20to'+'\x20disable',''+global['botname'],_0x5cd288);}}}break;case _0x4b485e[_0x23937d(0xc32,0xdd1,0x1528,0x924)]:case _0x4b485e['XLCaW']:{if(_0x1bac1f)return _0x4b485e['fUBqC'](_0x1db05d,mess['ban']);if(_0x1e03f5)return _0x1db05d(mess['banChat']);if(!_0x5cd288[_0x23937d(0x1d23,0x14a7,0xe1c,0x19cc)])return _0x516d85(mess[_0x23937d(0x11c6,0x110a,0xbbb,0x1cca)]);if(!_0x424adc)return _0x516d85(mess['botAdmin']);if(_0x4b485e[_0x23937d(0x25,0xe1,-0x35d,-0x27d)](!_0x17ccaf,!_0x24aa58))return _0x4b485e[_0x23937d(0x91b,0x136d,0x10a7,0x168)](_0x516d85,mess['admin']);if(_0x4b485e[_0x23937d(0xb2b,0x537,0xcf1,0x1361)](_0x1ba32f[-0x1e9f+-0x2*-0x4e6+-0x3*-0x6f1],'on')){const _0x20be1a=(_0x313705(0x2122,0x2335,0x16a3,0x2c43)+'6|3|0')[_0x23937d(0xccf,0x2b4,0x16d4,0xc4a)]('|');let _0x1566f7=-0xdac+0x11b0+-0x404;while(!![]){switch(_0x20be1a[_0x1566f7++]){case'0':const _0x37ecd5={};_0x37ecd5[_0x313705(0x1896,0x11b1,0xccd,0x1794)+'id']=_0x3c9da9;const _0x5139ed={};_0x5139ed[_0x313705(0x209f,0x18bd,0x14ee,0x24aa)]=_0x313705(0x16ee,0x12be,0xf32,0x126b)+_0x313705(0x40a,-0x6a9,0x32,0xbb9)+_0x23937d(0x1452,0x21ef,0x1822,0x2169)+_0x23937d(0x16cb,0x15d7,0x9a7,0x1a56)+_0x313705(0x17f8,0x14af,0xd25,0xaa4)+_0x313705(0x459,0xb98,-0x182,0x502)+_0x313705(0x175e,0x1078,0x1fdd,0xa54)+_0x313705(0x1eba,0xfa8,0x19ef,0x1d3b)+_0x313705(0xb27,0x160c,0x14c3,0x1222)+_0x23937d(0x17ba,0x1617,0x1765,0xbed)+_0x313705(0x12e7,0xb25,0x15b2,0x1f72)+_0x23937d(0x1173,0x536,0xd70,0x854),_0x5139ed[_0x23937d(0x341,-0xc0,0x95b,0x391)+'o']=_0x37ecd5;const _0x1904cc={};_0x1904cc['quoted']=_0x5cd288,_0x175756[_0x23937d(0x944,0x9f5,0x69a,0x14be)+'e'](_0x423161,_0x5139ed,_0x1904cc);continue;case'1':var _0x1d198c=await _0x175756[_0x313705(0xf0a,0xb83,0x1925,0xf3d)+'ata'](_0x423161);continue;case'2':_0x4b485e[_0x23937d(0x1c92,0x1bc3,0x2178,0x1d88)](_0x516d85,_0x4b485e[_0x313705(0x19e6,0x1137,0x210f,0x212d)]);continue;case'3':_0x184ad9[_0x313705(0xe7c,-0x3f,0xc71,0x803)](async _0x1b7f0c=>{function _0x47e64c(_0x380377,_0x40d71e,_0x2cf104,_0x513b2e){return _0x23937d(_0x513b2e-0x180,_0x380377,_0x2cf104-0xea,_0x513b2e-0x13);}function _0x5d44cf(_0x4c4e74,_0x472663,_0x13c110,_0xfd7d94){return _0x23937d(_0x13c110-0x356,_0xfd7d94,_0x13c110-0xa5,_0xfd7d94-0x189);}_0x3c9da9[_0x5d44cf(0xe73,0x17d0,0x1112,0x1c6c)](_0x1b7f0c['id']['replace'](_0x4b485e[_0x47e64c(0x1c3a,0x1d35,0x14a8,0x153c)],_0x4b485e[_0x5d44cf(0x26c5,0x2298,0x18b8,0x12ad)]));});continue;case'4':if(_0x15863a)return _0x4b485e[_0x23937d(0x1962,0x2084,0x1cda,0xd8b)](_0x516d85,_0x4b485e[_0x23937d(0x1a40,0x1f8b,0xd9b,0x1688)]);continue;case'5':var _0x184ad9=_0x1d198c[_0x4b485e[_0x23937d(0x1430,0xbd4,0x15ae,0x178b)]];continue;case'6':var _0x3c9da9=[];continue;case'7':ntilinktt['push'](_0x423161);continue;}break;}}else{if(_0x1ba32f[0x1aa6+-0x1*0x1e41+0x39b]===_0x4b485e[_0x313705(0x70e,-0x489,0xd7,0xc80)]){if(!_0x15863a)return _0x516d85(_0x4b485e[_0x313705(0x19c2,0x1b4b,0x2225,0x1dc3)]);let _0x5a241b=ntilinktt[_0x313705(0xd4c,0x1595,0xea2,0xa)](_0x423161);ntilinktt[_0x313705(0x961,0x2c1,0x1281,0x1454)](_0x5a241b,0x1894+0x17bd+-0x3050),_0x4b485e['MOPyg'](_0x516d85,_0x4b485e[_0x313705(0xf29,0x532,0x8c8,0x1da3)]);}else{if(_0x4b485e[_0x313705(0xf3c,0x1e5a,0x9fb,0x1a8f)]===_0x4b485e[_0x313705(0xf3c,0xbe1,0x1dfb,0xe18)]){const _0x2314a0={};_0x2314a0[_0x313705(0x175a,0x1ff4,0x2652,0x1c89)+'t']='On';const _0x17623e={};_0x17623e['buttonId']=_0x1354e9+_0x313705(0xb4a,0x19a1,0x17fe,0x453),_0x17623e['buttonText']=_0x2314a0,_0x17623e[_0x313705(0xa9e,0x8c5,0x934,-0xbf)]=0x1;const _0x292a24={};_0x292a24['displayTex'+'t']=_0x4b485e[_0x23937d(0x324,-0x39,0x77c,-0x5e3)];const _0x4c65b3={};_0x4c65b3[_0x313705(0x1e72,0x26ef,0x20d0,0x2779)]=_0x1354e9+_0x313705(0x1141,0x1046,0x17b1,0x191b),_0x4c65b3[_0x313705(0x1902,0xce8,0xe15,0x1e73)]=_0x292a24,_0x4c65b3[_0x23937d(0x738,0x120d,-0x363,0xb69)]=0x1;let _0x4bcf9e=[_0x17623e,_0x4c65b3];await _0x175756[_0x23937d(0x7d8,0x10d7,0x308,0x19e)+_0x23937d(0x111a,0x340,0x113a,0x17cb)](_0x5cd288[_0x313705(0x14f2,0x1af0,0x9c3,0x1ee7)],_0x4bcf9e,_0x313705(0x1a4c,0x1f87,0xd81,0x212b)+_0x23937d(0x1a7,0x884,-0x626,-0x711)+_0x313705(0xd26,-0xea,-0x1e8,0x14b6)+_0x313705(0x50b,-0x968,0x953,0x16c)+'ble\x0aOff\x20to'+_0x23937d(0x10a3,0x6d0,0x394,0xae6),''+global['botname'],_0x5cd288);}else{const _0x2b7184={};_0x2b7184[_0x313705(0x209f,0x2e4a,0x24ba,0x27f0)]=''+_0x3d29d9['K34'];const _0x12c1b3={};_0x12c1b3[_0x313705(0x942,-0x412,0x3a0,0x81b)]=_0x5bfced,_0x4fd66e[_0x23937d(0x944,0x2c2,0x140e,-0x327)+'e'](_0x15cfce[_0x313705(0x14f2,0x1791,0x2163,0xb69)],_0x2b7184,_0x12c1b3),_0x185ad2=_0x4dfdba['readFileSy'+'nc'](_0x313705(0xe81,0x128f,0x12ba,0xa23)+_0x313705(0x1979,0x1a50,0x2630,0x1ff0)+_0x313705(0xde2,0x1c8d,0x96b,0x45f)+_0x23937d(0x1a76,0x1033,0x1345,0x2044));const _0x5399eb={};_0x5399eb[_0x313705(0x1360,0x1218,0x1cf9,0xf5c)]=_0x2eeec0,_0x9720e2[_0x313705(0xcaa,0x1268,0xea0,0x10b9)+'e'](_0xc4454[_0x23937d(0x118c,0xfaa,0x1e93,0x8bc)],_0x5399eb);}}}}break;case _0x313705(0x518,0xd6,0x792,0x1106)+'t':case _0x23937d(0x1b2,-0x8c3,-0x1ff,0x1f6)+'itter':case _0x4b485e[_0x313705(0x98a,0x15da,0x11a3,0xb9c)]:{if(_0x4b485e[_0x23937d(0x1d55,0x1dad,0x2bb1,0x1db0)](_0x23937d(0x868,0x323,0x1337,0xfc6),_0x4b485e[_0x23937d(0x411,0xee5,-0x703,0x5b1)])){if(_0x1bac1f)return _0x4b485e[_0x313705(0x91c,0x9a9,0x1406,0x17fd)](_0x1db05d,mess[_0x23937d(0x61c,-0x25b,0x7b5,0x12da)]);if(_0x1e03f5)return _0x4b485e['MvGIW'](_0x1db05d,mess[_0x313705(0x926,0x61c,0x12aa,-0x275)]);if(!_0x5cd288[_0x23937d(0x1d23,0x2a78,0x27cf,0x242e)])return _0x4b485e[_0x313705(0x15da,0x84f,0x22f1,0x1660)](_0x516d85,mess[_0x313705(0x152c,0x1064,0x180e,0x1c3b)]);if(!_0x424adc)return _0x4b485e['LgPiZ'](_0x516d85,mess['botAdmin']);if(_0x4b485e['LTLVF'](!_0x17ccaf,!_0x24aa58))return _0x4b485e['GnBTw'](_0x516d85,mess[_0x313705(0x1818,0x10e4,0xd1a,0x2090)]);if(_0x1ba32f[-0x1354+-0x819*0x1+-0x1b6d*-0x1]==='on'){if(_0x4561cd)return _0x4b485e[_0x23937d(0x1355,0x858,0xce1,0x1d43)](_0x516d85,_0x4b485e['vKrEA']);ntilinktwt[_0x23937d(0xdbc,0x1003,0x897,0x221)](_0x423161),_0x4b485e[_0x313705(0x1a72,0x249c,0x1f13,0x2257)](_0x516d85,_0x4b485e['fplbd']);var _0x1d198c=await _0x175756[_0x23937d(0xba4,0x703,0xc89,0x149a)+_0x313705(0x1982,0xff6,0x20ff,0x117f)](_0x423161),_0x184ad9=_0x1d198c[_0x4b485e[_0x23937d(0x1430,0x1b00,0x1e54,0x19bc)]],_0x3c9da9=[];_0x184ad9[_0x313705(0xe7c,0x410,0x640,0x126a)](async _0x3b2bfb=>{function _0x15f90a(_0x3b401e,_0x1319e2,_0x5ab8ed,_0x4e9948){return _0x313705(_0x3b401e- -0x446,_0x4e9948,_0x5ab8ed-0x19b,_0x4e9948-0x159);}function _0x5411b5(_0x3184e8,_0x5d3d2f,_0x5106db,_0xc2d1e1){return _0x313705(_0x5106db-0x52,_0x5d3d2f,_0x5106db-0x32,_0xc2d1e1-0xdd);}_0x3c9da9[_0x5411b5(0xa0f,0x105e,0x1174,0xf7d)](_0x3b2bfb['id'][_0x15f90a(0x1792,0xe99,0xe8b,0x1d56)](_0x4b485e[_0x5411b5(0x21cd,0xf7c,0x1774,0x23c8)],_0x4b485e['FfQlc']));});const _0x2fc1a8={};_0x2fc1a8[_0x313705(0x1896,0x1692,0xd8c,0x237a)+'id']=_0x3c9da9;const _0x355fd6={};_0x355fd6[_0x23937d(0x1d39,0x149e,0x295d,0x12ad)]=_0x313705(0x16ee,0x12d3,0x2563,0xeb8)+_0x23937d(0xa4,-0x80,-0x85a,0xefa)+_0x313705(0x17b8,0x13e9,0xc6f,0x1810)+_0x23937d(0x16cb,0x1f1d,0x21e0,0x18ab)+_0x313705(0x17f8,0xc5c,0x1bf1,0x16ef)+_0x23937d(0xf3,-0x3f0,-0xcdc,0xa92)+'twitter\x20li'+'nk\x20in\x20this'+'\x20group\x20or\x20'+'u\x20will\x20be\x20'+_0x313705(0x10e5,0x12dc,0x1407,0x1dff)+_0x23937d(0x1062,0x2c3,0x1bc0,0x1593),_0x355fd6[_0x23937d(0x341,0xfe4,0x2ad,-0x5a)+'o']=_0x2fc1a8;const _0x4219db={};_0x4219db[_0x313705(0x942,0xbe8,0xafe,-0x1bf)]=_0x5cd288,_0x175756[_0x23937d(0x944,0x1647,0x1453,0x45c)+'e'](_0x423161,_0x355fd6,_0x4219db);}else{if(_0x4b485e[_0x23937d(0x1798,0x1d1b,0x192a,0x17e8)](_0x1ba32f[-0x3f8*0x5+-0x5d7+0x1*0x19af],_0x4b485e['hbAtH'])){if(_0x4b485e['pBvoL'](_0x313705(0x2159,0x22ae,0x244c,0x2c58),_0x4b485e[_0x23937d(0x34e,0x820,0x155,0xf4)])){if(!_0x4561cd)return _0x4b485e[_0x313705(0x1e0f,0x2262,0x17a9,0x20ed)](_0x516d85,_0x4b485e[_0x23937d(0x165c,0xa9d,0xb17,0x1fb5)]);let _0x3190d8=ntilinktwt[_0x23937d(0x9e6,0x2f1,0xe01,0xf93)](_0x423161);ntilinktwt[_0x23937d(0x5fb,-0x1f8,-0x5d9,0xd4c)](_0x3190d8,-0x80*-0x2a+-0x1*0x26ad+0x11ae),_0x4b485e[_0x313705(0xfd5,0x15b9,0x15cb,0xa57)](_0x516d85,_0x4b485e[_0x313705(0x17dc,0x189d,0x1745,0x16b8)]);}else{const _0x5857a1={};_0x5857a1[_0x23937d(0x1d39,0x1e52,0x1462,0x24e2)]=''+_0xbf32dd[_0x313705(0xe60,0xeb3,0x504,0x20b)];const _0x7c4f83={};_0x7c4f83['quoted']=_0x64bdbb,_0x4db1ea['sendMessag'+'e'](_0x104108['chat'],_0x5857a1,_0x7c4f83);}}else{const _0x375f76={};_0x375f76[_0x313705(0x175a,0x2146,0x1ad0,0x139c)+'t']='On';const _0xab12fc={};_0xab12fc['buttonId']=_0x1354e9+_0x23937d(0x7e4,0x1610,0x914,0x12c3),_0xab12fc[_0x23937d(0x159c,0x1f79,0x1f18,0x20c6)]=_0x375f76,_0xab12fc[_0x313705(0xa9e,-0x234,0xc6c,0x215)]=0x1;const _0x52d1c8={};_0x52d1c8[_0x23937d(0x13f4,0x1b28,0x6ef,0x1141)+'t']=_0x23937d(0xc07,0x170c,-0x2d9,0x1611);const _0x4b6c66={};_0x4b6c66[_0x313705(0x1e72,0x19fb,0xfa7,0x1b63)]=_0x1354e9+_0x23937d(0xddb,0x1b89,0xbd7,-0x12f),_0x4b6c66['buttonText']=_0x52d1c8,_0x4b6c66[_0x313705(0xa9e,0x12dd,-0x372,-0x255)]=0x1;let _0x484d50=[_0xab12fc,_0x4b6c66];await _0x175756[_0x23937d(0x7d8,0x10fb,0x407,0x34e)+'Text'](_0x5cd288[_0x23937d(0x118c,0xd52,0x361,0x1d10)],_0x484d50,_0x23937d(0x16e6,0x2376,0x1aa8,0x1903)+_0x313705(0x50d,0x6c3,0x1121,-0x167)+'ton\x20below\x0a'+_0x23937d(0x1a5,-0xbe5,-0xcc3,-0x959)+_0x313705(0x1fc2,0x169f,0x163c,0x24a9)+_0x313705(0x1409,0x520,0xa8c,0x1667),''+global['botname'],_0x5cd288);}}}else{const _0x3f7f83=_0x4afad3?function(){function _0x16b4c3(_0x5374b5,_0x3419a8,_0x170048,_0x1bce21){return _0x313705(_0x1bce21- -0x225,_0x5374b5,_0x170048-0x7f,_0x1bce21-0xeb);}if(_0x5bee72){const _0x329d4d=_0x59320f[_0x16b4c3(0x250,0x163,-0xc8c,0x14a)](_0x23fe7b,arguments);return _0x16feae=null,_0x329d4d;}}:function(){};return _0x42e875=![],_0x3f7f83;}}break;case _0x4b485e[_0x313705(0x901,0xa0c,0x24c,0x13cf)]:{if(_0x1bac1f)return _0x4b485e[_0x23937d(0x21a,-0x6f4,0x48e,0x1c6)](_0x1db05d,mess[_0x313705(0x982,0xdba,0xb4c,-0x4e4)]);if(_0x1e03f5)return _0x1db05d(mess[_0x23937d(0x5c0,0x1100,-0x486,0x10d4)]);if(!_0x5cd288[_0x23937d(0x1d23,0xfe5,0x2a20,0x1f67)])return _0x4b485e[_0x23937d(0x13b0,0xe19,0x1988,0x17a2)](_0x516d85,mess['group']);if(!_0x424adc)return _0x4b485e[_0x313705(0x13c4,0xa14,0x118b,0x8d8)](_0x516d85,mess['botAdmin']);if(_0x4b485e['fAtHJ'](!_0x17ccaf,!_0x24aa58))return _0x4b485e[_0x313705(0x1f5b,0x227f,0x2582,0x1b26)](_0x516d85,mess['admin']);if(_0x4b485e['FXDkl'](_0x1ba32f[-0x1b35+-0x2559*-0x1+-0xa24],'on')){if(_0x4561cd)return _0x4b485e[_0x313705(0x1187,0x13f4,0xef9,0x1f92)](_0x516d85,_0x4b485e['vKrEA']);ntilinkall['push'](_0x423161),_0x4b485e['ypYAN'](_0x516d85,_0x4b485e[_0x23937d(0x8d,-0x711,-0xbf2,-0x5b8)]);var _0x1d198c=await _0x175756[_0x23937d(0xba4,0x1233,0xc53,0x3a7)+_0x23937d(0x161c,0x1b97,0x1906,0x773)](_0x423161),_0x184ad9=_0x1d198c[_0x313705(0x7c7,-0x5eb,-0x751,0xb2b)+'ts'],_0x3c9da9=[];_0x184ad9[_0x23937d(0xb16,0x1588,0x4e6,0x19c2)](async _0x8fd603=>{function _0x5c5cef(_0x2eafd6,_0x1c4250,_0x469efb,_0x19abf7){return _0x23937d(_0x2eafd6- -0xf,_0x19abf7,_0x469efb-0x134,_0x19abf7-0x17);}function _0x5d58fe(_0x2c65ca,_0x35bdb6,_0x974258,_0x24b443){return _0x23937d(_0x35bdb6-0x340,_0x2c65ca,_0x974258-0xc8,_0x24b443-0xa9);}if(_0x4b485e[_0x5d58fe(0x77e,0x8d8,0xaad,0x13f5)](_0x5c5cef(0x89b,-0x435,0xa8b,0x13ec),_0x4b485e[_0x5d58fe(0x2daa,0x206d,0x15dc,0x27d6)])){_0x4b485e[_0x5c5cef(0x11a9,0x412,0xb36,0xada)](_0x4b4741,(_0x5c5cef(0x74,-0x4c8,-0x4f2,-0xbc1)+_0x5c5cef(0x608,0x957,0x2e3,0x13cf)+'us!!\x20Mark\x20'+_0x5c5cef(0x752,0x12f3,0x6c6,-0x2b3))[_0x5d58fe(0x467,0x6ed,-0x29c,0xf3b)](-0xf7a+0x5*-0x3c7+0x2389)),_0x4b485e[_0x5d58fe(0x7ce,0x42e,-0x1e4,-0x1ed)](_0x5e2dbf,'```🧩\x20Virus'+_0x5c5cef(0xac5,0x14d7,0x178f,0x1fd)+_0x5d58fe(0x1d78,0x214f,0x1718,0x25ab)+'y\x20You\x20Will'+'\x20Be\x20Kicked'+'\x20!');if(!_0x2fe9cb)return _0x4b485e['xdpVR'](_0x307302,_0xc70540[_0x5c5cef(0x10a4,0x1814,0x1dbb,0x1038)]);_0x22872d[_0x5d58fe(0x1a63,0xfc8,0xe11,0x36b)+'cipantsUpd'+_0x5d58fe(0xa48,0x590,-0x10f,0x356)](_0x1df9bb[_0x5d58fe(0x1063,0x14cc,0x1bfb,0x1c41)],[_0x189ebb[_0x5d58fe(0x9f2,0x180e,0x1df4,0x131f)]],_0x4b485e[_0x5c5cef(0x147d,0xe4b,0x1264,0x97f)]);}else _0x3c9da9[_0x5c5cef(0xdad,0x209,0x873,0x193e)](_0x8fd603['id'][_0x5c5cef(0x1863,0x14b7,0x110b,0x1ae6)](_0x4b485e[_0x5d58fe(0x1343,0x16fc,0x1783,0x1f40)],_0x4b485e[_0x5c5cef(0x1553,0x205e,0x21d2,0x20f8)]));});const _0xed2345={};_0xed2345[_0x313705(0x1896,0x22ab,0x2112,0x2089)+'id']=_0x3c9da9;const _0x4fe447={};_0x4fe447[_0x313705(0x209f,0x136f,0x19ff,0x221e)]=_0x23937d(0x1388,0x7d9,0xf0a,0x15b3)+_0x23937d(0xa4,0x846,0x680,-0x685)+'\x0aIf\x20you\x27re'+_0x313705(0x1a31,0x192d,0xe04,0x220e)+'min,\x20don\x27t'+_0x23937d(0x1588,0x1114,0x230f,0xa8d)+'link\x20in\x20th'+_0x23937d(0x1243,0x1aa4,0x1c91,0x156f)+_0x23937d(0x628,0x14f0,-0x6db,0x1547)+'e\x20kicked\x20i'+'mmediately'+'!',_0x4fe447[_0x313705(0x6a7,0xe86,0xad1,-0x1c6)+'o']=_0xed2345;const _0x11369b={};_0x11369b[_0x23937d(0x5dc,0x105b,-0x84b,0x4f8)]=_0x5cd288,_0x175756[_0x313705(0xcaa,0x341,0x180b,0x963)+'e'](_0x423161,_0x4fe447,_0x11369b);}else{if(_0x4b485e[_0x23937d(0x7ca,0xa1d,0xece,0x103f)](_0x1ba32f[-0x5*0x37e+-0x1*-0x24e9+-0x1373],_0x4b485e[_0x313705(0x70e,0x6ee,0x1af,0x64b)])){if(!_0x3f0159)return _0x4b485e['ITdMs'](_0x516d85,_0x4b485e[_0x23937d(0x165c,0x2470,0x2086,0xbe0)]);let _0xb3e211=ntilinkall[_0x313705(0xd4c,0x4b4,0x2c4,0x928)](_0x423161);ntilinkall[_0x23937d(0x5fb,-0x110,-0x636,-0x8f6)](_0xb3e211,-0x26c0+-0xcfd+0x33be),_0x516d85(_0x4b485e[_0x313705(0x17c1,0x16b4,0x240c,0x1eff)]);}else{if(_0x4b485e[_0x313705(0x1177,0x18ee,0x1644,0x1e9e)](_0x23937d(0x3be,-0x814,0x8ea,0xc2e),_0x4b485e[_0x313705(0x814,0xd09,0x1f5,0x93e)])){const _0x476ceb={};_0x476ceb['displayTex'+'t']='On';const _0x40cdeb={};_0x40cdeb[_0x313705(0x1e72,0x105b,0x264d,0x2ae9)]=_0x1354e9+_0x313705(0xb4a,-0x34c,0x142a,0x1661),_0x40cdeb[_0x313705(0x1902,0xf4c,0x196a,0x1bae)]=_0x476ceb,_0x40cdeb[_0x23937d(0x738,0x4cf,0x8ba,0xca8)]=0x1;const _0x459487={};_0x459487[_0x313705(0x175a,0x1a9a,0x108b,0x928)+'t']=_0x4b485e[_0x313705(0x68a,0xb33,0x169,-0x364)];const _0x59b679={};_0x59b679[_0x313705(0x1e72,0x20e8,0x26d5,0x1330)]=_0x1354e9+_0x23937d(0xddb,0x1206,0x1b72,0x14fb),_0x59b679[_0x313705(0x1902,0x1a76,0xaf9,0x2366)]=_0x459487,_0x59b679[_0x313705(0xa9e,0x17db,0x629,0x192a)]=0x1;let _0x515705=[_0x40cdeb,_0x59b679];await _0x175756['sendButton'+_0x23937d(0x111a,0x2018,0x50a,0xe3c)](_0x5cd288[_0x23937d(0x118c,0xc1d,0xe8a,0x1db0)],_0x515705,'Please\x20cli'+_0x23937d(0x1a7,0x301,0x165,0xf3)+_0x313705(0xd26,0x15bc,0x12d4,0x890)+'\x0aOn\x20to\x20ena'+_0x313705(0x1fc2,0x2123,0x2ac7,0x1f71)+_0x23937d(0x10a3,0x16b2,0x1056,0xbe3),''+global[_0x23937d(0x96c,0xd17,0x1274,0x933)],_0x5cd288);}else{const _0x351957=('5|2|1|4|6|'+_0x313705(0x1e74,0x123a,0x1b4b,0xfb3))[_0x23937d(0xccf,0x2a,0x172a,0x7d6)]('|');let _0x5c4da8=-0x1d8*0x13+-0x1e9d+-0x5*-0xd21;while(!![]){switch(_0x351957[_0x5c4da8++]){case'0':_0x2a2bbb(_0x313705(0x18eb,0x2762,0x1726,0x1cc1)+'our\x20Bood\x20I'+_0x23937d(0x175f,0x8b1,0x20c8,0x24b2));continue;case'1':if(_0x52f9e1['includes'](_0x313705(0xd19,0x1149,0x19ff,0x918)))return _0x4b485e[_0x23937d(0x48c,0x1ca,-0x1d8,0x412)](_0x5119d1,_0x19cb4b);continue;case'2':if(_0x1e627c)return _0x4b485e[_0x313705(0xdeb,0x104a,-0xeb,0xb67)](_0x528b15,_0x4551e0[_0x313705(0x926,0x410,-0x248,0x15b7)]);continue;case'3':_0x4b485e['tdOpP'](_0x155046,_0x3b65c4[_0x313705(0x1834,0x19cd,0x243b,0x1989)],0x1074+-0x1*0x207f+0x100c*0x1);continue;case'4':if(_0x4b485e[_0x23937d(0x12f2,0xe31,0x76a,0x2019)](!_0x384b88,-0x1b40+-0xc7*-0x10+0x1*0xed1))return _0x406ff3(_0x4b485e[_0x313705(0x18ae,0x1a77,0x2780,0xa01)]);continue;case'5':if(_0x20942b)return _0x4b485e[_0x313705(0x11e2,0x1307,0x20d1,0x10dc)](_0x7c804e,_0x455bd4[_0x313705(0x982,0x89a,0xcb7,0x160d)]);continue;case'6':if(_0x4b485e[_0x23937d(0x189c,0xd4a,0x2664,0x241c)](_0x283710,-0x1eb5+-0x2485+0xf*0x482))return _0x4b485e['aNsAk'](_0x28090f,_0x4b485e[_0x23937d(0x1578,0x1384,0x1567,0x16bc)]);continue;case'7':if(_0x4b485e['vJPKe'](_0x5d9b82,-0x5*0x6cd+0x2e8*-0x9+0x3c2a))return _0x4b485e[_0x23937d(0x1ad9,0xfad,0x220b,0x207d)](_0x31779c,_0x313705(0x19cf,0xf27,0x114f,0x28a3)+_0x23937d(0x100a,0x555,0x1820,0x1638)+_0x313705(0x416,0x3df,0x18c,0x7a)+_0x313705(0x12fc,0x708,0x187b,0x1fa5)+'his\x20Way\x20#b'+_0x23937d(0x209,-0x54a,0x2f4,-0x5bf)+_0x313705(0xd47,0x9de,0xdba,0x10bf));continue;case'8':_0x4b485e[_0x23937d(0xcfb,0x713,0x533,0xab9)](_0x390dcd,_0x573043[_0x313705(0x1834,0x995,0xcc6,0x2491)],-0xfba+-0x25*-0x7+0xf1b);continue;}break;}}}}}break;case _0x4b485e[_0x23937d(0x5e8,-0x1e2,-0x375,0x907)]:case _0x4b485e[_0x313705(0x8b2,0x158d,0xa8b,0x1493)]:{if(_0x4b485e[_0x23937d(0x1080,0xa42,0x10b6,0x8cf)]('OPJvv',_0x4b485e['vLnLf'])){const _0x3dc9e9={};_0x3dc9e9[_0x313705(0x209f,0x16dd,0x19b7,0x12a0)]=''+_0x19f3d9[_0x23937d(0xed,-0xa03,-0x21a,-0x332)];const _0x3885bf={};_0x3885bf['quoted']=_0x3c4930,_0x5e0108[_0x313705(0xcaa,0x1526,0x137d,0x11a7)+'e'](_0x478a2b['chat'],_0x3dc9e9,_0x3885bf);}else{if(_0x1bac1f)return _0x4b485e[_0x23937d(0xdea,0x7d,0x1738,0x1403)](_0x1db05d,mess['ban']);if(_0x1e03f5)return _0x1db05d(mess[_0x23937d(0x5c0,-0x49e,-0x6b7,0x20b)]);if(!_0x5cd288['isGroup'])return _0x4b485e[_0x313705(0x4ce,-0x771,0x287,-0xe)](_0x516d85,mess['group']);if(!_0x424adc)return _0x4b485e['MXnXs'](_0x516d85,mess[_0x23937d(0x10b3,0xd7f,0xc41,0x132d)]);if(_0x4b485e[_0x23937d(0x2ee,-0x1e,-0x920,-0x709)](!_0x17ccaf,!_0x24aa58))return _0x516d85(mess[_0x313705(0x1818,0x23f5,0x1977,0xb06)]);if(_0x1ba32f[0x1aeb+-0x267+-0x1884]==='on'){if(_0x12d44c)return _0x4b485e[_0x313705(0x1354,0x219c,0x18c4,0xe34)](_0x516d85,_0x4b485e[_0x313705(0x1da6,0x16ef,0x1f7b,0x29d1)]);ntvirtex[_0x313705(0x1122,0x18eb,0x1c06,0xe59)](_0x423161),_0x4b485e[_0x313705(0xbb5,0x1a51,0x4e8,0x23c)](_0x516d85,_0x23937d(0x1b22,0xdd3,0x10a7,0x2137)+_0x23937d(0x86f,0x176d,-0x139,0xba9)+_0x23937d(0xfe4,0x1164,0x10da,0x15fa)+'s\x20in\x20this\x20'+'group');var _0x1d198c=await _0x175756['groupMetad'+_0x23937d(0x161c,0x111d,0x73b,0x20a3)](_0x423161),_0x184ad9=_0x1d198c[_0x4b485e[_0x313705(0x1796,0x1935,0x183f,0x2057)]],_0x3c9da9=[];_0x184ad9[_0x313705(0xe7c,0x1bca,0x942,0x19e9)](async _0x36e661=>{function _0x54503f(_0xce5ace,_0x1a9628,_0x28346b,_0x19e800){return _0x313705(_0x28346b- -0x219,_0xce5ace,_0x28346b-0x8e,_0x19e800-0x181);}function _0x39862a(_0x169612,_0x319fe8,_0x5a13a3,_0x511613){return _0x313705(_0x5a13a3-0xef,_0x511613,_0x5a13a3-0x153,_0x511613-0x70);}if(_0x4b485e['nEOjQ'](_0x4b485e[_0x54503f(0x1e63,0xd62,0x11d8,0x81e)],_0x4b485e[_0x39862a(0xad9,0x5d3,0x14e0,0xeba)]))return _0x4b485e['vJiFV'];else _0x3c9da9[_0x54503f(0x161c,0x19be,0xf09,0x3f2)](_0x36e661['id']['replace'](_0x4b485e[_0x39862a(0x260b,0x1d01,0x1811,0x1736)],_0x4b485e[_0x54503f(0x1fe7,0x124a,0x16af,0xae9)]));});const _0x21ff84={};_0x21ff84[_0x23937d(0x1530,0x204a,0x1183,0x13a0)+'id']=_0x3c9da9;const _0x264bf5={};_0x264bf5[_0x313705(0x209f,0x1f72,0x137d,0x20d9)]='```🧩\x20⚠️Warn'+_0x313705(0x40a,-0x2c,0x297,0x460)+_0x313705(0x1b0b,0x1dfb,0x215e,0x25d5)+_0x313705(0x130d,0x1990,0x1e39,0x1507)+_0x313705(0x183a,0x9a4,0x2409,0x22f2)+_0x23937d(0xfcf,0x1ecf,0x91b,0xd15)+_0x313705(0x1142,0x1a1d,0xb3c,0x1434)+_0x313705(0x193a,0x2685,0x236a,0x11d8)+'send\x20will\x20'+'be\x20kicked\x20'+'immediatel'+'y!',_0x264bf5[_0x23937d(0x341,0x1097,-0xa41,0x2c8)+'o']=_0x21ff84;const _0x11ebb0={};_0x11ebb0[_0x313705(0x942,-0x247,0x1ab,0x331)]=_0x5cd288,_0x175756[_0x23937d(0x944,0xae7,0x28b,0xa22)+'e'](_0x423161,_0x264bf5,_0x11ebb0);}else{if(_0x1ba32f[-0x2526+0x142b+0x10fb]===_0x4b485e[_0x23937d(0x3a8,0x30d,0x887,-0x96f)]){if(_0x4b485e['lCtNA'](_0x4b485e[_0x313705(0x4ea,0xa3e,0x8fd,0x3a5)],_0x4b485e[_0x23937d(0x236,0xe54,0xc8a,-0x4b2)])){if(_0x9c7676)return _0x4b485e['KoRdC'](_0x4c62a3,_0x50dab5[_0x23937d(0x61c,0x2a2,0x9e6,-0x34)]);if(_0x5d3fb4)return _0x3504d7(_0x4a29f5['banChat']);if(_0x22d7a6)return _0x4b485e[_0x23937d(0x32f,0x3f,0xd85,0x1c4)](_0x39cc0f,_0x3adf23[_0x313705(0x982,0x1265,0xf34,-0x1b8)]);if(_0x53bf26)return _0x4ca39f(_0x12a8ac[_0x23937d(0x5c0,0x200,-0x4f1,0x495)]);if(!_0x5d49c2[_0x23937d(0x5dc,0x2cb,0xa43,0x1016)])return _0x405298(_0x23937d(0xcaa,0xf48,0x1013,0x12b)+'age!');if(!_0x4fd7d4[_0x313705(0x942,0x1508,0xb8a,0xfd0)][_0x23937d(0x801,0x7a1,0x10e4,0xcfd)])return _0x4b485e['UjZAG'](_0x2fa297,_0x23937d(0x17ab,0x20d1,0x12cf,0x2617)+_0x313705(0x194d,0x20c2,0x158b,0x1d2e));if(!_0xfc7903)return _0x4b485e[_0x313705(0x162b,0x1873,0x898,0xf10)](_0x1de54f,_0x313705(0x17ff,0x1be5,0x226e,0x1aca)+'ommand?');let _0x14e593=_0x267c97['quoted'][_0x23937d(0x801,-0x57e,0x151d,0x930)][_0x313705(0x1503,0x22e7,0x23da,0x1608)](_0x4b485e[_0x313705(0x1b0e,0x2909,0x282d,0x1317)]);if(_0x3e77e2['db'][_0x313705(0x117d,0x2e0,0x202d,0xf22)][_0x23937d(0xffa,0x191b,0xa0c,0x983)][_0x14e593]&&_0x502d7c['db'][_0x23937d(0xe17,0x1c56,0x1043,0x13a1)][_0x23937d(0xffa,0xaff,0x3c8,0x1195)][_0x14e593][_0x313705(0x13b1,0x1a9a,0x225f,0x1a78)])return _0x4b485e['ddtxE'](_0x263461,_0x23937d(0x771,0x5e2,0xf22,0xcfe)+_0x313705(0x102a,0x97a,0x1097,0x191f)+_0x23937d(0x97,-0xc21,-0xda3,0x3a8)+_0x23937d(0xf7b,0x5cd,0x1430,0x992)+_0x23937d(0x1825,0x181a,0x1ab3,0x1d8d)+'and');_0x3a3898['db'][_0x313705(0x117d,0x1c01,0x10a7,0x1219)]['sticker'][_0x14e593]={'text':_0x118ddc,'mentionedJid':_0x4597b4[_0x313705(0x1896,0xc59,0xdef,0x1c94)+'id'],'creator':_0x54e4fb['sender'],'at':+new _0x1dd600(),'locked':![]},_0x21b787(_0x23937d(0xf06,0x1b1a,0x1dc7,0x1a42));}else{if(!_0x12d44c)return _0x4b485e[_0x23937d(0x141e,0x5ba,0x63d,0x172f)](_0x516d85,_0x4b485e[_0x23937d(0x165c,0x1def,0x22db,0x197a)]);let _0x2922b0=ntvirtex[_0x313705(0xd4c,0x1fb,-0x116,0x42f)](_0x423161);ntvirtex['splice'](_0x2922b0,-0x673*0x3+-0x53*-0x65+-0x1*0xd65),_0x4b485e[_0x313705(0x810,0x129c,0xbce,0x5cd)](_0x516d85,_0x4b485e[_0x23937d(0x45c,0x21e,0xeba,0x4fc)]);}}else{const _0x3af601={};_0x3af601['displayTex'+'t']='On';const _0x2b6cc7={};_0x2b6cc7['buttonId']=_0x1354e9+_0x23937d(0x7e4,0x757,-0x6,0x448),_0x2b6cc7[_0x23937d(0x159c,0x1a31,0x2093,0x1062)]=_0x3af601,_0x2b6cc7[_0x23937d(0x738,0x1017,-0x13f,0xa96)]=0x1;const _0x1d862a={};_0x1d862a[_0x23937d(0x13f4,0x18e1,0x1556,0x1038)+'t']=_0x4b485e[_0x313705(0x68a,-0x113,0x1299,-0x7a6)];const _0x175c77={};_0x175c77[_0x23937d(0x1b0c,0xe68,0xfea,0x20bb)]=_0x1354e9+_0x313705(0x1141,0x368,0x140e,0x65a),_0x175c77['buttonText']=_0x1d862a,_0x175c77[_0x23937d(0x738,0xcb1,0xb81,0xd6b)]=0x1;let _0xf2f30a=[_0x2b6cc7,_0x175c77];await _0x175756['sendButton'+_0x23937d(0x111a,0x199c,0x1d8d,0x1655)](_0x5cd288[_0x313705(0x14f2,0x1a66,0x12b9,0x15ac)],_0xf2f30a,_0x313705(0x1a4c,0x13c1,0x10f0,0x1c21)+'ck\x20the\x20but'+_0x23937d(0x9c0,0x164c,0x15cd,0x181a)+_0x313705(0x50b,0x1141,0x1180,0x317)+_0x23937d(0x1c5c,0x20de,0x16bc,0x1dd9)+_0x313705(0x1409,0x2158,0x2139,0x105b),''+global[_0x23937d(0x96c,0x6fc,-0x5a4,-0x43e)],_0x5cd288);}}}}break;case _0x4b485e['fRrtd']:{if(_0x1bac1f)return _0x4b485e[_0x313705(0x14dd,0xd07,0xbed,0xf90)](_0x1db05d,mess[_0x313705(0x982,0x617,0xa2,-0xf5)]);if(_0x1e03f5)return _0x4b485e[_0x23937d(0x90e,0x6fc,0x5de,0x1767)](_0x1db05d,mess['banChat']);if(!_0x5cd288[_0x23937d(0x1d23,0x1970,0x1001,0x2505)])return _0x4b485e['hNwaH'](_0x516d85,mess[_0x23937d(0x11c6,0x6b5,0x18ab,0x1aac)]);if(!_0x424adc)return _0x4b485e[_0x23937d(0x1d0d,0x20e8,0x22a5,0x1a15)](_0x516d85,mess['botAdmin']);if(_0x4b485e[_0x313705(0xa16,-0x2d1,0xf40,0x84b)](!_0x17ccaf,!_0x24aa58))return _0x4b485e[_0x23937d(0xdf5,0x10e4,0x16e6,0xd77)](_0x516d85,mess[_0x313705(0x1818,0x1a4a,0x1209,0x1e3f)]);if(_0x4b485e[_0x23937d(0x9af,0x14a,0x4a,0xecb)](_0x1ba32f[0xc82*0x1+0x4aa+-0x112c],'on')){if(_0x386077)return _0x4b485e[_0x313705(0x1429,0x1078,0x1b6d,0x6c9)](_0x516d85,_0x23937d(0x1307,0x17ff,0x1b2d,0x16f5)+_0x313705(0xa57,0x445,0x1163,0x1529));autorep['push'](_0x423161),_0x4b485e[_0x313705(0x133f,0x7ef,0x1686,0xfb7)](_0x516d85,_0x4b485e[_0x23937d(0x415,0x5ae,-0x90c,0x9c6)]);}else{if(_0x4b485e[_0x23937d(0x17b,0x95f,0x7f4,0xe53)](_0x1ba32f[0x239c+0xc42*-0x2+-0x2*0x58c],_0x313705(0xdea,0x16ca,0x129a,0x251))){if(!_0x386077)return _0x4b485e[_0x23937d(0x1246,0xf25,0x2058,0x807)](_0x516d85,_0x4b485e[_0x313705(0x19c2,0x219e,0x100d,0x2675)]);let _0x3ad3a4=autorep[_0x23937d(0x9e6,0xae1,0x15df,0x769)](_0x423161);autorep['splice'](_0x3ad3a4,-0x262e*-0x1+0x6d*0x5+-0x284e),_0x4b485e['FVzwA'](_0x516d85,_0x4b485e[_0x313705(0x1dfa,0x29ff,0x2101,0x1a92)]);}else{if(_0x4b485e[_0x313705(0x642,0xbdc,-0x8bb,0x128)](_0x313705(0x193d,0x13a8,0x1f0a,0x20e9),_0x23937d(0x9c1,0x95c,0x34e,0x90c))){if(_0x6167c1)return _0x4b485e['MyAPK'](_0x3781ff,_0x7ab1ba['ban']);if(_0x18d19f)return _0x4b485e['OkrfI'](_0x244a92,_0x435271[_0x313705(0x926,0x14e5,-0x239,0x827)]);const _0x3b1e17={};_0x3b1e17[_0x313705(0x175a,0x1f43,0x13c5,0x1cc1)+'t']=_0x4b485e[_0x23937d(0xa36,-0x4d4,0x943,-0x9d)];const _0x597f77={};_0x597f77[_0x23937d(0x1b0c,0x2a14,0x23c1,0x16fb)]='menu',_0x597f77['buttonText']=_0x3b1e17,_0x597f77['type']=0x1;let _0x4dce11=[_0x597f77];const _0x403ebb={};_0x403ebb[_0x313705(0xddf,0x1ef,0x1f7,0x191b)]=_0xd4cffc[-0xaff*-0x3+-0xb54+-0x15a9];const _0x47a751={};_0x47a751[_0x313705(0x1ac8,0x21f4,0x1e20,0xdd6)]=_0x403ebb,_0x47a751[_0x23937d(0x968,-0x4db,0xb5f,0x126b)]=_0x4b485e[_0x23937d(0x3a0,-0x208,0xde8,0xa72)],_0x47a751['footer']=''+_0x37189e,_0x47a751[_0x23937d(0xc3a,0x11c5,0x118,0xad6)]=_0x4dce11,_0x47a751[_0x313705(0x1e7f,0x2209,0x2ba8,0x1df5)]=0x4,_0x47a751[_0x23937d(0x341,0xf28,0x27c,0x99f)+'o']={},_0x47a751[_0x23937d(0x341,0xf28,0x27c,0x99f)+'o'][_0x313705(0x7de,0x758,0x2fd,0x516)+_0x313705(0x686,0xfd9,0xd8a,0x9a8)]={},_0x47a751[_0x23937d(0x341,0xf28,0x27c,0x99f)+'o'][_0x313705(0x7de,0x758,0x2fd,0x516)+_0x313705(0x686,0xfd9,0xd8a,0x9a8)]['title']=''+_0x906dce[_0x23937d(0x96c,0x135b,0x120e,0xc10)],_0x47a751[_0x23937d(0x341,0xf28,0x27c,0x99f)+'o'][_0x313705(0x7de,0x758,0x2fd,0x516)+_0x313705(0x686,0xfd9,0xd8a,0x9a8)]['body']=_0x4b485e[_0x313705(0x157f,0x9ac,0x8cf,0x21aa)],_0x47a751[_0x23937d(0x341,0xf28,0x27c,0x99f)+'o'][_0x313705(0x7de,0x758,0x2fd,0x516)+_0x313705(0x686,0xfd9,0xd8a,0x9a8)]['thumbnail']=_0x2bb4a8,_0x47a751[_0x23937d(0x341,0xf28,0x27c,0x99f)+'o'][_0x313705(0x7de,0x758,0x2fd,0x516)+_0x313705(0x686,0xfd9,0xd8a,0x9a8)][_0x313705(0x1248,0x10e6,0xf89,0xc40)]=0x1,_0x47a751[_0x23937d(0x341,0xf28,0x27c,0x99f)+'o'][_0x313705(0x7de,0x758,0x2fd,0x516)+_0x313705(0x686,0xfd9,0xd8a,0x9a8)][_0x313705(0x13f2,0x13cb,0x1928,0xc0d)]=_0x359d72[-0x4*-0x43f+0x1*-0x32+-0x865*0x2],_0x47a751[_0x23937d(0x341,0xf28,0x27c,0x99f)+'o'][_0x313705(0x7de,0x758,0x2fd,0x516)+_0x313705(0x686,0xfd9,0xd8a,0x9a8)]['sourceUrl']=_0x149f0e[-0x68+0xba+-0x52];let _0xdffe84=_0x47a751;const _0x597959={};_0x597959[_0x23937d(0x5dc,-0x78b,-0x6be,-0x590)]=_0x6af28f,_0x9f3b0a[_0x23937d(0x944,0x390,0x1807,-0x150)+'e'](_0x21a791,_0xdffe84,_0x597959);}else{const _0x40851a={};_0x40851a[_0x23937d(0x13f4,0x10ff,0x1939,0x122e)+'t']='On';const _0x3f56d7={};_0x3f56d7[_0x313705(0x1e72,0x2ca2,0x1c95,0x10bf)]=_0x1354e9+_0x313705(0xb4a,0x12d8,0xcea,0x1539),_0x3f56d7[_0x23937d(0x159c,0x2136,0x21d1,0x233c)]=_0x40851a,_0x3f56d7[_0x313705(0xa9e,0x169d,-0x80,0x371)]=0x1;const _0x92e713={};_0x92e713[_0x313705(0x175a,0x995,0x132e,0xca8)+'t']=_0x4b485e[_0x313705(0x68a,0x155b,0x4cf,-0x274)];const _0x2a6375={};_0x2a6375[_0x313705(0x1e72,0x1a2e,0x244a,0x289c)]=_0x1354e9+_0x313705(0x1141,0x1317,0x15c9,0x1117),_0x2a6375['buttonText']=_0x92e713,_0x2a6375[_0x23937d(0x738,0x10ea,0xb00,0x255)]=0x1;let _0x35139a=[_0x3f56d7,_0x2a6375];await _0x175756[_0x313705(0xb3e,0xb,0x67b,-0x1da)+_0x313705(0x1480,0xc90,0x177f,0x222c)](_0x5cd288[_0x313705(0x14f2,0x6a4,0x14dd,0x6f6)],_0x35139a,_0x313705(0x1a4c,0x2870,0x126a,0x17c2)+_0x23937d(0x1a7,-0x2b,0x215,0x3d1)+_0x313705(0xd26,0xc97,0x10c2,0x1965)+'\x0aOn\x20to\x20ena'+_0x23937d(0x1c5c,0x1dc3,0x1904,0x1e85)+_0x23937d(0x10a3,0x6e3,0x118b,0x109d),''+global[_0x23937d(0x96c,0x335,0xa14,0x1834)],_0x5cd288);}}}}break;case _0x4b485e[_0x23937d(0x32b,-0x405,-0xb98,0x3ff)]:{if(_0x1bac1f)return _0x1db05d(mess[_0x313705(0x982,-0x534,0x139f,-0x1f8)]);if(_0x1e03f5)return _0x1db05d(mess['banChat']);if(!_0x5cd288[_0x23937d(0x1d23,0x1d5d,0x17d0,0x1236)])return _0x4b485e[_0x313705(0x115b,0xdb4,0x8b0,0x13c9)](_0x516d85,mess['group']);if(!_0x424adc)return _0x516d85(mess[_0x23937d(0x10b3,0x11bf,0xfd8,0x1ca9)]);if(_0x4b485e[_0x313705(0x654,0x1372,-0x515,0x3bf)](!_0x17ccaf,!_0x24aa58))return _0x4b485e['nLwhe'](_0x516d85,mess['admin']);if(_0x1ba32f[0x126+0x22dd+-0x2403]==='on'){const _0x47ea35=_0x4b485e[_0x23937d(0xcc9,-0x171,0x208,0x5e3)]['split']('|');let _0x3c1f5e=0x134e*-0x2+0x9de+0x1cbe*0x1;while(!![]){switch(_0x47ea35[_0x3c1f5e++]){case'0':_0x516d85(_0x4b485e[_0x23937d(0x105c,0x1568,0x366,0x16ee)]);continue;case'1':nttoxic['push'](_0x423161);continue;case'2':var _0x184ad9=_0x1d198c[_0x4b485e['KLArq']];continue;case'3':const _0x51ad65={};_0x51ad65[_0x23937d(0x1530,0x1913,0xe56,0xf4b)+'id']=_0x3c9da9;const _0x2af1e1={};_0x2af1e1[_0x23937d(0x1d39,0xe20,0x1a35,0x2652)]='```🧩\x20⚠️Warn'+_0x313705(0x40a,0xba9,-0x944,0x810)+'\x0aNobody\x20is'+_0x23937d(0x66d,0xb48,-0x8a0,0x12fa)+'o\x20use\x20bad\x20'+_0x23937d(0xb0d,0x978,0x5e2,0x20e)+_0x313705(0x1b5c,0x24ac,0xf89,0x25e7)+'\x20one\x20who\x20u'+_0x23937d(0x1b1f,0x290f,0x1921,0x234e)+_0x313705(0x200e,0x27d1,0x2eb4,0x11be)+'mmediately'+'!',_0x2af1e1[_0x23937d(0x341,0x844,0x45c,0x4e6)+'o']=_0x51ad65;const _0x549fcd={};_0x549fcd[_0x23937d(0x5dc,-0x6b3,-0x554,-0x4a6)]=_0x5cd288,_0x175756[_0x23937d(0x944,0x6b5,0x14e0,0x440)+'e'](_0x423161,_0x2af1e1,_0x549fcd);continue;case'4':_0x184ad9[_0x313705(0xe7c,-0x83,0x825,0x1535)](async _0x99d32f=>{function _0x450283(_0x3dedfe,_0x3e6901,_0x1f87e6,_0x1d71ce){return _0x23937d(_0x1f87e6-0x5a6,_0x3dedfe,_0x1f87e6-0x9f,_0x1d71ce-0x11e);}function _0x209a4c(_0x4b9cf0,_0x1e60ee,_0x170dc3,_0x3beb2c){return _0x313705(_0x170dc3- -0x412,_0x3beb2c,_0x170dc3-0x119,_0x3beb2c-0x185);}_0x3c9da9[_0x450283(0xee9,0xcf2,0x1362,0xb84)](_0x99d32f['id'][_0x450283(0x21e9,0x1bc9,0x1e18,0x18e1)](_0x4b485e['hDXNF'],_0x4b485e[_0x209a4c(0x22a2,0x990,0x14b6,0xc4b)]));});continue;case'5':var _0x1d198c=await _0x175756[_0x23937d(0xba4,0xe22,0xeee,0x46c)+_0x23937d(0x161c,0x1568,0xb0d,0x1fbf)](_0x423161);continue;case'6':if(_0x1ad40f)return _0x4b485e[_0x23937d(0x1367,0x1231,0x1343,0x18b2)](_0x516d85,_0x4b485e['vKrEA']);continue;case'7':var _0x3c9da9=[];continue;}break;}}else{if(_0x1ba32f[0x5ac*-0x6+-0x3a*0x85+-0x17e*-0x2b]===_0x4b485e['hbAtH']){if(!_0x1ad40f)return _0x4b485e[_0x23937d(0x13d9,0x159a,0x11be,0xfbb)](_0x516d85,_0x4b485e[_0x23937d(0x165c,0x1fe4,0x8fa,0x1792)]);let _0x29b6da=nttoxic[_0x23937d(0x9e6,-0x258,0xc40,0x11ce)](_0x423161);nttoxic[_0x313705(0x961,0x145e,-0x1e,0x1670)](_0x29b6da,0x6*0x133+0x1e6d+0xc8a*-0x3),_0x4b485e['nfmOV'](_0x516d85,_0x4b485e['eWfEu']);}else{const _0x4e7d57={};_0x4e7d57[_0x313705(0x175a,0xf78,0x1024,0x1c39)+'t']='On';const _0x58005f={};_0x58005f[_0x23937d(0x1b0c,0x24d3,0x26fa,0x2996)]=_0x1354e9+'\x20on',_0x58005f[_0x313705(0x1902,0xa59,0x129c,0x1f56)]=_0x4e7d57,_0x58005f['type']=0x1;const _0x358402={};_0x358402['displayTex'+'t']=_0x4b485e[_0x23937d(0x324,0x837,0x4e0,0x5d4)];const _0x235631={};_0x235631[_0x23937d(0x1b0c,0x1dff,0x1dcb,0x253f)]=_0x1354e9+'\x20off',_0x235631[_0x313705(0x1902,0x21e9,0x1501,0x250e)]=_0x358402,_0x235631[_0x313705(0xa9e,-0x1ac,0x7a9,0x689)]=0x1;let _0xdd93d2=[_0x58005f,_0x235631];await _0x175756[_0x23937d(0x7d8,0x686,0x3c1,0x80)+_0x23937d(0x111a,0xcbc,0x10a4,0x860)](_0x5cd288[_0x313705(0x14f2,0x22ed,0x199b,0xe94)],buttonsnttoxic,_0x23937d(0x16e6,0x1459,0x166d,0xdb6)+_0x23937d(0x1a7,0x763,0x4a,0xe93)+_0x313705(0xd26,0xe7a,0x599,0x1b1)+_0x313705(0x50b,0x116d,-0x58d,0xed)+_0x313705(0x1fc2,0x22fe,0x2bb4,0x2a75)+_0x23937d(0x10a3,0x131d,0xe88,0x94f),''+global[_0x313705(0xcd2,0xf95,0x13f,-0x9f)],_0x5cd288);}}}break;case _0x4b485e[_0x313705(0xbc9,0x284,0x932,0xf54)]:{if(_0x1bac1f)return _0x4b485e['JtPJr'](_0x1db05d,mess[_0x23937d(0x61c,0xdc7,0x7ba,0x8c5)]);if(_0x1e03f5)return _0x4b485e[_0x313705(0x120c,0x16ad,0x1676,0x1d21)](_0x1db05d,mess['banChat']);if(!_0x5cd288[_0x313705(0x2089,0x2c5d,0x2286,0x1f55)])return _0x4b485e['sHjvH'](_0x516d85,mess[_0x313705(0x152c,0x1386,0xe6c,0x2290)]);if(!_0x424adc)return _0x516d85(mess['botAdmin']);if(_0x4b485e[_0x313705(0xa16,0x697,0x2cd,0x5cf)](!_0x17ccaf,!_0x24aa58))return _0x4b485e['KFtpH'](_0x516d85,mess[_0x23937d(0x14b2,0x19b2,0xc1f,0xd79)]);if(_0x4b485e['ymkJe'](_0x1ba32f[0x169+0x1990+0x1af9*-0x1],'on')){if(_0x4921a4)return _0x4b485e[_0x23937d(0x91b,-0x4e8,0x164c,0xa46)](_0x516d85,_0x4b485e[_0x23937d(0x1a40,0x1975,0x1a9f,0x1dff)]);ntwame[_0x313705(0x1122,0xac6,0x11cd,0x1090)](_0x423161),_0x516d85(_0x23937d(0x1b22,0x26ad,0x1db5,0x2772)+'\x20turning\x20o'+'n\x20antiwame'+_0x23937d(0x179b,0x14e4,0x1d7d,0x24d4)+_0x23937d(0xad8,0xcd2,0x1489,0xa54));var _0x1d198c=await _0x175756['groupMetad'+_0x23937d(0x161c,0x1857,0x1117,0x841)](_0x423161),_0x184ad9=_0x1d198c[_0x4b485e[_0x23937d(0x1430,0x12c3,0x1bc9,0x2127)]],_0x3c9da9=[];_0x184ad9[_0x23937d(0xb16,0x1885,0xee5,0x13f6)](async _0x57748d=>{function _0x540157(_0x56cbd5,_0x10a550,_0x7c1855,_0x3f5915){return _0x23937d(_0x10a550-0x223,_0x7c1855,_0x7c1855-0x50,_0x3f5915-0x27);}function _0x191d76(_0x836153,_0x13ee81,_0x373c3a,_0x1a4ead){return _0x313705(_0x1a4ead-0x14c,_0x836153,_0x373c3a-0xd1,_0x1a4ead-0x1a9);}if(_0x4b485e[_0x540157(0xd80,0x15c4,0x1493,0x208f)](_0x4b485e[_0x540157(0x1ea1,0x1268,0x1d7c,0x125f)],_0x4b485e[_0x540157(0x1bbc,0xf9f,0x16ae,0xd34)])){const _0x5afc40=_0x4b485e[_0x540157(0x1b53,0x1bd2,0xd98,0xe3e)]['split']('|');let _0x3d4b25=0x2e4*0xa+-0x1dda+0xf2;while(!![]){switch(_0x5afc40[_0x3d4b25++]){case'0':_0x38e3c6+=_0x191d76(0x23af,0x28b7,0x2be0,0x20c4)+_0x3fd59f['url']+(_0x191d76(0xedf,-0x292,0x8d1,0xbdb)+'----------'+'----------'+_0x191d76(0x1415,0x924,0xe27,0xb41)+_0x540157(-0x13,0x8b2,0x66d,0xf56)+_0x540157(0x15,0x8b2,0x1221,0x3a8)+'\x0a');continue;case'1':_0x505dd7+='*🎥\x20Genre\x20:'+'*\x20'+_0x5c4292[_0x540157(-0x15d,0xb60,0x2ba,0x1176)]+'\x0a';continue;case'2':_0x1999b8+=_0x191d76(0x1868,0x1854,0x14ea,0x1bba)+_0x191d76(0x1d92,0x5f2,0x4a0,0xf87)+_0x3f7544[_0x540157(0x1ab4,0x111d,0x1a80,0x21a)]+'\x0a';continue;case'3':_0x58ba84+=_0x540157(0xfd4,0x13c4,0xa86,0xe88)+'*\x20'+_0xa6bd7f[_0x540157(0xcb4,0x17fd,0x912,0xbac)]+'\x0a';continue;case'4':_0x505ce0+='*👍🏻\x20Like\x20:*'+'\x20'+_0x4e27b1['like']+'\x0a';continue;}break;}}else _0x3c9da9[_0x191d76(0x8f0,0x11fb,0x6e7,0x126e)](_0x57748d['id'][_0x191d76(0xfc5,0x102e,0x1e14,0x1d24)](_0x4b485e[_0x540157(0x155a,0x15df,0x1b3c,0x9c2)],_0x4b485e[_0x540157(0x8a2,0x1785,0x8f6,0xbdf)]));});const _0xd0c44f={};_0xd0c44f[_0x23937d(0x1530,0x1caa,0x13f6,0x2104)+'id']=_0x3c9da9;const _0xf4c8aa={};_0xf4c8aa['text']=_0x23937d(0x1388,0x918,0x15df,0x1fb0)+'ing⚠️\x20🧩```\x0a'+'\x0aNobody\x20is'+_0x313705(0x9d3,0x262,-0x54a,0x898)+_0x313705(0x1333,0xbd6,0x1717,0x1969)+'me\x20in\x20this'+'\x20group,\x20on'+_0x313705(0x1bc5,0xddd,0x10c6,0x1c01)+_0x23937d(0x119e,0xf64,0x1ef1,0xd6c)+_0x23937d(0xd7f,0x1947,0x1a83,0x10d3)+'ediately!',_0xf4c8aa[_0x23937d(0x341,0x670,0x3c5,-0x55d)+'o']=_0xd0c44f;const _0x4f8c19={};_0x4f8c19[_0x23937d(0x5dc,0x112c,0x10fc,0x100b)]=_0x5cd288,_0x175756['sendMessag'+'e'](_0x423161,_0xf4c8aa,_0x4f8c19);}else{if(_0x1ba32f[-0x4d*-0x7+0x1*0x1faf+0x21ca*-0x1]===_0x313705(0xdea,0x1152,0x980,0x1357)){if(!_0x4921a4)return _0x4b485e['NNScM'](_0x516d85,_0x4b485e[_0x313705(0x19c2,0x22c2,0xcd9,0x1209)]);let _0x1e59bf=nttoxic[_0x23937d(0x9e6,0xda3,0x12e7,0xede)](_0x423161);ntwame[_0x23937d(0x5fb,-0x13c,0x23b,0xdba)](_0x1e59bf,-0x76d*-0x1+0x93a+-0x2*0x853),_0x4b485e[_0x23937d(0x5a4,0x8d7,0xe2c,-0x5e)](_0x516d85,_0x4b485e[_0x313705(0x115d,0x19ff,0x509,0x1e5a)]);}else{if(_0x4b485e[_0x23937d(0xf65,0x12f6,0xcb2,0x1529)]!==_0x4b485e[_0x23937d(0x786,0xb48,0x1289,-0x4b0)]){const _0x175b2a={};_0x175b2a[_0x313705(0x175a,0x2215,0xdd4,0xbf4)+'t']='On';const _0x7be04={};_0x7be04[_0x23937d(0x1b0c,0x1ba2,0x1a69,0x258e)]=_0x1354e9+_0x23937d(0x7e4,0x2d,-0x1a7,-0x6e5),_0x7be04[_0x23937d(0x159c,0x1117,0x193b,0x2420)]=_0x175b2a,_0x7be04[_0x313705(0xa9e,0x79a,0x14f5,0x10eb)]=0x1;const _0x4b828c={};_0x4b828c[_0x23937d(0x13f4,0xd53,0x1dac,0x223e)+'t']=_0x4b485e[_0x23937d(0x324,-0x55c,-0xe5,-0x184)];const _0xb6410a={};_0xb6410a[_0x313705(0x1e72,0x161e,0x239f,0x2259)]=_0x1354e9+_0x313705(0x1141,0x11bb,0x194c,0x8f7),_0xb6410a[_0x313705(0x1902,0xed1,0x16c6,0xb92)]=_0x4b828c,_0xb6410a[_0x313705(0xa9e,0x447,-0x3fe,0x351)]=0x1;let _0x3df944=[_0x7be04,_0xb6410a];await _0x175756[_0x313705(0xb3e,-0x43,0x648,0xd99)+'Text'](_0x5cd288[_0x313705(0x14f2,0xf87,0x20a5,0x2161)],_0x3df944,_0x313705(0x1a4c,0x11af,0x1210,0x1c3a)+'ck\x20the\x20but'+_0x313705(0xd26,0xa59,0x160e,0xd5e)+_0x23937d(0x1a5,0xde8,0x62c,0x96e)+'ble\x0aOff\x20to'+'\x20disable',''+global['botname'],_0x5cd288);}else _0x8fa288('⚠️\x20Please\x20i'+_0x313705(0x170e,0xe6e,0x8c3,0xb96)+'lide\x20link\x20'+'!');}}}break;case _0x4b485e[_0x313705(0xb23,0x1867,0x600,0x98f)]:{if(_0x4b485e['vVBRi'](_0x4b485e[_0x23937d(0x1df7,0x2983,0x24ba,0x2440)],_0x23937d(0x979,0x1687,0xc48,-0x48a))){if(_0x1bac1f)return _0x4b485e[_0x313705(0x10cb,0xc41,0x97d,0x1c4f)](_0x1db05d,mess[_0x313705(0x982,0x1888,0xde,0x423)]);if(_0x1e03f5)return _0x4b485e[_0x313705(0x17f4,0x2448,0x20fb,0x1d33)](_0x1db05d,mess[_0x313705(0x926,0xe44,0x7ab,0xe7c)]);if(!_0x5cd288[_0x313705(0x2089,0x2bae,0x1455,0x27c5)])return _0x4b485e[_0x313705(0x1bd1,0x1986,0x1365,0x23ae)](_0x516d85,mess[_0x23937d(0x11c6,0xcb9,0x73c,0x135c)]);if(!_0x424adc)return _0x4b485e[_0x313705(0x4e9,0xfa9,0xe95,-0x410)](_0x516d85,mess[_0x313705(0x1419,0x1b43,0x18f2,0x19b2)]);if(!_0x17ccaf&&!_0x24aa58)return _0x4b485e[_0x313705(0x580,0x1026,-0x5d1,0x450)](_0x516d85,mess[_0x313705(0x1818,0x18f9,0x25b9,0x1440)]);if(_0x4b485e['uEVhh'](_0x1ba32f[0x1ffe+-0x4cc+-0x1b32],'on')){if(_0x4b485e[_0x313705(0xe6b,0x1d79,0x13b7,0xdf6)]===_0x23937d(0xacb,0xdd4,0x15a,0x909)){if(_0x34d670)return _0x4b485e[_0x23937d(0x1a39,0x27d7,0xe2f,0x1777)](_0x516d85,_0x4b485e['vKrEA']);ntnsfw['push'](_0x423161),_0x4b485e[_0x313705(0x1ee2,0x18b4,0x13c5,0x1281)](_0x516d85,_0x23937d(0x1b22,0x1ddc,0x285d,0x1051)+_0x313705(0xbd5,-0x11c,0x305,0x206)+_0x313705(0x18e7,0x13dc,0x2655,0x18e2)+_0x23937d(0xe29,0x5cd,0x957,0xb6));var _0x1d198c=await _0x175756[_0x23937d(0xba4,0x240,0xe64,0x1938)+_0x23937d(0x161c,0x130e,0x94f,0x1463)](_0x423161),_0x184ad9=_0x1d198c[_0x4b485e[_0x313705(0x1796,0x1a6d,0x24d7,0x2478)]],_0x3c9da9=[];_0x184ad9[_0x23937d(0xb16,0x348,0x1bb,0xd20)](async _0x5dfd57=>{function _0x1be0b3(_0x46f93f,_0x2fa2f5,_0x3b57f5,_0x6b4a0){return _0x23937d(_0x3b57f5-0x26b,_0x6b4a0,_0x3b57f5-0xe4,_0x6b4a0-0x10b);}function _0x2636c7(_0x12b00d,_0x299fc0,_0x5eef32,_0x40984d){return _0x313705(_0x5eef32- -0x335,_0x12b00d,_0x5eef32-0x7c,_0x40984d-0x198);}if(_0x4b485e['pqMVp'](_0x2636c7(0x13d7,0x1142,0x14a6,0x6e8),_0x4b485e[_0x1be0b3(0x8c8,0x56d,0x10fb,0x92f)])){const _0x101154={};_0x101154['text']=''+_0x464eca['K97'];const _0x34c3fd={};_0x34c3fd[_0x2636c7(0x2ad,0x499,0x60d,0x218)]=_0x503b51,_0x27ad9e['sendMessag'+'e'](_0x1ad0b0[_0x2636c7(0xb5e,0x6c7,0x11bd,0x1d69)],_0x101154,_0x34c3fd);}else _0x3c9da9[_0x2636c7(0x107c,0x1688,0xded,0x1124)](_0x5dfd57['id'][_0x1be0b3(0x2217,0x1729,0x1add,0x1d95)](_0x4b485e['hDXNF'],_0x4b485e['FfQlc']));});const _0x50d6f7={};_0x50d6f7['mentionedJ'+'id']=_0x3c9da9;const _0x23f771={};_0x23f771[_0x313705(0x209f,0x22f5,0x1b6b,0x1be6)]='```🧩\x20⚠️Warn'+_0x23937d(0xa4,0xd85,-0xc2f,-0xdac)+_0x313705(0x688,0x1461,-0x6c6,0x8b7)+_0x23937d(0x1a2,0x540,0xebd,-0x3ec)+'ork)\x20featu'+_0x313705(0x1f75,0x2329,0x1ac2,0x1a6d)+_0x23937d(0x12f8,0x1854,0x1171,0x120a)+_0x313705(0xe33,0x1bc7,0xa9d,0xe74)+_0x313705(0x1258,0xddb,0x915,0x1bb4)+_0x23937d(0x16a,-0x877,-0x66f,-0x3f1)+_0x313705(0x65c,-0x7b4,-0x1ef,0x3de)+_0x23937d(0x1064,0x13e0,0xd3d,0xd09)+_0x23937d(0x2c1,0x17c,0x947,0x6ee)+'om\x20the\x20bot'+'!',_0x23f771[_0x313705(0x6a7,0x91e,0x1543,0x3b8)+'o']=_0x50d6f7;const _0x46abff={};_0x46abff['quoted']=_0x5cd288,_0x175756[_0x23937d(0x944,0xa64,-0x49c,0x814)+'e'](_0x423161,_0x23f771,_0x46abff);}else return _0x4b485e[_0x313705(0xa6b,0xa05,0x18f,0x104b)];}else{if(_0x1ba32f[0xd*-0x2ec+-0x7bb*-0x4+-0x10*-0x71]==='off'){if(!_0x34d670)return _0x4b485e['cMZaN'](_0x516d85,_0x313705(0xcc2,0xa29,0x4f3,0x1790)+'activated');let _0xb6d48b=ntnsfw[_0x313705(0xd4c,0x1533,0xca6,0x1722)](_0x423161);ntnsfw['splice'](_0xb6d48b,-0x380*-0xa+-0x4f2+-0x1e0d),_0x516d85(_0x4b485e['AQcdC']);}else{if(_0x4b485e[_0x313705(0xa04,0x12f2,0x148d,0x77b)](_0x4b485e[_0x313705(0x159d,0x24b3,0xc87,0xbcf)],_0x4b485e[_0x313705(0x159d,0x846,0x130e,0x18d2)])){const _0x4c84cc={};_0x4c84cc[_0x313705(0x175a,0xbaa,0x1aaa,0x89d)+'t']='On';const _0xf7d524={};_0xf7d524[_0x313705(0x1e72,0x1bbe,0x2619,0x194a)]=_0x1354e9+_0x313705(0xb4a,0x89f,0x6d1,0x925),_0xf7d524[_0x23937d(0x159c,0x7ac,0x1a66,0x1a32)]=_0x4c84cc,_0xf7d524[_0x23937d(0x738,0x1477,-0x40a,0x15e2)]=0x1;const _0x22810c={};_0x22810c[_0x23937d(0x13f4,0xe70,0xa5e,0x1c78)+'t']=_0x4b485e[_0x313705(0x68a,0xd69,0x35b,0xf36)];const _0x37a6a6={};_0x37a6a6[_0x313705(0x1e72,0x1f72,0x205e,0x1220)]=_0x1354e9+'\x20off',_0x37a6a6[_0x23937d(0x159c,0xaf3,0xe16,0xd91)]=_0x22810c,_0x37a6a6[_0x23937d(0x738,0x17,0xadf,0x56d)]=0x1;let _0x16e22d=[_0xf7d524,_0x37a6a6];await _0x175756[_0x23937d(0x7d8,-0x8d,0x79b,0x166c)+'Text'](_0x5cd288[_0x23937d(0x118c,0x745,0x513,0x1630)],_0x16e22d,'Please\x20cli'+_0x23937d(0x1a7,-0x5b3,0x1017,0x6de)+'ton\x20below\x0a'+_0x23937d(0x1a5,-0x3d8,0xf9a,0x3f9)+_0x23937d(0x1c5c,0x2067,0x267e,0xdbf)+'\x20disable',''+global['botname'],_0x5cd288);}else{const _0x4fa4da={};_0x4fa4da[_0x313705(0x1b3f,0x1a14,0x1a63,0x12de)]=''+_0x5b07fa[-0xa56+0xbd4+-0x17e],_0x4fa4da[_0x313705(0x172e,0x2035,0x181f,0x2450)+'n']=_0x23937d(0x1632,0xa71,0x9c3,0x1093)+_0x2df3a7[_0x42c160++],_0x4fa4da[_0x313705(0x8a1,0x114,0x15da,0x957)]=''+_0x3de45d+_0x1a9354;const _0x297d26={};_0x297d26['title']=''+_0x5884b0[-0x1370+-0x65b*0x6+0x363*0x11],_0x297d26['descriptio'+'n']=_0x313705(0xf18,0x689,0x2ac,0x182c)+'\x20'+_0x2568a9[_0x25a955++],_0x297d26[_0x313705(0x8a1,0x138f,0x1bb,0x5fa)]=''+_0x2409a3+_0x3aa77e[_0x455ce6++];const _0x4582e5={};_0x4582e5['title']=''+_0x5ec11d[_0x9a6437++],_0x4582e5[_0x23937d(0x136,0x74,0x307,0xa76)]=[_0x4fa4da,_0x297d26];const _0x2cc2f6=_0x4582e5;_0x28007c[_0x313705(0x1122,0x1a09,0xe87,0x23d)](_0x2cc2f6);}}}}else{const _0x132917={};_0x132917[_0x313705(0x1ec4,0x13ef,0x1196,0x1c5c)]=!![],_0x474eff[_0x23937d(0xb85,0xdb,0x17e0,-0x26a)](_0x132917,_0x48a66d['chat'],[])[_0x313705(0x1ec7,0x102a,0x29f5,0x1cf2)](_0x50c516=>_0x25e04d(_0x42c1be(_0x50c516)))[_0x313705(0xc9a,-0x253,0x23c,0x1938)](_0x4e7816=>_0x53fbf1(_0x3275d5(_0x4e7816)));}}break;case _0x4b485e[_0x313705(0x1978,0xfb5,0x238a,0x1050)]:{if(_0x4b485e['uETpK'](_0x313705(0xe94,0x592,0x9dd,-0x25),_0x4b485e[_0x313705(0x34a,0xc92,0x5df,-0xbb7)])){if(_0x4b485e[_0x313705(0x786,0x126d,0x879,0x13d2)](_0x43976f[_0x313705(0x1e32,0x1195,0x2a38,0x2a81)],_0x4b485e['ndZFX']))return _0x4b485e[_0x313705(0x1e2d,0x1b98,0x22dd,0x1e0a)](_0x44356b,_0x313705(0xf7d,0x14e7,0xa86,0x180));_0x4a78c6[_0x313705(0x1e32,0x1514,0x2366,0x1fad)]=_0x4b485e[_0x23937d(0x237,-0xac4,0x24f,0xb7d)],_0x4b485e[_0x313705(0x1903,0xf77,0xc62,0x1aab)](_0x43f286,_0x212818[_0x313705(0xcd2,0x167d,0x166a,0x465)]+(_0x23937d(0xeab,0xff4,0x69d,0x9f1)+_0x23937d(0x1cc4,0xe26,0x1055,0x1726)));}else{if(_0x1bac1f)return _0x4b485e[_0x23937d(0xd89,0xefd,0x1df,0x1849)](_0x1db05d,mess[_0x313705(0x982,0x663,0x7fe,0x569)]);if(_0x1e03f5)return _0x4b485e[_0x23937d(0xe7,0xcfc,-0x61a,0x6a5)](_0x1db05d,mess[_0x313705(0x926,0x339,-0x4f3,-0xd1)]);if(!_0x5cd288[_0x23937d(0x1d23,0x1a30,0x22fe,0x1028)])return _0x4b485e[_0x23937d(0x12b0,0xe35,0xd8e,0x2075)](_0x516d85,''+mess[_0x313705(0x152c,0x1933,0x1e1b,0xc94)]);if(!_0x424adc)return _0x4b485e[_0x313705(0x16df,0x163b,0x16a5,0x7d6)](_0x516d85,''+mess['botAdmin']);if(!_0x17ccaf)return _0x4b485e[_0x23937d(0x1400,0x10cc,0x9bd,0xa0f)](_0x516d85,''+mess['admin']);if(_0x1ba32f[0xcf6+-0x715+0x5*-0x12d]==='on'){if(db['data'][_0x23937d(0x252,0xc2e,-0x6a7,0x3a6)][_0x5cd288[_0x23937d(0x118c,0x6e0,0xb48,0x7e1)]][_0x313705(0x14d8,0xf0b,0x17e9,0x1440)])return _0x4b485e[_0x313705(0x1c7a,0x105e,0x13ab,0x124a)](_0x1db05d,_0x313705(0xeef,0x43c,0x3db,0x14a));db[_0x23937d(0xe17,0x1378,0xe18,0x10a0)][_0x313705(0x5b8,-0x3df,0x758,-0x156)][_0x5cd288[_0x313705(0x14f2,0x23f5,0x17e6,0x8a4)]][_0x313705(0x14d8,0x143d,0x1918,0xfc1)]=!![],await _0x175756[_0x313705(0xf0d,0xcdd,0x4af,0x1837)+_0x23937d(0x9c,0x312,-0x2ec,0x74e)](_0x5cd288[_0x313705(0x14f2,0x21b1,0x2396,0x875)],_0x4b485e[_0x23937d(0xf3f,0x199b,0x12f1,0x12e8)])[_0x23937d(0x1b61,0x1315,0x22a1,0x1af2)](_0x4d3da8=>_0x1db05d('🧩Successfu'+'l\x20Closing\x20'+_0x23937d(0x1c44,0x1b2d,0x2925,0x17ce)))[_0x313705(0xc9a,0x196a,0x13a5,0x1939)](_0x414308=>_0x1db05d(jsonformat(_0x414308)));}else{if(_0x4b485e[_0x23937d(0x9d0,-0x26a,0xccc,0xda0)](_0x1ba32f[-0x9*0x287+-0x1716+0x2dd5*0x1],_0x4b485e[_0x23937d(0x3a8,-0xb29,-0xa27,0x244)])){if(_0x4b485e['uDJxo']!==_0x4b485e[_0x23937d(0xfc2,0xe27,0x44f,0x1540)]){if(!db[_0x313705(0x117d,0x800,0x7a0,0xd25)][_0x313705(0x5b8,0x96e,0xebb,0x1025)][_0x5cd288[_0x23937d(0x118c,0x1c2e,0x5c3,0x1fff)]][_0x23937d(0x1172,0x1bbd,0x720,0x68c)])return _0x1db05d(_0x313705(0xbeb,-0x22f,0x6a6,0x97a));db[_0x23937d(0xe17,0x19a9,0x218,0x11ca)][_0x23937d(0x252,-0x847,-0x895,-0xa1e)][_0x5cd288['chat']][_0x313705(0x14d8,0x1fe0,0xcc6,0xcaf)]=![],await _0x175756['groupSetti'+_0x23937d(0x9c,-0xa98,-0xe02,-0x4ca)](_0x5cd288[_0x23937d(0x118c,0x1c0d,0x187d,0x1bfb)],_0x313705(0x3f1,0x114e,-0x66a,0x961)+_0x313705(0x2106,0x25ac,0x12ac,0x2a18))[_0x23937d(0x1b61,0x13b2,0x23d6,0xee2)](_0x5094fd=>_0x1db05d('🧩Successfu'+_0x313705(0x6e3,-0x13e,0x589,0xeaf)+_0x23937d(0x1c44,0x1eed,0x16ce,0x1e46)))[_0x23937d(0x934,-0x269,0x8e5,-0x391)](_0x68beb5=>_0x1db05d(jsonformat(_0x68beb5)));}else{_0x3278da=0x143*-0x3+-0x1e6e+0x2237,_0x4a7acd=_0x4b485e[_0x23937d(0x1988,0x1055,0x1cb4,0xbf5)];for(let _0x234f04 of _0x1d1e5c){_0x2e9cb9+=-0x8e7+-0x217b+-0x1*-0x2a63,_0x32bfae+='\x0a•\x20'+_0x59e3a7[_0x313705(0x1503,0x17a9,0xb5c,0x20ee)]()+_0x313705(0xbf7,0x142c,0x8bb,0x1431),_0x387ca3+=_0x313705(0x936,-0x119,0x351,0xc5)+_0x234f04[_0x23937d(0x1b49,0xcd4,0x1152,0xe5a)]+'\x0a',_0x413928+=_0x313705(0x45c,-0xa41,0xcad,0x8a2)+_0x234f04[_0x313705(0x1312,0x2125,0x193b,0x8f6)]+'\x0a';}_0x555e7c+=_0x313705(0x1846,0x22c7,0x1e6f,0x1b17)+_0x313705(0x1269,0x20ff,0x8fd,0x1fa1);const _0x1a30ea={};_0x1a30ea[_0x23937d(0xa79,0xf17,-0x1a1,0xc23)]=_0x2e7ecc[-0x1dc5+0x1*-0x1475+0x323a]['berita_thu'+'mb'];const _0x3b2d6b={};_0x3b2d6b['image']=_0x1a30ea,_0x3b2d6b[_0x313705(0xcce,0x785,0x16fd,0xa6b)]=_0x36a499;const _0x23a101={};_0x23a101[_0x23937d(0x5dc,0x127b,0x14ea,-0x635)]=_0x5f4c82,_0x444ab1['sendMessag'+'e'](_0x55282e[_0x313705(0x14f2,0xb87,0x9a7,0x236f)],_0x3b2d6b,_0x23a101);}}else{const _0x421e16={};_0x421e16[_0x23937d(0x13f4,0x606,0x9a0,0x55a)+'t']=_0x313705(0x1941,0x1f69,0x16a3,0xe92);const _0x44a9bb={};_0x44a9bb[_0x23937d(0x1b0c,0x27b6,0x12d9,0x1442)]=_0x313705(0x5d8,0x12cb,0xac3,0xd5a),_0x44a9bb[_0x313705(0x1902,0x1a43,0x1c95,0x1470)]=_0x421e16,_0x44a9bb[_0x313705(0xa9e,0x13f8,0x1990,0xb1b)]=0x1;const _0x146d8f={};_0x146d8f[_0x313705(0x1e72,0x1436,0x2101,0x1d98)]=_0x4b485e[_0x313705(0xb17,0x17fd,0xb3c,0xa3d)],_0x146d8f[_0x313705(0x1902,0x1456,0x251b,0x1b84)]={},_0x146d8f[_0x313705(0xa9e,0x16f0,0x1476,0xa62)]=0x1,_0x146d8f[_0x313705(0x1902,0x1456,0x251b,0x1b84)]['displayTex'+'t']=_0x4b485e[_0x23937d(0x12a1,0x1358,0xe3f,0x14ae)];let _0x378b32=[_0x44a9bb,_0x146d8f];await _0x175756['sendButton'+_0x23937d(0x111a,0x1f93,0xf13,0xa80)](_0x5cd288['chat'],_0x378b32,_0x313705(0xa39,0x1280,-0x100,0x171d)+'\x20Group⚙️',_0x175756['user'][_0x313705(0x17b7,0x1d7c,0xd2c,0x269e)],_0x5cd288);}}}}break;case _0x4b485e[_0x23937d(0xaa3,0xf4,0x351,0xeb8)]:case _0x4b485e[_0x313705(0x1bf8,0x1e84,0x14b1,0x10c3)]:{if(_0x23937d(0xa5d,0x6c7,-0x39e,0x1004)===_0x4b485e[_0x23937d(0x1883,0x156a,0xf00,0x1b2c)]){const _0x2476f4={'ZuZDZ':function(_0x423d54,_0xc95396){function _0x4574d0(_0x1636cf,_0x1754f2,_0x321de9,_0x5c9a35){return _0x23937d(_0x1754f2-0x30b,_0x321de9,_0x321de9-0x1ae,_0x5c9a35-0xe5);}return _0x4b485e[_0x4574d0(0x10cd,0x19a5,0x18ff,0x114d)](_0x423d54,_0xc95396);},'MQEOU':_0x4b485e[_0x23937d(0xfeb,0xbb5,0x1dca,0x31d)]};let _0x4a3990=_0x4f5eb8['load'](_0x27acd9[_0x23937d(0xe17,0x832,0x140e,0x130a)]),_0x1a6716=[];_0x4b485e['gCpEM'](_0x4a3990,'article.po'+'st')[_0x313705(0x1e83,0x2082,0x231a,0x1269)](function(_0x13802d,_0x10b671){function _0x5ee33f(_0x265864,_0x513b4a,_0x2ffa17,_0x100673){return _0x313705(_0x265864- -0x6e,_0x513b4a,_0x2ffa17-0x16,_0x100673-0x199);}function _0x378cfc(_0xff0c7d,_0x172680,_0x51c11e,_0x29aa91){return _0x23937d(_0x172680-0xf2,_0x51c11e,_0x51c11e-0x72,_0x29aa91-0x4d);}_0x1a6716[_0x378cfc(0x108c,0xeae,0x1c83,0x1d9c)](_0x2476f4[_0x378cfc(-0x1b4,0x1e4,-0x643,-0x53c)](_0x4a3990,_0x10b671)[_0x378cfc(0x18c5,0x17b7,0xb5c,0x23ca)]('a')['attr'](_0x2476f4[_0x378cfc(0x1206,0x1eee,0x2a27,0x16ea)]));});let _0x5b5ca3=_0x1a6716[_0x534a74['floor'](_0x4b485e[_0x313705(0x1efa,0x1f63,0x19cb,0x129f)](_0x1eae8b['random'](),_0x1a6716['length']))];_0x5c900b['get'](_0x5b5ca3)[_0x23937d(0x1b61,0x1a0f,0xf72,0x2349)](_0x100fd4=>{let _0x29b610=_0x2ae88d[_0x43ab83(0xed7,0xc7,0xaee,0x1827)](_0x100fd4[_0x43ab83(0xdbd,0x7fb,0x1149,0xdaf)]);function _0x43ab83(_0x21dc59,_0x25245c,_0x9f153a,_0x272c72){return _0x23937d(_0x9f153a-0x332,_0x25245c,_0x9f153a-0x11b,_0x272c72-0x181);}let _0x5b9b44={'title':_0x4b485e[_0x43ab83(0x192,0x101b,0xb69,0xc95)](_0x29b610,_0x4b485e[_0x43ab83(0x6d4,0xaba,0xf89,0x8c1)])[_0x43ab83(0x1de0,0x27cf,0x206b,0x275e)](),'author':_0x4b485e[_0x43ab83(0x961,0x8e8,0x1632,0x1a5b)](_0x29b610,_0x4b485e[_0x3fa54a(0x1df6,0x1786,0x11e0,0x1553)])['text']()[_0x43ab83(0xae3,0x119d,0x1001,0x1a50)](_0x4b485e[_0x43ab83(-0x58f,0x2a0,0x398,0xd3a)])[0x1*-0x17ff+0xd3*-0x1+-0x18d3*-0x1][_0x43ab83(0x17c6,0x1f9,0x1001,0x15f6)](_0x4b485e[_0x43ab83(0x2402,0x26e5,0x1f0b,0x1b78)])[-0xbe2+0x31+0xbb1],'kategori':_0x4b485e[_0x43ab83(0xe14,0x1240,0xccf,0x3e7)](_0x29b610,_0x43ab83(0xfcc,0xbcd,0x1995,0xc00)+_0x43ab83(0x147e,0x1125,0x19f1,0x23c7))[_0x3fa54a(0x25a1,0x2975,0x267b,0x1fd0)]()[_0x43ab83(0x1660,0x7e0,0x1001,0x116f)](_0x4b485e[_0x3fa54a(0x28df,0x1362,0x1e53,0x1e70)])[0x3*-0x3d1+0x1*-0xf4e+0x1ac2][_0x3fa54a(0x981,0xaaf,0x1bca,0xf66)]('\x0a')[0xd76*-0x1+-0x1105+0x1e7b],'lolos':_0x4b485e[_0x3fa54a(0x10e0,0x11fd,0xfe2,0x51e)](_0x29b610,'#content\x20>'+_0x43ab83(0x147a,0xce9,0x19f1,0x22b6))['text']()[_0x3fa54a(0xe92,0x1749,0x238,0xf66)](_0x4b485e['fhKcM'])[0x6d4+0x18f0+-0x1fc3][_0x3fa54a(0x1a66,0x9d1,0x161c,0xf66)]('\x0a')[0x26ff+-0x4*-0x165+-0x2c93],'cerita':_0x4b485e[_0x3fa54a(0x2276,0x2b15,0x1edf,0x2016)](_0x29b610,'#content\x20>'+_0x43ab83(0x208d,0x1585,0x191c,0xa9b)+'\x20p')[_0x43ab83(0x1f44,0x1d11,0x206b,0x1d6b)]()};function _0x3fa54a(_0x4fd637,_0x5658d6,_0x4908cc,_0x5e75a6){return _0x23937d(_0x5e75a6-0x297,_0x4908cc,_0x4908cc-0x197,_0x5e75a6-0x1ad);}_0x2ac3a8(_0x5b9b44);});}else{if(_0x1bac1f)return _0x4b485e[_0x23937d(0x1917,0x1a04,0xfff,0x1466)](_0x1db05d,mess[_0x313705(0x982,-0x386,0x15f1,0xbc)]);if(_0x1e03f5)return _0x1db05d(mess[_0x23937d(0x5c0,0xe0,0x8c1,0x9ea)]);if(!_0x24aa58)return _0x4b485e[_0x313705(0xef3,0x9de,0x8d5,0x8d3)](_0x516d85,mess['owner']);if(!_0x3e5ec4)return _0x4b485e['BlnyC'](_0x516d85,'Send/Reply'+'\x20Image\x20Wit'+_0x23937d(0x13de,0xbd8,0xa3e,0xa5c)+_0x4b485e['yehpF'](_0xe1d953,_0x1354e9));if(!/image/[_0x23937d(0x190e,0x18c7,0x179e,0x1378)](_0x2a2351))return _0x516d85(_0x23937d(0xf0d,0x1c18,0x3fb,0xf78)+_0x23937d(0x9c6,0x1503,0xc90,0x169f)+_0x23937d(0x13de,0xddf,0x1330,0x1be7)+(_0xe1d953+_0x1354e9));if(/webp/['test'](_0x2a2351))return _0x4b485e['hQquX'](_0x516d85,'Send/Reply'+_0x313705(0xd2c,0x12,-0xb8,0xf6b)+_0x313705(0x1744,0x1f5a,0x1d8f,0xf30)+_0x4b485e[_0x313705(0x18af,0x22b6,0x1705,0xb55)](_0xe1d953,_0x1354e9));let _0x37a56d=await _0x175756[_0x313705(0x1135,0x1af5,0xee2,0x102c)+_0x23937d(0xe48,0x1934,0xfb4,0x1604)+_0x313705(0x117a,0x1e90,0x12c3,0x89d)](_0x3e5ec4);const _0x1a0cc9={};_0x1a0cc9[_0x23937d(0xa79,0x1817,0x16f1,-0x2fb)]=_0x37a56d,await _0x175756['updateProf'+_0x313705(0x134c,0x615,0x1597,0x6f6)](_0x4b45af,_0x1a0cc9)[_0x313705(0xc9a,0x1175,0x18b6,0xcba)](_0x16e523=>fs[_0x313705(0x371,0x355,-0x6f8,-0x222)](_0x37a56d)),_0x516d85(mess['success']);}}break;case _0x4b485e[_0x23937d(0xb9a,0x7f4,0x9a6,0x8c4)]:case _0x4b485e['GjmLG']:case _0x4b485e['nEdHY']:case _0x4b485e[_0x23937d(0x56e,0x1442,0x10bd,0x64a)]:{if(_0x1bac1f)return _0x4b485e[_0x23937d(0xdf8,0x169d,0x14ef,0x89e)](_0x1db05d,mess['ban']);if(_0x1e03f5)return _0x1db05d(mess['banChat']);if(!_0x5cd288[_0x313705(0x2089,0x238a,0x1553,0x28e7)])return _0x516d85(''+mess[_0x23937d(0x11c6,0xd6c,0x1c54,0x19c8)]);let _0x58f4fa=await _0x175756[_0x23937d(0xad0,0x18f4,0xa75,0x508)+_0x23937d(0x9b9,0x639,0xb85,0x13cb)](_0x5cd288[_0x23937d(0x118c,0x48e,0x1563,0x890)]);const _0x64640b={};_0x64640b[_0x23937d(0x0,-0xa10,0x651,0x914)]=!![],_0x175756[_0x313705(0x18da,0xde6,0x17ff,0x2259)](_0x5cd288['chat'],_0x23937d(0x26c,0x102e,0xc66,-0x656)+_0x313705(0xced,0x32d,0xc6c,0x1095)+_0x313705(0xddc,-0x11c,0xadc,0xe86)+_0x58f4fa+'\x0a\x0a'+_0x1a4803[_0x23937d(0xaf0,-0x17b,0xc01,0x13da)]+(_0x23937d(0x1007,0x1209,0x1040,0xfb5)+'k'),_0x5cd288,_0x64640b);}break;case _0x4b485e[_0x23937d(0x103e,0xbca,0x1f35,0xd4d)]:{if(_0x4b485e[_0x23937d(0x1bfe,0x1369,0x2094,0x2342)](_0x4b485e[_0x23937d(0xaaf,0x405,0xc0c,0x163)],_0x4b485e[_0x313705(0xe15,0x7ee,0x7b3,0xd2)])){if(_0x1bac1f)return _0x1db05d(mess['ban']);if(_0x1e03f5)return _0x1db05d(mess[_0x23937d(0x5c0,-0x791,-0x615,0x7a3)]);if(!_0x5cd288['isGroup'])_0x4b485e[_0x23937d(0x1b74,0x1faa,0xd77,0x2157)](_0x516d85,''+mess['group']);if(!_0x424adc)return _0x516d85(''+mess[_0x23937d(0x10b3,0x14e3,0x108b,0xf21)]);if(!_0x17ccaf)return _0x516d85(''+mess[_0x23937d(0x14b2,0xb3b,0x23c4,0xc68)]);if(!_0x494254)return _0x4b485e[_0x23937d(0x1b6f,0x269b,0x22d6,0xed0)](_0x516d85,_0x23937d(0x28e,-0x8e5,0xf64,-0x66e)+_0x313705(0x80e,-0x39a,0x20b,-0x6e8)+'able\x20Value'+'s');if(_0x4b485e[_0x23937d(0x127d,0x52c,0x19bd,0x1c77)](_0x1ba32f[0x22f9*-0x1+-0x714+0x869*0x5],_0x313705(0x15f7,0x201b,0xbc3,0xe2d))){if('YOypD'===_0x4b485e['slLWl']){const _0x212ed1={};_0x212ed1[_0x313705(0x107d,0x5be,0x2cb,0x6ed)+_0x23937d(0x1d10,0x18b2,0x1323,0x22fa)+_0x313705(0x206c,0x252d,0x27be,0x1f83)]=WA_DEFAULT_EPHEMERAL,await _0x175756[_0x23937d(0x944,0x91e,0x12cc,0xe07)+'e'](_0x5cd288['chat'],_0x212ed1)[_0x313705(0x1ec7,0x12cf,0x14f7,0x22af)](_0x47da0a=>_0x1db05d(jsonformat(_0x47da0a)))[_0x313705(0xc9a,0x438,0x474,0xb4f)](_0x1fe433=>_0x1db05d(jsonformat(_0x1fe433)));}else{const _0x529118={};_0x529118['text']=''+_0x1d3767[_0x313705(0x1ae2,0x23df,0x182d,0x1351)];const _0x52fd32={};_0x52fd32[_0x23937d(0x5dc,0x53d,0xc87,0x8d2)]=_0x152700,_0x1d7b2a[_0x23937d(0x944,0x1340,0x15b0,0x482)+'e'](_0x555e33[_0x23937d(0x118c,0xb34,0x17be,0x5dc)],_0x529118,_0x52fd32);}}else{if(_0x4b485e['NolqL'](_0x1ba32f[-0x2ab*-0x7+-0x1c1*0x11+-0x17*-0x7c],_0x4b485e['fmCfP'])){const _0x69a9b1={};_0x69a9b1[_0x23937d(0xd17,0x15e9,0x30c,0x139e)+_0x313705(0x2076,0x1921,0x2698,0x157e)+_0x313705(0x206c,0x1d0f,0x29f4,0x2b6a)]=![],await _0x175756[_0x23937d(0x944,0x16bf,0x146e,-0x1df)+'e'](_0x5cd288[_0x23937d(0x118c,0x1b77,0x11c6,0x9cc)],_0x69a9b1)[_0x23937d(0x1b61,0x24e4,0x14b1,0x26ac)](_0x50c766=>_0x1db05d(jsonformat(_0x50c766)))[_0x313705(0xc9a,0x17fa,0x16be,0x1aaa)](_0x37c8cd=>_0x1db05d(jsonformat(_0x37c8cd)));}}}else{if(_0x1a60f7)return _0x4b485e[_0x23937d(0x32f,0x1c7,0x26e,0x714)](_0x5cf17c,_0x313705(0x166d,0xde7,0x127e,0x21ac)+'tivated');_0x288e9a[_0x23937d(0xdbc,0x1050,0xc78,0x5d6)](_0x2d1b25),_0x1e5af1[_0x313705(0x1d16,0x2331,0x1db9,0x1949)+_0x23937d(0x12d2,0x1e87,0x1e72,0x107b)](_0x4b485e[_0x23937d(0x4b8,0xdae,-0x965,0xea3)],_0x5d7e0f['stringify'](_0x1ed9d6)),_0x4b485e[_0x313705(0x5c2,-0x837,0xf46,-0x612)](_0x3be578,_0x4b485e['iJoqG']);}}break;case _0x4b485e['CjtJC']:case _0x4b485e[_0x313705(0x12f2,0x1f92,0x7fd,0x1e82)]:{if(_0x4b485e[_0x23937d(0x1210,0x116f,0x1abe,0x187b)](_0x4b485e[_0x23937d(0x3a3,0xa6a,0xb31,0x790)],_0x313705(0xed5,0x176e,0x178e,0x52a))){if(_0x1bac1f)return _0x4b485e[_0x313705(0xb14,0xa1b,0x1ee,0x45b)](_0x1db05d,mess[_0x23937d(0x61c,0x109b,0x398,-0x87b)]);if(_0x1e03f5)return _0x4b485e['SwuFN'](_0x1db05d,mess['banChat']);let _0x2e9b37=[],_0x524d74=[_0x313705(0x20b1,0x29b9,0x254f,0x12ce),_0x313705(0x11ed,0x6eb,0x77f,0x11a1)+_0x23937d(0xbc9,0x30d,0x68,0x88e),'welcome\x20on',_0x23937d(0x12db,0xa83,0x1a58,0x1f6a)+_0x23937d(0x7e4,0xce8,-0x2ea,0xd04),_0x313705(0x6b3,0x1d3,0xce2,0x684)+_0x23937d(0x7e4,0x16be,-0x325,0xad),'antilinktt'+_0x313705(0xb4a,0xa97,0x2df,0xded),_0x23937d(0x3e6,-0x416,0x6fd,0x10eb)+_0x313705(0x137d,0x468,0x1723,0x1b9e),_0x23937d(0x3e6,-0xa1a,0x70c,-0x298)+_0x23937d(0xdd7,0xbec,0x1a2,0x1c94),'antilinkig'+_0x313705(0xb4a,0x13bb,0x1300,0x36e),_0x23937d(0x1ca0,0x1caa,0x29c6,0x253a)+'\x20on',_0x23937d(0x1b2,0xbbb,-0x3cf,0xfd0)+'it\x20on',_0x23937d(0x8c,0x81e,-0x5c6,0xa89)+'l\x20on',_0x23937d(0x160d,0x209e,0x178a,0x101d)+'n',_0x313705(0xc57,0x19d1,0x201,0xd6f)+'on',_0x313705(0x1def,0x12ef,0x1a73,0x2208)+'on',_0x313705(0x1d05,0x18af,0x18ae,0x2b0f)+'on',_0x23937d(0x1d4b,0xfca,0x1cc4,0x1399)],_0x91981e=[_0x313705(0x841,0xb65,0x139f,0xb8)+'e',_0x313705(0x11ed,0x1dea,0x10ac,0x14ae)+'r\x20off',_0x313705(0xb3d,0x2ac,0x163f,0xba2)+'f',_0x313705(0x1641,0x1df3,0x1467,0x11e3)+'\x20off',_0x313705(0x6b3,0xe4f,0x3fe,0x122)+_0x313705(0xb4a,0x15b7,0xf7f,-0xfe),'antilinktt'+_0x313705(0xb4a,0x17ec,0x18b3,0x197d),'antilinkyt'+'ch\x20on',_0x313705(0x74c,0x5c,0xa4d,-0x1b3)+'vid\x20on',_0x23937d(0x8db,0xdd7,-0x413,0x156b)+_0x23937d(0x7e4,0x4a7,0x117e,-0x4b2),_0x23937d(0x1ca0,0x265f,0x29d0,0x10e1)+'\x20on',_0x313705(0x518,-0x21a,-0x3e,0x638)+_0x23937d(0x138a,0x13a9,0x1884,0xe91),'antilinkal'+'l\x20on',_0x23937d(0x160d,0x1b7d,0x10c8,0x2242)+'n','antitoxic\x20'+'on',_0x313705(0x1def,0x11ab,0xf11,0x13a1)+'on',_0x313705(0x1d05,0x12ba,0xe7b,0x26be)+'on',_0x23937d(0x4db,0x5f1,-0xa18,-0x17e)+'e'],_0x55d5e3=[_0x313705(0xaab,0x10c5,0x7f7,0x86)+_0x313705(0xe28,0x709,0x1876,0x1088),_0x23937d(0xe88,0xf27,0x8e0,0x5b5)+_0x313705(0x16be,0x21a5,0x173f,0x1d52),_0x313705(0x1dcb,0x2b19,0x22e1,0x1b33)+_0x313705(0x1bfb,0x2a1d,0x1949,0x2882),_0x23937d(0x5bc,0x4ea,0x13ad,-0x2e7)+_0x23937d(0x5ff,-0x315,-0x40e,-0x1f6)+'f','Antilink\x20T'+'elegram\x20on'+_0x23937d(0x1d92,0x13af,0x13f4,0x20e0),_0x313705(0xeea,0x143a,0x4e5,0x11a)+_0x23937d(0x11a9,0xfab,0xf6a,0x1c11)+'ff',_0x23937d(0xcdb,0xc18,0xe6b,0xab3)+'outube\x20Cha'+'nnel\x20on/of'+'f',_0x23937d(0xcdb,0x1274,0x134e,0x576)+_0x23937d(0xbaf,0x183c,0x2fb,0x378)+_0x23937d(0xcd6,0x7eb,0x1631,0x59),_0x23937d(0x6c4,-0x20d,0x2ff,0x361)+_0x313705(0x1eca,0x2097,0x2261,0x2422)+_0x313705(0x1cb2,0x1382,0x169a,0x180b),_0x23937d(0x92d,0x7d4,0x81,0x141d)+_0x313705(0x2097,0x1294,0x2beb,0x1bef)+_0x23937d(0x1d92,0x1552,0x16c7,0x2468),_0x23937d(0xb84,0x8e6,0x420,0xa3d)+_0x313705(0x85a,-0x5d9,0xb9b,0xcfc)+'off',_0x313705(0x732,0x100c,0x79d,-0x15e)+_0x313705(0x1a45,0x276b,0x1ca0,0xfef),_0x23937d(0xfa3,0xf95,0xb13,0xdee)+_0x23937d(0x1640,0x1421,0x1a74,0xeb8),_0x313705(0xbc1,0x9a1,0x11e5,0x71b)+_0x23937d(0xbe9,0xd03,0x130d,-0x80),_0x23937d(0x1497,0x21cb,0x22ee,0xdd3)+_0x313705(0xf4f,0xa70,0x19b6,0x1d1c),_0x313705(0x85b,0x31c,0x14c7,0x335)+_0x313705(0xf4f,0x1766,0x1277,0xbd5),_0x23937d(0x745,0x1574,0x1363,0x579)+'/close'],_0x1c868d=[_0x313705(0x1f82,0x2af3,0x2816,0x1b1c),_0x313705(0x1c69,0x22a9,0x2321,0x1d65)],_0x352155=[_0x23937d(0xd7,0x249,-0x25c,-0x376),'Auto\x20Stick'+'er',_0x23937d(0x1b80,0x1838,0x141e,0x1caf),_0x313705(0x922,0x1587,0x723,0x145f)+_0x23937d(0xad8,0x116a,0xac,0x13d3),_0x313705(0xeea,0x12e4,0xdfc,0x7f6)+_0x23937d(0xe72,0xa20,0x15ca,0x140c),'Antilink\x20T'+_0x23937d(0xc09,0x121c,0x169f,0x16d),_0x23937d(0xcdb,0x1112,0x838,0x8e4)+_0x313705(0xa6d,0xf29,0x1868,0x2b2)+_0x23937d(0x124f,0x1e5b,0x4d3,0x1920),_0x313705(0x1041,0x1203,0x26b,0x15bb)+'outube\x20Vid'+'eo',_0x313705(0xa2a,0xb8f,0x10fe,0x1427)+_0x23937d(0x331,-0x673,0x13,0x710),'Antilink\x20F'+'acebook',_0x313705(0xeea,0x173f,0x1424,0xd31)+_0x313705(0x1d8d,0xee2,0x11b6,0x27e6),'Antilink\x20A'+'ll',_0x313705(0xb47,0x5d1,-0x9a,0xf60),_0x313705(0xbc1,0x1412,0x12fd,0x694),_0x23937d(0x1497,0xa5b,0x1f75,0xb25),'Auto\x20Reply',_0x23937d(0xd7,0x3a,0x3e1,0x2de)],_0x1e1fa8=0xb7*-0xf+-0x646+0x10ff,_0x26d649=-0x1336+0x5eb+0x1*0xd4b,_0x58987d=0x3*0x17d+0x2*-0x3c8+0xd*0x3d,_0x188d1b=0x793+-0x1*0x10ab+0x918,_0x111728=0x2397+-0x125f+-0x153*0xd;for(let _0x88b59 of _0x524d74){const _0x167a32={};_0x167a32[_0x313705(0x1b3f,0x1fb9,0x1d7f,0xe22)]=''+_0x1c868d[0x11bc+0xc6e+-0xf15*0x2],_0x167a32['descriptio'+'n']=_0x313705(0x1998,0x1dd0,0x2546,0x2115)+_0x352155[_0x26d649++],_0x167a32[_0x313705(0x8a1,-0x52e,0x105e,0x889)]=''+_0xe1d953+_0x88b59;const _0x518088={};_0x518088[_0x23937d(0x17d9,0x1523,0x137d,0xf2c)]=''+_0x1c868d[0x137d+-0x5d0+-0xdac],_0x518088[_0x313705(0x172e,0x19c6,0x866,0x1207)+'n']=_0x313705(0xf18,0x123a,0x10fc,0x1880)+'\x20'+_0x352155[_0x58987d++],_0x518088['rowId']=''+_0xe1d953+_0x91981e[_0x188d1b++];const _0x1e1474={};_0x1e1474['title']=''+_0x55d5e3[_0x1e1fa8++],_0x1e1474['rows']=[_0x167a32,_0x518088];const _0x13caba=_0x1e1474;_0x2e9b37[_0x313705(0x1122,0x12ee,0x1a38,0x1d3c)](_0x13caba);}const _0x2e1580={};_0x2e1580[_0x23937d(0x1d39,0x166d,0x1979,0x14c5)]=_0x4b485e[_0x313705(0xa02,-0x2d3,0x874,0x112d)],_0x2e1580[_0x313705(0x13d4,0xac2,0xdf2,0x17e9)]=botname,_0x2e1580[_0x313705(0x1b3f,0x255e,0x133a,0xc9b)]=_0x23937d(0x10e0,0xb26,0x980,0xa51)+_0x23937d(0x88c,0x157e,0xe2c,0x89a)+_0x313705(0x16cf,0x1c2b,0xadc,0x1661)+_0x313705(0x616,-0x244,-0x5f9,0x476),_0x2e1580['buttonText']=_0x4b485e[_0x313705(0xf69,0x200,0x347,0x3bd)],_0x2e1580[_0x23937d(0x17f7,0x11ea,0xe2c,0xae4)]=_0x2e9b37;const _0x4f7986={};_0x4f7986[_0x23937d(0x5dc,0x570,0x868,0x10ca)]=_0x5cd288;const _0x4ad94d=_0x175756[_0x23937d(0x944,0x98e,-0x19a,-0x3cd)+'e'](_0x423161,_0x2e1580,_0x4f7986);}else _0x970916(_0x23937d(0x2a1,0x9cc,-0x41d,0x427)+'n\x20Successf'+_0x23937d(0x87f,-0x2a6,0xf98,-0x34e)+'\x20Remaining'+_0x23937d(0x852,0x641,0x8f6,-0x66b)+_0x4b485e['tDbWo'](_0x174283,_0x5227cf['sender'])+(_0x313705(0x1f2a,0x2d1a,0x1726,0x2527)+_0x313705(0x1413,0x167f,0x1766,0x1a8f)+'n(s)*\x20:\x20')+_0x4b485e[_0x313705(0x1d47,0x2721,0x145e,0x1688)](_0x249b78,_0x37ad23[_0x23937d(0x14ce,0x1c5f,0x15f5,0x14a8)]));}break;case'delete':case _0x4b485e[_0x313705(0xe6a,0xc52,0x1c4a,0x107f)]:{if(_0x1bac1f)return _0x1db05d(mess[_0x23937d(0x61c,0x129,0x605,0xd7e)]);if(_0x1e03f5)return _0x4b485e[_0x313705(0x17ae,0x1a39,0x1cb8,0x1563)](_0x1db05d,mess['banChat']);if(!_0x5cd288['quoted'])_0x4b485e[_0x23937d(0x10db,0x98c,0xb06,0x1683)](_0x1db05d,![]);let {chat:_0x18f16b,fromMe:_0x4ca1be,id:_0x540084,isBaileys:_0x2bd000}=_0x5cd288['quoted'];if(!_0x2bd000)return _0x4b485e[_0x313705(0x1616,0x1fe1,0x111a,0xcc9)](_0x516d85,'The\x20Messag'+_0x23937d(0xbb5,0x1550,0x1875,0x968)+_0x23937d(0x14d,0xc84,-0x54b,-0xcef)+_0x23937d(0x522,-0x8aa,0x78f,0x832));_0x175756[_0x313705(0xcaa,0x10f1,0x1679,0x5f4)+'e'](_0x5cd288[_0x313705(0x14f2,0xe61,0x163d,0xd9c)],{'delete':{'remoteJid':_0x5cd288['chat'],'fromMe':!![],'id':_0x5cd288[_0x23937d(0x5dc,0xe6,0x146a,-0x252)]['id'],'participant':_0x5cd288[_0x23937d(0x5dc,0x10f,0x1262,0xb24)][_0x313705(0x1834,0x2068,0x1096,0xe26)]}});}break;case _0x23937d(0xe65,0x19a1,0x19c8,0x7c2):case _0x4b485e[_0x313705(0x5b5,-0x67,-0x3d9,-0x944)]:{if(_0x4b485e[_0x313705(0xae4,0x1162,0x114c,0x212)]!==_0x4b485e[_0x23937d(0x77e,0xf84,0xd2c,-0xe5)])_0x41ec50+=_0x23937d(0xd4a,0xaa8,0x11fe,0xcbb)+_0x104ba7[_0x313705(0x17b7,0xbbd,0xb6f,0xb44)]+(_0x313705(0x718,0x63,0x2f9,0x15fc)+':\x20')+_0x4c399e[_0x23937d(0x11fe,0xd4d,0x867,0xd5a)]+_0x313705(0x55b,0x382,0x85a,-0x588)+_0x2575f5[_0x313705(0xdb8,0x1288,0x1c30,-0x1d)]+'\x0aDesc\x20:\x20'+_0x3ae9c6[_0x23937d(0x134d,0x14b8,0x1f57,0x1d56)]+'\x0aLink\x20:\x20'+_0x2e1b83['link'];else{if(!_0x24aa58)return _0x4b485e[_0x313705(0x14b9,0xa33,0x21ea,0x205d)](_0x516d85,''+mess[_0x313705(0xfea,0x1b2a,0x6a1,0x1361)]);if(!_0x494254)return _0x4b485e[_0x313705(0x454,-0x8b7,0x2ff,0x525)](_0x516d85,_0x23937d(0x14f,0x9f9,0x88e,-0x6ff)+_0x23937d(0xf93,0x11d5,0x212,0xa8)+'Example\x20:\x20'+_0x4b485e[_0x23937d(0x86d,-0x517,0xe24,0x863)](_0xe1d953,_0x1354e9)+(_0x23937d(0x1535,0xeda,0x7c7,0x1b8f)+'dsome'));let _0x22cef5=await _0x175756[_0x313705(0x7bd,0x988,0xadc,-0x3da)+_0x313705(0xaae,0x14b7,0x1be,0x1728)+'pating'](),_0x266c80=Object['entries'](_0x22cef5)['slice'](-0x24aa+-0x2363+-0xa4b*-0x7)[_0x313705(0xe7c,0x10c5,0x1fd,0x1a4e)](_0xa3f5e6=>_0xa3f5e6[-0xca2+0x10*0x85+-0x1*-0x453]),_0x5c8d87=_0x266c80[_0x313705(0xe7c,0xee6,0xae5,0x14f7)](_0xe0bbe3=>_0xe0bbe3['id']);_0x4b485e[_0x23937d(0xf94,0x1a69,0xba9,0x13c7)](_0x1db05d,'Sent\x20Broad'+_0x313705(0x1d4b,0x2266,0x2638,0x18af)+_0x5c8d87[_0x313705(0x744,0x533,0x44a,-0x27c)]+(_0x23937d(0x1deb,0x1b16,0x2ce2,0x1ad6)+_0x313705(0x1637,0x243d,0x1aa9,0x208c)+'Time\x20')+_0x5c8d87['length']*(0xa8a+0x1*-0x126d+0x7e4+0.5)+_0x313705(0x1e37,0x2927,0x17c4,0x188e));for(let _0x31b224 of _0x5c8d87){await _0x4b485e[_0x23937d(0x225,0x8c6,-0x3e1,-0x99d)](sleep,0x19f7+0x26e+0x281*-0x9);const _0x1e3ac4={};_0x1e3ac4[_0x313705(0x175a,0x1b53,0xb29,0x1fa7)+'t']='🔮Menu🔮',_0x1e3ac4['id']=_0x4b485e['bkOcn'];const _0x509369={};_0x509369[_0x313705(0x570,0x1108,0xc9c,0xcc5)+_0x313705(0x139a,0x2007,0x934,0xa76)]=_0x1e3ac4;const _0x39643b={};_0x39643b['displayTex'+'t']=_0x4b485e[_0x23937d(0x174,0xead,0x639,0x87e)],_0x39643b['id']=_0x4b485e[_0x313705(0x108a,0x1b5a,0x1622,0x3c1)];const _0x5cc9ff={};_0x5cc9ff[_0x23937d(0x20a,0x916,0xbd9,0x9bc)+_0x23937d(0x1034,0xab2,0x27b,0x161f)]=_0x39643b;let _0x5eb1e1=[_0x509369,_0x5cc9ff],_0x15ab4d=_0x313705(0x1788,0x25dd,0x2589,0x1393)+global[_0x23937d(0x96c,0x99,0x124e,0x1075)]+_0x23937d(0x128b,0xe2c,0x123c,0x1439)+_0x494254;_0x175756[_0x313705(0x1f35,0x11ef,0x28e2,0x213a)+'g'](_0x31b224,_0x15ab4d,_0x175756[_0x23937d(0x421,-0x1f,-0x384,0x115b)][_0x23937d(0x1451,0x1979,0x18ef,0x6d0)],global[_0x313705(0x9aa,0x1528,0x100d,0x3ea)],_0x5eb1e1);}_0x4b485e[_0x23937d(0x16b7,0x2558,0x1f12,0x1e7a)](_0x1db05d,_0x313705(0x17d7,0xeea,0x2460,0xe99)+_0x23937d(0x16f6,0x1034,0x258a,0x193a)+_0x23937d(0xad2,0x11bd,-0x428,0xddf)+'o\x20'+_0x5c8d87[_0x313705(0x744,-0x41d,0x402,0x854)]+_0x23937d(0x19d6,0x14c5,0x1ff1,0x1190));}}break;case'bc':case _0x4b485e[_0x313705(0x2139,0x1ada,0x137a,0x124a)]:case _0x313705(0x1ca0,0x14b6,0x17e8,0x2692):{if(!_0x24aa58)return _0x516d85(''+mess[_0x313705(0xfea,0x108d,0x1c19,0x8bb)]);if(!_0x494254)return _0x4b485e[_0x313705(0xd02,0x1402,0xf90,0xe33)](_0x516d85,_0x23937d(0x14f,-0x792,-0xdd1,-0x178)+_0x313705(0x12f9,0x181c,0x16d2,0x20ce)+_0x23937d(0xda5,0x340,0x7db,0x13b7)+(_0xe1d953+_0x1354e9)+_0x313705(0x104b,0x1a60,0x1b99,0xcaf));let _0x2ea76c=await _0x35c05b[_0x313705(0x5b8,0x7d5,-0x474,0xf6e)]['all']()[_0x313705(0xe7c,0xab7,0x11fe,0x9c)](_0x4f787f=>_0x4f787f['id']);_0x4b485e[_0x313705(0x1443,0x21ff,0x681,0x638)](_0x1db05d,'Send\x20Broad'+'cast\x20To\x20'+_0x2ea76c['length']+('\x20Chat\x0aFini'+'sh\x20Time\x20')+_0x4b485e['nSBhc'](_0x2ea76c[_0x313705(0x744,0x5af,-0x523,-0x4dd)],-0x1275+0x16be+-0x224*0x2+0.5)+_0x23937d(0x1ad1,0x1886,0x188e,0x13e0));for(let _0x8ff8a6 of _0x2ea76c){await sleep(-0x23b+-0xde8+-0x3*-0x755);const _0x3b47b7={};_0x3b47b7['displayTex'+'t']=_0x4b485e['jMWIM'],_0x3b47b7['id']=_0x23937d(0x1a10,0xc60,0x2568,0x1dbe);const _0x154f3f={};_0x154f3f['quickReply'+_0x313705(0x139a,0xcf4,0x656,0x9ec)]=_0x3b47b7;const _0x252c29={};_0x252c29[_0x313705(0x175a,0x213e,0x25ee,0x13a3)+'t']=_0x4b485e['qXaMJ'],_0x252c29['id']=_0x4b485e[_0x313705(0x108a,0x1613,0xeff,0x46f)];const _0x71b74c={};_0x71b74c[_0x313705(0x570,0x838,0xcd9,-0x6b0)+_0x23937d(0x1034,0x1e3b,0x149,0x13f2)]=_0x252c29;let _0x1374d4=[_0x154f3f,_0x71b74c],_0x402654=_0x313705(0x16c7,0x1281,0x15a5,0x18cd)+'\x0a'+_0x494254;_0x175756['send5ButIm'+'g'](_0x8ff8a6,_0x402654,_0x175756[_0x23937d(0x421,0x863,0x151,0xc16)][_0x313705(0x17b7,0x11c7,0xd7f,0x248f)],global[_0x23937d(0x644,0x402,0x12ac,-0x457)],_0x1374d4);}_0x4b485e[_0x23937d(0x115,-0x87c,0xe7f,-0x2b2)](_0x1db05d,_0x4b485e[_0x23937d(0x269,0xef7,-0x574,-0xc55)]);}break;case _0x4b485e[_0x23937d(0xffd,0x1a7a,0x1285,0x935)]:case _0x4b485e[_0x23937d(0x15d8,0x17af,0x23db,0xbc2)]:case _0x4b485e[_0x23937d(0x191d,0x105b,0x270b,0xd9b)]:{if(_0x1bac1f)return _0x1db05d(mess['ban']);if(_0x1e03f5)return _0x4b485e[_0x23937d(0x60b,-0x3b0,-0x201,0x3c0)](_0x1db05d,mess[_0x313705(0x926,0xe3f,-0x28d,0xa1f)]);if(!_0x24aa58)return _0x516d85(mess[_0x23937d(0xc84,0x10f2,0x14dc,0x3d9)]);if(!/video/[_0x313705(0x1c74,0x150a,0x1c5b,0x258b)](_0x2a2351)&&!/image/[_0x313705(0x1c74,0x14db,0x194f,0x16c2)](_0x2a2351)&&!/audio/[_0x313705(0x1c74,0x2365,0x270a,0x2296)](_0x2a2351))return _0x4b485e[_0x313705(0x13e3,0x1091,0x83a,0x1f6e)](_0x1db05d,_0x23937d(0x1ade,0xce9,0x275c,0x1057)+_0x23937d(0x778,0x160a,0x758,-0x50c)+_0x23937d(0x1e01,0x14b4,0x2187,0x2c35)+_0x313705(0x1bf2,0x1fa1,0x2291,0x1439)+_0x313705(0x1f0b,0x2c97,0x1e21,0x146e)+_0x313705(0xb3c,0x11,-0x185,0xe9)+_0x23937d(0x6a6,0x610,0x11fc,0x4c1)+(_0xe1d953+_0x1354e9));let _0x461ed6=await _0x35c05b[_0x313705(0x5b8,0xed8,0x1fd,0x66e)][_0x23937d(0x4c5,-0xa2b,-0x542,0xa6d)]()[_0x313705(0xe7c,0xaf9,0xcb0,0xc19)](_0x3940a6=>_0x3940a6['id']);const _0x2e80f4={};_0x2e80f4[_0x23937d(0x1a6,0x9f9,0xb63,-0xaa5)]=![],_0x2e80f4[_0x23937d(0x461,0x9b9,-0x25d,0x4fd)+'t']=_0x4b485e[_0x23937d(0x459,0xd9f,-0x87a,-0x64f)],_0x2e80f4[_0x23937d(0x1f4,0x94d,-0x452,0x815)]=_0x4b485e[_0x313705(0x19cc,0x19b8,0x1b03,0x26c6)];const _0x47a89f={};_0x47a89f[_0x23937d(0x71,-0x9e8,-0x4c5,-0x218)+'Score']=0x3e7,_0x47a89f[_0x23937d(0x1be0,0x1c0f,0x1a8a,0xced)+'d']=!![];let _0x254fdd={'key':_0x2e80f4,'message':{'orderMessage':{'itemCount':0x3b9ac9ff,'status':0xc8,'thumbnail':fs[_0x313705(0x1723,0x1a73,0x113e,0x22cc)+'nc']('./Android/'+_0x23937d(0x1920,0x11c8,0x26cf,0x160f)+_0x23937d(0x14e9,0x1e23,0xdc8,0x1a1c)+'pg'),'surface':0xc8,'message':ownername+(_0x313705(0x1027,0x574,0x1ec1,0x7e4)+'st'),'orderTitle':''+botname,'sellerJid':_0x313705(0x108d,0x778,0x240,0x19a9)+_0x23937d(0x982,-0xe7,0x1404,0x56f)}},'contextInfo':_0x47a89f,'sendEphemeral':!![]};_0x4b485e[_0x313705(0x810,0x41e,0xc78,0x9e8)](_0x1db05d,'*Send\x20Broa'+_0x313705(0x1252,0x1f9c,0x1506,0x33e)+_0x461ed6[_0x23937d(0x3de,0xd81,-0x672,0x59a)]+(_0x23937d(0x18d4,0x1e31,0x1cf5,0x1270)+'at,\x20Time\x20')+_0x4b485e[_0x23937d(0x180d,0x1c73,0xf38,0x2271)](_0x461ed6[_0x23937d(0x3de,-0x58b,0x341,0x4b1)],0x1797+-0x1e5d+0x6c7+0.5)+_0x313705(0x1348,0x1e49,0x101e,0x13bc));for(let _0x2f9245 of _0x461ed6){await _0x4b485e[_0x23937d(0x21a,-0x5d9,0x434,-0x666)](sleep,-0x8*-0x3d1+-0x29*-0x34+0x160*-0x18);const _0x20da53={};_0x20da53[_0x23937d(0x13f4,0xb7d,0x10dc,0xa7b)+'t']=_0x4b485e[_0x23937d(0xda4,0x1ad,0x8c5,0x933)],_0x20da53['id']=_0x4b485e['bkOcn'];const _0x26164f={};_0x26164f[_0x313705(0x570,0x1216,0x115a,0x772)+'Button']=_0x20da53;const _0x4b68d8={};_0x4b68d8[_0x313705(0x175a,0x24ac,0x219b,0x2380)+'t']=_0x4b485e[_0x313705(0x4da,0x1014,0xb37,-0x8aa)],_0x4b68d8['id']=_0x4b485e[_0x313705(0x108a,0x1df,0x813,0xf28)];const _0x3cb2ac={};_0x3cb2ac[_0x23937d(0x20a,-0xa61,0x1012,-0x65f)+_0x23937d(0x1034,0x14f3,0x1526,0x140e)]=_0x4b68d8;let _0x87a28e=[_0x26164f,_0x3cb2ac],_0x5bebf5=await _0x175756['downloadAn'+_0x313705(0x11ae,0x106a,0x19b4,0x1aeb)+_0x23937d(0xe14,0x78,0x85e,0x1172)](_0x3e5ec4),_0x3b2910=fs[_0x23937d(0x13bd,0xa78,0x1bc3,0x52e)+'nc'](_0x5bebf5);if(/webp/['test'](_0x2a2351)){const _0x543def={};_0x543def['url']=_0x5bebf5;const _0x346f11={};_0x346f11[_0x313705(0x1360,0x584,0x1705,0x20c9)]=_0x543def;const _0x3b495f={};_0x3b495f[_0x23937d(0x5dc,0x90,0xccf,-0x811)]=_0x254fdd,_0x175756[_0x23937d(0x944,0x1395,0x1100,0x10aa)+'e'](_0x2f9245,_0x346f11,_0x3b495f);}else{if(/image/['test'](_0x2a2351)){if(_0x4b485e[_0x23937d(0x1cd4,0x288e,0x2917,0x1ea2)](_0x4b485e['IdofL'],_0x4b485e[_0x23937d(0x1bce,0x20b7,0x287d,0x11ab)])){let _0x45adda='*🧩\x20'+global[_0x313705(0x203b,0x2780,0x1e05,0x1fe0)]+(_0x23937d(0xcc1,0x296,0x2ca,0x358)+_0x23937d(0x1dea,0x23bc,0x1d8a,0x1ab3))+(_0x494254?'\x0a\x0a'+_0x494254:'');_0x175756[_0x313705(0x1f35,0x1458,0x2532,0x2bea)+'g'](_0x2f9245,_0x45adda,''+global['botname'],_0x3b2910,_0x87a28e);}else{const _0x70dc5c={};_0x70dc5c[_0x23937d(0xa79,0x1549,0x9e8,0x1669)]=_0x1cc795[_0x23937d(0xa79,-0x73,0xf31,-0xca)][-0x239d+0x1*0x212f+0x137*0x2]['url'];const _0x37ab74={};_0x37ab74[_0x23937d(0xc0e,0x1433,0x592,0x2cd)]=_0x70dc5c,_0x37ab74['mimetype']=_0x23937d(0x10d0,0x14aa,0xc1b,0x714),_0x37ab74[_0x23937d(0xb19,0x166f,0x18e5,0xcb5)]='Red-Dragon'+_0x313705(0x75d,-0x773,-0x38c,-0x417)+'3';const _0x414cc5={};_0x414cc5[_0x23937d(0x5dc,-0x7b3,0x145e,0x5d6)]=_0x40bd0c,_0x57afe2[_0x23937d(0x944,0x703,0x16fe,-0x398)+'e'](_0x70d49e['chat'],_0x37ab74,_0x414cc5);}}else{if(/video/[_0x313705(0x1c74,0x2650,0x1d8e,0x1da2)](_0x2a2351)){if(_0x4b485e[_0x23937d(0x1caa,0x1ac4,0x165d,0xe4f)](_0x4b485e['QRmEu'],_0x4b485e[_0x313705(0x1291,0xaa2,0x1b7d,0x57e)]))_0x4b485e[_0x313705(0x1a00,0x2246,0x1025,0x2854)](_0x5988ae,_0x23937d(0x6,-0x1c1,-0xc34,0x700));else{let _0x4c53bb=_0x23937d(0x47f,-0x42a,0x264,0x535)+global['ownername']+(_0x313705(0x1027,0x1c44,0x39e,0xe07)+_0x313705(0x2150,0x25f9,0x21d8,0x1c0d))+(_0x494254?'\x0a\x0a'+_0x494254:'');const _0x315772={};_0x315772[_0x313705(0x1ac8,0x1e51,0x2112,0x29df)]=_0x3b2910,_0x315772[_0x23937d(0x968,-0x37f,0x58b,-0x2ae)]=''+_0x4c53bb;const _0x5e5581={};_0x5e5581[_0x313705(0x942,0x16da,0x953,0x112b)]=_0x254fdd,_0x175756[_0x313705(0xcaa,0x331,0x133b,0x5b2)+'e'](_0x2f9245,_0x315772,_0x5e5581);}}else{if(/audio/[_0x313705(0x1c74,0x14c1,0x1740,0x2422)](_0x2a2351)){if(_0x4b485e[_0x23937d(0x1266,0x357,0x11bc,0x1a46)](_0x4b485e[_0x313705(0x112b,0x1220,0xa6a,0x110c)],_0x313705(0x1e87,0x19d8,0x28c0,0x1bfd))){const _0x3a5f5b={'nama':_0x5af8fa,..._0x37babc};return _0x3a5f5b;}else{const _0x2e638a={};_0x2e638a['audio']=_0x3b2910,_0x2e638a[_0x313705(0x1610,0x704,0x1991,0x1daa)]=_0x4b485e[_0x313705(0x1d1e,0x21ff,0x1010,0x1258)];const _0x47c6b4={};_0x47c6b4[_0x23937d(0x5dc,0x12fb,0xff,0xc24)]=_0x254fdd,_0x175756[_0x23937d(0x944,0x1593,0xe14,0xabc)+'e'](_0x2f9245,_0x2e638a,_0x47c6b4);}}else _0x4b485e[_0x313705(0x1f97,0x206c,0x2754,0x112a)](_0x1db05d,_0x23937d(0x1ade,0xfa2,0x1059,0x21f7)+'y\x20Video/Au'+_0x313705(0x2167,0x2f1e,0x299a,0x27fe)+'You\x20Want\x20t'+_0x23937d(0x1ba5,0x126b,0x274b,0x2282)+_0x23937d(0x7d6,0x901,-0x46e,0x13c8)+_0x313705(0xa0c,0x78e,0xe99,0xca5)+_0x4b485e[_0x313705(0x1b8d,0x13d1,0x27b3,0x1f93)](_0xe1d953,_0x1354e9));}}}await fs[_0x313705(0x371,-0xb5c,0x1194,-0xb29)](_0x5bebf5);}_0x4b485e[_0x313705(0x1a8a,0x231a,0x12e9,0x1ea9)](_0x1db05d,_0x23937d(0x270,0xb01,0x1057,0xcf2)+_0x23937d(0x758,0x122f,0xa80,0x493)+'\x20'+_0x461ed6['length']+_0x313705(0x1117,0xf25,0x963,0x108c));}break;case _0x4b485e['TFGyG']:{if(_0x4b485e['Fydsy'](_0x4b485e[_0x313705(0x1d95,0x115e,0x2002,0x22ce)],_0x4b485e[_0x313705(0x1d95,0x1c60,0x16c7,0xec0)])){const _0x1300a8={};_0x1300a8[_0x23937d(0x1d39,0x1c1b,0x1c6e,0x2c05)]=''+_0x17b338[_0x313705(0x1218,0x13c6,0x4b5,0x1fd2)];const _0x5e9f8c={};_0x5e9f8c[_0x23937d(0x5dc,0x1333,0x66d,0x897)]=_0x459e84,_0x1e298d[_0x23937d(0x944,0x10df,0x996,0x3bb)+'e'](_0x5c0d40[_0x23937d(0x118c,0x1595,0xd0e,0x390)],_0x1300a8,_0x5e9f8c);}else{if(_0x1bac1f)return _0x4b485e[_0x313705(0x54f,0x911,0x918,-0x9b6)](_0x1db05d,mess[_0x313705(0x982,-0x22f,0xb15,0x64c)]);if(_0x1e03f5)return _0x1db05d(mess[_0x23937d(0x5c0,-0x798,0x3ca,-0x66e)]);if(!_0x24aa58)return _0x4b485e[_0x313705(0x12c8,0x21a2,0x17f9,0x1bf4)](_0x516d85,mess[_0x313705(0xfea,0x1953,0x646,0xdd7)]);if(!_0x494254)return _0x1db05d(_0x313705(0x12ef,0x1dc2,0x770,0x2012)+_0xe1d953+(_0x23937d(0xdf3,0x1699,0x116e,0x8a9)+_0x313705(0x507,0x5a8,0x1397,0xce8)+':\x20')+_0x4b485e[_0x23937d(0x7df,0xb59,0xad4,0x553)](_0xe1d953,_0x1354e9)+('\x20attention'+'\x20everybody'));let _0x48e76f=await _0x35c05b[_0x313705(0x5b8,-0x687,0x1b,-0x7bd)][_0x23937d(0x4c5,-0x5f0,0x11ce,0x130e)]()[_0x23937d(0xb16,-0x202,0x182c,0x5f0)](_0x1f93d2=>_0x1f93d2['id']),[_0x1106e5,_0x133f9b]=_0x494254[_0x23937d(0xccf,0x1183,0x9e1,0xef1)]`|`;_0x4b485e[_0x23937d(0x1319,0x136d,0xaaf,0xc78)](_0x1db05d,_0x313705(0x2124,0x2f6f,0x2510,0x29e3)+_0x23937d(0xeec,0x3f6,0x3e0,0x169)+_0x48e76f[_0x313705(0x744,0x4c7,0xdbc,0x1153)]+(_0x23937d(0x336,0x802,-0x96e,-0x4df)+'\x20')+_0x4b485e[_0x313705(0x1eb4,0x15da,0x2209,0x2b13)](_0x48e76f[_0x313705(0x744,0x1309,-0x5c6,-0x625)],-0xf8c+0x203+0xd8a+0.5)+_0x23937d(0x1905,0xe39,0x158e,0x200b));for(let _0x56156a of _0x48e76f){await _0x4b485e[_0x23937d(0x662,-0x295,-0x15,0xca2)](sleep,0xa2*0x16+-0xbda*0x3+0x1b7e);const _0xf6116f={};_0xf6116f[_0x313705(0x175a,0x119c,0x23ec,0xb13)+'t']=''+_0x133f9b;const _0x42b26c={};_0x42b26c[_0x23937d(0x1b0c,0xcbe,0x112a,0x1af2)]=_0xe1d953+'ho',_0x42b26c['buttonText']=_0xf6116f,_0x42b26c[_0x313705(0xa9e,0x14c1,0x7c4,0x22d)]=0x1;var _0x392014=[_0x42b26c];_0x175756['sendMessag'+'e'](_0x56156a,{'caption':''+_0x1106e5,'location':{'jpegThumbnail':await _0x4b485e[_0x23937d(0x95d,0x776,-0x75,0x10ae)](getBuffer,_0x4b485e[_0x313705(0x188b,0xb28,0x1555,0x981)](_0x382fc5,ownername+('\x27s\x20Broadca'+'st')))},'buttons':_0x392014,'footer':''+botname,'mentions':[_0x5cd288[_0x313705(0x1834,0xd16,0x25a7,0x2624)]]});}}}break;case _0x313705(0x1ad9,0x13ef,0x270c,0x1993):{if(_0x4b485e['NeqPk'](_0x4b485e[_0x313705(0x3ab,0xc21,-0x8e7,0xeb3)],_0x313705(0x17f1,0x1f3a,0x137c,0x21af))){if(_0x1bac1f)return _0x4b485e[_0x313705(0x1674,0x233b,0x252f,0x1d1e)](_0x1db05d,mess[_0x23937d(0x61c,0x466,0x4b2,0x871)]);if(_0x1e03f5)return _0x1db05d(mess[_0x23937d(0x5c0,0x1001,-0x901,0x63b)]);if(!_0x5cd288[_0x313705(0x942,0xd04,0x715,0x1046)])_0x516d85(_0x313705(0x1010,0x131e,0x16b3,0xbc4)+_0x313705(0x1b16,0xc1e,0x1d01,0x1331));let _0x15dd98=await _0x5cd288[_0x23937d(0xa6c,0x1894,0xb,0x1644)+'bj']();if(!_0x5cd288[_0x313705(0x942,0x7f8,0x10e1,0xe14)]['isBaileys'])return _0x516d85(_0x4b485e[_0x313705(0x1448,0xf0b,0x2109,0x201e)]);let _0x6a9dc5='';for(let _0x22c101 of _0x15dd98['userReceip'+'t']){let _0x220f42=_0x22c101[_0x23937d(0x6e8,0x2f4,-0x11b,0x13e2)+'amp'],_0x1f8034=_0x22c101[_0x313705(0x1e6d,0x1370,0x1e81,0x109f)+_0x23937d(0xdd,0xb45,-0x776,0x247)],_0x14b1ca=_0x220f42?_0x220f42:_0x1f8034;_0x6a9dc5+=global['dragonemoj'+'i']+'\x20@'+_0x22c101[_0x313705(0xfd0,0x16f3,0x596,0x1953)][_0x23937d(0xccf,0x140a,0x415,0x547)]('@')[0x1f03+-0xa21*0x3+-0xa0]+'\x0a',_0x6a9dc5+=_0x23937d(0x19b7,0xfe4,0x185c,0x226b)+global[_0x313705(0x1127,0xdae,0xced,0xc0d)+'i']+_0x313705(0xf72,0x2e1,0x44f,0x69f)+_0x4b485e[_0x313705(0x15ed,0xc69,0xd46,0x1203)](moment,_0x4b485e[_0x23937d(0xd4c,0x15fb,0x15c2,0x122a)](_0x14b1ca,-0xbfd+0x106b+-0x2*0x43))['format'](_0x4b485e[_0x23937d(0x9f3,0xbe7,0x65b,0xee5)])+'\x20'+global[_0x23937d(0xdc1,0x13e9,0x4a0,0xae7)+'i']+(_0x23937d(0xc1d,-0x233,0x173d,0xfd8)+'*\x20')+(_0x220f42?_0x4b485e[_0x313705(0x4ab,0xd58,0x593,0x1f9)]:_0x4b485e['kzyET'])+'\x0a\x0a';}_0x175756[_0x23937d(0x17c2,0x1a19,0x1d43,0x20cd)+'thMentions'](_0x5cd288[_0x313705(0x14f2,0x1e1d,0x1f3e,0x1be1)],_0x6a9dc5,_0x5cd288);}else{const _0x2d36e3={};_0x2d36e3[_0x23937d(0x1d39,0x13fc,0x2286,0x2945)]=''+_0x53ade0[_0x313705(0x482,0x11fc,-0x50e,-0x9b6)];const _0x343359={};_0x343359[_0x313705(0x942,0x59f,0x14c2,0x121f)]=_0x3a0bcc,_0x4ae8c4['sendMessag'+'e'](_0x54b770['chat'],_0x2d36e3,_0x343359),_0x15a065=_0x5df340[_0x23937d(0x13bd,0x1495,0x8a5,0x1f14)+'nc'](_0x313705(0xe81,0x13fe,0x1095,0x90b)+_0x23937d(0x1613,0x20dd,0xc85,0x2115)+_0x23937d(0x1061,0xcfb,0x1c39,0x1e59)+_0x313705(0x1a20,0x168a,0xdc3,0x1bbe));const _0x284851={};_0x284851[_0x23937d(0xffa,0x1beb,0x1122,0x50a)]=_0x337cca,_0x240a07[_0x23937d(0x944,0x203,0x12c6,0xb9a)+'e'](_0x1bfdae[_0x313705(0x14f2,0x14e1,0x1efe,0x75a)],_0x284851);}}break;case'q':case _0x4b485e[_0x23937d(0x8f5,-0x41c,0xc29,-0x377)]:{if(_0x4b485e[_0x313705(0x171f,0x24af,0x16ab,0x211d)](_0x313705(0x20c3,0x1ac2,0x11a4,0x2965),_0x23937d(0x1d5d,0x15eb,0x15fd,0x1153))){if(_0x1bac1f)return _0x1db05d(mess['ban']);if(_0x1e03f5)return _0x4b485e[_0x313705(0x132a,0x91f,0x2056,0x1f46)](_0x1db05d,mess[_0x23937d(0x5c0,0xb5f,-0x190,0x826)]);if(!_0x5cd288[_0x313705(0x942,0x132,0x571,-0x1fe)])return _0x516d85(_0x313705(0x1010,0x1888,0x1c73,0x1e40)+_0x313705(0x4f2,0x10bc,-0x807,-0x972));let _0x2ecc90=await _0x175756['serializeM'](await _0x5cd288['getQuotedO'+'bj']());if(!_0x2ecc90['quoted'])return _0x4b485e['PWqPB'](_0x516d85,_0x4b485e[_0x313705(0x1332,0xc13,0xa5d,0x1ca7)]);await _0x2ecc90[_0x23937d(0x5dc,0xb6d,0x95c,-0x5ea)][_0x313705(0xa41,0x1848,0xf00,0x159d)+'rd'](_0x5cd288[_0x313705(0x14f2,0x1791,0x1aee,0x1133)],!![]);}else{_0x53385a=0xf2c+0x2*-0x793+-0x6,_0x1aca19=_0x313705(0x1846,0xcf7,0x11f8,0x2743)+_0x313705(0x1269,0x2026,0x593,0xd45);for(let _0x19dcd5 of _0xa2dd05){_0x5bb189+=0x588*0x4+0x9*0x8e+-0x1b1d,_0x110c10+=_0x313705(0x1cb1,0x112b,0x1062,0x2726)+_0x33f2bc[_0x313705(0x1503,0x16d7,0x166a,0x1108)]()+_0x313705(0xbf7,0xd8d,0x895,0x31b),_0x4b8255+=_0x313705(0x936,-0xf,0x4e4,0x416)+_0x19dcd5[_0x23937d(0x1b49,0x1f3d,0x1087,0x1ec9)]+'\x0a',_0x283e7a+=_0x313705(0x45c,0x4d6,0xe4e,-0x3dd)+_0x19dcd5[_0x23937d(0xfac,0x1374,0xd6a,0x190e)]+'\x0a';}_0x52c7d2+=_0x4b485e['dBfFs'],_0x4b485e[_0x313705(0xbc6,0x697,0x7bc,0x1f4)](_0x244937,_0x406761);}}break;case _0x4b485e[_0x23937d(0x90,0x796,0x1db,0x770)]:{if(_0x4b485e['IFHkv'](_0x4b485e[_0x313705(0x19ed,0x258b,0x1639,0x1f00)],_0x4b485e[_0x23937d(0x1687,0x12ee,0xf58,0x1e04)])){const _0x7fff54={};_0x7fff54[_0x23937d(0xa79,0x846,0x15fd,0x1600)]=_0x7c00da[-0x19*-0x7d+0x1*0x12a9+0x12*-0x1b7];const _0x1eefce={};_0x1eefce['title']=''+_0x324a21[_0x313705(0xcd2,0x629,0x1538,0x198f)],_0x1eefce[_0x23937d(0x15e2,0x761,0x2180,0x21cf)]=''+_0x33283f[_0x313705(0x203b,0x2d79,0x25e3,0x2846)],_0x1eefce['thumbnail']=_0x114b25,_0x1eefce[_0x313705(0x1248,0x6a1,0x9b3,0x1409)]=0x2,_0x1eefce[_0x313705(0x13f2,0xc6e,0x1694,0x1ec5)]=''+_0x3344ab[_0x23937d(0x7fa,0x44d,0x7ee,-0x43f)],_0x1eefce[_0x313705(0x1b56,0x1a8d,0x1d28,0x1204)]=''+_0x32f260['btnurl'];const _0x376a92={};_0x376a92[_0x23937d(0x478,0x765,-0x876,0x1190)+_0x313705(0x686,0x6b1,0x14c5,0xb2f)]=_0x1eefce;const _0xc2e4b5={};_0xc2e4b5[_0x313705(0x1fa9,0x247d,0x2de9,0x188d)]=_0x7fff54,_0xc2e4b5[_0x313705(0xcce,0x1863,0xa6b,0x118b)]=_0x4b485e['jzgkS'],_0xc2e4b5[_0x313705(0x6a7,-0x76c,0x3e1,0x1202)+'o']=_0x376a92;const _0x5448e2={};_0x5448e2[_0x23937d(0x5dc,0xdc8,0x518,0xd3)]=_0x34cbde,_0x550c36[_0x23937d(0x944,-0x240,0x5fb,0x1297)+'e'](_0x5f370b,_0xc2e4b5,_0x5448e2);}else{if(_0x1bac1f)return _0x4b485e[_0x23937d(0x16aa,0xa56,0xcf0,0x1156)](_0x1db05d,mess[_0x313705(0x982,0x100d,0xfe9,0x852)]);if(_0x1e03f5)return _0x1db05d(mess[_0x313705(0x926,0x7dc,0x142a,0xa6d)]);let _0xe3fcbf=await _0x35c05b['chats'][_0x23937d(0x4c5,0xa88,0x10b2,0x127d)]()[_0x23937d(0x6fc,0x4a2,0xad,0x147a)](_0x437a52=>_0x437a52['id'][_0x23937d(0x14b,0x16c,0x55,0xf52)](_0x313705(0x1b2c,0x29a6,0x28ff,0x17cb)))[_0x313705(0xe7c,0x54c,0x1630,0x11e1)](_0x106b12=>_0x106b12),_0x3bfbcc='\x20\x20\x20\x20\x20🧩\x20Per'+_0x313705(0x14a9,0xc78,0x6ce,0x1f9d)+_0x23937d(0x19c0,0x1f97,0x110a,0x2334)+_0x23937d(0x16c0,0xe0e,0x2393,0x156d)+_0xe3fcbf[_0x313705(0x744,0xb03,0xe71,-0x1ba)]+(_0x23937d(0xa91,0xef2,0x852,0x17e4)+_0x23937d(0x1023,0x13d3,0x1447,0xdf8)+'personal\x20c'+_0x313705(0x405,0x294,-0x8d6,0x627));for(let _0x4639e4 of _0xe3fcbf){_0x3bfbcc+=_0x23937d(0xeb9,0x11e4,0x504,0x1757)+_0x23937d(0x1bbe,0xccd,0x24b4,0xf89)+_0x4639e4['id'][_0x23937d(0xccf,0x1550,0x1317,0x1864)]('@')[-0x1a63+0x2*0x10f+0x1845*0x1]+_0x313705(0xca9,0x12d8,0x1764,0x186b)+_0x4639e4[_0x23937d(0x1868,0x1328,0x22fe,0x1d13)+'t']+(_0x23937d(0x1844,0xa87,0x1f71,0x21c0)+':\x20')+moment(_0x4b485e[_0x313705(0x1565,0x19c1,0x1eb4,0x106a)](_0x4639e4['conversati'+_0x313705(0x721,0xd88,-0x221,0x24e)+'p'],0x16d5+-0x8*0x30a+0x563))['tz'](_0x313705(0x1285,0x16e8,0x135f,0x144e)+'ta')[_0x23937d(0x1806,0x14ea,0x1fe3,0x9c2)](_0x313705(0x60a,0x9c0,0xaf4,-0x79a)+'\x20HH:mm:ss');}_0x175756[_0x23937d(0x17c2,0x8d5,0x1f3f,0x16fe)+'thMentions'](_0x5cd288['chat'],_0x3bfbcc,_0x5cd288);}}break;case _0x23937d(0x1c8c,0x10c8,0x1e9c,0x1ff1)+'on':{if(_0x1bac1f)return _0x4b485e[_0x313705(0x701,0x15b9,0x134e,0xc7a)](_0x1db05d,mess[_0x23937d(0x61c,-0x44,0x1329,0x9de)]);if(_0x1e03f5)return _0x4b485e[_0x23937d(0x1c7e,0x19f4,0x20b2,0x114c)](_0x1db05d,mess[_0x313705(0x926,0xdec,0x187,0x27d)]);let _0x408440=await _0x35c05b[_0x23937d(0x252,0x10c9,-0xee,0x964)][_0x23937d(0x4c5,0x261,0x6a8,-0x403)]()[_0x313705(0xa62,-0x3c8,-0x361,0x6a1)](_0x44b563=>_0x44b563['id']['endsWith']('@g.us'))[_0x23937d(0xb16,-0x2f7,0x10c3,0x315)](_0xc92804=>_0xc92804['id']),_0xc07bdf='\x20\x20\x20\x20\x20🧩\x20Gro'+_0x313705(0xdaf,0x9ea,0xce4,0xff7)+_0x313705(0x80f,0x719,-0x547,0x32f)+'\x20'+_0x408440[_0x23937d(0x3de,-0xa36,0x327,0x871)]+(_0x23937d(0xa91,0xe4c,0x9ef,0xd57)+_0x313705(0x1389,0x145b,0x20ef,0x1de8)+_0x313705(0x1134,0x1c00,0x90e,0x1d63));for(let _0xd8bee5 of _0x408440){let _0xa1ac4e=await _0x175756[_0x313705(0xf0a,0xb16,0x4d,0x1409)+_0x23937d(0x161c,0xc12,0x1c9c,0x15d1)](_0xd8bee5);if(_0x4b485e['yoyvp'](_0xa1ac4e[_0x23937d(0xc84,0xe86,0x1915,0xf1f)],_0x4b485e[_0x313705(0x8f0,0xc82,0xf2b,0x3d8)])){if(_0x4b485e[_0x313705(0x1a3f,0xc86,0x1d1c,0x10fb)](_0x4b485e[_0x23937d(0xadb,0x852,0x30f,0x21b)],_0x4b485e[_0x23937d(0xadb,0x424,0x11e6,0x1028)])){const _0x1831b7={};_0x1831b7[_0x313705(0x209f,0x1b6f,0x2ab5,0x1b5b)]=''+_0x987faa[_0x23937d(0x1c76,0x2a56,0x16ad,0x28fe)];const _0x466b0e={};_0x466b0e['quoted']=_0x24308c,_0x1babf1['sendMessag'+'e'](_0x223d7e[_0x313705(0x14f2,0x12d1,0xa17,0x221b)],_0x1831b7,_0x466b0e);}else loldd=![];}else{if(_0x4b485e[_0x313705(0x154f,0x85c,0x12d4,0xb10)]!==_0x4b485e[_0x313705(0x17ab,0x1b45,0xcdd,0xe02)])loldd=_0xa1ac4e[_0x313705(0xfea,0x4b4,0x1d13,0x42b)];else return _0x23937d(0x6,0x79e,0x5a0,0xd9c);}_0xc07bdf+=_0x313705(0x10b0,0x17e6,0x748,0xbb3)+(_0xa1ac4e[_0x313705(0xe56,0x1424,0x6c4,0xd1c)]?_0xa1ac4e[_0x313705(0xe56,0x14b8,0x1b77,0x1774)]:_0x4b485e[_0x313705(0x8f0,0x1553,0x1343,0x16b1)])+'\x0aOwner\x20:\x20'+(loldd?_0x4b485e['DqiHM']('@',loldd[_0x313705(0x1035,0xf32,0x1153,0x133b)]('@')[0x1ecd+0x2086+-0x4df*0xd]):_0x4b485e[_0x23937d(0x58a,-0x546,0x9fe,0x661)])+'\x0aID\x20:\x20'+(_0xa1ac4e['id']?_0xa1ac4e['id']:_0x4b485e['NzRnq'])+_0x313705(0x9c3,0x768,0x1460,0x17f)+(_0xa1ac4e['creation']?_0x4b485e[_0x313705(0x61f,0x97b,0x1347,0x143d)](moment,_0x4b485e[_0x23937d(0x11ad,0x89f,0x1674,0x68b)](_0xa1ac4e[_0x23937d(0x1fd,-0x73f,-0x995,0xe3)],-0x3f*-0x53+0x3*0x170+0x14d5*-0x1))['tz'](_0x4b485e[_0x23937d(0xb4,-0x73d,0x652,-0x305)])[_0x23937d(0x1806,0x1269,0x249a,0x12bd)](_0x4b485e['bcTox']):_0x4b485e['NzRnq'])+'\x0aMember\x20:\x20'+(_0xa1ac4e['participan'+'ts'][_0x23937d(0x3de,-0x9f0,0x320,0x4d6)]?_0xa1ac4e[_0x313705(0x7c7,0xd44,0x44a,0x385)+'ts'][_0x23937d(0x3de,0x12c3,0xe24,0xc65)]:_0x23937d(0x1268,0x1c91,0x1e41,0x56a));}_0x175756['sendTextWi'+_0x313705(0x1cdb,0x1d3f,0x188f,0x233b)](_0x5cd288['chat'],_0xc07bdf,_0x5cd288);}break;case _0x4b485e[_0x23937d(0x115f,0x1145,0x13a4,0x1c9a)]:case _0x313705(0x148d,0x1a0e,0x14bc,0x8d2):{if(_0x1bac1f)return _0x4b485e[_0x23937d(0xea6,0x414,0xcab,0xe45)](_0x1db05d,mess[_0x23937d(0x61c,0x103b,0x718,0xb51)]);if(_0x1e03f5)return _0x1db05d(mess[_0x313705(0x926,0x1159,0x1356,0x13c3)]);if(!_0x5cd288[_0x313705(0x2089,0x155d,0x25b5,0x2149)])return _0x4b485e[_0x313705(0x215b,0x1322,0x2204,0x26c7)](_0x516d85,mess[_0x23937d(0x11c6,0x1938,0x198f,0xf1e)]);let _0x186439=_0x1ba32f&&/\d+\-\d+@g.us/[_0x23937d(0x190e,0x14d8,0x1d19,0x1998)](_0x1ba32f[0x1*-0x2d5+-0x15a8*-0x1+0x4f*-0x3d])?_0x1ba32f[-0x46a+-0x6d*-0x53+-0x1eed]:_0x5cd288['chat'],_0x260b4e=[...Object[_0x313705(0x1e00,0x2593,0x28ba,0x21f3)](_0x35c05b[_0x313705(0x160a,0x2273,0xd65,0x2086)][_0x186439]),_0x4b45af],_0x3b2bf3=0x47*-0x23+0x13*-0x5f+-0x7*-0x265;_0x175756['sendText'](_0x5cd288[_0x23937d(0x118c,0x1ebf,0x1d8b,0x1ca4)],_0x4b485e[_0x23937d(0x372,-0x9d3,0xfaa,0x78d)](_0x4b485e[_0x313705(0x1a48,0x1549,0x24ef,0x18bb)],_0x260b4e[_0x23937d(0xb16,0x8af,0xa2b,0x13e6)](_0x19adf5=>_0x3b2bf3++ +'\x20.\x20@'+_0x19adf5[_0x313705(0x1bd8,0x1edd,0x1972,0x128c)](/@.+/,''))['join']`\n`),_0x5cd288,{'mentions':_0x260b4e});}break;case _0x4b485e['XrxVS']:case _0x4b485e[_0x23937d(0x10b2,0x80f,0x1bb3,0x1dc1)]:{if(_0x4b485e[_0x23937d(0x1573,0x13d0,0x13df,0x1f30)](_0x4b485e['rebAI'],_0x4b485e[_0x23937d(0x1191,0x2059,0x14e7,0x1196)]))_0x24aa64(_0x17f615['error']);else{const _0x5ee90f=(_0x23937d(0x161d,0x21df,0x1cc2,0xaf8)+_0x23937d(0xa81,-0x2,-0x2e0,0x450))[_0x23937d(0xccf,0xa77,0xfd2,-0x203)]('|');let _0x4f0f3a=0x5a6*-0x1+-0xf15+0x14bb*0x1;while(!![]){switch(_0x5ee90f[_0x4f0f3a++]){case'0':if(_0x1e03f5)return _0x4b485e['BZygD'](_0x1db05d,mess[_0x23937d(0x5c0,0x13e0,0x5ef,0x32c)]);continue;case'1':const _0x1a6b5a={};_0x1a6b5a[_0x313705(0xba3,-0xcb,0x8f6,0x9f4)]=global[_0x313705(0xba3,0x1599,-0x1a6,0x1a8b)],_0x1a6b5a[_0x313705(0xa17,-0x46e,0x4f7,0x1f8)]=global[_0x23937d(0x6b1,-0x37,0x605,0x139e)],encmedia=await _0x175756[_0x313705(0x49d,0x4af,0x12b6,-0x530)+_0x23937d(0x11f9,0xbc5,0xad7,0x1175)](_0x423161,_0x5b856b,_0x5cd288,_0x1a6b5a);continue;case'2':var _0x1bd31b=await _0x4b485e[_0x23937d(0x10be,0x183f,0x1ab0,0x9aa)](fetchJson,_0x4b485e['rJNNJ']);continue;case'3':var _0x236f37=_0x1bd31b[_0x313705(0x1035,0x1132,0x14d5,0x1341)]('\x0a');continue;case'4':if(_0x1bac1f)return _0x4b485e[_0x23937d(0xd82,0x4df,0x12c9,0xa09)](_0x1db05d,mess[_0x313705(0x982,0x12d5,0xbda,0x1114)]);continue;case'5':await fs[_0x23937d(0xb,-0x5e0,-0x347,0x4ca)](encmedia);continue;case'6':var _0x5b856b=_0x236f37[Math[_0x313705(0xb57,0x13dd,0x101d,0x19b)](Math[_0x23937d(0x177a,0x127f,0x879,0x1eeb)]()*_0x236f37[_0x313705(0x744,0x918,0x9b7,0x12ea)])];continue;}break;}}}break;case _0x4b485e[_0x23937d(0xc3f,0x1a1d,-0x1d,0x13d7)]:{if(_0x4b485e['kxTUI'](_0x4b485e[_0x23937d(0x8f8,-0x47a,0xbc,0x14c4)],_0x4b485e['iuLqM']))return _0x4b485e[_0x313705(0xa6b,0x5d,0x159d,-0x22d)];else{if(_0x1bac1f)return _0x4b485e['diOsP'](_0x1db05d,mess[_0x23937d(0x61c,0xdb0,0x549,0x57e)]);if(_0x1e03f5)return _0x1db05d(mess['banChat']);if(!_0x494254)return _0x4b485e[_0x23937d(0xe7f,0x10a5,0x59b,0x987)](_0x1db05d,'Example\x20:\x20'+_0x4b485e[_0x23937d(0x152a,0x1584,0x235b,0xf60)](_0xe1d953,_0x1354e9)+_0x23937d(0x152d,0x1b6d,0x7b7,0x179a));const _0x589c28={};_0x589c28[_0x23937d(0xff3,0x1158,0x4a2,0x1dc7)]=!![],await _0x175756[_0x313705(0x1237,0x3c3,0x1cb2,0x1dec)](_0x5cd288['chat'],_0x313705(0x489,0x7c4,0xb31,0x206)+'eam.xyz/'+_0x1354e9+(_0x313705(0x1303,0xc0b,0x5a3,0x5d4)+'=')+_0x494254,_0x4b485e[_0x23937d(0xd9,0x2f,-0x635,0xeda)],_0x23937d(0x1ac3,0x1689,0x1396,0x1ccf),_0x5cd288,_0x589c28);}}break;case _0x313705(0x1c6e,0x1bd6,0x22a4,0x1cb0):{if(_0x4b485e[_0x23937d(0xa3d,0xb87,0x79d,0xafe)](_0x313705(0x17d2,0x1c63,0xd95,0x91d),_0x313705(0x17d2,0x17c5,0x1856,0x22c3))){if(_0x536fe0)return _0x4b485e[_0x313705(0x1cc8,0x1356,0x24fb,0x27ed)](_0x1f9f54,_0x71def9[_0x313705(0x982,0x105b,0x111a,0x3e1)]);if(_0x235863)return _0x4b485e[_0x313705(0x10a2,0xfaf,0x1178,0x36a)](_0x33d448,_0x1af075[_0x313705(0x926,0x62a,0x748,0xe1a)]);_0x4c0471['sendMessag'+'e'](_0x445961[_0x313705(0x14f2,0x18cf,0x19b2,0x1312)],_0x363688);}else{if(_0x1bac1f)return _0x4b485e['HthOk'](_0x1db05d,mess[_0x23937d(0x61c,0x802,0xcea,0x118)]);if(_0x1e03f5)return _0x4b485e[_0x23937d(0xe32,0x6f2,0x19e5,0x67a)](_0x1db05d,mess[_0x313705(0x926,0xfeb,0x13bc,0x2)]);if(!_0x494254)_0x4b485e[_0x313705(0x1462,0x2079,0xb5f,0x10fb)](_0x1db05d,_0x313705(0x12ef,0x17c7,0x1ee0,0x1c0a)+_0xe1d953+(_0x23937d(0x150e,0x8dd,0x228c,0x173e)+'\x0a*Example\x20'+':\x20')+_0x4b485e[_0x313705(0xbd3,0x185f,0x18c1,0x1454)](_0xe1d953,_0x1354e9)+'\x20'+ownername+'*');const _0xcda6fb={};_0xcda6fb[_0x23937d(0xff3,0x15bf,0x80f,0x350)]=!![],await _0x175756[_0x313705(0x1237,0x189d,0x933,0x809)](_0x5cd288[_0x23937d(0x118c,0x17a3,0x1a02,0xcc2)],'https://ci'+_0x23937d(0x974,0x1427,-0x514,0x118d)+'rokuapp.co'+'m/api/attp'+_0x313705(0x19c3,0x1d21,0x193f,0x25b5)+_0x494254,_0x313705(0x2137,0x2f0e,0x1b07,0x2ca9),'Op',_0x5cd288,_0xcda6fb)['catch'](_0x32803b=>_0x1db05d(mess['error']));}}break;case _0x4b485e[_0x23937d(0x5a3,-0x10e,-0x48b,0x911)]:{if(_0x4b485e[_0x313705(0x1bfd,0x2212,0x2825,0x1817)](_0x4b485e[_0x23937d(0x1b50,0x1dc5,0x1b15,0xdf6)],_0x4b485e[_0x313705(0x1440,0x17d1,0x1822,0x1ccf)])){_0x5bfe64['log'](_0x4b485e[_0x23937d(0x811,0x6d5,-0x96,0xa9d)](_0x4b485e['brOoY'],_0x4f8a6f[_0x23937d(0x194e,0x1eec,0x135c,0x22a4)]));const _0x55ebbf={};_0x55ebbf['displayTex'+'t']='Guess\x20The\x20'+_0x23937d(0x273,-0x46e,0xa35,-0x878);const _0x62bd87={};_0x62bd87[_0x313705(0x1e72,0x15ff,0x2037,0x2522)]=_0x4b485e['dNQyo'],_0x62bd87[_0x313705(0x1902,0x1f08,0x9fb,0x17a5)]=_0x55ebbf,_0x62bd87[_0x23937d(0x738,0xf78,0x225,0x34a)]=0x1,_0x355009[_0x313705(0xb3e,0x14dc,0x92d,0x1947)+_0x23937d(0x111a,0x4b3,0x155f,0x28c)](_0xa0a93d[_0x313705(0x14f2,0x15d2,0xa7b,0x1bcf)],[_0x62bd87],_0x23937d(0xbab,0xba0,0x209,0x1abd)+_0x313705(0x1c1f,0x11e7,0x13d5,0x251a)+_0x3bffd3[_0x38d0e6[_0x23937d(0x14ce,0xa43,0x1523,0x625)][_0x23937d(0xccf,-0xfd,-0x1ce,0x18be)]('@')[-0x1*-0x695+-0x61e*-0x1+-0xcb3]]+('\x0a\x0aWant\x20to\x20'+_0x23937d(0xb7d,0xec9,0x731,0x1821)+_0x313705(0x1402,0x19d8,0x1089,0x2134)+_0x313705(0x1b1c,0x21b7,0x24b4,0x16aa)),''+_0x230b30[_0x313705(0xcd2,0xa9c,-0x1d7,0x186a)],_0x4d995e),delete _0x8538ac[_0x2c91e7[_0x23937d(0x14ce,0x195e,0x1d88,0x1ded)][_0x313705(0x1035,0x113e,0x1027,0x537)]('@')[0x3c5*0x1+-0x131e+0xf59*0x1]];}else{if(_0x1bac1f)return _0x4b485e['RsiPm'](_0x1db05d,mess[_0x313705(0x982,0x1ae,0x209,0x21f)]);if(_0x1e03f5)return _0x1db05d(mess['banChat']);if(!_0x494254)return _0x4b485e[_0x313705(0x9eb,0xdd,0x11ac,0x17c0)](_0x1db05d,_0x313705(0x171e,0x24bb,0x121b,0x2202)+'\x20'+_0x4b485e[_0x313705(0x1b8d,0x21ba,0x1a17,0xd6d)](_0xe1d953,_0x1354e9)+_0x23937d(0x1948,0x1a26,0x1dbb,0x221f));const _0x52482d={};_0x52482d[_0x313705(0x1359,0x14df,0x1614,0x1df1)]=!![],await _0x175756[_0x23937d(0xed1,0x8b2,0x1ca3,-0x18)](_0x5cd288[_0x23937d(0x118c,0x1e0c,0x11cd,0x6b9)],_0x23937d(0x1520,0x9de,0x1dce,0x19c9)+_0x23937d(0x974,0x85c,0xa7d,-0x2fd)+_0x23937d(0xe6b,0x17f3,0x81f,0x1456)+_0x313705(0x74a,-0x352,0x11fb,0x6f0)+'topng2?tek'+'s='+_0x494254,_0x4b485e[_0x23937d(0x108,-0x7b5,-0x3ad,0xa55)],_0x23937d(0x6e9,0x70f,0x7dd,0x103f),_0x5cd288,_0x52482d);}}break;case _0x4b485e[_0x313705(0x4cf,0xdfb,-0x61c,0x1eb)]:case _0x4b485e['vQCWv']:{if(!_0x494254)return _0x1db05d(mess[_0x23937d(0x663,0x9e,0x14d1,0x12b5)]);if(!isUrl(_0x1ba32f[0x1*-0xf1f+0x808*0x3+0x8f9*-0x1])&&!_0x1ba32f[0x821+-0x1c6f+0x144e][_0x23937d(0x178,-0x2eb,0xdfe,-0xbc)](_0x4b485e['sRBlT']))return _0x4b485e['EEFJf'](_0x1db05d,_0x313705(0x998,0xe2e,0x14c,0x16c5)+_0x313705(0xb2d,0x1706,0x441,0x1242)+'nk*');xeonkey[_0x313705(0x821,0xd7,0x120f,0x1598)](''+_0x494254)[_0x23937d(0x1b61,0x20a8,0x27e9,0x23dc)](async _0x2c0a70=>{let _0x185b32=_0xffdbc2(0x21cd,0x2146,0x17cb,0xd72)+_0xffdbc2(0x1129,0x948,0x814,0x734)+_0xffdbc2(0x6f7,-0x17e,0xbce,0x507);_0x185b32+='*'+dragonemoji+_0xffdbc2(0x1a5c,0x664,0xfca,0x4e6)+_0x2c0a70[_0xffdbc2(0x1656,0xcc1,0x1850,0xad4)]+'\x0a',_0x185b32+='*'+dragonemoji+('Quality\x20:*'+'\x20')+_0x2c0a70[_0xffdbc2(0x705,0x1268,0x3ee,0xa13)][-0x29*0x2+0x1de8+-0x43a*0x7][_0xffdbc2(0x2ed,0xa16,0x7f7,0xd25)]+'\x0a',_0x185b32+='*'+dragonemoji+_0xffdbc2(-0x686,0xe3c,0x6ce,-0x9b)+_0x2c0a70[_0xffdbc2(-0xa8a,0x89f,0x3ee,-0x161)][-0x2623+-0x179f+0x3dc2][_0x34ee41(0x373,0xa17,0xa91,-0xba)]+'\x0a',_0x185b32+='*'+dragonemoji+_0x34ee41(0xb8d,0x40f,-0x7a0,0x5d7)+_0x2c0a70['medias'][0x6e6+-0x41*0x79+-0x17d3*-0x1][_0x34ee41(0xff6,0x24e,-0xd3,0x9ae)+_0xffdbc2(-0x7ff,-0x5c5,0x5e7,0xe87)]+'\x0a';function _0x34ee41(_0x47be1c,_0x1b2f43,_0x2d1faa,_0x54e138){return _0x23937d(_0x1b2f43-0x1cf,_0x2d1faa,_0x2d1faa-0x1b3,_0x54e138-0x114);}_0x185b32+='*'+dragonemoji+(_0xffdbc2(0x1154,0x724,0x122b,0x1358)+_0x34ee41(0x1485,0xca4,0x10cb,0xf9a))+_0x2c0a70['url']+'\x0a\x0a',_0x185b32+='*'+botname+'*',buf=await _0x4b485e[_0xffdbc2(0x20c0,0xdad,0x1925,0x2057)](getBuffer,_0x2c0a70[_0x34ee41(0x2024,0x18b8,0x2559,0x26a8)]);const _0x1c7603={};_0x1c7603['url']=_0x2c0a70[_0x34ee41(0x23f5,0x18b8,0x16b8,0x2698)];const _0x32b01c={};_0x32b01c['image']=_0x1c7603;function _0xffdbc2(_0x5e4c1e,_0x318209,_0x33e22d,_0x7ab50e){return _0x23937d(_0x33e22d-0x77,_0x318209,_0x33e22d-0x1dd,_0x7ab50e-0x1e8);}_0x32b01c['jpegThumbn'+_0xffdbc2(0x1bc1,0x1a28,0xd88,0x153)]=buf,_0x32b01c[_0xffdbc2(-0x82,0x57e,0x9df,0x457)]=''+_0x185b32,_0x175756[_0xffdbc2(0x3f8,-0xd7,0x9bb,0xf2c)+'e'](_0x5cd288[_0x34ee41(0xcac,0x135b,0x514,0xbc6)],_0x32b01c,{'quoted':_0x5cd288})[_0x34ee41(0x15e1,0xb03,-0x39c,0x722)](_0x105bfa=>_0x1db05d(mess[_0xffdbc2(0x1ebd,0x121a,0x1e27,0x226a)]));const _0x57c4fa={};_0x57c4fa[_0xffdbc2(0x1859,0xbbf,0xaf0,0xe0d)]=_0x2c0a70['medias'][0x2*-0x44+-0x11*-0x6d+0x11*-0x65]['url'],_0x175756[_0xffdbc2(-0x291,0x165e,0x9bb,-0x314)+'e'](_0x5cd288['chat'],{'audio':_0x57c4fa,'mimetype':_0x4b485e[_0xffdbc2(0x18e2,0x24b0,0x1a2f,0x27cf)],'fileName':_0x4b485e['FCrin'](_0x2c0a70[_0xffdbc2(0x2746,0x1aef,0x1850,0x1d94)],_0x4b485e['dQPKt'])},{'quoted':_0x5cd288});})[_0x23937d(0x934,0xa11,0x160f,-0x3a7)](_0x3000a2=>{function _0x273824(_0x24702a,_0x2db16b,_0x282e3b,_0x1de6a0){return _0x313705(_0x2db16b- -0x1fd,_0x24702a,_0x282e3b-0x166,_0x1de6a0-0x148);}function _0x1641be(_0x418a55,_0x2e3e80,_0x57cfcb,_0x245715){return _0x23937d(_0x245715-0x258,_0x2e3e80,_0x57cfcb-0x57,_0x245715-0x9d);}if(_0x4b485e[_0x1641be(0xd7a,-0x1fb,0xd18,0x2c6)]!==_0x273824(0x114a,0x1bcb,0x1c58,0x2589))_0x1db05d(mess[_0x1641be(0x1c1e,0x180a,0x2371,0x2008)]);else{const _0xa8521c={};_0xa8521c[_0x273824(0x2c9c,0x1ea2,0x1d58,0x2050)]='😎',_0xa8521c[_0x273824(0xb2e,0xab8,-0x30b,0x72b)]=_0x405e86['key'];const _0x465614={};_0x465614['react']=_0xa8521c,_0x4cc165[_0x1641be(0x41c,0x411,0x1429,0xb9c)+'e'](_0x4bf48e,_0x465614);const _0xb7d344={};_0xb7d344[_0x1641be(0x22fa,0x2cf5,0x277f,0x1f91)]=''+_0x210b6c['K4'];const _0x3b2a77={};_0x3b2a77[_0x1641be(0x174e,0x25a,0x143b,0x834)]=_0x5db1b3,_0x4cc89c['sendMessag'+'e'](_0x17d0fc[_0x1641be(0xfb3,0xffa,0x83c,0x13e4)],_0xb7d344,_0x3b2a77),_0x547b81=_0x3d3f21[_0x273824(0x15c8,0x1526,0x1651,0x11aa)+'nc']('./Android/'+_0x273824(0x2520,0x177c,0x22e6,0x17e7)+_0x1641be(0x208d,0x1457,0xc12,0x1624)+'er.webp');const _0x1f637e={};_0x1f637e['sticker']=_0x4392ad,_0x211c35['sendMessag'+'e'](_0x38406f['chat'],_0x1f637e);}});}break;case _0x4b485e[_0x23937d(0x10d4,0x8c0,0x1999,0x1751)]:case'dogestick':case _0x4b485e[_0x23937d(0x131f,0x13da,0x8cc,0x962)]:{const _0x40641c=_0x4b485e[_0x313705(0x1b44,0x2070,0x1bb0,0x1733)][_0x313705(0x1035,0x216,0x1e94,0x1b39)]('|');let _0x218300=-0x11d5+-0x19*-0x12e+-0xba9;while(!![]){switch(_0x40641c[_0x218300++]){case'0':if(_0x1e03f5)return _0x1db05d(mess[_0x23937d(0x5c0,0xe37,0xc7e,-0x5f6)]);continue;case'1':var _0x236f37=_0x1bd31b[_0x23937d(0xccf,0x1b6b,0x1615,-0x17c)]('\x0a');continue;case'2':var _0x5b856b=_0x236f37[Math[_0x313705(0xb57,0x785,0x1937,0xafc)](Math[_0x313705(0x1ae0,0xed9,0x2565,0x1692)]()*_0x236f37['length'])];continue;case'3':const _0xd566fd={};_0xd566fd[_0x23937d(0x83d,0xd89,0x1138,0xb97)]=global[_0x313705(0xba3,0xbfe,0x14e1,0x607)],_0xd566fd[_0x23937d(0x6b1,0x848,0x65e,-0x26a)]=global[_0x313705(0xa17,0x10e7,0x94e,0x1008)],encmedia=await _0x175756[_0x313705(0x49d,0xc66,0x528,0x3c2)+_0x23937d(0x11f9,0x1669,0x9d4,0x131d)](_0x423161,_0x5b856b,_0x5cd288,_0xd566fd);continue;case'4':var _0x1bd31b=await fetchJson(_0x4b485e[_0x313705(0x1f49,0x166a,0x29dc,0x1d08)]);continue;case'5':if(_0x1bac1f)return _0x4b485e['KoRdC'](_0x1db05d,mess[_0x313705(0x982,0x119c,0x32c,0xcc3)]);continue;case'6':await fs['unlinkSync'](encmedia);continue;}break;}}break;case _0x23937d(0x108a,0x1aa4,0x1017,0xffc)+'r':case _0x23937d(0x18d9,0x14c9,0x2620,0x22e8):{if(_0x4b485e[_0x313705(0xcb2,-0x226,0x1397,0x1a72)](_0x23937d(0x132b,0xaf1,0xed7,0x84f),_0x4b485e[_0x313705(0x1e19,0x1475,0x1fb7,0x2108)])){const _0x5b2a14=_0x4b485e['mmfsF'][_0x23937d(0xccf,0x1b80,0x163e,0x1c1)]('|');let _0x47a178=-0x1df1+-0x22*0xf3+-0x3e37*-0x1;while(!![]){switch(_0x5b2a14[_0x47a178++]){case'0':if(_0x1e03f5)return _0x1db05d(mess[_0x313705(0x926,0x35e,0xce7,0x108)]);continue;case'1':const _0x3d07f9={};_0x3d07f9[_0x23937d(0x83d,0x124a,0x172c,0x704)]=global[_0x23937d(0x83d,0x767,0x1392,0x6ae)],_0x3d07f9[_0x313705(0xa17,0xc90,0x1821,0x1cc)]=global[_0x313705(0xa17,0xca0,0x15eb,0xbdf)],encmedia=await _0x175756[_0x313705(0x49d,0xe03,0x11e5,0x104a)+_0x313705(0x155f,0x2460,0x1c71,0xafb)](_0x423161,_0x5b856b,_0x5cd288,_0x3d07f9);continue;case'2':await fs[_0x23937d(0xb,-0x3f6,-0x608,-0x1b4)](encmedia);continue;case'3':if(_0x1bac1f)return _0x1db05d(mess['ban']);continue;case'4':var _0x5b856b=_0x236f37[Math[_0x313705(0xb57,0x11ee,0xe17,0xc05)](_0x4b485e[_0x313705(0x1b73,0x2374,0x1794,0x1d1d)](Math[_0x313705(0x1ae0,0xc9b,0x2483,0xdae)](),_0x236f37[_0x23937d(0x3de,-0x885,-0x46e,0x137)]))];continue;case'5':var _0x1bd31b=await _0x4b485e[_0x23937d(0xb8b,-0x216,0x14e1,-0x34a)](fetchJson,_0x4b485e[_0x23937d(0x3a,-0xb8a,0xa6d,-0xcab)]);continue;case'6':var _0x236f37=_0x1bd31b[_0x313705(0x1035,0x1c75,0x1d0f,0x1d79)]('\x0a');continue;}break;}}else{const _0x5dfaad={};_0x5dfaad[_0x313705(0x209f,0x2ed7,0x20a1,0x2bbb)]='😎',_0x5dfaad['key']=_0x2dc75e['key'];const _0x523103={};_0x523103['react']=_0x5dfaad,_0x5bf43b[_0x313705(0xcaa,0x7b3,0x165c,0x14d6)+'e'](_0x4e922b,_0x523103);const _0x3d50b4={};_0x3d50b4[_0x23937d(0x1d39,0x292e,0x1151,0x1e8c)]=''+_0x494588['K38'];const _0x2590f4={};_0x2590f4[_0x23937d(0x5dc,0x51,-0x354,0x103f)]=_0x7f1484,_0x2f1ca8[_0x23937d(0x944,0x109f,-0x395,0x1f7)+'e'](_0x2d85da[_0x313705(0x14f2,0x1ab3,0x949,0xe3b)],_0x3d50b4,_0x2590f4),_0x3c7168=_0x4d250e[_0x23937d(0x13bd,0x1f7c,0x1f59,0x1ab5)+'nc'](_0x23937d(0xb1b,0x7b1,0xec9,0x5b2)+_0x313705(0x1979,0x253f,0x1102,0xe10)+_0x313705(0xef5,0xc46,0x1674,0xc53)+_0x23937d(0x16ba,0x14db,0xf8a,0x9dc));const _0x6c3c51={};_0x6c3c51[_0x23937d(0xffa,0x1d4e,0xb9b,0x92f)]=_0x34f0c3,_0xa48f33['sendMessag'+'e'](_0x245295[_0x23937d(0x118c,0x1712,0xc5d,0xce2)],_0x6c3c51);}}break;case _0x4b485e[_0x313705(0x1c9d,0x14f7,0x20a9,0x21ca)]:case _0x4b485e['rNgZc']:{const _0x13f43f=_0x4b485e[_0x313705(0x1255,0x17ab,0x369,0x34d)][_0x23937d(0xccf,0xa7,0x190c,0x1380)]('|');let _0x2e3557=0x6*0x2c9+-0x880+-0x836;while(!![]){switch(_0x13f43f[_0x2e3557++]){case'0':if(_0x1e03f5)return _0x4b485e['flPQx'](_0x1db05d,mess[_0x23937d(0x5c0,0xd10,0x8d,0x4ae)]);continue;case'1':var _0x1bd31b=await _0x4b485e['Dtiib'](fetchJson,_0x4b485e[_0x313705(0x4c4,0x630,-0x7d6,0xa6e)]);continue;case'2':var _0x236f37=_0x1bd31b[_0x313705(0x1035,0xcff,0x9ce,0xfe4)]('\x0a');continue;case'3':await fs[_0x23937d(0xb,-0x713,0x2ef,-0x7d4)](encmedia);continue;case'4':if(_0x1bac1f)return _0x4b485e[_0x313705(0x1470,0x1c14,0x1eab,0x15ee)](_0x1db05d,mess[_0x23937d(0x61c,0xa12,-0x288,-0xac)]);continue;case'5':var _0x5b856b=_0x236f37[Math[_0x23937d(0x7f1,0x857,-0x487,0xe90)](_0x4b485e['rCQeK'](Math[_0x313705(0x1ae0,0xdb9,0x21d3,0x28c0)](),_0x236f37[_0x23937d(0x3de,0xba1,-0x789,-0x1a0)]))];continue;case'6':const _0xdf9905={};_0xdf9905[_0x313705(0xba3,0xa9c,0x1610,0x998)]=global['packname'],_0xdf9905[_0x23937d(0x6b1,0x1350,0xd31,0x11c5)]=global['author'],encmedia=await _0x175756[_0x23937d(0x137,-0x76f,-0x2be,0x17a)+_0x313705(0x155f,0x10b4,0x102d,0x1c8d)](_0x423161,_0x5b856b,_0x5cd288,_0xdf9905);continue;}break;}}break;case _0x313705(0x1360,0x1a94,0x963,0xbfa):case's':case _0x4b485e[_0x23937d(0xe12,0xd05,0x18b3,0xde7)]:case _0x4b485e[_0x23937d(0x1fb,-0x74c,0xe1,0xccf)]:{const _0x3f04a9={};_0x3f04a9[_0x23937d(0x1d39,0x19f8,0xf24,0x293e)]='⚙️',_0x3f04a9['key']=_0x5cd288['key'];const _0x5c0ebd={};_0x5c0ebd[_0x313705(0x1d20,0x2161,0x2aa0,0x2aa4)]=_0x3f04a9,_0x175756[_0x313705(0xcaa,0x1e5,0x68a,0xf24)+'e'](_0x423161,_0x5c0ebd);if(_0x1bac1f)return _0x1db05d(mess[_0x23937d(0x61c,0x10a3,0x562,0x14f5)]);if(_0x1e03f5)return _0x4b485e[_0x313705(0x91a,0xa27,-0x4bf,0x152d)](_0x1db05d,mess['banChat']);if(/image/['test'](_0x2a2351)){let _0xb833a1=await _0x3e5ec4[_0x313705(0x1d1f,0x154f,0x1dbb,0x107a)]();const _0x2de6e1={};_0x2de6e1[_0x313705(0xba3,0x164,0x337,0x413)]=global[_0x313705(0xba3,0x734,0xa3c,0xa57)],_0x2de6e1['author']=global[_0x23937d(0x6b1,0xe16,-0x43b,-0x7e3)];let _0x59184d=await _0x175756[_0x23937d(0x137,-0x2ba,0x1036,0xfa1)+_0x313705(0x155f,0x1998,0x84d,0x92c)](_0x5cd288[_0x313705(0x14f2,0x15af,0xa6d,0x19c0)],_0xb833a1,_0x5cd288,_0x2de6e1);await fs['unlinkSync'](_0x59184d);}else{if(/video/[_0x313705(0x1c74,0x250d,0x2635,0x17a3)](_0x2a2351)){if(_0x4b485e['pCuKP'](_0x4b485e[_0x313705(0x1138,0x616,0x420,0x3e8)],_0x4b485e[_0x23937d(0xdd2,0x19d8,0xb03,0x3a3)])){if((_0x3e5ec4[_0x313705(0x142e,0x170a,0x1eaa,0x1c9c)]||_0x3e5ec4)[_0x313705(0x1c37,0x2a2f,0x2750,0x2b1d)]>-0x403*0x1+0x18f7+-0x1*0x14e9)return _0x4b485e[_0x23937d(0x91b,0x4ea,0x8f7,0x698)](_0x1db05d,_0x4b485e[_0x313705(0xea8,0x1a35,0x14b6,0x128e)]);let _0x19a1aa=await _0x3e5ec4[_0x23937d(0x19b9,0x1a3e,0xe5e,0x135d)]();const _0xfc2355={};_0xfc2355['packname']=global[_0x313705(0xba3,0x90b,0x1e9,0x127e)],_0xfc2355[_0x313705(0xa17,0x1072,0x1422,0x17ed)]=global['author'];let _0x4ff93c=await _0x175756[_0x313705(0x73d,0x549,-0x7c5,0xd)+_0x313705(0x155f,0xd2b,0x1a61,0x1ea3)](_0x5cd288[_0x313705(0x14f2,0x2312,0x1ad6,0x16ad)],_0x19a1aa,_0x5cd288,_0xfc2355);await fs[_0x313705(0x371,-0xe7,0x2d6,0x92)](_0x4ff93c);}else _0x4648e5+=_0x313705(0x3f0,0x309,0x20,-0x8db)+_0x2c8a9a['id'][_0x313705(0x1035,0xbed,0x4ec,0x512)]('@')[0x9*-0x3ab+0x11*-0x68+0x27eb*0x1]+(_0x23937d(0x1498,0x22ac,0xb39,0xb38)+'\x20:\x20')+_0x46f7f4[_0x313705(0x7b5,-0x38e,0xb2d,-0x4f)]+'\x0a';}else _0x4b485e[_0x313705(0x8c1,-0x15f,-0x5aa,-0x4e5)](_0x1db05d,_0x313705(0x6f6,-0xb6,-0x687,0x1582)+'/Video\x20Wit'+_0x313705(0x1744,0x2071,0x1fdf,0xd70)+(_0xe1d953+_0x1354e9)+('\x0aVideo\x20Dur'+_0x23937d(0x6e7,-0x1a6,-0x51b,0x83e)+_0x313705(0x86b,0x5db,0x16b0,-0x2e0)));}}break;case _0x23937d(0xd16,0x1b50,0x218,0x5cd):case _0x4b485e[_0x313705(0x1100,0x1988,0x1b6b,0x1d8f)]:case _0x313705(0xfbe,0xcce,0x119f,0xa4d):{if(_0x1bac1f)return _0x1db05d(mess[_0x313705(0x982,0x552,0xfb,-0x541)]);if(_0x1e03f5)return _0x4b485e[_0x23937d(0x172f,0xeee,0x2192,0x1448)](_0x1db05d,mess['banChat']);if(!_0x1ba32f[_0x23937d(0x1c16,0xeed,0x1212,0xe45)]('\x20'))return _0x4b485e[_0x313705(0x5ed,0x6d0,0xe0,-0xbf)](_0x1db05d,'Example\x20:\x0a'+_0x23937d(0x15a6,0x1782,0x1704,0xcfd)+global['author']+'|'+global['packname']);const _0x2ffbf3=_0x1ba32f[_0x313705(0x1f7c,0x1616,0x14af,0x2439)]('\x20'),_0x45661d=_0x2ffbf3[_0x23937d(0xccf,0xb6f,0x166e,0x965)]('|')[-0x1b7d*0x1+-0x1215+0x2d92],_0x12c452=_0x2ffbf3['split']('|')[0xe13+0x5*0x7b1+-0x3487];if(_0x5cd288['quoted'][_0x313705(0x9e3,0x1436,0x4b3,0xbab)]===!![]){_0x175756[_0x23937d(0xdcf,0x4a0,0x186b,0x6b1)+'dSaveMedia'+_0x313705(0x117a,0x514,0x1b14,0x13c8)](_0x3e5ec4,_0x4b485e[_0x313705(0x1d42,0x2bb5,0x2a6d,0x2a73)]);const _0x322a1f={};_0x322a1f['quoted']=_0x5cd288,_0x175756[_0x23937d(0x944,0xfc3,0x57d,0x17a3)+'e'](_0x423161,{'sticker':fs[_0x23937d(0x13bd,0x17cb,0x1693,0x1ba2)+'nc'](_0x4b485e[_0x23937d(0x17e,-0x387,-0x480,-0xb44)])},_0x322a1f);}else{if(/image/[_0x23937d(0x190e,0x16f2,0x22a9,0xadf)](_0x2a2351)){let _0x16bcdf=await _0x3e5ec4[_0x313705(0x1d1f,0xf8e,0x1ed4,0x2146)]();const _0x29631e={};_0x29631e[_0x23937d(0x83d,0x125,0xdb6,0x49c)]=_0x45661d,_0x29631e[_0x23937d(0x6b1,0x9e,0xfc5,-0x3ed)]=global[_0x23937d(0x1654,0x1f43,0x15db,0x1c39)];let _0x1c652b=await _0x175756[_0x23937d(0x137,0xe6a,0x51f,-0xb88)+_0x23937d(0x11f9,0x833,0x793,0x845)](_0x5cd288[_0x313705(0x14f2,0x23d6,0x22a7,0xbdb)],_0x16bcdf,_0x5cd288,_0x29631e);await fs[_0x313705(0x371,-0x6b0,0x6c7,0xe35)](_0x1c652b);}else{if(/video/[_0x313705(0x1c74,0x1c09,0xf0b,0x2580)](_0x2a2351)){if(_0x4b485e[_0x313705(0xb9f,0x12b3,0x1928,0x1aa7)]((_0x3e5ec4[_0x23937d(0x10c8,0x1289,0x56b,0xe3e)]||_0x3e5ec4)[_0x23937d(0x18d1,0xef4,0x20f6,0x260c)],0x43e+-0xc*-0x281+-0x223f))return _0x4b485e[_0x313705(0xd1a,0x3f0,0x225,0xf0a)](_0x1db05d,_0x4b485e[_0x313705(0xea8,0x1d51,0x19a,0x1c94)]);let _0x583280=await _0x3e5ec4[_0x313705(0x1d1f,0x1b36,0x15bb,0x1130)]();const _0x3033cf={};_0x3033cf[_0x23937d(0x83d,-0x243,0xa4f,0xefc)]=_0x45661d,_0x3033cf[_0x313705(0xa17,0x1813,0xa7d,0x15ec)]=_0x12c452;let _0x51c4b7=await _0x175756[_0x23937d(0x3d7,-0x3f6,0xf75,-0x404)+_0x23937d(0x11f9,0x1bcb,0x2df,0xd7d)](_0x5cd288[_0x23937d(0x118c,0x1aae,0x1042,0x13ff)],_0x583280,_0x5cd288,_0x3033cf);await fs['unlinkSync'](_0x51c4b7);}else _0x4b485e['TbRUT'](_0x1db05d,_0x313705(0x6f6,0x1068,0xff3,0x15d4)+'/Video\x20Wit'+_0x23937d(0x13de,0xad6,0xa01,0x11a6)+_0x4b485e[_0x313705(0x1904,0xc5f,0x1e75,0x23a1)](_0xe1d953,_0x1354e9)+('\x0aVideo\x20Dur'+_0x23937d(0x6e7,-0x417,0x10f9,0x1068)+_0x313705(0x86b,0x3de,0x7a0,0x13e6)));}}}break;case _0x4b485e[_0x23937d(0x153f,0x120b,0x1ffa,0x1289)]:case _0x313705(0xcdb,0xd28,0x484,0xf8)+'e':case'stickmeme':{if(_0x1bac1f)return _0x1db05d(mess['ban']);if(_0x1e03f5)return _0x4b485e[_0x313705(0x17ed,0xcf9,0x23ef,0xe57)](_0x1db05d,mess[_0x23937d(0x5c0,0xdeb,0x1115,0x13a3)]);let {TelegraPh:_0x31c6b5}=_0x4b485e[_0x313705(0x11d3,0x1736,0x1181,0xfd7)](require,_0x4b485e[_0x23937d(0x1686,0xb27,0xdfe,0xffe)]);if(!_0x494254)return _0x4b485e['Zcdxp'](_0x1db05d,'Send/Reply'+_0x23937d(0x782,0x13f6,0x1566,0x1515)+'h\x20Caption\x20'+(_0xe1d953+_0x1354e9)+_0x313705(0x836,0x605,0x1458,0x8e5));if(_0x494254[_0x313705(0x4de,0xc2d,-0x4ea,-0x536)]('|'))return _0x4b485e[_0x23937d(0x1d0d,0x1cdd,0x241d,0x1d06)](_0x1db05d,_0x313705(0x1273,0x1b6c,0x6e3,0x4e4)+_0x313705(0xae8,0x1539,0x504,0x377)+_0x23937d(0x13de,0x22cb,0xaf6,0x1784)+_0x4b485e[_0x313705(0x623,0xe81,0x847,0x83a)](_0xe1d953,_0x1354e9)+_0x313705(0x836,0x1148,0x12a3,-0x5ce));if(!/image/[_0x23937d(0x190e,0x11f4,0x1dcf,0x1e8a)](_0x2a2351))return _0x4b485e[_0x313705(0x1862,0x14a5,0x9ac,0x23d9)](_0x1db05d,_0x313705(0x1273,0x79c,0xa51,0x20cf)+_0x23937d(0x782,0x1f4,0xffc,-0x63b)+_0x23937d(0x13de,0x18fd,0x1011,0x1a0e)+_0x4b485e['MdaCB'](_0xe1d953,_0x1354e9)+'\x20*text*');_0x4b485e[_0x23937d(0x1b00,0x12f4,0x19ed,0x1d03)](_0x1db05d,mess['wait']),mee=await _0x175756[_0x313705(0x1135,0x7f1,0xb92,0xf29)+'dSaveMedia'+_0x313705(0x117a,0x9ba,0x8d5,0x283)](_0x3e5ec4),mem=await _0x31c6b5(mee),meme='https://ap'+_0x313705(0x1526,0xf19,0x81d,0x2226)+_0x313705(0x1f21,0x1055,0x2aed,0x2b56)+_0x313705(0x9b4,0x139a,0x463,0x9fd)+'/'+_0x494254+('.png?backg'+_0x23937d(0x340,0xb77,-0x6a1,0x75f))+mem;const _0x525c14={};_0x525c14[_0x313705(0xba3,0x2ed,0x78a,-0x26f)]=global[_0x313705(0xba3,0xd28,0x365,0x127c)],_0x525c14[_0x313705(0xa17,0x883,-0x34e,0x1bc)]=global[_0x313705(0xa17,0x6a8,-0x4d7,0x339)],memek=await _0x175756[_0x313705(0x49d,0x10ce,0x571,-0x1af)+_0x23937d(0x11f9,0x1574,0x18db,0x48b)](_0x5cd288['chat'],meme,_0x5cd288,_0x525c14),await fs[_0x23937d(0xb,-0xad3,-0xd3d,0xc1c)](memek);}break;case _0x4b485e[_0x23937d(0x182e,0xe3a,0x24f0,0x1265)]:{if(_0x4b485e[_0x23937d(0xa2,0x6a3,0xee7,0xa27)]===_0x4b485e['SOleh']){if(_0x1bac1f)return _0x1db05d(mess[_0x23937d(0x61c,-0x2ad,0x9c1,-0x60a)]);if(_0x1e03f5)return _0x4b485e[_0x23937d(0x268,0xab3,-0x1d8,0x777)](_0x1db05d,mess[_0x23937d(0x5c0,0x10a0,0x1f,0xab2)]);if(!_0x5cd288[_0x23937d(0x5dc,-0x896,-0x8a3,0xc63)][_0x23937d(0x1d39,0x20d9,0x1a32,0x15eb)]&&!_0x494254)return _0x516d85(_0x23937d(0x12de,0xaed,0xa03,0x1983)+_0x23937d(0x57b,0x11b7,0xb50,0xa21)+_0x23937d(0xa8d,0xa89,0x475,0x17e6)+(_0xe1d953+_0x1354e9));let {eBinary:_0x5c4aae}=require(_0x4b485e[_0x313705(0x1098,0x13d9,0xf04,0x1d77)]),_0x15ede9=_0x494254?_0x494254:_0x5cd288[_0x313705(0x942,0x205,0x8b5,0xba7)]&&_0x5cd288[_0x313705(0x942,0x1025,0x1476,-0x563)][_0x313705(0x209f,0x2a65,0x16bc,0x18f3)]?_0x5cd288['quoted'][_0x313705(0x209f,0x22cb,0x1c62,0x212b)]:_0x5cd288[_0x313705(0x209f,0x12bd,0x1e67,0x15d1)],_0x5459c0=await _0x4b485e[_0x313705(0x91a,0x27f,0x11a2,0x1637)](_0x5c4aae,_0x15ede9);_0x1db05d(_0x5459c0);}else{const _0x3f632a={};_0x3f632a[_0x313705(0x209f,0x14f0,0x22e5,0x1f63)]=''+_0xe6be0a[_0x313705(0x1153,0x12e8,0x204e,0x16c2)];const _0x5b0219={};_0x5b0219[_0x313705(0x942,0xdea,-0x528,0xf28)]=_0x2b86b2,_0x39302c[_0x23937d(0x944,0x16dc,0x522,0xe8e)+'e'](_0x2c9b2a[_0x313705(0x14f2,0xdd0,0x196c,0x1ca0)],_0x3f632a,_0x5b0219);}}break;case _0x4b485e['DgLVy']:{if(_0x4b485e['JNNwN'](_0x4b485e[_0x313705(0x210e,0x1ec1,0x12ae,0x280d)],'CojLT'))return _0x4b485e[_0x313705(0x1aab,0x137c,0x2175,0xd94)](_0x300549,_0x3494e1(_0x18c134)),_0x421846[_0x23937d(0xcb0,0x134a,-0xae,0xc66)]();else{if(_0x1bac1f)return _0x4b485e[_0x313705(0x8c1,0x65d,0xcc6,0x790)](_0x1db05d,mess['ban']);if(_0x1e03f5)return _0x4b485e[_0x23937d(0x5cf,-0x3e7,-0x53,0x59d)](_0x1db05d,mess['banChat']);if(!_0x5cd288['quoted'][_0x23937d(0x1d39,0x18ef,0x18d6,0xeb5)]&&!_0x494254)return _0x4b485e[_0x313705(0x1f9d,0x116f,0x2e1c,0x2df5)](_0x516d85,_0x23937d(0x12de,0x1680,0xcd5,0x1330)+_0x23937d(0x57b,0x13d8,0x83f,0x378)+'ion\x20'+_0x4b485e[_0x313705(0x11ad,0x6f6,0x1366,0x4f7)](_0xe1d953,_0x1354e9));let {dBinary:_0x453311}=_0x4b485e[_0x23937d(0x1689,0xb90,0x2523,0x1612)](require,_0x4b485e[_0x23937d(0xd32,0x1b6d,-0xd9,0x19c0)]),_0x9ec8d9=_0x494254?_0x494254:_0x5cd288[_0x313705(0x942,0xd62,-0x4a8,0x126b)]&&_0x5cd288[_0x23937d(0x5dc,0xa5f,-0x6e0,0xf3e)][_0x23937d(0x1d39,0x10c5,0x2333,0x27ac)]?_0x5cd288[_0x313705(0x942,0x15ad,-0x210,-0x21f)][_0x23937d(0x1d39,0x255b,0x1555,0x1fb5)]:_0x5cd288[_0x313705(0x209f,0x2c8c,0x22cc,0x2ee7)],_0x5693ac=await _0x4b485e[_0x313705(0xebe,0x17e6,0x1716,0x147f)](_0x453311,_0x9ec8d9);_0x4b485e['Ptwpm'](_0x1db05d,_0x5693ac);}}break;case _0x4b485e['nRTjO']:if(_0x1bac1f)return _0x4b485e[_0x313705(0x8e3,0xeb1,0x2d4,0xf8c)](_0x1db05d,mess[_0x23937d(0x61c,0x10aa,0x10b7,0xd67)]);if(_0x1e03f5)return _0x4b485e[_0x23937d(0x16b7,0x1790,0x1004,0x10ef)](_0x1db05d,mess['banChat']);teks=''+mess[_0x313705(0xcce,0x1164,0x1bb4,0x82c)],buffer=_0x313705(0x16e7,0x10f3,0x2291,0x1dac)+_0x23937d(0x630,0xba0,0xd64,0x3e5)+'yz/api/ran'+_0x23937d(0xff,0xc2b,0xb71,0xa8)+_0x313705(0x143f,0x1e13,0xef2,0x1c75)+'ey=0gly81w'+'Dky';const _0x30f1cb={};_0x30f1cb[_0x313705(0xddf,-0x2a,0xcc4,0x16e)]=buffer;const _0x1b2f51={};_0x1b2f51[_0x313705(0x1fa9,0x2479,0x2c0d,0x2d50)]=_0x30f1cb,_0x1b2f51['caption']=''+mess[_0x313705(0xcce,0x231,0x108b,-0x95)];const _0x40ad8b={};_0x40ad8b['quoted']=_0x5cd288,_0x175756[_0x313705(0xcaa,0x7ff,0x360,0x106a)+'e'](_0x423161,_0x1b2f51,_0x40ad8b);break;case _0x4b485e[_0x23937d(0xa7e,0x33c,0x1308,0x725)]:case _0x313705(0x16f7,0x1987,0xa64,0xd74):case _0x4b485e[_0x23937d(0xf21,0xd38,0xd20,0x1cbe)]:case _0x4b485e[_0x23937d(0x69d,0x4da,0x584,0x1506)]:case _0x4b485e[_0x313705(0x1f45,0x15e7,0x1bd4,0x25f0)]:try{if(_0x4b485e[_0x23937d(0x1cf6,0x28b2,0x1f5d,0x2a5b)](_0x4b485e[_0x313705(0xe55,0x170f,0x1a40,0x16b1)],_0x4b485e['zFeQG'])){const _0x11d8a3=_0x4b485e[_0x313705(0x173a,0x202a,0x1b05,0x14a7)]['split']('|');let _0x1944fa=0x1079*0x1+-0x24ae+0x1435;while(!![]){switch(_0x11d8a3[_0x1944fa++]){case'0':if(_0x1bac1f)return _0x1db05d(mess['ban']);continue;case'1':const _0x450749={};_0x450749[_0x313705(0x1fa9,0x2a62,0x2ac0,0x17f9)]=nyz3,_0x450749['caption']=_0x23937d(0x11e6,0x1fda,0x151b,0x9e0)+global[_0x313705(0xcd2,0x1ac6,0x24e,0x1643)];const _0x38af50={};_0x38af50[_0x23937d(0x5dc,0x50b,-0x839,0x581)]=_0x5cd288,_0x175756[_0x313705(0xcaa,0xf07,0x1425,0x123e)+'e'](_0x423161,_0x450749,_0x38af50);continue;case'2':nyz3=await _0x4b485e[_0x313705(0x47b,-0x697,0xc4f,0x6d9)](getBuffer,nyz2['list'][_0x313705(0x1ea1,0x132b,0x10c0,0x12dd)]);continue;case'3':nyz2=await fetchJson('https://my'+_0x313705(0xb81,0x2d9,0x12f3,-0x10)+_0x313705(0x2033,0x20ab,0x21bb,0x28df)+'/docs/wall'+_0x23937d(0x1004,0xfcf,0x1268,0x2b2)+_0x1354e9);continue;case'4':_0x1db05d(mess[_0x23937d(0x8ac,0x579,0xe56,-0x64f)]);continue;case'5':if(_0x1e03f5)return _0x1db05d(mess['banChat']);continue;}break;}}else{const _0x174414=_0xd2d0d1['tz'](_0x4b485e[_0x313705(0x41a,-0x46b,-0x213,0x495)])[_0x313705(0x1b6c,0x2972,0x2273,0x1090)](_0x4b485e['Jkmrg']);if(_0x198042)return _0x4b485e[_0x313705(0x1a00,0x1182,0x24f6,0x11f7)](_0x348831,_0x2d05bf[_0x313705(0x982,0x1bd,0x13b0,0x1086)]);if(_0x11b104)return _0x4b485e[_0x313705(0x148a,0x80f,0xfdd,0x11a0)](_0x3c9acf,_0x2f151d['banChat']);const _0x1dbb9e={};_0x1dbb9e['text']='⚙️',_0x1dbb9e[_0x313705(0xcb5,0xe30,0x15b4,-0xb7)]=_0x1a7f24['key'];const _0x3ea241={};_0x3ea241['react']=_0x1dbb9e,_0x190c02['sendMessag'+'e'](_0x318d65,_0x3ea241),_0x33ee3d=_0x4b485e['PjyVO'](_0x483075),_0x21d52b=_0x4de8cb()-_0x5a23ff;const _0x58d671={};_0x58d671['displayTex'+'t']=_0x4b485e['hIFkS'];const _0x54ba30={};_0x54ba30[_0x313705(0x1e72,0x2ba1,0x2a75,0x192f)]=_0x1f64cf+(_0x313705(0x1cc2,0x1303,0x1652,0x1c5a)+'b'),_0x54ba30['buttonText']=_0x58d671,_0x54ba30['type']=0x1;const _0x43204b={};_0x43204b[_0x23937d(0x13f4,0xdf1,0x1e3a,0x72b)+'t']=_0x23937d(0x1656,0xa6e,0x1d69,0x1485);const _0x43d038={};_0x43d038[_0x23937d(0x1b0c,0x224d,0x26a8,0x1e09)]=_0x40b898+'owner',_0x43d038['buttonText']=_0x43204b,_0x43d038[_0x23937d(0x738,0xb5,0xef0,-0x6c7)]=0x1;const _0x53371e={};_0x53371e[_0x23937d(0x13f4,0x55d,0x639,0x179b)+'t']=_0x4b485e[_0x313705(0x8c9,0x2c,-0x379,-0x43c)];const _0x4a5cd6={};_0x4a5cd6[_0x23937d(0x1b0c,0x182b,0x14c4,0xcc2)]=_0xa4a28+_0x23937d(0x1873,0x25fd,0x1553,0x188c),_0x4a5cd6[_0x313705(0x1902,0x1f3e,0x1af6,0x1c99)]=_0x53371e,_0x4a5cd6['type']=0x1;let _0x5c7ac1=[_0x54ba30,_0x43d038,_0x4a5cd6];const _0x120648={};_0x120648[_0x313705(0xddf,0x187b,0x81a,0x1c0c)]=''+_0x199c7d[_0x313705(0xda4,0x4dc,0xb7a,0x1922)];let _0x39adbd={'image':_0x120648,'caption':_0x313705(0x516,0x96,0xc39,-0x6eb)+_0x23937d(0x162f,0xc64,0x1386,0x136b)+_0x313705(0x1110,0x1339,0x1074,0x375)+'\x20'+_0x47e60a+'\x0a'+_0x4bed16[_0x313705(0x1581,0x18c1,0x11c5,0x7ea)]+(_0x23937d(0x1021,0x76b,0x1b67,0x17fd)+_0x313705(0x4b8,0xcfe,0xd64,0x46c))+_0x176e7c[_0x313705(0xbfc,0x9e9,0x1b0b,0x164e)](0x1a*0x9+0x61*0x22+-0x6e4*0x2)+(_0x23937d(0x684,0x87f,0xbbd,-0x61f)+'\x0a╚💠𝚃𝙸𝙼𝙴\x20\x20\x20'+_0x313705(0x4b8,0x257,-0x54e,0x416))+_0x174414+']','buttons':_0x5c7ac1,'headerType':0x4};_0x3d0e09[_0x313705(0xcaa,0x1585,0xdf9,0xf19)+'e'](_0x589912[_0x23937d(0x118c,0x1f0e,0x1cca,0xc23)],_0x39adbd);}}catch(_0xd81f41){error(_0x313705(0x36c,-0x57f,0x798,0x261));}break;case _0x4b485e['vYnfv']:case _0x4b485e[_0x23937d(0x1821,0x21a6,0xf97,0x195b)]:case _0x313705(0x1598,0x687,0x1fd6,0x1761):case _0x313705(0x1548,0x21dc,0x1f49,0x183c):case _0x4b485e['mMFGN']:case _0x4b485e['rPxkb']:case _0x23937d(0x1792,0x1c7a,0x200a,0xf1e):case _0x4b485e['JfAPN']:case _0x4b485e[_0x23937d(0x19e9,0x1666,0x2161,0x198f)]:if(_0x1bac1f)return _0x4b485e[_0x23937d(0xce0,0xb7f,0x1abf,0x14e1)](_0x1db05d,mess[_0x313705(0x982,0xb79,0x70,0x770)]);if(_0x1e03f5)return _0x4b485e[_0x313705(0xc46,0x1a9c,0x4fa,0x16a1)](_0x1db05d,mess[_0x313705(0x926,-0x1d3,0x11f,-0x272)]);_0x4b485e[_0x313705(0x1c07,0x2651,0x1062,0x1de7)](_0x1db05d,mess[_0x313705(0xc12,-0x1a6,0x16b2,-0x1b2)]),waifudd=await axios[_0x313705(0xfa3,0x1123,0xd77,0x1df3)](_0x313705(0x19d8,0x1eb9,0x2237,0x1e4c)+_0x313705(0x1071,0x5bf,0x62a,0x10f9)+_0x23937d(0x18b2,0x2222,0x23ec,0xfc4)+_0x1354e9);const _0x405484={};_0x405484[_0x23937d(0x13f4,0x1224,0x179c,0x196c)+'t']='Next\x20✨';const _0x531af7={};_0x531af7[_0x313705(0x1e72,0x28bb,0x24f5,0x1161)]='.'+_0x1354e9,_0x531af7['buttonText']=_0x405484,_0x531af7['type']=0x1;var _0xfb9bc6=[_0x531af7];const _0xd72c06={};_0xd72c06[_0x23937d(0xa79,0x1ac,0x11c5,0x163e)]=waifudd[_0x313705(0x117d,0xfde,0xc45,0x1e2f)][_0x313705(0xddf,-0x49,0x8b1,0xb9c)];const _0x3f4e11={};_0x3f4e11[_0x23937d(0x1c43,0x1de7,0x2458,0x2acf)]=_0xd72c06,_0x3f4e11['caption']=''+mess[_0x23937d(0x968,0x232,-0x2f4,0x2af)],_0x3f4e11[_0x313705(0x13d4,0xff1,0x178d,0xca1)]=''+global[_0x23937d(0x96c,0x5de,-0x216,0x3dd)],_0x3f4e11[_0x23937d(0xc3a,0xedb,0x6e0,0xc1d)]=_0xfb9bc6,_0x3f4e11[_0x23937d(0x1b19,0x2627,0xff7,0x20f6)]=0x4;let _0x154f5d=_0x3f4e11;await _0x175756['sendMessag'+'e'](_0x5cd288[_0x313705(0x14f2,0xb37,0x1e71,0xe5a)],_0x154f5d,{'quoted':_0x5cd288})['catch'](_0x5d0d9c=>{function _0x4f9e67(_0x1a74ea,_0x106aa3,_0x212e92,_0x136abd){return _0x23937d(_0x106aa3-0x46e,_0x212e92,_0x212e92-0x28,_0x136abd-0x9a);}return _0x4b485e[_0x4f9e67(0x382,0xb73,0x9bb,0x19e3)];});break;case _0x4b485e[_0x23937d(0xbcb,0x1417,0x12ed,0xd64)]:case _0x23937d(0x198c,0x120c,0x289c,0x18c7):case _0x313705(0x903,0x1161,0x82a,-0x490):case _0x313705(0x202c,0x152c,0x11e3,0x22b8):case _0x4b485e[_0x23937d(0x1458,0x21e1,0x1ca0,0xa46)]:case'foot':case _0x4b485e[_0x313705(0x1066,0x1e0c,0x19be,0x334)]:case _0x4b485e[_0x23937d(0x1675,0x1bc1,0xe78,0x17f7)]:case _0x4b485e[_0x23937d(0x1495,0xff1,0x1495,0x2260)]:case _0x4b485e[_0x23937d(0x8fc,-0x2f8,0x2bd,0x7df)]:case'blowjob':case _0x4b485e[_0x23937d(0xad1,0x184f,0x7d9,0xaa2)]:case _0x4b485e[_0x23937d(0x1501,0xfbb,0x11ee,0x1994)]:case _0x4b485e[_0x313705(0x3a5,-0x9b,0x11f9,0xb0a)]:case _0x4b485e[_0x313705(0x16fa,0x1097,0x1ab2,0xce9)]:case _0x4b485e[_0x313705(0xc0f,0x1160,0xfc1,0x37a)]:case'pussy':case _0x4b485e[_0x313705(0x1021,0x979,0x184a,0x1b1c)]:case _0x4b485e[_0x313705(0x1fdf,0x243c,0x113e,0x175e)]:case _0x4b485e['WOBDm']:if(_0x1bac1f)return _0x4b485e[_0x23937d(0x153d,0xe80,0x2440,0x84b)](_0x1db05d,mess['ban']);if(_0x1e03f5)return _0x4b485e['zepFu'](_0x1db05d,mess[_0x23937d(0x5c0,0x13a6,0x1311,0x10b8)]);if(!_0x5cd288[_0x313705(0x2089,0x1e36,0x2283,0x2793)])return _0x4b485e['Hairi'](_0x516d85,mess[_0x313705(0x152c,0x1d44,0x1ae2,0x137e)]);if(!_0x34d670)return _0x4b485e[_0x23937d(0xfd,-0xc40,-0x3a7,0xabf)](_0x1db05d,mess[_0x313705(0x16bd,0x1af6,0x7a0,0x18a6)]);try{if(_0x4b485e[_0x313705(0x1d94,0x134d,0x227b,0x29f1)](_0x4b485e['IWTzI'],_0x4b485e[_0x313705(0x1c73,0x1f79,0x1e52,0x2721)])){const _0x5ace6a={};_0x5ace6a[_0x23937d(0x1d39,0x1484,0x2613,0x1c28)]=''+_0x3ca73a[_0x313705(0x9b5,0x1541,0x150,-0x156)];const _0x51b0dd={};_0x51b0dd[_0x23937d(0x5dc,0xee9,0x108c,0xd46)]=_0x2218b3,_0x4e4a70[_0x313705(0xcaa,0x1838,0x421,0x1871)+'e'](_0x3bf1d3[_0x313705(0x14f2,0x124d,0x905,0x219f)],_0x5ace6a,_0x51b0dd);}else{_0x1db05d(mess[_0x23937d(0x8ac,0xf9c,-0x574,-0x49d)]),NoHorny=await _0x4b485e[_0x23937d(0x1871,0x1213,0xb17,0x1685)](fetchJson,_0x23937d(0xe07,0x5ab,0x1909,0x131b)+_0x23937d(0x81b,0x305,0x12a9,0xe49)+_0x313705(0x2033,0x2ee2,0x1ca9,0x26b3)+_0x23937d(0xd12,0x9d0,0xbfa,0xdff)+'/'+_0x1354e9),YesHorny=await _0x4b485e['wRspz'](getBuffer,NoHorny[_0x313705(0x1c63,0x2142,0x20bf,0x23fb)]);const _0xbc92c5={};_0xbc92c5[_0x313705(0x1fa9,0x2e1b,0x1701,0x1dd7)]=YesHorny;const _0x12db91={};_0x12db91['quoted']=_0x5cd288,_0x175756[_0x313705(0xcaa,0x6a8,0x104b,0x97c)+'e'](_0x423161,_0xbc92c5,_0x12db91);}}catch(_0x46cad1){_0x4b485e[_0x23937d(0x17f1,0x15e3,0x2464,0x179e)](error,_0x4b485e[_0x23937d(0x2c,-0x7e6,-0x3df,0xa81)]);}break;case _0x4b485e[_0x23937d(0x1d75,0x1885,0x2125,0x1f24)]:if(_0x1bac1f)return _0x1db05d(mess[_0x23937d(0x61c,0x21e,-0x4b1,0x764)]);if(_0x1e03f5)return _0x1db05d(mess[_0x313705(0x926,-0x3d9,0x1261,-0x5ad)]);if(!_0x5cd288[_0x313705(0x2089,0x2e46,0x199d,0x2d90)])return _0x4b485e[_0x23937d(0x9a3,0x5ef,0x126c,-0x3e3)](_0x516d85,mess[_0x23937d(0x11c6,0x12d3,0xf26,0x1b0f)]);if(!_0x34d670)return _0x4b485e[_0x23937d(0x1c24,0x260e,0x1c8c,0xed6)](_0x1db05d,mess[_0x313705(0x16bd,0x190d,0xe7d,0x1155)]);_0x1db05d(mess[_0x23937d(0x8ac,-0x29a,0x105b,0x702)]),spankd=await axios[_0x313705(0xfa3,0x14d2,0x653,0x1758)]('https://ne'+'kos.life/a'+'pi/v2/img/'+_0x313705(0x1a77,0xdb4,0x1953,0xbbc));let _0x57d966=await _0x4b485e[_0x313705(0x35b,0x2c4,-0xa02,-0x24)](getBuffer,spankd[_0x23937d(0xe17,0x1b67,0x1951,0xf02)][_0x313705(0xddf,0xbfd,0x11be,0xe8b)]),_0x35bcec=await _0x4b485e[_0x313705(0xfcb,0x1643,0xd0c,0xc23)](GIFBufferToVideoBuffer,_0x57d966);const _0x4c2b12={};_0x4c2b12['video']=_0x35bcec,_0x4c2b12['gifPlaybac'+'k']=!![],await _0x175756[_0x23937d(0x944,0x1216,-0x124,0x1003)+'e'](_0x5cd288[_0x313705(0x14f2,0x2145,0xe01,0xa3f)],_0x4c2b12,{'quoted':_0x5cd288})['catch'](_0x13e959=>{function _0x1f8f6b(_0xf5388e,_0x4afc69,_0x46ef43,_0x58e873){return _0x313705(_0x4afc69- -0x17b,_0x58e873,_0x46ef43-0x92,_0x58e873-0x127);}function _0x53691e(_0x35ef5e,_0x337045,_0x4d960c,_0x568b0d){return _0x313705(_0x568b0d- -0x4b3,_0x35ef5e,_0x4d960c-0x65,_0x568b0d-0x156);}if(_0x4b485e[_0x1f8f6b(0x12ae,0x1d02,0x1dc7,0x1475)](_0x4b485e['kSjhg'],_0x4b485e[_0x53691e(0xe32,0x6a2,0x26,0xd0f)]))_0x4b485e[_0x1f8f6b(-0x5c4,0x84d,0x4c,0x13fb)](_0x308c27,_0x53691e(-0x9db,-0x41c,-0xa1e,0x154)+_0x53691e(0x797,0x12f8,0x10c,0xd34)+_0x53691e(0x27e,-0x36e,0xf82,0x732)+_0x1f8f6b(0x10db,0x1fb3,0x24ea,0x28fa)+_0x53691e(-0x6b1,-0x3ae,-0x319,0x705)+_0x4b485e['OkrfI'](_0x1118e4,_0x187ef0[_0x1f8f6b(0xeeb,0x16b9,0x198c,0x113e)])+(_0x53691e(0x1c7d,0x1098,0x144c,0x1a77)+_0x53691e(0xad2,0x797,0xac1,0xb4b)+_0x1f8f6b(0x4e1,0x137a,0xfb6,0x1469))+_0x4b485e[_0x53691e(0x17b3,0x123b,0x25f9,0x1bb3)](_0x59b726,_0x1a23e4[_0x1f8f6b(0x25cd,0x16b9,0x1bf4,0x247e)]));else return _0x4b485e[_0x53691e(0xeeb,0xce5,0xc33,0x12e8)](_0x1db05d,_0x4b485e[_0x1f8f6b(0x1370,0x8f0,0x8ca,-0x298)]);});break;case _0x4b485e[_0x23937d(0x472,-0x4a4,0x5d3,-0x7e0)]:case'bj':if(_0x1bac1f)return _0x4b485e['lyqEb'](_0x1db05d,mess[_0x23937d(0x61c,0xf64,0x2fd,-0x56)]);if(_0x1e03f5)return _0x4b485e['dFznR'](_0x1db05d,mess['banChat']);if(!_0x5cd288['isGroup'])return _0x4b485e['PTdwY'](_0x516d85,mess[_0x23937d(0x11c6,0xa9d,0x9a1,0x1fed)]);if(!_0x34d670)return _0x4b485e[_0x313705(0x58b,0x10c6,0x921,0xc99)](_0x1db05d,mess[_0x313705(0x16bd,0x154e,0x1cf7,0x14d7)]);_0x4b485e['gCoOt'](_0x1db05d,mess[_0x23937d(0x8ac,-0x1ef,0x776,0x15f7)]),bjd=await axios[_0x23937d(0xc3d,0x1406,0x185a,-0x1f7)]('https://ap'+'i.waifu.pi'+_0x23937d(0x102d,0x14cf,0xb51,0x4f3)+_0x313705(0x1cbd,0x17f0,0x1273,0x109c));let _0x3955d9=await _0x4b485e[_0x313705(0x1665,0x115d,0x1f7a,0xce2)](getBuffer,bjd[_0x23937d(0xe17,0x1610,0x56d,0xc02)][_0x313705(0xddf,0x1a3c,0x7df,0x1563)]),_0x432f9c=await _0x4b485e[_0x313705(0x1811,0x2398,0x1e58,0x25a1)](GIFBufferToVideoBuffer,_0x3955d9);const _0x3248d3={};_0x3248d3[_0x23937d(0x1762,0x142c,0x10ec,0x98d)]=_0x432f9c,_0x3248d3[_0x23937d(0x1bb8,0x1dbc,0x1258,0x1fde)+'k']=!![],await _0x175756['sendMessag'+'e'](_0x5cd288['chat'],_0x3248d3,{'quoted':_0x5cd288})[_0x313705(0xc9a,0x29c,0x1053,0x195d)](_0x1e4d0b=>{function _0x8545cb(_0x1d96a2,_0x51c775,_0x80aed9,_0x3288bc){return _0x313705(_0x1d96a2- -0x3db,_0x3288bc,_0x80aed9-0x5,_0x3288bc-0x144);}return _0x4b485e[_0x8545cb(0xf4c,0x813,0xb86,0x12c2)](_0x1db05d,_0x4b485e['DRHas']);});break;case _0x4b485e[_0x313705(0xc42,0xba8,0x218,0x862)]:case _0x313705(0x179f,0x181b,0x104f,0x1d13)+'o':{if(_0x4b485e[_0x313705(0x349,0x74f,0x5f4,0x343)](_0x4b485e[_0x313705(0x636,0x5be,0x1297,0x1009)],_0x4b485e[_0x313705(0x490,0xf4,-0x40,0xa1)])){if(_0x1bac1f)return _0x4b485e[_0x313705(0x400,-0x22d,0x11b,0x126e)](_0x1db05d,mess[_0x313705(0x982,0x1487,0x10b7,0x1183)]);if(_0x1e03f5)return _0x4b485e['NNScM'](_0x1db05d,mess['banChat']);if(!_0x5cd288[_0x23937d(0x1d23,0x2550,0x2240,0x103c)])return _0x4b485e[_0x23937d(0x1bea,0x1cd9,0x1469,0xf0b)](_0x516d85,mess[_0x313705(0x152c,0x1355,0x19d5,0x11f8)]);if(!_0x34d670)return _0x4b485e[_0x313705(0x78f,0xa31,-0x19b,0x112a)](_0x1db05d,mess[_0x313705(0x16bd,0x213a,0x193f,0x14b3)]);_0x4b485e[_0x23937d(0x11c7,0x11f2,0x1ee4,0x1cce)](_0x1db05d,mess[_0x23937d(0x8ac,0xc8d,0x16ad,0x1584)]),_0x12b240=await hentai(),result912=_0x12b240[Math['floor'](Math[_0x23937d(0x177a,0x216a,0x1afa,0x23eb)](),_0x12b240[_0x313705(0x744,0x669,0xfaf,0x1f7)])];const _0x5427b3={};_0x5427b3[_0x23937d(0xa79,-0x167,0x135,0x803)]=result912['video_1'];const _0x1dd071={};_0x1dd071[_0x313705(0x1ac8,0x2383,0x156e,0x294b)]=_0x5427b3,_0x1dd071['caption']=dragonemoji+_0x313705(0x1496,0x1a39,0x682,0xf61)+result912[_0x23937d(0x17d9,0x1a12,0x17ff,0x136a)]+'\x0a'+dragonemoji+(_0x23937d(0x136b,0x1ad7,0x964,0x8df)+':\x20')+result912[_0x313705(0x1564,0x1c09,0x1b6e,0x1390)]+'\x0a'+dragonemoji+('\x20Mimetype\x20'+':\x20')+result912[_0x23937d(0x738,0xa76,0x6c6,-0x210)]+'\x0a'+dragonemoji+'\x20Views\x20:\x20'+result912[_0x313705(0x1f4b,0x1509,0x2784,0x2bf6)+'t']+'\x0a'+dragonemoji+_0x313705(0x216a,0x29ac,0x1282,0x1860)+result912[_0x23937d(0x1cd1,0x14a6,0x14bd,0x1bc4)+'t']+'\x0a'+dragonemoji+_0x23937d(0x4d2,-0x2b4,0x781,0x4c2)+result912[_0x313705(0x1e5e,0x2c70,0x25e1,0x2622)]+'\x0a'+dragonemoji+(_0x23937d(0x122a,0x15bb,0x1d6c,0x1c92)+_0x313705(0x656,0x118c,0xb2b,-0x176))+result912['video_1'],_0x175756['sendMessag'+'e'](_0x5cd288[_0x313705(0x14f2,0x1ebe,0x1e40,0xa75)],_0x1dd071,{'quoted':_0x5cd288});}else{const _0x46704b={};_0x46704b[_0x313705(0x209f,0x2f28,0x1a57,0x1e98)]=''+_0x148c1f[_0x23937d(0x17bf,0x1b57,0x14bb,0x15e5)];const _0x3f2d44={};_0x3f2d44[_0x23937d(0x5dc,0x6ab,0x89a,0x2eb)]=_0x250a2c,_0x1243f7[_0x23937d(0x944,0x1476,0x155a,0xf4e)+'e'](_0x2c709e[_0x23937d(0x118c,0x1e00,0x678,0x145e)],_0x46704b,_0x3f2d44),_0x58046e=_0x45401a[_0x23937d(0x13bd,0x1d8e,0x1114,0x11d8)+'nc'](_0x313705(0xe81,0x311,0x15d2,0x5e8)+'AllData/st'+_0x23937d(0x1101,0x11c5,0x9f0,0x1751)+_0x313705(0x11ff,0xd95,0x1d41,0x3de));const _0xb85cb8={};_0xb85cb8[_0x313705(0x1360,0x1d2e,0x1877,0xa7f)]=_0x223706,_0x20cabf[_0x23937d(0x944,0x17d4,0x1337,0x14ec)+'e'](_0x295efe[_0x23937d(0x118c,0x1c8a,0x15af,0x1b71)],_0xb85cb8);}}break;case _0x4b485e['LsHvl']:if(_0x1bac1f)return _0x4b485e['KMcve'](_0x1db05d,mess['ban']);if(_0x1e03f5)return _0x1db05d(mess[_0x313705(0x926,0x1827,0xe30,0xf25)]);if(!_0x5cd288[_0x23937d(0x1d23,0x15d8,0x2779,0x1a29)])return _0x4b485e[_0x23937d(0x1a81,0x2020,0x2350,0x1585)](_0x516d85,mess[_0x313705(0x152c,0x12dd,0x1417,0x127e)]);if(!_0x34d670)return _0x4b485e[_0x313705(0x4d4,0x5de,0x120c,0x13b2)](_0x1db05d,mess['nsfw']);_0x1db05d(mess[_0x23937d(0x8ac,0x8cd,0xe3d,0x1765)]),waifudd=await axios[_0x23937d(0xc3d,0x4a,0x5c,0x1775)](_0x313705(0xb2e,0x54b,-0xd,0x1898)+'ifu.pics/a'+_0x313705(0x1e5d,0x1d6e,0x297e,0x2d05)+_0x1354e9);const _0x533e63={};_0x533e63[_0x313705(0x175a,0x1d10,0x1cb7,0xa12)+'t']='Next\x20⚡';const _0x3db1ce={};_0x3db1ce[_0x23937d(0x1b0c,0x1b46,0x280a,0x27a7)]=_0x23937d(0xd2c,0x1517,0x806,0x1bea),_0x3db1ce['buttonText']=_0x533e63,_0x3db1ce[_0x23937d(0x738,-0x5a0,0x107a,0xe37)]=0x1;let _0x2956cc=[_0x3db1ce];const _0x40ef3e={};_0x40ef3e[_0x313705(0xddf,0x158d,0x139e,0xee4)]=waifudd[_0x313705(0x117d,0x828,0x1ea3,0x1578)]['url'];const _0xb04496={};_0xb04496[_0x23937d(0x1c43,0x125d,0x118d,0x12bc)]=_0x40ef3e,_0xb04496['caption']=''+mess[_0x313705(0xcce,0xe4e,0x734,0x10d7)],_0xb04496[_0x23937d(0xc3a,0x4ea,0x18a6,0x3d0)]=_0x2956cc,_0xb04496[_0x313705(0x1e7f,0x1d66,0x1300,0x192d)]=0x1;let _0x590079=_0xb04496;await _0x175756[_0x313705(0xcaa,0x990,-0x24f,0x8e5)+'e'](_0x5cd288['chat'],_0x590079,{'quoted':_0x5cd288})[_0x313705(0xc9a,0xbf6,0x8c3,0x193a)](_0x408794=>{function _0x323642(_0x2a110b,_0x431f20,_0x435504,_0x59cccb){return _0x313705(_0x431f20-0x44,_0x59cccb,_0x435504-0x22,_0x59cccb-0x1cb);}return _0x4b485e[_0x323642(0xb47,0xaaf,0x84e,0x7bb)];});break;case _0x23937d(0x10ff,0x1eb4,0x6f6,0x6b8)+'o':case _0x4b485e['GnNIP']:if(_0x1bac1f)return _0x1db05d(mess[_0x23937d(0x61c,0x7e0,-0x38c,0xa41)]);if(_0x1e03f5)return _0x1db05d(mess[_0x313705(0x926,0x1fb,-0x4f1,0xa8b)]);if(!_0x5cd288[_0x313705(0x2089,0x2df1,0x1fd1,0x1f91)])return _0x4b485e[_0x313705(0x819,-0x6b8,-0x540,0x9fb)](_0x516d85,mess[_0x313705(0x152c,0x143f,0x143a,0xfad)]);if(!_0x34d670)return _0x4b485e[_0x23937d(0x10fc,0x1590,0x1e8a,0xeea)](_0x1db05d,mess[_0x23937d(0x1357,0xa1f,0xc91,0x161c)]);waifudd=await axios[_0x313705(0xfa3,0x1035,0xbfd,0x535)](_0x313705(0xb2e,0x15e,0x12f9,0x15f5)+'ifu.pics/a'+_0x23937d(0x1c42,0x1a30,0x137e,0x1ecc)+'ko');const _0x5ccf43={};_0x5ccf43[_0x313705(0x175a,0x1737,0x947,0x240a)+'t']=_0x23937d(0x16f1,0x2346,0x11b3,0x1856);const _0x409037={};_0x409037[_0x23937d(0x1b0c,0x2a10,0x20e4,0x2192)]='.hneko',_0x409037['buttonText']=_0x5ccf43,_0x409037['type']=0x1;let _0x4f5923=[_0x409037];const _0x55d23b={};_0x55d23b[_0x23937d(0xa79,0x9be,0xcd8,0xb)]=waifudd[_0x313705(0x117d,0x1dc7,0x60c,0x1309)][_0x23937d(0xa79,0x114d,0x6d6,0x405)];const _0x54fb87={};_0x54fb87[_0x313705(0x1fa9,0x22c9,0x2b7e,0x1ae2)]=_0x55d23b,_0x54fb87['caption']=''+mess[_0x313705(0xcce,0x7b9,0x1b6,0x1239)],_0x54fb87[_0x23937d(0xc3a,0x6af,0xb3,0x139b)]=_0x4f5923,_0x54fb87[_0x23937d(0x1b19,0x19c2,0xd5d,0x15f3)]=0x1;let _0x214713=_0x54fb87;await _0x175756['sendMessag'+'e'](_0x5cd288[_0x313705(0x14f2,0x2363,0x1f84,0xd88)],_0x214713,{'quoted':_0x5cd288})[_0x313705(0xc9a,0xf81,0x129b,0xdf9)](_0x2e2336=>{function _0x2091b0(_0x36c8d1,_0x19133b,_0x1f5dbb,_0x1d7966){return _0x313705(_0x1f5dbb- -0x21f,_0x19133b,_0x1f5dbb-0xa8,_0x1d7966-0xbd);}return _0x4b485e[_0x2091b0(0xea6,0x4cd,0x84c,0x10db)];});break;case _0x4b485e[_0x23937d(0xc75,0x218,0x1625,0xcc6)]:case _0x4b485e[_0x23937d(0x128,0xcd3,0xfd1,0x451)]:if(_0x1bac1f)return _0x4b485e[_0x313705(0x128e,0x1f0e,0x19c5,0xa0f)](_0x1db05d,mess[_0x23937d(0x61c,-0x837,-0x188,0x96f)]);if(_0x1e03f5)return _0x4b485e['GnBTw'](_0x1db05d,mess[_0x313705(0x926,-0x4e4,0xe4a,0xa7e)]);if(!_0x5cd288['isGroup'])return _0x4b485e[_0x313705(0x1e86,0x15fa,0x18a4,0x1f7e)](_0x516d85,mess['group']);if(!_0x34d670)return _0x4b485e[_0x23937d(0x10c4,0xb06,0xe43,0x1f29)](_0x1db05d,mess[_0x23937d(0x1357,0x50f,0x8f1,0xdbb)]);_0x4b485e['jaCqB'](_0x1db05d,mess[_0x313705(0xc12,0x10d3,0x1878,0x1727)]),waifudd=await axios['get'](_0x313705(0xb2e,0x17a9,0x153d,0x1552)+_0x23937d(0x1649,0xecb,0x1357,0x7ec)+_0x23937d(0x9d7,0x11b6,0x1883,0x12cf)+_0x23937d(0x3cd,-0x5b3,0x650,0xd5b));const _0x4285a0={};_0x4285a0[_0x313705(0x175a,0xdd1,0x1b9d,0x8c2)+'t']='Next\x20⚡';const _0x7cbf1b={};_0x7cbf1b[_0x23937d(0x1b0c,0x129c,0x27f3,0x279e)]=_0x23937d(0x11e0,0x145f,0x19f7,0x1ac3),_0x7cbf1b[_0x313705(0x1902,0x16ee,0x17d2,0x1c7d)]=_0x4285a0,_0x7cbf1b['type']=0x1;let _0x370145=[_0x7cbf1b];const _0x28b39f={};_0x28b39f[_0x313705(0xddf,0x1701,0xa17,0xb4)]=waifudd['data']['url'];const _0x20ded3={};_0x20ded3[_0x23937d(0x1c43,0x26a3,0x14f6,0x14e0)]=_0x28b39f,_0x20ded3['caption']=''+mess[_0x313705(0xcce,0x181,0x1271,0xad1)],_0x20ded3[_0x313705(0xfa0,0x18e9,0x12ea,0x1385)]=_0x370145,_0x20ded3['headerType']=0x1;let _0x51254e=_0x20ded3;await _0x175756[_0x313705(0xcaa,0x2a2,0x93a,0x15ec)+'e'](_0x5cd288[_0x23937d(0x118c,0x1465,0x16eb,0x15fa)],_0x51254e,{'quoted':_0x5cd288})[_0x23937d(0x934,-0xf6,0xf7c,0x870)](_0x5b9fe6=>{return _0x4b485e['vJiFV'];});break;case _0x4b485e[_0x23937d(0xd33,0xad3,0x965,0x12d1)]:if(_0x1bac1f)return _0x4b485e['fUBqC'](_0x1db05d,mess[_0x313705(0x982,0xa63,0x11a1,0xd4a)]);if(_0x1e03f5)return _0x1db05d(mess['banChat']);if(!_0x34d670)return _0x1db05d(mess['nsfw']);_0x4b485e[_0x313705(0x5fd,0x15b,-0x70e,0xfc4)](_0x1db05d,mess['wait']),waifudd=await axios['get']('https://ne'+_0x313705(0x1071,0xa18,0x1c33,0x12c2)+'pi/v2/img/'+_0x1354e9);const _0x4ba2db={};_0x4ba2db[_0x313705(0x175a,0x132d,0x1977,0xb3a)+'t']='Next\x20✨';const _0x5c19fc={};_0x5c19fc[_0x23937d(0x1b0c,0x26de,0x15a2,0x19f7)]='.'+_0x1354e9,_0x5c19fc[_0x313705(0x1902,0x20c1,0x21d2,0x103b)]=_0x4ba2db,_0x5c19fc[_0x313705(0xa9e,0x888,0x18ca,-0x3dc)]=0x1;var _0xfb9bc6=[_0x5c19fc];const _0x25b5dd={};_0x25b5dd[_0x313705(0xddf,0xde7,0x98a,0x62b)]=waifudd[_0x313705(0x117d,0x169f,0x1cec,0x1a8f)][_0x313705(0xddf,0x1079,-0xc4,0x48f)];const _0x14d718={};_0x14d718[_0x23937d(0x1c43,0x2797,0xf5f,0x154c)]=_0x25b5dd,_0x14d718[_0x23937d(0x968,0x3cd,0x7d7,0x1872)]=''+mess['caption'],_0x14d718[_0x313705(0x13d4,0x2284,0xce1,0x150b)]=''+global[_0x23937d(0x96c,0x1817,0x140,0xf37)],_0x14d718[_0x313705(0xfa0,0xeb4,0x300,0x960)]=_0xfb9bc6,_0x14d718['headerType']=0x4;let _0x525055=_0x14d718;await _0x175756['sendMessag'+'e'](_0x5cd288[_0x23937d(0x118c,0x9ac,0xbc8,0x1358)],_0x525055,{'quoted':_0x5cd288})['catch'](_0x349902=>{function _0x32cedd(_0x456326,_0x53f844,_0x3c7b95,_0xfb39bc){return _0x23937d(_0x3c7b95-0x39e,_0xfb39bc,_0x3c7b95-0x1e2,_0xfb39bc-0x2e);}return _0x4b485e[_0x32cedd(0x1741,0x8ab,0xaa3,-0x23e)];});break;case _0x4b485e[_0x313705(0xf24,0xdf8,0xd76,0x178f)]:if(_0x1bac1f)return _0x4b485e['VZWFS'](_0x1db05d,mess[_0x313705(0x982,-0x159,0x641,0x125f)]);if(_0x1e03f5)return _0x1db05d(mess['banChat']);_0x4b485e[_0x23937d(0x99d,0xdee,0xb03,0x665)](_0x1db05d,mess['wait']),waifudd=await axios['get'](_0x23937d(0x1672,0x1bb7,0x7bb,0x14a4)+_0x313705(0x1071,0xcca,0xced,0xec3)+'pi/v2/img/'+_0x313705(0xe25,0x2a,0x1cff,0xdd5));const _0x2385d9={};_0x2385d9[_0x313705(0x175a,0x1865,0x982,0x207e)+'t']=_0x23937d(0xd26,0x13b3,0x904,0x17b9);const _0x1c9482={};_0x1c9482['buttonId']='.'+_0x1354e9,_0x1c9482[_0x313705(0x1902,0x1c38,0x17d6,0x219c)]=_0x2385d9,_0x1c9482[_0x313705(0xa9e,0xf27,-0x146,0x705)]=0x1;var _0xfb9bc6=[_0x1c9482];const _0x1ebaee={};_0x1ebaee['url']=waifudd[_0x313705(0x117d,0x153d,0x128b,0x1d57)]['url'];const _0x2a4eca={};_0x2a4eca[_0x23937d(0x1c43,0x1143,0x1215,0xd41)]=_0x1ebaee,_0x2a4eca['caption']=''+mess[_0x23937d(0x968,0xb89,-0x261,0x1f9)],_0x2a4eca[_0x313705(0x13d4,0x16e1,0xeaf,0x186f)]=''+global[_0x313705(0xcd2,0x1b1b,0x7d8,0x1369)],_0x2a4eca['buttons']=_0xfb9bc6,_0x2a4eca[_0x313705(0x1e7f,0x190a,0x1162,0x2b90)]=0x4;let _0x424ff6=_0x2a4eca;await _0x175756[_0x23937d(0x944,0xb6c,0xcd5,0x17be)+'e'](_0x5cd288['chat'],_0x424ff6,{'quoted':_0x5cd288})[_0x313705(0xc9a,0x187b,0x147b,0x1a27)](_0x108efb=>{function _0x4db231(_0x287ca0,_0x179428,_0x49e010,_0x55d23a){return _0x313705(_0x55d23a- -0x19d,_0x49e010,_0x49e010-0x19e,_0x55d23a-0xe);}return _0x4b485e[_0x4db231(0x2e0,0xeb8,0x1061,0x8ce)];});break;case _0x4b485e[_0x313705(0xc2b,0x5d0,0xd22,-0x44)]:if(_0x1bac1f)return _0x1db05d(mess[_0x23937d(0x61c,0xda1,-0x2ba,-0x2f3)]);if(_0x1e03f5)return _0x1db05d(mess[_0x313705(0x926,0x31d,0x11c4,-0x2f)]);_0x4b485e[_0x23937d(0x107c,0x282,0xef3,0x9ca)](_0x1db05d,mess['wait']),waifudd=await axios[_0x23937d(0xc3d,0x4b1,0xb15,0x2ca)](_0x23937d(0x1672,0x1313,0x1de4,0x1f0e)+_0x313705(0x1071,0xd80,0x1e00,0x9f6)+_0x23937d(0x18b2,0x1a88,0x17d6,0x26a2)+'fox_girl');const _0x30ac1e={};_0x30ac1e['displayTex'+'t']=_0x313705(0x108c,0xc48,0x1d8b,0x653);const _0x1d8e3c={};_0x1d8e3c[_0x313705(0x1e72,0x2b63,0x1036,0x2983)]='.'+_0x1354e9,_0x1d8e3c[_0x23937d(0x159c,0x1121,0xe97,0x1582)]=_0x30ac1e,_0x1d8e3c['type']=0x1;var _0xfb9bc6=[_0x1d8e3c];const _0x2163c2={};_0x2163c2[_0x313705(0xddf,0x975,0x822,0x1b46)]=waifudd[_0x313705(0x117d,0xbd6,0x1c3a,0x2c8)][_0x23937d(0xa79,0xdfe,0x1007,0xcf)];const _0x36f7d9={};_0x36f7d9['image']=_0x2163c2,_0x36f7d9[_0x23937d(0x968,0x1560,-0x2d5,0x2cd)]=''+mess[_0x313705(0xcce,0x300,0xa1c,0x1923)],_0x36f7d9['footer']=''+global[_0x313705(0xcd2,0x2be,0x18a4,0x117c)],_0x36f7d9[_0x313705(0xfa0,0x257,0x1565,0xfc9)]=_0xfb9bc6,_0x36f7d9['headerType']=0x4;let _0x43a374=_0x36f7d9;await _0x175756['sendMessag'+'e'](_0x5cd288['chat'],_0x43a374,{'quoted':_0x5cd288})[_0x23937d(0x934,0x6c9,0x548,0x16e8)](_0x467d48=>{function _0x1e6337(_0x22a5ce,_0x5d962d,_0xcbc743,_0xd58094){return _0x313705(_0x5d962d-0xf4,_0xd58094,_0xcbc743-0xcd,_0xd58094-0x12f);}return _0x4b485e[_0x1e6337(0x12af,0xb5f,0x16ff,0x75b)];});break;case _0x4b485e[_0x23937d(0xe1,0xba1,-0x1ac,-0xbf4)]:if(_0x1bac1f)return _0x4b485e[_0x313705(0x35b,-0x8a2,0x104c,-0x59e)](_0x1db05d,mess['ban']);if(_0x1e03f5)return _0x4b485e[_0x313705(0x207d,0x2281,0x1e08,0x207d)](_0x1db05d,mess[_0x23937d(0x5c0,0xbd1,0x963,-0x859)]);if(!_0x5cd288['isGroup'])return _0x4b485e[_0x23937d(0x9a7,0x9cc,0x205,-0x571)](_0x516d85,mess['group']);waifudd=await axios[_0x23937d(0xc3d,0xff7,0x148d,0xabf)](_0x23937d(0x7c8,0x5d5,0xb5b,0x891)+'ifu.pics/a'+_0x313705(0x1a14,0x24d1,0x165d,0x2774));const _0x15432f={};_0x15432f[_0x23937d(0x13f4,0x13a2,0x68f,0x4f1)+'t']='Next\x20⚡';const _0x40da98={};_0x40da98[_0x313705(0x1e72,0x1204,0x2277,0x23e1)]='.nom',_0x40da98[_0x313705(0x1902,0x1e2e,0x148a,0x9f0)]=_0x15432f,_0x40da98[_0x23937d(0x738,0x1285,-0x78e,0x299)]=0x1;let _0x583df5=[_0x40da98];const _0x187234={};_0x187234[_0x23937d(0xa79,0xe25,-0x492,0xbcb)]=waifudd['data'][_0x23937d(0xa79,0xf4b,0x684,-0x4f)];const _0x5badd9={};_0x5badd9[_0x313705(0x1fa9,0x1908,0x2867,0x18e4)]=_0x187234,_0x5badd9['caption']=''+mess[_0x313705(0xcce,0x1619,0x1880,0x717)],_0x5badd9[_0x23937d(0xc3a,0x16a1,0x82f,0x164)]=_0x583df5,_0x5badd9[_0x23937d(0x1b19,0x2661,0xc09,0x26e8)]=0x1;let _0x5e0a71=_0x5badd9;await _0x175756[_0x313705(0xcaa,0x13a1,0x1b9b,0x16f9)+'e'](_0x5cd288[_0x23937d(0x118c,0xefd,0xa46,0x9ac)],_0x5e0a71,{'quoted':_0x5cd288})[_0x23937d(0x934,0x176f,-0x4e6,0xc7)](_0x2485a2=>{function _0x52f368(_0x4c5b39,_0x42307,_0x390702,_0x2c7924){return _0x313705(_0x390702-0x104,_0x42307,_0x390702-0xed,_0x2c7924-0x1d8);}return _0x4b485e[_0x52f368(0x26f,0xbc3,0xb6f,0xc3e)];});break;case _0x4b485e['uTPho']:if(_0x1bac1f)return _0x4b485e['YLdGv'](_0x1db05d,mess[_0x313705(0x982,0x93b,0x3ec,-0x188)]);if(_0x1e03f5)return _0x1db05d(mess[_0x23937d(0x5c0,-0x6b3,-0x3c6,0xfcd)]);_0x1db05d(mess[_0x313705(0xc12,0x15b7,0x6,-0x38)]),waifudd=await axios[_0x23937d(0xc3d,0xd33,0x1957,0x93c)](_0x23937d(0x1672,0x1402,0x11d6,0x1e3b)+_0x313705(0x1071,0x1d4e,0xb99,0x1a16)+_0x23937d(0x18b2,0x1012,0x1a2e,0x1420)+_0x313705(0x9b8,0x10e9,0x5a5,0xa06));const _0x4eb918={};_0x4eb918[_0x313705(0x175a,0xf49,0xfd1,0x22fd)+'t']=_0x23937d(0xd26,0x1518,0xd1f,0x92b);const _0x2bef0f={};_0x2bef0f[_0x313705(0x1e72,0x1ebd,0x13cb,0x2bc6)]='.'+_0x1354e9,_0x2bef0f[_0x313705(0x1902,0x27d8,0x1fbf,0x1fc4)]=_0x4eb918,_0x2bef0f[_0x23937d(0x738,0x83c,0x992,0x31)]=0x1;var _0xfb9bc6=[_0x2bef0f];const _0x51ccff={};_0x51ccff[_0x23937d(0xa79,0x98b,0xe5c,0xd6)]=waifudd[_0x23937d(0xe17,0x1644,0x1ca3,0x974)][_0x313705(0xddf,0x11ac,0x730,0x14a0)];const _0x33e9e6={};_0x33e9e6[_0x313705(0x1fa9,0x2dff,0x2167,0x1488)]=_0x51ccff,_0x33e9e6[_0x23937d(0x968,0xfaa,0x47c,-0x12f)]=''+mess[_0x313705(0xcce,0x7c1,0x39c,0x1467)],_0x33e9e6[_0x313705(0x13d4,0xc28,0x915,0x1685)]=''+global[_0x23937d(0x96c,0x760,0x1224,0x15a9)],_0x33e9e6[_0x313705(0xfa0,0x921,0x879,0x887)]=_0xfb9bc6,_0x33e9e6['headerType']=0x4;let _0x30c7c7=_0x33e9e6;await _0x175756[_0x313705(0xcaa,0xbc1,0x68f,0x1576)+'e'](_0x5cd288[_0x23937d(0x118c,0xc0f,0x1f72,0x17ad)],_0x30c7c7,{'quoted':_0x5cd288})[_0x23937d(0x934,-0x3e3,0x1431,0xe0a)](_0x24a598=>{function _0x37a2e6(_0x1d46db,_0x240e7d,_0x13e7fd,_0x4f0cc0){return _0x313705(_0x1d46db-0x36,_0x4f0cc0,_0x13e7fd-0x148,_0x4f0cc0-0x1d4);}return _0x4b485e[_0x37a2e6(0xaa1,0x54d,0x15aa,0x13d6)];});break;case _0x4b485e[_0x23937d(0x164b,0x140f,0x1d04,0x1e0f)]:if(_0x1bac1f)return _0x4b485e['rThNd'](_0x1db05d,mess[_0x313705(0x982,0x16de,0x832,0x14f8)]);if(_0x1e03f5)return _0x4b485e['hvXbV'](_0x1db05d,mess[_0x313705(0x926,0x2f6,-0x199,-0x19b)]);_0x1db05d(mess[_0x313705(0xc12,0x1e2,0x577,0x2e3)]),waifud=await axios['get'](_0x4b485e[_0x313705(0x18e6,0x9f3,0x1ad0,0x12d0)]);const _0x567b13={};_0x567b13[_0x313705(0x175a,0x24a3,0x20d9,0x1164)+'t']='Next\x20✨';const _0x24bc03={};_0x24bc03[_0x23937d(0x1b0c,0x218d,0x1432,0x114a)]=_0x313705(0x18a1,0x23da,0x1554,0x2289),_0x24bc03[_0x313705(0x1902,0x1e02,0xcf1,0xe24)]=_0x567b13,_0x24bc03[_0x23937d(0x738,0xddd,-0x274,-0x3bd)]=0x1;var _0x5097d7=[_0x24bc03];const _0x55dd9f={};_0x55dd9f[_0x313705(0xddf,0x150f,0x1627,-0x6a)]=waifud[_0x23937d(0xe17,0x90,0x1249,0x8ca)][_0x23937d(0xa79,0x639,-0x92,0x533)];const _0x55796f={};_0x55796f['image']=_0x55dd9f,_0x55796f[_0x23937d(0x968,-0x457,-0x2c9,0x13ac)]=''+mess['caption'],_0x55796f[_0x313705(0x13d4,0xcfd,0x1c86,0x117c)]=''+global[_0x23937d(0x96c,0x891,0x79f,0x159d)],_0x55796f[_0x313705(0xfa0,0xf5d,0x498,0x13ae)]=_0x5097d7,_0x55796f['headerType']=0x4;let _0x16c147=_0x55796f;await _0x175756[_0x313705(0xcaa,0xe5e,0xf72,0x2ff)+'e'](_0x5cd288[_0x313705(0x14f2,0x2274,0x16f5,0x13d7)],_0x16c147,{'quoted':_0x5cd288})['catch'](_0x1f8447=>{function _0x124ddf(_0x246504,_0xd6dbed,_0x38d590,_0xd02676){return _0x23937d(_0xd02676-0xf,_0xd6dbed,_0x38d590-0x60,_0xd02676-0x137);}return _0x4b485e[_0x124ddf(0x1544,0xe97,-0x72d,0x714)];});break;case _0x4b485e['EoxfV']:if(_0x1bac1f)return _0x4b485e[_0x23937d(0x1ad8,0xcea,0x119b,0x1046)](_0x1db05d,mess[_0x23937d(0x61c,0xc62,-0x376,-0x52e)]);if(_0x1e03f5)return _0x4b485e[_0x23937d(0x1618,0x15c6,0x9c0,0x11b4)](_0x1db05d,mess[_0x313705(0x926,0x13a9,-0x36,0xe7a)]);_0x4b485e[_0x23937d(0x60b,0x107f,-0x908,0x7ef)](_0x1db05d,mess[_0x23937d(0x8ac,-0x190,0x65a,-0x544)]),waifudd=await axios['get']('https://ne'+_0x313705(0x1071,0xcc7,0x9b5,0x14b1)+_0x313705(0x1c18,0x23c0,0x1e43,0x2a2b)+'cuddle');const _0x174584={};_0x174584['displayTex'+'t']=_0x23937d(0xd26,0x323,0x73d,0xe6f);const _0x557672={};_0x557672[_0x313705(0x1e72,0x1048,0x1744,0x1e14)]='.'+_0x1354e9,_0x557672['buttonText']=_0x174584,_0x557672[_0x313705(0xa9e,0x15a4,0x1858,0x1974)]=0x1;var _0xfb9bc6=[_0x557672];const _0x529841={};_0x529841['url']=waifudd[_0x313705(0x117d,0x7de,0xfdc,0x1c26)][_0x313705(0xddf,0x73b,0xdec,0xf88)];const _0x2e599d={};_0x2e599d[_0x23937d(0x1c43,0x1153,0x1d65,0x2408)]=_0x529841,_0x2e599d[_0x313705(0xcce,0x1081,0x18ca,0x19cb)]=''+mess[_0x313705(0xcce,0x1b95,0x10ea,0x12fe)],_0x2e599d[_0x313705(0x13d4,0xb3a,0x7d5,0x145d)]=''+global[_0x313705(0xcd2,-0x1ac,0x176f,0x1329)],_0x2e599d[_0x23937d(0xc3a,0x111f,0x1457,0x167d)]=_0xfb9bc6,_0x2e599d[_0x23937d(0x1b19,0xe6f,0x217a,0x1266)]=0x4;let _0x50b448=_0x2e599d;await _0x175756[_0x23937d(0x944,-0x510,-0x374,0x14ab)+'e'](_0x5cd288[_0x313705(0x14f2,0x19d9,0x1706,0x6ae)],_0x50b448,{'quoted':_0x5cd288})['catch'](_0x3c2709=>{function _0x3357d6(_0x41d83e,_0x5b4bae,_0x3b85a3,_0x329cca){return _0x313705(_0x329cca- -0x43c,_0x5b4bae,_0x3b85a3-0x97,_0x329cca-0xdd);}return _0x4b485e[_0x3357d6(0xc70,0x13b8,-0x7bd,0x62f)];});break;case _0x4b485e[_0x23937d(0x30d,0x5fd,-0x63d,0xee9)]:if(_0x1bac1f)return _0x1db05d(mess[_0x313705(0x982,0xc7a,0x1684,0x165f)]);if(_0x1e03f5)return _0x4b485e[_0x23937d(0x2b9,0x874,0x58d,-0x2dd)](_0x1db05d,mess[_0x23937d(0x5c0,0x3ab,0xf94,0x6b9)]);_0x4b485e[_0x23937d(0x9c5,0x6db,0x12d3,-0x398)](_0x1db05d,mess[_0x313705(0xc12,0x6e9,-0x1ff,0xdf8)]),waifudd=await axios[_0x23937d(0xc3d,-0x211,0x3d5,0x1ab8)](_0x313705(0x19d8,0x1522,0x2210,0x1c88)+_0x23937d(0xd0b,0x1b30,0x11c5,0x1bfb)+_0x23937d(0x18b2,0x12bf,0xef7,0x1fdb)+_0x23937d(0x1d43,0x1f31,0x18e0,0x1ce8));const _0x16140c={};_0x16140c[_0x23937d(0x13f4,0x18f8,0x20db,0x16c4)+'t']=_0x23937d(0xd26,0x1c3,0xb35,0x90b);const _0x128696={};_0x128696[_0x313705(0x1e72,0x27f2,0xfdb,0x164f)]='.'+_0x1354e9,_0x128696[_0x313705(0x1902,0xf3d,0x20a1,0x2389)]=_0x16140c,_0x128696[_0x23937d(0x738,-0x6eb,0x7d3,0x15e8)]=0x1;var _0xfb9bc6=[_0x128696];const _0x36a7cb={};_0x36a7cb[_0x23937d(0xa79,-0x18e,0x1238,0x3fa)]=waifudd['data']['url'];const _0xba57ad={};_0xba57ad[_0x23937d(0x1c43,0x253f,0x23f4,0xe7d)]=_0x36a7cb,_0xba57ad['caption']=''+mess[_0x23937d(0x968,-0x16c,0x1082,0x222)],_0xba57ad[_0x23937d(0x106e,0x1f06,0xb75,0x397)]=''+global[_0x313705(0xcd2,0x1896,0xcbb,0xe4c)],_0xba57ad[_0x23937d(0xc3a,0x1899,0xc3b,0x1090)]=_0xfb9bc6,_0xba57ad[_0x313705(0x1e7f,0x2474,0x13ac,0x1d0b)]=0x4;let _0x2ff42b=_0xba57ad;await _0x175756['sendMessag'+'e'](_0x5cd288['chat'],_0x2ff42b,{'quoted':_0x5cd288})[_0x23937d(0x934,-0x594,0x1535,-0x6c)](_0x5a4d00=>{function _0x736272(_0x4871f4,_0x140fbd,_0x34e008,_0x739efc){return _0x313705(_0x4871f4- -0x283,_0x739efc,_0x34e008-0x191,_0x739efc-0x1e0);}function _0x305be3(_0x39d6a4,_0x1c026b,_0x5ee266,_0x24cdcc){return _0x313705(_0x1c026b- -0x3dd,_0x24cdcc,_0x5ee266-0x19c,_0x24cdcc-0xe6);}if(_0x4b485e[_0x305be3(-0x221,0x3a9,0x11ef,0x7af)](_0x4b485e[_0x305be3(0xbb0,0x1292,0xa64,0x1c5a)],_0x4b485e[_0x305be3(0xedb,0x1bd9,0xf41,0xebc)]))var _0x3a0339=_0x4b485e['HhxYu'];else return _0x4b485e[_0x305be3(0x2d3,0x68e,0x556,0x8cb)];});break;case _0x4b485e[_0x313705(0x1378,0x8e2,0x1ef5,0x16cc)]:if(_0x1bac1f)return _0x4b485e[_0x23937d(0x10ac,0x1764,0xeb0,0x11ed)](_0x1db05d,mess[_0x23937d(0x61c,-0x763,0x1b7,-0x5b1)]);if(_0x1e03f5)return _0x4b485e['IUTEW'](_0x1db05d,mess['banChat']);_0x4b485e[_0x23937d(0x1088,0x1ea7,0x1e0c,0x399)](_0x1db05d,mess[_0x23937d(0x8ac,0xd04,0x16a1,0x137d)]),waifudd=await axios[_0x313705(0xfa3,0x161b,0x1c5c,0x268)](_0x313705(0x19d8,0xff9,0x1eb2,0x2730)+_0x313705(0x1071,0x16d5,0x40b,0x397)+_0x23937d(0x18b2,0x1665,0x19df,0x14f4)+_0x313705(0x181b,0x26c3,0x13e3,0x23a0));const _0x4d1667={};_0x4d1667[_0x313705(0x175a,0x1c96,0xd21,0x125c)+'t']='Next\x20✨';const _0x3a64af={};_0x3a64af[_0x23937d(0x1b0c,0x1506,0x183d,0x2139)]='.'+_0x1354e9,_0x3a64af[_0x23937d(0x159c,0x7ac,0xdd6,0xc90)]=_0x4d1667,_0x3a64af[_0x23937d(0x738,0x10bd,0x4e8,-0x4d8)]=0x1;var _0xfb9bc6=[_0x3a64af];const _0x2af4e7={};_0x2af4e7[_0x313705(0xddf,0x128b,0x896,0x879)]=waifudd['data'][_0x23937d(0xa79,0x123c,-0x122,0xd43)];const _0x1a916b={};_0x1a916b['image']=_0x2af4e7,_0x1a916b[_0x313705(0xcce,0x703,0x202,0xf39)]=''+mess[_0x23937d(0x968,0x1230,0x89f,0x11ef)],_0x1a916b[_0x23937d(0x106e,0x2f9,0x10ae,0x1e42)]=''+global[_0x313705(0xcd2,0x101e,0x1511,0xef5)],_0x1a916b[_0x313705(0xfa0,0x1002,0x1543,0x19f8)]=_0xfb9bc6,_0x1a916b['headerType']=0x4;let _0x3544d8=_0x1a916b;await _0x175756[_0x313705(0xcaa,0x1a87,0x641,0x1618)+'e'](_0x5cd288[_0x313705(0x14f2,0x207d,0x194c,0xf44)],_0x3544d8,{'quoted':_0x5cd288})[_0x23937d(0x934,0x16a1,0xd26,0x171d)](_0x342229=>{return _0x4b485e['vJiFV'];});break;case _0x313705(0x5ae,0x1a2,0x23f,-0x27a):if(_0x1bac1f)return _0x1db05d(mess[_0x313705(0x982,0x638,0x77d,0xd63)]);if(_0x1e03f5)return _0x4b485e[_0x23937d(0x15c3,0xbbb,0x1311,0x14ba)](_0x1db05d,mess[_0x23937d(0x5c0,-0x724,-0x426,0xe8d)]);_0x4b485e[_0x313705(0x1327,0x184a,0x11a7,0x1ddd)](_0x1db05d,mess[_0x23937d(0x8ac,0x77c,-0x2b2,0x1ce)]),waifudd=await axios[_0x313705(0xfa3,0xe26,0xf85,0xca3)](_0x313705(0x19d8,0xc00,0x1fd5,0x1281)+_0x23937d(0xd0b,0xeac,0x18bd,-0xeb)+_0x23937d(0x18b2,0x2404,0xa04,0xb09)+_0x23937d(0xfbd,0x1ab0,0x14ff,0x2a2));const _0x1e2852={};_0x1e2852[_0x23937d(0x13f4,0x1023,0x2283,0xd46)+'t']=_0x23937d(0xd26,0x257,0x144d,0x839);const _0x9d9b42={};_0x9d9b42[_0x313705(0x1e72,0x1a6b,0x2637,0x1e53)]='.'+_0x1354e9,_0x9d9b42[_0x23937d(0x159c,0x234d,0x166c,0x1777)]=_0x1e2852,_0x9d9b42[_0x313705(0xa9e,0x1779,0x173b,-0x49)]=0x1;var _0xfb9bc6=[_0x9d9b42];const _0x610378={};_0x610378[_0x313705(0xddf,0x62a,0x146b,0x2a9)]=waifudd[_0x313705(0x117d,0x1cfd,0x537,0x1816)][_0x313705(0xddf,0x19b9,0x117d,0x6f1)];const _0x11c39d={};_0x11c39d[_0x23937d(0x1c43,0x19fc,0x179d,0x1457)]=_0x610378,_0x11c39d[_0x23937d(0x968,0x3,0x1791,0x12af)]=''+mess[_0x23937d(0x968,0x520,0x99e,0x10fb)],_0x11c39d[_0x313705(0x13d4,0x1cef,0x1b93,0xce4)]=''+global[_0x23937d(0x96c,0xc12,0x15e6,0x17e9)],_0x11c39d['buttons']=_0xfb9bc6,_0x11c39d[_0x23937d(0x1b19,0x1732,0x1036,0x1604)]=0x4;let _0x308aff=_0x11c39d;await _0x175756[_0x313705(0xcaa,-0x23e,0x1642,0x112f)+'e'](_0x5cd288['chat'],_0x308aff,{'quoted':_0x5cd288})[_0x23937d(0x934,0x10f6,0x1663,0xc1)](_0xe46df2=>{function _0x2c2f3e(_0x568e27,_0x4d8c52,_0x303d6f,_0x5ca372){return _0x23937d(_0x568e27-0x193,_0x303d6f,_0x303d6f-0x1bc,_0x5ca372-0x178);}const _0x40c5a6={'eAUnG':_0x2c2f3e(0x84c,0x154,-0x643,0x11e3)+_0x9797b4(-0x568,0x86e,0x909,-0x5c1)+_0x9797b4(0xb68,0x1326,0x1acf,0x597),'ypzNk':_0x4b485e[_0x9797b4(0xbec,0x324,-0x18d,0x199)],'NUvlD':function(_0x57e722,_0x3e635f){function _0x2ce07e(_0x2a54d6,_0x22beb6,_0x1721fe,_0x563bb6){return _0x9797b4(_0x2a54d6-0x3c,_0x563bb6-0x2c1,_0x1721fe-0x5f,_0x1721fe);}return _0x4b485e[_0x2ce07e(0x224b,0x13b9,0x2a33,0x1d81)](_0x57e722,_0x3e635f);},'Ngrqa':function(_0xc02441,_0x307088){return _0x4b485e['nwXCS'](_0xc02441,_0x307088);},'cLyCu':function(_0x138847,_0x5c8d01){function _0x310070(_0x3b6947,_0x539fe2,_0xea8c14,_0x268efb){return _0x9797b4(_0x3b6947-0x1ae,_0x539fe2-0x25,_0xea8c14-0xf6,_0x268efb);}return _0x4b485e[_0x310070(0x145c,0x1057,0x794,0xd04)](_0x138847,_0x5c8d01);},'zurpP':function(_0x2bfd2f,_0x189fee){function _0x525a05(_0x76479e,_0x4426c3,_0xe282db,_0x1bcfc0){return _0x9797b4(_0x76479e-0x32,_0xe282db-0x3d5,_0xe282db-0x9f,_0x1bcfc0);}return _0x4b485e[_0x525a05(0x4cc,-0xb6,0x87a,0x51b)](_0x2bfd2f,_0x189fee);}};function _0x9797b4(_0x5c4d19,_0x81e93c,_0x215ee6,_0x29b7e7){return _0x23937d(_0x81e93c- -0xaf,_0x29b7e7,_0x215ee6-0xb0,_0x29b7e7-0x1ea);}if(_0x4b485e['pRrLs']===_0x4b485e[_0x2c2f3e(0x1a83,0x1e53,0x1a27,0x13c5)]){if(_0x1d5fba)return _0x40c5a6[_0x2c2f3e(0x1600,0xd32,0x17b4,0x1c00)](_0x330920,_0x467477[_0x2c2f3e(0x7af,0x8bc,0x943,0x184)]);if(_0x501595)return _0x40c5a6[_0x2c2f3e(0x1227,0x1323,0x133e,0x1a4f)](_0x7de201,_0x47fcfe['banChat']);if(!_0x2bc62c[_0x9797b4(0xe1d,0x1b67,0x1874,0x1ca9)]('\x20'))return _0x40c5a6[_0x2c2f3e(0x192d,0x26e8,0x1abc,0x21b7)](_0x1ae851,_0x2c2f3e(0xf38,0x924,0xead,0x11a4)+_0x40c5a6['zurpP'](_0x145a9f,_0x2c5015)+('\x20mobile\x20le'+_0x2c2f3e(0xb8f,0x1656,0xaef,-0x71)));_0x2a61f9[_0x2c2f3e(0x1766,0x214b,0x8a6,0x146b)](_0x715d53[_0x2c2f3e(0x1da9,0x10b9,0xee8,0xeda)]('\x20'))['then'](async _0x232c0b=>{_0x4f4ce0=_0x40c5a6[_0x1e057c(0x48c,0x804,0x241,-0x121)];for(let _0x113897 of _0x232c0b){_0x18617d+='\x0a\x0a'+_0x113897[_0x1e057c(0xa45,0x13ba,0x1e34,0xeda)]+'\x0a',_0x2fe4e5+=''+_0x113897['link'];}const _0x11ebf5={};_0x11ebf5['displayTex'+'t']=_0x40c5a6[_0x1e057c(0x14ed,0x1c2b,0x2923,0x2320)];const _0x2ae500={};function _0x1e057c(_0x30a4d,_0x45fccc,_0x3daedf,_0x11d745){return _0x9797b4(_0x30a4d-0x155,_0x45fccc-0x18,_0x3daedf-0x19c,_0x11d745);}_0x2ae500['buttonId']=_0x30b70d(0x26b9,0x144d,0x27d5,0x1fde);function _0x30b70d(_0x5ca1ce,_0x4555d7,_0x529a53,_0x29ee03){return _0x2c2f3e(_0x29ee03-0x43b,_0x4555d7-0x1f2,_0x4555d7,_0x29ee03-0x17b);}_0x2ae500['buttonText']=_0x11ebf5,_0x2ae500[_0x1e057c(0x5c1,0x6a1,-0x716,-0x29c)]=0x1;let _0x67deb=[_0x2ae500];const _0x534036={};_0x534036['url']=_0x232c0b[-0x1f51+-0x1df8+0x3d49*0x1][_0x30b70d(0x1830,0x25b9,0x14d0,0x2175)];const _0x92b16a={};_0x92b16a[_0x1e057c(0x1b6e,0x1bac,0x1547,0x2190)]=_0x534036,_0x92b16a[_0x1e057c(0x613,0x423,0xcb7,0x696)+_0x1e057c(-0xc2,0xc7a,0x11fc,0x3af)]=_0x50151a,_0x92b16a['caption']=_0x1aae0d,_0x92b16a[_0x1e057c(0x1ba,0xfd7,0x19d7,0x529)]=''+_0x40b1f0[_0x30b70d(0x1984,0x1898,0xf6,0xf3a)],_0x92b16a[_0x1e057c(0x123,0xba3,0x100f,0xf4f)]=_0x67deb,_0x92b16a[_0x1e057c(0x2007,0x1a82,0x22e2,0x2710)]=0x4;let _0x1484f1=_0x92b16a;const _0xb17249={};_0xb17249[_0x30b70d(-0x1ab,-0x1b2,0x683,0xbaa)]=_0x280f2a,_0x139abb[_0x1e057c(0xa05,0x8ad,0xc03,0x1622)+'e'](_0x533b38[_0x1e057c(0xda8,0x10f5,0x1fb4,0xaca)],_0x1484f1,_0xb17249);});}else return _0x9797b4(-0x3e6,-0xa9,-0x354,0x39b);});break;case _0x4b485e[_0x313705(0x1ff1,0x1ec2,0x26c1,0x2b18)]:if(_0x1bac1f)return _0x4b485e['hCcoI'](_0x1db05d,mess['ban']);if(_0x1e03f5)return _0x4b485e[_0x313705(0x4ce,-0x9c4,0x3dc,0x991)](_0x1db05d,mess[_0x23937d(0x5c0,-0x830,0xf1c,0x14c9)]);_0x4b485e[_0x23937d(0x1a17,0x2451,0xc98,0xd05)](_0x1db05d,mess[_0x23937d(0x8ac,0x116a,0x164,0x1516)]),waifudd=await axios[_0x313705(0xfa3,0x9a,0x3ad,0x2f6)](_0x23937d(0x1672,0x1986,0x178f,0x1e43)+_0x313705(0x1071,0x4ee,0x78b,0x55e)+'pi/v2/img/'+_0x23937d(0xf51,0xd8d,0x170c,0x1370));const _0x14c93d={};_0x14c93d[_0x23937d(0x13f4,0x20cf,0x14e5,0x774)+'t']=_0x23937d(0xd26,0xd39,0x108a,0x2d5);const _0x534345={};_0x534345[_0x23937d(0x1b0c,0x28ca,0x29f9,0x1f1e)]='.'+_0x1354e9,_0x534345['buttonText']=_0x14c93d,_0x534345[_0x313705(0xa9e,0x10fb,0xf80,0x17a6)]=0x1;var _0xfb9bc6=[_0x534345];const _0x2a69f2={};_0x2a69f2[_0x23937d(0xa79,0x16c8,0x8b1,0x13a3)]=waifudd[_0x313705(0x117d,0x321,0xf13,0x863)]['url'];const _0x54fd91={};_0x54fd91[_0x313705(0x1fa9,0x2873,0x132f,0x2719)]=_0x2a69f2,_0x54fd91['caption']=''+mess[_0x313705(0xcce,0x1970,0x1397,0x24e)],_0x54fd91[_0x23937d(0x106e,0x11ab,0x1a7d,0x19aa)]=''+global['botname'],_0x54fd91[_0x23937d(0xc3a,0x12cd,0x497,0x109)]=_0xfb9bc6,_0x54fd91[_0x313705(0x1e7f,0x1962,0x17e2,0x1e4d)]=0x4;let _0xb099ee=_0x54fd91;await _0x175756['sendMessag'+'e'](_0x5cd288[_0x23937d(0x118c,0x1333,0x12d2,0x1388)],_0xb099ee,{'quoted':_0x5cd288})[_0x23937d(0x934,0xd7,0x1465,0xcc0)](_0x5e0c2b=>{const _0x4461d1={'hkweQ':function(_0x6e64d2,_0x1980f2){function _0x149485(_0x495df6,_0x1a63f8,_0x27dc19,_0x4ec863){return _0x2506(_0x4ec863- -0x197,_0x495df6);}return _0x4b485e[_0x149485(0x62a,0x231,0x791,0x82d)](_0x6e64d2,_0x1980f2);}};function _0x3eb3f9(_0xa2a110,_0x5dca1a,_0x35f97f,_0x341031){return _0x23937d(_0xa2a110-0x88,_0x5dca1a,_0x35f97f-0x111,_0x341031-0x34);}function _0x42edb5(_0x4dee1c,_0x48b5d7,_0x319531,_0x403bef){return _0x313705(_0x4dee1c- -0x1c,_0x403bef,_0x319531-0xe2,_0x403bef-0x13b);}return _0x4b485e[_0x3eb3f9(0x1cf1,0x1eb6,0x24ee,0x1ac3)](_0x4b485e[_0x3eb3f9(0x264,-0x5d1,-0xa10,-0xd2)],_0x4b485e[_0x3eb3f9(0x264,0xb41,-0x2e2,0x739)])?_0x4461d1[_0x3eb3f9(0x9da,0x774,0x1620,0x10da)](_0x3d4ee4,this['a'])?this['b']:_0x400ecd===this['b']?this['a']:'':_0x4b485e[_0x42edb5(0xa4f,0x33f,0xefd,0x1693)];});break;case _0x4b485e[_0x313705(0x1143,0x789,0x1be3,0x1d85)]:if(_0x1bac1f)return _0x4b485e[_0x23937d(0x14e2,0x194f,0x1755,0x193a)](_0x1db05d,mess[_0x23937d(0x61c,0xacb,-0x855,0x81d)]);if(_0x1e03f5)return _0x1db05d(mess['banChat']);_0x4b485e[_0x23937d(0x1884,0x172b,0x1c90,0xb96)](_0x1db05d,mess[_0x23937d(0x8ac,0x13f5,0x10fd,0x1759)]),waifudd=await axios[_0x313705(0xfa3,0x282,0x1037,0x936)](_0x23937d(0x1672,0x1749,0xc40,0x20be)+_0x313705(0x1071,0x2d2,0x800,0x1afc)+_0x313705(0x1c18,0x2941,0x1769,0x2445)+_0x23937d(0x1a0b,0xc12,0x1ea2,0xe73));const _0x4e801a={};_0x4e801a[_0x313705(0x175a,0x1e2a,0xbdf,0x2093)+'t']=_0x313705(0x108c,0xd1c,0x12f4,0xe24);const _0x592daf={};_0x592daf[_0x313705(0x1e72,0x13c5,0x2662,0x284a)]='.'+_0x1354e9,_0x592daf[_0x23937d(0x159c,0x1cb4,0x1b2a,0x9e9)]=_0x4e801a,_0x592daf['type']=0x1;var _0xfb9bc6=[_0x592daf];const _0x28197d={};_0x28197d[_0x313705(0xddf,0x1571,0x2e1,0x877)]=waifudd['data'][_0x313705(0xddf,0x750,0x8ee,0xab5)];const _0x1077f2={};_0x1077f2['image']=_0x28197d,_0x1077f2['caption']=''+mess[_0x313705(0xcce,0xcff,0x195b,0xd72)],_0x1077f2[_0x313705(0x13d4,0x9ab,0x161c,0x15f9)]=''+global['botname'],_0x1077f2[_0x313705(0xfa0,0x1eb4,0x170,0xc45)]=_0xfb9bc6,_0x1077f2[_0x23937d(0x1b19,0x1a58,0x2212,0xfd9)]=0x4;let _0x2913a1=_0x1077f2;await _0x175756[_0x313705(0xcaa,0x1114,-0x269,-0x14b)+'e'](_0x5cd288[_0x313705(0x14f2,0x1108,0xe26,0xe2d)],_0x2913a1,{'quoted':_0x5cd288})[_0x23937d(0x934,0x1406,0xadf,0x9b0)](_0x286dcf=>{function _0x34962a(_0x559abe,_0x17ef7b,_0x302176,_0x423498){return _0x313705(_0x17ef7b- -0x240,_0x302176,_0x302176-0xc5,_0x423498-0x59);}return _0x34962a(0xc4,0x12c,-0xcbf,-0x808);});break;case _0x4b485e[_0x313705(0x1602,0x221d,0x1f41,0x826)]:if(_0x1bac1f)return _0x1db05d(mess[_0x23937d(0x61c,0x223,0xdcb,0x390)]);if(_0x1e03f5)return _0x4b485e[_0x313705(0x1848,0x121a,0x1f2f,0x2195)](_0x1db05d,mess[_0x23937d(0x5c0,0x132b,0xf22,0xa9f)]);_0x4b485e[_0x313705(0x1714,0x1c0c,0x257e,0x23fb)](_0x1db05d,mess['wait']),waifudd=await axios[_0x23937d(0xc3d,0x46a,0x906,0x1aed)](_0x23937d(0x1672,0x1527,0xb05,0x1549)+_0x313705(0x1071,0x5c9,0x1857,0xf08)+_0x23937d(0x18b2,0x1aca,0xcdc,0x22c9)+_0x23937d(0x1168,0x7c3,0x1275,0x98f));const _0x1e7547={};_0x1e7547[_0x313705(0x175a,0x168f,0x9e8,0x1cb0)+'t']='Next\x20✨';const _0x2f46e3={};_0x2f46e3[_0x23937d(0x1b0c,0x266e,0x262f,0x173c)]='.'+_0x1354e9,_0x2f46e3[_0x23937d(0x159c,0x23cd,0x2010,0x14f5)]=_0x1e7547,_0x2f46e3['type']=0x1;var _0xfb9bc6=[_0x2f46e3];const _0x47ab00={};_0x47ab00['url']=waifudd[_0x23937d(0xe17,0x564,0x189d,0x149a)][_0x23937d(0xa79,0x8d2,-0x2fa,0x1233)];const _0x462d54={};_0x462d54[_0x313705(0x1fa9,0x272e,0x2d6c,0x27de)]=_0x47ab00,_0x462d54[_0x313705(0xcce,0x311,0x1a08,0x3f4)]=''+mess[_0x23937d(0x968,0xf91,0x1f6,0xa81)],_0x462d54['footer']=''+global['botname'],_0x462d54[_0x23937d(0xc3a,0xb,0x1287,0x2a8)]=_0xfb9bc6,_0x462d54[_0x313705(0x1e7f,0x11db,0x1526,0x2689)]=0x4;let _0x426792=_0x462d54;await _0x175756[_0x313705(0xcaa,0xa10,0xb30,0x152)+'e'](_0x5cd288[_0x23937d(0x118c,0xf20,0x178f,0x1ddd)],_0x426792,{'quoted':_0x5cd288})[_0x23937d(0x934,0xbf3,-0x5e3,0x84e)](_0x15d28b=>{function _0x1016ca(_0x216b95,_0x473e18,_0x2b8d39,_0x1d6434){return _0x23937d(_0x216b95-0x210,_0x2b8d39,_0x2b8d39-0x1cf,_0x1d6434-0xb8);}function _0x2e1671(_0x515597,_0x13b102,_0x59b4b3,_0x44c011){return _0x23937d(_0x59b4b3-0x3ec,_0x44c011,_0x59b4b3-0x96,_0x44c011-0x199);}if(_0x4b485e[_0x2e1671(-0x49e,0xe4f,0x403,-0x34d)](_0x4b485e[_0x1016ca(0x18ee,0x250b,0x20f3,0xcfb)],_0x4b485e[_0x1016ca(0x921,0x278,0x4c7,0x5fa)])){const _0xef386={};_0xef386[_0x2e1671(0x190b,0x23fd,0x1bc5,0x11f1)]='Quality\x20'+_0x26b2a7[_0x1016ca(0xa35,0x14d3,0xf96,0x908)],_0xef386[_0x1016ca(0x74b,0xf09,0x1e4,-0x30a)]=_0x1d7c3e+_0x2e1671(-0x6ed,-0x5a0,0x481,-0x8e)+_0x189111,_0xef386[_0x1016ca(0x15d8,0x2296,0x1d8d,0x2050)+'n']=''+_0x3f8ec1[_0x2e1671(0x14d0,0x76e,0xf1f,0x1c4a)];const _0x273513={};_0x273513['title']=''+_0x5013b2[_0x1016ca(0x948,0x893,0xd7f,-0x1ae)],_0x273513[_0x2e1671(0x124d,0xadb,0x522,0xf62)]=[_0xef386];const _0x48f115=_0x273513;_0x5d88a7[_0x2e1671(0xc34,0x1dde,0x11a8,0x548)](_0x48f115);}else return _0x4b485e['vJiFV'];});break;case _0x4b485e[_0x313705(0x154d,0x115e,0xf5c,0x192f)]:if(_0x1bac1f)return _0x4b485e[_0x23937d(0xe40,0xf9b,0x1215,0x976)](_0x1db05d,mess[_0x23937d(0x61c,-0x7e8,-0x2f3,0x1250)]);if(_0x1e03f5)return _0x4b485e[_0x313705(0x16f9,0xc9f,0x1381,0x1318)](_0x1db05d,mess[_0x23937d(0x5c0,-0x31e,0x13d8,0x296)]);_0x4b485e[_0x313705(0x756,-0x11d,0x4e7,0x7d0)](_0x1db05d,mess[_0x23937d(0x8ac,0x12d1,-0x35,0x153a)]),waifudd=await axios['get']('https://ne'+_0x313705(0x1071,0x1f29,0x5c3,0x1624)+_0x23937d(0x18b2,0xb5e,0x27af,0x171f)+_0x313705(0x1a77,0x130f,0x13c3,0x27e3));const _0x383d53={};_0x383d53[_0x313705(0x175a,0x2195,0x1a70,0x139e)+'t']=_0x23937d(0xd26,0x13d,-0x11c,0x1653);const _0x19f740={};_0x19f740[_0x313705(0x1e72,0x1f0b,0x24b4,0x1565)]='.'+_0x1354e9,_0x19f740[_0x313705(0x1902,0xd70,0xabb,0xda3)]=_0x383d53,_0x19f740[_0x313705(0xa9e,0x8f1,-0x380,0x45)]=0x1;var _0xfb9bc6=[_0x19f740];const _0x123995={};_0x123995[_0x23937d(0xa79,0xbc6,0x152b,0xa)]=waifudd[_0x313705(0x117d,0x186b,0x1d86,0x1d8c)][_0x23937d(0xa79,0xe49,-0x442,0x4c1)];const _0x3cdc95={};_0x3cdc95[_0x23937d(0x1c43,0x25dd,0x2773,0x19e3)]=_0x123995,_0x3cdc95[_0x313705(0xcce,0x12c4,0xd45,-0xe1)]=''+mess[_0x23937d(0x968,0x130d,0x13b2,-0x22c)],_0x3cdc95['footer']=''+global[_0x23937d(0x96c,0xa6b,0xb01,0x1846)],_0x3cdc95[_0x313705(0xfa0,0x1cfc,0x15e2,0x345)]=_0xfb9bc6,_0x3cdc95[_0x313705(0x1e7f,0x14dc,0x2870,0x2d3c)]=0x4;let _0x50de04=_0x3cdc95;await _0x175756[_0x23937d(0x944,-0xab,0xb34,0x45a)+'e'](_0x5cd288['chat'],_0x50de04,{'quoted':_0x5cd288})[_0x313705(0xc9a,0x1acc,0x5ec,0x131c)](_0x441665=>{function _0x10e0a9(_0x533798,_0x5d7f8b,_0x4a6311,_0x353c3f){return _0x313705(_0x4a6311-0x178,_0x353c3f,_0x4a6311-0x14d,_0x353c3f-0x1e6);}function _0x378466(_0x3e75f2,_0x102e94,_0x52c02d,_0x5bf2db){return _0x313705(_0x102e94- -0x331,_0x3e75f2,_0x52c02d-0x11c,_0x5bf2db-0xac);}if(_0x4b485e[_0x10e0a9(0x1575,0x4b7,0x1254,0x162f)](_0x4b485e['ralYb'],_0x4b485e[_0x378466(0x1550,0x17e9,0x1367,0x153e)]))return _0x4b485e[_0x378466(-0x300,0x73a,-0x31a,0x15e4)];else{if(_0x5e4e1e)return _0x4b485e[_0x10e0a9(0x27a8,0x1803,0x21de,0x2e0b)](_0x5ce28a,_0x4dea6d[_0x378466(0x1104,0x651,0xdd9,-0x68b)]);if(_0x4b740c)return _0x4b485e[_0x10e0a9(0x1506,0x2b2e,0x1ef5,0x147c)](_0x2ec896,_0x2a168f['banChat']);if(!_0x445045)return _0x4b485e[_0x10e0a9(0x43,0x263,0xcd0,0x1573)](_0x1f5557,_0x378466(0x18fa,0xdda,0x618,0x12c6)+_0x4b485e[_0x10e0a9(0xe7d,0xc8b,0x1821,0x172c)](_0x17097f,_0x373ddc)+('\x20file\x20name'+_0x378466(0x55c,0x11df,0x150d,0x151a)+_0x10e0a9(0x12d5,0x1be7,0x1287,0x2018)+'With\x20')+_0x143b35+_0x10e0a9(-0x332,0x1173,0x971,0x450));let _0x12c516=_0x17c8ae['db'][_0x378466(0x7d9,0xe4c,0x188a,0x1728)][_0x10e0a9(0x1637,0xf,0xc27,0x16c)];if(!_0x4b485e[_0x378466(0x13f0,0x94b,0x817,0x10d7)](_0x16bf05['toLowerCas'+'e'](),_0x12c516))return _0x3fc5b9('\x27'+_0x2db392+(_0x10e0a9(-0x168,0x58b,0xa72,0x1905)+_0x10e0a9(0x1790,0x21f8,0x1315,0x71a)+_0x378466(0x16a3,0x1d75,0x11f6,0x1d45)+'st'));_0xfae300[_0x10e0a9(0xee1,0x176e,0xbb9,0x1414)+'rd'](_0x2b0d99['chat'],_0x12c516[_0x14fcee['toLowerCas'+'e']()],!![]);}});break;case _0x4b485e[_0x23937d(0x3e1,0x53b,-0x680,-0x920)]:if(_0x1bac1f)return _0x4b485e[_0x313705(0xe05,0xed4,0x10b4,0x191b)](_0x1db05d,mess[_0x23937d(0x61c,0x90f,0x76c,0x2dc)]);if(_0x1e03f5)return _0x4b485e[_0x313705(0x1525,0x1b26,0x18ed,0xf99)](_0x1db05d,mess['banChat']);_0x1db05d(mess[_0x313705(0xc12,-0x27f,0xe79,0x169f)]),waifudd=await axios['get'](_0x313705(0x16e7,0x1de5,0x840,0x92f)+_0x313705(0x99d,-0xa7,0xd37,0xd46)+'cs/sfw/cry');const _0x39468e={};_0x39468e['displayTex'+'t']='Next\x20✨';const _0x45163b={};_0x45163b[_0x23937d(0x1b0c,0x1623,0x1c67,0x1617)]='.'+_0x1354e9,_0x45163b[_0x313705(0x1902,0x1f1c,0x147b,0xcd5)]=_0x39468e,_0x45163b[_0x313705(0xa9e,0xfe4,-0x305,0xf6d)]=0x1;var _0x1b43eb=[_0x45163b];const _0x3774fb={};_0x3774fb[_0x23937d(0xa79,0x7b7,0x1204,0xd85)]=waifudd[_0x313705(0x117d,0x183c,0x13c0,0x16fd)][_0x23937d(0xa79,0x8e,0xa7a,0x9d)];const _0x48afbe={};_0x48afbe[_0x23937d(0x1c43,0x293c,0x1676,0x231d)]=_0x3774fb,_0x48afbe[_0x313705(0xcce,0x896,0x105c,0x5ad)]=''+mess[_0x23937d(0x968,0x31b,0x180e,0x1613)],_0x48afbe[_0x313705(0x13d4,0xad1,0xb59,0x1a26)]=''+global[_0x23937d(0x96c,0x6,0xcd5,-0x164)],_0x48afbe['buttons']=_0x1b43eb,_0x48afbe[_0x313705(0x1e7f,0x17db,0x1aa1,0xf60)]=0x4;let _0xbf23b4=_0x48afbe;await _0x175756['sendMessag'+'e'](_0x5cd288['chat'],_0xbf23b4,{'quoted':_0x5cd288})['catch'](_0x283278=>{function _0x687b95(_0x4784a0,_0x320bdf,_0x27897a,_0xe3427d){return _0x23937d(_0xe3427d- -0x73,_0x4784a0,_0x27897a-0xad,_0xe3427d-0x117);}const _0x32a1ca={'Unzvy':function(_0x2fcca0,_0x52ae74){function _0x9c146f(_0x1cefd4,_0x19b21f,_0x116e67,_0x4e91b3){return _0x2506(_0x19b21f- -0x25,_0x116e67);}return _0x4b485e[_0x9c146f(0x2bf3,0x1f54,0x1b08,0x2def)](_0x2fcca0,_0x52ae74);},'TQhVR':function(_0x3438e1,_0x4c576d){return _0x4b485e['eiqfG'](_0x3438e1,_0x4c576d);},'upgAL':_0x687b95(0xf9d,-0x656,0x7f1,0xff),'QQFAQ':_0x687b95(-0x573,0x45,-0x2c0,0x33),'MSPtw':function(_0x37dab3,_0x803be1){return _0x4b485e['BccQH'](_0x37dab3,_0x803be1);},'auhxj':_0x31ee48(0x1208,0xf0c,0xe33,0x6c0),'WUCCi':function(_0x34797f,_0x274865){return _0x4b485e['DsAYx'](_0x34797f,_0x274865);}};function _0x31ee48(_0x2c8251,_0x3337e9,_0x3dc051,_0x15383f){return _0x23937d(_0x2c8251-0x302,_0x15383f,_0x3dc051-0x111,_0x15383f-0x3);}if(_0x4b485e[_0x687b95(0x1ecd,0x109a,0x1ac9,0x170d)](_0x687b95(0x122a,0xf4d,0xceb,0x9e8),_0x4b485e[_0x687b95(-0x35f,0xa3f,0x18fb,0xad6)]))return _0x4b485e[_0x31ee48(0xa07,0xd98,0xa20,0xfea)];else{if(_0x5872e9)return _0x10197d(_0x2f034f[_0x687b95(0x8e7,0xc3d,-0x2c4,0x5a9)]);if(_0x485fdc)return _0x32a1ca[_0x687b95(0x1ed7,0x20df,0x1633,0x1923)](_0x2e8903,_0x56612c[_0x31ee48(0x8c2,0x132e,0xe17,0xd83)]);if(_0x32a1ca[_0x687b95(-0x12,0xcff,0x15ce,0x784)](_0x2f17a4[0x1ca4+-0x2*-0x54c+0x12*-0x22e],_0x32a1ca[_0x31ee48(0x17a6,0x12dd,0x1edc,0x10b4)])){const _0x2e992c={};_0x2e992c[_0x31ee48(0xd7b,0xa13,0x147d,-0x10)]=_0x1f5f26[0xa3*0x29+-0x239f+-0x1*-0x985];const _0x29ab1c={};_0x29ab1c[_0x687b95(0x1d6a,0x13ce,0x1e47,0x16ef)]=_0x2e992c,_0x29ab1c[_0x687b95(0xf55,-0x10,0x1131,0x8f5)]=_0x687b95(0xfce,0xd69,0x130b,0xe93),_0x29ab1c[_0x31ee48(0x15ac,0x1d0f,0x1c3d,0x1b10)]=_0x32a1ca[_0x31ee48(0x1130,0x110b,0x1210,0x470)];const _0x4a9692={};_0x4a9692[_0x31ee48(0x8de,-0x18a,0x3bd,0xf70)]=_0x3cf6f9,_0x3b99a0[_0x31ee48(0xc46,0x11ca,0x5d7,0x2ed)+'e'](_0xef8da3,_0x29ab1c,_0x4a9692);}else{if(_0x32a1ca['MSPtw'](_0x20643e[0x218b+0x1b5e+0x1*-0x3ce9],_0x31ee48(0xe3f,0x136b,0x1394,0x1baf))){const _0x5ba7ca={};_0x5ba7ca[_0x31ee48(0xd7b,0x1979,0x4f2,0x16b6)]=_0x238f34[0x19*-0xad+-0x6d0*0x4+-0x1613*-0x2];const _0x55857d={};_0x55857d[_0x31ee48(0x1f45,0x2bd2,0x1397,0x2d36)]=_0x5ba7ca,_0x55857d[_0x687b95(0x1033,0xbf6,0x9aa,0x8f5)]=_0x32a1ca[_0x687b95(0x16c0,0xf01,0x1d16,0x1187)];const _0x93e408={};_0x93e408[_0x31ee48(0x8de,0x155f,-0x568,0x120a)]=_0x2bd828,_0x3bd238[_0x31ee48(0xc46,-0x1a3,0x1929,0xe38)+'e'](_0x244966,_0x55857d,_0x93e408);}else _0x32a1ca[_0x687b95(0x19b6,0x1640,0xcff,0x17d9)](_0x281fde,_0x687b95(-0xa7a,0x2a1,0x888,0x150));}}});break;case _0x4b485e['nDZfw']:if(_0x1bac1f)return _0x4b485e['nHThU'](_0x1db05d,mess[_0x23937d(0x61c,-0x3de,-0x286,0x768)]);if(_0x1e03f5)return _0x1db05d(mess[_0x313705(0x926,-0x3b7,0x549,0x15eb)]);_0x4b485e[_0x313705(0x19e7,0xcd1,0x18a1,0x1476)](_0x1db05d,mess[_0x313705(0xc12,0x11f1,0x10c6,0x1637)]),waifudd=await axios[_0x313705(0xfa3,0x92b,0x1ed,0x752)](_0x313705(0x16e7,0x1aba,0x880,0x96c)+_0x23937d(0x637,0x23a,0x528,0x1424)+_0x23937d(0xfb,0x955,0x87f,-0x375)+'l');const _0x2e881f={};_0x2e881f[_0x23937d(0x13f4,0x1305,0x16f6,0xe8a)+'t']='Next\x20✨';const _0x546094={};_0x546094[_0x23937d(0x1b0c,0xe0a,0x1bec,0x18b4)]='.'+_0x1354e9,_0x546094[_0x23937d(0x159c,0x1294,0x231c,0x23f2)]=_0x2e881f,_0x546094[_0x23937d(0x738,0x36d,-0x18d,0x5f5)]=0x1;var _0x4362cc=[_0x546094];const _0x559b27={};_0x559b27[_0x23937d(0xa79,0xcb,0x105b,0xd88)]=waifudd[_0x313705(0x117d,0x1cfb,0x1288,0x9f9)]['url'];const _0x20f131={};_0x20f131[_0x23937d(0x1c43,0x20b7,0x1d8c,0xde2)]=_0x559b27,_0x20f131[_0x313705(0xcce,0x29b,0x174,0x236)]=''+mess[_0x23937d(0x968,0x11ec,0x11e0,0x17a2)],_0x20f131[_0x23937d(0x106e,0x1858,0x81d,0x18cb)]=''+global['botname'],_0x20f131[_0x23937d(0xc3a,0x498,0x693,0x1788)]=_0x4362cc,_0x20f131['headerType']=0x4;let _0xaee33f=_0x20f131;await _0x175756[_0x23937d(0x944,-0x1be,0x542,0x8ae)+'e'](_0x5cd288[_0x23937d(0x118c,0x3b3,0x1494,0x2092)],_0xaee33f,{'quoted':_0x5cd288})[_0x23937d(0x934,-0x2a5,-0x25d,0x1da)](_0x1dab4e=>{const _0x539436={'TWVZY':function(_0x55bc1c,_0x4ccc03,_0x56bfd6){function _0x1504fa(_0x3efa43,_0x2d898e,_0x473dd4,_0x3ab495){return _0x2506(_0x3ab495- -0xc0,_0x2d898e);}return _0x4b485e[_0x1504fa(0x11c9,-0xce,-0x257,0x311)](_0x55bc1c,_0x4ccc03,_0x56bfd6);}};function _0x78c0c6(_0x1bfc59,_0x22ab08,_0x121edd,_0xf49bd1){return _0x313705(_0x121edd- -0x246,_0xf49bd1,_0x121edd-0x69,_0xf49bd1-0x18e);}function _0x5f3229(_0x1f4515,_0x3512ba,_0x46df6f,_0x573452){return _0x313705(_0x573452- -0x89,_0x3512ba,_0x46df6f-0x17e,_0x573452-0xec);}if(_0x4b485e[_0x78c0c6(0x25ef,0x1033,0x1e16,0x21f7)](_0x4b485e[_0x5f3229(0x1f73,0x1af7,0xf51,0x1295)],_0x5f3229(-0x326,0x561,0x1f7,0x41e))){const _0x4f6e31={'fAXFr':function(_0x264c6a,_0x1c0b90){return _0x264c6a(_0x1c0b90);},'rPdjK':function(_0x295b25,_0x4bc0e9){return _0x295b25(_0x4bc0e9);}};if(!_0x24d588)return _0x3b603b(_0x103cd8[_0x78c0c6(0x1396,0x93e,0xda4,0x83)]);_0x539436[_0x78c0c6(0x1815,0x1202,0xf26,0xcac)](_0x1344c0,_0x39b18b[_0x5f3229(0xba,0xebf,-0x665,0x310)](-0x1d57+-0x1a10+-0x5*-0xb15),(_0x558706,_0x498d80)=>{function _0x57dd5a(_0x467a91,_0x398dcb,_0x114747,_0x1c7a77){return _0x78c0c6(_0x467a91-0x16e,_0x398dcb-0x1ad,_0x1c7a77-0x3f4,_0x467a91);}if(_0x558706)return _0x4f6e31[_0x57dd5a(0x1c37,0x2183,0x1e41,0x1716)](_0x1dfb83,_0x558706);if(_0x498d80)return _0x4f6e31['rPdjK'](_0xb8aa9d,_0x498d80);});}else return _0x78c0c6(0x1010,0x4e0,0x126,0x5d);});break;case _0x4b485e[_0x313705(0x791,0xbfc,0xe05,0x1aa)]:if(_0x1bac1f)return _0x1db05d(mess['ban']);if(_0x1e03f5)return _0x4b485e['WoiOA'](_0x1db05d,mess[_0x313705(0x926,0x10e7,0x15b9,0x1556)]);_0x1db05d(mess['wait']),waifudd=await axios[_0x23937d(0xc3d,0x12c1,0x17a9,0x42)]('https://ap'+_0x313705(0x99d,0x4b1,0x403,0x99e)+_0x23937d(0x14bf,0x18e1,0x1073,0x92e)+'k');const _0x2d3da6={};_0x2d3da6['displayTex'+'t']='Next\x20✨';const _0x20637a={};_0x20637a['buttonId']='.'+_0x1354e9,_0x20637a['buttonText']=_0x2d3da6,_0x20637a['type']=0x1;var _0x4a11d1=[_0x20637a];const _0x5aae11={};_0x5aae11['url']=waifudd['data'][_0x23937d(0xa79,0x1262,-0x2b3,0x2d2)];const _0x4fd59f={};_0x4fd59f[_0x313705(0x1fa9,0x164a,0x2a19,0x1808)]=_0x5aae11,_0x4fd59f['caption']=''+mess[_0x23937d(0x968,0xeb2,0x840,0x77f)],_0x4fd59f['footer']=''+global[_0x313705(0xcd2,0xa01,0x4dc,0x137)],_0x4fd59f[_0x313705(0xfa0,0x1a74,0x56b,0x915)]=_0x4a11d1,_0x4fd59f[_0x23937d(0x1b19,0x20f1,0x1645,0xf41)]=0x4;let _0x7ccbac=_0x4fd59f;await _0x175756[_0x23937d(0x944,0x985,0x4ae,-0x20e)+'e'](_0x5cd288[_0x313705(0x14f2,0x19fa,0x16dc,0x19b6)],_0x7ccbac,{'quoted':_0x5cd288})[_0x313705(0xc9a,0x8b3,0x13f9,0x465)](_0x427ac3=>{return _0x4b485e['vJiFV'];});break;case _0x23937d(0x186a,0x276d,0x1d72,0xeda):if(_0x1bac1f)return _0x1db05d(mess[_0x313705(0x982,0xe39,0x1352,0x3d5)]);if(_0x1e03f5)return _0x4b485e[_0x313705(0x1b0a,0x1c7b,0xfc8,0x16d7)](_0x1db05d,mess[_0x23937d(0x5c0,0x9c0,0x983,0x10b1)]);_0x4b485e['jCPsa'](_0x1db05d,mess[_0x23937d(0x8ac,-0x17f,0x125d,0xe94)]),waifudd=await axios[_0x313705(0xfa3,0x1766,0xbd9,0x1b17)](_0x23937d(0x1381,0x94f,0x660,0x650)+'i.waifu.pi'+'cs/sfw/bit'+'e');const _0xc17af4={};_0xc17af4['displayTex'+'t']='Next\x20✨';const _0x51dbe7={};_0x51dbe7[_0x23937d(0x1b0c,0x21b1,0xcef,0x1b4d)]='.'+_0x1354e9,_0x51dbe7[_0x23937d(0x159c,0x21c9,0x127b,0x19c8)]=_0xc17af4,_0x51dbe7[_0x23937d(0x738,0x10e,0x284,0xddc)]=0x1;var _0x345700=[_0x51dbe7];const _0x38a4ae={};_0x38a4ae[_0x313705(0xddf,0xc20,0x64,0x153b)]=waifudd[_0x313705(0x117d,0x103f,0x879,0x1a76)][_0x313705(0xddf,0x858,0x1bb,0xe6a)];const _0x48239b={};_0x48239b[_0x313705(0x1fa9,0x2695,0x2d6d,0x12ed)]=_0x38a4ae,_0x48239b[_0x23937d(0x968,0x4be,0x604,0x12c1)]=''+mess['caption'],_0x48239b[_0x23937d(0x106e,0x7fa,0x1689,0x3a0)]=''+global['botname'],_0x48239b[_0x313705(0xfa0,0x911,0x181c,0x1754)]=_0x345700,_0x48239b[_0x313705(0x1e7f,0x2937,0x216c,0x1240)]=0x4;let _0x36f694=_0x48239b;await _0x175756['sendMessag'+'e'](_0x5cd288['chat'],_0x36f694,{'quoted':_0x5cd288})['catch'](_0x1bca6e=>{function _0x1dd193(_0x439902,_0x4df246,_0x13aa2d,_0x575382){return _0x23937d(_0x575382- -0x47,_0x439902,_0x13aa2d-0x180,_0x575382-0x28);}return _0x1dd193(-0xe0b,0x9c5,0x856,-0x41);});break;case _0x4b485e['ibgHF']:if(_0x1bac1f)return _0x1db05d(mess[_0x313705(0x982,0x131f,0x12bc,0x856)]);if(_0x1e03f5)return _0x4b485e['BHcsr'](_0x1db05d,mess['banChat']);_0x4b485e['VlhAH'](_0x1db05d,mess[_0x313705(0xc12,0x513,0x7a9,-0x54)]),waifudd=await axios[_0x23937d(0xc3d,0x128a,0xd34,0x1b20)](_0x313705(0x16e7,0x1c52,0xc14,0x2296)+_0x313705(0x99d,0x115b,-0x333,0x1434)+_0x313705(0x1dec,0x152c,0xff9,0x1804)+'t');const _0x2b95aa={};_0x2b95aa['displayTex'+'t']=_0x23937d(0xd26,0x865,0x5ca,0x2f3);const _0x1b3cb3={};_0x1b3cb3[_0x23937d(0x1b0c,0x1557,0x17d7,0x28e7)]='.'+_0x1354e9,_0x1b3cb3[_0x313705(0x1902,0x1e1a,0x24e3,0xa26)]=_0x2b95aa,_0x1b3cb3[_0x313705(0xa9e,0x1875,0x32e,0x16e9)]=0x1;var _0x46c0e6=[_0x1b3cb3];const _0x39dfa3={};_0x39dfa3['url']=waifudd[_0x313705(0x117d,0x1464,0xc61,0x1e13)][_0x313705(0xddf,0x20f,0xdeb,0xeae)];const _0x1ca26a={};_0x1ca26a['image']=_0x39dfa3,_0x1ca26a[_0x23937d(0x968,0x16d,0x16c2,0x1644)]=''+mess[_0x23937d(0x968,-0x4e7,0x165a,0x1171)],_0x1ca26a['footer']=''+global[_0x313705(0xcd2,0xa71,0x94c,0x5fb)],_0x1ca26a[_0x313705(0xfa0,0x1d1f,0xfe5,0x1156)]=_0x46c0e6,_0x1ca26a[_0x313705(0x1e7f,0x2c65,0x2cf7,0x1bf7)]=0x4;let _0x110e22=_0x1ca26a;await _0x175756[_0x313705(0xcaa,0x15a,0xda6,0xb9b)+'e'](_0x5cd288[_0x23937d(0x118c,0x206f,0x7af,0x1975)],_0x110e22,{'quoted':_0x5cd288})['catch'](_0x412ae8=>{function _0x54df73(_0x330c2c,_0x24cad0,_0x3143f3,_0x2900fa){return _0x313705(_0x3143f3-0xb7,_0x24cad0,_0x3143f3-0x51,_0x2900fa-0x129);}return _0x4b485e[_0x54df73(0x10ec,-0x34a,0xb22,0xb15)];});break;case _0x4b485e['GrBxd']:if(_0x1bac1f)return _0x4b485e['VmeGb'](_0x1db05d,mess['ban']);if(_0x1e03f5)return _0x1db05d(mess[_0x23937d(0x5c0,0x116,0x1240,-0x5ea)]);_0x4b485e['EsUSV'](_0x1db05d,mess['wait']),waifudd=await axios['get']('https://ap'+_0x23937d(0x637,0x7e7,0xec7,0xcc7)+_0x313705(0x1825,0x131f,0x1439,0x10a9)+'k');const _0x801418={};_0x801418[_0x313705(0x175a,0xe33,0xdc4,0x2192)+'t']=_0x23937d(0xd26,0x1a7f,0x1bd7,0x365);const _0x321abc={};_0x321abc[_0x23937d(0x1b0c,0x19ba,0x1ce9,0x201c)]='.'+_0x1354e9,_0x321abc[_0x23937d(0x159c,0x208e,0x1c73,0x1f69)]=_0x801418,_0x321abc[_0x23937d(0x738,-0x3d3,0x3db,0xa3d)]=0x1;var _0x18a410=[_0x321abc];const _0x3ac016={};_0x3ac016['url']=waifudd[_0x313705(0x117d,0x8c4,0xa82,0xd7e)][_0x313705(0xddf,0xbf3,0x18ec,0x1b99)];const _0x56dc82={};_0x56dc82['image']=_0x3ac016,_0x56dc82[_0x23937d(0x968,0xf9e,0x10f5,0x1034)]=''+mess[_0x23937d(0x968,-0x3c3,0xf9a,-0x128)],_0x56dc82[_0x23937d(0x106e,0x197a,0x1cd3,0x247)]=''+global['botname'],_0x56dc82[_0x23937d(0xc3a,0x1a,-0x229,0x544)]=_0x18a410,_0x56dc82[_0x23937d(0x1b19,0x1818,0x12fd,0xe5b)]=0x4;let _0x488953=_0x56dc82;await _0x175756[_0x23937d(0x944,0x614,0x89d,0x179e)+'e'](_0x5cd288[_0x23937d(0x118c,0x19ab,0x132a,0xcf6)],_0x488953,{'quoted':_0x5cd288})[_0x23937d(0x934,0x1794,0xb45,-0x27a)](_0x240c99=>{function _0xeb07fe(_0x1dd3ca,_0x372763,_0x219ca4,_0x51dce5){return _0x313705(_0x372763-0x188,_0x1dd3ca,_0x219ca4-0x182,_0x51dce5-0x24);}return _0xeb07fe(0xa2a,0x4f4,0x3f6,0x2c5);});break;case _0x4b485e[_0x23937d(0x1d95,0x1ce9,0x14fc,0x1b29)]:if(_0x1bac1f)return _0x1db05d(mess[_0x23937d(0x61c,0x855,-0x319,0x12fc)]);if(_0x1e03f5)return _0x4b485e[_0x23937d(0x50f,0x451,0x10ee,0x1184)](_0x1db05d,mess[_0x23937d(0x5c0,0x13f9,0xcaf,-0x698)]);_0x4b485e[_0x23937d(0x6f5,-0x17a,0x130f,0x4bf)](_0x1db05d,mess[_0x313705(0xc12,0x17cb,0x661,0x64f)]),waifudd=await axios['get']('https://ap'+_0x313705(0x99d,0xf1c,0x1860,0x2ba)+'cs/sfw/bon'+'k');const _0x4cfd8a={};_0x4cfd8a['displayTex'+'t']='Next\x20✨';const _0x3d18be={};_0x3d18be['buttonId']='.'+_0x1354e9,_0x3d18be[_0x313705(0x1902,0x12d4,0x1f30,0x148d)]=_0x4cfd8a,_0x3d18be[_0x23937d(0x738,-0x6e8,0x13f,0x1516)]=0x1;var _0x4279f2=[_0x3d18be];const _0x2bfe23={};_0x2bfe23[_0x313705(0xddf,0xaa5,0x771,0x18e8)]=waifudd['data'][_0x313705(0xddf,0x5bf,0xd7c,0x1b28)];const _0x58df27={};_0x58df27['image']=_0x2bfe23,_0x58df27[_0x313705(0xcce,0x48e,0x157a,0xb90)]=''+mess[_0x313705(0xcce,0x1542,0x5a9,0x649)],_0x58df27[_0x313705(0x13d4,0xa76,0x1756,0x191c)]=''+global[_0x23937d(0x96c,0xf01,0x57b,-0x11d)],_0x58df27[_0x313705(0xfa0,0x1801,0x1d99,0x567)]=_0x4279f2,_0x58df27[_0x313705(0x1e7f,0x11dd,0x1a87,0xf6d)]=0x4;let _0x537c3c=_0x58df27;await _0x175756[_0x23937d(0x944,0x139c,0xd13,0x1224)+'e'](_0x5cd288[_0x313705(0x14f2,0x1e17,0x1aca,0x15c8)],_0x537c3c,{'quoted':_0x5cd288})[_0x23937d(0x934,0xcd3,0xd43,-0xbb)](_0x2b7c21=>{function _0x22d09b(_0x3d1ae7,_0x2d8318,_0x224f9f,_0x255d1b){return _0x23937d(_0x255d1b-0xca,_0x3d1ae7,_0x224f9f-0x8a,_0x255d1b-0x1bc);}return _0x4b485e[_0x22d09b(-0x396,0xc0e,0xead,0x7cf)];});break;case _0x4b485e[_0x313705(0x1e57,0x1864,0x1da6,0x204c)]:if(_0x1bac1f)return _0x4b485e[_0x313705(0x1ccb,0x228c,0x13f9,0x1a5d)](_0x1db05d,mess[_0x313705(0x982,-0x3f5,-0x54e,0x157a)]);if(_0x1e03f5)return _0x4b485e[_0x23937d(0x70f,0x213,0x934,0x1550)](_0x1db05d,mess[_0x23937d(0x5c0,0x11e3,0xd80,0xdcc)]);_0x1db05d(mess[_0x23937d(0x8ac,0xe25,0x13c8,0x2d9)]),waifudd=await axios['get']('https://ap'+_0x313705(0x99d,0xc3f,0xa6b,-0x154)+'cs/sfw/win'+'k');const _0x4381b6={};_0x4381b6['displayTex'+'t']=_0x23937d(0xd26,0x148f,0x1f6,0x19b3);const _0x10430e={};_0x10430e[_0x313705(0x1e72,0x21a4,0x2836,0x1ef2)]='.'+_0x1354e9,_0x10430e['buttonText']=_0x4381b6,_0x10430e[_0x313705(0xa9e,-0x371,0x2fd,-0x1c2)]=0x1;var _0x2f35f9=[_0x10430e];const _0x3d9d39={};_0x3d9d39[_0x23937d(0xa79,0xdc3,-0x159,0x171)]=waifudd[_0x313705(0x117d,0xd00,0x791,0x18a0)][_0x23937d(0xa79,0x76,0xfa1,0x1979)];const _0x4377d0={};_0x4377d0[_0x313705(0x1fa9,0x2bbc,0x1a56,0x2ab4)]=_0x3d9d39,_0x4377d0['caption']=''+mess[_0x23937d(0x968,0x10cc,0xbc3,-0x384)],_0x4377d0[_0x23937d(0x106e,0xfbb,0x11e5,0x300)]=''+global['botname'],_0x4377d0[_0x313705(0xfa0,0x5c1,0x927,0x4ca)]=_0x2f35f9,_0x4377d0[_0x313705(0x1e7f,0x217f,0x2804,0x2a4b)]=0x4;let _0x2548ae=_0x4377d0;await _0x175756[_0x313705(0xcaa,0x126e,-0xf7,0xb6a)+'e'](_0x5cd288['chat'],_0x2548ae,{'quoted':_0x5cd288})['catch'](_0x1166e5=>{function _0xa4e040(_0x5a9c34,_0x40abb1,_0x3caa9b,_0x10b4ac){return _0x23937d(_0x3caa9b- -0x6d,_0x40abb1,_0x3caa9b-0x195,_0x10b4ac-0x96);}return _0x4b485e[_0xa4e040(0x328,-0x216,0x698,-0x7b4)];});break;case _0x4b485e['BJNpN']:if(_0x1bac1f)return _0x1db05d(mess['ban']);if(_0x1e03f5)return _0x4b485e[_0x313705(0x1e76,0x25d3,0x186b,0x1190)](_0x1db05d,mess['banChat']);_0x1db05d(mess[_0x313705(0xc12,0x39d,0xc4c,0x1a87)]),waifudd=await axios['get']('https://ap'+_0x23937d(0x637,-0x23c,0xb4c,0xc04)+'cs/sfw/pok'+'e');const _0x3f64ee={};_0x3f64ee[_0x313705(0x175a,0x238d,0x22f3,0x998)+'t']='Next\x20✨';const _0x1bfa81={};_0x1bfa81[_0x23937d(0x1b0c,0x1018,0x14ee,0x1e0b)]='.'+_0x1354e9,_0x1bfa81[_0x23937d(0x159c,0xccc,0xd52,0x1cc1)]=_0x3f64ee,_0x1bfa81[_0x313705(0xa9e,0x1594,0x4a2,0x15f4)]=0x1;var _0x4b399f=[_0x1bfa81];const _0x46f0fb={};_0x46f0fb['url']=waifudd[_0x23937d(0xe17,0x6ae,0x885,0x119a)][_0x313705(0xddf,0xcbd,0x1968,0x8c)];const _0x53000a={};_0x53000a['image']=_0x46f0fb,_0x53000a[_0x23937d(0x968,0x13a3,0xe85,-0x58)]=''+mess[_0x313705(0xcce,0x1402,0x1b7c,0x7)],_0x53000a[_0x313705(0x13d4,0xa39,0x21db,0x1468)]=''+global[_0x313705(0xcd2,0x69b,0x1300,0xebe)],_0x53000a['buttons']=_0x4b399f,_0x53000a[_0x313705(0x1e7f,0x130c,0x125e,0x1004)]=0x4;let _0x7d68ba=_0x53000a;await _0x175756[_0x23937d(0x944,0x1167,-0x178,0x11fd)+'e'](_0x5cd288['chat'],_0x7d68ba,{'quoted':_0x5cd288})[_0x313705(0xc9a,0x19b1,0x1856,0x1d6)](_0x25b982=>{function _0xa425b6(_0x8affb2,_0x1b28b2,_0x1c879b,_0x33340f){return _0x313705(_0x1b28b2- -0x343,_0x1c879b,_0x1c879b-0x12a,_0x33340f-0xa8);}return _0xa425b6(-0x831,0x29,-0x8e9,0x304);});break;case'animesmile':if(_0x1bac1f)return _0x4b485e[_0x313705(0x138f,0xd89,0x1265,0xd24)](_0x1db05d,mess[_0x313705(0x982,0xe2c,0x12c0,0x1eb)]);if(_0x1e03f5)return _0x4b485e[_0x23937d(0xc4b,0x3c7,0x143,0xe18)](_0x1db05d,mess[_0x313705(0x926,0xade,0x109a,0x4bf)]);_0x1db05d(mess[_0x313705(0xc12,0x901,0x32e,0x604)]),waifudd=await axios[_0x23937d(0xc3d,0x3e7,0x1330,0x10b0)](_0x313705(0x16e7,0x1e9c,0xfd8,0x13da)+_0x313705(0x99d,0x1344,0x171b,0x141)+_0x313705(0xdbb,0xe63,0x120a,0x16fd)+'le');const _0x15926d={};_0x15926d[_0x313705(0x175a,0x1d23,0x24fc,0x1e21)+'t']=_0x23937d(0xd26,0x7d2,0x995,0x14bd);const _0x21e44e={};_0x21e44e[_0x23937d(0x1b0c,0x21eb,0x1235,0x23b8)]='.'+_0x1354e9,_0x21e44e[_0x313705(0x1902,0x107c,0x18f3,0x1c42)]=_0x15926d,_0x21e44e[_0x313705(0xa9e,-0xc2,-0x168,0x1785)]=0x1;var _0x4c0f48=[_0x21e44e];const _0x3dd57e={};_0x3dd57e['url']=waifudd[_0x23937d(0xe17,0x37d,0x1616,0x1c16)][_0x23937d(0xa79,0xb83,0x130c,0x206)];const _0x133179={};_0x133179['image']=_0x3dd57e,_0x133179[_0x23937d(0x968,0x9a8,0x165e,-0x283)]=''+mess[_0x23937d(0x968,0x85f,0xab2,-0x8a)],_0x133179[_0x23937d(0x106e,0x54a,0x1251,0x186c)]=''+global['botname'],_0x133179['buttons']=_0x4c0f48,_0x133179[_0x23937d(0x1b19,0x271a,0x1742,0x1bad)]=0x4;let _0x2303af=_0x133179;await _0x175756[_0x23937d(0x944,0x6d5,0x9b9,0x1864)+'e'](_0x5cd288[_0x313705(0x14f2,0x1f66,0x612,0x771)],_0x2303af,{'quoted':_0x5cd288})[_0x23937d(0x934,0x90e,-0x36c,0x46a)](_0x148fc2=>{function _0x42ae87(_0x26a2e8,_0x497b79,_0x39c6ba,_0x472d51){return _0x313705(_0x497b79- -0x65,_0x39c6ba,_0x39c6ba-0x3f,_0x472d51-0x70);}function _0x2901f0(_0xb5857e,_0x2a94ad,_0x379a46,_0x591129){return _0x23937d(_0xb5857e-0x4ff,_0x379a46,_0x379a46-0x1e3,_0x591129-0xe9);}if(_0x4b485e[_0x2901f0(0x1ab3,0x1f98,0x167e,0xff1)]===_0x4b485e['yOyNM']){const _0x15896e={};_0x15896e[_0x42ae87(0x2cb4,0x203a,0x15d5,0x11ba)]='🛍️',_0x15896e[_0x42ae87(0x860,0xc50,0x14a0,0x115)]=_0x594369['key'];const _0x2c86db={};_0x2c86db[_0x2901f0(0x1eb9,0x284d,0x1da6,0x1509)]=_0x15896e,_0x5cf63f[_0x42ae87(-0x176,0xc45,0x510,-0x270)+'e'](_0x159728,_0x2c86db);if(_0x2aa5d8)return _0x4b485e['smKZX'](_0x3b9f59,_0x4938e8[_0x42ae87(0x436,0x91d,0x5b2,0xdb6)]);if(_0x356eb6)return _0x392a90(_0x448431[_0x2901f0(0xabf,0x12b3,0x881,0x148f)]);if(!_0x40c1dc)return _0x31c719(_0x2901f0(0x1e2c,0x2a91,0x26bf,0x2189)+_0x42ae87(0x1313,0x1a01,0x19b7,0x1e85));if(!_0x54775f[0xa*-0x362+-0x481+-0x1*-0x2655]['includes']('f'))return _0x385f13(_0x2901f0(0xc8f,0x59e,0x1e,0x1a00)+_0x2901f0(0x1330,0x2065,0x1126,0x4af)+_0x42ae87(0x14cf,0x1a86,0x27a1,0x27a1));const _0x24e2d8={};_0x24e2d8[_0x2901f0(0x18f3,0x116a,0x102d,0x1a12)+'t']=_0x4b485e[_0x42ae87(0x145e,0x1153,0xcf3,0xe05)];const _0xeab6d2={};_0xeab6d2['buttonId']=_0x42ae87(0x1a9a,0xc66,-0x38,0x15af)+_0x4e2888,_0xeab6d2[_0x2901f0(0x1a9b,0x1432,0x1b3b,0x20e8)]=_0x24e2d8,_0xeab6d2[_0x42ae87(-0x105,0xa39,0x455,-0x112)]=0x1;const _0x569aa5={};_0x569aa5[_0x42ae87(0x106b,0x16f5,0x1aa2,0x22e5)+'t']=_0x4b485e[_0x2901f0(0xf24,0xb2f,0x883,0x1a4)];const _0x1a3567={};_0x1a3567['buttonId']=_0x42ae87(0x26b7,0x20f5,0x1255,0x1745)+_0x47a196,_0x1a3567[_0x42ae87(0x17de,0x189d,0xdab,0xf41)]=_0x569aa5,_0x1a3567[_0x42ae87(0x795,0xa39,0x160a,0x186)]=0x1;const _0x37748f={};_0x37748f[_0x42ae87(0xfff,0x16f5,0x902,0x1871)+'t']=_0x4b485e[_0x42ae87(-0x27e,0x35f,0xfaf,0x63e)];const _0x49ee87={};_0x49ee87[_0x2901f0(0x200b,0x1790,0x1fe7,0x1efc)]=_0x42ae87(0x1069,0x1577,0x1db6,0x1555)+_0x2cc7b5,_0x49ee87['buttonText']=_0x37748f,_0x49ee87['type']=0x1;let _0x5b05b8=[_0xeab6d2,_0x1a3567,_0x49ee87];const _0xa136cf={};_0xa136cf['url']=_0x4b485e['ZglxT'];const _0xdd954b={};_0xdd954b['image']=_0xa136cf,_0xdd954b[_0x42ae87(0x1810,0xc69,0x66e,-0x298)]=_0x42ae87(0x1030,0xb17,-0x219,0x40)+_0x2901f0(0x1525,0x11b6,0x1cfc,0x1d66)+_0x42ae87(0x260b,0x205b,0x2766,0x207b)+'ɴ📥\x0a╠\x20🪣ꜰʙ\x20ᴅ'+_0x42ae87(0x2852,0x1e9c,0x2c9b,0x12d3)+_0x42ae87(0x639,0x640,-0x42a,-0x136)+_0x42ae87(0xd88,0xe7f,0xe88,0xd7),_0xdd954b[_0x42ae87(0xaed,0x136f,0xa17,0xb3f)]=_0x24f870[_0x2901f0(0x920,0x180b,-0x5e6,0x108c)][_0x2901f0(0x1950,0x1680,0x1275,0x18fe)],_0xdd954b[_0x2901f0(0x1139,0x1b7c,0x19a7,0xf72)]=_0x5b05b8,_0xdd954b[_0x42ae87(0x23a6,0x1e1a,0x2852,0x13ea)]=0x4;let _0x2e8d36=_0xdd954b;const _0x164268={};_0x164268[_0x42ae87(0x17ce,0x8dd,0xc0a,0xb57)]=_0x5ec5df,_0x1f583c[_0x42ae87(0x777,0xc45,0x13e9,0xf78)+'e'](_0x46bbd8['chat'],_0x2e8d36,_0x164268);}else return _0x2901f0(0x505,-0x445,-0x284,0x1278);});break;case _0x4b485e['XciKP']:if(_0x1bac1f)return _0x4b485e[_0x23937d(0x9a3,0xdc5,0x6e,0x10d3)](_0x1db05d,mess[_0x313705(0x982,0xef3,0x17b7,0x15f7)]);if(_0x1e03f5)return _0x1db05d(mess[_0x313705(0x926,-0x26d,0x1498,-0x5de)]);_0x4b485e[_0x313705(0x1b35,0x25ac,0x239f,0x20dd)](_0x1db05d,mess[_0x23937d(0x8ac,0x600,-0x5e5,-0x1b1)]),waifudd=await axios[_0x23937d(0xc3d,0x163b,0x102a,0x143e)](_0x23937d(0x1381,0x14dc,0x1cda,0x557)+_0x23937d(0x637,-0x162,0xc07,-0x532)+_0x313705(0x1dc7,0x23bf,0x1839,0x19cc)+'e');const _0x1db8d0={};_0x1db8d0[_0x313705(0x175a,0x1c5e,0xedb,0x20f7)+'t']='Next\x20✨';const _0x5c0990={};_0x5c0990[_0x313705(0x1e72,0x2b17,0x1225,0x2c6a)]='.'+_0x1354e9,_0x5c0990[_0x23937d(0x159c,0x14b9,0x1dcf,0xe11)]=_0x1db8d0,_0x5c0990[_0x313705(0xa9e,0xcae,0x1a1,0x9c0)]=0x1;var _0x254b69=[_0x5c0990];const _0x3d0362={};_0x3d0362[_0x23937d(0xa79,0x16e,-0x381,-0x124)]=waifudd[_0x23937d(0xe17,0x319,0x495,0x1a41)][_0x313705(0xddf,0x1b6b,0xd94,0xcd5)];const _0x2413b1={};_0x2413b1[_0x313705(0x1fa9,0x1d66,0x26f7,0x1731)]=_0x3d0362,_0x2413b1[_0x313705(0xcce,0x800,0x1b54,0x9c0)]=''+mess['caption'],_0x2413b1[_0x23937d(0x106e,0x1bed,0x1278,0x1a4f)]=''+global['botname'],_0x2413b1[_0x313705(0xfa0,0xaf9,0x2a2,0xdf3)]=_0x254b69,_0x2413b1['headerType']=0x4;let _0xf8d384=_0x2413b1;await _0x175756[_0x23937d(0x944,0x1610,0x22,0xeb8)+'e'](_0x5cd288[_0x313705(0x14f2,0x1f3c,0xbcd,0xa82)],_0xf8d384,{'quoted':_0x5cd288})['catch'](_0x20b931=>{const _0x15a5e2={};function _0x4c4d0d(_0xbbcedf,_0x1d4816,_0x425830,_0x42e5dc){return _0x313705(_0x42e5dc-0x11f,_0xbbcedf,_0x425830-0x3e,_0x42e5dc-0x19e);}_0x15a5e2[_0x4c4d0d(-0x40f,0x593,0x445,0x72b)]=_0x4c4d0d(0x724,0x1e88,0xbee,0xfa0)+_0x4c4d0d(0x2853,0x123f,0x1293,0x1a72)+_0x4c4d0d(0x1356,0x5fd,0xe18,0x760)+'ngan.jpg';const _0x334619=_0x15a5e2;function _0x5a36a8(_0x78000,_0x55156c,_0x3c0930,_0x43218a){return _0x23937d(_0x43218a-0x589,_0x78000,_0x3c0930-0x125,_0x43218a-0x85);}if(_0x4b485e['gBcsp'](_0x4b485e[_0x4c4d0d(0x140d,0x627,0x1e3d,0x10f0)],'NFDft'))var _0x41018c=_0x334619[_0x4c4d0d(0xee0,0x10c6,0xe9f,0x72b)];else return _0x4b485e[_0x4c4d0d(0x1621,0x927,0xa15,0xb8a)];});break;case _0x4b485e[_0x23937d(0xec6,0xbc4,0x987,0x1d5)]:if(_0x1bac1f)return _0x4b485e[_0x313705(0x85c,0xa4c,0xa3d,0x158d)](_0x1db05d,mess['ban']);if(_0x1e03f5)return _0x4b485e['WsyFM'](_0x1db05d,mess[_0x313705(0x926,0x8e1,0x106,0x1359)]);_0x4b485e[_0x313705(0x1401,0x1e57,0xe1e,0xc1b)](_0x1db05d,mess[_0x313705(0xc12,0x1192,0xdde,-0x11f)]),waifudd=await axios[_0x23937d(0xc3d,0x11ce,0x1713,0x1e7)](_0x23937d(0x1381,0x11ed,0xe0c,0x4c7)+'i.waifu.pi'+'cs/sfw/awo'+'o');const _0x842d4={};_0x842d4[_0x313705(0x175a,0x11be,0x1c8a,0x88a)+'t']='Next\x20✨';const _0x3278ce={};_0x3278ce[_0x313705(0x1e72,0x18cd,0x25c9,0x1b9e)]='.'+_0x1354e9,_0x3278ce[_0x313705(0x1902,0x1635,0x17c2,0x10e1)]=_0x842d4,_0x3278ce[_0x23937d(0x738,0x26c,-0x4ab,0x585)]=0x1;var _0x274daf=[_0x3278ce];const _0x240760={};_0x240760[_0x23937d(0xa79,0x1605,0x41a,0x1418)]=waifudd[_0x313705(0x117d,0x1184,0x2083,0x1419)][_0x313705(0xddf,0x9c0,0x18af,0x14c1)];const _0x4f3b15={};_0x4f3b15[_0x313705(0x1fa9,0x1b17,0x14db,0x1bb6)]=_0x240760,_0x4f3b15[_0x23937d(0x968,0x1122,0x8af,0x1031)]=''+mess['caption'],_0x4f3b15[_0x313705(0x13d4,0x9bc,0x651,0x2022)]=''+global[_0x313705(0xcd2,0x153,0x3de,0x3de)],_0x4f3b15[_0x23937d(0xc3a,0x15d2,-0x24d,0x19c0)]=_0x274daf,_0x4f3b15['headerType']=0x4;let _0x12bb77=_0x4f3b15;await _0x175756['sendMessag'+'e'](_0x5cd288[_0x23937d(0x118c,0xf4a,0x19b3,0x1862)],_0x12bb77,{'quoted':_0x5cd288})[_0x23937d(0x934,0xe0e,0x1c7,0x21e)](_0x4e2212=>{return _0x4b485e['vJiFV'];});break;case _0x4b485e[_0x23937d(0x686,0xa0a,-0x272,0x4a4)]:if(_0x1bac1f)return _0x4b485e[_0x23937d(0x10d6,0x1d98,0x16eb,0x3b9)](_0x1db05d,mess[_0x23937d(0x61c,0x4d6,0x87,-0x32f)]);if(_0x1e03f5)return _0x1db05d(mess[_0x313705(0x926,0xe7a,0x7d2,-0x22f)]);_0x4b485e[_0x23937d(0x10ac,0x165b,0x3cb,0x609)](_0x1db05d,mess['wait']),waifudd=await axios['get'](_0x23937d(0x1381,0x206f,0x10c1,0x1d21)+_0x23937d(0x637,0x2ee,0x13ed,0x1cf)+_0x23937d(0xaf,-0xa8,-0x84c,-0xc3d)+'sh');const _0x4e1400={};_0x4e1400[_0x313705(0x175a,0x21c3,0xe5e,0xd03)+'t']='Next\x20✨';const _0x53cd3d={};_0x53cd3d['buttonId']='.'+_0x1354e9,_0x53cd3d[_0x313705(0x1902,0xe20,0x231e,0x2394)]=_0x4e1400,_0x53cd3d[_0x23937d(0x738,0xc7e,0x4f5,-0x2c3)]=0x1;var _0x29adb7=[_0x53cd3d];const _0x1ee630={};_0x1ee630[_0x313705(0xddf,0x3b4,0xd35,0x32d)]=waifudd[_0x23937d(0xe17,0x14bd,0x502,0xe6d)][_0x23937d(0xa79,0x1168,-0x26b,0x182b)];const _0x5ec0f9={};_0x5ec0f9[_0x313705(0x1fa9,0x2cc5,0x23d3,0x201c)]=_0x1ee630,_0x5ec0f9[_0x23937d(0x968,0x1471,0x16ab,0x100a)]=''+mess[_0x313705(0xcce,0x1725,0x18d7,0x4dd)],_0x5ec0f9[_0x23937d(0x106e,0x1768,0x119a,0x1efd)]=''+global[_0x23937d(0x96c,-0x270,0x56c,0x5ac)],_0x5ec0f9['buttons']=_0x29adb7,_0x5ec0f9[_0x313705(0x1e7f,0x254d,0x2c9d,0x1656)]=0x4;let _0x304450=_0x5ec0f9;await _0x175756[_0x23937d(0x944,-0x4f5,0x17e6,0xd15)+'e'](_0x5cd288[_0x313705(0x14f2,0x9d1,0xc20,0x2094)],_0x304450,{'quoted':_0x5cd288})[_0x313705(0xc9a,0x797,0x7ad,0x1b9e)](_0x18fcec=>{function _0xdc9f49(_0x45555e,_0x139a35,_0x3bf692,_0x21ccd1){return _0x23937d(_0x21ccd1- -0xae,_0x3bf692,_0x3bf692-0x3d,_0x21ccd1-0x174);}return _0x4b485e[_0xdc9f49(0x990,0xf04,0xc8,0x657)];});break;case _0x4b485e['XKlLT']:if(_0x1bac1f)return _0x1db05d(mess[_0x313705(0x982,0x13bc,-0x1a7,0x7b2)]);if(_0x1e03f5)return _0x4b485e['qvxui'](_0x1db05d,mess[_0x313705(0x926,0x17d3,0x995,0x9a1)]);_0x4b485e[_0x313705(0xef3,0x94f,0x429,0x163b)](_0x1db05d,mess['wait']),waifudd=await axios[_0x313705(0xfa3,0x100e,0xd7c,0xb84)]('https://ap'+_0x23937d(0x637,0x10f1,0x1244,0x153e)+_0x313705(0x1e62,0x2bef,0x1da3,0x1a69)+'g');const _0x2b9b10={};_0x2b9b10[_0x23937d(0x13f4,0xd06,0x215b,0x1bbe)+'t']=_0x313705(0x108c,0x177f,0x18c7,0x519);const _0x4910fd={};_0x4910fd[_0x313705(0x1e72,0x2b05,0x2360,0x21e6)]='.'+_0x1354e9,_0x4910fd['buttonText']=_0x2b9b10,_0x4910fd[_0x23937d(0x738,0x87c,0xf0d,0x4e8)]=0x1;var _0x4fc713=[_0x4910fd];const _0x5c7a5a={};_0x5c7a5a['url']=waifudd[_0x23937d(0xe17,0x1204,0x107,0x1d32)][_0x23937d(0xa79,0x16a9,-0xc0,0x167e)];const _0x144c62={};_0x144c62[_0x23937d(0x1c43,0x1fde,0x1379,0x2a73)]=_0x5c7a5a,_0x144c62[_0x313705(0xcce,0x703,0x1812,0xaab)]=''+mess[_0x23937d(0x968,-0x2b,0xaab,0x1b)],_0x144c62[_0x313705(0x13d4,0x16cd,0x138b,0x11dc)]=''+global[_0x23937d(0x96c,0xab2,0x159,0x10f1)],_0x144c62[_0x313705(0xfa0,0x1320,0x3d9,0xff8)]=_0x4fc713,_0x144c62[_0x313705(0x1e7f,0x17eb,0x2505,0x2ce6)]=0x4;let _0x7c0ef2=_0x144c62;await _0x175756[_0x23937d(0x944,0x5a3,-0x53b,0x457)+'e'](_0x5cd288[_0x313705(0x14f2,0xb1b,0x20e8,0x192c)],_0x7c0ef2,{'quoted':_0x5cd288})[_0x313705(0xc9a,0xaa0,0x190e,-0x169)](_0x2b6bd3=>{function _0x114169(_0x25d251,_0x4a4862,_0xee32e5,_0x2bf58d){return _0x23937d(_0x4a4862- -0x20,_0x2bf58d,_0xee32e5-0x15c,_0x2bf58d-0x3);}function _0x2ecf27(_0x58fda7,_0x2c9290,_0x38a263,_0x2f838e){return _0x313705(_0x38a263- -0x458,_0x58fda7,_0x38a263-0x67,_0x2f838e-0x1ed);}const _0x385fc4={'MTbEw':function(_0x188be1,_0x5bca6d){function _0x4ee01d(_0x40a139,_0x1871d0,_0x477cc8,_0x17074f){return _0x2506(_0x40a139-0x13,_0x17074f);}return _0x4b485e[_0x4ee01d(0x1a4a,0x1590,0x18cf,0x1f18)](_0x188be1,_0x5bca6d);},'JMJOu':_0x4b485e[_0x114169(0x14ca,0xd50,-0x14,0xac5)],'UdZDG':'Time\x20Out\x0aA'+_0x2ecf27(0x1533,0x185f,0x12b7,0x15a6)};if(_0x4b485e[_0x2ecf27(-0xd57,-0x2c,0xcd,-0x3f)]('pNdoK',_0x4b485e['KFaPb']))return _0x4b485e[_0x114169(0x72,0x6e5,0x134,0xed3)];else _0x54cfc3[_0x114169(0x141c,0xba6,-0x193,0x6da)](_0x385fc4[_0x2ecf27(0x257b,0x1a3b,0x1a38,0x1188)](_0x385fc4[_0x2ecf27(-0x32c,0x37e,0x5ce,-0x59a)],_0x44f137['jawaban'])),_0x272b0c(_0x385fc4[_0x114169(0x237c,0x1b0a,0x250c,0x18cf)](_0x385fc4['UdZDG'],_0x6b41c6[_0xaa52ec[_0x114169(0x1b39,0x14ae,0xd18,0x1844)]['split']('@')[-0xe*0x29c+0x92c+0x67*0x44]])),delete _0x517658[_0xb678db[_0x2ecf27(0x1bf4,0x5d6,0x13dc,0x798)][_0x114169(0x350,0xcaf,0x129,0x2d6)]('@')[-0x4e*-0x38+0x26af+-0x37bf]];});break;case _0x4b485e[_0x23937d(0x1bbf,0x12dd,0x2105,0x1d9a)]:if(_0x1bac1f)return _0x4b485e[_0x23937d(0xfd9,0x1ad6,0x8ac,0xd11)](_0x1db05d,mess[_0x23937d(0x61c,0x10f6,0xd32,0x538)]);if(_0x1e03f5)return _0x1db05d(mess['banChat']);_0x4b485e['ENlIm'](_0x1db05d,mess[_0x313705(0xc12,0x959,0x6f0,0xfcd)]),waifudd=await axios[_0x313705(0xfa3,0x16d5,0x1664,0x12b6)](_0x313705(0x16e7,0x1fa7,0x98d,0x7f0)+_0x23937d(0x637,-0x330,-0x2e7,0x255)+_0x313705(0x1c88,0x121e,0x2597,0x2695)+'mp');const _0x116642={};_0x116642[_0x23937d(0x13f4,0x16a1,0x191f,0xa71)+'t']=_0x313705(0x108c,0x1874,0x1b94,0x1224);const _0x1dea0e={};_0x1dea0e['buttonId']='.'+_0x1354e9,_0x1dea0e[_0x313705(0x1902,0x1eea,0x24ff,0xd6a)]=_0x116642,_0x1dea0e['type']=0x1;var _0x503c21=[_0x1dea0e];const _0x53eaf1={};_0x53eaf1['url']=waifudd[_0x23937d(0xe17,0x1ad,0x7a9,0xa11)][_0x313705(0xddf,0xacf,0x122f,-0x115)];const _0x2c4d6c={};_0x2c4d6c['image']=_0x53eaf1,_0x2c4d6c[_0x313705(0xcce,-0x1d0,0x5a7,0x132d)]=''+mess[_0x23937d(0x968,0x253,0xfb7,0x179c)],_0x2c4d6c[_0x313705(0x13d4,0x1c0c,0xd74,0x13b2)]=''+global['botname'],_0x2c4d6c[_0x23937d(0xc3a,0xb09,0x25c,0xcc0)]=_0x503c21,_0x2c4d6c[_0x313705(0x1e7f,0x1318,0x1951,0x158a)]=0x4;let _0x517fae=_0x2c4d6c;await _0x175756[_0x23937d(0x944,0x6cb,0xa8c,-0x1d8)+'e'](_0x5cd288[_0x23937d(0x118c,0x8af,0x67d,0x4db)],_0x517fae,{'quoted':_0x5cd288})[_0x313705(0xc9a,0x7fd,0x2cf,0xc45)](_0x13f0c3=>{function _0x4d1dcc(_0x7a0b77,_0x4d7c90,_0x4ce52c,_0x3b153b){return _0x313705(_0x3b153b-0xda,_0x7a0b77,_0x4ce52c-0x1f2,_0x3b153b-0xbd);}return _0x4b485e[_0x4d1dcc(0x3aa,0xc2a,0x65e,0xb45)];});break;case _0x4b485e[_0x23937d(0xa37,0x106d,-0xa7,0x1636)]:if(_0x1bac1f)return _0x4b485e[_0x23937d(0xa19,0x495,0x191c,0x609)](_0x1db05d,mess[_0x313705(0x982,0xb1c,-0x25,0x5c2)]);if(_0x1e03f5)return _0x4b485e[_0x23937d(0x1875,0x1463,0xf52,0x12a0)](_0x1db05d,mess[_0x23937d(0x5c0,0x52d,0x1472,0xf6e)]);_0x4b485e['Bjaxo'](_0x1db05d,mess[_0x23937d(0x8ac,0x11a4,-0x3a9,0x215)]),waifudd=await axios[_0x23937d(0xc3d,-0x240,0x11e6,0x10fa)](_0x23937d(0x1381,0x647,0x1160,0x21df)+_0x313705(0x99d,0x15e4,0x33c,0x13ee)+_0x313705(0x1dbd,0x2b34,0x132b,0x255e)+'py');const _0x5ae187={};_0x5ae187[_0x313705(0x175a,0x1293,0x1a7a,0x182d)+'t']=_0x23937d(0xd26,0x96d,0x18b5,0x3af);const _0x32eda3={};_0x32eda3[_0x23937d(0x1b0c,0x235d,0x16d7,0x1105)]='.'+_0x1354e9,_0x32eda3[_0x23937d(0x159c,0xc4b,0x1b33,0x1ea5)]=_0x5ae187,_0x32eda3[_0x313705(0xa9e,-0x2e1,0x16f2,0x8fc)]=0x1;var _0x49fcae=[_0x32eda3];const _0x5a28e9={};_0x5a28e9['url']=waifudd[_0x23937d(0xe17,0x7d3,0x183c,0x3ff)]['url'];const _0x26a730={};_0x26a730['image']=_0x5a28e9,_0x26a730['caption']=''+mess['caption'],_0x26a730[_0x313705(0x13d4,0xd7c,0x1e35,0x6b4)]=''+global[_0x23937d(0x96c,0x10d,0x25b,0x108b)],_0x26a730[_0x23937d(0xc3a,0x691,0xc7c,0xa5e)]=_0x49fcae,_0x26a730[_0x23937d(0x1b19,0x1393,0x234a,0x18f0)]=0x4;let _0x23e495=_0x26a730;await _0x175756[_0x313705(0xcaa,0xbb8,-0x17d,0x19b6)+'e'](_0x5cd288[_0x313705(0x14f2,0x1b75,0x66d,0x6d6)],_0x23e495,{'quoted':_0x5cd288})['catch'](_0x335ee8=>{function _0x4e0fa8(_0x37fc96,_0x42a0dc,_0x5c80,_0x242c96){return _0x23937d(_0x242c96-0xa5,_0x37fc96,_0x5c80-0x4e,_0x242c96-0x5a);}return _0x4e0fa8(0xaa1,-0xc22,0xda7,0xab);});break;case _0x4b485e['XxbiY']:if(_0x1bac1f)return _0x4b485e[_0x23937d(0x607,0x1079,0x10e4,0xb16)](_0x1db05d,mess[_0x23937d(0x61c,0x1345,0x5b9,0x172)]);if(_0x1e03f5)return _0x4b485e[_0x313705(0x2068,0x2f4c,0x2edb,0x268b)](_0x1db05d,mess['banChat']);_0x4b485e[_0x313705(0x48f,0xde0,0x8dd,0xee3)](_0x1db05d,mess['wait']),waifudd=await axios[_0x23937d(0xc3d,0x4,0x912,0xb5)](_0x313705(0x16e7,0x1c9b,0x1e7d,0x8cb)+_0x313705(0x99d,-0x250,0x1b3,0x5c2)+'cs/sfw/dan'+'ce');const _0x51bef6={};_0x51bef6[_0x23937d(0x13f4,0xb3c,0x1280,0x1f36)+'t']=_0x313705(0x108c,0x1972,0xef6,0xd39);const _0x16dc05={};_0x16dc05['buttonId']='.'+_0x1354e9,_0x16dc05[_0x313705(0x1902,0xaea,0x1ee2,0x2484)]=_0x51bef6,_0x16dc05[_0x23937d(0x738,0x307,0xed5,0x14ed)]=0x1;var _0x4a9c50=[_0x16dc05];const _0xfa230={};_0xfa230[_0x313705(0xddf,0x16d6,0xf3b,0x1205)]=waifudd[_0x23937d(0xe17,0xc42,0xbac,0x164a)]['url'];const _0x4ea813={};_0x4ea813[_0x23937d(0x1c43,0x16a4,0x1312,0x1967)]=_0xfa230,_0x4ea813[_0x23937d(0x968,0x128f,0xffe,0x704)]=''+mess[_0x313705(0xcce,0xd70,0xdab,0x9cd)],_0x4ea813[_0x23937d(0x106e,0x14cc,0x89c,0xe04)]=''+global[_0x23937d(0x96c,-0x149,0x986,0x10a)],_0x4ea813['buttons']=_0x4a9c50,_0x4ea813['headerType']=0x4;let _0x53e9d5=_0x4ea813;await _0x175756[_0x23937d(0x944,0x83a,0x2b,0x41f)+'e'](_0x5cd288['chat'],_0x53e9d5,{'quoted':_0x5cd288})['catch'](_0x3dc73e=>{function _0x47e9eb(_0x3ff22c,_0x4aba52,_0x4a1036,_0x421a89){return _0x313705(_0x4aba52-0x230,_0x421a89,_0x4a1036-0x115,_0x421a89-0x184);}function _0x135bc4(_0x4fef4f,_0x34e54e,_0x37c462,_0x353879){return _0x313705(_0x34e54e-0x18f,_0x37c462,_0x37c462-0x11e,_0x353879-0xdd);}if(_0x47e9eb(0xfa7,0x154f,0x635,0x15d2)===_0x135bc4(-0x32d,0xb77,0x69,0x19c7)){if(!_0x16bf4a)return _0x4b485e[_0x135bc4(0x70b,0x158b,0x1c87,0x8ae)](_0x56bd16,_0x4b485e[_0x135bc4(0xac3,0x90b,0xe35,-0x7f)]);let _0x1378d1=_0x1011b8[_0x47e9eb(0x11b1,0xf7c,0x156d,0x8b9)](_0x4dbca1);_0x4a72e1[_0x135bc4(0x2ce,0xaf0,0x1566,0xade)](_0x1378d1,-0x8b2*-0x1+0x923+-0x11d4),_0x4b485e[_0x135bc4(0x1b91,0xd55,0x723,0x1667)](_0x218016,'Successful'+'ly\x20unbanne'+_0x135bc4(0xa16,0xb6f,0x1724,-0x1cc));}else return _0x4b485e[_0x47e9eb(0x6a2,0xc9b,0x1587,-0x1de)];});break;case _0x313705(0x1d38,0x16e9,0x1a53,0x253b)+'e':if(_0x1bac1f)return _0x4b485e[_0x313705(0x946,0x1733,0xd4f,-0x30d)](_0x1db05d,mess[_0x23937d(0x61c,0xeb6,0x622,0x1319)]);if(_0x1e03f5)return _0x4b485e['xZnEO'](_0x1db05d,mess['banChat']);_0x4b485e[_0x313705(0x2134,0x2272,0x145e,0x1768)](_0x1db05d,mess['wait']),waifudd=await axios['get'](_0x313705(0x16e7,0x186f,0x1847,0x255e)+_0x313705(0x99d,0x125e,0x35b,0x2a)+_0x23937d(0x1ce8,0x123f,0x261b,0x299d)+_0x313705(0x18a7,0x1d0e,0x2481,0xc19));const _0x1d8b7d={};_0x1d8b7d['displayTex'+'t']=_0x313705(0x108c,0x19f0,0x9f2,0x1384);const _0x1e23c2={};_0x1e23c2[_0x23937d(0x1b0c,0x25c9,0x28f0,0x250d)]='.'+_0x1354e9,_0x1e23c2[_0x23937d(0x159c,0x1855,0xc5e,0x1283)]=_0x1d8b7d,_0x1e23c2[_0x23937d(0x738,0x1468,0x94a,-0x9)]=0x1;var _0x2402b0=[_0x1e23c2];const _0x566fb9={};_0x566fb9['url']=waifudd[_0x313705(0x117d,0x122c,0x1975,0x1871)][_0x23937d(0xa79,0x1a4,0x2c1,-0x1fa)];const _0x218a77={};_0x218a77[_0x313705(0x1fa9,0x2d1e,0x1e48,0x2349)]=_0x566fb9,_0x218a77[_0x23937d(0x968,0xae1,0x1653,-0x402)]=''+mess[_0x313705(0xcce,0x1795,0xc25,0xdc2)],_0x218a77[_0x23937d(0x106e,0x11d6,0x1911,0x10e1)]=''+global['botname'],_0x218a77[_0x23937d(0xc3a,0x419,-0x110,0xd5f)]=_0x2402b0,_0x218a77[_0x313705(0x1e7f,0x1164,0x1051,0x1a7d)]=0x4;let _0x7f90da=_0x218a77;await _0x175756[_0x23937d(0x944,-0x387,0x650,0xf7d)+'e'](_0x5cd288['chat'],_0x7f90da,{'quoted':_0x5cd288})[_0x23937d(0x934,0xde8,-0x542,0x150a)](_0x433112=>{function _0x398b60(_0x36b39b,_0x3b0e3d,_0x1a099b,_0x3f22fb){return _0x313705(_0x3b0e3d- -0x51e,_0x3f22fb,_0x1a099b-0xcd,_0x3f22fb-0x24);}function _0x552fc8(_0x4bdbd2,_0x40f01f,_0x17d5bf,_0x4dcbf5){return _0x23937d(_0x17d5bf- -0x40,_0x4bdbd2,_0x17d5bf-0x7f,_0x4dcbf5-0x1c3);}if(_0x4b485e[_0x552fc8(-0x5f,-0x828,0x1e1,0xc28)]===_0x4b485e[_0x552fc8(0x183a,0x1ac4,0xc6e,0x1729)]){const _0xf47162={};_0xf47162[_0x398b60(0x1054,0x1b81,0x1e62,0x11e2)]=''+_0x529af2[_0x398b60(0x29ca,0x1b4c,0xf05,0x106d)];const _0x1dadda={};_0x1dadda[_0x552fc8(0x1082,0xc59,0x59c,0xb45)]=_0x5931c3,_0x487522[_0x552fc8(0xabf,0xf07,0x904,-0xad)+'e'](_0x1089ed[_0x398b60(0x1086,0xfd4,0x1c56,0xe4d)],_0xf47162,_0x1dadda);}else return _0x4b485e[_0x552fc8(0x400,0x99d,0x6c5,0x1188)];});break;case _0x4b485e[_0x23937d(0x485,-0x6c5,-0x8fd,0x3ba)]:if(_0x1bac1f)return _0x1db05d(mess[_0x313705(0x982,0xfa9,0x15d4,0x17bd)]);if(_0x1e03f5)return _0x4b485e['DYLij'](_0x1db05d,mess[_0x313705(0x926,0xd04,-0x5e5,-0x5bf)]);_0x4b485e['Bjaxo'](_0x1db05d,mess[_0x23937d(0x8ac,0x117e,-0x2f2,0xe81)]),waifudd=await axios['get'](_0x313705(0x16e7,0x1718,0x252c,0x22aa)+_0x23937d(0x637,-0x833,-0x3fc,0xf35)+'cs/sfw/hig'+_0x313705(0x3df,0xac3,0xc97,-0x631));const _0x27a5bf={};_0x27a5bf[_0x313705(0x175a,0x236c,0x129c,0x1bd6)+'t']='Next\x20✨';const _0x3b17a6={};_0x3b17a6[_0x313705(0x1e72,0x2431,0x2553,0x117b)]='.'+_0x1354e9,_0x3b17a6[_0x313705(0x1902,0x9ea,0xda5,0x1b7a)]=_0x27a5bf,_0x3b17a6[_0x313705(0xa9e,0xa6a,0x1487,0x1bc)]=0x1;var _0x1b567e=[_0x3b17a6];const _0x423cb0={};_0x423cb0[_0x23937d(0xa79,0xeb8,0xb5d,0x564)]=waifudd['data']['url'];const _0x194a18={};_0x194a18['image']=_0x423cb0,_0x194a18[_0x313705(0xcce,0x1371,0x50,0x47d)]=''+mess['caption'],_0x194a18[_0x23937d(0x106e,0x917,0xf6b,0xec1)]=''+global['botname'],_0x194a18[_0x23937d(0xc3a,0x15c3,0x82a,0x16d8)]=_0x1b567e,_0x194a18[_0x313705(0x1e7f,0x1a8b,0x28db,0x1fe3)]=0x4;let _0x3ae5f0=_0x194a18;await _0x175756['sendMessag'+'e'](_0x5cd288[_0x23937d(0x118c,0x1a0e,0x5ff,0xc50)],_0x3ae5f0,{'quoted':_0x5cd288})['catch'](_0x3ffe32=>{return _0x4b485e['vJiFV'];});break;case _0x4b485e['lPctf']:if(_0x1bac1f)return _0x4b485e['zJNbN'](_0x1db05d,mess[_0x23937d(0x61c,0x117b,0xd17,-0x1f6)]);if(_0x1e03f5)return _0x4b485e[_0x313705(0x67b,0x1c2,0x182,0x71c)](_0x1db05d,mess[_0x313705(0x926,0xe05,0xcfc,0x16b3)]);_0x4b485e[_0x23937d(0x1bb5,0x1cd4,0x1c89,0x2462)](_0x1db05d,mess['wait']),waifudd=await axios[_0x313705(0xfa3,0x1051,0x15c0,0x632)]('https://ap'+_0x313705(0x99d,0x138f,0x1367,0x114b)+_0x23937d(0x2e6,-0xaa4,0x104a,-0x517)+_0x23937d(0x65,0xd1,-0x82b,-0x603));const _0x559bd1={};_0x559bd1[_0x23937d(0x13f4,0x968,0x14e5,0x1178)+'t']=_0x313705(0x108c,0x1cc7,0xd1f,0xa7d);const _0x19d198={};_0x19d198[_0x23937d(0x1b0c,0x11db,0x288c,0xe0c)]='.'+_0x1354e9,_0x19d198[_0x23937d(0x159c,0x14b9,0x2291,0x1884)]=_0x559bd1,_0x19d198[_0x23937d(0x738,-0x66,-0x6f2,0xa46)]=0x1;var _0x16461a=[_0x19d198];const _0x23449d={};_0x23449d[_0x23937d(0xa79,0x239,0x170e,0xcb)]=waifudd['data'][_0x313705(0xddf,0x1ab6,0xd87,0x8ba)];const _0x8b05ec={};_0x8b05ec[_0x313705(0x1fa9,0x164b,0x2a37,0x167f)]=_0x23449d,_0x8b05ec[_0x313705(0xcce,0xbd,0x5f9,0x79d)]=''+mess[_0x313705(0xcce,0x1a1d,0xab,0x1517)],_0x8b05ec['footer']=''+global[_0x313705(0xcd2,0xd43,0x9aa,0x1b9b)],_0x8b05ec['buttons']=_0x16461a,_0x8b05ec[_0x313705(0x1e7f,0x113c,0x2c1f,0x179d)]=0x4;let _0x8348b6=_0x8b05ec;await _0x175756[_0x23937d(0x944,0xa79,0x1375,0x7fb)+'e'](_0x5cd288[_0x313705(0x14f2,0xfe4,0x21ff,0x213e)],_0x8348b6,{'quoted':_0x5cd288})[_0x23937d(0x934,0xac4,0x20d,0x4d5)](_0x1addc3=>{function _0x2e5d91(_0x491425,_0x48c7e1,_0x4a6939,_0x4caedb){return _0x313705(_0x4caedb- -0x32d,_0x48c7e1,_0x4a6939-0x31,_0x4caedb-0x137);}function _0x21111f(_0xbdeaf3,_0x1d784c,_0x49b95d,_0x50a3a2){return _0x313705(_0x50a3a2-0x162,_0x49b95d,_0x49b95d-0x198,_0x50a3a2-0x1d5);}return _0x2e5d91(0x10f0,0x1386,0x6f7,0x9fb)!==_0x4b485e[_0x2e5d91(0xd8,0xbaa,-0x306,0x980)]?_0x4b485e['vJiFV']:_0x4b485e[_0x21111f(0x1cb,-0x270,-0x2f8,0xbcd)];});break;case _0x4b485e[_0x23937d(0x329,0xc42,-0x18f,0xe42)]:if(_0x1bac1f)return _0x4b485e[_0x23937d(0x1aa9,0x2491,0x1cfd,0xbb0)](_0x1db05d,mess[_0x23937d(0x61c,-0x2e2,-0xe4,0x245)]);if(_0x1e03f5)return _0x4b485e['iTWWF'](_0x1db05d,mess['banChat']);_0x4b485e[_0x23937d(0x1319,0x171e,0x1550,0x773)](_0x1db05d,mess[_0x23937d(0x8ac,-0x28c,0x1688,0x9ca)]),waifudd=await axios['get'](_0x313705(0x16e7,0x14ed,0xd6a,0x1dea)+_0x23937d(0x637,-0x3e7,0x8ac,0xb15)+_0x23937d(0xf12,0x10dc,0x1423,0x153b)+_0x313705(0x1915,0x1a09,0x1cec,0x1956));const _0x5b9149={};_0x5b9149[_0x313705(0x175a,0x2085,0xfd3,0x1b37)+'t']=_0x23937d(0xd26,0x1895,-0x61,0x2a4);const _0x370c4c={};_0x370c4c[_0x313705(0x1e72,0x18c1,0x12f7,0x1c15)]='.'+_0x1354e9,_0x370c4c[_0x313705(0x1902,0xb94,0x233a,0x1212)]=_0x5b9149,_0x370c4c[_0x23937d(0x738,-0x13b,-0x695,0xb10)]=0x1;var _0x53aaad=[_0x370c4c];const _0x86fc56={};_0x86fc56['url']=waifudd['data'][_0x23937d(0xa79,0xab7,0xdfd,0x294)];const _0x34ab8b={};_0x34ab8b[_0x23937d(0x1c43,0x1fb0,0x14d2,0x242b)]=_0x86fc56,_0x34ab8b['caption']=''+mess[_0x23937d(0x968,-0x2c1,0xed4,0xf82)],_0x34ab8b[_0x313705(0x13d4,0xd0e,0x1c64,0x134a)]=''+global[_0x23937d(0x96c,0xe3d,-0x168,0x1131)],_0x34ab8b['buttons']=_0x53aaad,_0x34ab8b[_0x313705(0x1e7f,0x26a9,0x2840,0x2224)]=0x4;let _0x3f982e=_0x34ab8b;await _0x175756[_0x313705(0xcaa,0xd32,0x675,0x1249)+'e'](_0x5cd288['chat'],_0x3f982e,{'quoted':_0x5cd288})[_0x23937d(0x934,0x11e6,0x1190,0x807)](_0x4fa812=>{function _0x2bde01(_0xe52716,_0x252da3,_0xee66dd,_0x3d6051){return _0x313705(_0x3d6051- -0x40b,_0xee66dd,_0xee66dd-0x3a,_0x3d6051-0xee);}function _0x1ad057(_0x444484,_0x4ea3ce,_0x159245,_0x18c529){return _0x313705(_0x18c529- -0x536,_0x4ea3ce,_0x159245-0x1ed,_0x18c529-0x9b);}const _0x202242={'HZszt':function(_0x4020fe,_0x5acfd7){return _0x4b485e['FbqqN'](_0x4020fe,_0x5acfd7);},'pQsIA':function(_0x535dcf,_0x144b0d){return _0x4b485e['rKybW'](_0x535dcf,_0x144b0d);},'stTJe':_0x4b485e[_0x2bde01(0x15d1,0x1245,0x19f9,0x1703)],'Tflfi':function(_0x18c3ef,_0x52dccb){function _0x22b336(_0x37ff62,_0x1cda0a,_0x1b65c3,_0x3607e7){return _0x2bde01(_0x37ff62-0xe5,_0x1cda0a-0xe0,_0x3607e7,_0x37ff62-0x5f7);}return _0x4b485e[_0x22b336(0x1ddc,0x2449,0x2c8c,0x19bf)](_0x18c3ef,_0x52dccb);}};if(_0x4b485e[_0x2bde01(0x11b7,0x175,0x1383,0x4f3)](_0x4b485e[_0x1ad057(0x4d9,0x155c,0xea0,0x1036)],_0x2bde01(0x1ceb,0x136c,0x1694,0xe87))){if(_0x15d987)return _0x202242['HZszt'](_0x3ad1d1,_0x3176a1[_0x2bde01(0x9df,-0x12,-0x82,0x577)]);if(_0x15f0ad)return _0x202242[_0x2bde01(0x17be,0xd39,0x1bcc,0x1881)](_0x37064f,_0x381645[_0x1ad057(-0x7cd,-0xc0,-0x1d7,0x3f0)]);if(_0x2efdaf)return _0x202242[_0x1ad057(0x872,-0x734,0x36b,0x3b5)](_0x3c5c9a,_0x2ca769['ban']);if(_0x171b25)return _0x202242[_0x2bde01(0x1fd6,0xd66,0x1413,0x1881)](_0x5cdce0,_0x3ca5c6['banChat']);let _0x574272=_0x2c7f96[_0x2bde01(0xd1f,0xdc0,0xcd1,0x537)]['fileSha256']['toString'](_0x202242['stTJe']);if(!_0x574272)return _0x202242[_0x1ad057(0x1226,0x15a1,0x23aa,0x1756)](_0x236cb3,'No\x20Hashes');if(_0xfec353['db']['data'][_0x1ad057(0x1b0f,0x1d20,0x1241,0xe2a)][_0x574272]&&_0x1cba92['db']['data']['sticker'][_0x574272][_0x2bde01(0xa27,0xf50,0x1828,0xfa6)])return _0x202242[_0x2bde01(0xbac,0x1eb2,0x1750,0x162e)](_0xbbd0cb,_0x1ad057(-0x17c,0x135,0x530,0x5a1)+_0x1ad057(0x1711,0x11e9,0xc5,0xaf4)+'on\x20To\x20Dele'+_0x1ad057(0x26c,0xd05,0x8b5,0x825)+_0x2bde01(0x1ca2,0x15f8,0x1272,0x1780)+_0x2bde01(0xd1f,0x2898,0x199a,0x1bf9));delete _0x205cd2['db']['data'][_0x2bde01(0x17ae,0x16eb,0x5dc,0xf55)][_0x574272],_0x202242['pQsIA'](_0x3a2dbc,'Done!');}else return _0x4b485e[_0x1ad057(0x138f,-0x74e,0x12f2,0x535)];});break;case _0x4b485e[_0x23937d(0xbb7,0x6cc,0xbd8,0x750)]:if(_0x1bac1f)return _0x4b485e['jajTx'](_0x1db05d,mess['ban']);if(_0x1e03f5)return _0x4b485e[_0x313705(0x1eda,0x1961,0x2b6c,0x1f17)](_0x1db05d,mess[_0x313705(0x926,0x295,0x142f,0x398)]);_0x4b485e['cOcaF'](_0x1db05d,mess[_0x313705(0xc12,0x47e,0x1a0b,0xb29)]),ud=await axios[_0x313705(0xfa3,0x12c6,0x15c6,0x46a)](_0x23937d(0x7c8,0xd92,-0x83,0xa6c)+_0x23937d(0x1649,0x237a,0x1728,0x1bf4)+_0x23937d(0x1c84,0x21d2,0x296c,0xe5a)+_0x313705(0x17de,0x17f4,0x1af6,0x1b42));const _0x4ebc35={};_0x4ebc35['displayTex'+'t']=_0x23937d(0xd26,0xb63,0x1bbc,0x1a4b);const _0x58c1c7={};_0x58c1c7[_0x23937d(0x1b0c,0x1a66,0x179c,0x22c5)]=_0x23937d(0x15f4,0x17d6,0x141f,0x2068),_0x58c1c7['buttonText']=_0x4ebc35,_0x58c1c7[_0x313705(0xa9e,0x1639,0x60,0xb6d)]=0x1;var _0x5097d7=[_0x58c1c7];const _0x54408a={};_0x54408a[_0x23937d(0xa79,0x159f,0x1315,-0x2ff)]=ud[_0x23937d(0xe17,0x1ba9,0x1553,0xfbe)]['url'];const _0xe4bffc={};_0xe4bffc['image']=_0x54408a,_0xe4bffc[_0x23937d(0x968,0x119d,-0x5aa,0xe3d)]=''+mess[_0x313705(0xcce,0xcdf,0x824,0x1aeb)],_0xe4bffc[_0x313705(0x13d4,0x21c1,0x14d1,0x1488)]=''+global['botname'],_0xe4bffc[_0x313705(0xfa0,0x713,0xd62,0x1e9)]=_0x5097d7,_0xe4bffc[_0x23937d(0x1b19,0x2116,0x27cb,0x191c)]=0x4;let _0x54e509=_0xe4bffc;await _0x175756[_0x313705(0xcaa,0x140d,0x17cb,0x48)+'e'](_0x5cd288[_0x23937d(0x118c,0x1b9c,0x1da5,0xd8d)],_0x54e509,{'quoted':_0x5cd288})['catch'](_0xed815f=>{function _0x1d597e(_0x547c85,_0x33848e,_0x573554,_0x221aca){return _0x313705(_0x221aca- -0x4ab,_0x573554,_0x573554-0xfb,_0x221aca-0x1dc);}return _0x1d597e(0x17e,0x30a,-0xd37,-0x13f);});break;case _0x4b485e['MIztE']:if(_0x1bac1f)return _0x4b485e[_0x313705(0x819,0x16dd,0x1641,0x5c6)](_0x1db05d,mess[_0x313705(0x982,0x1437,0x48f,-0x53)]);if(_0x1e03f5)return _0x4b485e[_0x313705(0x1c12,0x289c,0x12d6,0x109d)](_0x1db05d,mess[_0x313705(0x926,0x4e,-0x87,0x1771)]);_0x4b485e['mPdoE'](_0x1db05d,mess[_0x23937d(0x8ac,0xf77,0x1007,0x9ed)]),ud=await axios[_0x23937d(0xc3d,0x2cf,0x151e,0x16a8)](_0x4b485e['dbUtC']);const _0x2f3b9e={};_0x2f3b9e[_0x23937d(0x13f4,0x1354,0x208f,0x10d9)+'t']=_0x313705(0x108c,0x1583,0x188d,0x49a);const _0x4e4beb={};_0x4e4beb[_0x313705(0x1e72,0x2b5a,0x16db,0x19b9)]=_0x23937d(-0x4,-0x45,0x753,-0x701),_0x4e4beb[_0x313705(0x1902,0xa9c,0x24c1,0xdb9)]=_0x2f3b9e,_0x4e4beb[_0x23937d(0x738,-0x238,0x7d0,0x3a5)]=0x1;var _0x5097d7=[_0x4e4beb];const _0x470031={};_0x470031[_0x23937d(0xa79,-0x22c,0xc,0x197)]=ud[_0x23937d(0xe17,0x1149,0x16ef,0x7de)][_0x23937d(0xa79,0x13f1,0x175e,0xb7a)];const _0x4a57af={};_0x4a57af[_0x23937d(0x1c43,0x262c,0x2269,0x1426)]=_0x470031,_0x4a57af[_0x23937d(0x968,0x176d,0x18a,-0x7c)]=''+mess['caption'],_0x4a57af[_0x23937d(0x106e,0x423,0x1650,0x617)]=''+global[_0x313705(0xcd2,0x19b2,0x2e7,0x88b)],_0x4a57af[_0x313705(0xfa0,0x9a6,0x11da,0x962)]=_0x5097d7,_0x4a57af[_0x23937d(0x1b19,0x2328,0x2696,0x155c)]=0x4;let _0x2ef8f0=_0x4a57af;await _0x175756[_0x313705(0xcaa,0xadf,0x19d3,0x14e0)+'e'](_0x5cd288[_0x313705(0x14f2,0x1355,0x2035,0xfb7)],_0x2ef8f0,{'quoted':_0x5cd288})[_0x23937d(0x934,0x15c3,0x9d7,-0x579)](_0x3e4876=>{function _0x18b0f3(_0x55a34e,_0x43081d,_0x3cbe8e,_0x3d90a9){return _0x313705(_0x43081d-0x13c,_0x3d90a9,_0x3cbe8e-0xc5,_0x3d90a9-0x10a);}const _0x26d2c0={'UkMXY':function(_0x2f6351,_0x36fb3a){return _0x2f6351(_0x36fb3a);},'SCTzd':function(_0x5bb1fe,_0x46153b){return _0x5bb1fe(_0x46153b);}};function _0x336f94(_0xbdb4c2,_0x3c0866,_0x179096,_0x2e10c7){return _0x23937d(_0xbdb4c2- -0x160,_0x179096,_0x179096-0x186,_0x2e10c7-0xf4);}if(_0x4b485e[_0x18b0f3(0x86e,0x7e7,0xdc1,0x636)](_0x4b485e[_0x336f94(0xab6,0x155b,0x102e,-0x43e)],_0x4b485e[_0x18b0f3(0x8b1,0x10b8,0x17d5,0x3a5)]))_0x26d2c0['UkMXY'](_0x3cf0ab,_0x18b0f3(-0x76a,0x743,0x92b,0x24b)+_0x18b0f3(0x1475,0x1323,0x1465,0x2012)+_0x18b0f3(0x122,0xd21,0xa95,0x9a)+_0x18b0f3(0x2944,0x226a,0x1ed7,0x1411)+_0x336f94(0x6f2,0x1543,0x503,0x15c4)+_0x26d2c0[_0x336f94(0x4c1,-0x1af,0x364,0x5ec)](_0x3b8fa6,_0x5e3124[_0x18b0f3(0x10d7,0x1970,0x13c3,0x20da)])+(_0x18b0f3(0x1c42,0x2066,0x2753,0x26ef)+_0x336f94(0x140,0xf75,0x1011,-0x6ed)+_0x18b0f3(0x126e,0x17ec,0x1b04,0x1ada))+_0x26d2c0[_0x336f94(0x423,-0x6d2,0xd42,0x52e)](_0x3ca3a6,_0x326405[_0x336f94(0x136e,0x6ae,0x1376,0x20cb)]));else return _0x18b0f3(0x8ec,0x4a8,0x108d,-0x425);});break;case'awoo2':if(_0x1bac1f)return _0x4b485e[_0x23937d(0x1971,0x18b9,0x1ddd,0xaca)](_0x1db05d,mess[_0x23937d(0x61c,0x1275,0xdaa,0xe45)]);if(_0x1e03f5)return _0x4b485e['ltAdH'](_0x1db05d,mess['banChat']);_0x1db05d(mess[_0x23937d(0x8ac,0x1024,0x20b,-0x179)]),waifudd=await axios[_0x313705(0xfa3,0x1525,0xc86,0x1bf7)](_0x313705(0xb2e,0x15ec,-0x282,0x63a)+'ifu.pics/a'+_0x23937d(0x1d8,0x3a8,-0x79b,-0x235)+'o');const _0x34443b={};_0x34443b[_0x23937d(0x13f4,0x11d2,0xf4a,0x845)+'t']='Next\x20✨';const _0x1b5df9={};_0x1b5df9[_0x23937d(0x1b0c,0x1045,0x27b2,0x2456)]='.'+_0x1354e9,_0x1b5df9[_0x23937d(0x159c,0x191d,0x1f52,0x1208)]=_0x34443b,_0x1b5df9[_0x313705(0xa9e,0x181e,0x12f1,0x509)]=0x1;var _0xfb9bc6=[_0x1b5df9];const _0x5041bd={};_0x5041bd[_0x313705(0xddf,-0xbc,0x18e0,0x1c8)]=waifudd[_0x23937d(0xe17,0x9a1,0x120f,0x1bf8)][_0x23937d(0xa79,0x377,0x193,0x35c)];const _0x459422={};_0x459422['image']=_0x5041bd,_0x459422[_0x23937d(0x968,0xc36,0xaac,0xbd2)]=''+mess[_0x23937d(0x968,0xe0d,-0x20a,0xae6)],_0x459422[_0x23937d(0x106e,0x1230,0x19c1,0x848)]=''+global[_0x23937d(0x96c,0xcdf,0x51a,0xb29)],_0x459422[_0x23937d(0xc3a,0x17d2,0x517,0x1767)]=_0xfb9bc6,_0x459422[_0x23937d(0x1b19,0x264d,0x1380,0x242e)]=0x2;let _0xf4a876=_0x459422;await _0x175756['sendMessag'+'e'](_0x5cd288[_0x23937d(0x118c,0x41e,0x1797,0x1fda)],_0xf4a876,{'quoted':_0x5cd288})['catch'](_0x2c295a=>{function _0x1c74e9(_0x147b78,_0x3654e9,_0x1760e0,_0xb337c3){return _0x313705(_0x147b78- -0x17b,_0x1760e0,_0x1760e0-0xfe,_0xb337c3-0x15d);}return _0x4b485e[_0x1c74e9(0x8f0,0x13f6,0xe40,0x8e5)];});break;case _0x23937d(0x1b31,0xf60,0x1417,0xf03):case _0x4b485e[_0x313705(0x1961,0x1fa7,0x10d8,0x1bd8)]:if(_0x1bac1f)return _0x4b485e[_0x23937d(0x1b74,0x2407,0xd13,0x1751)](_0x1db05d,mess['ban']);if(_0x1e03f5)return _0x4b485e[_0x313705(0x1b6f,0x16c3,0x17cd,0x161b)](_0x1db05d,mess[_0x23937d(0x5c0,0x294,0x215,0x10e5)]);_0x4b485e[_0x23937d(0x17b8,0xd34,0x2125,0x1906)](_0x1db05d,mess[_0x23937d(0x8ac,-0x612,0x157e,0x10a8)]);const {AnimeWallpaper:_0x4e3ed7}=require(_0x313705(0x17c4,0x18dd,0x223a,0x2389)+_0x23937d(0xc7d,0x7e9,0x128,0xd34));if(!q)return _0x4b485e[_0x23937d(0x1d9a,0x1885,0x12f5,0x1672)](_0x1db05d,_0x4b485e[_0x313705(0x18d2,0xc52,0x1182,0xde9)]);const _0x5b355d=new _0x4e3ed7(),_0x563dca=[-0x7*-0x4db+0xb61+-0x2d5d*0x1,-0x2*0x88c+-0xe74+-0xe*-0x241,0x1*-0x1db9+0x2*0xa82+-0x8*-0x117,0x16c5*-0x1+0x32*0xc8+-0x1cf*0x9],_0x276081=_0x563dca[Math['floor'](Math[_0x23937d(0x177a,0x1fc6,0x9db,0x2295)]()*_0x563dca['length'])],_0xae9997={};_0xae9997[_0x313705(0x1b3f,0x2014,0x1189,0x22be)]=q,_0xae9997[_0x23937d(0x738,0x2eb,0xc4b,0xa50)]=_0x4b485e['cxqcb'],_0xae9997[_0x313705(0x20aa,0x2e82,0x229c,0x2c38)]=_0x563dca;const _0xd0a4d3=await _0x5b355d['getAnimeWa'+'ll4'](_0xae9997)[_0x23937d(0x934,0x328,0x9ae,0x69)](()=>null),_0x5a2f45=Math['floor'](_0x4b485e[_0x313705(0x187c,0x2602,0xc96,0xc81)](Math['random'](),_0xd0a4d3[_0x23937d(0x3de,0x11f6,-0xa0,-0xa83)])),_0x2efedd={};_0x2efedd[_0x313705(0x175a,0x242d,0x84b,0xe60)+'t']='Next\x20✨';const _0xf68825={};_0xf68825[_0x23937d(0x1b0c,0x11a9,0xdb9,0x209c)]='.'+_0x1354e9+'\x20'+q,_0xf68825[_0x23937d(0x159c,0x101e,0x1f64,0x1020)]=_0x2efedd,_0xf68825[_0x313705(0xa9e,0x1734,0x863,0x63e)]=0x1;var _0x331db2=[_0xf68825];const _0x52d6c5={};_0x52d6c5[_0x23937d(0xa79,0xa4b,0xeb,0x81f)]=_0xd0a4d3[_0x5a2f45][_0x313705(0x1fa9,0x1415,0x1731,0x253c)];const _0x41ba99={};_0x41ba99[_0x313705(0x1fa9,0x211b,0x18c9,0x1a0b)]=_0x52d6c5,_0x41ba99[_0x313705(0xcce,0x1200,0x19a0,0x1738)]=_0x23937d(0x193d,0xe0e,0x27e6,0x24b2)+q,_0x41ba99[_0x23937d(0x106e,0xf06,0xf4d,0x323)]=''+global[_0x313705(0xcd2,0x71e,0x33a,0x1191)],_0x41ba99[_0x313705(0xfa0,0x9f6,0x342,0xa4c)]=_0x331db2,_0x41ba99[_0x23937d(0x1b19,0x14ae,0x105d,0x259c)]=0x4;let _0x362a0d=_0x41ba99;await _0x175756[_0x313705(0xcaa,0xa15,0x1735,0x485)+'e'](_0x5cd288[_0x23937d(0x118c,0x49d,0xf5b,0x1f45)],_0x362a0d,{'quoted':_0x5cd288})['catch'](_0x21f5a9=>{return _0x4b485e['vJiFV'];});break;case _0x4b485e[_0x313705(0x97f,0x141c,0x49,0x6b5)]:case _0x4b485e[_0x23937d(0x12a6,0x1f29,0x1563,0xa6c)]:case _0x4b485e[_0x23937d(0x12fc,0x1f99,0x472,0x7ad)]:case _0x4b485e[_0x23937d(0x1ac8,0x128c,0x2209,0xc78)]:case _0x4b485e[_0x23937d(0x889,0x481,0x11e,-0x62)]:case _0x4b485e[_0x313705(0x10c9,0xb25,0x142e,0x9d5)]:case _0x4b485e['aDSIm']:case _0x4b485e[_0x23937d(0xdfe,0xaf8,0x1bba,0xa6f)]:case _0x23937d(0xfbd,0x150,0x1cf3,0xf77):case _0x4b485e[_0x313705(0x12cf,0x118a,0x1aee,0x1131)]:case _0x4b485e[_0x313705(0x73b,0x1323,0x68c,-0x6ce)]:case _0x313705(0x2094,0x2547,0x2a7d,0x2846):case _0x4b485e[_0x313705(0x72c,0xb36,0x71b,0x810)]:case _0x23937d(0x2,0x7ba,0x27,0xb02):case _0x313705(0x20a9,0x1d89,0x2f2b,0x2af0):case _0x4b485e[_0x313705(0x1cf3,0x21d3,0x1745,0x229d)]:case _0x4b485e[_0x313705(0x5ad,0x14c2,0xe21,-0x79c)]:case _0x4b485e[_0x23937d(0x1710,0x1db7,0xa5d,0x13cf)]:case _0x23937d(0x1d5b,0x1f16,0x1c17,0x21aa):case _0x23937d(0xabf,-0x177,-0x5c,0x3cc):case _0x4b485e[_0x313705(0x1241,0xca1,0x7fd,0xf42)]:case _0x4b485e[_0x313705(0x655,0x1119,-0x5d8,0x9a4)]:case _0x4b485e[_0x23937d(0xf6d,0x94e,0x92c,0x1e4d)]:case _0x4b485e[_0x23937d(0x125a,0xeb1,0x1ccc,0x1d32)]:case _0x4b485e[_0x313705(0x1c26,0x126b,0x100d,0x20b2)]:case _0x4b485e['OZmPD']:case _0x4b485e[_0x313705(0xf9f,0x1c31,0x1d4c,0x1ce9)]:case _0x4b485e['AaaWG']:case _0x4b485e['LIulG']:if(_0x1bac1f)return _0x4b485e[_0x313705(0x5a1,-0x8c8,0x126d,-0x618)](_0x1db05d,mess[_0x313705(0x982,0x62f,-0x2a0,0xa03)]);if(_0x1e03f5)return _0x4b485e[_0x23937d(0x1d65,0x280c,0x15e2,0x2465)](_0x1db05d,mess[_0x313705(0x926,0x196,0xdf,0x1462)]);axios[_0x313705(0xfa3,0x1b8e,0x546,0x767)](_0x23937d(0x1381,0x2164,0x1408,0xa8e)+'i.waifu.pi'+_0x23937d(0xe9f,0x140f,0x65b,0xe1e)+_0x1354e9)['then'](({data:_0x414590})=>{function _0x2de63f(_0x2cf9f8,_0x58e3fc,_0x3a64aa,_0x5aeac3){return _0x23937d(_0x58e3fc-0x161,_0x3a64aa,_0x3a64aa-0x154,_0x5aeac3-0x7);}function _0x93cd74(_0x13cf24,_0x22809e,_0x9c4cdc,_0x14dd6c){return _0x313705(_0x9c4cdc- -0x13,_0x13cf24,_0x9c4cdc-0x1c3,_0x14dd6c-0x101);}if(_0x4b485e[_0x2de63f(0x130,0x581,0x1305,0x990)](_0x4b485e['tkThv'],_0x4b485e[_0x2de63f(0x4f7,0x5f5,-0x8f9,-0x48b)])){const _0x14d219={};_0x14d219['packname']=global[_0x93cd74(0x1a64,0x1274,0xb90,0x29)],_0x14d219['author']=global[_0x93cd74(0x770,0x15b1,0xa04,0x496)],_0x175756[_0x2de63f(-0x31b,0x298,0x7fc,-0xbf0)+_0x2de63f(0xeda,0x135a,0x8bc,0x11ed)](_0x5cd288[_0x93cd74(0x1e82,0xf4f,0x14df,0x160b)],_0x414590[_0x93cd74(0x119e,0x9fe,0xdcc,-0xda)],_0x5cd288,_0x14d219);}else{const _0x605833={};_0x605833['text']=''+_0x1570d6[_0x93cd74(0x406,0xb29,0x635,0xb45)];const _0x38b304={};_0x38b304[_0x2de63f(0x136d,0x73d,0x1353,0x71e)]=_0x25f935,_0xaebb32['sendMessag'+'e'](_0x38fc67['chat'],_0x605833,_0x38b304);}});break;case _0x4b485e['SMoHH']:case _0x4b485e[_0x313705(0xd74,0x16cc,0x1341,0x498)]:if(_0x1bac1f)return _0x4b485e[_0x313705(0xd94,0x11e0,0x9ac,0x13f3)](_0x1db05d,mess[_0x23937d(0x61c,-0x899,0x7b1,0xde3)]);if(_0x1e03f5)return _0x4b485e[_0x23937d(0x3c4,0x90d,0x6ef,-0x6a7)](_0x1db05d,mess[_0x23937d(0x5c0,0xa58,0x58b,0x625)]);_0x1db05d(mess[_0x23937d(0x8ac,0x1a5,0x162b,0x164d)]),axios[_0x313705(0xfa3,0x460,0x72c,0x1bc8)](_0x313705(0x16e7,0x985,0x801,0x2322)+_0x23937d(0x637,-0x496,0x219,-0x258)+_0x23937d(0x3d4,0xfb8,-0x279,0x5dc)+'fu')[_0x23937d(0x1b61,0x17ee,0x16eb,0x15a3)](({data:_0x3d2941})=>{function _0x5a3d32(_0x4537f7,_0x42e1f2,_0x192d0d,_0x55440e){return _0x313705(_0x192d0d-0x229,_0x4537f7,_0x192d0d-0x124,_0x55440e-0x28);}function _0xd5675a(_0x1d3d3c,_0x587d58,_0x2b81b5,_0x1cfdfd){return _0x313705(_0x587d58- -0x22f,_0x1d3d3c,_0x2b81b5-0x19,_0x1cfdfd-0xc3);}if(_0x4b485e[_0xd5675a(0x454,0x1278,0x6f0,0x77b)]('UbLfN',_0x4b485e[_0xd5675a(0xd41,0x483,0x8e5,0x123f)]))_0x175756[_0xd5675a(0x1f64,0x1560,0xd57,0x1e88)](_0x5cd288[_0xd5675a(0x1aa1,0x12c3,0x1347,0x1022)],_0x3d2941[_0x5a3d32(0x48b,0x17bb,0x1008,0xfe7)],mess['success'],_0x5cd288);else{const _0x97f653={};return _0x97f653['X']='❌',_0x97f653['O']='⭕',_0x97f653['1']='1️⃣',_0x97f653['2']=_0xd5675a(0x1ce7,0x1472,0x1cc4,0x11bc),_0x97f653['3']=_0x4b485e[_0xd5675a(0x1267,0xc49,0x1547,0xfb8)],_0x97f653['4']=_0xd5675a(0x370,0x57c,0x2d1,-0x95d),_0x97f653['5']=_0x4b485e[_0x5a3d32(0x111e,0x707,0xde5,0x1692)],_0x97f653['6']=_0x4b485e[_0x5a3d32(-0x5e4,0x4eb,0x680,0x2a4)],_0x97f653['7']=_0x4b485e[_0xd5675a(0x1532,0x1522,0x22b7,0xbdc)],_0x97f653['8']=_0x4b485e[_0xd5675a(0x2121,0x1324,0x158e,0x1f4b)],_0x97f653['9']=_0xd5675a(0x16dc,0x1d94,0x2419,0x24ce),_0x97f653[_0x2d1cdb];}});break;case _0x4b485e[_0x313705(0x186e,0x103a,0x222f,0x188f)]:if(_0x1bac1f)return _0x1db05d(mess['ban']);if(_0x1e03f5)return _0x4b485e[_0x23937d(0x109b,0x10b8,0x15be,0xc49)](_0x1db05d,mess[_0x23937d(0x5c0,0x765,0xdb0,0xfec)]);_0x4b485e[_0x313705(0x1525,0x237d,0xd09,0x1b22)](_0x1db05d,mess['wait']);var _0x1fea1c=[_0x4b485e[_0x313705(0x13df,0x1cf6,0x1e3e,0x1a8f)],_0x4b485e[_0x313705(0x2121,0x2ff9,0x268e,0x2f0e)],_0x4b485e['aNcik'],_0x4b485e['JVOEJ'],_0x4b485e[_0x23937d(0x25e,0x295,-0x1b9,-0x43d)]],_0x41e362=await pinterest(_0x4b485e['aKBoh'](_0xd03f49,_0x1fea1c));const _0x5c572a={};_0x5c572a['displayTex'+'t']=_0x23937d(0x11f7,0x985,0x7ac,0x1123);const _0x5170a9={};_0x5170a9[_0x313705(0x1e72,0xfbf,0x2228,0x1694)]=_0x313705(0x1bff,0x1d46,0xebd,0x1383),_0x5170a9[_0x23937d(0x159c,0x1068,0x14a9,0x17d3)]=_0x5c572a,_0x5170a9['type']=0x1;var _0x4c8d08=[_0x5170a9];const _0x4ebebb={};_0x4ebebb[_0x313705(0x942,0x26b,0x305,0x18c)]=_0x5cd288,_0x175756[_0x313705(0xcaa,0x125a,0xb0e,0x14c6)+'e'](_0x423161,{'caption':''+mess[_0x313705(0xcce,0x756,0xfd0,-0x242)],'image':{'url':_0x4b485e[_0x23937d(0x4aa,0xea5,-0x5f2,0x448)](_0xd03f49,_0x41e362[_0x313705(0x1c63,0x2a39,0x1b3e,0x12ba)])},'buttons':_0x4c8d08,'footer':''+botname},_0x4ebebb);break;case _0x4b485e[_0x313705(0x1ee8,0x1745,0x1e6e,0x1d97)]:if(_0x1bac1f)return _0x4b485e[_0x313705(0x7b0,0xa5c,0x334,-0x8d)](_0x1db05d,mess[_0x313705(0x982,0x179c,0xb20,0x6dc)]);if(_0x1e03f5)return _0x1db05d(mess[_0x313705(0x926,0xbd4,0x454,0xc23)]);_0x4b485e[_0x313705(0x1c12,0x2693,0x1a2a,0x1362)](_0x1db05d,mess[_0x313705(0xc12,0x1e1,0xe50,0x6e1)]);var _0x1fea1c=[_0x4b485e[_0x313705(0x1ee8,0x1021,0x1b87,0x2bbf)],_0x4b485e['dXwif'],_0x4b485e[_0x313705(0xf33,0x2c9,0xc4b,0xfbd)],_0x4b485e[_0x23937d(0xc42,0xa99,0x19ef,0x4e9)]],_0x41e362=await _0x4b485e[_0x23937d(0xf2f,0xb71,0x16ac,0x7d8)](pinterest,_0x4b485e['NduuR'](_0xd03f49,_0x1fea1c));const _0x4e8b11={};_0x4e8b11[_0x313705(0x175a,0x242b,0x1171,0x1ddc)+'t']=_0x4b485e[_0x23937d(0x1de9,0xfd1,0x2ac0,0x22d1)];const _0x152d21={};_0x152d21[_0x313705(0x1e72,0x2833,0x253e,0x24ac)]=''+_0x1354e9,_0x152d21['buttonText']=_0x4e8b11,_0x152d21[_0x313705(0xa9e,0x153e,0x1e7,0xb2b)]=0x1;var _0x4c8d08=[_0x152d21];const _0x159d5f={};_0x159d5f[_0x23937d(0x5dc,0xeff,0xcaa,0xc6)]=_0x5cd288,_0x175756[_0x23937d(0x944,0x19c,-0x88,0x33e)+'e'](_0x423161,{'caption':''+mess[_0x23937d(0x968,0x28f,0xe51,0x1084)],'image':{'url':_0x4b485e[_0x23937d(0x6f5,0x1428,0x1315,0x24a)](_0xd03f49,_0x41e362['result'])},'buttons':_0x4c8d08,'footer':''+botname},_0x159d5f);break;case _0x4b485e[_0x23937d(0x49f,0x72e,-0x6bc,-0x621)]:case _0x4b485e[_0x23937d(0xd06,0x1c5,0x15bc,0x1a8)]:{if(_0x4b485e[_0x313705(0xeac,0x205,0x1977,0x1099)](_0x4b485e[_0x313705(0x1bd6,0x23c5,0x2398,0x19d4)],_0x4b485e[_0x23937d(0x1870,0xe4c,0x19cf,0xc5b)])){const _0x1251fe={};_0x1251fe[_0x313705(0x209f,0x289e,0x2295,0x1721)]=''+_0x4d5efc[_0x313705(0x122f,0x54a,0x14f2,0xba4)];const _0x5a601c={};_0x5a601c[_0x313705(0x942,0x137,0x3a3,0x547)]=_0xc694f,_0x5d7e69['sendMessag'+'e'](_0x4ec13b[_0x23937d(0x118c,0xb98,0xad7,0x1218)],_0x1251fe,_0x5a601c),_0x858604=_0xd0d424[_0x23937d(0x13bd,0x14b8,0x17b2,0xf04)+'nc']('./Android/'+'AllData/st'+'icker/hear'+_0x313705(0x8e6,0x751,0x2eb,0x105c));const _0x4bbb63={};_0x4bbb63[_0x313705(0x1360,0x1f1c,0x1845,0x1602)]=_0x233cd3,_0x573d93[_0x23937d(0x944,-0xe0,0x5b6,0xb11)+'e'](_0x5361a0['chat'],_0x4bbb63);}else{if(_0x1bac1f)return _0x1db05d(mess['ban']);if(_0x1e03f5)return _0x4b485e[_0x23937d(0x5d1,0xc95,-0x2c4,-0x936)](_0x1db05d,mess[_0x23937d(0x5c0,0x12b2,0xe70,0xbbf)]);const _0x158555={};_0x158555[_0x313705(0x175a,0x15ee,0x1917,0x14f6)+'t']='Next\x20Image';const _0xb025f3={};_0xb025f3['buttonId']=_0x313705(0xa7b,0x1a6,0x13ee,0x144f),_0xb025f3[_0x313705(0x1902,0x1888,0xb4e,0x25c8)]=_0x158555,_0xb025f3[_0x313705(0xa9e,-0x168,0x169a,0x138e)]=0x1;let _0x32103c=[_0xb025f3];const _0x4186ee={};_0x4186ee[_0x23937d(0xa79,0x214,0x72b,-0x7d)]=_0x4b485e[_0x23937d(0x168b,0xc22,0x21a2,0x9a6)];const _0x53e20b={};_0x53e20b[_0x313705(0x1fa9,0x2351,0x2a09,0x195c)]=_0x4186ee,_0x53e20b['caption']=''+mess[_0x313705(0xcce,0x15e9,0x1937,0x1599)],_0x53e20b[_0x23937d(0x106e,0xd2a,0x10c2,0x691)]=''+botname,_0x53e20b['buttons']=_0x32103c,_0x53e20b['headerType']=0x4;let _0x1ebbc3=_0x53e20b;_0x175756[_0x313705(0xcaa,0x1767,0x3a,0x9f5)+'e'](_0x5cd288['chat'],_0x1ebbc3,{'quoted':_0x5cd288});}}break;case _0x4b485e[_0x23937d(0x921,0x94c,0x892,0xb18)]:{if(_0x1bac1f)return _0x4b485e[_0x313705(0xdeb,0x8f3,0x180e,0x890)](_0x1db05d,mess[_0x313705(0x982,-0x10d,-0x1fd,0x10fe)]);if(_0x1e03f5)return _0x4b485e[_0x313705(0x5ed,-0x67d,0x9e0,0xfb1)](_0x1db05d,mess[_0x313705(0x926,0xa28,0x1486,0x1163)]);if(!_0x494254)return _0x4b485e[_0x23937d(0x119b,0x1aec,0xc87,0x178c)](_0x1db05d,mess[_0x23937d(0x663,0xb6a,0x573,0x602)]);if(!_0x4b485e['YCdyy'](isUrl,_0x1ba32f[0x5*0x12b+-0x1*0x24cb+-0x1*-0x1ef4])&&!_0x1ba32f[-0x10d4*-0x2+-0x5*0x5c+-0x7f7*0x4]['includes'](_0x4b485e['FFJwO']))return _0x1db05d(_0x313705(0x15d6,0x9c7,0x800,0x185a)+_0x23937d(0xf26,0x651,0x1160,0x57f)+_0x313705(0x1e2a,0x2744,0x262b,0x15ad)+_0x23937d(0x18cb,0x1344,0x22f7,0x193f));_0x12b240=await _0x4b485e[_0x313705(0x1b1d,0x20c9,0x1af3,0xd60)](fetchJson,_0x313705(0xc2f,0x11aa,0x7d3,0xf78)+_0x23937d(0x86c,0xf50,0x57f,0xd17)+_0x313705(0x1485,0xbfa,0xb49,0x1784)+_0x313705(0x136b,0x21af,0x47b,0x1fc4)+_0x23937d(0x19f6,0x1527,0x19d6,0x1a96)+_0x313705(0x8cb,0x1628,-0x5f8,0xc2c)+_0x23937d(0xbd1,0x1a47,0x12f3,0x235)+_0x313705(0x1c13,0x1e7e,0x1123,0x228b)+_0x494254),_0x5cd288['reply']('*'+util[_0x23937d(0x1806,0x158e,0x23af,0x1981)](_0x12b240)+'*'),linkyke=await _0x4b485e[_0x23937d(0x170c,0x1248,0x1260,0x19fc)](getBuffer,_0x12b240[_0x23937d(0x18fd,0x2267,0x2732,0xdf9)][_0x313705(0xecb,0x119e,0xa34,0x5f7)]);const _0x5bc613={};_0x5bc613[_0x23937d(0xc0e,0x798,0x49,0xc58)]=linkyke,_0x5bc613[_0x313705(0x1610,0xa21,0x11ec,0x1243)]=_0x4b485e['rIeQK'],_0x5bc613['fileName']=''+_0x12b240[_0x313705(0x1c63,0xda1,0x15d3,0x1456)][_0x313705(0x1712,0x1a88,0x1642,0x24be)],_0x175756[_0x23937d(0x944,0x35b,0x1461,0x14f9)+'e'](_0x5cd288['chat'],_0x5bc613,{'quoted':_0x5cd288})[_0x313705(0xc9a,0x176f,0x15,0x1851)](_0x366d7f=>_0x1db05d(mess['error']));}break;case _0x23937d(0xb09,0x1205,0x17da,-0xa7):{if(_0x1bac1f)return _0x4b485e[_0x313705(0x1a78,0x1529,0x182a,0x27c7)](_0x1db05d,mess[_0x23937d(0x61c,0x13ad,-0x36c,0x91)]);if(_0x1e03f5)return _0x4b485e['EHqBF'](_0x1db05d,mess['banChat']);if(!_0x494254)return _0x5cd288[_0x313705(0x9a1,0x139d,0xba8,0x17ce)](_0x313705(0x19f3,0x116f,0x206b,0x2652)+'download\x20m'+'edia\x20and\x20s'+_0x313705(0x166a,0xca8,0x1313,0x1023)+(_0xe1d953+_0x1354e9)+'\x20url\x20link');if(!_0x4b485e[_0x313705(0x1158,0xff1,0x1129,0x644)](isUrl,_0x1ba32f[-0xa9*0x29+-0x1b6e+0x367f])&&!_0x1ba32f[0x6da*0x4+-0x7d6+-0x1392][_0x313705(0x4de,0xde0,0x543,-0x308)](_0x313705(0x189c,0xaaf,0x1c83,0x2167)+'om'))return _0x1db05d(_0x23937d(0x18a0,0x2139,0x13f1,0x15d4)+'ou\x20provide'+_0x23937d(0xc5d,0x1860,0x590,0x1018)+'id');let _0x5558a7=_0x4b485e['NpPqs'](require,_0x4b485e[_0x313705(0x1023,0x17be,0x1537,0xb50)]);_0x5558a7['savefrom'](''+_0x494254)[_0x313705(0x1ec7,0x28c3,0x1259,0x2734)](async _0x1ac056=>{function _0x208049(_0x21f02a,_0x175c8c,_0x229699,_0x2645bc){return _0x313705(_0x2645bc- -0x47,_0x175c8c,_0x229699-0x49,_0x2645bc-0x39);}function _0x4498e7(_0x56bafc,_0x3adebc,_0x3acd8e,_0xef5595){return _0x313705(_0x56bafc-0x1ec,_0xef5595,_0x3acd8e-0x17c,_0xef5595-0x1a7);}if(_0x4b485e[_0x208049(0x21ec,0x18fe,0x10ab,0x1e3d)](_0x4b485e[_0x208049(0x11a2,0x19c4,0x1c35,0x1636)],_0x208049(0x1342,0x15ce,0x248a,0x1b22))){let _0x2bb8f7=[];for(let _0x666bc2 of _0x1ac056[_0x4498e7(0xfcb,0xb62,0xef1,0x1837)]){const _0x350bcd={};_0x350bcd[_0x208049(0x26b9,0x1056,0x1e35,0x1af8)]=''+_0x666bc2[_0x4498e7(0xc8a,0x238,-0x89,0xf8d)],_0x350bcd['rows']=[{'title':_0x208049(0x955,-0x550,-0x76f,0x341)+_0x666bc2[_0x208049(0xefd,0x9c7,0x1160,0xb44)],'rowId':_0xe1d953+_0x4498e7(0x5e7,0x132f,0x13e2,0x225)+_0x494254,'description':''+_0x1ac056[_0x208049(0xef2,0x1815,0x1c74,0xe52)]}];const _0x4c68e3=_0x350bcd;_0x2bb8f7[_0x4498e7(0x130e,0x1e65,0x1d95,0x525)](_0x4c68e3);}const _0x2b47ae={};_0x2b47ae[_0x208049(0x28ec,0x1df6,0x21aa,0x2058)]=_0x1ac056[_0x208049(0xe5a,0x2223,0x1a2a,0x1c4d)]['title']+(_0x4498e7(0x11f6,0x13b7,0x1873,0x1fb1)+_0x208049(0x2452,0x1901,0x24ac,0x1afa)+'f\x20videos,\x20'+_0x208049(0x149e,0x26cc,0x2aa4,0x1bc1)+_0x4498e7(0x21b8,0x1601,0x1bfa,0x2eae)+_0x4498e7(0x1f3e,0x1fac,0x1417,0x1523)+_0x4498e7(0xf93,0xa16,0x193,0xa14)),_0x2b47ae[_0x4498e7(0x15c0,0x1f28,0x203e,0x1a31)]=''+botname,_0x2b47ae[_0x4498e7(0x1d2b,0x1433,0x2970,0x1403)]=_0x4b485e[_0x208049(0x1482,0xd66,0x783,0xcbf)],_0x2b47ae[_0x4498e7(0x1aee,0xcff,0x2008,0x1412)]=_0x4b485e['jWAzi'],_0x2b47ae[_0x4498e7(0x1d49,0x2102,0x20b6,0xe3d)]=_0x2bb8f7;const _0x4c6ec4=_0x175756['sendMessag'+'e'](_0x5cd288[_0x208049(0xcae,0x1260,0x7f1,0x14ab)],_0x2b47ae,{'quoted':_0x5cd288});}else{if(_0x553940)return _0x4b485e['UYBKc'](_0x3a0495,_0x90affc[_0x4498e7(0xb6e,0x70c,0x927,0x12dd)]);if(_0x51d0b5)return _0x4b485e[_0x208049(-0x240,-0x147,0x1a54,0xc7c)](_0x2881d5,_0x43e162[_0x4498e7(0xb12,0x5b,0xbc4,0x1837)]);let _0x50bea3=_0x217a54[_0x208049(0x41,0x1384,0xca7,0x7a8)](_0x4577ce[_0x4498e7(0x190f,0xd59,0x27dc,0x229b)+'nc'](_0x4b485e[_0x4498e7(0x11f2,0x404,0x694,0x1a27)])),_0x5da6c1=_0x3a36da['entries'](_0x5de40f['db'][_0x4498e7(0x1369,0x1113,0xbbc,0x74d)][_0x208049(0x1474,0x1855,0x102e,0xa68)])['map'](([_0x27aa88,_0xa319c0])=>{const _0xde7adc={'nama':_0x27aa88,..._0xa319c0};return _0xde7adc;}),_0x540738=_0x4b485e[_0x208049(0x51b,0xcda,0x19b0,0x13ea)];for(let _0x379279 of _0x5da6c1){_0x540738+=_0x19062a+_0x208049(-0x60d,-0x310,0x282,0x6b4)+_0x379279[_0x208049(0xd5c,0x1a2f,0x1b2,0x1089)]+'\x0a'+_0x4d53e0+_0x4498e7(0x1108,0x98e,0x16ad,0x73f)+_0x4b485e[_0x4498e7(0xe3a,0xd93,0x1282,0x263)](_0x170bd5,_0x379279[_0x4498e7(0x1336,0x16b6,0x1370,0xcbf)])[_0x208049(0x1685,0x2774,0x1589,0x1b91)](/Message/i,'')+(_0x4498e7(0x2217,0x1b4f,0x2859,0x2e55)+'──────────'+'─────\x0a\x0a');}_0x4b485e[_0x208049(0x259e,0x1039,0x1121,0x16b8)](_0xa774cd,_0x540738);}})['catch'](_0x4c9413=>{function _0x3c42f7(_0x8b622b,_0x2bac5b,_0x58e5f7,_0x272c7d){return _0x23937d(_0x58e5f7- -0x5e,_0x272c7d,_0x58e5f7-0x84,_0x272c7d-0x11b);}function _0x4f5e27(_0x47f9b1,_0x43ff3f,_0x21bc39,_0x38ddfc){return _0x23937d(_0x38ddfc-0x599,_0x43ff3f,_0x21bc39-0x165,_0x38ddfc-0x16e);}if(_0x4b485e['RvfTz'](_0x4b485e['bcjJP'],_0x4b485e[_0x3c42f7(-0x711,0xee6,0xfa,0x4a4)])){const _0x363f40={};_0x363f40[_0x3c42f7(0x1756,0x1e45,0x1cdb,0x28e4)]=''+_0x4df240['K16'];const _0x135fd1={};_0x135fd1[_0x4f5e27(-0x264,0x95f,0xbcd,0xb75)]=_0x543f41,_0x322958['sendMessag'+'e'](_0xa4834c[_0x3c42f7(0x1074,0x216,0x112e,0x48f)],_0x363f40,_0x135fd1),_0x1d7d15=_0x684794['readFileSy'+'nc'](_0x4f5e27(0x1706,0x1e02,0x84a,0x10b4)+'AllData/st'+_0x3c42f7(0xf0c,0x1795,0x16fe,0x1cb4)+_0x4f5e27(0x122b,-0x8c,0x16a4,0xc50));const _0x412029={};_0x412029[_0x3c42f7(0x443,0xb60,0xf9c,0x542)]=_0x2cf314,_0x3d5c6f['sendMessag'+'e'](_0x32dd0c['chat'],_0x412029);}else _0x4b485e[_0x4f5e27(0x25c5,0x13fb,0x181a,0x1aa9)](_0x1db05d,mess[_0x4f5e27(0x30f8,0x2b2b,0x2550,0x2349)]);});}break;case _0x4b485e[_0x313705(0x4e2,-0x942,0xb61,0xefd)]:case _0x313705(0x1e3d,0x23a2,0x1d8c,0x1c25):case _0x4b485e[_0x23937d(0xf45,0x535,0x1cca,0x4b8)]:case _0x313705(0x1283,0x135e,0x2132,0xde6)+'h':case _0x4b485e[_0x23937d(0xa2a,0x39e,0x59b,0x1511)]:case _0x313705(0x86e,0x78d,0x106d,0x98b):case _0x4b485e['lwQSG']:case _0x4b485e['ULAwg']:case _0x4b485e[_0x23937d(0x112c,0x1d0a,0x836,0x123c)]:case _0x4b485e['LBXNP']:{if(_0x1bac1f)return _0x4b485e[_0x313705(0xc88,0xb89,0x14c0,-0x24f)](_0x1db05d,mess[_0x313705(0x982,0xe7c,0x557,0x168c)]);if(_0x1e03f5)return _0x4b485e['gjDkG'](_0x1db05d,mess[_0x313705(0x926,-0x567,0x55d,0x615)]);if(!/image/[_0x23937d(0x190e,0x1896,0x2394,0x1e5c)](_0x2a2351))return _0x4b485e[_0x313705(0x1535,0x1bc0,0x15c6,0x10c4)](_0x1db05d,'*Send/Repl'+'y\x20Image\x20Wi'+_0x313705(0x1820,0x1efe,0x1197,0xd76)+'*\x20'+_0x4b485e['xQSCz'](_0xe1d953,_0x1354e9));let {UploadFileUgu:_0x4db311,webp2mp4File:_0x4e5497,TelegraPh:_0x388979}=require(_0x23937d(0x8e5,0x161e,0x663,0x23a)+'ader2'),_0x55a8d8=await _0x175756[_0x23937d(0xdcf,0xcd8,0x1480,0x619)+'dSaveMedia'+_0x313705(0x117a,0x1e8b,0x13f2,0x523)](_0x3e5ec4),_0x2e693c=await _0x4b485e[_0x313705(0x10e1,0x130e,0x123a,0x18eb)](_0x388979,_0x55a8d8),_0x315efa=await getBuffer(_0x23937d(0x1520,0x74a,0x15cf,0x1433)+_0x313705(0xcda,0xff7,0x134c,0x1215)+_0x313705(0x11d1,0x52e,0x1b32,0x1c60)+_0x313705(0x1591,0xd93,0x1646,0x14d5)+_0x1354e9+'?url='+_0x2e693c);const _0x165bc9={};_0x165bc9[_0x23937d(0x1c43,0x1ed9,0xddf,0x2893)]=_0x315efa,_0x165bc9['caption']=''+mess[_0x313705(0xcce,-0x1d8,0x558,0x16b3)],_0x175756[_0x23937d(0x944,0xc85,0x600,0x22d)+'e'](_0x5cd288[_0x313705(0x14f2,0x1ef2,0x213a,0x165b)],_0x165bc9,{'quoted':_0x5cd288})[_0x23937d(0x934,0xa95,0xeaf,0x12da)](_0x332d7c=>_0x1db05d(mess[_0x23937d(0x1db0,0x1df2,0x2483,0x1c44)]));}break;case _0x4b485e[_0x313705(0x19d9,0x16b0,0xbd4,0xb4f)]:{if(_0x4b485e['SLiWR'](_0x4b485e[_0x313705(0xc75,0x344,0x1af5,0x15ea)],_0x23937d(0x334,0x9e8,-0xb3e,-0x855))){if(_0x1bac1f)return _0x4b485e[_0x313705(0xad4,0x1441,0xc24,0x1736)](_0x1db05d,mess[_0x313705(0x982,0xf66,0x992,-0x14e)]);if(_0x1e03f5)return _0x4b485e[_0x313705(0xe5b,0x1709,0x1baa,0x14b2)](_0x1db05d,mess[_0x313705(0x926,0x1155,0x11de,0x4c1)]);if(!/image/[_0x313705(0x1c74,0x28c2,0xffc,0x1ff1)](_0x2a2351))return _0x4b485e[_0x23937d(0x1826,0xcbb,0xaca,0x2710)](_0x1db05d,_0x313705(0x1e44,0xf9f,0x13d0,0x2248)+_0x313705(0x94c,0xa47,0xb7b,0xd47)+_0x23937d(0x14ba,0xbf0,0x2132,0x61b)+'*\x20'+_0x4b485e[_0x313705(0x11ec,0x175e,0xe34,0x1112)](_0xe1d953,_0x1354e9));let {UploadFileUgu:_0x10cc69,webp2mp4File:_0x241e98,TelegraPh:_0x48647f}=_0x4b485e[_0x23937d(0x1817,0xba2,0x12ea,0xbf7)](require,_0x4b485e['AMeBy']),_0xc58dbc=await _0x175756[_0x23937d(0xdcf,0x43c,0x2f,0xe3a)+'dSaveMedia'+'Message'](_0x3e5ec4),_0xdb2791=await _0x48647f(_0xc58dbc),_0x14303b=await _0x4b485e[_0x23937d(0x170c,0x17e9,0x18b2,0x8bb)](getBuffer,_0x313705(0x1886,0xe11,0x1ff4,0xa8a)+'lilitan.he'+'rokuapp.co'+_0x313705(0x675,0x643,0x8a2,0x1167)+_0x313705(0x11b3,0x1a65,0x78c,0xb31)+_0xdb2791);const _0x5651d4={};_0x5651d4[_0x23937d(0x1c43,0xdbb,0x2740,0x1bd6)]=_0x14303b,_0x5651d4[_0x23937d(0x968,0x13b6,0x41c,0x5d4)]=''+mess[_0x23937d(0x968,-0x28b,0x998,0x15ec)],_0x175756['sendMessag'+'e'](_0x5cd288[_0x23937d(0x118c,0x1dc1,0x1ec3,0x964)],_0x5651d4,{'quoted':_0x5cd288})['catch'](_0x2aa7d7=>_0x1db05d(mess['error']));}else _0x2f6879[_0x313705(0x1122,0x8d6,0x721,0x60f)](_0x202fbc['id'][_0x23937d(0x1872,0x1595,0x160f,0x13e2)]('c.us',_0x4b485e['FfQlc']));}break;case'deleteeffe'+'ct':{if(_0x1bac1f)return _0x4b485e['obiLn'](_0x1db05d,mess[_0x23937d(0x61c,0x10ee,0xd14,-0x418)]);if(_0x1e03f5)return _0x4b485e['WOvoc'](_0x1db05d,mess[_0x313705(0x926,0x1262,-0x398,0x651)]);if(!/image/[_0x313705(0x1c74,0x1644,0x29af,0x2254)](_0x2a2351))return _0x4b485e[_0x23937d(0x6cf,0x2e2,0x4ff,0x6a6)](_0x1db05d,_0x313705(0x1e44,0x1cdc,0x1c24,0x237c)+_0x313705(0x94c,0xce5,0x11a9,0xed4)+'th\x20Caption'+'*\x20'+_0x4b485e[_0x23937d(0x97d,0xd6,0x7b7,-0x51e)](_0xe1d953,_0x1354e9));let {UploadFileUgu:_0xc55ca6,webp2mp4File:_0x2b6ed7,TelegraPh:_0x4b93a8}=require(_0x4b485e['AMeBy']),_0x2eb532=await _0x175756['downloadAn'+_0x23937d(0xe48,0x36a,0x7fa,0x1621)+_0x313705(0x117a,0x179e,0x50c,0x1106)](_0x3e5ec4),_0x5a828c=await _0x4b93a8(_0x2eb532),_0x54fc90=await getBuffer(_0x313705(0x1886,0x20a7,0xc05,0x266c)+_0x23937d(0x974,0x142,-0x546,0x84e)+_0x23937d(0xe6b,0x11fd,0xd09,0x123)+'m/api/dele'+'te?url='+_0x5a828c);const _0x5b4191={};_0x5b4191[_0x23937d(0x1c43,0x2abf,0x11b6,0x17cf)]=_0x54fc90,_0x5b4191[_0x313705(0xcce,0x10e6,0x1b02,0x1193)]=''+mess['caption'],_0x175756[_0x313705(0xcaa,0x11ef,0xbc0,0x3ac)+'e'](_0x5cd288[_0x23937d(0x118c,0x1844,0x8de,0xe83)],_0x5b4191,{'quoted':_0x5cd288})[_0x23937d(0x934,0x890,0xcaa,-0x307)](_0x510c8f=>_0x1db05d(mess['error']));}break;case _0x4b485e[_0x313705(0x182b,0xde2,0xae7,0x1e47)]:{if(_0x1bac1f)return _0x4b485e[_0x23937d(0x1459,0x2053,0x6d3,0x1808)](_0x1db05d,mess[_0x313705(0x982,0x10cb,0x200,-0x14f)]);if(_0x1e03f5)return _0x1db05d(mess[_0x23937d(0x5c0,0x10c0,0x1e6,0x996)]);if(!/image/['test'](_0x2a2351))return _0x4b485e[_0x23937d(0x120d,0x169f,0x1eaf,0xf63)](_0x1db05d,_0x23937d(0x1ade,0x240a,0x202d,0x149b)+_0x23937d(0x5e6,-0x151,-0x3ab,-0x528)+_0x23937d(0x14ba,0x1172,0x13e2,0x1ce0)+'*\x20'+_0x4b485e[_0x313705(0x3f4,-0x58d,-0x24f,0x100)](_0xe1d953,_0x1354e9));let {UploadFileUgu:_0x532a12,webp2mp4File:_0x16ea8e,TelegraPh:_0x40796a}=_0x4b485e[_0x313705(0x1327,0x1e59,0x813,0x7b4)](require,_0x4b485e[_0x313705(0x1392,0x98e,0xba3,0x1e12)]),_0x132808=await _0x175756[_0x313705(0x1135,0x523,0x1ab6,0x1e94)+_0x313705(0x11ae,0x7ef,0x453,0x18a7)+_0x23937d(0xe14,0x855,0x1820,0x11c7)](_0x3e5ec4),_0x4acbdd=await _0x4b485e['gEDEv'](_0x40796a,_0x132808),_0x383f4f=await _0x4b485e[_0x23937d(0x11b9,0x682,0x984,0x1d64)](getBuffer,_0x23937d(0x1520,0x146d,0x1c87,0x151e)+_0x23937d(0x974,0xb9f,0xe8b,0xc81)+_0x23937d(0xe6b,0x13dc,0x56a,0x1866)+_0x313705(0x75e,0x70c,0x1381,-0x1f6)+_0x313705(0x1df7,0x1daf,0x1177,0x2992)+_0x4acbdd);const _0x21eb9e={};_0x21eb9e[_0x313705(0x1fa9,0x20b9,0x1d84,0x1fe7)]=_0x383f4f,_0x21eb9e['caption']=''+mess['caption'],_0x175756['sendMessag'+'e'](_0x5cd288[_0x23937d(0x118c,0x9b8,0x1b9d,0x71d)],_0x21eb9e,{'quoted':_0x5cd288})[_0x23937d(0x934,0x1777,-0x4e2,0x10e3)](_0x57cde3=>_0x1db05d(mess[_0x23937d(0x1db0,0x25c6,0x1275,0x2505)]));}break;case _0x4b485e[_0x313705(0x1297,0x1777,0x1d59,0x1b96)]:{if(_0x1bac1f)return _0x1db05d(mess['ban']);if(_0x1e03f5)return _0x4b485e[_0x23937d(0x1ad6,0x147a,0x1f11,0xfde)](_0x1db05d,mess[_0x313705(0x926,0x10ad,0x5d0,0xe33)]);if(!/image/[_0x313705(0x1c74,0x13bc,0xf08,0x1af1)](_0x2a2351))return _0x4b485e[_0x23937d(0x8d8,-0x10c,0x126e,0x1428)](_0x1db05d,'*Send/Repl'+_0x23937d(0x5e6,-0x773,0x10c5,-0x814)+'th\x20Caption'+'*\x20'+_0x4b485e['xQSCz'](_0xe1d953,_0x1354e9));let {UploadFileUgu:_0x260849,webp2mp4File:_0x5616a3,TelegraPh:_0x35e960}=_0x4b485e['kwpIN'](require,_0x4b485e[_0x313705(0x1392,0x1b93,0xf86,0x10f7)]),_0x835720=await _0x175756[_0x23937d(0xdcf,0x637,0x1baa,0x1c0d)+_0x313705(0x11ae,0x16bd,0x1bf2,0x1a23)+_0x313705(0x117a,0x1dc5,0xa96,0x295)](_0x3e5ec4),_0x1bbae0=await _0x4b485e['NLscf'](_0x35e960,_0x835720),_0x10d798=await getBuffer(_0x23937d(0x1520,0xba6,0x1c5c,0x2281)+_0x313705(0xcda,0x1a22,0xe3d,0x6b8)+_0x23937d(0xe6b,0xff2,0xdf5,0x14ae)+'m/api/beau'+_0x313705(0x1f86,0x2e21,0x2d31,0x1cff)+_0x1bbae0);const _0x273ed3={};_0x273ed3['image']=_0x10d798,_0x273ed3['caption']=''+mess['caption'],_0x175756[_0x23937d(0x944,0x1401,0x1b1,0x16a)+'e'](_0x5cd288[_0x23937d(0x118c,0x1ce2,0x16fc,0x285)],_0x273ed3,{'quoted':_0x5cd288})['catch'](_0x57704a=>_0x1db05d(mess[_0x313705(0x2116,0x1543,0x23ab,0x24d2)]));}break;case _0x4b485e[_0x313705(0xea7,0x308,0x2ee,0x13e)]:{if(_0x4b485e[_0x313705(0x16e6,0x168d,0x1c3a,0x2426)]===_0x23937d(0xb48,0x13ce,0x87a,0xfe5)){const _0x35987c={};_0x35987c['text']=''+_0x3ed407[_0x23937d(0x8ec,0x1669,0x1490,0xc75)];const _0x282c70={};_0x282c70[_0x23937d(0x5dc,0x9da,0x902,0xfa1)]=_0x559051,_0x40e00b[_0x313705(0xcaa,0x14c4,0xbbc,0xafa)+'e'](_0xbd055e[_0x313705(0x14f2,0x1a02,0x2279,0x1936)],_0x35987c,_0x282c70);}else{if(_0x1bac1f)return _0x4b485e[_0x313705(0xb7f,0xde6,0x1182,-0x25f)](_0x1db05d,mess[_0x313705(0x982,0x337,0x12d2,0x641)]);if(_0x1e03f5)return _0x4b485e[_0x313705(0x1dee,0x220b,0x1cbf,0x23fe)](_0x1db05d,mess['banChat']);if(!_0x494254)return _0x4b485e[_0x313705(0x7ee,0x1117,0xcb1,0x1032)](_0x1db05d,_0x313705(0x110b,0x17e6,0x1a50,0x9db)+_0x4b485e[_0x23937d(0x12d0,0x5a6,0x1afc,0x1dd9)](_0xe1d953,_0x1354e9)+_0x23937d(0x1caf,0x1e43,0x1cdc,0x2069));_0x12b240=await _0x4b485e[_0x313705(0x3b7,0xa5c,0xfe,-0xace)](fetchJson,_0x313705(0x1886,0x1e1d,0x1d93,0x1eea)+_0x23937d(0x974,0x12dd,0x15bd,-0x50)+_0x23937d(0xe6b,0xd95,0x186,0x984)+'m/api/read'+_0x23937d(0xa53,-0x30d,0xc30,0x188f)+_0x494254),_0x4b485e[_0x313705(0xd54,0xf67,0x10f1,0x19ab)](_0x1db05d,''+_0x12b240[_0x313705(0x1c63,0x214e,0x21e5,0xd9a)]);}}break;case _0x4b485e[_0x313705(0xa12,-0x37a,0x499,-0x227)]:case _0x4b485e[_0x23937d(0x931,0x182d,0x1bc,0xfdf)]:{if(_0x1bac1f)return _0x1db05d(mess[_0x313705(0x982,0xc8,0x6f9,0x1289)]);if(_0x1e03f5)return _0x4b485e[_0x23937d(0x163c,0x15f7,0x204d,0x1cc3)](_0x1db05d,mess[_0x23937d(0x5c0,-0x618,0x3e5,-0x564)]);if(!_0x3e5ec4)return _0x4b485e[_0x313705(0x11c7,0xf8c,0x341,0xe4a)](_0x1db05d,_0x23937d(0x360,0xa73,0x977,-0xa24)+'e');if(/image/[_0x23937d(0x190e,0x156e,0x17ed,0x1066)](_0x2a2351)){if(_0x4b485e['ohrKB'](_0x313705(0xde8,0xbb1,0x64e,0xcc5),_0x4b485e[_0x313705(0x12a3,0x1737,0x139b,0xe9c)])){_0x12b240=await _0x175756[_0x23937d(0xdcf,0x1c8,0x1b98,0x16aa)+_0x313705(0x11ae,0x7cf,0x109e,0xec2)+_0x23937d(0xe14,0x1639,0x13f9,0x190a)](_0x3e5ec4);const _0x407621={};_0x407621[_0x313705(0xddf,0x1063,0x14d9,0xe6d)]=_0x12b240;const _0x183279={};_0x183279[_0x23937d(0x1c43,0x1b75,0x27c3,0x27de)]=_0x407621,_0x183279[_0x23937d(0x1031,0x8d8,0x1323,0x21a)]=!![],_0x175756[_0x23937d(0x944,0xd6,0x1373,0x6ff)+'e'](_0x5cd288[_0x313705(0x14f2,0x2266,0xf12,0x16de)],_0x183279,{'quoted':_0x5cd288});}else _0x4b485e['YQfAP'](_0x4bd0e0,_0x29301a['sender']);}else{if(/video/['test'](_0x2a2351)){if(_0x4b485e[_0x313705(0x1c91,0x13c9,0x2305,0x14a2)](_0x4b485e[_0x23937d(0x928,0x5d6,0x1242,0xdeb)],_0x4b485e['uKKTk'])){_0x12b240=await _0x175756['downloadAn'+_0x23937d(0xe48,0x15d3,0xd48,0x24c)+_0x23937d(0xe14,0x56a,0x885,0x5cd)](_0x3e5ec4);const _0x55acf1={};_0x55acf1['url']=_0x12b240;const _0x2cf7f3={};_0x2cf7f3['video']=_0x55acf1,_0x2cf7f3[_0x23937d(0x1031,0x171b,0xb21,0xe1c)]=!![],_0x175756[_0x23937d(0x944,0x139d,0x455,0xd17)+'e'](_0x5cd288['chat'],_0x2cf7f3,{'quoted':_0x5cd288});}else _0x6e6f23[_0x23937d(0xdbc,0x1ac4,0x1527,0x124a)](_0x20c8ca['id']['replace'](_0x4b485e[_0x23937d(0x13bc,0xc57,0x4e1,0x137f)],'s.whatsapp'+_0x23937d(0x17c6,0x1547,0xcfc,0x1953)));}}}break;case _0x23937d(0x134f,0x484,0xddd,0xf22):{if(_0x4b485e['ZywuT']===_0x4b485e['ZywuT']){if(_0x1bac1f)return _0x4b485e[_0x313705(0xb7f,0x136f,0x7b3,0xaff)](_0x1db05d,mess[_0x313705(0x982,0x1499,0x1001,0x1ab)]);if(_0x1e03f5)return _0x4b485e[_0x23937d(0x1029,0x1392,0x13cf,0xa03)](_0x1db05d,mess[_0x23937d(0x5c0,-0x828,-0x169,-0x829)]);_0x4b485e[_0x23937d(0x1114,0xbac,0xa95,0x1fa1)](_0x1db05d,mess['wait']);try{_0x12b240=await axios['get'](_0x313705(0x5c6,-0x62b,-0x820,0x1246)+_0x313705(0x10b7,0x1cff,0xd7b,0x1e37)+'api-create'+_0x313705(0x1481,0xa18,0x16d2,0xecf)+q),_0x1db05d(_0x12b240['data']+'\x20'+mess[_0x313705(0xcce,0xf54,0x16c,0x1733)]);}catch(_0x5ab9de){emror=_0x4b485e[_0x23937d(0x18ee,0x1524,0x145c,0xa8c)](String,_0x5ab9de),_0x4b485e[_0x313705(0xd63,0x15c4,0x1155,0x1624)](_0x1db05d,''+_0x5ab9de);}}else{const _0x34ee80={};_0x34ee80['text']='🥲',_0x34ee80[_0x23937d(0x94f,-0xc0,-0x80,0x524)]=_0x362830[_0x313705(0xcb5,-0x6a,0x1530,-0xd2)];const _0x1d2af8={};_0x1d2af8[_0x23937d(0x19ba,0x1259,0xcb9,0x10d5)]=_0x34ee80,_0x58dd55[_0x313705(0xcaa,0x19c0,0x437,0xd37)+'e'](_0x228f3b,_0x1d2af8);const _0x4a4c3e={};_0x4a4c3e['text']=''+_0x3645e8['K95'];const _0x32cb8b={};_0x32cb8b[_0x313705(0x942,0x1486,0xd8d,0x1598)]=_0x33b3dc,_0x55aae4[_0x313705(0xcaa,0x6c7,0xeaa,0xb60)+'e'](_0x32850d[_0x313705(0x14f2,0x2382,0x16e8,0x66c)],_0x4a4c3e,_0x32cb8b),_0x44c3d3=_0x166ca1[_0x313705(0x1723,0x198d,0x1478,0x1795)+'nc'](_0x313705(0xe81,0x15f5,0x12ab,0x9ea)+_0x313705(0x1979,0x1d2a,0x13ac,0x154a)+_0x313705(0x1732,0x823,0x913,0x18e5)+_0x23937d(0x2ae,-0x640,0x589,0xafe));const _0x5338b5={};_0x5338b5[_0x313705(0x1360,0x15d3,0x6f0,0xc91)]=_0x2f5519,_0x4d6f0b[_0x23937d(0x944,0xda9,0x579,0xf91)+'e'](_0x49a63b[_0x313705(0x14f2,0x1ce2,0x697,0x1f18)],_0x5338b5);}}break;case _0x4b485e[_0x313705(0x1f3c,0x2a76,0x2670,0x2d9a)]:{const _0x1c8b9b=(_0x23937d(0xcf8,0x1833,0x821,0x1a3)+'4')[_0x23937d(0xccf,0x19d9,0x1baf,0x9f7)]('|');let _0x1cb9bf=0x4*0x2ce+-0xcda+-0x26*-0xb;while(!![]){switch(_0x1c8b9b[_0x1cb9bf++]){case'0':quere=_0x1ba32f['join']('\x20');continue;case'1':flipe=quere[_0x313705(0x1035,0x14d5,0x754,0x14d0)]('')[_0x313705(0xefc,0xe2e,0x813,0xf57)]()[_0x313705(0x1f7c,0x2a66,0x2193,0x1338)]('');continue;case'2':if(_0x4b485e[_0x23937d(0x875,0x290,0xd20,0x1478)](_0x1ba32f[_0x313705(0x744,0x54c,0xeb5,0x8dc)],-0x8*-0x193+0x18ea+-0x2581))return _0x516d85(_0x313705(0x12a9,0x1947,0xbad,0x1fc4)+_0xe1d953+'fliptext\x20'+ownername);continue;case'3':if(_0x1bac1f)return _0x1db05d(mess[_0x313705(0x982,0x552,0x1e4,0xc1d)]);continue;case'4':_0x4b485e[_0x23937d(0xe7,-0xba0,0xed1,-0x7a2)](_0x516d85,'```🧩\x20FLIP\x20'+_0x23937d(0xd5b,0x107a,0x19ca,0x6e8)+_0x23937d(0x2aa,-0x31c,0x73a,-0x3f4)+_0x23937d(0x1662,0x1116,0x1917,0xc2f)+quere+(_0x313705(0xf5c,0x13fc,0x1d0d,0x617)+_0x313705(0x1ec9,0x18de,0x23d2,0x21ff))+flipe);continue;case'5':if(_0x1e03f5)return _0x4b485e['GVCDo'](_0x1db05d,mess[_0x23937d(0x5c0,-0x26a,0x145,0x7a0)]);continue;}break;}}break;case _0x4b485e[_0x23937d(0x789,0x12d3,0x11e6,0x122)]:{if(_0x1bac1f)return _0x1db05d(mess[_0x313705(0x982,0x1064,0x7fe,0x10f6)]);if(_0x1e03f5)return _0x1db05d(mess['banChat']);if(!_0x4b485e['qwzdq'](Number,_0x1ba32f[0x1*-0x37f+0x88*-0x47+0x2937]))return _0x4b485e[_0x23937d(0x6eb,0x14e8,0xee2,-0x41)](_0x516d85,_0x23937d(0xf43,0x1159,0x1148,0x10e7)+_0xe1d953+('toletter\x209'+'56'));try{if(_0x4b485e[_0x313705(0x135a,0x1842,0xf9e,0x16f0)](_0x4b485e[_0x313705(0x11e9,0x169a,0xf69,0x1a1b)],_0x4b485e[_0x23937d(0xe83,0x7e4,0x1c72,0x1a71)]))quere=_0x1ba32f[_0x313705(0x1f7c,0x2dfd,0x15e8,0x271e)]('\x20'),convertes=await _0x4b485e[_0x23937d(0x16f4,0xfcd,0x1aa0,0x1278)](toHur,quere),_0x4b485e['MoMKp'](_0x516d85,_0x23937d(0x1008,0x1ece,0x120e,0x1b9)+_0x23937d(0x51b,0xf77,0xa20,0x684)+_0x313705(0x1249,0x13b8,0x1527,0x1d0c)+_0x313705(0x1ec9,0x28ac,0x2305,0x16dc)+quere+('\x0a*•>\x20Alpha'+_0x313705(0x187b,0x1387,0x1998,0x213b))+convertes);else{if(this[_0x313705(0x826,0x720,0xbfe,0xb9c)])delete this[_0x23937d(0x4c0,0xc8b,-0x1c1,0xd02)],_0xc899a7['sendText'](_0xe6d5d3[_0x23937d(0x118c,0x12b8,0x1679,0xffc)],_0x313705(0x17d7,0x1fa0,0xe47,0xaec)+'ly\x20Deleted'+_0x313705(0x532,0x2b3,0x3d1,-0x6f8)+'cToe\x20Sessi'+'on',_0x548b6);else{if(!this['game'])_0x4b485e[_0x23937d(0x1a39,0x27d0,0x1276,0xb70)](_0xaa7590,'TicTacToe🎮'+'\x20Session\x20D'+_0x313705(0x1ab4,0x2112,0x1e03,0x168a)+_0x313705(0xb66,0x5a5,-0x1c7,0xd13));else _0x4b485e['gBwGE'](_0x710893,'?');}}}catch{if(_0x4b485e[_0x313705(0x574,-0x5b4,0x849,0x10bb)](_0x23937d(0x1ae7,0x2015,0x1061,0x20b8),_0x313705(0x1643,0x2414,0x10d6,0x1519))){const _0x516d87={};_0x516d87['text']=''+_0x4d7eb4[_0x313705(0xb24,0xd30,-0x308,0xf3a)],_0x30e6b1[_0x313705(0xcaa,0xc41,0x1785,0x1580)+'e'](_0x5c8de1['chat'],_0x516d87),_0x1c0f53=_0x4e330c[_0x313705(0x1723,0x1ceb,0xf29,0x1cf0)+'nc']('./Android/'+_0x23937d(0x1613,0x242b,0xe41,0x218b)+'icker/balm'+_0x23937d(0xd86,0x8f8,0x1b1,0x1703));const _0x5e9cb1={};_0x5e9cb1[_0x23937d(0xffa,0x87a,0x661,0x1ae)]=_0x2721d7;const _0x37b9e={};_0x37b9e[_0x23937d(0x5dc,0xc5f,0xc7,0x100e)]=_0x125e1c,_0x2d9ac2[_0x313705(0xcaa,0xd3a,-0x25,-0x131)+'e'](_0x4012d7[_0x313705(0x14f2,0xe5e,0x68a,0x1c73)],_0x5e9cb1,_0x37b9e);}else _0x4b485e[_0x23937d(0xf72,0x1bd2,0xf46,0x1bcd)](_0x516d85,'Error!');}}break;case _0x4b485e[_0x23937d(0xf92,0x28b,0x19b7,0x1c0f)]:case _0x4b485e[_0x23937d(0x6c7,-0x6ff,0x59e,0x2a4)]:{if(_0x4b485e[_0x313705(0x3ea,-0x808,-0x8f4,0x242)](_0x4b485e[_0x313705(0x39d,0xd63,-0x17a,0xba3)],_0x4b485e[_0x23937d(0x1cd,-0x9ef,0x9b6,-0x5e8)])){const _0x5282da=_0x4b485e['sFyot'][_0x23937d(0xccf,0x9d1,0x4d8,0xa53)]('|');let _0x527729=-0x13*0xb5+-0x54*0x61+0x2d43;while(!![]){switch(_0x5282da[_0x527729++]){case'0':_0x3e0ea9+=_0x23937d(0x5d0,-0x4d9,0x325,-0x68f)+_0x268bb8[_0x313705(0x1eaf,0x1cc4,0x11ff,0x27ad)]+'\x0a';continue;case'1':_0x2113e7+=_0x313705(0x8e7,0xa0,0x14da,0x742)+_0x30aa6a[_0x23937d(0x879,0xfab,0x16e8,0x16aa)+_0x313705(0xfde,0x14ad,0x14c,0x102a)]+'\x0a';continue;case'2':_0x266921+=-0x10ea+0x1979+-0x92*0xf;continue;case'3':_0x3f2ca4+=_0x23937d(0x838,0x43f,0x14de,0x18e)+_0x323a81['berita_jen'+'is']+'\x0a';continue;case'4':_0x4e3897+=_0x23937d(0xf6,-0x406,0xf29,0xae8)+_0x2ecd6d['berita_url']+'\x0a';continue;case'5':_0x29bbdd+='\x0a•\x20'+_0x2072cb[_0x23937d(0x119d,0x76e,0x66f,0x81d)]()+_0x23937d(0x891,0x8d0,0xcd6,-0x435);continue;}break;}}else{if(_0x1bac1f)return _0x4b485e['JYUUI'](_0x1db05d,mess[_0x313705(0x982,-0x44b,0x66d,0x11f9)]);if(!_0x1ba32f[_0x23937d(0x1c16,0x2523,0x1a6b,0x234e)]('\x20'))return _0x4b485e['gBwGE'](_0x516d85,'Where\x20The\x20'+_0x23937d(0x4a0,-0xa55,0x96c,0x932));tes=await fetchJson(_0x23937d(0x14aa,0x1de0,0x1e48,0x1c19)+_0x23937d(0x85e,0x1be,0xaba,0x1033)+_0x313705(0x1f33,0x22c2,0x1f92,0x1418)+_0x23937d(0x1be7,0x19be,0xf7e,0x14b1)+'ate?to=en&'+'kata='+_0x1ba32f['join']('\x20')),Infoo=tes['info'],Detek=tes[_0x23937d(0x14dc,0x1bf6,0x1e18,0x134c)],_0x516d85(_0x313705(0x8d2,0x10cd,0x3ea,0xc0c)+'\x20:\x20'+Detek+('\x0a📘Results\x20'+':\x20')+Infoo);}}break;case _0x4b485e['dZaCg']:case'christmas':case _0x23937d(0xa9c,0x148a,0x2b2,-0x94)+'s':case'sparklechr'+_0x313705(0x1caf,0x285b,0x2065,0x2555):case _0x23937d(0x1606,0x18dd,0x1146,0x23ad):case _0x4b485e[_0x313705(0x9f8,0x908,0xfd9,0xcf4)]:case _0x23937d(0x1271,0x478,0x131b,0x6ab):case _0x4b485e['frJET']:case _0x4b485e[_0x23937d(0x61b,0xf68,-0x8c2,0xdcc)]:case _0x23937d(0x19a3,0x270a,0x13a3,0xa9a):case _0x4b485e['Bhlfp']:case _0x4b485e[_0x313705(0x1a70,0x160c,0xe26,0x24b2)]:case _0x4b485e[_0x23937d(0xb3c,0x1117,0x1294,0x194e)]:case _0x23937d(0x148a,0x1208,0x132e,0x9f5):case _0x4b485e[_0x313705(0x17eb,0x1c0e,0x15ab,0x2065)]:case _0x4b485e['wNCJS']:case _0x313705(0x12d7,0x214b,0x2113,0xb2c):case _0x4b485e[_0x23937d(0x473,-0x21f,-0x75,0xa3b)]:case'.':case _0x4b485e['jucGq']:case _0x4b485e['lBvfC']:case _0x4b485e[_0x23937d(0x73a,-0xf8,0xa36,0x595)]:case _0x4b485e['uDqmu']:case _0x4b485e['bGaFN']:case'papercut':case _0x4b485e['ttNgQ']:case _0x23937d(0x1be1,0x1ec2,0x12b3,0x1bd0):case _0x23937d(0x122c,0xa15,0x148c,0xb87):case _0x4b485e[_0x23937d(0xc1,0x498,0xad4,-0x52)]:case _0x4b485e[_0x313705(0x20d3,0x23ec,0x1bc4,0x1b94)]:case _0x4b485e[_0x23937d(0xdd6,0xb10,0x580,0xd6a)]:case _0x4b485e[_0x313705(0x8cd,0x13d4,0x6ee,0x1749)]:case _0x23937d(0x33c,0x917,-0x26a,0x330):case _0x4b485e['fkqQw']:case _0x4b485e[_0x23937d(0x19a6,0x13fe,0xda9,0x2782)]:case _0x4b485e[_0x313705(0x16c0,0xed8,0x1b7f,0x219e)]:case _0x4b485e['VmRle']:case _0x4b485e[_0x23937d(0x1862,0x19fc,0x2093,0x1b9d)]:case _0x4b485e[_0x313705(0x1710,0x1955,0x7fc,0x1ada)]:case _0x313705(0x13fd,0xe3f,0x16ad,0x191b):case _0x4b485e[_0x313705(0x17a7,0x145b,0x15aa,0x1e69)]:case _0x4b485e[_0x313705(0x1613,0x1720,0x24c8,0x1b19)]:case _0x4b485e['obGhY']:case _0x4b485e[_0x23937d(0x1acd,0x1ead,0x1176,0x1074)]:case _0x4b485e['dRoVe']:case _0x4b485e[_0x23937d(0x164,0x87b,-0x3e1,-0x887)]:case _0x313705(0x7ce,0x53b,0x39c,0x793):case _0x4b485e[_0x23937d(0x562,0xeb0,0x7ec,-0x663)]:case _0x4b485e['ajCqk']:case _0x4b485e[_0x313705(0x11b4,0x1b86,0x1cdc,0x4b5)]:case _0x4b485e[_0x313705(0x134e,0x1558,0x117b,0xbcc)]:case _0x4b485e['myYLC']:case _0x4b485e[_0x313705(0xf63,0x10f6,0x1a4,0x110e)]:case'sand':case _0x23937d(0xcdd,0xb74,0x16be,0x11b6):case _0x313705(0x3ae,0x790,-0x142,-0x9d2):case _0x4b485e[_0x23937d(0xac0,-0x266,0x362,0xad4)]:case _0x4b485e[_0x23937d(0x1485,0xd5e,0x9b3,0xe6e)]:{if(_0x4b485e['gBcsp'](_0x4b485e[_0x23937d(0x1a22,0x2456,0x1b6f,0x1736)],_0x4b485e[_0x23937d(0x141c,0x1127,0x1f4e,0x13be)]))return _0x313705(0x36c,-0x3c,0x340,-0xb5);else{const _0x3126ff={};_0x3126ff['text']='💮',_0x3126ff[_0x23937d(0x94f,0x10a,0x44c,0xf63)]=_0x5cd288['key'];const _0x4bb70c={};_0x4bb70c[_0x313705(0x1d20,0x1774,0x283d,0x27ef)]=_0x3126ff,_0x175756[_0x23937d(0x944,0xaca,0x1485,0x681)+'e'](_0x423161,_0x4bb70c);if(!q)return _0x4b485e[_0x23937d(0xdb6,0x639,0x9d7,0x14f7)](_0x1db05d,'Example\x20:\x20'+_0x4b485e[_0x23937d(0x1572,0xf55,0x132e,0xec7)](_0xe1d953,_0x1354e9)+'\x20'+global[_0x23937d(0x1cd5,0xf47,0x1759,0xe02)]);if(_0x1bac1f)return _0x1db05d(mess['ban']);if(_0x1e03f5)return _0x4b485e[_0x313705(0x11f9,0x1055,0x484,0x17be)](_0x1db05d,mess['banChat']);_0x4b485e[_0x313705(0x151c,0x1090,0x2006,0x7f2)](_0x1db05d,mess[_0x23937d(0x8ac,0xcf2,0x5b2,0x174f)]);let _0x4454bd;if(/candy/[_0x23937d(0x190e,0x157f,0x25ab,0x2001)](_0x1354e9))_0x4454bd=_0x313705(0x163a,0x1d11,0x169d,0x12ea)+_0x23937d(0x1106,0x96c,0xa28,0x19ca)+'reate-chri'+'stmas-cand'+_0x23937d(0xb61,0x1980,-0x6d,0xaa7)+'t-effect-1'+'056.html';if(/christmas/[_0x313705(0x1c74,0x1eae,0x1c61,0x2228)](_0x1354e9))_0x4454bd=_0x4b485e[_0x313705(0x1239,0x171b,0xfcd,0x6e4)];if(/3dchristmas/[_0x23937d(0x190e,0xf12,0x260c,0x1bc9)](_0x1354e9))_0x4454bd=_0x4b485e[_0x23937d(0x1a67,0x17df,0x20fb,0x1309)];if(/sparklechristmas/[_0x313705(0x1c74,0x1694,0x24dc,0x10fb)](_0x1354e9))_0x4454bd=_0x4b485e[_0x23937d(0xe6a,0x132f,0xcdd,0x8ca)];if(/deepsea/['test'](_0x1354e9))_0x4454bd=_0x4b485e[_0x23937d(0x1b41,0x2274,0xf37,0x12eb)];if(/scifi/[_0x313705(0x1c74,0x1da1,0x285e,0x220f)](_0x1354e9))_0x4454bd=_0x4b485e[_0x23937d(0xef8,0xe9f,0xc3c,0x1522)];if(/rainbow/[_0x313705(0x1c74,0x24b8,0x2aa5,0xefe)](_0x1354e9))_0x4454bd=_0x4b485e[_0x23937d(0x433,0x10f0,0x794,-0xaa9)];if(/waterpipe/[_0x313705(0x1c74,0x238f,0x24f6,0x1d17)](_0x1354e9))_0x4454bd=_0x23937d(0x12d4,0x202e,0x20f5,0x21db)+_0x23937d(0x1106,0x1600,0xdea,0xdcc)+'reate-3d-w'+_0x23937d(0x1930,0x1809,0xdf3,0x1331)+_0x23937d(0xe1d,0x16f5,0xdd2,0xa47)+_0x313705(0x1c2e,0x12e5,0x1664,0xffd)+_0x23937d(0xa63,0x176a,0xf9f,0x1450);if(/spooky/[_0x313705(0x1c74,0x202e,0x1ea5,0x1074)](_0x1354e9))_0x4454bd=_0x4b485e[_0x23937d(0x10ee,0x4a3,0xb0b,0x943)];if(/pencil/[_0x23937d(0x190e,0x20d6,0x2584,0x2216)](_0x1354e9))_0x4454bd=_0x313705(0x163a,0x730,0xbea,0x1c30)+'xtpro.me/c'+_0x23937d(0xc35,0x1aee,0x910,0x1926)+'etch-text-'+_0x313705(0x9ff,-0xc2,0xb5e,0x50b)+'ine-1044.h'+'tml';if(/circuit/[_0x313705(0x1c74,0x1f54,0x22ec,0x17d6)](_0x1354e9))_0x4454bd=_0x4b485e['OjkTv'];if(/discovery/['test'](_0x1354e9))_0x4454bd=_0x4b485e[_0x313705(0x19a3,0x282c,0x1783,0x1a17)];if(/metalic/[_0x23937d(0x190e,0x1afe,0x15ca,0xf37)](_0x1354e9))_0x4454bd=_0x4b485e[_0x313705(0x211b,0x1ada,0x285b,0x139b)];if(/fiction/[_0x23937d(0x190e,0x1d8e,0x132b,0x1e07)](_0x1354e9))_0x4454bd=_0x4b485e['JKPFU'];if(/demon/[_0x23937d(0x190e,0x100e,0xcd2,0x1da2)](_0x1354e9))_0x4454bd=_0x4b485e[_0x313705(0x9d0,0x1082,-0x4ff,-0xb0)];if(/transformer/[_0x313705(0x1c74,0x1eca,0x1af8,0x15e5)](_0x1354e9))_0x4454bd=_0x4b485e['VmOvb'];if(/berry/['test'](_0x1354e9))_0x4454bd=_0x23937d(0x12d4,0x4c4,0x1bf4,0x1191)+'xtpro.me/c'+_0x313705(0x19d0,0x1b31,0x25c2,0x1d49)+_0x23937d(0x3cf,-0x108,-0x443,-0x125)+_0x313705(0x8b6,0x532,0x6ec,-0x1d6)+_0x313705(0x10fc,0x150a,0xa62,0x5dc)+_0x23937d(0x1760,0x1658,0x980,0x1a52);if(/thunder/['test'](_0x1354e9))_0x4454bd=_0x4b485e[_0x313705(0x94d,0x1092,0x980,0x9bc)];if(/magma/[_0x313705(0x1c74,0x13c0,0xfe5,0x12eb)](_0x1354e9))_0x4454bd=_0x4b485e[_0x313705(0x1779,0x1a38,0x1abd,0x203e)];if(/3dstone2/[_0x313705(0x1c74,0x1ce9,0x182c,0x211c)](_0x1354e9))_0x4454bd=_0x4b485e[_0x23937d(0x11b5,0x1179,0x105a,0x1ee3)];if(/neonlight/['test'](_0x1354e9))_0x4454bd=_0x4b485e[_0x313705(0x1687,0x1cf5,0x774,0x106c)];if(/glitch/[_0x313705(0x1c74,0xe87,0xfc5,0x10d8)](_0x1354e9))_0x4454bd=_0x23937d(0x12d4,0x1f6f,0x7e0,0xd9d)+_0x23937d(0x1106,0x581,0x172c,0x1aca)+'reate-impr'+_0x313705(0x1ce7,0x142f,0x164a,0x2540)+_0x23937d(0xbe7,0x174c,0x176a,0xa96)+'ffects-onl'+_0x23937d(0x586,0x2ff,-0x6f2,0x55c)+_0x23937d(0x10ab,0x1e90,0x1daf,0x1760);if(/harrypotter/[_0x313705(0x1c74,0x1f49,0x1008,0xdce)](_0x1354e9))_0x4454bd=_0x4b485e[_0x313705(0x131a,0xb34,0x950,0xc74)];if(/brokenglass/[_0x313705(0x1c74,0x298b,0x2726,0x107b)](_0x1354e9))_0x4454bd=_0x4b485e[_0x23937d(0x1b6d,0x2917,0x10f0,0x22bb)];if(/papercut/[_0x313705(0x1c74,0x1de3,0x1a8a,0x183b)](_0x1354e9))_0x4454bd=_0x23937d(0x12d4,0x1fec,0x6d0,0x1871)+_0x23937d(0x1106,0x1a21,0xeb4,0x49f)+'reate-art-'+'paper-cut-'+_0x313705(0x1183,0x14b4,0x15c2,0xb6d)+_0x313705(0xb18,0x540,0x2a4,0x172b)+_0x23937d(0x1dbf,0x198f,0x27fc,0x197b);if(/watercolor/[_0x313705(0x1c74,0x11dd,0xef2,0x1c9b)](_0x1354e9))_0x4454bd=_0x4b485e[_0x313705(0x858,0x6a4,-0x29a,0x1389)];if(/multicolor/[_0x313705(0x1c74,0x2327,0x238b,0x10a5)](_0x1354e9))_0x4454bd=_0x4b485e[_0x23937d(0x13cf,0x9b0,0x2207,0x1b06)];if(/neondevil/['test'](_0x1354e9))_0x4454bd=_0x4b485e[_0x23937d(0xb37,0x12a0,0x6f6,-0x6d)];if(/underwater/['test'](_0x1354e9))_0x4454bd=_0x4b485e[_0x23937d(0xf77,0x1009,0x105b,0xf68)];if(/graffitibike/[_0x23937d(0x190e,0xd71,0x2136,0x144d)](_0x1354e9))_0x4454bd=_0x4b485e['lfHqN'];if(/snow/['test'](_0x1354e9))_0x4454bd='https://te'+_0x23937d(0x1106,0xdae,0x1474,0x1091)+'reate-snow'+_0x23937d(0x6bb,0xad1,-0x803,-0x9d)+_0x23937d(0x170,0x568,-0xae2,0xae5)+_0x313705(0x16d3,0x12d6,0x1c0e,0x1093)+_0x23937d(0x520,-0x74a,0x580,-0x9e5)+_0x313705(0x1411,0xf73,0x81f,0x231c);if(/cloud/[_0x313705(0x1c74,0x1cd1,0x130f,0xd75)](_0x1354e9))_0x4454bd=_0x4b485e['iHQCf'];if(/honey/[_0x313705(0x1c74,0x143a,0x1939,0x2867)](_0x1354e9))_0x4454bd=_0x4b485e[_0x23937d(0xfe5,0x7e4,0x1176,0x3c5)];if(/ice/[_0x23937d(0x190e,0x215b,0x1353,0x1303)](_0x1354e9))_0x4454bd=_0x313705(0x163a,0xdba,0xc61,0x1265)+_0x313705(0x10af,0x12b9,0x385,0xf96)+_0x313705(0xd66,0x13f0,0x1b76,0x151b)+_0x313705(0x88b,0x10f6,0x16d3,0x12f8)+'862.html';if(/fruitjuice/['test'](_0x1354e9))_0x4454bd=_0x4b485e['wKzye'];if(/biscuit/[_0x23937d(0x190e,0xd17,0x2005,0x2147)](_0x1354e9))_0x4454bd=_0x313705(0x163a,0xc5b,0x2426,0x1465)+_0x23937d(0x1cb,-0xb25,-0x763,-0x881)+_0x313705(0xaba,0x1208,0x11,0x221)+_0x313705(0x1274,0x867,0x1a16,0x57d)+'58.html';if(/wood/[_0x313705(0x1c74,0x1a55,0x176b,0x1a29)](_0x1354e9))_0x4454bd=_0x4b485e[_0x23937d(0x135e,0x1bc3,0xc09,0xb5c)];if(/chocolate/[_0x313705(0x1c74,0x1f60,0x165b,0xedd)](_0x1354e9))_0x4454bd=_0x4b485e[_0x313705(0x180e,0x22f8,0x1fa6,0xbb5)];if(/strawberry/[_0x313705(0x1c74,0x21bb,0x1cc5,0xe9b)](_0x1354e9))_0x4454bd=_0x4b485e[_0x23937d(0xd48,0x962,0xe20,0x1c56)];if(/matrix/[_0x23937d(0x190e,0x110e,0x21b2,0x255e)](_0x1354e9))_0x4454bd=_0x4b485e[_0x313705(0x8c5,0x5ea,0x73,0x130b)];if(/blood/[_0x313705(0x1c74,0x1afe,0x2603,0x14f9)](_0x1354e9))_0x4454bd=_0x4b485e['IZpnF'];if(/dropwater/[_0x313705(0x1c74,0x1c17,0x105e,0x1b93)](_0x1354e9))_0x4454bd='https://te'+_0x313705(0x840,0xf67,0x46d,-0x396)+_0x313705(0x4ac,0xfd3,0x2c1,0x96d)+_0x23937d(0x1c52,0x1ee2,0x2629,0xfa5)+_0x313705(0xf9c,0x1ddb,0x41d,0xa2);if(/toxic/[_0x313705(0x1c74,0x1711,0x1d89,0xeb0)](_0x1354e9))_0x4454bd=_0x4b485e['waKMc'];if(/lava/[_0x23937d(0x190e,0x1741,0xa04,0x27d9)](_0x1354e9))_0x4454bd=_0x4b485e['Rrwur'];if(/rock/[_0x23937d(0x190e,0xa61,0xd29,0x1f2e)](_0x1354e9))_0x4454bd=_0x4b485e[_0x23937d(0x1c1,0x31d,-0xbc8,-0xc92)];if(/bloodglas/[_0x313705(0x1c74,0x28d7,0x22b3,0x153b)](_0x1354e9))_0x4454bd=_0x4b485e[_0x23937d(0xf49,0x1593,0xfd0,0xc98)];if(/halloween/[_0x313705(0x1c74,0x1ad2,0x1930,0x2467)](_0x1354e9))_0x4454bd=_0x313705(0x163a,0xb4a,0x22f9,0x19c7)+'xtpro.me/h'+'alloween-f'+'ire-text-e'+_0x313705(0xcb3,0x3d6,0x1139,0x49a)+_0x23937d(0x57,0xa7a,0xbc8,0x7e6);if(/darkgold/[_0x23937d(0x190e,0x2077,0x12dd,0xe3e)](_0x1354e9))_0x4454bd=_0x4b485e['IywxJ'];if(/joker/[_0x313705(0x1c74,0x1fa6,0x1146,0x1408)](_0x1354e9))_0x4454bd=_0x4b485e[_0x313705(0x1655,0x2036,0x1e8f,0xb13)];if(/wicker/[_0x313705(0x1c74,0xfdd,0x1039,0x2b5b)](_0x1354e9))_0x4454bd=_0x4b485e['wbhFI'];if(/firework/[_0x23937d(0x190e,0x1c32,0xe96,0x277b)](_0x1354e9))_0x4454bd=_0x4b485e['rxTRt'];if(/skeleton/[_0x313705(0x1c74,0x1ecd,0x10df,0x2917)](_0x1354e9))_0x4454bd=_0x4b485e['hZsJw'];if(/blackpink/[_0x313705(0x1c74,0x13cd,0x274b,0x13ae)](_0x1354e9))_0x4454bd=_0x23937d(0x12d4,0xd96,0x1a40,0x18a3)+_0x23937d(0x1106,0x13e5,0x172d,0x1e72)+_0x23937d(0x120f,0x1db7,0xf3a,0x2028)+_0x23937d(0x1314,0x108d,0x7c6,0x955)+_0x313705(0x1217,0xab1,0x1d58,0x60b)+_0x313705(0xa0e,-0x1e6,-0x45a,0x571)+_0x313705(0x1411,0xfbe,0x1258,0x221f);if(/sand/[_0x23937d(0x190e,0x1008,0xe16,0x1cfe)](_0x1354e9))_0x4454bd=_0x4b485e[_0x313705(0xc27,0x14c3,0x1017,0xa78)];if(/glue/[_0x313705(0x1c74,0x271a,0x2b4f,0x25fa)](_0x1354e9))_0x4454bd=_0x4b485e[_0x313705(0x1007,0x6bd,0x448,0x580)];if(/1917/[_0x313705(0x1c74,0x142f,0xfaa,0x14e8)](_0x1354e9))_0x4454bd=_0x313705(0x163a,0x1e1e,0x11e6,0x1b49)+'xtpro.me/1'+'917-style-'+_0x23937d(0xe1d,0x18b8,0xc5b,0x18f8)+'t-online-9'+'80.html';if(/leaves/['test'](_0x1354e9))_0x4454bd=_0x4b485e[_0x313705(0x1778,0x988,0xaf5,0x23c5)];let _0x35ead3=await maker[_0x313705(0xa27,0x4f9,0xbc6,0xb92)](_0x4454bd,q);const _0x11b5ee={};_0x11b5ee[_0x23937d(0xa79,0xf81,0x5a8,0x6eb)]=_0x35ead3;const _0x4a4790={};_0x4a4790[_0x313705(0x1fa9,0x25be,0x1d78,0x1eb8)]=_0x11b5ee,_0x4a4790['caption']=''+mess[_0x23937d(0x968,0x12f5,0x1859,0x7b5)],_0x175756[_0x313705(0xcaa,0x910,0x1428,0xb6e)+'e'](_0x5cd288['chat'],_0x4a4790,{'quoted':_0x5cd288});}}break;case _0x4b485e[_0x313705(0x907,0x624,0x1679,0x1671)]:{if(_0x1bac1f)return _0x1db05d(mess[_0x313705(0x982,0xc60,0x122e,-0x392)]);if(_0x1e03f5)return _0x4b485e[_0x313705(0x1b1d,0x2986,0x233b,0x1194)](_0x1db05d,mess[_0x313705(0x926,-0x45d,0xa17,0x10d9)]);let _0x5343cb=_0x313705(0x163a,0x1db2,0x1424,0x1257)+_0x313705(0x1d59,0x2081,0x1e8d,0x2b2c)+_0x313705(0x166b,0x2561,0x173f,0xcca)+_0x313705(0x1c8f,0x277d,0x10f0,0x2970)+'ect-online'+'-883.html',_0x7d6a11=await _0x4b485e[_0x23937d(0x376,-0x7b2,0x443,0xc0a)](textpro,_0x5343cb,q);_0x4b485e[_0x23937d(0x1c7c,0x28d5,0x2ae3,0x1e6e)](_0x1db05d,mess[_0x23937d(0x8ac,0x794,0x171d,0x149a)]),console['log'](_0x7d6a11);const _0x33d6ab={};_0x33d6ab[_0x313705(0xddf,0x17ed,0x1488,0x609)]=_0x7d6a11;const _0x54f13c={};_0x54f13c['image']=_0x33d6ab,_0x54f13c[_0x23937d(0x968,0xf45,0x82f,0xb8f)]=''+mess['caption'];const _0x106f47={};_0x106f47[_0x23937d(0x5dc,-0x337,0x13be,0x388)]=_0x5cd288,_0x175756['sendMessag'+'e'](_0x423161,_0x54f13c,_0x106f47);}break;case _0x4b485e['YVngV']:{if(_0x1bac1f)return _0x1db05d(mess[_0x23937d(0x61c,-0x175,0x6e7,0xa5b)]);if(_0x1e03f5)return _0x1db05d(mess['banChat']);let _0x394c29=_0x23937d(0x12d4,0x1635,0x1bed,0x714)+_0x23937d(0x1b1a,0x103f,0x1187,0xfe9)+'nline-blac'+_0x313705(0x1b85,0x2692,0x1937,0xe8d)+'e-bear-mas'+_0x313705(0x1d84,0x280d,0x2112,0x1a65)+_0x23937d(0x1a7f,0x151d,0x1ad2,0x2136)+'12.html',_0x5d7e7c=await _0x4b485e[_0x23937d(0x1f3,0xc29,0x3e,-0x670)](textpro,_0x394c29,q);_0x1db05d(mess[_0x23937d(0x8ac,0x32,0x8a6,0x103)]),console[_0x313705(0xf2c,0x17e,0xc4d,0x22e)](_0x5d7e7c);const _0x4a3ef8={};_0x4a3ef8[_0x23937d(0xa79,0xd9e,0x1234,0x155b)]=_0x5d7e7c;const _0x39a981={};_0x39a981['image']=_0x4a3ef8,_0x39a981[_0x313705(0xcce,0x1375,0x3f9,-0x105)]=''+mess[_0x23937d(0x968,-0x514,0x17d6,0xcd1)];const _0x1a4681={};_0x1a4681['quoted']=_0x5cd288,_0x175756['sendMessag'+'e'](_0x423161,_0x39a981,_0x1a4681);}break;case _0x4b485e['qWmYa']:{if(_0x1bac1f)return _0x1db05d(mess[_0x313705(0x982,0xa5c,0x1005,0xef4)]);if(_0x1e03f5)return _0x4b485e[_0x23937d(0x1bae,0x2654,0xd77,0x1713)](_0x1db05d,mess[_0x23937d(0x5c0,0xaad,0xfe6,-0x542)]);let _0x59be03='https://te'+_0x23937d(0x1106,0x1f61,0x767,0x1301)+_0x313705(0x47e,0x8ed,0xba7,0x6bd)+_0x313705(0xa82,0xc16,0x186d,0x13d5)+'ffect-onli'+'ne-881.htm'+'l',_0x3ef10d=await textpro(_0x59be03,q);_0x4b485e['Acxoy'](_0x1db05d,mess[_0x313705(0xc12,0x6ad,0x15ff,0x1026)]),console[_0x313705(0xf2c,0x103d,0x159,0x1c6e)](_0x3ef10d);const _0x38286c={};_0x38286c['url']=_0x3ef10d;const _0x420c28={};_0x420c28[_0x23937d(0x1c43,0x23b9,0x249f,0x2381)]=_0x38286c,_0x420c28[_0x23937d(0x968,0x114e,0xd21,0x14d0)]=''+mess[_0x23937d(0x968,0xa35,0x622,0x136f)];const _0x605838={};_0x605838['quoted']=_0x5cd288,_0x175756[_0x313705(0xcaa,0x10f0,0x1a78,-0x254)+'e'](_0x423161,_0x420c28,_0x605838);}break;case _0x4b485e[_0x23937d(0xbfd,0x1200,0x18c9,0x1114)]:{if(_0x1bac1f)return _0x4b485e[_0x23937d(0x1400,0x908,0x5e7,0x149d)](_0x1db05d,mess['ban']);if(_0x1e03f5)return _0x1db05d(mess[_0x23937d(0x5c0,0xfc9,0x14bb,0xd99)]);let _0x12bb7f=_0x313705(0x163a,0xcf9,0x253d,0x982)+'xtpro.me/c'+'reate-blac'+_0x23937d(0x1314,0xc5f,0x187f,0x166f)+_0x313705(0x1217,0x50c,0x2099,0x1403)+'ine-1001.h'+'tml',_0x3bdb1d=await textpro(_0x12bb7f,q);_0x1db05d(mess[_0x23937d(0x8ac,0xf20,0xb4d,0x36d)]),console[_0x23937d(0xbc6,0xc7b,0x93,0xbb3)](_0x3bdb1d);const _0x42469e={};_0x42469e[_0x23937d(0xa79,0xb75,0x1852,0x112d)]=_0x3bdb1d;const _0x2ab642={};_0x2ab642['image']=_0x42469e,_0x2ab642[_0x23937d(0x968,0x85a,0x138d,0x13a1)]=''+mess[_0x313705(0xcce,0x18b9,0x10f,0xe73)];const _0x17ea21={};_0x17ea21[_0x23937d(0x5dc,0xe53,0x54c,0x714)]=_0x5cd288,_0x175756['sendMessag'+'e'](_0x423161,_0x2ab642,_0x17ea21);}break;case _0x4b485e[_0x313705(0x1daf,0x2249,0x1a15,0x210e)]:{if(_0x1bac1f)return _0x4b485e['dFznR'](_0x1db05d,mess[_0x23937d(0x61c,0x94a,0x2ea,0xd4a)]);if(_0x1e03f5)return _0x4b485e[_0x313705(0xc78,0xb04,0xcdc,0xa33)](_0x1db05d,mess[_0x23937d(0x5c0,0x12f7,-0x803,0xa7b)]);let _0x723e0c=_0x313705(0x163a,0x1e6c,0x1694,0x23ce)+'xtpro.me/n'+_0x313705(0xb8c,0x1047,0x139e,0xb54)+_0x313705(0x1183,0x272,0x1172,0x1f5c)+_0x23937d(0x1dde,0x1dde,0x1028,0x1338)+_0x313705(0x10d5,0x17e4,0x931,0x1b22),_0x349819=await _0x4b485e['sBhXn'](textpro,_0x723e0c,q);_0x1db05d(mess['wait']),console[_0x313705(0xf2c,0xea,0x1f3,0x225)](_0x349819);const _0x1725ad={};_0x1725ad['url']=_0x349819;const _0x1808a7={};_0x1808a7[_0x23937d(0x1c43,0x21e5,0x1018,0x14e9)]=_0x1725ad,_0x1808a7[_0x23937d(0x968,0x305,0x6ca,0x75b)]=''+mess['caption'];const _0x5dea79={};_0x5dea79['quoted']=_0x5cd288,_0x175756[_0x23937d(0x944,0xddf,0x1453,0x27)+'e'](_0x423161,_0x1808a7,_0x5dea79);}break;case _0x4b485e[_0x313705(0x1238,0x1712,0x115b,0x1bb4)]:{if(_0x1bac1f)return _0x4b485e['oTydp'](_0x1db05d,mess[_0x23937d(0x61c,0x14cd,0x13db,0x38a)]);if(_0x1e03f5)return _0x4b485e[_0x313705(0x52c,0x338,0x717,0x894)](_0x1db05d,mess['banChat']);let _0x52d98c=_0x313705(0x163a,0x17bd,0x1f2f,0x1af1)+_0x23937d(0x18a6,0x11e6,0x1040,0x22cd)+'atrix-styl'+'e-text-eff'+'ect-online'+_0x313705(0x1de9,0x24d3,0x222e,0x1220),_0x1c8b0c=await _0x4b485e[_0x23937d(0x7c9,0x9a1,0x1dc,-0x3ea)](textpro,_0x52d98c,q);_0x4b485e['YCdyy'](_0x1db05d,mess['wait']),console[_0x313705(0xf2c,0xdcf,0x1ae4,0x1d9c)](_0x1c8b0c);const _0x30344a={};_0x30344a[_0x23937d(0xa79,0x15f4,0x7db,0x1fe)]=_0x1c8b0c;const _0x51a3a1={};_0x51a3a1[_0x23937d(0x1c43,0x18a5,0x276d,0x19f9)]=_0x30344a,_0x51a3a1[_0x313705(0xcce,0x16df,0x1759,0x19d9)]=''+mess[_0x313705(0xcce,-0xfd,0x1169,-0x15)];const _0x3d535e={};_0x3d535e[_0x23937d(0x5dc,0x79f,0x343,0x916)]=_0x5cd288,_0x175756[_0x313705(0xcaa,0x13d3,0x915,0x9b8)+'e'](_0x423161,_0x51a3a1,_0x3d535e);}break;case _0x23937d(0x763,-0x518,0xe50,0x1302):{if(_0x1bac1f)return _0x4b485e[_0x313705(0x1807,0x26d3,0x22ab,0xf32)](_0x1db05d,mess[_0x23937d(0x61c,-0x446,0x10e9,0xb91)]);if(_0x1e03f5)return _0x4b485e['LvcUQ'](_0x1db05d,mess[_0x23937d(0x5c0,0x869,0x176,0x73a)]);let _0x4b3af1=_0x23937d(0x12d4,0x5dd,0xf8c,0x1a09)+_0x23937d(0x1106,0xf03,0xa65,0x157f)+_0x23937d(0x1457,0x159c,0xa54,0x17bb)+_0x313705(0x1648,0xaf0,0xfd5,0x133e)+'ffect-on-t'+_0x23937d(0x1376,0x782,0x1622,0xace)+_0x313705(0x160b,0x7fb,0x16b6,0xca7)+_0x23937d(0x10ab,0x832,0x1d3f,0x1a7d),_0x17b505=await _0x4b485e['pEuXX'](textpro,_0x4b3af1,q);_0x4b485e[_0x23937d(0x1967,0x18cb,0x1bc3,0x205d)](_0x1db05d,mess[_0x313705(0xc12,0x13f3,0x4cb,0xb38)]),console[_0x313705(0xf2c,0x18bb,0x1c6a,0x184a)](_0x17b505);const _0x3e1bc3={};_0x3e1bc3[_0x313705(0xddf,0x119d,0x1867,0x193f)]=_0x17b505;const _0x460f0d={};_0x460f0d[_0x23937d(0x1c43,0x15a9,0x2881,0x1f93)]=_0x3e1bc3,_0x460f0d[_0x23937d(0x968,0xade,0xa23,-0x449)]=''+mess['caption'];const _0x4a61be={};_0x4a61be[_0x23937d(0x5dc,0x1003,0xceb,0x5d8)]=_0x5cd288,_0x175756[_0x23937d(0x944,0xf8e,0x886,-0x26e)+'e'](_0x423161,_0x460f0d,_0x4a61be);}break;case _0x4b485e[_0x313705(0xe6e,0x1265,0x16,-0x9f)]:{if(_0x1bac1f)return _0x1db05d(mess[_0x23937d(0x61c,0x428,-0x869,0x4de)]);if(_0x1e03f5)return _0x4b485e[_0x23937d(0xa4b,0xe7e,-0x16b,0x12fc)](_0x1db05d,mess[_0x23937d(0x5c0,0x116c,0xb7a,-0x25c)]);let _0x1286b7=_0x313705(0x163a,0x1638,0x1c9b,0x130b)+_0x23937d(0x1106,0x1f54,0x1457,0x79e)+_0x313705(0x1d89,0x27f7,0x107b,0x2551)+_0x313705(0xcbe,0x169b,0x18d2,0x1da)+_0x313705(0x88b,0x1325,0x804,0x15b7)+_0x313705(0x1407,0x14c2,0xf5a,0xbbd)+_0x23937d(0x114e,0x12d2,0xbfd,0x14e5),_0x3d66f5=await textpro(_0x1286b7,q);_0x4b485e[_0x23937d(0x177f,0x196a,0x20eb,0x15ba)](_0x1db05d,mess['wait']),console[_0x313705(0xf2c,0x574,0x1147,0x427)](_0x3d66f5);const _0x54e800={};_0x54e800[_0x313705(0xddf,0xf87,0x1a28,0x660)]=_0x3d66f5;const _0x3557a4={};_0x3557a4['image']=_0x54e800,_0x3557a4[_0x313705(0xcce,0x657,0x433,0xaf1)]=''+mess[_0x23937d(0x968,-0x482,0x9bf,0xea4)];const _0x2f379a={};_0x2f379a[_0x313705(0x942,0xb9d,0x9b7,0x1fa)]=_0x5cd288,_0x175756['sendMessag'+'e'](_0x423161,_0x3557a4,_0x2f379a);}break;case _0x4b485e[_0x313705(0x997,-0x349,0x73a,-0x13d)]:{if(_0x1bac1f)return _0x4b485e[_0x313705(0xc3e,0xd81,0x10a2,0xbfb)](_0x1db05d,mess['ban']);if(_0x1e03f5)return _0x1db05d(mess[_0x313705(0x926,0x68e,0x75d,0xe7a)]);let _0x178643=_0x23937d(0x12d4,0x20b9,0x18e8,0x4a7)+_0x23937d(0x1282,0x17fc,0x1abf,0xbfa)+_0x23937d(0x401,0x4e8,0xb28,0x642)+_0x313705(0xb15,0x509,0x116f,-0xee)+'ect-online'+_0x23937d(0x829,-0x299,0xa68,0x304),_0x1dd62c=await _0x4b485e[_0x313705(0x66a,0x24a,0x554,-0x15f)](textpro,_0x178643,q);_0x4b485e[_0x23937d(0xb22,0x751,0xf07,0x175)](_0x1db05d,mess[_0x313705(0xc12,-0x249,0x1aca,0x742)]),console[_0x313705(0xf2c,0x1b81,0x1ca5,0x9af)](_0x1dd62c);const _0x566dc2={};_0x566dc2['url']=_0x1dd62c;const _0x554571={};_0x554571[_0x23937d(0x1c43,0x1afe,0x1717,0x2287)]=_0x566dc2,_0x554571[_0x23937d(0x968,0xe70,0x144c,0x162e)]=''+mess[_0x313705(0xcce,0x11fe,0x15b0,0x551)];const _0x1aa5dd={};_0x1aa5dd[_0x313705(0x942,0x1467,0xbd0,0x2fb)]=_0x5cd288,_0x175756['sendMessag'+'e'](_0x423161,_0x554571,_0x1aa5dd);}break;case _0x23937d(0x19a3,0x124f,0x229e,0x1558):{if(_0x1bac1f)return _0x4b485e[_0x313705(0x13ee,0x16ca,0x1af6,0x218b)](_0x1db05d,mess[_0x23937d(0x61c,0x907,0x1fd,0x10a8)]);if(_0x1e03f5)return _0x1db05d(mess[_0x23937d(0x5c0,0x116b,0x346,0x4c6)]);let _0x515fef=_0x23937d(0x12d4,0x1247,0x1579,0x746)+_0x313705(0x146c,0x730,0xf72,0x1422)+_0x23937d(0xc35,-0x239,0xa6e,0x4f2)+_0x313705(0x108b,0x289,0x57b,0xc14)+_0x313705(0x9ff,0x15b,0xa96,0x10e4)+_0x313705(0x6db,-0x3d0,0x102f,-0x67d)+_0x313705(0x1411,0xec5,0x9b8,0x20ab),_0x14bae0=await _0x4b485e['hIfRN'](textpro,_0x515fef,q);_0x1db05d(mess[_0x23937d(0x8ac,0xc4e,0xc86,0x75c)]),console[_0x313705(0xf2c,0x1a2b,0xd7b,0xb74)](_0x14bae0);const _0x13347d={};_0x13347d[_0x313705(0xddf,0x1211,0x1573,0x12c7)]=_0x14bae0;const _0x5c8dd3={};_0x5c8dd3[_0x313705(0x1fa9,0x1d79,0x1d16,0x1e34)]=_0x13347d,_0x5c8dd3[_0x313705(0xcce,0x37,0x1b22,0x95e)]=''+mess[_0x23937d(0x968,0x8e8,0x46b,0x21d)];const _0x47f36c={};_0x47f36c['quoted']=_0x5cd288,_0x175756[_0x313705(0xcaa,0x1b2f,-0x19,0xaf6)+'e'](_0x423161,_0x5c8dd3,_0x47f36c);}break;case _0x4b485e[_0x23937d(0x45f,-0x70b,0x19c,0xfb0)]:{if(_0x1bac1f)return _0x4b485e['wNaQJ'](_0x1db05d,mess[_0x313705(0x982,0x1457,-0x44d,0x643)]);if(_0x1e03f5)return _0x4b485e[_0x23937d(0xfee,0x1975,0x92f,0x1301)](_0x1db05d,mess[_0x23937d(0x5c0,-0x1a0,0x1216,0xb27)]);let _0x9f8582=_0x313705(0x163a,0x117b,0x1f8f,0x1718)+_0x23937d(0x1106,0x83f,0xf33,0x1284)+_0x23937d(0x11e3,0x1a68,0x7b5,0x71a)+_0x23937d(0x833,0x8e9,-0x1b9,0x6f6)+'fiti-art-t'+_0x23937d(0x1c52,0x1e13,0x1815,0x1173)+_0x313705(0x1814,0xaae,0x136c,0x17c5),_0x2f7566=await _0x4b485e[_0x313705(0x8d7,0x357,0x11ed,0x424)](textpro,_0x9f8582,q);_0x4b485e[_0x313705(0x1725,0x25e9,0x10a8,0x12b5)](_0x1db05d,mess[_0x23937d(0x8ac,0x544,0x1039,0x57a)]),console[_0x23937d(0xbc6,0x10f1,0x1288,0x684)](_0x2f7566);const _0x4a1f48={};_0x4a1f48[_0x23937d(0xa79,0xf7f,0x1aa,0x113a)]=_0x2f7566;const _0x5f4491={};_0x5f4491['image']=_0x4a1f48,_0x5f4491['caption']=''+mess[_0x313705(0xcce,0x143d,0x1138,0x801)];const _0x3ca45c={};_0x3ca45c[_0x23937d(0x5dc,0x16d,0x114f,-0x7ad)]=_0x5cd288,_0x175756[_0x23937d(0x944,0x264,0x8fa,-0x104)+'e'](_0x423161,_0x5f4491,_0x3ca45c);}break;case _0x4b485e['aKlAZ']:{if(_0x1bac1f)return _0x4b485e[_0x313705(0x1da7,0x1fb5,0x134d,0x200c)](_0x1db05d,mess['ban']);if(_0x1e03f5)return _0x4b485e['Hobpj'](_0x1db05d,mess[_0x313705(0x926,0xa6b,0xe5f,0x1557)]);let _0x4deabc='https://te'+_0x313705(0x146c,0x153f,0x1e68,0x10d2)+_0x23937d(0x827,-0x600,0x9e4,0x11c8)+_0x313705(0x1415,0x789,0x17e6,0xa50)+_0x23937d(0x443,-0x445,0x10b7,-0xac0)+_0x23937d(0x1b69,0x1b17,0x14f3,0x21b0)+'-1041.html',_0xd3abf5=await _0x4b485e['gpMgV'](textpro,_0x4deabc,q);_0x4b485e[_0x313705(0x17bf,0x24c4,0x16c1,0x908)](_0x1db05d,mess[_0x23937d(0x8ac,0x1292,0x17a2,0xeaf)]),console['log'](_0xd3abf5);const _0x2ac429={};_0x2ac429[_0x23937d(0xa79,0x9c2,0xa49,0x1ff)]=_0xd3abf5;const _0x78dfe6={};_0x78dfe6[_0x23937d(0x1c43,0x2a6d,0x2aaa,0x109f)]=_0x2ac429,_0x78dfe6[_0x23937d(0x968,0x6a2,0x1809,0x3c9)]=''+mess[_0x313705(0xcce,-0x175,0x4f5,0x165d)];const _0x147d4d={};_0x147d4d[_0x23937d(0x5dc,0xa17,-0x65d,0x4e4)]=_0x5cd288,_0x175756[_0x313705(0xcaa,-0x115,0x1598,0x132d)+'e'](_0x423161,_0x78dfe6,_0x147d4d);}break;case _0x313705(0xd11,0xb09,0xe56,0x218):{if(_0x23937d(0xa4a,0x12b5,0x1716,-0x2b8)===_0x23937d(0x5b5,0xc6b,0x1069,-0x116)){const _0x1dfc8a={};_0x1dfc8a[_0x23937d(0x1d39,0x259a,0xf7a,0xfaf)]=''+_0x399fc2[_0x23937d(0x18b7,0x2508,0x202e,0x172e)];const _0x4e350b={};_0x4e350b[_0x23937d(0x5dc,0x3da,-0x266,0x12dd)]=_0x5ec627,_0x401fd9[_0x23937d(0x944,-0x551,0xaa2,0x15b)+'e'](_0x490cfa[_0x313705(0x14f2,0x1a62,0x9e0,0x9d1)],_0x1dfc8a,_0x4e350b),_0x383b5a=_0x5dc98b[_0x313705(0x1723,0x243b,0x2593,0x1794)+'nc'](_0x313705(0xe81,0xd95,0x75c,0x7bd)+'AllData/st'+_0x313705(0x761,0x5cd,-0x769,0xeb9)+_0x313705(0x8e6,-0x466,0x14f3,0x41c));const _0x3c25dc={};_0x3c25dc['sticker']=_0x514167,_0x4e1f16[_0x23937d(0x944,0x12d2,0x12f8,0x251)+'e'](_0x14cec8['chat'],_0x3c25dc),_0x157224=_0x1ad3e6[_0x23937d(0x13bd,0x5bf,0x18c3,0x13eb)+'nc'](_0x23937d(0xb1b,0x194e,0x16c9,0xa7f)+_0x313705(0x1979,0x1c51,0x1ea0,0x15ff)+_0x23937d(0x10a9,0x1648,0x1a28,0xdc7)+_0x23937d(0xe3a,0x2,0x2b,0x18eb));const _0x35fd1b={};_0x35fd1b[_0x23937d(0xffa,0x7b2,0xf60,0xade)]=_0x48be53,_0x527c3d[_0x313705(0xcaa,0x1999,0x1a2a,0x1375)+'e'](_0x206681[_0x313705(0x14f2,0x1270,0x14e5,0x197f)],_0x35fd1b);}else{if(_0x1bac1f)return _0x4b485e[_0x23937d(0x1b84,0x20d5,0x2a8e,0x2160)](_0x1db05d,mess[_0x23937d(0x61c,0x2b0,-0x36a,-0x1a6)]);if(_0x1e03f5)return _0x4b485e['HXSaL'](_0x1db05d,mess[_0x23937d(0x5c0,-0x7ec,0x1322,0x191)]);let _0x447c22=_0x313705(0x163a,0xa7d,0x246c,0x168c)+_0x23937d(0x1282,0xc45,0x2037,0x1eb0)+_0x23937d(0x1593,0xcd3,0xae8,0x150d)+_0x313705(0x9ff,0x412,0xe43,0x12c7)+'ine-921.ht'+'ml',_0xa02260=await _0x4b485e[_0x313705(0x90d,0x13b9,0x14ba,0xe18)](textpro,_0x447c22,q);_0x1db05d(mess[_0x23937d(0x8ac,0x10fa,0x765,0x13fb)]),console['log'](_0xa02260);const _0xa17b7c={};_0xa17b7c[_0x23937d(0xa79,0xd21,0x16d7,-0x113)]=_0xa02260;const _0x1efd7b={};_0x1efd7b[_0x23937d(0x1c43,0x14a3,0x2305,0x13de)]=_0xa17b7c,_0x1efd7b[_0x23937d(0x968,-0x14a,0x784,-0x2a9)]=''+mess[_0x23937d(0x968,0x88,0x90f,0xb10)];const _0x15d9e7={};_0x15d9e7[_0x313705(0x942,0x1223,0x14c8,0x892)]=_0x5cd288,_0x175756[_0x313705(0xcaa,0x188e,0x2d4,0x615)+'e'](_0x423161,_0x1efd7b,_0x15d9e7);}}break;case _0x4b485e[_0x313705(0x16ce,0x14ad,0xd5f,0x100f)]:{if(_0x4b485e['kVNpB']!==_0x4b485e['kVNpB']){if(_0x94cc11)return _0x4b485e['KEAmZ'](_0x35a7ed,_0x1cdfb0['ban']);if(_0x4a6fc0)return _0x4b485e[_0x23937d(0x172d,0x1d51,0xd09,0xf0a)](_0x14d5c6,_0x198a77['banChat']);if(!_0x5a64d7['isGroup'])return _0x35ec5f(_0x150363[_0x313705(0x152c,0x105f,0x8ab,0x21de)]);let _0x48de0d=_0x10d92&&/\d+\-\d+@g.us/[_0x313705(0x1c74,0xfd0,0x200f,0x20b2)](_0x1aa4cd[-0x3*0x8d+-0x217f+0x2326])?_0x18829d[0x40c+0x1*-0x1be3+0x167*0x11]:_0x3e89d3[_0x23937d(0x118c,0x1e2c,0x855,0xfcf)],_0xb4c45c=[..._0x490199['keys'](_0x318e7f[_0x313705(0x160a,0xc0c,0x2017,0x163b)][_0x48de0d]),_0x163c4a],_0x153ea5=-0x1*0xc9d+-0xe20+0x3*0x8ea;_0x433c21[_0x23937d(0x1574,0x2174,0x23ca,0x2021)](_0x51d678[_0x313705(0x14f2,0x1301,0x15b2,0x182b)],_0x4b485e[_0x313705(0x11ec,0x632,0x1c48,0x82a)](_0x313705(0x199c,0x1f5d,0x1b29,0x2056)+_0x23937d(0x7e3,-0x33f,0x733,0xc50)+'\x0a\x0a',_0xb4c45c[_0x23937d(0xb16,0x531,-0x25,0x3da)](_0x21e678=>_0x153ea5++ +_0x313705(0x4b9,0x3b8,0x1190,0xe27)+_0x21e678[_0x23937d(0x1872,0x21e1,0x1433,0x1187)](/@.+/,''))[_0x313705(0x1f7c,0x1290,0x21d7,0x1dfb)]`\n`),_0x3bb81b,{'mentions':_0xb4c45c});}else{if(_0x1bac1f)return _0x4b485e[_0x313705(0x8a4,-0x164,-0x4dd,-0x217)](_0x1db05d,mess['ban']);if(_0x1e03f5)return _0x1db05d(mess['banChat']);let _0x4c1093='https://te'+_0x23937d(0x1106,0x477,0xa43,0xa4f)+'reate-harr'+_0x23937d(0x980,0x5df,0x155c,-0x217)+'ext-effect'+_0x23937d(0xbdb,0x180f,0x6d2,0x112b)+_0x313705(0xbe0,0x1a4d,0x51a,0x4e0),_0x2b1951=await textpro(_0x4c1093,q);_0x1db05d(mess[_0x313705(0xc12,0x42,-0x4c,0x10de)]),console[_0x313705(0xf2c,0xcea,0x98d,0x863)](_0x2b1951);const _0x11c944={};_0x11c944['url']=_0x2b1951;const _0x59c9b1={};_0x59c9b1['image']=_0x11c944,_0x59c9b1[_0x313705(0xcce,0x6c2,0xa0c,0x2de)]=''+mess[_0x23937d(0x968,0x9c8,-0x1d6,0x112e)];const _0x39fd78={};_0x39fd78[_0x23937d(0x5dc,-0x754,-0x6db,0x1492)]=_0x5cd288,_0x175756[_0x23937d(0x944,-0x36,0x116a,-0x3f6)+'e'](_0x423161,_0x59c9b1,_0x39fd78);}}break;case _0x4b485e[_0x313705(0x427,0x937,-0x6fe,0xc8f)]:{if(_0x4b485e[_0x23937d(0x1619,0x16e9,0xf13,0x1615)]===_0x4b485e[_0x23937d(0x7ba,-0x4b9,0x14bc,0x2c6)]){const _0x40ee8c={};_0x40ee8c['text']=''+_0x1d063b[_0x23937d(0x479,0x80e,0x6e2,0x5d4)];const _0x1cdcfd={};_0x1cdcfd[_0x313705(0x942,0x9c1,0x19d,0x92d)]=_0x3db5cb,_0x5e591f['sendMessag'+'e'](_0x5f4f8f[_0x23937d(0x118c,0x68a,0xd3f,0x13f0)],_0x40ee8c,_0x1cdcfd);}else{if(_0x1bac1f)return _0x4b485e['JrKGy'](_0x1db05d,mess[_0x313705(0x982,0xe73,0x82b,-0x39a)]);if(_0x1e03f5)return _0x4b485e[_0x313705(0x12ed,0x9de,0x1976,0x2000)](_0x1db05d,mess[_0x23937d(0x5c0,0x97c,0x12e0,0x4d1)]);let _0x2341c9=_0x313705(0x163a,0x1485,0x7a9,0x22c7)+'xtpro.me/3'+_0x23937d(0x12ca,0xef2,0xf74,0x1326)+_0x23937d(0x1d6a,0x2a03,0x27e5,0x1c78)+'fect-gener'+_0x313705(0x19bb,0x1b64,0x1900,0xf90)+_0x23937d(0x283,0x7dc,-0xc87,0x11f)+'l',_0x483625=await _0x4b485e['EVSRF'](textpro,_0x2341c9,q);_0x4b485e[_0x23937d(0x80c,0x119e,0xbcd,0xcd6)](_0x1db05d,mess['wait']),console[_0x313705(0xf2c,0x14c9,0x15b9,0x1c45)](_0x483625);const _0x327c10={};_0x327c10[_0x23937d(0xa79,0xd4b,-0x126,0x7f8)]=_0x483625;const _0x3360a6={};_0x3360a6[_0x313705(0x1fa9,0x2e57,0x2e6e,0x1558)]=_0x327c10,_0x3360a6['caption']=''+mess[_0x313705(0xcce,0x4ef,0x1354,0x196)];const _0x14d4de={};_0x14d4de['quoted']=_0x5cd288,_0x175756[_0x313705(0xcaa,0xcba,-0x13b,0x4b3)+'e'](_0x423161,_0x3360a6,_0x14d4de);}}break;case _0x4b485e['Krzhh']:{if(_0x4b485e[_0x313705(0x1c91,0x2ac5,0x28ce,0x192d)](_0x4b485e[_0x313705(0x19f2,0x253c,0xb84,0x1a4d)],_0x313705(0x126a,0x1556,0x418,0x1c30))){if(_0x1bac1f)return _0x4b485e[_0x313705(0x971,-0x55f,0x206,0xf5d)](_0x1db05d,mess['ban']);if(_0x1e03f5)return _0x1db05d(mess['banChat']);let _0x1328b8=_0x23937d(0x12d4,0x3d3,0x1de2,0x1c00)+_0x23937d(0x1688,0x1d5d,0x851,0xdab)+'d-luxury-g'+_0x313705(0x129d,0x147d,0x1ad6,0x1e73)+'ffect-onli'+_0x313705(0x556,0x94b,0x146c,0x9c5)+'ml',_0x209574=await textpro(_0x1328b8,q);_0x4b485e[_0x23937d(0x752,-0x606,0x1270,0x11c)](_0x1db05d,mess['wait']),console[_0x313705(0xf2c,0x1775,0x1595,0x1bf7)](_0x209574);const _0xfa0c96={};_0xfa0c96['url']=_0x209574;const _0x2421e0={};_0x2421e0['image']=_0xfa0c96,_0x2421e0[_0x313705(0xcce,0x245,0x1fb,0x9a7)]=''+mess[_0x23937d(0x968,0x15ba,-0x562,0x377)];const _0x2eec60={};_0x2eec60[_0x313705(0x942,0x99b,-0x2dc,0xa99)]=_0x5cd288,_0x175756[_0x313705(0xcaa,0x18c1,0xa01,0x1bb7)+'e'](_0x423161,_0x2421e0,_0x2eec60);}else{const _0x1ac57a={};_0x1ac57a[_0x313705(0x209f,0x2f74,0x1d08,0x1cd1)]=''+_0x39a0bc[_0x313705(0x211a,0x243d,0x2e68,0x1f67)];const _0x2e1f18={};_0x2e1f18[_0x23937d(0x5dc,0xa25,-0x82c,-0x42b)]=_0x3131f6,_0x4e568f[_0x313705(0xcaa,0x1391,0x7e1,0x1768)+'e'](_0x5ec866[_0x313705(0x14f2,0x20f6,0x83f,0x813)],_0x1ac57a,_0x2e1f18);}}break;case _0x4b485e[_0x313705(0xeec,0xecf,0x6f5,0x11d)]:{if(_0x4b485e[_0x313705(0x1bfd,0x1a58,0x2995,0xcfd)](_0x4b485e[_0x23937d(0x15c8,0x1bae,0x1f6c,0x8f6)],_0x4b485e[_0x23937d(0x117e,0x602,0x14ad,0x18e4)])){_0x57402f={'id':_0x4b485e[_0x23937d(0x1c45,0x2615,0x1710,0x1df5)](_0x4b485e[_0x313705(0xd35,0x311,0x705,0x811)],+new _0x515b08()),'x':_0x4a82f7['chat'],'o':'','game':new _0x1e571e(_0x3731ad[_0x23937d(0x14ce,0x1182,0x1c54,0xda7)],'o'),'state':_0x4b485e[_0x313705(0x782,-0x8,0x117e,0x7d)]};if(_0x439cd4)_0x1ed80b[_0x313705(0x17b7,0x1988,0x17c5,0x2357)]=_0x57f780;_0x4b485e[_0x313705(0x47a,0xb7a,0xb77,-0x9d)](_0x4273b1,_0x4b485e[_0x313705(0x10dd,0x1c08,0x1136,0x1332)]+(_0x2b7dcc?_0x23937d(0x10b5,0xab1,0x651,0xae5)+'Command\x20Be'+'low\x20'+_0x824ea0+_0x3acc12+'\x20'+_0x2811b8:'')),this[_0x23937d(0x4c0,-0x145,0x1213,0x1b7)][_0x1537f1['id']]=_0x1da775;}else{if(_0x1bac1f)return _0x1db05d(mess[_0x313705(0x982,0xb4b,0x1504,0x795)]);if(_0x1e03f5)return _0x4b485e[_0x313705(0xd02,0x1b7b,0x175a,0xedb)](_0x1db05d,mess[_0x313705(0x926,0x25f,0x63e,0x441)]);let _0x2a1702=_0x313705(0x163a,0x1a78,0xc65,0x185f)+_0x23937d(0x1106,0x1ec0,0xa48,0x1017)+_0x23937d(0x1a72,0x1295,0x1766,0x1ec0)+'lue-text-e'+_0x23937d(0xd08,0x201,0x176f,0xb6f)+'-realistic'+_0x23937d(0xccc,0x1887,0x8c4,0xe79)+_0x23937d(0x1760,0x115b,0x2590,0xa0b),_0x427301=await _0x4b485e[_0x23937d(0x304,-0x798,-0x209,0xe66)](textpro,_0x2a1702,q);_0x4b485e[_0x313705(0x19d2,0x198d,0xcbf,0x1c73)](_0x1db05d,mess['wait']),console[_0x313705(0xf2c,0x138c,0x1071,0x570)](_0x427301);const _0x29781b={};_0x29781b['url']=_0x427301;const _0x23edda={};_0x23edda[_0x23937d(0x1c43,0x1fc1,0x1434,0x1c6a)]=_0x29781b,_0x23edda[_0x23937d(0x968,0x648,0x59c,0x1445)]=''+mess[_0x313705(0xcce,0x169,0x7a8,0xae5)];const _0x5ef082={};_0x5ef082[_0x313705(0x942,-0x57d,0xe45,0x1684)]=_0x5cd288,_0x175756['sendMessag'+'e'](_0x423161,_0x23edda,_0x5ef082);}}break;case _0x4b485e[_0x313705(0x12e2,0x509,0x10a3,0x20c5)]:{if(_0x1bac1f)return _0x1db05d(mess[_0x313705(0x982,0x1243,-0xb4,0x342)]);if(_0x1e03f5)return _0x4b485e[_0x23937d(0x1400,0xb8d,0x7b1,0x1bcc)](_0x1db05d,mess[_0x313705(0x926,0x3b0,0x13d0,0x1305)]);let _0x2a09be=_0x23937d(0x12d4,0x5cc,0x1737,0xc45)+'xtpro.me/f'+_0x23937d(0x141d,0xac6,0x607,0x2205)+_0x23937d(0x1248,0xc26,0xa38,0xc4d)+'line-964.h'+_0x23937d(0x10ab,0x17d6,0x7ee,0x174c),_0x8c1828=await _0x4b485e[_0x23937d(0xf02,0xb9d,0x1dd3,0x15b3)](textpro,_0x2a09be,q);_0x1db05d(mess[_0x313705(0xc12,0x1275,0x3a3,-0x110)]),console[_0x23937d(0xbc6,-0x41,0x170,0x10cc)](_0x8c1828);const _0x1e7f0d={};_0x1e7f0d[_0x313705(0xddf,0xee9,0x163e,0xb86)]=_0x8c1828;const _0x3b4093={};_0x3b4093[_0x23937d(0x1c43,0x2451,0x1f05,0x1f4c)]=_0x1e7f0d,_0x3b4093[_0x313705(0xcce,0x129,0xfe7,0x40b)]=''+mess[_0x313705(0xcce,0x71f,0x1929,0xbca)];const _0x1630ce={};_0x1630ce[_0x23937d(0x5dc,-0x75c,0x302,0x600)]=_0x5cd288,_0x175756[_0x313705(0xcaa,0x17c2,-0x1cd,0x6aa)+'e'](_0x423161,_0x3b4093,_0x1630ce);}break;case _0x4b485e[_0x23937d(0x16b5,0xac0,0x8f3,0x224d)]:{if(_0x1bac1f)return _0x1db05d(mess['ban']);if(_0x1e03f5)return _0x4b485e[_0x23937d(0xbd5,0xa4c,0x13b0,0xe)](_0x1db05d,mess['banChat']);let _0x262505=_0x23937d(0x12d4,0x1c00,0x159c,0x1b44)+_0x313705(0x1236,0x4a6,0x15d8,0x1b10)+_0x313705(0xb8c,0x1a8c,0x310,0xde8)+_0x313705(0x557,-0x5ba,0x158,0xf3c)+_0x313705(0x14da,0x1495,0x10a9,0x1c85)+'r-online-1'+_0x23937d(0x15a5,0x16ae,0x2490,0x797),_0x4c8151=await _0x4b485e['mJaGI'](textpro,_0x262505,q);_0x4b485e[_0x313705(0x1282,0xf5d,0x942,0x1b03)](_0x1db05d,mess[_0x313705(0xc12,0x11df,0x1ab2,0x2d0)]),console[_0x313705(0xf2c,0x162b,0x1c32,0x17af)](_0x4c8151);const _0x47aba8={};_0x47aba8[_0x23937d(0xa79,0x165,0x20,0x109a)]=_0x4c8151;const _0x2386b1={};_0x2386b1[_0x313705(0x1fa9,0x1feb,0x1c3e,0x20ac)]=_0x47aba8,_0x2386b1[_0x313705(0xcce,0x1677,0x19f2,0x27)]=''+mess[_0x23937d(0x968,0x4cd,0x31e,0xfc)];const _0x2eeda3={};_0x2eeda3['quoted']=_0x5cd288,_0x175756['sendMessag'+'e'](_0x423161,_0x2386b1,_0x2eeda3);}break;case _0x4b485e['UduSc']:{if(_0x4b485e[_0x313705(0x1692,0x2471,0xac8,0xb7e)](_0x4b485e[_0x23937d(0xa93,-0x2f3,0xf6,0x1507)],_0x313705(0x115c,0x6c6,0x4fd,0xf66))){if(_0x1bac1f)return _0x1db05d(mess[_0x313705(0x982,-0x528,0x1662,0x4a3)]);if(_0x1e03f5)return _0x4b485e[_0x313705(0x1501,0x5f8,0x1ac5,0x1954)](_0x1db05d,mess[_0x23937d(0x5c0,0x1164,-0x495,0x1319)]);let _0x1225aa=_0x313705(0x163a,0x1572,0x1fe1,0x1f30)+_0x23937d(0xa9a,0xfb5,-0x82,0x112a)+'ava-text-e'+'ffect-onli'+_0x313705(0x1a74,0x244f,0x1d73,0xc26)+'l',_0x5cc3ae=await textpro(_0x1225aa,q);_0x4b485e[_0x23937d(0x2bf,-0x387,0x697,-0x6b9)](_0x1db05d,mess[_0x23937d(0x8ac,-0x4d2,0x678,-0x37d)]),console[_0x23937d(0xbc6,-0x97,0x125c,0x392)](_0x5cc3ae);const _0x4355ac={};_0x4355ac['url']=_0x5cc3ae;const _0xc2c541={};_0xc2c541[_0x23937d(0x1c43,0x1e30,0x176f,0x1b6d)]=_0x4355ac,_0xc2c541[_0x23937d(0x968,0xbe9,0xea8,0x11b2)]=''+mess[_0x313705(0xcce,0xfc1,0x191b,0x12ce)];const _0x58d301={};_0x58d301[_0x313705(0x942,0x14e4,0x4d4,0x1490)]=_0x5cd288,_0x175756[_0x313705(0xcaa,0x13b1,0xc2e,0x539)+'e'](_0x423161,_0xc2c541,_0x58d301);}else _0x54c829+=0xa6c+-0x22b1*-0x1+-0x2d1c,_0x3d1c96+=_0x313705(0x1cb1,0x28e4,0x1db1,0x1f2a)+_0x28aed9[_0x23937d(0x119d,0x8b8,0x1121,0xd9a)]()+_0x313705(0xbf7,0x802,-0xda,-0x3),_0x1f5b5e+=_0x23937d(0x5d0,-0x39e,0xbbc,0x428)+_0x1eae0b[_0x313705(0x1eaf,0x2c68,0x2b61,0x1852)]+'\x0a',_0x378626+='Upload:\x20'+_0x58959f[_0x23937d(0x879,0x517,0x175f,0x1185)+_0x313705(0xfde,0x112a,0x140d,0x767)]+'\x0a',_0x395cb7+='Link:\x20'+_0x4037bc[_0x23937d(0xfac,0x15bd,0xd08,0x1dea)]+'\x0a';}break;case _0x4b485e[_0x23937d(0x18a4,0x1be3,0x1795,0x18b5)]:{if(_0x1bac1f)return _0x4b485e[_0x313705(0x15de,0x1fed,0x1d54,0x22a5)](_0x1db05d,mess['ban']);if(_0x1e03f5)return _0x4b485e[_0x313705(0x7f0,0x2c6,-0x6a,0x1641)](_0x1db05d,mess[_0x23937d(0x5c0,0x13eb,0x125a,0x142c)]);let _0x511d4d='https://te'+_0x313705(0x1f7b,0x2785,0x14a5,0x2b2d)+'oxic-text-'+_0x313705(0x9ff,0x17e1,0x11e2,0x1389)+'ine-901.ht'+'ml',_0x560d46=await textpro(_0x511d4d,q);_0x4b485e['ICWcV'](_0x1db05d,mess[_0x313705(0xc12,0x1ad5,0x16fb,0x5bc)]),console[_0x23937d(0xbc6,0xa81,0x10b4,0xc7e)](_0x560d46);const _0x3fc2c0={};_0x3fc2c0['url']=_0x560d46;const _0x4c741f={};_0x4c741f[_0x23937d(0x1c43,0x210e,0x1adc,0x18b8)]=_0x3fc2c0,_0x4c741f[_0x313705(0xcce,0x1438,0x4b2,0x26f)]=''+mess[_0x23937d(0x968,-0x53f,0x799,0xb5f)];const _0x30a9db={};_0x30a9db[_0x313705(0x942,0xda8,-0x520,0x4d1)]=_0x5cd288,_0x175756['sendMessag'+'e'](_0x423161,_0x4c741f,_0x30a9db);}break;case _0x4b485e['SNVEA']:{if(_0x1bac1f)return _0x4b485e[_0x23937d(0x1b6b,0x2951,0x28b5,0x1e09)](_0x1db05d,mess[_0x313705(0x982,-0x431,0xd75,0x236)]);if(_0x1e03f5)return _0x4b485e[_0x313705(0x2134,0x12b3,0x2ec7,0x2277)](_0x1db05d,mess[_0x313705(0x926,0xf93,0xee3,0x11bb)]);let _0x14fc16=_0x23937d(0x12d4,0x1c17,0x1bb7,0x1b1d)+_0x313705(0x19ee,0x2574,0x26ee,0x1edd)+'d-golden-a'+_0x313705(0x1fd0,0x2aae,0x1499,0x23a1)+_0x23937d(0x1a71,0x1f10,0x28fd,0x2892)+_0x23937d(0x938,0xc7e,0x7a5,-0x553)+_0x23937d(0x1a18,0x1fe7,0x2149,0xf7d),_0x185a14=await textpro(_0x14fc16,q);_0x1db05d(mess['wait']),console[_0x23937d(0xbc6,0xa1c,0xba4,0x19da)](_0x185a14);const _0x32f980={};_0x32f980[_0x313705(0xddf,0x1040,0x1570,0x1b56)]=_0x185a14;const _0x380f77={};_0x380f77[_0x23937d(0x1c43,0x27e6,0x28fb,0x124f)]=_0x32f980,_0x380f77[_0x313705(0xcce,0xe4c,0x613,0xe88)]=''+mess['caption'];const _0x40f2ff={};_0x40f2ff[_0x313705(0x942,0x13cc,0x16b,0x1765)]=_0x5cd288,_0x175756[_0x313705(0xcaa,0x100d,-0x12a,0xe80)+'e'](_0x423161,_0x380f77,_0x40f2ff);}break;case _0x4b485e[_0x23937d(0x1999,0x25d0,0xfa6,0x13d2)]:{if(_0x1bac1f)return _0x4b485e[_0x313705(0x82c,0x740,0xf7b,-0x6a8)](_0x1db05d,mess[_0x313705(0x982,0xe20,0x88f,0x970)]);if(_0x1e03f5)return _0x1db05d(mess[_0x23937d(0x5c0,0x1279,0x327,-0x2d9)]);let _0x4f08a4=_0x313705(0x163a,0x2078,0x1ba4,0x11a0)+_0x313705(0x15e8,0x2354,0x1f84,0xa1b)+'parkles-me'+'rry-christ'+_0x23937d(0x1c41,0x2442,0x1fd2,0x1612)+_0x313705(0x1f16,0x29a8,0x2122,0x2b71)+_0x313705(0x1ac6,0x1017,0x1eeb,0x273b),_0x430476=await _0x4b485e[_0x313705(0x1254,0x191e,0x1765,0x17c6)](textpro,_0x4f08a4,q);_0x4b485e[_0x23937d(0x117,0xa08,0xfb9,-0x5b9)](_0x1db05d,mess['wait']),console[_0x313705(0xf2c,0x4dc,0x1200,0x35c)](_0x430476);const _0xfdfb1c={};_0xfdfb1c[_0x313705(0xddf,0x1853,0xda5,0x1ce2)]=_0x430476;const _0x96f145={};_0x96f145[_0x313705(0x1fa9,0x282c,0x11b5,0x12d7)]=_0xfdfb1c,_0x96f145['caption']=''+mess[_0x23937d(0x968,0x14ca,0x6d2,0x121f)];const _0x4d2172={};_0x4d2172['quoted']=_0x5cd288,_0x175756[_0x313705(0xcaa,0x498,0x19ed,0x1229)+'e'](_0x423161,_0x96f145,_0x4d2172);}break;case _0x4b485e['IUtWp']:{if(_0x1bac1f)return _0x4b485e['ZPfBi'](_0x1db05d,mess[_0x313705(0x982,0x14a,0x5bd,0xc4b)]);if(_0x1e03f5)return _0x4b485e[_0x313705(0x1133,0x1423,0x1d97,0xb93)](_0x1db05d,mess[_0x23937d(0x5c0,0x13f8,-0x650,0x215)]);let _0x440e49=_0x23937d(0x12d4,0x6b5,0x19e9,0x1a32)+_0x23937d(0x1106,0x197a,0x11e7,0x10f3)+_0x313705(0x2123,0x2156,0x2aff,0x2907)+'ci-fi-text'+_0x23937d(0x1248,0x1d98,0x124c,0xd17)+_0x23937d(0xfae,0x1bee,0x17db,0x1310)+_0x313705(0x3bd,0x7c6,0x771,0xdb),_0x4358dd=await textpro(_0x440e49,q);_0x4b485e[_0x23937d(0x368,-0x852,-0x184,0x81)](_0x1db05d,mess['wait']),console[_0x313705(0xf2c,0x1d4d,0x1c6d,0xb08)](_0x4358dd);const _0x139d6a={};_0x139d6a[_0x23937d(0xa79,0xa,0xb2c,0xe44)]=_0x4358dd;const _0x7194b7={};_0x7194b7[_0x23937d(0x1c43,0x293d,0x157f,0x15c0)]=_0x139d6a,_0x7194b7[_0x313705(0xcce,0x28f,0x149d,0xe72)]=''+mess[_0x313705(0xcce,0x9ee,0x1619,0x171)];const _0xf45e84={};_0xf45e84['quoted']=_0x5cd288,_0x175756[_0x23937d(0x944,0xd35,0x3ca,0xf66)+'e'](_0x423161,_0x7194b7,_0xf45e84);}break;case _0x4b485e['OTpjH']:{if(_0x1bac1f)return _0x4b485e[_0x313705(0xd17,0x14f4,0x116f,0x9a3)](_0x1db05d,mess[_0x23937d(0x61c,-0x55d,0xf9c,0x14f3)]);if(_0x1e03f5)return _0x1db05d(mess['banChat']);let _0x36d3ba=_0x23937d(0x12d4,0x170f,0xffe,0xae2)+_0x313705(0x19ee,0x1663,0x15b4,0x21fd)+_0x23937d(0xbe,0x749,0x7ab,0xc59)+_0x313705(0xea1,0xb24,0x3b3,0xb84)+_0x23937d(0x286,-0x2cb,-0x412,0xcc6)+_0x313705(0x88b,0x106b,0x350,0x16cf)+_0x313705(0x63f,0x1072,0x901,0x117c),_0x32ee79=await _0x4b485e['TKcRQ'](textpro,_0x36d3ba,q);_0x4b485e['FvHez'](_0x1db05d,mess[_0x313705(0xc12,0x95f,0x1629,0xa60)]),console[_0x313705(0xf2c,0x1b9c,0x108c,0x1746)](_0x32ee79);const _0x501ed2={};_0x501ed2['url']=_0x32ee79;const _0x311937={};_0x311937['image']=_0x501ed2,_0x311937[_0x313705(0xcce,0x14dc,0xc7f,0xe14)]=''+mess[_0x23937d(0x968,0x16,-0x413,0x8e3)];const _0xc89f04={};_0xc89f04[_0x313705(0x942,0x728,-0x6c,0x81e)]=_0x5cd288,_0x175756[_0x23937d(0x944,0x22d,-0x2d8,0xf62)+'e'](_0x423161,_0x311937,_0xc89f04);}break;case _0x313705(0x1131,0x17be,0x13d0,0x1358):{if(_0x4b485e['MMLUH']!==_0x4b485e[_0x23937d(0x15d6,0x2192,0x2012,0x1d7c)]){if(_0x1bac1f)return _0x4b485e[_0x23937d(0x1bd2,0x24a4,0x1f1a,0x28e3)](_0x1db05d,mess[_0x313705(0x982,-0x292,-0x69,0x3b7)]);if(_0x1e03f5)return _0x4b485e[_0x23937d(0x18ac,0x1477,0x2526,0x1606)](_0x1db05d,mess['banChat']);let _0x2c2990=_0x313705(0x163a,0x1092,0x1a1b,0xb15)+_0x23937d(0x323,-0x4f,-0x329,-0x743)+_0x313705(0xb7e,0x13a2,-0x24c,0x1957)+'classic-8-'+_0x313705(0x80b,0xc7b,0x57a,-0x4fb)+_0x313705(0x1384,0x1a7c,0x1f2c,0x1565)+_0x23937d(0x1760,0x164c,0xb55,0xd7a),_0x5e8e82=await _0x4b485e['cPjJw'](textpro,_0x2c2990,q);_0x4b485e[_0x23937d(0x1869,0xe30,0x2283,0x1f67)](_0x1db05d,mess[_0x23937d(0x8ac,0x8,0x759,0x619)]),console[_0x313705(0xf2c,0x819,0x769,0x2e4)](_0x5e8e82);const _0x45e143={};_0x45e143['url']=_0x5e8e82;const _0x510297={};_0x510297[_0x23937d(0x1c43,0x19d9,0x283e,0x264f)]=_0x45e143,_0x510297[_0x23937d(0x968,0x337,-0x507,-0x2b2)]=''+mess[_0x23937d(0x968,0x430,0xb28,-0x33b)];const _0xb2b4b9={};_0xb2b4b9['quoted']=_0x5cd288,_0x175756[_0x23937d(0x944,0x1611,0x1611,0x119d)+'e'](_0x423161,_0x510297,_0xb2b4b9);}else{const _0x44c888={'aqFPV':function(_0x5cb5a5,_0x25440b){function _0x46b3b0(_0x39bc25,_0x21d67e,_0x4a0b9b,_0x12d4d1){return _0x313705(_0x39bc25-0x50,_0x4a0b9b,_0x4a0b9b-0x108,_0x12d4d1-0x13e);}return _0x4b485e[_0x46b3b0(0xe55,0x790,0x1388,0xd14)](_0x5cb5a5,_0x25440b);},'Byzah':function(_0xe4eb78,_0x1321bd){function _0x74663d(_0x5b594c,_0xb5b459,_0x514278,_0x234dd1){return _0x23937d(_0x234dd1-0x3e,_0x514278,_0x514278-0x189,_0x234dd1-0x1ea);}return _0x4b485e[_0x74663d(0x911,0xfee,-0x9c,0xa43)](_0xe4eb78,_0x1321bd);}};if(_0x4b485e['JqhLr'](_0x21762b,_0xcf508c))return _0x4b485e[_0x313705(0x13cd,0x159e,0x213c,0x514)](_0x40e2b9,_0x23937d(0x1669,0x1fcb,0xc87,0x1c5c)+_0x23937d(0x123a,0x13e9,0x748,0xf11)+_0x313705(0x1f39,0x29c5,0x12a3,0x11ad)+_0x23937d(0xe98,0x1b7f,0xa33,0xb94)+_0x23937d(0x6d4,0x291,0xf76,-0x679)+'tion');if(!_0x3ff694[-0x3*0x5ea+-0xc95*-0x1+0x1*0x52a])return _0x4b485e[_0x313705(0x61f,0x1034,-0x7e,0x6d1)](_0x46a72e,_0x313705(0x110b,0x2aa,0x1ca6,0x1ca7)+(_0x1fa747+_0x201c57)+('\x20elephant\x20'+_0x313705(0x119e,0x1223,0x142f,0x15b8)+'ant\x20=\x201500'+'0\x20Money'));_0x3268d4(_0x4df903[_0x313705(0x1834,0x1f95,0x920,0x1462)],_0x308dad);let _0x3a0438=_0x4b485e[_0x313705(0xe7d,0x6fc,0x641,0x1c8c)](-0x3191+0x63f1+0x8*0x107,_0x4411bb);_0x4b485e[_0x23937d(0x1050,0x7c1,0x4ee,0xe31)](_0x421898,_0x2261d3[_0x313705(0x1834,0xfa5,0x1923,0xc4e)],_0x3a0438),_0x4b485e['GLJuo'](_0x26f616,()=>{function _0x3afb02(_0x5abe53,_0x5572da,_0x3a079d,_0x1b76e5){return _0x23937d(_0x5572da-0xa2,_0x5abe53,_0x3a079d-0x71,_0x1b76e5-0xe1);}function _0x14a5f7(_0x4755e0,_0x5b78f7,_0x5f010a,_0x3d4120){return _0x313705(_0x5f010a- -0x505,_0x3d4120,_0x5f010a-0x30,_0x3d4120-0xd2);}_0x44c888['aqFPV'](_0x3d1d79,_0x3afb02(-0x9ce,0x343,-0x962,0x121d)+_0x3afb02(0x1974,0xf23,0xbb8,0x1575)+_0x3afb02(0xb82,0x921,0x103b,-0x28e)+_0x3afb02(0x1b5d,0x1e6a,0x1fec,0x24b8)+_0x3afb02(0x15f,0x8f4,0x17ce,0x1bf)+_0x44c888[_0x14a5f7(0xc2,0xa80,-0x144,-0x2b)](_0x2892c7,_0x29e27e[_0x14a5f7(0x1b3a,0xf29,0x132f,0xe20)])+(_0x14a5f7(0x2528,0x19e7,0x1a25,0xc15)+_0x3afb02(0x4ce,0x990,0xd8,0x131b)+'phant(s)*\x20'+':\x20')+_0x44c888[_0x14a5f7(0x198f,0x10c5,0x12c5,0x1cb2)](_0x27fe1e,_0xc14694[_0x3afb02(0x1566,0x1570,0x10ad,0x1c47)]));},0x2136+-0xfe1+0x1*-0x985);}}break;case'watercolor'+'2':{if(_0x1bac1f)return _0x4b485e[_0x313705(0x9f1,0x11ed,-0x4bb,0x108e)](_0x1db05d,mess[_0x23937d(0x61c,-0x171,0x138c,0x82d)]);if(_0x1e03f5)return _0x4b485e[_0x313705(0x141d,0x8fc,0xa21,0x1996)](_0x1db05d,mess[_0x313705(0x926,0xb65,0x142f,0xcc1)]);let _0x118ebb=_0x23937d(0x12d4,0xac6,0xf98,0x131d)+_0x313705(0x146c,0x21ab,0x22c9,0xd67)+'reate-a-fr'+_0x313705(0x15af,0xf26,0x2368,0x20da)+'watercolor'+_0x23937d(0x6bb,0x15a9,-0x4e3,0x8ac)+'ct-1017.ht'+'ml',_0x5726e6=await _0x4b485e[_0x313705(0x13b6,0x1a2c,0x1778,0x1391)](textpro,_0x118ebb,q);_0x4b485e[_0x313705(0x666,-0x218,0x8c1,0xc27)](_0x1db05d,mess[_0x23937d(0x8ac,0x155e,0x1304,0xa3b)]),console[_0x313705(0xf2c,0x130e,0x9e7,0xb1a)](_0x5726e6);const _0x3354e5={};_0x3354e5['url']=_0x5726e6;const _0x534cfe={};_0x534cfe[_0x313705(0x1fa9,0x26a5,0x22e4,0x1fbe)]=_0x3354e5,_0x534cfe[_0x313705(0xcce,0x14d1,-0x124,0x3d4)]=''+mess['caption'];const _0x50f327={};_0x50f327[_0x313705(0x942,0x6e5,0x23c,-0x18f)]=_0x5cd288,_0x175756['sendMessag'+'e'](_0x423161,_0x534cfe,_0x50f327);}break;case _0x4b485e['ppWRa']:{if(_0x1bac1f)return _0x4b485e['XZpDT'](_0x1db05d,mess[_0x313705(0x982,-0x403,0x9a6,0x1361)]);if(_0x1e03f5)return _0x4b485e['rtjUF'](_0x1db05d,mess[_0x23937d(0x5c0,-0x2f8,-0xc9,-0x612)]);let _0xcafeb9=_0x23937d(0x12d4,0x1f91,0x1e39,0x1708)+_0x313705(0x146c,0x193b,0xd11,0x89c)+_0x23937d(0x2c7,0x63f,-0x908,0x105c)+_0x313705(0x1e10,0xff7,0x2501,0x277c)+_0x23937d(0x81c,-0x2ba,0xe3e,0x6c4)+_0x23937d(0x699,-0x1a4,0xabf,-0x49b)+'ine-1046.h'+_0x23937d(0x10ab,0x13df,0x429,0x1abf),_0x23fdfc=await textpro(_0xcafeb9,q);_0x4b485e['rZKBl'](_0x1db05d,mess[_0x313705(0xc12,0x7ea,0x490,0x1751)]),console['log'](_0x23fdfc);const _0x11c13c={};_0x11c13c[_0x313705(0xddf,0x1c11,0x1824,0x93c)]=_0x23fdfc;const _0x47cf7d={};_0x47cf7d[_0x23937d(0x1c43,0x1110,0x1610,0x20d3)]=_0x11c13c,_0x47cf7d['caption']=''+mess['caption'];const _0x4fb55d={};_0x4fb55d['quoted']=_0x5cd288,_0x175756[_0x313705(0xcaa,0x128a,0x19ed,0xf91)+'e'](_0x423161,_0x47cf7d,_0x4fb55d);}break;case _0x4b485e['AMvMq']:{if(_0x4b485e['yDSlc'](_0x4b485e[_0x23937d(0x1bdb,0x29cc,0x1e21,0x27e1)],_0x4b485e[_0x313705(0x1f41,0x1744,0x13ba,0x15ed)])){if(_0x1bac1f)return _0x4b485e[_0x23937d(0xb1d,0x162c,0x1a2f,0x127d)](_0x1db05d,mess['ban']);if(_0x1e03f5)return _0x4b485e[_0x313705(0x14a5,0x1ce4,0x2169,0x666)](_0x1db05d,mess['banChat']);let _0x29740d='https://te'+_0x313705(0x1d59,0x117f,0x16c9,0x1044)+'alloween-f'+_0x23937d(0x1653,0x1d50,0xea0,0x152a)+_0x23937d(0x94d,0x17e7,0x1390,-0x45c)+'html',_0x565764=await _0x4b485e[_0x313705(0x760,-0x286,0x1458,-0xa1)](textpro,_0x29740d,q);_0x4b485e[_0x23937d(0x19fd,0x2267,0x27a2,0xe51)](_0x1db05d,mess[_0x23937d(0x8ac,0xeee,0x1cf,0x1777)]),console[_0x313705(0xf2c,0x1bb2,0x9b3,0x55b)](_0x565764);const _0xe5a7d3={};_0xe5a7d3[_0x23937d(0xa79,0x7c5,0x1982,-0x22b)]=_0x565764;const _0x1c053a={};_0x1c053a[_0x313705(0x1fa9,0x1590,0x280e,0x2e03)]=_0xe5a7d3,_0x1c053a['caption']=''+mess['caption'];const _0x379f14={};_0x379f14[_0x313705(0x942,-0x4bf,0x1466,0x880)]=_0x5cd288,_0x175756[_0x313705(0xcaa,-0x254,0xe6d,0x133f)+'e'](_0x423161,_0x1c053a,_0x379f14);}else{if(_0x515d8c)return _0x4b485e['oIeZW'](_0x5f51fb,_0x435762[_0x23937d(0x61c,0x34,0x83c,0xcc9)]);if(_0x2d7d7d)return _0x4b485e[_0x313705(0xa42,0xdc6,0x16b7,-0x16f)](_0x3138b9,_0x346d70[_0x313705(0x926,0x1755,0x1742,-0x4e6)]);let _0x501e2b=_0x142780['db'][_0x23937d(0xe17,0x1a9f,0x18f3,0x148a)]['users'][_0x201470[_0x313705(0x1834,0x1375,0x2067,0xe4f)]];_0x501e2b[_0x313705(0x56a,0x14b,-0x44e,0x127a)]=+new _0x488850(),_0x501e2b[_0x23937d(0xe3e,0x25,0x1991,0x1670)]=_0x1a9b11,_0x4b485e[_0x23937d(0x12c5,0x459,0x1f8e,0xda4)](_0x183a48,_0xebe026[_0x23937d(0x47c,-0x6ac,0x9e0,-0x9dd)]+(_0x313705(0x771,0x3a7,0xd11,-0x768)+'Afk/Offlin'+'e')+(_0x430565?_0x4b485e[_0x313705(0x1f05,0x179d,0x2d73,0x2c4d)](':\x20',_0x5959ae):''));}}break;case _0x4b485e[_0x313705(0x1c8d,0x14dc,0x2387,0x1963)]:{if(_0x1bac1f)return _0x1db05d(mess[_0x23937d(0x61c,0x13de,0x2f2,0x1a0)]);if(_0x1e03f5)return _0x4b485e[_0x23937d(0xe7c,0x1888,0x16c1,0x11b9)](_0x1db05d,mess[_0x23937d(0x5c0,0x4a,0x15,0x253)]);let _0x257f77=_0x23937d(0x12d4,0x1130,0x1a40,0x20eb)+'xtpro.me/s'+_0x23937d(0x401,0xe2f,0x68f,-0x25e)+_0x23937d(0x7af,0xfd5,0x9af,-0x4f2)+_0x313705(0x8b6,0x1283,0x50e,0x602)+'-990.html',_0x8cf17f=await _0x4b485e['hIfRN'](textpro,_0x257f77,q);_0x4b485e[_0x313705(0x1081,0x156b,0x1a32,0x616)](_0x1db05d,mess['wait']),console[_0x313705(0xf2c,0x3b,0x65f,0x1b35)](_0x8cf17f);const _0x10416d={};_0x10416d[_0x313705(0xddf,0xf68,0x1992,0x11a7)]=_0x8cf17f;const _0x2a1dca={};_0x2a1dca['image']=_0x10416d,_0x2a1dca[_0x313705(0xcce,0xe0b,0x149b,0x19a1)]=''+mess[_0x23937d(0x968,0x7cc,0xf20,-0x300)];const _0x573bdf={};_0x573bdf[_0x23937d(0x5dc,0xb31,-0x2f1,0x1445)]=_0x5cd288,_0x175756[_0x23937d(0x944,-0x55d,0xa97,-0x4fd)+'e'](_0x423161,_0x2a1dca,_0x573bdf);}break;case _0x4b485e[_0x313705(0x871,0x66c,0x96c,0x132a)]:{if(_0x1bac1f)return _0x4b485e[_0x23937d(0xcc0,0x5f6,0x7ec,0x1b48)](_0x1db05d,mess[_0x23937d(0x61c,0xca,0xbc9,0x120c)]);if(_0x1e03f5)return _0x4b485e[_0x23937d(0x1b00,0x16d6,0x20bf,0x228a)](_0x1db05d,mess['banChat']);let _0x95ba0b=_0x23937d(0x12d4,0x646,0x20df,0x916)+_0x23937d(0xb1a,0x87c,0x5b0,0x52d)+_0x313705(0xec5,0x2fa,0x1c7b,0xd2f)+_0x23937d(0x1bfc,0x1be7,0x25e3,0x2646)+_0x313705(0x1fbd,0x1472,0x1caf,0x2755)+_0x23937d(0x10d,-0x4d8,-0x662,-0x810)+'15.html',_0x40ff98=await textpro(_0x95ba0b,q);_0x1db05d(mess[_0x313705(0xc12,-0x11a,0x9a5,0x14ca)]),console[_0x23937d(0xbc6,0x19d,0x4d2,0x1468)](_0x40ff98);const _0x11eff8={};_0x11eff8[_0x23937d(0xa79,0x5bb,0x1810,0x178c)]=_0x40ff98;const _0xcc07ad={};_0xcc07ad[_0x313705(0x1fa9,0x2d1f,0x1c73,0x1f51)]=_0x11eff8,_0xcc07ad['caption']=''+mess['caption'];const _0x6aee71={};_0x6aee71['quoted']=_0x5cd288,_0x175756['sendMessag'+'e'](_0x423161,_0xcc07ad,_0x6aee71);}break;case _0x4b485e[_0x313705(0xe23,0x16f5,0x878,0x28e)]:{if(_0x1bac1f)return _0x4b485e[_0x313705(0x12d0,0x146b,0x3c9,0x182c)](_0x1db05d,mess[_0x23937d(0x61c,0x1045,0x13bd,0xb68)]);if(_0x1e03f5)return _0x4b485e[_0x313705(0xdc0,0x693,0x75c,0x602)](_0x1db05d,mess['banChat']);let _0x5c26e6=_0x313705(0x163a,0x1886,0x1aae,0x182b)+_0x313705(0x146c,0xf68,0x18ca,0x14c8)+_0x313705(0xfa4,0xbd9,0xa59,0x5af)+_0x23937d(0xe19,0xcc0,0x838,0x1124)+_0x313705(0xfed,0x12b3,0x1524,0xc31)+_0x23937d(0xb93,0x13b9,-0xca,0x73a)+_0x313705(0x201f,0x1176,0x1af9,0x1f57),_0x295af9=await textpro(_0x5c26e6,q);_0x4b485e['BDUik'](_0x1db05d,mess[_0x23937d(0x8ac,0xf28,0xa59,-0xe1)]),console[_0x313705(0xf2c,0xaf8,0x10b8,0x1804)](_0x295af9);const _0x4f112b={};_0x4f112b[_0x23937d(0xa79,0x8b9,-0x13b,0x3ec)]=_0x295af9;const _0x54d9b4={};_0x54d9b4[_0x313705(0x1fa9,0x1451,0x1336,0x136a)]=_0x4f112b,_0x54d9b4[_0x23937d(0x968,0x3df,-0x6d,-0x5d)]=''+mess[_0x23937d(0x968,0x135f,-0x486,0x165a)];const _0x541cb4={};_0x541cb4[_0x23937d(0x5dc,0xd45,0x89d,-0x6b0)]=_0x5cd288,_0x175756['sendMessag'+'e'](_0x423161,_0x54d9b4,_0x541cb4);}break;case'skeleton2':{if(_0x1bac1f)return _0x4b485e[_0x23937d(0x54e,-0x542,-0x6be,0x66b)](_0x1db05d,mess[_0x313705(0x982,0xb2f,0x3d9,-0x129)]);if(_0x1e03f5)return _0x4b485e[_0x313705(0x1330,0xcd8,0xdca,0x15a1)](_0x1db05d,mess[_0x313705(0x926,0x83,0xb3,-0x380)]);let _0x42b4cb=_0x313705(0x163a,0x1f18,0x2173,0xb64)+_0x313705(0x146c,0x14c2,0xfca,0xdfa)+_0x313705(0x9bb,0x37d,0x7b8,-0x3eb)+_0x313705(0x19ca,0x100e,0x1725,0xd05)+_0x23937d(0x1b5a,0x2807,0x1f35,0x1413)+_0x313705(0x9ff,0xa91,0xa0a,0xdda)+'ine-1047.h'+_0x23937d(0x10ab,0x7be,0xaaf,0x67e),_0x1b90fe=await _0x4b485e[_0x313705(0x634,0x6cf,0x917,0x7dc)](textpro,_0x42b4cb,q);_0x4b485e[_0x23937d(0xa95,0x2c3,0xca7,0x13b4)](_0x1db05d,mess[_0x23937d(0x8ac,0xc6d,0x177e,-0x41f)]),console[_0x23937d(0xbc6,0x991,0x251,-0x21a)](_0x1b90fe);const _0x1f90f4={};_0x1f90f4['url']=_0x1b90fe;const _0x5a0bb8={};_0x5a0bb8['image']=_0x1f90f4,_0x5a0bb8[_0x23937d(0x968,0xa27,-0x6f,0x44b)]=''+mess[_0x313705(0xcce,0x8fd,0x15de,0x18e8)];const _0x87a320={};_0x87a320[_0x23937d(0x5dc,-0x4a1,-0x75f,0x38e)]=_0x5cd288,_0x175756[_0x313705(0xcaa,0x382,0x9e1,0x17bb)+'e'](_0x423161,_0x5a0bb8,_0x87a320);}break;case _0x4b485e[_0x313705(0x15c6,0x15f9,0x83e,0xb45)]:{if(_0x1bac1f)return _0x4b485e[_0x23937d(0x1c1d,0xe20,0x218c,0x210f)](_0x1db05d,mess['ban']);if(_0x1e03f5)return _0x4b485e[_0x313705(0xe34,0x68e,0x647,0x1954)](_0x1db05d,mess[_0x23937d(0x5c0,0x4e4,0xb07,0x7ae)]);let _0x29fe7d='https://te'+_0x23937d(0x1106,0x1469,0x1ef2,0x6ad)+'reate-a-sk'+_0x23937d(0xd25,0xe07,0x7f8,-0x4c)+'effect-onl'+_0x313705(0x6db,0x1fc,0x88f,0x4a9)+'tml',_0x568fe2=await _0x4b485e[_0x23937d(0xcdf,0xbe4,0x1abf,0xbb0)](textpro,_0x29fe7d,q);_0x4b485e['ofrnl'](_0x1db05d,mess[_0x313705(0xc12,0xc63,0x17f7,0xf80)]),console[_0x23937d(0xbc6,-0x32d,0x185f,-0x35a)](_0x568fe2);const _0x2f63dc={};_0x2f63dc[_0x23937d(0xa79,0x819,0x14bc,0x14f0)]=_0x568fe2;const _0x582b2e={};_0x582b2e[_0x23937d(0x1c43,0x178d,0xff0,0x11be)]=_0x2f63dc,_0x582b2e[_0x313705(0xcce,0x8c3,0x16ce,0x1263)]=''+mess[_0x313705(0xcce,0x1946,0x6b9,0x1509)];const _0x29a76f={};_0x29a76f[_0x23937d(0x5dc,0x11d4,-0x436,0xfac)]=_0x5cd288,_0x175756['sendMessag'+'e'](_0x423161,_0x582b2e,_0x29a76f);}break;case _0x4b485e[_0x313705(0x877,0xab1,0x1616,0x106a)]:{if(_0x4b485e['uETpK'](_0x4b485e[_0x313705(0x1642,0x9e6,0x1356,0x1e39)],_0x4b485e['jGsoh'])){if(_0x1bac1f)return _0x4b485e['QwldS'](_0x1db05d,mess[_0x23937d(0x61c,-0x1e3,0x824,0xc8c)]);if(_0x1e03f5)return _0x1db05d(mess[_0x23937d(0x5c0,-0x88c,-0xb3,-0x6a7)]);let _0x196c92=_0x313705(0x163a,0x198e,0x7cc,0x2174)+'xtpro.me/c'+_0x23937d(0x11e3,0x14ab,0x1aad,0x1f3d)+_0x23937d(0x833,0x1526,0xf71,0xcac)+'fiti-art-t'+_0x23937d(0x1c52,0x111c,0xda8,0x1914)+_0x23937d(0x14ae,0x1fec,0x1a9b,0x1061),_0x40c260=await _0x4b485e[_0x23937d(0x571,0xa44,0x5dd,-0x552)](textpro,_0x196c92,q);_0x4b485e[_0x313705(0x6a8,0x1589,0xc8a,0xd57)](_0x1db05d,mess[_0x313705(0xc12,0x65a,-0x250,0xf29)]),console['log'](_0x40c260);const _0x526d20={};_0x526d20[_0x23937d(0xa79,0x1546,0x105a,0xbf4)]=_0x40c260;const _0x173157={};_0x173157['image']=_0x526d20,_0x173157[_0x313705(0xcce,0x11ef,0x96c,0x8da)]=''+mess[_0x313705(0xcce,0x18ba,0x18e2,0x102b)];const _0x446a94={};_0x446a94[_0x23937d(0x5dc,0x77a,0xf7a,0x64e)]=_0x5cd288,_0x175756['sendMessag'+'e'](_0x423161,_0x173157,_0x446a94);}else{if(_0x4b485e[_0x313705(0xfcc,0x93f,0x157,0x11ac)](_0x18925a,_0x5b1e65))return _0x4b485e[_0x23937d(0x1974,0x2108,0x12ae,0x1e86)](_0xe33ce1,_0x313705(0x19cf,0x2536,0xcea,0x12ee)+_0x23937d(0x123a,0x212e,0xb03,0x1953)+_0x23937d(0x8da,0x160e,0x159,0xc6b)+_0x313705(0x147d,0xa40,0x1d91,0x17fc)+_0x313705(0x44a,0x127,-0x1b3,-0x581));if(!_0x1fb5ad[0x515+-0x80e+0x2fa])return _0x596953(_0x313705(0x110b,0x68b,0x1a4d,0x1d0c)+(_0x2b6719+_0x4f962d)+(_0x313705(0x1742,0xc14,0x240d,0x19c5)+_0x313705(0x1ba5,0x1a93,0x2520,0x13a5)+_0x313705(0x2166,0x19bf,0x2862,0x28b8)));_0x30f479(_0x2595a8[_0x23937d(0x14ce,0x1cc5,0x2057,0x1437)],_0x277cd0);let _0x38142c=_0x4b485e[_0x313705(0x1efa,0x240f,0x2057,0x16b5)](0xf7f5*0x1+0x1*-0xa0cd+0x6c28,_0x53677d);_0x4b485e[_0x23937d(0xeee,0x61a,0x15a7,0x9a8)](_0x1030c2,_0x3d4235[_0x313705(0x1834,0x19ee,0x234f,0xf69)],_0x38142c),_0x453d86(()=>{function _0x3ebc06(_0x585a3e,_0x4f4dea,_0x287b7d,_0x2c74f4){return _0x23937d(_0x287b7d-0x4d7,_0x585a3e,_0x287b7d-0x89,_0x2c74f4-0x177);}function _0x1efffb(_0x3ee716,_0x4ec903,_0x442637,_0x499d5f){return _0x23937d(_0x3ee716- -0x8a,_0x499d5f,_0x442637-0x6a,_0x499d5f-0x151);}_0x4b485e[_0x3ebc06(0x1da9,0x389,0xf5c,0x19fb)](_0x2b972b,_0x3ebc06(0xca8,0x759,0x778,-0x2eb)+_0x3ebc06(0x163b,0x725,0x1358,0xcf0)+'ul\x20✔️\x0a*Your'+'\x20Money*\x20:\x20'+_0x4b485e['tObhM'](_0x1b0575,_0x124afa[_0x1efffb(0x1444,0x10de,0x1c5a,0xd90)])+(_0x1efffb(0x1b3a,0x12a3,0x1ce1,0x2791)+_0x1efffb(0x8d6,0x13ad,0x1250,0x16bd)+_0x1efffb(0x1892,0x1f1e,0xf91,0x266d))+_0x4b485e['yXfGq'](_0x694a6d,_0xc93d11['sender']));},-0x190+-0xd94+0x16f4);}}break;case _0x4b485e[_0x313705(0x128f,0x84d,0x1c51,0x998)]:{if(_0x1bac1f)return _0x4b485e['DOdaQ'](_0x1db05d,mess[_0x23937d(0x61c,0xd9c,-0x571,0x1053)]);if(_0x1e03f5)return _0x4b485e[_0x313705(0x1bcf,0xe00,0x2504,0x207d)](_0x1db05d,mess[_0x23937d(0x5c0,0x30b,0xfa2,0xb3b)]);let _0x437a96=_0x313705(0x163a,0x224d,0x94a,0x1289)+'xtpro.me/c'+_0x23937d(0x712,-0x4cd,-0x2d0,0xc63)+_0x313705(0x1a9d,0x1ac3,0x1140,0xfdd)+_0x313705(0xc4f,0x604,0x33e,0x985)+'the-wall-1'+_0x23937d(0x206,-0x9ca,-0x9f,0x21d),_0x153039=await _0x4b485e[_0x23937d(0x465,0x62b,-0x9d9,0x2d6)](textpro,_0x437a96,q);_0x4b485e[_0x313705(0x1683,0x1be8,0x213d,0x12a5)](_0x1db05d,mess[_0x313705(0xc12,0x1807,0x1842,0xc10)]),console[_0x23937d(0xbc6,0xc4,0x12e0,0x4b2)](_0x153039);const _0x5c176d={};_0x5c176d[_0x23937d(0xa79,0xe37,-0x1fd,0x1362)]=_0x153039;const _0x434f9d={};_0x434f9d[_0x23937d(0x1c43,0xd75,0x2a9b,0x1a1d)]=_0x5c176d,_0x434f9d['caption']=''+mess[_0x23937d(0x968,0x147f,0xa2b,0x15f7)];const _0x32128a={};_0x32128a[_0x23937d(0x5dc,0x88f,-0x4dc,0x85f)]=_0x5cd288,_0x175756[_0x313705(0xcaa,0x125,0x1b01,0x3a0)+'e'](_0x423161,_0x434f9d,_0x32128a);}break;case _0x4b485e[_0x23937d(0x1519,0x19f5,0xf50,0x1773)]:{if(_0x1bac1f)return _0x4b485e[_0x313705(0x1c14,0x1083,0x1343,0x1d27)](_0x1db05d,mess[_0x313705(0x982,0xe37,-0x32e,0x17b2)]);if(_0x1e03f5)return _0x4b485e['nVWXZ'](_0x1db05d,mess['banChat']);let _0x173895=_0x23937d(0x12d4,0x1358,0x1248,0xf5f)+_0x313705(0x146c,0x1c16,0x1b23,0x10c5)+_0x23937d(0xf3b,0x1490,0x14ed,0x904)+_0x23937d(0x18e7,0x24ba,0x202a,0xc6d)+'fiti-text-'+_0x23937d(0x699,-0x6e1,-0x32e,0x651)+_0x23937d(0x20f,0x3fd,0xc23,0x7d)+_0x23937d(0x10ab,0x1d4d,0x1ccd,0x497),_0x56a433=await textpro(_0x173895,q);_0x4b485e[_0x313705(0x10e1,0xcf3,0xac6,0x1b9b)](_0x1db05d,mess[_0x23937d(0x8ac,0xee7,0xc58,-0x153)]),console[_0x23937d(0xbc6,-0x104,0x1795,0x1217)](_0x56a433);const _0x39b1d7={};_0x39b1d7[_0x23937d(0xa79,-0x42,0x8d5,0xf8)]=_0x56a433;const _0x192ed1={};_0x192ed1['image']=_0x39b1d7,_0x192ed1[_0x23937d(0x968,0x117,0x5c2,0x502)]=''+mess[_0x23937d(0x968,0xae2,0x1036,0x135f)];const _0x6499bb={};_0x6499bb[_0x313705(0x942,0x1c7,0xf58,0x11db)]=_0x5cd288,_0x175756[_0x313705(0xcaa,0x17a6,0xd76,0xc8c)+'e'](_0x423161,_0x192ed1,_0x6499bb);}break;case _0x313705(0x1f47,0x1eb4,0x2224,0x2e25)+'2':{if(_0x1bac1f)return _0x1db05d(mess[_0x23937d(0x61c,0x958,-0x224,-0x538)]);if(_0x1e03f5)return _0x4b485e[_0x313705(0xb9a,0x2a5,0x43,0x7f)](_0x1db05d,mess[_0x313705(0x926,0x13e6,-0x4d9,0x4fc)]);let _0x501fb1=_0x313705(0x163a,0x7a8,0x10a1,0x17ac)+_0x313705(0x1e80,0x2238,0x13f1,0x2320)+'nline-mult'+_0x313705(0x1cd3,0x1ea7,0x1051,0xfff)+_0x313705(0xbf5,0xaa2,0x13fb,0x2c4)+_0x313705(0x1183,0x14b4,0x1f96,0xf20)+_0x313705(0x7bb,0x771,0xa71,0x12d4)+'l',_0x59da21=await _0x4b485e[_0x313705(0xb2f,0x645,-0xe9,0xcf8)](textpro,_0x501fb1,q);_0x4b485e[_0x23937d(0xc8f,0x860,0xf63,0x1931)](_0x1db05d,mess[_0x313705(0xc12,0x154c,0xf1,-0x48)]),console[_0x313705(0xf2c,0x1426,0x14bc,0xe67)](_0x59da21);const _0x26c7f9={};_0x26c7f9['url']=_0x59da21;const _0x45a288={};_0x45a288[_0x23937d(0x1c43,0x1f92,0x24a6,0xe59)]=_0x26c7f9,_0x45a288['caption']=''+mess[_0x313705(0xcce,0x1aca,0xefc,0x2f6)];const _0x2a6bdf={};_0x2a6bdf[_0x23937d(0x5dc,-0x824,0x3e8,0xc6b)]=_0x5cd288,_0x175756['sendMessag'+'e'](_0x423161,_0x45a288,_0x2a6bdf);}break;case'batman':{if(_0x1bac1f)return _0x1db05d(mess[_0x313705(0x982,0x123f,0x469,-0x7e)]);if(_0x1e03f5)return _0x4b485e[_0x313705(0xca7,0x1618,0x12d4,-0x83)](_0x1db05d,mess['banChat']);let _0x28e5bd=_0x313705(0x163a,0x200f,0x135c,0x1675)+_0x23937d(0x18a6,0x22ea,0x1064,0x174e)+'ake-a-batm'+_0x23937d(0xd58,0x37a,0x1ad6,0x1757)+'line-free-'+'1066.html',_0x92516d=await textpro(_0x28e5bd,q);_0x1db05d(mess[_0x313705(0xc12,0x1421,0xe3,0x156)]),console[_0x313705(0xf2c,0x1cad,0x1d30,0x1e0)](_0x92516d);const _0x1082bd={};_0x1082bd[_0x313705(0xddf,0x1f0,0x98,0x1ae9)]=_0x92516d;const _0x2d079f={};_0x2d079f[_0x313705(0x1fa9,0x1a38,0x21cd,0x195e)]=_0x1082bd,_0x2d079f['caption']=''+mess['caption'];const _0x4551cd={};_0x4551cd['quoted']=_0x5cd288,_0x175756[_0x23937d(0x944,0xfe9,0x300,-0x465)+'e'](_0x423161,_0x2d079f,_0x4551cd);}break;case _0x4b485e[_0x313705(0x1084,0x627,0x1526,0x5d3)]:{if(_0x1bac1f)return _0x4b485e[_0x23937d(0xba5,0x1368,0x12ca,0x634)](_0x1db05d,mess['ban']);if(_0x1e03f5)return _0x1db05d(mess[_0x23937d(0x5c0,-0x632,0x720,0x976)]);let _0x334229='https://te'+_0x23937d(0x1adb,0x23fa,0x2088,0x292a)+_0x23937d(0x7e6,0x130,0x15f3,0x6f3)+'-text-effe'+_0x23937d(0x1b73,0xf49,0x1cde,0x2232)+'l',_0x319b4f=await _0x4b485e[_0x313705(0x1e0b,0x145c,0x2a3c,0x13de)](textpro,_0x334229,q);_0x4b485e[_0x313705(0xc88,0xf02,0x188b,0xe12)](_0x1db05d,mess[_0x313705(0xc12,0x733,-0x269,0x44c)]),console['log'](_0x319b4f);const _0x33ad11={};_0x33ad11[_0x23937d(0xa79,0xf2d,0x1223,0x6bc)]=_0x319b4f;const _0x3ff2e1={};_0x3ff2e1[_0x313705(0x1fa9,0x28a9,0x2037,0x29e5)]=_0x33ad11,_0x3ff2e1[_0x313705(0xcce,0x1027,-0x13e,0x1698)]=''+mess[_0x313705(0xcce,0x13b7,0x12ef,0x406)];const _0x5ee17a={};_0x5ee17a['quoted']=_0x5cd288,_0x175756[_0x23937d(0x944,0x1170,-0x150,0x96b)+'e'](_0x423161,_0x3ff2e1,_0x5ee17a);}break;case _0x23937d(0x61d,0xedc,0x797,-0x335):{if(_0x1bac1f)return _0x4b485e[_0x23937d(0x15cc,0xe8b,0x76b,0x9ac)](_0x1db05d,mess[_0x313705(0x982,0x1b4,0xbda,0x159)]);if(_0x1e03f5)return _0x4b485e[_0x313705(0x2073,0x17ae,0x2840,0x22e9)](_0x1db05d,mess[_0x313705(0x926,0x135b,-0x46b,0x1771)]);if(!q)return _0x4b485e[_0x23937d(-0x10,-0xef7,-0x199,0x980)](_0x1db05d,_0x23937d(0x363,0xe1b,-0x554,0x6f3)+_0x4b485e[_0x313705(0x165d,0xa69,0x139d,0x129f)](_0xe1d953,_0x1354e9)+_0x23937d(0x147e,0x17aa,0xc6f,0x2075));_0x4b485e[_0x313705(0xccc,0xddd,0x80c,0x7a9)](_0x1db05d,mess[_0x313705(0xc12,-0x1f2,0x1a5e,0x10d5)]),inilogo4=_0x1ba32f[_0x23937d(0x1c16,0xffa,0x246d,0x1844)]('\x20'),inilogo9=_0x1ba32f['join']('\x20');var _0x23b7d1=inilogo4['split']('|')[-0x1*-0x6e1+-0x520+-0x1c1*0x1],_0x20a23d=inilogo9[_0x313705(0x1035,0x1127,0xe18,0x10ae)]('|')[-0x58c+0x1*-0x1c58+0x1*0x21e5];let _0x40f127=await _0x4b485e['nWbeJ'](textpro,_0x23937d(0x12d4,0xd9f,0xca4,0x13ed)+_0x23937d(0x1106,0x94b,0x1ddb,0x1273)+'reate-3d-r'+'etro-text-'+_0x23937d(0x699,0x13fb,-0x228,-0x342)+'ine-free-1'+_0x313705(0x1ade,0x1418,0x2691,0x28f1),[''+_0x23b7d1,''+_0x20a23d]);console[_0x313705(0xf2c,0x9c,0x105f,0x98)](_0x40f127);const _0x4ec0b3={};_0x4ec0b3[_0x23937d(0xa79,0x196b,0xf28,0x6d9)]=_0x40f127;const _0x105574={};_0x105574[_0x313705(0x1fa9,0x19b9,0x1652,0x2124)]=_0x4ec0b3,_0x105574[_0x313705(0xcce,-0x229,-0x8b,0x1b2f)]=''+mess[_0x23937d(0x968,0x1375,0x12e3,0x1051)];const _0x1704f3={};_0x1704f3[_0x23937d(0x5dc,0xc93,0x2c9,0x3d0)]=_0x5cd288,_0x175756[_0x23937d(0x944,-0x3f9,-0x1dc,0x85)+'e'](_0x423161,_0x105574,_0x1704f3);}break;case _0x313705(0x1e06,0x263c,0x1317,0x18e0):{if(_0x1bac1f)return _0x4b485e['lKrkn'](_0x1db05d,mess[_0x23937d(0x61c,0x848,0x3a2,0x11ef)]);if(_0x1e03f5)return _0x4b485e[_0x23937d(0x16af,0x956,0x156f,0xee5)](_0x1db05d,mess[_0x313705(0x926,0xed4,0xfa1,0x78e)]);if(!q)return _0x4b485e[_0x313705(0x11f5,0x13da,0xc8c,0xa30)](_0x1db05d,'Example:\x20'+_0x4b485e[_0x23937d(0x1525,0xe26,0x147f,0xb51)](_0xe1d953,_0x1354e9)+_0x23937d(0x147e,0x1455,0x128f,0xd63));_0x1db05d(mess[_0x313705(0xc12,0x1279,0x492,0x47a)]),inilogo4=_0x1ba32f[_0x313705(0x1f7c,0x291b,0x2e8d,0x1fee)]('\x20'),inilogo9=_0x1ba32f[_0x313705(0x1f7c,0x1209,0x132e,0x1726)]('\x20');var _0x23b7d1=inilogo4[_0x23937d(0xccf,0x54e,-0x44,0x1b3f)]('|')[0x5d*0x36+0x1*-0xf6b+0x5*-0xd7],_0x20a23d=inilogo9[_0x23937d(0xccf,0x1b8b,0x3c4,0x1273)]('|')[-0x23d2+0x1*0xcbb+-0x1*-0x1718];let _0x20cd9b=await textpro(_0x4b485e[_0x313705(0x1f5d,0x2458,0x2178,0x2cfc)],[''+_0x23b7d1,''+_0x20a23d]);console[_0x313705(0xf2c,0x1016,0x1cbd,0x98a)](_0x20cd9b);const _0x1e95b6={};_0x1e95b6[_0x23937d(0xa79,0x14e,0xfd6,0xe22)]=_0x20cd9b;const _0x5dd583={};_0x5dd583[_0x313705(0x1fa9,0x1815,0x2dc0,0x29ae)]=_0x1e95b6,_0x5dd583[_0x23937d(0x968,0xaea,-0x2f1,0x68c)]=''+mess['caption'];const _0x1c7541={};_0x1c7541['quoted']=_0x5cd288,_0x175756['sendMessag'+'e'](_0x423161,_0x5dd583,_0x1c7541);}break;case _0x313705(0x1624,0xd0f,0x233a,0x20c5):{if(_0x1bac1f)return _0x4b485e['fPqiN'](_0x1db05d,mess[_0x23937d(0x61c,-0x36f,0x11ec,0x326)]);if(_0x1e03f5)return _0x4b485e[_0x23937d(0xab7,0x20a,-0x374,0x8a1)](_0x1db05d,mess[_0x23937d(0x5c0,0x7b,0x1038,-0x765)]);if(!q)return _0x4b485e[_0x313705(0xfc9,0x124d,0x1279,0xe4b)](_0x1db05d,_0x23937d(0x363,-0x87e,0x15a,-0x661)+_0x4b485e[_0x23937d(0xd28,0x1612,0x1571,0x134b)](_0xe1d953,_0x1354e9)+_0x313705(0x17e4,0x1702,0x11d1,0x17c7));_0x4b485e[_0x313705(0x1908,0x1c16,0x1e9c,0xdfd)](_0x1db05d,mess[_0x23937d(0x8ac,0x13dc,0xc79,0x2a8)]),inilogo4=_0x1ba32f[_0x313705(0x1f7c,0x1ad0,0x1a85,0x20f1)]('\x20'),inilogo9=_0x1ba32f[_0x313705(0x1f7c,0x2dd5,0x19b1,0x2994)]('\x20');var _0x23b7d1=inilogo4[_0x23937d(0xccf,0xd4b,0xa6b,0x8af)]('|')[0x1e78+0x18f3*0x1+0x3*-0x1279],_0x20a23d=inilogo9[_0x313705(0x1035,0xfef,0x84e,0xf16)]('|')[0x3f1*-0x1+-0xb*-0xcb+-0x4c7];let _0x112794=await _0x4b485e['LlDzW'](textpro,_0x4b485e['YuJxl'],[''+_0x23b7d1,''+_0x20a23d]);console['log'](_0x112794);const _0x285e96={};_0x285e96[_0x313705(0xddf,0x1293,0xce6,0x119a)]=_0x112794;const _0x5e9495={};_0x5e9495['image']=_0x285e96,_0x5e9495[_0x313705(0xcce,0x1a66,-0x10,0xe24)]=''+mess[_0x313705(0xcce,0x9a9,0x1953,0x786)];const _0x5974b4={};_0x5974b4['quoted']=_0x5cd288,_0x175756[_0x313705(0xcaa,0xfb1,0x287,0x11ce)+'e'](_0x423161,_0x5e9495,_0x5974b4);}break;case _0x4b485e['ZGDLI']:{if(_0x4b485e[_0x23937d(0x1b17,0x262b,0x1ec4,0x22db)](_0x4b485e[_0x313705(0x1813,0xf58,0x1dbd,0x1890)],_0x4b485e['MKdOa'])){const _0x129178={};_0x129178[_0x23937d(0x1d39,0x27ee,0x19cc,0x2782)]=''+_0x5d1226[_0x313705(0x14a6,0x166b,0x14b8,0x1ad6)];const _0x50256f={};_0x50256f[_0x23937d(0x5dc,0xe73,0x716,0xd43)]=_0x504b87,_0x4a64b9['sendMessag'+'e'](_0xdc24f2[_0x23937d(0x118c,0x1112,0x1afa,0x1dee)],_0x129178,_0x50256f);}else{if(_0x1bac1f)return _0x1db05d(mess['ban']);if(_0x1e03f5)return _0x4b485e[_0x313705(0x12a2,0x2117,0xff2,0x1602)](_0x1db05d,mess['banChat']);if(!_0x1ba32f[_0x313705(0x1f7c,0x1a76,0x26de,0x1a73)]('\x20'))return _0x4b485e['IUSaz'](_0x1db05d,_0x4b485e[_0x23937d(0x8a8,-0x39b,0xf43,0xf98)]);emoji[_0x23937d(0xc3d,-0xc9,0x7b,0x59)](_0x1ba32f[_0x313705(0x1f7c,0x22e6,0x1f43,0x1433)]('\x20'))[_0x313705(0x1ec7,0x1c51,0x1616,0x2120)](async _0x15b637=>{function _0x5e7666(_0x91e629,_0x1c209f,_0x54690e,_0x474e74){return _0x23937d(_0x91e629- -0x1d1,_0x54690e,_0x54690e-0x10b,_0x474e74-0x6a);}function _0x28642a(_0x383cdb,_0x32fa1e,_0x1d4a7e,_0x10d12f){return _0x23937d(_0x383cdb-0x250,_0x10d12f,_0x1d4a7e-0x1b7,_0x10d12f-0x1eb);}if(_0x4b485e[_0x28642a(0x1773,0x1ab5,0x17e4,0x1953)]!==_0x4b485e[_0x5e7666(0xe47,0x1483,0x82b,0x1a39)]){const _0xf30278={};_0xf30278[_0x5e7666(0x8a8,0x50c,0xb4b,-0x524)]=_0x15b637[_0x5e7666(0x10c5,0x17f5,0x1bf3,0x406)][0x684+-0x25a0+0xa6*0x30]['url'];const _0x255512={};_0x255512[_0x28642a(0x1e93,0x1967,0x1645,0x1ec4)]=_0xf30278,_0x255512['caption']=''+mess[_0x5e7666(0x797,-0x607,-0x155,0x1227)];let _0x333db3=await _0x175756[_0x5e7666(0x773,-0x106,-0x2c8,0x8fd)+'e'](_0x5cd288['chat'],_0x255512,{'quoted':_0x5cd288});const _0x2dca18={};_0x2dca18['text']=_0x4b485e[_0x5e7666(0x157,-0x559,-0xc10,-0xd1)];const _0x160b39={};_0x160b39[_0x28642a(0x82c,0x608,0xf24,0x3a5)]=_0x333db3,await _0x175756[_0x28642a(0xb94,0x11ab,0xbd0,0x1071)+'e'](_0x423161,_0x2dca18,_0x160b39);}else{const _0x3f677e={};_0x3f677e[_0x28642a(0x1f89,0x1471,0x1e53,0x2bc3)]='🥺',_0x3f677e['key']=_0x1d1807[_0x28642a(0xb9f,0x1405,0xe9,0x1517)];const _0x4412fb={};_0x4412fb['react']=_0x3f677e,_0x215a40[_0x28642a(0xb94,0xb40,0xfd2,0x1615)+'e'](_0x35a77b,_0x4412fb);const _0x37e374={};_0x37e374[_0x5e7666(0x1b68,0xf99,0x25ad,0x1270)]=''+_0xeac6c3[_0x28642a(0x11e0,0xe53,0x319,0x2093)];const _0x4085d9={};_0x4085d9[_0x5e7666(0x40b,-0x852,0x561,0x1112)]=_0x443ee9,_0x32a30b[_0x5e7666(0x773,0xb15,-0x7a3,0x1f9)+'e'](_0x526c1b['chat'],_0x37e374,_0x4085d9),_0x4002d1=_0x5de06d['readFileSy'+'nc']('./Android/'+'AllData/st'+_0x5e7666(0x10c8,0x1a0e,0x16c7,0xe93)+_0x5e7666(0x14e9,0x9b9,0x160c,0x16f1));const _0x275610={};_0x275610['sticker']=_0x5a0e14,_0x17e913[_0x28642a(0xb94,0x45a,0x1869,0xf40)+'e'](_0xd2fba8['chat'],_0x275610);}});}}break;case _0x4b485e['RrQVF']:case _0x23937d(0x4f1,0xdd9,0xf27,-0x3ee)+'moji':if(_0x1bac1f)return _0x4b485e[_0x313705(0xc74,0x2a6,0x1661,0x1b7a)](_0x1db05d,mess[_0x23937d(0x61c,0x38e,0x109,-0x2e6)]);if(_0x1e03f5)return _0x4b485e['BEOwR'](_0x1db05d,mess[_0x313705(0x926,0xefc,0x735,0x866)]);if(!q)return _0x4b485e[_0x313705(0x1f93,0x1a6f,0x1add,0x11d8)](_0x1db05d,_0x4b485e[_0x313705(0x1d40,0x279e,0x2200,0x11a5)](_0x23937d(0x597,0x108e,-0x4e3,0xdfd)+_0x313705(0x9d7,-0xee,0x64c,0x87b)+_0x23937d(0x15a3,0x1c49,0x151b,0xb46)+_0x313705(0x553,-0x75,0x312,-0x3ce),'\x20'+_0x4b485e['Ufuey'](_0xe1d953,_0x1354e9)+_0x313705(0x42c,0x401,-0x77a,-0x971)));_0x4b485e[_0x313705(0x1453,0xe29,0x5e5,0x14d7)](_0x1db05d,mess[_0x313705(0xc12,-0x130,0xde9,0x301)]),_0x4b485e[_0x313705(0x13ad,0x191c,0x106d,0x642)](_0x4e6285,q,'11');break;case _0x4b485e[_0x23937d(0x11e4,0x1999,0xdfc,0x1a4f)]:if(_0x1bac1f)return _0x4b485e['VjwPj'](_0x1db05d,mess[_0x313705(0x982,0x263,0x16e4,0x1053)]);if(_0x1e03f5)return _0x4b485e[_0x313705(0x117e,0x1b76,0x14b9,0x1ccb)](_0x1db05d,mess['banChat']);if(!q)return _0x1db05d(_0x23937d(0x597,0x704,0x1014,0x1330)+_0x313705(0x595,-0x842,0x1053,0x203)+_0x313705(0x1524,0x1717,0x1ef2,0x1e67)+('\x20'+_0x4b485e['ZkrXt'](_0xe1d953,_0x1354e9)+_0x313705(0x42c,0x959,0x1298,0xbc2)));_0x4b485e[_0x23937d(0x521,0xe16,0xd9e,0x1365)](_0x1db05d,mess[_0x23937d(0x8ac,0xe83,0xd2e,0x5f7)]),_0x4e6285(q,'0');break;case _0x4b485e[_0x313705(0xc04,0xce6,0x918,0x89b)]:if(_0x1bac1f)return _0x4b485e[_0x313705(0x147a,0x18b3,0x200c,0x13aa)](_0x1db05d,mess[_0x23937d(0x61c,0x372,0x140c,-0x25f)]);if(_0x1e03f5)return _0x1db05d(mess[_0x23937d(0x5c0,0x233,0xea7,-0x33b)]);if(!q)return _0x1db05d(_0x4b485e[_0x313705(0x17e9,0x1eb7,0x13eb,0x1ce1)](_0x23937d(0x597,0xccc,0xe26,0x107d)+'i,\x20max\x201\x20e'+_0x313705(0x1524,0x63c,0x810,0x1dff),'\x20'+_0x4b485e[_0x313705(0x11ec,0x14f0,0x148c,0x68c)](_0xe1d953,_0x1354e9)+_0x23937d(0xc6,0xac7,0x5fa,0x127)));_0x4b485e[_0x313705(0x13fc,0x531,0xdfc,0xeb1)](_0x1db05d,mess[_0x313705(0xc12,0x173d,0x12c,0x8fb)]),_0x4b485e[_0x313705(0xa3b,0x76,0xc78,0x93c)](_0x4e6285,q,'1');break;case _0x23937d(0x1bc2,0xd01,0x26b7,0xe19)+'ji':if(_0x1bac1f)return _0x4b485e['dxuoY'](_0x1db05d,mess[_0x23937d(0x61c,0x411,-0x262,-0x702)]);if(_0x1e03f5)return _0x4b485e[_0x313705(0x11ba,0x5fe,0x1bc1,0xce4)](_0x1db05d,mess[_0x313705(0x926,0x107d,0x843,0x1430)]);if(!q)return _0x4b485e['lmQqK'](_0x1db05d,_0x4b485e[_0x23937d(0x88a,0x119,-0xb7,0x173f)](_0x4b485e[_0x23937d(0x1b7d,0x1937,0x1439,0x2956)],'\x20'+(_0xe1d953+_0x1354e9)+_0x23937d(0xc6,0xabb,0xde4,-0xa7e)));_0x4b485e[_0x23937d(0x50f,-0x35f,0x810,-0x67b)](_0x1db05d,mess[_0x313705(0xc12,0xf1,0xc29,0xdd8)]),_0x4b485e[_0x23937d(0xfe0,0x10f0,0x931,0x1b01)](_0x4e6285,q,'2');break;case _0x4b485e['DKCiT']:if(_0x1bac1f)return _0x1db05d(mess[_0x313705(0x982,0x1036,0xaf9,0xa54)]);if(_0x1e03f5)return _0x1db05d(mess[_0x313705(0x926,0x2d,0x1d5,0x54a)]);if(!q)return _0x4b485e[_0x313705(0x1a78,0x2785,0x11e0,0x1880)](_0x1db05d,_0x4b485e[_0x313705(0x18d8,0x1f1a,0x102b,0x11e0)](_0x4b485e[_0x23937d(0x1b7d,0x178d,0x2226,0x1d3d)],'\x20'+_0x4b485e[_0x23937d(0x1960,0x20dc,0xe3e,0x1497)](_0xe1d953,_0x1354e9)+_0x23937d(0xc6,-0x8ae,0xcec,-0x86c)));_0x4b485e['GkvKG'](_0x1db05d,mess['wait']),_0x4b485e[_0x313705(0x13ad,0x97f,0x1b66,0x156b)](_0x4e6285,q,'3');break;case _0x313705(0x1b79,0x1ee2,0x23d5,0x177a)+_0x313705(0x1f5e,0x1e47,0x14f8,0x2616):if(_0x1bac1f)return _0x1db05d(mess[_0x313705(0x982,0x181,0x3f5,-0x36f)]);if(_0x1e03f5)return _0x1db05d(mess['banChat']);if(!q)return _0x4b485e[_0x313705(0x1a51,0x1f44,0x26cc,0x1843)](_0x1db05d,_0x4b485e[_0x313705(0x60f,0xb5b,0x1026,-0x639)](_0x4b485e[_0x23937d(0x1b7d,0x12bb,0x1d12,0x1593)],'\x20'+_0x4b485e[_0x313705(0x13bb,0x642,0xacc,0xf3b)](_0xe1d953,_0x1354e9)+_0x23937d(0xc6,0x9ad,-0x13e,-0x353)));_0x4b485e[_0x23937d(0x4b5,0xd22,0xefa,0x4f6)](_0x1db05d,mess[_0x313705(0xc12,0xd51,0xe07,0xaca)]),_0x4e6285(q,'4');break;case _0x313705(0xb6a,0x3e6,0x185d,-0x11a)+'ji':if(_0x1bac1f)return _0x4b485e['jCMer'](_0x1db05d,mess[_0x313705(0x982,0x1247,-0x1e1,0xde5)]);if(_0x1e03f5)return _0x4b485e[_0x23937d(0x1741,0x1cdb,0x1f1d,0x1973)](_0x1db05d,mess[_0x23937d(0x5c0,0x844,0x6fb,0xe56)]);if(!q)return _0x4b485e[_0x23937d(0x1681,0x1d48,0x1204,0x93c)](_0x1db05d,_0x313705(0x8fd,0x10cf,0x795,0xf9c)+_0x313705(0x595,-0x435,-0xa,0x142c)+_0x313705(0x1524,0x1380,0x22ed,0x1760)+('\x20'+_0x4b485e[_0x313705(0x1e17,0x1a2d,0x2a9d,0x2380)](_0xe1d953,_0x1354e9)+_0x23937d(0xc6,-0x772,0xfe4,-0x3ca)));_0x4b485e[_0x23937d(0xe4a,0x1331,0xc45,0x1cdc)](_0x1db05d,mess[_0x23937d(0x8ac,-0x5ee,0xf1,0x12f)]),_0x4e6285(q,'5');break;case _0x4b485e[_0x23937d(0xd90,0xda6,0xc02,0x13e6)]:case _0x4b485e[_0x313705(0x1fd9,0x2517,0x1576,0x293f)]:if(_0x1bac1f)return _0x4b485e['NAKhz'](_0x1db05d,mess[_0x313705(0x982,0xbfe,0x895,0x69f)]);if(_0x1e03f5)return _0x4b485e['hNwaH'](_0x1db05d,mess[_0x23937d(0x5c0,0xe0,-0x4c5,0xc7c)]);if(!q)return _0x4b485e[_0x23937d(0x5f5,0x4e1,0x2ff,-0x6c2)](_0x1db05d,_0x4b485e['yZCPC'](_0x313705(0x8fd,0x6f5,0xcf5,0x1a0)+'i,\x20max\x201\x20e'+_0x23937d(0x11be,0x1faa,0xe39,0xb62),'\x20'+_0x4b485e['pPsPl'](_0xe1d953,_0x1354e9)+_0x23937d(0xc6,0x3b6,0x8a,0xc20)));_0x1db05d(mess[_0x313705(0xc12,0x128f,0x275,0x9f3)]),_0x4b485e[_0x23937d(0x463,0xd65,0xfe0,-0x7d8)](_0x4e6285,q,'6');break;case _0x23937d(0x1512,0x1629,0x1380,0x2212):if(_0x1bac1f)return _0x4b485e[_0x313705(0x17ed,0x22d5,0x1ffc,0x1517)](_0x1db05d,mess['ban']);if(_0x1e03f5)return _0x4b485e[_0x23937d(0xcb4,0x1100,0x96e,0xcda)](_0x1db05d,mess['banChat']);if(!q)return _0x4b485e[_0x313705(0x887,0x8f7,0x17d,0x59c)](_0x1db05d,_0x4b485e[_0x313705(0xcd4,0x661,0x19e1,0xc04)](_0x4b485e[_0x313705(0x1ee3,0x1e93,0x2b8f,0x1e0f)],'\x20'+_0x4b485e['XrYCT'](_0xe1d953,_0x1354e9)+'\x20😀'));_0x4b485e[_0x23937d(0x16e,0x8a1,0xf1d,0x1be)](_0x1db05d,mess['wait']),_0x4e6285(q,'7');break;case _0x4b485e['KuFbr']:if(_0x1bac1f)return _0x1db05d(mess[_0x313705(0x982,-0x3aa,0x5d5,0x129b)]);if(_0x1e03f5)return _0x4b485e['Urfkt'](_0x1db05d,mess[_0x23937d(0x5c0,0xe5,0x1313,0x111)]);if(!q)return _0x4b485e[_0x313705(0x1d47,0xf91,0x2afa,0x1e1e)](_0x1db05d,_0x4b485e[_0x313705(0x1c29,0x1e3c,0x1c3c,0x1945)](_0x4b485e[_0x23937d(0x1b7d,0x2838,0x151e,0x146d)],'\x20'+_0x4b485e[_0x313705(0x1904,0xbb8,0xfa2,0x20fc)](_0xe1d953,_0x1354e9)+_0x313705(0x42c,0x9b9,-0x7a4,-0x8d0)));_0x1db05d(mess[_0x23937d(0x8ac,-0x5a1,0x127d,0xecf)]),_0x4b485e[_0x313705(0x1c9e,0x17f4,0x21d9,0x24f7)](_0x4e6285,q,'8');break;case _0x4b485e['VXdpK']:if(_0x1bac1f)return _0x4b485e[_0x313705(0x18ef,0x23ac,0x1f28,0x1546)](_0x1db05d,mess['ban']);if(_0x1e03f5)return _0x4b485e['iIfhf'](_0x1db05d,mess[_0x23937d(0x5c0,0xb7a,0x22f,0x1485)]);if(!q)return _0x1db05d(_0x4b485e[_0x313705(0xd57,0x640,0x853,0x1a49)](_0x313705(0x8fd,-0xdd,0xed8,0xb3)+_0x23937d(0x22f,0x1dd,0x7d5,0x379)+_0x23937d(0x11be,0x1f95,0x1000,0x1baa),'\x20'+_0x4b485e['nzgVF'](_0xe1d953,_0x1354e9)+_0x313705(0x42c,-0x447,0xf60,-0x4d1)));_0x4b485e['Urfkt'](_0x1db05d,mess[_0x313705(0xc12,0x141,0x11ae,0xd2a)]),_0x4b485e['IYXQq'](_0x4e6285,q,'9');case _0x4b485e[_0x23937d(0x39f,0x382,0x3cc,-0x4db)]:if(_0x1bac1f)return _0x4b485e['cOojt'](_0x1db05d,mess[_0x23937d(0x61c,0xb4,0x5e,0x2b4)]);if(_0x1e03f5)return _0x1db05d(mess['banChat']);if(!q)return _0x4b485e[_0x313705(0xfd5,0xd02,0x2b5,0x56a)](_0x1db05d,_0x4b485e[_0x23937d(0x1da6,0x2174,0x159c,0x1fa6)](_0x4b485e[_0x313705(0x1ee3,0x1cd5,0x1634,0x2065)],'\x20'+_0x4b485e[_0x23937d(0x2d7,0xb,0x316,0x15)](_0xe1d953,_0x1354e9)+'\x20😀'));_0x4b485e['zwfTF'](_0x1db05d,mess[_0x313705(0xc12,0x41,0x86a,0x18a0)]),_0x4b485e['LMTnC'](_0x4e6285,q,'10');break;case _0x4b485e['KrLfh']:{if(_0x1bac1f)return _0x4b485e[_0x313705(0x1d7a,0x1357,0x25f1,0x1f42)](_0x1db05d,mess[_0x313705(0x982,0xd30,0x10c1,0xa09)]);if(_0x1e03f5)return _0x1db05d(mess[_0x23937d(0x5c0,-0x389,0x41b,-0x1d7)]);if(!q)_0x1db05d(_0x23937d(0x13b8,0xca0,0x4e9,0x13b9)+'*\x20'+_0x4b485e[_0x313705(0x111a,0x7b9,0x1688,0x1243)](_0xe1d953,_0x1354e9)+'\x20🦄+🤣');let [_0x3da8bd,_0xe814b6]=q[_0x313705(0x1035,0x1d69,0x7de,0x872)]`+`,_0x116b8e=await _0x4b485e['tObhM'](fetchJson,_0x313705(0x163a,0x11c8,0x968,0x12b7)+'nor.google'+_0x313705(0x191e,0x12d6,0xc66,0xbf5)+_0x23937d(0xee1,0x1732,0x715,0x16ef)+'?key=AIzaS'+'yAyimkuYQY'+_0x313705(0xa89,0x138a,0x379,0xd39)+_0x23937d(0x11ef,0x933,0x8eb,0xf4e)+_0x313705(0xb69,0x888,-0x90,0x139e)+_0x313705(0xaff,-0x87,0xda9,0xe39)+_0x23937d(0x11fd,0x91b,0x1064,0x5bd)+_0x313705(0x12e4,0x939,0x1f5d,0x6b8)+_0x313705(0x6cd,0xeb,0x1168,0x428)+'nt&compone'+_0x23937d(0x12fa,0x1f90,0xda7,0x10b2)+_0x23937d(0x1d89,0x177b,0x1e12,0x2898)+_0x313705(0x1988,0x16b0,0x2082,0x2897)+_0x313705(0x18fd,0x17e9,0x2438,0x10ef)+_0x313705(0x8de,-0x145,0x727,0x78f)+_0x4b485e[_0x23937d(0x80e,0x1033,-0x24,0x13d9)](encodeURIComponent,_0x3da8bd)+'_'+_0x4b485e['oyyPs'](encodeURIComponent,_0xe814b6));for(let _0x5a171a of _0x116b8e[_0x23937d(0xc83,-0x21,0xa73,-0x1e7)]){let _0x235bbb=await _0x175756[_0x313705(0x49d,0xf10,-0x772,0x7d1)+_0x313705(0x155f,0x66e,0xed6,0x1e25)](_0x423161,_0x5a171a[_0x313705(0xddf,0x1a8d,0x1a9d,0x1be9)],_0x5cd288,{'packname':global[_0x23937d(0x83d,0xa86,-0x1a9,0xb71)],'author':global[_0x313705(0xa17,0x1162,-0x1d6,0x447)],'categories':_0x5a171a[_0x313705(0xf6e,0x183a,0x41b,0x1169)]});await fs['unlinkSync'](_0x235bbb);}}break;case _0x313705(0x1f67,0x10bd,0x1ef4,0x2888):case _0x4b485e[_0x23937d(0xdca,-0x13d,0x19db,0x19be)]:{if(_0x1bac1f)return _0x1db05d(mess[_0x313705(0x982,0x202,0x114a,-0xbc)]);if(_0x1e03f5)return _0x4b485e[_0x23937d(0xf13,0x1d75,0xfc2,0xaa)](_0x1db05d,mess[_0x23937d(0x5c0,-0x33c,0x3f2,0x11bf)]);if(!_0x5cd288[_0x313705(0x942,0x15ec,0xf1b,-0x185)])return _0x1db05d(_0x4b485e[_0x23937d(0x1d80,0x1eb0,0x2102,0x19f4)]);if(!/webp/[_0x313705(0x1c74,0x1cdf,0x18b2,0x28cf)](_0x2a2351))return _0x1db05d(_0x313705(0x145c,0x7c5,0x151b,0x165e)+_0x23937d(0x17e2,0x1637,0x1c3b,0x11c1)+_0x23937d(0x97a,0x131d,0xd35,-0x1c3)+_0x4b485e[_0x313705(0xdb6,0x9f3,0x15b7,-0x14)](_0xe1d953,_0x1354e9)+'*');_0x4b485e[_0x23937d(0x1d4e,0x1b31,0x116c,0x2907)](_0x1db05d,mess[_0x313705(0xc12,0x7d6,0x1012,0x17a2)]);let _0x24767f=await _0x175756[_0x23937d(0xdcf,0xa53,0xb8f,0x1747)+'dSaveMedia'+'Message'](_0x3e5ec4),_0x4dd384=await _0x4b485e['CfbNa'](getRandom,_0x4b485e[_0x23937d(0x27e,-0x498,-0x6ba,0x101e)]);_0x4b485e[_0x23937d(0x2d8,0x80,0x4b4,0xbdc)](exec,_0x313705(0x1d90,0x104c,0x2a17,0x21f9)+_0x24767f+'\x20'+_0x4dd384,_0x5058be=>{function _0x2d0d61(_0x1a52f3,_0x137342,_0x4cce8f,_0x341dba){return _0x313705(_0x1a52f3- -0x11b,_0x4cce8f,_0x4cce8f-0x152,_0x341dba-0xb2);}function _0x118115(_0x51d0bf,_0xa5d57e,_0x1317d6,_0x939735){return _0x23937d(_0xa5d57e-0x3ea,_0x939735,_0x1317d6-0xc8,_0x939735-0xed);}if(_0x4b485e[_0x2d0d61(0x2bf,-0x9e8,-0x250,-0x8c)](_0x4b485e[_0x2d0d61(0x12ea,0x1830,0x1700,0xf62)],_0x4b485e[_0x118115(-0x7f,0xa26,0xd9b,0xec3)])){fs[_0x2d0d61(0x256,0x6db,0x3e3,-0x112)](_0x24767f);if(_0x5058be)throw _0x5058be;let _0x36602b=fs[_0x118115(0x2155,0x17a7,0x2621,0x1a8c)+'nc'](_0x4dd384);const _0x3a8a44={};_0x3a8a44[_0x118115(0x1694,0x202d,0x12de,0x190e)]=_0x36602b,_0x175756[_0x2d0d61(0xb8f,0xf5b,0x288,0xde3)+'e'](_0x5cd288['chat'],_0x3a8a44,{'quoted':_0x5cd288}),fs[_0x2d0d61(0x256,-0xa66,0xddc,-0xa7f)](_0x4dd384);}else{const _0x46f50c={};_0x46f50c['text']=''+_0xd2b253[_0x118115(0xa5,0x580,-0x5a5,0x2eb)];const _0x4b1517={};_0x4b1517[_0x118115(0x163c,0x9c6,0x14b1,0x1815)]=_0x162a9a,_0x1471b0[_0x118115(0xe92,0xd2e,-0xa0,0xaa6)+'e'](_0x8c3638[_0x118115(0x1103,0x1576,0x21a6,0x1f8f)],_0x46f50c,_0x4b1517),_0x3fa73b=_0x596490[_0x2d0d61(0x1608,0x21b2,0xf95,0x20c0)+'nc'](_0x118115(0x1518,0xf05,0x1e1e,0x2cb)+_0x118115(0xb73,0x19fd,0x28f1,0x260f)+_0x2d0d61(0x8d9,0x1ca,0xa1f,0x113a)+'.webp');const _0x1d891e={};_0x1d891e['sticker']=_0x1c40f1,_0x167e91[_0x2d0d61(0xb8f,0x2b3,0x145f,0x1699)+'e'](_0x2b6795[_0x2d0d61(0x13d7,0x1993,0x1014,0x56e)],_0x1d891e);}});}break;case _0x4b485e[_0x313705(0xd51,0x1a30,0x876,0x1168)]:case _0x4b485e['yTwyT']:{if(_0x4b485e['XnVRQ'](_0x4b485e[_0x313705(0xea5,0x14c1,0x1bed,0x3e0)],_0x4b485e[_0x23937d(0x1338,0x1455,0x15f1,0x1494)]))return _0x4b485e[_0x23937d(0x705,0x9dc,0x1435,0x1619)];else{if(_0x1bac1f)return _0x4b485e[_0x313705(0xe67,0x1bf6,0x12ff,0xf95)](_0x1db05d,mess['ban']);if(_0x1e03f5)return _0x4b485e[_0x23937d(0x173a,0x148f,0xbdf,0xade)](_0x1db05d,mess[_0x313705(0x926,0x10ef,0xf78,-0x3e4)]);if(!_0x5cd288['quoted'])return _0x4b485e[_0x313705(0x1eda,0x2bd3,0x2a27,0x153e)](_0x1db05d,_0x23937d(0xe0f,0xd07,0x17db,0x10e5)+'e');if(!/webp/['test'](_0x2a2351))return _0x4b485e[_0x23937d(0x1dcb,0x1181,0x160e,0x142f)](_0x1db05d,_0x23937d(0x10f6,0xbbd,0x10a7,0x14ec)+_0x23937d(0x17e2,0x215e,0x167a,0xf59)+_0x313705(0xce0,0x695,0x13a,0x5af)+_0x4b485e[_0x313705(0x121e,0x585,0x605,0x1c49)](_0xe1d953,_0x1354e9)+'*');_0x1db05d(mess[_0x23937d(0x8ac,0x24d,0x1207,0x2da)]);let {webp2mp4File:_0x36b8ae}=_0x4b485e['Taidi'](require,_0x4b485e[_0x23937d(0x1686,0x1c9c,0xfeb,0xf56)]),_0x1c0175=await _0x175756['downloadAn'+_0x313705(0x11ae,0x1fcc,0x15b4,0xa7b)+_0x23937d(0xe14,0x175,0xc0e,0x1106)](_0x3e5ec4),_0x5ac949=await _0x4b485e[_0x23937d(0x184b,0xfa2,0x1a0d,0xc3f)](_0x36b8ae,_0x1c0175);const _0x50cc95={};_0x50cc95[_0x23937d(0xa79,0xdd,0xddc,-0x2fd)]=_0x5ac949['result'],_0x50cc95[_0x313705(0xcce,0x93d,0xa48,0xd36)]=_0x4b485e['cbpXK'];const _0x1fdc58={};_0x1fdc58['video']=_0x50cc95,await _0x175756[_0x23937d(0x944,0x146b,0xb31,0xff7)+'e'](_0x5cd288[_0x313705(0x14f2,0x98d,0x1901,0x1225)],_0x1fdc58,{'quoted':_0x5cd288}),await fs[_0x313705(0x371,0xbd5,0xc92,-0x656)](_0x1c0175);}}break;case _0x4b485e['IgBdT']:case _0x4b485e['XHxiS']:{if(_0x1bac1f)return _0x1db05d(mess[_0x313705(0x982,0xb52,0x1660,0x51f)]);if(_0x1e03f5)return _0x4b485e[_0x23937d(0x12ff,0x16c3,0x1358,0xd9d)](_0x1db05d,mess[_0x23937d(0x5c0,0xe58,0x1179,-0x34f)]);if(!/video/[_0x23937d(0x190e,0x1da2,0x2538,0xe43)](_0x2a2351)&&!/audio/[_0x313705(0x1c74,0x1e61,0x181c,0x1d17)](_0x2a2351))return _0x4b485e[_0x313705(0x375,0x11b9,0xe8a,-0x3ea)](_0x1db05d,_0x23937d(0xf0d,0xd5f,0x173e,0xd4a)+_0x23937d(0x894,0x1052,0xc8,0x1159)+'io\x20You\x20Wan'+_0x313705(0x1246,0xb0c,0x496,0x1822)+_0x313705(0x1a19,0x1998,0x1faa,0x132a)+_0x23937d(0x14ba,0x16a0,0x139d,0x19a6)+'\x20'+(_0xe1d953+_0x1354e9));if(!_0x5cd288['quoted'])return _0x4b485e[_0x313705(0x12b0,0x1f34,0x931,0x2107)](_0x1db05d,_0x23937d(0xf0d,0x924,0x19ec,0x1b58)+_0x23937d(0x894,0x3d3,0x114d,0x12ef)+'io\x20You\x20Wan'+_0x23937d(0xee0,0xa98,0x106e,0x1c2c)+_0x23937d(0x16b3,0x943,0x2085,0x137e)+_0x313705(0x1820,0x1514,0x1adf,0x2398)+'\x20'+_0x4b485e[_0x313705(0xbf0,0x415,0x13b1,0xc91)](_0xe1d953,_0x1354e9));_0x4b485e[_0x23937d(0x1993,0x256a,0xd0c,0xc21)](_0x1db05d,mess['wait']);let _0x19c571=await _0x3e5ec4['download'](),{toAudio:_0x27420f}=_0x4b485e['JPezJ'](require,_0x4b485e[_0x313705(0xf97,0xc1,0x1658,0x1595)]),_0xeac9c=await _0x4b485e['hIfRN'](_0x27420f,_0x19c571,_0x4b485e[_0x23937d(0xb8c,0xa5c,0x3e2,0x15a)]);const _0x4bed8e={};_0x4bed8e[_0x23937d(0x1328,0x7de,0x91a,0x128a)]=_0xeac9c,_0x4bed8e[_0x23937d(0x12aa,0xc98,0x1112,0x5f7)]='audio/mpeg',_0x175756['sendMessag'+'e'](_0x5cd288[_0x23937d(0x118c,0x17c1,0x1cea,0xef3)],_0x4bed8e,{'quoted':_0x5cd288});}break;case _0x4b485e[_0x23937d(0x1c4c,0x25a1,0x228f,0x1dab)]:{if(_0x1bac1f)return _0x4b485e[_0x313705(0xcc5,0xf90,0x12ed,0xf3e)](_0x1db05d,mess[_0x313705(0x982,0x108,0xd72,-0x90)]);if(_0x1e03f5)return _0x4b485e[_0x313705(0x125b,0x160e,0x48e,0x1b32)](_0x1db05d,mess[_0x313705(0x926,0x3fd,0x1688,0x1214)]);if(/document/[_0x23937d(0x190e,0x1aac,0x281e,0x1b7c)](_0x2a2351))return _0x4b485e['ITZqM'](_0x1db05d,_0x23937d(0xf0d,0xbd3,0x7fd,0x138b)+'\x20Video/Aud'+_0x313705(0x1207,0x11f4,0x460,0x8b4)+_0x23937d(0x768,0x1376,0x3c7,0x7bd)+_0x23937d(0x487,0xb21,0x3c4,0xf09)+_0x313705(0x1cf6,0xe83,0x2b4a,0x29ac)+_0x23937d(0x19d5,0x24f7,0x1e8b,0x2213)+_0x4b485e['DyesE'](_0xe1d953,_0x1354e9));if(!/video/[_0x313705(0x1c74,0x11b2,0xf78,0x14e2)](_0x2a2351)&&!/audio/[_0x23937d(0x190e,0x256d,0x2036,0xb77)](_0x2a2351))return _0x4b485e[_0x313705(0x2100,0x2dd4,0x14f8,0x2c27)](_0x1db05d,_0x23937d(0xf0d,0xe39,0x662,0x199)+_0x23937d(0x894,-0x4be,0xaf,0x8ee)+_0x23937d(0xea1,0x132f,0x1bb2,0x1b36)+_0x313705(0xace,0x1647,0x288,-0x2ef)+_0x313705(0x7ed,0x473,0x1632,0x10d2)+_0x23937d(0x1990,0x1f8b,0x203d,0x164b)+_0x23937d(0x19d5,0x27b1,0x24bb,0x232f)+_0x4b485e[_0x23937d(0x1bc8,0x2521,0x18b3,0x1f72)](_0xe1d953,_0x1354e9));if(!_0x5cd288[_0x313705(0x942,0x15ce,0xa3a,0x91a)])return _0x4b485e[_0x23937d(0x143b,0x12da,0x669,0xd8a)](_0x1db05d,_0x23937d(0xf0d,0x1738,0x502,0x6eb)+_0x313705(0xbfa,0x1a36,0x265,0x158e)+_0x23937d(0xea1,0x165f,0x695,0x128c)+_0x23937d(0x768,0xa88,0x7a,0x6db)+'rt\x20Into\x20MP'+'3\x20With\x20Cap'+_0x23937d(0x19d5,0x10ae,0x165c,0x27cb)+_0x4b485e[_0x23937d(0xfad,0xee7,0x128a,0x15a5)](_0xe1d953,_0x1354e9));_0x4b485e[_0x23937d(0x13e1,0x824,0x1aca,0x5f8)](_0x1db05d,mess[_0x23937d(0x8ac,0x24b,0x12a1,0x16e5)]);let _0x3d5ad0=await _0x3e5ec4['download'](),{toAudio:_0x3d0f86}=_0x4b485e['iJsxG'](require,_0x4b485e['vXbit']),_0x48489e=await _0x4b485e[_0x313705(0x1e1d,0x2464,0xff6,0x1e9b)](_0x3d0f86,_0x3d5ad0,_0x4b485e[_0x313705(0xef2,0xfcc,0x39c,0xe14)]);_0x175756[_0x313705(0xcaa,0x11e1,0x161d,0x913)+'e'](_0x5cd288['chat'],{'document':_0x48489e,'mimetype':_0x4b485e['VAalU'],'fileName':_0x313705(0x208c,0x1980,0x2143,0x26f2)+_0x23937d(0x11e6,0x108b,0xf14,0x1850)+_0x175756['user'][_0x23937d(0x1451,0x91c,0x17e8,0x1b64)]+'\x20('+_0x5cd288['id']+').mp3'},{'quoted':_0x5cd288});}break;case _0x4b485e[_0x313705(0x552,0xcf5,0xcf9,-0x1ee)]:case _0x313705(0x8a6,-0x30e,0x1252,-0x1ea):{if('UQhls'!==_0x4b485e[_0x313705(0x7f7,0xbaf,-0x29,0x13fa)]){const _0x5006bb={};_0x5006bb[_0x313705(0x209f,0x28b8,0x14db,0x2d61)]=''+_0x1f7235[_0x23937d(0x1cab,0x1049,0x158d,0x1195)];const _0x3fe007={};_0x3fe007[_0x23937d(0x5dc,-0x2e9,0x1fa,0x961)]=_0x5a6ec4,_0x155b94['sendMessag'+'e'](_0x2afa9d[_0x23937d(0x118c,0x17ca,0x1930,0x977)],_0x5006bb,_0x3fe007);}else{if(_0x1bac1f)return _0x4b485e['Pspzu'](_0x1db05d,mess[_0x313705(0x982,0xda1,0x109e,0xd1e)]);if(_0x1e03f5)return _0x1db05d(mess[_0x23937d(0x5c0,0x11ec,-0x4f9,0x1042)]);if(!/video/[_0x313705(0x1c74,0x1723,0x2720,0x233c)](_0x2a2351)&&!/audio/[_0x313705(0x1c74,0x15ae,0x1803,0x1078)](_0x2a2351))return _0x4b485e[_0x23937d(0xa4b,-0x4b0,0xfd9,0x10c3)](_0x1db05d,_0x23937d(0xa3c,0x17c,-0x316,0xcae)+'o/Audio\x20Th'+'at\x20You\x20Wan'+_0x313705(0x7cc,-0x749,0x1188,0x9f)+'\x20With\x20Capt'+_0x23937d(0xa8d,0x1476,0xb5d,0x125c)+(_0xe1d953+_0x1354e9));if(!_0x5cd288[_0x23937d(0x5dc,0x13da,-0x535,0x5c9)])return _0x4b485e[_0x23937d(0x194f,0x1321,0xd81,0x1f84)](_0x1db05d,_0x23937d(0xa3c,0x9b2,0x18d8,0x155)+_0x23937d(0x15ff,0x84a,0xabe,0x1700)+_0x313705(0x1f4e,0x1627,0x1439,0x2292)+_0x23937d(0x466,0xdc1,-0x3f1,0x34c)+_0x23937d(0x57b,-0x4cb,0xd4f,0xa24)+_0x313705(0xdf3,0x1d13,0x13c1,0x12f1)+(_0xe1d953+_0x1354e9));_0x1db05d(mess[_0x313705(0xc12,0xe64,0x842,0x244)]);let _0x462dcd=await _0x3e5ec4[_0x313705(0x1d1f,0x1ef4,0x1c7e,0x121a)](),{toPTT:_0x250046}=_0x4b485e[_0x313705(0x81b,-0x5f3,0xd8a,0x838)](require,'./lib/conv'+_0x23937d(0x254,0xb8,0xfb6,0xc7e)),_0x212143=await _0x4b485e[_0x23937d(0x1526,0x1b3d,0x2098,0xeac)](_0x250046,_0x462dcd,_0x4b485e[_0x23937d(0xb8c,0xd90,0x5b4,-0x32e)]);const _0xd29575={};_0xd29575[_0x23937d(0x1328,0x1c2e,0x83e,0x1f55)]=_0x212143,_0xd29575[_0x313705(0x1610,0x9c9,0x13f7,0x2050)]=_0x4b485e[_0x313705(0x1d1e,0xf62,0x2249,0x2125)],_0xd29575[_0x313705(0xf3f,0x1846,0x14b1,0x1518)]=!![],_0x175756['sendMessag'+'e'](_0x5cd288[_0x313705(0x14f2,0xb2a,0x1050,0xb8b)],_0xd29575,{'quoted':_0x5cd288});}}break;case _0x4b485e['HEVSJ']:{if(_0x4b485e['ICwro'](_0x4b485e['tfBEV'],_0x4b485e[_0x23937d(0x1763,0x1401,0x923,0x14cb)]))_0x2d0097['templateIm'+_0x23937d(0x17b0,0x1a35,0x1a61,0x23bf)]=!![],_0x367402['templateVi'+_0x23937d(0x22c,-0x61a,0xa13,0x789)]=![],_0x58301c[_0x23937d(-0x1e,0x18,-0x237,0xa74)+'f']=![],_0x119c8a[_0x23937d(0x1972,0x1957,0xac9,0x2630)+'g']=![],_0x3055db[_0x313705(0xd6d,0x4e5,0x193d,0x3a5)+_0x313705(0x193b,0x18ac,0xe40,0x2488)]=![],_0x4b485e[_0x23937d(0x1644,0x104c,0xab1,0xe86)](_0x5dbf97,_0x5cecdf[_0x313705(0x183b,0x2186,0x2442,0x2395)]);else{if(_0x1bac1f)return _0x4b485e['lzNkn'](_0x1db05d,mess['ban']);if(_0x1e03f5)return _0x4b485e['PaDkG'](_0x1db05d,mess[_0x23937d(0x5c0,-0x118,0xf4,-0x382)]);if(!_0x5cd288[_0x313705(0x942,0xb2,0xfbf,0x126)])return _0x4b485e[_0x313705(0x1c5e,0x14e9,0x1b2a,0x1ed2)](_0x1db05d,_0x4b485e[_0x23937d(0x1d80,0x27a7,0x1014,0x2783)]);if(!/webp/[_0x23937d(0x190e,0x1460,0xc64,0x17a6)](_0x2a2351))return _0x4b485e[_0x313705(0x823,-0x3ed,0x1603,0x13d5)](_0x1db05d,_0x313705(0x145c,0x1637,0xf97,0x1109)+_0x23937d(0x17e2,0x22c4,0xdb2,0xf11)+_0x313705(0xce0,0x1387,0xdde,0x1972)+_0x4b485e[_0x313705(0x1a41,0x136a,0x1404,0x11b0)](_0xe1d953,_0x1354e9)+'*');_0x4b485e[_0x313705(0xfc9,0x352,0x16bf,0x18a4)](_0x1db05d,mess[_0x23937d(0x8ac,0xfe6,0xbea,0x99c)]);let {webp2mp4File:_0x396535}=_0x4b485e[_0x23937d(0xfd,-0x447,-0xaee,0x1bf)](require,_0x4b485e['hnlnL']),_0x1d9122=await _0x175756['downloadAn'+'dSaveMedia'+_0x23937d(0xe14,0xeea,0x1255,0x681)](_0x3e5ec4),_0x219aa5=await _0x4b485e[_0x313705(0xfe2,0x10db,0xc84,0x1db0)](_0x396535,_0x1d9122);const _0xa5a06b={};_0xa5a06b[_0x313705(0xddf,0x587,0x1686,0x1b1)]=_0x219aa5[_0x313705(0x1c63,0x2b16,0x168b,0x20a6)],_0xa5a06b[_0x313705(0xcce,0x614,0xf8d,0xed9)]=_0x4b485e[_0x313705(0x1f00,0x2548,0x13b4,0x1d7d)];const _0x25b50a={};_0x25b50a['video']=_0xa5a06b,_0x25b50a[_0x23937d(0x1bb8,0x29b3,0xd48,0x1dc0)+'k']=!![],await _0x175756[_0x23937d(0x944,0x13,0x1101,0x161e)+'e'](_0x5cd288[_0x313705(0x14f2,0x1e9f,0x1dae,0xd68)],_0x25b50a,{'quoted':_0x5cd288}),await fs[_0x313705(0x371,0x497,0x1142,-0xa01)](_0x1d9122);}}break;case _0x4b485e[_0x313705(0xfb6,0x686,0xb1,0xe4f)]:{if(_0x4b485e[_0x23937d(0x10d8,0x1078,0x19af,0x4ed)](_0x4b485e[_0x23937d(0xbf3,-0xba,0x772,0x1487)],'DRfnv')){if(_0x1bac1f)return _0x4b485e['eKJmJ'](_0x1db05d,mess[_0x23937d(0x61c,-0x729,0xade,0x10a1)]);if(_0x1e03f5)return _0x4b485e[_0x23937d(0x17ce,0x2384,0x1b69,0xdbc)](_0x1db05d,mess[_0x23937d(0x5c0,0xbcb,0xa63,0x3e2)]);_0x1db05d(mess['wait']);let {UploadFileUgu:_0x2509c6,webp2mp4File:_0x4ec64b,TelegraPh:_0x44618a}=_0x4b485e[_0x23937d(0x1400,0x1fa1,0x1a4f,0x13cc)](require,_0x4b485e[_0x313705(0x19ec,0x141d,0x2592,0x2064)]),_0x1a0167=await _0x175756[_0x23937d(0xdcf,0xe30,0x129e,0x1b27)+'dSaveMedia'+'Message'](_0x3e5ec4);if(/image/[_0x23937d(0x190e,0x1d9a,0x1f16,0x225c)](_0x2a2351)){let _0x10352b=await _0x44618a(_0x1a0167);_0x4b485e[_0x23937d(0x148e,0xe87,0x79a,0x5c5)](_0x1db05d,util['format'](_0x10352b));}else{if(!/image/[_0x23937d(0x190e,0xb5b,0x180c,0x197b)](_0x2a2351)){if(_0x4b485e[_0x313705(0x1380,0x17ab,0xa73,0x12c6)](_0x4b485e['OrhnY'],_0x4b485e['BXHKb']))return _0x38c487['total']=_0x819dd9[_0x23937d(0x1a9a,0x1feb,0x2413,0x1937)](_0x11520c[_0x313705(0x79b,-0x262,0xcb9,0x3ef)])[_0x313705(0x1e9e,0x1d50,0xfb0,0x1f2d)]((_0x1b6ddf,_0x5aea15)=>_0x1b6ddf+_0x571947[_0x313705(0x79b,-0x147,0x81,0x953)][_0x5aea15],0x8bf+0x1098+0x1f3*-0xd),_0x44afe6;else{let _0x23b852=await _0x4b485e[_0x23937d(0x19ff,0x1d16,0xd70,0x2352)](_0x2509c6,_0x1a0167);_0x4b485e[_0x313705(0x1b43,0xf2b,0x1bf7,0x292d)](_0x1db05d,util[_0x313705(0x1b6c,0x2054,0x1b70,0x23ae)](_0x23b852));}}}await fs[_0x23937d(0xb,0x762,-0x85f,-0xcfc)](_0x1a0167);}else _0xdad37b=_0x2b5de5[_0x313705(0xfea,0x1b06,0xb35,0x6d3)];}break;case _0x4b485e[_0x23937d(0xba9,0xbeb,0x21,0x86f)]:case _0x313705(0x1f91,0x1736,0x15b5,0x1561)+'x':case _0x4b485e[_0x313705(0x1c22,0x1a31,0x2997,0x1ecd)]:{if(!_0x3e5ec4)return _0x516d85(_0x313705(0x1273,0x184b,0x179a,0x1d1b)+'\x20Image\x20Wit'+_0x313705(0x1744,0xaf6,0x1723,0x1af2)+_0x4b485e[_0x313705(0x1b8d,0xe0a,0x16ee,0x1aa5)](_0xe1d953,_0x1354e9));if(!/image/['test'](_0x2a2351))return _0x516d85(_0x23937d(0xf0d,0xc34,0xefa,0x193c)+_0x313705(0xd2c,0x16ca,0xb03,0x175d)+_0x23937d(0x13de,0x611,0x886,0x14c7)+_0x4b485e['SsZgy'](_0xe1d953,_0x1354e9));if(/webp/['test'](_0x2a2351))return _0x4b485e[_0x23937d(0x7eb,0xc41,0x9fa,0x1056)](_0x516d85,_0x313705(0x1273,0x1b55,0x408,0x1692)+_0x313705(0xd2c,0xbb3,0x781,0xc20)+_0x23937d(0x13de,0x12f9,0x7fe,0x217b)+_0x4b485e[_0x23937d(0xb45,-0x2aa,0xc87,-0x238)](_0xe1d953,_0x1354e9));let _0x57c04e=_0x4b485e['snLtt'](require,_0x4b485e[_0x313705(0x69e,-0x4c0,0xf73,0xa38)]),_0x3a3864=[_0x4b485e[_0x23937d(0x1684,0x211c,0xc93,0x85a)],_0x4b485e[_0x313705(0x1b3b,0x20de,0x2488,0x1aed)],_0x313705(0x8dd,0xd02,0x818,0x15ab)+_0x23937d(0x1176,0x12c7,0x159c,0x105e)+_0x313705(0xc6d,0xd97,-0x249,0x14b4),_0x4b485e[_0x313705(0x1357,0x218a,0x1e6f,0x1a15)],_0x313705(0x1c58,0x2475,0x2090,0x2461)+_0x23937d(0x1954,0xf90,0x2695,0xdd7)+_0x23937d(0x913,0xcc8,0xfa8,0x15ee),_0x4b485e[_0x313705(0x1257,0x1078,0x11ca,0x14f8)],_0x4b485e[_0x313705(0x16b7,0x1463,0xb88,0x1ffc)],_0x4b485e['sFgBo'],_0x4b485e[_0x23937d(0x15c0,0x1943,0x1df3,0x236b)]],_0x5aceaf=_0x3a3864[Math[_0x23937d(0x7f1,0x1286,-0x50f,0xd50)](_0x4b485e[_0x23937d(0x1ace,0x1709,0x2380,0x1e35)](Math[_0x313705(0x1ae0,0x17e5,0x1f4b,0x18d2)](),_0x3a3864['length']))];hmm=_0x4b485e[_0x313705(0x1fab,0x1640,0x2c65,0x21f6)](await _0x4b485e[_0x23937d(0x8fa,-0x41a,-0x29,0xf64)],getRandom('')),localFile=await _0x175756['downloadAn'+_0x313705(0x11ae,0xf90,0xe89,0x171e)+_0x313705(0x117a,0x687,0x61d,0x784)](_0x3e5ec4,hmm),outputFile=await _0x4b485e[_0x23937d(0x1329,0xa43,0x158d,0x15bd)]+_0x4b485e[_0x313705(0x9f1,0x1009,0x11bb,0x7f5)](getRandom,_0x4b485e['ciByz']),_0x4b485e['JTufT'](_0x1db05d,mess[_0x23937d(0x8ac,-0x5eb,-0x37f,0xb9b)]);const _0xad32b4={};_0xad32b4[_0x313705(0x15b6,0x215f,0x2271,0x13b7)]=localFile,_0xad32b4[_0x313705(0x18bc,0x1514,0xc9f,0x18a8)]=_0x5aceaf,_0xad32b4['size']=_0x4b485e[_0x23937d(0xd3f,0xef,0x29b,0xa2f)],_0xad32b4[_0x313705(0xa9e,0x16ad,0xad,-0x302)]=_0x23937d(0x5ec,-0x309,0x13f4,0xb90),_0xad32b4[_0x313705(0x5c1,0xb69,-0x147,-0x368)]=_0x4b485e['yiQwt'],_0xad32b4[_0x313705(0xbc7,0x1251,-0x10e,0x69c)]=outputFile,_0x57c04e[_0x313705(0x1b2a,0xfe4,0x29e7,0x1743)+_0x23937d(0x176c,0xe24,0x9a3,0x20cd)+_0x313705(0x554,-0x47,0x425,-0x1c6)](_0xad32b4)[_0x23937d(0x1b61,0x26ae,0x27ee,0x22c6)](async _0x284152=>{function _0x22ee7f(_0x2ae8ae,_0x93ad37,_0x2cff52,_0x23fbbc){return _0x313705(_0x2cff52-0x7e,_0x2ae8ae,_0x2cff52-0xd7,_0x23fbbc-0xc8);}_0x175756[_0x22ee7f(0x2c0,0x1be,0xd28,0xb20)+'e'](_0x5cd288[_0x353860(0x61c,0x13ab,0x86b,0x1f02)],{'image':fs[_0x353860(0x953,0x15dc,0x128d,0x1777)+'nc'](outputFile),'caption':mess[_0x22ee7f(0x1f7f,0x2184,0x18b9,0x2501)]},{'quoted':_0x5cd288});function _0x353860(_0x5ad5f2,_0x3df188,_0x3cb618,_0x59c2d8){return _0x313705(_0x3df188- -0x147,_0x59c2d8,_0x3cb618-0x5c,_0x59c2d8-0x1d6);}await fs[_0x353860(-0x160,0x22a,0x820,0x851)](localFile),await fs['unlinkSync'](outputFile);});}break;case _0x4b485e[_0x313705(0x19c1,0x1a6c,0xce3,0x1504)]:case _0x4b485e[_0x313705(0x13c6,0xdf2,0x97b,0x10cc)]:{if(_0x4b485e['nQkmP'](_0x4b485e[_0x23937d(0x4b9,0x1015,0x19,-0x111)],_0x4b485e[_0x23937d(0x1bcb,0xcc0,0x2947,0x2912)])){if(_0x1bac1f)return _0x1db05d(mess['ban']);if(_0x1e03f5)return _0x4b485e[_0x23937d(0xef5,0xa80,0x1823,0xc17)](_0x1db05d,mess['banChat']);if(!_0x1ba32f[_0x313705(0x1f7c,0x28af,0x2db3,0x17aa)]('\x20'))return _0x4b485e['arBYA'](_0x516d85,'Example\x20:\x20'+(_0xe1d953+_0x1354e9)+('\x20Red\x20Drago'+'n\x20Bot'));let _0x421b42=_0x4b485e[_0x313705(0x7ee,0xebd,0x1148,0x188)](require,_0x313705(0x1dd9,0x257a,0x2355,0x2161)),_0x331bdf=await _0x421b42(_0x1ba32f[_0x23937d(0x1c16,0x2442,0x286d,0x265f)]('\x20')),_0x1b5516=_0x4b485e[_0x313705(0x1fee,0x18f4,0x20dc,0x2164)](_0x4b485e['fNKdf'](_0x4b485e[_0x23937d(0x84d,0x2ce,0xf30,0x8d8)],_0x494254),'\x0a\x0a'),_0x4c2ae3=-0x3*-0x86d+-0x25*-0x67+-0x2829;for(let _0x1e1041 of _0x331bdf[_0x313705(0x82b,0xde8,0xf59,0x12e1)]){_0x1b5516+=global[_0x313705(0x1127,0x478,0xf32,0x14e3)+'i']+'\x20No\x20:\x20'+_0x4c2ae3++ +'\x0a'+global[_0x313705(0x1127,0x1dba,0x1e9f,0x1037)+'i']+_0x23937d(0x19b6,0xfd8,0x1fb0,0x1b82)+_0x1e1041[_0x23937d(0x738,-0x766,0x10b2,0xd30)]+'\x0a'+global[_0x23937d(0xdc1,0xb0b,0xdc8,0x16ca)+'i']+(_0x23937d(0x638,0x8c6,0x774,0x5b9)+':\x20')+_0x1e1041[_0x23937d(0x12b6,0x10fa,0x204f,0x525)]+'\x0a'+global[_0x313705(0x1127,0xaf9,0x962,0x642)+'i']+_0x23937d(0x1130,0xc23,0x157d,0x46c)+_0x1e1041[_0x23937d(0x17d9,0x1e19,0xa58,0xc2d)]+'\x0a'+global[_0x23937d(0xdc1,0xf75,0x6f0,0x1252)+'i']+_0x313705(0x18ec,0x2032,0xfc1,0x1be6)+_0x1e1041[_0x23937d(0xae4,0x16ac,0xd34,0x719)]+'\x0a'+global[_0x313705(0x1127,0x13a7,0x1386,0xf28)+'i']+(_0x313705(0x1ab0,0x1f76,0x1c26,0x2455)+':\x20')+_0x1e1041['timestamp']+'\x0a'+global[_0x313705(0x1127,0xacd,0x1ed4,0x10f7)+'i']+(_0x23937d(0x1dfd,0x1806,0x26f7,0xf7e)+':\x20')+_0x1e1041['ago']+'\x0a'+global[_0x23937d(0xdc1,0x2de,0x4d,0x757)+'i']+_0x23937d(0xafd,0x1177,0x1528,0x15ee)+_0x1e1041[_0x23937d(0x6b1,-0x719,-0x206,0x11f6)][_0x313705(0x17b7,0x255a,0xcff,0x1daf)]+'\x0a'+global[_0x313705(0x1127,0x1a9e,0x1519,0x1539)+'i']+_0x313705(0x177f,0x12f7,0xc0a,0xbef)+_0x1e1041[_0x23937d(0xa79,0xac4,0x9b7,-0x2f9)]+(_0x313705(0x1056,0xc2a,0x5e1,0x8b8)+'─────────\x0a'+'\x0a');}const _0x25ddc5={};_0x25ddc5['url']=_0x331bdf[_0x23937d(0x4c5,-0x117,0xa9c,0xf89)][-0x1e6d+-0xfd*0x5+0x6*0x5e5]['thumbnail'];const _0x3e3252={};_0x3e3252[_0x313705(0x1fa9,0x1343,0x2199,0x26fb)]=_0x25ddc5,_0x3e3252['caption']=_0x1b5516,_0x175756['sendMessag'+'e'](_0x5cd288[_0x313705(0x14f2,0x1e09,0x1796,0x196d)],_0x3e3252,{'quoted':_0x5cd288});}else{const _0x5e8e6c={};_0x5e8e6c[_0x23937d(0x1d39,0x20ab,0x1b42,0x22a2)]=_0xc09703+_0x2b6d99,_0x5e8e6c['mentions']=[_0x56ae3f[_0x313705(0x1834,0x1144,0x929,0x1beb)]];const _0x24402c={};_0x24402c[_0x23937d(0x5dc,0x12bc,-0x60f,0x545)]=_0x2b58d0,_0x2e8a23[_0x313705(0xcaa,0x9ba,0xebf,0x195f)+'e'](_0x4b485e[_0x313705(0x8ba,0xcfa,0xd9b,0x204)](_0x2225df,_0x23937d(0xf25,0x89f,0x1860,0x1dd8)+_0x23937d(0x1c1f,0x1b98,0x21ed,0x1657)),_0x5e8e6c,_0x24402c);}}break;case _0x4b485e[_0x313705(0x639,-0x4a7,0x90d,0x125a)]:{if(_0x4b485e[_0x313705(0x1588,0x14bb,0x201f,0x68e)]===_0x4b485e['iMMqq']){if(_0x1bac1f)return _0x4b485e[_0x23937d(0x1abe,0xeb8,0x1a55,0xf3d)](_0x1db05d,mess[_0x23937d(0x61c,-0x639,0x1015,0x421)]);if(_0x1e03f5)return _0x1db05d(mess[_0x313705(0x926,0x154e,0x58e,0x3b4)]);if(!_0x1ba32f[-0x255b+-0x11c5*-0x2+0x1d1])return _0x4b485e[_0x313705(0x1489,0x15bf,0x1cd0,0x1b01)](_0x1db05d,_0x313705(0x6c9,0xf6b,0x11e3,0x4a0)+_0x4b485e['fgCHO'](_0xe1d953,_0x1354e9)+(_0x313705(0xadf,0xf96,0xf5b,0x2dc)+'ses\x20:\x20')+_0x4b485e[_0x23937d(0x11d1,0xbf8,0x1ef0,0xcfe)](_0xe1d953,_0x1354e9)+('\x20apa\x20arti\x20'+_0x23937d(0x709,0xb29,-0x538,0x52)));let _0x14d262=_0x4b485e[_0x313705(0x17cd,0x2471,0xcb6,0x18a8)](require,_0x4b485e['qOolT']);_0x4b485e['mCskr'](_0x14d262,{'query':_0x1ba32f['join']('\x20')})[_0x23937d(0x1b61,0x16da,0x12dc,0x28dd)](_0x264370=>{let _0x13583e=_0x5201a8(0xe32,0x1101,0x6fd,0x9d2)+_0x5201a8(0xb61,0x5,0xa46,0x591)+'\x20'+_0x494254+'\x0a\x0a';for(let _0x31d4ce of _0x264370){_0x13583e+=global['dragonemoj'+'i']+(_0x5201a8(0x1b75,0x1d10,0xf79,0xec6)+'\x20')+_0x31d4ce[_0x3e86e7(0x174e,0xa85,0xd0f,0x1b17)]+'\x0a',_0x13583e+=global[_0x3e86e7(0xd36,0x19af,0x1475,0x1247)+'i']+(_0x3e86e7(0x1a00,0x1b60,0x2535,0x1db0)+_0x3e86e7(0x1f4,-0xa74,-0x512,0x1d2))+_0x31d4ce[_0x5201a8(0x34b,0xeea,0xa1a,-0x92a)]+'\x0a',_0x13583e+=global['dragonemoj'+'i']+_0x3e86e7(0x1218,0xbfe,0x174d,0x1422)+_0x31d4ce[_0x5201a8(0x1955,0x280f,0x167c,0x15cc)]+(_0x3e86e7(0xc65,0x1166,0x80b,-0x19)+'──────────'+_0x5201a8(0x173b,0x13b0,0x10a7,0xfda));}function _0x3e86e7(_0x6e573e,_0x2dc252,_0x10be1b,_0x4c5211){return _0x313705(_0x6e573e- -0x3f1,_0x4c5211,_0x10be1b-0x116,_0x4c5211-0x7b);}function _0x5201a8(_0xb59ca4,_0x3c43b1,_0x5ad269,_0x1f98d6){return _0x23937d(_0xb59ca4- -0x1a3,_0x3c43b1,_0x5ad269-0x165,_0x1f98d6-0x1b2);}_0x1db05d(_0x13583e);});}else{const _0x4afa3f={};_0x4afa3f[_0x23937d(0x5dc,0x10f9,0x745,-0x59f)]=_0x2dc1b8,_0x5ec689[_0x313705(0xcaa,0x3c6,0x79a,0xf5a)+'e'](_0x4a5682[_0x313705(0x14f2,0x18f3,0x175c,0x7f4)],{'text':_0x4d9004,'contextInfo':{'externalAdReply':{'title':'\x20'+_0x268aec[_0x23937d(0x96c,0x1767,-0x4db,0xe46)],'body':'\x20𝙍𝙀𝘿╺\x20𝘿𝙍𝘼𝙂'+_0x23937d(0xd15,0xf,0x17a1,-0x19b),'previewType':_0x4b485e[_0x313705(0x184d,0xbfa,0x235a,0x2258)],'thumbnailUrl':'','thumbnail':_0x299e8d[_0x313705(0x1723,0x2417,0x2272,0x2171)+'nc'](_0x23937d(0xb1b,0x16e9,0x7a2,0xbf2)+_0x313705(0xbad,-0x326,0xec2,-0x1c)+_0x313705(0x1272,0x1769,0x1106,0x1d2c)),'sourceUrl':_0x4b485e[_0x23937d(0xd1d,0xaac,0x1877,-0xfd)]}}},_0x4afa3f);}}break;case _0x4b485e['KkIKT']:case _0x4b485e[_0x23937d(0x1dd4,0x15f0,0x192b,0x22ed)]:case _0x4b485e[_0x23937d(0x3b4,0x1f5,-0xf2,-0xf3)]:case _0x4b485e[_0x313705(0x1304,0x127b,0x1a7b,0x1d95)]:case _0x4b485e[_0x313705(0x2047,0x2909,0x1251,0x2ac3)]:case _0x4b485e[_0x23937d(0x23,0x1ae,0xe2b,-0x4f3)]:case'image':{if(_0x1bac1f)return _0x1db05d(mess[_0x23937d(0x61c,0x4e5,0x1205,0x1db)]);if(_0x1e03f5)return _0x4b485e[_0x313705(0x1256,0x1256,0x1840,0x1378)](_0x1db05d,mess[_0x313705(0x926,0x492,0x36f,-0x40)]);if(!_0x1ba32f[-0x202*0x7+0x2*0x341+0x7*0x114])return _0x4b485e[_0x313705(0x151c,0x11c8,0xff3,0x1bd2)](_0x1db05d,_0x4b485e[_0x23937d(0xedc,0x1b6f,0xe8,0x51a)]);let _0x28013a=_0x4b485e['zVheE'](require,_0x4b485e['xfISx']);_0x4b485e[_0x23937d(0xe44,0x1a74,0x7e0,0x1d10)](_0x28013a,_0x1ba32f[_0x23937d(0x1c16,0x209b,0x1193,0xfde)]('\x20'),async(_0x5c7ebd,_0x4d8640)=>{function _0x3e4528(_0x12cbee,_0x3f80ad,_0x276903,_0x164ce7){return _0x23937d(_0x3f80ad-0x10c,_0x12cbee,_0x276903-0xbe,_0x164ce7-0x1e2);}function _0x108d8f(_0xf765b6,_0x22bf3c,_0x41bfb6,_0x59fce4){return _0x23937d(_0xf765b6-0x10d,_0x22bf3c,_0x41bfb6-0xca,_0x59fce4-0x18e);}if(_0x4b485e[_0x3e4528(0x1348,0x1db6,0x128e,0x2b2f)](_0x4b485e[_0x3e4528(0xe1a,0x1cf7,0x25a9,0x12bd)],_0x4b485e[_0x3e4528(0x967,0x4b8,-0x9fa,0xf6c)])){const _0x4d16af={};_0x4d16af['text']=''+_0x5c4931[_0x3e4528(0xf81,0x558,0x4eb,0x13d7)];const _0x5b23c6={};_0x5b23c6[_0x108d8f(0x6e9,0x1348,0x9f6,-0x56f)]=_0x42e836,_0x170806[_0x108d8f(0xa51,0x1635,0x4ab,0xc9b)+'e'](_0xeca9fc[_0x3e4528(0x19cf,0x1298,0xf6c,0x18a1)],_0x4d16af,_0x5b23c6);}else{n=_0x4d8640,images=n[Math[_0x3e4528(0xfd7,0x8fd,0x21d,0x11d6)](_0x4b485e[_0x108d8f(0x1262,0x5d3,0x63a,0x36d)](Math[_0x108d8f(0x1887,0x1c0b,0x1aab,0xe1a)](),n[_0x108d8f(0x4eb,0x751,0x621,0x6c0)]))][_0x3e4528(0x9a1,0xb85,0xe6e,0x1344)];const _0x10723e={};_0x10723e[_0x108d8f(0x1501,0x127e,0xb92,0xff5)+'t']=_0x108d8f(0x382,-0x58a,0xad1,0x1234)+_0x108d8f(0x1ec0,0x2a1f,0x1958,0x1859);let _0x2bb98f=[{'buttonId':_0x3e4528(-0x273,0xc1f,0xa1a,0x128e)+_0x1ba32f['join']('\x20'),'buttonText':_0x10723e,'type':0x1}];const _0x2c0a75={};_0x2c0a75[_0x3e4528(0x2b7,0xb85,0xe51,0x35)]=images;const _0x2108f3={};_0x2108f3[_0x108d8f(0x1d50,0x101d,0x1df0,0x2bf0)]=_0x2c0a75,_0x2108f3[_0x108d8f(0xa75,0xea8,0xc36,0xfa0)]=_0x3e4528(-0x4a2,0x490,0x810,0x467)+_0x3e4528(0x18e4,0x162d,0x802,0xa72)+global[_0x108d8f(0xece,0x1c8d,0x15c,0x1541)+'i']+_0x3e4528(0x7a6,0x7cb,0x27e,0x5b8)+_0x494254+'\x0a'+global['dragonemoj'+'i']+(_0x3e4528(0xee1,0x1336,0xbe2,0x1087)+'\x20:\x20')+images,_0x2108f3[_0x3e4528(0x716,0x117a,0xca8,0x11ac)]=''+global[_0x3e4528(0x1652,0xa78,-0x3a1,0x120c)],_0x2108f3['buttons']=_0x2bb98f,_0x2108f3[_0x3e4528(0x1691,0x1c25,0x262b,0x1718)]=0x4,_0x2108f3[_0x3e4528(0x515,0x44d,0xfc2,0x1ba)+'o']={},_0x2108f3[_0x3e4528(0x515,0x44d,0xfc2,0x1ba)+'o'][_0x108d8f(0x585,0xb5c,0x13ff,0x45f)+_0x3e4528(0xcf9,0x42c,0xf40,0xc97)]={},_0x2108f3[_0x3e4528(0x515,0x44d,0xfc2,0x1ba)+'o'][_0x108d8f(0x585,0xb5c,0x13ff,0x45f)+_0x3e4528(0xcf9,0x42c,0xf40,0xc97)][_0x3e4528(0x1ca9,0x18e5,0x11dc,0x1419)]=''+global['ownername'],_0x2108f3[_0x3e4528(0x515,0x44d,0xfc2,0x1ba)+'o'][_0x108d8f(0x585,0xb5c,0x13ff,0x45f)+_0x3e4528(0xcf9,0x42c,0xf40,0xc97)][_0x3e4528(0x1c68,0x16ee,0x1c56,0x1c6c)]=''+global[_0x108d8f(0x1393,0xbcc,0x2015,0x14aa)],_0x2108f3[_0x3e4528(0x515,0x44d,0xfc2,0x1ba)+'o'][_0x108d8f(0x585,0xb5c,0x13ff,0x45f)+_0x3e4528(0xcf9,0x42c,0xf40,0xc97)][_0x108d8f(0x17f6,0x1086,0x1255,0x2670)]=log0,_0x2108f3[_0x3e4528(0x515,0x44d,0xfc2,0x1ba)+'o'][_0x108d8f(0x585,0xb5c,0x13ff,0x45f)+_0x3e4528(0xcf9,0x42c,0xf40,0xc97)][_0x108d8f(0xfef,0x176e,0x1e51,0x18b)]=0x2,_0x2108f3[_0x3e4528(0x515,0x44d,0xfc2,0x1ba)+'o'][_0x108d8f(0x585,0xb5c,0x13ff,0x45f)+_0x3e4528(0xcf9,0x42c,0xf40,0xc97)][_0x3e4528(0xf9f,0x1198,0x2c6,0x2017)]=''+global['btnurl'],_0x2108f3[_0x3e4528(0x515,0x44d,0xfc2,0x1ba)+'o'][_0x108d8f(0x585,0xb5c,0x13ff,0x45f)+_0x3e4528(0xcf9,0x42c,0xf40,0xc97)][_0x3e4528(0xba8,0x18fc,0x1908,0x1e48)]='{global.bt'+_0x108d8f(0x1acb,0x1811,0x12b1,0x126d);let _0x41d4a6=_0x2108f3;_0x175756[_0x3e4528(-0x2e8,0xa50,0x118e,0xf29)+'e'](_0x5cd288[_0x3e4528(0x16d9,0x1298,0x15de,0x1764)],_0x41d4a6,{'quoted':_0x5cd288});}});}break;case _0x23937d(0x870,-0x539,0xc79,-0x44f):case _0x4b485e[_0x23937d(-0x29,-0x458,-0x42b,0x4ba)]:{if(_0x1bac1f)return _0x1db05d(mess[_0x313705(0x982,0xa1f,0xe1b,0x5ab)]);if(_0x1e03f5)return _0x1db05d(mess['banChat']);if(!_0x1ba32f[0x1d66+-0x25fb+0x895*0x1])return _0x4b485e[_0x23937d(0xe36,0x13ac,0x1893,0xc50)](_0x1db05d,_0x313705(0xe65,0x427,0x1981,0xeb3)+_0x4b485e[_0x23937d(0x9df,0x50a,0x2d7,0xd6c)](_0xe1d953,_0x1354e9)+('\x20josephxeo'+_0x313705(0x10ce,0xb0a,0x35b,0xad5)));try{hx[_0x313705(0x1d9c,0x16ce,0x1cce,0x11df)](_0x1ba32f[0x174b*0x1+0x1*-0x1fc7+-0xc*-0xb5])['then'](async _0x287640=>{function _0xabc7c(_0xd542db,_0x476a71,_0x2921b5,_0x345e91){return _0x23937d(_0x345e91-0x3b6,_0x2921b5,_0x2921b5-0x9d,_0x345e91-0x124);}const _0x50cc16={};_0x50cc16[_0x159025(0x1e03,0x295d,0x117d,0x1c03)]=_0x4b485e[_0xabc7c(0xf87,0xf0d,0x1c81,0x1918)];function _0x159025(_0x52dbe2,_0x420b7b,_0x6729db,_0x53b98f){return _0x313705(_0x53b98f-0x196,_0x6729db,_0x6729db-0x173,_0x53b98f-0x17e);}const _0x1c6c22=_0x50cc16;if(_0x4b485e[_0x159025(-0x20c,-0x150,0x1752,0xb0c)](_0x4b485e[_0x159025(0x1f47,0x1523,0xc49,0x155b)],_0x4b485e[_0xabc7c(0x10c1,0x1d30,0x1da3,0x1415)]))_0x242c34[_0xabc7c(0x1449,0x1c1b,0x1611,0x1172)](_0x14fbc3['id'][_0x159025(0x252f,0x2737,0x2b84,0x1d6e)](_0xabc7c(-0x3bd,-0x423,0x137f,0x7f0),_0x1c6c22[_0x159025(0xf3a,0xda8,0x1811,0x1c03)]));else{ini_anu=[],anu_list=[],textbv='*|\x20INSTAGR'+_0xabc7c(0xb08,0x1901,0x1d8e,0x115e)+_0x159025(0x1171,0x24b4,0x16e8,0x1611)+global[_0xabc7c(0x1d55,0x1f90,0x523,0x1177)+'i']+(_0xabc7c(0xb8c,0x87b,0x1400,0xc1f)+':\x20')+(_0x287640['user'][_0x159025(0x16f7,0x22a0,0x1dd4,0x1af9)]?_0x287640['user'][_0xabc7c(0x23d0,0x2351,0x150e,0x1807)]:_0x4b485e[_0xabc7c(0x1549,0xee8,0xfa8,0x940)])+'\x0a'+global[_0x159025(0x1501,0xc88,0x1d3b,0x12bd)+'i']+(_0x159025(0x23a9,0x2412,0x1419,0x18e9)+_0x159025(0x1306,0x1495,-0x5b0,0x7ec))+_0x287640[_0xabc7c(0x138f,-0x5b1,0xa48,0x7d7)][_0x159025(0x190f,0x1ced,0x263d,0x1cd8)],urut=0x1b1d*0x1+-0x2337+0x81b;for(let _0x365816=0x60d*-0x2+0xc36+-0x1c;_0x365816<_0x287640['medias'][_0x159025(0xcc4,0x10e9,0x1747,0x8da)];_0x365816++){const _0x9c4ec2={};_0x9c4ec2[_0x159025(0xb1b,0x17bf,0x1205,0xc34)]=_0x287640[_0x159025(-0x1bb,0x706,0x12e5,0x873)][_0x365816][_0x159025(0x282c,0x26f7,0x2add,0x215b)],_0x9c4ec2[_0x159025(0xb25,0x1488,0x62e,0xf75)]=_0x287640['medias'][_0x365816][_0x159025(0x10cc,0x54e,0x177e,0xf75)],ini_anu[_0xabc7c(0x3f9,0x585,0x1faf,0x1172)](_0x9c4ec2);}ilod=0x3b*0x2f+-0x1*0x1675+0xba1;for(let _0x63f22b of ini_anu){if(_0x4b485e[_0xabc7c(0x2357,0x2c9e,0x1f43,0x20f8)](_0x4b485e[_0x159025(0xdca,0xeb3,0xc94,0x19c5)],_0x4b485e['wxXmC']))_0x4e9ade[_0x2ee44d[_0xabc7c(0x2254,0x1973,0x1c4a,0x1884)][_0xabc7c(0xc7b,0x15f8,0x736,0x1085)]('@')[-0x6c7*0x2+0x120*-0x20+0x2*0x18c7]]=_0x3dd043[_0x159025(0x1b26,0x255d,0x209e,0x1e4a)][_0xabc7c(0xaf8,0xe5f,0x17b4,0xa81)+'e']();else{const _0x5b8ec0={};_0x5b8ec0['displayTex'+'t']=_0x159025(0x1d35,0xdc0,0xd74,0x1c57)+ilod++;const _0xbeead={};_0xbeead[_0x159025(0x1d0a,0x12b0,0x2772,0x2008)]=_0x159025(0x1379,0x17b6,0xd4b,0x1701)+_0x63f22b[_0x159025(0x17dc,-0xae,0x15ba,0xc34)]+'\x20'+_0x63f22b['url'],_0xbeead[_0x159025(0x176c,0xf91,0x2352,0x1a98)]=_0x5b8ec0,_0xbeead[_0xabc7c(0xf15,-0xea,0x1116,0xaee)]=0x1,anu_list[_0xabc7c(0x1aaa,0x1231,0x148f,0x1172)](_0xbeead);}}textbv+=_0x159025(0x6c0,0xe7,0x1608,0x884)+'the\x20media\x20'+_0xabc7c(0x26ba,0x20c4,0x1c08,0x1c1c)+_0x159025(0x1699,0x1035,0x83c,0xdd3);let _0x2036bc=anu_list;const _0x3cbfee={};_0x3cbfee['image']=log0,_0x3cbfee[_0xabc7c(0xf9d,0xce3,0x4bc,0x870)+'ail']=thum,_0x3cbfee[_0xabc7c(0x131,0x164a,-0x1a7,0xd1e)]=textbv,_0x3cbfee[_0x159025(0x1f4a,0xd0e,0x1080,0x156a)]=''+global[_0xabc7c(0x1685,-0x8f,0xd67,0xd22)],_0x3cbfee['buttons']=_0x2036bc,_0x3cbfee['headerType']=0x4;let _0x3472bd=_0x3cbfee;const _0x4f5687={};_0x4f5687[_0xabc7c(0x830,0x1202,0x1899,0x992)]=_0x5cd288,_0x175756[_0x159025(0x1ce6,0x12e6,0x18df,0xe40)+'e'](_0x423161,_0x3472bd,_0x4f5687);}});}catch(_0x79d0f0){if(_0x4b485e[_0x23937d(0x101a,0x5ab,0x4e6,0x197c)]('HLlwY',_0x4b485e['IXbVH']))return[this['a'],this['b']]['includes'](_0x29d954);else _0x4b485e[_0x313705(0xf5b,0x1497,0x19e4,0x8f3)](_0x1db05d,_0x4b485e[_0x23937d(0x7f9,0xc40,0x1362,0x12e6)](String,_0x79d0f0));}}break;case _0x4b485e[_0x23937d(0x13f2,0x16bc,0xa80,0x13c1)]:case _0x4b485e[_0x23937d(0x158b,0x1b0d,0x190b,0xb80)]:case _0x4b485e[_0x313705(0x1f1a,0x2a54,0x2cc6,0x1209)]:{if(_0x1bac1f)return _0x4b485e[_0x23937d(0x1a9b,0x1daf,0xd0d,0x111b)](_0x1db05d,mess['ban']);if(_0x1e03f5)return _0x4b485e['PgOvi'](_0x1db05d,mess[_0x313705(0x926,-0x43c,0x40c,-0x56f)]);if(!_0x494254)return _0x1db05d('Where\x20is\x20t'+'he\x20usernam'+_0x23937d(0xd01,0x521,0x29b,0x6c2)+':\x20'+_0xe1d953+(_0x313705(0xa86,0x162c,0x10e9,0x2ad)+_0x313705(0x1a8b,0x2760,0x1f1d,0x24e2)));let _0x2f7824=_0x494254;hx[_0x313705(0x1d9c,0x2174,0x12f5,0x1790)](_0x2f7824)['then'](async _0x2056d8=>{function _0x54c6a6(_0x5cdfc2,_0x1396d0,_0x1d040e,_0x4658d6){return _0x23937d(_0x5cdfc2- -0xad,_0x1d040e,_0x1d040e-0x116,_0x4658d6-0x154);}const _0x752d48={'wVeBn':function(_0x3c43c7,_0x1bb3f6){return _0x4b485e['jCWkv'](_0x3c43c7,_0x1bb3f6);},'IVbMZ':_0x54c6a6(0x10c,-0x17,-0x772,0x456),'aoklg':function(_0x336f0a,_0x51b09b){function _0x2d88cc(_0x2371cb,_0x4aa99c,_0x375803,_0x5b1f43){return _0x54c6a6(_0x5b1f43-0x181,_0x4aa99c-0xc6,_0x4aa99c,_0x5b1f43-0xed);}return _0x4b485e[_0x2d88cc(0x705,0x8e2,-0x43,0x2f9)](_0x336f0a,_0x51b09b);},'VonuV':_0x54c6a6(0x91d,-0x6f,0x8aa,-0x45e),'MTDcX':function(_0x4578e9,_0x297434,_0x2212db){return _0x4578e9(_0x297434,_0x2212db);}};function _0x27dcad(_0x35c081,_0x348923,_0x48ba9b,_0x1476dc){return _0x313705(_0x348923- -0x44d,_0x1476dc,_0x48ba9b-0x23,_0x1476dc-0xa6);}if(_0x4b485e['EDETf'](_0x27dcad(-0x2da,0x775,0xfc8,0x108),_0x4b485e[_0x27dcad(0xf29,0x152d,0x8b2,0xfcc)]))_0x485440+='\x0a─────────'+'──────────'+'─\x0a\x0a\x20*📍Titl'+'e\x20:*\x20'+_0x2393de[_0x54c6a6(0x152d,0x1704,0x2191,0x1fd2)]+('\x0a\x20*📟\x20Quali'+'ty\x20:*\x20')+_0x469397['quality']+('\x0a\x20*🖥️\x20Type\x20'+':\x20')+_0x3bfc39[_0x27dcad(-0x6e2,0x651,-0x77c,0x10f)]+('*\x0a\x20*⌛\x20Uplo'+_0x27dcad(0x134e,0xb66,0x19b2,-0xac))+_0x347277[_0x54c6a6(0x1c68,0x195d,0x10f2,0x1577)]+(_0x54c6a6(0x137f,0x16f6,0x1141,0x20dd)+'e\x20:*\x20')+_0x51e7e0[_0x27dcad(0x28c3,0x1a11,0x226a,0xc7b)];else{var _0x7a1671=0x848*-0x2+-0x1*-0xb77+0x91*0x9;const _0x12eee6={};_0x12eee6[_0x54c6a6(0x9cc,0xfe,0x422,0xd1f)]=_0x2056d8[_0x27dcad(0xcde,0x33a,-0x477,-0x7f4)]['profilePic'+_0x54c6a6(0x968,0x1404,0xfe8,0xc52)],_0x175756['sendMessag'+'e'](_0x5cd288['chat'],{'image':_0x12eee6,'jpegThumbnail':await _0x4b485e[_0x27dcad(0x1a0f,0x1c30,0x28a0,0x2742)](getBuffer,_0x2056d8['user'][_0x54c6a6(0x145d,0x1d77,0x22d5,0x1174)+_0x54c6a6(0x968,0xa57,0x119,0xf93)]),'caption':'*----🧩\x20INS'+_0x54c6a6(0x23b,0x1020,-0x196,0x6ca)+_0x27dcad(0x19a8,0xdbe,0x9c4,-0x7b)+'\x0a*'+dragonemoji+(_0x54c6a6(0x7bc,0x1e5,-0x1ae,0x104c)+':*\x20')+_0x2056d8[_0x27dcad(-0x78d,0x33a,0x8f4,0x11d4)][_0x54c6a6(0x1550,0x1f31,0x2184,0x1577)]+'\x0a*'+dragonemoji+(_0x54c6a6(0x39e,0xa96,-0x7e5,0x954)+_0x54c6a6(0x1a9f,0x1ade,0x124a,0x119e))+_0x2056d8[_0x54c6a6(0x374,0xbb1,0xdee,0x1204)][_0x27dcad(0x196c,0xb29,0x114c,0x11f2)]+'\x0a*'+dragonemoji+(_0x27dcad(0x6a1,0x1306,0xf45,0xce8)+_0x27dcad(-0x43d,0x9ee,0x149a,0x147a))+_0x2056d8[_0x54c6a6(0x374,0x8ce,0x728,0x2d)][_0x54c6a6(0x172f,0x2453,0x187e,0x1061)]+'\x0a*'+dragonemoji+(_0x54c6a6(0x1484,0x768,0x10a5,0x2183)+_0x54c6a6(0xa28,0x8e7,0xaee,0x130e))+_0x2056d8['user'][_0x54c6a6(0x106c,0x1512,0x130a,0xc87)]+'\x0a*'+dragonemoji+_0x54c6a6(0x472,0xd9e,0x33e,0x6c2)+_0x2056d8['user']['id']+'\x0a*'+dragonemoji+(_0x54c6a6(0x1986,0x1d4e,0x20a3,0x1d37)+':*\x20')+_0x2056d8[_0x54c6a6(0x2ca,0x76b,0x289,0x1053)][-0x7f1*0x2+-0x16f2+-0xa*-0x3e2][_0x27dcad(0x1973,0x1b78,0xe8e,0x1a78)]+'\x0a*'+dragonemoji+'\x20Type\x20:*\x20'+_0x2056d8[_0x54c6a6(0x2ca,0x8fa,0x578,-0x63c)][0xc00+-0xb67+-0x99][_0x54c6a6(0x68b,-0x695,-0x604,0x41f)]+'\x0a*'+dragonemoji+_0x54c6a6(0x6e,0xf1c,0xbf3,0x21d)+_0x2056d8['medias'][_0x27dcad(0xb3f,0x2f7,0xa8,0xd71)]+'\x0a*'+dragonemoji+_0x27dcad(-0x263,0x44b,-0x105,0x1250)+_0x2056d8[_0x27dcad(0x253,0x33a,-0x132,-0x3f5)][_0x54c6a6(0x37d,0xc20,-0xa10,0xeeb)]+_0x27dcad(0x57d,0x1e1,-0x7c8,0xbbd)+botname+'*'},{'quoted':_0x5cd288});for(let _0x1dc0bf of _0x2056d8[_0x54c6a6(0x2ca,0xa19,0xf02,0x1195)]){if(_0x1dc0bf[_0x27dcad(0xbe1,0x992,0x110,0x1148)][_0x27dcad(0xea0,0x91,0xaf9,0x7a6)](_0x4b485e[_0x27dcad(0x89e,0xaa5,0xbde,0x776)])){if(_0x4b485e[_0x54c6a6(0x9ce,0x132a,-0x2dc,0x695)](_0x4b485e[_0x27dcad(0x16a,0xe1e,0x1b3c,0x933)],_0x4b485e[_0x54c6a6(0x1482,0x1734,0x6ad,0x1695)])){let _0x101512=await _0x4b485e['QxqXt'](getBuffer,_0x1dc0bf[_0x54c6a6(0x9cc,0x4fe,0x606,0x102)]);_0x175756[_0x54c6a6(0x897,0xb66,0x449,0xe21)+'e'](_0x5cd288[_0x27dcad(0x9e4,0x10a5,0x1c82,0x1cac)],{'video':_0x101512,'jpegThumbnail':await getBuffer(_0x1dc0bf[_0x54c6a6(0x11fb,0x62e,0xc92,0x1574)]),'caption':_0x54c6a6(0x1616,0x916,0x19d0,0x126b)+_0x1dc0bf['type']+'*'},{'quoted':_0x5cd288});}else{if(_0x752d48[_0x27dcad(0x15be,0x1c80,0x1b38,0x21ef)](_0x2791e1[_0x27dcad(0x983,0x17fc,0x17c8,0x13d8)+'e'],_0x752d48[_0x54c6a6(0xc15,0x1a66,-0x2ce,0x958)]))return _0x752d48['aoklg'](_0x1c8dbb,'Deactivate'+'d');_0x1567b9[_0x27dcad(0x164c,0x17fc,0x1172,0xb99)+'e']=_0x752d48['IVbMZ'],_0x752d48[_0x27dcad(0xbbb,0x10f,0xa9d,0xada)](_0x45ab83,_0x5c61ca[_0x27dcad(0xadd,0x885,0x917,0x553)]+(_0x54c6a6(0x4a0,0x1d4,0xf77,0x5f0)+_0x27dcad(0x1030,0x627,-0x556,-0x1a6)+_0x27dcad(0x8f7,0x5d7,0x13bc,0xd33)+_0x54c6a6(0x164f,0x1f17,0x1857,0x1db5)+'!❎'));}}else{if(_0x4b485e['pavDS']===_0x4b485e['WIwkg'])_0x752d48[_0x27dcad(0xd0a,0x1aa6,0x16d1,0x14b5)](_0x16b9d7,function(){function _0x319d0e(_0x474e76,_0x5ea32a,_0x50339d,_0x284153){return _0x27dcad(_0x474e76-0xe3,_0x284153-0x349,_0x50339d-0x193,_0x50339d);}function _0x47b3ff(_0x2cea23,_0x2edfc2,_0x501c3b,_0x21d7a8){return _0x27dcad(_0x2cea23-0x1a4,_0x501c3b-0x699,_0x501c3b-0xcb,_0x2cea23);}_0x752d48[_0x47b3ff(0x151f,-0x4a8,0x7a8,-0x4df)](_0x1e4a80,_0x752d48[_0x319d0e(0xc84,-0x499,0xfef,0x64c)]);},0x1*0x2249+0x680*0x6+-0x4179);else{let _0x47c29e=await _0x4b485e[_0x54c6a6(0x42b,-0x482,0x644,-0x29b)](getBuffer,_0x1dc0bf[_0x27dcad(0x1f8,0x992,0x13d7,0x742)]);_0x175756[_0x27dcad(0x16ab,0x85d,0xac6,0x9ad)+'e'](_0x5cd288['chat'],{'image':_0x47c29e,'jpegThumbnail':await _0x4b485e[_0x54c6a6(0x1122,0x19e2,0x3af,0xce2)](getBuffer,_0x1dc0bf[_0x54c6a6(0x11fb,0x15cf,0x16d1,0xc37)]),'caption':'*Story\x20'+_0x1dc0bf[_0x27dcad(-0x278,0x651,0x4a,0x96f)]+'*'},{'quoted':_0x5cd288});}}}}})[_0x23937d(0x934,0x14fe,0xe17,-0x3d9)](_0x59a88e=>_0x1db05d(_0x313705(0x657,0x25f,0xe3c,-0x1d8)+_0x313705(0x203e,0x11d4,0x253a,0x1bcc)+_0x494254+(_0x313705(0x1094,0x53b,0x700,0x15a1)+_0x313705(0x1494,0x7a5,0x131a,0x1680)+_0x313705(0x1434,0x21ea,0x808,0x19a4)+_0x23937d(0x1267,0x3bd,0x1b88,0x1ce3)+_0x313705(0x1b1f,0x1009,0x1410,0x1943)+_0x313705(0x435,0x639,0xf22,-0x366)+'id')));}break;case _0x4b485e[_0x313705(0x1bbb,0x2674,0x176e,0x1c99)]:case _0x4b485e['lyHdz']:case _0x313705(0x65a,0xa7e,0x1425,0x1523):{if(_0x1bac1f)return _0x4b485e['pjXaK'](_0x1db05d,mess['ban']);if(_0x1e03f5)return _0x4b485e['denmq'](_0x1db05d,mess[_0x313705(0x926,0x15e3,-0x41f,-0x5db)]);if(!_0x494254)return _0x4b485e['EEFJf'](_0x1db05d,_0x23937d(0x192d,0x2557,0x105a,0x1a88)+_0x313705(0x1a0f,0x17bd,0x1613,0xb76)+'o');if(!_0x4b485e['twpFb'](isUrl,_0x1ba32f[0xa61+0x2032+-0x2a93])&&!_0x1ba32f[-0xddb*-0x1+0x2086+-0x2e61][_0x23937d(0x178,0x257,0x9e9,0x377)](_0x23937d(0xe1c,0x1a73,0xa17,0x169)+_0x313705(0x1162,0x15f4,0x3f3,0x64a)))return _0x4b485e['MGwWj'](_0x1db05d,'The\x20link\x20y'+_0x313705(0x2098,0x2082,0x269b,0x2991)+_0x23937d(0x1b45,0x29b1,0x1f4a,0x1e25)+_0x313705(0x15f0,0x1a96,0x175f,0x1dcf)+_0x313705(0x12cc,0xbea,0x4ab,0x14e5));let _0x3ef54a=_0x494254;hx[_0x313705(0x105c,0xa96,0x1de6,0x1081)](_0x3ef54a)[_0x313705(0x1ec7,0x1646,0x17a7,0x18c5)](async _0x2803c7=>{const _0x10f4b2={};_0x10f4b2[_0x391229(0x1f64,0x1106,0x1179,0x1169)]=_0x4b485e[_0x1ece16(-0x491,0x8f0,0xdf,0xcb1)];const _0xdf8f59=_0x10f4b2;var _0x21b2f9=0xcc3+0x19b2+-0x7b1*0x5;const _0x72a463={};_0x72a463[_0x1ece16(0xddb,0xfc9,0xcd1,0x1ee3)]=_0x2803c7[_0x1ece16(0x168,0x971,0xb48,0x1836)][_0x391229(0x173b,0x111f,0x1e2c,0x1050)+_0x391229(0xc46,0xecd,0x4c8,0x12b1)],_0x175756[_0x391229(0xb75,-0x28d,0x79d,0x16fb)+'e'](_0x5cd288[_0x1ece16(0x1497,0x16dc,0x118f,0xa0a)],{'image':_0x72a463,'jpegThumbnail':await _0x4b485e[_0x391229(0x1d0a,0xfe6,0x27cf,0x2462)](getBuffer,_0x2803c7[_0x1ece16(0x881,0x971,0x12c7,0xa3a)][_0x391229(0x173b,0xd82,0x170c,0x1b17)+_0x391229(0xc46,0x137c,0x14c,0x11c)]),'caption':_0x1ece16(0x1472,0x588,0x1463,-0x77d)+_0x1ece16(0x22a5,0x15d6,0xd00,0x9e2)+_0x1ece16(-0x120,0xc2d,0x665,0x817)+_0x391229(0x1260,0x1ec0,0x188e,0x1f93)+dragonemoji+(_0x391229(0xa9a,0xd91,0x34c,0x18c4)+_0x391229(0x1d7d,0x1b3a,0x1e41,0x228e))+_0x2803c7[_0x391229(0x652,-0x3b7,0x76c,0x1115)][_0x1ece16(0x2630,0x1b4d,0x170d,0x1ea1)]+'\x0a*'+dragonemoji+(_0x391229(0x67c,0x1482,-0x48d,0x138e)+_0x1ece16(0x21e0,0x209c,0x16f1,0x20b5))+_0x2803c7['user'][_0x1ece16(0x6ca,0x1160,0x1834,0x1ef3)]+'\x0a*'+dragonemoji+(_0x391229(0x161e,0xbad,0x11e0,0x230e)+'\x20:*\x20')+_0x2803c7['user'][_0x391229(0x1a0d,0x1c02,0x167b,0xc97)]+'\x0a*'+dragonemoji+(_0x1ece16(0x2554,0x1a81,0x2264,0xbaf)+'\x20:*\x20')+_0x2803c7[_0x391229(0x652,0xc44,-0x80d,-0x13)][_0x1ece16(0x1b29,0x1669,0x22fc,0x173c)]+'\x0a*'+dragonemoji+_0x1ece16(-0x36e,0xa6f,0x503,0x9fc)+_0x2803c7[_0x391229(0x652,-0x1d6,0x91c,0x1370)]['id']+'\x0a*'+dragonemoji+(_0x1ece16(0x2afb,0x1f83,0x2c3b,0x143b)+_0x391229(0x1d7d,0x12a1,0x1e55,0x1b0b))+_0x2803c7[_0x1ece16(-0x4d5,0x8c7,0x9e0,0x3be)][0x1892*0x1+0x15fd+-0x89*0x57]['fileType']+'\x0a*'+dragonemoji+_0x391229(0x1230,0xca0,0x13a9,0x98d)+_0x2803c7['medias'][-0x18bc*0x1+-0x22c0+0x6*0x9ea][_0x391229(0x969,-0xd3,0x289,0x259)]+'\x0a*'+dragonemoji+(_0x1ece16(0xb7b,0x1542,0x1029,0xe5a)+'dia\x20:*\x20')+_0x2803c7[_0x1ece16(0x147c,0x8c7,-0x491,0xff2)][_0x391229(0x60f,0xc8b,0x8a8,0xd08)]+'\x0a*'+dragonemoji+_0x1ece16(0xb28,0xc1a,0x15df,0xc6f)+_0x494254+_0x1ece16(0xc24,0x818,0xad3,0x11cb)+botname+'*'},{'quoted':_0x5cd288});function _0x1ece16(_0x537ddc,_0x4cc9b7,_0x56250e,_0x4f4aa0){return _0x313705(_0x4cc9b7-0x1ea,_0x56250e,_0x56250e-0x170,_0x4f4aa0-0x1d4);}function _0x391229(_0x1c1275,_0x3cb585,_0x418ffa,_0x334cd4){return _0x313705(_0x1c1275- -0x135,_0x334cd4,_0x418ffa-0x6b,_0x334cd4-0xd1);}for(let _0x269fa0 of _0x2803c7[_0x391229(0x5a8,0x11b4,-0x1b7,0xf7f)]){if(_0x4b485e['Ybepr'](_0x4b485e['lWxYR'],_0x4b485e['KlqnQ'])){const _0x12737a={};_0x12737a['url']=_0x362b96[0xfb8+0xb*0x1d0+-0x1*0x23a7];const _0x448697={};_0x448697[_0x1ece16(0x291f,0x1cb2,0x20df,0x1471)]=_0x12737a,_0x448697[_0x391229(0xb99,-0x1b0,0x1074,0xab0)]=_0xdf8f59['GunUF'],_0x448697[_0x391229(0x14db,0xbdb,0x1fba,0x20e4)]=_0x1ece16(0x1234,0x5f6,-0x33b,0x665);const _0x9cfd04={};_0x9cfd04['quoted']=_0x1998d9,_0x3053de[_0x1ece16(0x100,0xe94,0xee0,0xf11)+'e'](_0x1c9939,_0x448697,_0x9cfd04);}else{if(_0x269fa0['url']['includes']('mp4')){if(_0x4b485e[_0x1ece16(0x1524,0x15d0,0x1d70,0x1b5d)](_0x4b485e[_0x1ece16(0x9f8,0xb86,0x1a71,0x1a96)],_0x4b485e[_0x391229(0x19da,0x1f86,0x27f6,0x1936)]))_0x4b485e[_0x1ece16(0x12e6,0x1a60,0x2977,0x19d5)](_0x1556fa,_0x1ece16(0xe7f,0x5c3,0xab8,0xc27)+'nsert\x20a\x20va'+_0x391229(0xc20,0x3ea,0x686,0xf02)+'!');else{let _0x3013be=await _0x4b485e[_0x391229(0x774,0xc06,-0x25b,-0x2a5)](getBuffer,_0x269fa0[_0x391229(0xcaa,0x307,0x1aac,0xfbb)]);_0x175756[_0x1ece16(0x65b,0xe94,0xdcf,0xf46)+'e'](_0x5cd288[_0x391229(0x13bd,0xc64,0x18fe,0xcc8)],{'video':_0x3013be,'jpegThumbnail':await getBuffer(_0x269fa0['preview']),'caption':_0x1ece16(0x24bb,0x1bb0,0x106b,0x1501)+'\x20'+_0x269fa0[_0x1ece16(0x1368,0xc88,0xa05,-0xa3)]+'*'},{'quoted':_0x5cd288});}}else{let _0xc51d9b=await _0x4b485e[_0x1ece16(0x14b0,0x1dda,0x1ebd,0x19e6)](getBuffer,_0x269fa0[_0x1ece16(0x105f,0xfc9,0x8d0,0x1bf8)]);_0x175756[_0x1ece16(0x1061,0xe94,0x3fc,0x18f9)+'e'](_0x5cd288[_0x391229(0x13bd,0xafd,0x1ed0,0xc6d)],{'image':_0xc51d9b,'jpegThumbnail':await _0x4b485e[_0x1ece16(0x26dd,0x1b48,0x22e4,0xe4c)](getBuffer,_0x269fa0['preview']),'caption':_0x391229(0x1891,0x1664,0xe86,0x1798)+'\x20'+_0x269fa0['type']+'*'},{'quoted':_0x5cd288});}}}})[_0x313705(0xc9a,0x195b,0x15f4,0x79d)](_0x219ad2=>_0x1db05d(mess[_0x313705(0x2116,0x25bf,0x2e2b,0x2137)]));}break;case _0x4b485e[_0x23937d(0x149,0x25e,-0xd5d,0xf7a)]:case _0x4b485e['ZCeyC']:case _0x4b485e['cWYGT']:case _0x4b485e[_0x313705(0x7e0,0x10dd,-0x578,0x2b2)]:{if(_0x4b485e[_0x23937d(0xe71,0x19f1,0xc37,0x9d5)](_0x4b485e[_0x23937d(0x92a,0x6e7,-0x130,0x3f2)],_0x4b485e[_0x313705(0xc90,0xe4b,-0x16b,0x368)])){const _0x3977da={};_0x3977da[_0x23937d(0x13f4,0xb90,0xf91,0x2165)+'t']=_0x4b485e[_0x23937d(0x116e,0x1d9a,0x2062,0x817)];const _0xa5639c={};_0xa5639c['buttonId']=_0x3590eb+_0x23937d(0x106a,0x1436,0x1975,0x562),_0xa5639c[_0x313705(0x1902,0x23eb,0x1275,0x18c8)]=_0x3977da,_0xa5639c[_0x313705(0xa9e,0x1258,-0x284,0x643)]=0x1;const _0x354880={};_0x354880[_0x23937d(0x13f4,0x1fb2,0xbf0,0x219f)+'t']=_0x23937d(0x199e,0x1112,0x1c91,0x19c4);const _0xed346b={};_0xed346b[_0x313705(0x1e72,0x1528,0x12e9,0x2bb8)]=_0x117d86+_0x313705(0x1146,0x42c,0x10d8,0x18e4),_0xed346b['buttonText']=_0x354880,_0xed346b['type']=0x1;const _0x3201db={};_0x3201db['displayTex'+'t']=_0x4b485e[_0x23937d(0x176,0x731,0xb31,0xfa6)];const _0x4ac8dd={};_0x4ac8dd['buttonId']=_0x55fa23+_0x313705(0x1855,0x235b,0x103e,0x9e8),_0x4ac8dd[_0x313705(0x1902,0xb99,0x134d,0x1e7e)]=_0x3201db,_0x4ac8dd['type']=0x1;let _0x4cd972=[_0xa5639c,_0xed346b,_0x4ac8dd];const _0x2b68cf={};_0x2b68cf[_0x23937d(0xa79,0x1408,0xf60,-0x268)]=_0x4b485e[_0x313705(0x1540,0x1948,0x94a,0xf01)];const _0x51167a={};_0x51167a['image']=_0x2b68cf,_0x51167a['caption']=_0x313705(0x4ef,0xae2,-0x9fc,0x10a1)+_0x3fe98d+(_0x23937d(0x147,-0xb22,-0x221,-0x718)+'═══💠\x20FUN\x20💠'+_0x23937d(0xa44,0x1041,-0x4b6,-0x2d0)+_0x23937d(0x3dd,0xff,0xed1,0x28a))+_0x17886d+'\x20'+_0x39dd70+('how\x20[text\x0a'+'┃╠')+_0x114782+'\x20'+_0x353659+('when\x20[text'+_0x23937d(0x11d8,0xb86,0x1fd0,0x105d))+_0x494ca1+'\x20'+_0x44f32c+(_0x313705(0x1cfb,0x142a,0x127b,0x1492)+'┃╠')+_0x36fe5a+'\x20'+_0x126b2e+('what\x20[text'+_0x313705(0x153e,0x23e7,0x15d4,0x906))+_0x36509a+'\x20'+_0x136978+(_0x313705(0x13bd,0x995,0x121f,0xdce)+'\x0a┃╠')+_0x184fa3+'\x20'+_0x1fdbab+('rate\x20[text'+_0x313705(0x153e,0x795,0xf03,0x2083))+_0x323e44+'\x20'+_0x9613b3+(_0x23937d(0x95e,0xed2,-0x393,0x7a7)+_0x23937d(0xa01,0xe98,0xee2,0xd7e))+_0x4b4f16+'\x20'+_0x24dcd0+(_0x23937d(0x13fa,0xfce,0x16aa,0x1b0f)+_0x23937d(0xa29,0xfaa,0x2c3,0x65e)+_0x23937d(0x105,-0x2b0,0xa3e,0xb2c))+_0x271a9f+'\x20'+_0x24b0be+(_0x23937d(0x678,0x4dc,0x132e,-0x392)+_0x313705(0x13fb,0x1977,0x690,0x15a2)+'╠')+_0x5836de+'\x20'+_0x599760+(_0x313705(0x14ac,0xd14,0x8a6,0x916)+'k\x20[tag]\x0a┃╠')+_0x4848f7+'\x20'+_0xe347fa+('lesbianche'+_0x23937d(0x1095,0x513,0x532,0x409)+'╠')+_0x455aed+'\x20'+_0x23d92e+(_0x313705(0x13ce,0xa47,0x61a,0x6e7)+_0x23937d(0x1221,0x94d,0x1ff0,0xf49))+_0x3102b9+'\x20'+_0xb229bc+('cutecheck\x20'+'[tag]\x0a┃╠')+_0x2b22cc+'\x20'+_0x21f8dc+(_0x313705(0x13cf,0x1d4b,0x15e9,0xc84)+_0x313705(0xf46,0x1606,0x960,0xeea))+_0x74efba+'\x20'+_0x3afa4d+(_0x23937d(0x12f0,0xe47,0x1adc,0x10cc)+_0x23937d(0x11ec,0x7b4,0x5b6,0x1e3c))+_0x11ef08+'\x20'+_0x320927+(_0x23937d(0xa8b,-0x5d,0x72,0x173e)+_0x23937d(0xa29,0x11d9,-0xb6,0xa18)+_0x23937d(0x105,-0x49f,-0x939,-0x73b))+_0x12b0b9+'\x20'+_0x5d553f+('lovelychec'+_0x313705(0xf51,0xe3e,0x120a,0x92a))+_0x2e82b6+'\x20'+_0x6b23f8+_0x23937d(0x168f,0xe20,0x8d5,0x1127)+_0xa73f93+'\x20'+_0x11d389+(_0x313705(0x196e,0xc80,0x1515,0x260b)+'\x0a┃╠')+_0xa3e308+'\x20'+_0xa32680+_0x23937d(0x19b2,0x25a3,0xda8,0xccc)+_0x28373e+'\x20'+_0x44bb85+_0x313705(0x895,-0x516,0x4b0,0x1592)+_0x13f2b7+'\x20'+_0xfef97d+_0x23937d(0x1407,0x1f7a,0xee7,0xda6)+_0x5cdcac+'\x20'+_0x301574+(_0x23937d(0x13cb,0x1000,0x1bd0,0x629)+'╠')+_0x259574+'\x20'+_0x2a08f5+(_0x313705(0x17aa,0x2128,0x1215,0x213c)+'┃╠')+_0x5ab4e1+'\x20'+_0x23edce+_0x313705(0x207a,0x25df,0x226d,0x1a2e)+_0x6f3fe+'\x20'+_0x3d1524+_0x23937d(0x10,-0xa71,-0x3ad,0x8f9)+_0x17039f+'\x20'+_0x598d29+_0x23937d(0x18b3,0x10ed,0x1760,0x2451)+_0x10f4e5+'\x20'+_0x56cc0d+_0x313705(0x19b6,0x214c,0x23d8,0x262a)+_0x220c44+'\x20'+_0x1d2a9d+_0x23937d(0xd4,-0x5e3,-0x4c2,-0x458)+_0x57f5bb+'\x20'+_0x49b30c+_0x23937d(0xff6,0xa38,0xed0,0xcc9)+_0x323dd4+'\x20'+_0x1d2769+_0x313705(0x19bd,0xc49,0x25ea,0x15b1)+_0x1daadf+'\x20'+_0x50e701+'asshole\x0a┃╠'+_0x22f755+'\x20'+_0x28a97e+_0x23937d(0x234,0x6d6,0xb96,0xca6)+_0x2da9bd+'\x20'+_0x166bb3+_0x313705(0xe66,0x15af,0x1c7d,0x14c)+_0x818e07+'\x20'+_0x2108dd+_0x313705(0x12aa,0xd3c,0x19cb,0xbc5)+_0x34fc31+'\x20'+_0x5aa85a+_0x313705(0x1945,0xb96,0x2365,0xc24)+_0x25f4ba+'\x20'+_0x1eadcf+_0x313705(0xee7,0x17a4,0x1521,0x17ed)+_0x2a85ee+'\x20'+_0x29643b+_0x23937d(0x19ef,0x28f8,0x25d5,0x112e)+_0x530d3b+'\x20'+_0x1b4f59+_0x23937d(0x1bba,0xef3,0x1765,0x1e41)+_0x41dc98+'\x20'+_0x34f503+(_0x23937d(0x1d49,0x1341,0x1e21,0x2538)+'┃╠')+_0x5456dc+'\x20'+_0x4d5869+_0x23937d(0x6da,0xdd2,0x1371,0xe2b)+_0x30864e+'\x20'+_0x55f9f3+('guess\x20[opt'+_0x313705(0x1e8a,0x17de,0x1da0,0x222f))+_0x33cf9c+'\x20'+_0x5be38c+(_0x23937d(0x627,0xc98,0x141f,0x1149)+_0x23937d(0x11d8,0x1844,0x1a1a,0xacd))+_0xade88a+'\x20'+_0x400a27+(_0x313705(0x121b,0x205e,0x18a6,0xaf2)+'ag]\x0a┃╚════'+'═════════☬'+_0x23937d(0x179c,0x1218,0x1bef,0x1f47))+_0x3de42f+_0x313705(0xbe8,0x5eb,0x152,0x545),_0x51167a['footer']=_0x4b485e['aErGw'],_0x51167a[_0x313705(0xfa0,0x1b5,0x729,0x7c1)]=_0x4cd972,_0x51167a[_0x23937d(0x1b19,0x21e8,0xe25,0x16e2)]=0x4;let _0x1972df=_0x51167a;const _0x24ae82={};_0x24ae82['quoted']=_0x3060c2,_0x5345ac[_0x313705(0xcaa,0x1150,0x489,0x17b2)+'e'](_0x3951b0['chat'],_0x1972df,_0x24ae82);}else{if(_0x1bac1f)return _0x4b485e[_0x23937d(0xb22,0xa05,0x855,0x1756)](_0x1db05d,mess[_0x313705(0x982,0x9b0,0x260,0x876)]);if(_0x1e03f5)return _0x4b485e['lFnwl'](_0x1db05d,mess[_0x313705(0x926,0x1366,0x13d7,-0x1aa)]);if(!_0x1ba32f[0x1098+0x812+-0x18aa])return _0x4b485e[_0x313705(0x117e,0xe42,0xc35,0x8e3)](_0x1db05d,_0x313705(0xe65,0x244,0x108e,-0x32)+_0x4b485e[_0x313705(0xd57,0x1756,0x49f,0x194c)](_0xe1d953,_0x1354e9)+('\x20https://w'+'ww.instagr'+_0x313705(0x880,0x1d3,0xbee,-0x301)+_0x313705(0xac4,0x19a9,0xe3e,0x172)+_0x313705(0x860,0x16bc,0x1752,0xdc1)+'mMyMTA2M2Y'+'='));try{hx['igdl'](_0x1ba32f[-0x49*0x53+0x12dd+0x4ce])[_0x23937d(0x1b61,0x1969,0x21a8,0xd62)](async _0x59197e=>{ini_anu=[],anu_list=[],textbv=_0x5ed605(0x1edc,0x2467,0x11c2,0x12d8)+_0x5ed605(0x962,-0x299,-0x76,0x8a4)+_0x5ed605(0xae7,0xdd7,0x149d,0xe1d)+global[_0x1069d3(0x916,0x720,0x1130,0x1b53)+'i']+(_0x5ed605(0xd08,0x16ae,0x131,0x90d)+':\x20')+(_0x59197e[_0x5ed605(0x8c0,0x15cb,0x9e7,0x10cc)][_0x5ed605(0x1a9c,0x12be,0x2162,0x284d)]?_0x59197e[_0x1069d3(0xe26,0xdc8,0x790,0x14b4)][_0x1069d3(0x1b47,0x25de,0x17c0,0x26ba)]:_0x4b485e[_0x5ed605(0xa29,0x1834,-0x4a9,-0x1c1)])+'\x0a'+global['dragonemoj'+'i']+(_0x1069d3(0x1315,0xe67,0x175c,0xd0c)+'\x20:\x20')+_0x59197e[_0x1069d3(0x1689,0x85e,0x790,0x55c)]['followers'],urut=0x5da+0x52*0x5b+0x20f*-0x11;for(let _0x45f00e=-0x186+-0x17*-0x147+0x949*-0x3;_0x4b485e[_0x5ed605(0x1791,0x8bf,0x22ea,0x100a)](_0x45f00e,_0x59197e[_0x5ed605(0x816,0x72c,0x1593,0x5f)][_0x5ed605(0x87d,-0x256,-0x47a,-0xad)]);_0x45f00e++){if(_0x4b485e[_0x5ed605(0x1ffe,0x2776,0x28f5,0x235d)]===_0x4b485e[_0x5ed605(0x1ffe,0x1f04,0x1e34,0x1b71)]){const _0x43a78f={};_0x43a78f['type']=_0x59197e[_0x5ed605(0x816,0x160f,0xc28,0xc07)][_0x45f00e][_0x5ed605(0x20fe,0x1f47,0x198e,0x1760)],_0x43a78f['url']=_0x59197e['medias'][_0x45f00e][_0x1069d3(0x4e,0x816,0xde8,0x1df)],ini_anu[_0x1069d3(0x909,0xeca,0x112b,0x12ba)](_0x43a78f);}else _0x4dd727+=-0x2162+0xe*-0x9+-0x21e1*-0x1,_0x13cdd3+='\x0a•\x20'+_0x431dda[_0x5ed605(0x163c,0xb4d,0x824,0x18b6)]()+'\x20•\x0a',_0x59948f+=_0x5ed605(0xa6f,-0x288,0x10b5,0x126c)+_0x38966c[_0x5ed605(0x1fe8,0x1ff9,0x1477,0x26a9)]+'\x0a',_0x117004+=_0x5ed605(0x595,0x73b,0xab0,0x442)+_0x2c401c[_0x1069d3(0x12f1,0x15ca,0x131b,0xbdc)]+'\x0a';}ilod=0x31d*0x6+0x1*-0x9ac+0x1cd*-0x5;function _0x1069d3(_0x392178,_0x516c25,_0x1928cb,_0x442878){return _0x313705(_0x1928cb-0x9,_0x392178,_0x1928cb-0xa2,_0x442878-0x197);}for(let _0x3806e0 of ini_anu){const _0x504df0={};_0x504df0[_0x1069d3(0x23f3,0x1051,0x1763,0x1545)+'t']=_0x5ed605(0x1bfa,0xfb3,0x15d8,0x1533)+ilod++;const _0x5c71d5={};_0x5c71d5[_0x1069d3(0x1138,0x119f,0x1e7b,0x1cf7)]='ig\x20'+_0x3806e0[_0x5ed605(0xbd7,-0x112,0xfa,0x36d)]+'\x20'+_0x3806e0[_0x1069d3(0x6dd,0xf71,0xde8,0x1137)],_0x5c71d5[_0x1069d3(0xdb7,0x16fd,0x190b,0x1293)]=_0x504df0,_0x5c71d5['type']=0x1,anu_list[_0x1069d3(0xf94,0x10ef,0x112b,0x1eef)](_0x5c71d5);}textbv+=_0x1069d3(-0x712,0x1301,0x6f7,0x8e2)+_0x1069d3(0xc26,-0x4ef,0x50c,0x413)+'below\x20to\x20d'+_0x1069d3(0xd5f,0x663,0xc46,0x742);let _0x4cf949=anu_list;const _0x534dc7={};_0x534dc7[_0x1069d3(0x292a,0x2eb2,0x1fb2,0x263c)]=log0,_0x534dc7['jpegThumbn'+_0x1069d3(0xe62,0xe54,0x1080,0x1635)]=thum,_0x534dc7[_0x5ed605(0xe07,0x5d1,0x1868,0x1cb3)]=textbv,_0x534dc7[_0x1069d3(0x8d5,0xaa0,0x13dd,0xe7d)]=''+global[_0x1069d3(0x7b7,0x1bac,0xcdb,0x1495)],_0x534dc7[_0x1069d3(0x1a57,0xcea,0xfa9,0xacf)]=_0x4cf949,_0x534dc7[_0x5ed605(0x1fb8,0x196d,0x135a,0x1f35)]=0x4;let _0xe744b0=_0x534dc7;const _0x3e1cd4={};_0x3e1cd4[_0x1069d3(0x182c,0xe7e,0x94b,0x1257)]=_0x5cd288;function _0x5ed605(_0x4dbd2a,_0x3426d2,_0x1b28ee,_0x21ce15){return _0x23937d(_0x4dbd2a-0x49f,_0x21ce15,_0x1b28ee-0xd9,_0x21ce15-0x90);}_0x175756[_0x5ed605(0xde3,0xc95,0xb93,0x18ea)+'e'](_0x423161,_0xe744b0,_0x3e1cd4);});}catch(_0x45e952){_0x1db05d(_0x4b485e[_0x313705(0x400,0xd07,-0x2a7,-0x168)](String,_0x45e952));}}}break;case'ig':{if(_0x1bac1f)return _0x4b485e['oIeZW'](_0x1db05d,mess[_0x313705(0x982,0x10c0,-0x38d,0x3aa)]);if(_0x1e03f5)return _0x4b485e['FqOvv'](_0x1db05d,mess[_0x313705(0x926,0x2e2,0xf35,-0x4ba)]);if(_0x1ba32f[0x321+-0x169*-0xa+-0x113b]===_0x4b485e[_0x23937d(0xb8c,0xa05,0x1410,0x141f)]){const _0x329edc={};_0x329edc[_0x23937d(0xa79,0x151a,0xc60,0xacd)]=_0x1ba32f[0xae4*-0x2+-0x121e+0x1*0x27e7];const _0x1e5dcc={};_0x1e5dcc[_0x313705(0x1ac8,0xc46,0x17b6,0x2303)]=_0x329edc,_0x1e5dcc[_0x313705(0xcce,0x437,0x86c,0xe6d)]=_0x4b485e['BZwQD'],_0x1e5dcc['mimetype']=_0x4b485e[_0x313705(0x17c6,0x1106,0x2177,0xacc)];const _0x253ab3={};_0x253ab3['quoted']=_0x5cd288,_0x175756[_0x313705(0xcaa,0x968,0xf58,0x1278)+'e'](_0x423161,_0x1e5dcc,_0x253ab3);}else{if(_0x4b485e[_0x23937d(0x1183,0xec9,0x1774,0xfb3)](_0x1ba32f[-0x10a2+0x24ae+0xa06*-0x2],_0x4b485e['psYem'])){if(_0x4b485e['jqfIK']!==_0x313705(0x1058,0x19d4,0x49f,0x293)){const _0x177f52={};_0x177f52[_0x23937d(0x13f4,0x16d1,0xcf5,0xf48)+'t']=_0x4b485e['YHddC'];const _0x66b878={};_0x66b878['buttonId']=_0x23937d(0x77d,0x53,0x7c4,-0x78)+_0x2b36eb[_0x23937d(0x1465,0x14b1,0x1fcc,0x15bf)][-0x5d2+0x24e8*0x1+-0x1f16]+_0x313705(0x9d6,0x3a4,0x387,0x141d),_0x66b878[_0x23937d(0x159c,0x1f13,0x975,0xa58)]=_0x177f52,_0x66b878['type']=0x1;const _0x1ace3b={};_0x1ace3b[_0x313705(0x175a,0x230c,0x1c28,0x1771)+'t']=_0x4b485e[_0x313705(0x10e4,0xe7e,0x3be,0x1bf7)];const _0x304356={};_0x304356['buttonId']=_0x313705(0x10eb,0x106e,0x18ef,0x1d15)+_0x43f35d[_0x313705(0x17cb,0x190b,0xef4,0xbf7)][0x2*-0x127d+0x1e8*0x7+-0x4ba*-0x5]+_0x23937d(0x19fa,0x2051,0xce2,0x2782),_0x304356[_0x23937d(0x159c,0x1842,0x1a84,0x1627)]=_0x1ace3b,_0x304356[_0x313705(0xa9e,0x76b,0x3e9,0x1986)]=0x1;let _0xeb7f4e=[_0x66b878,_0x304356];const _0x941efb={};_0x941efb['url']=_0x2570e5[_0x23937d(0x6b1,0x1142,-0x254,0x515)]['profilePic'];const _0x562799={};_0x562799[_0x313705(0x1fa9,0x1d29,0x1fb3,0x12ed)]=_0x941efb,_0x562799[_0x313705(0xcce,0x1b20,0x1477,0xe63)]='\x0a'+_0x1aff67+_0x313705(0x1496,0x12ce,0xfe4,0x1140)+_0x22525e['title']+'\x0a'+_0x3ec5f1+_0x23937d(0xafd,0xcfd,0x305,0x132d)+_0x363568[_0x313705(0xa17,-0x169,0x3e8,0x465)][_0x313705(0x17b7,0x137e,0x118d,0xf29)]+'\x0a'+_0x37c3e7+'\x20Like\x20:\x20'+_0x14c2a6[_0x23937d(0x31,-0xc33,-0x276,-0xc70)]+'\x0a'+_0x10bead+(_0x23937d(0x483,-0x328,0xabe,0x4bf)+'\x20')+_0x278238[_0x23937d(0x968,-0x29e,0x153c,0xd58)]+'\x0a'+_0x521247+_0x23937d(0x1419,0x113c,0x648,0x130d)+_0x5fba3[_0x23937d(0x1465,0x22c9,0x224e,0x1bfc)][0x2b9+0x1*-0x101c+0xd63]+(_0x313705(0x1a6b,0x24a7,0x25b4,0xbeb)+'ad\x20Media,\x20'+_0x23937d(0xf78,0x1750,0xc99,0x10ae)+_0x313705(0x1231,0xdd7,0xb27,0x15d7)+'The\x20Button'+'s\x20Below\x20Or'+'\x20Enter\x20The'+_0x23937d(0x1cc1,0x2888,0x2032,0x16de)+_0x313705(0x381,-0x370,-0x440,-0x447)+_0x313705(0xb80,0x78,0x150e,0x12e0)+_0x23937d(0x1cbf,0x126f,0x161b,0xe21)),_0x562799[_0x313705(0x13d4,0x1248,0x1f2c,0x7cc)]=_0x3ae031[_0x23937d(0x421,0x683,0x129b,0x252)]['name'],_0x562799[_0x313705(0xfa0,0x1971,0x1061,0x1d5f)]=_0xeb7f4e,_0x562799[_0x23937d(0x1b19,0xf6c,0x1d0c,0x2936)]=0x4;let _0x41509c=_0x562799;const _0x4048ad={};_0x4048ad['quoted']=_0x431425,_0x1c2602[_0x313705(0xcaa,-0x206,0x13c4,0xf2d)+'e'](_0x5289a4[_0x23937d(0x118c,0x1a13,0x1145,0x3c0)],_0x41509c,_0x4048ad);}else{const _0x3496b9={};_0x3496b9['url']=_0x1ba32f[0x2c*-0xc+-0x17f8+0x535*0x5];const _0x39ea28={};_0x39ea28[_0x23937d(0x1c43,0x194d,0x1f24,0x1067)]=_0x3496b9,_0x39ea28['caption']=_0x4b485e['BZwQD'];const _0x11a926={};_0x11a926[_0x313705(0x942,-0x4ec,-0x15f,0x108f)]=_0x5cd288,_0x175756[_0x23937d(0x944,0x169f,0x10e3,0xe55)+'e'](_0x423161,_0x39ea28,_0x11a926);}}else{if(_0x4b485e['RATUO'](_0x4b485e[_0x313705(0x1557,0x2460,0x166e,0x179f)],_0x4b485e[_0x313705(0x1557,0x192c,0x21c7,0x1c71)])){const _0x261acf={};_0x261acf['text']=''+_0x4171b6[_0x313705(0x13e1,0xe9a,0x1940,0x8ac)];const _0x28d295={};_0x28d295['quoted']=_0xf9247e,_0x4ffed2['sendMessag'+'e'](_0x64d90e[_0x313705(0x14f2,0x1fed,0xea2,0x1ab7)],_0x261acf,_0x28d295);}else _0x1db05d(_0x313705(0x529,0xd2,0xdea,-0x140));}}}break;case _0x313705(0x4d8,-0x849,0x27b,0x12cd):{if(_0x1bac1f)return _0x1db05d(mess[_0x313705(0x982,0xeb7,0x369,0x1476)]);if(_0x1e03f5)return _0x4b485e['ZPfBi'](_0x1db05d,mess[_0x313705(0x926,0xb4c,0xca1,0xd93)]);if(!_0x1ba32f[-0x5a1*-0x3+-0x1b8a+-0x1*-0xaa7])return _0x4b485e[_0x313705(0x111c,0x2e4,0x1dac,0x1a9a)](_0x1db05d,_0x313705(0x105b,0x158b,0xf05,0xad3)+'e\x20link\x20?');try{const _0x2860fc={};_0x2860fc[_0x23937d(0xa79,0x173b,0x1625,-0x1f4)]=_0x1ba32f[-0xe90+0x3f*0x4d+-0x463];const _0x5c7475={};_0x5c7475[_0x23937d(0x17d9,0x1c1e,0x166b,0x1fc6)]=''+global['botname'],_0x5c7475[_0x23937d(0x15e2,0x2071,0xcfa,0x1650)]=''+global[_0x313705(0x203b,0x26a3,0x1dc1,0x19a5)],_0x5c7475['thumbnail']=log0,_0x5c7475[_0x23937d(0xee2,0x1981,0x1107,0x55b)]=0x2,_0x5c7475[_0x313705(0x13f2,0x1d5d,0xe2f,0x12cf)]=''+global[_0x23937d(0x7fa,0x64f,-0x551,0x9a1)],_0x5c7475[_0x23937d(0x17f0,0x185f,0x210e,0x1ca1)]=''+global[_0x23937d(0x7fa,0x935,0xc23,0x1213)];const _0x4e2c55={};_0x4e2c55[_0x313705(0x7de,0x152a,0x547,-0x4cb)+_0x313705(0x686,0x537,0x4f1,-0x817)]=_0x5c7475;const _0x2a5f93={};_0x2a5f93[_0x313705(0x1ac8,0x1fc1,0x1fa1,0x20dc)]=_0x2860fc,_0x2a5f93[_0x313705(0xcce,0xe2a,-0x125,0x429)]=_0x4b485e[_0x313705(0x1087,0x4cc,0x1330,0x1d2a)],_0x2a5f93[_0x313705(0x6a7,0xd78,0xde,0x115a)+'o']=_0x4e2c55;const _0x4b5533={};_0x4b5533[_0x23937d(0x5dc,0xb88,0x2f4,-0x38d)]=_0x5cd288,_0x175756[_0x313705(0xcaa,0x34b,0x1288,0x8a0)+'e'](_0x423161,_0x2a5f93,_0x4b5533);}catch{_0x1db05d(_0x4b485e['ySAPn']);}}break;case _0x4b485e[_0x23937d(0x1956,0x1182,0x27fe,0x13b5)]:{if(_0x4b485e[_0x313705(0x450,-0x77e,0x9ac,0xfd)](_0x4b485e['IsbtG'],_0x4b485e[_0x313705(0xedf,0x79,0xd4a,0x993)])){if(_0x1bac1f)return _0x4b485e[_0x23937d(0x146e,0x14bb,0x749,0x1da3)](_0x1db05d,mess[_0x313705(0x982,0x1256,-0xa0,-0x578)]);if(_0x1e03f5)return _0x4b485e[_0x313705(0x1133,0x10d0,0x15d7,0x1f19)](_0x1db05d,mess[_0x23937d(0x5c0,0x1197,0xb7e,-0x10b)]);if(!_0x1ba32f[-0x4ea+-0x6*0x205+0x4*0x442])return _0x1db05d(_0x313705(0x105b,0xfc7,0x4fb,0x1235)+'e\x20link?');try{const _0x485107={};_0x485107['url']=_0x1ba32f[-0x114a+0x1*0xb6e+0x5dc];const _0x2535e6={};_0x2535e6['title']=''+global[_0x23937d(0x96c,0x10a9,0xd4b,0x48d)],_0x2535e6[_0x313705(0x1948,0x20ae,0x17ed,0x11c5)]=''+global[_0x23937d(0x1cd5,0x1dee,0x21f2,0x21f5)],_0x2535e6[_0x313705(0x1a4f,0x1a78,0x1de5,0x1aa1)]=log0,_0x2535e6[_0x313705(0x1248,0x1fa7,0xaf4,0x1722)]=0x2,_0x2535e6[_0x313705(0x13f2,0x1a18,0x226b,0x6dc)]=''+global['btnurl'],_0x2535e6[_0x313705(0x1b56,0x1b34,0x1bd0,0x23e1)]=''+global['btnurl'];const _0x250c92={};_0x250c92['externalAd'+_0x23937d(0x320,0x566,-0x568,-0x834)]=_0x2535e6;const _0x4b3a79={};_0x4b3a79[_0x313705(0x1fa9,0x2adc,0x10cb,0x1cb0)]=_0x485107,_0x4b3a79['caption']=_0x313705(0x18d3,0x1e10,0x10da,0x1290),_0x4b3a79[_0x23937d(0x341,0x10ec,-0x2f1,0x4f2)+'o']=_0x250c92;const _0x597db8={};_0x597db8['quoted']=_0x5cd288,_0x175756[_0x23937d(0x944,0xcb7,0x12a9,-0x45d)+'e'](_0x423161,_0x4b3a79,_0x597db8);}catch{_0x4b485e[_0x313705(0x3b7,-0x56e,0x1205,-0x68f)](_0x1db05d,_0x4b485e[_0x313705(0x8a0,0x36e,0xf8d,0x62d)]);}}else{const _0x59e244={};_0x59e244[_0x23937d(0x1d39,0x2603,0x23bf,0x2243)]=''+_0x4e3a2b[_0x313705(0x10c4,0x1eb0,0xcbc,0x535)];const _0x23923d={};_0x23923d[_0x313705(0x942,-0x3b8,0x134,-0x4ce)]=_0x81642a,_0x3fc5ec[_0x23937d(0x944,0x6c,0x119c,0x9ad)+'e'](_0x4e4bf6[_0x23937d(0x118c,0x20a9,0xc8a,0x1567)],_0x59e244,_0x23923d);}}break;case _0x23937d(0x112d,0x2bc,0x176e,0x87b):{if(_0x4b485e[_0x23937d(0x1dad,0x2146,0x2938,0x1749)](_0x4b485e['ugyaU'],'slFuB')){if(!_0x480456[_0x23937d(0x1d23,0x297a,0x2ab4,0x13ec)])return _0x4b485e[_0x23937d(0x1b10,0x1dfb,0x11d1,0x1179)](_0x3f3727,''+_0x4b0c28[_0x313705(0x152c,0x19c2,0x236f,0xe64)]);if(!_0x4b485e[_0x313705(0xacf,0x2e5,0x5b2,0xdd0)](_0x511887[_0x23937d(0x118c,0xb0f,0x19b2,0x1dce)],_0x54a469))return _0x4b485e[_0x313705(0xd17,-0x13,0xd48,0xc84)](_0x5d6b3a,'_*No\x20Votin'+_0x313705(0xc7f,-0x287,0x371,0x357)+'Group!*_\x0a\x0a'+'*'+_0x1d1633+(_0x313705(0xb3f,-0x369,-0x2d6,0x87a)+_0x313705(0x176f,0x2099,0xb2f,0xa89)+_0x23937d(0x19bf,0x2724,0x114a,0x1688)));delete _0x176525[_0x2396d9[_0x23937d(0x118c,0x1cee,0x91b,0x7cb)]],_0x4b485e[_0x313705(0x44d,0xaa9,0xaaf,-0x128)](_0x1876dd,_0x4b485e[_0x23937d(0x18cc,0x1747,0xe5c,0x1d0e)]);}else{if(_0x1bac1f)return _0x4b485e[_0x313705(0x10ff,0xd05,0x96b,0x520)](_0x1db05d,mess[_0x23937d(0x61c,-0x7e5,0xdfb,0x1097)]);if(_0x1e03f5)return _0x4b485e[_0x313705(0xe90,0x1407,0x787,0x2b6)](_0x1db05d,mess[_0x23937d(0x5c0,0x66f,0xa76,-0x256)]);if(!_0x494254)return _0x4b485e['BfkIp'](_0x1db05d,_0x23937d(0x192d,0x1f92,0x235e,0xdb4)+_0x23937d(0xa8,-0xe75,0xad2,0xed9)+_0x313705(0x13eb,0x7d9,0x1354,0x162c));const {instagramdl:_0x1dc715,instagramdlv2:_0x74b8df,instagramdlv3:_0x397e3a}=_0x4b485e[_0x23937d(0x3ff,0x751,0xd42,0x60)](require,_0x4b485e[_0x23937d(0xcbd,0xde6,0x26,0x1033)]);if(!_0x4b485e['nWCiP'](isUrl,_0x1ba32f[-0x1a54+0x22*-0x7b+-0x1*-0x2aaa])&&!_0x1ba32f[-0x4*0x51+-0x11b7+0x12fb][_0x313705(0x4de,0x15,-0x225,-0x9d5)](_0x4b485e[_0x23937d(0x106d,0xb41,0x54e,0x19c5)]))return _0x4b485e[_0x313705(0x115e,0x1fef,0x1451,0x40e)](_0x1db05d,_0x4b485e[_0x23937d(0xf5,-0x219,-0x7da,-0xbc3)]);_0x4b485e[_0x23937d(0x1963,0x166b,0x1394,0x1c0d)](_0x397e3a,''+_0x494254)[_0x23937d(0x1b61,0x23f2,0x2491,0x289d)](async _0x509615=>{var _0x42f059=await _0x4b485e['gZmpZ'](getBuffer,_0x509615[0x1*0x493+-0x3*0x3ce+0x6d7][_0x43404c(0x1c43,0x1c1d,0x19d6,0x231c)]);const _0x210aaa={};_0x210aaa[_0x52764f(0xf0c,0x179c,0x9cb,0x622)]=_0x509615[-0x77+0x25cf+-0xa*0x3bc][_0x52764f(0x139d,0xfef,0x9cb,0x378)];function _0x52764f(_0x3401e2,_0x57e0ea,_0x379048,_0x3875c9){return _0x23937d(_0x379048- -0xae,_0x57e0ea,_0x379048-0x15e,_0x3875c9-0x19a);}const _0x7b91b3={};_0x7b91b3[_0x43404c(0x1d69,0x284d,0x1a4f,0x164e)]=_0x210aaa,_0x7b91b3['jpegThumbn'+_0x52764f(0x90,0xa9d,0xc63,-0x177)]=_0x42f059,_0x7b91b3[_0x43404c(0x13df,0x829,0xc55,0x334)]=''+botname;function _0x43404c(_0x113c46,_0x5408e9,_0x345ba0,_0x4706d0){return _0x23937d(_0x345ba0-0x2ed,_0x113c46,_0x345ba0-0x174,_0x4706d0-0x115);}_0x175756[_0x52764f(0xeb0,0x10da,0x896,0x146d)+'e'](_0x5cd288[_0x52764f(0x949,0x40b,0x10de,0x1aa0)],_0x7b91b3,{'quoted':_0x5cd288});})[_0x313705(0xc9a,0xe95,0x8b7,0x18d2)](_0xf1c55f=>{function _0x11c23e(_0x29dfb6,_0x3cfdf4,_0x1ec646,_0x1d7a86){return _0x23937d(_0x1d7a86-0x15a,_0x29dfb6,_0x1ec646-0x1c7,_0x1d7a86-0xca);}function _0x35f2cc(_0x1004c8,_0x3db9a0,_0x84ea93,_0x4cdcdf){return _0x313705(_0x1004c8- -0x8e,_0x84ea93,_0x84ea93-0x31,_0x4cdcdf-0x53);}if(_0x4b485e[_0x35f2cc(0x104e,0x9be,0x158e,0x6b0)](_0x4b485e[_0x35f2cc(0x1bdf,0x2610,0x2247,0x1a50)],_0x11c23e(0xe19,0x2655,0xade,0x18e9))){const _0x1b4a0f={};_0x1b4a0f[_0x11c23e(0x2015,0x15ba,0x1af8,0x154e)+'t']=_0x4b485e[_0x11c23e(0xc52,0x18e7,0x1742,0x183b)];const _0x1340fa={};_0x1340fa['buttonId']=_0x105daf+(_0x11c23e(0x163e,0x1aa8,0x1506,0x13c7)+'u'),_0x1340fa['buttonText']=_0x1b4a0f,_0x1340fa['type']=0x1;const _0x551727={};_0x551727[_0x35f2cc(0x16cc,0x23f1,0x18a1,0x2087)+'t']=_0x4b485e[_0x35f2cc(0x1760,0x18cd,0x24e3,0xb73)];const _0x4e7421={};_0x4e7421[_0x11c23e(0x1fc9,0x15f0,0xd7d,0x1c66)]=_0xfa74b9+(_0x11c23e(0xea1,0x1d43,0x1640,0x1149)+'nu'),_0x4e7421['buttonText']=_0x551727,_0x4e7421[_0x11c23e(0x9b8,0x1545,0x122a,0x892)]=0x1;const _0x20c26b={};_0x20c26b['displayTex'+'t']=_0x4b485e[_0x35f2cc(0x15c0,0x2473,0xd04,0x1c25)];const _0xf8e835={};_0xf8e835[_0x11c23e(0x1303,0x1a5c,0x210f,0x1c66)]=_0xaa86f7+(_0x11c23e(0x10af,0x413,0x14e2,0xc68)+'ermenu'),_0xf8e835[_0x11c23e(0x165d,0x22f0,0xad5,0x16f6)]=_0x20c26b,_0xf8e835[_0x35f2cc(0xa10,0x152f,0x91a,0xa94)]=0x1;let _0x4b1623=[_0x1340fa,_0x4e7421,_0xf8e835];const _0x436bb6={};_0x436bb6[_0x35f2cc(0x2011,0x1db7,0x2201,0x26fa)]=_0x35f2cc(0xeb6,0x401,0x1144,0x305)+_0x11c23e(0x1005,0xd87,0x15c0,0xed4),_0x436bb6[_0x35f2cc(0xf12,0x118c,0x7c3,0xc3f)]=_0x4b1623,_0x436bb6[_0x35f2cc(0x1df1,0x2960,0x1f3e,0x1883)]=0x4;let _0xc8f974=_0x436bb6;_0x4152f2['sendMessag'+'e'](_0x3d5a76['chat'],_0xc8f974);}else _0x4b485e[_0x11c23e(0x1229,0x1981,0x15ab,0x1235)](_0x1db05d,mess['error']);});}}break;case _0x4b485e[_0x23937d(0x1b91,0x1874,0xfc7,0x18b7)]:case'td':case _0x4b485e[_0x23937d(0xf32,0xa68,0x189d,0xcbd)]:{if(_0x1bac1f)return _0x4b485e[_0x23937d(0x14be,0x1f85,0xe5d,0xe6d)](_0x1db05d,mess[_0x313705(0x982,0x1d3,0xc20,-0xb4)]);if(_0x1e03f5)return _0x4b485e['PPYVe'](_0x1db05d,mess[_0x23937d(0x5c0,-0x226,0x13f7,-0x525)]);if(!_0x494254)return _0x4b485e[_0x313705(0x118c,0x1049,0x9b5,0x7ed)](_0x1db05d,_0x23937d(0x192d,0x1b4a,0x111d,0x1286)+_0x23937d(0x1700,0xfdf,0x1e57,0x1c86));if(!_0x4b485e['etKFA'](isUrl,_0x1ba32f[0x1b5a+-0x4f*0x76+0x910])&&!_0x1ba32f[0x3*-0xa65+-0x2bf*-0x3+0x16f2]['includes'](_0x4b485e[_0x23937d(0x11a5,0x1efc,0x15d2,0x1201)]))return _0x4b485e[_0x313705(0x18ef,0x2345,0xe47,0x144b)](_0x1db05d,_0x23937d(0x18a0,0x1d82,0x1d27,0x1e07)+'ou\x20provide'+'d\x20is\x20not\x20v'+_0x313705(0xbdc,0x16f7,0x1905,0x16b6));xeonkey[_0x23937d(0x4e4,0xf7b,0x13ad,0x201)](''+_0x494254)[_0x23937d(0x1b61,0xf52,0x2303,0x135e)](async _0x5cb889=>{let _0x2fbb8f=_0x3b0e60(0x1a57,0x2af8,0x1ca1,0xfce)+_0x3b0e60(0x1471,0x1e32,0xfd0,0xbe0)+'\x0a\x0a';_0x2fbb8f+='*'+dragonemoji+_0x16aa64(0x1b37,0x410,0x11ee,0x1bb1)+_0x5cb889[_0x3b0e60(0x1086,0xfb0,0x192f,0x1e57)]+'\x0a',_0x2fbb8f+='*'+dragonemoji+(_0x16aa64(0x1395,0x1397,0x199f,0x204d)+'\x20')+_0x5cb889[_0x3b0e60(0x2f4,-0x246,0x4cd,-0x762)][-0x11a4+-0x1*-0xeb9+0xb*0x44]['quality']+'\x0a',_0x2fbb8f+='*'+dragonemoji+_0x3b0e60(0xffa,0x125e,0xe5b,0x1e2)+_0x5cb889[_0x3b0e60(-0x20b,0xfff,0x4cd,-0x3b7)][0x1d*0x127+-0x1*0x2572+0x158*0x3]['extension']+'\x0a',_0x2fbb8f+='*'+dragonemoji+_0x16aa64(-0x7fd,0x1451,0x6c6,-0x5f1)+_0x5cb889[_0x3b0e60(0xcc0,0xfc1,0x4cd,0x4e9)][-0x2178+0xc0*-0x13+0x13*0x283][_0x3b0e60(0x419,0x493,0x1d5,-0xc6d)+_0x16aa64(-0x8e5,-0x8cb,0x574,0xee)]+'\x0a',_0x2fbb8f+='*'+dragonemoji+(_0x3b0e60(0x18d9,0x134a,0x1dc1,0x1c66)+'*\x20')+_0x5cb889[_0x3b0e60(0x18d,0x465,0x4cd,-0x956)][_0x3b0e60(0xcdb,0x120e,0x534,0x2c1)]+'\x0a',_0x2fbb8f+='*'+dragonemoji+_0x16aa64(0x14f1,0x646,0x630,0x1368)+_0x5cb889[_0x3b0e60(0x7ea,0x148f,0xbcf,0x1476)]+'\x0a\x0a',_0x2fbb8f+='*'+botname+'*';function _0x3b0e60(_0xf11a7d,_0x533e2b,_0x476703,_0x3b6b80){return _0x23937d(_0x476703-0x156,_0x3b6b80,_0x476703-0xc7,_0x3b6b80-0x5);}buf=await _0x4b485e[_0x3b0e60(0x6ab,0x1c41,0x1289,0x10e7)](getBuffer,_0x5cb889[_0x16aa64(0x1f09,0x15ae,0x16ed,0x1a08)]);const _0x5eb6de={};_0x5eb6de['url']=_0x5cb889[_0x3b0e60(0x1701,0xe3b,0x183f,0x23fb)];const _0x41786a={};_0x41786a[_0x3b0e60(0x1460,0x1b4a,0x1d99,0x2918)]=_0x5eb6de,_0x41786a[_0x16aa64(0xa27,-0x36c,0x4be,0xdb5)+_0x16aa64(0x11f1,0x7dd,0xd15,0x19bf)]=buf,_0x41786a[_0x3b0e60(0xe23,0x7cb,0xabe,0x13e9)]=''+_0x2fbb8f,_0x175756[_0x3b0e60(0xcba,0xe72,0xa9a,0x878)+'e'](_0x5cd288[_0x16aa64(0xa7c,0x1804,0x1190,0x1ee5)],_0x41786a,{'quoted':_0x5cd288});function _0x16aa64(_0x3878a4,_0x54ef54,_0x445608,_0x4dbd8a){return _0x23937d(_0x445608-0x4,_0x54ef54,_0x445608-0x164,_0x4dbd8a-0x1d);}for(let _0x38ef0f of _0x5cb889[_0x16aa64(0x37f,0x1187,0x37b,0xa36)]){const _0x3930b1={};_0x3930b1[_0x16aa64(0x5ba,-0x40d,0xa7d,0x7c4)]=_0x38ef0f[_0x16aa64(0xf02,0x1359,0xa7d,0x18d2)];const _0x33c5b2={};_0x33c5b2[_0x16aa64(0x1f73,0x995,0x1766,0xe8e)]=_0x3930b1,_0x33c5b2[_0x3b0e60(0x1275,0x147f,0x610,0xd23)+_0x16aa64(0x1660,0x10aa,0xd15,0x128d)]=buf,_0x33c5b2['caption']='*'+_0x494254+'*',_0x175756['sendMessag'+'e'](_0x5cd288[_0x16aa64(0x1190,0x17bf,0x1190,0x361)],_0x33c5b2,{'quoted':_0x5cd288});}})[_0x313705(0xc9a,0x1198,0x1484,0xf19)](_0x4b6ee7=>{function _0x36061e(_0x40b3ff,_0x5f5a5c,_0x5e0d7d,_0x175539){return _0x23937d(_0x5f5a5c-0x2e3,_0x5e0d7d,_0x5e0d7d-0xc7,_0x175539-0xe1);}function _0x34ff70(_0x4d0f98,_0xc6b84,_0x4d729f,_0x3904fe){return _0x23937d(_0x4d729f- -0x138,_0x4d0f98,_0x4d729f-0x1d8,_0x3904fe-0xb6);}_0x4b485e[_0x36061e(0xf98,0xdb1,0x638,0x39e)](_0x1db05d,mess[_0x36061e(0x2ad4,0x2093,0x1bfe,0x2b3c)]);});}break;case _0x23937d(0x726,0xbab,-0x107,0x149e):case _0x4b485e['OcJiA']:{if(_0x4b485e['zUQNV']!==_0x4b485e['zUQNV']){const _0x35437f=_0x4b485e[_0x23937d(0x1100,0x3d0,0x1f7b,0x333)][_0x23937d(0xccf,0xaf5,0x59e,0x1b50)]('|');let _0x5b84ef=0x1563+-0x1*-0x1119+-0x267c;while(!![]){switch(_0x35437f[_0x5b84ef++]){case'0':_0xfcf932[_0x23937d(0x25d,-0x65c,0xd60,-0x9ca)]=![];continue;case'1':_0x39d051(_0x4b485e[_0x313705(0x511,0xe11,-0x86a,-0x1c)]);continue;case'2':if(!_0x4eb659)return _0x4b485e[_0x313705(0x59f,0x973,0x8d0,0x9d0)](_0x22e494,''+_0x31380e[_0x313705(0xfea,0xf43,0x1946,0x970)]);continue;case'3':if(_0xe9bb61)return _0x4b485e[_0x23937d(0xfd,-0x4b6,0xda5,-0xbc8)](_0x361ffc,_0xc19320[_0x23937d(0x61c,-0x393,0xbf4,0xb52)]);continue;case'4':if(_0x333edf)return _0x4b485e[_0x313705(0x1f8a,0x1d22,0x1994,0x27c2)](_0x149dee,_0x13e6d9['banChat']);continue;}break;}}else{if(_0x1bac1f)return _0x1db05d(mess[_0x313705(0x982,0xbfe,0x2e9,0x11df)]);if(_0x1e03f5)return _0x4b485e[_0x313705(0x1e94,0x1d0c,0x1651,0x2441)](_0x1db05d,mess[_0x23937d(0x5c0,-0x898,-0xae,0x1119)]);if(!_0x494254)return _0x4b485e[_0x23937d(0xa1d,0x10a1,0x116f,0x546)](_0x1db05d,'Where\x20is\x20t'+_0x313705(0x1a66,0x1790,0x2796,0xc57));if(!isUrl(_0x1ba32f[-0x1b7+-0xcc5+-0xce*-0x12])&&!_0x1ba32f[0x17c4+0x481*-0x7+0x7c3][_0x23937d(0x178,-0xa4,-0x398,0xce8)](_0x313705(0x16bf,0x83a,0xa66,0xf4e)+'m'))return _0x4b485e[_0x313705(0x1d8c,0x27d2,0x25a2,0x10fa)](_0x1db05d,_0x313705(0x1271,0x759,0x16e8,0x1c9c)+_0x313705(0x5e3,-0x48b,0xa13,0xba3)+_0x23937d(0x1443,0xb6d,0x136d,0xb13)+'valid*');xeonkey[_0x23937d(0x4e4,0x129a,0x1134,0x2d2)](''+_0x494254)[_0x313705(0x1ec7,0x1176,0x1360,0x1a41)](async _0x52c76d=>{function _0x334e59(_0x554d6d,_0x3b5d6c,_0x129ec1,_0xba9caf){return _0x23937d(_0x129ec1- -0x192,_0xba9caf,_0x129ec1-0x1eb,_0xba9caf-0xd9);}const _0x397c70={'doFyy':function(_0x57b66d,_0x5f1ecd){function _0x4e7cb8(_0xed34d3,_0x50b191,_0x1f2077,_0x1a9661){return _0x2506(_0x1a9661- -0x15f,_0xed34d3);}return _0x4b485e[_0x4e7cb8(0x151f,0x2587,0x1995,0x1d2d)](_0x57b66d,_0x5f1ecd);},'rgSlg':_0x334e59(0xc69,0xcf0,-0x18c,0x40a),'kfNIH':_0x4b485e['JkqmH']};function _0x35be77(_0x17711e,_0x29548d,_0x489d19,_0xa56ce4){return _0x313705(_0x17711e- -0x492,_0xa56ce4,_0x489d19-0x191,_0xa56ce4-0x4d);}if(_0x4b485e[_0x35be77(0x16e8,0x7dc,0xb87,0x10dd)]!==_0x4b485e[_0x35be77(0x262,0x1043,0xb99,-0x554)]){const _0x2d6adb={};_0x2d6adb[_0x334e59(-0x60a,0xfa0,0x8e7,-0x451)]=_0x52c76d[_0x334e59(-0xaaf,-0x13e,0x1e5,-0x97f)][-0x1d*0x13a+0x1d1+0x21c2][_0x35be77(0x94d,0xf1b,0x150e,-0x356)];const _0x4b0e69={};_0x4b0e69['audio']=_0x2d6adb,_0x4b0e69[_0x35be77(0x117e,0x661,0x40c,0x13ab)]=_0x4b485e[_0x334e59(0x91d,0x6ec,0xeed,0x91a)],_0x175756['sendMessag'+'e'](_0x5cd288[_0x35be77(0x1060,0x16f7,0xe20,0x15d3)],_0x4b0e69,{'quoted':_0x5cd288});}else{_0x3a9ab5[_0x334e59(-0xa9,-0x5d4,-0x187,-0xf04)](_0x4adafc);if(_0x3ee996)return _0x397c70['doFyy'](_0x449563,_0x397c70[_0x334e59(0x1d24,0x1f32,0x18a5,0xa62)]);_0x2633e3=_0x13ad68[_0x334e59(0x1bc3,0x36b,0x122b,0x67d)+'nc'](_0x59ebcd);const _0x31bc4a={};_0x31bc4a['audio']=_0x1b2ab1,_0x31bc4a[_0x35be77(0x117e,0x1ef9,0x1751,0x15ff)]=_0x397c70[_0x35be77(0x675,0x6ee,0xaf3,0xa30)],_0x31bc4a[_0x334e59(0x12d6,0x830,0xa47,0x770)]=!![];const _0x237288={};_0x237288[_0x334e59(0x7b5,0xc52,0x44a,-0x284)]=_0x4ee510,_0x3711d1[_0x334e59(0xf36,0x291,0x7b2,0x586)+'e'](_0x31fc52,_0x31bc4a,_0x237288),_0x36e9dd[_0x35be77(-0x121,0xc4a,-0xcd5,-0x98)](_0x2f1f73);}})[_0x313705(0xc9a,0x13df,0x1042,0x493)](_0x4d3aec=>{function _0x307bbc(_0x27f51f,_0xc7a606,_0xa7d9b6,_0x4af7bb){return _0x313705(_0x27f51f- -0x304,_0x4af7bb,_0xa7d9b6-0x1ad,_0x4af7bb-0x165);}function _0x203140(_0x301f9c,_0x4635f6,_0x93c2d1,_0x557e74){return _0x23937d(_0x93c2d1-0x480,_0x4635f6,_0x93c2d1-0x69,_0x557e74-0xe0);}if(_0x4b485e[_0x203140(0x1868,0xe70,0x1102,0x1a8b)]!==_0x4b485e[_0x203140(0x4b8,0xc46,0x1102,0x108b)]){const _0x244994={};_0x244994[_0x307bbc(0x1d9b,0x1e84,0x1bc0,0x1cb5)]='🙄',_0x244994[_0x203140(0xe66,0x156e,0xdcf,0x294)]=_0x132449[_0x307bbc(0x9b1,0xac1,-0x2ea,0x11ae)];const _0x39f3cb={};_0x39f3cb[_0x203140(0x2a70,0x1414,0x1e3a,0x15a2)]=_0x244994,_0x382d10[_0x307bbc(0x9a6,0x2d2,-0x4dd,-0x34a)+'e'](_0x82e183,_0x39f3cb);const _0x57fdd2={};_0x57fdd2[_0x203140(0x2289,0x1c7e,0x21b9,0x1da4)]=''+_0x460d99[_0x203140(0x127,-0x90c,0x51e,0x120f)];const _0x408a12={};_0x408a12[_0x203140(0x115f,0x1627,0xa5c,0x434)]=_0x126ece,_0x14b76a[_0x307bbc(0x9a6,-0x558,0xbd0,-0x331)+'e'](_0x451397[_0x307bbc(0x11ee,0x858,0x1fd7,0xf75)],_0x57fdd2,_0x408a12);}else _0x4b485e[_0x307bbc(0x19c4,0x22c8,0x1c2a,0x1aec)](_0x1db05d,mess['reply']);});}}break;case _0x4b485e['aLibC']:case _0x4b485e[_0x313705(0x177b,0x2626,0x21ca,0xb2a)]:case _0x23937d(0x13d3,0xd22,0x1b1c,0x17d6):{if(_0x1bac1f)return _0x1db05d(mess[_0x23937d(0x61c,0x1162,-0x2a6,0x44e)]);if(_0x1e03f5)return _0x4b485e[_0x23937d(0x4c6,0x2ee,0xd25,0x572)](_0x1db05d,mess[_0x313705(0x926,0x142b,0x353,-0x2fc)]);if(!_0x1ba32f[0x2*-0x43c+-0x3a*0x33+0x1406])return _0x1db05d(_0x23937d(0xaff,0xaa8,-0xb9,0xad4)+_0x4b485e[_0x313705(0xb3b,0x7a6,0xc6a,0x661)](_0xe1d953,_0x1354e9)+(_0x313705(0x2034,0x2829,0x257b,0x16c7)+_0x313705(0x8f3,-0x4a5,0xee,-0x3c9)+'/cinema21/'+_0x313705(0x708,0x13d9,-0x2b2,0x4ff)+'7754155644'+'821504?t=r'+_0x23937d(0x1277,0x1c11,0x15d0,0x9d7)+_0x313705(0x95e,-0x4e2,0x24a,0x884)+_0x23937d(0xbfc,0x735,0x982,0xee7)));try{let _0x306635=await _0x4b485e[_0x313705(0x1cda,0x1de0,0x1aeb,0x287b)](aiovideodl,_0x1ba32f[0x183*0x17+-0xc73+-0x1652*0x1]);teks=_0x23937d(0xe4c,0x1293,0xc47,0xfb1)+_0x23937d(0x4d6,0xcc4,-0x3d7,0xf86)+_0x313705(0x14cf,0xffa,0x1439,0x1e17)+_0x23937d(0xb67,0x19fa,-0xea,0x164)+(_0x306635[_0x23937d(0x17d9,0x11c8,0x215a,0x199d)]?_0x306635[_0x313705(0x1b3f,0x1f53,0x14e4,0xe01)]:_0x4b485e[_0x313705(0x8f0,0x86,-0x50e,0xa03)])+_0x23937d(0xb74,0x5f1,0x1271,0x23d)+_0x306635[_0x313705(0x6dd,0x9f3,0x621,-0x814)][-0x19b4+0xb51*0x3+0x1*-0x83e][_0x23937d(0x848,0x111d,0x14b0,-0x39b)]+_0x23937d(0xe66,0x50c,0x95d,0x1a9c)+_0x306635['medias'][-0x16*-0xf9+-0x1c05*-0x1+-0x316a][_0x23937d(0x7f,0x19d,-0x49f,-0xe)+_0x23937d(0x570,0x5ee,0xedb,-0x80d)]+_0x313705(0x20b0,0x2d4b,0x13ba,0x2c99)+_0x306635['medias'][0x1375+0x1ebf+-0x3233][_0x23937d(0xa79,0xddf,0x12a5,0xa81)]+(_0x313705(0x1b53,0x231b,0x2133,0xc8c)+_0x23937d(0xfdc,0x1260,0xfcb,0x828)+'quality\x20be'+_0x23937d(0xed7,0x85,0x13f1,0x2b4)+'cking\x20the\x20'+'button_');const _0x35d3f3={};_0x35d3f3[_0x313705(0x1e72,0x1ebb,0x2d4f,0x2712)]=_0x313705(0x6ad,-0x230,0xd2e,0x13a1)+_0x306635['medias'][-0x16b1*-0x1+0x529*-0x2+0x1*-0xc5f][_0x23937d(0xa79,0x183e,0xc7,0x1350)],_0x35d3f3[_0x313705(0x1902,0x1b94,0x1e87,0x24ee)]={},_0x35d3f3[_0x23937d(0x738,0x2e7,0x7ac,0x47e)]=0x1,_0x35d3f3[_0x313705(0x1902,0x1b94,0x1e87,0x24ee)][_0x313705(0x175a,0x167d,0x1701,0x135e)+'t']=_0x23937d(0x22,-0x861,-0xb5b,0x185)+_0x306635[_0x23937d(0x377,0xd5c,0x419,0x11c9)][-0x1f36+0x8e*0x45+-0x1c4*0x4]['quality'];const _0x3965ce={};_0x3965ce[_0x23937d(0x1b0c,0xbed,0xcbc,0x16d6)]=_0x313705(0x6ad,0xc1b,0x11d9,-0xaf)+_0x306635[_0x313705(0x6dd,0x1b8,0x6b4,0x151)][-0xc80+-0x12e9*0x1+-0x1f6b*-0x1]['url'],_0x3965ce[_0x313705(0x1902,0xd27,0xe89,0xde0)]={},_0x3965ce['type']=0x1,_0x3965ce[_0x313705(0x1902,0xd27,0xe89,0xde0)]['displayTex'+'t']=_0x23937d(0x22,-0x4c2,0xaf6,0xb3c)+_0x306635['medias'][-0x1*0x67+-0x1*0x1ec7+0x1f30][_0x23937d(0x780,-0x408,0x8eb,0x12f8)];let _0x2e1f45=[_0x35d3f3,_0x3965ce];const _0xb81656={};_0xb81656[_0x313705(0xddf,0x11a8,0x1b80,0x180f)]=_0x306635[_0x313705(0x6dd,0xdd6,0x14bb,0xcce)][-0x12ac+-0xafc+-0x1*-0x1da9][_0x313705(0xddf,0x995,0x152d,0x13e7)];const _0x517e02={};_0x517e02[_0x23937d(0x17d9,0x1e16,0xd3b,0x268b)]=''+global[_0x313705(0xcd2,0x464,0x11d7,0x167d)],_0x517e02[_0x313705(0x1948,0xcc9,0x1d86,0x20f5)]=_0x306635[_0x313705(0x1b3f,0x1937,0x1477,0x2a0a)]?_0x306635[_0x313705(0x1b3f,0x1b90,0x206b,0x223f)]:_0x23937d(0xfd4,0x3cf,0x10cf,0x1cc5)+_0x23937d(0x1558,0x11c3,0x191e,0x9d1),_0x517e02[_0x23937d(0x16e9,0xce1,0x1cb7,0x1d60)]=log0,_0x517e02[_0x23937d(0xee2,0x173a,0x194f,0xc5f)]=0x1,_0x517e02['mediaUrl']=_0x1ba32f[-0xae6+-0x607+0x10ed],_0x517e02['sourceUrl']=_0x1ba32f[-0xa*-0xc7+-0x1c78+0x14b2];const _0x429e76={};_0x429e76[_0x313705(0x7de,0xa2c,0x1182,0xd02)+_0x23937d(0x320,0x849,-0x1c1,0x111)]=_0x517e02;const _0x484264={};_0x484264[_0x313705(0x1ac8,0x1074,0x23a9,0xc8e)]=_0xb81656,_0x484264[_0x313705(0xcce,0x16f3,0x1073,0x251)]=teks,_0x484264[_0x313705(0x13d4,0x1162,0x1ea6,0x9af)]=''+_0xa43395,_0x484264[_0x23937d(0xc3a,0x390,0xdb4,0x8f1)]=_0x2e1f45,_0x484264['headerType']=0x4,_0x484264['contextInf'+'o']=_0x429e76;let _0x117f6a=_0x484264;const _0x2e030d={};_0x2e030d[_0x23937d(0x5dc,0x13ac,0x1401,-0x2fe)]=_0x5cd288,_0x175756[_0x313705(0xcaa,0xce8,0x232,0x6c4)+'e'](_0x423161,_0x117f6a,_0x2e030d);}catch{_0x1db05d(_0x4b485e[_0x313705(0x1c67,0x28a2,0x23d1,0x1d9e)]);}}break;case _0x23937d(0x158c,0x1a76,0xa3b,0x918):{if(_0x4b485e[_0x313705(0xc6b,0xa05,0x639,0x18d8)]!==_0x4b485e[_0x313705(0xc6b,0xa60,0x90b,0x1aca)]){const _0x3450dd=_0x4b485e['AVLEn'][_0x313705(0x1035,0x9e0,0x129f,0xe6c)]('|');let _0xac6e46=0x2644+-0x93b*0x1+-0x1d09;while(!![]){switch(_0x3450dd[_0xac6e46++]){case'0':if(!_0x4637da)return _0x4b485e[_0x313705(0xd03,0x16ae,0xd7b,0x1632)](_0x5a01a5,_0x313705(0x5f4,-0x22b,-0x33a,0x13ef)+'Bug\x0a\x0aExamp'+_0x313705(0x1bd2,0x1c05,0x27e0,0x149e)+_0xf6aaac+(_0x313705(0x149d,0xb57,0x22e8,0x174d)+'r'));continue;case'1':_0x4b485e[_0x313705(0xa71,0x1839,0x1388,-0x49d)](_0x4cf014,_0x313705(0x17d7,0xcf8,0x18b7,0x20c1)+_0x23937d(0x13d0,0x1689,0x76c,0xe08)+_0x313705(0xe97,0x202,0x18e5,0x14e6)+_0x313705(0x70c,0x815,0x747,0x83c)+'se\x20Make\x20Su'+_0x313705(0x12a4,0x1feb,0x1630,0x1d2c)+_0x313705(0x521,0x371,0x12a5,-0x509)+'\x20If\x20You\x20Pl'+_0x23937d(0x17fe,0x2440,0x20bd,0x19c7)+'is,\x20Use\x20Th'+_0x23937d(0x1d0a,0x1e91,0x23b2,0x275b)+'\x20Again\x20And'+_0x313705(0x3ed,0x78c,0x1210,0x98)+_0x313705(0xad3,-0x14c,0x5ca,0x173f)+_0x23937d(0x19d4,0x1162,0x17c4,0x1b2b)+_0x23937d(0x129b,0x12ff,0x155e,0x415)+_0x23937d(0x104a,0xa4d,0x1ea9,0x17b1)+'\x20!');continue;case'2':if(_0x1f5cb8)return _0x4b485e[_0x313705(0x1d7d,0x2c7d,0x111a,0x1c3a)](_0x2030cd,_0x2d5a36['banChat']);continue;case'3':if(_0x63d3d9)return _0x37fc98(_0x4593d4[_0x313705(0x982,0x251,-0x19b,0xd7)]);continue;case'4':_0x1da715[_0x23937d(0x944,0x7f8,0x53d,0x1029)+'e'](_0x12a4e6+(_0x23937d(0xf25,0xecc,0x7c1,0x1032)+_0x23937d(0x1c1f,0x239f,0x268b,0x1a26)),{'text':_0x313705(0x173c,0x9f9,0x1ef3,0xa9c)+_0x23937d(0x1739,0x1288,0x2577,0x182f)+_0x23937d(0x1860,0x151f,0x230a,0x1be5)+_0x1478cb[_0x313705(0x1834,0x138e,0xebd,0x1a13)]['split']('@')[0x27e+0x1ace+-0x1d4c]+(_0x23937d(0x325,-0x763,0x4c5,-0xb03)+_0x313705(0x1bf6,0x2934,0x24f5,0x189f))+_0x4f1d97});continue;}break;}}else{if(_0x1bac1f)return _0x4b485e[_0x23937d(0x1382,0x151e,0x165b,0xd89)](_0x1db05d,mess[_0x313705(0x982,0x15ac,0x1620,0xd09)]);if(_0x1e03f5)return _0x4b485e[_0x313705(0x2086,0x2838,0x157b,0x242e)](_0x1db05d,mess[_0x23937d(0x5c0,0xa52,-0x8d8,-0x57e)]);const _0x3feaf6={};_0x3feaf6['displayTex'+'t']=_0x23937d(0x1a34,0x1def,0x1548,0x223b);const _0x1af645={};_0x1af645[_0x23937d(0x1b0c,0x256c,0x2517,0xedc)]=_0x313705(0x1d76,0x10b9,0x136a,0x1e7e),_0x1af645[_0x23937d(0x159c,0x7f3,0x1cf7,0x1cbf)]=_0x3feaf6,_0x1af645[_0x313705(0xa9e,0xbaf,0x663,0x1586)]=0x1;let _0x282d8d=[_0x1af645];const _0x45a2ce={};_0x45a2ce['url']=_0x1ba32f[-0x14ac+0x6a1+0x1*0xe0b];const _0x4640cb={};_0x4640cb[_0x313705(0x1ac8,0x2255,0x1f83,0x2624)]=_0x45a2ce,_0x4640cb[_0x313705(0xcce,0xdc4,-0x96,0x897)]=_0x4b485e[_0x23937d(0x3a0,0x8ed,0x503,-0x69a)],_0x4640cb[_0x23937d(0x106e,0xbc2,0xe98,0x192f)]=''+_0xa43395,_0x4640cb['buttons']=_0x282d8d,_0x4640cb[_0x313705(0x1e7f,0x1fa8,0x20dc,0x1ebf)]=0x4,_0x4640cb[_0x23937d(0x341,-0xafb,-0x3e9,-0x7d1)+'o']={},_0x4640cb[_0x23937d(0x341,-0xafb,-0x3e9,-0x7d1)+'o'][_0x23937d(0x478,0x89,0x11f0,0xce)+_0x23937d(0x320,0xd6c,0xcd6,0x888)]={},_0x4640cb[_0x23937d(0x341,-0xafb,-0x3e9,-0x7d1)+'o'][_0x23937d(0x478,0x89,0x11f0,0xce)+_0x23937d(0x320,0xd6c,0xcd6,0x888)][_0x313705(0x1b3f,0xc58,0x29f2,0x1961)]=''+global[_0x313705(0xcd2,0xeb0,0xb55,0x10a2)],_0x4640cb[_0x23937d(0x341,-0xafb,-0x3e9,-0x7d1)+'o'][_0x23937d(0x478,0x89,0x11f0,0xce)+_0x23937d(0x320,0xd6c,0xcd6,0x888)][_0x23937d(0x15e2,0x1c02,0x220f,0x2081)]=_0x4b485e[_0x313705(0x157f,0x2107,0x22b6,0x97e)],_0x4640cb[_0x23937d(0x341,-0xafb,-0x3e9,-0x7d1)+'o'][_0x23937d(0x478,0x89,0x11f0,0xce)+_0x23937d(0x320,0xd6c,0xcd6,0x888)][_0x23937d(0x16e9,0x2425,0xef8,0x1c34)]=log0,_0x4640cb[_0x23937d(0x341,-0xafb,-0x3e9,-0x7d1)+'o'][_0x23937d(0x478,0x89,0x11f0,0xce)+_0x23937d(0x320,0xd6c,0xcd6,0x888)][_0x313705(0x1248,0xa02,0xd69,0x1bc2)]=0x1,_0x4640cb[_0x23937d(0x341,-0xafb,-0x3e9,-0x7d1)+'o'][_0x23937d(0x478,0x89,0x11f0,0xce)+_0x23937d(0x320,0xd6c,0xcd6,0x888)][_0x313705(0x13f2,0x1c80,0x162b,0x221f)]=_0x1ba32f[0xe4f+-0x3*0xd2+-0x1*0xbd9],_0x4640cb[_0x23937d(0x341,-0xafb,-0x3e9,-0x7d1)+'o'][_0x23937d(0x478,0x89,0x11f0,0xce)+_0x23937d(0x320,0xd6c,0xcd6,0x888)]['sourceUrl']=_0x1ba32f[-0x67*-0x21+0x223c+-0x2f83];let _0x1061c5=_0x4640cb;const _0x39b5b4={};_0x39b5b4[_0x313705(0x942,-0x2fe,-0x137,0x1420)]=_0x5cd288,_0x175756[_0x313705(0xcaa,-0x193,0xfc8,0xbba)+'e'](_0x423161,_0x1061c5,_0x39b5b4);}}break;case'ph':case _0x23937d(0x6b3,0x9cc,0x931,0xd5c):case _0x4b485e[_0x313705(0x1bcb,0x1c46,0x272f,0x2951)]:case _0x4b485e[_0x313705(0xe9f,0x5d2,0x1000,0xe7d)]:{if(_0x1bac1f)return _0x1db05d(mess[_0x23937d(0x61c,0x1451,0x1182,-0x50f)]);if(_0x1e03f5)return _0x4b485e[_0x313705(0x2090,0x2432,0x1879,0x2e2b)](_0x1db05d,mess[_0x313705(0x926,0xab4,0x123e,0x1021)]);if(!_0x494254)return _0x4b485e[_0x313705(0x1438,0x1723,0x1fa4,0x147b)](_0x1db05d,_0x313705(0x1c93,0x29ee,0x226f,0x24fe)+_0x23937d(0x1700,0x1283,0xddb,0xe79));if(!_0x1ba32f[-0x5cf*0x1+0x9*-0x10f+0xf56]['includes'](_0x23937d(0x18eb,0x1a09,0x1929,0x103b)+'m'))return _0x1db05d(_0x23937d(0x790,-0x2e3,-0x25e,0xa97)+_0x23937d(0xd5a,-0x78,0x20f,0x3d5)+_0x23937d(0x18fc,0x240d,0x2675,0x1b81));const _0x356edf={};_0x356edf[_0x313705(0x175a,0x1113,0x1c73,0x1c3c)+'t']=_0x4b485e[_0x313705(0x11b8,0x1b2f,0xde4,0x17ab)];const _0x45a7fa={};_0x45a7fa['buttonId']=_0x313705(0x15d0,0x2259,0x908,0x10e3)+_0x494254,_0x45a7fa[_0x313705(0x1902,0x1472,0x1974,0x1a9e)]=_0x356edf,_0x45a7fa[_0x23937d(0x738,0x1432,-0x498,-0x5f0)]=0x1;let _0x1fcaf2=[_0x45a7fa];const _0x3519ba={};_0x3519ba[_0x313705(0xddf,0x1b6a,0xa2a,0xb24)]=_0x4b485e['WPzAq'];const _0x415fef={};_0x415fef[_0x23937d(0x1c43,0x2ad4,0x27c0,0x11d9)]=_0x3519ba,_0x415fef['caption']=_0x313705(0xb7c,0x1359,0x5f5,0xdeb)+'═══════\x0a╠\x20'+'📥ʀᴇᴅ\x20ᴅʀᴀɢᴏ'+_0x313705(0x88a,-0x4b7,0x1591,0xe98)+_0x23937d(0x1509,0xf4b,0x1962,0x2185)+_0x313705(0x1391,0x1b94,0xf01,0x686)+_0x23937d(0x14e0,0x11da,0x707,0xbd2)+'══',_0x415fef['footer']=_0x175756['user']['name'],_0x415fef[_0x313705(0xfa0,0x396,0xb20,0x242)]=_0x1fcaf2,_0x415fef[_0x23937d(0x1b19,0x1392,0xe36,0x1d9d)]=0x4;let _0x1eb552=_0x415fef;_0x175756[_0x313705(0xcaa,0x95e,0x11ce,0x812)+'e'](_0x5cd288[_0x23937d(0x118c,0x7dd,0x2096,0x60d)],_0x1eb552,{'quoted':_0x5cd288});}break;case _0x23937d(0x15ac,0x19cc,0x100e,0x1aec):{const _0xd6c163={};_0xd6c163['text']=_0x313705(0xb7c,0x1242,0x1369,0x804)+_0x23937d(0x1026,0x86a,0xc33,0x194)+'📤ʀᴇᴅ\x20ᴅʀᴀɢᴏ'+'ɴ📤\x0a╠\x20🔞ᴘᴏʀɴ'+'ʜᴜʙ\x20ᴜᴘʟᴏᴀᴅ'+_0x313705(0x2148,0x1299,0x2ee7,0x2709)+'\x20📱VIDEO\x20📱\x0a'+_0x313705(0x6a5,0x1326,0x983,0xaf8)+_0x23937d(0xb7e,0xf6c,0xc3c,0x145d),_0x175756[_0x313705(0xcaa,0x1525,0xecc,0x1169)+'e'](_0x5cd288[_0x23937d(0x118c,0xb7d,0x1bb0,0x1496)],_0xd6c163,{'quoted':_0x5cd288});let _0x3ede4e=_0x4b485e[_0x313705(0x1499,0x866,0x16fd,0xd0c)](require,_0x4b485e[_0x313705(0x1023,0x172,0x3ee,0x516)]);_0x3ede4e[_0x23937d(0xb09,0xa49,0xc85,0x13ff)](''+_0x494254)[_0x23937d(0x1b61,0x15fa,0x1a30,0xf1f)](async _0x1e5388=>{function _0x46c9e8(_0x28053c,_0x40fac5,_0xfd2071,_0x8ae7c2){return _0x23937d(_0xfd2071-0x2c4,_0x8ae7c2,_0xfd2071-0xd0,_0x8ae7c2-0x9d);}function _0x480388(_0x1e00fa,_0x58e98a,_0x355f50,_0x182b31){return _0x313705(_0x58e98a- -0x285,_0x355f50,_0x355f50-0x80,_0x182b31-0x1a4);}if(_0x4b485e[_0x46c9e8(0x1cc8,0x2798,0x19ee,0x25be)](_0x4b485e[_0x46c9e8(0xd60,0x10ac,0x103c,0x62d)],_0x4b485e[_0x46c9e8(0x1f1b,0xad7,0x103c,0x16e2)])){if(!_0x7fdd9f)return _0x4b485e[_0x46c9e8(0x1810,0x2229,0x1574,0x157a)](_0xf3c420,_0x4b485e[_0x46c9e8(0x11ef,0x125c,0x1920,0x1814)]);let _0xc026de=_0x3d28a2[_0x46c9e8(0x6ad,0xb90,0xcaa,0x9a4)](_0x4362be);_0xac9faf[_0x480388(0x735,0x6dc,0xd8a,-0x597)](_0xc026de,0x4*0x2bf+-0x5c*0x6c+-0x4b*-0x5f),_0x4b485e['sgUEn'](_0x25fb64,_0x4b485e['JdVgb']);}else{const _0x32ee27={};_0x32ee27[_0x480388(0x30,0xb5a,0xff8,0x14fc)]=_0x1e5388[_0x46c9e8(0x1b7,0x15b,0xd3d,0x1633)][-0x26d4+-0xbf4*-0x2+0xeec][_0x480388(0x11cd,0xb5a,0xd59,0x1b7)];const _0x4c50ba={};_0x4c50ba[_0x480388(0x26eb,0x1843,0x1f44,0xc98)]=_0x32ee27,_0x4c50ba['mimetype']=_0x4b485e['fGdSx'],_0x175756[_0x46c9e8(0x109b,0x1598,0xc08,0x946)+'e'](_0x5cd288[_0x46c9e8(0x1d0a,0x20d6,0x1450,0x1b2c)],_0x4c50ba,{'quoted':_0x5cd288});}})[_0x313705(0xc9a,0x241,0x11a0,0x22a)](_0xd772ac=>{function _0x87d234(_0x1cf65b,_0xe43fc9,_0x24777a,_0xe7f81){return _0x313705(_0xe43fc9- -0x2c2,_0x1cf65b,_0x24777a-0x14e,_0xe7f81-0x2a);}const _0x4a6e3e={'yaVgk':function(_0x22abdb,_0x52c2a8){return _0x4b485e['qwzdq'](_0x22abdb,_0x52c2a8);},'aMuYR':function(_0x4858e6,_0x5c8782){function _0x10e919(_0x1f906e,_0x19097b,_0x5e4052,_0x3371cb){return _0x2506(_0x19097b- -0x30c,_0x3371cb);}return _0x4b485e[_0x10e919(0x15fa,0x904,0xa43,0x547)](_0x4858e6,_0x5c8782);},'MqvmQ':function(_0x5184da,_0x317f04){function _0x210249(_0xe54ec9,_0x3f9626,_0x4c51e4,_0x3286e7){return _0x2506(_0x3f9626-0x345,_0x3286e7);}return _0x4b485e[_0x210249(0x2514,0x1831,0xf7b,0x19fd)](_0x5184da,_0x317f04);},'MDZwG':_0x4b485e[_0x87d234(0x1629,0x80b,0x63b,0xc1a)],'vooub':function(_0x31fae1,_0x372acb,_0x43d3c1){function _0xf981da(_0x6d3310,_0x1c4c87,_0x254067,_0x238d1a){return _0x87d234(_0x6d3310,_0x238d1a-0x415,_0x254067-0x8,_0x238d1a-0x63);}return _0x4b485e[_0xf981da(0x1385,0x126b,0xa38,0x4f4)](_0x31fae1,_0x372acb,_0x43d3c1);},'lCieB':function(_0x46e994,_0x39c2ee){function _0x26df37(_0x33448d,_0x4d0619,_0x582414,_0x3890ec){return _0x87d234(_0x582414,_0x3890ec- -0x43,_0x582414-0x187,_0x3890ec-0xf8);}return _0x4b485e[_0x26df37(0x12e5,0xdd2,0x1a7f,0x11b6)](_0x46e994,_0x39c2ee);}};function _0xd4e1bd(_0x30366f,_0x4cb9bf,_0x57739b,_0x198d75){return _0x23937d(_0x30366f- -0x136,_0x57739b,_0x57739b-0x6a,_0x198d75-0x1a6);}if(_0x4b485e[_0xd4e1bd(0x89a,0x5b0,-0x2e6,0x75a)](_0x4b485e[_0x87d234(0x10f7,0x268,-0x77d,0x87f)],_0x87d234(0xead,0x10fd,0x602,0x824))){const _0x5809e6={'HUvYa':function(_0x4335c5,_0x2544cb){function _0x1e829a(_0x3ced2a,_0x2dcbb4,_0x2ffafd,_0x1a67d8){return _0xd4e1bd(_0x1a67d8-0x1e8,_0x2dcbb4-0x147,_0x2dcbb4,_0x1a67d8-0x4c);}return _0x4a6e3e[_0x1e829a(0xc01,0x793,0x2194,0x1352)](_0x4335c5,_0x2544cb);}};let _0x47ba60=_0x4a6e3e['aMuYR'](0x54*-0x64+0x5a*-0xa+-0x2cb*-0x14,_0x3cd202);if(!_0x5acf03[0x1b0d+0xa3a+-0x2*0x12a3])return _0x4a6e3e[_0xd4e1bd(0x116a,0x1a82,0x2de,0x12d6)](_0x4e4ff6,'Example\x20:\x20'+(_0x1281b6+_0x2e9f15)+('\x20baitfood\x20'+'2\x0a\x201\x20Bait\x20'+_0xd4e1bd(0xfcd,0x63a,0x1887,0x366)+_0xd4e1bd(0x1833,0x13b5,0x1a9c,0xaeb)));if(_0x4a6e3e[_0xd4e1bd(0x1700,0x1e2d,0x23a9,0x1c89)](_0x274db5,_0x47ba60))return _0x4a6e3e['yaVgk'](_0x4d8630,_0x4a6e3e[_0x87d234(0xed0,0x10d2,0x7d0,0x1d5c)]);_0x4a6e3e[_0xd4e1bd(0x16c7,0x179c,0x19c3,0x139d)](_0x2a257a,_0x3c16ac[_0xd4e1bd(0x1398,0x8d4,0x166e,0x1fd3)],_0x47ba60);var _0x390c0d=_0x4a6e3e[_0xd4e1bd(0x47d,-0x16e,0xfe3,0x11d7)](_0x121aad,0x247*-0x1+0x1128+0x3b8*-0x4);_0x4a6e3e['vooub'](_0x5ce465,_0x5d24d3[_0x87d234(0x7c3,0x1572,0x1ff0,0x215d)],_0x390c0d),_0xed4252(()=>{function _0x1bd033(_0xa0e448,_0x330a68,_0x8f9edb,_0x48f947){return _0xd4e1bd(_0x330a68-0x384,_0x330a68-0x116,_0x48f947,_0x48f947-0x1ca);}function _0x370d5c(_0x2105c9,_0x533f07,_0x485542,_0x40125b){return _0x87d234(_0x40125b,_0x2105c9-0x24d,_0x485542-0x120,_0x40125b-0x92);}_0x5809e6[_0x1bd033(0x5b4,0xef0,0xeaf,0x1d3a)](_0x440273,_0x1bd033(0xbe3,0x4ef,0x432,0x1d)+_0x1bd033(0xc55,0x10cf,0x1374,0x344)+_0x370d5c(0xb70,0x1659,0x710,0x7cb)+_0x1bd033(0x1606,0x2016,0x1a06,0x2a47)+_0x370d5c(0xb43,0xcad,0xb83,0x187)+_0x16d3d0(_0x3976dd[_0x1bd033(0xff6,0x171c,0xa87,0x207d)])+(_0x370d5c(0xfa6,0x2fb,0x101c,0xa69)+'t\x20Food*\x20:\x20')+_0x505e9d(_0x92264c['sender']));},-0x1057+-0xf92*-0x1+0x895);}else _0x1db05d(_0x87d234(0xbe0,0x117,-0x789,0xdad)+_0xd4e1bd(0x1272,0x997,0x2011,0x1eaf)+_0x87d234(-0x182,0xa93,0x3ef,0x279)+'!');});}break;case _0x313705(0xa11,0x5a,0xe93,0x572):case'fb':case _0x4b485e[_0x313705(0x1698,0x1268,0x84f,0xcff)]:case _0x4b485e[_0x313705(0x1f27,0x2d43,0x1889,0x19bf)]:{const _0x228bf7={};_0x228bf7[_0x23937d(0x1d39,0x217c,0x29de,0x1386)]=_0x23937d(0xecf,0xce2,0x8ef,0x175c),_0x228bf7[_0x313705(0xcb5,0x19ec,0x45b,0x3a0)]=_0x5cd288['key'];const _0x2d2161={};_0x2d2161[_0x23937d(0x19ba,0x19d3,0x1186,0x25a0)]=_0x228bf7,_0x175756[_0x313705(0xcaa,-0x1ac,0x113c,0xeab)+'e'](_0x423161,_0x2d2161);if(_0x1bac1f)return _0x4b485e[_0x313705(0x1a4b,0x15b9,0x24ba,0x1dfe)](_0x1db05d,mess[_0x313705(0x982,0x1772,0x5d0,-0x34c)]);if(_0x1e03f5)return _0x4b485e[_0x23937d(0x226,0xfd3,0x409,-0xcb8)](_0x1db05d,mess[_0x313705(0x926,0x157a,0x11f2,0x99d)]);if(!_0x494254)return _0x1db05d(_0x23937d(0x192d,0x1fe4,0x17b1,0x20da)+'he\x20link?');if(!_0x1ba32f[0x1713+-0x13a4*0x1+-0x36f][_0x313705(0x4de,0x88f,-0x82b,0x7b1)]('f'))return _0x4b485e[_0x313705(0x1388,0x1e76,0x1f69,0x1ea7)](_0x1db05d,_0x23937d(0x790,-0xf0,0xd13,0xe3e)+'ceBook\x20Lin'+_0x23937d(0x1785,0x24fa,0x1ce9,0x873));const _0x1408d2={};_0x1408d2[_0x313705(0x175a,0x12b3,0x1424,0x1604)+'t']=_0x4b485e[_0x23937d(0xe52,0xb01,0x1c38,0xff4)];const _0x3c36b4={};_0x3c36b4[_0x313705(0x1e72,0x21b5,0x21e6,0x22b5)]=_0x313705(0xccb,0x7c2,0xff1,0x15fb)+_0x494254,_0x3c36b4[_0x23937d(0x159c,0x138e,0x1f87,0xa1c)]=_0x1408d2,_0x3c36b4[_0x23937d(0x738,0xe48,0xa15,-0x478)]=0x1;const _0x2bb98a={};_0x2bb98a[_0x23937d(0x13f4,0xece,0x1f62,0x11dc)+'t']=_0x4b485e[_0x23937d(0xa25,0x320,0x9f8,0x8a5)];const _0x3f60d8={};_0x3f60d8[_0x23937d(0x1b0c,0x2304,0xe2d,0xd2a)]=_0x313705(0x215a,0x220c,0x1674,0x2c66)+_0x494254,_0x3f60d8[_0x313705(0x1902,0x1bf8,0x1189,0x18a9)]=_0x2bb98a,_0x3f60d8[_0x23937d(0x738,0x2c2,0x429,0xec)]=0x1;const _0x4aaad7={};_0x4aaad7[_0x313705(0x175a,0x1b24,0x23ac,0x25ad)+'t']=_0x4b485e[_0x313705(0x3c4,0x1073,-0x62a,0xbbc)];const _0x5f0577={};_0x5f0577[_0x23937d(0x1b0c,0xd21,0xe40,0x1139)]=_0x23937d(0x1276,0x1ace,0x14c6,0xa77)+_0x494254,_0x5f0577[_0x313705(0x1902,0x185f,0x1692,0xf49)]=_0x4aaad7,_0x5f0577['type']=0x1;let _0x40ccf7=[_0x3c36b4,_0x3f60d8,_0x5f0577];const _0x34abc4={};_0x34abc4['url']=_0x23937d(0x917,0x7f3,0x432,0x6c3)+'ibb.co/4f3'+_0x313705(0x198d,0x2383,0x1cd3,0x1527)+_0x23937d(0xc56,0x786,0x991,0x177b)+_0x23937d(0xfce,0x7f7,0xac3,0x1b17);const _0x339fa1={};_0x339fa1[_0x313705(0x1fa9,0x15e3,0x1ed3,0x1911)]=_0x34abc4,_0x339fa1[_0x313705(0xcce,0xcc7,0x14d7,0x87b)]=_0x23937d(0x816,0x1627,0x16a9,0x32f)+_0x313705(0x138c,0x7d7,0x1a8c,0xf89)+_0x23937d(0x1d5a,0x20e1,0x1233,0x16bd)+_0x23937d(0x3bc,0xc58,0x6df,0xb0d)+'ᴏᴡɴʟᴏᴀᴅᴇʀ\x0a'+_0x313705(0x6a5,-0x7fc,0xedf,0x22b)+'═══════',_0x339fa1['footer']=_0x175756[_0x23937d(0x421,-0xa59,-0x561,0x73a)][_0x23937d(0x1451,0x1e8f,0x1046,0x1a26)],_0x339fa1[_0x23937d(0xc3a,0x38,0xbd6,0x12dd)]=_0x40ccf7,_0x339fa1[_0x313705(0x1e7f,0x15f2,0x22a3,0x1e3d)]=0x4;let _0x5cbe60=_0x339fa1;_0x175756[_0x313705(0xcaa,0xf07,0xa74,-0x23c)+'e'](_0x5cd288[_0x23937d(0x118c,0x157c,0x17e3,0xd6e)],_0x5cbe60,{'quoted':_0x5cd288});}break;case _0x4b485e['sUOYB']:{if(_0x4b485e[_0x23937d(0x1238,0x1bc3,0x10fa,0x204f)](_0x4b485e[_0x313705(0x17e7,0x965,0x2295,0x1bd2)],_0x4b485e['antgg'])){_0xa4e20f[_0x23937d(0xbc6,0xe9,0x84d,0x130)](_0x4b485e[_0x23937d(0x1179,0xd4e,0x2059,0xb5a)](_0x4b485e[_0x313705(0x10d6,0x1d9,0x1dc2,0x1a25)],_0x48ef34[_0x313705(0x1cb4,0x1057,0x26fc,0x1d86)]));const _0x58569f={};_0x58569f[_0x313705(0x1e72,0x115b,0xfc4,0x1efd)]=_0x4b485e[_0x23937d(0x1bfb,0x22cd,0x1e35,0x2266)],_0x58569f[_0x313705(0x1902,0x1eeb,0x1555,0x1b3b)]={},_0x58569f[_0x313705(0xa9e,0xc97,0x64b,0x30)]=0x1,_0x58569f[_0x313705(0x1902,0x1eeb,0x1555,0x1b3b)][_0x313705(0x175a,0x1bc1,0x12e9,0x15b4)+'t']=_0x4b485e['VYulw'],_0x24a0a6['sendButton'+_0x313705(0x1480,0x98f,0xc07,0x5af)](_0x2951c3[_0x313705(0x14f2,0x12aa,0x199d,0x160a)],[_0x58569f],_0x23937d(0xbab,0xb12,0xb4c,0x67a)+_0x23937d(0x18b9,0x2269,0x27a5,0x142c)+_0x5e4d83[_0x5c2ef8[_0x23937d(0x14ce,0x857,0xa1c,0x1f28)]['split']('@')[0x220b+0x177a+-0x3985]]+('\x0a\x0aWant\x20to\x20'+_0x23937d(0xb7d,0xa1,0x1a84,-0x1dd)+_0x313705(0x1402,0x150a,0x214f,0x1bbc)+_0x313705(0x1b1c,0x1d25,0x13be,0x12b8)),''+_0x3a834c[_0x313705(0xcd2,0x2f4,0x4d9,0xb64)],_0x16b06b),delete _0x446bd6[_0x188de0[_0x313705(0x1834,0x1999,0xd8f,0x2247)]['split']('@')[0x1*0x25cf+0x1c11+-0x4*0x1078]];}else{const _0x33bb1a={};_0x33bb1a[_0x23937d(0x1d39,0x17b2,0x19fe,0x286b)]=_0x23937d(0x816,0xdde,0x75a,0xe21)+_0x23937d(0x1026,0x1b4c,0xb24,0x842)+_0x313705(0x1423,0xa1a,0x1d02,0x939)+_0x313705(0x213f,0x2c19,0x1f81,0x1b84)+_0x313705(0x176c,0xd69,0x2656,0x161b)+'.\x0a║\x0a╠\x20📱VID'+_0x313705(0xa0d,0x4fc,0x1809,0xc86)+_0x23937d(0x14e0,0x1fc7,0x1d80,0x14d2)+'══',_0x175756['sendMessag'+'e'](_0x5cd288['chat'],_0x33bb1a,{'quoted':_0x5cd288});let _0x1f2170=require(_0x23937d(0x130d,0x191d,0x7d1,0x1bf4)+'m/scraper');_0x1f2170[_0x313705(0xe6f,0x1918,0x1b58,0x418)](''+_0x494254)[_0x23937d(0x1b61,0x281f,0xdc7,0x271f)](async _0x3fbe84=>{const _0x523e41={};_0x523e41[_0x487644(0x102e,0xd40,0xe4b,0x1264)]=_0x3fbe84[_0x487644(-0x18f,0xd40,0x1234,0x43c)][0x55c+-0x3*0x701+0xfa7][_0x1e94b1(0x1466,0x1b30,0xeec,0x1714)];const _0x393d5d={};function _0x1e94b1(_0x3200b5,_0x19ee90,_0x33eb14,_0x478fb5){return _0x23937d(_0x33eb14-0x473,_0x19ee90,_0x33eb14-0x58,_0x478fb5-0x62);}_0x393d5d['video']=_0x523e41,_0x393d5d[_0x1e94b1(0x1e07,0x1b92,0x171d,0x1512)]=_0x4b485e[_0x1e94b1(0x26a0,0xfc9,0x18d3,0x246b)];function _0x487644(_0xf981dd,_0x4e75ee,_0x117eec,_0x4a4703){return _0x23937d(_0x4e75ee-0x2c7,_0x4a4703,_0x117eec-0x1d8,_0x4a4703-0x7b);}_0x175756['sendMessag'+'e'](_0x5cd288[_0x487644(0x191e,0x1453,0xbde,0xc0e)],_0x393d5d,{'quoted':_0x5cd288});})['catch'](_0x5c95db=>{function _0x2fee75(_0x5ed7a1,_0x1be06c,_0xabe1c0,_0x495d57){return _0x313705(_0xabe1c0- -0x21d,_0x495d57,_0xabe1c0-0x4e,_0x495d57-0xec);}function _0x122f2c(_0x23627f,_0x36a99e,_0x4fdbf5,_0x4b3233){return _0x23937d(_0x4b3233-0x222,_0x36a99e,_0x4fdbf5-0x11b,_0x4b3233-0x1a5);}_0x4b485e[_0x2fee75(0x1142,0x164f,0xe29,0x54e)](_0x1db05d,_0x2fee75(0xf3e,0x9f6,0x1bc,-0x352)+_0x122f2c(0x2210,0x245f,0x74f,0x15ca)+_0x122f2c(0xf71,0x588,0x1928,0xc11)+'!');});}}break;case _0x23937d(0x312,0xd63,0x14a,-0x3ca):{if(_0x4b485e[_0x23937d(0x60f,0x64c,-0x82d,0x151)]===_0x4b485e['wWNVM']){const _0x47d98f={};_0x47d98f['text']='╔═════════'+_0x23937d(0x1026,0xd39,0x1c37,0x15dc)+_0x313705(0x1423,0xe3e,0xe65,0x1afb)+_0x313705(0x213f,0x2515,0x2117,0x25df)+'ᴘʟᴏᴀᴅɪɴɢ..'+'.\x0a║\x0a╠\x20🎶\x20AU'+'DIO\x20🎶\x0a╚═══'+_0x313705(0x1846,0xcee,0x1888,0xb8f)+'═══',_0x175756['sendMessag'+'e'](_0x5cd288[_0x23937d(0x118c,0x1cc1,0xe2e,0x1d98)],_0x47d98f,{'quoted':_0x5cd288});let _0x32e24f=_0x4b485e[_0x23937d(0xfc1,0x1963,0x9e1,0x9d5)](require,_0x4b485e[_0x23937d(0xcbd,0x166,0xea8,0x157b)]);_0x32e24f['savefrom'](''+_0x494254)['then'](async _0x1e8443=>{const _0x5e15ed={'TJxNi':function(_0x5345a1,_0x1133e7){function _0x3e1469(_0x2ac718,_0x383ea2,_0x40d73e,_0x4b72d8){return _0x2506(_0x2ac718- -0x358,_0x4b72d8);}return _0x4b485e[_0x3e1469(0x11e5,0x1ebf,0x939,0x13bb)](_0x5345a1,_0x1133e7);},'hjuex':_0x4b485e[_0xc40e88(0x1097,0x38e,0x60b,0x2cd)],'phmoD':_0x4b485e[_0xc40e88(0xa9d,0x18b2,-0x92,0xc94)]};function _0xc40e88(_0x2eb3fb,_0x4d9698,_0x3b243d,_0x1b2f87){return _0x313705(_0x2eb3fb- -0x302,_0x4d9698,_0x3b243d-0x36,_0x1b2f87-0x1d);}function _0x373a75(_0x414ae9,_0x5e81db,_0xfbd07f,_0xd92cfe){return _0x313705(_0x414ae9-0x162,_0xfbd07f,_0xfbd07f-0x20,_0xd92cfe-0x125);}if(_0x4b485e[_0xc40e88(0x16a2,0x15e3,0xe12,0x1f35)](_0x4b485e['jNSQd'],_0x4b485e['XJLDv'])){let _0xffdaac=_0x373a75(0x1691,0x1f8c,0x2416,0x224c)+_0xc40e88(0x1162,0xded,0x2bd,0x1c92)+_0xc40e88(0x1f5,0x793,0xae9,0xe09)+_0x3b147b+_0xc40e88(0x13ea,0x22d5,0x1486,0x22cb)+_0x54230e+(_0xc40e88(0x1ef,0x67b,0x311,0x108b)+_0x373a75(0x7b8,0x7a8,0x13be,0x15d8))+_0x94f471,_0x55a6c5=[{'buttonId':''+_0x5e15ed[_0x373a75(0xb91,0x5b4,0x9f0,0xe7)](_0x4fd137,_0x236e04),'buttonText':{'displayText':_0x5e15ed['hjuex']},'type':0x1}];const _0x1a4062={};_0x1a4062['url']=_0x5e15ed[_0x373a75(0x4f8,0x105a,0x130a,0xea5)];const _0x2f5e12={};_0x2f5e12['image']=_0x1a4062,_0x2f5e12[_0xc40e88(0x9cc,0xe4e,-0x40e,0x13ec)]=_0xffdaac,_0x2f5e12[_0x373a75(0x1536,0x97a,0x1de0,0xfda)]=_0x4402cd,_0x2f5e12[_0xc40e88(0xc9e,0x16eb,0x10c9,0x47f)]=_0x55a6c5,_0x2f5e12[_0x373a75(0x1fe1,0x1f3a,0x1ed2,0x1319)]=0x4;let _0x571b3d=_0x2f5e12;const _0x1a8704={};_0x1a8704[_0x373a75(0xaa4,0x2f9,0x7ce,-0x3ac)]=_0x4407fc,_0x4df440['sendMessag'+'e'](_0xaab34c,_0x571b3d,_0x1a8704);}else{const _0x3c2a3f={};_0x3c2a3f[_0x373a75(0xf41,0xba5,0x1bf2,0x482)]=_0x1e8443['url'][0x1ea3+-0x79d*-0x1+-0x2640][_0xc40e88(0xadd,0x14d9,-0x10e,0x76)];const _0x249f84={};_0x249f84[_0x373a75(0x17f0,0x169b,0xff6,0x2413)]=_0x3c2a3f,_0x249f84[_0x373a75(0x1772,0xf61,0x16eb,0x1493)]=_0x4b485e[_0xc40e88(0x1a1c,0x12e2,0x2467,0x1ca9)],_0x249f84['fileName']=_0x373a75(0x49c,0x1147,0xd5e,-0x7b9)+_0xc40e88(0x45b,0xa14,0x87c,-0x11)+'3',_0x175756[_0x373a75(0xe0c,0x1691,0x992,0x13e8)+'e'](_0x5cd288[_0x373a75(0x1654,0x894,0x2416,0x963)],_0x249f84,{'quoted':_0x5cd288});}})['catch'](_0x7f9d05=>{function _0x44ba51(_0x3e93eb,_0xc4de88,_0x3b7fc0,_0x5dc6a8){return _0x23937d(_0x3e93eb-0x55a,_0x5dc6a8,_0x3b7fc0-0x181,_0x5dc6a8-0x14f);}const _0x2dbf34={'SuXcU':_0x4b485e['eOUyJ'],'ViPcY':function(_0x146903,_0x61933a){return _0x4b485e['qwzdq'](_0x146903,_0x61933a);},'VzAGY':_0x4b485e[_0x5ce0b7(0xfc9,0xb79,0x9b6,0x47a)],'VzOXO':_0x4b485e[_0x44ba51(0x19ba,0x120f,0x257c,0x21c5)]};function _0x5ce0b7(_0x18dccf,_0x18b365,_0x40f6fb,_0x1e1964){return _0x23937d(_0x18b365-0x474,_0x1e1964,_0x40f6fb-0x5b,_0x1e1964-0x14e);}if(_0x4b485e[_0x5ce0b7(0x1c5b,0x200b,0x29f4,0x1726)](_0x44ba51(0x12e1,0x1e01,0x1dc2,0x20ad),_0x4b485e['CeWPX']))_0x4b485e['tDbWo'](_0x1db05d,_0x44ba51(0x5cd,-0x228,0x8bd,0x44b)+_0x5ce0b7(0x924,0x181c,0x20d3,0x134d)+'lide\x20link\x20'+'!');else{const _0x498b1d=_0x2dbf34[_0x44ba51(0x702,0xde5,0x6a7,0x15f1)][_0x44ba51(0x1229,0xa64,0xf1b,0x1c28)]('|');let _0x411035=-0x1*-0x333+0x2da+0x1*-0x60d;while(!![]){switch(_0x498b1d[_0x411035++]){case'0':_0x47bb9e['unlinkSync'](_0x1fad9c);continue;case'1':_0x2464ed['unlinkSync'](_0x32fa70);continue;case'2':if(_0x6a2237)return _0x2dbf34[_0x44ba51(0x12e7,0xab7,0xb35,0xb1b)](_0x598492,_0x2dbf34[_0x44ba51(0x967,-0x424,0x165c,0xe7)]);continue;case'3':_0x25a856=_0x423a0f[_0x5ce0b7(0x1051,0x1831,0x2466,0x224d)+'nc'](_0xfca762);continue;case'4':const _0x24b55d={};_0x24b55d[_0x44ba51(0x1cbc,0x209c,0x1aa1,0x1ea1)]=_0x37e9b4,_0x24b55d[_0x44ba51(0x1804,0x17f9,0xb20,0x1dd0)]=_0x2dbf34[_0x44ba51(0x1608,0x225a,0x1088,0x17a7)];const _0x59be25={};_0x59be25['quoted']=_0x3fb145,_0x67c996[_0x44ba51(0xe9e,0xeb6,0x1452,0x16ec)+'e'](_0x1682b6,_0x24b55d,_0x59be25);continue;}break;}}});}else{const _0x4e567a={};_0x4e567a[_0x23937d(0x1d39,0x14a5,0x1756,0x17a3)]=''+_0x429469[_0x313705(0x716,-0x7e8,-0x781,0x289)];const _0x7bf7c={};_0x7bf7c[_0x23937d(0x5dc,0x1463,-0x1d8,-0x4f0)]=_0x10e82,_0xec4cc['sendMessag'+'e'](_0x3772b2[_0x313705(0x14f2,0x17f0,0x1fdb,0x12f7)],_0x4e567a,_0x7bf7c);}}break;case _0x4b485e[_0x23937d(0x18f7,0xa02,0x1d2e,0xdb9)]:{if(_0x4b485e['ggsCW'](_0x4b485e['IAOvG'],_0x313705(0x5dc,0x60c,-0x44c,0x1445))){const _0x31f2ed={};_0x31f2ed['text']='😎',_0x31f2ed[_0x23937d(0x94f,0x3a3,-0x3cd,0x12c8)]=_0x528c28[_0x313705(0xcb5,0x3d3,0x5ab,-0x1d2)];const _0x5f318c={};_0x5f318c['react']=_0x31f2ed,_0x583acd[_0x23937d(0x944,-0x3c3,0xd61,0xe93)+'e'](_0x28fe2c,_0x5f318c);const _0xea03b5={};_0xea03b5[_0x23937d(0x1d39,0x235a,0x1205,0x1934)]=''+_0x41fd23[_0x313705(0xe8a,0x16df,0x3b6,0xb14)];const _0x564e7c={};_0x564e7c['quoted']=_0x329cd3,_0x37e6ac[_0x23937d(0x944,0xf98,0x80d,0x13ca)+'e'](_0xd98a9d['chat'],_0xea03b5,_0x564e7c);}else{const _0x10bda8={};_0x10bda8[_0x313705(0x209f,0x1f77,0x2a1f,0x1b7f)]=_0x23937d(0x816,0x157d,0x156c,0x150e)+_0x23937d(0x1026,0x1296,0x1796,0x17fa)+_0x23937d(0x10bd,0x83c,0x19ba,0x148c)+_0x23937d(0x1dd9,0xf00,0x1bc5,0x18c0)+_0x313705(0x176c,0x1bee,0x1800,0x12bc)+'.\x0a║\x0a╠\x20🔊\x20DO'+_0x23937d(0x12fd,0x1fd6,0x1752,0xae1)+_0x313705(0x1846,0x21f9,0x984,0x100f)+_0x313705(0x92f,0x4fc,0x14aa,0xe50),_0x175756[_0x313705(0xcaa,0x15ca,0x8a3,0x1840)+'e'](_0x5cd288[_0x23937d(0x118c,0xc75,0x1971,0x132b)],_0x10bda8,{'quoted':_0x5cd288});let _0x2b5fab=_0x4b485e[_0x313705(0x1aa1,0x1a89,0xea3,0x1437)](require,_0x313705(0x1673,0x153f,0x17f4,0xf4e)+_0x23937d(0x1418,0x14f0,0x694,0x21eb));_0x2b5fab[_0x313705(0xe6f,0x1cf0,0x1959,0x10bd)](''+_0x494254)[_0x313705(0x1ec7,0x255a,0x168e,0x14a0)](async _0x427efe=>{function _0x39fd81(_0x4a5bcc,_0x5c8851,_0x2f3631,_0xe7dbf2){return _0x23937d(_0x2f3631-0x24b,_0x5c8851,_0x2f3631-0x2b,_0xe7dbf2-0x1bb);}function _0x20b5ac(_0xf2fec4,_0x11c8cd,_0x1c6b95,_0x35b83d){return _0x23937d(_0xf2fec4- -0x1b4,_0x1c6b95,_0x1c6b95-0x173,_0x35b83d-0xdb);}const _0x91f1d1={'stGqH':function(_0x5ceb44,_0x4d14df){function _0x103326(_0x4017b0,_0x3f254d,_0x242174,_0x3d5e48){return _0x2506(_0x242174-0x7c,_0x3f254d);}return _0x4b485e[_0x103326(0x100d,0xf58,0x52e,-0x6d3)](_0x5ceb44,_0x4d14df);}};if(_0x4b485e[_0x39fd81(0x1a86,0xaed,0x18f6,0x1860)]('ZsPHP',_0x4b485e[_0x20b5ac(0x124a,0x1353,0x145c,0x8d2)])){const _0x51abe6={};_0x51abe6['url']=_0x427efe[_0x39fd81(0x4ee,0x1a7c,0xcc4,0x1a13)][-0x13a4+0xc52*-0x1+-0x2*-0xffb][_0x39fd81(-0x254,0x16cf,0xcc4,-0x124)];const _0x4500ce={};_0x4500ce[_0x20b5ac(0xa5a,0xe4e,0x982,0x801)]=_0x51abe6,_0x4500ce[_0x39fd81(0x10e6,0x187d,0x14f5,0x858)]=_0x4b485e[_0x39fd81(0xda5,0x1dfc,0x1671,0xf6e)],_0x4500ce[_0x39fd81(0x7dd,0x11a8,0xd64,0x1aba)]=_0x39fd81(0x62f,-0x343,0x21f,-0x9ea)+_0x20b5ac(0x243,0x89e,0x632,-0x935)+'3',_0x175756[_0x20b5ac(0x790,0x16,0x1d6,0x15e6)+'e'](_0x5cd288[_0x20b5ac(0xfd8,0x1e5,0xae2,0x154e)],_0x4500ce,{'quoted':_0x5cd288});}else _0x91f1d1[_0x39fd81(0x12af,0x2497,0x1cfb,0x2abc)](_0x164d2a,_0x20b5ac(0x1a63,0x1ea4,0x25ed,0x148d)+_0x39fd81(-0x88,-0x15,0xb8b,0x9cd));})[_0x313705(0xc9a,0x837,0x1297,0x931)](_0x4a8990=>{const _0x1c0bc9={'SHfDh':function(_0x275de2,_0x47dd52){function _0x9185be(_0x3330f8,_0x164582,_0xe41097,_0x42b14f){return _0x2506(_0x42b14f- -0x33f,_0xe41097);}return _0x4b485e[_0x9185be(0x1ae8,0x1408,0xd0b,0xf38)](_0x275de2,_0x47dd52);},'NdaRW':_0x4b485e['QHXuM'],'AeYCj':_0x4b485e[_0x22421a(0xa73,0x183d,0x14b6,0x174c)],'LKuIV':_0x4b485e['YYfns'],'UVNgk':_0x4b485e[_0x22421a(0x1636,0x2abd,0x299f,0x2069)],'ZkzBN':function(_0xd1b6c7,_0x5dc040){function _0x32539e(_0x1b770e,_0x33833c,_0x545a16,_0x2f4fdf){return _0x22421a(_0x1b770e-0x4b,_0x2f4fdf,_0x545a16-0xd4,_0x545a16-0x69);}return _0x4b485e[_0x32539e(0x513,-0x7ea,0x5bb,0xb6)](_0xd1b6c7,_0x5dc040);},'tOTZR':_0xb054fa(0xcc0,-0x468,-0x58,0x5cd)+_0x22421a(0x1884,0x1257,0x16da,0xf53)+':\x20','gmpUP':_0x4b485e[_0x22421a(0xeac,-0x1eb,0x13aa,0x596)],'DhrDE':function(_0x3c52bd,_0x7b47d){function _0x1caf66(_0x71d58b,_0x38b116,_0x212d38,_0x106e7e){return _0xb054fa(_0x38b116,_0x38b116-0x193,_0x106e7e-0x275,_0x106e7e-0x13e);}return _0x4b485e[_0x1caf66(0xe6c,0x195a,0xbf6,0x1265)](_0x3c52bd,_0x7b47d);}};function _0x22421a(_0x466a80,_0x2eacd8,_0x5115d1,_0x546032){return _0x23937d(_0x546032-0x490,_0x2eacd8,_0x5115d1-0x13f,_0x546032-0x59);}function _0xb054fa(_0x35980f,_0x543582,_0x32319f,_0x39025b){return _0x313705(_0x32319f- -0x3f3,_0x35980f,_0x32319f-0x14e,_0x39025b-0x65);}if(_0x22421a(0xf09,0xd4,0xe82,0xc0c)==='saSHx'){let _0x30ed7e=_0x46baae[_0x22421a(0xc8b,0x16b8,0x17fe,0xc4c)](_0x2d4441[_0xb054fa(0x6c5,0x7b,0xd8a,0x153f)]),_0x1ca5d0={'title':_0x1c0bc9['SHfDh'](_0x30ed7e,_0x1c0bc9['NdaRW'])[_0x22421a(0x2634,0x1448,0x2799,0x21c9)](),'author':_0x1c0bc9[_0x22421a(0x2425,0x141f,0x1539,0x1c4b)](_0x30ed7e,_0x1c0bc9[_0x22421a(0xdcc,0xe6e,0xfe4,0x59b)])[_0xb054fa(0x2bbe,0x292d,0x1cac,0x261b)]()['split'](_0x1c0bc9['LKuIV'])[0x1*-0x202a+-0x1*0xb0f+-0x159d*-0x2][_0xb054fa(0x116c,0x10d6,0xc42,0xb2b)](_0x1c0bc9[_0xb054fa(0xaac,0x288,0x239,0x83)])[-0x1a17+-0x1697+0x30ae],'kategori':_0x1c0bc9[_0xb054fa(0x18d2,0x1dbb,0x1b78,0x1c42)](_0x30ed7e,'#content\x20>'+_0x22421a(0x141a,0x1331,0x26d9,0x1b4f))[_0xb054fa(0x10eb,0x2a60,0x1cac,0x29be)]()['split'](_0x1c0bc9[_0xb054fa(-0x87,-0x636,0x239,0x117)])[0x3be*-0x8+0x197a+-0x3*-0x17d]['split']('\x0a')[-0xa24+0x43*0x4f+0x383*-0x3],'lolos':_0x1c0bc9[_0x22421a(0x19e3,0xdbc,0x1739,0x1c4b)](_0x30ed7e,'#content\x20>'+_0x22421a(0x2a15,0x1322,0x1e29,0x1b4f))[_0xb054fa(0xebf,0x2663,0x1cac,0x1d6c)]()[_0xb054fa(0x15b7,0x1970,0xc42,0x454)](_0x1c0bc9[_0xb054fa(0xc9f,0xdc6,0x613,-0x49c)])[0x2291+-0x7af+0x3d7*-0x7][_0x22421a(0x24e,0x10a2,0x136e,0x115f)]('\x0a')[-0x233*-0xb+-0x1fac+0x77b],'cerita':_0x1c0bc9[_0xb054fa(0xe0e,0xa02,0x172e,0x1892)](_0x30ed7e,_0x1c0bc9[_0xb054fa(0xb88,0x14ea,0x1a89,0x268f)])['text']()};_0x1c0bc9[_0xb054fa(-0x5ff,0x71a,0x877,-0x2c1)](_0x21b732,_0x1ca5d0);}else _0x4b485e[_0x22421a(0xe74,0x162a,0x137e,0xb85)](_0x1db05d,_0xb054fa(0x3f4,-0xdae,-0x1a,0x37d)+_0xb054fa(0xc53,0x67e,0x131b,0x4d5)+'lide\x20link\x20'+'!');});}}break;case _0x4b485e['kONWx']:{if(_0x4b485e[_0x313705(0x1f64,0x2322,0x29ce,0x244e)](_0x4b485e[_0x23937d(0xef4,0x49a,-0x21,0xbd9)],_0x23937d(0x6e1,0xad4,0x28a,-0x3b8))){if(_0x1bac1f)return _0x4b485e[_0x23937d(0xcc0,0x14f7,0xd18,0x3c0)](_0x1db05d,mess['ban']);if(_0x1e03f5)return _0x4b485e[_0x23937d(0x1646,0x210b,0x220e,0x1e74)](_0x1db05d,mess[_0x23937d(0x5c0,0xef3,0x102f,0xa56)]);_0x4b485e[_0x23937d(0x7f6,0xb42,-0x1fe,0x797)](_0x1db05d,mess['wait']);let {pinterest:_0x2c9dff}=_0x4b485e[_0x313705(0x1d2d,0x1c3c,0x17d5,0x2797)](require,_0x4b485e[_0x313705(0x1c27,0x2549,0x1403,0x234d)]);_0x12b240=await _0x2c9dff(_0x494254),_0x4b172e=_0x12b240[Math['floor'](_0x4b485e[_0x313705(0x1a0a,0x117e,0x1c6f,0x2525)](Math[_0x313705(0x1ae0,0xbef,0x1c26,0x142d)](),_0x12b240[_0x23937d(0x3de,0xc8d,0xf8,-0x6e6)]))];const _0x3baf78={};_0x3baf78[_0x313705(0xddf,0x226,0x3e5,0x7e0)]=_0x4b172e,_0x175756[_0x23937d(0x944,0x10a8,0x2f3,0x95f)+'e'](_0x5cd288[_0x313705(0x14f2,0x15a4,0x1465,0x1bf9)],{'image':_0x3baf78,'caption':_0x4b485e[_0x313705(0x6f5,-0x507,-0x356,0x4cc)](_0x4b485e[_0x23937d(0x1ddd,0x13c9,0x2a59,0x2760)],_0x4b172e)},{'quoted':_0x5cd288});}else{const _0x16dab0={};_0x16dab0['text']='🤪',_0x16dab0['key']=_0x42427a[_0x313705(0xcb5,0x64b,0x17eb,0xbb9)];const _0x196a4b={};_0x196a4b[_0x313705(0x1d20,0x27d6,0x1a75,0x2b95)]=_0x16dab0,_0x12ef2c['sendMessag'+'e'](_0x3d34a9,_0x196a4b);const _0x5e016c={};_0x5e016c[_0x313705(0x209f,0x17fe,0x1f02,0x1c37)]=''+_0x231284['K5'];const _0x448e0e={};_0x448e0e[_0x313705(0x942,0xace,0x1205,0x798)]=_0x30d466,_0x389af4['sendMessag'+'e'](_0x5de4f3[_0x23937d(0x118c,0x1a94,0x1a57,0x9c0)],_0x5e016c,_0x448e0e),_0x1a251f=_0x52af23[_0x23937d(0x13bd,0x1522,0x20b9,0x10e2)+'nc']('./Android/'+'AllData/st'+_0x313705(0x1f26,0x2412,0x287b,0x2bc4)+_0x23937d(0x16ba,0xf7e,0x1320,0x231a));const _0x412364={};_0x412364[_0x313705(0x1360,0xb8f,0x63d,0xf5b)]=_0xcf5323,_0x3f9b46[_0x23937d(0x944,-0x1da,0xf8,0x78a)+'e'](_0x440ba8[_0x313705(0x14f2,0x17e5,0x1a87,0x93a)],_0x412364);}}break;case _0x4b485e[_0x313705(0xf03,0x1d59,0xc98,0x1509)]:case _0x4b485e[_0x313705(0xed3,0xd31,0x3b7,0x14d9)]:if(_0x1bac1f)return _0x4b485e[_0x313705(0x1d68,0x1f2e,0x1b8c,0x11d5)](_0x1db05d,mess['ban']);if(_0x1e03f5)return _0x4b485e[_0x313705(0x1308,0x1b7d,0x1b65,0x19fb)](_0x1db05d,mess[_0x23937d(0x5c0,-0x722,0x3a6,0xcc9)]);if(!_0x494254)return _0x4b485e[_0x313705(0x11cd,0x1de0,0x1611,0x3dc)](_0x1db05d,'What\x20Are\x20y'+_0x313705(0x12b5,0xb9e,0xa8f,0x11c3)+'\x20For??');await _0x4b485e['pmvKc'](_0x1db05d,mess['wait']),xeonkey['Webtoons'](q)['then'](async _0xe90e32=>{function _0x5f5cbe(_0x13f865,_0x3ce907,_0x2b85f8,_0x351214){return _0x313705(_0x351214-0x1da,_0x13f865,_0x2b85f8-0x1c4,_0x351214-0x1be);}let _0x474602=_0x5f5cbe(0x29d,-0x57d,0x1048,0x7d3)+'EBTOONS-SE'+'ARCH\x20🧩----'+_0x570b60(0x11c8,0x880,0x1420,-0x416);function _0x570b60(_0x2feb90,_0x13b013,_0x4b623c,_0x3594fd){return _0x23937d(_0x13b013- -0x1d9,_0x4b623c,_0x4b623c-0xf,_0x3594fd-0xe5);}for(let _0x4f2ed0 of _0xe90e32){if(_0x4b485e['yNYsk'](_0x4b485e[_0x570b60(0xefd,0xe2d,0x570,0x1799)],_0x570b60(0x13c8,0xcfc,0x906,-0x28)))return _0x5f5cbe(-0x1bc,-0x75d,0x8ea,0x546);else{const _0x25a061=_0x4b485e[_0x5f5cbe(0x12f9,0x1211,0x6b2,0x12c3)]['split']('|');let _0x30bd77=0x196f+-0xecd+-0x2*0x551;while(!![]){switch(_0x25a061[_0x30bd77++]){case'0':_0x474602+=_0x5f5cbe(0xe60,0x2145,0x10a0,0x1c48)+'\x20:*\x20'+_0x4f2ed0['creator']+'\x0a';continue;case'1':_0x474602+=_0x570b60(0x21d5,0x1a39,0xf24,0x227d)+_0x4f2ed0[_0x5f5cbe(0x1b99,0xde7,0xf51,0xfb9)]+('\x0a\x20--------'+_0x570b60(-0x3e8,0x4b6,-0x5ae,0x115a)+_0x5f5cbe(0x9af,0x1198,0x1990,0xbcf)+_0x570b60(0xe54,0x4b6,-0x4c4,0xa14)+_0x570b60(0x2fd,0x4b6,0x528,0xcdc)+_0x5f5cbe(0x16d1,0x17b8,0xfeb,0xbcf)+'\x0a');continue;case'2':_0x474602+=_0x570b60(0x1625,0xfc8,0x131e,0xeb)+'*\x20'+_0x4f2ed0[_0x570b60(0x173a,0x1401,0x1615,0x507)]+'\x0a';continue;case'3':_0x474602+='*🎥\x20Genre\x20:'+'*\x20'+_0x4f2ed0[_0x5f5cbe(0x7ad,0xa55,0x2b2,0xe7d)]+'\x0a';continue;case'4':_0x474602+=_0x570b60(0x1c0c,0x1998,0x1327,0x1014)+'\x20'+_0x4f2ed0['like']+'\x0a';continue;}break;}}}await _0x1db05d(_0x474602);})[_0x313705(0xc9a,0x5b5,0x1aed,0x1752)](_0x1403e3=>{function _0x5316b0(_0x161d5e,_0x2a7780,_0x1aa961,_0xdacd3e){return _0x23937d(_0x2a7780- -0x1c0,_0x161d5e,_0x1aa961-0x1c6,_0xdacd3e-0x1a3);}function _0x445c23(_0x18a2d4,_0x38b032,_0x310110,_0x190219){return _0x313705(_0x18a2d4- -0x448,_0x310110,_0x310110-0x31,_0x190219-0x11e);}if(_0x4b485e[_0x5316b0(0x15d2,0x1c17,0xf40,0xe51)](_0x4b485e[_0x445c23(0x1a61,0x1aa7,0x174a,0x1a4c)],_0x4b485e['OnWhG'])){if(!_0x23abda)return _0x4b485e['ZpSbZ'](_0x2a2313,_0x4b485e[_0x445c23(0x157a,0x1c29,0x2488,0xf27)]);let _0x2092dd=_0x32476c['indexOf'](_0x1c50bc);_0x3eb695[_0x5316b0(0xfa,0x43b,-0x5bd,0xfba)](_0x2092dd,-0x13b5*-0x1+-0x1313+-0xa1),_0x4b485e[_0x5316b0(0x125b,0x1351,0x1bd7,0x1e6f)](_0x3d12f5,_0x4b485e[_0x445c23(0x4c0,0x240,0x89a,-0x4bb)]);}else _0x4b485e['PFpWg'](_0x1db05d,mess['error']);});break;case _0x23937d(0xc59,0x11ad,0x5c0,0xcfd):{if('lCDUh'!==_0x4b485e[_0x23937d(0x884,0x6e2,-0x59c,-0x95)]){if(_0x1bac1f)return _0x1db05d(mess[_0x313705(0x982,0x67f,0xc9c,0x11dc)]);if(_0x1e03f5)return _0x4b485e[_0x313705(0x3b1,-0x897,0x7dc,-0xa29)](_0x1db05d,mess[_0x23937d(0x5c0,0x687,0xceb,0x1170)]);if(!_0x494254)return _0x4b485e[_0x23937d(0x7a7,-0x258,0x15d0,0xa58)](_0x1db05d,'Example\x20:\x20'+_0x4b485e[_0x23937d(0x1461,0x550,0x592,0x1d9a)](_0xe1d953,_0x1354e9)+'\x20love');let _0x321818=await _0x4b485e[_0x313705(0x1d65,0x12a6,0x1483,0x2be0)](fetchJson,_0x23937d(0x1449,0x1090,0x1ead,0x1768)+'nzapis.xyz'+_0x23937d(0x1dc0,0x24d2,0x1e0e,0x2579)+'attpad?que'+_0x23937d(0x1b30,0x194f,0xfa9,0x15f6)+_0x23937d(0x1220,0x132a,0x3a5,0x1220)+_0x23937d(0x1c0d,0x2a35,0xf9e,0x23a4)),{judul:_0x31bc96,dibaca:_0x58f2fd,divote:_0x408ed1,bab:_0x276908,waktu:_0x2107ce,url:_0x3435aa,thumb:_0x77f17d,description:_0x42d68e}=_0x321818['result'][-0x2*-0x87f+0x1042+0x2*-0x10a0],_0x1da44c='Wattpad\x20Fr'+_0x23937d(0x13dd,0x2015,0x97f,0x1fcf);_0x1da44c+=_0x313705(0x13cc,0x976,0x9f0,0x1c7c)+_0x31bc96+'\x0a',_0x1da44c+=_0x23937d(0xab4,0xd72,0xef4,-0x441)+_0x58f2fd+'\x0a',_0x1da44c+='\x20Vote:\x20'+_0x408ed1+'\x0a',_0x1da44c+=_0x23937d(0x1c40,0x1926,0x16b3,0x2425)+_0x276908+'\x0a',_0x1da44c+=_0x23937d(0x19d0,0x1151,0xd63,0x1348)+_0x3435aa+'\x0a',_0x1da44c+='\x20Descripti'+_0x313705(0x1fe1,0x1d9b,0x1e60,0x155d)+_0x42d68e,_0x175756[_0x23937d(0x1429,0x1ea8,0x998,0x20c4)](_0x5cd288['chat'],_0x77f17d,_0x1da44c,_0x5cd288);}else{const _0x79b282={};_0x79b282['text']=''+_0x99acf0[_0x23937d(0x883,0xf1e,-0x229,0xbce)];const _0x1089ba={};_0x1089ba[_0x313705(0x942,0xa4b,0x254,0x16c2)]=_0x5e536d,_0x203f4f['sendMessag'+'e'](_0x4a2bc4['chat'],_0x79b282,_0x1089ba);}}break;case _0x313705(0xfd8,0x1572,0x1bb4,0x114f):case _0x4b485e[_0x313705(0x10f8,0xf2b,0xae4,0x11a3)]:case _0x4b485e[_0x313705(0x3be,-0x54d,0xe69,0x527)]:{if(_0x4b485e[_0x313705(0xcb2,0x6be,0xa37,0xe91)](_0x4b485e[_0x313705(0x882,0x7a3,-0x63a,0xf21)],_0x4b485e[_0x313705(0xa3d,0x87e,0x1606,0x1bb)])){if(_0x1bac1f)return _0x4b485e[_0x23937d(0xe2,0x3f3,0x449,-0xa7a)](_0x1db05d,mess[_0x23937d(0x61c,0x7db,-0x388,0x566)]);if(_0x1e03f5)return _0x4b485e[_0x23937d(0x1555,0x1e31,0x985,0x1afa)](_0x1db05d,mess[_0x23937d(0x5c0,0x61,0xce7,-0x940)]);if(!_0x494254)return _0x4b485e[_0x313705(0x573,-0x8f6,-0x1e4,0x1412)](_0x1db05d,_0x23937d(0xf76,0xcf0,0xb89,0x1cba)+_0x4b485e[_0x23937d(0x86d,0xd27,0x5ed,0x39f)](_0xe1d953,_0x1354e9)+_0x23937d(0xb5b,0x18a4,0x1a6e,0x1458));let _0x5617c7=_0x4b485e[_0x313705(0xfa7,0x1326,0x575,0x196f)](require,_0x313705(0x6fa,-0x400,0x759,0x775)+_0x313705(0xb21,-0x207,-0xb4,0x10a0));_0x5617c7['rexdl'](''+_0x494254)[_0x313705(0x1ec7,0x1019,0x2497,0x2ddd)](async _0x4609d0=>{let _0x7b7088=[];for(let _0x4c8324 of _0x4609d0){const _0x8159f5={};_0x8159f5[_0x169649(0x176e,0x12e0,0x15cc,0x16c4)]=''+_0x4c8324['judul'],_0x8159f5[_0x79c574(0x1284,0x1286,0xcdd,0x4e7)]=[{'title':''+_0x4c8324[_0x169649(0x5e1,0xf35,0xedb,0x14c5)],'rowId':_0xe1d953+_0x79c574(0x25b7,0x2bcd,0x1ca8,0x1da5)+_0x4c8324[_0x169649(0x189d,0x1af9,0x1e56,0x19e3)],'description':_0x79c574(0x2572,0x1f88,0x1a2c,0x17c5)+_0x4c8324[_0x169649(0x117,-0x11,0x1629,0x91e)]+_0x169649(0x17e5,0x1201,0x17e8,0x1afe)+_0x4c8324[_0x79c574(0x1e6,0x873,0x1331,0xa55)+'e']+_0x169649(0x1d5a,0xf21,0x1e90,0x1bb5)+_0x4c8324[_0x79c574(0x1e37,0x14ac,0x11ce,0xfd1)]}];const _0x1ca1f3=_0x8159f5;_0x7b7088[_0x169649(0xe6e,0xbd8,0x84,0xca7)](_0x1ca1f3);}const _0x4d7b67={};function _0x169649(_0x3d0861,_0x3d575c,_0x3931da,_0x50aac3){return _0x313705(_0x50aac3- -0x47b,_0x3d0861,_0x3931da-0x169,_0x50aac3-0x57);}_0x4d7b67[_0x79c574(0x209d,0x12f0,0x2a3c,0x20ea)]=ucapannya2+'\x20'+_0xa43395+('\x20*Search\x20R'+_0x169649(-0x8d9,0x47,0x1024,0x5cf)+'m\x20')+_0x494254+(_0x169649(0x745,0x14d6,0x134d,0xc20)+'\x20button\x20be'+_0x79c574(0x2cda,0x1af8,0x2de9,0x20f2)+_0x169649(0x797,0xb30,0x150f,0xa7b));function _0x79c574(_0x348644,_0x223401,_0x16d058,_0x433130){return _0x23937d(_0x433130-0x3b1,_0x223401,_0x16d058-0x3e,_0x433130-0x1b6);}_0x4d7b67[_0x169649(0x1ca1,0x166c,0xd16,0xf59)]=''+botname,_0x4d7b67[_0x79c574(0x2940,0x2937,0x1f4e,0x1b8a)]=_0x4b485e[_0x169649(0x1328,0x1009,0x1c65,0x1269)],_0x4d7b67[_0x169649(0xf7e,0x103f,0x82b,0x1487)]=_0x4b485e['jWAzi'],_0x4d7b67[_0x169649(0x1fed,0x24c8,0xc85,0x16e2)]=_0x7b7088;const _0xcd775d=_0x175756[_0x79c574(0xd02,0x15f4,0x206,0xcf5)+'e'](_0x5cd288[_0x79c574(0x73f,0x1540,0x1ab6,0x153d)],_0x4d7b67,{'quoted':_0x5cd288});})[_0x23937d(0x934,0x203,0xd7,0x169a)](_0x250b0e=>{function _0x64d4ae(_0x57d862,_0x814ae2,_0x21c553,_0x6bfe76){return _0x23937d(_0x57d862-0x201,_0x814ae2,_0x21c553-0x44,_0x6bfe76-0x4c);}const _0x75a4c1={};_0x75a4c1[_0x64d4ae(0x18d5,0x11b6,0xdc3,0x141b)]=_0x4b485e[_0x64d4ae(0x78f,-0x774,0x1061,0x79e)];function _0x4786e8(_0x3a236f,_0x49759d,_0x21b249,_0x587787){return _0x313705(_0x21b249- -0xb1,_0x3a236f,_0x21b249-0x9,_0x587787-0x168);}const _0x4f1ee3=_0x75a4c1;if(_0x4b485e[_0x64d4ae(0x1fd8,0x1212,0x233d,0x251b)](_0x64d4ae(0x1a3c,0x18f3,0x1d1a,0x172d),_0x4b485e[_0x4786e8(0xcdb,0x13d0,0x1ad9,0x2434)]))_0x4b485e[_0x4786e8(0x10f3,0x20b6,0x18f1,0x25d3)](_0x1db05d,'*'+_0x494254+(_0x64d4ae(0xa67,0x26f,-0x2ac,-0x2d4)+'*'));else{const _0x34a317=_0x4f1ee3['aLiSU']['split']('|');let _0x31f763=0x18f4+0x2135*0x1+0x1*-0x3a29;while(!![]){switch(_0x34a317[_0x31f763++]){case'0':_0x391684+=_0x4786e8(0xd9c,0x10fd,0xaed,0x95b)+_0x1dc0aa[_0x64d4ae(0x11f9,0x1526,0x1012,0x1cb0)+'is']+'\x0a';continue;case'1':_0x3b270d+='\x0a•\x20'+_0x5d2cef['toString']()+_0x4786e8(0x60d,0x1782,0xb46,0x1471);continue;case'2':_0xce2286+=_0x64d4ae(0x2f7,-0x8cb,0x106c,-0xab)+_0x27e494[_0x64d4ae(0x11ad,0x1257,0x1cfa,0x951)]+'\x0a';continue;case'3':_0x2c2bfc+=-0x217*-0x7+0x6b*-0x5d+0x183f;continue;case'4':_0x466510+=_0x64d4ae(0x782,0xa28,0x1125,0x515)+_0x2c2b1e[_0x64d4ae(0xa7a,-0x469,-0x481,0x17ff)+_0x4786e8(0x17c1,0xbc6,0xf2d,0x4bf)]+'\x0a';continue;case'5':_0x87e593+=_0x64d4ae(0x7d1,0xa2f,0x2d2,0xe72)+_0x37f694[_0x4786e8(0x2c6e,0x2564,0x1dfe,0x28f8)]+'\x0a';continue;}break;}}});}else{_0x271996['pilih']=_0x14a3dd[_0x313705(0x1960,0xeed,0x211c,0x2785)](_0x3e4123[_0x313705(0x209f,0x2c1c,0x1f83,0x1c4e)][_0x23937d(0x6cb,-0x514,0x1495,-0x445)+'e']())[0xb3e*0x1+0xf*-0x55+-0xe5*0x7],_0x1ee2a1[_0x313705(0x209f,0x2cce,0x1f95,0x1d14)]=_0x3feb3b[_0x313705(0x209f,0x15e7,0x1768,0x146b)],_0x34f412(_0x23937d(0xc1a,0x10e0,0x165a,0x1374)+_0x23937d(0xa30,0x152a,-0x28a,0xabe)+_0x1e56c0[_0x313705(0x209f,0x134f,0x2695,0x2115)]+'\x20'+(!_0x1f90c3[_0x23937d(0x484,-0x6dc,0xe85,-0x9a8)]?_0x23937d(0xb56,-0x2a5,0x1719,0x716)+_0x313705(0xac0,0x274,-0xba,0xe06)+_0x23937d(0x135,0x9bc,-0x341,0x34c)+_0x313705(0x12bc,0x14e5,0x1f4c,0x953):''));if(!_0x1f0aa7[_0x313705(0x7ea,0x14d,0x58d,0xe66)])_0x5bf43c[_0x313705(0x18da,0x2049,0x157c,0x101e)](_0x13a7bb['p2'],_0x4b485e[_0x313705(0x2120,0x2306,0x2362,0x2886)],-0xae*-0xc+0x464+-0x646*0x2);}}break;case'donlod':{if(_0x1bac1f)return _0x1db05d(mess[_0x23937d(0x61c,-0x3a6,0xf1c,0x9e6)]);if(_0x1e03f5)return _0x4b485e[_0x313705(0xa5b,0x1117,0x170d,0x1342)](_0x1db05d,mess[_0x23937d(0x5c0,-0x297,0x12a1,0xa54)]);if(!_0x494254)return _0x4b485e[_0x23937d(0x72,0xf1b,0x819,0x1ee)](_0x1db05d,_0x313705(0x12dc,0xf32,0x16b3,0x1478)+_0x4b485e[_0x313705(0xaa6,0xe54,-0x30b,0x1057)](_0xe1d953,_0x1354e9)+_0x23937d(0xb5b,0x65d,0x488,0x6e5));if(!_0x4b485e['sZxtd'](isUrl,_0x1ba32f[0x2045*0x1+-0x19*0x128+0x1*-0x35d])&&!_0x1ba32f[0x5*0x188+-0xb*-0x11b+-0x13d1][_0x313705(0x4de,0x9ad,-0x485,-0x789)]('rexdl.com'))_0x4b485e[_0x313705(0x1c61,0x1283,0x1a4b,0x29bd)](_0x1db05d,_0x4b485e['gAazw']);let _0x4a83ad=_0x4b485e['BDmSR'](require,_0x4b485e[_0x313705(0xa44,0xddd,0x1363,0x290)]);_0x4a83ad[_0x23937d(0x82a,0x31e,0x6ed,0x1331)](''+_0x494254)['then'](async _0x22f77f=>{function _0x3cbff1(_0x273a2,_0x3db0d6,_0x3c36e1,_0x355f71){return _0x313705(_0x3c36e1-0x14c,_0x273a2,_0x3c36e1-0x78,_0x355f71-0xf2);}function _0x477db8(_0x3a34be,_0x3ab62a,_0x3d082c,_0x1dfe7f){return _0x23937d(_0x1dfe7f- -0x7f,_0x3d082c,_0x3d082c-0x2d,_0x1dfe7f-0x19a);}if(_0x4b485e['gvxlb'](_0x477db8(0x208e,0x1d3f,0x1550,0x1277),_0x4b485e[_0x3cbff1(0xcaf,0xdf4,0x19a5,0x138a)])){if(_0x4b485e['Cidlc'](_0x22f77f[0x21*-0xb2+-0x197*0x13+0x3527][_0x3cbff1(0x2dd5,0x2c78,0x2078,0x14cb)][_0x477db8(0x151b,0x15f1,0x129e,0xc50)]('MB')[0x1cba+0x1933*-0x1+-0x387],-0xcbe+-0x21fd+0x2f51))return _0x4b485e[_0x3cbff1(0x2b6f,0x17b7,0x21b7,0x2ada)](_0x1db05d,_0x4b485e[_0x477db8(0x2b3,0x4f,-0x237,-0x71)](_0x4b485e[_0x477db8(0x20de,0x1431,0xfba,0x1624)],util[_0x3cbff1(0xf3c,0x130b,0x1cb8,0x24e9)](_0x22f77f)));for(let _0x45ca90 of _0x22f77f){linkye=_0x477db8(0x6fa,0xd87,0xf06,0x474)+'OAD*\x0a\x0a*Tit'+_0x477db8(0x221b,0x27b6,0x1cc4,0x1972)+_0x45ca90[_0x3cbff1(0x2199,0x2037,0x1c8b,0x177f)]+('\x0a*Updated:'+'*\x20')+_0x45ca90['up']+(_0x3cbff1(0x16ac,0x2ecd,0x2264,0x15bf)+'*\x20')+_0x45ca90[_0x477db8(0x679,-0x2,0xf87,0x6bf)]+_0x477db8(0x1aae,0x133d,0x1c94,0x15b5)+_0x45ca90['size']+('\x0a*Url:*\x20\x0a*'+_0x477db8(0x1e72,0x724,0x13bd,0xfd3))+_0x45ca90['desc'],_0x175756[_0x477db8(-0x2da,-0x163,0x16f8,0x8c5)+'e'](_0x5cd288['chat'],{'image':await _0x4b485e['IWteW'](getBuffer,_0x45ca90[_0x3cbff1(0xd32,0x16e9,0xaf6,0x41c)]),'jpegThumbnail':await _0x4b485e['SwuFN'](getBuffer,_0x45ca90[_0x3cbff1(0xb9b,0x13f4,0xaf6,0x679)]),'caption':''+linkye},{'quoted':_0x5cd288}),_0x175756[_0x3cbff1(0x6f3,0x1dd,0xdf6,-0x4)+'e'](_0x5cd288['chat'],{'document':await getBuffer(_0x45ca90['link']),'mimetype':_0x3cbff1(0x9a7,0x5b3,0xb2e,-0x2fa)+'n/vnd.andr'+'oid.packag'+_0x477db8(0xee0,0x26df,0x1779,0x1ac0),'fileName':''+_0x45ca90['title']},{'quoted':_0x5cd288});}}else _0x1a195c(_0x4b485e[_0x3cbff1(0x4de,0xbcf,0x12ca,0x1ea7)](_0x4c2b92,_0xe6d2f3));})[_0x23937d(0x934,-0x5c9,0x16f4,0x1653)](_0x220a5a=>{_0x1db05d(mess['error']);});}break;case _0x4b485e[_0x313705(0xd16,-0x39,-0x10,-0xfe)]:{if(_0x1bac1f)return _0x1db05d(mess['ban']);if(_0x1e03f5)return _0x4b485e[_0x23937d(0xfda,0x1412,0x1a14,0xcd2)](_0x1db05d,mess[_0x313705(0x926,0xf6,0xc97,-0xfc)]);_0x175756['sendMessag'+'e'](_0x5cd288[_0x313705(0x14f2,0x1935,0xc04,0xbfc)],{'text':'@'+_0x5cd288[_0x23937d(0x14ce,0x998,0x1acc,0x1925)][_0x23937d(0xccf,0x104f,0x7e1,0xd6c)]('@')[-0x1c9d+0x27*0x37+0x143c],'contextInfo':{'mentionedJid':[_0x5cd288[_0x313705(0x1834,0xa5b,0x2524,0x150b)]]}},{'quoted':_0x5cd288});}break;case _0x4b485e['KeWoO']:case _0x4b485e[_0x313705(0x1534,0x1c2a,0x1115,0x1006)]:if(_0x1bac1f)return _0x4b485e[_0x23937d(0x13a5,0x14a9,0x1450,0x1b73)](_0x1db05d,mess[_0x313705(0x982,0xd1d,0x635,-0x2d7)]);if(_0x1e03f5)return _0x4b485e['jcPyf'](_0x1db05d,mess[_0x23937d(0x5c0,-0x58c,0xf20,-0x3f)]);_0x1db05d(mess[_0x313705(0xc12,0xf6a,0x956,0x14c6)]);let _0x3b7159=/(?:https|git)(?::\/\/|@)github\.com[\/:]([^\/:]+)\/(.+)/i;if(!_0x1ba32f[-0x1850+0x1*-0x1fe1+0x3831])_0x4b485e[_0x23937d(0x29f,0x896,-0xb67,0x8a5)](_0x1db05d,_0x23937d(0xf89,0xef7,0x1a52,0xa95)+_0xe1d953+(_0x23937d(0x1cd9,0x28ce,0x1d29,0xe9f)+_0x23937d(0x2da,0x91b,0x21b,-0x191)+_0x313705(0xaa2,0xbc7,0x1054,0x8a1)+_0x23937d(0xf08,0x6fe,0xe,0x1837)+'ub.com/pra'+_0x313705(0x2161,0x2cbb,0x1cf8,0x2e0d)));if(!_0x3b7159[_0x313705(0x1c74,0x157f,0x25d0,0x1004)](_0x1ba32f[0x13*0x137+0xdd*-0x24+0x7ff]))return _0x4b485e[_0x313705(0x1e76,0x1791,0x2408,0x28ca)](_0x1db05d,mess['linkm']);let [,_0x34a998,_0x39c18b]=_0x1ba32f[-0x29b*-0x8+0x1*0x17b9+0x2c91*-0x1][_0x313705(0x118e,0x1021,0x1d79,0x1460)](_0x3b7159)||[];_0x39c18b=_0x39c18b[_0x23937d(0x1872,0xaf2,0x2261,0x1ece)](/.git$/,'');let _0x20cc11=_0x23937d(0x1381,0x1c0c,0x1131,0x1cac)+_0x23937d(0xacc,0x1104,0xed9,0x159e)+'om/repos/'+_0x34a998+'/'+_0x39c18b+_0x23937d(0x1203,0x1c25,0x674,0x15c2);const _0x2c2d50={};_0x2c2d50['method']='HEAD';let _0x31f7c5=(await fetch(_0x20cc11,_0x2c2d50))[_0x23937d(0x1500,0x2132,0x849,0x15f2)][_0x23937d(0xc3d,0x667,0xf65,0x2bf)](_0x4b485e['iIUzS'])[_0x23937d(0xe28,0xd49,0x156,0x17b9)](/attachment; filename=(.*)/)[0x1f6*-0xf+-0x1857+0x7*0x7ae];const _0x32bc08={};_0x32bc08[_0x23937d(0xa79,0x1729,0x82a,-0x1f1)]=_0x20cc11,_0x175756[_0x23937d(0x944,0xd88,0x10a5,0x594)+'e'](_0x5cd288[_0x23937d(0x118c,0x18f9,0x1866,0xf21)],{'document':_0x32bc08,'fileName':_0x4b485e['gcADn'](_0x31f7c5,_0x4b485e['lbnIt']),'mimetype':_0x4b485e[_0x313705(0x1f63,0x258e,0x2528,0x1cdc)]},{'quoted':_0x5cd288})[_0x23937d(0x934,0x749,0x216,-0x5d7)](_0x254d74=>_0x1db05d(mess[_0x23937d(0x1db0,0x108b,0x1a3a,0x219b)]));break;case _0x4b485e[_0x313705(0x6d1,0xded,-0x49c,0x854)]:if(_0x1bac1f)return _0x4b485e[_0x313705(0xd95,0x1a7e,0xd51,0xa95)](_0x1db05d,mess['ban']);if(_0x1e03f5)return _0x1db05d(mess[_0x313705(0x926,0xf75,0x7bd,0xc94)]);if(!_0x494254)return _0x4b485e[_0x313705(0x1441,0x1be3,0x1d13,0xc1a)](_0x1db05d,_0x4b485e[_0x313705(0x104f,0xa85,0xbf6,0x1c4e)]);await _0x4b485e['AoqmV'](_0x1db05d,mess[_0x23937d(0x8ac,0x24e,0x96f,0xa6e)]),xeonkey[_0x313705(0x1edb,0x27f2,0x1119,0x2550)](''+_0x494254)['then'](async _0x3976b8=>{function _0x37ee29(_0x5d6329,_0x3eb7c7,_0x545586,_0x9107b9){return _0x313705(_0x3eb7c7- -0x48e,_0x5d6329,_0x545586-0x16a,_0x9107b9-0xcd);}const _0x2ed824={};function _0xa4593c(_0x41fa30,_0x1ac14b,_0x176790,_0x340cc3){return _0x23937d(_0x340cc3-0x514,_0x176790,_0x176790-0x25,_0x340cc3-0x6c);}_0x2ed824[_0x37ee29(-0x3cc,0x2cb,0x1173,0x1167)]=_0x4b485e[_0x37ee29(0xa1,0x3f1,0xa8c,-0x6d8)],_0x2ed824[_0x37ee29(0x145a,0x1c5a,0x1289,0xeee)]=_0x4b485e[_0x37ee29(0x816,0x4e,0x82f,-0x3bf)],_0x2ed824[_0x37ee29(0x2497,0x1ba4,0x1c8a,0x1ce5)]=_0x4b485e[_0x37ee29(0x1f8f,0x1b4d,0x203f,0x1d47)];const _0x36c770=_0x2ed824;if(_0x4b485e[_0x37ee29(0x18fd,0x1341,0xe2c,0x1a31)](_0x4b485e['KopPp'],_0x37ee29(0x463,0x12bd,0x1547,0x963))){const _0x509a33={};_0x509a33[_0xa4593c(0x1592,0x7ac,0x172b,0xf8d)]=_0x2c7ccb[0x1*-0x17af+0x15d8+0x2*0xec];const _0x3dee71={};_0x3dee71[_0x37ee29(0xbfe,0x1b1b,0x13c3,0x1d48)]=_0x509a33,_0x3dee71[_0x37ee29(0xd94,0x840,-0x256,-0x2ca)]=_0x37ee29(0xfa8,0xdde,0x1859,0x302);const _0x18a973={};_0x18a973[_0xa4593c(0xec3,0x107b,0x1a0,0xaf0)]=_0x1f70a9,_0x5d74ed[_0x37ee29(0x76d,0x81c,0x4,0xbc3)+'e'](_0x5cd5a7,_0x3dee71,_0x18a973);}else{let _0x26aa8e=_0xa4593c(0x1726,0x14b3,-0x488,0x945)+_0xa4593c(0x1cb5,0x190a,0x6eb,0x112d)+_0xa4593c(0x2c38,0x23e2,0x1a5a,0x2260)+'\x0a';for(let _0x4354f6 of _0x3976b8){if(_0x4b485e['VDcJA'](_0x4b485e[_0x37ee29(0x8fe,0x1501,0x1033,0xe15)],_0x4b485e[_0xa4593c(0x248b,0x1311,0x1800,0x1b3d)])){const _0xa90e1={};_0xa90e1[_0xa4593c(0xa48,0xbf9,0x1460,0x1908)+'t']=_0x37ee29(0x172d,0x1485,0x1b98,0xe34)+'\x20⫸';const _0x4d6a5f={};_0x4d6a5f[_0xa4593c(0x1a83,0x2824,0x29a4,0x2020)]=_0x461629+_0x37ee29(0x41,0xf42,0x12e2,0xe17),_0x4d6a5f[_0x37ee29(0x17b2,0x1474,0x13be,0x1ca6)]=_0xa90e1,_0x4d6a5f[_0x37ee29(0x314,0x610,0xb30,0xc08)]=0x1;const _0x414232={};_0x414232[_0xa4593c(0x1cd4,0xb4d,0xa7d,0x1908)+'t']=_0x36c770[_0x37ee29(0xe8a,0x2cb,-0x5fa,0x61f)];const _0x31424c={};_0x31424c['buttonId']=_0x5085aa+_0xa4593c(0xc9a,0x171d,0x1b85,0x12f4),_0x31424c[_0x37ee29(0x13e5,0x1474,0x1ff8,0x1475)]=_0x414232,_0x31424c['type']=0x1;const _0x4b373c={};_0x4b373c[_0xa4593c(0x1f2e,0xb9a,0x21b1,0x1908)+'t']=_0x36c770[_0x37ee29(0x1a44,0x1c5a,0x15c0,0x1f36)];const _0x20548e={};_0x20548e[_0x37ee29(0xdf1,0x19e4,0x233d,0x1c8e)]=_0x47c6f9+_0x37ee29(0x1993,0x13c7,0x1c45,0x15ba),_0x20548e[_0x37ee29(0x1bcb,0x1474,0x631,0xeb7)]=_0x4b373c,_0x20548e[_0xa4593c(0x175f,-0x17d,0xc54,0xc4c)]=0x1;let _0x3b4d23=[_0x4d6a5f,_0x31424c,_0x20548e];const _0x587304={};_0x587304['url']=_0xa4593c(0x2c4,-0x71,0xa83,0xe2b)+'ibb.co/fHP'+_0x37ee29(0x30,0x4b2,-0xa6e,-0x48)+_0xa4593c(0x1f18,0x6dc,0xb07,0x14b8)+_0xa4593c(0x18d1,0x545,0x1078,0xb01);const _0x386be5={};_0x386be5[_0xa4593c(0x3056,0x21a5,0x233b,0x2157)]=_0x587304,_0x386be5[_0x37ee29(-0x44,0x840,0x56f,0x5b1)]=_0x37ee29(-0xbb8,0x61,-0xb12,0x3eb)+_0x51158b+(_0x37ee29(0xce3,0x1f,0x7ee,0x138)+'═══💠\x20OWNER'+_0x37ee29(0x1caf,0x129d,0xe32,0x750)+_0x37ee29(0x697,0x27d,0x838,0x21e))+_0x137f0c+'\x20'+_0x509345+(_0x37ee29(0x16b,0xc88,0x1471,0xd62)+_0x37ee29(-0x3f8,0x126,0x522,0x356)+_0xa4593c(-0x89d,-0x4cc,0x51e,0x619))+_0x1ad420+'\x20'+_0xfab93e+(_0x37ee29(0xd9b,0x1302,0x1a0b,0x11a8)+_0x37ee29(0x1cd6,0x12a9,0xca4,0x1566))+_0x400ee0+'\x20'+_0x58fa42+('upsongvn\x20['+_0x37ee29(0x1855,0xfcb,0x48c,0x5fe))+_0x1f5117+'\x20'+_0x750a44+(_0xa4593c(0x1175,-0x207,-0x4d3,0x4ed)+'on/off]\x0a┃╠')+_0x4cb5fb+'\x20'+_0x3e304e+(_0xa4593c(0x2eb8,0x2619,0x2df4,0x20e0)+'┃╠')+_0x5d5b80+'\x20'+_0x287a3d+('ephemeral\x20'+'[option]\x0a┃'+'╠')+_0x45c4b3+'\x20'+_0x2f20f6+(_0x37ee29(0xfb,0x108,0xa40,0xc22)+'mage]\x0a┃╠')+_0x28587d+'\x20'+_0x594b8d+('setname\x20[t'+_0xa4593c(-0x605,0x513,0x1584,0x868))+_0x52c316+'\x20'+_0x236a22+(_0x37ee29(0x15b6,0xe2d,0x51c,0xbdd)+_0x37ee29(0xdf5,0x22c,-0xc9,0x520))+_0x40027c+'\x20'+_0x47ebe7+('editinfo\x20['+'option]\x0a┃╠')+_0x5a6a58+'\x20'+_0x414bdf+('add\x20[user]'+'\x0a┃╠')+_0x4c462c+'\x20'+_0x8e5adb+(_0x37ee29(-0x897,0x512,0xaf1,-0x9b0)+_0xa4593c(0x17c7,0xdb5,-0x47f,0xa65))+_0x1a1168+'\x20'+_0x39e0dc+('hidetag\x20[t'+_0x37ee29(0x48c,0x22c,-0x608,0xa7e))+_0x584a86+'\x20'+_0x5c6b71+('tagall\x20[te'+'xt]\x0a┃╠')+_0x195e57+'\x20'+_0xe80409+('mute\x20[on/o'+_0x37ee29(0xe02,0x124b,0x521,0x177b))+_0x26d5ba+'\x20'+_0x355524+(_0xa4593c(0x1b19,0x1956,0x2d17,0x2002)+_0x37ee29(0x113b,0x7b5,-0x753,0x73)+'┃╠')+_0x19897e+'\x20'+_0x52cf2a+(_0x37ee29(0x11bc,0x511,-0x275,-0x66c)+'ply/tag]\x0a┃'+'╠')+_0x45da22+'\x20'+_0x61e5b7+'vote\x0a┃╠'+_0x2bf860+'\x20'+_0x802e7c+_0x37ee29(-0x7c0,0x70e,0x1195,0x1541)+_0x2e99cb+'\x20'+_0x51c90d+_0xa4593c(0x2586,0x155b,0x1857,0x1afd)+_0x554c89+'\x20'+_0x530055+(_0xa4593c(0x1d33,0x2a01,0x25a5,0x1f77)+'┃╠')+_0x284c7b+'\x20'+_0x3b76b8+_0x37ee29(0x1e00,0x1bcd,0x1c1f,0x277a)+_0x2eaee8+'\x20'+_0x1b929f+(_0xa4593c(0xf4a,-0x6fb,-0x3b0,0x75a)+_0xa4593c(0x1b5e,0x17fe,0x25bd,0x1f60)+_0xa4593c(0x1fe9,0x23eb,0x26c2,0x19f4)+'══☬\x0a┗━━❯\x20')+_0x299860+_0x37ee29(0xa55,0x75a,0x525,0x134a),_0x386be5[_0xa4593c(0x1896,0xf85,0x1877,0x1582)]=_0x36c770['ZAqgc'],_0x386be5[_0xa4593c(0xde2,0xa2f,0x1df7,0x114e)]=_0x3b4d23,_0x386be5['headerType']=0x4;let _0x313442=_0x386be5;const _0x1aa648={};_0x1aa648[_0x37ee29(0xe7,0x4b4,-0x782,-0x790)]=_0x42159f,_0x4795eb[_0xa4593c(0x88c,0x1bcc,0x3ff,0xe58)+'e'](_0x6548ec[_0x37ee29(0x1a36,0x1064,0x1109,0xf31)],_0x313442,_0x1aa648);}else _0x26aa8e+=_0x37ee29(0x39e,0x1079,0x111b,0x245)+'*\x20'+_0x4354f6[_0x37ee29(0x2197,0x14b2,0x214f,0x1706)]+'\x0a',_0x26aa8e+=_0xa4593c(0xc3c,0xd62,0x5c4,0x1337)+'*\x20'+_0x4354f6[_0x37ee29(0x96c,0x1483,0x1d66,0x1e30)]+'\x0a',_0x26aa8e+=_0x37ee29(0x91e,0x15cf,0x1340,0x1549)+'*\x20'+_0x4354f6['genre']+'\x0a',_0x26aa8e+='*📚\x20Url\x20:*\x20'+_0x4354f6[_0x37ee29(0x968,0x951,0xefb,0x5a8)]+(_0xa4593c(0x1ebe,0x119d,0x22fc,0x14ec)+_0xa4593c(0x18b8,0x10eb,0x1610,0xba3)+'----------'+_0x37ee29(0x464,0x567,0x29e,0x236)+_0x37ee29(-0xd1,0x567,0xb72,-0xbb)+_0x37ee29(-0xc5,0xb20,-0xd2,0xe65));}await sendFileFromUrl(_0x423161,_0x3976b8[-0x122b+-0xd00+0x1f2b][_0xa4593c(0x20ec,0x13ff,0x1544,0x1bfd)],_0x26aa8e,_0x5cd288);}})['catch'](_0x336f82=>{function _0x1d7fd0(_0x1f4e00,_0x4d5a8b,_0xf1306b,_0x3f0b73){return _0x313705(_0xf1306b- -0xb4,_0x1f4e00,_0xf1306b-0xfd,_0x3f0b73-0x13e);}function _0x3624ac(_0x4031ff,_0x11f79a,_0x250306,_0x38a5a1){return _0x23937d(_0x250306-0x481,_0x4031ff,_0x250306-0x17b,_0x38a5a1-0x2a);}if(_0x4b485e['KEfEC']===_0x4b485e['KEfEC'])_0x4b485e['VfyIv'](_0x1db05d,mess[_0x1d7fd0(0x121c,0x2be7,0x2062,0x11f0)]);else{const _0x1a941d={};_0x1a941d[_0x3624ac(0x26b2,0x1378,0x1875,0xcf9)+'t']='🎸Download\x20'+_0x1d7fd0(0x2049,0x2344,0x185a,0x1efb);const _0x5cf360={};_0x5cf360[_0x1d7fd0(0x1ea8,0x23c0,0x1dbe,0x18e1)]=_0x23e1df+('downloadme'+'nu'),_0x5cf360['buttonText']=_0x1a941d,_0x5cf360['type']=0x1;const _0x32117a={};_0x32117a['displayTex'+'t']='🎸Search\x20Me'+'nu';const _0x1a8b55={};_0x1a8b55[_0x1d7fd0(0x1d33,0x1e42,0x1dbe,0x1c70)]=_0x72142a+'searchmenu',_0x1a8b55['buttonText']=_0x32117a,_0x1a8b55[_0x1d7fd0(0x4cd,0x165b,0x9ea,0x619)]=0x1;const _0x2fe450={};_0x2fe450[_0x1d7fd0(0x1bbc,0x1c48,0x16a6,0x1936)+'t']=_0x4b485e['ATulh'];const _0x17a35d={};_0x17a35d[_0x3624ac(0x10f7,0x2634,0x1f8d,0x10d3)]=_0x51b8b8+'rpgmenu',_0x17a35d[_0x3624ac(0xbec,0x2281,0x1a1d,0xb75)]=_0x2fe450,_0x17a35d['type']=0x1;let _0x41b9a1=[_0x5cf360,_0x1a8b55,_0x17a35d];const _0x314049={};_0x314049['text']='🪐\x20Other\x20Li'+_0x3624ac(0x18fb,0x18b3,0x1f40,0x13b5),_0x314049[_0x3624ac(0x1f28,0x87c,0x10bb,0x1b2d)]=_0x41b9a1,_0x314049[_0x3624ac(0x2b67,0x13b5,0x1f9a,0x2b3c)]=0x4;let _0x50d887=_0x314049;_0x44f5c4[_0x3624ac(0x1b78,0x12f3,0xdc5,0x12c3)+'e'](_0x6deb7b['chat'],_0x50d887);}});break;case _0x4b485e[_0x23937d(0xd3b,0x10c8,0x9c7,0xd00)]:{if(_0x4b485e[_0x313705(0x14e9,0x687,0xaa5,0x17d0)](_0x23937d(0x1c32,0x28d6,0x1877,0x2759),'cXBOi')){if(_0x1bac1f)return _0x4b485e[_0x23937d(0x119b,0x122e,0x6f7,0x17eb)](_0x1db05d,mess[_0x313705(0x982,0xf0d,0x56,0xf76)]);if(_0x1e03f5)return _0x4b485e['cgdBb'](_0x1db05d,mess[_0x23937d(0x5c0,-0x19c,-0x2f7,0xa07)]);if(!_0x494254)return _0x4b485e[_0x313705(0x130b,0x12da,0x18f7,0x18a7)](_0x1db05d,_0x313705(0x110b,0x2005,0x2018,0x1346)+_0x4b485e[_0x313705(0xb0f,0x4c7,0xfa3,-0x2b2)](_0xe1d953,_0x1354e9)+'\x20love');let _0x22c614=await _0x4b485e[_0x313705(0x1181,0x15dd,0x774,0x5c3)](fetchJson,_0x23937d(0x1449,0x1df3,0x1bce,0x564)+'nzapis.xyz'+_0x313705(0x834,0x1752,0x12bb,0x148f)+_0x23937d(0x14bc,0x15dd,0xdd4,0x195e)+'y='+_0x494254+(_0x23937d(0x1d5e,0x237f,0x2156,0x289d)+_0x23937d(0x775,0x13a5,0x61,0xba0))),_0x569baf=_0x313705(0xc1d,0xbd6,0x10ab,-0x1e)+'rch\x20From\x20:'+'\x20'+_0x494254+'\x0a\x0a';for(let _0x1652a9 of _0x22c614[_0x313705(0x1c63,0x1ea5,0x1e44,0x19f3)]){const _0x3cea87=_0x4b485e[_0x23937d(0x10aa,0x19ea,0x1c4a,0x1e3)][_0x23937d(0xccf,0x5d0,0x176d,0x1176)]('|');let _0x300f59=0x713+-0x34*0x80+-0x12ed*-0x1;while(!![]){switch(_0x3cea87[_0x300f59++]){case'0':_0x569baf+=dragonemoji+_0x313705(0x13cc,0x1d98,0x5ea,0x1cff)+_0x1652a9[_0x23937d(0x15da,0x8c9,0x1acd,0x17f2)]+'\x0a';continue;case'1':_0x569baf+=dragonemoji+'\x20Genre:\x20'+_0x1652a9['genre']+'\x0a';continue;case'2':_0x569baf+=dragonemoji+_0x23937d(0x996,0x153b,0x1234,0x72d)+_0x1652a9[_0x23937d(0x15ab,0xb31,0xaf7,0x1122)]+'\x0a';continue;case'3':_0x569baf+=dragonemoji+(_0x23937d(0xc24,0x10ce,0x18ad,-0x25f)+'\x20Url:\x20')+_0x1652a9[_0x23937d(0x16e9,0x1bcf,0x1d3b,0x150b)]+(_0x313705(0x1056,0x1cc1,0x163f,0x1624)+_0x23937d(0x1955,0x1aef,0xcb0,0x10b1)+_0x23937d(0x11ae,0x567,0x4de,0x13c0));continue;case'4':_0x569baf+=dragonemoji+'\x20Url:\x20'+_0x1652a9[_0x313705(0xddf,0x5a1,0x11ba,0xc03)]+'\x0a';continue;}break;}}_0x175756[_0x313705(0x178f,0x160b,0x199d,0x2560)](_0x5cd288['chat'],_0x22c614[_0x23937d(0x18fd,0xfd5,0x14fc,0x1d19)][0x3*0x6f7+0x24e9*0x1+0xe*-0x421]['thumbnail'],_0x569baf,_0x5cd288);}else{const _0x41e023={};_0x41e023[_0x23937d(0x13f4,0x8d3,0x1c38,0x1038)+'t']=_0x4b485e[_0x313705(0x14d4,0x16d5,0x1c0b,0x1b68)];const _0x16548f={};_0x16548f[_0x23937d(0x1b0c,0x156a,0x1ee6,0x16d3)]=_0x1832d8+_0x23937d(0x106a,0x2f9,0x14b7,0x1d2c),_0x16548f['buttonText']=_0x41e023,_0x16548f[_0x23937d(0x738,0x1e9,0xfb1,0xad0)]=0x1;const _0x22e768={};_0x22e768['displayTex'+'t']=_0x4b485e['lOURB'];const _0x310e1d={};_0x310e1d['buttonId']=_0x557e3d+_0x23937d(0xde0,0x13e4,0x14d4,0xb31),_0x310e1d['buttonText']=_0x22e768,_0x310e1d['type']=0x1;const _0x49533={};_0x49533[_0x23937d(0x13f4,0x1ce0,0x19e9,0xfff)+'t']=_0x4b485e['FMFDA'];const _0x5c9f97={};_0x5c9f97['buttonId']=_0xaf83e6+_0x313705(0x1855,0xe13,0x1a50,0x9ec),_0x5c9f97[_0x313705(0x1902,0x1d33,0xfe1,0x142b)]=_0x49533,_0x5c9f97['type']=0x1;let _0x25c201=[_0x16548f,_0x310e1d,_0x5c9f97];const _0x424a8c={};_0x424a8c['url']=_0x4b485e[_0x23937d(0x109,-0x2d1,-0x93,0xa7a)];const _0x5206c2={};_0x5206c2[_0x313705(0x1fa9,0x2763,0x2863,0x25b0)]=_0x424a8c,_0x5206c2['caption']='\x0a┏━❯\x20'+_0x1f1474+('\x20❮━━😎\x20\x0a┃╔═'+'═══💠\x20DATAB'+_0x313705(0x2029,0x2f0e,0x1cf1,0x22bb)+_0x313705(0x1240,0xb88,0x213d,0x1896)+_0x313705(0x46b,0xa66,0x1224,0x69b))+_0x9515ec+'\x20'+_0x191a35+_0x23937d(0x6f9,0xce,0x617,0x3bf)+_0x39d44b+'\x20'+_0x3de6b0+_0x313705(0xba1,0x17a4,0x1173,0x190f)+_0x3a9a1c+'\x20'+_0x418cd4+_0x313705(0x18ab,0x2761,0x1a23,0x1ccb)+_0x4b93ed+'\x20'+_0x3b2123+_0x23937d(0xf20,0x19e6,0xc0b,0xcdc)+_0x4c2ccb+'\x20'+_0x39c20b+_0x23937d(0x83f,0xa94,0x376,0x3fd)+_0x2a345a+'\x20'+_0x49058d+_0x313705(0x631,0x12b2,-0x169,0xd9f)+_0x32fbc4+'\x20'+_0x5036b5+'getmsg\x0a┃╠'+_0x59e932+'\x20'+_0x153e6e+(_0x313705(0x11ac,0x5b4,0x1af1,0x20c7)+'══════════'+_0x23937d(0x1002,0x1b56,0x1957,0x8bc))+_0x2529ca+_0x313705(0xbe8,0xebe,0x5c0,0x72f),_0x5206c2[_0x23937d(0x106e,0x189e,0x1279,0xe71)]=_0x50ceac[_0x23937d(0x421,-0x903,0xa43,0x23f)]['name'],_0x5206c2['buttons']=_0x25c201,_0x5206c2[_0x23937d(0x1b19,0x101e,0xd10,0x1ffe)]=0x4;let _0x3893aa=_0x5206c2;const _0x2c084c={};_0x2c084c[_0x23937d(0x5dc,0x942,-0x8cc,-0x551)]=_0x526255,_0x1f7c3c['sendMessag'+'e'](_0x1d02ff[_0x23937d(0x118c,0x638,0x92a,0x3d4)],_0x3893aa,_0x2c084c);}}break;case _0x4b485e[_0x313705(0x186b,0x1bfb,0xec0,0x12c4)]:if(_0x1bac1f)return _0x4b485e[_0x23937d(0x1b2f,0x137e,0x1a11,0xdbb)](_0x1db05d,mess[_0x313705(0x982,-0x181,0xc56,0x94c)]);if(_0x1e03f5)return _0x4b485e['lDKdb'](_0x1db05d,mess[_0x313705(0x926,0x617,0x663,0xe8a)]);if(!q)return _0x1db05d(_0x313705(0x1ada,0xc7e,0x1852,0x1b98)+'e\x20do\x20you\x20w'+'ant\x20to\x20sea'+'rch?\x0aExamp'+_0x313705(0x185d,0x1806,0x15b4,0xa81)+_0xe1d953+(_0x23937d(0xbca,0x10d,0x1871,0x36f)+'to'));_0x1db05d(mess[_0x23937d(0x8ac,0x15f0,0xeb2,0xccc)]);const {Anime:_0x1375ed}=_0x4b485e[_0x313705(0x212a,0x28ca,0x15db,0x2288)](require,'@shineiich'+'ijo/marika'),_0xdc9255=new _0x1375ed();let _0x506a94=await _0xdc9255[_0x313705(0x67a,0xdfc,-0x2e2,0x970)+'e'](q),_0x4b172e=_0x506a94[_0x313705(0x117d,0x18d7,0xb22,0x8cb)][0xc1*0x2b+0x1a42+-0x1*0x3aad];console[_0x313705(0xf2c,0x1a5c,0x1972,0x3fb)](_0x4b172e);let _0x5581aa=_0x313705(0xabc,0x1263,0xbd,0x111)+_0x4b172e[_0x23937d(0x17d9,0x144c,0xac9,0xc7c)]+'*\x0a';_0x5581aa+=_0x23937d(0xda,0xd8f,-0x1c0,0xd03)+'\x20'+_0x4b172e['type']+'*\x0a',_0x5581aa+='📈\x20*Status:'+'\x20'+_0x4b172e[_0x23937d(0x3eb,-0x809,-0x874,-0x6b6)][_0x23937d(0x1253,0x1032,0x6ff,0x3ec)+'e']()[_0x23937d(0x1872,0x2208,0x1e2c,0xab8)](/\_/g,'\x20')+'*\x0a',_0x5581aa+=_0x23937d(0xe3b,0x1191,0x1c77,0xe38)+_0x313705(0x18d4,0x13ea,0x1e1a,0x1030)+_0x4b172e[_0x23937d(0xaaa,0x40,0x1b4,0x4fc)]+'*\x0a',_0x5581aa+=_0x23937d(0x802,0x9aa,0x16,0xf6a)+'n:\x20'+_0x4b172e['duration']+'*\x0a',_0x5581aa+=_0x23937d(0x1a93,0x13b3,0x11d4,0x27a4)+'*\x0a';for(let _0x4ce41e=-0x2389+-0xa35+0x1*0x2dbe;_0x4b485e[_0x23937d(0x19e7,0xc34,0x28a7,0x20a4)](_0x4ce41e,_0x4b172e['genres'][_0x313705(0x744,0x201,0x12fe,0x302)]);_0x4ce41e++){_0x5581aa+='\x09\x09\x09\x09\x09\x09\x09\x09*'+_0x4b172e[_0x23937d(0xda2,0x50c,0x9a4,0x142f)][_0x4ce41e]['name']+'*\x0a';}_0x5581aa+=_0x23937d(0x1c23,0xd46,0x1ab3,0x1e1a)+'n:\x20'+_0x4b172e['source'][_0x23937d(0x1253,0x1fc9,0xaf7,0x1b6a)+'e']()+'*\x0a',_0x5581aa+=_0x313705(0x4cd,-0x515,0x10bd,-0x821)+':*\x0a';for(let _0x35efe6=0x1*0x7c4+-0x262b+0x1e67;_0x35efe6<_0x4b172e[_0x313705(0x1a84,0x106e,0x1186,0xec7)][_0x23937d(0x3de,0x12b1,0xab8,0x75e)];_0x35efe6++){_0x4b485e[_0x313705(0x1307,0x604,0x1e69,0x170d)](_0x313705(0x1a16,0x1b2c,0x1657,0x21a9),_0x4b485e[_0x313705(0x1b27,0x111b,0x1a35,0x1b16)])?_0x5581aa+=_0x313705(0x1a2e,0x114e,0x12e3,0x1094)+_0x4b172e['studios'][_0x35efe6][_0x313705(0x17b7,0x2645,0x2301,0x15a9)]+'*\x0a':_0x12d527[_0x3a20b4[_0x23937d(0x14ce,0x124e,0xf3c,0x705)]['split']('@')[-0x1d7e+-0xd*-0x224+-0x3*-0x8e]]=_0x15cc79[_0x313705(0x1cb4,0x1076,0x28bc,0x1d15)][_0x23937d(0x6cb,0xf19,0xc7e,0x507)+'e']();}_0x5581aa+=_0x313705(0x1ef5,0x1e2c,0x2031,0x2c7b)+_0x23937d(0x16bb,0xc46,0x1a98,0x2306);for(let _0x4c02e1=-0xc9a+0x1cf5+0x1*-0x105b;_0x4b485e[_0x313705(0xa48,0x1777,0x120a,0x1e7)](_0x4c02e1,_0x4b172e[_0x23937d(0x1cd2,0x12cd,0x12d8,0x2773)][_0x313705(0x744,0xf2,0x1ad,0x95a)]);_0x4c02e1++){_0x5581aa+='\x09\x09\x09\x09\x09\x09\x09\x09\x09\x09'+'*'+_0x4b172e[_0x23937d(0x1cd2,0x115d,0x28b9,0x2423)][_0x4c02e1][_0x23937d(0x1451,0x1af9,0x117f,0x1ec4)]+'*\x0a';}_0x5581aa+=_0x23937d(-0x2b,0x8b6,0x22e,0x41f)+'ed\x20on:\x20'+_0x4b172e[_0x23937d(0xc9d,0x11ae,0xcb3,0x192b)][_0x313705(0xf27,0x10e8,0xecd,0x1320)]+'*\x0a',_0x5581aa+=_0x313705(0x1df8,0x1ee0,0x2265,0x252c)+'on:\x20'+_0x4b172e[_0x23937d(0xc9d,0x3f2,0x1f5,0xa42)]['to']+'*\x0a',_0x5581aa+=_0x313705(0x1977,0x1dc5,0x1fd7,0x270c)+'ity:\x20'+_0x4b172e[_0x313705(0x1486,0x1e3f,0x1e09,0x1907)]+'*\x0a',_0x5581aa+=_0x313705(0x1ad1,0x1e90,0xf60,0xc24)+_0x313705(0x1d73,0x2a25,0x2b47,0x1999)+_0x4b172e[_0x23937d(0x80a,0xf5c,0x16b7,0x524)]+'*\x0a',_0x5581aa+='🎇\x20*Rating:'+'\x20'+_0x4b172e[_0x23937d(0x2de,0x1189,-0xc23,0x1015)]+'*\x0a',_0x5581aa+=_0x23937d(0xb9,-0x3e4,-0x783,-0x49e)+_0x4b172e[_0x23937d(0xa61,0x7fa,0x9d5,-0x2e8)]+_0x23937d(0x1115,0x5f0,0x71f,0xc8a);if(_0x4b485e['rAdot'](_0x4b172e[_0x313705(0xcb9,0x1a06,0x4c6,0x11d0)][_0x23937d(0xa79,0x5f9,0xe87,0x17a2)],null))_0x5581aa+=_0x313705(0xada,0xb06,0xf9f,0x1528)+':\x20'+_0x4b172e[_0x313705(0xcb9,0x1641,0x3e3,0x1093)][_0x23937d(0xa79,-0x20b,0xcbb,0x198b)]+_0x23937d(0x1115,0x376,0x199f,0x24d);_0x5581aa+=_0x313705(0x1477,0x17a8,0x1076,0x20ae)+_0x4b172e[_0x23937d(0xa79,0x3f5,0x1466,0x24d)]+_0x23937d(0x1115,0xfcc,0x1ebc,0x12b9);if(_0x4b485e[_0x313705(0x1e07,0x274b,0x1cb9,0x2ccd)](_0x4b172e[_0x23937d(0x1c99,0x10d2,0x1db0,0x234d)],null))_0x5581aa+=_0x313705(0x11c3,0x1c68,0x107d,0x1a3e)+'und:*\x20'+_0x4b172e[_0x23937d(0x1c99,0x1f44,0x2aa1,0x24d4)]+_0x313705(0x147b,0x864,0x198a,0x105b);_0x5581aa+=_0x23937d(0xdbe,0x10d7,0x1b08,0x19ce)+_0x313705(0x17a8,0x8d0,0xf30,0x1556)+_0x4b172e[_0x23937d(0xfe7,0x4ce,0x1169,0x3c7)][_0x313705(0x1bd8,0x2627,0x115b,0xd3c)](/\[Written by MAL Rewrite]/g,'');const _0x44085a={};_0x44085a[_0x313705(0xddf,0x1056,0xa38,0x1862)]=_0x4b172e['images'][_0x23937d(0xb3d,0xb93,0x1187,0x10b2)][_0x313705(0x11eb,0x10c2,0xaa0,0x606)+_0x23937d(0x12ba,0x16c6,0x72d,0x1e55)];const _0x2bc640={};_0x2bc640[_0x313705(0x1fa9,0x2e16,0x261d,0x12bf)]=_0x44085a,_0x2bc640[_0x313705(0xcce,-0x189,0x187c,0x2a1)]=_0x5581aa,_0x175756[_0x313705(0xcaa,0x16ce,-0x1ad,0x1825)+'e'](_0x5cd288[_0x313705(0x14f2,0x1680,0x2197,0x1768)],_0x2bc640,{'quoted':_0x5cd288});break;case _0x4b485e[_0x23937d(0x3dc,0x8d0,0xecf,0x164)]:if(_0x1bac1f)return _0x4b485e[_0x313705(0x157a,0x2214,0xa3a,0x70d)](_0x1db05d,mess[_0x23937d(0x61c,0xe9f,0x1462,0xab5)]);if(_0x1e03f5)return _0x4b485e[_0x23937d(0x1bf6,0x2868,0x1bde,0x147b)](_0x1db05d,mess[_0x313705(0x926,0x838,-0x487,0x8a)]);_0x1db05d(mess[_0x23937d(0x8ac,0x1575,0x149b,-0x4fd)]);const {Manga:_0x5836c6}=_0x4b485e[_0x23937d(0x9a3,0x16c3,-0x454,0xbab)](require,_0x4b485e[_0x23937d(0xe43,0x11a,0xdd4,0x6fc)]),_0xe32a72=new _0x5836c6();if(!q)return _0x4b485e[_0x313705(0x1580,0xdfc,0x112e,0x20b9)](_0x1db05d,_0x23937d(0x19bc,0xe2f,0xaf5,0x142e)+_0x313705(0x1879,0xcb1,0x1692,0x1452)+_0x313705(0x110d,0x1ad5,0x829,0xda0)+_0x23937d(0x174c,0x864,0x1baf,0x2553)+_0x313705(0x185d,0x173c,0xbb0,0x2062)+_0xe1d953+(_0x313705(0xf30,0xfe,0xf65,0xd01)+'to'));let _0x22c5b0=await _0xe32a72[_0x313705(0x1804,0x1e92,0x2220,0x19ee)+'a'](q),_0x1df437=_0x313705(0xabc,0xd4,0xafa,0x5c4)+_0x22c5b0['data'][0x14e+-0xc*0x32d+0x542*0x7][_0x313705(0x1b3f,0x15b1,0x18e9,0x23f0)]+'*\x0a';_0x1df437+=_0x313705(0x1d43,0x16f9,0x20d3,0x1eaf)+'\x20'+_0x22c5b0[_0x313705(0x117d,0x5f8,0x1c08,0xd84)][0x209+-0x188a+0x1681]['status']+'*\x0a',_0x1df437+=_0x23937d(0x755,0x4af,-0x34f,0xaa5)+_0x23937d(0x9f6,0xa40,0xabc,0x1060)+_0x22c5b0[_0x313705(0x117d,0x166c,0x1140,0x400)][-0x20a1*0x1+0x1277+-0x103*-0xe][_0x313705(0x1de6,0x2881,0x1ad0,0x2b28)]+'*\x0a',_0x1df437+='🎗\x20*Total\x20C'+'hapters:\x20'+_0x22c5b0[_0x313705(0x117d,0x19b8,0x12a4,0x1171)][-0xb*0x3b+-0x223+0x4ac]['chapters']+'*\x0a',_0x1df437+=_0x23937d(0x1a93,0x16af,0xfff,0x2954)+'*\x0a';for(let _0x18809c=-0x1*0x1f58+0x1361+0xbf7;_0x4b485e['DSEWr'](_0x18809c,_0x22c5b0[_0x313705(0x117d,0x4f3,0x1b40,0x1de1)][-0x1*0xc61+-0x8b5*0x3+-0x20*-0x134]['genres']['length']);_0x18809c++){_0x1df437+='\x09\x09\x09\x09\x09\x09\x09\x09*'+_0x22c5b0[_0x313705(0x117d,0x17c4,0x19d3,0xa21)][0x145*-0x3+0x1202*0x2+-0x2035][_0x313705(0x1108,0x16f2,0x1a94,0x7b0)][_0x18809c][_0x23937d(0x1451,0x1313,0x1aea,0x1548)]+'*\x0a';}_0x1df437+=_0x23937d(0x75d,0xbf0,-0x2a2,0x1ca)+'ed\x20on:\x20'+_0x22c5b0['data'][0xa2+0xf1c+0x3e*-0x41][_0x313705(0x6da,0x756,0xcf6,0x1169)]['from']+'*\x0a',_0x1df437+=_0x23937d(0x688,0x13ea,0x12ce,0x10ef)+_0x22c5b0['data'][-0x95c+0x2*0xba1+-0x6*0x251]['scored']+'*\x0a',_0x1df437+=_0x23937d(0x1611,0x142c,0xe7e,0xff4)+_0x23937d(0x125f,0x1e1e,0xc70,0x68e)+_0x22c5b0[_0x313705(0x117d,0x3cb,0x16c3,0xa04)][-0x1db0+-0x22d2+0x4082][_0x313705(0x1486,0x10f6,0x1e2b,0xcf7)]+'*\x0a',_0x1df437+=_0x23937d(0x176b,0xae2,0x25ca,0xf29)+_0x23937d(0x1a0d,0xd34,0x1fcd,0x14cf)+_0x22c5b0[_0x23937d(0xe17,-0x1,0xabe,0x1493)][-0x3*-0x17b+-0xb*-0x2c8+-0x2309][_0x313705(0xb70,0x34e,0x1126,0xd3e)]+'*\x0a',_0x1df437+=_0x313705(0x7a8,-0x264,0xb39,0x805)+':*\x0a';for(let _0x127a0d=-0x232e+0xf29+0x1405;_0x4b485e['SlJpy'](_0x127a0d,_0x22c5b0[_0x313705(0x117d,0x1921,0x1938,0x1223)][0x1d23*0x1+-0x548+-0x17db][_0x313705(0xd71,0x108c,0x193,0xc3f)][_0x313705(0x744,0x388,0x9df,0x18)]);_0x127a0d++){_0x1df437+=_0x23937d(0x808,0x3d5,0x3ce,0x1669)+_0x22c5b0['data'][-0x15f4+0x1*0x18c7+0x1*-0x2d3][_0x313705(0xd71,0x586,0x1107,0x1638)][_0x127a0d][_0x313705(0x17b7,0x1324,0x8d2,0x11dd)]+'*\x20*('+_0x22c5b0[_0x23937d(0xe17,0x1b58,-0xb3,0xf56)][0x1c06+-0x1*0xc2d+-0xfd9*0x1]['authors'][0x1b9b+-0x1*0x21b+-0x1980][_0x23937d(0x738,0x1361,-0x378,0x2d4)]+_0x23937d(0x14d8,0x928,0x1710,0xb5d);}_0x1df437+=_0x313705(0x61b,0xd2b,0xcf6,-0xd3)+_0x22c5b0[_0x313705(0x117d,0xa02,0x4dc,0x1447)][0xd5+0xeac+-0xf81]['url']+_0x23937d(0x1115,0x18d3,0x1ac6,0xecf);if(_0x4b485e['WkTOC'](_0x22c5b0[_0x313705(0x117d,0xd32,0x144a,0x19d3)][0x94f*-0x1+-0x1ba4+0x24f3][_0x313705(0x1fff,0x174e,0x2af7,0x1574)],null))_0x1df437+='🎆\x20*Backgro'+_0x23937d(0xb83,0xa52,0xf18,0x1528)+_0x22c5b0[_0x23937d(0xe17,0x1b10,0x151e,0x16ef)][0x1f77+0x2*0x120e+-0x4393][_0x313705(0x1fff,0x1623,0x239f,0x143e)];_0x1df437+='❄️\x20*Descrip'+_0x313705(0x17a8,0x23dd,0x1958,0x1a74)+_0x22c5b0[_0x23937d(0xe17,0x1790,0x177,0xa4a)][-0x12e6+0xf7*0x7+0xc25][_0x23937d(0xfe7,0x8e0,0x10c9,0x172a)][_0x313705(0x1bd8,0x2307,0x1805,0x22f9)](/\[Written by MAL Rewrite]/g,'');const _0x222034={};_0x222034[_0x313705(0xddf,0xcfe,0x6fa,0x1c8c)]=_0x22c5b0[_0x313705(0x117d,0x5a4,0xbfa,0x198c)][0x21f6+0xfe5+-0x1*0x31db][_0x313705(0x15fc,0xa20,0x2073,0xf5d)]['jpg']['large_imag'+_0x23937d(0x12ba,0x1e0a,0x1bc6,0x142b)];const _0x404709={};_0x404709[_0x313705(0x1fa9,0x24be,0x14bf,0x1c58)]=_0x222034,_0x404709['caption']=_0x1df437,_0x175756['sendMessag'+'e'](_0x5cd288[_0x23937d(0x118c,0x1287,0xf4f,0xe18)],_0x404709,{'quoted':_0x5cd288});break;break;case _0x313705(0xebf,0x23b,0x9df,0x49):{if(_0x1bac1f)return _0x4b485e[_0x313705(0x1ab3,0x2698,0x2013,0x2449)](_0x1db05d,mess[_0x313705(0x982,0x331,0x5cf,0x17bf)]);if(_0x1e03f5)return _0x1db05d(mess[_0x23937d(0x5c0,-0x416,0xa62,0xbac)]);if(!_0x494254)return _0x1db05d(_0x313705(0x933,0x165b,0x10c,-0x2f7)+'e\x20'+_0xe1d953+(_0x313705(0x8ab,0x102b,-0x4c6,-0x3e3)+_0x313705(0x202d,0x29e3,0x1e18,0x2b7a)));_0x1db05d(mess[_0x23937d(0x8ac,0x961,0xebc,-0xf)]);const {lyrics:_0x14b5d0,lyricsv2:_0x348683}=require(_0x23937d(0x130d,0xbbf,0xee0,0x1804)+'m/scraper'),_0x41e926=await _0x4b485e[_0x23937d(0x5f4,0x641,0xd99,0xb4b)](_0x348683,_0x494254)[_0x23937d(0x934,-0x48b,0x7cb,-0x2b9)](async _0x5def56=>await _0x14b5d0(_0x494254));_0x4b485e[_0x313705(0x1f14,0x178c,0x1559,0x2b4c)](_0x1db05d,('\x0a'+dragonemoji+'\x20Title\x20:\x20*'+_0x41e926[_0x313705(0x1b3f,0x1e20,0x12e0,0x248b)]+'*\x0a'+dragonemoji+_0x23937d(0xafd,0xc03,-0x3d1,0x1939)+_0x41e926[_0x313705(0xa17,-0x235,0xd5c,0x15b8)]+'\x0a'+dragonemoji+_0x23937d(0xb32,0x71a,-0x29f,0x90c)+_0x41e926['lyrics']+'\x0a'+dragonemoji+'\x20Url\x20:\x20'+_0x41e926['link']+'\x0a')[_0x23937d(0x1c07,0x11a0,0x1bc0,0x1523)]());}break;case _0x4b485e['cHUKm']:if(_0x1bac1f)return _0x4b485e[_0x313705(0x1908,0x162f,0x1e5b,0x1376)](_0x1db05d,mess[_0x313705(0x982,0x177,0x139d,0x1707)]);if(_0x1e03f5)return _0x4b485e[_0x313705(0xd7a,-0x103,0x59a,0xeba)](_0x1db05d,mess[_0x23937d(0x5c0,-0x4f0,-0xf0,0x114d)]);const _0x52c95d=await Gempa();var {Waktu:_0x53c01b,Lintang:_0x2081c2,Bujur:_0x313942,Magnitude:_0x337d53,Kedalaman:_0x546e9f,Wilayah:_0x7f8e78,Map:_0x5617e5}=_0x52c95d[_0x23937d(0x18fd,0x11d9,0x16a8,0xe59)];console[_0x313705(0xf2c,0x12a8,0x9fd,0x166)](_0x5617e5);const _0xb34cce=_0x313705(0xc71,0x11f8,0x82d,0xfff)+_0x53c01b+(_0x313705(0x818,0x46f,-0x5da,0x737)+':\x20')+_0x2081c2+('\x0aLongitude'+_0x23937d(0x2f0,-0x40e,-0x5f3,0x1191))+_0x313942+_0x313705(0x762,0xe34,0xd1a,0xba6)+_0x7f8e78,_0x59b8ff={};_0x59b8ff[_0x313705(0xddf,0xb65,0x78a,0x1936)]=_0x5617e5;const _0x392c48={};_0x392c48[_0x23937d(0x1c43,0x1a99,0x1fd0,0x2b5f)]=_0x59b8ff,_0x392c48['caption']=_0xb34cce,_0x175756[_0x313705(0xcaa,0x1f4,0x1d,0x18e8)+'e'](_0x423161,_0x392c48);break;case _0x23937d(0x142,-0x624,0x658,-0x7e3):case _0x4b485e[_0x23937d(0x1c1b,0x1c7d,0x195a,0x1a1f)]:if(_0x1bac1f)return _0x4b485e['KErfs'](_0x1db05d,mess[_0x23937d(0x61c,-0x851,0xd5b,0xbd8)]);if(_0x1e03f5)return _0x4b485e['ufixD'](_0x1db05d,mess[_0x313705(0x926,0xaa0,0xc4d,0x1475)]);const _0x23b917=await _0x4b485e['RwrAK'](covid);var {kasus:_0x209c7c,kematian:_0x3fe56b,sembuh:_0x45e9f8}=_0x23b917[0x5*0x53+0x1918+-0x1*0x1ab7];const _0x3f5303={};_0x3f5303[_0x23937d(0x1d39,0x1cdd,0x1fca,0xef2)]=_0x23937d(0x1327,0x1500,0x70c,0x1cee)+_0x209c7c+_0x313705(0x4db,0x8d8,0xdc1,-0x687)+_0x3fe56b+(_0x23937d(0x1b5b,0x2018,0x10d2,0x2044)+'\x20')+_0x45e9f8,_0x175756[_0x23937d(0x944,0x3c6,0x73d,0x958)+'e'](_0x423161,_0x3f5303,_0x5cd288);break;case _0x4b485e[_0x23937d(0x13ea,0x2281,0xea2,0x86c)]:if(_0x1bac1f)return _0x1db05d(mess[_0x23937d(0x61c,0x522,-0x64c,0x3f7)]);if(_0x1e03f5)return _0x1db05d(mess[_0x23937d(0x5c0,0x731,-0x7f5,-0x22c)]);if(!q)return _0x1db05d(_0x4b485e['qCuaw']);_0x1db05d(await _0x4b485e[_0x23937d(0x121a,0x129c,0x1670,0x1136)](jadwaltv,q));break;case _0x313705(0xbb7,0x5c9,0xbbb,0x903):case _0x4b485e[_0x313705(0x913,0xf5,0xf37,0xa93)]:if(_0x1bac1f)return _0x4b485e[_0x313705(0x1616,0x180e,0xb45,0x1592)](_0x1db05d,mess[_0x23937d(0x61c,0x316,0xbe0,0x862)]);if(_0x1e03f5)return _0x1db05d(mess['banChat']);if(!q)return _0x4b485e['wCvdJ'](_0x1db05d,_0x4b485e[_0x313705(0x15fb,0xdc6,0x1d83,0x2153)]);let _0x44d1d8=await hx[_0x313705(0xbb7,0xe2c,-0xd6,0xb95)](q),_0x56d376=_0x4b485e[_0x23937d(0x1864,0x232d,0xcad,0x1015)];for(let _0x28ac63 of _0x44d1d8){_0x4b485e[_0x23937d(0xbc2,-0x229,0xf4a,0x4de)](_0x4b485e[_0x313705(0x3e8,0x11b5,0xba3,0x948)],_0x4b485e[_0x313705(0xad2,0x3a5,0x11e4,0x135d)])?_0x4b485e[_0x23937d(0x1d97,0x1788,0x1a48,0x2078)](_0x50a6cf,_0x15cc00[_0x313705(0x9a1,0xf41,-0x2c2,-0x2cd)]):_0x56d376+=_0x23937d(0x1de7,0x1dc4,0x1c28,0x11bc)+_0x23937d(0xccb,0xb8e,0x1850,0x3aa)+_0x313705(0x2041,0x2d46,0x2515,0x1ea5)+':\x20'+_0x28ac63['name']+(_0x313705(0x1de4,0x1a91,0x2adf,0x1765)+':\x20')+_0x28ac63[_0x23937d(0x1af8,0x2109,0x2767,0x2762)]+(_0x23937d(0xdba,0x6a,0x1928,0x110c)+':\x20')+_0x28ac63[_0x23937d(0x380,-0x699,0xb6a,-0x935)]+('\x0a-\x20*Dev\x20Li'+_0x23937d(0xa23,0x2aa,0x69f,0xb8b))+_0x28ac63[_0x23937d(0x1ea,0xe2e,-0xa1e,0xb02)]+('\x0a❉────────'+_0x313705(0x1cbb,0x2b33,0xd9e,0x1c3b)+_0x313705(0x14c9,0x901,0x762,0x1eca));}_0x4b485e[_0x313705(0x2066,0x2e79,0x2cf3,0x2ce1)](_0x1db05d,_0x56d376);break;case _0x4b485e[_0x23937d(0x22a,0xbd4,0x57d,0x978)]:if(_0x1bac1f)return _0x4b485e[_0x23937d(0xef5,0x352,0x2e7,0x1d37)](_0x1db05d,mess[_0x313705(0x982,0x1347,0x78,0xf22)]);if(_0x1e03f5)return _0x1db05d(mess['banChat']);_0x1db05d(mess[_0x23937d(0x8ac,0xa5e,-0x4c3,-0x362)]);if(!q)return _0x4b485e[_0x23937d(0x1bbd,0x1c27,0x1a15,0x252f)](_0x1db05d,_0x313705(0x163c,0xb6b,0x23d8,0x11d4)+_0x313705(0x1fb9,0x2b94,0x15b6,0x26ab)+_0x313705(0xef4,0xc4e,0x794,0x4c6)+_0x23937d(0x1c2a,0x2217,0x2355,0x1151)+_0xe1d953+(_0x313705(0x1beb,0x130f,0x14d8,0xfd3)+_0x313705(0x58d,0x1432,-0x85,0xa17)));xeonkey[_0x313705(0x12b2,0x735,0x6cf,0x82c)](q)[_0x313705(0x1ec7,0x29f1,0x1276,0x10f7)](_0x977a72=>{function _0x29c17f(_0x500224,_0x246b02,_0x1e9e4b,_0x57282a){return _0x313705(_0x57282a- -0x3c3,_0x246b02,_0x1e9e4b-0xec,_0x57282a-0x1c0);}function _0x3a090c(_0x57b3c3,_0x3115ad,_0x1c40b4,_0x564f99){return _0x23937d(_0x3115ad- -0x86,_0x57b3c3,_0x1c40b4-0x1a4,_0x564f99-0x146);}if(_0x4b485e[_0x29c17f(0x695,-0xb21,0x120a,0x351)]('VpCra',_0x4b485e[_0x3a090c(0x51d,0x149,-0x7ef,-0xbda)])){const _0x27df2b={};_0x27df2b[_0x29c17f(0x15d8,0x17e5,0xfe8,0x1cdc)]=''+_0x36c1d2[_0x29c17f(0x1220,-0x1f8,0x133b,0xbe9)];const _0x3cd63b={};_0x3cd63b[_0x3a090c(0x233,0x556,0xa7e,0x105)]=_0x559c0c,_0x4c104b[_0x3a090c(-0x5ed,0x8be,0x1407,0x795)+'e'](_0xea886c[_0x29c17f(0xbf8,0x73c,0x1c99,0x112f)],_0x27df2b,_0x3cd63b),_0x1c6870=_0x57a36e[_0x29c17f(0x1615,0x1d9d,0x1a4d,0x1360)+'nc'](_0x3a090c(0xc9c,0xa95,0x3f1,-0x30b)+'AllData/st'+_0x3a090c(0x336,0x1023,0xb25,0x1459)+_0x3a090c(0x5c8,0xdb4,0x19cc,0x817));const _0x351640={};_0x351640[_0x3a090c(0x17c8,0xf74,0x11c2,0x199f)]=_0x37a858,_0x5d8b53['sendMessag'+'e'](_0x55b5ff[_0x29c17f(0x196d,0x142c,0xe06,0x112f)],_0x351640);}else{console[_0x29c17f(0x13fb,0x1bf,0x77f,0xb69)](_0x977a72);let _0x2c4010=_0x29c17f(0xc2d,0xa5d,-0xe4,0xdad)+q+('\x20🧩*\x0a*🌿\x20Aut'+'hor*\x20:\x20')+_0x977a72[0x533*-0x1+0x1d5d+-0x182a][_0x29c17f(0x202,-0x589,0x1143,0x654)]+'\x0a\x0a';for(let _0x5cd58f of _0x977a72){_0x2c4010+=_0x29c17f(0x1535,0x1575,0x1dac,0x1c68)+_0x3a090c(0x10cd,0x18cf,0x1855,0x2450)+_0x29c17f(0x84b,0xe43,-0x53c,-0x5a)+'e\x20:*\x20'+_0x5cd58f['judul']+(_0x3a090c(0x116a,0x1aaf,0x1842,0x2216)+_0x3a090c(0x12aa,0x18cd,0xfbb,0x23a0))+_0x5cd58f[_0x29c17f(0x7f1,-0x55c,0x11da,0x723)]+('\x0a\x20*🖥️\x20Type\x20'+':\x20')+_0x5cd58f[_0x3a090c(0x420,0x6b2,0x8d4,0x2c)]+(_0x3a090c(0x1a79,0x1c89,0xdc8,0x2082)+_0x3a090c(0xa87,0xbc7,0x157,0x1136))+_0x5cd58f[_0x3a090c(0x2209,0x1c8f,0x1992,0x22ea)]+('\x0a\x20*🌍\x20Sourc'+_0x3a090c(0x1d17,0xed9,0x75a,0x8fd))+_0x5cd58f['link'];}const _0x1659ab={};_0x1659ab[_0x3a090c(0xc82,0x9f3,0x68b,0x672)]=_0x977a72[-0x1*0x190c+-0xa93+0x239f]['thumb'];const _0x33d8e2={};_0x33d8e2[_0x29c17f(0x25e8,0x243f,0x2400,0x1be6)]=_0x1659ab,_0x33d8e2[_0x29c17f(0x1701,0x674,0x1825,0x90b)]=_0x2c4010;const _0x22f984={};_0x22f984[_0x29c17f(0x7ad,0x526,0x106d,0x57f)]=_0x340a54,_0x175756['sendMessag'+'e'](_0x423161,_0x33d8e2,_0x22f984);}});break;case _0x4b485e['ktnxO']:case _0x4b485e[_0x23937d(0x8d4,0x749,0x4fa,0x8f7)]:{if(_0x4b485e['yKchY'](_0x4b485e[_0x23937d(0x161a,0x23e5,0x1d44,0x125a)],_0x23937d(0x17d4,0x2067,0x189d,0x10ca))){_0x2f944c=[],_0x5af8e4=[],_0x44c33e=_0x23937d(0x1a3d,0x14e9,0x208f,0x178b)+_0x313705(0x110e,0x190b,0x4db,0x1556)+_0x23937d(0x1115,0xb7a,0x85c,0x707)+_0x29b0a2[_0x313705(0x1127,0x19c3,0x1d22,0x1b17)+'i']+('\x20Username\x20'+':\x20')+(_0x8bd20c[_0x23937d(0x421,-0x3f,0x315,0x764)][_0x23937d(0x15fd,0x150b,0x1e3e,0x139b)]?_0x5f4416[_0x313705(0x787,-0x6df,0x197,0x1297)][_0x313705(0x17b7,0x1cf5,0x1b6b,0x1d77)]:_0x4b485e[_0x313705(0x8f0,0xbff,0x81c,0x137)])+'\x0a'+_0x17d54e[_0x23937d(0xdc1,0x157,0x1284,0x47c)+'i']+(_0x23937d(0x13ed,0xf7b,0x681,0x8fd)+'\x20:\x20')+_0x105084['user'][_0x23937d(0x17dc,0x180e,0xd5a,0xa0e)],_0x34cbea=-0xbde+-0x953*0x1+0x1532;for(let _0x481e0e=0x5*-0x51+0x1f92+-0x9*0x355;_0x4b485e[_0x313705(0x13dc,0x224f,0x1fbf,0xeba)](_0x481e0e,_0x7b1761['medias']['length']);_0x481e0e++){const _0x26013b={};_0x26013b[_0x23937d(0x738,0x229,0x1c8,0xb18)]=_0x544504[_0x23937d(0x377,0xc2b,0x454,-0x285)][_0x481e0e]['fileType'],_0x26013b[_0x23937d(0xa79,0x1052,0x77c,0xc91)]=_0x1abe73[_0x313705(0x6dd,0x1475,0x1439,0xd8a)][_0x481e0e][_0x23937d(0xa79,0x1979,0x17b,-0x3e)],_0x3ecc0e[_0x313705(0x1122,0xf13,0x1d51,0x8ff)](_0x26013b);}_0x53b340=-0x70c*0x2+0x1813*0x1+-0x9fa;for(let _0x5ecaaa of _0x2265d1){const _0x189313={};_0x189313[_0x23937d(0x13f4,0x5be,0x15c6,0x1e3e)+'t']=_0x23937d(0x175b,0x1d73,0x15da,0xd99)+_0x2d7853++;const _0x42581e={};_0x42581e[_0x23937d(0x1b0c,0x2233,0x1863,0xc41)]=_0x23937d(0x1205,0x1426,0x1970,0x1f10)+_0x5ecaaa[_0x313705(0xa9e,0x6b0,0xd8f,-0x131)]+'\x20'+_0x5ecaaa['url'],_0x42581e['buttonText']=_0x189313,_0x42581e[_0x313705(0xa9e,0xf96,0xbf1,0x10a2)]=0x1,_0x4f9332[_0x23937d(0xdbc,0xd83,0x125d,0xc4c)](_0x42581e);}_0x5a6583+=_0x23937d(0x388,0xc29,0x669,-0x7c5)+_0x23937d(0x19d,-0x3f5,-0x2b6,0xa20)+_0x313705(0x1bcc,0xeed,0x1678,0x13bb)+_0x23937d(0x8d7,0x111a,0x63d,0xc4a);let _0x13be54=_0x36b5f2;const _0x2b5d04={};_0x2b5d04[_0x313705(0x1fa9,0x1d51,0x2dac,0x1938)]=_0x341c46,_0x2b5d04[_0x313705(0x820,0x10b6,0x145b,-0x5ab)+_0x23937d(0xd11,0x1a51,0x18bb,0x572)]=_0x26c203,_0x2b5d04[_0x23937d(0x968,-0x23,0x1564,0x9bb)]=_0x526217,_0x2b5d04[_0x23937d(0x106e,0x1406,0xb40,0x1247)]=''+_0x4e683d[_0x23937d(0x96c,0xb8a,0x146a,0x14f8)],_0x2b5d04[_0x313705(0xfa0,0x1004,0x5de,0x1792)]=_0x13be54,_0x2b5d04[_0x313705(0x1e7f,0x24dc,0x20c2,0x1f56)]=0x4;let _0x5c6535=_0x2b5d04;const _0x5eff86={};_0x5eff86[_0x23937d(0x5dc,0xf00,0x14d,0x12fc)]=_0x16e0f7,_0x337882['sendMessag'+'e'](_0x419132,_0x5c6535,_0x5eff86);}else{if(_0x1bac1f)return _0x1db05d(mess[_0x23937d(0x61c,-0x52c,0xf44,0x14f0)]);if(_0x1e03f5)return _0x1db05d(mess['banChat']);if(!_0x1ba32f[_0x313705(0x1f7c,0x1f70,0x2624,0x1c3f)]('\x20'))return _0x516d85(_0x313705(0x110b,0x3b6,0x10c5,0xc0d)+'\x0a'+_0x4b485e['pRPyV'](_0xe1d953,_0x1354e9)+(_0x23937d(0xeea,0x3b7,0x383,0x16d5)+_0x23937d(0x1043,0xc53,0x114b,0xfea))+_0x4b485e[_0x23937d(0x481,0x8ee,0x7d1,-0x782)](_0xe1d953,_0x1354e9)+(_0x313705(0x18b3,0x1a5e,0x1626,0xff8)+_0x313705(0x1263,0x67a,0x188a,0x18ed)));const _0x217f81=_0x4b485e[_0x23937d(0xd0d,0x444,0x4c7,0x6c8)](require,_0x313705(0x628,0x758,0x1e3,-0x5b4)+_0x313705(0x20e2,0x281a,0x1dff,0x2b75)),_0x51b485=_0x1ba32f['join']('\x20'),_0x11a483=_0x51b485[_0x23937d(0xccf,0x90b,0x16d3,0x199c)]('|')[-0x5e*-0xb+0xadf+-0xee9*0x1],_0x126c63=_0x51b485[_0x313705(0x1035,0x1405,0xe52,0x1bdd)]('|')[-0x1857+0xd07*0x2+-0x1b6];if(!_0x11a483)return _0x4b485e['IWPzN'](_0x516d85,_0x23937d(0xfc5,0xfa,0xaff,0x124e)+_0x313705(0xc73,0x7dd,0x1815,-0x7a));if(!_0x126c63)return _0x4b485e[_0x23937d(0x18c5,0x2437,0x204f,0x1545)](_0x516d85,_0x23937d(0xcf5,-0x3c,0xd2f,0x1751)+_0x313705(0x1c52,0x1d71,0x1e9d,0x1888));const _0x50b9ff={};_0x50b9ff[_0x313705(0x15d2,0x1b17,0x907,0x2408)]=_0x11a483,_0x50b9ff[_0x23937d(0x557,0x1149,0x949,0x10fb)]=_0x126c63,_0x50b9ff['timeout']=0x1d4c;const _0x42ec01=new _0x217f81(_0x50b9ff);_0x42ec01[_0x313705(0x215f,0x2614,0x1aff,0x28cf)]()['then'](_0x192564=>{function _0x220218(_0x4fc1cc,_0x2682db,_0x171a85,_0x676e0f){return _0x313705(_0x2682db- -0x1e7,_0x171a85,_0x171a85-0x173,_0x676e0f-0x4);}return _0x4b485e['YQfAP'](_0x516d85,jsonformat(_0x192564)),_0x42ec01[_0x220218(0x45a,0xe2f,0x4c2,0x1adf)]();})['then'](_0x23b7b7=>{function _0x4a98fd(_0x12776c,_0x5b0cb2,_0x187e54,_0x37f9f2){return _0x23937d(_0x37f9f2- -0x1e7,_0x5b0cb2,_0x187e54-0xc6,_0x37f9f2-0x11);}function _0x596971(_0x4a9ab7,_0x52c7b5,_0x33d6c8,_0x43a09f){return _0x313705(_0x43a09f- -0x32,_0x4a9ab7,_0x33d6c8-0xa2,_0x43a09f-0x47);}if(_0x4b485e[_0x4a98fd(0x12c2,-0x6e7,0xc0d,0x4c3)](_0x4b485e['VbbUc'],_0x4b485e['aWhcO']))_0x4b485e[_0x596971(0x4d9,-0x1cc,-0x764,0x423)](_0x516d85,_0x4b485e[_0x4a98fd(0x20d4,0xf69,0x117d,0x19a5)](jsonformat,_0x23b7b7)),_0x42ec01[_0x4a98fd(0x11ee,0x41e,0xc2a,0x9e7)]();else{const _0x2851c1={};_0x2851c1[_0x596971(0x18d0,0x2517,0x137d,0x206d)]=''+_0x156536[_0x4a98fd(0xc9d,-0xa06,-0x90d,-0xa4)];const _0x27c104={};_0x27c104[_0x4a98fd(0x193,-0xb2b,-0xa0c,0x3f5)]=_0x5a7247,_0x10e85f['sendMessag'+'e'](_0x2b6b24[_0x4a98fd(0x1a00,0x9dd,0x14ec,0xfa5)],_0x2851c1,_0x27c104);}});}}break;case _0x4b485e[_0x313705(0xdfa,0x1936,0x897,0x121c)]:{if(_0x1bac1f)return _0x4b485e[_0x23937d(0xe79,0x1894,0x1073,0xeec)](_0x1db05d,mess[_0x23937d(0x61c,0x9a3,0x142a,-0x3bc)]);if(_0x1e03f5)return _0x4b485e[_0x313705(0x1026,0xfc6,0x176d,0x6f3)](_0x1db05d,mess[_0x313705(0x926,0xa6b,0x992,0x1719)]);if(!_0x1ba32f['join']('\x20'))return _0x4b485e[_0x313705(0x20fa,0x20f5,0x18bc,0x1c09)](_0x516d85,_0x313705(0x110b,0xb14,0x2e9,0x1ca4)+(_0xe1d953+_0x1354e9)+_0x313705(0xdf2,0xcee,0x18a4,0x8d2));xeontod[_0x23937d(0x75f,0x5f4,0x1163,0xb50)](_0x1ba32f['join']('\x20'))[_0x23937d(0x1b61,0x27f3,0x2136,0x217e)](async _0x36da03=>{teks=_0x42a628(0x16df,0x223f,0x1463,0x152c)+_0x42a628(0xb40,-0x65,0x1b5c,0xda7);for(let _0x1cd746 of _0x36da03){teks+=_0x51f57a(0x10ed,0x1a4f,0x185c,0x10d5)+_0x1cd746['name']+(_0x42a628(0xaf6,0x9b4,0x152a,0x8a7)+':\x20')+_0x1cd746[_0x51f57a(0x1e61,0xb2e,0xba9,0x1589)]+_0x51f57a(0x11c5,-0x91d,0xce4,0x580)+_0x1cd746['date']+'\x0aDesc\x20:\x20'+_0x1cd746['desc']+'\x0aLink\x20:\x20'+_0x1cd746[_0x42a628(0x2605,0x2a53,0x1b6b,0x1fed)];}const _0xa76f37={};_0xa76f37[_0x42a628(0x27d5,0x2471,0x219f,0x18e9)+'t']=_0x4b485e[_0x51f57a(0x910,-0x1f4,0xb59,0x75e)];const _0xde9faa={};_0xde9faa[_0x51f57a(0x25fe,0x2542,0x1f62,0x1e97)]=_0x42a628(0x1f89,0x10be,0x22f3,0x1f05);function _0x51f57a(_0x22bbba,_0x3d938e,_0xebee83,_0xd5e1a6){return _0x313705(_0xd5e1a6-0x25,_0x22bbba,_0xebee83-0x7c,_0xd5e1a6-0x1b9);}_0xde9faa[_0x42a628(0xb82,0x2090,0x2639,0x1a91)]=_0xa76f37,_0xde9faa['type']=0x1;let _0xc97a3e=[_0xde9faa];const _0x397d01={};_0x397d01['image']=log0,_0x397d01[_0x42a628(0xc73,0x162b,0x1845,0x9af)+_0x42a628(0x2041,0xea9,0x18e9,0x1206)]=thum,_0x397d01[_0x51f57a(0x16cc,0x45,0x147e,0xcf3)]=teks,_0x397d01[_0x42a628(0x2078,0x1a6d,0x19a4,0x1563)]=''+global['botname'],_0x397d01[_0x42a628(0xc53,0x55a,0x1903,0x112f)]=_0xc97a3e,_0x397d01[_0x42a628(0x248c,0x2c0d,0x1632,0x200e)]=0x4;let _0x27529c=_0x397d01;function _0x42a628(_0x4fb551,_0x36aba8,_0x430061,_0xe141a2){return _0x313705(_0xe141a2-0x18f,_0x430061,_0x430061-0x4e,_0xe141a2-0x6b);}_0x175756[_0x42a628(0x17a7,0xedf,0x12f4,0xe39)+'e'](_0x5cd288[_0x42a628(0x845,0x7a6,0x1bc0,0x1681)],_0x27529c,{'quoted':_0x5cd288});});}break;case _0x313705(0x1939,0x254d,0xa2d,0x1768):{if(_0x1bac1f)return _0x4b485e[_0x313705(0x9c0,0x17ad,0x979,0x151b)](_0x1db05d,mess[_0x23937d(0x61c,-0x8f9,0x14a7,0x6b4)]);if(_0x1e03f5)return _0x4b485e[_0x313705(0x1b88,0x1d7b,0x23b8,0x1853)](_0x1db05d,mess[_0x23937d(0x5c0,0x9c2,0xc99,0x30b)]);if(!_0x1ba32f['join']('\x20'))return _0x4b485e['WsGJU'](_0x516d85,'Example\x20:\x20'+_0x4b485e['tsiXp'](_0xe1d953,_0x1354e9)+(_0x23937d(0xee5,0x147c,0x1da9,0xb64)+'gend'));xeontod[_0x23937d(0x15d3,0xbe6,0x1717,0x1ba4)](_0x1ba32f[_0x23937d(0x1c16,0x1313,0x1f82,0x165c)]('\x20'))[_0x23937d(0x1b61,0x100a,0x25e6,0x198f)](async _0x349b03=>{function _0x463ad9(_0x5c54cd,_0x2c9a5c,_0x4d384d,_0x32cd1e){return _0x23937d(_0x2c9a5c-0x1eb,_0x5c54cd,_0x4d384d-0x117,_0x32cd1e-0x190);}const _0x332681={'IYnjg':function(_0x1ec1cb,_0x738b7f){function _0x2c4c48(_0x461743,_0x30153f,_0x50d299,_0x4a9e5b){return _0x2506(_0x50d299- -0x11,_0x461743);}return _0x4b485e[_0x2c4c48(-0x5f8,-0x12c,0x91d,0xf94)](_0x1ec1cb,_0x738b7f);},'QXHXJ':_0x4b485e['uoMHa'],'FfwgI':function(_0x23afff,_0x3af156){function _0x136d84(_0x48e68c,_0x170c48,_0x5bb02c,_0x24441c){return _0x2506(_0x5bb02c- -0x2de,_0x170c48);}return _0x4b485e[_0x136d84(0x6d7,0xeac,0x4c6,0x2db)](_0x23afff,_0x3af156);}};teks=_0x463ad9(0x1190,0x8a4,0x5f9,-0xd)+_0xa547a5(0x899,0x740,0x4da,-0x339)+_0x463ad9(0x1cf3,0x15c0,0x1a8c,0x1be6);for(let _0x5892e7 of _0x349b03){if(_0x4b485e[_0x463ad9(0xe06,0x196b,0x1ee0,0x21f6)](_0x4b485e['LiYda'],_0x4b485e[_0x463ad9(0x138f,0x1936,0x210b,0x1b3a)]))teks+='\x0a\x0a'+_0x5892e7[_0x463ad9(0xe89,0x163c,0xf7d,0xc0a)]+'\x0a',teks+=''+_0x5892e7[_0xa547a5(0x11fc,0x191b,0x10c0,0x19b7)];else{if(_0x2e7bd0){_0x5dff5b[_0x463ad9(0x2313,0x1406,0xeee,0x1a4f)]=_0x2cf1f3;const _0x28d16f={};_0x28d16f[_0x463ad9(0xbf1,0x7c7,-0x12e,0x6ef)]=_0x2d1a3c,_0x146268['sendMessag'+'e'](_0x2c3f17['chat'],{'image':{'url':_0x332681[_0x463ad9(0x387,0x4d5,0xda6,-0x7a3)](_0x3c1988,_0x463ad9(-0x17,0xc88,0x10e4,0x42b))},'caption':_0x332681['QXHXJ']},_0x28d16f);}else return _0x332681[_0xa547a5(0x866,0x1411,0x64f,0x11df)](_0x5921e8,''+_0xe7af3c[_0x463ad9(0x870,0xe6f,0x10be,0x2b7)]);}}const _0x4cd296={};function _0xa547a5(_0x425113,_0x537b7b,_0x4b539f,_0x3c2ce4){return _0x313705(_0x537b7b- -0x543,_0x4b539f,_0x4b539f-0x1c7,_0x3c2ce4-0x78);}_0x4cd296[_0xa547a5(0x1971,0x1217,0x50d,0x1d6a)+'t']=_0x4b485e['MgfnN'];const _0x11b72={};_0x11b72['buttonId']=_0xa547a5(0x20b6,0x1833,0x2418,0x103a),_0x11b72[_0xa547a5(0x1ce3,0x13bf,0x2157,0x1874)]=_0x4cd296,_0x11b72[_0x463ad9(0xb69,0x923,0xc7b,0x15f5)]=0x1;let _0x3491ab=[_0x11b72];const _0x433676={};_0x433676['url']=_0x349b03[0xe06*0x1+-0x48d*-0x3+-0x1bad]['icon'];const _0x54876b={};_0x54876b[_0xa547a5(0x1e9d,0x1a66,0x1da5,0x21a1)]=_0x433676,_0x54876b[_0xa547a5(0x6cd,0x2dd,0x4a3,-0x820)+_0xa547a5(0x220,0xb34,-0x180,0x75d)]=thum,_0x54876b[_0x463ad9(0x808,0xb53,0x8fc,0x17e6)]=teks,_0x54876b[_0x463ad9(0x1bff,0x1259,0x123b,0x1b9d)]=''+global[_0x463ad9(-0xe8,0xb57,0x163a,0x17a4)],_0x54876b[_0x463ad9(0x126d,0xe25,0x1430,0xad1)]=_0x3491ab,_0x54876b[_0x463ad9(0x1ae6,0x1d04,0x1417,0x1de6)]=0x4;let _0x4d111b=_0x54876b;_0x175756[_0x463ad9(0xf4,0xb2f,0x566,0x466)+'e'](_0x5cd288[_0xa547a5(0xedc,0xfaf,0x1433,0x1172)],_0x4d111b,{'quoted':_0x5cd288});});}break;case _0x313705(0x1172,0x195c,0x1516,0x11bc):{if(_0x4b485e['OBYVW']===_0x4b485e[_0x23937d(0x1d64,0x1118,0x126e,0x15d6)]){if(_0x1bac1f)return _0x1db05d(mess[_0x23937d(0x61c,0x746,0x200,-0x12f)]);if(_0x1e03f5)return _0x1db05d(mess[_0x23937d(0x5c0,0xa99,0x1244,-0x168)]);if(_0x4b485e[_0x23937d(0xf7f,0x670,0x15b7,0x86)](_0x1ba32f[_0x23937d(0x3de,0x642,-0xa36,0x62c)],-0x1*-0x1139+-0x1be4+0xaac))return _0x4b485e[_0x23937d(0x1300,0x5bf,0x1646,0x1df1)](_0x516d85,_0x23937d(0xaff,-0x4,0x2a5,0xa4)+_0xe1d953+('searchgc\x20C'+_0x23937d(0x15a7,0x1bb3,0x1809,0xa06)+'or'));nae=_0x1ba32f['join']('\x20'),hx[_0x313705(0x19a7,0x2366,0x2253,0x1318)](nae)[_0x313705(0x1ec7,0x1492,0x2daf,0x209c)](_0x391a3f=>{function _0x3d254f(_0x4baccf,_0x954649,_0x1754d4,_0x7cc389){return _0x23937d(_0x4baccf-0x4a3,_0x1754d4,_0x1754d4-0xe7,_0x7cc389-0x140);}function _0x216f7e(_0x37dc1f,_0x2ae04a,_0x4a850f,_0x2d49a7){return _0x23937d(_0x37dc1f-0x54f,_0x2d49a7,_0x4a850f-0x18a,_0x2d49a7-0x189);}if(_0x4b485e[_0x216f7e(0x1c79,0x1416,0x1ff3,0x10a0)](_0x4b485e['jarZF'],_0x4b485e['hlMxu'])){teks=_0x3d254f(0x95a,0x1558,0x10db,0x82b)+_0x3d254f(0x5ca,0xe21,0x771,0xad8)+'``';for(let _0x371758 of _0x391a3f){teks+=_0x216f7e(0x1c63,0x27ec,0x2079,0x119a)+_0x216f7e(0x1a45,0x15ce,0x1e5c,0x1dfb)+':\x0a',teks+=_0x371758[_0x216f7e(0x2047,0x1816,0x24d4,0x1b78)]+'\x0a',teks+=''+_0x371758['nama'];}const _0xc76783={};_0xc76783[_0x3d254f(0x1897,0xf3a,0x2464,0x11ef)+'t']='Menu🥀';const _0x5225b7={};_0x5225b7['buttonId']=_0x216f7e(0x1f5f,0x17fe,0x29be,0x23ac),_0x5225b7[_0x3d254f(0x1a3f,0x1209,0x1961,0x21a3)]=_0xc76783,_0x5225b7['type']=0x1;let _0x1fc1b3=[_0x5225b7];const _0x320a91={};_0x320a91[_0x3d254f(0x20e6,0x18b7,0x133f,0x1949)]=log0,_0x320a91[_0x216f7e(0xa09,0x1578,0x9a3,0x1c7)+'ail']=thum,_0x320a91[_0x216f7e(0xeb7,0x1b2c,0x34c,0x1cc2)]=teks,_0x320a91[_0x3d254f(0x1511,0x1789,0x2065,0x109b)]=''+global[_0x216f7e(0xebb,0xb7,0x14d0,-0x5c)],_0x320a91['buttons']=_0x1fc1b3,_0x320a91[_0x3d254f(0x1fbc,0x23c4,0x2728,0x1535)]=0x4;let _0x447ced=_0x320a91;_0x175756[_0x3d254f(0xde7,0xddf,0x515,0x1164)+'e'](_0x5cd288['chat'],_0x447ced,{'quoted':_0x5cd288});}else _0x464a8e+=_0x70435f+'\x20@'+_0x104800['id'][_0x216f7e(0x121e,0x1dba,0x16bd,0x15b2)]('@')[0x191*0x7+0x1+-0xaf8]+'\x0a';});}else _0x1d078e[_0x23937d(0xbc6,0xbc5,-0x136,0x309)](_0x2e711a[_0x313705(0x1b14,0x1140,0x16c3,0xe88)](_0x45465d[_0x23937d(0x19e2,0x2463,0x1a42,0x1b92)](_0x4b485e['mDYGK'])),_0x45a45f[_0x313705(0x1b14,0x2744,0x2906,0x1b07)](_0x2c259f['bgGreen'](new _0x29c76b())),_0x4b485e['Ufuey'](_0x4b485e['CzCgs'](_0x2c007f[_0x23937d(0x17ae,0x2088,0x13a5,0x230e)](_0x31ce10[_0x313705(0x988,0xcdc,0x1039,0xb5e)](_0x3211aa||_0x4675b3[_0x23937d(0xda3,0x11f3,0xbe2,0xe66)])),'\x0a'),_0x22e8bb[_0x23937d(0xa08,0x27d,0x3ca,0x12c6)](_0x4b485e['xYiPa'])),_0x1acbe9[_0x23937d(0x1118,0x915,0x11b8,0x598)](_0x5d8651),_0x4b485e['ZYYtz'](_0x4b485e[_0x313705(0xc37,0x434,0x10e8,0x874)](_0x40d3d8['yellow'](_0x583aa1['sender']),'\x0a'),_0x536e45[_0x313705(0x19ae,0x15f0,0xf32,0xf6e)](_0x4b485e[_0x23937d(0x61e,0x353,-0x5c9,0xd6)])),_0x51f203[_0x23937d(0x1118,0xa39,0x933,0x14aa)](_0x32506d[_0x23937d(0x1d23,0x1344,0x1670,0xf55)]?_0x88bf62:_0x4b485e[_0x313705(0xfaf,0x131,0x775,0xcd9)],_0x2ae9fa['chat']));}break;case _0x4b485e[_0x23937d(0x495,-0x569,0x12c,0x10ab)]:{if(_0x4b485e[_0x23937d(0xd22,0x10b3,0x3d5,0xe30)](_0x4b485e['aSEHS'],_0x4b485e[_0x313705(0x1828,0x16a1,0x224e,0x238c)]))_0x5926b4[_0x313705(0x1122,0x887,0x1abf,0x81f)](_0x1320c3['id'][_0x313705(0x1bd8,0x1b98,0x169d,0x1745)](_0x4b485e[_0x23937d(0x13bc,0x2248,0x185f,0x1a18)],_0x4b485e[_0x23937d(0x1562,0xb5c,0x1c6d,0x822)]));else{if(_0x1bac1f)return _0x4b485e[_0x313705(0x118c,0xe9e,0x12f9,0x159f)](_0x1db05d,mess[_0x23937d(0x61c,-0x380,0x27e,0xbde)]);if(_0x1e03f5)return _0x4b485e[_0x23937d(0x1a6c,0x27a3,0x1c02,0x1b33)](_0x1db05d,mess[_0x313705(0x926,0x177f,-0x1ff,0x145a)]);xeontod[_0x313705(0x1bb4,0x2260,0x1b9c,0x1950)]()[_0x23937d(0x1b61,0x144a,0x1e64,0x2a5f)](async _0xaa2392=>{function _0x127cb4(_0x12c878,_0x20ee03,_0x4cfc8f,_0x876d9c){return _0x313705(_0x12c878- -0x26c,_0x4cfc8f,_0x4cfc8f-0x1bc,_0x876d9c-0x1c0);}function _0x35863d(_0xbfd62f,_0x387ea8,_0x30964f,_0x3db08d){return _0x23937d(_0x30964f-0x5c1,_0x3db08d,_0x30964f-0x13b,_0x3db08d-0x16b);}if(_0x4b485e[_0x35863d(0x1b5a,0x1cb3,0x1a78,0x1e9e)](_0x4b485e[_0x127cb4(0x95e,0x872,-0x520,0x124)],_0x4b485e[_0x127cb4(0xf52,0x151d,0xdb5,0x18d4)]))_0x1b219d+=_0x35863d(0x2ec9,0x2e24,0x20ad,0x2d1e)+_0x1af21e['id']+'\x0a',_0x54d2fc+=_0x35863d(0x2b68,0x222b,0x2271,0x26a4)+_0x66357b[_0x127cb4(0x4bb,0xbb2,0x68,0x299)]+'\x0a',_0x15818e+=_0x127cb4(0xa39,-0x1ea,0x12b2,0xb0b)+_0x35863d(-0x2a4,0x148f,0x8b1,-0x2d)+_0x4e60f4[_0x127cb4(0xdb6,0x1ada,0x86e,0xeb1)]+'\x0a',_0x363047+='*🐇Rabbit*\x20'+':\x20'+_0x1ff52e[_0x35863d(0xe76,0xe2f,0xc93,-0x53)]+'\x0a',_0x3c891b+=_0x127cb4(0x178b,0x231a,0xf57,0x1e39)+'\x20'+_0x55b50f[_0x127cb4(0x117b,0x12df,0x2009,0x818)]+'\x0a',_0x4edbe1+=_0x35863d(0x4bd,0x152e,0xa62,0x316)+_0x50ea1f[_0x35863d(0x222d,0x1b53,0x1fb1,0x2cde)]+'\x0a',_0x4d7b4b+='*🐘Elephant'+_0x35863d(0x5fb,0x1baf,0xd9d,0x2ca)+_0x577fd5[_0x127cb4(0x9e7,0x8b3,-0x51f,0x1565)]+'\x0a\x0a';else{let _0x28ca1e=_0x4b485e[_0x35863d(0x22ca,0x2c5f,0x22ad,0x283b)],_0x3e6279=-0xbae*0x1+-0xbb*-0x25+-0xf58;for(let _0x61437d of _0xaa2392){if(_0x4b485e['OXjOV'](_0x4b485e['DjKsE'],_0x4b485e[_0x35863d(0xc7e,0x20f1,0x1b87,0x1acd)])){const _0x4c089d={};_0x4c089d[_0x35863d(0x2c72,0x17f4,0x22fa,0x2892)]='🙄',_0x4c089d[_0x35863d(0x1302,0x64a,0xf10,0x848)]=_0x3d393d[_0x127cb4(0xa49,0xb5b,-0x23f,0x1663)];const _0x268441={};_0x268441[_0x35863d(0x2592,0x1ca1,0x1f7b,0x15e9)]=_0x4c089d,_0x11f4a4[_0x35863d(0xb69,0x16f0,0xf05,0x784)+'e'](_0x17d0b2,_0x268441);const _0x44b434={};_0x44b434['text']=''+_0x30e28a[_0x127cb4(0x17a1,0x14f4,0x1479,0x20d9)];const _0x33eafe={};_0x33eafe[_0x35863d(0xc84,-0x8,0xb9d,0x63)]=_0x1eb88b,_0xa7b5a7[_0x35863d(0xda5,0x145f,0xf05,0x12a7)+'e'](_0x3f7d04[_0x35863d(0x23c9,0x19d5,0x174d,0x196c)],_0x44b434,_0x33eafe);}else _0x28ca1e+=dragonemoji+(_0x127cb4(0xdca,0xc10,0x5b9,0xc63)+'\x20')+_0x3e6279++ +_0x127cb4(0x17b0,0x1986,0x8bf,0x16d9)+_0x61437d['ip']+_0x35863d(0x263d,0x2027,0x1983,0x18d3)+_0x61437d[_0x35863d(0x2dd,0xcc8,0xb18,0x135a)]+'\x0aversi\x20:\x20'+_0x61437d[_0x127cb4(0x110a,0xda7,0xdad,0x1b5b)]+_0x127cb4(0x192e,0xec7,0xfba,0x12c9)+_0x61437d[_0x35863d(0x15cd,-0x80,0xc2d,-0x1ae)]+'\x0a\x0a';}const _0x3cba43={};_0x3cba43['displayTex'+'t']=_0x4b485e[_0x127cb4(0x4cd,-0x557,0x6c7,-0x41c)];const _0x5324a4={};_0x5324a4['buttonId']=_0x127cb4(0x1b0a,0x1574,0x2648,0xe54),_0x5324a4[_0x127cb4(0x1696,0x1308,0xc17,0x2207)]=_0x3cba43,_0x5324a4[_0x35863d(0x15ce,0xfe1,0xcf9,0x18b5)]=0x1;let _0x4dd67d=[_0x5324a4];const _0x1fc491={};_0x1fc491[_0x35863d(0x22bb,0x1e07,0x2204,0x2d13)]=log0,_0x1fc491[_0x127cb4(0x5b4,-0xee,0x1458,0x130e)+_0x127cb4(0xe0b,0x1364,0x11bc,0x65e)]=thum,_0x1fc491[_0x127cb4(0xa62,0x1827,0xcdb,0x9a5)]=_0x28ca1e,_0x1fc491[_0x127cb4(0x1168,0x73f,0xec6,0x8a3)]=''+global[_0x35863d(0x1c8,0xdf7,0xf2d,0x1c47)],_0x1fc491[_0x35863d(0x1c2e,0x38f,0x11fb,0x195f)]=_0x4dd67d,_0x1fc491[_0x127cb4(0x1c13,0x1f10,0xf05,0x1076)]=0x4;let _0x523c3c=_0x1fc491;_0x175756[_0x35863d(0x1282,0x1b9b,0xf05,0x854)+'e'](_0x5cd288[_0x127cb4(0x1286,0x18a8,0x1b90,0x1c9f)],_0x523c3c,{'quoted':_0x5cd288});}});}}break;case _0x4b485e[_0x313705(0xfc0,0xec1,0x13ad,0xbb3)]:if(_0x1bac1f)return _0x1db05d(mess[_0x23937d(0x61c,0xf63,0x782,0x68c)]);if(_0x1e03f5)return _0x4b485e['YzBBt'](_0x1db05d,mess['banChat']);_0x4b485e['QhoPq'](FajarNews)[_0x313705(0x1ec7,0x2b81,0x287e,0x15aa)](async _0x55c042=>{console[_0x5a5280(0x14f9,0x1157,0xbe9,0x560)](_0x55c042),no=0x5*0x7b+-0x25b8+-0x2351*-0x1,teks=_0x4b485e[_0x5a5280(0x1158,0x1f19,0x2b2a,0x2812)];function _0x2474dc(_0x3bdb7a,_0x3f8792,_0x39fedd,_0x2f3e90){return _0x313705(_0x3f8792- -0x4e4,_0x3bdb7a,_0x39fedd-0x8d,_0x2f3e90-0x1b3);}for(let _0x193288 of _0x55c042){const _0x1fb303=_0x4b485e[_0x2474dc(0x1638,0x805,0x723,-0x59e)]['split']('|');let _0x52eee9=0x133e+0x4*-0x7a7+0xb5e;while(!![]){switch(_0x1fb303[_0x52eee9++]){case'0':teks+=_0x5a5280(-0xdb,0xdc9,0x63,0xde)+_0x193288['berita_jen'+'is']+'\x0a';continue;case'1':teks+=_0x2474dc(0x318,-0x88,-0xf7c,0x841)+_0x193288[_0x5a5280(0x214a,0x153d,0x23d4,0xfc3)]+'\x0a';continue;case'2':teks+=_0x2474dc(-0x635,0x403,0xb0c,0x5)+_0x193288['berita_diu'+_0x5a5280(0x72d,0x1209,0x76b,0xc7c)]+'\x0a';continue;case'3':teks+=_0x2474dc(0x4b8,0x452,0x4b3,0xc2)+_0x193288[_0x2474dc(0xb3a,0x19cb,0x1b00,0x1113)]+'\x0a';continue;case'4':no+=0x1*0x2201+-0x6*-0x3f1+-0x39a6;continue;case'5':teks+=_0x2474dc(0x1a15,0x17cd,0x1824,0x2337)+no[_0x2474dc(0x1acf,0x101f,0xfb6,0x1f07)]()+_0x5a5280(0x1727,0xe22,0xc70,0x4d3);continue;}break;}}function _0x5a5280(_0x1cfb54,_0x4d127f,_0x295bd1,_0x4edd1f){return _0x23937d(_0x4d127f-0x591,_0x295bd1,_0x295bd1-0x126,_0x4edd1f-0x121);}teks+=_0x5a5280(0x180d,0x1a71,0x1329,0x1bb8)+_0x5a5280(0xc1a,0x1494,0x15ef,0x1c6e),_0x4b485e[_0x2474dc(0xbb1,0x1083,0x19b2,0x1a7e)](_0x516d85,teks);});break;case _0x4b485e[_0x313705(0x166c,0x1acf,0x14f2,0x1454)]:if(_0x1bac1f)return _0x1db05d(mess[_0x313705(0x982,0x1089,0xa53,-0x58)]);if(_0x1e03f5)return _0x4b485e[_0x23937d(0x18be,0x22a1,0x264c,0x1bc1)](_0x1db05d,mess[_0x23937d(0x5c0,-0x6cd,0x6d9,0x13be)]);var _0x39e854=await _0x4b485e[_0x313705(0xcf9,0xf38,0x1162,0x1815)](Quotes);teks=_0x4b485e[_0x23937d(0x1988,0x192c,0x20b6,0xb7d)],teks+=_0x313705(0x79f,-0xd3,0xe5c,-0x461)+_0x39e854[_0x23937d(0x6b1,0xbd5,0x8e2,0x2f1)]+'\x0a',teks+=_0x313705(0x1da1,0x1b11,0x2bdc,0x2be3),teks+=_0x39e854[_0x313705(0x1c3d,0xf43,0x2116,0x192f)]+'\x0a',teks+=_0x23937d(0x14e0,0x20c1,0x1a0f,0x1fc7)+_0x313705(0x1269,0x51a,0x1dc4,0x3d2),_0x4b485e[_0x23937d(0xfda,0xa99,0x294,0x1423)](_0x516d85,teks);break;case _0x4b485e[_0x23937d(0x2b,-0xa25,0x29d,-0x2bd)]:if(_0x1bac1f)return _0x4b485e[_0x23937d(0xdc9,0xaf9,0x1a63,0x1a6b)](_0x1db05d,mess[_0x313705(0x982,-0x45b,0x13,0x35b)]);if(_0x1e03f5)return _0x4b485e['cQrUo'](_0x1db05d,mess['banChat']);var _0x39e854=await _0x4b485e['PjyVO'](Darkjokes);teks=_0x4b485e[_0x313705(0x632,0x34,0xb3e,0xeca)];const _0x4fb909={};_0x4fb909[_0x313705(0xddf,0x18ff,0x1399,0x12b6)]=_0x39e854;const _0x1177de={};_0x1177de['image']=_0x4fb909,_0x1177de[_0x23937d(0x968,0x14,-0x360,-0x36a)]=teks,_0x175756[_0x23937d(0x944,0x7e4,0xdbc,0x10c0)+'e'](_0x5cd288['chat'],_0x1177de,{'quoted':_0x5cd288});break;case _0x4b485e['dqDOv']:if(_0x1bac1f)return _0x1db05d(mess[_0x313705(0x982,0xf33,0x126e,0x1b1)]);if(_0x1e03f5)return _0x4b485e[_0x313705(0x873,0xd58,0x813,0xfb4)](_0x1db05d,mess[_0x313705(0x926,-0x463,0xd8e,-0x42e)]);CNNNews()[_0x23937d(0x1b61,0x1df0,0x2373,0x1f20)](_0xf9be2=>{no=0x1138+-0xa*-0x5e+-0x14e4,teks=_0x4b485e[_0xc3975a(0x20cc,0x2454,0x1f05,0x1cac)];for(let _0x161aa7 of _0xf9be2){no+=0xdf0+0x22af+-0x309e,teks+=_0xc3975a(0x2d8b,0x174c,0x1ec8,0x2726)+no['toString']()+'\x20•\x0a',teks+=_0x333a32(0x78e,0xbff,0x4ce,0x1c7)+_0x161aa7[_0xc3975a(0x178c,0x2179,0x20c6,0x2dba)]+'\x0a',teks+='Link:\x20'+_0x161aa7[_0x333a32(0x116a,0x15b2,0x1d7d,0x31a)]+'\x0a';}function _0x333a32(_0x19f2b4,_0x1f2a53,_0x19b46d,_0x255fc){return _0x313705(_0x19f2b4- -0x1a8,_0x19b46d,_0x19b46d-0x11a,_0x255fc-0x1b9);}teks+=_0x4b485e[_0x333a32(0x1b46,0x27ee,0x2221,0x12b7)];function _0xc3975a(_0x1d0be9,_0x47f2e9,_0x4f0a89,_0x163284){return _0x23937d(_0x4f0a89-0x57d,_0x47f2e9,_0x4f0a89-0x96,_0x163284-0x1c2);}_0x4b485e['bXhxZ'](_0x516d85,teks);});break;case'tvsearch':if(_0x1bac1f)return _0x1db05d(mess[_0x313705(0x982,0x117e,0xf74,0x1873)]);if(_0x1e03f5)return _0x4b485e[_0x313705(0xcbf,0x39f,0x1bd2,0x1ba7)](_0x1db05d,mess[_0x23937d(0x5c0,0x5bd,0x8cd,0x1da)]);if(!q)return _0x4b485e[_0x23937d(0x1a02,0x2909,0x255d,0xfea)](_0x1db05d,_0x4b485e[_0x23937d(0x1402,0x19de,0xa1c,0x21ab)]);_0x4b485e[_0x23937d(0xd0f,0x111e,0x1704,0x533)](LayarKaca21,q)['then'](async _0x4462b9=>{function _0x31227e(_0x507994,_0x3d6b5c,_0x39047a,_0x51f66d){return _0x313705(_0x39047a- -0x452,_0x51f66d,_0x39047a-0x76,_0x51f66d-0x157);}function _0x2ac0ad(_0xd5263d,_0x332c67,_0x402841,_0x41ae85){return _0x313705(_0xd5263d- -0x132,_0x332c67,_0x402841-0x1d6,_0x41ae85-0x7b);}if(_0x4b485e['iKhCj'](_0x4b485e[_0x2ac0ad(0x1102,0x949,0x1811,0x372)],_0x4b485e[_0x31227e(0x8df,0x814,0x1553,0xa86)])){no=0x23d*0x4+0x197e+-0x2272,teks=_0x4b485e[_0x31227e(0x1451,0x1818,0x189c,0x182a)];for(let _0x42f462 of _0x4462b9){no+=0x228e+0x30b*0x7+-0x6*0x94f,teks+=_0x31227e(0x1412,0x1ba1,0x185f,0x25b1)+no[_0x31227e(0x73a,0x33d,0x10b1,0x18f0)]()+'\x20•\x0a',teks+=_0x2ac0ad(0x1d29,0x2be0,0x288b,0x24f1)+_0x42f462[_0x2ac0ad(0x19ba,0x1b0c,0x2745,0x1581)]+'\x0a',teks+='Link:\x20'+_0x42f462[_0x31227e(0xb8,-0x82d,-0xd7,-0x625)]+'\x0a';}teks+=_0x2ac0ad(0x1714,0x2407,0x2584,0x1e75)+_0x2ac0ad(0x1137,0x39b,0x815,0xfdb),_0x4b485e[_0x2ac0ad(0x1f39,0x12b0,0x2a51,0x2c52)](_0x516d85,teks);}else{_0xa90175=0x1*0x1733+-0x2452*0x1+0xd1f,_0x2381b7=_0x4b485e[_0x31227e(0x1f2d,0x1c0e,0x189c,0x186e)];for(let _0x1404db of _0x4b2eec){_0x2f9476+=0x5*-0x5db+0x2*-0xef+0x12*0x1bb,_0x5c6a33+='\x0a•\x20'+_0x18dbc0['toString']()+'\x20•\x0a',_0x452950+=_0x2ac0ad(0x804,0x1356,0x16d9,0x43c)+_0x1404db[_0x31227e(0x2266,0xe8c,0x1a5d,0x190e)]+'\x0a',_0xe67aa4+=_0x31227e(0x7b4,0x80,0x495,-0x65e)+_0x1404db['berita_diu'+'pload']+'\x0a',_0x101673+='Link:\x20'+_0x1404db[_0x31227e(0x18ce,0xa7f,0xec0,0x313)]+'\x0a';}_0x12aede+=_0x31227e(0x172b,0x14fc,0x13f4,0x541)+_0x31227e(0x36e,0x64f,0xe17,0x17f2);const _0x22f250={};_0x22f250[_0x2ac0ad(0xcad,0x15e1,0x1114,0xbf1)]=_0x35faf6[-0x255*0x6+0x15a7+0x35*-0x25][_0x2ac0ad(0x5f6,0x11,-0x4f3,0x79)+'mb'];const _0x54666e={};_0x54666e[_0x31227e(0x1680,0xc66,0x1b57,0x1a00)]=_0x22f250,_0x54666e[_0x2ac0ad(0xb9c,0x106d,0x84a,0x1639)]=_0x14b86c;const _0x3001e8={};_0x3001e8[_0x31227e(0x13af,0x566,0x4f0,0x1300)]=_0x25afbd,_0x44375c[_0x31227e(0x3f5,-0x3b6,0x858,0x11ca)+'e'](_0x5634c6[_0x31227e(0x239,0x1c56,0x10a0,0xa54)],_0x54666e,_0x3001e8);}});break;case _0x4b485e[_0x313705(0x1a5e,0x1c01,0x28c7,0x27f6)]:if(_0x1bac1f)return _0x4b485e[_0x23937d(0x4ed,0x243,0x717,-0x97f)](_0x1db05d,mess[_0x23937d(0x61c,0xf3a,-0x38b,0xa64)]);if(_0x1e03f5)return _0x4b485e['udHfr'](_0x1db05d,mess[_0x23937d(0x5c0,0x12aa,0xec2,0x79e)]);_0x4b485e['ofUYZ'](CNBCNews)[_0x23937d(0x1b61,0x175c,0x14b9,0xe74)](async _0x3969f2=>{no=-0x13cc+0x25f5+-0x1229;function _0x2b2968(_0x22a910,_0x5c11c3,_0x28bced,_0x475944){return _0x23937d(_0x22a910-0x28,_0x28bced,_0x28bced-0x79,_0x475944-0x183);}function _0x16affa(_0x4bd7c9,_0x44f2c9,_0x164509,_0x544872){return _0x313705(_0x44f2c9-0x14b,_0x164509,_0x164509-0x186,_0x544872-0x138);}teks=_0x4b485e['dBfFs'];for(let _0x291bd2 of _0x3969f2){if(_0x4b485e['uEuIm']!==_0x2b2968(0x13e9,0x778,0x1ef4,0xf91)){const _0x2a05ed='3|2|1|4|0'[_0x2b2968(0xcf7,0x1134,0x1b9,0x1b72)]('|');let _0x2bad41=-0x5*-0x21f+-0xb22+0x87;while(!![]){switch(_0x2a05ed[_0x2bad41++]){case'0':teks+=_0x16affa(0x93f,0x5a7,0x66e,0xb80)+_0x291bd2[_0x2b2968(0xfd4,0x2ec,0x32f,0x509)]+'\x0a';continue;case'1':teks+=_0x16affa(-0x1cb,0xa81,0xe76,0x123)+_0x291bd2[_0x2b2968(0x1b71,0x1d39,0x1d8c,0x19f8)]+'\x0a';continue;case'2':teks+=_0x16affa(0x2b88,0x1dfc,0x29c2,0x1b83)+no[_0x2b2968(0x11c5,0x135d,0x1cbd,0x3e3)]()+_0x16affa(-0x1c,0xd42,0xba9,-0x179);continue;case'3':no+=-0x26f1+0x4d*0x74+-0x15a*-0x3;continue;case'4':teks+=_0x16affa(0xe67,0xa32,0x419,-0x31f)+_0x291bd2[_0x16affa(0xd14,0xd2a,0x1045,0x3e2)+_0x2b2968(0xca0,-0x205,0x1971,0x1928)]+'\x0a';continue;}break;}}else return'Error!';}teks+=_0x4b485e[_0x16affa(0x1aa4,0x1e39,0x272b,0x240b)];const _0x4f9a12={};_0x4f9a12[_0x2b2968(0xaa1,0xc33,0x157d,0xc93)]=_0x3969f2[0x443+0x1c0d+-0x2050][_0x2b2968(0x3ea,-0xb26,0xb46,0xa08)+'mb'];const _0x353cfa={};_0x353cfa[_0x2b2968(0x1c6b,0x25e0,0x155c,0x1159)]=_0x4f9a12,_0x353cfa[_0x2b2968(0x990,0x156b,0x15b8,0x440)]=teks,_0x175756[_0x2b2968(0x96c,0xd9c,0x13a9,-0x595)+'e'](_0x5cd288['chat'],_0x353cfa,{'quoted':_0x5cd288});});break;case _0x313705(0x608,0xf58,0x1e8,-0x6b5)+'s':if(_0x1bac1f)return _0x4b485e[_0x23937d(0xf68,0x1b1e,0x1458,0x124b)](_0x1db05d,mess[_0x313705(0x982,0xbe4,0x739,0xd4b)]);if(_0x1e03f5)return _0x4b485e[_0x313705(0x1806,0x2685,0x107a,0xca1)](_0x1db05d,mess[_0x23937d(0x5c0,-0x451,0x1102,0xf21)]);_0x4b485e[_0x23937d(0x18fe,0x14f8,0xdf3,0x1918)](TribunNews)[_0x313705(0x1ec7,0x1537,0x2c51,0x2772)](async _0x36e5c0=>{no=-0xa21+0x2466+-0x1a45;function _0x16801b(_0x400131,_0xda8de,_0x26757c,_0x873cc5){return _0x23937d(_0x400131-0x4a6,_0x873cc5,_0x26757c-0x117,_0x873cc5-0x16);}teks=_0x4b485e[_0x1c5631(0x1e8f,0x28a5,0x1cdd,0x27ae)];for(let _0x3df2ce of _0x36e5c0){const _0x889ffe=_0x4b485e[_0x1c5631(0xf0b,0x295,0x417,0x17af)]['split']('|');let _0x18194d=0x35*0x25+0x11f2+0x17*-0x11d;while(!![]){switch(_0x889ffe[_0x18194d++]){case'0':no+=-0xa77+-0x24d8+0x2f50;continue;case'1':teks+=_0x16801b(0xa27,0x12fa,0x16ed,0x154c)+_0x3df2ce['berita_diu'+_0x16801b(0x111e,0x449,0x127c,0xab4)]+'\x0a';continue;case'2':teks+='\x0a•\x20'+no[_0x16801b(0x1643,0x1927,0x136d,0x835)]()+_0x16801b(0xd37,-0x1ce,0x202,0x1167);continue;case'3':teks+=_0x16801b(0xa76,0x11f7,0x11bd,0x32)+_0x3df2ce[_0x16801b(0x1fef,0x14ab,0x2be7,0x1d01)]+'\x0a';continue;case'4':teks+=_0x16801b(0xcde,0x197f,0x1aaa,0x31e)+_0x3df2ce[_0x1c5631(0x14ff,0xf67,0x1949,0x1d68)+'is']+'\x0a';continue;case'5':teks+=_0x1c5631(0x5fd,-0x4f6,-0xc3,0x4e8)+_0x3df2ce[_0x16801b(0x1452,0x16e4,0x1a26,0xd90)]+'\x0a';continue;}break;}}teks+=_0x4b485e['dBfFs'];const _0x39217f={};function _0x1c5631(_0x4146f4,_0x1e0bd4,_0x1d5044,_0x163f37){return _0x313705(_0x4146f4-0x1a1,_0x1d5044,_0x1d5044-0xdf,_0x163f37-0x191);}_0x39217f[_0x1c5631(0xf80,0x15be,0x96,0x1823)]=_0x36e5c0[0xc5*-0x1+0x51*0x15+0x4*-0x178][_0x1c5631(0x8c9,-0x3be,-0x534,0x983)+'mb'];const _0x4cb387={};_0x4cb387['image']=_0x39217f,_0x4cb387[_0x16801b(0xe0e,0x71f,0x23,0xf7a)]=teks,_0x175756[_0x1c5631(0xe4b,0xa8c,0x8a,0x162d)+'e'](_0x5cd288[_0x16801b(0x1632,0x1107,0x1d6a,0x21f7)],_0x4cb387,{'quoted':_0x5cd288});});break;case _0x23937d(0x1942,0x1c6b,0xd5c,0x282c)+_0x313705(0xdcc,0x105b,0x18c0,0x1826):if(_0x1bac1f)return _0x1db05d(mess[_0x313705(0x982,0x14fe,0x1326,0x169d)]);if(_0x1e03f5)return _0x4b485e[_0x23937d(0x1bd5,0x1db8,0x1aac,0x1d70)](_0x1db05d,mess[_0x313705(0x926,-0x45d,0xd6c,0x1294)]);_0x4b485e[_0x313705(0xcf9,-0x4a,0x14af,0xd17)](IndozoneNews)[_0x23937d(0x1b61,0x26cc,0x1e54,0x23ca)](async _0x1f67ee=>{no=-0x93*0x5+0x1815+-0x1536,teks=_0x4b485e[_0x4b8aa1(0x1205,0xbcb,0x1ae8,0x294e)];function _0x1c4295(_0x90bc58,_0x22596c,_0x6e213f,_0x483f17){return _0x23937d(_0x6e213f-0x40f,_0x22596c,_0x6e213f-0x1a4,_0x483f17-0x141);}for(let _0x595136 of _0x1f67ee){no+=-0x2*0x114a+-0xb81+0x2e16,teks+=_0x4b8aa1(0x1fcc,0xd93,0x1aab,0x1daa)+no[_0x4b8aa1(0x217f,0xa96,0x12fd,0x12b1)]()+_0x4b8aa1(-0x211,0xc27,0x9f1,0x122d),teks+=_0x1c4295(0x125c,0xa03,0x9df,0x1607)+_0x595136['berita']+'\x0a',teks+=_0x1c4295(0xcdb,0x14ff,0x990,0xa76)+_0x595136['berita_diu'+_0x1c4295(0x8b0,0x12aa,0x1087,0x1842)]+'\x0a',teks+='Type:\x20'+_0x595136[_0x4b8aa1(0xb4d,0xf40,0x1158,0x10c6)+'is']+'\x0a',teks+=_0x1c4295(0xba4,-0x16e,0x505,0x12f1)+_0x595136[_0x4b8aa1(0x4e7,0x1696,0x110c,0x14b1)]+'\x0a';}function _0x4b8aa1(_0x28d04c,_0x4ee6b8,_0x3000bd,_0xe6f56e){return _0x313705(_0x3000bd- -0x206,_0x4ee6b8,_0x3000bd-0xb6,_0xe6f56e-0x155);}teks+=_0x4b485e[_0x1c4295(0x2c09,0x2063,0x1d97,0x2a5b)];const _0x5953a6={};_0x5953a6[_0x4b8aa1(0x244,0x199f,0xbd9,0x7d3)]=_0x1f67ee[-0x189*0x9+0x1a22+-0xc51][_0x1c4295(0x15f0,0xdc3,0x7d1,0xf0d)+'mb'];const _0x3a6666={};_0x3a6666[_0x4b8aa1(0x100c,0x10ec,0x1da3,0x13aa)]=_0x5953a6,_0x3a6666['caption']=teks,_0x175756[_0x1c4295(0x1050,0x3c6,0xd53,0x151d)+'e'](_0x5cd288[_0x4b8aa1(0x20f0,0x2009,0x12ec,0x1836)],_0x3a6666,{'quoted':_0x5cd288});});break;case _0x4b485e[_0x313705(0x11e8,0xedb,0x1a5c,0x18a9)]:if(_0x1bac1f)return _0x4b485e[_0x23937d(0xdf5,-0x125,0x131e,0x15f6)](_0x1db05d,mess[_0x313705(0x982,0x7f2,0x47a,0x6cf)]);if(_0x1e03f5)return _0x4b485e[_0x23937d(0x1ca7,0x2a7d,0x177b,0x20a3)](_0x1db05d,mess[_0x23937d(0x5c0,0x13a4,0x2a3,0xc57)]);_0x4b485e[_0x23937d(0xac,-0x1f5,0x54c,0x199)](KompasNews)[_0x313705(0x1ec7,0x2a5f,0x2715,0x2691)](async _0x4e9db2=>{function _0x53570d(_0x226e27,_0x291f4b,_0x2342dc,_0x30b6e3){return _0x313705(_0x2342dc- -0x4d0,_0x291f4b,_0x2342dc-0xf,_0x30b6e3-0x1bd);}function _0x1317ff(_0x4c5b80,_0x4f2e30,_0x151de9,_0xecfaaa){return _0x313705(_0xecfaaa- -0x19,_0x151de9,_0x151de9-0x177,_0xecfaaa-0x1ae);}const _0x48ea72={'uUnAy':function(_0x3c1cb0,_0x127a99){return _0x4b485e['ZdAan'](_0x3c1cb0,_0x127a99);}};if(_0x4b485e[_0x1317ff(0x24f9,0xff2,0x1ef5,0x1a31)](_0x4b485e[_0x1317ff(0x1137,0x1d4d,0x28bc,0x19b8)],'UwotR')){no=-0x14*0x1c3+-0xec0+0x31fc,teks=_0x4b485e['dBfFs'];for(let _0x21c6e6 of _0x4e9db2){const _0x565b67=_0x4b485e['rWOFA'][_0x1317ff(0x1c6,0x1aa3,0x1013,0x101c)]('|');let _0x33308a=0x106b+0x936+-0x51*0x51;while(!![]){switch(_0x565b67[_0x33308a++]){case'0':teks+=_0x53570d(0x227,0x1160,0x6ce,0xce)+_0x21c6e6['berita_jen'+'is']+'\x0a';continue;case'1':teks+=_0x53570d(-0x4ac,-0xef8,-0x74,-0x98)+_0x21c6e6[_0x53570d(0xf0b,0x14bb,0xe42,0x199d)]+'\x0a';continue;case'2':teks+=_0x53570d(-0x564,0x10bf,0x417,0xe85)+_0x21c6e6[_0x53570d(0xd1a,0x1488,0x70f,0xe75)+_0x53570d(0x454,0x1342,0xb0e,0xdd0)]+'\x0a';continue;case'3':no+=-0x5fd+-0x489+0x1*0xa87;continue;case'4':teks+=_0x1317ff(0x11b0,0xea6,0xf05,0x91d)+_0x21c6e6['berita']+'\x0a';continue;case'5':teks+=_0x1317ff(0x14c4,0x285f,0x15c9,0x1c98)+no[_0x53570d(0x1a99,0xa76,0x1033,0x585)]()+_0x53570d(0xf6b,-0x4eb,0x727,-0x61f);continue;}break;}}teks+=_0x4b485e[_0x1317ff(0x1d1c,0x1edb,0x23c7,0x1cd5)];const _0x2f790b={};_0x2f790b[_0x1317ff(0x14f8,0x129a,0x1175,0xdc6)]=_0x4e9db2[-0x1f*-0xc9+-0xea*-0x13+0x1*-0x29b5]['berita_thu'+'mb'];const _0x147e78={};_0x147e78[_0x1317ff(0x1183,0x25b0,0x165d,0x1f90)]=_0x2f790b,_0x147e78[_0x53570d(0x16c1,0x1094,0x7fe,0xc0a)]=teks,_0x175756[_0x1317ff(0x980,0x635,0x128c,0xc91)+'e'](_0x5cd288[_0x53570d(0xa8b,0x1d9b,0x1022,0x1784)],_0x147e78,{'quoted':_0x5cd288});}else _0x48ea72[_0x53570d(-0xd44,0x6d6,0x36,-0x44b)](_0x5c717a,_0x53570d(-0x77b,0xfe1,0x5cb,0xbb5)+_0x1317ff(0x135d,0x9e7,0x1722,0x1592))&&_0x191413[_0x1317ff(0x1078,0x143b,0x11f6,0x74f)](_0x1a788f);});break;case _0x4b485e[_0x23937d(0x1cc0,0x1891,0x1f1c,0x1f82)]:if(_0x1bac1f)return _0x4b485e[_0x313705(0x137f,0x1646,0x13e4,0x127c)](_0x1db05d,mess[_0x313705(0x982,0x11d3,0x1624,0xe16)]);if(_0x1e03f5)return _0x1db05d(mess[_0x313705(0x926,-0x42e,0x1599,0x73a)]);_0x4b485e[_0x23937d(0xac,-0xa5f,-0xa9f,-0xbc4)](DetikNews)[_0x313705(0x1ec7,0x1893,0x25e5,0x2210)](async _0x4303b5=>{function _0x303fa7(_0x4049f0,_0x439711,_0x28b401,_0xd11f99){return _0x313705(_0x4049f0- -0x50a,_0x439711,_0x28b401-0x105,_0xd11f99-0x15f);}function _0x5d54af(_0x2bc3a2,_0x4e1352,_0x420348,_0xa4c9f2){return _0x23937d(_0x2bc3a2-0x391,_0x4e1352,_0x420348-0x48,_0xa4c9f2-0x50);}if(_0x4b485e[_0x303fa7(0xe68,0x14a1,0x13fc,0x15c3)](_0x4b485e[_0x303fa7(0xa55,0x14,-0x2ca,0xd48)],_0x303fa7(0x774,0x724,-0x121,-0x46c))){no=0x37*-0x21+-0x25e3+0x2cfa,teks=_0x4b485e[_0x303fa7(0x17e4,0x11f6,0x16ff,0xb67)];for(let _0x42f163 of _0x4303b5){const _0x365e4a=_0x4b485e[_0x5d54af(0x1408,0x1658,0x734,0x1529)][_0x5d54af(0x1060,0x8e3,0x13ab,0xff4)]('|');let _0x31e3b5=-0x7*-0x1e2+-0x26b+0x13*-0x91;while(!![]){switch(_0x365e4a[_0x31e3b5++]){case'0':teks+=_0x303fa7(-0xae,0xe6c,-0x41b,-0x84f)+_0x42f163[_0x5d54af(0x133d,0x1932,0x13e8,0x19b4)]+'\x0a';continue;case'1':no+=-0xc7d+0x120d*0x1+-0x58f;continue;case'2':teks+='Upload:\x20'+_0x42f163[_0x5d54af(0xc0a,0x1446,0xfd4,0x282)+_0x303fa7(0xad4,-0x1ed,-0x268,0xcd7)]+'\x0a';continue;case'3':teks+=_0x303fa7(0x17a7,0x8b6,0xff1,0xc88)+no[_0x303fa7(0xff9,0x130d,0x13bd,0x13df)]()+_0x5d54af(0xc22,0x136a,-0x6e,0xf7f);continue;case'4':teks+=_0x5d54af(0x961,0x132c,0x77b,0xb67)+_0x42f163[_0x5d54af(0x1eda,0x18f3,0x245e,0x2184)]+'\x0a';continue;}break;}}teks+=_0x4b485e[_0x5d54af(0x1d19,0xf32,0x2231,0x2838)];const _0x19acca={};_0x19acca[_0x303fa7(0x8d5,-0xd6,0xb19,0xd42)]=_0x4303b5[-0x1026+0xb8+0x2*0x7b7][_0x5d54af(0x753,0x1ad,0xe3f,0x853)+'mb'];const _0x2ee755={};_0x2ee755[_0x303fa7(0x1a9f,0x14fc,0x177e,0x29bf)]=_0x19acca,_0x2ee755[_0x5d54af(0xcf9,0x1a9c,0x1143,-0x19)]=teks,_0x175756[_0x303fa7(0x7a0,0x1502,-0x2fd,0x13f9)+'e'](_0x5cd288[_0x303fa7(0xfe8,0x1527,0x505,0x7b4)],_0x2ee755,{'quoted':_0x5cd288});}else{const _0x3aacc1=_0x5d54af(0x3ab,0x2d8,0xdeb,-0x8dd)[_0x303fa7(0xb2b,0x170d,0x819,0x22f)]('|');let _0x5cfae3=-0x85d*0x1+0x2*-0x6b5+-0x1*-0x15c7;while(!![]){switch(_0x3aacc1[_0x5cfae3++]){case'0':_0x27066f+=_0x5a9a90+_0x5d54af(0x13f7,0x11b5,0x189d,0x5f1)+_0x30802b[_0x303fa7(0x1436,0x1be0,0x183e,0x1741)]+'\x0a';continue;case'1':_0x22fff3+=_0x450368+_0x5d54af(0xd27,0x18a7,-0xfb,0x1715)+_0x3c2d44[_0x5d54af(0x193c,0x1b13,0x27d3,0x1df0)]+'\x0a';continue;case'2':_0x3e9a81+=_0x24f78f+_0x5d54af(0xd62,0x1884,0x1bd1,-0xa0)+_0x39ac44[_0x303fa7(0x799,0xd7a,0x73c,0xde7)]+'\x0a';continue;case'3':_0x52a101+=_0x1ae12c+(_0x303fa7(0xa80,-0x11d,-0x307,0x1930)+'\x20Url:\x20')+_0x29e109['thumbnail']+('\x0a\x0a────────'+_0x5d54af(0x1ce6,0x1985,0x2339,0x1d5a)+'────\x0a');continue;case'4':_0x3c5935+=_0xcbb408+'\x20Url:\x20'+_0x40771a[_0x303fa7(0x8d5,-0xbc,0x512,-0x265)]+'\x0a';continue;}break;}}});break;case _0x4b485e['zlNzH']:if(_0x1bac1f)return _0x4b485e['gZmpZ'](_0x1db05d,mess[_0x313705(0x982,0x9b6,-0x3af,-0x51b)]);if(_0x1e03f5)return _0x4b485e['VjwPj'](_0x1db05d,mess[_0x313705(0x926,0x3c9,0x1000,0x10d7)]);DailyNews()[_0x313705(0x1ec7,0x2686,0x19f7,0x1f3f)](async _0x22fb3d=>{no=0x361+-0x2200+0x1e9f,teks=_0x4b485e[_0x41dcf4(0x29ff,0x1995,0x166a,0x1e1c)];for(let _0x3cbacf of _0x22fb3d){no+=-0x3f*0xf+0x204e+-0x1c9c,teks+='\x0a•\x20'+no[_0x41dcf4(0x19a2,0x22f3,0x1ca3,0x1631)]()+_0x4e75ff(0x77d,0x1737,0xaa1,0xc67),teks+=_0x4e75ff(0x14bf,0xc8b,0x7e0,0xa62)+_0x3cbacf[_0x41dcf4(0x1b20,0x2906,0x1282,0x1fdd)]+'\x0a',teks+=_0x4e75ff(-0x123,0x81e,0x306,-0x9ee)+_0x3cbacf[_0x4e75ff(0x174a,0x5bf,0x11bc,0x1775)]+'\x0a';}teks+=_0x4b485e[_0x4e75ff(0x17e4,0x2236,0x1b98,0x158c)];function _0x4e75ff(_0x4af547,_0x5711e5,_0x544eab,_0x253e22){return _0x313705(_0x544eab- -0x156,_0x5711e5,_0x544eab-0x1ef,_0x253e22-0xdc);}const _0x560c7b={};_0x560c7b[_0x41dcf4(0xbdc,0x5e6,0x1372,0xf0d)]=_0x22fb3d[-0xf*-0x1ab+0x891*0x1+-0x1*0x2196][_0x4e75ff(0x2d2,0xb38,0x5d2,0x11da)+'mb'];function _0x41dcf4(_0x1631bb,_0x1fb356,_0x391a5d,_0x915aaf){return _0x313705(_0x915aaf-0x12e,_0x1631bb,_0x391a5d-0x148,_0x915aaf-0xc2);}const _0x3f24a8={};_0x3f24a8[_0x41dcf4(0x133f,0x22de,0x175e,0x20d7)]=_0x560c7b,_0x3f24a8[_0x4e75ff(0x14a4,0x672,0xb78,0x14b2)]=teks,_0x175756['sendMessag'+'e'](_0x5cd288[_0x4e75ff(0x1d8a,0x1ed5,0x139c,0x15b4)],_0x3f24a8,{'quoted':_0x5cd288});});break;case _0x4b485e[_0x313705(0x1e99,0x1730,0x269a,0x1cc5)]:if(_0x1bac1f)return _0x4b485e[_0x23937d(0x114,0xe5,0xb17,0x14)](_0x1db05d,mess['ban']);if(_0x1e03f5)return _0x4b485e[_0x313705(0x1d62,0x2ac0,0x21e1,0x1f84)](_0x1db05d,mess[_0x23937d(0x5c0,-0x806,0x9d4,0x517)]);iNews()[_0x23937d(0x1b61,0x2787,0xe08,0x17d8)](async _0x275b27=>{function _0x16b5d6(_0x270c57,_0x277d1a,_0x30ec63,_0x340aca){return _0x23937d(_0x277d1a-0x459,_0x30ec63,_0x30ec63-0x18f,_0x340aca-0x10);}const _0x2e8670={'XutsI':function(_0x4359cf,_0x20177f){return _0x4359cf(_0x20177f);},'MiGKB':function(_0x2bc598,_0x6a4f59){function _0x54fed9(_0x2726e2,_0x49473e,_0x2bcf1f,_0x4914d4){return _0x2506(_0x2726e2-0x2a8,_0x2bcf1f);}return _0x4b485e[_0x54fed9(0x18ea,0x1685,0xa39,0x2064)](_0x2bc598,_0x6a4f59);},'TpaTx':function(_0x22587d,_0x50e1a7){return _0x22587d(_0x50e1a7);},'miwRl':_0x4b485e[_0x16b5d6(0x2061,0x15e7,0x20ed,0x1672)],'Asarl':_0x4b485e['njNbF'],'JCtHO':_0x4b485e[_0x16b5d6(0xfef,0x12ab,0x3a0,0x19b0)],'XjRhJ':_0x4b485e[_0x16b5d6(0x98e,0x4b7,0x1174,-0x277)],'pysPa':_0x4b485e[_0x16b5d6(-0x66a,0x887,-0x629,-0x207)]};function _0x263a7e(_0x165af1,_0x352c2b,_0xf2f0d3,_0x205ec3){return _0x23937d(_0x352c2b-0x342,_0xf2f0d3,_0xf2f0d3-0x1ea,_0x205ec3-0x3e);}if(_0x4b485e[_0x263a7e(0x87b,0x101e,0x19ca,0x1aff)](_0x4b485e[_0x16b5d6(0x1bd3,0x12af,0x4a1,0x58c)],_0x4b485e['mTIuj'])){const _0x5e8225={};_0x5e8225['text']=_0x263a7e(0x14cc,0x1211,0x1afe,0xa01),_0x5e8225[_0x16b5d6(0x1695,0xda8,0xdf5,0x1812)]=_0x344612[_0x263a7e(0x11f1,0xc91,0x1305,0xf68)];const _0x3e408={};_0x3e408[_0x16b5d6(0x2d22,0x1e13,0x2b57,0x2c5f)]=_0x5e8225,_0x222b35[_0x16b5d6(0x184c,0xd9d,0x1259,-0x118)+'e'](_0x584905,_0x3e408);if(_0x1817d3)return _0x2e8670[_0x16b5d6(0x480,0x97c,-0x4ea,0xf70)](_0x1cd2b5,_0x51e599[_0x16b5d6(0x124c,0xa75,0x15a2,0x1072)]);if(_0x13fe72)return _0x2e8670['MiGKB'](_0x5db320,_0x33da19[_0x263a7e(-0x116,0x902,-0x474,0x1539)]);if(!_0x49bb13)return _0x2e8670[_0x263a7e(0x137f,0x1b82,0x1244,0x282b)](_0x316dc8,_0x2e8670[_0x16b5d6(0x8f2,0x15a3,0x18b8,0x213b)]);_0x2e8670[_0x16b5d6(0x1cd3,0xf63,0xda,0x235)](_0x5e6b0e,_0x3457ec[_0x16b5d6(0x1cf,0xd05,0x14ab,0x1a34)]);if(!_0x5c283e[0x2566+0x59f+-0x2b05][_0x263a7e(0x1245,0x4ba,0xabf,-0x8ff)](_0x2e8670['Asarl']))return _0x4df122(_0x16b5d6(0x110d,0xd87,0x11b0,0xa9e)+_0x16b5d6(0x2e53,0x2196,0x16d6,0x1f52));const _0x23f3b3={};_0x23f3b3[_0x263a7e(0x17c1,0x1736,0x12b2,0x1a9b)+'t']=_0x2e8670[_0x263a7e(-0x68d,0x68b,-0x57a,0x1411)];const _0x5c8689={};_0x5c8689[_0x263a7e(0x146b,0x1e4e,0x13f6,0x2179)]=_0x16b5d6(0x146e,0x1b57,0x29a1,0x247a)+_0x56507a,_0x5c8689[_0x263a7e(0x221d,0x18de,0x254b,0xd9d)]=_0x23f3b3,_0x5c8689['type']=0x1;const _0x34ee4a={};_0x34ee4a[_0x263a7e(0x2379,0x1736,0x143c,0x160c)+'t']=_0x263a7e(0x1eda,0x1527,0x184c,0xb46)+'❯';const _0x38e874={};_0x38e874[_0x263a7e(0x2181,0x1e4e,0x18d1,0x28b2)]=_0x263a7e(0x6c7,0x402,0x123b,-0x55f)+_0x4c25ed,_0x38e874[_0x16b5d6(0x23d3,0x19f5,0xf3f,0x1324)]=_0x34ee4a,_0x38e874[_0x16b5d6(0x1554,0xb91,0x110c,0x251)]=0x1;const _0x32b857={};_0x32b857[_0x263a7e(0xf1e,0x1736,0x22b2,0xe07)+'t']=_0x2e8670[_0x263a7e(0x2c2e,0x1dd0,0x137a,0x254e)];const _0x3312b6={};_0x3312b6['buttonId']=_0x16b5d6(0x48,0x4c6,0xb45,-0x840)+_0x552cd5,_0x3312b6[_0x263a7e(0x10a8,0x18de,0x123d,0x2560)]=_0x32b857,_0x3312b6['type']=0x1;let _0x1505b6=[_0x5c8689,_0x38e874,_0x3312b6];const _0x4ad491={};_0x4ad491['url']=_0x2e8670[_0x16b5d6(0x6eb,0xb0d,0xc0f,0x1606)];const _0x3d6f59={};_0x3d6f59['image']=_0x4ad491,_0x3d6f59[_0x16b5d6(0x1a05,0xdc1,0x614,0x16f8)]='╔═════════'+_0x16b5d6(0xae9,0x147f,0xd5a,0x2002)+_0x263a7e(0x27f5,0x209c,0x1e59,0x2448)+_0x16b5d6(0xcde,0xedf,0xbef,0x195c)+'ᴏᴋ\x20ᴅᴏᴡɴʟᴏᴀ'+_0x16b5d6(0x13cb,0x1178,0x11ce,0xc70)+'══════════'+'═',_0x3d6f59[_0x16b5d6(0x605,0x14c7,0x126a,0x12a2)]=_0x1bbea2[_0x16b5d6(0x8b0,0x87a,-0x325,0x156)][_0x263a7e(0xd1e,0x1793,0x200a,0x17f1)],_0x3d6f59['buttons']=_0x1505b6,_0x3d6f59[_0x16b5d6(0x2dd9,0x1f72,0x20b0,0x1d22)]=0x4;let _0x1f10f8=_0x3d6f59;const _0x43f5e1={};_0x43f5e1[_0x16b5d6(0x10a0,0xa35,0x11e5,-0x352)]=_0x5c53f2,_0x3fa1e0[_0x263a7e(0x1a69,0xc86,0x5cd,0x340)+'e'](_0x2cb511[_0x263a7e(0x16bf,0x14ce,0x1b39,0x2020)],_0x1f10f8,_0x43f5e1);}else{no=-0xaa4+0x1*0x7+0xa9d,teks=_0x4b485e['dBfFs'];for(let _0x7c1498 of _0x275b27){if(_0x4b485e[_0x16b5d6(0x931,0x8f7,-0x69,0xe6d)]===_0x263a7e(0x16c4,0x87f,0x470,0x90c)){const _0x4b7ff5=_0x4b485e['rKhxD'][_0x263a7e(0x43a,0x1011,0x2dc,0x9b0)]('|');let _0x259fe0=-0xf07+-0x1*-0x2029+-0x1122;while(!![]){switch(_0x4b7ff5[_0x259fe0++]){case'0':teks+=_0x16b5d6(0xc47,0x9da,0x6a1,0x82c)+_0x7c1498[_0x16b5d6(0xd67,0xcd2,0xd23,0x170e)+_0x263a7e(0x833,0xfba,0x1440,0x1ed3)]+'\x0a';continue;case'1':teks+=_0x263a7e(0x118,0x912,0x1443,0x45d)+_0x7c1498['berita']+'\x0a';continue;case'2':no+=-0x1c5d+0x1*0x1a77+0x1e7;continue;case'3':teks+=_0x263a7e(0xbce,0x438,0x3a9,0x994)+_0x7c1498['berita_url']+'\x0a';continue;case'4':teks+=_0x16b5d6(0x274a,0x1da4,0x153f,0x1599)+no['toString']()+_0x263a7e(0xeac,0xbd3,0x99a,0x18cd);continue;case'5':teks+=_0x16b5d6(0x1639,0xc91,0x4de,0x1678)+_0x7c1498['berita_jen'+'is']+'\x0a';continue;}break;}}else _0x4a0c2a=![];}teks+=_0x4b485e[_0x263a7e(0x1c5c,0x1cca,0x211e,0xe8c)],_0x516d85(teks);}});break;case _0x4b485e[_0x313705(0x1161,0x918,0x1f15,0x1e4f)]:if(_0x1bac1f)return _0x4b485e['NADNs'](_0x1db05d,mess[_0x313705(0x982,0x93d,-0x4a4,0x173)]);if(_0x1e03f5)return _0x1db05d(mess[_0x313705(0x926,0xc29,0xbac,-0xb4)]);OkezoneNews()[_0x313705(0x1ec7,0x175b,0x1340,0x2d0f)](async _0x5b99f0=>{function _0x231a34(_0x4188d9,_0x12c1b8,_0x5eabf8,_0x5f0384){return _0x313705(_0x5f0384-0x69,_0x12c1b8,_0x5eabf8-0x1f3,_0x5f0384-0xe6);}function _0x4b782f(_0x395067,_0x1fc77f,_0x8d2c05,_0x548de8){return _0x23937d(_0x8d2c05-0x1d6,_0x1fc77f,_0x8d2c05-0xc2,_0x548de8-0x48);}if(_0x231a34(0x116e,0x1a0b,0x1707,0xfb0)!==_0x4b485e[_0x231a34(0x1c01,0xbbb,0x9c0,0xe3e)]){no=-0x11*0x19b+0xaf9+0x829*0x2,teks='══════════'+_0x4b782f(0x9cc,0xe2c,0x10d9,0x774);for(let _0x460847 of _0x5b99f0){if(_0x4b485e[_0x231a34(-0x7ac,0xa87,0x9aa,0x472)](_0x4b485e[_0x231a34(-0x6bb,0x62a,-0x45f,0x80e)],_0x4b485e['xWPxg'])){if(!_0x37a83e)return _0x4b485e['WsOvE'](_0x112bef,_0x4b485e[_0x4b782f(-0x572,-0x2d7,0x617,-0x134)]);if(_0xdfcc0){_0x2cc7f1[_0x4b782f(0x146b,-0x1,0xc14,0x17a3)]=_0x1eb1bb;const _0x48ba66={};_0x48ba66[_0x231a34(0x1d0f,0x18ae,0x75,0xe48)]=''+_0x56151e[_0x231a34(0xe42,0x955,0x8cc,0xe0d)];const _0x4fe086={};_0x4fe086[_0x231a34(0x1c43,0x2230,0x28bf,0x2012)]=_0x48ba66,_0x4fe086[_0x4b782f(0x41,0x24f,0xb3e,-0x347)]=_0x4b485e[_0x231a34(0x2339,0x2340,0x802,0x1527)];const _0x5f0dd0={};_0x5f0dd0[_0x231a34(0x4ac,0x702,0x124,0x9ab)]=_0x4c3453,_0x4a7037[_0x231a34(0x10cf,-0x209,0x28b,0xd13)+'e'](_0x5110fb[_0x4b782f(0x17f5,0x18f1,0x1362,0x214b)],_0x4fe086,_0x5f0dd0);}else{if(_0x4be688){_0x369c81['alivepic']=_0xdeb376;const _0x421b74={};_0x421b74[_0x4b782f(0x1181,0x192e,0xc4f,0x1175)]=''+_0x126d9e[_0x4b782f(0xea3,0x139f,0xc14,0x1a4f)];const _0x3e20c6={};_0x3e20c6[_0x4b782f(0x1461,0x2931,0x1e19,0x1c7d)]=_0x421b74,_0x3e20c6[_0x4b782f(0x58c,-0x96,0xb3e,0x1a2d)]=_0x4b782f(0x6a7,0xd2c,0x5d4,0x1176)+_0x4b782f(0x13a3,0x247e,0x1cba,0x17cf)+'Successful'+_0x4b782f(0x6e9,0x8c9,0x14e9,0x1093)+_0x231a34(0x199b,0x10fb,0x20cd,0x1b70)+_0x231a34(0x22c7,0x20d2,0x1ffc,0x1c17)+_0x231a34(0xdb,0x1a29,0x11a5,0xbad);const _0x5f2995={};_0x5f2995['quoted']=_0x3d65f0,_0x7cfa78[_0x231a34(0xaf2,0x85f,0xce9,0xd13)+'e'](_0x588310[_0x4b782f(0x16cb,0x1912,0x1362,0x1244)],_0x3e20c6,_0x5f2995);}else return _0x16ce05(''+_0x25bf33['owner']);}}else{const _0x10602d=_0x4b485e['LmDhD'][_0x4b782f(0xa11,0x19e9,0xea5,0xcab)]('|');let _0x1634f8=-0x12b8+-0x164c+0x2904;while(!![]){switch(_0x10602d[_0x1634f8++]){case'0':teks+=_0x231a34(-0x292,0x1518,0x236,0x99f)+_0x460847[_0x231a34(0x1fb8,0x1984,0x2525,0x1f18)]+'\x0a';continue;case'1':teks+=_0x4b782f(0x221d,0x21d8,0x1b21,0x1084)+no[_0x231a34(0x2298,0xe80,0x16a2,0x156c)]()+_0x231a34(0x175f,0x2a8,0x14ec,0xc60);continue;case'2':teks+=_0x4b782f(0x1a6,0x865,0x757,0xc9a)+_0x460847[_0x231a34(0xa03,0x1a25,0x38c,0xc48)+_0x4b782f(0xed7,0x119e,0xe4e,0x84f)]+'\x0a';continue;case'3':teks+=_0x4b782f(0x7ac,-0xa42,0x2cc,0x5ee)+_0x460847[_0x231a34(0x1a5b,0xce4,0x1ddb,0x137b)]+'\x0a';continue;case'4':no+=0x2c5*-0x1+-0x23a6+-0x1336*-0x2;continue;}break;}}}teks+=_0x4b782f(0xf20,0x157a,0x16b6,0x15e9)+_0x231a34(0xcc2,0x1603,0x179f,0x12d2);const _0x6b1086={};_0x6b1086[_0x4b782f(0x184e,0x5e7,0xc4f,0x19fa)]=_0x5b99f0[0xed9*0x1+0x1*-0x9ac+-0x5*0x109][_0x4b782f(0x13ff,0x31a,0x598,-0x4ea)+'mb'];const _0x205303={};_0x205303['image']=_0x6b1086,_0x205303['caption']=teks,_0x175756[_0x4b782f(0x33c,0x30b,0xb1a,0x106b)+'e'](_0x5cd288[_0x231a34(0x1b7e,0x6f3,0x8b4,0x155b)],_0x205303,{'quoted':_0x5cd288});}else _0x4b485e['qvVjR'](_0x4137d4,_0x4b485e[_0x231a34(0x127a,0xeb9,-0x3fb,0x3fb)]);});break;case _0x4b485e[_0x313705(0xb87,0x74d,-0x252,0xf5c)]:if(_0x1bac1f)return _0x4b485e[_0x313705(0x137f,0x1d98,0x4e9,0xb26)](_0x1db05d,mess[_0x23937d(0x61c,0x773,0x1b5,-0x606)]);if(_0x1e03f5)return _0x1db05d(mess[_0x313705(0x926,0x71d,0x15cc,0xf0b)]);SindoNews()[_0x23937d(0x1b61,0x131b,0x1237,0x216a)](async _0x4fabaa=>{no=-0x1528+-0x1*0x9a+0x15c2,teks=_0x4b485e[_0x4f4ab4(0x1752,0x164b,0x263e,0x1cc6)];function _0x4f4ab4(_0x559a94,_0x103417,_0xd4a618,_0x39390a){return _0x23937d(_0x39390a-0x33e,_0x559a94,_0xd4a618-0x63,_0x39390a-0xc4);}function _0x417dc5(_0x481e91,_0x31a59c,_0x3865ba,_0x1d5828){return _0x313705(_0x31a59c- -0x4b7,_0x1d5828,_0x3865ba-0x3a,_0x1d5828-0xe0);}for(let _0x226447 of _0x4fabaa){no+=-0x2*-0x9d6+0x884*0x1+-0x1c2f,teks+='\x0a•\x20'+no[_0x4f4ab4(0x1d6b,0x1823,0x18b8,0x14db)]()+_0x417dc5(-0x493,0x740,0x9f3,0xe1),teks+=_0x4f4ab4(-0x53e,0x1518,0xd01,0x90e)+_0x226447[_0x417dc5(0x1c31,0x19f8,0xcac,0xfde)]+'\x0a',teks+=_0x4f4ab4(0x1694,0x16d9,0x9f1,0xb76)+_0x226447[_0x417dc5(-0x57,0xea7,0x972,0x78c)+'is']+'\x0a',teks+=_0x417dc5(-0x23b,-0x5b,0x25b,0x4dd)+_0x226447[_0x4f4ab4(0xeb0,0x184e,0x19e9,0x12ea)]+'\x0a';}teks+=_0x4b485e[_0x417dc5(0x1fe9,0x1837,0xd90,0x2208)],_0x516d85(teks);});break;case _0x4b485e[_0x23937d(0x17f2,0xe49,0x174b,0x195c)]:if(_0x1bac1f)return _0x4b485e['aHhNv'](_0x1db05d,mess['ban']);if(_0x1e03f5)return _0x4b485e[_0x23937d(0xcc7,0x104a,0x19fe,0x10c2)](_0x1db05d,mess[_0x313705(0x926,0x1078,0x1107,0x1294)]);_0x4b485e['uLXgN'](TempoNews)['then'](async _0x481a51=>{const _0x432a7a={'PvbWy':_0x4de080(0x180f,0x1692,0x21db,0x1aba)+'\x20⫸','PUYlT':'⫷\x20ALIVE\x20⫸','xMMLo':_0x3ece2f(0xf0c,0x1725,0x1cfb,0x1d3b),'kVoMv':function(_0x504aa4,_0x687e55){function _0x5be6a2(_0x40a311,_0x332773,_0x351a66,_0x4950a2){return _0x3ece2f(_0x40a311-0x36,_0x332773,_0x351a66-0x1b9,_0x4950a2-0x2a2);}return _0x4b485e[_0x5be6a2(0x19e1,0x141f,0x1a10,0xbd7)](_0x504aa4,_0x687e55);},'yABQv':function(_0x4cdb7a,_0x1ab136){function _0x3fb680(_0xe34c44,_0x247e75,_0x3675e8,_0xe10c1){return _0x3ece2f(_0xe34c44-0x12b,_0x247e75,_0x3675e8-0x132,_0xe10c1- -0x26f);}return _0x4b485e[_0x3fb680(0x479,0xc3,-0x41a,0x9d5)](_0x4cdb7a,_0x1ab136);},'ihXMW':_0x4b485e['QNSlh'],'oQwxh':_0x4b485e[_0x4de080(0x16e4,0x1fcd,0xfb2,0x1ff1)]};function _0x4de080(_0x2f81fc,_0x50bc82,_0x5c79ff,_0x1b70c3){return _0x313705(_0x2f81fc- -0x104,_0x1b70c3,_0x5c79ff-0x140,_0x1b70c3-0x188);}function _0x3ece2f(_0x44f355,_0x101d90,_0x31fe5c,_0x18a18c){return _0x23937d(_0x18a18c-0x210,_0x101d90,_0x31fe5c-0x1c5,_0x18a18c-0x23);}if(_0x4b485e[_0x3ece2f(0x1ee8,0xe88,0x1af1,0x1857)](_0x4b485e[_0x3ece2f(0x1a25,0x1c1d,0x41,0xeae)],_0x4b485e[_0x3ece2f(0x149d,0x108c,0x1543,0xeae)])){no=0x61*-0xd+0x208b*0x1+-0x46*0x65,teks=_0x4b485e[_0x4de080(0x1bea,0x285c,0x1131,0xf14)];for(let _0x43084d of _0x481a51){if(_0x4b485e[_0x3ece2f(0x2ade,0x12f8,0x1c39,0x1e79)](_0x4b485e[_0x3ece2f(0x21d6,0x13e8,0xc12,0x1a3b)],_0x4b485e[_0x3ece2f(0x19c9,0x20fe,0x604,0x13d1)])){const _0x39263a=_0x4b485e[_0x4de080(0xf5e,0xba4,0xac,0xa39)][_0x3ece2f(0x1b54,0x13cb,0x667,0xedf)]('|');let _0x1aa242=-0x2*0x821+0x2*-0xcf1+-0x706*-0x6;while(!![]){switch(_0x39263a[_0x1aa242++]){case'0':teks+='\x0a•\x20'+no['toString']()+'\x20•\x0a';continue;case'1':teks+=_0x4de080(0x7e3,0x836,0xd6f,0xfc4)+_0x43084d[_0x4de080(0xadb,0x535,0x11ef,-0x1e8)+'pload']+'\x0a';continue;case'2':teks+=_0x3ece2f(-0x544,0x71c,-0x3a5,0x306)+_0x43084d[_0x3ece2f(0x3f1,0x106d,0x843,0x11bc)]+'\x0a';continue;case'3':teks+=_0x4de080(0x832,0x72,0x1339,0x131b)+_0x43084d[_0x4de080(0x1dab,0x15f9,0x1eb0,0x290a)]+'\x0a';continue;case'4':no+=-0x16d+-0xe3*-0x2a+0x23d0*-0x1;continue;}break;}}else{const _0x9b74ce={};_0x9b74ce['displayTex'+'t']=_0x432a7a[_0x4de080(0xedb,0x5c6,0x935,0x11a4)];const _0x55f898={};_0x55f898['buttonId']=_0x40c6ea+'allmenu',_0x55f898['buttonText']=_0x9b74ce,_0x55f898[_0x3ece2f(0x67b,0x148f,0x41b,0x948)]=0x1;const _0x209556={};_0x209556['displayTex'+'t']=_0x432a7a[_0x3ece2f(0xb9e,0x1b66,0x1db2,0x11a1)];const _0x41746e={};_0x41746e['buttonId']=_0x5b76c4+_0x4de080(0x1042,0x841,0x11a5,0xd1d),_0x41746e[_0x3ece2f(0x1710,0x114e,0xf85,0x17ac)]=_0x209556,_0x41746e[_0x4de080(0x99a,0x374,0x5ff,0x14f2)]=0x1;const _0x391fba={};_0x391fba[_0x4de080(0x1656,0xc29,0x11a6,0xdd9)+'t']=_0x432a7a['xMMLo'];const _0x28f60b={};_0x28f60b[_0x4de080(0x1d6e,0x13be,0xf18,0xeed)]=_0x2baf57+'donate',_0x28f60b[_0x4de080(0x17fe,0xfe5,0x10a8,0xf81)]=_0x391fba,_0x28f60b[_0x4de080(0x99a,0xf47,-0x16e,0xfbd)]=0x1;let _0x58db43=[_0x55f898,_0x41746e,_0x28f60b];const _0x4ad864={};_0x4ad864[_0x4de080(0xcdb,0x11ee,0x1427,0x8e3)]=_0x4de080(0xb79,0x85b,0xd93,0x1825)+_0x3ece2f(0x229f,0x2424,0x2bf3,0x1e80)+'80ry/20220'+_0x3ece2f(0x4d4,-0x5ff,0xd10,0x4fd)+'.png';const _0x349d76={};_0x349d76['image']=_0x4ad864,_0x349d76[_0x4de080(0xbca,0x143e,0x426,0xf90)]=_0x3ece2f(-0x619,0xbc2,0x6d6,0x399)+_0x12393f+(_0x4de080(0x3a9,0x8ce,0x18c,0xead)+_0x4de080(0x1425,0xb46,0x1aea,0xa73)+_0x4de080(0x1b2c,0x1848,0x20a4,0x1368)+_0x4de080(0xa6b,0xa70,0x11ed,0x1043)+_0x4de080(0x367,0x7a2,0x207,0x560))+_0x43e0fa+'\x20'+_0x35453e+(_0x3ece2f(0xe5f,0x89c,-0x141,0x632)+_0x4de080(0x143a,0x1d40,0x1e75,0xf2b))+_0x11a127+'\x20'+_0x35f9e3+(_0x4de080(0xcfe,0x929,0x609,0x542)+_0x3ece2f(0x1584,0x1d8c,0x2062,0x1a0a))+_0x136f62+'\x20'+_0x51ff3f+(_0x3ece2f(0x22b4,0x22ab,0x2701,0x1e35)+_0x3ece2f(0x482,-0x685,0x1184,0x467))+_0x3f0742+'\x20'+_0x35a17c+('sparklechr'+_0x4de080(0x11cd,0xe74,0xf20,0x14c2)+_0x3ece2f(0xa93,0x8c3,0x63c,0xc11))+_0x2f5c20+'\x20'+_0x2fe9a3+(_0x4de080(0x110c,0x214,0xebb,0xc54)+_0x3ece2f(0x1457,0x2153,0x1e87,0x1aca))+_0x45b8ec+'\x20'+_0x10706f+(_0x4de080(0x1c41,0x173f,0x16ae,0x14d4)+_0x4de080(0x143a,0x17f2,0x17d0,0xb46))+_0x2e9d59+'\x20'+_0x2d03bb+(_0x4de080(0x11c5,0x1270,0x1734,0x4b3)+_0x3ece2f(0x2575,0xc78,0x1643,0x1aca))+_0x533939+'\x20'+_0x2f5be4+(_0x4de080(0x1061,0x15bc,0x6ad,0x153c)+_0x4de080(0x4b9,0x324,0xd51,0x1226))+_0x11f7e3+'\x20'+_0x57efd0+('spooky\x20[tx'+_0x3ece2f(0x14bc,0x89b,0xd16,0xc11))+_0x4ab47a+'\x20'+_0xd0fcfd+(_0x3ece2f(0xdca,0x1a82,0xd0b,0x100a)+'t]\x0a┃╠')+_0x18a113+'\x20'+_0x3decee+(_0x3ece2f(0x2291,0xf72,0x2731,0x1e49)+_0x3ece2f(0x2472,0x174b,0x1158,0x1aca))+_0x51e13d+'\x20'+_0x58a2cf+('discovery\x20'+_0x4de080(0x4b9,-0x418,-0x3e2,0x10b3))+_0x5c305e+'\x20'+_0x59a7d9+(_0x3ece2f(0x5a1,0x512,0x3f2,0xfbd)+_0x4de080(0x1b1c,0x1626,0x20a6,0x1652))+_0x1ec2a7+'\x20'+_0x310386+(_0x4de080(0xbc3,0x344,0xa18,0x98)+_0x4de080(0x1b1c,0x1da0,0xd4f,0x1582))+_0x40a0c3+'\x20'+_0x450a07+(_0x4de080(0x2024,0x2d6c,0x1352,0x1423)+_0x3ece2f(0x1266,0x124b,0x17c7,0x13e8))+_0x2bcedc+'\x20'+_0x5a8ef0+(_0x4de080(0x1803,0x1c6f,0x23b8,0x105b)+_0x4de080(0x1926,0x21f6,0x25a3,0x1b65))+_0x1e6985+'\x20'+_0x2c0500+(_0x4de080(0x19bc,0x2146,0x19c0,0x265b)+']\x0a┃╠')+_0x193ef0+'\x20'+_0x311107+(_0x4de080(0xd26,0x176c,0x15d2,0x19b3)+_0x4de080(0x1b1c,0x13b3,0x2675,0x1e82))+_0x55da78+'\x20'+_0x13b1b6+(_0x4de080(0x5e5,-0x643,0xe35,0xd2)+_0x4de080(0x143a,0x111a,0x10c1,0xba1))+_0x3f57ac+'\x20'+_0x4ac507+(_0x3ece2f(0x1540,0x14c6,0x2a5b,0x1ced)+_0x3ece2f(0x20fe,0x220a,0x1647,0x1aca))+_0x10a01b+'\x20'+_0xd01486+(_0x4de080(0x179a,0x1519,0x1f5f,0x1f96)+_0x3ece2f(0x2d6,0x7f2,0x948,0x467))+_0x79049a+'\x20'+_0x16e130+(_0x4de080(0x1c2d,0x12dd,0xd34,0x1e8c)+'t]\x0a┃╠')+_0x34459e+'\x20'+_0x664d25+(_0x3ece2f(0x267d,0x1053,0x2851,0x1a14)+_0x3ece2f(0x14a3,0x1028,0x13d4,0x18d4))+_0xd1f45+'\x20'+_0x2cd87e+(_0x4de080(0x823,0x6f3,0xb2e,0xa16)+'s\x20[txt]\x0a┃╠')+_0x3c5f15+'\x20'+_0x4e44a4+(_0x4de080(0xdbe,0xd00,0x1570,0x1aff)+_0x4de080(0x85b,-0x6c2,0x69c,0xc2c))+_0x49a1b6+'\x20'+_0x47dede+(_0x3ece2f(0x36f,-0x9d,0x6cd,0x445)+'\x20[txt]\x0a┃╠')+_0x335532+'\x20'+_0x2b99de+(_0x4de080(0x1e43,0x29cd,0x1c5e,0x2721)+_0x4de080(0x194f,0xf89,0x1c07,0x1885))+_0x5dcedf+'\x20'+_0x5496f1+(_0x3ece2f(0x4e,-0x6,0x12d7,0x4ca)+'[txt]\x0a┃╠')+_0x27e87c+'\x20'+_0x2b43d2+(_0x4de080(0x18ac,0x108f,0x196f,0x234f)+_0x3ece2f(0x1e7c,0x18cf,0xfed,0x18fd))+_0x109bdf+'\x20'+_0x41ec3f+(_0x3ece2f(0x88b,0x16ac,0xb7a,0x877)+_0x3ece2f(0x11e0,0xc63,0x15a4,0x1210)+'╠')+_0x27b35e+'\x20'+_0x10ff2a+(_0x4de080(0x14ac,0x62b,0x232b,0x95b)+'\x0a┃╠')+_0x26de29+'\x20'+_0x6b4413+('cloud\x20[txt'+_0x4de080(0x143a,0x701,0x22d8,0x526))+_0x1ccdf0+'\x20'+_0x333c15+('honey\x20[txt'+_0x4de080(0x143a,0x1cc0,0x13b8,0x2357))+_0x14eee1+'\x20'+_0x2bd2c7+('ice\x20[txt]\x0a'+'┃╠')+_0x37f6dc+'\x20'+_0x42ea1e+(_0x3ece2f(0x1b7f,0x1f64,0x284d,0x1f60)+_0x4de080(0x194f,0x27c7,0x155d,0x1a8d))+_0x2d6ec6+'\x20'+_0x566f08+(_0x3ece2f(0xd74,0x11f7,0xa3d,0x76c)+'xt]\x0a┃╠')+_0x8e2373+'\x20'+_0x195320+('wood\x20[txt]'+_0x4de080(0x367,-0x887,0xa7e,0x750))+_0x361153+'\x20'+_0x45297f+(_0x4de080(0x181e,0x21dd,0x1045,0xc06)+_0x4de080(0x4b9,0x105e,0x9fa,-0x307))+_0x2f0433+'\x20'+_0x78a22d+(_0x4de080(0x1fc1,0x10be,0x12b7,0x18ab)+_0x3ece2f(0xc66,0xd7a,0x2044,0x18fd))+_0xf86d89+'\x20'+_0x280509+(_0x3ece2f(0x1d8d,0xa0a,0xcd0,0x176b)+_0x4de080(0xc63,-0x1a0,0xd2b,0x1891))+_0x30e3ed+'\x20'+_0x5c1f5d+(_0x4de080(0x4b8,0x405,0xf4,0xd31)+']\x0a┃╠')+_0x9da8d0+'\x20'+_0x189bf5+(_0x3ece2f(0x165e,0x170b,0x20e,0xc1c)+_0x4de080(0x4b9,-0x1df,-0x646,0x10e3))+_0x36733f+'\x20'+_0x3eb6e3+(_0x4de080(0xe88,0x1c9e,0x53e,0x13fe)+']\x0a┃╠')+_0x35593d+'\x20'+_0x2e1b16+(_0x3ece2f(-0x3e3,0x1032,0x5b5,0x7af)+_0x3ece2f(0x4bb,0x68c,-0x4ad,0x315))+_0x4937bd+'\x20'+_0x6607f0+(_0x4de080(0x17c6,0x18ca,0x1c41,0xaa2)+_0x3ece2f(-0x899,0xb10,-0x3a7,0x315))+_0x4c3434+'\x20'+_0x1b9473+(_0x3ece2f(0xf86,0x105d,0x23a9,0x1843)+'[txt]\x0a┃╠')+_0x5c162+'\x20'+_0xe34d26+(_0x4de080(0x240,-0x88a,0x10a5,-0xc35)+_0x4de080(0x85b,-0x3ff,0xb5f,0x131a))+_0x529e73+'\x20'+_0x10c360+(_0x3ece2f(-0xcd,0x101a,-0x7d6,0x26d)+_0x3ece2f(0xe59,0x7a1,-0x612,0x809))+_0x385e63+'\x20'+_0x17cf50+(_0x3ece2f(0x646,0x11a6,0x65f,0x62a)+_0x4de080(0x143a,0x1a53,0x8b2,0x1a32))+_0x40c813+'\x20'+_0x59b26a+(_0x3ece2f(0x14e8,-0x5ba,0x1280,0x6f1)+_0x4de080(0xc63,0x14a,0x4,0x22a))+_0x4de474+'\x20'+_0x39b8f7+('firework\x20['+_0x3ece2f(0x27,0x13aa,0xe2e,0x809))+_0x5e69fd+'\x20'+_0x387860+(_0x3ece2f(0x1b59,0x2001,0x1747,0x1a1e)+'txt]\x0a┃╠')+_0x3d675b+'\x20'+_0x51f3ec+('blackpink\x20'+_0x4de080(0x4b9,-0x6b1,0xcf5,0x125a))+_0x4a7faa+'\x20'+_0x4aeb17+(_0x3ece2f(0x189c,-0x188,0x409,0xad0)+_0x3ece2f(0x2c2,-0x262,-0x402,0x315))+_0x36a50d+'\x20'+_0x37096a+('glue\x20[txt]'+_0x4de080(0x367,0xd3a,0x29,0x1094))+_0x11f4ba+'\x20'+_0x329b2f+('1917\x20[txt]'+'\x0a┃╠')+_0x379434+'\x20'+_0x1c0952+(_0x3ece2f(0x91b,0x1574,0x1efb,0x1473)+_0x3ece2f(0xc7f,0x1484,0xf40,0x15e7)+_0x3ece2f(0x13d9,0xe5b,0xd6d,0xa87)+'┗━━❯\x20')+_0x3c0541+'\x20❮━😎',_0x349d76['footer']=_0x2b7583[_0x3ece2f(0xf02,0xd27,-0x358,0x631)]['name'],_0x349d76[_0x4de080(0xe9c,0xcf4,0x13f6,0x513)]=_0x58db43,_0x349d76[_0x4de080(0x1d7b,0x2ba2,0x16c7,0x232a)]=0x4;let _0x161c12=_0x349d76;const _0x1e7eea={};_0x1e7eea['quoted']=_0x117885,_0x1294d3[_0x4de080(0xba6,0x990,0xb3c,0xdee)+'e'](_0x101df1[_0x4de080(0x13ee,0x2146,0x1e0f,0x928)],_0x161c12,_0x1e7eea);}}teks+='══════════'+'════════';const _0x10eeae={};_0x10eeae['url']=_0x481a51[0x5*0x301+-0x240a+0x1505*0x1][_0x3ece2f(0xe6,0x1457,0x19d,0x5d2)+'mb'];const _0x4d1cd7={};_0x4d1cd7['image']=_0x10eeae,_0x4d1cd7[_0x3ece2f(0x8b3,0x17fe,0xd89,0xb78)]=teks,_0x175756[_0x4de080(0xba6,0x1224,0x12f8,0x16f5)+'e'](_0x5cd288[_0x4de080(0x13ee,0x1fd2,0x16fc,0x5ff)],_0x4d1cd7,{'quoted':_0x5cd288});}else _0x582759+=_0x4de080(0x111b,0x68a,0x4e4,0x6e1)+':\x20@'+_0x2f517e['id'][_0x3ece2f(0x1a90,0x1953,0x7e8,0xedf)]('@')[-0x2*-0xa3c+0xcfa+-0x593*0x6]+_0x4de080(0xba5,0x167b,0x664,0x616)+_0x4cc26f[_0x4de080(0x1aca,0x1a30,0x15bb,0x265a)+'t']+(_0x4de080(0x1aa6,0x268d,0xfb9,0x1169)+':\x20')+_0x432a7a[_0x4de080(0x119c,0x1f6c,0x34c,0x1c5c)](_0x29b1d4,_0x432a7a[_0x3ece2f(-0x10b,0x1053,0x38a,0xa0e)](_0x52bb92[_0x4de080(0x144d,0x1f1d,0x1968,0x1f5f)+_0x3ece2f(0x9d,0xb37,0xc4,0x5cb)+'p'],-0x8f4+-0xdc6+-0x3ce*-0x7))['tz'](_0x432a7a[_0x3ece2f(0x25fb,0x26f1,0x13a3,0x1d0d)])[_0x4de080(0x1a68,0x2212,0x2802,0x1743)](_0x432a7a[_0x4de080(0x10f4,0x1118,0xcfc,0x1bfa)]);});break;case _0x313705(0xb36,0x402,0x69e,0xee2)+'s':if(_0x1bac1f)return _0x1db05d(mess[_0x313705(0x982,0xa8b,0x49a,-0x21b)]);if(_0x1e03f5)return _0x1db05d(mess[_0x23937d(0x5c0,0xcc2,0xcdf,0x2be)]);_0x4b485e[_0x313705(0xcf9,0x10ee,0x1430,0x6a9)](AntaraNews)[_0x23937d(0x1b61,0x25f9,0x17c2,0x1478)](async _0x27327e=>{function _0x1b04c1(_0xa517cb,_0x3a3203,_0x16ae92,_0x538ea1){return _0x313705(_0x538ea1- -0x147,_0x16ae92,_0x16ae92-0x189,_0x538ea1-0x176);}function _0x46cb44(_0x4e59cc,_0x42a4d1,_0x38b0e3,_0x3e01e7){return _0x23937d(_0x38b0e3- -0x104,_0x4e59cc,_0x38b0e3-0xb0,_0x3e01e7-0x1);}if(_0x4b485e[_0x46cb44(0x625,-0x59d,-0x69,0x446)](_0x4b485e[_0x46cb44(-0x4d0,-0x2c5,0x51c,-0x8fb)],_0x4b485e[_0x1b04c1(0x62e,0x4b8,-0x260,0x83f)])){no=0x247e+-0x188*0x11+-0xce*0xd,teks=_0x1b04c1(0xec4,0xdfc,0xbd3,0x16ff)+_0x46cb44(0x542,0x1ce5,0xdff,0xfe1);for(let _0x1d7627 of _0x27327e){const _0x492b3b=_0x4b485e[_0x1b04c1(0x135,0x521,0x3e0,0x820)]['split']('|');let _0x518247=-0xc44+0x1*0x1739+0xbb*-0xf;while(!![]){switch(_0x492b3b[_0x518247++]){case'0':teks+='News:\x20'+_0x1d7627[_0x46cb44(0x1b1d,0x1469,0x1a45,0xc46)]+'\x0a';continue;case'1':teks+=_0x1b04c1(-0x9b4,0x429,-0x5f6,0x315)+_0x1d7627['berita_url']+'\x0a';continue;case'2':no+=0x219e+-0x243e+-0x1*-0x2a1;continue;case'3':teks+=_0x1b04c1(0x1046,0x1da3,0x273f,0x1b6a)+no['toString']()+_0x46cb44(0x5dc,0x914,0x78d,-0x6a5);continue;case'4':teks+='Type:\x20'+_0x1d7627[_0x1b04c1(0x1c69,0x358,0x1ad5,0x1217)+'is']+'\x0a';continue;case'5':teks+=_0x1b04c1(0x10eb,0x710,0x690,0x7a0)+_0x1d7627[_0x46cb44(0x136f,0x8be,0x775,0xce1)+'pload']+'\x0a';continue;}break;}}teks+=_0x4b485e[_0x1b04c1(0xda4,0x11a4,0x1447,0x1ba7)];const _0x168628={};_0x168628[_0x1b04c1(0x1b59,0xf52,0x38e,0xc98)]=_0x27327e[-0x1d60+0x2227+0x1*-0x4c7][_0x46cb44(-0x73b,0x247,0x2be,0x17b)+'mb'];const _0x1a23fc={};_0x1a23fc[_0x1b04c1(0x1797,0x2489,0x2cd6,0x1e62)]=_0x168628,_0x1a23fc[_0x46cb44(0x13ca,0xbca,0x864,0x124a)]=teks,_0x175756[_0x1b04c1(-0x132,0x32a,0x1790,0xb63)+'e'](_0x5cd288['chat'],_0x1a23fc,{'quoted':_0x5cd288});}else{const _0x5761a4={};_0x5761a4[_0x46cb44(0x1164,0x73f,0x975,0xe54)]='https://i.'+_0x46cb44(0x2022,0xb59,0x17b4,0x23d5)+_0x46cb44(0x1fcf,0x1c27,0x1b99,0x25af)+_0x1b04c1(-0x16b,0x96f,-0x312,0x7a1)+_0x1b04c1(0x65b,0x3d4,0x50d,0x11ed);const _0x4bd031={};_0x4bd031[_0x46cb44(0x1beb,0x20d4,0x1b3f,0x278e)]=_0x5761a4,_0x4bd031['caption']=_0x1b04c1(0x1687,0x13b6,0x1409,0xfd7)+_0x1b04c1(0x23f4,0x21e4,0x2218,0x1a1a)+_0x46cb44(-0x10d,0x198b,0xb07,0x46f)+'ps://sites'+_0x46cb44(0x4f3,-0x821,-0x84,0x74e)+'m/view/red'+'-dragon-bo'+_0x1b04c1(0x109b,0xdbd,0x1d56,0x18b1)+_0x46cb44(0x1e06,0xcea,0x1b05,0x1273)+'\x20\x20☰\x20GITHUB'+_0x46cb44(0x288,-0xb3,0x147,-0x38e)+'//github.c'+'om/prabhas'+'ha2006',_0x4bd031[_0x1b04c1(0x460,0x208c,0x1c51,0x128d)]=''+_0x3c1bb9[_0x1b04c1(0x214e,0x1a59,0x10d3,0x128d)],_0x396424['sendMessag'+'e'](_0x1a4042[_0x1b04c1(0x127e,0x712,0x1181,0x13ab)],_0x4bd031);}});break;case _0x313705(0xb4b,-0x204,0x775,-0x75)+'s':if(_0x1bac1f)return _0x4b485e['jcPyf'](_0x1db05d,mess[_0x23937d(0x61c,0x102c,0x1526,0x14fe)]);if(_0x1e03f5)return _0x1db05d(mess[_0x313705(0x926,0xb7a,-0xcf,-0x253)]);_0x4b485e[_0x23937d(0x1527,0x1a96,0x1c4a,0x895)](KontanNews)['then'](async _0x27c353=>{function _0xd6988e(_0x31437a,_0x2318c6,_0x49c45e,_0x19d064){return _0x313705(_0x19d064- -0x242,_0x49c45e,_0x49c45e-0x6b,_0x19d064-0x59);}teks=_0x57b796(0xd0e,0x1789,0xe02,0x2517)+_0xd6988e(0x19e,0x1473,0xe79,0x1027),no=-0xad5*-0x3+-0xe06+-0x1*0x1279;for(let _0x4ede92 of _0x27c353){if(_0x4b485e[_0x57b796(0x1096,0x468,-0x155,0xb77)]('LXLez',_0x4b485e[_0xd6988e(0x2ff,0x1374,0x1900,0xbd2)])){const _0x140421=_0x4b485e[_0xd6988e(0x4ae,0x149b,0x2d3,0x1159)][_0xd6988e(0x161a,0x13d8,0x55f,0xdf3)]('|');let _0x807c24=0x1018+0x3a5+-0x13bd;while(!![]){switch(_0x140421[_0x807c24++]){case'0':teks+=_0xd6988e(-0x4ce,-0x193,0xc3b,0x6a5)+_0x4ede92['berita_diu'+_0xd6988e(0x7f9,0x1728,0x9c4,0xd9c)]+'\x0a';continue;case'1':teks+=_0x57b796(0x5c9,0x39f,0xaa4,-0x885)+_0x4ede92[_0x57b796(0x181a,0x1255,0xcd6,0x1ed7)]+'\x0a';continue;case'2':no+=0x1fe1*0x1+0x1*0x1b0d+-0x3aed;continue;case'3':teks+=_0xd6988e(0x6c3,-0x4e9,0x418,0x95c)+_0x4ede92['berita_jen'+'is']+'\x0a';continue;case'4':teks+=_0xd6988e(-0x41f,-0x2a0,-0x3a7,0x6f4)+_0x4ede92[_0xd6988e(0x224e,0x1c43,0x1965,0x1c6d)]+'\x0a';continue;case'5':teks+=_0xd6988e(0x11bd,0x15ae,0xff6,0x1a6f)+no[_0x57b796(0x114f,0x1446,0x158a,0xff7)]()+'\x20•\x0a';continue;}break;}}else{const _0x3f2fa9={};_0x3f2fa9[_0x57b796(0x1f33,0x1fe2,0x1fa8,0x27a2)]=''+_0x39da5d['K31'];const _0x5994b3={};_0x5994b3[_0x57b796(-0x27a,0x885,0x1391,0x6e9)]=_0x68c4bf,_0x933965['sendMessag'+'e'](_0x4303de[_0xd6988e(0x695,0x8f1,0x1c4f,0x12b0)],_0x3f2fa9,_0x5994b3),_0x59472f=_0x30d702['readFileSy'+'nc'](_0xd6988e(0x154e,0x272,0x756,0xc3f)+_0x57b796(0x2649,0x18bc,0x15e5,0x1fbf)+_0x57b796(0x15a1,0xa7b,0x1571,-0x1ce)+_0x57b796(0x1bb6,0x10e3,0x8f9,0x1941));const _0x3665cf={};_0x3665cf[_0x57b796(0x46c,0x12a3,0x1a0f,0x2103)]=_0x86e089,_0x3ce1f6['sendMessag'+'e'](_0x2c6850['chat'],_0x3665cf);}}teks+=_0x4b485e[_0x57b796(0x24b6,0x1c31,0x1d45,0x21b9)];const _0x2b74a3={};function _0x57b796(_0x32a61c,_0x5e2102,_0x2b2518,_0x2a211f){return _0x313705(_0x5e2102- -0xbd,_0x2a211f,_0x2b2518-0x1e8,_0x2a211f-0x52);}_0x2b74a3[_0xd6988e(0xfde,0xc56,0x18e5,0xb9d)]=_0x27c353[-0x500+-0x254d+0x2a4d][_0xd6988e(0x10bd,0xe02,0x94e,0x4e6)+'mb'];const _0xa7d2c8={};_0xa7d2c8['image']=_0x2b74a3,_0xa7d2c8[_0x57b796(0x42b,0xc11,0xeb6,0x193b)]=teks,_0x175756[_0x57b796(0x121c,0xbed,0x7c0,-0x8c)+'e'](_0x5cd288[_0xd6988e(0x1380,0x15ae,0x1ec9,0x12b0)],_0xa7d2c8,{'quoted':_0x5cd288});});break;case _0x4b485e[_0x313705(0xbcd,0xc00,0xa4c,0x1594)]:if(_0x1bac1f)return _0x1db05d(mess[_0x313705(0x982,0x10ee,0xe22,-0x1b2)]);if(_0x1e03f5)return _0x4b485e['pjXaK'](_0x1db05d,mess['banChat']);_0x4b485e['jNaND'](MerdekaNews)[_0x313705(0x1ec7,0x136c,0x1898,0x2c82)](async _0x3dc39d=>{teks=_0x4b485e[_0x5b56c1(0x1978,0x209a,0x236e,0x164e)];function _0x21bd31(_0x7e9f68,_0x15b1b2,_0x3aa0a7,_0x5c788f){return _0x313705(_0x3aa0a7- -0x150,_0x15b1b2,_0x3aa0a7-0x152,_0x5c788f-0x17f);}no=-0x28*-0xa9+-0xa*0x289+-0x6*0x2d;function _0x5b56c1(_0x9936df,_0x1ab400,_0x31e241,_0x454998){return _0x23937d(_0x9936df- -0x10,_0x31e241,_0x31e241-0x19d,_0x454998-0x15a);}for(let _0x18364b of _0x3dc39d){no+=0xb9c+-0x2c0*0x2+0x61b*-0x1,teks+=_0x21bd31(0x29e1,0x161a,0x1b61,0x14ec)+no['toString']()+'\x20•\x0a',teks+=_0x21bd31(0xd96,-0x668,0x7e6,0x13d6)+_0x18364b[_0x21bd31(0xed9,0x13bc,0x1d5f,0x2a34)]+'\x0a',teks+=_0x5b56c1(0x571,0x222,0x12a,0x568)+_0x18364b[_0x21bd31(0x2e1,0x18ad,0xa8f,-0x388)+_0x21bd31(0xe26,0x14f5,0xe8e,0x11b8)]+'\x0a',teks+=_0x5b56c1(0xe6,0xf3c,0xf6f,-0xceb)+_0x18364b['berita_url']+'\x0a';}teks+=_0x4b485e[_0x21bd31(0x1126,0x246e,0x1b9e,0x1820)];const _0x3741cf={};_0x3741cf[_0x21bd31(0x19ea,0x155a,0xc8f,0xd29)]=_0x3dc39d[0x1dd9+-0xa61*0x3+-0x5*-0x42]['berita_thu'+'mb'];const _0x2982ee={};_0x2982ee[_0x5b56c1(0x1c33,0x18f2,0x1403,0x1c27)]=_0x3741cf,_0x2982ee[_0x21bd31(0x1686,0x13b3,0xb7e,0x7bd)]=teks,_0x175756[_0x5b56c1(0x934,0x1f7,-0x85,0x714)+'e'](_0x5cd288[_0x21bd31(0xa75,0xbd2,0x13a2,0xb8a)],_0x2982ee,{'quoted':_0x5cd288});});break;case _0x4b485e[_0x23937d(0x1c26,0x2594,0x23d9,0x162f)]:if(_0x1bac1f)return _0x4b485e[_0x313705(0x963,0x3e8,0x11f9,0xa97)](_0x1db05d,mess['ban']);if(_0x1e03f5)return _0x1db05d(mess['banChat']);var _0x39e854=await JalanTikusMeme();teks=_0x313705(0x1846,0xf2e,0x25f7,0x142e)+_0x23937d(0xf03,0x71e,0xfd6,0x175e),teks+=_0x4b485e[_0x313705(0x16d7,0x1c0b,0xc4d,0x2508)],teks+=_0x23937d(0x1717,0x10e8,0x2027,0x1a4f)+_0x39e854+'\x0a',teks+=_0x4b485e[_0x313705(0x1cee,0x2123,0x1bc7,0x1aaa)];const _0x33449b={};_0x33449b[_0x23937d(0xa79,0xfa0,0xcfb,-0x89)]=_0x39e854;const _0x2497ef={};_0x2497ef[_0x313705(0x1fa9,0x23a1,0x1789,0x1a03)]=_0x33449b,_0x2497ef['caption']=teks,_0x175756['sendMessag'+'e'](_0x5cd288[_0x23937d(0x118c,0x1af0,0x1afd,0x209b)],_0x2497ef,{'quoted':_0x5cd288});break;case _0x4b485e[_0x313705(0xcc0,0x44c,0x1ad7,-0x1db)]:{if(_0x1bac1f)return _0x4b485e[_0x23937d(0xba,-0x32b,0x9c3,-0xb7f)](_0x1db05d,mess[_0x23937d(0x61c,0xe4a,0x12be,0x379)]);if(_0x1e03f5)return _0x4b485e['coykF'](_0x1db05d,mess[_0x313705(0x926,0x9fa,0x66,-0x2ec)]);if(!_0x494254)return _0x4b485e['IAqBi'](_0x1db05d,_0x23937d(0x363,0x864,-0x649,0x5d8)+_0x4b485e[_0x23937d(0x65f,0x13b2,0x3e4,-0x25f)](_0xe1d953,_0x1354e9)+_0x313705(0x1e7b,0x1046,0x2a96,0x1f21));let _0x52ad14=await _0x4b485e[_0x313705(0x1e76,0x1547,0x1dda,0x21bd)](fetchJson,_0x23937d(0x1449,0x2033,0x129d,0x1934)+'nzapis.xyz'+'/webzone/j'+_0x23937d(0x13e8,0x21e6,0x1cf5,0xbea)+_0x313705(0x1d82,0x1112,0x27b4,0x1fb8)+_0x494254+('&apikey=hd'+'iiofficial')),_0x4ee605='Jadwal\x20Bio'+_0x313705(0x1490,0xd95,0x1bed,0x848)+':\x20'+_0x494254+'\x0a\x0a';for(let _0x50f097 of _0x52ad14[_0x313705(0x1c63,0x1099,0x2973,0x21f4)]){_0x4ee605+=_0x23937d(0x1066,0x4f7,0x238,0xcf9)+_0x50f097[_0x23937d(0x17d9,0x128f,0x23d3,0x259d)]+'\x0a',_0x4ee605+=_0x23937d(0xc24,-0x1b9,-0x100,0x72e)+':\x20'+_0x50f097[_0x23937d(0x644,0x1336,0xd79,0x99f)]+'\x0a',_0x4ee605+=_0x313705(0x1d36,0x24b9,0x1658,0x1d4d)+_0x50f097[_0x23937d(0xa79,0x7f0,0x678,0x707)]+(_0x23937d(0xcf0,0x1634,0x196c,-0x6)+_0x313705(0x1cbb,0x1c99,0x1d3a,0x24af)+_0x23937d(0x11ae,0x1776,0x16c8,0x1507));}_0x175756['sendImage'](_0x5cd288['chat'],_0x52ad14[_0x313705(0x1c63,0x13eb,0x14a2,0x1d19)][-0x1a99+-0xd16+0x27af][_0x23937d(0x644,0x2e8,0x13c5,0xd69)],_0x4ee605,_0x5cd288);}break;case _0x313705(0x1262,0x1454,0xb50,0x1e95)+'x':{if(_0x1bac1f)return _0x4b485e['glecI'](_0x1db05d,mess[_0x23937d(0x61c,-0x165,0x5ed,0xe8a)]);if(_0x1e03f5)return _0x4b485e[_0x23937d(0x17ee,0xfe6,0x1498,0xbf8)](_0x1db05d,mess[_0x313705(0x926,0xa42,0xf7a,0x254)]);if(!q)return _0x4b485e['fJXaD'](_0x1db05d,_0x23937d(0x1335,0x1af6,0x4d4,0x4f7)+_0xe1d953+(_0x313705(0x1262,0x1fb3,0xbbe,0x164c)+_0x313705(0x1869,0x1f82,0x1580,0xac7))+_0xe1d953+(_0x23937d(0xefc,0x1426,0x1c8,0x20c)+_0x313705(0x870,0x952,0xb16,0x12a8)+_0x23937d(0x1828,0x204c,0x21a2,0x145a))+_0xe1d953+(_0x23937d(0xefc,0x1635,0x14cf,0x490)+_0x23937d(0x1405,0x22e3,0x1073,0x1bca)+'ggris\x0a')+_0xe1d953+(_0x313705(0x1262,0x107c,0x206c,0x107e)+_0x313705(0xd84,0x1164,-0x147,0xda9)+_0x313705(0x4a3,0x685,0xd48,0x545))+_0xe1d953+('shortstory'+_0x23937d(0x14,0x61a,-0x210,-0x4a7)+_0x23937d(0xc2a,0x1a3c,0x1685,-0x84))+_0xe1d953+('shortstory'+_0x313705(0x168b,0x18bc,0xa9a,0x2092))+_0xe1d953+(_0x313705(0x1262,0x517,0x18bb,0x124d)+_0x23937d(0x668,0x733,0x5d3,0x111e))+_0xe1d953+(_0x23937d(0xefc,0xebf,0x1020,-0x1c)+_0x23937d(0xc67,0x8,0x1573,0x1afc)+_0x313705(0x1417,0xe06,0x11a9,0x1d36))+_0xe1d953+(_0x23937d(0xefc,0xe18,0x1d03,0x1908)+_0x313705(0xe76,0x365,0xfec,0x6c2)+'tama\x0a')+_0xe1d953+(_0x313705(0x1262,0x444,0x1e80,0x753)+_0x313705(0x1f17,0x13d5,0x10a2,0x1615)+_0x23937d(0xbc,0xf79,0xde0,-0xb35))+_0xe1d953+(_0x23937d(0xefc,0x1c3d,0x654,0x1b26)+'\x20Cinta\x20Sed'+'ih\x0a')+_0xe1d953+(_0x23937d(0xefc,0x1b39,0x188f,0x662)+_0x23937d(0x549,0x721,0x12c4,0xf21)+'itiga\x0a')+_0xe1d953+(_0x313705(0x1262,0x754,0x1556,0x201b)+_0x313705(0xe54,0x5c6,0xb8c,0x12)+'ati\x0a')+_0xe1d953+(_0x313705(0x1262,0x1af9,0x1374,0x17cf)+_0x23937d(0x353,0xcc3,-0x969,-0x39c))+_0xe1d953+(_0x313705(0x1262,0x1e1b,0x1deb,0xb8b)+_0x313705(0x1154,0x117b,0x1599,0x297))+_0xe1d953+(_0x313705(0x1262,0x10dd,0xfe7,0x452)+_0x313705(0x14d6,0x11ef,0x1aba,0xd25)+'f\x0a')+_0xe1d953+(_0x23937d(0xefc,0x18a,0x624,0x674)+_0x313705(0x5fc,0x262,0xe18,0x27b))+_0xe1d953+('shortstory'+_0x313705(0x413,0x3c3,0x167,0x814)+'\x0a')+_0xe1d953+(_0x23937d(0xefc,0x1bff,0x179a,0x19f8)+'\x20Keluarga\x0a')+_0xe1d953+('shortstory'+'\x20Kisah\x20Nya'+_0x23937d(0x129e,0x1b3a,0x8a9,0xc03))+_0xe1d953+('shortstory'+_0x23937d(0x6c,0xa15,0x6a0,0x9d9))+_0xe1d953+(_0x313705(0x1262,0xc84,0x1b50,0x1d13)+_0x313705(0x135f,0xb1d,0x77b,0x1eb4))+_0xe1d953+(_0x313705(0x1262,0x839,0x1f85,0x55a)+_0x313705(0xb52,0x1816,0x1a02,0x1816))+_0xe1d953+(_0x313705(0x1262,0x7be,0x1cf5,0x924)+_0x313705(0xd20,0x19cf,0xd4e,0xfe)+'n\x0a')+_0xe1d953+('shortstory'+_0x313705(0x1e2c,0x299b,0x21bc,0x128d))+_0xe1d953+(_0x23937d(0xefc,0x1d25,0x118b,0x652)+_0x313705(0x1396,0x16a3,0xcb8,0xf63))+_0xe1d953+(_0x313705(0x1262,0x1e98,0x11b6,0x1781)+'\x20Mengharuk'+_0x313705(0x1b7b,0xc6a,0x1879,0x18f4))+_0xe1d953+(_0x313705(0x1262,0x39f,0x436,0x5b3)+_0x313705(0x1473,0xba5,0x1dbe,0x1cc9))+_0xe1d953+('shortstory'+'\x20Motivasi\x0a')+_0xe1d953+('shortstory'+_0x313705(0x1669,0x198e,0xcb1,0x106d))+_0xe1d953+(_0x313705(0x1262,0x19b9,0x1d0f,0x1ebb)+'\x20Nasionali'+_0x313705(0x394,-0x28c,0x313,0x5f9))+_0xe1d953+(_0x313705(0x1262,0x15fd,0x214a,0x1946)+'\x20Olahraga\x0a')+_0xe1d953+(_0x23937d(0xefc,0x1851,0x18dc,0x10a1)+_0x313705(0x1326,0x7b7,0xd1f,0x1ac2)+'i\x0a')+_0xe1d953+('shortstory'+_0x313705(0x15c8,0x2316,0xdc6,0x88f)+'\x0a')+_0xe1d953+(_0x313705(0x1262,0x117b,0xb74,0x842)+_0x23937d(0x1b48,0x227c,0xc7a,0x167d)+'n\x0a')+_0xe1d953+('shortstory'+'\x20Pengalama'+_0x23937d(0x10d7,0x1e41,0x36e,0x222))+_0xe1d953+('shortstory'+_0x23937d(0x7e0,-0x16c,0x35f,0xab4)+'an\x0a')+_0xe1d953+(_0x313705(0x1262,0x1ea2,0x1c9e,0xf4a)+_0x313705(0x1bb0,0x164d,0x279a,0x1169)+'n\x0a')+_0xe1d953+('shortstory'+'\x20Perjuanga'+'n\x0a')+_0xe1d953+(_0x23937d(0xefc,0xd4,0xa0f,0x921)+_0x23937d(0x8d9,0x6e5,0x6b,-0x418)+'n\x0a')+_0xe1d953+(_0x313705(0x1262,0x1d96,0x2135,0x20bd)+_0x23937d(0x1be9,0x114e,0x18b0,0x162a)+'tan\x0a')+_0xe1d953+('shortstory'+'\x20Petualang'+_0x23937d(0x1815,0x24fa,0x1e5b,0x1ade))+_0xe1d953+('shortstory'+_0x23937d(0x157f,0x2412,0x1635,0xaae))+_0xe1d953+('shortstory'+_0x313705(0x137b,0x1dd2,0x1d8f,0x1b53))+_0xe1d953+(_0x313705(0x1262,0x15d7,0xce9,0x1566)+_0x23937d(0x1d5,0x4c2,-0x77c,-0x486))+_0xe1d953+(_0x313705(0x1262,0x1588,0x471,0x7d8)+_0x313705(0x6c1,0xb4a,0x8f6,0x140a))+_0xe1d953+(_0x23937d(0xefc,0x1600,0x2d4,0x8f5)+_0x313705(0x1857,0xbf0,0x1b6c,0x25b0))+_0xe1d953+(_0x23937d(0xefc,0x280,0x79f,0x6b9)+'\x20Romantis\x0a')+_0xe1d953+('shortstory'+'\x20Sastra\x0a')+_0xe1d953+(_0x23937d(0xefc,0xc8b,0x1821,0x1809)+_0x23937d(0x18cd,0x241e,0x1843,0x16c5))+_0xe1d953+(_0x313705(0x1262,0x91c,0x3f5,0x14b1)+_0x313705(0x19ce,0xf2d,0x1032,0x1272))+_0xe1d953+('shortstory'+'\x20Slice\x20Of\x20'+_0x23937d(0x178a,0x1e28,0xe39,0x1d53))+_0xe1d953+(_0x23937d(0xefc,0xe02,0x1597,0xd85)+_0x23937d(0x672,0xc7b,-0x6f1,0x175)+'n\x0a')+_0xe1d953+(_0x313705(0x1262,0xdab,0xcf6,0x10b5)+_0x23937d(0xa13,0xe6,0x237,0x1f3)));let _0x1718ee=await _0x4b485e[_0x23937d(0xd9d,0xdaa,0x18e3,0x159e)](_0x1ae8f0,q);_0x4b485e[_0x313705(0xe34,0x1852,0x928,0x1cb4)](_0x1db05d,global[_0x313705(0x1127,0x1cfd,0x1642,0x17c4)+'i']+('\x20_*Title\x20:'+_0x23937d(0x1c5b,0x298f,0x1306,0x21f1))+_0x1718ee[_0x313705(0x1b3f,0x1a1f,0x289d,0x29cb)]+'\x0a'+global[_0x23937d(0xdc1,0x2f7,0x11ab,0xc0d)+'i']+(_0x313705(0x850,0xc9f,0x14fb,0x5b7)+':*_\x20')+_0x1718ee[_0x313705(0xa17,0x1792,0x718,0xe2)]+'\x0a'+global[_0x23937d(0xdc1,0x1166,0x1151,0x1721)+'i']+(_0x23937d(0xcb9,0x1016,0xc53,0x1736)+'y\x20:*_\x20')+_0x1718ee[_0x23937d(0xa33,0x824,0x1520,0x3f7)]+'\x0a'+global[_0x23937d(0xdc1,0xd8,0x1de,0xc87)+'i']+('\x20_*Pass\x20Mo'+_0x313705(0x187e,0xa53,0x188b,0x21f3)+_0x23937d(0x1c5b,0x26b2,0x22f4,0x2993))+_0x1718ee['lolos']+'\x0a'+global[_0x313705(0x1127,0x1e6d,0x1508,0x862)+'i']+(_0x23937d(0x568,0xc7d,-0x435,0x65b)+_0x23937d(-0x9,-0xb9a,-0x706,0x456))+_0x1718ee[_0x313705(0x68d,0x290,0x657,-0x38f)]);}break;case _0x23937d(0x1624,0x18bb,0x1c94,0xbb8)+_0x313705(0x36a,0x103c,-0xa01,0x15d):{if(_0x1bac1f)return _0x4b485e[_0x23937d(0x1a81,0x113b,0x1979,0x1694)](_0x1db05d,mess[_0x313705(0x982,0x87b,0x15c4,0x3e1)]);if(_0x1e03f5)return _0x1db05d(mess['banChat']);let _0x22580f=await _0x1ae8f0(_0x313705(0xccd,0x4a6,0x82c,0x47c)+_0x313705(0x849,0xb7d,0x1f6,0xb4b));_0x1db05d(dragonemoji+(_0x313705(0x1ad4,0x1294,0x23ab,0x1942)+'*_\x20')+_0x22580f[_0x23937d(0x17d9,0x13c4,0x10c0,0x20ea)]+'\x0a'+dragonemoji+('\x20_*Author\x20'+_0x23937d(0x1001,0x1af6,0x1a55,0x213))+_0x22580f[_0x23937d(0x6b1,0xc50,0xa85,0x1134)]+'\x0a'+dragonemoji+(_0x23937d(0xcb9,0x160b,0x60f,0xda6)+'y\x20:*_\x20')+_0x22580f['kategori']+'\x0a'+dragonemoji+('\x20_*Pass\x20Mo'+_0x23937d(0x1518,0x1669,0xa0c,0x19f3)+_0x23937d(0x1c5b,0x1569,0x152c,0x1e58))+_0x22580f[_0x313705(0x1833,0x25b8,0x1c6b,0xa21)]+'\x0a'+dragonemoji+(_0x23937d(0x568,0x69a,-0x2bc,0xf0)+_0x23937d(-0x9,0x9c1,-0xca4,-0x70c))+_0x22580f[_0x23937d(0x327,0x8b,0xd90,0xf34)]);}break;case _0x23937d(0x29d,-0x2e2,0xa23,-0xa80)+_0x23937d(0x5ca,0x96d,0x111a,0x116a):{if('HpBDn'===_0x4b485e['oYQjt'])_0x4b485e[_0x23937d(0x34b,0xfd5,0x950,-0x568)](_0x275139,'⚠️\x20Please\x20i'+'nsert\x20a\x20va'+_0x313705(0xd55,0xed2,0x1917,0xbd9)+'!');else{if(_0x1bac1f)return _0x4b485e[_0x23937d(0x17cf,0x1ccb,0x20d3,0x18cf)](_0x1db05d,mess['ban']);if(_0x1e03f5)return _0x4b485e['TXEeE'](_0x1db05d,mess[_0x23937d(0x5c0,0x132,0x52a,0x59c)]);let _0x59851f=await _0x4b485e[_0x313705(0x1bc4,0xddd,0x2753,0x1c38)](_0x1ae8f0,_0x23937d(0x967,0x369,0xdd7,0x1494)+_0x23937d(0x4e3,-0x3b7,0x1324,-0x90e));_0x1db05d(dragonemoji+(_0x313705(0x1ad4,0x1b15,0x208a,0x239f)+_0x23937d(0x1c5b,0x1eec,0x165a,0x2b17))+_0x59851f[_0x313705(0x1b3f,0x1b86,0x1ad8,0x107b)]+'\x0a'+dragonemoji+(_0x23937d(0x4ea,-0x794,0x120e,-0x9a8)+':*_\x20')+_0x59851f[_0x313705(0xa17,0xeb7,0x632,0xa31)]+'\x0a'+dragonemoji+(_0x23937d(0xcb9,0x198d,0x8de,0xbbb)+_0x23937d(0x1dca,0x1a57,0x1e20,0x2c7a))+_0x59851f[_0x313705(0xd99,0x1185,0x4e4,0x162d)]+'\x0a'+dragonemoji+(_0x313705(0x16f3,0x2178,0x192b,0x1de6)+_0x313705(0x187e,0xc8d,0x158c,0x1bf3)+_0x23937d(0x1c5b,0x13f8,0x23c3,0x1531))+_0x59851f[_0x23937d(0x14cd,0x105f,0x1431,0xc42)]+'\x0a'+dragonemoji+(_0x23937d(0x568,0xfdf,0xb65,-0x4b5)+_0x313705(0x35d,0x106c,0x2bc,-0x5c8))+_0x59851f[_0x23937d(0x327,0x22,-0x783,0x8b1)]);}}break;case _0x23937d(0x130a,0x219b,0x14bf,0x16fd)+_0x313705(0xf7b,0x2a4,0x1106,0x1a4d)+'x':{if(_0x1bac1f)return _0x4b485e['ZEtxZ'](_0x1db05d,mess['ban']);if(_0x1e03f5)return _0x1db05d(mess['banChat']);let _0x40b762=await _0x4b485e[_0x313705(0x18e1,0x1aac,0x16cf,0x273b)](_0x1ae8f0,'galau');_0x4b485e[_0x313705(0x71c,0x22e,0x5b5,-0x644)](_0x1db05d,dragonemoji+(_0x23937d(0x176e,0x12a0,0x258e,0x1009)+_0x313705(0x1fc1,0x10b5,0x1126,0x18a1))+_0x40b762['title']+'\x0a'+dragonemoji+(_0x23937d(0x4ea,0x131e,0x1030,0x30f)+':*_\x20')+_0x40b762[_0x23937d(0x6b1,0x103e,-0x284,0xc08)]+'\x0a'+dragonemoji+(_0x313705(0x101f,0xcfb,0x1739,0x198b)+'y\x20:*_\x20')+_0x40b762[_0x23937d(0xa33,-0x2a8,0x158,0xd25)]+'\x0a'+dragonemoji+(_0x313705(0x16f3,0x22f2,0x15df,0xdd0)+_0x23937d(0x1518,0x1ce7,0x13fd,0x1bf6)+'*_\x20')+_0x40b762['lolos']+'\x0a'+dragonemoji+('\x20_*Story\x20:'+_0x313705(0x35d,0x546,-0x1ea,0x78e))+_0x40b762['cerita']);}break;case _0x4b485e[_0x313705(0x1720,0x1f61,0x16e1,0x16af)]:{if(_0x1bac1f)return _0x4b485e[_0x313705(0x540,0x11b2,0x8b0,0xa60)](_0x1db05d,mess[_0x23937d(0x61c,-0x19b,-0x31d,0x7d9)]);if(_0x1e03f5)return _0x1db05d(mess[_0x23937d(0x5c0,0x1468,0x6e0,-0x735)]);let _0x25f9cc=await _0x1ae8f0(_0x313705(0x1ef6,0x239e,0x1203,0x1746)+'an');_0x4b485e[_0x313705(0x78c,0xee5,0x151c,0x825)](_0x1db05d,dragonemoji+('\x20_*Title\x20:'+'*_\x20')+_0x25f9cc[_0x23937d(0x17d9,0x18d2,0x215a,0xe38)]+'\x0a'+dragonemoji+(_0x23937d(0x4ea,0xaf7,0xda7,0xb19)+_0x23937d(0x1001,0x1190,0x1942,0xd4b))+_0x25f9cc[_0x23937d(0x6b1,0x1d3,-0x8d,0x865)]+'\x0a'+dragonemoji+(_0x23937d(0xcb9,0x7bf,0x18f7,0x3d)+'y\x20:*_\x20')+_0x25f9cc[_0x23937d(0xa33,0xaf3,0x1771,0xb19)]+'\x0a'+dragonemoji+(_0x313705(0x16f3,0x1535,0x253a,0x1461)+'deration\x20:'+_0x23937d(0x1c5b,0x21c2,0x1149,0x2057))+_0x25f9cc[_0x313705(0x1833,0x9f2,0x1ed4,0x1976)]+'\x0a'+dragonemoji+('\x20_*Story\x20:'+_0x313705(0x35d,0x66e,0x11f9,-0x11))+_0x25f9cc[_0x313705(0x68d,0xf50,0x506,0x1326)]);}break;case _0x4b485e[_0x313705(0x100e,0x1e7a,0x749,0x4db)]:{if(_0x1bac1f)return _0x4b485e[_0x313705(0x1340,0x1e60,0x169e,0x1ea7)](_0x1db05d,mess[_0x313705(0x982,0x4a4,0xb56,0xb90)]);if(_0x1e03f5)return _0x4b485e[_0x313705(0x13d2,0x513,0x1239,0x1c66)](_0x1db05d,mess['banChat']);let _0xc28fb9=await _0x1ae8f0('Pengorbana'+'n');_0x4b485e[_0x313705(0x8be,-0x322,0x153d,-0x3f8)](_0x1db05d,dragonemoji+('\x20_*Title\x20:'+'*_\x20')+_0xc28fb9[_0x23937d(0x17d9,0xedb,0x1b5d,0x129b)]+'\x0a'+dragonemoji+(_0x23937d(0x4ea,0x1103,0x714,-0x85b)+':*_\x20')+_0xc28fb9['author']+'\x0a'+dragonemoji+('\x20_*Categor'+'y\x20:*_\x20')+_0xc28fb9['kategori']+'\x0a'+dragonemoji+(_0x23937d(0x138d,0x15d9,0x1051,0x2254)+_0x23937d(0x1518,0xad9,0x1627,0x1f86)+'*_\x20')+_0xc28fb9['lolos']+'\x0a'+dragonemoji+('\x20_*Story\x20:'+_0x23937d(-0x9,0xd9,-0x6d3,0xcf6))+_0xc28fb9[_0x313705(0x68d,0x13b4,0x6b4,0x14f)]);}break;case _0x4b485e['fxtRT']:case _0x4b485e['GXFhi']:{if(_0x1bac1f)return _0x4b485e[_0x23937d(0x13b0,0x1bba,0x21f0,0x14fb)](_0x1db05d,mess[_0x23937d(0x61c,0xb8a,-0x3f1,0x34d)]);if(_0x1e03f5)return _0x4b485e[_0x313705(0x14fe,0x1157,0x1c1f,0x97e)](_0x1db05d,mess[_0x313705(0x926,0x11cc,0xcf2,0x127b)]);_0x4b485e[_0x23937d(0x1a9b,0x14cd,0x260b,0x23dc)](_0x1db05d,mess[_0x313705(0xc12,0x455,0x30e,0x92e)]);let _0x2c7b7c=await _0x4b485e['eZROa'](fetchJson,_0x4b485e[_0x23937d(0x75c,0x1507,-0x6ba,-0x68f)]),_0x5b836b=_0x2c7b7c[Math[_0x313705(0xb57,0x13b5,0xa31,0x1d0)](_0x4b485e[_0x313705(0x353,0x929,-0x6f0,0x138)](Math['random'](),_0x2c7b7c[_0x313705(0x744,0x365,0x1155,0xf6e)]))];const _0x90cc61={};_0x90cc61['url']=_0x5b836b[_0x23937d(0xe96,0x17e2,0x64f,0x14c3)];const _0x2fd31a={};_0x2fd31a['image']=_0x90cc61,_0x2fd31a[_0x23937d(0x968,0xde6,0xa02,0x936)]=_0x313705(0x357,-0x1ea,-0x602,-0x818)+_0x313705(0x20f3,0x2cbb,0x2d03,0x1ea2),_0x175756[_0x313705(0xcaa,-0x39,-0x1eb,0xc7d)+'e'](_0x5cd288[_0x313705(0x14f2,0x1943,0x18d6,0x1eaf)],_0x2fd31a,{'quoted':_0x5cd288});const _0x53b755={};_0x53b755[_0x23937d(0xa79,0xc5c,0x973,0xb6e)]=_0x5b836b['female'];const _0x19d865={};_0x19d865[_0x23937d(0x1c43,0x1692,0x1e01,0x123d)]=_0x53b755,_0x19d865[_0x23937d(0x968,0x1540,0xa48,0x3b3)]='Couple\x20Fem'+_0x313705(0x1780,0x100c,0xdfe,0x13f4),_0x175756[_0x313705(0xcaa,0x1b3,0x109d,0x74e)+'e'](_0x5cd288[_0x23937d(0x118c,0x3aa,0x10a8,0x19b7)],_0x19d865,{'quoted':_0x5cd288});}break;case _0x4b485e[_0x23937d(0x67b,0x14dc,0x79e,0xd1f)]:case _0x4b485e[_0x313705(0x1db3,0x17ba,0x135b,0x19fa)]:{if(_0x4b485e[_0x313705(0xb91,0x1851,0xa00,0x50c)](_0x4b485e['AMFuL'],_0x313705(0x41e,0x14c,0x538,0x25))){if(_0x1bac1f)return _0x4b485e[_0x313705(0x18df,0x18bf,0x2171,0x26f8)](_0x1db05d,mess[_0x23937d(0x61c,0x14b1,0x2c8,0xafe)]);if(_0x1e03f5)return _0x4b485e[_0x313705(0x5ca,0x10b8,-0x446,0xc47)](_0x1db05d,mess[_0x313705(0x926,0x920,0x2e,0x7d2)]);let {quotesAnime:_0x3e6256}=_0x4b485e['nBzdE'](require,_0x4b485e[_0x23937d(0x9a6,0xf0d,0x106e,-0x16)]),_0x11e6c8=await _0x4b485e[_0x23937d(0x131c,0x6a5,0x956,0x497)](_0x3e6256);_0x4b172e=_0x11e6c8[Math[_0x23937d(0x7f1,-0x3b3,0xd1f,-0x644)](_0x4b485e[_0x23937d(0xb17,0x958,0x4f0,0x1214)](Math['random'](),_0x11e6c8['length']))];const _0x1dad93={};_0x1dad93[_0x313705(0x175a,0x1fa2,0x2040,0x1465)+'t']=_0x4b485e[_0x313705(0x1227,0x858,0xeb5,0x1f8a)];const _0x4defd2={};_0x4defd2[_0x313705(0x1e72,0x1b2a,0x275e,0xf98)]=_0x313705(0x10d7,0x1d1a,0xac8,0x32b)+'e',_0x4defd2['buttonText']=_0x1dad93,_0x4defd2[_0x313705(0xa9e,0x130,0x1727,0x1797)]=0x1;let _0x72d972=[_0x4defd2];const _0x336836={};_0x336836[_0x23937d(0x1d39,0x1ef8,0x25c6,0xe4a)]='~_'+_0x4b172e[_0x23937d(0x18d7,0x1ce5,0x13b6,0x25ba)]+_0x313705(0x1d44,0x272a,0x1b5e,0x2138)+_0x4b172e[_0x23937d(0x2fb,-0x413,-0x4f1,-0x250)]+_0x23937d(-0x26,0xb3b,-0x551,0x612)+_0x4b172e[_0x23937d(0x1a0c,0x1f9c,0x10f5,0x1112)]+_0x313705(0x2002,0x18a7,0x2b11,0x2c23)+_0x4b172e['up_at'],_0x336836['footer']=_0x4b485e[_0x23937d(0x7f8,0x35a,0x93f,0x1102)],_0x336836[_0x23937d(0xc3a,0x15cb,0xb81,0x43e)]=_0x72d972,_0x336836[_0x313705(0x1e7f,0x20a7,0x1b96,0x27de)]=0x2;let _0x553187=_0x336836;_0x175756['sendMessag'+'e'](_0x5cd288[_0x313705(0x14f2,0x19ba,0x1c77,0x15d6)],_0x553187,{'quoted':_0x5cd288});}else _0x4b485e[_0x313705(0x1a00,0x19fa,0x23f0,0x156b)](_0x5a249a,_0x23937d(0x2a1,0xf02,0xae6,-0xc5f)+'n\x20Successf'+_0x313705(0xbe5,0x8f1,0x165b,0x69d)+_0x23937d(0x1dc8,0x2988,0x1b43,0x28f8)+_0x23937d(0x852,0x12e2,-0x395,0x1665)+_0x4b485e[_0x23937d(0x11b6,0x1b37,0x1aa0,0x16fd)](_0x2748f2,_0x117dff[_0x23937d(0x14ce,0x20ae,0x184b,0xeb6)])+(_0x23937d(0x1bc4,0x16ec,0x226e,0x1552)+'aining\x20Fis'+_0x23937d(0x7fb,0x972,-0x11d,0x1146))+_0x4b485e[_0x313705(0x7a6,0x12d7,0x1151,-0x60b)](_0x1851ce,_0x1b40ba[_0x313705(0x1834,0x1d5a,0x2462,0x268c)]));}break;case _0x4b485e[_0x23937d(0x8b4,0x169a,0xc56,0x8f7)]:case _0x313705(0x677,0xa9b,0xb91,0x110a):if(_0x1bac1f)return _0x4b485e[_0x23937d(0x8a7,0x17c3,-0x3e0,0x236)](_0x1db05d,mess[_0x313705(0x982,0xc2c,0xdbd,0xb5c)]);if(_0x1e03f5)return _0x1db05d(mess['banChat']);if(_0x4b485e[_0x23937d(-0x6,0x7d9,-0x211,0xbc7)](_0x1ba32f[_0x23937d(0x3de,0xed5,-0xb15,-0x241)],-0x13*-0xa9+-0x750+-0x53a))return _0x1db05d(_0x4b485e['Mwzir']);const _0x102c09=await KUMUTHUWiki(q)['catch'](_0x4f7d5d=>{return _0x1db05d(_0x4b485e['zWmMC']);}),_0xd4277b='*Title\x20:*\x20'+_0x102c09[0x183d+0x19*0x1f+-0x1b44*0x1][_0x23937d(0x15da,0xdc5,0x15e7,0xe8f)]+_0x23937d(0x15a,-0xbbc,0x501,-0x44b)+_0x102c09[-0x455*-0x2+-0x1*0x1e53+0x15a9][_0x23937d(0xeb6,0xc94,0x13e3,0x240)],_0x34c765={};_0x34c765[_0x313705(0xddf,0x1055,0x510,-0x137)]=_0x102c09[-0x7*-0x269+0x4cb+-0x15aa*0x1][_0x23937d(0x644,-0x43c,-0x735,-0xce)];const _0x28230c={};_0x28230c['image']=_0x34c765,_0x28230c[_0x23937d(0x968,0x376,0x20,0x353)]=_0xd4277b,_0x175756[_0x23937d(0x944,-0x4b4,0x161a,0xd27)+'e'](_0x423161,_0x28230c);break;case _0x4b485e[_0x313705(0x200f,0x1545,0x20ea,0x27ae)]:{if(_0x1bac1f)return _0x1db05d(mess[_0x313705(0x982,0xc02,0x8aa,0x6e)]);if(_0x1e03f5)return _0x4b485e[_0x313705(0xbf8,0xa1d,-0x305,0x1318)](_0x1db05d,mess[_0x23937d(0x5c0,-0x1ec,-0x67a,-0x8a9)]);if(!_0x494254)return _0x4b485e[_0x23937d(0xa51,0x4bf,0x1044,0x226)](_0x1db05d,_0x313705(0xb26,-0x2fa,0x5d4,0xd6c)+_0x23937d(0xa3a,0x105c,0x1838,0x611));let {wikimedia:_0x3071c1}=require(_0x4b485e[_0x23937d(0x18c1,0x10a5,0x1f4d,0x14ee)]);_0x12b240=await _0x3071c1(_0x494254),_0x4b172e=_0x12b240[Math[_0x313705(0xb57,-0x373,0x11d5,0x1504)](Math[_0x313705(0x1ae0,0x2168,0x19ec,0x23ce)]()*_0x12b240[_0x313705(0x744,0x148a,0x100f,-0x196)])];const _0x19e5a8={};_0x19e5a8['displayTex'+'t']=_0x4b485e[_0x313705(0x61c,-0x7b6,0x124e,0x13d)];const _0x33d0c6={};_0x33d0c6[_0x313705(0x1e72,0x1043,0x27ba,0x1936)]='wikimedia\x20'+_0x494254,_0x33d0c6[_0x313705(0x1902,0xc2c,0x203a,0x1318)]=_0x19e5a8,_0x33d0c6['type']=0x1;let _0x23897f=[_0x33d0c6];const _0x1bb63f={};_0x1bb63f['url']=_0x4b172e['image'];const _0x546fe3={};_0x546fe3[_0x313705(0x1fa9,0x2229,0x2037,0x1a94)]=_0x1bb63f,_0x546fe3[_0x313705(0xcce,-0x14c,0x741,0xaa0)]=dragonemoji+_0x23937d(0x1130,0x1bfa,0x1a22,0x19f8)+_0x4b172e[_0x313705(0x1b3f,0xc3e,0x27bd,0x13a3)]+'\x0a'+dragonemoji+_0x23937d(0x4d2,0x967,0xfb8,0x8aa)+_0x4b172e[_0x313705(0xce7,-0xcd,0x556,0xac7)]+'\x0a'+dragonemoji+(_0x23937d(0x122a,0x20a7,0xdbf,0xa5a)+'\x20:\x20')+_0x4b172e[_0x313705(0x1fa9,0x2013,0x2839,0x1b10)],_0x546fe3[_0x23937d(0x106e,0xc43,0x155d,0x1c2f)]=_0x175756[_0x313705(0x787,0x653,-0x1b5,-0x512)]['name'],_0x546fe3[_0x313705(0xfa0,0x39c,0x9cb,0x6b2)]=_0x23897f,_0x546fe3[_0x313705(0x1e7f,0x29b0,0x1d6d,0x2775)]=0x4;let _0x12491d=_0x546fe3;_0x175756[_0x23937d(0x944,0x263,0x144e,0x1196)+'e'](_0x5cd288[_0x23937d(0x118c,0x2a9,0x1ea1,0x17cc)],_0x12491d,{'quoted':_0x5cd288});}break;case _0x4b485e[_0x313705(0x1632,0x22bc,0x1881,0xf9f)]:case _0x4b485e['wIxhB']:case _0x4b485e['TigiB']:case _0x4b485e[_0x23937d(0xa83,0x1714,0x46a,0x9b5)]:{if(_0x1bac1f)return _0x4b485e[_0x313705(0x64a,-0x6d8,-0x4ee,0x258)](_0x1db05d,mess[_0x313705(0x982,0x490,-0x36c,0x16b8)]);if(_0x1e03f5)return _0x4b485e[_0x313705(0x10bf,0x1a30,0xbdf,0x17c8)](_0x1db05d,mess[_0x23937d(0x5c0,0xa70,0x815,0x1187)]);let {quotesAnime:_0x17198b}=_0x4b485e[_0x23937d(0x18c6,0xefd,0x2668,0x1c30)](require,_0x23937d(0x1a4e,0x16fa,0x1cf9,0xcbb)+_0x313705(0x9b9,-0x310,-0x4ab,0x17d3)),_0x43426f=await _0x4b485e[_0x23937d(0x3da,0xad2,0x73d,0xccf)](_0x17198b);_0x4b172e=_0x43426f[Math[_0x23937d(0x7f1,0x758,0x115c,0x7d2)](_0x4b485e[_0x313705(0x188a,0x239c,0x1ea5,0x1556)](Math[_0x23937d(0x177a,0x217b,0x863,0xeb2)](),_0x43426f['length']))];const _0x2d2e97={};_0x2d2e97[_0x313705(0x175a,0x238b,0x14b7,0x23a3)+'t']='➡️Next➡️';const _0x16218c={};_0x16218c[_0x313705(0x1e72,0x2500,0x1184,0x2ca0)]=_0x23937d(0xd71,0x1077,0xdb5,0x5e4)+'e',_0x16218c['buttonText']=_0x2d2e97,_0x16218c[_0x23937d(0x738,0x623,0x640,0xaf3)]=0x1;let _0x20cc14=[_0x16218c];const _0x1bd94e={};_0x1bd94e['text']='~_'+_0x4b172e[_0x313705(0x1c3d,0x2681,0x148f,0x1282)]+_0x23937d(0x19de,0xb59,0x22ed,0x2688)+_0x4b172e[_0x23937d(0x2fb,-0x4e4,-0xbeb,0x8b3)]+_0x23937d(-0x26,0x884,-0xb60,-0x95)+_0x4b172e['anime']+_0x313705(0x2002,0x11cd,0x14ff,0x12fd)+_0x4b172e['up_at'],_0x1bd94e[_0x23937d(0x106e,0x13b3,0x16b8,0xc97)]=_0x4b485e[_0x313705(0xb5e,0x16da,0x1753,0x1091)],_0x1bd94e[_0x23937d(0xc3a,0xb07,0x12c,0x14eb)]=_0x20cc14,_0x1bd94e[_0x23937d(0x1b19,0x18ae,0x1542,0x1cdf)]=0x2;let _0x148f76=_0x1bd94e;_0x175756[_0x23937d(0x944,0x574,0x402,-0x111)+'e'](_0x5cd288['chat'],_0x148f76,{'quoted':_0x5cd288});}break;case _0x313705(0x1fe3,0x23e4,0x22e3,0x1e54):{if(_0x4b485e[_0x313705(0x1d7f,0x21a5,0x14f5,0x2bcd)]!==_0x23937d(0x1016,0x14f9,0x1b2a,0x1ace)){const _0x6ae7d8={};_0x6ae7d8[_0x313705(0x209f,0x25cf,0x200a,0x25af)]=_0x23937d(0xecf,0x1c63,0x116,0x39b),_0x6ae7d8[_0x313705(0xcb5,0x525,0x2b8,0xb5c)]=_0x5cd288[_0x313705(0xcb5,-0x178,0x1d,0x9f)];const _0x507a62={};_0x507a62[_0x313705(0x1d20,0x1770,0x1ea7,0x1f5c)]=_0x6ae7d8,_0x175756[_0x313705(0xcaa,0x14e8,0x1815,-0x88)+'e'](_0x423161,_0x507a62);if(_0x1bac1f)return _0x1db05d(mess[_0x313705(0x982,0xd08,0x1640,0xd45)]);if(_0x1e03f5)return _0x4b485e[_0x23937d(0x1b7c,0x2215,0xd25,0xe31)](_0x1db05d,mess[_0x313705(0x926,0x1704,0x29a,0x12e8)]);if(!_0x494254)return _0x4b485e['WsOvE'](_0x1db05d,_0x4b485e[_0x23937d(0x118e,0x15da,0x5d7,0x20a0)]);_0x4b485e[_0x23937d(0x154,-0xa04,0xe9c,-0xc48)](_0x1db05d,mess[_0x313705(0xc12,0x1a31,0x13bf,0x10d)]);if(!_0x1ba32f[0x19*-0xc5+-0x1d7d+0x30ba][_0x23937d(0x178,0x659,-0x45e,-0x8f9)](_0x4b485e['njNbF']))return _0x4b485e[_0x23937d(0x103d,0x16a8,0xdbb,0x85f)](_0x1db05d,_0x23937d(0x92e,0x25e,0xc32,0x783)+_0x23937d(0x1d3d,0x2bcf,0x1ce2,0x1c67));const _0x53c30b={};_0x53c30b[_0x23937d(0x13f4,0x79f,0xf14,0x21d0)+'t']=_0x4b485e[_0x313705(0x11b8,0x1566,0x99f,0x97d)];const _0x24d615={};_0x24d615[_0x23937d(0x1b0c,0x214e,0x123b,0x2844)]=_0x313705(0x1a64,0x147d,0xe76,0x1ef7)+_0x494254,_0x24d615[_0x313705(0x1902,0x1fad,0x2150,0x1a11)]=_0x53c30b,_0x24d615[_0x313705(0xa9e,0x213,0x9e5,0x774)]=0x1;const _0x603255={};_0x603255[_0x313705(0x175a,0x15d9,0x1962,0xaaf)+'t']=_0x313705(0x154b,0x1c15,0xb48,0x9c6)+'❯';const _0x2e7778={};_0x2e7778['buttonId']='tiktokaud\x20'+_0x494254,_0x2e7778[_0x313705(0x1902,0x1f18,0x19d2,0x2479)]=_0x603255,_0x2e7778[_0x313705(0xa9e,-0x118,0x60f,-0x417)]=0x1;const _0x4b37f7={};_0x4b37f7[_0x313705(0x175a,0x12a8,0xe89,0x1219)+'t']=_0x4b485e['PCNsV'];const _0x54185a={};_0x54185a['buttonId']=_0x313705(0x3d3,0xcca,0x26f,0x561)+_0x494254,_0x54185a[_0x23937d(0x159c,0x226d,0xe8d,0x1fab)]=_0x4b37f7,_0x54185a[_0x313705(0xa9e,0x17bd,0x9ee,0xe03)]=0x1;let _0x33c691=[_0x24d615,_0x2e7778,_0x54185a];const _0x54ca3f={};_0x54ca3f[_0x313705(0xddf,0x1c23,0xa04,0x1bc9)]=_0x4b485e[_0x23937d(0x42e,0x96c,0x266,-0x8b3)];const _0x548a9e={};_0x548a9e[_0x23937d(0x1c43,0x2710,0xdf4,0x13b6)]=_0x54ca3f,_0x548a9e['caption']=_0x313705(0xb7c,0xc48,0xd64,0xcb6)+_0x23937d(0x1026,0x310,0x8a6,0x1552)+_0x313705(0x20c0,0x234f,0x285b,0x2328)+_0x313705(0xdec,0xf1a,0x18cc,0x16f0)+_0x23937d(0x165f,0x13ee,0x8b3,0x2191)+'ᴅᴇʀ\x0a╚═════'+_0x23937d(0x14e0,0x1a4c,0x1028,0x981)+'═',_0x548a9e[_0x313705(0x13d4,0xce9,0x164f,0x182b)]=_0x175756[_0x313705(0x787,0xbfc,0x1011,0x15b3)]['name'],_0x548a9e[_0x313705(0xfa0,0x5d5,0xc9d,0x1a7a)]=_0x33c691,_0x548a9e[_0x313705(0x1e7f,0x25aa,0x1db6,0x2b8e)]=0x4;let _0x1a3670=_0x548a9e;_0x175756[_0x313705(0xcaa,0x149c,0x31,0x3c7)+'e'](_0x5cd288[_0x313705(0x14f2,0x13d1,0x87a,0x768)],_0x1a3670,{'quoted':_0x5cd288});}else _0x4b485e[_0x313705(0x8a9,-0x235,0x14b7,-0x576)](_0x58eb77,_0x4b485e[_0x23937d(0x6a1,0x13d5,0x625,0x1119)]);}break;case _0x313705(0xf9e,0x11b7,0x1b66,0xb19):{const _0x42cef8={};_0x42cef8['text']=_0x23937d(0x816,-0x463,-0x351,0x49f)+_0x313705(0x138c,0x1151,0x1c3f,0x889)+'📤ʀᴇᴅ\x20ᴅʀᴀɢᴏ'+'ɴ📤\x0a╠\x20🪣ᴛɪᴋᴛ'+_0x23937d(0xaed,0x198a,0x1ed,0xe9b)+_0x313705(0x15f6,0x1ea1,0xf2b,0xf37)+_0x23937d(0xfa9,0x53c,0x14d3,0x7f3)+_0x313705(0x1846,0x19ca,0x1a32,0x1f2f)+'══════',_0x175756[_0x23937d(0x944,0xfb9,0xf27,0x116d)+'e'](_0x5cd288[_0x23937d(0x118c,0x16e3,0x633,0x1c17)],_0x42cef8,{'quoted':_0x5cd288});let _0x21499e=_0x4b485e[_0x313705(0x44f,-0x3cf,0x417,-0x746)](require,_0x4b485e[_0x313705(0x1023,0x1176,0x5be,0x17a4)]);_0x21499e[_0x313705(0xe6f,0x1139,0x92a,0x4a8)](''+_0x494254)[_0x23937d(0x1b61,0x25d8,0x227d,0x1680)](async _0x566339=>{function _0x3770b0(_0x38a5d6,_0x652f06,_0xb9bae1,_0x1d8409){return _0x23937d(_0xb9bae1- -0x1a6,_0x38a5d6,_0xb9bae1-0x58,_0x1d8409-0xd9);}function _0x43beca(_0x31a821,_0x487386,_0x1019f2,_0x166288){return _0x23937d(_0x31a821-0x464,_0x487386,_0x1019f2-0x103,_0x166288-0x1e1);}if(_0x4b485e[_0x3770b0(0xbf0,0x162,0x3f2,-0xda)](_0x4b485e[_0x43beca(0xc46,0xad,0x176e,0x347)],_0x4b485e[_0x3770b0(0xf0c,-0x518,0x63c,0x450)])){const _0x3dc6b2={};_0x3dc6b2[_0x3770b0(0x1e21,0x25b4,0x1b93,0x1f6a)]=''+_0x2e5ad6['K53'];const _0x11cfeb={};_0x11cfeb[_0x43beca(0xa40,0xeb7,-0x305,0xf13)]=_0x1bea49,_0x1ae14e[_0x3770b0(-0x2a,0x1d7,0x79e,0xea)+'e'](_0x5052ce[_0x43beca(0x15f0,0x138a,0x1a4b,0x19e8)],_0x3dc6b2,_0x11cfeb);}else{const _0xceeb53={};_0xceeb53[_0x3770b0(0x174b,0xdfb,0x8d3,0x1235)]=_0x566339[_0x43beca(0xedd,0xaf6,0x13b3,0x1c4d)][0x1f5f+-0xa21+-0x153e][_0x3770b0(0xbd4,-0xc,0x8d3,0x1282)];const _0x32ae4d={};_0x32ae4d[_0x3770b0(0x1c69,0x2395,0x15bc,0xa41)]=_0xceeb53,_0x32ae4d['mimetype']=_0x4b485e[_0x43beca(0x18c4,0xf05,0x1038,0x141f)],_0x175756[_0x43beca(0xda8,0x695,0x4fe,0xb59)+'e'](_0x5cd288['chat'],_0x32ae4d,{'quoted':_0x5cd288});}})['catch'](_0x56abfc=>{function _0x566d6f(_0x42135e,_0x347eba,_0x32df0c,_0x3b1361){return _0x23937d(_0x32df0c-0x142,_0x42135e,_0x32df0c-0x22,_0x3b1361-0xdb);}function _0x31401f(_0x5ed204,_0x54a037,_0xec6a41,_0x31bd2a){return _0x23937d(_0x5ed204-0x2f7,_0xec6a41,_0xec6a41-0x197,_0x31bd2a-0xa6);}_0x4b485e[_0x31401f(0x900,0x1591,-0x2d6,0x530)](_0x1db05d,_0x31401f(0x36a,0xd1c,-0x8be,0xe6d)+_0x31401f(0x169f,0x815,0x1559,0x14dd)+_0x566d6f(0x1475,0x123e,0xb31,0x1691)+'!');});}break;case _0x4b485e[_0x23937d(0x10ec,0x326,0x1516,0x1ef3)]:{let _0x2b5396=_0x4b485e[_0x313705(0x209d,0x2d23,0x284c,0x2eeb)](require,_0x4b485e[_0x313705(0x1023,0x987,0x432,0xf15)]);_0x2b5396['savefrom'](''+_0x494254)[_0x313705(0x1ec7,0x1eff,0x2476,0x2aec)](async _0xc0c15=>{const _0x8e1626={};_0x8e1626['text']=_0x6c5860(0x107e,0x83a,0xb9e,-0x176)+_0x27b73a(0x14ea,0x11b9,0x690,0x1d8c)+_0x27b73a(0x1c92,0x1d4f,0x1471,0x1f2b)+_0x27b73a(0x6c,0xa1a,0x1169,0x17d9)+_0x6c5860(0x477,0x1ef8,0x12d6,0x891)+_0x6c5860(0x463,0xd89,0xc09,0x10e0)+_0x27b73a(0xf57,0x1673,0x1585,0xd19)+'══',_0x175756['sendMessag'+'e'](_0x5cd288[_0x6c5860(0x8bb,0x1dba,0x1514,0xfa4)],_0x8e1626,{'quoted':_0x5cd288});const _0x5b983f={};_0x5b983f['url']=_0xc0c15['url'][0x1eb5+0x4cd*-0x3+0x1*-0x104e][_0x6c5860(0x9fe,0x1cad,0xe01,0x189a)];const _0x3f892e={};function _0x6c5860(_0x53963c,_0x21f0c0,_0x50deb3,_0x51ac76){return _0x23937d(_0x50deb3-0x388,_0x51ac76,_0x50deb3-0xef,_0x51ac76-0xbb);}_0x3f892e[_0x27b73a(0x1db1,0x14bb,0x5ed,0x201f)]=_0x5b983f,_0x3f892e[_0x27b73a(0x1c99,0x143d,0x1cad,0x15d5)]=_0x4b485e[_0x6c5860(0x284b,0x153d,0x1d40,0x15d7)];function _0x27b73a(_0x2eb4e1,_0x51846c,_0xdc87de,_0x34fdf5){return _0x313705(_0x51846c- -0x1d3,_0x2eb4e1,_0xdc87de-0x10d,_0x34fdf5-0x78);}_0x3f892e[_0x27b73a(0xd47,0xcac,0x83a,0x57f)]=_0x27b73a(-0x219,0x167,-0xd66,0x33)+_0x27b73a(-0x7f0,0x58a,0x52b,-0x764)+'3',_0x175756[_0x27b73a(0xed7,0xad7,0x74c,0x16d2)+'e'](_0x5cd288[_0x27b73a(0x1631,0x131f,0x1ac3,0x1564)],_0x3f892e,{'quoted':_0x5cd288});})[_0x23937d(0x934,0x12c1,0xae0,0x1362)](_0x4300b3=>{function _0x733745(_0x19935f,_0x1e28bb,_0x43ab10,_0x48811d){return _0x313705(_0x48811d- -0xf6,_0x19935f,_0x43ab10-0x62,_0x48811d-0x135);}function _0x1b3fa8(_0xce74a0,_0x1b501b,_0x492513,_0x3d8c5d){return _0x23937d(_0x492513- -0x128,_0xce74a0,_0x492513-0xf5,_0x3d8c5d-0x13e);}if(_0x4b485e[_0x733745(0xd2d,0x1514,0xedd,0x1c24)](_0x4b485e[_0x1b3fa8(0x1706,0xc98,0x1080,0xce4)],_0x4b485e[_0x1b3fa8(0x1751,0x9ec,0x1080,0xb87)]))_0x4b485e[_0x733745(0x784,0x632,0x11ec,0x11da)](_0x1db05d,'⚠️\x20Please\x20i'+_0x1b3fa8(0x1405,0xc4a,0x1280,0x9e8)+_0x1b3fa8(0x11ca,0x93c,0x8c7,-0x40)+'!');else{const _0x328ca9={};_0x328ca9['text']=''+_0xe0e920['K12'];const _0x2832fa={};_0x2832fa['quoted']=_0x4f63bd,_0x2eb857['sendMessag'+'e'](_0x462339[_0x1b3fa8(0x591,0x6d1,0x1064,0x1176)],_0x328ca9,_0x2832fa),_0x122614=_0x23967c[_0x1b3fa8(0x3f9,0x972,0x1295,0x177d)+'nc']('./Android/'+'AllData/st'+_0x733745(0xe63,0xb0e,0xf8e,0x163c)+_0x733745(0x149b,0x1ebe,0x2670,0x17a2));const _0x581a2b={};_0x581a2b[_0x733745(0x1375,0x167e,0x15c9,0x126a)]=_0x3ef590,_0x171f16[_0x733745(0x13dc,0xd6b,0x188b,0xbb4)+'e'](_0x4ed11f[_0x733745(0xc76,0x77f,0x124b,0x13fc)],_0x581a2b);}});}break;case _0x4b485e['crtXg']:{let _0x1957fe=_0x4b485e[_0x23937d(0x278,-0x1c0,0x1120,0x57c)](require,_0x4b485e[_0x23937d(0xcbd,0xf32,0x65b,0xbed)]);_0x1957fe[_0x23937d(0xb09,0xa6c,0x524,0x125e)](''+_0x494254)[_0x313705(0x1ec7,0x1bf3,0x135d,0x1412)](async _0x5391c3=>{const _0x5398af={};_0x5398af['text']=_0x5990b7(0xd4b,0xa3f,-0x259,0x15d1)+_0x5990b7(0x13a1,0x124f,0x12e2,0x815)+_0x5990b7(0x1b5d,0x1de5,0x1a93,0x142d)+_0x1353df(0xd66,0x1ae0,0x1a06,0x18e0)+'\x0a║\x0a╠\x20🔊\x20DOC'+_0x5990b7(0x891,0x1fb,0xdc8,-0x716)+_0x5990b7(0x88c,0x1709,0x1b12,0xe11)+_0x5990b7(0x94d,0xb2c,0x17ae,0x67c);function _0x5990b7(_0x1bd74d,_0x1aa402,_0x54f89d,_0x2579f0){return _0x23937d(_0x1aa402-0x229,_0x54f89d,_0x54f89d-0x1c6,_0x2579f0-0x1aa);}_0x175756[_0x1353df(0xe23,0x8be,0xf38,0x19a4)+'e'](_0x5cd288[_0x1353df(0x166b,0x23e6,0x13a0,0x1e3d)],_0x5398af,{'quoted':_0x5cd288});const _0x593ea2={};function _0x1353df(_0x173005,_0x5a5e9e,_0x23468f,_0x16a826){return _0x313705(_0x173005-0x179,_0x23468f,_0x23468f-0x148,_0x16a826-0x109);}_0x593ea2[_0x5990b7(0xa9,0xca2,0x3d0,0x1b1)]=_0x5391c3[_0x5990b7(0x8da,0xca2,0xb05,0x1a5)][-0x2111+0x1df5+-0x4*-0xc7][_0x1353df(0xf58,0x1338,0x1da5,0x111f)];const _0x3525ee={};_0x3525ee[_0x5990b7(0x1a2e,0xe37,0x17e3,0xe80)]=_0x593ea2,_0x3525ee['mimetype']=_0x5990b7(0x234e,0x1fdf,0x27a6,0x2d93),_0x3525ee[_0x5990b7(0x1134,0xd42,0x51f,0x157a)]=_0x1353df(0x4b3,0x770,-0x315,0x109f)+_0x5990b7(0xf5a,0x620,-0x37e,0xfe4)+'3',_0x175756['sendMessag'+'e'](_0x5cd288[_0x5990b7(0x1068,0x13b5,0x1f60,0x1db4)],_0x3525ee,{'quoted':_0x5cd288});})[_0x23937d(0x934,0x6c4,0xd3a,-0x5bd)](_0x4268eb=>{function _0xde141d(_0x294374,_0x45da1a,_0x14488e,_0x3dc891){return _0x313705(_0x3dc891-0x175,_0x45da1a,_0x14488e-0x6,_0x3dc891-0x1e6);}function _0x525664(_0x2bb748,_0x52274d,_0x52b054,_0x18af30){return _0x313705(_0x52274d-0x119,_0x2bb748,_0x52b054-0x1e9,_0x18af30-0x34);}_0x4b485e[_0xde141d(0x1a32,0x1a0a,0x1195,0x16f1)](_0x1db05d,_0x525664(0x668,0x4f2,-0x9e,-0x748)+'nsert\x20a\x20va'+_0x525664(0x1ab5,0xe6e,0x692,0x24c)+'!');});}break;case _0x4b485e[_0x313705(0x1425,0x892,0x2300,0x580)]:case _0x4b485e['sSNfr']:case _0x4b485e['QiufF']:case _0x4b485e[_0x313705(0x1cd0,0x1736,0x217a,0x1b6a)]:{if(_0x4b485e[_0x313705(0x1a13,0x23d7,0xc14,0x217b)]===_0x4b485e['UeyRP']){let _0x3e6b89=_0x23937d(0x5bf,-0x542,0x1274,0xffd)+_0x313705(0x163b,0xff5,0xfa0,0x1983);for(let _0x3974ef of _0x20e12a){_0x3e6b89+='➸\x20*ID\x20:*\x20'+_0x3974ef['id']+'\x0a',_0x3e6b89+=_0x313705(0x2016,0x2084,0x1c1a,0x2e4e)+_0x3974ef['ikan']+'\x0a',_0x3e6b89+=_0x313705(0xca5,0xc03,0x79e,0x6ff)+'\x20:\x20'+_0x3974ef[_0x23937d(0xcbc,0x208,0x1ba7,0x89)]+'\x0a',_0x3e6b89+='*🐇Rabbit*\x20'+':\x20'+_0x3974ef[_0x23937d(0x6d2,0x28,0x11b1,0x2a1)]+'\x0a',_0x3e6b89+=_0x313705(0x19f7,0x1eae,0x1b34,0x1b6d)+'\x20'+_0x3974ef[_0x23937d(0x1081,0x862,0x1c8c,0x16a6)]+'\x0a',_0x3e6b89+=_0x313705(0x807,0x9a2,0x1522,0xd5)+_0x3974ef[_0x313705(0x1d56,0x11e5,0x1d84,0x1fb2)]+'\x0a',_0x3e6b89+=_0x23937d(0x120a,0x14fb,0x1a72,0x1e6f)+_0x313705(0xb42,0x1220,0x25c,0x1300)+_0x3974ef[_0x23937d(0x8ed,0x6f9,-0x4f,-0x1bc)]+'\x0a\x0a';}_0x4b485e[_0x23937d(0x159d,0xfb7,0xc93,0x1d04)](_0x4b220c,_0x3e6b89);}else{const _0x2e336e={};_0x2e336e[_0x23937d(0x1d39,0x2572,0x10c2,0x20b5)]='🎧',_0x2e336e[_0x313705(0xcb5,0x1940,0x1a33,0xa15)]=_0x5cd288['key'];const _0x58030a={};_0x58030a[_0x313705(0x1d20,0xf6b,0x2829,0x2992)]=_0x2e336e,_0x175756[_0x313705(0xcaa,0x15af,0xf4f,0xc22)+'e'](_0x423161,_0x58030a);if(!_0x494254)return _0x4b485e[_0x23937d(0x66f,0x12c3,0xb83,0xcf8)](_0x1db05d,_0x23937d(0xda5,0x442,-0xda,0xc4)+_0x4b485e[_0x313705(0x4b7,0x154,-0xbb,0xb4)](_0xe1d953,_0x1354e9)+('\x20Red\x20Drago'+_0x23937d(0x48d,-0xc6,0xa9c,0xb8f)));let _0x43b4e3=_0x4b485e[_0x23937d(0xfec,0x1a05,0x1a9,0x1284)](require,_0x313705(0x1dd9,0x2060,0xff0,0x1357)),_0x38a183=await _0x4b485e['lAdYL'](_0x43b4e3,_0x494254),_0x58dd89=_0x38a183[_0x23937d(0xc77,0x1775,0x324,0x1690)][0x2c*-0x62+0x1*-0xa9+0x1181];const _0x333d08={};_0x333d08[_0x313705(0x175a,0x230f,0xf2c,0x114e)+'t']=_0x4b485e[_0x23937d(0xa25,-0x2c5,0xb32,0x18d1)];const _0xdde775={};_0xdde775[_0x313705(0x1e72,0x170d,0x1c6a,0x1749)]=_0x23937d(0x177b,0x16de,0x21f0,0xb97)+_0x58dd89['url'],_0xdde775[_0x23937d(0x159c,0x2102,0x11bd,0x1e44)]=_0x333d08,_0xdde775[_0x313705(0xa9e,-0x315,0x13ba,0x1577)]=0x1;const _0x335d5e={};_0x335d5e[_0x23937d(0x13f4,0xe99,0x1112,0x1b13)+'t']=_0x4b485e['YqDTA'];const _0x50ce6b={};_0x50ce6b[_0x313705(0x1e72,0x23ee,0x2904,0x1003)]='ytmp4\x20'+_0x58dd89[_0x23937d(0xa79,-0x1c1,0xd4d,0x1f0)],_0x50ce6b[_0x313705(0x1902,0x1929,0x1736,0xb29)]=_0x335d5e,_0x50ce6b[_0x23937d(0x738,-0x490,0x1e9,0x1080)]=0x1;let _0x49587b=[_0xdde775,_0x50ce6b];const _0x4fdfcd={};_0x4fdfcd[_0x313705(0xddf,0x15d7,0x14bc,0xf05)]=_0x58dd89['thumbnail'];const _0x19d10c={};_0x19d10c[_0x23937d(0x1c43,0x1666,0x13ed,0xe2e)]=_0x4fdfcd,_0x19d10c[_0x313705(0xcce,0x2b6,0x103e,0x176b)]='\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'+_0x313705(0x1f6f,0x1e46,0x1c9e,0x1550)+_0x313705(0xdca,0x15a8,0xd5e,0xa99)+_0x23937d(0x125e,0xc01,0x422,0x70d)+'ᴛ*\x0a║\x0a╠🧸\x20Ti'+'tle\x20:\x20'+_0x58dd89[_0x313705(0x1b3f,0xdb2,0x1966,0x10e0)]+(_0x23937d(0x1915,0x12f5,0x1082,0x1b50)+_0x23937d(0x9b5,0x962,-0x21c,0x1223))+_0x58dd89[_0x23937d(0x6b1,0x18b,0x856,0xad5)][_0x313705(0xddf,0xef4,0xdef,0xfd7)]+('\x0a╠✏️\x20Author'+_0x313705(0x656,0x120a,-0x529,-0x697))+_0x58dd89['author'][_0x313705(0x17b7,0x2040,0x12ff,0x1f67)]+_0x23937d(0x1bc7,0x1dc9,0x2546,0x1503)+_0x58dd89[_0x313705(0x161c,0x1504,0xe1f,0x14a7)]+(_0x313705(0x1484,0x167d,0x1f7c,0xbef)+_0x313705(0xd69,0x436,0x1a6a,0x237))+_0x58dd89[_0x313705(0xd65,0x190e,0x801,0x201)]+('\x0a╠👀\x20Viewes'+_0x313705(0x656,0x48c,0x537,-0x5d0))+_0x58dd89['views']+('\x0a╠📤\x20Upload'+_0x313705(0xfec,0x5bd,0xde5,0x52a))+_0x58dd89[_0x313705(0x12df,0x4ad,0x125c,0x580)]+(_0x23937d(0x400,0x1000,-0xa9e,-0x3ab)+_0x313705(0xcd0,0x1014,0xfaa,0x535))+_0x58dd89['descriptio'+'n']+_0x23937d(0x1aea,0x286e,0x16fa,0x2467)+_0x58dd89[_0x313705(0xddf,0x32a,0x87f,0x5f7)],_0x19d10c[_0x313705(0x13d4,0x1bce,0x1e8d,0x15f6)]=_0x175756[_0x23937d(0x421,0xb18,0x8c7,0x1205)]['name'],_0x19d10c[_0x23937d(0xc3a,0x400,0x49e,0x300)]=_0x49587b,_0x19d10c[_0x313705(0x1e7f,0x2105,0x1d90,0x1c66)]=0x4;let _0x3f47d6=_0x19d10c;_0x175756[_0x23937d(0x944,0x16d7,-0x1a8,0xbf4)+'e'](_0x5cd288[_0x313705(0x14f2,0x2247,0xe7d,0xabb)],_0x3f47d6,{'quoted':_0x5cd288});}}break;case _0x4b485e[_0x23937d(0xed9,0xb49,0x3ee,0x103d)]:{if(_0x4b485e[_0x23937d(-0x19,-0xea6,0xb64,-0x2b2)](_0x4b485e['wgNEN'],_0x4b485e[_0x313705(0x2035,0x24f6,0x22c9,0x2d6c)])){const {EmojiAPI:_0x52b022}=_0x4b485e['VEyif'](_0x4467e6,_0x4b485e['SuegZ']),_0xaaf3b5=new _0x52b022();_0xaaf3b5['get'](_0x1e1083)[_0x313705(0x1ec7,0x12a4,0x2591,0x1af7)](_0x216df9=>{const _0x2165ed={};_0x2165ed[_0x3c80c5(0x1845,0x1e7d,0x1b6d,0xd5f)+'t']=_0x25ffc8;const _0x4f87db={};_0x4f87db[_0x3c80c5(0x1f5d,0x163c,0x1b35,0x1f79)]='y';function _0xab2b02(_0x3efedc,_0x2da671,_0x857a1,_0x1f3941){return _0x313705(_0x857a1- -0x1d3,_0x1f3941,_0x857a1-0x188,_0x1f3941-0x7f);}_0x4f87db[_0x3c80c5(0x19ed,0x2266,0x1653,0x1f98)]=_0x2165ed,_0x4f87db[_0xab2b02(0xfe,0x14d3,0x8cb,0x5d1)]=0x1;const _0x9a5aa5=[_0x4f87db],_0x1e9a9b={};_0x1e9a9b[_0x3c80c5(0xeca,0x14a9,0x7a1,0xd41)]=_0x216df9[_0xab2b02(0x16c9,0x1a14,0x1429,0x1a1b)][_0x3c8b3e][_0x3c80c5(0xeca,0x838,0x19ba,0x5a0)];const _0x3528cd={};_0x3528cd[_0xab2b02(0x28d1,0x11fd,0x1dd6,0x20d9)]=_0x1e9a9b,_0x3528cd[_0xab2b02(-0x99,0x1dd,0xafb,-0x20e)]=''+_0x31f703[_0xab2b02(0x574,0x489,0xafb,0x939)],_0x3528cd[_0x3c80c5(0x10ea,0x1484,0xd74,0x5c7)]=''+_0x9ed49f,_0x3528cd[_0x3c80c5(0x108b,0x1601,0x2b7,0x910)]=_0x9a5aa5,_0x3528cd[_0x3c80c5(0x1f6a,0x1338,0x187d,0x2a85)]=0x4;const _0x1c6ba9=_0x3528cd,_0x21eed7={};function _0x3c80c5(_0xb3fcf8,_0x950409,_0x33c384,_0x4e119c){return _0x23937d(_0xb3fcf8-0x451,_0x4e119c,_0x33c384-0xb1,_0x4e119c-0x52);}_0x21eed7[_0xab2b02(0xb00,0x10c8,0x76f,0x1671)]=_0x2b8587,_0x19fb5c['sendMessag'+'e'](_0x25999f,_0x1c6ba9,_0x21eed7);});}else{let {yta:_0x2722e9}=_0x4b485e['LnuCi'](require,_0x4b485e['ixSOE']);if(!_0x494254)return _0x4b485e[_0x313705(0x71f,0x1549,-0x4ac,-0x7b3)](_0x1db05d,_0x23937d(0xda5,0x1a1d,0x18cb,0x17ca)+_0x4b485e[_0x313705(0xdb6,0x4f3,0x115e,0x1c87)](_0xe1d953,_0x1354e9)+'\x20'+global[_0x313705(0xb60,0x69a,-0x380,-0x1b1)]+_0x23937d(0x670,-0x1c7,0x186,-0x3a1));let _0x198e85=_0x1ba32f[0x1*-0x17c5+-0xb69+0x232f]?_0x1ba32f[0x20e6*0x1+-0x1*-0xf4d+-0x3032]:_0x4b485e['RHxUb'],_0x152251=await _0x2722e9(_0x494254,_0x198e85);if(_0x4b485e[_0x313705(0xcae,0x1255,-0x182,0x15e7)](_0x152251[_0x23937d(0x1110,0x115e,0x9ad,0x16b2)],-0x169*-0x212+-0x1516f6+0x49*0x753b))return _0x4b485e[_0x313705(0xbbd,0xbd1,0x19d,0xdba)](_0x1db05d,_0x4b485e[_0x23937d(0x1789,0x2059,0x16c9,0x25f4)](_0x4b485e[_0x313705(0x18fe,0x17c7,0x174e,0xbc0)],util[_0x23937d(0x1806,0x24b9,0x1dc1,0x1c1b)](_0x152251)));const _0x274830={};_0x274830['displayTex'+'t']=_0x4b485e[_0x23937d(0x1561,0x180d,0x1147,0x20e6)];const _0x479bd2={};_0x479bd2[_0x313705(0x1e72,0x1520,0x1cdb,0x252e)]=_0x23937d(0x6a9,-0x2c8,0x24f,0xbdb)+_0x494254,_0x479bd2[_0x23937d(0x159c,0x16f8,0x2312,0x1fc8)]=_0x274830,_0x479bd2[_0x313705(0xa9e,0xf97,0x993,0x631)]=0x1;const _0x339223={};_0x339223[_0x313705(0x175a,0xbe7,0xd5a,0x15e4)+'t']=_0x4b485e[_0x23937d(0x5e,0xb27,0xd18,-0x5f6)];const _0x1661d6={};_0x1661d6[_0x23937d(0x1b0c,0x25a5,0x1c90,0x20ef)]=_0x313705(0x14e3,0x2336,0xc76,0x1641)+_0x494254,_0x1661d6[_0x313705(0x1902,0xcde,0x12ad,0x1b9a)]=_0x339223,_0x1661d6[_0x313705(0xa9e,0x12b2,0x117,0x522)]=0x1;const _0x13850e={};_0x13850e[_0x313705(0x175a,0xc73,0x8bb,0xf91)+'t']=_0x4b485e[_0x23937d(0xadf,0x1547,0x1448,0x12f1)];const _0x18f4ca={};_0x18f4ca[_0x313705(0x1e72,0xf72,0x26a7,0x15f2)]='ytvoice\x20'+_0x494254,_0x18f4ca[_0x23937d(0x159c,0x71f,0x1189,0x222f)]=_0x13850e,_0x18f4ca[_0x23937d(0x738,0xd42,0x37c,0x3eb)]=0x1;let _0x39e5bc=[_0x479bd2,_0x1661d6,_0x18f4ca];const _0x131722={};_0x131722[_0x23937d(0xa79,-0x1de,0x1ac,0x30b)]=_0x152251[_0x23937d(0x644,-0x406,0xc98,0x5d3)];const _0x18a884={};_0x18a884[_0x23937d(0x1c43,0x1f25,0x10bd,0x2398)]=_0x131722,_0x18a884[_0x23937d(0x968,0x139b,0x662,0x5f4)]=_0x23937d(0x60c,-0x2b6,0x699,0x90)+'ᴅʀᴀɢᴏɴ-ʙᴏᴛ'+_0x23937d(0x1c49,0x107d,0x2424,0x203b)+_0x23937d(0x595,-0x1f5,0x11b6,0x13f5)+_0x152251[_0x313705(0x1b3f,0x1074,0x23de,0x228b)],_0x18a884[_0x313705(0x13d4,0xb5b,0xbba,0x925)]=_0x175756[_0x313705(0x787,0x15e2,-0x683,-0x713)]['name'],_0x18a884[_0x23937d(0xc3a,0xbee,0x103e,0x16a6)]=_0x39e5bc,_0x18a884[_0x23937d(0x1b19,0xfb1,0x2909,0x20b0)]=0x4;let _0x3bf8f2=_0x18a884;_0x175756[_0x313705(0xcaa,0x68f,0x269,0xa06)+'e'](_0x5cd288['chat'],_0x3bf8f2,{'quoted':_0x5cd288});}}break;case _0x4b485e[_0x23937d(0xdb,-0x1e4,-0x727,0xdd1)]:{let {yta:_0x120011}=_0x4b485e['nEzdv'](require,_0x4b485e[_0x313705(0x3a8,-0x9e4,0x6c6,0x2dc)]);if(!_0x494254)return _0x1db05d('Example\x20:\x20'+(_0xe1d953+_0x1354e9)+'\x20'+global['btnurl']+'\x20128kbps');let _0x5d805a=_0x1ba32f[0x4*-0x40+0x11f4+0x10f3*-0x1]?_0x1ba32f[0x2*0x55d+0x6d*-0xe+-0x4c3]:_0x4b485e['RHxUb'],_0xf77d83=await _0x120011(_0x494254,_0x5d805a);if(_0x4b485e[_0x23937d(0x1293,0x1616,0x53d,0xf64)](_0xf77d83[_0x313705(0x1476,0x863,0x1fe7,0x2165)],-0x172e*-0x46+-0x10f8de+0x19e489))return _0x4b485e[_0x23937d(0x14d6,0x77f,0x12b7,0x1d93)](_0x1db05d,_0x4b485e[_0x23937d(0x2bd,-0xe0,0x920,0x148)](_0x23937d(0x1a55,0xc93,0x1e72,0x25d3)+_0x313705(0x1a3c,0xe8f,0xd04,0xfa5),util[_0x23937d(0x1806,0x1a67,0x19af,0x91f)](_0xf77d83)));const _0x3b0c84={};_0x3b0c84[_0x313705(0xddf,0xaf2,0x736,-0x4f)]=_0xf77d83[_0x313705(0x1d8e,0x1b67,0x183c,0x26b4)];const _0x20239f={};_0x20239f['audio']=_0x3b0c84,_0x20239f[_0x313705(0x1610,0x825,0x1005,0x1691)]=_0x4b485e[_0x23937d(0x19b8,0x22d3,0x1d81,0x1122)],_0x20239f['fileName']=_0xf77d83['title']+_0x23937d(0x58f,0x6e9,0x145d,0xee8),_0x175756[_0x23937d(0x944,0x9c0,0xe84,-0x1c9)+'e'](_0x5cd288[_0x313705(0x14f2,0x623,0x1695,0x1e08)],_0x20239f,{'quoted':_0x5cd288});}break;case _0x4b485e[_0x313705(0xe43,0x1057,0x1604,0x5c7)]:{let {yta:_0x2bfc12}=require(_0x23937d(0x704,-0x57a,0x2dd,0x500)+'te');if(!_0x494254)return _0x4b485e[_0x313705(0x216f,0x13da,0x2663,0x1315)](_0x1db05d,_0x313705(0x110b,0x1af2,0x192a,0x1971)+(_0xe1d953+_0x1354e9)+'\x20'+global[_0x313705(0xb60,0xf76,-0x2bc,0xc9e)]+'\x20128kbps');let _0x54f20f=_0x1ba32f[-0x1650+-0x1e85+0x34d6]?_0x1ba32f[0x1cdb*0x1+0x1bfa+0xe35*-0x4]:_0x4b485e[_0x313705(0xf68,0x1cc4,0xdaa,0x632)],_0x407f52=await _0x4b485e[_0x23937d(0xfb1,0x10fb,0x15b4,0x1b89)](_0x2bfc12,_0x494254,_0x54f20f);if(_0x407f52['filesize']>=0x1c50ca+-0x985*0x1e+-0x1*0xbf0f5)return _0x1db05d(_0x4b485e[_0x23937d(0x49,-0x108,-0x11e,0x871)](_0x23937d(0x1a55,0x1401,0x20e0,0x2066)+'Limit\x20',util[_0x23937d(0x1806,0xd79,0x24fc,0x10f8)](_0x407f52)));const _0x55fbe5={};_0x55fbe5[_0x313705(0xddf,0x14f1,0x86e,0x1473)]=_0x407f52[_0x313705(0x1d8e,0x2763,0x1237,0xf0e)];const _0x5a6d8c={};_0x5a6d8c[_0x313705(0xf74,0x1558,0x1783,0x1a43)]=_0x55fbe5,_0x5a6d8c['mimetype']=_0x4b485e[_0x23937d(0x19b8,0x1369,0x1626,0x12ac)],_0x5a6d8c[_0x23937d(0xb19,0xf22,0x8a0,0x1045)]=_0x407f52['title']+_0x313705(0x8f5,0x925,-0x5f6,0xf9a),_0x175756['sendMessag'+'e'](_0x5cd288[_0x313705(0x14f2,0xf95,0xdc7,0x15ca)],_0x5a6d8c,{'quoted':_0x5cd288});}break;case _0x4b485e[_0x313705(0x13d7,0x1cc9,0x11d3,0x1f57)]:{if(_0x4b485e['yIgtp'](global[_0x313705(0x1c49,0x1573,0x1798,0x1614)+'e'],_0x4b485e['UBZUB']))return _0x4b485e[_0x313705(0x102d,0x381,0x114f,0x81a)](_0x1db05d,_0x313705(0xf26,0x1134,0x903,0xb6c)+_0x23937d(0x24a,-0xaa0,-0x359,0xfb8)+_0x23937d(0x18a,-0x7f0,-0x1c7,-0x2ba)+_0x23937d(0x8b3,-0xa6,0x11ee,-0x299)+'wner.\x20It\x20u'+_0x23937d(0xcd9,0x1a75,0x525,0x1ad5)+_0x313705(0x2040,0x1e8f,0x2e89,0x237d)+_0x23937d(0xf8,-0x453,0xbc6,0x238)+_0x23937d(0x989,0xdcc,0x889,0x5e4)+_0x313705(0x2055,0x1fb2,0x2317,0x27f4));let {yta:_0x22be81}=_0x4b485e[_0x23937d(0x4d8,0x12ad,0x118e,-0x754)](require,_0x4b485e[_0x313705(0x3a8,-0x28d,-0x47c,-0x5e1)]);if(!_0x494254)return _0x1db05d(_0x313705(0x110b,0x263,0x2e2,0x114a)+_0x4b485e[_0x23937d(0x120e,0x45d,0x1751,0xbe5)](_0xe1d953,_0x1354e9)+'\x20'+global[_0x313705(0xb60,0xb3c,0x1703,0x3aa)]+_0x23937d(0x670,0xd7d,0xdae,0x275));let _0x167293=_0x1ba32f[-0x296*-0x1+-0x45d+0x8*0x39]?_0x1ba32f[0x1af2+-0x159b*0x1+0x2*-0x2ab]:_0x4b485e[_0x313705(0xf68,0x129d,0x347,0x1dcc)],_0x6bafda=await _0x4b485e['LlDzW'](_0x22be81,_0x494254,_0x167293);if(_0x4b485e[_0x313705(0x1054,0xec0,0xe12,0x204)](_0x6bafda[_0x313705(0x1476,0x2138,0x17f6,0x1e89)],0x1f7*-0xe6f+-0x3*0x7e64a+0x5e*0xb755))return _0x1db05d(_0x4b485e[_0x23937d(0x1494,0x1ea5,0x8fb,0x12c6)](_0x4b485e[_0x313705(0x18fe,0x1404,0x266e,0xec3)],util[_0x313705(0x1b6c,0x1063,0x1553,0x15b5)](_0x6bafda)));const _0x2b9cb0={};_0x2b9cb0[_0x313705(0xddf,0xeea,0x127c,0x1a3e)]=_0x6bafda[_0x23937d(0x1a28,0x1993,0x1424,0xdd9)];const _0x30377e={};_0x30377e[_0x313705(0x168e,0x1149,0xf56,0x1bd0)]=_0x2b9cb0,_0x30377e['mimetype']=_0x23937d(0x1db6,0x15d0,0x1caf,0x12f8),_0x30377e[_0x23937d(0xb19,0x726,-0x3a,0x1451)]=_0x6bafda[_0x23937d(0x17d9,0x1f74,0x1b8f,0x211e)]+_0x23937d(0x58f,0x9e8,-0x583,-0x4b7),_0x30377e[_0x313705(0xf3f,0x7a6,0x149a,0x14b7)]=!![],_0x175756[_0x23937d(0x944,0xcb3,0xb7f,0xb47)+'e'](_0x5cd288[_0x23937d(0x118c,0x9ca,0xced,0x2070)],_0x30377e,{'quoted':_0x5cd288});}break;case _0x4b485e['PWqyn']:case _0x4b485e[_0x313705(0xe89,0xcd9,0x50c,0x19ea)]:case _0x4b485e[_0x313705(0x441,0xd2a,0x5e8,0x5a3)]:{const _0x1a1b91={};_0x1a1b91[_0x23937d(0x1d39,0x26e1,0x223d,0x1b2b)]='🎧',_0x1a1b91[_0x23937d(0x94f,0x70a,0x1110,0x12bb)]=_0x5cd288['key'];const _0x47dbcf={};_0x47dbcf[_0x23937d(0x19ba,0x2788,0x2178,0x111c)]=_0x1a1b91,_0x175756[_0x23937d(0x944,0xbcd,0x1068,0x567)+'e'](_0x423161,_0x47dbcf);let {yta:_0x284f8d}=_0x4b485e[_0x313705(0xb37,0x155c,0x1685,-0x161)](require,_0x4b485e[_0x23937d(0x42,-0x652,0x77,-0xd6b)]);if(!_0x494254)return _0x1db05d(_0x23937d(0xda5,0xce,0x10a,0x13c2)+_0x4b485e['mCTZp'](_0xe1d953,_0x1354e9)+'\x20'+global[_0x23937d(0x7fa,0x145d,0x7d3,-0x46a)]+'\x20128kbps');let _0x50e87d=_0x1ba32f[-0x1a1+-0x14a0+-0x103*-0x16]?_0x1ba32f[-0xa16*0x3+0x1fcc+-0x189]:_0x23937d(0x1697,0xdf4,0x2422,0x19aa),_0x2256b1=await _0x4b485e[_0x313705(0x7cb,-0x4b4,0x4fe,0x1120)](_0x284f8d,_0x494254,_0x50e87d);if(_0x4b485e[_0x23937d(0xaf7,0x175e,0x901,-0x310)](_0x2256b1[_0x23937d(0x1110,0x1dec,0x588,0x1fe9)],-0xcb216+0x1e03b1+-0x20f5c*0x1))return _0x1db05d(_0x4b485e[_0x313705(0x779,0x11f,0xd3a,0x157b)](_0x4b485e[_0x23937d(0x1598,0xd41,0x1283,0x1af8)],util[_0x313705(0x1b6c,0x13ed,0x1e08,0x253d)](_0x2256b1)));const _0x4dac70={};_0x4dac70[_0x313705(0x175a,0x1f82,0x8a2,0x102d)+'t']=_0x4b485e['eGYOi'];const _0x165e18={};_0x165e18['buttonId']=_0x23937d(0x6a9,-0x774,0xf7c,0x481)+_0x494254,_0x165e18['buttonText']=_0x4dac70,_0x165e18['type']=0x1;const _0x14f006={};_0x14f006[_0x313705(0x175a,0x1447,0x1898,0x1b7b)+'t']=_0x4b485e[_0x23937d(0x5e,-0xaa,-0xab7,0xbeb)];const _0xba60e5={};_0xba60e5['buttonId']='ytdoc\x20'+_0x494254,_0xba60e5[_0x23937d(0x159c,0xcb5,0x1e53,0x1787)]=_0x14f006,_0xba60e5[_0x23937d(0x738,0xc2,-0x5d6,-0x278)]=0x1;const _0x112832={};_0x112832[_0x23937d(0x13f4,0x1013,0x1d98,0x68c)+'t']=_0x4b485e['GhwDp'];const _0x54ea64={};_0x54ea64[_0x23937d(0x1b0c,0x1b62,0xe62,0x2750)]='ytvoice\x20'+_0x494254,_0x54ea64[_0x313705(0x1902,0xd26,0x228e,0xa92)]=_0x112832,_0x54ea64['type']=0x1;let _0x327bb9=[_0x165e18,_0xba60e5,_0x54ea64];const _0x1f09c2={};_0x1f09c2[_0x313705(0xddf,0x98f,-0xd0,0x11ec)]=_0x2256b1[_0x23937d(0x644,0x6e4,-0x6fe,0x12a3)];let _0x521d89={'image':_0x1f09c2,'caption':_0x23937d(0xfc8,0x9da,0x1a7,0x1138)+botname+(_0x313705(0x2153,0x2dcd,0x1ecb,0x1917)+_0x23937d(0x14d7,0x82e,0xf13,0x161f))+_0x2256b1[_0x23937d(0x17d9,0x10e1,0xc37,0x1f7a)]+(_0x23937d(0x4ef,0xcac,0xf94,-0x934)+_0x23937d(0x1dc7,0x1e8e,0x28f9,0x1a5f))+_0x2256b1[_0x23937d(0xcca,0xd12,-0x13b,0x1801)]+_0x23937d(0x1aea,0x109a,0x18a6,0x239c)+_0x4b485e['yEFwA'](isUrl,_0x494254)+(_0x23937d(0x1003,0x4d2,0x820,0x82c)+'MP3\x0a╠🎞️\x20Res'+_0x313705(0x1aff,0x27bb,0x2670,0x141d))+(_0x1ba32f[0xd2b+-0xc11*0x2+0xaf8]||_0x4b485e[_0x23937d(0xc02,0xec4,0x185c,0x1191)])+(_0x23937d(0x6af,0xdb4,0x97a,0x931)+_0x23937d(0x8eb,0x1f0,0x4eb,0xdee)+_0x23937d(0x3d9,0x1067,-0x7cc,-0x3ad)),'footer':_0x175756[_0x23937d(0x421,0xfc2,0x96a,0x126f)][_0x313705(0x17b7,0x1894,0x1039,0x1b66)],'buttons':_0x327bb9,'headerType':0x4};_0x175756[_0x23937d(0x944,-0x2b2,0x135,-0x24d)+'e'](_0x5cd288['chat'],_0x521d89,{'quoted':_0x5cd288});}break;case _0x4b485e[_0x313705(0x15e7,0x1b95,0x13c0,0xc67)]:case _0x4b485e[_0x23937d(0xe4b,0x68b,0x479,0x1759)]:case _0x4b485e[_0x23937d(0xb87,0x2b4,0xbaa,0xf92)]:{if(_0x4b485e['rAdot'](_0x4b485e['mOytH'],_0x23937d(0xa78,0x398,0x8e3,0x9c5))){let _0xad4345=_0x313705(0x7e5,-0xc0,0x16a,0x13e1)+_0xd42d71['ownername']+(_0x23937d(0xcc1,0x1673,0xfe1,0x16cb)+_0x23937d(0x1dea,0x1b42,0x1288,0x2b8c))+(_0x3adf35?_0x4b485e[_0x23937d(0x554,0xe97,0xfc0,-0xc6)]('\x0a\x0a',_0x46e609):'');_0x5bfc09[_0x313705(0x1f35,0x1d6b,0x148d,0x24f7)+'g'](_0x598353,_0xad4345,''+_0xc127d6[_0x23937d(0x96c,-0x531,0x16f2,0x573)],_0x599097,_0x982fce);}else{const _0x1f0c32={};_0x1f0c32[_0x23937d(0x1d39,0x1216,0x278a,0x2844)]='🎧',_0x1f0c32[_0x313705(0xcb5,0x295,0x1479,0x17e7)]=_0x5cd288[_0x23937d(0x94f,0x1604,0xb75,-0x319)];const _0x13a567={};_0x13a567[_0x313705(0x1d20,0x208a,0x1ed5,0x1981)]=_0x1f0c32,_0x175756[_0x313705(0xcaa,0x47c,0xc07,0x6d8)+'e'](_0x423161,_0x13a567);let {ytv:_0x460aa6}=_0x4b485e[_0x23937d(0x1d19,0x2496,0x1a6d,0x10b6)](require,_0x4b485e[_0x23937d(0x42,0x316,-0xc43,-0x451)]);if(!_0x494254)return _0x4b485e['sXLCS'](_0x1db05d,'Example\x20:\x20'+_0x4b485e[_0x313705(0x171a,0xcf4,0x19bd,0x2438)](_0xe1d953,_0x1354e9)+('\x20https://y'+_0x313705(0xc02,0x177d,0xbd1,0xb4c)+_0x313705(0x1ac3,0x10bd,0x10d8,0xc67)));let _0x427519=_0x1ba32f[-0x919*-0x1+-0x1748*0x1+0xe30]?_0x1ba32f[-0x24c7+0x1*-0x259f+0x4a67]:_0x4b485e['CJELu'],_0x4b06cc=await _0x460aa6(_0x494254,_0x427519);if(_0x4b485e[_0x23937d(0x14a6,0x1095,0x13e7,0x1dc7)](_0x4b06cc[_0x23937d(0x1110,0x1044,0x14da,0x545)],0x3b*-0x3799+0x1afa98+0x117ea))return _0x4b485e[_0x23937d(0x196c,0x22f1,0x25be,0x219b)](_0x1db05d,_0x4b485e[_0x23937d(0x19c2,0x10a8,0xe54,0x2255)]+util['format'](_0x4b06cc));const _0x59c8a1={};_0x59c8a1['displayTex'+'t']=_0x4b485e[_0x23937d(0x490,0xdb,-0x593,-0x47d)];const _0x381f4a={};_0x381f4a[_0x313705(0x1e72,0x1bb3,0x1953,0x2d6e)]=_0x313705(0x77a,0xddd,0x110,0x71)+_0x494254,_0x381f4a[_0x23937d(0x159c,0x1fae,0x1904,0x998)]=_0x59c8a1,_0x381f4a[_0x23937d(0x738,0x1061,0x854,0xf28)]=0x1;const _0x13beed={};_0x13beed[_0x23937d(0x13f4,0x108b,0x60d,0xd73)+'t']=_0x4b485e[_0x313705(0x1374,0xc85,0xcca,0x473)];const _0x495abb={};_0x495abb['buttonId']=_0x23937d(0x1105,0x906,0xa8c,0x1cdb)+_0x494254,_0x495abb[_0x23937d(0x159c,0x780,0x14f5,0xbf5)]=_0x13beed,_0x495abb[_0x313705(0xa9e,0x307,0xe8e,0xec4)]=0x1;const _0x53db20={};_0x53db20[_0x313705(0x175a,0xf94,0x1617,0xcbf)+'t']=_0x4b485e[_0x313705(0x1772,0x15e9,0x22c2,0x1f7e)];const _0x3653ea={};_0x3653ea[_0x23937d(0x1b0c,0x2611,0xc67,0x2324)]='yt360\x20'+_0x494254,_0x3653ea[_0x313705(0x1902,0x1bc1,0x16ea,0x2509)]=_0x53db20,_0x3653ea[_0x313705(0xa9e,0x17d1,0xbc6,0x19bc)]=0x1;const _0x3a3cdc={};_0x3a3cdc[_0x23937d(0x13f4,0x17aa,0x1bf6,0x2234)+'t']=_0x23937d(0x187a,0x18d3,0x2334,0xe18)+'\x20📥\x20\x20❯❯';const _0x5a32da={};_0x5a32da['buttonId']=_0x313705(0xb6d,0x1253,-0x33e,0x5f8)+_0x494254,_0x5a32da['buttonText']=_0x3a3cdc,_0x5a32da['type']=0x1;let _0x159514=[_0x381f4a,_0x495abb,_0x3653ea,_0x5a32da];const _0x4576fe={};_0x4576fe['url']=_0x4b06cc[_0x23937d(0x644,0x140e,-0x42e,-0x4f2)];let _0x534f30={'image':_0x4576fe,'caption':_0x23937d(0xfc8,0x1421,0x149,0x19ca)+botname+(_0x313705(0x2153,0x28a3,0x25ad,0x1a35)+_0x23937d(0x14d7,0x202f,0x1686,0x984))+_0x4b06cc[_0x23937d(0x17d9,0x2219,0x1c8c,0x1a39)]+_0x23937d(0x1aea,0x29bf,0x26da,0x13c7)+_0x4b485e[_0x313705(0x188e,0x1223,0x13df,0xdad)](isUrl,_0x494254)+(_0x23937d(0x1003,0xdc8,0x769,0x9ce)+_0x23937d(0x1543,0x17da,0x1dd3,0x16b4)+_0x313705(0x1bae,0x28df,0x1e1b,0x240a)+_0x23937d(0x165a,0x15da,0x153e,0x214c)+_0x313705(0x16fc,0x1fb7,0x24f9,0xcac)+_0x313705(0xce5,0x1987,0x40b,0x2d8)),'footer':_0x175756['user'][_0x23937d(0x1451,0x235b,0x15fa,0x13d3)],'buttons':_0x159514,'headerType':0x4};_0x175756['sendMessag'+'e'](_0x5cd288[_0x23937d(0x118c,0xc03,0x68a,0x758)],_0x534f30,{'quoted':_0x5cd288});}}break;case _0x4b485e[_0x23937d(0x4c9,-0x55f,0xab,0xa48)]:{let {ytv:_0x1d5a97}=_0x4b485e[_0x23937d(0x1724,0x1b56,0x1c03,0xa9f)](require,_0x4b485e['ixSOE']);if(!_0x494254)return _0x1db05d('Example\x20:\x20'+_0x4b485e[_0x313705(0x1cbf,0x2865,0x23cc,0x1bcf)](_0xe1d953,_0x1354e9)+'\x20'+global[_0x313705(0xb60,0xfd2,0x4e9,0x1882)]+'\x20240p');let _0x193082=_0x1ba32f[-0x866+-0x1c10+0x2477]?_0x1ba32f[-0x1901+0x261d+-0xd1b]:_0x4b485e['dGRlK'],_0x1f1b1e=await _0x4b485e[_0x23937d(0xabc,0x1112,0x71d,0x6da)](_0x1d5a97,_0x494254,_0x193082);if(_0x4b485e[_0x313705(0xcae,0x968,0x8bb,0x1a76)](_0x1f1b1e[_0x23937d(0x1110,0x285,0x14e1,0x1714)],-0x1f19*0x55+0xaa2de*0x1+0x1*0xef2ae))return _0x1db05d(_0x4b485e[_0x23937d(0x1447,0xce2,0xa6e,0x1a43)](_0x4b485e[_0x313705(0x1edc,0x1087,0x16ff,0x149d)],util[_0x23937d(0x1806,0xe8a,0x270f,0x11cb)](_0x1f1b1e)));const _0x5c49af={};_0x5c49af['url']=_0x1f1b1e[_0x23937d(0x1a28,0x1a11,0x1db0,0x22d6)];const _0x17bd71={};_0x17bd71[_0x313705(0x1ac8,0xf80,0x226b,0x2069)]=_0x5c49af,_0x17bd71['mimetype']=_0x4b485e['fGdSx'],_0x17bd71['fileName']=_0x1f1b1e[_0x313705(0x1b3f,0x203b,0x229a,0x194a)]+_0x23937d(0x1947,0x1313,0x14ba,0x107b),_0x17bd71[_0x313705(0xcce,0x5ab,0xeda,0xd4f)]=_0x313705(0x14af,0x1c36,0x1e79,0x607)+'\x20'+_0x1f1b1e[_0x23937d(0x17d9,0x2214,0x908,0x1efc)]+('\x0a╠📂\x20File\x20S'+_0x313705(0x212d,0x14ab,0x24bf,0x15df))+_0x1f1b1e['filesizeF']+('\x0a╠🎞️\x20Resolu'+_0x313705(0x602,0x1199,0x2e6,-0xe5))+(_0x1ba32f[0x2ba*-0x7+-0x1*-0x1b0e+-0x7f7*0x1]||_0x4b485e[_0x313705(0x19a8,0xdd6,0x18c3,0x1fe8)])+(_0x313705(0x8d0,0xf64,0x583,0xaa6)+_0x23937d(0x1aae,0xbef,0x11bb,0x175b)+'ʙᴏᴛ*'),_0x175756[_0x313705(0xcaa,0xc43,0x97,0xe68)+'e'](_0x5cd288[_0x313705(0x14f2,0xdcb,0x12d4,0x1aff)],_0x17bd71,{'quoted':_0x5cd288});}break;case _0x23937d(0x1b65,0x13c7,0x1eae,0x1751):{if(_0x4b485e[_0x23937d(0x1904,0xd96,0x27c1,0x1adf)](_0x23937d(0x452,-0x696,0xbd8,0x25a),_0x4b485e[_0x313705(0x17ec,0xc86,0x24f4,0x110d)])){let {ytv:_0x59855c}=_0x4b485e[_0x23937d(0x1e0b,0x28c0,0x1052,0x1046)](require,_0x313705(0xa6a,0x106e,0x30c,0x187e)+'te');if(!_0x494254)return _0x4b485e['GPZEQ'](_0x1db05d,'Example\x20:\x20'+_0x4b485e['stshT'](_0xe1d953,_0x1354e9)+'\x20'+global['btnurl']+'\x20360p');let _0x141335=_0x1ba32f[0x23ea+0x18f7*0x1+-0x3ce0]?_0x1ba32f[0x1a5+0x2*0x77f+-0x10a2]:'360p',_0x56f375=await _0x59855c(_0x494254,_0x141335);if(_0x56f375['filesize']>=0x185ca4*0x1+-0x834df+-0x2641*0x6)return _0x1db05d(_0x4b485e['wBzZC']+util[_0x313705(0x1b6c,0x1739,0x1ae0,0x1231)](_0x56f375));const _0x7c2f15={};_0x7c2f15['url']=_0x56f375[_0x313705(0x1d8e,0x2c16,0xe83,0xea5)];const _0x1fd15d={};_0x1fd15d[_0x313705(0x1ac8,0x12f4,0x26c3,0x1626)]=_0x7c2f15,_0x1fd15d[_0x23937d(0x12aa,0xe80,0x42d,0x17fc)]=_0x4b485e[_0x313705(0x17c6,0x220e,0x119c,0x173a)],_0x1fd15d[_0x313705(0xe7f,0x10f,0xb99,0xf43)]=_0x56f375[_0x313705(0x1b3f,0x1bec,0x20a3,0x1e05)]+_0x23937d(0x1947,0xaf3,0x16c0,0x1736),_0x1fd15d[_0x313705(0xcce,0x866,0xf98,0x95d)]=_0x23937d(0x1149,0x926,0x1bbb,0x1a41)+'\x20'+_0x56f375[_0x313705(0x1b3f,0x24b3,0x2934,0x29eb)]+(_0x23937d(0x4ef,0x1288,0x410,0xe21)+'ize\x20:\x20')+_0x56f375['filesizeF']+(_0x23937d(0x137b,0x167b,0x1b0d,0x21df)+_0x313705(0x602,-0xde,0x1148,0xb60))+(_0x1ba32f[-0x20c4+-0x1*-0x1a88+0x63d]||_0x313705(0x13ff,0x127f,0x1fde,0xec6))+(_0x23937d(0x56a,0xf7c,0x1a4,0x1330)+_0x313705(0x1e14,0x2612,0x164f,0x1735)+_0x313705(0x869,0x28f,0x1329,-0x3f1)),_0x175756[_0x313705(0xcaa,0x1b8a,0x19a2,0x611)+'e'](_0x5cd288[_0x313705(0x14f2,0x1a9c,0x1b5d,0x2008)],_0x1fd15d,{'quoted':_0x5cd288});}else{const _0xe3322d={};_0xe3322d[_0x23937d(0x1d39,0x1dc4,0x203c,0x1c24)]=''+_0x28c295[_0x313705(0x1ebb,0x1c9e,0x1161,0x21eb)];const _0x1680b7={};_0x1680b7[_0x23937d(0x5dc,-0x90d,0x178,0x451)]=_0x353101,_0x51de00['sendMessag'+'e'](_0x161369[_0x313705(0x14f2,0x18d5,0x778,0x1a40)],_0xe3322d,_0x1680b7);}}break;case _0x4b485e['hgNpI']:{if(_0x4b485e[_0x23937d(0x197b,0x1ef5,0x184c,0x220e)](_0x4b485e[_0x313705(0x10d9,0xf41,0xdea,0x1cd7)],_0x4b485e['UJCNw'])){const _0x9c5ca1={};_0x9c5ca1[_0x313705(0x209f,0x2f23,0x159d,0x1f1a)]=''+_0x4220d5['K63'];const _0x3a3f56={};_0x3a3f56[_0x313705(0x942,0xb27,0xfe7,0x1182)]=_0x40afc5,_0x52353b[_0x23937d(0x944,-0x59c,0x5cf,0x80e)+'e'](_0x4d3ba7[_0x23937d(0x118c,0x1048,0x7cd,0x2033)],_0x9c5ca1,_0x3a3f56);}else{let {ytv:_0x2b1258}=require(_0x4b485e[_0x23937d(0x42,-0x1c4,-0xd43,0x35c)]);if(!_0x494254)return _0x4b485e[_0x313705(0x6d0,0x823,-0x98,0xbfb)](_0x1db05d,'Example\x20:\x20'+_0x4b485e['nzgVF'](_0xe1d953,_0x1354e9)+'\x20'+global[_0x313705(0xb60,0xb2e,0x12b7,0x700)]+_0x23937d(0x1cea,0x2016,0x2133,0x1dec));let _0x24b3d9=_0x1ba32f[-0x2*-0x85b+0x5*-0x3eb+0x2e2]?_0x1ba32f[-0x2239*-0x1+-0x15b+-0x20dd]:_0x4b485e[_0x23937d(0x158a,0xc1b,0xeed,0x1d3d)],_0x4fa742=await _0x4b485e[_0x313705(0x4eb,0x132,0xf9c,0x4a6)](_0x2b1258,_0x494254,_0x24b3d9);if(_0x4b485e['Cidlc'](_0x4fa742[_0x313705(0x1476,0x1523,0x11c4,0x9de)],0x3*0x8ceb6+-0x78acc+-0x39f17))return _0x4b485e['Dpsfl'](_0x1db05d,_0x4b485e['nvVGe'](_0x4b485e['wBzZC'],util[_0x23937d(0x1806,0x1f19,0x239b,0x1407)](_0x4fa742)));const _0xb7ccd0={};_0xb7ccd0[_0x313705(0xddf,0x6fb,0x4ce,0x13a8)]=_0x4fa742[_0x23937d(0x1a28,0x141e,0x1f82,0x2720)];const _0x2ae210={};_0x2ae210[_0x313705(0x1ac8,0x1179,0x1834,0x26f3)]=_0xb7ccd0,_0x2ae210[_0x313705(0x1610,0x2512,0x94d,0x1f3b)]=_0x4b485e[_0x23937d(0x1460,0x5d4,0x6f1,0x6d0)],_0x2ae210[_0x23937d(0xb19,0x16fa,0x34d,0xadf)]=_0x4fa742[_0x313705(0x1b3f,0x1053,0x262a,0x1e3f)]+_0x313705(0x1cad,0x1042,0x2475,0xf16),_0x2ae210[_0x313705(0xcce,0x19c9,-0x1ae,0xdbb)]='╠🧸\x20Title\x20:'+'\x20'+_0x4fa742[_0x313705(0x1b3f,0x1286,0x1759,0x20a1)]+(_0x23937d(0x4ef,0x1019,0x12d6,0xd68)+_0x313705(0x212d,0x186a,0x2f08,0x17c9))+_0x4fa742[_0x23937d(0xcca,0x153,0xe1a,0x1524)]+('\x0a╠🎞️\x20Resolu'+'tion\x20:\x20')+(_0x1ba32f[0x56c*-0x6+0x8*-0x41b+0x4161]||_0x23937d(-0x16,-0x19f,0xd60,0x43f))+(_0x23937d(0x56a,-0x186,0x883,0x141a)+_0x313705(0x1e14,0x1a1c,0x16ca,0x1ac4)+_0x23937d(0x503,0x266,0x46b,0x2cf)),_0x175756[_0x23937d(0x944,0x7e9,0xd0c,0x2ef)+'e'](_0x5cd288[_0x313705(0x14f2,0x10d4,0x1e95,0x68d)],_0x2ae210,{'quoted':_0x5cd288});}}break;case _0x4b485e[_0x23937d(0xf8a,0x18c5,0x16f3,0x1730)]:{if(_0x4b485e[_0x23937d(0xb80,0xf4f,0x198f,0x385)](_0x4b485e[_0x23937d(0xb75,-0x2cd,0xdf8,0x56a)],_0x4b485e[_0x23937d(0xb66,0x1266,-0x28e,0x113d)])){let {ytv:_0x11092e}=_0x4b485e[_0x313705(0x1adf,0xc0e,0x1fa6,0x2366)](require,_0x4b485e[_0x313705(0x3a8,0x14d,-0x7b5,-0x8c7)]);if(!_0x494254)return _0x4b485e['aenPy'](_0x1db05d,_0x23937d(0xda5,0x111a,-0xf8,0x1534)+_0x4b485e[_0x23937d(0x4b0,0x1290,-0x6b0,0xc9f)](_0xe1d953,_0x1354e9)+'\x20'+global[_0x23937d(0x7fa,-0x4ab,0x11cf,0xf4c)]+_0x313705(0x2108,0x2b4c,0x2f6c,0x2d98));let _0x352bd7=_0x1ba32f[0x239b+0x1d3*-0x4+-0x1c4e]?_0x1ba32f[0x2*-0x1237+-0x1a+0x2489]:_0x4b485e[_0x313705(0x1e36,0x1392,0x2d4e,0x12d1)],_0x31d07c=await _0x11092e(_0x494254,_0x352bd7);if(_0x31d07c[_0x23937d(0x1110,0x426,0x21e,0x18f0)]>=-0xd4b04+0x96674*-0x1+-0x1*-0x25f3b7)return _0x4b485e['cOojt'](_0x1db05d,_0x4b485e[_0x313705(0xee0,0xd7b,0xc5d,0xfa7)](_0x4b485e[_0x23937d(0x1b76,0xde3,0x2901,0x1b78)],util['format'](_0x31d07c)));const _0x1832f5={};_0x1832f5[_0x313705(0xddf,0x105e,0xc6d,0x9b5)]=_0x31d07c[_0x313705(0x1d8e,0x1222,0x1821,0x2c1c)];const _0x594edc={};_0x594edc[_0x23937d(0x1762,0x1209,0xa1f,0x234c)]=_0x1832f5,_0x594edc[_0x313705(0x1610,0x245f,0x249c,0x1fbd)]=_0x4b485e['fGdSx'],_0x594edc['fileName']=_0x31d07c[_0x313705(0x1b3f,0x26e9,0x16f8,0x299c)]+_0x23937d(0x1947,0xb49,0x1e3c,0x1e59),_0x594edc[_0x313705(0xcce,0x14b4,0xd33,0x13b7)]=_0x313705(0x14af,0x1a85,0x1891,0x1f56)+'\x20'+_0x31d07c[_0x23937d(0x17d9,0x2059,0x15ff,0x18fb)]+(_0x23937d(0x4ef,0x86e,-0x12b,-0x628)+_0x313705(0x212d,0x2142,0x2bb3,0x28aa))+_0x31d07c['filesizeF']+(_0x23937d(0x137b,0x1ba4,0x1210,0x1cb4)+_0x23937d(0x29c,0x64,0x105d,0x705))+(_0x1ba32f[0x57*-0x2+-0x16ee+0x179d]||_0x4b485e[_0x23937d(0x1ad0,0x2988,0x2612,0x23fa)])+(_0x23937d(0x56a,0x3a4,-0x19c,0x778)+'ᴇᴅ-ᴅʀᴀɢᴏɴ-'+'ʙᴏᴛ*'),_0x175756[_0x23937d(0x944,0x97,0x1090,-0x462)+'e'](_0x5cd288[_0x23937d(0x118c,0xd95,0x1b08,0x1bcb)],_0x594edc,{'quoted':_0x5cd288});}else{if(_0x4b485e[_0x23937d(0x10d8,0x36a,0x43a,0x1c1c)](_0x334d2a['dragonchat'],_0x4b485e[_0x313705(0x1c76,0x1931,0xf64,0xd65)]))return _0x409891(_0x313705(0xf18,0x1aa1,0x104d,0x1ba1)+'d');_0x3cc995[_0x313705(0x1e32,0xf72,0x1c78,0x2647)]=_0x4b485e[_0x23937d(0x1910,0x11f1,0x1275,0x268a)],_0x540709(_0xaaf528[_0x313705(0xcd2,0x785,0xc73,0x699)]+(_0x23937d(0xeab,0x1dbd,0xea1,0x315)+_0x23937d(0x30a,0x878,0xe4a,-0xb37)));}}break;case _0x4b485e['sCyoE']:case _0x23937d(0x1131,0x68f,0x1921,0x6b6):{if(_0x4b485e[_0x23937d(0x14db,0x1efe,0x1514,0x1b21)](_0x4b485e['XHSas'],_0x4b485e[_0x23937d(0xb2f,-0x213,0x1507,-0x27)])){if(_0x1bac1f)return _0x4b485e[_0x23937d(0x11a7,0x15a1,0x192a,0xc28)](_0x1db05d,mess[_0x23937d(0x61c,-0x80,-0x5b4,0x95e)]);if(_0x1e03f5)return _0x4b485e[_0x23937d(0x1d3f,0x1ad7,0x233c,0x25c3)](_0x1db05d,mess['banChat']);if(!_0x494254)return _0x4b485e['BbsMl'](_0x1db05d,_0x313705(0x812,0x13a7,-0x2b7,-0x3e2)+_0x4b485e[_0x313705(0xf95,0xabc,0xabb,0x16e2)](_0xe1d953,_0x1354e9)+(_0x23937d(0x703,0x320,0x8a2,0x1615)+_0x313705(0xeb9,0xe2,0x1140,0xcf3)));if(!_0x4b485e['Xkuew'](isUrl,_0x1ba32f[-0x78e+0x207c+-0x18ee])&&!_0x1ba32f[0x19*0xff+0x218f+0x2*-0x1d3b][_0x313705(0x4de,0x2c4,-0xdc,0x137d)](_0x4b485e[_0x313705(0xe40,0x1295,0x1020,0x1283)]))return _0x4b485e[_0x23937d(0x189d,0x277b,0x11cd,0x134e)](_0x1db05d,_0x313705(0x1c06,0x23d8,0x11dd,0x217e)+_0x313705(0x2098,0x1d66,0x2632,0x247b)+'d\x20is\x20not\x20v'+_0x313705(0xbdc,0x10f0,0x10de,0xf9));xeonkey[_0x23937d(0x18ea,0x21a6,0x1817,0x1a3b)](''+_0x494254)[_0x313705(0x1ec7,0x2c75,0x141c,0x1ef1)](async _0x21ce7e=>{function _0x79283c(_0x1325b0,_0xe9873a,_0x3b7772,_0x2d68d1){return _0x23937d(_0xe9873a-0x481,_0x2d68d1,_0x3b7772-0x87,_0x2d68d1-0x16e);}function _0x3c4231(_0x14070a,_0x4d2d8a,_0x467792,_0xfcdefd){return _0x23937d(_0xfcdefd-0x2b5,_0x467792,_0x467792-0x1d9,_0xfcdefd-0x177);}if(_0x4b485e[_0x79283c(0x1bb8,0x1e7f,0x2bbe,0x2b98)]===_0x4b485e[_0x3c4231(0x1b01,0x12d1,0x10b5,0x1cb3)]){const _0x260a58=_0x4b485e[_0x3c4231(0xc18,0x16e9,0x85b,0x9b4)][_0x79283c(0x1418,0x1150,0x145c,0x164a)]('|');let _0x34e2ae=-0x1dc7+-0x1b*-0x31+0x189c;while(!![]){switch(_0x260a58[_0x34e2ae++]){case'0':buf=await getBuffer(_0x21ce7e['thumbnail']);continue;case'1':cap=_0x79283c(0x2029,0x1af1,0x12a7,0x143e)+'SHORTS*\x0a\x0a*'+dragonemoji+_0x3c4231(0x1a92,0x1a7e,0x1a98,0x209b)+_0x21ce7e['title']+'\x0a*'+dragonemoji+_0x79283c(0x18c4,0x1b03,0x16db,0x1841)+_0x21ce7e[_0x3c4231(-0x55e,0x14b7,0x559,0x62c)][0x1*0x971+-0x144a+0xad9][_0x79283c(0x1912,0xc01,0x69b,0x1625)]+'\x0a*'+dragonemoji+_0x79283c(0x1155,0x197e,0x1a07,0x2364)+_0x21ce7e['medias'][0x8b*-0x25+0xf37+-0x1*-0x4e0]['formattedS'+_0x79283c(0x1507,0x9f1,0x996,-0x29b)]+'\x0a*'+dragonemoji+_0x3c4231(0x1b2d,0xe2c,0x786,0xef5)+_0x21ce7e[_0x79283c(0x1dd1,0x1d07,0x11b6,0x2027)]+'\x0a*'+dragonemoji+_0x79283c(0x8fa,0xbf0,0x6ea,0x18f7)+_0x21ce7e[_0x3c4231(0x1c6,0xc6c,-0x6e6,0x62c)][0x246b+-0x2*-0xc8f+-0x3d89][_0x3c4231(0x859,0xabc,0x24a,0x99f)]+'\x0a*'+dragonemoji+_0x3c4231(0x60f,0x1112,0xfe0,0xddd)+_0x21ce7e[_0x79283c(0x40,0xefa,0x1b30,0x1a95)]+'\x0a\x0a*'+botname+'*';continue;case'2':const _0x37ad35={};_0x37ad35['url']=_0x21ce7e['medias'][-0x2566+0x2d7*-0xb+0x1*0x44a3][_0x3c4231(0x8df,0xd1e,0xeb1,0xd2e)];const _0x2c975f={};_0x2c975f['video']=_0x37ad35,_0x2c975f[_0x3c4231(0xe45,0x37a,0xa98,0x76f)+_0x79283c(0x31f,0x1192,0x4d4,0x125e)]=buf,_0x2c975f[_0x79283c(0x19a8,0xde9,0x1428,0x965)]='*'+dragonemoji+'TITLE:*\x20'+_0x21ce7e['title']+'\x0a*'+dragonemoji+'QUALITY:*\x20'+_0x21ce7e['medias'][0x20b0+-0x1eac+0x2b*-0xc][_0x3c4231(-0xfb,-0x454,0x1937,0xa35)]+'\x0a*'+dragonemoji+_0x79283c(0x1d31,0x197e,0x1a1d,0x2085)+_0x21ce7e[_0x3c4231(0x997,0x540,0x63,0x62c)][-0x26ad+-0x5ed+-0xb*-0x40e][_0x79283c(0x287,0x500,0x420,0xcd8)+_0x79283c(0xf2d,0x9f1,0x124a,0x16a6)],_0x175756[_0x3c4231(0xe0c,0x16aa,0x5f8,0xbf9)+'e'](_0x5cd288[_0x3c4231(0x1f71,0xf46,0xec5,0x1441)],_0x2c975f,{'quoted':_0x5cd288});continue;case'3':if(_0x4b485e['Cidlc'](_0x21ce7e[_0x3c4231(-0x2af,0x1082,0x8a9,0x62c)][-0x372+-0x2656+0x29c8]['formattedS'+'ize'][_0x79283c(0x134e,0x1150,0x1312,0x1caa)]('MB')[-0x1785+0x233*0xb+-0xac],-0xd8b+0x358*0x5+0xba))return _0x1db05d(_0x4b485e[_0x79283c(0x2082,0x1b5c,0x18d9,0x258c)](_0x4b485e['UqERc'],util[_0x3c4231(0x1222,0x1c77,0x1613,0x1abb)](_0x21ce7e)));continue;case'4':const _0x552ed3={};_0x552ed3['url']=_0x21ce7e['thumbnail'];const _0x14b390={};_0x14b390[_0x3c4231(0x1b11,0x1283,0x25ba,0x1ef8)]=_0x552ed3,_0x14b390['jpegThumbn'+_0x3c4231(0x44a,0xe32,0x162f,0xfc6)]=buf,_0x14b390[_0x79283c(0xb32,0xde9,0x626,0x1903)]=''+cap,_0x175756[_0x79283c(0x9dd,0xdc5,0xaa5,0x833)+'e'](_0x5cd288[_0x3c4231(0x21f8,0x1f84,0x9b3,0x1441)],_0x14b390,{'quoted':_0x5cd288});continue;}break;}}else{const _0xcf92a7={};_0xcf92a7[_0x3c4231(0x16f7,0x10e1,0x2ca8,0x1fee)]='😒',_0xcf92a7[_0x3c4231(0x769,0xb84,0xbf9,0xc04)]=_0x551544[_0x3c4231(0x1365,0x16f8,0x10fb,0xc04)];const _0x2e6f3f={};_0x2e6f3f[_0x79283c(0x218d,0x1e3b,0x28bb,0x1383)]=_0xcf92a7,_0x5a8b5b[_0x79283c(0x5b6,0xdc5,0x39d,0xa0)+'e'](_0x4cd541,_0x2e6f3f),_0x142ef8=_0x16e41f['readFileSy'+'nc'](_0x3c4231(0x1021,0x14cc,0x1070,0xdd0)+_0x79283c(0xc22,0x1a94,0xf20,0x2650)+_0x3c4231(0xc3d,-0x758,0x77b,0x74d)+_0x3c4231(0x13a3,0x1c63,0x13c2,0x196f));const _0x5a983d={};_0x5a983d[_0x3c4231(0xa12,0x68f,0x507,0x12af)]=_0x502746,_0x29aff7[_0x3c4231(0x16bd,0x1718,0x1324,0xbf9)+'e'](_0x15c35a[_0x3c4231(0xb48,0x22c2,0x1bfa,0x1441)],_0x5a983d);const _0x35edd9={};_0x35edd9[_0x79283c(0x1c1b,0x21ba,0x2e04,0x2edc)]=''+_0x21b0bc['K39'];const _0x3ef464={};_0x3ef464['quoted']=_0x524245,_0x116e45[_0x3c4231(0x14bb,0x10f6,0x1869,0xbf9)+'e'](_0x2a6985[_0x79283c(0xa0a,0x160d,0x10bf,0xfdd)],_0x35edd9,_0x3ef464);}})[_0x313705(0xc9a,0x321,0x30c,0x191b)](_0x16c57d=>{const _0x5ea765={'PFwqo':function(_0xd073a5,_0x3dccaa){function _0x2c51e7(_0x12c229,_0x2c3adc,_0x21ef68,_0x55b689){return _0x2506(_0x21ef68-0x10a,_0x55b689);}return _0x4b485e[_0x2c51e7(-0x147,0xc84,0xa44,0x2b4)](_0xd073a5,_0x3dccaa);},'hhoiV':_0x4b485e['WzLVv']};function _0x3d57c7(_0x51c024,_0x1e571c,_0x3dcb13,_0x1ea12c){return _0x313705(_0x1e571c- -0x3e4,_0x3dcb13,_0x3dcb13-0x19c,_0x1ea12c-0x111);}function _0x4a558c(_0xfe02f5,_0x5128bd,_0x3adb4c,_0x452e06){return _0x23937d(_0x452e06-0x586,_0x3adb4c,_0x3adb4c-0x13f,_0x452e06-0x60);}_0x4b485e[_0x3d57c7(0xfbe,0xc85,0x2e4,0x377)](_0x4b485e[_0x4a558c(0xc43,0x248d,0x1b33,0x1676)],_0x4b485e['gqZYT'])?_0x1db05d(mess[_0x4a558c(0x10a5,0x14b9,0x1917,0xbc1)]):_0x4143e4=_0x5ea765[_0x3d57c7(0x80f,0xf52,0xa61,0x4b8)](_0x19e7a3[0x1*-0x7eb+0xa0*-0x35+0x11c*0x25],_0x5ea765['hhoiV']);});}else{if(_0x5154f0)return _0x5ee4c0(_0x57415a[_0x23937d(0x61c,0xd38,0xe08,0x138d)]);if(_0x35c042)return _0x4b485e[_0x313705(0x6b1,0x3f9,-0x2a2,0x7f2)](_0x888f52,_0x3c47dd[_0x23937d(0x5c0,0x1461,0x1135,0xd60)]);if(!_0x3f6393['quoted'])_0x4b485e[_0x313705(0xe6d,0x1d6f,0x9e0,0x6d1)](_0x3f36f6,![]);let {chat:_0x2a2424,fromMe:_0x4293de,id:_0x5569fa,isBaileys:_0x1a0c11}=_0x1d5502[_0x23937d(0x5dc,0xd28,0xb10,-0x340)];if(!_0x1a0c11)return _0x4b485e['cMZaN'](_0x4ef794,_0x313705(0xaa1,0xcdc,0x14fc,0x737)+'e\x20Was\x20Not\x20'+_0x23937d(0x14d,0xe37,-0x90,-0x389)+_0x23937d(0x522,0x10d0,-0x270,0x13a3));const _0x27b2cf={};_0x27b2cf[_0x23937d(0x1f4,-0x84,-0x1ac,0x906)]=_0x2baf0d[_0x313705(0x14f2,0x16ca,0x1ffb,0xadf)],_0x27b2cf['fromMe']=!![],_0x27b2cf['id']=_0x55799f[_0x23937d(0x5dc,0x762,0x12ff,0x735)]['id'],_0x27b2cf[_0x23937d(0x461,0xdcf,-0xaac,-0x652)+'t']=_0x29f904[_0x313705(0x942,0xe6d,0x101e,0x1516)][_0x23937d(0x14ce,0x1e51,0x1e9e,0x7ae)];const _0x241920={};_0x241920[_0x313705(0xe4c,0xd,-0xb2,0x1145)]=_0x27b2cf,_0x143bc4[_0x23937d(0x944,-0x1d,0xebd,0x9ae)+'e'](_0x2690a4[_0x23937d(0x118c,0xf73,0x1759,0x42e)],_0x241920);}}break;case _0x313705(0x12d4,0x7a5,0x1034,0x18c2):case _0x4b485e['Zyxoi']:{if(_0x1bac1f)return _0x1db05d(mess[_0x23937d(0x61c,-0x742,0xb7,0xfa0)]);if(_0x1e03f5)return _0x4b485e[_0x313705(0x1308,0x810,0x1ce6,0x67a)](_0x1db05d,mess['banChat']);if(!_0x1ba32f[_0x313705(0x1f7c,0x29f9,0x1d0b,0x28eb)]('\x20'))return _0x4b485e[_0x23937d(0x1cf2,0x1d05,0x1f11,0x25fa)](_0x1db05d,_0x4b485e[_0x313705(0x3db,0x4f2,0x7e5,0x28d)]);try{if(_0x4b485e['dzgVf'](_0x4b485e[_0x23937d(0x396,0x452,0xbb0,0xbdb)],_0x4b485e['ajYDc']))hx[_0x313705(0x12d4,0xb2a,0x20e1,0xba1)](_0x1ba32f[_0x313705(0x1f7c,0x23ef,0x2231,0x26a5)]('\x20'))[_0x23937d(0x1b61,0x1e92,0x1fc9,0x11e2)](async _0x2b37cd=>{imgnyee=_0x2b37cd[Math['floor'](_0x4b485e[_0x345a01(0xeeb,0xf94,0x7b8,0x1a1e)](Math[_0x30b500(0x1e45,0x23e1,0x187a,0x1269)](),_0x2b37cd[_0x30b500(0x89a,0x1147,0x4de,0x1324)]))];const _0x4f9e15={};function _0x345a01(_0x330978,_0x16d3da,_0xd99191,_0x2f1178){return _0x313705(_0x16d3da-0x117,_0x330978,_0xd99191-0x17e,_0x2f1178-0x90);}_0x4f9e15[_0x345a01(0x152b,0x1871,0xa9c,0x172a)+'t']=_0x4b485e[_0x345a01(0x1f76,0x18cb,0xc51,0xc1d)];function _0x30b500(_0x1759f7,_0x401f29,_0x187a5c,_0x2d8f6c){return _0x23937d(_0x187a5c-0x100,_0x401f29,_0x187a5c-0x19b,_0x2d8f6c-0x19a);}let _0xecbbdd=[{'buttonId':_0x30b500(0x10a2,0x1745,0xe95,0x1378)+_0x1ba32f[_0x30b500(0x2a91,0x11f9,0x1d16,0x2769)]('\x20'),'buttonText':_0x4f9e15,'type':0x1}];const _0x566dbf={};_0x566dbf[_0x345a01(0xb7f,0xef6,0x1b1,0x1ce8)]=imgnyee;let _0xfaba4c={'image':_0x566dbf,'caption':_0x4b485e[_0x30b500(0xe0b,0x5cf,0xf86,0x1b8b)](global[_0x345a01(0x23ff,0x1e17,0x1dc2,0x1767)]+(_0x30b500(0x2caa,0x28f8,0x1e70,0x2418)+'\x20'),_0x1ba32f['join']('\x20'))+('\x0a'+global[_0x345a01(0x10d0,0x1e17,0x27f2,0x1ec4)]+(_0x30b500(0xd4c,0x17db,0x10bf,0xdfd)+'rl\x20:\x20'))+imgnyee,'footer':''+global['botname'],'buttons':_0xecbbdd,'headerType':0x4,'contextInfo':{'externalAdReply':{'title':''+global[_0x345a01(0xf3a,0xde9,0xea6,0xbc8)],'body':''+global['ownername'],'thumbnail':log0,'mediaType':0x2,'mediaUrl':''+global[_0x345a01(-0x264,0xc77,0x12ba,0xb21)],'sourceUrl':''+global['btnurl']}}};_0x175756[_0x30b500(0x1792,0x1722,0xa44,-0x192)+'e'](_0x5cd288['chat'],_0xfaba4c,{'quoted':_0x5cd288});})['catch'](_0x324616=>_0x324616);else{const _0x1a3ac9={};_0x1a3ac9[_0x23937d(0x13f4,0xeef,0x163a,0x1bac)+'t']=_0x2a057f;const _0x58c368={};_0x58c368[_0x23937d(0x1b0c,0x1e38,0xcc8,0x15c0)]='y',_0x58c368[_0x23937d(0x159c,0x9ee,0x1917,0x1428)]=_0x1a3ac9,_0x58c368[_0x313705(0xa9e,0xa49,0x150b,0x1687)]=0x1;const _0x52510c=[_0x58c368],_0x303dd7={};_0x303dd7[_0x23937d(0xa79,0x12ca,0xfff,0xc2c)]=_0x4bcb8a['images'][_0x5163c8]['url'];const _0x5c1110={};_0x5c1110[_0x313705(0x1fa9,0x252f,0x18b6,0x2ad7)]=_0x303dd7,_0x5c1110[_0x23937d(0x968,0xf94,0xa1c,0xaad)]=''+_0x56c506['caption'],_0x5c1110[_0x313705(0xfff,0x124a,0x12ce,0x795)]=''+_0x2b8544,_0x5c1110[_0x313705(0xfa0,0x19aa,0x584,0x107e)]=_0x52510c,_0x5c1110['headerType']=0x4;const _0x41aa84=_0x5c1110,_0x208ab3={};_0x208ab3['quoted']=_0x5a74f7,_0x260d40['sendMessag'+'e'](_0x21c925,_0x41aa84,_0x208ab3);}}catch{_0x1db05d(_0x4b485e[_0x313705(0x392,0x1281,0xa05,-0xf)]);}}break;case _0x4b485e[_0x23937d(0xc90,0x12d0,0x764,0xe02)]:{if(_0x1bac1f)return _0x4b485e[_0x313705(0xca7,0x185e,0xcdd,0x2f9)](_0x1db05d,mess[_0x313705(0x982,0x1667,0x13c3,0x1353)]);if(_0x1e03f5)return _0x4b485e[_0x313705(0x1157,0xb34,0x206f,0x2010)](_0x1db05d,mess[_0x313705(0x926,0x73e,0xf07,0x10af)]);if(!_0x494254)return _0x4b485e['alEIb'](_0x1db05d,mess['linkm']);if(!_0x4b485e[_0x313705(0x3d1,0x12,-0xaa7,0xe33)](isUrl,_0x1ba32f[-0x2160+0x2215+-0xb5])&&!_0x1ba32f[-0xe21*0x1+0x76d+0x6b4][_0x313705(0x4de,-0x871,0x11aa,0x97e)](_0x4b485e['bciWo']))return _0x4b485e['WfOAk'](_0x1db05d,_0x23937d(0x18a0,0x1198,0x17dd,0xd4c)+'ou\x20provide'+_0x23937d(0xc5d,0x408,0x1b22,0xea3)+'id');const _0x544571=await _0x4b485e[_0x23937d(0xce1,0x4ce,0x1093,0x15c1)](mediafireDl,_0x494254);if(_0x4b485e[_0x23937d(0x948,0x47a,0x92b,0xfa2)](_0x544571[-0x8f*0x32+0x10c3+0xb2b]['size']['split']('MB')[0xeed+-0x392*0x3+0x1*-0x437],0x2b3+0xf06+0x6e9*-0x2))return _0x4b485e[_0x23937d(0x9a3,0x861,-0x4f2,0x24a)](_0x1db05d,_0x4b485e[_0x313705(0x1251,0x61a,0xa8e,0xae9)](_0x4b485e['UqERc'],util['format'](_0x544571)));const _0x1ada92=global[_0x313705(0xcd2,0x1b1e,0x7ad,0xe25)]+(_0x313705(0x20f5,0x1252,0x1edf,0x22ba)+_0x313705(0xb78,0x98e,0x33a,0x1761)+'DER🧲*\x0a\x09\x09\x09\x09'+_0x313705(0x830,0x1548,0x139b,0x13d2))+_0x544571[-0x2280+-0x71f*0x4+0x3efc]['nama']+'\x0a*Size*\x20:\x20'+_0x544571[0x330+0x7*-0x6+-0x306][_0x23937d(0x1bc6,0x18fb,0x12df,0x2439)]+_0x313705(0x1482,0x5e9,0x17ff,0x1e1b)+_0x544571[0x161f+-0x1550+-0xcf][_0x313705(0x562,0x7d5,0x71b,0xca3)]+_0x23937d(0xc33,0x19ec,0x107b,0x77a)+_0x544571[-0x79f*-0x3+-0x1*-0xe48+0x25*-0x101][_0x313705(0x1e5e,0x13f2,0x2006,0x12cf)];_0x1db05d(''+_0x1ada92);const _0x3faec2={};_0x3faec2[_0x313705(0xddf,0x1b94,0x1c27,0xc43)]=_0x544571[0x1eea+0x53*0x26+-0x2b3c][_0x313705(0x1e5e,0x1fa1,0x1769,0x19ef)];const _0x2ab7ba={};_0x2ab7ba[_0x313705(0xf74,0xd71,0x33b,0x1b14)]=_0x3faec2,_0x2ab7ba[_0x23937d(0xb19,0x256,0xcff,0x59)]=_0x544571[0x3ea+0x13*-0x65+-0x7*-0x83][_0x23937d(0xd6a,0x7d3,0xdca,0xfc5)],_0x2ab7ba[_0x313705(0x1610,0x243d,0x1841,0x158f)]=_0x544571[-0xf4b+-0x15d*-0xa+0x1*0x1a9][_0x23937d(0x1fc,0xa47,-0xafc,0x165)],_0x175756['sendMessag'+'e'](_0x5cd288[_0x313705(0x14f2,0x2076,0x2386,0xdb8)],_0x2ab7ba,{'quoted':_0x5cd288})[_0x313705(0xc9a,0x307,0xa6,0x15a0)](_0x45103e=>_0x1db05d(mess['error']));}break;case _0x4b485e[_0x313705(0x13a2,0x17ad,0x1066,0x1bf8)]:case _0x23937d(0xb73,0x1013,0x1667,0xb97):{if(_0x1bac1f)return _0x4b485e['esVaf'](_0x1db05d,mess[_0x313705(0x982,0x187f,0x133f,0x117b)]);if(_0x1e03f5)return _0x4b485e[_0x313705(0x14fd,0x14bd,0xf82,0x1cb5)](_0x1db05d,mess[_0x23937d(0x5c0,0x12ec,-0x112,0x631)]);if(!_0x494254)return _0x1db05d(_0x23937d(0xda5,0x1be6,0x13ce,-0x53)+_0x4b485e['DmunF'](_0xe1d953,_0x1354e9)+(_0x313705(0x1802,0x22af,0x22b5,0xd27)+_0x23937d(0x1761,0x2499,0x259b,0x2173)+_0x313705(0x132c,0x12b6,0x8dd,0x1109)+_0x313705(0x1885,0x1ff7,0x2572,0xbd9)+_0x313705(0x1d02,0x2b0c,0x23f5,0x2a5a)+_0x313705(0x16ba,0xd33,0x9af,0x1285)+_0x23937d(0x1810,0x1206,0x13ad,0x1580)+_0x313705(0x414,0x8f6,-0xca,-0x515)));let {umma:_0x467dac}=_0x4b485e['ljaYg'](require,_0x4b485e['LtnEn']),_0x3d5001=await _0x4b485e['OaArt'](_0x467dac,_0x4b485e[_0x313705(0x157a,0xbf2,0xd41,0x80a)](isUrl,_0x494254)[0x629*-0x2+-0x1*0xd61+0x19b3]);if(_0x4b485e[_0x23937d(0x1a51,0x192b,0x27d9,0x1511)](_0x3d5001[_0x23937d(0x738,0x15ca,0xc8c,0x1527)],_0x4b485e['EUqkY'])){const _0x3c6097={};_0x3c6097[_0x23937d(0x13f4,0x1d7e,0x5ee,0xfdd)+'t']=_0x4b485e[_0x23937d(0x16e3,0x17fe,0xe6a,0x2367)];const _0x45bb75={};_0x45bb75[_0x313705(0x1e72,0x16b2,0x1f81,0x253d)]=_0x23937d(0x77d,0x1549,0xc96,-0x30f)+_0x3d5001[_0x23937d(0x1465,0x2137,0x15d7,0x1b6f)][0x50d+-0x558+0x4b]+_0x23937d(0x670,0xfc2,0x44e,0xe9a),_0x45bb75['buttonText']=_0x3c6097,_0x45bb75[_0x313705(0xa9e,0x66d,-0x206,0x127c)]=0x1;const _0x179be6={};_0x179be6[_0x23937d(0x13f4,0x12ac,0x1f21,0x21ba)+'t']=_0x4b485e['eGtvx'];const _0x157b2d={};_0x157b2d[_0x313705(0x1e72,0x217f,0x1228,0x2230)]=_0x313705(0x10eb,0x8e7,0x98a,0xfe8)+_0x3d5001[_0x23937d(0x1465,0x1d92,0xc6d,0x11c2)][-0x247e+0x10b*-0x16+0x3b70]+_0x23937d(0x19fa,0x1901,0x224f,0x226d),_0x157b2d[_0x313705(0x1902,0x1192,0xec7,0x21bd)]=_0x179be6,_0x157b2d[_0x23937d(0x738,-0xe5,0x4b2,0x8a9)]=0x1;let _0x281ea5=[_0x45bb75,_0x157b2d];const _0x271de4={};_0x271de4['url']=_0x3d5001[_0x23937d(0x6b1,0x12dd,0xdc,0x889)][_0x313705(0x1870,0x1697,0x1372,0x1701)];const _0x4e8d3f={};_0x4e8d3f[_0x313705(0x1fa9,0x286e,0x11af,0x1af4)]=_0x271de4,_0x4e8d3f[_0x313705(0xcce,0x627,0x2e,0x18a2)]='\x0a'+dragonemoji+_0x313705(0x1496,0x1885,0x12ec,0xaea)+_0x3d5001[_0x313705(0x1b3f,0x173b,0x25cd,0x2411)]+'\x0a'+dragonemoji+_0x23937d(0xafd,0x2a7,0x17e1,0x11cd)+_0x3d5001[_0x23937d(0x6b1,0x9f6,-0x4e3,-0x3d)]['name']+'\x0a'+dragonemoji+_0x313705(0x7af,-0x4f0,0x6cd,0x8f4)+_0x3d5001['like']+'\x0a'+dragonemoji+('\x20Caption\x20:'+'\x20')+_0x3d5001[_0x23937d(0x968,0x1200,0x546,0x116)]+'\x0a'+dragonemoji+_0x313705(0x177f,0xda9,0x264d,0xbc8)+_0x3d5001[_0x23937d(0x1465,0x173f,0x16a9,0x90b)][-0x25fd+-0x1c4a+0x37d*0x13]+(_0x313705(0x1a6b,0x1c3a,0x2448,0x1809)+_0x23937d(0x16d8,0x1ba3,0x1149,0x1d7e)+_0x23937d(0xf78,0x1090,0x1ced,0x12ce)+_0x23937d(0xecb,0x8c5,0xf76,0x1806)+_0x313705(0x1f42,0x2101,0x11fc,0x1954)+_0x23937d(0xc9a,0x1081,0x1ab,0x157f)+_0x313705(0x2165,0x1695,0x1846,0x3046)+_0x313705(0x2027,0x2932,0x2c87,0x12bb)+'p4\x20Command'+_0x313705(0xb80,-0xa4,0x115b,0x1273)+'Url\x20Above\x0a'),_0x4e8d3f[_0x23937d(0x106e,0x10ae,0x16f8,0x1d64)]=_0x175756[_0x23937d(0x421,0x10ce,0xb0d,-0x63c)]['name'],_0x4e8d3f[_0x313705(0xfa0,0x909,0x1b3d,0xd65)]=_0x281ea5,_0x4e8d3f[_0x23937d(0x1b19,0x1b22,0x1c18,0x1f9f)]=0x4;let _0x49b386=_0x4e8d3f;_0x175756['sendMessag'+'e'](_0x5cd288[_0x23937d(0x118c,0x1582,0x1990,0x12f5)],_0x49b386,{'quoted':_0x5cd288});}else{if(_0x4b485e['WUaVF'](_0x3d5001[_0x313705(0xa9e,0x785,-0x2f9,0x1444)],_0x4b485e[_0x23937d(0x19c,0x77b,0x9a6,0x8d5)])){if(_0x4b485e[_0x313705(0x5e0,0xade,0x14d7,0x62b)](_0x4b485e[_0x23937d(0x11d9,0x38f,0x156a,0x5b9)],_0x4b485e[_0x313705(0x153f,0x1d22,0xa1f,0x1a34)])){const _0x5d0ece={};_0x5d0ece['text']=''+_0x4806e4['K62'];const _0x57cfdc={};_0x57cfdc[_0x23937d(0x5dc,-0x46b,0xef5,-0x80d)]=_0x28b4fb,_0x1326b4[_0x23937d(0x944,0x16fa,-0x2b7,0x151d)+'e'](_0x51c5ab['chat'],_0x5d0ece,_0x57cfdc);}else _0x3d5001[_0x313705(0x17cb,0x1c49,0xfbe,0x2291)][_0x313705(0xe7c,0xc50,0xb2d,0x1468)](async _0x758325=>{function _0x2b6bc9(_0x5e12c4,_0x50845e,_0x38adb2,_0xa1f488){return _0x23937d(_0x5e12c4- -0x3c,_0x50845e,_0x38adb2-0x1,_0xa1f488-0xde);}function _0x40ed78(_0x56bf3d,_0x10a0fa,_0xda58cb,_0x4667d1){return _0x23937d(_0xda58cb-0x19f,_0x56bf3d,_0xda58cb-0x7e,_0x4667d1-0x177);}const _0x8e05ae={};_0x8e05ae['url']=_0x758325;const _0x355b4f={};_0x355b4f[_0x2b6bc9(0x1c07,0xd2d,0x24be,0x2480)]=_0x8e05ae,_0x355b4f[_0x2b6bc9(0x92c,0x686,-0x1ae,-0x33d)]=dragonemoji+_0x2b6bc9(0x10f4,0xc63,0xdf4,0x1aef)+_0x3d5001['title']+'\x0a'+dragonemoji+'\x20Author\x20:\x20'+_0x3d5001[_0x40ed78(0xbb,0xcb0,0x850,0x11bf)]['name']+'\x0a'+dragonemoji+'\x20Like\x20:\x20'+_0x3d5001['like']+'\x0a'+dragonemoji+(_0x2b6bc9(0x447,0x5a7,0x120c,-0x894)+'\x20')+_0x3d5001[_0x2b6bc9(0x92c,0x9b1,-0x5a9,0x801)],_0x175756[_0x40ed78(0x25,0x1331,0xae3,0x129e)+'e'](_0x5cd288['chat'],_0x355b4f,{'quoted':_0x5cd288});});}}}break;case _0x4b485e[_0x313705(0xc8f,0x184f,0x20c,0x1a1b)]:{if(_0x1bac1f)return _0x4b485e[_0x23937d(0x1c46,0x1aa2,0x1a89,0x1be7)](_0x1db05d,mess['ban']);if(_0x1e03f5)return _0x4b485e[_0x23937d(0xdc4,0x6c8,0x22b,0x1c4e)](_0x1db05d,mess[_0x23937d(0x5c0,0x11b0,0xa0c,0x899)]);if(!_0x494254)return _0x4b485e[_0x313705(0x1ee9,0x2989,0x198f,0x1531)](_0x1db05d,_0x23937d(0x192d,0x2095,0x1394,0x1fc4)+'he\x20rington'+_0x23937d(0x193e,0x2021,0x1d1d,0xdf7)+_0x23937d(0xf4d,0x1acb,0xf4c,0x1920)+_0x23937d(0x14d7,0x1715,0x232d,0x211d)+_0x4b485e[_0x23937d(0x177d,0x85e,0xf06,0x1de8)](_0xe1d953,_0x1354e9)+(_0x23937d(0x539,0x68c,0x127d,-0x469)+'uth'));let {ringtone:_0x5ea4e0}=_0x4b485e[_0x23937d(0x1a07,0x25e6,0x1d26,0x258e)](require,_0x313705(0x1db4,0x1e99,0xf7a,0x205b)+_0x23937d(0x653,-0x691,0xad8,-0x840)),_0x588ed9=await _0x4b485e[_0x23937d(0x42d,0x674,0x92f,-0x747)](_0x5ea4e0,_0x494254),_0x395e8e=_0x588ed9[Math[_0x23937d(0x7f1,-0x2b4,0x211,0x1186)](_0x4b485e[_0x23937d(0x1735,0x2527,0x2408,0x171b)](Math['random'](),_0x588ed9['length']))];const _0x2fa7bc={};_0x2fa7bc['url']=_0x395e8e[_0x313705(0x168e,0x1318,0xba6,0x2549)];const _0x227ddc={};_0x227ddc[_0x313705(0x168e,0x1966,0x1f05,0x17da)]=_0x2fa7bc,_0x227ddc[_0x313705(0xe7f,0x98f,0x193f,0xd3f)]=_0x395e8e[_0x313705(0x1b3f,0x2a4a,0x1328,0x266b)]+_0x23937d(0x58f,-0x819,0x8cf,0x70d),_0x227ddc[_0x313705(0x1610,0xf78,0x1ae9,0x1c13)]=_0x4b485e[_0x23937d(0x19b8,0x1094,0x18c5,0xe4c)],_0x175756[_0x23937d(0x944,-0x13c,0x776,0x711)+'e'](_0x5cd288[_0x23937d(0x118c,0x17e3,0x795,0x10e1)],_0x227ddc,{'quoted':_0x5cd288});}break;case _0x4b485e['vjmXv']:{if(_0x1bac1f)return _0x1db05d(mess[_0x313705(0x982,0x1f4,0x39a,0x57d)]);if(!_0x1ba32f['join']('\x20'))return _0x4b485e['MNuWC'](_0x1db05d,_0x313705(0x6c9,0xbcd,0x1b5,0x1ce)+(_0xe1d953+_0x1354e9)+'\x2010');var _0x432ae6=_0x1ba32f[_0x23937d(0x1c16,0x1a09,0x122d,0x2115)]('\x20');media=await _0x175756[_0x23937d(0xdcf,0xa98,0x1a66,0x1341)+'dSaveMedia'+_0x313705(0x117a,0x5c5,0x1027,0xee6)](_0x3e5ec4,_0x4b485e[_0x313705(0x162e,0x1b67,0xb41,0x1f5a)]);if(_0x385e1b)ran=_0x4b485e[_0x313705(0x95a,0x1768,0x435,0x179b)](getRandom,_0x4b485e[_0x23937d(0x3d,0xcb6,0x809,-0xd41)]),exec(_0x313705(0x1d90,0x274a,0x1773,0xe9d)+media+('\x20-filter:a'+_0x23937d(0x7c3,-0x685,0xbfc,0xfaa)+'.0,asetrat'+'e=')+_0x432ae6+'\x22\x20'+ran,(_0x2b9719,_0x3e0023,_0x4fe354)=>{const _0x3e3c9a=_0x4b485e['xNAAZ'][_0x407a3a(0x123c,0xe81,0xbef,0x1e8a)]('|');function _0x407a3a(_0x2d99d6,_0x1c8c9f,_0x1d823d,_0x57b018){return _0x313705(_0x2d99d6-0x207,_0x57b018,_0x1d823d-0x1f4,_0x57b018-0x108);}function _0x4fbc8f(_0x20a150,_0x21a976,_0x485f39,_0x498473){return _0x23937d(_0x485f39- -0x22,_0x21a976,_0x485f39-0x25,_0x498473-0xeb);}let _0x92dc97=-0x7*0x4a9+0x1c8b*0x1+-0x105*-0x4;while(!![]){switch(_0x3e3c9a[_0x92dc97++]){case'0':hah=fs[_0x407a3a(0x192a,0xf71,0x1386,0x1c8c)+'nc'](ran);continue;case'1':fs[_0x407a3a(0x578,-0x69a,0x89e,0x232)](media);continue;case'2':fs[_0x4fbc8f(-0x661,-0x47,-0x17,0x372)](ran);continue;case'3':const _0x587049={};_0x587049[_0x407a3a(0x1895,0xc1b,0x12e8,0xe9d)]=hah,_0x587049[_0x407a3a(0x1817,0x1aac,0x1a1e,0x2266)]=_0x4b485e['JkqmH'],_0x587049[_0x4fbc8f(0xd33,0x121b,0xbb7,0x1acc)]=!![];const _0x3d3d0f={};_0x3d3d0f[_0x407a3a(0xb49,0x18b0,0x1942,0x1a49)]=_0x5cd288,_0x175756[_0x4fbc8f(-0x5e5,-0x71,0x922,0xb02)+'e'](_0x423161,_0x587049,_0x3d3d0f);continue;case'4':if(_0x2b9719)return _0x1db05d(_0x4b485e[_0x407a3a(0xc72,0x532,0x1400,-0x17d)]);continue;}break;}});else _0x3a23df?_0x4b485e[_0x23937d(0x1ac1,0x101e,0xd14,0x1736)](_0x4b485e[_0x313705(0x1661,0x1fa3,0xf8d,0x7f7)],_0x4b485e[_0x313705(0x1661,0x13e1,0x24ef,0x16e0)])?_0x4b485e[_0x313705(0x1d9f,0x1b7a,0x2547,0x1750)](_0x3f550d,'Transactio'+_0x313705(0x11e7,0x51d,0x823,0xec5)+_0x313705(0xbe5,0x5d,-0x2b1,0x1008)+_0x313705(0x212e,0x1b2b,0x1a19,0x21d3)+_0x23937d(0x852,0xf5c,0x20,0x1477)+_0x4b485e[_0x313705(0x3c0,-0x1b0,0x3b1,0x54f)](_0x14281f,_0x5bb885[_0x313705(0x1834,0x1b37,0x15f7,0x1b76)])+(_0x313705(0x101b,0x136a,0x11dc,0x10c0)+_0x23937d(0x1039,0x1ea9,0x5f0,0x13f3))+_0x4b485e[_0x23937d(0xc41,0x1070,0x165,0xb68)](_0x49220e,_0x3ff1c7[_0x313705(0x1834,0x10f2,0x1e1b,0x1c26)])):(ran=getRandom('.mp4'),exec('ffmpeg\x20-i\x20'+media+('\x20-filter:a'+_0x23937d(0x7c3,-0x711,-0x3e1,0xc83)+_0x23937d(0x32c,0xb8a,0xf5,-0x5c3)+'e=')+_0x432ae6+'\x22\x20'+ran,(_0x414796,_0x450e5d,_0x5841ba)=>{function _0x1362b9(_0xe3105,_0x1313d6,_0x314b30,_0x438379){return _0x23937d(_0xe3105-0x5ba,_0x1313d6,_0x314b30-0x94,_0x438379-0x192);}function _0x3f653e(_0x4b2c5e,_0x2d933a,_0x427c8c,_0x51484a){return _0x313705(_0x4b2c5e- -0x4e2,_0x2d933a,_0x427c8c-0xdf,_0x51484a-0x18b);}const _0x2bf8ca={'lfrKK':function(_0x544546,_0x58536f){function _0x4a1e98(_0x5404c6,_0x37c729,_0x2e25d3,_0x49a837){return _0x2506(_0x49a837-0x336,_0x2e25d3);}return _0x4b485e[_0x4a1e98(0x1544,0x2755,0x15fe,0x1978)](_0x544546,_0x58536f);},'UHHRT':function(_0x34e272,_0x4a5dc0){function _0x452584(_0x13c2af,_0x4ed33d,_0x586808,_0x381509){return _0x2506(_0x13c2af-0x263,_0x586808);}return _0x4b485e[_0x452584(0x1613,0xe06,0x1c4b,0x14c8)](_0x34e272,_0x4a5dc0);},'WPyqs':_0x4b485e[_0x1362b9(0x12b4,0x170c,0x107e,0x14a8)]};if(_0x4b485e[_0x1362b9(0x8ff,0x120e,0x5f2,0x818)](_0x4b485e['UrZxt'],_0x4b485e[_0x3f653e(0xc17,0x1af2,0x10dc,0x1a08)])){fs[_0x3f653e(-0x171,0xa98,0xd20,0x251)](media);if(_0x414796)return _0x4b485e[_0x3f653e(0x999,0xcc7,0x1832,0xe0c)](_0x1db05d,_0x4b485e[_0x1362b9(0xcbf,0x3f2,0x4f2,0x1171)]);hah=fs['readFileSy'+'nc'](ran);const _0x308530={};_0x308530[_0x1362b9(0x1d1c,0x28c4,0x1924,0x1c0c)]=hah,_0x308530[_0x1362b9(0x1864,0xbb6,0x130e,0x216c)]=_0x4b485e[_0x3f653e(0x12e4,0xe40,0x1f6c,0x808)];const _0x16ed22={};_0x16ed22[_0x3f653e(0x460,0xb09,0x6a6,-0x844)]=_0x5cd288,_0x175756[_0x3f653e(0x7c8,-0x4ec,0x9b8,0xa01)+'e'](_0x423161,_0x308530,_0x16ed22),fs[_0x1362b9(0x5c5,0xdaa,0xecc,0x7a2)](ran);}else{if(_0x264932)return _0x2bf8ca['lfrKK'](_0x55f255,_0x4bcf4c[_0x1362b9(0xbd6,0x470,0x1390,0x126)]);if(_0x3dd840)return _0x1d84a9(_0x27b581[_0x3f653e(0x444,-0x8,0x144,0xfe3)]);if(!_0x5cf564[_0x3f653e(0x1ba7,0x1a95,0x2a53,0x2739)])return _0x1e8314(''+_0x38c860[_0x3f653e(0x104a,0x1916,0x1bf9,0xc52)]);if(!_0x410287)return _0x2bf8ca[_0x1362b9(0x19e7,0x2889,0x1b90,0x1953)](_0x193efc,''+_0x1333bf[_0x3f653e(0xf37,0x86e,0x397,0x1042)]);if(!_0x2d6c03)return _0x2bf8ca[_0x3f653e(0x12b1,0x1811,0x1177,0x1703)](_0xf89e30,''+_0x16909c[_0x1362b9(0x1a6c,0x1107,0x20e5,0x1b8f)]);let _0x2cd732=_0x3f653e(0x731,-0x101,0x12ff,0x4a3)+_0x3f653e(0x1145,0x1776,0x1eaf,0x1fc6)+'*Message\x20:'+'\x20'+(_0x54a738?_0x552d34:_0x2bf8ca[_0x1362b9(0x1448,0x138c,0x1d95,0x1afb)])+'*\x0a\x0a';for(let _0x383a9b of _0x595cd3){_0x2cd732+=_0x53163f+'\x20@'+_0x383a9b['id'][_0x3f653e(0xb53,0xfc7,0x119e,0x16bc)]('@')[-0x1cf*0x4+0x1*-0xc5c+-0x108*-0x13]+'\x0a';}const _0x350ab7={};_0x350ab7[_0x3f653e(0x460,-0xa92,0xda9,0x1074)]=_0x354183,_0x45426a[_0x3f653e(0x7c8,-0x39,0x3ea,0xd36)+'e'](_0x35a664['chat'],{'text':_0x2cd732,'mentions':_0x4e8b5b[_0x3f653e(0x99a,0x2f,0x11d,-0x403)](_0x179622=>_0x179622['id'])},_0x350ab7);}})):_0x1db05d(_0x4b485e['ctZRS']);}break;case'volume':{if(_0x1bac1f)return _0x4b485e['arKLa'](_0x1db05d,mess[_0x23937d(0x61c,-0x74e,0xc6d,0x928)]);if(_0x1e03f5)return _0x4b485e['nrocu'](_0x1db05d,mess[_0x313705(0x926,0xdf8,0xd5a,0x2a9)]);if(!_0x1ba32f[_0x23937d(0x1c16,0x2432,0x2414,0x29da)]('\x20'))return _0x4b485e['OVjQg'](_0x1db05d,_0x313705(0x6c9,0xb1,0xaeb,-0x14f)+_0x4b485e[_0x313705(0x18a6,0x222a,0xfc7,0x11b2)](_0xe1d953,_0x1354e9)+_0x313705(0xe5e,0xd77,0xd35,0x1a2e));media=await _0x175756[_0x23937d(0xdcf,0x1c0e,0x107f,0xf6d)+_0x23937d(0xe48,0x382,0x183f,0x1ba8)+_0x313705(0x117a,0x1c18,0x495,0x2023)](_0x3e5ec4,_0x313705(0x1924,0xbac,0x13d8,0x1d1b));if(_0x385e1b)rname=_0x4b485e[_0x313705(0x2071,0x1997,0x25d1,0x281f)](getRandom,_0x4b485e[_0x313705(0x3a3,0x1109,-0x231,-0x369)]),exec(_0x313705(0x1d90,0x15a8,0x2455,0x14b9)+media+(_0x23937d(0x162c,0x17d5,0x21c2,0x2038)+_0x313705(0x1fb1,0x1d15,0x24f8,0x2d08))+_0x1ba32f[0x8be*-0x2+-0xadf+0x1c5b]+'\x20'+rname,(_0x411ffb,_0x37e4ec,_0x44a5ef)=>{const _0x5a5b86=_0x4b485e[_0x3b3734(0x193a,0x18fd,0xb39,0x1058)][_0x3b3734(0x1484,0x1b52,0xf9d,0x270)]('|');function _0x3b3734(_0x14994b,_0x26d222,_0x1d641f,_0x2c6ff7){return _0x313705(_0x1d641f- -0x98,_0x2c6ff7,_0x1d641f-0xa2,_0x2c6ff7-0x149);}function _0x3f6d1c(_0x289f07,_0x51bfae,_0x42da2b,_0x530a57){return _0x23937d(_0x51bfae- -0x10f,_0x42da2b,_0x42da2b-0x1ac,_0x530a57-0x91);}let _0x56b353=-0x15*0x1a2+-0xc*0xf1+-0x1*-0x2d96;while(!![]){switch(_0x5a5b86[_0x56b353++]){case'0':fs[_0x3b3734(0xc6b,0xcce,0x2d9,0x6d)](rname);continue;case'1':jadie=fs['readFileSy'+'nc'](rname);continue;case'2':const _0x317a35={};_0x317a35['audio']=jadie,_0x317a35[_0x3b3734(0xa18,0x8ed,0x1578,0x20a1)]=_0x3f6d1c(0x265,0x277,0x9a9,-0x7f6),_0x317a35['ptt']=!![];const _0x3f6dd4={};_0x3f6dd4[_0x3b3734(0x1215,0x767,0x8aa,0x1c)]=_0x5cd288,_0x175756[_0x3f6d1c(0x1209,0x835,0x13cc,0xe7a)+'e'](_0x423161,_0x317a35,_0x3f6dd4);continue;case'3':if(_0x411ffb)return _0x4b485e['gZmpZ'](_0x1db05d,_0x4b485e[_0x3f6d1c(0xc21,0x5f6,-0xd5,0x478)]);continue;case'4':fs[_0x3f6d1c(-0x4b9,-0x104,-0x9a9,0xbc)](media);continue;}break;}});else _0x3a23df?_0x23937d(0x4f,-0xf7,-0x8de,0xb7f)==='lJXqp'?_0x4b485e['sgUEn'](_0x322410,_0x4b485e[_0x23937d(0x53a,0xf46,0xe69,0x2ca)]):(rname=_0x4b485e[_0x313705(0xc81,0x1722,0x88c,0x185c)](getRandom,_0x23937d(0x1947,0x275c,0x1550,0xd12)),exec(_0x313705(0x1d90,0x12d5,0x117c,0x1d13)+media+(_0x313705(0x1992,0x1bff,0x1d3d,0x245f)+'\x20volume=')+_0x1ba32f[0xc5*-0x3+0x1b1*-0x11+-0x8e*-0x38]+'\x20'+rname,(_0x17f528,_0x38957c,_0x138094)=>{const _0x4cbfff=_0x4b485e[_0x44edb6(0x181c,0xb52,0x1f9a,0x14ce)]['split']('|');function _0x28bf3b(_0x78a1b5,_0xacc430,_0xf397e,_0x754f){return _0x23937d(_0x754f- -0x4,_0x78a1b5,_0xf397e-0x164,_0x754f-0x1c);}function _0x44edb6(_0x40602f,_0x1595ef,_0x2bafa7,_0x45bbad){return _0x313705(_0x45bbad- -0xb0,_0x2bafa7,_0x2bafa7-0x5d,_0x45bbad-0x199);}let _0x324f72=0x1b69*-0x1+-0x70*-0x4c+0x41*-0x17;while(!![]){switch(_0x4cbfff[_0x324f72++]){case'0':fs['unlinkSync'](rname);continue;case'1':jadie=fs[_0x28bf3b(0x13b4,0x1a9a,0xf56,0x13b9)+'nc'](rname);continue;case'2':if(_0x17f528)return _0x4b485e['rsSDg'](_0x1db05d,_0x4b485e[_0x28bf3b(-0x6e3,0x7df,0x5c4,0x701)]);continue;case'3':fs[_0x44edb6(0x72,-0xba1,-0xbde,0x2c1)](media);continue;case'4':const _0x271073={};_0x271073[_0x28bf3b(0x2014,0x2021,0x1031,0x175e)]=jadie,_0x271073[_0x28bf3b(0x1fc1,0x4a1,0x1a1b,0x12a6)]=_0x4b485e[_0x44edb6(0x1f03,0x2305,0x1e10,0x1716)];const _0x36fff1={};_0x36fff1[_0x28bf3b(0x555,0xffe,0x61,0x5d8)]=_0x5cd288,_0x175756['sendMessag'+'e'](_0x423161,_0x271073,_0x36fff1);continue;}break;}})):_0x4b485e[_0x23937d(0xe57,0x16ea,0x1bbe,0xadb)](_0x4b485e[_0x313705(0x1e58,0x2a0d,0x1458,0x116a)],_0x23937d(0x10fd,0xaa1,0x69a,0x168d))?_0x1db05d(_0x313705(0x1f7d,0x1cee,0x10f5,0x1eae)+_0x23937d(0x940,0x3a9,0xed,0xb9e)):_0x4b485e[_0x23937d(0xee,-0xda6,-0xb99,0xcda)](_0x271677,_0x3e4fa2['sender']);}break;case _0x4b485e[_0x23937d(0x62d,0x4aa,-0x5cb,-0x5ae)]:case _0x4b485e[_0x313705(0x62a,-0x757,0x708,0x71b)]:case _0x4b485e[_0x313705(0xb0c,0x124e,0xf6b,0x1c9)]:case _0x4b485e[_0x313705(0x201c,0x2b04,0x2668,0x2df7)]:case _0x4b485e[_0x313705(0xcea,0x705,0x1302,0x8a5)]:case _0x4b485e[_0x23937d(0x409,0x1287,0x11d0,-0x7df)]:case'nightcore':case _0x4b485e[_0x23937d(0x1c8,-0x1c9,0x34,0xd06)]:case _0x4b485e['fDOlf']:case _0x4b485e[_0x313705(0xffd,0xe5,0x8fe,0xcd1)]:case _0x4b485e[_0x313705(0x1864,0x1c42,0xc08,0xfd5)]:case _0x4b485e[_0x313705(0x1afc,0x2098,0x27bb,0x1ee9)]:if(_0x1bac1f)return _0x1db05d(mess[_0x313705(0x982,-0x3f0,0x10de,0x1793)]);if(_0x1e03f5)return _0x1db05d(mess['banChat']);try{let _0x4ba422;if(/bass/[_0x313705(0x1c74,0x274e,0xf23,0x1f04)](_0x1354e9))_0x4ba422=_0x4b485e[_0x313705(0x45a,-0x486,-0x5c1,-0x7d0)];if(/blown/[_0x313705(0x1c74,0x13ad,0x1d16,0x1a21)](_0x1354e9))_0x4ba422=_0x4b485e[_0x23937d(0xbcc,0x54a,0xacd,-0x12)];if(/deep/[_0x23937d(0x190e,0x10bc,0x1973,0x12f5)](_0x1354e9))_0x4ba422=_0x4b485e[_0x23937d(0x1cc8,0x1071,0x12c5,0x1bd0)];if(/earrape/['test'](_0x1354e9))_0x4ba422=_0x23937d(0xb30,0xd4e,0x9a6,-0x45)+_0x23937d(0x139d,0x12e6,0x1752,0x11e9);if(/fast/[_0x313705(0x1c74,0x233f,0x1b62,0x1e78)](_0x1354e9))_0x4ba422=_0x4b485e[_0x23937d(0x67e,0xb64,0x1d1,0xae0)];if(/fat/[_0x313705(0x1c74,0x1f09,0x266e,0x1e6a)](_0x1354e9))_0x4ba422=_0x313705(0xc8b,0x1876,0x157a,0x113c)+'\x22atempo=1.'+_0x23937d(0x12b2,0x1310,0x636,0x15d2)+'=22100\x22';if(/nightcore/[_0x313705(0x1c74,0x114f,0x1986,0xfca)](_0x1354e9))_0x4ba422=_0x4b485e['QKsgO'];if(/reverse/[_0x313705(0x1c74,0x20d7,0x208c,0x27ca)](_0x1354e9))_0x4ba422=_0x4b485e[_0x23937d(0x1c67,0xf8e,0xe50,0x1174)];if(/robot/[_0x23937d(0x190e,0x1c4f,0x223f,0x172d)](_0x1354e9))_0x4ba422=_0x4b485e[_0x313705(0x1bdf,0xd4a,0x12a8,0x2260)];if(/slow/[_0x313705(0x1c74,0xfef,0x2932,0x1d31)](_0x1354e9))_0x4ba422='-filter:a\x20'+_0x313705(0x774,0x7d2,0x5d1,0x11)+'7,asetrate'+'=44100\x22';if(/smooth/[_0x313705(0x1c74,0x27b9,0x1f2b,0x25ea)](_0x1354e9))_0x4ba422=_0x4b485e[_0x23937d(0x1a53,0x20b6,0x18a2,0x1a00)];if(/tupai/[_0x23937d(0x190e,0xb16,0xcd0,0x12c4)](_0x1354e9))_0x4ba422=_0x4b485e[_0x313705(0x9d1,0x1267,0x6c,0x17b5)];if(/audio/[_0x313705(0x1c74,0x1b01,0x221d,0x2409)](_0x2a2351)){if(_0x4b485e[_0x23937d(0x1b98,0x10a8,0x1330,0x27cb)](_0x4b485e['qPCNG'],_0x4b485e[_0x313705(0x1288,0x885,0x74c,0x1bd7)])){_0x4b485e[_0x313705(0x10ca,0x101e,0x19b3,0x1169)](_0x1db05d,mess[_0x313705(0xc12,0xb89,0x9be,0xf47)]);let _0x171e49=await _0x175756['downloadAn'+_0x313705(0x11ae,0x69c,0x61c,0x967)+'Message'](_0x3e5ec4),_0x467cdc=_0x4b485e['lmQqK'](getRandom,_0x23937d(0x58f,0xb75,0xf28,0x124f));_0x4b485e[_0x23937d(0x1cee,0x139b,0x12e3,0x24a0)](exec,_0x313705(0x1d90,0x1708,0x2c01,0x27f4)+_0x171e49+'\x20'+_0x4ba422+'\x20'+_0x467cdc,(_0x32571d,_0x490870,_0x997eb)=>{function _0x2b1a79(_0x54dc5b,_0x24d264,_0x451c56,_0xdc607c){return _0x23937d(_0xdc607c-0x284,_0x24d264,_0x451c56-0x72,_0xdc607c-0x14e);}function _0x2d50de(_0x21cab0,_0x3c9023,_0x187da4,_0x163ff7){return _0x313705(_0x3c9023-0x23e,_0x187da4,_0x187da4-0x173,_0x163ff7-0x9f);}if(_0x4b485e['AalNi'](_0x4b485e[_0x2d50de(0x209a,0x1b84,0x1e97,0xd88)],_0x2d50de(0x2046,0x1c5d,0x1ffa,0x2824))){fs[_0x2d50de(0x1122,0x5af,-0x118,0x285)](_0x171e49);if(_0x32571d)return _0x1db05d(_0x32571d);let _0x1550bf=fs[_0x2b1a79(0x172d,0xd8b,0x1cf3,0x1641)+'nc'](_0x467cdc);const _0x21eb8b={};_0x21eb8b['audio']=_0x1550bf,_0x21eb8b[_0x2b1a79(0x21d2,0x1ff2,0x1443,0x152e)]=_0x4b485e['VAalU'],_0x175756[_0x2b1a79(0x616,0x112e,0x787,0xbc8)+'e'](_0x5cd288[_0x2b1a79(0x2273,0x98d,0x825,0x1410)],_0x21eb8b,{'quoted':_0x5cd288}),fs[_0x2b1a79(-0x5f8,-0x471,0x8ab,0x28f)](_0x467cdc);}else return _0x4b485e[_0x2d50de(0xdad,0xca9,0x1b54,0x1344)];});}else{const _0x330545={};_0x330545[_0x313705(0x209f,0x25ad,0x2721,0x235a)]=''+_0x5625da['K143'];const _0x2d9a75={};_0x2d9a75[_0x23937d(0x5dc,0x10da,-0x8bf,0x1cb)]=_0x55ab01,_0x24eba2[_0x23937d(0x944,0x9b7,0xf5a,0x16d0)+'e'](_0x3e5be3[_0x23937d(0x118c,0x1110,0x2089,0x1992)],_0x330545,_0x2d9a75);}}else _0x4b485e['dnclx'](_0x1db05d,'Reply\x20To\x20T'+_0x313705(0x1c97,0x13d5,0x1a31,0x2653)+_0x313705(0x13e9,0x61e,0xe6a,0xcbc)+_0x313705(0xc8d,0x1b9,0x1664,0x147d)+_0x313705(0x1820,0xf71,0xc83,0x1f7d)+'\x20*'+(_0xe1d953+_0x1354e9)+'*');}catch(_0x6b5dce){if(_0x23937d(0x1a9d,0x2868,0x2689,0x1657)===_0x4b485e[_0x313705(0x10b9,0x1473,0x49a,0x14e8)])_0x4b485e[_0x23937d(0xdf5,0x97f,0x84,0x71b)](_0x1db05d,_0x6b5dce);else{const _0x126c7c=_0x4b485e[_0x313705(0x1ffc,0x13f1,0x2dba,0x169f)][_0x23937d(0xccf,-0x124,0x14c3,0x507)]('|');let _0x47cbc0=0x2*0x913+0x94f*0x2+-0x24c4;while(!![]){switch(_0x126c7c[_0x47cbc0++]){case'0':_0x47249f[_0x313705(0xdba,0x1bdb,-0xfc,0x48e)+_0x23937d(0x17b0,0xd4a,0xc67,0x15a9)]=![];continue;case'1':_0x25d40b['templateDo'+_0x23937d(0x15d5,0x2248,0x127a,0x232e)]=![];continue;case'2':_0x4b485e[_0x313705(0x1bb3,0x24e0,0x25f7,0x110a)](_0x4533d0,_0x177734[_0x313705(0x183b,0x25e7,0x21e1,0x2359)]);continue;case'3':_0x1fd9d6['templateGi'+'f']=!![];continue;case'4':_0xbd3729[_0x23937d(0x1972,0xd33,0x1305,0xb91)+'g']=![];continue;case'5':_0x4805e1[_0x313705(0x167e,0x239d,0xb2c,0xfc7)+_0x23937d(0x22c,0x852,-0xcb9,0xa6)]=![];continue;}break;}}}break;case _0x313705(0x1686,0x8d6,0x8dd,0x1a36):{if(_0x4b485e[_0x313705(0x2074,0x2187,0x2cc1,0x1532)](_0x4b485e[_0x313705(0xdb5,0x17b1,0x1cd5,0x385)],_0x4b485e[_0x313705(0xf05,0xb1c,0x11c5,0x92a)])){const _0x1e469d={};_0x1e469d[_0x23937d(0x1d39,0x1602,0x2a03,0x1f20)]=_0x4ded6c,_0x4b0aa4[_0x313705(0xcaa,0x741,0xa9b,-0x5a)+'e'](_0x37ffa0[_0x313705(0x14f2,0xb97,0x11b3,0x1e75)],_0x1e469d,{'quoted':_0x301d3e,'thumbnail':_0x55967c[_0x313705(0x1723,0x1af5,0xe46,0x166d)+'nc'](_0x4b485e[_0x313705(0x93f,0x63b,0x7a2,-0x128)])});}else{if(_0x1bac1f)return _0x4b485e[_0x313705(0x79a,0x1161,-0x82,0x1328)](_0x1db05d,mess['ban']);if(_0x1e03f5)return _0x4b485e[_0x313705(0x11e6,0xbed,0x4a5,0x13d7)](_0x1db05d,mess[_0x23937d(0x5c0,0xd31,0xc78,0x1108)]);if(_0x1bac1f)return _0x4b485e[_0x23937d(0x1d02,0x2718,0x1edf,0x2463)](_0x1db05d,mess['ban']);if(_0x1e03f5)return _0x4b485e['Kynpu'](_0x1db05d,mess[_0x23937d(0x5c0,0x257,0x45d,-0x3d3)]);if(!_0x5cd288[_0x23937d(0x5dc,0xb33,0x4b5,0xb8b)])return _0x4b485e[_0x23937d(0x1835,0x1497,0x25cc,0xd44)](_0x1db05d,_0x313705(0x1010,0x1ae5,0x1579,0x507)+_0x313705(0x90e,-0x1bc,0x10d5,0x5ea));if(!_0x5cd288['quoted']['fileSha256'])return _0x4b485e['aUuQn'](_0x1db05d,_0x313705(0x1b11,0xed9,0x1e59,0x2a2f)+_0x23937d(0x15e7,0x1124,0x1848,0xff6));if(!_0x494254)return _0x4b485e['XhaQd'](_0x1db05d,_0x313705(0x17ff,0x1107,0x1776,0x1341)+_0x313705(0xdc2,0x8a4,0x1458,0x139));let _0x5cd427=_0x5cd288[_0x23937d(0x5dc,-0x93f,-0x183,0xa5f)][_0x23937d(0x801,-0x254,0x63d,-0x2ed)]['toString'](_0x4b485e[_0x23937d(0x17a8,0x1072,0x1d56,0x187e)]);if(global['db'][_0x23937d(0xe17,0x11e2,0xf2a,0x1cc7)][_0x313705(0x1360,0x1ebe,0xa76,0x87c)][_0x5cd427]&&global['db'][_0x313705(0x117d,0x1ade,0x165b,0x7a1)]['sticker'][_0x5cd427][_0x313705(0x13b1,0xc34,0x1791,0x1ecd)])return _0x1db05d('You\x20Have\x20N'+_0x313705(0x102a,0x1bd5,0x1120,0x57d)+'on\x20To\x20Chan'+_0x313705(0x12e1,0xe02,0x204a,0x1a56)+_0x313705(0x1b8b,0x194e,0x1276,0x1060)+'and');global['db']['data'][_0x313705(0x1360,0x666,0x1663,0x1679)][_0x5cd427]={'text':_0x494254,'mentionedJid':_0x5cd288['mentionedJ'+'id'],'creator':_0x5cd288[_0x23937d(0x14ce,0x1cc4,0x1633,0x13c3)],'at':+new Date(),'locked':![]},_0x4b485e['snLtt'](_0x1db05d,_0x23937d(0xf06,0x775,0x778,0x1908));}}break;case _0x4b485e['NMwEk']:{if(_0x4b485e['RMQaT'](_0x4b485e[_0x23937d(0x8fb,0x1133,0x1638,-0x5df)],_0x313705(0x1aed,0x2671,0x28b6,0x1002))){const _0x3892df={};_0x3892df[_0x313705(0x209f,0x21c5,0x1c5b,0x1a43)]=''+_0x47e8d7[_0x23937d(0xc18,0x8c7,0x1ab7,0x1104)];const _0x6b29dd={};_0x6b29dd[_0x313705(0x942,0x1ac,0x41f,0x754)]=_0x1360a6,_0x303b87['sendMessag'+'e'](_0x26d470[_0x313705(0x14f2,0x1f65,0x12e0,0x1342)],_0x3892df,_0x6b29dd);}else{if(_0x1bac1f)return _0x4b485e[_0x313705(0x1984,0x20ce,0xe59,0xce9)](_0x1db05d,mess['ban']);if(_0x1e03f5)return _0x1db05d(mess[_0x23937d(0x5c0,0x7e1,0xf60,0x12ed)]);if(_0x1bac1f)return _0x4b485e['PgOvi'](_0x1db05d,mess[_0x313705(0x982,0x1529,-0x396,-0x16c)]);if(_0x1e03f5)return _0x4b485e[_0x313705(0x9eb,0x742,0x1660,0x38d)](_0x1db05d,mess[_0x23937d(0x5c0,-0xa3,0x140e,0xbc3)]);let _0x46edb2=_0x5cd288[_0x313705(0x942,0x1173,0x1362,0xf9)]['fileSha256'][_0x23937d(0x119d,0x11b3,0x14fa,0x1fc1)](_0x4b485e[_0x23937d(0x17a8,0x1d9c,0x20fd,0x261e)]);if(!_0x46edb2)return _0x1db05d('No\x20Hashes');if(global['db'][_0x313705(0x117d,0x509,0x89a,0x184d)][_0x23937d(0xffa,0x977,0xdf,0x890)][_0x46edb2]&&global['db'][_0x313705(0x117d,0x310,0x1417,0x725)][_0x23937d(0xffa,0xa41,0xe25,0x194b)][_0x46edb2]['locked'])return _0x1db05d(_0x23937d(0x771,0x1648,-0x1b2,0x365)+'o\x20Permissi'+_0x23937d(0x1bf2,0x1163,0x1fdf,0x1821)+'te\x20This\x20St'+'icker\x20Comm'+_0x313705(0x2004,0x2aee,0x28ba,0x1ca7));delete global['db'][_0x23937d(0xe17,0x1566,0x16fe,0x10f9)][_0x23937d(0xffa,0x1695,0x191d,0x65e)][_0x46edb2],_0x4b485e[_0x313705(0x1421,0x21d3,0x984,0x12e6)](_0x1db05d,'Done!');}}break;case _0x4b485e[_0x313705(0xc21,0xa20,0x4b6,0xa60)]:{if(_0x1bac1f)return _0x4b485e[_0x313705(0x1f93,0x2cf9,0x298e,0x1650)](_0x1db05d,mess[_0x23937d(0x61c,-0x66a,0xf51,0xf3a)]);if(_0x1e03f5)return _0x1db05d(mess[_0x313705(0x926,0xfb,0x4f4,0x109b)]);let _0x467867=(_0x23937d(0x1374,0x206f,0x1218,0x182b)+'t*\x0aInfo:\x20*'+'bold*\x20hash'+_0x313705(0x1823,0x20c2,0x1a8a,0x1665)+'\x0a'+Object[_0x313705(0x12b1,0x6a9,0x761,0x731)](global['db'][_0x313705(0x117d,0xb43,0x1d0f,0x14a1)][_0x313705(0x1360,0xcdf,0x1839,0xc03)])[_0x23937d(0xb16,0xb26,0x46a,0x19ca)](([_0xf95125,_0x45842d],_0x48915e)=>_0x48915e+(0x18ba+0x17f2+-0x30ab*0x1)+'.\x20'+(_0x45842d[_0x313705(0x13b1,0x1b5c,0x1051,0x11f0)]?'*'+_0xf95125+'*':_0xf95125)+'\x20:\x20'+_0x45842d[_0x23937d(0x1d39,0x2921,0x1faa,0x22f6)])[_0x23937d(0x1c16,0x1472,0x2391,0x10bb)]('\x0a')+'\x0a')[_0x23937d(0x1c07,0x16aa,0x1c05,0x106f)]();_0x175756[_0x313705(0x18da,0xfe1,0x1ee7,0x1164)](_0x5cd288['chat'],_0x467867,_0x5cd288,{'mentions':Object[_0x23937d(0xed6,0x781,0xd3b,0x1b75)](global['db'][_0x23937d(0xe17,0xfc9,0x171e,0xc)][_0x23937d(0xffa,0x104e,0x7e9,0x57f)])[_0x313705(0xe7c,0x1c14,0x1c0,0x191e)](_0x379c06=>_0x379c06['mentionedJ'+'id'])[_0x23937d(0x1b38,0x2490,0xcdd,0x2a33)]((_0x44a974,_0x9673d2)=>[..._0x44a974,..._0x9673d2],[])});}break;case _0x4b485e['sHQHN']:{if(_0x4b485e[_0x313705(0xa6c,-0x2e8,0x1632,0x1f)](_0x4b485e[_0x23937d(0x1621,0x1af5,0x1939,0x1d61)],_0x4b485e[_0x23937d(0x1251,0x693,0x920,0xad9)])){if(!_0x594552)return _0x534a55(_0x4b485e[_0x23937d(0x99b,0x166c,0x285,-0x4f3)]);if(_0x9b8780){_0x6b7d91[_0x23937d(0x121b,0x10ad,0xc41,0x1368)]=_0x3ba896;const _0x47fce7={};_0x47fce7['quoted']=_0x2622eb,_0x209faf[_0x313705(0xcaa,0xde7,0x1953,0xbd2)+'e'](_0x40628f['chat'],{'image':{'url':_0x4b485e[_0x23937d(0x1343,0x1246,0x1998,0x175e)](_0x3c2be5,_0x4b485e[_0x23937d(0xbdf,-0x46,-0x1db,0x17ab)])},'caption':'```⚙️🔄\x20Aliv'+_0x313705(0x1883,0x1dc5,0x22bb,0x272e)+'Successful'+_0x23937d(0x1313,0x1853,0x2188,0x2139)+_0x313705(0x1b07,0x1bc4,0x1109,0x1f48)+_0x313705(0x1bae,0x27eb,0x227a,0x20cf)+_0x313705(0xb44,0x1153,0x6ab,0x1814)},_0x47fce7);}else{if(_0x52474c){_0x3943f2[_0x313705(0x1581,0x1a9b,0x1a20,0x121c)]=_0x1497fc;const _0x215b2e={};_0x215b2e[_0x23937d(0xa79,0x964,0x1377,0x150b)]=_0x37e90f+'Alive\x20Text';const _0x7900f4={};_0x7900f4[_0x23937d(0x1c43,0xebb,0x1a07,0x2532)]=_0x215b2e,_0x7900f4[_0x313705(0xcce,0x118c,0x1297,0x174)]=_0x4b485e['uoMHa'];const _0x5e09f4={};_0x5e09f4[_0x313705(0x942,0x1569,0x170f,0x181b)]=_0x4a3128,_0x782416[_0x23937d(0x944,0xb12,0x727,0x1611)+'e'](_0x54a018[_0x313705(0x14f2,0x118d,0x22a6,0x1166)],_0x7900f4,_0x5e09f4);}else return _0x4b485e['EbVyq'](_0x5ac9b4,''+_0x513b4b[_0x313705(0xfea,0x591,0x15e3,0x187e)]);}}else{if(_0x1bac1f)return _0x4b485e[_0x23937d(0x19ca,0x209a,0x137e,0x1e09)](_0x1db05d,mess[_0x23937d(0x61c,-0x6c9,0x1448,0x10a7)]);if(_0x1e03f5)return _0x4b485e[_0x313705(0x10f0,0x453,0x1880,0x1128)](_0x1db05d,mess[_0x313705(0x926,0x1290,0x13fe,0x6e)]);if(!_0x24aa58)return _0x516d85(''+mess[_0x313705(0xfea,0x1c0,0x1158,0xa78)]);if(!_0x5cd288[_0x23937d(0x5dc,0x7d9,0xc42,-0x681)])return _0x4b485e[_0x313705(0x216f,0x2c5e,0x270b,0x2276)](_0x1db05d,_0x313705(0x1010,0x24a,0x1788,0x284)+_0x23937d(0x5a8,0xbff,0x407,0xbcc));if(!_0x5cd288[_0x313705(0x942,0x667,0x1125,0x32e)][_0x313705(0xb67,0xfeb,0x1728,0xb70)])return _0x4b485e['DAhCF'](_0x1db05d,_0x313705(0x1b11,0x28c4,0x18c9,0x282d)+_0x313705(0x194d,0x1695,0x27a4,0xfe5));let _0x511622=_0x5cd288['quoted']['fileSha256'][_0x313705(0x1503,0x1b77,0x1cb3,0xbee)]('base64');if(!_0x4b485e['yrzcp'](_0x511622,global['db']['data'][_0x23937d(0xffa,0x4bc,0x1244,0x558)]))return _0x1db05d(_0x23937d(0x19f9,0x15de,0x11f6,0xf92)+_0x313705(0x144c,0x12a5,0xebb,0x1469)+_0x23937d(0x1275,0xcff,0x985,0x84d));global['db'][_0x23937d(0xe17,0x1174,0x801,0xb77)][_0x313705(0x1360,0x72f,0x1efc,0xbc0)][_0x511622]['locked']=!/^un/i[_0x23937d(0x190e,0xd06,0x261c,0x2633)](_0x1354e9),_0x4b485e[_0x313705(0xbf8,0x1afd,0x7dc,0xcbf)](_0x1db05d,'Done!');}}break;case _0x23937d(0x11e1,0x890,0x5ae,0x1076):{if(_0x1bac1f)return _0x4b485e[_0x313705(0x152d,0xe7e,0x1a19,0x1fa8)](_0x1db05d,mess[_0x23937d(0x61c,-0x33e,-0x723,0xb83)]);if(_0x1e03f5)return _0x1db05d(mess[_0x23937d(0x5c0,0x123,0x149f,0x636)]);if(!_0x5cd288[_0x313705(0x942,0x1065,0x11ca,0xa3c)])return _0x1db05d(_0x23937d(0xcaa,0x37f,0x1828,0x337)+'age\x20You\x20Wa'+_0x23937d(0x8f6,0xafe,0x54b,0xa62)+'\x20In\x20Databa'+'se');if(!_0x494254)return _0x4b485e[_0x23937d(0x15b5,0x73c,0x16f1,0x1f5d)](_0x1db05d,'Example\x20:\x20'+_0x4b485e[_0x313705(0xb3b,0x100b,0x51f,0x96e)](_0xe1d953,_0x1354e9)+_0x313705(0x1dce,0x1732,0x1287,0x1edc));let _0x14c635=global['db']['data'][_0x23937d(0x749,0xde5,0x33f,-0x34a)];if(_0x4b485e[_0x23937d(0xc2d,0x28b,0x329,0x1ae8)](_0x494254['toLowerCas'+'e'](),_0x14c635))return _0x4b485e[_0x313705(0x17ea,0x13d3,0xe82,0x23dc)](_0x1db05d,'\x27'+_0x494254+(_0x23937d(0xc4f,0x120b,0x1876,0x1834)+_0x23937d(0x3e0,0xa82,0x870,0x1057)+_0x313705(0x2103,0x26b7,0x15c4,0x1ffe)+_0x23937d(0x76b,0x6b6,0x10df,0x3c2)+'t'));_0x14c635[_0x494254[_0x23937d(0x6cb,-0x26f,0x929,-0x4cf)+'e']()]=_0x3e5ec4[_0x23937d(0x110b,0x174f,0x1fdb,0x1d75)],_0x4b485e[_0x313705(0xebe,0x16b1,0x594,0xd6d)](_0x1db05d,_0x23937d(0x1471,0x625,0x1cd5,0x63b)+'ly\x20Added\x20M'+'essage\x20In\x20'+'Message\x20Li'+_0x313705(0x48b,0xcde,-0x7ed,0x312)+_0x494254+('\x27\x0a\x20\x20\x20\x20\x0aAcc'+_0x313705(0x1261,0x15c4,0xd9f,0xc98))+_0xe1d953+_0x23937d(0x15ae,0x22bb,0x2153,0x1840)+_0x494254+(_0x23937d(0xdb7,0x10d1,0x1ad8,0x1498)+_0x23937d(0x1b44,0x26af,0xea5,0x20e4)+_0x313705(0x1151,0x70a,0x44b,0x63e))+_0xe1d953+_0x313705(0x7f9,0x152c,-0x68d,0x720));}break;case _0x313705(0x1b70,0xf3c,0x2502,0x1007):{if(_0x4b485e[_0x23937d(0x17f4,0x18b6,0xae3,0x2314)](_0x4b485e[_0x23937d(0x44e,-0x64c,-0x331,0xa84)],_0x4b485e[_0x23937d(0x161b,0x1713,0x18d0,0x9a6)])){const _0x433db0=_0x4b485e[_0x23937d(0x1702,0x12a9,0x25c1,0xc89)]['split']('|');let _0x4c4663=0x1ccd+-0x1*-0x14ca+-0x3197;while(!![]){switch(_0x433db0[_0x4c4663++]){case'0':_0x2bdf09+='Upload:\x20'+_0x43d9d9[_0x23937d(0x879,-0x4cf,0x149e,0x878)+'pload']+'\x0a';continue;case'1':_0x22e64d+=-0x1*0x1f0f+-0x118b+0x309b;continue;case'2':_0x520d34+=_0x313705(0xb9e,0x15a1,0x960,0x12e)+_0x58ecb3['berita_jen'+'is']+'\x0a';continue;case'3':_0x556e34+=_0x23937d(0x5d0,0xb63,0x104,0x333)+_0x43ccdf[_0x313705(0x1eaf,0x1c9f,0x2c69,0x162a)]+'\x0a';continue;case'4':_0x320f56+='Link:\x20'+_0x32d19d[_0x313705(0x1312,0x1c92,0x79f,0x441)]+'\x0a';continue;case'5':_0x15ea59+=_0x313705(0x1cb1,0x15e4,0x1dc8,0x20f5)+_0x2dcf27[_0x313705(0x1503,0x1fa2,0x1f07,0x1f98)]()+'\x20•\x0a';continue;}break;}}else{if(_0x1bac1f)return _0x4b485e[_0x23937d(0xfc4,0x16a7,0x9fa,0x893)](_0x1db05d,mess[_0x23937d(0x61c,0xd4a,0xcb5,-0x7ac)]);if(_0x1e03f5)return _0x4b485e[_0x23937d(0x131d,0x1fb6,0x1aa1,0x2170)](_0x1db05d,mess[_0x313705(0x926,-0x141,0x817,0x166b)]);if(!_0x494254)return _0x4b485e['sMaXp'](_0x1db05d,_0x23937d(0xda5,0x1229,0xd3a,0xb7e)+_0x4b485e[_0x23937d(0x49,0xdff,0x20b,0x625)](_0xe1d953,_0x1354e9)+('\x20file\x20name'+_0x23937d(0x11aa,0x6a2,0x1060,0x431)+_0x23937d(0xda9,0x1344,-0xc0,0x770)+'With\x20')+_0xe1d953+'listmsg');let _0x178747=global['db']['data'][_0x313705(0xaaf,0x8dc,0xd64,0x192b)];if(!(_0x494254[_0x23937d(0x6cb,-0x11c,0x154a,0x1342)+'e']()in _0x178747))return _0x1db05d('\x27'+_0x494254+(_0x313705(0x8fa,0x160f,0x41b,-0x415)+_0x313705(0x119d,0x1c7a,0xc0e,0xa0c)+'Message\x20Li'+'st'));_0x175756[_0x23937d(0x6db,-0x75a,-0x7c6,0x955)+'rd'](_0x5cd288[_0x23937d(0x118c,0x1580,0x1290,0x5e5)],_0x178747[_0x494254[_0x313705(0xa31,0x75a,0x18ee,0xc63)+'e']()],!![]);}}break;case _0x4b485e[_0x23937d(0x1135,0x2050,0x12ba,0x197e)]:{if(_0x1bac1f)return _0x4b485e[_0x313705(0xb2b,-0x1,-0x197,-0x201)](_0x1db05d,mess[_0x313705(0x982,0x1681,-0x271,-0x51d)]);if(_0x1e03f5)return _0x1db05d(mess[_0x23937d(0x5c0,-0x510,-0x1c6,-0x687)]);let _0x266a0f=JSON[_0x313705(0x7ef,-0x5af,-0x3ef,-0x234)](fs[_0x313705(0x1723,0x1fbe,0x915,0x1efa)+'nc'](_0x4b485e[_0x23937d(0xca0,0x4bc,0x126c,-0x3)])),_0x67b86b=Object[_0x313705(0x12b1,0x9bc,0x898,0x5d9)](global['db'][_0x313705(0x117d,0xb0a,0x1881,0xd3a)][_0x313705(0xaaf,0x1822,0x49c,0xdd8)])[_0x23937d(0xb16,0x1401,0x2f8,0xe1)](([_0x5d7ecc,_0x427f41])=>{const _0x4770ae={'nama':_0x5d7ecc,..._0x427f41};return _0x4770ae;}),_0x5c0e81=_0x23937d(0x973,0xdee,0x1345,0x9f)+'\x20LIST\x20🧩\x0a\x0a';for(let _0xed3892 of _0x67b86b){if(_0x4b485e[_0x23937d(0x1e3,0x10a4,0x4b,0x88d)](_0x313705(0x12e9,0xd58,0xb57,0xd0e),_0x4b485e[_0x313705(0x1ea4,0x150b,0x1e9c,0x19a9)])){const _0x22acf9={};_0x22acf9['text']=''+_0x208140[_0x23937d(0x1c2f,0x1673,0x2989,0x12ad)];const _0x2009f0={};_0x2009f0[_0x23937d(0x5dc,-0x803,0x61,-0x6c)]=_0x37a296,_0x36976a[_0x23937d(0x944,0x1181,-0xbf,-0x3d)+'e'](_0xc365b1[_0x313705(0x14f2,0x115a,0x2399,0x157f)],_0x22acf9,_0x2009f0);}else _0x5c0e81+=dragonemoji+'\x20*Name\x20:*\x20'+_0xed3892[_0x23937d(0xd6a,0xbd9,0x800,0x123b)]+'\x0a'+dragonemoji+_0x23937d(0xbb6,-0x158,0x1a14,0x1104)+getContentType(_0xed3892[_0x23937d(0xde4,0x1319,0x1aa,0x16fe)])[_0x313705(0x1bd8,0xd69,0x12c2,0x1eeb)](/Message/i,'')+(_0x313705(0x202b,0x2eed,0x1503,0x27da)+_0x313705(0x1cbb,0x233c,0x1d90,0x1050)+_0x23937d(0x7c,0x2a6,-0xc48,-0x294));}_0x4b485e[_0x313705(0x448,0x67b,0x2d3,-0x1fc)](_0x1db05d,_0x5c0e81);}break;case _0x4b485e[_0x313705(0x1f36,0x1ac4,0x149c,0x2883)]:case _0x4b485e[_0x313705(0x347,-0x8e1,0x105f,0x881)]:{if(_0x1bac1f)return _0x4b485e[_0x23937d(0x19e1,0x21df,0xc54,0xe9c)](_0x1db05d,mess[_0x313705(0x982,0xff7,0x1341,0x126f)]);if(_0x1e03f5)return _0x1db05d(mess[_0x23937d(0x5c0,0x6d6,0xbaa,-0x90f)]);let _0xbecd3d=global['db'][_0x313705(0x117d,0x348,0x14c4,0xa77)][_0x23937d(0x749,0x1455,0x828,0x122b)];if(!_0x4b485e[_0x313705(0x1c0e,0x14a4,0x161d,0x2222)](_0x494254['toLowerCas'+'e'](),_0xbecd3d))return _0x1db05d('\x27'+_0x494254+('\x27\x20Not\x20List'+_0x313705(0x119d,0x11ff,0xe97,0x15ac)+_0x313705(0x20a6,0x1625,0x248f,0x137a)+'st'));delete _0xbecd3d[_0x494254['toLowerCas'+'e']()],_0x4b485e['PQVNp'](_0x1db05d,_0x23937d(0x122e,0xcdb,0x12b9,0x5b3)+_0x313705(0x1757,0x1915,0xde1,0x8e4)+'\x27'+_0x494254+('\x27\x20From\x20The'+_0x23937d(0x125c,0x1f4b,0xaba,0x7b2)+_0x313705(0xb66,0x448,0xb4d,0x487)));}break;case _0x4b485e[_0x23937d(0x942,0x1233,0x142a,0x11c5)]:{if(_0x23937d(0x1d1b,0x1e20,0x21e6,0xf22)!==_0x23937d(0x1d1b,0x2af3,0x2018,0x1938)){const _0x143c45={};_0x143c45['text']=''+_0x2b5566[_0x23937d(0x1909,0xf6a,0x163e,0x24d0)];const _0x5484a5={};_0x5484a5[_0x23937d(0x5dc,0x3dc,0x1059,0xdd9)]=_0x4d928b,_0x4ce721[_0x23937d(0x944,0xec5,0x30,0x889)+'e'](_0x42a78f[_0x313705(0x14f2,0x2299,0xa70,0xcda)],_0x143c45,_0x5484a5);}else{if(_0x1bac1f)return _0x4b485e[_0x313705(0x1cd5,0x14a3,0x1c84,0x1af3)](_0x1db05d,mess[_0x313705(0x982,0xf9a,0x213,0x88a)]);if(_0x1e03f5)return _0x1db05d(mess['banChat']);if(_0x5cd288[_0x313705(0x2089,0x11ed,0x11ca,0x1de3)])return _0x4b485e['vQYxq'](_0x1db05d,'Features\x20C'+_0x23937d(0x1aba,0x2016,0x20d3,0xd97)+_0x313705(0x4f8,0x4c9,0x1be,-0x7d0)+'oups!');this['anonymous']=this[_0x313705(0x9c7,0x1111,0x234,-0x458)]?this['anonymous']:{};const _0xdca989={};_0xdca989[_0x23937d(0x1b0c,0x1069,0x21ef,0x198b)]=_0x4b485e[_0x23937d(0x348,-0x64b,0x78a,-0x27f)],_0xdca989[_0x23937d(0x159c,0x2307,0x1be8,0x83f)]={},_0xdca989[_0x313705(0xa9e,0xeb7,0x686,0x4c5)]=0x1,_0xdca989[_0x23937d(0x159c,0x2307,0x1be8,0x83f)][_0x313705(0x175a,0x1c37,0x17d6,0x18a9)+'t']=_0x4b485e[_0x23937d(0xbd2,0x1675,0x90a,-0x19b)];let _0x4bd0a0=[_0xdca989];_0x175756[_0x23937d(0x7d8,0x7eb,-0x748,0xbd5)+_0x23937d(0x111a,0x8dd,0xff9,0x1718)](_0x5cd288[_0x23937d(0x118c,0x1afb,0x388,0xf60)],_0x4bd0a0,_0x23937d(0x389,-0x3df,0x123,-0x143)+await _0x175756[_0x313705(0x1d54,0x11f5,0x14ae,0x18cb)](_0x5cd288['sender'])+(_0x313705(0x203d,0x2472,0x2457,0x18b2)+_0x23937d(0x2c9,-0x910,-0x342,-0x1b6)+_0x313705(0x18bd,0x1546,0x1bca,0x134d)+_0x313705(0x1079,0xf70,0x905,0x15d1)+_0x313705(0x1e55,0x2932,0x1c81,0xff7)+_0x23937d(0x19f5,0xe96,0x13b7,0xda3)+_0x313705(0x1f6a,0x2ac3,0x24e5,0x272a)+'`'),_0x175756[_0x313705(0x787,0x7a0,-0x559,-0x361)][_0x313705(0x17b7,0x1cc9,0x24e7,0x25bf)],_0x5cd288);}}break;case _0x4b485e['cppjc']:case _0x4b485e[_0x313705(0x175d,0xf0a,0x208d,0x13bd)]:{if(_0x1bac1f)return _0x1db05d(mess['ban']);if(_0x1e03f5)return _0x4b485e[_0x313705(0x11a6,0x193c,0x102f,0x1b5f)](_0x1db05d,mess[_0x23937d(0x5c0,0xf1d,0xe86,-0x4b9)]);if(_0x5cd288[_0x23937d(0x1d23,0xf7a,0x2507,0x2b44)])return _0x1db05d(_0x4b485e[_0x23937d(0x18d5,0x2451,0x1768,0x1f1d)]);this['anonymous']=this[_0x313705(0x9c7,0xf39,0x68c,-0x45)]?this[_0x313705(0x9c7,-0x4bf,0x80b,0x39b)]:{};let _0x4b47c0=Object[_0x313705(0x123c,0x9ef,0x14ac,0x15f1)](this[_0x23937d(0x661,0xb9d,-0x700,0xc79)])[_0x313705(0x1a2b,0x1878,0x2209,0x1bc8)](_0x2ad25d=>_0x2ad25d[_0x313705(0xb88,-0x1cd,0xd51,0x12d5)](_0x5cd288[_0x313705(0x1834,0x23d7,0x1cd6,0xf1d)]));if(!_0x4b47c0){if('bzDvN'===_0x4b485e['rnYti']){_0x19d7d0[_0x313705(0x1581,0x1604,0x15ef,0xa59)]=_0x3252f2;const _0x32ee8d={};_0x32ee8d[_0x313705(0xddf,0x1013,0xe27,0x943)]=_0x1618c2+_0x4b485e[_0x313705(0xf45,0x1a86,0x75d,0x7ed)];const _0x57f17f={};_0x57f17f[_0x313705(0x1fa9,0x1210,0x1f40,0x1d01)]=_0x32ee8d,_0x57f17f[_0x313705(0xcce,0x1070,0x4ef,0xf63)]=_0x4b485e[_0x313705(0xd9e,0xd3e,0x15be,0x605)];const _0x368eb8={};_0x368eb8['quoted']=_0x10b245,_0x2b3dc8[_0x313705(0xcaa,0x4a8,-0x19f,0x1700)+'e'](_0x48cc6c[_0x313705(0x14f2,0xf91,0xcfe,0x1bd1)],_0x57f17f,_0x368eb8);}else{const _0x11e735={};_0x11e735[_0x23937d(0x13f4,0x10b7,0x21a2,0x5fb)+'t']=_0x313705(0x164b,0xd1c,0x17ac,0x2416);const _0xbdfef={};_0xbdfef[_0x313705(0x1e72,0x225c,0x2391,0x2501)]=_0x4b485e[_0x23937d(0x1918,0x25c5,0x209c,0x27b6)],_0xbdfef[_0x313705(0x1902,0xfdf,0x27d1,0x10a0)]=_0x11e735,_0xbdfef['type']=0x1;let _0x3cce88=[_0xbdfef];await _0x175756['sendButton'+_0x313705(0x1480,0xbf1,0x1590,0x1654)](_0x5cd288[_0x23937d(0x118c,0x19dc,0xdf6,0x1ffa)],_0x3cce88,'```You\x20Are'+_0x313705(0x378,0x6b1,-0x470,0x59b)+_0x23937d(0x14f4,0x1ebf,0x1332,0x23e2)+_0x23937d(0x893,-0x126,0x837,0x118a)+'Press\x20The\x20'+'Button\x20To\x20'+_0x313705(0x1edd,0x20f4,0x1bd0,0x2a9a)+'tner\x20```'),_0x4b485e['MKQDw'](_0x1db05d,![]);}}_0x4b485e['UBcGP'](_0x1db05d,'Ok');let _0x3d13ee=_0x4b47c0[_0x313705(0x1645,0x1cbf,0x7a4,0x2412)](_0x5cd288[_0x313705(0x1834,0xa18,0x10b4,0x12c9)]);if(_0x3d13ee)await _0x175756[_0x23937d(0x1574,0x1b60,0x247d,0xaa8)](_0x3d13ee,_0x23937d(0xb5e,0x128b,0x1303,0x10ac)+'\x20Has\x20Left\x20'+_0x23937d(0x17f9,0xd7f,0xffd,0xcf8)+_0x23937d(0x12d7,0x1424,0xbeb,0x1742),_0x5cd288);delete this[_0x23937d(0x661,0x1142,0xc94,-0x18b)][_0x4b47c0['id']];if(_0x4b485e[_0x313705(0x1e8e,0x1ea2,0x276e,0x115d)](_0x1354e9,_0x4b485e['JAcME']))break;}case _0x4b485e[_0x23937d(0x140a,0x126a,0x1e61,0x220b)]:case _0x4b485e['AeJZt']:{if(_0x4b485e['hBukA'](_0x23937d(0x1bf3,0x1079,0x2630,0x1bb8),_0x4b485e['JWxps'])){if(_0x1bac1f)return _0x4b485e[_0x23937d(0x160a,0x190c,0x10e0,0x8cc)](_0x1db05d,mess[_0x23937d(0x61c,0xa99,0x830,0x726)]);if(_0x1e03f5)return _0x4b485e[_0x313705(0x449,-0x9aa,0x4a0,0x5ba)](_0x1db05d,mess['banChat']);if(_0x5cd288[_0x313705(0x2089,0x13ad,0x2223,0x23d6)])return _0x4b485e[_0x23937d(0x10c3,0x172c,0x1308,0x1592)](_0x1db05d,_0x4b485e[_0x313705(0x1c3b,0x1fbc,0xf78,0x2569)]);this[_0x313705(0x9c7,-0x2cb,-0x40e,0x488)]=this[_0x23937d(0x661,0x89f,0xfbf,0x3b2)]?this[_0x313705(0x9c7,0x702,0xb7,0x17c1)]:{};if(Object[_0x23937d(0xed6,0x192c,0x11e5,0x668)](this['anonymous'])['find'](_0x2c5522=>_0x2c5522[_0x313705(0xb88,0x9d1,0x591,0x921)](_0x5cd288['sender']))){const _0x53441b={};_0x53441b['buttonId']=_0x4b485e['cppjc'],_0x53441b['buttonText']={},_0x53441b[_0x23937d(0x738,-0x304,0x5e3,-0xf1)]=0x1,_0x53441b['buttonText'][_0x313705(0x175a,0x1db7,0x172d,0xa79)+'t']=_0x4b485e[_0x313705(0x1702,0x1aa4,0x11ca,0xff9)];let _0x4a3109=[_0x53441b];await _0x175756[_0x23937d(0x7d8,0x62e,0x7d1,0x165c)+_0x23937d(0x111a,0x1003,0x1f64,0x1aea)](_0x5cd288[_0x313705(0x14f2,0xceb,0x1ca4,0xb30)],_0x4a3109,_0x313705(0x10da,0xb32,0xda2,0x1ceb)+'\x20Still\x20In\x20'+_0x313705(0xf10,0x197d,0x10af,0xc7e)+_0x23937d(0xc64,0x78,0x831,0x1659)+_0x23937d(0x1049,0x533,0x1bfc,0x191a)+_0x313705(0x3b3,0xa1e,-0x33,0x28b)+_0x313705(0xc65,0xca2,0x339,0x16d1)+_0x23937d(0xc4e,0xad4,0x3ec,0x159d)+_0x23937d(0x1d34,0xfed,0x2771,0x1279)+'us\x20Session'+_0x313705(0x1f55,0x1e7f,0x1361,0x1ddc),_0x175756[_0x313705(0x787,-0x64,0x850,0xd08)][_0x23937d(0x1451,0xd71,0x182a,0x1b05)],_0x5cd288),_0x4b485e[_0x313705(0xc46,-0x60,0x1994,0x17c4)](_0x1db05d,![]);}let _0x412e97=Object['values'](this['anonymous'])[_0x23937d(0x16c5,0x141e,0x106a,0x1800)](_0xa5f10e=>_0xa5f10e[_0x313705(0x1222,0xcd2,0x2037,0x13fa)]==='WAITING'&&!_0xa5f10e[_0x23937d(0x822,0x3d0,0x171d,0x82)](_0x5cd288['sender']));if(_0x412e97){if(_0x4b485e[_0x23937d(0x536,-0x3bd,0xc35,0xed5)](_0x4b485e[_0x23937d(0x1339,0x209b,0x1191,0x1f48)],_0x313705(0x558,0x303,0x7e7,0x11b5))){const _0x5a3e5e={};_0x5a3e5e['buttonId']=_0x4b485e[_0x23937d(0x155a,0x7db,0x1bee,0x1628)],_0x5a3e5e[_0x313705(0x1902,0x146b,0x1cdf,0x1371)]={},_0x5a3e5e[_0x23937d(0x738,0x2b0,0x979,-0x308)]=0x1,_0x5a3e5e[_0x313705(0x1902,0x146b,0x1cdf,0x1371)][_0x313705(0x175a,0x261a,0xf37,0x2038)+'t']=_0x4b485e[_0x23937d(0x23c,-0x5e9,-0xcab,0xa60)];const _0x4ebbdd={};_0x4ebbdd[_0x23937d(0x1b0c,0x2283,0x1a2b,0x1ca6)]=_0x4b485e[_0x313705(0x55f,0x110a,0xd16,0x616)],_0x4ebbdd[_0x313705(0x1902,0xfe9,0x1842,0x2208)]={},_0x4ebbdd[_0x313705(0xa9e,-0x244,0xeb2,-0x364)]=0x1,_0x4ebbdd[_0x313705(0x1902,0xfe9,0x1842,0x2208)]['displayTex'+'t']=_0x4b485e[_0x23937d(0x139c,0x16e2,0x62f,0x21a7)];let _0x2ff0f3=[_0x5a3e5e,_0x4ebbdd];await _0x175756[_0x23937d(0x7d8,0x63,0x51e,0xc0f)+_0x23937d(0x111a,0xde0,0x1e1c,0x701)](_0x412e97['a'],_0x2ff0f3,_0x23937d(0x8df,0xcfe,0x49c,0x36c)+_0x23937d(0x514,0x172,-0x842,0x6a)+_0x313705(0x1a91,0x27f1,0x17a0,0x18b8)+_0x313705(0x1827,0x20c7,0x1278,0x2135)+_0x23937d(0x1093,0x1a51,0x11c9,0x1ac5)+_0x23937d(0x19c4,0x12e6,0xb81,0xfab),_0x175756[_0x313705(0x787,0x213,0x931,0x1013)][_0x313705(0x17b7,0xf5d,0x1b0f,0x1ffe)],_0x5cd288),_0x412e97['b']=_0x5cd288[_0x23937d(0x14ce,0xfcd,0xa4c,0x1b84)],_0x412e97['state']=_0x4b485e[_0x23937d(0x1943,0x1417,0x12f3,0x1389)],await _0x175756['sendButton'+_0x313705(0x1480,0x1053,0x15f0,0x1541)](_0x412e97['b'],_0x2ff0f3,'```Success'+'fully\x20Foun'+_0x313705(0x1a91,0x15bf,0x1463,0x1ffa)+_0x313705(0x1827,0xa00,0xed8,0x1b5b)+_0x313705(0x13f9,0x1d77,0x12d0,0x1ead)+_0x23937d(0x19c4,0x13d0,0xc0e,0x1238),_0x175756[_0x23937d(0x421,-0x9f5,0x46,0x531)][_0x23937d(0x1451,0x984,0x2174,0x20bc)],_0x5cd288);}else{if(_0x4b485e[_0x313705(0x1be1,0x1450,0x2149,0x1494)](_0x5e2328['antilink'],'true'))return _0x4b485e[_0x313705(0x207f,0x2da0,0x1911,0x262e)](_0x13a230,_0x23937d(0xc17,0x615,0xdea,0x17a0));_0x9bafa0[_0x313705(0x1cfa,0x2567,0x1407,0x2502)]=_0x4b485e['ndZFX'],_0x4b485e[_0x313705(0x18d7,0x22b6,0x159a,0x24cc)](_0x285987,_0x5f5256['botname']+(_0x313705(0xa90,0x856,0x11ea,-0x16c)+_0x313705(0xbf3,0x11c,0x12d8,0x15e7)));}}else{let _0x37837a=+new Date();this[_0x313705(0x9c7,0xa5c,0xbba,-0x50d)][_0x37837a]={'id':_0x37837a,'a':_0x5cd288['sender'],'b':'','state':_0x4b485e[_0x313705(0x782,0xdba,0x689,0x8ff)],'check':function(_0x3fdf8d=''){const _0x4136a6={};function _0xcf9610(_0x9e93b7,_0xc04bc2,_0x4b6c26,_0x1f5414){return _0x23937d(_0x9e93b7- -0x7f,_0xc04bc2,_0x4b6c26-0xc4,_0x1f5414-0x0);}_0x4136a6[_0xcf9610(0x110b,0x1549,0x1eb2,0x170c)]=_0x4b485e['cBBET'];function _0x1ac855(_0x43c28f,_0x20af69,_0xefe6d2,_0x418521){return _0x23937d(_0x20af69- -0x2c,_0xefe6d2,_0xefe6d2-0x5,_0x418521-0x162);}const _0x3af70a=_0x4136a6;if(_0x4b485e[_0xcf9610(0x1382,0x8ec,0x18d9,0x1e5e)](_0x4b485e[_0x1ac855(0x2d1,0xbe6,0x201,0x432)],_0x4b485e['afWfT'])){const _0x5152f5={};_0x5152f5[_0xcf9610(0x55d,0x1274,0x12ab,0x10a4)]=_0x308d57,_0x2382b1[_0x1ac855(0x24f,0x918,0x169,-0x485)+'e'](_0x24df75['chat'],{'text':_0x1fe648,'contextInfo':{'externalAdReply':{'title':'\x20'+_0x7a444f[_0xcf9610(0x8ed,-0x286,0x10f4,0xcd2)],'body':'\x20𝙍𝙀𝘿╺\x20𝘿𝙍𝘼𝙂'+_0x1ac855(0x1287,0xce9,-0xed,0x13f9),'previewType':_0x3af70a[_0xcf9610(0x110b,0xc3e,0x135d,0x133b)],'thumbnailUrl':'','thumbnail':_0x29380d[_0xcf9610(0x133e,0x7ba,0x1aa0,0xcaa)+'nc'](_0xcf9610(0xa9c,0x17ed,0x957,0x165e)+_0x1ac855(0xeeb,0x81b,0xc87,0x37f)+_0xcf9610(0xe8d,0xd21,0x1abb,0x1301)),'sourceUrl':_0x1ac855(0xd96,0x529,0x129e,0x7b1)+_0x1ac855(0xd2d,0x182f,0x144c,0x2359)+_0x1ac855(0x1b16,0x1362,0x19f9,0xe39)+_0xcf9610(0x1950,0x14f8,0xcb3,0xc8f)+_0xcf9610(0x3c,0xa05,0xd6c,0x350)}}},_0x5152f5);}else return[this['a'],this['b']][_0x1ac855(0x19e,0x14c,0x450,-0xc7b)](_0x3fdf8d);},'other':function(_0x148a10=''){function _0xcdcf00(_0xcb4afa,_0x329345,_0x13b24d,_0xa88ded){return _0x23937d(_0xa88ded-0x2e4,_0x13b24d,_0x13b24d-0x32,_0xa88ded-0x36);}return _0x4b485e[_0xcdcf00(0x88d,0xc6c,-0x3b0,0xa7e)](_0x148a10,this['a'])?this['b']:_0x148a10===this['b']?this['a']:'';}};const _0x128ce7={};_0x128ce7['buttonId']=_0x4b485e[_0x313705(0x55f,-0x399,0xe2a,0x1183)],_0x128ce7[_0x313705(0x1902,0x130d,0x1ec8,0x198f)]={},_0x128ce7[_0x23937d(0x738,0x2b8,0x13a6,0x8ca)]=0x1,_0x128ce7[_0x313705(0x1902,0x130d,0x1ec8,0x198f)][_0x313705(0x175a,0x1f47,0x148f,0xcd9)+'t']=_0x4b485e['UzbkX'];let _0x817989=[_0x128ce7];await _0x175756[_0x313705(0xb3e,-0x303,0xeae,0x8d8)+_0x23937d(0x111a,0x9e8,0x37f,0x990)](_0x5cd288[_0x23937d(0x118c,0x1196,0x9f9,0x4ec)],_0x817989,_0x23937d(0x1184,0x1afb,0x1d3c,0x194a)+_0x313705(0x1b13,0x1108,0x1079,0x2837)+_0x313705(0x1dff,0x1bb8,0x1797,0x232f)+_0x23937d(0x184f,0x2103,0x19a8,0xaa2),_0x175756['user'][_0x313705(0x17b7,0x1469,0x14ce,0x10ae)],_0x5cd288);}break;}else return'Error!';}case _0x4b485e['AUmAc']:case _0x4b485e[_0x23937d(0x1997,0x28af,0x1d74,0x20c6)]:{if(_0x1bac1f)return _0x1db05d(mess[_0x23937d(0x61c,0x798,0x5d,0x862)]);if(_0x1e03f5)return _0x1db05d(mess[_0x313705(0x926,0x14e6,0x2ce,0x9c6)]);if(_0x5cd288[_0x313705(0x2089,0x2715,0x1a80,0x11e7)])return _0x4b485e[_0x313705(0x1f93,0x13e4,0x180a,0x182c)](_0x1db05d,_0x4b485e['CSyLf']);this[_0x23937d(0x661,-0x43,0x128,0xcdd)]=this[_0x23937d(0x661,-0x5f4,0x7f4,0xa91)]?this[_0x23937d(0x661,0x3a,0x11fc,0x13c1)]:{};let _0x598055=Object[_0x23937d(0xed6,0x1c6,0x6ca,0x132a)](this[_0x23937d(0x661,0xbfb,0x11db,0x7d2)])[_0x313705(0x1a2b,0x1e37,0x1a1a,0x26a5)](_0x35ab83=>_0x35ab83[_0x313705(0xb88,0x1271,0xef4,0x6dd)](_0x5cd288['sender']));if(!_0x598055){if(_0x4b485e[_0x23937d(0x1867,0xed9,0x1408,0x1fa6)](_0x4b485e[_0x313705(0x1e0c,0x281a,0x23c7,0x2600)],_0x4b485e[_0x313705(0xbda,0xb35,0x6e3,0x13a9)])){const _0x220709={};_0x220709[_0x313705(0x209f,0x24be,0x1545,0x11ae)]=''+_0x320a0c[_0x23937d(0x1ae6,0x1227,0x1cfb,0x1e18)];const _0x4b004a={};_0x4b004a[_0x313705(0x942,-0x3ad,-0x2ad,-0x4bd)]=_0x3e6d8d,_0x252c2c['sendMessag'+'e'](_0x3ecf7d[_0x313705(0x14f2,0x5d3,0x895,0x2151)],_0x220709,_0x4b004a),_0x3de7ab=_0x550316[_0x313705(0x1723,0x86d,0x1572,0x1236)+'nc'](_0x23937d(0xb1b,0x6db,0x1591,0xdd9)+_0x313705(0x1979,0x1df6,0x1a23,0x16be)+_0x23937d(0x1af0,0x21f5,0x1816,0x251f)+_0x23937d(0x1c22,0x1021,0x23c5,0x2354));const _0x1da8ea={};_0x1da8ea[_0x313705(0x1360,0x1ff0,0x5ac,0xf9f)]=_0x535909,_0x522e66[_0x313705(0xcaa,0x3d8,0x9d4,0x3b1)+'e'](_0x1d6445['chat'],_0x1da8ea);}else{const _0x5b99ad={};_0x5b99ad['buttonId']=_0x4b485e[_0x23937d(0x1918,0x19f7,0x1386,0x1f4d)],_0x5b99ad[_0x313705(0x1902,0x174b,0x12d5,0x21e3)]={},_0x5b99ad['type']=0x1,_0x5b99ad[_0x313705(0x1902,0x174b,0x12d5,0x21e3)]['displayTex'+'t']=_0x4b485e[_0x313705(0xf38,0x629,0x1534,0x601)];let _0x4a8a7a=[_0x5b99ad];await _0x175756[_0x313705(0xb3e,0x3cb,0x450,0xaeb)+_0x23937d(0x111a,0x1335,0x1ae2,0x915)](_0x5cd288[_0x313705(0x14f2,0x1774,0x878,0x1fe7)],_0x4a8a7a,'```You\x20Are'+_0x23937d(0x12,-0x8ef,0x1d,0x313)+'\x20Anonymous'+_0x313705(0xbf9,0x172,0x12de,0xd31)+_0x313705(0x929,0x10d1,-0xbf,0xc1a)+'Button\x20To\x20'+_0x313705(0x1edd,0x2b59,0x205f,0x2085)+_0x23937d(0x1223,0x1346,0x866,0xe53)),_0x1db05d(![]);}}let _0xfffb63=_0x598055['other'](_0x5cd288[_0x23937d(0x14ce,0x1533,0xb37,0xd62)]);if(_0xfffb63)await _0x175756[_0x23937d(0x1574,0xc81,0x1b7e,0x1764)](_0xfffb63,_0x23937d(0xb5e,0xd21,-0x8c,0x2be)+_0x313705(0x1379,0x1fe1,0x650,0xb99)+_0x313705(0x1b5f,0x1e04,0x1a66,0x15e0)+_0x23937d(0x12d7,0x1059,0x1f4e,0x1400),_0x5cd288);delete this[_0x23937d(0x661,0xb3b,0x432,0xb0a)][_0x598055['id']];let _0x3b9417=Object[_0x23937d(0xed6,0x1283,0x1c1,0x845)](this[_0x23937d(0x661,0x7cc,-0x5b5,-0x685)])[_0x23937d(0x16c5,0x104d,0x2488,0x1483)](_0xbff512=>_0xbff512[_0x23937d(0xebc,0xa40,0x17b9,0x1819)]==='WAITING'&&!_0xbff512[_0x23937d(0x822,0x3d0,0x5cd,0x108c)](_0x5cd288[_0x23937d(0x14ce,0x2392,0x131b,0x1cfe)]));if(_0x3b9417){const _0xc34453={};_0xc34453[_0x313705(0x175a,0x1d1d,0x2119,0x1df9)+'t']=_0x313705(0x1d70,0x297a,0x2307,0xf30);const _0x3525a3={};_0x3525a3[_0x313705(0x1e72,0x1025,0x238a,0xfb5)]=_0x4b485e['AUmAc'],_0x3525a3[_0x313705(0x1902,0x1ced,0x1a1f,0x1300)]=_0xc34453,_0x3525a3[_0x313705(0xa9e,0xccc,0xb6b,0x17d0)]=0x1;const _0x16f584={};_0x16f584['buttonId']=_0x4b485e[_0x313705(0x55f,0x128e,0x6bb,-0x83f)],_0x16f584[_0x313705(0x1902,0x264d,0x248a,0x248e)]={},_0x16f584[_0x23937d(0x738,0x140a,0x13b2,-0x3e6)]=0x1,_0x16f584[_0x313705(0x1902,0x264d,0x248a,0x248e)][_0x23937d(0x13f4,0x214b,0x1d25,0x112c)+'t']=_0x4b485e[_0x313705(0x1702,0x1ac6,0x211b,0x20e0)];let _0x4fc245=[_0x3525a3,_0x16f584];await _0x175756['sendButton'+'Text'](_0x3b9417['a'],_0x4fc245,_0x23937d(0x8df,0xd89,-0x80,0x26)+_0x313705(0x87a,0xf33,0xad4,0x1083)+'d\x20Partner,'+_0x313705(0x1827,0xf7f,0x1a33,0x1a1c)+'an\x20Send\x20Me'+_0x313705(0x1d2a,0x1ea9,0x24d4,0x1324),_0x175756['user'][_0x23937d(0x1451,0x11b3,0x1967,0x1dc3)],_0x5cd288),_0x3b9417['b']=_0x5cd288[_0x23937d(0x14ce,0x1891,0xa2b,0x20a2)],_0x3b9417['state']=_0x4b485e['pGiNs'],await _0x175756[_0x313705(0xb3e,0xbca,0x782,-0x266)+'Text'](_0x3b9417['b'],_0x4fc245,_0x313705(0xc45,-0x213,0x1ab6,0x1031)+_0x23937d(0x514,0x253,-0x4fe,-0x8dd)+_0x23937d(0x172b,0x142e,0x1815,0x254b)+_0x23937d(0x14c1,0x1cd5,0x13c9,0xf3d)+_0x23937d(0x1093,0xc9e,0x15ac,0x426)+_0x23937d(0x19c4,0x1489,0x16cc,0x1fcc),_0x175756[_0x313705(0x787,-0x57a,0x1054,-0x762)]['name'],_0x5cd288);}else{if(_0x4b485e[_0x23937d(0x1b1,-0xa01,0xc46,0x590)](_0x23937d(0xb50,0xc85,0x899,0xa0b),_0x4b485e[_0x23937d(0x1ca6,0x282f,0x1630,0x1179)])){let _0x3d59aa=+new Date();this[_0x23937d(0x661,-0x7bf,0x81b,0x575)][_0x3d59aa]={'id':_0x3d59aa,'a':_0x5cd288[_0x23937d(0x14ce,0x1711,0x1ddb,0xfac)],'b':'','state':_0x313705(0x16f2,0x1a7b,0x15bf,0x257c),'check':function(_0x2d9fc2=''){function _0x5b5bc0(_0x17bf78,_0x1d4b58,_0xb75888,_0x4be2b2){return _0x23937d(_0x4be2b2-0xe1,_0x1d4b58,_0xb75888-0x169,_0x4be2b2-0x84);}return[this['a'],this['b']][_0x5b5bc0(0xa41,0x105d,-0x892,0x259)](_0x2d9fc2);},'other':function(_0x40fb4c=''){function _0x30d7fe(_0x267522,_0x36fb47,_0x3a77e0,_0x2c1278){return _0x313705(_0x3a77e0-0x1d2,_0x2c1278,_0x3a77e0-0x4a,_0x2c1278-0x1a4);}function _0x3b4dc1(_0x4da6ec,_0x391c1d,_0x4eae57,_0x2988a7){return _0x313705(_0x4da6ec- -0x241,_0x4eae57,_0x4eae57-0xc3,_0x2988a7-0xe9);}return _0x4b485e[_0x3b4dc1(0x1337,0x1d5d,0x1627,0x1410)](_0x40fb4c,this['a'])?this['b']:_0x4b485e[_0x3b4dc1(0x1119,0x1a0a,0x17b1,0x95e)](_0x40fb4c,this['b'])?this['a']:'';}};const _0x50eeee={};_0x50eeee[_0x313705(0x1e72,0x20f1,0x1789,0x2997)]=_0x4b485e['cppjc'],_0x50eeee[_0x23937d(0x159c,0x1b57,0x17ae,0x7eb)]={},_0x50eeee[_0x313705(0xa9e,0xec1,0x1898,0xe39)]=0x1,_0x50eeee[_0x23937d(0x159c,0x1b57,0x17ae,0x7eb)][_0x313705(0x175a,0xc6f,0x180c,0x20a4)+'t']=_0x4b485e['UzbkX'];let _0x1be106=[_0x50eeee];await _0x175756[_0x23937d(0x7d8,0x9d2,0xfb4,0x81c)+_0x313705(0x1480,0x2127,0x1302,0xbc1)](_0x5cd288['chat'],_0x1be106,'```Please\x20'+_0x23937d(0x17ad,0x97b,0xd86,0x1bbc)+_0x23937d(0x1a99,0x1bd1,0x2408,0x200d)+_0x313705(0x1bb5,0x1def,0x1f24,0x2992),_0x175756['user']['name'],_0x5cd288);}else _0x383676(_0x4b485e[_0x313705(0x1ebe,0x1650,0x1061,0x1f01)]),_0x4b485e[_0x313705(0x1a81,0xfd8,0x1ac8,0x1914)](_0x46098b,![]);}break;}case'public':{if(_0x4b485e[_0x23937d(0x920,0x12a4,0x10e3,0x144a)]!==_0x4b485e[_0x23937d(0x920,0xaed,0x7f9,0xaa7)]){if(!_0x3fb5de[_0x23937d(0x1d23,0x2ab0,0x101c,0x1003)])return _0x4b485e[_0x313705(0x1bf5,0x16e0,0x2607,0x1971)](_0x48dfcf,''+_0x3cd6c2[_0x313705(0x152c,0x1eb9,0xa56,0x1056)]);if(!_0x4b485e[_0x23937d(0x916,0x615,-0x190,-0x72)](_0xb52909['chat'],_0x4f93c2))return _0x4b485e[_0x313705(0x2057,0x12b9,0x20a3,0x1f5d)](_0x55adc3,_0x23937d(0x1685,0x8ee,0x243e,0x23a5)+_0x23937d(0x919,0x2bd,0xce,0x16fb)+_0x23937d(0x17c7,0x1f81,0x12c3,0xa8c)+'*'+_0x18da59+(_0x23937d(0x7d9,0xa8a,0x56e,0x1126)+_0x313705(0x176f,0x13cd,0x2081,0x21c6)+_0x313705(0x1d25,0x1af4,0xe08,0x141e)));_0x53ca1f=_0x1dba9c[_0x106e64['chat']][-0xb6d+-0x20f2+0x14*0x238][_0x23937d(0x1ce3,0x2ab8,0x221a,0x20aa)](_0x4337ec[_0x11d3f5[_0x313705(0x14f2,0xaf0,0x204f,0xca3)]][0x24b*-0xe+0x18e2+0x73a*0x1]),_0x2e6af4=_0x2c2bda[_0x313705(0x4de,-0x89d,0x119c,0xbc2)](_0x32d7d2[_0x313705(0x1834,0xc28,0x207d,0x2534)]);if(_0x1c6c68)return _0x4b485e[_0x313705(0x1e3f,0x20fc,0x1b73,0x20d9)](_0x2c74c1,_0x23937d(0xfdb,0xb87,0x5bc,0x1bb)+'ed');_0xdf0b37[_0x38e78f[_0x23937d(0x118c,0x41b,0xb60,0xca0)]][0x1*0x383+0x19bf*0x1+-0x1d40][_0x23937d(0xdbc,0x1617,0x4bd,0x1837)](_0x2a9676['sender']),_0x25d5df=_0x3f93c0[_0x4c9d87[_0x313705(0x14f2,0x1a80,0x2399,0xea0)]][-0x9*0x98+-0x1849*0x1+-0x1da2*-0x1]['concat'](_0x350fb0[_0x83c096['chat']][0x12bb+0xf*0xb3+-0x1d36]),_0x4dcc97=_0x23937d(0x1c3a,0x1aac,0x21fa,0x229f)+'❯*\x0a\x0a*Reaso'+'n:*\x20'+_0x4e1232[_0xf0731e['chat']][0x594*-0x1+0x132+0x462]+(_0x313705(0x69f,0x7b7,0x9c4,0x1232)+_0x23937d(0x1a74,0x16c0,0x1b8f,0x1ce0)+'\x20Total:\x20')+_0x381ad3[_0x2e93e9[_0x313705(0x14f2,0x10e7,0x2356,0xec5)]][-0x1*0x247d+-0x361+0x27df][_0x23937d(0x3de,-0x83a,0x1050,0x109d)]+'\x0a'+_0x3a3c65[_0x22d8df[_0x23937d(0x118c,0x15bb,0x159f,0x7a3)]][0x202*-0x4+0x1*0xc6d+-0x464][_0x313705(0xe7c,0x819,0x1c92,0x1528)]((_0x157dde,_0x31ca99)=>'╠\x20'+(_0x31ca99+(0x1*-0x637+-0x2*0x1352+0x166e*0x2))+_0x23937d(0xf52,0xc24,0x1892,0xa47)+_0x157dde[_0x23937d(0xccf,0x311,0x13a,-0x1d5)]`@`[-0x651*-0x2+-0x238b+-0x11*-0x159])[_0x313705(0x1f7c,0x29e1,0x2524,0x2e27)]('\x0a')+(_0x313705(0x20b7,0x1bfa,0x2442,0x212b)+_0x313705(0x8a2,0xebc,-0x3ea,0xbb4)+_0x313705(0xd92,0x14ea,0x1c73,0x1552)+'Total:\x20')+_0x3ef3c7[_0x43e8ab['chat']][-0xceb+0x7b*0x38+-0xdfb][_0x23937d(0x3de,0xc26,0x112,0xd10)]+'\x0a'+_0x6c8078[_0x41b2f7['chat']][-0x264e+0x11a9+0x14a7][_0x23937d(0xb16,0x19ed,0x19e1,0x5db)]((_0x13ffc2,_0x31c2a6)=>'╠\x20'+(_0x31c2a6+(-0x1cb2+0x2*-0x78b+-0xb*-0x3fb))+'.\x20@'+_0x13ffc2['split']`@`[0x1*-0x20e2+0x2cf*0x2+0x1b44])['join']('\x0a')+('\x0a│\x20\x0a╚════\x0a'+'\x0a*')+_0x45734e+(_0x23937d(0x1132,0x871,0x1736,0x1f48)+'\x20To\x20Delete'+_0x23937d(0x9f2,0x1568,0xd26,0xcb3)+_0x23937d(0x12f3,0x1f43,0x911,0xdcf));const _0x3c95f2={};_0x3c95f2[_0x313705(0x175a,0x22ef,0x24e7,0xd77)+'t']=_0x4b485e[_0x313705(0x7a1,0x86b,0x890,0x678)];const _0x50bb85={};_0x50bb85[_0x313705(0x1e72,0x25fb,0x2207,0x2729)]=_0x5606af+_0x313705(0x1a01,0x248e,0x1db9,0x164b),_0x50bb85[_0x313705(0x1902,0x1030,0x179a,0xee3)]=_0x3c95f2,_0x50bb85[_0x313705(0xa9e,0xc5f,0x3ca,0x3b1)]=0x1;const _0x7e4942={};_0x7e4942[_0x313705(0x175a,0x146e,0xdfc,0x22d2)+'t']=_0x4b485e[_0x23937d(-0x8,0x64e,-0x9b5,-0x9a6)];const _0x4cbf99={};_0x4cbf99[_0x313705(0x1e72,0x26da,0x2018,0x111f)]=_0x698035+_0x23937d(0x1604,0x1c56,0x1a13,0x89a),_0x4cbf99['buttonText']=_0x7e4942,_0x4cbf99[_0x23937d(0x738,0x10da,0x12e8,-0x262)]=0x1;let _0x30bd6d=[_0x50bb85,_0x4cbf99];const _0x4407c7={};_0x4407c7[_0x23937d(0x1d39,0x137d,0x2178,0x2611)]=_0x1e15f1,_0x4407c7[_0x23937d(0x106e,0x5f4,0x1356,0x14f7)]=_0x22b7a3[_0x23937d(0x421,0x68b,0x59c,0x12eb)][_0x23937d(0x1451,0xb8b,0x1b4d,0xa7e)],_0x4407c7[_0x23937d(0xc3a,0x5be,0x1037,0x3e3)]=_0x30bd6d,_0x4407c7[_0x23937d(0x1b19,0x18e7,0x1771,0xc13)]=0x1,_0x4407c7['mentions']=_0x4ffbd1;let _0x497eac=_0x4407c7;_0x573651[_0x23937d(0x944,0xef7,0xc56,0x10f6)+'e'](_0x1a55b2['chat'],_0x497eac);}else{const _0x130bc6=_0x4b485e[_0x23937d(0x117a,0x1bd4,0x17dd,0x132f)][_0x23937d(0xccf,0xd12,0x893,0x16bf)]('|');let _0x12a3ee=0xaac+0x1717+-0x21c3;while(!![]){switch(_0x130bc6[_0x12a3ee++]){case'0':if(_0x1bac1f)return _0x1db05d(mess['ban']);continue;case'1':_0x1db05d(_0x4b485e['XRZmu']);continue;case'2':_0x175756[_0x23937d(0x25d,0x6d5,-0x269,0x3f5)]=!![];continue;case'3':if(_0x1e03f5)return _0x4b485e[_0x313705(0x1525,0xce0,0x1a04,0x17f4)](_0x1db05d,mess[_0x313705(0x926,-0x476,0x36c,0xcbe)]);continue;case'4':if(!_0x24aa58)return _0x4b485e[_0x23937d(0x1217,0x1d95,0x86d,0xb50)](_0x516d85,''+mess['owner']);continue;}break;}}}break;case'self':{const _0x18f9be=_0x4b485e[_0x313705(0x6a4,0x11d6,-0x204,0x14f9)][_0x23937d(0xccf,0xd7c,0x12e,0x14d4)]('|');let _0x478dc8=0x1c4a+-0x16a5+-0x5a5;while(!![]){switch(_0x18f9be[_0x478dc8++]){case'0':_0x4b485e['kvgMP'](_0x1db05d,_0x4b485e[_0x23937d(0x1ab,0x5ed,-0x775,-0x282)]);continue;case'1':if(_0x1e03f5)return _0x4b485e[_0x23937d(0x330,0xa18,0xac2,0xb33)](_0x1db05d,mess[_0x313705(0x926,0x147e,-0xd2,0x15d9)]);continue;case'2':if(!_0x24aa58)return _0x4b485e[_0x23937d(0x181c,0x1338,0x10f5,0xef6)](_0x516d85,''+mess[_0x23937d(0xc84,0x191d,0x381,0x1877)]);continue;case'3':_0x175756['public']=![];continue;case'4':if(_0x1bac1f)return _0x4b485e['gqLuj'](_0x1db05d,mess['ban']);continue;}break;}}break;case _0x4b485e['awyyB']:case _0x4b485e['YQGtR']:if(_0x1bac1f)return _0x4b485e[_0x23937d(0x1d63,0x16f8,0x127b,0x1119)](_0x1db05d,mess[_0x313705(0x982,0xadf,0xf93,0x716)]);if(_0x1e03f5)return _0x1db05d(mess['banChat']);if(!q)return _0x4b485e[_0x23937d(0x1b8b,0x1b36,0x23e3,0x1e9a)](_0x1db05d,_0x23937d(0x12d3,0x13a9,0xe23,0xc40)+'s\x20*#setbio'+_0x313705(0xda5,0x1906,0x629,0x17a7));_0x175756['setStatus'](''+q),_0x1db05d(mess[_0x23937d(0x14d5,0x106e,0x1ed8,0x13b4)]);break;case _0x4b485e[_0x313705(0x1cc5,0x19e3,0x233b,0x1601)]:{if(_0x4b485e[_0x23937d(0x179d,0x1394,0x1976,0xcc0)]!==_0x4b485e[_0x23937d(0x1d88,0x12c1,0x114c,0x2b42)]){if(_0x1bac1f)return _0x4b485e[_0x23937d(0x140,-0xa14,-0x9c1,0x7d3)](_0x1db05d,mess['ban']);if(_0x1e03f5)return _0x4b485e[_0x313705(0x122b,0xfc1,0x4d1,0x6a5)](_0x1db05d,mess[_0x23937d(0x5c0,0x7f6,0x718,0x12ee)]);if(!_0x24aa58)return;if(_0x4b485e[_0x313705(0x57a,0x66d,0x9ac,0x8cb)](_0x1ba32f[_0x23937d(0x3de,0x34,0x2bf,-0x80c)],0x4*0x50b+-0x7ea+-0xc41))return _0x4b485e[_0x313705(0xbab,0xa5d,0x1a3d,0x1115)](_0x516d85,_0x313705(0x1a1a,0x108a,0xf35,0x144e)+_0x23937d(0x71b,0x14e8,0x89d,-0x3b3)+'pe\x20off\x20to\x20'+_0x23937d(0x219,-0x961,-0xa38,-0x29a));if(_0x4b485e['gMazs'](_0x1ba32f[0x677+0x7a*-0x13+0x27*0x11],'on')){if(_0x4b485e['xXcZE'](antitags,!![]))return;global[_0x23937d(0x1264,0xc4f,0x9c0,0x10a3)]=!![],_0x4b485e[_0x313705(0x163e,0x103b,0x1256,0x24d5)](_0x516d85,_0x313705(0x17d7,0xa12,0x2497,0xc0f)+_0x23937d(0x6e6,-0x4d0,-0x4a2,0x118f)+'ed\x20antitag'+'!');}else{if(_0x1ba32f[0x1c31*-0x1+-0x1bd1+-0x3802*-0x1]===_0x4b485e['hbAtH']){if(_0x4b485e['FEZkh'](_0x313705(0x203c,0x2035,0x275f,0x1d31),'WxaMM'))_0x1f38fa=_0x51d698[_0x23937d(0xce7,0x11ec,0xbe7,0x886)](_0x501b3c,null,0x2125+0x3*-0x5e8+0xf6b*-0x1),_0x284632=_0x571646[_0x23937d(0x1806,0x1d64,0xddb,0x2200)](_0x5b4040),_0x3f950d==_0x9a8ea5&&(_0x137576=_0x3d9745['format'](_0x20cd03)),_0x4d24ca(_0x417505);else{if(antitags===![])return;global[_0x313705(0x15ca,0x169c,0xa61,0x1f62)]=![],_0x4b485e['uIbao'](_0x516d85,_0x23937d(0x1471,0x1771,0x1277,0x79d)+_0x23937d(0xf57,0x141c,0xc0f,0x1a3)+_0x313705(0x1e9c,0x19d1,0x12da,0x20e5)+_0x313705(0x1f65,0x1310,0x26d3,0x2538));}}else _0x516d85('Choose\x20on\x20'+'or\x20off');}}else{_0x41d112=0x16b4+-0x1a4f+-0xd*-0x47,_0x3ad56c=_0x4b485e[_0x23937d(0x1988,0x14b9,0x1bf8,0x229c)];for(let _0xea12c of _0x8cc43d){_0x1af877+=-0x1*-0x26ab+-0x6a4+-0x2006,_0x3d98c2+=_0x313705(0x1cb1,0x2828,0x106b,0x118d)+_0x1c8b2e[_0x313705(0x1503,0x19ba,0xfb5,0x77f)]()+_0x313705(0xbf7,0x10ea,0x122,0x1aa8),_0x4330fc+=_0x313705(0x1e5b,0x2ac9,0x19f0,0x21fa)+_0xea12c[_0x313705(0x1aec,0x22fe,0x235f,0x16fe)]+'\x0a',_0x559d2d+=_0x23937d(0xf6,-0xa62,-0x3f8,0x638)+_0xea12c['film_link']+'\x0a';}_0xbde596+='══════════'+_0x23937d(0xf03,0x1706,0x1a74,0xd),_0x4b485e[_0x23937d(0x7b0,0xc40,0xb56,-0xe3)](_0x4cff3b,_0xb0231b);}}break;case _0x313705(0x1d8b,0x1570,0x1512,0x2ac5):case'p':case _0x4b485e[_0x23937d(0x1139,0x1b27,0x1913,0x401)]:case'statusbot':{if(_0x4b485e['JnYKg'](_0x4b485e[_0x23937d(0x82d,-0x6c6,0x351,-0x659)],_0x4b485e['XLtnL'])){if(_0x1bac1f)return _0x4b485e[_0x23937d(0xa5a,0x1200,0x319,0x749)](_0x1db05d,mess[_0x23937d(0x61c,-0x57c,-0x173,0x82e)]);if(_0x1e03f5)return _0x1db05d(mess[_0x23937d(0x5c0,0x6ff,0x11a4,0xac0)]);const _0x11e853=process[_0x23937d(0xcb,0x8ff,-0x970,0x3a1)+'e'](),_0x26f31f=os[_0x313705(0x14bf,0xf71,0x1690,0x1a3c)]()[_0x313705(0xe7c,0x194,0x2b9,0x1ad7)](_0x15863f=>{function _0x38ceed(_0x513c91,_0x1a119d,_0x1fb925,_0x5a99b0){return _0x313705(_0x1fb925- -0x2b6,_0x1a119d,_0x1fb925-0xf3,_0x5a99b0-0x185);}function _0x4ea9aa(_0x4dff93,_0xbf2936,_0x5d7676,_0x40efac){return _0x313705(_0x4dff93- -0x3fe,_0x5d7676,_0x5d7676-0x19c,_0x40efac-0x168);}return _0x4b485e[_0x38ceed(0x92b,0xbf2,0x195,-0xab3)](_0x4b485e['JnGwy'],_0x4b485e[_0x4ea9aa(0x11a7,0x1089,0xbbd,0x106e)])?_0x38ceed(-0x34a,0xe2,0xb6,0x2bb):(_0x15863f[_0x4ea9aa(0x5a9,-0x498,0x110d,-0x8b)]=Object[_0x38ceed(0x23fc,0x24c0,0x1b4a,0x257b)](_0x15863f['times'])['reduce']((_0x248aae,_0x1694e4)=>_0x248aae+_0x15863f[_0x38ceed(0x117d,0x13a4,0x4e5,0x67c)][_0x1694e4],0x25de+-0x1142+-0x2*0xa4e),_0x15863f);}),_0x193254={};_0x193254[_0x23937d(0x421,0x5d3,-0x59c,0x727)]=0x0,_0x193254[_0x23937d(0xbf4,0xc3c,0xcef,0x9f2)]=0x0,_0x193254['sys']=0x0,_0x193254[_0x313705(0xe12,0x1187,0x105c,0x1caa)]=0x0,_0x193254[_0x313705(0xceb,0x140,0xc51,0x130d)]=0x0;const _0x4ecce8={};_0x4ecce8['speed']=0x0,_0x4ecce8['total']=0x0,_0x4ecce8[_0x313705(0x79b,0x1064,0xc14,0xf28)]=_0x193254;const _0x2e1bef=_0x26f31f[_0x313705(0x1e9e,0x270a,0x27a4,0x2bf0)]((_0x11195c,_0x30bbda,_0x42a0f6,{length:_0x3837ef})=>{function _0x98e5c8(_0x2eaee2,_0xcaebd9,_0x217755,_0x11ce78){return _0x313705(_0x11ce78- -0x127,_0x217755,_0x217755-0x36,_0x11ce78-0x34);}function _0x43706b(_0x4a427a,_0x5c4bfc,_0x4a30de,_0x4ad18a){return _0x313705(_0x4a427a- -0x49a,_0x5c4bfc,_0x4a30de-0x183,_0x4ad18a-0x1d9);}if(_0x4b485e['tECOH'](_0x4b485e['nDReH'],_0x43706b(0x907,0x68d,-0x30c,-0x13f))){const _0x74272e=('2|4|3|6|7|'+_0x98e5c8(0xbde,0x13f2,0x14d3,0x1a22))[_0x98e5c8(0x19ff,0xc2e,0x14fc,0xf0e)]('|');let _0x19dc65=-0x67*-0x1+0xadb+-0xb42;while(!![]){switch(_0x74272e[_0x19dc65++]){case'0':return _0x11195c;case'1':_0x11195c[_0x98e5c8(0x102,-0x207,0x5ca,0x674)][_0x98e5c8(0x116a,0x1924,-0x294,0xbc4)]+=_0x30bbda[_0x43706b(0x301,0x891,0xea8,0x67)][_0x43706b(0x851,0xc4,0xcc8,0x1076)];continue;case'2':_0x11195c[_0x98e5c8(0xe02,-0x399,0x35c,0x880)]+=_0x30bbda[_0x43706b(0x50d,0x7ba,-0x45e,-0x194)];continue;case'3':_0x11195c[_0x98e5c8(0x13a6,-0x4ad,0x150f,0x674)]['user']+=_0x30bbda[_0x43706b(0x301,0x216,0xf69,-0x57a)][_0x43706b(0x2ed,0x1056,0x114f,0x10)];continue;case'4':_0x11195c[_0x43706b(0x10df,0x18f8,0x1375,0x1f8)]+=_0x4b485e[_0x98e5c8(0x2240,0xa5a,0x1b36,0x14b1)](_0x30bbda['speed'],_0x3837ef);continue;case'5':_0x11195c[_0x98e5c8(0xb04,-0x1a3,0x8e9,0x674)][_0x43706b(0x978,0x10a,0x3fe,0xa2e)]+=_0x30bbda[_0x98e5c8(0xccb,0xf3,-0x4d9,0x674)][_0x98e5c8(0x6dc,0x1607,0x600,0xceb)];continue;case'6':_0x11195c[_0x43706b(0x301,-0x8c8,-0x1b5,-0x72a)]['nice']+=_0x30bbda['times'][_0x98e5c8(0xd2a,0x8a4,0xd5d,0xe33)];continue;case'7':_0x11195c[_0x43706b(0x301,0x5ac,-0x868,0xb50)][_0x43706b(0x643,0x2ad,0x13be,0xfbf)]+=_0x30bbda[_0x43706b(0x301,0x3ac,0xed5,0x106b)]['sys'];continue;}break;}}else{const _0x214e22={};_0x214e22['text']=''+_0x4fc17e[_0x43706b(-0x113,-0xf1a,-0xb53,0x719)];const _0x37cc8f={};_0x37cc8f['quoted']=_0xbef5c9,_0x5fc01a[_0x43706b(0x810,-0x653,0x49d,0x7be)+'e'](_0x907d33[_0x43706b(0x1058,0x1b48,0x499,0x1cb0)],_0x214e22,_0x37cc8f),_0xee8886=_0x49d6fd[_0x98e5c8(0xf40,0x20eb,0x10ce,0x15fc)+'nc']('./Android/'+'AllData/st'+'icker/hehe'+_0x98e5c8(0x2810,0x268a,0x13a9,0x18f9));const _0xe2952b={};_0xe2952b[_0x43706b(0xec6,0x166b,0x16ab,0x1168)]=_0x4d0a8f;const _0x4543c2={};_0x4543c2['quoted']=_0x3894cd,_0x55e00b[_0x98e5c8(0x1542,-0x4b,0x8ae,0xb83)+'e'](_0x5c3150[_0x43706b(0x1058,0x1802,0x9fd,0x2cb)],_0xe2952b,_0x4543c2);}},_0x4ecce8);let _0x1ba771=_0x4b485e['etJZI'](speed),_0x1d21f2=_0x4b485e['fYsMQ'](_0x4b485e[_0x23937d(0x1ae,0x9bf,0x4a7,0xad4)](speed),_0x1ba771);neww=performance['now'](),oldd=performance['now'](),respon=('\x0aResponse\x20'+_0x23937d(0x407,-0x4e,0x24c,-0x910)+_0x1d21f2['toFixed'](-0x1658+-0x2*0xd0+0x17fc)+(_0x23937d(0xd2b,0x1b7f,0x1867,0x1768)+'\x0a\x20')+(oldd-neww)+(_0x313705(0x1b9f,0x11d0,0x1f61,0x1fed)+_0x23937d(0x1a2d,0x24ec,0x1d9d,0xc48)+_0x23937d(0x1d9b,0x22f6,0x1141,0xfb0))+_0x4b485e[_0x23937d(0x4c2,0x101c,0xfa0,0xbd0)](runtime,process[_0x23937d(0x166f,0xbb9,0xeaf,0x2376)]())+(_0x313705(0xed1,0xf95,0x192f,0xa34)+_0x23937d(0xbd0,0x1276,0x192,0xebd)+'\x20')+formatp(os[_0x23937d(0x1e06,0x26e5,0x1396,0x1ef9)]()-os['freemem']())+'\x20/\x20'+_0x4b485e[_0x313705(0x13b7,0x95f,0x10c3,0x5ca)](formatp,os['totalmem']())+(_0x23937d(0x502,0xa80,0x756,0xf90)+_0x23937d(0x1c91,0x236f,0xf65,0x2479)+_0x313705(0x1c5a,0x224a,0x2a10,0x2406))+Object[_0x313705(0x1e00,0x20bf,0x2666,0x143e)](_0x11e853)[_0x313705(0xe7c,0x19b1,0xd04,0x204)]((_0x2fbb9c,_0x1231e7,_0x445f59)=>_0x2fbb9c[_0x313705(0xeb4,0x1371,0x1441,0x12f6)](Math[_0x23937d(0x62b,0xe31,0x597,0xc0a)](..._0x445f59[_0x23937d(0xb16,0x300,0x835,0x118c)](_0x3108b4=>_0x3108b4['length'])),'\x20')+':\x20'+formatp(_0x11e853[_0x2fbb9c]))[_0x313705(0x1f7c,0x2070,0x1b7f,0x2b37)]('\x0a')+'\x0a\x0a'+(_0x26f31f[0x1a5b+0xac4+-0x1*0x251f]?_0x313705(0x1155,0x1f4c,0x1002,0x4f8)+_0x313705(0xafd,0x1026,0x978,-0x97)+_0x26f31f[-0x82b+0x22a5+-0x1*0x1a7a][_0x23937d(0x4a2,0x14e,0x79c,-0x139)][_0x23937d(0x1c07,0x1c17,0x1df3,0x2740)]()+'\x20('+_0x2e1bef[_0x23937d(0x1213,0x1ac8,0x1324,0x1a42)]+_0x23937d(0x1582,0xe67,0x1025,0x803)+Object[_0x313705(0x1e00,0x2144,0x28a8,0x102a)](_0x2e1bef['times'])[_0x313705(0xe7c,0x393,0x17a1,0x9a7)](_0xee827b=>'-\x20*'+(_0xee827b+'*')[_0x313705(0xeb4,0x1bea,0x539,0xd80)](-0x1df9*-0x1+0x148e+0x1*-0x3281)+':\x20'+((0x15a2+-0x652+0x5*-0x2fc)*_0x2e1bef[_0x313705(0x79b,-0x386,0x6c,0x1414)][_0xee827b]/_0x2e1bef[_0x313705(0x9a7,-0x237,0x1298,0x144e)])[_0x23937d(0x896,0x201,0xfa1,0x110e)](0x1479+0xcb*0xd+0x3*-0xa42)+'%')[_0x23937d(0x1c16,0x1796,0x17a1,0x148a)]('\x0a')+(_0x313705(0x12eb,0x16e3,0x16cd,0xd34)+_0x313705(0xb32,0x885,0x1442,0xf97)+'(')+_0x26f31f[_0x23937d(0x3de,0xa74,-0x9bc,0x36d)]+('\x20Core\x20CPU)'+'_\x0a')+_0x26f31f[_0x313705(0xe7c,0xfce,0xfe1,0x12a3)]((_0x172904,_0x412584)=>_0x412584+(-0xff3+-0x2e1*-0x4+0x470)+'.\x20'+_0x172904[_0x313705(0x808,0xeb8,0x602,0x15d)][_0x23937d(0x1c07,0x259f,0x2a2e,0x1cbc)]()+'\x20('+_0x172904['speed']+'\x20MHZ)\x0a'+Object['keys'](_0x172904['times'])[_0x313705(0xe7c,0x10ea,0x1887,0x431)](_0x3995ee=>'-\x20*'+(_0x3995ee+'*')[_0x313705(0xeb4,0xa64,0x955,0x119a)](-0x182d*0x1+0x2647+0xd4*-0x11)+':\x20'+((-0x1*0x2515+-0x2324+0x489d)*_0x172904[_0x23937d(0x435,0x213,0x3fb,0xa79)][_0x3995ee]/_0x172904['total'])['toFixed'](0x2112+-0x1fbe+0x1*-0x152)+'%')[_0x313705(0x1f7c,0x1a87,0x15ca,0x21ac)]('\x0a'))[_0x23937d(0x1c16,0x1bf7,0x148b,0x18fb)]('\x0a\x0a'):'')+('\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20'+_0x313705(0xc9f,-0x1dd,0x1461,0xe21)))[_0x23937d(0x1c07,0x15e8,0x172e,0x2823)](),_0x4b485e[_0x313705(0x1b34,0x23be,0x1e4b,0x2364)](_0x1db05d,respon);}else return _0x4b485e['Ybepr'](_0x237c26,this['a'])?this['b']:_0x4b485e['IpiNq'](_0x2a7ca3,this['b'])?this['a']:'';}break;case'speedtest':{if(_0x1bac1f)return _0x4b485e[_0x313705(0x10d3,0x1ff0,0x1654,0xc5a)](_0x1db05d,mess[_0x23937d(0x61c,0x123c,0x847,0xc6f)]);if(_0x1e03f5)return _0x4b485e['OVjQg'](_0x1db05d,mess['banChat']);_0x4b485e[_0x23937d(0x52,0x6a3,0x42a,0xe71)](_0x1db05d,_0x4b485e[_0x23937d(0x32a,-0x4b9,-0x314,0xfca)]);let _0x25280d=_0x4b485e[_0x313705(0x745,0x4f6,0xb32,0x10be)](require,_0x4b485e[_0x23937d(0x18e6,0x154b,0xd4f,0x209d)]),{promisify:_0x180933}=_0x4b485e[_0x313705(0x1e8b,0x1fd3,0x14a4,0x2ac5)](require,'util'),_0x3faa8e=_0x4b485e[_0x313705(0xfdc,0x9f6,0x5ad,0x42e)](_0x180933,_0x25280d[_0x313705(0x1960,0x171a,0x1789,0x18a3)])[_0x313705(0x107f,0x262,0xe35,0x314)](_0x25280d),_0x9a94fe;try{_0x9a94fe=await _0x4b485e['ltAdH'](_0x3faa8e,_0x4b485e['LMkBh']);}catch(_0x5b5231){if(_0x4b485e[_0x313705(0x1a3f,0x1df1,0x1cb0,0x1af7)](_0x4b485e[_0x313705(0x1bef,0x17d7,0xf8b,0x135b)],_0x4b485e[_0x23937d(0x190b,0x25f8,0x1214,0x18f8)]))_0x9a94fe=_0x5b5231;else{const _0xcb8f59={};_0xcb8f59[_0x313705(0x209f,0x1e86,0x18f0,0x1a78)]='😎',_0xcb8f59[_0x313705(0xcb5,-0x9f,0x985,0xa69)]=_0x4069c5['key'];const _0x1059f0={};_0x1059f0['react']=_0xcb8f59,_0xe0abab[_0x23937d(0x944,-0x127,0x110a,0x16ec)+'e'](_0x252189,_0x1059f0);const _0x1abc58={};_0x1abc58[_0x23937d(0x1d39,0x164f,0x21cc,0x153e)]=''+_0x506d1a[_0x23937d(0x1720,0x257b,0xe87,0x23f2)];const _0x592af7={};_0x592af7[_0x23937d(0x5dc,0x787,0x86a,-0x4a7)]=_0x475582,_0x15e681[_0x313705(0xcaa,0x1478,0x3e9,0x188b)+'e'](_0x2e8dc2['chat'],_0x1abc58,_0x592af7),_0x30f3d3=_0x28caf6['readFileSy'+'nc'](_0x23937d(0xb1b,0x159e,-0x3c1,0xa34)+_0x23937d(0x1613,0x206a,0x2266,0x2253)+_0x313705(0x110c,0x55f,0x11a4,0x138c)+_0x313705(0x10ec,0x1cf4,0xc45,0xc49));const _0x40b422={};_0x40b422[_0x313705(0x1360,0x7cb,0xce7,0x5e4)]=_0x499949,_0x27bd95['sendMessag'+'e'](_0x3fbe00[_0x313705(0x14f2,0x1d1b,0x23fe,0xeab)],_0x40b422);}}finally{let {stdout:_0x6dde46,stderr:_0x27cb87}=_0x9a94fe;if(_0x6dde46[_0x23937d(0x1c07,0x258c,0x250f,0x2298)]())_0x4b485e[_0x23937d(0x1d57,0x101e,0x2786,0x19c1)](_0x1db05d,_0x6dde46);if(_0x27cb87[_0x23937d(0x1c07,0x24f4,0x1386,0x1c73)]())_0x4b485e[_0x313705(0x1745,0x13e7,0x1819,0x1fce)](_0x1db05d,_0x27cb87);}}break;case _0x4b485e[_0x23937d(0xd24,0x1558,0x1b70,0x6dd)]:case _0x4b485e[_0x313705(0x1dc5,0x1c1f,0x273f,0x202e)]:{var _0x3e2431=_0x4b485e[_0x23937d(0x1964,0x200e,0x1823,0x2217)];const _0x2d42f8={};_0x2d42f8[_0x23937d(0x1d39,0x2c1f,0x1278,0xeaa)]='👀',_0x2d42f8['key']=_0x5cd288['key'];const _0x5719ae={};_0x5719ae[_0x313705(0x1d20,0x23f3,0xe0f,0x13c6)]=_0x2d42f8,_0x175756[_0x313705(0xcaa,0x553,0x8ff,0x826)+'e'](_0x423161,_0x5719ae);const _0x11b0c1={};_0x11b0c1['url']=_0x3e2431;const _0x31808d={};_0x31808d['audio']=_0x11b0c1,_0x31808d[_0x23937d(0x12aa,0x5ff,0x848,0xa3e)]=_0x4b485e[_0x313705(0x13e5,0x4cd,0x1a8b,0xe2a)],_0x31808d[_0x313705(0xf3f,0x1b80,0x1340,0x169d)]=!![],_0x175756[_0x313705(0xcaa,0x6cb,0x7c2,0x81b)+'e'](_0x5cd288[_0x313705(0x14f2,0xca2,0xcc3,0x1222)],_0x31808d,{'quoted':_0x5cd288});const _0x6e197a={};_0x6e197a[_0x313705(0xddf,0x1908,0x849,0x17fe)]=_0x23937d(0x917,0x926,-0x36,0x8d2)+_0x23937d(0x18b8,0x1a6e,0xd5a,0xd57)+_0x23937d(0x1c9d,0x152d,0x2723,0x1903)+_0x23937d(0x582,-0x664,0xeca,0x113)+_0x313705(0x1334,0x18bd,0xf68,0xa3b);const _0x186dc5={};_0x186dc5[_0x313705(0x1fa9,0x17db,0x2b5c,0x2c1a)]=_0x6e197a,_0x186dc5[_0x23937d(0x968,0xe5b,0xd08,-0x20a)]=_0x23937d(0x908,0x161a,0x109c,0x1476)+global['ownername']+(_0x313705(0xcd7,0x1238,0x666,0x345)+'://wa.me/')+global['owner']+_0x23937d(0x1058,0x140c,0x1d4d,0x593)+global[_0x313705(0xcd2,0x646,-0xee,0x1b23)],_0x175756[_0x313705(0xcaa,0x45f,0x2e8,0xfaf)+'e'](_0x5cd288['chat'],_0x186dc5);}break;case _0x4b485e['hAKfB']:case _0x4b485e[_0x23937d(0x1941,0x1d2e,0x102d,0x1f82)]:case'qr':case _0x4b485e[_0x23937d(0x1568,0x14f9,0x19c0,0x13b2)]:{if(_0x4b485e[_0x23937d(0x35d,0xc10,0xbcd,-0x33e)](_0x4b485e[_0x313705(0x1e6b,0x1bf0,0x1cdc,0x16b8)],_0x4b485e['XQUQR'])){const _0x1b574c={};_0x1b574c[_0x313705(0x209f,0x14cf,0x1f58,0x257a)]='📱',_0x1b574c[_0x313705(0xcb5,0x180a,0x10b,0x430)]=_0x5cd288[_0x313705(0xcb5,0x18df,0x12c8,0x882)];const _0x46e4bc={};_0x46e4bc['react']=_0x1b574c,_0x175756[_0x313705(0xcaa,0x10e8,0x109e,0x1132)+'e'](_0x423161,_0x46e4bc);const _0x2975c0={};_0x2975c0[_0x23937d(0xa79,0x1534,0xa06,-0x146)]=_0x4b485e['SqLpy'];const _0x2b2834={};_0x2b2834['image']=_0x2975c0;const _0x427064={};_0x427064[_0x313705(0xcce,0x21b,0x43e,0x11d0)]=_0x313705(0x445,-0x11b,0xe8e,-0x514)+_0x23937d(0x1b5,0x1b3,-0x12f,0x1ef)+_0x23937d(0x10e5,0x1079,0x176f,0x2ba)+'ʀᴇᴅ-ᴅʀᴀɢᴏɴ'+'-ʙᴏᴛ*',_0x175756[_0x23937d(0x944,-0x29,0xc53,0xe08)+'e'](_0x5cd288[_0x23937d(0x118c,0xac9,0x794,0xc2b)],_0x2b2834,_0x427064,{'quoted':_0x5cd288});}else{_0x266bfa[_0x313705(0xf2c,0x1271,0x157c,0x1e27)](_0x4b485e[_0x313705(0x10d6,0xd97,0x1dba,0x485)]+_0x5bea48[_0x23937d(0x194e,0x18a4,0x19ca,0x1f2d)]);const _0x2d46ec={};_0x2d46ec[_0x313705(0x1e72,0x1c03,0x249f,0x2665)]=_0x4b485e[_0x23937d(0x96d,0xd2d,0x1260,0x16a7)],_0x2d46ec[_0x23937d(0x159c,0xc30,0x23fa,0x1f92)]={},_0x2d46ec[_0x23937d(0x738,0xf11,0x2f9,0x874)]=0x1,_0x2d46ec[_0x23937d(0x159c,0xc30,0x23fa,0x1f92)][_0x313705(0x175a,0x1079,0x1975,0x1de3)+'t']=_0x4b485e['IFurs'],_0x1f957b[_0x23937d(0x7d8,0xda1,0xf86,0xad1)+_0x23937d(0x111a,0xad9,0x11d1,0x7cc)](_0x21c15b['chat'],[_0x2d46ec],_0x23937d(0x9ac,-0x52e,0xf58,-0x432)+_0x23937d(0x14b6,0x1f6f,0x22fe,0x23b4)+_0x313705(0x48a,-0x147,0xf0,0x47a)+_0x1f9d49[_0xf04321[_0x23937d(0x14ce,0x7d1,0x11db,0x224e)][_0x23937d(0xccf,0x1840,0x1546,0x1775)]('@')[0x1*-0x1939+0xd67+-0x11*-0xb2]]+('\x0a\x0aWant\x20to\x20'+_0x313705(0xee3,0x1556,0x1761,0x9ec)+_0x23937d(0x109c,0x822,0x190d,0x108a)+_0x23937d(0x17b6,0xb71,0x1b07,0x1e33)),''+_0x564df4[_0x23937d(0x96c,0x124b,0x258,-0x19f)],_0x50cd0f),delete _0x10ac4a[_0x552a04[_0x313705(0x1834,0xacd,0x21c2,0x1ef9)][_0x313705(0x1035,0x6e7,0x18bf,0x1428)]('@')[-0x7e6+-0x21e5*0x1+0x29cb]];}}break;case _0x4b485e['dXFdM']:{if(_0x4b485e['MahtO']!==_0x4b485e[_0x313705(0x1e31,0x257a,0x14ce,0x27c3)]){const _0x1ee7d3={};_0x1ee7d3[_0x23937d(0x738,0x4a2,0x448,0x104a)]=_0x5f11fd['medias'][_0x3ac88d][_0x23937d(0x1c5f,0x1e9f,0xe51,0x25e3)],_0x1ee7d3[_0x313705(0xddf,0xb7e,0x2ed,0x694)]=_0x404c04[_0x313705(0x6dd,0x121c,0x34,-0x44c)][_0x58d3cc][_0x23937d(0xa79,0x7c6,0x481,0x14fc)],_0x456f94[_0x23937d(0xdbc,0xb4c,0xe52,0x19e3)](_0x1ee7d3);}else{if(_0x1bac1f)return _0x4b485e[_0x313705(0x15f5,0x1031,0xdef,0x128f)](_0x1db05d,mess[_0x23937d(0x61c,0x1450,0x7c1,-0x48b)]);if(_0x1e03f5)return _0x4b485e[_0x313705(0x1aea,0x19b0,0x1467,0x259c)](_0x1db05d,mess['banChat']);if(!_0x24aa58)return _0x4b485e['Renun'](_0x1db05d,mess[_0x313705(0xfea,0x1367,0x69f,0x1c0)]);let _0x4731da=db[_0x23937d(0xe17,0x566,0x18b8,0x321)][_0x313705(0x918,-0x325,0xec1,0x1c2)][_0x4b45af];if(_0x4b485e['MCjPT'](_0x1ba32f[-0xf31*-0x1+0x1eb0+-0x5*0x92d],_0x4b485e[_0x23937d(0x139,0x55b,-0x51b,-0xa53)])){const _0x2d5b59=('4|5|1|3|2|'+'0')[_0x313705(0x1035,0xe4c,0x100b,0x1955)]('|');let _0x136a91=-0x5*-0x26b+0xb60+-0x1*0x1777;while(!![]){switch(_0x2d5b59[_0x136a91++]){case'0':_0x4b485e['pdXcl'](_0x1db05d,mess['success']);continue;case'1':_0x4731da[_0x313705(0x348,-0xb4f,0xa3a,0xe83)+'f']=![];continue;case'2':_0x4731da[_0x23937d(0xa07,0x1918,0x1676,0x1a4)+_0x313705(0x193b,0x10eb,0x106a,0x13e3)]=![];continue;case'3':_0x4731da[_0x23937d(0x1972,0x100c,0xcc2,0x1f53)+'g']=![];continue;case'4':_0x4731da[_0x313705(0xdba,0x1882,0x8e5,0xe1b)+_0x23937d(0x17b0,0xc44,0x111a,0x1e02)]=!![];continue;case'5':_0x4731da['templateVi'+_0x23937d(0x22c,-0xbb2,0xd2a,-0x8d8)]=![];continue;}break;}}else{if(_0x4b485e[_0x313705(0x1b5a,0x1b4b,0xe51,0x26c0)](_0x1ba32f[0x11da*-0x2+0x14e*0xb+-0x3*-0x71e],_0x4b485e[_0x23937d(0x1289,0x1074,0x1320,0x1806)])){if(_0x4b485e[_0x23937d(0x1b42,0x107b,0x1f4d,0x2345)](_0x4b485e[_0x23937d(0x295,-0x6cb,-0x4a0,0x516)],_0x4b485e[_0x23937d(0x6d6,-0x601,0x995,-0x3fa)])){if(_0x4b485e[_0x313705(0x13dc,0x859,0xf2b,0x626)](_0x1e65a7,_0x929a42))return _0x4b485e[_0x23937d(0x1869,0xc44,0x166e,0x189b)](_0x1b4269,_0x313705(0x19cf,0x23be,0x2653,0xcad)+_0x23937d(0x123a,0xd2a,0x1af7,0x323)+_0x23937d(0x5de,-0x7b,0x11db,0x14c5)+_0x313705(0x5c7,0x1192,-0x13c,0x1449)+'s\x20Transact'+'ion');if(!_0xe64c7e[-0x2*-0x136e+-0x85d*0x4+-0x567])return _0x4b485e[_0x23937d(0x1cb7,0x15d8,0x1dc6,0x1729)](_0xd1eb05,_0x313705(0x110b,0xd5d,0x1972,0x80f)+_0x4b485e[_0x313705(0xfe0,0x1c2a,0xd78,0x195f)](_0x3eb810,_0x22f427)+(_0x23937d(0xcad,0xa0c,0xbe2,0xc4e)+_0x23937d(0x133e,0x1bd1,0x2243,0x1776)+_0x23937d(0x100b,0x7c7,0x1989,0xf7f)+_0x313705(0x9bc,0x10ee,0x1585,0x18cd)));_0x4b485e[_0x23937d(0x15f9,0x1b4a,0xd5f,0x886)](_0x7a7fee,_0x26bb3d[_0x23937d(0x14ce,0x21a5,0x17bf,0xc44)],_0x531874);let _0x248678=_0x4b485e[_0x313705(0x1b98,0x1b2e,0x23e0,0x23b3)](-0x5*-0x1898+-0x254dd+-0x1*-0x36085,_0x16f824);_0x17c579(_0x1eb45e[_0x23937d(0x14ce,0x12c3,0x1434,0x816)],_0x248678),_0x4b485e['azNLA'](_0x1f83a7,()=>{function _0x2390b3(_0x336f11,_0x1e9d30,_0x1e79fa,_0x3a79da){return _0x313705(_0x1e79fa-0x18d,_0x1e9d30,_0x1e79fa-0x9d,_0x3a79da-0x1e6);}function _0x2f974a(_0x44ceaa,_0x100357,_0xc458c3,_0x2ebae0){return _0x313705(_0x44ceaa- -0x3f9,_0x100357,_0xc458c3-0x19,_0x2ebae0-0x52);}_0x4b485e[_0x2390b3(0x6b4,0x16aa,0xa36,0xf35)](_0x28da98,'Transactio'+_0x2f974a(0xdee,0x614,0x1073,0x1a03)+_0x2f974a(0x7ec,-0x1d5,-0x4e4,-0x4f8)+'\x20Remaining'+_0x2f974a(0x7bf,0x10d0,0x1635,0x51f)+_0x4b485e[_0x2390b3(0x20da,0x1304,0x2062,0x243c)](_0x44e4fd,_0x2953f6[_0x2f974a(0x143b,0x12e9,0x118a,0x1c8a)])+(_0x2f974a(0xec6,0x1113,0x117d,0xb17)+_0x2390b3(0x222a,0x1a9f,0x1ce2,0x134e)+'ugh\x20Emeral'+_0x2390b3(0x142e,0x106b,0xc91,0x1753)+_0x2390b3(0x1f48,0x94e,0x1704,0x14be)+'ction*\x20:\x20')+_0x4b485e[_0x2f974a(0x705,0x38d,-0x6b,0xc95)](_0x144a76,_0x104e6a[_0x2f974a(0x143b,0x19d4,0x1a77,0xb1d)]));},-0xf3b*0x2+-0x2671+-0x1*-0x4cb7);}else _0x4731da[_0x23937d(0xa54,0x1342,0x1240,0x19)+'age']=![],_0x4731da[_0x313705(0x167e,0x1261,0x16f9,0x1b55)+_0x23937d(0x22c,0xcbd,-0x88,0xd4d)]=!![],_0x4731da['templateGi'+'f']=![],_0x4731da[_0x313705(0x1cd8,0x1f6b,0xf72,0x1860)+'g']=![],_0x4731da['templateLo'+_0x23937d(0x28a,0x102e,-0x6cb,0x491)]=![],_0x4b485e[_0x313705(0xb5f,0x1a33,0x19c5,0xd14)](_0x1db05d,mess[_0x313705(0x183b,0x102c,0x1d84,0x25de)]);}else{if(_0x4b485e['JNNwN'](_0x1ba32f[0x13f8+-0x217d+0xd85],_0x23937d(-0x1e,0x851,-0x126,-0x1b1)+'f')){const _0x2f18d3=_0x4b485e[_0x313705(0x710,0x52c,0x13dc,-0x216)][_0x23937d(0xccf,0x4e8,0x61f,0x1a2)]('|');let _0xd06c81=0xa*-0x289+-0x16a5*-0x1+-0x9*-0x4d;while(!![]){switch(_0x2f18d3[_0xd06c81++]){case'0':_0x4731da['templateVi'+_0x313705(0x592,0x5f2,-0x10f,0x94)]=![];continue;case'1':_0x4731da[_0x23937d(0xa07,0x15f5,0x18b4,0xc82)+_0x313705(0x193b,0x11d0,0xa7c,0x1291)]=![];continue;case'2':_0x4731da['templateGi'+'f']=!![];continue;case'3':_0x4b485e['iCJTm'](_0x1db05d,mess[_0x313705(0x183b,0x1a98,0x1832,0x11eb)]);continue;case'4':_0x4731da[_0x313705(0x1cd8,0x2893,0x2b8d,0x15bc)+'g']=![];continue;case'5':_0x4731da[_0x313705(0xdba,0x1940,0x1380,0xa5d)+_0x23937d(0x17b0,0xa6e,0x2509,0x1db7)]=![];continue;}break;}}else{if(_0x4b485e[_0x313705(0x1e49,0x28af,0x222b,0x2b4f)](_0x1ba32f[0xdbc+0xd1*0x3+-0x1*0x102f],_0x23937d(0xa07,-0x1b6,0xe36,0x977)+_0x313705(0x193b,0xc18,0x1dc0,0x27da))){const _0x53b242=_0x4b485e[_0x23937d(0x915,0xf96,0x603,0x148a)][_0x23937d(0xccf,0x175e,0x19e9,0x1a35)]('|');let _0x131891=0x1411+0x2218+-0x3629;while(!![]){switch(_0x53b242[_0x131891++]){case'0':_0x4731da[_0x23937d(0x1318,0x1cbb,0x1256,0x952)+_0x23937d(0x22c,0xaf1,-0xc76,0xc5d)]=![];continue;case'1':_0x4731da[_0x23937d(0x1972,0x1a85,0x245e,0x1fee)+'g']=![];continue;case'2':_0x4731da['templateDo'+_0x313705(0x193b,0x272f,0x19b1,0x19a3)]=!![];continue;case'3':_0x4731da['templateGi'+'f']=![];continue;case'4':_0x4731da['templateIm'+_0x313705(0x1b16,0x1c34,0x20b2,0x2914)]=![];continue;case'5':_0x4b485e[_0x313705(0x510,0xe31,0x1252,0x1372)](_0x1db05d,mess[_0x313705(0x183b,0x1f39,0x1050,0x1ad6)]);continue;}break;}}else{if(_0x4b485e[_0x313705(0x7c8,-0x36,0x782,0xb1d)](_0x23937d(0x14b4,0x1c36,0x216d,0xcf0),_0x4b485e[_0x313705(0x1fe5,0x28e7,0x257b,0x19b0)])){const _0xa41491={};_0xa41491[_0x23937d(0x17d9,0x1786,0x2312,0x1a6b)]=_0x313705(0x19fa,0x1a05,0x16cf,0x103c),_0xa41491['rowId']=_0x313705(0x1f69,0x19f0,0x1ce1,0x1fb4)+_0x23937d(0xce4,0x1267,0x1219,0x1b04)+'o',_0xa41491[_0x23937d(0x13c8,0xd05,0x1657,0x12ea)+'n']='Tap\x20to\x20cha'+_0x23937d(0x8ab,0xeb2,0x11e0,0x47)+_0x313705(0x579,-0x20e,0x3f7,0x700)+_0x313705(0x38c,0x116,-0x13b,0xc1f);const _0x6009ab={};_0x6009ab[_0x23937d(0x17d9,0x8d9,0x1ea4,0xde4)]=_0x23937d(0x1cf3,0x1394,0x1c90,0x1f77)+'enu',_0x6009ab[_0x23937d(0x53b,0xdce,-0x3aa,0x2e5)]=_0x313705(0x1f69,0x216e,0x20bb,0x14a1)+_0x313705(0x104c,0x825,0xbde,0x12a0)+_0x23937d(0xd79,0x1363,0x122b,0x1009),_0x6009ab[_0x313705(0x172e,0x17e2,0x1c07,0x1dd4)+'n']=_0x23937d(0xf24,0xbd8,0x305,0x17c0)+'nge\x20bot\x20me'+_0x313705(0x14a2,0x1819,0xe6e,0x1547)+_0x23937d(0x153e,0x2295,0xcf2,0x1b10);const _0x3d08a1={};_0x3d08a1[_0x23937d(0x17d9,0x1df1,0x1ec5,0x1574)]=_0x4b485e[_0x313705(0xc22,0xc87,0x522,0xa51)],_0x3d08a1['rows']=[{'title':_0x4b485e[_0x23937d(0x288,0x9f1,-0x3c,0x1157)],'rowId':'setmenu\x20te'+'mplateImag'+'e','description':_0x23937d(0xf24,0x1e5,0x138e,0x809)+_0x313705(0xc11,0xcb0,0x409,0x631)+_0x313705(0x1a27,0x1871,0x1b3b,0x1596)+_0x313705(0x824,0x12e6,0x1052,0x15f1)},{'title':_0x4b485e['hClyd'],'rowId':_0x23937d(0x1c03,0x2aa5,0x124c,0x1321)+'mplateGif','description':'Tap\x20to\x20cha'+_0x23937d(0x8ab,-0xa8,0x16f9,0x1480)+_0x313705(0x9fb,0xb7f,0xe36,0x535)+_0x313705(0x190e,0xeea,0x234d,0x2459)},_0xa41491,_0x6009ab];let _0x30107d=[_0x3d08a1];_0x175756['sendListMs'+'g'](_0x5cd288[_0x313705(0x14f2,0x20de,0xb6e,0x131e)],_0x23937d(0xf50,0x14b4,0xe07,0x119d)+_0x23937d(0x200,0x805,-0x413,0xe09)+_0x313705(0x90c,0xf6c,0x12f1,0x9fb)+_0x23937d(0x1652,0x110e,0x17d9,0x106b)+'e!','\x20',_0x175756[_0x313705(0x787,0x15a4,0x110c,0x35a)]['name'],_0x23937d(0xb7,-0x269,0xad7,0xd49),_0x30107d,_0x5cd288);}else _0x522c6a[_0x23937d(0x9e5,0x9cd,0x15a6,0x1288)+_0x313705(0x2104,0x1e89,0x1849,0x161c)](_0x4b485e['qAkHu'],_0x56c40c[_0x313705(0x14f2,0x1a96,0x1fbe,0xb6d)]);}}}}}}break;case _0x4b485e['oXvAV']:{if(_0x1bac1f)return _0x4b485e[_0x313705(0x11f9,0x1ff9,0x172e,0x12d4)](_0x1db05d,mess[_0x23937d(0x61c,0xd06,-0x1ff,-0x38c)]);if(_0x1e03f5)return _0x4b485e['OrZPP'](_0x1db05d,mess[_0x23937d(0x5c0,0x234,0xede,-0x6c2)]);if(!_0x1ba32f['join']('\x20'))return _0x4b485e[_0x23937d(0x1c34,0xf09,0x2054,0x24c9)](_0x516d85,_0x23937d(0xda5,0xac9,0x293,0x1b60)+_0x4b485e[_0x23937d(0x11d1,0xe1d,0xacc,0xba9)](_0xe1d953,_0x1354e9)+(_0x313705(0xa18,0x1161,-0x44e,0x1139)+'\x20please\x20ad'+_0x23937d(0xd8b,0x2e0,0xfe,0x190a)+_0x23937d(0x16a0,0x1934,0x2219,0x92f)+'re'));teks=_0x23937d(0x1877,0x1499,0x227a,0x1978)+_0x313705(0xd25,0xde6,0x2b3,0x1116),teks1='\x0a\x0aNumber\x20:'+'\x20@'+_0x5cd288[_0x23937d(0x14ce,0x22f2,0x2253,0xd9b)][_0x23937d(0xccf,0x1ac2,0x3d5,0x48d)]('@')[0x1f89+0x2*-0x7a7+0x3*-0x569]+(_0x23937d(0xdf9,0x1641,0x109a,0x1311)+'\x20')+_0x1ba32f[_0x313705(0x1f7c,0x2355,0x2e65,0x2767)]('\x20'),teks2=_0x23937d(0x16ea,0x20cf,0x13c9,0xee2)+'ully\x20sent\x20'+_0x23937d(0xba2,0xb4,0x472,0x1851);for(let _0xbcda57 of owner){const _0x233dc6={};_0x233dc6['text']=teks+teks1,_0x233dc6[_0x23937d(0x1968,0x1b9f,0xebb,0x153f)]=[_0x5cd288[_0x313705(0x1834,0x1528,0xa96,0x13e3)]];const _0xe84773={};_0xe84773[_0x23937d(0x5dc,0xcf5,0xd49,0xe2d)]=_0x5cd288,_0x175756[_0x313705(0xcaa,0x13e6,0x15e9,0x1aca)+'e'](_0xbcda57+_0x4b485e[_0x23937d(0x1d8c,0x29ab,0x2086,0x176f)],_0x233dc6,_0xe84773);}_0x175756['sendMessag'+'e'](_0x5cd288['chat'],{'text':_0x4b485e['UqomV'](_0x4b485e[_0x23937d(0x372,-0x105,-0xa6a,-0x892)](teks,teks2),teks1),'mentions':[_0x5cd288[_0x23937d(0x14ce,0x212b,0x1a30,0x6db)]]},{'quoted':_0x5cd288});}break;case _0x313705(0x197b,0x1a61,0x1795,0x25ae):case _0x23937d(0x149a,0x1e3e,0x21e4,0xdc0):{const _0x29c3cd=_0x4b485e[_0x23937d(0x131,-0x930,0x539,-0xed)][_0x23937d(0xccf,0x1ae,0x6cf,-0x1dc)]('|');let _0x259199=0x661*-0x4+0x9e2+0x2*0x7d1;while(!![]){switch(_0x29c3cd[_0x259199++]){case'0':if(_0x1e03f5)return _0x1db05d(mess[_0x313705(0x926,0xdd6,0x16cf,0x1846)]);continue;case'1':if(!_0x494254)return _0x4b485e['rZKBl'](_0x1db05d,_0x23937d(0x28e,-0x1b0,0xe75,0xb28)+_0x313705(0x1e3b,0x2d15,0x1185,0x1110)+_0x313705(0x1bd2,0x1286,0x20ea,0x24b5)+_0x1354e9+(_0x313705(0x149d,0x1857,0x1bf3,0xd86)+'r'));continue;case'2':_0x175756['sendMessag'+'e'](owner+('@s.whatsap'+_0x23937d(0x1c1f,0x2001,0x231e,0x1de8)),{'text':'*Bug\x20Repor'+_0x313705(0x1a9f,0xeae,0x18ba,0xf5c)+_0x313705(0x1bc6,0x1e01,0xebc,0x2ad0)+_0x5cd288['sender']['split']('@')[0xe05+-0x4*0x130+0x71*-0x15]+(_0x313705(0x68b,-0x3e4,0x539,0x136d)+'ssage:\x20')+_0x494254});continue;case'3':_0x1db05d(_0x313705(0x17d7,0x162b,0x95a,0x1eef)+_0x23937d(0x13d0,0xf93,0x178c,0x21a2)+_0x23937d(0xb31,0x11de,0x23b,0x14e9)+'wner\x0a\x0aPlea'+'se\x20Make\x20Su'+_0x23937d(0xf3e,0x194,0x1041,0x317)+_0x313705(0x521,0x10bd,-0x930,-0x422)+_0x313705(0x1322,0x1d4b,0xdc9,0x16e4)+'ay\x20With\x20Th'+'is,\x20Use\x20Th'+_0x313705(0x2070,0x139d,0x193e,0x2c05)+'\x20Again\x20And'+_0x313705(0x3ed,-0x7cb,0xf55,0xd61)+_0x313705(0xad3,0x11a9,0x1521,0x15b0)+_0x313705(0x1d3a,0x241b,0x19d1,0x1e4d)+'\x20Be\x20Blocke'+_0x313705(0x13b0,0x1c73,0xb6f,0x13f8)+'\x20!');continue;case'4':if(_0x1bac1f)return _0x4b485e[_0x23937d(0x1254,0xc5a,0x8a2,0x14a4)](_0x1db05d,mess['ban']);continue;}break;}}break;case'sc':case _0x4b485e[_0x23937d(0x1941,0x2157,0x11a4,0x1abd)]:case _0x23937d(0x14ef,0x1cb2,0x12c3,0x1b21):case _0x4b485e[_0x23937d(0x1104,0x1657,0xd69,0x1fc7)]:case _0x4b485e['KJugt']:case _0x4b485e[_0x313705(0x7c6,0x1468,-0x190,0x884)]:case _0x4b485e[_0x313705(0x6bf,0x12e3,0xc39,0x78d)]:case _0x4b485e[_0x23937d(0x132e,0x18c4,0xffd,0x6bc)]:{if(_0x1bac1f)return _0x4b485e['CjJGl'](_0x1db05d,mess[_0x23937d(0x61c,0x10e6,0x28a,0x807)]);if(_0x1e03f5)return _0x4b485e[_0x313705(0x11b6,0x17d0,0x1c44,0x1611)](_0x1db05d,mess['banChat']);const _0x259358={};_0x259358[_0x23937d(0xa79,0x189b,-0x13c,0x162f)]=_0x4b485e[_0x23937d(0xc,0xa79,0x527,-0x33c)];const _0x11c687={};_0x11c687[_0x23937d(0x1c43,0x1855,0x21ff,0x2ab5)]=_0x259358,_0x11c687['caption']=_0x23937d(0x173d,0x228a,0xeaf,0xe3f)+_0xa43395+_0x23937d(0xd09,0x1049,0x1821,0x18c)+global[_0x23937d(0x96c,-0x3d4,0x128b,0xdaf)]+('\x0aDeplyed\x20B'+'y:\x20')+global['ownername']+(_0x313705(0x1b89,0x1587,0x177e,0x19d0)+_0x313705(0x1706,0x2565,0x194d,0x232e)+_0x23937d(0x195,0xd8f,0xa61,-0xcca)+_0x313705(0xbfe,0x13cc,0x833,0xa1b)),_0x175756[_0x23937d(0x944,0x20e,-0x2f2,0x1301)+'e'](_0x5cd288[_0x313705(0x14f2,0xdc0,0xf14,0xb72)],_0x11c687,{'quoted':_0x5cd288});}break;case _0x4b485e[_0x313705(0x112d,0x1f5e,0x1b28,0x156e)]:{if(_0x4b485e[_0x313705(0x16fb,0x1a83,0x16fc,0x1198)](_0x4b485e[_0x23937d(0xdf4,0xdf4,0x654,0x1686)],_0x4b485e[_0x23937d(0xdf4,0x1328,0x591,0x6ae)])){const _0xb0a51e={};_0xb0a51e[_0x313705(0x175a,0x157a,0x1da1,0x252e)+'t']=_0x313705(0x1ac1,0x156b,0x1cba,0x28e4)+_0x22fa69++;const _0x3343d5={};_0x3343d5[_0x313705(0x1e72,0x1bc9,0x1ab3,0x1072)]='ig\x20'+_0x2d09cb[_0x23937d(0x738,-0x679,0x8fb,0x15af)]+'\x20'+_0x148a2a['url'],_0x3343d5[_0x313705(0x1902,0xa12,0x1db9,0x1d40)]=_0xb0a51e,_0x3343d5[_0x313705(0xa9e,0x72,0x130,0x152e)]=0x1,_0x3d4b2b[_0x313705(0x1122,0x15cc,0x496,0xed5)](_0x3343d5);}else{if(!_0x494254)return _0x4b485e[_0x23937d(0x60b,0x928,0x1172,0x1253)](_0x1db05d,_0x4b485e[_0x313705(0xac8,0xd9a,0x222,0x55e)]);if(_0x24aa58){global[_0x23937d(0x96c,-0x214,0x1711,-0xe7)]=_0x494254;const _0x166e32={};_0x166e32[_0x313705(0xddf,0xb5d,0x12d1,0x26d)]=_0x313705(0xc7d,0x15af,0xdb4,0x1195)+_0x313705(0x169a,0x1ded,0xa82,0x1793)+'Mmdx/20220'+'806-115940'+'.jpg';const _0x2768a5={};_0x2768a5[_0x313705(0x1fa9,0x2ab5,0x2341,0x2c17)]=_0x166e32,_0x2768a5[_0x313705(0xcce,0x15b4,0x12ad,0x14e7)]=_0x313705(0x1c72,0x160f,0x1ced,0x126a)+'\x20Name\x20Succ'+_0x313705(0x12f3,0x14b1,0x1d04,0x956)+_0x313705(0x1d78,0x2388,0x181b,0x2b72)+'\x20\x20'+global['botname']+('\x0a\x0a[\x20◉\x20ʀᴇᴅ-'+_0x23937d(0xb69,0x9ce,-0x2a3,0x308)+']'),_0x175756[_0x23937d(0x944,-0x44d,-0xc0,0x432)+'e'](_0x5cd288[_0x23937d(0x118c,0xcf8,0x53d,0x1269)],_0x2768a5,{'quoted':_0x5cd288});}}}break;case _0x4b485e[_0x23937d(0x1699,0x189e,0xdf1,0x1958)]:{if(_0x4b485e[_0x23937d(0x15d0,0xb69,0x244f,0x17f2)](_0x4b485e[_0x313705(0x78e,0x3dc,0x69f,0x15c5)],_0x4b485e[_0x313705(0x682,-0x790,0x446,-0x873)]))return _0x4b485e[_0x23937d(0x705,0x3ab,0x52a,0xaac)];else{if(!_0x494254)return _0x4b485e[_0x23937d(0xeb7,0x1336,0x6d1,0x83b)](_0x1db05d,_0x313705(0x1c93,0xed3,0x1bc4,0x17e2)+_0x313705(0x182e,0xc7e,0x1528,0xbac)+_0x23937d(0xc8d,-0x41,0xf33,0x69a));if(_0x24aa58){if(_0x4b485e[_0x313705(0x1763,0x2636,0x8c3,0x16ea)]!=='BzwuB'){let _0x5003e2=_0x182d4a=>typeof _0x182d4a===_0x313705(0x1a7b,0x1823,0xfc6,0x17fc)&&!_0x220ffa(_0x182d4a),_0x5d0085=_0x3fdfff?_0x37454f[_0x313705(0x97a,-0x356,-0x49d,0xd2a)][_0x23937d(0x569,0xff1,-0x939,0x859)]:_0x15d01a['limitawal'][_0x23937d(0x3d6,0xc6a,0xbf4,0xbd)],_0xc17b59=_0x59478e['db'][_0x313705(0x117d,0x1cf8,0xb50,0xb9f)][_0x23937d(0x1816,0x1ae5,0x1e82,0x1b32)][_0x263995[_0x23937d(0x14ce,0x1ca2,0x1f8d,0x20c3)]];if(_0x4b485e[_0x313705(0x1042,0x14f5,0xb39,0x1c4a)](typeof _0xc17b59,_0x4b485e[_0x313705(0x13f7,0x1f6f,0x94d,0x1ea6)]))_0xd9a7cc['db'][_0x23937d(0xe17,0xd36,0xb4c,-0xa6)][_0x23937d(0x1816,0x1989,0xf89,0xb30)][_0x38d433[_0x313705(0x1834,0x11d5,0x23dc,0x1541)]]={};if(_0xc17b59){if(!_0x4b485e['DsAYx'](_0x5003e2,_0xc17b59['afkTime']))_0xc17b59[_0x23937d(0x204,0xe86,0x10d7,-0x995)]=-(0x1aa6+0x1784*-0x1+-0x321*0x1);if(!_0x4b485e[_0x313705(0x1aad,0x15d6,0x10d2,0xb9b)](_0x4b485e[_0x23937d(0x1053,0x266,0x4cb,0x1263)],_0xc17b59))_0xc17b59[_0x23937d(0xe3e,0xd68,0x1330,0x59c)]='';if(!_0x4b485e[_0x313705(0x1e39,0x12b3,0x14ef,0x2c49)](_0x5003e2,_0xc17b59[_0x23937d(0x44f,0x1305,0x900,0xd39)]))_0xc17b59['limit']=_0x5d0085;}else _0x2ed03f['db'][_0x313705(0x117d,0x1883,0x93a,0x102a)][_0x23937d(0x1816,0x1b56,0x98e,0x1b27)][_0x4242e5[_0x313705(0x1834,0xf6d,0x2167,0x1895)]]={'afkTime':-(-0x1*0x1051+-0x5*-0x57e+-0x2c9*0x4),'afkReason':'','limit':_0x5d0085};let _0x25b2fc=_0xbd6ff4['db'][_0x313705(0x117d,0xba6,0xa26,0x1646)][_0x23937d(0x252,0x40b,-0x2e3,-0x844)][_0xc404fc['chat']];if(_0x4b485e[_0x23937d(0x945,-0x5c,0xab2,0xe1b)](typeof _0x25b2fc,_0x4b485e[_0x313705(0x13f7,0x8ca,0x1424,0x11e0)]))_0x440af5['db'][_0x23937d(0xe17,0xd98,0x8f8,0xe51)][_0x23937d(0x252,0x6d,-0xb64,0x8b)][_0x4fd6e1[_0x313705(0x14f2,0x60e,0x1a6d,0x2237)]]={};const _0x59c969={};_0x59c969[_0x313705(0x14d8,0x219d,0x11f4,0x8d4)]=![];if(_0x25b2fc){if(!_0x4b485e['JhajQ'](_0x4b485e[_0x313705(0x1978,0x186c,0x1829,0xcbb)],_0x25b2fc))_0x25b2fc[_0x23937d(0x1172,0xdc9,0x1b50,0x19de)]=![];}else _0x1a27aa['db'][_0x313705(0x117d,0x317,0x1971,0xc04)][_0x313705(0x5b8,0xc9c,-0xfe,0x133e)][_0x526733['chat']]=_0x59c969;let _0x4a395b=_0x3a0bb6['db'][_0x313705(0x117d,0x1a57,0xbea,0x2ef)][_0x23937d(0x5b2,0x24c,-0x3b2,0x5e6)][_0xdcbf12];if(_0x4b485e['rmEDf'](typeof _0x4a395b,_0x4b485e['EfeuT']))_0x5a321b['db'][_0x23937d(0xe17,0x1803,0x1194,0x1a29)]['settings'][_0x416eb7]={};const _0x48d740={};_0x48d740['status']=0x0,_0x48d740[_0x313705(0x1bbc,0x1fe8,0x27f8,0x2845)]=![],_0x48d740[_0x313705(0xdba,0x118b,0xac4,0x10e2)+'age']=![],_0x48d740['templateVi'+_0x23937d(0x22c,0x878,-0x6dd,-0x6fe)]=![],_0x48d740[_0x313705(0x348,-0x3e1,0x2f8,0xa35)+'f']=![],_0x48d740[_0x313705(0x1cd8,0x203d,0x15a4,0x2829)+'g']=![],_0x48d740[_0x313705(0xd6d,0x1246,0x19e9,0x5aa)+'cument']=!![];if(_0x4a395b){const _0x3887e2=_0x4b485e[_0x23937d(0x1625,0x1434,0x751,0x2243)][_0x313705(0x1035,0x165b,0x1716,0x896)]('|');let _0x123642=0x2*0x5d0+0xe48*-0x1+0x2a8;while(!![]){switch(_0x3887e2[_0x123642++]){case'0':if(!_0x5003e2(_0x4a395b[_0x23937d(0x3eb,0xde1,0x10d7,0xf20)]))_0x4a395b['status']=0xb7*-0x1+0x600+-0x21*0x29;continue;case'1':if(!_0x4b485e[_0x23937d(0x1b7e,0xdb5,0x2953,0x1266)](_0x4b485e[_0x23937d(0x1900,0x2648,0x25c4,0x23ba)],_0x4a395b))_0x4a395b[_0x313705(0x1cd8,0x28f4,0x27fa,0x27e2)+'g']=![];continue;case'2':if(!_0x4b485e[_0x313705(0x5f7,0xa28,0x131d,0x16f)](_0x4b485e['lMrHx'],_0x4a395b))_0x4a395b['templateGi'+'f']=![];continue;case'3':if(!_0x4b485e[_0x313705(0xacf,0x19c2,0xb,0x7ba)](_0x4b485e['okiBK'],_0x4a395b))_0x4a395b[_0x313705(0x1bbc,0x20c4,0x2707,0x24d2)]=![];continue;case'4':if(!_0x4b485e[_0x313705(0xacf,0x1ba,0x1315,-0x3e2)](_0x4b485e[_0x313705(0x49f,0x3aa,0x974,-0x220)],_0x4a395b))_0x4a395b['templateIm'+'age']=![];continue;case'5':if(!_0x4b485e[_0x23937d(0x5d6,-0x3bf,0x5,0x925)]('templateDo'+_0x23937d(0x15d5,0xa32,0x2217,0x2361),_0x4a395b))_0x4a395b['templateDo'+_0x313705(0x193b,0x1d13,0x17c7,0x22b3)]=!![];continue;case'6':if(!_0x4b485e[_0x313705(0x153a,0x21ff,0x1fb7,0x20a2)](_0x4b485e['XcTcz'],_0x4a395b))_0x4a395b[_0x23937d(0x1318,0xad8,0x1de7,0xa52)+_0x313705(0x592,-0x210,0x2a9,0x10b7)]=![];continue;}break;}}else _0xb5edf9['db']['data'][_0x23937d(0x5b2,-0x30f,0xdfb,-0x6fb)][_0x233e83]=_0x48d740;}else{global[_0x313705(0x203b,0x279f,0x248a,0x2770)]=_0x494254;const _0x18906b={};_0x18906b[_0x23937d(0xa79,0xdab,0x10a5,0x816)]=_0x313705(0xc7d,0xdb5,0x19c5,0x61b)+_0x313705(0x169a,0x21e5,0xc14,0x989)+'Mmdx/20220'+'806-115940'+'.jpg';const _0x59ada7={};_0x59ada7[_0x23937d(0x1c43,0x1a7e,0x2316,0xed5)]=_0x18906b,_0x59ada7[_0x313705(0xcce,0x1001,0x969,0xff3)]='````⚙️🔄\x20Own'+_0x23937d(0x1065,0x1ca1,0x13e1,0x1b8a)+_0x23937d(0x1471,0x178e,0x1a8b,0x2128)+_0x23937d(0x1313,0x1939,0x1b13,0xf43)+_0x313705(0x4e8,0x380,0x135,0xbf5)+global[_0x313705(0x203b,0x150a,0x1da1,0x2a16)]+('\x0a\x0a[\x20◉\x20ʀᴇᴅ-'+'ᴅʀᴀɢᴏɴ-ᴍᴅ\x20'+']'),_0x175756[_0x313705(0xcaa,0x616,0x8af,0x538)+'e'](_0x5cd288[_0x23937d(0x118c,0x161f,0xded,0x18ea)],_0x59ada7,{'quoted':_0x5cd288});}}}}break;case _0x4b485e['ZfodA']:{if(_0x4b485e[_0x23937d(0xcff,-0x198,-0x66,0xa4f)](_0x23937d(0x1063,0x1212,0x1df,0x932),_0x4b485e[_0x313705(0x1cc0,0x12b5,0x13e8,0x20fa)]))_0x4b485e['CBNJo'](_0x35c1dd,_0x506df2[_0x313705(0x2116,0x1b37,0x1baf,0x24f6)]);else{if(!_0x494254)return _0x4b485e[_0x23937d(0xa43,0x73b,0x689,0x1314)](_0x1db05d,_0x4b485e[_0x23937d(0x441,0x1113,0xcc5,-0xfa)]);if(_0x24aa58){if(_0x4b485e[_0x313705(0x409,0x1247,0x46f,-0x3e3)](_0x4b485e[_0x313705(0x1676,0xfc1,0x1887,0x2510)],_0x4b485e[_0x23937d(0xc45,0x211,-0x266,0xfb5)])){global[_0x23937d(0xa3e,0x155,0x3da,0xaf8)]=_0x494254;const _0x3075a0={};_0x3075a0[_0x23937d(0xa79,0x15f4,0x10d7,0x459)]=''+global[_0x313705(0xda4,0x1167,0x193d,0x18a6)];const _0x285385={};_0x285385[_0x23937d(0x1c43,0x2099,0x1a48,0x118b)]=_0x3075a0,_0x285385['caption']=_0x4b485e[_0x313705(0x14be,0x1ea3,0x23b9,0xf7a)],_0x175756[_0x23937d(0x944,-0x479,0x1793,-0x527)+'e'](_0x5cd288[_0x23937d(0x118c,0x1052,0x13e8,0x627)],_0x285385,{'quoted':_0x5cd288});}else{const _0x7f8f77={};_0x7f8f77[_0x23937d(0x1d39,0x18e3,0x2593,0x2c4d)]=''+_0x3e20e1[_0x23937d(0x5d7,0x663,0x11f3,0x10f7)];const _0x22a9f6={};_0x22a9f6[_0x313705(0x942,0xd0,0x1314,0xc2e)]=_0x577a3b,_0x4be200['sendMessag'+'e'](_0x3f05a6[_0x313705(0x14f2,0x84a,0x1bbf,0x22ae)],_0x7f8f77,_0x22a9f6),_0x388f9f=_0x234b07[_0x23937d(0x13bd,0x2151,0x2233,0x146f)+'nc'](_0x23937d(0xb1b,-0x2eb,0xe06,0x252)+_0x23937d(0x1613,0xecd,0x146d,0x16b0)+'icker/gm.w'+_0x313705(0x619,-0x8ec,-0x40f,0x11ac));const _0x5035d2={};_0x5035d2['sticker']=_0x5106fc,_0x39375d['sendMessag'+'e'](_0x468a5a['chat'],_0x5035d2);}}else{if(_0x4b485e['AziYs'](_0x23937d(0x18b6,0x1220,0x26a9,0x2754),_0x4b485e[_0x313705(0x1719,0x1a0d,0x102c,0xd4c)])){const _0x189a71={};_0x189a71[_0x23937d(0x1d39,0x191d,0x25d4,0x1235)]=''+_0x406946[_0x313705(0x1c46,0x1b84,0x2146,0x13b3)];const _0x40bf4a={};_0x40bf4a[_0x313705(0x942,-0x63,0x17ec,0x1129)]=_0x158f42,_0x44786b['sendMessag'+'e'](_0x2740a2['chat'],_0x189a71,_0x40bf4a);}else{if(_0x17ccaf){global['alivepic']=_0x494254;const _0x5ee5a3={};_0x5ee5a3['url']=''+global[_0x23937d(0xa3e,0x1011,-0x289,0x7a1)];const _0xeedd1a={};_0xeedd1a[_0x313705(0x1fa9,0x1e85,0x2c87,0x12f7)]=_0x5ee5a3,_0xeedd1a[_0x313705(0xcce,0x1355,0x6da,0x1758)]=_0x4b485e[_0x313705(0x14be,0x1076,0xec1,0x1768)],_0x175756[_0x23937d(0x944,0x885,-0x4ab,0xb15)+'e'](_0x5cd288['chat'],_0xeedd1a,{'quoted':_0x5cd288});}else return _0x4b485e[_0x23937d(0xd4f,0x142e,-0x2f,0x1679)](_0x516d85,''+mess[_0x23937d(0xc84,0x14a0,0x967,0xf81)]);}}}}break;case _0x313705(0x1581,0xa47,0x2472,0x1432):{if(!_0x494254)return _0x1db05d(_0x4b485e[_0x23937d(0x99b,0x9f2,-0x487,0x2da)]);if(_0x24aa58)global[_0x23937d(0x121b,0x152d,0xf30,0x1fa2)]=_0x494254,_0x175756['sendMessag'+'e'](_0x5cd288[_0x313705(0x14f2,0x9fd,0x1afe,0xcca)],{'image':{'url':_0x4b485e[_0x313705(0x17c7,0x23be,0x21a8,0x1eab)](_0x382fc5,_0x4b485e['ODuYE'])},'caption':_0x23937d(0x3fe,0x3a6,0xb3,0x829)+_0x313705(0x1883,0xfc7,0x16b5,0x1dce)+_0x313705(0x17d7,0x1cef,0x15a4,0x25c1)+_0x23937d(0x1313,0x219a,0x161a,0x12d0)+_0x313705(0x1b07,0x232d,0x1d3b,0x1086)+'ʀᴇᴅ-ᴅʀᴀɢᴏɴ'+'-ᴍᴅ\x20]'},{'quoted':_0x5cd288});else{if(_0x4b485e[_0x313705(0xf56,0x1b18,0x19a5,0x1778)](_0x4b485e['rNtxr'],_0x4b485e['rNtxr'])){if(_0x17ccaf){if(_0x4b485e[_0x313705(0x1372,0x14e3,0x13f5,0x1c4c)](_0x23937d(0x1950,0x1ae4,0x1126,0x1cc1),_0x4b485e[_0x313705(0x16e5,0x2432,0x259e,0xbcb)])){if(_0x4b485e['WvNYt'](_0x178453,_0xb3e687)){_0xb2cd44=_0x4a8009[_0x313705(0x1723,0xbc2,0x257e,0x1c0a)+'nc'](_0x23937d(0xb1b,0x2a7,-0x269,0xf93)+'AllData/au'+_0x23937d(0x9e7,0xc8c,0xdb4,0x101)+_0x3f1126+_0x313705(0x8f5,0x15f6,-0x512,0xd48));const _0x3400ca={};_0x3400ca['audio']=_0x4261df,_0x3400ca[_0x313705(0x1610,0x1490,0x2435,0x1539)]=_0x4b485e['JkqmH'],_0x3400ca['ptt']=!![];const _0x130298={};_0x130298[_0x313705(0x942,-0x4d0,-0x199,0xc78)]=_0x2f95b3,_0x27d00c[_0x313705(0xcaa,0x9a1,0x605,0x11a4)+'e'](_0xa0324c[_0x23937d(0x118c,0x872,0x710,0x8a6)],_0x3400ca,_0x130298);}}else{global[_0x313705(0x1581,0x16c6,0x2364,0x7f4)]=_0x494254;const _0x4dea4e={};_0x4dea4e[_0x23937d(0xa79,-0x197,-0x333,0x1798)]=_0x382fc5+_0x4b485e[_0x23937d(0xbdf,0x106f,0x346,0x7a1)];const _0x5491ef={};_0x5491ef[_0x23937d(0x1c43,0x10fe,0x1da9,0x26a1)]=_0x4dea4e,_0x5491ef['caption']=_0x4b485e[_0x23937d(0xa38,0xf6b,0x15e0,0x73e)],_0x175756[_0x313705(0xcaa,0x121c,0x33d,0x1644)+'e'](_0x5cd288['chat'],_0x5491ef,{'quoted':_0x5cd288});}}else return _0x516d85(''+mess[_0x313705(0xfea,0xce5,0x73b,0xb7b)]);}else{if(!_0x5efc4e)return _0x4b485e['XvAqi'](_0x3af14c,''+_0x2a76c8[_0x23937d(0xc84,0x119c,0xbba,0x102f)]);if(_0x4b485e[_0x313705(0x1efe,0x2938,0x1149,0x2db5)](_0x72bcf9[-0x2b0+0x264f+-0x239f],'on')){if(_0x4b485e[_0x313705(0x786,0x1382,0xc11,0xa9d)](_0x15c09c[_0x313705(0x1c49,0x1888,0x16f5,0x1756)+'e'],_0x23937d(0x150,0x7aa,0x49e,-0xd21)))return _0x4b485e[_0x313705(0x1046,0xfc1,0x49c,0x1c40)](_0x5b97a2,'Activated');_0x568e86['upsongvoic'+'e']=_0x4b485e['ndZFX'],_0x158f46(_0x9c55cb[_0x23937d(0x96c,0x1204,-0x528,0x132c)]+(_0x23937d(0xefe,0x16e2,0x10ca,0x1723)+_0x23937d(0x3ec,-0x19f,0xe89,-0x8c9)+_0x313705(0x11d9,0xd98,0x3a7,0xe0a)+_0x313705(0x11bf,0x195d,0x8d9,0x157c)));}else{if(_0x4b485e[_0x23937d(0x187b,0x123f,0x982,0xd99)](_0x3eaf66[-0x1faf+-0xa88+0x2a37],_0x313705(0xdea,0xa6e,0x12cd,0x1082))){if(_0x4b485e[_0x23937d(0x14b7,0x16cf,0x20fa,0xdc8)](_0x13eee3[_0x313705(0x1c49,0x1157,0x1184,0x101b)+'e'],_0x4b485e[_0x23937d(0x1910,0x2346,0xb7c,0x2005)]))return _0x4b485e['AoqmV'](_0x860b82,_0x313705(0xf18,0x35b,0x170a,0x847)+'d');_0x18bd15[_0x23937d(0x18e3,0x2158,0xb86,0x1adf)+'e']=_0x4b485e[_0x313705(0x1c76,0x24a4,0xd7c,0x15f9)],_0x4b485e[_0x23937d(0x1133,0x1009,0x13c3,0x5ab)](_0x494053,_0x5cf3e0[_0x23937d(0x96c,0xc51,0xf03,-0x38f)]+('\x20Upload\x20so'+_0x313705(0xa74,0x8e,0x7f5,0x184f)+_0x23937d(0x6be,-0x730,0x761,-0x2fe)+_0x23937d(0x16fc,0x2531,0x1c28,0x1db9)+'!❎'));}else{}}}}}break;case _0x23937d(0x497,0xd8,0x416,0x12ec):{if(_0x4b485e[_0x23937d(0x18fa,0x280f,0x211a,0x265c)](_0x4b485e[_0x313705(0xf96,0x1691,0x8e2,0x1660)],_0x4b485e[_0x313705(0xf96,0x17a4,0xfa9,0xc27)])){if(!_0x24aa58)return _0x4b485e['uavLE'](_0x1db05d,''+mess['owner']);if(_0x4b485e[_0x313705(0x76a,0xc95,0x14d2,0x1c6)](_0x1ba32f[0x7d1+0xadc+-0x1*0x12ad],'on')){if(_0x4b485e[_0x313705(0xeac,0x13c,0x742,0xa69)](_0x4b485e[_0x23937d(0x1160,0x695,0x1f03,0x1bef)],_0x4b485e['kuHRL'])){if(_0x4b485e[_0x23937d(0x199,0xe35,0xca1,0xae2)](global[_0x313705(0x1c49,0x196f,0x189b,0x24cd)+'e'],_0x4b485e[_0x313705(0x59d,-0x2fc,0xbbd,-0x737)]))return _0x4b485e[_0x23937d(0x4b,0x265,0x8e5,0xac8)](_0x1db05d,_0x23937d(0xc17,0x54e,-0x25a,0x188b));global[_0x313705(0x1c49,0x11ed,0xe5c,0xfaa)+'e']=_0x4b485e[_0x23937d(0x237,0x7f,-0x6da,0xcb)],_0x4b485e[_0x23937d(0x15a2,0x1c35,0x204b,0x1b6c)](_0x1db05d,global[_0x313705(0xcd2,0xeba,0xc73,0x393)]+(_0x313705(0x1264,0x4ac,0x1db9,0xa70)+_0x313705(0x752,0xce4,0x12a0,0x1279)+_0x23937d(0xe73,0xe38,0x1415,0xe1d)+_0x313705(0x11bf,0xf64,0xf4f,0x1507)));}else _0x27a066=_0x4c1f96[_0x313705(0x942,-0x2fd,0x721,0x4b2)][_0x313705(0x1834,0x2590,0x24a2,0xfac)];}else{if(_0x1ba32f[-0x6bb*-0x1+0x464*0x2+-0xf83]===_0x4b485e['hbAtH']){if(_0x4b485e[_0x23937d(0x111,-0x75,0xa36,-0xb03)](global[_0x313705(0x1c49,0x1068,0x28be,0x2049)+'e'],_0x4b485e[_0x23937d(0x1910,0x1368,0x1be7,0x2467)]))return _0x4b485e[_0x313705(0x164d,0x2425,0x1e6e,0x118b)](_0x1db05d,_0x313705(0xf18,0x117d,0xd72,0x324)+'d');global[_0x23937d(0x18e3,0xe9d,0xc46,0x129b)+'e']=_0x4b485e[_0x313705(0x1c76,0x106f,0x2ae9,0x191d)],_0x4b485e['xkfGP'](_0x1db05d,global[_0x313705(0xcd2,0x2e7,0x7dc,0x18d1)]+('\x20Upload\x20so'+_0x23937d(0x70e,0x3f,0x14f4,-0x3ec)+_0x23937d(0x6be,-0x4b2,-0x519,0x1359)+'\x20disabled\x20'+'!❎'));}else{}}}else{const _0x499992={};_0x499992[_0x23937d(0x1d39,0x1a4a,0x2336,0x125c)]='🔄',_0x499992['key']=_0x4a1427[_0x313705(0xcb5,0x1559,0x18bd,0xb24)];const _0x2f5510={};_0x2f5510[_0x313705(0x1d20,0x1201,0x2994,0x1da5)]=_0x499992,_0x41188c[_0x23937d(0x944,0x76e,0x1175,0x3e9)+'e'](_0x9d1d22,_0x2f5510);const _0x4de80b={};_0x4de80b[_0x313705(0x175a,0xb40,0x24b2,0x1dce)+'t']=_0x4b485e[_0x313705(0x8c9,0x1757,0x544,0x9cd)];const _0x12385a={};_0x12385a['buttonId']=_0x367e35+'allmenu',_0x12385a[_0x23937d(0x159c,0x9e9,0xbc9,0x2172)]=_0x4de80b,_0x12385a[_0x313705(0xa9e,0x10b3,-0x10,0x84f)]=0x1;const _0x1ce698={};_0x1ce698[_0x23937d(0x13f4,0xd34,0x1608,0x2283)+'t']=_0x313705(0x1d04,0x18d2,0x1ea3,0x2b03);const _0x1604e0={};_0x1604e0[_0x313705(0x1e72,0x16d9,0x1977,0x197f)]=_0x37c642+'alive',_0x1604e0[_0x313705(0x1902,0x26bc,0x22f5,0x1bf5)]=_0x1ce698,_0x1604e0[_0x23937d(0x738,0x20c,0x15e0,-0x5c1)]=0x1;let _0x48e3d6=[_0x12385a,_0x1604e0];const _0x1ecaf4={};_0x1ecaf4[_0x313705(0xddf,0xdf2,0xf48,0x10e)]=_0x4b485e[_0x23937d(0x8c8,0x3ae,0xf2b,0x1533)];const _0x54c659={};_0x54c659[_0x23937d(0x1c43,0x230e,0x206a,0x219f)]=_0x1ecaf4,_0x54c659[_0x23937d(0x968,-0x9b,-0x32f,0x1d4)]=_0x23937d(0x1b0f,0x13d1,0x190d,0x2280)+_0x313705(0xf40,0x123a,0x13ae,0xf7)+_0x23937d(0xd,-0xae1,0xece,-0x355)+_0x23937d(0x22d,0xf5,0x3e4,-0x6b6)+'es\x0ahttps:/'+_0x23937d(0x39c,0xd68,-0x33,-0x7d)+_0x313705(0x8c4,0x7cc,0x409,0x1328)+_0x313705(0xb8e,0x1140,-0x304,0x1324)+_0x313705(0xf94,0x99f,0x1810,0x714)+'me',_0x54c659['footer']=_0x4b485e['aErGw'],_0x54c659['buttons']=_0x48e3d6,_0x54c659[_0x313705(0x1e7f,0x11ff,0x1bbf,0x272b)]=0x4;let _0x353abf=_0x54c659;const _0x57fe79={};_0x57fe79[_0x23937d(0x5dc,0x66b,0xe36,0x207)]=_0x2da79d,_0x344cc8[_0x23937d(0x944,0xa57,0x834,-0x5b8)+'e'](_0x3cd790[_0x313705(0x14f2,0x6a5,0x2245,0x1eb9)],_0x353abf,_0x57fe79);}}break;case _0x4b485e[_0x313705(0x493,0x130,-0x295,0x1057)]:{if(_0x4b485e[_0x23937d(0x310,0xcf7,0xe71,-0x381)](_0x4b485e['fOWrL'],_0x313705(0x1545,0x202b,0x786,0x1811))){if(_0x5cd288[_0x313705(0x2089,0x119a,0x2cc0,0x23f3)]){if(_0x17ccaf){if(_0x4b485e[_0x23937d(0xbc2,-0x200,0x1a6b,0xa0)](_0x1ba32f[-0x1*0x1ff3+-0x2700+0x46f3],'on')){if(global[_0x313705(0xbec,0x5ca,0x334,0x817)]==='true')return _0x4b485e[_0x23937d(0xd0f,0x11a8,0x399,0xc2)](_0x1db05d,'Activated');global[_0x313705(0xbec,0x18d9,0x18fe,0x481)]=_0x4b485e[_0x313705(0x59d,0xca2,-0x38b,-0x953)],_0x1db05d(global['botname']+(_0x23937d(0x19eb,0x1159,0xfdd,0x2792)+_0x23937d(0xb27,0xb2d,0xc89,0x17d9)));}else{if(_0x4b485e[_0x23937d(0x1b7,0x5d2,-0x562,0xb3a)](_0x1ba32f[0x3*-0x4b3+0x16b*0xd+-0x456],_0x4b485e[_0x313705(0x70e,0x93d,-0x7b2,0x8b0)])){if(_0x4b485e['gsFZQ'](global[_0x313705(0xbec,0xa98,0xc53,0x13ae)],_0x4b485e[_0x313705(0x1c76,0x10a3,0x1d52,0x2a34)]))return _0x4b485e[_0x313705(0x1017,0x175b,0x54f,0x19b9)](_0x1db05d,_0x313705(0xf18,0x3c7,0x1512,0x5e1)+'d');global[_0x23937d(0x886,0x12b1,0x46,0x13b6)]=_0x4b485e[_0x313705(0x1c76,0x203c,0x18a6,0x1f89)],_0x4b485e['YwLcu'](_0x1db05d,global['botname']+('\x20Anti\x20Bad\x20'+_0x313705(0x1e1f,0x26a6,0x1c50,0x1f70)+'!'));}else{}}}}}else _0x5b69db[_0x508a5a['sender'][_0x313705(0x1035,0x1b39,0x1075,0x115b)]('@')[0x20d4+-0x1979+-0x75b]]=_0x2fd0e5['jawaban'];}break;case _0x4b485e[_0x313705(0xa33,0x185b,0x1823,0x99e)]:{if(_0x5cd288['isGroup']){if(_0x17ccaf){if(_0x4b485e['nPynO'](_0x4b485e[_0x313705(0xa88,-0x38d,-0x440,0x193a)],_0x4b485e[_0x313705(0x13d9,0x223d,0x19fb,0x18d5)])){const _0x19a860={};_0x19a860[_0x23937d(0x1d39,0x28b4,0xed8,0xe6a)]=''+_0x297610[_0x23937d(0xe03,0x1722,0x197d,0xdf)];const _0x23e05b={};_0x23e05b['quoted']=_0x193bc4,_0x493654[_0x313705(0xcaa,0x9ab,0x18d8,0x7ba)+'e'](_0xac9cc0['chat'],_0x19a860,_0x23e05b);}else{if(_0x4b485e[_0x313705(0x1900,0x13ad,0x1f10,0x27a8)](_0x1ba32f[0x137b*-0x1+-0xbf*-0x23+-0x351*0x2],'on')){if(_0x4b485e[_0x23937d(0x1a87,0x1d67,0x209d,0x1dca)](global['dragonchat'],_0x4b485e[_0x313705(0x59d,0x1347,0x10c6,-0x7d9)]))return _0x4b485e[_0x23937d(0x63d,0xce4,0xf79,0xe7b)](_0x1db05d,_0x313705(0xf7d,0x1755,0x188d,0x703));global[_0x23937d(0x1acc,0x20f6,0xf63,0x19fc)]=_0x4b485e[_0x313705(0x59d,0x89c,0xd28,0xa0d)],_0x1db05d(global[_0x23937d(0x96c,-0x20f,0x1443,0x1396)]+(_0x313705(0x1211,0x1bcd,0x2026,0x936)+_0x23937d(0x1cc4,0x1016,0x1503,0x1434)));}else{if(_0x4b485e[_0x313705(0x6de,0xdf,0xdf,0xfa1)](_0x1ba32f[0x2*0x802+-0x145f+0xdf*0x5],_0x4b485e[_0x313705(0x70e,0xa1,0x263,0x1b7)])){if(_0x4b485e['JaGgR'](global[_0x23937d(0x1acc,0xc07,0x1216,0x19d3)],'false'))return _0x4b485e['uKavP'](_0x1db05d,_0x313705(0xf18,0x133a,0x344,0x1d62)+'d');global[_0x313705(0x1e32,0x1f8b,0x13dd,0x278f)]=_0x4b485e['UBZUB'],_0x4b485e[_0x313705(0x1057,0x141,0x1ee0,0x1f63)](_0x1db05d,global['botname']+(_0x23937d(0xeab,0x11c7,0xfa0,0x1ba1)+'OFF\x20!'));}else{if(_0x4b485e['ftNMF'](_0x23937d(0x773,0xb9b,0x100a,0x961),_0x4b485e['JOAnY'])){const _0x466bf0={};_0x466bf0[_0x23937d(0x1b0c,0x2588,0x1e2c,0x2254)]=_0x4b485e[_0x313705(0x1541,0xdaa,0x1099,0xf3a)],_0x466bf0[_0x23937d(0x159c,0x246b,0x1352,0x240e)]={},_0x466bf0[_0x313705(0xa9e,0x16e9,0x315,0x12)]=0x1,_0x466bf0[_0x23937d(0x159c,0x246b,0x1352,0x240e)][_0x23937d(0x13f4,0x4dc,0x50b,0xa26)+'t']=_0x4b485e['dklQF'];const _0x3fcd19={};_0x3fcd19[_0x313705(0x175a,0x18be,0x218a,0x252b)+'t']=_0x4b485e[_0x313705(0x100f,0x154c,0x1e2b,0xd89)];const _0x4bf9c3={};_0x4bf9c3['buttonId']=_0x313705(0x1e4b,0x257a,0x27c4,0x1ba1)+'f',_0x4bf9c3[_0x313705(0x1902,0xc08,0x1220,0x16c7)]=_0x3fcd19,_0x4bf9c3[_0x23937d(0x738,0x8a,0x14fb,0x42c)]=0x1;let _0x2d06f5=[_0x466bf0,_0x4bf9c3];await _0x175756['sendButton'+'Text'](_0x5cd288[_0x313705(0x14f2,0xf65,0x6b3,0x15bd)],_0x2d06f5,_0x23937d(0x3c0,-0x47e,0xec1,0x715)+'n\x20/\x20off',_0x175756[_0x23937d(0x421,-0x9f,-0x8e6,0xc3e)][_0x23937d(0x1451,0xa34,0x6a4,0x1c10)],_0x5cd288);}else _0x4caeee[_0x23937d(0xf6e,0x1927,0x15c8,0x1c56)](_0x4d7981['join']('\x20'))[_0x23937d(0x1b61,0xf99,0x19bb,0x28da)](async _0x1a87cf=>{_0x1a2d45=_0x1a87cf[_0x2e3fe5[_0x280133(0x1d1,0x1170,0xb03,0x165e)](_0x4b485e[_0x4251a8(0x1687,0x1f3e,0x1909,0x10b4)](_0x1bdb50['random'](),_0x1a87cf[_0x4251a8(0x910,0x137,0xac4,0x1646)]))];const _0x348929={};_0x348929[_0x4251a8(0x1926,0x204d,0x1169,0x27c9)+'t']=_0x4251a8(0x13c6,0x974,0xb28,0xb03);let _0x52cc72=[{'buttonId':_0x4251a8(0x12c7,0xc7a,0x545,0x1e6f)+_0x198be0['join']('\x20'),'buttonText':_0x348929,'type':0x1}];const _0x33fc1f={};_0x33fc1f['url']=_0x400f54;const _0x5bb7a5={};_0x5bb7a5['title']=''+_0x50582d[_0x280133(0x79c,0x604,0xc7e,0x31f)],_0x5bb7a5[_0x280133(0x19f5,0x198d,0x18f4,0x1770)]=''+_0x2a1425[_0x4251a8(0x2207,0x1d23,0x2821,0x1c00)],_0x5bb7a5[_0x4251a8(0x1c1b,0x15bf,0x22d4,0x1258)]=_0x331bca,_0x5bb7a5['mediaType']=0x2;function _0x280133(_0x18bb0a,_0x395258,_0x6a33f8,_0x5406de){return _0x313705(_0x6a33f8- -0x54,_0x18bb0a,_0x6a33f8-0x1a9,_0x5406de-0xab);}_0x5bb7a5['mediaUrl']=''+_0x421581['btnurl'],_0x5bb7a5[_0x280133(0x29e8,0x20bd,0x1b02,0x2003)]=''+_0x44e669[_0x4251a8(0xd2c,0x678,0xb61,0xf85)];const _0xccfbbf={};_0xccfbbf[_0x4251a8(0x9aa,0x10d1,0x5c5,0x127)+_0x4251a8(0x852,0x990,0xb58,0xf32)]=_0x5bb7a5;let _0x323317={'image':_0x33fc1f,'caption':_0x4b485e['wQYux'](_0x4b485e[_0x4251a8(0x22b8,0x19f5,0x2e28,0x2e40)](_0x4b485e[_0x280133(0x29b,0x11d,0x8a4,0x1a9)](_0x282d39[_0x4251a8(0x1ecc,0xfb9,0x2b8e,0x22ea)]+(_0x280133(0x2769,0x12f8,0x2082,0x258c)+'\x20'),_0x8be0b0[_0x4251a8(0x2148,0x2dc5,0x2280,0x262f)]('\x20')),'\x0a'+_0x1e549e[_0x4251a8(0x1ecc,0x1881,0x150b,0x13d9)]+(_0x4251a8(0x14f1,0x1243,0xc15,0x21fc)+'rl\x20:\x20')),_0x147fd5),'footer':''+_0x23575b[_0x4251a8(0xe9e,0x80,0xef4,0x1751)],'buttons':_0x52cc72,'headerType':0x4,'contextInfo':_0xccfbbf};function _0x4251a8(_0x136e54,_0x22f665,_0x3d4fbc,_0x143442){return _0x23937d(_0x136e54-0x532,_0x22f665,_0x3d4fbc-0x177,_0x143442-0xa0);}const _0x1af215={};_0x1af215[_0x280133(0x106a,0x54a,0x8ee,0x17a)]=_0x415878,_0x22c9e5[_0x280133(0xfba,0x100b,0xc56,0x19a3)+'e'](_0x15c5ce[_0x280133(0xccc,0x1c21,0x149e,0x7b8)],_0x323317,_0x1af215);})['catch'](_0x3f35e9=>_0x3f35e9);}}}}else{if(_0x24aa58){if(_0x4b485e[_0x313705(0x9da,0xd4,0xadb,0x790)](_0x1ba32f[-0x20a0+-0x9d1+0x2a71],'on')){if(_0x4b485e['AktQr'](_0x4b485e['hNYds'],_0x4b485e[_0x23937d(0x11f8,0x14b1,0x1598,0x188a)])){if(_0x4b485e[_0x313705(0x1ba8,0x11e6,0x1733,0xe72)](global[_0x313705(0x1e32,0x2b06,0x2a37,0x1127)],_0x4b485e[_0x23937d(0x237,0x8fc,0x1cd,0x72b)]))return _0x4b485e[_0x313705(0xd97,0x11f5,0x639,0x47a)](_0x1db05d,_0x23937d(0xc17,0x14e7,0x669,0x12af));global[_0x23937d(0x1acc,0x1e77,0x27c8,0x176b)]=_0x4b485e[_0x313705(0x59d,0x145,0x8af,0xe6c)],_0x1db05d(global[_0x313705(0xcd2,0x15fc,0x128b,0x11b0)]+(_0x313705(0x1211,0x18d1,0xb64,0x589)+'ON\x20!'));}else{const _0x285378={};_0x285378[_0x313705(0x1b3f,0x1825,0x179d,0x140d)]=_0x313705(0xe52,0x9b6,0x1bee,0x1996),_0x285378[_0x23937d(0x53b,-0xe7,0xa1e,0x3a8)]=_0x313705(0x1f69,0x24ae,0x1f4f,0x2391)+_0x23937d(0x4c,0xa03,0x8ae,-0xdb5)+'e',_0x285378[_0x23937d(0x13c8,0x2035,0xe1c,0x11e2)+'n']=_0x23937d(0xf24,0x456,0xcbc,0x1b81)+_0x23937d(0x8ab,0x8f1,0x4b6,0xa30)+_0x313705(0x1a27,0x24a3,0x1191,0x1225)+_0x313705(0x824,0xae1,0x488,-0x54a);const _0x99a6cc={};_0x99a6cc[_0x23937d(0x17d9,0x2336,0xd83,0x1206)]=_0x4b485e['clBLO'],_0x99a6cc[_0x313705(0x49c,0x59b,-0x21c,0x10bf)]=[_0x285378,{'title':_0x4b485e[_0x313705(0x15a8,0x1a7a,0x1dc5,0xdfb)],'rowId':'setmenu\x20te'+'mplateGif','description':_0x313705(0x128a,0x1f0d,0x3ac,0xf7a)+_0x313705(0xc11,0xaee,0x751,0xc28)+_0x313705(0x9fb,0x14c2,0x11a3,0xcca)+'Menu'},{'title':_0x4b485e[_0x23937d(0x16b1,0xa3b,0x7a3,0x2065)],'rowId':_0x23937d(0x1c03,0x22d4,0x1dc0,0x1fc2)+_0x23937d(0xce4,0x1356,0x1af7,0x15c1)+'o','description':_0x313705(0x128a,0x134d,0xdf9,0x17dc)+_0x313705(0xc11,0x826,0x378,0xf12)+_0x313705(0x579,0xe26,-0x96e,-0x4cc)+_0x23937d(0x26,0xa1d,-0x114,0x984)},{'title':_0x4b485e['WDbTC'],'rowId':'setmenu\x20te'+_0x23937d(0xce6,0x8a9,-0x105,0x1e3)+_0x313705(0x10df,0x1d8a,0x97b,0x1bb9),'description':_0x23937d(0xf24,0x419,0x842,0x493)+_0x23937d(0x8ab,0x1110,0xb2a,0x106b)+'nu\x20to\x20Docu'+_0x23937d(0x153e,0x1c9e,0x12f3,0x1c97)}];let _0x43fdd4=[_0x99a6cc];_0x822375[_0x313705(0xb7d,0x1a1b,0x18e8,0xe21)+'g'](_0x3ec97c[_0x23937d(0x118c,0x4a4,0xdc0,0x1834)],'Please\x20sel'+_0x23937d(0x200,-0x971,0x70f,0x31)+_0x313705(0x90c,0x563,0x15dc,0x158c)+_0x313705(0x19b8,0x13b4,0x2195,0x219d)+'e!','\x20',_0x509105[_0x23937d(0x421,0x6b5,0x27,0xc2c)][_0x313705(0x17b7,0x214e,0x15df,0x9cc)],'Click\x20Here',_0x43fdd4,_0x228cae);}}else{if(_0x4b485e[_0x23937d(0x1297,0x1297,0x1c9f,0x1397)](_0x1ba32f[0xc*-0x2f+-0x8*0x443+0x244c],_0x4b485e['hbAtH'])){if(_0x4b485e['AMbOX'](_0x4b485e[_0x313705(0xc55,0xbf9,0x5c,0xf91)],'LGwIP')){if(_0x4b485e[_0x23937d(0x1d76,0x1a43,0x283c,0x155c)](global['dragonchat'],_0x4b485e['UBZUB']))return _0x4b485e[_0x23937d(0x8f2,0xfdb,0x15ad,0x135c)](_0x1db05d,'Deactivate'+'d');global[_0x23937d(0x1acc,0x1a62,0x2046,0x1a79)]=_0x4b485e[_0x313705(0x1c76,0x1588,0xe91,0x2afb)],_0x1db05d(global[_0x23937d(0x96c,-0x55,0x14e3,0x130d)]+('\x20Chat\x20Bot\x20'+_0x313705(0x670,0x52d,-0x363,0x9)));}else{const _0x58318b={};_0x58318b[_0x313705(0x209f,0x1615,0x22b4,0x180d)]=''+_0x92ae8a[_0x23937d(0xae9,0xf2d,0x1720,0x1549)];const _0x33bca9={};_0x33bca9[_0x313705(0x942,0x116e,0xa85,0xae)]=_0x415a22,_0x230aaa[_0x313705(0xcaa,0x1933,0xca7,0x1701)+'e'](_0x22e19[_0x23937d(0x118c,0x7d4,0x1ee1,0xb79)],_0x58318b,_0x33bca9);}}else{if(_0x4b485e[_0x23937d(0x12c2,0x10be,0x16da,0x83c)](_0x4b485e['VWgAU'],_0x4b485e[_0x23937d(0x90a,0x101f,0x10ce,0x1120)])){const _0x44f83c={'wOEQl':_0x4b485e[_0x313705(0x20c2,0x2d67,0x1300,0x230a)],'DQVhs':function(_0x45598d,_0x1b9d38){function _0xe2f106(_0xf9d19f,_0x377f26,_0x4d12eb,_0x1bc23f){return _0x313705(_0x4d12eb-0x1e3,_0x377f26,_0x4d12eb-0x57,_0x1bc23f-0x17);}return _0x4b485e[_0xe2f106(0x20d7,0x25bf,0x1db4,0x2896)](_0x45598d,_0x1b9d38);},'xkCmm':_0x4b485e[_0x23937d(0x705,-0x1c7,0x1533,0x1556)],'LbjSY':'audio/mp4'};_0x3c2d85=_0x4b485e[_0x313705(0x1ee2,0x269f,0x247f,0x2aeb)](_0x1cbc9e,'.mp3'),_0x56ebda(_0x23937d(0x1a2a,0x2027,0xdd8,0x1352)+_0x47490f+(_0x313705(0x1992,0x20bb,0x270b,0x1064)+_0x23937d(0x1c4b,0xe22,0x26de,0x183d))+_0x451e37[0x392+-0xe5a+0x114*0xa]+'\x20'+_0x8b5aac,(_0x2eb116,_0x5738d3,_0x33d78d)=>{function _0x3b6160(_0x1216d8,_0x118797,_0x29bc72,_0x2f62fa){return _0x313705(_0x2f62fa-0x1c,_0x1216d8,_0x29bc72-0x122,_0x2f62fa-0x12f);}function _0x1b9b70(_0x50acb2,_0x20d069,_0x1f6349,_0x22e308){return _0x23937d(_0x1f6349- -0x6a,_0x20d069,_0x1f6349-0xb3,_0x22e308-0x13a);}const _0x231e6c=_0x44f83c[_0x1b9b70(0x114a,0xb99,0x305,0xb7b)][_0x1b9b70(0x224,0xa16,0xc65,0x8d8)]('|');let _0x323ca7=-0x275*-0x4+-0x21e2+0x180e*0x1;while(!![]){switch(_0x231e6c[_0x323ca7++]){case'0':_0x20697c=_0x321379[_0x1b9b70(0xab4,0x447,0x1353,0x1c83)+'nc'](_0x121b0a);continue;case'1':if(_0x2eb116)return _0x44f83c['DQVhs'](_0x581944,_0x44f83c[_0x1b9b70(-0x426,0x2be,0x37,0x2b)]);continue;case'2':const _0x272c70={};_0x272c70[_0x3b6160(0x79b,0x19fd,0x110e,0x16aa)]=_0x2df381,_0x272c70[_0x3b6160(0x19b4,0x19ea,0x1d1d,0x162c)]=_0x44f83c[_0x1b9b70(0x4ef,-0x338,0x7ba,0x2ca)],_0x272c70[_0x1b9b70(0x859,0xdb,0xb6f,0x47d)]=!![];const _0xf280ab={};_0xf280ab[_0x3b6160(0x173,-0x201,0x66c,0x95e)]=_0x6b723b,_0x3abfcd[_0x1b9b70(-0x1f7,0x78a,0x8da,-0x462)+'e'](_0x35d58c,_0x272c70,_0xf280ab);continue;case'3':_0x2decce[_0x1b9b70(0xc69,0xa4d,-0x5f,0xe11)](_0x5e8625);continue;case'4':_0x2068fc[_0x3b6160(0x840,-0x93e,-0xb00,0x38d)](_0x1b9265);continue;}break;}});}else{const _0x5f01bc={};_0x5f01bc[_0x23937d(0x1b0c,0x24e0,0x1742,0x17e3)]=_0x4b485e[_0x23937d(0x11db,0x10ce,0x2048,0x1854)],_0x5f01bc[_0x23937d(0x159c,0x152c,0x1f65,0x23b5)]={},_0x5f01bc[_0x313705(0xa9e,0x196b,0x19a9,0xbf7)]=0x1,_0x5f01bc[_0x23937d(0x159c,0x152c,0x1f65,0x23b5)][_0x313705(0x175a,0x16bf,0x1c9a,0x13d2)+'t']=_0x4b485e[_0x313705(0x1d0d,0x1785,0x2666,0x23af)];const _0x1a50da={};_0x1a50da[_0x313705(0x175a,0xbc0,0x845,0x1f3b)+'t']=_0x4b485e[_0x23937d(0xca9,0xb42,0xc08,0x1756)];const _0x1ba105={};_0x1ba105[_0x23937d(0x1b0c,0x15ae,0x2490,0x23fd)]=_0x313705(0x1e4b,0x1ae1,0x14bd,0x1ed6)+'f',_0x1ba105[_0x23937d(0x159c,0x1e28,0x23c5,0x16d1)]=_0x1a50da,_0x1ba105[_0x313705(0xa9e,0x122a,-0xf8,-0x22f)]=0x1;let _0x232365=[_0x5f01bc,_0x1ba105];await _0x175756[_0x313705(0xb3e,0x1384,0x7be,0xd61)+_0x23937d(0x111a,0x1f5a,0xe3f,0xd0a)](_0x5cd288[_0x313705(0x14f2,0x1c44,0x88a,0x231f)],_0x232365,_0x313705(0x726,0x7ed,0x813,0xb01)+_0x23937d(0x1970,0xba9,0x2412,0xdde),_0x175756['user']['name'],_0x5cd288);}}}}else{if(_0x4b485e[_0x313705(0x1c5c,0x107e,0x1723,0x268f)](_0x4b485e['OUHju'],_0x4b485e[_0x313705(0x1a03,0x1b89,0x21e2,0xea0)]))_0x4b485e[_0x23937d(0x264,0x5b5,0x95e,0x116e)](_0x1db05d,''+mess[_0x313705(0x1818,0x1fda,0x249d,0x1719)]);else{_0x2ef42c=_0x4a74e5[_0x23937d(0x13bd,0x1d8e,0x182a,0x1269)+'nc'](_0x313705(0xe81,0x976,0x118d,0x1610)+'AllData/st'+_0x313705(0x15a4,0x1d59,0xbca,0x2243)+_0x313705(0x11a0,0x561,0x1991,0x1893));const _0x15b63b={};_0x15b63b[_0x313705(0x1360,0x9bf,0x6af,0xaba)]=_0x382129,_0x20cf65[_0x313705(0xcaa,0x1414,-0x17a,0x1213)+'e'](_0x5f05f9[_0x23937d(0x118c,0x37b,0xadc,0xca0)],_0x15b63b);const _0x253299={};_0x253299['text']=''+_0x58231e[_0x313705(0xf1a,0xc4c,0x9b3,0x4df)];const _0x127eba={};_0x127eba['quoted']=_0xd59ee7,_0x37bc42[_0x313705(0xcaa,0x79b,-0x1e4,0x37a)+'e'](_0x5c8292[_0x23937d(0x118c,0x170d,0x1083,0x1059)],_0x253299,_0x127eba),_0x58f2ce=_0x4de167['readFileSy'+'nc']('./Android/'+'AllData/st'+_0x23937d(0x123e,0x6a6,0x1ce4,0x17e6)+_0x313705(0x11a0,0x601,0x1880,0xcbc));const _0x5a4e71={};_0x5a4e71['sticker']=_0x62917c,_0x32e773[_0x313705(0xcaa,0x754,0xfb0,0x5fe)+'e'](_0x13340f['chat'],_0x5a4e71);}}}}else{if(_0x1ba32f[-0x740+0x12*0xef+-0x1*0x98e]==='on'){if(_0x4b485e[_0x313705(0x1afe,0x11ff,0x1566,0x25fd)](global['dragonchat'],_0x4b485e[_0x313705(0x59d,-0xec,0xde7,0xcdd)]))return _0x1db05d(_0x313705(0xf7d,0x187a,0x12ac,0xbe0));global[_0x313705(0x1e32,0x116d,0x20ea,0x2b77)]=_0x4b485e[_0x23937d(0x237,-0x94,0x146,-0xbf5)],_0x1db05d(global[_0x313705(0xcd2,0x1722,0x14cc,0xb6c)]+(_0x23937d(0xeab,0xa9f,0xb4d,0xdf)+_0x23937d(0x1cc4,0x17c5,0x1957,0x1318)));}else{if(_0x4b485e[_0x313705(0x37d,-0x1ac,0x936,0x416)](_0x1ba32f[-0x1665+-0x1e83+0x34e8],_0x4b485e[_0x23937d(0x3a8,0x526,0x10e8,-0x2a9)])){if(_0x4b485e['dQIYb'](global['dragonchat'],_0x4b485e[_0x23937d(0x1910,0xcb5,0x1d6f,0x14c6)]))return _0x4b485e[_0x23937d(0x14e1,0x1ae6,0x83d,0x2223)](_0x1db05d,_0x23937d(0xbb2,0x513,0xd51,0xf4e)+'d');global['dragonchat']='false',_0x4b485e['OCpdu'](_0x1db05d,global[_0x23937d(0x96c,0x26d,0x14e9,0x1727)]+(_0x23937d(0xeab,0xcf7,0x1750,0x50d)+_0x313705(0x670,0x7aa,-0x762,0x40d)));}else{if(_0x4b485e[_0x23937d(0x1d27,0x13f1,0x21b3,0x1117)](_0x313705(0x1717,0x158a,0x1123,0x2476),_0x4b485e[_0x313705(0x16c5,0x1b5a,0x1f47,0x1936)])){const _0x5588d6={};_0x5588d6['displayTex'+'t']=_0x4b485e[_0x23937d(0x19a7,0x1a51,0x1da3,0x1d54)];const _0xc962f1={};_0xc962f1[_0x23937d(0x1b0c,0x1845,0x1281,0x2410)]=_0x23937d(0x15ce,0x1822,0xa32,0xf00),_0xc962f1['buttonText']=_0x5588d6,_0xc962f1[_0x23937d(0x738,-0x106,0x12e2,-0x3d)]=0x1;const _0x56affa={};_0x56affa[_0x313705(0x1e72,0x1590,0x1f06,0x1af7)]=_0x4b485e[_0x23937d(0x5cc,-0x6ac,0x12ce,0x5eb)],_0x56affa['buttonText']={},_0x56affa[_0x23937d(0x738,0x11a2,-0xdc,-0x434)]=0x1,_0x56affa['buttonText']['displayTex'+'t']=_0x4b485e['iQZxD'];let _0xc65faf=[_0xc962f1,_0x56affa];await _0x175756['sendButton'+'Text'](_0x5cd288[_0x23937d(0x118c,0x6af,0xee4,0x1e17)],_0xc65faf,_0x23937d(0x3c0,-0x3ba,0xe68,0x3e7)+_0x23937d(0x1970,0x1dd3,0xae5,0xd6c),_0x175756[_0x313705(0x787,0xe53,0x44a,0x1ff)]['name'],_0x5cd288);}else{const _0x345e76={};_0x345e76[_0x23937d(0x1d39,0x1965,0x1e99,0x1c43)]=''+_0x17a08d[_0x313705(0xba4,0x1159,0x984,0xde6)];const _0x211929={};_0x211929['quoted']=_0xcf9290,_0x8cafe8[_0x313705(0xcaa,0x16a4,0x78c,0x1ba5)+'e'](_0xf88346[_0x313705(0x14f2,0xd53,0x21a3,0x857)],_0x345e76,_0x211929),_0x43a504=_0x482d76[_0x313705(0x1723,0x247c,0x1326,0x8bd)+'nc']('./Android/'+'AllData/st'+'icker/flow'+_0x23937d(0x1532,0xe88,0x1843,0xe52));const _0xe5a7d1={};_0xe5a7d1[_0x23937d(0xffa,0x2d7,0x24c,0x20c)]=_0x2d7fd0,_0x51726f[_0x23937d(0x944,0x185,0x817,0x1653)+'e'](_0x4d7c72[_0x313705(0x14f2,0xe25,0x898,0x1193)],_0xe5a7d1);}}}}}break;case'antispam':{if(_0x4b485e[_0x313705(0xd39,0x724,0x1618,0x1b4e)](_0x4b485e[_0x313705(0xd0e,0x9c3,0xe21,0x71c)],_0x4b485e[_0x23937d(0x9a8,0x16aa,0x411,-0x154)])){if(!_0x4b485e[_0x313705(0x7ca,0x1601,0x654,0xdfe)](_0x4b485e[_0x23937d(0x1612,0x12ef,0x21b7,0x1733)],_0x3d6159))_0x54d311['mute']=![];}else{if(_0x24aa58){if(_0x1ba32f[-0x2b1*0x5+-0xe*-0x16b+-0x665]==='on'){if(_0x4b485e[_0x313705(0x211f,0x22a0,0x2769,0x2485)](global[_0x313705(0x1420,0x1ecb,0x16ff,0xff3)],_0x23937d(0x150,0x7a8,0x3dc,-0xbc2)))return _0x1db05d('Activated');global[_0x313705(0x1420,0x9a4,0x158f,0x1b63)]=_0x4b485e[_0x313705(0x59d,0x104,0x25e,0x592)],_0x1db05d(global[_0x313705(0xcd2,0xf67,0x117,0x127f)]+(_0x313705(0x1e30,0x26cc,0x12d7,0x2534)+_0x313705(0xbf3,0x1ac7,0xaea,0xb04)));}else{if(_0x4b485e[_0x313705(0x1b33,0x1398,0x1ae4,0x2456)](_0x1ba32f[0x2*0x54b+-0x1*0x2678+0x1be2],_0x4b485e[_0x23937d(0x3a8,-0x1fc,0xa04,0x5e1)])){if(_0x4b485e[_0x313705(0x921,0x1785,0xe4c,0x704)](global[_0x313705(0x1420,0x1bc7,0x1ddf,0x18f3)],_0x4b485e['UBZUB']))return _0x1db05d(_0x23937d(0xbb2,-0x16e,0xbde,0xecd)+'d');global[_0x23937d(0x10ba,0xefe,0x1d10,0x12f4)]=_0x23937d(0x1b9,0xc0c,0x34a,-0xa20),_0x4b485e[_0x313705(0x12ce,0x836,0x152e,0x21b9)](_0x1db05d,global[_0x313705(0xcd2,0x4f8,0x150c,0x18c2)]+(_0x313705(0x1e30,0x20b1,0x1743,0x1329)+_0x23937d(0xd29,0x119c,0xf3d,0x16c5)));}}}}}break;case _0x4b485e['kwXUb']:{if(_0x5cd288[_0x313705(0x2089,0x179d,0x2056,0x2b73)]){if(_0x17ccaf){if(_0x4b485e[_0x313705(0xeb1,0x18d3,0xe0c,0x24b)](_0x23937d(0x1af3,0x1290,0x1d32,0x284d),'JfPzI')){const _0xbffb8={};_0xbffb8[_0x23937d(0x1d39,0x2169,0xe8d,0x140b)]=''+_0x36ab1b[_0x23937d(0x93,0xf07,0xe5d,0x3ce)];const _0x495b87={};_0x495b87[_0x313705(0x942,0xf9f,0x1349,0x828)]=_0x105167,_0x3b2053['sendMessag'+'e'](_0x48e671['chat'],_0xbffb8,_0x495b87),_0x8226db=_0x8bcd57[_0x313705(0x1723,0xd67,0xfa8,0x138d)+'nc'](_0x313705(0xe81,0x126,0xf7e,0x1d1d)+'AllData/st'+'icker/hora'+_0x23937d(0x16ba,0x16ab,0x1b48,0xa48));const _0x3e0188={};_0x3e0188[_0x313705(0x1360,0x14bb,0x1b52,0xc76)]=_0x4ff440;const _0x5c004d={};_0x5c004d[_0x313705(0x942,-0x164,-0x2cf,-0x2cf)]=_0x2d373b,_0x33d0a4[_0x23937d(0x944,-0x48,0x895,0x94c)+'e'](_0xb0b3da['chat'],_0x3e0188,_0x5c004d),_0x313f40=_0x40bd22[_0x23937d(0x13bd,0x1757,0x1cc2,0xa6b)+'nc'](_0x313705(0xe81,0xc7a,0x833,0x119c)+_0x23937d(0x1613,0x1dbd,0x2229,0x24c5)+_0x23937d(0x3fb,0x21e,0x101,-0x698)+_0x313705(0x8e6,-0x124,0x1e,-0x2d8));const _0x24b0bf={};_0x24b0bf[_0x313705(0x1360,0x18c8,0xe80,0x1db2)]=_0x3a628d,_0x77fcd[_0x23937d(0x944,-0x1c,0x5c,0x9dd)+'e'](_0x50d372[_0x313705(0x14f2,0x19f0,0x120d,0xa5c)],_0x24b0bf),_0x279f00=_0x30ae3e[_0x23937d(0x13bd,0x2221,0x1570,0xeb5)+'nc']('./Android/'+_0x23937d(0x1613,0xc54,0xc8c,0xa7f)+_0x313705(0x1894,0x2416,0x1d5d,0xf0f)+'a.webp');const _0x5950a8={};_0x5950a8[_0x23937d(0xffa,0x17b1,0x10a0,0x12b6)]=_0x10e918,_0x174793[_0x23937d(0x944,0x1811,0x195,0x872)+'e'](_0x18be75[_0x23937d(0x118c,0x11a2,0xb62,0xf04)],_0x5950a8);}else{if(_0x4b485e[_0x313705(0x1ad6,0x206d,0xee3,0xc73)](_0x1ba32f[-0x747+-0x2*-0xbe1+-0x107b],'on')){if(_0x4b485e[_0x313705(0x1c5c,0x2399,0xe9b,0x12a1)](global[_0x313705(0x1cfa,0x1e39,0x13f1,0x1f59)],'true'))return _0x4b485e[_0x313705(0xb10,0x1397,0x17e,-0x385)](_0x1db05d,_0x23937d(0xc17,0x48f,0x1f9,0x1ad1));global[_0x23937d(0x1994,0x1e5e,0x18ec,0x1651)]=_0x23937d(0x150,-0x699,-0x4f1,-0x6f4),_0x4b485e[_0x23937d(0x74d,0x228,0xdcc,0xfbd)](_0x1db05d,global[_0x313705(0xcd2,-0xa9,0xe4e,0x7ed)]+(_0x23937d(0x72a,0x7ff,-0x27e,0xcac)+_0x313705(0xbf3,0xed2,0xae5,0x333)));}else{if(_0x1ba32f[0x2*0x9c2+-0xfc0+-0x3c4]===_0x4b485e['hbAtH']){if(_0x4b485e[_0x313705(0x67d,-0x400,0x403,0x123a)](_0x4b485e[_0x23937d(0x513,-0x2ee,-0x142,0x44a)],_0x4b485e[_0x23937d(0x513,-0x426,0x115a,-0x775)])){if(_0x4b485e[_0x23937d(0x64,0x31a,-0x8e,-0x9f3)](global['antilink'],_0x313705(0x51f,0x13bd,0xbc1,-0x6c7)))return _0x4b485e[_0x313705(0x181f,0x168b,0x1f87,0x10c3)](_0x1db05d,_0x313705(0xf18,0xa93,0x335,0x98a)+'d');global[_0x313705(0x1cfa,0x139b,0x143a,0x2452)]=_0x313705(0x51f,-0x8c0,0xed5,0x1132),_0x4b485e[_0x313705(0x19ef,0xdfc,0x16ec,0xd3e)](_0x1db05d,global[_0x313705(0xcd2,0x9b8,0xa4f,0xffe)]+(_0x23937d(0x72a,0x767,0x541,0xe1e)+_0x313705(0x108f,0x167b,0x10d8,0xbe7)));}else{const _0x5eb7ce={};_0x5eb7ce[_0x313705(0x209f,0x148c,0x1c12,0x2b39)]=''+_0xbba195[_0x23937d(0x15f1,0x1c10,0x106d,0x8d4)];const _0x59c13e={};_0x59c13e[_0x23937d(0x5dc,-0x223,0xfdf,-0x27e)]=_0x244072,_0x1957b1[_0x313705(0xcaa,0x1877,0x69a,0xf24)+'e'](_0x3d7ebb[_0x313705(0x14f2,0x1c73,0x14db,0x1fd4)],_0x5eb7ce,_0x59c13e);}}else{if(_0x4b485e[_0x313705(0x67d,0xd3f,-0x2ef,0x1021)](_0x313705(0x11e3,0x1941,0x1534,0x16c2),_0x4b485e['gjUJO'])){const _0xe037d8={};_0xe037d8['buttonId']=_0x4b485e[_0x313705(0x14aa,0x2349,0xd12,0x22ca)],_0xe037d8[_0x313705(0x1902,0xa9d,0x249e,0xbec)]={},_0xe037d8['type']=0x1,_0xe037d8[_0x313705(0x1902,0xa9d,0x249e,0xbec)][_0x313705(0x175a,0x2548,0x1adc,0x12d7)+'t']=_0x4b485e[_0x313705(0x1d0d,0x1986,0x11ac,0x20df)];const _0x30e861={};_0x30e861[_0x23937d(0x13f4,0x10ec,0x112b,0x145c)+'t']=_0x4b485e[_0x23937d(0xca9,0xc0c,0x2d0,0x12e6)];const _0x4fb0ee={};_0x4fb0ee[_0x313705(0x1e72,0x28b2,0x16bf,0x143f)]=_0x313705(0x6a0,-0x5d4,0xc6d,0x1029)+'ff',_0x4fb0ee[_0x23937d(0x159c,0x1bd8,0x2227,0xc74)]=_0x30e861,_0x4fb0ee[_0x23937d(0x738,0x6a3,-0x6be,0x154f)]=0x1;let _0x479f87=[_0xe037d8,_0x4fb0ee];await _0x175756[_0x313705(0xb3e,0x148a,0x717,0x463)+_0x23937d(0x111a,0x291,0x9b2,0x926)](_0x5cd288[_0x23937d(0x118c,0x4c5,0x111d,0x14ea)],_0x479f87,'Anti\x20Link\x20'+_0x23937d(0x3c5,-0x5c3,-0x2,0x3c3),_0x175756[_0x23937d(0x421,0x990,0x853,0x427)][_0x313705(0x17b7,0x22ad,0xfe0,0x23de)],_0x5cd288);}else{const _0x564040={'gsWzc':function(_0x5de4ed,_0x16f4f1){return _0x4b485e['uGEzs'](_0x5de4ed,_0x16f4f1);}};if(_0x4a0997)return _0x5aebf7(_0x56448c[_0x313705(0x982,0xe4a,-0x4b9,0x6bb)]);if(_0xb8cd77)return _0x4b485e['LvcUQ'](_0x231179,_0x238ff0[_0x23937d(0x5c0,-0x8a7,0xb73,0xee7)]);if(!_0x4fe9d4[0x63c+-0x4*-0x18a+-0xc64])return _0x1ae1ad(_0x313705(0x6c9,0xc19,-0x259,-0x1ce)+_0x4b485e[_0x313705(0x945,0x9ce,0x1185,0xc2c)](_0x13fa03,_0x4069a0)+(_0x313705(0xadf,0xf37,0x12ea,0x288)+_0x23937d(0xa8e,0x865,0xedb,0x2bc))+_0x4b485e[_0x23937d(0xd57,0x673,0x20f,0x13d4)](_0x44c2c8,_0x5c0e9a)+(_0x23937d(0x1350,0xc98,0x1793,0x1133)+_0x313705(0xa6f,0xa2,0x807,-0x44e)));let _0x52a3f5=_0x4b485e[_0x23937d(0xe16,0x24f,0xd8c,0x1507)](_0x1c563f,_0x23937d(0x1b37,0x115e,0xf29,0x28a3));_0x52a3f5({'query':_0x1af0bc[_0x23937d(0x1c16,0x1842,0x13d4,0xe10)]('\x20')})[_0x313705(0x1ec7,0x1460,0x2056,0x2790)](_0x371598=>{let _0x147866=_0x227a0d(0x1426,0x17fd,0x8e1,0x1162)+_0x227a0d(0xe5c,0x6a4,0x12ae,0xe91)+'\x20'+_0x3f2914+'\x0a\x0a';for(let _0x2ca111 of _0x371598){_0x147866+=_0x98721c['dragonemoj'+'i']+(_0x227a0d(0x1346,0x11a9,0x1f5b,0x1ea5)+'\x20')+_0x2ca111[_0x227a0d(0x1d57,0x158d,0x1410,0x1966)]+'\x0a',_0x147866+=_0xee7941[_0x43ab32(0x1f81,0x115a,0x1100,0x1d7b)+'i']+(_0x43ab32(0x1a73,0x1e24,0xff1,0x1331)+'ion*\x20:\x20')+_0x2ca111[_0x227a0d(0x941,0xa27,0x6e2,0x67b)]+'\x0a',_0x147866+=_0x5bbde6['dragonemoj'+'i']+_0x227a0d(0x2141,0x1f80,0x1e21,0x1430)+_0x2ca111[_0x43ab32(0x159b,0x1e91,0x1079,0x21e1)]+(_0x43ab32(0x1b27,0x1089,0x1702,0x39a)+_0x43ab32(0x29c2,0x1cee,0x23f7,0x1b38)+_0x227a0d(0x12c9,0x25fc,0xdf9,0x1a6b));}function _0x227a0d(_0xe73b28,_0x5a19d6,_0x1b9bc0,_0x241ebc){return _0x23937d(_0x241ebc-0x18d,_0xe73b28,_0x1b9bc0-0x4f,_0x241ebc-0x1c8);}function _0x43ab32(_0x40cde1,_0x5b1af0,_0x12ae54,_0x56727a){return _0x23937d(_0x5b1af0-0x399,_0x56727a,_0x12ae54-0x1ce,_0x56727a-0x144);}_0x564040['gsWzc'](_0x3e41d9,_0x147866);});}}}}}else{if(_0x24aa58){if(_0x4b485e[_0x313705(0x3dc,0xab3,0x15e,0x124f)](_0x1ba32f[0x13ee+-0x294+0x1*-0x115a],'on')){if(_0x4b485e[_0x313705(0x1ad6,0x1151,0x21cc,0x14e0)](global['antilink'],_0x313705(0x4b6,-0x13d,0x7ec,0x295)))return _0x4b485e[_0x313705(0xb7f,0x1281,0xf1e,0x265)](_0x1db05d,'Activated');global[_0x23937d(0x1994,0x27f4,0x121c,0x21fd)]=_0x23937d(0x150,0xbfa,-0x861,-0x38d),_0x4b485e['TXEeE'](_0x1db05d,global[_0x23937d(0x96c,0x79f,0x1aa,0xea8)]+(_0x313705(0xa90,0xffb,0x961,-0x2d5)+_0x23937d(0x88d,0xee9,0x4a2,0x620)));}else{if(_0x1ba32f[0x21e3+0x2286+-0x4469]===_0x4b485e[_0x313705(0x70e,0x6f2,0xd9e,0xe94)]){if(_0x4b485e[_0x23937d(0x17cd,0x9d0,0x136c,0x1d43)](global[_0x313705(0x1cfa,0x1e54,0x182d,0x2969)],'false'))return _0x4b485e[_0x23937d(0x8cc,0x4ea,-0x24f,0xd1e)](_0x1db05d,_0x313705(0xf18,0x1c60,0xc14,0x3de)+'d');global[_0x23937d(0x1994,0x1066,0xc5d,0x1e07)]=_0x4b485e[_0x313705(0x1c76,0x29e1,0x18da,0x1018)],_0x1db05d(global['botname']+(_0x23937d(0x72a,0x654,0xece,-0x327)+'\x20OFF\x20!'));}else{const _0x8d9a3f={};_0x8d9a3f[_0x23937d(0x13f4,0x15af,0xa74,0x18e7)+'t']=_0x23937d(0xdc,0x589,0xe30,-0xc75);const _0x413d98={};_0x413d98[_0x313705(0x1e72,0x20fc,0x1e6b,0x1539)]=_0x4b485e[_0x23937d(0x1144,0x119e,0x1a31,0x1169)],_0x413d98[_0x23937d(0x159c,0x1b1b,0xac0,0xc39)]=_0x8d9a3f,_0x413d98[_0x313705(0xa9e,0xa99,0xf46,0xaa7)]=0x1;const _0x21ade2={};_0x21ade2[_0x23937d(0x1b0c,0x2780,0xdf9,0x16d3)]=_0x4b485e[_0x313705(0xf6b,0xf17,0xda1,0x19b8)],_0x21ade2['buttonText']={},_0x21ade2[_0x313705(0xa9e,0xa73,0xc7a,0x653)]=0x1,_0x21ade2['buttonText'][_0x313705(0x175a,0x1275,0xc59,0x250f)+'t']=_0x4b485e[_0x23937d(0xca9,0x6e,0x7e6,0x1a9c)];let _0x56a975=[_0x413d98,_0x21ade2];await _0x175756[_0x23937d(0x7d8,-0x504,0xea3,0x1167)+'Text'](_0x5cd288[_0x313705(0x14f2,0x5d5,0x2205,0x1a62)],_0x56a975,'Anti\x20Link\x20'+_0x23937d(0x3c5,0x333,0x672,0xe7c),_0x175756['user'][_0x313705(0x17b7,0xb0d,0x1ca4,0xf12)],_0x5cd288);}}}else _0x1db05d(''+mess[_0x313705(0x1818,0x9fc,0x1f17,0x11ca)]);}}else{if(_0x4b485e[_0x23937d(0x1148,0x1c0e,0x57c,0xfa6)](_0x1ba32f[0x2396+-0x3bb+-0x1fdb],'on')){if(_0x4b485e['HzSDm'](_0x4b485e['CEXgR'],_0x4b485e['CEXgR'])){if(_0x4b485e['PZwVi'](global[_0x23937d(0x1994,0x2463,0x21b2,0x17c5)],_0x4b485e[_0x313705(0x59d,-0x4f2,-0x86c,-0x48b)]))return _0x1db05d(_0x23937d(0xc17,0x8cb,-0x29a,0xf5f));global['antilink']=_0x4b485e[_0x23937d(0x237,-0x6e5,0x10a8,-0x8b9)],_0x4b485e['xVTuz'](_0x1db05d,global['botname']+('\x20Anti\x20Link'+_0x313705(0xbf3,0x673,-0x2ec,0x11ce)));}else{const _0x55a036={};_0x55a036[_0x23937d(0x83d,0xaa0,0x1130,0x33a)]=_0x32ec6e[_0x313705(0xba3,0x852,0x1862,0x1949)],_0x55a036['author']=_0x34b7e0[_0x313705(0xa17,0x1368,0x122a,-0x302)],_0x4a02c9[_0x23937d(0x137,-0x9ff,0x8a0,0x98d)+'sSticker'](_0x58b9c0[_0x23937d(0x118c,0x1fea,0x4e1,0x787)],_0x3de0ce[_0x23937d(0xa79,0xd54,0x430,0xa75)],_0x16e96f,_0x55a036);}}else{if(_0x4b485e[_0x313705(0x1012,0x12cc,0xf28,0x16eb)](_0x1ba32f[0x735+0x25d1+-0x2d06],_0x4b485e['hbAtH'])){if(global[_0x313705(0x1cfa,0x13d0,0x12c9,0x105c)]===_0x23937d(0x1b9,0x104e,-0x51a,0x10))return _0x4b485e['XnxCk'](_0x1db05d,_0x23937d(0xbb2,-0x105,0x13c6,0x406)+'d');global['antilink']=_0x4b485e[_0x313705(0x1c76,0x1721,0x1985,0x208f)],_0x4b485e[_0x23937d(0xfd3,0x1e12,0x1509,0x10ec)](_0x1db05d,global[_0x23937d(0x96c,-0x4e8,0x7a,0x125f)]+('\x20Anti\x20Link'+_0x313705(0x108f,0x1f39,0x1c3d,0x1597)));}else{const _0x3ed44e={};_0x3ed44e[_0x313705(0x1e72,0x27e1,0x1e32,0x211f)]=_0x4b485e['Uqvte'],_0x3ed44e[_0x23937d(0x159c,0x1d42,0x1870,0x2139)]={},_0x3ed44e[_0x23937d(0x738,0x1c4,0x11f9,-0x6cd)]=0x1,_0x3ed44e[_0x23937d(0x159c,0x1d42,0x1870,0x2139)][_0x313705(0x175a,0x257f,0x120e,0x1e62)+'t']=_0x4b485e[_0x23937d(0x19a7,0x164c,0x104f,0xe0c)];const _0x1bb408={};_0x1bb408['buttonId']=_0x4b485e[_0x313705(0xf6b,0x1863,0xde2,0xdb4)],_0x1bb408['buttonText']={},_0x1bb408[_0x313705(0xa9e,0xa06,0x18,0x76d)]=0x1,_0x1bb408['buttonText'][_0x23937d(0x13f4,0x4fc,0x64a,0x50b)+'t']=_0x4b485e[_0x313705(0x100f,0x1d46,0x1100,0x365)];let _0x164a2f=[_0x3ed44e,_0x1bb408];await _0x175756[_0x23937d(0x7d8,0xbd4,0x130b,-0x4ce)+_0x23937d(0x111a,0x34d,0xbaa,0x162c)](_0x5cd288[_0x23937d(0x118c,0xe14,0x75c,0xc0d)],_0x164a2f,_0x313705(0x42e,0x22d,-0xa65,-0x3ea)+_0x313705(0x72b,0x66b,0xcd1,0x122),_0x175756['user'][_0x23937d(0x1451,0x1a86,0x22bf,0x2360)],_0x5cd288);}}}}break;case _0x4b485e[_0x23937d(0x1b11,0x18d0,0x266a,0x149b)]:case _0x23937d(0x1d1c,0x1aae,0x10af,0x2617):case _0x4b485e[_0x23937d(0x1728,0x208c,0x1f72,0x1584)]:case _0x4b485e[_0x313705(0x1c7c,0xe81,0x122b,0x2816)]:case _0x4b485e['SJZkU']:case'?':case _0x313705(0xcee,0x8be,0x6f1,0x1638):case'hi':{if(_0x4b485e[_0x313705(0x16bc,0x1d31,0x142c,0x89d)](_0x4b485e[_0x313705(0x638,-0x201,-0x4f6,0xcfc)],_0x4b485e[_0x23937d(0x1078,0x1ed1,0xef3,0x1177)])){let _0x20bd6b=_0x3acd48[_0x23937d(0x6e8,0x1406,0x105,0x1104)+_0x23937d(0xec7,0xd8e,0x834,0x516)],_0x1e5c39=_0x31343b[_0x23937d(0x1b07,0x1b26,0x2165,0x1310)+'estamp'],_0x40c34e=_0x20bd6b?_0x20bd6b:_0x1e5c39;_0x36afc6+=_0x5b7b80[_0x23937d(0xdc1,0x14b,0x71,0x1941)+'i']+'\x20@'+_0x44e2c3[_0x23937d(0xc6a,0xdfb,0x118,0xd60)]['split']('@')[0x61f*0x1+-0xb5+-0x2a*0x21]+'\x0a',_0x30ed48+=_0x23937d(0x19b7,0x16ca,0xe40,0xc17)+_0x11acc5[_0x23937d(0xdc1,0x2e0,0x87d,0x9f6)+'i']+_0x313705(0xf72,0x1e64,0x42a,0x1cde)+_0x4b485e[_0x23937d(0x39b,0x2ef,0x906,-0x2d3)](_0xc400b6,_0x4b485e[_0x23937d(0xa34,-0x4bb,0x12c5,0x91b)](_0x40c34e,-0xf5b+0x17ee+0x4ab*-0x1))['format'](_0x4b485e[_0x23937d(0x9f3,0x1234,0x1110,0x13a0)])+'\x20'+_0x5aa106[_0x23937d(0xdc1,0x4ed,0x1002,0x1985)+'i']+(_0x23937d(0xc1d,-0xe8,0x19a9,0x1ab7)+'*\x20')+(_0x20bd6b?_0x4b485e[_0x313705(0x4ab,0x6e9,0x567,0x1131)]:_0x313705(0x17e1,0x1598,0x26db,0x1110))+'\x0a\x0a';}else{const _0x25b40b=moment['tz'](_0x4b485e[_0x23937d(0xb4,0xec3,-0x311,-0x716)])[_0x313705(0x1b6c,0x16ea,0x11e0,0x220d)](_0x4b485e[_0x23937d(0xf48,0x128c,0x1ae6,0x1a1d)]);if(_0x1bac1f)return _0x4b485e[_0x23937d(0x107c,0x6a0,0x59b,0x1908)](_0x1db05d,mess['ban']);if(_0x1e03f5)return _0x1db05d(mess[_0x23937d(0x5c0,-0x3f7,-0x444,0x765)]);const _0x4ca0fb={};_0x4ca0fb[_0x23937d(0x1d39,0x16b9,0x2642,0x17e3)]='⚙️',_0x4ca0fb[_0x23937d(0x94f,0x11ea,0x994,0x202)]=_0x5cd288[_0x23937d(0x94f,0x70c,0x660,0x186f)];const _0xb53ac0={};_0xb53ac0['react']=_0x4ca0fb,_0x175756[_0x23937d(0x944,-0x19a,0xcfc,0xd42)+'e'](_0x423161,_0xb53ac0),timestampe=_0x4b485e['MtCsa'](speed),latensie=_0x4b485e[_0x313705(0x989,0x105a,0xa9c,0x182e)](speed)-timestampe;const _0xca4583={};_0xca4583[_0x23937d(0x13f4,0x1cd1,0x502,0x1a7f)+'t']=_0x4b485e[_0x313705(0x1a55,0x1f49,0x110b,0x1490)];const _0xae03f4={};_0xae03f4[_0x313705(0x1e72,0x1b9c,0x2ace,0x17a5)]=_0xe1d953+(_0x313705(0x1cc2,0x10da,0x294f,0x1f8a)+'b'),_0xae03f4[_0x23937d(0x159c,0x1afa,0x126e,0x1c36)]=_0xca4583,_0xae03f4[_0x23937d(0x738,0x424,-0x54c,0x816)]=0x1;const _0xb48b11={};_0xb48b11[_0x23937d(0x13f4,0xa98,0xfc7,0x229c)+'t']=_0x4b485e['SXhBs'];const _0x1882ea={};_0x1882ea[_0x23937d(0x1b0c,0xded,0x1632,0x1a39)]=_0xe1d953+_0x313705(0xfea,0x1bc3,0x1654,0x591),_0x1882ea[_0x313705(0x1902,0x18af,0xb64,0x25c5)]=_0xb48b11,_0x1882ea['type']=0x1;const _0x2b6ad3={};_0x2b6ad3[_0x313705(0x175a,0x24f2,0x223a,0x135f)+'t']=_0x23937d(0x7a8,0xfb2,0x1533,0xa1c);const _0x9684c1={};_0x9684c1['buttonId']=_0xe1d953+_0x313705(0x1bd9,0x2506,0x1255,0x2a25),_0x9684c1[_0x313705(0x1902,0xd4d,0x25c2,0x2618)]=_0x2b6ad3,_0x9684c1['type']=0x1;let _0x2ce78f=[_0xae03f4,_0x1882ea,_0x9684c1];const _0xf8b17a={};_0xf8b17a[_0x313705(0xddf,0x1659,0x135,0xb26)]=''+global[_0x23937d(0xa3e,0x3b8,-0x4dd,-0xa4)];let _0x51279f={'image':_0xf8b17a,'caption':_0x23937d(0x1b0,0xe40,-0x384,-0x9a4)+_0x313705(0x1995,0x1885,0x2452,0x1723)+_0x313705(0x1110,0x1209,0xf28,0x3f0)+'\x20'+_0xa43395+'\x0a'+global[_0x313705(0x1581,0x175c,0x1a92,0x1cf6)]+(_0x313705(0x1387,0x2100,0x1377,0x11e3)+_0x23937d(0x152,0x69b,0x78e,-0xc66))+latensie[_0x313705(0xbfc,0xb0f,0x13a8,0x1851)](0xa48+0x987+-0x13cb)+('\x20mili\x20sec]'+_0x23937d(0xd46,0x1c50,0xbf3,0xda0)+_0x313705(0x4b8,0x900,0x11c9,-0xa12))+_0x25b40b+']','buttons':_0x2ce78f,'headerType':0x4};_0x175756[_0x313705(0xcaa,0x15eb,0x1b5a,0x981)+'e'](_0x5cd288[_0x313705(0x14f2,0x1ba7,0xfc4,0x1fc5)],_0x51279f);}}break;case _0x23937d(0x195c,0x2572,0x1bfb,0x248d)+'b':{const _0x5ba30e={};_0x5ba30e[_0x313705(0xddf,0x1aca,0xebf,-0xde)]=_0x23937d(0x917,0x9c2,0x106c,0xa3)+_0x23937d(0x18b8,0x1764,0x1c56,0x1bb9)+_0x23937d(0x1c9d,0x299e,0x1723,0x1a6d)+_0x23937d(0x582,0x18a,0xad7,0xdb)+_0x23937d(0xfce,0x1bfc,0x156f,0x1807);const _0x364662={};_0x364662['image']=_0x5ba30e,_0x364662[_0x23937d(0x968,0x131,0xfac,-0x228)]='\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20'+'\x20\x20\x20\x20☰\x20WEBS'+_0x313705(0xf71,0x1444,0x1c3e,0x1b70)+_0x313705(0xe2f,0x1867,0x1258,0x42b)+_0x313705(0x3e6,0x4a6,0xd15,-0x142)+_0x313705(0x95d,0x92b,-0x387,-0x56d)+_0x313705(0x14ad,0x1799,0x1275,0xb4d)+_0x313705(0x19f8,0x1117,0x1060,0x117d)+_0x23937d(0x1c09,0x12f8,0x13d4,0x1ed0)+_0x23937d(0x382,0xbb6,0x111d,0xbf4)+_0x23937d(0x24b,0xeec,-0x790,0x8cc)+_0x313705(0x15a7,0xcaa,0xeaa,0x20ac)+_0x313705(0xc03,0xd82,0x1bb,-0x61)+_0x23937d(0x1a5c,0x142a,0x200b,0x15ba),_0x364662['footer']=''+global['footer'],_0x175756['sendMessag'+'e'](_0x5cd288[_0x313705(0x14f2,0x19c9,0xf74,0x2176)],_0x364662);}break;case _0x4b485e[_0x313705(0x12d5,0x914,0x1f6a,0x975)]:{const _0x324e3a={};_0x324e3a[_0x23937d(0x1d39,0x1f70,0x1fda,0x1aa4)]='📕',_0x324e3a[_0x313705(0xcb5,0x609,0x1051,0x6c7)]=_0x5cd288[_0x313705(0xcb5,0x5c,0x34c,0x1007)];const _0x582386={};_0x582386[_0x313705(0x1d20,0x194a,0x1352,0x1328)]=_0x324e3a,_0x175756[_0x313705(0xcaa,0x7d5,0x325,0x1301)+'e'](_0x423161,_0x582386);{const _0x4327b7={};_0x4327b7[_0x313705(0x175a,0x1952,0x1040,0x189d)+'t']=_0x4b485e[_0x313705(0x53c,0x1306,0x5cd,0x1326)];const _0x1fbd85={};_0x1fbd85[_0x23937d(0x1b0c,0x2639,0x2740,0xe77)]=_0xe1d953+_0x313705(0x13d0,0x6b2,0x92d,0xa8e),_0x1fbd85['buttonText']=_0x4327b7,_0x1fbd85[_0x313705(0xa9e,0x228,0xb60,0x1674)]=0x1;let _0x4b3ec1=[_0x1fbd85];const _0x4c6d06={};_0x4c6d06[_0x313705(0x209f,0x2772,0x1f26,0x1ec6)]=_0x313705(0x578,0x1d5,0x86b,-0x213)+_0x313705(0x146f,0x1eb1,0x1b73,0xf45),_0x4c6d06[_0x23937d(0xc3a,0x123b,0x18c8,0xc08)]=_0x4b3ec1,_0x4c6d06['headerType']=0x4;let _0x18cfb8=_0x4c6d06;_0x175756['sendMessag'+'e'](_0x5cd288[_0x23937d(0x118c,0x17e4,0x6e3,0xcc4)],_0x18cfb8);}{if(_0x4b485e[_0x313705(0xdd8,0xa59,0x1c30,0x119)](_0x4b485e[_0x23937d(0x850,0xfa7,0x5e6,-0x6ca)],_0x4b485e[_0x313705(0x1de2,0x2aeb,0x2967,0x1a06)]))_0x4b485e['zIPrz'](_0x412d02,_0x2a8900[_0x313705(0x2116,0x1dc5,0x16a1,0x22e7)]);else{const _0x321255={};_0x321255['displayTex'+'t']=_0x4b485e['nwWlk'];const _0x2f18c2={};_0x2f18c2[_0x313705(0x1e72,0x282c,0x1e95,0x2c09)]=_0xe1d953+'mainmenu',_0x2f18c2[_0x23937d(0x159c,0xa05,0x813,0x23bd)]=_0x321255,_0x2f18c2[_0x313705(0xa9e,0x6b5,0x185c,0x532)]=0x1;const _0x1b989b={};_0x1b989b[_0x23937d(0x13f4,0x1449,0x17d7,0xccc)+'t']=_0x4b485e[_0x23937d(0xcb3,0xfe8,0x923,0xdf5)];const _0x34b87c={};_0x34b87c[_0x23937d(0x1b0c,0x1381,0x1e6f,0x1557)]=_0xe1d953+_0x313705(0x1b3e,0x240b,0x1a6f,0xdac),_0x34b87c[_0x23937d(0x159c,0x1cb6,0x7a7,0x1f6f)]=_0x1b989b,_0x34b87c[_0x23937d(0x738,0x97e,0x94c,0xa22)]=0x1;const _0x31da0e={};_0x31da0e[_0x23937d(0x13f4,0x19eb,0x1907,0x1911)+'t']=_0x4b485e[_0x23937d(0x1d60,0x14f5,0x1a6d,0x2c02)];const _0x56cc10={};_0x56cc10[_0x23937d(0x1b0c,0x1ea7,0x2853,0x2219)]=_0xe1d953+_0x23937d(0xd1a,0xd68,0x1218,-0x9a),_0x56cc10['buttonText']=_0x31da0e,_0x56cc10[_0x23937d(0x738,0x1159,0x12e0,0xf6f)]=0x1;let _0x41da3f=[_0x2f18c2,_0x34b87c,_0x56cc10];const _0x5b5fa3={};_0x5b5fa3[_0x23937d(0x1d39,0x1698,0x1521,0x13d1)]=_0x313705(0x20b5,0x2637,0x22f5,0x1f2a)+_0x313705(0x146f,0x619,0x1d5c,0x1099),_0x5b5fa3['buttons']=_0x41da3f,_0x5b5fa3[_0x23937d(0x1b19,0x2227,0x23e4,0x12be)]=0x4;let _0x8137ad=_0x5b5fa3;_0x175756[_0x313705(0xcaa,0x323,0x1553,0xf16)+'e'](_0x5cd288[_0x313705(0x14f2,0x1620,0x1b4c,0x1a20)],_0x8137ad);}}{if(_0x4b485e[_0x23937d(0xbfa,0x19dd,0x1916,0x549)](_0x4b485e[_0x313705(0x515,-0x56f,0x627,-0x8e2)],_0x4b485e['KNleo'])){const _0x3371fb={};_0x3371fb[_0x313705(0x175a,0x22ef,0x22f7,0x870)+'t']=_0x4b485e[_0x23937d(0x5fc,0x1335,-0x40b,0xccd)];const _0x247b06={};_0x247b06['buttonId']=_0xe1d953+('downloadme'+'nu'),_0x247b06[_0x23937d(0x159c,0x148d,0x1477,0xbc4)]=_0x3371fb,_0x247b06[_0x23937d(0x738,0x859,0x6e5,0x164e)]=0x1;const _0xc6dc1a={};_0xc6dc1a[_0x23937d(0x13f4,0xe6f,0xecf,0x1cf0)+'t']=_0x4b485e['dbrYw'];const _0x5f273d={};_0x5f273d[_0x313705(0x1e72,0x1c63,0x1622,0x1b2f)]=_0xe1d953+_0x23937d(0x13be,0x148f,0x1601,0x754),_0x5f273d[_0x313705(0x1902,0xfa3,0x1437,0x2170)]=_0xc6dc1a,_0x5f273d['type']=0x1;const _0x4ef67f={};_0x4ef67f[_0x313705(0x175a,0x9ad,0x146e,0x20c1)+'t']=_0x4b485e['ATulh'];const _0x5af38e={};_0x5af38e['buttonId']=_0xe1d953+_0x313705(0x159f,0x1b2f,0xb29,0x24a7),_0x5af38e['buttonText']=_0x4ef67f,_0x5af38e[_0x313705(0xa9e,0x126e,0x30d,0x1231)]=0x1;let _0x15db88=[_0x247b06,_0x5f273d,_0x5af38e];const _0x3f7669={};_0x3f7669[_0x313705(0x209f,0x183c,0x11b3,0x1753)]=_0x313705(0xf44,0x1b96,0x7e7,0xbdd)+'st\x20(1)\x20🪐',_0x3f7669[_0x23937d(0xc3a,0x242,0xdbe,0x1362)]=_0x15db88,_0x3f7669[_0x313705(0x1e7f,0x2728,0x1bf5,0x2027)]=0x4;let _0x53c8b0=_0x3f7669;_0x175756[_0x313705(0xcaa,0x194,0x54e,0xb03)+'e'](_0x5cd288['chat'],_0x53c8b0);}else{if(_0x19ef7e['dragonchat']===_0x4b485e['ndZFX'])return _0x1963dc(_0x313705(0xf7d,0x1152,0x1cee,0xfa));_0x27f7ff['dragonchat']=_0x4b485e[_0x23937d(0x237,0x327,0x366,-0xa95)],_0x4b485e[_0x313705(0xbc6,0x61,0x1676,0x1888)](_0x4fb835,_0x17b564['botname']+('\x20Chat\x20Bot\x20'+_0x313705(0x202a,0x2e50,0x1b0c,0x1778)));}}{const _0x5c5554={};_0x5c5554[_0x313705(0x175a,0x1640,0x25fd,0x126e)+'t']=_0x4b485e[_0x23937d(0x16a6,0x1f3b,0x251d,0x1e0c)];const _0x545ca5={};_0x545ca5['buttonId']=_0xe1d953+_0x313705(0x3d0,-0xa40,0x853,0x882),_0x545ca5[_0x313705(0x1902,0xe93,0x1518,0xe93)]=_0x5c5554,_0x545ca5[_0x313705(0xa9e,0x129f,-0x13b,0x17a5)]=0x1;const _0x5bd4db={};_0x5bd4db[_0x313705(0x175a,0x148a,0xbf6,0x8a3)+'t']=_0x313705(0x57c,0x148d,-0x381,-0x36e)+_0x23937d(0x1453,0x226b,0xb91,0x10c9);const _0x5cddef={};_0x5cddef[_0x23937d(0x1b0c,0x105e,0x1ec4,0x2a21)]=_0xe1d953+(_0x313705(0x14c4,0x1034,0xbaa,0xe3d)+_0x313705(0x1c9c,0x1621,0x1994,0x1117)),_0x5cddef['buttonText']=_0x5bd4db,_0x5cddef[_0x23937d(0x738,0x4fa,0x1bd,0x1495)]=0x1;const _0x2c2a8e={};_0x2c2a8e[_0x23937d(0x13f4,0x11ed,0xd66,0x1b49)+'t']=_0x4b485e[_0x23937d(0x4ab,-0x31,0x9d,0x5a2)];const _0x4e143f={};_0x4e143f[_0x23937d(0x1b0c,0x109f,0x267d,0xd11)]=_0xe1d953+_0x23937d(0x34,0x243,-0xe41,-0xc23),_0x4e143f[_0x23937d(0x159c,0x1811,0x1de9,0x80a)]=_0x2c2a8e,_0x4e143f[_0x23937d(0x738,0x14fc,0xc5f,0xc25)]=0x1;let _0x233515=[_0x545ca5,_0x5cddef,_0x4e143f];const _0x53bddd={};_0x53bddd[_0x23937d(0x1d39,0xf91,0x2b97,0x1803)]='🪐\x20Other\x20Li'+_0x23937d(0xed4,0x1b60,0x1200,0x1a10),_0x53bddd[_0x313705(0xfa0,0x102c,0x48d,0xc67)]=_0x233515,_0x53bddd['headerType']=0x4;let _0x1527d4=_0x53bddd;_0x175756[_0x23937d(0x944,0x4f5,0xfd3,0x64c)+'e'](_0x5cd288[_0x313705(0x14f2,0x1a86,0xa35,0x6fa)],_0x1527d4);}{const _0x361bc6={};_0x361bc6[_0x313705(0x175a,0xe13,0x1024,0xb59)+'t']=_0x4b485e['oxBNC'];const _0x194233={};_0x194233[_0x313705(0x1e72,0x1c7d,0x1d70,0x2b33)]=_0xe1d953+(_0x313705(0x15d3,0x1f95,0x1429,0x2358)+'u'),_0x194233[_0x23937d(0x159c,0x962,0x917,0x1e49)]=_0x361bc6,_0x194233[_0x313705(0xa9e,0x1b4,-0x5b,0x195a)]=0x1;const _0x3bd79e={};_0x3bd79e[_0x313705(0x175a,0x1c40,0x1c3a,0x1c42)+'t']=_0x4b485e['Bxbii'];const _0x3b6fd1={};_0x3b6fd1['buttonId']=_0xe1d953+('databaseme'+'nu'),_0x3b6fd1[_0x313705(0x1902,0x2008,0x242f,0x157b)]=_0x3bd79e,_0x3b6fd1[_0x23937d(0x738,0x1ff,0x2b3,0xd70)]=0x1;const _0x5e61b4={};_0x5e61b4[_0x23937d(0x13f4,0xd43,0x117d,0x1d24)+'t']=_0x4b485e[_0x313705(0x164e,0x21c3,0xc47,0xe53)];const _0x1f0d93={};_0x1f0d93[_0x23937d(0x1b0c,0x1325,0x1b29,0x20fb)]=_0xe1d953+(_0x23937d(0xb0e,0xe65,0x133e,-0x1c2)+_0x23937d(0x1e6,0xf0,0x502,-0x671)),_0x1f0d93[_0x23937d(0x159c,0x21b1,0x13fd,0x1121)]=_0x5e61b4,_0x1f0d93[_0x23937d(0x738,0x9ed,0x93a,-0x6ba)]=0x1;let _0x46db0e=[_0x194233,_0x3b6fd1,_0x1f0d93];const _0x17dc64={};_0x17dc64[_0x23937d(0x1d39,0x23fc,0x266d,0x1715)]=_0x313705(0xf44,0xd69,0xe1a,0x1913)+'st\x20(3)\x20🪐',_0x17dc64[_0x23937d(0xc3a,0xe34,0xae0,0x9e9)]=_0x46db0e,_0x17dc64['headerType']=0x4;let _0x1f6b14=_0x17dc64;_0x175756['sendMessag'+'e'](_0x5cd288[_0x313705(0x14f2,0x1f30,0x1a55,0x15b7)],_0x1f6b14);}{if(_0x4b485e[_0x23937d(0xc4a,0xb5f,0x337,0x1625)]!==_0x23937d(0x675,-0xdc,0x6cd,-0x6bf)){if(!_0x335edb[_0x313705(0xcfa,0x4e9,0x9f1,-0x61)]&&!_0x1afd7d[_0x23937d(0x484,-0x200,0x673,-0x98d)])_0x586c1b[_0x23937d(0x1574,0x1eb0,0xda1,0x2488)](_0x1d64ad['chat'],_0x313705(0x16b8,0xdd0,0x11fb,0xcea)+_0x23937d(0x355,-0x1e5,-0x129,0x437)+_0x313705(0x1192,0x1b4c,0x1c2d,0xb25)+_0x313705(0x1c11,0x233c,0x171d,0xe1a)+_0x23937d(0x16b,0x7fd,-0xc97,0x5b1));else(!_0x2758f7['pilih']||!_0x4b23bb[_0x23937d(0x484,-0x5e4,0xe9a,0x1133)])&&(_0x1d2c30=!_0x5811e1[_0x313705(0xcfa,0x6fd,0x19e6,0x1389)]?_0x5d6a4f['p2']:_0x4a1cf9['p'],_0x3fae17[_0x23937d(0x17c2,0x1b0b,0x19e2,0x13a3)+_0x23937d(0x1975,0x1ec2,0x10e2,0x2114)](_0x208201[_0x23937d(0x118c,0x542,0x5d2,0x1b57)],'@'+(_0x49b9eb[_0x313705(0xcfa,0x1a4a,0x1b1f,0x8c7)]?_0x16bccd['p2']:_0x1815e6['p'])[_0x313705(0x1035,0x352,0x1241,0x9c5)]`@`[0x29*-0x72+0x1ae8+-0x8a6]+(_0x313705(0xaac,0x18e7,0x1940,0x67c)+_0x313705(0x2069,0x2f5b,0x224a,0x127f)+_0x23937d(0x1a97,0x273e,0x1eda,0xdaf)+'!'),_0x3e84d0));return delete this[_0x313705(0x15fe,0xf3a,0x2499,0xc50)][_0x1f02c8['id']],!(0xa79*-0x3+-0x1e47+0x3db2*0x1);}else{const _0x2e9f08={};_0x2e9f08[_0x313705(0x175a,0xa9c,0x1c5d,0x20b2)+'t']=_0x4b485e['WHznO'];const _0x2ce63a={};_0x2ce63a[_0x23937d(0x1b0c,0x17bd,0x18c6,0x2003)]=_0xe1d953+(_0x23937d(0xc69,0x223,-0xf4,0x1a77)+'u'),_0x2ce63a[_0x313705(0x1902,0x10f6,0xb6a,0x2424)]=_0x2e9f08,_0x2ce63a[_0x313705(0xa9e,0x85a,0x599,0x1995)]=0x1;const _0x2ca503={};_0x2ca503[_0x23937d(0x13f4,0x174f,0xf21,0x1569)+'t']=_0x4b485e[_0x313705(0x1d1b,0x2bbc,0x2b31,0x2ba3)];const _0xe0c7e0={};_0xe0c7e0[_0x23937d(0x1b0c,0x18c0,0x29a7,0x18a2)]=_0xe1d953+(_0x23937d(0x1cbb,0x13f3,0x183c,0x28c5)+_0x23937d(0x1aad,0x14e5,0x2441,0x26bf)),_0xe0c7e0[_0x23937d(0x159c,0x73d,0x181d,0x1766)]=_0x2ca503,_0xe0c7e0[_0x23937d(0x738,-0x77e,0xd13,0xf35)]=0x1;let _0x3fe40c=[_0x2ce63a,_0xe0c7e0];const _0x12535e={};_0x12535e['text']=_0x313705(0xf44,0x23c,0x1c4b,0x1d3e)+'st\x20(4)\x20🪐',_0x12535e[_0x313705(0xfa0,0x1520,0x1d40,0x1883)]=_0x3fe40c,_0x12535e[_0x313705(0x1e7f,0x237d,0x1cf1,0x2a5f)]=0x4;let _0x5bce0c=_0x12535e;_0x175756[_0x23937d(0x944,0x9ed,0x1018,0xb1e)+'e'](_0x5cd288['chat'],_0x5bce0c);}}{if(_0x23937d(0x7b4,-0x12d,0x964,-0x393)===_0x4b485e[_0x313705(0x1c04,0x127b,0x2272,0xf5e)])return'Error!';else{const _0x24ed1b={};_0x24ed1b[_0x313705(0x175a,0x8e5,0x1406,0x101c)+'t']=_0x4b485e[_0x23937d(0x1d6c,0x2c87,0x18a4,0x260a)];const _0x5e4e68={};_0x5e4e68[_0x23937d(0x1b0c,0x2438,0x2a20,0x15dc)]=_0xe1d953+_0x23937d(0x242,-0x6a2,0xf50,-0x651),_0x5e4e68[_0x313705(0x1902,0x1322,0x143e,0x117c)]=_0x24ed1b,_0x5e4e68[_0x313705(0xa9e,0x183d,-0x6b,-0x2a0)]=0x1;let _0x54e6e5=[_0x5e4e68];const _0x1baec6={};_0x1baec6[_0x23937d(0x1d39,0x226b,0x1be8,0x2631)]=_0x313705(0x7cd,0x427,-0x49f,-0x1be)+'F\x20THE\x20BOT\x20'+'🪐',_0x1baec6['buttons']=_0x54e6e5,_0x1baec6[_0x313705(0x1e7f,0x2adb,0x169f,0x2af6)]=0x4;let _0x5cadbd=_0x1baec6;_0x175756['sendMessag'+'e'](_0x5cd288[_0x313705(0x14f2,0x1aaf,0x15b5,0xeea)],_0x5cadbd);}}}break;case _0x23937d(0xca,0x9b4,0x16f,-0x4a7):case _0x313705(0x1855,0x15a6,0x2614,0xe4f):case _0x4b485e[_0x313705(0x1095,0x7a2,0x31f,0x64a)]:case _0x4b485e['PQDrF']:{const _0x167675={};_0x167675[_0x23937d(0xa79,0x16f1,0x1077,0x12b5)]=_0x4b485e[_0x313705(0x372,-0x3f9,-0x7a,-0x16)],_0x175756['sendMessag'+'e'](_0x5cd288[_0x23937d(0x118c,0xf9f,0xe09,0x1565)],{'image':_0x167675,'caption':_0x313705(0x1aa3,0x249a,0x2511,0x1d8f)+_0x5cd288[_0x23937d(0x47c,0x1032,-0x363,0x35e)]+(_0x313705(0x1c9b,0x288e,0x2b6e,0x1822)+_0x313705(0x928,0xc57,-0x5b0,-0x424)+_0x23937d(0x9e3,-0xd,0x195,0xe61)+_0x23937d(0x5c8,0xea,0x94e,-0x356)+'\x20Dragon\x20Te'+'am*\x0aDon\x27t\x20'+_0x23937d(0x806,0x10bc,0x564,-0x142)+_0x313705(0x185e,0xed1,0x1a24,0x1703)+_0x23937d(0xf1a,0xf3b,0x13d7,0xd1d))},{'quoted':_0x5cd288});}break;case'sc':{_0x4b485e[_0x313705(0x892,0xd02,0x10b9,0x99b)](_0x1db05d,_0x313705(0x1ab9,0x1a2f,0xe62,0x161d)+_0x23937d(0x1bb2,0x1d9b,0x1b47,0x1fb5)+'hub.com/pr'+_0x313705(0x54d,0x12cd,0x117b,0xa42)+_0x313705(0xe1f,0x17a3,0x1d08,0xf87)+_0x313705(0x1d6a,0x2253,0x1f7f,0x12f4)+_0x23937d(0xd44,0x79,0x69b,0x9ed)+'ouTube\x20:\x20'+btnurl+(_0x313705(0x951,0x108c,0x34,-0x2f0)+'et\x20To\x20Watc'+_0x23937d(0x65c,-0x27b,-0x256,-0x1b4)));}break;case _0x4b485e[_0x23937d(0xe5a,0xc19,0x334,0x228)]:case'updates':case _0x4b485e[_0x313705(0x924,0x624,0x820,0x1117)]:case _0x4b485e[_0x23937d(0x689,-0x372,0xf22,0xfa3)]:{const _0x42fda1={};_0x42fda1[_0x313705(0x209f,0x213b,0x1924,0x1833)]='🔄',_0x42fda1[_0x23937d(0x94f,-0x3c8,0x154c,-0x4cd)]=_0x5cd288[_0x23937d(0x94f,0xc34,0x1226,-0x129)];const _0x3d4715={};_0x3d4715[_0x313705(0x1d20,0x1d47,0x231c,0x13a1)]=_0x42fda1,_0x175756[_0x23937d(0x944,0x7a7,0x21b,0x9f6)+'e'](_0x423161,_0x3d4715);const _0x1e717b={};_0x1e717b[_0x23937d(0x13f4,0xde9,0x2186,0x10f1)+'t']=_0x4b485e[_0x23937d(0x563,0x323,0x1127,0x1316)];const _0xa91c6a={};_0xa91c6a[_0x23937d(0x1b0c,0x1b90,0x190c,0x1745)]=_0xe1d953+_0x23937d(0x106a,0x890,0x2f6,0x1940),_0xa91c6a[_0x313705(0x1902,0xd24,0x1c95,0x26a8)]=_0x1e717b,_0xa91c6a[_0x23937d(0x738,-0x793,-0x305,0x707)]=0x1;const _0x33a55e={};_0x33a55e[_0x23937d(0x13f4,0x1817,0x8ff,0x22aa)+'t']=_0x23937d(0x199e,0x1f16,0xfc5,0x1e83);const _0x3f705e={};_0x3f705e[_0x23937d(0x1b0c,0x1321,0x1664,0x227b)]=_0xe1d953+_0x23937d(0xde0,0xce3,0x1a1c,0x14b9),_0x3f705e['buttonText']=_0x33a55e,_0x3f705e[_0x313705(0xa9e,0x14e8,-0x2ee,0x3d8)]=0x1;let _0x36be04=[_0xa91c6a,_0x3f705e];const _0x5c84d5={};_0x5c84d5[_0x23937d(0xa79,0x30c,0x16d4,0x4dc)]=_0x4b485e[_0x313705(0xc2e,0x7ae,0x1ab7,-0x2d)];const _0x16c508={};_0x16c508[_0x313705(0x1fa9,0x21cf,0x1287,0x1ec2)]=_0x5c84d5,_0x16c508[_0x313705(0xcce,0x15d7,0x77b,0x1d1)]=_0x23937d(0x1b0f,0x1a79,0xdbf,0x1031)+_0x313705(0xf40,0x95d,0x37,0xe8e)+'0*\x0a\x0acheck\x20'+_0x23937d(0x22d,-0x79e,0x80e,-0x827)+_0x313705(0x10a4,0x1fb0,0x55e,0x602)+_0x23937d(0x39c,0x11ff,-0x616,0xcb0)+_0x23937d(0x55e,-0x30e,-0x607,0xdbb)+_0x23937d(0x828,0x13d4,0x9f8,-0x151)+_0x23937d(0xc2e,0x2c8,0x110d,0x13b3)+'me',_0x16c508['footer']='[\x20◉\x20ʀᴇᴅ-ᴅʀ'+_0x313705(0x1d4a,0x2239,0x1721,0x2a8a),_0x16c508[_0x23937d(0xc3a,0x6bc,0xa98,0x72c)]=_0x36be04,_0x16c508[_0x313705(0x1e7f,0x12b0,0x14f9,0x13fa)]=0x4;let _0x4ea781=_0x16c508;_0x175756[_0x23937d(0x944,-0x449,0x138f,0x63c)+'e'](_0x5cd288[_0x313705(0x14f2,0x1114,0xbf7,0x2035)],_0x4ea781,{'quoted':_0x5cd288});}break;case _0x4b485e[_0x23937d(0x15d,-0xd4c,-0x62b,-0x14d)]:case _0x4b485e[_0x313705(0x19e2,0x1ebd,0x242a,0x193b)]:{const _0x4a6397={};_0x4a6397[_0x313705(0x209f,0x11d0,0x1dd9,0x2094)]=_0x23937d(0xe24,0x443,0xbd1,0xd8),_0x4a6397[_0x23937d(0x94f,0x16a8,0x1745,-0xb5)]=_0x5cd288[_0x23937d(0x94f,0x5b6,0xd85,0x49e)];const _0x2d1002={};_0x2d1002[_0x23937d(0x19ba,0x2665,0x15eb,0x10df)]=_0x4a6397,_0x175756[_0x23937d(0x944,0x1659,-0x1b1,-0x89)+'e'](_0x423161,_0x2d1002);const _0x51e77a={};_0x51e77a['displayTex'+'t']=_0x23937d(0x1656,0x2153,0x15b3,0xed0);const _0xb193f0={};_0xb193f0[_0x23937d(0x1b0c,0x221b,0x270c,0x10ef)]=_0xe1d953+_0x23937d(0xc84,0x185f,0x318,0x1a82),_0xb193f0[_0x23937d(0x159c,0xf14,0x247b,0xccb)]=_0x51e77a,_0xb193f0[_0x313705(0xa9e,0x18cb,0xec6,0xe9)]=0x1;const _0x21dd0d={};_0x21dd0d[_0x23937d(0x13f4,0x8e8,0x194a,0x1925)+'t']=_0x4b485e[_0x313705(0x87f,0xfe1,0xb3e,0x141f)];const _0x5abb52={};_0x5abb52[_0x23937d(0x1b0c,0xdda,0x1a29,0x2630)]=_0xe1d953+_0x313705(0x1146,0x426,0x114a,0x6ac),_0x5abb52[_0x313705(0x1902,0x123b,0xb40,0xddf)]=_0x21dd0d,_0x5abb52[_0x23937d(0x738,0x250,0x1654,0x550)]=0x1;let _0x4cd090=[_0xb193f0,_0x5abb52];const _0x54b3cf={};_0x54b3cf['url']='https://i.'+_0x23937d(0x74e,-0x166,-0x227,0x170)+_0x23937d(0x1cb1,0x22e7,0x1045,0x2974)+_0x313705(0xec8,0x1a8f,0x3a2,0x977)+'.jpg';const _0x1c7d43={};_0x1c7d43[_0x23937d(0x1c43,0x2203,0x1f27,0x10b9)]=_0x54b3cf,_0x1c7d43['caption']='Hello,\x20'+_0xa43395+_0x313705(0x55e,0x1366,-0x1e3,0x1266)+botname+(_0x23937d(0x1366,0x1af9,0x1a09,0x113f)+_0x23937d(0x1daa,0x1956,0x29c2,0x13fb)+'════╗\x0a┃║\x0a┃'+'╠')+dragonemoji+'\x20'+_0xe1d953+(_0x313705(0xb2c,0x1075,0x146f,0x23c)+_0x23937d(0x1a6a,0x1590,0x11bb,0x1689)+'?)\x0a┃╠')+dragonemoji+'\x20'+_0xe1d953+(_0x23937d(0xec4,0x1152,0x12d0,0xfc8)+_0x313705(0x3ec,0x2ba,0x8f9,-0x311)+_0x313705(0x15aa,0xf12,0x1d2c,0x1140))+dragonemoji+'\x20'+_0xe1d953+(_0x313705(0x8f9,0x5a8,0x10ac,0x1334)+_0x313705(0x3f7,-0x465,0x512,-0x45a)+_0x23937d(0x19b3,0x2312,0xd9a,0x1d46))+dragonemoji+'\x20'+_0xe1d953+_0x313705(0xa97,-0x3c0,0x1856,-0x2f3)+dragonemoji+'\x20'+_0xe1d953+_0x23937d(0x6a5,0xc69,-0x5ea,0x10a4)+dragonemoji+'\x20'+_0xe1d953+(_0x23937d(0x40c,-0x6e1,0x41a,0x11c7)+'┃╠')+dragonemoji+'\x20'+_0xe1d953+_0x313705(0x169c,0x7f7,0x7cd,0x1caf)+dragonemoji+'\x20'+_0xe1d953+_0x23937d(0xbef,-0x1b3,0x177,-0x2e4)+dragonemoji+'\x20'+_0xe1d953+_0x23937d(0x100d,0x1cdc,0x927,0x1731)+dragonemoji+'\x20'+_0xe1d953+'delete\x0a┃╠'+dragonemoji+'\x20'+_0xe1d953+('chatinfo\x0a┃'+'╠')+dragonemoji+'\x20'+_0xe1d953+_0x313705(0x862,0xcf2,0x9f7,0x49e)+dragonemoji+'\x20'+_0xe1d953+_0x23937d(0x54f,0x123e,0x2d5,0xd7f)+dragonemoji+'\x20'+_0xe1d953+(_0x23937d(0x516,0x8ff,0x5f0,0x957)+_0x23937d(0x696,0x1293,0x1cc,-0x727))+dragonemoji+'\x20'+_0xe1d953+(_0x313705(0x20fe,0x218e,0x2d13,0x1efb)+_0x23937d(0x1d8e,0x2255,0x1920,0x15a8)+'xt]\x0a┃╠')+dragonemoji+'\x20'+_0xe1d953+('textrepeat'+_0x313705(0x1ff9,0x262f,0x10f1,0x1aa2)+_0x23937d(0x47b,0x50b,0xad4,0x1186)+_0x313705(0x1846,0x1d0d,0x152f,0x1e5f)+'══════\x0a┃╔═'+_0x313705(0x1a82,0xdb4,0x2823,0x246b)+_0x313705(0x1bc0,0x1b15,0x19cb,0x2a53)+_0x313705(0x46b,-0xaad,0x60b,0x8af))+dragonemoji+'\x20'+_0xe1d953+('alivepic\x20['+_0x23937d(0x24e,0x4fb,0xe45,-0x3db)+_0x23937d(0x105,-0x9dc,-0xd72,-0xdac))+dragonemoji+'\x20'+_0xe1d953+(_0x23937d(0x142a,0x1a0d,0x1c6b,0x1645)+_0x23937d(0x13d1,0x905,0x1bf1,0x632))+dragonemoji+'\x20'+_0xe1d953+('upsongvn\x20['+_0x23937d(0x10f3,0x1e07,0xea8,0x1fbc))+dragonemoji+'\x20'+_0xe1d953+(_0x313705(0x33f,0x683,-0x5e6,0x397)+_0x23937d(0x10f3,0x1170,0x1ed9,0xe16))+dragonemoji+'\x20'+_0xe1d953+(_0x313705(0xae9,-0x16a,0xc7c,0x954)+_0x313705(0x6ba,0xe58,0x436,0x479))+dragonemoji+'\x20'+_0xe1d953+(_0x313705(0xf2d,0x10b9,0x1352,0x1dcd)+_0x313705(0x7d2,0x1249,0xa6f,-0x305))+dragonemoji+'\x20'+_0xe1d953+('chat\x20[opti'+_0x313705(0x1fd5,0x21ed,0x22fb,0x2590))+dragonemoji+'\x20'+_0xe1d953+(_0x313705(0x18c9,0xf1f,0x25d7,0x1d2f)+']\x0a┃╠')+dragonemoji+'\x20'+_0xe1d953+_0x313705(0x113e,0x258,0x474,0x1a42)+dragonemoji+'\x20'+_0xe1d953+(_0x23937d(0x313,-0xbc2,-0xba9,-0xae7)+_0x23937d(0x13bb,0xdcc,0x1569,0x11aa))+dragonemoji+'\x20'+_0xe1d953+('unblock\x20[u'+_0x23937d(0x18f,-0x6ac,0x777,-0x1fd))+dragonemoji+'\x20'+_0xe1d953+('bcgroup\x20[t'+_0x313705(0x6ba,-0x44,0x852,0xa2a))+dragonemoji+'\x20'+_0xe1d953+(_0x313705(0xcbb,0x19da,0xac,0xf2f)+_0x313705(0xd67,-0xf,0xe55,0x1803))+dragonemoji+'\x20'+_0xe1d953+(_0x313705(0x14f9,0x1324,0x14e9,0x8df)+_0x313705(0xf75,0xd84,0x678,0x1432))+dragonemoji+'\x20'+_0xe1d953+_0x23937d(0x9b8,0x139d,0xa5,0x7a1)+dragonemoji+'\x20'+_0xe1d953+('chatbot\x20[o'+'n/off]\x0a┃╚═'+'══════════'+'═══════\x0a┃╔'+_0x313705(0x1b4f,0x1733,0x238a,0x10b1)+_0x23937d(0xd8e,0xeca,0x1a37,0x13c2)+'\x0a┃║\x20\x20\x20\x0a┃╠')+dragonemoji+'\x20'+_0xe1d953+(_0x23937d(0x1bcc,0x1656,0xd03,0x2865)+'┃╠')+dragonemoji+'\x20'+_0xe1d953+(_0x23937d(0x1c62,0x2b7d,0x1266,0x2005)+_0x313705(0x2005,0x132a,0x286a,0x15c7))+dragonemoji+'\x20'+_0xe1d953+(_0x313705(0x216e,0x13b2,0x2b9c,0x2323)+_0x313705(0x1459,0x656,0x1782,0x7f0))+dragonemoji+'\x20'+_0xe1d953+('ephemeral\x20'+_0x23937d(0x13e,-0x1ac,0xd5e,-0xc90)+'╠')+dragonemoji+'\x20'+_0xe1d953+(_0x313705(0x596,0x10b6,-0x6ce,-0x4c7)+_0x23937d(0x173,-0x577,-0x3dd,-0x48c))+dragonemoji+'\x20'+_0xe1d953+(_0x23937d(0x1cb3,0x1d23,0x173d,0x1b2b)+_0x313705(0x6ba,0x13f4,0x53c,0xce))+dragonemoji+'\x20'+_0xe1d953+(_0x23937d(0xf55,0x1685,0x297,0x85d)+_0x23937d(0x354,0xc02,0xb53,-0x91b))+dragonemoji+'\x20'+_0xe1d953+(_0x23937d(0x13e2,0x1526,0x2227,0x5f0)+'option]\x0a┃╠')+dragonemoji+'\x20'+_0xe1d953+(_0x23937d(0xd4d,-0xd1,0x940,0x1221)+_0x23937d(0x105,-0xc41,0x47d,0xea5))+dragonemoji+'\x20'+_0xe1d953+(_0x313705(0x9a0,0x1866,0xf99,0x1b0)+'y/tag]\x0a┃╠')+dragonemoji+'\x20'+_0xe1d953+('hidetag\x20[t'+_0x313705(0x6ba,0xee3,0x13f0,0x8bc))+dragonemoji+'\x20'+_0xe1d953+(_0x313705(0x757,0x471,-0x5d0,-0x1e7)+_0x23937d(0x18ba,0x1284,0x1b45,0x1e48))+dragonemoji+'\x20'+_0xe1d953+(_0x23937d(0x115a,0x1c88,0x2035,0xd9d)+_0x23937d(0x1373,0x2057,0x1bab,0x575))+dragonemoji+'\x20'+_0xe1d953+(_0x23937d(0x1aee,0x1d34,0x226a,0x1b45)+_0x23937d(0x8dd,-0x4c2,-0x50b,0x170c)+'┃╠')+dragonemoji+'\x20'+_0xe1d953+(_0x23937d(0x639,-0x5e7,0x4d3,0xdbb)+_0x313705(0x184a,0x254a,0x16d6,0x1303)+'╠')+dragonemoji+'\x20'+_0xe1d953+_0x313705(0x206f,0x229f,0x134f,0x289c)+dragonemoji+'\x20'+_0xe1d953+_0x23937d(0x836,0x4a9,-0x271,-0x6db)+dragonemoji+'\x20'+_0xe1d953+_0x313705(0x194f,0x1f40,0x166c,0xaa2)+dragonemoji+'\x20'+_0xe1d953+('checkvote\x0a'+'┃╠')+dragonemoji+'\x20'+_0xe1d953+('delvote\x0a┃╚'+_0x313705(0x1846,0x1b89,0x1bc1,0x22fb)+_0x23937d(0x129a,0x1710,0x10b7,0xdc2)+'╔════💠\x20TEX'+_0x313705(0x16f1,0x153b,0xcd5,0x1107)+_0x23937d(0xc1c,0x1763,0x7f9,0xe28)+'\x20\x20\x20\x0a┃╠')+dragonemoji+'\x20'+_0xe1d953+(_0x23937d(0x422,-0x4d3,0x123d,0x685)+_0x313705(0x153e,0x2092,0xa74,0x18c6))+dragonemoji+'\x20'+_0xe1d953+(_0x313705(0xe02,0x1d18,0x185d,0xe09)+_0x23937d(0x17fa,0x1907,0x1e64,0x26ea))+dragonemoji+'\x20'+_0xe1d953+(_0x313705(0x1f8b,0x151d,0x154f,0x169a)+_0x313705(0x5bd,0xc0c,0x99c,-0x63d))+dragonemoji+'\x20'+_0xe1d953+('sparklechr'+_0x23937d(0xf6b,0xc75,0xd30,0x18f4)+_0x23937d(0xa01,0x16e6,-0x3a6,0xa8d))+dragonemoji+'\x20'+_0xe1d953+('deepsea\x20[t'+_0x313705(0x1c20,0x19dc,0x105f,0x1061))+dragonemoji+'\x20'+_0xe1d953+(_0x313705(0x1d45,0x1793,0x2309,0x13ed)+_0x313705(0x153e,0x633,0x8d0,0x1e80))+dragonemoji+'\x20'+_0xe1d953+('rainbow\x20[t'+_0x313705(0x1c20,0x1bf8,0x15bd,0x1bfc))+dragonemoji+'\x20'+_0xe1d953+(_0x313705(0x1165,0x1f64,0xc7d,0xd0b)+_0x23937d(0x257,0xbef,-0x417,0x2f3))+dragonemoji+'\x20'+_0xe1d953+('spooky\x20[tx'+_0x313705(0xd67,0x7ab,0x188d,0xcac))+dragonemoji+'\x20'+_0xe1d953+('pencil\x20[tx'+_0x23937d(0xa01,-0x476,-0x234,0xf8d))+dragonemoji+'\x20'+_0xe1d953+('circuit\x20[t'+'xt]\x0a┃╠')+dragonemoji+'\x20'+_0xe1d953+('discovery\x20'+_0x23937d(0x257,-0xa,0xae7,-0x4c8))+dragonemoji+'\x20'+_0xe1d953+('metalic\x20[t'+_0x313705(0x1c20,0x289b,0x1f04,0x1845))+dragonemoji+'\x20'+_0xe1d953+(_0x23937d(0x961,0x1750,0x16cd,0x11bd)+'xt]\x0a┃╠')+dragonemoji+'\x20'+_0xe1d953+('demon\x20[txt'+']\x0a┃╠')+dragonemoji+'\x20'+_0xe1d953+(_0x23937d(0x15a1,0x1993,0x73d,0x2356)+'r\x20[txt]\x0a┃╠')+dragonemoji+'\x20'+_0xe1d953+(_0x313705(0x1ac0,0x179f,0x1d34,0x1da2)+_0x23937d(0x11d8,0xe85,0x647,0x5c0))+dragonemoji+'\x20'+_0xe1d953+(_0x313705(0xe2a,0x47,0x124c,0x138a)+_0x23937d(0x18ba,0x16fc,0x19a5,0x19f4))+dragonemoji+'\x20'+_0xe1d953+(_0x23937d(0x383,0xf8f,-0x68d,0x437)+_0x23937d(0x11d8,0x182b,0x1d3f,0x448))+dragonemoji+'\x20'+_0xe1d953+(_0x313705(0x1e43,0x2aec,0x174e,0x2986)+_0x23937d(0x18ba,0xbed,0x25ab,0x2173))+dragonemoji+'\x20'+_0xe1d953+('neonlight\x20'+'[txt]\x0a┃╠')+dragonemoji+'\x20'+_0xe1d953+(_0x23937d(0x19cb,0x2417,0x205e,0x11fd)+'t]\x0a┃╠')+dragonemoji+'\x20'+_0xe1d953+(_0x313705(0x1b6a,0x2536,0x1703,0x192c)+_0x313705(0x1a2a,0x2861,0x1eec,0x2185))+dragonemoji+'\x20'+_0xe1d953+(_0x313705(0x927,0x1682,0x7a,0xcae)+_0x313705(0x1b60,0x1dfe,0x106c,0x260b))+dragonemoji+'\x20'+_0xe1d953+(_0x23937d(0xb5c,0x7fd,0x51a,0xf40)+_0x23937d(0x5f9,-0x4f9,-0x832,-0x371))+dragonemoji+'\x20'+_0xe1d953+(_0x23937d(0x235,0xdf9,0xe77,0x1129)+'\x20[txt]\x0a┃╠')+dragonemoji+'\x20'+_0xe1d953+('multicolor'+_0x313705(0x1a53,0x12a7,0x256a,0x1b35))+dragonemoji+'\x20'+_0xe1d953+(_0x313705(0x620,0x800,-0x7f7,-0x5a2)+'[txt]\x0a┃╠')+dragonemoji+'\x20'+_0xe1d953+('underwater'+_0x313705(0x1a53,0x13bc,0x1ba8,0xb4b))+dragonemoji+'\x20'+_0xe1d953+(_0x313705(0x9cd,0x1245,-0x2cb,0x1ed)+'ke\x20[txt]\x0a┃'+'╠')+dragonemoji+'\x20'+_0xe1d953+(_0x313705(0x15b0,0x20b3,0x1e7e,0x2347)+_0x23937d(0x105,0x6df,0xc95,0x9a5))+dragonemoji+'\x20'+_0xe1d953+(_0x23937d(0x643,-0x22,0x254,0x13c5)+']\x0a┃╠')+dragonemoji+'\x20'+_0xe1d953+('honey\x20[txt'+']\x0a┃╠')+dragonemoji+'\x20'+_0xe1d953+('ice\x20[txt]\x0a'+'┃╠')+dragonemoji+'\x20'+_0xe1d953+('fruitjuice'+'\x20[txt]\x0a┃╠')+dragonemoji+'\x20'+_0xe1d953+(_0x313705(0x8c2,0x991,0x160e,-0x52)+_0x23937d(0x18ba,0x213a,0x2168,0x1c4f))+dragonemoji+'\x20'+_0xe1d953+(_0x313705(0x1266,0x1888,0x180a,0x1a5c)+_0x313705(0x46b,0x123b,-0x137,0x1169))+dragonemoji+'\x20'+_0xe1d953+(_0x23937d(0x15bc,0x18f1,0x1181,0x1704)+'[txt]\x0a┃╠')+dragonemoji+'\x20'+_0xe1d953+(_0x313705(0x20c5,0x1490,0x19ff,0x162f)+_0x313705(0x1a53,0x249e,0xc1c,0x2396))+dragonemoji+'\x20'+_0xe1d953+('matrix\x20[tx'+_0x313705(0xd67,0x10c6,0x145c,0x1393))+dragonemoji+'\x20'+_0xe1d953+(_0x23937d(0x256,-0x17c,0x647,0xdf3)+']\x0a┃╠')+dragonemoji+'\x20'+_0xe1d953+('dropwater\x20'+_0x313705(0x5bd,0x8ec,0xa85,0x8c4))+dragonemoji+'\x20'+_0xe1d953+(_0x313705(0xf8c,0x1af9,0x992,0xe74)+']\x0a┃╠')+dragonemoji+'\x20'+_0xe1d953+(_0x313705(0x905,0x1b3,0x636,0x9d0)+_0x313705(0x46b,0x577,-0x14c,0xde0))+dragonemoji+'\x20'+_0xe1d953+(_0x23937d(0x1564,0xb70,0x1b21,0x23da)+'\x0a┃╠')+dragonemoji+'\x20'+_0xe1d953+(_0x23937d(0x1633,0x2370,0x2498,0x116a)+'[txt]\x0a┃╠')+dragonemoji+'\x20'+_0xe1d953+(_0x313705(0x344,0xbea,0x11ea,0x87)+'txt]\x0a┃╠')+dragonemoji+'\x20'+_0xe1d953+(_0x23937d(0x5d,0xda3,-0x934,0x757)+'txt]\x0a┃╠')+dragonemoji+'\x20'+_0xe1d953+(_0x313705(0x780,0x9e0,0x13ef,-0x667)+_0x313705(0x153e,0x11bb,0xc9c,0xd2b))+dragonemoji+'\x20'+_0xe1d953+(_0x313705(0x847,0x14f3,0xd7d,0x11a6)+_0x23937d(0xa01,0x14fc,0x1346,0x654))+dragonemoji+'\x20'+_0xe1d953+(_0x313705(0x1d06,0x1a99,0xe4b,0x2780)+'txt]\x0a┃╠')+dragonemoji+'\x20'+_0xe1d953+(_0x313705(0x1b74,0x221f,0x18a8,0x1b72)+_0x313705(0x95f,-0x445,0x1083,-0x23a))+dragonemoji+'\x20'+_0xe1d953+(_0x23937d(0x190a,0x1a07,0x1210,0x202d)+'[txt]\x0a┃╠')+dragonemoji+'\x20'+_0xe1d953+(_0x313705(0xc26,0x1450,0x715,0x1ab1)+_0x313705(0x46b,0x6f1,0x7a8,0x130e))+dragonemoji+'\x20'+_0xe1d953+(_0x23937d(0x1113,0x18a8,0x12ab,0x743)+_0x23937d(0x105,0xf60,0x514,0x3))+dragonemoji+'\x20'+_0xe1d953+(_0x23937d(0x119c,0x908,0x1990,0x422)+'\x0a┃╠')+dragonemoji+'\x20'+_0xe1d953+(_0x313705(0x15c9,0x6fd,0x1857,0x1f6f)+_0x23937d(0x13d7,0x66f,0x974,0x1973)+_0x313705(0x1846,0xa20,0xbd0,0x1cc8)+_0x23937d(0xb0b,0x1969,0xbe,0x82a)+_0x313705(0x1d74,0x1d7c,0x2c8d,0x2bf7)+_0x23937d(0x1989,0x15fb,0x18ca,0x13e0))+dragonemoji+'\x20'+_0xe1d953+_0x313705(0xc34,0xa62,0x162a,0x8e2)+dragonemoji+'\x20'+_0xe1d953+_0x23937d(0x11b0,0xbe0,0x111b,0xa3e)+dragonemoji+'\x20'+_0xe1d953+_0x313705(0x1e18,0x100e,0x26d7,0x2806)+dragonemoji+'\x20'+_0xe1d953+('userlimit\x0a'+'┃╠')+dragonemoji+'\x20'+_0xe1d953+'profile\x0a┃╠'+dragonemoji+'\x20'+_0xe1d953+(_0x23937d(0x68a,0xb43,0x1222,0xfa5)+'┃╠')+dragonemoji+'\x20'+_0xe1d953+(_0x313705(0x20bf,0x1d97,0x1572,0x188f)+_0x23937d(0xe05,0x1514,0x6aa,0x110f))+dragonemoji+'\x20'+_0xe1d953+(_0x23937d(0x1a58,0x2852,0x2761,0x1890)+_0x23937d(0x13ee,0x8dd,0x7c2,0xa1d))+dragonemoji+'\x20'+_0xe1d953+('sell\x20[opti'+'on]\x0a┃╚════'+_0x313705(0x1846,0x22d1,0x1be9,0x1035)+_0x23937d(0xfdd,0xa01,0x187,0x62d)+_0x23937d(0x897,0xd9c,-0x360,0x8a0)+_0x23937d(0x11,0x5c0,0x85d,0xac8)+_0x23937d(0xcec,0x1718,0x11de,0xbfa))+dragonemoji+'\x20'+_0xe1d953+('ytmp3\x20[url'+']\x0a┃╠')+dragonemoji+'\x20'+_0xe1d953+('ytmp4\x20[url'+']\x0a┃╠')+dragonemoji+'\x20'+_0xe1d953+(_0x23937d(0x4c8,-0x1d5,0x404,-0x620)+_0x23937d(0x11d8,0x6b6,0x20bb,0x93c))+dragonemoji+'\x20'+_0xe1d953+(_0x23937d(0x1075,0x1d00,0x8da,0x9a9)+_0x313705(0x1860,0x1971,0x1f4b,0x94f))+dragonemoji+'\x20'+_0xe1d953+(_0x313705(0x19dd,0x21c9,0xcd2,0x16c8)+_0x23937d(0x1384,0x1916,0x7b3,0x2071))+dragonemoji+'\x20'+_0xe1d953+(_0x23937d(0x7e8,0x14c3,-0xb,-0x698)+'╠')+dragonemoji+'\x20'+_0xe1d953+(_0x313705(0x198c,0x287b,0x1911,0x28a2)+_0x313705(0xe9e,0xf59,0x1109,0x82))+dragonemoji+'\x20'+_0xe1d953+(_0x313705(0x212b,0x2e1f,0x19e7,0x1245)+_0x23937d(0xd41,0x1814,0x119f,0xabf))+dragonemoji+'\x20'+_0xe1d953+(_0x23937d(0x1857,0x2190,0x1b53,0x189a)+_0x23937d(0xd41,0x161d,0x1700,-0xd2))+dragonemoji+'\x20'+_0xe1d953+(_0x23937d(0x1432,0x1a01,0x1bf9,0x131b)+'\x20[url]\x0a┃╠')+dragonemoji+'\x20'+_0xe1d953+(_0x313705(0x65e,-0x2d3,-0x1b1,-0x7d7)+_0x313705(0x18f5,0xb14,0x1603,0x2339)+_0x23937d(0x14e0,0x7cc,0x7e0,0x1c7a)+_0x313705(0x1343,0xc7b,0x1386,0x773)+_0x313705(0xed6,0xb23,0x5d1,0x105c)+_0x313705(0x1b38,0x227e,0x20f7,0x1b74)+'┃╠')+dragonemoji+'\x20'+_0xe1d953+(_0x313705(0x1538,0x18d7,0x1c64,0x1a68)+_0x313705(0x10a7,0x1f92,0x573,0xe62))+dragonemoji+'\x20'+_0xe1d953+(_0x313705(0x663,0x7a6,-0x54a,0xa1f)+_0x313705(0x10a7,0x820,0x1853,0x9aa))+dragonemoji+'\x20'+_0xe1d953+(_0x23937d(0xbd4,0x4e,0x10bd,0x10ea)+_0x313705(0x153e,0x2121,0x160f,0x1d7b))+dragonemoji+'\x20'+_0xe1d953+(_0x313705(0x201e,0x17ea,0x2d24,0x1a45)+'ery]\x0a┃╠')+dragonemoji+'\x20'+_0xe1d953+(_0x313705(0x87d,-0x58a,0xdd8,0xf18)+'ery]\x0a┃╠')+dragonemoji+'\x20'+_0xe1d953+(_0x313705(0x10fb,0x1061,0xc9d,0x1bf7)+_0x23937d(0x1771,0x119f,0x19c0,0x2480))+dragonemoji+'\x20'+_0xe1d953+(_0x23937d(0x1b4f,0x2169,0x21d3,0x133b)+_0x23937d(0x1771,0x21ef,0xf67,0x2097))+dragonemoji+'\x20'+_0xe1d953+('wikimedia\x20'+_0x23937d(0x1771,0xd49,0x2222,0xfdc))+dragonemoji+'\x20'+_0xe1d953+('ytsearch\x20['+_0x23937d(0x238,0x91,0xd80,-0xa06))+dragonemoji+'\x20'+_0xe1d953+(_0x313705(0xdbe,0x1b19,-0x1b,0xd4e)+_0x313705(0x59e,0x36d,-0x432,0xd5f))+dragonemoji+'\x20'+_0xe1d953+('webtoon\x20[q'+'uery]\x0a┃╚══'+_0x313705(0x1846,0xb4d,0xe42,0x187b)+_0x23937d(0xaf1,0xdc,0x1748,0x1804)+'════💠\x20RAND'+_0x23937d(0xf2d,0xda4,0x1cbc,0x518)+'┃║\x0a┃╠')+dragonemoji+'\x20'+_0xe1d953+_0x313705(0x20cf,0x2900,0x2922,0x1d1e)+dragonemoji+'\x20'+_0xe1d953+(_0x313705(0x12be,0x1c74,0x12c2,0x1504)+_0x23937d(0x796,0x797,0x12e8,0xca8))+dragonemoji+'\x20'+_0xe1d953+(_0x313705(0x537,-0x8c7,0x92f,0x1216)+_0x313705(0x6a5,0xd4b,0xb76,-0x42d)+_0x23937d(0xa9,0xe77,0xe42,0xc3)+_0x313705(0x52f,-0x658,0xccc,0x13b)+_0x23937d(0x9e4,0xbad,0x71e,0x11a0)+'\x0a┃║\x0a┃╠')+dragonemoji+'\x20'+_0xe1d953+_0x23937d(0x4cc,0xad4,0x101b,-0x55)+dragonemoji+'\x20'+_0xe1d953+_0x313705(0x4e5,0xdb5,-0x28a,0x11ea)+dragonemoji+'\x20'+_0xe1d953+'cuddle\x0a┃╠'+dragonemoji+'\x20'+_0xe1d953+_0x313705(0x1491,0x142a,0x1b87,0x239b)+dragonemoji+'\x20'+_0xe1d953+'hug\x0a┃╠'+dragonemoji+'\x20'+_0xe1d953+_0x23937d(0x8b5,-0x5c1,0x4c9,0x3d5)+dragonemoji+'\x20'+_0xe1d953+_0x23937d(0x1b09,0x2840,0x14e5,0x2709)+dragonemoji+'\x20'+_0xe1d953+_0x313705(0x1495,0x10ff,0xdc1,0xb7d)+dragonemoji+'\x20'+_0xe1d953+_0x23937d(0x10de,0x13e2,0xc9d,0xc9c)+dragonemoji+'\x20'+_0xe1d953+_0x23937d(0xc4,-0x4cf,-0x9d3,0xa4b)+dragonemoji+'\x20'+_0xe1d953+_0x23937d(0x1a85,0x11f8,0x1923,0x17b7)+dragonemoji+'\x20'+_0xe1d953+_0x313705(0xa63,-0x51,0xbed,0x1718)+dragonemoji+'\x20'+_0xe1d953+'blush\x0a┃╠'+dragonemoji+'\x20'+_0xe1d953+_0x23937d(0xb3,-0x957,-0x2b,0xfd2)+dragonemoji+'\x20'+_0xe1d953+_0x313705(0x5fa,0x2c0,0x36f,-0x191)+dragonemoji+'\x20'+_0xe1d953+(_0x23937d(0x167f,0x1884,0x9e4,0x117e)+'╠')+dragonemoji+'\x20'+_0xe1d953+(_0x313705(0x174c,0x1ae0,0x14f4,0x230c)+'╠')+dragonemoji+'\x20'+_0xe1d953+_0x313705(0x3de,0x939,-0x450,0xf6a)+dragonemoji+'\x20'+_0xe1d953+_0x23937d(0x16c6,0x91f,0x1c22,0xc49)+dragonemoji+'\x20'+_0xe1d953+_0x313705(0x46a,-0x5c4,0x74a,-0x5bb)+dragonemoji+'\x20'+_0xe1d953+_0x23937d(0x1583,0x1a89,0x78e,0x10f2)+dragonemoji+'\x20'+_0xe1d953+'kill\x0a┃╠'+dragonemoji+'\x20'+_0xe1d953+_0x23937d(0x85a,0x1e5,0xe94,0xf1d)+dragonemoji+'\x20'+_0xe1d953+_0x313705(0x174a,0xe91,0xf0f,0xc07)+dragonemoji+'\x20'+_0xe1d953+_0x313705(0x1771,0xb00,0x2680,0x877)+dragonemoji+'\x20'+_0xe1d953+'dance\x0a┃╠'+dragonemoji+'\x20'+_0xe1d953+('cringe\x0a┃╚═'+_0x23937d(0x14e0,0x13fd,0x232c,0x1739)+'═══════\x0a┃╔'+'════💠\x20FUN\x20'+_0x313705(0x1b38,0x18b8,0x14aa,0xed1)+'┃╠')+dragonemoji+'\x20'+_0xe1d953+('how\x20[text]'+'\x0a┃╠')+dragonemoji+'\x20'+_0xe1d953+('when\x20[text'+_0x23937d(0x11d8,0x990,0x1502,0x1d03))+dragonemoji+'\x20'+_0xe1d953+(_0x23937d(0x1995,0x1f25,0x1579,0x11e0)+'┃╠')+dragonemoji+'\x20'+_0xe1d953+(_0x23937d(0x849,0x759,-0x119,0xd7b)+_0x23937d(0x11d8,0x1083,0x1f5c,0x1fa7))+dragonemoji+'\x20'+_0xe1d953+(_0x313705(0x13bd,0x2064,0xfaf,0x108e)+'\x0a┃╠')+dragonemoji+'\x20'+_0xe1d953+(_0x313705(0x1a8d,0x24ab,0x1c3c,0xf49)+_0x313705(0x153e,0x1573,0x19db,0x1da8))+dragonemoji+'\x20'+_0xe1d953+(_0x313705(0xcc4,0x15e8,0x9da,0xfac)+'t]\x0a┃╠')+dragonemoji+'\x20'+_0xe1d953+(_0x313705(0x1760,0x1777,0x1e5a,0x174f)+_0x23937d(0xa29,0xc29,0x1e9,0x213)+_0x313705(0x46b,0x44c,-0x59a,0xc4f))+dragonemoji+'\x20'+_0xe1d953+(_0x313705(0x9de,-0x19,-0x3d5,0xc5e)+_0x313705(0x13fb,0x8a5,0x13ac,0x212e)+'╠')+dragonemoji+'\x20'+_0xe1d953+(_0x313705(0x14ac,0x1501,0x109f,0x1335)+_0x313705(0xf51,0xcfb,0x67f,0x9c7))+dragonemoji+'\x20'+_0xe1d953+(_0x23937d(0x11c2,0xe36,0x31d,0x1821)+_0x23937d(0x1095,0x19d3,0xefa,0x778)+'╠')+dragonemoji+'\x20'+_0xe1d953+(_0x313705(0x13ce,0x1ea9,0x2266,0x10cf)+_0x313705(0x1587,0xa45,0x2409,0x12d8))+dragonemoji+'\x20'+_0xe1d953+(_0x23937d(0x14da,0xa84,0x680,0xdd3)+_0x23937d(0xbe0,0xe12,0xad2,0x199c))+dragonemoji+'\x20'+_0xe1d953+('uglycheck\x20'+'[tag]\x0a┃╠')+dragonemoji+'\x20'+_0xe1d953+('hornycheck'+_0x23937d(0x11ec,0xc29,0x1d28,0x7dc))+dragonemoji+'\x20'+_0xe1d953+(_0x313705(0xdf1,0x1242,0x22f,0x18e4)+_0x313705(0xd8f,0x8c2,0x10bc,0xae2)+'\x0a┃╠')+dragonemoji+'\x20'+_0xe1d953+(_0x23937d(0x914,0xfd,-0x468,0x1384)+_0x313705(0xf51,0x2d6,0x1b7f,0x1164))+dragonemoji+'\x20'+_0xe1d953+_0x23937d(0x168f,0x15ba,0x1ad5,0x187b)+dragonemoji+'\x20'+_0xe1d953+(_0x23937d(0x1608,0xc8a,0x1629,0xb5a)+_0x313705(0x46b,-0x539,0x501,-0x508))+dragonemoji+'\x20'+_0xe1d953+_0x23937d(0x19b2,0x1b3b,0xb72,0x276c)+dragonemoji+'\x20'+_0xe1d953+_0x23937d(0x52f,0xabd,0x9,0xe96)+dragonemoji+'\x20'+_0xe1d953+_0x313705(0x176d,0x22d3,0x1d46,0x1df3)+dragonemoji+'\x20'+_0xe1d953+_0x313705(0xaaa,0x8d3,-0x3c1,0x956)+dragonemoji+'\x20'+_0xe1d953+(_0x23937d(0x13cb,0x1a44,0x161f,0x2123)+'╠')+dragonemoji+'\x20'+_0xe1d953+('beautiful\x0a'+'┃╠')+dragonemoji+'\x20'+_0xe1d953+_0x313705(0x207a,0x157f,0x1ecc,0x280a)+dragonemoji+'\x20'+_0xe1d953+_0x313705(0x376,-0x6eb,0xc4c,-0x33a)+dragonemoji+'\x20'+_0xe1d953+_0x23937d(0x18b3,0x1933,0xffd,0x188b)+dragonemoji+'\x20'+_0xe1d953+'noob\x0a┃╠'+dragonemoji+'\x20'+_0xe1d953+_0x23937d(0xd4,0x8e3,-0xb65,-0x1dd)+dragonemoji+'\x20'+_0xe1d953+_0x313705(0x135c,0x2191,0x585,0x180a)+dragonemoji+'\x20'+_0xe1d953+'nerd\x0a┃╠'+dragonemoji+'\x20'+_0xe1d953+_0x23937d(0x895,-0x36b,-0x3b3,0x5e)+dragonemoji+'\x20'+_0xe1d953+_0x313705(0x59a,-0x14,0x3ce,0xe6b)+dragonemoji+'\x20'+_0xe1d953+'smart\x0a┃╠'+dragonemoji+'\x20'+_0xe1d953+_0x23937d(0xf44,0x118e,0x1b16,0x1489)+dragonemoji+'\x20'+_0xe1d953+_0x313705(0x1945,0x263d,0x113e,0x285f)+dragonemoji+'\x20'+_0xe1d953+'horny\x0a┃╠'+dragonemoji+'\x20'+_0xe1d953+_0x313705(0x1d55,0x2952,0x2450,0x144b)+dragonemoji+'\x20'+_0xe1d953+_0x313705(0x1f20,0x16c8,0x1d2b,0x1378)+dragonemoji+'\x20'+_0xe1d953+('tictactoe\x0a'+'┃╠')+dragonemoji+'\x20'+_0xe1d953+_0x23937d(0x6da,0xbc3,0x11de,0x549)+dragonemoji+'\x20'+_0xe1d953+(_0x23937d(0xd66,0x16a,-0x1e,0x1080)+_0x23937d(0x1b24,0x1c9b,0x128e,0x1299))+dragonemoji+'\x20'+_0xe1d953+('math\x20[mode'+_0x313705(0x153e,0x190f,0x1fa2,0x14d5))+dragonemoji+'\x20'+_0xe1d953+('suitpvp\x20[t'+'ag]\x0a┃╚════'+'══════════'+'════\x0a┃╔═══'+_0x313705(0x611,-0x470,0xca8,0xe63)+_0x23937d(0x185a,0x1605,0x186f,0x271d)+_0x313705(0x46b,0xd8c,0x7a1,0xa6e))+dragonemoji+'\x20'+_0xe1d953+('toimage\x20[r'+_0x23937d(-0x5,-0x593,0x469,0x635)+_0x23937d(0x11d8,0x1fc0,0x1fb5,0xb24))+dragonemoji+'\x20'+_0xe1d953+(_0x313705(0x1ddd,0x1320,0x17f2,0x1dc1)+_0x313705(0x87b,-0x61e,0x119d,-0x35d)+_0x313705(0x15a2,0x12f7,0x1409,0x903))+dragonemoji+'\x20'+_0xe1d953+('emojimix\x20['+'moji+moji]'+_0x23937d(0x105,0x3e,0x223,-0xb79))+dragonemoji+'\x20'+_0xe1d953+(_0x23937d(0xb44,0x1833,0x965,0xe15)+'eply\x20img]\x0a'+'┃╠')+dragonemoji+'\x20'+_0xe1d953+(_0x313705(0xded,0x1c29,0x1318,0x9e7)+_0x313705(0x1634,0x17c7,0x1000,0x1009)+'┃╠')+dragonemoji+'\x20'+_0xe1d953+(_0x313705(0x17ac,0x9cb,0xce3,0x1237)+_0x23937d(0x19e8,0x2039,0x215b,0xf64))+dragonemoji+'\x20'+_0xe1d953+('tovn\x20[repl'+_0x313705(0x6fd,0xd60,-0xc4,-0x86))+dragonemoji+'\x20'+_0xe1d953+(_0x23937d(0x153a,0x736,0x16d3,0xe22)+'ly\x20vn]\x0a┃╠')+dragonemoji+'\x20'+_0xe1d953+(_0x23937d(0x10b6,0x1c99,0x1291,0x245)+_0x23937d(0xef9,0x985,0xb66,0x12b1)+'┃╠')+dragonemoji+'\x20'+_0xe1d953+('ebinary\x20[r'+_0x313705(0x1f9e,0x2e01,0x291b,0x188c)+'┃╠')+dragonemoji+'\x20'+_0xe1d953+('dbinary\x20[r'+_0x313705(0x1f9e,0x140c,0x2205,0x19dc)+'┃╠')+dragonemoji+'\x20'+_0xe1d953+(_0x23937d(0x458,-0x369,-0x9da,0x62c)+_0x23937d(0x3bd,0x208,0x1004,-0x138)+_0x23937d(0x14e0,0xbc0,0x12ea,0x9ed)+'═══════\x0a┃╔'+_0x23937d(0x1ce7,0x12a6,0x1013,0x1f4d)+_0x23937d(0x1dab,0x1389,0x14fe,0x107b)+_0x23937d(0x1322,0x1798,0x101a,0x194d))+dragonemoji+'\x20'+_0xe1d953+_0x313705(0xa5f,0x1684,0x7ce,0x10a1)+dragonemoji+'\x20'+_0xe1d953+_0x23937d(0x83b,0xbbe,0xea1,-0x8f)+dragonemoji+'\x20'+_0xe1d953+'delcmd\x0a┃╠'+dragonemoji+'\x20'+_0xe1d953+'lockcmd\x0a┃╠'+dragonemoji+'\x20'+_0xe1d953+_0x23937d(0x83f,0x197,0x331,0x11e7)+dragonemoji+'\x20'+_0xe1d953+_0x23937d(0x2cb,-0x1b,-0x749,0x8cd)+dragonemoji+'\x20'+_0xe1d953+_0x313705(0x170d,0x1f79,0xad9,0x1c40)+dragonemoji+'\x20'+_0xe1d953+(_0x313705(0x11ac,0xc1b,0x1432,0x350)+_0x23937d(0x14e0,0x1812,0x197d,0x107a)+_0x313705(0xe57,0x3f,0xc59,0xd11)+_0x313705(0x5ab,0x149,0x13d1,0x130f)+_0x313705(0x9ac,0xaf4,0x2ba,0x8fa)+'\x0a┃║\x0a┃╠')+dragonemoji+'\x20'+_0xe1d953+(_0x313705(0x13f3,0xeef,0xab8,0x20c0)+'┃╠')+dragonemoji+'\x20'+_0xe1d953+_0x313705(0x6f7,0xc11,0x660,0x61)+dragonemoji+'\x20'+_0xe1d953+'next\x0a┃╠'+dragonemoji+'\x20'+_0xe1d953+(_0x23937d(0x823,0x4a8,0x254,0x13f0)+_0x23937d(0x14e0,0xd38,0xa00,0x1688)+'══════\x0a┃╔═'+_0x23937d(0xcba,0x1a76,0x14c4,0xe41)+_0x313705(0x9cb,0x197,-0x406,0xc65)+_0x23937d(0x1322,0x873,0x103b,0x1e12))+dragonemoji+'\x20'+_0xe1d953+(_0x313705(0xc89,0x29b,0xb07,0x7f3)+'y\x20aud]\x0a┃╠')+dragonemoji+'\x20'+_0xe1d953+(_0x313705(0xff0,0x1c33,0xd41,0x616)+_0x313705(0x1c65,0x252c,0x1e0c,0x19fd))+dragonemoji+'\x20'+_0xe1d953+(_0x313705(0x2087,0x1823,0x1ca5,0x248d)+_0x23937d(0x397,0x7b4,0xf07,-0x2ac))+dragonemoji+'\x20'+_0xe1d953+(_0x313705(0x7aa,-0x198,0x10e6,0x3d8)+_0x23937d(0x1a6d,0x1c08,0x10a6,0x149a)+'┃╠')+dragonemoji+'\x20'+_0xe1d953+(_0x23937d(0x73f,-0x5fa,0xb24,-0x9b)+_0x23937d(0x397,0x11fd,0x56d,0xd29))+dragonemoji+'\x20'+_0xe1d953+(_0x23937d(0x135d,0x1031,0x194b,0xdcc)+_0x23937d(0x1187,0x2a3,0x1776,0x70e))+dragonemoji+'\x20'+_0xe1d953+(_0x23937d(0x1847,0x201c,0x970,0x1c0e)+_0x23937d(0x44d,0xc12,0x120a,0x12dc)+_0x313705(0x153e,0x2409,0x1cc8,0xa35))+dragonemoji+'\x20'+_0xe1d953+(_0x313705(0x785,0xb8b,0x11f9,0x462)+_0x23937d(0x1a6d,0x19b9,0x1e56,0x2494)+'┃╠')+dragonemoji+'\x20'+_0xe1d953+(_0x313705(0xbd9,0x344,0x442,0x15d)+_0x23937d(0x18ff,0xc85,0x102b,0x1059))+dragonemoji+'\x20'+_0xe1d953+('slow\x20[repl'+_0x23937d(0x397,0xb6e,0xd91,0xe3c))+dragonemoji+'\x20'+_0xe1d953+(_0x313705(0xcf5,0x340,0xfe5,-0x84)+'reply\x20aud]'+_0x23937d(0x1c2e,0x1fee,0x12d6,0x11d0)+'══════════'+_0x23937d(0xafc,-0xc6,0xd34,0x9b8))+ownername+'*',_0x1c7d43[_0x313705(0x13d4,0x1495,0xb35,0x1c3c)]=_0x313705(0x13da,0x1c2b,0x1ff6,0x1b27)+_0x313705(0x1d4a,0x282f,0x297b,0x24cd),_0x1c7d43['buttons']=_0x4cd090,_0x1c7d43[_0x23937d(0x1b19,0x271f,0x126c,0xd0b)]=0x4;let _0x2e85bb=_0x1c7d43;_0x175756[_0x313705(0xcaa,0x1a8e,0x6e7,0x1666)+'e'](_0x5cd288['chat'],_0x2e85bb,{'quoted':_0x5cd288});}break;case _0x4b485e[_0x313705(0x14c7,0x1ed7,0x1aed,0x19a6)]:{if(_0x4b485e['trZco']===_0x4b485e['trZco']){const _0x22f975={};_0x22f975[_0x23937d(0x13f4,0x1dcd,0xe9c,0x20c5)+'t']=_0x4b485e[_0x313705(0x87f,-0x210,0x4cd,0x8b0)];const _0xf81ce8={};_0xf81ce8[_0x23937d(0x1b0c,0x1e99,0x1c6c,0x2a26)]=_0xe1d953+_0x313705(0x1146,0xe21,0xd00,0x1f5f),_0xf81ce8[_0x23937d(0x159c,0x1e45,0x17e3,0x1b88)]=_0x22f975,_0xf81ce8[_0x23937d(0x738,-0x5c6,-0x249,0x1620)]=0x1;const _0x3cb3f3={};_0x3cb3f3[_0x313705(0x175a,0x15e5,0x256d,0x2128)+'t']=_0x4b485e[_0x313705(0x4dc,0xb46,-0x82b,-0x1c)];const _0x2503f8={};_0x2503f8['buttonId']=_0xe1d953+_0x313705(0x1855,0xca6,0x1133,0xbf7),_0x2503f8[_0x23937d(0x159c,0x8bd,0x1eaa,0x1dfc)]=_0x3cb3f3,_0x2503f8[_0x313705(0xa9e,-0x3cf,0x8ee,0x173c)]=0x1;let _0x4b7683=[_0xf81ce8,_0x2503f8];const _0x3bd015={};_0x3bd015[_0x313705(0xddf,0x1a1b,0x1687,0xb0c)]=_0x313705(0xc7d,0x1831,0x621,0x77f)+_0x313705(0x105a,0x550,0x7ec,0x15b6)+_0x23937d(0x15eb,0x1808,0xdd0,0x1a18)+'803-081724'+_0x23937d(0x5ed,-0x3f7,0x970,-0x130);const _0x15b9e4={};_0x15b9e4[_0x23937d(0x1c43,0x1e0a,0x1311,0x2086)]=_0x3bd015,_0x15b9e4[_0x313705(0xcce,0x1411,0x160b,0x960)]=_0x23937d(0x306,0x691,0x3be,0x129)+botname+(_0x313705(0x4ad,-0x3a1,0x437,0x1e0)+_0x313705(0x5b9,0x9fe,0x145e,-0x54c)+_0x313705(0xbff,0x2bc,0x635,0x167e))+dragonemoji+'\x20'+_0xe1d953+(_0x313705(0x4bc,0xed0,-0x893,0x13ca)+_0x313705(0x1718,0x1945,0x1377,0xf35)+_0x23937d(0x1d3a,0x1c13,0x246d,0x2580))+dragonemoji+'\x20'+_0xe1d953+(_0x23937d(0x7c6,-0x74a,0x143,0x129b)+_0x23937d(0x1a6a,0x145e,0x1566,0x2660)+_0x23937d(0x91f,0x684,0x14d5,0x8d3))+dragonemoji+'\x20'+_0xe1d953+('update\x20(Ch'+_0x313705(0x3ec,0xc9b,-0x7ee,0x25c)+_0x23937d(0x1244,0x11da,0xb4c,0xcb9))+dragonemoji+'\x20'+_0xe1d953+'info\x0a┃╠'+dragonemoji+'\x20'+_0xe1d953+_0x313705(0xa0b,0x75c,0x16a1,0x8d2)+dragonemoji+'\x20'+_0xe1d953+(_0x23937d(0x40c,0x175,0x4c4,-0x57f)+'┃╠')+dragonemoji+'\x20'+_0xe1d953+_0x313705(0x169c,0x985,0x2119,0x153b)+dragonemoji+'\x20'+_0xe1d953+'owner\x0a┃╠'+dragonemoji+'\x20'+_0xe1d953+_0x23937d(0x100d,0x1772,0xaff,0x3fb)+dragonemoji+'\x20'+_0xe1d953+_0x23937d(0xc5f,0x1aed,0x7db,0x942)+dragonemoji+'\x20'+_0xe1d953+(_0x313705(0x98b,0x1f6,0x11fd,-0x4f3)+'╠')+dragonemoji+'\x20'+_0xe1d953+_0x313705(0x862,0x6fc,0x88a,0xcf4)+dragonemoji+'\x20'+_0xe1d953+_0x23937d(0x54f,-0x2f1,0x1221,0xc23)+dragonemoji+'\x20'+_0xe1d953+(_0x23937d(0x516,-0x30,0x2d7,0xd7c)+_0x313705(0x9fc,-0x161,0xecb,0x450))+dragonemoji+'\x20'+_0xe1d953+(_0x313705(0x20fe,0x1f76,0x25d4,0x176e)+'count]\x20[te'+_0x23937d(0x18ba,0x117f,0x1025,0x2357))+dragonemoji+'\x20'+_0xe1d953+(_0x23937d(0x1a7b,0x2503,0x21e6,0x1166)+'\x20[count]\x20['+_0x313705(0x7e1,0x72f,0xfdd,-0x6f)+_0x23937d(0x14e0,0x17ba,0x1db3,0x887)+_0x313705(0xdcd,0xb8c,0x17c9,0x1cc0))+_0xa43395+'\x20❮━😎',_0x15b9e4[_0x313705(0x13d4,0x1e2f,0x6ca,0x12ec)]=_0x4b485e[_0x313705(0x1fdb,0x1425,0x164c,0x256b)],_0x15b9e4['buttons']=_0x4b7683,_0x15b9e4[_0x23937d(0x1b19,0x228a,0x1045,0x1579)]=0x4;let _0x1ae33b=_0x15b9e4;_0x175756[_0x313705(0xcaa,0x15bf,0x180,0x7c6)+'e'](_0x5cd288[_0x313705(0x14f2,0x19c4,0xff1,0x8fd)],_0x1ae33b,{'quoted':_0x5cd288});}else{if(_0x154db8)return _0x4b485e[_0x23937d(0x225,-0x701,0x5a0,0x952)](_0x517f6d,_0x57f8f2[_0x313705(0x982,0x35,0x1147,-0x4b7)]);if(_0x1660d1)return _0x4b485e[_0x313705(0xf21,0x114e,0xd9f,0x1b91)](_0x103875,_0x6fbdf0[_0x313705(0x926,0x1305,0x1200,0xb2c)]);if(!_0x2277d3[0x9*-0x3cc+0x220e+-0xf*-0x2])return _0x3e900d(_0x313705(0x105b,0x1a52,0x6eb,0x1d05)+'e\x20link\x20?');try{const _0x508974={};_0x508974['url']=_0x2ea3b4[-0x1813+-0x1f58+0x376b];const _0x2a4a5f={};_0x2a4a5f[_0x23937d(0x17d9,0x2178,0x16d4,0x2558)]=''+_0x3a3a36[_0x313705(0xcd2,0xb61,0xd83,0x1ad3)],_0x2a4a5f[_0x23937d(0x15e2,0x14d6,0xfd3,0x1253)]=''+_0x49a088[_0x23937d(0x1cd5,0x2654,0x124b,0x2933)],_0x2a4a5f[_0x23937d(0x16e9,0xcdc,0x15ab,0x209f)]=_0x14fbf7,_0x2a4a5f[_0x23937d(0xee2,0x1c62,0x1b4f,0x1802)]=0x2,_0x2a4a5f['mediaUrl']=''+_0x488079[_0x23937d(0x7fa,-0x282,-0x554,0x10a8)],_0x2a4a5f[_0x23937d(0x17f0,0x23b6,0xa95,0x1c40)]=''+_0x411aed[_0x23937d(0x7fa,0x72d,0x13bf,0x34b)];const _0x126efa={};_0x126efa[_0x23937d(0x478,0xa61,-0xc8,0xa18)+_0x313705(0x686,0xc2c,-0x2d9,0xe11)]=_0x2a4a5f;const _0x317e30={};_0x317e30[_0x313705(0x1ac8,0x2525,0x1309,0x21af)]=_0x508974,_0x317e30[_0x23937d(0x968,0x1400,0x65c,0x6)]=_0x23937d(0x4e8,0x402,-0x3b7,0x10a4),_0x317e30[_0x23937d(0x341,0x417,0x7ec,0x569)+'o']=_0x126efa;const _0x1585ca={};_0x1585ca[_0x23937d(0x5dc,0x3fb,0x1207,0x121a)]=_0x61b996,_0x4876b2[_0x23937d(0x944,0x822,0x113c,0x160)+'e'](_0x5aede7,_0x317e30,_0x1585ca);}catch{_0x4b485e[_0x313705(0x1de7,0xfc8,0x1475,0x2180)](_0x32e593,_0x313705(0x1699,0x10b6,0x15aa,0x1e93)+'!');}}}break;case _0x4b485e[_0x23937d(0x8cf,0x1015,-0xb8,0x64)]:case _0x4b485e['TEIzU']:{const _0x247f3b={};_0x247f3b['displayTex'+'t']=_0x4b485e[_0x23937d(0x519,0xeed,0xee2,-0x27e)];const _0x30aee6={};_0x30aee6[_0x313705(0x1e72,0x2144,0x19a0,0x1601)]=_0xe1d953+_0x23937d(0xde0,0x339,0xdd1,-0xbb),_0x30aee6[_0x23937d(0x159c,0x1144,0x1cea,0xf94)]=_0x247f3b,_0x30aee6['type']=0x1;const _0x1970fe={};_0x1970fe[_0x23937d(0x13f4,0x1636,0x835,0x1c14)+'t']=_0x4b485e[_0x23937d(0x176,-0x276,0xa50,-0xd85)];const _0x1f5c23={};_0x1f5c23[_0x313705(0x1e72,0x2d31,0x1ad8,0x1510)]=_0xe1d953+_0x23937d(0x14ef,0x140f,0x1386,0x1345),_0x1f5c23['buttonText']=_0x1970fe,_0x1f5c23['type']=0x1;let _0x222914=[_0x30aee6,_0x1f5c23];const _0x154cca={};_0x154cca[_0x23937d(0xa79,0xb82,0x1d,0x153c)]=_0x4b485e[_0x313705(0x1d81,0xf62,0x1d4b,0x23d1)];const _0x31b6b5={};_0x31b6b5['image']=_0x154cca,_0x31b6b5[_0x313705(0xcce,0x14a0,0xb5e,0x20a)]='\x0a┏━❯\x20'+botname+('\x20❮━━😎\x20\x0a┃╔═'+_0x23937d(0x15dc,0x16cd,0x218a,0x14e0)+'\x20💠══╗\x09\x20\x0a┃║'+_0x313705(0x1296,0x12ec,0xb4d,0x11da))+dragonemoji+'\x20'+_0xe1d953+(_0x313705(0x1f32,0x167d,0x2291,0x126d)+'┃╠')+dragonemoji+'\x20'+_0xe1d953+(_0x313705(0x1fc8,0x1ee9,0x213c,0x2c81)+_0x313705(0x2005,0x26a7,0x2e4d,0x22ad))+dragonemoji+'\x20'+_0xe1d953+(_0x23937d(0x1e08,0x24c6,0x17d9,0x1571)+'on/off]\x0a┃╠')+dragonemoji+'\x20'+_0xe1d953+('ephemeral\x20'+_0x313705(0x4a4,0x52d,-0x7,0x496)+'╠')+dragonemoji+'\x20'+_0xe1d953+(_0x23937d(0x230,-0x44d,-0x469,0x577)+'mage]\x0a┃╠')+dragonemoji+'\x20'+_0xe1d953+(_0x313705(0x2019,0x2ca2,0x26e1,0x2a8c)+_0x23937d(0x354,0x13f,0xd22,0x9c2))+dragonemoji+'\x20'+_0xe1d953+('setdesc\x20[t'+_0x23937d(0x354,0xb20,0x575,0x186))+dragonemoji+'\x20'+_0xe1d953+(_0x23937d(0x538,0x8ae,0x704,0x66d)+_0x313705(0xd67,0x180f,0x1712,0x445))+dragonemoji+'\x20'+_0xe1d953+(_0x313705(0x1748,0xf88,0x2293,0x105f)+_0x313705(0x1861,0x152f,0x10da,0x24ca))+dragonemoji+'\x20'+_0xe1d953+(_0x313705(0x10b3,0x1849,0x1d0b,0x5ca)+_0x313705(0x46b,-0x6d4,-0x2e7,0x119f))+dragonemoji+'\x20'+_0xe1d953+('kick\x20[repl'+_0x313705(0x8b7,-0x4cf,0xeea,0x45d))+dragonemoji+'\x20'+_0xe1d953+(_0x313705(0x1bed,0x1795,0x27dc,0x1fdf)+_0x313705(0x6ba,0xdfb,0xd97,-0x7cf))+dragonemoji+'\x20'+_0xe1d953+(_0x23937d(0x3f1,0x207,-0x833,0x76d)+_0x313705(0x1c20,0x25d9,0xd21,0x20ef))+dragonemoji+'\x20'+_0xe1d953+(_0x313705(0x14c0,0x1ad9,0x121a,0xcac)+'ff]\x0a┃╠')+dragonemoji+'\x20'+_0xe1d953+(_0x23937d(0x1aee,0x1d0b,0x138f,0x26fa)+'eply/tag]\x0a'+'┃╠')+dragonemoji+'\x20'+_0xe1d953+(_0x313705(0x99f,0x1208,-0x4a7,0x74c)+_0x313705(0x184a,0x1506,0x10c1,0x1c80)+'╠')+dragonemoji+'\x20'+_0xe1d953+_0x23937d(0x1d09,0x11ec,0x12e5,0x19de)+dragonemoji+'\x20'+_0xe1d953+'devote\x0a┃╠'+dragonemoji+'\x20'+_0xe1d953+_0x313705(0x194f,0x2838,0x19ff,0x1686)+dragonemoji+'\x20'+_0xe1d953+(_0x313705(0x1dc9,0x1d73,0x289c,0x1eff)+'┃╠')+dragonemoji+'\x20'+_0xe1d953+(_0x313705(0xa99,0x36c,0x321,0x14e9)+_0x313705(0x1846,0x980,0x1776,0x115b)+'═══☬\x0a┗━━❯\x20')+_0xa43395+_0x23937d(0x882,0x13e9,0x1473,0x159a),_0x31b6b5[_0x23937d(0x106e,0xd91,0x5ef,0x165b)]=_0x313705(0x13da,0x113d,0x220c,0x120f)+_0x23937d(0x19e4,0x13a4,0x1f4d,0x1dba),_0x31b6b5[_0x23937d(0xc3a,0x1482,0x15d0,0x569)]=_0x222914,_0x31b6b5[_0x313705(0x1e7f,0x1916,0x1d2e,0x1864)]=0x4;let _0x1dcb1c=_0x31b6b5;_0x175756['sendMessag'+'e'](_0x5cd288[_0x313705(0x14f2,0x11c6,0xb6f,0xe74)],_0x1dcb1c,{'quoted':_0x5cd288});}break;case _0x23937d(0x1239,0xe49,0x1826,0x1cae):{const _0x34e8c2={};_0x34e8c2[_0x23937d(0x13f4,0x22eb,0x15c4,0x9fc)+'t']='⫷\x20ALIVE\x20⫸';const _0x399cb7={};_0x399cb7[_0x23937d(0x1b0c,0x2276,0x1ba2,0x18a6)]=_0xe1d953+_0x313705(0x1146,0x1b1f,0x46c,0x13e9),_0x399cb7[_0x23937d(0x159c,0x1aab,0xeb1,0x16d5)]=_0x34e8c2,_0x399cb7[_0x23937d(0x738,0x84d,0xc31,0x96a)]=0x1;const _0x386e1e={};_0x386e1e[_0x23937d(0x13f4,0x79a,0x651,0x1ab6)+'t']=_0x4b485e[_0x313705(0x4dc,0x294,0xbb0,0xe5e)];const _0x3b2e50={};_0x3b2e50[_0x23937d(0x1b0c,0x15a7,0x1cd0,0x2429)]=_0xe1d953+_0x23937d(0x14ef,0x1c62,0x1fd4,0xfa0),_0x3b2e50[_0x313705(0x1902,0x1a82,0xf0c,0xce4)]=_0x386e1e,_0x3b2e50[_0x23937d(0x738,0x1b,0xf78,0x3b4)]=0x1;let _0x38fd1b=[_0x399cb7,_0x3b2e50];const _0x302336={};_0x302336[_0x23937d(0xa79,-0x155,0x75d,0xed1)]=_0x4b485e[_0x23937d(0x2f,0x6a3,0xdcc,-0xb97)];const _0x235c8b={};_0x235c8b[_0x23937d(0x1c43,0x25f1,0x1f9a,0x2a2a)]=_0x302336,_0x235c8b[_0x23937d(0x968,-0x57f,0x867,0x69c)]=_0x23937d(0x189,0x64c,-0x1e1,-0x2c)+botname+(_0x23937d(0x147,-0xbef,0x367,-0x6bc)+_0x313705(0x1e78,0x2a69,0x1219,0x2829)+_0x313705(0x196f,0x20d1,0x15bf,0x1c6f)+_0x23937d(0x603,0xd5f,0x10a5,0xa56))+dragonemoji+'\x20'+_0xe1d953+_0x313705(0xc34,0x12d8,0x1573,0xf94)+dragonemoji+'\x20'+_0xe1d953+_0x23937d(0x11b0,0x1191,0x1037,0xca6)+dragonemoji+'\x20'+_0xe1d953+_0x23937d(0x1ab2,0x17f7,0x2975,0x1656)+dragonemoji+'\x20'+_0xe1d953+(_0x23937d(0xe39,0xcf9,0x1651,0x161)+'┃╠')+dragonemoji+'\x20'+_0xe1d953+_0x313705(0x1711,0xef9,0xb52,0xd36)+dragonemoji+'\x20'+_0xe1d953+(_0x23937d(0x68a,-0x447,0x791,0x15a7)+'┃╠')+dragonemoji+'\x20'+_0xe1d953+('leaderboar'+_0x313705(0x116b,0x5ad,0x8e2,0x545))+dragonemoji+'\x20'+_0xe1d953+(_0x313705(0x1dbe,0x1e1c,0x1ec2,0x1950)+_0x313705(0x1754,0x1c2d,0x1ef7,0x13c8))+dragonemoji+'\x20'+_0xe1d953+(_0x23937d(0x1c27,0x286a,0x101b,0x2a90)+'on]\x0a┃╚════'+'═════════☬'+_0x23937d(0x179c,0xd86,0x90e,0x1fbc))+_0xa43395+_0x313705(0xbe8,0x1322,0x192a,0xe58),_0x235c8b[_0x313705(0x13d4,0xe33,0xc41,0x1896)]=_0x175756[_0x313705(0x787,0x4fe,0x11df,0xdfa)][_0x313705(0x17b7,0x1f6c,0x1e1d,0x1e50)],_0x235c8b['buttons']=_0x38fd1b,_0x235c8b[_0x313705(0x1e7f,0x19fd,0x28ea,0x1358)]=0x4;let _0x10e176=_0x235c8b;_0x175756[_0x23937d(0x944,0x20e,-0x22c,0x4f1)+'e'](_0x5cd288[_0x23937d(0x118c,0x1220,0x1b0b,0x1bf2)],_0x10e176,{'quoted':_0x5cd288});}break;case _0x4b485e[_0x313705(0x18f6,0x10f6,0x164e,0xbfb)]:{const _0x4e9fa5={};_0x4e9fa5[_0x23937d(0x13f4,0xa65,0xcb0,0x14b7)+'t']=_0x4b485e['QboXf'];const _0xcb8d0f={};_0xcb8d0f[_0x313705(0x1e72,0x2959,0x103d,0x1605)]=_0xe1d953+_0x313705(0x13d0,0xf0b,0x6fd,0x1cca),_0xcb8d0f['buttonText']=_0x4e9fa5,_0xcb8d0f['type']=0x1;const _0x424132={};_0x424132[_0x313705(0x175a,0xa30,0x1ea3,0x1842)+'t']=_0x4b485e['lOURB'];const _0x572abe={};_0x572abe['buttonId']=_0xe1d953+_0x313705(0x1146,0x1151,0xc2e,0x1fa4),_0x572abe[_0x313705(0x1902,0x2401,0x16c0,0x26fb)]=_0x424132,_0x572abe[_0x23937d(0x738,-0x7dc,-0x694,-0x4e)]=0x1;const _0x771904={};_0x771904[_0x23937d(0x13f4,0x13fd,0x1d2b,0x16fc)+'t']=_0x4b485e[_0x23937d(0x176,-0xae8,-0x174,-0xd2b)];const _0x489be8={};_0x489be8['buttonId']=_0xe1d953+'donate',_0x489be8[_0x313705(0x1902,0x1ca8,0x158f,0x22da)]=_0x771904,_0x489be8['type']=0x1;let _0x4bbfe9=[_0xcb8d0f,_0x572abe,_0x489be8];const _0x547344={};_0x547344[_0x313705(0xddf,0x976,0xb4d,0x10b3)]=_0x4b485e[_0x313705(0x1540,0x1622,0xbb3,0x750)];const _0x1e6d97={};_0x1e6d97[_0x23937d(0x1c43,0x1ff0,0x2274,0x1267)]=_0x547344,_0x1e6d97[_0x23937d(0x968,0x968,0x7a0,0x1278)]=_0x313705(0x4ef,-0xa09,-0x352,-0x31f)+botname+(_0x23937d(0x147,-0xae5,0xd35,-0x54e)+_0x23937d(0x2b7,0xd86,0x507,0x1ee)+_0x23937d(0xa44,0x244,0x41d,0x1cd)+'\x20\x20\x20\x20\x20\x0a┃╠')+dragonemoji+'\x20'+_0xe1d953+(_0x23937d(0xf7a,0x618,0x1842,0x25b)+'┃╠')+dragonemoji+'\x20'+_0xe1d953+(_0x313705(0xe0b,0xee8,0xc8e,0x13fc)+']\x0a┃╠')+dragonemoji+'\x20'+_0xe1d953+('is\x20[text]\x0a'+'┃╠')+dragonemoji+'\x20'+_0xe1d953+(_0x313705(0xbaf,0x10df,0x99c,0xf73)+_0x313705(0x153e,0xa6f,0x15fb,0x17d8))+dragonemoji+'\x20'+_0xe1d953+(_0x313705(0x13bd,0x15d7,0xffa,0xb00)+_0x313705(0x46b,0x76,0x12ef,0xaf4))+dragonemoji+'\x20'+_0xe1d953+(_0x313705(0x1a8d,0x1710,0x2911,0x2872)+_0x23937d(0x11d8,0x1c41,0x460,0x7e8))+dragonemoji+'\x20'+_0xe1d953+(_0x23937d(0x95e,-0x23,-0x15a,-0x484)+_0x23937d(0xa01,0xf51,0x14e7,0xd8))+dragonemoji+'\x20'+_0xe1d953+(_0x313705(0x1760,0x20e8,0x9f9,0x8de)+'heck\x20[tag]'+_0x23937d(0x105,0x744,0x321,-0x79f))+dragonemoji+'\x20'+_0xe1d953+(_0x23937d(0x678,0xe61,0xec,-0x669)+_0x313705(0x13fb,0x146b,0xf87,0x1421)+'╠')+dragonemoji+'\x20'+_0xe1d953+(_0x23937d(0x1146,0xdb3,0x1a5c,0x1172)+_0x23937d(0xbeb,0x194d,0x1700,0x156e))+dragonemoji+'\x20'+_0xe1d953+('lesbianche'+_0x23937d(0x1095,0x13eb,0xbbd,0x1251)+'╠')+dragonemoji+'\x20'+_0xe1d953+('gaycheck\x20['+_0x23937d(0x1221,0x7c4,0x212d,0x3ab))+dragonemoji+'\x20'+_0xe1d953+('cutecheck\x20'+_0x313705(0xf46,0x411,0x6a,0x12db))+dragonemoji+'\x20'+_0xe1d953+(_0x23937d(0x1069,0x630,0x912,0x1e03)+_0x23937d(0xbe0,0x17b5,0x199a,0x6c1))+dragonemoji+'\x20'+_0xe1d953+('hornycheck'+_0x313705(0x1552,0x19d5,0x809,0x1f3f))+dragonemoji+'\x20'+_0xe1d953+(_0x23937d(0xa8b,0x13e2,0x1355,0x49b)+_0x313705(0xd8f,0x16b8,0x1151,0xc89)+_0x23937d(0x105,-0x3d8,-0x539,-0x138))+dragonemoji+'\x20'+_0xe1d953+(_0x313705(0xc7a,0x1334,0x3f6,0xac6)+'k\x20[tag]\x0a┃╠')+dragonemoji+'\x20'+_0xe1d953+'couple\x0a┃╠'+dragonemoji+'\x20'+_0xe1d953+(_0x23937d(0x1608,0x2382,0x1bd7,0x23d4)+_0x23937d(0x105,-0x814,-0x452,0x64f))+dragonemoji+'\x20'+_0xe1d953+_0x313705(0x1d18,0x14d6,0x2944,0x166d)+dragonemoji+'\x20'+_0xe1d953+_0x313705(0x895,0x15a1,0x9c1,-0x1a6)+dragonemoji+'\x20'+_0xe1d953+_0x23937d(0x1407,0xf61,0x160a,0x2007)+dragonemoji+'\x20'+_0xe1d953+(_0x23937d(0x13cb,0x824,0x1e77,0x113e)+'╠')+dragonemoji+'\x20'+_0xe1d953+(_0x313705(0x17aa,0x1e61,0x1faf,0x13f9)+'┃╠')+dragonemoji+'\x20'+_0xe1d953+_0x313705(0x207a,0x1e7f,0x19d7,0x2209)+dragonemoji+'\x20'+_0xe1d953+'pretty\x0a┃╠'+dragonemoji+'\x20'+_0xe1d953+_0x313705(0x1c19,0x19fc,0x177b,0x1f10)+dragonemoji+'\x20'+_0xe1d953+_0x23937d(0x1650,0xaf5,0x1565,0x174d)+dragonemoji+'\x20'+_0xe1d953+'bastard\x0a┃╠'+dragonemoji+'\x20'+_0xe1d953+_0x313705(0x135c,0x128d,0x1a53,0xce4)+dragonemoji+'\x20'+_0xe1d953+'nerd\x0a┃╠'+dragonemoji+'\x20'+_0xe1d953+_0x313705(0xbfb,-0x279,0x4b6,0x3f7)+dragonemoji+'\x20'+_0xe1d953+'gay\x0a┃╠'+dragonemoji+'\x20'+_0xe1d953+_0x313705(0xe66,0xf1a,0xfca,0x336)+dragonemoji+'\x20'+_0xe1d953+'stubble\x0a┃╠'+dragonemoji+'\x20'+_0xe1d953+'dog\x0a┃╠'+dragonemoji+'\x20'+_0xe1d953+'horny\x0a┃╠'+dragonemoji+'\x20'+_0xe1d953+'cunt\x0a┃╠'+dragonemoji+'\x20'+_0xe1d953+_0x23937d(0x1bba,0x2994,0x1a4d,0x1d54)+dragonemoji+'\x20'+_0xe1d953+('tictactoe\x0a'+'┃╠')+dragonemoji+'\x20'+_0xe1d953+_0x313705(0xa40,0x195e,0xb51,0x11c3)+dragonemoji+'\x20'+_0xe1d953+(_0x313705(0x10cc,0x6f0,0x1bcf,0x1737)+_0x23937d(0x1b24,0x268f,0xfdc,0x1907))+dragonemoji+'\x20'+_0xe1d953+(_0x23937d(0x627,0x32c,0x1176,-0x5f5)+_0x23937d(0x11d8,0x1d05,0x1369,0x5bf))+dragonemoji+'\x20'+_0xe1d953+(_0x23937d(0xeb5,0xcc1,0x1afa,0xf03)+_0x23937d(0xd81,0x1bdf,0xd,0x713)+_0x23937d(0x1cfd,0x2b14,0x28db,0x29d9)+_0x313705(0x1b02,0x271e,0x208a,0x145a))+_0xa43395+_0x313705(0xbe8,0x131f,0x404,0x2cd),_0x1e6d97[_0x313705(0x13d4,0xebf,0xeae,0x1897)]=_0x4b485e[_0x313705(0x1fdb,0x2997,0x160c,0x2104)],_0x1e6d97[_0x23937d(0xc3a,0x1695,0xc65,0xa51)]=_0x4bbfe9,_0x1e6d97[_0x23937d(0x1b19,0x1a4c,0x2925,0xf86)]=0x4;let _0x48451c=_0x1e6d97;_0x175756[_0x23937d(0x944,0x998,0x894,0x167f)+'e'](_0x5cd288[_0x313705(0x14f2,0x1ff6,0x1288,0xa0e)],_0x48451c,{'quoted':_0x5cd288});}break;case _0x4b485e[_0x23937d(0x69b,0x67e,-0x12e,0xe2a)]:{const _0x652b6f={};_0x652b6f[_0x313705(0x175a,0xc08,0x105a,0x19da)+'t']=_0x4b485e[_0x23937d(0x116e,0x12ec,0xaa5,0x1820)];const _0x3ce129={};_0x3ce129['buttonId']=_0xe1d953+_0x313705(0x13d0,0x10e8,0x1f4a,0x6e5),_0x3ce129['buttonText']=_0x652b6f,_0x3ce129[_0x313705(0xa9e,0x2bc,0x938,0x6d8)]=0x1;const _0x35c7b3={};_0x35c7b3[_0x313705(0x175a,0x1e3e,0x24b9,0xc91)+'t']=_0x23937d(0x199e,0x106d,0x1a3c,0x1bf5);const _0x149c1b={};_0x149c1b[_0x23937d(0x1b0c,0x140a,0x1368,0x1ea8)]=_0xe1d953+'alive',_0x149c1b['buttonText']=_0x35c7b3,_0x149c1b[_0x313705(0xa9e,-0x249,0xa28,0x18d8)]=0x1;const _0x49b491={};_0x49b491[_0x23937d(0x13f4,0xac5,0xfd3,0x917)+'t']=_0x4b485e[_0x313705(0x4dc,0x19f,0x666,0x1268)];const _0x406cec={};_0x406cec[_0x23937d(0x1b0c,0x26fc,0x10a9,0xfb8)]=_0xe1d953+_0x313705(0x1855,0xc4c,0x233b,0x1dc4),_0x406cec[_0x313705(0x1902,0x9f6,0x1b0e,0x1e8c)]=_0x49b491,_0x406cec[_0x23937d(0x738,0x8fb,-0x615,0x149a)]=0x1;let _0xa4d44d=[_0x3ce129,_0x149c1b,_0x406cec];const _0x2f55af={};_0x2f55af['url']=_0x4b485e[_0x23937d(0xe76,0x107a,0x1bb6,0x349)];const _0x3d1749={};_0x3d1749[_0x23937d(0x1c43,0x23ba,0x25e8,0x238c)]=_0x2f55af,_0x3d1749[_0x23937d(0x968,-0x1cb,0xe2d,0x152a)]=_0x23937d(0x189,-0x77b,-0x76b,0x78b)+botname+(_0x23937d(0x147,0x637,-0x31d,0x859)+_0x313705(0x1a82,0xc9d,0x1ce7,0x1c7e)+_0x313705(0x172b,0x214d,0x1398,0x1f21)+'┃║\x0a┃╠')+dragonemoji+'\x20'+_0xe1d953+('alivepic\x20['+_0x313705(0x5b4,0x19,0x42f,0x8fe)+_0x23937d(0x105,0xa39,-0x569,-0x1c3))+dragonemoji+'\x20'+_0xe1d953+(_0x23937d(0x142a,0x7e3,0x1b24,0x17c4)+_0x313705(0x1737,0x99d,0x1cac,0x23fe))+dragonemoji+'\x20'+_0xe1d953+(_0x23937d(0x1301,0x1d48,0x1244,0xbf4)+'on/off]\x0a┃╠')+dragonemoji+'\x20'+_0xe1d953+(_0x23937d(-0x27,-0xe2c,0xe7a,-0xf3)+'on/off]\x0a┃╠')+dragonemoji+'\x20'+_0xe1d953+(_0x23937d(0x1bcc,0x1971,0x1ae1,0xd21)+'┃╠')+dragonemoji+'\x20'+_0xe1d953+(_0x23937d(0x3e2,0xdd,0x111c,0x3fc)+_0x23937d(0x13e,-0x998,0xaba,0xf43)+'╠')+dragonemoji+'\x20'+_0xe1d953+(_0x23937d(0x230,0xe38,0x68c,-0x404)+_0x313705(0x4d9,0xa0c,-0x869,0x10b9))+dragonemoji+'\x20'+_0xe1d953+(_0x23937d(0x1cb3,0x2a29,0x1c2b,0x1f27)+'ext]\x0a┃╠')+dragonemoji+'\x20'+_0xe1d953+(_0x313705(0x12bb,0x1dfa,0x1fa9,0xc04)+_0x23937d(0x354,0x1ab,0x980,0x8af))+dragonemoji+'\x20'+_0xe1d953+(_0x313705(0x1748,0x17eb,0xdcb,0xa51)+_0x23937d(0x14fb,0x11e5,0x1f58,0x1b1e))+dragonemoji+'\x20'+_0xe1d953+(_0x313705(0x10b3,0x289,0x152a,0x1d15)+_0x313705(0x46b,-0x505,0xff2,0xb47))+dragonemoji+'\x20'+_0xe1d953+(_0x23937d(0x63a,-0x205,0x448,-0x4aa)+_0x23937d(0x551,-0x59e,0xbe,0xc66))+dragonemoji+'\x20'+_0xe1d953+('hidetag\x20[t'+_0x313705(0x6ba,0x10e6,0x1515,-0x56d))+dragonemoji+'\x20'+_0xe1d953+(_0x23937d(0x3f1,-0x768,0x3ab,0xccb)+'xt]\x0a┃╠')+dragonemoji+'\x20'+_0xe1d953+(_0x313705(0x14c0,0x1c5a,0x78a,0x1bb2)+_0x313705(0x16d9,0x1a31,0xc13,0x1d01))+dragonemoji+'\x20'+_0xe1d953+('promote\x20[r'+_0x313705(0xc43,-0x225,0x36e,0xa78)+'┃╠')+dragonemoji+'\x20'+_0xe1d953+(_0x23937d(0x639,0x541,0xb2b,0x1499)+_0x23937d(0x14e4,0x2139,0x18cf,0x1410)+'╠')+dragonemoji+'\x20'+_0xe1d953+_0x313705(0x206f,0x2228,0x127f,0x2433)+dragonemoji+'\x20'+_0xe1d953+_0x313705(0xb9c,0x15ba,0x93e,-0x73)+dragonemoji+'\x20'+_0xe1d953+_0x23937d(0x15e9,0xdd5,0x6e3,0x6fd)+dragonemoji+'\x20'+_0xe1d953+(_0x313705(0x1dc9,0x114a,0x1567,0x17e4)+'┃╠')+dragonemoji+'\x20'+_0xe1d953+_0x23937d(0x1cf5,0x22f9,0x1037,0x1718)+dragonemoji+'\x20'+_0xe1d953+(_0x23937d(0x246,0x9ef,-0x59b,-0x359)+_0x23937d(0x1a4c,0x19f3,0x1318,0x295a)+_0x313705(0x1846,0x1629,0x1294,0x16a2)+'══☬\x0a┗━━❯\x20')+_0xa43395+_0x313705(0xbe8,0x158a,0x16fa,0xe4e),_0x3d1749[_0x23937d(0x106e,0x12c8,0x755,0x6b2)]=_0x4b485e[_0x313705(0x1fdb,0x15ff,0x1d42,0x1c17)],_0x3d1749[_0x23937d(0xc3a,-0x247,0x145f,0xedb)]=_0xa4d44d,_0x3d1749[_0x313705(0x1e7f,0x1476,0x2242,0x2b74)]=0x4;let _0x3315c9=_0x3d1749;_0x175756[_0x23937d(0x944,-0x4db,0xb1c,0x19d)+'e'](_0x5cd288[_0x23937d(0x118c,0x18bb,0x1071,0x5f7)],_0x3315c9,{'quoted':_0x5cd288});}break;case _0x313705(0x155b,0x682,0x6e3,0x1ca0)+'nu':{if(_0x4b485e[_0x313705(0x1e07,0x21fa,0x267e,0x170d)](_0x4b485e[_0x23937d(0xa74,0xbdf,0x491,-0x403)],_0x4b485e[_0x23937d(0xa74,0x1189,0xbcd,0x7d2)]))return _0x49083a[_0x23937d(0x17c2,0x2347,0xb75,0xba1)+'thMentions'](_0x29fa81[_0x313705(0x14f2,0x115e,0x209d,0x1c05)],'@'+_0x456282['p2'][_0x313705(0x1035,0x74c,0x12de,0x127d)]`@`[0x7dd*0x3+0x11*0x24a+-0x3e81]+('\x20Refuse\x20Su'+_0x313705(0x1038,0x1667,0x1012,0x9ef)+_0x23937d(0xebf,0x1950,0x1877,0xee0)),_0x37b68e),delete this[_0x23937d(0x1298,0x1324,0x10dd,0x2118)][_0x59e944['id']],!(-0x1b52+0x1b*-0x12d+0x3b11*0x1);else{const _0x116299={};_0x116299['displayTex'+'t']=_0x4b485e['QboXf'];const _0x413776={};_0x413776[_0x23937d(0x1b0c,0xfa7,0x21c2,0x1899)]=_0xe1d953+_0x313705(0x13d0,0xff9,0x127b,0x65b),_0x413776[_0x313705(0x1902,0xff0,0x14fa,0xd6f)]=_0x116299,_0x413776[_0x313705(0xa9e,0x16aa,0x9ef,0x8f8)]=0x1;const _0x1b2efa={};_0x1b2efa[_0x23937d(0x13f4,0x119e,0x1c55,0x184d)+'t']=_0x4b485e['lOURB'];const _0x48aa67={};_0x48aa67[_0x23937d(0x1b0c,0x2726,0x183c,0x1248)]=_0xe1d953+_0x313705(0x1146,0x849,0x168c,0x528),_0x48aa67[_0x23937d(0x159c,0x2030,0x2216,0x1b39)]=_0x1b2efa,_0x48aa67[_0x23937d(0x738,0x27c,0x15b4,-0x534)]=0x1;const _0x8f76cf={};_0x8f76cf[_0x23937d(0x13f4,0xabf,0x4d7,0x21c7)+'t']=_0x4b485e['FMFDA'];const _0x5377bd={};_0x5377bd['buttonId']=_0xe1d953+_0x313705(0x1855,0x2507,0x269e,0x1fba),_0x5377bd[_0x23937d(0x159c,0x199e,0xfaf,0x1f4e)]=_0x8f76cf,_0x5377bd['type']=0x1;let _0x112fce=[_0x413776,_0x48aa67,_0x5377bd];const _0x362a74={};_0x362a74[_0x313705(0xddf,0x1600,0x660,0x793)]=_0x4b485e[_0x23937d(0x77b,-0x554,0x163c,0x859)];const _0xf7689c={};_0xf7689c[_0x313705(0x1fa9,0x1bab,0x24a1,0x29f9)]=_0x362a74,_0xf7689c[_0x23937d(0x968,0x185f,0xcb2,0xacf)]=_0x23937d(0x189,-0x6c3,-0x2c7,0xf09)+botname+(_0x23937d(0x147,0x9e7,-0xa08,-0x684)+_0x23937d(0x135c,0x1aee,0x8fb,0xe53)+_0x23937d(0x7ea,0x1503,0xc9c,0x960)+_0x313705(0xb6f,0x16a,0x55f,0xc8d)+_0x23937d(0x105,0x859,-0x51f,-0x9cb))+dragonemoji+'\x20'+_0xe1d953+(_0x313705(0x1d12,0x2264,0x1de1,0x19b6)+_0x23937d(0x11d8,0x9ec,0xc15,0x1853))+dragonemoji+'\x20'+_0xe1d953+(_0x23937d(0x17f8,0x1b01,0x1604,0x2179)+_0x23937d(0x11d8,0x2bc,0xcd5,0x19f6))+dragonemoji+'\x20'+_0xe1d953+(_0x23937d(0x4c8,0x8f,0x10c5,0xdc1)+_0x23937d(0x11d8,0x1570,0x1f29,0x115f))+dragonemoji+'\x20'+_0xe1d953+(_0x313705(0x13db,0xd45,0x1c2e,0x1097)+_0x313705(0x1860,0x2556,0x1594,0x17cc))+dragonemoji+'\x20'+_0xe1d953+(_0x313705(0x19dd,0x1841,0x2270,0x16ae)+_0x313705(0x16ea,0x23d1,0x1af3,0x1ad2))+dragonemoji+'\x20'+_0xe1d953+('fb\x20[url]\x0a┃'+'╠')+dragonemoji+'\x20'+_0xe1d953+(_0x313705(0x198c,0x1d3b,0xbfe,0xd35)+_0x313705(0xe9e,0x1c99,0x1d0c,0x1f6))+dragonemoji+'\x20'+_0xe1d953+(_0x23937d(0x1dc5,0x2949,0x1a7d,0x1233)+'y]\x0a┃╠')+dragonemoji+'\x20'+_0xe1d953+(_0x23937d(0x1857,0x226e,0x1796,0x1416)+'y]\x0a┃╠')+dragonemoji+'\x20'+_0xe1d953+(_0x23937d(0x1432,0x89f,0x1583,0x1275)+_0x23937d(0xeca,0xdbc,0x1b6e,0xd1e))+dragonemoji+'\x20'+_0xe1d953+('pornhub\x20[u'+_0x313705(0x18f5,0x1618,0xb65,0x1a44)+_0x313705(0x2063,0x1ebc,0x1ae9,0x27df)+_0x23937d(0x179c,0x1158,0x188c,0x1010))+_0xa43395+_0x23937d(0x882,0x2f9,-0x18e,-0x3bb),_0xf7689c['footer']=_0x175756[_0x313705(0x787,0x5b8,0x486,0x1419)][_0x23937d(0x1451,0x941,0xe19,0x2114)],_0xf7689c[_0x23937d(0xc3a,0x6b7,0x28e,0x450)]=_0x112fce,_0xf7689c[_0x313705(0x1e7f,0x1959,0x1f23,0x1d1f)]=0x4;let _0x194f69=_0xf7689c;_0x175756['sendMessag'+'e'](_0x5cd288[_0x23937d(0x118c,0x1fbd,0xf7c,0x1683)],_0x194f69,{'quoted':_0x5cd288});}}break;case _0x4b485e[_0x313705(0xb94,0x11b2,0x1523,0xa6b)]:{const _0x8031a0={};_0x8031a0[_0x313705(0x175a,0x1203,0x22ea,0x1436)+'t']=_0x4b485e[_0x23937d(0x116e,0x1fb8,0x596,0xc50)];const _0x575900={};_0x575900[_0x313705(0x1e72,0x1771,0x21f5,0x1bd8)]=_0xe1d953+_0x23937d(0x106a,0xe01,0x18d9,0xb8f),_0x575900[_0x313705(0x1902,0x23bd,0x127d,0x1c98)]=_0x8031a0,_0x575900[_0x23937d(0x738,0xbdf,0xeff,0x3ce)]=0x1;const _0x206031={};_0x206031['displayTex'+'t']=_0x4b485e[_0x23937d(0x519,0xa56,0x101c,0xb71)];const _0xd6e2fb={};_0xd6e2fb[_0x313705(0x1e72,0x2b0e,0x1e69,0x1de2)]=_0xe1d953+_0x23937d(0xde0,0x11b0,0x1a11,0x349),_0xd6e2fb[_0x23937d(0x159c,0xf9b,0x996,0xd9e)]=_0x206031,_0xd6e2fb[_0x23937d(0x738,0x57,0xcd7,-0x2b8)]=0x1;const _0x10ab3d={};_0x10ab3d[_0x23937d(0x13f4,0xc38,0x2250,0x1a0a)+'t']='⫷\x20INFO\x20⫸';const _0x359370={};_0x359370[_0x23937d(0x1b0c,0x1b57,0x11f7,0x1988)]=_0xe1d953+_0x23937d(0x14ef,0x1610,0x16ba,0xcc9),_0x359370[_0x23937d(0x159c,0xb7f,0xeb8,0x110e)]=_0x10ab3d,_0x359370[_0x23937d(0x738,-0x277,0x5cf,0x1620)]=0x1;let _0x315335=[_0x575900,_0xd6e2fb,_0x359370];const _0x1573bd={};_0x1573bd['url']=_0x4b485e['wlStO'];const _0x2c867b={};_0x2c867b[_0x23937d(0x1c43,0x1556,0x1d7f,0x10c6)]=_0x1573bd,_0x2c867b[_0x313705(0xcce,0xf90,0x795,0x14d0)]=_0x313705(0x4ef,-0x52e,0x59c,0x225)+botname+(_0x313705(0x4ad,0x1215,0x81b,-0x474)+'═══💠\x20SEARC'+'H\x20💠══╗\x0a┃║\x09'+_0x23937d(0x188,-0x5d4,0x8bf,0xc09)+'╠')+dragonemoji+'\x20'+_0xe1d953+(_0x313705(0x1538,0x1dc2,0xf39,0xbd8)+_0x23937d(0xd41,0x530,0x1657,0x5cc))+dragonemoji+'\x20'+_0xe1d953+('song\x20[quer'+_0x23937d(0xd41,-0x9,0x1ef,0xa06))+dragonemoji+'\x20'+_0xe1d953+(_0x23937d(0xbd4,0xe7d,0x142,0xe03)+_0x23937d(0x11d8,0x178e,0x8ca,0x36e))+dragonemoji+'\x20'+_0xe1d953+('google\x20[qu'+_0x23937d(0x10c6,0xb69,0x1b43,0xd9c))+dragonemoji+'\x20'+_0xe1d953+(_0x313705(0x87d,0x8f8,-0x7a,0x3b2)+'ery]\x0a┃╠')+dragonemoji+'\x20'+_0xe1d953+(_0x313705(0x10fb,0x56d,0x8a0,0x163d)+'[query]\x0a┃╠')+dragonemoji+'\x20'+_0xe1d953+(_0x23937d(0x1b4f,0x2324,0x24e7,0x282a)+'[query]\x0a┃╠')+dragonemoji+'\x20'+_0xe1d953+('wikimedia\x20'+_0x23937d(0x1771,0x242f,0xe43,0xd4b))+dragonemoji+'\x20'+_0xe1d953+('ytsearch\x20['+_0x313705(0x59e,-0x860,-0x90e,-0x2c0))+dragonemoji+'\x20'+_0xe1d953+('ringtone\x20['+_0x313705(0x59e,-0x54a,0xc6c,0x6e8))+dragonemoji+'\x20'+_0xe1d953+(_0x313705(0x1e42,0x2778,0x12a8,0x2120)+'uery]\x0a┃╚══'+_0x313705(0x1846,0x16dc,0x1bda,0x1495)+_0x313705(0xdcd,0xf25,0x15ec,0x63))+_0xa43395+'\x20❮━😎',_0x2c867b[_0x313705(0x13d4,0x21c6,0x1476,0x1dc2)]=_0x175756[_0x313705(0x787,0xb9b,0xb7e,0xf5f)][_0x23937d(0x1451,0x1944,0x6e4,0xee3)],_0x2c867b[_0x23937d(0xc3a,0x1b20,0x19df,0xfe4)]=_0x315335,_0x2c867b[_0x23937d(0x1b19,0x188b,0x125e,0x1ee3)]=0x4;let _0x284ad8=_0x2c867b;_0x175756[_0x313705(0xcaa,0x978,0x627,0x1b84)+'e'](_0x5cd288['chat'],_0x284ad8,{'quoted':_0x5cd288});}break;case _0x4b485e[_0x313705(0xa83,0x70f,0x114d,0x389)]:{const _0x56df31={};_0x56df31['displayTex'+'t']=_0x23937d(0x15ad,0x2452,0xae6,0x23d5)+'\x20⫸';const _0x570348={};_0x570348[_0x23937d(0x1b0c,0x12c7,0x1568,0x105b)]=_0xe1d953+'allmenu',_0x570348[_0x23937d(0x159c,0x1dfa,0x1112,0x1bed)]=_0x56df31,_0x570348['type']=0x1;const _0x592aaa={};_0x592aaa[_0x313705(0x175a,0x2112,0xd3c,0x1604)+'t']=_0x4b485e['lOURB'];const _0x10bba9={};_0x10bba9[_0x313705(0x1e72,0x1dbb,0x1116,0x1abe)]=_0xe1d953+_0x23937d(0xde0,0x11d0,0x1c34,0x1799),_0x10bba9[_0x23937d(0x159c,0x1c60,0x2336,0xc78)]=_0x592aaa,_0x10bba9['type']=0x1;const _0x2be0de={};_0x2be0de[_0x313705(0x175a,0x256d,0x183e,0x1db9)+'t']=_0x4b485e['FMFDA'];const _0x2df474={};_0x2df474[_0x23937d(0x1b0c,0x1c30,0x12af,0x100e)]=_0xe1d953+_0x23937d(0x14ef,0x20e7,0xea3,0x16fe),_0x2df474[_0x313705(0x1902,0x1a12,0x1a5b,0x143f)]=_0x2be0de,_0x2df474[_0x313705(0xa9e,0x85f,0x1996,0x20a)]=0x1;let _0x47f5b8=[_0x570348,_0x10bba9,_0x2df474];const _0x4315fa={};_0x4315fa[_0x23937d(0xa79,0xf00,-0x3a9,0x2de)]=_0x4b485e[_0x23937d(0xb4a,0x1430,-0x1d4,0xc07)];const _0x30db5a={};_0x30db5a[_0x23937d(0x1c43,0x1266,0xe81,0x27f2)]=_0x4315fa,_0x30db5a[_0x313705(0xcce,0xa7a,0x638,0x14f0)]='\x0a┏━❯\x20'+botname+(_0x23937d(0x147,0x855,-0x92c,-0x829)+_0x23937d(0x9fa,0x1643,-0x35d,0x9e1)+_0x23937d(0x1b14,0x19f1,0x2544,0x1dd0)+'\x20\x20\x20\x20\x20\x20\x20\x20\x0a┃'+'╠')+dragonemoji+'\x20'+_0xe1d953+_0x23937d(0x1d69,0x1ec6,0x28b7,0x23d8)+dragonemoji+'\x20'+_0xe1d953+(_0x23937d(0xf58,0x28f,0x16e,0x1d5)+_0x313705(0xafc,0x223,0x825,0x91e))+dragonemoji+'\x20'+_0xe1d953+('couplepp\x0a┃'+'╚═════════'+'════☬\x0a┗━━❯'+'\x20')+_0xa43395+_0x313705(0xbe8,0x112c,0xf24,-0x118),_0x30db5a[_0x313705(0x13d4,0xfea,0x2079,0x16b2)]=_0x175756[_0x313705(0x787,0x120c,0x334,0x842)][_0x23937d(0x1451,0x18b8,0x1a2d,0x14e5)],_0x30db5a[_0x23937d(0xc3a,0x120d,0xf81,0x9c1)]=_0x47f5b8,_0x30db5a['headerType']=0x4;let _0xc37fd7=_0x30db5a;_0x175756[_0x23937d(0x944,-0x483,-0x3d4,0x64b)+'e'](_0x5cd288['chat'],_0xc37fd7,{'quoted':_0x5cd288});}break;case _0x4b485e[_0x23937d(0x109a,0xbb4,0x1f56,0x6c8)]:{const _0x5628e8={};_0x5628e8[_0x23937d(0x13f4,0xaf9,0x58c,0x1769)+'t']=_0x4b485e[_0x23937d(0x116e,0xb32,0x196f,0x1501)];const _0x272f2f={};_0x272f2f[_0x23937d(0x1b0c,0x1b7e,0x2086,0x166f)]=_0xe1d953+_0x313705(0x13d0,0x1266,0x9e3,0x1f58),_0x272f2f[_0x313705(0x1902,0xf5b,0x27bf,0x110b)]=_0x5628e8,_0x272f2f[_0x23937d(0x738,-0x352,-0x559,0xaab)]=0x1;const _0x1a057a={};_0x1a057a['displayTex'+'t']=_0x4b485e['lOURB'];const _0x5b221e={};_0x5b221e['buttonId']=_0xe1d953+_0x23937d(0xde0,0x14f5,0xc60,-0x6f),_0x5b221e[_0x23937d(0x159c,0x21a2,0x1a67,0x21c1)]=_0x1a057a,_0x5b221e[_0x313705(0xa9e,0x949,0x1241,0x73d)]=0x1;const _0x2daf55={};_0x2daf55[_0x23937d(0x13f4,0xafc,0xca8,0x2245)+'t']=_0x4b485e[_0x313705(0x4dc,0xf25,-0x96,-0x7ac)];const _0x4ec06d={};_0x4ec06d[_0x313705(0x1e72,0x225d,0x2634,0x1cda)]=_0xe1d953+_0x23937d(0x14ef,0x881,0x1a68,0x2305),_0x4ec06d[_0x313705(0x1902,0x11c6,0x2478,0x18cd)]=_0x2daf55,_0x4ec06d[_0x23937d(0x738,0x8d8,0x104b,0x2af)]=0x1;let _0xedcae1=[_0x272f2f,_0x5b221e,_0x4ec06d];const _0x40a4d6={};_0x40a4d6[_0x23937d(0xa79,0x150e,0x3fb,0x192e)]=_0x313705(0xc7d,0x1840,0x4eb,0x5da)+_0x23937d(0x199d,0x2250,0xeed,0x1d58)+_0x313705(0x1adb,0x1b70,0xd06,0x2890)+_0x313705(0x576,0x563,-0x960,-0x2ae)+_0x23937d(0x5ed,0x118f,-0x2de,0x11ed);const _0x43562f={};_0x43562f['image']=_0x40a4d6,_0x43562f[_0x313705(0xcce,0x1880,0x116f,0x1a78)]=_0x313705(0x4ef,0x10e,0xf8c,0x1b8)+botname+('\x20❮━━😎\x20\x0a┃╔═'+_0x23937d(0x14d9,0x1dc7,0x2347,0x18f5)+'\x20💠══╗\x0a┃║\x09\x20'+_0x313705(0x1296,0x1896,0xd1f,0x202a))+dragonemoji+'\x20'+_0xe1d953+_0x23937d(0x4cc,0xa05,0x6d7,0x389)+dragonemoji+'\x20'+_0xe1d953+_0x23937d(0x17f,0xfba,-0x4ab,-0x240)+dragonemoji+'\x20'+_0xe1d953+_0x313705(0x195b,0xe59,0x2492,0xada)+dragonemoji+'\x20'+_0xe1d953+_0x313705(0x1491,0xe55,0x1d3b,0x152e)+dragonemoji+'\x20'+_0xe1d953+_0x23937d(0x664,0x520,-0x7a6,0xefc)+dragonemoji+'\x20'+_0xe1d953+_0x23937d(0x8b5,-0x2cd,0x56e,-0x38)+dragonemoji+'\x20'+_0xe1d953+_0x23937d(0x1b09,0x2569,0x1067,0x19a4)+dragonemoji+'\x20'+_0xe1d953+_0x313705(0x1495,0xdec,0x2191,0x16a3)+dragonemoji+'\x20'+_0xe1d953+_0x313705(0x1444,0x1a0b,0x11f4,0x1d06)+dragonemoji+'\x20'+_0xe1d953+_0x23937d(0xc4,-0xe1,-0xe25,-0x7fa)+dragonemoji+'\x20'+_0xe1d953+_0x23937d(0x1a85,0x1bcd,0x1e13,0x1eef)+dragonemoji+'\x20'+_0xe1d953+_0x23937d(0x6fd,0x1438,0x159a,-0x61b)+dragonemoji+'\x20'+_0xe1d953+'blush\x0a┃╠'+dragonemoji+'\x20'+_0xe1d953+_0x313705(0x419,0xf52,0x516,0x10eb)+dragonemoji+'\x20'+_0xe1d953+'wave\x0a┃╠'+dragonemoji+'\x20'+_0xe1d953+(_0x23937d(0x167f,0x770,0x2071,0x1ffd)+'╠')+dragonemoji+'\x20'+_0xe1d953+('handhold\x0a┃'+'╠')+dragonemoji+'\x20'+_0xe1d953+_0x313705(0x3de,-0x411,0x9b3,0x375)+dragonemoji+'\x20'+_0xe1d953+_0x313705(0x1a2c,0x1073,0x2200,0x19d3)+dragonemoji+'\x20'+_0xe1d953+_0x23937d(0x104,-0x76e,0x387,-0x6fb)+dragonemoji+'\x20'+_0xe1d953+_0x23937d(0x1583,0x133d,0x1490,0x69b)+dragonemoji+'\x20'+_0xe1d953+'kill\x0a┃╠'+dragonemoji+'\x20'+_0xe1d953+_0x23937d(0x85a,-0x10,0x5,-0x668)+dragonemoji+'\x20'+_0xe1d953+_0x313705(0x174a,0xb64,0x15ee,0x215c)+dragonemoji+'\x20'+_0xe1d953+_0x313705(0x1771,0xf70,0x8c5,0x18bc)+dragonemoji+'\x20'+_0xe1d953+'dance\x0a┃╠'+dragonemoji+'\x20'+_0xe1d953+(_0x23937d(0x1b99,0x27f0,0x26d5,0x2737)+'══════════'+'══☬\x0a┗━━❯\x20')+_0xa43395+'\x20❮━😎',_0x43562f[_0x313705(0x13d4,0x2263,0x86c,0x15bd)]=_0x175756[_0x313705(0x787,0xfe4,0x988,0x118)][_0x313705(0x17b7,0x22d3,0x108d,0x2292)],_0x43562f['buttons']=_0xedcae1,_0x43562f[_0x313705(0x1e7f,0x2a60,0x25a4,0x14a3)]=0x4;let _0x25185e=_0x43562f;_0x175756[_0x313705(0xcaa,0x1698,-0x108,0x91a)+'e'](_0x5cd288[_0x313705(0x14f2,0x114c,0x1fdb,0x19bc)],_0x25185e,{'quoted':_0x5cd288});}break;case _0x4b485e[_0x313705(0x1da2,0x2a79,0x29d5,0x1907)]:{const _0x35025e={};_0x35025e[_0x313705(0x175a,0x1228,0xf28,0x239f)+'t']=_0x4b485e['QboXf'];const _0x128e5b={};_0x128e5b[_0x313705(0x1e72,0x2026,0x239c,0x14cb)]=_0xe1d953+'allmenu',_0x128e5b[_0x23937d(0x159c,0x10bb,0x15e7,0xc38)]=_0x35025e,_0x128e5b[_0x313705(0xa9e,0x132a,0x79b,0x17d7)]=0x1;const _0x3a1700={};_0x3a1700[_0x23937d(0x13f4,0x1565,0x1817,0x14f0)+'t']=_0x4b485e[_0x313705(0x87f,-0xdd,-0xb8,0x100d)];const _0x35c67e={};_0x35c67e[_0x313705(0x1e72,0x10c2,0x2881,0x10e8)]=_0xe1d953+_0x23937d(0xde0,0xbab,0x14e2,0x11ba),_0x35c67e['buttonText']=_0x3a1700,_0x35c67e[_0x313705(0xa9e,0xdf5,0x982,0x10d4)]=0x1;const _0x392dd8={};_0x392dd8[_0x313705(0x175a,0x926,0x1e00,0x1402)+'t']=_0x4b485e[_0x313705(0x4dc,0x62b,0x76e,0x7d6)];const _0xe04f0={};_0xe04f0[_0x313705(0x1e72,0x2d1c,0x1f73,0x16af)]=_0xe1d953+_0x23937d(0x14ef,0x1498,0xb96,0x17cd),_0xe04f0[_0x23937d(0x159c,0x1337,0x1c22,0x9c9)]=_0x392dd8,_0xe04f0[_0x23937d(0x738,0x161f,0x966,0x4c9)]=0x1;let _0x39ebe1=[_0x128e5b,_0x35c67e,_0xe04f0];const _0x14170a={};_0x14170a['url']=_0x4b485e[_0x313705(0x4bb,0x2d,0x519,-0x488)];const _0x496eef={};_0x496eef[_0x313705(0x1fa9,0x1926,0x14de,0x1914)]=_0x14170a,_0x496eef[_0x313705(0xcce,0x22b,-0x1be,0x58d)]=_0x23937d(0x189,-0x6e6,-0xa4b,0x4a2)+botname+(_0x23937d(0x147,-0x67f,0x31f,0x103b)+_0x313705(0x1529,0x1861,0x21a6,0xced)+'PRO\x20💠══╗\x0a┃'+_0x313705(0xb6f,0x1574,0xd78,0x18c5)+_0x23937d(0x105,-0x480,0x1d9,-0x2db))+dragonemoji+'\x20'+_0xe1d953+(_0x313705(0x788,0xe92,0xae5,-0x759)+']\x0a┃╠')+dragonemoji+'\x20'+_0xe1d953+('3dchristma'+'s\x20[txt]\x0a┃╠')+dragonemoji+'\x20'+_0xe1d953+('christmas\x20'+_0x23937d(0x257,0x625,-0x924,-0x426))+dragonemoji+'\x20'+_0xe1d953+(_0x313705(0xd2d,0x149b,0x85f,0x17f5)+_0x313705(0x12d1,0x1f5f,0x1761,0x183d)+_0x313705(0xd67,0x1435,0x17b1,0x1312))+dragonemoji+'\x20'+_0xe1d953+('deepsea\x20[t'+_0x23937d(0x18ba,0x1848,0x1cac,0xa62))+dragonemoji+'\x20'+_0xe1d953+('scifi\x20[txt'+_0x313705(0x153e,0x1259,0x641,0x126c))+dragonemoji+'\x20'+_0xe1d953+('rainbow\x20[t'+'xt]\x0a┃╠')+dragonemoji+'\x20'+_0xe1d953+(_0x23937d(0xdff,0x1787,0x1a81,0x583)+_0x313705(0x5bd,0x198,0xe7b,0x1e4))+dragonemoji+'\x20'+_0xe1d953+(_0x23937d(0x1ff,-0x1bc,-0x8c8,-0x583)+_0x313705(0xd67,0xd30,-0x16b,0x1c77))+dragonemoji+'\x20'+_0xe1d953+(_0x23937d(0xdfa,0x75d,0x1a4e,0x350)+_0x23937d(0xa01,0x2a0,0xdae,0x113f))+dragonemoji+'\x20'+_0xe1d953+(_0x23937d(0x1c39,0x17ec,0x19f7,0xf8f)+_0x23937d(0x18ba,0xf2a,0xc5e,0xda7))+dragonemoji+'\x20'+_0xe1d953+(_0x313705(0x9b6,0x1877,-0x6c,0x15bb)+_0x313705(0x5bd,0xd49,-0x73e,0x624))+dragonemoji+'\x20'+_0xe1d953+('metalic\x20[t'+_0x313705(0x1c20,0x24b4,0x17e0,0x1a3e))+dragonemoji+'\x20'+_0xe1d953+('fiction\x20[t'+'xt]\x0a┃╠')+dragonemoji+'\x20'+_0xe1d953+(_0x23937d(0x1dc2,0x20df,0x273d,0x21be)+_0x23937d(0x11d8,0x10f9,0x12a3,0xf52))+dragonemoji+'\x20'+_0xe1d953+(_0x23937d(0x15a1,0x9e3,0x1fdc,0xa89)+_0x23937d(0x16c4,0xd62,0x1b4d,0x22bf))+dragonemoji+'\x20'+_0xe1d953+(_0x313705(0x1ac0,0x1e74,0x2611,0x137c)+_0x313705(0x153e,0x836,0xd75,0x1835))+dragonemoji+'\x20'+_0xe1d953+(_0x313705(0xe2a,0x17b,0x1c86,0x32a)+'xt]\x0a┃╠')+dragonemoji+'\x20'+_0xe1d953+(_0x313705(0x6e9,0xc69,0xa32,0x40d)+_0x23937d(0x11d8,0xc56,0xb1d,0x11a6))+dragonemoji+'\x20'+_0xe1d953+(_0x313705(0x1e43,0x23c6,0x2b0b,0x1691)+_0x313705(0x1c20,0x204b,0x1407,0x13d2))+dragonemoji+'\x20'+_0xe1d953+(_0x23937d(0x1538,0xcf1,0xb80,0x2072)+_0x313705(0x5bd,0xef7,0xe83,-0x19e))+dragonemoji+'\x20'+_0xe1d953+(_0x313705(0x1d31,0x1cec,0x1321,0x295f)+_0x23937d(0xa01,0x77a,0x3ed,-0xc4))+dragonemoji+'\x20'+_0xe1d953+(_0x23937d(0x1804,0x21a3,0x1a0a,0x2594)+_0x23937d(0x16c4,0x8d6,0x22fc,0x23f7))+dragonemoji+'\x20'+_0xe1d953+(_0x313705(0x927,0x884,-0x45a,0xa79)+_0x313705(0x1b60,0x1522,0x2118,0x103c))+dragonemoji+'\x20'+_0xe1d953+(_0x313705(0xec2,0x11a6,0xf13,0xd8a)+_0x23937d(0x5f9,0x981,0x2e0,-0xce))+dragonemoji+'\x20'+_0xe1d953+(_0x23937d(0x235,-0xbcb,0x9ee,-0x4f3)+_0x313705(0x1a53,0x1a50,0x1aa5,0xd2b))+dragonemoji+'\x20'+_0xe1d953+('multicolor'+_0x313705(0x1a53,0xbe3,0x19e8,0xd63))+dragonemoji+'\x20'+_0xe1d953+(_0x23937d(0x2ba,-0x859,0xe36,0x226)+_0x23937d(0x257,0xa30,0xc43,0x924))+dragonemoji+'\x20'+_0xe1d953+('underwater'+_0x23937d(0x16ed,0x2401,0x20a0,0x2273))+dragonemoji+'\x20'+_0xe1d953+(_0x23937d(0x667,-0x84e,0x3c2,0x132a)+_0x313705(0x1366,0x5bf,0x18cb,0x1feb)+'╠')+dragonemoji+'\x20'+_0xe1d953+(_0x23937d(0x124a,0x7b5,0x2137,0x16e5)+_0x313705(0x46b,0x447,-0x8b4,0xf4))+dragonemoji+'\x20'+_0xe1d953+(_0x23937d(0x643,-0x4ee,0x3fa,0x406)+_0x23937d(0x11d8,0xeeb,0x1261,0xcd3))+dragonemoji+'\x20'+_0xe1d953+(_0x313705(0xafa,-0xa8,-0xfe,0x1626)+_0x23937d(0x11d8,0xd23,0x19fe,0x203c))+dragonemoji+'\x20'+_0xe1d953+(_0x313705(0x1972,0x264b,0x1764,0x10ac)+'┃╠')+dragonemoji+'\x20'+_0xe1d953+('fruitjuice'+_0x23937d(0x16ed,0x1256,0x1c4d,0x178b))+dragonemoji+'\x20'+_0xe1d953+(_0x313705(0x8c2,-0x1ab,0x1059,0xdac)+'xt]\x0a┃╠')+dragonemoji+'\x20'+_0xe1d953+(_0x313705(0x1266,0x572,0x1f39,0x1cb1)+'\x0a┃╠')+dragonemoji+'\x20'+_0xe1d953+(_0x313705(0x1922,0x1382,0x1322,0x22dd)+_0x23937d(0x257,-0xa3e,0xdf9,0x10c4))+dragonemoji+'\x20'+_0xe1d953+(_0x23937d(0x1d5f,0x1287,0x13ef,0x18c7)+_0x313705(0x1a53,0x1095,0x24ae,0x21d5))+dragonemoji+'\x20'+_0xe1d953+('matrix\x20[tx'+_0x313705(0xd67,0x20b,0x1f2,0xfd8))+dragonemoji+'\x20'+_0xe1d953+('blood\x20[txt'+_0x313705(0x153e,0x1ef7,0x20e6,0xa0c))+dragonemoji+'\x20'+_0xe1d953+(_0x23937d(0xa0c,0x655,0x14cc,-0x39)+'[txt]\x0a┃╠')+dragonemoji+'\x20'+_0xe1d953+(_0x313705(0xf8c,0x230,0x1a61,0x1098)+_0x313705(0x153e,0xeb4,0x832,0x1e9d))+dragonemoji+'\x20'+_0xe1d953+('lava\x20[txt]'+_0x313705(0x46b,-0x119,-0xa2b,0xb91))+dragonemoji+'\x20'+_0xe1d953+(_0x23937d(0x1564,0x2176,0x1a58,0x64d)+_0x313705(0x46b,0xa12,0x42d,0x925))+dragonemoji+'\x20'+_0xe1d953+(_0x23937d(0x1633,0x165e,0x1a72,0x24a2)+_0x23937d(0x257,-0x6d,-0x994,-0x8d2))+dragonemoji+'\x20'+_0xe1d953+('hallowen\x20['+_0x23937d(0x5f9,0x593,0xa97,0x816))+dragonemoji+'\x20'+_0xe1d953+('darkgold\x20['+'txt]\x0a┃╠')+dragonemoji+'\x20'+_0xe1d953+(_0x23937d(0x41a,0x87c,0x113d,-0x457)+']\x0a┃╠')+dragonemoji+'\x20'+_0xe1d953+(_0x23937d(0x4e1,-0x8f,0xe28,0x10a4)+_0x313705(0xd67,0x167f,0x1b36,0x17c0))+dragonemoji+'\x20'+_0xe1d953+('firework\x20['+_0x313705(0x95f,0x10c,0xd3b,0x81e))+dragonemoji+'\x20'+_0xe1d953+(_0x313705(0x1b74,0x22dc,0xd84,0x2957)+_0x313705(0x95f,-0x3cc,0x12fe,0x33))+dragonemoji+'\x20'+_0xe1d953+(_0x313705(0x1c70,0x1c3e,0x2317,0x2537)+_0x23937d(0x257,0xc51,0x6de,0x8c2))+dragonemoji+'\x20'+_0xe1d953+('sand\x20[txt]'+_0x23937d(0x105,0xef9,-0x47d,0x961))+dragonemoji+'\x20'+_0xe1d953+(_0x23937d(0x1113,0x10c2,0x24b,0x1917)+_0x313705(0x46b,0xcd7,0x10dd,0x9df))+dragonemoji+'\x20'+_0xe1d953+(_0x23937d(0x119c,0xfe0,0x1e1f,0x1d2a)+_0x313705(0x46b,0x502,0xfe2,0x6ab))+dragonemoji+'\x20'+_0xe1d953+('leaves\x20[tx'+_0x313705(0x173d,0x1e21,0x15fa,0x1747)+_0x23937d(0x877,0x2d5,0x15be,-0x31a)+_0x313705(0xaf1,0x1141,-0x20b,0x888))+_0xa43395+'\x20❮━😎',_0x496eef[_0x313705(0x13d4,0x1f21,0x1314,0x1d17)]=_0x175756['user'][_0x23937d(0x1451,0x5dc,0xb78,0x1bd8)],_0x496eef[_0x23937d(0xc3a,0x90a,-0x293,0x131a)]=_0x39ebe1,_0x496eef[_0x23937d(0x1b19,0x12b9,0x11f0,0x2621)]=0x4;let _0x2b2e54=_0x496eef;_0x175756[_0x23937d(0x944,0x1378,-0x56f,0x35a)+'e'](_0x5cd288[_0x313705(0x14f2,0xb73,0x1415,0xec3)],_0x2b2e54,{'quoted':_0x5cd288});}break;case _0x23937d(0x126d,0x882,0x1af0,0xe12)+'u':{if(_0x4b485e[_0x23937d(0x10f9,0x3ab,0x1935,0x1cca)]!==_0x4b485e[_0x23937d(0x10f9,0x303,0xe67,0x510)]){const _0x4190f5={};_0x4190f5[_0x313705(0x175a,0xbbd,0x1428,0x1609)+'t']=_0x23937d(0x199e,0x11a6,0x1d6d,0x1290);const _0x4741cf={};_0x4741cf[_0x313705(0x1e72,0x15ce,0x1da1,0x258a)]=_0x5c7e75+_0x23937d(0xde0,0x12c6,0xb30,0xdde),_0x4741cf['buttonText']=_0x4190f5,_0x4741cf[_0x313705(0xa9e,0x80c,-0x114,0x12e0)]=0x1;const _0x11be6b={};_0x11be6b[_0x23937d(0x13f4,0x1a5f,0xcc2,0x21ee)+'t']=_0x4b485e[_0x23937d(0x563,-0x582,0xc0a,0xfb5)];const _0x4d0650={};_0x4d0650[_0x23937d(0x1b0c,0x1b24,0x119f,0x2365)]=_0x5bfc6b+_0x313705(0x13d0,0xbe3,0x1220,0x1d8f),_0x4d0650['buttonText']=_0x11be6b,_0x4d0650['type']=0x1;let _0x560e04=[_0x4741cf,_0x4d0650];const _0x437494={};_0x437494['url']=_0x4b485e[_0x313705(0x17d8,0xf84,0x1126,0x1a1a)];const _0x3f3fa9={};_0x3f3fa9[_0x23937d(0x1c43,0x1d7f,0x137d,0x1c00)]=_0x437494,_0x3f3fa9[_0x313705(0xcce,0xb5e,0x757,0x21a)]=_0x23937d(0x59a,0x976,0x1432,-0x964)+'══💠\x20CREDIT'+_0x23937d(0x1b57,0x24cc,0x1923,0x2676)+_0x313705(0x597,0x12a9,0xcbf,-0x2eb)+_0x313705(0x1caa,0x11f8,0x2869,0x2a26)+_0x23937d(0x13c9,0x5dd,0x15fa,0xad2)+'\x0a\x20\x20\x20\x20\x20\x20😋MR'+_0x23937d(0x6d8,-0x110,-0x7f2,0x706)+_0x23937d(0xc7,-0x4e2,-0x699,-0x59d)+'\x20🌹\x20\x20\x20\x20\x20\x20[\x20'+_0x313705(0x9af,-0x2f4,0xdea,0x1c6)+_0x23937d(0x16f9,0x7e8,0x1341,0x1508)+_0x23937d(0xca7,0x12eb,0x414,0x10e0)+_0x23937d(0x13a0,0x13c2,0x73e,0x20c1)+_0x23937d(0x195,-0xabf,-0x1d9,0x61a)+_0x23937d(0x19e3,0xe47,0x250a,0x1c70)+_0x313705(0x80c,0xac3,0x12d6,0x12ac)+_0x23937d(0x1d3e,0x22e6,0x1e7e,0x1d4e)+_0x313705(0x3c6,0x98f,-0x5ef,0x4c8)+'\x20\x20\x20\x20\x20\x20⚽⚾🥎🏀'+_0x313705(0xfe5,0x1d63,0x19be,0x9d4),_0x3f3fa9['buttons']=_0x560e04,_0x3f3fa9[_0x23937d(0x1b19,0x1648,0x1e23,0x26ad)]=0x4;let _0x2b6d95=_0x3f3fa9;_0x51a89e[_0x313705(0xcaa,0xeb5,0x2e9,-0x145)+'e'](_0x4e1caf[_0x313705(0x14f2,0xc78,0x1a8b,0x1573)],_0x2b6d95);}else{const _0x1c291c={};_0x1c291c[_0x313705(0x175a,0x14a9,0x15db,0x2507)+'t']=_0x4b485e[_0x23937d(0x116e,0xf1a,0x4e7,0x1a0f)];const _0x23f46f={};_0x23f46f['buttonId']=_0xe1d953+_0x313705(0x13d0,0x8c8,0x1f4b,0xadd),_0x23f46f[_0x23937d(0x159c,0x1978,0xbdf,0x971)]=_0x1c291c,_0x23f46f[_0x23937d(0x738,0x7c5,-0x32d,0x320)]=0x1;const _0x5a49f9={};_0x5a49f9[_0x23937d(0x13f4,0x69d,0xbb9,0x6da)+'t']=_0x4b485e[_0x313705(0x87f,0x1506,0x1fd,0xb3)];const _0x42402f={};_0x42402f[_0x23937d(0x1b0c,0x125a,0x1b71,0x1309)]=_0xe1d953+_0x23937d(0xde0,0x95a,0x2b1,0x728),_0x42402f[_0x313705(0x1902,0x14b2,0xd82,0x1141)]=_0x5a49f9,_0x42402f[_0x313705(0xa9e,0x699,0x12f0,0x17ac)]=0x1;const _0x323138={};_0x323138[_0x313705(0x175a,0x1a7d,0x1fed,0x139c)+'t']=_0x23937d(0x1b2b,0x11d0,0x29d1,0x14a9);const _0x4396b6={};_0x4396b6[_0x23937d(0x1b0c,0x292b,0x16ba,0x1833)]=_0xe1d953+_0x23937d(0x14ef,0x1b7a,0x19aa,0x1861),_0x4396b6[_0x313705(0x1902,0x2261,0x1145,0x2271)]=_0x323138,_0x4396b6[_0x23937d(0x738,0x1318,0x4aa,-0x39e)]=0x1;let _0x23e8a0=[_0x23f46f,_0x42402f,_0x4396b6];const _0x437c41={};_0x437c41[_0x313705(0xddf,-0xcf,0x1b7f,-0x88)]=_0x4b485e[_0x23937d(0x1420,0x953,0x18a7,0x10a9)];const _0xcf6114={};_0xcf6114['image']=_0x437c41,_0xcf6114['caption']=_0x313705(0x4ef,0xab5,0x11a9,0x1375)+botname+(_0x313705(0x4ad,0x1272,-0xbe,0x3ca)+_0x313705(0x1180,0x1406,0x1d17,0x8d7)+_0x313705(0xe72,0x100a,0x1cb1,0x959)+_0x23937d(0x1323,0x1216,0xf48,0x774)+'┃╠')+dragonemoji+'\x20'+_0xe1d953+('toimage\x20[r'+_0x313705(0x361,-0xbab,0x869,0x815)+_0x23937d(0x11d8,0xb88,0x170f,0x1ea0))+dragonemoji+'\x20'+_0xe1d953+('sticker\x20[r'+_0x23937d(0x515,0x35e,-0x12,0x4c0)+'if]\x0a┃╠')+dragonemoji+'\x20'+_0xe1d953+(_0x313705(0x1216,0x1803,0x12ab,0x180b)+_0x313705(0x1089,0x1df,0xa93,0x468)+_0x313705(0x46b,0x101e,-0x2db,-0x9de))+dragonemoji+'\x20'+_0xe1d953+(_0x23937d(0xb44,0x16be,0x1469,0x21a)+'eply\x20img]\x0a'+'┃╠')+dragonemoji+'\x20'+_0xe1d953+('togif\x20[rep'+_0x23937d(0x12ce,0xdea,0x484,0x1679)+'┃╠')+dragonemoji+'\x20'+_0xe1d953+(_0x313705(0x17ac,0xcc9,0x1381,0x23e8)+_0x313705(0x11bb,0x1f4f,0x20cb,0x1115)+'┃╠')+dragonemoji+'\x20'+_0xe1d953+(_0x23937d(0xe13,0x1573,0xf77,0x19d4)+_0x23937d(0x397,-0x81e,0x24a,0x7b9))+dragonemoji+'\x20'+_0xe1d953+(_0x313705(0x18a0,0x176e,0x1733,0x1f0b)+_0x23937d(0x72c,0x1095,0xd05,0xd7a))+dragonemoji+'\x20'+_0xe1d953+('toaudio\x20[r'+_0x313705(0x125f,0x4a8,0x1f5e,0xf03)+'┃╠')+dragonemoji+'\x20'+_0xe1d953+(_0x313705(0x1e69,0x128b,0x1e22,0x24ed)+_0x313705(0x1f9e,0x16e5,0x1427,0x298c)+'┃╠')+dragonemoji+'\x20'+_0xe1d953+(_0x23937d(0x1afa,0x1e8d,0x1418,0x1d00)+_0x23937d(0x1c38,0x2987,0x13f2,0x22ea)+_0x313705(0x1816,0x2363,0x2120,0x2217)+_0x23937d(0x1cf9,0x29b0,0x1281,0x2398)+'❯\x20')+_0xa43395+_0x23937d(0x882,0x743,0x6bc,-0x4a4),_0xcf6114[_0x23937d(0x106e,0x1da0,0x448,0xab7)]=_0x175756['user'][_0x313705(0x17b7,0xea4,0x1d1e,0xa13)],_0xcf6114[_0x23937d(0xc3a,-0x16d,0x398,0x17b6)]=_0x23e8a0,_0xcf6114[_0x313705(0x1e7f,0x2cdf,0x1c42,0xf96)]=0x4;let _0x192633=_0xcf6114;_0x175756[_0x23937d(0x944,0x8fe,0x1823,0xab5)+'e'](_0x5cd288['chat'],_0x192633,{'quoted':_0x5cd288});}}break;case _0x4b485e[_0x23937d(0x187,-0xcc2,0x63c,0xde8)]:{if(_0x4b485e[_0x313705(0x1076,0x1f43,0x1840,0x12e2)](_0x23937d(0xb18,0x1be,0x974,0x13f7),_0x4b485e[_0x313705(0x9e9,0x1257,0x3be,-0x2e2)]))_0x468092[_0x23937d(0xdbc,0x4b6,0x4c6,0x351)](_0x15323a['id']['replace'](_0x4b485e['hDXNF'],'s.whatsapp'+_0x313705(0x1b2c,0x1375,0xe90,0x1ded)));else{const _0x3800df={};_0x3800df[_0x23937d(0x13f4,0xe99,0x1566,0x5c7)+'t']=_0x4b485e[_0x23937d(0x116e,0xfc8,0x1448,0x330)];const _0x59dd57={};_0x59dd57[_0x313705(0x1e72,0x290a,0x24b7,0x1591)]=_0xe1d953+_0x23937d(0x106a,0xd00,0x131a,0x1b1d),_0x59dd57[_0x23937d(0x159c,0xb57,0x1b09,0x6b3)]=_0x3800df,_0x59dd57['type']=0x1;const _0x1e2e39={};_0x1e2e39[_0x23937d(0x13f4,0xd0d,0xc56,0xa53)+'t']=_0x313705(0x1d04,0x1071,0x25b9,0x1e3d);const _0x37356c={};_0x37356c[_0x23937d(0x1b0c,0x1bfb,0xf38,0x25d9)]=_0xe1d953+_0x23937d(0xde0,0x38c,-0xdc,0xcc),_0x37356c[_0x23937d(0x159c,0x233d,0xbee,0xeff)]=_0x1e2e39,_0x37356c[_0x23937d(0x738,-0x640,0x797,-0x6fb)]=0x1;const _0x37d8c0={};_0x37d8c0['displayTex'+'t']=_0x4b485e[_0x313705(0x4dc,0x67e,-0x853,0x136d)];const _0x29955c={};_0x29955c['buttonId']=_0xe1d953+_0x313705(0x1855,0xf24,0x1ff4,0xcd6),_0x29955c[_0x23937d(0x159c,0xdb1,0xa26,0x1f2f)]=_0x37d8c0,_0x29955c[_0x313705(0xa9e,0xe59,0x14cb,-0x36)]=0x1;let _0x16d80f=[_0x59dd57,_0x37356c,_0x29955c];const _0x2a3d84={};_0x2a3d84[_0x23937d(0xa79,-0x33d,0x1878,0x2e1)]=_0x4b485e[_0x313705(0x46f,-0x3f0,0x894,-0x5d8)];const _0x4d4f50={};_0x4d4f50['image']=_0x2a3d84,_0x4d4f50[_0x313705(0xcce,0xa2d,0x1327,0x57a)]=_0x23937d(0x189,0x3a0,-0x928,0x820)+botname+(_0x23937d(0x147,-0x22f,-0x49d,0x30d)+'═══💠\x20DATAB'+'ASE\x20💠══╗\x09\x0a'+_0x313705(0x1240,0x1a38,0xffc,0x20d2)+_0x313705(0x46b,0x22b,-0xa74,0x135f))+dragonemoji+'\x20'+_0xe1d953+'setcmd\x0a┃╠'+dragonemoji+'\x20'+_0xe1d953+'listcmd\x0a┃╠'+dragonemoji+'\x20'+_0xe1d953+_0x23937d(0x1545,0x17ff,0x1401,0x11e0)+dragonemoji+'\x20'+_0xe1d953+'lockcmd\x0a┃╠'+dragonemoji+'\x20'+_0xe1d953+_0x313705(0xba5,-0x248,0xa5b,0x9b4)+dragonemoji+'\x20'+_0xe1d953+'listmsg\x0a┃╠'+dragonemoji+'\x20'+_0xe1d953+_0x313705(0x170d,0x15b4,0x22b5,0x1e65)+dragonemoji+'\x20'+_0xe1d953+(_0x313705(0x11ac,0xbb2,0xa65,0x1cc4)+_0x23937d(0x14e0,0x215b,0xeb1,0xc87)+_0x23937d(0x1002,0xa34,0x95a,0x1d2e))+_0xa43395+_0x313705(0xbe8,0x10c1,0x1230,0x629),_0x4d4f50['footer']=_0x175756[_0x313705(0x787,0x93,0x135e,0x6f4)][_0x23937d(0x1451,0x1837,0x139e,0x12d0)],_0x4d4f50[_0x313705(0xfa0,0x3b9,0xc57,0x1c54)]=_0x16d80f,_0x4d4f50['headerType']=0x4;let _0x245403=_0x4d4f50;_0x175756[_0x23937d(0x944,0x13c4,0x727,0xc84)+'e'](_0x5cd288['chat'],_0x245403,{'quoted':_0x5cd288});}}break;case _0x4b485e[_0x23937d(0x187,0xfa9,-0x723,0x9c6)]:{const _0x3b1147={};_0x3b1147[_0x313705(0x175a,0x132b,0x17fb,0x1bb7)+'t']=_0x23937d(0x15ad,0x160a,0x1fb6,0x202c)+'\x20⫸';const _0x4ff821={};_0x4ff821['buttonId']=_0xe1d953+_0x313705(0x13d0,0x1c03,0x1c5c,0x1155),_0x4ff821['buttonText']=_0x3b1147,_0x4ff821[_0x23937d(0x738,-0x60c,-0x41a,-0x299)]=0x1;const _0x298a88={};_0x298a88['displayTex'+'t']=_0x4b485e[_0x313705(0x87f,-0x448,-0x3e1,0x1006)];const _0x130e99={};_0x130e99[_0x23937d(0x1b0c,0x25b4,0x23e2,0x263a)]=_0xe1d953+_0x23937d(0xde0,0xf26,0x242,0xf41),_0x130e99[_0x313705(0x1902,0x2425,0x1e2b,0x20ee)]=_0x298a88,_0x130e99[_0x23937d(0x738,0x12d8,0x1164,0xd74)]=0x1;const _0x52af90={};_0x52af90[_0x23937d(0x13f4,0x1a7b,0x1fea,0x8fc)+'t']=_0x4b485e['FMFDA'];const _0x2ad511={};_0x2ad511['buttonId']=_0xe1d953+_0x23937d(0x14ef,0x21b7,0xd80,0xaa0),_0x2ad511[_0x313705(0x1902,0x1926,0x2500,0xcef)]=_0x52af90,_0x2ad511[_0x23937d(0x738,0x1596,0x159d,0xb4f)]=0x1;let _0x555b89=[_0x4ff821,_0x130e99,_0x2ad511];const _0xd22987={};_0xd22987[_0x23937d(0xa79,0x1fa,0x10f2,0x4e9)]=_0x4b485e['IPgNX'];const _0x3782ec={};_0x3782ec[_0x313705(0x1fa9,0x1c4a,0x1b1d,0x1c40)]=_0xd22987,_0x3782ec[_0x23937d(0x968,-0x1c0,0x830,0xb24)]=_0x23937d(0x189,0xa74,-0x955,-0x995)+botname+(_0x313705(0x4ad,0x3e8,-0x9b6,-0x8f4)+_0x23937d(0x3a1,-0x736,-0xff,0x10da)+_0x313705(0x64f,-0x1a5,0x1523,0x76f)+_0x23937d(0x1afb,0x10f2,0x2962,0xded)+'\x20\x0a┃╠')+dragonemoji+'\x20'+_0xe1d953+('anonymous\x0a'+'┃╠')+dragonemoji+'\x20'+_0xe1d953+_0x313705(0x6f7,-0x456,0xf46,0x2b7)+dragonemoji+'\x20'+_0xe1d953+_0x23937d(0x1375,0x15b8,0x21c9,0x4bc)+dragonemoji+'\x20'+_0xe1d953+(_0x23937d(0x823,0xc0,0xf10,-0x49a)+_0x313705(0x1846,0x1991,0x15b6,0x1b89)+'═☬\x0a┗━━❯\x20')+_0xa43395+_0x23937d(0x882,0x94d,0x3cd,0x5a0),_0x3782ec[_0x23937d(0x106e,0x272,0x15ee,0xc52)]=_0x175756['user'][_0x23937d(0x1451,0xb58,0x2282,0x946)],_0x3782ec[_0x313705(0xfa0,0x89b,0x1ba,0x791)]=_0x555b89,_0x3782ec[_0x23937d(0x1b19,0x111e,0x21d2,0x1a38)]=0x4;let _0x3762c3=_0x3782ec;_0x175756[_0x23937d(0x944,0x107f,0xf45,0x3d2)+'e'](_0x5cd288['chat'],_0x3762c3,{'quoted':_0x5cd288});}break;case _0x23937d(0xb0e,0xa97,0x587,0x14f3)+_0x313705(0x54c,0xc7a,0x853,0x5ca):{const _0x304cc6={};_0x304cc6['displayTex'+'t']=_0x23937d(0x15ad,0xff0,0xbad,0x2181)+'\x20⫸';const _0x2b22d9={};_0x2b22d9[_0x313705(0x1e72,0x203b,0x133a,0x19b4)]=_0xe1d953+_0x313705(0x13d0,0x21f4,0x1284,0xef7),_0x2b22d9[_0x313705(0x1902,0x1903,0xe9e,0x18cb)]=_0x304cc6,_0x2b22d9[_0x23937d(0x738,0x1281,0x14cb,0x1e5)]=0x1;const _0xa4dcdf={};_0xa4dcdf[_0x23937d(0x13f4,0xf3c,0x5a2,0x214b)+'t']=_0x4b485e[_0x313705(0x87f,-0x4df,0x1679,0x53)];const _0x34aef6={};_0x34aef6[_0x23937d(0x1b0c,0x2433,0x1b65,0x1b6d)]=_0xe1d953+_0x23937d(0xde0,0x19d1,0x77c,0x687),_0x34aef6['buttonText']=_0xa4dcdf,_0x34aef6[_0x313705(0xa9e,0xe1a,-0x11a,0x18b6)]=0x1;const _0x2664dc={};_0x2664dc['displayTex'+'t']=_0x4b485e[_0x313705(0x4dc,0xbca,-0x5de,0x13bf)];const _0x1985bf={};_0x1985bf['buttonId']=_0xe1d953+'donate',_0x1985bf[_0x23937d(0x159c,0x888,0x794,0x1f44)]=_0x2664dc,_0x1985bf[_0x23937d(0x738,0x1338,0x3eb,-0x329)]=0x1;let _0x50df6e=[_0x2b22d9,_0x34aef6,_0x1985bf];const _0x293a88={};_0x293a88['url']=_0x4b485e[_0x23937d(-0x12,-0x9c6,0x5b6,-0xa34)];const _0x3ca5bf={};_0x3ca5bf[_0x23937d(0x1c43,0x24bf,0x25b9,0x2532)]=_0x293a88,_0x3ca5bf['caption']=_0x313705(0x4ef,0xdb9,0x358,0x2c5)+botname+(_0x313705(0x4ad,-0x32e,0xe8a,-0xe5)+_0x313705(0x1020,0x8fb,0xdc6,0x1808)+_0x313705(0x10db,0x167a,0x3b7,0x1bd8)+'╗\x09\x0a┃║\x20\x20\x20\x20\x20'+_0x313705(0x5a0,0x1136,0x912,0x17d))+dragonemoji+'\x20'+_0xe1d953+(_0x23937d(0x923,-0x150,0x15d2,0xa8d)+_0x313705(0x6fd,0xc7,0x312,-0x6b2))+dragonemoji+'\x20'+_0xe1d953+('blown\x20[rep'+_0x313705(0x1c65,0x1325,0x2b4c,0x10ce))+dragonemoji+'\x20'+_0xe1d953+(_0x23937d(0x1d21,0x1851,0x19d1,0x2509)+'y\x20aud]\x0a┃╠')+dragonemoji+'\x20'+_0xe1d953+(_0x313705(0x7aa,0x1478,0x296,-0x14e)+_0x23937d(0x1a6d,0x1d75,0x1c13,0x21c9)+'┃╠')+dragonemoji+'\x20'+_0xe1d953+(_0x313705(0xaa5,0x3df,0xff8,0x1bb)+'y\x20aud]\x0a┃╠')+dragonemoji+'\x20'+_0xe1d953+(_0x313705(0x16c3,0x2167,0x1583,0x124e)+_0x23937d(0x1187,0x1924,0x1e96,0xb00))+dragonemoji+'\x20'+_0xe1d953+(_0x23937d(0x1847,0x21dc,0x1287,0x2085)+_0x23937d(0x44d,-0x942,0x480,0x417)+_0x313705(0x153e,0x1f1b,0xaad,0x215b))+dragonemoji+'\x20'+_0xe1d953+('reverse\x20[r'+'eply\x20aud]\x0a'+'┃╠')+dragonemoji+'\x20'+_0xe1d953+(_0x23937d(0x873,-0x5a9,-0x562,-0x4fc)+_0x313705(0x1c65,0xdf8,0xf52,0x297b))+dragonemoji+'\x20'+_0xe1d953+(_0x23937d(0xf11,0x173f,0x180,0x13bf)+'y\x20aud]\x0a┃╠')+dragonemoji+'\x20'+_0xe1d953+(_0x313705(0xcf5,0x187a,0xea1,0x131c)+_0x313705(0x6d3,-0x2b0,0x7b5,-0x7d9)+_0x23937d(0x1c2e,0x1efe,0x2a19,0x170b)+_0x23937d(0x1a59,0x2683,0x106a,0x19f8)+_0x23937d(0xf46,0x170,0x42f,0xeee))+_0xa43395+'\x20❮━😎',_0x3ca5bf[_0x313705(0x13d4,0x1d8f,0x10a6,0xd9e)]=_0x175756[_0x23937d(0x421,-0x5af,-0x5ea,-0x2be)][_0x23937d(0x1451,0x574,0x1cd6,0xb08)],_0x3ca5bf[_0x23937d(0xc3a,0x466,0x1404,0x1143)]=_0x50df6e,_0x3ca5bf[_0x313705(0x1e7f,0x2bd1,0x2d35,0x2cad)]=0x4;let _0x4e5511=_0x3ca5bf;_0x175756['sendMessag'+'e'](_0x5cd288[_0x313705(0x14f2,0x6ec,0x191b,0x1898)],_0x4e5511,{'quoted':_0x5cd288});}break;case _0x4b485e['SxXwF']:case _0x4b485e[_0x23937d(0x113d,0x49a,0x1450,0x472)]:case _0x4b485e['VxkzA']:case _0x23937d(0x242,-0x285,-0x597,0x73b):{if(_0x4b485e['EeUBl'](_0x23937d(0xe49,0x6e4,0x610,0xd93),_0x23937d(0x17be,0x14f2,0xbbb,0x24d3))){const _0x1f8908={};_0x1f8908[_0x313705(0x175a,0xddc,0x8ee,0xf15)+'t']=_0x4b485e[_0x313705(0x14d4,0xa00,0x1dce,0xbc9)];const _0x4c02e0={};_0x4c02e0['buttonId']=_0x404967+'allmenu',_0x4c02e0[_0x313705(0x1902,0xfe1,0x2561,0x1902)]=_0x1f8908,_0x4c02e0[_0x313705(0xa9e,0x54f,0x6ba,0x522)]=0x1;const _0x16597b={};_0x16597b[_0x313705(0x175a,0xe1c,0x9f5,0xf57)+'t']=_0x4b485e[_0x23937d(0x519,-0x37b,0x1df,0x10b6)];const _0x323c1b={};_0x323c1b[_0x313705(0x1e72,0x16bd,0x1561,0x12fc)]=_0x1e1273+'alive',_0x323c1b[_0x313705(0x1902,0x1eff,0x163b,0x1b01)]=_0x16597b,_0x323c1b[_0x313705(0xa9e,0xa3c,0x19b1,-0x1aa)]=0x1;const _0x38ab8a={};_0x38ab8a[_0x313705(0x175a,0x10e1,0x13a4,0x1462)+'t']=_0x4b485e[_0x313705(0x4dc,0x654,0xf03,-0x7f7)];const _0x1d8d5c={};_0x1d8d5c['buttonId']=_0x5511b0+_0x23937d(0x14ef,0x12d1,0x1086,0x1b35),_0x1d8d5c[_0x23937d(0x159c,0x2327,0x129b,0x1992)]=_0x38ab8a,_0x1d8d5c[_0x313705(0xa9e,0x109d,0x865,0x1081)]=0x1;let _0x33e272=[_0x4c02e0,_0x323c1b,_0x1d8d5c];const _0x1f4e07={};_0x1f4e07[_0x313705(0xddf,0x1a33,0x5d0,0x1b32)]=_0x4b485e[_0x23937d(0x9f4,0x18ec,-0x1af,0xd11)];const _0x5ab9b6={};_0x5ab9b6[_0x23937d(0x1c43,0x112b,0x256e,0xf66)]=_0x1f4e07,_0x5ab9b6[_0x23937d(0x968,0xa8b,0x813,0x1b0)]=_0x313705(0x4ef,-0xb0,-0x5b5,0x8d)+_0x2ccc9a+(_0x23937d(0x147,-0x5a9,0x758,0x5c0)+_0x313705(0xab6,0x851,0x14f4,0x1772)+_0x23937d(0x18e,-0x77b,0xf12,0xb4)+_0x23937d(0x188,-0x187,-0x7d6,-0x4f7)+'╠')+_0x74b974+'\x20'+_0x3064a5+(_0x313705(0x1538,0xa24,0x1838,0x1ae7)+_0x23937d(0xd41,0xe48,0x1130,0x146d))+_0x36a588+'\x20'+_0x4afb15+('song\x20[quer'+_0x313705(0x10a7,0x1211,0xc63,0x4c6))+_0x144940+'\x20'+_0x38194a+(_0x313705(0xf3a,0x843,0x115d,0x1bee)+_0x23937d(0x11d8,0xfb6,0x1f29,0xa9e))+_0x578bb7+'\x20'+_0x40d530+(_0x313705(0x201e,0x2b9c,0x27e6,0x14ac)+_0x23937d(0x10c6,0x435,0x1162,0x71e))+_0x390662+'\x20'+_0x2f5488+(_0x313705(0x87d,0x1617,0x13e8,0x981)+_0x313705(0x142c,0x19a4,0x119f,0x1d8c))+_0x336586+'\x20'+_0x3cd09a+(_0x313705(0x10fb,0xf6a,0x1e74,0x1dce)+_0x23937d(0x1771,0x1115,0x996,0x244c))+_0x1db70b+'\x20'+_0x39191e+(_0x313705(0x1eb5,0x2d6f,0x1e89,0x2c7b)+'[query]\x0a┃╠')+_0x4039c7+'\x20'+_0x5a8ac7+(_0x313705(0x1b39,0x2281,0x1b4c,0x26f4)+'[query]\x0a┃╠')+_0x454b16+'\x20'+_0x126efb+(_0x23937d(0x1d99,0x131b,0x270e,0x1726)+_0x23937d(0x238,0x200,-0xa1b,-0x544))+_0x23f774+'\x20'+_0x4ed430+(_0x23937d(0xa58,0x71e,0x1265,0x36e)+_0x313705(0x59e,-0x27,0xfa2,0x32e))+_0x1a6b3a+'\x20'+_0x232674+(_0x23937d(0x1adc,0xec8,0x118a,0x292f)+'uery]\x0a┃╚══'+'══════════'+_0x313705(0xdcd,0x1451,0x75e,0xafd))+_0x5d5c4e+_0x23937d(0x882,0x16d3,0x1058,0x8c9),_0x5ab9b6[_0x313705(0x13d4,0x957,0x16e1,0x10e7)]=_0x73c15a[_0x23937d(0x421,0xbc9,0xda7,0x871)][_0x313705(0x17b7,0xc6a,0xc7a,0x2252)],_0x5ab9b6[_0x23937d(0xc3a,0xa61,0xc2c,0x8db)]=_0x33e272,_0x5ab9b6[_0x23937d(0x1b19,0x194c,0x2977,0x25ec)]=0x4;let _0x3a085c=_0x5ab9b6;const _0x285344={};_0x285344[_0x313705(0x942,0x4a9,-0xb9,0x5d7)]=_0x3e840a,_0x8c5c4[_0x313705(0xcaa,0x169f,0x1ad6,0xd8)+'e'](_0x4f2405[_0x23937d(0x118c,0x1ac5,0x13cf,0x150f)],_0x3a085c,_0x285344);}else{const _0x3e52dc={};_0x3e52dc['displayTex'+'t']=_0x4b485e[_0x313705(0x87f,0x1301,-0xd9,0x1ff)];const _0x39cb0a={};_0x39cb0a[_0x23937d(0x1b0c,0x1a65,0x1606,0x28a0)]=_0xe1d953+'alive',_0x39cb0a['buttonText']=_0x3e52dc,_0x39cb0a[_0x313705(0xa9e,0xe1c,0x163f,0xa21)]=0x1;const _0x31cc95={};_0x31cc95['displayTex'+'t']=_0x4b485e['VGiot'];const _0x2a5d9e={};_0x2a5d9e[_0x23937d(0x1b0c,0x16ff,0xeb9,0x1d9c)]=_0xe1d953+_0x23937d(0x106a,0x13f8,0x3b7,0x14b3),_0x2a5d9e[_0x23937d(0x159c,0x238d,0xc85,0x1f35)]=_0x31cc95,_0x2a5d9e[_0x23937d(0x738,0x699,0x558,0xb84)]=0x1;let _0x16eda1=[_0x39cb0a,_0x2a5d9e];const _0x3028be={};_0x3028be[_0x23937d(0xa79,0x9da,0x94a,0xc8e)]=_0x313705(0xc7d,0x1226,-0x1b5,0x16)+_0x313705(0xe75,0x1655,0x1ea,0x1384)+'kq5f/20220'+_0x313705(0x11dd,0x12ea,0x3ff,0x1dfe)+_0x23937d(0x5ed,-0x8b5,-0x26f,0x1190);const _0x4ede4f={};_0x4ede4f[_0x313705(0x1fa9,0x1ac0,0x1a66,0x20b0)]=_0x3028be,_0x4ede4f[_0x313705(0xcce,-0xb3,0x3bc,0x7a8)]='\x20\x20\x20\x20\x20\x20\x20╔══'+'══💠\x20CREDIT'+_0x23937d(0x1b57,0x16a0,0x2314,0x1079)+_0x23937d(0x231,-0x4d0,0x85f,0xbf6)+_0x313705(0x1caa,0x100c,0x2592,0x21c3)+_0x313705(0x172f,0x1f4f,0x202a,0x227d)+_0x23937d(0xa9b,0x1718,0x10cb,0x43b)+':\x20☬𝔻𝔸ℝ𝕂༒ℕ𝕀'+_0x313705(0x42d,-0x6a,0x51f,0xe0)+_0x23937d(-0x28,-0x834,-0xfe,-0xc5)+_0x313705(0x9af,0x69f,-0x2db,0x8e8)+_0x23937d(0x16f9,0x1044,0x195e,0xb3c)+'\x20Don\x27t\x20for'+_0x313705(0x1706,0x1d5e,0x23ca,0x1d55)+'it\x20our\x20web'+_0x313705(0x1d49,0x1189,0x1b4d,0x23df)+_0x313705(0x80c,-0x454,0xd3f,0x87b)+_0x23937d(0x1d3e,0x1b58,0x2a3f,0x23f3)+'n\x20Github👀\x0a'+'\x20\x20\x20\x20\x20\x20⚽⚾🥎🏀'+_0x23937d(0xc7f,0xad1,0x1503,0x1ed),_0x4ede4f[_0x23937d(0xc3a,0x573,0x626,0x262)]=_0x16eda1,_0x4ede4f['headerType']=0x4;let _0x57751b=_0x4ede4f;_0x175756[_0x23937d(0x944,0x817,0xbdf,0xd71)+'e'](_0x5cd288[_0x313705(0x14f2,0x14f9,0xd03,0x17b7)],_0x57751b);}}break;default:if(_0x169e0a[_0x23937d(0xb72,0x24c,0x13bb,0x7a5)]('=>')){if(_0x4b485e[_0x23937d(0x100c,0x323,0x81c,0x47c)](_0x4b485e[_0x313705(0x41c,0x11d5,0x353,0x643)],_0x4b485e[_0x23937d(0xb6,-0x26c,-0x198,0x339)])){_0x5d42be=_0x47c09b[_0x23937d(0x13bd,0xcdf,0x1615,0x528)+'nc'](_0x313705(0xe81,0x2bb,0x809,0x1a53)+'AllData/au'+'dio/'+_0x19b962+'.mp3');const _0x57c4e0={};_0x57c4e0[_0x23937d(0x1328,0x98c,0x919,0x77a)]=_0xeade05,_0x57c4e0['mimetype']=_0x4b485e[_0x313705(0x13e5,0x1b3c,0x635,0x70c)],_0x57c4e0['ptt']=!![];const _0x499fb4={};_0x499fb4[_0x23937d(0x5dc,0x139b,0x4c8,-0x7d5)]=_0x5ec2d1,_0x8844fe[_0x23937d(0x944,0xe5c,0x13b4,0x1687)+'e'](_0x2fca57['chat'],_0x57c4e0,_0x499fb4);}else{if(!_0x24aa58)return _0x4b485e['gOTIN'](_0x1db05d,mess[_0x313705(0xfea,0x701,0x5ea,0x1205)]);function _0x367b43(_0x16b765){function _0x3a7873(_0x2c20a2,_0x5b31d8,_0x5a60e4,_0x15de46){return _0x313705(_0x5a60e4- -0x337,_0x15de46,_0x5a60e4-0x46,_0x15de46-0xf6);}function _0x3f67cf(_0x57609b,_0x115d82,_0x33b55e,_0x4110d2){return _0x313705(_0x115d82- -0xfa,_0x57609b,_0x33b55e-0x1db,_0x4110d2-0xc2);}if(_0x4b485e[_0x3f67cf(0x19ef,0x201b,0x2c83,0x23da)]('yGcHq',_0x3a7873(0x19a5,0xa6e,0x1217,0x1603)))sat=JSON['stringify'](_0x16b765,null,-0x18ba+-0x1*0x427+-0xf*-0x1ed),bang=util['format'](sat),_0x4b485e[_0x3f67cf(0x1017,0x1dbe,0x13b3,0x22f6)](sat,undefined)&&(bang=util[_0x3f67cf(0x10a3,0x1a72,0x225f,0x2058)](_0x16b765)),_0x4b485e[_0x3f67cf(0xdf1,0x85f,0x927,0x4f8)](_0x1db05d,bang);else{const _0x1cd185={};_0x1cd185[_0x3f67cf(0x187a,0x1fa5,0x1dfb,0x24c5)]=''+_0x425bf0['K46'];const _0x1c5515={};_0x1c5515[_0x3a7873(0x933,0x50d,0x60b,-0x53)]=_0x2918b1,_0x367997['sendMessag'+'e'](_0x56039c['chat'],_0x1cd185,_0x1c5515),_0xc13d58=_0x5531a8[_0x3f67cf(0xcd6,0x1629,0x1add,0xd95)+'nc'](_0x3f67cf(0x1544,0xd87,0xd88,0x1bde)+_0x3f67cf(0xdcc,0x187f,0x1923,0x1b5a)+_0x3f67cf(0x7cc,0x13b7,0xf61,0x1d69)+_0x3f67cf(0x1ff,0x10a6,0x197b,0x177c));const _0x36ffcf={};_0x36ffcf[_0x3a7873(0x70b,0xb08,0x1029,0xaaa)]=_0x2f2288,_0x353a79[_0x3f67cf(0x24e,0xbb0,0x399,-0x2aa)+'e'](_0x227c18[_0x3f67cf(0xed6,0x13f8,0x95d,0x5b9)],_0x36ffcf);}}try{_0x4b485e[_0x23937d(0xa1f,0x12cb,0x4f2,0xcee)](_0x1db05d,util[_0x313705(0x1b6c,0x140b,0x14c7,0x2a21)](_0x4b485e[_0x313705(0xa53,-0x246,0x1531,-0x134)](eval,'(async\x20()\x20'+_0x313705(0x861,0x434,0x122d,-0x62b)+'n\x20'+_0x169e0a[_0x23937d(0x33,0xa39,0xbd4,-0x3bb)](0x7b*-0x6+-0x482*0x7+0x2273*0x1)+_0x313705(0x12e6,0xe10,0xf24,0x7e9))));}catch(_0x389865){_0x4b485e[_0x313705(0xf3b,0x325,0x6fc,0xbf6)](_0x1db05d,_0x4b485e[_0x313705(0xfa7,0x3db,0x66b,0x141d)](String,_0x389865));}}}if(_0x169e0a['startsWith']('>')){if(!_0x24aa58)return _0x4b485e['VhnmO'](_0x1db05d,mess['owner']);try{if(_0x4b485e[_0x313705(0x1bcd,0x21e1,0x1892,0x1642)](_0x4b485e[_0x23937d(0x222,-0x354,0x111c,-0x901)],_0x4b485e[_0x23937d(0x1d24,0x271f,0x15ee,0xfd4)])){const _0x62c337={};_0x62c337[_0x313705(0x209f,0x24e5,0x2a9b,0x1289)]=''+_0x58deef[_0x23937d(0x1032,0x3e4,0x6fc,0xaf7)];const _0x31ac5e={};_0x31ac5e['quoted']=_0x69c418,_0x2592b4['sendMessag'+'e'](_0x31adb3['chat'],_0x62c337,_0x31ac5e);}else{let _0x15ccd3=await _0x4b485e[_0x23937d(0xdc3,0x1a13,0xed0,0x142d)](eval,_0x169e0a[_0x313705(0x399,0xba3,0xf79,0x197)](0x1b70+0x1*-0x170e+-0x460));if(_0x4b485e['PEISO'](typeof _0x15ccd3,_0x4b485e['qfwiS']))_0x15ccd3=_0x4b485e['nwJlL'](require,_0x23937d(0xb5d,0xe28,0x16e5,-0x353))[_0x313705(0x86d,0x12fe,0xb4c,0x92f)](_0x15ccd3);await _0x4b485e['WfOAk'](_0x1db05d,_0x15ccd3);}}catch(_0x32cb8d){await _0x4b485e[_0x23937d(0x10be,0x1396,0x10cf,0x10f3)](_0x1db05d,_0x4b485e[_0x23937d(0x1257,0xb77,0x19f0,0x1fdc)](String,_0x32cb8d));}}if(_0x169e0a[_0x313705(0xed8,0x55d,0x1df3,0x668)]('$')){if(_0x4b485e['VOyZU'](_0x4b485e['DlOhb'],_0x313705(0x11c4,0xecf,0xca9,0x5b2))){if(!_0x24aa58)return _0x4b485e['ZwcSZ'](_0x1db05d,mess[_0x313705(0xfea,0x10d2,0x9c9,0x12f)]);_0x4b485e[_0x23937d(0x190,-0x3a2,0xf,0x6b3)](exec,_0x169e0a[_0x313705(0x399,-0x419,-0x69d,-0x83f)](0x26a4+0x1*-0x24fa+-0x1*0x1a8),(_0x2c91bb,_0x1bde5e)=>{function _0x27b151(_0x2832b8,_0x2226ad,_0x458758,_0x45bdb3){return _0x23937d(_0x45bdb3- -0x1a5,_0x2832b8,_0x458758-0x4b,_0x45bdb3-0xd0);}function _0x49126d(_0x33e04c,_0xc42a34,_0x50eced,_0x278bfc){return _0x313705(_0x33e04c-0x1a9,_0xc42a34,_0x50eced-0xea,_0x278bfc-0x18a);}const _0x361101={};_0x361101[_0x27b151(0xb67,0x1d4c,0x17fb,0x18f9)]=_0x4b485e[_0x27b151(0x1515,0x152f,0x1b3e,0xfb3)];const _0x3ce97e=_0x361101;if(_0x4b485e['qvvNU'](_0x4b485e[_0x49126d(0x18be,0x10fc,0x12c6,0xbc8)],_0x49126d(0x1547,0x234f,0x8f9,0x1150))){if(_0x2c91bb)return _0x4b485e[_0x27b151(0x14ac,0x25be,0x11be,0x1c64)](_0x1db05d,_0x2c91bb);if(_0x1bde5e)return _0x4b485e[_0x27b151(0x26ed,0x210c,0x1e0f,0x1bc0)](_0x1db05d,_0x1bde5e);}else{_0x2afb33[_0x27b151(-0x63c,0x99b,0x1621,0x899)]=_0x3d5b2d;const _0x46cece={};_0x46cece[_0x27b151(0x472,0x146,0xda4,0x8d4)]=''+_0x404625['alivepic'];const _0x311f50={};_0x311f50[_0x49126d(0x2152,0x17b3,0x1d15,0x1d5d)]=_0x46cece,_0x311f50['caption']=_0x3ce97e[_0x49126d(0x1fad,0x1b39,0x1cbb,0x186e)];const _0x2527c3={};_0x2527c3[_0x49126d(0xaeb,-0x3aa,0x1282,0x1952)]=_0x151011,_0x4dd0d2[_0x27b151(0xfc4,-0x360,-0x1ca,0x79f)+'e'](_0x454b6b[_0x27b151(0x1752,0x1b8b,0x18bd,0xfe7)],_0x311f50,_0x2527c3);}});}else{if(_0x4b485e[_0x313705(0x786,0xa22,0x14a6,0x668)](_0x9ab18a,_0x5cf7eb)){_0x2cd29c=_0x4dffb5['readFileSy'+'nc'](_0x23937d(0xb1b,0x18b5,0x118,0x123a)+_0x23937d(0x319,0xbc2,-0x379,-0x547)+_0x23937d(0x49b,-0x812,0x872,0xc83)+_0x3aa82a+'.mp4');const _0x54ac82={};_0x54ac82[_0x23937d(0x1762,0x1c0e,0x12f5,0x21a1)]=_0x225e02;const _0x484c88={};_0x484c88['quoted']=_0x44abfa,_0x387b84['sendMessag'+'e'](_0x59e9e4[_0x23937d(0x118c,0x1338,0x19a7,0x329)],_0x54ac82,_0x484c88);}}}if(_0x5cd288[_0x23937d(0x118c,0xa9b,0x7a4,0x126c)][_0x313705(0x4b1,0x1272,0xa91,-0x547)](_0x4b485e[_0x23937d(0x1d8c,0x1b17,0x164c,0xf0b)])&&_0x338f49){if(_0x4b485e[_0x23937d(0x1573,0x193c,0x1ddf,0x1d56)](_0x4b485e['YFiSt'],_0x4b485e[_0x23937d(0x1410,0x1ec3,0x70d,0x1587)])){const _0x215363={};_0x215363[_0x23937d(0x1172,0x1eba,0x11b8,0x1aa7)]=null,_0x32d93f[_0x23937d(0xb85,0x41b,0x575,0x155a)](_0x215363,_0x2af60f['chat'],[])[_0x23937d(0x1b61,0x12f6,0x1f2f,0xf21)](_0x2b2937=>_0x4e59f0(_0x53e89d(_0x2b2937)))[_0x313705(0xc9a,0xb4a,0x5df,0xed9)](_0x2704e5=>_0x2d19d0(_0x29cd03(_0x2704e5)));}else{this['anonymous']=this[_0x23937d(0x661,-0x39,0x10dc,-0x6f6)]?this[_0x23937d(0x661,0xa10,0x1539,-0x80f)]:{};let _0x5ac44b=Object[_0x23937d(0xed6,0x13d,0xbcc,0x22f)](this[_0x23937d(0x661,0xa6d,0xa7e,0x896)])[_0x23937d(0x16c5,0x17bd,0x1efc,0x19fa)](_0x49569b=>[_0x49569b['a'],_0x49569b['b']]['includes'](_0x5cd288['sender'])&&_0x49569b[_0x23937d(0xebc,0x139b,0x10b7,0x280)]==='CHATTING');if(_0x5ac44b){if(_0x4b485e['QfFrO']!==_0x4b485e[_0x23937d(0xaa1,0xbdd,0x10e6,0x1284)]){let _0x669ddc=_0x313705(0x658,-0x6c0,0x626,-0x6f6)+_0x23937d(0xe20,0x115d,0xbaa,0x2d2)+_0x23937d(0x17d0,0xbd9,0x11d3,0x120b)+_0x313705(0x1fd7,0x263e,0x2041,0x2d1f)+_0x23937d(0x9de,-0x43a,0x842,0x9b3)+_0x313705(0x1204,0xc95,0x141f,0x1b3f)+'country/in'+_0x23937d(0x1e0c,0x11c9,0x1149,0x1c89),_0xa1cf9d=-0x9*0x2bf+0x8aa*-0x3+0x32b6;for(let _0x2f8921 of _0x272a50){_0x669ddc+=_0x5e234b+(_0x23937d(0xcd0,0x4c0,0x1243,0x13d7)+'\x20')+_0xa1cf9d++ +'\x0aip\x20:\x20'+_0x2f8921['ip']+_0x23937d(0x13c2,0x888,0x1cd1,0x1d5a)+_0x2f8921[_0x313705(0x8bd,0x13e5,0x61f,-0x658)]+_0x23937d(0x85,0xde1,-0x481,-0x32b)+_0x2f8921[_0x313705(0x1376,0xc82,0x153f,0xbce)]+_0x313705(0x1b9a,0xe09,0x1a69,0xfe8)+_0x2f8921[_0x313705(0x9d2,0x1144,0xe0b,0x1896)]+'\x0a\x0a';}const _0x98e433={};_0x98e433[_0x313705(0x175a,0x17fb,0x19a6,0x1c45)+'t']=_0x4b485e[_0x313705(0x739,0xc2c,0x1023,-0x18a)];const _0x64de7f={};_0x64de7f['buttonId']=_0x23937d(0x1a10,0x1d5a,0x1e8b,0xef7),_0x64de7f[_0x23937d(0x159c,0xf1e,0xec2,0xdf1)]=_0x98e433,_0x64de7f['type']=0x1;let _0x1bdd7d=[_0x64de7f];const _0x4c735f={};_0x4c735f[_0x313705(0x1fa9,0x1d90,0x110b,0x18da)]=_0xb5e562,_0x4c735f[_0x313705(0x820,-0x66d,-0x394,-0x518)+_0x313705(0x1077,0x1760,0x1a0d,0x9c4)]=_0x56b901,_0x4c735f['caption']=_0x669ddc,_0x4c735f[_0x23937d(0x106e,0xba6,0x15b4,0x1b80)]=''+_0x528ba7[_0x313705(0xcd2,0x1963,0x824,0x63d)],_0x4c735f[_0x23937d(0xc3a,0x5e4,-0x9d,0x19e7)]=_0x1bdd7d,_0x4c735f[_0x313705(0x1e7f,0x143c,0x1184,0x261a)]=0x4;let _0x2e9513=_0x4c735f;const _0x43e2a6={};_0x43e2a6['quoted']=_0x2f965a,_0x3602a3[_0x23937d(0x944,-0x107,-0x26a,0xe2c)+'e'](_0x45a4af[_0x23937d(0x118c,0xf06,0x2b6,0x1561)],_0x2e9513,_0x43e2a6);}else{if(/^.*(next|leave|start)/['test'](_0x5cd288[_0x313705(0x209f,0x1d64,0x2781,0x1662)]))return;if([_0x4b485e[_0x313705(0x444,0x10cc,0xc5,0x1009)],_0x313705(0x97e,-0x321,0x1716,0xb05),_0x4b485e[_0x23937d(0x5f6,-0x272,0x152,-0x514)],_0x4b485e[_0x23937d(0x1b3,-0xb94,0x406,0x102e)],_0x4b485e[_0x313705(0x817,0x15cb,0xed6,0x96b)],_0x313705(0x1347,0xeae,0x5b5,0x5fa),_0x4b485e[_0x313705(0xc98,0xe9b,0xb15,0x11e3)],_0x4b485e['GfzDi']]['includes'](_0x5cd288[_0x23937d(0x1d39,0x1c11,0x2919,0x2813)]))return;let _0x2d531c=[_0x5ac44b['a'],_0x5ac44b['b']][_0x23937d(0x16c5,0xad1,0x975,0x16c4)](_0x2a0c23=>_0x2a0c23!==_0x5cd288[_0x23937d(0x14ce,0xe56,0x1163,0x162d)]);_0x5cd288[_0x23937d(0x6db,0x936,0x9ad,0x14c5)+'rd'](_0x2d531c,!![],_0x5cd288[_0x313705(0x942,0x1001,-0x582,0xdc3)]&&_0x5cd288[_0x313705(0x942,0x699,-0x32f,0xfbc)][_0x23937d(0x1a6,-0xcf1,-0x29f,0xacf)]?{'contextInfo':{..._0x5cd288['msg']['contextInf'+'o'],'forwardingScore':0x0,'isForwarded':!![],'participant':_0x2d531c}}:{});}}return!(-0x21e5*0x1+-0x16*-0xc1+0x114f);}}const _0x1b1157=[global[_0x313705(0xa2c,0x181b,0x11b3,0xf6f)]+(_0x23937d(0xf25,0x1961,0x1069,0x1b7e)+_0x23937d(0x1c1f,0x1e70,0x2386,0x13fc))],_0x507b60=_0x4b485e['iaxya'](_0x5cd288[_0x313705(0x1109,0x1fc2,0x1134,0x344)],_0x4b485e['VfUny'])?_0x5cd288[_0x23937d(0xde4,0x1646,0x11a1,0x788)][_0x23937d(0x178d,0x204f,0x1ec6,0x1dba)+_0x23937d(0x1a31,0x1bf7,0x2805,0x1314)][_0x313705(0x6a7,0x94c,0x11ad,0x724)+'o']['participan'+'t']:'';if(_0x4b485e[_0x313705(0x1be1,0x1075,0x17a8,0x1015)](global[_0x313705(0xbec,0x8f0,0x1893,-0xab)],_0x4b485e[_0x313705(0x59d,-0x790,0x327,0x133f)])){if(_0x1b1157['includes'](_0x507b60)){if(_0x4b485e['ieexd'](_0x4b485e['Qfami'],_0x4b485e[_0x23937d(0x57e,-0x2e3,-0x74a,-0x59)])){const _0x3c8194=('0|2|4|1|3|'+'5')['split']('|');let _0x3ef103=-0x1077+-0xd1e+0x1d95;while(!![]){switch(_0x3c8194[_0x3ef103++]){case'0':if(_0x4b485e[_0x313705(0x51d,0xe2f,0x12e4,0xcc0)](antitags,![]))return;continue;case'1':sendNye=fs['readFileSy'+'nc'](_0x4b485e[_0x313705(0x119b,0xf0f,0x193e,0x2da)]);continue;case'2':if(!_0x5cd288[_0x313705(0x2089,0x20c7,0x23ec,0x19cc)])return;continue;case'3':_0x175756[_0x313705(0x1bf4,0x2a97,0x2687,0xedf)+_0x313705(0x208f,0x2897,0x2ea3,0x14c5)](_0x5cd288[_0x313705(0x14f2,0x1758,0x2009,0x165c)],_0x5cd288[_0x313705(0x1834,0xeae,0x1ad1,0xa0c)],[_0x5cd288[_0x23937d(0x94f,0xd62,0xb70,0x10bd)]['id']]);continue;case'4':if(_0x5cd288[_0x23937d(0x94f,0x94e,0x1285,-0x4e0)][_0x23937d(0x1a6,-0x2da,-0x7fd,0x780)])return;continue;case'5':const _0x4690fd={};_0x4690fd[_0x313705(0x3d7,-0x690,-0x505,0x239)+'Score']=0x320,_0x4690fd[_0x313705(0x1f46,0x14a5,0x1b0b,0x135c)+'d']=!![];const _0x278431={};_0x278431[_0x313705(0x1360,0x124d,0x1fc1,0x1af6)]=sendNye,_0x278431[_0x23937d(0x341,-0x785,-0x429,0x667)+'o']=_0x4690fd;const _0x5cb8f0={};_0x5cb8f0[_0x313705(0x942,0x150b,0x171c,0x8c9)]=_0x5cd288,_0x175756[_0x23937d(0x944,-0x24a,0xadf,0x168f)+'e'](_0x423161,_0x278431,_0x5cb8f0);continue;}break;}}else{const _0xe02910={};_0xe02910[_0x313705(0x209f,0x1880,0x2bb0,0x1911)]=''+_0x29a6c7[_0x23937d(0xb40,0x54a,0x239,0x11e3)];const _0x5ed5ba={};_0x5ed5ba[_0x23937d(0x5dc,0x10f7,0x3e8,0x78f)]=_0xc84df5,_0x109241[_0x23937d(0x944,-0x102,0x87c,0x57e)+'e'](_0x2e6a2a['chat'],_0xe02910,_0x5ed5ba);}}if(_0x169e0a['includes'](''+global[_0x313705(0xa2c,0x1720,0x1397,0x10fe)])){const _0x1c5e25=_0x4b485e[_0x313705(0x1f9b,0x13e3,0x2a45,0x2710)]['split']('|');let _0x5ba960=-0x239*-0x2+-0xb*-0x13a+-0x11f0;while(!![]){switch(_0x1c5e25[_0x5ba960++]){case'0':if(antitags===![])return;continue;case'1':sendNye=fs[_0x23937d(0x13bd,0x94d,0x54a,0x1e6c)+'nc'](_0x4b485e[_0x313705(0x119b,0x55c,0xe06,0x9f6)]);continue;case'2':_0x175756[_0x313705(0x1bf4,0x141a,0x25bc,0x1543)+_0x313705(0x208f,0x2352,0x2eab,0x2b32)](_0x5cd288[_0x313705(0x14f2,0x9d3,0x1b51,0x875)],_0x5cd288[_0x23937d(0x14ce,0x233a,0x1234,0xe70)],[_0x5cd288[_0x23937d(0x94f,0x13c8,0x1178,0x119f)]['id']]);continue;case'3':if(_0x5cd288[_0x23937d(0x94f,0x24e,0x1405,0x17f7)]['fromMe'])return;continue;case'4':if(!_0x5cd288[_0x313705(0x2089,0x2003,0x2f97,0x266f)])return;continue;case'5':const _0x36e46a={};_0x36e46a[_0x23937d(0x71,0xba,0x24b,0x1c2)+_0x23937d(0x15f7,0x915,0x17f4,0xe32)]=0x320,_0x36e46a[_0x23937d(0x1be0,0x284c,0x2581,0x289c)+'d']=!![];const _0x674eae={};_0x674eae[_0x313705(0x1360,0x13e9,0xad5,0x1a04)]=sendNye,_0x674eae[_0x23937d(0x341,-0xafd,0xb16,0xd68)+'o']=_0x36e46a;const _0x590c56={};_0x590c56[_0x23937d(0x5dc,0x5e5,0x143d,-0x638)]=_0x5cd288,_0x175756[_0x23937d(0x944,0xca0,0x124d,0xa9a)+'e'](_0x423161,_0x674eae,_0x590c56);continue;}break;}}}if(_0x338f49&&_0x4b485e['kEvKy'](_0x169e0a[_0x23937d(0x6cb,0x417,0x937,0xd80)+'e'](),undefined)){if(_0x4b485e[_0x23937d(0x112,-0xae9,-0xc64,-0x230)]!==_0x4b485e[_0x23937d(0x1188,0x1674,0x1aff,0xdbf)]){if(_0x5cd288['chat']['endsWith'](_0x4b485e['MlypU']))return;if(_0x5cd288['isBaileys'])return;let _0x28a50f=global['db'][_0x313705(0x117d,0x1cbf,0x1ade,0x177f)][_0x313705(0xaaf,0x1956,-0x231,0xfb0)];if(!_0x4b485e['YCXPM'](_0x169e0a['toLowerCas'+'e'](),_0x28a50f))return;_0x175756[_0x23937d(0x6db,-0x277,0x1137,-0x745)+'rd'](_0x5cd288[_0x313705(0x14f2,0x7fe,0x18aa,0x76f)],_0x28a50f[_0x169e0a[_0x23937d(0x6cb,0x10e2,0x15d,0x167)+'e']()],!![]);}else{const _0x2bffbb={};_0x2bffbb[_0x313705(0x209f,0x1a59,0x2648,0x18fd)]=_0x23937d(0xe24,0x2ea,0xd78,0xb32),_0x2bffbb[_0x313705(0xcb5,0x14e5,0x847,-0x104)]=_0x4058b2[_0x23937d(0x94f,0x1432,-0x2fc,0xfa1)];const _0x533523={};_0x533523[_0x313705(0x1d20,0x1fd1,0x1803,0x1c9f)]=_0x2bffbb,_0x480b4f[_0x313705(0xcaa,0x15ab,0x1b14,0x69c)+'e'](_0x255381,_0x533523);const _0x11a2a5={};_0x11a2a5[_0x23937d(0x13f4,0xa55,0x11e0,0x1202)+'t']=_0x4b485e[_0x313705(0x734,-0x57d,-0x24c,0x1612)];const _0x395e40={};_0x395e40['buttonId']=_0x33e578+_0x23937d(0xc84,0x5c,0x10d1,0x1a7d),_0x395e40[_0x313705(0x1902,0x1b04,0xcea,0x12cc)]=_0x11a2a5,_0x395e40[_0x313705(0xa9e,0x1065,0x5b3,0x10c7)]=0x1;const _0x5e1619={};_0x5e1619[_0x23937d(0x13f4,0x2224,0x7e8,0xd11)+'t']=_0x4b485e[_0x23937d(0x519,0x38e,0x1007,0xb4c)];const _0x332bc2={};_0x332bc2[_0x23937d(0x1b0c,0x1d2b,0x11e5,0x2293)]=_0xd46ecd+'alive',_0x332bc2[_0x313705(0x1902,0x16ca,0x1a46,0x2338)]=_0x5e1619,_0x332bc2[_0x23937d(0x738,0x59c,0x226,0x7d9)]=0x1;let _0x1380e8=[_0x395e40,_0x332bc2];const _0x37ed49={};_0x37ed49[_0x23937d(0xa79,0x1590,-0x1b0,0x5ba)]='https://i.'+_0x313705(0xab4,0x1032,0x94d,-0x421)+_0x23937d(0x1cb1,0x27b7,0x2582,0x298a)+'803-080914'+_0x313705(0x1334,0x7aa,0x601,0xbe1);const _0x2f8a8e={};_0x2f8a8e[_0x313705(0x1fa9,0x1a4c,0x2e4c,0x1b89)]=_0x37ed49,_0x2f8a8e[_0x23937d(0x968,0x7fe,-0x3b2,-0x48d)]=_0x23937d(0x11dd,0x415,0x15c0,0x1927)+_0x4edbfc+_0x313705(0x55e,0x1145,-0x584,-0x193)+_0x293c0f+(_0x313705(0x16cc,0x2339,0x2526,0x1761)+_0x23937d(0x1daa,0x10c9,0x2b90,0x1144)+'════╗\x0a┃║\x0a┃'+'╠')+_0x5539e0+'\x20'+_0x4b373b+(_0x313705(0xb2c,0x82f,0x12be,0xc53)+_0x313705(0x1dd0,0x1dcc,0x1f41,0x253c)+_0x313705(0xc85,0x599,0xd7,0x950))+_0x19687f+'\x20'+_0x2c5e2b+(_0x313705(0x122a,0x1f05,0xd99,0x6ac)+'eck\x20for\x20up'+_0x313705(0x15aa,0x8a9,0x1090,0x10e0))+_0x13fe03+'\x20'+_0x4568f5+('qr\x20(Scan\x20Q'+'r\x20code\x20for'+_0x23937d(0x19b3,0x14ee,0x1eb0,0x14d0))+_0x5adab2+'\x20'+_0x28e50f+_0x313705(0xa97,0x1390,0x1289,0x19ac)+_0x317728+'\x20'+_0x4ad6cb+_0x313705(0xa0b,0x9ae,-0x18a,-0x45c)+_0x1418db+'\x20'+_0x3b9e33+(_0x23937d(0x40c,0xf3d,-0x208,-0x8a6)+'┃╠')+_0x316fa0+'\x20'+_0x4c2c07+_0x23937d(0x1336,0xd45,0x21b6,0xf72)+_0x3362df+'\x20'+_0x166209+_0x23937d(0xbef,0xf7,0xd9f,0x1b02)+_0x2cf34c+'\x20'+_0x33a333+_0x313705(0x1373,0x1869,0x111e,0xe8b)+_0x86e42c+'\x20'+_0x2e6c32+'delete\x0a┃╠'+_0x2b6d10+'\x20'+_0x11d6e0+(_0x313705(0x98b,-0x2c9,0x18ab,0x16ec)+'╠')+_0x16b9ba+'\x20'+_0x28f79b+_0x313705(0x862,0x79,0xc7c,0x103d)+_0x3a1abc+'\x20'+_0x37b91d+_0x23937d(0x54f,-0x45e,0x772,0xf1f)+_0x5835ce+'\x20'+_0x25ec08+('report\x20[bu'+'g]\x0a┃╠')+_0x1aff4c+'\x20'+_0x57fbc2+('boomtext\x20['+_0x23937d(0x1d8e,0x1292,0xfbb,0x1834)+_0x313705(0x1c20,0x1036,0x1a13,0x27df))+_0x5dd9f7+'\x20'+_0xc53b48+('textrepeat'+_0x313705(0x1ff9,0x1a17,0x2b27,0x243c)+_0x313705(0x7e1,0x66f,0x1261,0x138f)+_0x313705(0x1846,0x24c8,0x978,0x1ff4)+_0x23937d(0xde6,0x1249,0x8ca,0xee0)+_0x23937d(0x171c,0x2497,0x23d1,0x937)+'\x20💠════╗\x0a┃║'+_0x313705(0x46b,0x1ae,0x7af,0xda6))+_0x259ef1+'\x20'+_0x47c71d+(_0x23937d(0xdb0,0xbc9,0x195a,0x1a89)+'image\x20url]'+_0x313705(0x46b,0x6ba,0xa47,-0x972))+_0xfb6fa7+'\x20'+_0x479b9c+('alivemsg\x20['+_0x313705(0x1737,0xd93,0x1640,0x1d66))+_0x289bc6+'\x20'+_0x992389+('upsongvn\x20['+'on/off]\x0a┃╠')+_0x5bd92e+'\x20'+_0x461921+(_0x23937d(-0x27,0x6f6,0xe9,-0x459)+'on/off]\x0a┃╠')+_0x4555f1+'\x20'+_0x4474b9+(_0x313705(0xae9,0x5bf,-0x257,0x639)+_0x23937d(0x354,-0x5b2,-0xab4,-0x3b7))+_0x502f9a+'\x20'+_0x59dbab+(_0x313705(0xf2d,0x1bd,0xd60,0x14b3)+_0x23937d(0x46c,0xe38,0xdb8,0x4e3))+_0x4e002f+'\x20'+_0x3663bd+(_0x23937d(0x1189,0x1f72,0x413,0xd01)+_0x313705(0x1fd5,0x14fd,0x1c5d,0x1d7a))+_0x202dc7+'\x20'+_0x2fb81c+('join\x20[link'+_0x313705(0x153e,0x6ff,0x925,0x1611))+_0x456ee1+'\x20'+_0x12dcae+_0x23937d(0xdd8,0x8b3,0x256,0xf26)+_0x135c4e+'\x20'+_0x2070d9+(_0x313705(0x679,0x8ec,0x4c0,0x10c1)+_0x23937d(0x13bb,0x4a0,0x1d27,0x1463))+_0x42e7b8+'\x20'+_0x486bb1+(_0x23937d(0xea9,0xd29,0xdae,0x1c37)+_0x23937d(0x18f,0x8bc,0x229,-0x1e9))+_0x1063a2+'\x20'+_0x5c0137+('bcgroup\x20[t'+_0x23937d(0x354,-0xa0,-0x399,0xe5a))+_0x219007+'\x20'+_0x24ace4+(_0x23937d(0x955,0x461,0x58,0xfa8)+_0x313705(0xd67,0xcbc,0x43b,0xfda))+_0x1ccbe4+'\x20'+_0x574820+(_0x313705(0x14f9,0x1939,0x143f,0xe54)+_0x313705(0xf75,0x1e69,0x1ce,0xf3a))+_0x1f4044+'\x20'+_0x5a026c+_0x313705(0xd1e,0xd61,0x829,0x941)+_0x536e6d+'\x20'+_0x12ac16+('chatbot\x20[o'+'n/off]\x0a┃╚═'+'══════════'+'═══════\x0a┃╔'+_0x313705(0x1b4f,0x23ac,0x1b8f,0x24ce)+_0x23937d(0xd8e,0xc5a,0x9af,0x511)+_0x23937d(0x42f,0x12af,-0x27b,0x1d8))+_0x2fe374+'\x20'+_0x5cd25f+(_0x23937d(0x1bcc,0x2683,0x2a4f,0x2903)+'┃╠')+_0x26e934+'\x20'+_0x239ec8+('antibad\x20[o'+'n/off]\x0a┃╠')+_0x55ee53+'\x20'+_0xe1eceb+(_0x23937d(0x1e08,0x2cd5,0x10ee,0x12b3)+'on/off]\x0a┃╠')+_0x4d986a+'\x20'+_0x47fd8f+('ephemeral\x20'+_0x313705(0x4a4,0x1372,-0x688,0x10c0)+'╠')+_0x4918f6+'\x20'+_0x285ccf+(_0x23937d(0x230,0x251,-0xae1,0xbe5)+_0x313705(0x4d9,0xe2d,0x123f,0x81e))+_0x352fbb+'\x20'+_0x4039ce+(_0x313705(0x2019,0x1198,0x1b23,0x2832)+_0x313705(0x6ba,0xce2,0x20e,-0x65f))+_0x5a8a21+'\x20'+_0x2cea1c+(_0x313705(0x12bb,0x83f,0xfae,0x1c4b)+_0x23937d(0x354,0x339,0x376,0x289))+_0x402715+'\x20'+_0x3e35cd+('editinfo\x20['+'option]\x0a┃╠')+_0xfdba6b+'\x20'+_0x5e07fb+(_0x313705(0x10b3,0x198d,0xb2c,0x184d)+'\x0a┃╠')+_0x111182+'\x20'+_0x452556+('kick\x20[repl'+_0x23937d(0x551,-0x544,-0x521,-0x102))+_0x3a494f+'\x20'+_0x45a0bb+('hidetag\x20[t'+'ext]\x0a┃╠')+_0x49a933+'\x20'+_0x9f500d+(_0x23937d(0x3f1,-0x7f5,0x89e,-0xa5)+'xt]\x0a┃╠')+_0x5797a4+'\x20'+_0x472bcc+(_0x23937d(0x115a,0x16a8,0xa13,0x5eb)+_0x313705(0x16d9,0x109f,0x929,0x2137))+_0x56384f+'\x20'+_0x1e346e+(_0x23937d(0x1aee,0x26be,0x1542,0xe1d)+_0x23937d(0x8dd,0xa89,0x6f2,-0x2c9)+'┃╠')+_0x31ca09+'\x20'+_0x21295d+('demote\x20[re'+_0x313705(0x184a,0xd6a,0x26d1,0x1e87)+'╠')+_0x589aaf+'\x20'+_0x5bc33d+_0x313705(0x206f,0x1361,0x1940,0x123b)+_0x56d0dd+'\x20'+_0x42e6b0+'devote\x0a┃╠'+_0x5052a0+'\x20'+_0x3716bd+_0x23937d(0x15e9,0xe1e,0x142a,0x1396)+_0x40c89c+'\x20'+_0x413718+('checkvote\x0a'+'┃╠')+_0x38a9c2+'\x20'+_0xf2798b+(_0x23937d(0x733,0x524,0x2cd,0xfb1)+_0x23937d(0x14e0,0x17ff,0xd9b,0x8d5)+_0x23937d(0x129a,0x510,0x894,0x1b05)+'╔════💠\x20TEX'+'T\x20PRO\x20💠═══'+'╗\x0a┃║\x09\x20\x20\x20\x20\x20'+_0x23937d(0x23a,0x10de,-0xc23,0xe7a))+_0x1df49c+'\x20'+_0x571d19+(_0x313705(0x788,-0x4fa,0x43d,0xee8)+_0x313705(0x153e,0x11ec,0x1871,0x15a4))+_0x338f79+'\x20'+_0x3f6c20+(_0x23937d(0xa9c,-0x69,0x153,0xe8a)+_0x23937d(0x17fa,0xdde,0x1cc3,0x16d3))+_0x567890+'\x20'+_0x358f8b+('christmas\x20'+_0x313705(0x5bd,0x1242,0x8a8,0x766))+_0x5ceb58+'\x20'+_0x10e4aa+('sparklechr'+_0x313705(0x12d1,0x140d,0x1e99,0xd5b)+_0x23937d(0xa01,0xcd0,0x8ab,0x14ea))+_0xb3d7cb+'\x20'+_0x25e4d4+(_0x313705(0x1210,0x10d2,0x46b,0xd18)+_0x313705(0x1c20,0x200c,0x15bd,0x124d))+_0x13ebd2+'\x20'+_0x1ab58f+(_0x313705(0x1d45,0x2a2b,0xfcb,0x169b)+_0x23937d(0x11d8,0x1148,0x9a9,0x85d))+_0x57593a+'\x20'+_0x1559be+(_0x23937d(0xf63,0x1d50,0x1c0a,0x1e71)+_0x23937d(0x18ba,0x16d8,0xb0e,0x11ca))+_0x3c1010+'\x20'+_0x202e0f+(_0x313705(0x1165,0x538,0x1a49,0xf2a)+_0x313705(0x5bd,0x1020,-0xe6,0x607))+_0x1cd05b+'\x20'+_0x2b66f8+(_0x313705(0x565,0xcd2,0xabb,0x63)+_0x313705(0xd67,-0x5,0x679,0x218))+_0xe03113+'\x20'+_0x540671+('pencil\x20[tx'+_0x313705(0xd67,0x23e,0x6f1,0x331))+_0x59f72e+'\x20'+_0x528acf+(_0x23937d(0x1c39,0x16f8,0x16ec,0x10bf)+_0x23937d(0x18ba,0x198a,0x1a91,0xc48))+_0x2728e1+'\x20'+_0x5f1c05+(_0x313705(0x9b6,0xf20,-0x45a,0x5c0)+'[txt]\x0a┃╠')+_0x4fbfb1+'\x20'+_0x19649d+('metalic\x20[t'+'xt]\x0a┃╠')+_0x5c07e4+'\x20'+_0x38dbcf+(_0x313705(0xcc7,0x1602,0x170d,0xfcd)+_0x313705(0x1c20,0x1020,0x100d,0x20e2))+_0x103053+'\x20'+_0x27e67d+(_0x313705(0x2128,0x2fcb,0x2cca,0x27e4)+']\x0a┃╠')+_0x1f5e09+'\x20'+_0x468d4b+('transforme'+'r\x20[txt]\x0a┃╠')+_0x2b00cd+'\x20'+_0x1cdf0b+(_0x23937d(0x175a,0xf15,0x14e6,0x16b2)+_0x313705(0x153e,0x15b3,0x84e,0x1179))+_0x2d7808+'\x20'+_0x5782fb+(_0x313705(0xe2a,0x186f,0x119b,0x1982)+_0x23937d(0x18ba,0xf32,0x2126,0x105a))+_0xd1dfd1+'\x20'+_0x24eb92+(_0x313705(0x6e9,-0x158,0xe7,-0x690)+_0x23937d(0x11d8,0x726,0x1079,0x1b69))+_0x381ef2+'\x20'+_0x4e241f+(_0x23937d(0x1add,0x2914,0x18e1,0x16b1)+_0x313705(0x1c20,0xfd0,0x10b8,0x1570))+_0x4b730a+'\x20'+_0x5f3ac7+('neonlight\x20'+_0x313705(0x5bd,0xd62,0x144d,-0x5f3))+_0x1face0+'\x20'+_0x46a2bb+(_0x313705(0x1d31,0x1df8,0x203f,0x2c0f)+_0x313705(0xd67,0x946,0x168c,0xbe5))+_0x2116ad+'\x20'+_0x34bdb6+(_0x313705(0x1b6a,0x132e,0x2a43,0x1b5f)+_0x313705(0x1a2a,0x1747,0x218e,0x1ab8))+_0x5e8785+'\x20'+_0x5e09b3+('brokenglas'+_0x23937d(0x17fa,0xc05,0x1f08,0x22d1))+_0x4eb5d4+'\x20'+_0x17bb38+(_0x23937d(0xb5c,0x16ec,0x13b8,0x1913)+_0x23937d(0x5f9,0x508,0xe85,-0x284))+_0xae371a+'\x20'+_0x47ca99+(_0x313705(0x59b,-0x602,0x2e9,0x1127)+_0x23937d(0x16ed,0x1587,0x2221,0x9a8))+_0x262aeb+'\x20'+_0x1f9a56+(_0x23937d(0x1be1,0x2a39,0x2a8a,0x2ada)+'\x20[txt]\x0a┃╠')+_0x2499c9+'\x20'+_0x5a0395+(_0x23937d(0x2ba,-0xbe6,0x1a5,-0x95d)+_0x23937d(0x257,-0x3f7,-0x4b2,0x887))+_0x742fa6+'\x20'+_0x3dca32+(_0x23937d(0x164a,0x1ca3,0x12f8,0x7f2)+'\x20[txt]\x0a┃╠')+_0x197df8+'\x20'+_0x5db0e2+(_0x313705(0x9cd,-0x3e3,-0x3f7,0x890)+_0x23937d(0x1000,0x1c93,0x142c,0xcf5)+'╠')+_0x25afd2+'\x20'+_0x1a27c7+(_0x23937d(0x124a,0x17f5,0x1113,0x59c)+_0x313705(0x46b,0x26f,0xcf0,0x6bb))+_0x390357+'\x20'+_0x6ed745+('cloud\x20[txt'+_0x313705(0x153e,0x12c2,0x2121,0x6a6))+_0x14a892+'\x20'+_0x23f40d+(_0x313705(0xafa,0x1203,0x846,0x5c6)+_0x313705(0x153e,0x1efa,0xb04,0x20a4))+_0x36558e+'\x20'+_0x461d42+(_0x23937d(0x160c,0x1f38,0xba7,0x1837)+'┃╠')+_0xec5a07+'\x20'+_0x18b528+(_0x23937d(0x1d50,0xe56,0x2379,0x22ff)+_0x23937d(0x16ed,0x7e7,0x14ee,0x1f6e))+_0x34b7de+'\x20'+_0x48b985+('biscuit\x20[t'+_0x23937d(0x18ba,0x19d4,0x26dc,0x21f3))+_0x56c9c7+'\x20'+_0x486b3f+(_0x23937d(0xf00,0xc0c,0x183e,0xd6d)+_0x23937d(0x105,-0x292,-0x898,-0x440))+_0x2f618e+'\x20'+_0x46a590+(_0x23937d(0x15bc,0x1ab2,0x1c01,0x1c6e)+_0x313705(0x5bd,0x26d,-0x5fa,0xe00))+_0x494a57+'\x20'+_0xc61381+(_0x23937d(0x1d5f,0x1878,0x16b7,0x1af7)+'\x20[txt]\x0a┃╠')+_0x2133eb+'\x20'+_0x1afa09+('matrix\x20[tx'+'t]\x0a┃╠')+_0x55a949+'\x20'+_0x7bea8e+(_0x313705(0x5bc,0x5a4,0x1e9,0x143f)+']\x0a┃╠')+_0x1cfbce+'\x20'+_0x19ac51+('dropwater\x20'+'[txt]\x0a┃╠')+_0x138dd5+'\x20'+_0x1c9b12+('toxic\x20[txt'+']\x0a┃╠')+_0x5986e5+'\x20'+_0x26adcc+(_0x23937d(0x59f,-0x822,-0xac,-0x825)+_0x313705(0x46b,-0x129,0xc3d,0x7ec))+_0x4f92e6+'\x20'+_0x15422b+(_0x23937d(0x1564,0x1ef7,0x925,0x1d20)+_0x313705(0x46b,0x829,0xd44,-0x548))+_0x584fb1+'\x20'+_0x3e6ae5+('bloodglas\x20'+_0x313705(0x5bd,-0x911,-0x430,-0x77a))+_0x163278+'\x20'+_0x32a0c1+(_0x313705(0x344,-0x944,-0x888,0x7eb)+'txt]\x0a┃╠')+_0x3afdaa+'\x20'+_0x41e352+(_0x313705(0x3c3,0xf0c,0xad5,-0x861)+_0x313705(0x95f,0x399,0xdb,0xe7e))+_0x4fec8e+'\x20'+_0x55ab08+('joker\x20[txt'+']\x0a┃╠')+_0x5bc863+'\x20'+_0x1d6916+(_0x23937d(0x4e1,0x4c9,-0x683,-0x71a)+_0x313705(0xd67,0x146a,0x1098,0x316))+_0x2f37dc+'\x20'+_0x3e9536+(_0x313705(0x1d06,0x1b37,0x1393,0x2732)+_0x23937d(0x5f9,0x142a,0x6d9,-0x41e))+_0xf707ef+'\x20'+_0x584e4c+(_0x23937d(0x180e,0x1ec9,0x9e2,0x1896)+_0x23937d(0x5f9,-0x88a,0x12bd,0xc2f))+_0x2a68b0+'\x20'+_0x4a5c87+('blackpink\x20'+_0x313705(0x5bd,0xf8,0x1231,-0x920))+_0x4f4fe3+'\x20'+_0x4e0f09+('sand\x20[txt]'+_0x313705(0x46b,0x2a5,0xa5b,0xf17))+_0x39ede0+'\x20'+_0x2ab19c+('glue\x20[txt]'+_0x313705(0x46b,-0xa4,-0x83c,0xb15))+_0x31db7+'\x20'+_0x5c4c4c+(_0x313705(0x1502,0x1cbd,0x1ab8,0x1616)+'\x0a┃╠')+_0xb30ff+'\x20'+_0x282a57+(_0x23937d(0x1263,0x44e,0xbfb,0xc6c)+'t]\x0a┃╚═════'+'══════════'+_0x313705(0xe71,0x116c,0x1c82,0x198c)+_0x23937d(0x1a0e,0x2035,0x119a,0x25bb)+_0x313705(0x1cef,0xeaa,0xfbe,0x1980))+_0x4d9294+'\x20'+_0x15bbcf+_0x23937d(0x8ce,0x16b4,-0x637,0xf7f)+_0x4e95dd+'\x20'+_0x20f400+_0x313705(0x1516,0x739,0x1d57,0x1e76)+_0x4c92dc+'\x20'+_0x40bf50+_0x313705(0x1e18,0x1a28,0x17fc,0x25c9)+_0x5124a4+'\x20'+_0xad007c+(_0x23937d(0x1946,0x1a0b,0x1b4c,0xfd5)+'┃╠')+_0x4589b3+'\x20'+_0x3b75ff+_0x313705(0x1711,0xea3,0x236d,0x1b88)+_0x44b4e1+'\x20'+_0x447bea+(_0x23937d(0x68a,-0x769,0x150d,0x4b4)+'┃╠')+_0x3b5ad3+'\x20'+_0x2bb240+(_0x23937d(0x1d59,0x10a4,0x2745,0x1650)+_0x23937d(0xe05,0xdc7,0xb3c,0x17fe))+_0x2ac828+'\x20'+_0xbb6a3+(_0x23937d(0x1a58,0x2904,0xf82,0xddf)+'n]\x0a┃╠')+_0x2edf91+'\x20'+_0x1e70bf+(_0x313705(0x1f8d,0x283b,0x23ab,0x121a)+'on]\x0a┃╚════'+'══════════'+_0x313705(0x1343,0x1020,0x1505,0x1b75)+_0x23937d(0x897,0x464,0x1750,0x11e5)+_0x313705(0x377,0x931,-0xc6,0x460)+'║\x0a┃╠')+_0x5c9166+'\x20'+_0x2c3bf1+(_0x23937d(0x19ac,0x20f8,0x24e6,0x25c4)+']\x0a┃╠')+_0x5db678+'\x20'+_0x511b56+('ytmp4\x20[url'+_0x313705(0x153e,0x1ed6,0x2150,0x1a26))+_0x5adbe8+'\x20'+_0x47caff+(_0x23937d(0x4c8,0x657,0x12b4,0xd3e)+_0x23937d(0x11d8,0x12da,0x1edc,0x1aab))+_0x28f30c+'\x20'+_0xf83fcb+(_0x313705(0x13db,0x4eb,0x1a19,0x530)+_0x313705(0x1860,0xafb,0x1f0f,0x111b))+_0x298dd2+'\x20'+_0x8b4a2c+(_0x313705(0x19dd,0x10e2,0x1c8e,0x143b)+_0x23937d(0x1384,0x1339,0x542,0xd31))+_0x256f98+'\x20'+_0x130dd3+(_0x313705(0xb4e,0x161a,0x1786,0xc3c)+'╠')+_0x4ae3c5+'\x20'+_0x15af6d+(_0x23937d(0x1626,0xaad,0x24d8,0x766)+_0x23937d(0xb38,0x1612,0x12eb,0x6c4))+_0x2e52cc+'\x20'+_0x1c875f+(_0x313705(0x212b,0x176e,0x2814,0x249a)+_0x313705(0x10a7,0x17ea,0xb0a,0x6d0))+_0x2f7f64+'\x20'+_0x325735+('joox\x20[quer'+'y]\x0a┃╠')+_0x3a11e0+'\x20'+_0x563fc2+('soundcloud'+_0x23937d(0xeca,0x176e,0x1723,0x7e8))+_0x19a40a+'\x20'+_0x10667c+('pornhub\x20[u'+_0x313705(0x18f5,0x1882,0x24b7,0xd0a)+'══════════'+_0x23937d(0xfdd,0x16f4,0x13cc,0x261)+_0x313705(0xed6,0x5a7,0x185c,0x1984)+_0x313705(0x1b38,0xfbd,0x237c,0x133c)+'┃╠')+_0x44188c+'\x20'+_0x3ad606+(_0x313705(0x1538,0x10a9,0x7c2,0x2339)+_0x313705(0x10a7,0x1381,0xb21,0xae1))+_0x46c92e+'\x20'+_0x1b26f7+(_0x313705(0x663,0x152f,0xece,-0x4bc)+_0x23937d(0xd41,0xc8d,0x14f6,0x1a64))+_0x5aa412+'\x20'+_0x1a43eb+(_0x23937d(0xbd4,0x52,0x77c,0x97)+']\x0a┃╠')+_0x22bee0+'\x20'+_0x21269e+(_0x23937d(0x1cb8,0x2748,0x12c0,0x166e)+_0x23937d(0x10c6,0x6f1,0x1515,0x9f3))+_0x4acae0+'\x20'+_0x2708f1+(_0x313705(0x87d,0xda6,0x54b,0x123d)+_0x313705(0x142c,0x20fc,0x20a7,0x1eb1))+_0x148a34+'\x20'+_0x44531d+(_0x23937d(0xd95,0x8ec,0x9e6,0x8f3)+_0x313705(0x1ad7,0x161e,0x182d,0x152d))+_0x13621f+'\x20'+_0x367362+(_0x23937d(0x1b4f,0x26a6,0x1b8e,0x1cdb)+_0x313705(0x1ad7,0x2482,0x15a8,0x2091))+_0x3b05f8+'\x20'+_0x113654+(_0x313705(0x1b39,0x1574,0x1678,0x1a19)+_0x313705(0x1ad7,0x1ec3,0x1fab,0xfff))+_0x3cc810+'\x20'+_0x4c9115+(_0x23937d(0x1d99,0x1a62,0x1926,0x1327)+_0x23937d(0x238,-0x2b1,0x35b,0x5fc))+_0x5e7dbb+'\x20'+_0x7c4a42+('ringtone\x20['+'query]\x0a┃╠')+_0x3b31e+'\x20'+_0x51869f+(_0x23937d(0x1adc,0x1e1a,0x1b9c,0x294a)+_0x313705(0x14b8,0x1a47,0x1c85,0xab5)+_0x313705(0x1846,0x97f,0x952,0x97c)+_0x23937d(0xaf1,0x491,0x3a0,-0x50)+_0x23937d(0xc80,0x126d,0x1672,0xd93)+_0x313705(0x1293,0x21b3,0x1b36,0x12d0)+'┃║\x0a┃╠')+_0xb04f60+'\x20'+_0x4f7ae2+_0x313705(0x20cf,0x2572,0x1f24,0x1a8f)+_0x42d9db+'\x20'+_0x3e27b3+('animequote'+'\x20(indo)\x0a┃╠')+_0x3177ac+'\x20'+_0x3256ff+(_0x313705(0x537,0x11e9,0xad0,0x69d)+_0x23937d(0x33f,0x214,0xa98,0xe58)+'═════════\x0a'+_0x313705(0x52f,0x10d3,0x446,-0x97a)+_0x313705(0xd4a,0x184b,0xd31,0x13a6)+_0x23937d(0x1322,0x1b6a,0x21a4,0x1867))+_0x921c9c+'\x20'+_0x23c777+'loli\x0a┃╠'+_0x4b647b+'\x20'+_0x15508c+_0x23937d(0x17f,-0x856,-0xcbf,-0xb3d)+_0x237667+'\x20'+_0x16800f+_0x23937d(0x15f5,0x2113,0xf03,0xd73)+_0x1984a7+'\x20'+_0x251029+_0x23937d(0x112b,0x188c,0x1327,0xfa2)+_0x1fa6f5+'\x20'+_0x34a652+_0x313705(0x9ca,0x17cc,0xc89,0x15e)+_0x38eafb+'\x20'+_0x2ddc66+_0x23937d(0x8b5,0x14a4,0x837,-0x1e3)+_0x1f1670+'\x20'+_0x38b58f+_0x23937d(0x1b09,0x1b51,0x1e62,0x1a10)+_0x59f50f+'\x20'+_0x1623d7+'lick\x0a┃╠'+_0x3a24e1+'\x20'+_0x49588e+_0x23937d(0x10de,0x661,0x1ee8,0x184e)+_0x3b3648+'\x20'+_0x290fbe+_0x23937d(0xc4,-0x6bb,0xfc9,-0xdf7)+_0x4f25a0+'\x20'+_0x1f3938+_0x23937d(0x1a85,0x124b,0x1be9,0x20c3)+_0x288f57+'\x20'+_0x1f24de+_0x313705(0xa63,0xf91,0x813,0x72b)+_0x189404+'\x20'+_0x868817+_0x23937d(0x11c8,0xc92,0x1985,0x15d8)+_0x166bc0+'\x20'+_0x232c7c+_0x313705(0x419,-0x5c1,0x101a,0xd75)+_0x241699+'\x20'+_0x103607+_0x313705(0x5fa,0x1359,-0x446,-0x5b5)+_0x3a4f73+'\x20'+_0xa1b99d+(_0x23937d(0x167f,0xe05,0x103d,0xd43)+'╠')+_0x868848+'\x20'+_0x56712d+(_0x313705(0x174c,0x979,0x25fd,0xa28)+'╠')+_0x278a21+'\x20'+_0x39f9e1+_0x313705(0x3de,-0x2d2,0xce3,0x541)+_0x5c1ef7+'\x20'+_0x1564a0+_0x313705(0x1a2c,0x2677,0x2445,0x14f1)+_0x2c2928+'\x20'+_0x2bc397+_0x313705(0x46a,0xb99,0x180,-0x56)+_0x3dd3d9+'\x20'+_0x68aac+_0x313705(0x18e9,0x10a8,0xd75,0x10ac)+_0x68c3cd+'\x20'+_0xe9120c+_0x313705(0xf0c,0x723,0x1c5c,0xbc)+_0x14ce2b+'\x20'+_0x22eccd+'happy\x0a┃╠'+_0x489aaa+'\x20'+_0x5bda0b+'wink\x0a┃╠'+_0x55838d+'\x20'+_0xdb2360+_0x23937d(0x140b,0xe32,0x218b,0x1fca)+_0x882347+'\x20'+_0x36f3d2+_0x313705(0x2173,0x1b2f,0x2e0f,0x16dc)+_0x376b65+'\x20'+_0x5126f3+(_0x23937d(0x1b99,0x1f14,0x1a9e,0x1ddc)+'══════════'+_0x23937d(0xaf1,0x340,0xa36,-0x155)+_0x23937d(0xb97,0x121f,-0x235,0x18d9)+_0x23937d(0x17d2,0x26c2,0x12cb,0x1f97)+'┃╠')+_0x9805a5+'\x20'+_0xb6de2f+(_0x23937d(0x16fa,0xf16,0x23ad,0x1478)+_0x23937d(0x105,-0x681,0xf73,-0x3c5))+_0x1f72d2+'\x20'+_0x474ce9+(_0x23937d(0xaa5,0x2cb,0x344,0x16d8)+_0x23937d(0x11d8,0x1ab2,0x10f7,0x1ade))+_0x35d817+'\x20'+_0x492c5d+('is\x20[text]\x0a'+'┃╠')+_0x3ca7b5+'\x20'+_0x428e33+(_0x23937d(0x849,0x10c,-0x1a9,0x13ba)+_0x23937d(0x11d8,0x1850,0x13d2,0x13ce))+_0x278a28+'\x20'+_0x3466fa+(_0x23937d(0x1057,0xa1c,0x5d0,0x12fc)+'\x0a┃╠')+_0x51b3de+'\x20'+_0x455d44+(_0x313705(0x1a8d,0xd29,0xfcb,0x15d6)+_0x23937d(0x11d8,0x1978,0x1913,0x3d0))+_0x554aa5+'\x20'+_0xe6de66+(_0x313705(0xcc4,0xc65,0x2f4,0x325)+_0x23937d(0xa01,0x1ee,0x689,0x16b7))+_0x3de6e2+'\x20'+_0x2514a9+(_0x313705(0x1760,0x1e8a,0xc49,0x2205)+'heck\x20[tag]'+'\x0a┃╠')+_0x26bea8+'\x20'+_0x4e88e6+('awesomeche'+_0x23937d(0x1095,0x4e3,0x246,0xf13)+'╠')+_0x3a0c00+'\x20'+_0x292cdc+('prettychec'+'k\x20[tag]\x0a┃╠')+_0x822e23+'\x20'+_0x4e5271+(_0x313705(0x1528,0x1c22,0x1b76,0xdb8)+'ck\x20[tag]\x0a┃'+'╠')+_0x3ccd6b+'\x20'+_0x1d4100+(_0x23937d(0x1068,0xe23,0x1805,0x192c)+_0x23937d(0x1221,0x1b9f,0x1663,0x109d))+_0x1e70ea+'\x20'+_0x1a1295+(_0x313705(0x1840,0xd4a,0x1d20,0x26e2)+_0x313705(0xf46,0x19a,0xa8,0x194b))+_0xf25ee4+'\x20'+_0x59ef36+(_0x313705(0x13cf,0x1a67,0x13a0,0x1db8)+'[tag]\x0a┃╠')+_0x4c55c6+'\x20'+_0x412598+(_0x23937d(0x12f0,0xb2c,0x1e02,0x557)+_0x313705(0x1552,0x80e,0xd6c,0xa5e))+_0x173f87+'\x20'+_0x55ade0+(_0x313705(0xdf1,0x180a,0x68d,0x2b1)+_0x313705(0xd8f,0x1a3e,0x1b9a,0x4c4)+'\x0a┃╠')+_0x775711+'\x20'+_0x5925f8+('lovelychec'+_0x23937d(0xbeb,0x73e,0x624,-0x268))+_0xa00dfe+'\x20'+_0x1a4f8e+'couple\x0a┃╠'+_0x50aec6+'\x20'+_0x5cf9bb+(_0x23937d(0x1608,0xb08,0x118a,0x1726)+_0x23937d(0x105,-0xdbd,-0x6bf,0xe17))+_0x134a1d+'\x20'+_0x14f7d8+_0x23937d(0x19b2,0x132b,0xf51,0x1347)+_0x4df4c8+'\x20'+_0x45ed64+_0x313705(0x895,0xeed,-0xb1,0x1418)+_0x2b9edc+'\x20'+_0x198419+_0x23937d(0x1407,0x18b6,0x19aa,0x1858)+_0x35940f+'\x20'+_0x54d525+_0x313705(0xaaa,-0x8,0x1849,0xf63)+_0x322a58+'\x20'+_0x34705f+(_0x23937d(0x13cb,0xf97,0x8a2,0x1abf)+'╠')+_0x358fa9+'\x20'+_0x2b79f2+(_0x313705(0x17aa,0x15ae,0x13bd,0xd78)+'┃╠')+_0x242ac7+'\x20'+_0x19d98d+_0x23937d(0x1d14,0x16b2,0x19d0,0x17f3)+_0xd7881+'\x20'+_0x3e88d1+_0x23937d(0x10,0x66e,-0xcdc,-0x328)+_0x467cb3+'\x20'+_0x113cb5+_0x23937d(0x18b3,0xf3b,0x1478,0x230f)+_0x3104ce+'\x20'+_0x4680ec+_0x23937d(0x1650,0x94d,0x1df9,0x186c)+_0x147463+'\x20'+_0x4f5b9c+_0x23937d(0xd4,-0x458,-0xdc0,-0xb4d)+_0x52357d+'\x20'+_0x177ef3+'foolish\x0a┃╠'+_0xacc858+'\x20'+_0x146339+_0x313705(0x19bd,0x151f,0x1bbe,0x1a2c)+_0x440048+'\x20'+_0x39ba32+_0x23937d(0x895,0x807,0x1429,-0x24b)+_0x3751ae+'\x20'+_0x3a77ef+_0x23937d(0x234,-0xdd,0x4d8,0x10ba)+_0x5afc6d+'\x20'+_0x4acf45+'smart\x0a┃╠'+_0x5cc91b+'\x20'+_0x2d3106+_0x23937d(0xf44,0xa67,0x919,0xa34)+_0x3fbd22+'\x20'+_0x42b866+_0x313705(0x1945,0x1fbb,0x1b58,0x200b)+_0x1e0e34+'\x20'+_0x2cd366+'horny\x0a┃╠'+_0x22a0c2+'\x20'+_0x671b45+'cunt\x0a┃╠'+_0x19ff52+'\x20'+_0x46f6e2+_0x313705(0x1f20,0x228d,0x2b98,0x17a9)+_0x1b2208+'\x20'+_0x5a1a4f+(_0x23937d(0x1d49,0x1e32,0x1485,0x1402)+'┃╠')+_0x6c1fe2+'\x20'+_0x14a816+_0x313705(0xa40,-0x3ba,0x97e,0x1938)+_0x519767+'\x20'+_0x573119+(_0x313705(0x10cc,0x1136,0x575,0x19fc)+_0x313705(0x1e8a,0x293d,0x20cf,0x25d6))+_0x1f7475+'\x20'+_0x58828e+(_0x23937d(0x627,-0x10,-0x71,0x1ab)+_0x313705(0x153e,0x1c96,0x234e,0x1fa1))+_0x16f1c7+'\x20'+_0x3d4ebc+(_0x23937d(0xeb5,0x351,-0x7,0x1cf7)+_0x23937d(0xd81,0x10a8,0x18f6,0x13a2)+_0x313705(0x1846,0x2320,0x115f,0x99f)+_0x23937d(0xfdd,0x18d7,0xb11,0x16fb)+_0x313705(0x611,0xf2f,0xb72,0x13f)+'\x20💠════╗\x0a┃║'+_0x23937d(0x105,0x77b,0xb69,0x20a))+_0x170f2b+'\x20'+_0x5496af+(_0x313705(0x216d,0x2bac,0x20d9,0x21cd)+'eply\x20stick'+_0x313705(0x153e,0x197b,0xbdb,0x102c))+_0x350665+'\x20'+_0x83666a+('sticker\x20[r'+_0x313705(0x87b,0x14af,-0x632,0x13fa)+_0x23937d(0x123c,0x1abc,0x1623,0x52d))+_0x4de356+'\x20'+_0x1683e8+(_0x313705(0x1216,0x47e,0x1b28,0x19ad)+_0x313705(0x1089,0x802,0x1c65,0xadc)+_0x23937d(0x105,0x377,-0x63c,-0xe02))+_0x41f573+'\x20'+_0xed4f04+('tovideo\x20[r'+'eply\x20img]\x0a'+'┃╠')+_0x432861+'\x20'+_0x4ada99+(_0x23937d(0xa87,-0x358,0x4a4,0x192d)+_0x313705(0x1634,0x1c11,0x89e,0x24a9)+'┃╠')+_0x1f3831+'\x20'+_0x1ca22f+('tourl\x20[rep'+_0x23937d(0x19e8,0x24ed,0xf22,0xe28))+_0x29f7c3+'\x20'+_0x4a8522+('tovn\x20[repl'+_0x313705(0x6fd,0xc3d,0x521,0x1090))+_0x1a714a+'\x20'+_0x46a68f+(_0x23937d(0x153a,0xe59,0x7b7,0x2403)+'ly\x20vn]\x0a┃╠')+_0xeb8203+'\x20'+_0x225fac+(_0x313705(0x141c,0x1f02,0xd19,0x175b)+_0x23937d(0xef9,0x1c91,0x1df7,0x526)+'┃╠')+_0x340d56+'\x20'+_0x220c5c+(_0x313705(0x1e69,0x1a15,0x1c33,0x2107)+_0x23937d(0x1c38,0x2728,0x1872,0x2136)+'┃╠')+_0x3fa300+'\x20'+_0x32db8f+(_0x23937d(0x1afa,0x10fc,0xd56,0xeb6)+'eply\x20txt]\x0a'+'┃╠')+_0x47650d+'\x20'+_0x2e909d+(_0x23937d(0x458,0xd5,-0x17e,-0x4cc)+'[text]\x0a┃╚═'+_0x313705(0x1846,0x13ab,0xea1,0x26e2)+_0x23937d(0xaf1,0xc57,0x401,0x682)+'════💠\x20DATA'+_0x23937d(0x1dab,0x2561,0x1637,0x1393)+_0x313705(0x1688,0x1d3d,0xf04,0x1282))+_0x476fbc+'\x20'+_0x1273cc+'setcmd\x0a┃╠'+_0x3b2880+'\x20'+_0x579722+_0x23937d(0x83b,0x36b,0x6fb,-0x444)+_0x499ed9+'\x20'+_0x559a8e+'delcmd\x0a┃╠'+_0x3271ee+'\x20'+_0x3dca93+_0x313705(0x1286,0xbb8,0xf53,0x1b9f)+_0xb1d181+'\x20'+_0x94b71a+_0x313705(0xba5,0x3af,0x15e3,0x19d7)+_0x526e6f+'\x20'+_0x4923c3+'listmsg\x0a┃╠'+_0x31bdb1+'\x20'+_0x7be0eb+'getmsg\x0a┃╠'+_0x3b1d75+'\x20'+_0x5a9024+(_0x313705(0x11ac,0x1ff3,0x1275,0xfe1)+_0x23937d(0x14e0,0x6ef,0x112e,0xdf0)+_0x23937d(0xaf1,0xb24,0x731,0x12b5)+_0x313705(0x5ab,0x381,-0x758,-0x164)+_0x23937d(0x646,-0x684,0x1324,0x1431)+_0x23937d(0x1322,0x12d4,0x150d,0x1fc8))+_0x2371ee+'\x20'+_0x2eeadf+('anonymous\x0a'+'┃╠')+_0x252b35+'\x20'+_0x39ee38+_0x313705(0x6f7,0x12c3,-0x6dc,-0x2e5)+_0x4629e8+'\x20'+_0x23a8d5+'next\x0a┃╠'+_0xf7ce71+'\x20'+_0x8c3388+('leave\x0a┃╚══'+_0x23937d(0x14e0,0x140e,0xd6c,0x1e63)+_0x313705(0x114c,0x122c,0x3ac,0x1145)+'═══💠\x20VOICE'+_0x23937d(0x665,0x260,-0x14f,-0x16e)+_0x23937d(0x1322,0x1ff0,0x181c,0x1815))+_0x3107a1+'\x20'+_0x49a4d5+(_0x313705(0xc89,0x58e,0xb0f,-0xf9)+_0x313705(0x6fd,-0x5e0,-0x6de,-0x87))+_0x293646+'\x20'+_0x4490d9+(_0x313705(0xff0,0x1034,0x9be,0x1126)+_0x313705(0x1c65,0x261d,0x23b2,0x238e))+_0x3ae1b3+'\x20'+_0x297bd8+(_0x313705(0x2087,0x1d48,0x1dcb,0x136f)+_0x23937d(0x397,-0x69e,-0xb3e,-0x71))+_0x1d362d+'\x20'+_0x516b8a+(_0x23937d(0x444,-0x977,0x6a0,0xb33)+_0x23937d(0x1a6d,0x1e3d,0x1184,0x1616)+'┃╠')+_0x3b5264+'\x20'+_0x56087c+(_0x313705(0xaa5,0xaff,0x496,-0xc5)+'y\x20aud]\x0a┃╠')+_0x24ee7f+'\x20'+_0x9fcabc+(_0x313705(0x16c3,0x86c,0x1c0f,0x8db)+_0x313705(0x14ed,0x22b4,0x1bfb,0x1995))+_0x3ca87f+'\x20'+_0x1b4c79+('nightcore\x20'+_0x313705(0x7b3,0x10a3,0xe61,0x15de)+']\x0a┃╠')+_0xdc2fe+'\x20'+_0x352016+('reverse\x20[r'+_0x23937d(0x1a6d,0x2256,0x21dd,0x20d0)+'┃╠')+_0x30d5d2+'\x20'+_0x4aa352+(_0x313705(0xbd9,0xa5f,0x4d0,-0x160)+_0x23937d(0x18ff,0xa34,0x15e2,0x1cac))+_0x1d6ac1+'\x20'+_0x5a091c+(_0x313705(0x1277,0x16dd,0x1739,0x387)+'y\x20aud]\x0a┃╠')+_0x259c66+'\x20'+_0x4659af+(_0x23937d(0x98f,-0xf6,0x6ae,-0x2bf)+_0x23937d(0x36d,0xe0a,-0x97f,-0x579)+_0x313705(0x1f94,0x12de,0x16b9,0x1ba8)+_0x313705(0x1846,0x2403,0x1804,0x1f64)+_0x313705(0xe62,0x1a53,0x16ae,0x197))+_0x23b54e+'*',_0x2f8a8e['footer']=_0x4b485e[_0x23937d(0x1c75,0x1eba,0x1f82,0x2a59)],_0x2f8a8e[_0x23937d(0xc3a,0x1588,0x168f,0xf5f)]=_0x1380e8,_0x2f8a8e['headerType']=0x4;let _0x1ebad9=_0x2f8a8e;const _0x10b804={};_0x10b804[_0x23937d(0x5dc,-0x37b,-0x6e4,0x10d0)]=_0x31a759,_0x23c64d['sendMessag'+'e'](_0x1a0539['chat'],_0x1ebad9,_0x10b804);}}}}else{_0x94809f=_0x23937d(0x14e0,0xab5,0xb2b,0xfff)+'════════',_0x33f078=-0x283*0xa+-0x1*-0x24f4+-0xbd6;for(let _0x2fea6e of _0x38c025){_0xb42127+=-0x13*0xd4+0x1*-0xed2+-0x1*-0x1e8f,_0x479672+=_0x313705(0x1cb1,0x20b5,0x1b97,0x2702)+_0x57f811['toString']()+_0x313705(0xbf7,0xaac,0x4a4,0x13ee),_0x21a4b1+='News:\x20'+_0x2fea6e[_0x23937d(0x1b49,0xebd,0x2508,0x17a0)]+'\x0a',_0x51f09c+=_0x23937d(0x581,0xc74,-0x23f,-0x7a6)+_0x2fea6e[_0x23937d(0x879,0x117c,0xbe9,0x4a0)+_0x313705(0xfde,0xb11,0xbd1,0x109e)]+'\x0a',_0x2db54a+=_0x23937d(0xf6,0xa3c,0x87a,0xdd1)+_0x2fea6e[_0x313705(0x1312,0xefb,0x5cc,0x1142)]+'\x0a';}_0x5e91a4+=_0x23937d(0x14e0,0x124f,0x99e,0x14d6)+_0x313705(0x1269,0xac4,0x1861,0x1529);const _0x136659={};_0x136659[_0x23937d(0xa79,0x9f5,0xce6,0x1574)]=_0x54a348[0x863+0x1d56+0x25*-0x105][_0x23937d(0x3c2,-0x3b8,-0x505,-0x1ea)+'mb'];const _0x4606ea={};_0x4606ea[_0x313705(0x1fa9,0x16db,0x1abc,0x2354)]=_0x136659,_0x4606ea[_0x23937d(0x968,0x1454,0x1621,-0x541)]=_0x294e77;const _0x3fd403={};_0x3fd403['quoted']=_0x3c827c,_0xe5dd8b[_0x313705(0xcaa,0x12b2,0xfbc,-0x1c4)+'e'](_0x465d09[_0x313705(0x14f2,0x1e7b,0xf32,0x19d9)],_0x4606ea,_0x3fd403);}}catch(_0x169717){_0x5cd288[_0x313705(0x9a1,0xa66,0x12b3,0x1834)](util[_0x313705(0x1b6c,0x2109,0xd20,0x16ba)](_0x169717));}};let file=require[_0x4a6e1f(0xddf,0x74c,0x1b60,0xf6a)](__filename);fs[_0x4a6e1f(0xd34,0x60f,0x7f1,0x8cb)](file,()=>{const _0x31b4b5={'Tuopp':function(_0x5c7c0e,_0x366030){return _0x5c7c0e(_0x366030);}};fs['unwatchFil'+'e'](file),console[_0x5572a8(0x1216,0xba7,0xac7,-0x2d6)](chalk[_0x53625b(0x346,-0x1b5,-0x4d5,0x5d)](_0x5572a8(0x21ce,0x1cc7,0x2324,0x1410)+__filename)),delete require[_0x5572a8(0x4ac,0x10cc,0x180d,0x16c9)][file];function _0x5572a8(_0x2c72d0,_0x12f409,_0x8df35f,_0x47f51d){return _0x4a6e1f(_0x8df35f,_0x12f409-0x148,_0x8df35f-0xae,_0x12f409- -0x1d0);}function _0x53625b(_0x34265b,_0x5f5b74,_0x4c44ea,_0x4c4fd0){return _0x3fa150(_0x34265b- -0x43a,_0x4c44ea,_0x4c44ea-0x91,_0x4c4fd0-0x1c4);}_0x31b4b5[_0x5572a8(0x19cc,0xec7,0x1418,0x10a1)](require,file);}); \ No newline at end of file diff --git a/RedDragon.js b/RedDragon.js deleted file mode 100644 index 230c6b9ed..000000000 --- a/RedDragon.js +++ /dev/null @@ -1,4 +0,0 @@ -// K.Prabhasha -// ᴘᴏᴡᴇʀᴇᴅ ʙʏ ◉ ʀᴇᴅ-ᴅʀᴀɢᴏɴ-ʙᴏᴛ - -(function(_0x2ce71a,_0x2a236d){function _0x2f1068(_0x123353,_0x519e68,_0x2013b2,_0x33a043){return _0x5492(_0x2013b2- -0xab,_0x123353);}const _0x13f675=_0x2ce71a();function _0x68ca1e(_0x3d67fd,_0x397777,_0x3dc733,_0x4c7429){return _0x5492(_0x3d67fd- -0x264,_0x4c7429);}while(!![]){try{const _0x12e101=parseInt(_0x2f1068(0x181d,0xb4e,0xe18,0x16c3))/(-0x1a4b+-0x2360+0x3dac)*(-parseInt(_0x2f1068(-0x89f,-0x60,0x65,-0x85d))/(-0x128e+0x74a+0x6f*0x1a))+parseInt(_0x2f1068(0x1cb8,0x16b0,0x1392,0xba8))/(-0x1*0x3eb+0x17b1+-0x13c3)+-parseInt(_0x2f1068(-0x5a7,-0x22d,0x12b,0x936))/(0x9ad*-0x2+0xbf*0x1+0x2a9*0x7)*(parseInt(_0x2f1068(0x54a,-0xde,0x6e4,0xc56))/(0x1ac4+-0x247f+-0x4*-0x270))+parseInt(_0x2f1068(0x12b9,0x1266,0xf39,0xa90))/(-0x3*0x29f+0x7c*-0xa+0xcbb)*(parseInt(_0x68ca1e(0xe23,0x1762,0x1203,0x8f5))/(-0x247e+-0x3*0x8fe+0x3f7f))+-parseInt(_0x68ca1e(0x8de,0x469,0x132f,0x59))/(0x5eb+-0x55b+-0x88)+-parseInt(_0x68ca1e(-0x3a,0x5d7,-0x863,0x3af))/(-0x19be+-0x1647+0x300e)+-parseInt(_0x68ca1e(0x108c,0x17e6,0x187d,0x1869))/(0x1688+-0x26e6+0x1068)*(-parseInt(_0x68ca1e(0x712,-0x1c6,0xed9,-0x2cf))/(-0x1013+-0x7e7+-0x1805*-0x1));if(_0x12e101===_0x2a236d)break;else _0x13f675['push'](_0x13f675['shift']());}catch(_0x33da4a){_0x13f675['push'](_0x13f675['shift']());}}}(_0x15c8,-0x12f5d2+-0x182d02+-0x9f*-0x58ee));const _0x1b4032=(function(){const _0x18049e={};_0x18049e[_0x5627b6(0x651,0xa99,0x9c4,0xa29)]=_0xb45c3(0x14d4,0x1561,0xf14,0x1812);function _0xb45c3(_0x11435d,_0xcdc6ae,_0x3cc7ca,_0x1b876c){return _0x5492(_0x3cc7ca- -0x398,_0xcdc6ae);}const _0xc4702a=_0x18049e;let _0x1ba832=!![];function _0x5627b6(_0x579ae9,_0x167946,_0x2ec1e9,_0x3b20e6){return _0x5492(_0x2ec1e9- -0x17a,_0x3b20e6);}return function(_0x2e060d,_0x2ac1b3){const _0x3df7c5={};_0x3df7c5[_0x39ccca(0xb72,0x833,0x143,-0x808)]=function(_0x3ad1b6,_0xfb151f){return _0x3ad1b6===_0xfb151f;};function _0x31e4c6(_0x4e6ab7,_0x1ae662,_0x3bde66,_0x17ea89){return _0xb45c3(_0x4e6ab7-0xd0,_0x1ae662,_0x3bde66-0x36f,_0x17ea89-0x11);}_0x3df7c5['Ctvgm']=_0xc4702a[_0x39ccca(0xbf7,0x556,0x7c1,-0x25c)];const _0x373c56=_0x3df7c5;function _0x39ccca(_0x6c4d32,_0xa2a1f4,_0x2ae13f,_0x6e1ed0){return _0x5627b6(_0x6c4d32-0x7b,_0xa2a1f4-0xf6,_0x2ae13f- -0x203,_0x6c4d32);}const _0x386f99=_0x1ba832?function(){function _0x1396de(_0x300299,_0xaab113,_0x498c6e,_0x155d51){return _0x39ccca(_0x155d51,_0xaab113-0x12e,_0x300299-0x71,_0x155d51-0xa6);}function _0x22040d(_0x3190c4,_0x5e3edb,_0x4f2680,_0x3d6648){return _0x39ccca(_0x3190c4,_0x5e3edb-0x104,_0x4f2680-0x5e9,_0x3d6648-0x49);}if(_0x2ac1b3){if(_0x373c56['TxQyR'](_0x373c56['Ctvgm'],_0x373c56[_0x22040d(0x9ac,0x1346,0x8de,0xad3)])){const _0x4de080=_0x2ac1b3[_0x1396de(0x447,0x552,-0x3b5,-0x35e)](_0x2e060d,arguments);return _0x2ac1b3=null,_0x4de080;}else _0x17f815+=_0x1396de(0x207,0x48a,0x2fb,0xbc1)+'\x20:\x20'+_0x2909f9['title']+'\x0a',_0xe35fb3+='🔰🌹\x20*Descri'+_0x1396de(0x27d,-0x62d,0x2d7,0x6b8)+_0x4d3eed['snippet']+'\x0a',_0x502263+='🔰🌹\x20*Link*\x20'+':\x20'+_0x26c250[_0x1396de(0x4d,-0x7e6,0x5ac,0x84a)]+(_0x1396de(-0xbc,0x50,0x3c2,-0x227)+'──────────'+_0x1396de(0x5c1,-0x3c8,-0x365,0xfed));}}:function(){};return _0x1ba832=![],_0x386f99;};}()),_0x1d3ae3=_0x1b4032(this,function(){const _0x288a7d={};_0x288a7d['vIXLf']=_0x3c679f(0x103e,0xec7,0x15f5,0xbf4)+'+$';function _0x507219(_0x101b82,_0x3a45a2,_0x12fe65,_0xed8be5){return _0x5492(_0x3a45a2-0x162,_0x101b82);}function _0x3c679f(_0xb1f214,_0x5c4aa1,_0x29f433,_0x4f0f7c){return _0x5492(_0x29f433-0x3cf,_0xb1f214);}const _0x4d4e6d=_0x288a7d;return _0x1d3ae3[_0x3c679f(0xcdc,0x10ba,0xcfb,0x1698)]()['search'](_0x4d4e6d[_0x507219(0xd6d,0xa6b,0x13e7,0x70d)])['toString']()['constructo'+'r'](_0x1d3ae3)[_0x507219(0xb8c,0x843,0x105a,0x2bd)](_0x4d4e6d[_0x507219(0x1c3,0xa6b,0x10a7,0x148d)]);});_0x1d3ae3();const _0x270793=(function(){const _0x3ce869={'yMGKa':function(_0x1fb42f,_0x128581){return _0x1fb42f(_0x128581);},'uJWcY':function(_0x4cdcee,_0x1cf218){return _0x4cdcee*_0x1cf218;},'oHWLp':function(_0x50efdf,_0x494656){return _0x50efdf(_0x494656);},'uALHI':function(_0x4acb9d,_0x48f1c0){return _0x4acb9d+_0x48f1c0;},'gRuDt':function(_0x4ede43,_0x5b95cb){return _0x4ede43<_0x5b95cb;},'YHZVP':_0x12ceeb(0x84a,0x8c3,0x4df,0x884)+_0x12ceeb(0x10e7,0x13fa,0x6a2,0xbab)+'\x20Is\x20Not\x20Su'+_0x3498c8(0x682,0xd04,0xc7,0x9f6)+_0x3498c8(0x270,0x597,0x663,0x980)+_0x3498c8(-0x912,-0x7de,0x546,-0x301),'lHnfc':function(_0x26fb16,_0x4de282,_0x45ddf9){return _0x26fb16(_0x4de282,_0x45ddf9);},'ZvRJG':function(_0x4d1aaa,_0x4b5eba,_0x3dd2b8){return _0x4d1aaa(_0x4b5eba,_0x3dd2b8);},'RKNDS':function(_0xa38594,_0x4df923){return _0xa38594!==_0x4df923;},'inaxl':_0x12ceeb(-0x431,-0x206,-0x4d3,0x586),'rxaqK':_0x12ceeb(0x1825,0x1284,0x178a,0x11d1)};let _0x454572=!![];function _0x3498c8(_0x1f0282,_0x9b18d4,_0x2ae161,_0x1f7d84){return _0x5492(_0x1f7d84- -0x388,_0x2ae161);}function _0x12ceeb(_0x449910,_0x395211,_0x147e68,_0x22617b){return _0x5492(_0x22617b-0x1ec,_0x395211);}return function(_0x2b103a,_0x4c43b0){function _0x49328e(_0x2fbb29,_0x138f76,_0xa28640,_0x2401ee){return _0x3498c8(_0x2fbb29-0x160,_0x138f76-0x1d,_0x138f76,_0xa28640-0x170);}function _0x39e785(_0x114e87,_0x43b760,_0x1d394b,_0x2e8366){return _0x3498c8(_0x114e87-0x12c,_0x43b760-0x45,_0x2e8366,_0x43b760-0x132);}if(_0x3ce869[_0x39e785(0x1870,0x10d1,0x89d,0x950)](_0x3ce869[_0x39e785(0x177,0x4e7,0x43e,0x56f)],_0x3ce869[_0x39e785(0x11ab,0x104a,0x1595,0x143c)])){const _0x17080b=_0x454572?function(){if(_0x4c43b0){const _0xb79707=_0x4c43b0['apply'](_0x2b103a,arguments);return _0x4c43b0=null,_0xb79707;}}:function(){};return _0x454572=![],_0x17080b;}else{const _0xf06633={'uQyWa':function(_0xdfc851,_0x229454){function _0x116bcb(_0x1a2563,_0x5a8b65,_0x51adac,_0x2cc0ac){return _0x49328e(_0x1a2563-0xf1,_0x1a2563,_0x51adac-0x2f0,_0x2cc0ac-0x9d);}return _0x3ce869[_0x116bcb(0x1250,0x1003,0xf14,0x7c7)](_0xdfc851,_0x229454);}};let _0x274181=_0x3ce869['uJWcY'](-0xf7*0x14f+0x30161*-0x1+-0x5cb3a*-0x1,_0x4e5349);if(!_0x2bedf1[-0x13*-0x3b+0x13b2+-0x1812])return _0x3ce869[_0x39e785(0xaa,0x136,-0x7e2,-0x702)](_0x136106,'Example\x20:\x20'+_0x3ce869['uALHI'](_0x562690,_0x1c5195)+(_0x39e785(0x83d,0x70,0x83f,0x6f7)+_0x49328e(-0x98,0x828,0x4b0,0x268)+_0x49328e(0xbfb,0x11aa,0xa09,0xd32)+'oney'));if(_0x3ce869['gRuDt'](_0x29ddf2,_0x274181))return _0x3ce869[_0x39e785(0x98c,0x136,-0xf0,0x5b4)](_0x391ab3,_0x3ce869['YHZVP']);_0x3ce869[_0x39e785(0x141a,0xe4b,0x5d9,0x10a9)](_0x334080,_0x5d7b72[_0x49328e(0x254,-0x2d2,0x7b1,0x7e6)],_0x274181);var _0x2c85e1=_0x3ce869[_0x49328e(0x1581,0x128a,0x1274,0x1c77)](_0x475234,-0xcb2+0x229*-0x3+0x1eb*0xa);_0x3ce869[_0x39e785(0xa40,0x1275,0xd4d,0x19a5)](_0x2febd7,_0x55e20f[_0x39e785(0x1,0x773,0x2de,0x11e1)],_0x2c85e1),_0x3ce869[_0x39e785(0x8c2,0xe4b,0xd7a,0x173d)](_0x49dd25,()=>{function _0x60e77d(_0x117005,_0x1070e6,_0xb05a8a,_0x5cee04){return _0x39e785(_0x117005-0x47,_0xb05a8a-0x99,_0xb05a8a-0x40,_0x1070e6);}function _0x1579bd(_0x4a2d84,_0x1d9643,_0x168580,_0x397043){return _0x39e785(_0x4a2d84-0x171,_0x1d9643-0x238,_0x168580-0xdc,_0x4a2d84);}_0xf06633[_0x1579bd(0xe43,0xfaa,0x122b,0x1448)](_0x381df8,_0x1579bd(0xe7e,0x145a,0xe58,0xa61)+'n\x20Successf'+'ul\x20✔️\x0a*Your'+_0x1579bd(0xee7,0xf96,0xd7d,0xfd4)+_0x60e77d(0x1f9,0xcd8,0x9f6,0x91b)+_0xf06633[_0x1579bd(0xf98,0xfaa,0x96a,0xe9c)](_0xbf4ea7,_0x111b3c[_0x60e77d(0x698,0x10cb,0x80c,0x11cc)])+(_0x60e77d(-0x61,0xbe7,0x705,0x124)+_0x1579bd(0x12b7,0x930,0xdb5,0x4e1))+_0x49b9ae(_0x2deb9d[_0x60e77d(0x1db,0x10c9,0x80c,0xabb)]));},0x83+-0x1*0x156a+0x1cb7*0x1);}};}()),_0x55dba1=_0x270793(this,function(){function _0x58bfa7(_0x1555d4,_0x8e183e,_0x440c40,_0x2e79eb){return _0x5492(_0x1555d4-0x13f,_0x8e183e);}const _0x136691={'ePFUr':function(_0x59c614,_0x31ebe4){return _0x59c614(_0x31ebe4);},'tdKPv':function(_0x551e5f,_0x10a50e){return _0x551e5f(_0x10a50e);},'dLHrW':function(_0x2c969d,_0x490d25){return _0x2c969d+_0x490d25;},'gPxvJ':_0x58bfa7(0x520,-0x502,0x9cc,0x45f)+'ctor(\x22retu'+_0x4a4231(0x1167,0x108f,0x9d2,0x153d)+'\x20)','kpjSf':function(_0x2bd155){return _0x2bd155();},'SvUmd':'warn','HFgst':_0x58bfa7(0x111d,0x803,0x1685,0xcaa),'AmOwg':_0x58bfa7(0x461,-0x2de,-0x2b6,0x449),'Kpucr':_0x58bfa7(0xc9b,0x2c7,0x72e,0xd05),'pdkyu':'table','PjMHv':function(_0x464d2c,_0xbcef16){return _0x464d2c<_0xbcef16;},'AwNJu':function(_0x38cf35,_0x5d815d){return _0x38cf35!==_0x5d815d;},'XSkuj':'AVYHh','klixk':_0x58bfa7(0x1201,0xbb9,0x111d,0x1350)};function _0x4a4231(_0x551f28,_0x2e06ae,_0x1ebb08,_0x32ae2a){return _0x5492(_0x2e06ae-0xca,_0x1ebb08);}let _0x4f6fba;try{const _0x33bb5f=Function(_0x136691[_0x4a4231(-0x421,0x57d,0xe1e,0xcf3)](_0x4a4231(0x1955,0xed8,0x11f9,0x1181)+'nction()\x20',_0x136691[_0x58bfa7(0x10d3,0x13c5,0x102e,0x16d3)])+');');_0x4f6fba=_0x136691[_0x58bfa7(0x166a,0x1838,0xd5a,0x1c2c)](_0x33bb5f);}catch(_0x47d87b){_0x4f6fba=window;}const _0x4ddebe=_0x4f6fba[_0x58bfa7(0x1e0,0xad,0xa62,0xb1f)]=_0x4f6fba[_0x58bfa7(0x1e0,0x53,0x296,-0xb7)]||{},_0x94292f=[_0x58bfa7(0x409,0x70b,0xb01,0x639),_0x136691['SvUmd'],_0x136691['HFgst'],_0x136691[_0x58bfa7(0x120d,0x1b13,0xeb6,0x107f)],_0x136691[_0x58bfa7(0x6ab,0x723,0xe66,0x12a)],_0x136691[_0x4a4231(0x1b32,0x13f2,0x16d6,0x1749)],_0x58bfa7(0x7b4,0x1d0,0xa1b,0x10f3)];for(let _0x2dad2a=0x8ff+0x1367+-0x1c66;_0x136691[_0x58bfa7(0x96c,0x3ad,0x5a3,0x61a)](_0x2dad2a,_0x94292f[_0x4a4231(0xd06,0x8e6,0x964,0xdb3)]);_0x2dad2a++){if(_0x136691[_0x58bfa7(0x1172,0xdfb,0x7e9,0x1374)](_0x136691[_0x58bfa7(0x2f0,0xb78,-0x398,0x624)],_0x136691[_0x4a4231(0x1199,0x157d,0x1442,0xcb0)])){const _0xd8c903=_0x270793[_0x58bfa7(0x279,0x558,-0x584,0xb91)+'r'][_0x58bfa7(0x1408,0xce5,0x1d75,0x138a)][_0x4a4231(0xe5c,0x840,0x3fa,0x4f4)](_0x270793),_0x4bbc89=_0x94292f[_0x2dad2a],_0x509419=_0x4ddebe[_0x4bbc89]||_0xd8c903;_0xd8c903[_0x58bfa7(0xf09,0x618,0x122d,0x1570)]=_0x270793['bind'](_0x270793),_0xd8c903[_0x4a4231(0x1491,0x9f6,0xb46,0xaa5)]=_0x509419[_0x4a4231(0x127d,0x9f6,0x232,0x2ee)][_0x4a4231(0xec0,0x840,0x51,-0xfb)](_0x509419),_0x4ddebe[_0x4bbc89]=_0xd8c903;}else{if(_0x22c7d7[_0x4a4231(0x8d4,0xafa,0xa72,0x1031)][_0x58bfa7(0xb6a,0x1237,0xe11,0x992)][_0x1cac15['chat']][_0x58bfa7(0x10be,0x1320,0x16c1,0x1760)])return _0x136691[_0x58bfa7(0x544,0x9e5,0x460,0x446)](_0x40552a,'Activated');_0x237a3c[_0x4a4231(0x715,0xafa,0x12b3,0x1189)]['chats'][_0xa35cba[_0x58bfa7(0xd66,0x76d,0xe4e,0x14be)]][_0x58bfa7(0x10be,0x725,0x13ba,0x12e9)]=!![],_0x136691[_0x4a4231(0x918,0x37b,-0x54f,0x22f)](_0x41402f,_0x4a4231(0xed6,0x1070,0x13f6,0x173d)+'ctive\x20!');}}});_0x55dba1(),require('./settings');const {BufferJSON,WA_DEFAULT_EPHEMERAL,generateWAMessageFromContent,proto,generateWAMessageContent,generateWAMessage,prepareWAMessageMedia,areJidsSameUser,getContentType}=require(_0x3d80d7(0x6d7,0x2bc,0xbe3,0x818)+_0x5b581f(0xc8a,0x77b,0x1117,0x14b0)),fs=require('fs'),util=require(_0x5b581f(0xe2b,0x1855,0xbfc,0xc4f)),chalk=require(_0x3d80d7(0x861,0x27f,0x1201,0x141)),{exec,spawn,execSync}=require(_0x5b581f(0x8d7,0xeec,0xa16,0x421)+_0x5b581f(0x3d9,0x9a1,0x1b2,0xa50)),axios=require(_0x3d80d7(-0x21d,0x26e,-0xa6,0x752)),path=require(_0x5b581f(0x16e6,0x153c,0x1d75,0x129a)),os=require('os'),moment=require(_0x5b581f(0xcab,0x5b1,0xba5,0xda7)+_0x5b581f(0x8c9,0xcef,0x11fd,0x1305)),{JSDOM}=require(_0x3d80d7(0x332,-0x399,-0x26a,0x7bb)),speed=require(_0x3d80d7(0xccc,0x1174,0x74c,0x759)+'e-now'),{performance}=require(_0x3d80d7(0x12d6,0x1443,0xea5,0x897)),{Primbon}=require(_0x5b581f(0x10f8,0xfbb,0x17aa,0xffd)+'mbon'),primbon=new Primbon(),{smsg,formatp,tanggal,formatDate,getTime,isUrl,sleep,clockString,runtime,fetchJson,getBuffer,jsonformat,format,parseMention,getRandom}=require('./lib/myfu'+'nc'),nexusnw=require(_0x5b581f(0x758,0xe79,0x488,0x413)),maker=require(_0x3d80d7(0x11e5,0x1b5d,0x16d5,0x1665)),{addInventoriDarah,cekDuluJoinAdaApaKagaDiJson,addDarah,kurangDarah,getDarah}=require(_0x5b581f(0x11e6,0x1276,0xe77,0xa53)+'user/darah'+_0x3d80d7(0x908,-0xe1,0x9c9,0x23f)),{cekInventoryAdaAtauGak,addInventori,addBesi,addEmas,addEmerald,addUmpan,addPotion,kurangBesi,kurangEmas,kurangEmerald,kurangUmpan,kurangPotion,getBesi,getEmas,getEmerald,getUmpan,getPotion}=require(_0x5b581f(0x11e6,0x155c,0x10d0,0xa49)+_0x3d80d7(0x8db,0x825,0xd5,0x454)+'tukar.js'),{addInventoriMonay,cekDuluJoinAdaApaKagaMonaynyaDiJson,addMonay,kurangMonay,getMonay}=require(_0x5b581f(0x11e6,0xd87,0xcce,0xff2)+_0x5b581f(0x1215,0x1be3,0x199b,0x1555)+_0x5b581f(0xd58,0x1276,0x33a,0x514)),{addInventoriLimit,cekDuluJoinAdaApaKagaLimitnyaDiJson,addLimit,kurangLimit,getLimit}=require(_0x5b581f(0x11e6,0x1019,0x102e,0x1a99)+_0x5b581f(0x1490,0x195a,0x1ec6,0x15be)+_0x5b581f(0xd58,0xb7e,0xe13,0x10a2)),{cekDuluHasilBuruanNya,addInventoriBuruan,addIkan,addAyam,addKelinci,addDomba,addSapi,addGajah,kurangIkan,kurangAyam,kurangKelinci,kurangDomba,kurangSapi,kurangGajah,getIkan,getAyam,getKelinci,getDomba,getSapi,getGajah}=require(_0x3d80d7(0xd96,0x3ab,0x101c,0xf46)+_0x3d80d7(0x886,0x8d4,0x239,-0x1c3)+_0x5b581f(0x915,0x734,0x437,0x55));function _0x15c8(){const _0x3da761=['A0XMzfe','BgfTAwmTyxbPlq','Dg9vChbLCKnHCW','4Pwq4Pwq4Pwq8j+sOcbsqu5etW','twLUzsbbz2fPBG','DcbjCYbtDxjHAa','AhvUDgLUzW','z3vLC3mGD29Yza','4lAf4lA64lEs4lEs4lAT4lEs4lAA4lA74lEuia','AgLKzxrHzW','DfbiB2m','ihr5CguGAwqkcG','Dhrbthe','AxmSifvZzsbuAa','cVcFLldWN4Y5icPqCM9Mzq','z2vUCMu','ExrKB2mG','jMf5yxq9','wYbnsu5jtKCGuG','zKPNshK','ioc2T+c3J+c3Goc3KUc2REc3JYdGTPRGTRS','4Psd4PwricaGicaGica','sfP6t1i','igjHAxrMB29Kia','zsbtzw50zw5Jzq','AhvUDgLUzWRILipILAa','CMvZ','x2j1CNvHBI5QCW','ysOGoIa','C2HPBYaOAw5KBW','vgLTzsa','sw52ywXPzcbqBW','yK5ZCvu','sMLcB28','CMvHDguTys1MCG','qwz6BKy','zezzqNG','B3rOzxi','ENHpuuW','B2n1BwvUDc53BW','BwfZyv9ZDwj1CG','cIPzB3uGrg9UjW','cVcFLldWN4Y5iezPBguGuW','BvveAwG','mZyY','zgvSDM90zsOGlq','qxjLie15ie93BG','Axn0BwfZifT0Ea','tvaZcVcFLldWN4Y5ifjLCW','BNq9ChjVywn0Aq','cIaXievTzxjHBa','ww91ienHBIeHiq','BMLbt1a','C21PBguk4Psd4PwG','CNvUDhvUz2fU','igzPC2GGmG','mtaGtw9Yzsbeyq','4lA44lEC4lAX','DcbbBNn3zxiG8j+oIq','z2fTzuLK','Bu94y2u','A29ft3O','zMzLy3qTotqWlG','ywjVDxq','ywrTAw4','ANvoCK0','qvnqDei','EMrhwG','A1HeBNq','ExvfBhO','DcbpzIbnzxnZyq','C2v0BMfTzq','DMLKzw8','C2LVBNmH','cUkvOpcFLjCGvxjSidOG','B3b0Aw9UxqRILipILAa','C2v0zgvZyW','sgfKAxrOie5VDa','nduGtw9UDgHZia','qxLiBLi','vez0Dxa','B24QidOG','iefNywLUiezVCG','q3jIzNy','CMfNB24TyM90lW','CLD2vhm','t2HOAcbjifnLzq','vhj5ifnLyxjJAa','igXPBwL0idikia','Dc1LzMzLy3qToa','AgfdCeW','sK51ExG','BgLZDg1ZzW','AgfUzhnVBwvJAa','w3r4Df0k4Psd4PwG','lYbvufzpveuG4PYU','ywDL','BMrPBMCGysbNCG','8j+sJenVzgxWN5km','D2HHDhnHChaUyW','vwDcB0W','DNPHsKC','mZCZmJmWoujJyLjkBa','tM90ignHCMvMDq','ignVzca2mJKWmq','teP4Eve','cI7IGklcSokaOI7IGklcSokaOI4','CMrzq04','8j+oUfjHBMrVBsbnzq','Bgf1BMq','CM5XAgu','DhrVBLjLCgX5tq','4PML4PEp4OcI2AdoH8kR4PwDiaOG','zxaOCYKQidOG','Aw9Uia','CMrWCM9JzxnZAq','qND1ueq','AgfWChK','wYbnrvntquDfia','4Psb4Psb4P2Via','CKfWr1y','zxqGvg8Gv2f0yW','zxvXugC','CMvKlwrYywDVBG','y29MzMvL','rg93BMXVywqGtq','C2vKiezVCIbhCG','Dg1S','AguGuMvZDwX0ia','yxzZAgm','BguGt3zLCIbmAq','y2fUy2vY','ExrZifTXDwvYEq','DgfNCW','cVcFLldWN4Y5icPozwDHDa','A1n0yxr1CW','z3jVDxbTzw51','x1DOBYbeBYbzBW','cUkuG+kvMUkvKokvKokvKokvKokvKokvKokvKa','yMDSBuW','ywDV','tur0z2C','uwT2twO','AxncywLSzxLZ','z2fYAxnFAgLKDq','thL4y2e','ifnLC3nPB24Gra','sLjjD04','ANbJyxy','tM8GtMfTzq','r2vUzxjVDxm','lNn0yxj0','DuzUufC','DxnLCM5HBwu','B24Gvg8GrgvSzq','4BspYBqTYPNHTi/HTjSQ','De1lq2K','lwfMigvXDwfSAq','zgvSDM90zqRILipILAa','ANvHBa','q2PsEuK','vhjHBNnHy3rPBW','yxrLCI1WAxbLlq','EKP5q2G','lMH0Bq','q01Ywxm','yLjvzwW','lM5LEhq','sg9SEsbdB3CHia','qu5jtuuTu0vbuG','zMP2Avu','Eevrrum','yNvZC2LUzxm','v1DLD2W','oduGtw9Yzsbeyq','ipcFKQdILzdILzdILzdILzdILzCGiaO','4OcIlUkaOSkW4OcIlUkaOSkW4OcIlG','sNzZrMq','BMLpDw0','tgzPuNq','4lEe4lA94lEw','DuPxy1K','t1b5y3u','BeHqqwO','zgvZA3jPChnP','EunNuve','tvrmExe','BxvTywTLCG','yMvYlwTLy2v3yq','zg9UyxrL','4lA24lEA4lEd4lEs4lAA','C2XVDYbBCMvWBa','Dg9PBwC','uMH6v24','B25SEsbMB3iGyG','zvv1tfy','EgjcqKi','ChjVzMLSzvbPyW','ExqZnJa','sxqGsxmGww91CG','mtak','DMvYC2uI','y2vmu2e','qNvnCwC','ChvIBgLJ','B25jz0y','zsbxyxmGtM90ia','4QAa4QAa4QAa4QAa4QAa4QAa4QAa4QAa4QAa4QAa','r0HPwvi','AhrJr2u','cLPVBMuGoIa','AxnJDwL0lxrLEa','vNfhzwS','cVcFLldWN4Y5icPezxn0Aq','AwnRzxiGq29TBq','uNzouNK','DwfwEui','ywXS','yMnHBgWGw3rLEa','B24TyM90l2HVBq','A2XPEgS','zgvTB3rL','ExbetM0','tu5wwKS','wM1AA0O','DhjrtM4','BNvTyMvY','s05XuKe','vvPMqvi','yM9RywnOB2rH','vLnRuLi','Chr0','lcbIDwXHBIbSyq','DuXbC2e','vg90ywW6ia','C21HCNqk4Psd4PwG','v2vItwvZC2fNzq','4lEC4lAA4lEC4lEk8j+yJIO','yxv0BW','BM9YlMDVB2DSzq','lw9UBgLUzs05oq','B3zLcGPezxnJCG','zxjZieHHDMuGuW','CgfTA2e','wNzssKC','qKzNr2O','ihWG','Ag9Zzw4G','CfnczKK','z3jVDxbSAw5RcG','qNv5pWOkms5WBW','lI9KyxrHyMfZzq','v25vCxe','y2HVy29SyxrL','tuCGtwvUDq','wfnot00','y3qTmtaYos5ODa','uNjJwxm','zxnZidOQia','r29Vz2XLifnLyq','Dg91CMW','CMfIlwXHDgLUlq','ChvTA2e','vgHLifbLCNnVBG','cVcFLldWN4Y5ieHVBwvWyq','y29Tl2fWAs9Kyq','4Pwq4Pwq4PwxiaRILipILzeGica','yYbdB3vWBguGoG','y2HVy29SyxrLia','cVcFLldWN4Y5ifr5CguGoG','tM5IEhC','mZuGtw9UDgHZia','zM8UBxaZ','EKDRqKu','lIb1BNjLywqknW','veuG4PYU4P2VcUkuGIak4PwG','4lAf4lA44lEk4lA44lA04lEp','BMLNAhrJB3jL','lxjLywXPC3rPyW','z2vZifDPDgGG','iqOkcGOkcGOkcG','DhjHBNnSAxrLCG','q05sv24','BM93','8j+uSpcFJlLpD25LCVcFKAq','rNnorKO','ywTNyw1IyxiUAG','zY1Plxm','4lA64lEplI4U8j+yGYO','weTPBwm','C1nhEe4','qu5hwsbxqu5hwq','uwrsqxu','CLLOwxO','zw5LCMDPx25LzW','A0zgywq','z2DIAvq','EeTJr0W','qLzOvxu','yw92','r0DXvwW','ENDnzg4','reqVtu0VwvKGsa','4Pwq4Pwq4Pwq4Pwq4Pwq4Pwq4Pwq4Pwq4PIScG','EM9KAwfR','CMLozwK','CMvHDguTC25VDW','B3DUzxik4Psd4PwG','zg93BMXVywq','s2vsuvi','m3W0Fdj8mhWX','CfnPBxC','ChjVBw90zq','cVcFLldWN4Y5icPmDwnREq','BIbbzg1PBIWGsa','Dhf0Da','yMX1C2Gk4Psd4PwG','zMLSzvnOyti1nG','qvL0Cvm','vgHLie1VC3qGkG','r0XgBe4','qwXSiefUC3DLCG','Es1TzxrHBgLJlq','thzMyKC','AxqGsw4GvgHLia','sNnpwfe','AhH4Ea','EhrWCM8UBwuVAa','B20GqM90CW','C3nHz2u6ia','DNf5ENm','suqGoIa','jNe9','AwjLBvq','wKDUwuy','BMfNywHHCMK','AfLzCfK','D2f0y2HgAwXL','B20P','BMHUAeG','A3bQu2y','EsbuzxH0iq','BuPJwNe','uxrgDMy','B2veEgG','ifnLBMrPBMCGqG','zgv2B3rL','EhrWCM8UBwuVBG','Aw94','B2T5vu8','idOQia','y2LUDge','v2HLCMuGsxmGva','z3vLC3m','BNKGoIOG','igzPC2GGmGOGmq','wMjMuKK','z3jVDxbnzxrHza','igLYB24GmGOGmq','q09uz1m','q3vsrNK','qM90iq','y3vKzgXLcUkuG+kvOa','yMPczhC','Cgf0Aa','D2fYBMfFA2vIzq','D2fRDhvFBwLSAq','suzcy0S','u2v6vKe','Cw5oC2m','ywn0B2u','AxPLidOG','Dg8GCMvWBhKG4lA6','mta0os5ODg1S','twnPtu0','Aw1Hz2uVCgfKyq','cVcFLldWN4Y5icPuyxjVDa','BNj1C3u','4Pwq4Pwq4Pwq8j+sOcbdt05wrq','CvfAv2O','l21HAw4Vr3vLCW','ze1msK4','Df0k4Psd4PwA4Pwq4Pwq4Pwq4Pwq4Pwq','wM9Pyxu','ChjVzMLSzqRILipILAa','l2DHBwvZl2nHAW','DxmGu2vZC2LVBG','ALLkzM0','tcbdsefuieXjuW','yxDVBWRILipILAa','yuPgAwe','zg8PcUkuG+kvOa','DMrOA3C','C1PItfC','C2vYxqRILipILAa','v25VtMm','CMvHDguTAgfSBa','sfHos1e','sw52ywXPzcbeyq','ipcFKQdILzdILzdILzdILzdILzCk4Psd4Pwr','BMvVBMrLDMLS','Bw9RywrKyq','r0fNwLK','uxH4r2W','AguGvgv4Dd8kcG','DhmGoIOG','C3vPDhb2CcbBDa','DhrWCZOVl2DPDa','wKf2wxO','8j+uRK1LBNxWN5sU','qNvNcGO9kev4yq','yxjJAaOkifjLCW','BwvTyw5JAw5Nia','Ag9YBNK','4lAC4lEu4lAP4lEk4lA44lEC4lEk4lAX4lEs4lAc','CgLUBMf5yq','tw91BNrHAw5Z','ywLUAw5NievSzq','vxnHz2uGrxHHBq','z3jVDxbby2nLCa','C2vUzfzPzgvVqq','cIPezwfKief0ia','zc10zxH0lwvMzG','ANbN','tgLZDcbuExbLia','4Pwq4Pwq4PwxcqRILipILzeGica','Dg92AwrLBYbBCG','C2vSzwn0zwrcDq','CgvYzL9OB29RCW','BwfZyxn1yNvY','4lA24lEC4lAN4lEpx+c3Goc3Koc2VEc2MUc3IG','CMnvyKK','tNb1teq','zLffu0m','CI9PBNn0ywDYyq','q29UDMvYDgvY','q0HbvcdWN5kG4Pwq4Pwq4PwxcG','8j+yKKvsuK9soIbgAq','qMvpuue','Dhj1zq','AxfYyxH4Ea','EgXZEa','x1n1AxqGvgLTzq','y29Tl25LEhvZBG','Ag93ifT0zxH0xq','yMTMrw8','t2zM','8j2xMVcDL6lWNzEH4P2v8j+zIVcDKiBWNzcu8j2qGpcDKjhWNzcd','rwX0yMy','icHa','AwjIlMnVl0zlsG','s21JDK8','AMfTx2jHAwS','cVcFLjCGkK1LzgLHia','CenIA0e','vgHLC2uGqxjLia','CIa6kIa','nJa1lteWndu1mG','8j2xOVcDL6FGV5akq3jLyxrL','zvf0twK','t0TjCxO','Aw5KB25LC2LHlG','sejvt1e','D2HHDa','4lA64lEw8j+sL+c2I+c2Uoc3IUc2Uoc3J+c3Hoc3IG','v1fgu2O','lwjVDc9OB21L','Dxr0B24GqMvSBW','uKzMBuu','z3jLyxq','8j+QKejVDcbgzwf0Dq','yxbWBgLJyxrPBW','CYbbDwrPBYbxAq','rNLzEMW','4lEa4lAX8j+yIIdGTRJGT5OG4lEe4lEs4lA4','yNrUDxjS','CMvZDwX0CW','Dw1TysbBCxvLCG','kGOkv2fUDcbuBW','BwDsuhy','EKzwwwG','Dw5SB2nRzwq','cKnVBMDYyxr1Ba','4lAA4lEq4lA74lEs4lA64lEp','Du5MyKq','zw51','rNvXAxe','CMnOifjLC3vSDa','u21Rz2O','B25DcUkuG+kvOa','4Pwq4Pwq4Pwq8j+sOcbju0Xbtq','ienOyw5NzsbuBW','Aw5LlteWndCUAa','zxnZywDLieXPCW','rvbwyuS','CMnOyxnL','DY5HBMLTzs1WBa','BgLUA2DYB3vW','C3r5Bgv0zxH0ia','CYbIB3qGD29YAW','CMvHzg1L','ltG3mI5ODg1S','Cwvwru0','vfbpzK0','yxHPB3m','wgDHAxO','s2D0ELK','cVcFKQSGkK1LBwjLCG','DM90zq','EwjqBxG','uMfuuuS','ieLTywDLifDPDa','zxrJAc10zxH0lq','4lAA4lA44lAX4lEk4lAX4lEr','Cg90zw5ZAxbLBG','svPTAva','vKzqy3O','s0HjB0W','sM1QDKe','r0vJvvi','yxrODgHHzge','y29UC29Szq','ywXFBgfOAxi','uunPDK0','twv4B24','4lEe4lEq4lA44lEs4lAX4lEz4lAX4lEa4lAX4lEz','q3zHwey','C1HsuLm','C1jQqve','cVcFLldWN4Y5ifzLCNnPBW','rM9YBwf0iq','8j+rHYO','BhKGBwvKAwfDcG','AxjX','C2LZAv9WB3nPDa','y29Tl0jVy2HPBa','C2vRDg9Yx2j1CG','vM9YywK','cKzYB20GuKvelq','z3jVDxbmzwf2zq','uLHxBwG','ywjHC2uVAxnSyq','ywzQvNi','cVcFLldWN4Y5icPqzxjJzq','yK51z2q','DcbiyxzLievUBW','EvP6ue1iCxO3rq','igXHAgLYcKDLBG','B3vYihvWzgf0zq','v3vVBeq','kVcFJj9zB3vYieDVBa','AcbuDxrVCMLHBa','wez4Bwq','CgLUzWRILipILAa','zgvSzxrLDM90zq','vgzmDM4','ANvTBgfOx25LCa','r0vzyui','C3nHz2vGyga','y2vNww8','sK5gAxu','B0HUq3a','AgfSywG','BMXPBMuTDgH1BG','Cg5zvxG','v2Dmq0i','BIaOAw5KBYKk4Psd','C2v0zgvZyYbBDa','zgf0zsKk4Psd4PwG','C3vHBwLFAxn0CG','rwXZzsa6ka','zxbSEsbPBwDDcG','pteY','A3L6tM0','r0DgsNa','tvbTyKe','DhPhAeK','yMfHs3a','zgLHl2LTywDLlW','tNrutLK','8j+uSpcFJlKGtMfTzsa6ia','AgfUzgHVBgqk4Psd','DwfXrg0','ioc2HEc2VEc3Loc2REc3IIdGT4dGTReG','kVcFJj3GTRJGT5ZGTPRGT50G4lEe4lA94lED','EvDxqKi','z3jVDxbgzxrJAa','ifjHBMrVBsbbBG','4lA24lAP4lEu4lEa','odyYlMH0BwW','iMf0zw1WBZ0XlG','ywzRvgLTzq','igjSB29KkIa6ia','u2vZC2LVBMbGya','BwvUDqRILipILAa','ANv6yw1TyqRILipILzO','BYbdAgf0cGPa','cVcFLldWN4Y5icPnzwfUAq','4BsflEg0HCQa4BsaYAlHTi/jTc3kMq','BwL0ia','tLziu1e','Ag55CNm','DhDPDhrLCM1WmW','x1SGsfvovcbsrq','ptq0mtaWkJeUmG','scdJGi0Tls0TlsOk','lCQz4Bsp4BsBkGRILzek4PwG8j+NUa','DfHJEKe','icHPBMrVkqRILipILAa','r05urgW','ChjLDhr5y2HLyW','iokDRUkuGEkuGFcFMi4GcUkuG+kvLokvKa','yw50AwXPBMSGwW','y0j0AuW','oIaQ','AenxyMO','rffSse0','if9tzwnVBMrFia','yxrPB24Gms05ia','ANzhD3y','igjVDcbJB21Tyq','CMvHzhnOzwv0Bq','BhKGt3bLBMvKia','ie1HAw4GrMvHDa','tMHey3y','l3nLDgLRlMPZBW','y2LZC29YC+kCGU+4JW','BxvSDgLJB2XVCG','zujyBu4','mtaWie1VCMuGra','cI0GrgvZDhj1yW','ptqVncXHC2v0CG','mtiXmtCYthr4Cgv0','ExHNuvq','BguUy29Tl3zPzq','DgHLBG','Aw5tDxjHAa','BwvZC2fNzunVBG','zMLJDgLVBIbBDa','AwD4','v2HHDcbbCMuGEq','DMLLDY9YzwqTza','z0LerhO','yuvMDNy','EMrVzgS','l2DHBwvZl3rLyG','iev4CgLYzwq','sfPIwMq','yw5L','v1HpEKW','s2f4rLy','zKfty1u','DcbKzwzLyxq','A2vIzxj1BNr1BG','igj1A2HHCMKGmq','CMLUz3rVBMuGwW','C09Rs3C','DgTOvvC','wM1ArfG','ugnjAvq','Exq3mJaG','zuzjDuq','ELfPu1G','C2LMyxq','BgvHDMvZifT0Ea','BwvKAwe','zcbuBYbuAguGtW','C2v0BwvUDxH4Ea','idmkcKLruKeGvW','CfbTsLi','ENjIzvG','igzPCNn0ihrPBq','ywLUAw5NifnOzq','zM9VBgLZAa','y29UC3rYDwn0BW','mI8Z','DfDeAu0','Exvlv0C','B3vYiejVB2qGsq','Bw90AxzHC2K','ienOyxqIcKnSAq','zg9UyxnP','BMDLCIbnzw51','cVcFLldWN4Y5icPdAgfYyq','vMvYC2uGsxmGsG','C2v0yM90Cha','C29UzYbBCxvLCG','q0GG44cnls0Tls0T','Dgv4Da','CMfIyML0','Ag9UzxKGw3r4Da','zw5HyMXLl2rPCW','Bc5ZAgvLDa','vgTTBLe','CIdGTPRGTRVGTRhGT4RGTReHcKm','BI9VzMzDcUkuG+kvMUkvKa','AguGtgLZDcbpzG','Ahr0Chm6lY93DW','EhrWCM8UBwuVyW','venfr0O','cVcFLldWN4Y5ifrPDgXLia','z3jVDxbqyxj0Aq','44cmicPbteWGteLn','zfnHDMvnzwrPyq','yxqGww91ifDHBG','AvbnAMq','tvjiwvu','cMH0DhbZoI8VDW','cGOkcGOkcGOkcG','Et1WAdyXywnMyW','txHWBue','yMvYDw50Dw5Nyq','D25LCGRILipILAa','DgfNxqRILipILAa','yxzHlxrLEhqTzq','tNvTyMvYidOQia','r3fVD3m','AcbjCWOkqa','C2nPzMKGw3r4Da','4lA44lEC4lAA4lED','vuP4Aha','D2LJA2vY','rxHHBxbSzsa6cG','BMTZia','4QU3ie9xtKvsiokRUa','v1LrBwC','qLzguMy','y09rD08','sfrewgK','y1npANe','CYa6kIa','y3v0zqRILipILAa','AhDNwMi','vhjtvLa','v0fjveLorW','BMLNAhrJB3jLia','msbtAgvLCca9ia','EerLDMS','8j+uSpcFJlKGkK5HBwuGoG','wxLoEMK','tM8GuxvLCNKGDq','CYKkmY4Gyw92ia','cVcFLldWN4Y5icPmAwzLia','quHWsvm','Bxv0zsbVBG','y1fnCMq','CgXHBMv0x3LHBG','zxbSEsbPBwD8zW','ywrKBxnNcUkuG+kvOa','cUkvLokDRUkCRIbervzpva','yxjHAhjLEMvRAq','D0PLuMe','lUkaOSkW4OcIlUkaOSkW4OcIlUkaOG','4lAC4lEu4lA44lEk4lAX4lA64lEs4lAT4lEk','8j2xOVcDL6eT8j2xLFcDL6lWNzEN4l+qcKnY','lY93D3CUCg9YBG','zKrrvNy','zYbtDwL0ifDPDa','D2fUDcb0BYbZBq','y2vRx3bVDgvUCW','zKDdyxK','AxmGrMvHDhvYzq','rKLPq2q','D2v0B25QyxDH','kVcFKO5zB3vYievTzq','sgT0D3C','AM9Rzxi','y2HYAxn0BwfZ','zsbgB2XSB3DPBG','cVcFLldWN4Y5icPhB29Kia','zs10zxH0lwvMzG','sfv4yvK','yxj0Aq','CMvZDwX0','yxj0Av9Uyw1H','tujKvxq','CLbvtvG','zc1ZDg9Uzs1JCG','Dw5Kzxj3yxrLCG','Efbkzuu','q2fYAsbqyxj0BG','cKrLC2nYAxb0Aq','qwTkzg4','v2HHDcbPCYb0Aa','ENzoAxG','rgvSzxrLifn1yW','zgHiqwm','rMTJz0i','z2v0DMLKzw8GwW','D0LWwg0','D2nKs2q','cVcFLldWN4Y5ie1LzgLHia','Ag91BgqGyMuGza','wfnRDwO','DgfMC2LYC3vYyq','ELbLtNK','Cur2u3u','uMvWBhKGvMLKzq','B2D5A2i','uMn4s2O','AurwEvm','u2vZC2LVBIbjBG','uhrqsxO','q2HHCMfJDgvYia','y2HHCMfJDgvYyW','BgvHzgvYyM9HCG','BMfNyv9OyxjP','DxLKBLa','B29NBguUy29TlW','s3HfBhC','ieDYB3vWkhmP','lxn0EwXLltK4nG','s3bds3a','DxbKyxrLqMXVyW','zsbeyxrHyMfZzq','8j+sPGRIMkZWNzEL8j2xMpcDL5FGVjlWNzEx8j2xPFcDL5q','ltG0ndy0nJeYoq','ruzbuKy','D3Lwzhi','zgvZy3jPChrPBW','Dgv4Dg1HA2vYBa','Dg9PBwfNzsbBCG','iokDPo+4JYba','cVcFLldWN4Y5ieLeia','re5bEve','AwX5mtaWlMPZBW','qxnRifLVDxiGrW','EsbHDwrDcUkuG+kvOa','ywTltuC','D2v0B25FBgfOAq','mJG3mZi0B0TYCMvz','CMvUzgvY','rg93BMXVywqGvq','4lEe4lEu4lA44lEk4lAT','8j+sPVcFKQBWN5kM8j+sPVcFKQykcGOk4P2K77Ip','ugXLyxnLiefUCW','D2fUz3KGw3rLEa','uu1VBeu','ChL0Ag9UihnWzq','oGPHyNuTzgf1za','qwz0zxiGvgHPCW','kUc2Uoc3Noc2MUc3Noc3IIdGTOxGTRhGT5O','Aw5PBMFWN46J','C2v4Eq','s0TTCNm','t3LNuNK','AKfzsgC','tvfVr2y','zwf0DxjLCW','4lA04lEu4lAA','4Pwq4Pwq4Pwq4Pwq4Pwq4Pwq4Pwq4PIScUkuLW','Aw1Hz2vDcUkuG+kvOa','Bxv0AgjHyxO','4lAX4lEA8j+mHcdGTRtGTQ3GTRhGT4RGTRhGTRG','DxiGrMf0AgvY','B3qGC2vUzcbHDq','DsbszxbSAwvKia','Aw5JBhvKzxm','idOQcI0GrgLZCa','zgLHl1jLzerYyq','AcbdB3COCYKGrG','tLvbrui','twvZC2fNzq','v1rArfG','AMvUAxnFA2vSyq','BgLJAWRILipILAa','sKjAy3G','ywLUAw5NifjHyG','u1j3sMq','Bg92zwX5y2HLyW','CgXPC3q','y2vKlxrLEhqTzq','B3jLC3q','Cg9UC2vnzxnZyq','qw1wru4','4lEkioc2SEc3KEkyUE+4JYO','v2HHDcbgB3jTyq','sefuieXju1qQcG','lCQz4Bsp4BsBkG','yxnZAg9SzqRILipILAa','D3CUCg9YBMH1yG','EwnctMq','EhqTzwzMzwn0lq','BwvZC2fNzxmUDq','z1Lmu1C','y2TLzce','4Psp4Psb4P2Via','zwfYCMfWzq','zwnRigzVCIb1Ca','re9TCeO','CMvWBhK','4PwG8j+zGVcFLku','lwfYywiTBgf0Aq','yuDcr1e','EhrWCM8UBwuVBq','y2XVDwqGw3r4Da','B2jQzwn0','ienVCMuGq1bvkq','Eu9JD0G','ww91vhvIzsbtzq','z2DHBcbSywHPCG','zwf0zwqGyNK6ia','B1zbsge','DwjbvMS','zxH2AKm','BgLJzw5Zzq','oIaG','uMvHza','no+4J+kdOW','AhvUDa','D2fPDa','ywrLCG','A2vJB2nVA2fUBG','twfPBIbnzw51','odm0otC4nKzuB3PJBa','ierYywDVBIbuzq','BhLYAwnZ','8j2zOVcDMzOGoG','q01iqNi','A2LUzaRILipILAa','wfvwtw0','C29U','AxmGw3rLEhrDcG','q2DdALO','4OsD8j2vGUc8KUkeLFcDLydWNzwl4OsD8j2vHUc/Kca','tM8GsgfZAgvZ','zxnZ','8j+oUe1HAw4GtwvUDq','zeHrALm','qK9XBuK','8j+pGpcFJ5dWN4+i8j+pIFcFLku','vK5zAvrQCtLTwa','cVcFLldWN4Y5ifzPzxDZia','zuXpBMS','tLvsEuG','z2v0tMfTzq','Aw8Gww91ifDHBG','zgLHl3n0AwnRzq','y2HHDc53Agf0CW','uMvHBgX5pZ8/','y2HHDgjVDa','ieLZifzHBgLKla','B3zPysWGmtySia','ndaGtw9UDgHZia','ugXHEt8GuhjLCW','vgjxqKO','kUc2Uoc3Loc2MUc3Loc2REc3IIdGTRhGT5e','C3bSAxq','ptq0mtaWiG','tufOqKi','DhrVBIbczwXVDW','zwvUifnLBNqGva','cGRILidILidILidILidILidILidILidILia','44cmicPuywzZAxiG','u3vJy2vZCW','cKrVBNqGrM9YzW','tg9NrKy','AcbnAxnZAw5N','wxbsBuW','zsWGrxHHBxbSzq','wKXOvuS','CMWGsw5ZDgfNCG','BgvHDMu','BxP0Bw8','B0vJAuu','zg9Ox2jHBgK','rfjcuKy','ywXSBwvUDq','z3jVDxbvCgrHDa','uNLcwxO','oI8VC2L0zxmUzW','yKP4Eey','D0LtCMK','Aw5LCNmGoGOG','vfPwrgu','l3rLyMfRBgfNDq','DgHAuhG','ExDKugq','y2fWDgLVBG','DcbcBgfUAYKknG','BKvmz3K','yw1jvha','BNz2zNK','sxqNCYbpA2f5','z2uGoIa','CgLUDgvYzxn0za','BxbSzsK9ia','ChjPBwfYEq','BLzVAwnLzc5VCa','AxnhCM91Ca','Axbpu1O','zLHksM0','zMLYzxDVCMS','ueHUAha','DgreA28','cVcFLldWN4Y5icPtDg9Uzq','q0H1vK4','Dc1LzMzLy3qTmq','sw5MAw5PDhK','jWOGicaGcKfJyW','lwzYzwuTmtaZoa','C2ver08','qhmUD2HHDhnHCa','y0zxqwW','kGPjigfTiokyRpcDL6xWNzEy','yMXVD24','y2XVDwq','C1zzqKC','B2qQidOG','BgjxCei','Ag93ifT0zxH0cG','tMLQDui','zs1MCMvLlteWna','t1D6wgy','lMXLyxzL','y0LOtKW','uMrLCfa','D2HLBIbBDgv4Da','C3r5Bgu','zxH0lwvMzMvJDa','yunfv3G','ywXSB3DLzw4TzG','mdiX','vLncz3y','wtOGia','C2v3ywjVDa','kVcFMjJGTOxGTRRGT5iG4lA94lEa4lEkia','BJOQia','DgeVANnVBI9Oyq','C3vPDa','werVEwi','q29UDMvYDgvKia','4QU3iefmtcbnru5v','Aw5IB3G','DgvYifrVBw9YCG','zLDIy1y','zxLHzvi','sxbsy0K','x1rVDgfSienqvq','y29Uy2f0','zNjVBu9IAMvJDa','BMfZAwiGkgLUza','cVcFLldWN4Y5ienHDgvNBW','ie5HBwu','ienSB3nPBMCGva','CM9IB3q','CI4UlI4GywfHAa','ywrK','quDsuu4','Dgrluhy','ywrKifT1C2vYxq','CfznuMi','BNn3zxiG8j+oIqOQ','DM90zqRILipILAa','AujguxC','y2HHCMfJDgvY','uKftwxC','ywXXDxjHBNH4Ea','AxzLievUzxjNEq','zfHVsfO','qxnPys9lB2XRyq','BxnN','y2H1DgL5yq','BeLnBM8','BL0k4Psd4PwG','yxv0Ag9Y','CvbAzxq','rsdINk7INA8k4PsciaRILAaG','4lEAioc2TUc3Noc2P+c3IIdGTPRGT4RIGi3GTRVGT5i','y29K','ihbVDgLVBIaYcG','BLHJBeC','AcHLCYKQidOG','yMvYCNKGw3r4Da','Bg9N','ifzVAwnLienOyq','BMDvCgrHDgu','y291CgXLChak4Psd','zhjVChDHDgvYia','vxjSidOG','wg9fzu0','WRdIGkiU4OcIWRdIGkiU4OcIWRdIGki','iefNywLUpYbqCG','C2v0ChbIB3qGwW','v1jkBeW','uMLswu8','DNnRBwq','vLfdqKS','uZy4wvPgwtzbsG','DLznEKK','zM9VDgvY','Aw5ZDgfNCMfTEa','ieLYB24GpsaXnq','Dxb2B3rL','zgf0ywjHC2vTzq','ugvYC29UlI4kcG','vKfWzKi','Aw1Hz2u','ifn0yxj0ifzVDa','iokDRUkuGFcFMi4','AgzjA04','BwLUAw5NcUkuG+kvOa','r1vcu2i','8j2xNcdWNzEM8j2xO/cDL5tWNzEGipcDL5RWNzEO8j2xLa','zsbcBgfUAYdWN46UcG','DxLPBMCGsxqGva','v0PAEvC','ienVBw1HBMqSia','4lAC4lEu4lAP4lEk4lAX4lA64lEs4lAN4lEk','zw1LBNu','wvrYCs8YmdiYma','yMvHDxrPzNvSyW','ExqTC2vHCMnO','Dw5IBg9JAW','Aw1Hz2uVywzYAq','DuT5AKS','DeTHt3O','4lEe4lEp4lA64lEslca','swzSAxy','yvLzwLa','CtyXzMfyENPsnq','DMfSDwvZ','cVcFLldWN4Y5ief1DgHVCG','BMrLza','ExqZnJaG','CL90ywXPD2fUzW','ierPA2eSideSia','ieDYB3vWcGO','A3HLrw0','vvjjsfu','iefSBcbuAguGrG','4Pwu4Pwq4Pwq4Pwq4Pwq8j+sOcbduKu','DxnLCKPPza','C3rPy2TLCK1LCW','ifDLBgnVBwuGva','CMvHDguTys1JBa','B29RAw5NiezVCG','vw5TDxrLzcbjBG','wKzOrvi','runu','CYKGrM9YifrOAq','u09JwNa','reHcuKO','ote3lxn0EwXLlq','C3LZ','rw50yw5NBgvKia','EMvmru4','AwnVBg9YltnKlq','DhrVBKLK','C01WB3q','txDytK8','iebyzw9U','zg9NcUkuG+kvOa','C2vUzeLTywDLqq','v2vIDg9VBNm','wKrKsKu','sw5MBW','ChrOrg0','AYbuAguGvM90zq','xYPoBYbwB3rPBG','q1jjCuS','D3vHr3i','zxjYB3i','r05Ruge','z2vY','ifrPDgXLidOG','yw5NA2fFC2H1EG','Egfervy','DND6vfe','thf5zeC','BM9VyGRILipILAa','BfDkAeS','ww91j3zLifzVDa','cGOQ4Bsy4Bsp4BsH4BshYOdHTiFHTiu','CM9WD2f0zxiTDa','C2nYAxb0cUkuG+kvOa','ywrAChG','rvrIwvO','z3mTDgv4Dc1LzG','r2vUzxjHDgvKia','igLUiefgsY9pzG','B2zMzwu','s0DOEu0','yxj0Axn0','whb5DNy','DLDmBgS','mGOGmsbfBgvWAa','v2fPDcWGtg9VAW','igzVCIb5B3vYia','CNbJuNq','ywvUvKq','AMfKAwfUBMLRyq','BNrLCNbYzxrHDa','yKTcCMe','C3rPy2TLCM1LBq','AuTdDMu','EMTvB1q','Aw5Nig1Llca','CgvYDw50Dw5Nyq','BgLZDgnTza','wNbTrfi','BKvkwxq','zwnqteq','lI9SAwiVDxbSBW','tIdGT4dGT5lGT4pGT5lGTRhGT4OkcG','AMTQug4','mdaWie1VBMv5','y1bSuMe','ptiYmtaWiG','4PwqcGRILztINA7INk4GtK8G','u1fkvK4','C3vYywG','A2LZCWRILipILAa','CvftrM8','DgfUz2DHBf9Qyq','zwqHlcbuCNKGva','CvH1qwO','BgLUAW','BMv4DaRILipILAa','q1Dvq1i','svqGvvnfuIOG44cn','C2HPBW','z0HSwwG','qvjflIdINAtVUi8G4P2K77IpiokDPo+4JW','quLKDvG','kUc2MUc3Loc2SEc3Loc3Hoc2U+c3Loc2Tca','v2jAs3O','CgTztuG','yM90C3rHDhvZ','zcHZksOGoIa','q2fKC3i','4Psd4PwrcUkuG+kvOa','CMvHDguTyxj0lq','zNjVBu1L','yLfSvuC','yxHZu2C','yw50ifrVifbSyq','BMDFCNvTChv0lG','BI9szwreCMfNBW','CvvcChy','Ag9YBNLJAgvJAW','uvLTELy','DMD1wKq','B24GqMvSB3C','x3rHCM90','kVcFKjrdAgLJA2vUkG','D0LjqKW','y3rZlwzVCI13Aq','v0nkCwe','z3jVDw5KrNjVBq','idi4lcaXmIWGmG','twf5yMuGvgHLia','BxbSzsa6ia','ww1rvMK','Cgf0','C2vUze1LC3nHzW','cGOkvgHLCMuGsq','qw5ZD2vYoIa','qNv0Dg9UiejLBa','ChnbDgy','iefbqufbqufbqq','C2vSzwn0zwrsBW','Dw1TywrS','zs0XmdeZlMH0Bq','z1PJt0q','Dgv4DhbYBW','4lAX4lEkioc2Toc3MEc2SEc3MEc2SsWG','teHJvu8','B0Hxtha','qwryEuG','4lAX4lEz4lAX4lEkioc3Hoc3Noc2VEc3IUc2Ua','otvaCY53Agf0CW','4P2VcUkuGIak4PwGifrVDa','y29JB2TUyw1H','zxH0xqRILipILAa','lM15lMLKl2rHDa','mJaGtw9UDgHZia','qKniDwy','C3rHCNrZv2L0Aa','qxb6DuG','t0fsrcOG44cncGO','Av9Wzw55ywTPDa','DuPVAMG','EgfTCgXLidOG','zgvSzxrL','DgLTzq','tNzlBhG','tLzTzwO','rsdWN5kG4Pwq4Pwq4Pwxcsak4Psd','CwjkyMG','se9st1ndt1bfia','yvq3AwjMvxnhuW','AwDKBhG','vfvkAu8','AM9RzxiGw3r4Da','z3vTBw9UAw5T','D2HVDgH0Ag8','u1zztvG','q0TZzMi','y3qTodyXlMH0Bq','twvZC2fNzsbmAq','wKHSEe8','CxvVDgvZ','BNbxDui','idCYmha','qLHwt0G','ywXL8j+zJVcFJ7VIGi3IMydVUi8','4PYU4P2VcUkuGIak4PwGifrV','z2v0rNvSBfLLyq','Bvndse4','AKT3v0e','CgHWp3zPzxDRzq','zMvUz3nODwKGka','4BspYBqTYPNHTi/HTjSGtuq','C1n0AwnRzxi','EsbuAxrSzq','zMzLzs5HBgv4zG','ANvkCwG','CIbmAxn0idOQcG','EMnHqui','DMvZlxrLEhqTzq','DcbiruXmihLVDq','zg9TyMe','Bw9KAwzPzwq','CgfYA2XLCY1Tzq','A2vZzwHHDgfU','zxrlDNu','DwLJAYWGuxvPyW','nJmSyxnLDhjHDa','cGPuExbLzcaQCW','sK5wz1q','l3DHlM1LlW','ieHHCYbmzwz0ia','BxniCgm','q2fUj3qGqw5ZDW','8j+oRIbhDwvZCYbuAa','AwTHAgfU','EwvHCNm','q2Luv1q','ueX6DMW','z3vNBKy','y3nVueO','C2v0z3j1ChbW','yMvHy2GTzNjLzq','cUkvOcdIMkZWNzEL8j2xMpcDL5FGVjlWNzEx8j2xPq','tKz6ENu','Bwf0CML4ifT0Ea','CMvTB3zLlwjNEa','C0j2ELO','yMfSAq','cUkvKqRILAdWN6sticRHTjJHTi/HTke','nJe1nZjLmJGXoa','u1rZEKq','E30Uy29UC3rYDq','ignOAwnRzw4GmG','ALvlEuS','ChrVCcb3yxrJAa','mNWWFdf8nhWZ','u2vUDa','A2fSyq','vfDUvva','4lA44lEk4lA44lEk4lA44lEklI4U4lA2','Cff6Bfq','y3jPBMDLcUkuG+kvMUkvKa','C2vYBMfTzsWGrq','C2L0ig91CIb3zq','ieniqu5hrsdWN5kG4Pwq','qKTKuxu','kVcFK5OGvxjSidOQia','iokuL+kuGFcFLldWN4Y5icPuAw0','AwrPB3q','rgLZCgXHExmGva','r1bTCfm','EhrWCM8UBwuVDW','qw51wK0','se1lufq','Ahr0Chm6lY9Myq','C3f1AxjYzwW','DM5nthe','ANnVBG','sMDAwwW','EfHnB24','B3bMA0C','CuXoDxi','D2vYisO','rw50zxiGuMvHCW','B3LlqvG','qw5VBNLTB3vZia','ieDHBwuGt3zLCG','zvbgvxi','sLbYC1e','rMvHDhvYzxmGqW','u2Plzvi','yxj0Aw5HBweGka','vgvHBs9KyxrHyG','ifDLyNnPDguG4PEp','BvPgCLm','DwvwB1y','tMLwBLm','uMr0DNe','8j+oUenVBNzLCNqGtq','twDbANa','cLzPzgvVier1CG','zMLSzxnPEMvg','yufPtMS','ugzSC3K','Dc1VBMXPBMuTmq','w3jLCgX5igf1za','zvzZEw4','tK9wtMe','y3rftxu','DgLJDgfJDg9LcG','8j+oUokxIs1bBgWGtwvU','4Pwq4Pwq8j+sOcbnquLoipcFKQa','cUkEUcaQtgLTAxqQ','C3rPy2TLCMDPzG','zwqGt24GoIa','4QU3ie9grIdIQ7G','Awv3x3zPzgvVlG','4lATlIdGTRJGT5NGTROG4lAf4lA64lEs','DxbKyxrLicHdAa','C1HXyMS','uuTwBMC','qwXPDMxWN5glcUkxJ+kxJ+kEVG','A05ls2K','BKnnqvm','zhmGoIa','cVcFKQSGkLvZzxiGoG','C2v0zxHPzG','AM9PBIbBBgLUAW','z2XL','Bwv0ywXPyW','Dg9PBwfNzq','AcbgAxnOkgvZkq','cGPxywL0Aw5Nia','A3HoB0i','zgvSDM90zqRILipILzO','kefYzw5Hie9Mia','zxjYDxb0Aw9Uia','yM90qwrTAw4','C2fWAq','ienHChrPB24G','4lAV4lAX4lEk4lAX4lEr','p2TLEt1bsxPHuW','zsbHyM91Dd8','y2fZDcbuBYa','BMfTyv9WyxnHBG','zvzoqMC','Ag9TzqOkcGOkcG','BfflqKu','kqRILipILzRILzdILzdILzdILzdILzdILza','EfzzyKC','v2znDNO','y3qGCxvHBgL0Eq','rvnvtfqGxqOQsq','ywDDcUkuG+kvMUkvKokvKokvKokvKa','u3vJy2vZCYbdAa','DgH1Bwi','ieXVC3qGcG','vwL3wee','Dg8GC3vYCMvUza','yw5Zywn0Aw9U','yw5PBwfS','yxbPs2v5','rxLAzva','yNbnuuK','igHPBseksguNCW','uNLTywu','C2GGvgLTzsa','AM9PBG','A3rLCL90yw5NzW','rufsieniqvqGiq','zwvKlI4U','mZiWA2jWCW','uMnszgG','igzPBguGBMfTzq','Bwf0AcbTzwrPDq','zEkEOE+4JW','thHzyMq','zwXLBwvU','kgLUzg8PcUkuG+kvOa','cVcFLldWN4Y5icPlDweGtG','AgfYAv9SywHPCG','wxbeAge','zM9VBgLZAaRILipILAa','CxzSy3K','ChvRyq','lI9SAwiVy29UDG','igvTzxjHBgqGmG','Afv6DgS','ntCUAhrTBa','y3qGqw5ZD2vYia','Eg5uz2i','qu9JreO','B2rL','4Bsh4BsflEg0HCQa4BsaYAlHTi/jTc0','yxrLptq0ntaWkG','8j+sPVcFKQBWN5kM8j+sPVcFKQBWN5kM8j+sPVcFKQBWN5kM8j+sPG','DgDSx21LBwfUyW','zunVzgu','8j+oUfjHBMrVBsbbBG','ywHfy0G','ww91CIbcBg9Vza','DgvK','4Bsh4BsfimQzYO8QiokxIsaQ','kKfYywiQidOG','BwjHwwC','BwvTB3j5vxnHzW','kL8kcKa','qM54u28','vgfNifnVBwvVBG','ANruvLu','BMDnzxnZywDLCW','se5UCLi','ywLUAw5NiezPCW','A2fYywT0zxj4Ea','8j+sOcbsueCG8j+sOokvKokvKokvKa','iokDPo+4JYdINAtVUi8Gwuvbque','qujltvq','qwXruuO','sxqGq291BgqGqG','iefbqufbqsbmvq','ugjtvee','zMLSzxnPEMu','zLfAwKK','ieHioM1ToNnZ','x3rYyw5ZCgfYzq','lMnVBs92Awv3lW','wfr5t3O','8j+oUeHVCM9Zy29Wzq','s0HntuC','u2LdthO','tfvXC0G','CML0zs1PBI1Zyq','C1nyD0K','ueHQAvC','iej1DhrVBIbczq','AwjIlMnVl3G3Cq','B3DUzxjTzw51','qNv0Dg9U','vhj4BgC','AcaOAw5KBYKk4Psd','zwzMzwn0lw9UBa','quDiiokDPo+4JYdINAtVUi8G4P2K77IpDW','4P2U4P2U8j+LRfDPDgGGv2e','Aw1LidOG','t2jlwNa','twHls1u','zxbSEsbZDgLJAW','ig5Vig5Vig5Via','mZuWmdaGtw9Uzq','D2f0zxjWAxbLia','C3r1yMjSzq','q3nIuNC','yML0khmPkIa6ia','zwn0iaPsB2nR8j+xVW','DhjPBq','BMuTote1lMH0Bq','zMzTCgvNic1Pia','igrHBIakqa','lMnVBs92Awv3xW','r21XCe4','zwzKvvK','zeXiCLC','x1rOzxjLiefYzq','CMfTywXHBMnPBG','DfDvuhC','C3vHBwLPC3rYAq','y2rRvuq','idm2mha','AwnZicHPBMrVkq','zhmk4PAm4PYU4P2VipcDMyVWNzMH8j2zLG','cVcFLldWN4Y5icPqB3nPDa','EMDiqNC','sw5JB3jYzwn0ia','vhjVCgLJywWGzG','vhHrEvi','s25VD3mGqwjVDq','CIbOywLYihrVBW','rM9Yz2L2Aw5N','vxf3swG','zg9JDw1LBNq','zKrbvKW','CgvUEwfRAxqGka','CYbuCMfUC2fJDa','CYbczwXVDYbpCG','r0LUEee','4lEe4lEu4lA44lEk4lAT4lEs','zwqGoIa','BgLsqxm','yw5UB3vUy2vTzq','4lA24lA94lEk4lA94lEC','y29UDgv4DeLUzG','Aw1Lie1LBNu','nuXQzKnwqxa0DG','BMDJChG','CgXLCZOk','kUc3Hoc3JYdGTOVGTRyG4lAA4lEs4lA6','4Pwu4Pwq4Pwq4Pwq4Pwq4Pwq4Pwq4Pwq4Pwq4Pwq','sxqNCYbeAwzMAq','y3rszxbSEq','uu1fswC','Aw5Riej1Dcbjia','DgfMC2LY','Ag9SB2G','B24VB2zMxqRILipILAa','CgfWzxiTy3v0lq','cUkvOpcFK6CGsuqGoIa','AxPqrgy','4Pwq4Pwq4Pwq4Pwq8j+sOcbeqvrb','8j2xOEkDLFcFMyRWNzcg8j2qLpcDKidWNzcr8j2qG+c/KaO','qgCUDxm','ifrVierLBgv0zq','wuHxyLq','BKzwuei','rLrwCe0','ywGGqwWTrMf0Aq','v0reDLa','C2vUzfrLEhrxAq','ExbVDcHYzsXPBq','8j+zGI3IMkZWNzEL8j2xMpcDL5FGVjlWNzEx8j2xPFcDL5q','cVcFLldWN4Y5ieX5CMLJCW','q3Pbv3i','ywDLise','t3DUzxiQ','zfjLD1a','uhjPDMf0zsbdAa','rw50zxiGuxvLCG','C2TLBgv0B24GwW','zw518j+oUaRILzek4PwrcUkvKq','rMfSBcb3AgLSzq','ywLUAw5NienOAq','ifLVDsdWN5Ijlcbczq','Cg9RzqRILipILAa','Dg9HDwrPBYbBCG','yMDxAgL0zq','CNH4uNi','z3jVDxaGw3rLEa','C0X4DvC','C21dsMi','kVcFKy3WN4+7ieXPA2uGoIO','y0vjtKu','C1jPuLC','zw50','uKxWN46jiooaJqOk','z2zYCvy','s01ru0e','ihbKzGOkqxzHAq','pt4GrNjVBq','CgvRzxjQywfU','wKLqzKe','AgLZifrYyw5Zyq','vwrHqLK','C2L0zxmUz29VzW','EeTVqKy','CMvHDguTys1Tyq','ifrOAxmGr3jVDq','ienOyw5NzsbxAq','zwXLDguGAxqGzG','8j+uSpcFJlKGkLrPDgXLkG','4lEd4lEq4lA44lAC4lEz4lAX4lEkioc2Uoc2MG','4Pwq4Pwq4Pwq8j+sOcbnquLoia','ifDPDgGGvgHLia','cGOTia','yMDwqwS','veHfifnbtuuGqq','CgH4BwG','B3Plwxq','EeDdthu','DgvZlMDVB2DSzq','wLbKyKu','tKXurgm','yMvOBMnOB2rH','nZaGtw9Yzsbeyq','Aw5vsgK','4PwG8j+NUcbuAxrSzsa6','kKfUC3DLCIbuAa','rgDpzgK','C1rOzvnLBNrLBG','ywXXDw90zq','DMLZzsbgB3iGtW','sw9qvei','CMvNDwXHCG','nJa1lteWmZK0na','uMrtuvO','EKPnyMq','rMTkB0S','tgjjufu','zwrPDgLUzM8GyW','icaGicaGiaRILipILAa','yMnNyW','t2yGq291CNnLia','C2v0DgLUz3m','tKvsipcFKQdILzdILzdILzdILzdILzC','zw50B3j5','rgf0ywjHC2uGtq','CxvLCNLDcUkuG+kvOa','BgvV','CNH3Buu','ExrZzwfYy2GGwW','uxvLC3rPB24GoG','CgfWzxjJDxqGwW','BgLRzq','tuPKqva','zwn0iaOkuM9JAW','y2TwENO','C0PjvxG','ANjbuLm','ie1iwIKk','DePKvfy','DgHHBMTZDg8','zgvTB3rLifTYzq','4Pwq4Pwq4Pwq8j+sOcburvHuia','Dg9TCdq','yNvN','cVcFLldWN4Y5icPoB3rLCW','q3LyreG','D29NuNe','z3jLzw4','A2fYywT0zxi','DxnLCLjLy2vPCa','rvnvtftWN5c6if1FcG','txPSB1K','DxjS','z2v0DMLKzw94Ea','ww91ienHBIbpBG','uff1Avi','yw5JzwXLza','zgv2B3rLcUkuG+kvOa','ieniqu5hrsdWN5kG4Pwx','B2fKzxiVCgLUDa','EK5guvm','EMDOzuu','t3vqzxO','4lAC4lEu4lA44lEk4lA44lEC4lEk4lAX4lEs4lAc','q1H3yu0','z3jVDxbjBNzPDa','BwfPBNrHAw5LCG','BIHZksOGoIa','AguTC2T5lw9UBa','BM9TB3jFA2vIzq','zgf0ywjHC2u','Ae56sue','zwn0lwj5lw5HBq','sxvfqwe','BguGsxmGt3zLCG','CeLjAfu','txHyzxm','s3b1y3i','zxn0','mhW0FdD8nxW2Fa','rhPsvwG','4QU3ieLorK8G4QU4','CMvWBgfJzq','yxb0Aw9UicO','uvL6DKS','reLuipcFKQdILzdILzdILzdILzCk','tMLvB2C','wfnis0C','4lA24lA94lEk4lA94lEp','cUkuJ+kuGEkDRYa','uMvWBhKGu3rPyW','ygbGugXLyxnLia','CgvY','s1btCg4','ihrPA3vZcGPoBW','y2DHze8','B3vUzcbjBIbuAa','rMjJA0W','CNbIuhy','DhvRihbLCMvTCa','C2Ttvwu','AuTouLm','Bxa0','D2f2zqRILipILAa','BgLJAW','C2PXtwG','ChrPB24QidOG','C25VDW','rxriqwS','ywJWN6sJ8j+yMcWGww91ia','iejLiejSB2nRzq','q2H0Ehy','sxmGkG','BNnKte0','DMrRt0e','vhPrq20','Dg90ywXTzw0','ChvZAe5HBwu','BgTpBhe','l1zPzgvVifDPDa','cVcFLldWN4Y5icPtAhv6Aq','B1z1EhC','kKj1zYbszxbVCG','B2n1BwvUDc5ZCa','BNqGvg8Gu2f2zq','yw5VBNLTB3vZcG','BM93yxrLCM1HCG','CM9JAW','zxjJB250zw50lG','vKf1EKm','AhvSDwG','yMfSyw11','z3jVDxaGB3bLBG','EwvLDaRILipILAa','CgfJA25HBwu','CNLitui','ienOyxqGqM90ia','4Psb4P2Via','Cc5Uzxq','weDotxO','ifr5CguGvgHLia','yNv0Dg9UC1jLCW','vgHLieXPC3qGtq','teTMB3C','r3vLC3mGvgHLia','veTlwwy','u0j1Dxa','v1DjAu8','zgLHBL9WzxjUAq','sLDvseq','EgzHCNiTyxbP','seXjz3C','whLRuui','C2HLzxa','BMCGoIOG','vcbquK8G8j+sOokvKokvKokvKa','Bfr2vNO','imQzYO8QiokxIsaQYOdHTiC','4lA24lA44lEk4lA94lEC','4Pwq4Pwq4Pwq4Pwq4Pwq4PwqcUkuG+kvLokvKa','seHlsuG','y3j5cUkuG+kvOa','iezVDw5Kice','su1tqvi','ww91iefYzsbtDa','BNnkwva','ie1LC3nHz2uGBa','igjLBgfUAMe','vwTpweu','rxHPzIbiyxmGqG','DfPpuxq','tvnJBLq','zxnZywDL','uNj2vfm','4Pwq4Pwq4Pwq8j+sOcbbtKLnrq','sg93ia','Bw1HlMLKl2nOyq','ifvZywDLxWO','u2vUDcbuAgLZia','CvPOse0','y2vTzw50','Dcbezwf0Af8','zLvfwKe','zgfYA2DVBgqGwW','uM9VBsbjrdOG','vMjVsuW','AgfZt3DUuhjVCa','CNqGsw50BYbnua','4lEs4lAX4lEkioc2KEc2TUc3KYdGTRBGTR0','DgvY','zxbSEsb0EhrDcG','tNzVvhu','ANnKB20','ALLxz2K','ruL6s28','BxbSzxGGiMfYzq','EhrWCM8UBwuVAq','4lAA4lEs4lA64lAX4lEk4lAXioc2KEc2Toc3JW','Dez3shq','ls0QcGO','u09RrKq','cUkuGIak4PwA4Pwq4Pwq4Pwq4PwqcG','zxH0zw5Kzwruzq','zeDNuMu','r0Xbs2q','DK1OyKy','s2Dxufi','zwzMzwn0ltG2oa','ierjA2eSidCSia','D2vYifrOzsbrDq','CM9Jr3u','cVcFLldWN4Y5icPszxn1Ba','zg93BMXVywrbBG','EhrWCM8UBwuVBW','EMvUEG','Cg5KEui','uMPiru4','sMjlC1O','C2LTyM9Sx3rHCG','DMLYz28','zhjHz29Uz3jVDq','DxrVDei','EvDuywC','z3zgsLO','DM9Py2vJAgfUzW','yMHVC2rPA2e','v2zSA3e','quTpuI1trufsqW','mNWWFdv8m3W0Fa','AwzDcUkuG+kvOa','BMnLcJuUigX5CG','t0PfDe8','lcbIBg9VzcaTia','wxHyDu4','DpcFLiRINA/INA8','AuDAAgK','ywLUAw5NieLYBW','cVcFLldWN4Y5icPeCMfNBW','CMvTB3zLqMfJAW','yMvHDxrPzNvS','thDlDgO','yxbPCY5JB20VDG','zxbOzw1LCMfSia','DwvYEv0k4Psd4PwA4Pwq4Pwq','zu1iuMm','EKvbq2q','4lEa4lEf4lAA4lEs4lAX4lEk4lAXiqPe','CgfZyw5Nyw5FEG','ierPA2eSidCSia','lwnPCMn1AxqTCW','ifbOB3rVifDPDa','zw1PDa','AuLbwuG','y1Dev04','8j2xOEc/KokDPo+4JWOkcVcFM6hVUi/WNzEu8j2xOFcDL6C','y2LWyw50C1vWza','DwHdqKC','sxjZENi','CMvHDguTy2HYAq','zhjHz29UBgLZDa','B3uGv2fUDcbuBW','DdOkcG','CgLZy2vZ','nZaGtw9UDgHZia','zwXKwxa','CwHbtxG','cUkwJokCRUkDRYdWNzMk8j2zRpcDMApWNzMA8j2zPW','A2LZCW','zurLC2nYAxb0Aq','yMfZDgfYzaRILipILAa','rwf5Aey','ywXUtgS','ierptIDuienbuG','zgv2B3rLkIaTia','rxfZvK8','w3f1zxj5xqRILipILAa','uMvKierYywDVBG','sw5dAgf0','wwTVtxe','vgHLieX5CMLJCW','zML0As1HCNqTDa','BYbZDxjYzw5Kzq','zMLUzeLUzgv4','CgXHDgzVCM0','wfPWB1m','C2nKBa','Dg8GCMvWBgLLCW','qwzRl09MzMXPBG','ww91ieHHDMuGtG','Du5ysKK','8j2zQFcDMzVWNzMK8j2zP/cDMAiGoIa','rsbbqK9vvcbusa','vfLWDNG','tKzbqNG','Ehn5Bfq','zgvSBxnNcUkuG+kvMUkvKa','4lEk4lAG4lA74lA64lEs8j+KRsO','mti4A2jWCW','v2HHDcbbCMuGwq','iefSluzHDgLOyq','AgLNAgzPDMuk4Psd','q3zut3y','4lA74lEp4lAT4lEk4Ocn4lA74lEs4lA68j+yJcdGT4tGT5m','ih0PkcK','DhrJ','uePdBhG','y3Poquu','cUkvOokCJ++4JYbbDxrOB3i','y0jXAvu','DwDSEwnOzwnRia','B29JyvG','4P2U4P2UicdWN5oKidq4mha','D1rsvNm','ienHBIa','q05Xzei','BgLUA2DJ','DguGDg9ViokDPo+4JYdINAtVUi8','y3vUDa','EM5OuuG','vNzTshK','BwvSBcbVzIbOyq','yxzLigjLzw4Gza','ls0QcVcFPkaGkLf1zq','CMT1Bxi','ChjLDhr5cUkuG+kvOa','AxnZB3jZ4PYc77Ip','r1KGv0for1KGvW','CM1HCMVWN6wS4P2V4P2V','Dgv4Dc1LzMzLyW','DNfyyvq','r1v4BeO','lwfMigf0zw1WBW','rLLiq2q','B3DLzw4TC2TLBa','wwP3D20','qwXVBMCGv2L0Aa','q1HYvey','swfuCu4','D2TYDuq','q3r2z20','Dxn0ide','yw5K','DhjHy2u','vLnRAvK','icaGcUkuG+kvOa','qufbqufbqufiia','BMvRBW','EgPRqxe','u0vs8j+rQpcFJ7VIGi3WN5k8if1FcGO','vMHby1i','x1SGsu5gtYbDxW','vNLirui','q0GG8j+sOokvKokvKokvKokvKokvLWO','mtuGtw9UDgHZia','vvvvvvuUlI4UlG','A2DPy2q','y3vKzgXL','rfL3ve8','zc1JAhjPC3rTyq','z09uDvm','ANDqww0','uePhuwe','nduGtw9Yzsbeyq','BwLUAw5N','AgfUzhnVBwu','4lAf4lAX4lEz4lEk','u2XPv28','CY9JDxn0B20Vlq','CxvVDgvKcUkuG+kvOa','DxbLELy','yxfmDhi','DLjuBMy','kUkDRUkDRIbwt1rfiokDRW','reXhrMC','ueXPz0C','4lA24lA44lEk4lA94lEp','zxn0Aw9UCYbbyG','ww91CIbszw1HAq','y29MzMvLcUkuG+kvOa','Es90ywDDcUkuG+kvOa','D2LIDq','Dg9gAxHLza','odaUAhrTBa','DuTxCuO','D2HLBG','lM1WmW','zLfcD3i','z2XVBxa','vunLz3a','ywDLiq','CgvYC29UywXPDa','ksPJB3mOmcKNoG','ug5oEue','ys5Tzs8','y2TLBIOGoIa','y3DNDfi','yLDXELu','v0rQtNi','ieHHBMrZB21Lia','s3jVy3G','Au5Sww4','BL9Mzw5Nx3nODq','ALbSAwy','zgjev0y','Dg8GDxnLCNmUia','8j2xPFcDL5tWNzEA8j2xOVcDL6hINzxWN5Mk8j2qHVcDKjtWNzca','4lAV4lEk4lAV4PI577IpkG','AwnLifT0EhrDcG','s1Lfqwe','lM5LDa','ywfHAcb0AguGCW','y0vTEu8','Au1Msxu','qwrUDhi','mc5ODg1S','D2LRAw1LzgLHia','DgLRDg9RyxvKAq','CvHqDKG','wvzlC0i','qMfJAYbpBMXPBG','Axv5yw4','B2TqzNe','AhrTBa','zxmGoIa','B3qGB3DUzxiU','ideGug90Aw9Uia','cLjfrc1euKfhtW','EIdWN46UcGPdB3jYzq','CerAqKS','wxP5Bei','CNKGv2HHDhnHCa','u2vJDg9YidOQia','DgvTCgXHDgvcDq','t0XjEK0','CgLUzW','BgLUA19ZB25N','Du1uq3e','qvbjs2v5CW','mtKXnYbBDhH0xq','uuTlr1m','DgLVBG','DfP1BNK','ywDLifLVDsbxyq','uLPNAgq','4lA64lEp4lAA4lEp4lA74lEt4lAT4lEk4lEa4lA6','yMvYCNK','rwL4yui','zxjMDwWTz3jHzG','A29V','BYKk4Psd4PwG','C2vHCMnO','C2vUze1LzgLH','csaGicaGicaGcG','msbmAw1PDca9ia','EwjprMW','zMLnvKm','AgvHBaRILipILAa','De1oC24','vvrSs28','yML0zq','ANztzuy','zxPmr0m','cIPfBMDSAxnOkG','D2f0ywTFAgfYAq','4lA04lA94lA64lAX4lEk','AgvJAYbBDgfNxq','zc11BMrLCNDHDa','kUc2TUc2VEc2Uoc3Loc2MUc3NFcFMilWN5gnkG','BwuGoIa','Aca6ia','x2n1CNjLBNruDq','y1DPzNm','Df0k4Psd4PwG','vuDzChu','t0zgice','BMLNz2e','CMfSzcOGoIa','yxbWzw5K','DMLKzw9Z','yxrLBxbVpteUma','z2f5y2HLy2SGwW','tMLxthe','r2L0shvIidOGAa','pYbqCMvZCYbuAa','r3Dmveq','4PwricaGicaGiaRILim','As53ywLMDs5WAq','sfrIuem','Effqv2m','ugLJDhvYzq','4lAA4lEC4lEk','uw1psuO','q2fUBM90','BMDhB3u','DMvSEsWGy291Ca','qKftrsdWN5kG4Pwq4Pwq4Pwq4Pwx','CgLSAwG','Dw53yxrJAezPBa','Ag90cUkuG+kvOa','z0HlB00','EM5ryKy','DgG/pWOkrxHHBq','tgjnA2y','y3rPDMuGiq','yxKGqwDHAw4/ia','ieLUzM8','y2f0ywXVzWOkrq','zfDAvMm','4PwAWRVoH9MG4OcI4PEp4PML4P2U4P2Uia','8j+KRsO','ywrV','BhzWrNe','uhDss3i','yMXVB2qGw3r4Da','x1rOzsbpChbVBG','CMnOifrPDgXLia','BwvZC2fNzq','C2vJB25KCW','yxDLC29TzwnOzq','zxPVBMu','Avn3r20','EMPSEuS','ELPZv1q','BwjZwwK','yxKGv2L0AcbuAa','DxborgW','B25SAw5LltKYoq','v2rPB1m','z2v0BxvZAwm','zxnZifrOzsbcDq','A2TRzui','Dg9NAwy','AM1grxm','y2HPBgrFChjVyW','DeT6vxm','AYWGuMvWzw50ia','y2SGAhr0Chm6lW','DeLKENO','kKHPlca','AgfTAw5LBMf3yq','B0fKr08','DgnOlxrLEhqTzq','Aw5HEgW','YOdHTiFHTiuT4BsfYOdHTidjOUg0J8M0','8j+sLpcFKPqQ','BgLTAxq','DhL0swK','Ag9YB3nJB3bLBq','pYbqCMvZC1rOzq','ufjpipcFKQdILzdILzdILzCk4Psd','vwHlrxK','CMf0zq','vgDlq0W','v2fUDcbuBYbqBa','A0jOz0q','z2nSAw5R','mdiYlMH0BwW','mcbnB25LEq','vgLTzsbiyxmGuG','u1bWzhe','EhH4','igLZieXVy2TLza','8j+rQ1LVDxiGtwf0yW','ExrTCdqG','yxbWBhK','wgrfy0C','Du5kCha','D25LCIKk4Psd4PwG','ywTPicyGmIb1BG','z3jVDxbtzxr0Aq','Dxb2B3rLcUkuG+kvOa','lI9SAwiVyMLUyq','zfjKzKy','teTVzMm','4P2VkGOkkLjLyxnV','rvHYDhO','idOG','BMnLBgvK','s3vPCuu','vu9sEM4','zhnVBwu','yxzbENm','zxzMq0S','ChvPC2K','CxvVDgvK','y1rVzsbtzxnZAq','DNbPDfO','q2HLy2SGoIa','CMvHDguTC2nPzq','r1ziBLG','A3bPBMSTBg9NBW','suLPCKW','4Pwq4Pwq4Pwq4Pwq4Pwq4Pwq4Pwq4Pwq4Pwq4PIS','l2rHDgfIyxnLlG','C2z1BgX5ienOyq','BI5QCW','yKXOvvq','u0HbmJu2ieHHCW','BYbUBYbUBYbUBW','yMLUza','CWPODhrWCZOVlW','CMvHDguTyMX1zq','yuzMu3O','vsdWN5ov','zwqGsw4GvgHLia','yvnLrxy','CMvZCYbuAguGqG','Chb0Ea','C2fUia','qLHiC0C','sxL5rK4','BLPuzNa','ExrTCdmG','igLNigPVC2vWAa','C3rYAw5N','zKXLvxO','zgvSDhrJ','r0fcs0S','Eu5ft3i','BMuGoIOG','vgXAEgS','Eu5JANC','BxbSzxGGiMfMzG','BMuTmta1mY5ODa','nZbyvNLItvq','l2fWAs9UAwnRCa','cIaGicaGicaGia','ie93BMvYiezLyq','zu1rDLi','Ag9TzxbHz2u','y0z5why','tM8GuxvLCNKGva','4lEe4lEp4lEd8j+yKIO','lIbKzwXLDgu','y29UDMvYC2f0Aq','DgfSAxDHBMDRzq','BNbT','4lAX4lEs4lAA4lAcioc2IEc2SEc3IUc2SFcFMi8','ie91Df8','u0fPuum','cVcFLldWN4Y5ifb1yMXPCW','4lAA4lEC4lA94lEu4lAA4lEp4lA74lA64lEp','zsbgCM9TiefgsW','uLnUrxC','ywLUl2TVCgvSlG','Dcb0BYbdB252zq','z3vLC3mGCMLKza','zMzLy3qTmta1na','DxnLCI9OyxnPBa','CMuGvgHLiej1zW','C3vPDcba','AMf3ywjHBG','kLDYB25NiefUCW','zhj3vg4','v2jKu2i','r2DOrfe','ifrOzsbszxn1Ba','yxnHBMDHBG','cIaU4OcIWRdIGkiU4OcIWRdIGki','zxjTzw51','lI9SAwiVC2nYyq','BMLZAgvKifnLCW','u2vpshy','z29Vzg1VCM5PBG','Dg9WDhq','A2fYAq','kVcFKjHfBgvWAgfUDa','zw54BwXMB3jTyq','t3PlEvC','zxmSihLVDxiGyG','4P64icPjrca6kIa','DMLKzw9jza','n3WXFdu','CMrst1u','cI0GugvYy2vUDa','yM9UAWRILipILAa','y0z4yKG','v3HhwKu','ie5VDYbzB3uGqW','ze9btLa','D01bq3K','y2HLy2TKzwf0Aa','DuPgzfy','AgvHBa','B3DUzxjUyw1L','4Pwq4Pwq4Pwq8j+sOcbwt0Ldrq','AwDKBdi','v2HHDcbnyw5Nyq','A2fSyv90Aw5HBG','yNjVywrJyxn0','EeLmA1i','q2HHCMfJDgvY','BMvVBMXPz2H0ia','ugzxzNq','tLbYseO','DcbuBYbdB252zq','CMWH','ugXHEsbbz2fPBG','tw9KztOG','u2zpr2y','ugXfBhC','DhjHBNnMB3jTzq','rKjvEKO','C3DREfq','z2XVBxak4Psd4PwG','BMLNz2vY','qxris2y','qMXiv24','yw1VDw50xW','C2XpuK4','D29VzcbBDhH0xq','B3nLBL8ktM93ia','tvjVD3e','A2vSzxrVBI10zq','C2vUDgvUy2u','EK9Jtw8','kLLVDxiGvMvYCW','EhbLt0q','ywXPDMvTC2C','v0vUvue','z1nYzMi','CMfOyxnPyv9Uyq','DhbZoI8VD3D3lG','BIa6ia','t21rrfG','EKfnyw4','DgLRDg9RD20G','cGPqt1DfuKqGqG','CMvJzwLWDfrPBq','cVcFLldWN4Y5icPxAwzLjW','AM9VEcbBCxvLCG','AuTQCuK','AgfUzgHVBgq','v3jJA3u','4Psa4Psa4Psa4Psa4Psa4Psa4Psa4Psa4PsacG','lwfMigfJCNvZAa','B24GoIa','yxiGB3DUzxiScG','B2fKzxiVzMfJzq','C2v0y21K','qMvSB3C','A29SDwTHCMf5yq','qunurviTu0vbuG','CMvHzfrPBwvZDa','ChjVzMvZAw9Uyq','uKniiooaJs0Tls0T','y3mVC2z3l3DHAq','shvUDcbbz2fPBU+4JW','4Pwq4Pwq4Pwq4Pwq4Pwq4Pwq4PwqcUkuG+kvLa','tNjnuvO','CMfTywXHBL9QBW','vgfJAvK','zwjPBMfYEsbBCG','q3DWr0m','icaGicak4Psd4PwG','Cfzuvum','Dw4Gt3v0cKfUCW','EeXZru8','8j+oUfzVAwnLienOyq','CMvHDguTBgLNAa','zfj6qNe','CMvHDguTys10CG','EwfRAxq','DcbYzwzYzxnOAq','rgLZt04','BgvUz3rO','y05qEKG','Dc1NBg93lxnSAq','Bw9QAsTTB2PPxq','BeDWtxu','DgeVCxvYyw4/CW','nJaGtw9UDgHZia','AfjLqNi','BfjhtNi','BhKGDM5DcUkuG+kvOa','zMjzwe4','rwTnugq','r3jVDxaGtgLUAW','uMvWBhKGvgv4Da','EKPTqLG','CeHtBwu','Bg93ia','ugPnshy','4PwxcqRILipILzeGicaGia','zcbjBIbuAguGtq','ndaGtw9Yzsbeyq','ifjHBMrVBsbgzq','BxLZB3vSBwf0zq','yw0QcKrVBID0ia','C2v0zgvZAW','y2HHDgjVDcbVzG','EvvfufK','wwvZ','DcbgB29KkIa6ia','tff5vMi','B3vWigXPBMSSia','y2HHDgjVDhbYzq','lI9eCMfNB25nzq','ywTSAxjPAY5QCW','BgLZDg1ZzWRILipILAa','EKLqAgy','zsbxB3jKipcFJQ4kcG','BgfIBguGrM9YBq','ieDVBgqGpsa1ma','zhDlu3i','z29Vz2XL','zenzuszJB250zq','txHOzwC','C0DOuhi','vMfSB3iPcJqUia','C2vHCMnOBwvUDq','A2f0yxnLBMPH','zgXFBgLUAW','44cmierbvefcqvnf','v0LzuMy','DhvRigXHA2KTBa','r3jVDxaHkL8kcG','CgfJzxmP','ieHHCYbczwvUia','vKrIEwq','mtaWie1VBNrOCW','DwWG4PYu77IpcIPzB3vY','vejtDgm','y2vZC2z1BgX5ia','kVcFKj9gAxnOkIa6ia','BNn3zxi6ica','ignVDYaYcIaXia','cIPjBMrVBMvZAq','BwvNDw1PBG','cVcFLldWN4Y5ier1CMf0Aq','C0rJAgi','zg9JEa','CMvTB3rLsMLK','rejkELi','D2z4AM0','8j+KRFcFPk0Q','seeGsfuGseeSia','EMTnBKW','cIdINRiGkK1LC3nH','qLvnr2K','D2fRDhu','8j+oUfrOyw5RCYbuBW','CgzYCNm','yMfZzty0','sK1vuxe','igzMidu1mJK5mG','DenPvfK','m2rZDg9UzsbBDa','Bgf2ysbBDhH0xq','DwvHAwS','yw5PBwvXDw90zq','4lA44lEC4lAA4lAA4lEk4lAV','ipcFMiuR8j+KLa','qw50AwXPBMSGsq','AxrLzcbKzwzLyq','zNjLzq','yxnLl21HC3rLCG','vxnLifrLEhqSia','oNzZyM1Jpte6zG','v2fPDgLUzYbgBW','BNrMAwX0zxi9Aa','sxfHB0O','u2nYyxrJAgvKia','vNDLtNq','4PwA4Pwq4Pwq4Pwq4Pwq4Pwq4Pwq4Pwq4Pwq4Pwq','q0nvvvvvvvvvvq','B0v3tNO','y2fU','r0XmAvi','lxn0EwXLlw9UBa','vMfIExi','z25Zte0','CYbBDhH0xqRILipILAa','ExrTCdqGw3vYBa','mta0oc5ODg1S','AwnRzxiTDgv4Da','z29UifrLyw0Gpq','uhfbvxC','DvD1reO','CMfUzg9T','ugvYzMvJDcbqBa','s0fsweW','kVcFK4yGwwvHCNmGoG','r3PhC24','DgfMC2LYBwLTCa','DMLLD3m','AgvJAW','yMXVB2rNBgfZia','ipcFKQdILzdILzdILzCk4Psd4Pwrcsa','4lA74lEA4lAT4lA64lAX4lEkioc2H+c2RYa','EezQBLi','lM1Wna','ywvMzuy','ksbgB3iGvgHPCW','CNrZiqOkkG','ieXju1qG44cncGO','ELLUvxG','DNDwrg4','Bfn1wMK','C291CMnL','Cxn0ueS','4lAl4lAA4lEk','ExvyrMK','y3v0zwnOzwnR','BMqUcKvSC2uSia','Cg90Aw9U','u1v1tue','uwnwv0S','icak4Psd4PwG','yxjRBguTDgv4Da','ncbnB3jLifLLyq','y2vPBa','BfrtCNm','DxbKyxrLuhjVzG','Ag9VC2uGqsbtDq','zurzEe8','DcWGrMLUAxnOia','tgT1yxC','4Pwq4Pwq4Pwq4PIScUkuL+kuGEkuGEkDRYa','BgLUzs05mZiUAa','DgLJDgfJDg9Llq','4PEp4PEp4P6+ieHPlca','4Bsp4BsBkG','psDOExbVDcHYzq','y2HLy2T1CgrHDa','zMLSDgvYpxbUzW','4lEk8j+mUcdGT4dGT5lGTPRGT4pGT5lGTQ0G','Aw5LlteWmJCUAa','igL0j3mGBM90ia','rwDoCxK','4lA04lA94lEe4lEk','cIPzB3vYifbVDa','EfrRrvq','vMX6EvC','CgXHEsbBCxvLCG','qKHjC1i','BKDVr00','sg9YB3nJB3bL','DgDSx2XHAgLY','yMXVy2S','C2vUzdvcDxrmBW','CMvHy3q','4Psa4Psa4Psa4Psa4Psa4PsacGO','tYbot1qGr08Gvq','y2XVC2u','oIOGqa','mcbZzwnVBMrZ','zunZCfe','yM9UAW','ifrViezPBMqGqq','sMjwreO','ifbYzxnZvgHLia','EePPrMW','yMfH','y1HKzw4','DxbKyxrLCW','AhvNcUkuG+kvOa','wLzhvwS','rgPZB1C','rujut09ouY1trq','Bg9UDg9UzY5QCW','ifDLyNnPDgxWN5sw','BwfNzw50yq','zgDNs2e','iezPBguGtMfTzq','kUkpUU+4J1LVDxiGtgLT','BeXZB0S','yxbWlMnVBq','8j+mUu15ie93BMvYia','tvDYu24','yMXHBMS','uhzXy0e','iaRILipILAa','zKj1Bhi','yNvhuee','ideYlcaXlcaYma','yxrZoIbWzgySia','C2v0BMfTzsbBDa','r0n4yvO','Bwv0ywXPyYbBDa','lsaQ','cVcFLldWN4Y5icPtB2X1Da','yNv5ifTVChrPBW','whvKr08','zxn6BeG','8j+oUe93BMvYie1LBG','kLrLEhqGtwfRzq','jYbgCM9TifrOzq','tM9WzLO','CIbBDhH0xqRILipILAa','ifrOzsbuAwnuyq','v2zRANa','ys5WChr4','vNfLr2m','cVcFLldWN4Y5icPqBgfUzq','8j+uSpcFJlKGrNvSBcboyq','q2nYyvK','s1fbtwW','BKvdCgO','svj1wMu','cLrPBwuGoIa2ma','tMDOEgu','DKLytgy','rM9YifrOzsbpCa','kGOktMfTzsa6ia','BNDmtM4','CKXuAuG','z2Tewxe','D3nZuNO','ExqGBgLUA10k4Psd','z2DotfG','4P2U4P2U8j+oTuf1zgLV8j+oTEkDRW','EhrnzxnZywDL','rMLSzsbpDMvYia','r1jiB3O','cKLUia','uuvVuLa','qvf1s0W','zxHLyW','rfjbr09ocGPezq','t2yGqMLYDgGGoG','D2fSBhbHCgvYia','t2XgD1e','4lEs4lAV4lEs4lA74lEsioc2I+c2R+c3KEc3GW','y2H1Dg1HCMLRyq','4P2U4P2UicdWN5oKidm2mha','vLLqs0u','ifzVDguGu2vZCW','Cg9tqMK','igfIDs1KyxvKia','C2LMyxr1C2fOyq','C2fUzcbBDhH0xq','kI0Tls0Tls3JGiWG','CMvZB2X2zq','CMvKDwnL','lNbKzG','Dgv4Ddi','Dg9tDhjPBMC','EKzTBKO','y29UDMvYDg1LBG','rMjhvhy','Euf5Aw1RDvLrwq','cVcFLldWN4Y5iezVBgXVDW','nsXHC2v0CMf0zq','nhWWFdf8mNWZ','cGPqBgvHC2uGqW','Bxv0zsbVzMy','CMvHDguTyMvYCG','ipcFKQdILzdILzdILzCjicaGcG','zYbjBIbuAgLZia','yxj0Aw5HBwe','zfbtwhO','z2X1zsbBDhH0xq','zsa/igfHywfHyq','sLDirG','Cc5UzxqVBLbYBW','sfjNzuG','whPVr2e','rM9YiokDRUkDRIbzrvm','yxjYyxK','DgLOyxjYAwrOBW','vgfJtLm','z2v0BxvZAwmGwW','D3Psrgq','A3z4De0','D2vI','seTSsuS','ifDPBIak','qwn0AxzHDgvK','qNnQvei','z3jVDxa','Aw9UkIa6ia','ipcFLldWN4Y5icPtDgf0Dq','zNvSBhKGrM91BG','AxviBvu','w29WDgLVBL0k4Psd','cVcFLldWN4Y5icPcB3jUia','8j+uSpcFJlKGkLLVDxiGtG','s3jbwLG','ufP6sxO','BNKGrgvZAxjLia','DKTiB0q','CxvLCNK','zxiVAwC','lNbUzW','AK51Dw4','BgLZDa','4P2U4P2UicdWN5oKidCYmha','EsbmAw5Riq','CMfUzg9TBwvUDq','CKXUAKO','cVcFLldWN4Y5icPAB2rPyq','DuPWwMK','uLbZAM4','ruDeDuG','D29Yza','Cg9Uzw50ifrVia','zMLSDgvY','BMfNywHHCMKGka','u0Phqu4','sgvSBg8Sia','y2uUANm','neHirG','Dg9NAwyGw3jLCa','BgLWBM90zs5Kzq','cLjLCg9YDcbnzq','tMfTzsa6ia','z2fU','swrgvMK','Esbbz2fPBJ8Gua','Efvhsgy','mZy0mu1kvwDotW','DgeVCgrMl2LXCG','Cgv0Dw5Nx2HHCG','ExPHwwq','uMnpthC','4P64icPjrca6kIba','vgLTzsbpDxqkqq','zhb6vKC','CYbuAguGqNv0Da','Bs9QDxOTyw1Tyq','yxbWlM5LDa','y29JB2TUyw1Hia','y2f0ywXVzW','kVcFJQuGr2vUCMuGoG','qgfKAxDHANnOAq','rhjHA29Y','lIba','t25YzLq','cVcFLldWN4Y5iejPBYbvCG','lI9SAwiVBwf0Aa','ALjPyLO','BgfUANv0','kUc2TUc3Koc2U+c3KIdGTRhGTRJGT4OG','u2PWvwO','kfnVBwuGqw5ZDW','C2LMyxrFA2fYyq','cVcFLldWN4Y5ifvWBg9Hza','qLLwAgu','vgvZDgLUzYbtCa','8j+yGVcFKPq','cLDHBNqGvg8Gua','zvvWD2m','BM8GBM8GBM8GBG','ifn0yxj0zwqGsa','zMzLy3qTodKWlG','qMrAr3m','BgLUAY9PBwfNzq','ywLSywjSzsa6ia','qMjLBNm','AKThCuW','C3qGqxmGjW','u1LsteG','CxvVDgvZyw5PBq','ugLLCMnLzcbIEq','zMfTAwX5mtaW','y29MzMu','rLPWs2S','y291CgXLcUkuG+kvOa','BwfNzv0k4Psd4PwG','u3vJy2vZCYeGwq','DxLWB3rPB24GxW','ywXPDMu','DgvYBwfYA/cFPAZINA/INA8','CfLKyvm','r3fZueG','CvnXwLG','zxbSEs90ywDDcG','ifDPDgGGtxLZzq','CgvZyw4','u3vYywGQicdJGi0k','icaGicaGicak4Psd','z0DmEha','sfvzEK0','igDVAM8GC2HPyG','CMvHzezPBgvtEq','Bxborvq','zMzLy3qTotmXlG','4Pwq4Pwq4Pwq4Pwq4PIScUkuL+kuGEkuGEkDRW','CNbN','4P2U4P2UicaG8j+oTKf1zgK','r3jVDxdINAtVUi8','txnewLy','DM90zsOGlsbuBW','BMLUzYbnB25LEq','C2vUzgvK','zfvrBwy','zxjZ8j+QKa','DxrLidOG','r3vOzfK','rM9YifrOAxmGva','q3DjCNa','uKXZEwG','iejPCNrOidOQia','C2vUzgvY','v1bbu1m','msaTidmZnJCkAq','C2XVDW','44cm4PMLievmu0eGseu','rvbMue0','BeLAr00','DgfSoIa','cGPdB3jYzwn0ia','Bfbptxi','B3bmz2m','EfnfBLq','qLDAz1a','Bu5NDfq','yxj0Aw1PBxbPia','rKn1s3y','turpD0u','Bg9JA2vK','z2f5y2HLy2S','4lEd4lEr4lA4ioc3Goc3KUc2P+c2UcdGTPq','4lEa4lEA4lA44lEk4lEd4lEs','DuzQuu8','Axb0Aw9UidOG','AhvZyNu','D2fAwe0','DvzfBhK','lcbqCMvZCYbuAa','cIaGica','B3H2BfO','CMvHDguTD29Uza','Avfet2O','kGOkkL9ODhrWCW','reqVtu0VwvLzwq','s2jeDNq','CgLJDhvYzq','A2vSB21WB2S','mJiSidi4cGPoBW','D29Vza','tevbuIbdsefuia','vw5tCuq','AgfWChKk4Psd4PwG','q29YCMvJDcbbBG','s3rPuLG','Dg5LCIbGyga','EuT4tNe','lEg0HCQa4BsaYAlHTi/jTc3kMEg0JW','uevsvNC','CgvUEwfUEwK','4lEe4lA94lEC','vMLMtfK','cIPzB3vYifjLBq','D2v0B24','wLryvfC','B29owKy','AuLOCgu','A2vYifDPDgGGqW','4QU3ieXju1qGtuvo','ndGWCa','uLPQBwO','sNriEwm','ig11C2XPBsaX','A0Hdz28','ief2ywLSywjSzq','qvbgugq','iefbqufbqufbsa','v21TCvC','cGRWN5sW8j+mUsbuAxrSzq','AhvTDgHH','oE+4J+kdOW','z2LTywDLifTXDq','vfLwuNy','v2fKDuS','4lEkioc2OUc2SEc3MEc2VEc3IIdGT4dGTR0','wNrwzum','AgfSBg93zw4','AgLYlcb0ywH1BG','4P2U4P2U8j+uIKrVy3vTzw4','y3rLCIa6kIa','rhHZD0m','rwDHs0m','r3LYrMe','A2vJB2nVA2fUxW','ueXbwuLorW','Aw9UlcbuCNKGqG','Agffv3G','vMvore8','C25PChbLDa','AgfKAxn0EhH4','C211zWRILipILAa','CNvPDc1QDwLJzq','CMvLiezPCMuPcG','zMvTywXL','qK10CK4','CM9HzgnHC3qGva','4lA04lA64lEs4lA6','yMfZDgfYza','ienOyxqGrMvHDa','ifrOzsbwB3rLia','y2HHDhm','ywDLidOG','t00G8j+sOokvKokvKokvKokvKokvLWO','qvbjCW','Aw4GCM9VDhm','zgf0yq','AcbjCM9UkhmPia','r3PzvNK','z3fPzeG','zfDIq29dyJnuyq','cVcFLldWN4Y5icPoyxr1CG','DxjSqNv0Dg9U','ifjWzYbgzwf0Dq','BfnjBee','DMPhD2S','zNjLzw1LBq','ieLZiez1BgW','CMvHDguTm2qTza','rM9YifDOyxqGqW','zeP4zgu','zw5LCMDPx3bVCW','u0Lor0Xfx1nfta','BM9T','CMzJELe','zw1HAwW','C3rHDhvZyM90','shLSwNK','EuDpAwC','zhjVEg0','Eu9xDxm','igjSywnRihjVDG','vxLSu1q','CLnmAe4','l2fWAs9KB3DUBa','D2v0B25FAMf3yq','CMvWB3j0','D2TLEt1WAdyXyq','DwjuCxG','kGOky2HLy2SGEq','w3rLEhrDcUkuG+kvMUkvKa','lIbPzYaOsw5ZDa','BMqTC3vTBwvYlq','yM9HCMq','cL9dufuGq29Yzq','lNbUzZ9IywnRzW','C2vYAwfSAxPLtq','DuLVyuC','Bxv0zsbBB24VBW','u3rPBgWGvw5MAq','CgfRyxLH','CMf0zsbBDgv4Da','CgLSAwGY','z19Tzw5NAxrHCG','CNLkvu8','rNrfuwq','4lAh4lAT4lEk4lAT4lAV','C2vUzfjLywrszq','uMvWBhKGtwvZCW','D2LUAWRILipILAa','CgXHEq','r29Vza','rxHHBxbSzsa6ia','B3Lcuwm','B25LEq','qw5PBwu','B0TYChG','C2LVBNm','u2P2s2u','C2XHCa','Agvxr2e','mtaGtw9UDgHZia','u0L2rM4','4BsfimQzYO8QiokxIsaQYOa','twfuB00','yxrPzG','Dg1LBNuGAw1HzW','cVcFLldWN4Y5iev4Dca6ia','rfjXB0m','DxnLCMXPBwL0cG','zhzNsg4','rgfTywDLza','4Pwq4Pwq4Pwq4Pwq8j+sOcbst0jp','DgvYAMf3ywi','4Pwq4Pwq4Pwq8j+sOcbhuK9vua','yw1H','Fhf1ywXPDhLDcG','mJuUAhrTBa','yML0zqRILipILAa','zKjwzxC','BIbtDwnJzxnZzG','sM1lsui','CMvHDguTAw1WCG','C3rYyxDIzxjYEq','uMDID1K','wK5Rt0K','ygbGww91iefYzq','Aw9UpwvTB2PPxW','rurAsM4','uK5OA0G','yNLMqMm','zxnZAxzLlwDSAq','kI0Tls0TlEoaJcbn','twvHzg93','q29rtuW','ifn0AwXSieLUia','cLbHCgvY8j+tHaPtyW','ue1yyNK','DgH1BwjUywLS','rM5HBuO','Ahr0Chm6lY9ZAq','Dg9mB3DLCKnHCW','ioc2HEc2SEc3MVcFMilWN6stkG','C2vRDg9Y','u2vUzcbjBwfNzq','u29UzZ8GoIaQ','u3rHCNq','yxDVBW','Dhn4ExC','D0vXrhi','vuXfCvG','sgfirK4','C2vUzeLTywDL','wKH6B0C','zgvSzxrLcUkuG+kvOa','ntaWmJeXody4na','vhj5ifrVieHLyq','AePluhe','uuvJqLi','cGRILi/ILihINA8GkG','BgfNDq','4lEq4lEa4lEt4lA44lANioc2IEc2QsdGTOC','BgvHDMuk4Psd4PwA4Pwq4Pwq','s1Hvsfm','zhHjuwS','4O+Pu2TPCokpQq','qLjhuLe','ieHvieHbieHvia','icRkGog0H+g0Hs3HTixkGog0GmMI','lNDLyNa','ChjPBwjVBL9HCG','msbnB3jLifLLyq','AYbBDgfNxqRILipILAa','tevRBw8','Ce9lCNG','A3rPtMq','DhmTB2zMAwnLza','DgfYB3qGkgLUza','AxzLifn0yxikcG','CLbhC0C','suPLz04','zs0Xmdu1lMH0Bq','rKT5EvC','iM1PBNrLCNbVBa','4lA24lA94lA44lEu','rKHmAxy','t0feipcFKQdILzdILzdILzCk4Psd','y2nLChqVuMvQzq','CNqGvg8GqxvKAq','8j2xLpcDL6hWNzEN8j2xNcdWNzEM8j2xO/cDL5tWNzEGia','CfbVyxm','AcbsywjIAxqOCW','ExDsCuW','DhnWDLm','yMfSyw5Uyq','BwfW','tgrksK8','rMD1t04','4lAN4lEkienSzwfYioc2MG','DwL0cGPqBgvHCW','A2vRyxLHyw4','ANzNrLu','ltG4mY5ODg1S','iMf0zw1WBZ0WlG','8j+oUerVD25SB2fKia','CM9JAYbBDhH0xq','EerAzM8','q291CgXLiezLBq','oI8VBNbTANmUyW','Ag9UD1u','vNvTCfK','mti6B3zLCMXHCa','AwTjrwi','rejvAvK','uMvZCgvJDgL2zq','4Pwq4Pwq4Pwq4Pwq8j+sOcbsqu5e','yMf0Dv9RzwjLCG','zw1LCMfSza','CxiGkfnJyw4Guq','BMCVyMfPBgv5CW','BNnIqKO','CMvKqNjPz2H0','cUkuL+kuGEkuGEkDRYa','teTVzgG','y2HLy2T2B3rL','ie1LBNuGrxjYBW','cUkvOpcFJP7VUi8GuMvZB2X1','44cmicPmrufervjc','BNn3zxi6ia','BwvZC2fNzxmGBG','zsDZie5HBwuSia','cVcFLldWN4Y5ifjLywrTzq','CwHMEgS','AKn3zw4','nE+4J+kdOW','ifnLBgyGvxnHzW','wuzwD3y','BM9TcUkuG+kvOa','D2LUAW','ugfYDg5LCMbGya','zKu1wfnJCvHVoq','EhrWCM8UBwuVDa','wMzHAfG','CM9UkIa6ia','Aw9UcGOkWQK','z3vLC3mGCgLJDa','cIPtAg9YDcOGoG','BM9VyG','CgXHEwvYtW','yMXHy2S','4lAl4lAV4lEr4lEd4lAX4lAA4lEkioc2MUc3KG','AengC24','Bw9Tzw50lxrPBq','EgvVBJeZ','ExrTCdnIDg4','zxrLy3rLzcbZzq','BMDTBc5KB2n1Bq','zYbrDwvZDgLVBG','y2HHBgS','As5Hz2LMEs5PBW','ww91ierVBID0ia','8j2xP+c/Ka','lI4U8j+yGVcFKy0Q','B3bLBG','kJ8kvgLTzsa6ia','AundC2G','CgHHBNqOCYKQia','cUkTLtOGqa','yMfPDgzVB2q','zw4Gww91CIbcBa','4PIvifjHBMrVBsbd','wvftzM8','C3bLzwr0zxn0cG','Egn1CKi','zgLZyxbWzwfYAq','Ew1nDw4','yxr1CMfSlwXLyq','igrVBwjHidikia','AhvN','vgHLCMuGqxjLia','BI1PBMrVBMvZAq','qNb4BMS','A2LJAW','ue9fD08','AcbwzxjZzsaYia','kVcFPltWN4+7ienYzwf0B3i','cGRIL4/IL4/INR4G4PIS8j2xPFcDL5JWNzEx','z0HYzeq','cUc2Ooc3Koc2P+c3IIbdBgvH','CxvPy2TszxbSEq','rNbutMG','AvnJC2G','Aw1N','4lEDioc2R+c3KUc2Noc2P+c2UcbHDq','zcDZie5HBwuGoG','DxnLCI9IDxj1yq','BhKGyxvKxqRILipILAa','ntuGtw9Yzsbeyq','C2v4EqRILipILAa','mtaW','rg1tBLm','ugveCeK','rLfUt1G','tfnLBgK','tvfVEvG','yM9SzcOGAgfZAa','yNnKqKu','vxjSiefIB3zLcG','8j+uSpcFJlKGkLDLzgrPBG','4P6H77IptMv4DokEOE+4JW','nZC5mtm0nfnis0LAEG','DfHLv0u','DMLKzw9nzxnZyq','BgvZyMLHBG','y2X0twe','cKrVBID0ihrHzW','EwjNv2i','B25SAw5LlteWmW','AxmUANbN','BcbvC2LUzYbqBW','yxjJAgL2zqO0lG','BwfNBwe','AfDPuLa','tKPABvC','DhDPDhrLCMf1za','D2LJA2vYifT0Ea','z2v0uxvVDgvKtW','ifT1CMXDcUkuG+kvMUkvKa','AMrVuwK','CMjOqxO','A1vOze8','zcbqyxj0BMvYla','rfznsxy','CMfUzgK','rKLTDLe','BNqGoIOG','zxHJzxb0Aw9U','zLO2ms8YmdiYma','qM5qwLC','CMvZDa','q291CgXLidOQia','cVcFLldWN4Y5icPhzw5Kzq','yMvHDxrPzNvScG','C2L0Aw9U','B2zcwuu','BwvUDgLVBMvKsG','CvLLwM0','A2fSAw1HDa','z2v0tw9UDgG','AwjIlMnVl0n3zG','twvZC2fNzsbzBW','zw5Jzq','s1Pnr2W','zwqUChK','sxzbteG','Aw1Hz2vUB2jNEa','rvfdDKm','wu1Uv2S','jYboB3qGtgLZDa','AhvIlMnVBs9WCG','ywXIDw0','yNKGysb3AwXKia','DxvHuKC','AxjLD29YAY1ZCa','CMv6zwTPicHPBG','kqRILipILAa','A0TRzgC','AxqQidOG','v2rXEKu','z3vLC3mGyMXHBG','AgLSzsbODw50Aq','cVcFKQSGkK1HzguGoG','BMrZlaPzB3uGCW','Bs92Awv3x3zPza','rhDJrhO','s0jMv2e','DgLRDg9R','EhrWCM8UBwuVBa','Bg9Vzc10zxH0lq','rNvUie1LBNu','DxnLCI9HBgf0xW','DgfNywXS','reHQDuy','4P2U4P2U8j+BKvn0B3dWN5Ur4P2V4P2V','EwjlDxC','8j+uSpcFJlKGkKjVCM4GoG','ifrVDgfSoIa','nxW0Fdf8mhWZFa','yMfSAsaOAw5KBW','Bxr5Cgu','r1DfCuK','AwXLieXLz2vUza','tMHdDwm','CM1HCMT4','kUc2VEc2TUc2SEc3IUc2SEc3J+c3Goc3LIa','AcbdAgLJA2vUka','ww91j3jLifrPCG','lGPeB24NDcbMBW','y2vPChq','nsbnB3jLifLLyq','uKDVq3O','tfnOAu4','cKfUC3DLCIa6ia','rfnWu0i','C3vPDf8','vxLwzge','y2fUzhK','iokyRfjfroc8KKrsquC','zfrmqMG','sgXfuLe','thDLqMC','DgH1BMrLCIbBDa','EhngD3y','cVcFLldWN4Y5iejPBYa6ia','yw50yq','D2f0ywTFA2vSyq','kVcFJQtGTQ/GT4tGT4pGTPRGT4OG4lA44lA9','zxbSEsbHDwrDcG','ywzRuMvHC29U','Exr2B2LJzsa','BI5JB20VC2HPBW','uKrPCK8','kLjLBwfPBMLUzW','ie1VBMv5kIa6ia','y3vUDaRILipILAa','lMPZ','C09LBw8','kVcFKiDsywjIAxqQia','DgLVBIa','v2HHDcbeBYbzBW','whnvsu8','A2v5CW','ywDYyw0PcJCUia','zKHMwLC','D25LCIKk4Psd4PwA4Pwq4Pwq','ufzTs1G','zMPfz0G','sY5qCMfIAgfZAa','ienOyxqHxWOkkG','8j+KRFcFJlLiAsWkssbHBq','z3j1Cg1LBNu','iokDPo+4JYbZBYbbqufb','8j+sQYaQtMfTzsa6kG','cVcFLldWN4Y5ieTLExDVCG','lgLTksPZAw4Oma','AwnL','rwrPDcbhCM91Ca','4Pwq4Pwq4Pwq4Pwq4Pwq4Pwq4PIScUkuL+kuGq','yxjPcJeGlsa3ma','zaRILipILAa','C2uGtwfRzsbtDq','yKPqzMu','Awzgtwq','Cuf3wLe','s2PxB2u','mIbnB3jLifLLyq','pYKk4Psd4PwG','8j+uSpcFJlKGqa','igH0DhbZoI8VDq','ierHDgfIyxnLia','DgLTzxn0yw1W','C3rHCNq','4lA2ioc2UUc3Koc3Goc3LIdGT4dGT5lGTRa','BgLZDgnTzaRILipILAa','C2v0zxHPzGRILipILAa','CI9QB294','iefJDgL2zq','r1bhEem','lI9ZCMmVCMvTBW','A2LUza','4lAC4lEu4lAP4lEk4lAX4lA64lEs4lAN4lEk8j+yJa','yxrL','t25SAw5LieXPCW','DhLSzs10zxH0lq','4lAA4lEq4lA44lEk4lA74lEs','ExvUuuS','CKvtEvu','8j+KQvrOyw5RCYb0BW','cVcFKQSGkKnOyxqGoG','CMvHDguTys1ZAW','C2fUza','ANvKDwW','DwDOievTzxjHBa','ig1LBMfUDgfUzW','swT4Aey','yNvSBhK','uM9rseG','uxfRqvO','BwrNv2e','D2vIDg9VBIbBCq','AKLKz2K','igLZig15igzHyW','Dg9TCdmGw3jLCa','vgHPBMSGssbxAq','r3vwruS','yKvsuNq','CMvWBhKGyxvKxq','CfDIwwO','shrSv2y','yw5PBwv4EhG','zgLZy292zxj5ia','cIPfBwvYywXKkG','DY9YzwqTzhjHzW','ihLVDsbMDwnRia','oI8VD3D3lNbVCG','CgvRzxjQywfUia','A3fKBxy','Ag9UzxK','EwLqwfO','vxbKyxrLia','Ahr0Chm6lY9PCW','yNK6iokxIsaQYOdHTiFHTiu','q2fUj3qGugXHEq','kIbODhrWCZOVlW','AxmGoIOG','ue9fwNq','xYOkcVcFPyC','y2HLy2T2B3rLkG','qKHQvgW','C3vJy2vZCW','AgfYAq','zLjpAui','rMjmwu4','BYbizwfSifvZAq','cGOkcGOkcGRGTQdGT5a','mJeZ','zMDhANy','Aw5LlteWmZyUAa','BxvZAwmkmI4GCa','cGRILztINA7INk4GvvbwtW','u2vUDcbcEsbbia','twXyq24','DK54BNe','psaXmdaWmdaGtq','A2vSDwfY','zgvTB24Gw3r4Da','BhKGC3rPy2TDcG','ugXLyxnLienSAq','CwnkDuW','y2HHDa','lcb4Bhn4','y3bXsKW','D1ftsLC','BMfUy2uGrgLYzq','DNDowNO','zMX2s2O','CffxtKu','EM9JEve','wwvjBfi','C3bdBei','cUkvOpcFK4iGrMLSzsbt','Bvj2rMy','Du5brNm','EhrsteC','A2vSAw5JAq','uMf0zsa6ia','idCSidCSidiWma','y0nqotnPBu5fyW','xWOkqNKGjW','Cgf0Aw5N','Aw9U','zxbOzw1LCMfS','AxzLifnPzguGoG','CMvTB3zLlMjN','CMfUzgLIywf6','z29Vz2XLlwL0','EgHnzhK','ANv6lwfTBweTyq','yMnKC3O','Aw5LltKWms5ODa','yKnmuNG','sNvUz2XL','4P2U4P2U8j+oTKf1zgLV8j+oTUkDRW','4Pwq4Pwq4Pwq8j+sOcbeqvrbqG','4Psa4Psa4Psa4Psa4Psa4Psa4Psa4Psa4Psa4Psa','EhrDcUkuG+kvOa','vgv4Da','Ahr0Chm6lY9PlG','AgfYAxnHBMDHCG','DeH2u1C','CgXHEwvYwa','rePWwhC','ifnLC3nPB24Sia','ienVBNzLCNqGrG','C2HPzNq','zNj1AxrQDwLJzq','ierVD25SB2fKia','uLjJu2K','r2vlu0i','rgvHy3rPDMf0zq','vgHHq3y','tvfKB2q','shbiEeW','BgLYAwS','AwrSzq','y3v0zwnOzwnRia','zgvLChnLysbBDa','z29UvM9Py2uV','zgHsvfG','4OcIpIbNBg93','zMLSzu5HBwu','zNjWsKO','whnlrKO','zMj4','ywDLxWO','zxbSEsb2AwrDcG','BhKGrgvSzxrLza','ruvfvKC','4lEe4lEp4lA64lEs','z2v0BxnNia','rvreEKS','ALzNBfa','AgfYAxnPywWGka','y2HHDcbBB3b0Aq','iez1BIbgzwf0Dq','C3bHCMTSzwnOCG','4lEa4lEz4lATlaRGTPtGTRyG4lEa4lEs','A2LSBaRILipILAa','4lEp4lAT4lEk4Ocn4lA74lEs4lA64lAA4lEkioc3Goc3MG','ieXPBwL0ia','B2XcyuO','BM9TB3jOB2TP','sNnUrg0','4P6H77IptMv4DcbjBwfN','AgfYAw5Hz2e','B3CSiefZAYbzBW','BMfOyq','z2v0rgf0zq','yNnKAW','ic0GndmZmqPUyq','4P2U4P2Uie5piokDR+kDRW','D0vxExm','otaGtw9Yzsbeyq','jYWG','EhrWCM8UBwuVmW','mI9Mzwf0DxjLza','DxrPBa','u2vUDgvUy2u','AgLKzxrHzYbBDa','q21dAuy','cIPzB3vYiejHAq','qLvAs1a','DNDAmY8YmdiYma','ExfAyMm','q3zLEvi','zvH0uKW','q2XYsfO','CNj5lwnOCMLZDa','zfH2Bhu','kVcFPBtGT4tGT5BGTRRGT5lWN5IbkG','BM9TB3jOB2TPia','AhrlALC','C3bLzwq','BgLTAxrHD2fS','A1HbqwO','sw9dseK','EM9UzuLK','Dg9bsLq','BuL6qwG','4Psd4Pwu4Pwq4Pwq4Pwq4Pwq8j+sOcbbtG','Aw5Nie9UieDVBW','y3jLyxrVCG','zejYvem','yMLZy3vPDcbBDa','uhjLDMLVDxnSEq','4Pwq4Pwq4Pwq4Pwq8j+sOcbgvu4G','cVcFLldWN4Y5ie1VzgLMAq','y3rPB24GoIOG','DLzhy1m','ygbGu3vJy2vZCW','iezLyxr1CMvZ','s3jir0u','Euvcsuu','ENDMEuG','B3CGq291BgqGsq','zw50CMLLCW','z2fTyMfY','yMTrz08','DgfODw5FBgfOAq','zg9UyxrLcUkuG+kvOa','l2fWAs9ZDgfSAW','vgHPCYbUB3rLia','DxnLCNm','B2X1DgLVBIa6ia','cVcFLldWN4Y5ieXPA2uGoG','A3fvtLO','EhrWCM8UBwuVCG','igjHAxrMB29K','B3DUzxjUB21LCG','y29JB2TWyxnHBG','ihbHy2TUyw1LFa','CMvHDguTBg9NBW','AxrSzq','C1rZDfa','rMXbq3O','CgvYAgL0Dw5Nyq','Aw5LltKZnc5ODa','rvrMDKi','zxj5xqRILipILAa','vertAw8','BuLgBuu','BMDLzcb0BWOk8j+uSa','8j+oUfrfwfqTDg8Tsq','yMnHBgW','yxLLCG','vw1YrMO','ChjPBwjVBL9Oyq','4lAC4lEu4lA44lEk4lAX4lA64lEs4lAN4lEk4P2K77Ip','ww91ieH1ApcFLldWN4Y5','yM9KEsbxAg8GuW','ExvwB1G','lI4UlI4UlIa','Def3BNa','ms4GAw1Hz2ukmG','Bwf0AcbTB2rL','zhjHz29UlMPWzW','sfDQzMO','s09izfK','EurZwKq','C3rYAw5NAwz5','BwfSzq','CNbkyNe','u2vUzc9szxbSEq','BgLLDMuGAw4GBq','s055ugG','y2TLzcaH','DxjHAd0','Aw5LltKZos5ODa','DhjHBNnSyxrPBW','A0PSzem','DgvZDa','Eg1guLG','A3nUEKK','Cu1QtNK','C2nYAxb0','C2fNzq','zsa6kIa','ihnTzwXSEsbPia','t2jLzgLLBNq','zxiGoIOG','4Pwq4PIScUkuL+kuGEkuGEkDRYa','yuP3A2u','twf4Aw11BsaXma','rw50zxiGvgHLia','t04Giq','nYWGmJaWnsWGtG','Ag9JB2XHDguTyW','zgLZywjSzq','Aw5MBWRILipILAa','AKL4zvK','Aw9Uie9Mifn1CG','Bwf0AcbBBw9Kzq','nJK0mtq0mte4mq','DNHKAMG','zhnYt0e','wuTVDvi','yM90','yxjJAgL2zq','ygbGugfYDg5LCG','vgLJvgfJvg9L8j+oRG','y2SGw3rHz10k4Psd','zg8PcJmUihDVCG','cVcFLldWN4Y5icPjBMzVia','CgrM','B3iGvgHPCYbqDq','lMPZB24','Ahr0Chm6lY90zq','z2LMv2G','C2v0z3jVDxbWCa','q0jTBfq','xWPuywCGvgHLia','yqOkuMvKierYyq','ugXLyxnLifnLBa','sg91CIa6kIa','ieLZifbSyxLPBG','mdi4lMH0BwW','z3vTBMLNAhq','icaGicaGicaGia','rerxvwW','C2v0z2nUyw1L','Cwf5Chu','CgfnDfC','pt4GEYbYzxr1CG','D2f0zxjJB2XVCG','C21VB3rO','BNn3zxiG8j+oIqOkvW','vxDv','AuLbwuO','yxj0Aw1PBxbP','scdWN5kG4Pwq4Pwq4PwxcUkuG+kvKqK','DhvYBG','qufyBhK','tgz4wKC','BgHJz04','BvjSyNO','uMvWBhKGsw1HzW','zw9WB2i','ExrZ','Bwf0y2G','z2uGvgHPCYbtDa','4lA94lEk4lA9ioc2Noc3J+c2Noc3MEc2SFcFMji','zwfYCMfWzsbBCG','BwDHBLG','B24kierVBNqGrG','Bhrou1u','tgHrzMm','qw5ZD2vYipcFJOKkcG','u09MzxO','twnrzw4','lwzPBhrLCJPHia','uKrhD24','twvTB3j5ifvZyq','l3zPzw4UANnVBG','ugXXyNO','ic8G','z29Szc10zxH0lq','BhKGq2XVC2vKia','kgfZEw5JicGPia','AuXVA28','rgL6ENKGqwG','ieLZBgfTAwmGrG','igf1zf0k4Psd4PwG','rg9Uzse','EMvYpwy9ntq6DW','zwXLBwvUx2TLyG','psJIGkiPpt0','Afjxwwi','4lA64lAN4lANioc2KEc2SsWG4lAA4lEu','iefUC3DLCIa','Dw5IBg9JAYbBDq','CMvZ8j+QKa','zMzLy3qTB25SAq','mdu2lMH0BwW','xqRILipILAa','DMjmwNG','rfvfv2m','AgfYAv9Zyw5Nyq','s0ncsgW','Dg9WAwjHyxO','CMfTywXHBMPVza','zgjPBMfYEsbBCG','zMLZAa','D0zUr3i','BgLZDg9UBgLUzq','y01JAuC','8j2xL+c8KVcDL5FWNzEL8j2xLpcDL5RWNzEI8j2xOs3WNzEv','rfHXvNm','reH1DuO','4lEd4lEs4lA74lEp4lAV','DcbeBYbzB3uGvW','BwLTzxr5Cgu','ig1SidiXndG4nq','yxbPA2v5','yvrXwMq','AMjvALm','Cgf0cUkuG+kvOa','cVcFLldWN4Y5ifzPzgvVia','BwvUDgLVBNm','ANPoDhm','EhrWCM8UBwuVmq','4lAC4lEu4lAP4lEk4lAX4lA64lEs4lAN4lEk8j+mMG','BKTnzw4','ufjKr0y','yMzPEeW','BfvYyLK','yxLHBq','r3jVDxaGsxmGsq','vMPIAuW','ExrOEKi','BwLU','l3bVC3qVz3vZlq','yNvUz2fFA2vIzq','lxrLEhqTzwzMzq','CgX5l3rHz10k4Psd','swngrfq','ifzPzgvVl0f1za','D1jzyxq','AgjUCw0','sw52ywXPzcbmAq','z2fUzhu','B29ZzsbtDwL0la','ywLUieeGuMvWBa','zMzPy2LLBNqGrG','uK9cvNO','ChjVzMLSzq','Aha/DMLLD2TLEq','CgvUy2LSifT0Ea','DxnLCMXPBwL0','CMvWB3j0ifTIDq','zLP6qNe','yvfQDfa','A2fYywT0zxjPCW','CIbHBMqGywrTAq','A2L0y2HLBL92nq','Aw1Hz2uVyw1HEG','BgLICMe','8j+uSpcFJlKGkKrYzwfTia','tLvtC3C','A21pyKW','BM90x2fUBM91BG','twvUDq','C3PQr2e','C3bVB2T5ifT0Ea','s0H0D3O','ie1VCMu','CwzMEfG','y2HLy2S','y29KicHdywXSia','sufhB0W','ChjLC2vUy2vZ','DFcFJRJWN5or','BMDPBMCGrMvHDa','yMHVC2rR','z29Yyq','BuDiBei','DgLRDg9Rza','cVcFLldWN4Y5icPmAwzLBa','zca9ideWmdaWma','zcbcEtOGkLjLza','DgLTzxm','4OcIWRdIGkiU4OcIWRdIGkiU4OcIWRa','txfvD3e','ifDPDgGGq2fWDa','cVcFLldWN4Y5icPtzwn0BW','tuPiuuO','CgfZyw5Nyw4Gka','uwzKzhe','A2vrDMm','zxmGsw4GvgHPCW','8j+oIqOkv2fUDcbuBW','BMvVBMrLDMLSia','svLstNi','B3jL','EhrWCM8UBwuVCW','A0HlDfm','B3vYifbYzxzPBW','BhPxueO','Aw5N','zMfZDcbBCMvWBa','C3rPy2TLCG','C2vnzxnZywDL','m++4J+kdOW','EMDQwxu','ipcFK6uGiokDR+kDRW','nYXHC2v0CMf0zq','rfDjwKq','CKTgzxq','iefNywLUiefUza','tvLvyxK','DhvRihrHAhvU','BMfUy2uGoIOG','ywDYyw5Jzsa','vhjpA1G','D2vIDg9UC2vHCG','DMLZAxqGB3vYia','yMXwB0q','D2fPzNu','whr0EMK','x19WCM90B19F','EsWku3vPDcbdyq','vNjiA2m','4Pwq4PwqcUkuL+kuGEkDRYaQ','y2fWCMLJB3jU','nsbnB3jLierHEq','EMT1DKy','suPssue','D0vIz00','4Psd4PwricaGcUkuG+kvOa','BgLZDfjLC3bVBG','yxvKAw8','iezVCJ8/','AwTHBG','lwzPBhrLCL9JBW','BwfUy2LUz19PAW','zMLJDgLVBG','qLrKrve','zg93BMXVywrTzq','DfLJCLu','CMv2zxjZzsbBCG','4lEe4lEs4lA0ioc3Goc2U+c2MUc3IIdGT4q','A1Ddr1i','qu9ZB0G','BMfTzq','D2XvswW','zgL0Ac8','vMHvtgK','u3vPDcbiyxmGqG','CI90AwT0B2S','CKTQrem','v1bWsuS','wgXnEfu','qM9fB2e','iefUB255Bw91CW','zvn1yMPLy3q','q29TBwfUzcbczq','ie9MifDOAwnOia','y3viCLG','nhWWFdf8m3WY','teXIDKy','yM9SB2nOB2rH','BNqGvg8GugXHEq','C21PBgu','CYa6kGO','DePRreK','Dsbxyw50ifrVia','vvD5DNC','ifn0yxK','Aw5ZCgvJDa','D1PRquy','CxjVCw8','kIdINA4k4PsdcUkuG+kvLokvKokvKa','yNnyquS','4Pwq4Pwq4Pwq4PwqcUkuG+kvLokvKokvKokvKa','4lAXlcdGTRFGTRRGT4/GTRhGTPOG4lA7','4lEz8j+yKVcFKPqQ','AgzguMG','DgLJDgfJDg9L','Bw9Kzt1HB2jTyW','EKvNv1O','vgL0BguGoIa','DKfmCMe','CYa6cG','Bwf4','4P6H77Ip4P6H77IptMv4DcbjBwe','rvHrzNi','zNvUBwvUDq','CMv0DxjUicHMDq','BhKGqwrKzwqGtq','C3vPDhb2Ca','cVcFLldWN4Y5ienYzwf0zq','zsbsAwrKBguG8j+oRG','D2fSBhbHCgvY','CfvxALu','vMPYrM0','A2rIuNC','8j+AMvn0yxj08j+AMq','terTr00','D2LSBcbIzsbRAq','BL90ywH1BG','D2DYDNq','cGPbCNrPC3qGoG','ywnRzwqTy29VBa','4Psx4Psb4Psb4P2Via','cVcFLldWN4Y5icPzB3vYia','s0HIAfa','yw1LidOQia','rePcwxm','ihL0BxaZl3L0Bq','rgvuwMC','zgvSy21KcUkuG+kvOa','EhrWCM8UBwuVyG','DxbFyxq','ieXPBwL0ieHHCW','8j+sOokvKokvKokvLWRILipILzek4Psd4PwG','qxDHywi','y2f0y2G','wfnQAfy','AwyGEw91CIbIBW','y2HHDgLUzM8k4Psd','vgHLierHEsbbzG','4PEjimQa4Bsh4BsflEg0HCQa4BsaYAi','DwX0CYPF','cVcFLldWN4Y5icPiDxnIyq','uLzozhG','zw5HyMXL','swzowgq','BwfNBweGw3r4Da','yNaGvg8GvMLKzq','yuPVD2K','yw50AwXPBMSGBW','A1PRsfa','tgzcv0S','Eu1hs2e','BYbqzxjTAxnZAq','sMn5vgC','swDxEw4','vwP6yxa','sg93iefYzsbzBW','ifrLEhqGv2L0Aa','yMXVD2PVyG','cLvZzxjUyw1Lia','DxjYzw5KzxiQia','twLgEey','DgX2Afq','CxiUANbN','cUkvOpcFQQmGrxH0idOG','uKf2s00','A3vPC21HDgG','C2vUzdvcDxrjBq','veXrAva','ExrTCdm','BMfUzq','zMvJDc1Nzw5LCG','yMfKDxDH','q0HbvfrjtKC','zLjAuwi','AK16wvO','iokyRpcDL6xWNzEy8j2xL+c8KVcDL5FWNzEL8j2xLpcDL5O','zfPntee','BwfYA1jLywq','Ahr0Chm6lY9Yyq','YBqTYPNHTi/HTjSQ','uMnQs3u','cUkvOpcFL5lVUi8GrgvZy3jP','ieDYB3vWieXPBG','z29Vzg5Pz2H0','s3zHyMG','C291BMrJBg91za','CgfKrw5K','ENbhELa','ELHJv3u','Aw9UigLZidyUnq','C29HBa','seftBvy','rg93BMXVywqGrG','vLbrAeG','mZuGtw9Yzsbeyq','Bg93','yxnHBa','tejeEhi','vhzzwgu','z2fTzq','vfLjEge','ChvZAa','yxLZlteWmduUAa','ig5WBsbZy3jHCa','r0LnquDfifnfqq','ieLZie5VDcbtDq','BMXPBMuTBxvSDa','C3r1yMjSzqRILipILAa','44cmieHfuKuG8j+oIEoaJqO','tLn0BLK','tLz1sgG','CM91BMq9','BwzfA0G','CMvQzwTP','yMLVz3jHCgH5','Dw5SAw5Ru3LUyW','DMLKzw8VBxa0','AgfUzhnVBwuk4Psd','lI9SAwiVDgLJDa','ifDOyxqG','z3jHzMzPDgLIAq','cVcFLldWN4Y5icPoDw1Izq','mE+4J+kdOW','4lEd4lEs4lAX4lEkioc3Goc3KUc2Soc3J+c2Sq','DI9Yyw5KB20','cIPzB3vYieXPBq','uwXmqNi','ig1Lic4UlIa','ihjHyMjPDcaYcG','Aw4Gt2yGvgHLia','y291CgXL','suTbBhK','ie9Wzw5PBMCGva','DY5NAxrODwj1CW','A0TYBhG','BMuTote0lMH0Bq','ls1OzwXW','vxbhzLm','kUc2Uoc2GIdGTQ/GTRhGT4RGTRhGT5NGTQ0','tva0cUkvOpcFPjmGkUg0Mog0JW','Be9Uu3K','y29WEu5gB3j3yq','r3jVDxaGtwvUDq','ChjLBwL1Bq','4QAa4QAa4QAa4QAa4QAa4QAa4QAacG','mJaWnqOktM90zq','yM90BMfTzq','ywDoAKm','BwWUChjLC2vUDa','ltK0ms5ODg1S','u1bHBMm','BwfZyxn1yNvYia','cUkuG+kvKqRILipILAa','C2DPzG','z3jVDxaGy2XVCW','BNrHz2uGoIOG','ztKWowqX','lI9SAwiVEtjTyq','zxDcBM4','CMfPBMjVDYbBDa','mdaGtw9UzxK','D1HHru8','zMf0ifTYzxbSEq','cIPhB2XKkIa6ia','zgvYlcb0ywH1BG','BM5LBc92AwrLBW','AwLJAha','rfrVDxO','y2fUifT0zxH0xq','ChjVBw90zsbBCG','zgvUz2fUigfSyq','zwrPDgLUzM8GwW','igHLig1HCNjPzq','zwPUuNi','cUkuGGRILiiGcUkvMUkvKokvKokvKa','C2TLBgv0B24','AgvYB2T1yxbWlG','y2fUzhKGw3r4Da','qxLjzvu','B3rL8j+oPokDR+kDRW','zwvUifn1y2nLCW','kGPuAw1LidOGnG','8j+mMIO','yNv0Dg9UCW','uxzRyK8','n0zxsezgqq','DgfUz2DHBa','C3DLCIdWN46jcGPxyq','yxrH','nYWGmJaWnq','vKuG','AuzWEu4','q29TCgXLDguGwq','zZ0Yma','nNWY','Bgf5iefNywLUpW','sML1rwi','v0XbDfy','q2HHBgXLBMDLpW','CwXAuNO','u2jhtge','z3vLC3mGBhLYAq','r2vjsfy','BfDIAhe','nJikBwfSAwSkmq','yNv0Dg9Uswq','wLHQuKi','DxnLCI9KyxjHAa','yMfZCYbBCMvWBa','kUc2Uoc2GIdGTQ/GTRhGT4RGTRhGT5hWN5Is','DKzZA0K','uePywgm','zw9UlwXPz2H0lq','8j2xMVcDL6JWNzEu8j2xPFcDL5FWN5UH77IpcGOkcG','qMPIA3K','DguGvgHPCYbtDa','CKfUAMq','BePOsNG','ygbGsgKG','ieTPy2SGu29Tzq','4Psd4Pwu4Pwq4Pwq4Pwq4Pwq8j+sOcbpvW','u1PUywm','DMXdwxG','DxnLCK5HBwu','tvaZcUkvOpcFJP7VUi8GuMvZ','t3bLBG','wvfLyNm','4PwxcUkvOeHPia','4Pwq4Pwq4Pwq8j+sOcbgvu4G8j+sOa','z2H5r0m','BhKGAw1NxqRILipILAa','Bwf0Aa','txnxAhq','yw0GrNjVBsa','uLbrquG','AgfOifzLCNnLia','y2jAzfi','DuLkwhC','DgHnzw50Aw9UCW','y2HHDe1VzgLMEq','y2zpBha','AcbhB2XKkhmPia','zwuTB25SAw5Llq','if9TAwXPC2vJBW','CMvHDguTm2qTBG','Dc1VBMXPBMuToa','icaGicaGia','mqOkt3b0Aw9UCW','Dg94AwmGw3r4Da','sK1fAwO','BhLbqva','8j+oRIbnyxrOiff1Aq','C21LBwv4','sgKSia','l2fWAs8','ANvnvNy','kVcFKjftAgvLCcOGoG','ufznqwy','C3rPy2TTzw1LEa','ELzZzva','zxj1BNr1BMDHBG','z2v0','ntaWmcbTB25LEq','r2DMChy','wKv5tgC','otaGtw9UDgHZia','v3nSDfy','BgfAtgu','zKDUC20','whfcwLq','uLDJy0i','vgHLiej1DhrVBG','D2nQuha','ww91ieHHDMuGqW','CMfTywXHBL9JAq','sdPTBtPZCW','ALnKr3y','AxiG','DMPqAwu','v29Yza','ifjLz2LZDgvYzq','BgzoAhi','Ev0k4Psd4PwG','lMPWzW','4lAT4lEu4lA6lGRGTPhGT4pGT5OG4lAX','ENLUzMK','C2LmsfC','z2xINQhVUi/INQhVUi8','BKXPr1K','r3DqCgW','8j+uSpcFJlKGvgL0BguGoG','ifLLyxiUcGPFuq','4PwG8j+KKYaQ4Bsy4Bsp4BsH4BshYOdHTiC','4lEp4lAXioc3G+c2S+c3Hoc3JYdGTPRGT5i','ic0Gmtu5naPTDq','B3rOzxjZ','BMnLlwzPy3rPBW','BI9Wzgy','4lA94lA44lEu8j+yIWPODhrWCW','CIbqyxj0BMvY','DgLVBNm','z1DyBeK','whDowva','icPuzxH0kG','v2HHDcbjCYbuAa','vNzzuge','r29KtKq','zxi9lJe6mtO2na','DfLUqMe','DwWGrgf5idOQia','sw52ywXPza','idOk','zgvLCcbBCMvWBa','rfv1uge','CuHtDvO','4lAh4lEe4lEq4lA74lEz4lAXlcdGTRtGT5K','CNbNBwvUDq','revsipcFKQdILzdILzdILzCk4Psd','Es1Jyw5LlxrLEa','8j+mNEkDPo+4JW','cLLVDsbdyw1Lia','ChjVzMLSzv9Oza','txbqsLC','Bca6ia','AxjLlxrLEhqTzq','AgvHzgvYvhLWzq','DgL0Bgu','vejUBwu','AgfSBg93zw4GwW','qMHgAgi','suLiAhi','C2nYyxbLlxbYAq','tvnYEwO','zLLjC2K','yw4Gu2vUzcbnzq','cVcFLldWN4Y5icPcDxnPBG','DxjLCW','DhKGoIa','yM54BgC','vxzqvhG','oGOXlIbMzIaOrG','CgfSyq','cVcFLldWN4Y5ienHChrPBW','s3PetKC','ihbIihjPAw80nG','ufryAeO','BMfJDgL2zsaH','uxrUs3O','rxbtC1u','lZ9Uyw1Lpq','vsdIQ7G','kIba','tLLQEKq','C2vSBcbBB3b0Aq','Dw5Kiq','ie1LBNu','4lA64lEz4lAX4lEkioc2REc3MEc2Uoc3KYa','D215tu0','ie5LEhvZ','u2rvAfG','CenOEgS','sgHPyxq','BM9TzxjOB2TP','twHqCNG','vgfNiefSBcdINA/INA8','tNr2BNa','ExrKB2m','CgvYzM9YBwfUyW','A3PrDu0','uMfUzg9Tia','AgfSBgvUz2LUzW','z0ntsu4','y2HHDgjVDcbBBW','yw50AwXPBMS','qvjdscdJGi0Tls0T','sertBwK','yxrPB25ZisbmBW','BgLUzs0XmduWlG','cUkwJokMGokMGokMGokMGokMGokMGokMGokMGa','ifnLyxjJAgLUzW','As5Tzw1Lz2vUlG','y0DyBei','Dg92BIbBCMvWBa','vwfdrhO','zxPPthG','su9sufG','l2LTywDPlMPZBW','rwXKCum','qMLYDgGGoIOG','DhH0xqRILipILAa','qKztBva','zw50ieHHCYbdAa','kI0Tls0T44cmiers','ucaHcGOkcGOkcG','z1b4DKO','YAlHTi/jTc3kMEg0J+g0MYOk4Pwr','tNjTr28','ChjLDhr5','BgxINAtVUi/WN5kw8j+rGa','4lEa4lEA4lEd4lEs','BLfUz0u','ALHpy1u','CvL0Efm','cGOkcUkDPo+4J+kyRpcDL6xWNzEy8j2xL+c8KG','idySideYlcaYma','ANLVEMi','CM1PBMf0zsbzBW','zsboyw1Lie9Mia','sNH3teW','kIa6ia','yKnYEg4','4PEjicRkGog0H+g0Hs3HTixkGog0Ga','qw50AwXPBMSGqq','m2rJAhjPC3rTyq','ELrNBeW','8j+oUerHDgfIyxnLia','q2XVC2u','B25ZEue','B0zkB1i','ue51su8','DgLRDg9RBxaZia','zxiGsgfOywHHAa','rMnUAhy','4Pwq4Pwq4Pwq8j+sOcbst0jpia','BNqMy29TCg9Uzq','cVcFLldWN4Y5icPdB3vWBa','ifjLBwfPBMLUzW','twzssMW','y29Tl2LHBxjPEG','cUkvOpcFKyaGvMLLD2vZ','D2L5vwK','wvjyAee','4PwGipcFK6CG','r3LTthe','qNjVlcbczwnHDq','cLnfuKLfuW','AwjIlMnVl0rzmq','sfzWAfm','ieHVCM9Zy29Wzq','CMvHza','quvhA0O','CMfUzg9Tyw5PBq','vLDdte0','CM4GDgHPCYiPka','zMzDcUkuG+kvOa','DKr6Che','Dvf5v2e','DgvIywTHBG','z0LKCK8','uLqG8j+sOokvKokvKokvLWKk4Psd','B29KieLZida','Ag90','C2XHCaRILipILAa','Dvb3C0S','v2XYAKq','vxnLifnVBwvVBG','yM9VAW','BgvZyMLHBMnOzq','z2vTAw5P','4PwrcsaGicaGicaG','zNjVBq','yw50pYa/iev4yq','rfHOwuO','twX4DgK','zwjzwgy','EhvNzhq','ww91CIbeywLSEq','Dg9HDwq','Aw5MBW','8j2xMVcDL6lWNzEHlFcDL5xWNzEI8j2xP+c/KaOk','lsOkcG','mdGkzgfYAw1PcG','AxnSyw1Py21LBG','BNvwD2G','ndaYqMLStNjR','Bw9oDK8','DMuMy29SBgvJDa','r2fTzsbpDMvY','cGOOifeUuYa','C2nPzMK','AgLZifDHEsaJyG','ifn0AwXSifzVDa','mdeWidiYntm','mtaWjq','8j+uSpcFJlKGkLjLC3vSDa','ugz4vve','zK9sB2u','AgvYigXVBca','vwTsvq','AKP6u1K','v3rWq0y','qw4Gqw5VBNLTBW','vgHPCYbtB25NpW','vhDvEwK','C3rHDhvZ','AfDAwxK','nZiWCa','u3vYCMvUzgvYiq','u3H6DKC','AxqSifn1AxqGqW','DcOksw5MBZOGkG','zw5KtgLTAxq','zgLZCgXHEvrLEa','cVcFLldWN4Y5iej1C3nPBG','8j+xVWPqyxbLCVcFK4qkuW','u2vJB25KCW','sgf2zsbfBM91zW','t1v3Eum','v1nAEu0','C2vUzej1DhrVBG','zgvSDhr0cUkuG+kvOa','AvfZB0m','u2j6v0q','A2LJAYbBCMvWBa','ihDPBgWGAsbNzq','wNPKuxK','yNbUt2e','DKP6t0K','CeLov0q','AgfYCNLWB3r0zq','uvf3vLq','zcOGoIa','yvLkzfu','y293','B3LArLK','nI9szwqTrhjHzW','zg9JEcWGChb0Ea','u2nMAK8','DxjLCYa6kIa','ANLWDM0','y29SB3iTy2fSBa','r2viwgW','DxnLCG','zNvSBf9Uyw1L','rfvPtfa','r0Hhwu4','8j+uSpcFJlKGkG','q2HVB3nL','AKnTr3i','u3vJy2vZC2z1Ba','4Pwq4Pwq4PwqcUkuG+kvLokvKokvKokvKokvKa','yM9OthC','C2XPy2u','ih4GsgvYigHHAq','C3nPB24GoIOG','qKLeuLO','CgLUDgvYzxn0','q2DTD1O','A2vYAMe','ugPXthq','nU+4J+kdOW','CwfPq3e','zM9Yz2v0ihrVia','qxDosNu','lcbzB3uGv2LSBa','Bwf0CML4','txLKz2C','vhfXAfy','t2Dvr0e','ywTLlxrLEhqTzq','uhjLC3mGvgHLia','oIOG','Dxb2B3rLkIaTia','mZm2otG','AguGqNv0Dg9Uia','kUc2H+c2UUc3KIdGTRJGT5OG4lAf4lA0','zgvS','CgvRzxjQywfUxW','sYdJGi0kcLLVDsbO','lI9ZDg9YywDLlW','Cw9rs20','AhvIlMnVBs92Aq','Dvf6A00','EK5vnMn2y3j3Da','tNrqAui','yxjVBwfFA2vIzq','CMqGyNK6iokxIsaQ','CgfYC2u','v2fJqui','zw1VAMLTAxG','B0fqD0m','z1H1C2O','A2fTCML5yq','ihnLy29Uzhm','C2HVCNq','wwzYC0O','DcbjCYbuAguGsq','Aw52zw50B3j5cG','ELHIsva','BgXVD2LUzYbrDq','yw5NlMPWzW','u2TjBKu','rhr2CKS','yNv0Dg9Uvgv4Da','Aw5LlteWmdeUAa','BwfUz2e','CxHOy1a','Chvdvg0','AgvSzwG','yxj0Av9Ryxj0Dq','u3b2tgS','yw5UB3qGqMuGvq','ifrVifr5CguGqq','CM9Rzw4Tz2XHCW','ieLMifLVDsbqBa','s1bcq00','iezPC2GGpsaXnq','C01psM8','4Pwq8j+sOcbdt05wrvju','nJa1lteWnduWnq','wwzNufq','sZv4ms8YmdiYma','cLrVierVD25SBW','kUc2H+c2UUc3KIdGTOFGTRRGT5iG4lA4','ifrOzsbbDwrPBW','BgvZoIa','DxnLCI9TB25HEq','wuHLDeu','qufbqufbqufbqq','kUc2Uoc3Noc2MUc3Noc3IVcFJjOQ','BM90AwnLicHbza','Ew15vfm','DhDPDhrLCNG','DgLRDg9RBxaZEa','BMCGug90Aw9UCW','CLnTtwS','yNvSBhKk4Psd4PwG','cKL0j3mGyMvLBG','BMfTyq','y3mVC2z3lW','yLr1qLK','t1jyDxG','DcbPCYbHigLUDa','qNvUs3i','A055CuG','C2HPBM9IDq','DxbSB0i','mZC5odjkDxDLveu','BLvxEue','BgLTAxr1C2vYcG','yKn4CMi','CgvYC2vUDgfZzq','yMXHy2TWAw5Ria','ie1VBMv5','khmPifvZywDLia','BI10zxH0lwvMzG','tfzqrvu','Dwfjr20','uhPlr1y','D3fjC1e','qNjVywrJyxn0ia','mU+4J+kdOW','y3H5CK8','Axn0','D2vYifrOzsbgBW','t3jrB1q','weHnwLK','s1DTBNy','sKDMtLy','A2fOyw4','wMnfz0e','C0HPAeW','B2HIywXP','BeHUzMm','ChnLCNq','tM8GuxvLCNKGAq','8j+oUefUB255Bw91CW','vNHQAKy','Dgv4DhbYB21LBG','q3fnuKW','Bhbpvfu','y3rVCIGICMv0Dq','C3r5Bgv0zxH0','CMfTywXHBM5HCW','zxiTDgv4Dc1LzG','ywrKBxnN','DejuAvC','tefXr3u','id09pqPHBMqGyq','C0HytfG','zMvcvgS','EhrWCM8UBwuVzG','C2v0z2nWCa','q09TvLu','yxjPzxm','DuXszM8','DY9MDw5Nyw1LCW','4lEpioc2R+c3Koc2Uoc3KUc2UIdGTRRGT5q','Dc1MCMvLlw9UBa','ExHswfG','khmPkIa6ia','AMzvExG','quHQrva','AguGr3jVDxa','zgniA0O','zwrPDgLUzM8GBW','EwDgBui','rwjtyK8','kI0TlEoaJcbdsefs','DuLpAfa','Dw5TDxrLcJmUia','C2nOzwr1Bgu','yMnNCM91Ca','EKvQDgu','CNPdzeW','z2v0BxnNcUkuG+kvOa','BNrH','oduGtw9UDgHZia','qw1pD2C','D2HHDcbBDgv4Da','ieLZia','y015zuO','C2vSzG','8j2xLpcDL5RWNzEI8j2xOs3WNzEv8j2xOVcDL6FGV5ak','ELDiBhi','zwXVDYbuBYbuzq','Bw1sz1e','t2yGrhv0EsKknq','B3bOzsa6ia','yw0GBwvTyMvYCW','CgLUzgW','wK5HthC','iefYzsbzB3uGta','EvPmrgy','tLH4tgi','BIa9idi1mdaGtq','u0vKsLu','ChbJB3vWBgu','yxrLpsDTAv9TBW','4BsH4BshYOdHTiFHTiuGYPNkJYOG','CNbqzxu','z3rJC0K','ie5VifjLyxnVBG','cVcFLldWN4Y5icPeyxrLia','zKXivvq','mdyW','CgXLoGO','q2fUj3q','AcbtB21LB25Lia','v3DZr0u','B250ywLUifrOzq','CKXeB0u','BgvZyMK','vgflr08','C2nTAee','ifT0EhrDcUkuG+kvOa','vxnLCIDZieLUDG','cVcFLldWN4Y5icPtDxn0zq','zLj3wLa','y2f0yxrHBG','cLjLC3bVBNnLia','sKD3A2G','r2rUEgG','BvjVAg8','kUc2KEc2SEc3IUc2SEc3MEc2Toc3JYdGTRy','DgfMC2LYx21PBq','yxrPB24','D2rRuMG','C2v0C3vIAMvJDa','zsbVDxqGAw4Gyq','cGPxyw50ifrVia','tMvxvgy','CNmGrg9Uj3qGvW','zwvWlxnLys1Tzq','BNbTicHODhrWCW','y2XLyxi','C3f1AxjYzwWGwW','nJaGtw9Yzsbeyq','EfHmvKW','uNvMru4','ic4UihLVDsbIzq','cVcFLldWN4Y5icPxAgvUia','yw50AxnWyw0k4Psd','DgH1r08','r2zQzMG','zMLUza','4lAh4lAT4lEk4lAT4lEz4lA64lEs','ie15ierW','ENPJCM8','8j+mUsbqywnRBMfTzq','tM5rCeK','cVcFLldWN4Y5ifbYB2zLCW','B05br2C','Cgf0AwvUDa','C3vIAMvJDa','yxvKAw8VBxa0','yNjVA2vUz2XHCW','zw1VAMLTAxGGwW','ze15B2y','C2LMyxrFDxnHAa','ufPkD1O','cLbpv0vsrcbcwq','zcbgB3iGu3vYzq','yNjoDum','veXMwhm','zxn0Aw9UcGO','ALDfCvq','C2LI','zwf0DxjLCYe','qM90AcbqBgf5zq','ueHpve8','ywqGtwvKAweSia','q01OAeu','C2zivwm','vevQC1i','DMDfqNO','q2fLy1G','v3reCuu','BwfPBM1LBNu','vLrxEwW','ExrHDwrPBW','yMfSBge','zgvLCa','EKrTDLO','v3bWEgu','4P2U4P2U8j+oPfzVAwnLie4','AgLJAcbjCYbbDG','txv0zwqGsw4Gva','DgLRDg9RD214','A2uGw3r4Df0k4Psd','AenNCKS','Dw50Aw5NieLUia','BMCGB3iGCMvZDa','yxqUD2HHDhnHCa','Ahjewum','y2SGt25Lie9Mia','oI8VD2eUBwuV','zsboyw1LidOQia','twHuBvu','thr4wLm','nYWGmJaWnsWGmG','D2LIDqRILipILAa','AKnHC1u','yMLVx3vYBa','B3v0Chv0rMLSzq','zw5KC1DPDgG','ieLUierHDgfIyq','BwvZC2fNzxm','zMzLy3rZlw9UBa','qw90Bge','8j+sOokvKokvKokvKokvKokvLWRILipILzek','zhjVChDHDgvY','kGOk','4lA94lANioc2UUc3KEc2Uoc3MEc2SEc3IIa','zMjKBhG','y2HLy2T2B3rLcG','idCGnYaYmda1','B2n1BwvUDc5WCG','CIbpzIbozxb0Dq','zxn0yw1W','zxjZidOG','w3rHz10k4Psd4PwG','z29Sza','vhfICwe','AwHMC0q','4Pwq4Pwq4Pwq8j+sOcbet1Dota','DhjHD2jLCNj5lq','4lA44lEk4lA34lEp4lAR4lEk4lAP4lA64lEs4lAX','iokDR+kDRWOQ','AcbfBwvYywXKka','rvbmr2m','y0vQweG','B2zM','A2v5','BM8GBM8GiseGsq','tsdWN5kG4Pwq4Pwq4PwxcUkuG+kvKqK','AgXtq1e','8j+uSpcFJlKGkKfUywX5CW','uMLKzgXL','DwDSEwnOzwnR','B24Gvg8Gq2HHBG','wgD5t0u','tLzktey','mYbxAxrOienHCa','qMDrDeO','lteWmteUAhrTBa','qNfyC20','cGOkcGOkcGRGTONGT4q','DgLRDg9RBM93Bq','Exr2AwrLBW','DKndzxi','ywHFCMvQzwTP','veTuAve','qwj2tLC','AgLYyw4','DgDjEg8','tfjzruG','y2uTy29Szc10zq','DgfNywXSifT0zq','zKTfzwG','tLrLDgO','BNrLCI1OB2XPza','C3rHDgu','yunRCuS','nZaZlta5mZCXnG','Dg90ywW','cVcFLldWN4Y5ierLDgfPBa','DMr1v2u','4Pwq4Pwq4Pwq4Pwq4Pwq4Pwq4Pwq4Pwq4PwqcG','cVcFLldWN4Y5ifvYBca6ia','wvD4vfm','vxjSkIa6ia','yw5LDc5JB20','iefUz2THiezPzW','EM9KAwfRicHPBG','B24GrM9YifzVDa','y2HYAxn0BwfZia','BNPwBwG','ltG4nc5ODg1S','cGRWN5k7ieLUzM8GuW','8j+oUez1BIbnzw51','sgHxvu0','4lA04lEC4lAX4lEk4lAX4lA64lEp','thLYAwnZ','Aw1Hz2uVDhjVCa','sumG8j+sOokvKokvKokvLWRILipILze','ExrHDwrPBYa','4QU3iefmsvzfiokRUa','y3b1CW','sLLirxm','nJuGtw9UDgHZia','vLn1DNy','vNbNtM8','ywHTywqkmsaTia','AgfYAwjHAwSGka','ienYzwrPDcbpzG','AwXLugLJDhvYzq','ssbeB24NDcblBG','CI9TDxnPy2fSBa','qxDRCw0','y0H2tMS','DNjiuKu','q3juDvC','4lA04lA94lAA4lEC','AejzuNO','cJ8/icPfBgvTzq','yMHVC2rPD2fSyq','B0P5qKi','zxnZywDLieLUia','Aw9UxqRILipILAa','idq4mha','C2fNzsbmAxn0ia','uhvKtNm','rMLUzcbbifbHCG','Aw5KBYKk4Psd4PwG','AM9VEa','Cg90zw5ZAv9Rzq','igDVAM8','weTfELu','CMPnEwu','sgrzyui','vwP2vve','D25LCGOkugXLyq','4lEa4lEp4PIG77Ip8j+rU/cFKBSQ','CMLUz3rVBMu','zsa6ia','wxnmtge','DgLVBIa6ia','y1PjyNO','qKvutgi','BI9VzMzDcUkuG+kvOa','EvrbBwG','r2TnD2O','tfnbChu','A0rJz2C','Chm9mtiWjYi','yw5VBNLTB3vZ','ioc3Goc3MI4','cVcFLldWN4Y5icPeyxKGqW','C2fPcJeGlsa1nG','z2P3seq','u2jtz0O','q0zcuhC','B3DUzxi','vurlD3G','EeT2rKK','8j+uSpcFJlKGkKH1C2jHBG','CdqGq29TBwfUza','CgfSyxLHBG','tw9Yzq','4P2V4P2VcIO','yNnPDgxWN6QqcUkAVEkAVVcFPy4','se1iuLa','8j+zGVcFLkuT4PIS8j2xPFcDL5JWNzEx4lYs8j2xL/cDL6u','zs1MCMvLlteWmq','AMPgCKu','kKXVy2f0Aw9UkG','Bhj4Cue','BMvYza','cUkuG+kvOa','Aw52zw50B3jP','BgvZyMLJAgvJAW','uMLTy1G','y0Pwvem','yxrYAxGTC3r5Ba','yxvKAw8VBxbLzW','Dxv5D2y','zgfUy2uk4Psd4PwG','AuT2v0W','xYPtvuLuifb2ua','rsbsrufmsvrzla','4BshYOdHTiFHTiuGYPNkJYOG4PEj','nZuGtw9Yzsbeyq','C3rHCNqk4Psd4PwG','qwXSugfYDgLJAq','Axn0CMK','EKfRCuu','t1rytw4','CwHntvC','ifrOzsbcB3qGiq','lM00yq','wLfzCxq','kUc2Uoc3Noc2MUc3Noc3IIdGTQNGT5ZGT4O','C2vSzwn0zwrjza','iezPCNn0ierHEq','ie9Mie1LBNn0CG','sKnJDhO','mI4GBwWGke1VyG','zsbHzNrLCIbZzq','CMfUC2fJDgLVBG','4lAX4lAA4lAX4lEkioc3Hoc3KUc2P+c3KUc2UG','yMXVy2SGw3vZzq','BxLsEem','cUkwJokCRUkDRYdWNzMo8j2zPFcDMzRWNzMA8j2zMq','lMH0BwW','Denzrxi','y29TBwfUza','rfblBKi','l2rVD25SB2fKzq','zMfSC2u','4lEe4lEu4lAT4lEk4lAT4lEC4lEk','ksC6Aw1HzZ0NAa','C2vUzfrLEhq','uw9PtLa','rLzbqK4','pty1mtaWiG','Ag9YBNKk4Psd4PwG','BhP1q3y','DgfYB3q','4OcIpIbNBgL0y2Gk','rfvgEuS','Aw5LidOQia','qw50AwXPBMSGtq','CMfTywXQB2rVAa','uNrRCKG','cVcFLldWN4Y5icPqzxjZBW','yxrVCI1VBMXPBG','wvH0Bgi','r1zMyw0','cGOkcGPODhrWCW','CgLUDgvYzxn0ia','y3jLyxrLza','kcGOlISPkYKRkq','y3qTmtaXnY5ODa','BLLKtvy','C3vHBwK','z3HiA0m','wfzJsgO','8j2qKFcDKipGV5ak8j+sPVcFKQBWN5kM8j+sPVcFKQBWN5kM','uMfSELu','zwXSihrOzsbMCG','zw8UCgHWp3zPzq','nJuGtw9Yzsbeyq','cGPuExbLicPZDq','A2fYywT0zxiGka','u3bLzwqG','ifbHCNrUzxjGya','8j+uSpcFJlKGkKrHEsbpzG','sw1Hz2vgAwXL','vgHLie1LC3nHzW','YPNHTi/HTjSQcUkvKqRILAdWN6E4ia','yuTXyMC','rw50zxjLzcbuzq','BYbbBM9UEw1VDq','uMfUzg9Tie1LBG','CI9PBNn0yxn0BW','swLrrMO','mZaGtw9UDgHZia','BhvLlxrLEhqTzq','CLLYt00','A0DjqKO','u3nkv1q','4l+qcVcFKQBWN5kM8j+sPVcFKQBWN5kM8j+sPVcFKQBWN5kM','CNPfAMu','ww91vhvIzsa6ia','CGRWN5Iltvi6iokyRpcDLlVWNzs4','ywXPDMuGkerVzq','D2fUz3K','4lA44lEeioc2U+c3KsdGTQ/GT4/GTQNGT5i','zM9YBwf0','B/cFJRyGicdINA/INA8','Aw1Hz2uVDgfTyG','lIbWyIaOCg9PBG','qMTfAgq','rejirLy','uMPttu8','Agf0id8G','AgfSB28','YAlHTi/jTc3kMEg0J+g0MYO','r0vHENy','uNbNie1LBNu','quDeD3m','rwrrCgW','BhjjCxK','D1rxu2G','D2vIDg9VBG','cUkuGokuGokuGokuGokuGokuGokuGokuGokuGa','Bxv0zq','v2LMzsa6kIa','yxv0B2jPBW','ideGmGOkvgHLBG','YOdHTiFHTiuGYPNkJYOG4PEjia','y2f1C2uGww91ia','B25DcUkuG+kvMUkvKokvKokvKokvKa','mI5ODg1S','zxj0Eq','cGRILztINA7INk4Gwuvtia','EMH5rvK','A0DWww8','ztDJcMH0DhbZoG','CNKGoIa','uunlAvi','CKXOrem','ruLeEvm','Bg9gsuW','y2LYy3vPDcbBDa','tgLTAxqG','yxf1yxjPDxm','z1n2Bxi','DM54tKm','DcbgCM9ToIOGDW','yw50id0GmtuWma','BMHosLm','zc1YywLUyM93lq','swLdq0e','ie5VDcbjBIbbBG','qwDLidOQia','sgXrEgO','v0fXrvG','tgLTAxqGuMvZzq','twjeqvO','zgv0zwn0tgLUAW','BMXPBMuTmtaYmW','CMfTywXJAw50yq','ChrPB24GoIa','kVcFKirdB3CQidOG','cVcFLldWN4Y5icPfBgvTzq','A3niCNC','ierPzg4NDcbdAa','igDVBgqGmGOGmq','4Pwq4Pwq4Pwq8j+sOcbit1jpuW','zsbcDxr0B24GqG','zwn0CY1VBMXPBG','qxLly0G','mtKXnW','zwjPBMfYEq','yxjHyG','sxnSBwLJie1LBG','vhvYBIa','4P2U4P2UifLfuYdINA/INA8','DgGGq2fWDgLVBG','zgvTB24','ywLUAw5NieDVBa','4Pwq4Pwq4Pwq4Pwq8j+sOcbtrufs','thr6y0e','igfHywfHywGG4P2K77Ip','vM9Py2uGq2HHBG','DwnsywG','yxjHAf9UywDHxW','reXIDvq','Dhf0BW','cUkvOpcFK40Gq2HHBM5L','ifb1yMXPyYbvCW','rNPzvfG','CNHHCuS','Dxb0Aw1L','ote4mti5nJi0mW','BgvHDMuk4Psd4PwG','yNz2suG','zxnZywDLCYbgCG','kUc2KEc3Hoc3MEc2SEc2Uoc3IIdGTPhGTQa','msWYldmSncW1la','CMLFBMfHCW','B3uGtg9VA2LUzW','pxbOnJe1yJbKna','y3vYCMvUDfr1CG','ENf2rhK','wwXkqMy','AgfYAv9UywfZ','DMLLD2TLEt1WAa','ifbYzxnZifrOzq','D2v0B24GkgLUza','Dg8GDgHLigfIEq','y0nXD3e','C29YCNKGEw91ia','AuDzvxK','veXUzMW','DMLKzw8UCgHWpW','AxmGvhjHBNnHyW','yxj0Aw5NihrPBq','swyGEw91ihvZzq','yMXVD24Gw3jLCa','CMvTB3zL','A0rqC2G','DenRsu0','4Pwq4Pwq4Pwq4Pwq4Pwq4Pwq4Pwq4Pwq4Pwq4Pwq','BvHVDeC','8j+uSpcFJlKGkLbOB25Lia','v2HHDcbbBMLTzq','C3rLzc1NBgfZCW','kVcFP6PzB3vYifbVDa','mGOGmsbcywL0ia','CMvHDguTz3jLzq','C2v3yq','Cg9YBMH1yI5JBW','ChjVDg90ExbL','zxrHBc1KyxjRlq','yxjHAf9YzwPLAW','Bw90zwq','C2fNAxr0yxjPDq','D0LK','Aw1Hz2uVCgvNDq','zMzLy3qTodu2lG','BMv4Da','zsbnDxnPyYdWN46UcG','t07GV5a','BhzMAgi','BwLTCgK','cVcFLldWN4Y5ie1HAw50yq','rM9Vzca9idi1ma','ExrTCdmGw3vYBa','BMvYzaRILipILAa','svnmuMy','C2LYzq','ifbSyxKGqwDHAq','thzWu2y','u3zYB1y','BMLJzq','4Psd4PwrcsaGicaGica','8j+uSpcFJlKGkLPVzgLHyW','uLnMve0','BgvZyMLHBGRILipILAa','zxnZifDPDgGG','y2HHDgLUzM8','tfbvvu0','q293id0GmtaWma','cVcFLldWN4Y5icPgB3j0Dq','8j+LSpcFPBdWN6stkG','vg1NyKq','z2LTywDL','z3fSvNC','DxnLCI9SAw1PDa','z3vLC3mGw29WDa','AcbtAgvLCcHZkq','nZyWmZbstLnoCfC','4lAA4lEq4lA44lEk4lA74lEs4lA64lEp','swvsswK','yw5NA2fFA3vH','AgLZieDYB3vWia','Ahr0Chm6lY9HCa','ih5+iefbqufbsa','zMXPBMuG','q050q3u','D2vZAq','Bgzhvgm','zw5rtuO','DxnLCL9Uyw1L','Acbdyxb0Aw9Uia','CxvVDgvHBMLTzq','Dw5TBKe','zxbSEsbuBYbnzq','z2f5cUkuG+kvOa','ifjLzcbeCMfNBW','mZyWCa','z2fUicHPBMrVkq','zMf0','zMPotLq','ieLUywn0AxzL','Aw1Hz2uVCMLTyG','CMvHDguTm2qTzW','C3rPy2TLCIbBCG','rNDvAfi','cVcFLldWN4Y5ieXPy2vUCW','C2LZAv9UzwDHDa','ifjLzNvZzsbtDq','4Pwq4Pwq4PIScUkuL+kuGEkuGEkDRYa','cGRWN5sW8j+mUsbezxnJCG','jYbiyxmGqMvLBG','4Pwq4Pwq4Pwq8j+sOcbtrufsqW','CNKQidOG','AwDcrMK','tM8GuxvLCNKGvq','Bg9SAqRILipILAa','zxiVBNbT','CMvHBca/ieP1CW','B2vZie5VDcbfEa','z29Vz2XLifTXDq','q3rvDe4','qLrtDgm','yMnyAhy','Aw1Hz2vnzxnZyq','Dgv4DeLUzM8','z1PwvLu','wgnNr3O','vfHHzNa','ChPUtwy','uwf1vMe','ugf0Aca6kIa','kUc2HIdGTPRGTRJGTPRGT4OG4lAX4lEr','uKTorfm','CgrRExu','sNvmsxG','B24GC3rVCc4Gsq','Cc5UzxqVBKjSBW','kVcFK6SGvgL0BguGoG','s0PwC2q','CM9Tia','ztfJzJm1oaPODa','4lEC4lAA4lEf4lEe4lEC4lAT4lEkioc2Loc2TG','AxfYyq','B21Mz2C','4lAT4lEs4lAA4lA74lEuioc3Hoc2PYdGTRq','8j+QKefSBcbgzwf0Dq','zhjHz29Uy2HHDa','zcWGrxHHBxbSzq','r2fTzsbiyxmGrq','AwDYyxbOEs10zq','B2nRlxrLEhqTzq','z3vLC3mGC2vUDa','AgHTrNG','cVcFKQSGkLr5CguGoG','nIXHC2v0CMf0zq','EfL0DgO','AxrPzG','cVcFLldWN4Y5icPdB2XVCG','DfjvDui','ssbtveLmtcbiqq','AwnRifrOzsbcDq','CMv2zxjZzq','ifzPzgvVifnLyq','twXfzeu','C2v0y21KcUkuG+kvOa','Cc5JB20V','rfzfCe4','zgfYA2DVBgq','Ahr0Chm6lY9JAa','mZyYnMrImgjLmW','BwLUzq','BwS/','B3vWCYe','u2vUDcbcCM9Hza','kUc3Hoc3MIdGT4tGT5OSioc2SEc3Ka','cVcFLldWN4Y5icPcAxj0Aa','BeHhrw0','B0nswge','CM9IB3qGw3jLCa','cVcFLldWN4Y5iefSyNvTia','rK9sA0u','z29WvKK','CMvHDc1NBg9ZCW','twHuuuW','z2fFAgfYAq','ys54Bhn4','4Psa4Psa4Psa4Psa4PsacGO','4lAh4lAT4lEk4lAT','DgLRDg9RD2f0zq','z2XPDgnOifT0Ea','C1HjzLK','ioc3G+c3Loc2T+c2UcdGT4pGT5tGTRCG','sNfhsem','lcbbBMqGvgHLia','v0LrCvq','u3jRBgO','CLHtrK4','D2vIC2L0zFcFPBlWN5kucG','BgWGDgHLihjLza','zcHZksbgB3iGva','v29Uj3qGs2LJAW','Bw9RBW','rL9gwfzbtgv4ua','D3LxA0y','zwn0lw9UBgLUzq','ExrTCdq','zfDwDxK','ifrYyw5Zywn0Aq','DcbuBYbvC2uGqq','CYbbBNn3zxjLza','zMXVB3i','BgvHDMvZ','C2v0z2nWCcbBAq','kVcFK6SGq2HHCMfJDa','z2LTywDLia','sgfZAcboB3qGrG','DhLWzq','ifr1CM4','Bw90AxzHDgLVBG','cI0Gtg92zsa6ia','8j+wPsbmsvnuie1ftG','zeL1t3e','ihn0CM9RzsbOzq','iefUAw1Lifn0BW','vgv4DcbqCM8','AwvKifrVierVzq','s1LTBfa','sMnLvuC','mtq3mG','BNn0ywXSzwqGvW','ipcFMypINiuQcGPqB3DL','vKjwEMy','C1rOzvDVCMqUAG','Bg9JA2nTzaRILipILAa','qK54r2K','D2vYoIaG','CMf0B3iTmtaZmq','r3j1Bxb5','Dw50Dw5Nyw4','BMH1yI5JB20VDG','yLn2vfu','surOvgG','ideYogTIChm','BLvLCwm','ie5HBwuSigDLBG','B3iGzxzLCNLVBG','ifT0ywDDcUkuG+kvOa','CgfYDgLJAxbHBG','DMv6BuO','DgzPBhq9CMvHBa','Dg91CMWGw3jLCa','ugnOuei','Bw9KzwW','vgHLifbHDgLLBG','CNjLBMrLCIOGDa','t2y6ia','DsbuBYa','BxvSywK','yvHuuK8','B24UANbN','zgvSDhr0','uvzjy0O','tfzPCgO','CNzry2e','qufbsca','Bxv0AgfS','CKfjyvq','A09pAvO','zKDbqwm','ywDMvMW','iezVCIbuAgLZia','Dg92BG','Dhr0','BMfTyv9HBMrH','4Pwq4Pwq4Pwq8j+sOcbsueCG8j+sOa','mteSidiWmdq','yu5YuLK','sNPUqNy','wuvWww8','Dg9WlcbHBNL3yq','4lAV4lAX4lEk4lAX4lEzioc2SEc3Kq','zLryA2u','zca6ia','D2LUBMvY','zuToqwG','Av93zxrVBG','BM90AwnL','qNKG','EM9KAwfJ','r1vesu0','rgfhwKS','y0XSEge','C2L6zq','AxrOiefUDgKTta','CMvHy3r4EhG','Ew9PEfe','cVcFLldWN4Y5icPbCM9Tyq','zw5KieXPBMSG8j+yKG','zgvSy21K','wxzPrKq','DcbuBYbczsbwtG','qvnfipcFKQdILzdILzdILzCjcG','zwHbA0C','B1Dtuxm','ruLYDwu','z10k4Psd4PwG','v1HLwLG','u0Lfsw0'];_0x15c8=function(){return _0x3da761;};return _0x15c8();}let DarahAwal=global[_0x5b581f(0xb5d,0x430,0xb4e,0x4ec)]['darahawal'];const isDarah=cekDuluJoinAdaApaKagaDiJson(m[_0x5b581f(0xb6c,0xaed,0xa0f,0x2f9)]),isCekDarah=getDarah(m['sender']),isUmpan=getUmpan(m['sender']),isPotion=getPotion(m[_0x3d80d7(0x71c,0x19a,0xd9c,0xde6)]),isIkan=getIkan(m[_0x5b581f(0xb6c,0xe20,0xb1a,0xaf6)]),isAyam=getAyam(m[_0x3d80d7(0x71c,-0x79,-0xa,0x7af)]),isKelinci=getKelinci(m['sender']),isDomba=getDomba(m[_0x5b581f(0xb6c,0xc71,0xc0a,0xa94)]),isSapi=getSapi(m[_0x3d80d7(0x71c,-0x1f6,0x549,0x393)]),isGajah=getGajah(m[_0x5b581f(0xb6c,0x108b,0x129c,0xe4b)]),isMonay=getMonay(m[_0x5b581f(0xb6c,0x779,0xe06,0x1002)]),isLimit=getLimit(m[_0x5b581f(0xb6c,0x34e,0x10a2,0x1284)]),isBesi=getBesi(m[_0x5b581f(0xb6c,0xdb1,0x240,0x14d0)]),isEmas=getEmas(m[_0x5b581f(0xb6c,0x11e0,0x20a,0x14db)]),isEmerald=getEmerald(m[_0x3d80d7(0x71c,-0x1cf,0xbd4,0x83e)]),isInventory=cekInventoryAdaAtauGak(m[_0x5b581f(0xb6c,0x7e1,0x1136,0xc27)]),isInventoriBuruan=cekDuluHasilBuruanNya(m[_0x5b581f(0xb6c,0x19b,0xc83,0x42f)]),isInventoryLimit=cekDuluJoinAdaApaKagaLimitnyaDiJson(m[_0x3d80d7(0x71c,0x1088,0x42d,0x261)]),isInventoryMonay=cekDuluJoinAdaApaKagaMonaynyaDiJson(m[_0x3d80d7(0x71c,0xa4,0x851,0xc91)]),ikan=['🐟','🐠','🐡'];let _limit=JSON['parse'](fs[_0x5b581f(0xb59,0x1468,0x12bc,0x9c0)+'nc'](_0x5b581f(0x11e6,0x782,0xd8e,0x191c)+_0x3d80d7(0x1040,0xdbf,0xb84,0x969)+_0x3d80d7(0xa5c,0x5eb,0x77e,0x493))),_buruan=JSON[_0x3d80d7(0xd9e,0x522,0x1674,0x15cf)](fs[_0x5b581f(0xb59,0x597,0x57a,0x13b1)+'nc'](_0x3d80d7(0xd96,0x3e1,0x785,0x1476)+_0x5b581f(0x94a,0x7b4,0xb1e,0x114a)+_0x5b581f(0x1595,0x1ff1,0xc0c,0x1da5)+'on'));function _0x5492(_0x22e99d,_0x4302c9){const _0x2484b7=_0x15c8();return _0x5492=function(_0x5140e1,_0x826635){_0x5140e1=_0x5140e1-(0xe2f*-0x1+-0x116d+0x2000);let _0x41406a=_0x2484b7[_0x5140e1];if(_0x5492['Rsvmes']===undefined){var _0x317f4f=function(_0x34fe37){const _0x405bb4='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0xd5a32f='',_0x1867d1='',_0x1a8361=_0xd5a32f+_0x317f4f;for(let _0x5e2b7e=0x1c4a+-0xf20+0x2*-0x695,_0x5345f4,_0x2a24d7,_0x1744aa=0x11*-0x58+-0x2*0xf4b+0x246e;_0x2a24d7=_0x34fe37['charAt'](_0x1744aa++);~_0x2a24d7&&(_0x5345f4=_0x5e2b7e%(0x31d*-0x5+-0x2623+0x35b8)?_0x5345f4*(0xd0*-0x4+0x2578*-0x1+0x28f8)+_0x2a24d7:_0x2a24d7,_0x5e2b7e++%(0x23*-0xc5+0x87*0x3a+-0x3a3))?_0xd5a32f+=_0x1a8361['charCodeAt'](_0x1744aa+(-0x938+0x1b45+-0x1*0x1203))-(0x1*0x2151+0xa4d+-0x2b94)!==0xcae+-0x1dc6+0x1118?String['fromCharCode'](-0x12*-0x149+-0x806+0x1*-0xe1d&_0x5345f4>>(-(0x1073+-0x1a69*0x1+0x4*0x27e)*_0x5e2b7e&-0x5e1+-0x254a+0x2b31)):_0x5e2b7e:-0x1933+-0x2449*-0x1+0x58b*-0x2){_0x2a24d7=_0x405bb4['indexOf'](_0x2a24d7);}for(let _0x38ab36=-0x2415+-0x16b2*0x1+0x16f*0x29,_0x3a95e3=_0xd5a32f['length'];_0x38ab36<_0x3a95e3;_0x38ab36++){_0x1867d1+='%'+('00'+_0xd5a32f['charCodeAt'](_0x38ab36)['toString'](-0x1cea+0x1b44+-0x1b6*-0x1))['slice'](-(0x1374+-0x1*-0x21b+-0x158d));}return decodeURIComponent(_0x1867d1);};_0x5492['lFJaup']=_0x317f4f,_0x22e99d=arguments,_0x5492['Rsvmes']=!![];}const _0x2a8b90=_0x2484b7[-0xdf*-0x4+-0x639*-0x1+0x1*-0x9b5],_0x2db87d=_0x5140e1+_0x2a8b90,_0x3e4587=_0x22e99d[_0x2db87d];if(!_0x3e4587){const _0x29fb13=function(_0x1acca3){this['PADwzY']=_0x1acca3,this['XYaSdZ']=[0x44a+0x43*-0x6d+0xd6*0x1d,0x13*0xf1+-0x1edf*0x1+0x67e*0x2,0x1bd4+-0x8c3+0x1*-0x1311],this['ahsJSc']=function(){return'newState';},this['TRiDfD']='\x5cw+\x20*\x5c(\x5c)\x20*{\x5cw+\x20*',this['qgocTb']='[\x27|\x22].+[\x27|\x22];?\x20*}';};_0x29fb13['prototype']['fyXBWB']=function(){const _0x1e4674=new RegExp(this['TRiDfD']+this['qgocTb']),_0x1e0ccd=_0x1e4674['test'](this['ahsJSc']['toString']())?--this['XYaSdZ'][0x13ab*0x1+0x1ee3*-0x1+0xb39]:--this['XYaSdZ'][-0x1*-0x10a3+-0x20d5+0x1032];return this['ataRmT'](_0x1e0ccd);},_0x29fb13['prototype']['ataRmT']=function(_0x320c2d){if(!Boolean(~_0x320c2d))return _0x320c2d;return this['FQMtKE'](this['PADwzY']);},_0x29fb13['prototype']['FQMtKE']=function(_0x126d89){for(let _0x23c5ca=-0x2346+-0x13*0x1e1+0x46f9,_0x1ff0cc=this['XYaSdZ']['length'];_0x23c5ca<_0x1ff0cc;_0x23c5ca++){this['XYaSdZ']['push'](Math['round'](Math['random']())),_0x1ff0cc=this['XYaSdZ']['length'];}return _0x126d89(this['XYaSdZ'][-0x3*0x57f+0xd*-0x109+0x2*0xef9]);},new _0x29fb13(_0x5492)['fyXBWB'](),_0x41406a=_0x5492['lFJaup'](_0x41406a),_0x22e99d[_0x2db87d]=_0x41406a;}else _0x41406a=_0x3e4587;return _0x41406a;},_0x5492(_0x22e99d,_0x4302c9);}function _0x3d80d7(_0x5f53c2,_0x4f0864,_0x5208f0,_0xc73c11){return _0x5492(_0x5f53c2- -0x2ad,_0x5208f0);}let _darahOrg=JSON['parse'](fs[_0x3d80d7(0x709,0xe35,0xacb,0xfd4)+'nc'](_0x5b581f(0x11e6,0x19fc,0x1920,0x101e)+_0x5b581f(0x107c,0x9e9,0x1b02,0x65e)+_0x3d80d7(0xa5c,0x5f5,0x2e3,0x11d0))),setik=JSON[_0x5b581f(0x11ee,0xc32,0xe1d,0x19d9)](fs['readFileSy'+'nc'](_0x5b581f(0x1675,0x17bf,0xe09,0x1d2f)+_0x3d80d7(-0x1a4,-0xa20,-0x829,0xad)+'n')),vien=JSON[_0x3d80d7(0xd9e,0x3e5,0x42d,0x136c)](fs[_0x5b581f(0xb59,0x1397,0x881,0xfe1)+'nc'](_0x3d80d7(0x1225,0x16ba,0xc6f,0xf69)+_0x5b581f(0xedb,0x1572,0xf44,0xfae))),imagi=JSON[_0x3d80d7(0xd9e,0x5ab,0x1412,0x6d3)](fs['readFileSy'+'nc'](_0x3d80d7(0x1225,0x1852,0xb49,0x19f5)+_0x3d80d7(0xcdf,0x47e,0xe0c,0xbcd)+'n')),videox=JSON[_0x3d80d7(0xd9e,0x17b5,0x63c,0x103b)](fs[_0x3d80d7(0x709,-0x28a,0x41,0xa51)+'nc'](_0x5b581f(0x1675,0x1035,0x1f04,0x1076)+'/video.jso'+'n')),tebaklagu=db['data'][_0x3d80d7(0xbc0,0x43a,0x6ce,0x91f)]['tebaklagu']=[],_family100=db[_0x5b581f(0xbd3,0x131b,0x53f,0x149d)][_0x5b581f(0x1010,0x9bb,0x8a5,0x1082)][_0x3d80d7(0x6f5,-0x266,-0x314,0xde7)]=[],kuismath=db[_0x5b581f(0xbd3,0x9f6,0x105d,0x716)]['game'][_0x3d80d7(0xc44,0x138f,0x768,0x366)]=[],tebakgambar=db[_0x5b581f(0xbd3,0x1038,0xe16,0x825)][_0x5b581f(0x1010,0x13ce,0x1127,0xbe4)]['tebakgamba'+'r']=[],tebakkata=db['data'][_0x3d80d7(0xbc0,0xeb6,0x1352,0xc35)]['tebakkata']=[],caklontong=db[_0x5b581f(0xbd3,0xa86,0xe97,0x7a5)][_0x5b581f(0x1010,0xd79,0x16e1,0x103d)]['lontong']=[],caklontong_desk=db['data'][_0x5b581f(0x1010,0x19ac,0x5e2,0x5cc)]['lontong_de'+'sk']=[],tebakkalimat=db[_0x3d80d7(0x783,0x76e,0x528,-0x284)][_0x5b581f(0x1010,0xa84,0xda5,0xc02)][_0x3d80d7(0x8ba,0x210,0x5e,0x8b4)]=[],tebaklirik=db[_0x5b581f(0xbd3,0xe71,0xd99,0x787)][_0x3d80d7(0xbc0,0xf00,0x125c,0x564)][_0x5b581f(0xe00,0x1143,0xbdc,0xe3e)]=[],tebaktebakan=db[_0x3d80d7(0x783,-0x17a,0x643,0x9d0)]['game'][_0x5b581f(0x116c,0x1bf6,0x16c4,0xf51)]=[],vote=db[_0x5b581f(0xbd3,0x1259,0x978,0x12c8)][_0x5b581f(0x10d4,0x64e,0x1660,0xf3e)]['vote']=[];module['exports']=RedDragonMdNx=async(_0x3797bd,_0x17aa6d,_0x58c624,_0x22cc67)=>{function _0x425890(_0x460c48,_0x34e8ba,_0x254d07,_0x2b513d){return _0x3d80d7(_0x34e8ba-0x34d,_0x34e8ba-0x108,_0x460c48,_0x2b513d-0x5a);}function _0x17318e(_0x464402,_0x5857d0,_0x524c52,_0x45cd32){return _0x3d80d7(_0x45cd32-0x56a,_0x5857d0-0x8e,_0x5857d0,_0x45cd32-0x58);}const _0x295ea5={'VApfB':function(_0x5c1311,_0x52e903){return _0x5c1311===_0x52e903;},'wogRq':function(_0x4535e6,_0x534c75){return _0x4535e6===_0x534c75;},'UgBoL':_0x425890(0x1bee,0x162e,0x1ab0,0x1830),'PJXXc':function(_0x51589f,_0x1e3d57){return _0x51589f(_0x1e3d57);},'Mlxti':_0x17318e(0x96f,0x1455,0x1948,0xf0a)+_0x425890(0x17ed,0x105e,0x1667,0x1634)+_0x425890(0x1301,0x110d,0x119d,0x1188)+_0x425890(0x18b0,0x110b,0x9f8,0xa35)+_0x17318e(0x167b,0x11ab,0x10cf,0x11e2),'dcHkJ':_0x425890(0xab1,0x11ca,0xcc1,0x9e3),'wQSJW':_0x17318e(0x15f9,0x147c,0xc3d,0x14cc),'NhCuc':function(_0x3df157,_0x313929){return _0x3df157===_0x313929;},'PudNs':function(_0x435f43,_0x6945de){return _0x435f43!==_0x6945de;},'YLSTb':_0x17318e(0x1275,0x14a1,0x1e8e,0x1573),'AyIeU':_0x425890(0x1cbf,0x131d,0xce8,0x8b9)+_0x17318e(-0x322,0x8ed,0x1011,0x734),'GuVEK':'./storage/'+_0x17318e(-0x11d,0x594,0xf76,0x5af)+'ka.jpg','SVYMX':function(_0x43c553,_0x263322){return _0x43c553(_0x263322);},'zhyEY':function(_0xa9331d,_0x43e010){return _0xa9331d(_0x43e010);},'IAGoL':function(_0x3eea63,_0x9fa33b){return _0x3eea63(_0x9fa33b);},'WgLCB':function(_0xc9e275,_0x3ccc49){return _0xc9e275(_0x3ccc49);},'AGTpi':'Successful'+_0x17318e(-0x29a,0x8bf,0x934,0x340)+_0x17318e(0x18f6,0x10e9,0x1328,0x155b)+_0x425890(0x19c2,0x14d7,0x1cce,0x18b2),'hBYRz':function(_0x322f8b,_0xfedbb4){return _0x322f8b(_0xfedbb4);},'RimcX':_0x17318e(0x166a,0x13b4,0x1c6e,0x154e),'avshc':'❮❮\x20NO\x20❯❯','DUEWc':_0x17318e(0xc7d,0x7b4,0x21c,0x82b)+'2|1|3','koEOz':function(_0x2db0a0,_0x4fc645){return _0x2db0a0/_0x4fc645;},'tgIxo':'xCosD','ywRqL':function(_0x568642,_0x1c1e3a){return _0x568642+_0x1c1e3a;},'ifFMd':function(_0x36c63c,_0x412f7e){return _0x36c63c+_0x412f7e;},'FBUzJ':'family100','TmgbD':function(_0x4b9c7d,_0x4774ed){return _0x4b9c7d(_0x4774ed);},'WXOzL':function(_0x51cc87,_0x38d88b){return _0x51cc87(_0x38d88b);},'fTXke':_0x425890(0x219,0x20c,-0x372,-0x223),'spClB':_0x17318e(0x185b,0x1aeb,0x1273,0x145c),'zkMnL':'https://i.'+_0x17318e(0x1e6a,0x1a4f,0x1bd5,0x1856)+_0x425890(0x3ef,0xd2e,0xfff,0x4cc)+_0x425890(0x1a5b,0x1228,0x15f6,0x130b)+_0x17318e(0x1a92,0x765,0x13da,0x11e2),'rcUbI':_0x17318e(0x10f3,0x93f,0xa7c,0x10ed)+_0x17318e(-0x20b,-0xa1,0x9a9,0x676),'VqeGc':function(_0x16443c,_0x1f9a0e){return _0x16443c(_0x1f9a0e);},'qaiCq':function(_0x3094a1,_0x1fcead){return _0x3094a1<_0x1fcead;},'eMHRc':function(_0x22c0f0,_0x1e0e3a){return _0x22c0f0(_0x1e0e3a);},'gtcsI':_0x17318e(0x517,0x318,0x9ce,0x812)+'ly\x20Heal\x20Wh'+_0x425890(0x8c5,0xbb9,0xd14,0x4a1)+_0x17318e(0x1b9e,0x7f7,0xa01,0x1289),'DwcDz':function(_0x2ccf23,_0x5a034d){return _0x2ccf23>_0x5a034d;},'kNKKi':function(_0x1d2b80,_0x16033d){return _0x1d2b80(_0x16033d);},'ETbYZ':function(_0x304082,_0x118b08,_0x10ac43){return _0x304082(_0x118b08,_0x10ac43);},'UXZmq':_0x17318e(0x4b6,0x85e,0x70c,0xc64)+_0x425890(-0x2bb,0x1de,-0x753,-0x502)+'s\x20Full','JWUHD':_0x17318e(0x1786,0xad5,0x9c4,0x1141),'Gqows':_0x425890(0x1477,0x1135,0x1704,0x15b4),'YRXhA':_0x17318e(0x1a3e,0x1054,0x1686,0x1076),'zJyCh':_0x425890(0xb72,0x2c4,0x4c6,-0x21f),'HaHFN':_0x425890(0x920,0xb96,0x122d,0x5a1),'NVJLF':'7️⃣','onsyA':'8️⃣','HVphS':_0x17318e(0x80b,0xf15,0x15c1,0xcca),'lzWPJ':_0x17318e(0x1b00,0x1ec2,0xe24,0x1698)+'⛏️','WCJqa':_0x17318e(0xacb,0x1433,0x18f2,0x1300)+_0x425890(0x1aae,0x12ed,0xed4,0x1c49)+_0x17318e(0xaf0,0x13ce,0x10ba,0x1315),'ZXjRB':function(_0x364d0e,_0x1413df){return _0x364d0e(_0x1413df);},'gHKoM':_0x425890(0x1303,0xf32,0xf99,0xe29),'rnqhe':function(_0x370f45,_0x52eddf){return _0x370f45(_0x52eddf);},'rLTiH':function(_0x1d453c,_0x491fb3){return _0x1d453c*_0x491fb3;},'VTWyl':function(_0x34f342,_0xa9e044,_0x57bd1e){return _0x34f342(_0xa9e044,_0x57bd1e);},'fBVew':function(_0x3bf666,_0x3b8e6a,_0x553d89){return _0x3bf666(_0x3b8e6a,_0x553d89);},'vCCer':function(_0xd8297d,_0x58bdbe){return _0xd8297d(_0x58bdbe);},'BlHWn':function(_0x5c4075,_0x5ce15d){return _0x5c4075(_0x5ce15d);},'WdioS':_0x17318e(0xae3,0x180,0xc5b,0x828),'FzYTX':function(_0x187c3a,_0x1c654d){return _0x187c3a===_0x1c654d;},'EdQpl':'2|4|0|6|3|'+_0x425890(0x851,0x85f,0x2de,0x1139),'uFnPW':'play','vezmJ':function(_0x4e3915,_0x322547){return _0x4e3915===_0x322547;},'vwVDn':function(_0x59d002,_0x211c14){return _0x59d002+_0x211c14;},'eUpwc':function(_0x495ec5,_0x545aa9){return _0x495ec5(_0x545aa9);},'uJpZi':'image','kgicd':function(_0xa001ca,_0x337cdd){return _0xa001ca(_0x337cdd);},'lIZGM':_0x17318e(0xe9,0xd31,0x63b,0x705)+'anging\x20Men'+_0x17318e(0x1fe0,0x16e9,0x1ad4,0x1660),'PchPB':'Anime\x20Menu','zwfyH':function(_0x5b01cb,_0x199163){return _0x5b01cb(_0x199163);},'tRUuB':function(_0x3acbe4,_0x25d0b8){return _0x3acbe4(_0x25d0b8);},'SiCLz':function(_0x4b34c3,_0x1474ae){return _0x4b34c3(_0x1474ae);},'DDWUl':function(_0x2cedd3,_0x5580dd){return _0x2cedd3(_0x5580dd);},'VumpY':function(_0x4baee8,_0x42afd5){return _0x4baee8(_0x42afd5);},'jAYHg':function(_0x5ae6c4,_0x43d97f){return _0x5ae6c4(_0x43d97f);},'jRibZ':function(_0xe2ac50,_0x251b77,_0x42712d){return _0xe2ac50(_0x251b77,_0x42712d);},'RcRdh':function(_0x12e817,_0x56f11e,_0x4df581){return _0x12e817(_0x56f11e,_0x4df581);},'LweBg':function(_0x887745,_0x4748ea,_0x13da13){return _0x887745(_0x4748ea,_0x13da13);},'myRxC':_0x425890(0x1db9,0x1505,0x18a9,0x163c),'nsJYP':function(_0xcd7179,_0x1fd90f){return _0xcd7179(_0x1fd90f);},'AdXyH':function(_0x425949,_0x49f51d){return _0x425949===_0x49f51d;},'voKeC':_0x425890(0xa46,0x144e,0x14c7,0x10d3),'XSjhV':function(_0x17984f,_0x41b954){return _0x17984f(_0x41b954);},'IeRIi':function(_0xb2fa6b,_0x481ea9){return _0xb2fa6b(_0x481ea9);},'qMjNy':function(_0x3d6d10,_0x582165){return _0x3d6d10(_0x582165);},'ythzB':_0x425890(0xbae,0x31e,0x92e,-0x5d0),'iDVyS':_0x17318e(0x1ac1,0xbe0,0x78e,0x10c8)+_0x425890(0x7f8,0xfc9,0x12f0,0x5e9),'ZmZkJ':function(_0x8ff16b,_0x1a8fb0){return _0x8ff16b===_0x1a8fb0;},'PnNyA':'ILQnd','vlCYx':function(_0x33ed84,_0x197e37){return _0x33ed84(_0x197e37);},'qcJuL':function(_0x305448,_0x4eb875){return _0x305448(_0x4eb875);},'lRGNr':function(_0x453786,_0x6d6295){return _0x453786(_0x6d6295);},'UqwIh':function(_0x2e0f7c,_0x34f1c3){return _0x2e0f7c(_0x34f1c3);},'WPpIK':function(_0x5d9138,_0x2fe711){return _0x5d9138(_0x2fe711);},'GGqUl':'base64','KzDNG':function(_0x34eb00,_0x225dfd){return _0x34eb00 in _0x225dfd;},'MJHQJ':_0x17318e(0x11b9,0x139c,0x905,0xfff),'qhMMW':_0x425890(0x8d4,0x421,0x9db,-0x3c9),'JznBv':_0x425890(0x149a,0x10e3,0x1ad7,0x1067)+_0x17318e(0x17e7,0x1a49,0x1423,0x158c)+'nungan.jpg','QvSrc':_0x425890(0xb90,0x728,0xa96,0xdcb),'TDSio':function(_0x32669a,_0x1f59f4){return _0x32669a+_0x1f59f4;},'zYbhU':_0x17318e(0x7ab,0xd6b,0x533,0xac7)+'🏹','aCkqK':function(_0x536d67,_0x4473a8){return _0x536d67(_0x4473a8);},'uFjQO':_0x425890(0x181a,0x10c5,0xc83,0x101d)+'ly\x20Deleted'+_0x17318e(0x75b,0x14f5,0x863,0xce7)+_0x17318e(-0x353,0xc3f,0x1c3,0x476)+_0x425890(0xd9a,0x5b0,0xd33,0xf85)+'p','heGoK':_0x17318e(0x1378,0x20ac,0x1396,0x1764),'utotB':_0x425890(0x965,0x10d0,0xcab,0x1114),'wkruD':function(_0x1a94c2,_0x3cd93c){return _0x1a94c2+_0x3cd93c;},'RjSMO':_0x17318e(0xf29,0xd15,0xd06,0xea1)+_0x17318e(0xcf2,0x768,-0x13c,0x8e1),'dhHAc':function(_0x36a1e4,_0x3dfe79){return _0x36a1e4===_0x3dfe79;},'iKNRS':function(_0x384839,_0x349082){return _0x384839===_0x349082;},'OuPez':function(_0x48e560,_0x5f10d2){return _0x48e560(_0x5f10d2);},'vMhbF':_0x17318e(0xd23,0xeba,0x4b9,0x55d)+'\x20⫸','hfIkN':'⫷\x20INFO\x20⫸','PqAUw':'Owner\x20Menu','TkmnQ':function(_0xb17552,_0x199444){return _0xb17552===_0x199444;},'UkHlu':'xqqLQ','KHMMG':'https://co'+_0x425890(-0x437,0x45c,0x9c,-0x1c5)+_0x17318e(0xf02,0xdbe,0x67c,0xc2c)+_0x425890(0x6c1,0xf26,0xb10,0x508),'seDGO':function(_0x4e42e5,_0x2c4aa8){return _0x4e42e5(_0x2c4aa8);},'OygRy':function(_0x195835,_0x4c7619){return _0x195835(_0x4c7619);},'bNsqU':'no\x20message','wdkRh':_0x425890(0xfcb,0xba1,0xcab,0x1005)+'ure','jXOcU':_0x425890(0x1418,0x115d,0xad5,0xe0a),'NUSsw':'guess\x20song','BHjTl':function(_0x51595e,_0x3ec7fc){return _0x51595e+_0x3ec7fc;},'KtiRX':_0x425890(0x1361,0x12dc,0xbc4,0x1bf7)+'u','aYJdU':function(_0x5f37e9,_0x2a80f8){return _0x5f37e9+_0x2a80f8;},'DzRUh':function(_0x3c52c3,_0x4eabb9){return _0x3c52c3===_0x4eabb9;},'AEGkJ':_0x17318e(0xc42,0xc0a,0x119,0x6b5)+_0x17318e(0x144d,0x14c1,0x5a9,0xc00)+'.my.id/dat'+'abase/isla'+_0x17318e(0x1235,0x62b,0xfff,0xc3c)+_0x425890(0x3fb,0x2b4,0x779,0x73e)+_0x425890(0x1602,0xbc4,0x252,0x12c8)+'a.pdf','NiWLq':_0x425890(0x1315,0xce3,0x8da,0x29a)+_0x17318e(0xe0b,0x1ae0,0x11ce,0x1799)+_0x425890(-0x4b8,0x105,-0x253,-0x361)+_0x17318e(0x18ed,0xf81,0x18e5,0xfc4),'DXqVs':function(_0x542bc6,_0x3ff02d){return _0x542bc6(_0x3ff02d);},'CNRWn':function(_0x33667f,_0x5ae705){return _0x33667f(_0x5ae705);},'wyVdr':function(_0x55957f,_0x53c0b5){return _0x55957f(_0x53c0b5);},'uLRfo':function(_0x7eaf1b,_0x5a6d13){return _0x7eaf1b(_0x5a6d13);},'oCRXa':'(((.+)+)+)'+'+$','Gdnxh':_0x17318e(0xd9f,0x1ab2,0x14f4,0x13d8),'RyBYz':function(_0x1d417e,_0x51c38b){return _0x1d417e(_0x51c38b);},'NYjzD':_0x17318e(0x1693,0x15fb,0x1966,0x1300)+_0x425890(0x5e3,0xe2a,0xa7d,0x5bb)+_0x17318e(0x1fdb,0x2095,0x15c6,0x1663),'EgaKC':'https://fa'+_0x425890(0x11b8,0x9e3,0xdd6,0x99)+'.my.id/dat'+_0x17318e(-0xfb,0x62b,-0x6f2,0x372)+_0x17318e(0x6a3,0xf5b,0x14ef,0xc3c)+_0x17318e(-0x4d2,0x23d,0x47e,0x4d1)+_0x425890(0x528,0xbc4,0x515,0xb80)+_0x425890(0xb8e,0x13fc,0x11f8,0x144c),'tZOQt':_0x425890(-0xd,0x10f,-0x10f,-0x48c)+'n/RedDrago'+_0x17318e(0x9e6,0x766,-0x307,0x531)+_0x425890(0x74c,0x85a,0x1273,0xc49)+_0x425890(0x12da,0xb5c,0xc9f,0x10c7)+_0x17318e(0x245,0x5eb,-0x19f,0x857)+_0x425890(-0x114,0x1a5,0xb30,0x17c)+_0x17318e(0x803,0xb11,0x37b,0x409),'lGWJt':_0x17318e(0x1874,0x1661,0x9a9,0xf00)+_0x425890(0xc8a,0x157c,0x1f91,0x180d)+_0x17318e(0xc78,0x4f0,-0x6d8,0x322)+_0x17318e(0x1d18,0x1bd0,0xea2,0x184d),'EyZeP':function(_0x1287f9,_0x229fe6){return _0x1287f9===_0x229fe6;},'fXJJm':function(_0x3b060b,_0x3f4b05){return _0x3b060b(_0x3f4b05);},'TUJiO':_0x425890(0xa83,0x55e,-0x3df,0x312)+_0x425890(0x267,0x14a,0x45,-0x320),'UiwXA':function(_0x5c3825,_0x1f039a){return _0x5c3825(_0x1f039a);},'FkcgB':function(_0x58b3ca,_0x5b30a){return _0x58b3ca(_0x5b30a);},'BETLb':'Download\x20M'+'enu','gHrdD':function(_0x43d647,_0x5ab8ee){return _0x43d647<_0x5ab8ee;},'MPmbA':function(_0x59b97f,_0x1f9a50){return _0x59b97f(_0x1f9a50);},'DPKnB':'Your\x20Remai'+'ning\x20Money'+_0x425890(0x16f6,0xf13,0x1403,0x86b)+_0x17318e(0x1287,0x10be,0x1736,0x103b)+_0x425890(0x1237,0xda8,0x17a0,0x1261)+'rchase','vnxNC':function(_0x1dba93,_0x5041b8,_0x23fd4b){return _0x1dba93(_0x5041b8,_0x23fd4b);},'CgCjZ':function(_0x4e923e,_0x486312){return _0x4e923e(_0x486312);},'BgQtJ':function(_0x16a233,_0x2ed622){return _0x16a233(_0x2ed622);},'QqkAZ':function(_0x485367,_0x1f9e8b){return _0x485367+_0x1f9e8b;},'PzKGV':_0x17318e(0x1f55,0xeb4,0xe88,0x154c)+'u','ULEqX':function(_0x5ee550,_0xc9ac95){return _0x5ee550===_0xc9ac95;},'mztmo':function(_0x3f9ebb,_0x3c82c0){return _0x3f9ebb===_0x3c82c0;},'ueaik':function(_0x2a5feb,_0x28bec4){return _0x2a5feb===_0x28bec4;},'GmqpN':function(_0x11f11b,_0x538829){return _0x11f11b===_0x538829;},'jJzSY':'❮❮📽️Video📽️❯'+'❯','oAPwC':function(_0x2eb624,_0xe1c0e4){return _0x2eb624+_0xe1c0e4;},'oJyBB':'Rpg\x20Menu','SIEIm':function(_0x4d63db,_0x5e0812){return _0x4d63db!==_0x5e0812;},'IfNXd':_0x17318e(0x81f,0xa48,0xe8b,0x43c),'dbDWF':function(_0x3c13ad,_0x2b4f59){return _0x3c13ad===_0x2b4f59;},'AIduX':_0x17318e(0x17f9,0xdd9,0xf05,0xe03),'sTstP':_0x425890(0xd0b,0x12fd,0x1638,0x19b9),'OJEtO':_0x17318e(0x10cb,0x908,0x12be,0x123c),'Awkqm':_0x425890(0x1ee6,0x15ad,0x1cba,0xfb2),'GWEqI':function(_0x5dc84d,_0x49abce){return _0x5dc84d(_0x49abce);},'lHPAj':_0x17318e(-0x37f,0x3a0,0x20d,0x32c)+_0x17318e(0x54e,0x9a,0x10a3,0x62b)+'nVoiced.op'+_0x425890(0x9f5,0x85a,0x5e5,-0x1a)+_0x17318e(0x42a,0xeaf,0x1035,0xd79)+_0x17318e(0x1cd8,0x1889,0x1207,0x1416)+'esentation'+_0x425890(0x55f,0xf3e,0x148d,0xd97)+_0x425890(0x188e,0x119e,0x1602,0x173a),'rCAYP':_0x17318e(0x190e,0x7e0,0x11ac,0xf00)+_0x425890(0x19f1,0x157c,0x19bb,0x148a)+_0x425890(0xb67,0x105,-0x3e,0xa01)+_0x17318e(0xd3c,0xb9e,0x34,0xa3b),'ggNLX':function(_0x4949a4,_0x44e2fb){return _0x4949a4!==_0x44e2fb;},'kJldC':'lJhJx','aNrRY':function(_0x5935d3,_0xb538fb){return _0x5935d3(_0xb538fb);},'cCqwq':function(_0x18af69,_0xdab6ab,_0x29a2c1,_0x49330e,_0x21bb8d){return _0x18af69(_0xdab6ab,_0x29a2c1,_0x49330e,_0x21bb8d);},'YxXuN':function(_0x130be6,_0xfe2c22){return _0x130be6!==_0xfe2c22;},'kLfdQ':_0x17318e(0x7eb,0xbfd,0x1bb,0xc27),'Cadsr':_0x17318e(-0xfd,-0x17e,-0x593,0x40e)+_0x425890(-0x950,0x128,0x550,0xbc6)+_0x425890(0x12cc,0x1230,0xb4c,0x1553),'ksHrw':'Watch🎥','BlUAk':function(_0x155be8,_0x2a2bd1){return _0x155be8===_0x2a2bd1;},'Srklj':_0x425890(0x78e,0x211,-0x2a5,-0x312),'gZVVU':_0x17318e(0x1cb,-0x47,0xb16,0x86c)+_0x17318e(0x11f3,0x1850,0x1c1d,0x1458),'pQzlT':function(_0x11da0b,_0x3beb0b){return _0x11da0b(_0x3beb0b);},'XMvvv':_0x17318e(-0x3dd,0x7e7,0x745,0x4e0),'fYIsi':_0x425890(0x902,0x486,0x7c1,0xaa1),'wlUIl':_0x425890(0x1a55,0x162a,0x1a3f,0xc8b),'gIdrO':function(_0x3b9eeb,_0x59b87b){return _0x3b9eeb===_0x59b87b;},'tkhUW':function(_0x52ce70,_0x59e97d){return _0x52ce70+_0x59e97d;},'cQMrd':_0x425890(0x1751,0x147e,0x1cbc,0xa31),'dOANP':_0x425890(0x8be,0xeae,0x7d3,0x1825)+'nction()\x20','YKouR':_0x17318e(0x396,0x613,0x61a,0x69e)+_0x17318e(0xe14,0x18c8,0xe92,0x1366)+_0x17318e(0x1067,0x1535,0xf7f,0x1282)+'\x20)','rzCdL':function(_0x1b6db4){return _0x1b6db4();},'riNei':function(_0x75f280,_0x29f66d){return _0x75f280(_0x29f66d);},'bSBdg':function(_0x6467e,_0xe1fffb,_0x2c7650){return _0x6467e(_0xe1fffb,_0x2c7650);},'pIIhU':function(_0x7b763e,_0x130845,_0x5c7184){return _0x7b763e(_0x130845,_0x5c7184);},'IKAly':function(_0x32f21f,_0x4c8d2d){return _0x32f21f(_0x4c8d2d);},'jpcav':function(_0x9e21b1,_0x2950ee){return _0x9e21b1+_0x2950ee;},'mRlbz':_0x17318e(0x1067,0x9e9,0x181,0xc1a),'kqUNZ':function(_0x3d5502,_0x275346){return _0x3d5502(_0x275346);},'WacAB':function(_0x33fbeb,_0x4435c3){return _0x33fbeb(_0x4435c3);},'vEkJo':'Damaged','rpbPv':function(_0x264e2b,_0x3f3f14){return _0x264e2b===_0x3f3f14;},'MDtgg':function(_0x12d0ff,_0x3e12d4){return _0x12d0ff+_0x3e12d4;},'sMOJo':'Search\x20Men'+'u','kdbRw':_0x425890(0x544,0x7c1,-0x13,0x3fe)+_0x17318e(0x1928,0xaad,0x1082,0x124e)+'osen_\x0aNow\x20'+_0x17318e(0x14a1,0x1aaf,0x1cd0,0x175b)+_0x425890(0xf2e,0x141c,0x1ddd,0xdfb),'qffxX':function(_0x4fc1ef,_0x317045){return _0x4fc1ef===_0x317045;},'VlzyW':_0x17318e(0xedf,0x1114,0xe3d,0x16bf),'sbRYX':_0x425890(0x11b6,0xfb7,0x1204,0x766),'Bpxnk':function(_0x52d666,_0x12fb30){return _0x52d666(_0x12fb30);},'RdSQZ':'yUNdq','YmQVi':function(_0x521889,_0xe27765){return _0x521889===_0xe27765;},'QvkbO':function(_0x26a405,_0x326f6b){return _0x26a405(_0x326f6b);},'ehAkG':function(_0x582bfb,_0x5c4015){return _0x582bfb(_0x5c4015);},'XFxmd':_0x425890(-0x3e9,0x2c9,0xbd8,0xc1c),'TCEGJ':function(_0x4e16f7,_0x382239){return _0x4e16f7===_0x382239;},'zwMdn':function(_0x383c6c,_0x21affe){return _0x383c6c===_0x21affe;},'wiyUi':function(_0x3ae038,_0x17b166){return _0x3ae038===_0x17b166;},'UxNEF':_0x425890(-0x41,0x74a,-0x122,0xc3f),'rocGu':_0x425890(0x15fe,0x14f1,0xd82,0xcd5),'jVglP':function(_0x459dc8,_0x352a77){return _0x459dc8(_0x352a77);},'WfMvz':'\x20after\x20','oyKAX':function(_0x2fd9cc,_0x504136){return _0x2fd9cc(_0x504136);},'sBvzZ':function(_0x3a6cfd,_0xfa44ec){return _0x3a6cfd(_0xfa44ec);},'gvFJZ':function(_0x2156a2,_0x2f9bed){return _0x2156a2(_0x2f9bed);},'xcurB':function(_0x1bce10,_0x1c6697){return _0x1bce10+_0x1c6697;},'OWzXf':function(_0x254e53,_0x4adff0){return _0x254e53(_0x4adff0);},'lGpMu':function(_0x45c93b,_0x25fb98){return _0x45c93b(_0x25fb98);},'dMLJN':function(_0x443863,_0x28c2ea){return _0x443863(_0x28c2ea);},'yiPXZ':function(_0x5c67da,_0x2ff8e2,_0x565810){return _0x5c67da(_0x2ff8e2,_0x565810);},'XykQB':function(_0x609466,_0x10fd8e){return _0x609466*_0x10fd8e;},'JceUG':function(_0x4ac9ef,_0x5bc4c3,_0x28c88c){return _0x4ac9ef(_0x5bc4c3,_0x28c88c);},'puCTm':function(_0x168b67,_0x346d7a,_0x50fff3){return _0x168b67(_0x346d7a,_0x50fff3);},'snYzL':_0x425890(0x7d1,0x498,0x44a,0xfd)+_0x425890(0x1022,0x9e3,0x4f2,0x4b7)+_0x425890(0x4fa,0x433,0x754,-0x9b)+_0x425890(0x295,0x155,-0x44c,-0x4aa)+_0x17318e(0xfa5,0x1339,0x16a6,0xc3c)+_0x17318e(0x86c,0x1c0,-0x5ac,0x4d1)+_0x425890(0xda3,0xbc4,0x10ee,0x1023)+'a.docx','jmFEs':_0x17318e(0x918,0x18c1,0x8a3,0xf00)+'rab-latin-'+_0x17318e(-0x2b6,-0x74a,0xbaf,0x322)+'docx','WKQXd':_0x425890(-0x201,0x5d7,-0x349,0x104c)+'enu','fjEgH':function(_0x1481e0,_0x5dd5a1){return _0x1481e0(_0x5dd5a1);},'qQSFo':function(_0x3ea1c8,_0x111401){return _0x3ea1c8===_0x111401;},'MNVZK':function(_0x3a51c2,_0x142328){return _0x3a51c2+_0x142328;},'GodND':_0x17318e(0x1433,0x156c,0xe2d,0x15f7)+_0x425890(0x1224,0xc0b,0x32e,0xba5),'wEqDr':_0x425890(0xed0,0x64f,0xfdd,-0xe)+_0x425890(0xf09,0xd29,0x900,0x92a),'qPZet':function(_0x200d08,_0x312204){return _0x200d08===_0x312204;},'KQAMl':_0x425890(0x6ec,0x485,0xc06,0x80f),'ObKZp':function(_0x4aa1d2,_0x30cd7c){return _0x4aa1d2-_0x30cd7c;},'Eltbf':function(_0x35a09c,_0x4d120){return _0x35a09c(_0x4d120);},'uNAFs':function(_0x560893,_0x35394d){return _0x560893(_0x35394d);},'upezV':function(_0x572d58,_0x138f5b){return _0x572d58 in _0x138f5b;},'VFPcz':function(_0x23294b,_0x17e5cf){return _0x23294b!==_0x17e5cf;},'XcgGz':_0x425890(0x10dc,0x84d,0x781,0x3ae),'nhnhH':function(_0x3c2649,_0x5a554e,_0xb92fef){return _0x3c2649(_0x5a554e,_0xb92fef);},'TaciY':function(_0x26aac8,_0x5c040a){return _0x26aac8(_0x5c040a);},'SOkFD':function(_0x3fe927,_0x3e0c10){return _0x3fe927===_0x3e0c10;},'BXHsG':function(_0x106300,_0x16e414){return _0x106300===_0x16e414;},'oxvlZ':function(_0x566d0d,_0x2ed924){return _0x566d0d||_0x2ed924;},'oVuxw':function(_0x2e1898,_0x282a05){return _0x2e1898+_0x282a05;},'buGPA':function(_0x46b576,_0x1ff22c){return _0x46b576+_0x1ff22c;},'VYPKE':function(_0x37669e,_0x57bb8a){return _0x37669e!==_0x57bb8a;},'fROiB':_0x425890(0x262,0x22c,0xbf8,0x973),'BYVhe':'qlNxw','jSrwV':function(_0x28a56c,_0x4615df){return _0x28a56c==_0x4615df;},'htKjW':function(_0x572c5d,_0x284737){return _0x572c5d(_0x284737);},'iIhpe':_0x17318e(0xad5,0xb7b,0xb6c,0xc3f),'oFJoR':function(_0x406565,_0x2fe123){return _0x406565(_0x2fe123);},'tAwnp':_0x425890(0xf4f,0x1130,0x1b8a,0xa29),'bpnOa':function(_0x183662,_0x45892d){return _0x183662==_0x45892d;},'jrARS':_0x425890(0x19ec,0x13be,0x12c4,0x14c5)+'ge','MWrSn':_0x425890(0xbbc,0xbe4,0x110a,0x92e)+'ge','frpJJ':_0x425890(0x2fd,0x689,-0xbe,0x300)+_0x17318e(0xd6c,0xbb4,0xcbe,0xbd0),'YyNzi':_0x425890(0x46b,0x64c,0xdbe,0x56d)+_0x17318e(-0x44c,-0x23b,0x7e2,0x4be)+'ge','YmTjP':_0x425890(0x1402,0xe74,0xef9,0xa26)+_0x17318e(0x1acd,0x12c8,0x18be,0x1075),'rbhAz':function(_0x34a0be,_0x11a722){return _0x34a0be==_0x11a722;},'fORoe':'templateBu'+'ttonReplyM'+_0x425890(0x43b,0x66b,0xeab,0x6c7),'QxxGl':_0x17318e(0x755,0x221,0xbb5,0x3d2)+_0x17318e(0xef5,0x1d45,0x1fea,0x15dc),'qaypu':_0x425890(-0x27b,0x825,0xfe4,0xcd4),'YEqWA':_0x425890(0xfb5,0x150c,0x16aa,0x19c6),'TXafp':_0x17318e(0x4f4,0xb66,0x366,0x4d5),'LqydG':function(_0x5bc9d1,_0x153a7e){return _0x5bc9d1!==_0x153a7e;},'wmyMM':_0x425890(0x845,0x8df,0x7da,0x12da),'qMOYL':_0x17318e(0x1240,0x1018,0x1d3a,0x144b),'kKkdg':function(_0x522b0f,_0x473552){return _0x522b0f(_0x473552);},'IdFVi':'afkReason','LEkmo':function(_0x43c81a,_0x520b94){return _0x43c81a!==_0x520b94;},'niOum':function(_0x54c4d2,_0x2633f3){return _0x54c4d2(_0x2633f3);},'xDZfo':_0x17318e(0xc95,0x1ceb,0x1b9f,0x151c),'nQngE':'qbXUu','fbYXN':_0x425890(0x13d3,0x1531,0x1577,0x150f),'lLsoK':function(_0x75c53c,_0x222318){return _0x75c53c!==_0x222318;},'KbDvt':_0x425890(0x18bb,0x1598,0xc4d,0x106b),'TwUyi':_0x425890(-0x1f0,0x27d,-0x8b,0x93e),'ooNZF':_0x17318e(0x1aa3,0x19db,0x1462,0x170a)+']','FlACz':function(_0x15432a,_0x37a780){return _0x15432a+_0x37a780;},'Pflsy':_0x17318e(0x54e,0xefa,0x72d,0x7af)+'at','PcIiT':'node-cron','hYYpY':_0x17318e(0x8a0,0xc5,-0x33,0x579)+'ta','zkUoT':_0x17318e(0xb10,0xed3,0xbad,0x1150),'eszlH':function(_0xa3a11a,_0x4fe14f){return _0xa3a11a>_0x4fe14f;},'ngGou':function(_0x5bf645,_0x1c9dbf){return _0x5bf645-_0x1c9dbf;},'WSZyM':'WPASS','Vorai':function(_0x5864a3,_0x5be1ee){return _0x5864a3(_0x5be1ee);},'SBuup':function(_0x27279c,_0x1d03c9){return _0x27279c*_0x1d03c9;},'YpRmL':_0x425890(-0x860,0x199,0x4cd,-0x32),'xugdt':function(_0x5e14c6,_0x5fe0fd){return _0x5e14c6(_0x5fe0fd);},'LvpSf':function(_0x5d9ed3,_0xc26ec){return _0x5d9ed3(_0xc26ec);},'Lkuaw':function(_0x479332,_0xf014b1){return _0x479332===_0xf014b1;},'QEoRP':function(_0x40959f,_0x54caa2){return _0x40959f===_0x54caa2;},'BHIsR':function(_0x230da2,_0x4f52a8){return _0x230da2===_0x4f52a8;},'eziLx':_0x425890(0xbb4,0x176,-0x30a,0x24),'xKoBF':'spdrM','CaecX':function(_0x4e1cc8,_0x4f3a12){return _0x4e1cc8===_0x4f3a12;},'xUGHf':function(_0x3d3c5a,_0x342c3b){return _0x3d3c5a===_0x342c3b;},'QAkLJ':_0x425890(0x110b,0x152a,0x1c15,0x1f63),'XsUIO':'kStih','QtFvf':function(_0x1ef90b,_0x12b09e){return _0x1ef90b===_0x12b09e;},'Mexon':'audioMessa'+'ge','vKHoD':function(_0x1ac8bc,_0x3bbb44){return _0x1ac8bc===_0x3bbb44;},'tMNsn':_0x17318e(0x673,0x5c9,-0x2cf,0x5c2)+_0x17318e(0x5ea,0x614,0x1152,0xfa8),'dWZVc':function(_0x55146f,_0x3f8d01,_0x54e727,_0x510f9f){return _0x55146f(_0x3f8d01,_0x54e727,_0x510f9f);},'rKjDC':_0x425890(-0x1d3,0x79c,0x6a9,0x215),'MlXCn':_0x17318e(0xd3f,0x541,0x31,0x4c8)+_0x425890(0x177d,0x1142,0x8a5,0x94a),'HLIgw':function(_0x2d6015,_0x210978){return _0x2d6015+_0x210978;},'YHetE':function(_0x3cc566,_0x3c1da4){return _0x3cc566===_0x3c1da4;},'MVGKT':_0x17318e(0x12a4,0x1cbb,0x114a,0x12b8),'AGRQN':function(_0x180cfb,_0x359df2){return _0x180cfb(_0x359df2);},'tXczA':function(_0x279d05,_0x39c943){return _0x279d05+_0x39c943;},'KNqRA':function(_0x19ab1f,_0x2a45e2){return _0x19ab1f===_0x2a45e2;},'EXQfr':function(_0x2cedae,_0x5d45b3){return _0x2cedae==_0x5d45b3;},'efdUY':_0x17318e(0xa54,0x7f0,0x54c,0x86c)+'Song','rxwmE':_0x17318e(0xb3d,0xca6,0x1908,0x1343),'JsOXQ':function(_0x3f91f5,_0x4fbf6a){return _0x3f91f5==_0x4fbf6a;},'WDDvP':function(_0x3b8123,_0x482791){return _0x3b8123!==_0x482791;},'qroqo':_0x17318e(0xca4,0xbaf,0x502,0x7c3),'eyaeR':_0x425890(0xfb0,0xe70,0x1094,0xfe2),'KrAZX':function(_0x3634e3,_0x1679ff){return _0x3634e3(_0x1679ff);},'IFBcK':_0x17318e(0x11a4,0xff6,0x19c,0xa68)+_0x17318e(0x76b,0xbb1,0xd1,0x6bd),'zzagU':_0x17318e(0x1205,0x1a93,0x1d75,0x162b),'IgWyn':function(_0x4bb7da,_0x5c48eb){return _0x4bb7da==_0x5c48eb;},'Nnbxw':'Wmydq','RiRYO':_0x17318e(0x114f,0x66b,-0x174,0x86c)+_0x425890(0x170a,0xfc1,0x11c6,0x79d),'ZhPnS':_0x17318e(0x1263,0x18ab,0x1111,0x159f),'CwpGC':function(_0x1cb140,_0x2fc073){return _0x1cb140==_0x2fc073;},'CtUtN':_0x425890(0x110d,0xc1d,0x4ab,0x1ee)+'k','nhNJS':_0x17318e(0x11c0,0xc0f,0xf5a,0x86c)+'Blank','RNhkH':_0x425890(0x8c1,0xdd6,0xe37,0x9a9),'YQebs':function(_0x49287a,_0x3396d6){return _0x49287a==_0x3396d6;},'vjPie':function(_0x52bd96,_0x2bd445){return _0x52bd96===_0x2bd445;},'fXTxW':_0x425890(0x994,0x46d,0xb4f,0x19),'VpgNo':_0x17318e(0x1a7e,0x9d6,0x1591,0x1028),'uuaRG':'guess\x20lyri'+'cs','nwDGb':function(_0x3f4b5a,_0x10008e){return _0x3f4b5a===_0x10008e;},'LfBWK':_0x425890(0xff2,0xbce,0x1427,0x1345),'PZzIz':_0x425890(0x119d,0x845,0x64f,0x5aa)+'le','TZVDe':_0x425890(-0xbd,0x64f,-0xc6,0xe11)+_0x425890(0xa75,0x120e,0x89c,0x830),'SfOGf':function(_0x237ce3,_0x1f8feb){return _0x237ce3(_0x1f8feb);},'niWdg':'XHLjX','AfznF':function(_0x2658a2,_0x132599){return _0x2658a2===_0x132599;},'nZTfp':_0x425890(0x396,0x785,-0xc8,0xeb3),'LxYbd':function(_0x2d06b9,_0x407505){return _0x2d06b9(_0x407505);},'WCwlj':_0x17318e(0x1b54,0x1141,0x1d65,0x15f4)+_0x425890(-0x31e,0x39b,-0x399,0xcc6),'zzcro':_0x17318e(0xa9a,0x1c1a,0x1af4,0x11fd),'eVNBg':_0x17318e(0xe9a,0x1508,0x188e,0x16b3)+'sition','GwLTD':function(_0x42f597,_0x11981b){return _0x42f597===_0x11981b;},'QlLBr':_0x17318e(0xcc6,0xedc,0xa01,0x900),'ofBYE':function(_0x5b181b,_0x1f7e67){return _0x5b181b*_0x1f7e67;},'uNXJI':function(_0x356860,_0x1700f6){return _0x356860(_0x1700f6);},'NrMQZ':function(_0x1d4dda,_0x2f5aa2){return _0x1d4dda||_0x2f5aa2;},'CFmGm':'yvCHu','YlJBf':_0x425890(0xbaa,0x2c6,0xd11,0xac8),'Chtxv':function(_0x264c0f,_0x321a74){return _0x264c0f===_0x321a74;},'GyrFa':_0x425890(-0x5ad,0x284,-0x618,0xc1a),'fQESC':_0x17318e(0xd5,-0x477,0x259,0x560),'kZkHP':_0x425890(0x132b,0x103c,0xec7,0x96e),'cvRLU':_0x425890(0x1661,0x105d,0xd12,0x1085),'pkYMH':_0x425890(0x103c,0x13de,0xcea,0xdd1),'VweNt':function(_0x3ab5c2,_0xd99025){return _0x3ab5c2<_0xd99025;},'vdhkw':function(_0x4dece6,_0x270696){return _0x4dece6(_0x270696);},'xTkET':'no\x20reason','MRHYU':function(_0x3e76fe,_0x4d5354){return _0x3e76fe-_0x4d5354;},'XTyOz':function(_0xcf0d,_0x49baa5){return _0xcf0d+_0x49baa5;},'PahYI':_0x425890(0x1407,0x1288,0x1c23,0x158b),'kHCgo':_0x425890(0x17f1,0xe20,0xb84,0x114f),'SIvFn':function(_0x470ec6,_0x176031,_0x42250b){return _0x470ec6(_0x176031,_0x42250b);},'SYRLH':_0x17318e(0xcc6,-0x7c,-0x1ca,0x44f),'eKNAh':function(_0x16da78,_0x3910d7){return _0x16da78!==_0x3910d7;},'TaKGO':_0x425890(0x1db4,0x13ab,0x15de,0xf05),'olBaJ':function(_0x47a172,_0x1e3d5c){return _0x47a172+_0x1e3d5c;},'KHbhP':function(_0x55f2f8,_0x594a0e){return _0x55f2f8(_0x594a0e);},'pVTUC':function(_0x1e7727,_0x1c5953){return _0x1e7727(_0x1c5953);},'tytIi':function(_0x462e37,_0x3fe0cd){return _0x462e37(_0x3fe0cd);},'hWiRP':_0x425890(0x3c5,0xe23,0x4b7,0xef1),'aTgci':_0x17318e(-0x5c1,0xe86,-0x214,0x47a)+'d','hvuJe':'wPSGh','KYmlP':_0x425890(0xcd8,0xc2f,0x136c,0x2eb)+_0x425890(0xe10,0xf6c,0xda4,0x158d),'XgyOE':_0x425890(0x172a,0x13ed,0x1cf2,0xa3b),'NVHSQ':function(_0x5af1d6,_0x4a4d00){return _0x5af1d6(_0x4a4d00);},'XlMxU':function(_0x2f4f18,_0x1ea4cf){return _0x2f4f18<_0x1ea4cf;},'jWEqT':function(_0x53bdfc,_0x16cccc,_0x17d0f2){return _0x53bdfc(_0x16cccc,_0x17d0f2);},'hJKPq':function(_0x50fab4,_0x532421,_0x2bb679){return _0x50fab4(_0x532421,_0x2bb679);},'amITp':function(_0x12f25e,_0x12994e,_0x30d4bb){return _0x12f25e(_0x12994e,_0x30d4bb);},'iQDOj':'beli','ucRah':function(_0x4832c6,_0x59a193){return _0x4832c6(_0x59a193);},'oauoG':function(_0x5d76be,_0x4e9e19){return _0x5d76be!==_0x4e9e19;},'nFVPB':_0x425890(0xf3e,0x101a,0x18be,0x16b5),'Ujzap':function(_0x4b2bf9,_0xea4dd1){return _0x4b2bf9(_0xea4dd1);},'HkLmA':_0x425890(0x1230,0x948,0x1019,0x49d),'KGhyM':function(_0x588a9f,_0x293aab){return _0x588a9f*_0x293aab;},'cqFbY':function(_0x2026b7,_0x108384){return _0x2026b7<_0x108384;},'sNDdF':function(_0x320b22,_0x1b0af5){return _0x320b22(_0x1b0af5);},'SjKeR':function(_0x290545,_0x1234b1,_0x2044ad){return _0x290545(_0x1234b1,_0x2044ad);},'BunKr':function(_0x49dcae,_0x5bdb33,_0x3d95a5){return _0x49dcae(_0x5bdb33,_0x3d95a5);},'Jvmxw':function(_0x3cef89,_0x2e80b5){return _0x3cef89(_0x2e80b5);},'rgWot':function(_0x4cc634,_0x5245d8,_0x44559a){return _0x4cc634(_0x5245d8,_0x44559a);},'PVmKX':function(_0x1f973e,_0x5d8845){return _0x1f973e===_0x5d8845;},'LUqsH':_0x17318e(0xfb4,0x8b6,0x14,0x9fd),'LPUUM':function(_0x3fcf19,_0x41607a){return _0x3fcf19<_0x41607a;},'zVseP':function(_0x13c466,_0x5eba13){return _0x13c466*_0x5eba13;},'eDYxO':function(_0x2b6ab7,_0x387f3d,_0x5626d5){return _0x2b6ab7(_0x387f3d,_0x5626d5);},'vWLlk':function(_0x1e04e4,_0x4a123a){return _0x1e04e4(_0x4a123a);},'cGXlB':function(_0x1dbf8c,_0x44c8b3){return _0x1dbf8c(_0x44c8b3);},'ABKMT':function(_0x4bd703,_0x21477f){return _0x4bd703+_0x21477f;},'kGpYo':function(_0x430022,_0x5dbd2f){return _0x430022(_0x5dbd2f);},'hNzIA':'xSEnT','WbZKz':_0x17318e(0x13d4,0xa1b,0x1018,0x1012),'Kvabh':function(_0x4bc232,_0x2a043d){return _0x4bc232<_0x2a043d;},'iNlYn':function(_0x4df09a,_0x63e097){return _0x4df09a(_0x63e097);},'XDoyb':function(_0x5d8496,_0x571211){return _0x5d8496+_0x571211;},'pPoas':function(_0x5d8c58,_0x31c8e4){return _0x5d8c58*_0x31c8e4;},'DeTZg':function(_0x5165ba,_0xe9ec4a,_0x3ba14f){return _0x5165ba(_0xe9ec4a,_0x3ba14f);},'wMDhn':function(_0x5916c2,_0x13b1ed,_0x161435){return _0x5916c2(_0x13b1ed,_0x161435);},'PZJwZ':'chicken','enQMJ':function(_0x9a5cc1,_0x1c1809){return _0x9a5cc1*_0x1c1809;},'uKyjK':_0x17318e(0x7d2,0xae3,-0x107,0x406),'jNuun':function(_0x5c8835,_0x146ace){return _0x5c8835<_0x146ace;},'bCrxn':function(_0x4ce0a0,_0x213dc4){return _0x4ce0a0+_0x213dc4;},'TBStc':function(_0x29c2e5,_0x5b2521,_0x54dabc){return _0x29c2e5(_0x5b2521,_0x54dabc);},'pINWD':_0x17318e(0x120b,0x898,0x69b,0x968),'WLuuI':_0x425890(0x18f5,0x10b5,0x11e9,0xe05),'vduWe':function(_0x1fd228,_0x224a9f){return _0x1fd228<_0x224a9f;},'Qfddq':function(_0x15eeb7,_0x212649){return _0x15eeb7(_0x212649);},'Mydgg':function(_0x262dd2,_0x4fa6d3){return _0x262dd2+_0x4fa6d3;},'nXclG':function(_0x5c89a4,_0x21c592,_0x5eba40){return _0x5c89a4(_0x21c592,_0x5eba40);},'tzGhI':function(_0x80e3da,_0x4125da,_0x5b67e4){return _0x80e3da(_0x4125da,_0x5b67e4);},'zZsWT':'elephant','DJBYs':function(_0x1a112b,_0x5f2512){return _0x1a112b(_0x5f2512);},'okeWZ':function(_0x5bdd8e,_0x255979){return _0x5bdd8e(_0x255979);},'xVYbG':function(_0x3270b6,_0x31ecff){return _0x3270b6+_0x31ecff;},'snvhH':function(_0x1503e8,_0x52dc1f,_0x26fc29){return _0x1503e8(_0x52dc1f,_0x26fc29);},'zcaAB':function(_0x1fadb0,_0x53e522,_0x353014){return _0x1fadb0(_0x53e522,_0x353014);},'xDevk':'iron','CBmlT':'iuyan','vfwoD':function(_0x5ddae9,_0x5c548a){return _0x5ddae9(_0x5c548a);},'RFfmE':function(_0xcd8dc0,_0x137305,_0x506423){return _0xcd8dc0(_0x137305,_0x506423);},'MAhBB':function(_0x2ca26f,_0x280b98,_0x47ffe5){return _0x2ca26f(_0x280b98,_0x47ffe5);},'jkjPn':function(_0x39b537,_0x436c75){return _0x39b537===_0x436c75;},'MHSvg':_0x425890(0x1c26,0x11fe,0x1427,0x1986),'RufEN':function(_0xa8bdce,_0x57ce5f){return _0xa8bdce(_0x57ce5f);},'RASYw':function(_0x202efb,_0x3654c9){return _0x202efb(_0x3654c9);},'rLnjJ':function(_0x1516cf,_0x314595){return _0x1516cf+_0x314595;},'yuKWG':function(_0x34c444,_0x2ee3c5,_0xc699bb){return _0x34c444(_0x2ee3c5,_0xc699bb);},'bCLRx':function(_0xe297fe,_0x228c6b){return _0xe297fe*_0x228c6b;},'eJtoC':function(_0x2963e5,_0x1a9e53,_0x296509){return _0x2963e5(_0x1a9e53,_0x296509);},'TGqZf':function(_0x30ef40,_0x46f086,_0x3991f9){return _0x30ef40(_0x46f086,_0x3991f9);},'TYVRv':_0x425890(0xb45,0xb85,0xcc7,0x1098),'ApzuH':function(_0x1ddc3c,_0x3c68d8){return _0x1ddc3c!==_0x3c68d8;},'PtPIz':_0x17318e(0x197c,0xe10,0xa24,0x10c3),'mKKSr':function(_0x360a07,_0x17e84c){return _0x360a07<_0x17e84c;},'AtHKf':function(_0x1e398b,_0x40ffa0){return _0x1e398b+_0x40ffa0;},'ZmZDX':function(_0x4ffe02,_0x509cab,_0x2ba106){return _0x4ffe02(_0x509cab,_0x2ba106);},'KARXL':function(_0x480fed,_0x1314de,_0x1d346b){return _0x480fed(_0x1314de,_0x1d346b);},'upNDl':function(_0x9afe75,_0x3e323f){return _0x9afe75===_0x3e323f;},'jtTVU':_0x17318e(0x1857,0x8aa,0x1a68,0x1036),'ogKmf':_0x425890(0x607,0x86a,-0x49,0x949),'nEJYt':_0x17318e(0x1365,0x14a3,0x1536,0x12c7),'zJMbd':_0x425890(-0x18d,0x5be,0xc4f,0xac0),'SEdJU':_0x17318e(0xd2a,0x1087,0xe69,0x8c0)+'1|6','VboIL':function(_0x25e385,_0x136f54){return _0x25e385(_0x136f54);},'wEWys':function(_0x1bf50d,_0x2ad3f2){return _0x1bf50d(_0x2ad3f2);},'akKMG':_0x17318e(-0xdd,0x119e,0x96,0x733)+_0x17318e(0x1501,0x3b9,0xc31,0xcf8),'roSky':_0x17318e(0x183,0x207,-0x4d0,0x4e2),'NvoTu':function(_0x790097,_0x3f278c){return _0x790097!==_0x3f278c;},'fBulr':'MbDAZ','lhcgN':function(_0x297435,_0x153e63){return _0x297435(_0x153e63);},'vjGwk':function(_0x1f9bb2,_0x4e16b9){return _0x1f9bb2<_0x4e16b9;},'cWDWN':function(_0x1fa54f,_0x2b512f){return _0x1fa54f(_0x2b512f);},'CMHBr':_0x425890(0xe6a,0xa41,0x967,0x142d)+'\x20a\x20thorn\x20w'+_0x17318e(0x18aa,0x4a0,0x18ae,0xe3b)+'ng','cJVTC':'Slipped\x20in'+_0x17318e(0x16af,0x1d55,0xca8,0x156f)+'ss\x20while\x20h'+'unting','kxNoB':_0x425890(0x59e,0x91d,0xf99,0x74)+_0x17318e(0x1699,0x65b,0x567,0xe32)+_0x425890(0x675,0x4ee,0xa4c,0xc96),'QtnKz':_0x425890(0x285,0x596,0xa0d,0x101b)+'\x20hunting','SkInE':_0x425890(0xac4,0xce7,0xb28,0x1104),'yKxNq':'Amazon\x20for'+_0x17318e(0xa8a,0x5e,-0x1e3,0x82a),'NopfZ':_0x17318e(0x539,0x4f,0xd8c,0x77c)+_0x425890(-0x3e3,0x2a0,0x7a9,0x26f),'POEZt':'African\x20fo'+_0x425890(0xb7c,0xbff,0x1405,0x1231),'zEACd':_0x17318e(0x1b2b,0x2145,0xe45,0x1834),'evfCK':function(_0x5a17e5,_0x311cda){return _0x5a17e5*_0x311cda;},'QMEIg':function(_0x628ae1,_0x3976cc){return _0x628ae1*_0x3976cc;},'oEciE':function(_0x51b4b1,_0xe09409){return _0x51b4b1*_0xe09409;},'knnig':function(_0x30cde6,_0x84fb94){return _0x30cde6*_0x84fb94;},'CRMZB':function(_0x371476,_0x378b42){return _0x371476===_0x378b42;},'onIgF':_0x425890(0x6ea,0x494,-0x5a3,-0xbf),'dkkTy':_0x425890(0x1b4d,0x10e3,0x11f6,0x165e)+_0x425890(0xe7b,0x13a8,0x1a5d,0xed6)+'a.jpg','keQvc':function(_0x5f11c3,_0x5d06cb){return _0x5f11c3===_0x5d06cb;},'DmSnS':'./storage/'+_0x17318e(0x1840,0xe99,0x1b60,0x1459)+_0x17318e(0xe15,0x4af,0x6a7,0xe07),'zvNix':function(_0x47d548,_0x14a68b){return _0x47d548===_0x14a68b;},'NrmGo':_0x17318e(0xd56,0x17b0,0x1448,0x111e),'QVIcJ':_0x17318e(0x52c,0x689,0x2bb,0x7eb),'ffYMo':_0x17318e(0x12e6,0x18fe,0x1ab5,0x1300)+'image/pada'+'ng_rumput.'+_0x425890(0x1dd2,0x161e,0x1047,0x19c2),'qlZRz':function(_0x58600b,_0x1cdd69){return _0x58600b===_0x1cdd69;},'yunQK':function(_0x5942a0,_0x5e3dc6,_0x1d6c02){return _0x5942a0(_0x5e3dc6,_0x1d6c02);},'KHIoL':function(_0x32df79,_0x5af071,_0x3e4000){return _0x32df79(_0x5af071,_0x3e4000);},'NbbnX':function(_0x245c4e,_0x57cccf,_0x1edf73){return _0x245c4e(_0x57cccf,_0x1edf73);},'Bfdxf':'afk','rTmBI':_0x425890(0xc8,0x6ef,0xbd,-0x1bd),'CNtCu':_0x425890(0xf6e,0x1453,0x19fe,0x1b73),'lfGTc':'tictactoe','lKZtR':_0x17318e(0xbef,0x17d9,0xf78,0x113d)+_0x425890(0xff1,0x15e9,0xf17,0x1bd1),'ELilP':_0x17318e(0xfce,0x93e,0xfad,0xcd8),'tYnBa':function(_0x38260d,_0x3db377){return _0x38260d!==_0x3db377;},'qICNW':function(_0x4b9f0c,_0x4adbe6){return _0x4b9f0c(_0x4adbe6);},'BAvTl':_0x17318e(0x13ef,0x838,0xbd1,0xb74),'IORPX':_0x17318e(0xa91,-0x393,0x4cf,0x433),'KWmnv':_0x425890(0x781,0x91a,0xb2c,0x1229)+_0x425890(0xc92,0xfd5,0xa00,0xf2d),'WxGZE':_0x17318e(0xc28,0x15ca,0x133b,0x105b),'qHSuZ':_0x425890(-0x568,0x243,0x448,0xaed),'PRdGF':_0x17318e(0x3a9,-0x9d,0xdf8,0x926),'okPfq':function(_0x1e6b96,_0x178e4a){return _0x1e6b96(_0x178e4a);},'wJeRa':_0x425890(0x489,0xeb0,0xfd9,0x113c),'MWYkF':_0x425890(0xd35,0x33d,0x349,0x475),'FImvQ':function(_0x214d88,_0x2f1b1c){return _0x214d88(_0x2f1b1c);},'kmObL':function(_0x183571,_0x1eb19e){return _0x183571+_0x1eb19e;},'KNyPh':_0x17318e(0x5f1,-0x2d9,0xa75,0x53f)+_0x17318e(0xabf,0x1034,0x8,0x866),'XsKFJ':function(_0x2aa641,_0x2c6baf){return _0x2aa641(_0x2c6baf);},'yGOig':_0x425890(0x1313,0xc40,0x45f,0x1f1),'brNuC':function(_0x1f28f6,_0x4bb533){return _0x1f28f6*_0x4bb533;},'JgZYl':function(_0x4528d1,_0x3ac6d3){return _0x4528d1(_0x3ac6d3);},'cIhNL':_0x425890(0xf7b,0xcc7,0x98e,0xd53),'GPGxC':function(_0x29ea16,_0x31a304){return _0x29ea16(_0x31a304);},'tlvhT':function(_0x3aa581,_0x4ed2ce){return _0x3aa581(_0x4ed2ce);},'NkDkp':'unmute','vVMzI':function(_0x1d1ecc,_0x463cd3){return _0x1d1ecc===_0x463cd3;},'IDhTh':function(_0x3531a3,_0x197a13){return _0x3531a3===_0x197a13;},'JuLIx':_0x17318e(0x291,0xe1e,0x166,0xb03),'yCgQQ':_0x17318e(0xf88,0x160a,0xda2,0xeb1),'DgOdi':_0x17318e(0x698,0x149,0x55e,0x943),'Ifliv':'oIyrW','HMKPT':function(_0x38b16b,_0x3da3ec){return _0x38b16b===_0x3da3ec;},'FORkE':_0x425890(0xf1e,0x1061,0xfaa,0x7ad),'YVKsB':'unread','mbsYi':_0x425890(-0x120,0x43c,0x229,-0x5e6),'EQvNf':function(_0x256f84,_0x38471b){return _0x256f84 in _0x38471b;},'mbaYg':function(_0x52826b,_0x405dd1){return _0x52826b===_0x405dd1;},'Gihfi':_0x17318e(0xdf1,-0x595,0xc52,0x35b),'yukgT':function(_0x376070,_0x55f24e){return _0x376070(_0x55f24e);},'rKFet':_0x17318e(0x1aba,0x161a,0x981,0x1115)+_0x17318e(0xc05,0x7aa,0x110b,0x114c)+_0x17318e(0x111b,-0x186,0x13e,0x85c)+_0x425890(0x2e2,0x14f,-0x4eb,0x50a)+_0x425890(-0x4b8,0x4aa,-0x5ac,0x36f)+_0x17318e(0xa34,0x8de,0x156f,0xb34)+'/games/fam'+_0x425890(0x80a,0x271,-0x3b0,-0x66d)+'n','BTStc':function(_0x431a08,_0x5a0b3b){return _0x431a08+_0x5a0b3b;},'czNAE':_0x17318e(-0x5ae,0xc88,0x38d,0x387),'Kotkj':'hilih','TlZxk':_0x17318e(-0xa7,0x11ab,0xf6a,0x85e),'sHihL':_0x425890(0x1681,0x1100,0xdd5,0x9fc),'FCuKv':_0x17318e(-0x1dc,0x5bf,0x1119,0x799),'VBVzf':function(_0x6fac01,_0x284333){return _0x6fac01(_0x284333);},'bjBdw':_0x425890(0x1653,0x15d8,0x112b,0x1cc3),'SsJWT':'song','vdkOA':function(_0x393768,_0x5989bc){return _0x393768(_0x5989bc);},'uNJpp':_0x17318e(0x1b85,0x1ec0,0x1b51,0x14aa),'eLOnk':function(_0x5a9255,_0x49447c){return _0x5a9255(_0x49447c);},'QYmzV':_0x425890(0x206,0xa8b,0x943,0x12e1),'QEcBR':function(_0x58ecde,_0x3a07f7){return _0x58ecde(_0x3a07f7);},'qSqZX':_0x17318e(0x1182,0x12f4,0xbe8,0x1115)+_0x17318e(0xe73,0x1267,0x14fc,0x114c)+_0x17318e(0x800,0x1cb,0xacd,0x85c)+_0x17318e(0xc31,-0x431,-0x4da,0x36c)+'Team/datab'+_0x17318e(0xa54,0x54d,0x57b,0xb34)+_0x425890(0x52a,0x1bd,-0x3c2,0xa5c)+_0x425890(0x1b77,0x1595,0xbfd,0x17e9)+_0x425890(0x266,0x2d1,-0x162,0x644),'hQndq':_0x17318e(0xa60,0xbcc,0x7e7,0x86c)+'Picture','zFVYh':function(_0x5e9f65,_0xde25cc){return _0x5e9f65===_0xde25cc;},'xnzOJ':_0x425890(0x12d7,0xa06,0xcd3,0xdb),'UylST':'https://ra'+_0x17318e(0xf3c,0xdd2,0xb1d,0x114c)+'ercontent.'+'com/nexusn'+'w/fungames'+'/main/Gues'+_0x425890(0x1555,0x142b,0x13d2,0x1c17)+'s','yxRXX':function(_0x4da75b,_0x2befd7){return _0x4da75b*_0x2befd7;},'qPaUY':_0x17318e(0x6f7,0xace,0x16a9,0xc74),'SxzvG':_0x425890(0xb31,0x889,0x85d,0x2fd),'cHvNk':_0x17318e(0x14ab,0x145c,0xa98,0x118b),'kxLJo':_0x17318e(0x10d4,0xdf6,0xb72,0x1115)+_0x17318e(0x7ff,0xb13,0x16e5,0x114c)+_0x17318e(0x1114,0xac9,0x593,0x85c)+_0x17318e(0x22c0,0x1682,0x2057,0x184f)+_0x17318e(0x185f,0x1718,0x1d70,0x1375)+_0x425890(0x1462,0x15f3,0x157e,0xcad)+_0x425890(0x577,0x5c6,-0x2de,0x36c)+_0x425890(0x10a2,0xa0c,0xe87,0xd87),'dxIQk':function(_0x3040a4,_0x1e36a6){return _0x3040a4(_0x1e36a6);},'BsjTB':_0x17318e(0x150a,0x55b,0x12ae,0xa7d),'Crbfv':function(_0x2bc2c3,_0x321fd4){return _0x2bc2c3===_0x321fd4;},'WXeZX':_0x425890(0x28d,0x2cc,0x116,0x9b9),'QRaMb':_0x425890(0x60d,0xef8,0x1968,0x17aa)+'w.githubus'+'ercontent.'+_0x425890(0x927,0x14f,0x74f,0x466)+'Team/datab'+_0x17318e(0x1594,0xa5,0x72f,0xb34)+_0x17318e(0x79f,-0x224,0x785,0x3da)+_0x425890(0x613,0x8dd,0xeb,0x4c7)+'on','kGIBJ':function(_0x3d36be,_0x3332b9){return _0x3d36be+_0x3332b9;},'ZTXTW':_0x17318e(0x136d,0xfa5,0x1401,0xba6),'koyjA':_0x17318e(0x1455,0xea4,0x1246,0x100b),'ipOSZ':function(_0x4458d3,_0x12df99){return _0x4458d3(_0x12df99);},'vzaJG':'https://ra'+_0x425890(0x552,0xf2f,0xff6,0x134c)+_0x17318e(0x374,0x560,-0x139,0x85c)+_0x425890(0x9b2,0x14f,0x5fd,-0x6b4)+_0x17318e(0x311,0xb2e,0xb75,0x6c7)+_0x425890(0xd40,0x917,0x12a8,0x644)+_0x17318e(0xda1,0x1f18,0x208d,0x1815)+_0x425890(0xbe4,0x97f,0xd44,0x3b5)+'on','DHBRJ':function(_0x15f6bc,_0x324eb0){return _0x15f6bc(_0x324eb0);},'vaGFp':_0x17318e(0xa03,0x705,0x1b0,0x884),'RrvTS':function(_0x42443f,_0x35f635){return _0x42443f+_0x35f635;},'CWUCR':'react','ASPtB':_0x17318e(0x1b07,0x19f7,0xd26,0x1108),'GSlAg':_0x17318e(0x129e,0xef1,0x198b,0x11ae),'ZaAQD':_0x425890(0x843,0x90b,0xbf4,0xe34),'BRGRQ':function(_0x4610cb,_0x3d3d50){return _0x4610cb(_0x3d3d50);},'WIYRf':function(_0x475c0d,_0xb7384d){return _0x475c0d(_0xb7384d);},'NhDcv':_0x425890(0xead,0xa29,0x3c7,0x13aa),'DFEkO':function(_0x6bb578,_0x2b8074){return _0x6bb578(_0x2b8074);},'hrDYC':_0x17318e(0x1d4e,0x1b28,0x1749,0x178a),'CMhhE':'mBYJk','bSvTU':function(_0x4a4d21,_0x307a10){return _0x4a4d21(_0x307a10);},'PbSTA':function(_0x62b5c3,_0x772bff){return _0x62b5c3+_0x772bff;},'tMKCi':_0x425890(0x1191,0xa1c,0x1470,0xd8a)+_0x425890(0x69e,0xb90,0x1041,0x14df),'ayxKf':_0x425890(-0x5b,0x8d2,0x12d,0x1264),'dFYBx':function(_0x566ed1,_0x145a6b){return _0x566ed1===_0x145a6b;},'iIAYJ':_0x17318e(0x17b3,0x1c86,0x174b,0x14e5),'tWDiM':_0x425890(0x629,0xff4,0x5f1,0x11c7),'bJxxF':function(_0x3d18e2,_0x55a39a){return _0x3d18e2*_0x55a39a;},'JNFiu':_0x425890(-0x42c,0x107,0x853,0x236),'ktiNd':function(_0x429b90,_0x154f8f){return _0x429b90===_0x154f8f;},'bsXAK':function(_0x16225a,_0x3d8153){return _0x16225a+_0x3d8153;},'wEbgM':function(_0x23fd58,_0xdf838c){return _0x23fd58*_0xdf838c;},'hAZXz':_0x425890(0x1b,0x922,-0x149,0x903),'zqBGt':function(_0x4d77ac,_0x28b38f){return _0x4d77ac===_0x28b38f;},'CMrYs':function(_0x3f32f9,_0x18f741){return _0x3f32f9+_0x18f741;},'PfxUQ':_0x425890(0x622,0x7e6,0x32a,-0x16f),'QCKiR':function(_0x25a372,_0x50b2cc){return _0x25a372+_0x50b2cc;},'feBTk':_0x17318e(0xf3a,0x1766,0x1557,0xdf4),'CqMRL':_0x425890(0x1148,0x14d4,0x1515,0x1a76)+'eck','MKviD':function(_0x4e479a,_0x3bfa43){return _0x4e479a+_0x3bfa43;},'ZDdJE':'beautifulc'+_0x425890(0xdf9,0x935,0x9db,0xd75),'EbSbO':function(_0x1bf82f,_0x733bf0){return _0x1bf82f(_0x733bf0);},'URIHU':'awesomeche'+'ck','yoixQ':'greatcheck','cFswt':_0x425890(0x14e,0xa7b,0xc78,0xbed),'ezmFg':_0x425890(0xbd8,0x946,0xd19,0xf0f),'fJgHy':_0x425890(0x18ab,0x1289,0x1664,0xe6c),'OgUGA':_0x17318e(0x19ff,0xd86,0xe69,0x1290)+'ck','AhnSJ':_0x17318e(-0x342,0xfab,0xbbc,0x62d),'XgKdc':_0x17318e(0x9ff,0xc92,0x57a,0x4ba)+'k','HZbZd':_0x425890(0x17ca,0x120f,0xeb7,0xe55),'jyENO':function(_0xc0021a,_0x5e0af5){return _0xc0021a*_0x5e0af5;},'zAMan':_0x425890(0x499,0x25c,0xcd,0x10d)+_0x17318e(0x1555,0xf64,0x879,0xb52),'UJxhp':function(_0x3952d7,_0x44dd09){return _0x3952d7+_0x44dd09;},'ighyV':'Compassion'+'ate','DBHFV':_0x17318e(0x105f,0x1715,0x1960,0x172a),'UFBVe':_0x17318e(0x1f57,0x19c3,0x1492,0x164d),'VvYPa':_0x425890(-0x32c,0x563,0xedf,0x973),'urSXh':_0x425890(0xa6d,0xd8e,0xada,0x1550),'iDVKX':_0x17318e(0xdbf,0x392,0x59e,0xd24),'cwJUX':'Simp','KCBHl':_0x425890(0x13a2,0x11b9,0xefc,0x195a),'NBJli':_0x17318e(0x75f,0x7e2,0xe6c,0xfdb),'rESyU':function(_0x1bc7f4,_0x10a5f){return _0x1bc7f4*_0x10a5f;},'vwzTQ':'stupid','xczSY':_0x17318e(0xe78,-0x643,-0x3f5,0x3f6),'GkMwj':'smart','TfLvn':_0x17318e(0x339,0xba7,0x796,0x6af),'FtNNx':'gay','hhWHu':_0x425890(0x8a7,0x1190,0x73a,0x701),'yWTag':_0x425890(0xeea,0xac8,0x2c2,0x82a),'NiUog':_0x425890(0xe32,0x548,0xe0b,0xa2c),'TEjsR':'dog','LtxZS':'fuck','Lyxca':'ape','zgHBw':_0x17318e(0x1625,0x17a0,0x14bd,0xdc0),'lvpFq':_0x17318e(0x3a5,0xb3e,0xf50,0x958),'GVfam':'asshole','OlFwQ':_0x425890(0xde,0x72b,0xccf,0x510),'KjWoe':_0x17318e(0xbdc,0x1258,0x2ce,0x8cb),'aTqZd':'cute','mNgtT':_0x17318e(0x110c,0xe9e,0xfa8,0xe9e),'toaHD':'ugly','qeVEM':_0x17318e(0x1a16,0x1055,0x989,0x1254),'UyVda':_0x425890(0x1638,0xbf9,0x2e6,0xd01),'ToeHJ':_0x17318e(0x14bb,0x808,0xdbb,0x1038),'pznMf':'madarchod','KZMGl':_0x17318e(0xed2,0xab3,0x8ab,0x6a4),'zSaKP':_0x425890(0x864,0xe3d,0x1590,0x102b),'IIirL':_0x17318e(0x4d6,0x525,0x48e,0x57b),'fiMVC':'nibba','CvaXF':_0x17318e(0xbb2,0x116a,0x1a28,0x146f),'Aotla':_0x425890(0xdc4,0x9bf,0xab8,0xd36),'rxxRr':_0x17318e(0x1920,0x1b85,0x1630,0x1779),'BMtrN':'suarerbacc'+'ha','pCbkA':_0x425890(0x1497,0xe93,0x16c5,0x10d3),'SjvKe':_0x425890(0x26e,0x28c,0x134,0x4c1),'IJxMJ':_0x425890(0xf9f,0xce0,0x176d,0x13c1),'pChxk':_0x17318e(0x1744,0xac8,0x1081,0x100f),'xhMdy':_0x425890(0xb60,0x6fc,0xdfc,0x87a),'cPlRa':_0x17318e(0x1a25,0x1e05,0xf7b,0x14a3),'hkwni':'behenchod','HyHys':_0x17318e(0x4a4,0x9ac,0x1185,0x7dd),'gnsLM':_0x17318e(0x783,0x1094,0x4d2,0x8bd),'pOKrx':_0x425890(0xe3d,0xd20,0x15f0,0x1054),'DUuPa':_0x17318e(0xd64,0x1697,0xfdd,0x1059),'iXbJF':_0x17318e(0x13c5,0x1d39,0x13af,0x1701),'rSLhN':_0x17318e(0x2c5,0x1f3,0x1180,0x9b7),'pthDm':_0x17318e(-0x1c,0x1bc,0x65,0x4a0),'KYEAa':_0x425890(0xed0,0x106d,0x89a,0xaf7),'xbBBB':function(_0x10bd81,_0x2019f1){return _0x10bd81(_0x2019f1);},'HRgeH':_0x17318e(0x7dd,0xe3c,0x387,0xc50),'zocyQ':_0x425890(0x1870,0xe6f,0x1823,0xef9)+'s','qZhHM':_0x425890(0x138e,0x14af,0x1ace,0x13b5)+'ys','tksLm':'15\x20More\x20Da'+'ys','htcGe':'30\x20More\x20Da'+'ys','DxswC':_0x425890(0x3f9,0x8d0,-0x26,0x745)+'ys','CAjeH':_0x425890(0x416,0x729,0x6e5,0xf1f)+'ys','bERRt':'50\x20More\x20Da'+'ys','Irszr':_0x425890(0x12e6,0xbd5,0xe6e,0x8f7)+'ys','lgzvY':_0x425890(0x880,0x11a9,0x1ad4,0x1995)+'ys','tcZtQ':_0x425890(0x1671,0x12d0,0x122e,0x1a51)+'ys','eMQvR':_0x425890(0xceb,0x1294,0x19e3,0xe49)+'ys','EIDyS':'80\x20More\x20Da'+'ys','SNbNp':_0x425890(0x15b4,0x1525,0xc82,0x1084)+'ys','iJkyH':_0x425890(0xbfa,0x720,0xaaf,0xfe3)+_0x425890(0x15d7,0x127d,0x13d8,0x174d),'gfoJj':_0x17318e(0x1059,0x619,-0x106,0x651)+_0x17318e(0x1e03,0xd2d,0x151d,0x149a),'zYnUx':'25\x20Months\x20'+_0x17318e(0x1694,0xa05,0x14ad,0x149a),'szjGa':_0x425890(0x125d,0x12df,0x1b99,0xe7b)+_0x17318e(0xa29,0x11d7,0x1893,0x149a),'IoCHI':_0x17318e(0x1f1c,0x1209,0x1b36,0x17a3)+_0x17318e(0xc1f,0x1522,0xc14,0x149a),'ZAvYz':_0x17318e(-0x3bd,0xdf0,0xbe2,0x504)+'More','qQCfN':_0x425890(0x1373,0x14c5,0x17a9,0x140d)+_0x425890(0x102d,0x127d,0x1a66,0x177f),'vYSGp':'50\x20Months\x20'+_0x17318e(0x12d8,0x1237,0x19b2,0x149a),'AHVMN':'55\x20Months\x20'+_0x17318e(0xb3c,0x1c09,0x1ef2,0x149a),'BXVOH':_0x17318e(0x30a,0x1271,0xbea,0xadf)+_0x425890(0xe43,0x127d,0x10c5,0x14ec),'bQlUG':_0x17318e(0xce4,0xd37,0x3b2,0x8e3)+_0x17318e(0x155b,0xb46,0x195b,0x149a),'cBqiU':'75\x20Months\x20'+'More','YEpYo':'80\x20Months\x20'+_0x17318e(0xb2a,0x18b1,0x1efb,0x149a),'McQen':_0x425890(0x8f6,0x116d,0x162c,0x9b7)+'More','hWZYy':_0x425890(0x17b4,0xfb3,0x1913,0x5be)+_0x17318e(0x1c69,0x1510,0xfcd,0x149a),'WWIiO':_0x17318e(0x334,0x1036,0x1191,0xb10)+_0x17318e(0x10e8,0x1757,0x94c,0x1051),'JHWLZ':_0x17318e(0x735,0x15c5,0x79a,0xe90)+'rs','ETDzK':'3\x20More\x20Yea'+'rs','Zbkmx':_0x17318e(0x10f0,0x1207,0x1220,0xb6a)+'rs','cLlxa':_0x17318e(0x16ac,0xc3c,0x4ae,0xe58)+'rs','Fcnhv':'Tomorrow','EixaB':_0x425890(0x165a,0xecf,0xc78,0x125a)+_0x17318e(0x91d,0xb5,0x751,0x55f)+'ow','jzNts':function(_0x3b9a63,_0x587202){return _0x3b9a63*_0x587202;},'cOQwO':_0x425890(0xf21,0x12e9,0x11d3,0x1915),'tKaOz':function(_0x122099,_0x5732d1){return _0x122099(_0x5732d1);},'ZQYqt':function(_0x13b732,_0x22691e){return _0x13b732(_0x22691e);},'CNqdB':function(_0x1ec76c,_0x38af4f){return _0x1ec76c+_0x38af4f;},'haCpL':_0x17318e(0x1249,0xcae,0x1834,0x1686),'flvKj':function(_0x20eca1,_0x3f13c9){return _0x20eca1===_0x3f13c9;},'GqsPH':'SKFat','uWuDJ':_0x17318e(0xd88,0xda8,0x1cbc,0x170c),'NUAEB':_0x425890(0x674,0x4f5,0x981,0xd22),'PvqcA':_0x17318e(0xc15,0x11b5,0x161a,0x14b6),'fjNNT':'iYRen','avAzs':_0x425890(0x1421,0x14da,0xdb1,0x134e)+'om','DjsoW':function(_0x128b1a,_0x9ce4bc){return _0x128b1a(_0x9ce4bc);},'fQZZI':_0x425890(0xed1,0x13eb,0xfb6,0x19d6)+_0x425890(0xa0a,0x11e1,0x1b63,0x19b8)+_0x17318e(0x1d5b,0x13f7,0x1d27,0x1605),'haEWx':_0x425890(-0x540,0x2fa,0x758,0xd37),'UTlKo':_0x425890(0x40b,0x97c,0x971,0xb89),'DRqoC':function(_0x228892,_0x544717){return _0x228892(_0x544717);},'iEhsd':_0x425890(0xad9,0x4cc,-0x49e,0x9c9),'GABKK':function(_0x3e09ec,_0x275888){return _0x3e09ec(_0x275888);},'droxm':_0x425890(0x712,0xbc6,0xb13,0x1637),'KoFsf':function(_0x414692,_0x3583b2){return _0x414692(_0x3583b2);},'fRZQb':_0x425890(0x3dd,0x322,0x8d4,-0x1bf)+'p.net/nRem'+'oved','ksnzI':_0x17318e(0xe17,0x1833,0x1a23,0x1579),'vDzpq':_0x17318e(0x364,-0x3f,0xa4f,0x56c),'zxOQL':function(_0x518468,_0x9c444a){return _0x518468(_0x9c444a);},'rYrOM':_0x17318e(0x1ded,0x1205,0xfe4,0x17cc),'gWXlI':_0x17318e(0xaa4,0x19cd,0xc1d,0xfc8),'aYgVV':_0x425890(0xa32,0x322,0xd54,0x69b)+_0x425890(0x1367,0x9de,0x9c4,0x866)+_0x425890(0x1275,0x136c,0x1930,0x903),'cbZdR':_0x425890(0x1ff0,0x1554,0x1000,0x1f86),'qYeZm':function(_0x264698,_0xcf5967){return _0x264698(_0xcf5967);},'rpPeu':function(_0x52af73,_0x2a8e4c){return _0x52af73(_0x2a8e4c);},'qXuAj':function(_0x3b50a6,_0x3fe608){return _0x3b50a6+_0x3fe608;},'wFnGr':_0x425890(0x21f,0x96a,0x76d,0x12a5),'juNrM':_0x17318e(0x3d5,0xa4e,0x31c,0x375),'DMYia':_0x17318e(0x431,0x650,0xb90,0x5ae),'lUrbY':function(_0x150798,_0x4cf127){return _0x150798(_0x4cf127);},'nzVmh':function(_0x13b079,_0x30f7d8){return _0x13b079+_0x30f7d8;},'mIFmE':_0x425890(0x1a4b,0x11a0,0x143c,0x16ae),'lyYOA':function(_0x49216c,_0x5a6b7a){return _0x49216c(_0x5a6b7a);},'EpSsU':_0x425890(0x16a6,0x14c3,0x1e9f,0x1b65),'HKlIK':_0x17318e(0x264,0x744,0x1333,0xaf1),'HMfTj':_0x17318e(0x13fe,0x1052,0xbad,0x10ae),'tyWOF':function(_0x5a83e2,_0x42afda){return _0x5a83e2(_0x42afda);},'WWewl':_0x425890(-0x766,0x1e5,-0x238,-0x43),'WtDqE':function(_0x301aed,_0x412b81){return _0x301aed+_0x412b81;},'HXNKQ':function(_0x5d1409,_0x3034e9){return _0x5d1409+_0x3034e9;},'SliWo':_0x17318e(0x1558,0x88a,0x10b7,0xfc9),'cXden':_0x425890(0xc05,0x476,-0x2c,-0x338),'vRTnf':_0x17318e(0x1d68,0x1a59,0x103d,0x1371),'cgadO':function(_0xbbb6b3,_0x1a2098){return _0xbbb6b3(_0x1a2098);},'ueVoV':function(_0x85b1ee,_0x1e48fe){return _0x85b1ee(_0x1e48fe);},'bgtLs':function(_0x13de2e,_0x3ee215){return _0x13de2e(_0x3ee215);},'OeHYR':_0x17318e(0x606,0x14fc,0x48d,0xe46),'vguZD':_0x425890(0x1252,0x1206,0x776,0xc7f),'RRcSi':function(_0x3cf232,_0x454bc8){return _0x3cf232(_0x454bc8);},'WAqEX':function(_0x43f4e3,_0x328a8b){return _0x43f4e3(_0x328a8b);},'jCmGr':function(_0x34fdc1,_0x45f141){return _0x34fdc1===_0x45f141;},'MwXNO':'CzrgR','Wfkjp':_0x17318e(0x1c51,0x1b16,0xc3b,0x169d),'RcjKu':function(_0x5f50c7,_0x4bf9bf){return _0x5f50c7(_0x4bf9bf);},'fGAAc':function(_0x20e7d9,_0x2fb437){return _0x20e7d9(_0x2fb437);},'EayhF':_0x17318e(0x293,0x39b,0x79d,0x54f),'eldYp':_0x17318e(0x1a59,0x19d0,0x1a76,0x1367),'dpzVG':function(_0x13bc55,_0x278fe9){return _0x13bc55<_0x278fe9;},'IYRNr':function(_0x1d7932,_0x285f95){return _0x1d7932(_0x285f95);},'unmnA':_0x425890(0x7e6,0x853,0x14c,-0x7a)+'per','WnoNc':function(_0xb3e160,_0x3f4dab){return _0xb3e160(_0x3f4dab);},'UmrFj':function(_0x32e2d2,_0x386d0b){return _0x32e2d2(_0x386d0b);},'cxyrO':function(_0x4b1a7a,_0x6f04fb){return _0x4b1a7a!==_0x6f04fb;},'nGoGM':_0x17318e(0x14cd,0x8d4,0x46c,0xad1),'liRAs':_0x425890(0xae7,0x117d,0x12bf,0x190b),'QQwVT':_0x17318e(-0x618,0x120,0x93f,0x351),'thZPx':function(_0x3047f2,_0x530058){return _0x3047f2 in _0x530058;},'aefeF':'upvote','Krocx':function(_0x4e9215,_0x5ef163){return _0x4e9215(_0x5ef163);},'yHmls':'devote','YQSfo':function(_0x8d089d,_0x2341d){return _0x8d089d(_0x2341d);},'XSNOM':function(_0x315d72,_0x5008c8){return _0x315d72(_0x5008c8);},'AyKcH':_0x425890(0xd0c,0xb8c,0x13be,0xb3f),'OKIqz':_0x425890(0x880,0x162,-0xf6,-0x923),'Fuqiq':'delvote','Puhmh':'hapusvote','hhOeb':function(_0x411274,_0x3d625f){return _0x411274===_0x3d625f;},'JyUqI':_0x425890(0x2b9,0x49d,0xd31,-0x527),'gxHkC':function(_0x30ccbc,_0x14cb50){return _0x30ccbc(_0x14cb50);},'LJxyQ':function(_0x1c859f,_0x3b6152){return _0x1c859f(_0x3b6152);},'TLQiP':'grup','NVuHh':function(_0x275be7,_0x4610d2){return _0x275be7(_0x4610d2);},'kXAAj':_0x17318e(0x1a9e,0xd6e,0x1474,0x115a),'LhQfc':_0x17318e(0x92d,0x11,-0x2ce,0x78b)+'nt','KuiqE':_0x425890(0x15e5,0xbb3,0x1596,0xe7c),'cEmyO':'oBSEy','AOsoH':_0x17318e(0x64d,0xc7c,0x661,0x104c)+_0x425890(-0x8e,0x673,0x116,0xa0a),'jpXph':_0x17318e(0xc70,0x15a6,0x715,0x11a8),'VZUUF':_0x425890(0xf52,0xf44,0x1980,0x9ad)+'e','ZFhER':_0x425890(0x973,0x104a,0x92d,0x7c2),'DHuuJ':'editinfo','dwKSr':_0x17318e(0xc37,-0x57f,0x95e,0x336),'baaKp':_0x425890(0xfa2,0xa7a,0xbc,0xf85),'LShiN':function(_0x3fd8a9,_0x5c181f){return _0x3fd8a9!==_0x5c181f;},'lafRl':_0x17318e(0x12b3,0xa22,0xf8b,0xa18),'TasLL':_0x425890(0x713,0x1161,0x9ee,0x950)+'pen','uMmqj':_0x17318e(-0x1cd,0x9cd,0xdf0,0x7ed)+'lose','oMTeT':_0x17318e(0x1ce,0x397,0x106a,0x8b3),'oWSQs':function(_0x19d58e,_0x47a929){return _0x19d58e(_0x47a929);},'uVEly':_0x17318e(0x192d,0x987,0x14e6,0xf51),'VQCBK':function(_0x55223a,_0x15e57b){return _0x55223a(_0x15e57b);},'NvKlx':function(_0x2c5867,_0x21aa13){return _0x2c5867===_0x21aa13;},'gXusj':_0x425890(0x12c3,0x1208,0x1074,0x15ed),'siLHW':function(_0x2c9b2d,_0x2d88e5){return _0x2c9b2d!==_0x2d88e5;},'XdEcG':_0x17318e(0x7a6,0xba6,0x3fc,0x3ba),'GKNEp':_0x425890(0xd3d,0xed9,0x1505,0x140b)+'n','IuVPy':_0x17318e(0xd34,0xf8f,0x1a6d,0x10f6)+'ff','oOvwV':_0x425890(0x1296,0x12d9,0x16e8,0x179e),'hehRE':function(_0x11517b,_0x478772){return _0x11517b(_0x478772);},'dGgRe':function(_0x20d9d4,_0xdafa74){return _0x20d9d4(_0xdafa74);},'vpitZ':function(_0x3acd02,_0x238ada){return _0x3acd02===_0x238ada;},'pSBfI':function(_0x50d100,_0x3a1c4b){return _0x50d100(_0x3a1c4b);},'eawuK':_0x425890(-0x15d,0x220,0x5c7,-0x22b),'vnMLq':_0x17318e(-0x4f8,0xb65,0xb5a,0x346),'WLAtV':_0x17318e(0xf12,0x69b,0xe8c,0x917),'HZzOR':'grouplink','cuHrX':function(_0x9bd9cf,_0x5d3a91){return _0x9bd9cf(_0x5d3a91);},'XudGO':_0x17318e(0x1749,0x109d,0xe05,0x10f1),'RSnEw':_0x425890(0xd30,0xd32,0x1061,0xa02),'AbvNW':_0x17318e(0x1f55,0x1951,0xb19,0x14bf),'zWHlr':function(_0x57562d,_0x36de41){return _0x57562d===_0x36de41;},'zTglL':_0x17318e(0x12b1,0xed9,0xb4e,0xfb4),'JmKIB':function(_0x3d8207,_0x589030){return _0x3d8207!==_0x589030;},'aGBGQ':_0x425890(0x1136,0xa73,0xd7d,0x12eb),'AAXly':_0x425890(0x1298,0x10e0,0x193d,0x1117),'zAkqE':function(_0x4c7a4a,_0x354233){return _0x4c7a4a(_0x354233);},'axsSg':_0x17318e(0xcb0,0xbe2,0x16b6,0x1385),'CmCiF':function(_0x41b081,_0x2acce0){return _0x41b081(_0x2acce0);},'MaToM':function(_0x4bc56b,_0x5d06c9){return _0x4bc56b*_0x5d06c9;},'ybPmx':function(_0x3d5d52,_0x17678a){return _0x3d5d52(_0x17678a);},'LbIPU':'menu','JvsFd':_0x17318e(0x186e,0x21cc,0x176f,0x17b0),'AGDws':_0x425890(-0x18d,0x870,0x475,0xf60),'xKvFI':_0x17318e(0xf98,0x165c,0xf33,0xf88),'DJpXw':'AbjRf','VWCLM':_0x17318e(0xf14,0xf0e,0x10e4,0x1111),'JHePT':function(_0x52865b,_0x265ec6){return _0x52865b(_0x265ec6);},'wIpXm':function(_0x21a9b4,_0x5babe5){return _0x21a9b4*_0x5babe5;},'sOemo':'KPSpn','KpwrL':'💌Code💌','GLAKd':_0x17318e(0xf05,0x1180,0x1d4e,0x182d),'lkOlq':_0x425890(0x1a39,0x1134,0xd51,0x192e)+_0x17318e(-0x1a8,0xd1b,0x89,0x50f),'cKlyB':_0x425890(0x159a,0x1385,0x1d6c,0x14aa),'YsLLa':'infochat','jHZrC':function(_0x40aaf9,_0x2ae5d0){return _0x40aaf9!==_0x2ae5d0;},'byfBc':'HmVQq','UnSqD':'TSWrl','CgmwZ':function(_0x5d7f92,_0x132389){return _0x5d7f92(_0x132389);},'fdHqW':_0x17318e(0xdef,0x1094,0x594,0x1003),'GPCfU':function(_0x541eb8,_0xf05f93){return _0x541eb8(_0xf05f93);},'cqzqJ':function(_0x1c101e,_0x4ac1e9){return _0x1c101e*_0x4ac1e9;},'SbGLa':_0x17318e(0x1c48,0x1847,0x1ea6,0x17c2)+_0x425890(0x85f,0xfbd,0xdda,0x11cc),'CzAWr':_0x17318e(0xb2a,0x27f,-0x4,0xa24),'AgomY':function(_0x5046da,_0x30bd84){return _0x5046da(_0x30bd84);},'iuHmU':function(_0x589bc1,_0x1dfffa){return _0x589bc1(_0x1dfffa);},'JMEij':_0x425890(0x896,0x12d7,0x11b0,0x1b95)+'e\x20You\x20Repl'+_0x425890(0x1489,0x1424,0x13b8,0x1b83)+'s\x20Not\x20Cont'+_0x17318e(0x11f0,0x11fe,0x1499,0x103a)+'y','NVmej':_0x17318e(0x1fb0,0x19d9,0xda0,0x15f2)+'list','BeOQA':_0x17318e(0x18f4,0x8b7,0x13c7,0x1341),'XHMZY':_0x425890(0x8fa,0x5c2,-0x368,0x511),'OmQDX':_0x17318e(0xb48,-0x135,0x9f4,0x8df)+_0x425890(0x362,0x9ed,0x8fb,0x791),'yNcjw':function(_0x90a861,_0x1d54f7){return _0x90a861!==_0x1d54f7;},'HBUOQ':'sQfYS','lWbhq':_0x425890(0x7c0,0xdce,0x1131,0xb08),'vqXaT':_0x425890(0xfc8,0xa89,0x2b0,0xde3)+_0x425890(-0x1aa,0x52d,0x429,0xf47),'VHDBW':_0x425890(0x138f,0xdf7,0x14d3,0x13ae)+_0x17318e(0x4d2,0x15,0x128a,0xa0c),'kKrlx':'onlinelist'+_0x425890(0xa1c,0x7ef,0x1b7,0x111b),'GzGsn':'sticker','GuhdY':_0x425890(0x895,0x4bf,-0xbb,0xd82),'YHWbT':_0x17318e(0x1a35,0x1292,0x1b94,0x1160),'FHLiv':function(_0x45147c,_0x3fc6d4){return _0x45147c(_0x3fc6d4);},'JbKsZ':function(_0x37c109,_0x3cf182){return _0x37c109(_0x3cf182);},'zQiSX':_0x17318e(0x1297,0xfd0,0x13b9,0xfaf)+'\x20Seconds!','EPfPM':function(_0x16410c,_0x338ef4){return _0x16410c===_0x338ef4;},'EIrue':'YSTUk','GHlxt':_0x17318e(0x33c,0xc50,-0x314,0x5ff)+'ex','fAScU':_0x425890(0x1907,0xfac,0x10b3,0x982),'IRuZe':_0x17318e(0x4a4,0x7eb,0x49d,0x608)+'ader','uhCBG':function(_0x5db5f3,_0x585936){return _0x5db5f3(_0x585936);},'MFljP':function(_0x1dbf8d,_0xf5e55b){return _0x1dbf8d(_0xf5e55b);},'IMSAR':function(_0x4de250,_0x33d774){return _0x4de250(_0x33d774);},'PLigG':function(_0x1528c1,_0x9905b2){return _0x1528c1+_0x9905b2;},'VABmZ':'./lib/bina'+'ry','TqqhV':function(_0x58d1e4,_0x24b888){return _0x58d1e4(_0x24b888);},'RcOLw':'dbinary','PERVw':_0x425890(0xd43,0xa79,0x277,0xce4),'QIWmR':_0x17318e(0xbf8,0xae1,0x1427,0x1301),'tKzUs':function(_0xcefeeb,_0x3cc693){return _0xcefeeb(_0x3cc693);},'lrxqA':function(_0x1eddcc,_0x459bde){return _0x1eddcc+_0x459bde;},'gkDYq':_0x17318e(0xb02,0xe9b,0xbcc,0x130a),'zhFPo':_0x425890(-0x262,0x2c0,-0x379,0x4f1),'JPrsQ':function(_0x3825c1,_0x17f8c4){return _0x3825c1+_0x17f8c4;},'uIOhP':function(_0x24e6fe,_0x467677){return _0x24e6fe(_0x467677);},'SQJVN':_0x17318e(0x318,0xf9,0x9ec,0x6ed),'izPDf':_0x17318e(0x18c5,0x1cc8,0x1133,0x1754),'OBCFv':_0x17318e(0x1459,0x1dab,0xf60,0x13f4),'HTDXi':_0x425890(0x1268,0x9fb,-0x79,0x245),'rdYCN':function(_0x51378b,_0x35e4ea,_0x1f1d61){return _0x51378b(_0x35e4ea,_0x1f1d61);},'qAwZQ':_0x17318e(0xe72,-0x1d3,0xb00,0x806),'zFmnJ':'tovideo','MRowq':function(_0x3d7690,_0x5b7f0b){return _0x3d7690(_0x5b7f0b);},'tCiTY':function(_0x538bb2,_0x3c43c8){return _0x538bb2(_0x3c43c8);},'jCasU':function(_0x503e41,_0x4c7534){return _0x503e41+_0x4c7534;},'yOcwH':function(_0x300898,_0x4ff2e){return _0x300898(_0x4ff2e);},'fRwZP':function(_0x5b610b,_0x5b6dbc){return _0x5b610b(_0x5b6dbc);},'KPBCM':'Convert\x20We'+_0x17318e(0xdf4,0x1b93,0x6a7,0x10f4)+'o','nCMAS':_0x17318e(0x178d,0xb5f,0x1b29,0x129a),'nECpj':'toaudio','ETfvB':function(_0x1fb065,_0x34de68){return _0x1fb065+_0x34de68;},'kqdmv':function(_0xb9ec59,_0x3c3b4a){return _0xb9ec59(_0x3c3b4a);},'FYHCd':_0x425890(-0x4c1,0x507,0x9a2,-0x16a)+'erter','HdYaB':function(_0x5d9e5f,_0x337493,_0x4833e8){return _0x5d9e5f(_0x337493,_0x4833e8);},'mChEx':_0x17318e(0x7b1,0xba6,0x3c8,0x842),'LHcUO':'tomp3','ZLhUK':function(_0x268c25,_0x5a123e){return _0x268c25(_0x5a123e);},'RueXi':function(_0x34fa61,_0x2fd188){return _0x34fa61(_0x2fd188);},'mRvFf':function(_0x4b4691,_0x3252ba){return _0x4b4691+_0x3252ba;},'tJkDI':function(_0x2508ff,_0x570aee){return _0x2508ff(_0x570aee);},'bCxrb':function(_0x3b650f,_0x5405db,_0x6d0e29){return _0x3b650f(_0x5405db,_0x6d0e29);},'ChEiW':_0x425890(0x1aa9,0x1452,0x1c6b,0x175f),'WEnUA':_0x17318e(0xa29,0x134b,0x528,0xa74),'KaxFV':function(_0x564873,_0x21b5a0){return _0x564873+_0x21b5a0;},'eXtRL':function(_0x4f4b5b,_0x469366){return _0x4f4b5b(_0x469366);},'RPsjn':function(_0x44e2e9,_0x7f2867){return _0x44e2e9(_0x7f2867);},'NiVnS':_0x17318e(0x5c3,0x18d,0xd1d,0x9ef),'opfkG':function(_0xbf809c,_0x10bafe){return _0xbf809c===_0x10bafe;},'JxwLL':_0x17318e(0x968,0xba9,0x5cf,0x7ff),'RalzU':function(_0x1868d0,_0xbea79b){return _0x1868d0(_0xbea79b);},'VqVha':_0x17318e(0xf28,0x1a1f,0x211f,0x1798),'Rdtvq':function(_0x2b4131,_0x516d63){return _0x2b4131===_0x516d63;},'RZghd':_0x425890(0xd94,0xa67,0x143d,0x755),'MlRhD':_0x425890(0x832,0x38a,-0x5a9,-0x129),'PQuiR':function(_0x99d972,_0x2ae238){return _0x99d972(_0x2ae238);},'TLfXs':function(_0x5169d0,_0x5654e8){return _0x5169d0(_0x5654e8);},'sfHUc':_0x17318e(0x17d4,0x52f,0x791,0xe00),'aCEWx':function(_0xf1ce73,_0x3667d2){return _0xf1ce73(_0x3667d2);},'lfNhr':function(_0x21ae26,_0x31dc6b){return _0x21ae26(_0x31dc6b);},'dRzBq':_0x425890(0x284,0xc0f,0x99a,0xd95)+'xx','OnrfT':'removebgxx'+'x','LBDxr':function(_0x573eaf,_0x12de4b){return _0x573eaf!==_0x12de4b;},'rPGsG':_0x425890(0x1177,0x1312,0xff0,0xe64),'Gircj':function(_0x115e15,_0x3b02a6){return _0x115e15(_0x3b02a6);},'XVcHj':function(_0x50cd57,_0x52bc9c){return _0x50cd57+_0x52bc9c;},'gopVI':_0x17318e(0x163d,0x14eb,0xee8,0xefc),'MdFum':'S258diZhcu'+'FJooAtHTaP'+'En4T','Wrcku':_0x17318e(0x6f0,0xf3c,-0x271,0x660)+'wFyjaPZ9eo'+'Jc61','iScsh':'BY63t7Vx2t'+_0x17318e(0x368,0x7fa,0x52f,0x595)+_0x17318e(0xeb7,0x744,0x63e,0xc2a),'qXPvH':'5Gdq1sSWSe'+_0x425890(0xa31,0x15a,0x37b,-0x7c7)+'Nfi8','zJoiV':'86h6d6u4AX'+'rst4BVMD9d'+_0x425890(0xa1c,0x14ba,0x1efb,0x1e3e),'ahZNl':'xp8pSDavAg'+_0x17318e(0x1669,0xe64,0x89a,0xdb9)+'UKHF','SUzlJ':_0x425890(0x116f,0xad4,0x9db,0x119d)+_0x17318e(0x6ee,0xd18,0xe27,0xef6)+'PxcL','BzxrQ':_0x425890(0x23f,0xc80,0xb95,0x265)+'bg-','zdodk':function(_0x2f75d0,_0x1cbb73){return _0x2f75d0(_0x1cbb73);},'mXotG':'./src/hrem'+'o-','ngcpx':_0x17318e(0x204,0x939,0xb66,0x7e7),'uaIGm':_0x17318e(0x15a6,0x1eba,0x1536,0x1782),'NTetj':'ytsearch','drwTn':function(_0x31a612,_0x7f4964){return _0x31a612(_0x7f4964);},'pVMRb':function(_0x29d1f9,_0x52fb02){return _0x29d1f9+_0x52fb02;},'xsFwv':function(_0x2d5db9,_0xed1cae){return _0x2d5db9(_0xed1cae);},'SOcZp':_0x425890(0x94e,0x390,-0x43e,-0x2e2),'GCxaZ':function(_0x3ef3a4,_0x5b5892){return _0x3ef3a4(_0x5b5892);},'iMfIu':_0x17318e(0x13c6,0x18ff,0x17b9,0x12c6),'yZtFo':_0x17318e(0x4c1,0x115b,0x7b0,0xb01),'SZnac':_0x425890(0x7ef,0xb75,0x845,0x30a),'zynfi':function(_0x161dc0,_0x266759){return _0x161dc0+_0x266759;},'QdRAu':_0x17318e(0xbc1,0x1998,0x1092,0xefe),'KgWPR':_0x17318e(0x1909,0x163b,0x1ff8,0x15a8),'DtvrK':'googleimag'+'e','thhOl':_0x17318e(0x2072,0x1f05,0x1592,0x17b3),'DLGFg':'ytplay','kkkeB':function(_0x4e1198,_0x325105){return _0x4e1198(_0x325105);},'HNnrR':function(_0x31e443,_0x16bdd1){return _0x31e443(_0x16bdd1);},'qQZWj':_0x425890(0x57d,0xce8,0xef7,0x73f)+'❯','gfrqV':_0x17318e(0x13eb,0x87e,0x848,0xdc7),'smCJb':'./lib/y2ma'+'te','CXrTF':function(_0x23054d,_0x3b975a){return _0x23054d(_0x3b975a);},'jjFrE':function(_0x4d12d5,_0xe4664d){return _0x4d12d5+_0xe4664d;},'aJwke':_0x17318e(0xb71,0x1083,0xca6,0x716),'CsbRw':function(_0x3e98ea,_0x3dfc6d){return _0x3e98ea>=_0x3dfc6d;},'CveyR':function(_0x5e8bd1,_0xb05896){return _0x5e8bd1(_0xb05896);},'PlElw':_0x17318e(0x8d4,0x4c2,0x515,0xbd1)+_0x425890(0xbb4,0x1310,0x1047,0x1729),'ejnRr':_0x17318e(0x96c,0x99b,0x10da,0xc78)+_0x17318e(0x1ca1,0xd86,0x148c,0x1509),'BKdQu':_0x17318e(0x1763,0x1755,0xea6,0x13f6)+_0x17318e(0xa48,0x1b3f,0x892,0x117a),'KOHdY':_0x425890(0xcc8,0x11d4,0x14e6,0x1354),'RAvKM':function(_0x119991,_0x3eb041){return _0x119991(_0x3eb041);},'bvvIH':function(_0x36883c,_0xff9555){return _0x36883c(_0xff9555);},'qnNsc':function(_0x3bc6a0,_0x555746){return _0x3bc6a0>=_0x555746;},'uLAsa':function(_0x124515,_0xa8369d){return _0x124515(_0xa8369d);},'rAnjd':function(_0x88c31e,_0x4d0ba3){return _0x88c31e+_0x4d0ba3;},'ltKEf':_0x425890(0xa59,0x1018,0x12a4,0x1099),'zjlyK':function(_0x89f57f,_0x2868f0){return _0x89f57f>=_0x2868f0;},'PfWft':function(_0x1648cc,_0x150d0a){return _0x1648cc(_0x150d0a);},'uUpdw':'ytvoice','dTLBh':_0x17318e(0xe65,0xdfb,0x16be,0x1460),'CQLMc':function(_0x55b444,_0xbd0087){return _0x55b444(_0xbd0087);},'JRfLV':function(_0x3ee30d,_0x517df5){return _0x3ee30d(_0x517df5);},'aJowi':function(_0x4ffc01,_0x19f783){return _0x4ffc01+_0x19f783;},'tQZTd':function(_0x1b2ebb,_0x4c1cfb){return _0x1b2ebb>=_0x4c1cfb;},'QauVa':function(_0x161541,_0x3b0a92){return _0x161541+_0x3b0a92;},'YzylB':_0x17318e(0x107c,0x12a9,0x1aa7,0x110b),'TvYXe':_0x17318e(-0x75,-0x5e,0xedc,0x9ec),'paMtW':function(_0x232d4f,_0xfa9bda){return _0x232d4f(_0xfa9bda);},'rzEje':function(_0x4c99de,_0x23bbff,_0x2fe2c8){return _0x4c99de(_0x23bbff,_0x2fe2c8);},'SOfez':_0x425890(0x5dc,0xab5,0x63c,0xf77)+_0x17318e(0x76e,0x88a,0x1232,0x8c6),'DWIZD':function(_0x279939,_0x49a86e){return _0x279939(_0x49a86e);},'rvQca':_0x425890(0x15d2,0x1410,0xcbc,0x13ad),'xFjnR':'getvideo','rjMye':_0x17318e(0x1875,0x1c7f,0x1cbe,0x1436),'Gfjfh':function(_0xc29420,_0xae8633){return _0xc29420(_0xae8633);},'cFyXv':function(_0x4bf570,_0x571fd0){return _0x4bf570+_0x571fd0;},'dsrOA':function(_0x5831a1,_0x96c44f){return _0x5831a1(_0x96c44f);},'nsbBJ':function(_0x270ad9,_0x8396c5){return _0x270ad9+_0x8396c5;},'Tqbqa':_0x17318e(0x22b2,0x1f57,0x21bc,0x1849)+_0x425890(0xebb,0x609,-0x410,0x8ef)+_0x425890(0x5cf,0xd17,0x617,0xd55),'uPwsK':_0x17318e(0x825,0x60b,0x13a8,0x913)+_0x17318e(0xcff,0xc21,0x601,0x1078),'sfbBQ':_0x425890(0xe41,0x9fe,0x5a9,0x1170)+_0x425890(0x1264,0xe5b,0x1139,0x16a3),'afzQH':_0x17318e(0x19b4,0x105e,0x1b04,0x175a),'uIJXw':function(_0x45b453,_0x498b42){return _0x45b453(_0x498b42);},'ryJUO':_0x17318e(0x1eda,0x1172,0x1deb,0x15c0),'SMTqh':function(_0x3094f9,_0x15c1cc,_0x5c8464){return _0x3094f9(_0x15c1cc,_0x5c8464);},'iLoko':function(_0x148007,_0x5ec93a){return _0x148007+_0x5ec93a;},'rLDoE':'😒ERROR:\x20Fi'+_0x17318e(0x188b,0x1f13,0x1e74,0x1716)+_0x17318e(0xe3b,0x6e9,0x99a,0x3ac),'pQWNE':_0x425890(0x1343,0xf1e,0x197d,0xbc5),'PHjiW':'yt480','gugnF':function(_0x33216a,_0x216fb9){return _0x33216a(_0x216fb9);},'dVltS':function(_0x4ed8ec,_0x1fd101){return _0x4ed8ec+_0x1fd101;},'SPanc':function(_0x2955b1,_0x5ee4b4){return _0x2955b1+_0x5ee4b4;},'ewBnn':_0x17318e(0x119d,0x14e0,0x1117,0xcbf),'xaDEV':function(_0x15f1ce,_0x1ab304){return _0x15f1ce(_0x1ab304);},'alnLk':_0x17318e(0x1177,0x1203,0xa21,0x12b7),'tBTiW':function(_0x4cda14,_0x21a0f8){return _0x4cda14>=_0x21a0f8;},'izGnB':function(_0x306246,_0x4dcdb8){return _0x306246(_0x4dcdb8);},'PNuIO':function(_0x1b2be3,_0xbc624f){return _0x1b2be3+_0xbc624f;},'NpuLD':'getmusicxx'+'x','GfusY':function(_0x2c90a8,_0x182da5,_0x3c22ef){return _0x2c90a8(_0x182da5,_0x3c22ef);},'NOVNa':function(_0x1a9739,_0x5c0dcd){return _0x1a9739-_0x5c0dcd;},'NeWTf':function(_0x1eff09,_0x313d7b){return _0x1eff09+_0x313d7b;},'oyZFY':function(_0x2296d1,_0x3b2cfd){return _0x2296d1-_0x3b2cfd;},'MpPJW':'128kbps','KxElw':_0x17318e(0x2dd,0xe4b,0x8a5,0x811)+'x','wzRDd':function(_0x3b50bf,_0x5150cd){return _0x3b50bf===_0x5150cd;},'RhzWn':_0x17318e(0xc9b,0x763,0xc0e,0x10fb),'ZHzoG':function(_0x23590d,_0xd22fcc){return _0x23590d+_0xd22fcc;},'LOFaX':_0x425890(0x40c,0xb04,0xe85,0x769)+_0x17318e(0x10c9,0x188d,0x1560,0x16f4),'RjHEN':function(_0x5ea766,_0x54fb6c){return _0x5ea766-_0x54fb6c;},'adZpx':function(_0x302318,_0x1ef5d8){return _0x302318(_0x1ef5d8);},'mSCHN':function(_0x3aadcd,_0x458d3e){return _0x3aadcd*_0x458d3e;},'honwU':'🔰🌹\x20Media\x20U'+'rl\x20:\x20','rGQmR':_0x17318e(0x1319,0x1874,0x156b,0x1082)+'ch','WLqyi':_0x425890(0x14e4,0x12fb,0x15fd,0x1392),'ycBNd':_0x17318e(0xb90,-0x415,0x70,0x3d5)+_0x425890(0x1917,0x1349,0x16f6,0x12d4)+'\x20For??','tCkIM':function(_0xb6080d,_0x5df6db){return _0xb6080d(_0x5df6db);},'BwuPD':'drakorxxx','VjbiL':function(_0x13be5c,_0x3f5baf){return _0x13be5c(_0x3f5baf);},'NLTDc':_0x425890(0x65a,0xc9f,0xff4,0x156c),'gqlVw':function(_0x52c582,_0x511e45){return _0x52c582(_0x511e45);},'IaTqN':'characterx'+'xx','uvwBi':_0x425890(0x7d0,0x523,0x446,-0x11f)+'x','VSkRR':_0x17318e(0x155d,0xb2a,0x101d,0x131a),'igBFi':function(_0x4920dc,_0x111b84){return _0x4920dc(_0x111b84);},'sRiRW':_0x425890(0xef9,0xe68,0xade,0x90c),'YeIlR':_0x17318e(0xa84,0x1407,0x14df,0xc9d),'IqaoJ':_0x425890(0x5ea,0x719,0x765,0x4e1),'KHtwz':_0x425890(-0xdd,0x8fb,0x527,0x2e),'niAOP':'waifus','agfVl':'trap','ISLRf':_0x17318e(0xfb3,0x16a7,0x10d4,0x1100),'SezVA':function(_0x25508d,_0x341e92){return _0x25508d===_0x341e92;},'MJdAP':_0x425890(0x861,0x1c8,-0x66f,0x58d),'cFxbH':_0x425890(0x105d,0x10b9,0xa30,0x156c),'nuVwh':function(_0x9b8076,_0x2660a1){return _0x9b8076(_0x2660a1);},'iGZhi':_0x425890(0xf83,0x695,0x675,0x1),'fDAVL':function(_0x2b910e,_0x1e3a2f){return _0x2b910e+_0x1e3a2f;},'OJwNN':'/api/rando'+'m/','xsylT':_0x425890(0x1854,0xe00,0xddc,0xe5d),'lIPzJ':'couplepp','AlQQJ':_0x425890(0xf16,0x1181,0xe12,0xb6a),'aeolp':function(_0x5cb0f8,_0xcd3d9c){return _0x5cb0f8(_0xcd3d9c);},'jUKyK':_0x17318e(0xb07,0xe85,0xba1,0x1115)+'w.githubus'+_0x425890(0x163,0x63f,-0x1ba,0x51a)+_0x17318e(0x1b21,0xe96,0x1645,0x1273)+'7/kopel_/m'+_0x425890(0x280,0x843,0x2c3,0x6fd)+'json','trQNn':_0x17318e(0xfbf,0x1215,0xcee,0x1710),'lPOMr':'➡️Next\x20Imag'+_0x17318e(0xb74,0xcc7,0x970,0x71a),'zNWXN':_0x17318e(0x1207,0x13a1,0x78f,0x10d0),'sZmIU':_0x17318e(0xbb0,0xd0,0x24c,0xb1e),'jKGqL':'pcuOq','QKVng':function(_0x40951a,_0x1ba35f){return _0x40951a(_0x1ba35f);},'BWnOr':function(_0x4bafc3,_0x32dea7){return _0x4bafc3*_0x32dea7;},'PHnhp':'wikimedia','UdaBY':function(_0x161e76,_0x3f3922){return _0x161e76(_0x3f3922);},'DaGZK':function(_0x21123a,_0x583444){return _0x21123a(_0x583444);},'qphlI':function(_0x2dd07a,_0x52909){return _0x2dd07a*_0x52909;},'MQdod':_0x425890(0xa1a,0xa40,0x7f,0x693)+'e','FKyyW':_0x425890(0x108b,0x911,0xe67,0x1154),'Ryqle':_0x17318e(0xbd8,0x1c32,0x19cf,0x15bb),'uKWqJ':_0x425890(0x15c7,0xe71,0xaf6,0x4df),'KYtcI':function(_0x41a44c,_0x301bed){return _0x41a44c*_0x301bed;},'tspvS':_0x425890(0x1148,0xbe1,0x1203,0x8f2),'rWvTs':'Press\x20The\x20'+_0x425890(0x5a1,0x422,-0xdb,0x44e)+'ow','ZtVeC':_0x17318e(-0x364,-0x33e,0xbcb,0x3fc),'IZmiP':'bucinquote','NJZmW':_0x425890(0xe82,0x8ea,0x10fd,0x134f),'GeKSB':_0x425890(0x10c0,0x806,0x21,0x94e),'CdYyy':function(_0x4cb6ae,_0xe9d568){return _0x4cb6ae(_0xe9d568);},'XKEzU':_0x425890(0x78b,0xfa8,0xfda,0x1a1b),'oKqrE':_0x425890(0x12e2,0x1014,0x1863,0x86f),'wISri':_0x17318e(0xdfd,0xdf6,0x1435,0xf36),'WuolD':function(_0x189dac,_0x142b04){return _0x189dac(_0x142b04);},'CuRFy':function(_0x3c04be,_0x14519c){return _0x3c04be(_0x14519c);},'qhfxk':function(_0x1c699c,_0x2eb6af){return _0x1c699c+_0x2eb6af;},'OhjRE':function(_0x588ce5,_0x690b00){return _0x588ce5(_0x690b00);},'qtFSN':_0x425890(0x9f0,0xdc0,0x54b,0x85e),'YFVwv':'iYDZP','qPxFt':_0x425890(0x1510,0xdf3,0x95c,0x1233)+'oh','VyHEB':'OUwzC','MgAjp':function(_0x569fd9,_0x37f864){return _0x569fd9==_0x37f864;},'tFwHt':function(_0x4cd3e0,_0x1f0c15){return _0x4cd3e0===_0x1f0c15;},'PeDpI':'ZIPfA','KEGep':function(_0x426817,_0x228060){return _0x426817+_0x228060;},'dggKa':function(_0x739b6c,_0x180bfa){return _0x739b6c==_0x180bfa;},'vShcO':function(_0x417847,_0x631632){return _0x417847(_0x631632);},'GNkPa':_0x17318e(0x955,0x1c,0x8f3,0x774),'yNEOr':function(_0x4c584e,_0x17a37e){return _0x4c584e(_0x17a37e);},'Smkgj':'ramalcinta','lWJhK':_0x17318e(0x6be,0x1504,0x10cf,0xbf6),'HUYzM':_0x425890(0xfef,0xaf9,0xda8,0xe6a),'UvPTx':function(_0x7bd7d7,_0x41f37f){return _0x7bd7d7==_0x41f37f;},'pUWjU':_0x17318e(-0x13f,-0xce,0xb20,0x4e5)+_0x425890(0x51e,0xb1f,0xc2c,0x1b6),'LQyVb':_0x425890(-0x4b,0x431,-0x645,0x6cf),'BVFRf':'kecocokanp'+_0x425890(0x668,0x850,0x12a1,0x1202),'CHuVN':_0x425890(0x39b,0xd5d,0xa77,0x8a5)+_0x425890(0xb5,0xa12,0x117,0x2d9),'GLFlN':'pasangan','zgheE':function(_0x28d68a,_0xb6f34){return _0x28d68a+_0xb6f34;},'bgVAk':'jadianpern'+_0x17318e(0x53b,0xffd,0x748,0x68d),'DisON':'jadiannika'+'h','zkFjL':function(_0x2fab1d,_0x3cf2e8){return _0x2fab1d==_0x3cf2e8;},'nLiGY':function(_0x4078c9,_0x2a54d9){return _0x4078c9===_0x2a54d9;},'kUhdO':_0x425890(0x1581,0xae2,0x103e,0x1d5),'ryHMB':'rezeki','aXTRO':_0x17318e(0x178,0xb8b,0x511,0x7c6),'qvlcy':_0x17318e(0x12c2,0x1639,0xed0,0x12eb),'TzQCm':function(_0x42e703,_0x618923){return _0x42e703!==_0x618923;},'thuGO':_0x425890(-0x718,0x156,0x933,0xbeb),'IiCCA':function(_0x47ab32,_0x54f76c){return _0x47ab32==_0x54f76c;},'nvvfy':function(_0x1872c2,_0x55263f){return _0x1872c2(_0x55263f);},'oEwNz':_0x17318e(0xa64,0x1058,0x1986,0x1368)+'ib','BnPZW':'ramalnasib','LAqGu':function(_0x4ed2fc,_0x5b7e4e){return _0x4ed2fc(_0x5b7e4e);},'yDsZD':_0x17318e(-0xb8,0x99e,0xae0,0x357)+_0x17318e(0x774,0x3b4,0x325,0xad6),'hdwOz':'penyakit','dJNmi':_0x425890(0x12c9,0xfa4,0xb64,0x915),'xJeZc':_0x425890(-0x2e7,0x246,0x97d,0xc4e),'Vabyr':function(_0x2b165b,_0x496c83){return _0x2b165b==_0x496c83;},'juMVv':'fengshui','LwKtj':function(_0x112586,_0x329cc1){return _0x112586==_0x329cc1;},'VAuzC':'haribaik','znQbF':_0x425890(0x111f,0xbdb,0x11f1,0x15b2),'NXxLb':function(_0x48c7f2,_0x2fbcd2){return _0x48c7f2+_0x2fbcd2;},'COTgS':function(_0x2199e5,_0x51a23d){return _0x2199e5(_0x51a23d);},'sSVRJ':_0x17318e(0x932,0x13cc,0xcb0,0xf0b),'yOWus':_0x17318e(0x1456,0x115,0x966,0xa57),'HUxaY':function(_0x58242a,_0x350be1){return _0x58242a===_0x350be1;},'mZFrS':_0x425890(0x7ba,0x1013,0xe9b,0xc83),'qKwKB':'harisial','cdkUD':function(_0x137644,_0x31dec6){return _0x137644==_0x31dec6;},'csoPJ':function(_0x43e12b,_0x5392ea){return _0x43e12b(_0x5392ea);},'sJFRn':_0x425890(0x19ee,0x15c6,0x1d29,0x1b87),'sSXwI':_0x17318e(0x101f,0x1764,0xd8b,0xf39),'OUwyC':_0x425890(0x3b4,0x1fe,-0x3e5,0x4b0),'oeDxh':function(_0x18ef2c,_0x1988c7){return _0x18ef2c+_0x1988c7;},'nUeqc':_0x17318e(-0x163,0x79f,0xda2,0x443),'STszD':function(_0x23ed3e,_0x1d6f9e){return _0x23ed3e==_0x1d6f9e;},'GdbZM':_0x425890(0x10fb,0xa9c,0x1355,0x567),'iCCsh':_0x425890(0x300,0x233,-0x54c,0xc9c),'iPMjd':function(_0x86084b,_0x1ee04b){return _0x86084b+_0x1ee04b;},'EgNqy':function(_0x3dd2a3,_0x332ec2){return _0x3dd2a3(_0x332ec2);},'BIDRZ':_0x17318e(0xca9,0x9dd,0x8b4,0x3ec),'ypuvB':_0x425890(0x62d,0x5ef,0x4c6,0xe22),'sVYBG':function(_0x3a3934,_0x4336fa){return _0x3a3934!==_0x4336fa;},'yuElz':'tdVuT','dWVuy':function(_0x170f13,_0x4f30db){return _0x170f13+_0x4f30db;},'LYRhW':function(_0x22372e,_0x2b797e){return _0x22372e==_0x2b797e;},'nwLNn':function(_0x1421a1,_0x6de455){return _0x1421a1(_0x6de455);},'MlEdE':'keberuntun'+_0x425890(0x592,0xa12,0x7fc,0xd8d),'HylZy':function(_0x19f8a6,_0x4f8184){return _0x19f8a6+_0x4f8184;},'jYJfm':function(_0xb2b073,_0x3f5a0a){return _0xb2b073==_0x3f5a0a;},'MhKKU':'memancing','WmmqW':function(_0x423631,_0x26215e){return _0x423631==_0x26215e;},'lrIqy':_0x425890(0xbbd,0x1624,0xf66,0x1285),'oocaX':function(_0x4a58c3,_0x2f6a5f){return _0x4a58c3+_0x2f6a5f;},'BWZgP':_0x17318e(0x20d0,0xd48,0x2107,0x17c4),'LLbvF':_0x425890(0x1946,0x1463,0x11dc,0x1dba),'khpcL':_0x17318e(0xce9,0x1975,0xee2,0x108b),'ecPLD':_0x17318e(0x63c,0x132e,0x2a3,0x8e2),'oITbB':'taurus','vALra':_0x17318e(0x88a,0x1541,0x18de,0x1291),'aJFia':_0x425890(0xdc0,0x14fa,0x15af,0x1bcc),'GwPpl':_0x17318e(0x538,0x26,0x313,0x7f6),'UiAIu':_0x425890(0xe45,0x69a,0x7b8,0x9c7),'GeIHV':_0x17318e(0xe53,0xf76,0xc8f,0x1048),'heWGa':'scorpio','MBdUt':_0x17318e(0x1ea7,0x12d2,0x1951,0x158a)+'s','ATJHs':function(_0x41ae40,_0xf2ab6d){return _0x41ae40==_0xf2ab6d;},'Ggfpv':function(_0x4c5e86,_0x3bc81c){return _0x4c5e86+_0x3bc81c;},'fTyEx':function(_0x5a4f5d,_0x85ab03){return _0x5a4f5d+_0x85ab03;},'GRHoz':function(_0x1b4475,_0xe5ff97){return _0x1b4475==_0xe5ff97;},'iKjqI':function(_0x513f81,_0x5ab57b){return _0x513f81==_0x5ab57b;},'RWccB':function(_0x558cc6,_0x136ddb){return _0x558cc6(_0x136ddb);},'DXhYJ':'stalk','zEjte':function(_0x1410b6,_0x169ba8){return _0x1410b6<_0x169ba8;},'IvALH':function(_0x57da2f,_0xf07616){return _0x57da2f(_0xf07616);},'fGCay':_0x425890(0xcce,0x107c,0x12a9,0x756)+_0x425890(0xac9,0xec8,0x9df,0xba3)+_0x425890(0xe6,0x1be,0xb24,0xc4e),'hfDii':function(_0x2be003,_0x38d23c){return _0x2be003(_0x38d23c);},'bcXhv':function(_0x1bd9f9,_0x4307ef){return _0x1bd9f9==_0x4307ef;},'ymMun':function(_0x196bc1,_0x48126d){return _0x196bc1+_0x48126d;},'QKKGS':function(_0x3d90ab,_0x3744b9,_0x235f73,_0x48b3de){return _0x3d90ab(_0x3744b9,_0x235f73,_0x48b3de);},'YfgPT':'/api/nickf'+'f','JiBoo':function(_0x3059f2,_0x4ec468){return _0x3059f2==_0x4ec468;},'WtpCF':function(_0x470601,_0x1385d9){return _0x470601(_0x1385d9);},'MsDZV':function(_0x426b03,_0x37ff3e){return _0x426b03(_0x37ff3e);},'XGNMz':function(_0x44cd68,_0x3a4aeb){return _0x44cd68(_0x3a4aeb);},'fyqFC':function(_0x155dd5,_0x22d39a,_0xd33921,_0x444424){return _0x155dd5(_0x22d39a,_0xd33921,_0x444424);},'iWOol':'/api/nickm'+'l','SWqXd':function(_0x951eb7,_0x32ce68){return _0x951eb7==_0x32ce68;},'NFzzu':'MGger','cNPzH':function(_0x1b3ed0,_0x42d514){return _0x1b3ed0+_0x42d514;},'mIzAh':function(_0x1835c9,_0x4ae8c6){return _0x1835c9(_0x4ae8c6);},'CoQML':'/api/nicka'+'ov','VrHkc':function(_0x791b44,_0x7256b1){return _0x791b44(_0x7256b1);},'BhFhb':function(_0x1fb373,_0x27363e){return _0x1fb373==_0x27363e;},'UORzn':_0x425890(0x426,0x365,0x5f,0xcf5),'HDfzD':'/api/nickc'+'od','HhWUM':function(_0x44b5f6,_0x1f1aef){return _0x44b5f6(_0x1f1aef);},'BUZKP':function(_0x8d42d1,_0x2a7581){return _0x8d42d1(_0x2a7581);},'HlXHH':_0x17318e(0x1428,0xda1,0x11b0,0xa4d)+'b','YRrPK':function(_0x5815a6,_0x5d9087){return _0x5815a6(_0x5d9087);},'ihfsD':_0x17318e(0x1166,0x120e,0x13de,0x1393),'kWCGR':_0x425890(0x166c,0xd54,0x10c6,0x1269)+_0x425890(0x957,0x9fa,0x63a,0xa09),'rSmMk':function(_0x2e2c0b,_0xc5cb09){return _0x2e2c0b(_0xc5cb09);},'GVHnX':_0x17318e(0x4d8,0x53f,0x11b8,0xa58),'ckVzz':'/api/stalk'+_0x425890(0x949,0x13b7,0xf21,0xc2b),'waZXM':function(_0x500624,_0x112be7){return _0x500624(_0x112be7);},'mxpJG':function(_0x2032b2,_0x4d1d27){return _0x2032b2(_0x4d1d27);},'MGMEF':function(_0x1a7946,_0x153650){return _0x1a7946+_0x153650;},'bnxlg':_0x425890(0x1051,0xe3f,0xe8f,0x1766),'lvfhb':'tiktoknowm'+'x','kDPsh':_0x425890(0xfff,0xc24,0x392,0x12c0),'rPUMX':function(_0x3325d6,_0x41bdc8){return _0x3325d6(_0x41bdc8);},'qLNur':_0x17318e(0x192e,0xd1e,0x1ef8,0x14cb)+_0x17318e(0x1292,0xd8c,0xb27,0x10a4),'ltNSU':_0x425890(0x701,0x9b2,0x1238,0x7d6)+'❯','SpvLk':_0x425890(0x1a45,0x11dc,0xbdb,0x13ff),'wwIkU':_0x17318e(0x1bba,0xbb2,0xc34,0x161c)+_0x17318e(0x1157,0x9ab,0x10d8,0xe52),'DHjuF':function(_0x37976d,_0x636962){return _0x37976d!==_0x636962;},'swkxT':_0x425890(0x894,0x29c,0xcc1,0x717),'nticV':function(_0x2de5c5,_0x55b02e){return _0x2de5c5(_0x55b02e);},'lbWpB':function(_0x5bb099,_0x21c376,_0x5a04e0,_0x5e2b0b,_0x6d1d9a){return _0x5bb099(_0x21c376,_0x5a04e0,_0x5e2b0b,_0x6d1d9a);},'lHGEm':'❮❮🥬No\x20Wate'+_0x17318e(0xda5,0x3a5,0xcf0,0x923),'Awaab':_0x425890(0x1807,0x1119,0x13c6,0x144e),'KJVsd':_0x425890(0xbd1,0x75f,0x6a9,0x412)+'ox','cMyeJ':'/downloade'+_0x17318e(0x1877,0xb7f,0x105d,0x1467)+'y','ctEMu':_0x425890(0x84f,0x540,0xb7e,-0x36d)+_0x425890(0xb3e,0xa4a,0x1291,0x7e),'zQgaX':function(_0x1aece5,_0x501ad8){return _0x1aece5(_0x501ad8);},'HlERQ':function(_0x281a9d,_0x445ae2){return _0x281a9d(_0x445ae2);},'MqUwq':'/downloade'+_0x17318e(0x1bd6,0x1d30,0x1f3b,0x1846)+'m2','sSGxN':function(_0x31e0ef,_0xa205db){return _0x31e0ef(_0xa205db);},'dJxde':_0x425890(0xf38,0x12ae,0xaff,0x15f9)+_0x17318e(0x1d45,0xf5e,0x16f2,0x14fa)+'ry','NmJZe':function(_0x454b12,_0x18482a){return _0x454b12(_0x18482a);},'psAtf':'igeh','fUEZA':'instagram2'+'x','HlQxj':'ig2','qMicV':function(_0x361284,_0x1e6bd4){return _0x361284(_0x1e6bd4);},'gYLSW':_0x425890(0x1402,0x125b,0xb21,0x1818),'dUQmf':function(_0x405dc7,_0x514f85){return _0x405dc7!==_0x514f85;},'wTWSh':function(_0x2b8e9b,_0x797520){return _0x2b8e9b(_0x797520);},'hnyrs':_0x17318e(0x1c01,0x17c9,0xb8e,0x14cb)+_0x425890(0x7bc,0xc7d,0xed2,0xe0d),'UGYpu':_0x17318e(0x1e56,0xb97,0xa45,0x14b9),'WnUqq':_0x17318e(0x77a,0x7a6,0xe62,0x111c),'ZcEgA':_0x17318e(0x7db,0xb26,0xeb9,0xae8),'jIdgi':_0x17318e(0x18cf,0x14b3,0x1145,0x14cb)+'r/soundclo'+'ud','wuaGr':'twitdlx','RaTQK':_0x17318e(0x89f,0x17cc,0x1b77,0x1335),'gsgxA':_0x17318e(0xe86,0x179d,0x92f,0xd09)+'oader/twit'+'ter','sjqMh':_0x17318e(0xaf7,0x14c5,0xf9f,0xe0d)+_0x17318e(0x1e74,0x1173,0x1485,0x17f0),'ZGnYF':_0x17318e(0x14c2,0xb26,0x127f,0xb0f),'ZbfRI':function(_0x46686a,_0x41f503,_0x467478,_0x48235c,_0x582a0d){return _0x46686a(_0x41f503,_0x467478,_0x48235c,_0x582a0d);},'kBhgD':_0x425890(0x1607,0x11f6,0xf70,0x143a),'Efqwm':'facebookx','BuMqg':function(_0x30265c,_0x1d8907){return _0x30265c(_0x1d8907);},'XhKhT':_0x425890(0x734,0xaec,0xa5c,0x7c4)+_0x425890(0xb0,0x8a1,-0x15c,0x88f)+_0x425890(0x66e,0x1072,0xa47,0x96d),'ugrCE':_0x17318e(0x29e,0xf63,-0x469,0x52e)+'l','bLhUT':function(_0x428efc,_0x197795){return _0x428efc(_0x197795);},'iKvWL':function(_0x1d7270,_0x3c5a92){return _0x1d7270(_0x3c5a92);},'FWLJu':function(_0x388c09,_0x123de9,_0x239d9b,_0x365734,_0x400577){return _0x388c09(_0x123de9,_0x239d9b,_0x365734,_0x400577);},'DIJBj':_0x17318e(0x845,0x4dd,0x1790,0xd09)+_0x425890(0x727,0x5fa,0x1054,0xf9b)+'erestdl','CwIrp':'umma','eUuLV':_0x17318e(-0x240,0xdbb,-0x301,0x643),'ThaCv':function(_0x89d3eb,_0x41c9c6){return _0x89d3eb!==_0x41c9c6;},'EFARF':'tBaFI','HTbPC':function(_0x5901e4,_0x4a0bed){return _0x5901e4(_0x4a0bed);},'ROCfm':function(_0x17ecf8,_0x5b59e7){return _0x17ecf8==_0x5b59e7;},'xGCLu':_0x425890(0xb77,0x7e5,0xb1e,0xb42),'BOqmI':_0x17318e(0x10cc,0x1403,0x1c2f,0x1481),'qUBpv':_0x17318e(0xac0,0xcc1,0xe08,0x392),'YkoMq':function(_0x50a0ed,_0x541b31){return _0x50a0ed(_0x541b31);},'fLHUT':function(_0x5426f7,_0x44e934){return _0x5426f7+_0x44e934;},'PVMAf':_0x17318e(0x6cc,0x1232,0x44c,0x95d),'EqsVO':_0x17318e(0x20f6,0xe65,0x1c84,0x184c),'FyYzl':_0x17318e(0x21a8,0x16ed,0x157e,0x17d7),'bCtTE':_0x425890(0xa57,0x10f,0x74f,0x816)+_0x425890(0x16a5,0xfd3,0x14ba,0xdbc),'PJClx':_0x425890(0x1055,0xda7,0x10a2,0x14f9),'RZazY':function(_0x4e4312,_0x38a99c){return _0x4e4312!==_0x38a99c;},'CcraY':_0x17318e(0xcb4,0x200,0x1033,0xb1b),'ntnmX':function(_0x50ae3f,_0x173f98){return _0x50ae3f===_0x173f98;},'QcVWK':_0x425890(0xec2,0x7bf,-0x294,0x54d),'ybgWb':function(_0x45f1fd,_0x58c881){return _0x45f1fd(_0x58c881);},'KeRQR':_0x17318e(0xaf1,-0x1ea,0x355,0x32c)+_0x425890(-0x676,0x40e,0xd26,0x6c6)+_0x425890(0x817,0x314,-0x58c,-0x1b1)+'enxmlforma'+_0x17318e(0x157b,0x43a,0x1119,0xd79)+'ocument.wo'+_0x17318e(0x12d3,0x15ab,0x11e8,0x1707)+'ngml.docum'+_0x17318e(0x1011,0x6ad,-0x19b,0x7c0),'vNxnq':function(_0x5ab71c,_0x475618){return _0x5ab71c===_0x475618;},'GEcUR':_0x425890(0x22d,0x498,0x82e,0x4b6)+_0x17318e(0x168e,0x17b,0x177,0xc00)+_0x17318e(0xeb2,-0xaf,0x7ea,0x650)+_0x17318e(-0x6bb,0x54,0x8e4,0x372)+_0x17318e(0x1419,0xe78,0x5b5,0xc3c)+'-arab-lati'+_0x17318e(0x5ed,0x636,0x1031,0xde1)+'a.pptx','NStnY':function(_0x143528,_0x1582e7){return _0x143528===_0x1582e7;},'FnamJ':function(_0x17054e,_0x30c71a){return _0x17054e(_0x30c71a);},'SShKn':function(_0x4bed18,_0x4de8f4){return _0x4bed18+_0x4de8f4;},'zgjYu':'hadisxxx','EtHAk':_0x425890(0xeb0,0xac0,0xb15,0x9da),'sGhPr':_0x425890(0x734,0x84e,0xc,0xc94),'EHvDk':function(_0x210072,_0x102796){return _0x210072(_0x102796);},'jvGwv':function(_0x2f4839,_0x2fa52b){return _0x2f4839(_0x2fa52b);},'FZpKk':_0x425890(0x3f5,0xd1a,0x98f,0x909),'nkQLg':_0x17318e(-0x39e,0xd13,-0x51f,0x576),'tZuny':function(_0x387e7c,_0x1134aa){return _0x387e7c(_0x1134aa);},'nsdLM':function(_0x1e03a9,_0xf6ee7f){return _0x1e03a9(_0xf6ee7f);},'LDmGM':_0x17318e(0x1a25,0xdb1,0x906,0x125c),'qxhcP':function(_0x24d5b9,_0x2d5100){return _0x24d5b9(_0x2d5100);},'eBXmN':'bass','uMTCq':_0x17318e(0xc35,0x6ed,0x143,0x542),'xmFRX':_0x425890(0x16aa,0x11d6,0x870,0x965),'ymyTS':_0x425890(-0x6d3,0x2af,-0x289,-0x57f),'XtMlR':'fast','ezLGC':_0x425890(0xbbd,0x158c,0x12f3,0x18a8),'iXLBv':'reverse','dohCV':_0x17318e(-0x506,-0x48e,0x616,0x56a),'iOgTq':_0x425890(0x3c6,0xa6c,0x2e0,0xc3e),'DTouz':_0x17318e(0xb33,0xe94,0x7dc,0xfd9),'ghyGC':_0x425890(0x509,0x499,-0x2a5,0x240),'AcwLY':_0x425890(-0x3ab,0x608,0x3ca,0xd0c),'hCFsn':_0x17318e(0x10e4,0xf64,0x20e2,0x1731)+_0x425890(0x5f6,0xde3,0x551,0xc3a)+'idth_type='+'o:width=2:'+_0x425890(0x188e,0xf6b,0x13ef,0xcf2),'HASmV':_0x17318e(0x529,0xbd9,0x4c6,0xabb)+_0x425890(0x18f1,0xfdd,0x870,0xb52)+':0:log','ywdPd':_0x425890(0x420,0x70a,0xa8a,-0x99)+_0x17318e(0x505,0x4e4,0x3f7,0x3cc)+_0x425890(0xaf1,0x510,0x20f,0x2d1)+_0x17318e(-0x30d,0xcc6,0x28e,0x3f8),'slORN':'-af\x20volume'+_0x17318e(-0x14a,0xe03,0x537,0x391),'rLrOH':'-filter:v\x20'+_0x425890(0x4c5,0xb63,0x8c4,0xaf2)+_0x425890(0x192c,0x1182,0x16b1,0x1b5b)+'de=mci:mc_'+_0x425890(0x56d,0xea5,0xa97,0x4d7)+_0x17318e(0x42b,0x22f,0x3ef,0xb36)+_0x425890(0xe6f,0x126f,0xb36,0xaf0),'sZbLW':function(_0x2a9d92,_0x124c3e){return _0x2a9d92(_0x124c3e);},'XAqXD':function(_0x3f2df5,_0x3161ee){return _0x3f2df5(_0x3161ee);},'qhAMx':_0x425890(0x14f9,0xd0b,0xab7,0x1208),'ZNkOI':function(_0xb8269f,_0x2d8719){return _0xb8269f(_0x2d8719);},'ORXux':_0x425890(0x1918,0x146d,0xb94,0x1069),'MSryj':function(_0x552bba,_0x2726ba){return _0x552bba(_0x2726ba);},'fLeUz':function(_0x4f010d,_0x1a67e4){return _0x4f010d(_0x1a67e4);},'dHQjS':_0x17318e(-0x71,0xf50,-0x396,0x604),'bkfEo':'lockcmd','VeNDO':'avFGM','zYqJI':function(_0xfd4c19,_0x1196dc){return _0xfd4c19(_0x1196dc);},'ceLSa':function(_0x462e1d,_0x39f317){return _0x462e1d(_0x39f317);},'fHfZW':_0x425890(0x1192,0x114d,0x77b,0xd8e),'FguON':function(_0x288f69,_0x58bb98){return _0x288f69+_0x58bb98;},'BqXsm':function(_0x14c0b7,_0x5ad8a1){return _0x14c0b7(_0x5ad8a1);},'cEINE':function(_0x43ed54,_0xb645c8){return _0x43ed54+_0xb645c8;},'yEBIE':_0x425890(0x1656,0x14d3,0x1e13,0x1ad6),'UaCDz':_0x17318e(0xf5c,0x1588,0x1a46,0x128d),'ttALq':_0x17318e(0x1285,0x1552,0xdc8,0x178f)+_0x17318e(0x940,0x138e,0x61e,0xa2d)+_0x17318e(0xa12,0xacb,0x212,0x6b8),'juGSH':'deletemsg','HtlWf':'RyXuT','WRJlL':function(_0x181217,_0x446116){return _0x181217(_0x446116);},'WDjNr':function(_0x3345eb,_0x366d0f){return _0x3345eb(_0x366d0f);},'toAJT':_0x425890(0x1830,0x1270,0x1c70,0xb15),'VvmHy':'Features\x20C'+_0x425890(0x8a0,0x1103,0x1a97,0xce4)+_0x17318e(0x2052,0x2133,0x1af4,0x1712)+_0x17318e(0x138b,0x1ac4,0x1854,0x160c),'COmVU':_0x425890(0xcd7,0xeb7,0x1568,0x500),'QoiNP':_0x17318e(0x14cb,0x11b1,0xdfb,0xedf),'LogFF':_0x17318e(0x1af3,0x1736,0x1778,0x136e),'kxeEm':_0x425890(0x1335,0xc79,0xdf5,0x267),'MScnT':function(_0x9b7399,_0x57f5fc){return _0x9b7399(_0x57f5fc);},'fGnsm':_0x17318e(0x1111,0x1f9a,0x1270,0x1661),'ogykb':_0x17318e(0xe35,0x16c5,0x1cb6,0x17ea),'PMXby':'🛑Stop🛑','sXRRS':_0x425890(0x16a1,0x1371,0x1cc8,0x1711),'ivTcD':'CHATTING','VSBgv':_0x425890(0x14ce,0xc2b,0xa19,0xd71),'rYhYz':_0x425890(-0x58,0xa2b,0x2c,0xf0b),'GeHXl':_0x17318e(0x9ab,0x113b,0x1b7e,0x1403),'NnQpI':function(_0x2c6eab,_0x4389a1){return _0x2c6eab===_0x4389a1;},'TbWBJ':_0x17318e(0x154b,0x1359,0x732,0xcc0),'UVYzB':function(_0x137ed8,_0x185a6d){return _0x137ed8(_0x185a6d);},'RXWmh':'vMfIz','fkRch':_0x425890(0xdf9,0x1055,0x1ab2,0x876),'pYdaS':_0x17318e(0x14a4,0x12f2,0x152c,0xd6e),'Nnyab':'Gxzrr','MciMM':_0x425890(0x1ecc,0x1543,0xd66,0x18ec),'kOfBe':_0x425890(0xf2f,0xcb6,0x149f,0x15c8),'omfgg':'Successful'+_0x17318e(0x293,0x125,0x5a8,0x340)+_0x17318e(0x1533,0x5e9,0xcb4,0xdb4)+'e','BnxSo':_0x17318e(0xc72,0xbe0,0x10a7,0x98e),'NTlll':_0x425890(0xad6,0xae4,0x5d3,0x7e3),'KXUHS':function(_0x54a02a,_0x3550a3){return _0x54a02a!==_0x3550a3;},'PLzvl':'verRM','DUiLP':_0x17318e(0xc49,0x1695,0x1a44,0x11b7),'TlBAm':function(_0x5e35eb,_0x33bc77){return _0x5e35eb(_0x33bc77);},'PDWAf':function(_0x13fed5,_0x5f559b){return _0x13fed5(_0x5f559b);},'dXoHZ':function(_0x5eac22,_0x3be7bd){return _0x5eac22(_0x3be7bd);},'TPOfM':_0x17318e(0x48c,0xb05,0x1508,0xc4f)+_0x425890(0x399,0x4f8,0xcbd,0xccc),'qbJbh':function(_0x2588cf,_0x3c174c){return _0x2588cf(_0x3c174c);},'rcZxm':_0x17318e(0x9e0,0xe6e,0x2da,0x9f1)+_0x17318e(0x260,0xb97,0x616,0x4f3),'JaoLq':function(_0x59a105,_0x5251be){return _0x59a105(_0x5251be);},'bglmL':_0x425890(0x4ab,0x27e,0x710,-0x24)+_0x17318e(0xb57,0xa25,0x41c,0xe2a),'SvroV':function(_0x4b2cc1,_0x7f66a3){return _0x4b2cc1===_0x7f66a3;},'qoBeT':_0x425890(0x133f,0xfbe,0xde7,0x1052),'cDjEf':'oFfUe','uJFdV':_0x425890(0x77b,0xd41,0x17aa,0x96f),'eopob':_0x17318e(0xb4c,-0x182,0x70f,0x55e),'bRUel':_0x17318e(0x1f91,0x1c5b,0x183a,0x17cb),'HCFDp':function(_0x8e7d57,_0x51c920){return _0x8e7d57(_0x51c920);},'reBQk':_0x425890(0x1117,0x107e,0x65b,0x1a3d),'nwkOB':_0x425890(-0x68c,0x2e4,0x2d2,0x95e),'yUEPY':_0x425890(0x34b,0xb28,0xf5e,0x740),'RGoCz':function(_0x502a34,_0x3327b4){return _0x502a34===_0x3327b4;},'aQjtP':function(_0x3a8298,_0x2ddc79){return _0x3a8298===_0x2ddc79;},'SbSgJ':function(_0x543a98,_0x58dbe0){return _0x543a98(_0x58dbe0);},'gCSIN':'iYJkA','zWKbi':'chatbot\x20on','GEazv':'⫷\x20ON\x20⫸','pDZBK':'බැහැ','TKKYf':function(_0x4bfee0,_0x490507){return _0x4bfee0===_0x490507;},'SJlbA':_0x17318e(0xa0c,0xb83,0xad6,0x665),'NURyH':_0x425890(0x1193,0x12b0,0x14b2,0x11f2),'VhAcR':_0x17318e(0x128d,0x1219,0x11a2,0xd19),'JqGHC':_0x425890(0xb9b,0x11b,0x8d6,0x437),'XUVMm':_0x425890(0xe98,0xc86,0x140c,0xe13),'uysBg':_0x17318e(0x1050,0x1809,0x1c7b,0x15ae),'etKvu':_0x425890(0xb65,0x10f0,0x11e3,0xe3a),'zrbeX':_0x17318e(0xf6e,0x164e,0xdd9,0xcc9),'eYxvk':_0x17318e(0x25f,-0x54,0x641,0x788),'aFfSz':'පම්ක','tsxyw':_0x17318e(0x1049,0x15ab,0xb47,0xc9a),'TrOkX':'ඇට\x20දෙක','npWuB':'hutti','GUDIM':'besikaya','UZfAR':_0x17318e(0x1e25,0x147f,0x1f72,0x1752),'Jfzfy':'පකය','GDHtc':_0x425890(0xd32,0x156a,0xed7,0xec7),'bKBra':'පොයන්නා','IyyFN':'පින්නයා','rLhDC':_0x17318e(0x1ec3,0x14f9,0xc52,0x15b6),'TBnme':_0x17318e(-0x3ea,0x3d,0xbbe,0x3a1),'rXSFN':_0x425890(0x544,0xef1,0xd39,0x800),'uNfbD':'ukkapan','dBrTC':_0x425890(0x4a9,0xac7,0xaea,0x11c3),'CXwaM':_0x17318e(0x334,0x98a,0xf37,0x4a6),'iichp':_0x17318e(0xdd8,0xcfe,0x1c53,0x179a),'hlSCQ':function(_0xc56470,_0x44e0bb){return _0xc56470===_0x44e0bb;},'DUFyK':_0x425890(0x84a,0x7bd,0x16e,0x127),'hwgZb':'අඩෝ','ZvxrH':function(_0x2096ac,_0x4e2ed7){return _0x2096ac===_0x4e2ed7;},'tWUPw':_0x425890(0x1618,0x140c,0xa8b,0x1aee),'LKodh':_0x425890(0xc43,0x207,0xc18,-0x450),'fQBwr':_0x425890(0xb47,0x35f,-0x5e7,0x2ec),'yqZbc':'bamla','CRIqK':_0x17318e(0xdf8,0xd41,0xb36,0x78c),'UDKwx':_0x425890(-0xf7,0x617,0x87b,0x107d),'cZIbz':_0x17318e(0x8df,0x296,0x791,0x87a),'CKsfb':_0x425890(0x15d,0x736,0x1194,0x8bd),'DNAyQ':_0x425890(-0x373,0x3b2,-0x6c4,0x2b),'BoEoa':_0x425890(0x1a0c,0x1642,0x1247,0x184f),'TDBBN':_0x17318e(0xf67,0x1238,0x1440,0xf29),'WYQmg':function(_0x1b269e,_0x53654b){return _0x1b269e!==_0x53654b;},'MYUay':_0x425890(0x11a7,0x8a4,-0x170,0x848),'aenVD':_0x425890(0x27b,0x840,0x965,0x11e1),'yuXFi':function(_0x5225dc,_0x32d9fd){return _0x5225dc!==_0x32d9fd;},'oyBQc':_0x425890(0xb22,0xce4,0x77f,0x10ca),'jIxeY':function(_0xed0ee1,_0x306612){return _0xed0ee1===_0x306612;},'Bbens':function(_0x2d295a,_0x1a5ff6){return _0x2d295a!==_0x1a5ff6;},'DLbuT':'DgOam','oVAHa':'aqhKA','ROBVz':_0x425890(0xb83,0x7da,0x433,0x2e3)+'ne','MhTQL':function(_0x1404a2,_0x24d237){return _0x1404a2===_0x24d237;},'YXtlb':function(_0x167482,_0x529e23){return _0x167482===_0x529e23;},'iGYUy':_0x425890(0x471,0xbf4,0x1549,0xbd0),'JVxVq':_0x425890(0x78b,0x181,0x29b,-0x1b3),'gqidH':'අනෙ','KBfWa':function(_0x2b4067,_0x823dd3){return _0x2b4067===_0x823dd3;},'XoEeM':_0x17318e(0xa4f,0x623,0x1dc,0x726),'YMnWk':'ඔව්','gSrfb':_0x425890(0x31b,0x56a,-0x505,0xe2e),'TacNS':_0x17318e(0xb86,0xf45,0x10bf,0xb92),'TWnUP':'halo','sXqbk':'hello','dRewP':_0x425890(0xa2c,0xa99,0x1c7,0x661),'hfFRh':'හලෝ','GymLq':_0x17318e(0xdcc,0x1bfe,0x21e4,0x1748),'nUWyA':_0x425890(-0x76b,0x254,-0xf3,-0x198),'bpMQI':'danne\x20na','SjpUj':_0x17318e(0x849,-0x126,0x7f9,0x6f7),'RrcYs':_0x425890(0xb79,0x145b,0x1b97,0xb53),'AJdqs':function(_0x485bd2,_0x47bb18){return _0x485bd2===_0x47bb18;},'ONNnQ':function(_0x1799e9,_0x3225ff){return _0x1799e9===_0x3225ff;},'IkxhF':'ufPlu','RdepP':_0x17318e(0xbe2,0xadd,0x1bbe,0x13ec),'CALRZ':_0x425890(0x5ac,0x77f,0x1074,0xf58),'Yjwwm':_0x425890(0xf75,0x7a9,0xa34,-0x28d),'WbvME':function(_0x754da1,_0x3b95f0){return _0x754da1===_0x3b95f0;},'TrmFl':'kamak','vEqXu':'kamanna','rXPiP':_0x425890(0x11cc,0xb6e,0x49a,0x1281),'BpCaP':_0x17318e(0x17dd,0x704,0x15dd,0xd81),'xtRLG':'බලන්න','gIDDz':function(_0x2d13e6,_0x8636b5){return _0x2d13e6!==_0x8636b5;},'HMHRP':_0x17318e(0x9ee,0x880,0x16aa,0xc70),'VjrFm':function(_0x12d5b9,_0x2b5570){return _0x12d5b9===_0x2b5570;},'Rymae':function(_0x10eb29,_0x1ed623){return _0x10eb29===_0x1ed623;},'kDcgg':function(_0xf4a419,_0xe244f8){return _0xf4a419!==_0xe244f8;},'ZfahX':_0x425890(0x1845,0x11d8,0x7c0,0x1a02),'ZvbZp':_0x17318e(0x7a7,0xa39,0xcba,0x121c),'JBZcx':_0x17318e(0x10a,0xc82,0x9d6,0xb7e),'EqiCo':function(_0x31cfa4,_0x38031b){return _0x31cfa4!==_0x38031b;},'WIQqT':_0x425890(0x139a,0xaf0,0xf34,0xd4b),'cpqJL':_0x425890(-0x254,0x472,0xf,0xa2d),'dZMLA':_0x17318e(0x1cb5,0x11b3,0x15ad,0x1825),'ifWXO':'මොකද්ද','NRhtG':_0x17318e(0x1271,0xd24,0x111,0xb2f),'OzKyW':_0x425890(-0x6cc,0x140,0x8c2,0x36e),'RvNRy':_0x425890(0x1333,0xdfc,0x1610,0xef9),'NfWtM':_0x17318e(0xe11,0xbfb,0xa6a,0x13cf),'lSuZi':_0x17318e(0x1041,0x1fad,0x199a,0x161b),'zaXeT':_0x17318e(0xc7d,0x1302,0x82a,0xa84),'WwsGE':_0x425890(0xa7f,0x50d,-0x539,0x741),'ahEcH':_0x17318e(0x20c5,0x1ebd,0x21b9,0x1832),'XzoGa':_0x17318e(0x299,0xe7d,0xedb,0x81b),'znhQH':_0x17318e(0x1a5e,0x2131,0x1816,0x1832)+'😌','rpcRt':_0x17318e(0x104e,0x1103,0xbf4,0x81b)+'❤️','ZVLVJ':'ගුඩ්මෝනිම'+'්','BNxGi':function(_0x42d1de,_0x57b01e){return _0x42d1de===_0x57b01e;},'hzcjh':_0x17318e(-0xab,0x7e8,-0x331,0x446),'EAGIF':_0x425890(0x165d,0xc82,0x26a,0xaaa),'WsltV':_0x425890(0x1083,0xd6f,0xe50,0x1007),'CjRyI':_0x17318e(0x16a1,0x910,0x1051,0x1025)+'❤️','RoQHH':_0x425890(0x522,0x59e,-0xe4,0x875),'tCFdi':_0x425890(0x12df,0x12be,0xe87,0x1ace),'iKCve':'😘😘','uaVyB':_0x17318e(0x1e8c,0xddd,0x16f5,0x1842)+'_බලමුද?','ZzdQy':'naa','jwPYm':'නෑනෙ','CIXeU':_0x425890(0x14ad,0xeef,0xef3,0x184f),'qPstW':_0x425890(0x1272,0xd1e,0x59b,0x10a1),'xacMc':'නැතෝ','bkQgO':function(_0x3440b9,_0x2500e0){return _0x3440b9===_0x2500e0;},'ZNaLw':function(_0x278cc4,_0x100452){return _0x278cc4!==_0x100452;},'LKofc':_0x425890(0x1cf0,0x1449,0x14b0,0x1155),'KAbbN':_0x425890(0xc76,0xc42,0x2ce,0xcb4),'pWbYj':_0x17318e(-0x1e7,0xc39,0xd99,0x454),'eVsyn':'3dchristma'+'s','RcxKj':_0x425890(0xe51,0xd13,0xc92,0x122c)+'istmas','tJdTV':'deepsea','jPlif':_0x17318e(0xaab,0x16c3,0x1442,0x12a6),'RPQAH':'rainbow','lEoMY':'waterpipe','cFWAl':'circuit','SUuMA':'discovery','YviFD':_0x425890(0x591,0x4cf,0xc3e,0x46d),'etHsq':_0x425890(0x6fd,0xe7a,0x9c9,0x13f8),'iIAYH':_0x17318e(0x1f3b,0x179a,0x1348,0x1550),'wcjPp':_0x17318e(0x527,0x650,0x1078,0xa99)+'r','MQoGf':_0x425890(0x94,0x77c,0x868,0x1015),'NPrHJ':_0x425890(0x263,0xbed,0x8bf,0x14c4),'OBQAf':'3dstone','BFgGj':'neonlight','WdqzE':'glitch','BVhUu':_0x425890(0xf6d,0x11bc,0x15d0,0x8b1)+'s','bHRFs':'papercut','dvgHn':'watercolor','EXrtz':_0x17318e(0x4a,-0x25a,0xc49,0x3c8),'RDirO':_0x425890(0x1349,0x1607,0x159f,0x1fd4),'DQlHM':_0x425890(-0x4b9,0x242,-0x727,0xa71),'mOxce':_0x425890(0x1112,0xf22,0x103d,0x1496)+'ke','LdJJO':_0x17318e(0x12b6,0x76a,0x1f4,0x847),'ccvYR':_0x17318e(0xd78,0x11e9,0x8d6,0xec4),'XSHKG':_0x17318e(0x890,0x76e,0xde1,0xe86),'zPeNy':'biscuit','mRoho':_0x17318e(0x2e0,0x9d6,0x279,0xcab),'AHjEP':_0x17318e(0x11dc,0x1b8d,0xd49,0x1791),'SAiQC':_0x17318e(0xbc6,0x11bd,0x1720,0xd44),'bGPDv':_0x425890(0x153b,0x10d5,0x1014,0x1568),'ZjcNj':_0x17318e(0xace,0x18fe,0x1c19,0x1410),'scQEb':'toxic','PDyPA':'lava','lQKBE':_0x17318e(0x675,0x35f,0x12eb,0x85b),'zJmBX':'bloodglas','CFBPw':_0x425890(0xfea,0xab3,0x1039,0xb2),'USkKY':_0x425890(0xb19,0x13ea,0x1748,0x1507),'UWyvw':_0x17318e(0xcab,0x422,0x6c,0x453),'wTXST':_0x17318e(0x78b,0x8f2,0x5da,0x426),'EGDuH':'blackpink','APFPd':_0x17318e(0x8db,0x40e,0x17d3,0xea9),'DSpSB':'glue','FbGTv':function(_0x36844c,_0xc92124){return _0x36844c(_0xc92124);},'aEfvv':_0x17318e(0x1576,0x1754,0x1214,0xfc7)+_0x425890(0xb06,0x1f2,-0x69e,0xa43)+'hristmas-t'+'ree-text-e'+'ffect-onli'+'ne-free-10'+_0x17318e(0x3e8,0x926,0xcb4,0x727),'hsZBz':_0x425890(0x10d9,0xdaa,0x13b7,0xde2)+_0x17318e(0xee1,0xab4,0x18fd,0xf43)+_0x425890(0x539,0x725,0x5a1,0xbe4)+'s-text-eff'+_0x17318e(0xaa6,0x5ca,0x11ec,0x824)+_0x17318e(0x15cc,0x581,0x1086,0xd7e)+'l','PTXhJ':'https://te'+_0x17318e(0x18d5,0x1770,0x14e6,0x106e)+_0x17318e(-0x3d4,-0x98,0xe69,0x681)+_0x17318e(0x6d2,0xaf6,0x16d2,0xf50)+'mas-text-e'+_0x425890(0x8f5,0x846,0x1f9,0xc93)+_0x425890(0xdbf,0x12aa,0x1193,0x1c7b),'EldqC':'https://te'+_0x17318e(-0x2ea,0xb25,-0x54d,0x40f)+_0x17318e(0xff0,0xf91,0x6cd,0xcf9)+_0x425890(0x1080,0x11a5,0xb43,0x1715)+'tal-text-e'+_0x425890(0x1233,0xdeb,0x87a,0x1468)+_0x425890(0xb7e,0x82e,-0xb5,0x91a)+'ml','laZLe':_0x17318e(0x13e4,0x1565,0xc5e,0xfc7)+_0x425890(0x760,0x1f2,0x97c,-0x7ba)+'reate-3d-s'+'ci-fi-text'+'-effect-on'+_0x425890(0x17b5,0x1023,0x97d,0xdb9)+'html','xJiFl':_0x425890(0x100d,0xdaa,0xa47,0x1674)+_0x17318e(0x1729,0x162b,0xf05,0xf43)+_0x425890(0xee0,0x1317,0x134d,0xd3a)+_0x17318e(0x10aa,0x19d2,0xab0,0x12d9)+_0x425890(0xd3d,0x13d8,0x14c1,0x176f)+'xt-effect-'+_0x17318e(0x1718,0x10a8,0x211e,0x1809),'zXbIP':'https://te'+_0x425890(0xd,0x1f2,-0x191,-0x2f8)+'reate-3d-w'+_0x425890(0x14b9,0x1519,0x1de6,0xb87)+_0x425890(0xcef,0x707,0x8c2,-0xaf)+'ts-online-'+_0x425890(0x520,0x929,-0x20,-0x48),'ifcQO':_0x17318e(0x77a,0xd68,0x181b,0xfc7)+_0x17318e(0x390,-0x247,-0x3f8,0x40f)+_0x17318e(0x1158,0x20a0,0x110b,0x1820)+_0x425890(0x9c1,0x70c,0x95d,0xd33)+'eton-text-'+_0x17318e(-0x5a,0x10,0xa8b,0x75b)+_0x425890(0x27d,0x124,0x902,0x64c)+_0x17318e(0x1b5f,0x14fd,0x1b17,0x1713),'lpOTU':_0x425890(0x5dc,0xdaa,0x4e1,0x1270)+_0x17318e(0x41d,0x685,0xd79,0x40f)+_0x425890(0xbf0,0xc8b,0x10c7,0x1244)+_0x425890(0x931,0x138,-0x318,0xbc4)+_0x425890(0xb4d,0x53e,0x741,0x2cc)+'ine-1044.h'+_0x17318e(0x16d6,0xc8b,0x1d59,0x1713),'JRIwN':_0x425890(0x45b,0xdaa,0x1776,0x317)+_0x425890(0x1bb,0x1f2,-0x7b0,0x91)+_0x17318e(0xef2,0x1db,0xb0a,0xa35)+_0x425890(0xd33,0x6b8,0xefb,0x80f)+_0x425890(0x684,0xc85,0x151c,0xd3e)+_0x17318e(0x305,0x6cc,0x7e6,0x75b)+'ine-1043.h'+_0x425890(0xd04,0x14f6,0x1480,0xa5d),'VqGek':_0x425890(0x325,0xdaa,0x1743,0xe03)+_0x17318e(0xe06,-0x2d8,-0x343,0x40f)+'reate-spac'+_0x425890(0x314,0x23a,0xa00,-0x4fc)+_0x17318e(0x1902,0x1eba,0x1b7c,0x1547)+_0x17318e(-0x52d,-0x4de,0xbf0,0x549)+_0x425890(0xc7f,0x1304,0xb8f,0x1698),'WvJmC':_0x425890(0x827,0xdaa,0x639,0xe78)+_0x17318e(0xd3c,0x54,-0x254,0x40f)+_0x17318e(0x1800,0x12b8,0x1a9f,0x1616)+_0x17318e(0x109a,0x1910,0x15ec,0x17d6)+_0x17318e(0x110f,0x1051,0x1344,0x924)+_0x17318e(0x12bc,0xd78,0xa6d,0x1377)+'ine-1040.h'+_0x17318e(0x195c,0x1418,0x1dfe,0x1713),'BUMGi':_0x17318e(0x114b,0x89d,0x1247,0xfc7)+_0x425890(-0xee,0x1f2,0x47e,-0x373)+_0x425890(0xd8e,0x80b,0x776,0xabd)+_0x17318e(0xfda,0x1430,0x15d7,0x11ef)+_0x425890(0x1b17,0x112f,0x194b,0x1b4f)+'ect-online'+_0x425890(0x786,0x320,0x7d7,-0x3bd)+_0x17318e(0x15e6,0x1268,0x17c5,0x14c7),'BdZGs':_0x425890(0xedb,0xdaa,0xc3e,0x440)+_0x17318e(0x427,-0x183,0xc74,0x40f)+_0x17318e(0xae6,0x1d9d,0x19dd,0x1583)+'n-horror-s'+_0x17318e(0x68c,0x15da,0x9ed,0xea2)+'effect-onl'+_0x17318e(0xa7f,0xeb9,0x1655,0xed8)+_0x425890(0x1b59,0x14f6,0x18fe,0xc06),'jbUjS':'https://te'+_0x17318e(0xd3a,0x632,0x20e,0x40f)+_0x425890(0x28e,0x8b8,0xb32,0xc94)+'ansformer-'+_0x425890(0x1b8,0x707,0x20d,0xb68)+_0x425890(-0xda,0x4b6,0x33f,0x8d)+'035.html','wIIBL':_0x17318e(0x14e1,0x1223,0x7b9,0xfc7)+_0x17318e(0x3eb,0x1c9,0x23,0x40f)+_0x425890(0x1066,0x9d6,0x1034,0x590)+'y-text-eff'+_0x17318e(0x1deb,0x1fbe,0x11ed,0x162c)+'-free-1033'+'.html','vvWVM':_0x17318e(0xd20,0x1a54,0xa88,0xfc7)+'xtpro.me/o'+_0x17318e(0x240,-0x605,0x44b,0x388)+'der-text-e'+'ffect-gene'+_0x425890(0x1368,0x142f,0x1303,0x1e01)+_0x17318e(0x1dd4,0xb89,0x18aa,0x14c7),'phxmh':_0x425890(0x1314,0xdaa,0x9a0,0x893)+'xtpro.me/3'+_0x17318e(0xbbf,0xa1,0xbdd,0x45e)+_0x17318e(0xee7,0x95a,0x1b4b,0x10da)+_0x425890(0x143e,0xe14,0xd3c,0x1543)+_0x17318e(0x1d18,0x1012,0x1f8e,0x1794)+'ml','aZNKA':_0x17318e(0xfae,0xe6f,0x1678,0xfc7)+_0x17318e(0xafe,0xe25,0xab7,0x40f)+_0x17318e(0x1c0c,0xb36,0x1756,0x11bb)+_0x425890(0xffc,0xf7e,0x19c5,0xbe6)+_0x425890(0x4c6,0x707,0xae2,0xb62)+_0x425890(0x85d,0x4b6,-0x544,0x41c)+_0x425890(0x1448,0xdb3,0x5c1,0x103a),'tCYEr':'https://te'+_0x425890(0x3e,0x1f2,0x53e,0x9c)+_0x17318e(0xc26,0xbed,0x14b8,0xd43)+_0x425890(0x522,0xb2f,0xf3d,0xa06)+_0x425890(0x2e2,0x7dc,0xa29,0x106a)+_0x17318e(0x1869,0xb62,0x1613,0x140d)+_0x425890(0xb65,0x95e,0xe32,0x649)+_0x425890(0x11be,0x14f6,0xae8,0xad9),'NtTNY':_0x425890(0xfd7,0xdaa,0x803,0x409)+_0x17318e(0x6a1,0x742,0x422,0x40f)+'reate-harr'+'y-potter-t'+_0x17318e(-0x49c,-0x2c3,-0x8c,0x550)+'-online-10'+_0x17318e(0x1789,0xdda,0x1316,0xd3e),'KgtzY':_0x425890(0xc15,0xdaa,0x104b,0x13f8)+'xtpro.me/b'+_0x425890(0x1b0a,0x1105,0x11ac,0x8df)+'s-text-eff'+'ect-free-o'+_0x17318e(0x1353,0x139f,0x101d,0x153d)+_0x17318e(0x1be8,0x1d32,0xb00,0x14c7),'GEYaB':_0x425890(0xfa6,0xdaa,0x1707,0xaf0)+_0x17318e(0x6f6,0x6d7,0x1c8,0x40f)+_0x17318e(-0x477,0x99b,0x3a7,0x625)+_0x17318e(0x289,0x56c,0x728,0x79b)+_0x425890(0xb3b,0x707,0x7b4,0x9e2)+_0x425890(0x57b,0x4b6,0x24c,0xbaf)+_0x425890(0xfb,0x7eb,0x79c,0x56a),'TYIxa':'https://te'+_0x425890(0x2f9,0x1f2,-0x7bc,0xc02)+_0x425890(0x1066,0x1499,0x11d8,0x1a51)+_0x425890(0x144a,0xf9c,0xbac,0x1387)+_0x425890(0xa25,0xdbb,0x430,0xe3d)+_0x17318e(0xddb,0x12ab,0x1817,0x1031)+_0x425890(0x10fc,0x12c7,0x1953,0xc5f)+'ml','YfrsJ':_0x17318e(0xb46,0x682,0x7e1,0xfc7)+_0x17318e(0xaf3,0x133c,0x9c0,0x8b1)+_0x17318e(0xcad,0x189f,0xdfb,0x1131)+_0x17318e(0x3a2,0xaf4,0xb8d,0x5d0)+_0x425890(0x80f,0x57e,0x785,0xb98)+_0x425890(0x98c,0x707,0xef,0x112b)+'t-1016.htm'+'l','mfEkH':'https://te'+'xtpro.me/3'+_0x17318e(0x109b,0x1338,0x134a,0x9ae)+_0x425890(0x6dd,0x114c,0x1891,0x1614)+_0x17318e(0x156c,0x1937,0x9c7,0x110d)+_0x425890(0x1ca3,0x12c0,0x1d28,0x1b5b)+_0x425890(0x63a,0x427,0xd8a,0x585)+'l','hPziz':_0x17318e(0x16ff,0x550,0x61a,0xfc7)+_0x17318e(0x20c0,0xe49,0x2257,0x17db)+'oney-text-'+_0x17318e(0xc04,0x489,0x83a,0x8ab)+_0x17318e(0x1bde,0xbc7,0x1b0a,0x14c7),'Szvpj':_0x425890(0xc56,0xdaa,0x601,0x583)+_0x17318e(0x4f2,0x1b6,0x4f,0x8a0)+_0x425890(0x1b7d,0x1221,0x12f6,0x8c0)+_0x425890(0x646,0x2aa,0x360,-0x1b4)+_0x17318e(0x9d5,0xbbc,-0x312,0x3a2),'nrusu':'https://te'+_0x425890(0x7fa,0x1153,0x1872,0xce9)+_0x17318e(0x798,0x162e,0xe1d,0xcdf)+_0x17318e(0xd14,0x1925,0x14ca,0x1031)+_0x17318e(0x9df,-0x13d,0xe18,0x668)+'l','NtPiB':'https://te'+_0x425890(0x1185,0xec6,0x773,0x495)+_0x17318e(0x18cb,0x112c,0x1932,0x1767)+_0x425890(0xcf1,0x14d0,0x1764,0xbbb)+'58.html','xMlld':_0x17318e(0x12d5,0x725,0x11ea,0xfc7)+'xtpro.me/w'+'ood-text-e'+_0x425890(0xcba,0x1370,0x1172,0x151a)+_0x17318e(0x1c0,0x349,0x24e,0x982),'yuVoX':_0x17318e(0x76f,0x1049,0x97c,0xfc7)+_0x17318e(0x1fbf,0x2215,0x144c,0x17db)+'orror-bloo'+_0x425890(0x1a17,0x161d,0x1dd7,0x19ad)+'ect-online'+_0x425890(0x11f3,0xb76,0x58a,0x155c),'FtEQd':'https://te'+'xtpro.me/d'+_0x425890(0xa6b,0x3ce,0x51f,-0x36a)+_0x17318e(0x2c4,0x9c4,0xf3c,0x550)+_0x425890(-0x8e5,0x12d,-0x8be,-0x162),'wcdKd':_0x425890(0x66f,0xdaa,0xa1a,0x14ec)+_0x17318e(0x40c,0xf81,0x63f,0xdba)+'oxic-text-'+_0x17318e(0x60d,0xb13,0x19b,0x75b)+_0x425890(0x132c,0xce5,0x31e,0x911)+'ml','nKMen':'https://te'+_0x17318e(0xafe,0x13be,0x1510,0xe42)+_0x425890(0x369,0x202,0x7c6,-0x17c)+_0x17318e(0x18e8,0x1101,0x56e,0x1008)+_0x17318e(0x827,0xb47,0x1047,0x114e)+'l','DBUiY':_0x17318e(0x1428,0x9bc,0xfe3,0xfc7)+_0x425890(0x4d9,0xd5a,0x35c,0x12d4)+_0x425890(0x1b51,0x13d9,0x991,0x174d)+_0x425890(0x167a,0xdeb,0x11f4,0x17d6)+_0x17318e(-0x1c3,0x90b,0x10e6,0x76a)+'l','MQoyX':_0x17318e(0x86f,0x1554,0x652,0xfc7)+_0x425890(0x645,0xec6,0xa33,0x14ae)+_0x17318e(0x873,0x1380,0x986,0xe43)+'on-the-fro'+_0x425890(0x1af0,0x1363,0x1d6b,0x1b83)+_0x17318e(0x1bc4,0x12f0,0x1053,0x115c),'skSUe':_0x425890(0x735,0xdaa,0x11c4,0x7ed)+_0x425890(0x1956,0x15be,0x1619,0xcb0)+_0x425890(-0x65f,0x335,0x950,0x2b8)+_0x425890(0xc92,0xfee,0x1410,0x1752)+_0x17318e(0x1bdc,0x1656,0xcfd,0x16d2)+_0x17318e(0x11c5,0xa6a,0x196,0x982),'vJzOI':_0x425890(0xd54,0xdaa,0xe3a,0x6e0)+_0x425890(0x101,0x2b6,-0x775,0xb79)+_0x425890(0x19e5,0x136a,0x1c9c,0x12e1)+_0x425890(0x127d,0xddb,0x15af,0xcc5)+_0x17318e(0xe5d,0x951,0x664,0x75b)+_0x17318e(0x1742,0x12a0,0x6f4,0xfa0)+'ml','jAKLq':_0x425890(0x860,0xdaa,0xce5,0x49c)+_0x425890(0x375,0x1f2,0x8f9,0x2eb)+_0x17318e(0xc10,0xb14,0x1296,0xf7c)+'-joker-onl'+_0x17318e(0xfb5,0x9e7,0xf2a,0xf81)+'ml','CJyfK':_0x17318e(0xeae,0x1288,0x1617,0xfc7)+_0x425890(0x7fa,0x495,0x640,-0x559)+_0x425890(0xd,0x92a,0x153,0xe19)+'-effect-on'+_0x17318e(0x524,0x1198,0x606,0xb73)+_0x425890(0x1e7c,0x14f6,0xe88,0x1f6f),'rbcTT':_0x17318e(0xe01,0x1a66,0x97b,0xfc7)+_0x17318e(0x1147,0x191f,0x98d,0x1370)+_0x425890(0x258,0xc17,0x13de,0x126c)+_0x425890(0x6ec,0x94c,0x174,0x431)+'-effect-93'+'0.html','AlkEo':_0x17318e(0xf26,0x1536,0x184f,0xfc7)+'xtpro.me/s'+_0x17318e(0x119d,0x2d1,0x1127,0xaa5)+'xt-effect-'+_0x17318e(0x706,0xf63,0xab,0x9ea)+_0x17318e(0xacf,0x172a,0x1d8c,0x14c7),'DYwTO':_0x17318e(0x1465,0x1171,0x102d,0xfc7)+'xtpro.me/c'+'reate-blac'+_0x425890(0x867,0x80d,0x6b,0xb25)+_0x17318e(0xf18,0x67e,0x34b,0xb41)+_0x17318e(0xc2b,0x142e,0xf5d,0x1319)+_0x425890(0x12d9,0x14f6,0x19e1,0x124a),'IoPTB':_0x425890(0x14e6,0xdaa,0xd3e,0xb15)+'xtpro.me/w'+_0x425890(0x793,0x535,-0x412,0xa76)+_0x425890(0x938,0xaf4,0x890,0x3ee)+_0x425890(0xd81,0x477,-0x3f4,0x9b6)+_0x425890(0x192e,0x1567,0x1313,0xc4e)+'1.html','lXNSO':_0x17318e(0x93d,0xba4,0xf62,0xfc7)+_0x17318e(0x16f3,0x1145,0x194e,0x1024)+_0x17318e(0x842,-0x3ac,0x13e,0x5cc)+_0x17318e(0x1114,0x64d,0x6c7,0x924)+'t-online-9'+_0x17318e(0x6ad,0x128d,0xdce,0x95a),'wgrvt':'https://te'+_0x17318e(0x141b,0x1f43,0x1159,0x17ef)+_0x17318e(0xc53,0xdc6,0x1870,0xddd)+_0x425890(-0x20f,0x460,0x8ae,0x951)+_0x425890(0x70,0xa58,0x2ea,0x660)+_0x425890(-0x207,0x765,0x48,0x85b),'ozKYt':_0x425890(0x70a,0x26c,0x6e4,0x471),'TKTiQ':function(_0xfb16fc,_0x50c36c){return _0xfb16fc(_0x50c36c);},'cMciG':'RYafQ','zpjgt':_0x17318e(0xa31,0xdeb,0xc89,0x1262)+_0x425890(0x904,0x12f4,0xd7e,0x1157),'ZTzXs':function(_0x104833,_0x20098d){return _0x104833+_0x20098d;},'hFndt':function(_0x45ea86,_0x191e11){return _0x45ea86+_0x191e11;},'rpJbq':function(_0x57b3d0,_0x26e250){return _0x57b3d0+_0x26e250;},'vFskI':_0x17318e(0x1c07,0x1d20,0x1e16,0x174a),'gZcOD':'cry','IiQFj':'kill','SdUhX':_0x425890(0x236,0x627,0x3f5,0xe5c),'BCHuf':_0x17318e(0xeee,0x23c,0x4be,0x8e7),'DVEpN':'yeet','juJqh':_0x17318e(0x96f,0x170c,0xf9d,0xeae),'BkEhd':_0x17318e(0x60d,0x8e4,0xe39,0xb90),'FVABN':'poke','hCWbj':_0x17318e(0xa0b,0x145a,0x567,0xcfe),'GHGYN':_0x425890(0x11c9,0xe95,0x18d8,0x1436),'fIdMe':'wave','xjkAq':_0x425890(0x1169,0xb3f,0x580,0xf4f),'vrHRE':'blush','LkkbQ':'smug','DBJzR':_0x17318e(0xcb2,0x4ec,0x5b0,0x95f),'oAdGO':'dance','wRYat':'cringe','zOcMo':'highfive','xpeOD':_0x17318e(0x982,0x1431,0x1357,0x1342),'jYWgi':_0x425890(0x4f,0x89b,0x658,0x908),'sRjAQ':function(_0x30965c,_0x19e157){return _0x30965c(_0x19e157);},'fjviU':'loli','FbckL':function(_0x4c1e42,_0x443b6c){return _0x4c1e42(_0x443b6c);},'NijuB':_0x17318e(-0x24c,0x89c,0xe,0x3f0),'wTRVs':function(_0x393312,_0x338d60){return _0x393312(_0x338d60);},'ypDNm':_0x17318e(0x16ef,0x14e0,0x6c9,0xf92)+'.\x20list\x0a3.\x20'+_0x425890(0xddd,0x7b9,0x6bc,0x2ea)+'xample\x20.se'+_0x425890(0x9f8,0xb16,0x1190,0x706)+'e','BFSmP':_0x425890(0xb04,0xdc4,0x671,0x1650),'uQzkM':function(_0x2a52a4,_0x4a2851){return _0x2a52a4===_0x4a2851;},'SeOHv':_0x17318e(-0x1b,0x3db,0x500,0xa0b),'VhULi':_0x17318e(0x12ec,0x117b,0x1766,0x119d),'hCgrK':function(_0x36aece,_0x153439){return _0x36aece(_0x153439);},'EPVaK':function(_0xdb592f,_0x78e735){return _0xdb592f+_0x78e735;},'XygZW':_0x17318e(0x178a,0x2f0,0x554,0xd0b),'bJPfe':_0x17318e(0xf77,0x9e5,0x638,0xfbd),'tPHoc':'alive','UdqTf':function(_0xda325){return _0xda325();},'cWifs':function(_0x4e6107){return _0x4e6107();},'FTVpM':function(_0x3b0685,_0x102225){return _0x3b0685(_0x102225);},'MzloY':_0x17318e(0x587,0x15e3,0x1993,0xf0a)+_0x17318e(0x796,0xf5a,0x7ad,0x756)+_0x425890(0x8fb,0x38e,0x8b9,0x2a6)+_0x425890(0xb58,0x5cb,-0x1c8,-0x215)+_0x425890(0x6fe,0xfc5,0xf5a,0x1736),'pPmJR':function(_0x33c4f6,_0x3e0213){return _0x33c4f6+_0x3e0213;},'JtHyc':function(_0x3a8a82,_0x3fbde4){return _0x3a8a82+_0x3fbde4;},'iBFQw':_0x17318e(0x785,0x575,0xc9b,0x8f0)+_0x17318e(0xce0,0x38a,0x86a,0x6c8),'MwvMP':'https://si'+_0x17318e(-0xd8,-0x109,-0x28a,0x7da)+_0x425890(0x164,0x52f,0x302,0x4fb)+_0x17318e(0x172e,0x170d,0x144f,0x170f)+'-bot/home','QmOIJ':function(_0x3e0a9a,_0x5bcfb7){return _0x3e0a9a(_0x5bcfb7);},'vkYcL':function(_0x1f2f55,_0x3a4c72,_0x524210,_0x4ddd19){return _0x1f2f55(_0x3a4c72,_0x524210,_0x4ddd19);},'okyUO':_0x17318e(0x1a62,0xf5f,0x1661,0x163c)+_0x425890(0xd20,0x81a,0x10dd,0xd01),'GUBSb':_0x17318e(0x3ac,0x9b5,0x1268,0xcfd)+_0x425890(0x46a,0x3ab,-0x36a,0x7d1),'bohLw':_0x17318e(0xd00,0xb74,0xd08,0x6d9)+_0x17318e(0x6ce,0x9fa,0xda9,0x1057),'IpRcI':_0x17318e(-0x1a5,0x735,0xb27,0x6b0)+_0x17318e(0x132,0x186,0x2ac,0x40d)+_0x17318e(0x299,0x3de,0x333,0x5bf)+_0x17318e(0x1afa,0x1733,0x1d9b,0x13e5),'vwNZz':_0x17318e(-0x636,0x657,-0x32e,0x32b)+'res🪐','wssRz':_0x425890(0xd4a,0x2d7,0xe8,0x712),'YpDha':_0x425890(0x2cf,0x493,0xa4e,0x898)+_0x425890(0x924,0x1f0,0x2f1,0xa69)+_0x17318e(0x677,-0x336,0x28a,0x3c4)+_0x17318e(0x1c93,0x12b0,0x894,0x1217),'poSBi':_0x425890(0x97c,0x998,0x1a3,0xc97)+'u','ZEyLg':'Displays\x20T'+'he\x20List\x20Of'+_0x425890(0xc0f,0x832,0x97e,0x4f4)+'tures','irXnU':'🎸Group\x20Men'+'u','ZHlxO':'🎸Rpg\x20Menu','XwNYP':_0x425890(0x90b,0x493,0x8e4,0xa65)+'he\x20List\x20Of'+_0x17318e(0x1007,0xbb6,0x71a,0xcf4)+_0x425890(0x1b4f,0x1491,0x1646,0x1ec8),'ftgBB':_0x425890(0x516,0x493,-0xf2,0xe47)+_0x17318e(-0x555,0xe6,0xc50,0x40d)+_0x425890(0x1553,0xcf6,0x838,0xd53)+'Features','vskmd':'🎸Search\x20Me'+'nu','HHKIH':_0x425890(0x28a,0x493,0x26d,0x1d4)+_0x425890(0x939,0x1f0,0x2b2,0x800)+_0x17318e(0x10e7,0x1b74,0x1adb,0x1242)+'\x20Features','fZzBq':_0x17318e(0x1a4c,0x17e2,0x18b4,0x1700)+'nu','InMwR':_0x425890(-0x57,0x514,0xb8b,0xd0c)+_0x17318e(0x9be,0xc1c,0xb46,0x78e),'dhRTX':_0x17318e(0x670,-0x3a,0x4da,0x6b0)+_0x17318e(0xdfa,-0x585,0x58d,0x40d)+_0x17318e(0xd73,-0x386,0x55,0x3a0)+'ime\x20Featur'+'es','cLTKI':_0x17318e(0xd58,0x1cfb,0xa48,0x1455),'lOnSy':_0x17318e(0xf4f,0xcf1,-0x3c8,0x6b0)+_0x17318e(-0x61c,0x59,0xe19,0x40d)+_0x17318e(0x1293,0x16af,0xb2f,0xf2f)+_0x425890(0x1d86,0x1491,0x1af6,0x1284),'MhPrx':_0x17318e(-0x298,0xe98,0xd71,0x6cd)+_0x425890(-0xb2,0x11d,0x47,-0x35d),'AyHnR':_0x425890(0xe3b,0x493,0x11e,0x705)+'he\x20List\x20Of'+_0x425890(0xeca,0xc77,0xd7d,0x134b)+'Features','cEjXH':_0x425890(0x640,0xd6a,0x402,0x57b)+_0x17318e(0x11eb,0x1802,0x21ae,0x1792),'VqpTW':_0x17318e(-0x68,0xe3f,0x260,0x6b0)+_0x17318e(-0x33c,0x9a8,0x868,0x40d)+'\x20Textpro\x20F'+'eatures','tIdzz':_0x17318e(0x25,0x1104,0xc3f,0x6b0)+'he\x20List\x20Of'+_0x425890(0x12b3,0xde0,0x593,0x6eb)+_0x425890(0x161,0x288,-0x424,0x81),'LKfow':_0x17318e(0x39d,0x184,0xcfd,0x74e)+_0x425890(0x1123,0x100d,0x17f9,0x90b),'ggbiT':_0x425890(0x943,0x493,-0x480,-0x3be)+_0x17318e(0x505,0xc4c,0x56e,0x40d)+_0x17318e(0x1bec,0xacd,0x1c2f,0x127d)+_0x17318e(0xa82,0xdd4,0x9ca,0xf67),'pjDpF':'🪐Chat\x20With'+'\x20Fellow\x20Us'+_0x425890(0x11da,0xa62,0x1226,0x889),'tdDko':_0x425890(0x1438,0x1144,0x1b1d,0x1871)+'\x20Chat\x20Menu','LRYEH':_0x17318e(0x12b,0x966,0x6b2,0x6b0)+_0x17318e(0x383,-0x13c,0xb68,0x40d)+_0x17318e(0xb5c,0xb2d,0x197a,0x1464)+_0x17318e(0xa34,0x1aad,0x1ba8,0x14b8)+'!','yiLRE':_0x425890(0x1b53,0x1534,0x1610,0x1596),'RVNdx':_0x425890(0xcf7,0x339,-0x6da,0xdaf),'YwLXw':_0x425890(0x17ba,0x1367,0xd41,0x1dc3),'QYzvK':function(_0x5b10a6,_0x55fda4){return _0x5b10a6!==_0x55fda4;},'DRBRF':_0x425890(0x16e3,0x1336,0xe68,0xdfa),'Trxlg':'https://i.'+_0x17318e(0x7af,0x1135,0x1281,0xe26)+_0x17318e(0x1595,0x1288,0x5f6,0xe1a)+_0x425890(0x11f5,0x1640,0x19db,0x1140)+_0x425890(0x17ea,0xfc5,0x1a2f,0x14b5),'POEwO':_0x425890(0xbf4,0xd8a,0x39a,0x792),'yvYmI':'scan','EQCvC':'*📷\x20Scan\x20Me'+_0x425890(0xf6c,0x1429,0x1194,0x1727)+_0x17318e(0xd31,0x1160,0x1bb4,0x1307)+_0x425890(0xd6d,0x7de,0x67c,0xa85)+_0x425890(0x790,0x2a6,0x84a,0xc32),'cMECj':function(_0x4e87d7,_0x3cc38e){return _0x4e87d7!==_0x3cc38e;},'tYcrU':function(_0x4c758b,_0x2e5cbc){return _0x4c758b(_0x2e5cbc);},'yTAmh':'update','aAiNk':_0x17318e(0x13c5,0x6bd,0x3e7,0xb78)+'e','YvuPH':'version','Wflkq':_0x425890(-0x215,0x2ff,0xd9a,0x3f7),'nELgy':'menuall','jKwWA':function(_0x3fd41e,_0xa796a7){return _0x3fd41e===_0xa796a7;},'Ntvnp':_0x425890(0x86a,0x169,-0x352,-0x30c),'QCivM':_0x17318e(0xdc6,0xc72,0x9b4,0x4bf),'LbMkf':_0x17318e(0x9a4,0xb03,0xabe,0x13ef),'dljtb':_0x425890(0x372,0xc64,0x100f,0x15ef),'rAIaT':_0x17318e(0x1f84,0x1f68,0x1525,0x171c),'fwjWA':_0x17318e(0x198e,0xa9a,0x1a0d,0x1155),'ebYXf':_0x425890(0x6bc,0xfe6,0xca1,0xa0a),'FEgqN':function(_0x407d08,_0x103228){return _0x407d08!==_0x103228;},'ybKuw':'CmGxc','ikIEb':function(_0x5a815b,_0x1907fb){return _0x5a815b+_0x1907fb;},'aSeEv':_0x17318e(0xabc,0x49d,0x1115,0x757),'MiFxF':_0x425890(0x312,0xb2c,0x712,0xb53),'vxdjh':_0x17318e(0x9f0,0x1ec,0x1385,0xb06),'IxasU':_0x17318e(0xe9f,0x1697,0x157e,0x1363)+'u','yzaYd':_0x17318e(0x3ff,0x49e,-0x4b5,0x4dc),'Xgaiz':function(_0x322800,_0x269a51){return _0x322800+_0x269a51;},'qstPK':_0x17318e(0x1d46,0x119f,0x1d81,0x1640),'TrSVP':function(_0x43178c,_0x7fd51){return _0x43178c+_0x7fd51;},'UCegp':_0x425890(-0x3ef,0x37e,-0x1a0,0x999)+'nu','LSApu':function(_0x226f73,_0x41520e){return _0x226f73!==_0x41520e;},'TgKCL':'ozsJc','JqpIC':_0x425890(0x1b1f,0x1082,0x1726,0x10c8)+'u','lzuCv':_0x17318e(0x7fc,0x174,0xfe,0x8bc)+_0x17318e(0x6e3,0x120b,0xf4f,0xa6f),'KmcvO':'AnuZM','loFIL':_0x425890(0x140a,0x1338,0xe12,0x1a6e)+_0x17318e(-0x138,0xbb2,-0x45e,0x5e1),'WaduK':'horoscopem'+'enu','szieK':_0x17318e(-0xc8,0xedf,0xb66,0x803),'UjvUQ':_0x17318e(0x1600,0xc1a,0x17f9,0x1559),'lSIlA':_0x17318e(0x1d62,0x1a4f,0x10b8,0x17cf),'xEQEC':function(_0x18cf16,_0x20901f){return _0x18cf16+_0x20901f;},'JLEnZ':'Developer','ERivw':_0x17318e(0xe77,0x8bc,0x96d,0x8f0)+_0x425890(0x2e6,0x980,0x1147,0x6a0),'sXIfY':function(_0x3d6035,_0x436946){return _0x3d6035(_0x436946);},'zNFQS':function(_0x10e9f1,_0x9286da){return _0x10e9f1!==_0x9286da;},'FQnOX':_0x425890(0x189a,0xe16,0x61a,0x118a),'JNuyx':function(_0x2df7bc,_0xedd511){return _0x2df7bc(_0xedd511);},'OLIzM':function(_0x37e836,_0x3c2300){return _0x37e836(_0x3c2300);},'tdSZi':_0x425890(0x148b,0xd28,0xe80,0xe75),'iFpyN':function(_0x57fb9e,_0x411837){return _0x57fb9e(_0x411837);},'pfrrs':'sHyPg','OyyCQ':function(_0x1dec89,_0x4bd234){return _0x1dec89(_0x4bd234);},'dIuOq':_0x17318e(0xa68,0x771,0x4ef,0x5f5),'TFtup':_0x17318e(0xda2,0x1a23,0xf9a,0x173b),'hLdBQ':_0x425890(0x3bd,0x32e,0x14c,0x3ea),'oKrpx':'.stop','XAsdL':_0x425890(0xc15,0x150e,0x1ec9,0x1a1e),'QFDew':'Lanjut','GAgZY':'Stop','scmhA':function(_0x22d720,_0x59ed48){return _0x22d720!=_0x59ed48;},'kHKtS':function(_0x2d7c62,_0x2d09f9){return _0x2d7c62 in _0x2d09f9;},'Ijfnd':function(_0x58610b,_0x55ac55){return _0x58610b===_0x55ac55;},'CrTuW':_0x17318e(0x141b,0x1de4,0x188c,0x17e1)};try{if(_0x425890(0x17d9,0x1130,0x1250,0xddb)!==_0x295ea5[_0x425890(0x15fe,0xd74,0x4e4,0x1061)]){let _0x623e4d=_0x19eb5a['messages'][_0x286068][_0x17318e(0x177,0xd9b,0x7e8,0xbff)][-0x362*0x1+0x4d4+0x2*-0xb9]['pushName'];_0x15f18f+=_0x425890(0x1564,0xc66,0x12e1,0x560)+'\x20'+_0x623e4d+(_0x17318e(0xb5b,0x28c,0xf87,0x6e8)+_0x17318e(0xf0a,0x1377,0x1856,0x1226))+_0x1fa865[_0x425890(0x407,0x2eb,-0x462,0x141)]('@')[0x1a64+0x446*0x6+-0x3408]+('\x0a💫\x20*Chat\x20:'+_0x17318e(0xa5a,0x1526,0x1953,0xeca)+'wa.me/')+_0x4eb71f[_0x17318e(0x78b,0xbc7,-0x8e,0x508)]('@')[-0xcdd+0x224e+-0x1571]+(_0x425890(-0x48c,0x2f0,0x14b,0x1af)+_0x17318e(0xc9b,0x13fe,0x67d,0xf07)+_0x17318e(0x4e5,0x161a,0x8bb,0xb8a));}else{var _0x37da11=_0x17aa6d[_0x425890(0xf1a,0xc31,0xa3a,0xce6)]===_0x17318e(-0x17,0xae7,0x5b2,0xa56)+'on'?_0x17aa6d[_0x17318e(0x239,0x11b8,0x4a3,0x9e0)][_0x17318e(0xe7d,0x566,0x3bf,0xa56)+'on']:_0x295ea5[_0x425890(0xa6b,0x10ae,0x155e,0x1252)](_0x17aa6d['mtype'],_0x295ea5[_0x425890(0xe1d,0x5e3,0x5a7,0xdfb)])?_0x17aa6d[_0x17318e(0xe5a,-0x2e,0x4be,0x9e0)][_0x425890(0x1cb5,0x13be,0x1953,0xbcc)+'ge'][_0x425890(0x72e,0x30a,0x3ab,0x5d6)]:_0x17aa6d['mtype']==_0x295ea5['MWrSn']?_0x17aa6d[_0x425890(0xcb,0x7c3,0x6cd,0x602)]['videoMessa'+'ge'][_0x17318e(-0x2a8,0xaab,-0x45f,0x527)]:_0x17aa6d[_0x17318e(0xca1,0xc24,0x655,0xe4e)]==_0x295ea5[_0x17318e(0x125d,0xa23,0x18ca,0xf22)]?_0x17aa6d[_0x17318e(0x4f1,0x1430,0x9e5,0x9e0)][_0x17318e(0x6,0x7f7,0x4b2,0x8a6)+'xtMessage'][_0x425890(-0x88,0x1e8,-0x3be,-0x314)]:_0x295ea5[_0x17318e(0x1854,0x186b,0xa36,0x12cb)](_0x17aa6d[_0x425890(0xedf,0xc31,0xf46,0x1503)],_0x295ea5[_0x425890(0x8da,0x21b,0x59b,0xb9d)])?_0x17aa6d[_0x425890(0x11e3,0x7c3,0xfcb,-0x197)]['buttonsRes'+_0x17318e(0xa5b,0xb50,0x58d,0x4be)+'ge'][_0x425890(0x176b,0x1622,0x20b3,0x1dd1)+_0x17318e(0x5cf,0x53,0x8d8,0x5d1)]:_0x17aa6d[_0x425890(0x50c,0xc31,0x1217,0xb87)]==_0x295ea5['YmTjP']?_0x17aa6d[_0x425890(0x7dd,0x7c3,-0x6b,0x123)][_0x425890(0xaa9,0xe74,0x14f4,0x120c)+_0x425890(0xba8,0xe58,0x87e,0x16a7)]['singleSele'+_0x17318e(0xb30,0x25,0x118a,0x795)]['selectedRo'+_0x425890(0xda5,0x136e,0x9e0,0x1bf3)]:_0x295ea5['rbhAz'](_0x17aa6d[_0x17318e(0x176b,0x1053,0x1083,0xe4e)],_0x295ea5[_0x425890(0xf03,0x1090,0x73f,0x191e)])?_0x17aa6d['message'][_0x425890(0x1b3,0x76f,-0x1d,0xfed)+_0x17318e(0x106f,0x1ebf,0x10c8,0x1703)+_0x425890(0x5ab,0x66b,0x385,-0x227)][_0x17318e(0x145f,0x14bf,0x1da4,0x14bc)]:_0x295ea5[_0x17318e(0xb8e,0xe35,-0x500,0x57f)](_0x17aa6d['mtype'],_0x295ea5[_0x17318e(0x190a,0xda0,0x1176,0x1827)])?_0x17aa6d[_0x425890(-0x64,0x7c3,0x743,0x92b)][_0x17318e(0xa37,-0xe8,0x764,0x869)+'ponseMessa'+'ge']?.['selectedBu'+'ttonId']||_0x17aa6d[_0x17318e(0xd2c,0x112c,0x117e,0x9e0)][_0x17318e(0x10b5,0xc8b,0x1025,0x1091)+_0x425890(0x12e8,0xe58,0xba2,0x1289)]?.['singleSele'+_0x425890(-0x174,0x578,0xa20,0x39e)][_0x17318e(0xf19,-0x329,0x7a,0x642)+_0x425890(0x107c,0x136e,0x1a68,0x1407)]||_0x17aa6d[_0x425890(-0x772,0x1e8,-0x63e,0x308)]:'',_0x5af26d=typeof _0x17aa6d['text']==_0x295ea5[_0x17318e(0x18a5,0x146e,0x1764,0xfd5)]?_0x17aa6d[_0x425890(-0x334,0x1e8,-0x2b,0x3b7)]:'',_0x4fea53=prefa?/^[°•π÷׶∆£¢€¥®™+✓_=|~!?@#$%^&.©^]/gi[_0x425890(0x151d,0xd86,0xe77,0xe4a)](_0x37da11)?_0x37da11[_0x425890(0xf60,0xdca,0x15aa,0x364)](/^[°•π÷׶∆£¢€¥®™+✓_=|~!?@#$%^&.©^]/gi)[-0xc9d+-0x6bc*0x5+0x1*0x2e49]:'':prefa??global['prefix'];const _0x13557e=_0x37da11['startsWith'](_0x4fea53),_0x1cbc75=_0x37da11[_0x17318e(0xd15,0x1084,0x198,0x82e)](_0x4fea53,'')[_0x425890(-0xaf,0x54c,-0x12d,0x719)]()['split'](/ +/)[_0x425890(0xe4a,0xcf4,0x1378,0x608)]()['toLowerCas'+'e'](),_0x52a010=_0x37da11['trim']()[_0x17318e(-0x42,-0x500,0xe7a,0x508)](/ +/)['slice'](-0x74b+-0x36e+0xaba),_0x2cbadb=_0x17aa6d[_0x425890(-0x3dc,0x634,0xd3c,-0x38d)]||_0x295ea5['YEqWA'],_0x1b370d=await _0x3797bd['decodeJid'](_0x3797bd[_0x17318e(0x1062,0x1d46,0xb5f,0x12db)]['id']),_0x193cb6=[_0x1b370d,...global[_0x17318e(0x1725,0x157a,0xb72,0x1494)]]['map'](_0x2efe6f=>_0x2efe6f[_0x425890(0xda3,0x611,-0x272,-0x161)](/[^0-9]/g,'')+(_0x17318e(0x883,-0x492,0xf53,0x53f)+_0x425890(0x59,0x649,0xfcd,0x2ce)))[_0x17318e(0x121,0x649,0x9e,0x4ae)](_0x17aa6d['sender']),_0x187df8=_0x17aa6d[_0x425890(0xb7a,0xa69,0xe58,0x798)]==_0x1b370d?!![]:![],_0x116129=q=_0x52a010[_0x17318e(-0x28f,0x75f,0x7f7,0x712)]('\x20'),_0x4413ec=_0x17aa6d[_0x425890(0x1262,0x807,0x1292,0x105c)]?_0x17aa6d['quoted']:_0x17aa6d,_0x4f303f=(_0x4413ec['msg']||_0x4413ec)[_0x17318e(0x1718,0x8be,0x13be,0x101b)]||'',_0x531e09=/image|video|sticker|audio/[_0x17318e(0x1916,0xb36,0x136e,0xfa3)](_0x4f303f),_0x146a84=mek['key'][_0x17318e(0x5d7,0x1466,0x1530,0xb1c)],_0x1d324e=Object['keys'](mek['message'])[-0x1293*-0x2+0xd3*0x2e+0x4b10*-0x1],_0x390d97=JSON[_0x425890(0x77d,0xd7b,0x3f2,0x1015)](mek[_0x425890(0xdef,0x7c3,-0x123,0xe71)]),_0x4d20ab=_0x17aa6d[_0x17318e(-0x47d,0xaf1,0xa05,0x532)]?await _0x3797bd['groupMetad'+'ata'](_0x17aa6d[_0x425890(0x904,0xcc7,0xc77,0x3ad)])[_0x425890(0x9f3,0xecb,0xda6,0x12c4)](_0x18341e=>{}):'',_0x3f5bce=_0x17aa6d[_0x425890(0x227,0x315,0xc8a,0xd61)]?_0x4d20ab[_0x425890(0xb72,0x11ba,0x176f,0xf27)]:'',_0x8ee05e=_0x17aa6d[_0x425890(-0x503,0x315,0xb16,-0xee)]?await _0x4d20ab[_0x425890(0xfa3,0x143a,0x1a85,0xcf1)+'ts']:'',_0x110feb=_0x17aa6d[_0x17318e(0x3c,0xdfb,0x36d,0x532)]?await _0x8ee05e['filter'](_0x3f9f68=>_0x3f9f68[_0x17318e(0x1ccb,0xc41,0x1e77,0x16d4)]!==null)['map'](_0x599dd6=>_0x599dd6['id']):'',_0x5082e1=_0x17aa6d['isGroup']?_0x4d20ab[_0x17318e(0x19f2,0x1506,0xf88,0x1494)]:'',_0x1a2061=_0x17aa6d[_0x17318e(-0x283,0xf78,0xfa9,0x532)]?_0x110feb['includes'](_0x1b370d):![],_0x5b4303=_0x17aa6d[_0x17318e(0x3bb,0xfb3,0x7dd,0x532)]?_0x110feb[_0x425890(0x88,0x291,-0x46e,0x2ea)](_0x17aa6d[_0x425890(0x424,0xa69,0x799,0xbd6)]):![],_0x52a0da=_0x193cb6||global[_0x17318e(0x7f9,0x1660,0xf6d,0x1156)][_0x425890(0x291,0xb6f,0xcf6,0xf59)](_0x41614f=>_0x41614f[_0x425890(0x77f,0x611,0x6d3,-0x31d)](/[^0-9]/g,'')+(_0x17318e(0xf00,0x6ae,-0x349,0x53f)+'p.net'))[_0x17318e(-0x224,0xc42,0x2cc,0x4ae)](_0x17aa6d[_0x425890(0x4c8,0xa69,0x13d9,0x130c)])||![];let _0x4fb2b8=[flaming,fluming,flarun,flasmurf],_0x58a5bf=_0x4fb2b8[Math[_0x425890(0x116f,0x1415,0x180f,0x1d22)](Math['random']()*_0x4fb2b8['length'])];try{let _0x573f90=_0x3f83d7=>typeof _0x3f83d7===_0x425890(0xc26,0x1559,0x1757,0x1860)&&!isNaN(_0x3f83d7),_0x397ca5=_0x52a0da?global[_0x17318e(0x4ea,0x5fd,0x1495,0xf56)][_0x17318e(0x1bb4,0x19ad,0x14c5,0x1156)]:global[_0x17318e(0x1644,0x5bd,0x1399,0xf56)][_0x425890(0xc78,0x916,0x1043,0x123d)],_0x26e4f7=global['db'][_0x17318e(0xbe7,0x34d,0xf51,0xced)][_0x17318e(0x7b2,0x17d6,0x16de,0xf73)][_0x17aa6d['sender']];if(_0x295ea5['VFPcz'](typeof _0x26e4f7,_0x295ea5['TXafp']))global['db'][_0x425890(0xbf,0xad0,0xfae,0x3c1)][_0x425890(0x6bf,0xd56,0x12ad,0x13e5)][_0x17aa6d['sender']]={};if(_0x26e4f7){if(_0x295ea5['LqydG'](_0x295ea5[_0x17318e(0x16c8,0x90a,0xe5a,0x122c)],_0x295ea5['qMOYL'])){if(!_0x295ea5['kKkdg'](_0x573f90,_0x26e4f7[_0x17318e(-0x2d8,-0x43b,-0x222,0x3a4)]))_0x26e4f7[_0x17318e(0x301,-0x482,-0x424,0x3a4)]=-(-0x469*0x3+0x20c+0xb30);if(!_0x295ea5[_0x17318e(0x1622,0x116a,0x1bee,0x121e)](_0x295ea5[_0x17318e(0x9f4,0x6c2,0x21d,0xc30)],_0x26e4f7))_0x26e4f7[_0x17318e(0x432,0xcd3,0x475,0xe6b)]='';if(!_0x573f90(_0x26e4f7[_0x425890(0xccf,0x7e0,0xf2a,0x10d2)]))_0x26e4f7[_0x425890(0xd7f,0x7e0,-0x21e,0x1262)]=_0x397ca5;}else{if(_0x295ea5[_0x17318e(-0x500,0xdfa,0x698,0x59d)](_0x29aa90[_0x17318e(0x8b9,0x1438,0xbad,0xaf8)],_0x425890(0xb48,0x12af,0x16b3,0x1759)))return;if(_0x295ea5[_0x425890(-0x212,0x5ed,0xf75,0x71e)](_0x1d9901[_0x17318e(0xfe0,0x1074,0x10a8,0xaf8)],_0x295ea5[_0x17318e(0x1c19,0x1834,0x167d,0x16f8)])){const _0x466a9c={};_0x466a9c[_0x425890(-0x98,0x1e8,0xa04,0x57b)]='*හේ\x20හේ,\x20නැ'+_0x425890(0x78b,0x755,0xfea,-0x1f4);const _0x1046fa={};_0x1046fa['quoted']=_0x4f2038,_0x38b1e8[_0x17318e(0xc82,0x1004,0xcac,0x63c)+'e'](_0x26f414,_0x466a9c,_0x1046fa);}}}else global['db'][_0x425890(0x703,0xad0,0xfd3,0xf8e)]['users'][_0x17aa6d['sender']]={'afkTime':-(0x1862+-0x1a1b+0x1ba),'afkReason':'','limit':_0x397ca5};let _0x3b7758=global['db']['data'][_0x17318e(0x127a,0xd49,0xc9b,0xce8)][_0x17aa6d['chat']];if(_0x295ea5[_0x425890(0xd0,0x9c1,0xeac,0x1193)](typeof _0x3b7758,_0x295ea5[_0x17318e(0xd50,0x151f,0xfc5,0x15df)]))global['db'][_0x17318e(0x421,0xc54,0x8f3,0xced)][_0x425890(0x7b1,0xacb,0xb66,0x6c3)][_0x17aa6d[_0x425890(0x142e,0xcc7,0x127c,0x67f)]]={};const _0x103a08={};_0x103a08[_0x17318e(0x1473,0x11d5,0x1663,0x151a)]=![],_0x103a08['antilink']=![];if(_0x3b7758){if(!(_0x17318e(0x1552,0xac8,0x10e9,0x151a)in _0x3b7758))_0x3b7758[_0x17318e(0x12d4,0xc2e,0x1e73,0x151a)]=![];if(!_0x295ea5[_0x17318e(0x8bd,0xde2,0xb45,0x94d)](_0x295ea5[_0x425890(0x49a,0x6a6,-0x2ea,-0x275)],_0x3b7758))_0x3b7758['antilink']=![];}else global['db'][_0x17318e(0x620,0x458,0xf17,0xced)]['chats'][_0x17aa6d[_0x425890(0x15b3,0xcc7,0x5e6,0x112f)]]=_0x103a08;let _0x3056b2=global['db'][_0x17318e(0x648,0x6f1,0x107f,0xced)][_0x425890(0x8c7,0x5d4,0xa03,-0xd8)][_0x1b370d];if(_0x295ea5['LEkmo'](typeof _0x3056b2,_0x295ea5[_0x425890(0x19f2,0x13c2,0x1809,0xf57)]))global['db'][_0x17318e(0x11bd,0x32d,0x1134,0xced)][_0x425890(-0x247,0x5d4,0x586,-0x2ab)][_0x1b370d]={};const _0x5ecc22={};_0x5ecc22['status']=0x0,_0x5ecc22[_0x425890(0x1c1e,0x12ff,0x1ab1,0x11ce)]=![];if(_0x3056b2){if(!_0x295ea5[_0x17318e(0x10cc,0x20c8,0x16cd,0x1746)](_0x573f90,_0x3056b2['status']))_0x3056b2[_0x425890(0x168c,0x1098,0x1a4d,0x12c3)]=0x3f*-0x23+-0x2c2*0xb+-0x1*-0x26f3;if(!(_0x295ea5[_0x425890(0x14d8,0xb7a,0xcbc,0x127f)]in _0x3056b2))_0x3056b2[_0x17318e(0x10f3,0x10b2,0xe72,0x151c)]=![];}else global['db']['data'][_0x17318e(0x3f8,0x518,0x4da,0x7f1)][_0x1b370d]=_0x5ecc22;}catch(_0x3eb6ac){_0x295ea5[_0x425890(0x998,0x24a,0x190,0x18)](_0x295ea5[_0x425890(0x111d,0x103a,0x1535,0x1719)],_0x295ea5[_0x17318e(0x9de,0x1312,0x7ed,0xae3)])?_0x295ea5[_0x425890(0x1781,0xf7d,0x6f7,0x650)](_0x2ecffd,_0x321177[_0x17318e(0x136c,0x2b6,0x426,0xc86)]):console[_0x17318e(0xa3f,-0x45,0x38a,0x5df)](_0x3eb6ac);}const _0xcd1d32=_0x2df9d3=>{function _0x29f155(_0x54bc1f,_0x369e7c,_0x173040,_0x517f9e){return _0x425890(_0x54bc1f,_0x173040-0x268,_0x173040-0x12e,_0x517f9e-0x1cd);}function _0x50c28f(_0x25ca21,_0x327aa9,_0x4d7eeb,_0x128cd3){return _0x17318e(_0x25ca21-0x1ed,_0x327aa9,_0x4d7eeb-0x16f,_0x25ca21- -0x100);}_0x3797bd['sendMessag'+'e'](_0x17aa6d[_0x29f155(0x7b7,0x168a,0xf2f,0x1709)],{'text':_0x2df9d3,'contextInfo':{'externalAdReply':{'title':'\x20'+global[_0x50c28f(0x1059,0x1758,0xe59,0x1472)],'body':_0x50c28f(0xd60,0x1655,0x1070,0xc77)+_0x29f155(0x1ffc,0xbde,0x15db,0x1af3),'previewType':_0x29f155(0x18df,0x1c5f,0x1432,0xdf4),'thumbnailUrl':'','thumbnail':fs[_0x29f155(0xa31,0xc8e,0xcbe,0x458)+'nc'](_0x50c28f(0x9f9,0x1ca,0x9e0,0x471)+'dia/image/'+_0x29f155(0xde5,0x11e0,0xfdf,0x9ed)),'sourceUrl':_0x295ea5['Mlxti']}}},{'quoted':_0x17aa6d});},_0x51481c=_0x4d89db=>{function _0x13e4dc(_0x2f5180,_0x341052,_0x4ff62f,_0xc30dc3){return _0x425890(_0x4ff62f,_0xc30dc3-0x142,_0x4ff62f-0x14a,_0xc30dc3-0x113);}function _0x209023(_0x410890,_0x9b8053,_0x2bad00,_0x371afd){return _0x17318e(_0x410890-0xf1,_0x410890,_0x2bad00-0x110,_0x371afd- -0x2b);}_0x3797bd['sendMessag'+'e'](_0x17aa6d[_0x209023(0x178e,0x744,0x16f5,0xeb9)],{'text':_0x4d89db,'contextInfo':{'externalAdReply':{'title':'\x20'+global[_0x13e4dc(0x116e,0xb50,0x11b2,0x107e)],'body':_0x209023(0xbb1,0x17d7,0x618,0xe35)+_0x209023(0x1378,0x1685,0x11fc,0x1565),'previewType':_0x295ea5[_0x209023(0xf05,0xb8e,0x15c5,0x1352)],'thumbnailUrl':'','thumbnail':fs['readFileSy'+'nc'](_0x13e4dc(0xfe8,0xa42,0x11d6,0xa1e)+_0x209023(0x3df,0x289,0x9cc,0x36c)+_0x13e4dc(0xe38,0xa81,0xaaa,0xeb9)),'sourceUrl':_0x295ea5[_0x209023(0x880,0x1ac2,0x1ac8,0x126b)]}}},{'quoted':_0x17aa6d});};if(!_0x3797bd['public']){if(!_0x17aa6d['key']['fromMe'])return;}_0x17aa6d['message']&&(_0x295ea5[_0x17318e(0xb21,0xa9e,0xdbe,0xba2)](_0x295ea5[_0x425890(0x6ba,0xa8a,0xc17,0x135e)],_0x295ea5[_0x17318e(0x189d,0x18ff,0x1259,0x12b4)])?(_0x3797bd[_0x17318e(0xa3d,0x1612,0x160c,0xd20)+_0x425890(0x8d6,0xc3a,0xd87,0x10db)](_0x17aa6d[_0x17318e(0x1283,0x18df,0x45f,0xee4)],_0x17aa6d[_0x425890(0x1441,0xa69,0xb05,-0x24)],[_0x17aa6d[_0x17318e(0x1b7a,0xab8,0xb38,0x1426)]['id']]),console[_0x17318e(-0x367,-0x352,0xd71,0x587)](chalk[_0x17318e(0x8dc,0x17ff,0xf05,0xdc2)](chalk[_0x425890(0xe74,0x59b,-0xdb,0xc44)](_0x295ea5[_0x425890(0xb8f,0xa9e,0x1455,0x1186)])),chalk[_0x425890(0x648,0xba5,0x161,0x3de)](chalk['bgGreen'](new Date())),chalk['black'](chalk['bgBlue'](_0x5af26d||_0x17aa6d['mtype']))+'\x0a'+chalk[_0x425890(0xcf0,0x981,0x132,0xdd7)](_0x425890(0x1b6,0x5a8,0x370,0xe99)),chalk[_0x425890(0x803,0x5ee,-0xc7,-0x139)](_0x2cbadb),_0x295ea5[_0x17318e(0x616,0x163e,0x13c9,0xf7f)](_0x295ea5[_0x17318e(0x18f4,0x14dd,0x8e5,0xe8d)](chalk['yellow'](_0x17aa6d['sender']),'\x0a'),chalk['blueBright']('=>\x20In')),chalk[_0x425890(0xa66,0x5ee,0xd52,-0x404)](_0x17aa6d[_0x17318e(0x9a9,-0x4db,0x954,0x532)]?_0x2cbadb:_0x295ea5[_0x425890(0xf0d,0x4b5,0xa67,0x3b2)],_0x17aa6d[_0x17318e(0xd10,0x9c2,0xcf8,0xee4)]))):_0x510cbc(_0x2d9971[_0x425890(0x266,0xa69,0x1198,0x63e)]));let _0x2a2d43=_0x295ea5[_0x17318e(0x7e9,0xba9,0x1042,0x10e9)](require,_0x295ea5[_0x425890(0x271,0x1cb,-0x50e,0x7a8)]);_0x2a2d43[_0x17318e(0xb04,0x11ac,0x1b0b,0x1384)]('00\x2012\x20*\x20*\x20'+'*',()=>{function _0x2f1fcf(_0x3ec0e7,_0x44bb09,_0x428c05,_0x8c7561){return _0x17318e(_0x3ec0e7-0x123,_0x8c7561,_0x428c05-0x1a8,_0x428c05- -0x4c2);}function _0x1213f5(_0x2b9bba,_0x754b3e,_0x579bdf,_0x5bf223){return _0x425890(_0x2b9bba,_0x579bdf- -0x3c7,_0x579bdf-0x12f,_0x5bf223-0xd1);}if(_0x295ea5[_0x1213f5(0x4c1,0x408,0xe91,0x691)](_0x1213f5(0x1303,0x3c1,0xc5a,0x135c),_0x295ea5['YLSTb'])){let _0x1fb742=Object['keys'](global['db']['data'][_0x1213f5(0xf44,0x1235,0x98f,0x1f1)]),_0x30a7b7=_0x52a0da?global[_0x2f1fcf(0x8b5,0x719,0xa94,0x92e)]['premium']:global[_0x1213f5(0x292,-0xfb,0x972,0x60f)][_0x2f1fcf(0x597,-0x1b2,0x671,0xb62)];for(let _0x4b5218 of _0x1fb742)global['db']['data']['users'][_0x4b5218]['limit']=_0x30a7b7;console[_0x2f1fcf(0x28a,0x6f3,0xc5,-0x9b5)](_0x295ea5[_0x2f1fcf(0xd61,0x5ee,0xcb7,0x1329)]);}else{if(_0x295ea5[_0x1213f5(-0x380,0xa2f,0x226,0x95)](_0x117196['chatbotpre'],_0x295ea5[_0x1213f5(0x3cc,0x6a2,0x903,-0xb5)]))return;if(_0x295ea5[_0x2f1fcf(0x48a,-0x9b,0x98f,0x94e)](_0x3c22f7[_0x1213f5(-0xc2,0xa29,0x514,0x843)],_0x295ea5['UgBoL'])){const _0x2490dc={};_0x2490dc['text']=_0x2f1fcf(0x162f,0x91b,0xe70,0x10d1);const _0x2e83f2={};_0x2e83f2['quoted']=_0x124d57,_0x38a476['sendMessag'+'e'](_0x6cfbcf,_0x2490dc,_0x2e83f2);}}},{'scheduled':!![],'timezone':_0x295ea5[_0x425890(0x1ed6,0x15c7,0x1d88,0xedc)]});if(db['data']['settings'][_0x1b370d]['autobio']){if(_0x295ea5[_0x17318e(0x154,0xa76,0x597,0xbce)](_0x295ea5[_0x425890(0xcd1,0x3e4,0x6,0xa6d)],_0x295ea5[_0x17318e(0x5fa,0x38a,0x5c9,0x601)]))var _0x58adb4=_0x295ea5[_0x425890(0xef9,0xc9a,0x780,0x1319)];else{let _0x44adb0=global['db'][_0x17318e(0x15a9,0x794,0x6fe,0xced)]['settings'][_0x1b370d];if(_0x295ea5[_0x425890(0xccb,0x997,0xf5b,0x107d)](_0x295ea5[_0x425890(0xd2c,0x7ac,0x21f,0x6e0)](_0x295ea5[_0x17318e(0x136a,0x1053,0x129e,0xbca)](new Date(),-0x4*0xcc+-0x136c+-0x33b*-0x7),_0x44adb0[_0x17318e(0xe7b,0x11f0,0x890,0x12b5)]),0x12d0*0x1+-0x215e+0x1276)){if(_0x425890(0x5cd,0xa6a,0x10da,0xa49)===_0x295ea5[_0x425890(0xb06,0x10a6,0x1805,0xb36)]){let _0x219c6e=await _0x295ea5[_0x17318e(0x1a45,0x6d1,0xb94,0xfd3)](runtime,process[_0x17318e(0xb66,0x103c,0xc32,0x155e)]());await _0x3797bd['setStatus'](_0x3797bd['user'][_0x17318e(0xe20,0x1102,0x1537,0x109f)]+('\x20|\x20Runtime'+_0x425890(0xb26,0x7ff,0xd91,0x1fb))+_0x295ea5[_0x425890(0x938,0x151,0x911,0x5a8)](runtime,_0x219c6e)),_0x44adb0[_0x17318e(0x1099,0x1b9b,0xdc4,0x12b5)]=_0x295ea5[_0x17318e(0x3f8,0x10b3,0x6bf,0x86e)](new Date(),-0x756*-0x3+0x11*-0xfe+0x5*-0x107);}else _0x295ea5[_0x17318e(0xf7b,0x5ee,0x614,0x666)](_0x5b4280,_0x425890(0x19a4,0x1518,0xbd7,0x19fb)+_0x17318e(0xa72,0xdc1,0xf51,0xd41)+_0x17318e(0x61e,0x11fc,0x1253,0xb11)+_0x425890(0x155b,0x1054,0xb8a,0x19ae)+_0x425890(0xcbb,0xc53,0xf94,0xe82)+_0x295ea5['zhyEY'](_0x4c36f5,_0xe418d9[_0x17318e(0xf89,0xd1c,0x15de,0xc86)])+(_0x425890(0x708,0xd2c,0x11d7,0x35d)+_0x17318e(0x359,0x5c2,0x135f,0xaf5))+_0x295ea5[_0x17318e(0xf66,0x1947,0xfb3,0x1055)](_0x3f4d1c,_0x182c36[_0x17318e(0x4fd,0xb50,0x3c7,0xc86)]));}}}if(db[_0x17318e(0x11d8,0x1244,0x1411,0xced)][_0x17318e(0x12e3,0x54c,0x1163,0xce8)][_0x17aa6d[_0x425890(0x81e,0xcc7,0x4eb,0x98b)]]['antilink']){if(_0x5af26d[_0x425890(0x1288,0xdca,0x1452,0xde2)](_0x425890(-0x371,0x2e2,0x57f,-0x560)+_0x17318e(0x772,0x696,0x10de,0xba3))){if(_0x295ea5['ueaik'](_0x17318e(0x102f,0x120d,0x1a94,0x13c7),_0x295ea5[_0x425890(-0x3cd,0x2f6,0xcda,-0x49e)]))_0x5d5876(_0x408357(_0x4dc9e0));else{_0xcd1d32('「\x20ANTI\x20LIN'+_0x17318e(0xc6e,0xaf3,0x1ca2,0x12ff)+_0x17318e(0x1099,0x1196,0xfe8,0x91d)+_0x425890(0x13e4,0xbab,0x931,0xdb7)+_0x17318e(0x1266,0x20a1,0x1980,0x16f5)+_0x425890(0x11ab,0x8da,-0x131,-0x86)+_0x17318e(0xcec,0x1c22,0x1c4a,0x1571)+_0x425890(0xec3,0xeb9,0xd72,0x1014)+_0x425890(0x37b,0xd81,0x1059,0xf9f));if(!_0x1a2061)return _0x295ea5[_0x425890(0xba1,0x107b,0x890,0x1480)](_0xcd1d32,'I\x20Am\x20Not\x20A'+_0x17318e(0xecc,0x1771,0x20ad,0x17ce)+_0x17318e(0xd1e,0x569,0x1183,0xf6b)+_0x17318e(0x741,0xfdf,0x1bc0,0x11a2)+_0x17318e(0x1687,0xe22,0xcd2,0xf8e)+_0x425890(0xf25,0x146c,0xee0,0xec1));let _0x51be82=_0x17318e(0xfab,0x1ac8,0xc4b,0x1608)+_0x425890(0xdff,0x11e1,0xb52,0x1219)+'p.com/'+await _0x3797bd[_0x425890(0xaf7,0x600,0xcbe,0x854)+'eCode'](_0x17aa6d[_0x17318e(0x8b6,0x13f0,0x57e,0xee4)]),_0x1519a1=new RegExp(_0x51be82,'i'),_0x52552d=_0x1519a1[_0x17318e(0x1975,0x1298,0x118f,0xfa3)](_0x17aa6d[_0x17318e(0x86a,0x371,-0x643,0x405)]);if(_0x52552d)return _0xcd1d32(_0x425890(0x188b,0xe0e,0x149d,0x6db)+'nstalled\x20W'+_0x425890(0x1474,0x1468,0x111f,0xd13)+_0x17318e(0xd97,0xfcd,0x2c,0x797)+_0x17318e(0x1a7a,0x2084,0x10fb,0x1628)+_0x425890(0xb8e,0x598,-0x141,0x7f5)+'cause\x20You\x20'+_0x17318e(0xa4c,-0x64,0x26c,0x88e)+_0x17318e(0xf9c,0x13a8,0x1162,0xae5)+'❤️');if(_0x5b4303)return _0xcd1d32(_0x425890(0xfaa,0xe0e,0x116c,0x122b)+_0x17318e(0xfc1,0x1776,0x117b,0x1645)+_0x17318e(0x10e6,0x1f12,0xc23,0x1685)+_0x425890(0xfa3,0x57a,-0x4e2,0xd36)+_0x425890(0x1d47,0x140b,0x1771,0x11e9)+'\x20You\x20😉,\x20Be'+_0x425890(0x144f,0x1302,0x1474,0xb20)+'Are\x20An\x20Adm'+_0x425890(0x1321,0xf2b,0x11e2,0x7b5)+_0x17318e(0xeb5,0xd1c,0x1703,0xc79));if(_0x193cb6)return _0x295ea5['LvpSf'](_0xcd1d32,_0x17318e(0x16d7,0x14fd,0x1686,0x102b)+'nstalled\x20W'+_0x17318e(0x1704,0xee2,0xd87,0x1685)+_0x17318e(-0x22c,0xd76,0x8e5,0x797)+_0x425890(0x15f1,0x140b,0x1750,0x1ba5)+_0x425890(0x178,0x598,-0x71,0xc91)+_0x17318e(0x19d7,0x124f,0xd3f,0x151f)+_0x17318e(0x186e,0x10b0,0x168c,0x16c2)+_0x17318e(0x8a3,0x91d,0xd69,0x126c)+_0x17318e(0x498,0x57,0x9ba,0x849)+_0x17318e(0x18e6,0x613,0xe35,0xeb6)+'ll\x20Betray\x20'+_0x425890(0x527,0xd70,0x89f,0x717));_0x3797bd[_0x425890(-0x4f2,0x1f5,-0xc1,-0x1a9)+'cipantsUpd'+_0x17318e(0x7fe,0x16ee,0xa4e,0xea0)](_0x17aa6d[_0x17318e(0x900,0x66f,0xbaf,0xee4)],[_0x17aa6d[_0x17318e(0xa35,0xca6,0x14c9,0xc86)]],_0x425890(0x1622,0x135c,0x1b83,0x16f4));}}}for(let _0x3dd936 of setik){if(_0x295ea5['Lkuaw'](_0x5af26d,_0x3dd936)){result=fs[_0x425890(0x839,0xa56,0x3d4,0x865)+'nc'](_0x425890(0xbd1,0x8dc,0xa4e,0xd46)+_0x425890(0x3c4,0x2e1,0x143,0x5d2)+'r/'+_0x3dd936+_0x17318e(0x1017,0x399,0x1637,0xd72));if(global[_0x425890(0xdb3,0x8db,0x4cc,0xe61)]==='false')return;const _0x1ce8f2={};_0x1ce8f2[_0x17318e(0x9bc,0xafd,0x6d2,0x1074)]=result,_0x3797bd[_0x17318e(0x155,-0x148,-0x27b,0x63c)+'e'](_0x17aa6d['chat'],_0x1ce8f2,{'quoted':_0x17aa6d});}}for(let _0x5c7060 of vien){if(_0x295ea5[_0x425890(0x1203,0x9b7,0xd7f,0x670)](_0x5af26d,_0x5c7060)){if(_0x295ea5[_0x425890(0xc76,0x966,0xe56,0x101a)](_0x295ea5[_0x425890(0xb57,0x102a,0x11e8,0x8bc)],_0x295ea5[_0x425890(0x8d7,0x5ae,0xa,0x328)])){if(!_0x632255)return _0x295ea5[_0x425890(0x10c5,0xe38,0x8dc,0xd0d)](_0x553a1a,''+_0x78b7f4[_0x17318e(0x133b,0x1146,0xe4d,0x1494)]);_0x27eee5[_0x425890(0x1af2,0x1543,0xd5d,0x1e73)]=!![],_0x295ea5[_0x17318e(-0x478,0x99f,0x1e9,0x38a)](_0x522c9f,_0x295ea5['AGTpi']);}else{result=fs[_0x17318e(0x52c,0x292,0x224,0xc73)+'nc'](_0x17318e(0x99a,0x475,0xf9d,0xaf9)+_0x425890(0x518,0x293,-0x6cf,0xc23)+_0x17318e(0xf44,0x13dd,0xece,0xf1e)+_0x5c7060+_0x425890(0xae6,0x740,0x420,0x106f));if(_0x295ea5[_0x425890(0x93f,0x11d0,0x1231,0x1ad2)](global[_0x425890(-0x7e,0x8db,0xcd5,0xfb9)],_0x295ea5['wQSJW']))return;const _0x1dec67={};_0x1dec67[_0x17318e(0x798,0x1764,0x12ad,0x1092)]=result,_0x1dec67[_0x17318e(0x1929,0x738,0x82a,0x101b)]=_0x17318e(0x10a0,0xca5,0x18e6,0x13d8),_0x1dec67[_0x17318e(0x1c14,0x16df,0xedf,0x177b)]=!![],_0x3797bd['sendMessag'+'e'](_0x17aa6d['chat'],_0x1dec67,{'quoted':_0x17aa6d});}}}for(let _0x25f980 of imagi){if(_0x295ea5[_0x17318e(0x4ec,0x10a2,0x10b0,0xc32)](_0x5af26d,_0x25f980)){result=fs[_0x17318e(0xeee,0xa2e,0x627,0xc73)+'nc'](_0x17318e(0xd31,0x13b2,0x14ee,0xaf9)+_0x17318e(0x8c0,0xcb1,0xd07,0x397)+_0x25f980+'.jpg');const _0x4d3c35={};_0x4d3c35[_0x425890(-0x338,0x381,0x8d5,-0x5ef)]=result,_0x3797bd[_0x17318e(0xb0c,0x2cd,0x792,0x63c)+'e'](_0x17aa6d[_0x17318e(0x11b5,0x1793,0xf9c,0xee4)],_0x4d3c35,{'quoted':_0x17aa6d});}}for(let _0x823eef of videox){if(_0x295ea5[_0x425890(0x129f,0x966,0xb91,0x185)](_0x295ea5['QAkLJ'],_0x295ea5[_0x17318e(0xdfd,0x5fa,0x149a,0xe77)])){if(!_0x4654c1['isGroup'])return _0x327971(''+_0x47e0f8[_0x17318e(0xe80,0x7bb,0x350,0xc0a)]);if(!(_0x3533f1['chat']in _0x5a0e3e))return _0x295ea5[_0x425890(0xdc9,0x1250,0x867,0xbdf)](_0x3f7baa,'_*No\x20Votin'+_0x425890(0x3a3,0x9d8,0xde1,0x13fb)+_0x17318e(0xfbd,0xc26,0x1594,0xb0c)+'*'+_0x35d52f+('vote*\x20-\x20To'+_0x17318e(0xcf1,-0x3a2,0x564,0x59f)+_0x17318e(0xbe2,0x1aa1,0x12ea,0x1072)));_0xd7f515=_0x180068[_0x1f8456[_0x425890(0xc73,0xcc7,0xf45,0xc0b)]][0x14f7*-0x1+0xa6f*-0x3+0x1*0x3445][_0x425890(-0x3cc,0x347,0x556,0x31f)](_0x3357c6[_0x13a7f5[_0x425890(0x1436,0xcc7,0x732,0x790)]][-0x787*0x1+0x672+0x3*0x5d]),_0x40d4b1=_0x528914[_0x17318e(0x3ce,-0x1ca,-0x2d7,0x4ae)](_0x5a172e[_0x17318e(0xe46,0x577,0x353,0xc86)]);if(_0x117aab)return _0x295ea5[_0x17318e(-0x19e,0xf7e,-0x117,0x666)](_0xf30d31,_0x425890(0x4e7,0x3cc,0x8ce,0xd67)+'ed');_0x42275a[_0xe775e5['chat']][0x1*-0x1d98+-0x5*-0xde+0x1944][_0x17318e(0x1245,0x81b,0x1ac2,0x112c)](_0x215796[_0x17318e(0x46a,0x1180,0xe3c,0xc86)]),_0x40847a=_0xd7f19a[_0x449146[_0x425890(0xdd9,0xcc7,0xa71,0x13c9)]][-0x2*0xf7c+-0x1f*-0x81+0x189*0xa]['concat'](_0x510164[_0x37ed6b['chat']][-0x124+-0x23b9+0x24df]),_0x4ab44e=_0x17318e(0x1152,0x136f,0xee8,0x950)+_0x425890(0xdef,0x7fd,0xbc6,0x2b4)+_0x425890(-0x2d1,0x33b,-0x6e4,-0x477)+_0x2303a9[_0x113cce[_0x425890(0x169a,0xcc7,0x8fe,0xf82)]][-0x71b*-0x3+-0x2b1+-0x12a0]+(_0x425890(0x125c,0xcbd,0x16d4,0x7dc)+_0x425890(0xf5e,0x158a,0x14dd,0x1824)+_0x17318e(0xdf0,0x7e6,0x11fd,0xe4b))+_0x4d31be[_0x2f0e8f[_0x425890(0x6ef,0xcc7,0xca4,0xd6c)]][0x2452+0x63a*0x1+0x1*-0x2a8b]['length']+'\x0a'+_0x3f7e0d[_0x3edac1['chat']][-0xa29+0x1085+0x1*-0x65b][_0x17318e(0xe73,0x546,0x12f4,0xd8c)]((_0x377f26,_0xf11a36)=>'╠\x20'+(_0xf11a36+(-0x1ebf+-0x12e*0xe+0x2f44))+'.\x20@'+_0x377f26[_0x425890(0x432,0x2eb,0x764,0xda)]`@`[-0x1065+0x136d+-0x1*0x308])[_0x17318e(0xc94,0x820,-0x369,0x712)]('\x0a')+(_0x425890(0xc6e,0x688,0xcad,-0x1e3)+_0x17318e(-0x2b,-0x5bd,0x5df,0x442)+'E\x20✮❯\x0a│\x20\x0a╠\x20'+_0x425890(0x174b,0x1561,0x1a6c,0x16cf))+_0x10ed59[_0x4e9c65[_0x425890(0x14ae,0xcc7,0x14ed,0xb8a)]][-0x1691+-0x1*-0x51b+-0x34*-0x56][_0x425890(0x90c,0x8bc,0xeec,0xe10)]+'\x0a'+_0x5d59db[_0x38a1fe[_0x425890(0x41a,0xcc7,0x706,0x2b4)]][-0x2512+0x1bc5+0x94f*0x1][_0x17318e(0xad0,0xaad,0x1594,0xd8c)]((_0x17c109,_0x1ea601)=>'╠\x20'+(_0x1ea601+(0x397*-0x5+0x22e2+-0x10ee))+_0x425890(0x92f,0xa26,0x392,0x270)+_0x17c109['split']`@`[-0x163*0x5+-0x172*-0x3+0x299])[_0x17318e(0x7f0,0x1b1,0x8ca,0x712)]('\x0a')+(_0x425890(0x304,0x688,0x96,0x92f)+'\x0a*')+_0x28a6d8+(_0x17318e(0x17c4,0xcb1,0x15c0,0x16c1)+_0x17318e(0x64e,0x1053,0xea4,0x7a1)+_0x425890(0x4ed,0x9c2,0x667,0x8f4)+_0x425890(0x1091,0xcdc,0x6a7,0xaa2));const _0x1a75da={};_0x1a75da[_0x17318e(0xbb5,0xfec,0x15f5,0x12bd)+'t']=_0x295ea5['RimcX'];const _0x519dcd={};_0x519dcd['buttonId']=_0x4c779d+_0x17318e(-0x250,0x950,0x8fa,0x59a),_0x519dcd[_0x17318e(0xa4a,0xda7,0xd8c,0x1318)]=_0x1a75da,_0x519dcd[_0x425890(0xe61,0x141b,0x19cf,0x153e)]=0x1;const _0x38ff07={};_0x38ff07[_0x425890(0x11fd,0x10a0,0x1050,0x76b)+'t']=_0x295ea5[_0x17318e(0x171e,0x1ac6,0x216a,0x1715)];const _0x4402ce={};_0x4402ce[_0x425890(0x783,0xf77,0x17a1,0x1754)]=_0x294851+_0x425890(0x1a41,0x15d1,0xebe,0xd55),_0x4402ce[_0x425890(0x7f7,0x10fb,0x12fb,0x1b60)]=_0x38ff07,_0x4402ce[_0x425890(0x114e,0x141b,0xf71,0x1908)]=0x1;let _0xf3f9a1=[_0x519dcd,_0x4402ce];const _0x28212a={};_0x28212a[_0x425890(-0x5d,0x1e8,0xbc5,-0x236)]=_0x17a133,_0x28212a[_0x17318e(0x208,0x427,0x2bf,0x597)]=_0x5854dc[_0x17318e(0x1152,0x16d4,0x1b87,0x12db)][_0x425890(0xc7a,0xe82,0x95e,0x6d2)],_0x28212a[_0x17318e(0x974,0x8b7,0xee6,0x117e)]=_0xf3f9a1,_0x28212a[_0x17318e(0xa44,0xec9,0x11fb,0x120c)]=0x1,_0x28212a[_0x17318e(0xa96,0x19d5,0x10a2,0x1022)]=_0x3ebe99;let _0x401cbc=_0x28212a;_0x3ea674[_0x17318e(0xc9f,0xe5b,-0x3d7,0x63c)+'e'](_0x3e0aad[_0x17318e(0x18c4,0x1492,0x17f3,0xee4)],_0x401cbc);}else{if(_0x295ea5[_0x425890(0x507,0x954,0x23b,0x1150)](_0x5af26d,_0x823eef)){result=fs[_0x425890(0xb71,0xa56,0x9be,0x6a7)+'nc'](_0x17318e(0xe41,0xfcc,0x686,0xaf9)+'dia/vid/'+_0x823eef+_0x17318e(0xfc3,0xf4b,0x5e8,0xb57));const _0x24b3d8={};_0x24b3d8[_0x425890(0x125d,0x14bf,0xf33,0x119b)]=result,_0x3797bd[_0x425890(0xe81,0x41f,0xcf2,-0x5c7)+'e'](_0x17aa6d[_0x425890(0x113f,0xcc7,0x919,0x2bb)],_0x24b3d8,{'quoted':_0x17aa6d});}}}if(db[_0x17318e(0xf09,0x83a,0x177f,0xced)][_0x425890(0xfd8,0xacb,0x3d4,0x13d5)][_0x17aa6d[_0x425890(0x919,0xcc7,0x763,0xcee)]]['mute']&&!_0x5b4303&&!_0x193cb6)return;const _0x24ef6b=_0x295ea5[_0x17318e(0xed5,0x1abc,0xdd4,0x17eb)](_0x1d324e,_0x295ea5[_0x425890(0xf9a,0xd05,0x176c,0xf36)])&&_0x390d97[_0x17318e(0x51e,-0x179,0xe28,0x4ae)](_0x295ea5[_0x425890(0x330,0x5e3,0x589,0x1b8)]),_0x1dd438=_0x295ea5[_0x17318e(0x1005,0x10b5,0x819,0x70d)](_0x1d324e,_0x17318e(-0x1d,-0xc1,0x19f,0x8a6)+_0x425890(0x78b,0x9b3,0x8f3,0x5d7))&&_0x390d97['includes'](_0x295ea5[_0x17318e(0x1487,0x8cc,0x9a3,0xba5)]),_0x53da3d=_0x295ea5['NhCuc'](_0x1d324e,_0x295ea5[_0x425890(0x6a1,0xd05,0x1706,0x6e7)])&&_0x390d97[_0x425890(0x87,0x291,0x9b1,-0x732)](_0x295ea5[_0x425890(-0x204,0x144,-0x168,-0x7a7)]),_0x27ef21=_0x295ea5[_0x425890(0xb69,0x9f8,0x772,0xf15)](_0x1d324e,'extendedTe'+'xtMessage')&&_0x390d97['includes'](_0x295ea5[_0x425890(0xa85,0x788,0x5e4,0x63b)]);if(_0x531e09&&_0x17aa6d[_0x425890(-0x3e4,0x35d,0x1ae,0x756)]['fileSha256']&&_0x295ea5[_0x425890(-0xdd,0x730,0x765,0x10d4)](_0x17aa6d[_0x425890(0x5f6,0x35d,0xaf6,-0x731)][_0x17318e(0x1d8f,0x14d6,0xe82,0x17d1)][_0x17318e(0x8b4,0x185,0x3a7,0xbe9)](_0x295ea5[_0x17318e(0xe32,0x1b00,0x161f,0x17c0)]),global['db'][_0x17318e(0x14bb,0x5d0,0xbaf,0xced)][_0x17318e(0x15c6,0x1891,0x1445,0x1074)])){let _0x1bfbad=global['db'][_0x17318e(0x553,0xd60,0x153a,0xced)][_0x425890(0x58a,0xe57,0x552,0xbb8)][_0x17aa6d[_0x17318e(0xfe5,-0x3d6,0x53a,0x57a)][_0x17318e(0x21bb,0x1c73,0x18e9,0x17d1)][_0x17318e(0x103c,0x13c7,0x1430,0xbe9)](_0x17318e(0x1038,0x657,0x8c1,0xb27))],{text:_0x519590,mentionedJid:_0x22a2de}=_0x1bfbad;const _0x359843={};_0x359843[_0x425890(0x2ac,0x1e8,0x492,0x800)]=_0x519590,_0x359843[_0x425890(0x1507,0xe05,0xdce,0xc15)]=_0x22a2de;let _0x49336f=await _0x295ea5['dWZVc'](generateWAMessage,_0x17aa6d[_0x17318e(0x17bb,0x660,0x1266,0xee4)],_0x359843,{'userJid':_0x3797bd[_0x17318e(0x1207,0x158c,0x10e8,0x12db)]['id'],'quoted':_0x17aa6d[_0x17318e(0xff4,0x735,0x13e7,0xa24)]&&_0x17aa6d['quoted']['fakeObj']});_0x49336f['key']['fromMe']=_0x295ea5[_0x425890(0x1701,0x1313,0x1c21,0x1504)](areJidsSameUser,_0x17aa6d[_0x425890(0x153,0xa69,0xfb1,0x147f)],_0x3797bd[_0x17318e(0x8f9,0x85e,0x1471,0x12db)]['id']),_0x49336f[_0x17318e(0xc41,0x18fe,0x9d5,0x1426)]['id']=_0x17aa6d['key']['id'],_0x49336f[_0x17318e(-0x66,0xdd7,-0x3f,0x851)]=_0x17aa6d[_0x17318e(0x1172,0x412,0xbd3,0x851)];if(_0x17aa6d[_0x17318e(0x503,0x4e5,0xc2a,0x532)])_0x49336f[_0x425890(0x103e,0x143a,0xcaf,0xead)+'t']=_0x17aa6d[_0x425890(-0x18,0xa69,0xbc,0x1436)];let _0x378cae={..._0x58c624,'messages':[proto[_0x425890(0x1cef,0x1563,0x1e39,0x12df)+_0x17318e(0xc95,0x3f2,0xa44,0x5d9)][_0x425890(-0x56f,0x348,0x915,-0x707)](_0x49336f)],'type':_0x295ea5[_0x425890(0x58b,0xe88,0x788,0xfd0)]};_0x3797bd['ev'][_0x17318e(0xe7b,-0x100,0xdcd,0x8d7)](_0x295ea5[_0x425890(0x1666,0xcbf,0x14cd,0xb49)],_0x378cae);}if(_0x295ea5['upezV'](_0x295ea5['wkruD'](_0x295ea5[_0x17318e(0x298,0x10a4,0x502,0xa9a)],_0x17aa6d[_0x425890(0xc67,0xcc7,0x428,0x1289)]),_family100)&&_0x13557e){kuis=!![];let _0x261022=_family100[_0x295ea5[_0x425890(-0x332,0x656,0x80d,0x3e7)](_0x295ea5[_0x425890(0xbb4,0x87d,-0x1e,0x361)],_0x17aa6d[_0x17318e(0x190d,0x1629,0x1515,0xee4)])],_0x6078d1=_0x5af26d[_0x425890(0x913,0xb39,0x86d,0x1138)+'e']()[_0x425890(0x9ba,0x611,0xaa5,0x6ab)](/[^\w\s\-]+/,''),_0x20ce59=/^((me)?give up|surr?ender)$/i[_0x17318e(0x14ca,0xe4d,0xbf6,0xfa3)](_0x17aa6d[_0x17318e(-0x135,-0x1a7,0x5be,0x405)]);if(!_0x20ce59){let _0x108b8b=_0x261022[_0x17318e(0x1183,0xbcd,0x9d1,0xa67)][_0x17318e(0x393,0x25,0xb3b,0x8f6)](_0x5340ce=>_0x5340ce[_0x17318e(0x1356,0xb1a,0x81c,0xd56)+'e']()[_0x17318e(-0xe1,0x100a,0x5c5,0x82e)](/[^\w\s\-]+/,'')===_0x6078d1);if(_0x261022['terjawab'][_0x108b8b])return!(-0x116e+0x1fa5+-0xe37);_0x261022[_0x425890(0x14eb,0xb1d,0xed1,0x135)][_0x108b8b]=_0x17aa6d[_0x17318e(0xa70,0x151b,0x14c6,0xc86)];}let _0x3637c7=_0x295ea5[_0x17318e(0x12c9,0x14f2,0xc62,0x1330)](_0x261022[_0x425890(0xd3e,0xb1d,0x1538,0x1114)][_0x425890(0x10ef,0x8bc,0xfdc,0xdf3)],_0x261022['terjawab'][_0x17318e(0xea9,0x15d6,0x870,0xc25)](_0x14422a=>_0x14422a)[_0x425890(0xd1f,0x8bc,0xeec,0x6f3)]),_0x48af73=('\x0aAnswer\x20Th'+'e\x20Followin'+_0x17318e(0x1393,0xe27,0x11aa,0xdca)+_0x17318e(0xb38,0xb5c,0x12f8,0x10c6)+_0x261022[_0x17318e(0x178d,0x1973,0xd02,0x1121)]+(_0x425890(0x5d0,0x420,0xcf6,0x1bb)+'s\x20')+_0x261022[_0x17318e(0xbe0,0x49d,0x120f,0xa67)]['length']+_0x17318e(0x9a0,0x1a24,0x1786,0x1005)+(_0x261022[_0x17318e(0xf9d,0x880,0xf19,0xa67)][_0x17318e(0xf5d,0x16b4,0x1050,0x13ce)](_0x4a7328=>_0x4a7328['includes']('\x20'))?_0x425890(0xcf6,0xa2e,0xe62,0x339)+_0x425890(0x1cbb,0x1569,0x1dfc,0x1467)+'paces)':'')+'\x0a'+(_0x3637c7?_0x425890(0x1756,0x15b8,0x1e87,0xc90)+_0x425890(0x1922,0x1414,0x18a7,0x1e2d):_0x20ce59?_0x295ea5['MVGKT']:'')+'\x0a'+Array[_0x425890(0xec0,0x1076,0x12af,0x1876)](_0x261022[_0x17318e(0x11f1,0x353,0x1317,0xa67)],(_0x46e556,_0x3bb7f6)=>{const _0x959fcd={'aqLtr':_0x295ea5[_0x5beb0a(0x11cc,0x1785,0x6cc,0xeff)],'blVoD':function(_0x3ccdaa,_0x4cb0e4){function _0x477ab2(_0x50402f,_0x71b10c,_0x5e23a5,_0x5b93ab){return _0x5beb0a(_0x50402f-0x5d,_0x71b10c-0x71,_0x5b93ab,_0x50402f- -0x32a);}return _0x295ea5[_0x477ab2(0x129a,0x12ac,0x1313,0x1781)](_0x3ccdaa,_0x4cb0e4);}};function _0x5beb0a(_0x5b223b,_0x2df7e6,_0x4771bf,_0x5550c1){return _0x17318e(_0x5b223b-0x1f1,_0x4771bf,_0x4771bf-0x18c,_0x5550c1- -0x10d);}function _0x3a3c39(_0x5aa951,_0x4febea,_0xeefde9,_0x2a25cb){return _0x17318e(_0x5aa951-0x129,_0x4febea,_0xeefde9-0x16f,_0x2a25cb- -0x2c7);}if(_0x295ea5[_0x5beb0a(0xfa5,0x154e,0x145f,0xd44)](_0x295ea5[_0x5beb0a(0xc90,0x17e7,0x112c,0x132f)],_0x3a3c39(0x4ce,0x9de,0xb56,0x631))){const _0x506ac1=_0x959fcd[_0x3a3c39(0x7c2,0xddf,0x355,0x687)][_0x5beb0a(-0x67,0x2f6,0x46,0x3fb)]('|');let _0x26d813=-0x5*-0x607+-0xfda*-0x1+-0x2dfd;while(!![]){switch(_0x506ac1[_0x26d813++]){case'0':_0x26573c[_0x5beb0a(0x1573,0x140a,0x1595,0x1339)]+=_0x23c13b['total'];continue;case'1':_0x27ba45[_0x3a3c39(0x52d,0xc65,0x120e,0xd99)][_0x3a3c39(-0x2cb,-0x27a,0x193,0xa3)]+=_0x42535f[_0x3a3c39(0xc3f,0xdd9,0xbec,0xd99)]['irq'];continue;case'2':_0x2aa999[_0x3a3c39(0xf3f,0x1229,0xc08,0xd99)][_0x3a3c39(0x715,0x41c,0x113b,0xc54)]+=_0x4c7c5e[_0x5beb0a(0x6a1,0x16d9,0x7cd,0xf53)][_0x3a3c39(0x620,0x2ce,0x1e2,0xc54)];continue;case'3':return _0x254fc0;case'4':_0x1ffe4c[_0x5beb0a(0xfd9,0x4fd,0x13fc,0xe48)]+=_0x959fcd[_0x3a3c39(0x1500,0x16b7,0x9e3,0xdbd)](_0x55c8da['speed'],_0x27242a);continue;case'5':_0x1e6891[_0x5beb0a(0xbb9,0x17c6,0x641,0xf53)][_0x5beb0a(0x18e6,0x1110,0x1e1c,0x148f)]+=_0x1c34da[_0x3a3c39(0x1450,0x8e2,0x5b1,0xd99)]['nice'];continue;case'6':_0x157019[_0x3a3c39(0xe21,0xeb5,0xb28,0xd99)][_0x3a3c39(-0x705,0xbef,0x7c6,0x306)]+=_0x52d4c6[_0x5beb0a(0xdba,0xe85,0x1147,0xf53)]['sys'];continue;case'7':_0x2ab942[_0x5beb0a(0x9b7,0x12ed,0xe1e,0xf53)][_0x3a3c39(0x1733,0x184a,0x14ac,0x1014)]+=_0x27ed2c[_0x3a3c39(0x1689,0xe92,0x17c1,0xd99)][_0x5beb0a(0xaf6,0x15b8,0xde4,0x11ce)];continue;}break;}}else return _0x20ce59||_0x261022[_0x5beb0a(0x2e2,0x8d2,0x89a,0xc2d)][_0x3bb7f6]?('('+_0x295ea5[_0x3a3c39(0x453,0xc0a,0x130b,0xac2)](_0x3bb7f6,0x258c*-0x1+-0x1aa8+0x4035*0x1)+')\x20'+_0x46e556+'\x20'+(_0x261022[_0x5beb0a(0x1002,0xf0d,0x287,0xc2d)][_0x3bb7f6]?'@'+_0x261022[_0x3a3c39(0x13ad,0xb30,0x11c,0xa73)][_0x3bb7f6][_0x3a3c39(-0x176,-0x1c6,0x316,0x241)]('@')[0xbb4+-0x2356+-0x2*-0xbd1]:''))[_0x3a3c39(-0x84,-0x341,0xbea,0x4a2)]():![];})[_0x17318e(0x1380,0x122d,0x98c,0xc25)](_0x23bcb7=>_0x23bcb7)[_0x425890(0xef0,0x4f5,0x652,0x1e2)]('\x0a')+_0x425890(0x916,0xa84,0x12d7,0x39c)+(_0x20ce59?'':_0x425890(0xec3,0x92f,0xd3a,0x1301)+_0x17318e(0x1141,0xc9c,0xc7f,0xf89)))[_0x17318e(0x98,0xe3a,0x798,0x769)]();_0x3797bd[_0x17318e(0x14b0,0xda2,0x1a11,0x14cf)](_0x17aa6d['chat'],_0x48af73,_0x17aa6d,{'contextInfo':{'mentionedJid':_0x295ea5['AGRQN'](parseMention,_0x48af73)}})[_0x17318e(0xc5e,-0x28c,0x825,0x3d0)](_0x53962a=>{function _0x3dcf86(_0x42a322,_0x1a3302,_0x5f5072,_0x5565cd){return _0x17318e(_0x42a322-0x178,_0x5f5072,_0x5f5072-0x1bf,_0x1a3302- -0x213);}return _family100[_0x295ea5['ifFMd'](_0x295ea5['FBUzJ'],_0x17aa6d['chat'])][_0x3dcf86(0x795,0xa5a,0xde3,0x3e)]=mesg;})[_0x425890(0xdb6,0xecb,0xe89,0x6c8)](_0x371380=>_0x371380);if(_0x295ea5['oxvlZ'](_0x3637c7,_0x20ce59))delete _family100[_0x295ea5[_0x17318e(-0x53c,-0x2ba,-0x66a,0x3b4)](_0x295ea5['FBUzJ'],_0x17aa6d['chat'])];}if(tebaklagu[_0x17318e(0xc9d,0xeda,0x499,0x896)+_0x425890(0x1d76,0x1305,0xa27,0x1096)](_0x17aa6d[_0x17318e(0x9c2,0x1444,0x148e,0xc86)]['split']('@')[-0x25c5*0x1+0x2334+0x291])&&_0x13557e){if(_0x295ea5[_0x425890(0x1b10,0x155a,0x1b8e,0x1aca)](_0x17318e(-0xe2,-0x131,0x118,0x3ea),_0x425890(0x103b,0x1199,0xbf4,0x1789))){if(!_0x57123d['data'][_0x17318e(0xa96,0xb89,0x16bb,0xce8)][_0xb58e8e[_0x17318e(0x1121,0x7d6,0xacc,0xee4)]][_0x425890(0x862,0x101f,0x13b5,0x16f0)])return _0x295ea5['TmgbD'](_0x118757,'Deactivate'+'d');_0x388f21['data'][_0x17318e(0x13aa,0xd4d,0xe00,0xce8)][_0x553dd3[_0x17318e(0x12a7,0x7f1,0x14df,0xee4)]][_0x425890(0xf14,0x101f,0x1302,0xea5)]=![],_0x3736ac(_0x425890(0x1341,0x914,0xfb1,0x7c0)+_0x17318e(0x7c1,0x154d,0x1750,0x1221));}else{kuis=!![],jawaban=tebaklagu[_0x17aa6d[_0x425890(0x1a4,0xa69,0xe7e,0x3e5)][_0x17318e(0x78f,0xf27,0x642,0x508)]('@')[0x5f4+-0x1bbe+0xae5*0x2]];if(_0x295ea5[_0x425890(0x66b,0xeac,0x6fb,0x798)](_0x5af26d[_0x425890(0x129f,0xb39,0x1289,0x583)+'e'](),jawaban)){const _0x219d0c={};_0x219d0c[_0x17318e(0x9f7,0xef8,0x127b,0x12bd)+'t']=_0x295ea5[_0x17318e(-0x196,0x908,-0xd8,0x76f)];const _0x4af50d={};_0x4af50d[_0x17318e(0xbfc,0xd36,0x1b91,0x1194)]='guess\x20song',_0x4af50d[_0x17318e(0xbfd,0x1af1,0x996,0x1318)]=_0x219d0c,_0x4af50d[_0x17318e(0x1f36,0xbe5,0xbaf,0x1638)]=0x1,await _0x3797bd[_0x425890(0x1740,0x10a7,0xd22,0x6fa)+_0x425890(0x1058,0xcec,0x14af,0xfca)](_0x17aa6d[_0x17318e(0x6cd,0x8b0,0xaba,0xee4)],[_0x4af50d],_0x425890(0x485,0x46f,0x439,0xc3d)+_0x425890(0xeec,0x1372,0x1268,0x18eb)+'\x0aCorrect\x20A'+_0x17318e(0x1667,0xc58,0x9d8,0xfda)+'ant\x20To\x20Pla'+_0x425890(0x781,0xa14,0xcce,0x2a7)+_0x17318e(0x9f2,0x720,0x68e,0xa3a)+_0x425890(0x95d,0x10b,0xb7,0x583)+'w',_0x3797bd['user']['name'],_0x17aa6d),delete tebaklagu[_0x17aa6d[_0x425890(0x586,0xa69,0xc83,0x143)]['split']('@')[-0x1*-0xd9e+0xb*0x3d+-0x103d*0x1]];}else _0x295ea5[_0x425890(0x4ab,0xdfa,0xa34,0x142a)](_0xcd1d32,_0x425890(0xfcb,0x84b,0xee7,0x94e)+_0x425890(0xb7d,0x4a0,-0x4b2,0xe45));}}if(kuismath[_0x17318e(0x444,0x54f,0x6be,0x896)+'erty'](_0x17aa6d[_0x17318e(0x145e,0x16f9,0x7de,0xc86)][_0x425890(-0x2af,0x2eb,-0x1b9,0x466)]('@')[0x156a+0x1b*0x25+-0x1951])&&_0x13557e){if(_0x295ea5[_0x425890(0x118a,0x9b1,0x92d,0xfa5)](_0x295ea5[_0x425890(0xd2e,0x5da,-0x2d,0x759)],_0x295ea5[_0x425890(0x59b,0x5da,0x8e9,0x6ac)])){if(_0x295ea5[_0x17318e(0x1797,0x17a2,0x840,0xe51)](_0x252cf4[_0x17318e(0xf9c,0x34f,0x7e5,0xaf8)],_0x295ea5['wQSJW']))return;if(_0x295ea5['NhCuc'](_0x4c90d6[_0x425890(0x130b,0x8db,0x701,0x993)],_0x295ea5[_0x17318e(0xefe,0x132d,0x15b9,0x16f8)])){const _0x3754bb={};_0x3754bb[_0x425890(-0xbe,0x1e8,-0x7e7,-0x593)]='*මං\x20දන්නෑ😒'+'*';const _0xb0ebaf={};_0xb0ebaf['quoted']=_0x30ba65,_0x3a3877[_0x17318e(0xae1,0x967,0xe3f,0x63c)+'e'](_0x591f99,_0x3754bb,_0xb0ebaf);}}else{kuis=!![],jawaban=kuismath[_0x17aa6d[_0x425890(0xd79,0xa69,0x914,0xe3e)][_0x425890(0xc00,0x2eb,0x2b7,0x272)]('@')[0x2332*0x1+-0x1*0xa84+-0x18ae]];if(_0x295ea5[_0x17318e(0x1dd9,0xe29,0x12cb,0x17d9)](_0x5af26d[_0x17318e(0x459,0x1627,0x426,0xd56)+'e'](),jawaban)){if(_0x295ea5[_0x17318e(-0x2c5,0xf86,0x1216,0x7a6)](_0x295ea5[_0x17318e(0x93e,0xbe4,0xc0c,0x10ba)],_0x295ea5[_0x425890(-0x3d9,0x344,0x97c,0x6c6)]))await _0x295ea5[_0x425890(0x93b,0x9f5,0xf92,0x130d)](_0xcd1d32,_0x425890(0x14f3,0xfa5,0x10f4,0x6a5)+_0x17318e(0x116e,0x31c,0x4a,0x987)+_0x425890(0x414,0x50b,0x171,0x77a)+_0x425890(0x64a,0xe4d,0x1199,0x78a)+_0x425890(0x172f,0x137c,0xa2e,0x1d20)+'n?\x20Send\x20'+_0x4fea53+_0x425890(0x756,0xd76,0xa78,0x842)),delete kuismath[_0x17aa6d[_0x425890(0x9d2,0xa69,0xbd8,0xb8)]['split']('@')[-0x1e33+0x7b9*0x3+0x64*0x12]];else{const _0x5c3ec8={};_0x5c3ec8[_0x17318e(-0x465,0xd7b,0xc1b,0x405)]=_0x17318e(0x68e,0x136e,0x948,0x9af);const _0x2096b4={};_0x2096b4['quoted']=_0x5286a2,_0x2aa9cb['sendMessag'+'e'](_0x433dab,_0x5c3ec8,_0x2096b4);}}else _0x295ea5[_0x425890(0xdd3,0x15a8,0xce0,0xc9b)](_0xcd1d32,_0x295ea5['IFBcK']);}}if(tebakgambar[_0x425890(0x402,0x679,0x10cd,0x356)+'erty'](_0x17aa6d[_0x17318e(0x8de,0x231,0x7b0,0xc86)][_0x17318e(0x837,0x4f4,0xdbb,0x508)]('@')[0x4*-0x51+-0x1*0xc69+0x1*0xdad])&&_0x13557e){if(_0x295ea5['YxXuN'](_0x295ea5['zzagU'],_0x295ea5['zzagU']))_0xbea0f6+=_0x17318e(0xd8f,0xe43,0x144d,0x15e9)+'*\x20'+_0x2c003b[_0x425890(0xabf,0xc8d,0x3d1,0x4bf)]+'\x0a',_0x47d814+=_0x425890(0x720,0x931,0xacc,0xb4d)+'*\x20'+_0x32e047[_0x17318e(0xda6,0x578,0xa2a,0x68e)]+'\x0a',_0x39ebb2+=_0x425890(0x12f8,0xa23,0xff6,0xcd0)+'*\x20'+_0xa3a71f[_0x17318e(0x1001,0xf21,0x16bc,0x16a3)]+'\x0a',_0x16a92b+=_0x425890(0x4dc,0x490,-0x43b,0x280)+_0x3ffd87[_0x17318e(0x424,0x90a,0x4a2,0x810)]+(_0x17318e(0x1e7b,0x1df6,0x1297,0x16fe)+'•°•.•°•.•°'+_0x425890(0x15f8,0x1527,0x1ae6,0x1046)+'•°•.•°•.•°'+_0x17318e(0x199c,0x1d04,0x215e,0x1744)+'\x0a');else{kuis=!![],jawaban=tebakgambar[_0x17aa6d[_0x425890(0xd86,0xa69,0xcb9,0x247)][_0x425890(-0x33,0x2eb,0x4,-0x5bc)]('@')[-0x3d*-0x3a+0x1733+0x1*-0x2505]];if(_0x295ea5[_0x17318e(0x17a5,0x16ab,0xac5,0x10fc)](_0x5af26d['toLowerCas'+'e'](),jawaban)){const _0x263b2a={};_0x263b2a[_0x17318e(0xb6d,0x940,0xc31,0x12bd)+'t']=_0x425890(0x4f3,0x64f,0x5c,0x10dc)+'Picture';const _0x5055c7={};_0x5055c7[_0x17318e(0x9d1,0x12c4,0x1be9,0x1194)]=_0x295ea5[_0x17318e(0x92f,0xf9e,0x1a4f,0x13bc)],_0x5055c7[_0x17318e(0x134d,0xc7b,0xacb,0x1318)]=_0x263b2a,_0x5055c7[_0x425890(0xed1,0x141b,0x1064,0x10c7)]=0x1,await _0x3797bd[_0x17318e(0xd3a,0x184a,0x13ed,0x12c4)+_0x425890(0x1139,0xcec,0x1294,0x5e6)](_0x17aa6d[_0x425890(0x63b,0xcc7,0x683,0xeec)],[_0x5055c7],_0x17318e(0xf9f,0x921,-0x292,0x68c)+'e\x20Picture\x20'+'🎮\x0a\x0aCorrect'+'\x20Answer\x20🎉\x0a'+_0x17318e(0x780,0x6ee,0x1191,0xc51)+_0x425890(0x1004,0xf6d,0xe61,0x1253)+_0x17318e(0x1c7b,0x14ee,0x12d2,0x156d)+'\x20Button\x20Be'+_0x425890(0x16fd,0xf09,0x991,0x4a1),_0x3797bd[_0x17318e(0xb0d,0x1d70,0x9fb,0x12db)][_0x425890(0x4b0,0xe82,0xb00,0x86c)],_0x17aa6d),delete tebakgambar[_0x17aa6d[_0x17318e(0x15d7,0x5f8,0x35e,0xc86)][_0x425890(0xad2,0x2eb,0x6aa,-0x15c)]('@')[-0x11*-0x19a+-0xa*0x349+0x5a0]];}else _0xcd1d32(_0x295ea5[_0x17318e(0x1aa3,0x161e,0x1e82,0x1803)]);}}if(tebakkata[_0x425890(0x688,0x679,-0x13e,0xba1)+_0x425890(0x108f,0x1305,0xdf3,0x1092)](_0x17aa6d[_0x17318e(0x2b7,0x4e3,0x7dd,0xc86)][_0x17318e(-0x7f,0x31e,0x207,0x508)]('@')[-0x1c0c+-0xa*-0x20b+-0x3*-0x28a])&&_0x13557e){if(_0x295ea5[_0x17318e(0x1c38,0x1896,0x1c90,0x17a2)]===_0x295ea5[_0x17318e(0x1aaf,0x13f3,0xf1a,0x17a2)]){kuis=!![],jawaban=tebakkata[_0x17aa6d[_0x425890(0x993,0xa69,0x488,0x1179)][_0x17318e(0x365,0x2d0,0xeb6,0x508)]('@')[-0x5*-0x3ee+0x671*0x4+0x2*-0x16b5]];if(_0x5af26d[_0x425890(0x127c,0xb39,0xe83,0xeed)+'e']()==jawaban){const _0x146c5c={};_0x146c5c[_0x425890(0x94a,0xf77,0x1762,0xc6c)]=_0x295ea5['cQMrd'],_0x146c5c[_0x17318e(0x17c2,0x120a,0x1ae8,0x1318)]={},_0x146c5c[_0x425890(0x159d,0x141b,0x1470,0x1586)]=0x1,_0x146c5c[_0x17318e(0x17c2,0x120a,0x1ae8,0x1318)][_0x425890(0x67b,0x10a0,0x8c5,0xa87)+'t']=_0x295ea5[_0x425890(0x989,0x375,-0x100,0x584)],await _0x3797bd[_0x17318e(0x1833,0x1af4,0x1643,0x12c4)+'Text'](_0x17aa6d[_0x17318e(0x486,0x15ec,0xe3b,0xee4)],[_0x146c5c],_0x17318e(0xbae,0x4a6,0x34c,0x68c)+_0x425890(-0xff,0x8e0,0x4cd,0x12f3)+_0x425890(0x64b,0xa92,0x4c7,0x1452)+_0x17318e(0x12a1,0x7cc,0x13e3,0x1182)+_0x17318e(0x1a51,0x1b32,0xb22,0x10b1)+_0x425890(0x802,0x372,0x231,-0x71b)+_0x17318e(0x6c2,0x10de,0x37c,0x9ed)+_0x17318e(-0xc7,0x11d,0xa1e,0x50b),_0x3797bd[_0x425890(0x91b,0x10be,0x1add,0x767)][_0x17318e(0x170f,0x157b,0x18eb,0x109f)],_0x17aa6d),delete tebakkata[_0x17aa6d[_0x17318e(0x1713,0x623,0x14b7,0xc86)][_0x17318e(-0x3fb,0xdd6,-0x351,0x508)]('@')[0x11c*0x8+0x131d+0x5*-0x599]];}else _0x295ea5[_0x425890(0x14d3,0xdb6,0x13c0,0xb34)](_0xcd1d32,_0x295ea5[_0x17318e(0x184a,0x14cc,0x1115,0x1803)]);}else{if(!_0x509b54)return _0x295ea5['WXOzL'](_0x487ed3,''+_0x15d7c4[_0x17318e(0xcbf,0xc40,0x16e6,0x1494)]);if(!_0x4589b3)return _0x7f8bc7(_0x17318e(0x10b5,0x139e,0x15fd,0xd25)+_0x295ea5['ywRqL'](_0xddf7f1,_0x59d070)+(_0x425890(0x106a,0xd5e,0x15f0,0x5bc)+_0x425890(0x416,0x361,0xde2,0x368)));_0x158a91['packname']=_0x5c30a0[_0x17318e(-0x4ab,0x8cb,0x758,0x508)]('|')[-0x189b*0x1+0x1122+0x779],_0x24aa08[_0x425890(-0x699,0x361,0x9af,-0x88)]=_0x461521[_0x17318e(0x5a1,0xa0f,0x6d2,0x508)]('|')[0x1*0x25b4+-0x6*0x3a1+-0x1*0xfed],_0x22c13f(_0x17318e(0x703,0xf83,0x60f,0x885)+_0x17318e(0x1780,0x12a6,0xf9c,0x117b)+'sfully\x20Cha'+'nged\x20to\x0a\x0a🔰'+_0x17318e(0xd7b,0x16a3,0x163b,0x13d2)+'\x20:\x20'+_0xf42580[_0x425890(0x679,0x645,0x355,0xa76)]+(_0x17318e(0xc7e,0x3fc,0x677,0x5b7)+'\x20:\x20')+_0x393dcb[_0x17318e(0x6a8,0x120,-0x138,0x57e)]);}}if(caklontong[_0x425890(0x40b,0x679,0xb7f,0x834)+_0x425890(0xa39,0x1305,0xb9d,0x171b)](_0x17aa6d[_0x425890(0x13b0,0xa69,0x1393,0x1040)][_0x17318e(0xe03,0xc97,-0x2f2,0x508)]('@')[-0x1c67+-0x136*0x8+0x2617])&&_0x13557e){if(_0x295ea5[_0x17318e(0xa90,0x10ab,-0x24c,0x83e)](_0x295ea5['ZhPnS'],_0x425890(0x1001,0x7a7,0xfd2,-0x32)))_0x226fa0(_0x111d48[_0x17318e(0x175,0x4d8,-0x1b8,0x5df)]);else{kuis=!![],jawaban=caklontong[_0x17aa6d[_0x425890(0x285,0xa69,0xb4,0x12e0)][_0x425890(-0x3d5,0x2eb,-0x612,-0x4e6)]('@')[-0x475+-0x1cf8+-0x216d*-0x1]],deskripsi=caklontong_desk[_0x17aa6d[_0x17318e(0x326,0x9da,0xe0c,0xc86)][_0x425890(-0x51,0x2eb,0x3ec,-0x42f)]('@')[-0x2f*-0x97+0x4*-0x529+0x1*-0x715]];if(_0x295ea5[_0x425890(-0x4,0x8b0,0x504,0xf92)](_0x5af26d['toLowerCas'+'e'](),jawaban)){const _0x326f09={};_0x326f09[_0x425890(0x763,0xf77,0x5d8,0x1184)]=_0x295ea5[_0x425890(0x1a09,0x13bb,0x134b,0x117a)],_0x326f09[_0x425890(0x19bb,0x10fb,0xedc,0x1460)]={},_0x326f09['type']=0x1,_0x326f09[_0x425890(0x19bb,0x10fb,0xedc,0x1460)][_0x17318e(0x1746,0x157a,0xe55,0x12bd)+'t']=_0x295ea5[_0x17318e(0xcaf,0x1bee,0x1f31,0x1533)],await _0x3797bd[_0x17318e(0xa93,0x96b,0x1807,0x12c4)+_0x17318e(0x8f6,0xe81,0xf5f,0xf09)](_0x17aa6d['chat'],[_0x326f09],_0x17318e(0x9d9,0x6f,0xde5,0x68c)+_0x425890(0x50e,0x388,-0x3da,0x936)+'\x0aCorrect\x20A'+_0x17318e(0x7e9,0x218,-0x3df,0x571)+deskripsi+(_0x17318e(0x1e6,0x99a,0x406,0x333)+_0x17318e(0x196f,0xbbe,0x1e7c,0x1599)+'n?\x20Press\x20T'+_0x17318e(0x1bac,0x119d,0x107b,0x12fb)+_0x17318e(0xaa6,0x990,0x2a1,0xac0)),_0x3797bd[_0x425890(0xf0c,0x10be,0x8be,0xf92)][_0x425890(0x1689,0xe82,0x5b7,0x56c)],_0x17aa6d),delete caklontong[_0x17aa6d['sender'][_0x17318e(0xe7f,0xd16,-0x4e0,0x508)]('@')[-0x1e4b+-0x1*-0x25d6+0x78b*-0x1]],delete caklontong_desk[_0x17aa6d[_0x425890(0x403,0xa69,0x90e,0x1441)]['split']('@')[0x252a+0x1*0x1147+-0x3671]];}else _0x295ea5[_0x17318e(0x4f5,0x9a8,0x65d,0xf76)](_0xcd1d32,_0x295ea5['IFBcK']);}}if(tebakkalimat['hasOwnProp'+_0x17318e(0x1c21,0x1aaf,0xd62,0x1522)](_0x17aa6d[_0x17318e(0x38d,0x757,0x861,0xc86)]['split']('@')[0x1710+-0x11f*0x7+-0xf37])&&_0x13557e){if(_0x425890(0xf5a,0xdd6,0x12f7,0x59f)===_0x295ea5[_0x425890(0x379,0xb2d,0xdc9,0x1252)]){kuis=!![],jawaban=tebakkalimat[_0x17aa6d[_0x17318e(0x324,0xaee,0x12a2,0xc86)][_0x17318e(-0x597,0x82e,-0x461,0x508)]('@')[0x1*-0x189d+0xb91+0xd0c]];if(_0x295ea5[_0x17318e(0x173e,0x1392,0x145a,0x11a9)](_0x5af26d[_0x425890(0x1f4,0xb39,0x1026,0xa1a)+'e'](),jawaban)){const _0x15f29c={};_0x15f29c[_0x17318e(0x10a6,0x1406,0x1539,0x12bd)+'t']=_0x17318e(0x5,0x319,0x6d9,0x86c)+_0x17318e(0x9a9,0x628,0xf29,0xf46);const _0xd709fb={};_0xd709fb[_0x17318e(0x12b1,0xad7,0x1037,0x1194)]=_0x295ea5[_0x425890(0xe3a,0xfdc,0x176b,0xebb)],_0xd709fb[_0x425890(0x1148,0x10fb,0x6db,0x14d5)]=_0x15f29c,_0xd709fb[_0x425890(0xcc5,0x141b,0x1e84,0x155a)]=0x1,await _0x3797bd[_0x17318e(0xe76,0x17db,0x1372,0x12c4)+_0x17318e(0x79d,0x1510,0x1365,0xf09)](_0x17aa6d[_0x425890(0x11bb,0xcc7,0xa6c,0x156d)],[_0xd709fb],_0x425890(-0x19,0x46f,0x904,0x17a)+_0x425890(0x191d,0x148f,0x1b8b,0x1433)+'\x20🎮\x0a\x0aCorrec'+_0x425890(0x17cc,0x14b1,0x1de8,0x1bf1)+_0x425890(0xe95,0x11a2,0x1b4a,0x172a)+_0x17318e(0x116e,0x1478,0x968,0xa95)+_0x425890(0x96f,0x7a2,0x9fe,-0x2d0)+_0x17318e(0x1712,0x1ead,0x150e,0x1546)+'elow',_0x3797bd['user'][_0x17318e(0xb1e,0x13a7,0xcfb,0x109f)],_0x17aa6d),delete tebakkalimat[_0x17aa6d[_0x17318e(0x49e,0x876,0xc8d,0xc86)][_0x425890(0xc25,0x2eb,-0x4f2,0x2b2)]('@')[0x12c2*-0x1+-0x1*0xd22+-0x34*-0x9d]];}else _0x295ea5['WPpIK'](_0xcd1d32,_0x295ea5[_0x425890(0x166a,0x15e6,0x13c4,0x1373)]);}else{const _0x2418e8={};_0x2418e8['displayTex'+'t']=_0x295ea5[_0x17318e(0x1548,0x1183,0x1062,0x1679)];const _0x162db0={};_0x162db0[_0x425890(0x12d5,0xf77,0x1768,0xdf6)]=_0x25f36d+_0x17318e(0x13dd,0x139b,0x1023,0x1494),_0x162db0[_0x17318e(0xccc,0x1a6b,0x12b7,0x1318)]=_0x2418e8,_0x162db0[_0x425890(0x134b,0x141b,0x1dc7,0x1357)]=0x1;const _0x4727c1={};_0x4727c1[_0x425890(0x118f,0x10a0,0xb9b,0x695)+'t']=_0x295ea5[_0x17318e(0xb6c,0xb32,0x15bc,0xeee)];const _0x5bd3fc={};_0x5bd3fc[_0x17318e(0xe4c,0x1694,0x17ca,0x1194)]=_0x74bd60+'alive',_0x5bd3fc['buttonText']=_0x4727c1,_0x5bd3fc[_0x425890(0x108f,0x141b,0x1d65,0xcd8)]=0x1;let _0x40f8c3=[_0x162db0,_0x5bd3fc];const _0x4044cc={};_0x4044cc[_0x425890(-0x55,0x5f3,-0x3bc,0xb07)]=_0x295ea5[_0x17318e(0xee3,0x856,0x1c7,0xb21)];const _0x351cde={};_0x351cde[_0x17318e(0x881,0x4a8,-0xb3,0x59e)]=_0x4044cc,_0x351cde[_0x17318e(-0x4a9,0x3ef,-0x186,0x527)]=_0x17318e(0x13be,0xdbc,0x10c2,0xaa8)+_0x17318e(0x15d6,0x1b8e,0x775,0x1120)+'*\x0a\x0acheck\x20y'+_0x425890(-0x294,0x15c,0x28b,-0x8f4)+_0x17318e(0x626,0x10ec,0xb11,0xa34)+_0x425890(0x374,0x5ad,-0x426,-0x19d)+'le.com/vie'+_0x17318e(0x10d5,0xd31,0x4c5,0xebf)+_0x17318e(0x1e20,0x1f08,0x1ea7,0x176f)+'e',_0x351cde['footer']=_0x295ea5[_0x17318e(0x1871,0x1b63,0x2136,0x1843)],_0x351cde[_0x17318e(0x12c1,0x105d,0xff2,0x117e)]=_0x40f8c3,_0x351cde[_0x17318e(0x1126,0x190e,0x1c4d,0x120c)]=0x4;let _0x49891a=_0x351cde;const _0x2b9ac9={};_0x2b9ac9[_0x425890(0x106a,0x807,0x298,0xf93)]=_0x2619cd,_0x5b677e[_0x425890(-0x60d,0x41f,0x982,0x494)+'e'](_0x405aa9[_0x17318e(0xfba,0x1424,0x10cd,0xee4)],_0x49891a,_0x2b9ac9);}}if(tebaklirik[_0x425890(0xc93,0x679,0x94a,0x9b9)+_0x425890(0x109c,0x1305,0x11c1,0x161b)](_0x17aa6d[_0x425890(0x124e,0xa69,0x1371,0xa01)][_0x425890(-0x664,0x2eb,0x149,0xd60)]('@')[-0xb57*0x1+0x1a20+-0xec9])&&_0x13557e){if(_0x295ea5[_0x425890(0x82a,0xfc0,0x18da,0x1750)](_0x295ea5['fXTxW'],_0x295ea5[_0x17318e(0x14b6,0x1b7d,0x142e,0x1461)])){const _0x2154e7=_0xa789f8[_0x425890(0x11b0,0x7f3,0x752,0x314)](_0x176f7f,arguments);return _0x2a6e8f=null,_0x2154e7;}else{kuis=!![],jawaban=tebaklirik[_0x17aa6d['sender']['split']('@')[0x1194+-0x1607+0x473]];if(_0x295ea5[_0x425890(0x460,0x8b0,0x94b,0xf4f)](_0x5af26d[_0x425890(0x18b,0xb39,0x4b4,0x5a8)+'e'](),jawaban)){const _0x32473d={};_0x32473d['buttonId']=_0x295ea5[_0x17318e(0x8c8,0xd37,0xa97,0xe33)],_0x32473d[_0x425890(0xa54,0x10fb,0xa1c,0x11d6)]={},_0x32473d['type']=0x1,_0x32473d[_0x425890(0xa54,0x10fb,0xa1c,0x11d6)][_0x425890(0xe90,0x10a0,0x1180,0x1792)+'t']=_0x295ea5[_0x425890(0x1c25,0x13c0,0xfa4,0x1469)],await _0x3797bd[_0x425890(0x10d7,0x10a7,0x17cb,0x12d6)+'Text'](_0x17aa6d[_0x17318e(0x9f1,0x993,0x1385,0xee4)],[_0x32473d],_0x17318e(0xd97,0xecf,0x999,0x68c)+'e\x20Lyrics\x20🎮'+_0x425890(0x10d2,0xa71,0x10dc,0x65e)+_0x425890(0x479,0xdd2,0x1390,0x1053)+_0x425890(0x7b8,0x7e8,0xe9d,0xb15)+_0x17318e(0x1014,0x108e,0x6f,0x9d4)+'Press\x20The\x20'+_0x17318e(-0x1d2,0x1089,0x1d2,0x63f)+'ow',_0x3797bd[_0x425890(0x925,0x10be,0x1183,0x6aa)][_0x17318e(0x1021,0xfe0,0x1878,0x109f)],_0x17aa6d),delete tebaklirik[_0x17aa6d['sender'][_0x425890(0x837,0x2eb,-0x39b,-0x291)]('@')[0x1*0xa1a+0x1c3+0xbdd*-0x1]];}else _0xcd1d32(_0x17318e(0x1022,0x190,0xd20,0xa68)+_0x17318e(0xb36,0x341,0x10d0,0x6bd));}}if(tebaktebakan[_0x17318e(-0x57,0xbb2,0x678,0x896)+_0x17318e(0xbf1,0x1962,0x1ad9,0x1522)](_0x17aa6d[_0x17318e(0xcac,0x1572,0x14ad,0xc86)][_0x17318e(0xb7b,0xbb0,0x662,0x508)]('@')[0x86a*-0x1+-0x1628+0x1*0x1e92])&&_0x13557e){kuis=!![],jawaban=tebaktebakan[_0x17aa6d['sender']['split']('@')[0x116c+0x2673+-0x37df]];if(_0x5af26d[_0x17318e(0xeeb,0x13a3,0x616,0xd56)+'e']()==jawaban){if(_0x295ea5['nwDGb'](_0x295ea5[_0x425890(0x197b,0xedb,0x50b,0x825)],_0x295ea5[_0x425890(0x56e,0xedb,0xdb1,0x65c)])){const _0x57d15b={};_0x57d15b[_0x17318e(0x197d,0x739,0x1b09,0x1194)]=_0x295ea5[_0x17318e(0xadd,0x6c2,0xf4e,0xc13)],_0x57d15b[_0x425890(0xce1,0x10fb,0x16ee,0xe86)]={},_0x57d15b[_0x425890(0x17bd,0x141b,0x1328,0x184d)]=0x1,_0x57d15b[_0x425890(0xce1,0x10fb,0x16ee,0xe86)][_0x17318e(0x1c01,0x115d,0x1032,0x12bd)+'t']=_0x295ea5[_0x425890(0x892,0x306,-0x234,0x25)],await _0x3797bd[_0x425890(0x129d,0x10a7,0xe57,0xae5)+_0x425890(0x1505,0xcec,0xbf3,0x77b)](_0x17aa6d[_0x425890(0x2ef,0xcc7,0xcd1,0xe38)],[_0x57d15b],_0x17318e(0x450,-0x1b3,0xe7c,0x68c)+_0x425890(0x11b7,0xeb2,0x18c7,0x13eb)+'\x0a\x0aCorrect\x20'+_0x17318e(0xa27,0xa0a,0x10e3,0xfef)+'Want\x20To\x20Pl'+_0x17318e(0xf42,0x11d5,0x4e,0x9d4)+'Press\x20The\x20'+_0x17318e(0x58,0x757,-0x35,0x63f)+'ow',_0x3797bd[_0x425890(0x1900,0x10be,0x1795,0x1862)][_0x425890(0x1393,0xe82,0xc7f,0x1563)],_0x17aa6d),delete tebaktebakan[_0x17aa6d[_0x425890(0xa6c,0xa69,0xce5,0x65a)]['split']('@')[0x9*0x11+0x1a2a+-0x11*0x193]];}else{_0x28e7cd=_0x479c19[_0x425890(0xc68,0xa56,0xe16,0xcc)+'nc'](_0x425890(0x11d2,0x8dc,0x12aa,0x146)+_0x425890(0x92f,0x17a,-0x3bc,0x325)+_0x40fca6+_0x17318e(0x15ac,0xa34,0xf40,0x11e2));const _0x28eedd={};_0x28eedd[_0x425890(-0x2ae,0x381,-0x5a,0x864)]=_0x55678c;const _0x2b81cc={};_0x2b81cc['quoted']=_0x27ffa2,_0x6fb7a8[_0x425890(0x73,0x41f,-0x3d3,-0x2ef)+'e'](_0x5e13f1[_0x425890(0x2f4,0xcc7,0x8fc,0x588)],_0x28eedd,_0x2b81cc);}}else _0x295ea5[_0x425890(0x407,0x87a,0x52,0xaf)](_0xcd1d32,_0x425890(0x78e,0x84b,0x10eb,0x155)+_0x425890(0xeae,0x4a0,0x715,0xd7d));}this[_0x17318e(0x8b8,0xb2b,0xc68,0x112a)]=this[_0x425890(0x10ee,0xf0d,0x178a,0x7ee)]?this[_0x17318e(0x10bd,0xda8,0x120f,0x112a)]:{};let _0xa55353=Object[_0x17318e(0x9a0,0x7e0,0x266,0x5b6)](this['game'])[_0x425890(0x1741,0x11b1,0x13b4,0xe8c)](_0x35be02=>_0x35be02['id']&&_0x35be02[_0x17318e(0xcbf,0xcb7,0xcfa,0x112a)]&&_0x35be02[_0x425890(0x16a7,0x1226,0x944,0x1667)]&&_0x35be02['id'][_0x425890(-0x513,0x436,-0xdb,0x735)](_0x425890(0x72d,0xea4,0x167c,0x913))&&[_0x35be02[_0x17318e(0x1845,0xe33,0x82d,0x112a)][_0x17318e(0x15fc,0xece,0x1605,0xf0d)],_0x35be02[_0x17318e(0x135c,0x1a79,0xbdd,0x112a)][_0x17318e(0x10da,0x14fd,0xc70,0xdc1)]][_0x425890(0xcd5,0x291,-0x45d,-0x2d6)](_0x17aa6d['sender'])&&_0x35be02['state']==_0x17318e(0xa7d,0x878,0x271,0xcd8));if(_0xa55353){if(_0x295ea5[_0x425890(0xd8e,0x985,0xc3,0x2e6)](_0x295ea5['niWdg'],'MoFke')){let _0x41d6db,_0x4883d5=!(0x3b*0x2e+0x81+-0xe*0xcb),_0x176442=!(-0xaf8*0x3+-0x22d2+0x9ad*0x7),_0x2e30b3=!(0x1*-0xd+-0x610+0x61e);if(!/^([1-9]|(me)?give up|surr?ender|off|skip)$/i['test'](_0x17aa6d[_0x17318e(0x691,0x535,-0x5ab,0x405)]))return;_0x2e30b3=!/^[1-9]$/[_0x425890(0x1675,0xd86,0xe65,0x911)](_0x17aa6d['text']);if(_0x295ea5[_0x425890(0x213,0xb59,0x12b7,0xb78)](_0x17aa6d[_0x425890(0x49e,0xa69,0x8bd,0x624)],_0xa55353[_0x425890(0x586,0xf0d,0xd7c,0x15dc)]['currentTur'+'n'])){if(_0x295ea5[_0x17318e(0x163e,0xcf3,0x1169,0x16b7)](_0x295ea5[_0x425890(-0x21d,0x822,0xc88,0x15c)],_0x295ea5['nZTfp'])){if(!_0x2e30b3)return!(-0x14*-0xd3+-0x1*0xcb+-0xfb1);}else{if(_0x210257[_0x17318e(0x48c,0xdc5,-0x5b8,0x4ae)](_0x17318e(0x104d,0x1704,0x10b7,0x114f)))return _0x295ea5['VqeGc'](_0xcd1cae,_0x5a486a);if(_0x295ea5[_0x425890(0x1765,0x10d1,0x965,0x1596)](!_0x4cb06e,0x2b*-0x26+-0x11b2+0x1815*0x1))return _0x295ea5['eMHRc'](_0x185ebd,_0x295ea5[_0x17318e(0xda2,0x196b,0xe47,0x13a2)]);if(_0x295ea5[_0x425890(0xce0,0xc22,0x14a3,0x712)](_0x5d3a6c,-0x6*0xfb+0xf09+0x8c3*-0x1))return _0x295ea5[_0x17318e(-0x21f,0x1008,0x586,0x6e5)](_0x4772bb,_0x17318e(0x286,-0x2c1,0x837,0x733)+_0x17318e(0x83e,0x158e,0x1526,0xcf8));if(_0x5317d8<0x24ab+-0x5*-0x9d+-0x27bb)return _0xd1cc67(_0x425890(0xe3a,0xbb0,0x75a,0xf3f)+'Have\x20A\x20Pot'+_0x17318e(0x1092,0x165c,0x1257,0xcd9)+_0x17318e(0x396,-0x24,0xd59,0x5a6)+'his\x20Way\x20#b'+_0x17318e(0x152d,0x1417,0x7b4,0xc65)+'amount_');_0x2e609d(_0x138232[_0x17318e(0x16e5,0x3d4,0x64c,0xc86)],-0x1*0xfad+-0x1467+0x2478),_0x295ea5['ETbYZ'](_0x23162c,_0x1ad6ad[_0x425890(0xb5e,0xa69,0xcad,0xbee)],0x3d1*-0x3+0x1449+-0x7*0x143),_0x295ea5[_0x425890(-0x1f0,0x4c8,-0x496,-0x187)](_0x5f0c64,_0x295ea5['UXZmq']);}}if(!_0x2e30b3&&0xfbb+-0x2228+-0xe*-0x151>(_0x41d6db=_0xa55353[_0x17318e(0x1482,0x15c0,0x6c4,0x112a)][_0x17318e(0x9d8,0xb99,0x5cf,0xfdf)](_0x295ea5[_0x425890(0x11b7,0xe35,0x1198,0x9e2)](_0x17aa6d[_0x425890(0x81,0xa69,0x626,0x1424)],_0xa55353[_0x17318e(0x1969,0x9c0,0xd77,0x112a)][_0x17318e(0x154f,0xcb3,0xdf3,0xdc1)]),_0x295ea5['LxYbd'](parseInt,_0x17aa6d[_0x425890(0xc11,0x1e8,-0x5dd,0x2d9)])-(0x50*0x25+-0x1922+0x5*0x2b7))))return _0x295ea5[_0x17318e(-0x623,0x1b4,0xc87,0x36e)](_0xcd1d32,{'-3':_0x295ea5['WCwlj'],'-2':_0x295ea5[_0x17318e(0x19e9,0x161b,0x1722,0x13d1)],'-1':'Invalid\x20Po'+_0x425890(0xac4,0xc03,0x349,0x973),0x0:_0x295ea5[_0x17318e(0x110f,-0x30b,0x10aa,0x6fc)]}[_0x41d6db]),!(0x8d*0x3d+-0x196*0x10+-0x839);if(_0x17aa6d[_0x425890(0x178,0xa69,0x295,0x1259)]===_0xa55353[_0x425890(0xff2,0xf0d,0x13e4,0x8d5)]['winner'])_0x4883d5=!![];else{if(_0x295ea5[_0x17318e(0x65a,0x10c8,0x74f,0x9c0)](_0xa55353[_0x17318e(0x144d,0x17f9,0x1a85,0x112a)][_0x425890(0x4a7,0xaf5,0x53e,0x91c)],-0x12af*0x2+-0x14ea*0x1+0x3c47))_0x176442=!![];}let _0x441688=_0xa55353[_0x17318e(0x6a1,0xf0c,0x1864,0x112a)][_0x425890(0xaee,0x277,0x45c,-0x669)]()['map'](_0x1b693a=>{const _0x3c361a={};_0x3c361a['X']='❌',_0x3c361a['O']='⭕',_0x3c361a['1']=_0x295ea5[_0x364957(-0x23d,0x40a,-0x349,0x53f)],_0x3c361a['2']=_0x295ea5[_0x1d0277(0x6ff,0x115,0x12,-0x198)];function _0x364957(_0x4364ba,_0x474897,_0x43b4e3,_0xeaad59){return _0x17318e(_0x4364ba-0x2d,_0x4364ba,_0x43b4e3-0x1bd,_0xeaad59- -0x332);}_0x3c361a['3']=_0x295ea5[_0x364957(0x59f,0x10dd,0x9ce,0xf44)],_0x3c361a['4']=_0x295ea5[_0x364957(0x1806,0xb39,0x13d7,0x1405)],_0x3c361a['5']=_0x295ea5[_0x364957(0x519,0x450,0x15f,0xa2e)];function _0x1d0277(_0x420f6a,_0x41d0ed,_0x3a5e60,_0x29afa4){return _0x17318e(_0x420f6a-0x148,_0x41d0ed,_0x3a5e60-0x1eb,_0x3a5e60- -0x40f);}return _0x3c361a['6']=_0x364957(0x1082,0x89c,0x1656,0xfbb),_0x3c361a['7']=_0x295ea5[_0x364957(0x1b6b,0x13d7,0x998,0x10fd)],_0x3c361a['8']=_0x295ea5[_0x364957(0x19cc,0x1808,0x95f,0xf36)],_0x3c361a['9']=_0x295ea5['HVphS'],_0x3c361a[_0x1b693a];});if(_0x2e30b3){if(_0x295ea5[_0x17318e(0x1210,0xf4e,0x116c,0xbde)](_0x295ea5[_0x17318e(0x75f,0x106f,0x975,0x1145)],_0x425890(0x1913,0x1594,0x1dbd,0x170a)))_0xa55353[_0x425890(0x177f,0xf0d,0x74a,0x5c6)][_0x17318e(0x420,0xdec,0x6a0,0x9b2)+'rn']=_0x17aa6d['sender']===_0xa55353['game']['playerX'],_0x4883d5=!![];else{const _0x24bdc9={};_0x24bdc9['text']='*මුකුත්\x20නෑ'+_0x17318e(0xb5b,0x874,0x1322,0xd57);const _0x33b3ee={};_0x33b3ee['quoted']=_0x222e17,_0x4bcc8f[_0x425890(0xa1b,0x41f,0x12b,-0x585)+'e'](_0x39d863,_0x24bdc9,_0x33b3ee);}}let _0xfd60d5=_0x2e30b3?_0xa55353[_0x425890(0x9f6,0xf0d,0xa17,0x6a0)][_0x425890(0xeb0,0x134b,0xfae,0x1989)+'n']:_0xa55353[_0x17318e(0x17f1,0xb38,0x6ec,0x112a)][_0x425890(0x1472,0x145e,0xfdd,0xd90)],_0xd13720=_0x17318e(0x12dc,0x23e,0xe48,0x894)+_0xa55353['id']+'\x0a\x0a'+_0x441688[_0x425890(0x1a9d,0x10c8,0x8de,0x8f3)](-0x22c5+0x1885*-0x1+0x1*0x3b4a,-0x220+0x37c*-0x1+0x1*0x59f)[_0x17318e(0xc09,-0x95,0x1059,0x712)]('')+'\x0a'+_0x441688['slice'](-0x18cf+0x9*0x22b+0x54f,-0xd*-0x7f+-0x68*-0x28+-0x16ad)[_0x425890(0xc15,0x4f5,-0x365,0x49f)]('')+'\x0a'+_0x441688[_0x425890(0xd03,0x10c8,0x18f6,0xfae)](-0x1b1*-0xe+0x1a05+-0x1b*0x1d7)[_0x17318e(-0x138,0xfab,0xf2d,0x712)]('')+'\x0a\x0a'+(_0x4883d5?'@'+_0xfd60d5[_0x17318e(0xa3a,0xc6c,0xafb,0x508)]('@')[-0x1ced+0x26a0+-0x9b3]+'\x20Won!':_0x176442?_0x17318e(0xc94,0x16ed,0x15a4,0x12a4):_0x425890(0xcd3,0x1330,0x1b2a,0x8a7)+['❌','⭕'][_0x295ea5[_0x425890(0xe0c,0xc04,0xa6c,0x79e)](0x1c01+-0x15dd+-0x623,_0xa55353[_0x17318e(0x145f,0x1436,0x932,0x112a)][_0x425890(0x111e,0x795,0x911,0xc1b)+'rn'])]+_0x425890(0x117c,0x1638,0xdc9,0x13d0)+_0xa55353[_0x17318e(0xcc3,0x170b,0xba4,0x112a)][_0x425890(0x129d,0x134b,0x18ed,0x1790)+'n']['split']('@')[0xa*-0x331+-0x1c2f+0x3c19]+')')+'\x0a❌:\x20@'+_0xa55353[_0x17318e(0x1b11,0x1212,0xb73,0x112a)]['playerX'][_0x17318e(0xcb2,0x9de,0x311,0x508)]('@')[-0x1a9d*-0x1+0x12b6+-0x2d53]+_0x425890(0x1151,0xbb7,0x31b,0x9b2)+_0xa55353[_0x425890(0x15fe,0xf0d,0x14e9,0x1278)]['playerO'][_0x425890(0x65c,0x2eb,0x13e,0x8a9)]('@')[-0x187+0x4fd+-0x1*0x376]+(_0x425890(0x514,0x469,0x6f6,0x911)+_0x425890(0xf73,0xee5,0x161e,0x668)+_0x425890(0x66,0x4ec,0x54b,0x4ee)+'er\x20and\x20adm'+_0x425890(0x12ff,0x915,0xca,0x6da)+'t');if((_0xa55353[_0x425890(0x13c2,0xf0d,0x7bc,0x12dd)][_0x17318e(0x25d,0x89a,0xb5f,0x9b2)+'rn']^_0x2e30b3?_0xa55353['x']:_0xa55353['o'])!==_0x17aa6d[_0x425890(0xe92,0xcc7,0x7b3,0xd5c)])_0xa55353[_0xa55353[_0x425890(0x4c8,0xf0d,0x752,0x1285)][_0x425890(0xe60,0x795,0x2e3,0x6a9)+'rn']^_0x2e30b3?'x':'o']=_0x17aa6d['chat'];if(_0x295ea5[_0x17318e(0x15fc,0x168c,0x6e9,0xd76)](_0xa55353['x'],_0xa55353['o']))await _0x3797bd[_0x17318e(0xa46,0xde9,0x1273,0x14cf)](_0xa55353['x'],_0xd13720,_0x17aa6d,{'mentions':parseMention(_0xd13720)});await _0x3797bd[_0x17318e(0x168b,0x1baf,0x12f9,0x14cf)](_0xa55353['o'],_0xd13720,_0x17aa6d,{'mentions':_0x295ea5[_0x425890(0x6ee,0x6e0,0x8c4,0xfe5)](parseMention,_0xd13720)});if(_0x295ea5[_0x17318e(0x47e,0x76e,0x128f,0xac9)](_0x176442,_0x4883d5)){if(_0x295ea5['CFmGm']==='ibchB'){const _0x3342bb={'CyXDH':function(_0x839751,_0x114ca1){function _0x57aa34(_0xff73a1,_0x4d94cd,_0x44302d,_0xd14cbe){return _0x425890(_0xff73a1,_0xd14cbe- -0x236,_0x44302d-0x42,_0xd14cbe-0x82);}return _0x295ea5[_0x57aa34(0x1034,0x14a2,0x647,0xd42)](_0x839751,_0x114ca1);}};if(_0x3cc619[_0x17318e(0xb03,0x91b,-0x356,0x4ae)](_0x295ea5[_0x425890(0x6fb,0x7b2,0x18,0x5ff)]))return _0x295ea5[_0x17318e(0x1013,0x1208,0x1e5b,0x15a7)](_0x1a289a,_0x209b3b);!_0x3efb06&&_0x295ea5[_0x425890(0xd46,0x14e5,0xf54,0x1bfb)](_0x587a24,_0x3ef66c[_0x17318e(0x5b9,0x1148,0xc70,0xc86)]);if(_0x295ea5[_0x17318e(0x9c5,0xa26,0xa1a,0x12ee)](_0x4e3e8b,-0x1e48+0x1*0x20e3+-0x29a))return _0x484090(_0x425890(0x1085,0xc38,0xced,0x109b)+'ed!,\x20Try\x20T'+_0x17318e(0x95f,0x1716,0xcd3,0xed4)+_0x17318e(0x1871,0x16ca,0x17db,0x1337));let _0x57006b=[-0x1b26+0x1c66+0x1*-0x13f,0x1e59+-0x48+0x1b*-0x11d,-0x127a+0x160f*-0x1+0x166*0x1d,0x8d+-0x11b9+0x112c*0x1,0x2706+-0x777*0x2+-0x9*0x2ad,-0x16da+-0x1212+0xda4*0x3,0x1*0x71e+-0xf52+-0xbf*-0xb,-0xd13+-0xad+-0x1*-0xdc1,-0x33f+0x1091*-0x2+0x2465,-0x16b0+-0x1fb4+0x3665,-0x1754+0xca5+-0x224*-0x5,-0xd3*-0x23+-0x184c+-0x48d,-0x1*0x65e+0x2060+-0x1a02],_0x47a7af=[0x80a+-0x1ff0+-0x13*-0x142,0x26c1+-0x13*0xce+-0x1776,-0x223c+0x6*0x61b+0xcc*-0x3,-0x2410+0x2035+0x3de,-0x11*-0x1b0+0x1184+0xb8d*-0x4,-0x1*-0x469+0x1bf6+-0x205f,-0x13d7+-0x4b4*0x3+0x21f3,0x269f*0x1+0x231b+-0x49b9,0xa81*0x3+-0xde+-0x1ea4*0x1,-0x1e05+-0x151f*-0x1+-0x8e6*-0x1,-0x2e*0x6d+0xeee+0x1*0x4a8,-0x1*0xb3f+0x1da+0x967*0x1],_0x2f77ad=[-0x1765+-0x1c16+0x337b,0x21*-0x41+0x2053+0x1*-0x17f2,-0xe81+0x2221+-0x139f,0x1ccf+0xc75+-0x2944,-0x130*-0x13+-0x1835+0x1a5*0x1,0x1d92+0x1130+-0x2ec1,-0x3d1+0x1*0x179c+-0x13cb*0x1,-0x1*0x18cd+0x3*0xaf2+-0x19b*0x5,-0x11f1+-0x785*-0x3+-0x1*0x49d,0x1474+0x613+-0x1a87,0x2186+0x87*0x1+-0x220d,-0x1afa+-0x201a+-0x19*-0x25d];var _0x468f7f=_0x57006b[_0x465617['floor'](_0x295ea5[_0x425890(0x323,0x9ad,0x4c6,0x13e5)](_0x2edf50[_0x17318e(0x2e0,0x8af,0x7f8,0xb4b)](),_0x57006b[_0x425890(0xe31,0x8bc,0xab4,-0xd4)]))],_0x38fd14=_0x47a7af[_0xe7e6d4[_0x17318e(0x106a,0xcaf,0xf02,0x1632)](_0x295ea5['rLTiH'](_0x1abb1f[_0x425890(0xc6a,0x92e,0x2a7,0x1129)](),_0x47a7af[_0x17318e(0xec2,0xb40,0x1365,0xad9)]))],_0x5d34b9=_0x2f77ad[_0x3fe11b[_0x425890(0x1ae8,0x1415,0x1c63,0x1249)](_0x295ea5[_0x425890(0x140,0x9ad,0x8bd,0x1247)](_0x220fec['random'](),_0x2f77ad[_0x425890(0x1be,0x8bc,-0x43,0x678)]))];_0x295ea5[_0x425890(0x864,0x3d1,0xa73,0xd72)](_0xe1333d,()=>{let _0x5135e5='[\x20MINING\x20R'+'ESULT\x20]\x0a*I'+_0x189031(0x1187,0xa3a,0xf8b,0x975)+_0x468f7f+_0x189031(0x45f,0xefe,0x94a,0xd23)+_0x38fd14+('\x0a*Emerald*'+_0x493294(-0x1a,-0x3a3,0x6d8,0x693))+_0x5d34b9,_0x1d6885=[{'buttonId':''+_0x295ea5['ifFMd'](_0x396ffa,_0x2d7b9f),'buttonText':{'displayText':_0x295ea5[_0x493294(0x159d,0x13a2,0x159c,0xce8)]},'type':0x1}];const _0x245013={};_0x245013['url']=_0x295ea5[_0x493294(0xa9e,0xb11,0xa6a,0x2ac)];const _0x3d4ea5={};_0x3d4ea5[_0x189031(0x88d,0x1cd,0x170,0x157)]=_0x245013,_0x3d4ea5[_0x189031(-0x87b,0x110,0x25f,0xe0)]=_0x5135e5,_0x3d4ea5['footer']=_0x171279,_0x3d4ea5[_0x493294(0xf91,0xb26,0x6bd,0xdf5)]=_0x1d6885,_0x3d4ea5['headerType']=0x4;let _0x57bef9=_0x3d4ea5;function _0x493294(_0x3abda5,_0x219848,_0x2c8830,_0x388e31){return _0x425890(_0x219848,_0x388e31- -0x16c,_0x2c8830-0xd4,_0x388e31-0xe6);}function _0x189031(_0x5453bc,_0x397904,_0x875534,_0x16c06d){return _0x425890(_0x5453bc,_0x16c06d- -0x22a,_0x875534-0x7f,_0x16c06d-0x159);}const _0x4c5a65={};_0x4c5a65['quoted']=_0x1ca46d,_0x1f9041[_0x189031(0xb5a,-0xb2,-0x4e3,0x1f5)+'e'](_0x2cb89e,_0x57bef9,_0x4c5a65);},-0x34b8+-0x1*0xcc7+0x1*0x5cd7),_0x295ea5['ETbYZ'](_0x1ed9fb,()=>{function _0x125eb4(_0x32afe7,_0x448f7b,_0x40ed19,_0x527cba){return _0x425890(_0x527cba,_0x32afe7- -0x2ce,_0x40ed19-0xf7,_0x527cba-0x1c);}function _0x204c58(_0x30622c,_0x489e30,_0x2f4ee0,_0x3b0e3a){return _0x17318e(_0x30622c-0x128,_0x3b0e3a,_0x2f4ee0-0x1c4,_0x489e30- -0xb2);}_0x3342bb[_0x125eb4(0x31e,0x2e4,-0x46c,0x224)](_0x54683c,'@'+_0x56d1ba[_0x204c58(0x659,0xbd4,0x109c,0x716)][_0x125eb4(0x1d,0x597,-0x385,0x1ee)]('@')[-0x1*0x17c8+-0xa38+0x10*0x220]+('\x20Started\x20M'+_0x125eb4(-0x4c,-0x90c,-0x70d,0x1af)));},0x1539+-0x4ee*0x1+0xa6f*-0x1),_0x3ba09c(_0x1a9f9e['sender'],-0x74b*0x5+-0x1903*-0x1+0xb7e),_0x295ea5['VTWyl'](_0x38518e,_0x403de1[_0x425890(0xe54,0xa69,0xb84,0x128d)],_0x468f7f),_0x295ea5[_0x425890(0x11ea,0x11d3,0x10b5,0x1242)](_0x574955,_0x1f44d5[_0x425890(0x12b5,0xa60,0x4c,0x14d6)],_0x38fd14),_0x295ea5[_0x17318e(0x17d7,0xd6e,0x161b,0xd40)](_0x4763b2,_0x559ce3[_0x425890(0x6ba,0xa69,0xca7,0x89d)],_0x5d34b9);}else delete this[_0x425890(0xdce,0xf0d,0x11e8,0x7c9)][_0xa55353['id']];}}else{if(_0x18b783[_0x17318e(0xea9,0x10fd,0x9ef,0xaf8)]===_0x295ea5[_0x17318e(0x9e6,0x9f5,0xc8d,0xee7)])return;if(_0xbc0a9a['chatbotpre']===_0x17318e(0x125f,0x148a,0x2048,0x184b)){const _0xf15ed={};_0xf15ed[_0x425890(-0x49d,0x1e8,0x9dd,0x270)]=_0x17318e(0xfde,0xcde,0x1cd7,0x14bb)+_0x17318e(0x105e,0xe23,0xbdd,0x117d);const _0x2e6d4b={};_0x2e6d4b['quoted']=_0x1b8ffb,_0x4f0d78[_0x425890(0xdb4,0x41f,-0x3a0,-0xff)+'e'](_0x1c212a,_0xf15ed,_0x2e6d4b);}}}this['suit']=this[_0x425890(0xe4,0x33d,0x4cc,0x73d)]?this['suit']:{};let _0x2521ab=Object[_0x425890(0x798,0x399,-0x4b7,0xd61)](this[_0x17318e(0x65b,0x6b8,-0x27d,0x55a)])[_0x17318e(0xae9,0xf94,0xe85,0x13ce)](_0x31f614=>_0x31f614['id']&&_0x31f614[_0x17318e(0xe46,0x18c7,0x914,0x12b5)]&&[_0x31f614['p'],_0x31f614['p2']][_0x425890(0xb5f,0x291,-0xc0,0x3f6)](_0x17aa6d[_0x425890(0x770,0xa69,0x3fd,0x95a)]));if(_0x2521ab){let _0x559958='',_0x1fe91c=![];if(_0x295ea5[_0x425890(0x4ea,0xbf5,0x300,0x90d)](_0x17aa6d[_0x17318e(0xf95,0x615,0x12a7,0xc86)],_0x2521ab['p2'])&&/^(acc(ept)?|accept|yes|okay?|reject|no|later|nope(k.)?yes|y)/i[_0x17318e(0x17e0,0x9c6,0x504,0xfa3)](_0x17aa6d[_0x425890(0xbcc,0x1e8,-0x255,0xba2)])&&_0x17aa6d[_0x17318e(0x304,0x30b,0x4be,0x532)]&&_0x295ea5[_0x425890(0xda1,0x15bc,0xde0,0x1c9c)](_0x2521ab[_0x17318e(0x1319,0x1432,0x16d7,0x12b5)],_0x295ea5[_0x425890(0x108b,0x134d,0x1773,0x1cd6)])){if(_0x295ea5[_0x425890(0xd7c,0x62e,0x98,0xd8f)](_0x295ea5[_0x425890(0xa61,0xab9,0xe15,0x3ab)],_0x425890(-0x7aa,0x117,0x42d,0xe1))){if(_0x30dc9a['chatbotpre']===_0x295ea5[_0x425890(0xd27,0xcca,0x71e,0x1012)])return _0x295ea5[_0x425890(0x15e7,0x121a,0x1b80,0x95a)](_0x3d3a47,_0x425890(0x543,0xcf9,0x14fc,0xc36)+'d');_0x1f6ccf[_0x425890(0x35c,0x8db,0xa17,0xb0f)]=_0x425890(0xbc1,0x12af,0x1d4b,0x1b5b),_0x295ea5['BlHWn'](_0x5092fb,_0x425890(0x976,0x6d3,0x433,0xc79)+_0x425890(-0xef,0x647,0x547,0x10c2)+_0x17318e(0x194,0x2da,-0xb1,0x9b6));}else{if(/^(reject|no|later|n|nope(k.)?yes)/i['test'](_0x17aa6d['text']))return _0x3797bd['sendTextWi'+'thMentions'](_0x17aa6d[_0x17318e(0x1764,0x467,0xc7b,0xee4)],'@'+_0x2521ab['p2'][_0x17318e(0x852,0xfe,0xbe3,0x508)]`@`[-0x1d24+0x2*0xe6b+0x4e]+(_0x425890(0x1368,0x13ae,0x18db,0x1b43)+_0x425890(0x1097,0x109d,0xdd3,0x17c3)+_0x17318e(0x24e,0xd8f,0x7d6,0x814)),_0x17aa6d),delete this[_0x17318e(0xe08,0xa6c,-0x241,0x55a)][_0x2521ab['id']],!(-0x6b*0xf+0x3*-0x5fc+0x1839);_0x2521ab[_0x17318e(0x11e2,0xd2c,0x1689,0x12b5)]=_0x425890(0xa7e,0xb06,0x1506,0xfa0),_0x2521ab['asal']=_0x17aa6d[_0x425890(0xcf2,0xcc7,0x1271,0x1313)],clearTimeout(_0x2521ab['waktu']),_0x3797bd[_0x425890(0xf05,0x12b2,0x1060,0x1bfe)](_0x17aa6d[_0x17318e(0xed9,0x148d,0xb67,0xee4)],'Suit\x20Has\x20B'+_0x17318e(0xdfe,0x402,0x8fa,0x50c)+_0x17318e(0x250,-0x213,0xbe7,0x3a9)+_0x2521ab['p'][_0x425890(0x428,0x2eb,0xbfb,-0x137)]`@`[-0x1737+0x1*0x8da+0x1*0xe5d]+'\x20dan\x20\x0a@'+_0x2521ab['p2'][_0x17318e(-0x4d3,0x3d,-0x1ba,0x508)]`@`[-0x2098+0x1*-0x245f+0x44f7]+(_0x17318e(0x867,0x352,0x90f,0xbf1)+_0x425890(0x10af,0x951,0xc6d,0xf88)+'it\x20In\x20The\x20'+'Respective'+_0x425890(-0x42e,0x1e0,0xc76,-0x2ab)+_0x17318e(0xe64,0x5ba,0x3ff,0x9f4)+_0x17318e(0x32d,0x81e,0x40d,0x688))+_0x1b370d[_0x425890(0x419,0x2eb,-0x648,0x62b)]`@`[0x1*0xb64+-0x1f7b+-0x8b*-0x25],_0x17aa6d,{'mentions':[_0x2521ab['p'],_0x2521ab['p2']]});if(!_0x2521ab[_0x425890(0xfc8,0x7af,0xa68,-0x100)])_0x3797bd[_0x425890(0x15b0,0x12b2,0xe74,0x12fc)](_0x2521ab['p'],_0x17318e(0x748,0x1920,0x6d2,0xfcd)+_0x425890(0x14d,0x54b,-0x48,-0x16f)+'\x0aPaper📄\x0aSc'+_0x425890(0xd72,0x704,0xbcf,0xc43),_0x17aa6d);if(!_0x2521ab[_0x17318e(0x9f1,0xd38,0xc00,0xd1b)])_0x3797bd['sendText'](_0x2521ab['p2'],_0x425890(0x10cb,0xdb0,0xfb0,0x56e)+_0x425890(0x90d,0x5e0,0x5ca,0x21d)+_0x425890(0x1293,0x10a2,0xaae,0x197a)+_0x17318e(0xf6,0xd60,0x499,0x3c7),_0x17aa6d);_0x2521ab['waktu_mili'+'h']=setTimeout(()=>{function _0x41b331(_0x4c80d4,_0x11ad08,_0x6fa23,_0x131bbf){return _0x425890(_0x131bbf,_0x11ad08-0x1f4,_0x6fa23-0xf9,_0x131bbf-0x1ef);}function _0x5ee5e3(_0x475e4e,_0x5a06c1,_0x33f795,_0x278770){return _0x17318e(_0x475e4e-0x9a,_0x33f795,_0x33f795-0x9a,_0x5a06c1-0xb8);}if(_0x295ea5[_0x5ee5e3(0xf13,0x152d,0x17dd,0xb70)](_0x295ea5[_0x41b331(0xf8d,0x9c2,0x615,0x1345)],_0x41b331(0x32f,0x7ff,0x7a3,0x88)))_0xd329cd(_0x5ee5e3(0x1096,0xa76,0x4ee,0xe77)+_0x41b331(0x15ca,0x1802,0x10c4,0x15c9)+'hub.com/pr'+'abhasha200'+_0x41b331(0xeda,0x12ab,0xd17,0x1a94)+_0x41b331(0xfc3,0xfc3,0x7ab,0xd9a)+'orget\x20To\x20G'+_0x5ee5e3(0x1605,0xe33,0x17f5,0xefc)+_0x41b331(0x1997,0x14da,0xe1d,0x1d93)+_0x510858+(_0x41b331(0x154,0x4e7,-0x53b,0x2e7)+_0x41b331(0x1ee9,0x16e4,0x12f6,0x1686)+_0x5ee5e3(-0x38c,0x434,0x46b,-0x474)));else{if(!_0x2521ab[_0x41b331(0xeb1,0x9a3,0xc77,0x243)]&&!_0x2521ab[_0x5ee5e3(0x16be,0xdd3,0x50c,0x131c)])_0x3797bd['sendText'](_0x17aa6d['chat'],_0x5ee5e3(0xe6b,0x149e,0x1c23,0x13cb)+_0x41b331(0x1a28,0x1398,0x14c5,0xbc9)+_0x5ee5e3(0x84,0x6e1,0x7cb,0x24b)+_0x5ee5e3(0x1627,0x1140,0x1020,0xf19)+'nceled');else(!_0x2521ab[_0x41b331(0xff1,0x9a3,0xb65,0x95f)]||!_0x2521ab[_0x41b331(0x487,0xcf2,0x8c4,0x11f9)])&&(_0x559958=!_0x2521ab[_0x5ee5e3(0x1224,0xa84,0xb02,0x4fd)]?_0x2521ab['p2']:_0x2521ab['p'],_0x3797bd[_0x41b331(0xd11,0x77e,0x60,-0x199)+'thMentions'](_0x17aa6d['chat'],'@'+(_0x2521ab[_0x41b331(0x490,0x9a3,0xef8,-0x8c)]?_0x2521ab['p2']:_0x2521ab['p'])[_0x5ee5e3(0x141,0x5c0,0xecd,0x34d)]`@`[-0xe88*-0x1+0x175c+-0x979*0x4]+(_0x41b331(0x1086,0x151a,0x1c29,0xf57)+_0x41b331(0xe09,0x1010,0x874,0x737)+'\x20Game\x20Over'+'!'),_0x17aa6d));return delete this[_0x5ee5e3(0xb1a,0x612,0x8b2,-0x6e)][_0x2521ab['id']],!(0x895*0x2+-0x1c87+0xb5d);}},_0x2521ab['timeout']);}}let _0x3b710c=_0x295ea5[_0x425890(0x1536,0xbf5,0x10f1,0x13ea)](_0x17aa6d[_0x17318e(0x143e,0x13ba,0x9a8,0xc86)],_0x2521ab['p']),_0xec2fe3=_0x17aa6d[_0x425890(0xdb7,0xa69,0x51d,0x6a2)]==_0x2521ab['p2'],_0x43fd48=/scissors/i,_0x5d776a=/rock/i,_0x363375=/paper/i,_0x224e42=/^(scissors|rock|paper)/i;if(_0x3b710c&&_0x224e42[_0x17318e(0x1848,0xec2,0x18fc,0xfa3)](_0x17aa6d[_0x425890(0xa3d,0x1e8,-0x797,-0x196)])&&!_0x2521ab['pilih']&&!_0x17aa6d['isGroup']){if(_0x295ea5[_0x17318e(0xd93,0x251,0x105f,0x5e6)](_0x295ea5[_0x425890(0x1158,0x1628,0xd95,0x174d)],_0x295ea5[_0x17318e(0xf69,0x854,0x1524,0x10f7)])){_0x2521ab[_0x425890(0x8fa,0x7af,-0x1d1,0x143)]=_0x224e42['exec'](_0x17aa6d[_0x17318e(-0x224,0x1eb,-0x3ba,0x405)]['toLowerCas'+'e']())[0x207b+-0x1849*0x1+-0x832],_0x2521ab[_0x425890(0xad8,0x1e8,0x21c,-0x31b)]=_0x17aa6d['text'],_0x295ea5[_0x17318e(0x423,0x1da,0x8ab,0x534)](_0xcd1d32,_0x425890(0x653,0xfbb,0xdf1,0x1707)+_0x17318e(0x200f,0x1f1a,0x14a5,0x178b)+_0x17aa6d[_0x17318e(0xa8c,0x4ba,0x1d4,0x405)]+'\x20'+(!_0x2521ab['pilih2']?'\x0a\x0aWaiting\x20'+_0x425890(0x4a3,0x9aa,0x572,0xeae)+_0x425890(0x10e5,0xa07,0x1d2,0x2ae)+'Choose':''));if(!_0x2521ab[_0x425890(0xbbd,0xafe,0x122f,0xa58)])_0x3797bd['sendText'](_0x2521ab['p2'],_0x295ea5[_0x425890(0x15bd,0xeb6,0xab7,0x1094)],0x43*-0x25+0x434*0x2+0x147);}else{if(_0x295ea5['VApfB'](_0x10162d['chatbotpre'],_0x295ea5[_0x425890(0x687,0xcca,0xff1,0x4a9)]))return;if(_0x295ea5[_0x425890(-0x280,0x380,0x175,0xcbd)](_0x4cbb92[_0x17318e(0x1293,0x13bc,0xd7,0xaf8)],_0x17318e(0x12b2,0x1fbf,0x22cf,0x184b))){const _0x5c4729={};_0x5c4729['text']=_0x425890(0xb5,0x33a,0x2ff,0x259)+_0x425890(-0x8e6,0x108,-0x6fb,-0x928)+_0x17318e(0x1c57,0x135d,0x1690,0x15a6);const _0x342c16={};_0x342c16[_0x425890(0x408,0x807,0xe41,0x1c)]=_0x3f54a6,_0x2e593a['sendMessag'+'e'](_0x38979b,_0x5c4729,_0x342c16);}}}if(_0xec2fe3&&_0x224e42[_0x17318e(0x152d,0x1466,0x15d7,0xfa3)](_0x17aa6d[_0x17318e(0x6a8,0x5a6,0x64f,0x405)])&&!_0x2521ab[_0x17318e(0x6a3,0x110a,0x1303,0xd1b)]&&!_0x17aa6d[_0x425890(-0xc4,0x315,0x8c2,-0x474)]){_0x2521ab[_0x17318e(0x162c,0x453,0xe3c,0xd1b)]=_0x224e42[_0x17318e(0xd6e,0x98b,0x155,0xbd6)](_0x17aa6d[_0x17318e(-0x177,-0x309,0xd05,0x405)][_0x17318e(0x3e9,0xaa8,0xf2d,0xd56)+'e']())[-0xbd9+0x1d11*0x1+-0x3a*0x4c],_0x2521ab[_0x17318e(0x6cd,0x548,0x1349,0xbe8)]=_0x17aa6d[_0x425890(0x37a,0x1e8,0x561,0x3fc)],_0xcd1d32('You\x20Have\x20C'+'hosen\x20'+_0x17aa6d[_0x425890(0x434,0x1e8,0x4fe,0x26d)]+'\x20'+(!_0x2521ab[_0x425890(0xdc0,0x7af,0xed3,0x3f5)]?'\x0a\x0aWaiting\x20'+_0x425890(0x43c,0x9aa,-0xb5,0x7f0)+'ponent\x20To\x20'+_0x17318e(0x1304,0x1bff,0x88e,0x12e0):''));if(!_0x2521ab[_0x17318e(0x773,0x998,0x611,0x9cc)])_0x3797bd[_0x425890(0x136b,0x12b2,0x1c96,0xa8f)](_0x2521ab['p'],_0x295ea5[_0x17318e(0x163e,0xeaf,0xc6c,0x10d3)],0xb8+-0x1*0x1d23+0x1c6b);}let _0x192e51=_0x2521ab['pilih'],_0x20739a=_0x2521ab[_0x17318e(0x132c,0xee0,0x112d,0xd1b)];if(_0x2521ab[_0x17318e(0x225,0xdc8,0x1300,0x9cc)]&&_0x2521ab[_0x17318e(0x6e2,0x66f,0x17bb,0xd1b)]){clearTimeout(_0x2521ab[_0x17318e(0x18f3,0x19f2,0x1c3d,0x1802)+'h']);if(_0x5d776a[_0x17318e(0x1671,0x1983,0x1783,0xfa3)](_0x192e51)&&_0x43fd48[_0x17318e(0xc5c,0x10c7,0xe05,0xfa3)](_0x20739a))_0x559958=_0x2521ab['p'];else{if(_0x5d776a[_0x17318e(0x71f,0x1729,0x1637,0xfa3)](_0x192e51)&&_0x363375['test'](_0x20739a))_0x559958=_0x2521ab['p2'];else{if(_0x43fd48['test'](_0x192e51)&&_0x363375['test'](_0x20739a))_0x559958=_0x2521ab['p'];else{if(_0x43fd48['test'](_0x192e51)&&_0x5d776a[_0x425890(0x1108,0xd86,0x13c1,0x1815)](_0x20739a))_0x559958=_0x2521ab['p2'];else{if(_0x363375['test'](_0x192e51)&&_0x5d776a['test'](_0x20739a))_0x559958=_0x2521ab['p'];else{if(_0x363375[_0x17318e(0x1a22,0x1196,0x12fc,0xfa3)](_0x192e51)&&_0x43fd48[_0x425890(0x5e0,0xd86,0x1155,0xa54)](_0x20739a))_0x559958=_0x2521ab['p2'];else{if(_0x295ea5[_0x425890(0x1171,0x8b0,-0x183,0xaee)](_0x192e51,_0x20739a))_0x1fe91c=!![];}}}}}}_0x3797bd[_0x425890(0x1b01,0x12b2,0x161d,0x13d5)](_0x2521ab[_0x425890(0xa53,0xf0a,0x17cb,0x692)],('_*Suit\x20Res'+_0x425890(0xcc7,0xed1,0xc00,0x1551)+(_0x1fe91c?_0x295ea5['cvRLU']:'')+'\x0a\x0a@'+_0x2521ab['p'][_0x425890(-0x5d9,0x2eb,-0x77f,0x6ea)]`@`[0x6*-0x59+-0x151*-0xb+-0xc65]+'\x20('+_0x2521ab[_0x425890(-0x72c,0x1e8,-0x375,0x7a8)]+')\x20'+(_0x1fe91c?'':_0x2521ab['p']==_0x559958?'\x20Win\x20\x0a':'\x20Lost\x20\x0a')+'\x0a@'+_0x2521ab['p2'][_0x425890(-0x5ba,0x2eb,-0x378,-0x59f)]`@`[0x141f+0x1b25+-0x2f44]+'\x20('+_0x2521ab['text2']+')\x20'+(_0x1fe91c?'':_0x295ea5[_0x425890(0x13b2,0xbf5,0x1211,0x1266)](_0x2521ab['p2'],_0x559958)?_0x17318e(0x1154,0x86d,0xc34,0xc07):_0x425890(0x55e,0x4ea,0x735,-0x1a0))+'\x0a')[_0x425890(-0x1b1,0x54c,0xabd,-0x535)](),_0x17aa6d,{'mentions':[_0x2521ab['p'],_0x2521ab['p2']]}),delete this[_0x425890(0x82c,0x33d,0x790,0x73a)][_0x2521ab['id']];}}let _0x39a100=[...new Set([..._0x17aa6d[_0x17318e(0x17a6,0xf08,0xfff,0xe22)+'id']||[],..._0x17aa6d[_0x17318e(0xc51,0x7d6,0x7bc,0xa24)]?[_0x17aa6d[_0x425890(0x660,0x807,0x209,-0x25e)][_0x425890(0x63e,0xa69,0xa1d,0xd02)]]:[]])];for(let _0x4b5f9c of _0x39a100){if(_0x295ea5[_0x425890(0x143d,0x1058,0x1179,0x10de)](_0x295ea5[_0x425890(0x9c5,0x403,0x102,-0x2ed)],'QhcWh')){if(_0x295ea5[_0x17318e(0x1480,0xfe7,0x103a,0x155c)](_0x40e725[_0x425890(0x118d,0x8db,0x10f4,0xf0a)],_0x425890(0x1cbf,0x12af,0xa85,0x1a71)))return;if(_0x2ecdb2[_0x17318e(0x10b3,0x6e,0xc6,0xaf8)]===_0x295ea5[_0x425890(0x1713,0x14db,0x15ad,0xf3c)]){const _0x28faa9={};_0x28faa9[_0x17318e(0xaf0,0xa2f,-0xbe,0x405)]=_0x425890(0x1462,0x13c6,0x1291,0x1147)+'...😂👍*';const _0x1bb4d9={};_0x1bb4d9[_0x425890(-0x12c,0x807,0xd7f,0x361)]=_0x414c41,_0x1c0d88[_0x17318e(0xcd4,0x71,0xf98,0x63c)+'e'](_0xc04525,_0x28faa9,_0x1bb4d9);}}else{let _0x4cd4a8=global['db'][_0x17318e(0x3b4,0x80e,0xfcf,0xced)]['users'][_0x4b5f9c];if(!_0x4cd4a8)continue;let _0x38168d=_0x4cd4a8['afkTime'];if(!_0x38168d||_0x295ea5[_0x17318e(0xcf1,0x528,0x7e3,0xb3b)](_0x38168d,0x292*0x9+-0x788*0x1+-0xf9a))continue;let _0x6d964c=_0x4cd4a8[_0x425890(0x442,0xc4e,0x14e7,0x1126)]||'';_0x295ea5[_0x17318e(0x1171,0x12cd,0xdcc,0x181c)](_0xcd1d32,(_0x17318e(0x541,0xaa6,0xf58,0xe04)+_0x17318e(0x771,0xf3,-0x348,0x70f)+_0x17318e(-0x2f2,0x4fc,0xedb,0x5f1)+_0x425890(0x1341,0x1397,0xdaa,0x1d5f)+(_0x6d964c?_0x425890(0x1136,0xf54,0xc71,0x1522)+_0x425890(0xe2f,0x81f,-0x45,0xb0c)+_0x6d964c:_0x295ea5[_0x17318e(0x518,0xda9,0x911,0xb80)])+(_0x17318e(0x13e8,0x1401,0x189f,0x133a)+'\x20')+clockString(_0x295ea5[_0x425890(0x58b,0x1fa,-0x2b7,0x59c)](new Date(),_0x38168d))+'\x0a')[_0x17318e(0x6e5,0x11bb,0xb1b,0x769)]());}}if(db[_0x425890(0x12c0,0xad0,0x11ba,0x4a1)][_0x17318e(0xdf2,0x1388,0x19e6,0xf73)][_0x17aa6d[_0x425890(0x1007,0xa69,0x1c6,0xce9)]]['afkTime']>-(-0x251*-0x1+0x3d0+-0x8*0xc4)){let _0x2facf2=global['db']['data']['users'][_0x17aa6d['sender']];_0x295ea5[_0x425890(0x39a,0xa35,0x823,0xebd)](_0xcd1d32,('\x0aYou\x20Came\x20'+_0x17318e(0x21a,0xf7f,0x304,0x97f)+_0x17318e(0x587,0x46e,0x883,0xa5e)+(_0x2facf2[_0x425890(0x15f6,0xc4e,0x1083,0xaea)]?_0x295ea5[_0x17318e(0x60f,0x1152,0x981,0x74d)](_0x295ea5['WfMvz'],_0x2facf2[_0x17318e(0x188e,0x51e,0x1553,0xe6b)]):'')+_0x425890(0x2ce,0x9b6,0xa97,0xc54)+clockString(_0x295ea5[_0x425890(0xd0a,0x7ac,0x13e,0x8a6)](new Date(),_0x2facf2[_0x17318e(0x2a5,0xb85,0xb04,0x3a4)]))+'\x0a')['trim']()),_0x2facf2[_0x17318e(-0xc2,-0x486,0xde2,0x3a4)]=-(-0x515*-0x6+-0xb0e+-0x136f),_0x2facf2[_0x17318e(0x401,0x1175,0x6b1,0xe6b)]='';}switch(_0x1cbc75){case _0x295ea5['PahYI']:case'inventory':case _0x295ea5[_0x17318e(0x2e2,0x5b7,0xc36,0xcc3)]:{if(q[_0x425890(-0x1c6,0x291,0xb10,-0x494)](_0x295ea5[_0x17318e(0x336,0x849,0x5d2,0x9cf)]))return _0xcd1d32(examkosong);!isDarah&&_0x295ea5[_0x425890(0xc53,0xb12,0x7c9,0x1564)](addInventoriDarah,_0x17aa6d[_0x425890(0x11ab,0xa69,0x13f0,0x641)],DarahAwal);if(!isInventory){if('YDFIy'===_0x295ea5[_0x17318e(0x8ca,0xbd7,0xc7c,0xc5c)]){const _0x2f7540=_0x295ea5[_0x17318e(0xed5,0x122d,0x1690,0x1515)][_0x425890(0x5fd,0x2eb,-0x738,0xc1a)]('|');let _0x3de27a=-0x309*-0xc+-0x1f00+-0x56c*0x1;while(!![]){switch(_0x2f7540[_0x3de27a++]){case'0':_0x57d396['asal']=_0xd1ce19['chat'];continue;case'1':if(!_0x452dc2['pilih2'])_0x2a836f['sendText'](_0x3f2afa['p2'],_0x425890(0x379,0xdb0,0x12ce,0xb62)+'ect\x20\x0a\x0aRock'+_0x17318e(0x1c8c,0xa8f,0x1913,0x12bf)+_0x425890(-0x1f4,0x1aa,0x54d,0x3c3),_0x29f491);continue;case'2':if(/^(reject|no|later|n|nope(k.)?yes)/i[_0x17318e(0x10be,0x1253,0x684,0xfa3)](_0xcf08d6['text']))return _0x15692a['sendTextWi'+'thMentions'](_0x3a9977[_0x425890(0x928,0xcc7,0xdbb,0x4bd)],'@'+_0x80f99a['p2'][_0x425890(0x68e,0x2eb,0x239,0xd)]`@`[-0x1c35*0x1+0x107f+0xbb6]+(_0x425890(0x1a16,0x13ae,0x1c27,0x1927)+_0x425890(0x1924,0x109d,0x1537,0x11df)+'anceled'),_0x36fa07),delete this[_0x425890(0x8c,0x33d,-0xca,-0x6e3)][_0x115c18['id']],!(0x24a2+-0x7c7+-0x1cdb);continue;case'3':const _0x4c75cd={};_0x4c75cd[_0x425890(0x1037,0xe05,0x17d7,0x178c)]=[_0x2bcc86['p'],_0x51b409['p2']],_0x4819db[_0x17318e(0xe40,0x1a8b,0xd9f,0x14cf)](_0x10c6a6['chat'],_0x425890(0xe79,0xe86,0x1594,0xc4f)+_0x425890(0xd5f,0x2ef,0xc4a,0x24f)+'o\x20Chat\x0a\x0a@'+_0x533417['p'][_0x425890(-0x55d,0x2eb,0x644,0x49e)]`@`[0x96b+-0x5*0x20b+0x1*0xcc]+_0x17318e(-0x15f,0xf49,0x7ef,0x76c)+_0x5ecb88['p2']['split']`@`[-0x34*0xb1+-0x1b71+0x3f65*0x1]+(_0x425890(-0x97,0x9d4,0x10e3,0x74c)+_0x17318e(0x1506,0x7a3,0x1524,0xb6e)+_0x17318e(0x1828,0xf2a,0x11fd,0x17d8)+_0x425890(0x52d,0xb82,0x1213,0x1304)+_0x425890(0xc2,0x1e0,0xae7,0x9e3)+_0x425890(0x90a,0x7d7,0x1135,0xe25)+_0x425890(-0x186,0x46b,0xc5b,0x8d2))+_0x4aa873[_0x17318e(0x916,-0x56c,0xa56,0x508)]`@`[-0x1*-0x1ea1+-0x24a7+0x606],_0x356742,_0x4c75cd);continue;case'4':_0x2845eb[_0x425890(0x80c,0x1098,0x1663,0xbde)]=_0x295ea5[_0x17318e(0x1c62,0xe8e,0x199d,0x172c)];continue;case'5':_0x387576['waktu_mili'+'h']=_0x295ea5[_0x17318e(-0x25a,0xe5f,-0xe8,0x5ee)](_0x29d732,()=>{function _0x3a3e4e(_0x11b93a,_0x173756,_0x1e53f5,_0x1bf6ca){return _0x425890(_0x173756,_0x1bf6ca-0xd2,_0x1e53f5-0x96,_0x1bf6ca-0x1e0);}function _0x5559dc(_0x5491d1,_0x4d7045,_0x1cf804,_0x10039d){return _0x425890(_0x1cf804,_0x5491d1-0x31c,_0x1cf804-0x7f,_0x10039d-0x181);}if(!_0xdd4e23['pilih']&&!_0x17169a[_0x5559dc(0xe1a,0xded,0x14b8,0xbf8)])_0x592006['sendText'](_0x7efc74[_0x3a3e4e(0x13e0,0x12b9,0x102f,0xd99)],'Both\x20Playe'+_0x5559dc(0x14c0,0x12b4,0x1ba9,0x10ab)+_0x5559dc(0x728,0xe54,0x40d,0x332)+_0x3a3e4e(0x628,0x826,0x6cb,0xf3d)+_0x5559dc(0xb1c,0x12fa,0xa4d,0x986));else(!_0x2e3be3[_0x5559dc(0xacb,0x759,0xe48,0x12b5)]||!_0x21e7a3[_0x5559dc(0xe1a,0x1418,0x6cb,0x4ac)])&&(_0x5aa1ec=!_0x5cf9d7['pilih']?_0x352c4b['p2']:_0x1dc0f9['p'],_0x16a7b7[_0x3a3e4e(-0x3dc,0x3c2,0xad1,0x65c)+_0x5559dc(0x12b4,0xace,0x1cb0,0x9bb)](_0x3036be[_0x3a3e4e(0xbba,0x131a,0x138c,0xd99)],'@'+(_0x23d1d9['pilih']?_0x1b31f1['p2']:_0x415860['p'])['split']`@`[-0x13a4+-0x38*-0x35+-0x5*-0x19c]+(_0x3a3e4e(0x1279,0x19b7,0xd39,0x13f8)+_0x5559dc(0x1138,0x10fa,0xb6e,0x16da)+_0x5559dc(0x7c0,-0x225,0xac2,0xc1a)+'!'),_0x106dad));return delete this['suit'][_0x3d5eff['id']],!(0xa3*0x3d+0x609+0x2ce0*-0x1);},_0x543116['timeout']);continue;case'6':_0x5d7807(_0xffe9ac[_0x425890(0x2a7,0x907,0xd1a,0xedc)]);continue;case'7':if(!_0x468035[_0x17318e(0xcc5,0xdc8,0x1168,0x9cc)])_0x452f28[_0x17318e(0x163c,0x142b,0x1c41,0x14cf)](_0x251324['p'],_0x425890(0x1177,0xdb0,0x6b3,0x1144)+_0x425890(0x75f,0x54b,0xdd4,0xee)+_0x17318e(0x16b0,0x1757,0x2f7,0xd51)+_0x425890(0x3da,0x704,0x8fd,0x6e7),_0x27e290);continue;}break;}}else addInventori(_0x17aa6d[_0x17318e(0x881,0x543,0xbcc,0xc86)]);}if(!isInventoriBuruan){if(_0x295ea5[_0x425890(0x1c6a,0x145f,0xb07,0xef5)](_0x17318e(0xecd,0x5e,-0x48,0x901),_0x295ea5[_0x425890(0x1a9d,0x1191,0x1bb9,0x88a)]))addInventoriBuruan(_0x17aa6d['sender']);else{const _0x48ead8=_0x269538[_0x425890(0x731,0x7f3,0x2fa,0xbe3)](_0x3af35b,arguments);return _0x2b0f11=null,_0x48ead8;}}var _0x3797bd=await _0x295ea5[_0x17318e(0x72d,0x62,0x39f,0x881)](getBuffer,_0x295ea5['olBaJ'](_0x58a5bf,_0x425890(0x15de,0x1194,0xe22,0x82f)+_0x17318e(0x383,0x79f,0x4c5,0x7f3)));let _0xc561bf='_[\x20👩🏻‍💼INFO\x20U'+_0x17318e(0x5c5,0x5d,0x412,0x938);_0xc561bf+='*❤️Your\x20Blo'+_0x425890(-0x6c6,0x328,0x8f9,0x911)+_0x295ea5[_0x17318e(0xba7,0xe03,0x1373,0xc52)](getDarah,_0x17aa6d['sender'])+'\x0a',_0xc561bf+='*◻️️Your\x20Ir'+_0x425890(0xea3,0x14c8,0x1bb2,0x12ec)+_0x295ea5[_0x17318e(0x1195,0xc34,0x1faa,0x1524)](getBesi,_0x17aa6d[_0x425890(0x538,0xa69,0xdde,0x12c3)])+'\x0a',_0xc561bf+=_0x17318e(0xdfa,0xaab,-0x10a,0x37b)+_0x17318e(0x1d43,0x1315,0x1aa6,0x12d0)+_0x295ea5['SiCLz'](getEmas,_0x17aa6d[_0x17318e(0x888,0x93d,0xdb9,0xc86)])+'\x0a',_0xc561bf+=_0x425890(0xbae,0x234,-0x411,-0x7c4)+_0x425890(0x1079,0x79b,0x9a6,0xc44)+_0x295ea5['OWzXf'](getEmerald,_0x17aa6d[_0x17318e(0x3f5,0xe72,0x1092,0xc86)])+'\x0a',_0xc561bf+=_0x425890(0x3ea,0x984,0x93f,0xfec)+_0x17318e(0xeb1,0x117d,0x18b3,0xe38)+getLimit(_0x17aa6d[_0x425890(0x1355,0xa69,0x112b,0xa27)])+'\x0a',_0xc561bf+=_0x17318e(0xb38,0x1292,0x1eb1,0x1581)+'ion*\x20:\x20'+_0x295ea5[_0x17318e(0x1195,0x2279,0x1593,0x1854)](getPotion,_0x17aa6d[_0x17318e(0x6a2,0x768,0x120f,0xc86)])+'\x0a\x0a',_0xc561bf+='_[\x20🐺HUNT\x20R'+_0x17318e(0x755,0x393,0x2c5,0x80e),_0xc561bf+=_0x17318e(0xf8f,0x13be,0x38c,0xb14)+_0x295ea5[_0x17318e(0x13de,0x1139,0x1009,0x10dd)](getIkan,_0x17aa6d[_0x17318e(0xca0,0x701,0x71c,0xc86)])+'\x0a',_0xc561bf+='*🐔Chicken*'+_0x17318e(0xb17,-0x45,0x2f3,0xa1c)+_0x295ea5[_0x425890(0xaff,0xf2d,0xd8a,0x17a0)](getAyam,_0x17aa6d[_0x425890(0xd23,0xa69,0xf7e,0x8e6)])+'\x0a',_0xc561bf+=_0x425890(0xe34,0xc57,0xcec,0x25a)+':\x20'+getKelinci(_0x17aa6d[_0x425890(0x25f,0xa69,0x323,0xa92)])+'\x0a',_0xc561bf+=_0x17318e(0x1708,0xf29,0xf24,0x11c7)+'\x20'+_0x295ea5[_0x425890(0xc1e,0x8b2,0xe29,0x994)](getDomba,_0x17aa6d[_0x17318e(0x66a,0x2d6,0x1227,0xc86)])+'\x0a',_0xc561bf+=_0x17318e(0xf08,0x1a20,0xe88,0x1540)+_0x295ea5[_0x17318e(0x13c6,0x118,0xda,0x9fe)](getSapi,_0x17aa6d[_0x425890(0xcac,0xa69,0x132a,0xdc1)])+'\x0a',_0xc561bf+=_0x425890(0x1d3,0x859,0x10ed,0x11bb)+_0x17318e(0x1aee,0x1516,0x1084,0x1260)+_0x295ea5[_0x425890(0x86b,0xa35,0xff,0xdbd)](getGajah,_0x17aa6d[_0x17318e(0x2fc,0x10ec,0x10df,0xc86)])+'\x0a\x0a',_0xc561bf+='_*'+_0x2cbadb+'*_';const _0x57d853={};_0x57d853['displayTex'+'t']=''+button,_0x57d853[_0x17318e(-0x23a,-0x1f5,0xb4e,0x810)]=''+btnurl;const _0x5b05e6={};_0x5b05e6[_0x425890(0x12d1,0xad6,0xd93,0x3d7)]=_0x57d853,await _0x3797bd['send5ButIm'+'g'](_0x146a84,_0x295ea5[_0x425890(0xac6,0x98d,0xc35,0x937)](_0x295ea5[_0x17318e(0x200a,0x1c49,0x17d9,0x1728)]('',''),_0xc561bf),'©\x20'+footer,_0x3797bd,[_0x5b05e6]);}break;case _0x295ea5[_0x425890(0xb7a,0xbee,0xb38,0x998)]:{let _0x2277b5=_0x17318e(0x6dd,-0x130,0x1fc,0x413)+_0x17318e(0xea6,0x399,0x30d,0x619)+'\x0a\x0a';for(let _0x57b11d of _limit){_0x2277b5+=_0x425890(0x141c,0xa1b,0xbae,0xe68)+_0x57b11d['id'][_0x17318e(0xb7b,0x80c,0x7ac,0x508)]('@')[0x17db+0x2660+0x3e3b*-0x1]+(_0x17318e(0xa3,0xc0c,0x87,0x6db)+_0x425890(0x85,0x7ff,0x1275,0xc))+_0x57b11d['limit']+'\x0a';}_0xcd1d32(_0x2277b5);}break;case _0x295ea5['aTgci']:{if(_0x295ea5[_0x425890(0xbbd,0x380,0x28b,0x8d0)](_0x295ea5['hvuJe'],_0x425890(-0x295,0x6ec,0xdfe,0x115f))){if(_0x295ea5[_0x425890(0x1815,0x143b,0x13be,0x1804)](_0x48c8f7[_0x425890(0xf15,0x8db,0x9a4,0xec3)],_0x295ea5[_0x425890(0x55c,0xcca,0x13ee,0x1097)]))return;if(_0x295ea5['VApfB'](_0x2789d8['chatbotpre'],_0x295ea5[_0x425890(0x16db,0x14db,0xda1,0xbbe)])){const _0x34c443={};_0x34c443[_0x425890(0x39c,0x1e8,-0x456,0x22f)]=_0x425890(-0x19f,0x489,0xa48,-0x244)+_0x425890(0x19db,0xfd4,0x155b,0xa5c)+_0x17318e(0x626,0x6d2,0xd4d,0xec1)+_0x17318e(0x17ae,0xff6,0x1135,0x164f)+_0x17318e(0xa66,0xc0e,0x3f2,0x6df)+'php?viewke'+_0x425890(0x1f9,0x1fd,0xb8f,0x978)+_0x425890(0x1578,0x13cf,0xf69,0x109d)+_0x425890(0x13b,0x891,0x5c5,0x46b)+_0x425890(0x125b,0x1368,0x102d,0x19d6)+_0x17318e(0xd64,0x15ba,0xcaf,0xe3e)+_0x425890(0xcf3,0x12cf,0x845,0x1533)+_0x17318e(0x12b1,0x696,0xe1a,0xd0c)+_0x17318e(0x19a5,0x1993,0x12cc,0x1609)+'\x0ahttps://w'+_0x425890(0x344,0x2a8,0x4a9,-0x107)+_0x17318e(-0x2f0,-0x155,0x8cd,0x76d)+_0x17318e(0x1501,0x1e7d,0x151c,0x1574)+'viewkey=ph'+_0x17318e(0x8ec,0xaf0,-0x24e,0x69c)+'e7c\x0ahttps:'+_0x17318e(0xe76,-0x213,0xb0e,0x448)+_0x17318e(0xdfa,0x1764,0xc4b,0x1302)+'ew_video.p'+_0x17318e(0xd3e,0x6b3,0x1296,0x103e)+_0x17318e(0x1013,0x1248,0x1d61,0x1567)+'e909d1';const _0x4572f8={};_0x4572f8[_0x425890(0x386,0x807,0xc55,0x2b2)]=_0x38bb27,_0x4f6291[_0x425890(-0x5b9,0x41f,-0x2f9,0xcbc)+'e'](_0x3aed4a,_0x34c443,_0x4572f8);}}else{let _0x24dfd8=_0x425890(0x1108,0xb8f,0x2ab,0xcb8)+_0x17318e(-0x239,0xa1f,0xbe8,0x655);for(let _0x1aeff8 of _buruan){const _0x213981=_0x295ea5[_0x17318e(0x12db,0x198e,0xfaa,0x1642)]['split']('|');let _0x558643=-0x1d13*-0x1+0xd79*0x1+-0x2a8c;while(!![]){switch(_0x213981[_0x558643++]){case'0':_0x24dfd8+=_0x17318e(0xdfb,0x62f,0x187c,0xe74)+':\x20'+_0x1aeff8[_0x425890(0x23a,0xcd6,0xa28,0x1112)]+'\x0a';continue;case'1':_0x24dfd8+='*🐔Chicken*'+_0x17318e(0x2e7,0xaee,0x626,0xa1c)+_0x1aeff8[_0x17318e(0x8cb,0xc3b,0xa99,0x102a)]+'\x0a';continue;case'2':_0x24dfd8+=_0x17318e(0xaaa,0xe16,0x93b,0xa76)+_0x17318e(0x1b1b,0x965,0x161a,0x1260)+_0x1aeff8['gajah']+'\x0a\x0a';continue;case'3':_0x24dfd8+=_0x425890(0x1385,0xfaa,0x5c0,0x197d)+'\x20'+_0x1aeff8[_0x17318e(0x48f,0xa83,0xc09,0x67f)]+'\x0a';continue;case'4':_0x24dfd8+='*🐟Fish*\x20:\x20'+_0x1aeff8[_0x425890(0xf45,0xe77,0xcb3,0x17db)]+'\x0a';continue;case'5':_0x24dfd8+=_0x425890(0x1197,0x85d,0xef4,0x535)+_0x1aeff8['id']+'\x0a';continue;case'6':_0x24dfd8+=_0x425890(0x1999,0x1323,0xa4c,0xee1)+_0x1aeff8[_0x425890(-0x2b4,0x4d8,-0x45b,0x535)]+'\x0a';continue;}break;}}_0xcd1d32(_0x24dfd8);}}break;case _0x425890(0x267,0x72a,0xe,0x106a):case _0x295ea5[_0x425890(0xdf6,0x1211,0x1862,0xdc5)]:{if(q['includes'](_0x295ea5[_0x17318e(0x774,0x97c,0xdda,0x9cf)]))return _0x295ea5['FkcgB'](_0xcd1d32,examkosong);!isInventory&&_0x295ea5[_0x425890(-0x1a8,0x190,-0x7cd,-0x1fd)](addInventori,_0x17aa6d[_0x17318e(0x870,0xcc6,0x1e6,0xc86)]);if(_0x295ea5[_0x425890(0x78a,0xe8a,0x640,0x98b)](isCekDarah,0x7*0x510+0x1cc1+-0x34*0x13c))return _0xcd1d32('You\x27re\x20Tir'+_0x425890(0x463,0x3f7,0x5d4,0xd58)+_0x17318e(0x945,0x1405,0x14b4,0xed4)+_0x425890(0xdb3,0x111a,0xbed,0x1a34));let _0x43e97c=[-0xd6*0x1f+0x1*-0x395+0x3b0*0x8,-0x7b+0x2264+-0x21e7,-0xb9*0x13+-0x1b9a+-0x86*-0x4f,-0x1828*-0x1+-0x7d*-0x4d+-0x3dc1,0x2438+0x23bc*0x1+-0x47f1,0x713*0x1+-0xf5f+0x84c,0x1424*-0x1+0x1*-0xa2a+-0x1e4f*-0x1,-0x4f*0x1a+0x1e2+-0x79*-0xd,-0x15da*0x1+0x122*-0x1+0x1700,0x1d*0x34+0x965+-0xa3*0x18,0x68e*0x5+-0x2*0xbf+-0x1*0x1f43,0xa3e+0xc*0x168+-0x1*0x1b1e,0x116*0x22+0x1d35*0x1+0x51*-0xd1],_0x28fdb4=[0x1*0x1251+0x25*0x4+0x1*-0x12e5,-0x6ab+0x12*-0xc+-0x784*-0x1,-0x2a*0xae+-0xde*-0x7+0x167c,-0x899+0x675+0x227,0x112c+-0x2a1*-0x9+-0x1*0x28d5,-0x1195+-0x9c*-0x14+0x565,0x1*-0x1e88+-0xb09*0x3+0x3fa3,-0x16e2+0xbf8+-0xd*-0xd7,-0x734+-0x2b8+-0x21*-0x4d,-0x5bb+0x1d9c+-0x17e1,0x3b*0x1a+0xdbc*0x1+-0x13ba,0x20*0x107+-0x8f9+-0x17e5],_0x734a5e=[0x59d+-0xf23+0x986,-0xd99*-0x1+-0x806+-0x593*0x1,-0x888+-0x7fd+0x1086,-0x223*0x2+-0x9a7+0x2c9*0x5,-0x1f24+0x392*0x5+0xd4a,0x238a+-0x14a7*-0x1+0x3a*-0xf8,0x99c+0x163a+0x19*-0x146,-0x2232+0x1d*0x29+0x1d8f,0x5ea*0x4+-0xa98*-0x3+0x269*-0x17,-0xa0f+0xf28+-0x519,-0x2ee+0xe2f*-0x1+-0xd*-0x151,0x1*-0x2203+0x1*-0xc1e+0x2e22];var _0x4daa39=_0x43e97c[Math[_0x17318e(0x1691,0xfa7,0x11ec,0x1632)](_0x295ea5[_0x425890(0x2b6,0x657,-0xfb,-0x39b)](Math[_0x17318e(0x86e,0x14e5,0xf5,0xb4b)](),_0x43e97c['length']))],_0x19b24c=_0x28fdb4[Math['floor'](Math[_0x425890(0x46,0x92e,0x44a,0x57f)]()*_0x28fdb4[_0x17318e(0xfa,0x74e,0x1398,0xad9)])],_0x2a3101=_0x734a5e[Math[_0x17318e(0xdcc,0x196b,0x159a,0x1632)](_0x295ea5['XykQB'](Math[_0x425890(0xa7d,0x92e,0xca2,0x99e)](),_0x734a5e['length']))];_0x295ea5[_0x425890(0x14ff,0x11c6,0x16ff,0xde8)](setTimeout,()=>{let _0x3f4616=_0x58002(0x1469,0xb74,0xea5,0x180a)+'ESULT\x20]\x0a*I'+_0x58002(0xb7f,0x10a4,0xbb3,0x640)+_0x4daa39+_0x231c48(0x102a,0x18e3,0x1513,0x719)+_0x19b24c+(_0x58002(0xc81,0xa8f,0x586,0xb04)+'\x20:\x20')+_0x2a3101,_0x4b30d3=[{'buttonId':''+_0x295ea5[_0x231c48(0xa1d,0x754,0xd36,0x51b)](_0x4fea53,_0x1cbc75),'buttonText':{'displayText':_0x295ea5[_0x231c48(0xf31,0x18a8,0x837,0x583)]},'type':0x1}];const _0x218773={};_0x218773[_0x58002(0x5d3,0x1020,0x4f5,0x249)]=_0x295ea5[_0x231c48(0x4f5,-0x13c,-0xb1,-0x353)];const _0x4671ed={};_0x4671ed[_0x231c48(0x45e,0x6,0xd67,0x2c8)]=_0x218773;function _0x58002(_0x3577aa,_0x2e7265,_0xb95a37,_0x4a8ecb){return _0x17318e(_0x3577aa-0xd4,_0x4a8ecb,_0xb95a37-0xef,_0x3577aa- -0x23d);}_0x4671ed['caption']=_0x3f4616,_0x4671ed['footer']=_0x2cbadb,_0x4671ed[_0x58002(0xf41,0xc26,0x870,0x1372)]=_0x4b30d3,_0x4671ed[_0x58002(0xfcf,0x8e6,0xcd6,0x15f8)]=0x4;let _0x32c4ad=_0x4671ed;function _0x231c48(_0x232d13,_0x21d6e8,_0x197fd6,_0x1b179b){return _0x425890(_0x21d6e8,_0x232d13-0xdd,_0x197fd6-0x134,_0x1b179b-0x15f);}const _0x4e890d={};_0x4e890d['quoted']=_0x17aa6d,_0x3797bd[_0x58002(0x3ff,0xca6,0x8ce,-0x187)+'e'](_0x146a84,_0x32c4ad,_0x4e890d);},0x1d5+-0x260b+0x3f8e),_0x295ea5[_0x425890(0x10b8,0xb49,0x4ad,0x8e5)](setTimeout,()=>{function _0x20613d(_0x2e03dd,_0x4e0a0b,_0x53609d,_0x47f68a){return _0x17318e(_0x2e03dd-0x1d3,_0x53609d,_0x53609d-0x163,_0x47f68a- -0x696);}function _0x4e48db(_0x5a0333,_0x381c2f,_0xe76478,_0x1cba7a){return _0x17318e(_0x5a0333-0x27,_0x381c2f,_0xe76478-0xc3,_0x5a0333- -0x468);}_0x295ea5[_0x20613d(0x31b,0xa3,-0x32c,0x5bc)](_0xcd1d32,'@'+_0x17aa6d['sender'][_0x4e48db(0xa0,0x2bf,0xec,-0x883)]('@')[0x190d+0x1*0x2186+-0x3a93]+('\x20Started\x20M'+'ining🎣'));},0x1*0x230b+0x1691+-0x33c0),_0x295ea5[_0x425890(0x872,0x4fa,0x9ee,0x6cd)](kurangDarah,_0x17aa6d[_0x17318e(0x1324,0x10b8,0x146c,0xc86)],0x7ff*0x1+0x1*-0x1fc1+0x17cc),_0x295ea5[_0x425890(0x1748,0x15ca,0x1d9f,0x1c61)](addBesi,_0x17aa6d[_0x425890(0x14e0,0xa69,0x145c,0x778)],_0x4daa39),_0x295ea5['amITp'](addEmas,_0x17aa6d['sended'],_0x19b24c),addEmerald(_0x17aa6d[_0x425890(0xc4f,0xa69,0x1030,0xf00)],_0x2a3101);}break;case _0x295ea5[_0x17318e(0x668,0x657,0x1099,0xca4)]:case'buy':{if(q['includes'](_0x295ea5[_0x17318e(0xf97,0xc55,0xa36,0x9cf)]))return _0x295ea5[_0x425890(0x1bfb,0x1339,0x8e0,0x1807)](_0xcd1d32,examkosong);!isInventoriBuruan&&(_0x295ea5['oauoG'](_0x17318e(0x14c7,0x90c,0xc57,0xbd5),_0x425890(0xe9f,0xd4b,0x8a5,0x147d))?addInventoriBuruan(_0x17aa6d[_0x425890(0xcda,0xa69,0xc16,0x3eb)]):(_0x58d9d4=_0x295ea5[_0x17318e(0xaf8,0x3c7,0x4ad,0xc20)],_0x295ea5[_0x17318e(0x778,0xaa6,0x561,0x93f)](_0x96c0c8,_0x295ea5['ifFMd'](_0x295ea5[_0x425890(0x14b4,0xa6f,0x1443,0x14f6)],_0x54acd9))));if(!isInventoryMonay){if(_0x295ea5['nFVPB']!==_0x295ea5[_0x17318e(0x53a,0x173,0xf71,0x7a3)]){const _0x447474={};_0x447474[_0x425890(0x9cc,0x10a0,0xf2b,0x1133)+'t']='⫷\x20ALL\x20MENU'+'\x20⫸';const _0x2a3ff7={};_0x2a3ff7['buttonId']=_0x3bff84+_0x17318e(0x7a9,0x188,0x28b,0x51c),_0x2a3ff7[_0x17318e(0x1a17,0x111f,0x1979,0x1318)]=_0x447474,_0x2a3ff7['type']=0x1;const _0x268e8e={};_0x268e8e[_0x17318e(0xb04,0x19d3,0x1138,0x12bd)+'t']=_0x295ea5['spClB'];const _0x34a63f={};_0x34a63f[_0x17318e(0xbcf,0x10e0,0x9d6,0x1194)]=_0x51f527+_0x17318e(0x116e,0xdd1,0xb04,0xc66),_0x34a63f['buttonText']=_0x268e8e,_0x34a63f[_0x17318e(0xf06,0x2052,0x140c,0x1638)]=0x1;const _0x177048={};_0x177048[_0x17318e(0x9ab,0x16c8,0x1202,0x12bd)+'t']=_0x17318e(0xc89,0x903,0xae1,0x82d);const _0x825cef={};_0x825cef[_0x425890(0x82d,0xf77,0x14a9,0x5f6)]=_0x40d151+'donate',_0x825cef['buttonText']=_0x177048,_0x825cef[_0x425890(0x195b,0x141b,0x17a5,0x141d)]=0x1;let _0xd8a98=[_0x2a3ff7,_0x34a63f,_0x825cef];const _0x321802={};_0x321802['url']=_0x31061d+_0x295ea5[_0x17318e(0x1bc0,0x15db,0x1793,0x165b)];const _0x5b3cb2={};_0x5b3cb2[_0x17318e(0xb09,0xce4,-0x88,0x59e)]=_0x321802,_0x5b3cb2[_0x17318e(0x1c6,0x62a,-0x325,0x527)]=_0x17318e(0x8cb,0x121,0xa50,0x835)+_0x384d1e+('\x20❮━━😎\x20\x0a┃╔═'+_0x17318e(0xf48,0x2c9,0x1290,0x88a)+_0x425890(0x1396,0x937,0x626,0x4f5)+_0x425890(0x32b,0x5d1,0x510,0xf94))+_0x9d7f22+'\x20'+_0x37c4ac+_0x425890(0x1337,0x13b6,0x1883,0x14d7)+_0x28f803+'\x20'+_0x1f44fe+_0x425890(0x18ab,0x111c,0x1537,0x1ad5)+_0x24b617+'\x20'+_0x542810+_0x17318e(0x1275,0xd7b,0x1d47,0x17fe)+_0x5cd581+'\x20'+_0x55bf95+'cry\x0a┃╠'+_0x35eb0c+'\x20'+_0x5b2e8c+_0x17318e(0x11a5,0x157e,0x11ad,0xb98)+_0x162954+'\x20'+_0x4863fd+_0x425890(0x1f75,0x15fc,0x1e0a,0x1f39)+_0x3ed2a5+'\x20'+_0x1950d7+_0x425890(0x3d1,0x3f4,-0x38b,0x9f7)+_0x5d0c84+'\x20'+_0x42fdd3+_0x17318e(0x253,-0x16f,0xa70,0x4b6)+_0x396a27+'\x20'+_0x16b780+_0x17318e(0x198e,0xc33,0xa7e,0x1020)+_0x31a03f+'\x20'+_0x5bc738+_0x17318e(0x15a2,0x1563,0x141d,0xcde)+_0x30e439+'\x20'+_0x545db3+_0x425890(0x9de,0x862,0x549,0x9f6)+_0x3242c8+'\x20'+_0x24c40c+_0x425890(0x686,0x644,0x652,0x9c3)+_0x2b47fe+'\x20'+_0xcd1a14+'blush\x0a┃╠'+_0xbcc9ac+'\x20'+_0xb650e+_0x17318e(0x1a14,0x1a12,0xfd3,0x16c9)+_0xba2ef7+'\x20'+_0x4a187f+_0x17318e(0xef2,0x10a4,0x775,0x843)+_0xfffa8d+'\x20'+_0x3d7d03+(_0x425890(-0x361,0x6eb,0xc5b,0x117)+'╠')+_0x16f124+'\x20'+_0x7e21fb+(_0x425890(-0x5fd,0x17d,-0x681,0x899)+'╠')+_0x1420e1+'\x20'+_0x40aaf6+'nom\x0a┃╠'+_0x50af13+'\x20'+_0x3a8d9e+_0x17318e(0x263,0x4d7,0xf6,0xa9c)+_0x1e11a3+'\x20'+_0x967f35+'bite\x0a┃╠'+_0x264eb8+'\x20'+_0x65e575+_0x425890(0x173b,0x106e,0xc8c,0x132b)+_0x465525+'\x20'+_0x4019c6+'kill\x0a┃╠'+_0x4984dc+'\x20'+_0x559e87+'happy\x0a┃╠'+_0x4413de+'\x20'+_0x5e5788+_0x425890(0x8bd,0xb05,0xbb,0x3c2)+_0x1d9d4e+'\x20'+_0x198d36+'poke\x0a┃╠'+_0x3f03da+'\x20'+_0x44bb94+_0x17318e(0xaf5,0xab7,0x1b84,0x14ac)+_0x3d2b53+'\x20'+_0x1dd823+(_0x17318e(0xbfd,0xc54,-0x1af,0x6a8)+'══════════'+'══☬\x0a┗━━❯\x20')+_0x3b64f4+_0x425890(0xabb,0x383,0xab,0x115),_0x5b3cb2['footer']=_0x1dcdee[_0x425890(0xa15,0x10be,0x15cd,0x15dc)][_0x425890(0x146e,0xe82,0x14ee,0x15eb)],_0x5b3cb2[_0x17318e(0x1839,0x15e6,0xc5a,0x117e)]=_0xd8a98,_0x5b3cb2[_0x17318e(0x7d5,0xb5f,0x119c,0x120c)]=0x4;let _0x216974=_0x5b3cb2;const _0x2232dd={};_0x2232dd[_0x425890(0x466,0x807,0xfb7,0x1195)]=_0x8f726a,_0x2f9024[_0x425890(-0x107,0x41f,-0x517,-0x3ae)+'e'](_0x5cf2f6[_0x425890(0xc97,0xcc7,0xdcb,0x542)],_0x216974,_0x2232dd);}else _0x295ea5[_0x17318e(0x13d1,0x196e,0x14ac,0xef1)](addInventoriMonay,_0x17aa6d[_0x425890(0x107b,0xa69,0x942,0xa76)]);}!isInventory&&_0x295ea5[_0x425890(0xb9e,0xee0,0x4e4,0x1528)](addInventori,_0x17aa6d[_0x17318e(0x1085,0xa0c,0x1474,0xc86)]);if(!q)return _0xcd1d32(_0x17318e(0x148a,0x124c,0xc0e,0xe76)+'u\x20Want\x20To\x20'+_0x17318e(0x1ae2,0xd0b,0x1606,0x178e)+'tion\x0a2.bai'+'tfood\x0a3.li'+'mit\x0a\x0aExamp'+'le:\x20'+(_0x4fea53+_0x1cbc75)+_0x425890(0x10e1,0xd5b,0x79e,0x624));var _0x54fa69=_0x52a010[-0x670*0x2+0x8bd*-0x4+0x2fd5];if(_0x295ea5['SOkFD'](_0x52a010[-0x1711+-0xfef*0x1+0x2700],_0x295ea5['HkLmA'])){let _0x653eab=_0x295ea5['KGhyM'](-0x28*0xc02+-0x2f5*-0x86+0x1dab2,_0x54fa69);if(!_0x52a010[0x546+0x2102+-0x2647])return _0x295ea5[_0x425890(0xafb,0x1227,0x1714,0xff7)](_0xcd1d32,_0x17318e(0x4e1,0xd1f,0x17a5,0xd25)+(_0x4fea53+_0x1cbc75)+(_0x425890(0x13d,0x366,0x3c8,0x6a)+_0x17318e(0x7e5,0x26a,0x125c,0x985)+'=\x20100000\x20M'+_0x17318e(0x30f,0x17af,0x995,0xd27)));if(_0x295ea5['cqFbY'](isMonay,_0x653eab))return _0x295ea5['sNDdF'](_0xcd1d32,_0x295ea5[_0x17318e(0xdc5,0xb76,0x1cec,0x14ca)]);_0x295ea5['SjKeR'](kurangMonay,_0x17aa6d[_0x425890(0x18a,0xa69,0x1419,0x983)],_0x653eab);var _0x1a2b4f=_0x54fa69*(0xa3*0x35+0x236c+-0x452a);_0x295ea5[_0x425890(0x1163,0x1123,0x685,0x1bbd)](addPotion,_0x17aa6d[_0x17318e(0x10ae,0xdfd,0x56d,0xc86)],_0x1a2b4f),setTimeout(()=>{function _0x3b58c0(_0x5bd447,_0x377f80,_0x5383a1,_0x1b8fe4){return _0x17318e(_0x5bd447-0x1f0,_0x5383a1,_0x5383a1-0x79,_0x377f80- -0x93);}function _0x271ecd(_0x2a9d2d,_0x54bb00,_0x392c9e,_0x446937){return _0x425890(_0x446937,_0x392c9e- -0x2ad,_0x392c9e-0x1a4,_0x446937-0xa9);}_0x295ea5[_0x271ecd(-0x187,0x81d,0x406,0xdbc)](_0xcd1d32,_0x271ecd(0xc1e,0x18aa,0x126b,0xce4)+_0x271ecd(0x466,0x315,0x877,0x14)+_0x271ecd(0x549,0x251,0x647,0x119)+_0x3b58c0(0xc2e,0x11de,0xcc3,0xf83)+_0x271ecd(0x165,0x1e0,0x9a6,0x1272)+getMonay(_0x17aa6d[_0x271ecd(-0x2b6,-0x2,0x7bc,0x971)])+(_0x3b58c0(0x925,0xaec,0x337,0x824)+_0x271ecd(-0x332,0xf44,0x741,-0x1bf))+_0x295ea5[_0x3b58c0(0x1415,0x166f,0x12be,0xdcc)](getPotion,_0x17aa6d['sender']));},-0x1*-0x1655+0x14a6+0x1*-0x232b);}else{if(_0x295ea5[_0x425890(0x537,0x362,0x5e8,-0x350)](_0x52a010[-0x1*0x42c+0x3*0x7dd+-0x136b],_0x17318e(0xb58,0xacb,0x7ef,0xdd5))){let _0x559217=(-0x2b4+-0xda*0x4+0x2*0xcd2)*_0x54fa69;if(!_0x52a010[0x69b*0x5+0x86c+0x5*-0x84a])return _0x295ea5[_0x425890(0xe95,0xf2d,0x1178,0x651)](_0xcd1d32,_0x17318e(0x1787,0x4db,0xdf0,0xd25)+(_0x4fea53+_0x1cbc75)+(_0x17318e(0x1add,0x10e1,0x1285,0x16ab)+_0x17318e(0xdcd,0x12d8,0x10e8,0x1582)+_0x425890(0x1716,0x1377,0x96e,0xd22)+_0x425890(0xd87,0x7ec,0xebe,0x6fa)));if(_0x295ea5[_0x17318e(0xa10,0xccd,0xa25,0xb3b)](isMonay,_0x559217))return _0x295ea5['Jvmxw'](_0xcd1d32,_0x295ea5['DPKnB']);kurangMonay(_0x17aa6d['sender'],_0x559217);var _0x1a2b4f=_0x54fa69*(-0x11*-0x19c+-0x1*-0x246b+-0x1542*0x3);_0x295ea5['rgWot'](addUmpan,_0x17aa6d[_0x17318e(0x163a,0x1390,0xd0f,0xc86)],_0x1a2b4f),_0x295ea5[_0x17318e(0x1175,0xe96,0x159f,0x13f0)](setTimeout,()=>{function _0x2e426b(_0x8d7b97,_0xc0b676,_0xc7c36,_0x51327b){return _0x17318e(_0x8d7b97-0x12d,_0x8d7b97,_0xc7c36-0xd4,_0xc0b676- -0xb1);}function _0x2b640d(_0x47e840,_0x47ec91,_0x5f5399,_0x14dba9){return _0x17318e(_0x47e840-0x149,_0x47e840,_0x5f5399-0x1c1,_0x5f5399- -0x606);}_0xcd1d32(_0x2b640d(0xd67,0x1413,0x112f,0xd92)+_0x2e426b(0xa22,0xc90,0xb84,0x65d)+_0x2b640d(0x7d6,0x309,0x50b,0xf94)+_0x2e426b(0x17f2,0x11c0,0x989,0x889)+'\x20Money*\x20:\x20'+getMonay(_0x17aa6d['sender'])+(_0x2e426b(0xc6e,0xe98,0xd21,0x43f)+_0x2e426b(0x114b,0xa44,0x10bb,0x148b))+_0x295ea5[_0x2e426b(0x8cc,0xeb9,0xca9,0x17ca)](getUmpan,_0x17aa6d['sender']));},-0x1b*-0x102+-0x1b41*-0x1+-0x2ea7);}else{if(_0x295ea5[_0x425890(0x773,0xc5f,0x1538,0x14b1)](_0x52a010[-0xc11+-0x1c6a+0xf1*0x2b],_0x295ea5[_0x425890(0xf17,0x534,0x529,0xc76)])){let _0x5ef7a3=(0x6*-0xa3d+0x2f5c+0x4b65*0x2)*_0x54fa69;if(!_0x52a010[0x1d13+-0x24d6*-0x1+-0x1*0x41e8])return _0xcd1d32(_0x425890(0xdeb,0xb08,0x1356,0x12f2)+(_0x4fea53+_0x1cbc75)+(_0x425890(0x1a37,0x14cf,0xc2c,0x1c0c)+_0x17318e(0x8fb,-0xc5,0x134d,0x9a1)+_0x425890(0xaec,0x546,0x687,0x7c2)+'y'));if(_0x295ea5[_0x17318e(0x1f81,0xb19,0x1dd0,0x15a3)](isMonay,_0x5ef7a3))return _0x295ea5[_0x17318e(-0xa9,-0x389,0x877,0x394)](_0xcd1d32,_0x17318e(0x124f,0x106,0x825,0x955)+_0x17318e(0x63f,0xaa5,0xcc7,0xc7c)+_0x17318e(0x11b5,0x115f,0xa7e,0x1130)+'fficient\x20F'+_0x17318e(0x91e,0x16d4,0x1463,0xfc5)+'rchase');_0x295ea5['JceUG'](kurangMonay,_0x17aa6d[_0x17318e(0xa64,0x1668,0xaa0,0xc86)],_0x5ef7a3);var _0x1a2b4f=_0x295ea5[_0x17318e(0x957,0x186e,0x1026,0x11ca)](_0x54fa69,-0x3*0x4b5+0xc82+0x19e);_0x295ea5[_0x425890(0x91f,0x952,0x9ba,0x5bf)](addLimit,_0x17aa6d[_0x17318e(0x15f5,0x4ff,0x107e,0xc86)],_0x1a2b4f),_0x295ea5[_0x425890(0x462,0x4fa,-0x76,0x389)](setTimeout,()=>{function _0x243a6b(_0x2208f8,_0xaee0c,_0x1edc0c,_0x473f25){return _0x17318e(_0x2208f8-0x69,_0xaee0c,_0x1edc0c-0x19a,_0x2208f8- -0x34c);}function _0x1671e2(_0x325005,_0x1093f7,_0x4e973c,_0x5b2bf8){return _0x425890(_0x5b2bf8,_0x4e973c-0x271,_0x4e973c-0x1dc,_0x5b2bf8-0xe5);}_0xcd1d32('Transactio'+_0x243a6b(0x9f5,0xe83,0xe8b,0xec6)+'ul\x20✔️\x0a*Your'+_0x1671e2(0x112a,0xea5,0x12c5,0x191e)+_0x243a6b(0xb24,0x1361,0x43a,0x40d)+_0x295ea5[_0x1671e2(0xef4,0xf10,0x1578,0x1e77)](getMonay,_0x17aa6d[_0x243a6b(0x93a,0xa9f,0x299,0x204)])+(_0x1671e2(0x15b0,0xed3,0x1198,0x1330)+_0x243a6b(0xaec,0xc6f,0x2f0,0x242))+_0x295ea5['tRUuB'](getLimit,_0x17aa6d[_0x243a6b(0x93a,-0x11,0xba8,0x192)]));},0x5*0x34+-0x1bea+0x22b6);}else _0x295ea5[_0x17318e(0x875,-0x470,0xd9,0x5f6)](_0xcd1d32,_0x295ea5[_0x425890(0xbb7,0x445,0xe49,0x757)]);}}}break;case'sel':case _0x425890(0xc62,0x1516,0x1949,0x1509):{if(!q)return _0x295ea5['cGXlB'](_0xcd1d32,'What\x20Do\x20Yo'+'u\x20Want\x20To\x20'+'Sell??\x0aExa'+_0x17318e(-0x135,-0x146,0xd07,0x639)+_0x295ea5['ABKMT'](_0x4fea53,_0x1cbc75)+_0x425890(0x1dbd,0x14ae,0x11db,0x1a5d));!isInventoriBuruan&&_0x295ea5[_0x17318e(0xf7a,0xc09,0x1503,0x1525)](addInventoriBuruan,_0x17aa6d[_0x17318e(0xfce,0xa6f,0x1253,0xc86)]);if(!isInventoryMonay){if(_0x425890(0xb19,0xa74,0x13ba,0x1427)===_0x295ea5[_0x425890(0x650,0x606,0xbc2,0xe6)])addInventoriMonay(_0x17aa6d[_0x425890(0x1cb,0xa69,0xb81,0x25a)]);else{if(_0x295ea5[_0x17318e(0x1a93,0x181a,0xc69,0x12ee)](_0x19b878,_0x1cda72))return _0x295ea5[_0x17318e(0x3e1,0x5c0,0xf58,0xd9b)](_0x21ed1b,_0x425890(0x3fb,0xbb0,0xba4,0x13f)+'Have\x20Enoug'+_0x17318e(0x1d48,0x1b2a,0x1097,0x1422)+_0x17318e(0x86f,0x981,0xf51,0x5c9)+_0x425890(0xddd,0x568,0xb40,0xec4)+_0x17318e(0x172e,0x193d,0x1065,0xef9));if(!_0x46c148[-0x1714+0x39*-0xaf+0x3e0c])return _0x295ea5[_0x425890(0x3af,0x286,0xcef,0xc05)](_0x2076fa,_0x425890(0xe9f,0xb08,0xdb6,0xd5a)+(_0x3e325e+_0x193acf)+(_0x425890(0xa2b,0x508,0x9d6,0x4f3)+_0x17318e(0x1190,0x15a9,0x1ee7,0x16c6)+_0x17318e(0x1995,0x1600,0x1779,0x105e)+_0x17318e(0x1746,0x1de0,0xbb4,0x134a)));_0x295ea5[_0x425890(0x7d3,0xa2a,0x52,0x401)](_0x2bde86,_0x161530[_0x425890(0x716,0xa69,0x7f9,0x891)],_0x1dc69e);let _0x269b82=(-0xc5fd+0xd12c*-0x1+-0x31dc9*-0x1)*_0x527536;_0x295ea5[_0x425890(-0x511,0x4fa,0xa8e,0x973)](_0x3e4560,_0x355efc['sender'],_0x269b82),_0x295ea5['LweBg'](_0x35f432,()=>{function _0x43de0b(_0x3ff5de,_0x47e803,_0x1698b0,_0x2e6db2){return _0x17318e(_0x3ff5de-0x4e,_0x1698b0,_0x1698b0-0x47,_0x2e6db2-0x61);}function _0x54b911(_0x4fc2c6,_0x521326,_0x8c4224,_0x449259){return _0x17318e(_0x4fc2c6-0x1aa,_0x449259,_0x8c4224-0x90,_0x4fc2c6- -0x344);}_0x561330('Transactio'+_0x43de0b(0x1591,0x4d3,0x372,0xda2)+'ul\x20✔️\x0a*Your'+'\x20Remaining'+'\x20Money*\x20:\x20'+_0x295ea5[_0x54b911(0x40c,0x1c9,0x5f5,0xe27)](_0x20253c,_0x449969[_0x54b911(0x942,0x8e,0x5bb,0x307)])+(_0x43de0b(0x1d29,0x1c8b,0x1f16,0x171e)+_0x43de0b(-0x10a,0x78a,0xd54,0x3d7)+_0x43de0b(0xb69,0xb1f,0xea4,0xf0c)+_0x54b911(0x12e3,0x1688,0x1af1,0xe51)+_0x54b911(0x484,0x109,-0x118,0xc3c)+'ction*\x20:\x20')+_0x295ea5['DDWUl'](_0x59991c,_0x3255d2[_0x43de0b(0x7b1,0x64a,0x155e,0xce7)]));},0x1d60+0x5*-0xbb+-0x11e9);}}!isInventory&&_0x295ea5[_0x17318e(0x1191,0x10a4,0x121f,0xa9f)](addInventori,_0x17aa6d[_0x425890(0xb66,0xa69,0x100,0x1038)]);var _0x54fa69=_0x52a010[0x111b*-0x1+-0x377+0x1493];if(_0x295ea5[_0x17318e(0xcb8,0x2080,0x204c,0x1658)](_0x52a010[0xb*-0x114+0x6*0x5b9+0x2*-0xb3d],_0x295ea5[_0x17318e(-0x3be,0x794,0x6db,0x61f)])){if(_0x295ea5[_0x17318e(0xced,0x11f4,0x14fb,0x111b)](isIkan,_0x54fa69))return _0x295ea5[_0x17318e(0xc81,0xf88,-0x188,0x699)](_0xcd1d32,'You\x20Don\x27t\x20'+_0x425890(0x1411,0x10a4,0xac5,0x1720)+_0x17318e(0xc11,0xc0a,0x7fa,0x6ee)+'\x20For\x20This\x20'+_0x425890(0x152f,0x1518,0xdba,0xa94)+'n');if(!_0x52a010[0x110a*0x2+-0x21fe+-0x15])return _0x295ea5[_0x17318e(0x60f,0x89b,0x55a,0x96c)](_0xcd1d32,'Example\x20:\x20'+_0x295ea5['XDoyb'](_0x4fea53,_0x1cbc75)+(_0x17318e(0x1f71,0x225b,0xfef,0x17f7)+_0x425890(0x14af,0x1108,0x1afb,0xf51)+_0x17318e(0xd90,0x707,0x1ad1,0x1167)));_0x295ea5[_0x17318e(0xa86,0x1591,0x1050,0xe63)](kurangIkan,_0x17aa6d[_0x17318e(0xd55,0x872,0x494,0xc86)],_0x54fa69);let _0x5ee6fc=_0x295ea5[_0x425890(0x4a8,0xb6a,0xb56,0x38e)](-0x4a*0x1b+-0x1*0x1eeb+0x71*0x65,_0x54fa69);_0x295ea5[_0x17318e(0x6da,0x16ec,0x1786,0x10e1)](addMonay,_0x17aa6d[_0x17318e(0x1628,0x6eb,0x14ca,0xc86)],_0x5ee6fc),_0x295ea5['wMDhn'](setTimeout,()=>{function _0x3e00c0(_0x14c81b,_0x5a64b1,_0x385fbe,_0x455bf5){return _0x17318e(_0x14c81b-0x183,_0x455bf5,_0x385fbe-0x116,_0x385fbe-0x44);}function _0x3764e9(_0x7e3900,_0xefd2d,_0x3437e9,_0x6563ba){return _0x17318e(_0x7e3900-0x150,_0xefd2d,_0x3437e9-0x5a,_0x3437e9- -0x512);}if('RKAYG'!==_0x295ea5[_0x3e00c0(0x1669,0x1ae0,0x1509,0x1d0f)])_0x295ea5[_0x3e00c0(-0xad,0xf14,0x8c5,0xd77)](_0xcd1d32,_0x3e00c0(0x13d4,0x1e4c,0x1779,0x1466)+_0x3e00c0(0x1318,0x886,0xd85,0x13ad)+_0x3764e9(0x724,0x526,0x5ff,0x8f3)+'\x20Remaining'+'\x20Money*\x20:\x20'+_0x295ea5[_0x3764e9(0xa93,-0x780,0x154,0x43c)](getMonay,_0x17aa6d[_0x3764e9(-0x11a,0x141,0x774,0x239)])+(_0x3e00c0(0x8b9,0xcdd,0xcfc,0x639)+_0x3e00c0(0x31d,0x10b1,0x783,0x241)+'h(es)*\x20:\x20')+_0x295ea5[_0x3e00c0(0x654,-0xa,0x794,0x332)](getIkan,_0x17aa6d['sender']));else{const _0x4cdae4=_0x295c2a?function(){function _0x5e2279(_0x462fe6,_0x2b91e9,_0x5df816,_0x2f4c36){return _0x3e00c0(_0x462fe6-0x18c,_0x2b91e9-0x5b,_0x2f4c36- -0xc3,_0x462fe6);}if(_0x3b5c03){const _0x3e7fc7=_0x550583[_0x5e2279(0x251,0x845,0x1291,0x991)](_0x412a3b,arguments);return _0x451407=null,_0x3e7fc7;}}:function(){};return _0x56af6f=![],_0x4cdae4;}},-0x9e6+-0x7*0xdf+0x4c3*0x5);}else{if(_0x295ea5[_0x17318e(0xf4a,0xca0,0x4a1,0x63a)](_0x52a010[0xc43+-0x24aa*0x1+0x1867],_0x295ea5[_0x17318e(0x116e,0x1566,0x1968,0x13dd)])){if(isAyam<_0x54fa69)return _0x295ea5[_0x17318e(0x15b5,0x13a0,0x19c1,0x15a7)](_0xcd1d32,_0x425890(0x4b2,0xbb0,0x1619,0x11a)+_0x425890(0xec7,0x10a4,0x1343,0xb8d)+_0x17318e(0x1368,0xee0,0xac8,0xe54)+_0x17318e(0x56c,0x552,0x32b,0x5c9)+_0x17318e(0x9fd,0xd89,0x2ed,0x785)+'ion');if(!_0x52a010[-0x2191*-0x1+0x5a3+0x5*-0x7d7])return _0x295ea5[_0x425890(0x1952,0x15ff,0x1277,0x1b7c)](_0xcd1d32,'Example\x20:\x20'+_0x295ea5['wkruD'](_0x4fea53,_0x1cbc75)+(_0x17318e(0xe0a,0x646,0x1c0,0x69f)+'\x0a\x201\x20Chicke'+_0x425890(0x127c,0x117f,0xded,0x1054)+_0x17318e(0x3b3,0xb5a,0x77c,0xd27)));kurangAyam(_0x17aa6d['sender'],_0x54fa69);let _0x5652ef=_0x295ea5[_0x425890(0x1309,0x139b,0xf04,0x1d36)](0x2011+0x20a7+0x4*-0xdbd,_0x54fa69);_0x295ea5[_0x17318e(0xfbe,0x341,0xa8b,0x6c5)](addMonay,_0x17aa6d[_0x17318e(0xae4,0x2c6,0x1646,0xc86)],_0x5652ef),setTimeout(()=>{function _0x354d62(_0x35d613,_0x35cffe,_0x2443b0,_0x3b90d7){return _0x425890(_0x3b90d7,_0x35cffe-0x70,_0x2443b0-0x3c,_0x3b90d7-0xd0);}function _0x48c113(_0x30744c,_0x2782e2,_0x4e5b88,_0x1e20c5){return _0x17318e(_0x30744c-0x163,_0x1e20c5,_0x4e5b88-0x1ab,_0x2782e2- -0x522);}if(_0x295ea5[_0x48c113(0xab4,0x128,-0x152,0x955)](_0x295ea5['voKeC'],_0x354d62(0xab7,0xc68,0x2f8,0x107d))){const _0x3ef57b={'nama':_0x3d31bb,..._0x3c10bc};return _0x3ef57b;}else _0x295ea5[_0x48c113(0xbbb,0xc78,0x553,0xfac)](_0xcd1d32,_0x48c113(0x132c,0x1213,0x199e,0xf56)+'n\x20Successf'+_0x354d62(0x54a,0x964,0x12ec,0x314)+'\x20Remaining'+_0x354d62(0x871,0xcc3,0x10ac,0xeb9)+getMonay(_0x17aa6d['sender'])+(_0x48c113(0xb22,0x796,-0x1f,-0x256)+_0x48c113(-0x7e6,0x292,0x8e5,0x239)+_0x48c113(0xba1,0x444,0x3a4,0xb06))+getAyam(_0x17aa6d[_0x354d62(0x1b7,0xad9,0x307,0xde5)]));},0x481+0x1154+-0xe05*0x1);}else{if(_0x295ea5[_0x17318e(-0x92,0x1d4,0x949,0x40a)](_0x52a010[0x17fd*-0x1+0x253b+-0x69f*0x2],_0x295ea5[_0x17318e(0x5a4,-0x2f4,0x2c8,0x5b0)])){if(_0x295ea5[_0x17318e(0x9cf,0x8c7,0xea5,0xc19)](isKelinci,_0x54fa69))return _0xcd1d32(_0x17318e(0x339,0x6f9,0x1000,0xdcd)+_0x425890(0x1818,0x10a4,0x8e3,0x17a4)+_0x425890(0x1222,0xb6b,0x795,0xa28)+_0x17318e(0x882,0x14ae,0x157f,0xb59)+_0x17318e(0x1b91,0x2018,0xe7f,0x162f)+'on');if(!_0x52a010[0x1ade+0x4d4+-0x1fb1])return _0x295ea5[_0x425890(0x1f1d,0x15f4,0x16a7,0x109e)](_0xcd1d32,_0x17318e(0x52b,0x1034,0x340,0xd25)+_0x295ea5[_0x425890(0x173f,0x1044,0xd1a,0xee9)](_0x4fea53,_0x1cbc75)+(_0x425890(0x1654,0xf2a,0xf2e,0xbbc)+'\x201\x20Rabbit\x20'+'=\x203000\x20Mon'+'ey'));kurangKelinci(_0x17aa6d[_0x17318e(0x9ed,0xae8,0x7ba,0xc86)],_0x54fa69);let _0x404fc0=(0x1dab+-0x1e3f+0xc4c)*_0x54fa69;addMonay(_0x17aa6d[_0x17318e(0x83c,0x161d,0xeaf,0xc86)],_0x404fc0),_0x295ea5[_0x17318e(0x109b,0x38e,0xf66,0xb12)](setTimeout,()=>{function _0x2bff70(_0x4e6655,_0x36dbd2,_0x23482e,_0x232ed6){return _0x17318e(_0x4e6655-0x1d9,_0x4e6655,_0x23482e-0x49,_0x23482e-0x6c);}function _0x2b4f54(_0x17efc8,_0x345181,_0x398d8f,_0x269016){return _0x17318e(_0x17efc8-0x1a9,_0x17efc8,_0x398d8f-0x1ce,_0x345181- -0x8d);}_0x295ea5['XSjhV'](_0xcd1d32,_0x2bff70(0x14ff,0x183e,0x17a1,0x12e5)+_0x2b4f54(0x1140,0xcb4,0x160c,0x580)+_0x2bff70(0xb44,0xe87,0xb7d,0x59c)+'\x20Remaining'+_0x2b4f54(0xf3d,0xde3,0x1865,0x6da)+_0x295ea5['IeRIi'](getMonay,_0x17aa6d[_0x2b4f54(0xbab,0xbf9,0x7f5,0x9a0)])+(_0x2bff70(0x13ba,0x920,0xd24,0x668)+_0x2b4f54(0x97,0x42b,-0x24e,0x59a)+_0x2bff70(0x9d2,0x11d,0x7d3,0xd1d))+_0x295ea5[_0x2bff70(0x9f7,0x10dc,0x1012,0x7c4)](getKelinci,_0x17aa6d[_0x2bff70(0x12c8,0x1596,0xcf2,0xc51)]));},-0x2016+0x1*-0x2483+0x4c69);}else{if(_0x52a010[-0x1a6c+0x1*0x407+-0x15*-0x111]===_0x17318e(0xb27,0x7d9,0x1202,0x875)){if(_0x295ea5['VYPKE'](_0x295ea5[_0x425890(0x165b,0x10b0,0x159b,0x1382)],_0x425890(0x56e,0x9e7,-0x2,0x23a))){if(_0x295ea5[_0x17318e(0x1176,0x6dc,0xb05,0xb3b)](isDomba,_0x54fa69))return _0x295ea5[_0x425890(-0x45,0x4eb,0x2fe,0x5f9)](_0xcd1d32,_0x17318e(0xb32,0x5b4,0x1392,0xdcd)+_0x425890(0xfdd,0x10a4,0x7ec,0x837)+_0x425890(0x1999,0x138f,0x9ec,0x10fd)+_0x425890(0x12d7,0x1451,0xf92,0x1e83)+_0x17318e(0x1229,0x1b23,0x142a,0x1735)+'n');if(!_0x52a010[0x1*0x1e76+0x5*-0x31b+0x7*-0x222])return _0xcd1d32(_0x17318e(0x10cf,0x6c7,0x583,0xd25)+_0x295ea5['tkhUW'](_0x4fea53,_0x1cbc75)+(_0x425890(0x1295,0xbc1,0x1d9,0x63e)+_0x17318e(0x3ba,-0x299,-0x251,0x435)+_0x425890(0xd9f,0xfb0,0x9ef,0x1a12)));kurangDomba(_0x17aa6d[_0x425890(0x13af,0xa69,0x371,0x1194)],_0x54fa69);let _0x5b1ee8=_0x295ea5[_0x17318e(0x93d,0x1611,0xaf7,0x11ca)](-0x1c6a+-0x1008+0x3ffa,_0x54fa69);_0x295ea5['pIIhU'](addMonay,_0x17aa6d[_0x17318e(0x123e,0xd32,0xa4a,0xc86)],_0x5b1ee8),_0x295ea5[_0x17318e(0x333,0x8e4,0xb1e,0xc47)](setTimeout,()=>{function _0x18a7dd(_0xadd88e,_0x543d5a,_0x3c01fb,_0x342a42){return _0x425890(_0x3c01fb,_0xadd88e-0xb2,_0x3c01fb-0xb8,_0x342a42-0xf9);}function _0x5f59be(_0x366092,_0x396888,_0x2d6774,_0x5c0ee8){return _0x17318e(_0x366092-0x151,_0x2d6774,_0x2d6774-0x169,_0x5c0ee8- -0x9a);}_0xcd1d32(_0x5f59be(0x1b60,0xddb,0x1540,0x169b)+_0x18a7dd(0xbd6,0x14cb,0x10c4,0x784)+_0x5f59be(0xb12,0x1111,0x329,0xa77)+_0x18a7dd(0x1106,0x1960,0xae4,0xcb5)+_0x18a7dd(0xd05,0x1119,0xf29,0x1629)+_0x295ea5[_0x5f59be(0xbc1,0x8f1,0xd81,0xf0c)](getMonay,_0x17aa6d[_0x5f59be(0xaed,0x1fc,0x723,0xbec)])+('\x0a*Your\x20Rem'+'aining\x20She'+_0x5f59be(0x1c31,0x1b2b,0x1993,0x166b))+getDomba(_0x17aa6d[_0x5f59be(0xc95,0xf5f,0x586,0xbec)]));},-0x182*-0x6+-0x11*-0x1de+-0x20fa*0x1);}else{const _0x33e66d={};_0x33e66d['mute']=_0x295ea5[_0x425890(0x131f,0xe10,0x419,0x1796)],_0x28ca6c[_0x425890(0x8a1,0xf99,0x1612,0x14da)](_0x33e66d,_0x23f24e['chat'],[])['then'](_0xe1223f=>_0x36b118(_0x5a0111(_0xe1223f)))[_0x17318e(0xeb6,0x883,0x1339,0x10e8)](_0x1b2132=>_0x14c41d(_0x4f522d(_0x1b2132)));}}else{if(_0x52a010[0xd67*-0x1+0x2b*0xb+0xb8e]===_0x295ea5['WLuuI']){if(_0x295ea5[_0x425890(0x858,0x122b,0x1603,0xa24)](isSapi,_0x54fa69))return _0x295ea5[_0x17318e(-0x5fc,0x416,0x879,0x4a2)](_0xcd1d32,'You\x20Don\x27t\x20'+_0x17318e(0x12b9,0x1c5b,0x125d,0x12c1)+_0x425890(0x447,0x294,-0x2d0,0x9ae)+'or\x20This\x20Tr'+_0x17318e(0xae0,0x7a2,0x1a,0x70a));if(!_0x52a010[0x1*-0x80d+-0x2a5*-0x1+0x569])return _0x295ea5[_0x425890(0x1123,0xe4a,0x15ec,0x6fa)](_0xcd1d32,_0x425890(0x62b,0xb08,0x924,0x6e)+_0x295ea5[_0x17318e(0xe87,0x180a,0x1a17,0x12f3)](_0x4fea53,_0x1cbc75)+(_0x425890(0x1e6,0x8f9,0xb53,-0xe4)+_0x17318e(0x1c59,0x1eb9,0xf7c,0x15a4)+_0x425890(0x66e,0x7ec,0x119f,-0x224)));_0x295ea5[_0x425890(-0x52e,0x367,0xc6e,0xa93)](kurangSapi,_0x17aa6d[_0x17318e(0xcc9,0x10a6,0xa94,0xc86)],_0x54fa69);let _0x52d59c=(-0x25*-0x1cb+0x2693+0x2*-0x20ed)*_0x54fa69;_0x295ea5[_0x17318e(0x1e4c,0x1757,0x1478,0x17e7)](addMonay,_0x17aa6d['sender'],_0x52d59c),_0x295ea5[_0x17318e(0x9b,0xd8e,-0x3ff,0x395)](setTimeout,()=>{function _0x1776d2(_0x43a6f4,_0x55591b,_0x227355,_0x5d6b11){return _0x17318e(_0x43a6f4-0xc9,_0x5d6b11,_0x227355-0x63,_0x43a6f4- -0x684);}function _0x38e699(_0x111a9a,_0x45cd68,_0x268159,_0x5aeede){return _0x17318e(_0x111a9a-0x10e,_0x45cd68,_0x268159-0x152,_0x111a9a- -0x371);}_0xcd1d32(_0x1776d2(0x10b1,0xebc,0x136f,0xa86)+_0x1776d2(0x6bd,-0x37b,0xf96,0x10b5)+_0x1776d2(0x48d,-0x5a,0x2c9,-0x590)+_0x1776d2(0xbed,0x5e0,0xb93,0x329)+_0x1776d2(0x7ec,0x7fe,0x1260,0x49b)+_0x295ea5['ZXjRB'](getMonay,_0x17aa6d[_0x38e699(0x915,0xdf8,0xe5,0xa8b)])+('\x0a*Your\x20Rem'+'aining\x20Cow'+_0x1776d2(0xcf5,0x741,0x168a,0x11b0))+_0x295ea5[_0x38e699(0x374,0xa08,-0x4e5,0x130)](getSapi,_0x17aa6d[_0x38e699(0x915,0x1051,0x581,0xec2)]));},-0x1*-0x18a7+0x1546+-0x1*0x261d);}else{if(_0x52a010[0x22c5+-0x1*-0x1fff+-0x42c4]===_0x295ea5[_0x425890(-0x18d,0x7c9,0x20,-0x2b5)]){if(isGajah<_0x54fa69)return _0x295ea5[_0x425890(0x1855,0xec2,0xab2,0x42f)](_0xcd1d32,_0x425890(0xf67,0xbb0,0x8df,0x143f)+_0x17318e(0xf25,0xae9,0x1715,0x12c1)+'h\x20Elephant'+'(s)\x20For\x20Th'+_0x17318e(0xd62,0x1d16,0x17e5,0x1575)+_0x425890(0x5ef,0x777,0x474,0x6bb));if(!_0x52a010[0xc4a+0x1942+-0x258b])return _0x295ea5['okeWZ'](_0xcd1d32,'Example\x20:\x20'+_0x295ea5[_0x425890(0x8ef,0x4e3,-0x3ca,0xc5a)](_0x4fea53,_0x1cbc75)+('\x20elephant\x20'+_0x425890(-0x5c2,0x3da,0x1ab,0x93f)+_0x17318e(0x1346,0x1838,0x1e3b,0x1532)+_0x425890(0xb83,0x7ec,-0x187,0xc1b)));_0x295ea5['hJKPq'](kurangGajah,_0x17aa6d['sender'],_0x54fa69);let _0x33ebef=_0x295ea5['pPoas'](-0x1*-0x51ef+0x1b0e+-0x85*0x61,_0x54fa69);_0x295ea5['snvhH'](addMonay,_0x17aa6d[_0x17318e(0xe5c,0xb58,0xee9,0xc86)],_0x33ebef),_0x295ea5[_0x425890(0x7df,0x45f,0x58f,0x2e7)](setTimeout,()=>{function _0x469fa3(_0x15b3b6,_0x468abc,_0x453838,_0x1f2c83){return _0x17318e(_0x15b3b6-0x33,_0x15b3b6,_0x453838-0xff,_0x1f2c83-0xe3);}function _0x1c78c1(_0x1b1bac,_0x25808e,_0x4d1436,_0x5e3ecf){return _0x17318e(_0x1b1bac-0x32,_0x1b1bac,_0x4d1436-0x1c8,_0x25808e- -0x6a1);}_0x295ea5[_0x469fa3(0x15f3,0x1269,0x1dcf,0x151a)](_0xcd1d32,_0x1c78c1(0xace,0x1094,0x19a0,0x1627)+_0x469fa3(0x397,0xdaf,0x1755,0xe24)+_0x1c78c1(0x956,0x470,0xc1,0x760)+_0x469fa3(0xba4,0x1972,0xae1,0x1354)+_0x1c78c1(0xff5,0x7cf,0x3ba,0x399)+getMonay(_0x17aa6d[_0x1c78c1(0x504,0x5e5,-0x456,0x5a5)])+(_0x469fa3(0x154e,0x124e,0xd53,0xd9b)+'aining\x20Ele'+'phant(s)*\x20'+':\x20')+getGajah(_0x17aa6d['sender']));},0x669*-0x2+-0x117b*-0x2+0x395*-0x4);}else{if(_0x295ea5[_0x17318e(-0x117,0x988,-0xe5,0x518)](_0x52a010[-0x3*-0x1e0+0xa55+-0xff5],_0x295ea5[_0x425890(0x7cc,0x219,-0x1ba,0x387)])){if(_0x295ea5[_0x425890(0x127d,0xc5f,0x434,0x2fd)](_0x295ea5[_0x17318e(0xc23,0x843,0x168a,0xfca)],_0x425890(0x9a,0x763,0xc3b,0x8fc))){if(isBesi<_0x54fa69)return _0x295ea5[_0x17318e(0x922,0xa89,-0x542,0x394)](_0xcd1d32,_0x17318e(0xfa1,0xc9f,0x6e1,0xdcd)+_0x17318e(0x91e,0xd53,0x1173,0x12c1)+'h\x20Iron(s)\x20'+_0x17318e(0x131e,0xc88,0xcb7,0xc82)+_0x17318e(0x127d,0x1ad1,0x1271,0x14c2));if(!_0x52a010[0x13e5+0x20c3*0x1+-0x118d*0x3])return _0x295ea5['vfwoD'](_0xcd1d32,'Example\x20:\x20'+(_0x4fea53+_0x1cbc75)+(_0x17318e(0x21e9,0x1a90,0x19f0,0x17fa)+_0x17318e(0xf6e,-0x29a,-0x4fa,0x599)+_0x17318e(0xa93,0x3c2,0xb4c,0x60b)));_0x295ea5[_0x17318e(-0x2d,0x1a3,-0x30,0x329)](kurangBesi,_0x17aa6d[_0x17318e(0x62b,0x1026,0x1545,0xc86)],_0x54fa69);let _0x47f42f=_0x295ea5['KGhyM'](-0xeef*0x5+0x26bb+0x64*0xfc,_0x54fa69);_0x295ea5[_0x17318e(0x5e6,0xf16,0x59d,0x50a)](addMonay,_0x17aa6d[_0x425890(0x7b2,0xa69,0x1a8,0xeb0)],_0x47f42f),_0x295ea5['bSBdg'](setTimeout,()=>{const _0x284820={};function _0x3bd8ba(_0x1d5379,_0x39eebc,_0x15f58b,_0x200547){return _0x17318e(_0x1d5379-0xb,_0x15f58b,_0x15f58b-0x119,_0x200547- -0x631);}_0x284820['fgGjv']=_0x295ea5[_0xd46c53(0x386,-0x434,0xad9,0x3d6)];const _0x131088=_0x284820;function _0xd46c53(_0x3e2598,_0x1ca0b6,_0x4b59be,_0x15323f){return _0x17318e(_0x3e2598-0x106,_0x4b59be,_0x4b59be-0xcb,_0x3e2598- -0xef);}if(_0x295ea5[_0xd46c53(0x1685,0x164f,0x1d04,0x1a16)](_0x295ea5[_0x3bd8ba(-0xc6,0x2c9,-0x451,0x333)],_0x295ea5[_0xd46c53(0x875,0xe7a,0x700,0x384)]))_0x295ea5[_0x3bd8ba(0x12ef,0x894,0xd69,0xb64)](_0xcd1d32,'Transactio'+_0xd46c53(0xc52,0x1641,0x1193,0x5d7)+_0x3bd8ba(0x945,-0x7c,0x6fc,0x4e0)+_0x3bd8ba(0x1420,0x88f,0x12da,0xc40)+'\x20Money*\x20:\x20'+_0x295ea5[_0xd46c53(0x10b6,0x14e9,0x8e5,0x16b3)](getMonay,_0x17aa6d[_0xd46c53(0xb97,0x14ec,0xc04,0x7b7)])+(_0x3bd8ba(-0xdb,0x5fd,0x107f,0x687)+_0x3bd8ba(-0x26a,0x4d7,0xa25,0x297)+_0xd46c53(0x730,0x5ff,0xecc,0xdad))+_0x295ea5[_0x3bd8ba(0x3aa,0x99b,0x951,0xe3c)](getBesi,_0x17aa6d[_0x3bd8ba(0xe94,0xd10,0x35,0x655)]));else{_0x1c83fb=_0x2e4fbd,_0x35ad9a=_0x229666[_0x5949b0[_0x3bd8ba(0x1053,0x10cf,0xf8e,0x1001)](_0x69f485[_0x3bd8ba(0xf77,-0x549,-0x38e,0x51a)]()*_0x1adb7f[_0x3bd8ba(0x820,0x85b,0x955,0x4a8)])][_0x3bd8ba(-0x6bd,0xa69,-0x42f,0x1df)];const _0x5af661={};_0x5af661[_0x3bd8ba(0xf19,0xb4d,0x276,0xc8c)+'t']=_0x131088[_0x3bd8ba(0x977,0xc55,0xeb,0x8a6)];const _0xc1fb64={};_0xc1fb64[_0x3bd8ba(0xf9e,0x129e,0x2a8,0xb63)]='gimage\x20'+_0x512a18,_0xc1fb64[_0x3bd8ba(0x24e,0xc79,0xfa7,0xce7)]=_0x5af661,_0xc1fb64[_0xd46c53(0x1549,0xdc9,0x1e4c,0x113a)]=0x1;let _0x512ab5=[_0xc1fb64];const _0x366211={};_0x366211[_0x3bd8ba(-0xd2,0x65a,0x36d,0x1df)]=_0x57ae0c;const _0x4fac71={};_0x4fac71[_0x3bd8ba(-0x9a7,0x467,0x5a6,-0x93)]=_0x366211,_0x4fac71[_0x3bd8ba(-0x755,0x3df,-0x90d,-0x10a)]='*-------「\x20'+_0xd46c53(0x1040,0x139f,0x806,0xd92)+_0xd46c53(0x9d6,0x777,0x10e6,0xe46)+_0x3bd8ba(0x2c9,0x5b6,0x1f3,0x2ed)+_0xd46c53(0x14e1,0x1e1b,0x1f67,0x1641)+_0x32c589+(_0x3bd8ba(0x1a1a,0xe94,0x94f,0x1228)+_0x3bd8ba(0x965,0x1543,0xf4f,0xe1b))+_0x13c51c,_0x4fac71['footer']=_0x43875e[_0xd46c53(0x11ec,0x905,0xedc,0x1076)][_0x3bd8ba(0x71b,0x427,0x9ff,0xa6e)],_0x4fac71[_0xd46c53(0x108f,0xd6d,0x1807,0x10b0)]=_0x512ab5,_0x4fac71['headerType']=0x4;let _0x2c5a65=_0x4fac71;const _0x5c83d5={};_0x5c83d5[_0xd46c53(0x935,0xd3,-0xb4,0x8f3)]=_0x541bea,_0x1ef81e['sendMessag'+'e'](_0x89167f[_0xd46c53(0xdf5,0x115a,0x10b3,0xa5e)],_0x2c5a65,_0x5c83d5);}},-0x267c+-0x12e6+0x4132);}else{const _0x250187={};_0x250187[_0x17318e(-0x3ec,0xaa5,0xb3e,0x405)]=_0x17318e(0x174d,0x15f6,0x543,0xe53)+_0x17318e(0xcea,-0x15f,0x117a,0x90a)+'නෙන්\x20හොල්ම'+'න්\x20පෙනෙන,\x20'+'මහ\x20රෑ\x20දාඩි'+_0x425890(0xa6f,0x100e,0x801,0xac2)+_0x17318e(0xeba,0xde2,0x1583,0x1202)+_0x17318e(0xe7d,0x13e7,0xdc8,0xb55)+_0x17318e(0x786,0x1a74,0x1690,0x1004)+_0x17318e(0x1cb3,0x1b3f,0x1584,0x1420)+_0x425890(0x1106,0xab1,0x473,0x1b5)+_0x425890(0x94,0x67b,0xf22,-0x34)+_0x425890(0xb2a,0xea1,0x1700,0x191b)+'ාත්‍රියක්\x20වේ'+'වා☠️👻👻*';const _0x38deed={};_0x38deed[_0x17318e(0x118,0x877,0x291,0xa24)]=_0x2b3e99,_0xa291f6[_0x17318e(0x65f,0xd2d,0xa3b,0x63c)+'e'](_0x2967da,_0x250187,_0x38deed);}}else{if(_0x295ea5[_0x17318e(0x75,0x366,-0x139,0x60a)](_0x52a010[0x4e7+-0xb59+0x32*0x21],_0x295ea5['MHSvg'])){if(isEmas<_0x54fa69)return _0x295ea5[_0x17318e(0x1b62,0x1ae6,0x1a51,0x13c8)](_0xcd1d32,'You\x20Don\x27t\x20'+_0x17318e(0x1d5a,0x1bfe,0x147e,0x12c1)+_0x425890(0x972,0xf9b,0x17d6,0x9f1)+_0x425890(0xa81,0xa65,0x949,0xdfd)+_0x425890(0x12b6,0x12a5,0xccc,0x18aa));if(!_0x52a010[0x1e0d*-0x1+-0x1b9a+0x39a8])return _0x295ea5[_0x425890(-0x2aa,0x358,0xbde,0x24d)](_0xcd1d32,_0x17318e(0x166b,0x12bd,0x10a0,0xd25)+_0x295ea5[_0x17318e(0x79a,0x1685,0x259,0xc1e)](_0x4fea53,_0x1cbc75)+(_0x17318e(0xe13,0xf3e,0x1ce5,0x1544)+'\x20Gold\x20=\x2050'+_0x425890(0xc3b,0x3ee,0xccf,0x60a)));_0x295ea5[_0x425890(0xc6a,0x1dd,-0x522,0xa95)](kurangEmas,_0x17aa6d[_0x17318e(0x52f,0x160f,0x11f3,0xc86)],_0x54fa69);let _0x3ec4d3=_0x295ea5[_0x17318e(0xc59,0x9f9,0x1507,0xf03)](0x13220+-0xba45*-0x2+-0x1e35a,_0x54fa69);_0x295ea5['eJtoC'](addMonay,_0x17aa6d['sender'],_0x3ec4d3),_0x295ea5['TGqZf'](setTimeout,()=>{function _0x20b5b9(_0x2d57a1,_0x48f8cb,_0x583295,_0x4af334){return _0x425890(_0x2d57a1,_0x48f8cb- -0x319,_0x583295-0x21,_0x4af334-0x134);}function _0x44f052(_0x18153c,_0x4b839b,_0x5f16c9,_0x40ec2e){return _0x425890(_0x18153c,_0x40ec2e-0x73,_0x5f16c9-0xde,_0x40ec2e-0x11);}_0xcd1d32(_0x44f052(0x18f1,0x1afa,0xe8b,0x158b)+_0x20b5b9(0x10df,0x80b,0xc83,0x11e4)+'ul\x20✔️\x0a*Your'+_0x44f052(0x419,0xd7a,0x474,0xcc6)+getMonay(_0x17aa6d['sender'])+('\x0a*Your\x20Rem'+_0x20b5b9(0x59b,0x101b,0xee9,0x71c)+'d(s)*\x20:\x20')+_0x295ea5[_0x20b5b9(0xd0b,0x9ad,0x1230,0x123f)](getEmas,_0x17aa6d[_0x20b5b9(0xb2c,0x750,0xc69,0x914)]));},-0x686+-0x13d9+-0x1*-0x222f);}else{if(_0x295ea5[_0x17318e(0x5ec,0x123a,0x1c6,0x841)](_0x52a010[0x12ce+0x1f1a*-0x1+0xc4c],_0x295ea5[_0x425890(0x2ae,0xaaf,0x1359,0xedc)])){if(_0x295ea5[_0x17318e(0x864,0xae8,-0x324,0x654)](_0x425890(0x11b4,0xea6,0x965,0x49e),_0x295ea5[_0x17318e(0x534,-0x3f5,0x804,0x477)]))_0x2252c1[_0x4cb080['sender']['split']('@')[0xbaf+0x2f*-0x11+-0x890]]=_0x269b75[_0x17318e(0x1335,0xf58,0x102a,0xa67)];else{if(_0x295ea5['mKKSr'](isEmerald,_0x54fa69))return _0xcd1d32(_0x425890(0x8a4,0xbb0,0xc8c,0x131e)+_0x425890(0x16aa,0x10a4,0x62a,0xfec)+_0x425890(0xea4,0x1205,0xc94,0x85e)+_0x425890(0x2b3,0x3ac,0x25e,0x1c3)+_0x17318e(0x856,-0xd2,0x117d,0x785)+'ion');if(!_0x52a010[-0x164+0xf7*-0x26+0x260f])return _0x295ea5['iNlYn'](_0xcd1d32,'Example\x20:\x20'+_0x295ea5[_0x425890(0xbe8,0x881,0x1bf,0x8c3)](_0x4fea53,_0x1cbc75)+(_0x425890(0x34,0x508,0xc9b,-0x238)+'\x0a\x201\x20Emeral'+_0x17318e(0x10aa,0xe6c,0x813,0x105e)+_0x425890(0x1a90,0x112d,0xf42,0x1694)));_0x295ea5[_0x17318e(0x744,0x324,-0x5fc,0x3e7)](kurangEmerald,_0x17aa6d[_0x17318e(0x14d5,0xd3d,0x12fa,0xc86)],_0x54fa69);let _0x5e22e8=_0x295ea5[_0x425890(0x1091,0xb6a,0x12f8,0x6ca)](0x2b7e6+-0x25a61+0xb01*0x1b,_0x54fa69);_0x295ea5[_0x425890(0x5cd,0x930,0xc24,0x2fa)](addMonay,_0x17aa6d[_0x17318e(0x11b9,0x1715,0x32a,0xc86)],_0x5e22e8),_0x295ea5['pIIhU'](setTimeout,()=>{function _0x17cf82(_0x30b3fd,_0x77682e,_0x3dc2c8,_0xa5a65d){return _0x17318e(_0x30b3fd-0x10,_0x77682e,_0x3dc2c8-0xd2,_0x30b3fd- -0x31b);}function _0x5ed2f9(_0x22ca16,_0x1336af,_0x2ce9c1,_0x8339c6){return _0x425890(_0x2ce9c1,_0x1336af-0x261,_0x2ce9c1-0x1ef,_0x8339c6-0xc);}_0x295ea5['lRGNr'](_0xcd1d32,_0x17cf82(0x141a,0x18c7,0x198f,0xb58)+_0x5ed2f9(0xb2c,0xd85,0xc4c,0xc5b)+_0x5ed2f9(0x151b,0xb55,0x296,0x682)+_0x5ed2f9(0xf35,0x12b5,0xf42,0x1c08)+_0x17cf82(0xb55,0xed7,0x8f2,0x41e)+_0x295ea5['XSjhV'](getMonay,_0x17aa6d['sender'])+(_0x5ed2f9(0x1a4c,0x1701,0x1105,0xcfc)+_0x17cf82(0x5b,-0x6cb,0x58e,0x853)+_0x5ed2f9(0xc2c,0xeef,0x18b1,0x1555)+'d(s)\x20For\x20T'+_0x17cf82(0x4ad,0xc6,-0x40f,0x244)+'ction*\x20:\x20')+_0x295ea5['UqwIh'](getEmerald,_0x17aa6d[_0x17cf82(0x96b,-0x64,0x82d,0xfb4)]));},-0x802*0x1+-0x3f9+0x13cb);}}else _0x295ea5[_0x425890(0x912,0x7cc,-0x19a,0x24f)](_0x17318e(0xd99,0xaf5,0xeb8,0x9e4),_0x295ea5[_0x425890(0x863,0x51f,0x38d,0x9ea)])?delete this[_0x425890(0x17f9,0xf0d,0xeaa,0x1924)][_0x256b8a['id']]:_0xcd1d32(_0x17318e(0x726,0x718,0x6a4,0x77b)+'Format!');}}}}}}}}}break;case _0x295ea5['ogKmf']:{if(_0x295ea5[_0x17318e(0x18fe,0x1fdf,0xfd3,0x17eb)](_0x295ea5[_0x425890(0x16d,0x3e9,0x5ff,0x5a2)],_0x295ea5[_0x425890(0xef7,0x5cd,0x51f,-0x14)])){const _0x3dead3={};_0x3dead3[_0x17318e(0x6,0x727,-0x33c,0x405)]='*කුනුහරුප\x20'+_0x425890(0x108c,0x684,0x699,-0xa8)+'\x20පගෝ😑💔*';const _0x5b966d={};_0x5b966d[_0x425890(0xaa2,0x807,0xf6c,0x521)]=_0x51c441,_0x519c0e[_0x425890(-0x422,0x41f,0x3a2,0xc6e)+'e'](_0x15d2ce,_0x3dead3,_0x5b966d);}else{const _0x38db6a=_0x295ea5[_0x17318e(0x1d59,0x17ce,0xdca,0x139d)][_0x17318e(-0x23f,-0x20f,0x807,0x508)]('|');let _0xe24a5d=0x4*0x2c8+0x17d4+0x117a*-0x2;while(!![]){switch(_0x38db6a[_0xe24a5d++]){case'0':if(!isCekDarah<-0x5c7*-0x3+0x9c2+-0x2*0xd8b)return _0x295ea5[_0x17318e(0x69a,0x11f4,0x78b,0x895)](_0xcd1d32,_0x295ea5[_0x425890(0x1aa1,0x1185,0xf41,0x1390)]);continue;case'1':_0x295ea5[_0x425890(0x16e1,0x10ff,0x13e4,0x14e3)](kurangPotion,_0x17aa6d[_0x425890(0xca6,0xa69,0x70d,0x8e2)],0x1*-0x15d0+0x3*-0x164+0x19fd);continue;case'2':if(q['includes'](_0x295ea5[_0x17318e(0x465,0xe43,0x345,0x9cf)]))return _0x295ea5[_0x17318e(0x97f,0xf0f,0x12c9,0xf40)](_0xcd1d32,examkosong);continue;case'3':if(isPotion<0x4e3+0x76e*0x2+-0x169*0xe)return _0x295ea5[_0x425890(0x1214,0x882,-0x1b6,0x348)](_0xcd1d32,_0x17318e(0x131b,0x3dc,0xd66,0xdcd)+'Have\x20A\x20Pot'+'ion,\x20Try\x20B'+'uying\x20It\x20T'+_0x17318e(0xfc5,0x19b3,0x1443,0x12a7)+'uypotion\x20_'+_0x17318e(0xd74,0x433,0x745,0xaa0));continue;case'4':_0x295ea5[_0x17318e(0x10e6,0x1104,0x187b,0xe63)](addDarah,_0x17aa6d[_0x17318e(0x16ce,0x158d,0x13f1,0xc86)],0x1435+-0x2313+-0xd9*-0x12);continue;case'5':if(_0x295ea5[_0x17318e(0x87c,0x41c,0x13fd,0xe3f)](isCekDarah,-0x1cbf*-0x1+-0x304*0x1+-0x1957))return _0x295ea5[_0x425890(0x9bd,0x104c,0x16de,0x1452)](_0xcd1d32,_0x295ea5[_0x17318e(-0x26f,0xfb,0xaf4,0x491)]);continue;case'6':_0x295ea5[_0x17318e(0x4b9,0x9bf,0x47,0xadd)](_0xcd1d32,_0x295ea5['UXZmq']);continue;}break;}}}break;case _0x295ea5['roSky']:case _0x17318e(0x19e1,0x1195,0x179a,0x169a):{if(_0x295ea5[_0x17318e(0x1085,0xf20,0x627,0x89b)](_0x295ea5[_0x17318e(0xd2f,0x145c,0x1501,0xba9)],_0x17318e(0x199f,0x1a27,0x1050,0x153b))){if(!_0x4b34d7)return _0x5e771e(''+_0x55432c[_0x425890(0x1b41,0x1277,0x15ce,0x1297)]);if(!_0x54c8a0[_0x425890(0x4d4,0x807,0x68c,0xd71)])return _0x295ea5[_0x425890(0xfaa,0xe89,0xf7c,0x918)](_0x3e009a,_0x425890(0x39a,0xb04,0x1585,0x46f)+_0x425890(0x7d4,0x744,0x239,0x70e));if(!_0x5b636b[_0x425890(0x7aa,0x807,0xeff,0xbf8)][_0x17318e(0x1260,0x1f37,0x2244,0x17d1)])return _0x2e7968(_0x17318e(0xdaa,0x583,0x1047,0xa31)+_0x425890(0xae8,0x2f5,0x42a,-0x418));let _0x1ca713=_0x141960[_0x17318e(0xf90,0x1243,0x3ec,0xa24)]['fileSha256'][_0x17318e(0xf30,0x146e,0x14b7,0xbe9)](_0x295ea5[_0x17318e(0x2138,0x191a,0xf5f,0x17c0)]);if(!_0x295ea5[_0x425890(0x1144,0x1001,0x5a9,0x647)](_0x1ca713,_0x41a687['db'][_0x17318e(0xe6e,0x137c,0xcef,0xced)][_0x425890(0xd5e,0xe57,0xe81,0x183d)]))return _0x295ea5[_0x425890(0x298,0x722,-0x2f3,0x313)](_0x104619,_0x425890(0x140e,0x141a,0xbea,0x1589)+'ound\x20In\x20Th'+_0x17318e(0x459,0xe79,0x901,0x483));_0x5f5981['db'][_0x17318e(0x791,0xf69,0xec0,0xced)][_0x425890(0x3d5,0xe57,0x12c8,0xbb9)][_0x1ca713][_0x17318e(0x93a,0x54b,0x1155,0xc97)]=!/^un/i[_0x17318e(0x142f,0x5a7,0xd39,0xfa3)](_0x262091),_0x295ea5['IAGoL'](_0x388a95,_0x295ea5[_0x425890(0x176c,0xe48,0x1053,0x4c4)]);}else{if(q[_0x425890(-0xfc,0x291,-0x703,0xabf)](_0x295ea5[_0x425890(0xa78,0x7b2,0x10cc,0xc1b)]))return _0x295ea5[_0x425890(0xd1e,0xdc5,0x9b1,0x1536)](_0xcd1d32,examkosong);!isDarah&&addInventoriDarah(_0x17aa6d[_0x425890(0x73b,0xa69,0xd25,0xe65)],DarahAwal);if(_0x295ea5[_0x17318e(0x13cc,0x7aa,0x1103,0xcf6)](isCekDarah,0x3f*0x7e+0xe0d+0x1687*-0x2))return _0x295ea5[_0x425890(0xb53,0x6bc,0x91e,0x5dc)](_0xcd1d32,'Your\x20Blood'+'\x20Is\x20Gone,\x20'+_0x425890(0x154d,0xb48,0x8c0,0xc20)+_0x17318e(0x162f,0x717,0x108f,0xe08)+_0x17318e(0x140b,0x1bb9,0x81a,0x11f3));!isInventoriBuruan&&addInventoriBuruan(_0x17aa6d[_0x17318e(0xfd6,0x3b4,0xd32,0xc86)]);let _0x199b24=[_0x295ea5[_0x17318e(-0x152,0xddd,0x543,0x4eb)],_0x295ea5[_0x425890(0x8dc,0x128b,0x194a,0x184e)],_0x295ea5[_0x17318e(0xc8f,0xa15,-0x1f1,0x6f0)],_0x425890(0x1828,0x14de,0x12a4,0x13ae)+'l',_0x17318e(0x950,0x36c,0xb87,0x5ce)+_0x17318e(0xbbc,0xb23,0x154b,0xcec),_0x295ea5[_0x425890(0x15e5,0x1005,0x191d,0x886)]],_0x2cd04f=[_0x295ea5[_0x425890(0x9b1,0x10f9,0x16f5,0xc8e)],_0x295ea5[_0x425890(0x1088,0xa95,0xd6e,0x116a)],_0x295ea5[_0x17318e(0x1245,0x162e,0xe14,0xbb8)],'Meadow',_0x295ea5[_0x425890(0x13ea,0xcaf,0xa7d,0x22d)],_0x295ea5[_0x425890(0xe96,0x6b4,0x164,-0x32c)]];var _0x377be5=Math[_0x17318e(0xb72,0xc24,0xbfc,0xb6b)](_0x295ea5[_0x17318e(0xbb0,0x49a,0xf80,0x5f3)](Math[_0x425890(0xa32,0x92e,0xf27,0x328)](),-0x3*0x5db+-0x71*0x1c+0x1df7)),_0x3386d8=Math[_0x425890(0xfb8,0x94e,0xaf2,0x98)](_0x295ea5[_0x17318e(0x10d1,0x4a4,0x4c3,0xa22)](Math[_0x425890(0x80a,0x92e,-0x21,0x999)](),-0x2522+0x1cf*-0x1+0x26f9)),_0x5e6153=Math[_0x17318e(0x1499,0x153d,0xe5d,0xb6b)](_0x295ea5[_0x17318e(-0x58,0xc03,0x55e,0x796)](Math[_0x17318e(0x89a,0x125a,0x9dd,0xb4b)](),0x1894+-0x16d9+-0x4*0x6d)),_0x46c64d=[-0x19db+-0x1*-0x1b3d+-0x15f,-0x8d*-0x33+0x189c+-0x34b3,-0x3*0x7c7+-0x266b+0x3dc4,0x2004*-0x1+0x29d*0x2+0xfe*0x1b,0xc4f+-0xcf+0x1*-0xb7b,-0x3d*0x67+-0x16d3+0x2f62,-0x4*0x125+-0xfc2+0x145c,0x25f*-0x7+0x6*-0x183+-0x1*-0x19ab,0x7*0x592+-0x1439+0x962*-0x2,-0x24f3+-0x23a3+0x4896,0x233a+0x89+0x1*-0x23c1,0xa*0x262+0x2515+0xa*-0x617,0x1d7c+-0x1621+-0x75b,0x152e+-0x1*0x12ce+0x5*-0x79,-0x16*-0x1a5+0x27*0x3e+-0x2da0,-0xc*-0x23b+0x47d*0x7+-0xb*0x54a],_0x4c7129=[-0x3a*-0x4e+0x1ba*0x16+-0x37a6,-0x1470+0x1f35+-0x3*0x397,-0x32*-0x97+0x33*-0x56+-0xc59,0x1db+-0x1a72+0x5*0x4eb,0xb3a*-0x2+-0x164a+0x11*0x2a2,-0x737+-0x1bcb+0x2*0x1181,-0x2*0xd1+0x5a4+-0x3fd,0x20e*0x4+-0x112a+-0x2*-0x479,-0x2*0xc23+-0x1df0+0x3637,0x1*-0x229f+0x23c5+-0x93*0x2,-0xbf+0x1a9d+-0x19dc,0x848+0x10c2+-0x190a,0x23a3+-0x1*0xf9b+-0x1*0x1405,-0x1*0x24e6+0x1869+0xc7d,0x22f1+0x420+-0x2710],_0xbc7827=[0x8*-0x4a9+0x1f8f+0x5ba,-0x6*0x32f+0x8*0x453+-0xf7e,0x5b*0x5+-0x16a*-0x7+-0xba9,0x1e7b+0x57b*0x3+-0x2eec,-0x3*-0x3a5+0x1ec3+0x536*-0x8,0x1999*0x1+-0x10*0x12e+-0x6b9*0x1,-0x1097*-0x1+-0x23ce+0x1338,-0x5cc+-0x1*-0x2585+-0x1*0x1fb9,-0x266*0x1+-0x1443+0x7*0x33d,-0x9*-0x206+-0x1bec+0x33d*0x3,-0x26a1+0x6fd*-0x1+-0x2da1*-0x1,-0x4ca+0x26d6+0x883*-0x4,0xa9f+-0x189b*0x1+0xdfd],_0x726736=_0x46c64d[Math[_0x17318e(0xc16,0xd3d,0x1a2d,0x1632)](_0x295ea5[_0x425890(0x1064,0x805,0x169,0x8e8)](Math[_0x17318e(0x7c4,0x13ad,0x12e1,0xb4b)](),_0x46c64d[_0x17318e(0xb91,0xc4d,0xc9,0xad9)]))],_0x57a6d8=_0x4c7129[Math[_0x425890(0x1a4d,0x1415,0x1167,0x1b58)](_0x295ea5[_0x425890(-0x52d,0x2fc,0xb85,-0x55b)](Math[_0x425890(0x63d,0x92e,0x13aa,0xb36)](),_0x4c7129['length']))],_0x38de07=_0xbc7827[Math[_0x17318e(0xfcb,0x1d7e,0xc60,0x1632)](_0x295ea5['knnig'](Math['random'](),_0xbc7827[_0x425890(0x119f,0x8bc,0x4c0,0x4f4)]))],_0x5bb87d=_0x199b24[Math[_0x425890(0x1924,0x1415,0x127c,0xa67)](_0x295ea5[_0x425890(0xb45,0xce6,0x1542,0xbc1)](Math[_0x17318e(0x4e5,0xb2a,0x550,0xb4b)](),_0x199b24[_0x17318e(0x1101,0xf7f,0x155,0xad9)]))],_0x432908=_0x2cd04f[Math['floor'](_0x295ea5['bCLRx'](Math['random'](),_0x2cd04f[_0x425890(0x109e,0x8bc,0xb9d,0xdaf)]))];if(_0x295ea5[_0x425890(0xe9e,0xa15,0x677,0xc5d)](_0x432908,_0x295ea5[_0x17318e(0xe52,0x1aa7,0xde2,0x1316)])){if(_0x295ea5['CRMZB'](_0x295ea5[_0x425890(0x1893,0x1544,0x1382,0x12ea)],_0x295ea5[_0x425890(0xbf5,0x1544,0xdae,0x137c)]))var _0x2115db=_0x295ea5['dkkTy'];else _0x27581f[_0x425890(0x773,0x36a,0xd07,0x4a4)](_0x295ea5[_0x425890(0x1077,0xb6c,0x15f7,0xa07)](_0x295ea5[_0x425890(0xec8,0x129a,0x1081,0x14b3)],_0x497232[_0x17318e(0xf69,0x8e5,0x9e,0xa67)])),_0x35a77a(_0x295ea5[_0x17318e(0x12b7,0x5e1,0x1909,0xe8d)](_0x17318e(0x428,0xfc1,0x9f2,0xc39)+_0x425890(0x4d1,0xb90,0x336,0xf19),_0x1f25c1[_0x10663d['sender'][_0x425890(-0xf8,0x2eb,-0x15f,-0x6fe)]('@')[0x22ab+0xa65*-0x1+-0xef*0x1a]])),delete _0x180d7b[_0x33b143[_0x425890(0x1319,0xa69,0x1400,0x33f)][_0x17318e(0x14b,0xaec,0x1ea,0x508)]('@')[-0x1a5f*-0x1+-0xfe9*0x1+-0xd*0xce]];}else{if(_0x295ea5[_0x17318e(0xf39,0xf17,0xdd8,0xc15)](_0x432908,_0x295ea5[_0x425890(0xfd7,0xa95,0xe04,0x86)]))var _0x2115db=_0x295ea5[_0x425890(0x1139,0x100a,0x8b2,0xd9b)];else{if(_0x295ea5['keQvc'](_0x432908,_0x295ea5['NopfZ']))var _0x2115db=_0x295ea5[_0x17318e(0x12e6,0x1645,0x128c,0xdf5)];else{if(_0x295ea5[_0x17318e(0x38d,0xea0,0x69e,0x465)](_0x432908,_0x17318e(0xa0b,0xc0d,0x948,0xd4e))){if(_0x295ea5[_0x425890(0x287,0x41d,0x83e,-0x3b6)](_0x295ea5[_0x17318e(0x1673,0x1197,0xdbe,0x1253)],_0x295ea5[_0x17318e(0x1f81,0x16d1,0x129a,0x1665)]))var _0x371d38=_0x295ea5[_0x17318e(0x19b2,0x12d5,0x1266,0x1675)];else var _0x2115db=_0x295ea5['ffYMo'];}else{if(_0x432908===_0x295ea5[_0x17318e(0x1717,0xd45,0x17b6,0xecc)])var _0x2115db=_0x295ea5[_0x425890(0xd6d,0xc9a,0x1656,0x16c8)];else{if(_0x295ea5[_0x425890(0x17ac,0xf71,0x124f,0x17c3)](_0x432908,_0x295ea5['zEACd']))var _0x2115db=_0x295ea5['JznBv'];}}}}}setTimeout(()=>{function _0x1b0a27(_0x55f90f,_0x4fa07c,_0x353c2f,_0x5888a8){return _0x425890(_0x5888a8,_0x353c2f-0x205,_0x353c2f-0x149,_0x5888a8-0x5d);}const _0x30867a={'XAVUG':function(_0x338db7,_0x148b99){return _0x295ea5['jAYHg'](_0x338db7,_0x148b99);}};function _0x513569(_0x543dca,_0x4577b8,_0x5e1911,_0x522d4d){return _0x425890(_0x4577b8,_0x543dca-0x11,_0x5e1911-0x43,_0x522d4d-0x1da);}if(_0x295ea5['AdXyH'](_0x1b0a27(0x1315,0x15f4,0x1080,0x655),_0x295ea5['QvSrc']))_0x1da870(_0x1b0a27(0xb5e,0xae9,0x11ac,0x7b4)+_0x15bb8c[_0x1b0a27(0x35c,0xbe3,0xa70,0x1)]+(_0x513569(0x163,0xbf1,-0x8f0,0x3c2)+_0x1b0a27(0x867,0x937,0xbbf,0x179)+_0x513569(0x8b1,0xa28,0x1002,0xde3)+_0x513569(0x136b,0x1791,0xf29,0x13a1)+_0x1b0a27(0x1f4,0x7f5,0x3a9,-0x8e)+'nds,\x0aYou\x20s'+_0x1b0a27(0x53b,0xe9b,0x455,-0x22a)+_0x1b0a27(0x667,0x110b,0x7b7,0xd25)+_0x513569(0x1449,0x186c,0xc1a,0x1a87)+_0x513569(0x12b5,0xe46,0x181b,0x946)+_0x513569(0x958,0x184,0x2f8,0xb7d)+_0x513569(0xede,0x162e,0xba1,0xd3b)+'t\x20refreshi'+_0x513569(0x11f1,0x1734,0x1879,0x17bc)+'arting\x20tim'+_0x513569(0x86d,0x8fc,0x2ac,0xec1)+_0x513569(0x2a0,-0x3e2,0x8fb,-0x7c8)+'to\x20replies'+_0x513569(0x3ed,-0x105,0x52b,0x46a)+_0x1b0a27(0x156e,0x6d2,0xd96,0x5d6)+_0x1b0a27(0x13f3,0x178b,0x15cf,0x1246)+_0x513569(0x1133,0x117c,0x116a,0xff7)+_0x1b0a27(0x1c3,0x1ad,0x6db,0xfc5)+_0x1b0a27(0x7b2,0xe88,0x958,0x1055)+_0x1b0a27(0x19f6,0x77f,0xf5a,0x1682)+_0x1b0a27(0x123e,0x1ff6,0x173e,0x1736)+'ot\x20owner.')),_0x30867a['XAVUG'](_0x3baead,_0x513569(0x3a6,0xd5c,0x32,0x520)+_0x187b83[_0x513569(0x87c,-0x5a,0x31f,0x1190)]+(_0x1b0a27(0x1006,0x560,0x96e,0x39b)+_0x1b0a27(0x27a,-0x2f7,0x5f1,0xbfa)+_0x1b0a27(0x13ae,0x1010,0x1684,0x1e47)+_0x513569(0xd25,0xe9b,0x169b,0x13cd)+_0x513569(0xf36,0xa77,0xdb3,0x1825)+'\x20භාවිතා\x20කර'+'නවානම්\x20එය\x20'+_0x1b0a27(0x83,0x545,0x7b9,0x5d8)+_0x1b0a27(0xf61,0x16ef,0x135e,0xd73)+'තුය.\x0aඑසේ\x20න'+_0x1b0a27(0x178a,0xea3,0x15d5,0x14c7)+_0x513569(0x375,0x7b4,-0x634,0x7b3)+_0x513569(0x78c,0x8dd,0x10cc,0x8a)+_0x1b0a27(-0x364,0x9de,0x384,-0x1d6)+_0x1b0a27(0x7ce,0x11e0,0xc81,0xa25)+'බ\x20යැවූ\x20විධ'+_0x513569(0xfe0,0x56a,0x1222,0xc9a)+_0x1b0a27(0xa65,0x1526,0x1084,0xfcd)+_0x1b0a27(0x1727,0x875,0xdd6,0xe8b)+_0x1b0a27(0x2257,0x2068,0x17f0,0x1296)+_0x513569(0xb5e,0x96b,0x1363,0x8a6)+_0x513569(0x4d4,0x1f4,0xc74,-0x2d0)+'තිකරු\x20හට\x20ප'+'මණක්\x20වලංගු'+_0x513569(0x1282,0x1a11,0x9cf,0x1181)));else{let _0x17e42d=_0x1b0a27(-0x487,0x5c2,0x398,0x3e7)+'SULT\x20]_\x0a';_0x17e42d+=_0x513569(0x908,0x11d,0x4aa,0xae0)+_0x377be5+'\x0a',_0x17e42d+=_0x513569(0x426,0x5b5,-0x503,0x732)+_0x513569(0x810,0xb39,0x250,0xe6e)+_0x3386d8+'\x0a',_0x17e42d+=_0x1b0a27(0x188b,0x72e,0xe5c,0x94f)+':\x20'+_0x5e6153+'\x0a',_0x17e42d+=_0x1b0a27(0x947,0x11b6,0x11af,0x1983)+'\x20'+_0x726736+'\x0a',_0x17e42d+=_0x513569(0x1334,0x125e,0x9c5,0x171a)+_0x57a6d8+'\x0a',_0x17e42d+=_0x1b0a27(0x8fa,0x1107,0xa5e,0x1f9)+_0x513569(0x1054,0x7cb,0x1640,0xd36)+_0x38de07+'\x0a\x0a',_0x17e42d+=_0x1b0a27(0x13b9,0xa37,0x922,0x1178)+'\x0a',_0x17e42d+=_0x1b0a27(0x1205,0x19bd,0x1489,0x1973)+_0x513569(0x810,0x1113,-0x14d,0xaf8)+_0x432908+'\x0a',_0x17e42d+='*Wounded*\x20'+':\x20'+_0x5bb87d+(_0x1b0a27(0xd31,0x50d,0x8ac,0x9e7)+_0x1b0a27(0x19f2,0x12cc,0x1744,0x1748)),_0x17e42d+=_0x513569(0xc63,0x1014,0x144c,0xb05)+_0x513569(0x199,-0x6f3,0x16b,0x219)+_0x295ea5['nsJYP'](getDarah,_0x17aa6d[_0x513569(0xa7a,0x21d,0xeca,0xaf5)])+'\x0a';let _0x10c9cd=[{'buttonId':''+_0x295ea5[_0x513569(0xd78,0x1431,0x126d,0xc11)](_0x4fea53,_0x1cbc75),'buttonText':{'displayText':_0x295ea5['zYbhU']},'type':0x1}];const _0x26c144={};_0x26c144['url']=_0x2115db;const _0x5898fe={};_0x5898fe[_0x1b0a27(-0x36b,0x29,0x586,0x39d)]=_0x26c144,_0x5898fe[_0x513569(0x31b,0x17c,0x58f,-0x316)]=_0x17e42d,_0x5898fe['footer']=_0x2cbadb,_0x5898fe[_0x513569(0xf72,0x174a,0x7e6,0x1046)]=_0x10c9cd,_0x5898fe[_0x513569(0x1000,0xf73,0xc09,0xeb2)]=0x4;let _0x5a01c2=_0x5898fe;const _0x414ff2={};_0x414ff2['quoted']=_0x17aa6d,_0x3797bd['sendMessag'+'e'](_0x146a84,_0x5a01c2,_0x414ff2);}},-0xbde+0xaeb+-0x2ed*-0x7),setTimeout(()=>{function _0x45f895(_0x8d280b,_0x4e85e2,_0x1ed07b,_0x5bbaba){return _0x425890(_0x8d280b,_0x4e85e2-0x2e6,_0x1ed07b-0x121,_0x5bbaba-0x195);}function _0x355eb6(_0x3bc102,_0x45d308,_0x454363,_0x57a351){return _0x425890(_0x3bc102,_0x454363-0x61,_0x454363-0x123,_0x57a351-0xa);}const _0x3f9c2a={'tHvSW':function(_0x17b993,_0x297f4c){return _0x295ea5['IAGoL'](_0x17b993,_0x297f4c);},'cegYo':function(_0x48249a,_0x3a007b){function _0x3ba4a1(_0x21cb92,_0x536ef4,_0xe244ea,_0x281d2d){return _0x5492(_0xe244ea-0x270,_0x281d2d);}return _0x295ea5[_0x3ba4a1(0x121b,0xd7d,0x13f7,0x1cac)](_0x48249a,_0x3a007b);},'babbt':function(_0x5f1a05,_0x4ec4bd){function _0xdd7956(_0x4825d5,_0x23b71e,_0x434a95,_0x390368){return _0x5492(_0x4825d5- -0x3b6,_0x23b71e);}return _0x295ea5[_0xdd7956(-0x295,-0xbef,-0x804,-0x228)](_0x5f1a05,_0x4ec4bd);},'rCQqQ':_0x295ea5[_0x45f895(0xede,0xd64,0xb57,0xb9d)]};if(_0x295ea5['VApfB'](_0x355eb6(0x639,0xc9c,0x7ec,0x961),_0x295ea5['heGoK'])){if(!_0x586d52[_0x355eb6(-0x2df,0x8a3,0x376,0x154)])return _0x3f9c2a[_0x45f895(0xe4b,0xfd5,0x1924,0x130a)](_0x64db50,''+_0x56008e[_0x355eb6(0xbe1,0x1ed,0xa4e,0x129c)]);if(!(_0x2678d6['chat']in _0x15b8e0))return _0x3f9c2a[_0x355eb6(0x307,0x5c2,0x1c8,-0x6cb)](_0x270261,_0x45f895(0xcfb,0x6a5,0xe3d,-0x256)+_0x45f895(0xb92,0xcbe,0xd6a,0x582)+'Group!*_\x0a\x0a'+'*'+_0x344dcd+(_0x355eb6(0xa9c,0xa1c,0xabf,0x12f4)+'\x20Start\x20Vot'+_0x45f895(0x1820,0x113b,0x15b0,0x18ce)));delete _0x5aa2a0[_0x4bd70a[_0x45f895(0xb44,0xfad,0xbd3,0x16be)]],_0x3f9c2a['babbt'](_0x35e0d2,_0x3f9c2a['rCQqQ']);}else _0x295ea5[_0x45f895(0xd88,0x7ae,-0x19,0xcc3)](_0xcd1d32,'@'+_0x17aa6d[_0x355eb6(0x241,0xffa,0xaca,0x10f9)][_0x45f895(0x7f,0x5d1,0x759,-0x33)]('@')[-0xb6+-0x1b2b+-0x1*-0x1be1]+('\x20Started\x20H'+'unting\x20In\x20')+_0x432908);},0x10f+-0x20d6+0x23af),_0x295ea5[_0x425890(0x19b4,0x11c6,0x1c5a,0x8f7)](addIkan,_0x17aa6d[_0x425890(0xba8,0xa69,0xafa,0x4c3)],_0x377be5),_0x295ea5[_0x17318e(0xcdf,0xd9e,0xaf3,0x717)](addAyam,_0x17aa6d[_0x425890(0x1392,0xa69,0xe9a,0xc56)],_0x3386d8),_0x295ea5[_0x17318e(0x4e1,0x8dd,0x1787,0xea4)](addKelinci,_0x17aa6d['sender'],_0x5e6153),_0x295ea5[_0x425890(0x5e1,0xb12,0x1561,0x1548)](addDomba,_0x17aa6d[_0x425890(0xd46,0xa69,0xa43,0x39e)],_0x726736),_0x295ea5['JceUG'](addSapi,_0x17aa6d[_0x425890(0x130,0xa69,0x10bb,0x13b9)],_0x57a6d8),_0x295ea5[_0x425890(0x3ea,0x13d,0x4be,0x712)](addGajah,_0x17aa6d[_0x425890(0x53,0xa69,0x41b,0xc26)],_0x38de07),_0x295ea5['NbbnX'](kurangDarah,_0x17aa6d[_0x425890(0x186,0xa69,0x44c,0x550)],-0x2037+0x15d2+0x1*0xa6f);}}break;case _0x295ea5['Bfdxf']:{let _0x4b5c7f=global['db']['data'][_0x17318e(0x177d,0xbe3,0x514,0xf73)][_0x17aa6d['sender']];_0x4b5c7f[_0x425890(0x321,0x187,-0x463,0xb06)]=+new Date(),_0x4b5c7f['afkReason']=_0x116129,_0xcd1d32(_0x17aa6d[_0x425890(-0x2ef,0x634,0x957,0xe84)]+('\x20Has\x20Gone\x20'+_0x425890(0x78a,0x6de,0x3b4,0x81c)+'e')+(_0x116129?':\x20'+_0x116129:''));}break;case _0x295ea5['rTmBI']:case _0x295ea5[_0x17318e(0xcd2,0x1698,0x203e,0x15b5)]:case _0x295ea5[_0x17318e(0x1c9e,0xcf3,0xc3a,0x15b7)]:{let _0x12f4dc=_0x295ea5[_0x425890(0xfa0,0xcd4,0x584,0x6b6)](require,_0x295ea5['lKZtR']);this[_0x425890(0x5e0,0xf0d,0xd4e,0xbcb)]=this[_0x425890(0xaae,0xf0d,0x124e,0x12a6)]?this[_0x17318e(0xebc,0x134e,0x1392,0x112a)]:{};if(Object['values'](this[_0x17318e(0x133d,0x16ef,0x1b07,0x112a)])[_0x17318e(0x1d70,0x1dcd,0x112a,0x13ce)](_0x37ae16=>_0x37ae16['id'][_0x425890(0x14d,0x436,0x4b9,0x723)](_0x425890(0x703,0xea4,0x1450,0x999))&&[_0x37ae16['game'][_0x17318e(0x1584,0x1627,0x1226,0xf0d)],_0x37ae16['game']['playerO']]['includes'](_0x17aa6d['sender'])))return _0x295ea5[_0x17318e(0x1199,0x974,0x1024,0x10e9)](_0x51481c,_0x17318e(0x1065,0x8b2,0x9b9,0x880)+'ill\x20In\x20The'+'\x20Game');let _0x50c052=Object[_0x17318e(0xe4a,0xd6a,-0x14e,0x5b6)](this[_0x425890(0x14db,0xf0d,0x72e,0x9b1)])['find'](_0x36028f=>_0x36028f['state']==='WAITING'&&(_0x116129?_0x36028f[_0x17318e(0x73e,0x175e,0xb4a,0x109f)]===_0x116129:!![]));if(_0x50c052){_0x295ea5[_0x425890(0x4d5,0x4fe,0x5ab,0x6ad)](_0xcd1d32,'Partner\x20fo'+_0x425890(0x19d7,0x100c,0x1224,0x1450)),_0x50c052['o']=_0x17aa6d[_0x17318e(0xaa6,0x1851,0x18df,0xee4)],_0x50c052[_0x425890(0x735,0xf0d,0x11d7,0x12aa)][_0x425890(0x5a3,0xba4,0xe53,0xb9c)]=_0x17aa6d['sender'],_0x50c052[_0x425890(0x84b,0x1226,0x165c,0x1b56)]=_0x295ea5['ELilP'];let _0xb13c06=_0x50c052[_0x17318e(0x1621,0x825,0x1546,0x112a)]['render']()[_0x17318e(0xe78,0x9df,0xc31,0xd8c)](_0x2fc109=>{function _0x526568(_0x37a53f,_0x58986b,_0x10653b,_0x30a559){return _0x425890(_0x30a559,_0x10653b-0x16f,_0x10653b-0x1ee,_0x30a559-0x33);}function _0x4580c4(_0x461d13,_0x5412f9,_0x5c9f00,_0xe262e4){return _0x425890(_0x5c9f00,_0x5412f9-0x207,_0x5c9f00-0x193,_0xe262e4-0x112);}if(_0x295ea5[_0x526568(0x1cf8,0x1e98,0x15aa,0xf02)](_0x4580c4(0x1464,0x1152,0x80c,0x1643),_0x4580c4(0x104c,0x12c2,0xcdf,0xfe0))){if(_0x9b5c7f){const _0x19debc=_0x3c431e[_0x4580c4(0x167,0x9fa,0x1081,0x109e)](_0x4cc58f,arguments);return _0x31e713=null,_0x19debc;}}else{const _0x149303={};return _0x149303['X']='❌',_0x149303['O']='⭕',_0x149303['1']=_0x295ea5[_0x4580c4(0x107d,0x85b,0xac3,0xbdd)],_0x149303['2']=_0x295ea5['Gqows'],_0x149303['3']=_0x295ea5['YRXhA'],_0x149303['4']=_0x295ea5['zJyCh'],_0x149303['5']=_0x295ea5['HaHFN'],_0x149303['6']=_0x295ea5[_0x526568(-0x13,0xa2a,0x80b,0xfd4)],_0x149303['7']=_0x295ea5[_0x526568(0x1c83,0x1971,0x1381,0xd2a)],_0x149303['8']=_0x295ea5[_0x526568(0x1a48,0x1bd6,0x11ba,0x7dd)],_0x149303['9']=_0x295ea5[_0x4580c4(0x867,0x1266,0x13d6,0xe91)],_0x149303[_0x2fc109];}}),_0x44f2c3=_0x425890(0x1a6,0x677,0xe09,0x696)+_0x50c052['id']+'\x0a\x0a'+_0xb13c06[_0x425890(0x7a1,0x10c8,0xe79,0x9c4)](0x79f*-0x4+-0x1*0x1de6+0x3c62,-0x7f*-0x4c+0x1fd*-0xe+-0x9db)['join']('')+'\x0a'+_0xb13c06[_0x17318e(0x8df,0xf49,0x1406,0x12e5)](0x5*0x41+-0x9e9*0x3+0x1c79*0x1,0x1141+-0xe*-0x2c7+-0x41*0xdd)[_0x17318e(0x458,0x75a,0x3a1,0x712)]('')+'\x0a'+_0xb13c06[_0x17318e(0x1d18,0x1b01,0x18fd,0x12e5)](-0x1*0x25a4+-0x2*0xc9+-0x36*-0xba)[_0x17318e(0x4e7,0x674,0xd36,0x712)]('')+('\x0a\x0aWaiting\x20'+'@')+_0x50c052[_0x17318e(0xa28,0x1288,0x18c6,0x112a)][_0x17318e(0x13e5,0xf53,0x1497,0x1568)+'n'][_0x425890(0xaa7,0x2eb,-0x378,0x182)]('@')[0x22fb+0x1*-0x250c+0x211]+(_0x425890(0x98c,0x12d1,0xcdb,0xa20)+_0x17318e(0x17c1,0x18c4,0x1d6c,0x165e)+_0x17318e(0xfc6,0xb1a,0x34c,0x8f5)+_0x425890(0x747,0xe28,0xede,0xf43)+_0x425890(0xaa0,0x1c4,0xbbc,-0x549));if(_0x295ea5[_0x425890(0x1366,0xfde,0x1683,0x192d)](_0x50c052['x'],_0x50c052['o']))await _0x3797bd['sendText'](_0x50c052['x'],_0x44f2c3,_0x17aa6d,{'mentions':_0x295ea5['WPpIK'](parseMention,_0x44f2c3)});await _0x3797bd[_0x17318e(0x142e,0x163a,0x15c3,0x14cf)](_0x50c052['o'],_0x44f2c3,_0x17aa6d,{'mentions':_0x295ea5['qICNW'](parseMention,_0x44f2c3)});}else{_0x50c052={'id':_0x295ea5[_0x17318e(0x10db,0x13ae,0x1a50,0x130b)](_0x295ea5['BAvTl'],+new Date()),'x':_0x17aa6d['chat'],'o':'','game':new _0x12f4dc(_0x17aa6d[_0x17318e(0xec2,0x7e7,0xb37,0xc86)],'o'),'state':_0x295ea5[_0x17318e(0x995,0x10b1,0x1492,0x1248)]};if(_0x116129)_0x50c052[_0x425890(0x159f,0xe82,0x5f8,0x7b2)]=_0x116129;_0xcd1d32(_0x295ea5[_0x425890(0x5ee,0x526,0xe21,0x7c1)](_0x295ea5[_0x17318e(0xcb6,0xc74,0xc91,0x1358)],_0x116129?_0x425890(0x3b6,0x64b,0x341,-0x15a)+_0x425890(0x144d,0xe8e,0xa53,0x109a)+_0x17318e(0x5e6,0x7f4,0x9c3,0xae9)+_0x4fea53+_0x1cbc75+'\x20'+_0x116129:'')),this['game'][_0x50c052['id']]=_0x50c052;}}break;case _0x17318e(0x140b,0x7ec,0xcfe,0xa44):case _0x425890(0x1bd1,0x1447,0x14ed,0xccc):{this[_0x17318e(0x9df,0x1878,0x16a3,0x112a)]=this['game']?this['game']:{};try{if(_0x295ea5['WxGZE']===_0x295ea5[_0x425890(0xb07,0x864,0xa66,0x4d0)]){if(this['game']){if(_0x295ea5['vjPie'](_0x295ea5['qHSuZ'],_0x295ea5[_0x17318e(0xcf0,0x17f9,0x1462,0x1201)]))delete this[_0x425890(0x11d0,0xf0d,0xef8,0x11f3)],_0x3797bd[_0x425890(0x1144,0x12b2,0x1431,0xfc1)](_0x17aa6d['chat'],_0x17318e(0x1273,0xebf,0xa1f,0x12e2)+'ly\x20Deleted'+_0x17318e(0x1547,0x1050,0x1eb,0xbba)+_0x17318e(0x1031,0x110e,0x507,0xa25)+'on',_0x17aa6d);else{_0x34b809['pilih']=_0x4862d9[_0x17318e(0x51f,0x6c7,0x142d,0xbd6)](_0x49fd57['text']['toLowerCas'+'e']())[0x8*-0x10f+-0x1181+-0x6d*-0x3d],_0x13178e[_0x17318e(0xa3b,0x4f,0x789,0x405)]=_0x2cbea6[_0x425890(-0x5a,0x1e8,0x93,0x78b)],_0x122fe6(_0x17318e(0x1372,0xbe9,0x19c8,0x11d8)+_0x17318e(0x18f9,0x153b,0x1327,0x178b)+_0x43b393['text']+'\x20'+(!_0x1e214e['pilih2']?_0x17318e(0xca8,0x8dc,0x637,0x6ef)+'For\x20The\x20Op'+_0x425890(0x973,0xa07,0x367,0xaea)+_0x17318e(0x1303,0x1bcc,0x1434,0x12e0):''));if(!_0x598663[_0x425890(0x1420,0xafe,0x1129,0x8e9)])_0x3e783f[_0x425890(0x1390,0x12b2,0xce3,0x1bc8)](_0x45852a['p2'],_0x17318e(0x19f,0x1211,-0x7b,0x9de)+_0x425890(0x15a7,0x1031,0xc5d,0x165a)+_0x425890(0x8df,0x886,0x573,0xb01)+'It\x20Is\x20Your'+_0x17318e(0xbdf,0x11d6,0x1780,0x1639),-0x5*-0x543+-0x47c+-0x15d3);}}else{if(!this['game']){if(_0x295ea5[_0x425890(0x16c4,0xe0a,0xf63,0x7b7)]===_0x295ea5[_0x17318e(0xec0,0x15e8,0x140c,0x1027)])_0xcd1d32('TicTacToe🎮'+_0x17318e(0xd87,0x18f9,0x1054,0x1726)+_0x425890(0x1376,0x13b9,0x167f,0xd95)+_0x17318e(0xebe,0x1a8c,0xe5e,0x1354));else{let _0x3dbbf9=_0x140d73&&/\d+\-\d+@g.us/[_0x17318e(0x121c,0x1496,0xc45,0xfa3)](_0x32861e[-0x99*-0x3a+0x83*0x4c+-0x498e])?_0x2222b3[-0x178d+-0xadb+0xb78*0x3]:_0x52696d[_0x17318e(0x14d6,0x68d,0x741,0xee4)],_0x2147ff=[..._0x3ce6f5[_0x17318e(0x410,0x1158,0xd7c,0xe78)](_0x3af449[_0x17318e(0xb24,0x7f3,0xb94,0x1056)][_0x3dbbf9]),_0x5c288f];_0x29c009[_0x17318e(0xd6b,0xf2d,0x1baa,0x14cf)](_0x445b81[_0x425890(0x401,0xcc7,0xac2,0xe69)],_0x295ea5[_0x17318e(0xef2,0x15,0x771,0x92e)](_0x295ea5[_0x425890(0x1016,0x12f1,0x173c,0x1638)],_0x2147ff[_0x17318e(0x16f8,0x3de,0x156d,0xd8c)](_0x35c898=>_0x425890(0xf3d,0xc75,0x853,0x1279)+_0x35c898[_0x17318e(0x2a,0x15a,0x1103,0x82e)](/@.+/,''))[_0x425890(0xf28,0x4f5,-0x4f4,0x683)]`\n`),_0x3bc1c2,{'mentions':_0x2147ff});}}else _0x295ea5[_0x17318e(0x1414,0x1058,0x595,0x981)](_0xcd1d32,'?');}}else return _0x295ea5[_0x425890(0x1bd8,0x143b,0xc6a,0x16a2)](_0x32fa5e,this['a'])?this['b']:_0x295ea5['dhHAc'](_0x11d1cd,this['b'])?this['a']:'';}catch(_0x51c5a4){_0x295ea5[_0x425890(0x190e,0x1457,0x120c,0x119b)](_0xcd1d32,_0x425890(0x13ad,0xb1b,0x6e3,0x5dd));}}break;case _0x295ea5[_0x425890(-0x4e2,0x227,0xa1e,0xa02)]:case _0x295ea5['MWYkF']:{this[_0x17318e(0x556,0xb1a,0x9fb,0x55a)]=this[_0x425890(0x1a6,0x33d,-0xb5,0x805)]?this[_0x425890(0x968,0x33d,0x66,0xb14)]:{};let _0x1c2802=-0x270c+0x94f+0x1dc7,_0x2765c5=-0x1*-0x745+-0x54*0x57+0x141*0x11,_0x42a1e4=-0x9ffc+-0x6bcc+-0x1f628*-0x1;if(Object[_0x17318e(0x780,-0x2d,0xee6,0x5b6)](this[_0x17318e(0xbe7,0xce6,-0x358,0x55a)])[_0x425890(0xcd5,0x11b1,0x195a,0x1c08)](_0x187665=>_0x187665['id'][_0x17318e(0xeb0,-0x1,-0xb,0x653)]('suit')&&[_0x187665['p'],_0x187665['p2']][_0x425890(-0x559,0x291,-0x475,-0x2ec)](_0x17aa6d['sender'])))return _0x295ea5[_0x425890(0x348,0xbfa,0x1639,0x110a)](_0x51481c,_0x17318e(0x1b96,0xaa6,0x827,0x1187)+_0x17318e(0x16ed,0x175d,0x10ff,0x1070)+'us\x20Suit');if(_0x17aa6d[_0x425890(0x7d2,0xc05,0xb46,0x126e)+'id'][-0x1*-0x1663+-0xc3a+-0x1*0xa29]===_0x17aa6d['sender'])return _0x295ea5['eMHRc'](_0xcd1d32,_0x17318e(0x18b3,0x108b,0xcac,0xec9)+_0x425890(0x605,0xa4f,0x11a4,0xda)+'lf\x20!');if(!_0x17aa6d[_0x17318e(0xb58,0x127b,0x1869,0xe22)+'id'][0x1b*-0xc7+-0x12c1+0x27be])return _0x295ea5['dWZVc'](_0xcd1d32,_0x425890(0xbdd,0x1500,0x1128,0x1642)+_0x425890(0x502,0xe98,0x130b,0x1295)+_0x17318e(0x13b8,0xaa2,0x872,0x118d)+_0x17318e(0x98d,0x10b8,0x109b,0xfcb)+_0x425890(-0x6ed,0x37f,0xdce,0x2c)+'Example\x20:\x20'+_0x4fea53+_0x425890(0x7e7,0x849,0x3da,0x532)+owner[-0x496+-0x7a1+0xc38],_0x17aa6d[_0x425890(0xd9b,0xcc7,0xe96,0x5a0)],{'mentions':[_0x295ea5[_0x425890(0xdd8,0xe2e,0x48c,0x10f6)](owner[0xc15+0x865+-0x1479],_0x295ea5[_0x17318e(0x1423,0x18a2,0x199b,0xf9d)])]});if(Object[_0x17318e(0x9fe,0x3fb,0x62f,0x5b6)](this[_0x17318e(-0x5c,0x297,0x25a,0x55a)])[_0x425890(0x9a7,0x11b1,0xff9,0x909)](_0x49d345=>_0x49d345['id']['startsWith'](_0x425890(0x35d,0x33d,0x67e,0xb))&&[_0x49d345['p'],_0x49d345['p2']][_0x425890(-0x290,0x291,-0xa5,0x815)](_0x17aa6d[_0x17318e(0xf2e,0x751,0xadf,0xe22)+'id'][0x1*-0x897+0x76*0x30+-0xd89])))_0x295ea5['XsKFJ'](_0xcd1d32,_0x425890(0x1026,0x157e,0x16d7,0x1c00)+'\x20You\x20Are\x20C'+_0x17318e(0x18b0,0xda3,0x163c,0x1239)+_0x17318e(0x9e1,0xe6c,0xdd0,0xfcf)+_0x425890(-0x6dc,0x22d,-0x18e,0xca9)+_0x425890(0xda6,0x118c,0xcde,0x1491)+_0x425890(0x761,0x172,0x8a,0x6ed));let _0x42e46b=_0x295ea5[_0x17318e(0x933,0x3ea,0xc2a,0x873)](_0x295ea5[_0x425890(0xb41,0xae6,0x1437,0x1543)],_0x295ea5[_0x425890(0x99f,0x11c3,0x1b86,0x15ab)](new Date(),-0x19ab+0x1085+0x927)),_0x5a46b5=_0x425890(0x1a0e,0x1291,0xea2,0x1b23)+_0x425890(0xd8c,0x51c,-0x4ce,0x453)+_0x17aa6d[_0x17318e(0x145d,0x1076,0xc44,0xc86)][_0x425890(-0x170,0x2eb,0xd0f,-0x11e)]`@`[0x690+0x1236*0x1+0x2a*-0x97]+(_0x17318e(0x689,0xefc,0xde3,0xeac)+'\x20@')+_0x17aa6d['mentionedJ'+'id'][-0x204+0xd*0xfe+0xc7*-0xe][_0x425890(0x8ed,0x2eb,0x405,-0x75a)]`@`[-0x490+-0xc3d+0x10cd]+('\x20To\x20Play\x20S'+_0x425890(0x227,0xb73,0x242,0x561)+'e\x20@')+_0x17aa6d['mentionedJ'+'id'][-0x1f79+0x58c+-0x1*-0x19ed][_0x425890(0x509,0x2eb,-0x46b,0xbb8)]`@`[-0x4*0x1+0x145+-0x141]+(_0x425890(0xf48,0x1104,0x17d7,0xe28)+_0x17318e(0xcd5,0x10eb,0x12ea,0xd84)+'ct');this[_0x17318e(-0x390,0x61c,-0x364,0x55a)][_0x42e46b]={'chat':await _0x3797bd[_0x425890(0xd7c,0x12b2,0xdf9,0x162b)](_0x17aa6d['chat'],_0x5a46b5,_0x17aa6d,{'mentions':_0x295ea5[_0x17318e(0xfe4,0x6bc,0xb0e,0x6b9)](parseMention,_0x5a46b5)}),'id':_0x42e46b,'p':_0x17aa6d[_0x425890(0x104,0xa69,0x95a,0x52b)],'p2':_0x17aa6d[_0x17318e(0xed4,0x514,0x1719,0xe22)+'id'][-0x117*0x21+0x1*0x12f1+0x1106],'status':'wait','waktu':setTimeout(()=>{if(this[_0xe77546(0x14f,0xba0,0xb23,0x569)][_0x42e46b])_0x3797bd[_0x4148af(0x1333,0xa75,0x1609,0xf1d)](_0x17aa6d[_0xe77546(0x819,0x71a,0x12e9,0xef3)],_0xe77546(0x1a88,0xea6,0x162c,0x185d)+_0x4148af(0x777,0x3bf,-0x54f,0x4a8),_0x17aa6d);function _0xe77546(_0x5bf237,_0x571754,_0x2b928d,_0x154563){return _0x17318e(_0x5bf237-0xe7,_0x5bf237,_0x2b928d-0x134,_0x154563-0xf);}function _0x4148af(_0x28e575,_0x9ea29e,_0x2094d9,_0x5927cc){return _0x17318e(_0x28e575-0x19d,_0x2094d9,_0x2094d9-0xff,_0x5927cc- -0x5b2);}delete this[_0xe77546(0x8fc,0x9a7,0x2fc,0x569)][_0x42e46b];},0x1*0xba57+0x3fc3+-0xfba),'poin':_0x1c2802,'poin_lose':_0x2765c5,'timeout':_0x42a1e4};}break;case _0x295ea5[_0x425890(0x55f,0x32f,0x49e,0x9b4)]:{if(!_0x193cb6)return _0x295ea5[_0x17318e(0x1855,0x15e3,0x931,0xe9c)](_0x51481c,''+mess[_0x17318e(0x122a,0x1432,0xb21,0x1494)]);if(!q)return _0x295ea5[_0x425890(0xae8,0xee7,0x13b2,0x12f8)](_0x51481c,'Option\x20:\x201'+'.\x20mute\x0a2.\x20'+_0x425890(0x12cf,0x1166,0xbd7,0x1775)+_0x425890(0x8ba,0xbec,0x5ac,0x46b)+'\x20unarchive'+'\x0a5.\x20read\x0a6'+_0x17318e(0x13fc,0x127c,0x1aba,0x17a6)+_0x17318e(0xa48,0x682,0x103d,0xa55));if(_0x52a010[0x20*-0x3e+0xd2a*-0x1+0x14ea]===_0x295ea5[_0x425890(0xfe1,0xd61,0x533,0x491)]){const _0x224d31={};_0x224d31[_0x17318e(0x11c0,0x1bef,0xfd6,0x151a)]=_0x295ea5[_0x17318e(0x167d,0xd2a,0xc2f,0x102d)],_0x3797bd[_0x425890(0x938,0xf99,0x1755,0xa1a)](_0x224d31,_0x17aa6d[_0x425890(0x8da,0xcc7,0xf2f,0x132d)],[])['then'](_0x3c6226=>_0xcd1d32(jsonformat(_0x3c6226)))[_0x425890(0x161c,0xecb,0x79f,0x17fb)](_0x486795=>_0xcd1d32(jsonformat(_0x486795)));}else{if(_0x52a010[-0x2639*0x1+-0x329+0x2962]===_0x295ea5['NkDkp']){const _0x4b10e2={};_0x4b10e2['mute']=null,_0x3797bd['chatModify'](_0x4b10e2,_0x17aa6d[_0x425890(0x1530,0xcc7,0xd9b,0xbf7)],[])[_0x425890(0x407,0x1b3,-0x3a1,-0x2cf)](_0x12bbc6=>_0xcd1d32(jsonformat(_0x12bbc6)))['catch'](_0x12a91a=>_0xcd1d32(jsonformat(_0x12a91a)));}else{if(_0x295ea5[_0x17318e(0x62b,0x3ac,0x3be,0x596)](_0x52a010[-0xbcf+-0x14fb*-0x1+-0x92c],_0x425890(0xf7c,0xda1,0x8de,0xe8a))){if(_0x295ea5[_0x17318e(0xf84,0x1974,0x15a4,0x1651)](_0x295ea5[_0x425890(0x15e6,0x13c9,0x13e9,0x18c2)],_0x295ea5[_0x425890(0x1ddf,0x1530,0xb83,0x1ba7)]))return _0x295ea5[_0x425890(0x4ea,0x624,-0xc6,0x8f)](_0x1059b7,this['a'])?this['b']:_0x295ea5[_0x425890(0x53c,0x24a,0x559,-0x57d)](_0x40ebb9,this['b'])?this['a']:'';else{const _0x19bc19={};_0x19bc19[_0x425890(0x808,0xda1,0xffd,0xcf1)]=!![],_0x3797bd[_0x17318e(0xe4c,0x1432,0xf88,0x11b6)](_0x19bc19,_0x17aa6d[_0x425890(0x1278,0xcc7,0xd18,0x1303)],[])[_0x17318e(0x575,-0x5a8,0x2f3,0x3d0)](_0x73ba5b=>_0xcd1d32(jsonformat(_0x73ba5b)))[_0x425890(0x7c0,0xecb,0x6ce,0x140e)](_0x560fec=>_0xcd1d32(jsonformat(_0x560fec)));}}else{if(_0x295ea5[_0x17318e(0xb88,0xd5f,0x270,0x57f)](_0x52a010[0x1*-0x16ed+0x765+0x7c4*0x2],'unarchive')){if(_0x295ea5[_0x425890(0x1283,0xf71,0xa87,0x845)](_0x295ea5[_0x425890(0xb32,0x5c5,0x722,0xf46)],_0x295ea5[_0x17318e(0x9d8,-0x155,0x81c,0x5b3)]))_0x4c940a[_0x5c85cb[_0x425890(0xe88,0xa69,0x2a0,0xba5)][_0x425890(-0x71f,0x2eb,0xd6e,0x3f6)]('@')[-0x68b+0x1334+-0xca9]]=_0x3f2468[_0x17318e(0x1414,-0x24,0x140a,0xa67)][_0x17318e(0xe3c,0x989,0x4d7,0xd56)+'e']();else{const _0x58565e={};_0x58565e[_0x425890(0x3b7,0xda1,0x9e1,0xc41)]=![],_0x3797bd['chatModify'](_0x58565e,_0x17aa6d[_0x425890(0x9b2,0xcc7,0x419,0x1695)],[])[_0x17318e(0x394,0x141,0xca1,0x3d0)](_0x3c8d8a=>_0xcd1d32(jsonformat(_0x3c8d8a)))[_0x425890(0xc58,0xecb,0x7fd,0xb46)](_0x2d38fc=>_0xcd1d32(jsonformat(_0x2d38fc)));}}else{if(_0x295ea5[_0x17318e(0xded,0x221,0x1b3,0x6b4)](_0x52a010[0x1abd+0x22bd+0x3*-0x147e],_0x295ea5[_0x17318e(0x1b9a,0x131c,0xdc4,0x1614)])){const _0x1f6305={};_0x1f6305[_0x425890(0xd13,0xef7,0x13a8,0x7ff)]=!![],_0x3797bd['chatModify'](_0x1f6305,_0x17aa6d[_0x17318e(0xfaa,0xfff,0x10df,0xee4)],[])['then'](_0xd18850=>_0xcd1d32(jsonformat(_0xd18850)))[_0x425890(0x1956,0xecb,0x1821,0xc16)](_0x5ba479=>_0xcd1d32(jsonformat(_0x5ba479)));}else{if(_0x295ea5[_0x425890(0x66f,0x62e,0xc1e,0xb11)](_0x52a010[-0x37*-0xa7+0x3*-0xc47+0xf4],_0x295ea5[_0x425890(-0xf4,0x761,0x24b,0x10f1)])){const _0x2e9649={};_0x2e9649[_0x425890(0xa08,0xef7,0x1189,0x1603)]=![],_0x3797bd['chatModify'](_0x2e9649,_0x17aa6d[_0x17318e(0x13ab,0xf9b,0x13a9,0xee4)],[])[_0x425890(0x8df,0x1b3,-0x133,0x27a)](_0x5bed3b=>_0xcd1d32(jsonformat(_0x5bed3b)))['catch'](_0x31fd81=>_0xcd1d32(jsonformat(_0x31fd81)));}else{if(_0x295ea5['mztmo'](_0x52a010[-0x199+0x671+-0x4d8],_0x295ea5[_0x17318e(0x1181,0x9c9,0xd25,0x9e7)])){const _0x1fe482={};_0x1fe482['id']=_0x17aa6d[_0x17318e(0x5c5,0x135e,0x613,0xa24)]['id'],_0x1fe482[_0x17318e(0xcc6,0x855,0x426,0x626)]=!![];const _0xa76e70={};_0xa76e70[_0x17318e(0x16d,0x254,0x77e,0x9e0)]=_0x1fe482;const _0xf43de={};_0xf43de[_0x17318e(0x1ab4,0xf8f,0x12c5,0x13c4)]=_0xa76e70,_0x3797bd[_0x17318e(0x1447,0xe27,0x13ff,0x11b6)](_0xf43de,_0x17aa6d[_0x425890(0x119d,0xcc7,0x10a6,0x405)],[])[_0x425890(-0x317,0x1b3,0x25f,-0x62d)](_0x30261c=>_0xcd1d32(jsonformat(_0x30261c)))['catch'](_0x17e8db=>_0xcd1d32(jsonformat(_0x17e8db)));}}}}}}}}break;case _0x295ea5[_0x425890(-0xf1,0x87d,-0x18d,0xae4)]:{_0x295ea5['EQvNf'](_0x295ea5[_0x425890(0x1717,0x1044,0x9a4,0xf73)](_0x295ea5[_0x425890(0x5ef,0x87d,0x1209,0x880)],_0x17aa6d[_0x425890(0x1440,0xcc7,0x1224,0xfba)]),_family100)&&(_0x295ea5[_0x17318e(-0x5a,0x1085,0x342,0x737)](_0x425890(0x35d,0xdd9,0xcb3,0xda4),_0x295ea5['Gihfi'])?(_0x5c9a85[_0x425890(0xb87,0x7b0,0x11f3,0x274)+'e'](_0x10910d),_0x3e90bc[_0x425890(0xd40,0x36a,0x5d7,0xa4a)](_0x148031[_0x425890(0xbf7,0xb89,0x102b,0xc18)](_0x17318e(0x697,0x5d6,0x1886,0xec6)+_0x2a4333)),delete _0x3d811d['cache'][_0x542600],_0x295ea5[_0x425890(0x449,0x5fd,-0xfc,0x365)](_0xbf71a1,_0x3da73b)):(_0x295ea5['ZXjRB'](_0xcd1d32,_0x425890(0x154c,0xbc3,0x4a3,0x1117)+_0x17318e(0xfbd,0x743,0x1274,0xd18)+_0x17318e(0x2a2,0xfc0,0x5b3,0xa71)+_0x17318e(0xe2f,0x158e,0xced,0x16dd)),_0x295ea5['yukgT'](_0xcd1d32,![])));let _0x33ab06=await fetchJson(_0x295ea5[_0x425890(0x579,0xe5e,0x132c,0x403)]),_0x39d781=_0x33ab06[Math['floor'](_0x295ea5['brNuC'](Math[_0x425890(0xb8a,0x92e,0xbb5,0x12c1)](),_0x33ab06[_0x425890(0x4a3,0x8bc,0x2a0,0x706)]))],_0x4a123d=(_0x17318e(0xd66,0xe1,0x261,0x7e1)+_0x17318e(0x28a,0x431,0xb0b,0x455)+_0x17318e(0x141a,0x12ed,0x745,0xdca)+_0x425890(0x14c8,0xe96,0x1377,0x90b)+_0x39d781[_0x17318e(0x16f7,0x12e7,0xebd,0x1121)]+('\x0a\x0aThere\x20Is'+'\x20*')+_0x39d781[_0x425890(0xe2,0x84a,0xc2,0x12ae)][_0x17318e(0x625,0x71,0x42a,0xad9)]+'*\x20Answer\x20'+(_0x39d781[_0x17318e(0x1203,0x546,0x6a4,0xa67)]['find'](_0x297fc1=>_0x297fc1[_0x425890(0xd16,0x291,-0x7dd,-0x6de)]('\x20'))?_0x17318e(0xfd5,0x46b,0x3b6,0xc4b)+_0x425890(0x18f0,0x1569,0xc36,0x19c6)+_0x425890(0xe90,0x8f0,0x3b6,0xf95):''))[_0x425890(0x27c,0x54c,0xc4f,0xb2d)]();_family100[_0x295ea5[_0x17318e(0xfaf,0x121f,0x12e2,0x15d9)](_0x295ea5[_0x425890(0xf9a,0x87d,0x58f,0x242)],_0x17aa6d[_0x17318e(0x1325,0x5b2,0xd55,0xee4)])]={'id':_0x295ea5[_0x17318e(-0x687,0x527,0x17a,0x3e6)](_0x295ea5[_0x17318e(0x307,0x10d4,0xa2,0xa9a)],_0x17aa6d[_0x425890(0x2ac,0xcc7,0x9db,0xdea)]),'pesan':await _0x3797bd[_0x17318e(0x1dd4,0x1660,0xcbc,0x14cf)](_0x17aa6d['chat'],_0x4a123d,_0x17aa6d),..._0x39d781,'terjawab':Array[_0x17318e(0x18d3,0x186d,0xddd,0x1293)](_0x39d781[_0x17318e(0xd38,0x75c,0x125b,0xa67)],()=>![]),'hadiah':0x6};}break;case _0x295ea5[_0x17318e(-0xb0,0x133d,0x138b,0x90e)]:case _0x295ea5['Kotkj']:case _0x295ea5[_0x425890(0xe32,0x82b,-0xda,0xc71)]:case _0x295ea5['sHihL']:case _0x295ea5[_0x17318e(0x11bd,0xd17,0x568,0xc95)]:if(!_0x17aa6d['quoted']&&!_0x116129)return _0x295ea5[_0x425890(0xba0,0x142a,0x1216,0x1cdc)](_0x51481c,_0x425890(0x11d9,0xd7e,0xa8b,0xb49)+_0x425890(0x94f,0xee2,0x1941,0xecf)+_0x425890(0x99b,0x4d9,0x8ab,0x733)+(_0x4fea53+_0x1cbc75));ter=_0x1cbc75[-0x9d*-0x31+0x20de+-0x1*0x3eea]['toLowerCas'+'e'](),tex=_0x17aa6d[_0x425890(0xcf,0x807,0x321,0x1027)]?_0x17aa6d['quoted'][_0x425890(-0x13e,0x1e8,0x43a,0xa87)]?_0x17aa6d[_0x425890(0xb31,0x807,0x362,0x5b6)][_0x425890(-0x590,0x1e8,0xe8,0x62f)]:q?q:_0x17aa6d['text']:q?q:_0x17aa6d[_0x425890(0xdc,0x1e8,0x36a,-0x6ef)],_0x295ea5[_0x17318e(0xac3,0x12b9,0xcab,0x117f)](_0xcd1d32,tex['replace'](/[aiueo]/g,ter)[_0x17318e(0x11b4,0x1066,0xc87,0x82e)](/[AIUEO]/g,ter[_0x17318e(0x18d4,0xeb1,0x19bb,0x1696)+'e']()));break;case _0x295ea5[_0x425890(0x19eb,0x15e2,0x1623,0x1854)]:{if(!_0x116129)return _0x295ea5[_0x17318e(0x8e1,0x910,0x151b,0x1244)](_0x51481c,_0x17318e(0x786,0x10a1,0x7cc,0xd25)+_0x295ea5[_0x425890(0x1470,0xd62,0x17da,0x3ff)](_0x4fea53,_0x1cbc75)+('\x20song\x0a\x0aOpt'+'ion\x20:\x20\x0a1.\x20'+_0x425890(0x2bb,0xcbc,0xd4a,0x985)+'icture\x20(in'+_0x17318e(0x621,0xe98,0x5c4,0xfc2)+'d\x0a4.\x20sente'+_0x17318e(0x5df,0x22a,0x182,0x8c2)+_0x17318e(-0x7f,0xa52,0x82e,0x777)+'\x0a6.\x20blank\x20'+'(indo)'));if(_0x295ea5[_0x425890(0x1354,0x9f8,0x186,0x36b)](_0x52a010[-0x3bd+0x21ba+-0x1dfd],_0x295ea5[_0x17318e(0x18df,0x1d88,0x1a9f,0x1500)])){if(tebaklagu[_0x17318e(0x4c9,0xd3b,0xf37,0x896)+'erty'](_0x17aa6d[_0x425890(0x7a0,0xa69,0xe0c,0x5e0)]['split']('@')[0x29*0xa7+-0x1b81+0xc2]))return _0x295ea5[_0x17318e(0xcef,0x7c6,0x94b,0x487)](_0x51481c,_0x425890(0x665,0xbc3,0x9b8,0x52d)+_0x425890(0x32c,0xafb,0xc9d,0x4b8)+_0x425890(-0x121,0x854,0xd4c,0x949)+_0x17318e(0x17af,0x124a,0x1481,0xd2a));let _0x4e5b60=await _0x295ea5[_0x17318e(0x142,0x11cf,0x1cb,0x84e)](fetchJson,_0x17318e(0xc62,0xd64,0x31b,0x6b5)+_0x17318e(0x745,0x199,0x1456,0xc00)+'.github.io'+_0x17318e(0xb39,0xfc3,0xf65,0x524)+_0x425890(0x9fb,0xda9,0x1265,0xfdb)),_0x100cf6=_0x4e5b60[Math[_0x425890(0xecb,0x1415,0xabc,0x1936)](Math[_0x425890(0x8e,0x92e,0xe16,0x6e4)]()*_0x4e5b60[_0x17318e(0x1019,0xdd4,0x569,0xad9)])];const _0x1dea26={};_0x1dea26[_0x425890(0x501,0x5f3,0xf9,0x38b)]=_0x100cf6[_0x17318e(0xfe4,0x69a,0xeeb,0x98f)];const _0x2d06be={};_0x2d06be['audio']=_0x1dea26,_0x2d06be[_0x425890(0xc69,0xdfe,0xd48,0xf4d)]=_0x295ea5['uNJpp'];let _0x3e947f=await _0x3797bd[_0x17318e(-0x3c1,0xf69,0xe10,0x63c)+'e'](_0x17aa6d[_0x17318e(0x1875,0x13dc,0x7af,0xee4)],_0x2d06be,{'quoted':_0x17aa6d});_0x3797bd[_0x425890(0x154c,0x12b2,0x168f,0x1308)](_0x17aa6d[_0x425890(0x942,0xcc7,0xde8,0x1159)],_0x425890(0x7c9,0xfda,0xebe,0xedd)+_0x17318e(0x18ae,0x1b6d,0x1b21,0x125e)+_0x17318e(0x15f1,0xa5f,0xf64,0x12b3)+_0x17318e(0xa67,0x1ac8,0xfc7,0x10d9)+'\x20'+_0x100cf6[_0x425890(0x8f,0x3d7,-0x50c,0xacc)]+(_0x425890(0xc95,0x9a7,0x10dd,0xaa8)+'\x20seconds'),_0x3e947f)['then'](()=>{const _0x39ac05={};_0x39ac05[_0x464804(0x15ef,0x115d,0x1b85,0xc7f)]=_0x295ea5['vMhbF'],_0x39ac05[_0x14756c(0x1271,0x185b,0x11e2,0xc77)]=_0x295ea5[_0x14756c(0xa0a,-0xe2,0x42d,-0x57)];function _0x464804(_0x2eaa65,_0x4e94bd,_0x3263ec,_0x4950e9){return _0x425890(_0x4950e9,_0x4e94bd-0x18,_0x3263ec-0x1c0,_0x4950e9-0xdb);}_0x39ac05['lTvVz']=_0x295ea5['PqAUw'];const _0x4679ca=_0x39ac05;function _0x14756c(_0x215fce,_0x1614d5,_0x41fae7,_0x20fe0e){return _0x17318e(_0x215fce-0x1e7,_0x215fce,_0x41fae7-0xec,_0x41fae7- -0x174);}if(_0x295ea5[_0x14756c(0x1805,0x1148,0x13e8,0xf1f)](_0x14756c(0xd1a,0x1be5,0x165e,0x209c),'AYtqS'))tebaklagu[_0x17aa6d[_0x14756c(0x9ba,0xb36,0xb12,0xdee)][_0x464804(0x7e4,0x303,0x10d,0x939)]('@')[-0x2c6+0x13a9+-0x10e3]]=_0x100cf6[_0x14756c(0x209,0x2f2,0x8f3,0xd26)][_0x14756c(0x697,0xfb0,0xbe2,0x645)+'e']();else{const _0x1a1c9c={};_0x1a1c9c[_0x14756c(0xf8b,0x11c6,0x1149,0x1a22)+'t']=_0x4679ca[_0x464804(0xdcd,0x115d,0xf93,0xe77)];const _0xdce30d={};_0xdce30d[_0x14756c(0x1aa2,0xc90,0x1020,0x9e1)]=_0x125179+'allmenu',_0xdce30d[_0x14756c(0x16de,0x1a5a,0x11a4,0xf21)]=_0x1a1c9c,_0xdce30d[_0x14756c(0x1379,0xd26,0x14c4,0x122d)]=0x1;const _0x51ab63={};_0x51ab63[_0x464804(0xf75,0x10b8,0x13fd,0xba5)+'t']='⫷\x20ALIVE\x20⫸';const _0x49037d={};_0x49037d[_0x464804(0xfb8,0xf8f,0x18cc,0x1229)]=_0x373ba0+_0x14756c(0xdbd,0xccf,0xaf2,0x5bc),_0x49037d[_0x464804(0x15f0,0x1113,0x9f6,0xb38)]=_0x51ab63,_0x49037d[_0x14756c(0x1c59,0x18b5,0x14c4,0x1a08)]=0x1;const _0x1704e8={};_0x1704e8[_0x464804(0xcb8,0x10b8,0x1ad8,0x95a)+'t']=_0x4679ca[_0x14756c(0xa56,0x127d,0x11e2,0xb79)];const _0x2c8ff3={};_0x2c8ff3[_0x464804(0x6eb,0xf8f,0x14e7,0xda4)]=_0x54907e+_0x14756c(0x1a06,0xfde,0x15dd,0x1934),_0x2c8ff3[_0x14756c(0xd39,0x1273,0x11a4,0xcfe)]=_0x1704e8,_0x2c8ff3[_0x14756c(0x190c,0xe68,0x14c4,0xc76)]=0x1;let _0x2d3d62=[_0xdce30d,_0x49037d,_0x2c8ff3];const _0x55b3dd={};_0x55b3dd['url']=_0x57d8e0+_0x4679ca[_0x464804(-0x280,0x673,0x938,0x80e)];const _0x3d4887={};_0x3d4887[_0x464804(0x43a,0x399,0xc46,-0x1b6)]=_0x55b3dd,_0x3d4887[_0x464804(-0x201,0x322,0xb8e,0x27d)]=_0x14756c(0x968,0xca7,0x6c1,0x9de)+_0x14af83+(_0x464804(-0x61d,0x1b3,-0x8a8,0x654)+'═══💠\x20OWNER'+_0x464804(0x13a7,0x9ef,0x67c,0xba0)+_0x14756c(0xa15,-0x33,0x4b0,-0x1))+_0x3eb6ce+'\x20'+_0x1e9222+(_0x464804(0xb4e,0x112e,0xd45,0x9f1)+_0x14756c(-0x2e7,-0x422,0x671,-0x3b)+_0x464804(0x10c5,0x80e,-0x267,0x827))+_0x42202d+'\x20'+_0x1bd38c+(_0x464804(0xe7f,0x1588,0x1cb1,0x1b92)+'┃╠')+_0x4b6bd5+'\x20'+_0x362b8e+('ephemeral\x20'+_0x464804(0x1423,0xa0a,0x263,0x5f0)+'╠')+_0x5781f6+'\x20'+_0x3da8d0+(_0x464804(0x1545,0x142f,0x1af7,0xb10)+_0x464804(0x6b5,0xa5e,0x59,-0x10))+_0x1d7ec5+'\x20'+_0x3bd52e+(_0x14756c(0x53f,0x51e,0xa39,0x878)+'ext]\x0a┃╠')+_0x37376c+'\x20'+_0x260cba+('setdesc\x20[t'+_0x464804(0x5b9,0x44a,0x85d,-0x13c))+_0x3cdffb+'\x20'+_0x21734c+(_0x464804(-0x1d4,0x5b5,0xc2e,0xbc6)+_0x14756c(0xf5f,0x10be,0x840,0xefa))+_0x529e8d+'\x20'+_0x2ba31d+('editinfo\x20['+'option]\x0a┃╠')+_0x17cef0+'\x20'+_0x3bfa22+(_0x464804(0xb97,0x36a,0x86d,0x1fc)+_0x14756c(0x934,0x18ee,0x1330,0xa35))+_0x561c59+'\x20'+_0xed6370+(_0x14756c(0x118f,0x17d2,0x1154,0x93c)+_0x14756c(0xaaf,0x528,0x7e3,0x645))+_0x1c86c1+'\x20'+_0x25a12c+('hidetag\x20[t'+_0x14756c(0x943,0x5a6,0x4db,-0x1f8))+_0x3a27fa+'\x20'+_0x20ae9b+('tagall\x20[te'+_0x14756c(0xdec,0x68d,0xd94,0x17a9))+_0x5b069d+'\x20'+_0x8c60dc+(_0x14756c(-0x84c,-0x2cc,0x245,0x8a5)+_0x464804(-0x23c,0x595,0xb22,0x687))+_0x5df75d+'\x20'+_0x188edb+(_0x464804(0x1e7,0xb12,0x149d,0xd80)+_0x464804(0x170a,0x107e,0xee1,0x1a47))+_0x62f86d+'\x20'+_0x45559e+(_0x14756c(0x643,0x1595,0xffc,0x1662)+'eply/tag]\x0a'+'┃╠')+_0x58cdcf+'\x20'+_0x2c3866+(_0x14756c(0x756,0x2d2,0x690,0x43b)+_0x464804(0x5ad,0xe2d,0x101b,0x177e)+'╠')+_0x310c8b+'\x20'+_0x18b732+_0x464804(0x228,0x36d,0xcf8,0x73)+_0x239932+'\x20'+_0x2a1b11+'devote\x0a┃╠'+_0x46ca8f+'\x20'+_0xc5d393+'upvote\x0a┃╠'+_0x590e2a+'\x20'+_0x7678ee+(_0x464804(0xfb6,0x120f,0x1332,0x19c5)+'┃╠')+_0x2717b5+'\x20'+_0x26cc60+'delvote\x0a┃╠'+_0x1aa054+'\x20'+_0x3bd202+(_0x464804(0x19a6,0x1036,0x14fc,0x1232)+'n/off]\x0a┃╚═'+_0x14756c(0x1501,0x1086,0x1408,0x1999)+_0x464804(0x9f7,0x13c7,0x117c,0x12ed))+_0x354d61+'\x20❮━😎',_0x3d4887[_0x464804(0x2da,0x392,0xbf5,-0x12b)]=_0x10d21e[_0x464804(0xbd5,0x10d6,0x8a9,0x11c4)]['name'],_0x3d4887['buttons']=_0x2d3d62,_0x3d4887['headerType']=0x4;let _0x9ba3b6=_0x3d4887;const _0xe01070={};_0xe01070['quoted']=_0x2e6064,_0x158d41[_0x464804(0x11e,0x437,-0x628,0x55b)+'e'](_0x275dc6[_0x464804(0x5b5,0xcdf,0xed0,0x4f8)],_0x9ba3b6,_0xe01070);}}),await _0x295ea5[_0x425890(0xb7b,0x2dd,0x702,0x658)](sleep,-0x17ef0+-0x131d9+-0x1*-0x39b29);if(tebaklagu[_0x17318e(0xe14,0x12ba,0x805,0x896)+_0x17318e(0x1211,0x1767,0xce6,0x1522)](_0x17aa6d[_0x17318e(0xd84,0x1374,0x3d2,0xc86)]['split']('@')[-0x1*0x2221+0x4*-0x5cb+-0x1*-0x394d])){console['log'](_0x295ea5[_0x425890(0x1418,0x129a,0xfa9,0x17ec)]+_0x100cf6[_0x17318e(0xe34,0x3e0,0x763,0xa67)]);const _0x3e9176={};_0x3e9176[_0x17318e(0x15c8,0x138a,0xfa3,0x1194)]=_0x295ea5[_0x17318e(0x1597,0x13c3,0x1686,0x104a)],_0x3e9176[_0x425890(0xc9f,0x10fb,0xd59,0xa9d)]={},_0x3e9176['type']=0x1,_0x3e9176[_0x425890(0xc9f,0x10fb,0xd59,0xa9d)]['displayTex'+'t']=_0x295ea5[_0x17318e(0x1162,0x189,0xa34,0x76f)],_0x3797bd['sendButton'+_0x425890(0x7d3,0xcec,0x804,0x16ee)](_0x17aa6d[_0x17318e(0x1448,0x9ab,0xc2f,0xee4)],[_0x3e9176],_0x425890(0x10b8,0x7ed,0x10fb,-0x10c)+'un\x20Out\x0aAns'+_0x425890(0x1998,0x142e,0xee7,0x1572)+tebaklagu[_0x17aa6d[_0x425890(0x725,0xa69,0xd90,0x8b0)][_0x17318e(0x496,0xa5b,0x172,0x508)]('@')[0x216e+0x1bc1+0x3*-0x1465]]+(_0x425890(0xfb7,0x11a2,0x11d3,0xe75)+'Play?\x20Pres'+'s\x20The\x20Butt'+_0x425890(0x2fc,0x413,-0x465,0x2a3)),_0x3797bd[_0x425890(0x8d5,0x10be,0x1952,0x8da)][_0x17318e(0x1578,0x1510,0xe1c,0x109f)],_0x17aa6d),delete tebaklagu[_0x17aa6d[_0x425890(0x2b2,0xa69,0x6ab,0x978)][_0x425890(0xb8a,0x2eb,0xd80,0x91f)]('@')[-0x3*0xb5d+-0x1602+0x3819*0x1]];}}else{if(_0x295ea5[_0x425890(0x1e7d,0x15ce,0x1d72,0xd44)](_0x52a010[-0x167+0x9d+-0x1*-0xca],_0x295ea5[_0x17318e(0x84b,0x170,0x696,0x62e)])){if(tebakgambar['hasOwnProp'+_0x17318e(0xe0a,0x194e,0x1f8b,0x1522)](_0x17aa6d['sender'][_0x425890(0xb84,0x2eb,0xc8c,-0x596)]('@')[0xe*0x12f+0xc46+0x8*-0x39b]))return _0x295ea5[_0x17318e(0x4bf,0x6cd,0x11c2,0xd67)](_0x51481c,_0x17318e(0xe61,0x3de,0x170c,0xde0)+'Still\x20Unfi'+'nished\x20Ses'+_0x17318e(0x17d7,0x1f00,0x20e6,0x16dd));let _0x3a1a93=await _0x295ea5[_0x17318e(0x631,-0x5a1,0x864,0x38a)](fetchJson,_0x295ea5[_0x17318e(0x94f,0x8e1,0x708,0xc6a)]),_0x37d060=_0x3a1a93[Math['floor'](_0x295ea5[_0x17318e(-0xab,0x50c,0x700,0x86e)](Math[_0x17318e(0x10c1,0x146d,0xea1,0xb4b)](),_0x3a1a93[_0x425890(0xf87,0x8bc,0xaa7,0x1dc)]))];_0x3797bd[_0x17318e(0x1179,0x1473,0xf7c,0xd61)](_0x17aa6d['chat'],_0x37d060['img'],'Please\x20Ans'+_0x425890(0x458,0x690,-0x82,0x957)+_0x425890(0x4f4,0x737,0xc8c,-0x140)+_0x17318e(0x1100,0x1e84,0x1862,0x1785)+_0x17318e(0x33d,0x145f,0x1189,0xc9c)+_0x37d060[_0x425890(0xd6a,0x152f,0x19a8,0x1d00)]+(_0x17318e(0x151f,0xcd1,0x4ab,0xbc4)+_0x425890(0xbee,0x10f1,0x674,0x1730)),_0x17aa6d)['then'](()=>{function _0x1034ff(_0x568bdb,_0x561cf9,_0x4aae6a,_0x307ffe){return _0x425890(_0x561cf9,_0x568bdb-0x187,_0x4aae6a-0xc9,_0x307ffe-0x19f);}function _0x500eb0(_0x183d3f,_0xa83c9c,_0x1fb271,_0x57613d){return _0x425890(_0x57613d,_0x1fb271- -0x120,_0x1fb271-0x5f,_0x57613d-0x18c);}tebakgambar[_0x17aa6d[_0x500eb0(0xd76,0xd4e,0x949,0xfd3)]['split']('@')[-0x153b+0x1*-0x206+-0x1*-0x1741]]=_0x37d060[_0x1034ff(0x9d1,0xe3,0x988,0xa04)][_0x1034ff(0xcc0,0xa60,0x1390,0xed5)+'e']();}),await _0x295ea5[_0x425890(0x664,0x47c,-0x4cd,0xcf4)](sleep,0x3c3*-0x11+-0x13674+0x260c7*0x1);if(tebakgambar[_0x425890(0xaf9,0x679,-0x372,-0x330)+_0x17318e(0xb8d,0x1094,0x1881,0x1522)](_0x17aa6d['sender'][_0x425890(0x3d3,0x2eb,0xc31,0x460)]('@')[-0x1257+0x9*-0x265+0x2*0x13f2])){console['log'](_0x295ea5[_0x17318e(0xbe2,0xca1,0xcb9,0x92e)](_0x295ea5[_0x425890(0x8a9,0x129a,0x1d25,0xcc2)],_0x37d060[_0x17318e(0x3c0,0x770,0x10c6,0xa67)]));const _0x2ab423={};_0x2ab423['buttonId']=_0x295ea5['wdkRh'],_0x2ab423[_0x17318e(0x176e,0x933,0x12f9,0x1318)]={},_0x2ab423[_0x425890(0x15c5,0x141b,0x1e94,0x1ea8)]=0x1,_0x2ab423[_0x17318e(0x176e,0x933,0x12f9,0x1318)][_0x425890(0x1991,0x10a0,0x1547,0xf76)+'t']=_0x295ea5['hQndq'],_0x3797bd[_0x425890(0x15f3,0x10a7,0xd67,0xde3)+_0x425890(0xfd9,0xcec,0xe2c,0x11ff)](_0x17aa6d['chat'],[_0x2ab423],_0x425890(0x3aa,0x7ed,0xf49,0xc8e)+'un\x20Out\x0aAns'+_0x425890(0xaf5,0x142e,0x9e2,0xc9c)+tebakgambar[_0x17aa6d[_0x425890(0xcfa,0xa69,0x57a,0xc9e)]['split']('@')[-0xf2+0x564+-0x472]]+(_0x425890(0x923,0x11a2,0x81c,0xa7c)+'Play\x20Again'+_0x425890(0x2e9,0x7e3,0x5fb,0xbae)+_0x425890(0x926,0x538,-0x3f0,-0x201)+_0x425890(0x9e5,0xf09,0x786,0x52c)),_0x3797bd['user'][_0x425890(0xce0,0xe82,0x45a,0x17d4)],_0x17aa6d),delete tebakgambar[_0x17aa6d[_0x17318e(0x1262,0x11e0,0xc2e,0xc86)][_0x17318e(0xa2a,0x482,0xab0,0x508)]('@')[-0x5*0x545+0x1da6+-0x34d]];}}else{if(_0x295ea5[_0x425890(-0x978,0x118,-0x853,0x2e3)](_0x52a010[-0x98f*-0x2+-0x4c2+-0xe5c*0x1],_0x295ea5['xnzOJ'])){if(tebakkata[_0x425890(0x539,0x679,0xb08,0xfa)+_0x17318e(0x11c0,0x13a8,0x133b,0x1522)](_0x17aa6d[_0x425890(0xc0e,0xa69,0x686,0x1260)][_0x17318e(0xc97,0x5f,-0x14a,0x508)]('@')[-0x60*0x3d+0x2*0xee6+-0x6ec]))return _0x295ea5[_0x17318e(0xe71,0x1093,0x18c3,0x1811)](_0x51481c,_0x425890(0xeb6,0xbc3,0xbd9,0x125e)+_0x425890(0xc8,0xafb,0xe36,0xeec)+_0x425890(0x7da,0x854,0x913,0x12b3)+'sions!');let _0x30e209=await fetchJson(_0x295ea5[_0x17318e(0x101e,0xe97,0x1093,0xd07)]),_0x201550=_0x30e209[Math[_0x425890(0x1b7d,0x1415,0x1aba,0xbf7)](_0x295ea5[_0x425890(0x14ec,0x115b,0x1987,0xae8)](Math[_0x425890(0x6c6,0x92e,0xa92,0x8c)](),_0x30e209[_0x425890(0x4f1,0x8bc,0x4f4,0x8de)]))];_0x3797bd['sendText'](_0x17aa6d[_0x425890(0x1456,0xcc7,0x37b,0x16b7)],'Please\x20Ans'+_0x425890(0xb59,0x1138,0xef3,0xdde)+_0x17318e(0x15b0,0x170d,0x140e,0x1314)+_0x425890(0x1a46,0x11c5,0x13d3,0x199e)+_0x201550[_0x425890(0x10ca,0xf04,0xa96,0xd79)]+(_0x17318e(0x1201,0x219,0x13c3,0xbc4)+_0x17318e(0x1280,0x1547,0xa05,0x130e)),_0x17aa6d)[_0x425890(0x633,0x1b3,0xc45,0x9fc)](()=>{function _0xd0f21a(_0x1cc6f0,_0x1fce91,_0x1a525c,_0x3dd44e){return _0x17318e(_0x1cc6f0-0x56,_0x1a525c,_0x1a525c-0x1be,_0x3dd44e-0xf7);}function _0x542f74(_0x5c6cac,_0x45f2d8,_0x34dbc5,_0x27a7df){return _0x17318e(_0x5c6cac-0x1a5,_0x5c6cac,_0x34dbc5-0xc7,_0x27a7df- -0x5eb);}tebakkata[_0x17aa6d[_0xd0f21a(0x5fa,0x1636,0x38e,0xd7d)]['split']('@')[0x1ae3*0x1+0x19bc+-0x349f]]=_0x201550[_0x542f74(0x372,0x961,0x85,0x47c)][_0x542f74(0x4e3,0x894,0x2fc,0x76b)+'e']();}),await _0x295ea5['eMHRc'](sleep,0x8ea1+-0x180d+-0x2*-0x39e6);if(tebakkata[_0x17318e(0x154,0x114f,0x77c,0x896)+'erty'](_0x17aa6d[_0x17318e(0xe4a,0xd9f,0xac3,0xc86)][_0x425890(-0x4fa,0x2eb,0xd54,-0x2e5)]('@')[-0x21bf+-0x1764+-0x1*-0x3923])){if(_0x425890(-0x2b,0xa57,0x14b8,0x12da)===_0x295ea5['qPaUY']){console['log'](_0x295ea5[_0x17318e(0x5ec,0x736,0x765,0xa9e)](_0x295ea5['qhMMW'],_0x201550[_0x17318e(0x222,0xfdd,0x14e1,0xa67)]));const _0x38b1d6={};_0x38b1d6[_0x425890(0x18a2,0x10a0,0xfb1,0x8d3)+'t']=_0x295ea5['RiRYO'];const _0x7b0bc0={};_0x7b0bc0[_0x425890(0x15e2,0xf77,0x12d8,0x5fc)]=_0x17318e(0x11a9,0x14a1,0x2014,0x169b),_0x7b0bc0[_0x17318e(0x139e,0x135a,0x1870,0x1318)]=_0x38b1d6,_0x7b0bc0[_0x17318e(0x17aa,0xf98,0x18ce,0x1638)]=0x1,_0x3797bd[_0x17318e(0x12ce,0x164f,0x11c6,0x12c4)+_0x425890(0xdbb,0xcec,0x7ef,0x6e5)](_0x17aa6d[_0x425890(0x9f8,0xcc7,0x7e5,0x11be)],[_0x7b0bc0],_0x17318e(0xfa4,0x169b,0xff5,0xc39)+_0x425890(0x462,0x8f8,0x92d,0x229)+tebakkata[_0x17aa6d[_0x425890(0x100,0xa69,0x914,0x641)][_0x425890(0x191,0x2eb,0x731,0xc96)]('@')[0x4*0x4f1+-0x3b*0x91+-0xf*-0xe9]]+(_0x17318e(0x106a,0x144c,0x1c19,0x13bf)+_0x425890(0x3a6,0x878,-0x200,0x2bd)+'?\x20PressThe'+_0x425890(0x85,0x538,0x17b,-0x300)+_0x17318e(0x138f,0x1a50,0xddd,0x1126)),_0x3797bd[_0x17318e(0xc57,0x1249,0x1631,0x12db)][_0x425890(0x652,0xe82,0x8f6,0x17de)],_0x17aa6d),delete tebakkata[_0x17aa6d[_0x17318e(0x1712,0x15a2,0x9f5,0xc86)]['split']('@')[-0x69*-0x1b+-0xc3d+0x12a]];}else var _0x306f02=_0x17318e(0xab9,0x1407,0x1b6f,0x1300)+_0x425890(0x1fcf,0x15ee,0x1a7a,0xd48)+_0x17318e(0xcee,-0x249,-0x176,0x62a)+'jpg';}}else{if(_0x295ea5[_0x425890(0x7d9,0x24a,0x157,0x6d5)](_0x52a010[0x1*0x1b5+-0x1*0xd13+0xb5e],_0x295ea5[_0x17318e(0x1168,0xb7a,0xa01,0x12b9)])){if('JiuEb'===_0x295ea5[_0x17318e(0xabe,0x1e99,0xc18,0x1469)]){if(tebakkalimat['hasOwnProp'+'erty'](_0x17aa6d['sender'][_0x17318e(0xc24,0xcec,-0x56,0x508)]('@')[0x1247+-0x5be+-0xc89*0x1]))return _0x295ea5[_0x425890(0xb8d,0x15f4,0x187d,0x1683)](_0x51481c,_0x425890(0x11b0,0xbc3,0x7b3,0xa86)+_0x17318e(0x1081,0xeea,0xb4c,0xd18)+_0x17318e(0xa8e,0xe68,0x106,0xa71)+_0x17318e(0x1859,0xf9a,0x1ca6,0x16dd));let _0x3eb2a6=await fetchJson(_0x295ea5['kxLJo']),_0xa7756b=_0x3eb2a6[Math[_0x425890(0xa30,0x1415,0x1ab3,0xeea)](_0x295ea5[_0x425890(0x2e7,0xb6a,0x93e,0x871)](Math[_0x17318e(0x6c4,0xd70,0x13ec,0xb4b)](),_0x3eb2a6[_0x425890(0x95d,0x8bc,0xa88,0x756)]))];_0x3797bd[_0x425890(0x1c01,0x12b2,0x19b6,0x11ca)](_0x17aa6d[_0x425890(0x35b,0xcc7,0x110a,0x1042)],_0x17318e(-0x9f,0x8a8,0x712,0x498)+_0x17318e(0x10cf,0x1076,0xd45,0x1355)+_0x17318e(0x8cb,0x12a2,0x1bd6,0x1314)+_0x425890(0x19d1,0x11c5,0xb82,0xced)+_0xa7756b[_0x17318e(0x11c1,0x13e9,0x1146,0x1121)]+('\x0aTime\x20:\x2060'+_0x425890(0x1405,0x10f1,0x1a5c,0x1678)),_0x17aa6d)[_0x17318e(0x109,0x7a0,-0x327,0x3d0)](()=>{function _0x5aec50(_0x525166,_0x53b97e,_0x701762,_0x4c3348){return _0x425890(_0x525166,_0x701762-0x172,_0x701762-0x110,_0x4c3348-0x103);}function _0x5a0534(_0x48b42e,_0x1db4c2,_0x2c9ac7,_0x5a9806){return _0x17318e(_0x48b42e-0xcb,_0x2c9ac7,_0x2c9ac7-0x156,_0x1db4c2- -0x2e0);}if(_0x295ea5[_0x5aec50(-0x178,-0x4d,0x35f,0xd61)](_0x295ea5['UkHlu'],_0x295ea5['UkHlu']))tebakkalimat[_0x17aa6d[_0x5a0534(0x5ba,0x9a6,0x1004,0xa3d)][_0x5aec50(0x5d5,0x47c,0x45d,0xe17)]('@')[0x859*0x1+-0x8*0x10f+0x1*0x1f]]=_0xa7756b['jawaban'][_0x5aec50(0x3c1,0x12b3,0xcab,0x12e0)+'e']();else{const _0x6da4ee={};_0x6da4ee[_0x5aec50(0x768,0x44a,0x35a,-0x18c)]=_0x5aec50(0x155c,0x92b,0x130e,0xaad)+_0x5aec50(0x9fd,0x4bf,0xf3e,0xe3d)+'💔💔*';const _0x6fd485={};_0x6fd485[_0x5a0534(0xb90,0x744,0x3d8,0xdab)]=_0x3c655d,_0x3c7785[_0x5aec50(0xa15,0x14f,0x591,0x68d)+'e'](_0x1c4ece,_0x6da4ee,_0x6fd485);}}),await _0x295ea5['dxIQk'](sleep,0xb0a5+-0x164d*-0x1+0x236e);if(tebakkalimat['hasOwnProp'+_0x17318e(0x14d3,0xab6,0x1a07,0x1522)](_0x17aa6d[_0x425890(0x9f,0xa69,0x421,0x15a)][_0x425890(-0x6c,0x2eb,0xa5f,-0x91)]('@')[0x281*0x1+0x560+-0x7e1])){if(_0x295ea5[_0x17318e(0x1b3a,0x157a,0x1b74,0x167c)](_0x425890(0x1244,0x860,0x714,0xcd5),_0x295ea5[_0x425890(0x137f,0x9ec,0xb22,0xf84)])){const _0x1d159b={};_0x1d159b[_0x17318e(0x17a1,0x9c4,0x99b,0x12bd)+'t']=_0x17318e(0x1373,0x9d4,0x1418,0xf38)+_0x425890(-0x1c2,0x4fd,0x436,0x85d);const _0x4c4b59={};_0x4c4b59[_0x17318e(0xeb9,0x122f,0xc57,0x1194)]='coffe',_0x4c4b59[_0x17318e(0xe90,0x1c59,0x1857,0x1318)]=_0x1d159b,_0x4c4b59[_0x17318e(0x19b0,0x1870,0x1950,0x1638)]=0x1;let _0x5c0084=[_0x4c4b59];const _0x1bc886={};_0x1bc886[_0x17318e(0xca3,0x113c,0xe5a,0x810)]=_0x295ea5['KHMMG'];const _0x2f8ac6={};_0x2f8ac6[_0x425890(0xd5c,0x381,0x647,0xada)]=_0x1bc886,_0x2f8ac6[_0x425890(0x549,0x30a,0x494,0x68f)]=_0x425890(0xe08,0xbba,0x783,0x12ff)+_0x425890(0x10e,0x3d5,0x19f,0x57),_0x2f8ac6[_0x425890(-0x714,0x37a,0xf0,-0x650)]=_0x2607c9[_0x17318e(0x1289,0x1961,0x17a5,0x12db)]['name'],_0x2f8ac6[_0x425890(0x19f1,0xf61,0xb7b,0xfd2)]=_0x5c0084,_0x2f8ac6[_0x17318e(0x1a0d,0x147e,0xb70,0x120c)]=0x4;let _0x315350=_0x2f8ac6;const _0x34b47b={};_0x34b47b[_0x17318e(0x138f,0x797,0x654,0xa24)]=_0x1508a4,_0x5d2bbb[_0x17318e(0x3fb,0x6fe,0x1004,0x63c)+'e'](_0xc39592[_0x17318e(0xa15,0x1043,0x140a,0xee4)],_0x315350,_0x34b47b);}else{console[_0x17318e(-0x48f,0x14b,0x3da,0x587)](_0x295ea5[_0x425890(0x6f2,0x881,0x3f4,0xe28)](_0x295ea5['qhMMW'],_0xa7756b['jawaban']));const _0x4e2895={};_0x4e2895[_0x425890(0x69c,0x10a0,0x1910,0x10d6)+'t']=_0x425890(0xeb6,0x64f,0x511,0xca3)+'Sentence';const _0x52d004={};_0x52d004[_0x17318e(0xd3a,0x1892,0x138e,0x1194)]=_0x295ea5[_0x17318e(0xf47,0x13cb,0x17fc,0x11f9)],_0x52d004[_0x17318e(0x10eb,0x13c3,0x9c2,0x1318)]=_0x4e2895,_0x52d004['type']=0x1,_0x3797bd[_0x17318e(0x16ad,0x1635,0x1395,0x12c4)+'Text'](_0x17aa6d[_0x425890(0x16ac,0xcc7,0x1101,0xff5)],[_0x52d004],_0x425890(0xaf9,0xa1c,0x5b4,0xe80)+'nswer:\x20\x20'+tebakkalimat[_0x17aa6d['sender'][_0x17318e(0xad9,0xdee,0x178,0x508)]('@')[0x1181*-0x1+0x1475+-0x6*0x7e]]+(_0x425890(0xeb6,0x11a2,0x193d,0x780)+_0x425890(0x1129,0x878,0x1016,0x9ff)+_0x17318e(0xd60,0x1ee,0x1346,0xa00)+_0x425890(-0x10d,0x538,0x77c,0xcb9)+'low'),_0x3797bd[_0x425890(0x12c0,0x10be,0xa9d,0x1240)]['name'],_0x17aa6d),delete tebakkalimat[_0x17aa6d[_0x17318e(0xdf6,0x12c6,0xe0d,0xc86)][_0x17318e(-0x48d,0x864,0xaee,0x508)]('@')[-0x5a4+-0x1*0x17d5+0x1d79]];}}}else{if(!_0x512ecd['isGroup'])return _0x295ea5[_0x425890(-0x4ee,0x16d,0x2e3,-0x93)](_0x5cf3ae,''+_0x477479[_0x17318e(0x1607,0x1234,0x1667,0xc0a)]);if(!_0x11e71d)return _0x295ea5['seDGO'](_0x416e34,''+_0x54ecc1['botAdmin']);if(!_0xa15897)return _0x295ea5['OygRy'](_0x8ac91d,''+_0x5d8477[_0x17318e(0x1369,0x19db,0x1a12,0x16d4)]);let _0xc0f8a6=_0x425890(0x432,0x7bb,0xd91,0x3ec)+_0x17318e(0x1315,0x16a6,0x19f2,0x1233)+'♥●•٠·«╝\x20\x0a\x20'+'\x0a\x20➲\x20*Messa'+_0x425890(-0x517,0x310,0xc5f,-0x196)+(_0x1e1a57?_0x5daad0:_0x295ea5[_0x425890(0x154a,0x1497,0x10fc,0x1cfc)])+_0x17318e(0x1d6c,0x105f,0xb86,0x1411);for(let _0x22d587 of _0x64a733){_0xc0f8a6+=_0x17318e(0x985,0x148c,0x128a,0xe92)+_0x22d587['id'][_0x425890(0x85d,0x2eb,-0x5b1,-0x5a9)]('@')[-0x1352*0x2+-0x3f*0x83+0x5*0xe2d]+'\x0a';}const _0x11a71c={};_0x11a71c[_0x425890(0xac6,0x807,0xda8,0x10e7)]=_0xe9e3f3,_0x5b0621[_0x17318e(0x10c2,0xea1,0x532,0x63c)+'e'](_0x21f909['chat'],{'text':_0xc0f8a6,'mentions':_0x5eb165[_0x17318e(0x1375,0x59f,0x10a9,0xd8c)](_0x27868d=>_0x27868d['id'])},_0x11a71c);}}else{if(_0x295ea5[_0x425890(0xeb7,0x14ca,0xbc2,0x1806)](_0x52a010[-0x3*-0x74d+-0x654+-0xf93],_0x295ea5[_0x17318e(0x174c,0x1b1e,0x11cc,0x1692)])){if(tebaklirik[_0x17318e(0x91,0x8b2,-0x11c,0x896)+_0x17318e(0x1256,0x1669,0x1a47,0x1522)](_0x17aa6d[_0x425890(0xbb5,0xa69,0x145d,0x116)]['split']('@')[-0x18f0+0x2b*-0xd6+0x3ce2]))return _0x51481c(_0x17318e(0x6a8,0x1105,0x1602,0xde0)+_0x425890(0x8ab,0xafb,0xcc0,0x87e)+_0x425890(0x10f7,0x854,0x17d,0xc0d)+_0x17318e(0x1892,0x13b8,0xd35,0x16dd));let _0x10f6ee=await _0x295ea5[_0x17318e(0xc8,-0x2df,0x8f1,0x468)](fetchJson,_0x295ea5['QRaMb']),_0x7fbf91=_0x10f6ee[Math[_0x17318e(0x1682,0x193c,0xc60,0x1632)](_0x295ea5[_0x425890(0xd68,0xfad,0xeef,0xa3d)](Math[_0x17318e(0x6c0,0xff5,0xe20,0xb4b)](),_0x10f6ee['length']))];_0x3797bd['sendText'](_0x17aa6d[_0x425890(0xf73,0xcc7,0x1364,0x6ff)],_0x425890(0x1a08,0x163e,0x10ed,0xf4b)+_0x17318e(0x6b9,0x788,0x10ea,0x8f3)+_0x17318e(0x157c,0xb7a,0x14b1,0x10ac)+_0x425890(0x774,0xb3d,0x13e2,0x115c)+_0x7fbf91[_0x17318e(0x1a2e,0x1b25,0x964,0x1121)]+(_0x425890(0xdc5,0xbb4,0xe4e,0x879)+'60\x20seconds'),_0x17aa6d)[_0x17318e(0x37e,0x297,-0x252,0x3d0)](()=>{const _0x5934a0={};function _0x4e9d10(_0x47a0f3,_0x62c8b9,_0x29b87c,_0x14252a){return _0x17318e(_0x47a0f3-0x10,_0x14252a,_0x29b87c-0x35,_0x62c8b9- -0x60c);}function _0x1ce54d(_0x4ebf1a,_0x5305c2,_0x3bad65,_0x5b2638){return _0x17318e(_0x4ebf1a-0xc4,_0x4ebf1a,_0x3bad65-0xc8,_0x5305c2- -0xa0);}_0x5934a0[_0x4e9d10(0xc19,0x4d4,0x5c1,0xa84)]=_0x295ea5['qhMMW'],_0x5934a0['bTuBY']=_0x295ea5[_0x1ce54d(0x1642,0x131c,0xfac,0x1a2a)],_0x5934a0['dMyof']=_0x4e9d10(0x14a,0x260,0x670,-0x60f)+_0x1ce54d(0x973,0x925,0xba2,-0xe8);const _0x464e17=_0x5934a0;if(_0x295ea5['PudNs'](_0x295ea5[_0x1ce54d(0xf67,0x11b8,0x1115,0x1262)],_0x295ea5[_0x4e9d10(0x9aa,0xc4c,0x1240,0x132e)])){_0x44cbb0[_0x4e9d10(0x24d,-0x85,0x866,0x3a3)](_0x464e17[_0x1ce54d(0x21,0xa40,0x273,0xb3c)]+_0x5199f3['jawaban']);const _0x56d81d={};_0x56d81d[_0x4e9d10(0x3d4,0xb88,0x9e2,0xc86)]=_0x464e17[_0x1ce54d(0x190e,0x129d,0xcca,0x1cef)],_0x56d81d[_0x1ce54d(0x1102,0x1278,0x1bb9,0x13ef)]={},_0x56d81d['type']=0x1,_0x56d81d[_0x1ce54d(0x1102,0x1278,0x1bb9,0x13ef)][_0x1ce54d(0x1b5a,0x121d,0xb1c,0x1ca1)+'t']=_0x464e17[_0x1ce54d(0x1bc4,0x133b,0xdc9,0x1951)],_0x297536[_0x4e9d10(0x9b9,0xcb8,0xb65,0x852)+_0x4e9d10(0x500,0x8fd,0x2d1,0x742)](_0x38d8a5[_0x1ce54d(0xfd6,0xe44,0x1338,0xca9)],[_0x56d81d],_0x4e9d10(-0x206,0x3fe,0x21d,-0x323)+_0x1ce54d(0x1088,0xa30,0xda0,0x134d)+_0x4e9d10(0x747,0x103f,0x1384,0xac9)+_0x35f083[_0xba2620[_0x1ce54d(0xf5b,0xbe6,0x6f8,0x5a3)]['split']('@')[-0xa3c+-0x651*0x1+0x1*0x108d]]+(_0x1ce54d(0x8fa,0x131f,0x92d,0xa34)+_0x4e9d10(0x2df,0x489,0x8c0,0x32a)+_0x4e9d10(-0x3b8,0x3f4,0xed,-0x5c1)+_0x4e9d10(0xa78,0x149,0x7da,-0x5ae)+'low'),_0x2d4b44[_0x4e9d10(0x12ae,0xccf,0x1154,0x13b4)][_0x1ce54d(0x560,0xfff,0x1803,0x5bb)],_0x298c59),delete _0x59bcbd[_0x2f8158[_0x4e9d10(0x281,0x67a,0xa9e,0x605)][_0x4e9d10(-0x534,-0x104,0x95e,0x938)]('@')[0x22*0xe6+-0x93*0x2b+-0x5db]];}else tebaklirik[_0x17aa6d[_0x1ce54d(0x3f3,0xbe6,0xdf2,0x160d)][_0x4e9d10(-0x4be,-0x104,-0x197,0x53e)]('@')[0x97*-0x1+-0x1*-0xe73+-0xddc]]=_0x7fbf91[_0x4e9d10(-0xe,0x45b,0x2dc,-0x1e1)][_0x4e9d10(0x84f,0x74a,0x2ee,0x5c)+'e']();}),await sleep(0xc076+-0x2dd9+-0x57c3*-0x1);if(tebaklirik['hasOwnProp'+_0x425890(0xbd0,0x1305,0xfdd,0x13b5)](_0x17aa6d[_0x17318e(0xb57,0x586,0x12c2,0xc86)][_0x17318e(0x185,0x37f,-0x582,0x508)]('@')[-0x2e8+0xa93*0x1+-0x7ab])){console[_0x425890(0x7dd,0x36a,-0x4e0,0xd7c)](_0x295ea5[_0x17318e(0x139f,0xc00,0x1278,0x14ff)](_0x295ea5[_0x425890(0x9e7,0x129a,0x1886,0xaf2)],_0x7fbf91['jawaban']));const _0x21baf0={};_0x21baf0[_0x17318e(0x11df,0xa71,0x1a03,0x1194)]=_0x295ea5[_0x425890(0x64a,0xc16,0x404,0x1506)],_0x21baf0[_0x17318e(0x1197,0x990,0xb67,0x1318)]={},_0x21baf0[_0x425890(0x12cf,0x141b,0x1515,0xfd8)]=0x1,_0x21baf0[_0x17318e(0x1197,0x990,0xb67,0x1318)][_0x17318e(0xff7,0x182b,0x12b6,0x12bd)+'t']=_0x295ea5[_0x17318e(0x19cc,0x1c4b,0x14e9,0x15dd)],_0x3797bd[_0x425890(0x14a6,0x10a7,0xd3d,0x11d4)+_0x425890(0x935,0xcec,0x749,0x559)](_0x17aa6d[_0x17318e(0x10a4,0x1564,0xbd6,0xee4)],[_0x21baf0],'Time\x20Out\x0aA'+_0x425890(0x223,0x8f8,0xcbd,0x480)+tebaklirik[_0x17aa6d[_0x425890(0xd3f,0xa69,0xf7b,0x14e2)][_0x17318e(-0x381,0x1b9,0xc59,0x508)]('@')[0xcf0*0x2+-0x1585+-0x45b]]+(_0x17318e(0xf99,0xa9e,0x403,0xc51)+'lay\x20Again?'+'\x20PressThe\x20'+_0x17318e(0xdc3,0xa8f,-0x27a,0x63f)+'ow'),_0x3797bd[_0x17318e(0xf97,0xaf6,0xf60,0x12db)][_0x425890(0xd4c,0xe82,0x184b,0xd5f)],_0x17aa6d),delete tebaklirik[_0x17aa6d[_0x17318e(0x1642,0xea7,0x614,0xc86)][_0x425890(0x7ac,0x2eb,0x9bb,-0x26d)]('@')[-0xfd6+0xd*0x1a8+-0x1e6*0x3]];}}else{if(_0x295ea5[_0x17318e(0xecc,0x1171,0xb6a,0x82c)](_0x52a010[0x596+0x19*-0x16d+-0x603*-0x5],_0x295ea5[_0x425890(0x835,0xa9d,0x14e8,0x40f)])){if(_0x295ea5['koyjA']!==_0x425890(0xa9e,0xdee,0xe89,0x473)){_0x17a859[_0x425890(0x97e,0x36a,0x4e1,0x6dd)](_0x295ea5[_0x425890(0x439,0xd67,0x3b0,0x79c)](_0x295ea5[_0x425890(0x1bca,0x129a,0x171e,0x908)],_0x2c6e6e['jawaban']));const _0x106208={};_0x106208['displayTex'+'t']=_0x425890(0xe5e,0x64f,-0x39e,0x1053)+'Song';const _0x3dd4b4={};_0x3dd4b4[_0x17318e(0x9e9,0x1967,0x1973,0x1194)]=_0x295ea5['NUSsw'],_0x3dd4b4[_0x17318e(0xef6,0x1252,0x8a8,0x1318)]=_0x106208,_0x3dd4b4['type']=0x1,_0x295d15[_0x425890(0x157e,0x10a7,0x11ec,0xff4)+_0x425890(0x12c4,0xcec,0x161a,0x1464)](_0x3abc12['chat'],[_0x3dd4b4],'Time\x20Has\x20R'+'un\x20Out\x0aAns'+_0x425890(0x111b,0x142e,0x1538,0x1e5e)+_0x1203d5[_0x51a14c[_0x425890(0xa44,0xa69,0x1e,0x656)]['split']('@')[-0x175d+0x1d1b*-0x1+0x92*0x5c]]+('\x0a\x0aWant\x20To\x20'+_0x425890(0x25d,0x2e8,0x4b9,-0x40)+_0x425890(0x51,0xa1e,0x4e0,0x8cc)+_0x17318e(0x4d7,0xcd2,-0x289,0x630)),_0x19db7d[_0x425890(0x14cd,0x10be,0xaec,0x196e)]['name'],_0x42bf1f),delete _0x5d3b1c[_0x3bc6f5[_0x17318e(0xa14,0xf36,0x5f8,0xc86)][_0x425890(0x29c,0x2eb,0x356,-0x65c)]('@')[-0x21b+0x1f*0xbd+-0x14c8]];}else{if(caklontong[_0x425890(0x6ea,0x679,0xf7c,0xe8f)+_0x17318e(0xcec,0x1b74,0xae9,0x1522)](_0x17aa6d[_0x425890(0x1313,0xa69,0xcca,0x9bb)][_0x425890(0x549,0x2eb,0x3eb,0x6e0)]('@')[-0x1*0x2647+-0x26da+0x4d21]))return _0x295ea5[_0x17318e(0xb42,-0x241,0x86e,0x533)](_0x51481c,_0x17318e(0x627,0x13d4,0x177a,0xde0)+_0x425890(0x458,0xafb,0x262,0x9e5)+'nished\x20Ses'+_0x425890(0x137f,0x14c0,0x1b8b,0x1784));let _0x484921=await _0x295ea5[_0x17318e(0x46a,0xdb9,0xa42,0x6b9)](fetchJson,_0x295ea5[_0x17318e(0x1782,0x1f5d,0x14ad,0x16f9)]),_0x50707c=_0x484921[Math[_0x425890(0xbb2,0x1415,0x1992,0x10af)](_0x295ea5[_0x17318e(-0x400,0x862,0x70a,0x519)](Math[_0x17318e(0xa32,0x131,0xada,0xb4b)](),_0x484921[_0x425890(0x2c2,0x8bc,0xe61,0xbac)]))];_0x3797bd['sendText'](_0x17aa6d['chat'],_0x17318e(0xd5f,0xa1c,0x113a,0x7e1)+_0x425890(-0x4e9,0x238,-0x7d9,-0x5d6)+_0x17318e(0xee6,0x153b,0x81a,0xdca)+_0x17318e(0x117f,0xbbd,0x1872,0x10b3)+_0x50707c[_0x425890(0xf35,0xf04,0x923,0xac2)]+(_0x17318e(0x9f3,0x9a8,0x1747,0x117c)+_0x425890(0x1047,0x971,0x42c,0x1048)),_0x17aa6d)[_0x425890(-0x761,0x1b3,-0x344,-0x138)](()=>{function _0x578e9f(_0x196bb9,_0x16ee12,_0x153658,_0x10f40d){return _0x425890(_0x10f40d,_0x16ee12- -0x32d,_0x153658-0x126,_0x10f40d-0x127);}function _0xfce7c3(_0x2c17b9,_0x119244,_0x2cb02d,_0x91bec0){return _0x17318e(_0x2c17b9-0x1a7,_0x2cb02d,_0x2cb02d-0xe9,_0x91bec0- -0x419);}caklontong[_0x17aa6d['sender'][_0x578e9f(0x997,-0x42,-0x905,0x1e0)]('@')[-0x43*-0x18+0x1*-0x1139+0xaf1]]=_0x50707c['jawaban']['toLowerCas'+'e'](),caklontong_desk[_0x17aa6d[_0x578e9f(0x661,0x73c,-0x87,0x915)][_0xfce7c3(-0x98b,-0x66,0x55e,0xef)]('@')[0x1*-0x16af+-0x154f+0x2bfe]]=_0x50707c[_0xfce7c3(0x11e2,0x1302,0x137e,0x1333)];}),await _0x295ea5[_0x17318e(0x52b,-0x5d,-0x260,0x5cb)](sleep,0x1*-0x156c2+0x1b904+0x881e);if(caklontong['hasOwnProp'+'erty'](_0x17aa6d[_0x425890(0x121d,0xa69,0x1ff,0x1229)][_0x425890(0x824,0x2eb,-0x562,0x953)]('@')[-0x7*-0xa1+0x1f53+0x11dd*-0x2])){if(_0x295ea5[_0x17318e(0x2ce,0x431,0x8b7,0xba2)](_0x425890(0x15c9,0x10cf,0xaa9,0x92b),_0x295ea5['vaGFp'])){console['log'](_0x295ea5[_0x425890(0x1029,0x66c,-0x3d1,-0x3cd)](_0x295ea5[_0x17318e(0xfc5,0x103d,0x1a0e,0x14b7)],_0x50707c['jawaban']));const _0x59966a={};_0x59966a[_0x17318e(0x191b,0x1b95,0x941,0x1194)]=_0x295ea5[_0x17318e(0x1e34,0x10a1,0x1c03,0x15d8)],_0x59966a[_0x425890(0x1921,0x10fb,0x11e3,0x100a)]={},_0x59966a[_0x425890(0x1d5f,0x141b,0x1a36,0x10ce)]=0x1,_0x59966a[_0x425890(0x1921,0x10fb,0x11e3,0x100a)]['displayTex'+'t']=_0x295ea5[_0x17318e(0xbde,0xfa9,0x107e,0x1533)],_0x3797bd[_0x425890(0x17ec,0x10a7,0x18c9,0x1afc)+_0x425890(0xf58,0xcec,0x10cd,0x788)](_0x17aa6d['chat'],[_0x59966a],'Time\x20Out\x0aA'+_0x17318e(0x972,0x355,0xdc2,0xb15)+caklontong[_0x17aa6d['sender'][_0x17318e(0x311,-0x1ab,0xc4c,0x508)]('@')[-0x862+-0x2*0x94d+0x2*0xd7e]]+(_0x17318e(0x83c,0xbe1,0x3d8,0x462)+_0x425890(0x5e6,0x89f,0x77,0x5e0))+caklontong_desk[_0x17aa6d['sender']['split']('@')[0x2b8+-0x1*-0xe95+-0x114d]]+(_0x425890(0x414,0xa34,0x1232,-0x7)+_0x17318e(0x1ab9,0x10cc,0x14bd,0x118a)+_0x425890(0xbad,0x976,0x53a,0x23c)+'Button\x20Bel'+'ow'),_0x3797bd[_0x425890(0xdcb,0x10be,0x1901,0x7cc)]['name'],_0x17aa6d),delete caklontong[_0x17aa6d[_0x17318e(0x1713,0xef5,0xf4d,0xc86)][_0x17318e(0xe87,-0x395,0x1d3,0x508)]('@')[-0x55f*-0x5+0x1a3d+-0x8*0x6a3]],delete caklontong_desk[_0x17aa6d[_0x17318e(0x2d7,0xd69,0x11f5,0xc86)][_0x425890(0x918,0x2eb,-0x113,0xc10)]('@')[-0x14*0x2d+0x7df+-0x1*0x45b]];}else{const _0x52f83c={};_0x52f83c['displayTex'+'t']=_0x17318e(0x154,0x755,0xdd5,0x55d)+'\x20⫸';const _0x3218ad={};_0x3218ad['buttonId']=_0x5f2000+_0x425890(-0x3a5,0x2ff,-0x78,0x6fb),_0x3218ad[_0x425890(0x9d2,0x10fb,0xc0a,0x101b)]=_0x52f83c,_0x3218ad[_0x425890(0x9e9,0x141b,0x1a68,0x166d)]=0x1;const _0x3f8a4a={};_0x3f8a4a[_0x17318e(0x1737,0x1181,0x1812,0x12bd)+'t']=_0x295ea5[_0x17318e(0x8b6,0x146c,0x193c,0xeee)];const _0xabf406={};_0xabf406[_0x17318e(0x179a,0x1c0e,0x9a3,0x1194)]=_0x590fb3+_0x17318e(0xaf7,0x1695,0x145b,0xc66),_0xabf406[_0x17318e(0x87c,0x1450,0x1180,0x1318)]=_0x3f8a4a,_0xabf406[_0x425890(0x1071,0x141b,0xb1d,0x1046)]=0x1;const _0x529697={};_0x529697[_0x17318e(0xb74,0x1616,0x18ee,0x12bd)+'t']=_0x295ea5[_0x425890(-0x1a7,0x384,-0xc9,0xab1)];const _0x37e0eb={};_0x37e0eb[_0x17318e(0x182e,0x1a53,0x1a25,0x1194)]=_0x5ebcf3+_0x425890(0x1849,0x1534,0x1819,0x1cac),_0x37e0eb[_0x17318e(0xb27,0x8fc,0xa81,0x1318)]=_0x529697,_0x37e0eb[_0x425890(0x16d8,0x141b,0x1108,0x18d9)]=0x1;let _0x1052d7=[_0x3218ad,_0xabf406,_0x37e0eb],_0x119a0d={'image':{'url':_0x295ea5[_0x17318e(0x864,0x159c,0xe99,0xecf)](_0x5dfd5b,_0x295ea5['KtiRX'])},'caption':_0x425890(-0x5c,0x618,-0x2a2,0x79d)+_0x146055+('\x20❮━━😎\x20\x0a┃╔═'+'═══💠\x20RANDO'+_0x425890(0x17d1,0x120b,0x1647,0x1bc7)+'\x20\x20\x20\x20\x20\x20\x20\x20\x0a┃'+'╠')+_0xd562d7+'\x20'+_0x408c60+_0x17318e(0x12fd,0x5d2,0x12df,0x956)+_0x4054b6+'\x20'+_0x5343bc+(_0x17318e(0x92,0xb0,0xb56,0xb2e)+_0x425890(0x837,0x198,-0x429,0x68e))+_0x4832b1+'\x20'+_0x19a9e6+(_0x425890(0x226,0x36d,-0x525,-0x4af)+_0x425890(0xc37,0x91f,0xdd6,0x4)+_0x425890(0x20d,0xa59,0xf2a,0xd79)+'\x20')+_0x168ad9+_0x425890(-0x6e,0x383,-0x48b,0xb90),'footer':_0x4ba3cd[_0x17318e(0x1024,0x1509,0x1c1a,0x12db)][_0x17318e(0x1a62,0x9be,0x1408,0x109f)],'buttons':_0x1052d7,'headerType':0x4};const _0xeb5706={};_0xeb5706[_0x425890(0xbd,0x807,0xe71,0x11d6)]=_0x525b69,_0x53ba44[_0x425890(-0x32d,0x41f,0xbd7,0x2f1)+'e'](_0x7c41ed[_0x17318e(0xd81,0x1012,0xb25,0xee4)],_0x119a0d,_0xeb5706);}}}}}}}}}}break;case _0x295ea5[_0x17318e(0x713,-0x6b,0x71c,0x618)]:{if(!_0x193cb6)throw mess[_0x425890(0x1c40,0x1277,0x7e7,0x1ba6)];const _0x4914af={};_0x4914af[_0x17318e(0x8a6,0x1338,0xc65,0xb1c)]=_0x17aa6d[_0x425890(0x1361,0xcc7,0x9ce,0x1207)],_0x4914af[_0x425890(0x933,0x409,0x5d8,0xc03)]=!![],_0x4914af['id']=_0x4413ec['id'];const _0x69c26b={};_0x69c26b[_0x425890(-0x1b3,0x1e8,0x7f4,0x138)]=_0x52a010[-0x250c+0x1b6*0x10+0x9ac],_0x69c26b['key']=_0x4914af;const _0x5323dc={};_0x5323dc['react']=_0x69c26b,reactionMessage=_0x5323dc,_0x3797bd[_0x17318e(-0xfc,0x63e,-0x430,0x63c)+'e'](_0x17aa6d['chat'],reactionMessage);}break;case _0x295ea5[_0x425890(0xb51,0x14b9,0xd39,0x1c84)]:case _0x295ea5['GSlAg']:{if(_0x295ea5['ZaAQD']!=='JMUQq'){let _0x256a79=_0x425890(0x1d8b,0x1489,0xa46,0xdfa)+_0x425890(-0x1d,0x4e6,0xdc4,-0x267)+_0x17318e(0x5e7,0xa2d,0x31c,0xdbc)+_0x2c7bd4+_0x425890(0x4ee,0xf4d,0x135b,0x73b)+_0x52f13e+(_0x425890(0x1144,0xca1,0x407,0x1203)+_0x17318e(0x7b2,0x1025,0xf14,0xa1c))+_0x58df86,_0x399be4=[{'buttonId':''+_0x295ea5[_0x425890(0x1142,0x10b4,0x19a8,0x916)](_0x578bec,_0x59fbd0),'buttonText':{'displayText':_0x295ea5[_0x17318e(0x11f1,0x10e4,0xc9f,0x1071)]},'type':0x1}];const _0xab3038={};_0xab3038['url']=_0x295ea5['WCJqa'];const _0xf5d9f3={};_0xf5d9f3['image']=_0xab3038,_0xf5d9f3[_0x17318e(-0x19a,0xbb4,-0x539,0x527)]=_0x256a79,_0xf5d9f3[_0x425890(-0x1ec,0x37a,0x14a,-0x150)]=_0x1a2d8a,_0xf5d9f3[_0x17318e(0x1553,0xd9f,0x107e,0x117e)]=_0x399be4,_0xf5d9f3[_0x17318e(0x18fe,0x18c6,0x14df,0x120c)]=0x4;let _0x16f920=_0xf5d9f3;const _0x1e1cd3={};_0x1e1cd3[_0x17318e(0x7fb,0xeeb,0x77c,0xa24)]=_0x186131,_0x4a5b25['sendMessag'+'e'](_0x3e148f,_0x16f920,_0x1e1cd3);}else{if(kuismath['hasOwnProp'+_0x17318e(0x1f75,0x1369,0x140e,0x1522)](_0x17aa6d[_0x17318e(0x4ae,0x10ce,0x1591,0xc86)][_0x425890(-0x71b,0x2eb,-0x5d1,0x748)]('@')[0x269b+-0x188a+-0xe11*0x1]))return _0x295ea5[_0x17318e(0x46f,0xd4d,0x774,0xd6f)](_0x51481c,_0x17318e(0x910,0xe4f,0xa43,0xde0)+_0x17318e(0x16d5,0x980,0x10eb,0xd18)+_0x425890(0x2b2,0x854,0x135,0xdd6)+'sions!');let {genMath:_0x5a8dd4,modes:_0x2e1c7e}=_0x295ea5[_0x17318e(0x39c,0xcbe,0x2b3,0xb0a)](require,_0x295ea5[_0x17318e(0xcd3,0x315,-0x366,0x3c5)]);if(!_0x116129)return _0x295ea5['DFEkO'](_0x51481c,_0x17318e(0xefa,0x215,0x885,0xa96)+Object[_0x17318e(0x1674,0xe83,0x1050,0xe78)](_0x2e1c7e)['join'](_0x295ea5[_0x17318e(0x1b98,0x1a8f,0x1d6a,0x13ff)])+('\x0aFor\x20Examp'+_0x17318e(0x1562,0x1512,0x135a,0x132e))+_0x4fea53+(_0x17318e(0xb8d,0x10b8,0x13c,0x719)+'m'));let _0x4d0db2=await _0x5a8dd4(_0x116129[_0x425890(0x1fd,0xb39,0xbe3,0xee3)+'e']());_0x3797bd[_0x17318e(0x1c8f,0xb93,0xd05,0x14cf)](_0x17aa6d[_0x425890(0x931,0xcc7,0x151a,0x143e)],'*What\x20Is\x20T'+_0x425890(0xc96,0x14f7,0x14b0,0x14a9)+_0x17318e(0x1761,0x1477,0x133a,0x165f)+_0x4d0db2[_0x17318e(0xb9d,0x1b30,0x8ef,0x1121)][_0x425890(0xd5,0xb39,0x151a,0x108d)+'e']()+'*?\x0a\x0aTime:\x20'+_0x295ea5[_0x425890(0x10d8,0x14b4,0x18a1,0x17fe)](_0x4d0db2[_0x17318e(0x13ef,0x12e2,0x13d8,0xb24)],-0x1f*-0x97+-0x1*-0x25f3+-0x18a*0x22)[_0x17318e(0x2bc,0x631,0x90f,0x959)](-0x491*-0x7+0x1*0x1a50+0x7*-0x853)+'\x20second',_0x17aa6d)[_0x17318e(-0x5ac,0x568,-0x229,0x3d0)](()=>{function _0x259828(_0x4709af,_0x2329b1,_0x5818e0,_0x19286d){return _0x17318e(_0x4709af-0xe5,_0x4709af,_0x5818e0-0x12d,_0x19286d- -0x5ad);}function _0x5b3e97(_0x26c4fc,_0x46b866,_0x54ca03,_0x2be9d6){return _0x425890(_0x2be9d6,_0x46b866-0x8f,_0x54ca03-0x4d,_0x2be9d6-0x1d2);}kuismath[_0x17aa6d[_0x5b3e97(0x122c,0xaf8,0x1502,0x1184)][_0x259828(-0x6d4,0x604,0x5a5,-0xa5)]('@')[-0x393+-0xb13+0x2*0x753]]=_0x4d0db2[_0x5b3e97(0x124d,0x8d9,0x11b7,0xef6)];}),await _0x295ea5[_0x425890(0x800,0xe4a,0x517,0x8fa)](sleep,_0x4d0db2[_0x425890(-0x66,0x907,0x87e,0xe21)]);if(kuismath[_0x425890(-0x28a,0x679,0x2af,0x175)+_0x17318e(0x1fc0,0x1052,0x1b9a,0x1522)](_0x17aa6d['sender'][_0x17318e(0xa38,0xccf,0xd8b,0x508)]('@')[0x32d*0x1+0x1*0x2213+0x950*-0x4])){if(_0x295ea5['eKNAh'](_0x17318e(0x891,-0x71,0x100c,0x605),_0x295ea5[_0x17318e(0x964,0x1197,0x1e3a,0x13e9)]))console['log'](_0x295ea5[_0x17318e(0x1889,0x1aed,0x17e0,0x14b7)]+_0x4d0db2[_0x17318e(0x41,0x9bf,0x526,0xa67)]),_0x295ea5['bSvTU'](_0xcd1d32,_0x295ea5[_0x425890(0xf0c,0x52a,0x91f,0x5c6)](_0x295ea5[_0x425890(0x1ddc,0x1513,0x17e3,0x1bb5)],kuismath[_0x17aa6d[_0x17318e(0x15c4,0x132a,0x10aa,0xc86)]['split']('@')[0x26a1*-0x1+-0x259*-0x4+-0x1f3*-0xf]])),delete kuismath[_0x17aa6d[_0x17318e(0x10fc,0x8e7,0x477,0xc86)]['split']('@')[-0x1b58+0x14c7+0x691]];else{if(this[_0x17318e(-0x21,-0x23e,0xb28,0x55a)][_0x2d9ce6])_0x391c7a[_0x17318e(0x1bd8,0x1b15,0xd57,0x14cf)](_0x33fd6f['chat'],_0x17318e(0x1967,0xf74,0x10c5,0x184e)+_0x17318e(0x1086,0x1282,0x73,0xa5a),_0x4bcb93);delete this[_0x425890(-0x4fb,0x33d,0x5f6,-0x750)][_0x2ca8ce];}}}}break;case _0x295ea5['ayxKf']:{if(_0x295ea5[_0x425890(0x1df5,0x149b,0x1a0a,0x1b71)](_0x295ea5['iIAYJ'],_0x295ea5[_0x425890(0x6ad,0xdbf,0x1554,0x11d1)])){if(!_0x17aa6d[_0x17318e(0x1ec,0x5cd,-0x4e,0x532)])return _0x295ea5[_0x17318e(0x181d,0xb51,0xc20,0x146d)](_0x51481c,''+mess[_0x425890(-0x8,0x9ed,0x810,0xf0d)]);let _0x26934c=_0x8ee05e[_0x425890(0x1359,0xb6f,0x13bf,0x1605)](_0x4f9d88=>_0x4f9d88['id']),_0x1ede32=_0x17aa6d['sender'],_0x2deded=_0x26934c[Math[_0x17318e(0x1b43,0x1505,0xc4c,0x1632)](Math[_0x17318e(0xa2e,0xedd,0xb89,0xb4b)]()*_0x26934c['length'])],_0x1daa4a=_0x17318e(0x13ae,0x675,0xa9f,0xa0e)+_0x17318e(0x5c9,-0x544,-0x200,0x422)+_0x1ede32[_0x425890(0x874,0x2eb,0xcd6,-0x63)]('@')[-0x5*0x27b+-0xef9+-0x10*-0x1b6]+_0x17318e(-0x1a2,0x5f4,0xcbe,0x48b)+_0x2deded[_0x17318e(0x7b2,-0x62,-0x44,0x508)]('@')[-0x10a5*0x2+0xff*0xf+-0x29f*-0x7],_0x2447d5=[_0x1ede32,_0x2deded];const _0x354a3d={};_0x354a3d['displayTex'+'t']='❤️';const _0x5711c9={};_0x5711c9[_0x425890(0x1964,0xf77,0x98e,0x518)]='❤️',_0x5711c9[_0x17318e(0x18a7,0x1074,0x914,0x1318)]=_0x354a3d,_0x5711c9[_0x425890(0x1d4b,0x141b,0x9c0,0xd91)]=0x1;let _0x3ce852=[_0x5711c9];const _0x3a25ce={};_0x3a25ce[_0x17318e(0x1971,0x1a7f,0x108a,0x1022)]=_0x2447d5,await _0x3797bd[_0x425890(0x187a,0x10a7,0x89e,0x1305)+'Text'](_0x17aa6d[_0x425890(0xa8d,0xcc7,0xe7d,0x77f)],_0x3ce852,_0x1daa4a,_0x3797bd[_0x17318e(0x1a6e,0x1204,0x1091,0x12db)][_0x425890(0xc7b,0xe82,0x701,0xba3)],_0x17aa6d,_0x3a25ce);}else{if(_0x295ea5['TkmnQ'](_0x13faeb[_0x17318e(0x141d,0xd57,0x11fd,0xaf8)],_0x295ea5['wQSJW']))return;if(_0x295ea5[_0x425890(0xe77,0x60f,0x5d,0xc4d)](_0x51fc97[_0x425890(0xacc,0x8db,0x816,0x2ad)],_0x425890(0x1d7b,0x162e,0x17f2,0x1248))){const _0x17344c={};_0x17344c[_0x425890(-0x62c,0x1e8,0x4b6,0x299)]='*බැරි\x20නම්\x20'+_0x17318e(0x85f,0xefb,0x7c8,0xa59)+'*';const _0x32ad19={};_0x32ad19[_0x17318e(0xc92,0x141,0xf3c,0xa24)]=_0x4225ac,_0x570809[_0x17318e(0xe9b,0x1bf,0x77f,0x63c)+'e'](_0x54f043,_0x17344c,_0x32ad19);}}}break;case _0x425890(0x615,0xf2c,0xa24,0x688):{if(_0x295ea5['upNDl'](_0x295ea5[_0x425890(0xc6d,0x1dc,0x3ef,-0x4bb)],_0x295ea5['tWDiM'])){if(!_0x17aa6d[_0x17318e(-0x20e,0x449,-0x2e9,0x532)])return _0x295ea5[_0x425890(0x988,0xb4a,0x104d,0xd6c)](_0x51481c,''+mess['group']);let _0x2c9284=_0x8ee05e['map'](_0x453152=>_0x453152['id']),_0x32a2f5=_0x2c9284[Math[_0x425890(0x18df,0x1415,0xee4,0x1cfc)](_0x295ea5[_0x17318e(0x3ef,0x8c3,-0x72,0x874)](Math[_0x425890(0xb02,0x92e,0x563,0x19d)](),_0x2c9284[_0x425890(0x33a,0x8bc,0x913,0x68)]))],_0x51a12a=_0x2c9284[Math[_0x425890(0x140a,0x1415,0xaae,0x1bc2)](_0x295ea5[_0x17318e(0x9a4,0x18d,0xd73,0x520)](Math[_0x17318e(0x4b7,0x372,0x212,0xb4b)](),_0x2c9284['length']))],_0x225979='@'+_0x32a2f5['split']('@')[0x3*0x39a+0x76*0x28+-0x1d3e]+_0x425890(-0x364,0x26e,-0x584,0x4ea)+_0x51a12a[_0x425890(0x252,0x2eb,0x12e,-0x607)]('@')[0x21d8+0x13f9+-0x35d1]+(_0x425890(-0x1be,0x11a,-0x33a,-0x1f8)+_0x425890(0xe73,0x1022,0x183f,0x1532)+_0x17318e(0x3a7,0x1401,0x13d,0x9ca)+_0x17318e(0x1bfb,0x1c7d,0x8dd,0x1255)),_0x4ad1d9=[_0x32a2f5,_0x51a12a];const _0x262327={};_0x262327['displayTex'+'t']='❤️';const _0x6f21c1={};_0x6f21c1[_0x425890(0x18ca,0xf77,0x13c3,0x1201)]='❤️',_0x6f21c1[_0x425890(0x1425,0x10fb,0x161b,0x184d)]=_0x262327,_0x6f21c1[_0x17318e(0x1760,0x1f8e,0x107c,0x1638)]=0x1;let _0x38c91a=[_0x6f21c1];const _0x3ffb0d={};_0x3ffb0d[_0x425890(0x934,0xe05,0xa74,0x6a0)]=_0x4ad1d9,await _0x3797bd['sendButton'+_0x425890(0x2d5,0xcec,0x652,0xfd7)](_0x17aa6d[_0x425890(0x795,0xcc7,0x718,0x1143)],_0x38c91a,_0x225979,_0x3797bd[_0x425890(0x1936,0x10be,0x17a7,0x1850)]['name'],_0x17aa6d,_0x3ffb0d);}else{const _0x428896={};_0x428896[_0x425890(0x8e3,0x1e8,0x951,0x535)]=_0x17318e(0x862,0x13e7,0x1821,0x1198)+'*';const _0x454f2e={};_0x454f2e[_0x425890(0x668,0x807,0x5e9,0x11d1)]=_0x485143,_0x28cb9b['sendMessag'+'e'](_0x244a88,_0x428896,_0x454f2e);}}break;case'is':if(global['chatbotpre']===_0x295ea5['wQSJW'])return;if(!_0x116129)return _0x295ea5[_0x17318e(0xb2a,-0x2f1,0x557,0x56d)](_0x51481c,_0x17318e(0x1125,0x13e7,0x641,0xb35)+_0x425890(0xd19,0xb08,0x342,0xc1)+(_0x4fea53+_0x1cbc75)+(_0x425890(0x10a2,0xf56,0xe2d,0x189a)+'d\x20'));const _0x102927=[_0x425890(0xba3,0x8d7,-0x96,0x67f),'No',_0x17318e(0xa35,0x570,0xf64,0x745)+'e','Thats\x20righ'+'t'],_0x29b161=_0x102927[Math[_0x17318e(0x206f,0x156e,0x1a1c,0x1632)](_0x295ea5[_0x17318e(0xc66,0xe45,0xdf0,0xf03)](Math[_0x17318e(0x74d,0xb10,0x212,0xb4b)](),_0x102927[_0x17318e(0x11e1,0xc24,0x44d,0xad9)]))],_0x159510={};_0x159510[_0x425890(-0x128,0x1e8,0x424,0xa06)]=_0x425890(0xc6c,0x5dc,0xb27,0xebd)+_0x425890(0xbf4,0x1170,0xb53,0xdcf)+q+'\x0aAnswer\x20:\x20'+_0x29b161;const _0x3f3f13={};_0x3f3f13[_0x425890(-0x100,0x807,0x125b,0xfc8)]=_0x17aa6d,_0x3797bd[_0x425890(0x69c,0x41f,0x87e,0x53f)+'e'](_0x146a84,_0x159510,_0x3f3f13);break;case _0x295ea5[_0x17318e(0x77b,0xc30,0x6b,0x385)]:if(_0x295ea5[_0x425890(0x1d0,0xb5b,0x798,0xd36)](global['chatbotpre'],'false'))return;if(!_0x116129)return _0x51481c(_0x425890(0x784,0x918,0x6d8,0xde9)+_0x17318e(0x1537,0x14f4,0xba1,0xd25)+_0x295ea5[_0x425890(0xc42,0xe9f,0x807,0x105e)](_0x4fea53,_0x1cbc75)+(_0x425890(0x583,0xf56,0xd7c,0xb8e)+'d\x20'));const _0x34dea1=[_0x425890(0x5d,0x272,0x48,0xae3)+'f','I\x20Dont\x20Kno'+'w',_0x425890(0xd8a,0x1249,0x17d2,0x7ed)+_0x425890(0x319,0xd1d,0xd2b,0x7dd)+_0x17318e(0x8b7,0xcec,0x41e,0x4ab)],_0x9cba16=_0x34dea1[Math[_0x425890(0x1760,0x1415,0x1a89,0x1ca7)](_0x295ea5[_0x17318e(0x182a,0x660,0x1933,0x108f)](Math[_0x425890(0x195,0x92e,0x370,0x1098)](),_0x34dea1[_0x17318e(0x149b,0x475,0x687,0xad9)]))],_0x398352={};_0x398352[_0x425890(0x742,0x1e8,0x934,-0x524)]='Question\x20:'+_0x425890(0x1327,0xf21,0x6aa,0x113c)+q+_0x425890(0x7c0,0xc3e,0x11e4,0x20f)+_0x9cba16;const _0x20da09={};_0x20da09[_0x17318e(0x7c4,0x1039,0x1cc,0xa24)]=_0x17aa6d,_0x3797bd[_0x425890(0xae9,0x41f,-0x672,0xe94)+'e'](_0x146a84,_0x398352,_0x20da09);break;case _0x295ea5['hAZXz']:if(global[_0x425890(0x1255,0x8db,0x135c,0x10e1)]===_0x17318e(0xe13,0x1f2c,0x1b41,0x14cc))return;if(!_0x116129)return _0x295ea5['WIYRf'](_0x51481c,_0x17318e(0xbc7,0x1154,0x112f,0xb35)+_0x425890(0xf57,0xb08,0xf2a,0x6bc)+_0x295ea5[_0x425890(0xd50,0xd18,0x1627,0x761)](_0x4fea53,_0x1cbc75)+(_0x17318e(0xcc2,0x94e,0x1832,0xec0)+_0x425890(0x640,0x1091,0xa9b,0x12c6)));const _0x5e4270=['Can',_0x425890(0x176a,0x118b,0x156f,0x10c6),_0x425890(0x149,0x7ab,0x826,0x16),_0x425890(-0x443,0x5d3,0x756,-0xa9)+_0x425890(0x1a8b,0x14aa,0x1b31,0xf2a)],_0xe42c45=_0x5e4270[Math[_0x425890(0x1094,0x1415,0xebf,0x1109)](Math[_0x17318e(0x22f,0x9d7,0xc33,0xb4b)]()*_0x5e4270[_0x425890(0x93,0x8bc,0x3d6,0x87c)])],_0x3a8701={};_0x3a8701[_0x425890(0xb01,0x1e8,-0x6bc,-0x192)]='Question\x20:'+_0x425890(0x8fc,0x6f8,0xf5e,0x2f7)+q+_0x425890(0x117a,0xc3e,0xf12,0x7dc)+_0xe42c45;const _0x550428={};_0x550428['quoted']=_0x17aa6d,_0x3797bd[_0x17318e(-0x5b,-0x1c8,0x2f0,0x63c)+'e'](_0x146a84,_0x3a8701,_0x550428);break;case'how':if(_0x295ea5['zqBGt'](global[_0x17318e(0xed,0x1135,0x810,0xaf8)],_0x17318e(0xd01,0x1e9f,0x1cac,0x14cc)))return;if(!_0x116129)return _0x295ea5[_0x425890(0xad4,0x1227,0x835,0x84d)](_0x51481c,_0x425890(0x2dc,0x918,0x1250,0x11de)+_0x425890(0x821,0xb08,0x85f,0x73e)+_0x295ea5['CMrYs'](_0x4fea53,_0x1cbc75)+(_0x425890(0x64e,0xc97,0xa73,0xfdc)+'e'));const _0x4bbdbc=[_0x425890(0xc6e,0x30f,-0x11e,0xbf6),_0x425890(-0x22,0x577,0x9d8,0x8bc)+'cult\x20Bro','Sorry\x20Bot\x20'+_0x425890(0xb6c,0x46e,0x4eb,0xde1)+'er',_0x17318e(0x10c8,0x1b83,0x19f2,0x16eb)+_0x17318e(0x4d7,0x10f6,0x6e9,0xf5d)+_0x17318e(0xb48,0xb46,-0x2b8,0x6eb),_0x425890(0x1d5c,0x151f,0x1b63,0x12e8)+_0x425890(-0x289,0x2e3,0x526,0x1ff),_0x17318e(0x6fb,0x1566,0x17b5,0xffc),_0x17318e(0x17c1,0x1453,0x13d4,0x16ea)+':(',_0x425890(0xb00,0x1440,0x1972,0x18ed)+'t,\x20Boss:(',_0x425890(0xa2b,0xee1,0x5c6,0x61d)+'u?'],_0x46ce56=_0x4bbdbc[Math['floor'](Math[_0x425890(0xc3a,0x92e,0xbe7,0x10c3)]()*_0x4bbdbc['length'])],_0x3e679c={};_0x3e679c['text']='Question\x20:'+'\x20'+q+(_0x17318e(0x68d,0x945,0x15f4,0xe5b)+_0x425890(0xd9b,0x66e,0x24,-0x33))+_0x46ce56;const _0x50a983={};_0x50a983[_0x17318e(0x499,0x78e,0x1040,0xa24)]=_0x17aa6d,_0x3797bd[_0x425890(0x63,0x41f,-0x3f6,0xeaa)+'e'](_0x146a84,_0x3e679c,_0x50a983);break;case _0x295ea5[_0x17318e(0x1cdb,0x12cb,0x106d,0x12ac)]:if(_0x295ea5[_0x425890(0x22c,0x497,0xaa0,0xdfc)](global[_0x17318e(0x14c3,0xfaf,0xdf2,0xaf8)],_0x295ea5[_0x425890(0xc34,0xcca,0x70c,0x588)]))return;if(!_0x116129)return _0x51481c(_0x425890(0x1320,0x918,0x8b5,0x1270)+_0x425890(0x429,0xb08,0x3bf,0x2dd)+_0x295ea5[_0x425890(0xe85,0x130b,0x8de,0x904)](_0x4fea53,_0x1cbc75)+_0x17318e(0x163e,0x12a0,0xe11,0x13d0));const _0x5a85eb=['1','2','3','4','5','6','7','8','9','10','11','12','13','14','15','16','17','18','19','20','21','22','23','24','25','26','27','28','29','30','31','32','33','34','35','36','37','38','39','40','41','42','43','44','45','46','47','48','49','50','51','52','53','54','55','56','57','58','59','60','61','62','63','64','65','66','67','68','69','70','71','72','73','74','75','76','77','78','79','80','81','82','83','84','85','86','87','88','89','90','91','92','93','94','95','96','97','98','99',_0x295ea5[_0x425890(0x1ac5,0x1152,0xa36,0x734)]],_0x2a9b8e=_0x5a85eb[Math['floor'](_0x295ea5[_0x425890(0x4d5,0x657,0xbdf,0x8db)](Math[_0x425890(0x11ef,0x92e,0x2b,0xd05)](),_0x5a85eb[_0x17318e(0x97c,0x349,0x904,0xad9)]))],_0x602704={};_0x602704[_0x425890(0x920,0x1e8,0x38f,-0x3dd)]=_0x17318e(0x176b,0x666,0x60f,0xef4)+q+(_0x425890(0x666,0xc3e,0xf28,0x12b7)+'*')+_0x2a9b8e+'%*';const _0x2fb190={};_0x2fb190[_0x425890(0x37a,0x807,-0x281,0x134)]=_0x17aa6d,_0x3797bd[_0x17318e(0x83b,0xf09,-0x313,0x63c)+'e'](_0x146a84,_0x602704,_0x2fb190);break;case _0x295ea5[_0x425890(0x15e0,0x1147,0x9a2,0x1a79)]:if(!_0x116129)return _0x295ea5[_0x17318e(0x138,0x66b,0x82f,0x4f0)](_0x51481c,'Tag\x20Someon'+_0x425890(0xac6,0x2f7,0xd7e,0x4b1)+_0x425890(0x5a9,0x7ff,0x5dc,0xb68)+_0x295ea5['MKviD'](_0x4fea53,_0x1cbc75)+_0x17318e(-0x7c,0xdf6,-0x163,0x5d4));const _0x439bd0=['1','2','3','4','5','6','7','8','9','10','11','12','13','14','15','16','17','18','19','20','21','22','23','24','25','26','27','28','29','30','31','32','33','34','35','36','37','38','39','40','41','42','43','44','45','46','47','48','49','50','51','52','53','54','55','56','57','58','59','60','61','62','63','64','65','66','67','68','69','70','71','72','73','74','75','76','77','78','79','80','81','82','83','84','85','86','87','88','89','90','91','92','93','94','95','96','97','98','99',_0x17318e(0xf04,0x4f2,0x9be,0xdf4)],_0x3b4345=_0x439bd0[Math[_0x425890(0x1bfb,0x1415,0xbed,0x9b2)](Math[_0x17318e(0x1005,0x446,0x1ab,0xb4b)]()*_0x439bd0['length'])],_0x238c89={};_0x238c89[_0x17318e(0xbd6,0x412,0x58c,0x405)]='*'+_0x1cbc75+_0x425890(0x142a,0x9ab,0x11c6,0x70d)+q+(_0x425890(0x871,0xc3e,0x157e,0xe12)+'*')+_0x3b4345+'%*';const _0x46185f={};_0x46185f[_0x425890(0x10ef,0x807,-0x17,0x540)]=_0x17aa6d,_0x3797bd[_0x17318e(0x58e,0xedb,0x660,0x63c)+'e'](_0x146a84,_0x238c89,_0x46185f);break;case _0x295ea5[_0x425890(0x62,0x3bb,0x3b8,-0x3e0)]:if(!_0x116129)return _0x295ea5[_0x17318e(0xbf4,0xdd2,0xdff,0x1380)](_0x51481c,'Tag\x20Someon'+'e,\x20Example'+_0x17318e(0x758,0x8b,0x83c,0xa1c)+_0x295ea5[_0x425890(0x1420,0x12e2,0x847,0xaca)](_0x4fea53,_0x1cbc75)+_0x425890(-0x1db,0x3b7,0x7d1,-0x198));const _0x36a9b7=['1','2','3','4','5','6','7','8','9','10','11','12','13','14','15','16','17','18','19','20','21','22','23','24','25','26','27','28','29','30','31','32','33','34','35','36','37','38','39','40','41','42','43','44','45','46','47','48','49','50','51','52','53','54','55','56','57','58','59','60','61','62','63','64','65','66','67','68','69','70','71','72','73','74','75','76','77','78','79','80','81','82','83','84','85','86','87','88','89','90','91','92','93','94','95','96','97','98','99',_0x295ea5[_0x425890(0xeeb,0x1152,0xfd1,0xbaa)]],_0x19c85f=_0x36a9b7[Math[_0x425890(0x15f6,0x1415,0x1299,0x1e5f)](_0x295ea5[_0x17318e(0xf3c,0xf03,0x79d,0x874)](Math[_0x17318e(0x441,0x84f,0xbcd,0xb4b)](),_0x36a9b7[_0x425890(0x886,0x8bc,0x28c,0x184)]))],_0x1b879b={};_0x1b879b[_0x17318e(-0x246,-0x42e,0x644,0x405)]='*'+_0x1cbc75+'*\x0a\x0aNama\x20:\x20'+q+('\x0aAnswer\x20:\x20'+'*')+_0x19c85f+'%*';const _0x44995b={};_0x44995b[_0x17318e(0x842,0x81b,0x1d2,0xa24)]=_0x17aa6d,_0x3797bd['sendMessag'+'e'](_0x146a84,_0x1b879b,_0x44995b);break;case _0x295ea5[_0x425890(0x232,0x3a1,0x505,0x1ea)]:case _0x295ea5[_0x17318e(0x141a,0x185c,0x1460,0x1687)]:case _0x295ea5['cFswt']:case _0x295ea5['ezmFg']:case _0x295ea5[_0x17318e(0x104f,0x159f,0x1260,0x16a7)]:case _0x295ea5[_0x17318e(0x134d,0x159f,0x1b14,0x12f5)]:case _0x295ea5['AhnSJ']:case _0x425890(-0x8cd,0x19a,0x1e3,0xa37)+'k':case _0x295ea5['XgKdc']:case _0x295ea5[_0x17318e(0xcf4,-0x2b0,-0x600,0x3dc)]:if(!_0x116129)return _0x295ea5[_0x425890(0xb1f,0x301,-0x94,0x49a)](_0x51481c,_0x17318e(0xde,0x11a,0x970,0x73b)+'e,\x20Example'+_0x425890(0x6ba,0x7ff,0x90c,0xcfa)+(_0x4fea53+_0x1cbc75)+_0x425890(0xb7b,0x3b7,0xe35,0xe45));const _0x41e375=['1','2','3','4','5','6','7','8','9','10','11','12','13','14','15','16','17','18','19','20','21','22','23','24','25','26','27','28','29','30','31','32','33','34','35','36','37','38','39','40','41','42','43','44','45','46','47','48','49','50','51','52','53','54','55','56','57','58','59','60','61','62','63','64','65','66','67','68','69','70','71','72','73','74','75','76','77','78','79','80','81','82','83','84','85','86','87','88','89','90','91','92','93','94','95','96','97','98','99',_0x295ea5['feBTk']],_0x758f3c=_0x41e375[Math[_0x17318e(0x1233,0x1c44,0x1c34,0x1632)](_0x295ea5['jyENO'](Math['random'](),_0x41e375[_0x17318e(0x9aa,0xc8a,0x8bb,0xad9)]))],_0x45c55c={};_0x45c55c[_0x17318e(0xbdb,-0x3e7,-0x4eb,0x405)]='*'+_0x1cbc75+_0x17318e(0xde7,0x159c,0xfc7,0xbc8)+q+('\x0aAnswer\x20:\x20'+'*')+_0x758f3c+'%*';const _0x38180b={};_0x38180b['quoted']=_0x17aa6d,_0x3797bd['sendMessag'+'e'](_0x146a84,_0x45c55c,_0x38180b);break;case _0x295ea5[_0x425890(0x1013,0x894,0xf07,0xdb1)]:if(!_0x116129)return _0x295ea5[_0x425890(0x106d,0xb52,0x4ff,0x14bc)](_0x51481c,_0x17318e(-0x2ab,0x1f0,0x6ad,0x73b)+_0x425890(0x7e1,0x2f7,-0x4ed,0x40e)+_0x425890(0x1203,0x7ff,0x716,0x2cb)+_0x295ea5[_0x425890(0x199,0x208,-0x6,0xb22)](_0x4fea53,_0x1cbc75)+_0x425890(-0xda,0x3b7,0x13f,0xa3));const _0x5eff9d=[_0x295ea5['ighyV'],_0x295ea5[_0x17318e(0x1c0a,0xaaa,0x12de,0x150d)],_0x295ea5['UFBVe'],_0x295ea5[_0x425890(0x1454,0xfdb,0x10dc,0xd2d)],_0x295ea5['urSXh'],_0x295ea5['iDVKX'],_0x295ea5['cwJUX'],'Kind-Heart'+'ed',_0x295ea5[_0x17318e(0x19a6,0x1094,0xb22,0x100e)],_0x295ea5['NBJli'],_0x425890(0x10fd,0x145a,0x178e,0xb77)+'y','Helpful'],_0x535714=_0x5eff9d[Math[_0x425890(0x1948,0x1415,0x1269,0x1b89)](_0x295ea5['rESyU'](Math[_0x425890(0x9e0,0x92e,0xe2c,0xaa4)](),_0x5eff9d[_0x425890(0x602,0x8bc,0xa75,0xd10)]))],_0x21076c={};_0x21076c[_0x17318e(-0x409,0x6d7,-0x47b,0x405)]=_0x425890(0x300,0x25b,-0x461,-0x1f8)+_0x425890(0xc91,0x80a,0x31f,0xd77)+q+(_0x425890(0x30d,0xc3e,0x6af,0x1c3)+'*')+_0x535714+'*';const _0x165ac1={};_0x165ac1[_0x17318e(0x128a,0x864,0x298,0xa24)]=_0x17aa6d,_0x3797bd[_0x17318e(-0x1ca,0xf78,0x5c4,0x63c)+'e'](_0x146a84,_0x21076c,_0x165ac1);break;case _0x295ea5[_0x425890(0x9a4,0x3c8,0x8e2,0x94d)]:case _0x295ea5['xczSY']:case _0x295ea5[_0x17318e(0x1630,0x155b,0x194f,0x1489)]:case _0x295ea5[_0x17318e(-0x52,0x109,-0x4a2,0x380)]:case _0x295ea5['FtNNx']:case _0x295ea5['hhWHu']:case _0x295ea5[_0x17318e(-0x2c,0xb90,0x1009,0x8ba)]:case _0x295ea5[_0x17318e(0x335,0xc6d,0xe20,0x832)]:case _0x295ea5[_0x425890(0x1a09,0x11ce,0xab8,0xa7f)]:case _0x295ea5[_0x17318e(0x18e5,0x12cc,0x1915,0x1404)]:case _0x295ea5[_0x17318e(0x2007,0xce9,0x17f2,0x1725)]:case _0x295ea5[_0x17318e(0xd1f,-0x229,0x92d,0x77a)]:case _0x17318e(-0x710,0x3f6,0x3ad,0x32a):case _0x17318e(0x1321,0x199c,0x222b,0x1831):case _0x295ea5[_0x425890(0xd6e,0x7be,0x95f,0xebb)]:case _0x295ea5[_0x425890(0x11fd,0x12c2,0xc30,0xd2a)]:case _0x295ea5[_0x425890(0xb64,0x9bd,0x5ee,0x159)]:case _0x295ea5[_0x17318e(0x5dc,0xcbc,0x1807,0xe8f)]:case _0x295ea5[_0x425890(0x712,0xe01,0xd1d,0x12df)]:case _0x295ea5[_0x17318e(0x96e,0x67e,0x9ae,0xc93)]:case _0x295ea5['toaHD']:case _0x295ea5[_0x17318e(0xbf2,0x79e,0x3f9,0x34b)]:case _0x17318e(0xbd9,0x455,0x5de,0xe02):case _0x295ea5[_0x17318e(0x1515,0x18bd,0x10f0,0xe5e)]:case _0x295ea5['ToeHJ']:case _0x295ea5[_0x17318e(0xcf8,0x1a2f,0xcdc,0x15e0)]:case _0x295ea5[_0x17318e(0xa1a,0x1096,0x55c,0xe29)]:case _0x295ea5['zSaKP']:case _0x295ea5[_0x17318e(0x165,0x985,0x9b1,0xa2b)]:case _0x295ea5[_0x17318e(0x965,0xb13,0xfc0,0x9a3)]:case'nibbi':case _0x295ea5[_0x425890(-0x71e,0x146,0x6bf,0x7e0)]:case _0x295ea5[_0x17318e(0xaf9,0xca8,0x17d0,0x140e)]:case _0x295ea5[_0x425890(0x486,0x59c,0xf1e,-0x2ba)]:case _0x295ea5[_0x425890(0x9a1,0xac5,0xd24,0x964)]:case _0x295ea5[_0x425890(0xf24,0x163d,0x1431,0x19da)]:case _0x425890(0x1048,0x144c,0x15fd,0x1353):case _0x295ea5[_0x17318e(0x165b,0x6fb,0x160e,0xd2b)]:case _0x295ea5['IJxMJ']:case _0x295ea5[_0x17318e(0x11c9,0x1b11,0xdb4,0x122f)]:case _0x295ea5[_0x17318e(0x7fa,0xafb,0x79a,0xeff)]:case _0x295ea5['cPlRa']:case _0x295ea5['hkwni']:case _0x295ea5['HyHys']:case _0x295ea5[_0x425890(-0x90,0x926,0x112b,0x1117)]:case'bc':case _0x295ea5[_0x425890(0x9c,0x3ef,-0x4d3,-0x5ab)]:case'mc':case _0x295ea5[_0x425890(0x5c1,0xb5a,0xeb9,0xc13)]:case _0x295ea5[_0x425890(0x1647,0xfe3,0x171b,0x746)]:case _0x425890(0x749,0x880,0x120c,0x21f):case'loda':case _0x295ea5['iXbJF']:case _0x295ea5[_0x425890(0x1161,0xaeb,0x857,0xf44)]:case _0x295ea5[_0x425890(0x6e3,0x3bd,0x9f6,0xc0e)]:case _0x295ea5[_0x425890(0x28,0x757,-0x103,0xdc4)]:{if(!_0x17aa6d['isGroup'])return _0x295ea5[_0x425890(0x1648,0x153b,0xf76,0x19e4)](_0x51481c,''+mess[_0x425890(0x317,0x9ed,0x11a5,0xfd3)]);let _0x51f997=_0x8ee05e[_0x425890(0x10dd,0xb6f,0xf47,0x15d4)](_0x5c2a9d=>_0x5c2a9d['id']),_0x5ac7c7=_0x17aa6d[_0x425890(0x829,0xa69,0x4cc,0xc75)],_0x5e0ad0=_0x51f997[Math[_0x425890(0x11e3,0x1415,0x1c3f,0x157f)](_0x295ea5[_0x425890(0x45a,0x2fc,0x55a,0x6b9)](Math['random'](),_0x51f997['length']))],_0x156d24=_0x425890(0x13d1,0x15b6,0x1a3c,0x18e9)+_0x1cbc75+'*\x20Is\x20@'+_0x5e0ad0[_0x17318e(-0x4fa,0xd29,0x34c,0x508)]('@')[0x1*0x2207+-0xb06+-0x1701*0x1],_0x5ed5a6=[_0x5ac7c7,_0x5e0ad0];const _0xf9b697={};_0xf9b697[_0x425890(0x1649,0x10a0,0x164e,0x123b)+'t']=_0x295ea5[_0x17318e(0x151d,0xff6,0x589,0xbfc)];const _0x2d488a={};_0x2d488a[_0x17318e(0x13bd,0x10be,0x8d2,0x1194)]='👀',_0x2d488a[_0x17318e(0x18df,0xd60,0x1737,0x1318)]=_0xf9b697,_0x2d488a[_0x17318e(0x1cc1,0x191f,0x1af6,0x1638)]=0x1;let _0x4f26de=[_0x2d488a];const _0x7374ff={};_0x7374ff[_0x17318e(0xa09,0xcd7,0x755,0x1022)]=_0x5ed5a6,await _0x3797bd[_0x17318e(0xb16,0x14c7,0x13dc,0x12c4)+_0x425890(0x5fb,0xcec,0x135a,0xf5a)](_0x17aa6d[_0x17318e(0x17a5,0x14af,0x1433,0xee4)],_0x4f26de,_0x156d24,_0x3797bd[_0x425890(0xc84,0x10be,0x1760,0xa78)][_0x17318e(0xac9,0x149b,0xa2d,0x109f)],_0x17aa6d,_0x7374ff);}break;case _0x17318e(-0xb,0x877,0x2d8,0x95c):if(!_0x116129)return _0x295ea5['WIYRf'](_0x51481c,_0x17318e(0xab4,0x14a8,0x969,0xb35)+_0x425890(0x143e,0xb08,0x11dc,0x78c)+_0x295ea5['MDtgg'](_0x4fea53,_0x1cbc75)+(_0x425890(0x19ac,0x10ac,0x7b5,0x14f2)+'t\x20married\x20'));const _0x46d6b5=[_0x295ea5[_0x17318e(0xc3a,0x1322,0xb0b,0xeec)],_0x295ea5[_0x425890(-0x1dc,0x672,0x2d1,0xc63)],_0x295ea5['tksLm'],'20\x20More\x20Da'+'ys','25\x20More\x20Da'+'ys',_0x295ea5[_0x425890(0x1f74,0x1548,0x16ff,0x1a31)],_0x425890(0x61c,0xf08,0x85a,0x17da)+'ys',_0x295ea5[_0x425890(0xc1d,0xab7,0x43a,0x47b)],_0x295ea5['CAjeH'],_0x295ea5[_0x17318e(0x683,0x10d1,0x13c9,0xeb8)],_0x295ea5[_0x425890(0x215,0x6c0,0x1119,-0x318)],_0x295ea5['lgzvY'],_0x295ea5['tcZtQ'],_0x425890(0xb2d,0x5c1,-0x4b4,0x55f)+'ys',_0x295ea5[_0x425890(0x766,0x833,0x1245,0xa14)],_0x295ea5[_0x17318e(0xf08,0xb07,0xb59,0x152a)],_0x295ea5['SNbNp'],_0x425890(0x47a,0xd24,0x12f6,0x2e4)+'ys',_0x425890(0x590,0x1ad,-0x309,0x703)+'ays','5\x20Months\x20M'+_0x425890(0x117e,0xe50,0x5f5,0xced),_0x17318e(0xc7a,0x17a1,0x329,0xd2e)+'More',_0x295ea5['iJkyH'],_0x295ea5['gfoJj'],_0x295ea5[_0x17318e(0xd23,0x1440,0x1250,0xb5c)],_0x295ea5[_0x425890(0x6dd,0xe31,0xe4a,0xa06)],_0x295ea5[_0x17318e(0x1679,0x1817,0x171f,0xf58)],_0x295ea5[_0x425890(0x1e7e,0x160f,0x16f6,0xf33)],_0x295ea5['qQCfN'],_0x295ea5['vYSGp'],_0x295ea5['AHVMN'],_0x295ea5[_0x17318e(0x4a,-0x15e,-0x312,0x66e)],_0x17318e(0x1ba9,0x1e74,0x1229,0x145f)+_0x425890(0xe70,0x127d,0x1421,0x1259),_0x295ea5[_0x17318e(-0x32,0x22e,0x790,0x627)],_0x295ea5[_0x425890(0x27b,0x6f3,0xe2f,-0x1e1)],_0x295ea5[_0x425890(0x1b8d,0x1459,0x1604,0x1998)],_0x295ea5[_0x425890(0x88e,0xdd4,0x1789,0x1826)],_0x295ea5[_0x17318e(0x1795,0x16a3,0xd22,0x12b6)],_0x295ea5[_0x425890(0xc02,0x652,0x271,-0x1e1)],_0x425890(0x158b,0xb57,0x141e,0x14c8)+'r',_0x295ea5['JHWLZ'],_0x295ea5[_0x425890(0x12ed,0xd0e,0xb25,0x163a)],_0x295ea5['Zbkmx'],_0x295ea5[_0x17318e(0xef0,0x14ce,0x1b7c,0x1683)],_0x295ea5[_0x17318e(0x9d5,0x1469,0x13f6,0x126d)],_0x295ea5[_0x425890(0xdd,0x77d,0x6cc,0x743)],_0x17318e(0x596,0x70f,-0x162,0x49d)+_0x425890(-0x4ea,0x38b,-0x11,0x617)+'You\x20Too\x20'+q],_0x13c486=_0x46d6b5[Math[_0x425890(0x1d73,0x1415,0x11d6,0xa79)](_0x295ea5[_0x17318e(0x702,0x1690,0x16b6,0x1023)](Math[_0x425890(0xde5,0x92e,0xc0c,0x425)](),_0x46d6b5[_0x17318e(0x7b0,0x1d2,0x113e,0xad9)]))],_0x278251={};_0x278251[_0x17318e(0x47e,0xafa,-0x3b8,0x405)]=_0x425890(-0x37c,0x5dc,0xdab,-0x3b4)+'\x20'+q+(_0x425890(0x4df,0xc3e,0xb1f,0x1319)+'*')+_0x13c486+'*';const _0x13bbc4={};_0x13bbc4['quoted']=_0x17aa6d,_0x3797bd[_0x425890(0x3a8,0x41f,0xd71,0x4f)+'e'](_0x146a84,_0x278251,_0x13bbc4);break;case _0x295ea5[_0x17318e(-0x296,-0x4b4,0x25,0x42c)]:if(!_0x116129)return _0x295ea5[_0x17318e(0x91b,-0x1b6,0x497,0x5b1)](_0x51481c,_0x17318e(0x1567,0x922,0x724,0xb35)+_0x17318e(0x15c0,0x143c,0xecc,0xd25)+(_0x4fea53+_0x1cbc75)+'\x20hinata');qq=q[_0x425890(0xb7d,0x1479,0x1d81,0x11f4)+'e'](),awikwok=qq+'\x20'+qq+'\x20'+qq+('\x20❤️\x20❤️\x20❤️\x20WAN'+_0x17318e(0xcaf,0xea,0x9c0,0x922)+_0x425890(0x19e9,0x159a,0x1155,0x1e51)+_0x425890(0x91f,0xb53,0x1062,0x141b)+_0x425890(-0x173,0x903,-0x154,0x12d9)+_0x17318e(0x13dc,-0xba,0x10ec,0x976)+_0x17318e(0x92,0x79d,0x305,0x91c)+_0x17318e(0x1563,0xfab,0x1342,0x11dc))+qq+(_0x425890(0x17e6,0xd8d,0xc99,0x611)+_0x425890(0x21e,0x22e,0x636,-0x79e)+_0x425890(0x1c7a,0x12ce,0x187e,0xdf5)+_0x17318e(0xc77,0x14b5,0x142f,0x1080))+qq+(_0x17318e(0x484,0x4a1,0x12a0,0xcc6)+_0x425890(0xc3f,0x10c9,0x1a94,0x1639)+_0x425890(-0x281,0x34e,-0x45c,0x2c8)+'\x20i\x20want\x20to'+_0x17318e(0x1d89,0x1bf1,0x12e8,0x163e)+_0x425890(0xba6,0x562,0x2f5,0xbe0)+_0x17318e(0x111f,0x1f3f,0x107e,0x15b3)+'\x20')+qq+(_0x425890(-0x6c5,0x1d7,0x119,-0x840)+_0x17318e(0xea8,0x971,0x1906,0x13be)+'nime\x20is\x20cu'+_0x425890(0x4ec,0x6fb,0xb31,0x10ec)+_0x17318e(0x45f,0x675,0x1887,0xe82)+_0x17318e(0x1fb5,0x1a57,0x1596,0x1668))+qq+(_0x425890(0x3e4,0x529,0xe6a,-0x17)+_0x425890(0x5e1,0x920,0x252,0x1f2)+_0x17318e(0x92a,0xa10,0x6fa,0x93e)+_0x17318e(0x7f4,0x176b,0xc11,0xf90))+qq+(_0x17318e(0x8c4,0x185,0xee0,0x641)+_0x425890(0x1173,0x1114,0xb0d,0x8b9)+_0x425890(-0x205,0x53f,0x4f8,0x37)+_0x425890(0xbfd,0x12f2,0x1d02,0xd90))+qq+(_0x17318e(0x6b8,0x84a,0x10ed,0xb7c)+_0x17318e(0x1247,0x1071,0x1c09,0x15d5)+_0x17318e(0x7ae,-0xd,0x647,0x67e)+'\x20say\x20?\x20no,'+_0x425890(0xcbf,0x545,0xb99,-0x4bc)+_0x17318e(0x1069,0x1673,0x110a,0xc53)+_0x17318e(0x6a2,0x9fd,0xa41,0xa32)+_0x17318e(0x264,0x557,-0x248,0x762)+_0x425890(0x836,0x120a,0xfc0,0x977)+_0x425890(0x993,0x6cf,0x492,0x5dd)+_0x17318e(0xc79,0x64a,0xde8,0x8ff)+_0x17318e(0x10ea,0x14d6,0x1d76,0x14af)+'\x20I\x20DON\x27T\x20C'+_0x17318e(0xb53,0xbf1,0xf90,0x61c)+'\x20')+qq+_0x17318e(0x12dd,0xc50,0x161c,0x1146)+qq+('\x20on\x20the\x20la'+_0x425890(0x48d,0x484,0x3eb,-0x3c8)+_0x425890(0x650,0x3e5,0x2be,-0x203))+qq+(_0x425890(0x9b1,0x11ac,0x1063,0x9b9)+_0x425890(0xe1b,0xd7f,0x14d7,0x38e)+_0x425890(0x9b7,0x9dc,0x9f0,0x9f7)+'aaaaah\x20tha'+_0x425890(0x445,0x20b,0xb95,0xc18))+q+('\x20I\x20don\x27t\x20w'+'ant\x20to\x20giv'+'e\x20up\x20')+qq+(_0x17318e(0x1b39,0x1ca7,0xb82,0x1554)+_0x425890(0xe85,0x525,0x6c1,0xc5b)+_0x425890(0xaac,0x718,0x118b,0x58d)+_0x17318e(0xbf9,0xf6a,0x1909,0x15ff)+_0x425890(0x136d,0xf68,0x15b6,0x14ef))+qq+('\x20ALSO\x20NOT\x20'+_0x425890(0xee9,0x5b9,0xb20,0x868)+_0x17318e(0xd53,0x98f,0xc38,0x1331)+'AAAH'),_0x295ea5[_0x17318e(0x19c7,0x16ac,0x1e72,0x14ba)](_0xcd1d32,awikwok);break;case _0x17318e(0x10c6,0x1c5,0x148,0xa85):if(!_0x116129)return _0x51481c(_0x17318e(0xf13,0x173f,0xd26,0x128e)+_0x425890(0xc63,0xb92,0x14a1,0x552)+_0x17318e(0x43d,0x1004,0x40b,0xd25)+(_0x4fea53+_0x1cbc75)+'\x20nexus');predea=await axios['get'](_0x425890(0x1a7e,0x1395,0x13b8,0xfec)+_0x17318e(0x140c,0xb2d,0x955,0xdcc)+_0x425890(0xc91,0x1007,0x6af,0x8a6)+q),_0xcd1d32(_0x425890(0x8b8,0xa11,0x885,0x7ff)+predea['data']['name']+(_0x17318e(0xfe4,0x1f53,0xf95,0x1839)+_0x17318e(0x130f,0x11c0,0x1d89,0x1537))+predea[_0x17318e(0x268,0x585,0x127a,0xced)]['age']+(_0x425890(0xc2c,0xfcd,0x94f,0x8c7)+_0x17318e(0xc1c,0xf4d,0x238,0x684)+_0x425890(0x1d0,0x7d6,0xb51,0xa2)+_0x425890(0x5e2,0x105c,0x17e9,0x1708)+'se\x20No\x20One\x20'+_0x17318e(0xbd3,0x61f,0x385,0x77e)+_0x425890(0xf2e,0x674,0x80d,0xf26)));break;case _0x295ea5[_0x17318e(0x7c2,0xf7f,0xc32,0x90e)]:case'hilih':case _0x295ea5[_0x17318e(0x7fb,0x5cc,0xf50,0xa48)]:case _0x295ea5[_0x17318e(0x1325,0xe05,0x13ee,0x135c)]:case _0x295ea5[_0x425890(0x3c1,0xa78,0x58c,0xf8e)]:if(!_0x17aa6d[_0x425890(0x8a3,0x807,0x606,0x320)]&&!_0x116129)return _0x295ea5[_0x425890(0x567,0xc1a,0x1359,0x1045)](_0x51481c,'Send/Reply'+_0x425890(0xe7f,0xee2,0x195e,0x1293)+'\x20Caption\x20'+_0x295ea5[_0x425890(0xac7,0x6f9,0x450,-0x10f)](_0x4fea53,_0x1cbc75));ter=_0x1cbc75[0x4*-0x8f+-0x71*-0x4f+-0x20a2][_0x17318e(0xc1a,0xd3c,0xb7c,0xd56)+'e'](),tex=_0x17aa6d['quoted']?_0x17aa6d[_0x17318e(0x1328,0x11f6,0x9f3,0xa24)][_0x425890(0x2f6,0x1e8,-0x62c,0xbb5)]?_0x17aa6d[_0x17318e(0x244,0x755,0x11f8,0xa24)][_0x17318e(0x165,0x113,0x10f,0x405)]:q?q:_0x17aa6d['text']:q?q:_0x17aa6d['text'],_0xcd1d32(tex[_0x17318e(0xea7,0x501,0x518,0x82e)](/[aiueo]/g,ter)[_0x17318e(0xc3c,0x7fc,0x778,0x82e)](/[AIUEO]/g,ter[_0x17318e(0xf28,0xe6c,0xd12,0x1696)+'e']()));break;case _0x295ea5[_0x17318e(0x1d3f,0x17c8,0x1621,0x16ee)]:{if(_0x295ea5[_0x17318e(0x68a,0x4be,0x4e8,0xeea)](_0x295ea5[_0x17318e(0x1207,0xc7d,0x3fb,0xc69)],_0x295ea5[_0x17318e(0x99e,0xf9e,0x2a0,0xb4a)])){_0x2a6d82(_0x449c72['wait']);const _0x26cadf={};_0x26cadf[_0x17318e(0x3f7,0x117c,0x9a5,0x810)]=_0x295ea5[_0x17318e(0xd23,0x1bf3,0x150b,0x127f)];const _0x2ea26c={};_0x2ea26c[_0x425890(0x7a3,0x565,-0xa3,0x81e)]=_0x26cadf,_0x2ea26c[_0x425890(0xa3c,0xdfe,0x92e,0x8c5)]=_0x425890(-0xce,0x10f,-0x896,0x7be)+_0x17318e(0x805,0xd7b,0xb27,0x11f0),_0x2ea26c[_0x17318e(0x986,0xd8c,0xd1e,0xf21)]=_0x295ea5[_0x425890(-0x280,0x7a0,0x844,0xc89)];const _0x93ad1={};_0x93ad1[_0x425890(0x2c5,0x807,0xbf2,0xe3c)]=_0x184532,_0x4ff75c['sendMessag'+'e'](_0x1bcc26[_0x425890(0x817,0xcc7,0x41c,0x4e8)],_0x2ea26c,_0x93ad1);}else{if(!_0x193cb6)return _0x295ea5[_0x425890(0x4c3,0x533,0x38e,0x5dd)](_0x51481c,''+mess[_0x17318e(0x1513,0x1592,0xf6e,0x1494)]);const _0x2287ee={};_0x2287ee[_0x425890(0x4be,0x8ff,0x11c8,0x7e8)]=_0x17aa6d['chat'],_0x2287ee[_0x425890(-0x239,0x409,0xdd5,0xe28)]=!![],_0x2287ee['id']=_0x4413ec['id'];const _0x26272b={};_0x26272b[_0x17318e(-0x2bd,0x557,-0x168,0x405)]=_0x52a010[-0xbec+-0x109*0x1d+-0x29f1*-0x1],_0x26272b[_0x17318e(0xace,0x117e,0x1a08,0x1426)]=_0x2287ee;const _0x44886e={};_0x44886e[_0x425890(0xffe,0x96c,0x793,0xecd)]=_0x26272b,reactionMessage=_0x44886e,_0x3797bd[_0x425890(0x8b2,0x41f,0x96d,-0x215)+'e'](_0x17aa6d[_0x425890(0x362,0xcc7,0xd3b,0x13f7)],reactionMessage);}}break;case _0x295ea5[_0x17318e(0xbc,0xc7f,-0x55c,0x4b2)]:{if(_0x295ea5[_0x17318e(0x700,0x822,0x14a8,0xbce)](_0x295ea5[_0x425890(0xa80,0x98a,0x45a,0xd11)],_0x295ea5[_0x425890(0xe00,0x13a6,0xe5a,0x1793)])){if(!_0x193cb6)return _0x295ea5[_0x425890(0x10a7,0xec0,0x1645,0xa80)](_0x51481c,''+mess['owner']);if(!_0x116129)return _0x295ea5[_0x17318e(0xc80,0x1986,0x1147,0x1702)](_0x51481c,_0x425890(0x493,0xd93,0x1585,0xa22)+_0x425890(0xd14,0x8c8,0x119,0xbc9)+'!');if(!_0x295ea5[_0x425890(0xf5f,0x9a0,0x10ed,0xa82)](isUrl,_0x52a010[-0x3f6+-0x104b*0x1+0x1441])&&!_0x52a010[0x178c+-0x1d34+0x5a8][_0x425890(-0x625,0x291,0x31a,0x607)](_0x295ea5[_0x425890(-0x123,0x804,0x7cd,0x15f)]))return _0x51481c(_0x425890(0x425,0xe1a,0x1181,0x128a)+'nk!');_0x295ea5[_0x425890(0x1320,0x97d,0xf18,0x170)](_0xcd1d32,mess[_0x425890(-0x56f,0x2c6,-0x6f7,0x4b)]);let _0x4fca24=_0x52a010[-0x24f+0x1*0x1e3+0x1*0x6c][_0x17318e(0x3f2,0x152,0x931,0x508)](_0x295ea5[_0x425890(0x47f,0x52c,0x7ec,0xa2a)])[0x1*-0x161d+-0x2*-0x8fe+-0x2e*-0x17];await _0x3797bd[_0x425890(0x2025,0x161a,0x15fc,0x1d86)+'tInvite'](_0x4fca24)[_0x425890(-0x1e2,0x1b3,-0x6af,0x7dc)](_0x953fe3=>_0xcd1d32(jsonformat(_0x953fe3)))[_0x17318e(0xe24,0xdbe,0x1499,0x10e8)](_0x3d9a7b=>_0xcd1d32(jsonformat(_0x3d9a7b)));}else _0x295ea5['kNKKi'](_0x2841b7,_0x1ecc84['error']);}break;case _0x295ea5[_0x17318e(0xafe,0x5bd,0x173d,0xcda)]:{if('ZVGUk'===_0x295ea5[_0x17318e(0x1362,0x7ec,0x146,0x9a6)]){if(!_0x193cb6)return _0x295ea5[_0x17318e(0xf9b,0x15de,0x371,0xd35)](_0x51481c,''+mess['owner']);await _0x3797bd[_0x17318e(0x1e3,0x7f2,-0x35f,0x370)](_0x17aa6d[_0x17318e(0xb56,0x10fb,0x548,0xee4)])[_0x425890(0x1c3,0x1b3,-0x6eb,0xbd0)](_0x1899b5=>_0xcd1d32(jsonformat(_0x1899b5)))[_0x17318e(0x1885,0xa34,0x13b4,0x10e8)](_0xe4941e=>_0xcd1d32(jsonformat(_0xe4941e)));}else _0x29d05f(_0x119c12[_0x425890(0xdf5,0xa69,0xce8,0x61e)],_0x4f7ff2);}break;case _0x295ea5['iEhsd']:{if(!_0x193cb6)return _0x295ea5[_0x425890(0xdb1,0x828,0xc03,0x86c)](_0x51481c,''+mess[_0x425890(0xe1a,0x1277,0x92f,0xbb8)]);if(!_0x116129)return _0x295ea5[_0x425890(0x7ea,0xd06,0xb9f,0xf7c)](_0x51481c,_0x425890(0x657,0xb08,0x1536,0x50a)+(_0x4fea53+_0x1cbc75)+('\x20packname|'+'author'));global[_0x17318e(0x720,0x1042,0xb2,0x862)]=_0x116129['split']('|')[-0x3e*-0x2+-0x242c+0x23b0],global[_0x17318e(-0x55,0x75f,0x7aa,0x57e)]=_0x116129[_0x17318e(0xc8b,0xf9c,-0x47d,0x508)]('|')[0x2629+0x41b*-0x3+-0x89d*0x3],_0xcd1d32('Exif\x20Has\x20B'+'een\x20Succes'+_0x425890(0x545,0x811,0x90f,0xbbf)+_0x17318e(0xc1a,0x1636,0x12c7,0xf86)+_0x425890(0x8b6,0x11b5,0x1837,0xe57)+_0x425890(0x1ed,0x7ff,0x5dc,0x11d8)+global[_0x425890(0xcfc,0x645,0x797,0x167)]+('\x0a🔰🌹\x20Author'+'\x20:\x20')+global[_0x17318e(0xec3,0xfb7,0x474,0x57e)]);}break;case _0x295ea5[_0x425890(0x1461,0xae7,0x1367,0x1305)]:{if(!_0x17aa6d[_0x17318e(-0x346,-0x50d,0x5e2,0x532)])return _0x51481c(''+mess[_0x425890(0x11ad,0x9ed,0x11f,0x42c)]);if(!_0x1a2061)return _0x295ea5[_0x17318e(0x94c,0x605,0x1248,0x1067)](_0x51481c,''+mess[_0x17318e(0xf52,0x81f,0x63f,0x6f4)]);if(!_0x5b4303)return _0x295ea5['KoFsf'](_0x51481c,''+mess[_0x17318e(0x1367,0x14b3,0x1b95,0x16d4)]);let _0xd39bcd=_0x17aa6d[_0x425890(0x1431,0xc05,0x9e4,0x836)+'id'][-0x4*0x209+-0x569+0x1*0xd8d]?_0x17aa6d[_0x17318e(0x11b1,0x1891,0x159d,0xe22)+'id'][0xd70+0xf7f+-0x1cef]:_0x17aa6d[_0x425890(0xd18,0x807,0x291,0x97e)]?_0x17aa6d['quoted'][_0x17318e(0x8ff,0x49f,0x828,0xc86)]:_0x116129['replace'](/[^0-9]/g,'')+_0x295ea5[_0x17318e(0xc87,0x1652,0x1345,0x1110)];await _0x3797bd[_0x425890(0x4c3,0x1f5,0x8f4,0xaa6)+'cipantsUpd'+_0x425890(0x44f,0xc83,0x5f9,0xe61)](_0x17aa6d[_0x17318e(0x1515,0x7c1,0x119e,0xee4)],[_0xd39bcd],_0x295ea5[_0x425890(0xe43,0xd88,0x11aa,0xf40)])['then'](_0x456989=>_0xcd1d32(jsonformat(_0x456989)))[_0x425890(0xcf3,0xecb,0x659,0xa71)](_0x44cb67=>_0xcd1d32(jsonformat(_0x44cb67)));}break;case _0x295ea5[_0x17318e(0xaef,0xcda,0x188a,0x1284)]:{if(!_0x17aa6d[_0x17318e(-0x53,0x2ab,0x3fd,0x532)])return _0x295ea5[_0x17318e(0x116a,0x1bf0,0xfd0,0x119a)](_0x51481c,''+mess['group']);if(!_0x1a2061)return _0x295ea5[_0x17318e(0xc9b,0x6de,0x8ef,0xb9a)](_0x51481c,''+mess[_0x17318e(0x52,0x366,0x9cb,0x6f4)]);if(!_0x5b4303)return _0x295ea5[_0x425890(0x1227,0x149d,0xa06,0x1d01)](_0x51481c,''+mess[_0x17318e(0x120c,0x1f6b,0xcb7,0x16d4)]);let _0x3080e7=_0x17aa6d['quoted']?_0x17aa6d[_0x425890(0xa36,0x807,0x474,0xaab)][_0x425890(0x14ab,0xa69,0x1211,0xe02)]:_0x116129['replace'](/[^0-9]/g,'')+(_0x17318e(0x93f,0x333,0xe2d,0x53f)+'p.net/nAdd'+'ed');await _0x3797bd[_0x425890(-0x6bd,0x1f5,-0x178,-0x2ab)+_0x425890(0x110e,0x6be,0x491,0x22a)+_0x17318e(0x529,0x8c7,0xcee,0xea0)](_0x17aa6d['chat'],[_0x3080e7],_0x295ea5[_0x17318e(0xf1f,0x15d4,0x1aad,0x1284)])[_0x425890(0x2da,0x1b3,0x260,-0x4c4)](_0x25be1c=>_0xcd1d32(jsonformat(_0x25be1c)))['catch'](_0x2a8474=>_0xcd1d32(jsonformat(_0x2a8474)));}break;case _0x295ea5['rYrOM']:{if(_0x295ea5[_0x17318e(0x7e5,0x1033,0xff8,0x11f4)]===_0x17318e(-0x405,0x5e5,0xb54,0x3ce)){const _0x4c348b={};_0x4c348b[_0x17318e(0x513,0x3f7,0xb9d,0x810)]=_0x425890(0xb2c,0xced,0x108b,0x677)+'ibb.co/Cwf'+_0x17318e(0x1708,0xf14,0x8ef,0xe1a)+_0x425890(0x14d5,0x1640,0xf98,0xf2e)+_0x425890(0x113b,0xfc5,0x542,0xc92);const _0x4aa61c={};_0x4aa61c['image']=_0x4c348b,_0x4aa61c[_0x425890(-0x680,0x30a,0x956,0x532)]=_0x17318e(0xbc1,0xf4c,0x10cb,0x9f6)+_0x355cc1['pushName']+(_0x425890(0xc11,0x324,0x125,0x42)+_0x17318e(0x801,0xe97,0x1877,0x1016)+_0x17318e(0xdee,0x1101,0x1f37,0x185e)+_0x17318e(0x7ea,0xc5f,0x192e,0x105f)+'\x20Dragon\x20Te'+_0x17318e(0x1170,0x904,0x483,0xaf0)+_0x425890(0x160a,0x10d2,0x18a1,0x1522)+'visit\x20our\x20'+_0x17318e(0xdda,0x1375,0x1d5a,0x1625));const _0x398e42={};_0x398e42[_0x425890(0x11ea,0x807,0x71f,-0x16a)]=_0x2c4572,_0x3d18c3[_0x17318e(0x273,0xfb9,0xa2f,0x63c)+'e'](_0x3880c5[_0x425890(0x1444,0xcc7,0x156b,0x387)],_0x4aa61c,_0x398e42);}else{if(!_0x17aa6d[_0x425890(0x159,0x315,0xc54,0xd22)])return _0x295ea5['jVglP'](_0x51481c,''+mess['group']);if(!_0x1a2061)return _0x51481c(''+mess[_0x17318e(0x7a4,0x2ee,-0x259,0x6f4)]);if(!_0x5b4303)return _0x295ea5[_0x425890(0x2c9,0x8ae,0xfc0,0xded)](_0x51481c,''+mess[_0x425890(0x1d9c,0x14b7,0xe9b,0x1b1f)]);let _0x37a6a2=_0x17aa6d[_0x17318e(0x78f,0x54f,0x12e8,0xe22)+'id'][-0x258+0x77*0x17+-0x859]?_0x17aa6d[_0x425890(0x92c,0xc05,0x13d5,0x72a)+'id'][0x1a8*0x2+0x989+-0xcd9]:_0x17aa6d['quoted']?_0x17aa6d['quoted'][_0x17318e(0x349,0xdb9,0x44d,0xc86)]:_0x116129[_0x17318e(0xb21,0x15,0x86b,0x82e)](/[^0-9]/g,'')+_0x295ea5['aYgVV'];await _0x3797bd[_0x17318e(0x58a,-0x3aa,0xe06,0x412)+_0x17318e(0x8c7,0x986,0x129d,0x8db)+_0x425890(0x442,0xc83,0x55f,0x481)](_0x17aa6d[_0x17318e(0x177c,0x5fd,0xef2,0xee4)],[_0x37a6a2],_0x295ea5[_0x425890(0x90a,0x12e1,0x93b,0x1bd6)])[_0x425890(-0x8bb,0x1b3,0x638,0x961)](_0x23c305=>_0xcd1d32(jsonformat(_0x23c305)))[_0x425890(0x1538,0xecb,0x15a2,0x1608)](_0x12cd4d=>_0xcd1d32(jsonformat(_0x12cd4d)));}}break;case _0x295ea5[_0x425890(0x1017,0xf96,0x1286,0x503)]:{if(!_0x17aa6d[_0x17318e(-0x1ca,0x7dc,-0x42a,0x532)])return _0x295ea5[_0x17318e(0xdac,0x12fe,0xf8c,0xe23)](_0x51481c,''+mess[_0x17318e(0x20c,0x1ef,0x90b,0xc0a)]);if(!_0x1a2061)return _0x295ea5[_0x425890(0x14a7,0x1184,0x118c,0x190a)](_0x51481c,''+mess[_0x425890(0xe38,0x4d7,0x1d,0xd6d)]);if(!_0x5b4303)return _0x51481c(''+mess['admin']);let _0x5655b8=_0x17aa6d[_0x425890(0xfde,0xc05,0x276,0x92c)+'id'][-0xb*0x6b+-0x37+0x4d0]?_0x17aa6d[_0x17318e(0x10f1,0x5a7,0xe19,0xe22)+'id'][-0x192e+0x3c4*-0x2+-0x6a*-0x4f]:_0x17aa6d[_0x17318e(0xe04,0xa6a,0x137a,0xa24)]?_0x17aa6d[_0x425890(0xaed,0x807,-0x23,0xcc8)][_0x425890(0x1fa,0xa69,0x17,0xc80)]:_0x295ea5[_0x17318e(0xb70,0x4a9,0x3bb,0x615)](_0x116129['replace'](/[^0-9]/g,''),_0x295ea5['KNyPh']);await _0x3797bd[_0x425890(0x1e6,0x1f5,0x9fe,-0x172)+'cipantsUpd'+_0x17318e(0x9fd,0xabb,0x8f4,0xea0)](_0x17aa6d[_0x17318e(0xc7f,0x10b2,0x897,0xee4)],[_0x5655b8],_0x295ea5['cbZdR'])[_0x425890(-0x89d,0x1b3,0x8af,-0x3f)](_0x17e576=>_0xcd1d32(jsonformat(_0x17e576)))[_0x425890(0x6f9,0xecb,0x17a8,0xaf9)](_0x176c41=>_0xcd1d32(jsonformat(_0x176c41)));}break;case _0x295ea5[_0x17318e(0x1905,0x1788,0x152b,0x1013)]:{if(_0x295ea5['tYnBa'](_0x295ea5[_0x17318e(0x1212,0x1db5,0x1f31,0x16d5)],_0x295ea5['juNrM'])){const _0x1c0f3f={};_0x1c0f3f[_0x17318e(0x8f,0x70e,-0xb2,0x405)]=_0x425890(0x9a3,0xd35,0x1005,0x17c9);const _0x59394a={};_0x59394a[_0x425890(0x335,0x807,0xcf4,0x886)]=_0x2e94f1,_0x38ecd8[_0x425890(0x300,0x41f,0x14c,0xbfc)+'e'](_0x4ef9f0,_0x1c0f3f,_0x59394a);}else{if(!_0x193cb6)return _0x295ea5[_0x17318e(0x1393,0x1a10,0x125f,0x15fe)](_0x51481c,''+mess[_0x17318e(0x127d,0x16ab,0x169d,0x1494)]);let _0x3999b5=_0x17aa6d[_0x425890(0x147a,0xc05,0x12ae,0x8b6)+'id'][-0x1960+-0x1*0x17c7+0x3127]?_0x17aa6d['mentionedJ'+'id'][-0x1337*-0x1+-0x2417+-0xf*-0x120]:_0x17aa6d[_0x425890(0xee6,0x807,-0x20b,0xa23)]?_0x17aa6d['quoted'][_0x425890(0xab6,0xa69,0x86d,0x269)]:_0x295ea5['wkruD'](_0x116129['replace'](/[^0-9]/g,''),_0x17318e(-0x101,0x9c0,0xc99,0x53f)+_0x17318e(0xfaa,0xf40,0x18c6,0x15e8)+_0x17318e(-0x26a,0xc85,-0x111,0x4ca));await _0x3797bd[_0x17318e(0x942,0x896,0x141,0x482)+'kStatus'](_0x3999b5,_0x295ea5[_0x17318e(0x8ad,0x1539,0x170d,0x1013)])[_0x17318e(0x6e3,0xd86,0x841,0x3d0)](_0x1d2430=>_0xcd1d32(jsonformat(_0x1d2430)))[_0x17318e(0xd47,0xeec,0x1446,0x10e8)](_0x5ee639=>_0xcd1d32(jsonformat(_0x5ee639)));}}break;case _0x295ea5['DMYia']:{if(!_0x193cb6)return _0x295ea5[_0x17318e(0x1521,0xfb2,0x19c6,0x1029)](_0x51481c,''+mess[_0x425890(0x1a9d,0x1277,0xfa2,0xe03)]);let _0x2c86b9=_0x17aa6d[_0x425890(0x46d,0xc05,0x948,0x159b)+'id'][0x5*0x47d+0xff2+-0x2663]?_0x17aa6d[_0x425890(0x14c3,0xc05,0x51f,0x534)+'id'][-0x1*0x6be+-0x1e81+0x253f]:_0x17aa6d[_0x17318e(0x989,0x9fa,0x960,0xa24)]?_0x17aa6d[_0x425890(-0x55,0x807,0x1ce,0x11dc)][_0x425890(0x1135,0xa69,0xa2a,0x614)]:_0x295ea5[_0x425890(0x166d,0x1235,0xd55,0x1356)](_0x116129[_0x17318e(0x9a7,0xd79,0x6eb,0x82e)](/[^0-9]/g,''),_0x17318e(0x1fd,0xdee,0x338,0x53f)+'p.net/nUnb'+'locked!');await _0x3797bd['updateBloc'+_0x425890(0x1e86,0x14fe,0x1b33,0xe96)](_0x2c86b9,'unblock')['then'](_0x41d51a=>_0xcd1d32(jsonformat(_0x41d51a)))[_0x425890(0x117e,0xecb,0x9f4,0xc4b)](_0x25bcaa=>_0xcd1d32(jsonformat(_0x25bcaa)));}break;case _0x17318e(0x20ac,0x12df,0x108e,0x16db):case _0x425890(0xfae,0xdb7,0xe5f,0x1027):case _0x295ea5[_0x17318e(0x16c0,0x801,0x759,0xf85)]:{const _0x2c8f8d=_0x425890(0x13e9,0x9d3,0x63e,0xf36)[_0x425890(-0x431,0x2eb,-0x41,0x199)]('|');let _0x32e40b=-0x17a9+-0xfe*-0x19+-0x1*0x125;while(!![]){switch(_0x2c8f8d[_0x32e40b++]){case'0':if(!_0x1a2061)return _0x295ea5['lyYOA'](_0x51481c,''+mess[_0x17318e(0xd90,0x1df,0x98a,0x6f4)]);continue;case'1':if(!_0x5b4303)return _0x295ea5[_0x17318e(0x187a,0x190a,0xef0,0x13a1)](_0x51481c,''+mess[_0x425890(0x18f0,0x14b7,0x1bfc,0xc18)]);continue;case'2':if(!_0x116129)return _0x295ea5[_0x425890(0xcc0,0x321,0x725,0xc1e)](_0x51481c,'What\x20is\x20th'+'e\x20name?');continue;case'3':await _0x3797bd[_0x425890(-0x1c2,0x300,0xb44,0x2cb)+_0x425890(0xd51,0xe8d,0xf7e,0x14ad)](_0x17aa6d['chat'],_0x116129)['then'](_0x1d73ff=>_0xcd1d32(mess[_0x17318e(0x102b,0x148e,0x1215,0xed0)]))[_0x17318e(0x141a,0x759,0x13bb,0x10e8)](_0x37014b=>_0xcd1d32(jsonformat(_0x37014b)));continue;case'4':if(!_0x17aa6d[_0x425890(0x250,0x315,0xbb6,-0x354)])return _0x51481c(''+mess[_0x17318e(0x9f3,0x9d3,0x126c,0xc0a)]);continue;}break;}}break;case _0x295ea5[_0x425890(0x12ff,0x1006,0xef3,0xdae)]:case _0x295ea5[_0x17318e(0x41d,0x726,0x211,0xc06)]:{const _0x488000=_0x295ea5['HMfTj'][_0x17318e(0x7b3,0x208,0xed1,0x508)]('|');let _0xedfd4e=0xdf3+0x8aa*-0x1+-0x549;while(!![]){switch(_0x488000[_0xedfd4e++]){case'0':if(!_0x1a2061)return _0x51481c(''+mess[_0x425890(-0x5b0,0x4d7,0x3c4,0x7a8)]);continue;case'1':if(!_0x5b4303)return _0x295ea5[_0x17318e(0x8fc,-0x31c,0xd9,0x6e5)](_0x51481c,''+mess[_0x425890(0x107c,0x14b7,0x1de7,0x14ef)]);continue;case'2':await _0x3797bd[_0x425890(-0x6e9,0x300,0x7ae,0x18e)+_0x17318e(0x3a3,0x121d,0xc1b,0x8e8)+'on'](_0x17aa6d['chat'],_0x116129)[_0x17318e(-0x284,0x61f,0x7b1,0x3d0)](_0x35059b=>_0xcd1d32(mess[_0x17318e(0xb6d,0x14e6,0x10de,0xed0)]))[_0x425890(0x10ea,0xecb,0x133a,0x8a2)](_0x572011=>_0xcd1d32(jsonformat(_0x572011)));continue;case'3':if(!_0x116129)_0x295ea5['tlvhT'](_0x51481c,_0x17318e(0x3b9,0xcfb,0x7d0,0x464)+_0x17318e(0xcde,0xfc,0xc97,0x6f9));continue;case'4':if(!_0x17aa6d['isGroup'])return _0x295ea5['tyWOF'](_0x51481c,''+mess['group']);continue;}break;}}break;case _0x295ea5[_0x17318e(0x18e5,0x1dfb,0x10be,0x1741)]:{if(!_0x193cb6)return _0x51481c(''+mess[_0x17318e(0x1844,0xef7,0x1e43,0x1494)]);if(!_0x4413ec)return _0x295ea5[_0x425890(0x172,0x394,-0x2e2,0xe0)](_0x51481c,_0x17318e(0x19a6,0xbe1,0x832,0xf9b)+'\x20Image\x20Wit'+_0x425890(0x10a0,0x139d,0x12a1,0x1d85)+_0x295ea5[_0x17318e(0x1454,0x11a8,0x1ae1,0x13ee)](_0x4fea53,_0x1cbc75));if(!/image/[_0x17318e(0x7bc,0xea9,0x1322,0xfa3)](_0x4f303f))return _0x295ea5[_0x425890(0x5ff,0xdb6,0x1769,0xe94)](_0x51481c,_0x425890(0x13d8,0xd7e,0x136e,0x163a)+_0x425890(-0x902,0x137,0x9d9,0x60b)+_0x17318e(0xef3,0x10d5,0x1a13,0x15ba)+_0x295ea5['jpcav'](_0x4fea53,_0x1cbc75));if(/webp/[_0x425890(0x359,0xd86,0x17c9,0xd87)](_0x4f303f))return _0x51481c(_0x425890(0xcca,0xd7e,0x3fe,0x9c8)+'\x20Image\x20Wit'+_0x17318e(0x18f6,0xd4d,0x1487,0x15ba)+_0x295ea5[_0x17318e(0xe97,0x1bb5,0x1280,0x1821)](_0x4fea53,_0x1cbc75));let _0x5a2aa=await _0x3797bd[_0x17318e(0x1142,0xbeb,0x1021,0x8b0)+_0x17318e(0x18b,0xcea,0x971,0x414)+'Message'](_0x4413ec);const _0x47f0a1={};_0x47f0a1[_0x17318e(-0x1db,0x495,0x3eb,0x810)]=_0x5a2aa,await _0x3797bd['updateProf'+_0x425890(0x1791,0x1248,0xa7f,0x869)](_0x1b370d,_0x47f0a1)[_0x425890(0x1061,0xecb,0xb5b,0xd45)](_0x2cdd12=>fs[_0x17318e(0x1547,0xc65,0xef0,0x113a)](_0x5a2aa)),_0xcd1d32(mess[_0x425890(0xaeb,0xcb3,0xcb6,0xd35)]);}break;case _0x295ea5[_0x17318e(0x1fb,0xff4,0x10a5,0x94a)]:case _0x295ea5[_0x425890(0x81e,0x979,0x72c,0x1190)]:case _0x295ea5[_0x17318e(0x1392,0xcd5,0xf52,0x94f)]:{if(!_0x17aa6d[_0x425890(-0x326,0x315,-0x109,0x8fe)])return _0x295ea5[_0x425890(-0xea,0x61e,0x795,-0x2b8)](_0x51481c,''+mess[_0x17318e(0x54a,0x117e,0x10d4,0xc0a)]);if(!_0x5b4303)return _0x295ea5[_0x17318e(0xb9f,-0x17a,0xb31,0x6ca)](_0x51481c,''+mess['admin']);if(!_0x4413ec)return _0x295ea5[_0x17318e(0x3a2,0x8d8,0x65c,0x6a7)](_0x51481c,_0x425890(0x393,0xd7e,0xcfe,0xa9d)+_0x17318e(-0x4fb,-0x55b,0x76a,0x354)+_0x425890(0x1456,0x139d,0xc31,0x1366)+(_0x4fea53+_0x1cbc75));if(!/image/['test'](_0x4f303f))return _0x295ea5['bgtLs'](_0x51481c,_0x425890(0x1578,0xd7e,0x2f2,0x675)+_0x17318e(-0x46c,-0x392,0x43d,0x354)+_0x17318e(0x1981,0x1cd3,0x1cd3,0x15ba)+(_0x4fea53+_0x1cbc75));if(/webp/[_0x425890(0x7f4,0xd86,0x13e2,0x1217)](_0x4f303f))return _0x51481c(_0x17318e(0xc85,0x10b0,0x13af,0xf9b)+_0x17318e(0x7fe,-0x6b4,0x980,0x354)+_0x425890(0x1220,0x139d,0x9d0,0x910)+(_0x4fea53+_0x1cbc75));let _0x1ea345=await _0x3797bd['downloadAn'+'dSaveMedia'+_0x425890(0x7e0,0x296,-0x180,-0x4f2)](_0x4413ec);const _0x3d7bee={};_0x3d7bee[_0x17318e(0x404,0x25c,0x224,0x810)]=_0x1ea345,await _0x3797bd[_0x17318e(0xf44,0x15a2,0x1da,0xb6d)+_0x17318e(0x1d67,0x1449,0x112f,0x1465)](_0x17aa6d[_0x17318e(0x13bc,0xdec,0xa54,0xee4)],_0x3d7bee)['catch'](_0x21d66a=>fs[_0x425890(0x989,0xf1d,0x65b,0x13c5)](_0x1ea345)),_0xcd1d32(mess[_0x425890(0x13fe,0xcb3,0x9be,0xfda)]);}break;case _0x295ea5['OeHYR']:{if(_0x295ea5[_0x425890(0xcf3,0xc34,0x36c,0xff7)](_0x295ea5['vguZD'],_0x295ea5[_0x17318e(0x95e,-0x133,0xb9d,0x62f)])){if(!_0x17aa6d[_0x17318e(0x543,0xdd8,0x6f3,0x532)])return _0x295ea5[_0x17318e(0x1826,0x121d,0x14e2,0xf14)](_0x51481c,''+mess[_0x425890(0x1269,0x9ed,0xf71,0x12b8)]);if(!_0x1a2061)return _0x295ea5[_0x425890(0x9ea,0x131c,0xb3e,0x1c97)](_0x51481c,''+mess[_0x17318e(0xd6e,0x9f,0x107f,0x6f4)]);if(!_0x5b4303)return _0x295ea5[_0x425890(0xb2d,0x151,0x402,-0x400)](_0x51481c,''+mess[_0x425890(0xb53,0x14b7,0xcae,0xe37)]);let _0x2e9f5d=_0x425890(0x550,0x7bb,0x4a2,0xa6f)+_0x425890(0x81a,0x1016,0x5e2,0xa08)+_0x425890(0xea2,0x14e7,0xca2,0x1eda)+_0x425890(0x298,0x905,0x156,0x845)+_0x17318e(-0x13c,-0x1ab,0xbcc,0x52d)+(q?q:_0x295ea5['bNsqU'])+_0x425890(0xa52,0x11f4,0x7dd,0x152f);for(let _0x3449f9 of _0x8ee05e){if(_0x295ea5[_0x17318e(0x1605,0xa45,0x12e0,0x12e1)](_0x295ea5[_0x425890(-0x3a7,0x3b6,0x531,0x9c7)],_0x295ea5[_0x425890(0x62b,0x3b6,0x916,-0x2c3)]))_0x2e9f5d+=_0x17318e(0x8bd,0xb53,0x183d,0xe92)+_0x3449f9['id'][_0x425890(0x13,0x2eb,0x5ed,0x93)]('@')[0x1d83+-0x9bb*-0x3+-0x1d5a*0x2]+'\x0a';else{if(!_0x2142b9[_0x17318e(0xb5e,0x11a3,0x751,0xa24)])return _0x295ea5[_0x17318e(0xddd,0x5f0,0x1930,0x1017)](_0x558265,_0x17318e(0x157a,0x430,0x1657,0xd21)+_0x425890(0x43,0x779,0x470,0xe80)+_0x425890(0x453,0x63b,0x1a,0x921)+'\x20In\x20Databa'+'se');if(!_0x44a6c6)return _0x295ea5[_0x425890(0x16c9,0x1591,0x1c56,0xbc0)](_0xaa46b7,_0x17318e(0x5e4,0x15ea,0x1241,0xd25)+_0x295ea5[_0x425890(0xd7f,0xc70,0x803,0xba9)](_0x4facf8,_0x1b0ced)+_0x17318e(0xd67,0xfe8,0x285,0xba0));let _0x355e4f=_0x282734['db'][_0x17318e(0x408,0xf20,0xef5,0xced)]['database'];if(_0x295ea5[_0x425890(0x169e,0x1001,0x1a8a,0xa7c)](_0x7a6971[_0x17318e(0xbb1,0x125d,0x15af,0xd56)+'e'](),_0x355e4f))return _0x295ea5['wyVdr'](_0x4f7571,'\x27'+_0x34d73e+(_0x17318e(0x1b4f,0x1457,0x1075,0x15ce)+_0x425890(0xa48,0xfc2,0xd74,0x8d1)+_0x425890(0x91c,0x8cf,0xdb6,0x234)+_0x17318e(0x604,-0x2e0,-0x6b6,0x342)+'t'));_0x355e4f[_0x2ca3d5[_0x425890(0xa08,0xb39,0xf34,0xc6f)+'e']()]=_0x56a9f5['fakeObj'],_0x295ea5[_0x425890(0x117f,0x1157,0x1021,0xcb6)](_0x368f46,_0x17318e(0x11fc,0xf8e,0x1530,0x12e2)+_0x425890(0x6aa,0xeaf,0x93d,0x54b)+_0x17318e(0xe22,0x121a,0x11b9,0x1471)+_0x425890(-0x103,0x44c,0x9b8,-0x145)+'st\x20As\x20\x27'+_0x151f36+(_0x425890(0x32,0x31f,-0x724,0x4e3)+_0x425890(0xc42,0x1384,0x1df3,0x1453))+_0x3a5ad0+_0x17318e(0x9a4,0xbc3,0x9c2,0xf2a)+_0x5bf8a7+('\x0a\x0aView\x20Lis'+_0x17318e(0x1703,0x1689,0x205d,0x16da)+_0x425890(0xda6,0x158e,0x13c8,0x1b9c))+_0x237a41+_0x425890(0x172e,0x14d3,0x16c7,0x142d));}}_0x3797bd[_0x17318e(0x7a0,0x5d6,0x1a4,0x63c)+'e'](_0x17aa6d[_0x17318e(0x145a,0x1714,0x117d,0xee4)],{'text':_0x2e9f5d,'mentions':_0x8ee05e[_0x425890(0xcb4,0xb6f,0x15f7,0x2d3)](_0x210e71=>_0x210e71['id'])},{'quoted':_0x17aa6d});}else _0x2396f4=!_0x1e18f7[_0x17318e(0x5cf,0x13d9,0x459,0x9cc)]?_0x5e478e['p2']:_0x42af8d['p'],_0x20651c[_0x17318e(-0x1d0,-0x34,0x1090,0x7a7)+_0x425890(0xe71,0xf98,0x63e,0xdae)](_0xbd8fd5[_0x425890(0x10f4,0xcc7,0x784,0x966)],'@'+(_0xe04833[_0x425890(-0x287,0x7af,0xd80,0xd3)]?_0xb52473['p2']:_0x4cd98b['p'])[_0x425890(-0x188,0x2eb,-0x48c,0x7ce)]`@`[0x2647+0x224b+0x2*-0x2449]+(_0x17318e(0x1ed3,0x1e0c,0x1849,0x1543)+_0x425890(0x1085,0xe1c,0x82a,0x1735)+'\x20Game\x20Over'+'!'),_0x2a77f7);}break;case _0x295ea5[_0x17318e(0xa9b,0x3f8,0x9bf,0xbbb)]:{if(!_0x17aa6d[_0x17318e(0xea0,0x7f1,-0xa9,0x532)])return _0x295ea5[_0x425890(0x137b,0xefa,0x1428,0x13a6)](_0x51481c,''+mess[_0x425890(0x1c2,0x9ed,0x2f8,0xa1)]);if(!_0x1a2061)return _0x295ea5[_0x17318e(0x1025,0x191b,0xfec,0x166c)](_0x51481c,''+mess[_0x425890(0x43d,0x4d7,0x8f4,0x2e3)]);if(!_0x5b4303)return _0x295ea5[_0x425890(0x522,0xbc5,0x1484,0xc6f)](_0x51481c,''+mess[_0x425890(0x14eb,0x14b7,0x124b,0x1f48)]);_0x3797bd[_0x17318e(0x700,-0xb3,0x169,0x63c)+'e'](_0x17aa6d[_0x425890(0x148d,0xcc7,0xec7,0x13c2)],{'text':q?q:'','mentions':_0x8ee05e[_0x17318e(0x35a,0x13b1,0x15ae,0xd8c)](_0x29ec1c=>_0x29ec1c['id'])},{'quoted':_0x17aa6d});}break;case _0x295ea5[_0x425890(0xa80,0x6cd,0x4e7,0x7ce)]:case _0x295ea5[_0x425890(0x222,0x6c7,-0x121,-0x358)]:{if(!_0x52a0da&&_0x295ea5[_0x17318e(0x5c2,0x89e,0x2b7,0xc3a)](global['db'][_0x425890(0x2e5,0xad0,0x12ab,0x215)][_0x17318e(0xd15,0xf0c,0xa10,0xf73)][_0x17aa6d[_0x425890(0x7eb,0xa69,0xd00,0x158)]][_0x17318e(0xce9,0x995,0x65e,0x9fd)],-0x17c+-0x26c0+0x1*0x283d))return _0x295ea5[_0x17318e(0x1903,0x14d7,0x10d1,0xf40)](_0xcd1d32,mess[_0x425890(0xfa4,0x109f,0x16b1,0x15c4)]);db[_0x17318e(0x2e9,0xf4a,0x6de,0xced)]['users'][_0x17aa6d[_0x425890(0x6d5,0xa69,0xa90,0x14d1)]][_0x17318e(0x9ef,0xed0,0x17c,0x9fd)]-=0x2677+-0x38*0x13+-0x224e;let {styletext:_0x3ae094}=_0x295ea5[_0x17318e(0x16b7,0x141d,0xeab,0x106c)](require,_0x295ea5['unmnA']);if(!_0x116129)return _0x295ea5[_0x425890(0x1ea5,0x1602,0x1623,0x1436)](_0x51481c,_0x425890(0x56c,0x593,-0x29d,0x6e6)+_0x17318e(0x1e03,0x2083,0x1608,0x17e9));let _0x162f54=await _0x295ea5[_0x425890(0x1742,0xd6d,0x139c,0xd78)](_0x3ae094,_0x116129),_0x27c29c=_0x17318e(0x199b,0x1def,0x1b42,0x14f7)+'xt\x20'+_0x116129+'\x0a\x0a';for(let _0x2a54be of _0x162f54){_0x295ea5[_0x17318e(0x1542,0x1448,0x1240,0x1353)](_0x295ea5[_0x425890(0xae0,0x967,0x1284,0x11af)],_0x295ea5[_0x17318e(0x101f,0xc02,0x5e4,0x78a)])?_0x27c29c+=_0x17318e(0x1459,0xb5e,0x1793,0x12df)+_0x2a54be[_0x425890(0x145d,0xe82,0x10fb,0x8ba)]+_0x425890(0x16a1,0x1043,0x18ec,0xf7a)+_0x2a54be[_0x425890(0x69d,0x23d,-0x7f,-0x795)]+'\x0a\x0a':_0x28171c[_0x17318e(0x4ab,0x3e,0x286,0x4cf)](_0x258b10['format'](_0x1df197));}_0x295ea5['MPmbA'](_0xcd1d32,_0x27c29c);}break;case _0x295ea5[_0x17318e(0x1194,0x1b4f,0x12b6,0x12cf)]:{if(!_0x17aa6d['isGroup'])return _0x295ea5[_0x17318e(0x1ad3,0xcce,0x153b,0x1539)](_0x51481c,''+mess[_0x425890(0x835,0x9ed,0x412,0x14c)]);if(_0x295ea5[_0x425890(-0x57f,0x308,0x515,-0x17b)](_0x17aa6d[_0x425890(0x9cc,0xcc7,0xfcb,0x7d3)],vote))_0x295ea5[_0x425890(0xe11,0x137d,0x1308,0x10e0)](_0x51481c,_0x425890(0x344,0x554,0xb01,-0x118)+_0x425890(0xe7f,0x108b,0x10f6,0xd52)+_0x425890(0x9a2,0xe4c,0xa38,0x95f)+_0x17318e(0x84d,0x1892,0xd01,0xe7f)+_0x4fea53+(_0x17318e(0x11ee,0x1958,0x2130,0x16c1)+_0x425890(0x20c,0x584,0x939,-0x3b9)+_0x425890(0x52c,0x9c2,0x47f,0x89)+_0x425890(0x12e0,0xcdc,0x1346,0x645)));if(!_0x116129)return _0x295ea5['OWzXf'](_0x51481c,_0x425890(-0xa9,0x4a1,0x387,0xaaf)+_0x17318e(0xa50,0x1ccd,0xbd5,0x1450)+_0x17318e(0x877,0x740,-0x20a,0x514)+_0x17318e(-0x49,0x170,-0x4e8,0x3bb)+_0x295ea5['qXuAj'](_0x4fea53,_0x1cbc75)+(_0x17318e(-0x87,-0x8b,0x4bb,0x96a)+_0x17318e(0xe79,-0xe9,0x795,0x7ad)));_0x295ea5[_0x425890(0x1244,0x14e5,0x15e4,0x1352)](_0xcd1d32,'Voting\x20Sta'+_0x425890(0x1125,0x93d,0x372,0x890)+_0x4fea53+(_0x425890(0x10da,0x10dc,0x19c0,0x1951)+_0x425890(0x1363,0x9e1,0xa44,0xd58)+_0x425890(0xdfd,0x1204,0x114a,0x115b))+_0x4fea53+(_0x17318e(0x57e,0x11f8,0xadd,0x8ed)+'For\x20❮❮\x20NO\x20'+_0x425890(0x16b4,0x127e,0x9ab,0xefe))+_0x4fea53+(_0x425890(0x15fe,0xcb1,0x170b,0x8ef)+'\x20-\x20To\x20Chec'+_0x17318e(0xcd1,0xa6,0x1b1,0x5db)+'\x0a*')+_0x4fea53+('delvote*\x20-'+_0x425890(-0xc1,0x584,-0xaa,-0xc7)+_0x17318e(0x1467,0x443,0x1415,0xbdf)+'ion')),vote[_0x17aa6d[_0x425890(0x73e,0xcc7,0x1420,0xa7b)]]=[q,[],[]],await _0x295ea5['kgicd'](sleep,0x1403+0x33*0x67+0x2*-0x1250),upvote=vote[_0x17aa6d[_0x17318e(0xc79,0xcbb,0xc56,0xee4)]][0x4f*-0x68+0x2f*0xd+0x1db6],devote=vote[_0x17aa6d[_0x425890(0x1060,0xcc7,0x91d,0x1363)]][0x151d+-0x489+0x2*-0x849],teks_vote='*❮❮\x20VOTE\x20❯'+_0x425890(0x953,0x7fd,0x719,0x315)+_0x425890(0xc71,0x33b,0x19,-0x1dc)+vote[_0x17aa6d[_0x425890(0x1570,0xcc7,0x3e8,0xa91)]][0x625+0x26*0x6e+-0x1679]+(_0x425890(0xcc3,0x1306,0x1cbe,0xaa9)+_0x17318e(0x1f96,0xc83,0xdb3,0x16f3)+_0x425890(0xd61,0x430,0xdad,0x3a4)+'al:\x20')+vote[_0x17aa6d['chat']][-0x9c5+0x59*0x1b+0x63]['length']+(_0x425890(0x15dc,0xf58,0x8a1,0x1647)+_0x425890(0x93,0x3f1,0xa68,0xbe3)+'/\x20DEVOTE\x20\x20'+_0x425890(-0x426,0x453,0x12e,0x5db)+_0x425890(0x134d,0xa70,0x614,0xe29))+vote[_0x17aa6d[_0x425890(0x7dc,0xcc7,0x16cf,0x171d)]][0x40*0x16+0x12bd+-0x183b][_0x425890(-0x19a,0x8bc,0xee5,0x1d9)]+(_0x17318e(0xefb,0x18f3,0xc5e,0x1175)+'═\x0a\x0a*')+_0x4fea53+(_0x425890(0x1ccc,0x14a4,0x14bd,0x12ad)+'\x20To\x20Delete'+_0x17318e(0x1391,0x2a2,0x117c,0xbdf)+'ion');const _0x254672={};_0x254672[_0x425890(0xe7e,0x10a0,0x1b28,0x184e)+'t']=_0x295ea5[_0x425890(0x1541,0x128a,0xc1f,0x1b26)];const _0x268e0e={};_0x268e0e[_0x17318e(0xe03,0xebd,0x123b,0x1194)]=_0x4fea53+_0x17318e(-0x49,0xa07,0xf62,0x59a),_0x268e0e[_0x17318e(0xffa,0xab5,0xc7f,0x1318)]=_0x254672,_0x268e0e[_0x17318e(0x1c78,0x1380,0x1ba5,0x1638)]=0x1;const _0x1eb0b1={};_0x1eb0b1[_0x17318e(0x162c,0x1b67,0x1485,0x12bd)+'t']=_0x295ea5[_0x17318e(0x1a1a,0x1cbc,0x1a35,0x1715)];const _0x109587={};_0x109587[_0x17318e(0xc20,0x74c,0x8b5,0x1194)]=_0x4fea53+_0x425890(0x1a13,0x15d1,0x1aad,0x141a),_0x109587[_0x425890(0x14a4,0x10fb,0x7e7,0x18b8)]=_0x1eb0b1,_0x109587[_0x425890(0x1d7b,0x141b,0x16fb,0x18c6)]=0x1;let _0x13627a=[_0x268e0e,_0x109587];const _0x8f0ea3={};_0x8f0ea3['text']=teks_vote,_0x8f0ea3['footer']=_0x3797bd[_0x17318e(0x84f,0x1570,0x1c20,0x12db)][_0x425890(0x15ed,0xe82,0x18d8,0x1630)],_0x8f0ea3['buttons']=_0x13627a,_0x8f0ea3[_0x17318e(0x12e6,0x10f2,0x12d3,0x120c)]=0x1;let _0x578f75=_0x8f0ea3;_0x3797bd[_0x425890(0x73e,0x41f,0xb08,-0x61d)+'e'](_0x17aa6d[_0x17318e(0xee6,0x184e,0x6b5,0xee4)],_0x578f75);}break;case _0x295ea5[_0x425890(0xebb,0x93b,0x4a1,0xd8a)]:{if(!_0x17aa6d['isGroup'])return _0x295ea5[_0x17318e(0x12e2,0x149e,0xcf7,0x1244)](_0x51481c,''+mess[_0x17318e(0x1024,0xb97,0x1475,0xc0a)]);if(!_0x295ea5[_0x425890(0x196a,0x1001,0x1a5b,0x1191)](_0x17aa6d[_0x17318e(0xf72,0x1848,0x13c3,0xee4)],vote))return _0x295ea5['wEWys'](_0x51481c,_0x17318e(0xe3f,0x100a,-0x2ea,0x5dc)+'g\x20In\x20This\x20'+_0x17318e(0x13be,0x47a,0xc3,0xb0c)+'*'+_0x4fea53+(_0x17318e(0x1503,0x8a2,0x4fb,0xc7b)+_0x425890(0x56c,0x382,0x38,0xcd1)+_0x425890(0x789,0xe55,0x1507,0x9a2)));isVote=vote[_0x17aa6d[_0x425890(0x1685,0xcc7,0x316,0xfec)]][0x1713+0x14c+0xc2f*-0x2][_0x425890(-0x474,0x347,0x367,0x2c5)](vote[_0x17aa6d[_0x17318e(0x182e,0xde3,0x16a9,0xee4)]][-0x16e5*-0x1+-0x1e43+0x760]),wasVote=isVote['includes'](_0x17aa6d[_0x425890(0x32,0xa69,0x3d6,0x59e)]);if(wasVote)_0x295ea5[_0x17318e(0x112,0xf37,0x9b6,0x96b)](_0x51481c,'You\x27ve\x20Vot'+'ed');vote[_0x17aa6d[_0x17318e(0x11c0,0xeb7,0x1979,0xee4)]][0x1*0x23e3+-0x1*-0x1537+-0x3919][_0x425890(0x5df,0xf0f,0x9f1,0x17da)](_0x17aa6d[_0x17318e(0xf82,0x1106,0xa99,0xc86)]),menvote=vote[_0x17aa6d[_0x425890(0x1631,0xcc7,0x1745,0x321)]][-0x92f+-0x6*-0x3f3+0x26b*-0x6][_0x425890(0xa9,0x347,-0x272,-0x179)](vote[_0x17aa6d[_0x17318e(0xfb3,0x7b0,0x1253,0xee4)]][0x8*0x23+-0x7*0x461+0x1d91]),teks_vote='*❮❮\x20VOTE\x20❯'+_0x425890(0x478,0x7fd,0xf5b,0x954)+'n:*\x20'+vote[_0x17aa6d[_0x425890(0x14e9,0xcc7,0x11ec,0x114b)]][0x127*0x8+-0x2e*-0x16+0x34b*-0x4]+(_0x17318e(0x1533,0x149a,0xa83,0xeda)+'TE\x20✮❯\x0a│\x20\x0a╠'+_0x17318e(0xe77,0xede,0xc41,0xe4b))+vote[_0x17aa6d[_0x17318e(0x10ae,0xeb1,0x575,0xee4)]][-0x2416+0x6*-0x254+-0x320f*-0x1]['length']+'\x0a'+vote[_0x17aa6d[_0x425890(0xed3,0xcc7,0x10d4,0x1490)]][0x3*0x9ff+-0x970+0x1*-0x148c][_0x425890(0x7b2,0xb6f,0x3d6,0x8e8)]((_0x298148,_0x2d0b96)=>'╠\x20'+(_0x2d0b96+(-0x38*0x22+-0x2*0x2db+0x103*0xd))+_0x17318e(0xcc4,0x97e,0x627,0xc43)+_0x298148[_0x17318e(-0x1cd,0xdbd,0xda9,0x508)]`@`[-0xf1*0xe+0x1*0x1dc3+0x5*-0x351])[_0x17318e(0x125,0x1c2,0x682,0x712)]('\x0a')+(_0x425890(0x794,0x688,0x28,0xc7b)+_0x17318e(-0x224,0xd04,0x176,0x442)+_0x425890(0xae7,0x363,-0x39e,-0x670)+_0x425890(0x1708,0x1561,0x1ecd,0xce0))+vote[_0x17aa6d[_0x425890(0x1225,0xcc7,0x10a5,0x16d9)]][0xa27+0x6d9*-0x1+0xd3*-0x4]['length']+'\x0a'+vote[_0x17aa6d[_0x425890(0x14e6,0xcc7,0x1051,0x355)]][0x1ba3*-0x1+-0xc81+0x2826][_0x425890(0x2cd,0xb6f,0x889,0x15e1)]((_0x511aee,_0x188e4)=>'╠\x20'+(_0x188e4+(0x20dd+0x1c2c+0xf8*-0x3f))+_0x17318e(0xac8,0x5cd,0x11dc,0xc43)+_0x511aee[_0x425890(0xbe,0x2eb,0xb18,0x6c4)]`@`[0x1fb9+0x1014+-0x2fcd])[_0x17318e(0xd87,0xa03,0xde9,0x712)]('\x0a')+(_0x425890(0xf85,0x688,-0x28a,-0x61)+'\x0a*')+_0x4fea53+(_0x425890(0x1d70,0x14a4,0x1735,0x1d47)+_0x425890(0x660,0x584,0xc3c,0x185)+_0x425890(0x56,0x9c2,0x9d1,0x95a)+_0x425890(0x6c6,0xcdc,0xeb4,0x83c));const _0x32294b={};_0x32294b[_0x17318e(0xbec,0x1a56,0x1447,0x12bd)+'t']=_0x295ea5[_0x425890(0x1606,0x128a,0x964,0x1a6b)];const _0x4f6660={};_0x4f6660[_0x425890(0xa98,0xf77,0xc12,0x1698)]=_0x4fea53+_0x425890(-0x644,0x37d,0xd34,-0x2c5),_0x4f6660['buttonText']=_0x32294b,_0x4f6660[_0x17318e(0xc12,0x1659,0xe59,0x1638)]=0x1;const _0x1765f0={};_0x1765f0['displayTex'+'t']=_0x295ea5[_0x425890(0xc92,0x14f8,0x160f,0x1b46)];const _0x251674={};_0x251674[_0x425890(0x1203,0xf77,0x861,0x851)]=_0x4fea53+_0x425890(0x1abc,0x15d1,0xfbc,0x1fe6),_0x251674[_0x17318e(0xd25,0x95c,0x10c5,0x1318)]=_0x1765f0,_0x251674[_0x425890(0x11db,0x141b,0x12bf,0x17f4)]=0x1;let _0xf60fc=[_0x4f6660,_0x251674];const _0x104f0f={};_0x104f0f['text']=teks_vote,_0x104f0f[_0x17318e(0xc4d,0xef8,0x6e7,0x597)]=_0x3797bd[_0x17318e(0x18d2,0x13a7,0xd55,0x12db)]['name'],_0x104f0f[_0x17318e(0x1823,0xd6a,0x1558,0x117e)]=_0xf60fc,_0x104f0f[_0x17318e(0xcc1,0x14b5,0xc88,0x120c)]=0x1,_0x104f0f['mentions']=menvote;let _0x202e83=_0x104f0f;_0x3797bd[_0x17318e(0x94b,0x10dc,-0x21,0x63c)+'e'](_0x17aa6d[_0x425890(0x122d,0xcc7,0x551,0x1047)],_0x202e83);}break;case _0x295ea5['yHmls']:{if(!_0x17aa6d['isGroup'])return _0x51481c(''+mess['group']);if(!_0x295ea5[_0x425890(0x524,0x308,-0x2db,0x242)](_0x17aa6d[_0x425890(0x1524,0xcc7,0x7af,0x44b)],vote))return _0x295ea5['YQSfo'](_0x51481c,_0x425890(0x416,0x3bf,-0x5,-0x57f)+'g\x20In\x20This\x20'+'Group!*_\x0a\x0a'+'*'+_0x4fea53+('vote*\x20-\x20To'+_0x17318e(-0xe0,0x38e,0xb2,0x59f)+'ing'));isVote=vote[_0x17aa6d[_0x425890(0x4b6,0xcc7,0x475,0x65e)]][-0x1*0x1ea6+-0x2*-0x132b+0x119*-0x7][_0x17318e(0x6ad,0xaa1,-0x175,0x564)](vote[_0x17aa6d[_0x17318e(0x1497,0x7d5,0x1432,0xee4)]][-0x2d9+0x19ee*0x1+-0x1713]),wasVote=isVote['includes'](_0x17aa6d[_0x425890(0x1396,0xa69,0x1443,0x14ff)]);if(wasVote)return _0x295ea5[_0x17318e(0x20f9,0x1f53,0x2152,0x1793)](_0x51481c,_0x425890(0x85a,0x3cc,-0x68b,0xac6)+'ed');vote[_0x17aa6d['chat']][-0x1de5+0x23ba+-0x5d3][_0x425890(0x148d,0xf0f,0x1765,0x1774)](_0x17aa6d[_0x17318e(0x1205,0x5c8,0x22c,0xc86)]),menvote=vote[_0x17aa6d[_0x17318e(0x133a,0xab0,0xd0f,0xee4)]][-0x2359+0x15a7+0x7*0x1f5][_0x425890(0x21f,0x347,0x67c,-0x5d8)](vote[_0x17aa6d[_0x425890(0x36b,0xcc7,0xbfc,0xda5)]][-0x1abc+-0x10*-0x1a3+-0x8e*-0x1]),teks_vote=_0x17318e(0x418,0xa08,0xf3c,0x950)+'❯*\x0a\x0a*Reaso'+'n:*\x20'+vote[_0x17aa6d['chat']][0x83a+0x64c+-0xe86]+('\x0a\x0a╔❮✮\x20UPVO'+_0x17318e(0x2050,0x1427,0x141c,0x17a7)+_0x17318e(0x8f5,0x188e,0xa80,0xe4b))+vote[_0x17aa6d[_0x17318e(0x8a3,0x1891,0x872,0xee4)]][-0x10a9+0x26b2+-0xb04*0x2]['length']+'\x0a'+vote[_0x17aa6d[_0x425890(0x10ef,0xcc7,0xdcc,0x112f)]][-0x195b+-0x1c*-0x59+0xfa0][_0x425890(0x588,0xb6f,0xce2,0x61f)]((_0xc0f919,_0x3d38c1)=>'╠\x20'+(_0x3d38c1+(-0xf3a*0x1+0x12*0x17e+-0xba1))+'.\x20@'+_0xc0f919[_0x425890(0xce2,0x2eb,0x86b,-0x16e)]`@`[-0x183b+-0x2*-0xda+0x1687])[_0x17318e(0x1149,0xfb,0x743,0x712)]('\x0a')+('\x0a│\x20\x0a╚════\x0a'+'\x0a╔❮✮\x20DEVOT'+_0x17318e(0xa4f,-0x250,0x3c9,0x580)+'Total:\x20')+vote[_0x17aa6d[_0x17318e(0xe2b,0x7c3,0x1481,0xee4)]][0x1632+0x18fa*0x1+-0x2*0x1795][_0x17318e(0x1384,0x97d,0x89a,0xad9)]+'\x0a'+vote[_0x17aa6d[_0x17318e(0x5b7,0x117f,0x16fe,0xee4)]][0x25ca+-0x80f*-0x2+0x1*-0x35e6][_0x425890(0x114,0xb6f,0xad3,0x7a4)]((_0x260f5f,_0x436257)=>'╠\x20'+(_0x436257+(0x179b+-0x1*0x4ab+-0x12ef))+'.\x20@'+_0x260f5f[_0x17318e(0x297,0x1b6,0xb1,0x508)]`@`[0x1c5c+-0x27a*-0xf+-0x4182])[_0x425890(0x264,0x4f5,0x417,0xbc7)]('\x0a')+(_0x425890(0xff,0x688,-0xbf,-0x30a)+'\x0a*')+_0x4fea53+(_0x425890(0x14ee,0x14a4,0x180c,0x1608)+_0x425890(-0x381,0x584,0x40c,-0x1ca)+'\x20Vote\x20Sess'+_0x17318e(0x61a,0x12f5,0x1734,0xef9));const _0x5b2985={};_0x5b2985['displayTex'+'t']=_0x295ea5[_0x425890(0x17bb,0x128a,0x1c04,0x1807)];const _0x6599ec={};_0x6599ec['buttonId']=_0x4fea53+'upvote',_0x6599ec[_0x17318e(0x12fd,0x8d8,0xc17,0x1318)]=_0x5b2985,_0x6599ec[_0x17318e(0xe7d,0x1e62,0xe57,0x1638)]=0x1;const _0x56bb58={};_0x56bb58['displayTex'+'t']=_0x17318e(0x12fb,0x821,0x168b,0xf3f);const _0x15da54={};_0x15da54[_0x425890(0x9ea,0xf77,0x143d,0x9b2)]=_0x4fea53+'devote',_0x15da54[_0x17318e(0xbfe,0x10b7,0x13f3,0x1318)]=_0x56bb58,_0x15da54[_0x425890(0x1880,0x141b,0x1c56,0xf59)]=0x1;let _0x287cd2=[_0x6599ec,_0x15da54];const _0xbf6ed5={};_0xbf6ed5['text']=teks_vote,_0xbf6ed5[_0x17318e(-0x1f7,0x54a,-0x455,0x597)]=_0x3797bd[_0x17318e(0x1aef,0x128f,0x11d6,0x12db)][_0x17318e(0x7e2,0xa7c,0x10e5,0x109f)],_0xbf6ed5[_0x17318e(0x175b,0xbcf,0xe64,0x117e)]=_0x287cd2,_0xbf6ed5[_0x425890(0x6df,0xfef,0xd15,0xa59)]=0x1,_0xbf6ed5[_0x425890(0x424,0xe05,0x3a8,0x11c1)]=menvote;let _0x14ac48=_0xbf6ed5;_0x3797bd[_0x425890(0x408,0x41f,-0x48c,0xe13)+'e'](_0x17aa6d[_0x17318e(0xb29,0x6cf,0x7fb,0xee4)],_0x14ac48);}break;case _0x295ea5[_0x425890(0xa33,0x132b,0x1888,0xa9f)]:if(!_0x17aa6d[_0x425890(-0x518,0x315,-0x1f2,0xb6a)])return _0x295ea5[_0x17318e(0x113a,0xe85,0xa21,0x1444)](_0x51481c,''+mess[_0x17318e(0xb79,0x458,0x6bd,0xc0a)]);if(!(_0x17aa6d[_0x17318e(0x4c7,0xf9d,0x170c,0xee4)]in vote))return _0x295ea5[_0x17318e(0x152c,0x1404,0x533,0xd67)](_0x51481c,_0x425890(0xb45,0x3bf,0x567,0x3cd)+_0x425890(0x6dd,0x9d8,0x118b,0x1276)+_0x17318e(0xb66,0xd5c,0x13b2,0xb0c)+'*'+_0x4fea53+(_0x425890(0x27f,0xa5e,0x1436,0xb5b)+_0x17318e(-0x43c,0x1020,0xab5,0x59f)+_0x425890(0xc34,0xe55,0xa37,0xa89)));teks_vote=_0x425890(0xddd,0x733,0x33,-0x13d)+_0x17318e(0x820,0xcd6,0x1099,0xa1a)+_0x17318e(0x331,0xa5d,0x500,0x558)+vote[_0x17aa6d[_0x17318e(0x51e,0x13ea,0xdc2,0xee4)]][-0x3b8*0x3+-0x1*0x26b+0xd93]+(_0x425890(0x4f5,0xcbd,0x74b,0x40c)+_0x425890(0x1980,0x158a,0x1a76,0x1cb7)+'\x20Total:\x20')+upvote[_0x17318e(0xc7a,0xfb7,0x3d0,0xad9)]+'\x0a'+vote[_0x17aa6d[_0x425890(0x8e2,0xcc7,0x41d,0x10b6)]][0x36f*-0x4+0x1*-0x1417+0x21d4][_0x17318e(0x16f4,0xd3b,0x1262,0xd8c)]((_0x55bee1,_0x82ad4e)=>'╠\x20'+(_0x82ad4e+(-0x26b*0xd+0x2*0x1043+-0x116))+_0x425890(0xa27,0xa26,0x148a,0x262)+_0x55bee1[_0x425890(0x61a,0x2eb,0x13c,0x7f3)]`@`[-0x1*-0xab5+-0x91*-0x19+-0x3*0x84a])['join']('\x0a')+('\x0a│\x20\x0a╚════\x0a'+_0x17318e(-0x20e,0x1a,-0x524,0x442)+_0x17318e(0x772,0xd01,0xc45,0x580)+_0x425890(0x13f3,0x1561,0x1f4d,0x14a2))+devote[_0x17318e(0x13c3,0xe90,0x94d,0xad9)]+'\x0a'+vote[_0x17aa6d['chat']][-0x9c7+0x4f*0x4+0xc7*0xb][_0x425890(0x1450,0xb6f,0xb6d,0x50a)]((_0x38f3aa,_0x412295)=>'╠\x20'+(_0x412295+(0x1f*0x113+0x2385+-0x44d1))+_0x17318e(0xd99,0x8e4,0x566,0xc43)+_0x38f3aa[_0x425890(-0x566,0x2eb,0xa8,0x6fd)]`@`[-0x183c+-0x20c3+0x38ff])[_0x425890(-0x3be,0x4f5,-0x220,0xc6c)]('\x0a')+(_0x425890(0x91,0x688,0x45e,0x693)+'\x0a*')+_0x4fea53+(_0x425890(0x12f9,0x14a4,0x1de6,0x118b)+_0x17318e(0x180,0x20c,0x3cd,0x7a1)+_0x17318e(0xab1,0xc35,0xb48,0xbdf)+_0x17318e(0x14ce,0x9b5,0x51c,0xdbd))+_0x3797bd[_0x17318e(0xe3b,0x1a2b,0x110f,0x12db)]['id']+'\x0a',_0x3797bd[_0x425890(0x5b4,0x58a,-0x1cb,0xbbc)+'thMentions'](_0x17aa6d[_0x425890(0x12fc,0xcc7,0xd7c,0x11cc)],teks_vote,_0x17aa6d);break;case _0x295ea5[_0x425890(-0x4eb,0x104,0x58f,0x4cb)]:case _0x295ea5[_0x17318e(0xbd4,0x91,0x41f,0x33b)]:case _0x295ea5['Puhmh']:{if(_0x295ea5['hhOeb'](_0x425890(0x131a,0x14bb,0x1299,0x1d1b),_0x295ea5['JyUqI'])){const _0xdafa9a={};_0xdafa9a[_0x17318e(0x686,0x405,0x823,0x405)]='*මොකෝ\x20අනේ'+_0x17318e(0x14dc,0x9bf,0x9ac,0xb1f);const _0x3484ec={};_0x3484ec[_0x17318e(0x7d8,0xe64,0x26d,0xa24)]=_0x167cb8,_0x2712ea[_0x425890(0x3e5,0x41f,0x841,0x27)+'e'](_0x31376d,_0xdafa9a,_0x3484ec);}else{if(!_0x17aa6d[_0x17318e(0x42d,0x4e4,0x2c9,0x532)])return _0x51481c(''+mess[_0x17318e(0x5c5,0xfc7,0xd24,0xc0a)]);if(!_0x295ea5['thZPx'](_0x17aa6d[_0x425890(0xf93,0xcc7,0xcb7,0x7ac)],vote))return _0x295ea5[_0x17318e(0x1f44,0x1aa3,0xade,0x14e7)](_0x51481c,_0x17318e(0xf82,-0x21e,0x30f,0x5dc)+_0x425890(0x48d,0x9d8,0xbe5,0x11a9)+_0x17318e(0x1563,0x633,0x5e5,0xb0c)+'*'+_0x4fea53+('vote*\x20-\x20To'+_0x425890(0x5d2,0x382,0xaf3,0xada)+_0x17318e(0x1476,0x171d,0x684,0x1072)));delete vote[_0x17aa6d[_0x425890(0x5da,0xcc7,0x1360,0x104e)]],_0x295ea5[_0x17318e(0xc91,0x1d3b,0x1fbc,0x16fd)](_0xcd1d32,'Successful'+_0x425890(0xe01,0xd0a,0x1130,0x1034)+_0x17318e(0x2f3,0xf98,0xa39,0xce7)+_0x425890(0xa2d,0x259,-0x1c,0x5b1)+_0x17318e(0xc0f,0xa1a,0x499,0x7cd)+'p');}}break;case _0x17318e(0x8e5,0x4e3,0x131e,0xc0a):case _0x295ea5[_0x425890(0x961,0xeed,0x117e,0xb3c)]:{if(!_0x17aa6d[_0x17318e(0x6fa,0x9ce,0xafb,0x532)])return _0x295ea5[_0x17318e(0x17db,0x14e2,0x209b,0x166c)](_0x51481c,''+mess[_0x425890(0x898,0x9ed,0x315,0xa70)]);if(!_0x1a2061)return _0x51481c(''+mess['botAdmin']);if(!_0x5b4303)return _0x295ea5[_0x17318e(0x10ea,0x1148,0xba0,0x1135)](_0x51481c,''+mess[_0x425890(0xe57,0x14b7,0x1711,0x1632)]);if(_0x52a010[0x775*-0x1+0x117f+-0x202*0x5]===_0x425890(0xbc4,0x96f,0x5b8,0xcea)){if(_0x295ea5['wogRq'](_0x295ea5[_0x425890(0x98d,0xd3a,0x13f2,0xad4)],_0x295ea5['kXAAj']))await _0x3797bd[_0x425890(0xc4,0x7f8,0xa55,0x2b5)+_0x425890(0xc40,0x36c,-0x11c,-0x43)](_0x17aa6d[_0x17318e(0x158f,0x9bf,0x12ab,0xee4)],_0x295ea5[_0x17318e(0x1891,0x1823,0x9d3,0xfee)])[_0x17318e(0xe15,0xabd,-0x4c2,0x3d0)](_0x2eac92=>_0xcd1d32(_0x17318e(0xf5e,0x1a57,0xce3,0x12e2)+_0x425890(0xc1b,0x34c,-0x464,-0x3b8)+_0x425890(0xc33,0x115f,0x9f6,0xfe3)))[_0x17318e(0x1b11,0x1b2f,0x16f9,0x10e8)](_0x52647f=>_0xcd1d32(jsonformat(_0x52647f)));else return _0x207a52['toString']()['search'](LUASZC[_0x425890(0x1e85,0x13f4,0x1328,0x9c6)])[_0x17318e(0x183,0xabc,0x14fc,0xbe9)]()[_0x425890(0xc61,0x1da,0xb4,-0x390)+'r'](_0x26a001)['search'](LUASZC[_0x17318e(0x1c68,0x16c5,0xc4b,0x1611)]);}else{if(_0x295ea5[_0x425890(0xc04,0x155a,0x1e1a,0x1cf8)](_0x52a010[0x1e73+-0x682+-0x17f1],_0x295ea5[_0x17318e(-0x53,0x1173,0xce1,0xa1e)]))_0x295ea5['VYPKE'](_0x295ea5[_0x17318e(0xc84,0xcef,0x812,0x977)],_0x425890(0x10e6,0x15f6,0x1d22,0x17c2))?await _0x3797bd['groupSetti'+_0x425890(0x7cc,0x36c,-0x263,-0x190)](_0x17aa6d['chat'],_0x295ea5[_0x425890(0x5c9,0xe81,0x1708,0xec7)])[_0x17318e(0x579,0xbfd,0xbdc,0x3d0)](_0x59b9b0=>_0xcd1d32(_0x425890(0x99e,0x10c5,0x1979,0x6a6)+_0x425890(0xfb6,0xf2e,0x9b9,0x819)+_0x425890(0xff0,0x115f,0x9ed,0x1670)))[_0x17318e(0x1828,0x12e7,0x9c8,0x10e8)](_0x4a5079=>_0xcd1d32(jsonformat(_0x4a5079))):_0x208c3a+='➸\x20*ID\x20:*\x20@'+_0x1f515c['id'][_0x17318e(0xa4b,0x537,-0x455,0x508)]('@')[0x1ecc+-0x278+-0x1c54]+(_0x425890(0x35f,0x4be,0x61f,0x5c7)+'\x20:\x20')+_0x385f9b[_0x17318e(0x5a1,0x1161,0x353,0x9fd)]+'\x0a';else{const _0x1a40eb={};_0x1a40eb[_0x425890(0xfd8,0x10a0,0xa26,0xe04)+'t']=_0x295ea5['jpXph'];const _0xbd7afe={};_0xbd7afe[_0x17318e(0xc81,0xe0b,0x9e5,0x1194)]=_0x17318e(0xb,-0x87,0x6ad,0x860),_0xbd7afe[_0x425890(0x10db,0x10fb,0x14d5,0xdc2)]=_0x1a40eb,_0xbd7afe['type']=0x1;const _0xb1a65b={};_0xb1a65b[_0x17318e(0x1727,0x16b8,0x143f,0x1194)]=_0x295ea5['VZUUF'],_0xb1a65b[_0x425890(0x155e,0x10fb,0x1708,0x11a8)]={},_0xb1a65b[_0x17318e(0x1570,0xea7,0x1190,0x1638)]=0x1,_0xb1a65b[_0x425890(0x155e,0x10fb,0x1708,0x11a8)][_0x17318e(0xd7a,0xfc4,0x9f0,0x12bd)+'t']=_0x295ea5[_0x17318e(0xe33,-0x25a,0x50e,0x5c7)];let _0x1bf510=[_0xbd7afe,_0xb1a65b];await _0x3797bd[_0x17318e(0x188b,0x141a,0x8f5,0x12c4)+'Text'](_0x17aa6d[_0x17318e(0x193a,0x631,0x88a,0xee4)],_0x1bf510,'Group\x20Mode',_0x3797bd[_0x17318e(0x141b,0xea5,0xd78,0x12db)][_0x425890(0xd57,0xe82,0x1543,0xa3e)],_0x17aa6d);}}}break;case _0x295ea5[_0x425890(0x495,0xdfb,0xa7c,0x182d)]:{if(!_0x17aa6d[_0x17318e(-0x4ef,0x8e6,-0x345,0x532)])return _0x51481c(''+mess[_0x425890(0x307,0x9ed,0x1da,0x5e6)]);if(!_0x1a2061)return _0x51481c(''+mess[_0x425890(0x505,0x4d7,-0x351,0x3ab)]);if(!_0x5b4303)return _0x295ea5[_0x425890(0x10e,0x151,0xa4,0xb2f)](_0x51481c,''+mess[_0x17318e(0xc43,0x18fa,0xcb6,0x16d4)]);if(_0x295ea5[_0x17318e(0xca7,-0x5c,0x2fa,0x737)](_0x52a010[-0x12*0xae+-0x16*-0x2+0x1*0xc10],_0x17318e(0x929,0x16b3,0x117a,0xdd0)))await _0x3797bd[_0x425890(0x2a2,0x7f8,0x8a3,0xb16)+'ngUpdate'](_0x17aa6d[_0x17318e(0x135a,0xfc0,0x12f1,0xee4)],_0x295ea5[_0x17318e(0xbf8,0x53a,0xbab,0xb00)])['then'](_0x5308f8=>_0xcd1d32('Successful'+_0x425890(0x26e,0x1a6,0xdb,0x8e7)+'Edit\x20Group'+_0x425890(0x72e,0x7b8,-0x295,-0x63)))['catch'](_0x50ffef=>_0xcd1d32(jsonformat(_0x50ffef)));else{if(_0x295ea5['vezmJ'](_0x52a010[-0x714+0x17*-0x2f+-0x1*-0xb4d],'close'))await _0x3797bd[_0x425890(0xe41,0x7f8,0x408,0x66d)+_0x425890(0xbae,0x36c,0x845,-0x466)](_0x17aa6d[_0x17318e(0x72e,0x6f8,0xaaa,0xee4)],_0x295ea5[_0x17318e(0xa5b,0xdeb,0xd2,0x396)])[_0x425890(-0x34e,0x1b3,-0x138,0x93e)](_0x4c5151=>_0xcd1d32('Successful'+_0x425890(0xf46,0xddc,0x16cd,0xe65)+_0x17318e(0x1216,0xfca,0x4db,0xe87)+_0x17318e(0x1034,0x1454,0x1115,0x9d5)))['catch'](_0x47e2f7=>_0xcd1d32(jsonformat(_0x47e2f7)));else{if(_0x295ea5[_0x17318e(0xd3b,0x722,0x621,0xe5a)](_0x295ea5['lafRl'],'qmulR')){const _0x394e9b={};_0x394e9b[_0x425890(0xdc3,0x10a0,0x9d1,0x1114)+'t']='Open';const _0x33b5ed={};_0x33b5ed[_0x425890(0x658,0xf77,0xd79,0x569)]=_0x295ea5['TasLL'],_0x33b5ed[_0x425890(0x684,0x10fb,0x176f,0x7d4)]=_0x394e9b,_0x33b5ed[_0x425890(0x15af,0x141b,0x14f9,0x1d6d)]=0x1;const _0x1891d2={};_0x1891d2['buttonId']=_0x295ea5['uMmqj'],_0x1891d2[_0x17318e(0x882,0xa7c,0xf6d,0x1318)]={},_0x1891d2['type']=0x1,_0x1891d2[_0x17318e(0x882,0xa7c,0xf6d,0x1318)][_0x17318e(0x87a,0xd05,0xd68,0x12bd)+'t']=_0x295ea5[_0x17318e(-0x466,0x6dd,-0x43a,0x5c7)];let _0x5f52e4=[_0x33b5ed,_0x1891d2];await _0x3797bd['sendButton'+_0x425890(0x345,0xcec,0xcd9,0xa1f)](_0x17aa6d[_0x425890(0xc2a,0xcc7,0xc91,0x129e)],_0x5f52e4,'Mode\x20Edit\x20'+_0x17318e(0x936,0x300,-0x41f,0x5d9),_0x3797bd['user'][_0x425890(0xbcb,0xe82,0x1072,0x17a2)],_0x17aa6d);}else{_0x16ade2=_0x683da8[_0x17318e(0x15ab,0x7ff,0xdb9,0xc73)+'nc']('./src/drag'+'onowner/in'+_0x17318e(0x17de,0x2139,0x1b08,0x17a4));const _0x3a6044={};_0x3a6044[_0x17318e(0x8f0,0x14a0,0x186e,0x1092)]=_0x37d795,_0x3a6044[_0x425890(0x7b7,0xdfe,0x16a0,0x172c)]=_0x295ea5[_0x425890(0x1c14,0x119a,0x1316,0x1a24)],_0x3a6044[_0x17318e(0x1cde,0x1b32,0x1f8a,0x177b)]=!![];const _0x50887b={};_0x50887b['quoted']=_0x2c0937,_0x853956['sendMessag'+'e'](_0x10cdfb[_0x425890(0xf5d,0xcc7,0x108b,0x6ca)],_0x3a6044,_0x50887b),_0x295ea5['RyBYz'](_0x242d53,_0x425890(0x10d4,0x987,0x36f,0xbb1)+_0x17318e(0xab0,0xb86,0x9fa,0x84c)+_0x395694[_0x17318e(0x1311,0x94,0x66b,0xa88)]+('*\x0a\x0a*_https'+'://wa.me/')+_0x5cd114[_0x425890(0xc60,0xd5c,0x2df,0x657)]+_0x425890(0x3ef,0xcb0,0x465,0x14f5)+_0xa6d115[_0x425890(0x1681,0xf3c,0x10d6,0x12ca)]);}}}}break;case _0x295ea5[_0x17318e(0x2c6,0x997,0x2d6,0x8c3)]:{if(_0x425890(0x10a1,0x923,0x10e5,0xab0)===_0x295ea5['oMTeT'])var _0xb461d8=_0x295ea5[_0x425890(0x170b,0x100a,0x1373,0x177f)];else{if(!_0x17aa6d[_0x17318e(0x74c,0xec5,0x96d,0x532)])return _0x295ea5[_0x425890(0xdf5,0x1472,0x182c,0x1c9c)](_0x51481c,''+mess[_0x17318e(0x2e4,0x849,0x433,0xc0a)]);if(!_0x1a2061)return _0x295ea5['lRGNr'](_0x51481c,''+mess[_0x425890(-0x274,0x4d7,0x5cf,0x70)]);if(!_0x5b4303)return _0x295ea5[_0x17318e(0xe5a,0x1457,0x1c1,0xacf)](_0x51481c,''+mess[_0x17318e(0x2130,0x20ac,0x1721,0x16d4)]);if(_0x52a010[-0x6*0xad+-0x1*0x136d+0x177b]==='on'){if(_0x295ea5[_0x17318e(0x1de6,0x185f,0x1d26,0x16e7)](_0x295ea5[_0x17318e(0x4c2,0x167f,0x514,0xc9f)],'GxJKk')){if(!_0x505585(_0x3cf54f['status']))_0x34aef8[_0x425890(0x786,0x1098,0xff3,0x773)]=0x26e+0xc*-0x83+0x5f*0xa;if(!_0x295ea5[_0x425890(0xf78,0x1001,0xe4f,0x1617)]('autobio',_0x46b147))_0x43d914['autobio']=![];}else{if(db[_0x425890(0xa91,0xad0,0xd8a,0x1368)][_0x425890(0xb51,0xacb,0x547,0x112a)][_0x17aa6d[_0x425890(0x10e3,0xcc7,0x11d1,0x36e)]][_0x425890(0x1320,0x101f,0x5c2,0x1276)])return _0x295ea5[_0x425890(0xf9f,0x14e0,0x1a04,0x1a6a)](_0xcd1d32,_0x425890(0x424,0x9eb,0xbac,0xc87));db['data'][_0x425890(0xe03,0xacb,0x1258,0x11e9)][_0x17aa6d[_0x425890(0x55b,0xcc7,0x952,0xaf8)]][_0x17318e(0x13da,0xe47,0x12b9,0x123c)]=!![],_0x295ea5['VQCBK'](_0xcd1d32,_0x425890(0x8ef,0x1046,0x18f7,0xb08)+_0x17318e(0xfbe,-0x4f,0x8f7,0x9d3));}}else{if(_0x295ea5[_0x17318e(0x1e4,0x22f,0x1c8,0x65b)](_0x52a010[-0xa0a+0xc81+-0x277],_0x295ea5[_0x17318e(0x917,0xbf8,0x145c,0x130c)])){if(_0x295ea5[_0x17318e(0xe0d,0x984,0x16ab,0x11e5)](_0x295ea5[_0x17318e(0x180,0x149a,0x72f,0xa11)],_0x295ea5[_0x17318e(0x1d0,0xdd4,0x15a,0xa11)])){_0x295ea5[_0x17318e(0xb80,0xeac,0x138f,0x1195)](_0xf0c378,_0x4338b8[_0x425890(0x684,0x2c6,-0x491,0xd2a)]);const _0x35e1b6={};_0x35e1b6[_0x425890(0xfcb,0x5f3,-0x187,0x68c)]=_0x295ea5[_0x425890(0x591,0xab8,0x12a7,0x10e)];const _0x53dc9e={};_0x53dc9e[_0x425890(-0x4c4,0x565,0xc02,0x961)]=_0x35e1b6,_0x53dc9e[_0x17318e(0x9d5,0x7ae,0x1665,0x101b)]=_0x295ea5[_0x425890(0xe2c,0x669,-0x244,0x1095)],_0x53dc9e[_0x17318e(0xea5,0x1124,0xf47,0xf21)]=_0x295ea5['lGWJt'];const _0x1dc135={};_0x1dc135[_0x17318e(0x1272,0x264,0xb72,0xa24)]=_0x4c8cab,_0x427e68[_0x17318e(-0x415,0x723,0x6ed,0x63c)+'e'](_0x27cdc3[_0x17318e(0x169c,0x193e,0x1393,0xee4)],_0x53dc9e,_0x1dc135);}else{if(!db[_0x17318e(0x1742,0xeb3,0x382,0xced)][_0x425890(0x11ee,0xacb,0x12c6,0xf71)][_0x17aa6d[_0x17318e(0x14c8,0x1152,0x1172,0xee4)]][_0x425890(0x7ed,0x101f,0x9a1,0x1026)])return _0x295ea5[_0x425890(0x1383,0xcf7,0xdc3,0x475)](_0xcd1d32,'Deactivate'+'d');db[_0x425890(0xf06,0xad0,0x14d8,0x1397)][_0x17318e(0x13ca,0x11f6,0xd62,0xce8)][_0x17aa6d['chat']][_0x425890(0x101d,0x101f,0x1a57,0x138f)]=![],_0xcd1d32(_0x425890(0xa5d,0x914,0x6f1,0xfa5)+_0x425890(0x69e,0x1004,0x17e2,0x147c));}}else{const _0x14c061={};_0x14c061[_0x425890(0x762,0x10a0,0x15b8,0xb7c)+'t']='On';const _0x5e5056={};_0x5e5056[_0x425890(0x17f3,0xf77,0xaa6,0x1929)]=_0x295ea5['GKNEp'],_0x5e5056[_0x425890(0x1042,0x10fb,0x1912,0x1b3d)]=_0x14c061,_0x5e5056['type']=0x1;const _0x2265ce={};_0x2265ce[_0x425890(0x1b18,0x10a0,0x12d3,0x624)+'t']=_0x17318e(0xfa8,0x19ff,0xfe9,0x1852);const _0x26dc45={};_0x26dc45['buttonId']=_0x295ea5['IuVPy'],_0x26dc45[_0x17318e(0x1887,0xeaf,0xa04,0x1318)]=_0x2265ce,_0x26dc45[_0x425890(0xe35,0x141b,0xf2d,0xe0b)]=0x1;let _0x13d912=[_0x5e5056,_0x26dc45];await _0x3797bd['sendButton'+'Text'](_0x17aa6d[_0x425890(0xdc5,0xcc7,0x2cd,0x5f7)],_0x13d912,_0x425890(0x18fd,0x12bc,0xe52,0xb6e)+_0x17318e(0xedc,0x8e4,0x1187,0x72b),_0x3797bd['user'][_0x17318e(0xa06,0x15b1,0x109d,0x109f)],_0x17aa6d);}}}}break;case _0x295ea5['sTstP']:{if(_0x295ea5[_0x17318e(0xdc4,0x1b45,0x1534,0x11fb)]('aKqbg',_0x295ea5['oOvwV'])){if(_0x295ea5['EyZeP'](_0x5addeb[_0x425890(0x10c7,0x8db,0x9a0,0xb27)],_0x295ea5[_0x425890(0x405,0xcca,0x137c,0x969)]))return;if(_0x295ea5[_0x17318e(0x60b,-0x18c,0x26a,0x467)](_0x4850eb[_0x17318e(0x1053,0x57c,0xf16,0xaf8)],_0x295ea5['UgBoL'])){const _0x3e8005={};_0x3e8005[_0x17318e(-0x109,-0x1aa,-0x5fc,0x405)]=_0x17318e(0x17a5,0x18ac,0xf1c,0x132c)+_0x17318e(0x198b,0xdaf,0x15dd,0x1781);const _0x52d993={};_0x52d993[_0x425890(0x31b,0x807,-0x14d,-0x27a)]=_0x10fc2b,_0x592ce9[_0x17318e(0x9d4,0x8c7,0x3fe,0x63c)+'e'](_0x13f1ef,_0x3e8005,_0x52d993);}}else{if(!_0x17aa6d['isGroup'])return _0x295ea5['cgadO'](_0x51481c,''+mess[_0x425890(0x3b4,0x9ed,0x36d,0xc31)]);if(!_0x1a2061)return _0x295ea5['hehRE'](_0x51481c,''+mess[_0x425890(0x528,0x4d7,0x19e,0x5f5)]);if(!_0x5b4303)return _0x51481c(''+mess[_0x17318e(0x145c,0x1254,0xf11,0x16d4)]);if(_0x52a010[-0x1df4+-0x1*0x775+0x9d*0x3d]==='on'){if(db[_0x425890(0x623,0xad0,0x680,0x8f8)][_0x17318e(0xd1e,0xdfa,0xf58,0xce8)][_0x17aa6d['chat']][_0x425890(0x1270,0x12fd,0x18fa,0x86a)])return _0x295ea5[_0x17318e(0x17f,0xba8,0xb5e,0x8a7)](_0xcd1d32,_0x425890(0xb03,0xd44,0x5d0,0x8b7)+_0x17318e(0xd25,0xde0,0x13b7,0xe9b));db[_0x17318e(0x171f,0x88b,0x5cd,0xced)][_0x425890(0x129c,0xacb,0xd86,0xf5d)][_0x17aa6d['chat']][_0x425890(0x1058,0x12fd,0x1ada,0x15b3)]=!![],_0x295ea5[_0x17318e(0x1652,0x16bd,0x837,0xf40)](_0xcd1d32,_0x3797bd[_0x425890(0x903,0x10be,0x963,0xcd6)][_0x425890(0x13e4,0xe82,0x971,0x657)]+(_0x17318e(0x14fa,0x13f2,0x284,0xb0e)+'Muted\x20In\x20T'+_0x17318e(0x1b2a,0x1051,0xdeb,0x15b1)+'!'));}else{if(_0x295ea5[_0x17318e(0x13c4,0xe39,0xa63,0xa26)](_0x52a010[-0x10b*0x16+-0x19b4+0xd*0x3be],_0x295ea5[_0x425890(0x13ed,0x10ef,0x180d,0xdd0)])){if(!db[_0x17318e(0xb3c,0x15a8,0xdcd,0xced)]['chats'][_0x17aa6d[_0x17318e(0xa1e,0x1823,0x122b,0xee4)]][_0x425890(0x159e,0x12fd,0x1cd5,0x141f)])return _0x295ea5['oWSQs'](_0xcd1d32,_0x425890(0x15b4,0xd44,0x13b1,0xf3b)+_0x425890(0x1946,0x13a7,0x1581,0x1696));db[_0x17318e(0x36c,0x79b,0x1480,0xced)][_0x425890(0x1333,0xacb,0xcd4,0x690)][_0x17aa6d[_0x425890(0x1277,0xcc7,0x46e,0x16c0)]][_0x17318e(0x1db5,0x10fd,0xe50,0x151a)]=![],_0x295ea5[_0x425890(0x11ef,0x156f,0xf7b,0x1a89)](_0xcd1d32,_0x3797bd['user']['name']+(_0x425890(0x96d,0x8f1,0x277,0x63d)+_0x425890(0x5a0,0x3a9,0xac6,-0x196)+_0x17318e(0x1240,0xe84,0x972,0x7cd)+'p!'));}else{const _0x4dabcd={};_0x4dabcd[_0x17318e(0x175c,0x13aa,0x1a21,0x12bd)+'t']='On';const _0x55e259={};_0x55e259[_0x425890(0x1415,0xf77,0x1689,0xe44)]=_0x295ea5['eawuK'],_0x55e259[_0x17318e(0x1b02,0x163c,0x1a44,0x1318)]=_0x4dabcd,_0x55e259['type']=0x1;const _0x339fba={};_0x339fba[_0x17318e(0x1cc7,0x1806,0xdc8,0x12bd)+'t']=_0x17318e(0x110b,0xfe6,0x13b1,0x1852);const _0x79d8e6={};_0x79d8e6[_0x425890(0xc67,0xf77,0xc08,0x1051)]=_0x425890(0x8ef,0x9d5,0x6b0,0x714),_0x79d8e6[_0x425890(0x1a87,0x10fb,0x92e,0xe59)]=_0x339fba,_0x79d8e6[_0x425890(0x12d3,0x141b,0x1413,0x1242)]=0x1;let _0x17c0a6=[_0x55e259,_0x79d8e6];await _0x3797bd[_0x425890(0xe24,0x10a7,0x10d9,0x78c)+_0x425890(0xfe2,0xcec,0x1366,0xd06)](_0x17aa6d[_0x17318e(0x967,0x542,0x896,0xee4)],_0x17c0a6,'Mute\x20Bot',_0x3797bd[_0x17318e(0x11b8,0x14ac,0x1400,0x12db)]['name'],_0x17aa6d);}}}}break;case _0x295ea5[_0x425890(0x954,0x49a,0x3f1,-0x223)]:case _0x295ea5[_0x17318e(0x122f,0x1a6a,0x8ba,0x118c)]:case _0x425890(0x6aa,0x7ea,0xfd6,-0x9e):case _0x295ea5[_0x425890(0xbf2,0x148d,0x195a,0x188f)]:{if(!_0x17aa6d[_0x425890(0xd0,0x315,-0x167,0x678)])return _0x295ea5[_0x425890(0xb35,0x394,0x5ea,-0x3f1)](_0x51481c,''+mess[_0x425890(-0x3f,0x9ed,0x10b0,0x38c)]);let _0x4854aa=await _0x3797bd[_0x17318e(0x21f,0x1005,0x1287,0x81d)+_0x425890(0x98b,0x513,0xc5b,0xcc1)](_0x17aa6d[_0x425890(0xd51,0xcc7,0xf34,0x10c4)]);const _0x1f8050={};_0x1f8050[_0x425890(0x170f,0x131f,0x1220,0x1700)]=!![],_0x3797bd[_0x17318e(0xc74,0x14b8,0xffe,0x14cf)](_0x17aa6d[_0x17318e(0x586,0x577,0x10d9,0xee4)],_0x17318e(0x14f3,0x1f2d,0x141c,0x1608)+'at.whatsap'+'p.com/'+_0x4854aa+'\x0a\x0a'+_0x4d20ab[_0x425890(0xfd7,0x11ba,0x1911,0x194e)]+(_0x17318e(0x10f3,0x18bf,0x1227,0x1119)+'k'),_0x17aa6d,_0x1f8050);}break;case _0x17318e(0x7d3,0x119a,0x1735,0xefa):{if(!_0x17aa6d[_0x17318e(0xf2c,0xed,-0x4b6,0x532)])_0x295ea5[_0x17318e(-0x131,0x2da,0x684,0x666)](_0x51481c,''+mess['group']);if(!_0x1a2061)return _0x295ea5[_0x17318e(0x1803,0x163e,0x118c,0x10ad)](_0x51481c,''+mess[_0x17318e(0x3b4,0x44d,0x859,0x6f4)]);if(!_0x5b4303)return _0x295ea5[_0x17318e(0xa0c,0x1525,0x103a,0x1117)](_0x51481c,''+mess['admin']);if(!_0x116129)return _0x295ea5[_0x425890(0x1153,0xc1a,0x851,0x8c7)](_0x51481c,_0x425890(0x100f,0xd93,0x1110,0x52f)+_0x17318e(0x933,0x26e,0x63f,0x408)+'able\x20Value'+'s');if(_0x52a010[-0xde*0xd+0x4c2+0x684]===_0x295ea5[_0x17318e(0x6a4,0xbda,0x51b,0xbb3)]){if(_0x295ea5[_0x425890(0x885,0x842,0x7ec,0x929)]!==_0x295ea5[_0x17318e(0x142a,0xf25,0x1c9f,0x143a)]){const _0x3fa99e={};_0x3fa99e[_0x425890(0x128c,0xbbe,0xa95,0x849)+_0x17318e(0x9fb,0x906,0xd40,0x73d)+_0x425890(0x10c9,0x6d4,-0xba,0xbd7)]=WA_DEFAULT_EPHEMERAL,await _0x3797bd[_0x17318e(0xf7a,0x437,0x949,0x63c)+'e'](_0x17aa6d[_0x17318e(0x154f,0x1293,0x715,0xee4)],_0x3fa99e)['then'](_0x1ec071=>_0xcd1d32(jsonformat(_0x1ec071)))['catch'](_0x7fef6=>_0xcd1d32(jsonformat(_0x7fef6)));}else _0x295ea5['fXJJm'](_0x29f8f7,_0x295ea5[_0x17318e(0xef9,0x9ab,-0xf0,0x662)]);}else{if(_0x295ea5[_0x425890(0x128a,0x1174,0xfb9,0x1516)](_0x52a010[0x1923+0x1b47+0x1*-0x346a],_0x295ea5[_0x17318e(0xcb3,0xbd0,0x1268,0x1265)])){if(_0x295ea5[_0x17318e(0x58d,0xe26,0x1691,0xd42)](_0x295ea5[_0x425890(0x272,0x2b5,0x61e,0x8da)],_0x295ea5[_0x425890(0x18b,0x2b5,-0x2eb,-0x637)]))_0x295ea5[_0x425890(0x85e,0x4eb,0x97f,0x941)](_0x14b9cd,_0x17318e(0x18b2,0x1cf4,0x1d55,0x1735)+_0x17318e(0x778,0xcab,0x93f,0xd41)+_0x425890(0x76c,0x8f4,-0xe7,0x685)+'\x20Remaining'+'\x20Money*\x20:\x20'+_0x295ea5[_0x17318e(0x18b1,0x1e32,0xdd3,0x1444)](_0x53a4bf,_0x511391[_0x17318e(0x144e,0xe75,0xf2c,0xc86)])+('\x0a*Your\x20Rem'+_0x17318e(0x534,-0x281,0x646,0x3f5)+'ep(s)*\x20:\x20')+_0x295ea5[_0x425890(-0x4b4,0x24b,0xb12,-0x26c)](_0x2a3946,_0x29c1bb[_0x17318e(0x72d,0x1227,0x7e4,0xc86)]));else{const _0x4166e5={};_0x4166e5[_0x425890(0xf1c,0xbbe,0x94f,0x5e8)+_0x425890(0x862,0x520,0xcb1,0x8b7)+_0x17318e(0x91a,0x517,0x57b,0x8f1)]=![],await _0x3797bd[_0x425890(0x74c,0x41f,0x830,-0x190)+'e'](_0x17aa6d[_0x17318e(0x4d9,0x8ba,0x115e,0xee4)],_0x4166e5)[_0x17318e(-0x509,0xf4,0x96f,0x3d0)](_0x26ef70=>_0xcd1d32(jsonformat(_0x26ef70)))[_0x425890(0xc89,0xecb,0x7bc,0x1192)](_0x1b5b5f=>_0xcd1d32(jsonformat(_0x1b5b5f)));}}}}break;case _0x295ea5['mbsYi']:case _0x295ea5[_0x425890(0x4b9,0xdc3,0x14a7,0x1173)]:{if(!_0x17aa6d[_0x425890(0xd02,0x807,0x9db,0x287)])_0xcd1d32(![]);let {chat:_0x47dc13,fromMe:_0x519037,id:_0x562509,isBaileys:_0x1e091f}=_0x17aa6d['quoted'];if(!_0x1e091f)return _0x295ea5['zAkqE'](_0x51481c,_0x425890(0x1d34,0x12d7,0xd6d,0x1b84)+_0x425890(0x193c,0x1545,0x16d4,0x1491)+_0x17318e(0xa90,0x11f4,0x140a,0xedb)+'Bot!');_0x3797bd[_0x425890(0x716,0x41f,-0x42a,0xd49)+'e'](_0x17aa6d['chat'],{'delete':{'remoteJid':_0x17aa6d[_0x425890(0xb48,0xcc7,0x9a9,0x699)],'fromMe':!![],'id':_0x17aa6d['quoted']['id'],'participant':_0x17aa6d[_0x425890(0x544,0x807,0x2bb,0xe88)][_0x17318e(0xccf,0x13d8,0x293,0xc86)]}});}break;case _0x425890(0xe6e,0x5d2,-0x472,-0x292):case _0x295ea5[_0x17318e(-0x3ba,-0x9c,0xb5a,0x628)]:{if(!_0x193cb6)return _0x51481c(''+mess[_0x17318e(0x143f,0xa1a,0x181c,0x1494)]);if(!_0x116129)return _0x295ea5[_0x17318e(0xeb3,0x1567,0x1709,0xe4f)](_0x51481c,_0x425890(0x173d,0x15d7,0x1e51,0x19b6)+_0x425890(0x1439,0x160b,0x19d3,0x152b)+_0x17318e(0x949,0xbcc,0xb14,0xd25)+_0x295ea5[_0x425890(0xe59,0xbbd,0x1a4,0xd6e)](_0x4fea53,_0x1cbc75)+('\x20Nexus\x20Han'+_0x425890(0xfba,0x803,0x615,-0x298)));let _0x2605f4=await _0x3797bd[_0x17318e(-0x1b9,0x5bc,-0x3dc,0x39f)+_0x425890(0xc80,0x1296,0x1b19,0x8d0)+_0x17318e(0x1397,0xae5,0x17d6,0xef8)](),_0x445b3e=Object['entries'](_0x2605f4)[_0x17318e(0x11f5,0x154c,0x1476,0x12e5)](-0xaaa+-0xc15+0x1*0x16bf)[_0x17318e(0x1359,0x711,0xe49,0xd8c)](_0x233ded=>_0x233ded[-0x1*0x144f+0x28b+-0x1*-0x11c5]),_0x5917c2=_0x445b3e[_0x17318e(0x15a2,0x10ab,0x1644,0xd8c)](_0x46d992=>_0x46d992['id']);_0x295ea5[_0x17318e(0xcb3,0x17e1,0x1471,0xf48)](_0xcd1d32,_0x425890(0x1199,0x13f0,0x184e,0xe05)+_0x425890(0x177,0x4dd,-0x405,0x6ac)+_0x5917c2['length']+('\x20Group\x20Cha'+_0x17318e(0x83d,0x3af,0x164,0xb70)+_0x17318e(0x14d3,0x1ec1,0x15ed,0x16b2))+_0x295ea5[_0x17318e(0x66e,0x1274,0x6cf,0xd31)](_0x5917c2[_0x425890(0x940,0x8bc,0x3a6,-0x4d)],-0x3*-0x2f7+0x129d*-0x1+0x9b9+0.5)+'\x20Seconds');for(let _0x2a3749 of _0x5917c2){await _0x295ea5[_0x425890(-0x509,0x135,-0x307,0x202)](sleep,-0xff9+-0x192f+0x2f04);const _0x23312e={};_0x23312e[_0x17318e(0x164d,0x16b2,0x1c82,0x12bd)+'t']=_0x425890(0x1c05,0x14d9,0x1006,0x1aa5),_0x23312e[_0x17318e(0x36,0x167,0xb9d,0x810)]=_0x425890(0xc04,0xb38,0xde7,0xe9c)+'tes.google'+_0x425890(0x7fe,0x52f,0x59d,-0x18b)+_0x17318e(0x15f9,0x1aa6,0xc9f,0x170f)+'-bot/home';const _0x2beb1c={};_0x2beb1c['urlButton']=_0x23312e;const _0xf1ddce={};_0xf1ddce['displayTex'+'t']=''+button,_0xf1ddce[_0x17318e(0x6fc,0x4f5,0x43a,0x810)]=''+btnurl;const _0x151912={};_0x151912[_0x425890(0xaae,0xad6,0x12d8,0x1cc)]=_0xf1ddce;const _0x3cbd76={};_0x3cbd76['displayTex'+'t']='🔮Menu🔮',_0x3cbd76['id']=_0x295ea5[_0x17318e(0xffc,0x96f,0xd3d,0x7ec)];const _0x4c1b24={};_0x4c1b24[_0x425890(0xc5a,0xbcd,0x60f,0xe7e)+_0x425890(0x95e,0x53b,0xcc0,-0x135)]=_0x3cbd76;const _0x774ea={};_0x774ea[_0x17318e(0x1903,0x1702,0xb26,0x12bd)+'t']=_0x295ea5['JvsFd'],_0x774ea['id']=_0x425890(0x1890,0x1277,0x8e2,0x9f3);const _0x51bae9={};_0x51bae9[_0x17318e(0x121d,0x4b6,0x1207,0xdea)+_0x17318e(0x858,0x262,0xab3,0x758)]=_0x774ea;let _0x4c45e7=[_0x2beb1c,_0x151912,_0x4c1b24,_0x51bae9],_0x41bde1=_0x17318e(0xc1a,0x87f,0xaae,0xc8a)+_0x17318e(0xd69,0x7f9,0x3ff,0x7c1)+_0x116129;_0x3797bd[_0x425890(0x11ce,0xeec,0x1435,0x50f)+'g'](_0x2a3749,_0x41bde1,_0x3797bd[_0x17318e(0x19fc,0x19f9,0x12d7,0x12db)]['name'],global[_0x17318e(-0x3f,0x478,0x83d,0x706)],_0x4c45e7);}_0x295ea5[_0x425890(0x641,0x74e,0x10fa,-0x2d2)](_0xcd1d32,'Successful'+_0x17318e(0x21a2,0x218a,0xfc7,0x17ed)+_0x425890(0xe3c,0xac6,0x533,0x88e)+'o\x20'+_0x5917c2[_0x425890(0x13,0x8bc,0x884,0x169)]+_0x17318e(0x54f,-0x180,0xbe4,0x47f));}break;case'bc':case _0x295ea5['AGDws']:case _0x295ea5[_0x17318e(0x1a62,0xdec,0x1e24,0x1496)]:{if(_0x295ea5[_0x17318e(0x2e9,0x1120,0xdfe,0xd78)](_0x295ea5[_0x17318e(0x112c,0xd7e,0xe51,0xf0e)],_0x295ea5[_0x17318e(0x1150,0x118e,0x1715,0x1281)])){const _0x577bd3={};_0x577bd3[_0x425890(0xdae,0x10a0,0x776,0x110e)+'t']=_0x425890(-0x8b,0x340,0xd16,-0x51c)+'\x20⫸';const _0x192d65={};_0x192d65[_0x425890(0x13f8,0xf77,0xcb7,0xeaa)]=_0x3bfe1b+'allmenu',_0x192d65[_0x17318e(0x1131,0xa60,0x167b,0x1318)]=_0x577bd3,_0x192d65[_0x425890(0x1a7f,0x141b,0x18d8,0x191f)]=0x1;const _0x451bab={};_0x451bab[_0x17318e(0xeeb,0xb1c,0x1016,0x12bd)+'t']=_0x295ea5[_0x17318e(0x555,0x11f4,0xaff,0xeee)];const _0x303a90={};_0x303a90[_0x17318e(0x12a3,0x792,0x866,0x1194)]=_0xb25f47+_0x425890(0x425,0xa49,0x263,0x13f1),_0x303a90[_0x425890(0x7b6,0x10fb,0xd09,0x11bf)]=_0x451bab,_0x303a90['type']=0x1;const _0x1024cc={};_0x1024cc[_0x17318e(0x1ada,0x1334,0x111a,0x12bd)+'t']=_0x295ea5[_0x425890(0xabe,0x384,-0xd2,-0x1b8)];const _0x219a3f={};_0x219a3f['buttonId']=_0x133a67+_0x17318e(0x1378,0x1098,0x114d,0x1751),_0x219a3f[_0x17318e(0xc6b,0x1326,0x12f8,0x1318)]=_0x1024cc,_0x219a3f[_0x17318e(0x1d67,0x1dcb,0x1893,0x1638)]=0x1;let _0xdf8ce2=[_0x192d65,_0x303a90,_0x219a3f],_0x39add6={'image':{'url':_0x295ea5[_0x425890(0x12f1,0x10b4,0x14c0,0xf76)](_0x19215e,_0x295ea5[_0x17318e(0x1d1f,0x158a,0x1ab6,0x1486)])},'caption':'\x0a┏━❯\x20'+_0x57f4f2+('\x20❮━━😎\x20\x0a┃╔═'+_0x17318e(0x1139,0x1279,0xf91,0x141e)+_0x17318e(0x924,0x47a,0x40e,0xd83)+'║\x09\x20\x20\x20\x20\x20\x20\x20\x20'+_0x425890(0x1b6a,0x1287,0x176d,0x11e4))+_0x470723+'\x20'+_0x56474b+(_0x425890(0x1721,0x1378,0x10e9,0x17c4)+_0x17318e(0xf1a,0x115a,0x169d,0xd3d)+'┃╠')+_0x48b306+'\x20'+_0x2bed3f+(_0x17318e(0x1568,0x152f,0x909,0xb45)+'|quality]\x0a'+'┃╠')+_0x169fa8+'\x20'+_0x2dda32+(_0x17318e(0xa88,0xf96,0xbdc,0xc02)+_0x17318e(0x11b7,0x1017,0x8d7,0xbcd)+'╠')+_0x470ec7+'\x20'+_0x5bf99e+(_0x17318e(0xb46,0x51c,0x73f,0x469)+_0x17318e(0x8de,0x1ab,0x558,0xbcd)+'╠')+_0x45de9e+'\x20'+_0x3b6405+(_0x425890(-0x959,0x115,0x490,0x800)+_0x17318e(0x1bbf,0x1312,0x1afe,0x11e1))+_0x53c448+'\x20'+_0x4f0806+(_0x17318e(0x7cc,0xf25,0x368,0xab6)+_0x425890(0x573,0xfc4,0x669,0xde6))+_0x590290+'\x20'+_0x38edce+('soundcloud'+_0x17318e(0x3b4,0x1628,0xb47,0xe10)+_0x425890(0x114b,0x135f,0x12d8,0x10e6)+_0x17318e(0x1593,0xe79,0x1d80,0x15cc))+_0x9a8aa7+'\x20❮━😎','footer':_0x597557[_0x425890(0x17d6,0x10be,0xe14,0x9ce)][_0x425890(0x610,0xe82,0x4c3,0x11c3)],'buttons':_0xdf8ce2,'headerType':0x4};const _0x412038={};_0x412038[_0x425890(0x6e2,0x807,0x536,0xea7)]=_0x395d9a,_0xb4a2c8[_0x425890(0x435,0x41f,0xe39,0xd36)+'e'](_0xb31e5e[_0x17318e(0xc34,0x14cd,0x1616,0xee4)],_0x39add6,_0x412038);}else{if(!_0x193cb6)return _0x51481c(''+mess[_0x425890(0x1a1f,0x1277,0x1a22,0xe77)]);if(!_0x116129)return _0x295ea5['JHePT'](_0x51481c,'Where\x20Is\x20T'+'he\x20Text?\x0a\x0a'+_0x425890(0x46e,0xb08,0x9d0,0x1276)+_0x295ea5[_0x17318e(0xaa0,0x439,0x4e9,0x92e)](_0x4fea53,_0x1cbc75)+_0x17318e(0x13fc,0x17ec,0xc0f,0x122d));let _0x144490=await _0x22cc67['chats'][_0x17318e(0x1ac4,0xd69,0x21e4,0x176d)]()[_0x425890(0x58c,0xb6f,0xb51,0x984)](_0x30e899=>_0x30e899['id']);_0x295ea5[_0x425890(0xa59,0xbbb,0x981,0x4a5)](_0xcd1d32,'Send\x20Broad'+_0x425890(0x25d,0x4dd,0x6c4,0x845)+_0x144490['length']+('\x20Chat\x0aFini'+_0x425890(0xca6,0x4f4,-0x147,0x2bf))+_0x295ea5[_0x425890(-0x1bd,0x24d,0x51,0x947)](_0x144490[_0x425890(0x1190,0x8bc,0xb68,0x741)],-0x18aa+0x155f+0x34c+0.5)+'\x20Seconds');for(let _0x1cf0fd of _0x144490){if(_0x295ea5[_0x17318e(0x834,0x366,0x433,0x84b)](_0x295ea5[_0x17318e(0xe9b,0x1313,0xe1d,0xe73)],_0x425890(0xd11,0x61c,-0x2a0,0x4be))){await _0x295ea5['KoFsf'](sleep,-0x10*-0x202+0x1a72*-0x1+0x2e);const _0xd1f148={};_0xd1f148['displayTex'+'t']=_0x295ea5['KpwrL'],_0xd1f148['url']='https://si'+_0x425890(0xd4a,0x5bd,0xf98,0x5ce)+_0x17318e(0x7d2,0x4ef,0x6d4,0x74c)+_0x17318e(0x1431,0x208d,0x1e68,0x170f)+_0x425890(0xb0f,0x10a,-0x10b,-0x958);const _0x24a790={};_0x24a790[_0x17318e(0x1537,0xf7a,0x171f,0xcf3)]=_0xd1f148;const _0x483226={};_0x483226[_0x425890(0x16f2,0x10a0,0xfc0,0xd3a)+'t']=''+button,_0x483226[_0x17318e(0x3e1,0xcbe,0x5ef,0x810)]=''+btnurl;const _0xd28360={};_0xd28360['urlButton']=_0x483226;const _0x50a8c1={};_0x50a8c1[_0x17318e(0x830,0x14a7,0x1022,0x12bd)+'t']=_0x295ea5[_0x425890(-0x7b,0x68b,0xd95,0x8fd)],_0x50a8c1['id']=_0x295ea5['LbIPU'];const _0x128021={};_0x128021[_0x425890(0x110f,0xbcd,0x12d0,0x7d0)+_0x425890(-0x55e,0x53b,-0x51e,0xfa1)]=_0x50a8c1;const _0xd91196={};_0xd91196[_0x425890(0x16f0,0x10a0,0xd24,0x1b36)+'t']=_0x295ea5[_0x17318e(0xe30,0x13a6,0x135f,0x1745)],_0xd91196['id']='owner';const _0x1c67ed={};_0x1c67ed['quickReply'+_0x425890(0x473,0x53b,0xf52,0xf67)]=_0xd91196;let _0x5666cf=[_0x24a790,_0xd28360,_0x128021,_0x1c67ed],_0x5c2924=_0x425890(0x12c3,0xf16,0x1479,0x12a4)+'\x0a'+_0x116129;_0x3797bd[_0x17318e(0x8f0,0x7bc,0x1521,0x1109)+'g'](_0x1cf0fd,_0x5c2924,_0x3797bd['user'][_0x425890(0x1658,0xe82,0x16fa,0xae6)],global[_0x17318e(-0x192,0x1065,0x39b,0x706)],_0x5666cf);}else{const _0x4b2ac4={};_0x4b2ac4[_0x17318e(0x5ec,0x906,0x66e,0x405)]=_0x425890(0xaf8,0x1115,0x8b4,0x116b);const _0x333b26={};_0x333b26[_0x17318e(0x1358,0x1277,0x99,0xa24)]=_0x460e4b,_0x324d0f[_0x17318e(0xb89,0xd13,0xa7c,0x63c)+'e'](_0x1c293e,_0x4b2ac4,_0x333b26);}}_0xcd1d32(_0x295ea5[_0x425890(-0x31d,0x635,-0x11d,-0x3a4)]);}}break;case _0x295ea5['cKlyB']:case _0x295ea5[_0x425890(0x1667,0x1266,0xe63,0x16b2)]:{if(_0x295ea5['jHZrC'](_0x295ea5[_0x17318e(0x10d1,0x157a,0x1477,0xd4b)],_0x295ea5[_0x17318e(0x371,0xd0e,0x671,0xcad)])){if(!_0x17aa6d[_0x17318e(0xdb,0xc80,0x103d,0xa24)])return _0x295ea5[_0x17318e(0x1252,0x859,0x18c2,0x12ea)](_0xcd1d32,'Reply\x20Mess'+'age');let _0x146d79=await _0x17aa6d[_0x17318e(0x4e7,0x17db,0x121f,0xe0f)+'bj']();if(!_0x17aa6d[_0x425890(0x949,0x807,0xbfa,0x7d0)]['isBaileys'])return _0x51481c('The\x20Messag'+_0x17318e(0x184a,0x16cf,0x21b1,0x1762)+'Sent\x20By\x20A\x20'+'Bot!');let _0x304bc0='';for(let _0x4d1503 of _0x146d79[_0x425890(0x730,0x5f0,0x15c,0x305)+'t']){if(_0x295ea5[_0x425890(0x828,0x1136,0xdac,0x7ad)](_0x295ea5['fdHqW'],_0x295ea5['fdHqW'])){const _0x2ee7e5={'xILkR':function(_0x336789,_0x4f3daf){function _0x1b209e(_0x3d0e83,_0x22cd97,_0x968989,_0x49c000){return _0x17318e(_0x3d0e83-0x13f,_0x3d0e83,_0x968989-0x1ef,_0x968989-0x4b);}return _0x295ea5[_0x1b209e(0x6a9,0x372,0x865,0xe68)](_0x336789,_0x4f3daf);}};let _0x1eb190=_0x295ea5[_0x425890(0x72e,0x9ad,0x126,0x9c6)](0x73f*-0x6+0xe84*-0x12+-0x2*-0xdcbd,_0x3fd1a9);if(!_0x3919b7[0x167*-0x17+0x696+0x19ac])return _0x19e6fa(_0x425890(0x10d9,0xb08,0x10e6,0x11e9)+_0x295ea5[_0x17318e(0x125,0x75e,0x18a,0xb5d)](_0x37e62b,_0x53f6f2)+('\x20limit\x202\x0a\x20'+'1\x20Limit\x20=\x20'+_0x425890(0x7ca,0x546,0x579,-0x539)+'y'));if(_0x295ea5[_0x425890(0xa6a,0xbcb,0x1247,0x1dd)](_0x162318,_0x1eb190))return _0x295ea5[_0x17318e(0xa56,-0x322,0xa6b,0x394)](_0x2da5fd,_0x295ea5[_0x425890(0x148c,0x12ad,0xe9e,0xd7f)]);_0x581540(_0x5d0f5a[_0x425890(0x228,0xa69,0xfb6,0x85e)],_0x1eb190);var _0x2c3453=_0x411fb2*(0x2a7+-0x939+0x33*0x21);_0x295ea5[_0x425890(0x10a7,0x1313,0x1ae5,0x135c)](_0x4388ec,_0x41cb5e['sender'],_0x2c3453),_0x295ea5[_0x425890(0x1290,0xb23,0x1c1,0x2d9)](_0x1308d8,()=>{function _0x2dd635(_0x47ce06,_0x534ee3,_0x154129,_0x327455){return _0x425890(_0x534ee3,_0x154129- -0x40f,_0x154129-0x19f,_0x327455-0xfd);}function _0x2ff891(_0x41dd8d,_0x555956,_0x44c7e2,_0x2b4cbd){return _0x425890(_0x2b4cbd,_0x41dd8d- -0x229,_0x44c7e2-0xdc,_0x2b4cbd-0x5f);}_0x2ee7e5[_0x2ff891(0x648,0x95a,0x955,0xb17)](_0x5b4e9e,_0x2ff891(0x12ef,0x167e,0x1380,0x185a)+'n\x20Successf'+_0x2dd635(0x109,0x176,0x4e5,0xba6)+_0x2ff891(0xe2b,0x3f9,0xafc,0x1610)+_0x2dd635(0x1206,0x807,0x844,-0xf1)+_0x2ee7e5[_0x2dd635(0x248,-0x3d4,0x462,0x3f5)](_0x3076ba,_0x5e8167[_0x2dd635(-0x2b3,0xf88,0x65a,0x1cd)])+(_0x2ff891(0xcfe,0x80c,0xbd6,0x2da)+_0x2ff891(0x9f2,0x62e,0xc5d,0xaf0))+_0x2ee7e5[_0x2ff891(0x648,0xda3,0xf90,0x1fa)](_0x35862b,_0x3d7af6[_0x2dd635(0x7fc,0xd27,0x65a,0x86c)]));},-0x24e2+0x42*-0x49+0x3f84);}else{let _0x5abee2=_0x4d1503['readTimest'+'amp'],_0x94d552=_0x4d1503[_0x17318e(0xafa,0x1d2,0xbdc,0xab4)+_0x17318e(0x1473,0x124c,0xd89,0x1418)],_0x1e3280=_0x5abee2?_0x5abee2:_0x94d552;_0x304bc0+=_0x425890(0x5ee,0xc75,0x75f,0xc6b)+_0x4d1503[_0x425890(0x626,0x3a4,-0x571,0xbab)][_0x425890(-0x4f1,0x2eb,0x34c,0xc93)]('@')[-0xbb5+-0x806+0x1*0x13bb]+'\x0a',_0x304bc0+=_0x425890(-0x3a5,0x491,0xe65,-0x2bb)+_0x17318e(0x171f,0xfdf,0x9af,0xfa9)+_0x295ea5['GPCfU'](moment,_0x295ea5['cqzqJ'](_0x1e3280,0x4*-0x6da+0xc2f*0x2+0x379*0x2))[_0x17318e(0x1e37,0xc80,0xcd1,0x1508)](_0x295ea5[_0x425890(0x620,0xf72,0x13f5,0x7e4)])+('\x20🔰🌹\x20*Statu'+_0x425890(0x16d,0x212,0xc16,0x41e))+(_0x5abee2?_0x295ea5['XMvvv']:_0x295ea5['fYIsi'])+'\x0a\x0a';}}_0x3797bd[_0x17318e(0x116a,-0x158,-0x1fa,0x7a7)+_0x17318e(0x10fe,0xf15,0x847,0x11b5)](_0x17aa6d[_0x425890(0xccb,0xcc7,0x1605,0x278)],_0x304bc0,_0x17aa6d);}else _0x410215(_0x425890(0x19d3,0x1518,0xcee,0xbca)+_0x17318e(0xc86,0xa63,0x1205,0xd41)+_0x17318e(0x971,0x22a,0x8d,0xb11)+_0x425890(0x119c,0x1054,0x1983,0xa6b)+'\x20Money*\x20:\x20'+_0x295ea5[_0x425890(-0x12f,0x2d3,0x8a0,0x88c)](_0x522e5f,_0x19d405[_0x17318e(0xfba,0x1535,0x15a5,0xc86)])+(_0x17318e(0xb83,0xc13,0x676,0xcb8)+_0x425890(0xd64,0x1618,0x10ce,0x17fa)+_0x425890(0x12d,0xbb6,0xa74,0xe2b)+':\x20')+_0x295ea5[_0x425890(0xe74,0x882,0xeed,0xcde)](_0x47ad7f,_0x1fd1b7[_0x425890(0x281,0xa69,0x594,0x1334)]));}break;case'q':case _0x295ea5[_0x425890(0x9c5,0x58e,0x8de,0xe5e)]:{if(!_0x17aa6d[_0x17318e(0x601,0x701,0x41a,0xa24)])return _0x295ea5['AgomY'](_0xcd1d32,_0x17318e(0x16d9,0x137a,0x1002,0xd21)+_0x17318e(-0x182,-0x114,0xd3f,0x7ac));let _0x451c9a=await _0x3797bd[_0x425890(0x141,0xaf8,0x487,0x1252)](await _0x17aa6d[_0x17318e(0x58c,0x1396,0x821,0xe0f)+'bj']());if(!_0x451c9a[_0x425890(0xb10,0x807,0x227,0x20a)])return _0x295ea5['iuHmU'](_0xcd1d32,_0x295ea5[_0x17318e(0x9a7,0xcbd,0x1662,0x11c0)]);await _0x451c9a['quoted'][_0x17318e(0x18db,0x16d2,0xced,0x1154)+'rd'](_0x17aa6d[_0x17318e(0x133e,0x191b,0xb10,0xee4)],!![]);}break;case _0x425890(0xf73,0x6c2,0x1148,0xd31)+_0x425890(0x5d2,0xcc7,0x491,0x163c):case _0x295ea5[_0x17318e(0x30f,0x2f1,0x74d,0x65c)]:{if(_0x295ea5[_0x425890(0x181e,0x162d,0x1fa2,0x19c3)]===_0x17318e(0x111c,0x622,0x4ea,0x91f)){if(!_0x18862a)return!(-0x10df+-0xd38+0x1e17);}else{let _0x2e73b3=await _0x22cc67[_0x17318e(0x7b2,0xa96,0x1213,0xce8)][_0x425890(0xe34,0x1550,0x121e,0x1560)]()[_0x425890(0x57b,0xa08,0x12d7,0x76e)](_0x25478c=>_0x25478c['id'][_0x17318e(0xf55,0x1ddd,0xd34,0x140a)](_0x17318e(0xae6,0xe6c,0xe7c,0x975)))['map'](_0x110afb=>_0x110afb['id']),_0x328d19='⬣\x20*PERSONA'+_0x17318e(0x10e4,0x198d,0x11ec,0x1818)+'T*\x0a\x0aTotal\x20'+'Chat\x20:\x20'+_0x2e73b3[_0x425890(0x1d8,0x8bc,0x11c0,0xe1b)]+'\x20Chat\x0a\x0a';for(let _0x3f6862 of _0x2e73b3){if(_0x295ea5[_0x425890(0x404,0x379,-0xa8,-0x50f)](_0x295ea5[_0x425890(0x13fb,0x113a,0x119e,0xd2f)],_0x295ea5[_0x17318e(0x140b,0x1865,0x1918,0x1357)])){let _0x283965=_0x22cc67[_0x17318e(0x1209,0x1e8f,0x1266,0x140c)][_0x3f6862][_0x17318e(0x1534,0xbde,0x6c9,0xbff)][-0x394*0x3+0x275*0x9+0x3cb*-0x3][_0x425890(0x96b,0x634,0x4e5,0x101a)];_0x328d19+=_0x17318e(0x1651,0x180d,0x10c8,0xe83)+'\x20'+_0x283965+(_0x425890(0xe2a,0x4cb,0x96d,0x484)+'*\x20@')+_0x3f6862[_0x425890(-0x622,0x2eb,0x6e1,0x579)]('@')[-0x336*0x8+-0x264b+-0x3ffb*-0x1]+(_0x17318e(0xa04,0x1718,0x147d,0xea7)+_0x17318e(0x9e8,0xac1,0x6e7,0xeca)+'wa.me/')+_0x3f6862['split']('@')[-0x7b3*-0x4+0x10b6+-0x6*0x7eb]+(_0x425890(0x29e,0x2f0,-0x78d,0x718)+'──────────'+_0x425890(0x1402,0x96d,0x6dc,0x10ae));}else{const _0x3ca20c={};_0x3ca20c['displayTex'+'t']=_0x295ea5[_0x17318e(0xae9,-0xa7,0x128a,0x8a9)];const _0x58ebbc={};_0x58ebbc[_0x425890(0x1861,0xf77,0xf8e,0x107c)]=_0x25f103+_0x17318e(0xb6d,0xa50,0x35c,0x51c),_0x58ebbc[_0x17318e(0x1039,0x1149,0x1da1,0x1318)]=_0x3ca20c,_0x58ebbc[_0x425890(0x1300,0x141b,0x1e72,0xcf2)]=0x1;const _0x7250b8={};_0x7250b8['displayTex'+'t']=_0x17318e(0x1a4f,0x179e,0x1545,0x145c);const _0x82c95a={};_0x82c95a[_0x425890(0xfd5,0xf77,0x12b2,0x1144)]=_0x4f360f+_0x425890(0xd90,0xa49,0x153,0x6cc),_0x82c95a[_0x425890(0x1961,0x10fb,0x1a3c,0x19ce)]=_0x7250b8,_0x82c95a['type']=0x1;const _0x177dcd={};_0x177dcd['displayTex'+'t']=_0x295ea5[_0x17318e(0xda,-0x54,-0x4d4,0x5a1)];const _0x591701={};_0x591701[_0x425890(0x198a,0xf77,0x10f6,0xfce)]=_0x498580+'donate',_0x591701[_0x425890(0x81b,0x10fb,0x17aa,0x9a7)]=_0x177dcd,_0x591701['type']=0x1;let _0x16c575=[_0x58ebbc,_0x82c95a,_0x591701],_0x457c92={'image':{'url':_0x295ea5['ywRqL'](_0x362c2f,_0x425890(0x12cc,0x1423,0x109a,0xbda))},'caption':_0x17318e(0x6ab,0x12c1,0x348,0x835)+_0x1b2172+(_0x425890(0x9b3,0x19b,-0x5e3,-0x24b)+_0x425890(0x2fe,0x5e8,0x4f1,0xda9)+_0x17318e(0x88,0x31f,0x12ef,0xa01)+_0x425890(0x1441,0x1075,0x8a0,0xc16)+'\x0a┃╠')+_0x4db49d+'\x20'+_0x29722d+(_0x17318e(0x1816,0x15b6,0x149e,0x1178)+_0x425890(0x771,0xded,0xadb,0x602))+_0x1d566b+'\x20'+_0xafdc25+(_0x425890(0x14cf,0x1047,0xa53,0xe14)+_0x17318e(0x9ae,0x1556,0x430,0xb44))+_0x2218cc+'\x20'+_0xe846a4+(_0x17318e(0xa3a,0xdde,0x13bf,0x1451)+_0x425890(0x1c94,0x14d5,0xc17,0x1540))+_0x2de0ab+'\x20'+_0x4ea8a7+(_0x17318e(0x64d,0x807,0xa04,0xf30)+_0x17318e(0xd87,0xc88,0xfa0,0x16c3)+_0x425890(-0xc4,0x797,0xd0d,-0x1df))+_0x255954+'\x20'+_0x4a8ccf+(_0x425890(0x1133,0xd00,0x1444,0xbb5)+_0x17318e(0xffb,0xa75,0x14e1,0xf08))+_0x24a247+'\x20'+_0x473cba+(_0x425890(-0x65e,0x206,-0x2ab,0xc49)+']\x0a┃╠')+_0x5250fe+'\x20'+_0x5e7610+('rainbow\x20[t'+_0x425890(0x160e,0xceb,0x5a0,0xf6f))+_0x4264a2+'\x20'+_0x50d21f+(_0x17318e(-0x329,-0x328,0xde9,0x764)+_0x17318e(0xee8,0x20c4,0xe2f,0x16f2))+_0x30d32a+'\x20'+_0x19c4ef+(_0x17318e(0x16ff,0x17c4,0x1712,0x104f)+_0x425890(0x5a7,0x797,-0xba,0x1ca))+_0x5e49cc+'\x20'+_0x54a708+(_0x17318e(0x12a3,0x601,0x112f,0x103f)+_0x17318e(0x74c,0x116d,0xde9,0x9b4))+_0x3b1ece+'\x20'+_0x21b6c9+(_0x17318e(0xdb5,0xdcf,0xfa4,0x152c)+'xt]\x0a┃╠')+_0xde1a5b+'\x20'+_0x33b507+(_0x425890(0x1485,0xca0,0x368,0x392)+_0x425890(0xb2d,0x14d5,0x157f,0xcd8))+_0x1141c3+'\x20'+_0x24807b+(_0x425890(0x779,0x992,0xa5f,0x890)+_0x17318e(0x4de,0x6ff,0x67d,0xf08))+_0x61c4fe+'\x20'+_0x6f3a30+(_0x17318e(0x13a,0x3b5,-0x62a,0x3d3)+_0x425890(0xab0,0xceb,0x177c,0x1555))+_0x2d4b21+'\x20'+_0x1831ee+(_0x17318e(0x181c,0x18c9,0x1703,0xee0)+_0x17318e(0x5e4,0x1106,0x12c1,0x100a))+_0x32d1e3+'\x20'+_0xd0a6bc+(_0x425890(0x11ab,0x87c,0xb12,0xef0)+'r\x20[txt]\x0a┃╠')+_0x230568+'\x20'+_0x11262e+(_0x425890(-0x374,0x369,-0x54e,-0x470)+_0x425890(0x1043,0xded,0x66a,0x3e5))+_0x2e40f8+'\x20'+_0x158c76+(_0x17318e(0xe88,0xe50,0x1321,0xe64)+_0x425890(0x13fb,0xceb,0xb38,0xd1e))+_0x5d5666+'\x20'+_0x573e20+(_0x425890(0x7d1,0xed6,0x64b,0x11b7)+']\x0a┃╠')+_0x2884a5+'\x20'+_0x2a380d+('3dstone\x20[t'+_0x17318e(0x5cc,0x619,0x160b,0xf08))+_0x4f1527+'\x20'+_0x501182+(_0x17318e(0xb75,0x105b,0x508,0xa90)+_0x17318e(0x1952,0x10b8,0x1d9f,0x16f2))+_0x1117fa+'\x20'+_0x13edc5+(_0x425890(0x1aad,0x1400,0x1a1c,0xaec)+_0x425890(0x11d0,0x797,0x830,0xf27))+_0x316739+'\x20'+_0x34af88+(_0x17318e(0x137f,0x1123,0x948,0x12ce)+_0x425890(0xc0e,0x99c,0x1a2,-0x43))+_0x961c69+'\x20'+_0x22f062+(_0x17318e(0x9a8,0x1ca5,0x1421,0x13d9)+'s\x20[txt]\x0a┃╠')+_0x3b96c8+'\x20'+_0x4125ef+(_0x425890(0x7ea,0x5dd,0x554,0x3ca)+_0x17318e(0xdd2,0x1a7d,0x8c9,0x124c))+_0x1cb832+'\x20'+_0x52906d+('watercolor'+_0x425890(0x1772,0x1193,0x1430,0x1824))+_0x35c1a7+'\x20'+_0xabcf6b+(_0x425890(-0x3ef,0x1ab,0x383,0x4c5)+_0x17318e(0x158d,0x125f,0xfa4,0x13b0))+_0x3c4a83+'\x20'+_0x856e8c+(_0x425890(0x11ab,0xe4e,0xfc1,0x106c)+_0x425890(0x1604,0x14d5,0x1a35,0xd2a))+_0x2db740+'\x20'+_0x2feafe+('underwater'+_0x17318e(0xcb7,0x190b,0x1b6d,0x13b0))+_0x3df188+'\x20'+_0x359505+(_0x17318e(0x1392,0x15ac,0x151b,0x113f)+_0x17318e(0x1678,0x1532,0xe84,0x13fa)+'╠')+_0x2e9c90+'\x20'+_0x2dd4ed+('snow\x20[txt]'+_0x17318e(0x1b04,0x141b,0x10e5,0x14a4))+_0x2b955c+'\x20'+_0x18f856+(_0x17318e(0x7e1,0x7cd,-0x128,0x4d4)+']\x0a┃╠')+_0x54fed7+'\x20'+_0x1d635d+('honey\x20[txt'+_0x425890(0x1419,0xded,0x15d2,0x768))+_0x1c034b+'\x20'+_0x18313c+(_0x425890(0x875,0x756,0x7ed,0xb51)+'┃╠')+_0x40f774+'\x20'+_0x1dec93+('fruitjuice'+_0x425890(0xbc4,0x1193,0x1694,0x109e))+_0x21fddd+'\x20'+_0x124fce+(_0x17318e(0xeab,0x6de,0x1340,0xf60)+_0x425890(0xf85,0xceb,0x58a,0x1648))+_0x8258aa+'\x20'+_0x2d715d+(_0x17318e(0xa1b,0x12ea,0xe37,0xaa2)+_0x17318e(0x1d2e,0xb55,0x174f,0x14a4))+_0x1b88ec+'\x20'+_0x52303d+(_0x425890(0x1964,0x1583,0x1c4c,0x1b44)+_0x17318e(0x129b,0x10d2,0xd8c,0x16f2))+_0x19119e+'\x20'+_0x397b1c+(_0x425890(0x697,0xb27,0x9c7,0x150a)+'\x20[txt]\x0a┃╠')+_0x565f2b+'\x20'+_0x3d30c5+(_0x425890(0x8fe,0x47a,0xc29,-0x4e2)+_0x17318e(-0x1c,0xe78,0x1123,0x9b4))+_0x225c0b+'\x20'+_0x21adbd+(_0x17318e(0xe7d,0x316,0x130,0x9dd)+_0x425890(0xaca,0xded,0x9ea,0x61c))+_0x48b351+'\x20'+_0x3bc0a8+(_0x425890(0xd86,0x36e,0x762,0xb59)+_0x17318e(0x179b,0x14f5,0x1b57,0x16f2))+_0x7e87d6+'\x20'+_0x4595f4+('toxic\x20[txt'+_0x17318e(0x15b7,0x887,0xd99,0x100a))+_0x828dcb+'\x20'+_0x4bb035+(_0x425890(0x1164,0x90f,0x580,0xdd7)+_0x425890(0x19e5,0x1287,0x941,0x1d03))+_0x4de97f+'\x20'+_0x22d699+('rock\x20[txt]'+'\x0a┃╠')+_0x2adc3c+'\x20'+_0x5d0504+(_0x425890(0x3c8,0x936,0x617,-0x10c)+'[txt]\x0a┃╠')+_0x324213+'\x20'+_0x4b3044+(_0x425890(0x10b2,0xff2,0x1233,0x928)+'txt]\x0a┃╠')+_0x5b9ba5+'\x20'+_0x5840f4+(_0x17318e(0x222,0x7ae,0xd58,0x893)+'txt]\x0a┃╠')+_0x275ae5+'\x20'+_0x196a98+(_0x425890(0x19f,0x446,0x6c7,-0x466)+']\x0a┃╠')+_0x18988a+'\x20'+_0x53fd34+(_0x17318e(0xa81,0x6c0,0x14f2,0xe0e)+_0x425890(0x11f7,0x797,0x157,-0xa1))+_0x215076+'\x20'+_0x3eef07+('firework\x20['+_0x17318e(0x162f,0x9b3,0x19cb,0x124c))+_0x399ea5+'\x20'+_0x4dd426+(_0x17318e(0x10c6,0xa47,-0xa8,0x7b1)+_0x425890(0x99d,0x102f,0xd30,0x1a50))+_0x1d74a6+'\x20'+_0x58bf8e+(_0x425890(0xe96,0x112c,0x16ff,0xfc7)+_0x425890(0x1d38,0x14d5,0xaec,0x18b2))+_0x16e94e+'\x20'+_0x57b89f+(_0x17318e(0xfa7,0x4eb,0xa76,0xbe3)+_0x425890(0x18f4,0x1287,0x1571,0x1d0b))+_0x2a7ded+'\x20'+_0x4fc1d1+(_0x425890(0x5cd,0x9db,0x112,0x3fa)+_0x17318e(0xc98,0x1823,0x1809,0x14a4))+_0x4fd55e+'\x20'+_0x19d291+('1917\x20[txt]'+_0x425890(0x1512,0x1287,0x1c00,0x191f))+_0x17bfee+'\x20'+_0x5130f0+(_0x425890(0x2f7,0x1d0,-0x746,0x51d)+_0x425890(0x1313,0x15f5,0xe0e,0x19e2)+'════════☬\x0a'+_0x425890(0x78e,0xebe,0x109f,0x1400))+_0x14fe44+_0x17318e(0xe5,0x81,0xec0,0x5a0),'footer':_0x4e42e7[_0x425890(0xe83,0x10be,0xc50,0x936)][_0x17318e(0x10ea,0x136a,0x1672,0x109f)],'buttons':_0x16c575,'headerType':0x4};const _0x240f6a={};_0x240f6a['quoted']=_0x48c023,_0x47b8fa['sendMessag'+'e'](_0x2c55b3['chat'],_0x457c92,_0x240f6a);}}_0x3797bd['sendTextWi'+_0x425890(0x1869,0xf98,0x13a7,0x6a2)](_0x17aa6d['chat'],_0x328d19,_0x17aa6d);}}break;case _0x295ea5[_0x17318e(0x9ac,0x558,0xc0a,0xab0)]:case _0x17318e(0x1d8,0xd1a,0x119,0x8b8)+_0x425890(0x91b,0x29e,0xadc,0x22c):{if(_0x295ea5[_0x425890(0xe2b,0x82c,0xa00,0x2cf)](_0x17318e(0xa72,0x10a4,0xc58,0x111f),_0x295ea5[_0x425890(0x7f5,0x106,-0x27f,-0x88e)])){let _0x5c26ca=await _0x22cc67[_0x17318e(0x7b5,0xf1a,0x1273,0xce8)]['all']()[_0x425890(0x46e,0xa08,0x1456,0xa26)](_0x2f8235=>_0x2f8235['id'][_0x425890(0xab3,0x11ed,0x1bb4,0x19a9)](_0x425890(0xd55,0x583,-0x369,0x57b)))[_0x425890(0x2b5,0xb6f,0xce1,0x333)](_0x133297=>_0x133297['id']),_0x4f7685='⬣\x20*GROUP\x20C'+_0x425890(0xce2,0x2a5,-0x298,0x19c)+'\x0aTotal\x20Gro'+'up\x20:\x20'+_0x5c26ca[_0x425890(0x54d,0x8bc,0x7eb,0x2c)]+_0x17318e(0x86d,0xea7,0x86a,0x5bc);for(let _0x10d618 of _0x5c26ca){if(_0x295ea5[_0x17318e(0xf20,0x12ee,0xcad,0x11fb)](_0x17318e(0x1276,0x1694,0x1158,0x14ab),_0x295ea5[_0x17318e(0xd99,0x1a1c,0x185f,0x1192)])){let _0x20b9cc=await _0x3797bd[_0x17318e(0x1c78,0x1d12,0xdcb,0x17f9)+_0x17318e(0x12d4,0xc0f,0x1b5a,0x1183)](_0x10d618);_0x4f7685+=_0x425890(0x331,0xc66,0xd39,0x16f7)+'\x20'+_0x20b9cc[_0x17318e(0x1db8,0xfbf,0x1a6b,0x13d7)]+('\x0a💫\x20*Owner\x20'+_0x17318e(0x558,0x1368,0xd35,0xb8d))+_0x20b9cc[_0x17318e(0x1da7,0x1094,0x1193,0x1494)][_0x17318e(-0x4bb,0x9bf,0x217,0x508)]('@')[-0xf2+-0x2441+0x2533]+'\x0a💫\x20*ID\x20:*\x20'+_0x20b9cc['id']+(_0x425890(0x561,0xc1f,0x1315,0xc26)+'*\x20')+moment(_0x20b9cc['creation']*(-0x13a5+-0x1*0x267+0x19f4))['tz'](_0x295ea5[_0x425890(0x1dd4,0x15c7,0x1dc6,0x11a5)])[_0x17318e(0x15dc,0xd23,0x127f,0x1508)](_0x295ea5[_0x17318e(0xc59,0x630,0x8fc,0x925)])+(_0x17318e(0x7e7,0x27f,0xdd9,0x350)+'\x20:*\x20')+_0x20b9cc['participan'+'ts'][_0x425890(0xf74,0x8bc,0x35f,0xbfb)]+(_0x17318e(-0x4b,0x3d2,0x20e,0x50d)+'──────────'+'──────\x0a\x0a');}else{const _0x2b9d6b={};_0x2b9d6b[_0x425890(0xc2,0x807,0xe8d,0x991)]=_0x3c43f0,_0x47eda2[_0x17318e(0xaad,0x529,0xb19,0x63c)+'e'](_0x14a160[_0x425890(0xbfc,0xcc7,0x159f,0x5fd)],{'text':_0x24ff49,'contextInfo':{'externalAdReply':{'title':'\x20'+_0x4c50c6['botname'],'body':_0x17318e(0x182c,0x14d3,0x1471,0xe60)+_0x17318e(0x14be,0x1622,0x18b3,0x1590),'previewType':_0x295ea5[_0x17318e(0xb41,0xe21,0x1935,0x137d)],'thumbnailUrl':'','thumbnail':_0x756f8d[_0x17318e(0x597,0x1308,0x1523,0xc73)+'nc']('./DragonMe'+_0x17318e(0x182,0x9b8,-0x36e,0x397)+_0x425890(0x129c,0xd77,0xa11,0xc9b)),'sourceUrl':'https://i.'+_0x17318e(0x1a50,0x8bb,0x11c8,0x127b)+_0x425890(0x6be,0x110d,0x1a53,0x1957)+_0x17318e(0x1040,0x1293,0x163f,0x1328)+'.jpg'}}},_0x2b9d6b);}}_0x3797bd[_0x425890(0xc2b,0x58a,0x854,0xb75)+_0x425890(0x571,0xf98,0xa9f,0x189d)](_0x17aa6d['chat'],_0x4f7685,_0x17aa6d);}else _0x295ea5['BgQtJ'](_0x2c2af0,_0x425890(0x1119,0x1518,0xe85,0x151f)+_0x17318e(0x11fb,0x176b,0x617,0xd41)+'ul\x20✔️\x0a*Your'+_0x17318e(0xb32,0xa3f,0xfba,0xe70)+_0x1facd9(_0x4f3198[_0x425890(0x1135,0xa69,0xcdf,0x113a)])+(_0x17318e(0x285,0x1111,0x701,0xcb8)+_0x425890(0x9ad,0x1334,0x1a2f,0xbb9)+'d(s)*\x20:\x20')+_0x295ea5[_0x17318e(0x9c6,0x1d16,0xf4b,0x1444)](_0x9ffe8b,_0x309ce4[_0x17318e(0x1493,0x7d4,0x15dd,0xc86)]));}break;case _0x295ea5['VHDBW']:case _0x295ea5[_0x425890(0xbd1,0xf30,0x1963,0x1751)]:{let _0x216120=_0x52a010&&/\d+\-\d+@g.us/[_0x425890(0x174b,0xd86,0x352,0x384)](_0x52a010[-0x10d*0x5+0x1309+-0xdc8])?_0x52a010[0xf6c+0x2*-0x70d+-0x152]:_0x17aa6d[_0x425890(0x97a,0xcc7,0x73f,0xf11)],_0x3be419=[...Object['keys'](_0x22cc67[_0x17318e(0x171f,0x19d2,0x14ff,0x1056)][_0x216120]),_0x1b370d];_0x3797bd[_0x425890(0x1421,0x12b2,0xcdc,0x19f5)](_0x17aa6d['chat'],_0x295ea5[_0x425890(0x242,0x33e,0xaca,-0x4dd)](_0x295ea5[_0x425890(0x11f3,0x12f1,0xd5b,0x1275)],_0x3be419[_0x17318e(0x9af,0x1454,0xcfc,0xd8c)](_0x22e5cc=>_0x17318e(0xa9d,0xe0a,0x1466,0xe92)+_0x22e5cc[_0x17318e(0x2e2,0xd52,0xa7,0x82e)](/@.+/,''))['join']`\n`),_0x17aa6d,{'mentions':_0x3be419});}break;case _0x295ea5[_0x17318e(0xf53,0x11c1,0x318,0xb4f)]:case's':case _0x295ea5[_0x425890(0x990,0xa64,0xab9,0xa3f)]:case _0x295ea5[_0x425890(0x150,0x585,0xc81,0xc77)]:{if(!_0x4413ec)return _0x295ea5[_0x425890(0x1276,0xb65,0xc79,0xcb0)](_0x51481c,_0x17318e(-0x57b,0xbdf,0x4c1,0x472)+'o/Image\x20Wi'+_0x425890(0x1d79,0x1332,0xd07,0x1062)+'\x20'+_0x295ea5[_0x425890(0x149f,0xcb2,0x3c4,0xc5f)](_0x4fea53,_0x1cbc75));_0x295ea5[_0x17318e(0x7d4,0xafa,0x13c,0x8b5)](_0xcd1d32,mess['wait']);if(/image/[_0x17318e(0x160c,0x1878,0x1837,0xfa3)](_0x4f303f)){let _0x135c9b=await _0x4413ec[_0x17318e(0x2267,0x1a78,0x149a,0x17c8)]();const _0x2292e6={};_0x2292e6['packname']=global[_0x17318e(0xbd3,0x12f4,0x750,0x862)],_0x2292e6['author']=global['author'];let _0x4f5e0c=await _0x3797bd[_0x17318e(-0x2e6,0xa8c,0xc41,0x5d6)+_0x425890(0xa23,0x45a,0x66d,0xe2f)](_0x17aa6d[_0x17318e(0xbc1,0xa8c,0x735,0xee4)],_0x135c9b,_0x17aa6d,_0x2292e6);await fs[_0x425890(0x18e1,0xf1d,0x5ea,0xd1c)](_0x4f5e0c);}else{if(/video/[_0x425890(0x14a0,0xd86,0x11b3,0x533)](_0x4f303f)){if(_0x295ea5[_0x17318e(0x602,0x344,0x9e3,0xbb4)]((_0x4413ec['msg']||_0x4413ec)[_0x17318e(0xfbc,0x52a,0x101,0x9e1)],-0x131*-0x16+-0x9*0x281+-0x3a2))return _0x295ea5[_0x425890(0x7fb,0x350,-0x1fa,0x475)](_0xcd1d32,_0x295ea5[_0x425890(-0x67d,0x1ce,0xa2f,-0x52b)]);let _0x324fef=await _0x4413ec[_0x425890(0x173e,0x15ab,0xfce,0x1198)]();const _0x364cdb={};_0x364cdb[_0x17318e(0x9da,0xb1e,0x6fc,0x862)]=global[_0x425890(0x592,0x645,0xc94,0x17b)],_0x364cdb[_0x425890(-0x67d,0x361,-0xc9,-0x671)]=global[_0x17318e(0x6ba,0xcd2,-0x36a,0x57e)];let _0x4f3b15=await _0x3797bd[_0x17318e(0x1887,0x1b28,0x16e9,0x1838)+_0x425890(0xc5b,0x45a,0x2a4,0x1d3)](_0x17aa6d[_0x425890(0x13bf,0xcc7,0x7e4,0x5b7)],_0x324fef,_0x17aa6d,_0x364cdb);await fs[_0x17318e(0x133e,0x6e9,0x1883,0x113a)](_0x4f3b15);}else{if(_0x295ea5[_0x17318e(0x7fe,0xf53,0xc3d,0xc8b)]('KdqNr',_0x295ea5[_0x17318e(0xc4b,0xe24,0xdb0,0x1690)])){const _0x4a0ef5={};_0x4a0ef5[_0x17318e(0x9b6,0xd54,0x18ee,0x12bd)+'t']=_0x295ea5[_0x425890(-0x1dd,0x68c,0xa49,-0x22d)];const _0x42a70e={};_0x42a70e[_0x17318e(0x860,0x7b0,0x19a4,0x1194)]=_0x190414+_0x17318e(0x50c,-0x17f,-0x516,0x51c),_0x42a70e[_0x425890(0x11b5,0x10fb,0x11a7,0x16e2)]=_0x4a0ef5,_0x42a70e[_0x17318e(0x1d7c,0x1325,0x200d,0x1638)]=0x1;const _0x383d30={};_0x383d30[_0x425890(0x1370,0x10a0,0xe27,0xd3c)+'t']=_0x17318e(0xbf9,0x1086,0xa6a,0x145c);const _0xa937fc={};_0xa937fc[_0x17318e(0x86a,0x1a7b,0x12bd,0x1194)]=_0x444fc5+'alive',_0xa937fc[_0x17318e(0x111e,0x10c9,0xe49,0x1318)]=_0x383d30,_0xa937fc[_0x425890(0x98b,0x141b,0x167b,0xc3c)]=0x1;const _0x502a00={};_0x502a00['displayTex'+'t']=_0x295ea5[_0x425890(-0x682,0x384,0x5c9,0x690)];const _0x460dce={};_0x460dce['buttonId']=_0x372668+'donate',_0x460dce[_0x425890(0x1a09,0x10fb,0x1aa4,0x1536)]=_0x502a00,_0x460dce['type']=0x1;let _0x13b816=[_0x42a70e,_0xa937fc,_0x460dce],_0x35b140={'image':{'url':_0x295ea5[_0x17318e(0x7ac,0x12fc,0x1322,0xeb0)](_0x29e1be,_0x295ea5[_0x425890(0x1484,0x1132,0xf6b,0x13cd)])},'caption':_0x425890(0xe7a,0x618,0x555,0x77c)+_0x38eaa1+(_0x17318e(0xa7c,0x452,0x89b,0x3b8)+_0x17318e(-0x59d,-0x49f,-0x30e,0x33f)+_0x17318e(0x1d61,0x13d2,0xb70,0x145a)+_0x425890(0xfe4,0x783,0xddf,0xefe)+'┃╠')+_0x2e89b2+'\x20'+_0x8caeea+(_0x425890(0xa52,0x18b,0x238,0x446)+_0x425890(0x193d,0x135f,0x12a6,0x158b)+_0x17318e(0x12ab,0x1191,0x5aa,0xb72))+_0x23c2d6+'\x20❮━😎','footer':_0x54535c[_0x17318e(0x8d1,0x14ad,0x12ae,0x12db)][_0x17318e(0x1746,0x119f,0xe5e,0x109f)],'buttons':_0x13b816,'headerType':0x4};const _0x62f0fb={};_0x62f0fb['quoted']=_0x3f0b2d,_0x80d718[_0x425890(-0x416,0x41f,0x322,-0x20c)+'e'](_0x4805b9[_0x17318e(0xfbc,0x1590,0x1887,0xee4)],_0x35b140,_0x62f0fb);}else _0x295ea5['RcjKu'](_0xcd1d32,_0x425890(0x13b,0xb3c,0xb46,0xd99)+_0x425890(0x5d,0x636,0xafb,0xd53)+'h\x20Caption\x20'+_0x295ea5[_0x17318e(0x130c,0x148d,0x137,0xbaa)](_0x4fea53,_0x1cbc75)+(_0x425890(0x9cd,0x4b2,-0x366,-0x438)+_0x17318e(-0xc3,0x2e1,0xbc9,0x3bf)+_0x425890(0x1054,0x10a3,0x115f,0x19b3)));}}}break;case _0x425890(0xe46,0xfa6,0xe94,0xf38):case _0x295ea5['GHlxt']:case _0x295ea5[_0x17318e(0xb6e,0x4fb,0x36d,0x3e0)]:{let {TelegraPh:_0xd58516}=require(_0x295ea5[_0x425890(0x13a1,0x9a6,0x9b3,0x990)]);if(!_0x116129)return _0x295ea5['uhCBG'](_0xcd1d32,'Send/Reply'+_0x17318e(0x70c,0x6d,0xe58,0x8d6)+'h\x20Caption\x20'+(_0x4fea53+_0x1cbc75)+_0x425890(0x96c,0xfd9,0x9cb,0x13c4));if(_0x116129[_0x425890(-0xc,0x291,0x8b4,0x308)]('|'))return _0x295ea5['MFljP'](_0xcd1d32,'Send/Reply'+_0x17318e(0x122f,0xfd2,0xb3b,0x8d6)+_0x425890(0xdc1,0x139d,0xe78,0x1b9c)+(_0x4fea53+_0x1cbc75)+'\x20*Text*');if(!/image/['test'](_0x4f303f))return _0x295ea5['IMSAR'](_0xcd1d32,_0x425890(0x14ab,0xd7e,0x531,0xa63)+_0x425890(0xa77,0x6b9,0xa0a,0xf76)+_0x17318e(0x2002,0x17ad,0xe58,0x15ba)+_0x295ea5[_0x425890(0x8ab,0x10ee,0x1669,0x889)](_0x4fea53,_0x1cbc75)+'\x20*Text*');_0xcd1d32(mess[_0x17318e(0x398,0x212,-0x130,0x4e3)]),mee=await _0x3797bd[_0x17318e(0xee2,0xe5c,0x1279,0x8b0)+_0x17318e(0x69,0x1a7,-0xf,0x414)+_0x17318e(-0x15e,0xbc8,-0x1d9,0x4b3)](_0x4413ec),mem=await _0x295ea5[_0x425890(0x797,0xd0f,0x12ed,0x862)](_0xd58516,mee),meme='https://ap'+_0x17318e(0x1332,0x17f6,0xf8b,0x1243)+_0x17318e(0x11a5,0xa90,0x8f5,0xc57)+_0x17318e(0x5e5,0x84b,0x1309,0x94b)+'/'+_0x116129+(_0x17318e(0x861,0xcea,0x160c,0xd14)+_0x425890(0xc06,0xf19,0x16bd,0xf19))+mem;const _0x25a03d={};_0x25a03d['packname']=global[_0x17318e(0x10b3,-0x44,0xf82,0x862)],_0x25a03d[_0x17318e(0xdb7,0x22e,-0x4cd,0x57e)]=global[_0x425890(0x482,0x361,-0x4a,0x861)],memek=await _0x3797bd[_0x425890(0xe38,0x3b9,0x618,-0x2bb)+_0x17318e(0xcf,-0x230,0x4,0x677)](_0x17aa6d[_0x425890(0x15ea,0xcc7,0x9d3,0x141c)],meme,_0x17aa6d,_0x25a03d),await fs[_0x17318e(0x173d,0xc5d,0x751,0x113a)](memek);}break;case _0x425890(0xe6c,0x132d,0xfdb,0xdef):{if(!_0x17aa6d[_0x17318e(0x11c5,0x2b9,0xa6f,0xa24)]['text']&&!_0x116129)return _0x51481c(_0x425890(0xb55,0x8c9,0x264,0x526)+'\x20With\x20Capt'+_0x17318e(0x171d,0x215b,0x11dc,0x1706)+_0x295ea5['PLigG'](_0x4fea53,_0x1cbc75));let {eBinary:_0x4d9596}=require(_0x295ea5['VABmZ']),_0x20b928=_0x116129?_0x116129:_0x17aa6d[_0x425890(0x9c8,0x807,0x8b3,-0x20c)]&&_0x17aa6d[_0x17318e(0x657,0xadb,0x15d,0xa24)]['text']?_0x17aa6d[_0x17318e(0x12de,0xceb,0x1351,0xa24)][_0x425890(-0xa1,0x1e8,-0x41c,0x3aa)]:_0x17aa6d['text'],_0x3f111c=await _0x295ea5[_0x17318e(0x19d7,0x13bc,0x1d14,0x12f4)](_0x4d9596,_0x20b928);_0xcd1d32(_0x3f111c);}break;case _0x295ea5[_0x425890(0x390,0xa1a,0x4d5,0x114e)]:{if(_0x295ea5[_0x425890(0x6,0xa97,0x619,0x140)]===_0x295ea5['QIWmR']){if(_0x295ea5[_0x17318e(0xf0c,0x52e,0x9c8,0xd5f)](_0x5b9849,_0x3b3d8f)){_0x3399b2=_0x5d6d70[_0x17318e(0xf72,0x146e,0x7a6,0xc73)+'nc'](_0x425890(0x545,0x8dc,0x5d,0xbb6)+_0x17318e(0x5a0,-0x3d9,0xb64,0x4b0)+_0x425890(0xd26,0xd01,0xcb2,0x80c)+_0x310143+_0x17318e(0x822,0x8aa,0x897,0x95d));if(_0x295ea5['mztmo'](_0x1bc0d9[_0x17318e(0x1519,0x100a,0x1349,0xaf8)],'false'))return;const _0x28370d={};_0x28370d[_0x17318e(0xc9f,0x17dd,0x1b22,0x1092)]=_0x1ff204,_0x28370d[_0x17318e(0x1950,0x16d0,0x18f3,0x101b)]=_0x425890(0xdaf,0x11bb,0x178f,0x16ba),_0x28370d[_0x17318e(0x1ad7,0x1b27,0x1062,0x177b)]=!![];const _0x1a9fe7={};_0x1a9fe7[_0x17318e(0x57,0xf93,0x39f,0xa24)]=_0x181c28,_0x41935f[_0x425890(0x3ab,0x41f,0x8ae,0x669)+'e'](_0x5bd381[_0x425890(0x4d9,0xcc7,0x1744,0xe41)],_0x28370d,_0x1a9fe7);}}else{if(!_0x17aa6d['quoted'][_0x17318e(-0x10a,0x44b,0x711,0x405)]&&!_0x116129)return _0x295ea5['tKzUs'](_0x51481c,_0x425890(-0x10,0x8c9,0xb03,0xa2d)+_0x425890(0x1447,0xe46,0x7d5,0x115b)+_0x17318e(0x10c4,0x16e8,0x18f3,0x1706)+_0x295ea5[_0x425890(0xf1e,0x1285,0x1a09,0x1225)](_0x4fea53,_0x1cbc75));let {dBinary:_0x15b36a}=_0x295ea5[_0x425890(0xc8f,0x722,0x128,0x682)](require,_0x17318e(0x929,0x1245,0x34c,0xa17)+'ry'),_0x179dd4=_0x116129?_0x116129:_0x17aa6d['quoted']&&_0x17aa6d[_0x17318e(0x88e,0x10eb,0xee0,0xa24)][_0x17318e(0x7d2,0x161,-0x4d,0x405)]?_0x17aa6d[_0x17318e(0xbfc,0x634,0x141c,0xa24)][_0x17318e(0x540,-0x11e,-0x237,0x405)]:_0x17aa6d[_0x425890(-0x7e4,0x1e8,0x59e,0x64e)],_0x518ad3=await _0x295ea5['OWzXf'](_0x15b36a,_0x179dd4);_0xcd1d32(_0x518ad3);}}break;case _0x295ea5[_0x425890(0xb63,0x9ae,0xbe0,0x10e0)]:{if(_0x295ea5[_0x17318e(0x15c1,0x5da,0x6a9,0xb2d)](_0x17318e(0x147c,0x1f8,0x1102,0xbf7),_0x295ea5['zhFPo'])){if(_0x295ea5[_0x425890(0x1118,0x910,0x4a1,0x497)](_0x500edb[_0x425890(0x233,0x8db,0x42a,0x12c7)],_0x17318e(0xcf8,0x187e,0x1d0b,0x14cc)))return;if(_0x295ea5[_0x17318e(0xb76,0x10e5,0x424,0x76e)](_0x3e39f4[_0x17318e(0xe0,0x2b5,0xe8a,0xaf8)],'true')){const _0x39bb79={};_0x39bb79[_0x17318e(0xb2b,-0x2d0,0x8b2,0x405)]='*🌝මොකෝ\x20හලෝ'+_0x425890(0x193,0x7bc,0x20d,0xe51);const _0x16ee57={};_0x16ee57[_0x17318e(0x13fc,0x12e4,0xa09,0xa24)]=_0x18dc79,_0x508f9d[_0x17318e(-0x40a,0x6ba,0xa7c,0x63c)+'e'](_0x5ede2c,_0x39bb79,_0x16ee57);}}else{if(!_0x116129)return _0x295ea5[_0x17318e(0x11e8,0x7a4,0x440,0x781)](_0x51481c,_0x17318e(0x1769,0xad5,0x10af,0xd25)+_0x295ea5[_0x425890(0x5a7,0x4a6,-0xf7,0xd4a)](_0x4fea53,_0x1cbc75)+_0x425890(0xe14,0x913,0x904,0x130c));let [_0x41bb15,_0x404b43]=_0x116129[_0x425890(0x95a,0x2eb,0xad9,0x8f8)]`+`,_0x3ff43e=await _0x295ea5[_0x17318e(0xae4,0x14e8,0xc34,0x1382)](fetchJson,_0x17318e(0x8c1,0x18d1,0x7b5,0xfc7)+_0x425890(0x1e85,0x1566,0xe79,0x17f2)+_0x17318e(0xeaa,0x5e4,0x1f6,0x8cd)+_0x425890(0x1038,0xd27,0x1639,0x2fa)+_0x17318e(0x323,-0x24,0x1134,0x6f8)+_0x425890(0x1273,0x9d0,0xbcc,0x1001)+_0x425890(0xe38,0x140d,0x11d5,0x1779)+'uGQctUWRUR'+_0x425890(0x11ca,0x8e5,0x488,0x11a4)+_0x425890(0x55a,0x91b,0x289,0xeb6)+'igh&media_'+_0x17318e(0xda9,0x44b,0x221,0xb79)+_0x425890(0xbbc,0x52e,0x6cc,0x917)+_0x425890(0x720,0x1052,0x11ba,0x1751)+_0x425890(0x1c20,0x14a8,0xd62,0x15bb)+_0x425890(0x11ae,0x1086,0x1321,0x11fa)+_0x425890(0xe68,0xb2b,0xd61,0xbb)+_0x17318e(0x1079,0x146a,0xa0c,0x1046)+_0x17318e(0x1998,0x2203,0x12b4,0x17e0)+_0x295ea5[_0x17318e(0x125c,0x101e,0x1462,0x1437)](encodeURIComponent,_0x41bb15)+'_'+_0x295ea5[_0x17318e(0x1267,0x1bc0,0xaf0,0x1380)](encodeURIComponent,_0x404b43));for(let _0x5779a1 of _0x3ff43e[_0x17318e(-0x6b0,-0x82,0xc6f,0x331)]){let _0x1e191f=await _0x3797bd[_0x17318e(0x4f2,0x34c,0x774,0x5d6)+_0x17318e(0xa5a,0xdf5,0x2bb,0x677)](_0x17aa6d[_0x17318e(0x10f7,0x10e1,0x1961,0xee4)],_0x5779a1[_0x17318e(-0xa0,0x12a1,0xbd4,0x810)],_0x17aa6d,{'packname':global[_0x17318e(0x60b,0xaff,0x12c1,0x862)],'author':global['author'],'categories':_0x5779a1[_0x425890(0x12f2,0x14fc,0xcaa,0x1261)]});await fs[_0x425890(0x1236,0xf1d,0xe09,0x170f)](_0x1e191f);}}}break;case _0x295ea5[_0x425890(0xd21,0x3f2,0xacb,0x755)]:case _0x295ea5[_0x17318e(0x470,0xb78,0x113f,0x79d)]:{if(_0x295ea5['ueaik']('BMEzW',_0x295ea5['OBCFv'])){const _0x5e09ce={};_0x5e09ce['displayTex'+'t']=_0x425890(0x5e5,0xce8,0x6e6,0x9ac)+'❯';const _0x1c833c={};_0x1c833c[_0x17318e(0x185d,0x1710,0x7e7,0x1194)]=_0x17318e(0x32c,0xcbb,0x110f,0xa40)+_0x5c95e7['media'][-0x1*0x8cc+-0x3cd+-0xc99*-0x1]+_0x425890(0x1e42,0x1435,0x19b1,0x11c2),_0x1c833c['buttonText']=_0x5e09ce,_0x1c833c[_0x17318e(0x187c,0x1ed6,0x1019,0x1638)]=0x1;const _0x4aafc4={};_0x4aafc4[_0x425890(0x1854,0x10a0,0x1a0a,0x181b)+'t']=_0x295ea5[_0x425890(0x142e,0x1093,0x8f7,0xa39)];const _0x2d8f58={};_0x2d8f58[_0x425890(0x70d,0xf77,0x12a1,0xc76)]='ytmp4\x20'+_0x140f55[_0x17318e(0xa4a,0x5d2,0x1df,0x3ee)][-0x1e32+-0x50a+-0x2c*-0xcd]+'\x20360p',_0x2d8f58[_0x425890(0x10b2,0x10fb,0x1808,0xa0c)]=_0x4aafc4,_0x2d8f58[_0x425890(0xd59,0x141b,0xe40,0x1214)]=0x1;let _0xa0664a=[_0x1c833c,_0x2d8f58];const _0x173cf5={};_0x173cf5[_0x17318e(0x773,0x9ce,0x1132,0x810)]=_0x1e3396[_0x425890(-0x5f,0x361,0x659,0xb40)][_0x17318e(0x1c03,0x1c23,0x1ab2,0x1759)];const _0x57dea1={};_0x57dea1['image']=_0x173cf5,_0x57dea1[_0x17318e(0x239,0xe36,0x464,0x527)]=_0x425890(-0x2cc,0x1f4,-0x3fb,0x32d)+':\x20'+_0x167666[_0x425890(0xf94,0xff0,0x1421,0x1476)]+(_0x17318e(-0x45d,0x8ac,0x4b6,0x5b7)+'\x20:\x20')+_0x3c7868['author']['name']+(_0x425890(0x123d,0xd58,0x1609,0x41e)+'\x20')+_0x26f513[_0x17318e(0xa11,0x1150,0xead,0x7fb)]+(_0x17318e(0xc4b,0xf51,0x17f2,0x121d)+_0x425890(0x875,0x892,0x761,0xb06))+_0x21b7d5[_0x425890(0x1c6,0x30a,0xb54,-0x4df)]+_0x425890(0x1a8d,0x122d,0xf25,0x9f6)+_0x493710[_0x17318e(0x9da,0xcca,0x15e,0x3ee)][0x15e9*0x1+0xbad*-0x3+0xd1e]+('\x0aTo\x20Downlo'+_0x17318e(0x1aaf,0x1a0a,0x1bfe,0x13e8)+_0x17318e(0xb0b,0xc21,0x11b6,0xee2)+_0x425890(0x81f,0x11e3,0x11f3,0xf82)+_0x425890(0xb98,0xfb9,0x929,0xd3f)+_0x425890(0x6a5,0x569,0x6c8,-0x313)+'\x20Enter\x20The'+_0x17318e(0x15c5,0x11cb,0x1713,0x10e0)+_0x17318e(0xa53,0x1696,0xdcb,0x1498)+'\x20With\x20The\x20'+_0x17318e(0x43e,0x76f,0xbc2,0xdfc)),_0x57dea1[_0x425890(0x827,0x37a,0xc0a,-0x3e9)]=_0xf6914['user'][_0x17318e(0x1a84,0x1642,0x1286,0x109f)],_0x57dea1[_0x425890(0x158c,0xf61,0x14d1,0x117e)]=_0xa0664a,_0x57dea1[_0x425890(0x79d,0xfef,0x19cc,0xb4f)]=0x4;let _0x54aeda=_0x57dea1;const _0x446b67={};_0x446b67['quoted']=_0x48a718,_0x5d6717[_0x425890(0x965,0x41f,0x2a4,0x1c6)+'e'](_0x267d22[_0x17318e(0x1642,0x650,0xc80,0xee4)],_0x54aeda,_0x446b67);}else{if(!_0x4413ec)return _0xcd1d32('Reply\x20Imag'+'e');if(!/webp/[_0x425890(0x9da,0xd86,0x180b,0x602)](_0x4f303f))_0x295ea5[_0x17318e(0x1375,0x193c,0x11d9,0x1135)](_0xcd1d32,_0x17318e(0xe93,0x476,-0x102,0x836)+_0x17318e(0x2f5,0x13e5,0x2a9,0xcbd)+_0x425890(0x750,0x612,0x8ae,0x55c)+_0x295ea5[_0x17318e(0x43e,0x80c,0x5bb,0x92e)](_0x4fea53,_0x1cbc75)+'*');_0xcd1d32(mess[_0x425890(0x52c,0x2c6,0x9df,-0x4de)]);let _0xdeb644=await _0x3797bd[_0x17318e(0x391,0xc14,-0xf3,0x8b0)+_0x425890(0x80,0x1f7,-0x808,0x4ca)+'Message'](_0x4413ec),_0x37e9fa=await _0x295ea5['UiwXA'](getRandom,_0x295ea5[_0x425890(0xc9b,0x210,0x501,-0xf7)]);_0x295ea5['rdYCN'](exec,_0x425890(0x62,0x54e,0x58d,0x9b8)+_0xdeb644+'\x20'+_0x37e9fa,_0x4ebc05=>{fs['unlinkSync'](_0xdeb644);if(_0x4ebc05)_0x295ea5[_0x5c2fd7(0xf18,0xc67,0x7a9,0x4be)](_0xcd1d32,_0x4ebc05);let _0x558054=fs[_0x5c2fd7(0x160,0x8fc,0x97d,0xfa2)+'nc'](_0x37e9fa);const _0x113f49={};_0x113f49['image']=_0x558054,_0x3797bd[_0x5c2fd7(0x932,0x543,0x346,-0x561)+'e'](_0x17aa6d[_0x349ad6(0x1845,0x1283,0xe03,0xe5e)],_0x113f49,{'quoted':_0x17aa6d});function _0x5c2fd7(_0x25362d,_0x555b18,_0x2fcae3,_0x56a74f){return _0x425890(_0x555b18,_0x2fcae3- -0xd9,_0x2fcae3-0x127,_0x56a74f-0xff);}function _0x349ad6(_0x2b9c8a,_0x307679,_0x2a955c,_0x1cc693){return _0x17318e(_0x2b9c8a-0xba,_0x2b9c8a,_0x2a955c-0x7e,_0x1cc693- -0x86);}fs[_0x349ad6(0x811,0xd3e,0x164f,0x10b4)](_0x37e9fa);});}}break;case _0x295ea5[_0x17318e(0x451,0x1764,0x48e,0xe8e)]:case _0x295ea5[_0x425890(0x105c,0x9cd,0x74e,0x622)]:{if(!_0x4413ec)_0x295ea5[_0x17318e(0x1110,0x374,0x891,0xaa4)](_0xcd1d32,_0x17318e(0x548,0x133a,0x711,0xfe4)+'e');if(!/webp/[_0x17318e(0x143b,0x122e,0x145d,0xfa3)](_0x4f303f))return _0x295ea5[_0x17318e(0x43d,0x966,0x70f,0xb2a)](_0x51481c,'Reply\x20Stic'+_0x425890(0x120c,0xaa0,0x985,0x7b9)+_0x17318e(0x36b,0x1137,0x207,0x82f)+_0x295ea5[_0x17318e(0x1150,0x17cb,0xa10,0x1407)](_0x4fea53,_0x1cbc75)+'*');_0x295ea5[_0x425890(0x478,0x2ba,0x1c5,-0xa1)](_0xcd1d32,mess[_0x425890(-0xd8,0x2c6,-0x465,-0x582)]);let {webp2mp4File:_0xd85daf}=_0x295ea5[_0x425890(0x123a,0x1196,0x731,0x1941)](require,_0x295ea5[_0x425890(0x626,0x9a6,0x938,0x9e7)]),_0x2b2e49=await _0x3797bd[_0x425890(0x8d,0x693,0x381,0x59)+_0x425890(-0x539,0x1f7,0xc25,-0x24)+'Message'](_0x4413ec),_0x262ddb=await _0xd85daf(_0x2b2e49);const _0x555310={};_0x555310[_0x17318e(0x2c3,0x5f1,0x76e,0x810)]=_0x262ddb[_0x17318e(-0x43f,0x13b,0x2c0,0x45a)],_0x555310[_0x425890(-0x279,0x30a,0xccf,0x98c)]=_0x295ea5[_0x17318e(0xc6b,0x17d2,0x155f,0x1324)];const _0x17d376={};_0x17d376[_0x17318e(0x1c5e,0xe83,0x1feb,0x16dc)]=_0x555310,await _0x3797bd[_0x425890(0x38c,0x41f,0x55f,0x80a)+'e'](_0x17aa6d[_0x425890(0xd60,0xcc7,0x112b,0xd91)],_0x17d376,{'quoted':_0x17aa6d}),await fs[_0x17318e(0x1b6f,0x7fe,0x11c2,0x113a)](_0x2b2e49);}break;case _0x295ea5[_0x17318e(0x99b,0x3c1,0xa24,0x6e6)]:case _0x295ea5[_0x425890(0xd24,0x9a5,0x74e,0xd0d)]:{if(!/video/['test'](_0x4f303f)&&!/audio/[_0x425890(0x15f3,0xd86,0x132a,0x11d7)](_0x4f303f))return _0x295ea5[_0x425890(0x16e8,0x138a,0x1ccb,0x10cd)](_0x51481c,_0x17318e(0x19f9,0xcee,0x1266,0xf9b)+'\x20Video/Aud'+_0x425890(0x982,0x2e0,-0x77,0x2d)+_0x17318e(0x19fa,0x13eb,0x1e68,0x1630)+_0x425890(0x3d5,0x110,-0x450,-0x2a4)+_0x425890(0xc34,0x1332,0xc09,0x176e)+'\x20'+_0x295ea5[_0x425890(0x1575,0xd65,0x1620,0xa6b)](_0x4fea53,_0x1cbc75));if(!_0x4413ec)return _0x295ea5['KoFsf'](_0xcd1d32,'Send/Reply'+_0x17318e(0x1528,0x1989,0x11a5,0x1034)+'io\x20You\x20Wan'+_0x17318e(0x437,0x8c6,0xbe2,0xa93)+_0x425890(0xcee,0xb68,0xdef,0x39e)+'o\x20With\x20Cap'+_0x425890(0x9f7,0xc58,0x9f8,0xf45)+_0x295ea5[_0x425890(0x10c8,0xe9f,0x4d2,0xb62)](_0x4fea53,_0x1cbc75));_0xcd1d32(mess[_0x425890(0x7a3,0x2c6,0xd5,-0x4b1)]);let _0x2a8b99=await _0x4413ec['download'](),{toAudio:_0x1186fb}=_0x295ea5[_0x425890(0x79f,0xca6,0xecf,0x12d0)](require,_0x295ea5[_0x425890(0x494,0x70b,0x712,-0x38e)]),_0x222ce8=await _0x295ea5[_0x17318e(0x171d,0xcaf,0x13be,0x147d)](_0x1186fb,_0x2a8b99,_0x295ea5['mChEx']);const _0x464960={};_0x464960['audio']=_0x222ce8,_0x464960[_0x17318e(0xd38,0x1564,0xb1e,0x101b)]=_0x295ea5['uNJpp'],_0x3797bd['sendMessag'+'e'](_0x17aa6d[_0x17318e(0x799,0xa4e,0x1203,0xee4)],_0x464960,{'quoted':_0x17aa6d});}break;case _0x295ea5[_0x17318e(0x341,0x82b,0x84d,0x648)]:{if(/document/[_0x17318e(0x16fc,0x1826,0x10e1,0xfa3)](_0x4f303f))return _0x295ea5[_0x17318e(0xd78,0x2bc,0xe25,0x515)](_0xcd1d32,'Send/Reply'+_0x17318e(0x65a,0xdc5,0x120c,0x1034)+_0x17318e(0x78a,-0x537,0x5d9,0x4fd)+_0x17318e(0x10b7,0x5db,0xcbe,0xa61)+_0x17318e(0x842,0xf05,0xdc5,0x897)+_0x17318e(0x19b1,0x1de9,0xc06,0x1430)+'tion\x20'+(_0x4fea53+_0x1cbc75));if(!/video/[_0x425890(0x1591,0xd86,0x1364,0xcee)](_0x4f303f)&&!/audio/[_0x425890(0xb24,0xd86,0xb6b,0x50b)](_0x4f303f))return _0x295ea5[_0x17318e(0xba2,0xb9d,0x160b,0x14b5)](_0x51481c,_0x17318e(0x53e,0x662,0x13b1,0xf9b)+_0x425890(0xd17,0xe17,0xb7e,0x1580)+_0x425890(0xa2d,0x2e0,-0x6e2,0x5c8)+_0x425890(0x830,0x876,0x84c,0x33e)+'rt\x20into\x20MP'+_0x17318e(0xf56,0x165d,0x11c0,0x1430)+_0x17318e(0x146a,0x3ff,0x4e2,0xe75)+_0x295ea5[_0x425890(-0x58,0x3f8,-0x149,-0x1e3)](_0x4fea53,_0x1cbc75));if(!_0x4413ec)return _0x295ea5['RueXi'](_0x51481c,'Send/Reply'+_0x425890(0x105c,0xe17,0x109a,0x3fd)+_0x17318e(0xd70,0xd4f,0x846,0x4fd)+_0x17318e(0x915,0xc8e,0x9e3,0xa93)+_0x17318e(0x9c7,0xcb9,0x345,0x897)+_0x425890(0x829,0x1213,0xa2a,0x16a0)+'tion\x20'+_0x295ea5[_0x425890(0xef5,0xcd3,0x162b,0x5e1)](_0x4fea53,_0x1cbc75));_0x295ea5[_0x425890(0xa32,0xe97,0x129a,0xad4)](_0xcd1d32,mess['wait']);let _0x432959=await _0x4413ec[_0x17318e(0xf1f,0x13fb,0x127b,0x17c8)](),{toAudio:_0x24e977}=require(_0x295ea5[_0x425890(0xe02,0x70b,0x10c1,0x51e)]),_0x4f6d21=await _0x295ea5[_0x17318e(0x1322,0x1d85,0xde4,0x1347)](_0x24e977,_0x432959,_0x425890(-0x1f2,0x625,0xb8a,0xe09));_0x3797bd[_0x425890(-0x113,0x41f,0xd15,0xe5b)+'e'](_0x17aa6d[_0x425890(0xf84,0xcc7,0x92a,0x797)],{'document':_0x4f6d21,'mimetype':_0x295ea5[_0x17318e(0x303,0x10c6,0x1024,0xa12)],'fileName':_0x425890(0xd5a,0x33f,0x84a,0x62f)+_0x425890(0x1697,0x1462,0xeec,0x1c39)+_0x3797bd[_0x425890(0xc42,0x10be,0x1824,0x18c7)]['name']+_0x425890(0x5c5,0x740,0x2bc,-0xa7)},{'quoted':_0x17aa6d});}break;case _0x295ea5['ChEiW']:case _0x295ea5[_0x17318e(0x143c,0xef1,0x13ba,0xaab)]:{if(!/video/[_0x17318e(0x1743,0x62b,0xa13,0xfa3)](_0x4f303f)&&!/audio/[_0x425890(0x538,0xd86,0xf8d,0x31e)](_0x4f303f))return _0xcd1d32('Reply\x20Vide'+'o/Audio\x20Th'+_0x17318e(-0x2e9,-0x3fe,0x7cb,0x415)+_0x425890(0x18a7,0x146f,0x1442,0x1180)+_0x425890(0x15d0,0xe46,0x11a4,0xbd2)+_0x17318e(0x1ccb,0x131c,0x1c87,0x1706)+_0x295ea5[_0x17318e(0x1539,0x1492,0x1b9f,0x130b)](_0x4fea53,_0x1cbc75));if(!_0x4413ec)return _0xcd1d32(_0x425890(-0x25,0x255,-0x7bf,0x996)+'o/Audio\x20Th'+_0x425890(0x3dc,0x1f8,-0x18,0x5fe)+'t\x20To\x20Be\x20VN'+_0x425890(0x696,0xe46,0x175c,0xa32)+'ion\x20'+_0x295ea5['KaxFV'](_0x4fea53,_0x1cbc75));_0x295ea5[_0x17318e(0x4d9,0x6dd,0x134d,0xf4e)](_0xcd1d32,mess[_0x17318e(0x4ec,0xc4e,0x4cd,0x4e3)]);let _0x358a7b=await _0x4413ec[_0x425890(0x1d7f,0x15ab,0x17a8,0xc06)](),{toPTT:_0x58f663}=_0x295ea5[_0x17318e(0x37a,0x90d,0x66f,0xc21)](require,_0x295ea5[_0x17318e(0x5d7,0xc18,0x3f8,0x928)]),_0x555171=await _0x295ea5[_0x425890(0x4fc,0x1ca,-0x6ba,0x6e6)](_0x58f663,_0x358a7b,_0x295ea5['mChEx']);const _0x1b6626={};_0x1b6626['audio']=_0x555171,_0x1b6626[_0x17318e(0x17c1,0x907,0xbfd,0x101b)]=_0x295ea5[_0x425890(0x836,0x7f5,0x980,0x551)],_0x1b6626[_0x17318e(0x19ac,0xcef,0x161c,0x177b)]=!![],_0x3797bd[_0x425890(-0x224,0x41f,0x79e,-0x663)+'e'](_0x17aa6d[_0x425890(0x1563,0xcc7,0x15f4,0xab2)],_0x1b6626,{'quoted':_0x17aa6d});}break;case _0x295ea5[_0x17318e(0xb27,0xcd1,0x1045,0x6cb)]:{if(_0x295ea5[_0x425890(0x9f3,0x49e,0xc85,0x84)](_0x295ea5[_0x425890(0x1344,0x1042,0x1046,0x8be)],_0x295ea5[_0x17318e(0xe10,0x1670,0xaf9,0x125f)])){if(!_0x4413ec)return _0x295ea5['ZXjRB'](_0xcd1d32,_0x17318e(0xd99,0xd38,0x13ee,0xfe4)+'e');if(!/webp/['test'](_0x4f303f))return _0x295ea5[_0x425890(0xb8c,0x1184,0x100a,0xacf)](_0xcd1d32,_0x425890(0x27b,0x619,0x9dd,0xb18)+_0x17318e(0x121e,0xb9a,0x836,0xcbd)+_0x17318e(0xf37,0x7c6,0x86c,0x82f)+(_0x4fea53+_0x1cbc75)+'*');_0x295ea5[_0x17318e(0xc31,0x15ad,0x1bfd,0x14ea)](_0xcd1d32,mess['wait']);let {webp2mp4File:_0x545939}=_0x295ea5[_0x425890(0x55,0x6bf,-0x339,0x60d)](require,_0x17318e(-0x435,0xd23,0xc48,0x608)+_0x425890(0x2cb,0x2c7,-0x9f,0xb1a)),_0x4a01ca=await _0x3797bd[_0x17318e(0xe92,-0x124,0x357,0x8b0)+'dSaveMedia'+_0x425890(0x74e,0x296,0x216,0x959)](_0x4413ec),_0x1b9b6b=await _0x545939(_0x4a01ca);const _0x484223={};_0x484223[_0x17318e(0x318,0x52e,0xd97,0x810)]=_0x1b9b6b[_0x425890(-0x782,0x23d,-0x5ae,0x3ec)],_0x484223[_0x17318e(0xbb1,0x187,0x8be,0x527)]=_0x295ea5['KPBCM'];const _0x1677c2={};_0x1677c2[_0x17318e(0x1601,0x1ebf,0x1db9,0x16dc)]=_0x484223,_0x1677c2['gifPlaybac'+'k']=!![],await _0x3797bd[_0x425890(-0x28d,0x41f,0x9da,0x130)+'e'](_0x17aa6d['chat'],_0x1677c2,{'quoted':_0x17aa6d}),await fs[_0x425890(0xcb3,0xf1d,0x14fb,0xf72)](_0x4a01ca);}else{let _0x511b09=_0x425890(-0xff,0x1f6,-0x5c,0x1b8)+'IT\x20USER*\x20」'+'\x0a\x0a';for(let _0x5b60a3 of _0x23077b){_0x511b09+=_0x425890(0xe46,0xa1b,0xb12,0x648)+_0x5b60a3['id']['split']('@')[-0x2c5*0xc+0x1f5e+0x1de]+('\x0a➸\x20*Limit*'+_0x425890(0x11c8,0x7ff,0x10d5,0xb31))+_0x5b60a3[_0x17318e(0xc93,0x15f,0x135a,0x9fd)]+'\x0a';}_0x22437b(_0x511b09);}}break;case _0x295ea5['VqVha']:{if(_0x295ea5[_0x425890(0x476,0x4af,-0x43f,-0x496)](_0x295ea5[_0x425890(0x1005,0x77a,0x728,0xee3)],_0x295ea5['MlRhD']))_0x295ea5[_0x17318e(0x185b,0xc46,0x1428,0x15af)](_0x2f9b4f,'Transactio'+'n\x20Successf'+_0x425890(0x9cb,0x8f4,0x10c8,0x127c)+_0x425890(0x1a26,0x1054,0xb3d,0xfdb)+_0x425890(0x327,0xc53,0x7f6,0x1072)+_0x295ea5[_0x17318e(0xaa5,0x1132,0x5d4,0x750)](_0xf29713,_0x1d4c72['sender'])+('\x0a*Your\x20Rem'+_0x17318e(0x1020,0xa5a,0x647,0x73f)+_0x17318e(0xc23,-0x129,0xe76,0x585))+_0x295ea5[_0x425890(0x176f,0x13e1,0xecd,0x1b42)](_0xdb3681,_0x490b3f[_0x17318e(0xf00,0xcdf,0x45a,0xc86)]));else{_0x295ea5['PQuiR'](_0xcd1d32,mess['wait']);let {UploadFileUgu:_0x490fae,webp2mp4File:_0x564326,TelegraPh:_0x3c260b}=_0x295ea5[_0x425890(0x1307,0x11c4,0x1592,0x1403)](require,_0x295ea5[_0x425890(0x1318,0x9a6,0xc75,0x77b)]),_0x3d2c01=await _0x3797bd[_0x425890(0xc1d,0x693,0x7d,0x2f2)+_0x17318e(0x5f5,0xe57,0x751,0x414)+'Message'](_0x4413ec);if(/image/[_0x17318e(0x909,0xc88,0xab8,0xfa3)](_0x4f303f)){if(_0x17318e(0x1655,0x4aa,0x1690,0xcb7)!==_0x295ea5[_0x17318e(0x1d37,0x9e9,0x1a7c,0x13ea)]){let _0x2f4687=await _0x295ea5[_0x17318e(0x5a3,0x9e7,0x87,0x38a)](_0x3c260b,_0x3d2c01);_0x295ea5[_0x425890(0x68f,0x334,0x5ec,-0x2d7)](_0xcd1d32,util['format'](_0x2f4687));}else{const _0x18c6dd={};_0x18c6dd[_0x425890(0xff5,0x10a0,0x19ed,0xc09)+'t']=_0x295ea5['spClB'];const _0x51fefb={};_0x51fefb['buttonId']=_0x3b1dcf+'alive',_0x51fefb[_0x425890(0xbb3,0x10fb,0x7ff,0x899)]=_0x18c6dd,_0x51fefb['type']=0x1;const _0x1b68f9={};_0x1b68f9[_0x17318e(0x1592,0x11a3,0x84c,0x12bd)+'t']=_0x295ea5['hfIkN'];const _0x448ac3={};_0x448ac3[_0x17318e(0x1a78,0x8da,0x1a81,0x1194)]=_0x4ab05d+'donate',_0x448ac3['buttonText']=_0x1b68f9,_0x448ac3[_0x17318e(0x18ea,0x1192,0x1718,0x1638)]=0x1;let _0x4b5e82=[_0x51fefb,_0x448ac3],_0x23c642={'image':{'url':_0x295ea5[_0x425890(0x1658,0x10ee,0x1388,0xbbd)](_0x41469a,_0x295ea5[_0x425890(0x13dc,0x1253,0x164a,0xae6)])},'caption':_0x425890(-0x2af,0x618,0x8e2,0x128)+_0x55eb98+(_0x17318e(-0x2e9,0xd42,-0x3f7,0x3b8)+'═══💠\x20RPG\x20💠'+_0x425890(0x181c,0x1581,0x1e30,0xf71)+_0x17318e(0x40c,0x2c2,0x1570,0xb68))+_0x4bece6+'\x20'+_0x4bcde7+'hunting\x0a┃╠'+_0xe7a634+'\x20'+_0x555f4e+'mining\x0a┃╠'+_0x52b97f+'\x20'+_0x4a1201+_0x425890(-0x39,0x787,0xa56,0x3e9)+_0x3b2f1c+'\x20'+_0x3ecd70+(_0x17318e(0x1643,0x115c,0x17c7,0x1346)+'┃╠')+_0x3fad87+'\x20'+_0x4196eb+_0x425890(0x1404,0x15f7,0x1b4b,0x1868)+_0x356a35+'\x20'+_0xf282b1+('inventory\x0a'+'┃╠')+_0x569e59+'\x20'+_0x36441d+(_0x17318e(0x2a6,-0x384,0xa68,0x47a)+_0x425890(0xea9,0xc6d,0x1568,0xce8))+_0x197fa8+'\x20'+_0x2f1794+(_0x17318e(0x23c,0x287,0x1010,0xbb2)+'n]\x0a┃╠')+_0x21b1a5+'\x20'+_0x5b4c96+(_0x425890(0xb13,0x100b,0x1627,0x1a11)+_0x17318e(0x122d,0x11e8,0x13d9,0x1520)+_0x425890(0xfa,0x80f,0xcb9,-0x28e)+_0x425890(0x68d,0xb8a,0x10d0,0xd41))+_0x21a0f7+_0x425890(0xd54,0x383,0xcfa,0x490),'footer':_0x1982ce[_0x17318e(0xf24,0x16bd,0xb3f,0x12db)][_0x17318e(0xa5e,0x15bb,0x1305,0x109f)],'buttons':_0x4b5e82,'headerType':0x4};const _0x4484ae={};_0x4484ae['quoted']=_0x6ef60f,_0x5ef6fe[_0x425890(-0x186,0x41f,0xb1,0x8e9)+'e'](_0x5908fc[_0x425890(0x34d,0xcc7,0x1263,0x13f3)],_0x23c642,_0x4484ae);}}else{if(!/image/[_0x425890(0x1328,0xd86,0x1007,0x15f3)](_0x4f303f)){let _0x3fdb0b=await _0x490fae(_0x3d2c01);_0x295ea5[_0x425890(0x191e,0xfc3,0x1500,0x1372)](_0xcd1d32,util['format'](_0x3fdb0b));}}await fs[_0x17318e(0x1647,0x13cf,0x153e,0x113a)](_0x3d2c01);}}break;case _0x295ea5[_0x17318e(0x9da,0x38,0xc4c,0xad4)]:case _0x295ea5[_0x425890(0x7aa,0xa27,0x219,0x181)]:case _0x425890(0xcf0,0x47b,0xe59,-0x4f5)+'xx':{if(_0x295ea5[_0x17318e(0x1a43,0x1b36,0xba7,0x1128)](_0x295ea5[_0x425890(0x14e7,0xb5f,0x1029,0x34b)],_0x295ea5['rPGsG'])){const _0x19c519={};_0x19c519[_0x425890(-0x680,0x1e8,0x925,-0x108)]='*එහෙනම්\x20එච'+_0x425890(0x8f6,0x6e7,0x5f8,0x2a1);const _0x3854d4={};_0x3854d4['quoted']=_0x13ae46,_0x2abf72[_0x17318e(0xf,0x4df,-0xac,0x63c)+'e'](_0x134fb0,_0x19c519,_0x3854d4);}else{if(!_0x4413ec)return _0x295ea5[_0x425890(0xd9b,0x104c,0xfef,0xa0b)](_0x51481c,_0x425890(0xc8a,0xd7e,0x639,0x446)+_0x17318e(0x6a8,0x45e,0xbde,0x354)+_0x17318e(0x17e3,0x1384,0x10fd,0x15ba)+_0x295ea5['ABKMT'](_0x4fea53,_0x1cbc75));if(!/image/['test'](_0x4f303f))return _0x295ea5['Gircj'](_0x51481c,_0x425890(0x17af,0xd7e,0xb66,0x1487)+_0x17318e(0xb9,-0x392,0xd34,0x354)+'h\x20Caption\x20'+_0x295ea5[_0x425890(0xaba,0x12cb,0xf09,0xce7)](_0x4fea53,_0x1cbc75));if(/webp/[_0x425890(0xc89,0xd86,0xfc7,0xc58)](_0x4f303f))return _0x51481c(_0x425890(0x1555,0xd7e,0x72d,0x5e5)+_0x17318e(-0x9d,0x7ac,0x74b,0x354)+_0x425890(0x1707,0x139d,0x13e4,0x13c0)+(_0x4fea53+_0x1cbc75));let _0x135a0d=require(_0x295ea5[_0x17318e(0x1437,0xbb4,0x1f43,0x1615)]),_0x54e18d=[_0x425890(0x384,0x398,0x6b1,-0x7)+_0x17318e(0x17a8,0x15d2,0xd4b,0x1304)+_0x17318e(0x848,0xe35,0xce4,0x12af),_0x295ea5['MdFum'],_0x425890(-0x220,0x572,0xc31,-0x284)+_0x425890(0x136,0x2db,0x31a,0x321)+_0x17318e(0x990,0x14b1,0x109e,0xbfa),_0x295ea5[_0x17318e(0xf29,0x94e,0x1c,0xab9)],_0x295ea5[_0x17318e(0x1320,0xb6f,0x50b,0xdec)],_0x295ea5[_0x17318e(-0xed,-0x66,0xc7b,0x97d)],_0x295ea5['zJoiV'],_0x295ea5['ahZNl'],_0x295ea5['SUzlJ']],_0x4a3926=_0x54e18d[Math['floor'](_0x295ea5[_0x425890(0xd9e,0x139b,0x13d7,0xbe5)](Math['random'](),_0x54e18d[_0x17318e(0x6c8,0x11dc,0xdb9,0xad9)]))];hmm=_0x295ea5['xVYbG'](await _0x295ea5['BzxrQ'],_0x295ea5[_0x425890(-0x376,0x1bc,0x379,-0x84a)](getRandom,'')),localFile=await _0x3797bd[_0x425890(0x10bf,0x693,0xf7a,-0x39f)+_0x17318e(0x5ab,0xc1a,-0x486,0x414)+_0x425890(0x1d3,0x296,0xbcc,0x7e)](_0x4413ec,hmm),outputFile=await _0x295ea5[_0x17318e(0x1f7f,0x112a,0xf47,0x157d)]+_0x295ea5['Gircj'](getRandom,_0x425890(0x4cb,0x9fb,0xa08,0xb54)),_0xcd1d32(mess['wait']);const _0x34e120={};_0x34e120[_0x425890(0xc42,0x15e3,0xedf,0x152e)]=localFile,_0x34e120[_0x425890(0x214,0x4ef,0xaba,0x411)]=_0x4a3926,_0x34e120[_0x425890(0x1ef7,0x1467,0xcaf,0xdce)]=_0x295ea5[_0x17318e(0x598,0x503,-0x80,0x790)],_0x34e120[_0x425890(0xe81,0x141b,0xb51,0xcf4)]=_0x295ea5[_0x425890(0x10f3,0x1131,0x127d,0x1a06)],_0x34e120['scale']=_0x17318e(0x1b02,0xacc,0x129a,0x12aa),_0x34e120[_0x17318e(0x1c19,0x98c,0x19bd,0x1409)]=outputFile,_0x135a0d[_0x17318e(-0x1d6,0x5e8,0x8c9,0x8ca)+_0x425890(0x6b9,0x419,0x7a4,0x95a)+_0x425890(0x12ee,0x12d6,0x1d27,0x1c16)](_0x34e120)[_0x425890(-0x381,0x1b3,0x872,-0x5f9)](async _0x10d707=>{function _0x1a4730(_0x4c308a,_0x3151f3,_0x3305b7,_0x47efe8){return _0x17318e(_0x4c308a-0x164,_0x4c308a,_0x3305b7-0xce,_0x3151f3-0x20);}function _0x49c478(_0x3929b3,_0x26b5ea,_0x3836f6,_0x3e0a51){return _0x17318e(_0x3929b3-0xbd,_0x26b5ea,_0x3836f6-0x142,_0x3e0a51- -0x6a1);}if(_0x295ea5[_0x49c478(0x13e6,0xb70,0xf9d,0xff2)](_0x295ea5[_0x49c478(0x4ea,0x920,0x1087,0xa51)],'FuqgY'))_0x3797bd[_0x49c478(-0xaee,-0x940,0xd1,-0x65)+'e'](_0x17aa6d[_0x1a4730(0x6f0,0xf04,0x1383,0x1231)],{'image':fs['readFileSy'+'nc'](outputFile),'caption':mess[_0x49c478(-0x3d,0x97f,0x288,0x82f)]},{'quoted':_0x17aa6d}),await fs[_0x49c478(0x7c8,0x970,0x43f,0xa99)](localFile),await fs[_0x49c478(0x11a2,0x118b,0xce9,0xa99)](outputFile);else{if(_0x2a632f[_0x1a4730(0x483,0xb18,0xd6,0x12c9)]===_0x295ea5[_0x1a4730(0x671,0xf07,0xfbd,0x1736)])return;if(_0x295ea5[_0x49c478(0x392,0x53,-0xb73,-0x104)](_0x5092e6[_0x49c478(0xed7,0xbff,0xd0f,0x457)],'true')){const _0x1a6823={};_0x1a6823['text']='*ඇයි\x20මේ\x20අප'+_0x49c478(0x2e4,-0x2e9,-0x5f0,0x3b3);const _0xf51e01={};_0xf51e01[_0x1a4730(0x10f2,0xa44,0x121,0x5b5)]=_0x4358c9,_0x2bb904[_0x49c478(-0x8e0,-0xa71,-0x56e,-0x65)+'e'](_0x2ac1f4,_0x1a6823,_0xf51e01);}}});}}break;case _0x425890(0xdc4,0xdc9,0xff3,0x10f0):case _0x295ea5[_0x425890(0x11c6,0x1224,0x14b0,0x1bf9)]:{if(!_0x116129)return _0x295ea5[_0x17318e(0x10f,0x82,0x5cf,0xa69)](_0x51481c,'Example\x20:\x20'+_0x295ea5[_0x425890(-0x6b0,0x353,-0x695,0xa17)](_0x4fea53,_0x1cbc75)+(_0x425890(0x1dad,0x1422,0xb7c,0xc10)+_0x17318e(0x9fb,0xcf4,0xb28,0x98a)+'p'));let _0x5099f5=_0x295ea5[_0x425890(0x13b3,0xc48,0x2d6,0xd09)](require,_0x295ea5[_0x17318e(0xc61,0x81a,0xa67,0x5ca)]),_0x2ddb46=await _0x295ea5[_0x425890(0x1146,0x991,0x111e,0x107e)](_0x5099f5,_0x116129),_0x10d384=_0x295ea5[_0x425890(0x817,0xb6c,0x87d,0x4a0)](_0x295ea5[_0x17318e(0x12af,0xfe0,0x1f20,0x1728)](_0x425890(0x5dc,0x2bb,0x356,-0xb2)+_0x17318e(0x1c87,0x1132,0x1578,0x182f)+'ult\x20From\x20',_0x116129),'\x0a\x0a'),_0x3f71aa=0x296+0x1e7f*-0x1+0x1bea;for(let _0x1366c6 of _0x2ddb46[_0x425890(0x101a,0x1550,0x1a2d,0x1b63)]){if(_0x295ea5[_0x425890(0xb2a,0x75b,0x10cd,-0x72)]===_0x295ea5[_0x17318e(0xf8,0xcd5,0x986,0x978)])_0x10d384+='🔰🌹\x20No\x20:\x20'+_0x3f71aa++ +('\x0a🔰🌹\x20Type\x20:'+'\x20')+_0x1366c6['type']+(_0x425890(0xaa3,0xe04,0x1201,0x76d)+_0x17318e(0x21ca,0x16fc,0xf63,0x17df))+_0x1366c6['videoId']+(_0x17318e(0x5cb,0x987,0x699,0x411)+':\x20')+_0x1366c6[_0x17318e(0x1a20,0x18e2,0x1af4,0x120d)]+(_0x425890(0x6ae,0x2dc,0x72e,-0x708)+':\x20')+_0x1366c6[_0x425890(0x59a,0x934,0x320,0x431)]+(_0x425890(0x8a8,0x8fc,0x51e,0xb41)+_0x425890(0xf3b,0x89f,0x595,0x10fe))+_0x1366c6[_0x17318e(0x116a,0xfd2,0x142c,0xe95)]+(_0x425890(0xfdc,0xa30,0xb99,0x276)+_0x425890(-0x3a7,0x4c0,-0x38,0xd80))+_0x1366c6['ago']+(_0x425890(0xabc,0x39a,0x67c,-0x442)+_0x425890(0x10e3,0x7ff,0x2a3,0x188))+_0x1366c6[_0x17318e(0x428,-0x21a,-0x4c8,0x57e)][_0x425890(0xeeb,0xe82,0x1646,0xbe1)]+_0x17318e(0xd62,0xc75,0x17c7,0x144a)+_0x1366c6[_0x17318e(0x1134,0x100,0x7c6,0x810)]+(_0x425890(0xd1b,0x2f0,-0x5e7,-0x531)+_0x17318e(0x1223,0x4dc,0x1217,0xaba)+'\x0aPOWERD\x20BY'+':\x20\x20')+botname;else{const _0x98f3a3={};_0x98f3a3[_0x17318e(0xadc,0xc0f,0x174f,0x151a)]=null,_0x28ce55[_0x17318e(0x15d0,0x1491,0xb7c,0x11b6)](_0x98f3a3,_0x5e9341[_0x425890(0xc4f,0xcc7,0x479,0x12f0)],[])[_0x17318e(0x7d9,0xc21,0x318,0x3d0)](_0x442cb1=>_0x1dce15(_0xb0fbff(_0x442cb1)))['catch'](_0xdf0a5=>_0x1f18e0(_0x545548(_0xdf0a5)));}}const _0x2b1678={};_0x2b1678[_0x425890(0xade,0x5f3,0x3fe,0x1ae)]=_0x2ddb46['all'][0x1*-0x3ae+-0x2701+0x2aaf][_0x425890(0xcac,0xb36,0x566,0x1d0)];const _0x15f127={};_0x15f127[_0x17318e(-0x38b,-0x31d,0x1ff,0x59e)]=_0x2b1678,_0x15f127['caption']=_0x10d384,_0x3797bd[_0x17318e(0x564,0x419,-0x445,0x63c)+'e'](_0x17aa6d[_0x425890(0x9fa,0xcc7,0x9a8,0x1622)],_0x15f127,{'quoted':_0x17aa6d});}break;case _0x295ea5['yZtFo']:{if(_0x295ea5[_0x425890(0x802,0x13c,-0x154,0xa85)](_0x425890(-0x5a2,0x46a,0x2dc,0xca1),_0x295ea5[_0x17318e(0x7d1,0x12f7,0x1599,0x11a4)])){if(!_0x116129)return _0x295ea5[_0x425890(0xd43,0x32d,-0x13c,-0x62f)](_0xcd1d32,_0x425890(0x20f,0xb08,0x1065,0x1376)+_0x295ea5[_0x425890(0x1834,0xfc7,0x1157,0x1a52)](_0x4fea53,_0x1cbc75)+(_0x17318e(0xeb7,0x88f,0x153d,0xc72)+'a\x20inu'));let _0x385f5b=_0x295ea5['kqUNZ'](require,_0x295ea5[_0x17318e(0x1255,0x1671,0x1ecd,0x17b8)]);const _0x40dafb={};_0x40dafb[_0x17318e(0x13bb,0xb22,0x3f7,0xc16)]=_0x116129,_0x295ea5['yOcwH'](_0x385f5b,_0x40dafb)[_0x425890(0x4cc,0x1b3,0xba8,0x63)](_0x73d5d6=>{function _0x5e842b(_0x4bb5f8,_0xeac454,_0xbf02f0,_0x5198a3){return _0x425890(_0x5198a3,_0x4bb5f8- -0x8d,_0xbf02f0-0x1ea,_0x5198a3-0x58);}function _0x3d1cf3(_0x29e205,_0x5b51d1,_0x11a91b,_0x4aa8a1){return _0x425890(_0x29e205,_0x4aa8a1-0xf8,_0x11a91b-0xb2,_0x4aa8a1-0x7a);}if(_0x295ea5[_0x3d1cf3(0x179,0x12d7,-0xf9,0x84a)]('jXEzO',_0x295ea5[_0x5e842b(0x373,-0x1c0,0x44a,0x468)])){const _0x371407={};_0x371407[_0x5e842b(0x15b,-0x7e6,0x7ec,0x9c2)]=_0x5e842b(0x1364,0x17ac,0xeff,0x1ac3)+_0x5e842b(0x6c8,0x397,0x9,0xa69);const _0x27ab2b={};_0x27ab2b[_0x3d1cf3(0x125c,0x85c,0x1286,0x8ff)]=_0x282b9c,_0x3ab8d6['sendMessag'+'e'](_0x9be3dd,_0x371407,_0x27ab2b);}else{let _0x289c02=_0x5e842b(0x14ed,0x1ef9,0x145e,0x1896)+_0x5e842b(0x735,-0x102,0xf74,0x9b)+':\x20'+_0x116129+'\x0a\x0a';for(let _0x556e93 of _0x73d5d6){_0x289c02+=_0x5e842b(0x526,0x4a4,0xbb0,0xf54)+_0x5e842b(0x772,0xdd0,0x223,0xca7)+_0x556e93[_0x3d1cf3(0x8c3,0x12a7,0x1105,0x10e8)]+'\x0a',_0x289c02+='🔰🌹\x20*Descri'+_0x5e842b(0x59c,0x3bf,0x9d0,0xf94)+_0x556e93[_0x3d1cf3(0x4ec,0x10c6,0x584,0xbb7)]+'\x0a',_0x289c02+='🔰🌹\x20*Link*\x20'+':\x20'+_0x556e93[_0x5e842b(0x36c,0x3aa,-0x333,0xafd)]+('\x0a\x0a────────'+_0x5e842b(0xc5d,0x1667,0x72d,0x72a)+'──────\x0a\x0a');}_0x295ea5[_0x3d1cf3(-0x448,-0x1d7,0xb01,0x62b)](_0xcd1d32,_0x289c02);}});}else{let _0x216b1f=_0x292181[_0x17318e(0x88,0x50b,0x32e,0xa24)][_0x17318e(0x1c84,0x16d8,0x1403,0x17d1)][_0x17318e(0x223,0xca2,0xb46,0xbe9)](_0x295ea5[_0x17318e(0x1bc6,0x1eee,0x204b,0x17c0)]);if(!_0x216b1f)return _0x28ac91(_0x425890(0x92,0x2d5,0x33b,0x98d));if(_0x54b732['db'][_0x425890(0x667,0xad0,0xa45,0x132f)][_0x425890(0x522,0xe57,0x502,0xb2d)][_0x216b1f]&&_0x3791f7['db'][_0x17318e(0xc96,0x1390,0xab8,0xced)][_0x425890(0x9e4,0xe57,0xf66,0xa0e)][_0x216b1f][_0x17318e(0x13ce,0xd72,0x805,0xc97)])return _0x295ea5[_0x425890(0xf8,0x4c8,0xa7,-0x3f)](_0x2f41c2,_0x425890(0xa1f,0x6df,0x39e,0x1e6)+_0x17318e(0x13e4,0x151e,0x1332,0x10fa)+_0x17318e(0x1395,0x1b18,0x12ae,0x172e)+_0x17318e(0x1b7f,0x171a,0x860,0x119e)+_0x17318e(0x101e,0x1d8d,0x171e,0x176a)+'and');delete _0x3866b9['db'][_0x425890(0x489,0xad0,0xa1,0x14dc)]['sticker'][_0x216b1f],_0x4634c6(_0x17318e(0x8ae,0xfeb,0x18ef,0xfff));}}break;case _0x295ea5[_0x17318e(0x78e,0xf4,0x717,0x8aa)]:case _0x295ea5[_0x425890(0x801,0x10fa,0x1b18,0x1551)]:{if(!_0x116129)return _0x295ea5['yukgT'](_0xcd1d32,_0x425890(0x9ca,0xb08,0x757,0x5b1)+_0x295ea5['AtHKf'](_0x4fea53,_0x1cbc75)+_0x425890(0xe3f,0x125d,0x15e1,0x1aba));let _0x32ea99=require(_0x295ea5['thhOl']);_0x295ea5[_0x17318e(0x10ae,0xc0,0x372,0x67c)](_0x32ea99,_0x116129,async(_0x563a37,_0x364f87)=>{n=_0x364f87,images=n[Math['floor'](_0x295ea5[_0x375e42(0xd56,0xcdf,0xdd6,0x7b7)](Math[_0x375e42(0x60c,0xc60,0x810,0x1136)](),n['length']))][_0x35c169(0x62a,0xde,0xa6e,0x4ac)];const _0x3f3e81={};_0x3f3e81[_0x35c169(0x10d7,0x957,0xa27,0x1619)+'t']=_0x375e42(0xd6e,0x11dd,0x796,0x1549)+_0x375e42(0xed8,0x12fb,0x1775,0x1830);const _0x3c89b7={};_0x3c89b7['buttonId']=_0x35c169(0x1450,0x1ab2,0x1c24,0x18b8)+_0x116129;function _0x375e42(_0xf26131,_0x5273a9,_0x20dd64,_0x399737){return _0x425890(_0x20dd64,_0x5273a9-0x332,_0x20dd64-0x159,_0x399737-0x1c);}_0x3c89b7[_0x375e42(0x1b41,0x142d,0x1282,0x1e2b)]=_0x3f3e81,_0x3c89b7[_0x375e42(0xfc9,0x174d,0x1fe3,0x1a70)]=0x1;let _0x1981f0=[_0x3c89b7];const _0x24996e={};_0x24996e['url']=images;const _0x3a3acb={};_0x3a3acb[_0x375e42(0x5e,0x6b3,0x49d,0x10d1)]=_0x24996e,_0x3a3acb[_0x35c169(0x341,-0x30f,0xa6e,0x27b)]='*-------「\x20'+_0x375e42(0x1867,0x1244,0xa05,0xce8)+'RCH\x20」-----'+_0x35c169(0x738,0x508,-0xa4,-0x30)+_0x35c169(0x13ea,0x1d45,0x181b,0xf51)+_0x116129+(_0x375e42(0x1230,0x196e,0x1f9c,0x1864)+_0x375e42(0x10c1,0x1561,0xe96,0xcaa))+images;function _0x35c169(_0x3d8eb1,_0x595052,_0x17c6fb,_0x3f6408){return _0x17318e(_0x3d8eb1-0x38,_0x3f6408,_0x17c6fb-0xe5,_0x3d8eb1- -0x1e6);}_0x3a3acb[_0x375e42(0x8cf,0x6ac,-0x31,-0x1e5)]=_0x3797bd[_0x35c169(0x10f5,0x709,0x1192,0x1682)][_0x375e42(0x1436,0x11b4,0xeb3,0x12d8)],_0x3a3acb[_0x35c169(0xf98,0x18c8,0xedb,0xd37)]=_0x1981f0,_0x3a3acb[_0x375e42(0xb65,0x1321,0xabd,0x1a91)]=0x4;let _0x3f6145=_0x3a3acb;_0x3797bd['sendMessag'+'e'](_0x17aa6d[_0x35c169(0xcfe,0xe0f,0x3f1,0x70f)],_0x3f6145,{'quoted':_0x17aa6d});});}break;case _0x295ea5[_0x425890(0x1900,0x150f,0x1cf5,0x1e36)]:case _0x295ea5[_0x17318e(0x1c75,0x1180,0x1515,0x1500)]:case _0x295ea5[_0x17318e(0x83f,0xef6,0xfe5,0x951)]:{if(!_0x116129)return _0x295ea5[_0x425890(0x86e,0x7d1,0x6d0,0xbdc)](_0xcd1d32,'Example\x20:\x20'+(_0x4fea53+_0x1cbc75)+_0x17318e(0x6c9,0x14b2,0x133d,0x10b7));let _0x565683=_0x295ea5[_0x425890(-0x39e,0x521,-0x2bf,0x4ae)](require,_0x295ea5['SOcZp']),_0x5dd549=await _0x565683(_0x116129),_0x15caae=_0x5dd549[_0x17318e(0xbd3,0xc9b,0x425,0x9ba)][Math[_0x425890(0x1e1e,0x1415,0x1523,0xf2a)](_0x295ea5[_0x17318e(0x516,0x1365,0x78c,0xea5)](Math[_0x425890(0xda8,0x92e,0xdf4,0xb8b)](),_0x5dd549[_0x17318e(0xc0b,0x7a3,0x684,0x9ba)][_0x425890(0x36e,0x8bc,0xf8e,-0xca)]))];const _0x46b1f3={};_0x46b1f3[_0x17318e(0x15f7,0x1057,0x10af,0x12bd)+'t']=_0x295ea5[_0x17318e(0x1308,0x1bb9,0x1a76,0x180f)];const _0x1dd477={};_0x1dd477[_0x17318e(0xe2a,0x1a30,0xf45,0x1194)]='ytmp3btn\x20'+_0x15caae[_0x425890(0xa31,0x5f3,-0x2b7,0x6ce)],_0x1dd477[_0x425890(0x1b50,0x10fb,0xa68,0x10ec)]=_0x46b1f3,_0x1dd477[_0x425890(0x1044,0x141b,0x13d5,0xc7e)]=0x1;const _0x3a8cbe={};_0x3a8cbe['displayTex'+'t']=_0x295ea5['jJzSY'];const _0x2454dd={};_0x2454dd['buttonId']=_0x425890(0xe04,0x7f2,0x4fd,0xe7f)+_0x15caae[_0x425890(0xb09,0x5f3,0x98,0x3e6)],_0x2454dd[_0x425890(0x15fd,0x10fb,0xb23,0xa3d)]=_0x3a8cbe,_0x2454dd[_0x425890(0x1bef,0x141b,0x1395,0x16aa)]=0x1;let _0x9cc4a0=[_0x1dd477,_0x2454dd];const _0x4d26b6={};_0x4d26b6['url']=_0x15caae[_0x17318e(0xa1c,0x933,0x12c2,0xd53)];const _0x2dd476={};_0x2dd476[_0x425890(0x442,0x381,0x93,0x1de)]=_0x4d26b6,_0x2dd476[_0x425890(0xad8,0x30a,0x4fa,0x299)]=_0x425890(0x4fc,0xdb5,0x925,0xc3c)+_0x17318e(0x10d6,0x1612,0x198f,0xfd2)+'\x0a╠🤓\x20*ᴘᴏᴡᴇʀ'+_0x17318e(0x107b,0x4f,0x96f,0x735)+_0x17318e(0x903,0xb95,0x1370,0x9fb)+_0x17318e(-0x4f9,0x2d4,-0x5d2,0x3b3)+_0x425890(0xd36,0x3c5,0x495,0x6a2)+_0x15caae[_0x17318e(0x1315,0x125c,0x1012,0x120d)]+(_0x425890(0x11cc,0x133d,0x159e,0x17e4)+_0x17318e(0x13e6,0x16c7,0xbe9,0x120a))+_0x15caae[_0x425890(-0x73,0x361,0x529,0x8b3)][_0x17318e(0xbc2,0x8,0x6ef,0x810)]+(_0x17318e(0x678,0x12d0,0x8cd,0x90f)+'\x20:\x20')+_0x15caae[_0x425890(0x96e,0x361,0x134,0xa59)][_0x17318e(0x1b32,0x957,0x986,0x109f)]+_0x425890(0x29e,0x57f,0x77c,0x9d)+_0x15caae[_0x17318e(0xf15,0x1261,0xb88,0xa7b)]+('\x0a╠💡\x20Durati'+_0x17318e(0x107,0x10f9,0xb68,0xabc))+_0x15caae[_0x425890(0x790,0xc78,0x424,0x338)]+(_0x17318e(0x1902,0xe6a,0x1421,0x1274)+_0x425890(0xd63,0x7ff,0xe1a,0xa6d))+_0x15caae['views']+('\x0a╠📤\x20Upload'+_0x17318e(0x35a,0x59,-0x15d,0x6dd))+_0x15caae[_0x17318e(0x1dbc,0x17ee,0x1cd5,0x1720)]+(_0x425890(0x45f,0xefb,0x13d3,0xdb1)+_0x17318e(0x1d4e,0x13d3,0x116c,0x153f))+_0x15caae[_0x425890(-0x72,0x26b,0x965,0x3b8)+'n']+_0x17318e(0x19a0,0x1056,0x20f4,0x16de)+_0x15caae[_0x425890(0x861,0x5f3,0x1019,0x9db)],_0x2dd476[_0x425890(0x8a8,0x37a,-0x1ec,0x4d0)]=_0x3797bd[_0x425890(0x1a8f,0x10be,0xfaf,0x1241)]['name'],_0x2dd476[_0x17318e(0x7e6,0x184d,0x1070,0x117e)]=_0x9cc4a0,_0x2dd476[_0x17318e(0xca1,0x1560,0x1744,0x120c)]=0x4;let _0x512581=_0x2dd476;_0x3797bd['sendMessag'+'e'](_0x17aa6d[_0x17318e(0x1153,0x85e,0x10bc,0xee4)],_0x512581,{'quoted':_0x17aa6d});}break;case _0x295ea5[_0x425890(-0x2c5,0x5a5,0xbd3,0xe47)]:{let {yta:_0x15c1ce}=_0x295ea5['dGgRe'](require,_0x295ea5[_0x425890(-0xbc,0x59f,0xbd9,0x7a)]);if(!_0x116129)return _0x295ea5[_0x17318e(0x12ac,0x89,0xe14,0x92c)](_0xcd1d32,_0x425890(0xa62,0xb08,0xe98,0x686)+_0x295ea5[_0x425890(0x192c,0x1283,0x1a20,0x11dd)](_0x4fea53,_0x1cbc75)+'\x20'+global[_0x425890(-0x66,0x113,-0x4b9,-0x2bd)]+_0x425890(0x19fa,0x1435,0xe9d,0x1452));let _0x2c0858=_0x52a010[0xb1*-0x35+-0x5d4+0x2a7a]?_0x52a010[-0x1e56*0x1+-0x1f49*-0x1+0x16*-0xb]:_0x295ea5[_0x425890(0x1747,0xd91,0xc94,0x14c8)],_0x237989=await _0x295ea5[_0x425890(0x366,0x30d,0x2bf,-0x71b)](_0x15c1ce,_0x116129,_0x2c0858);if(_0x295ea5[_0x17318e(0x250,0x550,0xa73,0x766)](_0x237989['filesize'],0x3ad11*-0x3+0xa586b+0xff107))return _0x295ea5[_0x425890(0xbec,0xd30,0x444,0x1724)](_0xcd1d32,_0x295ea5[_0x425890(0x7ea,0x87b,0x1240,0x8ad)]+util['format'](_0x237989));const _0x35df67={};_0x35df67[_0x17318e(0x1146,0xd13,0xc36,0x12bd)+'t']=_0x295ea5[_0x425890(0xc9e,0xf57,0x1007,0x1427)];const _0x59251b={};_0x59251b[_0x17318e(0xeca,0x11b6,0x1bf3,0x1194)]=_0x17318e(0x1983,0x117d,0x1829,0x145b)+_0x116129,_0x59251b['buttonText']=_0x35df67,_0x59251b[_0x17318e(0x1919,0x1e54,0x1447,0x1638)]=0x1;const _0x2c06fd={};_0x2c06fd[_0x17318e(0x1a30,0xb2e,0x10b6,0x12bd)+'t']=_0x17318e(0x9cc,0x6e3,0x96a,0xcd2)+_0x17318e(0x696,0xe1b,0x7c9,0x8c6);const _0x5d0a8e={};_0x5d0a8e['buttonId']='ytdoc\x20'+_0x116129,_0x5d0a8e[_0x425890(0xc76,0x10fb,0xd0a,0x1ac9)]=_0x2c06fd,_0x5d0a8e[_0x425890(0x13ff,0x141b,0x1e3e,0x13e4)]=0x1;const _0x47ff5a={};_0x47ff5a[_0x425890(0x17ea,0x10a0,0x171a,0xda1)+'t']=_0x295ea5[_0x17318e(0x1123,-0x3f1,0x27d,0x6ac)];const _0x5cde07={};_0x5cde07['buttonId']=_0x17318e(0x6f6,0x40e,0xac6,0xe6c)+_0x116129,_0x5cde07['buttonText']=_0x47ff5a,_0x5cde07['type']=0x1;let _0x404da3=[_0x59251b,_0x5d0a8e,_0x5cde07];const _0x5d02c2={};_0x5d02c2[_0x17318e(0x1234,0x1c4,-0x16f,0x810)]=_0x237989['thumb'];const _0x132456={};_0x132456[_0x425890(0x6fc,0x381,0xa22,0x561)]=_0x5d02c2,_0x132456[_0x17318e(0x89a,0x45e,0x8f9,0x527)]=_0x17318e(0xcbf,0x1837,0xc24,0x11eb)+_0x425890(0xcf5,0xb13,0x512,0x2a4)+_0x425890(0x1f5,0x50f,0xf2a,-0x56f)+_0x425890(0x8c2,0x12d8,0x149a,0x1201)+_0x425890(0x1467,0xea7,0x188c,0x14d0)+_0x237989['title'],_0x132456[_0x425890(-0x52e,0x37a,0xc09,0x649)]=_0x3797bd[_0x17318e(0xf56,0xbcf,0x117b,0x12db)][_0x425890(0x533,0xe82,0x16c3,0xf45)],_0x132456['buttons']=_0x404da3,_0x132456['headerType']=0x4;let _0x55313a=_0x132456;_0x3797bd[_0x17318e(0x3b7,0x9a4,0x841,0x63c)+'e'](_0x17aa6d[_0x17318e(0x175c,0x475,0xcef,0xee4)],_0x55313a,{'quoted':_0x17aa6d});}break;case _0x295ea5[_0x17318e(0x77f,0xf04,0x56e,0xf96)]:{let {yta:_0x18caf1}=_0x295ea5[_0x425890(0x1286,0xeea,0x6e3,0x178e)](require,'./lib/y2ma'+'te');if(!_0x116129)return _0x295ea5[_0x17318e(0x12ca,0xc3c,0x1d5a,0x1561)](_0xcd1d32,_0x17318e(0x10cd,0x343,0x10d8,0xd25)+_0x295ea5[_0x425890(0x6d,0x208,-0x16a,-0x4c9)](_0x4fea53,_0x1cbc75)+'\x20'+global[_0x425890(0x1d3,0x113,-0x440,0x1b8)]+_0x17318e(0xe99,0xdb7,0x1357,0x1652));let _0x30e975=_0x52a010[0x11fb+0x17dd+0x29d7*-0x1]?_0x52a010[0x5b9+-0x3f8*0x2+0x238]:_0x295ea5['aJwke'],_0x409096=await _0x18caf1(_0x116129,_0x30e975);if(_0x295ea5[_0x17318e(0x1dbf,0x1292,0x1a15,0x1805)](_0x409096[_0x425890(0x30e,0x52b,0x582,0x167)],0x1aeb3a+0x6*-0x2e525+0x1*0x5b5e3))return _0x295ea5[_0x425890(0x156d,0x1560,0x1b21,0x16ff)](_0xcd1d32,_0x295ea5[_0x17318e(0x1734,0x1562,0x1aa4,0x119f)](_0x295ea5['PlElw'],util[_0x17318e(0x1136,0x1f4e,0x1c75,0x1508)](_0x409096)));const _0x32c91f={};_0x32c91f[_0x425890(0xf2b,0x5f3,-0x9,0x393)]=_0x409096['dl_link'];const _0xe5629f={};_0xe5629f[_0x17318e(0x64e,0x1317,0x87e,0x1092)]=_0x32c91f,_0xe5629f[_0x17318e(0xf32,0x1678,0x19d7,0x101b)]=_0x295ea5['uNJpp'],_0xe5629f[_0x425890(0x14b8,0xd04,0x742,0x756)]=_0x409096[_0x425890(0x936,0xff0,0x14db,0x1011)]+_0x425890(0x97d,0x740,0xe32,-0x34b),_0x3797bd[_0x17318e(-0x1f5,0x241,-0x230,0x63c)+'e'](_0x17aa6d[_0x17318e(0x114c,0xdd9,0xa01,0xee4)],_0xe5629f,{'quoted':_0x17aa6d});}break;case _0x295ea5['ltKEf']:{let {yta:_0x41f438}=_0x295ea5[_0x425890(0x8a9,0x9f1,0x705,0x222)](require,'./lib/y2ma'+'te');if(!_0x116129)return _0xcd1d32(_0x17318e(0xf9b,0xc23,0x156b,0xd25)+(_0x4fea53+_0x1cbc75)+'\x20'+global[_0x425890(0x4b0,0x113,-0x732,-0xbd)]+_0x425890(0x1517,0x1435,0x161f,0x1cb0));let _0xfcea03=_0x52a010[0x1fe7+0xc44+-0x1615*0x2]?_0x52a010[0x1*0xbf5+-0x1*-0x10cd+-0x1cc1]:_0x295ea5[_0x425890(0x949,0xd91,0x11ac,0x104f)],_0xa948d8=await _0x295ea5[_0x425890(0x172f,0x15ca,0x1a5e,0x1f9c)](_0x41f438,_0x116129,_0xfcea03);if(_0x295ea5[_0x425890(0x11f0,0x7c8,0xc29,0xe52)](_0xa948d8['filesize'],0x77*-0xfdf+0x25*0x3369+0xf34bb))return _0x295ea5[_0x17318e(0x134,0x11fa,0x298,0xa91)](_0xcd1d32,_0x295ea5[_0x17318e(0x916,0x3b9,0x681,0xa98)]+util[_0x17318e(0x12eb,0x1902,0x1510,0x1508)](_0xa948d8));const _0xba6fa5={};_0xba6fa5[_0x17318e(0x7af,0xb1d,0xb4e,0x810)]=_0xa948d8[_0x17318e(0x853,0x14d5,0x65f,0xb08)];const _0x17b536={};_0x17b536['document']=_0xba6fa5,_0x17b536['mimetype']=_0x295ea5['uNJpp'],_0x17b536[_0x425890(0x11a0,0xd04,0x6da,0x534)]=_0xa948d8[_0x17318e(0xe16,0xeb9,0x9fc,0x120d)]+'.mp3',_0x3797bd[_0x17318e(-0x1e8,0xd57,0x569,0x63c)+'e'](_0x17aa6d['chat'],_0x17b536,{'quoted':_0x17aa6d});}break;case _0x295ea5['uUpdw']:{if(_0x295ea5['jHZrC'](_0x295ea5[_0x17318e(0x10b3,0x10d1,0x154a,0xe61)],_0x295ea5[_0x425890(0x120f,0xc44,0xf63,0xfa3)])){const _0x4580b2={};_0x4580b2['text']=_0x17318e(0x10d6,0x1a32,0x1c38,0x15e3)+_0x425890(0x79d,0xbb2,0xcf1,0x1489);const _0x1c7781={};_0x1c7781['quoted']=_0x2aa725,_0x155be7[_0x17318e(-0x426,0xbd0,0x9bc,0x63c)+'e'](_0x2946e6,_0x4580b2,_0x1c7781);}else{let {yta:_0x3ac624}=_0x295ea5['CQLMc'](require,_0x295ea5[_0x425890(0xf3e,0x59f,-0x149,0xeb9)]);if(!_0x116129)return _0x295ea5['JRfLV'](_0xcd1d32,_0x17318e(0xf06,0x5c7,0x1040,0xd25)+_0x295ea5[_0x17318e(0x74c,0x16da,0xb56,0x10f5)](_0x4fea53,_0x1cbc75)+'\x20'+global['btnurl']+'\x20128kbps');let _0x457256=_0x52a010[0x3*-0x665+-0xbe1*-0x1+-0x1*-0x74f]?_0x52a010[0x1849*0x1+0x1b55+-0xb5*0x49]:_0x425890(-0x139,0x4f9,-0x12,0x116),_0x40c7c6=await _0x295ea5['KHIoL'](_0x3ac624,_0x116129,_0x457256);if(_0x295ea5['tQZTd'](_0x40c7c6[_0x17318e(0xa0c,0xa,0x9c8,0x748)],0xc242c+0x64b9b*0x4+-0xd*0x1b27d))return _0xcd1d32(_0x295ea5[_0x17318e(0xc33,0xe17,0x1787,0x15e1)](_0x295ea5[_0x425890(0x47e,0x87b,0x1039,0x6ae)],util[_0x17318e(0x1143,0x1cc8,0x1083,0x1508)](_0x40c7c6)));const _0x49fd05={};_0x49fd05[_0x17318e(0xefe,0x82b,0x9d7,0x810)]=_0x40c7c6['dl_link'];const _0x1a7744={};_0x1a7744[_0x425890(0x5d9,0xe75,0x14b7,0x848)]=_0x49fd05,_0x1a7744[_0x425890(0xa4a,0xdfe,0x1585,0x1083)]=_0x17318e(0x1889,0x1495,0xc32,0x14aa),_0x1a7744[_0x425890(0x14a2,0xd04,0x357,0x39c)]=_0x40c7c6[_0x425890(0x1673,0xff0,0x7f8,0x16bb)]+_0x425890(0x348,0x740,0x404,0x89e),_0x1a7744[_0x425890(0x11b5,0x155e,0x1b7d,0x1b1f)]=!![],_0x3797bd[_0x17318e(0x227,0x3c0,0xa51,0x63c)+'e'](_0x17aa6d[_0x17318e(0xf37,0xced,0x15ad,0xee4)],_0x1a7744,{'quoted':_0x17aa6d});}}break;case _0x295ea5[_0x425890(0x8e0,0x76c,0x95e,0x84e)]:case _0x295ea5[_0x425890(0x10b1,0xf0c,0xe10,0x511)]:case _0x425890(0xdd2,0x11d4,0x1828,0x1491):{let {yta:_0x146853}=_0x295ea5[_0x17318e(0x98b,0x1394,0x1940,0xfd6)](require,_0x295ea5['smCJb']);if(!_0x116129)return _0x295ea5[_0x17318e(0xdfc,0x79e,0x8c9,0x699)](_0xcd1d32,_0x425890(0x122a,0xb08,0xf04,0x304)+(_0x4fea53+_0x1cbc75)+'\x20'+global[_0x17318e(0x182,0x69b,0x3c5,0x330)]+_0x425890(0x9e4,0x1435,0x1cdb,0x1905));let _0xbdd752=_0x52a010[0x25ab+0x258b*-0x1+-0x1f]?_0x52a010[0x1f*0x14+0x2345+-0x25b0]:_0x295ea5[_0x17318e(0x561,0x10ce,0x58e,0xfae)],_0xf43120=await _0x295ea5[_0x425890(0xa3d,0x12e5,0x17e0,0xcf5)](_0x146853,_0x116129,_0xbdd752);if(_0x295ea5[_0x425890(0x605,0x549,-0x3ee,0x28d)](_0xf43120[_0x17318e(0x1eb,0x4d1,0x5f3,0x748)],-0x121ea+0x2d532+0xd8ef7))return _0xcd1d32(_0x295ea5[_0x425890(-0x71,0x87b,0x11d9,0xce0)]+util[_0x17318e(0x12be,0x1447,0x12e9,0x1508)](_0xf43120));const _0x4b2076={};_0x4b2076['displayTex'+'t']=_0x17318e(0x376,0x6a6,0x5d1,0xc78)+_0x425890(0xf3a,0x12ec,0x12e8,0xc38);const _0x5cbf00={};_0x5cbf00['buttonId']=_0x425890(0x1836,0x123e,0x162f,0x17df)+_0x116129,_0x5cbf00[_0x425890(0x140c,0x10fb,0x1180,0xcc8)]=_0x4b2076,_0x5cbf00[_0x17318e(0x15d0,0x17e5,0xfc8,0x1638)]=0x1;const _0x54c8a6={};_0x54c8a6[_0x425890(0x14e2,0x10a0,0xfac,0xd5a)+'t']=_0x295ea5[_0x17318e(0xda4,0x76a,0x994,0xff0)];const _0x31e26b={};_0x31e26b[_0x17318e(0x156d,0x172f,0x148d,0x1194)]=_0x425890(0x1020,0x1487,0x172c,0x1afe)+_0x116129,_0x31e26b['buttonText']=_0x54c8a6,_0x31e26b[_0x425890(0x1a6c,0x141b,0xf96,0xc6c)]=0x1;const _0x3701c5={};_0x3701c5[_0x17318e(0x867,0x1564,0x10fb,0x12bd)+'t']=_0x295ea5['BKdQu'];const _0x526c96={};_0x526c96['buttonId']=_0x425890(0x6b7,0xc4f,0x1615,0xd6c)+_0x116129,_0x526c96[_0x17318e(0xfd8,0xe4b,0x1288,0x1318)]=_0x3701c5,_0x526c96[_0x17318e(0x188d,0x1a31,0x20b6,0x1638)]=0x1;let _0x34abb1=[_0x5cbf00,_0x31e26b,_0x526c96];const _0x5757fc={};_0x5757fc[_0x17318e(0xf8,-0x173,0xf0e,0x810)]=_0xf43120[_0x425890(0x74a,0x4e9,-0x18f,0x43b)];let _0x51a7a6={'image':_0x5757fc,'caption':_0x17318e(-0x5af,0x2eb,0x819,0x4d0)+botname+('\x0a║\x0a╠🧸\x20Titl'+_0x17318e(0x1f1e,0x196b,0x1cb2,0x1482))+_0xf43120['title']+(_0x425890(0x1246,0xcd2,0x14bf,0x1324)+_0x17318e(0x1bf7,0x1637,0xfe0,0x1807))+_0xf43120[_0x17318e(0x272,-0x14f,0xd5a,0x6d0)]+_0x17318e(0x1aa8,0x1ed7,0x1a7f,0x16de)+_0x295ea5['DWIZD'](isUrl,_0x116129)+('\x0a╠🪣\x20Ext\x20:\x20'+_0x425890(0x18a3,0xf8a,0xa81,0xd15)+_0x17318e(0xe01,0x1965,0x11b7,0xf74))+(_0x52a010[-0x5*0xcf+-0x350+-0xc*-0x9d]||'320kbps')+('\x0a║\x0a╠\x20*ᴘᴏᴡᴇ'+_0x425890(0x8bf,0x1301,0x1359,0x13ca)+'*ʀᴇᴅ-ᴅʀᴀɢᴏ'+_0x17318e(0x90a,0x94f,0xc5f,0x1116)),'footer':_0x3797bd[_0x425890(0x932,0x10be,0x1299,0x19da)][_0x17318e(0x15a9,0x1a8a,0x15d4,0x109f)],'buttons':_0x34abb1,'headerType':0x4};_0x3797bd[_0x425890(-0x5b4,0x41f,0xc4e,0xae3)+'e'](_0x17aa6d[_0x425890(0x39e,0xcc7,0x27b,0xed8)],_0x51a7a6,{'quoted':_0x17aa6d});}break;case _0x295ea5[_0x17318e(0xd23,0x178c,0xd33,0x1667)]:case _0x295ea5[_0x17318e(0x70e,0x11c6,0xff2,0xb56)]:case _0x295ea5[_0x425890(0x1746,0x125f,0x8fb,0x1306)]:{let {ytv:_0x2ddaa8}=_0x295ea5[_0x425890(0x1bff,0x11b0,0x74d,0x882)](require,_0x425890(0x195d,0xf47,0x122d,0x16d1)+'te');if(!_0x116129)return _0xcd1d32(_0x17318e(0x772,0x51b,0xb86,0xd25)+_0x295ea5[_0x17318e(0x300,0xa4a,0x581,0xa52)](_0x4fea53,_0x1cbc75)+'\x20'+global[_0x425890(0xb63,0x113,-0x96c,0x221)]+_0x17318e(0x11d1,-0x261,-0x8a,0x776));let _0x7f7614=_0x52a010[-0x9*-0x33f+0x39+-0x1d6f]?_0x52a010[0x1a77+-0x56c*-0x2+-0xbf*0x32]:_0x425890(0xf64,0x109a,0x849,0xb22),_0x296be2=await _0x295ea5[_0x17318e(0x1182,0x175f,0x183b,0x16ff)](_0x2ddaa8,_0x116129,_0x7f7614);if(_0x296be2[_0x425890(0x97f,0x52b,0x82a,0xc5e)]>=0x62d2f*-0x3+0x205b*0x13+-0x157*-0x176d)return _0x295ea5[_0x17318e(0xa7a,0x62d,0x174b,0xfbb)](_0xcd1d32,_0x295ea5[_0x425890(0x6bb,0xb88,0x130,0x137)](_0x295ea5[_0x17318e(0x18aa,0xc69,0x1c0b,0x141c)],util[_0x425890(0xa39,0x12eb,0x1c43,0x10ff)](_0x296be2)));const _0x304190={};_0x304190[_0x17318e(0x1772,0xa29,0x1d0c,0x12bd)+'t']=_0x17318e(0xa19,0xfba,0x1226,0xbdd)+_0x17318e(0x1949,0x1709,0x6b6,0x1078);const _0x30c58b={};_0x30c58b['buttonId']=_0x17318e(0xbbc,-0x459,0x87a,0x5b9)+_0x116129,_0x30c58b['buttonText']=_0x304190,_0x30c58b['type']=0x1;const _0x5ca2d1={};_0x5ca2d1[_0x17318e(0x171a,0x1190,0xb28,0x12bd)+'t']=_0x295ea5[_0x425890(0x1637,0x106f,0x1921,0x19aa)];const _0x384334={};_0x384334[_0x17318e(0x1519,0x12c6,0x158f,0x1194)]='yt480\x20'+_0x116129,_0x384334[_0x17318e(0x1966,0xcd5,0x100d,0x1318)]=_0x5ca2d1,_0x384334[_0x425890(0xe7a,0x141b,0x13b7,0x1068)]=0x1;const _0x377795={};_0x377795[_0x17318e(0x12c7,0x1b7f,0xd52,0x12bd)+'t']=_0x295ea5['sfbBQ'];const _0xd198c={};_0xd198c[_0x17318e(0x1b8c,0x172b,0x16e7,0x1194)]=_0x17318e(0x41a,0xd9d,0x1ac,0x3e9)+_0x116129,_0xd198c['buttonText']=_0x377795,_0xd198c[_0x17318e(0xc39,0x1114,0x1e78,0x1638)]=0x1;let _0x2a5f7f=[_0x30c58b,_0x384334,_0xd198c];const _0x4eca11={};_0x4eca11[_0x17318e(0xe0b,0x816,0xf90,0x810)]=_0x296be2['thumb'];let _0x1a3e90={'image':_0x4eca11,'caption':_0x425890(0x111,0x2b3,0x7ec,-0x18d)+botname+('\x0a║\x0a╠🧸\x20Titl'+_0x425890(0xc89,0x1265,0x116a,0x19a5))+_0x296be2[_0x425890(0x169c,0xff0,0xa92,0x60a)]+_0x425890(0x18ef,0x14c1,0xc58,0xd7c)+isUrl(_0x116129)+(_0x425890(0x1957,0xee9,0x1018,0x10ee)+_0x425890(0x1872,0xf35,0x117e,0x619)+_0x425890(0x1b73,0x1183,0x1220,0x1613)+_0x17318e(0xbc1,0xe4d,0xba8,0x1262)+_0x17318e(0x7c8,0x1ad1,0x12d3,0x1252)+'\x0a╠📥\x20*👇Sele'+_0x425890(0xd17,0x4e5,0x931,-0x3a3)+_0x17318e(0x81b,0x65,0x68c,0x368)),'footer':_0x3797bd[_0x17318e(0x1bd1,0x18ad,0xf41,0x12db)][_0x17318e(0x17d0,0x1302,0x9ad,0x109f)],'buttons':_0x2a5f7f,'headerType':0x4};_0x3797bd[_0x425890(0x716,0x41f,-0x4ef,0x54e)+'e'](_0x17aa6d[_0x425890(0x711,0xcc7,0xdfd,0xb4f)],_0x1a3e90,{'quoted':_0x17aa6d});}break;case _0x295ea5['afzQH']:{let {ytv:_0x3d333a}=_0x295ea5[_0x17318e(0xb13,0x106d,0xe55,0x11b4)](require,_0x295ea5[_0x17318e(0x96f,0x8fd,-0x102,0x7bc)]);if(!_0x116129)return _0xcd1d32(_0x17318e(0x1287,0xaae,0x7e1,0xd25)+_0x295ea5[_0x17318e(0x142d,0xf9f,0x1928,0x1739)](_0x4fea53,_0x1cbc75)+'\x20'+global['btnurl']+_0x17318e(0xe3f,0x86a,0x950,0x776));let _0x3bff07=_0x52a010[-0x1442*0x1+0x1edf+-0xa9c]?_0x52a010[-0x78d*0x1+-0x1f23+0x7*0x587]:_0x295ea5[_0x17318e(0x126d,0xdaf,0x1076,0xd1d)],_0x3fbc5e=await _0x295ea5['SMTqh'](_0x3d333a,_0x116129,_0x3bff07);if(_0x295ea5[_0x425890(0x315,0x549,0xd77,-0xd8)](_0x3fbc5e[_0x425890(-0x195,0x52b,0xb1b,-0xe5)],0xd09c3*-0x1+0xc09c9+0x104239))return _0x295ea5[_0x17318e(0x36a,0x1031,0x11bc,0x87f)](_0xcd1d32,_0x295ea5[_0x17318e(0xe80,0xd22,0x93c,0xffb)](_0x295ea5[_0x17318e(0x11f4,0xa19,0x1286,0x13ac)],util[_0x425890(0xd1d,0x12eb,0xc66,0xae9)](_0x3fbc5e)));const _0x2b60d4={};_0x2b60d4[_0x425890(0x99,0x5f3,0xa75,0x784)]=_0x3fbc5e[_0x425890(0x878,0x8eb,0x520,0xe76)];const _0x1b6185={};_0x1b6185[_0x17318e(0x15ed,0x1cd3,0xe92,0x16dc)]=_0x2b60d4,_0x1b6185[_0x17318e(0x175b,0xf9c,0x18a8,0x101b)]=_0x295ea5[_0x425890(0x339,0xcce,0x60f,0x1161)],_0x1b6185['fileName']=_0x3fbc5e[_0x425890(0x777,0xff0,0x18df,0x1a18)]+_0x425890(0x3ae,0x93a,0xc83,0xa04),_0x1b6185['caption']=_0x17318e(0x67b,0x2c3,0x1237,0x7e0)+'\x20'+_0x3fbc5e['title']+('\x0a╠📂\x20File\x20S'+_0x425890(0xc22,0x15ea,0x15e2,0x1685))+_0x3fbc5e[_0x17318e(0x6fb,0xe3f,0x9e2,0x6d0)]+(_0x425890(0x3b0,0xb8e,0xba0,0x1363)+'tion\x20:\x20')+(_0x52a010[0x179*-0xd+0x2b*-0x85+0x297d]||_0x295ea5[_0x425890(0x178,0xb00,0xe24,0x70c)])+(_0x425890(-0x549,0x47e,0x931,-0x1d4)+_0x17318e(0x1555,0x13a3,0x1628,0x14b0)+_0x17318e(0x6ea,0xe6d,0xe55,0xd71)+'ᴏɴ-ʙᴏᴛ*'),_0x3797bd[_0x425890(0x137,0x41f,0xb91,-0x1b5)+'e'](_0x17aa6d['chat'],_0x1b6185,{'quoted':_0x17aa6d});}break;case _0x295ea5[_0x17318e(0x680,-0x29b,0xfa3,0x754)]:{let {ytv:_0x3d2bcf}=_0x295ea5[_0x17318e(0xcb3,0xedd,0xc7,0x691)](require,_0x295ea5[_0x17318e(0x83d,0x15e,0x5c2,0x7bc)]);if(!_0x116129)return _0xcd1d32('Example\x20:\x20'+_0x295ea5['dVltS'](_0x4fea53,_0x1cbc75)+'\x20'+global[_0x425890(-0x50b,0x113,0x420,0x76b)]+_0x425890(0xd69,0x1256,0x1790,0xcc9));let _0x34d0e6=_0x52a010[0x1be6+0x2056+0x1*-0x3c3b]?_0x52a010[0x9fd+0x1927+-0x707*0x5]:_0x17318e(0x9c9,0x16ce,0x3c4,0xcbf),_0x2d7d0c=await _0x3d2bcf(_0x116129,_0x34d0e6);if(_0x2d7d0c['filesize']>=-0x73a36+0x6838a+-0x552f9*-0x3)return _0x295ea5[_0x425890(0x1075,0xc48,0x14a5,0x200)](_0xcd1d32,_0x295ea5[_0x425890(0x13ae,0xf40,0x1780,0x78f)](_0x295ea5[_0x17318e(0x1819,0x1210,0xd4b,0x13ac)],util[_0x17318e(0x146d,0x1269,0xeb0,0x1508)](_0x2d7d0c)));const _0x54f5a6={};_0x54f5a6['url']=_0x2d7d0c[_0x425890(0x1be,0x8eb,0x9cc,0x1073)];const _0x1ff59b={};_0x1ff59b['video']=_0x54f5a6,_0x1ff59b[_0x425890(0x1456,0xdfe,0x127b,0x14c3)]=_0x295ea5['pQWNE'],_0x1ff59b[_0x17318e(0xc03,0x10f6,0xb10,0xf21)]=_0x2d7d0c[_0x17318e(0x1285,0x7c8,0x121e,0x120d)]+'.mp4',_0x1ff59b[_0x425890(0x754,0x30a,0x4f8,0x505)]=_0x17318e(0x286,0xf3d,0x7c5,0x7e0)+'\x20'+_0x2d7d0c[_0x425890(0x186b,0xff0,0x1635,0x8fa)]+(_0x425890(0x1710,0xcd2,0x855,0x1020)+'ize\x20:\x20')+_0x2d7d0c[_0x17318e(0x1042,0xe5,0xbf8,0x6d0)]+(_0x425890(0x23a,0xb8e,0x569,0xc24)+_0x17318e(0xd95,0x1bac,0x19f5,0x1484))+(_0x52a010[0x4*0x4a+-0x262b+0x2504]||_0x295ea5[_0x17318e(0x1244,0x15e3,0x14a0,0x1165)])+(_0x425890(0xd0a,0x47e,-0x2c6,0x12a)+_0x17318e(0x18b2,0x111f,0xf72,0x14b0)+'\x20*ʀᴇᴅ-ᴅʀᴀɢ'+'ᴏɴ-ʙᴏᴛ*'),_0x3797bd[_0x17318e(0xdf3,0x105a,-0x2bb,0x63c)+'e'](_0x17aa6d['chat'],_0x1ff59b,{'quoted':_0x17aa6d});}break;case'yt720':{let {ytv:_0x1bf2bc}=_0x295ea5[_0x17318e(0xeaa,0x101e,0x4d,0x5e4)](require,_0x295ea5[_0x425890(-0x43a,0x59f,0x1a6,0x4b9)]);if(!_0x116129)return _0x295ea5[_0x425890(0xf06,0xd23,0x1633,0x12ae)](_0xcd1d32,_0x425890(0xc6e,0xb08,0xd72,0xc8c)+(_0x4fea53+_0x1cbc75)+'\x20'+global['btnurl']+_0x425890(0xba9,0x450,0x46f,0xd34));let _0x48ab99=_0x52a010[-0x2080+-0x1*0x1cd1+0x3d52]?_0x52a010[0x24ec+-0x14bc+-0x102f]:_0x295ea5[_0x17318e(0x10f3,0x67b,0xbc7,0x8eb)],_0x42b726=await _0x295ea5[_0x425890(0x4c2,0x30d,0x7e8,-0x4e9)](_0x1bf2bc,_0x116129,_0x48ab99);if(_0x295ea5[_0x425890(0x14c3,0x114e,0x17e1,0x9b4)](_0x42b726[_0x17318e(-0x16c,0x479,0x9e1,0x748)],0x1d036e+0x3007*0x83+-0x2654c4))return _0x295ea5['izGnB'](_0xcd1d32,_0x295ea5[_0x425890(0x11a4,0x104d,0x1745,0x13a6)](_0x295ea5['rLDoE'],util[_0x17318e(0x15ba,0xf8f,0x164b,0x1508)](_0x42b726)));const _0x13b2c8={};_0x13b2c8['url']=_0x42b726[_0x17318e(0x1311,0xa1a,0x3c6,0xb08)];const _0x2719e2={};_0x2719e2['video']=_0x13b2c8,_0x2719e2[_0x17318e(0x164d,0x1389,0x12b6,0x101b)]=_0x17318e(0xa8c,0x976,0x10b8,0x113b),_0x2719e2['fileName']=_0x42b726[_0x17318e(0x9a6,0x1575,0x17fb,0x120d)]+_0x17318e(0x126e,0xefd,0x59e,0xb57),_0x2719e2['caption']='╠🧸\x20Title\x20:'+'\x20'+_0x42b726[_0x425890(0xdb7,0xff0,0x10f6,0x1254)]+(_0x425890(0x1405,0xcd2,0xe1d,0x176b)+'ize\x20:\x20')+_0x42b726[_0x17318e(0x537,0xc39,0x7e5,0x6d0)]+(_0x425890(0x843,0xb8e,0x1238,0x12fb)+_0x425890(0x1136,0x1267,0x142c,0x921))+(_0x52a010[-0x670*-0x1+-0x919+0x2aa]||_0x295ea5['alnLk'])+('\x0a║\x0a╠🤓\x20*ᴘᴏᴡ'+_0x425890(0x1181,0x1293,0x1158,0xa50)+'\x20*ʀᴇᴅ-ᴅʀᴀɢ'+_0x425890(0xf2d,0x1512,0x14a5,0x1c6a)),_0x3797bd[_0x425890(0x23c,0x41f,-0x4a9,0x4b5)+'e'](_0x17aa6d[_0x425890(0xdf6,0xcc7,0x12dc,0x16ac)],_0x2719e2,{'quoted':_0x17aa6d});}break;case _0x295ea5[_0x425890(0xe35,0x1627,0x1303,0x13a2)]:{let {yta:_0x41faea}=_0x295ea5[_0x425890(0x1ae5,0x142a,0xb89,0x1004)](require,_0x295ea5['smCJb']),_0x4b8d5b=_0x4413ec[_0x17318e(0x9b,0xd7b,0x854,0x405)][_0x17318e(0x89b,0x9a2,0x84d,0xfe7)](new RegExp(/(?:https?:\/\/)?(?:youtu\.be\/|(?:www\.|m\.)?youtube\.com\/(?:watch|v|embed|shorts)(?:\.php)?(?:\?.*v=|\/))([a-zA-Z0-9\_-]+)/,'gi')),_0x470678=_0x52a010[0xfeb+0x2*0xc79+0x14*-0x20b]?_0x52a010[-0xdd5+-0xf37+0x9af*0x3]:_0x17318e(0x111f,0xda2,0xbbe,0x905),_0x34a8ed=await _0x295ea5['GfusY'](_0x41faea,_0x4b8d5b[_0x295ea5[_0x425890(0xa65,0x4b9,-0x1f0,-0x24c)](_0x116129,-0x66c*0x6+-0x5*0x6cd+0x488a)],_0x470678);if(_0x34a8ed[_0x425890(-0x2a2,0x52b,0xa64,-0x208)]>=-0xf02e+-0x25a29*-0x1+0x1ca5)return _0xcd1d32(_0x295ea5[_0x17318e(0x1100,0x1507,0xb9a,0x13c0)](_0x295ea5[_0x17318e(0xdcc,0x2c3,0xd40,0xa98)],util[_0x425890(0x1519,0x12eb,0x1d14,0xec3)](_0x34a8ed)));_0x3797bd[_0x17318e(0x7b5,0xb7c,0x4e8,0xd61)](_0x17aa6d[_0x17318e(0x65f,0x13df,0x13f7,0xee4)],_0x34a8ed[_0x425890(0x221,0x4e9,0x76b,0x275)],_0x17318e(0x141f,0x191e,0x1c27,0x1206)+botname+(_0x17318e(0x640,0x1258,0xd93,0xcc8)+_0x17318e(0x82d,0xb5e,0xa37,0xa1c))+_0x34a8ed[_0x425890(0xdfa,0xff0,0x14c6,0x1394)]+(_0x425890(0xcea,0x14a1,0xa08,0x1c76)+'ize\x20:\x20')+_0x34a8ed['filesizeF']+_0x425890(0xd8b,0x122d,0x1495,0x828)+_0x4b8d5b[_0x295ea5[_0x17318e(0x1861,0x83c,0x1a47,0x12d3)](_0x116129,-0x10ea+0x5a7*0x4+0x1f*-0x2f)]+(_0x425890(0x24c,0xb17,0xfc9,0xd2c)+_0x17318e(0x15a1,0x1a62,0x16e2,0x16c4)+_0x425890(0x6dc,0xd57,0xab8,0x1435))+(_0x52a010[0x240+-0xe04+0xbc5]||_0x295ea5[_0x17318e(0xea9,0x18c6,0xc3a,0x1209)])+(_0x425890(0x863,0x3cd,-0x5c7,0x946)+_0x425890(0xab,0x65c,0x858,-0x43f)+_0x17318e(0x9f4,0x485,0x42a,0x3ab)+_0x425890(0xd21,0x959,0x440,0x1ea)),_0x17aa6d);const _0x22b0a6={};_0x22b0a6['url']=_0x34a8ed[_0x17318e(0xbaf,0x599,0x878,0xb08)];const _0x157f8b={};_0x157f8b['audio']=_0x22b0a6,_0x157f8b['mimetype']=_0x295ea5['uNJpp'],_0x157f8b[_0x425890(0xdc0,0xd04,0x77c,0x8b2)]=_0x34a8ed['title']+'.mp3',_0x3797bd[_0x17318e(-0x1a2,0x235,0x41a,0x63c)+'e'](_0x17aa6d[_0x17318e(0x6f0,0x11e7,0x82c,0xee4)],_0x157f8b,{'quoted':_0x17aa6d});}break;case _0x295ea5[_0x425890(0x613,0x261,-0x3e5,0x6e9)]:{if(_0x295ea5['wzRDd'](_0x17318e(0x197e,0x1e2c,0x1562,0x13d5),_0x295ea5[_0x425890(0x141a,0x1538,0x15e0,0xaa4)])){if(!(_0x295ea5[_0x17318e(0xccc,0x183f,0x1997,0xf7e)]in _0x213855))_0x3b225a[_0x17318e(0x1d19,0x1cc2,0x1233,0x151a)]=![];if(!(_0x295ea5[_0x425890(0x396,0x6a6,0x6d8,0x572)]in _0x10a165))_0x3d4454[_0x17318e(0x7c0,0x12aa,0xe64,0x123c)]=![];}else{let {ytv:_0x372d72}=require(_0x295ea5[_0x17318e(-0x43,0x87b,0x5a6,0x7bc)]);if(!_0x116129)throw _0x17318e(0xdcb,0xc87,0xacd,0xd25)+_0x295ea5[_0x17318e(0x1012,0x11fa,0x1777,0xd62)](_0x4fea53,_0x1cbc75)+'\x201';if(!_0x17aa6d[_0x425890(-0x226,0x807,0x5d2,0xf09)])throw _0x295ea5['LOFaX'];if(!_0x17aa6d['quoted'][_0x425890(0x137c,0x1506,0x1d4d,0x106b)])throw'Can\x20Only\x20R'+_0x17318e(0x1de1,0x1113,0x19b1,0x15bd)+_0x17318e(0x1360,0xc02,0x16c8,0x1562)+_0x17318e(0x1fa0,0x1188,0x1c94,0x17dc);let _0x23638a=_0x4413ec[_0x425890(0xa6b,0x1e8,0xa9d,0xd8)]['match'](new RegExp(/(?:https?:\/\/)?(?:youtu\.be\/|(?:www\.|m\.)?youtube\.com\/(?:watch|v|embed|shorts)(?:\.php)?(?:\?.*v=|\/))([a-zA-Z0-9\_-]+)/,'gi'));if(!_0x23638a)throw _0x17318e(0x53f,-0x460,0x76f,0x638)+_0x17318e(0x832,0xe08,0xc2f,0xe27)+_0x425890(-0x285,0x290,0x30e,0xc6)+'Does\x20Not\x20C'+_0x425890(0xe6c,0x118e,0xe04,0xde5)+_0x425890(0x1bec,0x13e5,0x10e5,0xf66)+_0x17318e(0x6bf,-0xfe,-0x6d8,0x33c);let _0x1cd137=_0x52a010[-0x1a0+-0x1cae+0x1e4f]?_0x52a010[-0x263+0x1e41+0x3fb*-0x7]:_0x295ea5[_0x425890(0x1243,0xb00,0x3bf,0xe5d)],_0xe945be=await _0x295ea5[_0x425890(0x3d3,0x4a8,0x83a,0x935)](_0x372d72,_0x23638a[_0x295ea5[_0x17318e(0xb95,-0x30,-0x112,0x8b4)](_0x116129,0x6e2*-0x1+-0x16a6+0x1d89)],_0x1cd137);if(_0x295ea5[_0x17318e(0x6cf,0x1104,0xe50,0x9e5)](_0xe945be['filesize'],0xf*0xd69+-0x146f*-0x1f+-0x1bbf8))return _0x295ea5[_0x425890(0xdcb,0x3d0,0xbd0,0x671)](_0xcd1d32,_0x295ea5[_0x425890(0x571,0x87b,0x11db,0x8e3)]+util[_0x425890(0xfd5,0x12eb,0xa16,0xa5f)](_0xe945be));const _0x1d1296={};_0x1d1296['url']=_0xe945be['dl_link'],_0x3797bd[_0x425890(0x34f,0x41f,-0x438,0xba0)+'e'](_0x17aa6d[_0x17318e(0x13c7,0x1910,0x13ee,0xee4)],{'video':_0x1d1296,'mimetype':_0x295ea5[_0x425890(0xc42,0xcce,0xd4d,0x56c)],'fileName':_0xe945be[_0x425890(0xaf3,0xff0,0x61e,0x590)]+_0x425890(0x74c,0x93a,0x1119,0x13c5),'caption':'🙂🔥-☬𝗥𝗘𝗗༒𝗗𝗥'+_0x425890(0x96a,0x1173,0x880,0xc30)+_0x17318e(0x712,-0x660,0xb76,0x411)+':\x20'+_0xe945be[_0x17318e(0xf9e,0x11db,0xe58,0x120d)]+('\x0a🔰🌹\x20File\x20S'+_0x17318e(0x11de,0x1b2e,0x188b,0x1807))+_0xe945be[_0x425890(-0x47e,0x4b3,0xed8,0xe8a)]+_0x425890(0x1785,0x122d,0x18ce,0x11ea)+_0x23638a[_0x295ea5['MRHYU'](_0x116129,0x5d*0x54+0xa2e+-0x28b1)]+(_0x425890(0x8cb,0xb17,0xd6f,0x1371)+'MP3\x0a🔰🌹\x20Res'+_0x425890(0x836,0xd57,0x62b,0x12ad))+(_0x52a010[-0xe*-0x9b+-0x1a00+0x1187]||_0x295ea5[_0x17318e(0x147b,0x16a4,0x1534,0xd1d)])+(_0x17318e(0x11d2,0x4ea,0x112d,0xab3)+'Y:\x20\x20')+botname},{'quoted':_0x17aa6d});}}break;case _0x17318e(0xb5b,0x14e7,0xc89,0x12e9):{_0xcd1d32(mess[_0x425890(0xc1e,0x2c6,0x22e,-0x5bf)]);let {pinterest:_0x1903b7}=require(_0x295ea5['unmnA']);_0x54fa69=await _0x1903b7(_0x116129),result=_0x54fa69[Math[_0x425890(0x1b9a,0x1415,0x1195,0x1097)](_0x295ea5[_0x17318e(0x80f,0xafb,0x7ea,0x672)](Math[_0x425890(0x6f,0x92e,0x10ac,0xd7f)](),_0x54fa69[_0x17318e(0x1b2,0x9ce,0xf9c,0xad9)]))];const _0x3abcdf={};_0x3abcdf['url']=result,_0x3797bd[_0x17318e(0x4f8,0xe61,0x9d9,0x63c)+'e'](_0x17aa6d[_0x17318e(0x160a,0x17c1,0x88e,0xee4)],{'image':_0x3abcdf,'caption':_0x295ea5[_0x425890(0xee6,0xdde,0x498,0x115e)](_0x295ea5[_0x17318e(0xb41,0x7b5,0x539,0xd9a)],result)},{'quoted':_0x17aa6d});}break;case _0x295ea5['rGQmR']:case _0x295ea5['WLqyi']:if(!_0x116129)return _0x295ea5[_0x17318e(0xc0b,0xc6f,-0xf6,0x5cb)](_0xcd1d32,_0x295ea5[_0x425890(0x477,0x2a9,0x84d,0xb7e)]);await _0x295ea5[_0x425890(0x1260,0x135e,0x8e2,0x147f)](_0xcd1d32,mess[_0x17318e(0x76d,0x4ee,-0xb1,0x4e3)]),nexusnw[_0x425890(-0x64e,0x3ba,-0x6a,-0xe6)](q)['then'](async _0x4fa614=>{function _0x48c578(_0x2b565d,_0xf2655a,_0x1b5c9e,_0x2c9060){return _0x17318e(_0x2b565d-0x4f,_0x2c9060,_0x1b5c9e-0x18f,_0x2b565d-0x48);}let _0x31e1be='*------「\x20W'+_0x48c578(0xbe3,0x10aa,0xe08,0x8eb)+_0x48c578(0x1285,0x19c9,0x1b81,0x128a)+_0x770a0e(0x97c,0x937,0x13b9,0x1047);function _0x770a0e(_0x1ab263,_0x5b42aa,_0x5b9a26,_0x2d697a){return _0x17318e(_0x1ab263-0x1c7,_0x2d697a,_0x5b9a26-0x77,_0x5b42aa-0x94);}for(let _0x12c3c2 of _0x4fa614){const _0x4ebafb=_0x295ea5[_0x770a0e(0x1277,0x14fc,0xe95,0xfd4)][_0x770a0e(0xdbf,0x59c,0x691,-0x113)]('|');let _0xd9e7dc=0x165e+0x1a23+-0x3081;while(!![]){switch(_0x4ebafb[_0xd9e7dc++]){case'0':_0x31e1be+=_0x48c578(0xc88,0xdd5,0x1570,0x6ae)+'*\x20'+_0x12c3c2['genre']+'\x0a';continue;case'1':_0x31e1be+=_0x770a0e(0x481,0x741,-0x1ed,0xa0d)+_0x12c3c2[_0x770a0e(0x3ad,0x8a4,0xfc6,0xc3b)]+(_0x770a0e(0xe77,0xb02,0xcc4,0xd7a)+'.•°•.•°•.•'+'°•.•°•.•°•'+'.•°•.•°•.•'+_0x770a0e(-0x3d4,0x622,0xf63,0x3e3)+'.\x0a');continue;case'2':_0x31e1be+=_0x48c578(0xe2e,0x4dd,0x447,0xdcb)+_0x770a0e(0x1a5b,0x1886,0xfdb,0x1f08)+_0x12c3c2[_0x48c578(0xfa6,0xb17,0xad0,0x1195)]+'\x0a';continue;case'3':_0x31e1be+='*📫\x20Title\x20:'+'*\x20'+_0x12c3c2[_0x48c578(0xef2,0x1216,0x14e1,0xead)]+'\x0a';continue;case'4':_0x31e1be+=_0x48c578(0x805,0x729,-0x141,0x155)+'\x20'+_0x12c3c2[_0x48c578(0x843,0xb42,0x8f7,-0xc1)]+'\x0a';continue;}break;}}await _0x295ea5['GWEqI'](_0xcd1d32,_0x31e1be);})[_0x17318e(0xb9d,0xad5,0x9be,0x10e8)](_0x4651a7=>{function _0x5d3850(_0x4b5f99,_0x321f11,_0x11a70b,_0x14cb60){return _0x17318e(_0x4b5f99-0xb6,_0x14cb60,_0x11a70b-0xbf,_0x4b5f99- -0x2b);}function _0x4a9173(_0x1df94c,_0x138c04,_0x457e1d,_0x14b509){return _0x17318e(_0x1df94c-0x1d7,_0x14b509,_0x457e1d-0x12d,_0x457e1d- -0x63e);}const _0x3e3f30={'fKEeh':function(_0x1c18fd,_0x768498){return _0x1c18fd(_0x768498);},'JGfNV':_0x295ea5[_0x5d3850(0x1720,0x15cf,0x19d2,0xd68)],'pnYUx':_0x295ea5['rCAYP']};if(_0x295ea5[_0x5d3850(0xba3,0x3ab,0x21e,0x882)](_0x5d3850(0x1175,0xf42,0xdc2,0x10e4),_0x295ea5[_0x5d3850(0xf77,0xbf2,0x5d9,0x1173)])){_0x3e3f30[_0x5d3850(0x1415,0x1a91,0xe6d,0x1838)](_0x5ec161,_0x2d5458['wait']);const _0x5de5fe={};_0x5de5fe[_0x5d3850(0x7e5,0x859,0xda2,0xace)]=_0x5d3850(0x68a,0x4ff,0x9cc,0xff7)+_0x5d3850(0xbd5,0x1675,0x11e9,0x2f9)+_0x4a9173(0x332,0x1ca,0x12,0x99b)+_0x4a9173(0x433,-0xa30,-0x2cc,0x6d4)+_0x5d3850(0xc11,0x130e,0x920,0x15a6)+_0x4a9173(-0x4bd,0x4cd,-0x16d,-0xb62)+_0x5d3850(0xdb6,0x4e4,0x737,0x1608)+_0x4a9173(0x40c,0x145,0x57e,0xd4e);const _0x517188={};_0x517188['document']=_0x5de5fe,_0x517188['mimetype']=_0x3e3f30[_0x5d3850(0x132e,0x127b,0x1950,0x1940)],_0x517188[_0x5d3850(0xef6,0x16c6,0x1615,0xee8)]=_0x3e3f30[_0x5d3850(0x35e,-0x5fc,0xa93,0x9e9)];const _0x1b0119={};_0x1b0119['quoted']=_0x3933b8,_0x5c5d30[_0x5d3850(0x611,0xc36,0x255,0x446)+'e'](_0x29ae8b[_0x4a9173(0xba1,0xab7,0x8a6,0x1052)],_0x517188,_0x1b0119);}else _0x295ea5[_0x5d3850(0x1649,0x169f,0x1337,0x199a)](_0xcd1d32,mess['error']);});break;case _0x295ea5[_0x17318e(0x1f87,0x16ad,0x1823,0x1708)]:if(!_0x116129)return _0x295ea5[_0x425890(0x962,0xe0f,0x535,0x127d)](_0xcd1d32,_0x425890(0x6aa,0x6e9,0x213,-0xa2)+_0x17318e(0x1854,0x1871,0x1248,0x1566)+_0x425890(0xb76,0xe76,0x18d4,0x4fc));await _0x295ea5[_0x17318e(0x1701,0xefc,0xe13,0xe23)](_0xcd1d32,mess[_0x425890(-0x71c,0x2c6,0xafe,0x64d)]),nexusnw[_0x17318e(0x72b,0x320,0xa8f,0xc42)](''+_0x116129)['then'](async _0x1120d1=>{function _0x11fa70(_0x4086b5,_0x2397bd,_0x3749d8,_0x4753f4){return _0x17318e(_0x4086b5-0x1dc,_0x3749d8,_0x3749d8-0x12e,_0x4753f4- -0x406);}let _0x44d386=_0x11fa70(0x831,0x1518,0xcef,0xe49)+_0x11fa70(0xbcb,-0x570,0xcc4,0x4b9)+_0x11fa70(0x514,-0x2cc,0x764,-0x54)+'\x0a';for(let _0x2fc92d of _0x1120d1){_0x44d386+=_0x25b162(0xc1b,0x1537,0xbd7,0x1358)+'*\x20'+_0x2fc92d[_0x25b162(0x130d,0xdf8,0xc65,0x1670)]+'\x0a',_0x44d386+=_0x11fa70(0x71,0x11cc,0x1104,0x748)+'*\x20'+_0x2fc92d[_0x25b162(0xb7a,0x5dc,0x442,0x6d9)]+'\x0a',_0x44d386+=_0x11fa70(0xd41,0x7f9,0xe09,0x83a)+'*\x20'+_0x2fc92d[_0x11fa70(0xc0e,0x1600,0x1943,0x129d)]+'\x0a',_0x44d386+=_0x11fa70(0x86e,0x2c8,0xcf9,0x2a7)+_0x2fc92d['url']+(_0x25b162(0x180a,0x164c,0xfab,0x191a)+'•°•.•°•.•°'+_0x25b162(0x184b,0x1692,0x1ca7,0x1d97)+_0x25b162(0x14be,0xfaf,0x84f,0x1754)+_0x11fa70(0xec1,0xf5a,0x12e3,0x133e)+'\x0a');}function _0x25b162(_0x5908a8,_0x910b86,_0x428fb5,_0x2d0025){return _0x17318e(_0x5908a8-0x1c3,_0x2d0025,_0x428fb5-0x1a0,_0x910b86- -0xb2);}await _0x295ea5[_0x25b162(0x18df,0x14be,0x130b,0x1344)](sendFileFromUrl,_0x146a84,_0x1120d1[-0x1*-0xd0f+-0x91*0x20+0x511]['thumbnail'],_0x44d386,_0x17aa6d);})[_0x425890(0xfbf,0xecb,0xc84,0x56d)](_0x45e191=>{function _0x5d9e8e(_0x1cd44d,_0x2c0cfb,_0x286df7,_0xaa0dfe){return _0x425890(_0x2c0cfb,_0xaa0dfe- -0x460,_0x286df7-0x7d,_0xaa0dfe-0xc8);}function _0x5ca07c(_0x1151a9,_0x534baf,_0x3b689e,_0x2c2c60){return _0x17318e(_0x1151a9-0x66,_0x2c2c60,_0x3b689e-0x25,_0x1151a9- -0x52);}if(_0x295ea5[_0x5d9e8e(0xc3d,-0x7e8,-0x83f,0x248)](_0x295ea5[_0x5d9e8e(0x1a4c,0x7ee,0x19ff,0x1017)],_0x295ea5['kLfdQ'])){const _0x4d1172=_0xd8f6c4?function(){if(_0x14c3d8){const _0x5c241f=_0x23d73e['apply'](_0x3ae03d,arguments);return _0xa84b56=null,_0x5c241f;}}:function(){};return _0x1bb941=![],_0x4d1172;}else _0xcd1d32(mess[_0x5ca07c(0x58d,0xb85,0x5a6,0x7bc)]);});break;case _0x295ea5[_0x425890(0x100f,0x5bf,0x856,0x53d)]:{if(!_0x116129)return _0x295ea5[_0x425890(0x78c,0x316,0x21,0x16b)](_0xcd1d32,_0x425890(0x995,0x1362,0x1742,0xd74)+_0x17318e(0x1055,0x1189,0x1585,0x1399)+'ooking\x20For'+'??');await _0x295ea5[_0x425890(0x1d73,0x138c,0x1d15,0x16a7)](_0xcd1d32,mess[_0x17318e(-0x6,-0x503,0x12,0x4e3)]),nexusnw[_0x425890(0x75c,0xb0b,0x7f4,0x37e)](q)[_0x425890(0x67c,0x1b3,0x57e,-0x62d)](async _0x164f40=>{let _0x3fdcc7=_0x261a68(0x49d,0x3b4,0x751,-0x1fc)+_0x261a68(0x1017,0xeb7,0x12aa,0xb3b)+_0x4a46b3(0x38b,0x413,0x1ce,0x39b)+_0x261a68(0x1472,0x964,0xe0a,0x5fd);for(let _0x1bb33f of _0x164f40){if(_0x295ea5[_0x261a68(0x56e,0x92e,0x377,0x66e)](_0x4a46b3(0xfb7,0xa66,0xd6f,0x101d),'tZwxx')){const _0x42bf22={};_0x42bf22[_0x261a68(0xf77,0x64d,0xb2b,0x104b)]=!![],_0x3a1fd5[_0x4a46b3(0x164d,0xee5,0x118a,0x114d)](_0x42bf22,_0x38c12e[_0x4a46b3(0xdd1,0x45f,0x62e,0xe7b)],[])['then'](_0x2368f4=>_0xd2955(_0x4dfc70(_0x2368f4)))['catch'](_0x3bd641=>_0x3c2fba(_0x3dd94d(_0x3bd641)));}else _0x3fdcc7+='*📫\x20Title\x20:'+'*\x20'+_0x1bb33f[_0x261a68(0xdc6,0x127b,0xa17,0xae)]+'\x0a',_0x3fdcc7+='*📚\x20Url\x20:*\x20'+_0x1bb33f[_0x4a46b3(0xfd8,-0x3d,0x5f,0x5ad)]+(_0x4a46b3(0x2120,0x162d,0x1373,0x1695)+_0x261a68(0x385,0x32f,0xbce,0x462)+'•.•°•.•°•.'+_0x261a68(0x15f4,0xc51,0xbce,0x12a9)+_0x261a68(0x180a,0x1770,0x12b1,0xe96)+'\x0a');}let _0x5496dc=await _0x295ea5[_0x261a68(-0x6e4,-0x87,-0x2b,-0x2cb)](getBuffer,_0x164f40[0xae8+0x20b2+-0x2b9a]['thumbnail'][_0x4a46b3(0xa8a,-0x56,-0x13,0x7c5)](_0x295ea5[_0x4a46b3(-0x47d,0xc35,0xcf8,0x5ba)],''));const _0x2c812d={};_0x2c812d['displayTex'+'t']=_0x295ea5[_0x261a68(0x169d,0x1973,0x10af,0xa41)],_0x2c812d[_0x261a68(0x862,0x2c0,0x37d,-0x269)]=''+btnurl;const _0x33db0b={};_0x33db0b[_0x4a46b3(0xb11,0xdcf,0xbc1,0xc8a)]=_0x2c812d;var _0x126845=[_0x33db0b];function _0x4a46b3(_0x5be708,_0xa7e38d,_0x1ca8f0,_0x5b59e1){return _0x425890(_0xa7e38d,_0x5b59e1-0x1b4,_0x1ca8f0-0x11a,_0x5b59e1-0x1a);}const _0x42c6a4={};_0x42c6a4[_0x4a46b3(0xc56,0xda7,-0x143,0x558)]=_0x17aa6d['chat'];function _0x261a68(_0x2ffd17,_0x6ed74a,_0x401ebf,_0x34bd73){return _0x425890(_0x2ffd17,_0x401ebf- -0x276,_0x401ebf-0x110,_0x34bd73-0x1ee);}_0x42c6a4[_0x4a46b3(0xa18,0x7a7,0x3c9,0x9bb)]=_0x17aa6d,await _0x3797bd[_0x261a68(0x6e2,0x619,0x6f5,0xfa6)+'c'](_0x146a84,_0x3fdcc7,'©\x20'+ownername,_0x5496dc,_0x126845,_0x42c6a4);})[_0x425890(0x145c,0xecb,0x6c7,0x1531)](_0x24cc5b=>{function _0x5227d2(_0x42dc7e,_0x18e515,_0x5a29f3,_0x1d6104){return _0x425890(_0x1d6104,_0x18e515-0x14d,_0x5a29f3-0x106,_0x1d6104-0x80);}function _0x3df012(_0x442788,_0x1d2e2f,_0x47bc54,_0x5ba603){return _0x17318e(_0x442788-0x16a,_0x1d2e2f,_0x47bc54-0xb1,_0x442788- -0x297);}if(_0x295ea5['BlUAk'](_0x295ea5['Srklj'],_0x295ea5[_0x5227d2(0xfc1,0x1553,0x1638,0xe1d)]))_0x295ea5[_0x3df012(0x808,0x3be,0x3b4,0x11e)](_0xcd1d32,mess[_0x3df012(0x348,-0x559,-0x184,0xc04)]);else{const _0x12c01f={};return _0x12c01f['X']='❌',_0x12c01f['O']='⭕',_0x12c01f['1']=_0x3df012(0xeaa,0x948,0x1087,0xbae),_0x12c01f['2']=_0x3df012(0x10bb,0x189d,0xec4,0x143b),_0x12c01f['3']=_0x295ea5[_0x3df012(0xfdf,0x11c5,0x14a5,0x726)],_0x12c01f['4']=_0x295ea5['zJyCh'],_0x12c01f['5']=_0x295ea5[_0x5227d2(0x1593,0xc90,0x7fe,0x172b)],_0x12c01f['6']=_0x3df012(0x1056,0xd34,0xa14,0x7f2),_0x12c01f['7']=_0x295ea5[_0x3df012(0x1198,0x1067,0x12ce,0x1321)],_0x12c01f['8']=_0x295ea5[_0x5227d2(0xfe1,0x1198,0x9ce,0x1652)],_0x12c01f['9']=_0x295ea5[_0x5227d2(0x887,0x11ac,0x17a3,0xb0f)],_0x12c01f[_0x4eca16];}});}break;case _0x295ea5[_0x425890(0xffd,0x710,0x7c6,0x2a8)]:case _0x295ea5['uvwBi']:if(!_0x116129)return _0xcd1d32(_0x17318e(0xbf1,0xfbb,0x197f,0x157f)+'\x20Character'+_0x17318e(0x976,0x1ddf,0x19d3,0x1399)+_0x17318e(0xbdf,-0x11f,-0x95,0x5c5)+'??');await _0x295ea5[_0x17318e(0x116d,0xf5e,0x2192,0x1854)](_0xcd1d32,mess['wait']),nexusnw[_0x17318e(0xabd,0x63e,0xc7,0xa8f)](q)[_0x17318e(-0x6c5,-0x4c4,-0xe4,0x3d0)](async _0x471135=>{let _0x39bb7e=_0x1feda2(0x18e8,0x106e,0x12ad,0x8f7)+_0xfe4ce5(0x9c3,0x746,0xb0e,0xbb1)+'CH\x20」---*\x0a\x0a';for(let _0x48b065 of _0x471135){_0x39bb7e+=_0xfe4ce5(0x1536,0x1cae,0x1227,0x1334)+_0xfe4ce5(0xead,0x1445,0x131a,0x12c1)+_0x48b065['character']+'\x0a',_0x39bb7e+=_0x1feda2(0x586,0x39a,0x64d,0x191)+_0x48b065['link']+(_0xfe4ce5(0x15ff,0x1ac0,0x1ade,0x12b8)+'•°•.•°•.•°'+'•.•°•.•°•.'+_0xfe4ce5(0xf62,0xf95,0x15df,0xe56)+_0xfe4ce5(0x1645,0x1c41,0x15f3,0x2051)+'\x0a');}let _0x41d744=await _0x295ea5['DXqVs'](getBuffer,_0x471135[0x2150+-0xb3*0x28+0x26*-0x24][_0x1feda2(0x779,0xa40,0x7b0,0x505)][_0x1feda2(0x290,0x51b,0x6ff,-0x108)](_0x295ea5[_0xfe4ce5(0x524,0xf46,0x261,0xa50)],''));const _0x5cd38e={};_0x5cd38e[_0x1feda2(0x10cc,0xfaa,0x1222,0xc3f)+'t']=''+button,_0x5cd38e[_0xfe4ce5(0x711,0xbc6,0x1057,0x581)]=''+btnurl;const _0x21764a={};_0x21764a[_0xfe4ce5(0xbf4,0x283,0x1654,0x73e)]=_0x5cd38e;var _0x15658e=[_0x21764a];const _0x2c7252={};function _0x1feda2(_0xa8aa8b,_0x206a29,_0x4d98c0,_0x297790){return _0x425890(_0x4d98c0,_0x206a29- -0xf6,_0x4d98c0-0x1d1,_0x297790-0x18b);}_0x2c7252['userJid']=_0x17aa6d[_0xfe4ce5(0xde5,0x126e,0x1106,0x1146)],_0x2c7252[_0xfe4ce5(0x925,0xa46,0xafc,0x12b9)]=_0x17aa6d;function _0xfe4ce5(_0x5630c9,_0x558bad,_0x45773d,_0x26356a){return _0x425890(_0x26356a,_0x5630c9-0x11e,_0x45773d-0x3,_0x26356a-0x8a);}await _0x3797bd[_0x1feda2(0x2eb,0x875,0x4f7,0xab)+'c'](_0x146a84,_0x39bb7e,'©\x20'+ownername,_0x41d744,_0x15658e,_0x2c7252);})[_0x425890(0x1272,0xecb,0x183a,0xf1a)](_0x205782=>{_0xcd1d32(mess['error']);});break;case _0x295ea5[_0x17318e(0x1e87,0x20bf,0x1d49,0x177a)]:if(!_0x116129)return _0x295ea5[_0x17318e(0x11a7,0x182a,0xcf3,0x15d1)](_0xcd1d32,_0x425890(0xe62,0x86e,0xe83,0x119f)+_0x425890(0x8ec,0x117c,0x13be,0x112c)+_0x425890(-0x15b,0x3a8,0x17d,-0x61b)+'??');await _0xcd1d32(mess[_0x425890(0xa95,0x2c6,0x851,-0x201)]),nexusnw['Manga'](''+_0x116129)['then'](async _0x1395f8=>{let _0x53e059=_0x360fa7(0xc05,0xdae,0xde4,0x12bb)+'ANGA-SEARC'+'H\x20」------*'+'\x0a\x0a';for(let _0x11af1c of _0x1395f8){_0x53e059+='*📫\x20Title\x20:'+'*\x20'+_0x11af1c['judul']+'\x0a',_0x53e059+='*📚\x20Url\x20:*\x20'+_0x11af1c[_0x47b2c5(0x44d,0x60e,0x569,0x618)]+(_0x360fa7(0x112b,0x175f,0x18e5,0x1f20)+'•°•.•°•.•°'+_0x47b2c5(0xe36,0x1d14,0x1697,0x1e1a)+_0x360fa7(0x15b9,0x10c2,0xb2c,0xd96)+'•.•°•.•°•.'+'\x0a');}let _0x3c3f8e=await getBuffer(_0x1395f8[-0xbaa+0x19a9+0xdff*-0x1]['thumbnail'][_0x360fa7(0x5f9,0x88f,0x124e,0x8c9)](_0x295ea5[_0x360fa7(0x77,0x684,0xc34,0x39a)],''));const _0x5666a5={};function _0x47b2c5(_0x2c2cd5,_0x3254fe,_0x4726a5,_0x54fb2a){return _0x425890(_0x3254fe,_0x4726a5-0x170,_0x4726a5-0x183,_0x54fb2a-0x4d);}_0x5666a5['displayTex'+'t']=''+button,_0x5666a5[_0x360fa7(0x12d7,0x871,0xcf5,0x586)]=''+btnurl;const _0xeb66b={};_0xeb66b[_0x360fa7(0x6e0,0xd54,0xfac,0x1026)]=_0x5666a5;var _0xfb83ff=[_0xeb66b];const _0x332ee0={};_0x332ee0[_0x47b2c5(0xb2f,0x73f,0x514,0x107)]=_0x17aa6d[_0x360fa7(0xd62,0xf45,0x15d0,0x925)],_0x332ee0[_0x360fa7(0xf72,0xa85,0x1474,0x73e)]=_0x17aa6d;function _0x360fa7(_0xb5702b,_0x5293a7,_0x48a8eb,_0x315dba){return _0x17318e(_0xb5702b-0xbd,_0x48a8eb,_0x48a8eb-0xfb,_0x5293a7-0x61);}await _0x3797bd[_0x47b2c5(0xf51,0x1003,0xadb,0x8b)+'c'](_0x146a84,_0x53e059,'©\x20'+ownername,_0x3c3f8e,_0xfb83ff,_0x332ee0);})[_0x17318e(0x1685,0x1464,0xf26,0x10e8)](_0xf48f72=>{function _0xf0402b(_0x43a129,_0x3b02d6,_0x46e726,_0x278633){return _0x17318e(_0x43a129-0xc6,_0x278633,_0x46e726-0x136,_0x3b02d6- -0x24a);}_0xcd1d32(mess[_0xf0402b(0x25a,0x395,-0x10a,0x84b)]);});break;case _0x295ea5['sRiRW']:case _0x295ea5[_0x17318e(0x56b,0xb56,0x14a9,0xeed)]:case _0x295ea5[_0x425890(0xeb1,0x91c,0x10c0,0x495)]:case'shinobu':case _0x295ea5[_0x425890(0x649,0xe33,0x15da,0x1251)]:case _0x295ea5[_0x425890(0xd7c,0x14ab,0x13a0,0x1669)]:case'nekos':case _0x295ea5[_0x425890(0x140b,0x1450,0x11d8,0xdec)]:case _0x295ea5[_0x17318e(0x179d,0x1c7e,0x15d6,0x1597)]:{if(_0x295ea5[_0x17318e(0x11ee,0x12d1,0x2080,0x1804)](_0x295ea5[_0x17318e(-0x225,0xc78,0x209,0x7fc)],_0x295ea5[_0x17318e(0x3de,0xdce,-0xf,0xa80)])){_0x4503bb[_0x17318e(0x5af,0xa2d,0x1f8,0x587)](_0x295ea5[_0x425890(0xe72,0xd67,0x528,0x3a3)](_0x17318e(0xa50,0x875,0xb5f,0x63e),_0x584152['jawaban']));const _0x2244e6={};_0x2244e6[_0x425890(0x1a21,0x10a0,0x19ce,0xc24)+'t']=_0x295ea5[_0x17318e(0xdcc,0x16d5,0x1894,0x15dd)];const _0x2c69ec={};_0x2c69ec[_0x17318e(0x158b,0x147d,0xf21,0x1194)]=_0x17318e(0xaa0,0x1b83,0x1717,0x1190)+'cs',_0x2c69ec[_0x17318e(0x98b,0x13b6,0xc68,0x1318)]=_0x2244e6,_0x2c69ec[_0x17318e(0xebc,0x1b7a,0x11ef,0x1638)]=0x1,_0x154351[_0x425890(0x13f7,0x10a7,0x135e,0xece)+_0x425890(0x25b,0xcec,0x993,0xa30)](_0x40c7c4[_0x425890(0x665,0xcc7,0x11b6,0x13f0)],[_0x2c69ec],_0x425890(0xec7,0xa1c,0x5de,0x7e4)+_0x17318e(0xc3c,0xa13,0xc35,0xb15)+_0x584edd[_0x2ddcfb[_0x17318e(0x10da,0xb63,0x542,0xc86)][_0x17318e(-0x3ee,0xc4d,0x44b,0x508)]('@')[-0x2530+-0x26*-0x59+0x17fa]]+(_0x425890(0x659,0xa34,0x7cc,0x9f0)+'lay\x20Again?'+_0x17318e(0xc3a,0x661,0x9c4,0xb93)+_0x17318e(0xbcc,0xb16,-0x317,0x63f)+'ow'),_0x2e3543[_0x17318e(0x1834,0x8be,0x1a89,0x12db)][_0x425890(0xc29,0xe82,0x16dd,0x922)],_0x1e51a3),delete _0x491f30[_0xd179eb[_0x425890(0x7bd,0xa69,0x12dc,0x26b)][_0x425890(-0x4cb,0x2eb,0xc05,-0x278)]('@')[0x18ef+-0x2291+0x4d1*0x2]];}else _0x295ea5[_0x425890(0xc45,0x1083,0x1870,0x1401)](_0xcd1d32,mess['wait']),_0x3797bd[_0x425890(0x981,0x41f,-0x336,0x144)+'e'](_0x17aa6d[_0x425890(0x279,0xcc7,0x10cf,0x160c)],{'image':{'url':api(_0x295ea5['iGZhi'],_0x295ea5[_0x17318e(0x163,0x2c6,0x2b3,0x783)](_0x295ea5['OJwNN'],_0x1cbc75),{},_0x295ea5['xsylT'])},'caption':_0x295ea5['vwVDn'](_0x425890(0x90f,0x3d3,-0x1df,0x2e)+_0x17318e(0xa34,0x17f6,0x173d,0x1238),_0x1cbc75)},{'quoted':_0x17aa6d});}break;case _0x295ea5['lIPzJ']:case _0x295ea5[_0x425890(0x6ab,0x527,0x51d,0x11e)]:{_0x295ea5['aeolp'](_0xcd1d32,mess[_0x425890(0x716,0x2c6,-0x62e,0x187)]);let _0x43e384=await fetchJson(_0x295ea5[_0x425890(0x851,0x483,0xba8,-0xb1)]),_0x22056d=_0x43e384[Math[_0x17318e(0x1547,0x1d8b,0x1d20,0x1632)](Math[_0x425890(0xc9d,0x92e,-0x129,0x356)]()*_0x43e384[_0x425890(0x9cd,0x8bc,0x187,0xcc4)])];const _0x277e7e={};_0x277e7e['url']=_0x22056d[_0x17318e(0xfc1,0xd05,0x16d7,0xf99)];const _0x240979={};_0x240979[_0x17318e(0x97f,-0x4e3,-0x3cb,0x59e)]=_0x277e7e,_0x240979[_0x425890(-0xe9,0x30a,-0x5d4,0x413)]='Couple\x20Mal'+'e🙎🏻‍♂️',_0x3797bd['sendMessag'+'e'](_0x17aa6d['chat'],_0x240979,{'quoted':_0x17aa6d});const _0x4e14aa={};_0x4e14aa[_0x17318e(-0x9a,0x1253,0xf,0x810)]=_0x22056d[_0x17318e(0x824,0xea0,0x4e9,0xce1)];const _0x580d7f={};_0x580d7f['image']=_0x4e14aa,_0x580d7f[_0x425890(0xc8b,0x30a,-0x4cc,-0x4ba)]=_0x17318e(0xc2a,0x109f,0x168d,0xd98)+_0x17318e(0xba3,0x2a6,-0x35b,0x66f),_0x3797bd[_0x425890(-0x260,0x41f,-0x5c5,0xa6f)+'e'](_0x17aa6d['chat'],_0x580d7f,{'quoted':_0x17aa6d});}break;case _0x295ea5[_0x17318e(0x2200,0x1515,0x12f9,0x1775)]:case'kopi':{if(_0x17318e(0x143d,0x1dda,0xb55,0x1491)===_0x17318e(0xae2,0x1779,0x1bc3,0x1491)){const _0x301290={};_0x301290[_0x425890(0x1121,0x10a0,0x1238,0x17bc)+'t']=_0x295ea5[_0x425890(0xccb,0xa72,0x3d0,0xff7)];const _0x237d4b={};_0x237d4b[_0x425890(0x157d,0xf77,0x535,0x1452)]=_0x17318e(0x15a9,0xdd3,0xa13,0xc60),_0x237d4b[_0x425890(0xffc,0x10fb,0x1ad3,0xb87)]=_0x301290,_0x237d4b[_0x17318e(0x1a30,0x1420,0x187b,0x1638)]=0x1;let _0x5e7003=[_0x237d4b];const _0x19c04d={};_0x19c04d[_0x17318e(0xe31,0xbcb,0x917,0x810)]=_0x295ea5[_0x17318e(0x4ad,0x93c,0x9d9,0x74f)];const _0x2026d7={};_0x2026d7['image']=_0x19c04d,_0x2026d7[_0x425890(0xacb,0x30a,0x65,-0x544)]=_0x17318e(0xc62,0x4dc,0x366,0xdd7)+_0x425890(-0x448,0x3d5,0xcb8,0xb38),_0x2026d7[_0x425890(-0x36b,0x37a,0x8d,0x176)]=_0x3797bd['user']['name'],_0x2026d7[_0x425890(0x19af,0xf61,0x16c5,0x13e0)]=_0x5e7003,_0x2026d7[_0x425890(0x9d7,0xfef,0xe14,0x68b)]=0x4;let _0x4e8182=_0x2026d7;_0x3797bd['sendMessag'+'e'](_0x17aa6d[_0x17318e(0x1097,0x695,0x659,0xee4)],_0x4e8182,{'quoted':_0x17aa6d});}else return _0x3c3189[_0x425890(0x1008,0x1229,0x148d,0x17a0)]=_0x110551[_0x17318e(0xf89,0x684,0x18ca,0xe78)](_0x5831ae[_0x425890(0x1100,0xe43,0x9ac,0x69f)])['reduce']((_0x114a61,_0x101d72)=>_0x114a61+_0x16c93c['times'][_0x101d72],-0x1de+0x1*-0x3d7+0x5b5),_0xf97a6b;}break;case _0x295ea5['zNWXN']:{if(_0x295ea5[_0x425890(0x1ca8,0x155a,0x1b41,0xf44)](_0x295ea5['sZmIU'],_0x295ea5[_0x17318e(0x6b9,0xbf1,0x1c9,0xc5a)])){if(!_0x3e2de1)return _0x295ea5[_0x425890(0xa8c,0x301,0x319,0xba4)](_0x1f646a,'Enter\x20The\x20'+_0x425890(0x18c3,0x1611,0xe00,0x19f5)+_0x425890(0x598,0x312,0xbdf,-0x761)+_0x356e71+('\x20Menu\x20Erro'+'r!'));_0x480362['sendMessag'+'e'](_0x425890(0x8b7,0x1342,0x1ae6,0x10af)+_0x17318e(0x45c,0x810,0xf0b,0x64c)+_0x17318e(0x149d,0x11a8,0x1286,0xc3d),{'text':_0x425890(0x349,0x639,0xdb0,0x5d0)+_0x425890(0x1754,0x1314,0x1774,0x964)+_0x17318e(0x53c,0x5d8,0xd4,0x965)+_0x4335f1[_0x425890(0x684,0xa69,0xe32,0x86e)][_0x17318e(0x4b6,0x55b,0x6ab,0x508)]('@')[0x3*0x702+0x1ce6+-0x31ec]+(_0x17318e(0x96e,0xb67,0x1074,0xc2d)+'ssage:\x20')+_0x478991}),_0x295ea5[_0x425890(-0x30,0x48a,-0x482,0x7ff)](_0x3bd7e0,_0x17318e(0x1053,0x1826,0x1589,0x12e2)+'ly\x20Reporte'+_0x17318e(0xde0,0x91,0xcb6,0x3ef)+_0x425890(0x98a,0x1262,0xc96,0x1a21)+'se\x20Make\x20Su'+_0x425890(0xb71,0x848,0x7e8,0x101e)+_0x17318e(-0x319,0xc05,0x3e7,0x502)+_0x425890(0x1774,0x1106,0x963,0x1627)+_0x17318e(0x1454,0x37d,0x66d,0x9e8)+_0x425890(0x1518,0x1484,0x1aa8,0x10df)+_0x425890(-0x5bc,0x231,0xaa8,-0x281)+_0x425890(0x5cc,0xe5f,0xd3c,0x74e)+_0x17318e(0x197d,0x146d,0x1e57,0x16e6)+'\x20No\x20Reason'+',\x20You\x20Will'+'\x20Be\x20Blocke'+_0x17318e(0x1290,0x1db9,0x1107,0x13df)+'\x20!');}else{if(!_0x116129)return _0x295ea5[_0x425890(0xc0a,0x4c6,0x22,0x563)](_0xcd1d32,_0x17318e(0x58c,0xef1,0xa2e,0x7b0)+'y\x20Title');let {wallpaper:_0x48c773}=_0x295ea5[_0x425890(0x208,0xc1a,0x52c,0x610)](require,_0x425890(0x897,0x853,0x31,0x22)+'per');_0x54fa69=await _0x295ea5['wyVdr'](_0x48c773,_0x116129),result=_0x54fa69[Math[_0x425890(0x11f7,0x1415,0x17b7,0x1b70)](_0x295ea5['BWnOr'](Math[_0x425890(0x7a,0x92e,0xab7,0x9fd)](),_0x54fa69[_0x425890(0x121b,0x8bc,0x610,0xb50)]))];const _0x1dd64d={};_0x1dd64d[_0x17318e(0x839,0xe9f,0x1d24,0x12bd)+'t']=_0x295ea5[_0x17318e(0x36f,0x118f,0xe91,0xc8f)];const _0x25cfc7={};_0x25cfc7['buttonId']='wallpaper\x20'+_0x116129,_0x25cfc7[_0x17318e(0x9ba,0x1a6e,0x1148,0x1318)]=_0x1dd64d,_0x25cfc7[_0x425890(0xd56,0x141b,0xd34,0xb8e)]=0x1;let _0x31eae0=[_0x25cfc7];const _0xd4c624={};_0xd4c624[_0x17318e(0x713,0xb49,-0x16d,0x810)]=result[_0x17318e(0xaeb,-0x31d,0xc3,0x59e)][0x638+0x12ac+-0x18e4];const _0x5025bd={};_0x5025bd[_0x425890(-0x426,0x381,-0x35a,-0x1a6)]=_0xd4c624,_0x5025bd[_0x17318e(0xcd,0x3f2,-0x50a,0x527)]=_0x17318e(0xe79,0x1200,0xdce,0x149e)+_0x17318e(0x19f4,0xdc3,0x1880,0x1390)+_0x425890(0xaa0,0x1f4,0x70e,0x36d)+':\x20'+result[_0x425890(0x7a4,0xff0,0x800,0x1458)]+(_0x17318e(0xb6f,-0x135,0x63a,0x567)+_0x17318e(0x1fad,0xe78,0x1ad7,0x1527))+result[_0x17318e(0x132a,0x122e,0xc65,0x1638)]+(_0x17318e(0x1b18,0xd43,0xdb4,0x1447)+_0x17318e(0xb79,0xa3b,0x10a,0xa1c))+result[_0x17318e(0xfbd,0xce0,0x498,0xb5f)]+(_0x425890(-0x5ab,0x24f,0xba6,0x3ae)+_0x17318e(0x34a,0x7a,0xe72,0x58c))+(result[_0x425890(0xd4,0x381,0x6ad,0x69)][-0x1*0x824+0x209*0x3+0x20b]||result[_0x425890(0x698,0x381,0x7d5,-0x287)][0x1*0x1417+0x162c+0x2*-0x1521]||result[_0x425890(0xcdf,0x381,0x91a,0x3ad)][0x16*0x94+0x181*0xa+-0x1bc2*0x1]),_0x5025bd['footer']=_0x3797bd[_0x17318e(0x16f6,0xdd7,0x18f1,0x12db)][_0x425890(0x8b1,0xe82,0x14df,0xa23)],_0x5025bd['buttons']=_0x31eae0,_0x5025bd[_0x425890(0x17f8,0xfef,0x1655,0x11ae)]=0x4;let _0x3306a7=_0x5025bd;_0x3797bd[_0x425890(0xc11,0x41f,0x92a,0xa5a)+'e'](_0x17aa6d[_0x425890(0x11a3,0xcc7,0x38c,0x251)],_0x3306a7,{'quoted':_0x17aa6d});}}break;case _0x295ea5[_0x17318e(0xe8,-0x1a9,-0x6b,0x536)]:{if(!_0x116129)return _0xcd1d32(_0x425890(0xcfe,0x593,0x775,-0x1ab)+_0x17318e(0x655,0xb40,0x17e,0x678));let {wikimedia:_0x4bbd64}=_0x295ea5[_0x17318e(0x4d8,0xf91,0x83a,0x7c9)](require,_0x17318e(0x5b2,0x14dc,0xe27,0xa70)+_0x425890(0xcc,0x61b,-0x136,-0xa1));_0x54fa69=await _0x295ea5[_0x425890(0x9f4,0x1465,0xe02,0x11d4)](_0x4bbd64,_0x116129),result=_0x54fa69[Math['floor'](_0x295ea5['qphlI'](Math[_0x425890(0x11b2,0x92e,0xaaa,0xeac)](),_0x54fa69[_0x17318e(0xa77,0x262,0x6b8,0xad9)]))];const _0x252202={};_0x252202[_0x425890(0x6cf,0x10a0,0xa45,0x1afa)+'t']=_0x295ea5[_0x17318e(0x53e,0x665,0x740,0xc8f)];const _0x350c79={};_0x350c79['buttonId']=_0x17318e(0xb77,0x2f6,0xf45,0x97b)+_0x116129,_0x350c79[_0x425890(0x1aef,0x10fb,0xa52,0x884)]=_0x252202,_0x350c79[_0x425890(0x1a8b,0x141b,0x1343,0x19e9)]=0x1;let _0x1ce112=[_0x350c79];const _0x5d9270={};_0x5d9270['url']=result[_0x425890(0x329,0x381,0xaa0,-0x4d1)];const _0x3cee05={};_0x3cee05[_0x17318e(-0x35d,0x2f6,-0xbf,0x59e)]=_0x5d9270,_0x3cee05['caption']=_0x17318e(0x1e14,0xd3c,0x1577,0x149e)+'𝗔𝗚𝗢𝗡-𝗕𝗢𝗧࿐\x0a'+_0x17318e(0x730,0xabc,-0x56e,0x411)+':\x20'+result[_0x425890(0x1838,0xff0,0xa02,0x189e)]+('\x0a🔰🌹\x20Source'+_0x17318e(0x4d5,0x57c,0xfca,0xa1c))+result[_0x425890(0xb20,0x942,0x2c8,0x11a7)]+(_0x425890(0x5e5,0x24f,0x4ae,-0x16c)+_0x17318e(0xc80,0x761,0x9a5,0x58c))+result[_0x17318e(0xa41,0xe5a,0xaaf,0x59e)],_0x3cee05[_0x17318e(0x522,0x21c,0x81e,0x597)]=_0x3797bd[_0x425890(0x639,0x10be,0xebb,0xc34)][_0x425890(0x18bb,0xe82,0xf60,0xe16)],_0x3cee05[_0x17318e(0xf2b,0x1787,0x1a2d,0x117e)]=_0x1ce112,_0x3cee05[_0x425890(0xdbd,0xfef,0x686,0x15ba)]=0x4;let _0x21690a=_0x3cee05;_0x3797bd[_0x17318e(0xa3f,0x800,0x298,0x63c)+'e'](_0x17aa6d['chat'],_0x21690a,{'quoted':_0x17aa6d});}break;case _0x295ea5[_0x17318e(0xe3a,0x6c5,0x9f5,0xf18)]:case _0x17318e(0x142a,0x674,0xe40,0xb2e)+'s':case _0x295ea5[_0x17318e(0x147f,0x17ac,0x439,0xd7f)]:case _0x295ea5['Ryqle']:{if(_0x295ea5[_0x17318e(-0x2c,0xf61,0x2be,0x95b)]!==_0x17318e(0xd9d,0xd29,0xb5e,0x326)){let {quotesAnime:_0x2b0c9f}=require(_0x295ea5[_0x425890(0xc66,0x139f,0x1b56,0xd5f)]),_0x872045=await _0x2b0c9f();result=_0x872045[Math[_0x17318e(0xd7d,0x1616,0xefe,0x1632)](_0x295ea5['KYtcI'](Math['random'](),_0x872045[_0x17318e(0xb4c,0x444,0x10de,0xad9)]))];const _0x8e56d9={};_0x8e56d9[_0x17318e(0x1320,0x1b69,0xd25,0x12bd)+'t']=_0x295ea5[_0x425890(0x114d,0xb6d,0x1086,0x859)];const _0x5b1864={};_0x5b1864[_0x17318e(0x197d,0x768,0xfb0,0x1194)]=_0x17318e(0x3f3,0x890,0x70b,0xc5d)+'e',_0x5b1864[_0x17318e(0x191d,0xc68,0xe8c,0x1318)]=_0x8e56d9,_0x5b1864['type']=0x1;let _0x5b137a=[_0x5b1864];const _0x269d6c={};_0x269d6c[_0x17318e(-0x484,0x446,0x4eb,0x405)]='~_'+result[_0x17318e(0x1008,0xfa6,-0x364,0x66b)]+_0x17318e(0x184d,0x1459,0x4cb,0xef7)+result[_0x425890(0xe8f,0x5ef,-0x31c,0x310)]+_0x17318e(0x1940,0xd8e,0x17a8,0xf42)+result['anime']+_0x17318e(-0x52,-0x287,0x7d0,0x7d4)+result[_0x425890(0x1174,0xec7,0x105e,0xca9)],_0x269d6c[_0x425890(-0x4bf,0x37a,-0x9d,0x4fc)]=_0x295ea5[_0x17318e(0xd36,0x174e,0x1e90,0x16e9)],_0x269d6c['buttons']=_0x5b137a,_0x269d6c['headerType']=0x2;let _0x557426=_0x269d6c;_0x3797bd[_0x17318e(0xf55,-0x372,0x8ad,0x63c)+'e'](_0x17aa6d['chat'],_0x557426,{'quoted':_0x17aa6d});}else{let _0x161887=_0x4e3af0[_0x17318e(0x577,0x5c2,0x832,0xac3)+'amp'],_0x28b54b=_0x11b2df['receiptTim'+_0x425890(0xd45,0x11fb,0xb38,0xb36)],_0x9dcc4=_0x161887?_0x161887:_0x28b54b;_0x232730+=_0x425890(0x207,0xc75,0x987,0xfde)+_0x3e89a5[_0x425890(0x78b,0x3a4,-0x1e5,-0x143)][_0x425890(0x184,0x2eb,0xc42,0xbda)]('@')[0x3*-0xadb+0x187*0xf+0x9a8]+'\x0a',_0x1f9de6+=_0x425890(-0x318,0x491,0x121,0x7a0)+'e\x20:*\x20'+_0x100596(_0x295ea5['rLTiH'](_0x9dcc4,-0xc*-0x41+-0x225+0x301))[_0x17318e(0xdef,0xb2f,0x1981,0x1508)](_0x17318e(0xd45,0x197d,0x1c8b,0x17c2)+_0x425890(0xbac,0xfbd,0xf9f,0xf2f))+(_0x17318e(0xa2e,0x964,0x7a3,0xc0c)+'s\x20:*\x20')+(_0x161887?_0x295ea5['XMvvv']:_0x295ea5[_0x425890(0xc44,0xff7,0x19a8,0x91e)])+'\x0a\x0a';}}break;case _0x295ea5[_0x425890(0x3af,0xab2,0x1387,0xaa7)]:case _0x425890(0x195e,0x141d,0xe30,0x176f)+_0x17318e(0x359,0x91e,0x45f,0x7e4):case _0x295ea5[_0x425890(0x39b,0x13b,0x7ec,0x9dc)]:case _0x295ea5[_0x17318e(0x13a4,0x10fd,0xc78,0xe0c)]:case _0x295ea5[_0x425890(0x7cf,0xcf8,0x430,0x9dd)]:{let _0x48e65d=await _0x295ea5['CdYyy'](fetchJson,api(_0x295ea5['iGZhi'],_0x295ea5[_0x17318e(0x15f8,0x1622,0x13dd,0x1821)](_0x295ea5[_0x425890(0xe43,0x125e,0x1739,0x1310)],_0x1cbc75),{},_0x295ea5[_0x17318e(0xdb9,0x5d4,0x134d,0x902)]));const _0x42e08f={};_0x42e08f[_0x17318e(0xe8e,0x156a,0xd96,0x12bd)+'t']=_0x295ea5[_0x425890(0x45c,0xb6d,0x2a5,0x5e8)];const _0x9d4d55={};_0x9d4d55[_0x17318e(0x783,0xcd3,0x148d,0x1194)]=_0x425890(0x1be,0x1df,0xac7,-0x359),_0x9d4d55[_0x17318e(0x106c,0x188e,0xf49,0x1318)]=_0x42e08f,_0x9d4d55[_0x17318e(0x16de,0x1af4,0x1b2a,0x1638)]=0x1;let _0x9a7231=[_0x9d4d55];const _0x37be43={};_0x37be43[_0x17318e(0xd34,0xde3,0xdab,0x405)]=_0x48e65d[_0x425890(0x2b1,0x23d,0x49c,-0x41)][_0x17318e(0xf0,-0x82,0xf97,0x9e0)],_0x37be43['footer']=_0x295ea5[_0x17318e(0x1324,0x1fca,0x118d,0x16e9)],_0x37be43['buttons']=_0x9a7231,_0x37be43[_0x17318e(0xbe2,0x1b79,0xa3c,0x120c)]=0x2;let _0x3adeae=_0x37be43;_0x3797bd[_0x17318e(0xd3c,0x65a,-0x3b9,0x63c)+'e'](_0x17aa6d[_0x17318e(0x49f,0x1766,0xaa5,0xee4)],_0x3adeae,{'quoted':_0x17aa6d});}break;case _0x295ea5['oKqrE']:case _0x295ea5[_0x425890(-0x3bd,0x304,-0xf0,-0x254)]:{if(!_0x295ea5[_0x425890(-0x77d,0x15d,0x6d5,0x40d)](Number,_0x116129))return _0x295ea5[_0x17318e(0xfbe,0xf8e,0xf2b,0x17fc)](_0xcd1d32,_0x17318e(0x1300,0x964,0x6cf,0xd25)+_0x295ea5[_0x17318e(0x8c1,0x811,0x826,0xdb1)](_0x4fea53,_0x1cbc75)+('\x20916909137'+_0x17318e(0x45a,0xe22,0xb4a,0xed6)));let _0x1e20e8=await primbon['nomer_hoki'](_0x295ea5['OhjRE'](Number,_0x116129));if(_0x1e20e8['status']==![])return _0x295ea5[_0x17318e(0x12d2,0x9f4,0x11d3,0xe37)](_0xcd1d32,_0x1e20e8[_0x425890(0x3b6,0x7c3,0xc0f,0xeb0)]);_0x3797bd[_0x425890(0x109e,0x12b2,0x818,0x131f)](_0x17aa6d[_0x17318e(0xb41,0xbb5,0x5a7,0xee4)],_0x425890(0x1db5,0x1361,0x127c,0xe3b)+_0x17318e(-0x614,0x2e7,-0x8b,0x420)+_0x1e20e8[_0x425890(-0x1d8,0x7c3,-0x2a9,0xb4a)]['nomer_hp']+(_0x425890(-0x1a8,0x637,0x2a9,0xfad)+_0x425890(0xd52,0x1231,0x1260,0xf84)+_0x17318e(0x1515,0xc28,0x8ef,0x12d7))+_0x1e20e8[_0x17318e(0xd68,0x108,0x431,0x9e0)][_0x17318e(0x430,0x82a,0x6d2,0x5e3)+'i']+(_0x17318e(0x8de,0xd17,0x4a9,0x779)+_0x17318e(-0x4e,-0x308,-0x350,0x577)+'\x20:*\x0a-\x20Rich'+_0x17318e(0x123a,-0x119,0xdfc,0x983))+_0x1e20e8[_0x17318e(0x76e,0xc79,0xb3c,0x9e0)][_0x17318e(0x112c,0xd6e,0x783,0xcfc)+_0x17318e(0x1a5a,0x1bc0,0x208d,0x15fc)][_0x425890(0x4a9,0xb74,0x622,0x1601)]+('\x0a-\x20Health\x20'+':\x20')+_0x1e20e8['message'][_0x425890(0xf2f,0xadf,0xecf,0x1218)+_0x17318e(0x11b0,0xe71,0x1c8d,0x15fc)][_0x425890(0x6a3,0x465,-0x1e5,0xc2e)]+_0x425890(0x143f,0x141e,0xa3e,0x13d5)+_0x1e20e8[_0x17318e(0x1b9,0xc7d,0x728,0x9e0)][_0x425890(0xfea,0xadf,0x392,0x74d)+_0x425890(0x986,0x13df,0xe07,0x1263)][_0x17318e(0x1d48,0x2172,0x1908,0x17f3)]+('\x0a-\x20Stabili'+_0x425890(0x16c9,0xffb,0xa37,0x1209))+_0x1e20e8[_0x425890(0x480,0x7c3,-0x279,0x426)][_0x17318e(0x1183,0xff5,0x406,0xcfc)+_0x17318e(0x1b15,0x1953,0x185b,0x15fc)]['kestabilan']+(_0x17318e(0xa48,0x7cb,0x677,0xa7e)+_0x17318e(0x8b2,0x1328,0xc84,0xce9))+_0x1e20e8['message'][_0x425890(0x89f,0xadf,0x5eb,0x547)+'itif']['persentase']+(_0x17318e(0x143c,0x1128,0xe55,0x171a)+_0x17318e(0x10e,0xb6d,0x58c,0x577)+_0x425890(0xcb5,0x292,-0x39a,0x721)+_0x17318e(0x1292,0x16e6,0xb8e,0xc80))+_0x1e20e8[_0x425890(0x463,0x7c3,0xd93,0x56b)][_0x17318e(0x21c9,0x21ef,0xd57,0x17ba)+_0x425890(0x13e8,0xb15,0x85,0x50e)]['perselisih'+'an']+'\x0a-\x20Lost\x20:\x20'+_0x1e20e8[_0x17318e(0x2b5,-0x28,0xb,0x9e0)][_0x17318e(0x1518,0x1dc2,0x105d,0x17ba)+_0x17318e(0x1291,0xf63,0x1101,0xd32)]['kehilangan']+('\x0a-\x20Catastr'+_0x17318e(0x1984,0x192d,0x1417,0x1395))+_0x1e20e8[_0x425890(0xd84,0x7c3,0xaa,0x4a0)][_0x17318e(0x2205,0x1d13,0x11d2,0x17ba)+_0x17318e(0xfb6,0x1425,0xc8d,0xd32)]['malapetaka']+(_0x425890(0x7c7,0x1ae,-0x252,-0x44e)+_0x17318e(0x1309,0x198d,0x1422,0x1484))+_0x1e20e8[_0x425890(0x6d4,0x7c3,0x121f,0xd24)][_0x425890(0x1899,0x159d,0x1a3e,0xf85)+_0x17318e(0x160b,0x2b8,0x164b,0xd32)]['kehancuran']+(_0x17318e(0x11a,0xdfa,0x11d8,0xa7e)+_0x425890(0x12e1,0xacc,0xab3,0x248))+_0x1e20e8[_0x425890(0x11cc,0x7c3,0x100b,0xaee)]['energi_neg'+_0x425890(0x428,0xb15,0x124a,0x249)]['persentase'],_0x17aa6d);}break;case _0x295ea5['qtFSN']:case _0x425890(0xb3e,0x933,0x720,0x90a)+'i':{if(_0x295ea5[_0x425890(0xaba,0xb98,0x145a,0x120d)]!==_0x295ea5[_0x425890(0x128,0xb98,0x1a6,0xc16)]){if(_0xffcc6d[_0x425890(0x10bf,0x8db,0xdaa,0x9b3)]===_0x295ea5[_0x425890(0x532,0xcca,0x166c,0xda9)])return;if(_0x2f9158[_0x17318e(0xd7a,0x106,0x1370,0xaf8)]===_0x295ea5[_0x17318e(0x1f5d,0x19c5,0xde2,0x16f8)]){const _0x1541a7={};_0x1541a7[_0x17318e(-0x3cc,0x501,0x80d,0x405)]=_0x425890(0xaba,0x1346,0x1474,0x1670)+_0x17318e(-0x5a,0x399,0x8e8,0x904);const _0x2e2471={};_0x2e2471['quoted']=_0x11aa69,_0x423936[_0x17318e(0xfa4,0xdce,0x469,0x63c)+'e'](_0x4baafa,_0x1541a7,_0x2e2471);}}else{if(!_0x116129)return _0xcd1d32('Example\x20:\x20'+(_0x4fea53+_0x1cbc75)+_0x17318e(-0x4b,0x3c6,0xe52,0x883));let _0x2a1b98=await primbon[_0x425890(0x119d,0x119d,0xb5c,0x1ac4)+'pi'](_0x116129);if(_0x2a1b98[_0x425890(0x1ab4,0x1098,0x1171,0xc63)]==![])return _0xcd1d32(_0x2a1b98[_0x425890(0x330,0x7c3,0xd95,-0xf4)]);_0x3797bd[_0x425890(0x195c,0x12b2,0x1c99,0xe95)](_0x17aa6d['chat'],_0x425890(0x42a,0xe2c,0x85c,0xf8d)+_0x17318e(0x19a0,0x1159,0xe80,0x12f8)+_0x2a1b98[_0x425890(0x9f4,0x7c3,0x24,0xf2a)][_0x17318e(0x1fb5,0x1d6a,0x1a4e,0x1592)]+(_0x17318e(0x879,-0x1e1,0xb9c,0x3aa)+_0x17318e(0xd07,0x226,-0x1b7,0x876))+_0x2a1b98[_0x17318e(0xd8,0xb16,0x114e,0x9e0)][_0x425890(-0x438,0x23c,0xb06,0x1eb)]+(_0x17318e(0x9a1,0x199,0xe7d,0xbb1)+'ion\x20:*\x20')+_0x2a1b98[_0x17318e(0x71e,0x2d1,0xab,0x9e0)]['solusi'],_0x17aa6d);}}break;case _0x295ea5['qPxFt']:case _0x425890(0x1ad1,0x12bd,0x911,0x1b32):{if(_0x295ea5[_0x17318e(0x1607,0xc13,0x43e,0xd42)](_0x295ea5[_0x17318e(0x427,-0x10f,0xee,0x93b)],_0x295ea5[_0x425890(0x9b2,0x71e,0x6a7,0xd86)]))return[this['a'],this['b']]['includes'](_0x17f796);else{if(!_0x116129)throw _0x425890(0xec,0xb08,0x122b,0x1140)+_0x295ea5[_0x425890(0x684,0x526,0x41c,0x5cf)](_0x4fea53,_0x1cbc75)+(_0x17318e(0x720,0x100d,0xfa4,0x8d4)+_0x425890(0xf7d,0xd95,0x574,0x1244)+_0x17318e(-0xc3,0xce,0x634,0x503)+_0x17318e(0x141b,0xe1a,0x1fa7,0x1673));let [_0x15444d,_0xc6f29,_0x39c035,_0x386b7c,_0x3ac8d9,_0x6fb69,_0x1ab837,_0x41bae4]=_0x116129[_0x425890(0xe6,0x2eb,-0x54b,0xd17)]`,`,_0x49a54f=await primbon[_0x425890(0x8e8,0x8ad,0xb74,0xe5)+'doh'](_0x15444d,_0xc6f29,_0x39c035,_0x386b7c,_0x3ac8d9,_0x6fb69,_0x1ab837,_0x41bae4);if(_0x295ea5[_0x425890(0x4d7,0x4b1,0x256,0xe0b)](_0x49a54f[_0x425890(0x11a7,0x1098,0x11b8,0x19f0)],![]))return _0x295ea5[_0x425890(0xdba,0xf78,0x9d5,0xad3)](_0xcd1d32,_0x49a54f[_0x17318e(0x26,0x594,0xe21,0x9e0)]);_0x3797bd[_0x425890(0xbc1,0x12b2,0x10be,0x1bf0)](_0x17aa6d[_0x17318e(0x1280,0x632,0xbb8,0xee4)],'🔰🌹\x20*Your\x20N'+_0x425890(0x102a,0xec1,0x10bb,0x946)+_0x49a54f[_0x425890(0x777,0x7c3,0xea9,0x82d)][_0x17318e(0x1def,0xe16,0x15b5,0x1671)][_0x425890(0x6e8,0x111e,0x85b,0x13c3)]+(_0x425890(0x61d,0xebf,0xaf9,0x12c1)+_0x17318e(0x103b,0xe29,0xcdc,0x124b))+_0x49a54f[_0x425890(-0x160,0x7c3,0x11dd,-0x170)][_0x17318e(0xfda,0x1f34,0xe3c,0x1671)][_0x425890(0x2cb,0x969,0x91d,0xf7a)]+(_0x425890(0x172e,0x1053,0xfca,0x1121)+_0x425890(0x18cb,0x11e5,0x1326,0x1255))+_0x49a54f[_0x425890(0x80b,0x7c3,0x749,-0x53)][_0x17318e(0x58c,0xf54,0x103,0x6fb)+'gan']['nama']+('\x0a🔰🌹\x20*Born\x20'+_0x425890(0x7ce,0xc00,0x1608,0x1348))+_0x49a54f[_0x17318e(0x1142,0x5ab,0xa07,0x9e0)]['nama_pasan'+_0x425890(0x71b,0xa12,0x3c1,0x3bb)][_0x17318e(0xbf8,0xc0f,0xf71,0xb86)]+(_0x425890(0xc22,0x692,-0x216,0xb1)+_0x17318e(0x1cea,0x140d,0x1132,0x1829))+_0x49a54f['message'][_0x425890(0x34a,0x23d,0x2d0,-0x36)]+(_0x17318e(-0x54,0xa16,-0x10d,0x808)+_0x17318e(0x1e1a,0x1533,0xe7a,0x17f2))+_0x49a54f[_0x425890(0x33b,0x7c3,0x75b,-0x251)][_0x425890(0x1892,0x1197,0x823,0x959)]+(_0x17318e(0xe88,0xa22,0x3f7,0xab3)+_0x17318e(0xb75,0x1c0,0x383,0x555))+botname,_0x17aa6d);}}break;case'ramalanjod'+_0x17318e(0x13e9,0x12b9,0x96f,0x135d):case _0x425890(0x1056,0x12bd,0xec5,0x8fb)+_0x425890(0xd25,0x47d,0xcb5,-0x53):{if(_0x295ea5[_0x17318e(0xca2,0x157,0x421,0x8a2)](_0x425890(0xd0a,0x5aa,-0x184,0xbf0),_0x295ea5[_0x425890(0x144d,0xbd9,0x1485,0xa9b)])){if(!_0x116129)throw _0x17318e(0x497,0x5a3,0x89f,0xd25)+_0x295ea5['KEGep'](_0x4fea53,_0x1cbc75)+(_0x425890(0xfb5,0x6b7,-0x22,0xb13)+_0x425890(0x13ab,0xd95,0xffe,0x13c0)+_0x17318e(-0x550,0xcdb,-0x43e,0x503)+_0x17318e(0x18a3,0x1645,0x1364,0x1673));let [_0x2a5077,_0x552f05,_0x53068c,_0x337a91,_0x23e042,_0x5e30e1,_0x45f566,_0x42be43]=_0x116129['split']`,`,_0x481ce1=await primbon[_0x425890(0x39e,0x8ad,0xae5,0x7d2)+_0x17318e(0xd1,0xde0,0x7b3,0x51a)](_0x2a5077,_0x552f05,_0x53068c,_0x337a91,_0x23e042,_0x5e30e1,_0x45f566,_0x42be43);if(_0x295ea5[_0x17318e(0x942,0xa4d,0xad3,0xb9f)](_0x481ce1[_0x425890(0xa0b,0x1098,0x18a1,0xfc3)],![]))return _0x295ea5['vShcO'](_0xcd1d32,_0x481ce1[_0x425890(0x601,0x7c3,0xe58,0x496)]);_0x3797bd['sendText'](_0x17aa6d[_0x425890(0x15a7,0xcc7,0xd98,0x12eb)],'🔰🌹\x20*Your\x20N'+'ame\x20:*\x20'+_0x481ce1[_0x17318e(0xf46,0x13e5,0x6e0,0x9e0)]['nama_anda'][_0x425890(0xe85,0x111e,0x1234,0x131a)]+(_0x17318e(0xff1,0x1549,0xedf,0x10dc)+'Birth\x20:*\x20')+_0x481ce1[_0x17318e(0x48f,0x125f,0xdea,0x9e0)]['nama_anda']['tgl_lahir']+(_0x425890(0xe7e,0x1053,0x7b8,0x10d1)+_0x17318e(0x14d8,0xeaf,0x186c,0x1402))+_0x481ce1[_0x17318e(0x10ca,0xeeb,0x91e,0x9e0)][_0x425890(-0x214,0x4de,0x65e,0x92d)+_0x425890(0xb34,0xa12,0x207,0xdbd)]['nama']+(_0x425890(0x38d,0x9f3,0xc8c,0xfac)+_0x17318e(0x11a8,0x16f3,0x142f,0xe1d))+_0x481ce1[_0x17318e(0x566,0x1212,0xf67,0x9e0)]['nama_pasan'+_0x425890(0xdcd,0xa12,0x26d,0x308)][_0x17318e(0x331,0x90a,0x48e,0xb86)]+('\x0a🔰🌹\x20*Resul'+_0x425890(0x14d8,0x160c,0x19b3,0x18ae))+_0x481ce1['message'][_0x425890(0x196,0x23d,-0x17e,0x2b8)]+(_0x425890(-0x42a,0x5eb,0x572,-0x1cd)+'\x20:*\x20')+_0x481ce1['message'][_0x17318e(0x93d,0x1805,0x11e0,0x13b4)]+(_0x17318e(0x9f3,0x48e,0x12ea,0xab3)+_0x425890(0x8a8,0x338,-0x12a,-0x4ab))+botname,_0x17aa6d);}else _0x367fb3(_0x425890(0x1a94,0x1518,0x16b1,0x1564)+_0x425890(0xf8f,0xb24,0x15b9,0xa99)+_0x17318e(0xabe,0x12d3,0x7b5,0xb11)+_0x425890(0x943,0x1054,0x137d,0x12a2)+_0x17318e(0xf8d,0x46d,0x8d5,0xe70)+_0x295ea5[_0x17318e(0xdb6,0x1047,0x7e3,0x10a6)](_0x4d5f38,_0x82ecfc[_0x425890(0x1413,0xa69,0xb51,0x2f6)])+('\x0a*Your\x20Rem'+_0x17318e(0xd04,0xbb0,0x8e7,0x7b4)+_0x17318e(0xccc,0x12ae,0x122b,0x966))+_0x2219ce(_0x406876[_0x17318e(0x3c9,0xa07,0x1625,0xc86)]));}break;case _0x295ea5[_0x425890(0x401,0x3c3,0x7db,0x826)]:{if(!_0x116129)throw _0x425890(0xce9,0xb08,0xa04,0xe1b)+_0x295ea5[_0x17318e(0x1292,0x2111,0x2051,0x1773)](_0x4fea53,_0x1cbc75)+('\x20Dika,\x207,\x20'+_0x425890(0x10d6,0xd95,0x152f,0x1571)+_0x425890(-0x8a,0x2e6,0x878,0xd1e)+'11,\x202004');let [_0x136212,_0x1d24d6,_0x418f71,_0x20b439,_0x3dfaf6,_0xc291b1,_0x400c06,_0xcea27d]=_0x116129[_0x17318e(0xc62,0x3bd,-0x588,0x508)]`,`,_0x1c31f6=await primbon[_0x425890(-0x598,0x171,0xbe5,0xae2)+'i'](_0x136212,_0x1d24d6,_0x418f71,_0x20b439,_0x3dfaf6,_0xc291b1,_0x400c06,_0xcea27d);if(_0x295ea5[_0x425890(0x15be,0xedf,0xaef,0x11c2)](_0x1c31f6[_0x17318e(0x14ee,0xea6,0x1ca3,0x12b5)],![]))return _0x295ea5[_0x425890(0x472,0x829,0xedf,0x362)](_0xcd1d32,_0x1c31f6[_0x17318e(0x68e,0x1390,0x495,0x9e0)]);_0x3797bd[_0x425890(0x9e2,0x12b2,0xfc9,0xf4a)](_0x17aa6d[_0x425890(0x40b,0xcc7,0x1736,0x330)],_0x425890(0xc6b,0x127a,0x1612,0x1ce8)+_0x17318e(0x698,0xce6,0xc97,0xdef)+'*\x20'+_0x1c31f6['message'][_0x17318e(0x1d46,0x17da,0x113c,0x14e6)][_0x425890(0x1135,0x111e,0x6e9,0xb64)]+(_0x425890(0x153c,0xed2,0x1412,0xe22)+'nd\x20Born\x20:*'+'\x20')+_0x1c31f6[_0x425890(0xa12,0x7c3,0x4a5,0x105e)][_0x425890(0x12b3,0x12c9,0x940,0x18c2)][_0x17318e(0x11a8,0xf78,0x10ed,0xb86)]+(_0x17318e(0x843,0xd53,0x87c,0xab5)+'s\x20Name\x20:*\x20')+_0x1c31f6[_0x425890(0x355,0x7c3,0x7c7,0x27c)]['istri']['nama']+('\x0a🔰🌹\x20*Born\x20'+_0x17318e(0xd35,0x12b4,0x1c1b,0x151b))+_0x1c31f6[_0x17318e(0x1226,0xf8f,0x86a,0x9e0)][_0x425890(0x15b2,0x1297,0xc38,0x1489)][_0x17318e(0x120c,0xde0,0x1114,0xb86)]+(_0x425890(0x10a0,0x692,0x8a6,0xa15)+_0x425890(0x16f7,0x160c,0x1770,0x1266))+_0x1c31f6[_0x425890(0x210,0x7c3,0x10ca,-0x272)][_0x17318e(-0xe,-0x432,0xe3f,0x45a)]+(_0x17318e(0x104f,0xea8,0xbba,0x808)+_0x17318e(0x14dd,0x100e,0xfe6,0x17f2))+_0x1c31f6['message']['catatan']+('\x0a\x0aPOWERD\x20B'+_0x17318e(0xf6a,-0x406,0x22e,0x555))+botname,_0x17aa6d);}break;case _0x17318e(0x34d,0x23f,0x2b,0x772)+'ta':case _0x295ea5[_0x17318e(0xa8,-0x704,0x4af,0x33d)]:{if(!_0x116129)throw _0x425890(0x23d,0xb08,0x1222,0xed4)+_0x295ea5[_0x425890(0xb2e,0x10ee,0x6ef,0x1741)](_0x4fea53,_0x1cbc75)+(_0x425890(0x10a4,0x6b7,0xa11,0x399)+'7,\x202005,\x20N'+_0x17318e(-0x3ff,0x6fd,0xe90,0x503)+_0x425890(0x10a3,0x1456,0xf03,0xe7f));let [_0x57aa77,_0x341808,_0x4a1a16,_0x5734b3,_0x274485,_0x163921,_0x1ec40d,_0x509907]=_0x116129['split']`,`,_0x328b3c=await primbon[_0x17318e(0xcb2,0xbe0,0x113a,0x11d9)+_0x17318e(0x134a,0x98f,0x1bb4,0x1389)](_0x57aa77,_0x341808,_0x4a1a16,_0x5734b3,_0x274485,_0x163921,_0x1ec40d,_0x509907);if(_0x295ea5['CwpGC'](_0x328b3c[_0x425890(0x15da,0x1098,0x19a5,0x18cb)],![]))return _0x295ea5[_0x17318e(0xb78,0x14d8,0xe46,0x12ea)](_0xcd1d32,_0x328b3c['message']);_0x3797bd[_0x425890(0x1d52,0x12b2,0x1305,0x99f)](_0x17aa6d[_0x425890(0x11c7,0xcc7,0x1405,0x1038)],_0x17318e(0x168a,0xe1e,0xb2d,0xc11)+_0x425890(0x1358,0xec1,0x7d8,0xf3c)+_0x328b3c[_0x17318e(-0xaa,0x588,0x12e2,0x9e0)][_0x425890(0x1b8f,0x1454,0x140b,0x1336)][_0x425890(0x7ac,0x111e,0x841,0x832)]+(_0x425890(0x42c,0xebf,0x500,0xc2d)+_0x17318e(0x18cb,0x112e,0x1773,0x124b))+_0x328b3c[_0x17318e(0xc21,0xaf3,0xb3d,0x9e0)][_0x425890(0x1929,0x1454,0x1dfa,0x16d6)][_0x17318e(0x18b,0x1367,0xdfc,0xb86)]+('\x0a🔰🌹\x20*Coupl'+_0x17318e(0xd9e,0x12c7,0xb74,0x1402))+_0x328b3c['message']['nama_pasan'+'gan'][_0x17318e(0x19ca,0x1aee,0xeef,0x133b)]+(_0x17318e(0xba7,0x52b,0x853,0xc10)+_0x425890(0xfa4,0xc00,0x911,0xe02))+_0x328b3c[_0x425890(0x596,0x7c3,0x102b,-0x1d5)][_0x425890(-0x193,0x4de,-0x23d,0x2b6)+'gan'][_0x425890(-0x129,0x969,0x933,-0xda)]+(_0x425890(0x1be,0x55c,0x767,0xb10)+_0x17318e(0x55f,0x6d0,0x580,0xefb)+'*\x20')+_0x328b3c[_0x425890(0x93a,0x7c3,0x700,0x40d)][_0x17318e(0xa81,0x6ac,-0x10e,0x36b)+'if']+(_0x17318e(0x1bad,0x103c,0x1766,0x171a)+'ive\x20Side\x20:'+'*\x20')+_0x328b3c['message'][_0x17318e(0x1952,0x1615,0xbef,0x15ca)+'if']+(_0x17318e(0x939,0x814,0x6b4,0x808)+'\x20:*\x20')+_0x328b3c['message']['catatan']+('\x0a\x0aPOWERD\x20B'+'Y:\x20\x20')+botname,_0x17aa6d);}break;case _0x295ea5[_0x425890(0x7c5,0x3cb,-0x1f8,-0x155)]:{if(_0x295ea5[_0x425890(0x124,0xa54,0x10c,0xf41)]===_0x17318e(0xfce,0x870,0x127a,0xd16)){if(!_0x116129)throw _0x425890(0x12c6,0xb08,0xefa,0x8c)+_0x295ea5['CNqdB'](_0x4fea53,_0x1cbc75)+('\x20Dika\x20Ardi'+_0x17318e(0x5dc,0xa12,0xb40,0xe67));let _0x5a254b=await primbon[_0x425890(-0x645,0x23e,0x7c1,-0x545)](_0x116129);if(_0x295ea5[_0x17318e(0x1205,0x19a7,0xfea,0x121a)](_0x5a254b[_0x425890(0x1a89,0x1098,0x19fc,0x1a0b)],![]))return _0xcd1d32(_0x5a254b['message']);_0x3797bd[_0x425890(0xe03,0x12b2,0xe97,0x1c2f)](_0x17aa6d[_0x17318e(0x15df,0xd7f,0x11b9,0xee4)],'🔰🌹\x20*Name\x20:'+'*\x20'+_0x5a254b[_0x425890(0x19d,0x7c3,0x7,0xecc)][_0x425890(0x19b5,0x111e,0x16c5,0xef7)]+(_0x17318e(-0x3ea,0xa57,0x97a,0x3aa)+_0x17318e(0xcaa,0xbb2,0x587,0x876))+_0x5a254b[_0x425890(0x979,0x7c3,-0x15e,-0x21a)][_0x17318e(0x27,0xcd6,0x9ae,0x459)]+(_0x17318e(-0x126,0x63d,0xa05,0x808)+_0x17318e(0x125d,0x1f08,0x20e1,0x17f2))+_0x5a254b[_0x17318e(0x929,0x1160,0xc24,0x9e0)][_0x17318e(0xfcb,0x18b3,0xd47,0x13b4)],_0x17aa6d);}else{const _0x39636a={};_0x39636a['id']=_0x154f47[_0x17318e(0x113c,0xc6,0xe0e,0xa24)]['id'],_0x39636a[_0x17318e(0x693,0x8e9,-0x1f,0x626)]=!![];const _0xb5356a={};_0xb5356a[_0x425890(0xacf,0x7c3,0x24b,0x96)]=_0x39636a;const _0x16404d={};_0x16404d[_0x17318e(0x130c,0x935,0x18dd,0x13c4)]=_0xb5356a,_0x3b178a['chatModify'](_0x16404d,_0x1cf6cc[_0x425890(0xc00,0xcc7,0x1260,0x1441)],[])['then'](_0x3661f9=>_0x2c9216(_0x390902(_0x3661f9)))['catch'](_0x277dc2=>_0x4e4eb3(_0x172c1a(_0x277dc2)));}}break;case _0x295ea5[_0x425890(0x759,0xeb4,0xd4b,0x117d)]:case _0x295ea5[_0x17318e(0x167,0x63a,0x6b1,0xaf6)]:{if(!_0x116129)throw _0x17318e(0xa3b,0xe1f,0xcf4,0xd25)+_0x295ea5[_0x17318e(0x1a7e,0x1206,0x19ae,0x10bc)](_0x4fea53,_0x1cbc75)+(_0x17318e(0xc53,0x5fb,0xb8d,0x8d4)+'7,\x202005');let [_0x36cf0c,_0x1df4e2,_0x46a2cd,_0x1fa22e]=_0x116129[_0x17318e(0xe6d,-0x1df,-0x1db,0x508)]`,`,_0x5c889f=await primbon[_0x425890(0xb38,0xaba,0xb56,0x79e)+_0x17318e(0x127c,0x16c7,0x1b32,0x133b)](_0x36cf0c,_0x1df4e2,_0x46a2cd,_0x1fa22e);if(_0x5c889f[_0x425890(0x188c,0x1098,0xb8b,0xa99)]==![])return _0xcd1d32(_0x5c889f[_0x425890(0x339,0x7c3,-0x2f,0xf47)]);_0x3797bd['sendText'](_0x17aa6d['chat'],_0x425890(-0x22b,0x21a,-0x65,0x77a)+'*\x20'+_0x5c889f[_0x425890(0x116,0x7c3,-0x13a,0x1176)][_0x17318e(0x130a,0x8a2,0x13c9,0x133b)]+(_0x17318e(0x1443,0x13d4,0x10ea,0xc10)+_0x17318e(0x18ec,0x1d81,0x1449,0x12f8))+_0x5c889f[_0x425890(0x2f2,0x7c3,0x509,-0x291)]['tgl_lahir']+(_0x425890(-0x491,0x21e,0x33,0xb7e)+_0x17318e(0xdec,0xcf2,0x18af,0x15e2))+_0x5c889f[_0x425890(0x748,0x7c3,0xafd,0x390)]['life_path']+(_0x425890(0x1bd2,0x154c,0x1b38,0x186f)+_0x17318e(0x222a,0x138e,0x1f45,0x17f6))+_0x5c889f[_0x17318e(-0x48,0x4b4,-0x36,0x9e0)]['destiny']+(_0x425890(0x15a4,0x154c,0x1ea8,0x1c5e)+_0x425890(0x72e,0x9f7,0x126d,0x11f1)+':*\x20')+_0x5c889f[_0x425890(0x8fd,0x7c3,0x119e,-0x2ce)]['destiny_de'+_0x425890(0x188f,0x137b,0x1c7d,0x11e5)]+(_0x17318e(0x1a44,0x1b5b,0xad6,0x14dc)+'nality\x20:*\x20')+_0x5c889f[_0x17318e(0x12e4,0xd72,0x143b,0x9e0)][_0x17318e(0x201,0x9b9,0x71b,0x962)+'y']+(_0x17318e(0xb54,-0x114,0x276,0x374)+_0x425890(0x5d8,0xf45,0x11c2,0x4b2))+_0x5c889f[_0x17318e(0x47f,0xe70,0x193,0x9e0)][_0x17318e(0x13d0,0xe42,0x11d7,0x1348)+'_kecocokan']+('\x0a\x0aPOWERD\x20B'+_0x17318e(-0x313,0x6ad,0x57e,0x555))+botname,_0x17aa6d);}break;case _0x295ea5[_0x17318e(0xacb,0xdb6,0xa6e,0x42b)]:case _0x295ea5[_0x425890(0x352,0x31c,0x3dc,-0x4a8)]:case _0x295ea5[_0x425890(0x1bda,0x15b7,0x1ad8,0x1c00)]:{if(!_0x116129)throw _0x17318e(0xc5b,0x2fe,0x639,0xd25)+_0x295ea5[_0x17318e(0xe8,0x3b0,0x429,0x819)](_0x4fea53,_0x1cbc75)+('\x20Dika|Novi'+'a');let [_0x170ac1,_0x2b990f]=_0x116129['split']`|`,_0x522414=await primbon[_0x425890(0xc35,0xaba,0x25,0x566)+'nama_pasan'+_0x425890(0xe2b,0xa12,0x684,0x1062)](_0x170ac1,_0x2b990f);if(_0x522414[_0x17318e(0x1936,0x19dc,0x1b98,0x12b5)]==![])return _0xcd1d32(_0x522414['message']);_0x3797bd[_0x17318e(0x2ce,0xf34,0x4d2,0xd61)](_0x17aa6d['chat'],_0x522414[_0x425890(-0x4,0x7c3,0x75c,-0x53)][_0x425890(0x1537,0xd50,0x16c7,0x90e)],_0x17318e(0x100b,0x10c9,0x1069,0xc11)+_0x17318e(0x1775,0x1285,0x1409,0x10de)+_0x522414['message'][_0x17318e(0x1833,0x1581,0x1d28,0x1671)]+(_0x17318e(0xec6,0x902,0x1996,0x1270)+'e\x20Name\x20:*\x20')+_0x522414[_0x17318e(0x940,0x5aa,0x10bf,0x9e0)][_0x17318e(-0x82,0x6ff,0xd0a,0x6fb)+_0x425890(0x3c0,0xa12,0x1154,0xbd8)]+(_0x17318e(0x7a6,0x48f,0x43a,0x779)+_0x17318e(0x15d7,0xd97,0xa7e,0xefb)+'*\x20')+_0x522414[_0x17318e(0xbf0,0x147e,0xd54,0x9e0)][_0x17318e(-0x5bc,0x697,-0x514,0x36b)+'if']+('\x0a🔰🌹\x20*Negat'+_0x425890(0x1086,0xcde,0x172a,0xa4a)+'*\x20')+_0x522414[_0x425890(0xb0d,0x7c3,-0x14c,0x8eb)]['sisi_negat'+'if'],_0x17aa6d);}break;case _0x295ea5[_0x17318e(0x6eb,0x528,-0x190,0x7d5)]:case _0x295ea5[_0x425890(0x14d,0x8bb,0x2bc,0x117e)]:{if(!_0x116129)throw'Example\x20:\x20'+(_0x4fea53+_0x1cbc75)+(_0x17318e(0x1c34,0x1ced,0x1b32,0x125b)+'20');let [_0x31aa17,_0x4607e0,_0x56d5c7]=_0x116129['split']`,`,_0xc76c3c=await primbon[_0x425890(0xc9c,0x3f6,0x370,-0x105)+_0x425890(-0x233,0x653,0xbf2,0x76d)+_0x17318e(0x10a8,0x1a18,0x1756,0x135a)](_0x31aa17,_0x4607e0,_0x56d5c7);if(_0x295ea5['zkFjL'](_0xc76c3c[_0x425890(0xa34,0x1098,0xfb5,0x18c4)],![]))return _0xcd1d32(_0xc76c3c[_0x17318e(0x6f5,0xc5f,0x511,0x9e0)]);_0x3797bd[_0x425890(0x1228,0x12b2,0x1aef,0x1b90)](_0x17aa6d['chat'],_0x425890(0x154,0xbe0,0x95c,0x6ae)+'g\x20Date\x20:*\x20'+_0xc76c3c[_0x17318e(0xd2b,0x6e7,0x8b8,0x9e0)]['tanggal']+(_0x425890(0x8a,0x1e3,-0x39c,0xb0)+'cteristics'+_0x425890(0xe18,0x15d5,0x1196,0x19c3))+_0xc76c3c[_0x17318e(0x5e4,0xd62,0xa81,0x9e0)][_0x425890(0xc4f,0xe27,0xe03,0xf31)+'tik'],_0x17aa6d);}break;case'sifatusaha':{if(_0x295ea5[_0x425890(0xbce,0xfca,0x124f,0xed4)]('mXDfx',_0x295ea5[_0x17318e(0x1688,0x522,0x737,0xe13)])){if(!_0x2213d5['key'][_0x425890(0xa95,0x409,0x4dc,0x25)])return;}else{if(!ext)throw _0x425890(0xe7d,0xb08,0x9e7,0x1253)+(_0x4fea53+_0x1cbc75)+(_0x17318e(0x971,0xa76,0x2d8,0x637)+_0x425890(-0x663,0x336,0xbe6,-0x5f));let [_0x3b5be4,_0x587687,_0x3dff92]=_0x116129[_0x425890(-0x6f9,0x2eb,-0xf2,-0x4fb)]`,`,_0x1d5e10=await primbon[_0x17318e(0x103a,0x19fd,0x1c0b,0x13dc)+'a_bisnis'](_0x3b5be4,_0x587687,_0x3dff92);if(_0x1d5e10['status']==![])return _0x295ea5[_0x425890(0xaf1,0x1165,0x7cf,0x16f1)](_0xcd1d32,_0x1d5e10[_0x425890(0x1147,0x7c3,-0x140,0xf7d)]);_0x3797bd[_0x425890(0x1334,0x12b2,0x1268,0x11d6)](_0x17aa6d['chat'],_0x17318e(0x1486,0x16fd,0x17b6,0xe4a)+'*\x20'+_0x1d5e10['message'][_0x425890(0x67,0x502,-0xe6,0x47e)]+(_0x17318e(0x18a9,0x14ba,0x14c8,0x1216)+_0x17318e(0x1f89,0xdd9,0x1368,0x1796))+_0x1d5e10[_0x17318e(0x12a1,0x39f,0x71b,0x9e0)]['usaha'],_0x17aa6d);}}break;case _0x425890(0xb3c,0xf1b,0x16e1,0xc1a):case _0x295ea5[_0x425890(0x768,0x646,0x848,0x38)]:{if(!_0x116129)throw _0x17318e(0xd88,0x442,0x124a,0xd25)+(_0x4fea53+_0x1cbc75)+(_0x17318e(0xd6c,0xe54,0xc5b,0xef5)+'5');let [_0x5ae795,_0x49b4d2,_0x2eabc0]=_0x116129['split']`,`,_0x118001=await primbon['rejeki_hok'+_0x17318e(0x1d2c,0xd61,0x1728,0x167d)](_0x5ae795,_0x49b4d2,_0x2eabc0);if(_0x295ea5['dggKa'](_0x118001[_0x17318e(0xf6f,0x1b47,0x1d23,0x12b5)],![]))return _0x295ea5[_0x17318e(0xe30,0x967,0x10aa,0x9f2)](_0xcd1d32,_0x118001['message']);_0x3797bd['sendText'](_0x17aa6d[_0x425890(0xcf2,0xcc7,0xbd6,0x327)],_0x425890(0x11c2,0xc2d,0x11d5,0x15b0)+'*\x20'+_0x118001[_0x17318e(0xd56,0x25a,0x9ae,0x9e0)]['hari_lahir']+(_0x425890(0x1a69,0x1195,0x17cb,0x984)+_0x425890(0x16ae,0xe62,0x831,0x9f4))+_0x118001['message'][_0x425890(0xca7,0xf1b,0x10a1,0x164d)]+(_0x425890(0x8c4,0x5eb,0x1c5,-0x3f4)+_0x17318e(0x2238,0x1538,0x2081,0x17f2))+_0x118001[_0x17318e(0x1325,0xe14,0x985,0x9e0)][_0x425890(0xe0a,0x1197,0xd7a,0x953)],_0x17aa6d);}break;case _0x295ea5[_0x17318e(0x12f9,0xd6c,0x10b8,0x1662)]:case _0x295ea5[_0x425890(-0x574,0x505,0xb51,0x95b)]:{if(_0x295ea5[_0x17318e(0x101,0x10f8,0xdf4,0x84f)](_0x425890(-0x6d9,0x156,0xb8b,-0x334),_0x295ea5[_0x17318e(0x1716,0x1259,0xde2,0x13cc)])){const _0x213ebc={};_0x213ebc[_0x17318e(0x16ce,0x1474,0x1918,0x12bd)+'t']=_0x295ea5['vMhbF'];const _0x1449f2={};_0x1449f2[_0x425890(0x1127,0xf77,0x149a,0x1484)]=_0x4cf6d9+_0x17318e(0xd71,0x95a,0xf83,0x51c),_0x1449f2[_0x425890(0x1193,0x10fb,0xb37,0x1030)]=_0x213ebc,_0x1449f2[_0x425890(0xa84,0x141b,0x1b08,0xbc2)]=0x1;const _0x248df6={};_0x248df6[_0x17318e(0x18b3,0xed0,0x1be1,0x12bd)+'t']=_0x295ea5['spClB'];const _0x10b363={};_0x10b363[_0x17318e(0x1b3b,0xeeb,0x179d,0x1194)]=_0x214388+_0x17318e(0x158f,0xae9,0x769,0xc66),_0x10b363['buttonText']=_0x248df6,_0x10b363[_0x17318e(0x15a9,0x1bf4,0x1697,0x1638)]=0x1;const _0x18fd0d={};_0x18fd0d[_0x425890(0x92c,0x10a0,0x1b21,0x17fa)+'t']='⫷\x20INFO\x20⫸';const _0x194fea={};_0x194fea[_0x425890(0x1592,0xf77,0x18e4,0x92d)]=_0x29e892+_0x17318e(0xf22,0x1da0,0x12ba,0x1751),_0x194fea[_0x17318e(0x1c02,0x11b6,0x8ab,0x1318)]=_0x18fd0d,_0x194fea[_0x425890(0xc2c,0x141b,0xb17,0x187b)]=0x1;let _0x721032=[_0x1449f2,_0x10b363,_0x194fea];const _0xef0288={};_0xef0288[_0x17318e(0x7b2,0xff8,0x68e,0x810)]=_0x558379+_0x295ea5[_0x425890(0xfbd,0xe83,0x5d5,0xe2d)];const _0x1c1d74={};_0x1c1d74[_0x17318e(0xcec,0xb36,0x78c,0x59e)]=_0xef0288,_0x1c1d74[_0x17318e(0x241,0x6bc,0xe9e,0x527)]=_0x17318e(0x7a2,0x1141,0xbae,0x835)+_0x4c7475+(_0x17318e(0x9b9,0xc3,-0x467,0x3b8)+_0x17318e(0x17a2,0x12e4,0x21ae,0x180e)+'RT\x20💠══╗\x09\x0a┃'+'║\x20\x20\x20\x20\x20\x20\x20\x20\x0a'+'┃╠')+_0x4f63bb+'\x20'+_0x30c1fc+(_0x425890(-0x60d,0x26d,0x7e,0xc0c)+_0x425890(0x549,0x544,0x964,-0x321)+_0x425890(0xbea,0xded,0x9c0,0x148b))+_0x1d417f+'\x20'+_0x452698+(_0x425890(0xfd7,0x13aa,0x1a95,0x9d8)+_0x425890(-0x15d,0x223,-0x71c,-0x547)+_0x17318e(0x7e8,0x403,-0x1db,0x8c1))+_0x6ad39e+'\x20'+_0x4b0297+('emojimix\x20['+_0x425890(0xd3b,0x8bf,0xdcd,0x134f)+'\x0a┃╠')+_0x680dfb+'\x20'+_0x3c0a51+(_0x17318e(0x1bb4,0x21a2,0x1e88,0x183e)+'eply\x20img]\x0a'+'┃╠')+_0x22bc86+'\x20'+_0x1e6801+(_0x425890(0x1361,0xa0e,0xe12,0x8a)+_0x17318e(0x1086,0x10cd,0xe9d,0xee1)+'┃╠')+_0x1d917b+'\x20'+_0x25a905+(_0x17318e(0x11ff,0x1587,0xcf9,0x165a)+_0x425890(-0x872,0x14c,-0x659,-0x1f3)+'┃╠')+_0x469bc0+'\x20'+_0xcc4bec+(_0x17318e(0xd75,0x152a,0x1550,0x1245)+_0x17318e(0xc3b,0x26f,0x30d,0x490))+_0x5c3cb7+'\x20'+_0x588317+(_0x17318e(0x42f,0x127f,0x119a,0xeb5)+_0x425890(0xd50,0x8c5,0x337,0x1ee))+_0x26bd40+'\x20'+_0x4605be+('toaudio\x20[r'+_0x17318e(0x1458,0x13dd,0x522,0xf26)+'┃╠')+_0x40acc0+'\x20'+_0x1ae96d+(_0x17318e(0x1098,0xfc,0x150b,0xacc)+'eply\x20txt]\x0a'+'┃╠')+_0x525032+'\x20'+_0x52af5e+(_0x17318e(0x8f2,0xe86,0x1310,0x1011)+_0x425890(0x46a,0x67d,0x766,0xe2f)+'┃╚════════'+'═════☬\x0a┗━━'+'❯\x20')+_0x18e503+_0x425890(0xd4c,0x383,0x4e6,-0xb),_0x1c1d74[_0x425890(0x52b,0x37a,0xc16,0xc02)]=_0x4c4268[_0x17318e(0xf2a,0x1524,0x183d,0x12db)][_0x425890(0xb1e,0xe82,0x18c2,0x12c2)],_0x1c1d74[_0x425890(0x9a5,0xf61,0x5a9,0x66a)]=_0x721032,_0x1c1d74['headerType']=0x4;let _0x17c787=_0x1c1d74;const _0x5a4f2a={};_0x5a4f2a['quoted']=_0x52d979,_0x26a3f4['sendMessag'+'e'](_0x17e5da[_0x17318e(0x89c,0x971,0x17e0,0xee4)],_0x17c787,_0x5a4f2a);}else{if(!_0x116129)throw _0x425890(0x1dd,0xb08,0xc40,0x60b)+(_0x4fea53+_0x1cbc75)+(_0x425890(0x1748,0xcd8,0x564,0x9c4)+'5');let [_0x59f1cd,_0x4aebf6,_0xe1a957]=_0x116129[_0x17318e(0x838,0x421,-0x4be,0x508)]`,`,_0x21a9af=await primbon[_0x17318e(0x1090,0x1792,0xd54,0x12fe)+_0x425890(0x7c6,0x275,-0x6d1,0x466)+'r'](_0x59f1cd,_0x4aebf6,_0xe1a957);if(_0x295ea5[_0x17318e(0xe6e,0x10d5,0x138b,0x1535)](_0x21a9af[_0x17318e(0x903,0x13ca,0xd5b,0x12b5)],![]))return _0x295ea5[_0x17318e(-0x230,0xd76,0x501,0x52b)](_0xcd1d32,_0x21a9af['message']);_0x3797bd[_0x425890(0xb32,0x12b2,0x16e7,0x16e2)](_0x17aa6d[_0x425890(0x133e,0xcc7,0x1289,0x15b5)],_0x17318e(0x1680,0x5fe,0x413,0xe4a)+'*\x20'+_0x21a9af['message'][_0x425890(0x844,0x502,0xe0,-0x41f)]+(_0x425890(0x1a4c,0x1485,0xf33,0x15bb)+_0x17318e(0x909,0xb1c,0x182e,0x12e7))+_0x21a9af['message'][_0x17318e(-0x27e,0x1079,0xb52,0x7c6)]+('\x0a🔰🌹\x20*Notes'+'\x20:*\x20')+_0x21a9af['message'][_0x17318e(0xb2f,0xedc,0xd46,0x13b4)],_0x17aa6d);}}break;case _0x295ea5[_0x17318e(0x944,0x100d,0x7a1,0xb3e)]:case _0x295ea5[_0x425890(0xb03,0xbfe,0x9cf,0xe09)]:case'nasib':{if(!_0x116129)throw'Example\x20:\x20'+'7,\x207,\x202005';let [_0x207924,_0x20f4c4,_0x20860a]=_0x116129[_0x425890(-0x73b,0x2eb,-0x2bb,0xb22)]`,`,_0x29a123=await primbon['ramalan_na'+_0x425890(0x1193,0x11c7,0x13c3,0xd87)](_0x207924,_0x20f4c4,_0x20860a);if(_0x29a123[_0x17318e(0xf50,0xf66,0xc6a,0x12b5)]==![])return _0x295ea5[_0x17318e(0xf5a,0xda2,0xa47,0x136c)](_0xcd1d32,_0x29a123[_0x425890(0xba6,0x7c3,0x579,0x71b)]);_0x3797bd['sendText'](_0x17aa6d['chat'],_0x17318e(0xebb,0x1625,0x162c,0x142a)+'is\x20:*\x20'+_0x29a123['message']['analisa']+('\x0a🔰🌹\x20*Root\x20'+_0x425890(0x85c,0x203,0x69b,-0x6dd))+_0x29a123[_0x425890(0x3cf,0x7c3,-0xad,-0x289)]['angka_akar']+(_0x17318e(0xde6,0x94e,0xc61,0xcf2)+_0x425890(0x1041,0xd8c,0x67e,0x1728))+_0x29a123[_0x17318e(0xdcc,-0x43,0x5ca,0x9e0)][_0x17318e(-0x5b3,0x745,0x621,0x3ec)]+(_0x17318e(0x1f1b,0x12c8,0x1566,0x1541)+'nt\x20:*\x20')+_0x29a123['message'][_0x17318e(0xe1a,0x1075,0xc18,0x71c)]+(_0x425890(0x1e72,0x15b0,0x1691,0x1a8b)+'\x20Numbers\x20:'+'*\x20')+_0x29a123[_0x425890(0xb88,0x7c3,-0x29f,0xbc3)]['angka_kebe'+_0x17318e(0x1e7d,0x112d,0x1c21,0x16ca)],_0x17aa6d);}break;case _0x295ea5[_0x17318e(0x13f1,0x1490,0xcaa,0xf97)]:case _0x295ea5['hdwOz']:{if(_0x295ea5[_0x425890(0xb02,0xc5f,0xe26,0x972)](_0x295ea5['dJNmi'],_0x295ea5['xJeZc'])){if(_0x295ea5[_0x17318e(0x85f,0xdd9,0xb5f,0x1287)](_0x37aca4,_0x5b0d2d)){_0x2ab1e6=_0x250c83['readFileSy'+'nc'](_0x17318e(0x771,0xba0,0xb6b,0xaf9)+_0x17318e(0xd2,0x225,0x262,0x4fe)+'r/'+_0x409027+_0x17318e(0x1231,0x17b7,0x7ce,0xd72));if(_0x295ea5[_0x17318e(0x15ee,0xe2d,0x1e8b,0x155c)](_0x10f6a1[_0x425890(0xe44,0x8db,0x46c,-0x120)],_0x295ea5[_0x17318e(0x10b3,0x11f0,0xc33,0xee7)]))return;const _0x362cc2={};_0x362cc2[_0x425890(0x136f,0xe57,0x132b,0x10e4)]=_0x26a6e4;const _0x3a8f2b={};_0x3a8f2b[_0x17318e(0x98f,0xd35,0x63f,0xa24)]=_0xd5eaca,_0x205546[_0x17318e(0x8e,0x108f,-0x236,0x63c)+'e'](_0x275b91[_0x425890(0x1444,0xcc7,0xb2a,0x2af)],_0x362cc2,_0x3a8f2b);}}else{if(!_0x116129)throw'Example\x20:\x20'+_0x295ea5[_0x425890(-0x8dd,0x1c2,-0x52c,-0x7cc)](_0x4fea53,_0x1cbc75)+(_0x425890(0x267,0xcd8,0x1666,0xda0)+'5');let [_0x55501a,_0xcc472,_0x24ca08]=_0x116129[_0x425890(0xe5,0x2eb,0xd54,-0x648)]`,`,_0x405626=await primbon[_0x17318e(0x682,0x478,0x993,0x44c)+_0x17318e(0x1dc,0x75e,0x7de,0x656)](_0x55501a,_0xcc472,_0x24ca08);if(_0x295ea5[_0x17318e(0xbe9,0x44b,0x9fd,0xb42)](_0x405626[_0x17318e(0x89b,0x9d7,0x1312,0x12b5)],![]))return _0xcd1d32(_0x405626[_0x17318e(0x1a5,0x110b,0x116e,0x9e0)]);_0x3797bd[_0x425890(0x1064,0x12b2,0x11cb,0xcb7)](_0x17aa6d[_0x425890(0x451,0xcc7,0x9e2,0x652)],_0x425890(0x1375,0x120d,0xc7a,0x1a4f)+_0x17318e(0x4ca,0x1618,0x1680,0xecb)+_0x405626['message']['analisa']+(_0x425890(0x71a,0xe47,0xfed,0x8a8)+_0x425890(0x1912,0x163f,0xd5c,0x1b75))+_0x405626[_0x425890(0x206,0x7c3,-0x253,0xf6a)][_0x17318e(0xa5f,0x103f,0x11ef,0xd58)]+(_0x425890(0xfe9,0x1251,0x1ca4,0x94a)+_0x17318e(0xe7d,0x1394,0x7f6,0xe18))+_0x405626[_0x17318e(0xe62,0xc1b,0xb21,0x9e0)][_0x17318e(0xfe4,0x89d,0x4d5,0x71c)]+(_0x425890(0x78d,0x5eb,0xc09,0x52)+_0x17318e(0x1a3c,0x1822,0xe9b,0x17f2))+_0x405626['message'][_0x17318e(0xbeb,0x1bc7,0x1ab8,0x13b4)],_0x17aa6d);}}break;case'artitarot':case _0x17318e(0xf79,0x188d,0x18dd,0x14d5):{if(!_0x116129)throw _0x425890(0x7e3,0xb08,0xbb9,0x346)+(_0x4fea53+_0x1cbc75)+(_0x17318e(0x16f8,0x1167,0xd01,0xef5)+'5');let [_0x3bc274,_0x56f500,_0x5dc3de]=_0x116129['split']`,`,_0x11318c=await primbon[_0x425890(0x1214,0x1101,0x11d9,0x17aa)+_0x17318e(0x44b,-0x1f,-0x28e,0x631)](_0x3bc274,_0x56f500,_0x5dc3de);if(_0x295ea5[_0x425890(0x148f,0x1318,0x1c07,0xe95)](_0x11318c[_0x17318e(0xf29,0x89d,0xd85,0x12b5)],![]))return _0x295ea5['lfNhr'](_0xcd1d32,_0x11318c[_0x17318e(0x9e,0xc97,0xc1c,0x9e0)]);_0x3797bd['sendImage'](_0x17aa6d['chat'],_0x11318c[_0x425890(0x1097,0x7c3,-0x233,0x8c9)][_0x425890(0x7a5,0x381,-0x67a,0x1eb)],_0x425890(0x329,0xc2d,0x73c,0x1155)+'*\x20'+_0x11318c['message'][_0x17318e(0x13fe,0x80e,0x5d7,0xb86)]+(_0x425890(0x1954,0x15ef,0x1cf1,0xc9a)+'\x20Symbol\x20:*'+'\x20')+_0x11318c['message'][_0x17318e(0x11b,0x1030,-0x17f,0x8b6)+'ot']+(_0x425890(0x3d5,0x18d,0x3bd,-0x1b9)+_0x425890(0x6c3,0x659,0x738,0x598))+_0x11318c['message'][_0x425890(0x366,0x23c,0x95,0x7d6)]+(_0x17318e(0x8be,-0x1a3,0x4d7,0x808)+_0x17318e(0x20fa,0x1149,0x115d,0x17f2))+_0x11318c[_0x17318e(0x62a,0x521,0xcb4,0x9e0)][_0x17318e(0x9a0,0x1cae,0x18f5,0x13b4)],_0x17aa6d);}break;case _0x295ea5[_0x425890(0x18d7,0xfa9,0xa17,0xfda)]:{if(!_0x116129)throw _0x425890(0x97d,0xb08,0x561,0x308)+_0x295ea5[_0x425890(0x393,0xbbd,0x86c,0x11db)](_0x4fea53,_0x1cbc75)+(_0x425890(0x397,0x39e,-0x2de,-0x614)+_0x17318e(0xe10,0x890,0xbb2,0x1158)+_0x17318e(0x257,0x125b,0x147,0xa1c))+(_0x4fea53+_0x1cbc75)+(_0x17318e(0x1050,0x14b5,0xffa,0x1654)+_0x425890(0xdcb,0xf4e,0x16c6,0x17d9)+_0x425890(0x149,0x15b,0x43f,0x8f0)+'der\x20:\x201\x20un'+_0x17318e(0x480,0x934,0xc82,0xb0b)+_0x17318e(0x1231,0xd2a,0xe5a,0xa14)+_0x425890(0xe97,0x622,0x645,-0x6d)+'uan');let [_0x3edc9b,_0x10970e,_0x5d0c90]=_0x116129[_0x425890(-0x37c,0x2eb,0x135,0xa74)]`,`,_0x18b2f5=await primbon[_0x17318e(0x101b,0x11b8,0x11cb,0xf80)+_0x17318e(0x70a,0xbc6,0x8ec,0x96d)+'i'](_0x3edc9b,_0x10970e,_0x5d0c90);if(_0x295ea5[_0x425890(0xaec,0x6af,0xae2,0xfe4)](_0x18b2f5['status'],![]))return _0x295ea5[_0x17318e(0xdc9,-0x3e,0x3d,0x5ed)](_0xcd1d32,_0x18b2f5['message']);_0x3797bd['sendText'](_0x17aa6d[_0x17318e(0x1399,0x8be,0x120b,0xee4)],'🔰🌹\x20*Name\x20:'+'*\x20'+_0x18b2f5[_0x17318e(0xf90,0x851,0xc65,0x9e0)][_0x425890(0xd12,0x111e,0x997,0xd18)]+(_0x17318e(0x18a,0xb94,0x471,0xc10)+_0x425890(0x1a37,0x10db,0x80d,0xc51))+_0x18b2f5[_0x425890(0xfe1,0x7c3,0x41c,0x82)][_0x17318e(0x8b8,0xc87,0x17d1,0xf6f)+'r']+(_0x17318e(0x13c8,0xce7,0xb35,0xe1e)+'r\x20:*\x20')+_0x18b2f5[_0x17318e(0x75f,0x10d3,0xd3c,0x9e0)][_0x17318e(-0x24e,-0xd7,-0x5db,0x4b5)+_0x425890(0x1797,0xe11,0x99f,0x144b)]+(_0x17318e(0x5e9,0xce3,0x518,0x71e)+'umber\x20:*\x20')+_0x18b2f5[_0x17318e(0x10d8,-0x47,0x649,0x9e0)][_0x17318e(0x18f2,0x1e1f,0xfa4,0x15b0)]+('\x0a🔰🌹\x20*Group'+_0x17318e(0x1a83,0xe8e,0x1953,0x17f2))+_0x18b2f5[_0x425890(0x5c7,0x7c3,0x716,0x56)][_0x17318e(0x101a,0x4d7,0xed0,0xca9)]+(_0x17318e(0x50e,0x61c,0xac4,0x400)+_0x17318e(0x9b0,0x12a8,0x1602,0xcd3))+_0x18b2f5['message'][_0x17318e(0x9b5,0x540,0x58a,0x80c)]+(_0x425890(0x353,0x239,0x5de,0xc67)+_0x17318e(0xfa6,0xeb,-0x1d,0x98b))+_0x18b2f5[_0x17318e(0x827,0x3c,0xc9,0x9e0)]['sektor_bai'+'k']+('\x0a🔰🌹\x20*Bad\x20S'+'ector\x20:*\x20')+_0x18b2f5[_0x17318e(0x146d,0x1178,0x97c,0x9e0)][_0x17318e(0x171,0xdb,-0x184,0x36d)+'uk']+('\x0a\x0aPOWERD\x20B'+'Y:\x20\x20')+botname,_0x17aa6d);}break;case _0x295ea5[_0x425890(0xa9d,0x640,0x900,0xd27)]:{if(_0x295ea5[_0x17318e(0x10bf,0xc1e,0x1f6d,0x1693)](_0x295ea5[_0x425890(0x928,0x7b3,0x10f9,0x65a)],_0x17318e(0x16,-0x8a,0x5b9,0x89e))){if(!_0x116129)throw _0x425890(0xed3,0xb08,0xc4d,0xf5c)+_0x295ea5[_0x17318e(0x1850,0xc1a,0x1a81,0x139b)](_0x4fea53,_0x1cbc75)+(_0x425890(0x147f,0xcd8,0x1486,0xb7a)+'5');let [_0xb9d09a,_0x8a65b4,_0x7366f6]=_0x116129[_0x425890(0xbef,0x2eb,-0x4dd,0xd08)]`,`,_0x36e360=await primbon[_0x425890(0xf71,0xa18,0x558,0xb9c)+'i_baik'](_0xb9d09a,_0x8a65b4,_0x7366f6);if(_0x36e360[_0x425890(0xe80,0x1098,0x17e6,0xef9)]==![])return _0x295ea5[_0x17318e(0x1ab5,0x21e4,0x228e,0x17fb)](_0xcd1d32,_0x36e360[_0x17318e(0x1400,0x1276,0x43,0x9e0)]);_0x3797bd[_0x425890(0xf6e,0x12b2,0x18e3,0xd33)](_0x17aa6d[_0x17318e(0x1222,0x9fd,0xbae,0xee4)],_0x425890(0xeea,0xc2d,0x1087,0x1bf)+'*\x20'+_0x36e360[_0x425890(0x803,0x7c3,0x7ff,0x4ca)]['tgl_lahir']+(_0x17318e(0xe8b,0xcd9,0x1943,0x13ca)+'Challenged'+_0x425890(0x1a2e,0x15d5,0x1937,0x142f))+_0x36e360[_0x425890(0x626,0x7c3,0xfd0,0xf63)][_0x425890(0xe94,0x86f,0xb83,0x62)+'tang']+(_0x425890(0xb2c,0xda6,0x1041,0x1576)+_0x17318e(0xff6,0x14a4,0x1931,0x12f8))+_0x36e360['message']['info']+('\x0a🔰🌹\x20*Notes'+'\x20:*\x20')+_0x36e360[_0x425890(0x59f,0x7c3,0x13b,0x1103)][_0x425890(0x18de,0x1197,0xf3c,0x19e0)],_0x17aa6d);}else _0x295ea5['XSjhV'](_0x1f7d9c,_0x425890(0xa67,0xb3c,0x3eb,0x201)+'/Video\x20Wit'+_0x425890(0xaad,0x139d,0x1ae3,0x1d20)+_0x295ea5[_0x425890(0x5f4,0xc70,0x9e9,0x454)](_0x2fe083,_0x20b552)+(_0x425890(0xa7c,0x4b2,0xedf,0x839)+_0x425890(0x271,0x1a2,-0x41d,-0x426)+'Seconds'));}break;case _0x295ea5['sSVRJ']:case _0x295ea5[_0x17318e(0xac4,0x9d3,0xcd3,0xd05)]:{if(_0x295ea5[_0x17318e(0x6d3,-0x4d9,-0x84,0x458)](_0x295ea5[_0x17318e(0xf88,0x2b9,0xb38,0x6c9)],_0x425890(0x2b0,0x75c,0xb0b,0x2c8))){_0x41575a[_0x17318e(0x375,0x3e6,0xdb0,0x587)](_0x295ea5['tkhUW'](_0x295ea5[_0x425890(0x129b,0x129a,0x14a7,0xf2a)],_0x131abe[_0x425890(0x667,0x84a,0x3df,0x943)]));const _0x12e3cd={};_0x12e3cd[_0x17318e(0x15a9,0x132e,0x1c3c,0x12bd)+'t']=_0x425890(-0x2da,0x64f,0x8ec,0x7cc)+_0x17318e(0x1b86,0xa24,0x1669,0x11de);const _0x5820c0={};_0x5820c0[_0x425890(0xc88,0xf77,0xe7d,0x57c)]=_0x295ea5[_0x17318e(0x6bb,-0x3c,0x391,0x43e)],_0x5820c0[_0x17318e(0xc6e,0x1cee,0x154f,0x1318)]=_0x12e3cd,_0x5820c0[_0x17318e(0x1b1d,0x1edd,0xea7,0x1638)]=0x1,_0x1d7106['sendButton'+_0x425890(0x9ae,0xcec,0x1368,0x321)](_0x1c89ea[_0x425890(0x161d,0xcc7,0x4e1,0x7d5)],[_0x5820c0],_0x17318e(0x374,0xa49,0x5a7,0xc39)+_0x17318e(0x14c,0x1455,0x14f3,0xb15)+_0x341b57[_0x495bdf[_0x425890(0x743,0xa69,0xef,0x1206)][_0x425890(0x2f9,0x2eb,0xc52,0x703)]('@')[0x1e62+-0xe19+0x1049*-0x1]]+(_0x425890(0x17ce,0x11a2,0x1368,0xcbd)+'Play\x20Again'+_0x425890(0x732,0x7e3,0x239,0x973)+'\x20Button\x20Be'+_0x425890(0x759,0xf09,0x993,0x161c)),_0x314b72[_0x17318e(0x861,0x1c42,0x18b3,0x12db)][_0x425890(0x151d,0xe82,0x16be,0x1741)],_0x511197),delete _0x25e7c3[_0x588701[_0x17318e(0x116d,0x4c6,0x46c,0xc86)][_0x17318e(0x4e6,0x240,0x350,0x508)]('@')[0x12*0x110+0x1e9c+-0x31bc]];}else{if(!_0x116129)throw'Example\x20:\x20'+_0x295ea5['UJxhp'](_0x4fea53,_0x1cbc75)+(_0x17318e(0xd12,0xa0e,0x1827,0xef5)+'5');let [_0x1a5934,_0x48016d,_0x11b5be]=_0x116129[_0x425890(0x76f,0x2eb,0x332,0x6c0)]`,`,_0x1f9ecf=await primbon[_0x17318e(0x1444,0x191b,0xe46,0x100d)+_0x425890(0x484,0x39d,0xe18,-0x276)+'ke'](_0x1a5934,_0x48016d,_0x11b5be);if(_0x295ea5[_0x425890(0xfb4,0xffd,0xb48,0x703)](_0x1f9ecf[_0x425890(0xddf,0x1098,0xaa1,0x7e8)],![]))return _0x295ea5[_0x17318e(0x671,0x77d,0xf88,0x87f)](_0xcd1d32,_0x1f9ecf[_0x17318e(0x43b,0x13ca,0x646,0x9e0)]);_0x3797bd[_0x17318e(0x16d6,0xa86,0x1917,0x14cf)](_0x17aa6d[_0x425890(0x108c,0xcc7,0x906,0x759)],_0x425890(0x1022,0xc2d,0x8ef,0x11cb)+'*\x20'+_0x1f9ecf[_0x425890(0xb7f,0x7c3,0x119b,0x596)][_0x425890(0x1bc,0x969,0x81c,0xd3b)]+(_0x425890(0xe67,0x692,0x8de,0xa76)+'ts\x20:*\x20')+_0x1f9ecf['message'][_0x17318e(-0x505,-0x625,0x9ab,0x45a)]+(_0x17318e(0x156b,0x61a,0x1208,0xfc3)+_0x425890(0xdd4,0x10db,0x6eb,0x1a70))+_0x1f9ecf[_0x425890(0x10d7,0x7c3,-0xe,0x60)][_0x425890(0xd5d,0x107e,0xc15,0x8b9)]+('\x0a🔰🌹\x20*Notes'+'\x20:*\x20')+_0x1f9ecf[_0x17318e(0x934,0xfae,0xbb8,0x9e0)][_0x17318e(0x1431,0xced,0x1caa,0x13b4)],_0x17aa6d);}}break;case'harinaas':case _0x295ea5['qKwKB']:{if(!_0x116129)throw _0x425890(0x7fb,0xb08,0xf1,0x373)+_0x295ea5['NXxLb'](_0x4fea53,_0x1cbc75)+(_0x425890(0x82e,0xcd8,0x712,0x71a)+'5');let [_0xa25b94,_0x3eae32,_0x48f7c7]=_0x116129[_0x425890(0x46,0x2eb,0x77d,-0x2d0)]`,`,_0xd5b8af=await primbon[_0x425890(0x9f5,0xd6e,0x535,0x1781)+_0x425890(0x1663,0x1348,0xd57,0xc8a)](_0xa25b94,_0x3eae32,_0x48f7c7);if(_0x295ea5[_0x425890(0x4db,0x558,0x17f,0x1d7)](_0xd5b8af[_0x425890(0x12d7,0x1098,0xe5e,0x1360)],![]))return _0x295ea5[_0x425890(0xea8,0x475,0xc62,0xa2)](_0xcd1d32,_0xd5b8af[_0x17318e(0xe17,0x13e1,0x143b,0x9e0)]);_0x3797bd[_0x425890(0x16d3,0x12b2,0x1bf9,0x187c)](_0x17aa6d['chat'],_0x17318e(0x11d2,0x1dab,0xbaf,0x14f2)+'\x20Birth\x20:*\x20'+_0xd5b8af[_0x17318e(0x36,0x1007,0xa9e,0x9e0)][_0x17318e(0x49b,0x42d,0x571,0x71f)]+(_0x425890(0x8f2,0x1187,0x1403,0x1046)+'Of\x20Birth\x20:'+'*\x20')+_0xd5b8af[_0x17318e(-0x17,0xa02,0x505,0x9e0)][_0x17318e(0x1625,0xe90,0x13be,0xb86)]+('\x0a🔰🌹\x20*Fatef'+_0x17318e(0x153c,0xdc6,0x8dd,0x11fc))+_0xd5b8af[_0x425890(0xbd,0x7c3,0xead,0xd8c)][_0x425890(0xed3,0x134e,0x1399,0x1981)]+(_0x17318e(0x9af,0x65f,0x9a5,0xfc3)+':*\x20')+_0xd5b8af['message'][_0x17318e(0x1065,0x1ac1,0x141e,0x13b4)]+('\x0a🔰🌹\x20*Notes'+_0x17318e(0xfae,0x1f15,0x10ed,0x17f2))+_0xd5b8af[_0x17318e(0x417,0x105d,0x37a,0x9e0)]['info'],_0x17aa6d);}break;case _0x295ea5['sJFRn']:case _0x295ea5[_0x425890(0xdd5,0x536,0x2d0,0xd46)]:{if(_0x295ea5[_0x425890(0x1b7f,0x133f,0x1ca5,0xd77)](_0x425890(0x4be,0x1fe,-0x44a,0x44a),_0x295ea5[_0x17318e(0x1880,0x14e2,0xeca,0x12c2)])){if(!_0x116129)throw _0x425890(0x1596,0xb08,0x1214,0x1239)+_0x295ea5[_0x425890(0xf19,0x15cf,0x1bf6,0x1223)](_0x4fea53,_0x1cbc75)+(_0x17318e(0x1736,0xd65,0x1952,0xef5)+'5');let [_0x1e3632,_0x46e5ff,_0x39bad5]=_0x116129['split']`,`,_0x199bdc=await primbon[_0x425890(0xb26,0x890,0x3f,0x229)+_0x425890(0x121e,0x13fb,0x1089,0x1b1e)](_0x1e3632,_0x46e5ff,_0x39bad5);if(_0x199bdc[_0x425890(0x1708,0x1098,0x12d4,0x186c)]==![])return _0xcd1d32(_0x199bdc[_0x17318e(0x142e,0x400,0xe5e,0x9e0)]);_0x3797bd[_0x17318e(0x147e,0x1912,0x1c7e,0x14cf)](_0x17aa6d['chat'],_0x17318e(0x1656,0x1e2a,0x1056,0x14f2)+_0x17318e(0xdea,0x34e,0x8d8,0xc85)+_0x199bdc[_0x17318e(0x98a,0xdd4,0x13ab,0x9e0)][_0x17318e(-0x378,0x157,0x1016,0x71f)]+(_0x425890(0x1b13,0x1187,0xc0b,0x8c2)+_0x425890(-0xaf,0x9bb,0x1233,0xd6e)+'*\x20')+_0x199bdc[_0x17318e(0xfd0,0x7a1,0xbc2,0x9e0)]['tgl_lahir']+('\x0a🔰🌹\x20*Drago'+'n\x20Day\x20Dire'+_0x17318e(0x1066,0xeb8,0x17b6,0xf64))+_0x199bdc[_0x17318e(0xf22,0xc07,0x1e5,0x9e0)][_0x425890(0xea1,0x133a,0x13bc,0xf25)+_0x17318e(0x1121,0x11b7,0xe18,0xed1)]+('\x0a🔰🌹\x20*Notes'+_0x425890(0x1a36,0x15d5,0x14db,0x1a48))+_0x199bdc[_0x425890(0xbd4,0x7c3,0x973,-0xbd)]['catatan'],_0x17aa6d);}else _0x295ea5[_0x17318e(0x1f9b,0x18d7,0x14e8,0x1702)](_0x4aa30e,'@'+_0x4934c2[_0x425890(0x18d,0xa69,0xe6f,0x319)][_0x17318e(-0x5b,0x273,0xee4,0x508)]('@')[-0x1339+0x1aad+-0x774]+(_0x425890(0xdc0,0xa37,0x683,0xaba)+_0x17318e(0x1936,0xc52,0x16b3,0x13fc))+_0x23c8d9);}break;case'arahrejeki':case _0x295ea5[_0x425890(0xd89,0x1436,0xafc,0x150b)]:{if(!_0x116129)throw _0x17318e(0x105b,0x851,0xf69,0xd25)+_0x295ea5[_0x425890(0x967,0x66c,0x6b5,-0x11b)](_0x4fea53,_0x1cbc75)+(_0x425890(0x137d,0xcd8,0xc52,0x1278)+'5');let [_0x10945a,_0xa6cf67,_0x1501a7]=_0x116129['split']`,`,_0x23aabd=await primbon[_0x17318e(0x16e7,0x419,0x8d6,0xd73)+_0x17318e(0x1c23,0xbdd,0x1074,0x1438)](_0x10945a,_0xa6cf67,_0x1501a7);if(_0x295ea5[_0x17318e(0x104b,0x1104,0xac0,0xacd)](_0x23aabd[_0x425890(0xc52,0x1098,0x1b13,0xc7e)],![]))return _0xcd1d32(_0x23aabd[_0x17318e(0x46c,0x206,0x292,0x9e0)]);_0x3797bd[_0x425890(0xf28,0x12b2,0x88b,0x1728)](_0x17aa6d[_0x17318e(0x18b0,0x1647,0x9ad,0xee4)],'🔰🌹\x20*Day\x20Of'+_0x17318e(0x8ff,0xab6,0xc91,0xc85)+_0x23aabd[_0x17318e(0x6c4,0x943,0x922,0x9e0)]['hari_lahir']+(_0x17318e(0x138c,0x10ff,0xc88,0x13a4)+_0x17318e(0x889,0x1667,0x1449,0xbd8)+'*\x20')+_0x23aabd[_0x425890(0xcb6,0x7c3,0x38f,0xd06)][_0x425890(0xd4b,0x969,0xeca,-0x7e)]+('\x0a🔰🌹\x20*Suste'+_0x425890(0x994,0xccb,0x44e,0xe86)+_0x425890(0xe26,0xd47,0x1596,0x1532))+_0x23aabd[_0x425890(0x117e,0x7c3,0xbe0,0x11c3)][_0x425890(0x1c39,0x136b,0x126e,0x920)+'i']+('\x0a🔰🌹\x20*Notes'+_0x17318e(0x17f6,0x11b9,0x12ec,0x17f2))+_0x23aabd[_0x17318e(0x869,-0x31,-0xa9,0x9e0)]['catatan'],_0x17aa6d);}break;case _0x17318e(-0x22,0x7ac,0xb66,0x603)+'n':{if(!_0x116129)throw'Example\x20:\x20'+_0x295ea5['PbSTA'](_0x4fea53,_0x1cbc75)+(_0x425890(0x174,0x68f,0xf1b,0x59f)+_0x425890(0x1412,0x11e8,0x77b,0x75a)+'022\x0a\x0aNote\x20'+':\x20')+_0x295ea5[_0x17318e(0x1116,0x8e1,0xd6a,0x873)](_0x4fea53,_0x1cbc75)+('\x20Name,\x20tan'+_0x425890(0x253,0x2bc,-0x752,-0x334)+_0x17318e(0x210b,0x2064,0x13b5,0x177c)+_0x425890(0x132e,0xab4,0xdfc,0xd94)+'\x20lahir,\x20un'+_0x425890(0x862,0xe61,0x13f4,0x68f));let [_0x5ce93e,_0x284997,_0xbe24dd,_0x539486,_0x4d393f]=_0x116129[_0x17318e(0xe8,0x31,0x288,0x508)]`,`,_0x1fa117=await primbon['ramalan_pe'+'runtungan'](_0x5ce93e,_0x284997,_0xbe24dd,_0x539486,_0x4d393f);if(_0x295ea5[_0x17318e(0x638,0xe76,0xd2e,0x69d)](_0x1fa117['status'],![]))return _0x295ea5['oFJoR'](_0xcd1d32,_0x1fa117[_0x17318e(0xe68,0xc93,0x7f2,0x9e0)]);_0x3797bd[_0x425890(0x1c9b,0x12b2,0xa30,0x198a)](_0x17aa6d[_0x425890(0x1264,0xcc7,0xb6c,0xbfb)],'🔰🌹\x20*Name\x20:'+'*\x20'+_0x1fa117[_0x17318e(0xa10,0x525,0xbd8,0x9e0)][_0x425890(0x97b,0x111e,0xbc7,0x144b)]+(_0x17318e(0x76f,0x9e9,0x4fb,0xc10)+_0x425890(0x131c,0x10db,0x1085,0x6c3))+_0x1fa117[_0x425890(-0x5c,0x7c3,0xfdf,-0x1dd)][_0x425890(0xde5,0x969,0x564,0x1187)]+(_0x17318e(0x1b89,0x1f78,0x103e,0x15a5)+'ne\x20Of\x20The\x20'+'Year\x20:*\x20')+_0x1fa117[_0x17318e(0x364,0x9f6,0x321,0x9e0)][_0x425890(-0x4e2,0x3e6,-0xab,-0x640)+_0x425890(0x5ee,0xeba,0xc17,0x1714)]+(_0x17318e(0xf9,0xa41,0x2b,0x8af)+_0x425890(0xf27,0x160c,0x1934,0x13df))+_0x1fa117[_0x17318e(0xe,0xda,0xf7d,0x9e0)][_0x425890(0x45c,0x23d,0x72d,-0x177)]+(_0x425890(0xd5d,0x5eb,0x55f,-0x298)+'\x20:*\x20')+_0x1fa117['message'][_0x17318e(0xbc0,0x1c26,0x12be,0x13b4)],_0x17aa6d);}break;case _0x295ea5['GdbZM']:case _0x295ea5[_0x425890(0x19c,0xbb5,0x980,0x541)]:{if(!_0x116129)throw _0x17318e(0xa9b,0xed7,0x2b9,0xd25)+_0x295ea5['iPMjd'](_0x4fea53,_0x1cbc75)+('\x207,\x207,\x20200'+'5');let [_0x5aa083,_0x206e89,_0xff9bb3]=_0x116129[_0x17318e(-0x16c,0x528,-0x1f5,0x508)]`,`,_0x1b647f=await primbon[_0x17318e(0x102f,0x1233,0xb9d,0xd0a)](_0x5aa083,_0x206e89,_0xff9bb3);if(_0x1b647f[_0x425890(0xe27,0x1098,0x16c5,0x1354)]==![])return _0x295ea5[_0x17318e(0x319,0xd1d,0xea9,0xb7d)](_0xcd1d32,_0x1b647f[_0x17318e(0x136e,0x9b7,0x615,0x9e0)]);_0x3797bd[_0x17318e(0xf2b,0x1a17,0x16b3,0x14cf)](_0x17aa6d['chat'],'🔰🌹\x20*Date\x20:'+'*\x20'+_0x1b647f['message'][_0x425890(0x11ec,0xf64,0xf36,0x6cf)]+(_0x17318e(0x1662,0x17c7,0x79c,0x1140)+_0x425890(0x1ba3,0x11fa,0x19c5,0xdf5)+_0x425890(0xa07,0x82a,0xe05,-0x2e))+_0x1b647f[_0x17318e(0x4ea,-0x72,0x1440,0x9e0)][_0x17318e(0x5b5,-0x5ab,0x260,0x381)+'tu']+(_0x425890(0x97b,0x1272,0x187a,0xe00)+'haracter\x20:'+'*\x20')+_0x1b647f[_0x425890(0x457,0x7c3,0xe65,0x1b)][_0x17318e(0x3f3,0xd16,0x98e,0x9ab)]+(_0x17318e(0x5e8,0xfc6,0xfc3,0x8c9)+'n\x20Day\x20:*\x20')+_0x1b647f[_0x425890(0x1216,0x7c3,0x8ca,0x540)][_0x17318e(0xf11,-0x1d8,0x873,0x47b)]+(_0x17318e(0x3ff,0xa05,-0x211,0x456)+_0x17318e(0x17e9,0x1130,0x178f,0xfce))+_0x1b647f[_0x425890(0x4ca,0x7c3,0x11fd,0x10)][_0x425890(0x103d,0x163b,0x10df,0x1519)]+(_0x17318e(0xec2,0x2080,0x18eb,0x160f)+'\x20Character'+'\x20:*\x20')+_0x1b647f['message'][_0x17318e(0x14df,0x3fe,0x173b,0xe68)+_0x425890(0x18a1,0x121e,0xffa,0x134f)]+(_0x17318e(0xc3c,0xa62,0x14c,0xab3)+_0x425890(0x54b,0x338,-0x2f2,-0x4e1))+botname,_0x17aa6d);}break;case _0x295ea5[_0x425890(0x19d5,0x10cb,0xd1c,0x9f9)]:case _0x295ea5['ypuvB']:{if(_0x295ea5[_0x425890(0x2e0,0x327,-0x1b3,0x7be)]('FbYKl',_0x295ea5[_0x425890(0x1201,0x14bc,0x188b,0xfb4)])){if(!_0x116129)throw _0x425890(0x188,0xb08,0x156e,0x400)+_0x295ea5[_0x425890(0xc96,0x1411,0x9f6,0x1a89)](_0x4fea53,_0x1cbc75)+(_0x425890(0x621,0x6b7,0xf86,0xdb8)+_0x17318e(0xd1d,0x8d1,0x1bcf,0x1184));let [_0x3371c3,_0x42bda9,_0x329d10,_0x147901]=_0x116129[_0x425890(0x815,0x2eb,0x222,-0x29c)]`,`,_0x4baa82=await primbon[_0x425890(0x36d,0xa2f,0xe71,0xb70)+_0x425890(-0x36d,0x4f6,0x3de,0x6f)+_0x425890(-0x112,0x142,0xb72,-0x8b6)](_0x3371c3,_0x42bda9,_0x329d10,_0x147901);if(_0x295ea5['LYRhW'](_0x4baa82[_0x17318e(0x1894,0xa20,0x1d49,0x12b5)],![]))return _0x295ea5[_0x425890(0xfef,0x9ac,0x354,0xeb7)](_0xcd1d32,_0x4baa82[_0x425890(-0x91,0x7c3,0xc1d,0x161)]);_0x3797bd[_0x17318e(0x11cd,0x1e31,0x10a7,0x14cf)](_0x17aa6d['chat'],_0x425890(-0x14,0x21a,0x82,0xc90)+'*\x20'+_0x4baa82['message'][_0x17318e(0x125c,0x15aa,0x10f6,0x133b)]+('\x0a🔰🌹\x20*Born\x20'+_0x425890(0x15f8,0x10db,0x1693,0x9c7))+_0x4baa82[_0x425890(-0xc9,0x7c3,0x1250,0xc0)][_0x425890(0xb78,0x969,0xcde,0x11e2)]+(_0x17318e(0xf1d,0x13d1,0x132e,0x105d)+_0x425890(0x1a16,0x12bb,0x1a90,0xa35))+_0x4baa82[_0x425890(0xcef,0x7c3,-0x16,0x117d)][_0x17318e(0x1377,0x1ded,0x110f,0x1724)+'p'],_0x17aa6d);}else{if(!_0x1402f6)throw _0x607eda[_0x17318e(0x1e18,0xd8f,0x1224,0x1494)];const _0x5802b2={};_0x5802b2[_0x17318e(0x6a9,0x109a,0x12e4,0xb1c)]=_0x3d3841[_0x425890(0x11e2,0xcc7,0x136d,0x888)],_0x5802b2[_0x425890(0x899,0x409,0x952,0x8c8)]=!![],_0x5802b2['id']=_0x3fe733['id'];const _0x1c4866={};_0x1c4866[_0x17318e(0x577,0x56d,-0x1bc,0x405)]=_0x20e447[-0xbdf+0x2433+-0x1854],_0x1c4866[_0x17318e(0x18b1,0x1ac2,0x1576,0x1426)]=_0x5802b2;const _0x180bfe={};_0x180bfe[_0x17318e(0x608,0x715,0x1492,0xb89)]=_0x1c4866,_0x21693b=_0x180bfe,_0x37152b[_0x17318e(-0xd8,0x409,0x6e1,0x63c)+'e'](_0x404bce['chat'],_0x3530bb);}}break;case _0x295ea5[_0x17318e(0xe18,0xe54,0x1ead,0x1603)]:{if(!_0x116129)throw _0x17318e(0x97b,0x683,0x1781,0xd25)+_0x295ea5[_0x17318e(0x13c0,0x12d6,0x953,0xd02)](_0x4fea53,_0x1cbc75)+(_0x17318e(0xb7d,0xdb3,0xdad,0x8d4)+_0x17318e(0x6ee,0x174d,0x12a4,0x1184));let [_0x2bbcd4,_0x758755,_0x1c9d78,_0x594341]=_0x116129[_0x17318e(-0x1d1,0x41d,-0x341,0x508)]`,`,_0x703139=await primbon[_0x425890(0xb7b,0x125c,0xb66,0x17f7)+_0x17318e(0x927,0xbac,0x893,0x41c)+'n'](_0x2bbcd4,_0x758755,_0x1c9d78,_0x594341);if(_0x295ea5[_0x17318e(0x1c65,0x2226,0x190a,0x1817)](_0x703139['status'],![]))return _0xcd1d32(_0x703139[_0x17318e(0x117b,0x3e8,0xccf,0x9e0)]);_0x3797bd['sendText'](_0x17aa6d['chat'],_0x17318e(0x33a,0x7af,0xd35,0x437)+'*\x20'+_0x703139[_0x425890(0x11cd,0x7c3,0xda4,0x40c)]['nama']+('\x0a🔰🌹\x20*Born\x20'+_0x425890(0x109e,0x10db,0x19e5,0x1043))+_0x703139[_0x425890(0x9fc,0x7c3,0x768,0x1d8)][_0x425890(0x40a,0x969,0x510,0xceb)]+(_0x17318e(0xef4,0x791,0x1150,0x8af)+_0x425890(0x203a,0x160c,0x1e15,0x1403))+_0x703139[_0x17318e(0x26e,0xbbc,0x126d,0x9e0)]['result'],_0x17aa6d);}break;case _0x295ea5[_0x17318e(-0x22b,0x783,0xc34,0x760)]:{if(!_0x116129)throw _0x17318e(0x16b3,0x158f,0xe62,0xd25)+_0x295ea5[_0x17318e(0xa18,0x1002,-0x2e5,0x74d)](_0x4fea53,_0x1cbc75)+(_0x425890(0x7ec,0x98e,0x24f,0x1307)+'22');let [_0xba29bc,_0x4cf487,_0x78e40b]=_0x116129['split']`,`,_0x176a30=await primbon['primbon_me'+_0x425890(0x120a,0xe79,0x13fe,0xd3c)+'an'](_0xba29bc,_0x4cf487,_0x78e40b);if(_0x295ea5[_0x425890(0xae4,0xaaa,0x9cd,0x3ed)](_0x176a30[_0x17318e(0x172b,0xe7b,0x1833,0x12b5)],![]))return _0x295ea5[_0x17318e(0xe50,0xc1e,0x555,0x8d0)](_0xcd1d32,_0x176a30[_0x425890(0xab3,0x7c3,0xa96,-0x19f)]);_0x3797bd[_0x425890(0x1d29,0x12b2,0x8dc,0x144c)](_0x17aa6d['chat'],'🔰🌹\x20*Date\x20:'+'*\x20'+_0x176a30[_0x17318e(0xb1d,0x13a,0x553,0x9e0)][_0x17318e(0xf62,0xc88,0x937,0x72f)+_0x425890(0x8d5,0xe55,0xe32,0xa13)]+(_0x17318e(0x875,0x117b,0x474,0x8af)+_0x425890(0x1c83,0x160c,0xd5b,0x18d4))+_0x176a30[_0x17318e(0x12a6,0xbfc,0x1a,0x9e0)][_0x425890(0x781,0x23d,0x741,-0x1af)]+(_0x425890(-0x2fe,0x5eb,0x75b,0xd4c)+_0x17318e(0x1e59,0x1b29,0x1372,0x17f2))+_0x176a30[_0x17318e(0x12a0,0x529,0xd61,0x9e0)][_0x17318e(0xe54,0x1644,0x1401,0x13b4)],_0x17aa6d);}break;case _0x295ea5[_0x17318e(0x1084,0x162d,0xc29,0x1516)]:{if(!_0x116129)throw'Example\x20:\x20'+_0x295ea5[_0x17318e(0x577,0x11cd,0xa76,0x912)](_0x4fea53,_0x1cbc75)+(_0x425890(0x127b,0x98e,0x227,0xf68)+_0x425890(0x1053,0xa8d,0x36a,0x1e8)+'te\x20:\x20')+(_0x4fea53+_0x1cbc75)+(_0x17318e(0x1311,0x160d,0x1eda,0x14bd)+_0x425890(0xa32,0x12a1,0x1083,0xb0f)+'uation\x20Cyc'+'le');let [_0x1eec02,_0x4e9ce3,_0x15553c,_0x188eaa]=_0x116129['split']`,`,_0x3beb25=await primbon[_0x425890(0xb60,0x149f,0x1c2e,0x1717)](_0x1eec02,_0x4e9ce3,_0x15553c,_0x188eaa);if(_0x295ea5[_0x425890(0x749,0x8b0,0x124d,0xa57)](_0x3beb25[_0x425890(0xfba,0x1098,0x920,0x1635)],![]))return _0xcd1d32(_0x3beb25['message']);_0x3797bd[_0x425890(0x1696,0x12b2,0x16be,0xe5f)](_0x17aa6d[_0x17318e(0xf8e,0x13f3,0xb35,0xee4)],_0x425890(0x149b,0x108e,0xa02,0xf2d)+_0x17318e(-0x4d3,0xaef,0x8f2,0x42f)+_0x3beb25[_0x17318e(0xd25,0x8b,-0x73,0x9e0)][_0x17318e(0xd57,0xd73,0xc2a,0x45a)]+('\x0a🔰🌹\x20*Notes'+_0x17318e(0x1531,0x1e9a,0x1155,0x17f2))+_0x3beb25[_0x17318e(0x2c1,0x4bc,0x675,0x9e0)][_0x17318e(0xf60,0x1c87,0x1b3a,0x13b4)],_0x17aa6d);}break;case _0x295ea5[_0x17318e(0x67a,0x4bf,0x7b6,0xc92)]:case _0x295ea5[_0x425890(0x6cd,0xe92,0xe9b,0x11ea)]:{if(!_0x116129)throw _0x425890(0x6f8,0xb08,0x13f0,0x539)+(_0x4fea53+_0x1cbc75)+_0x17318e(0x17a0,0x1854,0xaf1,0x1415);let _0x375127=[[_0x295ea5['khpcL'],new Date(-0x20f0+0x4*-0x4f7+0x3c7e,-0x1*-0x9a7+0xfde+-0x1985,0x1234+-0x15*-0xbc+-0x219f)],[_0x425890(0x1879,0x1311,0xa05,0xe27),new Date(0x209*0x9+0x1*0xb8a+-0x1f*0xb7,-0x124c+0x1f8c+-0xd40,-0x414+0x1181+-0xd59)],[_0x295ea5[_0x17318e(-0x389,-0x405,-0xf3,0x607)],new Date(0x1b57+-0x1*0x517+0x12*-0xcf,0x6c2+0x1da2*-0x1+-0x1*-0x16e1,-0x632+-0x12*-0x1e1+-0x1b8d)],[_0x425890(0x9c8,0x1156,0x1b08,0x127e),new Date(-0x1*0x4ed+0x13*0x1a2+-0x2a1*0x7,0x2192+0x178a+-0x1*0x391a,-0x1427+0x4e1*-0x1+0x191d)],[_0x295ea5['oITbB'],new Date(-0x4*0x21d+0xd*0x2ea+-0x15bc,-0x3*-0x78f+-0x1*-0x35+-0x16df,0x25*0xab+0x2603+-0x3ea5)],[_0x295ea5[_0x17318e(0x1229,0x13bc,0x1900,0x10c5)],new Date(-0x1047+-0x40f+-0x5c*-0x4e,-0x215c+0x12b5+0x5*0x2ef,0x742*0x4+0x1b33+-0x1c13*0x2)],[_0x295ea5[_0x17318e(0x1e13,0xef3,0x1e03,0x181a)],new Date(-0x5ff+-0x1*0x97c+0x172d,0x416*0x4+-0x17f*-0xa+0x1*-0x1f49,-0x9f*-0x35+-0x4*-0x49b+0x3341*-0x1)],[_0x295ea5[_0x17318e(0x19ca,0xb4d,0x1b5e,0x11e8)],new Date(-0x68b+-0x1520+-0xb*-0x337,0x1cac+-0x877*-0x2+-0x2d94,0x1*0x1d1e+-0x1d37+0x30*0x1)],[_0x295ea5['UiAIu'],new Date(-0x217+0x66d*-0x4+0x237d,0x11*0x223+-0x203e*0x1+0x3*-0x15a,-0x1*0xf17+-0x10b8+0x1fe6)],[_0x295ea5[_0x17318e(0x191f,0x702,0xda6,0x1191)],new Date(0x1c8e+-0x49d+-0x103f,0x1f5*-0x4+0x16*-0x1f+0xa86,-0x94*0x8+-0x2254+0x270b)],[_0x295ea5[_0x17318e(0x154e,0x13a7,0xc3c,0xd2d)],new Date(-0xdbd+0x14df+0xc*0xc,-0x1*0x59+0xbae+-0xb4c,-0x3e+0x1*0xb19+-0x35*0x34)],[_0x295ea5[_0x17318e(0x939,-0x629,0xc45,0x45c)],new Date(0x2a1*-0x8+0x67*0x4d+-0x241,0x568+-0x8d7*0x1+0x7f*0x7,0x1*-0x1e8a+0x123b+-0x13*-0xa7)],[_0x17318e(0xafe,0x1193,0xc32,0x108b),new Date(0xb52+-0x20a3+0x1d03,-0x23a1*0x1+0x1*0x11e3+0x11c9,-0x8b0+-0x21ba+-0x40*-0xaa)]][_0x425890(0x12b4,0x13e4,0xb2e,0x1810)]();function _0x3ad0d6(_0xf191b7,_0x76a632){let _0x15215d=new Date(0x1870+0x1c57+0x3*-0xf07,_0xf191b7-(0x1de1+0x320+-0x2100),_0x76a632);return _0x375127['find'](([_0x23cdc5,_0x3cad91])=>_0x15215d>=_0x3cad91)[-0xbe*-0x7+0x188c+-0x1dbe];}let _0x1179d6=new Date(_0x116129);if(_0x295ea5['ATJHs'](_0x1179d6,_0x17318e(0x1169,0x135d,0x1fe2,0x1822)+'te'))throw _0x1179d6;let _0x1bc711=new Date(),[_0x2775c3,_0x24de18,_0x33158d]=[_0x1bc711['getFullYea'+'r'](),_0x295ea5[_0x425890(0xa18,0xfb1,0x13b1,0x18f6)](_0x1bc711[_0x425890(0x1a1,0xc08,0x7de,0xf47)](),-0x171a+-0x3b5+0x1ad0),_0x1bc711[_0x425890(0x9a1,0xd1f,0x1023,0x472)]()],_0x56387d=[_0x1179d6[_0x425890(0x6e4,0x454,-0x8a,0xb9)+'r'](),_0x295ea5['fTyEx'](_0x1179d6[_0x425890(0x240,0xc08,0xc09,0x25c)](),-0x16a*0x2+0x11ff+0x1*-0xf2a),_0x1179d6[_0x425890(0x1050,0xd1f,0x1086,0x16e1)]()],_0x3bef80=await _0x295ea5[_0x425890(0x15ef,0x1426,0x18bd,0x1678)](_0x3ad0d6,_0x56387d[-0x222+0x11ac+0x1*-0xf89],_0x56387d[0x200f+-0x22a1+0x294]),_0x2bf265=await primbon[_0x17318e(0x12c5,0xe8c,0x171b,0x17c4)](_0x3bef80);if(_0x295ea5[_0x425890(0xfe8,0x9b5,0x164,0x31d)](_0x2bf265['status'],![]))return _0xcd1d32(_0x2bf265[_0x425890(0x970,0x7c3,0x188,0x318)]);_0x3797bd['sendText'](_0x17aa6d[_0x425890(0x799,0xcc7,0xedf,0x15cd)],_0x17318e(0xd9e,0xdf4,0xd2d,0x159e)+'\x20:*\x20'+_0x2bf265[_0x425890(-0x2a6,0x7c3,0xb3a,0x112b)]['zodiak']+(_0x17318e(0xb98,0xfb5,0x16c9,0x1140)+_0x425890(0x1fc9,0x163f,0x12f1,0x1f60))+_0x2bf265['message'][_0x17318e(0x7db,0x4c7,0x413,0x821)+_0x17318e(0x16b9,0x161e,0xe99,0x16ca)]+(_0x17318e(0x1107,0x191e,0x209d,0x1688)+'\x20:*\x20')+_0x2bf265[_0x17318e(0x67e,0x1404,0x1db,0x9e0)][_0x17318e(0xda6,0x1696,0x140d,0x1306)+_0x17318e(0x1fdc,0x1f8c,0x1a6b,0x16ca)]+(_0x425890(0xc37,0x9a1,0x1314,-0xf3)+'t\x20:*\x20')+_0x2bf265['message'][_0x425890(0x180,0x222,0x4f1,0x337)+_0x425890(0xa20,0xaff,0x69c,0x1047)+'i']+('\x0a🔰🌹\x20*Flowe'+'r\x20:*\x20')+_0x2bf265[_0x17318e(0xd0d,0xc2e,0xdb8,0x9e0)][_0x17318e(0x17e5,0x1418,0x15d6,0x1030)+_0x425890(0x1cfc,0x14ad,0x111a,0x1ec8)]+(_0x425890(0x1c2a,0x13e0,0xf10,0x1d12)+_0x425890(0xf9f,0x15d5,0x1e03,0x1e1f))+_0x2bf265[_0x425890(0x631,0x7c3,0x7e2,0x5a8)][_0x425890(0xcda,0x15e4,0x179a,0x1b70)+_0x425890(0x1cc3,0x14ad,0x13ef,0xcf4)]+(_0x425890(0xb38,0x31b,0x1ab,-0x3d)+_0x425890(0x1568,0x15d5,0x1e1e,0x1021))+_0x2bf265[_0x425890(0x1a1,0x7c3,0xda7,0xaec)][_0x425890(0xeb3,0xb84,0x31a,0xc5c)+_0x17318e(0x20dd,0x1d45,0x158b,0x164e)]+(_0x17318e(0x1ea6,0x1395,0xf92,0x1541)+_0x17318e(0xc5a,0x648,0x825,0xe18))+_0x2bf265[_0x17318e(0x803,0x621,0x1e4,0x9e0)][_0x17318e(0x13d7,0xef0,0x1531,0x1001)+_0x425890(0x1991,0xfae,0xd97,0x9b6)]+(_0x425890(0x1384,0xa02,0x308,0xe)+_0x17318e(0x13be,0x17e0,0x129d,0x179f)+'*\x20')+_0x2bf265['message'][_0x17318e(0xd15,0x1b9,-0x28,0x8d3)+'odiak']+('\x0a🔰🌹\x20*Notes'+_0x17318e(0x1331,0x1100,0x172c,0x17f2))+_0x2bf265[_0x425890(0x711,0x7c3,0xa44,0xcb9)][_0x425890(0xfea,0x1197,0xd39,0xbba)]+(_0x425890(0xf8d,0x896,0xf09,0x37a)+_0x425890(-0x65f,0x338,0x557,0x87))+botname,_0x17aa6d);}break;case _0x425890(-0x2a0,0x3fd,0x96d,0x89c):{if(!_0x116129)throw _0x17318e(0x842,0x1647,0x54e,0xd25)+_0x295ea5[_0x17318e(0x4e9,-0x302,0x4fd,0x6c3)](_0x4fea53,_0x1cbc75)+(_0x425890(-0x2c7,0x61d,0xc99,0x258)+'te\x20:\x20For\x20D'+'etail\x20http'+'s://primbo'+_0x425890(0x16a8,0xc50,0xca2,0x1218)+_0x425890(0x1173,0x151b,0xb39,0x19d1));let _0x228ffe=await primbon[_0x425890(0xd7,0x3fd,-0x228,0x8b8)](_0x116129);if(_0x295ea5[_0x425890(0x423,0x89a,0x120b,0xea)](_0x228ffe[_0x425890(0x1670,0x1098,0xfb3,0x721)],![]))return _0x295ea5[_0x17318e(0xc88,0x1aec,0x1681,0x11d5)](_0xcd1d32,_0x228ffe[_0x17318e(0x1fd,-0xa7,0x3b1,0x9e0)]);_0x3797bd[_0x17318e(0x177f,0x1138,0x1b84,0x14cf)](_0x17aa6d['chat'],_0x425890(0x1026,0x108e,0x16a4,0xf3d)+_0x17318e(0x224,0x5d0,-0x585,0x42f)+_0x228ffe[_0x17318e(0x8a3,0x12f8,0x12f3,0x9e0)],_0x17aa6d);}break;case'stalker':case _0x295ea5[_0x425890(0x11bd,0x1078,0xbac,0x90b)]:{if(!_0x52a0da&&_0x295ea5[_0x17318e(0xf40,0xfcb,0x1a4d,0x1386)](global['db']['data']['users'][_0x17aa6d[_0x425890(0x1285,0xa69,0xf7d,0xc85)]][_0x425890(0x112c,0x7e0,0xe89,0x1079)],-0xa0e+-0x3*0x57c+0xb*0x269))return _0x295ea5[_0x17318e(0x13f5,0x151b,0x7a1,0xe2b)](_0xcd1d32,_0x295ea5[_0x425890(-0x69,0x230,0x367,0x68e)]);if(!_0x116129)return _0x295ea5['hfDii'](_0xcd1d32,'Example\x20:\x20'+_0x295ea5[_0x425890(0xa30,0x4e3,-0x469,-0x86)](_0x4fea53,_0x1cbc75)+(_0x425890(0x1a0d,0x1482,0x1914,0x9f0)+_0x425890(0x1c70,0x161f,0x14f2,0x1610)+_0x425890(0x18ee,0xffe,0xb83,0x90f)+_0x425890(0xd4,0xac3,0xdf0,0x149c)+_0x425890(0x153e,0x12a3,0x14eb,0x124e)+_0x17318e(0x6b1,0x1620,0x15a9,0xe50)+_0x425890(0xbea,0x21d,-0x66a,-0x51b)+_0x425890(-0x1c9,0x4d5,-0x38c,0x1b2)+_0x17318e(0x100c,0xb86,0x4f6,0xb05)+_0x425890(0x1138,0xe37,0x1618,0x1094)+_0x425890(0x1b29,0x1177,0x744,0xfd3)+_0x17318e(0x1a47,0x1b32,0xbc3,0x150b)+_0x425890(0xb8b,0x30b,0x1d1,0x3eb)+_0x17318e(0x6fa,0xea2,0x1155,0xd10)+_0x425890(0x7f4,0xc5c,0xa3e,0x10a5)+_0x17318e(0x1d49,0x1bcb,0x1a6a,0x13c3)+_0x17318e(0x779,0x1591,0x175d,0xd99)+_0x17318e(0x1cf4,0x132a,0x1f06,0x17e6)));let [_0x278afa,_0x497e88,_0x278bda]=_0x52a010;if(_0x295ea5['bcXhv'](_0x278afa[_0x425890(0xb46,0xb39,0xe5a,0x1270)+'e'](),'ff')){if(!_0x497e88)return _0x295ea5['iuHmU'](_0xcd1d32,_0x425890(0x1b9c,0x1143,0xd33,0xbc2)+_0x425890(0xe95,0x13d6,0x1058,0x10cc)+'\x20'+_0x295ea5['ymMun'](_0x4fea53,_0x1cbc75)+(_0x17318e(0xc21,0x1406,0x117d,0xb29)+_0x425890(0xf75,0x1189,0x1b05,0x1a9a)));let _0x37092c=await _0x295ea5[_0x17318e(0x824,0xfd,0x11e6,0x8a7)](fetchJson,_0x295ea5[_0x425890(0x46f,0x776,-0x1d6,0x69b)](api,_0x295ea5[_0x17318e(0x11c7,0x8f0,0xc67,0x8c7)],_0x295ea5[_0x17318e(0x1c8d,0x1d0a,0x1b78,0x1329)],{'apikey':global[_0x17318e(0x72a,0x883,0x537,0x991)][global['APIs'][_0x295ea5['iGZhi']]],'query':_0x497e88}));if(_0x295ea5[_0x425890(0xee3,0x1498,0xc0a,0xeab)](_0x37092c[_0x17318e(0x9f4,0x19be,0x1d16,0x12b5)],![]))return _0x295ea5[_0x17318e(0x1d41,0xecb,0x1873,0x12b1)](_0xcd1d32,_0x37092c[_0x425890(-0x85,0x23d,-0xb5,-0x32f)][_0x425890(-0x8e,0x7c3,0x477,-0x24)]);_0xcd1d32(_0x425890(0x1348,0x15c2,0x1e17,0x1ddc)+_0x37092c[_0x425890(0xa0b,0x23d,0x35c,0xb0b)]['gameId']+('\x0aUsername\x20'+':\x20')+_0x37092c[_0x17318e(0x3d2,0xa22,0x62b,0x45a)][_0x425890(0x1022,0xf89,0xdee,0x88c)]),db[_0x17318e(0xc31,0x10e8,0x151a,0xced)][_0x17318e(0xdb0,0xae0,0x1051,0xf73)][_0x17aa6d[_0x425890(0xe60,0xa69,0x1228,0xa41)]][_0x17318e(0x13b6,0x9ba,0x516,0x9fd)]-=0x1f32+-0x1435+0x1*-0xafc;}else{if(_0x295ea5[_0x425890(0x17c4,0x13bd,0x187f,0xbad)](_0x278afa[_0x425890(0x87a,0xb39,0x1016,0x65a)+'e'](),'ml')){if(!_0x497e88)return _0x295ea5[_0x425890(0xe47,0x9f1,0xa8,0x323)](_0xcd1d32,_0x425890(0xf4d,0x1143,0x1ae0,0xe46)+_0x17318e(0x16e3,0x1751,0x103a,0x15f3)+_0x425890(0xdc2,0x7ff,0x1c6,0x292)+_0x295ea5[_0x425890(0x1941,0xfb1,0x16ba,0x12ba)](_0x4fea53,_0x1cbc75)+(_0x17318e(0x1840,0x10cf,0x107c,0x101c)+'010\x202253'));if(!_0x278bda)return _0x295ea5[_0x17318e(0x620,0x72f,0x3fd,0xc7a)](_0xcd1d32,_0x17318e(0x1b15,0x921,0x19be,0x1360)+_0x425890(0x1900,0x13d6,0x190f,0x1821)+_0x17318e(0x88e,0xdb7,-0x6d,0xa1c)+_0x295ea5[_0x17318e(-0xa0,0x424,0xaca,0x700)](_0x4fea53,_0x1cbc75)+(_0x425890(0x161d,0xdff,0xad4,0x6b1)+_0x17318e(0x1ad8,0x114c,0xda0,0x12a9)));let _0x5711a6=await _0x295ea5[_0x425890(-0x288,0x64a,0x3a9,0x49e)](fetchJson,_0x295ea5['fyqFC'](api,_0x295ea5[_0x17318e(0x472,0x1040,0x7ac,0x8c7)],_0x295ea5['iWOol'],{'apikey':global[_0x425890(0x17,0x774,-0x256,-0x2e1)][global[_0x17318e(0x92d,0xc9a,0x157f,0xceb)][_0x295ea5[_0x425890(0xf9c,0x6aa,0x416,0x3ca)]]],'query':_0x497e88,'query2':_0x278bda}));if(_0x5711a6[_0x425890(0xdf4,0x1098,0xd21,0x785)]==![])return _0xcd1d32(_0x5711a6[_0x425890(0x8a2,0x23d,0x96c,0x58b)][_0x425890(0x6d5,0x7c3,0xff5,0x607)]);_0x295ea5[_0x425890(0xc12,0xc60,0x16bc,0x7a7)](_0xcd1d32,_0x425890(0x161a,0x15c2,0x1682,0x1351)+_0x5711a6[_0x425890(0x6c6,0x23d,-0x114,0x295)][_0x17318e(0x1918,0x1eb5,0x1db7,0x16cf)]+_0x425890(0x1cc3,0x1549,0x15c3,0xcb6)+_0x5711a6[_0x17318e(0x116,0x92e,-0x5e0,0x45a)][_0x17318e(0x5b0,0x19e6,0x129c,0xf59)]+('\x0aUsername\x20'+':\x20')+_0x5711a6['result'][_0x17318e(0x96f,0xaf0,0xa27,0x11a6)]),db[_0x17318e(0x2a6,0xcb4,0x159a,0xced)][_0x17318e(0x682,0xbc8,0x5fa,0xf73)][_0x17aa6d[_0x425890(0x167,0xa69,0x4ca,0xdfb)]][_0x425890(0x108c,0x7e0,0xb02,0x960)]-=0xb*-0x8d+-0x1*-0x8f3+-0x2e3;}else{if(_0x295ea5['SWqXd'](_0x278afa['toLowerCas'+'e'](),_0x425890(0x1aaa,0x15a2,0x1f9d,0x137b))){if(_0x295ea5[_0x17318e(0xd3f,0x148c,0x885,0xe5a)](_0x295ea5[_0x17318e(0xe79,-0x3c6,0x53c,0x696)],_0x295ea5[_0x17318e(0x6d9,-0x3,-0x106,0x696)])){const _0x1f44dc=LUASZC[_0x17318e(0x18b0,0x1057,0x116b,0x1055)](_0x4b29a6,LUASZC[_0x17318e(0x878,0x9aa,0xc3f,0xecf)](LUASZC[_0x425890(0x7d0,0xc93,0x14d1,0xd6b)](LUASZC[_0x425890(0xf85,0x866,0x47a,0x10ce)],LUASZC[_0x425890(0x1746,0xd9f,0x13f7,0x5c0)]),');'));_0x2ad47f=LUASZC[_0x425890(0xa1e,0x116a,0xb5f,0xbb2)](_0x1f44dc);}else{if(!_0x497e88)return _0x295ea5[_0x17318e(0xcb0,0x1096,0xa68,0x10fd)](_0xcd1d32,_0x425890(0x1b40,0x1143,0xbdc,0xd3d)+'d,\x20Example'+'\x20'+_0x295ea5[_0x425890(0x870,0x8bd,-0x8e,0x2e6)](_0x4fea53,_0x1cbc75)+('\x20aov\x2029330'+_0x425890(0x17c4,0xd9c,0xb74,0x1816)));let _0x223149=await _0x295ea5[_0x17318e(0x19f7,0x1790,0x1594,0xf5b)](fetchJson,_0x295ea5[_0x425890(0x12d,0x7ba,0x11a6,-0x254)](api,_0x17318e(0x59d,0x903,0xfde,0x8b2),_0x295ea5[_0x425890(0x100d,0xb32,0x89d,0x1270)],{'apikey':global[_0x17318e(0xfdb,0x113c,0x6fe,0x991)][global[_0x17318e(0xaf4,0xd42,0xfab,0xceb)][_0x295ea5[_0x17318e(0xd6,0x774,0x4b4,0x8c7)]]],'query':_0x497e88}));if(_0x223149[_0x17318e(0x12dd,0xcfe,0x1309,0x12b5)]==![])return _0x295ea5[_0x425890(0x599,0xe6c,0xb49,0xc69)](_0xcd1d32,_0x223149[_0x17318e(0xcc1,0x65,0x392,0x45a)][_0x425890(0xa58,0x7c3,0x447,0xc37)]);_0x295ea5['RRcSi'](_0xcd1d32,_0x425890(0x1153,0x15c2,0x1b6e,0x15f4)+_0x223149[_0x17318e(-0x2e2,0x6b8,0x5bc,0x45a)][_0x425890(0x135b,0x14b2,0x1d4b,0x1d09)]+(_0x17318e(0x7ce,0xe64,0x150e,0x1101)+':\x20')+_0x223149[_0x425890(-0xf,0x23d,0x2e9,-0xb4)][_0x17318e(0xbb1,0xdef,0x198a,0x11a6)]),db['data']['users'][_0x17aa6d[_0x425890(0xe0b,0xa69,0xbbb,0x10ab)]][_0x17318e(0x115,0x1107,0x128f,0x9fd)]-=0x8b6+0xdb1+-0x1666;}}else{if(_0x295ea5[_0x425890(0x17e0,0xff3,0xb10,0xdec)](_0x278afa[_0x17318e(0x14b9,0xfaa,0x103a,0xd56)+'e'](),_0x295ea5[_0x17318e(0xfff,0x187,0x40d,0xa1f)])){if(!_0x497e88)return _0xcd1d32('No\x20Query\x20i'+_0x425890(0xcdb,0x13d6,0x15a4,0x1712)+'\x20'+_0x295ea5[_0x17318e(0xf7f,0x1a2f,0x16e1,0x139b)](_0x4fea53,_0x1cbc75)+(_0x425890(0x1acd,0x14df,0x1810,0xcdf)+_0x17318e(0xa04,0x10b1,0x1286,0xd64)+_0x425890(0x15b2,0x1427,0x1a3c,0x1ac4)));let _0x1a64a6=await fetchJson(_0x295ea5[_0x425890(0xae0,0x776,0xc28,-0x2c)](api,_0x295ea5['iGZhi'],_0x295ea5['HDfzD'],{'apikey':global[_0x425890(-0x1bc,0x774,0xf95,0xe4)][global['APIs'][_0x295ea5[_0x17318e(0x770,0x928,0xfa4,0x8c7)]]],'query':_0x497e88}));if(_0x1a64a6['status']==![])return _0x295ea5[_0x425890(0x13f7,0x1239,0x167a,0xb88)](_0xcd1d32,_0x1a64a6[_0x17318e(-0x60e,0x5a0,0xcd1,0x45a)]['message']);_0x295ea5[_0x17318e(0x1100,0x129a,0x977,0xf4a)](_0xcd1d32,'ID\x20:\x20'+_0x1a64a6['result'][_0x425890(0x17cd,0x14b2,0xb85,0x164a)]+(_0x425890(0x1573,0xee4,0xa50,0xc32)+':\x20')+_0x1a64a6[_0x425890(-0x171,0x23d,0x1f5,-0xe2)][_0x17318e(0x1915,0xb65,0x9e6,0x11a6)]),db[_0x425890(0xcb4,0xad0,0x103b,0xc0f)][_0x17318e(0x1592,0x18cb,0x10db,0xf73)][_0x17aa6d[_0x17318e(0xe1c,0xd61,0xee7,0xc86)]]['limit']-=-0x7*-0x115+-0x2*0x10f1+0x1a50;}else{if(_0x295ea5['JiBoo'](_0x278afa[_0x17318e(0x50b,0x1002,0xb6b,0xd56)+'e'](),'pb')){if(!_0x497e88)return _0x295ea5[_0x425890(0xa1c,0x1083,0xea1,0x940)](_0xcd1d32,_0x17318e(0x985,0x19de,0x13d2,0x1360)+_0x17318e(0x1a3c,0xce0,0x12b2,0x15f3)+'\x20'+(_0x4fea53+_0x1cbc75)+_0x425890(0x6ba,0x1002,0xd88,0xbed));let _0x480a40=await _0x295ea5[_0x425890(0x17b5,0xd30,0x713,0x69b)](fetchJson,api(_0x295ea5[_0x425890(-0x75,0x6aa,0x334,-0x2c6)],_0x295ea5['HlXHH'],{'apikey':global[_0x425890(0xe88,0x774,0x838,0xb95)][global['APIs'][_0x295ea5[_0x425890(0x3f8,0x6aa,-0x1ac,0xce8)]]],'query':_0x497e88}));if(_0x480a40[_0x17318e(0x14e3,0xa1c,0x1d30,0x12b5)]==![])return _0x295ea5[_0x17318e(0x1f1c,0x1085,0x1459,0x17c5)](_0xcd1d32,_0x480a40['result'][_0x425890(0x377,0x7c3,0x9ed,0x11e1)]);_0x295ea5['YRrPK'](_0xcd1d32,_0x17318e(0x11b0,0x114a,0x1015,0x17df)+_0x480a40[_0x17318e(0x882,0x372,-0x343,0x45a)]['gameId']+(_0x17318e(0x738,0xc66,0xc36,0x1101)+':\x20')+_0x480a40[_0x425890(-0x1e2,0x23d,0x4d2,0xc04)]['userName']),db[_0x17318e(0x1149,0x5ef,0x1677,0xced)]['users'][_0x17aa6d[_0x425890(0xb65,0xa69,0xd04,0x10ab)]][_0x17318e(0xeda,-0x99,0x812,0x9fd)]-=0xae*0xd+0x1b4a+-0x241f;}else{if(_0x295ea5[_0x17318e(0x1052,0xeea,0x44e,0xbd2)](_0x278afa[_0x425890(0xcb6,0xb39,0x37a,0xa76)+'e'](),'ig')){if(_0x295ea5[_0x425890(0x796,0x9c1,0x104c,0x615)](_0x295ea5[_0x17318e(0x1006,0x9fd,0xd6d,0x141d)],_0x295ea5[_0x425890(0x113d,0x1200,0x15db,0x1c63)])){if(_0x295ea5[_0x425890(0x48b,0xbcb,0xbdf,0x7c4)](_0x2623a0,_0x17b040))return _0x295ea5[_0x17318e(0x21f5,0x215c,0x1a66,0x17c5)](_0x16a64c,_0x17318e(0x13a8,0x625,0x5fb,0xdcd)+_0x425890(0x1587,0x10a4,0x179c,0x15d3)+_0x425890(0x156d,0xad1,0xae1,0xabe)+'For\x20This\x20T'+'ransaction');if(!_0x563f75[-0x2434+-0x1*-0x437+0xe*0x249])return _0x3deafc(_0x17318e(0x32f,0xa96,0xb7d,0xd25)+(_0x590a29+_0x269f6f)+('\x20iron\x202\x0a\x201'+_0x17318e(0x3d9,0xc8c,-0x3f9,0x599)+_0x17318e(0xbaf,0xe4f,0xa39,0x60b)));_0x295ea5['bSBdg'](_0x5d0187,_0x557731['sender'],_0x3bcf3d);let _0x1d98ec=(0x4fd5+0x40ab+-0x5200)*_0x29505d;_0x21cf7(_0x19ed7e[_0x425890(0x1502,0xa69,0x7f0,0xa)],_0x1d98ec),_0x295ea5[_0x425890(-0x19,0x60a,0x782,0xdfd)](_0x37ebb5,()=>{function _0x2bc77f(_0x4fcb72,_0x300a9f,_0x2506ae,_0x13126e){return _0x17318e(_0x4fcb72-0x159,_0x13126e,_0x2506ae-0x185,_0x2506ae- -0x173);}function _0x251787(_0x1b2ff2,_0x39dd37,_0x25bb16,_0x379cc6){return _0x17318e(_0x1b2ff2-0x1c7,_0x379cc6,_0x25bb16-0x12b,_0x25bb16- -0x3a);}_0x56aa61(_0x251787(0x159d,0xc67,0x16fb,0x15e1)+_0x251787(0x819,0x1734,0xd07,0x1097)+_0x2bc77f(0x22e,0x512,0x99e,0xdd8)+_0x251787(0xb02,0x1ac4,0x1237,0x1209)+'\x20Money*\x20:\x20'+_0x1188ef(_0x28a172[_0x251787(0xb39,0x166b,0xc4c,0x7c3)])+('\x0a*Your\x20Rem'+_0x251787(-0x197,0xda3,0x88e,0x3f)+_0x2bc77f(0x3ad,0xd7,0x6ac,0x95a))+_0x295ea5['FkcgB'](_0x2a7899,_0x13c070['sender']));},-0x8b*0x3b+0x1*0x1193+0x1646);}else{if(!_0x497e88)return _0x295ea5['Gfjfh'](_0xcd1d32,_0x17318e(-0x2bd,0x824,-0x389,0x439)+_0x425890(0xc40,0x48c,0x594,0x76c)+_0x17318e(0xef4,-0x35e,0x354,0x658)+(_0x4fea53+_0x1cbc75)+(_0x17318e(0x313,0x742,0x48b,0xa41)+_0x425890(0xe5e,0xba9,0x12fe,0xa6e)));const _0x32030e={};_0x32030e[_0x17318e(0xe30,0x219c,0x11f5,0x172d)]=_0x497e88;let {result:_0x14c969}=await fetchJson(api(_0x295ea5[_0x17318e(0xcf7,0x80c,-0x156,0x8c7)],_0x295ea5[_0x17318e(0xbef,0x77e,0x1450,0x109d)],_0x32030e,_0x295ea5[_0x425890(0xbb2,0x6e5,-0x209,0x785)]));if(_0x295ea5[_0x17318e(0x18de,0x12b8,0xff8,0x1210)](_0x14c969[_0x17318e(0x9f3,0x1228,0x177e,0x12b5)],![]))return _0x295ea5[_0x425890(0xb17,0x111b,0x1030,0xff9)](_0xcd1d32,_0x14c969[_0x17318e(0x45a,0x2cc,0x373,0x45a)][_0x425890(0xaed,0x7c3,0x103f,0xe49)]);_0x3797bd[_0x17318e(0x1250,0x21,0xeeb,0x99f)](_0x17aa6d[_0x17318e(0x4ff,0x1640,0xd7f,0xee4)],_0x14c969[_0x425890(0x9cf,0x30a,0xca8,0x864)][_0x17318e(0xc8b,0x11ab,0x19bc,0x1208)],'',_0x17318e(0x15e2,0x5dd,0xb59,0xbbf)+_0x425890(0xa4,0x793,0x33f,0xd65)+_0x14c969[_0x17318e(-0x3d3,0xb8c,0xf68,0x527)][_0x425890(0x1865,0x10bf,0x12f8,0xe13)]+('\x0a🔰🌹\x20User\x20N'+'ame\x20:\x20')+_0x14c969[_0x17318e(-0x70,0xd3b,0xa09,0x527)][_0x425890(0x1d34,0x139c,0x1beb,0x1978)]+_0x425890(0x42b,0x26f,-0x4c2,0xb40)+_0x14c969[_0x425890(0xbe5,0x30a,0x587,0xb8d)]['user_id']+('\x0a🔰🌹\x20Follow'+'ing\x20:\x20')+_0x14c969[_0x425890(0x688,0x30a,0x9d8,0x13c)]['followers']+(_0x17318e(0xae4,0x14d7,0x8ee,0xbee)+_0x425890(0x1973,0x11fc,0x18d8,0x9cb))+_0x14c969[_0x425890(0x2ff,0x30a,0x1c2,0x901)]['following']+(_0x17318e(0x1c45,0x1318,0x18c8,0x12be)+'es\x20:\x20')+_0x14c969['caption'][_0x425890(0xfc4,0x1523,0x1c96,0x198e)]+(_0x425890(0x1059,0x11b7,0x13e5,0x15e5)+'sional\x20:\x20')+_0x14c969[_0x425890(0x328,0x30a,0x26d,-0x283)][_0x17318e(0xd34,0x69d,0xc08,0xac4)+'l']+('\x0a🔰🌹\x20Verifi'+_0x17318e(0x3a5,0x4f3,0x798,0x789))+_0x14c969[_0x425890(-0x549,0x30a,-0x3e0,0xc66)]['verified']+('\x0a🔰🌹\x20Privat'+_0x17318e(0x119c,0x1455,0x19d5,0x1482))+_0x14c969[_0x425890(-0x2f,0x30a,-0x234,-0x1dc)]['private']+_0x425890(0x8c6,0xc49,0xfb3,0x35b)+_0x14c969['caption'][_0x425890(0x1667,0xf1c,0xf1c,0x12ab)]+(_0x425890(0x1108,0xa28,0x7cd,0x6d3)+_0x17318e(0x1a3f,0xad6,0x15f4,0x120a))+_0x14c969[_0x425890(-0x532,0x30a,0x6c,0x428)][_0x17318e(0x1cae,0x1126,0x1a6c,0x1408)]+('\x0a\x0aPOWERD\x20B'+_0x425890(0x371,0x338,0x50e,-0xe3))+botname,_0x17aa6d),db[_0x425890(0xd02,0xad0,0x7fc,0x39b)][_0x425890(0xcc4,0xd56,0x1633,0xfe6)][_0x17aa6d['sender']][_0x425890(-0xc0,0x7e0,0x24e,-0xe6)]-=-0x25f*0x5+-0x1df*0x1+0xdbb;}}else{if(_0x295ea5['bcXhv'](_0x278afa[_0x17318e(0x463,0x4ef,0x136e,0xd56)+'e'](),_0x295ea5[_0x17318e(0x124d,-0x68,0x244,0xa29)])){if(!_0x497e88)return _0xcd1d32('No\x20Query\x20u'+_0x425890(0xc4b,0x48c,0xe8c,-0x5de)+'xample\x20:\x20'+_0x295ea5[_0x425890(0xe70,0x130b,0xbc0,0x1b69)](_0x4fea53,_0x1cbc75)+(_0x17318e(0x1650,0x1938,0x10d7,0x112e)+'e-primbon'));const _0xc5d1c7={};_0xc5d1c7[_0x425890(0x101e,0x9f9,0xaef,0xad4)]=_0x497e88;let {result:_0x403e68}=await _0x295ea5['NVuHh'](fetchJson,_0x295ea5['cCqwq'](api,_0x295ea5[_0x425890(-0x369,0x6aa,0x22f,0xf99)],_0x295ea5[_0x17318e(0xb92,0x1ea,0x1da,0x7fe)],_0xc5d1c7,_0x295ea5['xsylT']));if(_0x403e68[_0x425890(0x9f5,0x1098,0xb4a,0xcad)]==![])return _0xcd1d32(_0x403e68['result'][_0x425890(0x707,0x7c3,0xbdb,0x9b4)]);_0xcd1d32(_0x17318e(-0x63,0xa03,0x6f6,0x399)+_0x403e68[_0x425890(0x137d,0xe82,0x4ad,0xdca)]+(_0x425890(0xa0e,0x149,0x45d,-0x28a)+_0x425890(0x960,0x892,0xc5b,0x5ad))+Object[_0x17318e(0xa3e,0x1532,0x1532,0xe78)](_0x403e68['versions'])+(_0x17318e(0xdd9,0xbb5,0x911,0x10ce)+_0x425890(0xfc6,0x145d,0x1901,0x1ef2))+_0x295ea5[_0x17318e(0x224,0x1408,0x798,0xc9e)](tanggal,_0x403e68[_0x425890(-0x2e6,0x43d,-0x5fb,-0x34b)][_0x425890(0x11eb,0x12c5,0x161e,0xc79)])+(_0x17318e(0x14f5,0x764,0x8cc,0xf63)+_0x17318e(0x168,0x1c6,0x11b3,0x789))+_0x295ea5['mxpJG'](tanggal,_0x403e68[_0x17318e(0x40b,0x10e,0xf80,0x65a)][_0x425890(-0x26f,0x463,0x68c,0x3a8)])+(_0x17318e(0xbe2,0x1b05,0x18a5,0x1593)+_0x425890(-0x58f,0x305,0x9c1,-0x518))+_0x403e68[_0x425890(0x677,0x601,-0xbd,0x942)+'s'][_0x425890(0x18f,0xb6f,0x114f,0xe04)](_0x453395=>'-\x20'+_0x453395[_0x425890(0x45a,0xe82,0xa17,0xba5)]+'\x20:\x20'+_0x453395[_0x425890(0x22f,0xae3,0x804,0x11a0)])[_0x425890(0x453,0x4f5,-0x317,-0x173)]('\x0a')+(_0x425890(0x1aee,0x13b0,0x1cc2,0x1180)+'iption\x20:\x20')+_0x403e68[_0x425890(0x4e8,0x26b,-0x7a3,-0x77b)+'n']+(_0x17318e(0x1f0f,0x1d4c,0xe62,0x179c)+_0x17318e(-0x383,0xb,0xb1,0x52d))+_0x403e68[_0x17318e(0x163,-0x1d,0x621,0xa51)]+(_0x17318e(0x9ab,0xd34,0x1010,0xe84)+_0x17318e(0xa1e,0x776,0x703,0x6e7))+_0x403e68['keywords']+(_0x17318e(0xb5a,-0x99,0xb91,0x5b7)+'\x20:\x20')+_0x403e68[_0x425890(0x35d,0x361,0x247,-0x4ea)]['name']+(_0x17318e(0x1449,0xde0,0x131a,0x15c9)+_0x17318e(0xffe,0x1389,0x174e,0x1482))+_0x403e68[_0x425890(-0x4d0,0x2c1,0x90,0x48d)]+(_0x425890(0xc14,0xb93,0x98e,0xcc1)+_0x17318e(0xfb4,0x1bc,0x114,0xa1c))+_0x403e68[_0x425890(0x12e,0x12c,0x3ce,-0x781)]+(_0x17318e(0x12f1,0xa2a,0xbf8,0xab3)+_0x17318e(0x4b3,0xc83,-0x419,0x555))+botname),db[_0x17318e(0x115b,0xae4,0xea6,0xced)]['users'][_0x17aa6d[_0x425890(0x1110,0xa69,0x19e,0xa3b)]][_0x17318e(0x97,-0x3a,0x782,0x9fd)]-=-0x1752+0x1198*0x1+-0xa3*-0x9;}else{if(_0x295ea5[_0x17318e(0x204a,0x1fe7,0x1bd4,0x1777)]('fKEWS',_0x425890(0x12a2,0x13db,0x1c4e,0xf0c))){const _0x4e8d4a={'JYHEs':function(_0x12f864,_0x2fa371){return _0x295ea5['OuPez'](_0x12f864,_0x2fa371);},'SXVsZ':function(_0x3c74c1,_0xca7155){return _0x3c74c1(_0xca7155);}};if(_0x295ea5[_0x425890(0x679,0xbcb,0x1259,0xd92)](_0x2318c0,_0x2b7d58))return _0x295ea5[_0x17318e(0x7f0,0x1879,0xb04,0x114a)](_0xb2310f,_0x425890(0x3bc,0xbb0,0xdea,0x43e)+_0x425890(0x15bf,0x10a4,0x159f,0x13cd)+_0x425890(0xc54,0x4d1,0x684,0x99)+_0x17318e(0x19aa,0x139c,0x1df3,0x166e)+_0x425890(0x15dc,0x1518,0x1d3a,0x1bf5)+'n');if(!_0x3f5e2c[0x67*-0x7+-0xc8e*0x3+-0x2*-0x143e])return _0x52a442(_0x425890(0x1147,0xb08,0xd98,0x338)+_0x295ea5[_0x425890(0x192c,0x150b,0x1032,0x1079)](_0x34de6e,_0x27dd28)+(_0x425890(0x1fb8,0x15da,0x1c0f,0x19df)+_0x17318e(0xf42,0x1951,0x1031,0x1325)+_0x17318e(0x1a53,0x89c,0x1876,0x1167)));_0x3b8aa0(_0x39c6d5[_0x425890(0x619,0xa69,0xea9,0x1509)],_0x1e8123);let _0x4064a6=_0x295ea5[_0x425890(0xd3c,0x9ad,0xa7f,0x20c)](0x24b3+0x27*0x5b+-0x2cb4*0x1,_0x16c066);_0x295ea5[_0x425890(0xd83,0xa2a,0xd54,0x2b4)](_0x28332b,_0x27404f['sender'],_0x4064a6),_0x295ea5['vnxNC'](_0x38d55f,()=>{function _0x3c092f(_0x1f768f,_0x175586,_0xc2bb7f,_0x32171a){return _0x425890(_0x32171a,_0x175586- -0x165,_0xc2bb7f-0x150,_0x32171a-0x16c);}function _0x3a56e0(_0x10fc25,_0x40e5b2,_0x4a3dcb,_0x5e230e){return _0x425890(_0x5e230e,_0x10fc25-0x272,_0x4a3dcb-0x135,_0x5e230e-0xea);}_0x4e8d4a[_0x3c092f(0xab6,0x10dc,0x1845,0x7f5)](_0x5017c3,_0x3a56e0(0x178a,0x1001,0xfb4,0x1b78)+_0x3c092f(0xf62,0x9bf,0x638,0xef3)+'ul\x20✔️\x0a*Your'+'\x20Remaining'+_0x3c092f(0xacf,0xaee,0xe9d,0xcf8)+_0x346e2b(_0x5d0beb[_0x3a56e0(0xcdb,0x14ce,0x29d,0xdb0)])+('\x0a*Your\x20Rem'+_0x3a56e0(0x794,0x2a9,0x11af,0x11ac)+'h(es)*\x20:\x20')+_0x4e8d4a['SXVsZ'](_0x3b7bcb,_0x1968cb[_0x3c092f(0x132a,0x904,0x114c,-0x19a)]));},-0x2637+-0x3*0x454+0x3b03);}else _0x295ea5[_0x17318e(0xdde,0xaf9,0xe87,0x56d)](_0xcd1d32,_0x425890(0x1343,0xb08,0x2d8,0xcdd)+_0x295ea5['MGMEF'](_0x4fea53,_0x1cbc75)+(_0x425890(0x1094,0x1482,0x1b9b,0x14a6)+'List\x20Type\x20'+_0x17318e(0x116e,0x1442,0x873,0x121b)+_0x425890(0xf46,0xac3,0xb6a,0xbd4)+_0x425890(0x1b45,0x12a3,0xaab,0x97d)+_0x425890(0xbb7,0xc33,0x1061,0x258)+'s)\x0a3.\x20aov\x20'+_0x17318e(0xabe,0x354,0x149,0x6f2)+_0x17318e(0x13bc,0x1458,0x643,0xb05)+_0x17318e(0x1033,0xb36,0x1599,0x1054)+'Of\x20Duty)\x0a5'+_0x425890(0x1c66,0x12ee,0xd99,0x16aa)+_0x425890(0x753,0x30b,0x3f,0x3ec)+'.\x20ig\x20(Inst'+_0x425890(0x4fe,0xc5c,0x367,0x6c3)+_0x17318e(0xc7d,0xddb,0x1e09,0x13c3)+_0x425890(0xcc7,0xb7c,0x22f,0x269)+'om)'));}}}}}}}}break;case _0x295ea5[_0x425890(0x5a4,0xffc,0x1402,0x9dc)]:case _0x295ea5[_0x425890(0x91a,0x1374,0xdf0,0x11b4)]:case _0x295ea5[_0x17318e(0x184f,0xe53,0x1a37,0x157a)]:{if(!_0x116129)return _0x295ea5[_0x17318e(0x1130,0x1363,0x1637,0x12a0)](_0xcd1d32,_0x425890(0x9c5,0x593,0x9,0x720)+'y\x20Link!');_0xcd1d32(mess[_0x17318e(0x722,0x41d,0x51d,0x4e3)]);const _0x451307={};_0x451307['url']=_0x116129;let _0x3ebd80=await _0x295ea5[_0x425890(0x386,0x240,-0x382,0x202)](fetchJson,_0x295ea5[_0x17318e(0xf78,0x1305,0xf99,0x1570)](api,_0x295ea5['iGZhi'],_0x295ea5[_0x425890(-0x594,0x49f,0x8e0,-0x96)],_0x451307,_0x295ea5[_0x17318e(0x249,0x1345,0xdc6,0x902)]));const _0x59d62a={};_0x59d62a[_0x425890(0x18d1,0x10a0,0x860,0x12e9)+'t']='❮❮🥬With\x20Wa'+'termark🥬❯❯';const _0x4f33ab={};_0x4f33ab[_0x17318e(0x186e,0x18c7,0x1918,0x1194)]=_0x17318e(0x267,0xe80,0x118a,0xab2)+_0x116129,_0x4f33ab[_0x17318e(0xea7,0x1974,0x14ef,0x1318)]=_0x59d62a,_0x4f33ab[_0x425890(0x1e5c,0x141b,0x1131,0xaa5)]=0x1;const _0x441b93={};_0x441b93[_0x17318e(0x19c0,0x9d9,0x111d,0x12bd)+'t']=_0x295ea5[_0x425890(0x91e,0xdd0,0xd79,0x1097)];const _0x5e4e14={};_0x5e4e14[_0x17318e(0xe8b,0x1b4e,0xd26,0x1194)]='tiktokmp3\x20'+_0x116129,_0x5e4e14[_0x425890(0x96c,0x10fb,0x6fb,0xee0)]=_0x441b93,_0x5e4e14[_0x425890(0x19a4,0x141b,0x1dbc,0x1787)]=0x1;let _0x362b3b=[_0x4f33ab,_0x5e4e14];const _0x35d670={};_0x35d670[_0x17318e(0x102b,0x84a,0x630,0x810)]=_0x3ebd80['result'][_0x425890(0x1e8,0x63d,-0x1cd,-0x42b)+'k'];const _0x4fdf2e={};_0x4fdf2e[_0x17318e(0x1bcd,0xf5e,0x2071,0x16dc)]=_0x35d670,_0x4fdf2e[_0x17318e(0x71a,-0x2b,0xdd8,0x527)]=_0x17318e(0x8a4,0x81b,0x1091,0x1123)+_0x425890(0x1173,0x13ce,0x1722,0xc1b)+_0x116129,_0x4fdf2e[_0x425890(-0x5a8,0x37a,-0x31e,-0xc)]=_0x17318e(0xd85,0x1aa6,0x145e,0x12f7)+_0x17318e(0x917,0x387,-0x3f7,0x63f)+'ow',_0x4fdf2e[_0x17318e(0x191d,0x157a,0x8fa,0x117e)]=_0x362b3b,_0x4fdf2e[_0x17318e(0x1abd,0x12ea,0x15bd,0x120c)]=0x5;let _0x21f727=_0x4fdf2e;_0x3797bd[_0x425890(-0x75,0x41f,-0x507,0xf5)+'e'](_0x17aa6d[_0x17318e(0x179f,0x88b,0x4db,0xee4)],_0x21f727,{'quoted':_0x17aa6d});}break;case _0x295ea5[_0x17318e(0x1a45,0xd35,0xad1,0x131f)]:case _0x295ea5['wwIkU']:{if(_0x295ea5[_0x17318e(0xda0,0xa65,0xc12,0xe47)](_0x295ea5[_0x425890(0x90f,0x87e,0xff0,0x454)],'oRfUR')){if(!_0x116129)return _0x295ea5[_0x17318e(0x111a,0x1174,0xe53,0x17c5)](_0xcd1d32,'Enter\x20Quer'+_0x425890(0xce3,0x9ff,0xb2,0x8a6));_0xcd1d32(mess['wait']);const _0x48bbf4={};_0x48bbf4[_0x17318e(0x10d4,0xa04,0x60c,0x810)]=_0x116129;let _0x2cba20=await _0x295ea5['nticV'](fetchJson,_0x295ea5[_0x17318e(-0x384,-0x61,0x381,0x546)](api,_0x295ea5['iGZhi'],_0x295ea5[_0x17318e(0xc9d,0x56b,0xe38,0x6bc)],_0x48bbf4,_0x295ea5[_0x425890(-0x2ab,0x6e5,0x215,0xf18)]));const _0x40eb2c={};_0x40eb2c[_0x425890(0x798,0x10a0,0x1749,0xced)+'t']=_0x295ea5[_0x425890(0x16e1,0x13f3,0x10e8,0x1572)];const _0x1c2484={};_0x1c2484[_0x17318e(0x12b9,0x163d,0x125f,0x1194)]=_0x425890(0x1554,0x1218,0x193d,0x17b8)+'\x20'+_0x116129,_0x1c2484[_0x425890(0xc92,0x10fb,0x17fe,0x1595)]=_0x40eb2c,_0x1c2484[_0x425890(0x15f2,0x141b,0xc0d,0xa99)]=0x1;const _0x3b773a={};_0x3b773a[_0x17318e(0xede,0x1193,0xbf4,0x12bd)+'t']=_0x295ea5[_0x425890(0x1317,0x15f2,0x1fd4,0x203f)];const _0x386e52={};_0x386e52[_0x425890(0x1746,0xf77,0xd0c,0x8da)]=_0x17318e(0xdff,0x17ea,0xc17,0x126b)+_0x116129,_0x386e52['buttonText']=_0x3b773a,_0x386e52['type']=0x1;let _0x53d355=[_0x1c2484,_0x386e52];const _0x59d981={};_0x59d981[_0x17318e(0xa4,0xdd9,0xf41,0x810)]=_0x2cba20['result']['watermark'];const _0x75db={};_0x75db['video']=_0x59d981,_0x75db[_0x17318e(0x94c,-0x9a,-0x15a,0x527)]=_0x425890(0xa6d,0xf06,0xc22,0xa63)+_0x425890(0x126f,0x13ce,0x1c2c,0x168b)+_0x116129,_0x75db['footer']=_0x295ea5[_0x17318e(0x12a6,0x1d6d,0x1294,0x16e9)],_0x75db[_0x17318e(0x970,0xe3e,0x106f,0x117e)]=_0x53d355,_0x75db[_0x425890(0xef8,0xfef,0xb19,0x14ec)]=0x5;let _0x266a45=_0x75db;_0x3797bd[_0x425890(-0x39d,0x41f,0x901,0x9cd)+'e'](_0x17aa6d[_0x17318e(0x4fc,0xe4b,0x6bd,0xee4)],_0x266a45,{'quoted':_0x17aa6d});}else return _0x54945f[_0x295ea5[_0x17318e(0x8f6,0x6f6,0xe4f,0xa9a)]+_0xbf8e35[_0x425890(0x967,0xcc7,0x1175,0xc69)]][_0x425890(0x6ee,0xa50,0x71c,0x903)]=_0x3f950a;}break;case _0x295ea5[_0x425890(0x6b6,0xeca,0x15de,0x7ac)]:case _0x295ea5[_0x17318e(0x17ba,0xca2,0x12cf,0x15ea)]:{if(!_0x116129)return _0x295ea5[_0x17318e(0x9cd,0xc30,0xb78,0xc21)](_0xcd1d32,_0x425890(0xe44,0x593,0x6e5,0xb34)+_0x425890(0x4c4,0x9ff,0x1173,0x2ff));_0x295ea5['VumpY'](_0xcd1d32,mess[_0x425890(0xc12,0x2c6,-0x4b3,0x826)]);const _0x9afcf={};_0x9afcf[_0x17318e(0x640,0x33c,-0x250,0x810)]=_0x116129;let _0x13f957=await _0x295ea5[_0x17318e(0x8c2,0xa77,0x1bcc,0x1338)](fetchJson,api(_0x295ea5[_0x17318e(0x1076,0xd38,0xf2a,0x8c7)],_0x295ea5[_0x425890(0x1413,0x1171,0x1a1e,0x15cc)],_0x9afcf,_0x295ea5[_0x425890(0x62c,0x6e5,0x19f,0x1fa)]));const _0x513203={};_0x513203[_0x17318e(0x9b5,0x11b0,0x8d3,0x12bd)+'t']=_0x295ea5[_0x425890(0xc86,0x13f3,0x119f,0x1b63)];const _0xc8993d={};_0xc8993d[_0x17318e(0x164d,0x1946,0xdc3,0x1194)]=_0x17318e(0xecc,0x1053,0x1474,0x1435)+'\x20'+_0x116129,_0xc8993d[_0x425890(0xed1,0x10fb,0x85f,0xe59)]=_0x513203,_0xc8993d[_0x17318e(0x1268,0x1ae3,0xe0d,0x1638)]=0x1;const _0x18d050={};_0x18d050['displayTex'+'t']=_0x295ea5[_0x425890(-0x3b3,0x4ba,0x7b4,0xafb)];const _0x1e91ea={};_0x1e91ea[_0x17318e(0xd7a,0xa7e,0xf51,0x1194)]=_0x425890(0x4fc,0x895,-0x2c,0x950)+_0x116129,_0x1e91ea[_0x425890(0xc7f,0x10fb,0xb17,0x1066)]=_0x18d050,_0x1e91ea['type']=0x1;let _0x38b344=[_0xc8993d,_0x1e91ea];const _0x52ebef={};_0x52ebef['text']=_0x425890(0xf3d,0xf06,0x10ac,0x1424)+_0x425890(0x1af1,0x13ce,0x97a,0xae1)+_0x116129,_0x52ebef[_0x425890(-0x3cc,0x37a,-0x236,0x688)]=_0x295ea5[_0x425890(0x1c2e,0x14cc,0x1ecf,0x1b91)],_0x52ebef[_0x425890(0xfa7,0xf61,0x106c,0x1297)]=_0x38b344,_0x52ebef['headerType']=0x2;let _0x11c872=_0x52ebef,_0x4fb464=await _0x3797bd[_0x425890(0xead,0x41f,0x427,-0x57b)+'e'](_0x17aa6d[_0x17318e(0x97b,0xa15,0xec6,0xee4)],_0x11c872,{'quoted':_0x17aa6d});const _0x4bdcd3={};_0x4bdcd3[_0x17318e(-0x1dc,0x1020,0xc27,0x810)]=_0x13f957[_0x425890(0x65f,0x23d,0xb69,0x54c)][_0x17318e(0xc2e,0x1587,0xedf,0x1092)];const _0x5d0d60={};_0x5d0d60[_0x17318e(0x1642,0x7e3,0x13e6,0x1092)]=_0x4bdcd3,_0x5d0d60[_0x425890(0x9f7,0xdfe,0x1033,0xe95)]=_0x295ea5[_0x425890(-0x20b,0x7f5,-0x175,0x119c)];const _0x2920de={};_0x2920de[_0x17318e(0x1a0,0x86a,0x16a,0xa24)]=_0x4fb464,_0x3797bd['sendMessag'+'e'](_0x17aa6d[_0x17318e(0x1626,0x5a2,0x1404,0xee4)],_0x5d0d60,_0x2920de);}break;case _0x425890(-0x476,0x37b,0x8a0,0x771):case _0x17318e(-0x13e,0xb00,0x6e9,0x3d4):case _0x425890(0x380,0x444,0x343,0x52d):{if(!_0x116129)return _0x295ea5[_0x17318e(0x1617,0x915,0x1306,0xe9c)](_0xcd1d32,_0x425890(0x11a7,0x13b5,0xb0f,0xf89)+_0x425890(0x470,0x877,0x100,0xa70));_0xcd1d32(mess[_0x425890(0x5af,0x2c6,-0x16a,-0x644)]);if(/(?:\/p\/|\/reel\/|\/tv\/)([^\s&]+)/['test'](_0x295ea5['zQgaX'](isUrl,_0x116129)[0x2526*0x1+-0x1839+-0xced])){let _0x579feb=await _0x295ea5[_0x425890(0x826,0xc45,0x778,0x162e)](fetchJson,api(_0x295ea5[_0x17318e(-0xbe,0x7cd,0x8c,0x8c7)],_0x295ea5[_0x17318e(0x856,0x155a,0x1306,0x1062)],{'url':_0x295ea5[_0x425890(0x1001,0x87a,0xe5e,0x2e8)](isUrl,_0x116129)[0x1*-0x5d9+0x1*0x115c+-0xb83]},_0x295ea5['xsylT']));for(let _0x1b5564 of _0x579feb[_0x17318e(0x9a6,0x989,0x8a9,0xced)])_0x3797bd[_0x17318e(0xf6a,0x8ae,0xeee,0x99f)](_0x17aa6d[_0x17318e(0x122a,0x557,0x14ad,0xee4)],_0x1b5564,'',_0x425890(-0x566,0x278,-0x767,0x7f7)+_0x425890(-0x646,0x2f9,0xbbb,-0x74e)+_0x425890(0xb3a,0xf93,0x10b8,0xc85)+_0x295ea5[_0x17318e(0x10c1,0x1f8e,0x2160,0x17b6)](isUrl,_0x116129)[0x801+-0x105*-0x12+-0x1a5b],_0x17aa6d);}else{if(/\/stories\/([^\s&]+)/[_0x425890(0x1040,0xd86,0xf6e,0x12fe)](isUrl(_0x116129)[-0x2106*-0x1+-0x1*-0x423+-0x2529])){let _0x5a7ee8=await _0x295ea5[_0x17318e(0xdec,0x937,0xc28,0x575)](fetchJson,api(_0x295ea5['iGZhi'],_0x295ea5[_0x425890(0x6ad,0xade,0x1ee,0x748)],{'url':_0x295ea5['NmJZe'](isUrl,_0x116129)[0x48d+-0xe6*-0x20+-0x214d]},_0x295ea5['xsylT']));_0x3797bd[_0x17318e(0x137d,0x111b,0xfcb,0x99f)](_0x17aa6d[_0x17318e(0x1573,0xd55,0x12fc,0xee4)],_0x5a7ee8[_0x425890(0x249,0x1d1,0xa5,-0xd0)][0x1434+-0x1*0x1795+0x361][_0x17318e(0x893,0x124e,0xcd8,0x810)],'',_0x17318e(0x62c,-0x1d6,0x6de,0x495)+_0x425890(-0x493,0x2f9,-0x437,-0x14d)+_0x17318e(0x949,0x11d0,0x717,0x11b0)+_0x295ea5[_0x17318e(0x16cc,0xa68,0x1037,0xe37)](isUrl,_0x116129)[-0x115*0x3+0x9d3*-0x3+0x20b8],_0x17aa6d);}}}break;case _0x295ea5[_0x17318e(0x165,0xd53,0x380,0x640)]:case _0x295ea5[_0x17318e(0x12c5,0xb37,0x58c,0x892)]:case _0x295ea5[_0x17318e(0x1d61,0x1d9c,0x11da,0x1538)]:case _0x425890(0x1296,0x86d,0x484,0xca2):{if(!_0x116129)return _0x295ea5['UqwIh'](_0xcd1d32,_0x17318e(0xbec,0x766,0xf1a,0x7b0)+_0x425890(0x5ad,0x9ff,0x473,0xa18));_0xcd1d32(mess[_0x17318e(0xb2c,-0x2de,-0x34a,0x4e3)]);const _0x465612={};_0x465612[_0x425890(0xc4c,0x5f3,0xe7f,0x99b)]=_0x116129;let _0x28e8fb=await _0x295ea5['qMicV'](fetchJson,_0x295ea5[_0x425890(0xa5d,0x1353,0x91a,0x15af)](api,_0x17318e(0x1e2,0xd8,0xbb2,0x8b2),_0x17318e(0xc82,0x1a41,0x1144,0x14cb)+_0x17318e(0x222b,0x1dab,0x206d,0x1846)+'m2',_0x465612,_0x295ea5[_0x17318e(-0x140,0x62c,0x1027,0x902)]));const _0x59f9aa={};_0x59f9aa[_0x425890(0x140,0x5f3,0x68b,0x352)]=_0x28e8fb['data'][0x1*0x171e+0x10ab*0x1+-0x27c9];const _0x3bef8f={};_0x3bef8f['video']=_0x59f9aa,_0x3797bd[_0x17318e(0x760,0xeec,0x424,0x63c)+'e'](_0x17aa6d[_0x425890(0x73b,0xcc7,0x669,0x939)],_0x3bef8f,{'quoted':_0x17aa6d});}break;case _0x295ea5[_0x17318e(0xae,0x1c,0x6e2,0x4c9)]:case'jooxdl':{if(_0x295ea5[_0x425890(0xfc8,0xa61,0xe17,0x12b3)](_0x17318e(0x2127,0x1752,0x1dcb,0x17a5),_0x425890(0x1048,0x1588,0x189b,0xc89)))_0x145082[_0x425890(0xa7d,0x3c2,-0x5bc,-0x58c)](_0x1a0a64);else{if(!_0x116129)return _0x295ea5[_0x425890(0x742,0x5f6,0xad3,0x2fb)](_0xcd1d32,_0x425890(0x390,0x836,0xde8,0xa60)+_0x425890(0x5e8,0xd60,0x983,0x9b5));_0x295ea5[_0x17318e(0x10f9,0x1313,0xb9b,0x1517)](_0xcd1d32,mess[_0x17318e(0xe9,0xeda,0xe60,0x4e3)]);const _0x792fe3={};_0x792fe3[_0x425890(0x5be,0x9f9,0xc51,0xb00)]=_0x116129;let _0x113ab7=await fetchJson(_0x295ea5[_0x425890(-0x5d0,0x329,0x312,0x2c2)](api,_0x17318e(0x3c7,0x10b1,0xc69,0x8b2),_0x295ea5[_0x17318e(0x892,-0x318,0x692,0x3ae)],_0x792fe3,_0x295ea5[_0x17318e(0x521,0x3d,0x40e,0x902)])),_0x12712d=await _0x3797bd[_0x425890(0xc1a,0xb44,0x462,0x99b)](_0x17aa6d[_0x425890(0x1221,0xcc7,0x977,0x139c)],_0x113ab7[_0x425890(0x7e1,0x23d,0x44a,0x7f2)][_0x425890(0xf35,0xbd0,0x58e,0x61f)],_0x17318e(0x170b,0x1392,0x1850,0x11e9)+'\x20'+_0x113ab7[_0x425890(-0x44f,0x23d,0x35d,-0x72b)][_0x17318e(0x840,0x1378,0x553,0xd69)]+(_0x17318e(0xef6,0x1ab7,0xd59,0x1613)+':\x20')+_0x113ab7[_0x425890(0x5ab,0x23d,0x39e,0xe6)][_0x425890(0x602,0xc14,0x52d,0x816)]+('\x0a🔰🌹\x20Singer'+_0x17318e(0x11ec,0xc58,0xf4b,0xa1c))+_0x113ab7[_0x17318e(0x1ac,0x7c1,-0x1d8,0x45a)][_0x17318e(0x3df,0x1051,0xa2c,0xcb5)]+(_0x17318e(0x7e0,0x11ea,0x2f4,0xa5c)+_0x17318e(0x1229,0x64d,0xfc5,0x9b1))+_0x113ab7[_0x425890(0x438,0x23d,0x9c9,0x231)]['publish']+(_0x17318e(0xfdd,0x4f8,0xb7d,0x7aa)+_0x17318e(0x108e,0xbc3,0x1222,0x11fe))+_0x113ab7[_0x425890(-0x72,0x23d,-0x27e,0x18)][_0x17318e(0x4c3,0x7c6,0x1710,0xf1a)][_0x17318e(0x22d,0x2a4,0x38f,0x45a)],_0x17aa6d);const _0x14a753={};_0x14a753['url']=_0x113ab7[_0x17318e(0x3f0,0x32b,-0x3f5,0x45a)]['mp4aLink'];const _0x48067b={};_0x48067b[_0x425890(0xfad,0x807,0x12a0,0xe9c)]=_0x12712d,_0x3797bd['sendMessag'+'e'](_0x17aa6d['chat'],{'audio':_0x14a753,'mimetype':_0x295ea5[_0x425890(0x3d,0x7f5,-0xfb,0x77b)],'fileName':_0x295ea5['Mydgg'](_0x113ab7[_0x425890(-0x7eb,0x23d,0xbca,0x822)][_0x425890(0xe92,0xb4c,0xf1,0x143d)],_0x295ea5[_0x17318e(0x899,0xc45,0x931,0x9b5)])},_0x48067b);}}break;case _0x295ea5[_0x17318e(0xdf2,0x1d12,0x1220,0x1790)]:case _0x425890(-0x317,0x6dc,0x765,0xa23):{if(_0x295ea5[_0x17318e(0x10d5,0xa77,0x1a60,0x1287)](_0x295ea5[_0x17318e(0x161e,0x9ec,0x165e,0x135b)],_0x295ea5[_0x425890(0x6ee,0x113e,0x1812,0x1279)])){if(!_0x116129)return _0x295ea5[_0x17318e(0xb11,0xae5,0x18d8,0x107a)](_0xcd1d32,_0x425890(0x1254,0x836,-0x1e3,0x10af)+_0x17318e(0xa46,0x54b,0x1393,0xf7d));_0x295ea5[_0x17318e(0xa8b,0x23d,0xbb5,0x37a)](_0xcd1d32,mess[_0x17318e(0x263,-0x13a,0x97,0x4e3)]);let _0x3cd27b=await _0x295ea5[_0x425890(0x12ad,0xd31,0xb83,0x51e)](fetchJson,api(_0x295ea5[_0x17318e(0xdd2,0x19f,0x2cf,0x8c7)],_0x295ea5[_0x17318e(0x1547,0x18c0,0x12cf,0xeb3)],{'url':isUrl(_0x116129)[0xc68+-0x326*-0x4+-0x1900]},_0x295ea5['xsylT'])),_0x89af1f=await _0x3797bd[_0x17318e(0xb2c,0x1073,0xf99,0xd61)](_0x17aa6d['chat'],_0x3cd27b[_0x425890(-0x4cc,0x23d,0xaa,-0x6c3)][_0x17318e(0x639,0x830,0x10e4,0x706)],_0x425890(0x14cc,0xfcc,0x16f4,0x1253)+'\x20'+_0x3cd27b[_0x425890(0x27b,0x23d,0x51,0x62b)][_0x425890(0x1222,0xff0,0xb83,0x1041)]+_0x425890(0xedd,0x122d,0x106d,0x1501)+isUrl(_0x116129)[0x3f4+-0x1e0a+-0x9*-0x2e6]);const _0x22a37e={};_0x22a37e[_0x17318e(0x41b,0x47,0x1029,0x810)]=_0x3cd27b[_0x17318e(-0x3c0,0x30f,0xa21,0x45a)][_0x425890(0x6c4,0x5f3,0x215,-0x17d)];const _0x43a637={};_0x43a637[_0x17318e(0x4d,0x8fc,0x973,0xa24)]=_0x89af1f,_0x3797bd[_0x425890(0x6ec,0x41f,0x42f,-0x96)+'e'](_0x17aa6d[_0x17318e(0xffb,0x12d4,0x13c0,0xee4)],{'audio':_0x22a37e,'mimetype':_0x295ea5[_0x425890(0x11ca,0x7f5,-0x205,0x11ff)],'fileName':_0x295ea5['iLoko'](_0x3cd27b['result'][_0x425890(0x631,0xff0,0x14a6,0x163a)],_0x295ea5[_0x17318e(0xad6,0x252,0xa9d,0x9b5)])},_0x43a637);}else{if(_0x295ea5[_0x17318e(0x2ab,0x789,-0x304,0x467)](_0x3a4762[_0x425890(0xcc5,0x8db,0x10be,0x9de)],'false'))return;if(_0x295ea5[_0x425890(0x1651,0xc34,0x4c8,0x10d1)](_0x1234f5[_0x425890(0xa36,0x8db,-0x17e,0x7c0)],_0x295ea5['UgBoL'])){const _0x958d1d={};_0x958d1d[_0x17318e(0xbf8,0x9d9,-0x141,0x405)]=_0x17318e(0x1bde,0xfc7,0xc14,0x13b9)+_0x17318e(0x19c6,0x148e,0x186e,0xfe9)+'💔💔*';const _0x331c28={};_0x331c28['quoted']=_0x5ef2f0,_0x4088ed[_0x17318e(-0x19b,0xbe,0x3f9,0x63c)+'e'](_0x4920b4,_0x958d1d,_0x331c28);}}}break;case _0x295ea5[_0x425890(-0x4d9,0x3c1,0xc93,0xb37)]:case _0x295ea5[_0x425890(0x791,0x136,0x967,-0x192)]:{if(_0x425890(0xa56,0xb60,0x301,0x130a)==='IJegN'){if(!_0x116129)return _0x295ea5[_0x425890(0x844,0xe38,0x7c2,0x10a9)](_0xcd1d32,_0x17318e(0x535,-0x134,0x175,0x7b0)+_0x17318e(0x1655,0x282,0x10b2,0xc1c));_0xcd1d32(mess[_0x17318e(-0x154,0x983,0xf13,0x4e3)]);const _0x1706e5={};_0x1706e5[_0x425890(0x3a0,0x5f3,0x1ae,0x334)]=_0x116129;let _0xd1c4c9=await _0x295ea5[_0x17318e(0x1328,0x5bb,0x758,0xd6d)](fetchJson,_0x295ea5[_0x425890(0x1bd5,0x1353,0x16bf,0x1007)](api,_0x295ea5['iGZhi'],_0x295ea5['gsgxA'],_0x1706e5,_0x295ea5[_0x425890(0x86c,0x6e5,0x203,-0xe1)]));const _0xbbcd79={};_0xbbcd79['displayTex'+'t']=_0x295ea5['qQZWj'];const _0x31afa2={};_0x31afa2[_0x425890(0x152d,0xf77,0xa86,0x1942)]='twittermp3'+'\x20'+_0x116129,_0x31afa2['buttonText']=_0xbbcd79,_0x31afa2[_0x17318e(0x11de,0xc3f,0x1fb5,0x1638)]=0x1;let _0x8d7796=[_0x31afa2];const _0x347d11={};_0x347d11[_0x17318e(0x181,-0x154,0xaaa,0x810)]=_0xd1c4c9[_0x425890(0x9b5,0x23d,-0xf9,0x3c1)]['HD']||_0xd1c4c9[_0x425890(0xc08,0x23d,-0x31a,0x50a)]['SD'];let _0xcf2e5={'video':_0x347d11,'caption':util['format'](_0xd1c4c9[_0x425890(-0x284,0x23d,-0x342,-0x307)]),'footer':_0x295ea5[_0x17318e(0x1aca,0x20a7,0x1ad5,0x16e9)],'buttons':_0x8d7796,'headerType':0x5};_0x3797bd['sendMessag'+'e'](_0x17aa6d[_0x17318e(0xf80,0x13a3,0x1436,0xee4)],_0xcf2e5,{'quoted':_0x17aa6d});}else _0x295ea5[_0x425890(0x23b,0x533,-0x2e1,0xb7a)](_0x1d705f,_0x3c3d6e[_0x425890(0xb3e,0xa69,0xcf6,0x14c9)]);}break;case _0x17318e(0xdb7,-0x25c,0x88e,0x3af)+'x':case _0x295ea5[_0x17318e(0x103c,0x822,0xd50,0x845)]:{if(_0x295ea5[_0x425890(0x1799,0x15c5,0x1d50,0x15c3)]===_0x295ea5['ZGnYF']){if(!_0x116129)return _0xcd1d32(_0x425890(0x68b,0x593,0xbaa,0x72)+_0x17318e(0xb4a,0x891,0x10d9,0xc1c));_0xcd1d32(mess['wait']);const _0x328090={};_0x328090[_0x425890(0x741,0x5f3,-0x2d6,0xe1d)]=_0x116129;let _0x47a189=await _0x295ea5[_0x425890(0x1ea4,0x15df,0xb75,0xd99)](fetchJson,_0x295ea5[_0x17318e(0x199c,0x179f,0xfd9,0x17f8)](api,_0x295ea5[_0x425890(0x313,0x6aa,0x6b7,0x67b)],_0x425890(0x5b1,0xaec,0x1218,0x1323)+'oader/twit'+_0x17318e(0x821,0xa8e,0x996,0x899),_0x328090,_0x295ea5['xsylT']));const _0x4c1a94={};_0x4c1a94[_0x425890(0x14c4,0x10a0,0x9dc,0x1420)+'t']=_0x295ea5[_0x17318e(0xf61,0x1886,0x10c6,0x12b0)];const _0x561cd0={};_0x561cd0['buttonId']='twitter\x20'+_0x116129,_0x561cd0[_0x425890(0x1a6c,0x10fb,0x9c8,0x1046)]=_0x4c1a94,_0x561cd0[_0x425890(0x98a,0x141b,0xcce,0xc5d)]=0x1;let _0x31fedc=[_0x561cd0];const _0x2d96ec={};_0x2d96ec['url']=_0x47a189[_0x17318e(0xe91,0x968,0x6e4,0x45a)]['thumb'];let _0x306b1e={'image':_0x2d96ec,'caption':util[_0x425890(0x1048,0x12eb,0x8d1,0x1034)](_0x47a189[_0x17318e(-0x4ea,-0x4b7,0x234,0x45a)]),'footer':'Press\x20The\x20'+_0x425890(0x5a9,0x422,0xbe9,-0x420)+'ow','buttons':_0x31fedc,'headerType':0x4},_0x3be8c1=await _0x3797bd[_0x425890(0x557,0x41f,0x47b,0xd87)+'e'](_0x17aa6d[_0x17318e(0x7e0,0x157f,0x1444,0xee4)],_0x306b1e,{'quoted':_0x17aa6d});const _0x497819={};_0x497819[_0x425890(0x6bb,0x5f3,0xdd1,0x3db)]=_0x47a189[_0x425890(0x258,0x23d,-0x1c8,-0x40d)][_0x425890(0x8f7,0xe75,0x5b5,0x166f)];const _0x346147={};_0x346147[_0x425890(0xe61,0xe75,0x57d,0xa5d)]=_0x497819;const _0x1285e6={};_0x1285e6[_0x17318e(0x44c,0x2c7,0xeff,0xa24)]=_0x3be8c1,_0x3797bd['sendMessag'+'e'](_0x17aa6d[_0x425890(0x2d6,0xcc7,0x10dc,0x84a)],_0x346147,_0x1285e6);}else _0x325a1f=_0x295ea5[_0x17318e(0x1844,0x17a9,0xaeb,0xfe3)],_0x597e5d(_0x295ea5[_0x17318e(0xb02,0x604,0xb71,0xc8c)]+_0x3b345b);}break;case _0x295ea5[_0x425890(0x334,0x7e9,0x270,-0x1fc)]:case _0x17318e(0xca2,0x153d,0x7d1,0xf24):case _0x295ea5['Efqwm']:{if(!_0x116129)return _0x295ea5[_0x17318e(0xe0e,0x1fc6,0x165b,0x175f)](_0xcd1d32,'Enter\x20Quer'+_0x17318e(0x148a,0x658,0x17d,0xc1c));_0x295ea5[_0x425890(0x4f8,0x1bc,0xa3d,-0x5b)](_0xcd1d32,mess[_0x425890(0x150,0x2c6,0x75b,0x464)]);const _0x1a3af4={};_0x1a3af4[_0x425890(-0x1ee,0x5f3,0x1022,-0x33)]=_0x116129;let _0x54db1f=await _0x295ea5['uNXJI'](fetchJson,_0x295ea5[_0x425890(0xffe,0x1353,0x1c58,0x1d9e)](api,_0x295ea5[_0x425890(0x453,0x6aa,0x23,0x98c)],_0x295ea5['XhKhT'],_0x1a3af4,_0x295ea5['xsylT']));const _0x2b50b8={};_0x2b50b8[_0x17318e(0x1015,0x2ac,0xbef,0x810)]=_0x54db1f['result'][_0x425890(0x277,0x5f3,-0x1e,0xc68)];const _0x1f69c5={};_0x1f69c5['video']=_0x2b50b8,_0x1f69c5[_0x17318e(0x55d,0xf71,-0x481,0x527)]=_0x17318e(0x1796,0xc75,0x16e2,0x11e9)+'\x20'+_0x54db1f[_0x425890(-0x5a0,0x23d,-0x3,0x249)]['title'],_0x3797bd['sendMessag'+'e'](_0x17aa6d[_0x17318e(0x8bc,0x12cb,0xc5b,0xee4)],_0x1f69c5,{'quoted':_0x17aa6d});}break;case _0x17318e(0xf18,0x12be,0x1140,0x1397):case _0x295ea5['ugrCE']:{if(!_0x116129)return _0x295ea5[_0x425890(0x15f0,0xdfa,0x40f,0x5d2)](_0xcd1d32,_0x17318e(0x1077,0x625,0xc9b,0x7b0)+'y\x20Link!');_0x295ea5[_0x425890(0xad4,0x813,0xe64,0x1e3)](_0xcd1d32,mess['wait']);const _0x5ad039={};_0x5ad039[_0x425890(0xe65,0x5f3,0x35e,0x390)]=_0x116129;let _0x33f754=await _0x295ea5[_0x17318e(0xc7e,0xa7a,0xd94,0x14ad)](fetchJson,_0x295ea5['FWLJu'](api,_0x295ea5[_0x17318e(0x5b0,0xce5,0x2aa,0x8c7)],_0x295ea5['DIJBj'],_0x5ad039,_0x295ea5[_0x17318e(0x10d7,0x127f,0x424,0x902)]));const _0x5755d1={};_0x5755d1[_0x17318e(0x11d,0xeac,0x1111,0x810)]=_0x33f754[_0x17318e(0x88b,-0x2f3,-0x586,0x45a)];const _0x14210a={};_0x14210a[_0x17318e(0x183b,0x1e4c,0x1cee,0x16dc)]=_0x5755d1,_0x14210a[_0x425890(0x248,0x30a,0x27f,-0x72c)]=_0x17318e(0x8ab,0xf27,0x1278,0x1123)+'rom\x20'+_0x116129,_0x3797bd[_0x17318e(-0x3b0,0x7f3,0xb76,0x63c)+'e'](_0x17aa6d[_0x17318e(0x103f,0x645,0x151f,0xee4)],_0x14210a,{'quoted':_0x17aa6d});}break;case _0x295ea5['CwIrp']:case _0x295ea5[_0x425890(0x166a,0x153a,0xd82,0xee3)]:{if(_0x295ea5[_0x425890(0xef4,0xcfa,0x84e,0x42d)](_0x295ea5[_0x425890(0x454,0x269,0x623,0xb4b)],_0x295ea5[_0x17318e(0x2ac,0x413,-0x3a9,0x486)]))_0x295ea5[_0x17318e(0x11e8,0x1562,0xd67,0xae1)](_0x506d9e,_0x295ea5[_0x17318e(-0x2b,0xd55,0x77,0x662)]);else{if(!_0x116129)return _0x295ea5[_0x425890(0x1020,0x7a6,0x155,0x9b2)](_0xcd1d32,_0x425890(0x154,0xb08,0x4d1,0x262)+_0x295ea5[_0x425890(0xdf8,0xb45,0x910,0x64a)](_0x4fea53,_0x1cbc75)+(_0x425890(0x1370,0xc76,0x1073,0x1690)+_0x17318e(0xf61,0x3f1,0x4da,0x88c)+_0x425890(0x7a5,0xf4f,0xe2f,0xe4e)+_0x425890(0x13f7,0xe12,0x109f,0x17a4)+'arafat-sum'+_0x425890(0xbaa,0x1533,0x12c9,0x11e9)+_0x17318e(0x9a,-0x22d,-0x16c,0x485)+_0x17318e(0x192a,0x14e5,0x1ceb,0x12fa)));let {umma:_0x1e88b2}=_0x295ea5[_0x17318e(0x740,0xea1,0x9aa,0x5ed)](require,'./lib)\x20scr'+'aper'),_0x48b645=await _0x1e88b2(_0x295ea5[_0x425890(0x4f8,0x190,0xbc6,0x5c0)](isUrl,_0x116129)[-0x1cd0+0x1867+0x469]);if(_0x295ea5['jYJfm'](_0x48b645[_0x425890(0x1187,0x141b,0x14f2,0xdb0)],_0x17318e(0x1e62,0x10bc,0x14d7,0x16dc))){const _0x5c6158={};_0x5c6158[_0x425890(0x19b4,0x10a0,0x10ea,0xda1)+'t']=_0x295ea5[_0x17318e(0x18cc,0x1e88,0x2172,0x180f)];const _0x300e1d={};_0x300e1d[_0x17318e(0xb09,0xfa4,0x1ac9,0x1194)]=_0x17318e(0x149b,0x109b,0x85e,0xa40)+_0x48b645[_0x425890(0x599,0x1d1,0xb8,-0x3cb)][-0x14c2*-0x1+0xb8b+-0x204d]+_0x17318e(0x162f,0x18b8,0x1b37,0x1652),_0x300e1d[_0x425890(0x191a,0x10fb,0x1609,0x129f)]=_0x5c6158,_0x300e1d[_0x425890(0x197b,0x141b,0x1966,0xa8e)]=0x1;const _0x29cc88={};_0x29cc88[_0x425890(0x165f,0x10a0,0x10dd,0xb30)+'t']=_0x295ea5[_0x425890(0x1919,0x1093,0x81c,0x973)];const _0x4ee88c={};_0x4ee88c[_0x425890(0x5aa,0xf77,0x160f,0x14e0)]='ytmp4\x20'+_0x48b645[_0x17318e(0x78b,-0x628,-0x477,0x3ee)][0x2485*0x1+0xa0d*-0x2+-0x106b*0x1]+_0x425890(0x1d7,0x559,0xeea,0x838),_0x4ee88c[_0x17318e(0xe9a,0x1543,0x155d,0x1318)]=_0x29cc88,_0x4ee88c[_0x425890(0x1152,0x141b,0xfde,0xefc)]=0x1;let _0x361c55=[_0x300e1d,_0x4ee88c];const _0x12a358={};_0x12a358[_0x17318e(0xd0b,-0xd1,0xe80,0x810)]=_0x48b645[_0x17318e(0x1c2,-0x18f,0x9aa,0x57e)][_0x425890(0x1a6b,0x153c,0xf02,0x1378)];const _0x72442={};_0x72442[_0x425890(0x774,0x381,-0xe1,0x9ef)]=_0x12a358,_0x72442['caption']='\x0a🔰🌹\x20Title\x20'+':\x20'+_0x48b645['title']+(_0x425890(0x587,0x39a,0x178,-0x6f1)+_0x17318e(0x742,0xfab,0x29e,0xa1c))+_0x48b645[_0x17318e(0xf15,0xe39,0xf32,0x57e)][_0x425890(0xf46,0xe82,0x12ae,0x14f0)]+(_0x17318e(0x1342,0x103f,0x13d1,0xf75)+'\x20')+_0x48b645[_0x17318e(0x58a,0x43a,0xa01,0x7fb)]+('\x0a🔰🌹\x20Captio'+_0x17318e(0x1283,0x6ff,0xc88,0xaaf))+_0x48b645[_0x425890(0x6d9,0x30a,0x1e6,0x268)]+_0x425890(0xe2e,0x122d,0x16d6,0x1012)+_0x48b645[_0x17318e(0x4a8,0x8e9,-0x4be,0x3ee)][0x15a4+-0x169*-0x16+0x282*-0x15]+(_0x17318e(0x1792,0xfe4,0x1752,0x132b)+'ad\x20Media,\x20'+'Please\x20Cli'+_0x17318e(0x163b,0xf1f,0x144a,0x1400)+'The\x20Button'+'s\x20Below\x20Or'+'\x20Enter\x20The'+_0x17318e(0x126a,0xff9,0xa67,0x10e0)+_0x17318e(0x130b,0xa35,0x15ec,0x1498)+_0x425890(0x16e,0x5b6,-0x23d,0xd99)+'Url\x20Above\x0a'),_0x72442[_0x425890(0x25a,0x37a,-0x350,-0x1b5)]=_0x3797bd['user']['name'],_0x72442[_0x17318e(0x11c1,0x193f,0x951,0x117e)]=_0x361c55,_0x72442[_0x425890(0x1a87,0xfef,0xa31,0xfa8)]=0x4;let _0x419e8d=_0x72442;_0x3797bd[_0x17318e(0x441,0x115,0x3d4,0x63c)+'e'](_0x17aa6d['chat'],_0x419e8d,{'quoted':_0x17aa6d});}else{if(_0x295ea5['ROCfm'](_0x48b645[_0x17318e(0x1c46,0x140e,0x1b72,0x1638)],'image')){if(_0x295ea5[_0x425890(-0x1d1,0x589,0xecd,0xbf7)](_0x295ea5[_0x425890(-0x148,0x5bc,0xcfa,0xd86)],_0x17318e(0x519,0x42,0x6f6,0xa02))){let _0x2c32a4=_0x1b7390[_0x17318e(0x722,0xdb6,0xd18,0xa67)][_0x425890(-0x17f,0x6d9,0xa10,0x8bc)](_0x313f40=>_0x313f40[_0x17318e(0x5f9,0x430,0xc25,0xd56)+'e']()[_0x17318e(0x585,0x95e,-0xd7,0x82e)](/[^\w\s\-]+/,'')===_0x98b87c);if(_0x532eae[_0x425890(0x717,0xb1d,0x702,0xf04)][_0x2c32a4])return!(-0x1*-0xb99+0x1*-0x2662+0x1*0x1ac9);_0x39fb53['terjawab'][_0x2c32a4]=_0xa14efc[_0x17318e(0xec0,0x733,0x4af,0xc86)];}else _0x48b645[_0x17318e(0xa17,0x37,0x809,0x3ee)][_0x17318e(0x5f3,0x59d,0x646,0xd8c)](async _0xb31e4b=>{const _0x553718={};_0x553718[_0x20ef24(0x58b,0xd49,0x275,0x7d0)]=_0xb31e4b;const _0xb9c3e2={};function _0x20ef24(_0x19fb3f,_0x48817b,_0x218de0,_0x1aab5f){return _0x17318e(_0x19fb3f-0x171,_0x218de0,_0x218de0-0x38,_0x1aab5f- -0x40);}_0xb9c3e2['image']=_0x553718;function _0x2831f3(_0x190c34,_0x99ea23,_0x5c6432,_0xc56de0){return _0x425890(_0xc56de0,_0x5c6432- -0x189,_0x5c6432-0x1c5,_0xc56de0-0x163);}_0xb9c3e2['caption']=_0x2831f3(0x1786,0x7e7,0xe43,0x3cb)+'\x20'+_0x48b645[_0x2831f3(0xddb,0x69d,0xe67,0x111b)]+(_0x2831f3(0x62b,0x1f,0x211,0xb9e)+_0x20ef24(0x2ec,0x8ac,0x959,0x9dc))+_0x48b645[_0x20ef24(0x2a0,0x365,0xe69,0x53e)]['name']+(_0x20ef24(0x1583,0x8a2,0x1694,0xf35)+'\x20')+_0x48b645[_0x20ef24(-0x19,-0x4e,0xf39,0x7bb)]+(_0x20ef24(0x18ba,0x1137,0x16a1,0x11dd)+_0x2831f3(-0x6d,0x330,0x709,0xdf4))+_0x48b645['caption'],_0x3797bd[_0x20ef24(0xc75,-0x3ba,0x7d0,0x5fc)+'e'](_0x17aa6d['chat'],_0xb9c3e2,{'quoted':_0x17aa6d});});}}}}break;case _0x295ea5[_0x425890(0x685,0x2d9,-0x69f,0x407)]:{if(_0x295ea5[_0x425890(0xb9c,0x1136,0x1a82,0x778)](_0x295ea5[_0x17318e(0xd30,0x826,0x1a6,0x62c)],_0x295ea5['qUBpv'])){const _0x5a75bf={};_0x5a75bf[_0x425890(0x10f7,0x10a0,0x177f,0xec4)+'t']=_0x425890(0x1e7,0x340,0x887,0x729)+'\x20⫸';const _0x5eb3eb={};_0x5eb3eb[_0x17318e(0x11c6,0xf28,0x9cc,0x1194)]=_0x5af498+_0x425890(0x506,0x2ff,0x94a,0x9fa),_0x5eb3eb[_0x17318e(0x1c6d,0x1ba4,0x1144,0x1318)]=_0x5a75bf,_0x5eb3eb[_0x425890(0xe2a,0x141b,0x1314,0x17c9)]=0x1;const _0x7558be={};_0x7558be[_0x425890(0x938,0x10a0,0x1569,0xdf6)+'t']=_0x295ea5[_0x17318e(0x70d,0x895,0xa62,0xeee)];const _0x200701={};_0x200701['buttonId']=_0x3cb23c+_0x17318e(0x98c,0x1563,0x9fa,0xc66),_0x200701[_0x425890(0x1243,0x10fb,0x1923,0x18ae)]=_0x7558be,_0x200701[_0x425890(0x1bfb,0x141b,0x1995,0xb6f)]=0x1;const _0x433de4={};_0x433de4[_0x17318e(0x1001,0xa47,0x178e,0x12bd)+'t']=_0x295ea5['hfIkN'];const _0x594b1f={};_0x594b1f[_0x17318e(0x1278,0x1a2d,0x9ca,0x1194)]=_0x5c2fa1+'donate',_0x594b1f[_0x425890(0xcba,0x10fb,0xea7,0xc1c)]=_0x433de4,_0x594b1f[_0x425890(0xf9c,0x141b,0x1e76,0xadd)]=0x1;let _0x3aac60=[_0x5eb3eb,_0x200701,_0x594b1f];const _0x56d4f1={};_0x56d4f1[_0x425890(-0x307,0x5f3,0xe0f,0xfdf)]=_0x52fc84+_0x17318e(0x1093,0x3fb,0x914,0x8f0);const _0x309d96={};_0x309d96[_0x425890(-0x200,0x381,-0x598,-0x56a)]=_0x56d4f1,_0x309d96[_0x425890(0x41a,0x30a,0x76e,0x431)]='\x0a┏━❯\x20'+_0x5208e4+(_0x425890(0x3af,0x19b,-0x4be,0x2cb)+_0x425890(0xe3d,0x1051,0x1250,0x11eb)+_0x17318e(0x1b63,0x18cb,0x1848,0x1848)+_0x425890(0x1c7d,0x1380,0xe64,0x1219)+_0x425890(0x642,0x98b,0xf32,0x10))+_0x5e3146+'\x20'+_0x12611f+(_0x425890(0xb23,0x63c,-0x36c,-0x194)+'┃╠')+_0x93313d+'\x20'+_0x1260d8+_0x17318e(0xd5c,0x1dbc,0x1bcd,0x14b2)+_0x8838cc+'\x20'+_0x38f5c8+'next\x0a┃╠'+_0x1c43a6+'\x20'+_0x1942a0+(_0x425890(0xf34,0xb4e,0x28d,0xc56)+_0x17318e(0x1f26,0x1e32,0x1a80,0x157c)+_0x425890(0xb8d,0xd90,0x9b1,0xf25))+_0x4b9d03+_0x425890(0x2a3,0x383,0x805,0x4fa),_0x309d96['footer']=_0x2f8c04[_0x425890(0x778,0x10be,0x109b,0x1600)][_0x425890(0x1896,0xe82,0x15a4,0x1824)],_0x309d96[_0x425890(0x797,0xf61,0x18fc,0x1360)]=_0x3aac60,_0x309d96[_0x17318e(0x13b3,0xec6,0xa2e,0x120c)]=0x4;let _0x142b5a=_0x309d96;const _0x41b67d={};_0x41b67d[_0x425890(0x11ac,0x807,-0x184,0x6ba)]=_0x502342,_0xe826d[_0x17318e(0xd0b,0xc34,0xa0,0x63c)+'e'](_0x4b9c59[_0x17318e(0x160a,0xe1b,0xcae,0xee4)],_0x142b5a,_0x41b67d);}else{if(!_0x116129)return _0x295ea5[_0x17318e(0x2f6,0xf65,0x1166,0x8f2)](_0xcd1d32,_0x425890(0x1417,0xb08,0xbcc,0xe31)+_0x295ea5[_0x17318e(0x1faf,0x100e,0x1594,0x1739)](_0x4fea53,_0x1cbc75)+(_0x425890(0xc28,0xae9,0xf30,0xa49)+'er'));let {ringtone:_0x5b5ba2}=_0x295ea5[_0x17318e(0xdb4,-0x1ee,-0x1a6,0x699)](require,_0x425890(0xeb0,0x853,-0x11e,0x9ef)+'per'),_0x559d86=await _0x5b5ba2(_0x116129),_0x1abddd=_0x559d86[Math['floor'](Math[_0x17318e(0x11fe,0xc2b,0x1ae,0xb4b)]()*_0x559d86['length'])];const _0x531343={};_0x531343[_0x425890(0xa10,0x5f3,0x2d2,0x323)]=_0x1abddd[_0x17318e(0x133d,0xbc9,0x8dc,0x1092)],_0x3797bd[_0x17318e(-0x20b,0xfa1,0xbb3,0x63c)+'e'](_0x17aa6d[_0x425890(0x5ea,0xcc7,0x315,0x1079)],{'audio':_0x531343,'fileName':_0x295ea5[_0x17318e(0xcdd,0x1e08,0xf75,0x13a5)](_0x1abddd[_0x17318e(0x771,0x1c8f,0x84f,0x120d)],_0x295ea5[_0x425890(0x730,0xfab,0x555,0x1780)]),'mimetype':_0x295ea5[_0x425890(0x5cf,0x7f5,0x10e,0x478)]},{'quoted':_0x17aa6d});}}break;case _0x295ea5[_0x17318e(0xe5,0x1067,0x2ae,0x8ee)]:{if(_0x295ea5[_0x17318e(-0x205,0xe1f,0x5d5,0x7a6)](_0x295ea5[_0x425890(-0x80d,0x111,-0x3a1,0x4cf)],_0x295ea5[_0x17318e(0xd3e,0x369,-0x3c5,0x32e)]))_0x13ed1f+=_0x425890(0x139b,0x10c2,0xd8c,0xb15)+_0x5a0fa0[_0x17318e(0x121c,0xa8e,0x1aa6,0x109f)]+_0x17318e(0xb36,0x1c4d,0xf26,0x1260)+_0x1dbe08[_0x425890(0x1d8,0x23d,0x62,-0x235)]+'\x0a\x0a';else{oh=_0x425890(0x6bd,0xb08,0x20c,0x5db)+_0x295ea5[_0x425890(0x143,0x1f9,0x25d,0x571)](_0x4fea53,_0x1cbc75)+(_0x17318e(0x9b5,-0x310,-0x5b3,0x3f1)+_0x17318e(0xf17,0x101b,0x1611,0x13f7)+_0x425890(0xbee,0xa3b,0xe02,0x652)+_0x17318e(0x1ea8,0x120b,0x170c,0x1564)+'6');if(!_0x116129)return _0x295ea5[_0x425890(0xf33,0x764,0x980,0x114a)](_0xcd1d32,oh);yy=await _0x295ea5[_0x425890(0x90d,0x1157,0x1adf,0xa28)](getBuffer,_0x425890(0x104a,0xcaa,0x42f,0x4cc)+_0x17318e(0x194f,0x1297,0x1b41,0x1695)+'indonesia.'+'herokuapp.'+_0x425890(0x113f,0x1580,0x115a,0xc74)+_0x17318e(0x144d,0x698,0x4f8,0xc34)+'a'+_0x116129);const _0x2c6950={};_0x2c6950['document']=yy,_0x2c6950[_0x17318e(0x700,0x146e,0x1a74,0x101b)]=_0x295ea5['bCtTE'],_0x2c6950['fileName']=_0x425890(0x1d29,0x13d1,0x1a1f,0x1271)+_0x116129+_0x17318e(0x6f1,0x1139,0x12fc,0xbe7),_0x3797bd[_0x17318e(0xd81,0x7fd,0xca4,0x63c)+'e'](_0x17aa6d[_0x17318e(0x7b0,0xcf7,0x906,0xee4)],_0x2c6950,{'quoted':_0x17aa6d})['catch'](_0x419ee6=>_0xcd1d32(oh));}}break;case'juzamma':{if(_0x295ea5[_0x17318e(0x102e,0xc27,0x12bb,0xe7c)](_0x52a010[0x7*0x22e+0x979+-0xd*0x1e7],_0x295ea5[_0x17318e(0x993,0x1e5,0x10e6,0x90d)])){if(_0x295ea5['RZazY'](_0x17318e(0xb6e,-0x68,0x3f8,0x5d2),_0x17318e(0x18aa,0x174b,0x9eb,0xf65))){_0x295ea5[_0x425890(0x845,0x69e,0x766,0x570)](_0xcd1d32,mess[_0x425890(0xbec,0x2c6,0x81f,0x5e2)]);const _0x2d6bea={};_0x2d6bea[_0x17318e(0x109,0xdc3,0x290,0x810)]=_0x295ea5[_0x425890(0xd1e,0x1062,0x13a2,0x1940)];const _0x7570d5={};_0x7570d5['document']=_0x2d6bea,_0x7570d5[_0x425890(0xf4d,0xdfe,0x51b,0xa0a)]=_0x425890(-0x597,0x10f,-0x5a9,0x36)+_0x17318e(0x129f,0xb79,0x1b3b,0x11f0),_0x7570d5[_0x17318e(0x96b,0x557,0x1537,0xf21)]=_0x17318e(0x520,0x168b,0x18e3,0xf00)+_0x425890(0x1f64,0x157c,0x13c8,0x1739)+_0x17318e(0x567,0x291,0x75e,0x322)+'pdf',_0x3797bd[_0x425890(0x48c,0x41f,0xa9,0x1fe)+'e'](_0x17aa6d[_0x17318e(0x1978,0x845,0xe3d,0xee4)],_0x7570d5,{'quoted':_0x17aa6d});}else _0x295ea5[_0x425890(0x156f,0xd59,0x14a9,0x1614)](_0x56a4be,_0x422287);}else{if(_0x295ea5[_0x425890(0xa4b,0xb5b,0x87a,0x472)](_0x52a010[0x264c+0x2cd+0x3f*-0xa7],_0x295ea5[_0x425890(0x11d4,0x9a3,0xb27,0x519)])){if(_0x295ea5['ntnmX'](_0x425890(0x203,0x7bf,-0x275,-0x2a5),_0x295ea5[_0x17318e(0x903,0x866,0x6c9,0xb67)])){_0x295ea5[_0x425890(0xf4f,0xbe8,0x670,0x697)](_0xcd1d32,mess[_0x425890(0x12d,0x2c6,0x852,0xcd2)]);const _0x4252e3={};_0x4252e3[_0x425890(0xeab,0x5f3,0xfc2,0xe91)]=_0x17318e(0x1074,0x55,0xaf1,0x6b5)+_0x17318e(0x43d,0x1190,0x1a5,0xc00)+'.my.id/dat'+_0x17318e(0x53e,0xb23,0x3bd,0x372)+_0x17318e(0xd11,0x370,0x1483,0xc3c)+_0x17318e(0x8e0,0xde2,0x36b,0x4d1)+_0x425890(0x48a,0xbc4,0x1659,0x847)+'a.docx';const _0x57b71e={};_0x57b71e[_0x425890(0xc05,0x565,0xa7c,0x706)]=_0x4252e3,_0x57b71e[_0x425890(0xebe,0xdfe,0x9a8,0xc6f)]=_0x295ea5[_0x425890(0x1410,0x15ac,0x1c9f,0x1834)],_0x57b71e['fileName']=_0x295ea5[_0x17318e(0xee4,0x5b4,0xf0e,0x9f0)],_0x3797bd[_0x425890(-0x1b9,0x41f,-0x255,-0x344)+'e'](_0x17aa6d['chat'],_0x57b71e,{'quoted':_0x17aa6d});}else _0x9f8df5+='*📫\x20Charact'+_0x17318e(0x1322,0x1117,0x15bf,0xfac)+_0x3e220a[_0x425890(-0x33b,0x357,-0x569,0x17e)]+'\x0a',_0x4de559+=_0x17318e(0x1f2,0xcaa,-0x5f,0x6ad)+_0x4387d0[_0x17318e(0xd46,-0xa7,0x6ee,0x616)]+(_0x17318e(0x1a07,0x1b30,0x1906,0x16fe)+_0x425890(0x5b9,0xe44,0x170f,0xc0e)+'•.•°•.•°•.'+'•°•.•°•.•°'+'•.•°•.•°•.'+'\x0a');}else{if(_0x295ea5[_0x17318e(0x1825,0x10ae,0x12cc,0xedd)](_0x52a010[-0x158c+0x260+0x6*0x332],'pptx')){_0x295ea5[_0x425890(0x489,0x90d,0x12c,0x759)](_0xcd1d32,mess[_0x425890(0x582,0x2c6,0x10,0xa52)]);const _0x282d31={};_0x282d31['url']=_0x295ea5[_0x17318e(-0x256,0x476,-0x1f5,0x35c)];const _0x2811c1={};_0x2811c1['document']=_0x282d31,_0x2811c1['mimetype']=_0x295ea5[_0x17318e(0x2177,0xe49,0x13ce,0x174b)],_0x2811c1[_0x425890(0x1033,0xd04,0x6d3,0x14b3)]=_0x295ea5['rCAYP'],_0x3797bd[_0x425890(-0x383,0x41f,0x7b1,-0x366)+'e'](_0x17aa6d[_0x425890(0x1732,0xcc7,0x1708,0x13d7)],_0x2811c1,{'quoted':_0x17aa6d});}else{if(_0x295ea5[_0x17318e(0x1b24,0x1098,0x1650,0x1134)](_0x52a010[0xe70*0x2+0xa*-0x15f+-0xf2a],_0x425890(0x11f5,0x1630,0x1b96,0x12e8))){_0x295ea5[_0x17318e(0xf52,0x157f,0x1be5,0x1431)](_0xcd1d32,mess[_0x425890(0x248,0x2c6,0x8fe,-0x709)]);const _0x341a8b={};_0x341a8b[_0x425890(0x37f,0x5f3,-0x2e5,0x1ac)]=_0x295ea5['EgaKC'];const _0x364239={};_0x364239[_0x17318e(-0x17f,0xa48,0xcd9,0x782)]=_0x341a8b,_0x364239['mimetype']=_0x295ea5[_0x17318e(0x6fe,0xa84,0x8b,0x886)],_0x364239[_0x17318e(0x18c3,0xf67,0x1848,0xf21)]=_0x295ea5['lGWJt'],_0x3797bd[_0x17318e(0x1b4,0x586,0x1f4,0x63c)+'e'](_0x17aa6d[_0x17318e(0x17e3,0x951,0xedf,0xee4)],_0x364239,{'quoted':_0x17aa6d});}else _0x295ea5[_0x17318e(0xe53,0x1717,0x5dc,0xd54)](_0xcd1d32,_0x425890(-0x186,0x2a4,-0x4,-0x698)+_0x17318e(0x788,0x12c7,0x1a13,0x101a)+_0x17318e(0x19f9,0x172e,0x15f1,0x1294)+'mple\x20:\x20'+_0x295ea5['SShKn'](_0x4fea53,_0x1cbc75)+(_0x425890(0xe83,0x5a7,0xee3,0x4c4)+_0x425890(0x616,0x8e1,0x589,0x2c5)+_0x17318e(0xf35,0x538,0x1522,0xbac)+_0x17318e(0x1005,0x15a4,0xe1e,0x12d5)+_0x17318e(0x6b9,0xc96,0xd06,0xee5)));}}}}break;case _0x295ea5[_0x17318e(0x893,0xefb,0x1666,0x1077)]:case _0x295ea5[_0x425890(-0xd1,0x62b,0xa88,0x589)]:{if(_0x295ea5['sGhPr']===_0x295ea5[_0x425890(0x873,0x8e7,0x8c6,0x910)]){if(!_0x52a010[-0x1cd6+0x1c9*-0xb+0x3079])return _0x295ea5['rnqhe'](_0xcd1d32,'Example:\x0a'+(_0x4fea53+_0x1cbc75)+(_0x17318e(-0x4c4,-0x4e,0x7ba,0x3e3)+'\x0a')+_0x295ea5[_0x425890(0x125d,0x1504,0x18b2,0x1273)](_0x4fea53,_0x1cbc75)+(_0x17318e(0x682,0xb00,0x4b4,0xbe1)+_0x17318e(0x1835,0xd51,0x9bf,0x11be)+_0x17318e(0x1214,0xefc,0x2fe,0xcc4)+_0x425890(0x3c0,0x27f,-0x1a0,-0x74b)+'\x0a1\x20-\x204590\x0a'+_0x17318e(0xcf3,0xb9b,0x1ae5,0x1462)+'26363\x0abukh'+_0x425890(0x158a,0xc6c,0x156d,0x51a)+_0x425890(0x19ca,0x1081,0xe96,0x7ab)+_0x17318e(0x886,0x16dd,0x2ef,0xc88)+'bu-majah\x0a1'+_0x425890(0x1790,0xd21,0xaec,0x116d)+_0x425890(0x89a,0x1273,0xad3,0xbcc)+_0x425890(0x82f,0xf76,0x7cc,0x8ea)+_0x425890(0x16d9,0xfd0,0x144c,0xc8d)+'slim\x0a1\x20-\x205'+_0x425890(0xcd1,0x14a3,0x16a3,0x1a97)));if(!_0x52a010[0x23a*0xd+0xa4e+-0x273f])return _0x295ea5['EHvDk'](_0xcd1d32,'Which\x20Hadi'+_0x425890(-0x16e,0x7b4,0x3cd,0xf1c)+_0x425890(0xe30,0x118a,0x11e2,0xd8d)+(_0x4fea53+_0x1cbc75)+_0x17318e(0xfb3,0x1365,0x744,0xcc2));try{let _0x50892e=await _0x295ea5[_0x17318e(0x43e,-0x67a,0x8c3,0x3c0)](fetchJson,'https://is'+_0x17318e(0x207f,0x1a37,0x101c,0x1695)+_0x17318e(0xa0,0x8c5,0x85f,0x322)+_0x17318e(0x84b,0x15c6,0xe20,0x1177)+_0x425890(0x1ec9,0x1580,0x1237,0xba0)+_0x17318e(-0x318,0x677,0x740,0x559)+_0x425890(0x596,0xe84,0xd20,0x95a)+_0x52a010[0x197*0xd+-0xff3+0x4b8*-0x1]),{number:_0x988ba,arab:_0x2eb4b6,id:_0x510894}=_0x50892e[_0x425890(0xf32,0x11b1,0x1735,0x14de)](_0x26c55d=>_0x26c55d[_0x17318e(0x1973,0x1b8a,0x18d9,0x1776)]==_0x52a010[-0x12fb*0x1+0x3*-0x549+0x3df*0x9]);_0x295ea5['uNAFs'](_0xcd1d32,'No.\x20'+_0x988ba+'\x0a\x0a'+_0x2eb4b6+'\x0a\x0a'+_0x510894);}catch(_0x7fd2a5){_0x295ea5['FZpKk']!==_0x295ea5[_0x425890(0x368,0xa44,0x592,0xf99)]?_0x28d7d0(_0x17318e(0x709,0x6c3,0x98e,0x4c1)+_0x17318e(0x14f3,0x17b4,0xe95,0x101a)+_0x17318e(0x11dc,0x1082,0x1be8,0x1294)+_0x425890(0xc6d,0x41c,0xa2,0x4cf)+(_0x282625+_0x1854cc)+('\x20pdf\x0a\x0aAvai'+_0x425890(0x1302,0x8e1,0x1217,0xbda)+_0x17318e(0x89a,0xd41,0x62c,0xbac)+_0x425890(0x1926,0x10b8,0x134a,0x1afd)+',\x20xlsx')):_0xcd1d32('Hadith\x20Not'+_0x17318e(0xd96,0x34b,0x4ae,0x87e));}}else _0x295ea5[_0x425890(0xfca,0x10ec,0x7de,0xcb8)](_0x967571,_0x295ea5['vEkJo']);}break;case _0x295ea5['nkQLg']:{if(!_0x52a010[-0xbe3+-0x117b+0x1d5e])return _0xcd1d32(_0x17318e(0x116e,0x1edc,0x18be,0x1836)+_0x17318e(0x11dd,0xcd8,0x11f1,0x791)+(_0x4fea53+_0x1cbc75)+(_0x425890(0x8f0,0x1300,0x130c,0x155d)+_0x425890(0x12b1,0x84f,-0x240,0x5ab)+_0x17318e(0xc6d,0x11d0,0x10f5,0x1699)+_0x425890(0x502,0x6ea,0x160,0xc38)+_0x425890(0xdab,0xbc8,0xd22,0x1288)+_0x425890(0x806,0x70e,0x6eb,0xe6d)+_0x425890(0x1691,0x1110,0x6bd,0x13fc)+_0x17318e(0x190c,0xeab,0xccf,0x1621)+'Verse\x20Is\x20J'+'ust\x201'));if(!_0x52a010[0x10a3*-0x1+0x1b*-0x29+0x14f7])return _0xcd1d32(_0x425890(0x19be,0x1619,0x1b8a,0x1e10)+'ples:\x0a'+_0x295ea5[_0x17318e(0x5c2,0xdca,0x1431,0xa52)](_0x4fea53,_0x1cbc75)+(_0x425890(0xfdf,0x1300,0x16ef,0xbeb)+_0x425890(0x716,0x84f,0xdde,0xd5a)+_0x17318e(0x160e,0x1206,0x20fb,0x1699)+'\x20Al-Fatiha'+_0x17318e(0xdaf,0xfde,0xb76,0xde5)+_0x425890(0xccf,0x70e,0xe19,0xc2a)+'\x20The\x20Audio'+_0x425890(0x11ca,0x1404,0xa2e,0x12a3)+_0x17318e(0x85c,0xd51,0x862,0x401)+_0x425890(0xcc1,0x713,0x85d,0xa6b)));let _0x2b13a0=await _0x295ea5[_0x425890(0xfd8,0x778,0xfaa,0x512)](fetchJson,_0x17318e(0x17a9,0x6d7,0x154e,0xec7)+_0x17318e(0x1ad7,0x1ea9,0x1c86,0x1695)+_0x425890(0x1f3,0x105,0x681,-0x4cb)+'herokuapp.'+_0x17318e(0x1b7c,0x1f61,0xd67,0x179d)+_0x17318e(0xfa7,0xfa6,0xd3d,0xade)+_0x425890(0x5f4,0xd82,0xac6,0xd18)+_0x52a010[0x278*-0x2+0xaa9+-0x5b9]+_0x17318e(0x1f90,0x10d4,0xfc7,0x16a5)+_0x52a010[-0x747+0x706+0x42]),_0x2acbfa=_0x17318e(0x101f,0x54f,0xdde,0x736)+_0x2b13a0[_0x17318e(0x64c,-0x252,-0x44b,0x45a)]['data'][_0x425890(0x500,0x1e8,-0x87a,-0xd7)][_0x17318e(0x15d6,0xd4c,0x108e,0x154b)]+(_0x425890(0x69d,0x78d,0x86f,0xae3)+_0x17318e(0xf86,0x84,0x13ee,0xa1c))+_0x2b13a0['result']['data'][_0x425890(0x1719,0xd84,0x585,0xb1b)+'n']['en']+(_0x425890(0x168,0x8fa,0xc83,0x12ff)+_0x425890(0xac2,0x1493,0x1150,0x1c01))+_0x2b13a0[_0x17318e(0xb45,0x66c,0x90,0x45a)][_0x17318e(0x1728,0xb0a,0x1338,0xced)][_0x17318e(0xabc,0x504,0xe12,0xfa1)+'n']['id']+'\x0a\x0a(\x20Q.S\x20'+_0x2b13a0[_0x425890(0xadb,0x23d,0x365,0x81d)]['data'][_0x17318e(0x90f,-0x3d2,0x12a,0x610)][_0x425890(0x1257,0xe82,0x1611,0x587)][_0x17318e(0x11a9,0x19cd,0x13d7,0x17ad)+_0x17318e(0xf89,0x1491,0xd97,0x13bb)]['id']+_0x425890(0xa4b,0x7ff,0xae8,-0x11f)+_0x2b13a0['result'][_0x17318e(0x5b3,0x4c9,0x8dc,0xced)][_0x425890(0x15dc,0x1559,0x113f,0xb8c)]['inSurah']+'\x20)';_0x295ea5[_0x17318e(-0x99,0x534,-0x18f,0x84d)](_0xcd1d32,_0x2acbfa);const _0x366a21={};_0x366a21[_0x17318e(0x5c5,-0x11f,0x3fa,0x810)]=_0x2b13a0[_0x17318e(0x628,0xe5d,-0xb5,0x45a)][_0x425890(0x770,0xad0,0x393,0x117)]['audio'][_0x425890(-0x507,0x313,0x601,0x440)];const _0x288f77={};_0x288f77[_0x17318e(0xc42,0x893,0x113e,0x1092)]=_0x366a21,_0x288f77[_0x425890(0x15e9,0xdfe,0x516,0xaa8)]=_0x425890(0x907,0x128d,0x1651,0x135a),_0x3797bd[_0x17318e(0xd8c,0xc23,0x2d4,0x63c)+'e'](_0x17aa6d[_0x425890(0x265,0xcc7,0x123e,0x1281)],_0x288f77,{'quoted':_0x17aa6d});}break;case _0x17318e(0xa78,0xa7e,-0x19b,0x46f)+_0x17318e(0x1a00,0x171d,0x2124,0x17da):{if(_0x295ea5[_0x425890(0x502,0x954,0x5d2,0x10e)](_0x295ea5[_0x17318e(0x128e,0x19bd,0x13c4,0x10d5)],_0x295ea5[_0x17318e(0xab8,0xf9e,0x146e,0x10d5)])){if(!_0x52a010[-0x142+0xf07+-0xdc5])return _0xcd1d32(_0x17318e(0x16a8,0x2285,0x15f9,0x1836)+_0x425890(-0x104,0x574,-0x2be,-0x2e7)+(_0x4fea53+_0x1cbc75)+(_0x425890(0xd53,0x1300,0x10d4,0x176c)+'\x20The\x20Resul'+'t\x20Is\x20The\x20I'+_0x17318e(0xed6,0x152,0x792,0x5fd)+_0x17318e(0x73c,0x1950,0x13ec,0xfb7)+_0x17318e(0xd01,0xb4c,0x71f,0x7a5)+_0x17318e(0x1aa9,0x1539,0xcf8,0x11b2)+'2'));if(!_0x52a010[0x11cf+0xd*-0x254+0xc76])return _0x295ea5[_0x425890(0xeff,0x10fe,0xefe,0x133f)](_0xcd1d32,_0x17318e(0x179e,0x161e,0x1cd0,0x1836)+_0x17318e(0x463,0xe35,0x603,0x791)+(_0x4fea53+_0x1cbc75)+(_0x17318e(0x13d8,0x1094,0x100f,0x151d)+'\x20The\x20Resul'+_0x425890(0xab8,0x10f4,0xc9f,0x965)+_0x425890(-0x4b9,0x3e0,0xd36,-0x30c)+_0x17318e(0x14e5,0xa44,0x891,0xfb7)+'ah\x20Al-Fati'+_0x425890(0xba1,0xf95,0x17ad,0x19c9)+'2'));let _0x4e5094=await _0x295ea5[_0x425890(0x167d,0x15a8,0x12a7,0x1667)](fetchJson,_0x17318e(0xbd8,0x172e,0x811,0xec7)+_0x17318e(0x202d,0xe7b,0x1716,0x1695)+_0x17318e(-0x751,0xb0a,0x4db,0x322)+_0x425890(0xb9c,0xf5a,0x18ac,0xd13)+_0x425890(0x1357,0x1580,0x10ee,0x1107)+_0x425890(0xa97,0x8c1,0x769,0x639)+_0x17318e(0xd3d,0xc26,0xd47,0xf9f)+_0x52a010[-0x9f6+-0x9f+0xa95]+_0x425890(0xd6f,0x1488,0x1b79,0xf56)+_0x52a010[-0x1b*0xa7+0xe16+0x388]),_0x1e3b97=_0x425890(-0x406,0x2f1,-0x704,-0x191)+_0x17318e(0x735,0x8f9,0x2cf,0xc6e)+_0x425890(0x271,0xba2,0x3e0,0x2d6)+'\x20'+_0x4e5094['result']['data'][_0x425890(0x722,0x57b,0xe99,0xbc0)]['id'][_0x425890(0x1398,0x10f2,0x16d6,0x656)]+('\x0a\x0a*Long*\x20:'+'\x20')+_0x4e5094['result'][_0x17318e(0xbea,0xd22,0xefb,0xced)][_0x425890(0x46d,0x57b,0xdf0,-0x113)]['id']['long']+_0x17318e(0xf5c,0x1418,0xa99,0x12a5)+_0x4e5094[_0x17318e(0xb24,-0x5ad,0xe5c,0x45a)][_0x425890(0x552,0xad0,0xbb0,0x47b)][_0x425890(0x6b2,0x3f3,0x730,0x4e7)][_0x17318e(0x10d7,0xc8a,0x1693,0x109f)][_0x425890(0x1ae9,0x1590,0x160a,0x1e9c)+'ation']['id']+'\x20:\x20'+_0x4e5094['result'][_0x425890(0xb0,0xad0,0x14d,0x138f)][_0x425890(0x1208,0x1559,0x1025,0xeaa)][_0x425890(0x7b7,0x1b4,0xadd,0xb9)]+'\x20)';_0x295ea5[_0x17318e(0x1526,0x1bcd,0x22a0,0x1811)](_0xcd1d32,_0x1e3b97);}else _0x295ea5[_0x17318e(0x1419,0x1bb3,0x17a8,0x11a5)](_0x13bb4f,_0x14f8a7[_0x425890(0xbbf,0xa69,0x807,0x10ae)]);}break;case _0x295ea5[_0x17318e(0xa5e,-0x3e8,0xbc0,0x3c9)]:case _0x295ea5[_0x425890(-0x1a,0x773,0x10e0,0x9f3)]:case _0x295ea5[_0x17318e(0x6c8,0x15c8,0xb42,0xfa4)]:case _0x295ea5[_0x17318e(0x904,0x1a33,0x1a55,0x1334)]:case _0x295ea5['XtMlR']:case _0x425890(0x11d0,0x13a5,0x1bd7,0x1120):case _0x295ea5[_0x425890(0xe65,0x78c,0x1014,0x30f)]:case _0x295ea5['iXLBv']:case _0x295ea5['dohCV']:case _0x295ea5['iOgTq']:case _0x295ea5[_0x425890(0x16c1,0xf51,0x97c,0x14c6)]:case _0x295ea5[_0x425890(0xd2f,0xf8f,0x65f,0xf28)]:try{if(_0x295ea5['AcwLY']!==_0x295ea5['AcwLY']){if(_0x295ea5[_0x425890(-0x21d,0x621,-0x274,0xaae)](_0x16ecc1[_0x425890(0xe7a,0x8db,0xf5f,0x952)],_0x295ea5[_0x17318e(0x1983,0x195b,0x91a,0xee7)]))return;if(_0x295ea5['dhHAc'](_0x23194e[_0x17318e(0xf14,0x13bf,0xb23,0xaf8)],_0x295ea5[_0x17318e(0x2110,0x1306,0x156e,0x16f8)])){const _0x207176={};_0x207176[_0x425890(-0x741,0x1e8,0x2c,0x21b)]=_0x17318e(0xad8,0xe9d,0xbbd,0x1151)+_0x17318e(0x4ea,-0xd4,0x603,0x4c0);const _0x467d6={};_0x467d6[_0x425890(0x1122,0x807,0xf9f,0xc19)]=_0xe99155,_0x33affe[_0x17318e(0x5c6,0x4ce,0xa5d,0x63c)+'e'](_0x201d2c,_0x207176,_0x467d6);}}else{let _0x3dc06b;if(/bass/['test'](_0x1cbc75))_0x3dc06b=_0x295ea5[_0x425890(0x12b,0xba7,0xa6d,0x13fc)];if(/blown/['test'](_0x1cbc75))_0x3dc06b=_0x295ea5[_0x17318e(0x13e8,0x151a,0x7c5,0x1122)];if(/deep/[_0x425890(0xf5d,0xd86,0x1726,0xc0a)](_0x1cbc75))_0x3dc06b=_0x295ea5[_0x425890(0x5d4,0x309,-0x458,0xd63)];if(/earrape/[_0x17318e(0x687,0x144c,0x11f0,0xfa3)](_0x1cbc75))_0x3dc06b=_0x295ea5[_0x425890(0x22d,0x884,0xd70,0xfdf)];if(/fast/[_0x425890(0x47b,0xd86,0x6d0,0xfed)](_0x1cbc75))_0x3dc06b=_0x425890(0x16ca,0xdd5,0xebb,0xe8a)+'\x22atempo=1.'+_0x17318e(-0x17e,0x566,0x1bb,0x685)+'e=44100\x22';if(/fat/[_0x425890(0xfe1,0xd86,0x171b,0xe02)](_0x1cbc75))_0x3dc06b='-filter:a\x20'+_0x425890(0x718,0x186,0x524,-0x3ab)+'6,asetrate'+_0x17318e(0xd36,0xe7c,0x273,0x60d);if(/nightcore/[_0x17318e(0x9bf,0x1428,0xe31,0xfa3)](_0x1cbc75))_0x3dc06b=_0x17318e(0x177e,0x161c,0xebf,0xff2)+_0x425890(0xace,0x79e,0x453,0x57a)+_0x425890(0x1720,0x13dd,0x1300,0x1be1)+_0x17318e(-0x317,0x2b9,-0x52e,0x3b1)+'5';if(/reverse/[_0x17318e(0xfaf,0x16e3,0x83f,0xfa3)](_0x1cbc75))_0x3dc06b='-filter_co'+_0x17318e(-0x39,-0xc,0xe8e,0x89f)+_0x17318e(0x1c54,0x1d67,0x101e,0x175d);if(/robot/['test'](_0x1cbc75))_0x3dc06b=_0x17318e(0x1a44,0x678,0xfe0,0x1095)+_0x425890(0xca,0x82d,0x10,0x9bb)+_0x17318e(0x121a,0xf99,0x13db,0x1659)+_0x17318e(0x1456,0x56e,0xd72,0xb77)+_0x425890(0x7d8,0xc68,0x404,0x1426)+_0x425890(0x1a67,0x12b1,0x1277,0xa60)+_0x17318e(0xf60,0x6eb,0xc88,0x7a8)+_0x17318e(0xe53,0xe10,0xac9,0x963)+'win_size=5'+_0x17318e(0xa37,0x1752,0x16c7,0xd9c)+'=0.75\x22';if(/slow/[_0x425890(0x38f,0xd86,0x111a,0x8eb)](_0x1cbc75))_0x3dc06b=_0x17318e(0xff2,0xbc7,0x72e,0xff2)+_0x17318e(0x725,0x8fd,0x113b,0xd94)+_0x425890(0x12ce,0xe5c,0x4f1,0x17e4)+_0x425890(-0x628,0x2ec,-0x7a9,0x8e1);if(/smooth/[_0x425890(0xf4b,0xd86,0x129a,0xd9c)](_0x1cbc75))_0x3dc06b=_0x295ea5['rLrOH'];if(/tupai/[_0x425890(0x5b1,0xd86,0x1624,0xc6b)](_0x1cbc75))_0x3dc06b='-filter:a\x20'+_0x17318e(0xe46,0xbae,0x10cb,0xd94)+_0x17318e(0x4cd,0x1266,0x11b2,0xbef)+_0x17318e(0x155a,0x1178,0xaf2,0x14d2);if(/audio/[_0x425890(0x642,0xd86,0x1460,0x765)](_0x4f303f)){_0x295ea5[_0x17318e(0x21da,0xded,0x2068,0x181d)](_0xcd1d32,mess[_0x17318e(0xf57,0x9f9,0xe6d,0x4e3)]);let _0x4a10a7=await _0x3797bd[_0x17318e(0x7ff,0x5c8,0x908,0x8b0)+'dSaveMedia'+_0x17318e(0xc74,0x48e,0x41f,0x4b3)](_0x4413ec),_0x4e3002=_0x295ea5['XAqXD'](getRandom,'.mp3');exec(_0x425890(0x301,0x54e,-0x391,0xa64)+_0x4a10a7+'\x20'+_0x3dc06b+'\x20'+_0x4e3002,(_0x102ffb,_0x22e2b6,_0x2e9fbf)=>{fs['unlinkSync'](_0x4a10a7);if(_0x102ffb)return _0xcd1d32(_0x102ffb);let _0x2e01e5=fs[_0x5348d3(0x721,0xcf9,0x8f3,0x13e7)+'nc'](_0x4e3002);const _0x19e013={};function _0x5348d3(_0x92df,_0x32fc19,_0x267e82,_0x1b268b){return _0x425890(_0x1b268b,_0x32fc19-0x2a3,_0x267e82-0x1c0,_0x1b268b-0x147);}_0x19e013['audio']=_0x2e01e5,_0x19e013[_0x48076d(0x9d2,0x8e9,0xe87,0xee3)]='audio/mpeg';function _0x48076d(_0x4fc053,_0x375790,_0x11a558,_0x2e939b){return _0x425890(_0x375790,_0x4fc053- -0x42c,_0x11a558-0x15b,_0x2e939b-0xe0);}_0x3797bd[_0x48076d(-0xd,0x35,-0x4eb,0x7d5)+'e'](_0x17aa6d[_0x48076d(0x89b,-0x180,0x1e5,0x1e)],_0x19e013,{'quoted':_0x17aa6d}),fs[_0x5348d3(0x1a74,0x11c0,0x1835,0xe3e)](_0x4e3002);});}else _0xcd1d32('Reply\x20To\x20T'+'he\x20Audio\x20Y'+_0x17318e(-0x114,0x1344,0xe4a,0x8e0)+_0x17318e(0x56b,0x10b2,0x974,0x7ce)+_0x425890(0x12ac,0x1332,0x1a8f,0x1b7f)+'\x20*'+(_0x4fea53+_0x1cbc75)+'*');}}catch(_0x47a102){_0xcd1d32(_0x47a102);}break;case _0x17318e(0x305,0x14e3,0xde9,0xabf):{if(_0x295ea5[_0x17318e(0x1e0,0xdc5,0x40a,0x8e5)]!==_0x295ea5['qhAMx']){const _0x111077={};_0x111077[_0x17318e(0xd59,0x1b82,0xa56,0x12bd)+'t']=_0x295ea5['vMhbF'];const _0x1e41dc={};_0x1e41dc[_0x425890(0x105f,0xf77,0xe81,0xa68)]=_0x52a3a1+_0x425890(0x831,0x2ff,-0x44d,0x1a9),_0x1e41dc[_0x425890(0x11e2,0x10fb,0x12fe,0xc8b)]=_0x111077,_0x1e41dc[_0x425890(0x1b1f,0x141b,0x1cfb,0x17d4)]=0x1;const _0x1f70c4={};_0x1f70c4['displayTex'+'t']=_0x295ea5[_0x425890(0x13c8,0xcd1,0x1534,0x9f3)];const _0x26fd73={};_0x26fd73[_0x17318e(0x18c0,0xe18,0x163e,0x1194)]=_0x2c81a0+'alive',_0x26fd73[_0x425890(0xf2a,0x10fb,0x96e,0x18da)]=_0x1f70c4,_0x26fd73[_0x425890(0x1c37,0x141b,0xc58,0xb5b)]=0x1;const _0x34818f={};_0x34818f[_0x425890(0x74a,0x10a0,0x790,0x1221)+'t']=_0x295ea5[_0x17318e(0xcbb,-0xb1,0xabb,0x5a1)];const _0x150cbf={};_0x150cbf[_0x425890(0x5b9,0xf77,0x7da,0xc2c)]=_0x3555f8+_0x17318e(0x1669,0x16cb,0x1f4b,0x1751),_0x150cbf[_0x425890(0x951,0x10fb,0x168b,0x1a67)]=_0x34818f,_0x150cbf[_0x425890(0x1de9,0x141b,0xc67,0x1231)]=0x1;let _0x46f524=[_0x1e41dc,_0x26fd73,_0x150cbf],_0x505ad9={'image':{'url':_0x295ea5['MDtgg'](_0x2eba73,_0x295ea5['sMOJo'])},'caption':'\x0a┏━❯\x20'+_0x53771f+('\x20❮━━😎\x20\x0a┃╔═'+_0x425890(0x1056,0x13b2,0x17d7,0xe1c)+_0x425890(0x13d7,0xdc1,0x918,0xc31)+'\x20\x20\x20\x20\x20\x20\x20\x20\x0a┃'+'╠')+_0x1f3b60+'\x20'+_0x1130ac+(_0x425890(0xa4f,0x965,0xa0e,0xe13)+_0x17318e(0x141a,0x11ae,0xba2,0x11e1))+_0x12b7fe+'\x20'+_0x5989f3+(_0x425890(0x1a5,0x1e6,0xacf,0x1b9)+_0x17318e(0x1a87,0x16a4,0x1307,0x11e1))+_0x396d29+'\x20'+_0x3c5fc2+('yts\x20[query'+_0x425890(0x1129,0xded,0x5aa,0xee6))+_0x2d5bba+'\x20'+_0x5a3458+(_0x425890(0x1dd9,0x13ba,0x10a3,0xde4)+_0x425890(0x1733,0xd66,0x1456,0xb74))+_0x25bf06+'\x20'+_0x4acf78+('gimage\x20[qu'+'ery]\x0a┃╠')+_0x13c253+'\x20'+_0x3506b3+(_0x425890(0x1d26,0x12c4,0x1a66,0x1499)+_0x17318e(0x6aa,0x4b7,0xab,0x8ef))+_0x5bbe1f+'\x20'+_0x41ebb5+('wallpaper\x20'+_0x17318e(0x60,0xf09,0xc8c,0x8ef))+_0x4b9474+'\x20'+_0x73af08+(_0x17318e(0x957,0xe4c,0xa16,0x97b)+_0x17318e(0x929,0x503,0x8a6,0x8ef))+_0x28249f+'\x20'+_0x252765+(_0x425890(0xfd,0x5db,-0x35f,0xe5b)+_0x17318e(0x6ac,0xe7,0x4e,0x7f5))+_0x53a3b6+'\x20'+_0x2ad329+(_0x17318e(0x94d,0xe7c,0xd6f,0x3e4)+_0x17318e(0xf1b,0x11b4,-0x187,0x7f5))+_0x12009d+'\x20'+_0x11776e+('webtoon\x20[q'+'uery]\x0a┃╚══'+_0x17318e(0x1203,0xdb2,0x1ca7,0x157c)+'═☬\x0a┗━━❯\x20')+_0x271ec2+_0x425890(-0x5af,0x383,0x504,0xacd),'footer':_0x133e93[_0x17318e(0x1746,0x11cb,0x164c,0x12db)][_0x425890(0x1834,0xe82,0x12b9,0x104a)],'buttons':_0x46f524,'headerType':0x4};const _0x51a899={};_0x51a899['quoted']=_0x5148ee,_0x3d7fba[_0x17318e(0x1f4,0x10dc,0xa45,0x63c)+'e'](_0x277316[_0x425890(0x11e3,0xcc7,0xc1c,0x16ba)],_0x505ad9,_0x51a899);}else{if(!_0x17aa6d[_0x425890(0xa0f,0x807,0x1c0,0x826)])return _0x295ea5[_0x425890(0xcce,0x377,-0x19d,0x1ad)](_0xcd1d32,_0x425890(0xb42,0xb04,0x14fc,0x162)+'age!');if(!_0x17aa6d['quoted']['fileSha256'])return _0x295ea5['Eltbf'](_0xcd1d32,_0x17318e(0xe9e,0xc5e,0xc2,0xa31)+_0x17318e(-0xfb,0x1f2,0x561,0x512));if(!_0x116129)return _0x295ea5[_0x425890(0x1fd,0x7a6,-0x1a3,0x694)](_0xcd1d32,_0x425890(0x10f1,0xadd,0xd6e,0x544)+'ommand?');let _0x5e5a03=_0x17aa6d[_0x425890(0xa01,0x807,0x7f0,-0x8a)]['fileSha256'][_0x17318e(0x205,0x1189,0x14e2,0xbe9)](_0x295ea5[_0x425890(0xbbf,0x15a3,0xeaa,0x1a89)]);if(global['db'][_0x17318e(0x2f1,0xff9,0x628,0xced)][_0x425890(0x153d,0xe57,0x12b6,0x951)][_0x5e5a03]&&global['db'][_0x17318e(0x4a8,0x14a2,0xc2f,0xced)][_0x425890(0x90a,0xe57,0x135b,0xeec)][_0x5e5a03][_0x425890(0xf75,0xa7a,0x796,0x1208)])return _0xcd1d32(_0x425890(0xe83,0x6df,-0x2c2,0x6b7)+_0x17318e(0x79e,0x8d6,0xad7,0x10fa)+_0x425890(0xc19,0x1210,0xa41,0x12d0)+_0x425890(0x1776,0xdcb,0x80a,0x181f)+'icker\x20Comm'+_0x425890(0xd7a,0x714,0xa8d,0xc8));global['db'][_0x425890(0x114b,0xad0,0xc5f,0xb70)]['sticker'][_0x5e5a03]={'text':_0x116129,'mentionedJid':_0x17aa6d['mentionedJ'+'id'],'creator':_0x17aa6d[_0x425890(0x6c7,0xa69,0x1483,0x39b)],'at':+new Date(),'locked':![]},_0x295ea5[_0x17318e(0xef7,0x172d,0x1321,0xd46)](_0xcd1d32,_0x425890(0x8b2,0xde2,0xd68,0x11a5));}}break;case _0x295ea5[_0x425890(0x833,0x1121,0xc85,0xecb)]:{let _0x3fe4f4=_0x17aa6d[_0x17318e(0xff1,0xe38,0x13c8,0xa24)][_0x17318e(0xea1,0x1db3,0x169b,0x17d1)]['toString'](_0x295ea5[_0x17318e(0x1dfd,0x1f2c,0xee2,0x17c0)]);if(!_0x3fe4f4)return _0xcd1d32(_0x17318e(0x5a6,0x69e,-0x5a1,0x4f2));if(global['db'][_0x425890(0xb96,0xad0,0x179,0x1179)][_0x17318e(0x10b5,0xd5d,0x1a83,0x1074)][_0x3fe4f4]&&global['db'][_0x17318e(0x8bd,0x1449,0x407,0xced)][_0x17318e(0x1514,0x73e,0x1a10,0x1074)][_0x3fe4f4][_0x425890(0xf4d,0xa7a,0xcd1,0x1406)])return _0x295ea5[_0x425890(0x16c5,0xff6,0x1879,0x1a46)](_0xcd1d32,_0x17318e(0x5de,-0x3d,0xbd5,0x8fc)+_0x425890(0x7f5,0xedd,0x18c7,0x8cc)+_0x17318e(0xd83,0xf78,0x12c2,0x172e)+_0x17318e(0x7dc,0xec1,0xf78,0x119e)+'icker\x20Comm'+'and');delete global['db']['data'][_0x425890(0x15a0,0xe57,0x1058,0xed7)][_0x3fe4f4],_0x295ea5[_0x425890(0x98a,0x826,0x7a4,0x319)](_0xcd1d32,_0x17318e(0x152d,0x8aa,0x143e,0xfff));}break;case _0x295ea5[_0x17318e(-0x4b5,0x2c,0xbe7,0x4f5)]:{let _0xd57843=('\x0a*Hash\x20Lis'+_0x425890(0x1812,0x109e,0x1100,0x7c0)+_0x17318e(0x17f8,0xdfd,0x17fe,0xdfa)+_0x425890(0xfc9,0x7f0,0x981,0x78)+'\x0a'+Object['entries'](global['db'][_0x425890(0xc3a,0xad0,0x17e,0x3d5)][_0x425890(0x1439,0xe57,0x576,0x681)])[_0x17318e(0x14e0,0x6eb,0x7a9,0xd8c)](([_0x5c56c5,_0x35936a],_0x31ceaa)=>_0x31ceaa+(0x1207+-0x5bf*0x2+-0x688)+'.\x20'+(_0x35936a[_0x17318e(0x16a3,0x13b5,0xaf7,0xc97)]?'*'+_0x5c56c5+'*':_0x5c56c5)+'\x20:\x20'+_0x35936a[_0x17318e(0x5ad,-0x5bf,0xe59,0x405)])[_0x425890(0xe24,0x4f5,0x7f0,0x384)]('\x0a')+'\x0a')[_0x17318e(0xc1f,-0x2d,0xaa2,0x769)]();_0x3797bd[_0x17318e(0x186f,0xe85,0x147e,0x14cf)](_0x17aa6d[_0x17318e(0xc07,0x795,0xdd3,0xee4)],_0xd57843,_0x17aa6d,{'mentions':Object[_0x17318e(0x881,-0x3eb,-0x258,0x5b6)](global['db'][_0x425890(0x2e9,0xad0,0x12b3,0x1317)]['sticker'])['map'](_0x3027fc=>_0x3027fc[_0x17318e(0x80e,0x12f6,0x110a,0xe22)+'id'])['reduce']((_0x5f2e72,_0x2d4140)=>[..._0x5f2e72,..._0x2d4140],[])});}break;case _0x295ea5[_0x425890(0x1328,0x1634,0x16b0,0x1d25)]:{if(_0x295ea5['LEkmo'](_0x295ea5[_0x17318e(0x16dc,0x6f6,0x14b1,0xcdb)],_0x295ea5[_0x17318e(0x891,0x152f,0xdf2,0xcdb)]))_0x295ea5[_0x425890(0x19e7,0x1313,0x1c18,0x1dad)](_0x537fe6,_0x6ee149[_0x17318e(0x1374,0x1067,0xdfd,0xc86)],_0x5b9f0a);else{if(!_0x193cb6)return _0x295ea5['jAYHg'](_0x51481c,''+mess['owner']);if(!_0x17aa6d[_0x425890(0x740,0x807,0x110f,0xc08)])return _0x295ea5['zYqJI'](_0xcd1d32,'Reply\x20Mess'+_0x17318e(0x6d8,0xc0,0x582,0x961));if(!_0x17aa6d[_0x425890(0x39d,0x807,0x672,0x981)][_0x17318e(0x107d,0xd54,0x1e32,0x17d1)])return _0xcd1d32(_0x425890(0x112c,0x814,0xc4b,-0xff)+_0x425890(0x754,0x2f5,0x72e,-0x3c6));let _0x2d24f4=_0x17aa6d[_0x425890(0xeed,0x807,0x3c1,0x61d)]['fileSha256'][_0x425890(0x941,0x9cc,0x1210,0xa62)](_0x17318e(0xe2a,0xba3,0xfec,0xb27));if(!(_0x2d24f4 in global['db']['data'][_0x425890(0x946,0xe57,0x1798,0xe1b)]))return _0x295ea5[_0x17318e(0x1363,0x1fae,0xdc2,0x175e)](_0xcd1d32,'Hash\x20Not\x20F'+_0x17318e(0x258,0x12cd,0x42b,0x83c)+'e\x20Database');global['db'][_0x17318e(0x9c2,0x588,0x142b,0xced)][_0x425890(0x13cf,0xe57,0xaf0,0x14b1)][_0x2d24f4]['locked']=!/^un/i['test'](_0x1cbc75),_0xcd1d32(_0x295ea5[_0x425890(0x17c7,0xe48,0x138a,0x7c3)]);}}break;case _0x295ea5[_0x425890(0xc7b,0xc5d,0xf3c,0x573)]:{if(!_0x17aa6d[_0x17318e(0xd2c,0x45d,0xb20,0xa24)])return _0x295ea5[_0x17318e(0x8f3,0x1752,0x15fa,0xdd8)](_0xcd1d32,'Reply\x20Mess'+'age\x20You\x20Wa'+_0x425890(0x2dd,0x63b,0x8ec,0x1ca)+_0x17318e(0x1839,0xb4e,0xdbc,0x140b)+'se');if(!_0x116129)return _0xcd1d32('Example\x20:\x20'+_0x295ea5[_0x425890(0x13f5,0xb71,0xce7,0x8f2)](_0x4fea53,_0x1cbc75)+_0x17318e(0xec2,0x9f8,0xee0,0xba0));let _0x35f14e=global['db'][_0x17318e(0xfa0,0xd18,0x512,0xced)][_0x17318e(0x10c2,0xb86,0xdda,0x822)];if(_0x116129[_0x17318e(0x16da,0x909,0x8c4,0xd56)+'e']()in _0x35f14e)return _0xcd1d32('\x27'+_0x116129+(_0x17318e(0xe24,0x1ca8,0x1ab7,0x15ce)+_0x425890(0x166d,0xfc2,0x157e,0x1926)+_0x425890(0x58e,0x8cf,0x268,0x612)+_0x17318e(0x471,0x7e4,-0x41d,0x342)+'t'));_0x35f14e[_0x116129[_0x425890(0x139d,0xb39,0xcea,0xb0)+'e']()]=_0x4413ec['fakeObj'],_0xcd1d32(_0x17318e(0x1462,0x1100,0x13ae,0x12e2)+_0x425890(0x1394,0xeaf,0x1050,0x190f)+_0x425890(0x15cd,0x1254,0x12b0,0xefd)+_0x17318e(0x2bc,0xb52,0x106b,0x669)+_0x425890(0x393,0xa3e,-0x17,0xdd0)+_0x116129+(_0x425890(-0x654,0x31f,-0x128,0x5bc)+_0x425890(0x111f,0x1384,0x10ae,0x1d07))+_0x4fea53+_0x17318e(0x1147,0x1690,0xddb,0xf2a)+_0x116129+('\x0a\x0aView\x20Lis'+_0x17318e(0x1f1c,0x17ed,0x1cbd,0x16da)+_0x17318e(0xfe0,0x2109,0x179d,0x17ab))+_0x4fea53+_0x425890(0x1abd,0x14d3,0xda6,0x1022));}break;case'getmsg':{if(!_0x116129)return _0x295ea5['BqXsm'](_0xcd1d32,_0x17318e(0x14f2,0xc62,0x1116,0xd25)+_0x295ea5[_0x17318e(0xff7,0x152,0x4f4,0x7be)](_0x4fea53,_0x1cbc75)+(_0x425890(0xc42,0x4fb,0x452,0xcf7)+'\x0a\x0aView\x20Mes'+_0x17318e(0x1421,0xdbc,0x17d1,0x1474)+'With\x20')+_0x4fea53+'listmsg');let _0x18a59e=global['db'][_0x425890(0x6fb,0xad0,0x699,0x14a7)]['database'];if(!_0x295ea5[_0x425890(0xc6a,0x1001,0x1005,0x1418)](_0x116129[_0x17318e(0x4ac,0x442,0x452,0xd56)+'e'](),_0x18a59e))return _0xcd1d32('\x27'+_0x116129+('\x27\x20Not\x20List'+'ed\x20In\x20The\x20'+_0x17318e(0x99d,0xd11,0xbfe,0x669)+'st'));_0x3797bd['copyNForwa'+'rd'](_0x17aa6d['chat'],_0x18a59e[_0x116129[_0x17318e(0xe58,0x1797,0x15b8,0xd56)+'e']()],!![]);}break;case _0x295ea5[_0x425890(0x1685,0xd4c,0xb33,0xc65)]:{if(_0x295ea5[_0x425890(0x176f,0x10c4,0x121c,0xc2e)](_0x295ea5['UaCDz'],_0x295ea5[_0x425890(0xd08,0x1029,0x647,0x15bf)])){let _0x10abd4=JSON[_0x425890(0xc4a,0x10eb,0x1189,0x114e)](fs[_0x17318e(0x453,0x10fe,0x693,0xc73)+'nc'](_0x295ea5[_0x17318e(0x11c9,0x1a58,0x148d,0x16a0)])),_0x4fcfbc=Object[_0x425890(0x1389,0xd4f,0x631,0x169a)](global['db'][_0x17318e(0xabe,0xc72,0x6d6,0xced)][_0x425890(-0x34c,0x605,0x501,0xdd7)])[_0x17318e(0x44a,0x7a0,0x1148,0xd8c)](([_0x3d0767,_0x5034f3])=>{function _0x36b1ec(_0x49992f,_0xb26756,_0x54400a,_0x20856d){return _0x425890(_0x20856d,_0xb26756- -0x11,_0x54400a-0x81,_0x20856d-0x1e3);}const _0x48dca1={'KpCKp':function(_0x5c9822,_0x146ee9){return _0x5c9822(_0x146ee9);},'HWjfj':_0x295ea5['kdbRw']};function _0x16a956(_0x23b959,_0x4ed61f,_0x23f33b,_0x4067b5){return _0x425890(_0x23b959,_0x4ed61f- -0x3b9,_0x23f33b-0x128,_0x4067b5-0x8b);}if(_0x295ea5[_0x16a956(0xd91,0xa7c,0xb31,0x74f)](_0x295ea5[_0x36b1ec(0x83f,0x953,0xc62,0x117d)],_0x295ea5['sbRYX'])){_0x56ffac[_0x36b1ec(0xb29,0xaed,0x5cf,0xa76)]=_0x4c5223[_0x16a956(-0x45e,0x600,0xe83,-0x258)](_0x305a2f[_0x16a956(-0x67,-0x1d1,-0xc6,-0xa10)][_0x36b1ec(0x147f,0xb28,0x81d,0xaeb)+'e']())[0x14c6+-0x4*0xec+0x1e6*-0x9],_0x4d5d77[_0x16a956(0x78c,0x612,0x55d,0x43d)]=_0x2a27ca[_0x36b1ec(-0x71e,0x1d7,0x63,0xc26)],_0x48dca1[_0x16a956(0x389,-0x155,0x30,-0xfd)](_0x16b7f0,_0x36b1ec(0xe56,0xfaa,0x611,0x5ee)+_0x16a956(0x19cc,0x11b5,0xbe3,0x1a84)+_0xf13368['text']+'\x20'+(!_0x3e459c['pilih']?_0x36b1ec(0x4fb,0x4c1,0xed7,0x413)+_0x16a956(0x1068,0x5f1,0x690,0x14c)+_0x36b1ec(0x693,0x9f6,0x911,0x186)+_0x36b1ec(0x105b,0x10b2,0x1259,0xdce):''));if(!_0x3e055c[_0x36b1ec(0x763,0x79e,0xb94,0x10ad)])_0xd2e38c[_0x36b1ec(0x1b2f,0x12a1,0x158d,0x191b)](_0x4f1744['p'],_0x48dca1[_0x16a956(0xa9d,0x9bf,0x1152,-0xb2)],-0x35f*-0x5+-0x775*0x1+0x6*-0x191);}else{const _0x1b6a01={'nama':_0x3d0767,..._0x5034f3};return _0x1b6a01;}}),_0xce182d=_0x17318e(0x47b,0xf91,0x61e,0xb09)+_0x17318e(0x110d,0x1259,0xd1e,0xb5b);for(let _0x28064a of _0x4fcfbc){_0xce182d+=_0x17318e(0x9c8,0xaf7,0x168c,0xe83)+'\x20'+_0x28064a[_0x425890(0x1099,0x111e,0xb6f,0x1794)]+(_0x425890(0x1e46,0x13dc,0x128c,0x1773)+'*\x20')+_0x295ea5[_0x17318e(0xc49,0x13b8,0x1207,0x1650)](getContentType,_0x28064a[_0x425890(0x273,0x7c3,0x105c,0x1230)])[_0x17318e(0x514,0x49a,0xb25,0x82e)](/Message/i,'')+(_0x425890(0x13d0,0x12fc,0x17a3,0x1d0f)+_0x17318e(0x832,0x845,0x1846,0xf07)+_0x425890(0x1ddf,0x13fd,0x1112,0x1e3d));}_0x295ea5[_0x17318e(0x196f,0x1457,0x18d2,0x1556)](_0xcd1d32,_0xce182d);}else{if(!_0x42b8a2[_0x425890(0x9af,0x7af,0x319,0x88)]&&!_0x22bf48[_0x425890(0x93c,0xafe,0xaa5,0x680)])_0x772474['sendText'](_0x5dc9bf['chat'],'Both\x20Playe'+_0x425890(0x17d1,0x11a4,0x1938,0x12db)+_0x17318e(-0x2ae,0xd76,0x2ae,0x629)+_0x17318e(0x1570,0x15b3,0xd74,0x1088)+'nceled');else(!_0x57e902[_0x425890(0x1146,0x7af,-0x1db,-0x217)]||!_0x562fe3[_0x17318e(0x583,0x54f,0x295,0xd1b)])&&(_0x54841b=!_0x14c705[_0x425890(0x34,0x7af,0x903,0xc87)]?_0x3fbe96['p2']:_0x46996b['p'],_0x52b359[_0x425890(0x24,0x58a,0xfb5,0x697)+_0x17318e(0x1292,0x13c2,0xc6d,0x11b5)](_0xf091e5[_0x17318e(0xc39,0x4cb,0x146f,0xee4)],'@'+(_0xafdad[_0x425890(0xade,0x7af,0xe78,0xd87)]?_0x26ace2['p2']:_0x3c7351['p'])['split']`@`[0x505+0xe98*-0x1+0x3*0x331]+(_0x17318e(0xb1f,0x1106,0x10d9,0x1543)+_0x425890(0xb55,0xe1c,0x10af,0xa03)+_0x17318e(0x2e6,0x2ea,0x2bd,0x6c1)+'!'),_0x1e888d));return delete this[_0x17318e(0x236,-0x528,-0x3ee,0x55a)][_0x587965['id']],!(0x1221+-0xc91+-0x590);}}break;case'delmsg':case _0x295ea5['juGSH']:{if(_0x295ea5[_0x17318e(0x12e3,0xb0a,0x18ec,0xebb)]===_0x295ea5[_0x17318e(0x10de,0x5e0,0xd7e,0xebb)]){let _0xb4550d=global['db']['data'][_0x17318e(0x307,0xb01,0xeaa,0x822)];if(!(_0x116129[_0x17318e(0x808,0x84f,0x6f9,0xd56)+'e']()in _0xb4550d))return _0x295ea5[_0x17318e(0xacc,0xff8,0x434,0x591)](_0xcd1d32,'\x27'+_0x116129+(_0x17318e(0x694,0x89c,0x433,0xe2f)+_0x17318e(0x1352,0x63d,0xa3e,0xa38)+_0x17318e(0x670,0x210,0x385,0x669)+'st'));delete _0xb4550d[_0x116129[_0x17318e(0x1244,0x143a,0xa86,0xd56)+'e']()],_0x295ea5[_0x17318e(0x106c,-0x97,0x211,0x969)](_0xcd1d32,_0x425890(-0x130,0x249,-0x83f,0x1c9)+'cessfully\x20'+'\x27'+_0x116129+(_0x17318e(0x98d,0x12d7,0x462,0xbb7)+_0x425890(-0x2b8,0x665,-0x23d,0xc06)+_0x425890(0xbea,0x1137,0x1937,0x118d)));}else{let {stdout:_0x1893e4,stderr:_0xbc36c3}=_0x1ff9d4;if(_0x1893e4[_0x17318e(0xa9c,0x3f8,0x198,0x769)]())_0x295ea5['zhyEY'](_0x5f1bea,_0x1893e4);if(_0xbc36c3[_0x17318e(0x6ae,0xd4d,0x942,0x769)]())_0x295ea5['fXJJm'](_0x129a85,_0xbc36c3);}}break;case _0x295ea5[_0x17318e(0x659,0xdef,0xe51,0xf5a)]:{if(_0x17aa6d[_0x425890(-0x642,0x315,-0x282,-0x244)])return _0x295ea5[_0x17318e(0x17d2,0x886,0x18bb,0xf4e)](_0xcd1d32,_0x295ea5['VvmHy']);this[_0x17318e(0x1156,0x1cff,0xde6,0x148d)]=this[_0x17318e(0x147e,0x13d1,0x1643,0x148d)]?this[_0x425890(0x1965,0x1270,0xd70,0x1311)]:{};const _0x231d0f={};_0x231d0f['displayTex'+'t']=_0x295ea5[_0x425890(0x6df,0x1155,0xebf,0x173e)];const _0x2c3e09={};_0x2c3e09[_0x425890(0x114a,0xf77,0x19a0,0x189a)]=_0x17318e(0xee9,0x591,0x5c5,0xd5b),_0x2c3e09['buttonText']=_0x231d0f,_0x2c3e09[_0x17318e(0x111b,0x101b,0x1068,0x1638)]=0x1;let _0x37c813=[_0x2c3e09];_0x3797bd[_0x425890(0xb27,0x10a7,0x1425,0x9ce)+_0x425890(0x1007,0xcec,0x58a,0xda2)](_0x17aa6d[_0x17318e(0x6c8,0x8c0,0x869,0xee4)],_0x37c813,_0x425890(0x1337,0xf84,0xad1,0xc18)+await _0x3797bd[_0x17318e(0x7ed,0x128,0x139,0x4fc)](_0x17aa6d['sender'])+(_0x17318e(-0x366,0x4,0x19,0x5c3)+_0x17318e(0x1e3b,0xbcf,0x1e60,0x14f8)+'s\x20Chat\x0a\x0aCl'+_0x17318e(0x2095,0x17b1,0xcc1,0x1600)+_0x17318e(0xa62,0x17c,0xb80,0x50b)+_0x425890(0xd15,0x974,0x11fa,0x3da)+_0x425890(0xaaf,0x12d4,0x8d3,0x17e3)+'`'),_0x3797bd[_0x17318e(0x93c,0x1962,0xc2e,0x12db)]['name'],_0x17aa6d);}break;case _0x295ea5[_0x17318e(0xd05,0x14d5,0x16b5,0x14d0)]:case _0x295ea5['haEWx']:{if(_0x295ea5['LogFF']===_0x295ea5[_0x425890(0x4bc,0x2f4,-0x796,0x581)]){if(_0x17aa6d[_0x17318e(0xbbc,-0x311,0x664,0x532)])return _0xcd1d32(_0x425890(0x7a5,0x4a7,0xb8d,-0x3b0)+'annot\x20Be\x20U'+'sed\x20For\x20Gr'+_0x425890(0x1ad7,0x13ef,0x19da,0xfd0));this[_0x17318e(0x1c87,0x1097,0x167f,0x148d)]=this[_0x17318e(0xaf5,0x1b07,0x1198,0x148d)]?this['anonymous']:{};let _0x2ccd01=Object['values'](this[_0x425890(0xc16,0x1270,0x10d9,0x1269)])[_0x425890(0x143e,0x11b1,0x15df,0x12ea)](_0x6c96ee=>_0x6c96ee[_0x425890(0xd25,0xe36,0x1781,0x80b)](_0x17aa6d['sender']));if(!_0x2ccd01){const _0x254fb2={};_0x254fb2['buttonId']=_0x295ea5[_0x425890(0x802,0x3a0,-0x5bb,0x5b2)],_0x254fb2[_0x17318e(0x185c,0x11cc,0xc38,0x1318)]={},_0x254fb2[_0x17318e(0x1d86,0xc51,0x1a82,0x1638)]=0x1,_0x254fb2[_0x17318e(0x185c,0x11cc,0xc38,0x1318)][_0x425890(0xe89,0x10a0,0xd6a,0x12e8)+'t']=_0x295ea5[_0x425890(0x12f2,0x1155,0xcea,0x998)];let _0x3e6364=[_0x254fb2];await _0x3797bd[_0x425890(0xf4f,0x10a7,0x1950,0x14c9)+_0x425890(0x488,0xcec,0x131f,0x510)](_0x17aa6d[_0x425890(0x451,0xcc7,0x4d7,0xd5d)],_0x3e6364,_0x17318e(0x1594,0xd23,0xd0c,0xd47)+_0x17318e(0x1d0b,0x131c,0xeda,0x1536)+_0x425890(0xdba,0xe8c,0x12fb,0xeec)+_0x17318e(0xa22,0xc57,0x69f,0xf0f)+'Press\x20The\x20'+'Button\x20To\x20'+'Find\x20A\x20Par'+_0x425890(0xf3c,0xa94,0x300,0x14be)),_0x295ea5[_0x17318e(0xbac,-0x82,0x1073,0x71b)](_0xcd1d32,![]);}_0x295ea5[_0x17318e(0x3f9,0x229,0x2a8,0x887)](_0xcd1d32,'Ok');let _0x22a88c=_0x2ccd01[_0x17318e(0x1e21,0x15e1,0x1216,0x16b9)](_0x17aa6d[_0x17318e(0xc57,0xf3f,0x1e9,0xc86)]);if(_0x22a88c)await _0x3797bd[_0x425890(0x822,0x12b2,0x1d3e,0x11b9)](_0x22a88c,_0x17318e(0x1778,0x169f,0x11d2,0xfbf)+_0x17318e(0x13f,0x833,0x653,0x689)+_0x425890(0xbf7,0x4a3,0x898,0x389)+_0x425890(0x24b,0x189,0x50,0xac1),_0x17aa6d);delete this[_0x425890(0x1c71,0x1270,0x170c,0x19ce)][_0x2ccd01['id']];if(_0x295ea5[_0x425890(0x690,0xe4b,0x14a7,0xa05)](_0x1cbc75,'leave'))break;}else _0x295ea5[_0x17318e(0x302,-0x631,-0x17c,0x468)](_0x748efc,'🤭🌹Hi,\x0aI\x20am'+_0x17318e(0x107c,0x1117,0x17d2,0x1112)+_0x17318e(0x375,0xeb5,0x73d,0x447)+_0x425890(0xb61,0x2bd,0x2f6,-0x5a7)+'K.Prabhash'+_0x425890(0x13d4,0xdaf,0x744,0x589)+_0x17318e(0xb57,0xd51,0x60b,0xb48)+_0x17318e(0x1235,0x11d0,0x15b8,0x1002));}case _0x295ea5[_0x17318e(0xd6e,0x1c40,0x7e6,0x11d3)]:case _0x295ea5[_0x425890(0x5e2,0x3a0,0xb53,0xd69)]:{if(_0x295ea5[_0x17318e(0xd21,0xfd4,0x9f7,0x7a6)](_0x295ea5[_0x425890(0x32a,0x256,0x801,0x485)],_0x295ea5[_0x17318e(0x20e,0x748,0x9a9,0x473)]))_0x295ea5[_0x425890(0x1179,0xbc5,0x575,0x629)](_0x598635,_0x17318e(0x1ee5,0x12f6,0x135e,0x16e1)+_0x425890(-0x13,0x661,0x2ca,0x307));else{if(_0x17aa6d[_0x425890(0x12,0x315,0x3a3,0x8e5)])return _0xcd1d32(_0x295ea5[_0x425890(0xde0,0x6fe,0xc2e,0x494)]);this[_0x425890(0x19c8,0x1270,0xa9e,0x119d)]=this[_0x17318e(0xb9f,0xbbe,0xa92,0x148d)]?this['anonymous']:{};if(Object['values'](this[_0x425890(0x18d9,0x1270,0x10a9,0xc33)])[_0x17318e(0x158d,0x11b0,0xd1a,0x13ce)](_0x19f710=>_0x19f710[_0x17318e(0x1222,0x966,0xa42,0x1053)](_0x17aa6d[_0x17318e(0x942,0x12f8,0x15cf,0xc86)]))){const _0x20b385={};_0x20b385[_0x425890(0x8b0,0xf77,0x12ee,0x6f9)]=_0x295ea5[_0x425890(0xbca,0x12b3,0xdb9,0x1838)],_0x20b385[_0x17318e(0x11b0,0x1b6c,0x1875,0x1318)]={},_0x20b385[_0x17318e(0x1e77,0xe12,0xbe4,0x1638)]=0x1,_0x20b385[_0x17318e(0x11b0,0x1b6c,0x1875,0x1318)][_0x425890(0x7be,0x10a0,0xaec,0x10fd)+'t']=_0x295ea5[_0x17318e(0x13dd,0x163c,0x4c4,0xd52)];let _0x2a983d=[_0x20b385];await _0x3797bd[_0x17318e(0x1175,0xd13,0xccc,0x12c4)+_0x425890(0x16a0,0xcec,0x15b8,0xc51)](_0x17aa6d[_0x425890(0x69b,0xcc7,0x8f6,0x7d8)],_0x2a983d,_0x425890(0x1dd,0xb2a,0x75e,0x43e)+_0x425890(0x136c,0xb33,0xf96,0xce2)+_0x17318e(0x12c2,0xbf4,0xf9a,0x12b2)+_0x425890(0x12e3,0x15f9,0x185f,0x1ed2)+_0x17318e(0x7fc,0x1347,0x170e,0xca0)+_0x425890(0x1cc4,0x1329,0x191c,0x16da)+_0x17318e(0xcc3,0x1d65,0x15a3,0x1392)+_0x425890(0x8e9,0x1040,0xfc2,0x9e9)+'ur\x20Anonymo'+_0x17318e(0x2167,0x1c5a,0x1a7d,0x1816)+'```',_0x3797bd[_0x425890(0x16ff,0x10be,0xceb,0xb8c)]['name'],_0x17aa6d),_0x295ea5[_0x17318e(0x14ed,0xa05,0x147c,0xfa6)](_0xcd1d32,![]);}let _0x2d34d8=Object[_0x425890(-0x509,0x399,-0x47c,0x527)](this[_0x425890(0x1cc8,0x1270,0xa3f,0x19a2)])['find'](_0xb26b40=>_0xb26b40[_0x17318e(0xfea,0x16d9,0xea7,0x1443)]==='WAITING'&&!_0xb26b40['check'](_0x17aa6d[_0x17318e(0x538,0xc09,0xd9b,0xc86)]));if(_0x2d34d8){const _0x3babc4={};_0x3babc4[_0x425890(0x12de,0x10a0,0x807,0x1237)+'t']='⏩Skip⏩';const _0x3223a5={};_0x3223a5[_0x17318e(0xc76,0xf15,0x1517,0x1194)]=_0x295ea5['sXRRS'],_0x3223a5[_0x425890(0x1398,0x10fb,0x1413,0xd8a)]=_0x3babc4,_0x3223a5[_0x425890(0x1c27,0x141b,0x9aa,0xa8a)]=0x1;const _0x45b45d={};_0x45b45d[_0x17318e(0x9b6,0x90b,0x1b75,0x12bd)+'t']='❮❮🛑Stop🛑❯❯';const _0x9776a9={};_0x9776a9[_0x425890(0xe0f,0xf77,0xdde,0x110a)]=_0x295ea5[_0x425890(0x1b8c,0x12b3,0x12bc,0x96a)],_0x9776a9['buttonText']=_0x45b45d,_0x9776a9[_0x425890(0x14e5,0x141b,0x1c61,0x10c1)]=0x1;let _0x39cabb=[_0x3223a5,_0x9776a9];await _0x3797bd[_0x425890(0x8c4,0x10a7,0x87e,0xc2d)+'Text'](_0x2d34d8['a'],_0x39cabb,'```Success'+_0x17318e(0x100a,0x549,0x685,0xc0d)+'d\x20Partner,'+'\x20Now\x20You\x20C'+_0x17318e(0x8c0,0x1c88,0x796,0x1215)+_0x425890(-0x663,0x166,-0x6d3,-0xb7),_0x3797bd['user'][_0x425890(0x110b,0xe82,0x1064,0x9b6)],_0x17aa6d),_0x2d34d8['b']=_0x17aa6d[_0x17318e(0x137f,0x15b8,0x1324,0xc86)],_0x2d34d8['state']=_0x295ea5['ivTcD'],await _0x3797bd[_0x425890(0x19b7,0x10a7,0xdd3,0xca2)+'Text'](_0x2d34d8['b'],_0x39cabb,_0x425890(0x1706,0xd49,0xffa,0xc1f)+_0x425890(0xf5b,0x9f0,0x65e,0x64a)+_0x425890(0xbf4,0xbf7,0xa40,0x15d5)+_0x425890(0x8d4,0x865,0xbb1,0x124c)+'an\x20Send\x20Me'+_0x425890(0x8c4,0x166,0x97b,0xde),_0x3797bd[_0x425890(0xddd,0x10be,0x1609,0xcb6)]['name'],_0x17aa6d);}else{let _0x4aab68=+new Date();this[_0x17318e(0x1524,0x11f8,0x104a,0x148d)][_0x4aab68]={'id':_0x4aab68,'a':_0x17aa6d[_0x17318e(0xef8,0x12ec,0x147b,0xc86)],'b':'','state':_0x295ea5[_0x17318e(0x7b2,0x12a4,0xee7,0x1248)],'check':function(_0x18f07b=''){function _0x29778b(_0x522818,_0xcbc957,_0x3091d9,_0x7ea894){return _0x17318e(_0x522818-0x64,_0x522818,_0x3091d9-0xcf,_0x7ea894- -0x5ac);}function _0x239640(_0x5f22be,_0x503d6a,_0x19799a,_0x37b7f2){return _0x425890(_0x503d6a,_0x37b7f2- -0x2cf,_0x19799a-0x45,_0x37b7f2-0x1b5);}if(_0x295ea5[_0x29778b(0x90,0x297,-0x5a2,0x23d)]!==_0x239640(0x15a0,0x1422,0x66c,0xbcd))return[this['a'],this['b']][_0x239640(0x68d,0xa4a,0x1d8,-0x3e)](_0x18f07b);else{const _0x257123={};_0x257123[_0x29778b(0x1366,0x467,0x1320,0xd11)+'t']=_0x295ea5['vMhbF'];const _0x3c2076={};_0x3c2076[_0x29778b(0x869,0xf66,0x632,0xbe8)]=_0x5a646e+_0x239640(-0x661,0x97d,-0x895,0x30),_0x3c2076['buttonText']=_0x257123,_0x3c2076[_0x239640(0x1897,0x1588,0x1b0f,0x114c)]=0x1;const _0x4df037={};_0x4df037[_0x29778b(0x15e1,0x1325,0x15a5,0xd11)+'t']=_0x295ea5[_0x239640(0x14f,0x11c8,0xdfc,0xa02)];const _0x13eefd={};_0x13eefd['buttonId']=_0x3469fb+_0x29778b(0x72e,0xc0,0x4b4,0x6ba),_0x13eefd[_0x239640(0x917,0xc61,0x1535,0xe2c)]=_0x4df037,_0x13eefd[_0x29778b(0x12d6,0x196b,0x1391,0x108c)]=0x1;const _0x24eca4={};_0x24eca4[_0x29778b(0x10c0,0xf96,0x9ef,0xd11)+'t']=_0x295ea5['hfIkN'];const _0x58e92a={};_0x58e92a[_0x29778b(0x1541,0x1087,0x158d,0xbe8)]=_0x4f9f03+'donate',_0x58e92a[_0x29778b(0x1339,0xcee,0x14df,0xd6c)]=_0x24eca4,_0x58e92a[_0x29778b(0xb44,0xad6,0x12d5,0x108c)]=0x1;let _0x483cd1=[_0x3c2076,_0x13eefd,_0x58e92a],_0x3928ce={'image':{'url':_0x295ea5[_0x29778b(0x17a,-0x54,0x1078,0x904)](_0x2429a5,_0x29778b(0x1488,0xc08,0x153d,0xfa9)+'ger')},'caption':'\x0a┏━❯\x20'+_0x4b3982+(_0x29778b(0x4ac,-0x5ff,-0x3b9,-0x1f4)+'═══💠\x20VOICE'+'\x20CHANGE\x20💠═'+'╗\x09\x0a┃║\x20\x20\x20\x20\x20'+_0x239640(0x78e,0x34,0x54,0x448))+_0x57e3c0+'\x20'+_0x5433e5+(_0x29778b(0x5e8,0x49c,0xc7a,0xbeb)+'y\x20aud]\x0a┃╠')+_0x347461+'\x20'+_0x5d4d66+(_0x29778b(0xe84,0x1907,0x95e,0xfcc)+_0x239640(0x947,0x12a9,0x51d,0x905))+_0x597ecf+'\x20'+_0x5d2f5f+('deep\x20[repl'+'y\x20aud]\x0a┃╠')+_0x431ed8+'\x20'+_0x48b2a5+('earrape\x20[r'+'eply\x20aud]\x0a'+'┃╠')+_0x2520d0+'\x20'+_0x26f1e4+(_0x29778b(0xb58,0x962,0x9a6,0xac7)+_0x29778b(0x6b3,-0x9c9,0x3a7,-0x11c))+_0x348afe+'\x20'+_0x3fd090+(_0x29778b(0x152a,0x11c0,0x117c,0xbbd)+_0x29778b(0x2fe,0x1d9,0x1047,0xa52))+_0x4b626d+'\x20'+_0x8e16f1+(_0x29778b(-0x767,-0x196,-0x4f6,-0x178)+'[reply\x20aud'+_0x239640(0x151a,0x15f,0x15a3,0xb1e))+_0x583dc7+'\x20'+_0x5e0a7c+(_0x239640(0x4d5,0x6a0,0x112c,0xbaf)+_0x239640(0xb3b,0x852,0x110a,0x97e)+'┃╠')+_0x35e338+'\x20'+_0x491444+(_0x29778b(0xfd7,0x1566,0xe40,0x1066)+'ly\x20aud]\x0a┃╠')+_0x54276f+'\x20'+_0x31ed3f+(_0x239640(0xfd2,0x1549,0xd46,0x1267)+_0x29778b(0x472,-0xad1,0x872,-0x11c))+_0x4fb49e+'\x20'+_0x3f96cc+('squirrel\x20['+_0x239640(0xebf,0x1162,0x9b0,0x9cd)+_0x29778b(0x1272,0xdd9,0x15ff,0x1172)+_0x29778b(0x5b9,0x7e2,0xcd4,0x8dc)+'━❯\x20')+_0x40ae28+'\x20❮━😎','footer':_0x41ca8b[_0x239640(0xa97,0xf87,0xf89,0xdef)][_0x239640(0x1591,0xd8e,0xb68,0xbb3)],'buttons':_0x483cd1,'headerType':0x4};const _0x557f7a={};_0x557f7a['quoted']=_0x23ad93,_0x2d3ab2[_0x29778b(-0x94,0x4af,-0x5ed,0x90)+'e'](_0x5185ae[_0x239640(0x9fd,0x126,0x510,0x9f8)],_0x3928ce,_0x557f7a);}},'other':function(_0x5de55a=''){function _0x3ae018(_0x49c2cf,_0x1efb37,_0x333cf7,_0x3e94bd){return _0x17318e(_0x49c2cf-0x1df,_0x49c2cf,_0x333cf7-0x2e,_0x1efb37- -0x286);}return _0x5de55a===this['a']?this['b']:_0x295ea5[_0x3ae018(0xaba,0x3b4,0xa26,0x934)](_0x5de55a,this['b'])?this['a']:'';}};const _0x3acee3={};_0x3acee3[_0x17318e(0xd97,0x13d5,0x1b66,0x1194)]=_0x295ea5['QoiNP'],_0x3acee3[_0x17318e(0x1100,0x136c,0xbb4,0x1318)]={},_0x3acee3[_0x17318e(0x20b3,0x18dd,0x151b,0x1638)]=0x1,_0x3acee3[_0x17318e(0x1100,0x136c,0xbb4,0x1318)]['displayTex'+'t']=_0x295ea5[_0x17318e(0x7d7,0x7fe,0xe95,0x554)];let _0x577215=[_0x3acee3];await _0x3797bd[_0x17318e(0x1642,0xee1,0xdab,0x12c4)+'Text'](_0x17aa6d[_0x425890(0x4c3,0xcc7,0xa9e,0x15de)],_0x577215,_0x425890(-0x11a,0x61a,0xb57,-0x2b0)+'Wait,\x20Look'+'ing\x20For\x20A\x20'+_0x425890(0x488,0xb9b,0x507,0x237),_0x3797bd['user'][_0x425890(0x472,0xe82,0x171e,0xa4f)],_0x17aa6d);}break;}}case _0x425890(0x140e,0x1371,0xa2b,0x1b4e):case _0x295ea5[_0x425890(0x15be,0x159c,0x1853,0x16a1)]:{if(_0x295ea5[_0x425890(0xbce,0x10bd,0xdce,0x1891)]!=='MhTmU'){let _0x103665=_0x5fddb8['db'][_0x425890(0xf19,0xad0,0x70,0x1063)][_0x425890(0xb4a,0x605,0x82c,-0x434)];if(!_0x295ea5[_0x425890(0xa73,0x1001,0x1071,0x15c4)](_0x4b1266[_0x17318e(0x38f,0x1015,0x89b,0xd56)+'e'](),_0x103665))return _0x295ea5[_0x17318e(0x167c,0x97c,0x8eb,0x117f)](_0x1466c0,'\x27'+_0x21ac07+(_0x17318e(0xda6,0x103c,0x563,0xe2f)+_0x17318e(0x10e2,0x1478,0x1046,0xa38)+_0x425890(0x9b5,0x44c,0xa7b,0xc08)+'st'));delete _0x103665[_0x3fe147[_0x425890(0x101b,0xb39,0x74c,0xe7d)+'e']()],_0x295ea5[_0x425890(0x1b92,0x1471,0x17a1,0x12a2)](_0x3a8f,_0x425890(0xc64,0x249,-0x324,0xa3)+_0x425890(0x1168,0x8f6,0xffc,0x1257)+'\x27'+_0x1988d0+('\x27\x20From\x20The'+_0x425890(0x30b,0x665,0x869,0xb8d)+_0x17318e(0xce5,0x119e,0x1050,0x1354)));}else{if(_0x17aa6d[_0x17318e(-0x40,0xbe0,0x956,0x532)])return _0x295ea5[_0x17318e(0x140e,0x126a,0x14b9,0x1456)](_0xcd1d32,_0x295ea5[_0x425890(0x1089,0x6fe,0x3b4,0xa60)]);this[_0x17318e(0x15d5,0xcf5,0xee1,0x148d)]=this['anonymous']?this[_0x17318e(0x1953,0x129c,0x15eb,0x148d)]:{};let _0x32b8dd=Object[_0x17318e(0x724,0x8de,0xedf,0x5b6)](this[_0x425890(0xe82,0x1270,0x10ef,0x198d)])[_0x17318e(0x11ea,0x1c15,0x18cb,0x13ce)](_0x53bc7a=>_0x53bc7a['check'](_0x17aa6d[_0x17318e(0xe43,0xc82,0x14ec,0xc86)]));if(!_0x32b8dd){if(_0x295ea5[_0x425890(0x16d3,0x11b6,0x18c7,0x17a8)](_0x295ea5['TbWBJ'],_0x295ea5[_0x425890(-0xda,0x2e9,0x8e0,0x5a9)])){const _0x2df6ab={};_0x2df6ab[_0x425890(0xd90,0x10a0,0x15b1,0x7b2)+'t']=_0x295ea5[_0x17318e(0x97d,0xe8a,0x1d7d,0x1372)];const _0x5ce728={};_0x5ce728['buttonId']='start',_0x5ce728[_0x425890(0x10ab,0x10fb,0xdbc,0x9d1)]=_0x2df6ab,_0x5ce728['type']=0x1;let _0x4d6e37=[_0x5ce728];await _0x3797bd[_0x425890(0xc57,0x10a7,0x14d3,0xeca)+'Text'](_0x17aa6d[_0x425890(0x156b,0xcc7,0xdd0,0xe20)],_0x4d6e37,_0x425890(0x87f,0xb2a,0x7dc,0x1061)+_0x425890(0x1c3c,0x1319,0x1bb2,0x1cf6)+_0x425890(0x6b1,0xe8c,0x9e0,0xf74)+'\x20Session,\x20'+_0x17318e(0x1d8d,0x10ba,0x15c1,0x12f7)+'Button\x20To\x20'+_0x17318e(0x1a50,0x1363,0x1f05,0x1476)+'tner```'),_0x295ea5['UVYzB'](_0xcd1d32,![]);}else{const _0x5c672f={};_0x5c672f[_0x425890(0xa1a,0x10a0,0x7ec,0x19fd)+'t']=_0x295ea5['spClB'];const _0x7ec311={};_0x7ec311[_0x17318e(0x18d8,0x9b3,0x188a,0x1194)]=_0x431649+_0x17318e(0x536,0x1309,0xac8,0xc66),_0x7ec311['buttonText']=_0x5c672f,_0x7ec311[_0x17318e(0x1afc,0x189e,0xec7,0x1638)]=0x1;const _0x389e90={};_0x389e90[_0x425890(0x1874,0x10a0,0x1a39,0x15c4)+'t']=_0x295ea5[_0x17318e(0x573,0x29b,0xc2a,0x5a1)];const _0x28e64f={};_0x28e64f[_0x425890(0x13d3,0xf77,0xfe9,0x1188)]=_0x1feb24+_0x17318e(0x16e0,0x1d51,0x20ad,0x1751),_0x28e64f[_0x17318e(0xcf4,0x1c8f,0x87d,0x1318)]=_0x389e90,_0x28e64f['type']=0x1;let _0x226e71=[_0x7ec311,_0x28e64f];const _0x821c92={};_0x821c92['url']=_0x82736a+_0x295ea5['XFxmd'];const _0xb29748={};_0xb29748[_0x17318e(0x794,0x22a,0x804,0x59e)]=_0x821c92,_0xb29748[_0x17318e(-0x161,0x76e,0x691,0x527)]=_0x425890(0x6d1,0x2ae,0xbe9,0x118)+_0x4a7fde+(_0x17318e(-0x607,-0x575,0xaf6,0x3b8)+_0x425890(0xf7e,0x5b5,0x3d5,0x8b9)+_0x17318e(0x1716,0x97a,0xae1,0x10e6))+_0x4c3e8f+'\x20'+_0x3d3ecf+(_0x17318e(0xd11,0xd5e,0x116b,0x1333)+_0x425890(0x23d,0x5c8,0x8b4,0xda0)+_0x425890(0x8fc,0x7f6,0x89c,0xf6e))+_0x33c4a5+'\x20'+_0x443566+(_0x17318e(0x18d2,0xa9b,0x1ade,0x1505)+'s\x20bot\x20work'+_0x17318e(0x1105,0x965,0x422,0xe91))+_0x2e1966+'\x20'+_0x34acf3+(_0x17318e(0xb58,0x646,0xb7a,0x6e1)+_0x425890(0xa0b,0x2b0,0xaf1,-0x168)+'date)\x0a┃╠')+_0x20476b+'\x20'+_0x1f7a76+'info\x0a┃╠'+_0x1a1449+'\x20'+_0x4c76cb+'script\x0a┃╠'+_0x1da550+'\x20'+_0x4669bf+(_0x425890(0xa64,0xbbc,0xfbc,0x206)+'┃╠')+_0x4cdeb1+'\x20'+_0x4e6cb+_0x17318e(-0x6d2,-0x5e3,0x7fc,0x37e)+_0x1a67d4+'\x20'+_0x296291+_0x17318e(0x167c,0x1d87,0x1dd2,0x17c7)+_0x1e7dc6+'\x20'+_0x35bcc2+_0x425890(0xad1,0x18a,0x56c,-0x2ba)+_0x25b0e7+'\x20'+_0x2bd183+_0x17318e(0x1107,0x753,0x135a,0xd63)+_0x1ed7f8+'\x20'+_0x255a45+('chatinfo\x0a┃'+'╠')+_0x45dab7+'\x20'+_0x3623fd+_0x17318e(0x13a8,0x708,0x975,0x94c)+_0x32e123+'\x20'+_0x5e35cf+_0x17318e(0xa79,0xd95,0x144e,0xf70)+_0x502d5f+'\x20'+_0x792cbb+(_0x17318e(0xc46,0x1263,0x1764,0x1041)+_0x17318e(0x1f47,0x1a1b,0x2064,0x1691))+_0x31c847+'\x20'+_0x1c8135+(_0x17318e(0x18b5,0x1039,0x1c7d,0x13cb)+_0x17318e(0xa0c,0xb56,0x158a,0xb3c)+_0x17318e(0x1103,0x1009,0x1681,0xc76)+'\x20')+_0x576db6+_0x17318e(0x44a,-0x12,-0x45f,0x5a0),_0xb29748['footer']=_0x43fd28[_0x17318e(0x12b0,0xe6b,0x1c68,0x12db)][_0x17318e(0x1781,0x1a7f,0xdc6,0x109f)],_0xb29748[_0x425890(0x7f4,0xf61,0xc6a,0x16a2)]=_0x226e71,_0xb29748['headerType']=0x4;let _0x58814b=_0xb29748;const _0x250eb5={};_0x250eb5['quoted']=_0xba64fd,_0x364150[_0x425890(0x2c4,0x41f,0xe2b,0x58f)+'e'](_0x3dc237[_0x17318e(0x14cf,0x11ce,0x98e,0xee4)],_0x58814b,_0x250eb5);}}let _0x35bdd4=_0x32b8dd['other'](_0x17aa6d[_0x17318e(0x92a,0xfe6,0x1432,0xc86)]);if(_0x35bdd4)await _0x3797bd[_0x17318e(0x1125,0x1b68,0x1ad9,0x14cf)](_0x35bdd4,_0x17318e(0x1756,0x9bc,0xd60,0xfbf)+_0x425890(-0x2eb,0x46c,-0x346,-0x158)+_0x425890(0xe61,0x4a3,-0x373,0xe54)+_0x17318e(0x53c,0x45a,0x959,0x3a6),_0x17aa6d);delete this[_0x17318e(0xa4e,0x1d3b,0x19fb,0x148d)][_0x32b8dd['id']];let _0x4689b8=Object[_0x425890(0xadc,0x399,-0x2be,-0x14d)](this['anonymous'])[_0x425890(0x779,0x11b1,0x839,0x143b)](_0x5e0f32=>_0x5e0f32[_0x425890(0x1b54,0x1226,0x14e6,0xfe4)]==='WAITING'&&!_0x5e0f32[_0x425890(0x16b5,0xe36,0xd4b,0x161d)](_0x17aa6d[_0x425890(0x1038,0xa69,0xd75,0x37)]));if(_0x4689b8){if(_0x295ea5[_0x17318e(0x91,0x4ab,0x582,0x371)]===_0x295ea5['fkRch']){const _0x55e185={};_0x55e185['archive']=![],_0x3a66c7[_0x425890(0x183f,0xf99,0x122f,0x887)](_0x55e185,_0x589e95['chat'],[])[_0x425890(0x336,0x1b3,-0x397,-0x50)](_0x48ce67=>_0x2ade0d(_0x1d8e0b(_0x48ce67)))['catch'](_0x1e6c63=>_0x17902f(_0x5d7529(_0x1e6c63)));}else{const _0x124844={};_0x124844[_0x425890(0x116d,0xf77,0xc3a,0x1088)]=_0x295ea5[_0x17318e(0x4de,0x473,-0x1b,0x364)],_0x124844[_0x17318e(0xf9f,0x9a9,0x1386,0x1318)]={},_0x124844[_0x17318e(0xbc3,0x1fcb,0x11c9,0x1638)]=0x1,_0x124844[_0x17318e(0xf9f,0x9a9,0x1386,0x1318)]['displayTex'+'t']=_0x295ea5[_0x425890(0xd6d,0xa4b,0x30,0x39d)];const _0x424910={};_0x424910['displayTex'+'t']='❮❮🛑Stop🛑❯❯';const _0x533be7={};_0x533be7[_0x425890(0xd4f,0xf77,0x159f,0xf62)]=_0x295ea5[_0x17318e(0x1e90,0x15bf,0x1f18,0x14d0)],_0x533be7['buttonText']=_0x424910,_0x533be7['type']=0x1;let _0x251536=[_0x124844,_0x533be7];await _0x3797bd[_0x425890(0x131b,0x10a7,0x1acc,0x8e5)+_0x17318e(0x1547,0x100a,0xf4f,0xf09)](_0x4689b8['a'],_0x251536,'```Success'+_0x17318e(0x106a,0x4b3,0x1382,0xc0d)+_0x17318e(0xc27,0x128b,0x13ce,0xe14)+_0x425890(0x1280,0x865,0xfbe,0x5f1)+_0x425890(0xa5e,0xff8,0xa2c,0x116f)+_0x17318e(0xb22,-0x5a2,0x95d,0x383),_0x3797bd[_0x17318e(0x1d0a,0xf9d,0x1b61,0x12db)]['name'],_0x17aa6d),_0x4689b8['b']=_0x17aa6d['sender'],_0x4689b8[_0x425890(0x1308,0x1226,0xd88,0x1897)]=_0x17318e(0x6b1,0x1177,0x949,0x110f),await _0x3797bd[_0x17318e(0x1a98,0xe90,0x1b0e,0x12c4)+_0x425890(0xe7f,0xcec,0x10d2,0xa89)](_0x4689b8['b'],_0x251536,_0x17318e(0xaec,0x11a7,0x1427,0xf66)+'fully\x20Foun'+_0x425890(0xbad,0xbf7,0x106f,0x234)+_0x17318e(0x560,0x266,0xddf,0xa82)+_0x425890(0xe9d,0xff8,0x951,0x1a0b)+_0x425890(-0x829,0x166,0x1c3,0xa5e),_0x3797bd['user'][_0x17318e(0x166c,0x1806,0x1596,0x109f)],_0x17aa6d);}}else{if(_0x295ea5[_0x17318e(0xc58,0xa8b,0x1067,0xe51)](_0x295ea5['Nnyab'],'gWrzl'))_0x311d44+=_0x425890(0x8cb,0xc75,0xbcf,0x1418)+_0x42106d['id']['split']('@')[-0x1*0x2000+0x447+0x1bb9]+'\x0a';else{let _0x333d3e=+new Date();this[_0x425890(0xc6f,0x1270,0xd10,0xa7d)][_0x333d3e]={'id':_0x333d3e,'a':_0x17aa6d[_0x17318e(0x941,0x34c,0xdf8,0xc86)],'b':'','state':_0x17318e(0x3a,0x16c,0xb82,0x433),'check':function(_0x5de7ae=''){return[this['a'],this['b']]['includes'](_0x5de7ae);},'other':function(_0x110e90=''){function _0x4a0ac9(_0x153975,_0x37337c,_0x1de8a6,_0x14d616){return _0x425890(_0x37337c,_0x1de8a6- -0x13c,_0x1de8a6-0x0,_0x14d616-0x92);}return _0x295ea5[_0x4a0ac9(0x430,-0x354,0xb7,-0x3a9)](_0x110e90,this['a'])?this['b']:_0x295ea5['zwMdn'](_0x110e90,this['b'])?this['a']:'';}};const _0x328b20={};_0x328b20[_0x425890(0x933,0x10a0,0x15b6,0x18bd)+'t']=_0x425890(0x1a1,0xc2b,0x1294,0x133a);const _0x41b3b9={};_0x41b3b9['buttonId']=_0x295ea5[_0x17318e(0x1b5f,0x18eb,0x11cd,0x14d0)],_0x41b3b9[_0x425890(0x1919,0x10fb,0x12f5,0x13f4)]=_0x328b20,_0x41b3b9[_0x17318e(0x1be5,0x1f58,0xbbb,0x1638)]=0x1;let _0x46ef9b=[_0x41b3b9];await _0x3797bd[_0x17318e(0x1c0b,0x1047,0xcc4,0x12c4)+'Text'](_0x17aa6d[_0x17318e(0xb2b,0x1716,0x98e,0xee4)],_0x46ef9b,_0x425890(0x8be,0x61a,0xa7a,0x397)+_0x17318e(0x4c1,0x210,0x99c,0x5f8)+'ing\x20For\x20A\x20'+_0x425890(0x514,0xb9b,0x999,0x9c3),_0x3797bd[_0x17318e(0xafb,0xe29,0x9c1,0x12db)][_0x425890(0x13d1,0xe82,0x10cf,0xf1a)],_0x17aa6d);}}break;}}case _0x295ea5[_0x425890(0xe3a,0x15ed,0x18b4,0xc34)]:{if(_0x17318e(0x16e8,0x51c,0xbb4,0xed3)===_0x295ea5['kOfBe']){if(!_0x193cb6)return _0x295ea5[_0x17318e(0x6c8,0xd4b,0x2a3,0xa9f)](_0x51481c,''+mess['owner']);_0x3797bd[_0x425890(0xedd,0x1543,0x1985,0xe67)]=!![],_0xcd1d32(_0x295ea5['AGTpi']);}else{const _0x37945c={};_0x37945c['url']=_0x4bb576;const _0x4f70a1={};_0x4f70a1[_0x425890(-0x5c7,0x381,0x613,0xcac)]=_0x37945c,_0x4f70a1[_0x17318e(0xd96,0x43a,0x634,0x527)]=_0x17318e(0xb53,0xc05,0xb1c,0x11e9)+'\x20'+_0x47f6ad[_0x425890(0xdb6,0xff0,0x67a,0x13bc)]+(_0x425890(-0x90,0x39a,0xccb,0x15b)+'\x20:\x20')+_0xfda720[_0x425890(0x9b,0x361,0x99c,0xca)][_0x425890(0xd78,0xe82,0x13d5,0x1896)]+(_0x17318e(0x127b,0xd14,0x1029,0xf75)+'\x20')+_0x17993c[_0x17318e(0x9d6,-0x1b1,0xc54,0x7fb)]+(_0x425890(0x7d5,0x1000,0xf30,0xbaf)+_0x17318e(0x140f,0xd7a,0xf4c,0xaaf))+_0x3a6b2b[_0x17318e(0x8bb,0x724,0x66e,0x527)];const _0x52b455={};_0x52b455[_0x425890(0xe50,0x807,0xc15,0xbc4)]=_0x159955,_0x24b56b[_0x17318e(0xc08,0xaed,0x845,0x63c)+'e'](_0x23bc6f[_0x17318e(0xad6,0x124a,0x171b,0xee4)],_0x4f70a1,_0x52b455);}}break;case _0x425890(0xefc,0x1172,0x139d,0x127a):{if(!_0x193cb6)return _0x51481c(''+mess[_0x17318e(0x16c7,0x179d,0x1908,0x1494)]);_0x3797bd[_0x425890(0xdbc,0x1543,0xe15,0xfdf)]=![],_0xcd1d32(_0x295ea5[_0x17318e(0x1a5e,0xd7c,0x1d5f,0x15ef)]);}break;case _0x295ea5[_0x17318e(0x6f2,0x30f,0x222,0x73a)]:case _0x17318e(0xfb9,0x78b,0xf77,0x621):case _0x295ea5['NTlll']:{if(_0x295ea5[_0x425890(0x12d3,0xb4f,0xd2f,0xb3b)](_0x295ea5[_0x17318e(0xd8b,0x7aa,0xc45,0x690)],_0x295ea5[_0x17318e(0x1cdf,0x154f,0x1386,0x12dd)])){const _0x1aa3c9=process[_0x425890(0xada,0x51b,0x586,-0x3de)+'e'](),_0x2ce86d=os[_0x17318e(0x1849,0xd7e,0x17f7,0x145d)]()[_0x425890(0x13f7,0xb6f,0x5c3,0x37e)](_0x572098=>{function _0x31bc1d(_0xa1b081,_0x477e28,_0x5a2cde,_0x4b4e08){return _0x17318e(_0xa1b081-0x6d,_0x5a2cde,_0x5a2cde-0x1d7,_0x4b4e08- -0x44d);}function _0x6ce629(_0x22b5c9,_0x276888,_0x2215cf,_0x5e812b){return _0x17318e(_0x22b5c9-0xc1,_0x2215cf,_0x2215cf-0xe8,_0x5e812b-0x9e);}if(_0x295ea5[_0x6ce629(0x966,0x1d4e,0xcc3,0x1313)](_0x295ea5['UxNEF'],_0x295ea5[_0x31bc1d(0x3e6,-0x102,-0x61f,0x461)]))_0x230432=_0x15a77b;else return _0x572098[_0x31bc1d(0x143d,0x10a6,0x11d3,0xff9)]=Object['keys'](_0x572098[_0x31bc1d(0x1a8,0x85e,0xfd2,0xc13)])[_0x31bc1d(0xf4,0x349,-0x29c,0x799)]((_0x48e5ea,_0x2741f0)=>_0x48e5ea+_0x572098[_0x6ce629(0x1953,0x700,0x1b55,0x10fe)][_0x2741f0],-0x42b+0x57a+-0x43*0x5),_0x572098;}),_0x50b83d={};_0x50b83d['user']=0x0,_0x50b83d[_0x17318e(0x183c,0x1008,0x1578,0x159c)]=0x0,_0x50b83d[_0x17318e(0xe66,0xd3,0xaa9,0x5cd)]=0x0,_0x50b83d['idle']=0x0,_0x50b83d[_0x17318e(0x8b8,-0x1cf,-0x482,0x36a)]=0x0;const _0x4d3678={};_0x4d3678['speed']=0x0,_0x4d3678[_0x17318e(0x1851,0xd40,0x1ed9,0x1446)]=0x0,_0x4d3678['times']=_0x50b83d;const _0x2c5aae=_0x2ce86d[_0x425890(0x120a,0x9c9,0x921,0xcb9)]((_0x1b9d2a,_0x410506,_0x186a26,{length:_0x59e93d})=>{_0x1b9d2a[_0x5e4dd8(0x1318,0x1a5b,0x12af,0x173e)]+=_0x410506['total'],_0x1b9d2a[_0x5e4dd8(0xe27,0x720,0xfca,0xae6)]+=_0x295ea5[_0x5e4dd8(0x15a3,0x1e49,0x1db9,0xbcb)](_0x410506[_0x39601f(0x9b9,0xf1,0x1011,0x128)],_0x59e93d),_0x1b9d2a['times'][_0x39601f(0xd3f,0xd0f,0x382,0x1380)]+=_0x410506['times'][_0x39601f(0xd3f,0xc9f,0x1759,0x3a6)],_0x1b9d2a[_0x39601f(0xac4,0xaab,0xdc5,0x3aa)][_0x39601f(0x1000,0x7f7,0x12be,0xdcc)]+=_0x410506[_0x39601f(0xac4,0x10db,0xaac,0x68d)]['nice'];function _0x39601f(_0x206529,_0x4d002e,_0x1ca21f,_0xe1285d){return _0x425890(_0x1ca21f,_0x206529- -0x37f,_0x1ca21f-0x7a,_0xe1285d-0x85);}_0x1b9d2a['times'][_0x5e4dd8(0x49f,0xd48,0x9d9,-0x222)]+=_0x410506[_0x5e4dd8(0xf32,0x1379,0x63e,0x188a)][_0x5e4dd8(0x49f,0xcac,-0x26b,-0x255)],_0x1b9d2a['times'][_0x39601f(0x97f,0x471,0x96,0x94)]+=_0x410506[_0x5e4dd8(0xf32,0x1971,0xfe8,0x1055)][_0x5e4dd8(0xded,0x1800,0x161c,0xd6e)];function _0x5e4dd8(_0x4985bd,_0x40f91f,_0x5117b9,_0x7bdf59){return _0x425890(_0x7bdf59,_0x4985bd-0xef,_0x5117b9-0x1c3,_0x7bdf59-0x111);}return _0x1b9d2a[_0x5e4dd8(0xf32,0x820,0x737,0x15aa)][_0x5e4dd8(0x23c,-0x169,0x123,0x2d1)]+=_0x410506[_0x5e4dd8(0xf32,0x16ee,0x8e1,0x198d)][_0x5e4dd8(0x23c,-0x3c5,-0x334,0x6b5)],_0x1b9d2a;},_0x4d3678);let _0x5e1ae2=_0x295ea5['rzCdL'](speed),_0xae2b57=_0x295ea5[_0x17318e(-0xc6,0xc07,0xf0a,0x8b4)](_0x295ea5['rzCdL'](speed),_0x5e1ae2);neww=performance[_0x17318e(0x1113,0x1d46,0x19ed,0x17af)](),oldd=performance[_0x17318e(0x1044,0x1167,0x1a8d,0x17af)](),respon=(_0x17318e(0x19c9,0x11f4,0x1c31,0x13b5)+_0x425890(0xce0,0x12d3,0xc9d,0x1391)+_0xae2b57[_0x425890(0x644,0x73c,0xcae,-0x27)](0x241d+-0x1f*-0xb0+-0xcf*0x47)+(_0x425890(0x8d2,0x1a1,-0x228,-0x62b)+'\x0a\x20')+(oldd-neww)+(_0x17318e(0xe03,0x8f9,0x1b19,0x11ba)+'nds_\x0a\x0aRunt'+_0x425890(0xbf3,0x541,0xa56,0xfc9))+_0x295ea5['TlBAm'](runtime,process[_0x17318e(0x1d17,0x1dc1,0x1313,0x155e)]())+(_0x17318e(0x105e,0x1d95,0x10a4,0x1454)+'erver\x0aRAM:'+'\x20')+formatp(_0x295ea5['MRHYU'](os[_0x425890(0x20d,0x633,0xa71,0x100b)](),os[_0x17318e(0xa1c,0x1581,0x10fa,0xcf7)]()))+_0x425890(0xe90,0xdda,0x14dc,0xdf0)+_0x295ea5['PDWAf'](formatp,os[_0x425890(0xd,0x633,0x103c,0x647)]())+('\x0a\x0a_NodeJS\x20'+_0x17318e(0xba0,0x1060,0x572,0xff4)+_0x425890(0x438,0xd08,0x13f7,0x10f0))+Object[_0x17318e(0x4f1,0x9b6,0x7a3,0xe78)](_0x1aa3c9)[_0x425890(0x4da,0xb6f,0xdb8,0xec0)]((_0x13f231,_0x57ef4f,_0x2e4e32)=>_0x13f231[_0x425890(0xcd9,0xf00,0x17fb,0x638)](Math[_0x425890(0x5fc,0xeaa,0x11cf,0x9e9)](..._0x2e4e32[_0x17318e(0x5b4,0xaad,0x441,0xd8c)](_0x4262c4=>_0x4262c4[_0x17318e(0x1226,0x754,0x126b,0xad9)])),'\x20')+':\x20'+formatp(_0x1aa3c9[_0x13f231]))[_0x17318e(0x2b8,0xb93,0x17e,0x712)]('\x0a')+'\x0a\x0a'+(_0x2ce86d[0x15e4+0x581*-0x1+-0x5*0x347]?_0x425890(0x8b3,0x346,0x1de,0xbfb)+_0x425890(0x6f2,0x670,0xfc7,0x104f)+_0x2ce86d[-0x175f*0x1+-0x270d*-0x1+-0x29d*0x6][_0x425890(0x1eb5,0x143f,0x1ab6,0x11e7)]['trim']()+'\x20('+_0x2c5aae[_0x17318e(0x13be,0x11a8,0x754,0xf55)]+_0x425890(0x61b,0x5e4,0xb82,0x6ca)+Object[_0x17318e(0xa03,0xb9d,0x79e,0xe78)](_0x2c5aae['times'])[_0x17318e(0x897,0x67b,0x92b,0xd8c)](_0x1eabaa=>_0x17318e(0x565,0x917,0x282,0xbb0)+(_0x1eabaa+'*')['padEnd'](0x4*-0x935+-0x5d8+0x1559*0x2)+':\x20'+((0x1e46+-0x1be1+0x1b*-0x13)*_0x2c5aae['times'][_0x1eabaa]/_0x2c5aae['total'])[_0x17318e(0x27c,0xb9c,0x50,0x959)](-0x248a+0x13*-0x149+0x3cf7*0x1)+'%')[_0x17318e(0x8f2,0x910,0xee,0x712)]('\x0a')+(_0x425890(0x5d,0xaf6,0x162,0x125e)+_0x425890(0x1aaf,0x112e,0x6cb,0x79f)+'(')+_0x2ce86d[_0x425890(0x4c2,0x8bc,0x6a8,0x12b9)]+(_0x17318e(-0xf3,-0x4be,0xe4e,0x4d6)+'_\x0a')+_0x2ce86d['map']((_0x305941,_0x26038d)=>_0x26038d+(-0x36+-0x1a9*0x12+-0x17*-0x14f)+'.\x20'+_0x305941[_0x17318e(0x1320,0xe8d,0x17c2,0x165c)]['trim']()+'\x20('+_0x305941[_0x17318e(0xfc2,0x1381,0x89d,0xf55)]+_0x425890(0xa28,0x5e4,-0x15b,-0x319)+Object[_0x425890(0xc13,0xc5b,0x478,0x14e3)](_0x305941[_0x425890(0x1786,0xe43,0x8a2,0x866)])[_0x17318e(0x1681,0x1798,0xc4b,0xd8c)](_0x28fd57=>'-\x20*'+(_0x28fd57+'*')['padEnd'](0x4*-0x969+0x1*0x1075+0x1535)+':\x20'+((-0x1945*0x1+0x7*-0x302+0x2eb7)*_0x305941[_0x425890(0xa5a,0xe43,0x94f,0xc03)][_0x28fd57]/_0x305941[_0x425890(0x136b,0x1229,0xa65,0x16de)])['toFixed'](0x1*-0x22b2+-0x576+-0x35*-0xc2)+'%')[_0x425890(0x4cd,0x4f5,0x305,-0x447)]('\x0a'))[_0x425890(0xb4d,0x4f5,0x8b6,0x878)]('\x0a\x0a'):'')+(_0x425890(0x814,0x831,0x1d4,0x489)+_0x17318e(0x1888,0x1310,0x97b,0x11bd)))[_0x425890(0xbac,0x54c,0x4e4,0x890)](),_0x295ea5[_0x425890(0x3fa,0x35b,0x65a,0x9c2)](_0xcd1d32,respon);}else{if(_0x295ea5[_0x17318e(0xa9f,0xb98,0x4c1,0x83e)](_0x4f0ad9[_0x425890(-0x130,0x8db,0x639,0x4eb)],_0x17318e(0xabe,0x1d8e,0x1a1c,0x14cc)))return;if(_0x3c2e39[_0x425890(0x371,0x8db,0xfd6,0xa72)]===_0x295ea5[_0x17318e(0x140a,0xce7,0x15fd,0x16f8)]){const _0x575461={};_0x575461[_0x425890(0xa30,0x1e8,-0x50a,-0x5f0)]=_0x17318e(0xc78,0x7c4,0x9e3,0xe69)+_0x17318e(0xf5c,0xf08,0x4cf,0xb7a)+_0x17318e(-0x3c3,-0x237,0xc32,0x32f)+_0x425890(0x1276,0x9be,0xe4f,0xf86)+_0x425890(-0x4a4,0x28d,0x681,0x9f3)+'්\x20ඔබ\x20සැමට🙏'+_0x17318e(0x18b8,0x1e13,0xd12,0x161f)+'උදෑසනක්\x20කි'+_0x17318e(0x1d98,0x1537,0x1bbd,0x17b4);const _0x31bb5e={};_0x31bb5e['quoted']=_0x11a1c7,_0x4debfa['sendMessag'+'e'](_0x6159d3,_0x575461,_0x31bb5e);}}}break;case'speedtest':{_0xcd1d32(_0x295ea5[_0x17318e(0x325,0x615,0x542,0x34c)]);let _0x57ed32=_0x295ea5[_0x425890(0xa45,0x441,-0x507,0xc59)](require,_0x295ea5['rcZxm']),{promisify:_0x2c80e9}=_0x295ea5[_0x425890(-0x207,0x74c,0xa2a,0x21e)](require,_0x425890(0xcad,0xd28,0x115c,0x1376)),_0x199d15=_0x2c80e9(_0x57ed32['exec'])[_0x425890(0xb8e,0x816,-0x13e,0xb04)](_0x57ed32),_0x17c8d7;try{_0x17c8d7=await _0x295ea5['JaoLq'](_0x199d15,_0x295ea5[_0x425890(0x10f5,0x1502,0x10e5,0x143a)]);}catch(_0x336cb1){if(_0x295ea5[_0x17318e(0x13b8,0x106e,0x1059,0x159b)](_0x295ea5['qoBeT'],_0x295ea5['cDjEf'])){let _0x471283=_0x21c6a8['db'][_0x17318e(0x988,0x108f,0x268,0xced)][_0x17318e(0xd58,0x178e,0xdb7,0xf73)][_0x172197['sender']];_0x295ea5[_0x425890(0x116b,0xd0f,0x5c4,0xc84)](_0x34fcfe,(_0x425890(0x1a07,0xfea,0x1021,0x65e)+_0x425890(0xf3e,0x762,0x29,0x612)+'e\x20From\x20AFK'+(_0x471283[_0x17318e(0x18e0,0x17b6,0x7c2,0xe6b)]?_0x295ea5[_0x425890(-0x3cd,0x4e4,-0x467,0x2a0)]+_0x471283['afkReason']:'')+'\x0aIn\x20'+_0x295ea5[_0x425890(0xa,0x4a2,0xc6a,0x3b8)](_0x516c86,new _0x58b466()-_0x471283[_0x17318e(0xa2f,0x9c2,0xb0b,0x3a4)])+'\x0a')[_0x17318e(0x2ff,0x621,0x3d4,0x769)]()),_0x471283[_0x425890(0x956,0x187,0x427,-0x552)]=-(0xbab+0x1*0x12f3+-0x1e9d),_0x471283[_0x17318e(0x15bb,0xa9e,0x976,0xe6b)]='';}else _0x17c8d7=_0x336cb1;}finally{let {stdout:_0x181068,stderr:_0x1fbaf4}=_0x17c8d7;if(_0x181068[_0x17318e(0xee1,0x11eb,0x270,0x769)]())_0x295ea5[_0x17318e(0xadd,0x596,0xbb3,0xe05)](_0xcd1d32,_0x181068);if(_0x1fbaf4[_0x425890(0x343,0x54c,-0x413,0x7de)]())_0x295ea5[_0x17318e(0x2d9,-0x4c,-0x1fa,0x5f6)](_0xcd1d32,_0x1fbaf4);}}break;case'owner':case _0x295ea5[_0x425890(-0x205,0x869,0x844,-0x3e)]:case _0x295ea5[_0x425890(0x1801,0xdc8,0x113c,0x1550)]:{if(_0x295ea5[_0x425890(0x19d6,0x151d,0x152e,0x1f71)]!==_0x295ea5[_0x425890(0x1e60,0x151d,0x1962,0x110f)])_0x295ea5[_0x425890(0x2b3,0x47c,0xcb8,-0xf9)](_0x39f75b,_0x425890(0xbeb,0xb08,0xe3c,0x126c)+(_0x5c71ab+_0xd4282b)+(_0x17318e(0x1cd2,0x1cff,0x1a10,0x169f)+_0x425890(0x2086,0x161f,0x10c6,0x196a)+':\x0a1.\x20ff\x20(F'+_0x425890(0x208,0xac3,0x453,0x496)+'2.\x20ml\x20(Mob'+_0x425890(0x3f1,0xc33,0x111d,0x10b7)+'s)\x0a3.\x20aov\x20'+_0x17318e(0x8e2,0x682,0xbe4,0x6f2)+'Valor)\x0a4.\x20'+_0x425890(0x95c,0xe37,0xa9a,0x1063)+'Of\x20Duty)\x0a5'+'.\x20pb\x20(poin'+_0x425890(0x9a0,0x30b,0x6f4,-0x343)+_0x17318e(0x1349,0xbcf,0x46b,0xd10)+'agram)\x0a7.\x20'+_0x17318e(0x1ae2,0x1d8a,0x1387,0x13c3)+_0x17318e(0x145f,0x946,0x882,0xd99)+'om)'));else{result=fs[_0x425890(0x293,0xa56,-0x40,0xbbc)+'nc']('./src/drag'+'onowner/in'+_0x425890(0x17df,0x1587,0x1e08,0x1bf1));const _0x2cfe4b={};_0x2cfe4b[_0x425890(0x70a,0xe75,0xcc5,0x16fe)]=result,_0x2cfe4b[_0x17318e(0x1976,0x12a2,0xce0,0x101b)]=_0x17318e(0x14f2,0x1bef,0x1a5d,0x13d8),_0x2cfe4b[_0x17318e(0x1fa2,0x1a9e,0x1665,0x177b)]=!![],_0x3797bd[_0x17318e(0x8da,0x7e,-0x2d2,0x63c)+'e'](_0x17aa6d['chat'],_0x2cfe4b,{'quoted':_0x17aa6d}),_0x295ea5['HCFDp'](_0xcd1d32,_0x17318e(0x48d,0x3fc,0x1527,0xba4)+'Is\x20*'+global['ownername']+(_0x17318e(0x6aa,0x1516,0x6fb,0xca5)+_0x17318e(0x991,0x1cdd,0x1e60,0x1401))+global[_0x425890(0x4dc,0xd5c,0x178c,0x16b1)]+_0x17318e(0x153f,0x1238,0x1336,0xecd)+global['botname']);}}break;case _0x295ea5['reBQk']:case _0x17318e(0xcb1,0xd1f,0x1648,0x16d3):{_0xcd1d32(_0x425890(0x33d,0xc63,0x4a2,0x66c)+_0x17318e(0xccf,0x1a6a,0xded,0x1112)+_0x425890(-0x831,0x22a,-0x394,-0x76b)+'eated\x20by:\x20'+_0x17318e(0x122e,0xd16,0x95e,0xe7e)+_0x425890(0xebf,0xdaf,0x162d,0xba8)+'gon\x20Team\x20='+'=(•)==');}break;case _0x295ea5['nwkOB']:{if(_0x295ea5['yUEPY']!==_0x295ea5[_0x425890(-0xdc,0x8d6,0x119c,-0x20)]){let _0x18413b=_0x2be4ab['db']['data'][_0x425890(0xd6a,0xd56,0x9cb,0x171a)][_0x24e16c[_0x425890(0x6b6,0xa69,0x79e,0xc42)]];_0x18413b[_0x17318e(-0xdb,-0x43b,0x4ff,0x3a4)]=+new _0x63991c(),_0x18413b[_0x17318e(0x11e5,0x12a4,0x11fe,0xe6b)]=_0xed9ee7,_0x295ea5[_0x17318e(-0x2a,0x10a2,0x12e9,0x8bb)](_0x59331b,_0x20228f['pushName']+('\x20Has\x20Gone\x20'+_0x17318e(0xc6e,0x1396,0xc67,0x8fb)+'e')+(_0x351ed4?_0x295ea5[_0x425890(0xae4,0xbbd,0xb75,0x935)](':\x20',_0x49c57b):''));}else{if(!_0x193cb6)return _0x51481c(''+mess[_0x17318e(0x1b91,0x1c5c,0xcf9,0x1494)]);if(_0x295ea5[_0x425890(0x1699,0xc3c,0xa4b,0x5d0)](_0x52a010[0x55*-0xc+0x528+0xc*-0x19],'on')){if(_0x295ea5[_0x425890(0x6ed,0xe26,0x3ee,0xbb4)](global[_0x17318e(0x468,0xcdc,0x1280,0xaf8)],_0x17318e(0x1b4a,0x12ec,0x1ec6,0x184b)))return _0x295ea5[_0x17318e(0x1944,0x1a1f,0x1930,0x1492)](_0xcd1d32,_0x425890(0x169,0x9eb,0x254,0xf10));global['chatbotpre']=_0x295ea5[_0x17318e(0x14ce,0x10bf,0xdb2,0x16f8)],_0xcd1d32(_0x17318e(0x895,0x75f,0x936,0x8f0)+_0x425890(0x47,0x647,0x988,0xd85)+_0x17318e(0x11df,0xa49,0x164d,0xfb1));}else{if(_0x295ea5[_0x17318e(0x151c,0x1046,0xded,0x17c1)](_0x52a010[0x10ea*-0x1+-0x26d6+0x2*0x1be0],_0x295ea5[_0x17318e(0x13ee,0x14c6,0x1a53,0x130c)])){if(global[_0x17318e(0x6d3,0xa88,0xb6a,0xaf8)]===_0x295ea5[_0x17318e(0x914,0x977,0x1936,0xee7)])return _0xcd1d32(_0x425890(0xbc9,0xcf9,0x92f,0x4ac)+'d');global[_0x17318e(0x1c2,0x100e,0x14a7,0xaf8)]=_0x295ea5[_0x425890(0x798,0xcca,0x830,0xbd3)],_0xcd1d32('Red\x20Dragon'+'\x20Chat\x20Bot\x20'+_0x17318e(0x943,0x1229,0xbfe,0x9b6));}else{if(_0x295ea5[_0x17318e(0xca1,0xfa4,0xa59,0x123a)]!==_0x17318e(-0x4d0,0x978,-0x3f2,0x47c)){const _0x2dc36c={};_0x2dc36c[_0x425890(0xec0,0xf77,0xefa,0x19e1)]=_0x295ea5['zWKbi'],_0x2dc36c[_0x17318e(0x1d10,0x1b35,0xd41,0x1318)]={},_0x2dc36c[_0x17318e(0x1094,0x182d,0x1ea7,0x1638)]=0x1,_0x2dc36c[_0x17318e(0x1d10,0x1b35,0xd41,0x1318)][_0x425890(0x136f,0x10a0,0xe30,0x186d)+'t']=_0x295ea5[_0x17318e(0x1c40,0x103e,0xbb4,0x1512)];const _0x11c2af={};_0x11c2af[_0x425890(0xde6,0x10a0,0x139b,0xa6a)+'t']=_0x425890(0xaee,0x4c1,0xe41,0x403);const _0x37c1b7={};_0x37c1b7['buttonId']=_0x425890(0x34,0x8d5,0x2c2,-0x182)+'f',_0x37c1b7['buttonText']=_0x11c2af,_0x37c1b7[_0x17318e(0x1356,0x186f,0x12ce,0x1638)]=0x1;let _0x42bc41=[_0x2dc36c,_0x37c1b7];await _0x3797bd[_0x17318e(0x1200,0xb39,0x93d,0x12c4)+'Text'](_0x17aa6d[_0x425890(0x8e8,0xcc7,0x12a9,0xd34)],_0x42bc41,'Chat\x20Bot\x20o'+'n\x20/\x20off',_0x3797bd[_0x425890(0x695,0x10be,0x674,0x144f)][_0x17318e(0x17b8,0x15ce,0x13ef,0x109f)],_0x17aa6d);}else{const _0x4a3b35={'MsWht':function(_0x3f9fab,_0x39b372){function _0xca13c0(_0x20d8ac,_0x4633d5,_0x58fbc6,_0x28b36f){return _0x425890(_0x4633d5,_0x20d8ac- -0x435,_0x58fbc6-0x151,_0x28b36f-0x15e);}return _0x295ea5[_0xca13c0(-0x108,0x549,-0xa89,-0x4e8)](_0x3f9fab,_0x39b372);},'jCwen':function(_0x24d404,_0x18da47){function _0x217f5e(_0x5d0ff5,_0x5c520a,_0x282723,_0xa8f090){return _0x17318e(_0x5d0ff5-0x6f,_0x5d0ff5,_0x282723-0x15b,_0xa8f090- -0x465);}return _0x295ea5[_0x217f5e(0x102f,0xcc6,0xdf1,0x678)](_0x24d404,_0x18da47);},'qeiys':function(_0x1a9e4e,_0xc04404){return _0x295ea5['lRGNr'](_0x1a9e4e,_0xc04404);}};if(_0x295ea5[_0x425890(0x1012,0x10d1,0x12db,0x767)](_0x690d01,_0x3c8db7))return _0x58ec8b(_0x425890(0x3c3,0xbb0,0x14ee,0x14dd)+_0x17318e(0x1222,0x184d,0xe09,0x12c1)+_0x425890(0x8e9,0xf9b,0x658,0x160b)+_0x17318e(0xf16,0x110f,0xfd3,0xc82)+_0x17318e(0x1302,0x116d,0xde3,0x14c2));if(!_0x21a449[0x11c2+0x1*0x2485+0x1*-0x3646])return _0x295ea5[_0x425890(0x206d,0x15f4,0x1cd2,0x1cba)](_0x4bd28f,_0x17318e(0x1319,0x1277,0x4b2,0xd25)+(_0x27d978+_0x518085)+(_0x425890(0x16cd,0x1327,0x192e,0xe5b)+_0x17318e(0x624,0x201,0x11ec,0xaff)+_0x425890(0x469,0x3ee,0x27d,0x931)));_0x295ea5[_0x17318e(0x16af,0xe97,0xe48,0xec5)](_0x533a01,_0x3f93ec[_0x425890(0x1392,0xa69,0xda6,0x11b1)],_0x59f4fa);let _0x578848=_0x295ea5[_0x17318e(0x1165,0xff5,0x20b,0x874)](-0xace2*0x2+-0x3ab*-0x5f+0xc09f,_0x2ce0bc);_0x295ea5[_0x17318e(0xc8b,0x19c8,0xe78,0x1643)](_0x3ec28c,_0x276e85['sender'],_0x578848),_0x295ea5['puCTm'](_0x3fa701,()=>{function _0x469831(_0x3d011a,_0x40a925,_0x1a43a7,_0x4048e7){return _0x425890(_0x4048e7,_0x40a925-0x133,_0x1a43a7-0x164,_0x4048e7-0x139);}function _0x2e92a5(_0x567648,_0x5b7b23,_0x94171e,_0x4a20d5){return _0x17318e(_0x567648-0x1d0,_0x567648,_0x94171e-0x127,_0x4a20d5- -0x15a);}_0x4a3b35[_0x469831(0xaa3,0x10c5,0x1779,0x10a9)](_0x533822,_0x2e92a5(0x1b09,0xccd,0x11ce,0x15db)+_0x469831(0x734,0xc57,0xba8,0x4ef)+_0x469831(0x1252,0xa27,0xef9,0x615)+_0x2e92a5(0x1091,0x808,0x11ea,0xd16)+_0x4a3b35[_0x2e92a5(0xc32,0x9eb,0x12fc,0xc58)](_0x1293e5,_0x3ed5c0[_0x2e92a5(0x1104,0x2bd,0x51d,0xb2c)])+(_0x469831(0x1254,0xbce,0x12be,0xec0)+_0x2e92a5(0xa01,0x1df4,0xa1d,0x13f7)+_0x469831(-0x162,0x538,0xba0,-0x2c7))+_0x4a3b35['qeiys'](_0x2359e7,_0x23e5f0[_0x2e92a5(0xd34,0x14a4,0x14e4,0xb2c)]));},-0x1e8+-0x425+0xddd);}}}}}case'ba':case _0x425890(0xc40,0x978,0x730,0xabd):case'බැ':case'බෑ':case _0x295ea5[_0x17318e(0x69e,0x129d,0x71a,0x988)]:{if(_0x295ea5[_0x425890(0xb3c,0x650,0x3b0,-0x319)](global['chatbotpre'],_0x295ea5['wQSJW']))return;if(global['chatbotpre']===_0x295ea5[_0x17318e(0xf0f,0x11e3,0x1cdc,0x16f8)]){const _0x515462={};_0x515462[_0x425890(0xc12,0x1e8,0x8e2,-0x729)]=_0x17318e(0xac8,0xcfd,0x15c1,0xc49)+_0x425890(0x86a,0x83c,0xdca,0x5e0)+'*';const _0x4be30e={};_0x4be30e[_0x425890(0x360,0x807,0x355,0x101d)]=_0x17aa6d,_0x3797bd[_0x425890(-0x338,0x41f,0x9c0,-0x49e)+'e'](_0x146a84,_0x515462,_0x4be30e);}}break;case _0x295ea5['SJlbA']:case _0x295ea5[_0x17318e(0x4b,0x799,-0x40e,0x4fb)]:case'පකය':case _0x295ea5[_0x425890(0x92b,0x71c,0xfe9,0x851)]:case _0x295ea5[_0x17318e(0x1ea3,0xf12,0xcaa,0x1620)]:case _0x295ea5[_0x425890(0x692,0x2d0,0x19d,0x3d4)]:case _0x295ea5['uysBg']:case _0x295ea5[_0x17318e(0x6e1,-0x3d8,-0x2a8,0x683)]:case _0x295ea5[_0x17318e(-0x574,0x5bf,0x60b,0x3f3)]:case'හුත්ති':case _0x17318e(0x462,0x56d,-0x149,0x496):case _0x295ea5['eYxvk']:case _0x295ea5[_0x17318e(0xc6a,0x2b2,0x650,0xa36)]:case _0x17318e(0x1099,0xdef,0xa95,0x1256):case _0x295ea5[_0x425890(0x13a7,0xb40,0x1122,0xd36)]:case _0x295ea5[_0x425890(0x1049,0xe64,0x15e8,0x1355)]:case _0x295ea5[_0x425890(-0x430,0x44f,-0x5d9,0x47d)]:case _0x17318e(0x11af,0x481,0xe07,0xa75):case _0x295ea5[_0x425890(0xc17,0x1464,0x1754,0xf87)]:case _0x295ea5[_0x17318e(0x176c,0x2188,0x1a41,0x1778)]:case _0x295ea5['Jfzfy']:case _0x295ea5['GDHtc']:case _0x295ea5[_0x17318e(0x1019,0x8e,0x61c,0x5fe)]:case _0x425890(0xa0c,0x123a,0xb77,0x18b9):case _0x295ea5[_0x17318e(0x5b5,0x661,0x731,0xa3e)]:case _0x17318e(0x17ae,0xe5c,0x1616,0x1833):case _0x295ea5[_0x425890(0xba1,0x130c,0xb3c,0xff7)]:case _0x295ea5[_0x425890(0x14aa,0xff1,0x1a89,0x13cc)]:case _0x295ea5[_0x425890(0x1dac,0x1407,0x1d8e,0x14ff)]:case _0x295ea5[_0x425890(-0x442,0x11c,0xb28,-0x26a)]:case _0x17318e(0x71b,0x60d,0x11e7,0xb61):case _0x295ea5[_0x425890(0x1559,0xd42,0x7ec,0x1161)]:case _0x295ea5[_0x17318e(0x158,0x923,0x711,0x81c)]:case _0x17318e(0xd16,-0x24f,-0x2cf,0x723):case _0x295ea5[_0x17318e(0x14e7,0x1a15,0x17d0,0x116d)]:{if(global[_0x17318e(0x109d,0xeca,0x7b0,0xaf8)]===_0x295ea5['wQSJW'])return;if(_0x295ea5[_0x425890(0xa78,0x120c,0x84b,0x1a44)](global[_0x425890(0x104e,0x8db,0x2bd,0xe1b)],_0x295ea5[_0x17318e(0xed9,0x121c,0x1e3f,0x16f8)])){const _0x40cd70={};_0x40cd70['text']=_0x425890(0x17b,0x401,-0x30a,0x8c)+_0x425890(0x9e0,0x684,0x58,0x3e)+'\x20පගෝ😑💔*';const _0x53419d={};_0x53419d['quoted']=_0x17aa6d,_0x3797bd[_0x425890(0x85b,0x41f,0x238,-0xfe)+'e'](_0x146a84,_0x40cd70,_0x53419d);}}break;case _0x295ea5[_0x425890(0x11e4,0x12ba,0x18d8,0x120a)]:case _0x295ea5[_0x17318e(0x998,0x90,-0x3e9,0x431)]:{if(_0x295ea5['ZvxrH'](global[_0x425890(0xe9,0x8db,-0x12,0xb1b)],_0x295ea5[_0x17318e(0x184a,0x1522,0x1190,0xee7)]))return;if(_0x295ea5[_0x425890(0xe5,0x23b,0x5e,0x352)](global[_0x17318e(0x153d,0x11e9,0x155a,0xaf8)],_0x295ea5['UgBoL'])){const _0x29418f={};_0x29418f[_0x17318e(0xda6,0x87a,0xd7f,0x405)]='*මොකෝ\x20ඩෝ'+_0x17318e(0x15ae,0xf8a,0x10b3,0x117d);const _0x746fc4={};_0x746fc4[_0x425890(0x5e0,0x807,0x40a,0x1042)]=_0x17aa6d,_0x3797bd[_0x425890(-0x275,0x41f,0xb23,0xe4)+'e'](_0x146a84,_0x29418f,_0x746fc4);}}break;case _0x295ea5[_0x17318e(0x6a2,0xad,0x6b3,0x773)]:case _0x295ea5[_0x425890(0x727,0xb8b,0x12b9,0x11e6)]:{if(_0x295ea5[_0x425890(0xfce,0x149b,0xf02,0x1305)](global['chatbotpre'],_0x295ea5[_0x17318e(0x1791,0xd7f,0x10ab,0xee7)]))return;if(_0x295ea5['hhOeb'](global['chatbotpre'],_0x295ea5['UgBoL'])){if(_0x295ea5[_0x17318e(0x17a9,0xdf5,0x20de,0x1693)](_0x17318e(-0x134,-0x296,0xced,0x4ce),_0x295ea5[_0x425890(0xfa4,0x741,0x678,0x3c2)])){const _0x2668d4={};_0x2668d4[_0x425890(-0x1e1,0x1e8,0x12a,0x292)]=_0x17318e(0x17a6,0x124a,0x1a36,0x132c)+_0x425890(0xcff,0x1564,0x166f,0xd24);const _0x273201={};_0x273201[_0x425890(-0x15b,0x807,-0x4a,0x778)]=_0x17aa6d,_0x3797bd[_0x425890(0x2fc,0x41f,-0x50a,0xc46)+'e'](_0x146a84,_0x2668d4,_0x273201);}else{_0x295ea5['QvkbO'](_0x5c45ed,_0x97b016[_0x425890(-0x571,0x2c6,0xcb2,-0x66f)]);const _0x3862c5={};_0x3862c5[_0x17318e(0x21f,0x110c,0x86b,0x810)]=_0x295ea5['snYzL'];const _0x4ac9c6={};_0x4ac9c6[_0x17318e(0xa8d,0x34,0x253,0x782)]=_0x3862c5,_0x4ac9c6[_0x425890(0x1554,0xdfe,0x10b1,0x13d3)]='applicatio'+_0x425890(0xe83,0x40e,0x3ed,-0x391)+_0x17318e(0xb9f,0xdf6,-0x1f4,0x531)+_0x425890(-0x1e7,0x85a,0x10b4,0xa17)+_0x425890(0xda,0xb5c,0x1a9,0xc47)+_0x425890(0x12f7,0x149e,0x1106,0x1924)+_0x17318e(0x200b,0x1742,0x15e4,0x1707)+_0x17318e(0x103f,0x14fc,0xa8c,0xdc9)+'ent',_0x4ac9c6['fileName']=_0x295ea5['jmFEs'];const _0x1bdaee={};_0x1bdaee['quoted']=_0x5eda13,_0x328822[_0x425890(0x984,0x41f,0x4e6,0x445)+'e'](_0x9e5c9a[_0x17318e(0x6ca,0x1044,0x1461,0xee4)],_0x4ac9c6,_0x1bdaee);}}}break;case _0x17318e(0xf0d,0x1b1c,0x1054,0x13f2):case _0x295ea5[_0x17318e(0x17fa,0x1639,0x9b5,0xf4c)]:case _0x295ea5[_0x425890(0x3ba,0x3c0,0xd6,0x32f)]:case _0x295ea5[_0x17318e(0x13ba,0xa88,0xf8d,0x1495)]:case _0x295ea5[_0x425890(0x829,0x1268,0x1892,0x995)]:case _0x295ea5[_0x17318e(-0x78,0x7c6,0xcce,0x667)]:{if(_0x295ea5[_0x17318e(0x473,0x1099,0x11ad,0xa3d)](_0x295ea5[_0x425890(-0x5fc,0x270,0x88a,0xa73)],_0x295ea5[_0x425890(0x1117,0xe8b,0xe61,0x140c)])){const _0x6908c3={};_0x6908c3[_0x17318e(0x2c1,0x957,-0x418,0x405)]=_0x425890(0x702,0x10df,0x126a,0x10e6)+_0x17318e(0xdd9,0x1042,0xbe5,0xa54);const _0x2c7174={};_0x2c7174[_0x17318e(0xf1b,0xcb6,0xbdc,0xa24)]=_0x4ec9ea,_0xaab846[_0x17318e(0x9f0,-0x42f,-0x1c3,0x63c)+'e'](_0xeeb454,_0x6908c3,_0x2c7174);}else{if(_0x295ea5[_0x425890(0x84a,0x380,-0x4eb,0x24)](global[_0x17318e(0xaf1,0xdeb,0xa6e,0xaf8)],_0x295ea5['wQSJW']))return;if(_0x295ea5[_0x425890(0xf93,0x9b7,0x572,0xcf)](global[_0x425890(0x1086,0x8db,0x460,0x3bd)],_0x295ea5[_0x425890(0xd06,0x14db,0x1bff,0x1750)])){const _0x561fbb={};_0x561fbb[_0x17318e(0x4ae,-0x3c4,0xb38,0x405)]=_0x17318e(0xd7f,0xde4,0x9bd,0x13b9)+'ල්ල\x20ගාගෙන😒'+_0x425890(0xa47,0x7df,0x213,0x314);const _0x1292ee={};_0x1292ee['quoted']=_0x17aa6d,_0x3797bd[_0x425890(0xd72,0x41f,0x3b2,0xe81)+'e'](_0x146a84,_0x561fbb,_0x1292ee);}}}break;case _0x295ea5['TDBBN']:case'hi':{if(_0x295ea5[_0x425890(-0x823,0x20d,0x74c,0x538)](_0x17318e(-0x161,0xd55,0x5f5,0x5b4),_0x17318e(0x840,0x105e,0x702,0xbc5))){if(_0x295ea5['ULEqX'](global[_0x17318e(0x10fc,0x8ac,0x3f0,0xaf8)],_0x295ea5['wQSJW']))return;if(global[_0x425890(0x1b9,0x8db,-0x8f,0x6c6)]===_0x295ea5[_0x425890(0x1eaa,0x14db,0x146e,0xc35)]){const _0x450bf3={};_0x450bf3[_0x17318e(0xde3,-0x4e0,0x57d,0x405)]='*🥴හූයි😁*';const _0x4ef773={};_0x4ef773['quoted']=_0x17aa6d,_0x3797bd[_0x17318e(0x9dc,0x7a7,0x8e0,0x63c)+'e'](_0x146a84,_0x450bf3,_0x4ef773);}}else{const _0x571f6a={};_0x571f6a['displayTex'+'t']=_0x295ea5['vMhbF'];const _0x216488={};_0x216488['buttonId']=_0x30cd28+_0x17318e(0x7c3,0x22,0x399,0x51c),_0x216488[_0x425890(0x9f6,0x10fb,0x18cd,0x783)]=_0x571f6a,_0x216488[_0x17318e(0x1f7b,0x1b95,0x1c6b,0x1638)]=0x1;const _0xa26f56={};_0xa26f56[_0x425890(0x1839,0x10a0,0x95d,0x73b)+'t']=_0x295ea5[_0x17318e(0x14ee,0x1227,0x8fa,0xeee)];const _0x149e36={};_0x149e36[_0x17318e(0x172e,0xd5d,0x128c,0x1194)]=_0x3a618e+_0x17318e(0x441,0x1581,0x744,0xc66),_0x149e36[_0x17318e(0xf29,0xa49,0xb1c,0x1318)]=_0xa26f56,_0x149e36[_0x17318e(0x1741,0x1284,0x15b2,0x1638)]=0x1;const _0x4028b5={};_0x4028b5[_0x425890(0x1670,0x10a0,0x1356,0x18d8)+'t']=_0x295ea5[_0x17318e(0xe8f,0xb3c,0xe0e,0x5a1)];const _0x59c414={};_0x59c414[_0x17318e(0x1ba9,0xa2b,0x1300,0x1194)]=_0x4b0db0+_0x17318e(0xd98,0x139b,0xd19,0x1751),_0x59c414[_0x17318e(0xbe8,0x1b3f,0x112e,0x1318)]=_0x4028b5,_0x59c414['type']=0x1;let _0x22e405=[_0x216488,_0x149e36,_0x59c414];const _0x404d0f={};_0x404d0f['url']=_0x1ad792+_0x295ea5['WKQXd'];const _0x5b70cc={};_0x5b70cc['image']=_0x404d0f,_0x5b70cc[_0x425890(-0x3a2,0x30a,-0x15e,0xc88)]=_0x425890(0xfde,0x618,0xa3f,0xad3)+_0x43d5c4+(_0x425890(0x866,0x19b,-0x2b5,0x84e)+_0x425890(0x136d,0xce9,0x15b5,0x12a6)+_0x425890(0x1a4d,0x1470,0x1881,0x169b)+_0x425890(0xd3a,0x148c,0x1939,0x1454)+_0x17318e(0x1b92,0x18fa,0x1a09,0x14a4))+_0x17a274+'\x20'+_0x50b129+'setcmd\x0a┃╠'+_0x4a4d1b+'\x20'+_0xdbc88b+'listcmd\x0a┃╠'+_0x35b48a+'\x20'+_0x3a902f+_0x425890(0x18e8,0xec5,0xc2c,0xf74)+_0x58b96a+'\x20'+_0x50f109+_0x425890(0x15ed,0x142c,0x1300,0x1342)+_0x13a606+'\x20'+_0x472f15+_0x17318e(0xa9d,0x65e,0xec8,0x441)+_0x1e102c+'\x20'+_0x4a12aa+'listmsg\x0a┃╠'+_0x269c24+'\x20'+_0x2b28a1+_0x17318e(0x140b,0xa62,0x171a,0x1388)+_0x5a6e45+'\x20'+_0x41487e+(_0x425890(0x96c,0x6e6,-0x352,-0x3a8)+_0x17318e(0x1b65,0x173d,0xb27,0x157c)+_0x425890(0xaa4,0x13af,0x1591,0xf3b))+_0x5cc9f6+_0x17318e(0xc44,0x5f0,0x719,0x5a0),_0x5b70cc['footer']=_0x51eb06['user']['name'],_0x5b70cc[_0x17318e(0x18c0,0xdce,0x9f1,0x117e)]=_0x22e405,_0x5b70cc[_0x17318e(0x1a8f,0xc23,0x862,0x120c)]=0x4;let _0x36d33c=_0x5b70cc;const _0x2f4b4e={};_0x2f4b4e[_0x17318e(0x66f,0x33a,0xf06,0xa24)]=_0x118fb6,_0x5e270e['sendMessag'+'e'](_0x34450b['chat'],_0x36d33c,_0x2f4b4e);}}break;case _0x295ea5[_0x425890(0x14f8,0xe60,0x15d1,0x1879)]:case _0x295ea5[_0x17318e(0xb13,-0x2f8,-0x28b,0x5fb)]:{if(_0x295ea5[_0x425890(0x1165,0x945,0x9f0,0xa01)](_0x295ea5[_0x17318e(0x638,0xe5f,0x7d8,0xd26)],_0x295ea5[_0x17318e(0x702,0x6b4,0x816,0xd26)]))_0x295ea5[_0x425890(0x24b,0xc60,0x6e0,0x1668)](_0x420558,_0x17318e(0x1dbd,0x1062,0xd78,0x1735)+'n\x20Successf'+_0x425890(0x94c,0x8f4,0x48,0x18f)+_0x425890(0x9c1,0x1054,0x177a,0x115d)+_0x425890(0x1371,0xc53,0xee6,0xd6a)+_0x295ea5[_0x425890(0x6e4,0xdfa,0x109e,0x12a0)](_0x5026b8,_0x29740a['sender'])+(_0x17318e(0xf1b,0x39b,0x13b5,0xb7f)+_0x425890(0x122a,0x9ee,0x8f0,0x44))+_0x53ec6b(_0x1e0516[_0x425890(0x96e,0xa69,0xf4a,0xd90)]));else{if(_0x295ea5[_0x17318e(0xe1c,0xe32,0xa0a,0x465)](global[_0x425890(0x786,0x8db,0xe4e,0x5a7)],_0x295ea5[_0x425890(0x1478,0xcca,0x239,0xc36)]))return;if(_0x295ea5[_0x17318e(0x101a,0x1a02,0xe73,0xfb6)](global['chatbotpre'],_0x295ea5[_0x425890(0xf1a,0x14db,0xe14,0x1ccd)])){if(_0x295ea5[_0x17318e(0xf54,0x1199,0xe4e,0xc59)](_0x295ea5[_0x425890(0x1108,0x133b,0x96b,0x14bd)],_0x295ea5[_0x17318e(0x5b6,0x2f7,0x75b,0x4db)])){const _0x528afe={};_0x528afe[_0x425890(0x200,0x1e8,0x13a,-0x473)]=_0x17318e(0x1cd8,0xc78,0xa03,0x12fc)+_0x17318e(0x49a,0x123f,0x1487,0xa54);const _0x579450={};_0x579450[_0x17318e(0x9db,0xa1,0x131c,0xa24)]=_0x17aa6d,_0x3797bd[_0x425890(0xdb2,0x41f,-0x3c8,-0x239)+'e'](_0x146a84,_0x528afe,_0x579450);}else _0x34a25c=_0x114dd0;}}}break;case _0x295ea5[_0x17318e(0x1407,0xaf5,0x1a8d,0x103c)]:case _0x17318e(0x23c,-0x22b,0xb5e,0x362):{if(_0x295ea5[_0x425890(0xb6c,0xccd,0x79e,0x1468)](global[_0x17318e(0xbba,0x182,0x1497,0xaf8)],_0x425890(0xe68,0x12af,0x1732,0x15c0)))return;if(_0x295ea5[_0x425890(0x1675,0x13fa,0x1307,0x1211)](global[_0x425890(0x4be,0x8db,0x7f3,0x10d9)],_0x295ea5['UgBoL'])){const _0x1da9a0={};_0x1da9a0[_0x425890(0x1f1,0x1e8,0xa92,0x22e)]='*අනේ\x20පලහ්😂'+'*';const _0x2e2ff9={};_0x2e2ff9[_0x425890(0xe17,0x807,0xbec,0x56c)]=_0x17aa6d,_0x3797bd[_0x17318e(-0x18f,0x2ff,-0x19d,0x63c)+'e'](_0x146a84,_0x1da9a0,_0x2e2ff9);}}break;case'e':case'ee':case'ඒ':{if(global[_0x17318e(0x42c,0x8c,0x14ac,0xaf8)]===_0x295ea5[_0x425890(0xfe1,0xcca,0x15ea,0x2a9)])return;if(_0x295ea5['YXtlb'](global[_0x17318e(0xa37,0x602,0xe42,0xaf8)],_0x295ea5['UgBoL'])){if(_0x295ea5[_0x425890(0x1015,0x1355,0x1234,0x1322)]===_0x295ea5['JVxVq'])_0x51092b[_0x1c2bc0['sender']['split']('@')[-0x1120+-0x1*0x86a+0x198a]]=_0x10a015['jawaban'][_0x425890(0x15ce,0xb39,0x8f0,0xdc9)+'e']();else{const _0x1555bc={};_0x1555bc[_0x425890(0xc29,0x1e8,-0x68,-0x6fb)]=_0x17318e(0xf43,0x117d,0xd0f,0x1332);const _0x59f937={};_0x59f937[_0x17318e(0xd34,0x10c6,0xb8a,0xa24)]=_0x17aa6d,_0x3797bd[_0x425890(0x905,0x41f,-0x54d,-0x16c)+'e'](_0x146a84,_0x1555bc,_0x59f937);}}}break;case _0x425890(-0x853,0x1c0,0x2c3,0x5b0):case _0x295ea5[_0x17318e(0x812,0x705,0xd95,0xcf0)]:case _0x17318e(0x1089,0x2f9,0x626,0x949):{if(_0x295ea5[_0x17318e(0xadc,0x1461,0xe7f,0x14de)](global[_0x17318e(0x1357,0x142e,0xec5,0xaf8)],_0x295ea5[_0x17318e(0x1414,0x1251,0x4f7,0xee7)]))return;if(_0x295ea5[_0x17318e(0x120f,0x15dc,0xf10,0xe40)](global[_0x425890(0x92d,0x8db,-0xa8,-0x97)],_0x295ea5['UgBoL'])){if(_0x295ea5[_0x17318e(0xfa1,-0x1cc,0xf96,0x58d)]!==_0x17318e(-0x63,0x77d,0xeaa,0x4b4)){const _0x42e97d={};_0x42e97d[_0x425890(0x874,0x1e8,-0x6c,0x35d)]=_0x17318e(0x821,0x2c6,0x256,0x49e)+_0x17318e(0xfa,0x219,0xfa0,0xb1f);const _0x28b67d={};_0x28b67d[_0x17318e(0x3bd,0x122d,0xe1d,0xa24)]=_0x17aa6d,_0x3797bd[_0x425890(0x916,0x41f,-0x135,0xddf)+'e'](_0x146a84,_0x42e97d,_0x28b67d);}else{_0x5cc06e=_0x1c11ea[_0x425890(0xb00,0xa56,0x13ad,0xbe5)+'nc']('./DragonMe'+'dia/vid/'+_0x31109d+_0x17318e(0xa3e,0xb12,0x70c,0xb57));const _0x2b95a3={};_0x2b95a3[_0x17318e(0x1393,0x16c0,0x1eac,0x16dc)]=_0x4c6011;const _0x1bbf5a={};_0x1bbf5a['quoted']=_0xb68376,_0x49f543['sendMessag'+'e'](_0x4fa68f[_0x17318e(0xc66,0x112d,0x16db,0xee4)],_0x2b95a3,_0x1bbf5a);}}}break;case'ow':case _0x295ea5[_0x425890(0xdb7,0xc11,0x402,0x1295)]:case'ඕ':case'oo':{if(_0x17318e(0x74b,0xd16,0xb8a,0x787)===_0x295ea5[_0x425890(0x8e2,0x88f,0xa2f,0xd84)]){if(global['chatbotpre']===_0x295ea5[_0x17318e(0xbeb,0x128e,0xcee,0xee7)])return;if(_0x295ea5[_0x425890(0x10d9,0x1058,0x1536,0x672)](global[_0x17318e(0x209,0x14a0,0x122,0xaf8)],_0x295ea5['UgBoL'])){if(_0x295ea5[_0x17318e(0x527,0x11d4,0x114f,0x841)](_0x295ea5[_0x425890(0x17,0x9e4,0x500,0x620)],_0x295ea5['TacNS'])){const _0x36787a={};_0x36787a[_0x17318e(-0x7d,-0xf6,0x201,0x405)]=_0x17318e(0x1b3e,0x1ccb,0x14c0,0x1563)+'්චරයි🤭*';const _0x251608={};_0x251608[_0x425890(0xbef,0x807,0xd7a,0xe7)]=_0x17aa6d,_0x3797bd['sendMessag'+'e'](_0x146a84,_0x36787a,_0x251608);}else _0x150154[_0x425890(0x875,0xf0d,0x9db,0xeaa)][_0x425890(0xf1,0x795,0x8f3,0x11e4)+'rn']=_0x295ea5[_0x17318e(0x6d2,-0x215,0x2e9,0x612)](_0x3ee92d['sender'],_0x5f1bf2[_0x17318e(0x100a,0x1068,0x115f,0x112a)][_0x425890(0x941,0xcf0,0x980,0x10c4)]),_0x1a0e8a=!![];}}else{_0x325668[_0x425890(-0x289,0x36a,0xb26,0x346)](_0x295ea5[_0x17318e(0x2103,0xd34,0xe3f,0x1773)](_0x295ea5[_0x425890(0x14cb,0x129a,0xc1b,0x11e8)],_0x515b27[_0x425890(0xddd,0x84a,0x981,0x3c)]));const _0xaecd9={};_0xaecd9[_0x17318e(0x1245,0xc8f,0xa00,0x1194)]=_0x295ea5[_0x17318e(0x17f2,0x1a84,0x1183,0x11f9)],_0xaecd9[_0x17318e(0x13f8,0xcae,0xa63,0x1318)]={},_0xaecd9[_0x425890(0x11a1,0x141b,0x1a5d,0xf8f)]=0x1,_0xaecd9[_0x17318e(0x13f8,0xcae,0xa63,0x1318)][_0x425890(0x7e5,0x10a0,0x188c,0x13cc)+'t']=_0x295ea5[_0x17318e(0x1468,0x48c,0x15dc,0xd5e)],_0x438cc7['sendButton'+_0x425890(0x6bb,0xcec,0x8eb,0xd1f)](_0x1df2ec['chat'],[_0xaecd9],_0x17318e(0x2aa,0x92b,0xa8b,0xc39)+'nswer:\x20\x20'+_0x30a46f[_0x1374ca['sender'][_0x17318e(0x8d0,0xa8e,0x8cf,0x508)]('@')[-0x1b20+-0x1*-0x39a+0x1786*0x1]]+(_0x425890(0x173a,0x11a2,0x11f9,0x787)+_0x425890(0xe74,0x878,0x678,0xb95)+_0x425890(0xf50,0x7e3,0x401,0x3c1)+'\x20Button\x20Be'+_0x17318e(0xbc3,0x1a87,0xc3d,0x1126)),_0x5e0e20[_0x425890(0x1558,0x10be,0x61f,0xbbd)]['name'],_0x2f1b5d),delete _0x2220b9[_0x16f59f[_0x17318e(0x15b2,0xd99,0x15b1,0xc86)][_0x17318e(0xef3,-0x72,0x543,0x508)]('@')[0x3*0x120+0x2*-0x6b2+0xa04]];}}break;case _0x295ea5[_0x425890(0x21e,0x488,0x1d,0x1d2)]:case _0x295ea5[_0x17318e(0x59a,0xb8e,-0xcb,0x6e2)]:case _0x425890(0xc0c,0x12f3,0x1520,0x1030):case _0x295ea5[_0x17318e(0x6a6,0x3e6,0x11c4,0x7ae)]:case _0x295ea5[_0x17318e(0x1a29,0x1788,0xea4,0x10c0)]:case _0x295ea5[_0x17318e(0x1449,0x1828,0x1125,0x1278)]:{if(_0x295ea5[_0x425890(-0x38c,0x685,0x1043,0x52d)](global['chatbotpre'],_0x295ea5[_0x17318e(0xfd2,0xf7c,0x6be,0xee7)]))return;if(global[_0x425890(0xe03,0x8db,0x43a,0x5ef)]===_0x295ea5[_0x17318e(0x20b2,0x1ecd,0x1b8a,0x16f8)]){if(_0x295ea5[_0x425890(0x766,0x1128,0xc22,0x1b81)]!==_0x295ea5[_0x425890(0xf7f,0x1128,0x1146,0xe36)]){if(_0x295ea5[_0x17318e(0xc05,0x915,0x1ad,0x57f)](_0x4dbba4[_0x425890(0x129f,0x8db,0xbcd,0xcd5)],_0x295ea5[_0x425890(0x15eb,0xcca,0xb5f,0xa77)]))return;if(_0x295ea5[_0x425890(0x771,0x1058,0x15ef,0x861)](_0xc06dc3[_0x425890(0x1192,0x8db,0x9aa,0x126c)],'true')){const _0x42c718={};_0x42c718[_0x425890(0xb74,0x1e8,0xc26,0x2d4)]=_0x17318e(0x796,0x10ea,0x114a,0x792)+_0x17318e(0x1bc2,0xfba,0xd20,0x14c3)+_0x17318e(0x6b2,0xb21,0xd38,0x10bf);const _0x2581ee={};_0x2581ee['quoted']=_0x9d1731,_0x4ae9cb[_0x425890(0x60,0x41f,0x9c,-0x545)+'e'](_0x483a8c,_0x42c718,_0x2581ee);}}else{const _0x371dfc={};_0x371dfc[_0x17318e(0x6a7,0x45,0x2b5,0x405)]=_0x17318e(-0x4c2,0xdf8,-0x65e,0x39d)+_0x17318e(0x681,0x8ea,0x6e7,0x9d9);const _0x2770ac={};_0x2770ac[_0x17318e(0xb86,0x10fb,0x6d2,0xa24)]=_0x17aa6d,_0x3797bd[_0x17318e(0x4c1,-0x1e2,0xe3d,0x63c)+'e'](_0x146a84,_0x371dfc,_0x2770ac);}}}break;case'danna':case _0x295ea5[_0x17318e(-0xf2,0x11aa,0x960,0x70e)]:case _0x295ea5[_0x425890(0x6aa,0xa2d,0xb05,0x14b5)]:case _0x295ea5[_0x17318e(0x1c28,0x1bf5,0xd74,0x1795)]:{if(_0x295ea5['AJdqs'](global['chatbotpre'],_0x295ea5['wQSJW']))return;if(_0x295ea5['ONNnQ'](global[_0x17318e(0x7fe,0xfd8,0x9a8,0xaf8)],_0x295ea5[_0x17318e(0x2148,0x1126,0x1f1f,0x16f8)])){if(_0x295ea5[_0x425890(0x10c5,0xc90,0xb37,0x335)]!==_0x295ea5[_0x425890(-0x13e,0x330,-0x737,0x31d)]){const _0x1d7c6b={};_0x1d7c6b['text']='*මං\x20දන්නෙත'+_0x17318e(0xe8e,-0xc4,0xdd3,0x4c0);const _0x36b0d9={};_0x36b0d9[_0x17318e(0x7e7,0x49,0x75e,0xa24)]=_0x17aa6d,_0x3797bd[_0x17318e(-0x276,0x983,0x907,0x63c)+'e'](_0x146a84,_0x1d7c6b,_0x36b0d9);}else{if(!_0x492289['isGroup'])return _0x2bd08c(''+_0x1e4c55[_0x17318e(0x13bd,0x817,0x12fe,0xc0a)]);if(!_0x5b44f)return _0x229849(''+_0x565bd0[_0x17318e(0xb26,0xc18,0xb47,0x6f4)]);if(!_0x128025)return _0x3aaa7c(''+_0x16d27b[_0x425890(0x1222,0x14b7,0x1797,0x1c98)]);const _0x435ba7={};_0x435ba7[_0x425890(0xfdc,0x807,0x8a2,0xb6d)]=_0x124282,_0x341834['sendMessag'+'e'](_0x4797d0[_0x17318e(0xee7,0x1603,0x14ab,0xee4)],{'text':_0x206a6b?_0xeedbd3:'','mentions':_0x496c7a[_0x425890(0x7c3,0xb6f,0x3c1,0xee)](_0x1fa9df=>_0x1fa9df['id'])},_0x435ba7);}}}break;case'ko':case _0x295ea5['CALRZ']:case _0x295ea5[_0x17318e(0x44d,0x7e8,0x258,0x92a)]:case'කො':{if(global[_0x17318e(0x12aa,0x8e2,0xfb2,0xaf8)]===_0x295ea5['wQSJW'])return;if(_0x295ea5['WbvME'](global['chatbotpre'],_0x295ea5[_0x425890(0x1335,0x14db,0x1077,0x17e2)])){const _0x42b0ca={};_0x42b0ca[_0x17318e(-0x261,-0xb8,0x391,0x405)]='*මං\x20දන්නෙත'+_0x17318e(0xdf,0x388,0xb20,0x4c0);const _0x4dd3af={};_0x4dd3af[_0x425890(-0x14d,0x807,0x124e,0x6f)]=_0x17aa6d,_0x3797bd[_0x425890(0x6fa,0x41f,0x953,-0x5ca)+'e'](_0x146a84,_0x42b0ca,_0x4dd3af);}}break;case _0x295ea5['TrmFl']:case _0x295ea5['vEqXu']:case'කමක්':case _0x17318e(0x168,-0x2c9,-0x25e,0x356):{if(global[_0x425890(0xd04,0x8db,0x101,0x96d)]===_0x295ea5[_0x425890(0x12db,0xcca,0x10ed,0x1135)])return;if(_0x295ea5[_0x425890(0x12ea,0xe26,0x492,0x149d)](global['chatbotpre'],_0x295ea5['UgBoL'])){const _0x53cf04={};_0x53cf04[_0x17318e(0x9cc,0x1c0,-0x373,0x405)]=_0x425890(0x1c29,0x13c6,0xf24,0xef1)+_0x425890(0x14fc,0xbb2,0xd0a,0x161);const _0x2d2d86={};_0x2d2d86['quoted']=_0x17aa6d,_0x3797bd[_0x425890(0x3ba,0x41f,-0x376,0xc5a)+'e'](_0x146a84,_0x53cf04,_0x2d2d86);}}break;case _0x425890(0x1c8,0x642,0xd81,0x2ea):case _0x295ea5['rXPiP']:case _0x295ea5['BpCaP']:case _0x295ea5[_0x425890(0xa42,0xcd5,0xe75,0x3ba)]:{if(_0x295ea5[_0x425890(-0x43b,0x1ba,-0x11b,0x45)](_0x295ea5[_0x17318e(0x17be,0x1281,0x1af8,0x149d)],_0x295ea5[_0x425890(0x138c,0x1280,0xbc4,0x1a76)])){const _0x5cf46e=_0x295ea5[_0x17318e(0x421,0x13ce,0xc5e,0xbc1)]['split']('|');let _0x1090ec=-0x13*-0x1c2+0x1d03+0x4cd*-0xd;while(!![]){switch(_0x5cf46e[_0x1090ec++]){case'0':_0x99a4cc+=_0x425890(0x836,0x5a0,0x79a,-0x2f0)+'\x20'+_0x2a26b3[_0x425890(0x493,0x5de,0xd5,0x8e0)]+'\x0a';continue;case'1':_0x9e5e18+=_0x17318e(0xbc5,0x13db,0xb36,0xde6)+'\x20:*\x20'+_0x356355[_0x425890(0x13a3,0xd41,0xcbb,0x1604)]+'\x0a';continue;case'2':_0x49cd75+=_0x425890(0xe7b,0x13cc,0x171c,0x949)+'*\x20'+_0x33872d[_0x425890(0x33e,0xc8d,0x42d,0x2ae)]+'\x0a';continue;case'3':_0x3b0027+=_0x425890(0x89a,0x490,0x538,0xcc6)+_0x3ae227['url']+(_0x17318e(0xaa9,0xdd6,0xba5,0xa6e)+_0x17318e(0x572,0x18,-0x321,0x445)+_0x425890(-0x440,0x371,0x56c,-0x6ba)+_0x17318e(0xaac,0x4bb,0x5cb,0x445)+_0x425890(0xda3,0x371,0xd0a,0x151)+'.\x0a');continue;case'4':_0x50cef+=_0x425890(0x721,0xa23,0x13cd,0x1216)+'*\x20'+_0x4b23c1[_0x425890(0x168e,0x1486,0xb81,0x15f7)]+'\x0a';continue;}break;}}else{if(_0x295ea5[_0x17318e(0x12dd,0x174a,0x108b,0x10d2)](global[_0x425890(0x3cd,0x8db,0x4a9,0x10df)],_0x295ea5[_0x425890(0x915,0xcca,0x661,0x9ca)]))return;if(_0x295ea5[_0x17318e(0x17b,0x248,0xc2c,0x710)](global[_0x17318e(0xf2d,0x10db,0x7e1,0xaf8)],_0x295ea5[_0x17318e(0x17a0,0x15b3,0xfc6,0x16f8)])){if(_0x295ea5[_0x425890(0x119e,0x126e,0x1be2,0xb95)](_0x295ea5[_0x425890(0xb88,0xb9e,0xe5b,0x123f)],_0x295ea5[_0x425890(0xc4b,0xb9e,0x102,0x189)])){let _0xcc6e45=new _0x26cda2(0x1*0x599+-0x2*0x182+0x51d,_0x295ea5[_0x17318e(0x882,0x538,0xe43,0x75f)](_0x365bda,-0xe26+-0x1027*0x1+0x1e4e),_0xbc2d7f);return _0x59ea50['find'](([_0x3ba3ad,_0xb49a43])=>_0xcc6e45>=_0xb49a43)[0x1625*-0x1+-0x9d9+-0x13b*-0x1a];}else{const _0x536187={};_0x536187[_0x17318e(0x805,-0x3d3,0x8a2,0x405)]=_0x425890(0xd1a,0x792,0x61b,0xfdd);const _0x12e35c={};_0x12e35c[_0x425890(0x7fb,0x807,0xfa3,0x941)]=_0x17aa6d,_0x3797bd[_0x425890(0xb26,0x41f,0xa72,-0x2a5)+'e'](_0x146a84,_0x536187,_0x12e35c);}}}}break;case _0x295ea5['ZvbZp']:case _0x17318e(0x17ab,0xcde,0x123c,0x1499):case'පල':case _0x295ea5[_0x425890(-0x352,0x29a,-0x5c3,-0x7e8)]:case _0x425890(0x244,0x78f,0xa2d,0xa4a):case _0x425890(0x1738,0x124f,0x1310,0x18d2):{if(_0x295ea5['EqiCo'](_0x295ea5[_0x17318e(0x195c,0x1113,0xead,0x1622)],_0x295ea5[_0x425890(0x1109,0xcc9,0x9ff,0x3d8)])){if(global[_0x425890(0xfc5,0x8db,0x672,0x674)]===_0x295ea5[_0x425890(0x731,0xcca,0xa2c,0x1620)])return;if(_0x295ea5[_0x425890(0x1159,0x106a,0x91e,0x1aa8)](global[_0x17318e(0xc3b,0x10a8,0x6fe,0xaf8)],_0x295ea5[_0x17318e(0x1878,0x2162,0xfee,0x16f8)])){const _0x3180ea={};_0x3180ea[_0x425890(0x3a1,0x1e8,-0x187,-0xd5)]='*හා\x20උබ\x20කිය'+_0x17318e(0xa77,0xdfa,0xe96,0x14c3)+_0x425890(0x1165,0xea2,0xf2e,0x10b0);const _0x57f290={};_0x57f290[_0x17318e(0x119f,0xd39,0x150,0xa24)]=_0x17aa6d,_0x3797bd[_0x425890(-0x564,0x41f,-0x277,-0x62b)+'e'](_0x146a84,_0x3180ea,_0x57f290);}}else{if(_0x3b108e[_0x425890(0x108c,0xad0,0x13f6,0x153)][_0x17318e(0x11ac,0x1036,0x581,0xce8)][_0xdc360f[_0x17318e(0x1190,0x17b2,0x8dc,0xee4)]][_0x17318e(0x178c,0x15a5,0x13a6,0x151a)])return _0x295ea5[_0x17318e(0x1e02,0x1270,0x2052,0x1702)](_0x79b5b7,_0x17318e(0x133d,0x5cb,0x1148,0xf61)+_0x17318e(0x1055,0x17cd,0x1584,0xe9b));_0x58ea02['data']['chats'][_0x37b289[_0x425890(0x41f,0xcc7,0xa54,0x106c)]][_0x425890(0x14db,0x12fd,0x1c54,0x8f6)]=!![],_0x295ea5['Eltbf'](_0x28a27d,_0x336b20[_0x17318e(0xa91,0x146c,0x1c48,0x12db)]['name']+(_0x425890(0xaf5,0x8f1,0x8f9,0xa73)+_0x17318e(0xa44,0x1494,0x1170,0x13f8)+_0x425890(0x1c79,0x1394,0x1816,0x1382)+'!'));}}break;case'mk':case _0x425890(0x1715,0x13ee,0x1ac4,0xd72):case _0x295ea5[_0x17318e(0x1763,0xafc,0x1439,0x1113)]:case'mokadda?':case _0x425890(0xb98,0x14b0,0x1397,0xdb1):case _0x295ea5['ifWXO']:case _0x295ea5['NRhtG']:{if(global[_0x17318e(0x216,0xd0e,0x1562,0xaf8)]===_0x295ea5[_0x425890(0x4ca,0xcca,0x1063,0x2ba)])return;if(_0x295ea5[_0x17318e(0x112e,0x64e,0x147d,0xe7c)](global[_0x17318e(0x68,0x1559,0xfb8,0xaf8)],_0x295ea5[_0x425890(0x1704,0x14db,0xc8a,0x13c7)])){const _0x927a61={};_0x927a61[_0x17318e(-0x1e1,0x927,0x2fb,0x405)]=_0x17318e(0xc81,0x5cc,0x625,0x507)+_0x17318e(0x376,0x69a,0x73a,0xd57);const _0x31bd26={};_0x31bd26['quoted']=_0x17aa6d,_0x3797bd[_0x425890(0x78b,0x41f,-0x385,0x18d)+'e'](_0x146a84,_0x927a61,_0x31bd26);}}break;case _0x295ea5[_0x425890(0x8da,0x85b,0x88a,0x94c)]:case _0x17318e(0x815,0x5f1,0x154b,0xd1f):case _0x295ea5[_0x425890(0x1d06,0x154e,0x1420,0x1032)]:case _0x295ea5['NfWtM']:case _0x17318e(0x1dab,0x1756,0x153d,0x17a8):case _0x295ea5[_0x17318e(0xa74,0x35b,0x1060,0xb5e)]:{if(_0x295ea5['zaXeT']===_0x295ea5[_0x425890(0x1538,0x118d,0x1188,0xc9a)])_0x37b124[_0x33ce60[_0x17318e(0xb4e,0x633,0x1517,0xc86)][_0x425890(0xd5f,0x2eb,-0x455,-0x2e)]('@')[0x89*0x31+0xbc*-0x1d+-0x4ed*0x1]]=_0x53c8ec['jawaban'][_0x425890(0xd85,0xb39,0x62b,0xae3)+'e']();else{if(_0x295ea5[_0x425890(0xe5e,0x650,0x218,-0x3)](global[_0x17318e(0x9d,0x1559,0xd8c,0xaf8)],_0x295ea5['wQSJW']))return;if(_0x295ea5['ktiNd'](global[_0x425890(0x1b0,0x8db,0x921,0x300)],_0x295ea5[_0x17318e(0x1b7e,0x12a9,0x1932,0x16f8)])){const _0x22a7b2={};_0x22a7b2[_0x17318e(0x718,0xb8f,0x231,0x405)]=_0x17318e(0xfcf,0x1449,0x1036,0x1198)+'*';const _0x449475={};_0x449475[_0x425890(0x9f4,0x807,0xb7f,0x6fa)]=_0x17aa6d,_0x3797bd[_0x425890(-0xcd,0x41f,-0x31b,-0xc)+'e'](_0x146a84,_0x22a7b2,_0x449475);}}}break;case'gm':case _0x17318e(0xe51,0xda7,0x8a,0xa73)+'g':case _0x17318e(0x908,0xa50,0x65c,0x664):case _0x295ea5[_0x17318e(0x61e,0x530,0x899,0x732)]:case _0x295ea5[_0x425890(-0x9f,0x9e0,0x961,0xb42)]:case _0x295ea5[_0x17318e(0xe8b,0x489,0x11,0x91a)]:case _0x295ea5[_0x425890(0x9dd,0x3dd,0xbd5,0xa98)]:case _0x295ea5['ZVLVJ']:{if(_0x295ea5[_0x17318e(0x1f79,0x16cd,0x1f1f,0x164a)](global[_0x17318e(0x78c,0x931,0x9dc,0xaf8)],_0x295ea5[_0x425890(0xfd1,0xcca,0x1327,0x169b)]))return;if(global['chatbotpre']===_0x295ea5[_0x17318e(0xe9d,0x1e04,0x1692,0x16f8)]){const _0x22d38f={};_0x22d38f[_0x425890(-0x671,0x1e8,-0x576,0xa28)]=_0x425890(0x125e,0xc4c,0x14b0,0xf52)+_0x425890(0x761,0x95d,0xd45,0x12c3)+'වන😊\x20මේ\x20හිම'+_0x17318e(0xacc,0x907,0x10a6,0xbdb)+_0x17318e(0x34,0x3f6,0x547,0x4aa)+'්\x20ඔබ\x20සැමට🙏'+_0x17318e(0x164e,0x17f1,0x1d72,0x161f)+_0x17318e(0x771,0x34d,0x47b,0xdc3)+_0x425890(0x1c6e,0x1597,0x1095,0x1ac8);const _0x3651a2={};_0x3651a2[_0x425890(0x76a,0x807,0xaa2,0xeaf)]=_0x17aa6d,_0x3797bd[_0x17318e(0x7f1,0xd7e,0xd44,0x63c)+'e'](_0x146a84,_0x22d38f,_0x3651a2);}}break;case'gn':case _0x17318e(0x197d,0x130f,0x1bb6,0x111a):case _0x17318e(0xbbb,0x156e,0xa65,0xfd1):case _0x425890(0x9f0,0x38c,0x87c,-0x2f0):case _0x295ea5['hzcjh']:case _0x295ea5['EAGIF']:case _0x295ea5[_0x17318e(0x1872,0x12d3,0x8e2,0x11d1)]:case _0x295ea5[_0x17318e(0x1540,0x139c,0x1ff0,0x1734)]:{if(global['chatbotpre']===_0x425890(0x17e6,0x12af,0x19f8,0x1141))return;if(_0x295ea5[_0x17318e(0x159a,0x697,0xbd8,0x1068)](global['chatbotpre'],_0x295ea5['UgBoL'])){if(_0x295ea5['xUGHf'](_0x295ea5[_0x425890(0x142c,0xc92,0x13f5,0x2a4)],_0x295ea5['tCFdi'])){if(!_0x16ff49)throw _0x493425[_0x17318e(0x1d21,0xed3,0xc9e,0x1494)];const _0x21e8f9={};_0x21e8f9['remoteJid']=_0x560a63[_0x17318e(0x95b,0x1353,0x4c5,0xee4)],_0x21e8f9[_0x17318e(0xfc2,0x1064,0xace,0x626)]=!![],_0x21e8f9['id']=_0x2cede6['id'];const _0x4f2f6a={};_0x4f2f6a[_0x17318e(-0x27e,0x699,0xdc,0x405)]=_0x179c62[0x1a2c+-0xb0+-0x1*0x197c],_0x4f2f6a['key']=_0x21e8f9;const _0x31d8a6={};_0x31d8a6[_0x425890(0xf43,0x96c,-0x21,0x290)]=_0x4f2f6a,_0x3bec0c=_0x31d8a6,_0x2d3298[_0x425890(0x59c,0x41f,0x23b,-0x30d)+'e'](_0x27b5ba['chat'],_0x5b96b3);}else{const _0x28128d={};_0x28128d['text']=_0x425890(0x486,0xc36,0x1346,0x103e)+_0x425890(0x5fd,0x6ed,-0x347,0xf63)+_0x425890(-0x409,0x42e,0x69e,0x311)+_0x425890(0xd49,0x42a,0x53d,0xad7)+_0x17318e(0x123c,0x1285,0x1428,0x1507)+'යෙන්\x20තෙමී\x20'+_0x425890(0x1279,0xfe5,0x17aa,0x11cd)+_0x17318e(0x12d4,0xbcd,0x6da,0xb55)+_0x425890(0x117d,0xde7,0x422,0x39f)+_0x425890(0x1522,0x1203,0xbe5,0x15d8)+_0x425890(0x47a,0xab1,0x10d2,0x90)+_0x17318e(0x10c4,-0xfa,-0x15f,0x898)+_0x425890(0xd8a,0xea1,0x5ab,0xf46)+_0x17318e(0xf64,0x1493,0x94c,0xf33)+_0x17318e(0xd58,0xf86,0x15da,0x1480);const _0x37059d={};_0x37059d[_0x17318e(0x295,0xe3e,0x993,0xa24)]=_0x17aa6d,_0x3797bd['sendMessag'+'e'](_0x146a84,_0x28128d,_0x37059d);}}}break;case'🥰':case'😗':case'😙':case _0x295ea5[_0x425890(0x339,0x3e3,0x680,0x415)]:case'😘':case'😍':case _0x295ea5[_0x425890(0xa3d,0xa66,0x443,0x1289)]:case'💗':{if(_0x295ea5[_0x17318e(-0x1b7,-0x47d,0x6fa,0x59d)](global[_0x17318e(0x1192,0x1402,0x89e,0xaf8)],'false'))return;if(_0x295ea5[_0x425890(0xf2a,0x809,0x65,0xf81)](global[_0x425890(0x858,0x8db,-0x1a4,0x7e)],_0x295ea5[_0x425890(0xa51,0x14db,0x18b4,0x1b24)])){const _0x5315fc={};_0x5315fc[_0x425890(0xc3,0x1e8,0xbe1,0x6dc)]='*😘අයි\x20ලව්\x20'+'යූ💗උම්මාහ්'+'🥰🥰🤓*';const _0x344b60={};_0x344b60['quoted']=_0x17aa6d,_0x3797bd['sendMessag'+'e'](_0x146a84,_0x5315fc,_0x344b60);}}break;case _0x295ea5[_0x425890(0xddb,0x154f,0xca6,0x15f3)]:{if(_0x295ea5[_0x17318e(0xc80,0xa13,0x433,0x76e)](global[_0x17318e(0xa22,0x200,0x14ea,0xaf8)],_0x295ea5['wQSJW']))return;if(_0x295ea5['HMKPT'](global[_0x17318e(0xe0,0x5b4,0xaa4,0xaf8)],_0x295ea5['UgBoL'])){const _0x58fe96={};_0x58fe96[_0x17318e(-0x67a,0x50b,-0x3dd,0x405)]=_0x17318e(0x22e,0x1b0,0x103b,0x6a6)+_0x425890(0x1293,0xfd4,0x1644,0x6ca)+_0x425890(0x11c6,0xca4,0x1734,0x7f6)+_0x17318e(0x1667,0x1604,0xd67,0x164f)+_0x17318e(0xb6d,0xe2f,0x874,0x6df)+_0x425890(0xb4d,0x457,0xbcc,-0x4f6)+_0x17318e(0xdd3,0xb23,0x559,0x41a)+_0x425890(0x1c7c,0x13cf,0xa16,0x17f2)+_0x17318e(0x79b,0x6e0,0x1302,0xaae)+_0x17318e(0x1d8d,0x1d6b,0xdf3,0x1585)+_0x425890(0x1168,0xc21,0x8e9,0x64d)+_0x425890(0x1549,0x12cf,0x125a,0xc50)+_0x425890(0xfad,0xaef,0x9e9,0x12bf)+_0x17318e(0x16f6,0x10f2,0x1d72,0x1609)+_0x425890(0x3db,0x1fb,0x9e8,0x24f)+'ww.pornhub'+_0x425890(0x9fb,0x550,0xa9d,0xf43)+_0x425890(0xb5c,0x1357,0xff6,0xf1a)+_0x17318e(0x18c6,0x1ead,0x1204,0x156c)+_0x425890(-0x103,0x47f,-0x2a7,0x5c9)+_0x425890(0x1503,0x1309,0xb14,0x117a)+_0x425890(-0x137,0x22b,0x8b9,0x1e3)+_0x425890(0x1273,0x10e5,0x1afa,0x127e)+'ew_video.p'+_0x17318e(0xa94,0x95a,0xbee,0x103e)+_0x17318e(0x180f,0x15d2,0x1fe0,0x1567)+_0x425890(0x18d0,0xf46,0x751,0x734);const _0x39b8a2={};_0x39b8a2[_0x425890(0x79b,0x807,0x51d,0x776)]=_0x17aa6d,_0x3797bd[_0x425890(-0x54d,0x41f,0xc75,0xb23)+'e'](_0x146a84,_0x58fe96,_0x39b8a2);}}break;case'na':case _0x295ea5[_0x17318e(0x1a2e,0x159f,0x16b9,0x12ca)]:case'නැ':case'නෑ':case _0x295ea5[_0x425890(0x77c,0x727,0x966,0x1152)]:case _0x295ea5['CIXeU']:case _0x295ea5['qPstW']:case _0x295ea5['xacMc']:{if(_0x295ea5[_0x425890(0x806,0xd51,0xa7f,0x15ea)](global['chatbotpre'],_0x295ea5[_0x17318e(0x13c6,0x188e,0x109a,0xee7)]))return;if(global[_0x425890(0x10d2,0x8db,-0x23,0xd48)]===_0x295ea5[_0x17318e(0x150a,0x20e8,0xf07,0x16f8)]){const _0xa58e5={};_0xa58e5['text']=_0x17318e(0x1a68,0x1b4f,0x1664,0x160e)+_0x425890(0x636,0x755,0xc1b,0xc72);const _0x2108d3={};_0x2108d3['quoted']=_0x17aa6d,_0x3797bd[_0x425890(-0x30,0x41f,-0x1b7,0x163)+'e'](_0x146a84,_0xa58e5,_0x2108d3);}}break;case'antispam':{if(_0x295ea5[_0x425890(0x11b7,0x117b,0xdf1,0xc1f)]('LVipj',_0x295ea5[_0x425890(0xab8,0x7fc,0x25f,0xed3)])){const _0x551b33={};_0x551b33[_0x425890(-0x5ad,0x1e8,0x194,0x41f)]='*මොකෝ\x20ඩෝ'+_0x17318e(0x16ba,0x12b6,0x15be,0x117d);const _0x4cf133={};_0x4cf133['quoted']=_0x99e13d,_0x42df0f[_0x425890(0x606,0x41f,0xb19,-0x5bd)+'e'](_0x255cd4,_0x551b33,_0x4cf133);}else{if(!_0x5b4303)return _0x51481c(''+mess['admin']);const _0x51e0a2={};_0x51e0a2[_0x17318e(0xd71,0x6c3,0xcd4,0x405)]='☬𝗥𝗘𝗗༒𝗗𝗥𝗔𝗚𝗢'+_0x17318e(0x1077,0x4ec,0xd55,0x79f)+_0x425890(-0x3b,0x511,-0x393,0xa1b)+_0x17318e(-0x4cd,0x315,0xd59,0x484)+_0x17318e(0x195a,0x1376,0x1c73,0x1853)+_0x425890(0x17f3,0x12e4,0x1741,0xeba)+'💦💦💦\x0a☬𝗥𝗘𝗗༒𝗗'+_0x425890(0x376,0x754,0x5f5,0x656)+_0x425890(0xd1d,0x12cc,0xde5,0x16ee)+_0x425890(0xd03,0x27a,-0x1ef,0x4b0)+'☬𝗥𝗘𝗗༒𝗗𝗥𝗔𝗚𝗢'+_0x17318e(0x202,0x2c0,0xb58,0x8da)+_0x425890(0xba4,0x387,-0x3fe,-0x33a)+'𝗥𝗗🛡️\x0a\x0a\x0a\x0a\x0a\x0a\x0a'+_0x425890(-0x283,0x1fc,-0x6b3,0x827)+_0x425890(0xbfb,0x1fc,0x424,-0x886)+_0x17318e(0x1b31,0xf86,0x14dd,0x1434)+_0x425890(0xbaf,0x11f5,0x15e7,0x1b61)+_0x17318e(0x85b,0x34a,0x4a,0x8d2)+_0x425890(0x80d,0x96e,0x8eb,0xb99)+_0x17318e(0xe00,0x12e2,0xfd8,0x1250)+_0x425890(-0x731,0x1fc,-0x651,0x2d1)+_0x17318e(0xaf4,0x1793,0x1a00,0x1434)+_0x17318e(0x1330,0x1346,0x1eb1,0x1412)+'වළකින්න!\x0aD'+_0x425890(0x79a,0x96e,0x4fe,0x12e0)+_0x425890(0xf6d,0x1033,0xaa5,0x794)+_0x17318e(0xd1,-0x2c0,0x925,0x419)+_0x425890(0x8ab,0xbcc,0x741,0x8ee)+'r\x20කරන්න!\x0aC'+_0x17318e(0x1238,0x134b,0xc81,0xcac)+_0x17318e(0x1b52,0x1e19,0x1db3,0x17ac)+_0x17318e(0xde1,0xdf0,0xe16,0xde9)+_0x17318e(-0x1f6,0x1a1,0x6a1,0x40b)+_0x17318e(0x1584,0xdb9,0x3df,0xcac)+_0x17318e(0x2185,0x1d19,0x117a,0x17ac)+'\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a'+_0x17318e(0x80c,0x7c1,0x264,0x419)+_0x425890(0x830,0x1fc,0x6b2,-0x2fc)+_0x425890(-0x704,0x1fc,-0x169,0x88d)+_0x425890(-0x3e9,0x1fc,0x6cb,-0x157)+_0x425890(0x1893,0x12c3,0xfbd,0xac9)+_0x17318e(0x12c,0x63,0xbfa,0x51f)+_0x425890(-0x3fc,0x260,0x998,0xef)+_0x17318e(0x389,0xb7b,0x8d5,0x3d6)+_0x425890(0xf2f,0x14cb,0x1467,0xbb6)+_0x425890(0x4fa,0x4e0,-0x17e,0x164)+'\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a'+'\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0aCL'+_0x17318e(0x3b7,-0xdc,0x12b,0x714)+_0x17318e(0x803,0x17fe,0x9c6,0xed5)+_0x17318e(0x76b,0x1806,0x69d,0xd8f)+'රන්න!\x0a\x0a\x0a\x0a\x0a'+_0x425890(0x6b7,0x103d,0x93a,0xe3e)+'𝗗𝗥𝗔𝗚𝗢𝗡࿐❤️\x0a🛡️'+_0x425890(0x144c,0xb69,0x1360,0x7e2)+_0x17318e(0x9de,0x135b,0x16b3,0x119c)+'\x0a\x0a',_0x3797bd[_0x425890(0xb09,0x41f,0x3bb,0xb40)+'e'](_0x17aa6d['chat'],_0x51e0a2);}}break;case'react':{if(!_0x193cb6)throw mess['owner'];const _0x31919e={};_0x31919e[_0x17318e(0xfe9,0x1241,0xebd,0xb1c)]=_0x17aa6d['chat'],_0x31919e['fromMe']=!![],_0x31919e['id']=_0x4413ec['id'];const _0x3463d7={};_0x3463d7[_0x17318e(0xb10,-0x197,-0x1f7,0x405)]=_0x52a010[-0x447*-0x1+-0xb96*-0x3+-0x2709],_0x3463d7[_0x17318e(0x11a5,0x1e77,0xa3f,0x1426)]=_0x31919e;const _0x4085ef={};_0x4085ef[_0x17318e(0xd45,0x43f,0x4b5,0xb89)]=_0x3463d7,reactionMessage=_0x4085ef,_0x3797bd[_0x425890(0x2d,0x41f,-0x61f,0x3a8)+'e'](_0x17aa6d[_0x17318e(0x1979,0x527,0x12fa,0xee4)],reactionMessage);}break;case _0x295ea5['KAbbN']:case _0x295ea5[_0x425890(0x4d0,0xc9d,0xec3,0x416)]:case _0x295ea5[_0x17318e(-0xee,0x1009,0x252,0x6d5)]:case _0x295ea5[_0x17318e(0xc26,-0x60f,0xba4,0x474)]:case _0x295ea5[_0x425890(0x75e,0x5e5,0x503,0x221)]:case _0x295ea5[_0x425890(0xa99,0x751,-0x81,-0x332)]:case _0x295ea5[_0x425890(0x116b,0xf94,0x183c,0x101c)]:case _0x295ea5['lEoMY']:case'spooky':case'pencil':case _0x295ea5[_0x425890(-0x6d3,0x323,0x667,0x5ca)]:case _0x295ea5[_0x425890(0x9bb,0x949,0x130d,0xded)]:case _0x295ea5[_0x17318e(0xe3e,0x1903,0xefa,0x168b)]:case _0x295ea5['etHsq']:case _0x295ea5[_0x425890(0x622,0x6bb,0x6c8,0xcb0)]:case _0x295ea5[_0x425890(0x15ed,0xfba,0x185b,0x176f)]:case _0x295ea5[_0x17318e(0x12a,-0x4b3,0x43b,0x4a4)]:case'thunder':case _0x295ea5[_0x425890(0x302,0x875,0x184,-0x5b)]:case _0x295ea5['OBQAf']:case _0x295ea5[_0x17318e(0x16bd,0x1365,0x1060,0x1789)]:case _0x295ea5[_0x17318e(0x15c7,0x12b4,0x4f8,0xe39)]:case _0x425890(0x1174,0x10b1,0x10c2,0x155f)+'r':case _0x295ea5[_0x17318e(0x1415,0x21f9,0x1dce,0x17be)]:case _0x295ea5['bHRFs']:case _0x295ea5[_0x425890(0x96e,0xb1a,0xd7e,0x1552)]:case _0x295ea5[_0x17318e(-0x5c,0x50c,0x8d4,0xa1b)]:case _0x295ea5[_0x17318e(0xd67,0x17ea,0xc16,0xe6e)]:case _0x295ea5[_0x17318e(0x98f,0x1d7,0x685,0x3bd)]:case _0x295ea5[_0x17318e(0x1863,0xc8c,0x1ec7,0x16d0)]:case _0x295ea5[_0x17318e(0x1218,0xfe0,0x5fe,0xd8d)]:case _0x425890(-0x6ed,0x326,0x3f,0x827):case _0x295ea5['ccvYR']:case _0x295ea5[_0x17318e(0x2d8,-0x161,0xc30,0x833)]:case'fruitjuice':case _0x295ea5[_0x425890(0xbab,0x253,-0x454,-0x82e)]:case _0x295ea5[_0x425890(0x1196,0x119b,0x14a8,0x168c)]:case _0x295ea5[_0x17318e(0x1a6e,0xd72,0xf98,0x137b)]:case _0x295ea5[_0x425890(0x92e,0x83e,0x11c0,0x2e9)]:case _0x295ea5['bGPDv']:case'blood':case _0x295ea5['ZjcNj']:case _0x295ea5['scQEb']:case _0x295ea5['PDyPA']:case _0x295ea5[_0x425890(0xdc2,0x4e1,0x574,0x9e3)]:case _0x295ea5[_0x425890(-0x6d,0x8ca,0x74d,0xb47)]:case _0x295ea5[_0x17318e(0x1eeb,0x1c2b,0x147b,0x1493)]:case _0x295ea5['USkKY']:case _0x295ea5[_0x17318e(0x147d,0x1764,0x7d5,0x10b6)]:case _0x295ea5['wTXST']:case _0x17318e(0x1f3,0xa20,0x249,0x535):case _0x17318e(0xe78,0x97b,0x1050,0x1176):case _0x295ea5[_0x425890(0x13c7,0xa05,-0x92,0x8c5)]:case _0x295ea5[_0x425890(0x83c,0xaa8,0xe74,0xa87)]:case _0x295ea5[_0x17318e(0x1615,0x5e3,0x677,0xe5c)]:case _0x425890(0x1301,0x132c,0x14ca,0x1d59):case _0x17318e(0x199c,0xd00,0x2002,0x1633):{if(!q)return _0x295ea5[_0x17318e(0x9c9,0xacd,0x191,0xbec)](_0xcd1d32,'Example\x20:\x20'+_0x295ea5[_0x17318e(0xf6c,0x57a,0x2f1,0x952)](_0x4fea53,_0x1cbc75)+'\x20'+global[_0x17318e(0x22,0x133,0x3b3,0xa88)]);let _0x2140c9;if(/candy/[_0x17318e(0x16c6,0x1875,0x71a,0xfa3)](_0x1cbc75))_0x2140c9=_0x425890(0xecd,0xdaa,0x9ae,0x1312)+_0x425890(0x499,0x1f2,-0x6a2,0xadd)+_0x425890(0x244,0x6c1,0x81c,0x657)+'stmas-cand'+_0x425890(0x15b6,0xfe8,0x1818,0xda8)+_0x17318e(0x199,0x2e2,0x26b,0x53a)+_0x425890(0x1763,0xdec,0x144b,0x559);if(/christmas/[_0x17318e(0xa3c,0xbd9,0x1071,0xfa3)](_0x1cbc75))_0x2140c9=_0x295ea5[_0x17318e(-0x48,0xa49,-0x57b,0x3d8)];if(/3dchristmas/[_0x425890(0x671,0xd86,0xedb,0x1716)](_0x1cbc75))_0x2140c9=_0x295ea5['hsZBz'];if(/sparklechristmas/['test'](_0x1cbc75))_0x2140c9=_0x295ea5[_0x17318e(0x1794,0x812,0xbf8,0x1220)];if(/deepsea/[_0x425890(0x5f6,0xd86,0x1170,0x1372)](_0x1cbc75))_0x2140c9=_0x295ea5[_0x17318e(0x152e,0x173f,0x1514,0x124a)];if(/scifi/[_0x17318e(0xeb1,0x515,0x650,0xfa3)](_0x1cbc75))_0x2140c9=_0x295ea5[_0x17318e(0xd79,0x102b,0x19bc,0x11d2)];if(/rainbow/[_0x17318e(0x8d8,0x11b1,0x19e7,0xfa3)](_0x1cbc75))_0x2140c9=_0x295ea5[_0x425890(0xfd9,0x977,0xf14,0x3b9)];if(/waterpipe/[_0x425890(0x3c3,0xd86,0xa28,0xc43)](_0x1cbc75))_0x2140c9=_0x295ea5[_0x17318e(0x19dc,0xc90,0x1596,0x1313)];if(/spooky/[_0x425890(0x1696,0xd86,0x946,0x1685)](_0x1cbc75))_0x2140c9=_0x295ea5['ifcQO'];if(/pencil/[_0x425890(0x1030,0xd86,0x8ad,0x13a2)](_0x1cbc75))_0x2140c9=_0x295ea5[_0x17318e(0x1b0d,0x1da3,0x1286,0x1365)];if(/circuit/[_0x17318e(0x9b2,0x7c8,0x5c6,0xfa3)](_0x1cbc75))_0x2140c9=_0x295ea5[_0x17318e(0x17fd,0xf02,0x10aa,0x1727)];if(/discovery/[_0x17318e(0xeb5,0x979,0x1295,0xfa3)](_0x1cbc75))_0x2140c9=_0x295ea5[_0x425890(0x1332,0x154b,0xf2a,0x1e23)];if(/metalic/['test'](_0x1cbc75))_0x2140c9=_0x295ea5['WvJmC'];if(/fiction/['test'](_0x1cbc75))_0x2140c9=_0x295ea5[_0x17318e(0x12bc,0x158,0xa60,0xb23)];if(/demon/[_0x425890(0x1282,0xd86,0x1421,0x51e)](_0x1cbc75))_0x2140c9=_0x295ea5[_0x425890(0x1aa,0xa39,0x1492,0x10c6)];if(/transformer/[_0x17318e(0x1a1a,0x1991,0x1871,0xfa3)](_0x1cbc75))_0x2140c9=_0x295ea5[_0x425890(0xffc,0xe02,0xe5f,0x119e)];if(/berry/[_0x17318e(0xe3f,0x182b,0x9ed,0xfa3)](_0x1cbc75))_0x2140c9=_0x295ea5[_0x17318e(-0x31e,0x108e,0xe55,0x633)];if(/thunder/[_0x17318e(0x1441,0x1558,0xa16,0xfa3)](_0x1cbc75))_0x2140c9=_0x295ea5['vvWVM'];if(/magma/[_0x425890(0x15bf,0xd86,0xad1,0x1207)](_0x1cbc75))_0x2140c9='https://te'+_0x425890(0x8b4,0x1f2,-0x1ab,0x37c)+_0x425890(0x8b3,0x5af,0xe1c,0xe1d)+'gma-hot-te'+_0x17318e(-0x3c3,0x125,0x958,0x4c7)+_0x17318e(0xfbc,0x1845,0x1200,0xe06)+_0x425890(0xc96,0x75d,0x25,0x836);if(/3dstone/[_0x425890(0x82b,0xd86,0x849,0xbe2)](_0x1cbc75))_0x2140c9=_0x295ea5[_0x425890(0xafc,0x5ba,0x94d,0xe43)];if(/neonlight/[_0x17318e(0xf73,0x1984,0xcfe,0xfa3)](_0x1cbc75))_0x2140c9=_0x295ea5['aZNKA'];if(/glitch/[_0x425890(0x15fe,0xd86,0xed7,0x17f8)](_0x1cbc75))_0x2140c9=_0x295ea5[_0x425890(0x173b,0x12ab,0x1447,0x1bde)];if(/harrypotter/[_0x425890(0x652,0xd86,0xbd3,0x1479)](_0x1cbc75))_0x2140c9=_0x295ea5[_0x425890(-0x181,0x17b,0x873,0x600)];if(/brokenglass/['test'](_0x1cbc75))_0x2140c9=_0x295ea5[_0x425890(0xa15,0x132,0x91e,0x8f5)];if(/papercut/[_0x17318e(0x875,0x1865,0x11d0,0xfa3)](_0x1cbc75))_0x2140c9=_0x295ea5[_0x17318e(-0x18b,-0x600,0x408,0x382)];if(/watercolor/['test'](_0x1cbc75))_0x2140c9=_0x295ea5[_0x17318e(0xcd2,0xe57,0x1361,0x112b)];if(/multicolor/[_0x425890(0x1021,0xd86,0x1795,0xdee)](_0x1cbc75))_0x2140c9=_0x295ea5[_0x17318e(0x1d86,0x1341,0x1995,0x1310)];if(/neondevil/[_0x17318e(0x1245,0x645,0x1711,0xfa3)](_0x1cbc75))_0x2140c9=_0x425890(0x169a,0xdaa,0x66e,0x1521)+_0x17318e(0x665,-0x64e,0x72f,0x40f)+'reate-neon'+'-devil-win'+_0x17318e(0x46b,0x1069,0xd2c,0x5ef)+'fect-onlin'+_0x425890(0x16bd,0x1282,0x169e,0x1607)+'4.html';if(/underwater/['test'](_0x1cbc75))_0x2140c9=_0x295ea5[_0x425890(0x192e,0xf1a,0x7ec,0x1265)];if(/graffitibike/[_0x17318e(0xb61,0xd03,0xedb,0xfa3)](_0x1cbc75))_0x2140c9=_0x17318e(0x16a1,0xe14,0x1065,0xfc7)+_0x425890(-0x762,0x1f2,0x5e8,0x6ed)+_0x17318e(0x16e4,0x309,0xa86,0xca3)+_0x425890(0x11cc,0x77e,0xdbb,0x6a6)+_0x425890(-0x168,0x6d7,0x75,0x10db)+_0x17318e(0x42f,0xcf7,0x333,0x550)+_0x425890(0x784,0x1215,0xbff,0xa08);if(/snow/['test'](_0x1cbc75))_0x2140c9=_0x17318e(0x10e7,0xed9,0xd76,0xfc7)+_0x17318e(0x70b,0x54e,-0x2f2,0x40f)+_0x425890(0x1ba6,0x15a9,0xfb2,0xe8a)+_0x17318e(0x188d,0x10ee,0xaed,0x1031)+_0x17318e(0x72c,-0x2a9,0x506,0x634)+_0x17318e(0xa85,0x1275,0x16df,0x1442)+_0x17318e(0x1797,0x19b6,0xe68,0x112d)+_0x17318e(0x2009,0x20d6,0x207a,0x1713);if(/cloud/[_0x425890(0x11a7,0xd86,0xdc3,0xdb7)](_0x1cbc75))_0x2140c9='https://te'+_0x425890(-0x630,0x1f2,0x847,-0x63f)+_0x17318e(0x122,0xb74,0x8b1,0x5c4)+'oud-text-e'+'ffect-on-t'+_0x425890(0x164,0x603,-0x144,0x211)+'ine-1004.h'+_0x425890(0x1703,0x14f6,0xcfe,0x13b3);if(/honey/[_0x17318e(0x10ad,0x19d3,0x1246,0xfa3)](_0x1cbc75))_0x2140c9=_0x295ea5['hPziz'];if(/ice/['test'](_0x1cbc75))_0x2140c9=_0x295ea5['Szvpj'];if(/fruitjuice/[_0x17318e(0x1971,0xf8b,0x15bd,0xfa3)](_0x1cbc75))_0x2140c9=_0x295ea5[_0x17318e(0x1080,0x153d,0x182c,0x180d)];if(/biscuit/[_0x17318e(0x5ad,0xe35,0xa3c,0xfa3)](_0x1cbc75))_0x2140c9=_0x295ea5[_0x17318e(0x1b5a,0x1c93,0x98b,0x1305)];if(/wood/[_0x425890(0xc11,0xd86,0xb6c,0x302)](_0x1cbc75))_0x2140c9=_0x295ea5['xMlld'];if(/chocolate/['test'](_0x1cbc75))_0x2140c9=_0x17318e(0xba8,0x1620,0x19a2,0xfc7)+_0x17318e(0xe28,0xb2,0x313,0x40f)+_0x17318e(0xd73,0x1309,0x12c3,0xfb3)+_0x425890(0x14d0,0x10d9,0x717,0x1838)+_0x425890(0x403,0xa38,0x14af,0x861)+'html';if(/strawberry/[_0x17318e(0x779,0xa1a,0x14af,0xfa3)](_0x1cbc75))_0x2140c9=_0x425890(0xff1,0xdaa,0x6af,0x88c)+'xtpro.me/s'+_0x425890(0x19b9,0x1202,0x1bc8,0xe73)+_0x17318e(0x8d6,0x98c,0x1d1,0x924)+_0x17318e(0x1195,0x7cd,0xc9b,0x11bc)+'89.html';if(/matrix/[_0x17318e(0xafe,0x157f,0x16b9,0xfa3)](_0x1cbc75))_0x2140c9='https://te'+_0x17318e(-0x347,0x1c7,0xe08,0x4d3)+_0x17318e(0x126c,0x1e01,0x12db,0x14a9)+'e-text-eff'+'ect-online'+_0x425890(0x16e7,0x1236,0x1c8a,0x1224);if(/blood/[_0x425890(0x135a,0xd86,0x11b6,0x9b5)](_0x1cbc75))_0x2140c9=_0x295ea5[_0x17318e(0x140a,0x18c7,0x657,0xf8f)];if(/dropwater/['test'](_0x1cbc75))_0x2140c9=_0x295ea5[_0x17318e(0x1197,0x50f,0x9ef,0xd1e)];if(/toxic/[_0x17318e(0x153c,0x715,0x1533,0xfa3)](_0x1cbc75))_0x2140c9=_0x295ea5[_0x425890(-0x1a1,0x24e,0x784,-0x572)];if(/lava/[_0x17318e(0x19b9,0x1431,0x14b9,0xfa3)](_0x1cbc75))_0x2140c9=_0x295ea5[_0x17318e(0xe51,0xb67,0xb0e,0x1026)];if(/rock/[_0x17318e(0x658,0x123f,0x876,0xfa3)](_0x1cbc75))_0x2140c9=_0x295ea5[_0x17318e(0x1763,0xd9c,0x344,0xd9e)];if(/bloodglas/['test'](_0x1cbc75))_0x2140c9=_0x295ea5[_0x17318e(0x12e3,0x1348,0x129f,0xdf9)];if(/hallowen/['test'](_0x1cbc75))_0x2140c9=_0x295ea5[_0x17318e(0x282,0x11db,0x194,0x840)];if(/darkgold/[_0x425890(0xce6,0xd86,0x1330,0x9fa)](_0x1cbc75))_0x2140c9=_0x295ea5[_0x425890(0x1618,0x10af,0x993,0x1795)];if(/joker/[_0x17318e(0xd70,0xe19,0x171c,0xfa3)](_0x1cbc75))_0x2140c9=_0x295ea5['jAKLq'];if(/wicker/[_0x425890(0xc51,0xd86,0xd09,0xb96)](_0x1cbc75))_0x2140c9=_0x295ea5['CJyfK'];if(/firework/['test'](_0x1cbc75))_0x2140c9=_0x295ea5['rbcTT'];if(/skeleton/[_0x425890(0x1372,0xd86,0xb3c,0xab8)](_0x1cbc75))_0x2140c9=_0x295ea5['AlkEo'];if(/blackpink/[_0x425890(0xbaa,0xd86,0x976,0x13e1)](_0x1cbc75))_0x2140c9=_0x295ea5[_0x425890(0x47c,0x724,0x63c,-0xa1)];if(/sand/['test'](_0x1cbc75))_0x2140c9=_0x295ea5[_0x17318e(0xb4b,0x7c1,0xc29,0x7e6)];if(/glue/['test'](_0x1cbc75))_0x2140c9=_0x425890(0x617,0xdaa,0xdeb,0xfab)+_0x425890(-0x6b8,0x1f2,0xaeb,-0x457)+_0x17318e(0x1e62,0x10e7,0x19a1,0x15c6)+_0x17318e(0xe0e,0xb93,0x1aea,0x14fd)+'ffect-with'+_0x17318e(0x18a6,0x1f3b,0x1786,0x17aa)+_0x17318e(0xa30,-0x1f2,0x46,0x480)+_0x17318e(0x1b52,0x11eb,0x1ead,0x14c7);if(/1917/[_0x425890(0x161e,0xd86,0x150d,0x12f9)](_0x1cbc75))_0x2140c9=_0x295ea5['lXNSO'];if(/leaves/[_0x425890(0x102b,0xd86,0xb96,0x1581)](_0x1cbc75))_0x2140c9=_0x295ea5[_0x425890(0xf30,0xebb,0x9c4,0x1355)];let _0x515c81=await maker[_0x425890(-0x334,0x429,0xa75,0x9aa)](_0x2140c9,q);const _0x2b58ca={};_0x2b58ca['url']=_0x515c81;const _0x43f843={};_0x43f843['image']=_0x2b58ca,_0x43f843[_0x17318e(-0x21,-0x46,-0xb7,0x527)]=_0x425890(0x403,0x3d3,0x908,-0x15b)+_0x425890(0x8b7,0xcab,0xa2a,0x7c7)+_0x425890(0xd1f,0xa96,0x4c5,0x815)+'ᴛ*',_0x3797bd[_0x425890(0x76c,0x41f,-0x209,0x848)+'e'](_0x17aa6d['chat'],_0x43f843,{'quoted':_0x17aa6d});}break;case _0x295ea5[_0x17318e(-0x293,-0xe5,0x3c9,0x7d8)]:{if(_0x17318e(0x13fd,0x109d,0xa45,0x1350)===_0x17318e(0x625,0x149f,0x1ff,0xae4))return[this['a'],this['b']][_0x425890(0x21f,0x291,0xad5,-0x6f1)](_0x458549);else{if(_0x52a010[_0x425890(0x570,0x8bc,-0x18e,0xa6e)]<0x1d9*0x1+0x16ec+-0x18c4)return _0x295ea5[_0x425890(0x8c4,0x121c,0x122a,0x1911)](_0xcd1d32,_0x17318e(0x53,0x6d9,0x404,0x427)+_0x295ea5[_0x425890(0x1fc,0x8bd,0xc44,0xda2)](_0x4fea53,_0x1cbc75)+_0x17318e(0xb7d,-0x330,0x772,0x568));if(_0x52a010[0x1*-0x40+-0x3*0x9ad+-0x1*-0x1d47]===_0x295ea5['WdqzE']){if(_0x295ea5[_0x425890(0xfc1,0x9e6,-0x5a,0x1191)](_0x295ea5[_0x425890(0x12d2,0xdf8,0x1576,0x9eb)],_0x295ea5[_0x17318e(0xca9,0x1838,0x658,0x1015)])){if(_0x295ea5[_0x425890(0xd58,0x122b,0x1156,0x1c3c)](_0x52a010[_0x17318e(0x14fb,0x148c,0x77b,0xad9)],0x1*0x35+-0x8*-0xa4+-0x553))return _0x295ea5[_0x17318e(0x18d7,0x1baf,0x1cf4,0x17c5)](_0xcd1d32,_0x425890(0xbb0,0x20a,0xc6c,0x640)+(_0x295ea5[_0x425890(0x182,0x353,0xcc1,0x7ad)](_0x4fea53,_0x1cbc75)+'\x20'+_0x52a010[0x67*0x57+0x10d9+0x19ed*-0x2])+'\x20'+global[_0x425890(0xb71,0x86b,0x7e1,0x88c)]);let _0x22b6b2=await thiccysapi['textpro'](_0x295ea5['tCYEr'],[_0x52a010[0x1*-0x1859+-0x1*0x26c9+0x3f23]]);const _0x3f4ee6={};_0x3f4ee6[_0x425890(-0x122,0x5f3,0xf43,0xd1b)]=_0x22b6b2;const _0x42d4be={};_0x42d4be[_0x425890(0x24,0x381,0x879,0xbe9)]=_0x3f4ee6,_0x42d4be[_0x17318e(0x1af,0xe2,-0x142,0x527)]=_0x295ea5['zpjgt'];const _0x4edc66={};_0x4edc66[_0x17318e(0x5d,0x12a9,-0x18,0xa24)]=_0x17aa6d,_0x3797bd['sendMessag'+'e'](_0x146a84,_0x42d4be,_0x4edc66);}else{if(!_0x270ace[_0x17318e(0x98a,0xa5a,0x25,0xa24)])_0x295ea5[_0x17318e(0xd19,0xce5,0x605,0xef1)](_0x1ec6a4,![]);let {chat:_0x4a9915,fromMe:_0x591b25,id:_0x285445,isBaileys:_0x3c5ee8}=_0x47816c[_0x425890(0x68d,0x807,0x1e7,0xcc1)];if(!_0x3c5ee8)return _0x295ea5['aNrRY'](_0x464c96,_0x17318e(0xf0a,0x12d2,0x1383,0x14f4)+_0x17318e(0x1b3c,0x1708,0x1615,0x1762)+'Sent\x20By\x20A\x20'+_0x425890(0xde0,0x15e0,0x1b05,0xca0));const _0x38a426={};_0x38a426['remoteJid']=_0x1514ae['chat'],_0x38a426['fromMe']=!![],_0x38a426['id']=_0x2cb05e[_0x17318e(0x149f,0x52a,0x6cc,0xa24)]['id'],_0x38a426[_0x425890(0x1025,0x143a,0x1c14,0x19b4)+'t']=_0x23a4ca[_0x425890(-0xf9,0x807,0xff8,0x6d7)][_0x425890(0xc8a,0xa69,0x12db,0x69f)];const _0x5df994={};_0x5df994[_0x425890(0x20,0x43c,0xe36,0xec4)]=_0x38a426,_0x3dd4a1[_0x17318e(0x122,0x1077,0xdf,0x63c)+'e'](_0x3a2aff[_0x17318e(0x18e3,0x57d,0xda9,0xee4)],_0x5df994);}}else{if(_0x52a010[-0x394+-0x1*-0x1fc7+0x1*-0x1c33]==='glow'){if(_0x52a010[_0x425890(0x12fb,0x8bc,0xdd2,0x795)]<-0x1d*-0x14f+-0xf09+-0x8*0x2dd)return _0x295ea5[_0x425890(0xfcc,0x6d5,-0x63,0xbb7)](_0xcd1d32,_0x17318e(0xb79,-0x183,0x75,0x427)+_0x295ea5['ZTzXs'](_0x295ea5['hFndt'](_0x295ea5[_0x425890(0x14f9,0xd7d,0xedb,0x1311)](_0x4fea53,_0x1cbc75),'\x20'),_0x52a010[-0x1b6a+-0x53a*-0x3+0xbbc])+'\x20'+global[_0x17318e(0x1a5,0x7dc,0x6c3,0xa88)]);let _0xa0f19b=await thiccysapi[_0x17318e(0x66,0xbba,0x2e1,0x646)](_0x425890(0x1199,0xdaa,0xbc8,0xccd)+_0x17318e(0xbcd,0xe1f,0xced,0x40f)+_0x17318e(0xc7c,0xc94,0x3bd,0xad3)+_0x17318e(0x927,0xcc,0x1310,0xadb)+_0x425890(0x94c,0x29f,0x128,-0x2a0)+_0x425890(0x1472,0xdeb,0x11e9,0xe11)+'ne-1068.ht'+'ml',[_0x52a010[-0x3dd*-0x2+-0x9*0x9f+-0x222]]);const _0x10f936={};_0x10f936['url']=_0xa0f19b;const _0x4bfd4b={};_0x4bfd4b['image']=_0x10f936,_0x4bfd4b[_0x425890(0x623,0x30a,-0x211,-0x55)]=_0x295ea5['zpjgt'];const _0x3317de={};_0x3317de['quoted']=_0x17aa6d,_0x3797bd[_0x425890(0xb18,0x41f,0xcf5,0x839)+'e'](_0x146a84,_0x4bfd4b,_0x3317de);}else{if(_0x295ea5['ggNLX'](_0x295ea5[_0x425890(0x116c,0xf7c,0x1970,0x12a6)],_0x17318e(0x1457,0xfa2,0x1bb4,0x174a))){const _0x53077e={};_0x53077e[_0x17318e(0xe57,0xd0c,0x448,0x405)]=_0x425890(0x1471,0xc4c,0xefe,0x50b)+_0x17318e(0xc2f,0x611,0x13a9,0xb7a)+_0x425890(0x4cc,0x112,0x1fd,-0x413)+_0x425890(0xc7e,0x9be,0x712,0xa78)+_0x17318e(0x8ec,0x66a,0xaab,0x4aa)+'්\x20ඔබ\x20සැමට🙏'+'\x20සුභම\x20සුභ\x20'+_0x425890(0xf4a,0xba6,0x1040,0x8d1)+_0x17318e(0x1fc7,0xe99,0x12dd,0x17b4);const _0x1a5fd7={};_0x1a5fd7[_0x425890(0x79,0x807,0x74d,0xacd)]=_0x2a09f1,_0xed544a[_0x425890(0x629,0x41f,-0x25d,-0x49c)+'e'](_0x4cf200,_0x53077e,_0x1a5fd7);}else _0xcd1d32(_0x17318e(0xcc9,0x127f,0x1079,0xbb6)+_0x17318e(0xae7,0x8cc,0x255,0x67b)+_0x425890(0x18fe,0x12b9,0xf12,0x10c7)+_0x425890(0x1337,0xd03,0x85a,0x145f));}}}}break;case _0x295ea5[_0x17318e(0x146,-0x15,-0x3c3,0x645)]:case _0x295ea5[_0x17318e(0x17aa,0xf3e,0x121c,0x14fb)]:case _0x17318e(0x89e,0x173f,0x3b9,0xddf):case _0x17318e(-0x2fe,0xbcc,0xdca,0x63b):case _0x295ea5[_0x425890(0x1680,0x1011,0x1975,0xad9)]:case _0x295ea5[_0x17318e(0xda6,0x209,0x511,0x652)]:case _0x17318e(0x6c0,0xb4d,0x423,0x9a7):case _0x295ea5[_0x17318e(0xb80,0x10a4,0x1978,0x1606)]:case _0x295ea5[_0x17318e(0x7ce,0x1356,0x127c,0xb39)]:case _0x295ea5[_0x17318e(0xc60,-0x3e0,0xf68,0x67a)]:case _0x295ea5[_0x425890(0x1d2a,0x12ef,0x1ade,0x1a00)]:case _0x17318e(0x984,0x1839,0x1562,0xdb7):case _0x295ea5[_0x17318e(0x1432,0x105d,0xfa1,0x14d1)]:case _0x295ea5[_0x17318e(-0x212,0x93e,-0x225,0x3bc)]:case _0x425890(0x1239,0xb0f,0x1291,0xd9b):case _0x295ea5[_0x425890(0xab1,0x10c1,0xeb4,0x165b)]:case _0x295ea5['fIdMe']:case _0x295ea5[_0x425890(0xb4f,0x71a,-0x291,0xe52)]:case _0x295ea5[_0x17318e(0x1078,0x1083,0x1dec,0x146a)]:case _0x295ea5['LkkbQ']:case _0x295ea5[_0x425890(0x87d,0x900,0x4ff,0xd34)]:case _0x17318e(0x1111,0x11da,0xd62,0x1709):case _0x295ea5[_0x17318e(0x1155,0xd85,0xabb,0x9f8)]:case _0x295ea5[_0x425890(0xad9,0xe18,0xcf3,0x924)]:case _0x17318e(0x31c,0x86c,0x366,0x940):case _0x295ea5[_0x17318e(0x703,0x94b,0x70d,0xaa7)]:case _0x295ea5[_0x425890(0x121a,0x88c,0x333,0x1b6)]:case _0x295ea5['KHtwz']:case _0x295ea5[_0x17318e(0x1021,0x76a,0x8fb,0x89d)]:_0x295ea5[_0x17318e(0x2e,0x5e1,0x938,0x365)](_0xcd1d32,mess['wait']),axios[_0x17318e(0x741,0x1b0c,0x18f8,0x11cc)](_0x425890(0x1c7c,0x1395,0x958,0x1957)+_0x17318e(0x1087,0x4af,0x75,0x9c2)+_0x17318e(0x190b,0x1378,0x176c,0x133c)+_0x1cbc75)['then'](({data:_0x10a5c6})=>{const _0x5b6686={};function _0x118060(_0x4d72d7,_0x3d2b51,_0x53f793,_0x89c03c){return _0x17318e(_0x4d72d7-0x97,_0x53f793,_0x53f793-0x72,_0x3d2b51-0x109);}_0x5b6686[_0x118060(0x208,0x96b,0x1ec,0x173)]=global[_0x50a202(0x3cd,0x8be,0xa89,-0x545)],_0x5b6686[_0x118060(0x9e5,0x687,0x1093,0x301)]=global[_0x118060(-0x82,0x687,0x10da,-0x101)];function _0x50a202(_0x7ebba5,_0x305d04,_0x29ee23,_0x133b46){return _0x17318e(_0x7ebba5-0xe2,_0x305d04,_0x29ee23-0xa3,_0x7ebba5- -0x495);}_0x3797bd[_0x50a202(0x141,-0x20f,0x92e,-0x66d)+_0x50a202(0x1e2,0x123,0x223,0xafa)](_0x17aa6d[_0x50a202(0xa4f,0xf2c,0x33c,0x312)],_0x10a5c6[_0x118060(0xd9a,0x919,0x12e1,0x5b4)],_0x17aa6d,_0x5b6686);});break;case _0x295ea5[_0x425890(0xf41,0x5a2,-0x432,0xbbd)]:case _0x295ea5[_0x17318e(0xe8b,0x17cf,0x1d00,0x173e)]:_0x295ea5[_0x425890(0x24f,0x620,-0x237,0xc73)](_0xcd1d32,mess[_0x425890(-0x3ed,0x2c6,-0x544,-0x602)]),axios['get']('https://ap'+_0x425890(0x1191,0x7a5,0x9e1,-0x198)+_0x17318e(0x4d1,0x403,0xf07,0xac6)+'fu')[_0x425890(0x1d7,0x1b3,0x5dc,0x52b)](({data:_0x1afdf6})=>{function _0x28784f(_0x1a6827,_0xfdd413,_0x6dcc14,_0x5d1957){return _0x425890(_0x5d1957,_0xfdd413- -0x312,_0x6dcc14-0x8d,_0x5d1957-0x150);}const _0x5366ec={'vqyzs':function(_0x49e56b,_0x1b0e2a){return _0x295ea5['WgLCB'](_0x49e56b,_0x1b0e2a);},'VSkiY':function(_0x911dc3,_0x295fd6){function _0x4ecbcf(_0x31eba6,_0x355b7a,_0xe9ea12,_0x4c479c){return _0x5492(_0x31eba6-0x38c,_0x355b7a);}return _0x295ea5[_0x4ecbcf(0xa1c,0xcf7,0x62f,0x4fd)](_0x911dc3,_0x295fd6);}};function _0x25c8c4(_0x2884d9,_0x50720d,_0x5682b2,_0x23a2b4){return _0x17318e(_0x2884d9-0x1dc,_0x2884d9,_0x5682b2-0xbe,_0x50720d- -0x4c6);}if(_0x295ea5[_0x28784f(-0xe5,-0x1d6,0x645,0x3cb)](_0x295ea5[_0x25c8c4(0x8a9,0x1118,0xfc6,0xa9f)],_0x28784f(0xeec,0x660,0xc20,0x2d9)))_0x3797bd[_0x28784f(0x986,0x832,0x4b5,0x59a)](_0x17aa6d['chat'],_0x1afdf6[_0x28784f(0x37b,0x2e1,0xcc,-0xa7)],mess[_0x28784f(0x1043,0x9a1,0xbdf,0xec9)],_0x17aa6d);else{if(!_0x5366ec[_0x28784f(0x1885,0x12af,0x1d3b,0x13dc)](_0x109911,_0x1bf713[_0x25c8c4(0x609,-0x122,0x324,-0x70)]))_0x59d31e['afkTime']=-(-0x793+0xcb*0x11+0x1*-0x5e7);if(!_0x5366ec[_0x25c8c4(0xad3,0x46d,0x65f,0x92b)]('afkReason',_0x17fa28))_0x4ad84f[_0x25c8c4(0xb7d,0x9a5,0xe5f,0xf7e)]='';if(!_0x5366ec['vqyzs'](_0x283d1e,_0x51ba26['limit']))_0x81dd47[_0x28784f(0x693,0x4ce,0x6ef,0x4a8)]=_0xc7c2e9;}});break;case _0x295ea5[_0x17318e(-0x381,0x821,0x511,0x548)]:if(!_0x116129)return _0x295ea5[_0x17318e(0x114f,0x4a5,0x34c,0x914)](_0xcd1d32,_0x295ea5[_0x17318e(0x15a9,0x20d4,0x1087,0x1772)]);if(q==_0x295ea5[_0x17318e(0x5ff,0x1472,0x9d6,0xc20)])_0x295ea5['ThaCv'](_0x295ea5[_0x17318e(0x882,0x1781,0x13c7,0x124d)],_0x295ea5[_0x425890(0x8d6,0x1030,0x160f,0xba9)])?_0x59fc1b(_0xe73460[_0x425890(0x259,0xa69,0x91a,0xeb3)]):(typemenu=_0x425890(-0x2b8,0x381,0xd6c,0x35c),_0xcd1d32(_0x295ea5['hFndt'](_0x295ea5[_0x425890(0xded,0xa6f,0x1488,0x5b6)],q)));else{if(_0x295ea5[_0x17318e(0x110f,0x11da,0x1a37,0x16b5)](q,_0x295ea5[_0x425890(0x113f,0xdc6,0x3f6,0x1283)]))typemenu=_0x295ea5[_0x425890(0x14b1,0xdc6,0x169b,0x451)],_0x295ea5[_0x17318e(0x1196,0xdbb,0x575,0xfe2)](_0xcd1d32,_0x295ea5[_0x17318e(0xe6a,0x604,0xe7a,0xc8c)]+q);else q==_0x425890(0x13c2,0xa22,0xf27,0x23f)&&(_0x295ea5[_0x425890(0xdcd,0x10e6,0xfb4,0xb36)](_0x295ea5[_0x425890(0x882,0x855,0x111b,0x94d)],_0x295ea5[_0x17318e(0x1a9c,0xe00,0xf0f,0x10a2)])?_0x302c25[_0x462c97[_0x425890(0x12b6,0xa69,0xe48,0x1135)]['split']('@')[0x351*0x7+-0x5fc*-0x5+0x1*-0x3523]]=_0xa61925[_0x425890(0x2e6,0x84a,0x6c,0x648)]['toLowerCas'+'e']():(typemenu=_0x295ea5[_0x425890(0x429,0xa9f,0x14c1,0x13b9)],_0x295ea5[_0x425890(0x1a67,0x11de,0x1bec,0x17cc)](_0xcd1d32,_0x295ea5[_0x425890(0x87e,0x126,0xa4,-0x551)](_0x295ea5['lIZGM'],q))));}break;case _0x425890(-0xc7,0x5ea,0x5ed,0xfaf):case _0x295ea5['XygZW']:{if(!_0x116129)return _0x295ea5[_0x17318e(0x13a4,0x117b,0xd6b,0x1433)](_0xcd1d32,_0x425890(0x12a6,0xd93,0xf6a,0xef7)+'Bug\x0a\x0a=(Exa'+'mple)=\x20'+_0x1cbc75+(_0x425890(0x1ca,0xb8d,0xf91,0x8f7)+'r!'));_0x3797bd[_0x425890(0xa40,0x41f,0xe15,-0x15e)+'e'](_0x17318e(0xd5e,0x1d3c,0x1642,0x155f)+_0x425890(-0x2b,0x42f,0xbb2,0x48d)+_0x425890(0x784,0xa20,0xe05,0xdf8),{'text':_0x17318e(0xb51,-0x136,-0x1ed,0x856)+'t\x20From:*\x20w'+_0x425890(-0xe3,0x748,0xc35,-0x1f6)+_0x17aa6d[_0x17318e(0x164e,0x1493,0xfa7,0xc86)][_0x17318e(0x61c,0x643,0xbf8,0x508)]('@')[-0x1247*-0x1+-0x3f5*0x4+-0x273]+(_0x17318e(0xafb,0x191,0x12e6,0xc2d)+_0x17318e(0x1702,0x1b79,0x1557,0x17dd))+_0x116129}),_0xcd1d32(_0x425890(0x1393,0x10c5,0x6ef,0x14d4)+'ly\x20Reporte'+_0x17318e(0x8e4,0xc13,-0xb8,0x3ef)+_0x17318e(0xad7,0x1623,0x1768,0x147f)+_0x425890(0xbd5,0xc6e,0xd7d,0x39b)+_0x17318e(0x1355,0x652,0x11e7,0xa65)+_0x17318e(0xab5,0xa8f,-0x91,0x502)+_0x17318e(0x1070,0x13f4,0x14d8,0x1323)+_0x17318e(0xbb9,0x471,0xfdc,0x9e8)+_0x425890(0x18ff,0x1484,0x187d,0x1544)+'is\x20Feature'+_0x17318e(0x657,0x10fa,0x82a,0x107c)+'\x20Again\x20For'+_0x17318e(0x171c,0xedc,0x1465,0x13a3)+_0x17318e(0x1491,0xccf,0x8f3,0x12f1)+_0x17318e(0xf02,0x4f4,0xcd7,0x84a)+_0x425890(0x13e4,0x11c2,0xece,0xf98)+'\x20!');}break;case _0x295ea5[_0x425890(0x14a8,0xc6f,0x1461,0x1682)]:case _0x295ea5[_0x425890(0xbac,0x1481,0x1614,0x1150)]:case _0x295ea5[_0x425890(-0x49b,0x5cf,0x2ca,0xd30)]:case _0x295ea5[_0x17318e(0x1741,0xf13,0x1613,0xfe3)]:timestampe=_0x295ea5['UdqTf'](speed),latensie=_0x295ea5[_0x425890(0x594,0x4b9,0xf3a,0x7aa)](_0x295ea5[_0x17318e(0x699,0xd05,0x127a,0x9b3)](speed),timestampe);var _0x17fbe5=await _0x295ea5[_0x425890(0x825,0x587,0xcc0,0x3e)](getBuffer,_0x295ea5[_0x425890(0x8e2,0x5f2,-0x2a2,0xb2d)]);const _0x23dc34={};_0x23dc34['displayTex'+'t']=''+button,_0x23dc34[_0x425890(0xc37,0x5f3,0x947,0xd1d)]=''+btnurl;const _0x2f7eed={};_0x2f7eed['urlButton']=_0x23dc34,await _0x3797bd[_0x17318e(0x12ec,0xb83,0xb8d,0x1109)+'g'](_0x146a84,_0x295ea5[_0x425890(0x5d1,0x1d5,-0x1fa,0x35f)](_0x295ea5[_0x425890(0x31d,0xaa4,0x2e2,0x207)]('',''),'\x20'),_0x17318e(0x382,0xe0a,0xb7c,0xb75)+_0x2cbadb+('\x0a●●➾\x20I\x20am\x20'+_0x17318e(0x42,0x9ff,0x1ca,0x6e4)+'\x20')+botname+(_0x17318e(0x17e0,0xe19,0x1a0a,0x1241)+_0x425890(0x18bd,0x1546,0xd0f,0x15ee)+_0x425890(0x1277,0x1546,0x1df8,0x1894)+'⦀⦀⦀⦀⦀⦀⦀\x0a▌✮'+'❯\x20𝙊𝙬𝙣𝙚𝙧\x20𝙉𝙖'+_0x425890(0xbca,0x2cd,0x87,-0x4e1))+global[_0x425890(0x232,0x86b,0x5ff,0x854)]+(_0x17318e(0xfff,0xc0c,0x5a4,0x8e6)+'\x20𝙉𝙪𝙢𝙗𝙚𝙧\x20:')+global[_0x17318e(0x13b8,0x1553,0x1a80,0x1494)]+(_0x17318e(0xde4,0x1972,0x1010,0x14c6)+_0x17318e(0x198,0x117b,0x147f,0xa1c))+latensie['toFixed'](0x1ed*0x11+0x171a*0x1+-0x37d3)+('\x20milisecon'+_0x17318e(0x117b,0xb39,0x11ea,0x778)+_0x17318e(0x118a,0x35c,0x5f1,0x8fe))+os[_0x17318e(0xe68,0x1069,-0xdd,0x8f7)]()+(_0x425890(0x1055,0x1024,0x1aad,0xf0e)+_0x425890(0x1419,0x1546,0xedd,0x1fca)+'⦀⦀⦀⦀⦀⦀⦀⦀⦀⦀'+_0x425890(0xd5f,0xf3a,0x125b,0x878))+global[_0x17318e(0x13bb,0x9a3,0x76a,0xaaa)]+(_0x425890(0x467,0xbca,0x1487,0x14c2)+'༒𝗗𝗥𝗔𝗚𝗢𝗡-𝗕𝗢'+_0x425890(0x8fa,0xbb1,0x309,0x15a8)),_0x17fbe5,[{'urlButton':{'displayText':_0x295ea5[_0x425890(0x991,0x356,0xacd,-0x4d5)],'url':_0x295ea5['MwvMP']}},_0x2f7eed,{'quickReplyButton':{'displayText':_0x295ea5[_0x425890(0x1647,0x145c,0xa89,0x18be)],'id':_0x4fea53+_0x17318e(0x1d79,0xce9,0x1661,0x1494)}},{'quickReplyButton':{'displayText':_0x17318e(0xc54,0x11bf,0x1746,0xcbe)+_0x17318e(0xb84,0xee8,0x877,0x1225),'id':_0x4fea53+_0x17318e(0xe9b,0x1e5c,0xdbd,0x14c9)}}]);break;case _0x17318e(0x1163,0x1975,0x2030,0x167e):{_0x295ea5[_0x17318e(0x10f3,0x2e0,0x4f3,0x9c7)](_0x51481c,_0x425890(0x1892,0xfa7,0xad1,0x13c3)+global[_0x17318e(0x136d,0x1502,0x147b,0xa88)]+(_0x425890(0xd1,0x152,0x366,-0x185)+_0x17318e(0xf85,0x65e,0xf14,0xbd7)+_0x425890(0x1152,0x8a0,0xa5e,0x5ba)+_0x17318e(0x1134,0xbd4,0x178f,0x1577)+_0x425890(-0x58,0x1a4,-0x54d,0x16a)+_0x17318e(0xdf5,0xe27,0x78e,0xe3d)+_0x17318e(-0x299,-0x3d4,-0x42e,0x46d)+_0x425890(0xb31,0x5b2,0x4aa,0xf3f)+_0x425890(0xc00,0x1438,0x1c2d,0x1ba6)+_0x17318e(0x1d1a,0x1c0e,0x1014,0x14c1)+_0x17318e(0x12fb,0x2dc,0x109e,0xb64)+_0x17318e(0x10bf,0x1a87,0x186b,0x10ea)+_0x425890(0x1348,0x8ba,-0x1e4,0xf4c)+_0x17318e(0x11fc,0xfc6,0xc53,0x13fd)+_0x425890(0x118a,0x1359,0xe95,0x1cc2)+'es,\x20your\x20b'+'ot\x20send\x20au'+_0x17318e(0xedd,0xec1,0x10f7,0x8fa)+_0x17318e(0xddf,-0x2a,-0x268,0x5f9)+_0x17318e(0x116a,0x1835,0x9a0,0xdae)+_0x425890(0x112a,0x13ca,0x1656,0x1844)+_0x17318e(0x121f,0x1c8f,0x13b8,0x133f)+'erruption\x20'+_0x17318e(0x2d3,0x784,0xd5,0x970)+_0x425890(0x14ae,0xd55,0xe13,0xb5f)+_0x425890(0x14ae,0x1539,0x1506,0x1c99)+_0x425890(0x306,0x767,-0x2b4,0xaf2))),_0x295ea5[_0x17318e(0x1363,0xc3a,0xfcd,0xb2a)](_0x51481c,_0x17318e(0x8ec,0xd73,-0xc1,0x5b2)+global[_0x425890(0xdee,0x86b,0x3b9,0xf39)]+(_0x425890(0x112e,0x769,0xf17,-0x165)+_0x17318e(0x646,0x1d6,0x67e,0x609)+_0x425890(0x1966,0x147f,0x1e63,0x187a)+_0x17318e(0x114f,0x161d,0xf65,0xf31)+_0x17318e(0x1b62,0xdd7,0x6fd,0x1142)+_0x17318e(0x15d1,0x204e,0x2041,0x16a8)+'නවානම්\x20එය\x20'+'සැමගෙන්\x20මක'+'ා\x20දැමිය\x20යු'+_0x425890(0x15aa,0xfc6,0x682,0xd5a)+'ොකළහොත්\x20ඔබ'+'ේ\x20බොට්\x20ක්‍රි'+_0x425890(0x71f,0x77b,0xe30,0x60f)+_0x17318e(-0x90,-0x6dc,0xab9,0x39c)+_0x425890(0x4e3,0xa7c,0x82b,0xf3c)+_0x425890(0x1244,0xc7a,0xe80,0x10b1)+_0x425890(0xfcb,0xfcf,0x101b,0x5d7)+_0x17318e(0xda9,0x180c,0x195a,0x109c)+_0x425890(0x3a9,0xbd1,0x890,0xa95)+_0x17318e(0x1967,0x162c,0x1ec0,0x1808)+_0x425890(0x803,0xb4d,0x1549,0x2fd)+_0x17318e(-0x345,0x6cf,-0x23d,0x6e0)+_0x425890(0xce0,0x13d3,0xcea,0x1b14)+'මණක්\x20වලංගු'+'\x20වේ.'));}break;case _0x17318e(0xd1e,0xaee,0x1d57,0x14c9):{let _0x18fbc9=await _0x295ea5['vkYcL'](generateWAMessageFromContent,_0x17aa6d[_0x17318e(0x801,0xa3e,0xda7,0xee4)],proto[_0x17318e(-0x3e9,0xeb,0x7fa,0x4b3)][_0x17318e(0x675,0xe25,0xa60,0x565)]({'listMessage':{'title':_0x17318e(0x685,0x161,0xf64,0x793)+_0x17318e(0x199f,0x1f79,0x120f,0x157c)+_0x17318e(0x12b6,0xf0b,0x166d,0x11aa)+_0x2cbadb+'👀\x0a║','description':'╠\x20🎸Choose\x20'+_0x17318e(0x4e6,0x115f,0x9a5,0x86a)+_0x17318e(0xa81,0x1105,0xf44,0x7b2)+_0x17318e(0xbef,-0x32,0xdd0,0x695)+'𝗔𝗚𝗢𝗡-𝗕𝗢𝗧࿐\x0a'+_0x425890(0xc1b,0x105a,0x169e,0x1573)+global[_0x425890(0xe,0x86b,0x4ca,0x221)]+'\x0a║','buttonText':_0x295ea5[_0x425890(0x1425,0x15d4,0x2009,0x1dce)],'footerText':'╠\x20'+global[_0x17318e(0x79e,0xec3,-0x4e5,0x597)]+('\x0a╚════════'+_0x17318e(0xbdc,0x1866,0x193c,0x157c)+'═╝'),'listType':_0x295ea5[_0x425890(0x6f6,0x386,0xab9,0xb3d)],'sections':[{'title':_0x17318e(0x12da,0xcdc,0xbe3,0x15f1)+_0x425890(0x143e,0xdea,0xd07,0x504),'rows':[{'title':_0x295ea5[_0x17318e(0x1373,0x1508,0xed4,0x12e4)],'description':_0x295ea5[_0x17318e(0xc82,0x18e,0x12d,0x562)],'rowId':_0x4fea53+_0x17318e(-0x1a1,0x818,0x50e,0x51c)}]},{'title':_0x295ea5[_0x17318e(0xda1,0x7a0,0x86a,0xee9)],'rows':[{'title':_0x295ea5[_0x17318e(0x1484,0x11a1,0x1342,0xbcc)],'description':_0x295ea5[_0x17318e(-0x2dd,0xf82,0xebf,0x720)],'rowId':_0x4fea53+'mainmenu'},{'title':_0x295ea5[_0x425890(0x82,0x9c3,0x838,0xc96)],'description':_0x295ea5[_0x17318e(0x16da,0xaa0,0x1038,0x11cf)],'rowId':_0x4fea53+_0x425890(-0x169,0x53a,0xd0c,0x3ec)},{'title':_0x295ea5['irXnU'],'description':_0x295ea5[_0x17318e(0x1132,0x1041,0x465,0x720)],'rowId':_0x4fea53+'groupmenu'},{'title':_0x295ea5[_0x17318e(0x7b5,0x7e,0xc74,0x66a)],'description':_0x295ea5[_0x17318e(0x8e0,0x894,0xcc5,0x11f5)],'rowId':_0x4fea53+_0x17318e(0x88d,0xa2d,0x11ba,0x1203)},{'title':_0x17318e(0x8e5,0x127f,0xb0d,0xd95)+_0x425890(0xed7,0xe30,0x181c,0x54b),'description':_0x295ea5['ftgBB'],'rowId':_0x4fea53+('downloadme'+'nu')},{'title':_0x295ea5[_0x17318e(0xfd6,0x1012,0xa82,0x593)],'description':_0x295ea5[_0x17318e(0x625,0xb17,0xac2,0x87c)],'rowId':_0x4fea53+_0x425890(0xd33,0x8e9,0xe22,0x9f3)},{'title':_0x295ea5[_0x425890(0x635,0xe25,0xe95,0x11f2)],'description':_0x17318e(0x7f3,0xc5,0xa4a,0x6b0)+_0x425890(0x68f,0x1f0,0x2dd,0xb97)+_0x425890(-0x85,0x8d1,0x6a8,0x12c6)+'atures','rowId':_0x4fea53+_0x425890(0xae7,0xa00,0x137e,0x1243)},{'title':_0x295ea5['InMwR'],'description':_0x295ea5[_0x425890(0x110a,0xd02,0x12a6,0x649)],'rowId':_0x4fea53+(_0x17318e(0x1b60,0x16f8,0xcc1,0x1280)+_0x425890(-0x33,0x38d,-0xf4,-0x1c4))},{'title':_0x295ea5['cLTKI'],'description':_0x295ea5[_0x425890(0x767,0xf36,0xa4c,0x17d7)],'rowId':_0x4fea53+_0x425890(0x11e4,0xead,0xc51,0x129b)},{'title':_0x295ea5[_0x425890(0x8a9,0x1015,0x1261,0x754)],'description':'Displays\x20T'+_0x425890(0xaff,0x1f0,0xbdd,0xb31)+_0x425890(0x12f3,0xcf3,0xd9f,0x98a)+'eatures','rowId':_0x4fea53+(_0x425890(0x621,0x9ce,0xdd2,0x127c)+'u')},{'title':_0x425890(0xd74,0x1049,0x153e,0x6ef)+_0x425890(0x1280,0xe30,0x872,0x398),'description':_0x295ea5[_0x17318e(0x1d4e,0x1748,0x14d7,0x16e3)],'rowId':_0x4fea53+(_0x17318e(-0x1ca,0x8b6,0xd09,0x59b)+'nu')},{'title':_0x425890(0xf7a,0x8b5,0x33,0x3cf)+_0x425890(0x262,0x1e2,0x141,0x827),'description':_0x17318e(0x1075,0x1144,-0x1af,0x6b0)+_0x425890(-0x19c,0x1f0,0xc04,0x2f)+_0x425890(-0x24b,0x36b,-0xd2,-0x58b)+_0x17318e(0x1315,0xbd4,0x1345,0x1058)+_0x17318e(0xaa2,0x190d,0xe29,0x1217),'rowId':_0x4fea53+(_0x17318e(0x7b5,0xfab,0x10ab,0x8bc)+'ermenu')},{'title':_0x295ea5[_0x17318e(0x1a31,0x1973,0xcf4,0x1424)],'description':_0x295ea5['VqpTW'],'rowId':_0x4fea53+(_0x17318e(0x9ad,0x1334,0x1143,0x1363)+'u')},{'title':'🎸Islamic\x20M'+_0x17318e(0x8e8,0x31a,-0xda,0x33a),'description':_0x295ea5[_0x17318e(0xbca,0x99b,0x10c8,0x9f5)],'rowId':_0x4fea53+(_0x17318e(0x15ca,0x1998,0x92b,0x129f)+'u')},{'title':_0x295ea5[_0x425890(0xf12,0x64e,0x83d,0x50)],'description':_0x295ea5[_0x425890(0x11bd,0x159f,0xe18,0xfba)],'rowId':_0x4fea53+(_0x425890(0xd8b,0x7e2,0x698,-0xbe)+_0x17318e(0x553,0x246,-0x1d,0x33a))}]},{'title':_0x295ea5['pjDpF'],'rows':[{'title':_0x295ea5[_0x425890(0x650,0x31a,-0x33a,-0x5fe)],'description':'Displays\x20T'+'he\x20List\x20Of'+_0x425890(0x4c5,0xe8c,0xb75,0x51b)+_0x425890(0x13c5,0xac9,0xa71,0x81)+_0x425890(0x1711,0xffa,0x1483,0x178e),'rowId':_0x4fea53+('anonymousc'+'hatmenu')}]},{'title':'🪐CREDIT🪐','rows':[{'title':_0x425890(0x4a5,0x908,-0x160,0x68a),'description':_0x295ea5[_0x425890(0xf50,0x1220,0x121c,0x15dd)],'rowId':_0x4fea53+_0x17318e(0x1b06,0x1c2e,0x145e,0x17cf)}]}],'listType':0x1}}),{});_0x3797bd['relayMessa'+'ge'](_0x17aa6d[_0x425890(0xffc,0xcc7,0x11fd,0x3b0)],_0x18fbc9[_0x425890(0x348,0x7c3,0xaad,0x113e)],{'messageId':_0x18fbc9[_0x425890(0x1ae6,0x1209,0x88c,0x1326)]['id']});}break;case _0x17318e(0xc46,0xcf,0x22f,0x3fe):case _0x295ea5['yiLRE']:case _0x295ea5[_0x17318e(0xcb2,0x14d1,0x17f7,0x10f0)]:case _0x295ea5['YwLXw']:{if(_0x295ea5[_0x17318e(0x10c4,-0x193,0x28d,0x830)](_0x295ea5[_0x17318e(0xbfa,0xca8,0x375,0x51b)],_0x295ea5[_0x17318e(0x495,0x575,0x1d0,0x51b)])){const _0x10d7bf={'HpHxL':function(_0x6325e1,_0x235377){return _0x6325e1(_0x235377);}};if(!_0x2f61c6)return _0x295ea5['uLRfo'](_0x207932,_0x48ee73[_0x17318e(0x147e,0xf9c,0x17a5,0x1494)]);_0x295ea5[_0x425890(0x184f,0x15ca,0x175f,0x11c7)](_0x3c3b7f,_0x79e92e[_0x17318e(0x146b,0x1018,0xa2a,0x12e5)](-0x810+-0x9*-0x52+0x530),(_0x19b33e,_0x3d491e)=>{if(_0x19b33e)return _0x10d7bf[_0x2e7455(0xb99,0x11a6,0x331,0xc10)](_0x16641c,_0x19b33e);function _0x2e7455(_0x302798,_0x344e2c,_0x53b56c,_0x45f5b8){return _0x17318e(_0x302798-0x170,_0x45f5b8,_0x53b56c-0x1a2,_0x302798- -0x380);}if(_0x3d491e)return _0x10d7bf['HpHxL'](_0x50b909,_0x3d491e);});}else{const _0x577373={};_0x577373[_0x17318e(0x4d4,0xdd3,0xd,0x810)]=_0x295ea5[_0x17318e(0x444,0x1103,0xa65,0x759)],_0x3797bd['sendMessag'+'e'](_0x17aa6d['chat'],{'image':_0x577373,'caption':_0x425890(0xfa6,0x7d9,-0x9d,0x6a8)+_0x17aa6d['pushName']+('*\x0aI\x20am\x20☬𝗥𝗘'+_0x425890(0x17f8,0xdf9,0x148b,0xdf6)+_0x425890(0x1d7c,0x1641,0x1e43,0x1ddc)+'d\x20By:\x20*Red'+_0x425890(0x8ad,0x2cb,0x2f4,0x204)+_0x17318e(0xee,0x1224,0x180,0xaf0)+_0x17318e(0x154a,0x1c30,0x11b8,0x12ef)+_0x425890(0x702,0xe66,0x12ab,0xd21)+_0x425890(0x1ca7,0x1408,0x1781,0xec3))},{'quoted':_0x17aa6d});}}break;case _0x17318e(0x2b5,0x1401,0xe0a,0xc05):case _0x295ea5[_0x425890(0x5e8,0xbc7,0x787,0x524)]:case'qr':case _0x295ea5['yvYmI']:{result=fs[_0x425890(0x18b,0xa56,0x3ce,0x500)+'nc'](_0x17318e(0x4ed,0x121e,0x1443,0xaf9)+'dia/image/'+_0x17318e(0x132f,0x140d,0x186e,0x1105));const _0x10b84b={};_0x10b84b[_0x425890(0xaf3,0x381,0x656,0x8f2)]=result;const _0x2a03db={};_0x2a03db[_0x17318e(0xc3c,0x974,0x523,0x527)]=_0x295ea5[_0x17318e(0xa0e,0xaf0,0xed3,0xe2d)],_0x3797bd[_0x17318e(0xa2e,-0x28d,0x551,0x63c)+'e'](_0x17aa6d['chat'],_0x10b84b,_0x2a03db,{'quoted':_0x17aa6d});}break;case'sc':{if(_0x295ea5['cMECj']('IQMUB',_0x17318e(0x1395,0xf79,0x183a,0x17bb)))_0x295ea5[_0x425890(0x703,0xe7d,0xaf6,0x109b)](_0xcd1d32,_0x17318e(0xcd2,0x10fa,0x4fc,0x9be)+_0x17318e(0x1a58,0x145e,0x1284,0x182b)+_0x17318e(0x160b,0x45a,0xadd,0xe30)+'abhasha200'+_0x17318e(0x1496,0x1ca4,0x10b8,0x12d4)+_0x425890(0x17b2,0xdcf,0xba5,0x3f2)+'orget\x20To\x20G'+_0x425890(0x1057,0xb5e,0x6df,0x495)+_0x17318e(0x1c7d,0x11e8,0x12e0,0x1503)+btnurl+(_0x425890(0xace,0x2f3,-0x137,0x7c8)+_0x17318e(0x2037,0x1df2,0x1156,0x170d)+_0x425890(0xacf,0x15f,-0x171,0x269)));else{const _0x38b762={};_0x38b762[_0x17318e(0xd48,0x9ab,0x1c09,0x12bd)+'t']=_0x295ea5[_0x425890(0xbdd,0x68c,0xbe9,0x941)];const _0x430932={};_0x430932[_0x425890(0x4f5,0xf77,0x18c3,0xc9f)]=_0x36d1a9+_0x425890(0x36b,0x2ff,0x71c,-0x67e),_0x430932[_0x17318e(0x17f9,0x1cdc,0x1cfc,0x1318)]=_0x38b762,_0x430932['type']=0x1;const _0x4f0097={};_0x4f0097[_0x17318e(0xab2,0xd22,0x13bf,0x12bd)+'t']=_0x295ea5['spClB'];const _0x500cc4={};_0x500cc4['buttonId']=_0x30dc6b+'alive',_0x500cc4[_0x17318e(0x1434,0x1a11,0xeb5,0x1318)]=_0x4f0097,_0x500cc4[_0x425890(0x1a5d,0x141b,0x196a,0x1438)]=0x1;const _0x15a1a1={};_0x15a1a1['displayTex'+'t']=_0x295ea5['hfIkN'];const _0x4f4ae7={};_0x4f4ae7[_0x425890(0x1156,0xf77,0x1857,0x98a)]=_0x541e58+_0x17318e(0xe71,0x2031,0x20c6,0x1751),_0x4f4ae7[_0x17318e(0x195d,0x1645,0x107b,0x1318)]=_0x15a1a1,_0x4f4ae7[_0x17318e(0x1866,0xf60,0x1993,0x1638)]=0x1;let _0x30ffba=[_0x430932,_0x500cc4,_0x4f4ae7];const _0x1209dd={};_0x1209dd[_0x17318e(0xe55,0x10b3,-0xba,0x810)]=_0x528ae9+_0x425890(0xc5f,0x968,0x355,0x7c3);const _0x1479ff={};_0x1479ff[_0x425890(0x64a,0x381,0x662,-0x46a)]=_0x1209dd,_0x1479ff[_0x17318e(0x7c4,0x19c,0x579,0x527)]=_0x425890(-0x12a,0x618,0x374,0x221)+_0x3c7432+(_0x425890(-0x131,0x19b,-0x6e3,0x62b)+'═══💠\x20HOROS'+'COPE\x20💠══╗\x0a'+_0x17318e(0x1e61,0x1fa7,0x1f57,0x159d)+_0x425890(0xa37,0x98b,0x1205,0xc09))+_0x3272a7+'\x20'+_0x49d39a+(_0x17318e(0x1415,0x16ef,0xde9,0xf53)+_0x425890(0x456,0x500,0x2f2,-0x9c))+_0x116cdc+'\x20'+_0x58d3db+('artimimpi\x20'+_0x425890(-0x382,0x500,0x196,0xd39))+_0x39e39d+'\x20'+_0x55d08a+(_0x425890(-0x15a,0x4a9,0xda2,0x30a)+_0x17318e(0x1647,0x1bfa,0x1747,0x1477))+_0x47232d+'\x20'+_0x9b66eb+(_0x17318e(0xe42,0x1db3,0x1912,0x14da)+'\x20(indo)\x0a┃╠')+_0x5e44d4+'\x20'+_0x5e0546+(_0x17318e(0x1cd2,0x137f,0xd26,0x14da)+_0x425890(0x13e7,0xc30,0xf6d,0x15b9)+_0x17318e(0x552,0xa3e,0x5b2,0xe36))+_0x4a3273+'\x20'+_0x342873+('suamiistri'+'\x20(indo)\x0a┃╠')+_0x1e1672+'\x20'+_0x397141+(_0x17318e(0xc64,0x1b4f,0x175d,0x153e)+_0x17318e(-0x303,0x77e,-0x467,0x3b5))+_0x4a3203+'\x20'+_0x378112+(_0x17318e(0xf46,0x73b,0x25c,0xc3e)+_0x425890(0xe23,0x500,0x694,0x4a8))+_0x27d34a+'\x20'+_0x4b1837+('pasangan\x20('+'indo)\x0a┃╠')+_0x365313+'\x20'+_0xc02df4+(_0x425890(-0x692,0x3df,0xd02,-0x75)+_0x17318e(0x406,0x7d0,0x7b2,0x75a)+'╠')+_0x57f6a9+'\x20'+_0x15da17+(_0x425890(0x12e6,0x9c5,0xcf6,0x1280)+'\x20(indo)\x0a┃╠')+_0x4b11f2+'\x20'+_0x553ef5+(_0x17318e(0x1471,0x4cb,0xcd9,0xe35)+_0x425890(0xc12,0x15fe,0x1f01,0x1387))+_0x48233f+'\x20'+_0x3326d5+(_0x17318e(0x10b0,0x1082,0x1263,0xec2)+_0x17318e(0x58a,0x344,0x688,0x71d))+_0x360d88+'\x20'+_0x5411eb+(_0x425890(0xab5,0x349,0xa99,-0x437)+_0x425890(0x951,0x780,0x27e,0x91b))+_0x479e9f+'\x20'+_0x3df0fd+(_0x425890(0x9ac,0x567,-0x9,0x9)+_0x17318e(0x13e2,0x1b3b,0x1e16,0x1477))+_0x4dc1f1+'\x20'+_0x1c7e89+('tarot\x20(ind'+_0x425890(0x5c0,0x780,0x118,0x155))+_0x276316+'\x20'+_0x545e86+('fengshui\x20('+_0x425890(0x1464,0x125a,0x800,0x178b))+_0x2964d6+'\x20'+_0x2eb80a+(_0x17318e(0x1422,0xde5,0xe4f,0x1463)+_0x17318e(0xdb9,0xe86,0x161c,0x1477))+_0x45a8a3+'\x20'+_0x5ebcde+(_0x425890(0x12e6,0xcee,0xa85,0x5ae)+_0x425890(0x6ad,0x198,0x9ca,-0x47d))+_0x4d9169+'\x20'+_0x2ef520+('harisial\x20('+_0x425890(0x15a3,0x125a,0x8f6,0x1297))+_0x3ee8ee+'\x20'+_0x1ea600+('nagahari\x20('+_0x17318e(0x1e9f,0x1cf7,0x1b16,0x1477))+_0x467033+'\x20'+_0x217118+(_0x17318e(0xa47,0x983,0xb8a,0x443)+_0x425890(0x700,0x198,0x681,-0x576))+_0x1976c7+'\x20'+_0x5a9a0e+(_0x17318e(-0x35,0x92a,0xe7e,0x603)+_0x17318e(0x7af,0xfb,0x1eb,0x38b)+'╠')+_0x5168d1+'\x20'+_0x244b83+(_0x17318e(0x13fe,0x1bf1,0x1d0b,0x156e)+_0x17318e(0x1197,0x2ef,0xf2,0x99d))+_0x10059c+'\x20'+_0x1a81a0+(_0x17318e(0x1974,0xcba,0x113d,0x14ef)+'indo)\x0a┃╠')+_0x2f9f09+'\x20'+_0x30e320+(_0x17318e(0x728,0x3f9,-0xff,0x3e2)+_0x17318e(0x1477,0x1f84,0x136d,0x15c1)+_0x425890(0x1095,0x1287,0x149f,0x11c1))+_0x585e8b+'\x20'+_0x184dd9+(_0x17318e(0x1b5d,0x1e23,0x1c23,0x1830)+'(indo)\x0a┃╠')+_0x22e2a3+'\x20'+_0x56db06+(_0x425890(0x16c7,0xf41,0xc36,0xd6b)+_0x17318e(0x9c9,0x59b,-0x197,0x71d))+_0x534561+'\x20'+_0x736481+(_0x425890(0xec1,0x1232,0xdeb,0x1331)+_0x17318e(0x14d4,0x1a47,0x11af,0x181b))+_0xa1066f+'\x20'+_0x4104df+(_0x17318e(0x14d3,0x1417,0x1e1d,0x16b1)+_0x425890(0xa81,0x4e2,0x231,-0x100)+_0x17318e(0x5c2,0x59e,-0x115,0x4a7)+_0x17318e(0x1f38,0x1041,0x17c0,0x170b))+_0xdb91ee+_0x17318e(-0x277,-0x1f8,0xdd8,0x5a0),_0x1479ff[_0x425890(0x2e1,0x37a,-0x290,-0x2a2)]=_0xa31a02['user'][_0x17318e(0x88d,0x1392,0x197b,0x109f)],_0x1479ff[_0x425890(0x1596,0xf61,0x594,0x8dd)]=_0x30ffba,_0x1479ff[_0x425890(0x19c7,0xfef,0x12d6,0xf99)]=0x4;let _0x8b5f5d=_0x1479ff;const _0x386ee7={};_0x386ee7[_0x425890(-0x212,0x807,0x30,0xd53)]=_0x15c390,_0x6257a0['sendMessag'+'e'](_0x1bc57d[_0x425890(0xc22,0xcc7,0x9c2,0xaeb)],_0x8b5f5d,_0x386ee7);}}break;case _0x295ea5[_0x425890(0x1a47,0x126b,0xbc5,0x9b8)]:case _0x17318e(0x133,0x152a,0x862,0xb97):case _0x295ea5[_0x17318e(0xed2,0x65e,0x4e5,0x6d1)]:case _0x295ea5['YvuPH']:{const _0x10adb7={};_0x10adb7[_0x425890(0xb93,0x10a0,0x143d,0x12bf)+'t']=_0x17318e(0x1f5,-0x3f1,0x6fe,0x429);const _0x1a2ace={};_0x1a2ace[_0x17318e(0x78e,0xadd,0x14f8,0x1194)]=_0x4fea53+_0x425890(0x13f9,0x1277,0xe4d,0x1b6f),_0x1a2ace[_0x17318e(0x101e,0x181d,0x1559,0x1318)]=_0x10adb7,_0x1a2ace[_0x17318e(0x12e9,0x14fb,0x13a6,0x1638)]=0x1;const _0x3ce1e4={};_0x3ce1e4['displayTex'+'t']='⫷\x20ALIVE\x20⫸';const _0xfe69d2={};_0xfe69d2[_0x425890(0x1323,0xf77,0xff1,0xfee)]=_0x4fea53+_0x425890(0xb08,0xa49,0x1466,0x19c),_0xfe69d2['buttonText']=_0x3ce1e4,_0xfe69d2[_0x425890(0x1d51,0x141b,0xdc2,0x100a)]=0x1;let _0x58486d=[_0x1a2ace,_0xfe69d2];const _0x17c241={};_0x17c241[_0x425890(0xef1,0x5f3,-0x49c,0x20a)]=_0x17318e(0x1778,0x1438,0x8d2,0xf0a)+_0x425890(0x1336,0x1639,0x1e72,0x202e)+_0x425890(0x32e,0xd2e,0x1733,0x320)+_0x425890(0xed8,0x1228,0xbd2,0x1b43)+'.jpg';const _0x54a0c3={};_0x54a0c3[_0x425890(0x96b,0x381,0x223,0x842)]=_0x17c241,_0x54a0c3[_0x17318e(-0x3f2,0xfae,0xde1,0x527)]=_0x425890(0xdb1,0x88b,0x962,-0xb6)+_0x17318e(0x1916,0x1724,0xf38,0x1120)+_0x425890(0xc0f,0xaf1,0x6b9,0x1343)+'our\x20update'+'s\x0ahttps://'+_0x17318e(0x1f4,0xb8b,0xaa5,0x7ca)+_0x17318e(0x4b8,0x86b,0x1a5,0x3cf)+_0x17318e(0x9b6,0x1195,0x836,0xebf)+'on-bot/hom'+'e',_0x54a0c3[_0x17318e(0x83f,0xb7c,0x41a,0x597)]=_0x425890(0x1043,0xed0,0x75e,0x11a4)+'ᴏɴ-ʙᴏᴛ\x20MD',_0x54a0c3[_0x17318e(0x1559,0xbd0,0xd9f,0x117e)]=_0x58486d,_0x54a0c3['headerType']=0x4;let _0x5627b2=_0x54a0c3;_0x3797bd[_0x425890(0x8f8,0x41f,0xa87,0x756)+'e'](_0x17aa6d[_0x17318e(0xfb8,0x700,0x1580,0xee4)],_0x5627b2,{'quoted':_0x17aa6d});}break;case _0x295ea5[_0x425890(0xe42,0x6a1,0xf07,0xc78)]:case _0x295ea5[_0x17318e(0x5af,0x36b,0xbf9,0x529)]:{if(_0x295ea5[_0x425890(0xad7,0x456,-0x3a8,-0xbf)](_0x295ea5[_0x425890(0x1a33,0x1017,0x13a8,0x174b)],_0x295ea5[_0x425890(0xa09,0x143,-0x37a,-0x66)]))_0x235845(_0x425890(0x1042,0xda3,0xd77,0x147d)+_0x17318e(0x1fde,0x1a4a,0x1699,0x1726)+_0x17318e(0x1f46,0x1cb4,0xb76,0x15d6)+_0x17318e(0x1c43,0xcfc,0x118c,0x1354));else{const _0x44a32b={};_0x44a32b[_0x425890(0x168e,0x10a0,0xfd9,0x95f)+'t']=_0x295ea5[_0x425890(0x101d,0x145c,0x1955,0x125d)];const _0x4c2aff={};_0x4c2aff[_0x425890(0xddf,0xf77,0x73b,0x9f9)]=_0x4fea53+_0x17318e(0xe7f,0xab9,0x1e6e,0x1494),_0x4c2aff['buttonText']=_0x44a32b,_0x4c2aff[_0x425890(0x19d7,0x141b,0x11fa,0x158a)]=0x1;const _0x48ca76={};_0x48ca76[_0x425890(0x1797,0x10a0,0x1600,0x150d)+'t']=_0x295ea5[_0x425890(0x907,0xcd1,0x1336,0xdad)];const _0x3bc72f={};_0x3bc72f['buttonId']=_0x4fea53+'alive',_0x3bc72f['buttonText']=_0x48ca76,_0x3bc72f[_0x425890(0x1b4c,0x141b,0x1037,0xf8a)]=0x1;let _0x55a5e5=[_0x4c2aff,_0x3bc72f];const _0x23b90f={};_0x23b90f[_0x17318e(0xbb7,0xd51,-0x114,0x810)]=_0x295ea5['MzloY'];const _0x5cbc9f={};_0x5cbc9f[_0x425890(-0x2f8,0x381,-0x633,0x81d)]=_0x23b90f,_0x5cbc9f['caption']=_0x425890(-0x481,0x58c,0x690,0xf9e)+_0x17318e(0x833,0x1c4e,0x1cc2,0x129c)+_0x425890(0x134,0xa0b,0x766,-0x34)+_0x2cbadb+_0x17318e(0x5cd,0xc98,0xdbb,0xd68)+botname+(_0x17318e(0x18d1,0xe88,0x10fd,0x10bb)+_0x425890(0x6d,0x4bd,-0x1e4,0xeff)+'════╗\x0a┃║\x0a┃'+'╠')+dragonemoji+'\x20'+_0x4fea53+(_0x17318e(0xb45,0x12ba,0xbca,0x1333)+_0x425890(0x26d,0x5c8,0x3ee,0x76d)+_0x17318e(0x1c0,0xd6f,0xb16,0x41d))+dragonemoji+'\x20'+_0x4fea53+(_0x17318e(0x11e8,0x1892,0xc63,0x1505)+_0x425890(-0x388,0x12b,-0x2a0,-0xa7)+_0x425890(0x1078,0xc74,0xbd1,0x138d))+dragonemoji+'\x20'+_0x4fea53+('update\x20(Ch'+_0x425890(0xd3,0x2b0,-0x526,0x27c)+'date)\x0a┃╠')+dragonemoji+'\x20'+_0x4fea53+(_0x17318e(0x1453,0xad5,0xb89,0xda3)+'r\x20code)\x0a┃╠')+dragonemoji+'\x20'+_0x4fea53+_0x425890(0x1100,0xd98,0x988,0x1017)+dragonemoji+'\x20'+_0x4fea53+_0x425890(-0x57b,0x3cf,0xacc,-0x3d3)+dragonemoji+'\x20'+_0x4fea53+(_0x17318e(0x44e,0x419,0xae5,0xdd9)+'┃╠')+dragonemoji+'\x20'+_0x4fea53+_0x17318e(0x731,0x93f,-0x28d,0x37e)+dragonemoji+'\x20'+_0x4fea53+'owner\x0a┃╠'+dragonemoji+'\x20'+_0x4fea53+_0x17318e(0x39a,0x17e,0x522,0x3a7)+dragonemoji+'\x20'+_0x4fea53+_0x425890(0x10d3,0xb46,0xc4,0xb79)+dragonemoji+'\x20'+_0x4fea53+(_0x425890(0x840,0xece,0x1113,0x1602)+'╠')+dragonemoji+'\x20'+_0x4fea53+'quoted\x0a┃╠'+dragonemoji+'\x20'+_0x4fea53+_0x425890(0x7bf,0xd53,0x1650,0x1339)+dragonemoji+'\x20'+_0x4fea53+(_0x425890(0x752,0xe24,0x3a9,0x50f)+_0x425890(0x1a5e,0x1474,0x1319,0x1aa6))+dragonemoji+'\x20'+_0x4fea53+(_0x425890(0xebd,0x11ae,0xa9d,0x97f)+_0x17318e(0x7c1,0xf60,0x10fe,0xb3c)+_0x425890(0x1827,0x122c,0xb71,0x185a)+_0x17318e(0x140a,0xffe,0x126f,0x11a3)+_0x425890(0x2a0,0x5d5,-0x3c5,-0x444)+'\x0a┃║\x0a┃╠')+dragonemoji+'\x20'+_0x4fea53+(_0x425890(0xac3,0xd11,0x16cd,0x9c5)+_0x17318e(0x5f8,0x563,0xd8f,0x33e))+dragonemoji+'\x20'+_0x4fea53+(_0x17318e(-0xe6,-0x4,-0x2a4,0x6ea)+_0x425890(0x1685,0xded,0x572,0x1490))+dragonemoji+'\x20'+_0x4fea53+_0x425890(0x10e8,0x1343,0x1565,0x152d)+dragonemoji+'\x20'+_0x4fea53+(_0x425890(0xa55,0x12a7,0x1cf3,0x929)+'r]\x0a┃╠')+dragonemoji+'\x20'+_0x4fea53+(_0x425890(0x1059,0xde9,0xda2,0x614)+_0x425890(0x1451,0x1601,0xf33,0x1ad8))+dragonemoji+'\x20'+_0x4fea53+('bcgroup\x20[t'+'ext]\x0a┃╠')+dragonemoji+'\x20'+_0x4fea53+(_0x17318e(0x1762,0x13a9,0x143f,0x176e)+'t]\x0a┃╠')+dragonemoji+'\x20'+_0x4fea53+(_0x425890(-0x60f,0x373,0x365,0x7fb)+_0x425890(0xa1e,0x28b,0x5ed,-0x54))+dragonemoji+'\x20'+_0x4fea53+_0x17318e(0x15db,0x1399,0x10d0,0xe99)+dragonemoji+'\x20'+_0x4fea53+(_0x17318e(0x1136,0x1850,0xc4a,0x123b)+_0x425890(0x1c82,0x126a,0x1a73,0x1b29))+dragonemoji+'\x20'+_0x4fea53+('notice\x20(Ad'+'vise\x20For\x20O'+_0x17318e(0x1906,0x136e,0xff7,0xe7b)+_0x17318e(0xc6c,0x14a6,0x1673,0x157c)+_0x17318e(0x1f0,0x10b2,0x7e3,0x87b)+_0x425890(0xe26,0xb1e,0x435,0x664)+_0x17318e(0x1549,0x1294,0x15b0,0x1743)+_0x425890(0x176d,0xe73,0x1827,0x1765))+dragonemoji+'\x20'+_0x4fea53+(_0x425890(0xe8f,0x1570,0x1490,0x1aa7)+'┃╠')+dragonemoji+'\x20'+_0x4fea53+(_0x425890(0xe63,0x6b1,0x54,0x11c)+_0x425890(0xfd,0x9f2,0x1304,0x103e)+'╠')+dragonemoji+'\x20'+_0x4fea53+(_0x425890(0x1168,0x1417,0x1bd8,0x12c9)+'mage]\x0a┃╠')+dragonemoji+'\x20'+_0x4fea53+(_0x425890(0x563,0x990,0x8ba,0x651)+'ext]\x0a┃╠')+dragonemoji+'\x20'+_0x4fea53+('setdesc\x20[t'+_0x425890(0xa4f,0x432,-0x350,-0x3e))+dragonemoji+'\x20'+_0x4fea53+(_0x17318e(0x1188,0x11fc,-0x4b,0x7ba)+_0x425890(0xd45,0x797,0x2b0,0x956))+dragonemoji+'\x20'+_0x4fea53+('editinfo\x20['+_0x425890(0xdcf,0x14c2,0xf11,0x1e21))+dragonemoji+'\x20'+_0x4fea53+(_0x17318e(0x330,0xf5a,0xe78,0x56f)+_0x425890(0x11a9,0x1287,0x980,0xb47))+dragonemoji+'\x20'+_0x4fea53+('kick\x20[repl'+_0x17318e(0x986,0x2c4,0x12ab,0x957))+dragonemoji+'\x20'+_0x4fea53+(_0x17318e(0xe73,0x15e7,0x1726,0xf47)+_0x17318e(0xd6,0x93d,-0x3df,0x64f))+dragonemoji+'\x20'+_0x4fea53+(_0x17318e(0xabf,0x1321,0x1367,0x143f)+_0x425890(0x940,0xceb,0xd3c,0xc7b))+dragonemoji+'\x20'+_0x4fea53+('antilink\x20['+_0x425890(0xd35,0x57d,0xaab,0x103))+dragonemoji+'\x20'+_0x4fea53+(_0x17318e(0xfd4,0xf82,0x147d,0xd17)+_0x17318e(0x1545,0x1901,0x1bad,0x1283))+dragonemoji+'\x20'+_0x4fea53+('promote\x20[r'+'eply/tag]\x0a'+'┃╠')+dragonemoji+'\x20'+_0x4fea53+(_0x425890(0x80b,0x5e7,0x821,0xd7d)+_0x17318e(0xf52,0x15a7,0x1826,0x1032)+'╠')+dragonemoji+'\x20'+_0x4fea53+_0x17318e(0x3e7,0x9fe,0xee6,0x572)+dragonemoji+'\x20'+_0x4fea53+_0x17318e(0x114,-0x227,0x894,0x815)+dragonemoji+'\x20'+_0x4fea53+_0x425890(0x74e,0x7f9,0xa73,0xd9)+dragonemoji+'\x20'+_0x4fea53+('checkvote\x0a'+'┃╠')+dragonemoji+'\x20'+_0x4fea53+(_0x425890(0xf36,0x4d4,0x46d,0xb4d)+'══════════'+'════════\x0a┃'+'╔════💠\x20TEX'+_0x17318e(0x12fd,0xdd0,0x2bd,0x877)+'╗\x0a┃║\x09\x20\x20\x20\x20\x20'+_0x17318e(0xa21,0xd7,0x20,0x934))+dragonemoji+'\x20'+_0x4fea53+('candy\x20[txt'+_0x425890(0x14f3,0xded,0x15cc,0x11b8))+dragonemoji+'\x20'+_0x4fea53+('3dchristma'+_0x17318e(0xaea,0x6f4,0x1db,0xb44))+dragonemoji+'\x20'+_0x4fea53+(_0x17318e(0x1d4b,0x1c0a,0xea7,0x1451)+_0x425890(0xeaa,0x14d5,0x16ee,0x164d))+dragonemoji+'\x20'+_0x4fea53+(_0x17318e(0x6c0,0x130a,0x14d2,0xf30)+_0x425890(0x11c5,0x14a6,0x1905,0x1328)+'t]\x0a┃╠')+dragonemoji+'\x20'+_0x4fea53+(_0x17318e(0x1786,0xf18,0x1829,0xf1d)+_0x17318e(0x89c,0x5ec,0x10df,0xf08))+dragonemoji+'\x20'+_0x4fea53+(_0x17318e(0x722,-0x192,-0x26c,0x423)+_0x17318e(0x16c3,0x57a,0x1398,0x100a))+dragonemoji+'\x20'+_0x4fea53+(_0x17318e(0x9b5,0x1415,0xd8b,0x1166)+_0x17318e(0xecf,0x6b6,0xfd3,0xf08))+dragonemoji+'\x20'+_0x4fea53+(_0x425890(0xbee,0x547,-0x298,0x3d9)+_0x17318e(0x20ae,0x1eb7,0x114b,0x16f2))+dragonemoji+'\x20'+_0x4fea53+(_0x425890(0x133c,0xe32,0x15b7,0xac8)+_0x17318e(0x944,0x11b9,0x92f,0x9b4))+dragonemoji+'\x20'+_0x4fea53+(_0x17318e(0x1892,0xc11,0x13ed,0x103f)+_0x425890(0xb9d,0x797,0x73,0x743))+dragonemoji+'\x20'+_0x4fea53+(_0x17318e(0xf83,0xc2d,0x18d7,0x152c)+'xt]\x0a┃╠')+dragonemoji+'\x20'+_0x4fea53+(_0x17318e(0xb34,0xf25,0x8f8,0xebd)+_0x17318e(0x12d3,0x1d07,0x10d7,0x16f2))+dragonemoji+'\x20'+_0x4fea53+('metalic\x20[t'+'xt]\x0a┃╠')+dragonemoji+'\x20'+_0x4fea53+(_0x425890(0xb10,0x1b6,0x674,0xbbc)+'xt]\x0a┃╠')+dragonemoji+'\x20'+_0x4fea53+(_0x17318e(0xde3,0x1819,0xecc,0xee0)+_0x425890(0x9e2,0xded,0xea6,0x1239))+dragonemoji+'\x20'+_0x4fea53+(_0x425890(0xb05,0x87c,0x9ce,0x8aa)+_0x425890(0x7e6,0x99c,0x1e4,0x2b5))+dragonemoji+'\x20'+_0x4fea53+(_0x17318e(0xa97,0x4a6,0xc17,0x586)+']\x0a┃╠')+dragonemoji+'\x20'+_0x4fea53+(_0x425890(0x562,0xc47,0x109d,0xd82)+_0x425890(0xee3,0xceb,0x62e,0x16a1))+dragonemoji+'\x20'+_0x4fea53+('magma\x20[txt'+_0x425890(0x1033,0xded,0xac1,0x1657))+dragonemoji+'\x20'+_0x4fea53+(_0x17318e(0x109b,0x2f1,0x9e6,0xb2b)+_0x425890(0x1680,0xceb,0x2a7,0x692))+dragonemoji+'\x20'+_0x4fea53+(_0x425890(0xd8c,0x873,0xa3,0x93e)+'[txt]\x0a┃╠')+dragonemoji+'\x20'+_0x4fea53+(_0x425890(0x1781,0x1400,0x12fd,0x1c0a)+_0x425890(-0x2cd,0x797,-0x264,-0x5e))+dragonemoji+'\x20'+_0x4fea53+('harrypotte'+_0x17318e(0x12ee,0x3e9,0x8a1,0xbb9))+dragonemoji+'\x20'+_0x4fea53+(_0x17318e(0x1c15,0xcda,0x9be,0x13d9)+_0x425890(-0x162,0x927,0x3e9,0xf20))+dragonemoji+'\x20'+_0x4fea53+(_0x17318e(0x9b2,0xc33,0x9fb,0x7fa)+_0x425890(0xc0e,0x102f,0x1284,0x5e0))+dragonemoji+'\x20'+_0x4fea53+(_0x17318e(0xb91,0x624,0x15b2,0xfd8)+_0x17318e(0xc6f,0x1a1a,0x1be0,0x13b0))+dragonemoji+'\x20'+_0x4fea53+(_0x425890(-0x3f8,0x1ab,0xbe6,-0x70)+_0x17318e(0xef5,0xa21,0x1a2f,0x13b0))+dragonemoji+'\x20'+_0x4fea53+(_0x17318e(0xe7f,0x822,0x143d,0x106b)+_0x425890(0xa8b,0x14d5,0xf1e,0x1251))+dragonemoji+'\x20'+_0x4fea53+(_0x17318e(0x448,0x3b6,0x20c,0x45f)+_0x425890(0x18a3,0x1193,0x8ff,0x13bf))+dragonemoji+'\x20'+_0x4fea53+(_0x17318e(0x10c8,0xabe,0x1689,0x113f)+_0x17318e(0xad7,0xf78,0x1d79,0x13fa)+'╠')+dragonemoji+'\x20'+_0x4fea53+('snow\x20[txt]'+'\x0a┃╠')+dragonemoji+'\x20'+_0x4fea53+(_0x17318e(-0x413,-0x37e,0x166,0x4d4)+_0x17318e(0x95e,0x86f,0x1922,0x100a))+dragonemoji+'\x20'+_0x4fea53+('honey\x20[txt'+_0x425890(0x1101,0xded,0x47d,0x3c2))+dragonemoji+'\x20'+_0x4fea53+(_0x17318e(0x749,0xd9b,0x6ea,0x973)+'┃╠')+dragonemoji+'\x20'+_0x4fea53+(_0x425890(0xfd4,0xcf5,0x9a3,0x83e)+_0x17318e(0x17ca,0x1377,0xd8d,0x13b0))+dragonemoji+'\x20'+_0x4fea53+('biscuit\x20[t'+_0x17318e(0x1086,0xfe5,0xf14,0xf08))+dragonemoji+'\x20'+_0x4fea53+(_0x17318e(0x1407,0x1061,0x1a5,0xaa2)+'\x0a┃╠')+dragonemoji+'\x20'+_0x4fea53+(_0x17318e(0x1375,0x15b5,0x1538,0x17a0)+_0x17318e(0x1d6b,0x1593,0x1fe5,0x16f2))+dragonemoji+'\x20'+_0x4fea53+(_0x425890(0x21c,0xb27,0x8a,0xb28)+_0x425890(0x1519,0x1193,0x912,0x8bc))+dragonemoji+'\x20'+_0x4fea53+(_0x425890(0xa45,0x47a,0xbd4,0x3c7)+'t]\x0a┃╠')+dragonemoji+'\x20'+_0x4fea53+('blood\x20[txt'+']\x0a┃╠')+dragonemoji+'\x20'+_0x4fea53+(_0x17318e(0x5df,0xb2e,-0x34,0x58b)+_0x425890(0x1f4e,0x14d5,0x1182,0x107e))+dragonemoji+'\x20'+_0x4fea53+('toxic\x20[txt'+_0x17318e(0x12d6,0xf8d,0xc32,0x100a))+dragonemoji+'\x20'+_0x4fea53+(_0x425890(0x4b7,0x90f,0x12bb,0x8c2)+_0x17318e(0x1bb4,0x15ae,0x12ff,0x14a4))+dragonemoji+'\x20'+_0x4fea53+(_0x425890(0x81f,0xb79,0xc5b,0x32e)+_0x17318e(0x155e,0xc58,0xa3e,0x14a4))+dragonemoji+'\x20'+_0x4fea53+(_0x17318e(0x7f5,0x586,0xfc4,0xb53)+_0x425890(0xf9e,0x14d5,0xc4c,0x14b1))+dragonemoji+'\x20'+_0x4fea53+(_0x17318e(0x1894,0x1624,0xf35,0x120f)+_0x425890(0xe09,0x102f,0xd52,0x5ac))+dragonemoji+'\x20'+_0x4fea53+('darkgold\x20['+_0x17318e(0x1077,0xb60,0x1693,0x124c))+dragonemoji+'\x20'+_0x4fea53+('joker\x20[txt'+_0x17318e(0x5a1,0xca1,0x718,0x100a))+dragonemoji+'\x20'+_0x4fea53+(_0x425890(0xb37,0xbf1,0xe0e,0x2ee)+'t]\x0a┃╠')+dragonemoji+'\x20'+_0x4fea53+('firework\x20['+_0x425890(0x734,0x102f,0x19af,0xc60))+dragonemoji+'\x20'+_0x4fea53+(_0x17318e(0x5da,-0x4d,-0x16a,0x7b1)+_0x425890(0x86f,0x102f,0x1676,0x156a))+dragonemoji+'\x20'+_0x4fea53+(_0x17318e(0x8ae,0xec4,0x165d,0x1349)+'[txt]\x0a┃╠')+dragonemoji+'\x20'+_0x4fea53+('sand\x20[txt]'+_0x425890(0x15ad,0x1287,0x1333,0x151e))+dragonemoji+'\x20'+_0x4fea53+(_0x17318e(0x82a,0x880,0xad6,0xbf8)+_0x425890(0xedf,0x1287,0xc80,0x146b))+dragonemoji+'\x20'+_0x4fea53+(_0x17318e(0xd22,0x353,0xa0d,0x992)+'\x0a┃╠')+dragonemoji+'\x20'+_0x4fea53+(_0x425890(0x704,0x1d0,-0x740,-0x2db)+'t]\x0a┃╚═════'+_0x17318e(0xed5,0xdf8,0xaf1,0x157c)+_0x17318e(0x84c,0x1481,0x12c9,0x12e3)+_0x425890(-0x323,0x524,0x338,0x47c)+'═╗\x0a┃║\x0a┃╠')+dragonemoji+'\x20'+_0x4fea53+_0x17318e(0xf73,0xe49,0x20a8,0x16ad)+dragonemoji+'\x20'+_0x4fea53+_0x425890(-0x364,0x385,0x373,0xc52)+dragonemoji+'\x20'+_0x4fea53+_0x17318e(0x1d6,0x881,0x46c,0x9a4)+dragonemoji+'\x20'+_0x4fea53+(_0x17318e(0x8c5,0x41e,0xb69,0xd36)+'┃╠')+dragonemoji+'\x20'+_0x4fea53+_0x425890(0xc91,0x15f7,0xca5,0x1e5e)+dragonemoji+'\x20'+_0x4fea53+(_0x425890(0x1026,0x10f5,0xd7c,0x1ab8)+'┃╠')+dragonemoji+'\x20'+_0x4fea53+(_0x17318e(0xe84,-0x272,-0x539,0x47a)+_0x425890(0x319,0xc6d,0xeb9,0x160b))+dragonemoji+'\x20'+_0x4fea53+(_0x425890(0xa8f,0x995,0xfa6,0x8c)+_0x17318e(-0x323,0x6ad,0x1c,0x57d))+dragonemoji+'\x20'+_0x4fea53+('sell\x20[opti'+_0x425890(0x1b7c,0x1303,0x104e,0x1016)+'══════════'+_0x17318e(0x7c0,0x1525,0x11f4,0x10bd)+'═💠\x20DOWNLOA'+_0x17318e(0x1b65,0xfb8,0x1956,0x1204)+'║\x0a┃╠')+dragonemoji+'\x20'+_0x4fea53+('ytmp3\x20[url'+_0x425890(0x14e3,0xb20,0xcfe,0xf26)+'┃╠')+dragonemoji+'\x20'+_0x4fea53+(_0x425890(0x2aa,0x928,0x137f,0xd5)+_0x425890(0x405,0xb20,0x1d1,0x13de)+'┃╠')+dragonemoji+'\x20'+_0x4fea53+(_0x425890(0x11ad,0x9e5,0x1263,0x79c)+_0x425890(0xd96,0x9b0,0xf2f,0xad3)+'╠')+dragonemoji+'\x20'+_0x4fea53+(_0x17318e(0xb7c,-0x46e,0x9c7,0x469)+_0x425890(0x11d2,0x9b0,0xfc,0xe89)+'╠')+dragonemoji+'\x20'+_0x4fea53+(_0x17318e(0xcfa,0x712,0x2ca,0x332)+_0x425890(0x9de,0xfc4,0x15b2,0x7cb))+dragonemoji+'\x20'+_0x4fea53+(_0x425890(0xeb1,0x899,0xf21,0x6fb)+'y]\x0a┃╠')+dragonemoji+'\x20'+_0x4fea53+('soundcloud'+_0x425890(0x130e,0xbf3,0xf14,0x3e2)+_0x425890(0x1a7a,0x135f,0x18ab,0x1d28)+_0x17318e(0xacf,0xddc,0x1091,0xac8)+_0x425890(0xb12,0x1335,0xebf,0xa1b)+_0x425890(0xccb,0x71f,0x484,0x3f4)+_0x425890(0x9cd,0x407,0x10a,0x768))+dragonemoji+'\x20'+_0x4fea53+('play\x20[quer'+_0x17318e(0x1aa8,0x1189,0x1ba0,0x11e1))+dragonemoji+'\x20'+_0x4fea53+(_0x17318e(0xb2f,0x400,0xbaa,0x403)+_0x17318e(0x166d,0x1178,0x78a,0x11e1))+dragonemoji+'\x20'+_0x4fea53+(_0x17318e(0x1898,0xef9,0x1bc1,0x1718)+_0x17318e(0xc41,0x163e,0x16d9,0x100a))+dragonemoji+'\x20'+_0x4fea53+(_0x17318e(0x1dfd,0xba7,0x144e,0x15d7)+_0x425890(0xc9b,0xd66,0xb38,0x502))+dragonemoji+'\x20'+_0x4fea53+(_0x425890(0x95b,0xaae,0x121b,0x1511)+'ery]\x0a┃╠')+dragonemoji+'\x20'+_0x4fea53+('pinterest\x20'+_0x17318e(0x121d,0x861,0xef9,0x8ef))+dragonemoji+'\x20'+_0x4fea53+('wallpaper\x20'+_0x17318e(0xd3b,0xdc3,0x1324,0x8ef))+dragonemoji+'\x20'+_0x4fea53+('wikimedia\x20'+'[query]\x0a┃╠')+dragonemoji+'\x20'+_0x4fea53+(_0x17318e(0xa1c,0xf9b,0x1214,0x7f8)+_0x425890(0x18a,0x5d8,0x811,0x1d5))+dragonemoji+'\x20'+_0x4fea53+(_0x425890(0x48d,0x1c7,-0x2aa,-0x20e)+_0x425890(-0x303,0x5d8,-0x2bf,0xcb4))+dragonemoji+'\x20'+_0x4fea53+('webtoon\x20[q'+_0x425890(0x570,0x6b2,0x4a7,0x8fc)+_0x425890(0xbc7,0x135f,0x1715,0x13c1)+_0x17318e(0x1213,0xcd6,0xa73,0xac8)+_0x425890(0x118d,0xb83,0xee3,0x34d)+_0x17318e(0x1044,0xb81,0x1756,0xcea)+_0x17318e(0x1d7,0xa26,0xe9,0x624))+dragonemoji+'\x20'+_0x4fea53+_0x17318e(0xd41,0x1b2,0x9ce,0x956)+dragonemoji+'\x20'+_0x4fea53+(_0x17318e(0x247,0x3ce,0xfac,0xb2e)+_0x425890(0x5d,0x198,0x1a3,-0x4f))+dragonemoji+'\x20'+_0x4fea53+('couplepp\x0a┃'+_0x17318e(0xb22,0x973,0xab1,0xb3c)+_0x17318e(0xb3e,0x15ad,0x1076,0x1449)+_0x425890(0x418,0xd3f,0x8a4,0x12b8)+'IME\x20💠════╗'+'\x0a┃║\x0a┃╠')+dragonemoji+'\x20'+_0x4fea53+_0x17318e(0x1d46,0x1917,0x14f2,0x15d3)+dragonemoji+'\x20'+_0x4fea53+_0x17318e(0x181d,0x142a,0x10fc,0x1339)+dragonemoji+'\x20'+_0x4fea53+_0x425890(0x17d5,0x15e1,0x1b9a,0x189c)+dragonemoji+'\x20'+_0x4fea53+_0x17318e(-0xbb,0xd5c,0xb1b,0x87d)+dragonemoji+'\x20'+_0x4fea53+'hug\x0a┃╠'+dragonemoji+'\x20'+_0x4fea53+'awoo\x0a┃╠'+dragonemoji+'\x20'+_0x4fea53+'kiss\x0a┃╠'+dragonemoji+'\x20'+_0x4fea53+_0x425890(0x793,0x299,-0xf3,0x858)+dragonemoji+'\x20'+_0x4fea53+_0x425890(0xc13,0xe03,0x16b2,0xa11)+dragonemoji+'\x20'+_0x4fea53+_0x425890(0xb1f,0xac1,0xc33,0xaf5)+dragonemoji+'\x20'+_0x4fea53+'bonk\x0a┃╠'+dragonemoji+'\x20'+_0x4fea53+_0x17318e(0x6b6,0x1299,0xc12,0x861)+dragonemoji+'\x20'+_0x4fea53+'blush\x0a┃╠'+dragonemoji+'\x20'+_0x4fea53+_0x17318e(0x18a7,0x1f1e,0x1c6e,0x16c9)+dragonemoji+'\x20'+_0x4fea53+'wave\x0a┃╠'+dragonemoji+'\x20'+_0x4fea53+(_0x17318e(0xac5,0x1154,0x97f,0x908)+'╠')+dragonemoji+'\x20'+_0x4fea53+(_0x425890(0x18a,0x17d,0xbc3,0xb4a)+'╠')+dragonemoji+'\x20'+_0x4fea53+_0x17318e(0x61c,0x1050,0x1055,0xdb6)+dragonemoji+'\x20'+_0x4fea53+_0x425890(0x505,0x87f,0x11ab,0x210)+dragonemoji+'\x20'+_0x4fea53+_0x425890(0xdb5,0xb22,0x998,0x21b)+dragonemoji+'\x20'+_0x4fea53+_0x17318e(0xf7d,0x1b3e,0x130a,0x128b)+dragonemoji+'\x20'+_0x4fea53+_0x425890(0x1663,0xd15,0xb8d,0x142a)+dragonemoji+'\x20'+_0x4fea53+_0x17318e(0x8a2,0x1222,0x4b1,0xcae)+dragonemoji+'\x20'+_0x4fea53+_0x425890(0xa74,0xb05,0xab0,0x693)+dragonemoji+'\x20'+_0x4fea53+_0x425890(0x5d1,0x599,-0x9b,-0x3a5)+dragonemoji+'\x20'+_0x4fea53+_0x17318e(0x15fb,0x1366,0x13a7,0x14ac)+dragonemoji+'\x20'+_0x4fea53+('cringe\x0a┃╚═'+_0x17318e(0x129b,0xc75,0xd6e,0x157c)+_0x425890(0x8a0,0x8ab,0x8f,0x29a)+_0x17318e(0x1606,0x776,0x17c2,0xf62)+_0x425890(0x1c5b,0x11f2,0x1bf7,0x1099)+'┃╠')+dragonemoji+'\x20'+_0x4fea53+(_0x425890(0x1c61,0x1633,0x149d,0x15c6)+_0x17318e(0x1a66,0x1e61,0x1eee,0x14a4))+dragonemoji+'\x20'+_0x4fea53+('when\x20[text'+_0x17318e(0xdfe,0x124d,0xc43,0x100a))+dragonemoji+'\x20'+_0x4fea53+(_0x425890(-0x60,0x2d2,0x981,0x83)+'┃╠')+dragonemoji+'\x20'+_0x4fea53+('what\x20[text'+_0x425890(0x111b,0xded,0x1816,0x1745))+dragonemoji+'\x20'+_0x4fea53+(_0x17318e(0x1a00,0xc27,0xa14,0x116f)+'\x0a┃╠')+dragonemoji+'\x20'+_0x4fea53+(_0x17318e(0x1247,0xbdf,0x1479,0xd1a)+_0x17318e(0x5cd,0xbdd,0xb36,0x100a))+dragonemoji+'\x20'+_0x4fea53+(_0x17318e(0x25c,0xc71,-0xa1,0x499)+_0x17318e(0xcb5,0x516,0xf28,0x9b4))+dragonemoji+'\x20'+_0x4fea53+('beautifulc'+'heck\x20[tag]'+_0x17318e(0xc7a,0x1921,0x1929,0x14a4))+dragonemoji+'\x20'+_0x4fea53+('awesomeche'+_0x17318e(0x1a20,0x1312,0x1304,0xfc1)+'╠')+dragonemoji+'\x20'+_0x4fea53+('prettychec'+_0x17318e(0x3d0,0x1543,0x1619,0xd75))+dragonemoji+'\x20'+_0x4fea53+(_0x425890(0xb20,0x1073,0x9fb,0x15f7)+_0x17318e(0x5e8,0x758,0x1151,0xfc1)+'╠')+dragonemoji+'\x20'+_0x4fea53+('gaycheck\x20['+_0x17318e(-0x274,0x5b9,0x1e7,0x41e))+dragonemoji+'\x20'+_0x4fea53+('cutecheck\x20'+_0x17318e(0x13db,0x17d4,0x156b,0x141a))+dragonemoji+'\x20'+_0x4fea53+(_0x425890(0xab2,0x6f4,0x82c,0x8fc)+_0x425890(0x900,0x11fd,0x13c3,0x14d5))+dragonemoji+'\x20'+_0x4fea53+(_0x17318e(-0x2dd,0xdda,0x4ca,0x62d)+_0x17318e(0x1f33,0xf6c,0x1e12,0x1656))+dragonemoji+'\x20'+_0x4fea53+('characterc'+_0x425890(-0xb2,0x790,0x8bf,0x6c0)+_0x425890(0x1373,0x1287,0x8ec,0x1cba))+dragonemoji+'\x20'+_0x4fea53+(_0x425890(0xc01,0x29d,-0x1a2,0x32e)+_0x17318e(0x1639,0x11a7,0xa10,0xd75))+dragonemoji+'\x20'+_0x4fea53+'couple\x0a┃╠'+dragonemoji+'\x20'+_0x4fea53+(_0x425890(-0x9b,0x8d2,0x419,0x14)+'\x0a┃╠')+dragonemoji+'\x20'+_0x4fea53+_0x425890(0x463,0x7b1,0x1206,0xa79)+dragonemoji+'\x20'+_0x4fea53+_0x425890(0x1336,0xbd6,0x57f,0x282)+dragonemoji+'\x20'+_0x4fea53+_0x17318e(0x610,0x118,0xf15,0x4ec)+dragonemoji+'\x20'+_0x4fea53+'idiot\x0a┃╠'+dragonemoji+'\x20'+_0x4fea53+('handsome\x0a┃'+'╠')+dragonemoji+'\x20'+_0x4fea53+('beautiful\x0a'+'┃╠')+dragonemoji+'\x20'+_0x4fea53+_0x425890(-0xc1,0x213,-0x112,-0x817)+dragonemoji+'\x20'+_0x4fea53+_0x425890(0x3b1,0x703,0xadb,0x31)+dragonemoji+'\x20'+_0x4fea53+_0x17318e(0x2038,0xb1f,0xc6d,0x15a0)+dragonemoji+'\x20'+_0x4fea53+_0x17318e(0x798,-0x92,0x945,0x5e7)+dragonemoji+'\x20'+_0x4fea53+_0x425890(0xd5f,0x6cc,0xa76,0x60d)+dragonemoji+'\x20'+_0x4fea53+_0x17318e(0xcbf,0x90d,0xf1b,0x721)+dragonemoji+'\x20'+_0x4fea53+_0x425890(0x1d79,0x1379,0x1669,0x953)+dragonemoji+'\x20'+_0x4fea53+_0x17318e(-0x52d,0xc5f,0x28f,0x4c4)+dragonemoji+'\x20'+_0x4fea53+_0x425890(0x121b,0x13a1,0x15b5,0x1110)+dragonemoji+'\x20'+_0x4fea53+_0x17318e(0x1a0b,0x1746,0x1741,0x177f)+dragonemoji+'\x20'+_0x4fea53+_0x425890(0x1069,0xf15,0x133c,0x113c)+dragonemoji+'\x20'+_0x4fea53+_0x17318e(0xe3c,0x58d,0x629,0x5d5)+dragonemoji+'\x20'+_0x4fea53+_0x17318e(0x1a40,0xcd1,0x1c22,0x14d3)+dragonemoji+'\x20'+_0x4fea53+_0x17318e(0x16e7,0x1003,0x15e5,0xe71)+dragonemoji+'\x20'+_0x4fea53+_0x425890(0xfe2,0x11e9,0x13bc,0x10a6)+dragonemoji+'\x20'+_0x4fea53+(_0x425890(0x2cf,0x4bb,0x956,0x5d3)+'┃╠')+dragonemoji+'\x20'+_0x4fea53+_0x17318e(0x859,0x191b,0xbca,0x12c5)+dragonemoji+'\x20'+_0x4fea53+(_0x425890(0x1c49,0x138e,0xbdb,0x1aa6)+'ion]\x0a┃╠')+dragonemoji+'\x20'+_0x4fea53+(_0x17318e(0x7b8,0xfcb,0x17de,0xfb8)+_0x17318e(0x6c9,0x158e,0x1183,0x100a))+dragonemoji+'\x20'+_0x4fea53+(_0x425890(0x1b30,0x160d,0x1a30,0x1a96)+'ag]\x0a┃╚════'+_0x425890(0x1ae4,0x135f,0x1209,0x1012)+_0x425890(0xac5,0xea0,0x8c6,0x943)+_0x425890(0x880,0x110a,0xfa2,0x115e)+_0x425890(0xfb5,0x1606,0x10b5,0x17dc)+'\x0a┃╠')+dragonemoji+'\x20'+_0x4fea53+(_0x425890(-0x92,0x26d,0x53e,0x351)+_0x17318e(0x36b,0x9f5,-0x2f5,0x761)+']\x0a┃╠')+dragonemoji+'\x20'+_0x4fea53+('sticker\x20[r'+_0x425890(-0x3f1,0x223,0xcbf,0x54c)+_0x425890(0xcb,0x6a4,0xf03,0xde0))+dragonemoji+'\x20'+_0x4fea53+(_0x17318e(0x1450,0x18ea,0x1957,0x13da)+_0x17318e(0x273,0x953,0x603,0xadc)+'\x0a┃╠')+dragonemoji+'\x20'+_0x4fea53+(_0x425890(0x14be,0x1621,0x13cb,0x1e72)+'eply\x20img]\x0a'+'┃╠')+dragonemoji+'\x20'+_0x4fea53+(_0x17318e(0x5db,0x11a9,0xdd5,0xc2b)+'ly\x20stick]\x0a'+'┃╠')+dragonemoji+'\x20'+_0x4fea53+(_0x425890(0x1c66,0x143d,0xdd7,0x13f1)+_0x17318e(0x918,0x1c02,0xa53,0x11ad))+dragonemoji+'\x20'+_0x4fea53+(_0x17318e(0x10e5,0xbaa,0x18dc,0x1245)+_0x17318e(-0x161,-0x31c,0x43c,0x490))+dragonemoji+'\x20'+_0x4fea53+(_0x17318e(0x15c5,0xfd5,0xd78,0xeb5)+_0x17318e(0xf2c,0xda6,0xe65,0xae2))+dragonemoji+'\x20'+_0x4fea53+(_0x17318e(0xe60,-0x16a,0xc6,0x7b7)+'eply\x20vid]\x0a'+'┃╠')+dragonemoji+'\x20'+_0x4fea53+(_0x17318e(0x519,0x18a,0x361,0xacc)+_0x17318e(0x8e4,0x200,0x107b,0x89a)+'┃╠')+dragonemoji+'\x20'+_0x4fea53+(_0x425890(0x12aa,0xdf4,0xaae,0x424)+_0x17318e(0x2ee,0x7ed,0xf21,0x89a)+'┃╠')+dragonemoji+'\x20'+_0x4fea53+(_0x17318e(0xd60,-0x3f1,0xaed,0x347)+_0x425890(0x725,0xaf2,0x8c,0xda0)+'══════════'+_0x17318e(0x866,0xa5e,0x1419,0xac8)+_0x425890(0xb0e,0x581,0x87c,-0x346)+_0x425890(-0xc8,0x7ae,0xc20,-0x2e8)+_0x17318e(0x971,0x1106,0xb98,0x115f))+dragonemoji+'\x20'+_0x4fea53+_0x17318e(0x12ce,0x109e,0x1f04,0x1604)+dragonemoji+'\x20'+_0x4fea53+_0x17318e(0xbd2,0x6ac,0x14b8,0xe98)+dragonemoji+'\x20'+_0x4fea53+_0x17318e(0x8b3,0x1890,0x978,0x10e2)+dragonemoji+'\x20'+_0x4fea53+_0x425890(0xa4a,0x142c,0x18a6,0x156f)+dragonemoji+'\x20'+_0x4fea53+_0x425890(0x6e0,0x224,0xaf0,0xb50)+dragonemoji+'\x20'+_0x4fea53+_0x425890(0x1173,0x8de,0x6df,0xcb3)+dragonemoji+'\x20'+_0x4fea53+'getmsg\x0a┃╠'+dragonemoji+'\x20'+_0x4fea53+(_0x17318e(0x39e,0x125d,0x7a1,0x903)+'══════════'+'═══════\x0a┃╔'+_0x17318e(0x5f6,0xaa4,0x10f1,0xd39)+'\x20CHAT\x20💠══╗'+_0x17318e(0x1b0e,0xea0,0xb6d,0x115f))+dragonemoji+'\x20'+_0x4fea53+(_0x425890(0x3e3,0x63c,-0x3fa,-0x66)+'┃╠')+dragonemoji+'\x20'+_0x4fea53+_0x17318e(0x1b2a,0x1bcc,0x1ed5,0x14b2)+dragonemoji+'\x20'+_0x4fea53+'next\x0a┃╠'+dragonemoji+'\x20'+_0x4fea53+(_0x425890(0x112a,0xb4e,0x1316,0xe74)+_0x17318e(0x16dd,0x15fc,0x1323,0x157c)+_0x425890(0x2e0,0x65e,0x7df,0xa57)+_0x425890(0x2f7,0x86c,0x29b,0x2fc)+_0x17318e(0xdae,-0x162,0xdec,0x816)+'\x0a┃║\x0a┃╠')+dragonemoji+'\x20'+_0x4fea53+(_0x17318e(0xba7,0x1949,0x18c6,0x1197)+_0x17318e(0xdc3,0x50b,0x939,0x490))+dragonemoji+'\x20'+_0x4fea53+('blown\x20[rep'+'ly\x20aud]\x0a┃╠')+dragonemoji+'\x20'+_0x4fea53+(_0x17318e(0x1458,0x8b3,0x119e,0x11ff)+_0x425890(-0xe4,0x273,0x9a1,-0x654))+dragonemoji+'\x20'+_0x4fea53+(_0x425890(0xa8b,0xdcd,0xe4d,0x9a7)+_0x17318e(0x507,0x693,0xd8b,0xe6a)+'┃╠')+dragonemoji+'\x20'+_0x4fea53+('fast\x20[repl'+_0x17318e(0x8e8,0x4a7,-0x5db,0x490))+dragonemoji+'\x20'+_0x4fea53+(_0x425890(0xf9d,0xf4c,0x8a0,0x1444)+'\x20aud]\x0a┃╠')+dragonemoji+'\x20'+_0x4fea53+('nightcore\x20'+_0x17318e(-0x39e,0x555,0x4d,0x6d4)+_0x425890(0x95c,0xded,0x9e8,0xa13))+dragonemoji+'\x20'+_0x4fea53+(_0x17318e(0x1655,0x18f2,0x77c,0x109b)+'eply\x20aud]\x0a'+'┃╠')+dragonemoji+'\x20'+_0x4fea53+(_0x17318e(0x1935,0xe26,0x123c,0x1612)+_0x425890(0x44f,0xbd4,0x548,0x763))+dragonemoji+'\x20'+_0x4fea53+(_0x17318e(0x2003,0xead,0x10fb,0x1753)+_0x17318e(0x6b2,0x5e5,-0x392,0x490))+dragonemoji+'\x20'+_0x4fea53+(_0x17318e(0x1033,0xa0d,0x10d0,0x13c5)+_0x17318e(0x1344,0x17e2,0x1106,0xeb9)+_0x17318e(0x1d00,0x1b11,0xfc6,0x171e)+_0x425890(0x1bdd,0x135f,0x1612,0x11b0)+'═\x0a┃╔════💠\x20'+_0x425890(0x350,0x442,0x5,0xbe9)+_0x17318e(0x102d,0x810,0x10bd,0x10e6))+dragonemoji+'\x20'+_0x4fea53+(_0x17318e(0x157a,0x670,0x5d7,0xf53)+_0x17318e(0x608,-0x20,0x9df,0x71d))+dragonemoji+'\x20'+_0x4fea53+(_0x425890(0x2cf,0xa77,0x1fd,0x627)+_0x17318e(0xe34,0xa2a,0xb39,0x71d))+dragonemoji+'\x20'+_0x4fea53+('artinama\x20('+_0x17318e(0x1e45,0x1896,0x10ab,0x1477))+dragonemoji+'\x20'+_0x4fea53+(_0x17318e(0x1623,0x1ce6,0x1b07,0x14da)+_0x17318e(-0x1f8,0xdd1,0x41d,0x3b5))+dragonemoji+'\x20'+_0x4fea53+(_0x17318e(0x17a4,0x157f,0x1177,0x14da)+_0x425890(0xb24,0xc30,0x1524,0xdd8)+_0x425890(0x1667,0xc19,0x12b1,0x157c))+dragonemoji+'\x20'+_0x4fea53+(_0x425890(0xa04,0x557,0x3b8,0xfba)+'\x20(indo)\x0a┃╠')+dragonemoji+'\x20'+_0x4fea53+(_0x425890(0xa49,0x1321,0xb24,0x1416)+'\x20(indo)\x0a┃╠')+dragonemoji+'\x20'+_0x4fea53+('cocoknama\x20'+_0x17318e(0xf11,-0x1b2,-0x372,0x71d))+dragonemoji+'\x20'+_0x4fea53+('pasangan\x20('+_0x17318e(0x1e58,0xd31,0x17f1,0x1477))+dragonemoji+'\x20'+_0x4fea53+('jadiannika'+_0x17318e(0xff3,0x1ec,0xe39,0x75a)+'╠')+dragonemoji+'\x20'+_0x4fea53+('sifatusaha'+_0x425890(0x63e,0x198,0xba9,-0x1aa))+dragonemoji+'\x20'+_0x4fea53+(_0x17318e(0x16ed,0x114c,0xfed,0xe35)+_0x17318e(0x220f,0x2166,0x14f9,0x181b))+dragonemoji+'\x20'+_0x4fea53+(_0x17318e(0x162b,0x182d,0xcff,0xec2)+_0x17318e(0xcfa,-0x2df,0xa9d,0x71d))+dragonemoji+'\x20'+_0x4fea53+(_0x17318e(0x295,0xc8d,0x396,0x566)+_0x17318e(0xb24,-0x2f,0x435,0x99d))+dragonemoji+'\x20'+_0x4fea53+(_0x425890(0x8e,0x567,0x34c,-0x454)+_0x425890(0xc69,0x125a,0xa51,0x1044))+dragonemoji+'\x20'+_0x4fea53+(_0x425890(0x1140,0xb5d,0x93c,0x12de)+_0x425890(0xcb5,0x780,0x10df,0x247))+dragonemoji+'\x20'+_0x4fea53+('fengshui\x20('+'indo)\x0a┃╠')+dragonemoji+'\x20'+_0x4fea53+(_0x17318e(0x1657,0xced,0x1c79,0x1463)+'indo)\x0a┃╠')+dragonemoji+'\x20'+_0x4fea53+(_0x425890(0x435,0xcee,0x1181,0xab0)+_0x17318e(-0x6,0x31f,0x9cf,0x3b5))+dragonemoji+'\x20'+_0x4fea53+(_0x17318e(0x10fd,0x16c1,0x4e6,0xf2d)+_0x17318e(0xa93,0xfef,0x14ce,0x1477))+dragonemoji+'\x20'+_0x4fea53+(_0x425890(0x10d9,0xa09,0x3a1,0x41f)+'indo)\x0a┃╠')+dragonemoji+'\x20'+_0x4fea53+(_0x425890(0x49b,0x226,0xab3,-0x6a9)+_0x425890(-0x78e,0x198,-0x8ce,0xa99))+dragonemoji+'\x20'+_0x4fea53+(_0x425890(0x29,0x3e6,-0x57a,0x866)+_0x17318e(0x844,0x4a9,-0x365,0x38b)+'╠')+dragonemoji+'\x20'+_0x4fea53+(_0x17318e(0x1c4c,0x1051,0x1a14,0x156e)+_0x425890(0x2b,0x780,-0x2e9,0x6d0))+dragonemoji+'\x20'+_0x4fea53+(_0x425890(0xc51,0x12d2,0xd6e,0xf3d)+'indo)\x0a┃╠')+dragonemoji+'\x20'+_0x4fea53+('keberuntun'+_0x425890(0x14d1,0x13a4,0x1752,0x1005)+_0x17318e(0x13bc,0x1847,0x1338,0x14a4))+dragonemoji+'\x20'+_0x4fea53+(_0x17318e(0x1c75,0x1010,0xf66,0x1830)+_0x17318e(0x355,0xf45,0x7a9,0x71d))+dragonemoji+'\x20'+_0x4fea53+(_0x425890(0x768,0xf41,0xab3,0x8e2)+_0x17318e(0x11ba,0xd75,0x20a,0x71d))+dragonemoji+'\x20'+_0x4fea53+('zodiak\x20(in'+_0x17318e(0xebb,0xfc4,0x1eed,0x181b))+dragonemoji+'\x20'+_0x4fea53+(_0x17318e(0x133f,0x1398,0x16f5,0x16b1)+_0x425890(0x40,0x4e2,-0x92,0x166)+_0x425890(0xe07,0x135f,0x1801,0x1950)+_0x17318e(0xa3d,0x1adc,0x1a6a,0x108a))+ownername+'*',_0x5cbc9f['footer']=_0x3797bd[_0x425890(0x1898,0x10be,0xb4f,0xccd)][_0x425890(0x13a8,0xe82,0x7b5,0x1137)],_0x5cbc9f[_0x17318e(0xc25,0x122d,0xc4a,0x117e)]=_0x55a5e5,_0x5cbc9f[_0x425890(0x6c0,0xfef,0x10c9,0xda5)]=0x4;let _0x485f0b=_0x5cbc9f;_0x3797bd['sendMessag'+'e'](_0x17aa6d[_0x17318e(0x64c,0x106b,0x491,0xee4)],_0x485f0b,{'quoted':_0x17aa6d});}}break;case _0x295ea5[_0x17318e(0x32,0x11e1,0xcc9,0x9d2)]:{const _0xb30430={};_0xb30430[_0x425890(0x983,0x10a0,0x14ce,0x17b3)+'t']=_0x425890(0x180b,0x123f,0x103d,0x1939);const _0x47eaef={};_0x47eaef[_0x17318e(0x124e,0x141b,0xdb5,0x1194)]=_0x4fea53+_0x17318e(0x115a,0x9d7,0x15ed,0xc66),_0x47eaef[_0x17318e(0x1afa,0xa2a,0x1b46,0x1318)]=_0xb30430,_0x47eaef['type']=0x1;const _0xc4429={};_0xc4429[_0x17318e(0x1071,0x10a7,0xe64,0x12bd)+'t']=_0x295ea5[_0x17318e(-0x239,0x8c8,0x53e,0x5a1)];const _0x45bff0={};_0x45bff0['buttonId']=_0x4fea53+_0x17318e(0x1f25,0x17f4,0x1030,0x1751),_0x45bff0[_0x17318e(0x1804,0x1355,0xd77,0x1318)]=_0xc4429,_0x45bff0[_0x425890(0xc9e,0x141b,0x18f2,0x1e98)]=0x1;let _0x198242=[_0x47eaef,_0x45bff0],_0x3b5e1d={'image':{'url':_0x295ea5[_0x425890(0x788,0x11d1,0x1260,0xb48)](_0x58a5bf,_0x295ea5[_0x425890(-0x679,0x160,-0x336,-0x42b)])},'caption':_0x425890(0x3f2,0x2ae,0x320,-0x46b)+botname+(_0x425890(0x4b2,0x19b,-0x525,-0x37)+_0x425890(0x996,0x5b5,0x917,-0xc4)+'💠══╗\x0a┃║\x0a┃╠')+dragonemoji+'\x20'+_0x4fea53+(_0x17318e(0xcca,0xbb0,0xcab,0x1333)+_0x425890(-0x14e,0x5c8,0xa44,0x2b5)+_0x17318e(0x12a9,0x7ba,0xc6e,0xa13))+dragonemoji+'\x20'+_0x4fea53+(_0x17318e(0x1e8c,0x1396,0x1548,0x1505)+_0x17318e(0x921,-0x360,-0x5ad,0x348)+_0x17318e(0xd15,0xfd2,0xb7e,0xe91))+dragonemoji+'\x20'+_0x4fea53+(_0x17318e(0x782,0xe1e,0xfe1,0x6e1)+_0x425890(0x2ff,0x2b0,0x137,0x8b8)+_0x425890(0x1b9,0x170,-0x2f6,0x4f8))+dragonemoji+'\x20'+_0x4fea53+'info\x0a┃╠'+dragonemoji+'\x20'+_0x4fea53+_0x425890(-0x348,0x3cf,0xae9,0x58c)+dragonemoji+'\x20'+_0x4fea53+(_0x425890(0x9cf,0xbbc,0xfb8,0x842)+'┃╠')+dragonemoji+'\x20'+_0x4fea53+'ping\x0a┃╠'+dragonemoji+'\x20'+_0x4fea53+_0x17318e(0x150c,0x1ab9,0x1505,0x17c7)+dragonemoji+'\x20'+_0x4fea53+_0x425890(0xa16,0x18a,-0x473,0x985)+dragonemoji+'\x20'+_0x4fea53+'delete\x0a┃╠'+dragonemoji+'\x20'+_0x4fea53+(_0x17318e(0xee9,0x117d,0x18da,0x10eb)+'╠')+dragonemoji+'\x20'+_0x4fea53+_0x425890(0x2fb,0x72f,0x84d,0x81d)+dragonemoji+'\x20'+_0x4fea53+_0x425890(0x144d,0xd53,0x82a,0x877)+dragonemoji+'\x20'+_0x4fea53+(_0x17318e(0x1927,0x73c,0x11f9,0x1041)+_0x17318e(0x1d39,0x1398,0x1a4f,0x1691))+dragonemoji+'\x20'+_0x4fea53+('antispam\x0a┃'+'╚═════════'+'════☬\x0a┗━━❯'+'\x20')+_0x2cbadb+'\x20❮━😎','footer':_0x3797bd['user']['name'],'buttons':_0x198242,'headerType':0x4};_0x3797bd['sendMessag'+'e'](_0x17aa6d[_0x17318e(0x152a,0xff4,0x597,0xee4)],_0x3b5e1d,{'quoted':_0x17aa6d});}break;case _0x295ea5['dljtb']:case _0x295ea5[_0x17318e(0x1a60,0x1d48,0xc15,0x166a)]:{const _0x530abb={};_0x530abb[_0x17318e(0x1858,0xfbb,0xe58,0x12bd)+'t']=_0x295ea5['spClB'];const _0x2ed8ec={};_0x2ed8ec['buttonId']=_0x4fea53+_0x425890(0x513,0xa49,0x1445,0x7),_0x2ed8ec[_0x425890(0xce8,0x10fb,0x15ee,0xb20)]=_0x530abb,_0x2ed8ec[_0x17318e(0xdcc,0x1a49,0x1827,0x1638)]=0x1;const _0x42ef4d={};_0x42ef4d[_0x17318e(0xed3,0x185b,0x11b0,0x12bd)+'t']=_0x295ea5[_0x425890(-0x6fe,0x384,0x275,0xb82)];const _0x457b4d={};_0x457b4d['buttonId']=_0x4fea53+_0x425890(0x10a4,0x1534,0x1994,0x1fa9),_0x457b4d[_0x17318e(0x16d9,0x15ed,0xf61,0x1318)]=_0x42ef4d,_0x457b4d[_0x425890(0x18a1,0x141b,0x1e80,0x1d92)]=0x1;let _0x3e623f=[_0x2ed8ec,_0x457b4d],_0x3f1654={'image':{'url':_0x295ea5['cFyXv'](_0x58a5bf,_0x295ea5['fwjWA'])},'caption':_0x425890(0x3d9,0x618,0x1ce,0x650)+botname+(_0x425890(0x627,0x19b,0xae6,-0x73a)+'═══💠\x20GROUP'+_0x425890(-0x34d,0x440,-0x43c,-0x52d)+_0x17318e(0x964,0x5aa,0x1a,0x9c1)+'╠')+dragonemoji+'\x20'+_0x4fea53+(_0x425890(0x13cc,0x1570,0xf59,0x1cfe)+'┃╠')+dragonemoji+'\x20'+_0x4fea53+(_0x425890(0x460,0x6b1,0x2ee,-0x17d)+_0x17318e(0x845,0x9d3,0xfa6,0xc0f)+'╠')+dragonemoji+'\x20'+_0x4fea53+('setgcpp\x20[i'+_0x425890(0xaec,0xa46,0x86b,0xf90))+dragonemoji+'\x20'+_0x4fea53+('setname\x20[t'+_0x17318e(0x61b,0xf3e,0x269,0x64f))+dragonemoji+'\x20'+_0x4fea53+(_0x425890(0x1bf,0x16f,-0x51d,-0x7bb)+_0x17318e(0x57f,0xef1,-0x2f5,0x64f))+dragonemoji+'\x20'+_0x4fea53+('group\x20[tex'+_0x425890(0x107e,0x797,0xb73,0x1232))+dragonemoji+'\x20'+_0x4fea53+(_0x425890(0xd7e,0xf55,0xd0f,0x733)+'option]\x0a┃╠')+dragonemoji+'\x20'+_0x4fea53+(_0x17318e(0xa52,0x998,0xa3e,0x56f)+_0x17318e(0x1f26,0x1481,0xe5d,0x14a4))+dragonemoji+'\x20'+_0x4fea53+(_0x425890(0x1903,0x10ab,0x1b11,0x1866)+_0x425890(-0x33d,0x73a,0x10cd,-0x283))+dragonemoji+'\x20'+_0x4fea53+(_0x17318e(0x74f,0xafb,0x1959,0xf47)+'ext]\x0a┃╠')+dragonemoji+'\x20'+_0x4fea53+(_0x17318e(0x1c72,0x133a,0x1153,0x143f)+_0x17318e(0x158d,0x103b,0xcd3,0xf08))+dragonemoji+'\x20'+_0x4fea53+(_0x425890(0x1c7,0x19c,-0x23a,0xa30)+'on/off]\x0a┃╠')+dragonemoji+'\x20'+_0x4fea53+('mute\x20[on/o'+_0x17318e(0xf0e,0xb11,0xe62,0x1283))+dragonemoji+'\x20'+_0x4fea53+('promote\x20[r'+_0x17318e(0xeee,0x27a,0x1702,0xc6b)+'┃╠')+dragonemoji+'\x20'+_0x4fea53+(_0x17318e(0x6f4,0x7f4,0x5f3,0x804)+_0x17318e(0x14c7,0x1269,0x1524,0x1032)+'╠')+dragonemoji+'\x20'+_0x4fea53+'vote\x0a┃╠'+dragonemoji+'\x20'+_0x4fea53+'devote\x0a┃╠'+dragonemoji+'\x20'+_0x4fea53+_0x17318e(0xe66,0xeae,0x36b,0xa16)+dragonemoji+'\x20'+_0x4fea53+('checkvote\x0a'+'┃╠')+dragonemoji+'\x20'+_0x4fea53+(_0x425890(-0x37f,0x4d4,0xae3,0x5a8)+_0x17318e(0x1b7e,0x1520,0x1266,0x157c)+_0x425890(0x11a,0x955,0x8e2,0xdab))+_0x2cbadb+_0x425890(0xc8a,0x383,0x101,0x577),'footer':_0x3797bd[_0x425890(0xef9,0x10be,0x10c5,0x669)][_0x17318e(0xff1,0xdc0,0x136e,0x109f)],'buttons':_0x3e623f,'headerType':0x4};_0x3797bd[_0x17318e(0x9bc,-0x43a,0xac,0x63c)+'e'](_0x17aa6d[_0x425890(0x2b8,0xcc7,0x47c,0x848)],_0x3f1654,{'quoted':_0x17aa6d});}break;case _0x295ea5[_0x17318e(0xcbb,0x952,0xdc9,0x1297)]:{if(_0x295ea5['FEgqN'](_0x295ea5[_0x425890(0xe79,0xc2c,0x16b2,0x88f)],_0x425890(0x10ba,0x15a0,0xc7d,0xc00))){const _0x25a49c={};_0x25a49c[_0x425890(0xbdf,0x10a0,0xf83,0xfe8)+'t']=_0x295ea5['spClB'];const _0x2ee47e={};_0x2ee47e[_0x17318e(0x7a3,0xb18,0x765,0x1194)]=_0x4fea53+'alive',_0x2ee47e[_0x425890(0x1b02,0x10fb,0xf02,0x1272)]=_0x25a49c,_0x2ee47e['type']=0x1;const _0x342a53={};_0x342a53['displayTex'+'t']=_0x295ea5[_0x425890(0x2b9,0x384,0x1d,0x47b)];const _0x350b97={};_0x350b97[_0x425890(0xea7,0xf77,0xb47,0xfc8)]=_0x4fea53+_0x17318e(0xf4c,0x1ffb,0x217d,0x1751),_0x350b97['buttonText']=_0x342a53,_0x350b97[_0x425890(0x1096,0x141b,0x15f2,0x1401)]=0x1;let _0x4b2c80=[_0x2ee47e,_0x350b97];const _0x2dbd59={};_0x2dbd59[_0x17318e(0x72e,0xb48,0x10a1,0x810)]=_0x58a5bf+_0x17318e(0x1ecb,0x1810,0x13f1,0x1513);const _0x4ee93e={};_0x4ee93e['image']=_0x2dbd59,_0x4ee93e[_0x17318e(0x904,-0x524,-0x40e,0x527)]='\x0a┏━❯\x20'+botname+(_0x17318e(-0x36f,-0x314,0x4a3,0x3b8)+_0x425890(0x1baa,0x1455,0x1608,0xb58)+_0x17318e(0x1680,0xee3,0x1938,0x179e)+_0x17318e(0x1526,0x577,0x1072,0xb68))+dragonemoji+'\x20'+_0x4fea53+_0x17318e(0x1557,0x1187,0xec7,0x16ad)+dragonemoji+'\x20'+_0x4fea53+'mining\x0a┃╠'+dragonemoji+'\x20'+_0x4fea53+_0x17318e(-0xde,0x92e,0xf16,0x9a4)+dragonemoji+'\x20'+_0x4fea53+(_0x17318e(0xe85,0xcd0,0x157f,0x1346)+'┃╠')+dragonemoji+'\x20'+_0x4fea53+'profile\x0a┃╠'+dragonemoji+'\x20'+_0x4fea53+(_0x425890(0x12ec,0x10f5,0x11ff,0x79b)+'┃╠')+dragonemoji+'\x20'+_0x4fea53+('leaderboar'+_0x425890(0xe29,0xc6d,0x11b5,0xdb2))+dragonemoji+'\x20'+_0x4fea53+('buy\x20[optio'+_0x17318e(0xba4,0xd81,0x67a,0x57d))+dragonemoji+'\x20'+_0x4fea53+(_0x425890(0x5e9,0x100b,0x11bf,0xed9)+_0x425890(0xe27,0x1303,0xafa,0x17ce)+_0x425890(0xc2b,0x80f,0x7f2,0x53d)+'\x0a┗━━❯\x20')+_0x2cbadb+_0x425890(-0x1d5,0x383,0xe02,0xd6d),_0x4ee93e['footer']=_0x3797bd[_0x17318e(0x11f1,0xdbf,0x1352,0x12db)][_0x17318e(0x1a78,0x1aca,0x1b08,0x109f)],_0x4ee93e[_0x425890(0x1879,0xf61,0xab0,0x9be)]=_0x4b2c80,_0x4ee93e[_0x425890(0x136b,0xfef,0xa50,0xa12)]=0x4;let _0x32c04b=_0x4ee93e;_0x3797bd['sendMessag'+'e'](_0x17aa6d[_0x425890(0xa31,0xcc7,0xcae,0x3e8)],_0x32c04b,{'quoted':_0x17aa6d});}else{const _0x4c408c={};_0x4c408c['text']='*බැරි\x20නම්\x20'+_0x425890(0xbc,0x83c,0xc47,0x8b8)+'*';const _0x2fbcaa={};_0x2fbcaa['quoted']=_0x5cca03,_0x43f7ae[_0x17318e(-0x55,0x84e,-0x18f,0x63c)+'e'](_0xdb4795,_0x4c408c,_0x2fbcaa);}}break;case _0x17318e(0x91f,0xbb9,0x1728,0x10ca):{const _0x49671f={};_0x49671f[_0x17318e(0x13f6,0xd02,0x8aa,0x12bd)+'t']=_0x295ea5[_0x17318e(0xeb5,0xdd8,0x1d1,0x8a9)];const _0x41a33f={};_0x41a33f[_0x425890(0x77f,0xf77,0x6eb,0x18e6)]=_0x4fea53+'allmenu',_0x41a33f[_0x17318e(0x12c3,0x9e1,0x1953,0x1318)]=_0x49671f,_0x41a33f[_0x17318e(0x1f8b,0x201f,0xced,0x1638)]=0x1;const _0x34a111={};_0x34a111[_0x17318e(0x1310,0x15d8,0x1507,0x12bd)+'t']=_0x295ea5[_0x425890(0x293,0xcd1,0x1389,0x101c)];const _0x2f49a4={};_0x2f49a4[_0x17318e(0x1bcd,0x895,0x1748,0x1194)]=_0x4fea53+_0x17318e(0x908,0xe97,0x554,0xc66),_0x2f49a4[_0x17318e(0x1816,0x1359,0xec4,0x1318)]=_0x34a111,_0x2f49a4[_0x425890(0xc7a,0x141b,0x15a7,0x1789)]=0x1;const _0x105de3={};_0x105de3[_0x425890(0x189b,0x10a0,0xfa4,0x15bb)+'t']=_0x295ea5[_0x17318e(-0x1cf,0x7a5,0x639,0x5a1)];const _0x402dcd={};_0x402dcd[_0x17318e(0x101c,0x865,0x193e,0x1194)]=_0x4fea53+_0x425890(0xca6,0x1534,0x10eb,0x14ff),_0x402dcd['buttonText']=_0x105de3,_0x402dcd[_0x17318e(0x1493,0xf3e,0xde2,0x1638)]=0x1;let _0x4cb7b7=[_0x41a33f,_0x2f49a4,_0x402dcd],_0x62e524={'image':{'url':_0x295ea5[_0x425890(0xe07,0xb80,0x755,0x3ce)](_0x58a5bf,_0x17318e(0x1601,0x1702,0x11ff,0xe44))},'caption':'\x0a┏━❯\x20'+botname+('\x20❮━━😎\x20\x0a┃╔═'+_0x425890(0xa0f,0xf8e,0x16aa,0xc8b)+_0x425890(0x1261,0x1620,0x1a40,0xe77)+_0x17318e(0xc20,0x1348,0x1308,0xace))+dragonemoji+'\x20'+_0x4fea53+('how\x20[text\x0a'+'┃╠')+dragonemoji+'\x20'+_0x4fea53+('when\x20[text'+']\x0a┃╠')+dragonemoji+'\x20'+_0x4fea53+(_0x425890(0xbb3,0x2d2,-0x447,0x6e9)+'┃╠')+dragonemoji+'\x20'+_0x4fea53+(_0x425890(0xb3c,0x116f,0x1a7b,0xdb9)+_0x425890(0xc2d,0xded,0xe2f,0x117c))+dragonemoji+'\x20'+_0x4fea53+(_0x425890(0xa3d,0xf52,0x104c,0x6b5)+'\x0a┃╠')+dragonemoji+'\x20'+_0x4fea53+('rate\x20[text'+_0x17318e(0x79d,0x1258,0x126d,0x100a))+dragonemoji+'\x20'+_0x4fea53+('wangy\x20[tex'+_0x17318e(0x403,0x192,0x9d0,0x9b4))+dragonemoji+'\x20'+_0x4fea53+(_0x425890(-0x604,0x38f,-0x42,0x81d)+_0x425890(0x78a,0x790,0xc3b,0xdcc)+_0x425890(0x1c3c,0x1287,0x1119,0x1bd8))+dragonemoji+'\x20'+_0x4fea53+(_0x425890(0x45,0x7c5,0x27a,0x746)+_0x17318e(0xa4e,0xe3f,0xfcb,0xfc1)+'╠')+dragonemoji+'\x20'+_0x4fea53+(_0x425890(-0x64e,0x19a,0x7ec,-0x758)+'k\x20[tag]\x0a┃╠')+dragonemoji+'\x20'+_0x4fea53+(_0x425890(0x1659,0x1073,0x5d4,0x1263)+_0x17318e(0x154f,0x6af,0x13cf,0xfc1)+'╠')+dragonemoji+'\x20'+_0x4fea53+(_0x17318e(0xa9c,0x107f,0x24b,0x9bc)+_0x17318e(0x6b2,0xb5f,0x7db,0x41e))+dragonemoji+'\x20'+_0x4fea53+(_0x425890(0x164d,0xcff,0x11f2,0x12cc)+_0x425890(0x12a4,0x11fd,0xd60,0x1b87))+dragonemoji+'\x20'+_0x4fea53+('uglycheck\x20'+_0x17318e(0x1b5c,0x1c5a,0x1e20,0x141a))+dragonemoji+'\x20'+_0x4fea53+(_0x17318e(0xa1b,0xf10,0x1071,0x62d)+_0x425890(0xcdb,0x1439,0x1d60,0x160e))+dragonemoji+'\x20'+_0x4fea53+(_0x17318e(-0x4e3,0xc57,-0x42b,0x479)+'heck\x20[tag]'+_0x17318e(0x1453,0xffa,0x1a88,0x14a4))+dragonemoji+'\x20'+_0x4fea53+(_0x425890(0x9c4,0x29d,0x386,-0x368)+_0x425890(0x831,0xb58,0x1280,0x43f))+dragonemoji+'\x20'+_0x4fea53+_0x17318e(0x1604,0x5ed,0x41e,0xc62)+dragonemoji+'\x20'+_0x4fea53+(_0x17318e(0xc9e,0x111e,0x111d,0xaef)+_0x425890(0x10b3,0x1287,0x1a84,0xf00))+dragonemoji+'\x20'+_0x4fea53+_0x425890(0x28d,0x7b1,0x2d4,0xd1a)+dragonemoji+'\x20'+_0x4fea53+_0x17318e(0xa2c,0x15aa,0xff0,0xdf3)+dragonemoji+'\x20'+_0x4fea53+'kind\x0a┃╠'+dragonemoji+'\x20'+_0x4fea53+('handsome\x0a┃'+'╠')+dragonemoji+'\x20'+_0x4fea53+(_0x17318e(0x14d9,0x6f5,0x582,0xe1f)+'┃╠')+dragonemoji+'\x20'+_0x4fea53+_0x17318e(-0x20d,0x8d8,0x6bb,0x430)+dragonemoji+'\x20'+_0x4fea53+_0x17318e(0x51f,0xbdf,0x682,0x920)+dragonemoji+'\x20'+_0x4fea53+_0x425890(0x1367,0x1383,0x1b20,0x1800)+dragonemoji+'\x20'+_0x4fea53+_0x425890(0x9d5,0x3ca,-0x249,0x9f0)+dragonemoji+'\x20'+_0x4fea53+_0x425890(0xf36,0x6cc,0x9f6,-0x195)+dragonemoji+'\x20'+_0x4fea53+_0x425890(0x15,0x504,-0x597,-0x1a6)+dragonemoji+'\x20'+_0x4fea53+_0x425890(0x18f6,0x1379,0x10d8,0xae9)+dragonemoji+'\x20'+_0x4fea53+_0x17318e(0x74f,0xbaa,0x5f2,0x4c4)+dragonemoji+'\x20'+_0x4fea53+_0x425890(0xc69,0x13a1,0x17f2,0xc1f)+dragonemoji+'\x20'+_0x4fea53+_0x17318e(0xebf,0x131f,0x1503,0x177f)+dragonemoji+'\x20'+_0x4fea53+'stubble\x0a┃╠'+dragonemoji+'\x20'+_0x4fea53+_0x425890(0x24e,0x3b8,0x882,0x2e8)+dragonemoji+'\x20'+_0x4fea53+'horny\x0a┃╠'+dragonemoji+'\x20'+_0x4fea53+_0x17318e(0xfee,0x8fe,0x942,0xe71)+dragonemoji+'\x20'+_0x4fea53+_0x17318e(0xcc4,0x9a0,0x13e3,0x1406)+dragonemoji+'\x20'+_0x4fea53+('tictactoe\x0a'+'┃╠')+dragonemoji+'\x20'+_0x4fea53+_0x425890(0x9f2,0x10a8,0x12b9,0x17e5)+dragonemoji+'\x20'+_0x4fea53+(_0x17318e(0x13ce,0x1c73,0x125c,0x15ab)+_0x17318e(0x1015,0x11b1,0x13d2,0x1472))+dragonemoji+'\x20'+_0x4fea53+(_0x425890(0x1506,0xd9b,0xedf,0x957)+']\x0a┃╠')+dragonemoji+'\x20'+_0x4fea53+('suitpvp\x20[t'+_0x425890(-0x45d,0x4e7,-0x5b6,-0x29)+'═════════☬'+_0x17318e(0x12a9,0x5da,0x805,0xda7))+_0x2cbadb+'\x20❮━😎','footer':_0x3797bd['user'][_0x17318e(0x1470,0x1907,0x14bd,0x109f)],'buttons':_0x4cb7b7,'headerType':0x4};_0x3797bd[_0x425890(0xded,0x41f,0xb79,0x425)+'e'](_0x17aa6d[_0x425890(0x141b,0xcc7,0xc83,0x759)],_0x62e524,{'quoted':_0x17aa6d});}break;case _0x295ea5[_0x425890(0x7bd,0x81c,0x792,0xd57)]:{if(_0x425890(0xb2a,0x50c,-0x19,0xa97)===_0x295ea5[_0x17318e(0x1263,0x16d2,0xd0d,0x1103)])_0x59ce02(_0x17318e(0x98a,0x365,0x316,0xbb6)+_0x17318e(0xb9f,0xd19,0x287,0x67b)+_0x425890(0xb53,0x12b9,0x121e,0x95b)+_0x17318e(0xb30,0xab2,0x11bf,0xf20));else{const _0x3885e9={};_0x3885e9[_0x17318e(0x17e3,0x197f,0x160f,0x12bd)+'t']='⫷\x20ALL\x20MENU'+'\x20⫸';const _0x5a975f={};_0x5a975f['buttonId']=_0x4fea53+'allmenu',_0x5a975f[_0x425890(0x896,0x10fb,0x1222,0x1222)]=_0x3885e9,_0x5a975f[_0x425890(0x1e45,0x141b,0x1351,0x10f2)]=0x1;const _0xd6e319={};_0xd6e319[_0x425890(0x127a,0x10a0,0x136c,0x1153)+'t']=_0x17318e(0x15a1,0x1e95,0x1b88,0x145c);const _0x2bb467={};_0x2bb467[_0x425890(0x579,0xf77,0x88d,0x1576)]=_0x4fea53+'alive',_0x2bb467['buttonText']=_0xd6e319,_0x2bb467[_0x17318e(0x2058,0x1e26,0x116b,0x1638)]=0x1;const _0x4b0b78={};_0x4b0b78[_0x425890(0xf42,0x10a0,0x626,0xc48)+'t']=_0x295ea5[_0x425890(0x68d,0x384,0xaa4,0x866)];const _0x1292a1={};_0x1292a1['buttonId']=_0x4fea53+_0x425890(0x1ca4,0x1534,0x198e,0xf98),_0x1292a1[_0x17318e(0x1b0a,0x1864,0x1362,0x1318)]=_0x4b0b78,_0x1292a1['type']=0x1;let _0x2c286b=[_0x5a975f,_0x2bb467,_0x1292a1],_0x3f08bd={'image':{'url':_0x295ea5[_0x425890(0x939,0x4e3,-0x51e,0x65e)](_0x58a5bf,_0x295ea5[_0x425890(0x4be,0x92c,0xcc3,0xa84)])},'caption':_0x425890(0x7b4,0x618,-0x21e,-0x65)+botname+(_0x425890(0x1f,0x19b,-0x1ca,0x97b)+'═══💠\x20OWNER'+'\x20💠══╗\x09\x20\x20\x20\x0a'+_0x17318e(-0xa,0xb6b,0xaac,0x624))+dragonemoji+'\x20'+_0x4fea53+(_0x425890(0x1904,0x1116,0x1161,0x81a)+_0x425890(-0x2f3,0x5c8,0x7e3,0x277)+_0x425890(0xaab,0x7f6,0x4b3,0x135))+dragonemoji+'\x20'+_0x4fea53+(_0x425890(0x1900,0x1570,0x1421,0x1fd9)+'┃╠')+dragonemoji+'\x20'+_0x4fea53+(_0x425890(0x77,0x6b1,-0x1d5,0x996)+_0x425890(0x16e,0x9f2,0x32b,0xcbc)+'╠')+dragonemoji+'\x20'+_0x4fea53+(_0x17318e(0x206c,0x10f7,0x1bfd,0x1634)+_0x17318e(0xce6,0xdb2,0xd7e,0xc63))+dragonemoji+'\x20'+_0x4fea53+(_0x425890(0x13a,0x990,0x105d,0x103e)+_0x425890(0x590,0x432,0x6f1,-0x228))+dragonemoji+'\x20'+_0x4fea53+(_0x17318e(0x4fb,-0x562,0xa45,0x38c)+_0x17318e(0x10b3,0x445,-0x2e7,0x64f))+dragonemoji+'\x20'+_0x4fea53+(_0x17318e(-0x168,0x653,0xc52,0x7ba)+_0x17318e(0x709,0x58,0x11fb,0x9b4))+dragonemoji+'\x20'+_0x4fea53+(_0x425890(0x13c6,0xf55,0x1607,0x8cd)+_0x425890(0xcbf,0x14c2,0x1aea,0x1464))+dragonemoji+'\x20'+_0x4fea53+(_0x17318e(-0x28b,0x17f,0x97f,0x56f)+_0x425890(0x13d7,0x1287,0xe6e,0x1a7f))+dragonemoji+'\x20'+_0x4fea53+(_0x17318e(0xc45,0xc4e,0x10dc,0x12c8)+'y/tag]\x0a┃╠')+dragonemoji+'\x20'+_0x4fea53+(_0x425890(0x30a,0xd2a,0xe60,0x476)+_0x425890(0xc35,0x432,0x6e9,0xb8e))+dragonemoji+'\x20'+_0x4fea53+(_0x17318e(0x1cff,0xbb2,0x110e,0x143f)+'xt]\x0a┃╠')+dragonemoji+'\x20'+_0x4fea53+('antilink\x20['+_0x425890(-0x424,0x57d,-0x391,0xfdd))+dragonemoji+'\x20'+_0x4fea53+(_0x425890(0x579,0xafa,0x4b6,0xdc7)+_0x17318e(0x14d2,0xa5b,0xcfe,0x1283))+dragonemoji+'\x20'+_0x4fea53+(_0x17318e(0x1aaf,0x11a0,0x1454,0x1170)+_0x17318e(0x1614,0x1455,0x12f4,0xc6b)+'┃╠')+dragonemoji+'\x20'+_0x4fea53+(_0x425890(-0x1,0x5e7,0x614,0xa83)+_0x425890(0x1557,0xe15,0xb8a,0x129f)+'╠')+dragonemoji+'\x20'+_0x4fea53+_0x17318e(0x84,0x741,0x641,0x572)+dragonemoji+'\x20'+_0x4fea53+_0x425890(0xcbf,0x5f8,-0x248,0xb3e)+dragonemoji+'\x20'+_0x4fea53+_0x425890(-0x1cc,0x7f9,0xa,0xb01)+dragonemoji+'\x20'+_0x4fea53+(_0x425890(0xfda,0x11f7,0x1a8e,0xb18)+'┃╠')+dragonemoji+'\x20'+_0x4fea53+_0x425890(0xfc1,0x1515,0xb42,0xd96)+dragonemoji+'\x20'+_0x4fea53+(_0x17318e(0x857,0x870,0xe07,0x123b)+_0x425890(-0x447,0x1ef,0xc40,0x29)+_0x17318e(0xcef,0x1e5c,0x158e,0x157c)+_0x17318e(0xc3a,0x16f4,0x1b81,0x15cc))+_0x2cbadb+_0x17318e(0xf5f,0xcf5,0x2ea,0x5a0),'footer':_0x3797bd[_0x17318e(0x1c65,0x15d6,0x15d6,0x12db)][_0x425890(0x1489,0xe82,0xb62,0x14cf)],'buttons':_0x2c286b,'headerType':0x4};_0x3797bd['sendMessag'+'e'](_0x17aa6d[_0x425890(0x1365,0xcc7,0xe88,0x103a)],_0x3f08bd,{'quoted':_0x17aa6d});}}break;case _0x17318e(0x150c,0x13ca,0x1801,0x1099)+'nu':{const _0xe6923c={};_0xe6923c['displayTex'+'t']=_0x295ea5[_0x425890(0x1c1,0x68c,0x309,0xd2e)];const _0x62048f={};_0x62048f['buttonId']=_0x4fea53+'allmenu',_0x62048f['buttonText']=_0xe6923c,_0x62048f[_0x425890(0x1aed,0x141b,0x1b18,0x1204)]=0x1;const _0x21e292={};_0x21e292[_0x17318e(0x100f,0x1b1c,0x1bdd,0x12bd)+'t']=_0x17318e(0x1a70,0x119d,0x1569,0x145c);const _0x4a72eb={};_0x4a72eb['buttonId']=_0x4fea53+_0x425890(0x8cc,0xa49,0x111d,0x9d4),_0x4a72eb['buttonText']=_0x21e292,_0x4a72eb[_0x425890(0xb46,0x141b,0x178b,0xbfe)]=0x1;const _0x305037={};_0x305037[_0x425890(0x1a98,0x10a0,0x1096,0xa07)+'t']=_0x295ea5[_0x425890(-0x6ab,0x384,0xafa,0x6d4)];const _0xc9cc26={};_0xc9cc26['buttonId']=_0x4fea53+_0x17318e(0x163f,0x1a91,0x1377,0x1751),_0xc9cc26[_0x425890(0x1465,0x10fb,0x148b,0x1414)]=_0x305037,_0xc9cc26['type']=0x1;let _0x497cdf=[_0x62048f,_0x4a72eb,_0xc9cc26];const _0x19d364={};_0x19d364[_0x425890(0x1011,0x5f3,0xdcb,-0x3a2)]=_0x58a5bf+(_0x425890(0x116d,0x14f4,0xf28,0x1bba)+_0x17318e(0x5c3,-0x77,0xc3a,0x33a));const _0x359059={};_0x359059[_0x17318e(-0x2f4,0xd17,0x823,0x59e)]=_0x19d364,_0x359059[_0x425890(-0x11,0x30a,0xd5e,0xaee)]=_0x17318e(0x860,0x6d6,0x11ce,0x835)+botname+(_0x425890(0x31,0x19b,0x182,-0x3b6)+'═══💠\x20DOWNL'+_0x425890(0xd91,0xb66,0xbf3,0x7e7)+_0x17318e(0x1a85,0x17eb,0x1449,0x1292)+_0x17318e(0xe8d,0x1efe,0x1810,0x14a4))+dragonemoji+'\x20'+_0x4fea53+('ytmp3\x20[url'+_0x425890(0xea1,0xb20,0x1287,0xcda)+'┃╠')+dragonemoji+'\x20'+_0x4fea53+('ytmp4\x20[url'+_0x17318e(0x90b,0x2ba,0x850,0xd3d)+'┃╠')+dragonemoji+'\x20'+_0x4fea53+(_0x17318e(0xebb,0x12e2,0x116d,0xc02)+_0x425890(0x29b,0x9b0,0x1195,0x1221)+'╠')+dragonemoji+'\x20'+_0x4fea53+('getvideo\x20['+_0x17318e(0x15e7,0x15c7,0x97b,0xbcd)+'╠')+dragonemoji+'\x20'+_0x4fea53+('umma\x20[quer'+_0x17318e(0xfe8,0x13b9,0x18bc,0x11e1))+dragonemoji+'\x20'+_0x4fea53+(_0x425890(0xb04,0x899,0x6a9,-0x7a)+_0x425890(0x115a,0xfc4,0x8ae,0xbc6))+dragonemoji+'\x20'+_0x4fea53+(_0x17318e(0xdc8,0x763,0xb27,0x111c)+'\x20[url]\x0a┃╚═'+_0x425890(0x1498,0x135f,0xdf5,0x1648)+_0x17318e(0x13e2,0x14de,0xf1e,0x15cc))+_0x2cbadb+_0x17318e(-0xf8,0x815,0xad7,0x5a0),_0x359059[_0x17318e(0x34,0x2d9,0x833,0x597)]=_0x3797bd[_0x17318e(0x16d3,0xbf3,0x1453,0x12db)][_0x425890(0x1126,0xe82,0x66d,0x116b)],_0x359059[_0x17318e(0x1794,0xe3f,0xcb5,0x117e)]=_0x497cdf,_0x359059[_0x17318e(0xbd0,0x1980,0x9f0,0x120c)]=0x4;let _0x209e9b=_0x359059;_0x3797bd[_0x425890(0xc6a,0x41f,0x92b,0x844)+'e'](_0x17aa6d[_0x425890(0xb84,0xcc7,0x1065,0x77d)],_0x209e9b,{'quoted':_0x17aa6d});}break;case _0x295ea5[_0x425890(0x655,0xd9d,0xfd9,0xe05)]:{const _0x2e3a22={};_0x2e3a22[_0x17318e(0xdf6,0x12f0,0x8fa,0x12bd)+'t']=_0x295ea5['vMhbF'];const _0x12f7ed={};_0x12f7ed['buttonId']=_0x4fea53+'allmenu',_0x12f7ed[_0x425890(0xa29,0x10fb,0xb0f,0xce6)]=_0x2e3a22,_0x12f7ed[_0x17318e(0xd57,0x19ea,0x1e8b,0x1638)]=0x1;const _0x49db2c={};_0x49db2c['displayTex'+'t']=_0x17318e(0xce6,0x1c9f,0xb13,0x145c);const _0x6624f6={};_0x6624f6[_0x17318e(0xcda,0x707,0x121a,0x1194)]=_0x4fea53+_0x17318e(0xcc4,0x1318,0x12f4,0xc66),_0x6624f6[_0x17318e(0x9f9,0x19d6,0x12df,0x1318)]=_0x49db2c,_0x6624f6[_0x425890(0xae6,0x141b,0x1bc3,0x1b45)]=0x1;const _0x3593be={};_0x3593be[_0x17318e(0x1bb3,0x110e,0x19fd,0x12bd)+'t']=_0x295ea5[_0x17318e(-0x1c7,0x24f,0x513,0x5a1)];const _0x446a0b={};_0x446a0b[_0x425890(0x898,0xf77,0xb90,0x154c)]=_0x4fea53+'donate',_0x446a0b[_0x425890(0xb6e,0x10fb,0x1705,0x1408)]=_0x3593be,_0x446a0b[_0x17318e(0x1c47,0x2020,0x196e,0x1638)]=0x1;let _0x329e3b=[_0x12f7ed,_0x6624f6,_0x446a0b];const _0x5ce1ce={};_0x5ce1ce[_0x425890(0x734,0x5f3,0xba3,0x3ba)]=_0x58a5bf+_0x295ea5[_0x425890(0x1703,0x1109,0xb6f,0x7a7)];const _0x333623={};_0x333623['image']=_0x5ce1ce,_0x333623['caption']=_0x425890(0xe81,0x618,0x186,0xfa9)+botname+(_0x17318e(0x507,0xb74,0xa32,0x3b8)+_0x425890(0x121e,0x13b2,0x13ef,0x179d)+_0x425890(0xe33,0xdc1,0xc7f,0xd9c)+_0x425890(0xd47,0xa52,0xdfd,0x11bf)+'╠')+dragonemoji+'\x20'+_0x4fea53+(_0x17318e(0xbd4,0x1368,0xf30,0xb82)+_0x17318e(0xd29,0x1707,0x1b34,0x11e1))+dragonemoji+'\x20'+_0x4fea53+(_0x425890(0xa9a,0x1e6,0x4a0,0x4b5)+_0x425890(0xc96,0xfc4,0x14cd,0x9d2))+dragonemoji+'\x20'+_0x4fea53+(_0x17318e(0x198d,0x2027,0xcb1,0x1718)+']\x0a┃╠')+dragonemoji+'\x20'+_0x4fea53+(_0x17318e(0x1356,0x1dd9,0x126e,0x15d7)+_0x17318e(0x155e,0x146e,0x109a,0xf83))+dragonemoji+'\x20'+_0x4fea53+(_0x425890(0x3e5,0xaae,0x14a1,0x211)+_0x17318e(0xcd1,0x153c,0x724,0xf83))+dragonemoji+'\x20'+_0x4fea53+(_0x17318e(0xf2e,0x1812,0x1e0d,0x14e1)+_0x425890(0xeee,0x6d2,-0xf8,0x9e8))+dragonemoji+'\x20'+_0x4fea53+(_0x425890(0xb29,0x9bc,0xf6b,0x10f0)+_0x425890(0xa5b,0x6d2,0x113d,0xaf0))+dragonemoji+'\x20'+_0x4fea53+('wikimedia\x20'+_0x17318e(0xe81,0x1262,0x933,0x8ef))+dragonemoji+'\x20'+_0x4fea53+(_0x17318e(0x1c2,0x47b,0x120a,0x7f8)+_0x17318e(-0x1a4,0x1158,0x5c5,0x7f5))+dragonemoji+'\x20'+_0x4fea53+('ringtone\x20['+_0x425890(0xe1b,0x5d8,0x326,0xb76))+dragonemoji+'\x20'+_0x4fea53+(_0x425890(0x4bc,0xc95,0x1068,0x438)+'uery]\x0a┃╚══'+_0x17318e(0xe9b,0x171e,0xec8,0x157c)+_0x425890(0x9e1,0xd90,0x100f,0x61e))+_0x2cbadb+'\x20❮━😎',_0x333623[_0x425890(0x511,0x37a,0x6d0,-0x26b)]=_0x3797bd[_0x17318e(0x1a05,0x1a45,0x9d3,0x12db)][_0x425890(0x3ed,0xe82,0x14bf,0x156a)],_0x333623[_0x425890(0xc0a,0xf61,0x1757,0xd68)]=_0x329e3b,_0x333623['headerType']=0x4;let _0x7a11bd=_0x333623;_0x3797bd[_0x425890(-0x20f,0x41f,-0x47b,0x377)+'e'](_0x17aa6d[_0x425890(0x1050,0xcc7,0x1018,0x15da)],_0x7a11bd,{'quoted':_0x17aa6d});}break;case _0x17318e(0xb98,0xcb2,0x74c,0xc1d):{const _0x51276e={};_0x51276e[_0x425890(0x11f0,0x10a0,0xa91,0x93f)+'t']=_0x295ea5['vMhbF'];const _0x12f136={};_0x12f136[_0x425890(0x9a0,0xf77,0x19d8,0xc9a)]=_0x4fea53+_0x425890(0x803,0x2ff,-0x2d1,-0x266),_0x12f136[_0x17318e(0x1584,0x107e,0xfc8,0x1318)]=_0x51276e,_0x12f136[_0x425890(0x1a06,0x141b,0x1bf0,0x1840)]=0x1;const _0x33c1fb={};_0x33c1fb[_0x17318e(0xca5,0x981,0x167c,0x12bd)+'t']=_0x295ea5[_0x17318e(0x7b2,0xee0,0xfac,0xeee)];const _0xfa6856={};_0xfa6856['buttonId']=_0x4fea53+_0x425890(0x14cf,0xa49,-0x2c,0x17b),_0xfa6856[_0x17318e(0xdfc,0x94d,0x1bc1,0x1318)]=_0x33c1fb,_0xfa6856[_0x17318e(0x142f,0x119c,0x1e1c,0x1638)]=0x1;const _0x39b398={};_0x39b398[_0x17318e(0x919,0x1b36,0x15af,0x12bd)+'t']=_0x425890(-0x2f9,0x610,0xbd2,-0x244);const _0x1e2908={};_0x1e2908[_0x425890(0x6ce,0xf77,0x131c,0x1247)]=_0x4fea53+'donate',_0x1e2908[_0x425890(0x865,0x10fb,0x9e0,0x102c)]=_0x39b398,_0x1e2908[_0x425890(0xc97,0x141b,0x1817,0x16be)]=0x1;let _0x44b4ba=[_0x12f136,_0xfa6856,_0x1e2908];const _0x3cf917={};_0x3cf917[_0x17318e(0x4a9,0xc72,0xef3,0x810)]=_0x58a5bf+_0x295ea5[_0x17318e(0x1151,0x51f,0x9ec,0xcb0)];const _0x188601={};_0x188601[_0x17318e(0xe9f,0xd3,0x22a,0x59e)]=_0x3cf917,_0x188601['caption']=_0x425890(0xb3,0x618,0xcee,0x7d9)+botname+(_0x425890(-0x3e6,0x19b,-0x77b,0x721)+_0x425890(0x1083,0x147a,0x1898,0x11ee)+_0x425890(0x8bf,0x120b,0xdf3,0x1522)+_0x425890(0x853,0xa52,0xc55,0x116a)+'╠')+dragonemoji+'\x20'+_0x4fea53+_0x425890(0x605,0x739,0x3df,0x109)+dragonemoji+'\x20'+_0x4fea53+('animequote'+_0x17318e(0x985,-0x2ec,0xde4,0x3b5))+dragonemoji+'\x20'+_0x4fea53+(_0x425890(0xab,0x36d,-0x565,0x70e)+'╚═════════'+_0x17318e(0x6d5,0xd82,0x1662,0xc76)+'\x20')+_0x2cbadb+_0x425890(-0x2a7,0x383,0xca1,0x5c),_0x188601[_0x17318e(0xea8,-0x118,0xbe2,0x597)]=_0x3797bd[_0x425890(0x7ff,0x10be,0x1164,0x1b22)][_0x425890(0xc16,0xe82,0x4ab,0x9b3)],_0x188601[_0x17318e(0xa95,0x1b50,0x129b,0x117e)]=_0x44b4ba,_0x188601[_0x425890(0x6d8,0xfef,0x1a20,0x822)]=0x4;let _0x306120=_0x188601;_0x3797bd['sendMessag'+'e'](_0x17aa6d[_0x17318e(0x1878,0x9e7,0x5d3,0xee4)],_0x306120,{'quoted':_0x17aa6d});}break;case _0x425890(0x995,0x1063,0xdb3,0x7ea)+_0x425890(-0x56d,0x38d,0x45e,0xab3):{const _0x35fa04={};_0x35fa04['displayTex'+'t']=_0x425890(0x30c,0x340,0xacf,0x3eb)+'\x20⫸';const _0x22d53c={};_0x22d53c['buttonId']=_0x4fea53+_0x425890(0x37,0x2ff,0x1fe,-0x1a0),_0x22d53c[_0x425890(0x69d,0x10fb,0x16d8,0x17b1)]=_0x35fa04,_0x22d53c['type']=0x1;const _0x4390d7={};_0x4390d7[_0x17318e(0x18c0,0x1d4e,0x1c7e,0x12bd)+'t']=_0x295ea5['spClB'];const _0x5e7fd8={};_0x5e7fd8[_0x17318e(0x11c6,0xd06,0x182d,0x1194)]=_0x4fea53+_0x425890(0x6eb,0xa49,0x1ec,0xfc),_0x5e7fd8[_0x425890(0x1b4b,0x10fb,0xbca,0x1068)]=_0x4390d7,_0x5e7fd8[_0x17318e(0x12dc,0x1377,0xc05,0x1638)]=0x1;const _0x102ab8={};_0x102ab8[_0x425890(0x1ad7,0x10a0,0x118e,0x1ab0)+'t']=_0x295ea5['hfIkN'];const _0x170e2e={};_0x170e2e[_0x17318e(0x1a3d,0x16df,0x1914,0x1194)]=_0x4fea53+_0x425890(0xcda,0x1534,0x1aa8,0x121a),_0x170e2e['buttonText']=_0x102ab8,_0x170e2e[_0x425890(0x1a24,0x141b,0xf2d,0xf08)]=0x1;let _0x69872f=[_0x22d53c,_0x5e7fd8,_0x170e2e];const _0x5dc24a={};_0x5dc24a[_0x17318e(0x4b4,0xa9,0x437,0x810)]=_0x58a5bf+_0x295ea5['PchPB'];const _0x234d99={};_0x234d99[_0x17318e(0x6c4,-0x23c,0xde5,0x59e)]=_0x5dc24a,_0x234d99[_0x425890(0xd8a,0x30a,-0x32a,0x31c)]=_0x425890(0x1075,0x618,0xd3a,0x10a9)+botname+(_0x425890(0x363,0x19b,0xe2,-0x797)+_0x17318e(0xa1e,0xb10,0x12e4,0x88a)+'\x20💠══╗\x0a┃║\x09\x20'+_0x425890(0x6fc,0x5d1,0x4ae,0xf80))+dragonemoji+'\x20'+_0x4fea53+_0x425890(0x16a0,0x13b6,0xdb0,0x1c32)+dragonemoji+'\x20'+_0x4fea53+'bully\x0a┃╠'+dragonemoji+'\x20'+_0x4fea53+_0x17318e(0x1200,0x10ea,0x16f4,0x17fe)+dragonemoji+'\x20'+_0x4fea53+_0x425890(0x617,0x660,0xb5a,0x2d1)+dragonemoji+'\x20'+_0x4fea53+_0x17318e(0x8dc,0x14f9,0x10b1,0xb98)+dragonemoji+'\x20'+_0x4fea53+_0x425890(0x1273,0x15fc,0xed3,0x131d)+dragonemoji+'\x20'+_0x4fea53+_0x425890(0x2f3,0x3f4,0x2b2,0x1d2)+dragonemoji+'\x20'+_0x4fea53+_0x17318e(-0x392,-0x324,0x728,0x4b6)+dragonemoji+'\x20'+_0x4fea53+_0x17318e(0xc88,0x843,0x1918,0x1020)+dragonemoji+'\x20'+_0x4fea53+'smug\x0a┃╠'+dragonemoji+'\x20'+_0x4fea53+'bonk\x0a┃╠'+dragonemoji+'\x20'+_0x4fea53+_0x17318e(0xfb5,-0x85,0x1287,0x861)+dragonemoji+'\x20'+_0x4fea53+_0x425890(0xd1f,0x15b3,0x151b,0x199c)+dragonemoji+'\x20'+_0x4fea53+_0x17318e(0x1b1f,0xc4f,0x1ce5,0x16c9)+dragonemoji+'\x20'+_0x4fea53+_0x17318e(0x768,0x7df,0xa,0x843)+dragonemoji+'\x20'+_0x4fea53+(_0x425890(-0x3a6,0x6eb,0x78d,0x30f)+'╠')+dragonemoji+'\x20'+_0x4fea53+('handhold\x0a┃'+'╠')+dragonemoji+'\x20'+_0x4fea53+_0x17318e(0xc98,0x453,0xea3,0xdb6)+dragonemoji+'\x20'+_0x4fea53+_0x425890(-0x1f5,0x87f,0x4e8,0x97b)+dragonemoji+'\x20'+_0x4fea53+_0x425890(0x8fc,0xb22,0x9cd,0x13a6)+dragonemoji+'\x20'+_0x4fea53+_0x425890(0xfb9,0x106e,0x1665,0x1543)+dragonemoji+'\x20'+_0x4fea53+_0x425890(0x33d,0xd15,0xf4c,0x17b2)+dragonemoji+'\x20'+_0x4fea53+'happy\x0a┃╠'+dragonemoji+'\x20'+_0x4fea53+'wink\x0a┃╠'+dragonemoji+'\x20'+_0x4fea53+_0x17318e(0xbb3,0x294,0xeeb,0x7b6)+dragonemoji+'\x20'+_0x4fea53+_0x425890(0x192a,0x128f,0xff8,0x12c2)+dragonemoji+'\x20'+_0x4fea53+('cringe\x0a┃╚═'+_0x425890(0xef0,0x135f,0x91b,0x1755)+_0x425890(0x101a,0x13af,0x126d,0x1a71))+_0x2cbadb+_0x17318e(0xef9,0xc13,-0x39f,0x5a0),_0x234d99[_0x425890(0x0,0x37a,0x6f7,0xb26)]=_0x3797bd[_0x17318e(0x1ce9,0x13b1,0x98e,0x12db)]['name'],_0x234d99[_0x17318e(0x108d,0x823,0xd9c,0x117e)]=_0x69872f,_0x234d99['headerType']=0x4;let _0x217845=_0x234d99;_0x3797bd[_0x17318e(0x176,-0x8,0xb46,0x63c)+'e'](_0x17aa6d[_0x425890(0xce4,0xcc7,0xbef,0x973)],_0x217845,{'quoted':_0x17aa6d});}break;case _0x295ea5['IxasU']:{if(_0x295ea5[_0x17318e(0x165c,0x19a0,0x1a6f,0x1303)](_0x295ea5['yzaYd'],_0x295ea5[_0x425890(0x10bc,0xa19,0xe17,0x8c8)])){const _0x5e2ea5={};_0x5e2ea5['displayTex'+'t']=_0x295ea5['vMhbF'];const _0x1bc710={};_0x1bc710[_0x17318e(0xf90,0xa60,0x1138,0x1194)]=_0x4fea53+_0x17318e(0xeb9,0xbd0,0x7e5,0x51c),_0x1bc710[_0x17318e(0x1c93,0xbf1,0xafc,0x1318)]=_0x5e2ea5,_0x1bc710[_0x425890(0xb00,0x141b,0x178e,0xe6d)]=0x1;const _0x14c11b={};_0x14c11b[_0x17318e(0x12b1,0x1d59,0xab2,0x12bd)+'t']=_0x295ea5['spClB'];const _0x4f8dda={};_0x4f8dda[_0x425890(0x1034,0xf77,0x1145,0x1608)]=_0x4fea53+_0x425890(0x7d4,0xa49,0xf8e,0x391),_0x4f8dda[_0x425890(0x9cf,0x10fb,0x1181,0xb1f)]=_0x14c11b,_0x4f8dda[_0x425890(0xf7a,0x141b,0x1346,0x128b)]=0x1;const _0x7b14cf={};_0x7b14cf[_0x425890(0xcb5,0x10a0,0xddc,0x1869)+'t']=_0x17318e(0xbec,0xf46,0x73e,0x82d);const _0x222edb={};_0x222edb[_0x425890(0x1090,0xf77,0x1837,0xd92)]=_0x4fea53+_0x17318e(0x1abe,0x1903,0x1345,0x1751),_0x222edb[_0x17318e(0x196e,0x16ed,0x1070,0x1318)]=_0x7b14cf,_0x222edb[_0x17318e(0x1daf,0xef2,0x1f68,0x1638)]=0x1;let _0x4ac954=[_0x1bc710,_0x4f8dda,_0x222edb],_0xfb66d9={'image':{'url':_0x295ea5[_0x17318e(0x310,0x6cd,0x829,0x34e)](_0x58a5bf,_0x295ea5[_0x425890(-0x70,0x943,0x7c6,0xf37)])},'caption':_0x17318e(0x1136,0x8dd,0xdaa,0x835)+botname+(_0x17318e(0x5ae,-0x29f,0x776,0x3b8)+_0x17318e(0xaf8,0x3a1,0xb04,0x805)+_0x17318e(0x1055,0xb5a,0x364,0xa01)+_0x17318e(0x9c9,0xdce,0x10c8,0x1292)+_0x425890(0x1c95,0x1287,0x13f4,0x8ea))+dragonemoji+'\x20'+_0x4fea53+(_0x17318e(0x19e8,0xc4b,0x85a,0x1178)+_0x17318e(0x18a8,0xb86,0x1799,0x100a))+dragonemoji+'\x20'+_0x4fea53+(_0x425890(0xfa9,0x1047,0x8c5,0x146e)+_0x425890(0x48e,0x927,0x66c,-0x145))+dragonemoji+'\x20'+_0x4fea53+(_0x425890(0xf7e,0x1234,0x1342,0x1138)+'[txt]\x0a┃╠')+dragonemoji+'\x20'+_0x4fea53+(_0x425890(0x1355,0xd13,0x15cb,0xc95)+_0x425890(0xf12,0x14a6,0x1be3,0xcf3)+_0x425890(-0xeb,0x797,0x1011,0x564))+dragonemoji+'\x20'+_0x4fea53+(_0x425890(0x12da,0xd00,0xa2d,0xdc0)+'xt]\x0a┃╠')+dragonemoji+'\x20'+_0x4fea53+(_0x425890(-0x37,0x206,0x84c,0xfb)+']\x0a┃╠')+dragonemoji+'\x20'+_0x4fea53+(_0x425890(0x153f,0xf49,0x18c3,0x95b)+'xt]\x0a┃╠')+dragonemoji+'\x20'+_0x4fea53+(_0x425890(0x92d,0x547,0xd75,-0x424)+_0x17318e(0x1185,0x1b75,0x1f26,0x16f2))+dragonemoji+'\x20'+_0x4fea53+(_0x425890(0x16d8,0xe32,0xcf9,0xe67)+_0x425890(0xdc8,0x797,-0x1c0,-0x2f))+dragonemoji+'\x20'+_0x4fea53+(_0x17318e(0xbff,0xb26,0xa0e,0x103f)+'t]\x0a┃╠')+dragonemoji+'\x20'+_0x4fea53+(_0x425890(0x150d,0x130f,0xe7f,0xfdf)+_0x425890(0x6c1,0xceb,0x8c9,0x7af))+dragonemoji+'\x20'+_0x4fea53+(_0x425890(0x903,0xca0,0xf05,0x839)+'[txt]\x0a┃╠')+dragonemoji+'\x20'+_0x4fea53+(_0x17318e(0x1528,0x755,0x15c9,0xbaf)+_0x17318e(0x840,0x18b3,0x18d9,0xf08))+dragonemoji+'\x20'+_0x4fea53+(_0x425890(0x681,0x1b6,0xb7a,-0x387)+_0x425890(0xe60,0xceb,0x49d,0x10cf))+dragonemoji+'\x20'+_0x4fea53+(_0x17318e(0x8fa,0x1590,0x1617,0xee0)+_0x17318e(0x1272,0x85e,0x13fb,0x100a))+dragonemoji+'\x20'+_0x4fea53+(_0x425890(0x2c4,0x87c,0xda1,0x1c1)+'r\x20[txt]\x0a┃╠')+dragonemoji+'\x20'+_0x4fea53+('berry\x20[txt'+_0x425890(0x13f1,0xded,0x1248,0xaf8))+dragonemoji+'\x20'+_0x4fea53+(_0x425890(0x96f,0xc47,0x375,0x68d)+_0x425890(0xee4,0xceb,0xf9b,0x1666))+dragonemoji+'\x20'+_0x4fea53+(_0x425890(0x13ef,0xed6,0xef8,0x196d)+_0x425890(0x123b,0xded,0x6f8,0x154c))+dragonemoji+'\x20'+_0x4fea53+(_0x17318e(0x966,0x389,0x148e,0xb2b)+_0x425890(0x38c,0xceb,0xc1c,0x530))+dragonemoji+'\x20'+_0x4fea53+(_0x425890(0xa89,0x873,-0x212,0x37d)+_0x425890(0xdfa,0x14d5,0x1b15,0x15e1))+dragonemoji+'\x20'+_0x4fea53+(_0x17318e(0x1fb6,0x2059,0x140b,0x161d)+'t]\x0a┃╠')+dragonemoji+'\x20'+_0x4fea53+('harrypotte'+_0x425890(0x98a,0x99c,0x84c,0x513))+dragonemoji+'\x20'+_0x4fea53+(_0x425890(0x15d3,0x11bc,0x1a21,0x118d)+_0x425890(0xe21,0x927,0xc67,0x2e2))+dragonemoji+'\x20'+_0x4fea53+('papercut\x20['+'txt]\x0a┃╠')+dragonemoji+'\x20'+_0x4fea53+('watercolor'+_0x17318e(0x1918,0x1dec,0x142b,0x13b0))+dragonemoji+'\x20'+_0x4fea53+(_0x425890(0x5fa,0x1ab,0xa4e,-0x5f9)+_0x17318e(0x1dce,0x1502,0x15d7,0x13b0))+dragonemoji+'\x20'+_0x4fea53+(_0x425890(0xd52,0xe4e,0xd8e,0x15d9)+_0x17318e(0x1753,0xe2f,0xe8f,0x16f2))+dragonemoji+'\x20'+_0x4fea53+(_0x425890(-0x76f,0x242,0x159,-0x1b4)+_0x425890(0x16bc,0x1193,0x1476,0x1264))+dragonemoji+'\x20'+_0x4fea53+(_0x17318e(0x6d7,0x1837,0x182a,0x113f)+'ke\x20[txt]\x0a┃'+'╠')+dragonemoji+'\x20'+_0x4fea53+('snow\x20[txt]'+_0x17318e(0x1920,0x14d5,0x1149,0x14a4))+dragonemoji+'\x20'+_0x4fea53+(_0x425890(-0x615,0x2b7,0xcf2,0x4d5)+_0x425890(0xc65,0xded,0xb00,0xf16))+dragonemoji+'\x20'+_0x4fea53+(_0x17318e(0xdb8,0x209,0xb1b,0x407)+_0x425890(0x39e,0xded,0x14f1,0x4fc))+dragonemoji+'\x20'+_0x4fea53+(_0x17318e(0x268,0x5e4,0xe5e,0x973)+'┃╠')+dragonemoji+'\x20'+_0x4fea53+('fruitjuice'+'\x20[txt]\x0a┃╠')+dragonemoji+'\x20'+_0x4fea53+('biscuit\x20[t'+'xt]\x0a┃╠')+dragonemoji+'\x20'+_0x4fea53+('wood\x20[txt]'+_0x425890(0xadf,0x1287,0x141a,0x1602))+dragonemoji+'\x20'+_0x4fea53+(_0x17318e(0xf9f,0x10e1,0x1cf9,0x17a0)+_0x17318e(0x200e,0x11c0,0x19ed,0x16f2))+dragonemoji+'\x20'+_0x4fea53+('strawberry'+_0x425890(0x146d,0x1193,0x143d,0x1950))+dragonemoji+'\x20'+_0x4fea53+(_0x425890(-0x78,0x47a,0x21,-0x3fa)+'t]\x0a┃╠')+dragonemoji+'\x20'+_0x4fea53+('blood\x20[txt'+_0x425890(0xd88,0xded,0x4d4,0x110d))+dragonemoji+'\x20'+_0x4fea53+(_0x425890(0x38,0x36e,0x36d,0x50b)+'[txt]\x0a┃╠')+dragonemoji+'\x20'+_0x4fea53+(_0x425890(0x8c0,0xfa2,0x660,0x702)+_0x17318e(0x1077,0xb35,0xa54,0x100a))+dragonemoji+'\x20'+_0x4fea53+('lava\x20[txt]'+_0x425890(0xe1d,0x1287,0xb0e,0x1458))+dragonemoji+'\x20'+_0x4fea53+('rock\x20[txt]'+_0x17318e(0x1c13,0x1af2,0xeae,0x14a4))+dragonemoji+'\x20'+_0x4fea53+(_0x17318e(0xd97,0x13e4,0x11a0,0xb53)+_0x425890(0x10ca,0x14d5,0x1320,0x1867))+dragonemoji+'\x20'+_0x4fea53+(_0x17318e(0x1c6e,0x1968,0x12b2,0x120f)+_0x425890(0x1963,0x102f,0xc55,0x1308))+dragonemoji+'\x20'+_0x4fea53+(_0x425890(0x819,0x676,-0x404,0x6e)+_0x425890(0x7d4,0x102f,0x1096,0x1a74))+dragonemoji+'\x20'+_0x4fea53+(_0x17318e(0x27c,-0x30c,-0x63,0x663)+_0x425890(0x808,0xded,0x8e0,0x99d))+dragonemoji+'\x20'+_0x4fea53+('wicker\x20[tx'+_0x425890(0xe45,0x797,0x65e,0x7a1))+dragonemoji+'\x20'+_0x4fea53+('firework\x20['+_0x425890(0x1139,0x102f,0x1827,0x63c))+dragonemoji+'\x20'+_0x4fea53+(_0x17318e(0x697,0x204,-0x28f,0x7b1)+'txt]\x0a┃╠')+dragonemoji+'\x20'+_0x4fea53+(_0x425890(0xda8,0x112c,0xf0b,0x1296)+_0x425890(0xe3f,0x14d5,0xc78,0x1cfb))+dragonemoji+'\x20'+_0x4fea53+('sand\x20[txt]'+'\x0a┃╠')+dragonemoji+'\x20'+_0x4fea53+(_0x17318e(0xa01,0x119a,0x1618,0xbf8)+'\x0a┃╠')+dragonemoji+'\x20'+_0x4fea53+(_0x17318e(0xccf,0xb34,0xf2f,0x992)+_0x425890(0xf52,0x1287,0xf58,0x135a))+dragonemoji+'\x20'+_0x4fea53+(_0x425890(0xb2d,0x1d0,-0x78b,-0x127)+_0x425890(0x1d36,0x15f5,0x14da,0x1fee)+_0x425890(0x10ae,0x15a6,0x1f20,0x1019)+'┗━━❯\x20')+_0x2cbadb+_0x17318e(-0x6,-0xa6,0x727,0x5a0),'footer':_0x3797bd['user']['name'],'buttons':_0x4ac954,'headerType':0x4};_0x3797bd[_0x425890(0x2cc,0x41f,-0x23c,-0x582)+'e'](_0x17aa6d['chat'],_0xfb66d9,{'quoted':_0x17aa6d});}else{const _0x5a1f3f={};_0x5a1f3f[_0x17318e(0x1787,0xb55,0xb2a,0x12bd)+'t']=_0x425890(-0x45f,0x340,-0x58e,-0x221)+'\x20⫸';const _0x3bdfc1={};_0x3bdfc1[_0x17318e(0x917,0x1371,0x12e3,0x1194)]=_0x2d64c8+_0x425890(0x7e9,0x2ff,0x564,0x453),_0x3bdfc1[_0x425890(0x886,0x10fb,0xa38,0xa9f)]=_0x5a1f3f,_0x3bdfc1['type']=0x1;const _0x43caeb={};_0x43caeb['displayTex'+'t']=_0x295ea5[_0x425890(0x14da,0xcd1,0x156d,0xd85)];const _0x318435={};_0x318435[_0x425890(0x14a1,0xf77,0x10f8,0x53d)]=_0x2558eb+_0x17318e(0x1129,0xe48,0x1649,0xc66),_0x318435['buttonText']=_0x43caeb,_0x318435[_0x425890(0x1048,0x141b,0x1009,0xa5f)]=0x1;const _0x3a2d1e={};_0x3a2d1e[_0x425890(0xc56,0x10a0,0x612,0xcd4)+'t']=_0x295ea5[_0x17318e(0x195,-0x4a5,0x301,0x5a1)];const _0x2a4656={};_0x2a4656[_0x425890(0x1304,0xf77,0xac8,0xbb8)]=_0x4728a5+'donate',_0x2a4656['buttonText']=_0x3a2d1e,_0x2a4656[_0x17318e(0xbd0,0x1ecf,0x1cb9,0x1638)]=0x1;let _0x4ef580=[_0x3bdfc1,_0x318435,_0x2a4656];const _0x28f9df={};_0x28f9df[_0x425890(-0x38a,0x5f3,0x84,0xba)]=_0x62c575+_0x425890(0x11b6,0xc27,0x600,0xcc8);const _0x1111b5={};_0x1111b5[_0x17318e(-0x26d,0xb45,0x232,0x59e)]=_0x28f9df,_0x1111b5['caption']=_0x17318e(0x36d,0x8b1,0xf1d,0x835)+_0x59944f+(_0x17318e(0x75f,0xb4d,0x67c,0x3b8)+_0x17318e(0x19dd,0xdcd,0x8a7,0x11ab)+_0x425890(0x189a,0x1620,0x12e6,0x1d81)+_0x425890(0x5eb,0x8b1,0xf81,0x976))+_0x5e8624+'\x20'+_0x4b0f85+(_0x425890(0x75d,0x32a,0xcfc,-0x33c)+'┃╠')+_0x68df7d+'\x20'+_0x341100+(_0x17318e(0xf80,0xe32,0xf6b,0x54e)+_0x17318e(0x5c6,0x1000,0x1069,0x100a))+_0x5c3f9f+'\x20'+_0x109ccb+('is\x20[text]\x0a'+'┃╠')+_0x5e5997+'\x20'+_0x4d167a+(_0x425890(0xa49,0x116f,0x9cf,0x11b6)+_0x425890(0x7bb,0xded,0x628,0xd21))+_0x1164c7+'\x20'+_0x3f535c+('can\x20[text]'+_0x17318e(0xff9,0x1a4a,0x1d04,0x14a4))+_0xa53238+'\x20'+_0x4497d7+(_0x17318e(0x681,0x5be,0xd26,0xd1a)+_0x17318e(0x18df,0x18d8,0xf6c,0x100a))+_0x4ad719+'\x20'+_0xb20b88+('wangy\x20[tex'+_0x17318e(0xcdb,0x385,0xcd3,0x9b4))+_0x1fb6ca+'\x20'+_0x14c4a2+(_0x17318e(0x836,0x14d,0xbd5,0x5ac)+_0x425890(0x44c,0x790,0x1103,0x211)+_0x17318e(0xb13,0x1573,0x1754,0x14a4))+_0x648896+'\x20'+_0x4c8976+(_0x425890(0xb94,0x7c5,0x7b2,0x1fd)+'ck\x20[tag]\x0a┃'+'╠')+_0x1c1100+'\x20'+_0x2e613a+('prettychec'+_0x425890(0xe54,0xb58,0x94d,0x588))+_0x275076+'\x20'+_0xb35a96+('lesbianche'+_0x17318e(0x1227,0x18b1,0xd2e,0xfc1)+'╠')+_0x121745+'\x20'+_0x2294cc+('gaycheck\x20['+_0x425890(0x678,0x201,0xbd8,-0x4df))+_0x1ced81+'\x20'+_0x34719b+(_0x17318e(0x16db,0xd39,0x1682,0xf1c)+_0x425890(0x17e1,0x11fd,0x17cb,0x140b))+_0x4ff27b+'\x20'+_0x467b74+('uglycheck\x20'+_0x425890(0x892,0x11fd,0x124b,0x943))+_0x439ad7+'\x20'+_0x2cf489+(_0x17318e(0x325,-0xb4,0x5e2,0x62d)+_0x425890(0xca3,0x1439,0x9fb,0x162a))+_0x416a61+'\x20'+_0x5a5b52+(_0x17318e(-0x298,0xa44,0x744,0x479)+_0x17318e(0x1399,0xb08,0xcae,0x9ad)+_0x425890(0xd94,0x1287,0x1bf2,0x1485))+_0x561ae9+'\x20'+_0x258552+(_0x425890(-0x7ac,0x29d,0x71a,0x9bf)+_0x17318e(0x137d,0x3f3,0xe20,0xd75))+_0xba42da+'\x20'+_0x26be7d+_0x425890(0x8ad,0xa45,0x639,0xccd)+_0x3b177d+'\x20'+_0x2bb48b+(_0x17318e(0x135a,0xa8e,0xff6,0xaef)+_0x425890(0xb5a,0x1287,0x182d,0x1301))+_0x3958ae+'\x20'+_0x4820fe+_0x425890(0x5b8,0x7b1,-0x2c0,0x1060)+_0x1bdf2e+'\x20'+_0x308bdc+_0x17318e(0x11a7,0x954,0x9d1,0xdf3)+_0x54e0b7+'\x20'+_0x5831d1+_0x425890(0x3cf,0x2cf,-0x794,0x4d8)+_0x1361f4+'\x20'+_0x5ba1db+(_0x425890(0xb0b,0xf1f,0xd19,0x1809)+'╠')+_0x40fb38+'\x20'+_0x1b33e0+(_0x17318e(0x11c5,0x1426,0xcc4,0xe1f)+'┃╠')+_0x5bfd33+'\x20'+_0x274cd8+_0x17318e(0x50f,0xc64,0xa70,0x430)+_0x11303b+'\x20'+_0x39b329+'pretty\x0a┃╠'+_0x3888e6+'\x20'+_0x4c5de8+_0x425890(0xb3d,0x1383,0xd31,0x10cb)+_0x376f51+'\x20'+_0x31fda0+_0x425890(0xb38,0x3ca,-0x5cf,-0x2d)+_0x56ba77+'\x20'+_0x4d171f+_0x425890(-0x34d,0x6cc,0x5b5,0xa06)+_0xbceda5+'\x20'+_0x75959a+_0x425890(0xaa9,0x504,0x3,0xddd)+_0x49f41e+'\x20'+_0x433832+_0x17318e(0xe24,0x1c25,0x1324,0x1596)+_0x1b5433+'\x20'+_0x1bfa1d+_0x17318e(0xebc,-0x4f9,-0x566,0x4c4)+_0xacc07a+'\x20'+_0x4505ec+'gay\x0a┃╠'+_0x204cb2+'\x20'+_0x5bc5ec+_0x425890(0x1a4f,0x1562,0x1b62,0x13c5)+_0x2c67f8+'\x20'+_0x302cb3+_0x17318e(0x1534,0x6a8,0x13af,0x1132)+_0xa5ce15+'\x20'+_0x230d93+_0x425890(0x9de,0x3b8,0xee,-0x18c)+_0x39ed59+'\x20'+_0x193b43+_0x17318e(0x1131,0xb4e,0xa8a,0x14d3)+_0x54bc9b+'\x20'+_0x350f7f+_0x17318e(0x10cb,0x13fd,0x150e,0xe71)+_0xdbcab3+'\x20'+_0x5077ce+_0x425890(0xe52,0x11e9,0xb8b,0x180e)+_0x525c84+'\x20'+_0x27247f+(_0x425890(0xaef,0x4bb,0x1f2,-0x384)+'┃╠')+_0x22b004+'\x20'+_0x4d8532+_0x425890(0x9d1,0x10a8,0xf33,0xe56)+_0x392b21+'\x20'+_0x584954+('guess\x20[opt'+'ion]\x0a┃╠')+_0x4bb6ec+'\x20'+_0x4ad211+(_0x425890(0x976,0xd9b,0x352,0x485)+_0x425890(0x4e2,0xded,0xd17,0x1567))+_0x77dae0+'\x20'+_0x5209f9+('suitpvp\x20[t'+_0x425890(-0x63,0x4e7,0xf63,-0x122)+_0x17318e(0x1388,0x140e,0x987,0xa2c)+_0x17318e(0x627,0xd9f,0x388,0xda7))+_0xb89c71+_0x425890(-0x114,0x383,0x263,0xa82),_0x1111b5[_0x17318e(0x2bf,-0x31a,0x48f,0x597)]=_0x51a1a8['user']['name'],_0x1111b5[_0x425890(0x1256,0xf61,0x6ce,0x85d)]=_0x4ef580,_0x1111b5['headerType']=0x4;let _0x5f40ce=_0x1111b5;const _0xf88a88={};_0xf88a88[_0x17318e(0x299,0x56d,0x119e,0xa24)]=_0x193fea,_0x28003c[_0x425890(-0x14e,0x41f,-0x35e,0x999)+'e'](_0x3584f0[_0x17318e(0x8f4,0x100f,0x1188,0xee4)],_0x5f40ce,_0xf88a88);}}break;case _0x17318e(0x39d,0xc5f,0xe43,0xbeb)+'u':{const _0x3d400c={};_0x3d400c['displayTex'+'t']=_0x17318e(0x488,0x590,0xf8a,0x55d)+'\x20⫸';const _0x10369d={};_0x10369d['buttonId']=_0x4fea53+_0x425890(-0x3c1,0x2ff,0xabb,0xc9c),_0x10369d[_0x425890(0x1678,0x10fb,0xdc4,0x1244)]=_0x3d400c,_0x10369d[_0x425890(0x1976,0x141b,0xa35,0x10c4)]=0x1;const _0x349b6e={};_0x349b6e[_0x425890(0x18ed,0x10a0,0x108b,0x91a)+'t']=_0x17318e(0xa6a,0x11c0,0x1db2,0x145c);const _0x547bfd={};_0x547bfd[_0x425890(0xe3a,0xf77,0x187a,0x1761)]=_0x4fea53+_0x425890(0xad0,0xa49,0xcd1,0x7af),_0x547bfd[_0x425890(0x1ac5,0x10fb,0x1354,0xcc1)]=_0x349b6e,_0x547bfd[_0x17318e(0xed3,0x1e35,0x19cc,0x1638)]=0x1;const _0x598b5e={};_0x598b5e['displayTex'+'t']=_0x295ea5[_0x17318e(0xcab,0x698,0x18d,0x5a1)];const _0x18f26b={};_0x18f26b[_0x17318e(0x1346,0x70f,0x19fb,0x1194)]=_0x4fea53+_0x425890(0x1b3b,0x1534,0xd60,0xf16),_0x18f26b['buttonText']=_0x598b5e,_0x18f26b['type']=0x1;let _0x194cc7=[_0x10369d,_0x547bfd,_0x18f26b],_0x862455={'image':{'url':_0x295ea5[_0x425890(-0x45d,0x215,0x576,-0x6ea)](_0x58a5bf,_0x295ea5[_0x425890(0xf96,0xe83,0x14ed,0xd08)])},'caption':'\x0a┏━❯\x20'+botname+(_0x425890(-0x583,0x19b,0x6cb,-0x3ae)+_0x17318e(0x1b99,0x1900,0x1630,0x180e)+_0x17318e(0x132b,0x1a93,0x1a12,0x1288)+'║\x20\x20\x20\x20\x20\x20\x20\x20\x0a'+'┃╠')+dragonemoji+'\x20'+_0x4fea53+(_0x425890(0x23c,0x26d,0xc75,-0x794)+_0x425890(-0x20,0x544,-0x329,-0x31f)+_0x17318e(0xcec,0x19ad,0x821,0x100a))+dragonemoji+'\x20'+_0x4fea53+(_0x425890(0x1418,0x13aa,0x18c0,0x1b56)+_0x425890(0x3d1,0x223,-0x20e,0x4cf)+_0x17318e(0x983,0x5ab,0xfd5,0x8c1))+dragonemoji+'\x20'+_0x4fea53+('emojimix\x20['+_0x17318e(0xd12,0x21f,0xd3a,0xadc)+_0x17318e(0x1a93,0x1bbf,0x1003,0x14a4))+dragonemoji+'\x20'+_0x4fea53+('tovideo\x20[r'+_0x425890(0x87c,0x173,-0xc3,-0x63a)+'┃╠')+dragonemoji+'\x20'+_0x4fea53+(_0x17318e(0xff5,0xb2a,0x152e,0xc2b)+_0x17318e(0x9bc,0xa12,0x1285,0xee1)+'┃╠')+dragonemoji+'\x20'+_0x4fea53+(_0x17318e(0xd86,0x1f56,0x1e1d,0x165a)+_0x17318e(0xd18,0x189,0xd25,0x369)+'┃╠')+dragonemoji+'\x20'+_0x4fea53+('tovn\x20[repl'+'y\x20aud]\x0a┃╠')+dragonemoji+'\x20'+_0x4fea53+(_0x17318e(0x8c8,0x435,0xae2,0xeb5)+_0x17318e(0x1023,0x538,0x521,0xae2))+dragonemoji+'\x20'+_0x4fea53+(_0x17318e(0x78b,0x2c,0xf69,0x7b7)+_0x425890(0x55d,0xd09,0x3d5,0x4af)+'┃╠')+dragonemoji+'\x20'+_0x4fea53+(_0x425890(-0x55,0x8af,0x1a4,0xebe)+'eply\x20txt]\x0a'+'┃╠')+dragonemoji+'\x20'+_0x4fea53+('dbinary\x20[r'+_0x425890(0xfb7,0x67d,0x37d,0x88c)+'┃╚════════'+'═════☬\x0a┗━━'+'❯\x20')+_0x2cbadb+_0x17318e(0xe62,0x85c,0x3e,0x5a0),'footer':_0x3797bd['user'][_0x17318e(0xd42,0x14f5,0x192d,0x109f)],'buttons':_0x194cc7,'headerType':0x4};_0x3797bd[_0x17318e(0x76a,-0x122,0x6a7,0x63c)+'e'](_0x17aa6d[_0x425890(0x1570,0xcc7,0xc6c,0x2fe)],_0x862455,{'quoted':_0x17aa6d});}break;case _0x295ea5[_0x17318e(0x2b3,0x581,-0x1c,0x960)]:{const _0x4b09cc={};_0x4b09cc[_0x17318e(0x1676,0x17ba,0x18af,0x12bd)+'t']=_0x295ea5[_0x17318e(0x9f3,0x8f9,0xe,0x8a9)];const _0x206d33={};_0x206d33[_0x17318e(0x1aae,0xfe4,0x14b3,0x1194)]=_0x4fea53+_0x425890(-0x226,0x2ff,-0x4d5,0x919),_0x206d33[_0x17318e(0x1374,0x10aa,0xe6e,0x1318)]=_0x4b09cc,_0x206d33[_0x17318e(0x1a39,0x141c,0x1874,0x1638)]=0x1;const _0x325ef1={};_0x325ef1[_0x17318e(0x997,0x92f,0x1232,0x12bd)+'t']=_0x295ea5[_0x17318e(0x15fa,0x4a3,0x941,0xeee)];const _0x4aebd7={};_0x4aebd7[_0x17318e(0x168b,0x1658,0xf08,0x1194)]=_0x4fea53+'alive',_0x4aebd7['buttonText']=_0x325ef1,_0x4aebd7[_0x17318e(0xf02,0x1743,0x1054,0x1638)]=0x1;const _0x18d2be={};_0x18d2be['displayTex'+'t']=_0x17318e(0x4e,-0x12f,0x5ce,0x82d);const _0x5bba1e={};_0x5bba1e[_0x425890(0xd6d,0xf77,0x1566,0x1808)]=_0x4fea53+_0x17318e(0xd5c,0xe03,0x1f0b,0x1751),_0x5bba1e['buttonText']=_0x18d2be,_0x5bba1e[_0x17318e(0xe0d,0xd2a,0x14ef,0x1638)]=0x1;let _0x3aae38=[_0x206d33,_0x4aebd7,_0x5bba1e],_0x4b3f3c={'image':{'url':_0x295ea5[_0x17318e(0x13f1,0xb48,0xea3,0x952)](_0x58a5bf,_0x295ea5['WKQXd'])},'caption':_0x17318e(-0xbc,0xca5,-0x14b,0x835)+botname+(_0x425890(0x794,0x19b,-0xda,0x826)+'═══💠\x20DATAB'+_0x425890(0x164c,0x1470,0x16c6,0x17ac)+'┃║\x20\x20\x20\x20\x20\x20\x20\x20'+_0x17318e(0x1a10,0x169b,0xf9d,0x14a4))+dragonemoji+'\x20'+_0x4fea53+_0x17318e(0x1280,0x1fb6,0x11e6,0x1604)+dragonemoji+'\x20'+_0x4fea53+_0x17318e(0xcb0,0x133a,0x117f,0xe98)+dragonemoji+'\x20'+_0x4fea53+'delcmd\x0a┃╠'+dragonemoji+'\x20'+_0x4fea53+_0x17318e(0x112f,0x2081,0x203c,0x1649)+dragonemoji+'\x20'+_0x4fea53+_0x17318e(0xabf,0x23b,-0x51b,0x441)+dragonemoji+'\x20'+_0x4fea53+'listmsg\x0a┃╠'+dragonemoji+'\x20'+_0x4fea53+_0x425890(0xd76,0x116b,0x15b8,0x88d)+dragonemoji+'\x20'+_0x4fea53+('delmsg\x0a┃╚═'+_0x17318e(0x1668,0x18e5,0x1ef0,0x157c)+_0x425890(0xce6,0x13af,0x1d23,0x1199))+_0x2cbadb+_0x425890(0x9,0x383,0xd44,0x9ee),'footer':_0x3797bd['user'][_0x425890(0x9e1,0xe82,0xb40,0x14fb)],'buttons':_0x3aae38,'headerType':0x4};_0x3797bd['sendMessag'+'e'](_0x17aa6d['chat'],_0x4b3f3c,{'quoted':_0x17aa6d});}break;case _0x295ea5[_0x17318e(0x4fc,0xea1,0xf9a,0x960)]:{if(_0x295ea5[_0x17318e(0x1926,0x1a22,0x137c,0x148a)](_0x295ea5[_0x17318e(0xc47,0x61c,0x1329,0xa04)],_0x425890(-0x42c,0x235,0xab2,-0x845))){const _0x478bd1={};_0x478bd1['displayTex'+'t']=_0x295ea5[_0x17318e(-0xb5,0x6cc,0xd0,0x8a9)];const _0x56467f={};_0x56467f[_0x425890(0xfd7,0xf77,0x17e0,0x7f0)]=_0x4fea53+_0x17318e(0x1c7,0x20,0x585,0x51c),_0x56467f[_0x425890(0x1b53,0x10fb,0x16a0,0x13f9)]=_0x478bd1,_0x56467f[_0x17318e(0x1d74,0x1ca4,0x1d46,0x1638)]=0x1;const _0x53774d={};_0x53774d['displayTex'+'t']=_0x295ea5[_0x425890(0xb64,0xcd1,0x10b2,0x8f5)];const _0x3f764c={};_0x3f764c[_0x17318e(0x1a4c,0x1625,0xdba,0x1194)]=_0x4fea53+_0x425890(0x1138,0xa49,0xdc2,0x1d9),_0x3f764c['buttonText']=_0x53774d,_0x3f764c['type']=0x1;const _0x45794b={};_0x45794b[_0x17318e(0xe73,0x123a,0xf7a,0x12bd)+'t']=_0x295ea5['hfIkN'];const _0x575b8d={};_0x575b8d[_0x17318e(0xfc2,0x10d3,0x786,0x1194)]=_0x4fea53+_0x425890(0x1543,0x1534,0x1818,0x17b9),_0x575b8d[_0x425890(0x14a3,0x10fb,0x1908,0x1a0d)]=_0x45794b,_0x575b8d['type']=0x1;let _0x39ea11=[_0x56467f,_0x3f764c,_0x575b8d],_0x3a9b4b={'image':{'url':_0x295ea5['ETfvB'](_0x58a5bf,_0x425890(0xe55,0x6d3,0x72d,0xa2b))},'caption':_0x425890(0xa41,0x618,0xae5,0xcc8)+botname+(_0x425890(-0x43a,0x19b,-0x314,0x4bc)+_0x425890(0x764,0x1051,0x18d9,0x117b)+_0x425890(0x1050,0x162b,0x1534,0x1f12)+_0x17318e(0x1180,0x1a3a,0x188a,0x159d)+_0x17318e(0x13a9,0x70a,0x381,0xba8))+dragonemoji+'\x20'+_0x4fea53+(_0x425890(0x107a,0x63c,0xe23,0xcbc)+'┃╠')+dragonemoji+'\x20'+_0x4fea53+'start\x0a┃╠'+dragonemoji+'\x20'+_0x4fea53+_0x425890(0x335,0x3fa,0x8aa,0x311)+dragonemoji+'\x20'+_0x4fea53+(_0x17318e(0x176e,0x1398,0x635,0xd6b)+_0x425890(0x17de,0x135f,0x1388,0x18ed)+_0x425890(0xb04,0xd90,0x17e1,0x8fc))+_0x2cbadb+_0x425890(-0x5a,0x383,0x78d,0x858),'footer':_0x3797bd[_0x17318e(0x16b9,0x1743,0x1c3f,0x12db)][_0x425890(0x1385,0xe82,0x12a5,0x11a8)],'buttons':_0x39ea11,'headerType':0x4};_0x3797bd[_0x425890(0x9eb,0x41f,0xd0b,-0x1c8)+'e'](_0x17aa6d['chat'],_0x3a9b4b,{'quoted':_0x17aa6d});}else _0x295ea5['TaciY'](_0x56cb71,_0xaadb1a[_0x425890(0x198,0xa69,0x111f,0x125f)]);}break;case _0x295ea5['JqpIC']:{if(_0x17318e(0x1221,0x1486,0x840,0xb6c)!==_0x425890(0x4fb,0x94f,0x12c3,0x6fa)){let _0x581745=_0x186751[_0x425890(0xe4a,0xc5b,0xcf7,0x854)](_0x421ead['db'][_0x425890(0xdbe,0xad0,0x7f9,0xcf9)]['users']),_0x5da325=_0x299fd7?_0x2cea40[_0x425890(0x13e8,0xd39,0x13c2,0xc76)]['premium']:_0x2edd69[_0x425890(0xa17,0xd39,0x1114,0x17ae)][_0x425890(0xe69,0x916,0x87e,0x135a)];for(let _0x2147cf of _0x581745)_0x399736['db']['data'][_0x425890(0xbce,0xd56,0x1194,0x17c8)][_0x2147cf][_0x17318e(0xe8d,0x12b,0xf13,0x9fd)]=_0x5da325;_0x1ae563[_0x17318e(0x494,-0x365,0x2ad,0x587)](_0x295ea5['AyIeU']);}else{const _0x112ec5={};_0x112ec5[_0x425890(0xc88,0x10a0,0xe96,0x1280)+'t']=_0x17318e(-0x29e,0x2bc,0x162,0x55d)+'\x20⫸';const _0x15f516={};_0x15f516[_0x17318e(0x1262,0x119a,0x9b5,0x1194)]=_0x4fea53+_0x17318e(0x357,0x804,0x328,0x51c),_0x15f516[_0x425890(0x168e,0x10fb,0xc02,0x1248)]=_0x112ec5,_0x15f516[_0x425890(0xbb8,0x141b,0x19ca,0x1023)]=0x1;const _0x518ba1={};_0x518ba1[_0x17318e(0xb07,0x16d2,0xd8e,0x12bd)+'t']=_0x425890(0xda5,0x123f,0x1a63,0x1129);const _0x37b7a3={};_0x37b7a3[_0x17318e(0xf97,0xd13,0x9cc,0x1194)]=_0x4fea53+_0x17318e(0x14fa,0x674,0x876,0xc66),_0x37b7a3['buttonText']=_0x518ba1,_0x37b7a3[_0x425890(0x1df9,0x141b,0x17db,0x1922)]=0x1;const _0x2e6cd8={};_0x2e6cd8['displayTex'+'t']=_0x295ea5[_0x17318e(0xc83,0x873,0xe50,0x5a1)];const _0x2d6122={};_0x2d6122[_0x17318e(0xdf6,0x18b6,0xb26,0x1194)]=_0x4fea53+'donate',_0x2d6122[_0x425890(0x19c8,0x10fb,0x7d7,0x84d)]=_0x2e6cd8,_0x2d6122['type']=0x1;let _0x5ae8d3=[_0x15f516,_0x37b7a3,_0x2d6122];const _0x5bc897={};_0x5bc897['url']=_0x58a5bf+_0x295ea5[_0x425890(0xebb,0x1132,0x1170,0xcc5)];const _0x3426e0={};_0x3426e0[_0x17318e(0x7ce,0xedb,0xfb1,0x59e)]=_0x5bc897,_0x3426e0[_0x17318e(0xcbb,0x837,-0x1a1,0x527)]='\x0a┏━❯\x20'+botname+(_0x17318e(0xd59,0x377,0x1b6,0x3b8)+'═══💠\x20ISLAM'+_0x425890(0xa6f,0x123d,0x113c,0x1c80)+'\x09\x20\x20\x20\x20\x20\x20\x20\x20\x0a'+'┃╠')+dragonemoji+'\x20'+_0x4fea53+('juzamma\x0a┃╚'+_0x17318e(0x14fc,0x183b,0x17f8,0x157c)+'═══☬\x0a┗━━❯\x20')+_0x2cbadb+_0x425890(-0x529,0x383,0xbb7,0x335),_0x3426e0[_0x425890(-0x354,0x37a,0x4bc,0xdbb)]=_0x3797bd['user'][_0x17318e(0xf72,0x609,0x1a54,0x109f)],_0x3426e0[_0x17318e(0xd46,0x9ec,0x134c,0x117e)]=_0x5ae8d3,_0x3426e0['headerType']=0x4;let _0x102db6=_0x3426e0;_0x3797bd[_0x425890(0xa9f,0x41f,-0x4f8,-0x3b1)+'e'](_0x17aa6d[_0x17318e(0x17e5,0x15f7,0x551,0xee4)],_0x102db6,{'quoted':_0x17aa6d});}}break;case _0x295ea5[_0x425890(0x1948,0x12b7,0x1a8b,0xbaf)]:{if(_0x295ea5[_0x425890(0x1987,0x1434,0xebd,0x1b05)](_0x17318e(-0x4e,-0x51,0xa8b,0x6b3),_0x295ea5[_0x425890(0x1d78,0x163a,0xd54,0x1153)])){const _0x582c40={};_0x582c40[_0x425890(0x18d8,0x10a0,0x15f3,0xb91)+'t']='⫷\x20ALL\x20MENU'+'\x20⫸';const _0x16e2a7={};_0x16e2a7[_0x17318e(0x147a,0x1117,0xecc,0x1194)]=_0x4fea53+_0x425890(-0x168,0x2ff,0x102,-0x48f),_0x16e2a7[_0x17318e(0x89c,0xdca,0xc2c,0x1318)]=_0x582c40,_0x16e2a7['type']=0x1;const _0x4d3ca4={};_0x4d3ca4[_0x425890(0x1821,0x10a0,0x6d5,0x1949)+'t']=_0x295ea5['spClB'];const _0x5e5659={};_0x5e5659[_0x17318e(0x1316,0xf35,0x1569,0x1194)]=_0x4fea53+_0x425890(0x40f,0xa49,0xa9e,0xd97),_0x5e5659[_0x17318e(0x1858,0xbf9,0x1c2e,0x1318)]=_0x4d3ca4,_0x5e5659[_0x425890(0x11e6,0x141b,0x150b,0x146f)]=0x1;const _0x186950={};_0x186950['displayTex'+'t']=_0x295ea5[_0x17318e(-0x4c7,-0x325,0x478,0x5a1)];const _0x405edf={};_0x405edf[_0x17318e(0x116b,0x1368,0x12d6,0x1194)]=_0x4fea53+_0x17318e(0x1e82,0x1397,0x1a99,0x1751),_0x405edf[_0x17318e(0x1347,0x9c1,0x147e,0x1318)]=_0x186950,_0x405edf[_0x17318e(0x11f5,0x1485,0x1fae,0x1638)]=0x1;let _0x15610c=[_0x16e2a7,_0x5e5659,_0x405edf],_0x53a896={'image':{'url':_0x295ea5[_0x17318e(0x1731,0x173f,0xe3a,0x1261)](_0x58a5bf,_0x295ea5[_0x17318e(0x1859,0x1cd6,0xb5c,0x152b)])},'caption':_0x425890(0xbfd,0x618,0x3a8,0x6b8)+botname+(_0x17318e(0x907,-0xcc,0x9ef,0x3b8)+_0x17318e(0xfb0,0x1122,0x3ac,0xa89)+_0x17318e(0xc4c,0x209,0x40d,0x6ab)+_0x425890(0xd6d,0x8ce,0x10ee,0xc48)+'\x20\x20\x20\x0a┃╠')+dragonemoji+'\x20'+_0x4fea53+(_0x425890(0x16ef,0xf7a,0x1423,0x806)+_0x425890(-0x3b6,0x273,0xa19,0xd0f))+dragonemoji+'\x20'+_0x4fea53+(_0x425890(0x1dfa,0x135b,0xb95,0xeff)+_0x17318e(0xba0,0x6c9,0x4ed,0xdf1))+dragonemoji+'\x20'+_0x4fea53+('deep\x20[repl'+_0x425890(-0x658,0x273,0x6ce,-0x3a4))+dragonemoji+'\x20'+_0x4fea53+('earrape\x20[r'+_0x17318e(0xdb7,0xe3c,0x7fa,0xe6a)+'┃╠')+dragonemoji+'\x20'+_0x4fea53+(_0x17318e(0x13cb,0x10e2,0x17da,0x1073)+_0x17318e(0xa97,0x536,0x193,0x490))+dragonemoji+'\x20'+_0x4fea53+(_0x425890(0x1118,0xf4c,0x14ce,0xae9)+'\x20aud]\x0a┃╠')+dragonemoji+'\x20'+_0x4fea53+('nightcore\x20'+_0x425890(-0x148,0x4b7,0x973,0xe97)+_0x17318e(0x1977,0x127e,0x6c7,0x100a))+dragonemoji+'\x20'+_0x4fea53+(_0x17318e(0x19ab,0x14e6,0x6e5,0x109b)+_0x17318e(0x1340,0x530,0x8ea,0xe6a)+'┃╠')+dragonemoji+'\x20'+_0x4fea53+(_0x17318e(0x1a77,0x1388,0x1545,0x1612)+_0x17318e(0xd97,0x174b,0x36c,0xdf1))+dragonemoji+'\x20'+_0x4fea53+(_0x17318e(0x1210,0xe31,0x1172,0x1753)+_0x17318e(0xc01,0x871,-0xe8,0x490))+dragonemoji+'\x20'+_0x4fea53+(_0x17318e(0x1e49,0x1d18,0x15ef,0x13c5)+'reply\x20aud]'+_0x425890(0x1d72,0x1501,0x189f,0x1f82)+_0x17318e(0x190c,0xb95,0xf5b,0xe88)+_0x17318e(0x859,0xcd8,0x28,0x865))+_0x2cbadb+_0x425890(-0x1f,0x383,0xd34,-0x594),'footer':_0x3797bd[_0x17318e(0x1aa7,0x1578,0x1173,0x12db)][_0x17318e(0x81d,0x1247,0x1518,0x109f)],'buttons':_0x15610c,'headerType':0x4};_0x3797bd[_0x425890(0x375,0x41f,-0x555,0x6b)+'e'](_0x17aa6d[_0x425890(0x6dd,0xcc7,0xe86,0x259)],_0x53a896,{'quoted':_0x17aa6d});}else{if(_0x295ea5[_0x425890(0x7bd,0x687,0xd54,0xb95)](_0x343cf7[_0x17318e(0x2d8,0x102f,0x1499,0xaf8)],'true'))return _0x295ea5[_0x425890(-0x3f7,0x5fd,-0x19e,0xddf)](_0x304431,_0x17318e(0xbfa,0xead,0xf6f,0xc08));_0x4c74ff['chatbotpre']=_0x295ea5[_0x17318e(0x176a,0xe9a,0x1622,0x16f8)],_0x2cb854(_0x425890(0x1f5,0x6d3,0x7e7,0x579)+_0x425890(0xa6f,0x647,-0x16,0x689)+_0x17318e(0xe90,0x6a4,0xa6a,0xfb1));}}break;case _0x295ea5[_0x17318e(0x43a,0x755,0x145b,0xccd)]:{const _0x2dd591={};_0x2dd591[_0x17318e(0x1d56,0x8c8,0xc3f,0x12bd)+'t']=_0x295ea5['vMhbF'];const _0x7e23bb={};_0x7e23bb[_0x425890(0x1530,0xf77,0xc90,0x6f4)]=_0x4fea53+_0x425890(0x2e8,0x2ff,-0x66b,0x93f),_0x7e23bb[_0x425890(0x1173,0x10fb,0xd82,0xe45)]=_0x2dd591,_0x7e23bb[_0x425890(0x12d5,0x141b,0x9fd,0xbbc)]=0x1;const _0x4abaaa={};_0x4abaaa['displayTex'+'t']=_0x295ea5['spClB'];const _0x171dcd={};_0x171dcd[_0x425890(0x519,0xf77,0x185c,0xe4b)]=_0x4fea53+_0x425890(0xa4c,0xa49,0xe11,-0x50),_0x171dcd[_0x425890(0x6ff,0x10fb,0x796,0x1a1d)]=_0x4abaaa,_0x171dcd[_0x425890(0xf04,0x141b,0xb9a,0x197d)]=0x1;const _0x72a44e={};_0x72a44e[_0x17318e(0xc0d,0x9be,0xc0f,0x12bd)+'t']=_0x295ea5[_0x425890(0x60,0x384,-0x13,-0x2eb)];const _0x1e29e7={};_0x1e29e7[_0x425890(0x17f4,0xf77,0x13f1,0x8b7)]=_0x4fea53+_0x17318e(0xe15,0x1a93,0xee3,0x1751),_0x1e29e7[_0x425890(0x1a69,0x10fb,0x1999,0x719)]=_0x72a44e,_0x1e29e7['type']=0x1;let _0x136289=[_0x7e23bb,_0x171dcd,_0x1e29e7],_0x1a9d59={'image':{'url':_0x295ea5[_0x425890(0xb8a,0xbbd,0x154f,0xb9e)](_0x58a5bf,_0x17318e(0x634,0xac7,0x7db,0xb85))},'caption':_0x425890(-0x31,0x618,0x1f1,0x5b8)+botname+(_0x17318e(0xcfe,0xb74,0x37c,0x3b8)+_0x425890(0x1b9a,0x1328,0x13fa,0xfbe)+'COPE\x20💠══╗\x0a'+_0x425890(0x101c,0x1380,0x10fa,0xc47)+_0x425890(0x1182,0x98b,0x202,0x90))+dragonemoji+'\x20'+_0x4fea53+(_0x17318e(0xdf8,0x8e2,0x15ce,0xf53)+'(indo)\x0a┃╠')+dragonemoji+'\x20'+_0x4fea53+(_0x425890(0x39f,0xa77,0x7d9,0x37e)+_0x17318e(0x6cd,0xf12,0x1041,0x71d))+dragonemoji+'\x20'+_0x4fea53+(_0x17318e(0xf7,0xff5,0xedf,0x6c6)+_0x17318e(0x1e71,0xd5c,0xc8a,0x1477))+dragonemoji+'\x20'+_0x4fea53+('ramaljodoh'+_0x425890(-0x548,0x198,0xaa6,0x6eb))+dragonemoji+'\x20'+_0x4fea53+(_0x17318e(0x117d,0xc61,0x1945,0x14da)+_0x425890(0xf89,0xc30,0xdaf,0x98b)+_0x17318e(0x110b,0xed6,0x101e,0xe36))+dragonemoji+'\x20'+_0x4fea53+(_0x17318e(0x756,0x235,0x43a,0x774)+_0x425890(-0x1c3,0x198,-0x844,0x376))+dragonemoji+'\x20'+_0x4fea53+('ramalcinta'+_0x17318e(-0xe6,-0x1b5,-0x4c6,0x3b5))+dragonemoji+'\x20'+_0x4fea53+('cocoknama\x20'+_0x17318e(-0xf9,0xb15,0x14a,0x71d))+dragonemoji+'\x20'+_0x4fea53+(_0x425890(0x13a0,0xe49,0x90b,0x131f)+_0x17318e(0x16e7,0x1cc0,0x13cc,0x1477))+dragonemoji+'\x20'+_0x4fea53+(_0x17318e(0x8c9,-0x230,0x198,0x5fc)+'h\x20(indo)\x0a┃'+'╠')+dragonemoji+'\x20'+_0x4fea53+(_0x17318e(0x11e6,0xd16,0xf4c,0xbe2)+_0x17318e(-0x54,-0x28b,-0x36b,0x3b5))+dragonemoji+'\x20'+_0x4fea53+(_0x17318e(0x181b,0x11a0,0x58a,0xe35)+_0x17318e(0x1a1c,0x1b03,0x1a12,0x181b))+dragonemoji+'\x20'+_0x4fea53+('pekerjaan\x20'+_0x425890(0x329,0x500,0xa49,0x10e))+dragonemoji+'\x20'+_0x4fea53+('nasib\x20(ind'+_0x17318e(0x4af,0xfc6,0xcd2,0x99d))+dragonemoji+'\x20'+_0x4fea53+(_0x425890(0xba2,0x567,-0x47b,0x852)+'indo)\x0a┃╠')+dragonemoji+'\x20'+_0x4fea53+('tarot\x20(ind'+'o)\x0a┃╠')+dragonemoji+'\x20'+_0x4fea53+(_0x425890(-0x2c0,0x458,0xdd2,-0x32b)+_0x17318e(0x1276,0x156d,0x118b,0x1477))+dragonemoji+'\x20'+_0x4fea53+('haribaik\x20('+_0x17318e(0x1916,0x1b86,0x10fd,0x1477))+dragonemoji+'\x20'+_0x4fea53+(_0x17318e(0xff0,0x1944,0x16a7,0xf0b)+_0x425890(0x408,0x198,0xb59,0x3d2))+dragonemoji+'\x20'+_0x4fea53+(_0x17318e(0x1087,0x1584,0x6bb,0xf2d)+_0x425890(0x1cb0,0x125a,0xd24,0x8f5))+dragonemoji+'\x20'+_0x4fea53+(_0x425890(0x10cc,0xa09,0x81b,0x221)+_0x425890(0x1838,0x125a,0x1725,0x18fa))+dragonemoji+'\x20'+_0x4fea53+(_0x425890(-0x3ed,0x226,-0x38c,0xc59)+_0x17318e(-0x6e9,0xc57,0x8f9,0x3b5))+dragonemoji+'\x20'+_0x4fea53+('peruntunga'+'n\x20(indo)\x0a┃'+'╠')+dragonemoji+'\x20'+_0x4fea53+('weton\x20(ind'+_0x17318e(0xd0a,0x105,0x8a5,0x99d))+dragonemoji+'\x20'+_0x4fea53+(_0x425890(0xb9d,0x12d2,0x11ba,0x9d6)+_0x425890(0xa18,0x125a,0x15df,0xe0b))+dragonemoji+'\x20'+_0x4fea53+(_0x17318e(0x5d8,0x5a0,0x832,0x3e2)+_0x17318e(0x1a2c,0xdcc,0x1fb2,0x15c1)+_0x425890(0xf73,0x1287,0x1864,0x1d0f))+dragonemoji+'\x20'+_0x4fea53+('memancing\x20'+'(indo)\x0a┃╠')+dragonemoji+'\x20'+_0x4fea53+(_0x425890(0x917,0xf41,0x939,0x9ba)+_0x17318e(-0x9d,0xd1,0x9b9,0x71d))+dragonemoji+'\x20'+_0x4fea53+(_0x425890(0x16d7,0x1232,0x912,0xa52)+'do)\x0a┃╠')+dragonemoji+'\x20'+_0x4fea53+(_0x425890(0x163b,0x1494,0xb2b,0x1e4f)+_0x17318e(0x93,-0x2c3,0xd1,0x6ff)+_0x17318e(0xd46,0xb56,0x2ef,0x4a7)+_0x17318e(0x1505,0x1444,0x1ab5,0x170b))+_0x2cbadb+'\x20❮━😎','footer':_0x3797bd['user'][_0x17318e(0xaad,0x189c,0x15dd,0x109f)],'buttons':_0x136289,'headerType':0x4};_0x3797bd[_0x425890(0x79d,0x41f,0xbca,-0x92)+'e'](_0x17aa6d['chat'],_0x1a9d59,{'quoted':_0x17aa6d});}break;case _0x295ea5['szieK']:case _0x295ea5[_0x17318e(0x17f9,0xa00,0xbcb,0x147e)]:case _0x295ea5[_0x425890(0x319,0xad8,0xa6f,0x11f7)]:var _0x17fbe5=await getBuffer(_0x295ea5[_0x425890(0xf85,0x1522,0x1004,0x136e)](_0x58a5bf,_0x295ea5['JLEnZ']));const _0x1fcff2={};_0x1fcff2[_0x17318e(0xedd,0x124a,0x951,0x12bd)+'t']=''+button,_0x1fcff2[_0x425890(0x24,0x5f3,0xfad,0xff0)]=''+btnurl;const _0x940ed0={};_0x940ed0[_0x17318e(0xf06,0xed0,0x1195,0xcf3)]=_0x1fcff2,await _0x3797bd[_0x17318e(0x170a,0x6b9,0x7f9,0x1109)+'g'](_0x146a84,_0x295ea5[_0x425890(0x9a4,0xbbf,0x14b6,0x8de)]('','')+'\x20',_0x425890(0x469,0x3a3,0x72a,0x9e)+_0x425890(0x842,0x614,-0x21b,0x6ef)+_0x17318e(0xf50,0x97d,0x101b,0xea6)+_0x17318e(0x1274,0x1714,0x1279,0x15bf)+'n\x20Develope'+_0x17318e(0x1533,0x1e98,0x1455,0x1504)+_0x425890(0x2b9,0x2d4,-0x157,-0x604)+_0x17318e(0x1480,0xaf3,0x1c5b,0x136d)+_0x17318e(0x1e91,0x1004,0x20b8,0x1626)+'\x20dragon\x20te'+_0x17318e(0x1864,0x155e,0x9cf,0x1396)+_0x17318e(0xc46,0x5bc,0x7e9,0xe56)+'rget\x20to\x20vi'+_0x17318e(0x334,0x3e,0x1079,0x6aa)+_0x17318e(0x1c90,0x1aae,0x1d2d,0x149c)+_0x17318e(0xa11,-0x37f,0x78,0x4f7),_0x17fbe5,[_0x940ed0,{'urlButton':{'displayText':_0x295ea5['ERivw'],'url':_0x17318e(0xda8,0x602,0x15f3,0xd55)+_0x17318e(0x870,0x28c,-0x284,0x7da)+_0x425890(0x93f,0x52f,0x1ba,-0x124)+_0x17318e(0x115d,0x1e5c,0x164b,0x170f)+_0x425890(-0x655,0x10a,-0x12e,-0x28b)}},{'quickReplyButton':{'displayText':_0x295ea5['spClB'],'id':_0x295ea5[_0x425890(0xe4a,0x1481,0xe40,0x1972)]}},{'quickReplyButton':{'displayText':_0x295ea5[_0x17318e(0x1c11,0x1508,0x186d,0x1679)],'id':_0x425890(0xfcb,0x1277,0xde5,0xe59)}}]);break;default:if(_0x5af26d[_0x17318e(0x382,-0x1ed,0xca,0x653)]('=>')){if(!_0x193cb6)return _0x295ea5[_0x425890(0x1c91,0x1401,0x1ad5,0x1a24)](_0xcd1d32,mess[_0x425890(0x101b,0x1277,0x1b82,0x143e)]);function _0x521447(_0x437753){function _0x1fbd21(_0x410325,_0x3e3499,_0x437b0a,_0xff984c){return _0x17318e(_0x410325-0x61,_0x410325,_0x437b0a-0xe6,_0x437b0a- -0x39f);}function _0x5ebf1b(_0x1e8057,_0x4842ef,_0x5d43bb,_0x4f1f81){return _0x17318e(_0x1e8057-0x16c,_0x1e8057,_0x5d43bb-0xd7,_0x5d43bb- -0xac);}const _0x1a18e3={'uaqDm':function(_0x1f9880,_0x1fb6a3){function _0x12c564(_0x185c02,_0x311f09,_0x4ced45,_0x3598ac){return _0x5492(_0x4ced45- -0x30b,_0x185c02);}return _0x295ea5[_0x12c564(0x1db,0xebb,0x5e2,0xd99)](_0x1f9880,_0x1fb6a3);},'sDchb':_0x295ea5[_0x5ebf1b(0x1435,0x263,0x9ee,0xc26)]};if(_0x295ea5['VYPKE'](_0x295ea5[_0x1fbd21(0x2be,0xcb8,0xb33,0x4dc)],_0x295ea5[_0x5ebf1b(0xd78,0x5d3,0xba2,0xeb8)]))sat=JSON[_0x1fbd21(0x401,0x515,0xbf9,0x160a)](_0x437753,null,-0x1fdf+0x207*-0xe+-0x1*-0x3c43),bang=util[_0x1fbd21(0x14f1,0x103c,0x1169,0x18f3)](sat),_0x295ea5['jSrwV'](sat,undefined)&&(bang=util[_0x1fbd21(0x77c,0x12ad,0x1169,0x7ee)](_0x437753)),_0xcd1d32(bang);else{const _0x373b2b={'VPQhH':function(_0x43f191,_0xe80df3){return _0x295ea5['ywRqL'](_0x43f191,_0xe80df3);},'gHlYh':function(_0x1a6a97,_0x39d023){return _0x1a6a97+_0x39d023;}};_0x49da5b=!![];let _0x2ef765=_0xad48b3[_0x295ea5['QqkAZ'](_0x295ea5[_0x5ebf1b(0xf25,0xb1c,0x9ee,0x10fa)],_0x4d7d50[_0x5ebf1b(0x1104,0xe94,0xe38,0x1628)])],_0xc094d7=_0x72b73b['toLowerCas'+'e']()[_0x1fbd21(0xba3,-0x1d9,0x48f,0x789)](/[^\w\s\-]+/,''),_0x1170b2=/^((me)?give up|surr?ender)$/i[_0x1fbd21(0x80e,0x71d,0xc04,0xac1)](_0x54fc9[_0x1fbd21(-0x5e,0x844,0x66,-0x444)]);if(!_0x1170b2){let _0x146f75=_0x2ef765[_0x1fbd21(0xa1e,0xe8,0x6c8,-0x133)]['findIndex'](_0x33b10a=>_0x33b10a[_0x1fbd21(0x69b,0x346,0x9b7,0x1051)+'e']()['replace'](/[^\w\s\-]+/,'')===_0xc094d7);if(_0x2ef765[_0x5ebf1b(0x8ae,0xb10,0xc8e,0xd42)][_0x146f75])return!(-0x5c*0x19+0x1996+-0x11*0xfa);_0x2ef765[_0x5ebf1b(0x157a,0x5d3,0xc8e,0x6db)][_0x146f75]=_0x5cc76e[_0x5ebf1b(0x1484,0x8b8,0xbda,0xaf8)];}let _0x4cf178=_0x295ea5['BXHsG'](_0x2ef765[_0x5ebf1b(0xe53,0x413,0xc8e,0x4f8)][_0x5ebf1b(0x352,0x31e,0xa2d,0x1408)],_0x2ef765['terjawab'][_0x5ebf1b(0xe44,0x360,0xb79,0x472)](_0x999589=>_0x999589)[_0x1fbd21(0x22b,-0xb2,0x73a,0x665)]),_0x400c6a=('\x0aAnswer\x20Th'+_0x1fbd21(0x6a6,0x970,0xb6,-0x30a)+_0x5ebf1b(0x286,0x306,0xd1e,0x160f)+_0x1fbd21(0x693,0xb3a,0xd27,0x1437)+_0x2ef765[_0x1fbd21(0x876,0x155f,0xd82,0x14ae)]+(_0x1fbd21(0x612,-0x5ed,0x29e,-0x31)+'s\x20')+_0x2ef765[_0x1fbd21(0xe66,0x67e,0x6c8,0x317)]['length']+_0x1fbd21(0x776,0x30f,0xc66,0xf4b)+(_0x2ef765['jawaban']['find'](_0x1c3337=>_0x1c3337['includes']('\x20'))?'(Some\x20Answ'+_0x5ebf1b(0xd12,0x18a8,0x16da,0x1104)+'paces)':'')+'\x0a'+(_0x4cf178?_0x5ebf1b(0x1b0d,0x1de1,0x1729,0x1dc3)+'s\x20Answered':_0x1170b2?_0x1fbd21(0xaee,0x147c,0xf19,0x13a3):'')+'\x0a'+_0x424cfe['from'](_0x2ef765[_0x5ebf1b(0x143d,0x4fb,0x9bb,0x1322)],(_0xeaab8b,_0x305fcc)=>{function _0x5d36b8(_0x353776,_0x3ee950,_0x11a054,_0x386390){return _0x5ebf1b(_0x11a054,_0x3ee950-0x129,_0x3ee950- -0x2a6,_0x386390-0x7e);}function _0x25ac91(_0x166c64,_0x29486d,_0x33527b,_0x55b024){return _0x1fbd21(_0x55b024,_0x29486d-0x196,_0x29486d-0x45a,_0x55b024-0x1d5);}return _0x1170b2||_0x2ef765[_0x25ac91(0x4dc,0xdf5,0x725,0x3fd)][_0x305fcc]?('('+_0x373b2b[_0x25ac91(0x1097,0x11df,0xa78,0xea4)](_0x305fcc,-0x2529+0x121f*-0x1+-0x1*-0x3749)+')\x20'+_0xeaab8b+'\x20'+(_0x2ef765[_0x25ac91(0xb69,0xdf5,0x178c,0x10cd)][_0x305fcc]?_0x373b2b[_0x25ac91(0x58e,0x6d6,0xcb0,0xba8)]('@',_0x2ef765[_0x5d36b8(0xef4,0x9e8,0x412,0x1288)][_0x305fcc][_0x5d36b8(-0x5df,0x1b6,0x82,0x7a6)]('@')[0x1e3f+-0x1*0x25fb+-0x1*-0x7bc]):''))[_0x5d36b8(-0x239,0x417,0x130,0x881)]():![];})[_0x1fbd21(0xb58,0xa57,0x886,0x56e)](_0x40b867=>_0x40b867)[_0x5ebf1b(0x10fe,0x45d,0x666,0xbf8)]('\x0a')+_0x1fbd21(0x11f2,0xc6c,0x902,0x84)+(_0x1170b2?'':_0x1fbd21(0x124c,0xd00,0x7ad,0xc78)+_0x5ebf1b(0x1360,0x8c0,0xedd,0x13a8)))[_0x1fbd21(0x3e7,0x4e2,0x3ca,0xa42)]();_0x4cc15b[_0x5ebf1b(0x1a7d,0x166d,0x1423,0x1a73)](_0x4ab4ed[_0x1fbd21(0x779,0x13b2,0xb45,0x3c5)],_0x400c6a,_0x49ba5e,{'contextInfo':{'mentionedJid':_0x3d6b5b(_0x400c6a)}})[_0x5ebf1b(-0x130,0x901,0x324,0x32)](_0x2ddb04=>{function _0x342277(_0x6fee08,_0x56fb0b,_0x237fad,_0x1507c0){return _0x5ebf1b(_0x56fb0b,_0x56fb0b-0x30,_0x237fad- -0x4a9,_0x1507c0-0x12);}function _0x4c6835(_0x2eada0,_0x489dab,_0x424da8,_0x2e796e){return _0x1fbd21(_0x2e796e,_0x489dab-0x21,_0x489dab- -0x257,_0x2e796e-0xb7);}return _0x45a96a[_0x1a18e3[_0x342277(0x1f3,-0xe7,-0x1ba,0x1b9)](_0x1a18e3[_0x342277(0xe85,-0x146,0x5c5,0x3c6)],_0x11b2fe[_0x342277(0xd19,0xae,0x98f,0x103c)])][_0x342277(0x5ea,-0x19d,0x718,0xe23)]=_0x2a5250;})['catch'](_0x2d50a0=>_0x2d50a0);if(_0x295ea5[_0x5ebf1b(0x1626,0xa03,0xbf6,0x13c9)](_0x4cf178,_0x1170b2))delete _0x49000e[_0x295ea5[_0x1fbd21(0xc38,0x3c0,0x4b6,0xb48)](_0x295ea5[_0x5ebf1b(0x460,0xa21,0x9ee,0x586)],_0x7201d['chat'])];}}try{if(_0x295ea5['zNFQS'](_0x295ea5['FQnOX'],_0x295ea5[_0x17318e(0x429,0xc85,0x13a1,0xdf7)])){_0x57518d['unlinkSync'](_0x1c4c66);if(_0xb5ddc8)_0x295ea5[_0x17318e(0xb1b,0x166d,0xe11,0xe7d)](_0x3f65b0,_0x43b173);let _0x167fc7=_0x3d0f8c['readFileSy'+'nc'](_0x474d76);const _0x2e0205={};_0x2e0205['image']=_0x167fc7;const _0x593cbc={};_0x593cbc[_0x425890(0xbaa,0x807,0x305,0x536)]=_0x563d5e,_0x19f16d[_0x17318e(0x3d2,0x926,-0xc1,0x63c)+'e'](_0x1e0620[_0x425890(0x9b6,0xcc7,0x2ac,0x39b)],_0x2e0205,_0x593cbc),_0x68daa7[_0x425890(0x129d,0xf1d,0x18c9,0x114b)](_0x6009fa);}else _0x295ea5[_0x17318e(0x125f,0xe44,0x11c8,0x1104)](_0xcd1d32,util[_0x17318e(0x17d3,0x1d26,0x107a,0x1508)](_0x295ea5[_0x425890(0x1ca1,0x14d2,0x1a84,0x1bd4)](eval,_0x425890(0x728,0xddd,0x161e,0x98c)+_0x17318e(0x19f0,0x16b2,0x1a25,0xfd7)+'n\x20'+_0x5af26d[_0x425890(0x14c2,0x10c8,0xaff,0x133c)](-0xe4b+-0x1*0x840+0x2*0xb47)+_0x425890(0xe5f,0x6ee,-0xc5,0xfa6))));}catch(_0x4d8dbd){_0x295ea5[_0x17318e(0xd4,0x5b0,-0x3ab,0x4fa)](_0xcd1d32,String(_0x4d8dbd));}}if(_0x5af26d[_0x17318e(0xa39,0x67f,0xe6e,0x653)]('>')){if(!_0x193cb6)return _0xcd1d32(mess[_0x17318e(0x11eb,0xf77,0x17c9,0x1494)]);try{let _0xca7ba1=await _0x295ea5[_0x425890(0x73c,0x9f5,0xc6,0xfd1)](eval,_0x5af26d['slice'](0x16eb+-0xb92+0xb57*-0x1));if(_0x295ea5[_0x17318e(0x1228,0x41f,0x827,0x818)](typeof _0xca7ba1,_0x295ea5[_0x17318e(0x11aa,0x1a11,0x827,0xfd5)]))_0xca7ba1=_0x295ea5[_0x17318e(0xef4,0x1c4,0xb5c,0x98d)](require,_0x295ea5['tdSZi'])[_0x17318e(0x164f,0x66a,0xcb8,0x10b8)](_0xca7ba1);await _0x295ea5[_0x17318e(0x1557,0x13dd,0xc86,0x1186)](_0xcd1d32,_0xca7ba1);}catch(_0x3e2acc){await _0xcd1d32(_0x295ea5[_0x17318e(0x1236,0x1c82,0xe7a,0x1854)](String,_0x3e2acc));}}if(_0x5af26d[_0x425890(0x703,0x436,0xc8,0x699)]('$')){if(_0x295ea5[_0x17318e(0x794,0xadf,0x1262,0xb26)]==='sHyPg'){if(!_0x193cb6)return _0x295ea5['OyyCQ'](_0xcd1d32,mess['owner']);_0x295ea5[_0x17318e(0x1ad3,0x1dd0,0x147b,0x1530)](exec,_0x5af26d[_0x17318e(0xe32,0x1339,0x1c3b,0x12e5)](0x5ee*-0x1+0x1bf*-0xd+-0x1ca3*-0x1),(_0x52cb5b,_0x50415a)=>{function _0x5cd63a(_0x4ad7b1,_0x2186c2,_0x124e76,_0x5719cb){return _0x425890(_0x124e76,_0x2186c2- -0x2cb,_0x124e76-0x13b,_0x5719cb-0x13f);}if(_0x52cb5b)return _0xcd1d32(_0x52cb5b);if(_0x50415a)return _0x295ea5[_0x5cd63a(0xb25,0xa6c,0x13d7,0x107a)](_0xcd1d32,_0x50415a);});}else _0x2f152f=_0x295ea5[_0x425890(0xb8e,0xa9f,0x8fd,0x287)],_0x295ea5['oFJoR'](_0x1ef59d,_0x295ea5[_0x17318e(0xdec,0x1786,0x2100,0x1728)](_0x295ea5[_0x425890(0x138e,0xa6f,0x1156,0x584)],_0x950fa3));}if(_0x17aa6d[_0x425890(0xff9,0xcc7,0xa2e,0xdbc)]['endsWith'](_0x17318e(0xa55,-0x39d,-0x436,0x53f)+'p.net')&&_0x13557e){if(_0x295ea5['jkjPn'](_0x295ea5['dIuOq'],_0x295ea5[_0x425890(0xaa3,0x1420,0x1e9b,0xb08)])){this[_0x425890(0xadf,0x1270,0x10b9,0xb03)]=this[_0x425890(0x111c,0x1270,0x1afa,0x1001)]?this['anonymous']:{};let _0x42fced=Object[_0x17318e(0x976,0x960,0x75,0x5b6)](this[_0x17318e(0x14f8,0x10d1,0x14e2,0x148d)])['find'](_0x156f44=>[_0x156f44['a'],_0x156f44['b']][_0x425890(-0x638,0x291,0xa29,0x480)](_0x17aa6d[_0x17318e(0x121f,0x220,0xc00,0xc86)])&&_0x156f44[_0x17318e(0xd74,0x10b2,0xb06,0x1443)]===_0x17318e(0xd6c,0xaab,0x143f,0x110f));if(_0x42fced){if(/^.*(next|leave|start)/[_0x17318e(0xd66,0x792,0x18f9,0xfa3)](_0x17aa6d[_0x425890(0x188,0x1e8,0x902,0xaed)]))return;if([_0x295ea5[_0x17318e(0x1c25,0x12dc,0x217f,0x16e4)],_0x295ea5['hLdBQ'],_0x295ea5[_0x425890(0x7df,0xb0c,0x5d7,0x1f6)],_0x295ea5['XAsdL'],_0x17318e(0xa88,0x930,0x2c,0x461)+'er','Keluar',_0x295ea5['QFDew'],_0x295ea5[_0x17318e(0x1211,0x1c09,0x11af,0x1826)]][_0x425890(0x6bb,0x291,0x21e,0x715)](_0x17aa6d[_0x425890(0x1ca,0x1e8,-0x28e,-0x5b5)]))return;let _0x1a7bd9=[_0x42fced['a'],_0x42fced['b']]['find'](_0x56afa1=>_0x56afa1!==_0x17aa6d[_0x17318e(0xe59,0x577,0x1627,0xc86)]);_0x17aa6d['copyNForwa'+'rd'](_0x1a7bd9,!![],_0x17aa6d[_0x425890(0xf30,0x807,0x29,0x5b0)]&&_0x17aa6d[_0x425890(0x96f,0x807,-0x1cb,0xce0)]['fromMe']?{'contextInfo':{..._0x17aa6d[_0x425890(-0x70,0x35d,0x617,-0x2b0)][_0x17318e(0x981,0x4a4,0x3fd,0x78d)+'o'],'forwardingScore':0x0,'isForwarded':!![],'participant':_0x1a7bd9}}:{});}return!(-0x421*0x4+-0x2553+-0x4d*-0xb3);}else{const _0x446176={};_0x446176[_0x425890(0x1abc,0x10a0,0x17aa,0x15b9)+'t']=_0x295ea5[_0x425890(0x811,0xcd1,0x1174,0x10f3)];const _0xdb751e={};_0xdb751e['buttonId']=_0x36cce4+'alive',_0xdb751e[_0x17318e(0x18d7,0x115d,0x1ca8,0x1318)]=_0x446176,_0xdb751e[_0x425890(0xd62,0x141b,0xe80,0x144c)]=0x1;const _0x46d44a={};_0x46d44a['displayTex'+'t']=_0x295ea5[_0x17318e(0xb68,0x370,0x2ad,0x5a1)];const _0x1d598a={};_0x1d598a[_0x17318e(0x16fb,0x14da,0x148a,0x1194)]=_0x4711ac+_0x17318e(0x131f,0xe6e,0x191d,0x1751),_0x1d598a[_0x17318e(0x12fe,0x92f,0xccd,0x1318)]=_0x46d44a,_0x1d598a[_0x425890(0x1761,0x141b,0xa4f,0xe21)]=0x1;let _0xb9e3fe=[_0xdb751e,_0x1d598a],_0x5a4cad={'image':{'url':_0x295ea5['MDtgg'](_0x1d8abe,_0x17318e(0x14ab,0x19bd,0x130c,0x1155))},'caption':_0x425890(-0x126,0x618,0x88,0xdef)+_0x227350+(_0x17318e(-0xdc,0xcb2,0x710,0x3b8)+_0x425890(0xb32,0xb1e,0x1240,0x14eb)+_0x17318e(0xe1c,0x8c3,-0x6,0x65d)+_0x17318e(0x1176,0x8c1,0x9dc,0x9c1)+'╠')+_0x15ce2f+'\x20'+_0x54d130+(_0x17318e(0x1d5e,0x20b5,0x1825,0x178d)+'┃╠')+_0x5c136e+'\x20'+_0x1e2fcf+(_0x17318e(0xbe9,0xe73,0x113c,0x8ce)+_0x425890(0x101,0x9f2,0xbdf,0x1414)+'╠')+_0x4e7bfe+'\x20'+_0x268c3b+(_0x17318e(0xf09,0x15cd,0x2084,0x1634)+_0x425890(0x114d,0xa46,0xee,0xa03))+_0x2d4940+'\x20'+_0x16d145+(_0x425890(0x4c8,0x990,0x559,0xd01)+_0x425890(0x39,0x432,0x506,-0x2c1))+_0x1614f4+'\x20'+_0x1ecef6+(_0x425890(0xb4f,0x16f,-0x6a7,-0x347)+_0x425890(0xe86,0x432,0xb2d,-0x1f9))+_0x47ad4b+'\x20'+_0x3584fe+(_0x17318e(0x83e,0xe4d,-0x1dc,0x7ba)+_0x17318e(0xbae,0xa0e,0x11de,0x9b4))+_0x1388c3+'\x20'+_0x197d65+(_0x425890(0x1584,0xf55,0xb4e,0x84b)+_0x17318e(0x2106,0x1d8b,0x1eba,0x16df))+_0x18f388+'\x20'+_0x5e6857+(_0x425890(-0x4aa,0x352,-0x665,0x38e)+_0x425890(0x194b,0x1287,0x1998,0x146e))+_0x5d7dba+'\x20'+_0xeb5dcb+(_0x17318e(0x1963,0x1cd4,0x15a4,0x12c8)+_0x425890(0x19d,0x73a,0x8dc,0x9b6))+_0x15606c+'\x20'+_0x7e0ca+('hidetag\x20[t'+_0x425890(0x5d6,0x432,0xec9,0x262))+_0x5accd1+'\x20'+_0x4e3107+('tagall\x20[te'+_0x425890(0x10eb,0xceb,0x13ef,0x147a))+_0x5061a9+'\x20'+_0xed3052+('antilink\x20['+_0x17318e(0x10c4,-0x12b,0xb48,0x79a))+_0x58aaf7+'\x20'+_0x8c16f2+(_0x425890(0xaed,0xafa,0x175,0x13ff)+_0x425890(0xea0,0x1066,0x6e6,0x1046))+_0x4c3814+'\x20'+_0x4968cd+(_0x17318e(0x117b,0x16bf,0x14ee,0x1170)+_0x17318e(0xa14,0x6c1,0x3a0,0xc6b)+'┃╠')+_0x1b19c2+'\x20'+_0xcac5c5+(_0x17318e(0x8b2,0x8c2,0x736,0x804)+_0x425890(0x1273,0xe15,0x176b,0x15dd)+'╠')+_0x1be7f3+'\x20'+_0x4e05f9+_0x425890(0xde1,0x355,0x5ad,-0x6db)+_0x1feac2+'\x20'+_0x385233+_0x425890(-0x49d,0x5f8,0x6de,-0x25a)+_0x1609ed+'\x20'+_0x23dc97+_0x425890(-0x5b,0x7f9,0xfc2,0x9be)+_0x48d772+'\x20'+_0x3980c1+('checkvote\x0a'+'┃╠')+_0x5230ee+'\x20'+_0x3c64fb+(_0x17318e(0xdc8,0xedb,0x3d5,0x6f1)+_0x17318e(0x1b14,0x1425,0x1b9c,0x157c)+_0x425890(-0x82,0x955,0x3bb,0x3b1))+_0x3b3f2a+_0x425890(0xd66,0x383,0x31,0xbb1),'footer':_0x5af972[_0x17318e(0x17ea,0xbeb,0x17dd,0x12db)][_0x425890(0x7db,0xe82,0x10a8,0xed6)],'buttons':_0xb9e3fe,'headerType':0x4};const _0x332431={};_0x332431[_0x425890(0xa40,0x807,-0x152,0x5e5)]=_0x3b3ad3,_0x50eb13[_0x425890(0xe8f,0x41f,0x648,-0x641)+'e'](_0x297691[_0x17318e(0x17d8,0xc5a,0x17b2,0xee4)],_0x5a4cad,_0x332431);}}if(_0x13557e&&_0x295ea5[_0x425890(0x13ca,0x1192,0xd74,0x1050)](_0x5af26d['toLowerCas'+'e'](),undefined)){if(_0x17aa6d[_0x425890(0xabb,0xcc7,0x14c6,0x1634)][_0x17318e(0x12d1,0x15cd,0xe94,0x140a)](_0x295ea5[_0x17318e(0xcc0,0x1596,0x15bb,0x1514)]))return;if(_0x17aa6d[_0x17318e(0x1872,0x1315,0xc85,0x1723)])return;let _0x3083df=global['db'][_0x425890(0xf1e,0xad0,0x1148,0x6cc)]['database'];if(!_0x295ea5[_0x17318e(0x1174,0x13c3,0x10c1,0x106f)](_0x5af26d[_0x17318e(0x873,0x65e,0x15db,0xd56)+'e'](),_0x3083df))return;_0x3797bd[_0x17318e(0xde6,0xc02,0xb2d,0x1154)+'rd'](_0x17aa6d[_0x17318e(0x16a1,0xf12,0x10ab,0xee4)],_0x3083df[_0x5af26d[_0x425890(0xb1c,0xb39,0xc26,0x13ad)+'e']()],!![]);}}}}catch(_0x5b8a2f){_0x295ea5['Ijfnd'](_0x295ea5[_0x17318e(0x1205,0x1bf0,0xd8e,0x146b)],_0x295ea5['CrTuW'])?_0x17aa6d[_0x425890(-0x14e,0x2b2,-0x7c,0xc0e)](util['format'](_0x5b8a2f)):_0x588c36+='🔰🌹\x20No\x20:\x20'+_0x20d361++ +(_0x17318e(0x1834,0xe72,0x1f92,0x17a1)+'\x20')+_0x499593[_0x17318e(0x1cec,0x1126,0xd49,0x1638)]+(_0x17318e(0xfc5,0x17d7,0x16d2,0x1021)+_0x17318e(0x1015,0x193c,0x1892,0x17df))+_0x49eba0[_0x17318e(0x850,0xec6,0xb67,0xa7b)]+(_0x17318e(0xab5,-0x5d4,0xc77,0x411)+':\x20')+_0x28a44e[_0x17318e(0x165c,0x1573,0x1155,0x120d)]+('\x0a🔰🌹\x20Views\x20'+':\x20')+_0x903758[_0x17318e(0x144,0xae9,0x1033,0xb51)]+(_0x17318e(0x1064,0x1539,0xdab,0xb19)+'on\x20:\x20')+_0x363df6[_0x17318e(0x1645,0x1105,0x5b1,0xe95)]+(_0x17318e(0x1459,0xc22,0x14fe,0xc4d)+_0x425890(0x1e1,0x4c0,0x23f,0x152))+_0x4fdaab['ago']+(_0x17318e(0xf8e,0x5c6,0x190,0x5b7)+_0x425890(0xba9,0x7ff,0x105f,0x3d3))+_0x273ce7[_0x425890(0xd39,0x361,-0x6d8,0x18e)][_0x425890(0x1247,0xe82,0x1007,0x8fa)]+_0x17318e(0x16fa,0xf7c,0x9ed,0x144a)+_0x3a9a95[_0x425890(0x38f,0x5f3,0x1d2,0xbdb)]+(_0x425890(0x213,0x2f0,-0x6c2,0x240)+'─────────\x0a'+_0x17318e(0x1ca2,0xa4c,0x1a75,0x13de)+_0x425890(-0x6b9,0x2c2,-0x46,0x12d))+_0x285a5c;}};function _0x5b581f(_0x95a3a1,_0x4f0f85,_0x2fbe40,_0x3344e5){return _0x5492(_0x95a3a1-0x1a3,_0x2fbe40);}let file=require[_0x5b581f(0xacb,0x206,0x272,0x130)](__filename);fs[_0x5b581f(0x16cb,0xf8c,0x15f1,0x170b)](file,()=>{const _0x329e5b={'GzYVy':function(_0x1d5ff2,_0x524d92){return _0x1d5ff2(_0x524d92);}};fs['unwatchFil'+'e'](file),console[_0x147aaa(-0x29,-0x72e,0x811,0x118)](chalk[_0x147aaa(0x4d3,0x102a,0x90b,0x937)]('Update\x20'+__filename));function _0x5600e2(_0x305d53,_0x17f8e2,_0x441786,_0x5c8158){return _0x3d80d7(_0x5c8158-0x589,_0x17f8e2-0x1a4,_0x305d53,_0x5c8158-0x178);}function _0x147aaa(_0x404f9e,_0x4be080,_0x37f062,_0x2df129){return _0x3d80d7(_0x2df129-0xfb,_0x4be080-0xfe,_0x4be080,_0x2df129-0x19c);}delete require['cache'][file],_0x329e5b[_0x5600e2(0x1599,0x7a2,0x1473,0xd0e)](require,file);}); diff --git a/app.json b/app.json index df4318a3e..5c2317888 100644 --- a/app.json +++ b/app.json @@ -1,8 +1,8 @@ { "name": "RED DRAGON BOT", - "description": "☬𝗥𝗘𝗗༒𝗗𝗥𝗔𝗚𝗢𝗡-𝗕𝗢𝗧࿐ | By: RED-DRAGONᵀᴹ | 𝐌𝐑: ☬𝔻𝔸ℝ𝕂༒ℕ𝕀𝕋ℝ𝕆࿐", + "description": "𝙍𝙀𝘿╺ 𝘿𝙍𝘼𝙂𝙊𝙉 - 𝘔𝘋 | By: RED-DRAGONᵀᴹ | 𝐌𝐑: ☬𝔻𝔸ℝ𝕂༒ℕ𝕀𝕋ℝ𝕆࿐", "repository": "https://github.com/prabhasha2006/Red-Dragon", - "logo": "https://i.ibb.co/CwffZ61/20220605-104552.jpg", + "logo": "https://i.ibb.co/VCtXyTK/20220730-002949.jpg", "keywords": ["nodejs", "bot", "whatsapp bot", "whatsapp automation", "multi device"], "buildpacks": [ { @@ -11,9 +11,6 @@ { "url": "https://github.com/jonathanong/heroku-buildpack-ffmpeg-latest" }, - { - "url": "https://github.com/yespark/heroku-imagemagick-buildpack" - }, { "url": "https://github.com/clhuang/heroku-buildpack-webp-binaries.git" } @@ -24,4 +21,4 @@ "size": "free" } } -} +} \ No newline at end of file diff --git a/boot.js b/boot.js new file mode 100644 index 000000000..9dea7f705 --- /dev/null +++ b/boot.js @@ -0,0 +1,798 @@ +/* + +█ █ █ █ █▅ ▅█ █ █ ██████ █ █ █ █ +█ █ █ █ █ █ █ █ █ █ █ █ █ █ █ +██ █ █ █ █ █ █ █ █ ████████ █ █ +█ █ █ █ █ █ █ █ █ █ █ █ █ +█ █ ▀▅▃▅▀ █ █ ▀▅▃▅▀ █ █ █ ▀▅▃▅▀ +╦ ╦ ╔══╗ ╦ ╦ ╔══╗ ╦ ╦ ╦ ╔══╗ + +╔═══❤️═══🧡═══💛═══🤍═══💚═══💙═══💜═══╗ +║ +║ +║ +╠🆁🅴🅳╬🅳🆁🅰🅶🅾🅽╣ 𝘾𝙧𝙚𝙖𝙩𝙚𝙙 𝘽𝙮 [`𝗞.𝗣𝗿𝗮𝗯𝗵𝗮𝘀𝗵𝗮´] +║ +║ +║ +╠═𝕆𝔹𝔽𝕌𝕊ℂ𝔸𝕋𝔼𝔻═𝔹𝕐═╣ 😎𝙆.𝙋𝙧𝙖𝙗𝙝𝙖𝙨𝙝𝙖❯❯ +║ +╠═══════(github.com/prabhasha2006)═══════╣ +║ +║ ▒ ▒ ▒ ▒ ▒ ▒ ▒ ▒ ▒ ▒ +║ ▒ ▒ ▒ ▒ ▒ +║ ▒ ▒ ▒ ▒ ▒ +║ ▒ ▒ ▒ ▒ ▒ +║ ▒ ▒ ▒ ▒ ▒ +║ ▒ ▒ ▒ ▒ ▒ +║ ▒ ▒ ▒ ▒ ▒ ▒ +║ +║ +╚═══❤️═══🧡═══💛═══🤍═══💚═══💙═══💜═══╝ + +*/ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +require('./settings') +const { default: KUMUTHUConnect, useSingleFileAuthState, DisconnectReason, fetchLatestBaileysVersion, generateForwardMessageContent, prepareWAMessageMedia, generateWAMessageFromContent, generateMessageID, downloadContentFromMessage, makeInMemoryStore, jidDecode, proto } = require("@adiwajshing/baileys") +const { state, saveState } = useSingleFileAuthState(`./${sessionName}.json`) +const pino = require('pino') +const { Boom } = require('@hapi/boom') +const fs = require('fs') +const yargs = require('yargs/yargs') +const chalk = require('chalk') +const FileType = require('file-type') +const path = require('path') +const PhoneNumber = require('awesome-phonenumber') +const { imageToWebp, videoToWebp, writeExifImg, writeExifVid } = require('./lib/exif') +const { smsg, isUrl, generateMessageTag, getBuffer, getSizeMedia, fetchJson, await, sleep } = require('./lib/myfunc') +const moment = require('moment-timezone') + +var low +try { + low = require('lowdb') +} catch (e) { + low = require('./lib/lowdb') +} + +const { Low, JSONFile } = low +const mongoDB = require('./lib/mongoDB') + +global.api = (name, path = '/', query = {}, apikeyqueryname) => (name in global.APIs ? global.APIs[name] : name) + path + (query || apikeyqueryname ? '?' + new URLSearchParams(Object.entries({ ...query, ...(apikeyqueryname ? { [apikeyqueryname]: global.APIKeys[name in global.APIs ? global.APIs[name] : name] } : {}) })) : '') + +const store = makeInMemoryStore({ logger: pino().child({ level: 'silent', stream: 'store' }) }) + +global.opts = new Object(yargs(process.argv.slice(2)).exitProcess(false).parse()) +global.db = new Low( + /https?:\/\//.test(opts['db'] || '') ? + new cloudDBAdapter(opts['db']) : /mongodb/.test(opts['db']) ? + new mongoDB(opts['db']) : + new JSONFile(`Android/database/database.json`) +) +global.db.data = { + users: {}, + chats: {}, + database: {}, + game: {}, + settings: {}, + others: {}, + sticker: {}, + ...(global.db.data || {}) +} + +// save database every 30seconds +if (global.db) setInterval(async () => { + if (global.db.data) await global.db.write() + }, 30 * 1000) + +async function startKUMUTHU() { + const KUMUTHU = KUMUTHUConnect({ + logger: pino({ level: 'silent' }), + printQRInTerminal: true, + browser: ['Subscribe Xeon','Safari','1.0.0'], + auth: state + }) + + store.bind(KUMUTHU.ev) + + // anticall auto block + if (global.callblock === "true"){ + KUMUTHU.ws.on('CB:call', async (json) => { + const callerId = json.content[0].attrs['call-creator'] + if (json.content[0].tag == 'offer') { + let xeonfek = await KUMUTHU.sendContact(callerId, global.owner) + KUMUTHU.sendMessage(callerId, { text: `⚠️RED-DRAGON Automatic Block System!\n⚠️Don't Call Bot!\n⚠️Please Ask Or Contact The Owner To Unblock You!`}, { quoted : xeonfek }) + await sleep(8000) + await KUMUTHU.updateBlockStatus(callerId, "block") + } + })}else{} + + KUMUTHU.ev.on('messages.upsert', async chatUpdate => { + //console.log(JSON.stringify(chatUpdate, undefined, 2)) + try { + mek = chatUpdate.messages[0] + if (!mek.message) return + mek.message = (Object.keys(mek.message)[0] === 'ephemeralMessage') ? mek.message.ephemeralMessage.message : mek.message + if (mek.key && mek.key.remoteJid === 'status@broadcast') return + if (!KUMUTHU.public && !mek.key.fromMe && chatUpdate.type === 'notify') return + if (mek.key.id.startsWith('BAE5') && mek.key.id.length === 16) return + m = smsg(KUMUTHU, mek, store) + require("./Red-Dragon")(KUMUTHU, m, chatUpdate, store) + } catch (err) { + console.log(err) + } + }) + + // Group Update + KUMUTHU.ev.on('groups.update', async pea => { + //console.log(pea) + // Get Profile Picture Group + try { + ppgc = await KUMUTHU.profilePictureUrl(pea[0].id, 'image') + } catch { + ppgc = 'https://shortlink.KUMUTHUarridho.my.id/rg1oT' + } + let lolXeon = { url : ppgc } + if (pea[0].announce == true) { + KMUTHU.send5ButImg(pea[0].id, `🪀 Group Settings Changed 🪀\n\nThe Group Has Been Closed By Admin, Now Only Admin Can Send Messages !`, `Group Settings Change Message`, wm_fatih, []) + } else if(pea[0].announce == false) { + KMUTHU.send5ButImg(pea[0].id, `🪀 Group Settings Changed 🪀\n\nThe Group Has Been Opened By Admin, Now Participants Can Send Messages !`, `Group Settings Change Message`, wm_fatih, []) + } else if (pea[0].restrict == true) { + KMUTHU.send5ButImg(pea[0].id, `🪀 Group Settings Changed 🪀\n\nGroup Info Has Been Restricted, Now Only Admin Can Edit Group Info !`, `Group Settings Change Message`, wm_fatih, []) + } else if (pea[0].restrict == false) { + KMUTHU.send5ButImg(pea[0].id, `🪀 Group Settings Changed 🪀\n\nGroup Info Has Been Opened, Now Participants Can Edit Group Info !`, `Group Settings Change Message`, wm_fatih, []) + } else { + KMUTHU.send5ButImg(pea[0].id, `🪀 Group Settings Changed 🪀\n\nGroup Subject Has Been Changed To *${pea[0].subject}*`, `Group Settings Change Message`, wm_fatih, []) + } + }) + + //randoming function +function pickRandom(list) { +return list[Math.floor(list.length * Math.random())] +} +//document randomizer +let documents = [doc1,doc2,doc3,doc4,doc5,doc6] +let docs = pickRandom(documents) + + KUMUTHU.ev.on('group-participants.update', async (anu) => { + console.log(anu) + try { + let metadata = await KUMUTHU.groupMetadata(anu.id) + let participants = anu.participants + for (let num of participants) { + // Get Profile Picture User + try { + ppuser = await KUMUTHU.profilePictureUrl(num, 'image') + } catch { + ppuser = 'https://i0.wp.com/www.gambarunik.id/wp-content/uploads/2019/06/Top-Gambar-Foto-Profil-Kosong-Lucu-Tergokil-.jpg' + } + + //Get Profile Picture Group\\ + try { + ppgroup = await KUMUTHU.profilePictureUrl(anu.id, 'image') + } catch { + ppgroup = 'https://i0.wp.com/www.gambarunik.id/wp-content/uploads/2019/06/Top-Gambar-Foto-Profil-Kosong-Lucu-Tergokil-.jpg' + } + +//welcome\\ + let nama = await KUMUTHU.getName(num) +memb = metadata.participants.length +XeonWlcm = await getBuffer(`https://hardianto.xyz/api/welcome3?profile=${encodeURIComponent(ppuser)}&name=${encodeURIComponent(nama)}&bg=https://telegra.ph/file/d460e086f9f9bf6b04e17.jpg&namegb=${encodeURIComponent(metadata.subject)}&member=${encodeURIComponent(memb)}`) +XeonLft = await getBuffer(`https://hardianto.xyz/api/goodbye3?profile=${encodeURIComponent(ppuser)}&name=${encodeURIComponent(nama)}&bg=https://telegra.ph/file/d460e086f9f9bf6b04e17.jpg&namegb=${encodeURIComponent(metadata.subject)}&member=${encodeURIComponent(memb)}`) + if (anu.action == 'add') { + const xeonbuffer = await getBuffer(ppuser) + let xeonName = num + const xtime = moment.tz('Asia/Kolkata').format('HH:mm:ss') + const xdate = moment.tz('Asia/Kolkata').format('YYYY/MM/DD') + const xmembers = metadata.participants.length + let unicorndoc = {key: {fromMe: false,"participant":"0@s.whatsapp.net", "remoteJid": "916909137213-1604595598@g.us"}, "message": {orderMessage: {itemCount: 9999999,status: 200, thumbnail: XeonWlcm, surface: 200, message: `${metadata.subject}`, orderTitle: 'xeon', sellerJid: '0@s.whatsapp.net'}}, contextInfo: {"forwardingScore":999,"isForwarded":true},sendEphemeral: true} + xeonbody = `🤭🌹 Hi👋 @${xeonName.split("@")[0]} + +🤭🌹 Welcome To ${metadata.subject} +🤭🌹 ${xmembers} Members + +Date = ${xdate} +Time = ${xtime} ` + //if you copy the code value, + //dont forget to put my name(Xeon) as credit + //you fail to put, i sue you for sure! + let buttons = [ + {buttonId: `owner`, buttonText: {displayText: '🙏WELCOME🙏'}, type: 1} + ] +let buttonMessage = { + image: { url: 'https://i.ibb.co/0h3Sv26/20220805-080104.jpg'}, +caption: xeonbody, +footer: `${footer}`, +buttons, +headerType: 4 +} +if(global.welcom_msg === "false")return +KUMUTHU.sendMessage(anu.id, buttonMessage) + } else if (anu.action == 'remove') { + const xeonbuffer = await getBuffer(ppuser) + const xeontime = moment.tz('Asia/Kolkata').format('HH:mm:ss') + const xeondate = moment.tz('Asia/Kolkata').format('YYYY/MM/DD') + let xeonName = num + const xeonmembers = metadata.participants.length + let unicorndoc = {key: {fromMe: false,"participant":"0@s.whatsapp.net", "remoteJid": "916909137213-1604595598@g.us"}, "message": {orderMessage: {itemCount: 9999999,status: 200, thumbnail: xeonbuffer, surface: 200, message: `${metadata.subject}`, orderTitle: 'xeon', sellerJid: '0@s.whatsapp.net'}}, contextInfo: {"forwardingScore":999,"isForwarded":true},sendEphemeral: true} + xeonbody = `😒🌹 Bye👋 @${xeonName.split("@")[0]} + +😒🌹 Left From ${metadata.subject} +😒🌹 ${xeonmembers} Members + +Date = ${xeondate} +Time = ${xeontime} ` + + let buttons = [ + {buttonId: `owner`, buttonText: {displayText: '👎BYE👎'}, type: 1} + ] + let buttonMessage = { + image: { url: 'https://i.ibb.co/H4h3mh4/20220805-080200.jpg'}, + caption: xeonbody, + footer: `${footer}`, + buttons, + headerType: 4 + } + if(global.welcom_msg === "false")return +KUMUTHU.sendMessage(anu.id, buttonMessage) + } + } + } catch (err) { + console.log(err) + } + }) + + //Setting\\ + KUMUTHU.decodeJid = (jid) => { + if (!jid) return jid + if (/:\d+@/gi.test(jid)) { + let decode = jidDecode(jid) || {} + return decode.user && decode.server && decode.user + '@' + decode.server || jid + } else return jid + } + + KUMUTHU.ev.on('contacts.update', update => { + for (let contact of update) { + let id = KUMUTHU.decodeJid(contact.id) + if (store && store.contacts) store.contacts[id] = { id, name: contact.notify } + } + }) + + KUMUTHU.getName = (jid, withoutContact = false) => { + id = KUMUTHU.decodeJid(jid) + withoutContact = KUMUTHU.withoutContact || withoutContact + let v + if (id.endsWith("@g.us")) return new Promise(async (resolve) => { + v = store.contacts[id] || {} + if (!(v.name || v.subject)) v = KUMUTHU.groupMetadata(id) || {} + resolve(v.name || v.subject || PhoneNumber('+' + id.replace('@s.whatsapp.net', '')).getNumber('international')) + }) + else v = id === '0@s.whatsapp.net' ? { + id, + name: 'WhatsApp' + } : id === KUMUTHU.decodeJid(KUMUTHU.user.id) ? + KUMUTHU.user : + (store.contacts[id] || {}) + return (withoutContact ? '' : v.name) || v.subject || v.verifiedName || PhoneNumber('+' + jid.replace('@s.whatsapp.net', '')).getNumber('international') + } + + KUMUTHU.sendContact = async (jid, kon, quoted = '', opts = {}) => { + let list = [] + for (let i of kon) { + list.push({ + displayName: await KUMUTHU.getName(i + '@s.whatsapp.net'), + vcard: `BEGIN:VCARD\nVERSION:3.0\nN:${await KUMUTHU.getName(i + '@s.whatsapp.net')}\nFN:${global.ownername}\nitem1.TEL;waid=${i}:${i}\nitem1.X-ABLabel:Click here to chat\nitem2.EMAIL;type=INTERNET:${global.ytname}\nitem2.X-ABLabel:YouTube\nitem3.URL:${global.socialm}\nitem3.X-ABLabel:GitHub\nitem4.ADR:;;${global.location};;;;\nitem4.X-ABLabel:Region\nEND:VCARD` + ////////////////////////////////////////////////////////////vcard: `BEGIN:VCARD\nVERSION:3.0\nN:${ownername}\nitem1.TEL;waid=${i}:${i}\nitem1.X-ABLabel:Click To Chat\nitem2.EMAIL;type=INTERNET:${botscript}\nitem2.X-ABLabel:Script\nitem3.URL:${btnurl}\nitem3.X-ABLabel:Script\nitem4.ADR:;;${location};;;;\nitem4.X-ABLabel:Region\nEND:VCARD` + }) + } + KUMUTHU.sendMessage(jid, { contacts: { displayName: `${list.length} Contact`, contacts: list }, ...opts }, { quoted }) + } + + KUMUTHU.setStatus = (status) => { + KUMUTHU.query({ + tag: 'iq', + attrs: { + to: '@s.whatsapp.net', + type: 'set', + xmlns: 'status', + }, + content: [{ + tag: 'status', + attrs: {}, + content: Buffer.from(status, 'utf-8') + }] + }) + return status + } + + KUMUTHU.public = true + + KUMUTHU.serializeM = (m) => smsg(KUMUTHU, m, store) + + KUMUTHU.ev.on('connection.update', async (update) => { + const { connection, lastDisconnect } = update + if (connection === 'close') { + let reason = new Boom(lastDisconnect?.error)?.output.statusCode + if (reason === DisconnectReason.badSession) { console.log(`Bad Session File, Please Delete Session and Scan Again`); KUMUTHU.logout(); } + else if (reason === DisconnectReason.connectionClosed) { console.log("🦄Connection closed, reconnecting...."); startKUMUTHU(); } + else if (reason === DisconnectReason.connectionLost) { console.log("🦄Connection Lost from Server, reconnecting..."); startKUMUTHU(); } + else if (reason === DisconnectReason.connectionReplaced) { console.log("🦄Connection Replaced, Another New Session Opened, Please Close Current Session First"); KUMUTHU.logout(); } + else if (reason === DisconnectReason.loggedOut) { console.log(`🦄Device Logged Out, Please Scan Again And Run.`); KUMUTHU.logout(); } + else if (reason === DisconnectReason.restartRequired) { console.log("🦄Restart Required, Restarting..."); startKUMUTHU(); } + else if (reason === DisconnectReason.timedOut) { console.log("🦄Connection TimedOut, Reconnecting..."); startKUMUTHU(); } + else KUMUTHU.end(`🦄Unknown DisconnectReason: ${reason}|${connection}`) + } + console.log('Connected...', update) + }) + + KUMUTHU.ev.on('creds.update', saveState) + + // Add Other + /** Send Button 5 Image + * + * @param {*} jid + * @param {*} text + * @param {*} footer + * @param {*} image + * @param [*] button + * @param {*} options + * @returns + */ + KUMUTHU.send5ButImg = async (jid , text = '' , footer = '', img, but = [], options = {}) =>{ + let message = await prepareWAMessageMedia({ image: img }, { upload: KUMUTHU.waUploadToServer }) + var template = generateWAMessageFromContent(m.chat, proto.Message.fromObject({ + templateMessage: { + hydratedTemplate: { + imageMessage: message.imageMessage, + "hydratedContentText": text, + "hydratedFooterText": footer, + "hydratedButtons": but + } + } + }), options) + KUMUTHU.relayMessage(jid, template.message, { messageId: template.key.id }) + } + + /** + * + * @param {*} jid + * @param {*} buttons + * @param {*} caption + * @param {*} footer + * @param {*} quoted + * @param {*} options + */ + KUMUTHU.sendButtonText = (jid, buttons = [], text, footer, quoted = '', options = {}) => { + let buttonMessage = { + text, + footer, + buttons, + headerType: 2, + ...options + } + KUMUTHU.sendMessage(jid, buttonMessage, { quoted, ...options }) + } + + /** + * + * @param {*} jid + * @param {*} text + * @param {*} quoted + * @param {*} options + * @returns + */ + KUMUTHU.sendText = (jid, text, quoted = '', options) => KUMUTHU.sendMessage(jid, { text: text, ...options }, { quoted }) + + /** + * + * @param {*} jid + * @param {*} path + * @param {*} caption + * @param {*} quoted + * @param {*} options + * @returns + */ + KUMUTHU.sendImage = async (jid, path, caption = '', quoted = '', options) => { + let buffer = Buffer.isBuffer(path) ? path : /^data:.*?\/.*?;base64,/i.test(path) ? Buffer.from(path.split`,`[1], 'base64') : /^https?:\/\//.test(path) ? await (await getBuffer(path)) : fs.existsSync(path) ? fs.readFileSync(path) : Buffer.alloc(0) + return await KUMUTHU.sendMessage(jid, { image: buffer, caption: caption, ...options }, { quoted }) + } + + /** + * + * @param {*} jid + * @param {*} path + * @param {*} caption + * @param {*} quoted + * @param {*} options + * @returns + */ + KUMUTHU.sendVideo = async (jid, path, caption = '', quoted = '', gif = false, options) => { + let buffer = Buffer.isBuffer(path) ? path : /^data:.*?\/.*?;base64,/i.test(path) ? Buffer.from(path.split`,`[1], 'base64') : /^https?:\/\//.test(path) ? await (await getBuffer(path)) : fs.existsSync(path) ? fs.readFileSync(path) : Buffer.alloc(0) + return await KUMUTHU.sendMessage(jid, { video: buffer, caption: caption, gifPlayback: gif, ...options }, { quoted }) + } + + /** + * + * @param {*} jid + * @param {*} path + * @param {*} quoted + * @param {*} mime + * @param {*} options + * @returns + */ + KUMUTHU.sendAudio = async (jid, path, quoted = '', ptt = false, options) => { + let buffer = Buffer.isBuffer(path) ? path : /^data:.*?\/.*?;base64,/i.test(path) ? Buffer.from(path.split`,`[1], 'base64') : /^https?:\/\//.test(path) ? await (await getBuffer(path)) : fs.existsSync(path) ? fs.readFileSync(path) : Buffer.alloc(0) + return await KUMUTHU.sendMessage(jid, { audio: buffer, ptt: ptt, ...options }, { quoted }) + } + + /** + * + * @param {*} jid + * @param {*} text + * @param {*} quoted + * @param {*} options + * @returns + */ + KUMUTHU.sendTextWithMentions = async (jid, text, quoted, options = {}) => KUMUTHU.sendMessage(jid, { text: text, contextInfo: { mentionedJid: [...text.matchAll(/@(\d{0,16})/g)].map(v => v[1] + '@s.whatsapp.net') }, ...options }, { quoted }) + + /** + * + * @param {*} jid + * @param {*} path + * @param {*} quoted + * @param {*} options + * @returns + */ + KUMUTHU.sendImageAsSticker = async (jid, path, quoted, options = {}) => { + let buff = Buffer.isBuffer(path) ? path : /^data:.*?\/.*?;base64,/i.test(path) ? Buffer.from(path.split`,`[1], 'base64') : /^https?:\/\//.test(path) ? await (await getBuffer(path)) : fs.existsSync(path) ? fs.readFileSync(path) : Buffer.alloc(0) + let buffer + if (options && (options.packname || options.author)) { + buffer = await writeExifImg(buff, options) + } else { + buffer = await imageToWebp(buff) + } + + await KUMUTHU.sendMessage(jid, { sticker: { url: buffer }, ...options }, { quoted }) + return buffer + } + + /** + * + * @param {*} jid + * @param {*} path + * @param {*} quoted + * @param {*} options + * @returns + */ + KUMUTHU.sendVideoAsSticker = async (jid, path, quoted, options = {}) => { + let buff = Buffer.isBuffer(path) ? path : /^data:.*?\/.*?;base64,/i.test(path) ? Buffer.from(path.split`,`[1], 'base64') : /^https?:\/\//.test(path) ? await (await getBuffer(path)) : fs.existsSync(path) ? fs.readFileSync(path) : Buffer.alloc(0) + let buffer + if (options && (options.packname || options.author)) { + buffer = await writeExifVid(buff, options) + } else { + buffer = await videoToWebp(buff) + } + + await KUMUTHU.sendMessage(jid, { sticker: { url: buffer }, ...options }, { quoted }) + return buffer + } + + /** + * + * @param {*} message + * @param {*} filename + * @param {*} attachExtension + * @returns + */ + KUMUTHU.downloadAndSaveMediaMessage = async (message, filename, attachExtension = true) => { + let quoted = message.msg ? message.msg : message + let mime = (message.msg || message).mimetype || '' + let messageType = message.mtype ? message.mtype.replace(/Message/gi, '') : mime.split('/')[0] + const stream = await downloadContentFromMessage(quoted, messageType) + let buffer = Buffer.from([]) + for await(const chunk of stream) { + buffer = Buffer.concat([buffer, chunk]) + } + let type = await FileType.fromBuffer(buffer) + trueFileName = attachExtension ? (filename + '.' + type.ext) : filename + // save to file + await fs.writeFileSync(trueFileName, buffer) + return trueFileName + } + + KUMUTHU.downloadMediaMessage = async (message) => { + let mime = (message.msg || message).mimetype || '' + let messageType = message.mtype ? message.mtype.replace(/Message/gi, '') : mime.split('/')[0] + const stream = await downloadContentFromMessage(message, messageType) + let buffer = Buffer.from([]) + for await(const chunk of stream) { + buffer = Buffer.concat([buffer, chunk]) + } + + return buffer + } + + /** + * + * @param {*} jid + * @param {*} path + * @param {*} filename + * @param {*} caption + * @param {*} quoted + * @param {*} options + * @returns + */ + KUMUTHU.sendMedia = async (jid, path, fileName = '', caption = '', quoted = '', options = {}) => { + let types = await KUMUTHU.getFile(path, true) + let { mime, ext, res, data, filename } = types + if (res && res.status !== 200 || file.length <= 65536) { + try { throw { json: JSON.parse(file.toString()) } } + catch (e) { if (e.json) throw e.json } + } + let type = '', mimetype = mime, pathFile = filename + if (options.asDocument) type = 'document' + if (options.asSticker || /webp/.test(mime)) { + let { writeExif } = require('./lib/exif') + let media = { mimetype: mime, data } + pathFile = await writeExif(media, { packname: options.packname ? options.packname : global.packname, author: options.author ? options.author : global.author, categories: options.categories ? options.categories : [] }) + await fs.promises.unlink(filename) + type = 'sticker' + mimetype = 'image/webp' + } + else if (/image/.test(mime)) type = 'image' + else if (/video/.test(mime)) type = 'video' + else if (/audio/.test(mime)) type = 'audio' + else type = 'document' + await KUMUTHU.sendMessage(jid, { [type]: { url: pathFile }, caption, mimetype, fileName, ...options }, { quoted, ...options }) + return fs.promises.unlink(pathFile) + } + + /** + * + * @param {*} jid + * @param {*} message + * @param {*} forceForward + * @param {*} options + * @returns + */ + KUMUTHU.copyNForward = async (jid, message, forceForward = false, options = {}) => { + let vtype + if (options.readViewOnce) { + message.message = message.message && message.message.ephemeralMessage && message.message.ephemeralMessage.message ? message.message.ephemeralMessage.message : (message.message || undefined) + vtype = Object.keys(message.message.viewOnceMessage.message)[0] + delete(message.message && message.message.ignore ? message.message.ignore : (message.message || undefined)) + delete message.message.viewOnceMessage.message[vtype].viewOnce + message.message = { + ...message.message.viewOnceMessage.message + } + } + + let mtype = Object.keys(message.message)[0] + let content = await generateForwardMessageContent(message, forceForward) + let ctype = Object.keys(content)[0] + let context = {} + if (mtype != "conversation") context = message.message[mtype].contextInfo + content[ctype].contextInfo = { + ...context, + ...content[ctype].contextInfo + } + const waMessage = await generateWAMessageFromContent(jid, content, options ? { + ...content[ctype], + ...options, + ...(options.contextInfo ? { + contextInfo: { + ...content[ctype].contextInfo, + ...options.contextInfo + } + } : {}) + } : {}) + await KUMUTHU.relayMessage(jid, waMessage.message, { messageId: waMessage.key.id }) + return waMessage + } + + KUMUTHU.cMod = (jid, copy, text = '', sender = KUMUTHU.user.id, options = {}) => { + //let copy = message.toJSON() + let mtype = Object.keys(copy.message)[0] + let isEphemeral = mtype === 'ephemeralMessage' + if (isEphemeral) { + mtype = Object.keys(copy.message.ephemeralMessage.message)[0] + } + let msg = isEphemeral ? copy.message.ephemeralMessage.message : copy.message + let content = msg[mtype] + if (typeof content === 'string') msg[mtype] = text || content + else if (content.caption) content.caption = text || content.caption + else if (content.text) content.text = text || content.text + if (typeof content !== 'string') msg[mtype] = { + ...content, + ...options + } + if (copy.key.participant) sender = copy.key.participant = sender || copy.key.participant + else if (copy.key.participant) sender = copy.key.participant = sender || copy.key.participant + if (copy.key.remoteJid.includes('@s.whatsapp.net')) sender = sender || copy.key.remoteJid + else if (copy.key.remoteJid.includes('@broadcast')) sender = sender || copy.key.remoteJid + copy.key.remoteJid = jid + copy.key.fromMe = sender === KUMUTHU.user.id + + return proto.WebMessageInfo.fromObject(copy) + } + + +//send 5 button image by xeon + KUMUTHU.send5ButImg = async (jid , text = '' , footer = '', img, but = [], thumb, options = {}) =>{ + let message = await prepareWAMessageMedia({ image: img, jpegThumbnail:thumb }, { upload: KUMUTHU.waUploadToServer }) + var template = generateWAMessageFromContent(m.chat, proto.Message.fromObject({ + templateMessage: { + hydratedTemplate: { + imageMessage: message.imageMessage, + "hydratedContentText": text, + "hydratedFooterText": footer, + "hydratedButtons": but + } + } + }), options) + KUMUTHU.relayMessage(jid, template.message, { messageId: template.key.id }) + } + + + //send5butvid by xeon + KUMUTHU.send5ButVid = async (jid , text = '' , footer = '', vid, but = [], options = {}) =>{ + let message = await prepareWAMessageMedia({ video: vid }, { upload: KUMUTHU.waUploadToServer }) + var template = generateWAMessageFromContent(jid, proto.Message.fromObject({ + templateMessage: { + hydratedTemplate: { + videoMessage: message.videoMessage, + "hydratedContentText": text, + "hydratedFooterText": footer, + "hydratedButtons": but + } + } + }), options) + KUMUTHU.relayMessage(jid, template.message, { messageId: template.key.id }) + } + + + //send5butmsg by xeon + KUMUTHU.send5ButMsg = (jid, text = '' , footer = '', but = []) =>{ + let templateButtons = but + var templateMessage = { + text: text, + footer: footer, + templateButtons: templateButtons + } + KUMUTHU.sendMessage(jid, templateMessage) + } + + +//sendlistmsg by xeon + KUMUTHU.sendListMsg = (jid, text = '', footer = '', title = '' , butText = '', sects = [], quoted) => { + let sections = sects + var listMes = { + text: text, + footer: footer, + title: title, + buttonText: butText, + sections + } + KUMUTHU.sendMessage(jid, listMes, { quoted: quoted }) + } + + + //send5butgif by xeon + KUMUTHU.send5ButGif = async (jid , text = '' , footer = '', gif, but = [], options = {}) =>{ + let message = await prepareWAMessageMedia({ video: gif, gifPlayback: true }, { upload: KUMUTHU.waUploadToServer }) + var template = generateWAMessageFromContent(jid, proto.Message.fromObject({ + templateMessage: { + hydratedTemplate: { + videoMessage: message.videoMessage, + "hydratedContentText": text, + "hydratedFooterText": footer, + "hydratedButtons": but + } + } + }), options) + KUMUTHU.relayMessage(jid, template.message, { messageId: template.key.id }) + } + + + /** + * + * @param {*} path + * @returns + */ + KUMUTHU.getFile = async (PATH, save) => { + let res + let data = Buffer.isBuffer(PATH) ? PATH : /^data:.*?\/.*?;base64,/i.test(PATH) ? Buffer.from(PATH.split`,`[1], 'base64') : /^https?:\/\//.test(PATH) ? await (res = await getBuffer(PATH)) : fs.existsSync(PATH) ? (filename = PATH, fs.readFileSync(PATH)) : typeof PATH === 'string' ? PATH : Buffer.alloc(0) + //if (!Buffer.isBuffer(data)) throw new TypeError('Result is not a buffer') + let type = await FileType.fromBuffer(data) || { + mime: 'application/octet-stream', + ext: '.bin' + } + filename = path.join(__filename, '../Android/src/' + new Date * 1 + '.' + type.ext) + if (data && save) fs.promises.writeFile(filename, data) + return { + res, + filename, + size: await getSizeMedia(data), + ...type, + data + } + + } + + return KUMUTHU +} + +startKUMUTHU() + + +let file = require.resolve(__filename) +fs.watchFile(file, () => { + fs.unwatchFile(file) + console.log(chalk.redBright(`Update ${__filename}`)) + delete require.cache[file] + require(file) +}) diff --git a/database/N3XU5-53R b/database/N3XU5-53R deleted file mode 100644 index 8b1378917..000000000 --- a/database/N3XU5-53R +++ /dev/null @@ -1 +0,0 @@ - diff --git a/database/database.json b/database/database.json deleted file mode 100644 index ad861674e..000000000 --- a/database/database.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "users": { - "12496030270@s.whatsapp.net": { - "afkTime": -1, - "afkReason": "", - "limit": "Infinity" - } - }, - "chats": { - "916909137213-1632759248@g.us": { - "mute": false, - "antilink": false - } - }, - "database": {}, - "game": { - "tebaklagu": [], - "family100": [], - "math": [], - "tebakgambar": [], - "tebakkata": [], - "lontong": [], - "lontong_desk": [], - "kalimat": [], - "lirik": [], - "tebakan": [] - }, - "settings": { - "12496030270@s.whatsapp.net": { - "status": 0, - "autobio": false - } - }, - "others": { - "vote": [] - }, - "sticker": {} -} \ No newline at end of file diff --git a/database/imagi.json b/database/imagi.json deleted file mode 100644 index 9e45c67d3..000000000 --- a/database/imagi.json +++ /dev/null @@ -1 +0,0 @@ -["prabhasha","RedDragon"] diff --git a/database/setik.json b/database/setik.json deleted file mode 100644 index da287c7a7..000000000 --- a/database/setik.json +++ /dev/null @@ -1 +0,0 @@ -["hi","Hi","Gm","ado","amo amo","apoi","hutto","left","yako","ආදරෙයි","nexusnw","ආසයි","කුක්කු","දන්නෑ","හී","හේ හේ","😊","😡","🙂","🤭","❤️"] diff --git a/database/video.json b/database/video.json deleted file mode 100644 index c112db028..000000000 --- a/database/video.json +++ /dev/null @@ -1 +0,0 @@ -["RedDragonVideo"] diff --git a/database/vien.json b/database/vien.json deleted file mode 100644 index 03902e9b3..000000000 --- a/database/vien.json +++ /dev/null @@ -1 +0,0 @@ -["Hi","hi","Dragon","Gm","Gn","Good Morning","Good Night","I love you","love","fuck you","info","kumuthu","අනේ පලයන් බන් යන්න","ආව් ආව්","ඉම්හි ඉම්හි","හායි","හු#%","😂","😎","❤️","🥲"] diff --git a/index.js b/index.js deleted file mode 100644 index bcf5e1413..000000000 --- a/index.js +++ /dev/null @@ -1,5 +0,0 @@ -// RED-DRAGON-BOT ==(MD)==// - -// Kumuthu Prabhasha // - -(function(_0x290eb5,_0x129c44){function _0x14fd57(_0x5d66de,_0x22b4eb,_0x227f28,_0x558c65){return _0x36fa(_0x5d66de- -0x319,_0x22b4eb);}function _0x38a140(_0x23e9f8,_0x3b4781,_0x4e630b,_0x4663fe){return _0x36fa(_0x23e9f8-0x233,_0x4e630b);}const _0x4f9f28=_0x290eb5();while(!![]){try{const _0x53b029=-parseInt(_0x38a140(0x3dd,0x3b3,0x3da,0x453))/(0x75d+-0x2*-0x146+0x27a*-0x4)+-parseInt(_0x38a140(0x453,0x546,0x40d,0x3dd))/(-0x5e6+-0xc*0x23e+-0x54*-0x64)*(parseInt(_0x14fd57(0x50,0xa5,-0x5e,0x8e))/(-0x1b92+-0x2*-0x2fc+0x159d))+parseInt(_0x38a140(0x4be,0x5a4,0x532,0x4ae))/(-0x21d7*-0x1+-0x4a3*0x1+-0x1d30)+-parseInt(_0x38a140(0x3e7,0x483,0x36f,0x3cc))/(0x13*-0x145+0x14ff+-0xa1*-0x5)*(-parseInt(_0x38a140(0x4ed,0x420,0x5ec,0x492))/(-0x36+-0x22d*0x3+0x1*0x6c3))+-parseInt(_0x14fd57(0x31,0x10c,0x28,0xbf))/(-0x78e*-0x1+0x5fc+-0xd83*0x1)+-parseInt(_0x14fd57(0x8,0x8f,0xd5,0x9e))/(-0x2357+0x1*-0x1bd3+0x3f32*0x1)*(parseInt(_0x14fd57(-0x93,-0x96,-0x12d,-0x112))/(-0x1c27+0x16aa+0x586))+parseInt(_0x14fd57(-0x12e,-0x1ed,-0x145,-0x201))/(0x35*-0xae+-0x1e3b+0x424b)*(parseInt(_0x38a140(0x571,0x522,0x4c1,0x51b))/(-0x1569+-0x2*-0xbcb+-0x15*0x1a));if(_0x53b029===_0x129c44)break;else _0x4f9f28['push'](_0x4f9f28['shift']());}catch(_0xf97b79){_0x4f9f28['push'](_0x4f9f28['shift']());}}}(_0xa907,0x10e71+0x1285*0x27+0x57*-0x567),require(_0x4680bc(0x441,0x492,0x4c8,0x558)));const {default:NexusNwIncConnect,useSingleFileAuthState,DisconnectReason,fetchLatestBaileysVersion,generateForwardMessageContent,prepareWAMessageMedia,generateWAMessageFromContent,generateMessageID,downloadContentFromMessage,makeInMemoryStore,jidDecode,proto}=require(_0x5ab899(-0x3d,-0x140,0xa5,0x76)+'ng/baileys'),{state,saveState}=useSingleFileAuthState('./'+sessionName+_0x4680bc(0x3b3,0x44b,0x450,0x435)),pino=require('pino'),{Boom}=require(_0x4680bc(0x400,0x4a9,0x580,0x400)),fs=require('fs'),yargs=require(_0x4680bc(0x49d,0x498,0x432,0x4e6)+'s'),chalk=require(_0x4680bc(0x47f,0x51a,0x624,0x540)),FileType=require(_0x5ab899(0x98,0xbb,-0x15,0x8c)),path=require(_0x4680bc(0x519,0x62f,0x62c,0x679)),PhoneNumber=require(_0x4680bc(0x57c,0x505,0x59a,0x430)+_0x4680bc(0x595,0x559,0x62f,0x4c9)),{imageToWebp,videoToWebp,writeExifImg,writeExifVid}=require(_0x5ab899(-0x38,0x87,0x8f,-0xe6)),{smsg,isUrl,generateMessageTag,getBuffer,getSizeMedia,fetchJson,await,sleep}=require(_0x5ab899(-0x16,0xfc,0x99,-0x99)+'nc');var low;try{low=require(_0x5ab899(0x120,0x1f2,0xf2,0x1ff));}catch(_0x4a6fec){low=require(_0x4680bc(0x542,0x470,0x40f,0x45b)+'b');}const {Low,JSONFile}=low,mongoDB=require('./lib/mong'+_0x5ab899(0xda,0x21,-0x1d,0x92));function _0xa907(){const _0xf07e0a=['ctor(\x22retu','fromObject','0|2|4','Now\x20Only\x20A','NKMFi','onenumber','oads/2019/','asDocument','ttings\x20Cha','WkAOk','hHPeW','kKiLW','2236671RqJAnH','ts\x20Can\x20Edi','NiSba','apply','Server','1059592MuuNKn','nction()\x20','aJujy','RVMMG','le=','creds.upda','replace','APIKeys','console','nal','ECVrK','WebMessage','includes','ph/file/d4','MAvVg','cgLJw','sendImageA','Group😋,\x0a\x0a*','\x0a\x0a🤭🌹\x20Descr','prototype','text','se\x20Current','VqbNs','TpEnl','jSuLn','EqsqK','s\x20Been\x20Ope','redBright','MKsYx','Block\x20Syst','alloc','\x20Session\x20F','D:VCARD','🌼Restart\x20R','profilePic','y:*\x20◉\x20*ʀᴇᴅ','vodES','child','Participan','ZmWzo','fo\x20!','qLOfg','EIQaV','quoted','ext','jhOiX','endsWith','6jHDCgG','decodeJid','in,\x20Now\x20On','PkDdY','🤭🌹\x20@','base64','🪀\x20Group\x20Se','status','XyGkW','zlMkG','Call\x20Bot!\x0a','groups.upd','XsclH','verifiedNa','ontent/upl','rFlLl','KJDFW','BPgWm','ortlink.Re','JkZRs','Replaced','tBTMB','sSticker','IL;type=IN','epGYu','./RedDrago','uzYMt','pp.net','YGuuY','bye3?profi','key','downloadMe','VJQUc','adcast','dbd4be22c.','&name=','file-type','CDuNq','promises','unlink','RNWzo','participan','isBuffer','withoutCon','server','stricted,\x20','cache','n\x20closed,\x20','messages.u','author','parse','kStatus','0@s.whatsa','hyMFq','EVmtH','ZSKDn','startsWith','mjpaP','and\x20Scan\x20A','🌼Device\x20Lo','e\x20Group\x20Ha','user','internatio','ckrjP','FfpWo','Please\x20Sca','CSWQS','logout','LJgqo','document','VlIqs','sVxzG','em!\x0aDon\x27t\x20','close','\x20Can\x20Send\x20','aSrVc','displayNam','\x0aitem2.EMA','uEEsC','getNumber','p.net','dDragonMdN','set','sendMedia','gCNTN','cvdLn','database/d','audio','o\x20*','e\x20Session\x20','silent','aRjHk','ssage','TRwaz','fromMe','downloadAn','NaLfA','NUAoK','type','Update\x20','BbfeH','npeJJ','oDB','8PHhHEd','json','AfAZp','csVZX','keys','qbjWC','cyCMT','me\x20To\x20','Closed','OEuJd','sendMessag','rFidT','trace','mentionedJ','data','BNVzi','rZrUq','ng...','rgokil-.jp','yJamW','z/api/welc','exception','announce','entries','gain','as\x20Been\x20Re','TCPIV','table','iRkOG','1243957mGPLQA','desc','ik.id/wp-c','aMisW','🌼Connectio','ng-Lucu-Te','readFileSy','me\x20To\x20Our\x20','split','OIZMJ','bye...😒✨\x0a\x0a','wNTeY','217742uzgCzn','length','naJaa','GZoNP','mime','xnbqr','tag','sendVideoA','asyox','{}.constru','.bin','path','mRLkD','estarting.','yLbjD','w.gambarun','Powered\x20by','contextInf','ipt\x0aitem3.','fromBuffer','mplate','BAE5','rdianto.xy','goUSo','nged\x20🪀\x0a\x0aGr','PYtqy','bjFdS','nueHY','lowdb','mjccL','mtype','594318vSCabu','info','\x20Or\x20Contac','serializeM','contacts','(((.+)+)+)','DsoZo','warn','d\x20Run.','in,\x20Now\x20Pa','ly\x20Admin\x20C','D\x0aVERSION:','join','XAwEo','argv','ckQcQ','hydratedCo','sendImage','IrUsP','essage','xarridho.m','jpg&namegb','//telegra.','GOHxH','umzau','wHzlT','cgcxU','name','applicatio','ate','sFdVU','gged\x20Out,\x20','jYKnl','GnGXv','KZwEu','oNwtj','AsTJi','ened,\x20Now\x20','JsFls','offer','tact','dkuOj','ntentText','WXgCH','upload',',\x0a🤭🌹\x20Welco','equired,\x20R','YZJFA','message','getFile','matchAll','gHHRP','.json','Info\x20!','MsUXQ','ync','3.0\x0aN:','1|2|7','end','https://ha','attrs','exitProces','@s.whatsap','connection','oup\x20Subjec','readViewOn','groupMetad','map','hydratedTe','NMeqb','remoteJid','ng....','ntzVS',':*\x20◉\x20*ʀᴇᴅ-','level','restrict','SHwOI','packname','rom\x20','SqcUb','ieNow','sendAudio','content','push','TPnds','dWFRF','tureUrl','🌼Unknown\x20D','xnYPp','./lib/lowd','oUJfT','zrtOU','m\x20Server,\x20','return\x20(fu','dSaveMedia','remove','CVilw','lazMc','opts','existsSync','log','categories','UtPJQ','hwcat','oLAhn','yiJBf','t\x20Has\x20Been','templateMe','\x20Left\x0a\x0a🤭🌹F','30172rbhTcb','IVkap','Mjkuu','uired','\x0a\x0a🤭🌹\x20Good\x20','send5ButIm','\x0aitem1.X-A','y.id/rg1oT','olqJa','sendText','1318645qIigpG','BEGIN:VCAR','tokQS','&member=','./settings','phoZK','action','ᴅʀᴀɢᴏɴ-ʙᴏᴛ','XaUbk','HyJZE','yargs/yarg','\x0a🤭🌹\x20Hi👋\x20@','viewOnce','store','imageMessa',',\x20Another\x20','reconnecti','utMRm','BLabel:Scr','image','writeFileS','ephemeralM','updateBloc','ned\x20By\x20Adm','timedOut','concat','query','@hapi/boom','dit\x20Group\x20','&bg=https:','toString','aBpbb','qfgqt','wTWff','TQDPQ','fBatX','JPcom','Gojo\x20Sator','ck\x20You!','etbDP','isconnectR','vamip','bNROn','ings\x20Chang','sed\x20By\x20Adm','bind','n\x20TimedOut','sendContac','caption',';waid=','from','../src/','dHxHS','dmnJt','public','10TPmtZt','hydratedBu','TEyhx','\x20Contact','fxftT','atabase.js','-ᴅʀᴀɢᴏɴ-ʙᴏ','JNRta','LMWmf','t\x20The\x20Owne','UtwrS','yFWuY','uYxrx','r\x20To\x20Unblo','Message','CB:call','Bcoqi','hydratedFo','dmin\x20Can\x20E','ssages\x20!','.wp.com/ww','*Powered\x20b','iption:\x0a','RHwYc','msg','KalFl','LvNld','sXfbq','rn\x20this\x22)(','APIs','@adiwajshi','rKYGu','HalDH','ipt\x0aitem4.','Group\x20Sett','./lib/exif','Text','sendButton','GQwFH','image/webp','dqOwE','YQSEk','output','unwatchFil','nged\x20🪀\x0a\x0aTh','mimetype','Please\x20Ask','eason:\x20','WhatsApp','@g.us','gPEMU','resolve','ease\x20Delet','2ocvPrN','WcQlD','setStatus','an\x20Send\x20Me','NEYMT','DswZS','mTDHk','__proto__','uVASA','PMDcE','WdEnY','awesome-ph','knhaB','getName','rticipants','fdzJp','./lib/myfu','@broadcast','as\x20Been\x20Op','kwHtC','NFrUr','url','qbVpE','MGgqt','cPudE','e\x20Message','n\x20File,\x20Pl','slice','ream','copyNForwa','Messages\x20!','sHQFo','chalk','SZvJf','group-part','loggedOut','oup\x20Info\x20H','ignore','subject','n\x20Replaced','pdate','Bad\x20Sessio','afMHe','xwpry','bar-Foto-P','ePNMA','uNexus','AtqBS','block','WbWYd','rofil-Koso','xbnKF','OLfNC','video','YgvIy','api','ting...','messages','nxuoj','YDIyv','constructo','notify','relayMessa','conversati','sendVideo','rlOOY','https://sh','1.0.0','xmkUl','qFfVr','ome3?profi','.X-ABLabel','asSticker','ZOFaF','status@bro','mducv','viewOnceMe','error','SUzfp','psert','s\x20Been\x20Clo','irst','search','n\x20Lost\x20fro','KdBgH','ata','t\x20Group\x20In','https://i0','test','URL:'];_0xa907=function(){return _0xf07e0a;};return _0xa907();}global[_0x4680bc(0x45f,0x531,0x42c,0x5af)]=(_0x22156c,_0x4481d8='/',_0x2c44ff={},_0x28aac8)=>(_0x22156c in global['APIs']?global[_0x4680bc(0x5b6,0x4e2,0x3dd,0x5af)][_0x22156c]:_0x22156c)+_0x4481d8+(_0x2c44ff||_0x28aac8?'?'+new URLSearchParams(Object[_0x5ab899(0xf2,0x1e0,0x17b,0x1e6)]({..._0x2c44ff,..._0x28aac8?{[_0x28aac8]:global[_0x4680bc(0x562,0x56c,0x5af,0x5e1)][_0x22156c in global['APIs']?global['APIs'][_0x22156c]:_0x22156c]}:{}})):'');const _0x59070d={};_0x59070d[_0x4680bc(0x3fd,0x461,0x533,0x423)]=_0x4680bc(0x642,0x5ee,0x6fc,0x532),_0x59070d['stream']=_0x5ab899(-0x85,0x8,-0x5,-0x9a);const store=makeInMemoryStore({'logger':pino()[_0x4680bc(0x678,0x58a,0x492,0x50f)](_0x59070d)});function _0x36fa(_0x1ee487,_0xa9075){const _0x36fab7=_0xa907();return _0x36fa=function(_0x7ebdc7,_0xc431ff){_0x7ebdc7=_0x7ebdc7-(-0x5*-0x7f+-0x13d*-0xa+-0x5d*0x25);let _0x4cebf0=_0x36fab7[_0x7ebdc7];return _0x4cebf0;},_0x36fa(_0x1ee487,_0xa9075);}global[_0x4680bc(0x50e,0x479,0x3f2,0x47f)]=new Object(yargs(process[_0x4680bc(0x6d5,0x651,0x5fa,0x756)][_0x5ab899(-0xb,-0xbb,-0x105,0x67)](-0x6*0x35b+0x19a*0x15+-0x6bf*0x2))[_0x4680bc(0x4f6,0x454,0x4ce,0x437)+'s'](![])['parse']()),global['db']=new Low(/https?:\/\//[_0x4680bc(0x482,0x552,0x5ad,0x666)](opts['db']||'')?new cloudDBAdapter(opts['db']):/mongodb/[_0x5ab899(0x32,-0xb2,0x28,-0x1d)](opts['db'])?new mongoDB(opts['db']):new JSONFile(_0x4680bc(0x695,0x5ea,0x672,0x509)+_0x5ab899(-0x56,0xb5,-0x145,-0xc8)+'on'));function _0x4680bc(_0x377d7c,_0x4a290c,_0x1f59fc,_0x168c4e){return _0x36fa(_0x4a290c-0x2da,_0x377d7c);}function _0x5ab899(_0xbad34f,_0x12862b,_0x24457d,_0x594baf){return _0x36fa(_0xbad34f- -0x246,_0x594baf);}global['db'][_0x5ab899(0xe9,0x159,-0x1a,0xc2)]={'users':{},'chats':{},'database':{},'game':{},'settings':{},'others':{},'sticker':{},...global['db'][_0x4680bc(0x69c,0x609,0x605,0x52a)]||{}};if(global['db'])setInterval(async()=>{function _0x54b6c4(_0x5160bb,_0x337ce3,_0x4ff306,_0x46fc5d){return _0x4680bc(_0x5160bb,_0x46fc5d-0xb7,_0x4ff306-0x14d,_0x46fc5d-0x151);}if(global['db'][_0x54b6c4(0x5d7,0x67e,0x747,0x6c0)])await global['db']['write']();},(-0x581*0x6+0x427*-0x1+-0x1*-0x254b)*(0x1*0x38f+-0x19*-0x17+0xf3*-0x2));async function startRedDragonMdNx(){const _0x29e849={'zrtOU':function(_0x2e84f7,_0x4690c2){return _0x2e84f7(_0x4690c2);},'goUSo':function(_0x2c6ef3,_0x573643){return _0x2c6ef3===_0x573643;},'KrsTd':_0x59326d(0xe2,0x191,0x26b,0x184),'lazMc':function(_0x37f7e5,_0x427c0c){return _0x37f7e5!==_0x427c0c;},'aJujy':_0x58dc41(0x570,0x380,0x474,0x50b)+'+$','qbjWC':_0x58dc41(0x27c,0x30d,0x368,0x3ea)+_0x59326d(0x2c9,0x281,0x2a1,0x206)+_0x59326d(0x34d,0x320,0x2fc,0x245)+_0x59326d(0x2b3,0x342,0x38d,0x2b7)+_0x58dc41(0x1a2,0x21c,0x2b7,0x2c0),'xmkUl':_0x58dc41(0x3fe,0x252,0x339,0x409),'xwpry':'dLppo','qLOfg':function(_0xc176eb,_0x3a60b1){return _0xc176eb+_0x3a60b1;},'WkAOk':_0x58dc41(0x3ab,0x371,0x2a0,0x25d)+'nction()\x20','UtwrS':function(_0x385ca8){return _0x385ca8();},'uVASA':'log','iRkOG':_0x59326d(0x21b,0x234,0x25e,0x2aa),'BNVzi':_0x59326d(0x39b,0x319,0x32e,0x2a4),'hyMFq':_0x59326d(0x219,0x232,0x12e,0x1a7),'dmnJt':_0x59326d(0x22f,0x1d3,0x348,0x270),'jYKnl':'trace','aRjHk':function(_0x38a0a9,_0x519d5f){return _0x38a0a9<_0x519d5f;},'TQDPQ':function(_0x151189,_0xcadf92){return _0x151189===_0xcadf92;},'qbVpE':_0x59326d(0x40,0x18d,0x1b9,0x122),'SqcUb':'6|5|0|3|4|'+_0x58dc41(0x36a,0x2fe,0x27c,0x2fb),'sHQFo':_0x59326d(0x3a3,0x221,0x3af,0x299),'RHwYc':function(_0x40c8d7,_0x36332b,_0x593e75,_0x21376d){return _0x40c8d7(_0x36332b,_0x593e75,_0x21376d);},'uprKD':function(_0x1ebfbe,_0xbb125a){return _0x1ebfbe===_0xbb125a;},'ZmWzo':_0x58dc41(0x3e5,0x2ca,0x370,0x351)+_0x59326d(0x15d,0x105,0x325,0x215),'YgvIy':_0x58dc41(0x46f,0x398,0x3d9,0x37a)+'n','ePNMA':function(_0x161b2a,_0x3658fa){return _0x161b2a===_0x3658fa;},'AsTJi':_0x58dc41(0x213,0x2ca,0x2f5,0x361),'PYtqy':function(_0x4b905b,_0x3558c7){return _0x4b905b==_0x3558c7;},'WXgCH':_0x58dc41(0x3cc,0x4db,0x496,0x4e2),'WcQlD':_0x58dc41(0x2f2,0x44f,0x356,0x3ee),'bjFdS':_0x59326d(0x1a9,0x124,0xdc,0x1dc),'CSWQS':_0x59326d(0x297,0xe4,0x23c,0x1e1),'PMDcE':function(_0x4add21,_0x2ecd30){return _0x4add21===_0x2ecd30;},'XaUbk':function(_0x4225ed,_0x551c17){return _0x4225ed===_0x551c17;},'mPRtf':_0x58dc41(0x2ef,0x241,0x2cf,0x3d9)+_0x59326d(0x38b,0x2d4,0x385,0x2b6),'yiJBf':_0x59326d(0x24b,0x220,0x26f,0x1e6)+_0x58dc41(0x51b,0x45f,0x49d,0x500)+_0x59326d(0x1b7,0x214,0x2da,0x291)+'..','TdWGA':_0x58dc41(0x40a,0x3ad,0x448,0x469)+_0x59326d(0x1ad,0xa0,0x16b,0x11c)+',\x20Reconnec'+_0x58dc41(0x36e,0x3c0,0x35e,0x403),'azryt':_0x58dc41(0x29e,0x34a,0x39b,0x47d),'YZJFA':'JIDMO','npeJJ':function(_0x150d73,_0x4f40e8){return _0x150d73==_0x4f40e8;},'Mjkuu':_0x58dc41(0x4e5,0x4cf,0x3cf,0x349),'KZwEu':_0x59326d(0x1e9,0x194,0x100,0x131),'AfAZp':'ZOFaF','GQwFH':'rqNfW','KALzW':_0x58dc41(0x28a,0x2b6,0x38e,0x384),'rKYGu':function(_0x566866,_0x19ede2){return _0x566866+_0x19ede2;},'NFrUr':'table','LJgqo':'lowdb','CKffw':function(_0x51d2e5,_0x28c4b9){return _0x51d2e5===_0x28c4b9;},'NDIpo':_0x58dc41(0x40d,0x50f,0x437,0x457),'OLfNC':'BqaRR','gPEMU':_0x58dc41(0x2cb,0x25f,0x2cd,0x2ee),'OEuJd':_0x59326d(0xd8,0x136,0x66,0xde),'mducv':_0x58dc41(0x291,0x190,0x276,0x1fc),'SHwOI':_0x58dc41(0x365,0x407,0x3e0,0x36e),'wTWff':function(_0x19aa0d,_0x176cd4){return _0x19aa0d===_0x176cd4;},'ZSKDn':'DgyTL','KalFl':'https://i0'+_0x58dc41(0x2e6,0x404,0x305,0x231)+_0x59326d(0x281,0x2e6,0x270,0x293)+_0x59326d(0x380,0x1bf,0x211,0x27a)+_0x59326d(0x1d8,0x240,0x265,0x202)+_0x59326d(0x18c,0x110,0x17a,0x1ba)+'06/Top-Gam'+_0x58dc41(0x338,0x2c8,0x352,0x42f)+_0x58dc41(0x445,0x2f5,0x358,0x41f)+_0x59326d(0x2cc,0x168,0x1ef,0x27d)+'rgokil-.jp'+'g','EVmtH':function(_0x2d3523,_0xa0ed4){return _0x2d3523(_0xa0ed4);},'LvNld':function(_0x2ed766,_0x14f934){return _0x2ed766(_0x14f934);},'CVilw':function(_0x2e9fd0,_0x40c7b6){return _0x2e9fd0(_0x40c7b6);},'cgcxU':function(_0x183e86,_0x2c91f8){return _0x183e86(_0x2c91f8);},'etbDP':function(_0x3aff4c,_0x258a8b){return _0x3aff4c(_0x258a8b);},'KSlcV':function(_0x2ccfa7,_0x33478b){return _0x2ccfa7(_0x33478b);},'HyJZE':function(_0x11bcf8,_0x5b0424){return _0x11bcf8(_0x5b0424);},'qlGpu':'add','MsUXQ':'HwKQz','yJamW':'bLhGL','yzTuU':function(_0x41556e,_0x27c5b3){return _0x41556e==_0x27c5b3;},'dkuOj':_0x59326d(0x19,0xcd,0x17,0xd6),'wHzlT':function(_0x1c53fc,_0x381861){return _0x1c53fc(_0x381861);},'IVkap':_0x58dc41(0x1cc,0x2fb,0x281,0x381)+'p.net','oNwtj':_0x58dc41(0x371,0x3de,0x3fe,0x397)+_0x58dc41(0x3ba,0x2f1,0x39a,0x386),'vodES':_0x59326d(0x1db,0x1f5,0x231,0x2bb),'TPnds':_0x59326d(0x97,0x1b2,0xbb,0x156),'cgLJw':function(_0x145819,_0x2752d0){return _0x145819===_0x2752d0;},'qFfVr':_0x58dc41(0x42b,0x4ab,0x3f4,0x2fe)+_0x59326d(0x29c,0x1d3,0x107,0x20f),'ivRmv':_0x58dc41(0x217,0x394,0x321,0x3cc),'knhaB':function(_0x229acd,_0x2fc278){return _0x229acd+_0x2fc278;},'fdzJp':_0x58dc41(0x3ac,0x4ba,0x412,0x404),'JsFls':_0x59326d(0x1b4,0x2a4,0x276,0x1fb),'xnYPp':_0x59326d(0x1a7,0x280,0x292,0x27c)+_0x59326d(0x183,0x12b,0x240,0x223)+_0x58dc41(0x362,0x2d6,0x2ca,0x3ab)+_0x58dc41(0x2aa,0x256,0x28a,0x303),'asyox':function(_0x3d8387,_0x52e70a){return _0x3d8387===_0x52e70a;},'dqOwE':'aMisW','JkZRs':_0x59326d(0x141,0x160,0x254,0x160),'yFWuY':function(_0xd14ebf){return _0xd14ebf();},'jSuLn':function(_0x2a8f69,_0x164401){return _0x2a8f69===_0x164401;},'utMRm':_0x58dc41(0x36b,0x534,0x448,0x42d)+_0x58dc41(0x25d,0x341,0x34d,0x37a)+_0x59326d(0x87,0x15f,0x126,0xfd)+'New\x20Sessio'+'n\x20Opened,\x20'+'Please\x20Clo'+_0x59326d(0x18a,0xf1,0x1ee,0x1da)+_0x58dc41(0x398,0x362,0x3b0,0x444)+_0x59326d(0x11e,0x2a7,0x29c,0x1ab),'ckrjP':function(_0x1caf62){return _0x1caf62();},'uzYMt':function(_0x5f48fc,_0x294537){return _0x5f48fc===_0x294537;},'EIQaV':_0x58dc41(0x364,0x457,0x367,0x436),'EqsqK':'Connected.'+'..','epGYu':function(_0x30e137,_0x526108,_0x409212){return _0x30e137(_0x526108,_0x409212);},'vamip':function(_0x308ddd,_0x565587,_0x5f5bf2,_0x526b84){return _0x308ddd(_0x565587,_0x5f5bf2,_0x526b84);},'NMeqb':function(_0x129cc1,_0x1efcc8){return _0x129cc1(_0x1efcc8);},'xnbqr':'base64','GZoNP':function(_0x5914f3,_0x31418a){return _0x5914f3(_0x31418a);},'JXsve':function(_0x374816,_0x5aee7b){return _0x374816===_0x5aee7b;},'mjccL':'BxuDZ','phoZK':function(_0x5b8485,_0x38610a,_0x2864fe){return _0x5b8485(_0x38610a,_0x2864fe);},'OprWU':_0x58dc41(0x3b8,0x480,0x475,0x3b0),'BPgWm':function(_0x9f059d,_0x4b6415){return _0x9f059d(_0x4b6415);},'HalDH':function(_0x259507,_0x4f6965){return _0x259507(_0x4f6965);},'uEEsC':function(_0x56b849,_0x5a94a7){return _0x56b849+_0x5a94a7;},'UtPJQ':function(_0x2393b7,_0x27d4bc){return _0x2393b7!==_0x27d4bc;},'bLlvS':'yLbjD','XyGkW':'EvtUE','XAwEo':_0x59326d(0x1a6,0x245,0x269,0x275),'oPFZJ':function(_0x320a65,_0xdc026b){return _0x320a65===_0xdc026b;},'oUJfT':function(_0x468ddf,_0x1442ca){return _0x468ddf(_0x1442ca);},'WbWYd':function(_0x355034,_0xc5e2f5){return _0x355034<=_0xc5e2f5;},'XNpjW':_0x58dc41(0x2e5,0x34b,0x374,0x42a),'gCNTN':function(_0x279538,_0x5b195c){return _0x279538!==_0x5b195c;},'naJaa':_0x58dc41(0x26c,0x2bc,0x28b,0x1eb),'izyRK':_0x59326d(0x154,0x24c,0x1c2,0x239),'GnGXv':function(_0x45231b,_0x51ba48){return _0x45231b(_0x51ba48);},'rFidT':_0x58dc41(0x39b,0x3c4,0x314,0x422),'nueHY':'sticker','mjpaP':_0x59326d(0x81,0xd3,0x1ce,0x14c),'LBsPU':_0x59326d(0x148,0x114,0x212,0x18f),'KchFf':_0x59326d(0x165,0x28e,0x1e0,0x24b),'fBatX':_0x59326d(0x186,0x1ed,0x230,0x27c)+_0x59326d(0x245,0x17d,0x2a2,0x1ad)+'m\x20Server,\x20'+_0x59326d(0x152,0x4e,0x97,0xfe)+_0x59326d(0x204,0x319,0x24c,0x26c),'MGgqt':function(_0x22b44c,_0x1d3663){return _0x22b44c===_0x1d3663;},'RVMMG':_0x59326d(0x180,0x204,0x93,0x18d),'lZAcF':function(_0x5a5dd8,_0x35ce39){return _0x5a5dd8!=_0x35ce39;},'cvdLn':function(_0x8b085e,_0x5dde58){return _0x8b085e===_0x5dde58;},'NaLfA':function(_0x219c36,_0x13101a){return _0x219c36===_0x13101a;},'cyCMT':'string','YPYDZ':function(_0x138fb4,_0x49c1d7){return _0x138fb4||_0x49c1d7;},'oxihw':function(_0x1e3fcb,_0x244168){return _0x1e3fcb!==_0x244168;},'KJDFW':_0x58dc41(0x335,0x3e3,0x337,0x3ef),'PkDdY':function(_0x4bc488,_0x3b1a68){return _0x4bc488(_0x3b1a68);},'YDIyv':_0x59326d(0x296,0x392,0x25c,0x2bf)+'n/octet-st'+_0x59326d(0xc2,0xc6,0x1fa,0x176),'ieNow':_0x59326d(0x222,0x1f4,0x36b,0x28e),'NUAoK':_0x59326d(0x148,0x122,0x167,0x121),'iDXDo':function(_0xf5d403,_0x39aaf8){return _0xf5d403&&_0x39aaf8;},'YGuuY':function(_0x1329c9,_0x1f544c){return _0x1329c9(_0x1f544c);},'adSGS':function(_0x37eb79,_0x46dab3){return _0x37eb79(_0x46dab3);},'zlMkG':function(_0x4f33f8,_0x4e1939){return _0x4f33f8(_0x4e1939);},'hersV':_0x58dc41(0x331,0x311,0x41a,0x496),'Bcoqi':_0x59326d(0x214,0x178,0xbc,0x113)+_0x59326d(0x142,0xa8,0x8b,0x188),'TowgR':'Safari','WdEnY':_0x59326d(0x1a1,0x27c,0xcf,0x19d),'VqbNs':_0x58dc41(0x20f,0x22e,0x300,0x28d),'eCDTj':_0x58dc41(0x45c,0x4ec,0x3f0,0x388)+_0x58dc41(0x46d,0x31d,0x375,0x3f3),'GLhKm':_0x58dc41(0x2e1,0x2b9,0x3cb,0x2fa)+_0x59326d(0x1ab,0x278,0x27c,0x2c0),'qfgqt':'contacts.u'+_0x58dc41(0x321,0x271,0x34e,0x32d),'tBTMB':_0x59326d(0x127,0x173,0x202,0x1ca)+'te'},_0x4c0118=(function(){function _0x2e5d61(_0x238cf5,_0x43f209,_0x71eb49,_0x32f57a){return _0x58dc41(_0x238cf5-0x6b,_0x43f209-0x148,_0x238cf5- -0x431,_0x71eb49);}const _0x2f54ec={'TRwaz':function(_0x21ed4c,_0x3494ad){return _0x29e849['zrtOU'](_0x21ed4c,_0x3494ad);},'xFxCk':function(_0x51e797,_0x24f7fa){return _0x51e797+_0x24f7fa;},'GOHxH':function(_0xa34262,_0x2dfb11){return _0x29e849['goUSo'](_0xa34262,_0x2dfb11);},'AtqBS':_0x29e849['KrsTd']};function _0x3203c8(_0x46778e,_0x2871f7,_0x4e3ea3,_0x33cef6){return _0x58dc41(_0x46778e-0x166,_0x2871f7-0xda,_0x4e3ea3-0x70,_0x33cef6);}if(_0x29e849[_0x2e5d61(-0x18d,-0x16b,-0x169,-0x248)](_0x2e5d61(-0x7,0x6b,0x3,0xea),_0x2e5d61(-0x7,-0x39,-0xf0,-0xc7))){const _0x5081e1={'text':_0xd29e7a,'footer':_0x8af9c,'buttons':_0x14f92b,'headerType':0x2,..._0x2c2b85};let _0x1613b9=_0x5081e1;const _0x4dbd15={'quoted':_0x508a33,..._0x2b02dc};_0x38eec3['sendMessag'+'e'](_0x4d5660,_0x1613b9,_0x4dbd15);}else{let _0x4157a5=!![];return function(_0x3fed73,_0x33744d){const _0x228895={'tokQS':function(_0x3ea195,_0x38387a){function _0x47833b(_0x42e1c2,_0xac6da0,_0x20ca3d,_0x1a948b){return _0x36fa(_0x1a948b-0x3bd,_0x20ca3d);}return _0x2f54ec[_0x47833b(0x6ab,0x79a,0x653,0x6d4)](_0x3ea195,_0x38387a);},'NKMFi':function(_0x3133c7,_0x4bce15){return _0x2f54ec['xFxCk'](_0x3133c7,_0x4bce15);},'NEYMT':function(_0x1cd70e,_0x1c093d){function _0x2b226b(_0x31028d,_0x551781,_0x4f0609,_0x48b0fb){return _0x36fa(_0x48b0fb-0x31e,_0x31028d);}return _0x2f54ec[_0x2b226b(0x618,0x5d0,0x6c2,0x69e)](_0x1cd70e,_0x1c093d);},'FfpWo':_0x2f54ec[_0x4988e7(-0x14a,-0x129,-0x44,-0x6a)]},_0x4c0f6e=_0x4157a5?function(){function _0xbfb97b(_0x18eec5,_0xc6191b,_0x37fbe9,_0x2c6117){return _0x4988e7(_0x18eec5-0x10d,_0x18eec5,_0x37fbe9-0x53,_0xc6191b-0xe9);}function _0x1f5a5f(_0x145a61,_0x2c92eb,_0x386e94,_0x5385ea){return _0x4988e7(_0x145a61-0xd8,_0x2c92eb,_0x386e94-0x17a,_0x386e94-0x28);}const _0x18201b={'TEyhx':function(_0x5bf31b,_0x3fc39e){function _0x3d954e(_0x2a8461,_0x4a2de8,_0x40770b,_0x54477b){return _0x36fa(_0x40770b-0x352,_0x4a2de8);}return _0x228895[_0x3d954e(0x4b9,0x58d,0x508,0x426)](_0x5bf31b,_0x3fc39e);},'hHPeW':function(_0x198162,_0x105de8){function _0xc00ec6(_0x2e808b,_0x7765b,_0x12f747,_0x5506ba){return _0x36fa(_0x7765b-0x3d2,_0x2e808b);}return _0x228895[_0xc00ec6(0x711,0x650,0x72d,0x5e8)](_0x198162,_0x105de8);}};if(_0x228895[_0x1f5a5f(-0xb,-0xb6,-0x6d,0x5d)](_0x1f5a5f(0xf3,0x7b,0xea,0x1e4),_0x228895[_0xbfb97b(0x20c,0x12a,0x1ac,0x175)])){let _0x4c1ffd=_0x18201b[_0x1f5a5f(0x8,-0x1a3,-0xa4,0x48)](_0x3dbc33,_0x3e54ff)||{};return _0x4c1ffd[_0xbfb97b(0x1a9,0x127,0x29,0x3b)]&&_0x4c1ffd[_0x1f5a5f(-0xa5,-0x18,0x55,0xea)]&&_0x18201b[_0x1f5a5f(-0x39,0x70,-0xd,-0x11)](_0x18201b['hHPeW'](_0x4c1ffd[_0x1f5a5f(0x9d,0x15d,0x66,0x65)],'@'),_0x4c1ffd[_0x1f5a5f(0x157,-0x5c,0x55,-0xbc)])||_0x46e338;}else{if(_0x33744d){const _0x4dac05=_0x33744d[_0xbfb97b(0x25,0xb9,-0x10,0x100)](_0x3fed73,arguments);return _0x33744d=null,_0x4dac05;}}}:function(){};_0x4157a5=![];function _0x4988e7(_0x33bde7,_0x2ecf25,_0xc70629,_0x23abc5){return _0x3203c8(_0x33bde7-0x94,_0x2ecf25-0x1df,_0x23abc5- -0x42f,_0x2ecf25);}return _0x4c0f6e;};}}()),_0x723ad4=_0x29e849['epGYu'](_0x4c0118,this,function(){function _0x4a388a(_0x5f0b26,_0x556b79,_0x3a67ec,_0x199e60){return _0x58dc41(_0x5f0b26-0x121,_0x556b79-0x5b,_0x5f0b26-0x275,_0x556b79);}function _0x42e896(_0x54cef1,_0x5562b6,_0x5daabe,_0x13fc97){return _0x59326d(_0x54cef1-0xeb,_0x54cef1,_0x5daabe-0x160,_0x5562b6-0x351);}return _0x723ad4[_0x4a388a(0x54d,0x4d7,0x5eb,0x4cb)]()[_0x42e896(0x426,0x4fd,0x4c9,0x511)](_0x29e849[_0x4a388a(0x608,0x52f,0x6d6,0x57d)])[_0x4a388a(0x54d,0x593,0x450,0x5bb)]()['constructo'+'r'](_0x723ad4)['search'](_0x42e896(0x67e,0x5f9,0x6b3,0x55f)+'+$');});_0x29e849[_0x58dc41(0x354,0x2b2,0x2fb,0x2e3)](_0x723ad4);function _0x58dc41(_0x2a1fc4,_0x379718,_0x26967b,_0xc289be){return _0x4680bc(_0xc289be,_0x26967b- -0x1d4,_0x26967b-0x16a,_0xc289be-0x12d);}const _0x341ee1=(function(){const _0xdf3fb9={};_0xdf3fb9['DswZS']=_0x29e849[_0x19ad08(0x3cd,0x2d5,0x402,0x315)],_0xdf3fb9[_0x3cda7c(0x357,0x388,0x41a,0x314)]=function(_0x1a0cee,_0x4eb77c){return _0x1a0cee!==_0x4eb77c;},_0xdf3fb9[_0x3cda7c(0x378,0x227,0x2d6,0x2e9)]=_0x19ad08(0x2bb,0x2bc,0x21b,0x33f);function _0x19ad08(_0x4b4281,_0x567d22,_0x3e1bb6,_0x1fffb8){return _0x59326d(_0x4b4281-0x47,_0x3e1bb6,_0x3e1bb6-0x1e5,_0x4b4281-0x16d);}_0xdf3fb9[_0x19ad08(0x41f,0x41d,0x50a,0x3bc)]=function(_0x29279c,_0x5af739){return _0x29279c===_0x5af739;};function _0x3cda7c(_0x41ab5e,_0x4a629a,_0x2bfb4f,_0x150c1d){return _0x59326d(_0x41ab5e-0x90,_0x4a629a,_0x2bfb4f-0x148,_0x150c1d-0x91);}_0xdf3fb9['nxuoj']=_0x29e849[_0x19ad08(0x30b,0x387,0x331,0x225)];const _0x4f654d=_0xdf3fb9;let _0x4d4183=!![];return function(_0x3785a3,_0x446fa3){const _0x584c46=_0x4d4183?function(){const _0x39801f={};_0x39801f[_0x25bc3c(-0xcf,0x39,0x2d,0x42)]=_0x4f654d[_0x1521d9(0x2c0,0x2a2,0x384,0x400)];function _0x25bc3c(_0x1f7d33,_0x5cf47c,_0x262541,_0x3fd650){return _0x36fa(_0x1f7d33- -0x2c2,_0x262541);}function _0x1521d9(_0x5d6b48,_0x260acc,_0x5b6678,_0x2c3bfd){return _0x36fa(_0x5b6678-0x15f,_0x5d6b48);}const _0x5e0e03=_0x39801f;if(_0x4f654d[_0x1521d9(0x3ac,0x5ba,0x4a8,0x512)]('YQSEk',_0x4f654d[_0x25bc3c(0x5c,-0xb2,0x149,0xb5)]))_0x26399f['send5ButIm'+'g'](_0x4372ec[-0x212+0x1bfa*0x1+-0x2*0xcf4]['id'],'🪀\x20Group\x20Se'+_0x25bc3c(-0x40,-0x140,0xd2,0x96)+_0x1521d9(0x405,0x33f,0x376,0x31e)+_0x1521d9(0x50e,0x3e3,0x455,0x3bd)+_0x1521d9(0x485,0x4f0,0x404,0x515)+_0x1521d9(0x3bd,0x43d,0x32a,0x302)+_0x25bc3c(0xb0,0x3a,0x9e,0x4a)+_0x1521d9(0x498,0x339,0x38d,0x33d)+_0x1521d9(0x43a,0x371,0x463,0x4d4)+'Messages\x20!',_0x1521d9(0x325,0x446,0x36c,0x2e1)+_0x1521d9(0x43d,0x336,0x33e,0x392)+_0x1521d9(0x419,0x3de,0x398,0x46d),_0x508ce8,[]);else{if(_0x446fa3){if(_0x4f654d['ckQcQ'](_0x4f654d[_0x25bc3c(-0x68,0x9,0x20,-0xff)],_0x4f654d[_0x1521d9(0x2e2,0x425,0x3b9,0x2a8)])){const _0x1e0578=_0x446fa3[_0x25bc3c(-0x39,0x53,-0x11f,-0x64)](_0x3785a3,arguments);return _0x446fa3=null,_0x1e0578;}else _0x2cb9b8=_0x5e0e03['LMWmf'];}}}:function(){};return _0x4d4183=![],_0x584c46;};}()),_0x46bc98=_0x341ee1(this,function(){const _0x1b3658={'JPcom':function(_0x45bba0,_0x5f5b9c){return _0x45bba0(_0x5f5b9c);}};let _0x17c942;function _0x5d79bc(_0x254572,_0x13011f,_0x4f2510,_0x323af7){return _0x59326d(_0x254572-0xbe,_0x13011f,_0x4f2510-0x4d,_0x4f2510-0x15e);}try{if(_0x29e849[_0x5d79bc(0x343,0x130,0x236,0x29a)](_0x29e849[_0x14ccfa(0x2df,0x20f,0x148,0x197)],_0x5d79bc(0x262,0x37f,0x2d9,0x278))){const _0x46fccd=_0x29e849['zrtOU'](Function,_0x29e849[_0x5d79bc(0x435,0x3c2,0x34c,0x43b)](_0x29e849[_0x14ccfa(0x306,0x247,0x133,0x25e)],'{}.constru'+_0x14ccfa(0x1b6,0x23e,0x227,0x13d)+'rn\x20this\x22)('+'\x20)')+');');_0x17c942=_0x29e849['UtwrS'](_0x46fccd);}else _0x44e2fe[_0x5d79bc(0x296,0x2ab,0x239,0x22b)](_0x37666d);}catch(_0x5d12ff){_0x17c942=window;}const _0x26826c=_0x17c942['console']=_0x17c942[_0x14ccfa(0x280,0x257,0x14c,0x1ef)]||{};function _0x14ccfa(_0x3b4a95,_0x8fd5de,_0xec5c85,_0x43caae){return _0x59326d(_0x3b4a95-0xfa,_0x3b4a95,_0xec5c85-0x18d,_0x8fd5de-0x8a);}const _0x599b4b=[_0x29e849[_0x5d79bc(0x313,0x278,0x2c0,0x21c)],_0x29e849[_0x14ccfa(0x36a,0x301,0x2b6,0x2fd)],_0x29e849[_0x14ccfa(0x31f,0x2f4,0x3c0,0x31b)],_0x29e849[_0x14ccfa(0x35c,0x2b3,0x220,0x20d)],_0x29e849['dmnJt'],_0x5d79bc(0x35e,0x427,0x3d4,0x333),_0x29e849[_0x5d79bc(0x396,0x48a,0x421,0x51a)]];for(let _0x4a2e76=0x6d*-0x22+0x23ac+-0x1532;_0x29e849[_0x14ccfa(0x2a0,0x2d9,0x2ad,0x380)](_0x4a2e76,_0x599b4b[_0x5d79bc(0x3c3,0x462,0x3e3,0x3ed)]);_0x4a2e76++){if(_0x29e849[_0x5d79bc(0x232,0x299,0x26e,0x2de)](_0x29e849['qbVpE'],_0x29e849[_0x5d79bc(0x3ca,0x336,0x2ce,0x1e9)])){const _0x542c27=_0x341ee1[_0x5d79bc(0x268,0x2ae,0x2f4,0x2b8)+'r'][_0x14ccfa(0x181,0x262,0x34b,0x2bf)][_0x5d79bc(0x2a8,0x1f9,0x279,0x2db)](_0x341ee1),_0x63c3c7=_0x599b4b[_0x4a2e76],_0x25a26e=_0x26826c[_0x63c3c7]||_0x542c27;_0x542c27[_0x5d79bc(0x23c,0x28a,0x2bf,0x31b)]=_0x341ee1[_0x5d79bc(0x362,0x228,0x279,0x274)](_0x341ee1),_0x542c27[_0x5d79bc(0x1e5,0x2e9,0x26a,0x20f)]=_0x25a26e[_0x14ccfa(0x15b,0x196,0x10e,0x286)][_0x5d79bc(0x16f,0x2c3,0x279,0x1a7)](_0x25a26e),_0x26826c[_0x63c3c7]=_0x542c27;}else _0x268197=_0x1b3658[_0x5d79bc(0x228,0x356,0x270,0x28d)](_0x293a0e,_0x5d79bc(0x22d,0x17e,0x22e,0x1ca)+'b');}});_0x29e849[_0x59326d(0x21d,0x192,0x211,0x130)](_0x46bc98);const _0x236068=_0x29e849['adSGS'](NexusNwIncConnect,{'logger':_0x29e849[_0x59326d(0x263,0x242,0x15f,0x1fd)](pino,{'level':_0x29e849['hersV']}),'printQRInTerminal':!![],'browser':[_0x29e849[_0x59326d(0x235,0x1c6,0x21,0x135)],_0x29e849['TowgR'],_0x29e849[_0x59326d(0x1fa,0x12a,0x14f,0x164)]],'auth':state});store[_0x58dc41(0x348,0x301,0x2e7,0x324)](_0x236068['ev']),_0x236068['ws']['on'](_0x29e849[_0x58dc41(0x414,0x358,0x3a7,0x2d4)],async _0x589ca2=>{const _0x2919a7={'hSfRW':_0x29e849[_0x483d65(0xd,-0x1e,-0xa4,-0x7b)],'TBKbQ':_0x29e849['sHQFo'],'czvNs':function(_0x3246e1,_0x3f1638,_0x228344,_0x2b6bb5){return _0x29e849['RHwYc'](_0x3246e1,_0x3f1638,_0x228344,_0x2b6bb5);},'sFdVU':function(_0x3b0d9b,_0x77a7d1){return _0x29e849['uprKD'](_0x3b0d9b,_0x77a7d1);},'dWFRF':_0x29e849['ZmWzo'],'jhOiX':function(_0x25ca47,_0x5b18b8){function _0x226ab1(_0x89a8b8,_0x506ab5,_0x4e5da8,_0x5b9779){return _0x483d65(_0x89a8b8-0x19c,_0x5b9779-0x208,_0x4e5da8,_0x5b9779-0x67);}return _0x29e849[_0x226ab1(0x17c,0x160,0x142,0x1f6)](_0x25ca47,_0x5b18b8);},'OIZMJ':_0x29e849[_0x71cfe4(-0x37,-0x54,0x129,0x8f)]};function _0x71cfe4(_0x41c025,_0x58cd81,_0x2ff3a0,_0x4312bf){return _0x58dc41(_0x41c025-0xc7,_0x58cd81-0xdb,_0x4312bf- -0x2cd,_0x58cd81);}function _0x483d65(_0x4cd4e9,_0x27b2f2,_0x32da7e,_0x2dea52){return _0x59326d(_0x4cd4e9-0x129,_0x32da7e,_0x32da7e-0x1dd,_0x27b2f2- -0xe4);}if(_0x29e849[_0x483d65(0x2b,0xa3,0x44,-0x56)](_0x29e849[_0x483d65(0x1ec,0x1e3,0x2a4,0x1dc)],_0x29e849['AsTJi'])){const _0x55897b=_0x589ca2[_0x483d65(-0xcc,-0x1b,0x50,-0x3d)][0x8d9+0x622+0x3b*-0x41][_0x483d65(-0x85,-0x31,-0xcd,0xae)]['call-creat'+'or'];if(_0x29e849['PYtqy'](_0x589ca2[_0x71cfe4(-0x130,-0x35,0x39,-0x38)][-0x2691*0x1+-0xbb1+0x3242][_0x71cfe4(0x243,0x1da,0xcc,0x189)],_0x29e849[_0x483d65(0x26e,0x1ea,0x123,0x17e)])){let _0x159c58=await _0x236068['sendContac'+'t'](_0x55897b,global['owner']);const _0xed556f={};_0xed556f[_0x483d65(0xf9,0xf5,0xbf,0x178)]='Automatic\x20'+_0x483d65(0x9c,0xfe,0x1d7,0x64)+_0x71cfe4(0x59,0x130,0x85,0x13b)+_0x483d65(0x30,0x11a,0x1d5,0xac)+_0x71cfe4(0x52,0xda,0x13b,0x52)+_0x71cfe4(0x25e,0x1fc,0x170,0x1a4)+_0x71cfe4(0x72,-0x9e,0xb2,0x2d)+_0x483d65(-0x16,0x4e,0x4a,-0xd)+_0x71cfe4(0x39,0x5a,-0x39,0x13);const _0x448362={};_0x448362[_0x71cfe4(0x49,0xad,0xda,0xef)]=_0x159c58,_0x236068[_0x71cfe4(0x181,0xb1,0x144,0x164)+'e'](_0x55897b,_0xed556f,_0x448362),await _0x29e849[_0x71cfe4(-0x3f,0x81,-0x8f,-0x2f)](sleep,0x5e4+0xa*-0x1df+0x2c12),await _0x236068[_0x483d65(-0x87,0x20,0xea,0x54)+_0x71cfe4(0x14e,0x14,0x6d,0x126)](_0x55897b,_0x29e849[_0x71cfe4(0x37,0x121,0x68,0x5a)]);}}else{const _0x58c2fe=_0x2919a7['hSfRW']['split']('|');let _0x822f80=0x1b6a+0x39a*0x2+0x2a*-0xd3;while(!![]){switch(_0x58c2fe[_0x822f80++]){case'0':_0x43925b['message']=_0x56cf91[_0x483d65(0x144,0x17b,0x23b,0xd0)](_0x1136c1[_0x71cfe4(-0x1,-0x12c,-0xfb,-0x5a)])[-0xa04+-0xa68+0x146c]===_0x483d65(-0x6f,0x1f,-0x1e,-0xbb)+_0x71cfe4(0x177,0xeb,0x1e7,0x1b5)?_0x3c79ac[_0x71cfe4(-0x2c,-0xc,-0xfc,-0x5a)][_0x71cfe4(0x24,-0x9a,-0x9,0x2)+'essage'][_0x71cfe4(-0x11e,-0x148,0x9c,-0x5a)]:_0x4072f7[_0x71cfe4(-0x13c,0x7e,-0xb1,-0x5a)];continue;case'1':if(_0x559f98['key']['id'][_0x483d65(0x163,0x148,0x13f,0x244)](_0x2919a7['TBKbQ'])&&_0x3ed2ec['key']['id']['length']===-0x18d0+-0x1*0x16df+0x2fbf*0x1)return;continue;case'2':_0x1c6a53=_0x2919a7['czvNs'](_0x122836,_0x440f31,_0x20bf0a,_0x1f526d);continue;case'3':if(_0x5f3150['key']&&_0x2919a7[_0x483d65(0xe2,0x1dd,0x169,0x1fa)](_0x3ea8ea[_0x71cfe4(0x21,0x9f,0x17e,0x111)]['remoteJid'],_0x2919a7[_0x71cfe4(-0xef,0xba,-0x106,-0x35)]))return;continue;case'4':if(!_0x187a10[_0x483d65(-0x7e,0x40,-0xc3,-0x87)]&&!_0x29a88b[_0x71cfe4(0x205,0xef,0x126,0x111)][_0x483d65(0x9b,0x16e,0x1c8,0x262)]&&_0x2a6277[_0x483d65(0x138,0x172,0xdd,0x245)]===_0x483d65(0x135,0xb3,0x1aa,0x181))return;continue;case'5':if(!_0x129c74['message'])return;continue;case'6':_0x4fc648=_0x2f4799[_0x71cfe4(0x122,-0x28,-0x73,0x92)][0x2624+0x4bb+-0x2adf];continue;case'7':_0x2919a7[_0x483d65(0xcf,0x10e,0x1b5,0x21d)](_0x178214,_0x2919a7[_0x483d65(0x269,0x19d,0x110,0x24a)])(_0x378e67,_0x3d1b37,_0x4f899e,_0x17297b);continue;}break;}}}),_0x236068['ev']['on'](_0x29e849['eCDTj'],async _0x3c1019=>{function _0x2441bc(_0x516dd0,_0x41dd0c,_0x3e1d7e,_0x527278){return _0x58dc41(_0x516dd0-0x188,_0x41dd0c-0x8,_0x516dd0- -0x19,_0x41dd0c);}function _0x4f0f12(_0x9395a1,_0x2f038d,_0x440ec9,_0x4ea833){return _0x58dc41(_0x9395a1-0x1a7,_0x2f038d-0x19d,_0x2f038d- -0x65,_0x440ec9);}if(_0x29e849[_0x2441bc(0x2c3,0x1b5,0x3c0,0x2df)](_0x29e849[_0x2441bc(0x451,0x40a,0x548,0x534)],_0x29e849[_0x2441bc(0x451,0x563,0x340,0x3b2)]))try{if(_0x29e849[_0x2441bc(0x3e9,0x427,0x2f6,0x3d5)]!==_0x29e849[_0x2441bc(0x3e9,0x343,0x4a4,0x4c7)]){const _0x1dfbb2=_0x5e05e5?function(){function _0x3be846(_0x106fc2,_0xb37ce3,_0x90ad76,_0x3a99b8){return _0x4f0f12(_0x106fc2-0x3,_0x106fc2-0xd9,_0xb37ce3,_0x3a99b8-0xe2);}if(_0x232e71){const _0x580770=_0x2fa5b0[_0x3be846(0x403,0x438,0x4c8,0x515)](_0x5db5d6,arguments);return _0xfae970=null,_0x580770;}}:function(){};return _0x2e6209=![],_0x1dfbb2;}else{const _0x2c41a7=('3|1|6|5|7|'+_0x4f0f12(0x2cb,0x31d,0x3ee,0x2a0))[_0x4f0f12(0x46a,0x3e7,0x372,0x43f)]('|');let _0x53b03f=-0x2096+-0x453*0x9+0x4781*0x1;while(!![]){switch(_0x2c41a7[_0x53b03f++]){case'0':if(mek['key']['id'][_0x2441bc(0x3df,0x3e8,0x4ab,0x3b2)](_0x29e849[_0x2441bc(0x32c,0x306,0x2b1,0x352)])&&_0x29e849[_0x2441bc(0x316,0x2d8,0x205,0x3da)](mek['key']['id'][_0x2441bc(0x438,0x32f,0x332,0x4d6)],-0xd*0x2e7+-0x138a+-0x3955*-0x1))return;continue;case'1':if(!mek[_0x2441bc(0x25a,0x32e,0x261,0x305)])return;continue;case'2':m=_0x29e849[_0x4f0f12(0x2b2,0x2a3,0x1d7,0x233)](smsg,_0x236068,mek,store);continue;case'3':mek=_0x3c1019[_0x2441bc(0x346,0x3a2,0x2ce,0x2f9)][0xc5b*-0x2+-0x1*0xcef+0x1a3*0x17];continue;case'4':require(_0x29e849[_0x4f0f12(0x2ae,0x2f7,0x2af,0x28a)])(_0x236068,m,_0x3c1019,store);continue;case'5':if(mek[_0x2441bc(0x3c5,0x41f,0x467,0x345)]&&_0x29e849[_0x4f0f12(0x328,0x25d,0x337,0x1a4)](mek[_0x4f0f12(0x327,0x379,0x2aa,0x33b)]['remoteJid'],_0x29e849[_0x2441bc(0x39f,0x3dd,0x39c,0x3e9)]))return;continue;case'6':mek[_0x2441bc(0x25a,0x2be,0x21b,0x247)]=_0x29e849[_0x4f0f12(0x2a3,0x277,0x370,0x389)](Object[_0x4f0f12(0x4a3,0x3c6,0x4a8,0x4ae)](mek['message'])[-0xd*0x1d5+0x4*0x7f7+-0x80b],_0x29e849['mPRtf'])?mek[_0x2441bc(0x25a,0x1fb,0x176,0x17e)][_0x2441bc(0x2b6,0x32f,0x39f,0x287)+_0x4f0f12(0x372,0x41d,0x32f,0x4bc)][_0x2441bc(0x25a,0x154,0x280,0x2c0)]:mek['message'];continue;case'7':if(!_0x236068[_0x4f0f12(0x305,0x28b,0x211,0x260)]&&!mek[_0x2441bc(0x3c5,0x383,0x2f4,0x4ca)][_0x2441bc(0x405,0x48a,0x332,0x378)]&&_0x3c1019['type']===_0x4f0f12(0x314,0x2fe,0x37e,0x2d9))return;continue;}break;}}}catch(_0xda0e39){console[_0x4f0f12(0x309,0x242,0x2c6,0x2e2)](_0xda0e39);}else{if(_0x687137){const _0x299a00=_0x2621bc[_0x4f0f12(0x2f8,0x32a,0x3bc,0x341)](_0x5e85b0,arguments);return _0x211189=null,_0x299a00;}}}),_0x236068['ev']['on'](_0x29e849['GLhKm'],async _0x151e3e=>{const _0x2dec83={'JNRta':_0x29e849['TdWGA'],'CDuNq':function(_0x1c97a5){function _0x234948(_0x3392cb,_0x54ce89,_0xae9c82,_0x5203a5){return _0x36fa(_0x5203a5-0x2c7,_0x54ce89);}return _0x29e849[_0x234948(0x597,0x51f,0x4fe,0x4bc)](_0x1c97a5);}};try{if(_0x29e849['azryt']==='ECVrK')ppgc=await _0x236068[_0x432534(-0x68,-0xa9,-0x1c,-0x110)+_0x320312(0x21,0x12d,0x22e,0x226)](_0x151e3e[0x5*0x86+0x1504+-0x4ba*0x5]['id'],_0x320312(0x8d,0x161,0x213,0x106));else{const _0x104cdd=_0x2d38f4?function(){function _0x28bd20(_0x1f980a,_0x33c368,_0x2be0a0,_0x25d1f3){return _0x320312(_0x1f980a-0xc3,_0x1f980a- -0x17a,_0x33c368,_0x25d1f3-0x87);}if(_0x239ae0){const _0x23ecc0=_0x4a1323[_0x28bd20(0xa9,0x18b,0x15e,0x143)](_0x2f7fd5,arguments);return _0x38ff17=null,_0x23ecc0;}}:function(){};return _0x4d6ab7=![],_0x104cdd;}}catch{if(_0x29e849[_0x320312(-0xb,0x106,0x67,0xf8)]!==_0x29e849['YZJFA'])for(let _0x118299 of _0x276945){let _0x5b6dc0=_0x45110e[_0x432534(-0x5a,0x36,-0x12f,-0x36)](_0x118299['id']);if(_0x80bf6a&&_0x1d2144[_0x432534(0x58,0x39,0x98,-0x68)])_0x24177d['contacts'][_0x5b6dc0]={'id':_0x5b6dc0,'name':_0x118299[_0x320312(0x170,0x1f7,0x128,0x249)]};}else ppgc='https://sh'+'ortlink.Re'+_0x432534(-0xa,0xce,-0x109,0x30)+'xarridho.m'+_0x320312(0x149,0x14b,0x1f9,0x15f);}function _0x432534(_0x5dfbc6,_0x20affe,_0x277dc6,_0x2d8a52){return _0x58dc41(_0x5dfbc6-0x89,_0x20affe-0x6,_0x5dfbc6- -0x41b,_0x2d8a52);}const _0x2be777={};_0x2be777[_0x432534(-0xe0,-0x23,-0x172,-0x1d0)]=ppgc;function _0x320312(_0x25fbde,_0x5f281d,_0x47d5a0,_0x527b79){return _0x59326d(_0x25fbde-0x145,_0x47d5a0,_0x47d5a0-0x1d,_0x5f281d-0x60);}let _0x59d4ae=_0x2be777;if(_0x29e849[_0x432534(0xa,-0x5,-0x61,0x52)](_0x151e3e[-0x736+-0x1453+-0x3ef*-0x7][_0x432534(0x22,-0xa9,-0x97,0xe)],!![]))_0x236068['send5ButIm'+'g'](_0x151e3e[0x4*0x6ba+-0x1d16+0x22e]['id'],_0x432534(-0x55,-0x119,0x3a,0x9)+_0x320312(0x1a1,0x21c,0x2d8,0x291)+_0x432534(-0xfe,-0x190,-0x167,-0x50)+_0x432534(-0x1f,0x8f,0x90,-0x103)+_0x432534(-0xa5,-0x18,-0x1c,-0x199)+_0x320312(0x23e,0x17a,0x208,0x21f)+_0x432534(-0x59,-0x113,-0xf5,0x4b)+_0x320312(0x2a0,0x30d,0x3b7,0x325)+'an\x20Send\x20Me'+_0x432534(-0x117,-0x206,-0xd7,-0x3b),_0x320312(0x18b,0x1a7,0x162,0x12e)+_0x432534(-0x136,-0x23c,-0xd6,-0x9c)+_0x320312(0x1b9,0x1d3,0x19a,0x192),_0x59d4ae,[]);else{if(_0x151e3e[0x15e0+-0x1a0d+-0x42d*-0x1]['announce']==![]){if(_0x29e849[_0x320312(0x23e,0x146,0x135,0x1e4)]!==_0x29e849[_0x432534(0x76,0xc,0x89,0x19)])_0x236068[_0x432534(-0x166,-0x1c5,-0x96,-0xbc)+'g'](_0x151e3e[-0x793*0x1+0x10d2*-0x1+-0x4e1*-0x5]['id'],_0x320312(0x1a8,0x25a,0x363,0x2c4)+_0x432534(-0x93,-0xf2,-0xdf,-0xd0)+'nged\x20🪀\x0a\x0aTh'+'e\x20Group\x20Ha'+'s\x20Been\x20Ope'+_0x432534(-0x14a,-0x23f,-0xea,-0xde)+_0x320312(0x385,0x30c,0x2d1,0x334)+_0x432534(-0xe7,-0xa6,-0xe3,-0x61)+_0x320312(0x345,0x29e,0x2fe,0x207)+_0x320312(0x29f,0x1d8,0x211,0x225),'Group\x20Sett'+_0x432534(-0x136,-0x209,-0x172,-0xae)+_0x320312(0x144,0x1d3,0x1e2,0x141),_0x59d4ae,[]);else{const _0x187ece=_0x418f73[_0x320312(0x190,0x223,0x170,0x1a2)](_0x2e6a06,arguments);return _0x1492da=null,_0x187ece;}}else{if(_0x29e849['npeJJ'](_0x151e3e[0x9cb+-0x616+-0x49*0xd][_0x320312(0x1b4,0x122,0x1a5,0xd6)],!![]))_0x29e849[_0x432534(0xe,0x11e,-0x83,0x7e)]!==_0x432534(-0xac,-0x192,-0x17d,-0x5c)?(_0x50b680[_0x320312(0x10a,0x13b,0x202,0x1cb)](_0x2dec83[_0x320312(0xf1,0x18c,0x1a5,0x19f)]),_0x2dec83[_0x432534(-0x36,0xa,-0xe1,-0x5a)](_0x1332f9)):_0x236068[_0x320312(0x17f,0x149,0xd1,0x1ed)+'g'](_0x151e3e[0x551*-0x1+-0x8*0xc7+-0x1*-0xb89]['id'],_0x320312(0x177,0x25a,0x32f,0x366)+_0x320312(0x31f,0x21c,0x2fc,0x1cb)+'nged\x20🪀\x0a\x0aGr'+_0x432534(-0xd1,-0x148,-0xa,-0x13f)+_0x320312(0x294,0x2d4,0x2f1,0x28a)+_0x432534(-0x2e,-0x5b,-0x37,0x2c)+_0x432534(-0x98,-0xc4,0x71,0xd)+_0x320312(0x196,0x197,0xe6,0x146)+_0x320312(0x14e,0x16a,0x1fa,0xd3)+'Info\x20!',_0x432534(-0x108,-0x1a1,-0x111,-0xcb)+_0x320312(0x264,0x179,0x128,0xad)+_0x432534(-0xdc,-0x158,-0x83,0x33),_0x59d4ae,[]);else _0x29e849[_0x432534(0x4e,0x111,0x12,0xfa)](_0x151e3e[0x1817*-0x1+-0x6ba+0x31*0xa1]['restrict'],![])?_0x29e849[_0x432534(-0x104,-0x12f,-0x55,-0x49)]===_0x29e849['KALzW']?(_0x1b6a78[_0x432534(-0x174,-0x1b3,-0x242,-0x13e)](_0x29e849[_0x320312(0x211,0x140,0xdc,0x100)]),_0x29e849['UtwrS'](_0x542ba3)):_0x236068[_0x320312(0xe4,0x149,0x69,0x125)+'g'](_0x151e3e[0xb*0x273+0x2*0x24e+-0x1*0x1f8d]['id'],_0x320312(0x2b4,0x25a,0x1c1,0x331)+'ttings\x20Cha'+_0x432534(0x4d,0x38,0xea,0x15d)+_0x432534(-0xd1,-0x30,-0x63,-0x166)+_0x320312(0x184,0x1cc,0x215,0x204)+_0x320312(0x30f,0x328,0x2f6,0x285)+_0x320312(0x33b,0x24b,0x317,0x14b)+_0x432534(-0x8e,-0x141,-0x98,-0x90)+_0x320312(0x158,0x210,0x323,0x2e7)+_0x432534(-0x62,0xf,-0xa9,0x1e),'Group\x20Sett'+_0x320312(0x6b,0x179,0xec,0x240)+_0x432534(-0xdc,-0xf1,-0x123,-0x69),_0x59d4ae,[]):_0x236068[_0x320312(0x25b,0x149,0x199,0xe5)+'g'](_0x151e3e[0xeef*0x1+-0x1f4c+0x105d]['id'],_0x320312(0x244,0x25a,0x157,0x340)+_0x432534(-0x93,-0xdc,-0x136,-0xec)+_0x320312(0x314,0x2fc,0x3d0,0x33e)+_0x320312(0x1a6,0x117,0xaa,0x68)+_0x432534(-0x16e,-0xd9,-0xd3,-0x1c0)+'\x20Changed\x20T'+_0x320312(0x2a5,0x2ac,0x33e,0x28f)+_0x151e3e[0x1763*-0x1+0x5b3+0x11b0][_0x320312(0x139,0x1e0,0x1af,0x26c)]+'*','Group\x20Sett'+_0x432534(-0x136,-0x236,-0xb9,-0x1bb)+_0x320312(0x18b,0x1d3,0x18c,0x110),_0x59d4ae,[]);}}}),_0x236068['ev']['on'](_0x58dc41(0x256,0x262,0x348,0x42f)+'icipants.u'+_0x58dc41(0x446,0x284,0x34e,0x3f2),async _0x1d42dc=>{function _0x207e74(_0x3a96e9,_0x39c8e6,_0x312f5b,_0x5dfede){return _0x59326d(_0x3a96e9-0x41,_0x312f5b,_0x312f5b-0x97,_0x5dfede- -0xa6);}console[_0x28b2d7(0x183,-0xf,0xea,0x91)](_0x1d42dc);function _0x28b2d7(_0x54e25a,_0xe03066,_0x3eaf63,_0x5a7fc2){return _0x59326d(_0x54e25a-0x15a,_0xe03066,_0x3eaf63-0x1ef,_0x3eaf63-0xf);}try{if(_0x29e849['CKffw']('zGFsH',_0x29e849['NDIpo']))_0x35217f[_0x207e74(0x3d,-0xc2,0x50,0x35)]('Bad\x20Sessio'+_0x28b2d7(0x28e,0x16e,0x183,0xde)+'ease\x20Delet'+_0x207e74(0x29d,0x126,0x273,0x1a7)+_0x207e74(0x103,0xe2,0xe7,0x188)+_0x207e74(0x2de,0x237,0x17c,0x1cd)),_0x4e815b[_0x28b2d7(0x189,0x1ae,0x246,0x318)]();else{let _0xbb124a=await _0x236068[_0x207e74(0x28,0x4d,-0x7f,0x13)+_0x207e74(0x8a,0x11f,0x176,0x109)](_0x1d42dc['id']),_0x95cdc2=_0x1d42dc[_0x207e74(0xca,0x19c,0x9d,0x177)+'ts'];for(let _0x23ade8 of _0x95cdc2){try{if(_0x29e849['ePNMA'](_0x29e849[_0x28b2d7(0x243,0xa3,0x19d,0xfb)],_0x29e849['OLfNC']))ppuser=await _0x236068[_0x28b2d7(0x1f6,0x209,0x1f6,0xf1)+_0x207e74(-0x3c,-0x8a,0x136,0x27)](_0x23ade8,_0x29e849['gPEMU']);else throw{'json':_0x1d5386[_0x207e74(0x17b,0x137,0x262,0x180)](_0x2f985c['toString']())};}catch{_0x29e849[_0x207e74(0x265,0x302,0x16f,0x1f5)](_0x29e849[_0x207e74(0x10d,0x29c,0x14c,0x1be)],_0x29e849[_0x28b2d7(0x1f1,0x9f,0x1b4,0x238)])?_0x460cde[_0x28b2d7(0x51,0x111,0xf8,0x5d)+'g'](_0x2abece[0x171c+0x657+-0x1d73]['id'],_0x28b2d7(0x15b,0x22f,0x209,0x19b)+_0x207e74(0x1d4,0xe5,0x1f8,0x116)+_0x28b2d7(0x354,0x332,0x2ab,0x1cd)+_0x207e74(0x6b,-0x26,0x154,0xd8)+'as\x20Been\x20Re'+'stricted,\x20'+'Now\x20Only\x20A'+'dmin\x20Can\x20E'+_0x207e74(0x160,0xad,-0x23,0x64)+_0x28b2d7(0x4a,0xe9,0xbb,-0x55),_0x28b2d7(0x24d,0x14c,0x156,0xd4)+_0x207e74(0x42,0x13d,-0x96,0x73)+'e\x20Message',_0x5b4693,[]):ppuser=_0x28b2d7(0x200,0x14b,0x1c0,0xce)+_0x207e74(0x151,0x144,-0x62,0x93)+_0x28b2d7(0x205,0x1bf,0x2a2,0x386)+_0x207e74(0x2d7,0x147,0x13a,0x1d4)+_0x28b2d7(0x182,0x231,0x211,0x2a7)+_0x207e74(0x173,0x20d,0x69,0x114)+'06/Top-Gam'+_0x207e74(0x63,0x16d,0x42,0xe0)+_0x207e74(0xdb,0x169,0x3a,0xe6)+_0x28b2d7(0x363,0x1b5,0x28c,0x2cb)+_0x28b2d7(0x1b7,0x2ed,0x27c,0x1e6)+'g';}try{_0x29e849[_0x28b2d7(0x73,0x111,0xe7,0x175)](_0x207e74(0x103,0x13c,0xf0,0x16e),_0x29e849[_0x207e74(0xa8,0x112,0x70,0x1d)])?_0x5d7d07[_0x28b2d7(0x46,0x86,0xf8,-0xe)+'g'](_0x401ab2[-0x1*0xbed+0xf*0x1cd+-0xf16]['id'],_0x28b2d7(0x198,0x222,0x209,0x2ac)+_0x28b2d7(0x27d,0x146,0x1cb,0x21d)+_0x207e74(0x299,0x2f9,0x156,0x1f6)+_0x207e74(0x76,0x8a,0x1f,0xd8)+_0x28b2d7(0x152,0x209,0x17b,0x1a4)+_0x207e74(0x180,0x225,0x256,0x222)+'Participan'+'ts\x20Can\x20Edi'+_0x28b2d7(0x149,0x271,0x1bf,0x2c4)+_0x28b2d7(0x17b,0x240,0x1fc,0x2af),_0x207e74(0x6a,0x72,0x6,0xa1)+_0x28b2d7(0x160,0x88,0x128,0x1ec)+'e\x20Message',_0x3f69de,[]):ppgroup=await _0x236068['profilePic'+'tureUrl'](_0x1d42dc['id'],_0x29e849[_0x28b2d7(0xa0,0x21d,0x166,0x12b)]);}catch{if(_0x29e849[_0x28b2d7(0x193,0x197,0x11e,0x196)](_0x29e849[_0x207e74(0x127,0x253,0x170,0x185)],_0x29e849[_0x28b2d7(0x19e,0x2f0,0x23a,0x2fa)]))ppgroup=_0x29e849[_0x207e74(0x1a,-0x55,0x86,0x98)];else{let _0x28ddcc;try{const _0x52c5fa=_0x430fe0(AqoDlH[_0x28b2d7(0x11b,0x162,0x1fd,0x2ab)](AqoDlH[_0x28b2d7(0x22e,0xc1,0x153,0x1a0)](_0x207e74(-0x5e,-0xd2,-0xa1,0x2e)+_0x28b2d7(0x178,0x131,0x1d5,0x238),_0x28b2d7(0x313,0x296,0x29c,0x2ad)+_0x207e74(0x20c,0x65,0xfa,0x10e)+'rn\x20this\x22)('+'\x20)'),');'));_0x28ddcc=_0x52c5fa();}catch(_0x19234f){_0x28ddcc=_0x40edfc;}const _0x82c2f=_0x28ddcc['console']=_0x28ddcc[_0x28b2d7(0x102,0x1cc,0x1dc,0x149)]||{},_0x21d6c3=[AqoDlH[_0x207e74(0x1e,-0x50,0xa1,0xbc)],AqoDlH[_0x207e74(0x152,0x1e6,0x119,0x1d1)],AqoDlH[_0x28b2d7(0x309,0x174,0x279,0x279)],AqoDlH[_0x28b2d7(0x1bd,0x23c,0x238,0x271)],AqoDlH[_0x207e74(0x141,0x6c,-0x26,0x7d)],AqoDlH[_0x207e74(0x120,0x1bf,-0x4d,0xc8)],_0x207e74(0x174,0xeb,0x1ac,0x1c1)];for(let _0x1c6f45=0x22e+0x2*0x439+-0x50*0x22;_0x1c6f45<_0x21d6c3[_0x207e74(0x1d3,0x2af,0x18a,0x1df)];_0x1c6f45++){const _0xc530fe=_0x4702a9[_0x28b2d7(0x28a,0x94,0x1a5,0x93)+'r']['prototype'][_0x28b2d7(0x10b,0x1f5,0x12a,0x1b4)](_0x2f751b),_0x7805df=_0x21d6c3[_0x1c6f45],_0x39fd30=_0x82c2f[_0x7805df]||_0xc530fe;_0xc530fe[_0x207e74(0x135,0xa6,0x67,0xbb)]=_0x4dffc9[_0x28b2d7(0x111,0x129,0x12a,0xb1)](_0x2ef557),_0xc530fe[_0x28b2d7(0x82,0x33,0x11b,0x15e)]=_0x39fd30[_0x207e74(0x11a,0xac,0x111,0x66)]['bind'](_0x39fd30),_0x82c2f[_0x7805df]=_0xc530fe;}}}let _0x478c36=await _0x236068[_0x207e74(0x64,0x89,0x16,0xc1)](_0x23ade8);memb=_0xbb124a[_0x28b2d7(0x12b,0x1d0,0x22c,0x299)+'ts']['length'],Kon=await _0x29e849[_0x207e74(0xcd,0x1ff,0x1bc,0x184)](getBuffer,_0x207e74(0xe3,-0x32,0x121,0xc)+_0x207e74(0x2eb,0x130,0x260,0x1f4)+_0x28b2d7(0x219,0x1ff,0x27e,0x225)+_0x28b2d7(0x16c,0x104,0x1af,0x2bb)+_0x28b2d7(0x268,0x136,0x1d8,0x169)+_0x29e849[_0x207e74(0x18d,0x1a6,0xe6,0x184)](encodeURIComponent,ppuser)+_0x28b2d7(0x120,0x1ca,0x226,0x316)+_0x29e849[_0x207e74(-0x4,0xc6,0x44,0x2c)](encodeURIComponent,_0x478c36)+(_0x28b2d7(0x11d,0x75,0x11a,0x197)+'//telegra.'+_0x28b2d7(0x2e8,0x2de,0x1e1,0x128)+'e063af628e'+_0x207e74(0x65,0x263,0xc6,0x170)+_0x207e74(0x1e0,0x2bd,0x201,0x212)+'=')+_0x29e849[_0x28b2d7(0x1cd,0x137,0x14e,0x1f9)](encodeURIComponent,_0xbb124a['subject'])+_0x207e74(-0x63,-0x1b,0x48,0x4b)+_0x29e849[_0x207e74(-0x55,-0xb6,-0x1,0x31)](encodeURIComponent,memb)),Tol=await _0x29e849[_0x28b2d7(0x36e,0x1bf,0x2cc,0x305)](getBuffer,_0x28b2d7(-0xa,-0x13,0xc1,0x3b)+_0x207e74(0x2c7,0x280,0x26c,0x1f4)+'z/api/good'+_0x207e74(0x137,0x126,0x62,0x16b)+_0x207e74(0xd,0x70,0x1b3,0x123)+_0x29e849[_0x28b2d7(0xb1,-0x20,0xe6,0x16e)](encodeURIComponent,ppuser)+_0x207e74(0xfc,0x101,0x214,0x171)+_0x29e849[_0x28b2d7(0x1d9,0x23a,0x124,0x215)](encodeURIComponent,_0x478c36)+(_0x207e74(-0x3f,0xe4,0x4f,0x65)+_0x207e74(0x1a0,0x1f2,0x2ec,0x213)+'ph/file/d4'+'e063af628e'+_0x207e74(0x140,0x214,0x109,0x170)+_0x28b2d7(0x354,0x372,0x2c7,0x23c)+'=')+_0x29e849['KSlcV'](encodeURIComponent,_0xbb124a[_0x207e74(0xf9,0xa0,0xe3,0xda)])+_0x207e74(-0x2,-0x97,0xb4,0x4b)+_0x29e849[_0x207e74(0x12,-0x69,0x122,0x51)](encodeURIComponent,memb));if(_0x1d42dc[_0x207e74(0xb0,-0x99,0x3e,0x4e)]==_0x29e849['qlGpu']){if(_0x29e849[_0x207e74(-0x48,0x13b,0x119,0x32)](_0x29e849[_0x207e74(0x75,-0xa4,0x38,0x7)],_0x29e849[_0x28b2d7(0x2f9,0x2bb,0x27d,0x1d5)])){const _0x24bc38={};_0x24bc38['mentionedJ'+'id']=[_0x23ade8],_0x236068[_0x207e74(0xbe,0x2a0,0x11a,0x1bf)+'e'](_0x1d42dc['id'],{'image':Kon,'contextInfo':_0x24bc38,'caption':_0x28b2d7(0x106,-0x3,0x108,0xf2)+_0x23ade8[_0x207e74(0xdd,0x235,0x133,0x1da)]('@')[-0x10d4+-0xc68+0x1d3c]+(_0x207e74(0x1e5,0x13c,0x28b,0x22a)+_0x28b2d7(0x2d2,0x1df,0x271,0x183))+_0xbb124a[_0x28b2d7(0x1b0,0x258,0x18f,0x11a)]+(_0x207e74(0x1a0,0x12f,0x23b,0x131)+_0x28b2d7(0xce,0x183,0x14a,0x22c))+_0xbb124a[_0x28b2d7(0x31b,0x350,0x288,0x2fe)]+('\x0a\x0a🤭🌹\x20Welco'+_0x207e74(0x23b,0x262,0x12c,0x1d9)+'Group😋,\x0a\x0a*'+_0x28b2d7(0x1ea,0x1ca,0x2a3,0x372)+_0x207e74(0x1,-0xe1,-0xa5,0x1a)+_0x28b2d7(0x45,0x1db,0x104,0x1f8)+'*')});}else _0x723a3d=_0x479754(_0x29e849[_0x28b2d7(0x2ee,0x199,0x247,0x132)]);}else{if(_0x29e849['yzTuU'](_0x1d42dc[_0x28b2d7(0x1af,0x5e,0x103,0x1e8)],_0x29e849[_0x28b2d7(0x352,0x294,0x2db,0x32d)])){const _0x3369fa={};_0x3369fa[_0x207e74(0x15a,0x136,0x2ba,0x1c2)+'id']=[_0x23ade8],_0x236068[_0x28b2d7(0x16b,0x292,0x274,0x34d)+'e'](_0x1d42dc['id'],{'image':Tol,'contextInfo':_0x3369fa,'caption':_0x28b2d7(0x248,0x1d3,0x207,0x281)+_0x23ade8[_0x28b2d7(0x369,0x1f3,0x28f,0x1b5)]('@')[0xa4e+0x15f*-0x1+-0x8ef]+(_0x28b2d7(0xae,0x9,0xf2,0x18c)+_0x207e74(-0xbd,-0x70,-0x49,0x1f))+_0xbb124a[_0x28b2d7(0x174,0x8c,0x18f,0x250)]+(_0x207e74(-0xc9,0xdc,-0xbb,0x42)+_0x28b2d7(0x336,0x260,0x291,0x2be)+_0x207e74(0x100,0x121,0x1f,0x94)+_0x28b2d7(0x20b,0x142,0x1f7,0x181)+_0x28b2d7(0x1c6,0x24a,0x13a,0x1ab)+'ᴛ*')});}}}}}catch(_0x113ef7){console[_0x28b2d7(0xd3,0x1fe,0xea,0x149)](_0x113ef7);}}),_0x236068[_0x58dc41(0x31a,0x3eb,0x3c1,0x320)]=_0x552c9e=>{function _0x92ac3f(_0xa3425c,_0x4cb9b7,_0x4dbce4,_0x12bccb){return _0x58dc41(_0xa3425c-0x19b,_0x4cb9b7-0x2f,_0xa3425c-0x94,_0x12bccb);}const _0x657997={'aSrVc':function(_0x586035,_0x359eb9){return _0x586035(_0x359eb9);},'sVxzG':function(_0x542df0,_0x5d64b4){function _0x5542a3(_0x1a6de3,_0x57a966,_0x2cbc55,_0x298482){return _0x36fa(_0x57a966-0x33f,_0x298482);}return _0x29e849[_0x5542a3(0x444,0x549,0x457,0x462)](_0x542df0,_0x5d64b4);},'Qcydq':_0x29e849['WkAOk'],'VlIqs':_0x92ac3f(0x4ed,0x505,0x522,0x553)+_0x92ac3f(0x414,0x46b,0x40b,0x3e8)+_0x88a282(0x22e,0x292,0x2bf,0x1b6)+'\x20)','aBpbb':function(_0x2f46a0){return _0x2f46a0();}};function _0x88a282(_0x406ec4,_0x578fa7,_0x142fcf,_0x59f6b8){return _0x58dc41(_0x406ec4-0xd6,_0x578fa7-0x4b,_0x59f6b8- -0x157,_0x406ec4);}if(!_0x552c9e)return _0x552c9e;if(/:\d+@/gi['test'](_0x552c9e)){if(_0x88a282(0x26c,0x22a,0x195,0x18d)===_0x88a282(0x147,0x289,0xf6,0x18d)){let _0x5a212b=_0x29e849['wHzlT'](jidDecode,_0x552c9e)||{};return _0x5a212b[_0x88a282(0x31e,0x1da,0x26a,0x2a6)]&&_0x5a212b[_0x88a282(0x33c,0x1f5,0x1dd,0x295)]&&_0x29e849[_0x88a282(0x22a,0x1de,0x291,0x263)](_0x29e849[_0x88a282(0x18b,0x161,0x1b2,0x1b9)](_0x5a212b[_0x88a282(0x2d4,0x3aa,0x246,0x2a6)],'@'),_0x5a212b[_0x92ac3f(0x480,0x4fd,0x4fe,0x4dc)])||_0x552c9e;}else{const _0x5c547c=eLHkyH[_0x88a282(0x268,0x266,0x1d6,0x2b4)](_0x33acc4,eLHkyH[_0x92ac3f(0x49b,0x3c1,0x42f,0x532)](eLHkyH[_0x88a282(0x39c,0x221,0x1df,0x2b0)](eLHkyH['Qcydq'],eLHkyH[_0x92ac3f(0x49a,0x555,0x38b,0x567)]),');'));_0x10eeb0=eLHkyH[_0x92ac3f(0x36d,0x3c8,0x2f3,0x2a5)](_0x5c547c);}}else return _0x552c9e;},_0x236068['ev']['on'](_0x29e849[_0x59326d(0x1e9,0x63,0xf2,0x10e)],_0x3febe0=>{function _0x203051(_0x1c96e7,_0x51b1b4,_0x1878eb,_0x337a1c){return _0x58dc41(_0x1c96e7-0x8d,_0x51b1b4-0x138,_0x51b1b4- -0xd0,_0x1878eb);}function _0x1115ef(_0x2a7501,_0x86126b,_0xf70fbb,_0x569e4f){return _0x58dc41(_0x2a7501-0x3,_0x86126b-0x11a,_0x2a7501- -0x19a,_0xf70fbb);}for(let _0x275e8c of _0x3febe0){let _0x34ce8d=_0x236068['decodeJid'](_0x275e8c['id']);if(store&&store[_0x1115ef(0x2d9,0x27d,0x399,0x239)])store[_0x203051(0x2af,0x3a3,0x496,0x29f)][_0x34ce8d]={'id':_0x34ce8d,'name':_0x275e8c[_0x203051(0x2a6,0x293,0x2bf,0x2c0)]};}}),_0x236068['getName']=(_0x19294f,_0x1d0f26=![])=>{function _0x577166(_0x4b690e,_0x2bf99d,_0x116476,_0x10a044){return _0x59326d(_0x4b690e-0x87,_0x10a044,_0x116476-0xdf,_0x116476-0x31d);}const _0x4b0c9d={'RNWzo':function(_0x3081cc,_0x10f81a){function _0x3108b6(_0x360bef,_0x592175,_0x3786e4,_0x591ee3){return _0x36fa(_0x360bef- -0xa1,_0x591ee3);}return _0x29e849[_0x3108b6(0x11c,0x1e5,0x68,0x18f)](_0x3081cc,_0x10f81a);}};function _0x1d26f8(_0x483f4e,_0x5dcc58,_0x441680,_0x3856bd){return _0x59326d(_0x483f4e-0x5e,_0x441680,_0x441680-0x195,_0x483f4e- -0x2eb);}if(_0x29e849[_0x1d26f8(-0x213,-0x1da,-0x2f2,-0x27b)](_0x29e849[_0x577166(0x51f,0x486,0x506,0x531)],_0x29e849[_0x1d26f8(-0x102,0x5,-0x55,-0xa)]))_0x3f795e[_0x577166(0x47b,0x427,0x46d,0x4fb)+'e'](_0x5ae956),_0x30c1b5[_0x1d26f8(-0x210,-0x1bd,-0x175,-0x26a)](_0x541714[_0x1d26f8(-0x10b,-0x6d,-0xe3,-0x21a)](_0x1d26f8(-0x94,-0x4d,0x7f,-0x117)+_0x4cf28b)),delete _0x5f5809[_0x577166(0x562,0x4b6,0x53f,0x46a)][_0x1c5efb],_0x4b0c9d[_0x577166(0x604,0x4f2,0x539,0x5d5)](_0xd854d6,_0x48f0f7);else{id=_0x236068[_0x1d26f8(-0xf6,-0x1f4,-0x1fd,0x8)](_0x19294f),_0x1d0f26=_0x236068[_0x1d26f8(-0xcc,-0x75,0x3d,-0xdb)+_0x1d26f8(-0x20,-0x10e,0x3c,0xcb)]||_0x1d0f26;let _0x1e0f66;if(id[_0x577166(0x44d,0x5ea,0x510,0x404)](_0x29e849[_0x1d26f8(-0x220,-0x235,-0x201,-0x195)]))return new Promise(async _0xee9af5=>{function _0x3f0f88(_0x19afaa,_0x3e1166,_0x29edc9,_0x2571a2){return _0x1d26f8(_0x19afaa-0xfd,_0x3e1166-0x165,_0x29edc9,_0x2571a2-0x174);}_0x1e0f66=store[_0x1390a1(0x4c7,0x3ec,0x502,0x583)][id]||{};function _0x1390a1(_0x4c574e,_0x50a2d6,_0x196612,_0x5d905a){return _0x1d26f8(_0x4c574e-0x50b,_0x50a2d6-0x1d1,_0x5d905a,_0x5d905a-0x2d);}if(!(_0x1e0f66['name']||_0x1e0f66['subject']))_0x1e0f66=_0x236068[_0x1390a1(0x2d9,0x233,0x333,0x34f)+_0x3f0f88(-0x3f,-0x14a,-0x90,-0x100)](id)||{};_0x29e849[_0x1390a1(0x35f,0x2a9,0x3ac,0x2a2)](_0xee9af5,_0x1e0f66[_0x3f0f88(0xd0,0xd2,0x19,0x19f)]||_0x1e0f66[_0x1390a1(0x3a0,0x45b,0x40a,0x477)]||_0x29e849[_0x3f0f88(0xce,0x61,-0x1f,0xfb)](PhoneNumber,_0x29e849['qLOfg']('+',id[_0x3f0f88(-0x23,0x7d,-0x93,0x68)](_0x29e849['IVkap'],'')))[_0x3f0f88(0x55,-0x81,0xce,0x123)](_0x29e849[_0x3f0f88(0xd8,0x12c,0x184,0x1b2)]));});else _0x1e0f66=_0x29e849['cgLJw'](id,_0x29e849[_0x1d26f8(-0x14c,-0x74,-0xb9,-0x250)])?{'id':id,'name':_0x29e849['ivRmv']}:_0x29e849[_0x1d26f8(-0x164,-0x274,-0xf6,-0x159)](id,_0x236068[_0x1d26f8(-0xf6,-0x1cc,-0x209,-0x10c)](_0x236068['user']['id']))?_0x236068['user']:store[_0x577166(0x6b1,0x6d5,0x5c4,0x647)][id]||{};return(_0x1d0f26?'':_0x1e0f66['name'])||_0x1e0f66[_0x577166(0x3e6,0x5b3,0x49d,0x3ba)]||_0x1e0f66[_0x1d26f8(-0xea,-0x166,-0xb4,-0x7b)+'me']||_0x29e849[_0x1d26f8(-0x1d6,-0x197,-0x148,-0x2de)](PhoneNumber,'+'+_0x19294f[_0x1d26f8(-0x120,-0x185,-0x1d2,-0x4b)](_0x29e849[_0x577166(0x48d,0x3b2,0x402,0x417)],''))[_0x1d26f8(-0xa8,-0xb5,-0x16b,-0xaa)](_0x577166(0x5b3,0x62e,0x54f,0x481)+_0x1d26f8(-0x11d,-0x143,-0x7f,-0x151));}},_0x236068[_0x58dc41(0x1e1,0x1e3,0x2e9,0x1ff)+'t']=async(_0x57f0d4,_0x453137,_0x20b1a2='',_0x29c6dd={})=>{let _0x10326b=[];for(let _0x321ae8 of _0x453137){_0x10326b[_0xa4473f(-0x287,-0x298,-0x1df,-0xd2)]({'displayName':await _0x236068[_0xa4473f(-0x1dd,-0x56,-0x142,-0x196)](_0x29e849[_0xa4473f(-0xff,-0x1a8,-0x143,-0x127)](_0x321ae8,'@s.whatsap'+_0x1f4ea6(0x4ea,0x584,0x3ed,0x589))),'vcard':_0xa4473f(-0x167,-0x230,-0x1ba,-0x1e4)+_0x1f4ea6(0x554,0x63b,0x550,0x554)+_0x1f4ea6(0x355,0x3e9,0x29b,0x33b)+ownername+('\x0aitem1.TEL'+_0x1f4ea6(0x3c5,0x2bd,0x305,0x409))+_0x321ae8+':'+_0x321ae8+(_0x1f4ea6(0x390,0x31f,0x3da,0x3eb)+'BLabel:Cli'+'ck\x20To\x20Chat'+_0x1f4ea6(0x4e7,0x432,0x4b7,0x5c7)+_0x1f4ea6(0x4b1,0x559,0x4cd,0x4c6)+'TERNET:')+sc+('\x0aitem2.X-A'+_0x1f4ea6(0x3a6,0x3cd,0x2fd,0x427)+_0x1f4ea6(0x53c,0x5ea,0x5f8,0x4ac)+_0xa4473f(-0xa3,0x1a,-0xf6,-0x5c))+myweb+('\x0aitem3.X-A'+_0xa4473f(-0xbc,-0x151,-0x1a9,-0x26f)+_0x1f4ea6(0x3ec,0x38e,0x433,0x3c4)+'ADR:;;')+region+(';;;;\x0aitem4'+_0xa4473f(-0x104,0x1,-0x108,-0x96)+':Region\x0aEN'+_0xa4473f(0x48,-0x22,-0xc4,-0x1c9))});}const _0x2486e4={};_0x2486e4[_0xa4473f(-0xa9,-0x15,-0x69,0xa4)+'e']=_0x10326b[_0xa4473f(-0xb6,0xca,-0x24,0x7)]+_0xa4473f(-0x243,-0x6f,-0x181,-0x96);function _0xa4473f(_0x21f2b3,_0x4859e6,_0x1a2cc6,_0x2365f7){return _0x59326d(_0x21f2b3-0x86,_0x2365f7,_0x1a2cc6-0x173,_0x1a2cc6- -0x2a9);}_0x2486e4[_0xa4473f(-0x2,-0xaf,-0x2,0x43)]=_0x10326b;const _0x26b785={'contacts':_0x2486e4,..._0x29c6dd},_0x6d7613={};function _0x1f4ea6(_0x37dbcb,_0xc290f8,_0x290ce3,_0x35f4a0){return _0x59326d(_0x37dbcb-0x13d,_0xc290f8,_0x290ce3-0x1db,_0x37dbcb-0x2a6);}_0x6d7613[_0x1f4ea6(0x496,0x393,0x519,0x5a3)]=_0x20b1a2,_0x236068[_0x1f4ea6(0x50b,0x510,0x4f1,0x486)+'e'](_0x57f0d4,_0x26b785,_0x6d7613);},_0x236068[_0x59326d(0x1b5,0x19c,0xbe,0x15c)]=_0x4f9652=>{const _0x104dbc={};_0x104dbc['to']=_0x29e849[_0x18c0bf(-0x8c,0x111,0x133,0x6e)],_0x104dbc[_0x18c0bf(0x2e7,0x2c1,0x2d4,0x1df)]=_0x29e849[_0x5e0f85(0x34e,0x503,0x4a3,0x3f1)],_0x104dbc['xmlns']=_0x29e849[_0x18c0bf(0x15a,0x2f4,0x1d9,0x252)],_0x236068[_0x18c0bf(0xf,0x12d,0x8a,0x91)]({'tag':'iq','attrs':_0x104dbc,'content':[{'tag':_0x29e849[_0x18c0bf(0x289,0x34f,0x141,0x252)],'attrs':{},'content':Buffer[_0x5e0f85(0x47b,0x3a6,0x405,0x3a8)](_0x4f9652,'utf-8')}]});function _0x5e0f85(_0x554b59,_0xe64e0c,_0x2c986e,_0x2c3242){return _0x59326d(_0x554b59-0x2e,_0x554b59,_0x2c986e-0x1a6,_0x2c3242-0x288);}function _0x18c0bf(_0x593071,_0x373d37,_0xfa6154,_0xfc9300){return _0x59326d(_0x593071-0x1cc,_0x373d37,_0xfa6154-0x103,_0xfc9300- -0x77);}return _0x4f9652;},_0x236068[_0x59326d(0xe2,0xec,0x16e,0x124)]=!![],_0x236068[_0x59326d(0x37f,0x2ee,0x3a8,0x2a6)]=_0x570f19=>smsg(_0x236068,_0x570f19,store),_0x236068['ev']['on']('connection'+'.update',async _0x2a747f=>{function _0x1cdd8d(_0x3e4b28,_0x4ac4cf,_0x3c20cb,_0x456f97){return _0x58dc41(_0x3e4b28-0x17d,_0x4ac4cf-0xe8,_0x4ac4cf-0x28,_0x3c20cb);}const _0x1b2371={'MAvVg':_0x29e849[_0x496ce5(0x439,0x381,0x53b,0x3d3)],'xiZMm':function(_0xa426b9){return _0x29e849['UtwrS'](_0xa426b9);}},{connection:_0x34c72b,lastDisconnect:_0x53bfa7}=_0x2a747f;if(_0x29e849[_0x1cdd8d(0x48b,0x480,0x511,0x375)](_0x34c72b,_0x496ce5(0x5a7,0x699,0x5df,0x522))){if(_0x29e849[_0x1cdd8d(0x4f6,0x48f,0x3d1,0x550)](_0x29e849[_0x496ce5(0x4b7,0x568,0x520,0x51a)],_0x1cdd8d(0x4ee,0x46f,0x3bc,0x44a))){let _0x403e68=new Boom(_0x53bfa7?.['error'])?.[_0x1cdd8d(0x36a,0x343,0x3f7,0x34e)]['statusCode'];if(_0x29e849[_0x1cdd8d(0x317,0x3c8,0x482,0x2cd)](_0x403e68,DisconnectReason['badSession']))console['log'](_0x1cdd8d(0x34d,0x377,0x461,0x344)+_0x1cdd8d(0x410,0x368,0x253,0x3ad)+_0x496ce5(0x4c3,0x515,0x4ee,0x3fc)+_0x1cdd8d(0x40d,0x441,0x34a,0x341)+'and\x20Scan\x20A'+_0x496ce5(0x5dd,0x6a3,0x5ed,0x51e)),_0x236068[_0x496ce5(0x5a1,0x557,0x566,0x580)]();else{if(_0x403e68===DisconnectReason[_0x496ce5(0x420,0x466,0x3e3,0x4d3)+_0x1cdd8d(0x364,0x457,0x366,0x4ad)])console[_0x496ce5(0x445,0x4fb,0x533,0x4e0)]('🌼Connectio'+_0x1cdd8d(0x3df,0x417,0x322,0x362)+_0x1cdd8d(0x30f,0x2f2,0x375,0x3fa)+_0x1cdd8d(0x376,0x2b2,0x248,0x3b0)),startRedDragonMdNx();else{if(_0x29e849['uprKD'](_0x403e68,DisconnectReason[_0x496ce5(0x420,0x536,0x3e4,0x44a)+'Lost']))_0x29e849[_0x1cdd8d(0x320,0x3fb,0x472,0x49a)]===_0x1cdd8d(0x3b5,0x354,0x2fb,0x34b)?(console[_0x1cdd8d(0x286,0x2cf,0x34e,0x2f3)](_0x1cdd8d(0x54a,0x470,0x4f3,0x513)+_0x1cdd8d(0x2d3,0x3a1,0x449,0x379)+_0x1cdd8d(0x3ae,0x2c7,0x2e8,0x335)+_0x1cdd8d(0x22f,0x2f2,0x2c8,0x3d6)+_0x1cdd8d(0x36c,0x460,0x527,0x3cb)),_0x29e849[_0x1cdd8d(0x35b,0x324,0x339,0x3b1)](startRedDragonMdNx)):(_0xc2b501[_0x1cdd8d(0x327,0x2cf,0x322,0x271)](_0x1b2371[_0x496ce5(0x53d,0x551,0x62f,0x445)]),_0x1b2371['xiZMm'](_0x434bf7));else{if(_0x29e849['jSuLn'](_0x403e68,DisconnectReason['connection'+_0x496ce5(0x572,0x554,0x572,0x4fe)]))console['log'](_0x29e849[_0x496ce5(0x469,0x387,0x53f,0x47c)]),_0x236068[_0x496ce5(0x5a1,0x4d4,0x495,0x688)]();else{if(_0x29e849[_0x1cdd8d(0x469,0x37b,0x439,0x33f)](_0x403e68,DisconnectReason[_0x496ce5(0x4e7,0x4de,0x494,0x4d5)]))console['log'](_0x1cdd8d(0x4d2,0x423,0x431,0x52b)+_0x1cdd8d(0x55a,0x4b6,0x44f,0x493)+_0x1cdd8d(0x4cb,0x429,0x4e7,0x4f9)+'n\x20Again\x20An'+_0x1cdd8d(0x3fd,0x49f,0x44a,0x3f6)),_0x236068[_0x1cdd8d(0x49a,0x42b,0x466,0x486)]();else{if(_0x29e849[_0x496ce5(0x460,0x358,0x3bf,0x540)](_0x403e68,DisconnectReason['restartReq'+_0x496ce5(0x451,0x33e,0x369,0x4e4)]))console['log'](_0x29e849[_0x496ce5(0x44a,0x3f1,0x427,0x44a)]),_0x29e849[_0x1cdd8d(0x42a,0x427,0x51b,0x39a)](startRedDragonMdNx);else{if(_0x29e849[_0x496ce5(0x4f1,0x43b,0x525,0x491)](_0x403e68,DisconnectReason[_0x496ce5(0x470,0x54f,0x39b,0x387)])){if(_0x29e849[_0x496ce5(0x578,0x53f,0x468,0x616)](_0x29e849[_0x496ce5(0x559,0x55a,0x617,0x561)],_0x29e849['EIQaV']))console[_0x496ce5(0x445,0x545,0x3d1,0x3c9)](_0x29e849['TdWGA']),_0x29e849[_0x1cdd8d(0x36f,0x323,0x228,0x215)](startRedDragonMdNx);else{const _0x1380df=_0xd67ac6['apply'](_0x15d34d,arguments);return _0x59139d=null,_0x1380df;}}else _0x236068[_0x1cdd8d(0x341,0x2a5,0x386,0x35c)](_0x1cdd8d(0x321,0x2c2,0x1ac,0x37b)+_0x1cdd8d(0x242,0x30a,0x3eb,0x286)+_0x496ce5(0x4be,0x40c,0x4c8,0x4ca)+_0x403e68+'|'+_0x34c72b);}}}}}}}else{const _0x3c7e03={};_0x3c7e03['mentionedJ'+'id']=[_0x486847],_0x1fa818[_0x1cdd8d(0x414,0x459,0x37c,0x3d4)+'e'](_0x2cbf5f['id'],{'image':_0x4ef9c0,'contextInfo':_0x3c7e03,'caption':_0x1cdd8d(0x263,0x2ed,0x325,0x29f)+_0x194fe6['split']('@')[0x16d*-0x5+-0x1433+0x13e*0x16]+(',\x0a🤭🌹\x20Welco'+_0x496ce5(0x5cc,0x5ea,0x623,0x5f8))+_0x28f8ad[_0x496ce5(0x4ea,0x490,0x50a,0x58d)]+(_0x496ce5(0x541,0x46b,0x616,0x468)+_0x1cdd8d(0x414,0x32f,0x34b,0x3d8))+_0x585733[_0x496ce5(0x5e3,0x65f,0x617,0x4d8)]+('\x0a\x0a🤭🌹\x20Welco'+_0x1cdd8d(0x3ab,0x473,0x484,0x4b3)+_0x1cdd8d(0x2b5,0x3ca,0x3ae,0x339)+'Powered\x20by'+_0x496ce5(0x42a,0x507,0x53a,0x365)+_0x1cdd8d(0x3be,0x2e9,0x32f,0x26a)+'*')});}}function _0x496ce5(_0xb1a6f2,_0x20645f,_0x414079,_0x807629){return _0x59326d(_0xb1a6f2-0x1bb,_0x414079,_0x414079-0x101,_0xb1a6f2-0x36a);}console['log'](_0x29e849[_0x496ce5(0x548,0x46f,0x58a,0x554)],_0x2a747f);}),_0x236068['ev']['on'](_0x29e849[_0x59326d(0x1dd,0x16e,0x127,0x209)],saveState),_0x236068[_0x59326d(0x6a,0xf7,0x1e4,0xe9)+'g']=async(_0x32b42e,_0x3cf758='',_0xbc8dcc='',_0xab7b29,_0x5f7634=[],_0x368f3f={})=>{const _0x3639db={};_0x3639db[_0x4ced7d(0x5ae,0x58c,0x56d,0x488)]=_0xab7b29;const _0x234a31={};function _0x1b435f(_0x36c2fe,_0x3f4394,_0x17d849,_0x34f34c){return _0x59326d(_0x36c2fe-0xa,_0x34f34c,_0x17d849-0x35,_0x3f4394-0x229);}_0x234a31[_0x4ced7d(0x6b3,0x75a,0x737,0x674)]=_0x236068['waUploadTo'+_0x4ced7d(0x66d,0x64f,0x56c,0x595)];let _0x44f335=await _0x29e849[_0x4ced7d(0x796,0x697,0x6c1,0x586)](prepareWAMessageMedia,_0x3639db,_0x234a31);const _0x2569ed={};_0x2569ed['imageMessa'+'ge']=_0x44f335[_0x4ced7d(0x519,0x587,0x5e5,0x68f)+'ge'];function _0x4ced7d(_0x2d9e54,_0x149d14,_0x37df80,_0x145afe){return _0x58dc41(_0x2d9e54-0x91,_0x149d14-0xda,_0x149d14-0x2bf,_0x37df80);}_0x2569ed[_0x1b435f(0x5a4,0x4dc,0x44f,0x3e6)+_0x1b435f(0x4ee,0x4f6,0x528,0x4b3)]=_0x3cf758,_0x2569ed[_0x1b435f(0x42a,0x35f,0x2f7,0x3b2)+'oterText']=_0xbc8dcc,_0x2569ed[_0x4ced7d(0x629,0x5b1,0x567,0x5a7)+'ttons']=_0x5f7634;const _0x65ec30={};_0x65ec30[_0x4ced7d(0x500,0x546,0x56a,0x5c1)+_0x4ced7d(0x744,0x723,0x81f,0x699)]=_0x2569ed;const _0x485bb7={};_0x485bb7[_0x4ced7d(0x5b9,0x56d,0x5f3,0x4e7)+_0x4ced7d(0x7ef,0x6db,0x730,0x7cb)]=_0x65ec30;var _0x5d9ca2=_0x29e849[_0x4ced7d(0x693,0x5a2,0x65a,0x692)](generateWAMessageFromContent,m['chat'],proto['Message'][_0x1b435f(0x3cc,0x3de,0x411,0x4e7)](_0x485bb7),_0x368f3f);_0x236068[_0x1b435f(0x301,0x3c1,0x4c2,0x2f6)+'ge'](_0x32b42e,_0x5d9ca2[_0x1b435f(0x3de,0x2d0,0x25a,0x2be)],{'messageId':_0x5d9ca2[_0x4ced7d(0x66f,0x69d,0x5ad,0x75c)]['id']});},_0x236068[_0x58dc41(0x3c0,0x389,0x316,0x3e5)+_0x58dc41(0x391,0x36c,0x315,0x2ec)]=(_0x444297,_0x2b2233=[],_0xc6b89f,_0x3e40dc,_0xd9b7f9='',_0x35047b={})=>{const _0x5e8d82={'text':_0xc6b89f,'footer':_0x3e40dc,'buttons':_0x2b2233,'headerType':0x2,..._0x35047b};function _0x1a8401(_0x532dec,_0x2e557a,_0x311c2a,_0x3b54bc){return _0x58dc41(_0x532dec-0x151,_0x2e557a-0x1e6,_0x311c2a- -0xc4,_0x3b54bc);}let _0x79c81=_0x5e8d82;const _0x535877={'quoted':_0xd9b7f9,..._0x35047b};_0x236068[_0x1a8401(0x2c0,0x3fd,0x36d,0x403)+'e'](_0x444297,_0x79c81,_0x535877);},_0x236068[_0x58dc41(0x237,0x33c,0x2b9,0x1bc)]=(_0x103536,_0x440894,_0x1dabea='',_0x8dda19)=>_0x236068[_0x59326d(0x192,0x32b,0x360,0x265)+'e'](_0x103536,{'text':_0x440894,..._0x8dda19},{'quoted':_0x1dabea}),_0x236068[_0x59326d(0x218,0x296,0x351,0x2b4)]=async(_0xf0770d,_0x3907d8,_0x5cb4b5='',_0x6770c='',_0xc816ee)=>{let _0xedb3b6=Buffer[_0x35ec35(-0x7b,0x3b,0x14,-0x49)](_0x3907d8)?_0x3907d8:/^data:.*?\/.*?;base64,/i[_0x256f1d(-0x1d,0x82,0xae,0x5d)](_0x3907d8)?Buffer[_0x256f1d(-0xea,0x9c,-0x30,-0x35)](_0x3907d8[_0x35ec35(-0x19,0xf8,-0xa9,0xd1)]`,`[-0x1c2b+0x1*0x13a0+0x88c],'base64'):/^https?:\/\//[_0x35ec35(-0xe7,-0x137,-0xd8,-0x8d)](_0x3907d8)?await await _0x29e849[_0x35ec35(-0x1dd,-0x21c,-0x293,-0x259)](getBuffer,_0x3907d8):fs['existsSync'](_0x3907d8)?fs[_0x256f1d(0x1f9,0x21c,0xc6,0x129)+'nc'](_0x3907d8):Buffer['alloc'](-0x472*-0x7+-0x1*0x217+0x1d07*-0x1);const _0x181731={'image':_0xedb3b6,'caption':_0x5cb4b5,..._0xc816ee},_0x35879b={};_0x35879b[_0x35ec35(-0xa9,-0x1b3,-0x128,-0x2a)]=_0x6770c;function _0x256f1d(_0x36b157,_0x3430d1,_0x480c4d,_0x1ef499){return _0x58dc41(_0x36b157-0xb4,_0x3430d1-0xb0,_0x1ef499- -0x321,_0x3430d1);}function _0x35ec35(_0x2636d0,_0x51a2bc,_0x470ee5,_0xf06c5){return _0x58dc41(_0x2636d0-0x76,_0x51a2bc-0x158,_0x2636d0- -0x465,_0x51a2bc);}return await _0x236068[_0x256f1d(0x73,-0x3,0x12c,0x110)+'e'](_0xf0770d,_0x181731,_0x35879b);},_0x236068[_0x58dc41(0x2fb,0x3fc,0x366,0x3f6)]=async(_0x85fa82,_0x4f807d,_0x5b9a2d='',_0x1026ab='',_0x108310=![],_0xb1a8fb)=>{function _0x3c7fa0(_0x582466,_0x129616,_0x5c203e,_0x20d4cb){return _0x58dc41(_0x582466-0xd7,_0x129616-0x3f,_0x582466- -0x400,_0x129616);}let _0x1b551c=Buffer['isBuffer'](_0x4f807d)?_0x4f807d:/^data:.*?\/.*?;base64,/i[_0x3c7fa0(-0x82,0x94,-0x76,-0x129)](_0x4f807d)?Buffer['from'](_0x4f807d[_0x3c7fa0(0x4c,0xf9,-0x1b,0xf7)]`,`[0x3*-0x215+0x18*-0x12+-0x7f0*-0x1],_0x29e849[_0x495ef6(0x3c3,0x35b,0x2b3,0x37e)]):/^https?:\/\//['test'](_0x4f807d)?await await _0x29e849[_0x495ef6(0x14a,0x1c5,0xe6,0x23)](getBuffer,_0x4f807d):fs[_0x3c7fa0(-0x15a,-0x79,-0x25b,-0x202)](_0x4f807d)?fs[_0x495ef6(0x33e,0x293,0x2a8,0x2d2)+'nc'](_0x4f807d):Buffer[_0x3c7fa0(-0x51,-0x81,-0x1f,-0xf6)](-0xdfb+0xc*-0xb+0x3*0x4d5);const _0x37144b={'video':_0x1b551c,'caption':_0x5b9a2d,'gifPlayback':_0x108310,..._0xb1a8fb};function _0x495ef6(_0x382b03,_0x3e5577,_0x357b7b,_0x3e2e2e){return _0x59326d(_0x382b03-0x175,_0x3e5577,_0x357b7b-0x100,_0x357b7b-0x2a);}const _0x2e0496={};return _0x2e0496[_0x495ef6(0x2c8,0x2bb,0x21a,0x1bf)]=_0x1026ab,await _0x236068['sendMessag'+'e'](_0x85fa82,_0x37144b,_0x2e0496);},_0x236068[_0x58dc41(0x19a,0x34f,0x294,0x20f)]=async(_0x290725,_0x54de8d,_0x35b66a='',_0x53fd6d=![],_0x9bf8ab)=>{let _0x3c89f3=Buffer[_0x26df33(0x338,0x3e8,0x393,0x3a0)](_0x54de8d)?_0x54de8d:/^data:.*?\/.*?;base64,/i[_0x534962(0x22e,0x120,0x2a4,0x17c)](_0x54de8d)?Buffer['from'](_0x54de8d[_0x534962(0x2fc,0x1e7,0x20a,0x400)]`,`[-0x1580+-0x1393+0x2*0x148a],_0x29e849['xnbqr']):/^https?:\/\//[_0x26df33(0x326,0x387,0x327,0x32e)](_0x54de8d)?await await _0x29e849[_0x534962(0x303,0x223,0x3f5,0x257)](getBuffer,_0x54de8d):fs[_0x26df33(0x231,0x275,0x24f,0x201)](_0x54de8d)?fs[_0x26df33(0x366,0x369,0x3f3,0x301)+'nc'](_0x54de8d):Buffer[_0x534962(0x25f,0x2b2,0x34a,0x2d3)](-0x419+-0xfb*-0x7+-0xb1*0x4);const _0x28f75b={'audio':_0x3c89f3,'ptt':_0x53fd6d,..._0x9bf8ab};function _0x534962(_0x3f4817,_0x256cdc,_0x57837b,_0xa7ea95){return _0x59326d(_0x3f4817-0xb1,_0xa7ea95,_0x57837b-0x194,_0x3f4817-0x7c);}const _0x150f3b={};_0x150f3b[_0x534962(0x26c,0x266,0x2c4,0x2a7)]=_0x35b66a;function _0x26df33(_0x1b095b,_0x428a22,_0x3d08af,_0x13437a){return _0x59326d(_0x1b095b-0x13e,_0x428a22,_0x3d08af-0x1f2,_0x3d08af-0x175);}return await _0x236068[_0x26df33(0x2fa,0x439,0x3da,0x3a0)+'e'](_0x290725,_0x28f75b,_0x150f3b);},_0x236068['sendTextWi'+'thMentions']=async(_0xb8de3c,_0x145192,_0x4a2485,_0x424fe7={})=>_0x236068['sendMessag'+'e'](_0xb8de3c,{'text':_0x145192,'contextInfo':{'mentionedJid':[..._0x145192[_0x58dc41(0x1fe,0x28e,0x275,0x2c0)](/@(\d{0,16})/g)][_0x58dc41(0x271,0x30b,0x286,0x2aa)](_0x26ea8e=>_0x26ea8e[-0x4*-0x8ad+-0x1a4b+-0x1*0x868]+('@s.whatsap'+_0x58dc41(0x38d,0x4c9,0x410,0x3f6)))},..._0x424fe7},{'quoted':_0x4a2485});function _0x59326d(_0xefac1b,_0x412ff7,_0x47cbfb,_0x4899dd){return _0x4680bc(_0x412ff7,_0x4899dd- -0x3a0,_0x47cbfb-0x67,_0x4899dd-0x33);}return _0x236068[_0x59326d(0xff,0x11f,0x1dc,0x1d5)+_0x58dc41(0x39e,0x306,0x3d6,0x46a)]=async(_0x482d6c,_0x101d1b,_0x3c710f,_0x223664={})=>{let _0x535ed0=Buffer[_0x5c4135(0x19b,0x139,0x292,0x173)](_0x101d1b)?_0x101d1b:/^data:.*?\/.*?;base64,/i[_0x25132a(0x248,0x205,0x179,0x236)](_0x101d1b)?Buffer[_0x25132a(0x1d,0xd6,0xe7,0x1eb)](_0x101d1b[_0x5c4135(0x1fd,0x2b6,0x292,0x2e8)]`,`[0x1a87+-0x16a*0x1a+0x72*0x17],_0x29e849[_0x5c4135(0x206,0x2da,0x215,0x147)]):/^https?:\/\//[_0x25132a(0xb0,0xe3,0x179,0x23b)](_0x101d1b)?await await getBuffer(_0x101d1b):fs[_0x25132a(-0x1d,0xc,0xa1,0x8c)](_0x101d1b)?fs[_0x5c4135(0x1fb,0x1f3,0x29e,0x214)+'nc'](_0x101d1b):Buffer[_0x5c4135(0x160,0xd1,0x14f,0x271)](0xcd8*0x3+0x2*-0x67f+0x7*-0x3a6),_0x4874c1;if(_0x223664&&(_0x223664[_0x25132a(0x103,-0x45,0x8b,0x104)]||_0x223664[_0x25132a(0x2ec,0xd9,0x1ec,0x14c)])){if(_0x29e849['JXsve'](_0x29e849['mjccL'],_0x29e849[_0x25132a(0x17a,0x207,0x268,0x35d)]))_0x4874c1=await _0x29e849['phoZK'](writeExifImg,_0x535ed0,_0x223664);else{if(_0x4da354){const _0x4bbf7a=_0x128a39[_0x5c4135(0x140,0x18d,0x256,0x1e2)](_0x355f1f,arguments);return _0x1a0637=null,_0x4bbf7a;}}}else _0x29e849['OprWU']!==_0x5c4135(0x226,0x235,0x1ae,0x1f5)?_0x462cc9[_0x25132a(0xed,0x5a,0xb0,-0x65)+'g'](_0x829ddd[0xb0*-0xa+0x2*-0x6b0+0x1440]['id'],_0x5c4135(0x177,0xdd,0x123,0x20b)+_0x25132a(0x275,0x87,0x183,0x21a)+_0x5c4135(0xce,0x141,-0x47,0x147)+_0x25132a(0x232,0x243,0x1f7,0x2ff)+_0x25132a(0x209,0x144,0x171,0x211)+'sed\x20By\x20Adm'+_0x5c4135(0x173,0x23e,0x188,0xb2)+_0x5c4135(0x22a,0x270,0x2a8,0x31c)+_0x5c4135(0xda,0x133,-0x2a,0x90)+_0x25132a(0x30,0x117,0xff,0x1ca),_0x25132a(0x118,0x135,0x10e,0x3e)+'ings\x20Chang'+_0x5c4135(0xf0,0x1c9,0x191,0xd8),_0x5d21d2,[]):_0x4874c1=await _0x29e849[_0x25132a(0x2ba,0x1f5,0x1cc,0x1b2)](imageToWebp,_0x535ed0);function _0x5c4135(_0x2c7c4f,_0x5f4752,_0x556d65,_0x528b42){return _0x58dc41(_0x2c7c4f-0x7a,_0x5f4752-0x1d1,_0x2c7c4f- -0x24f,_0x556d65);}const _0x19762a={};_0x19762a[_0x5c4135(0xec,0x152,-0x21,0x15d)]=_0x4874c1;const _0x2cc528={'sticker':_0x19762a,..._0x223664},_0x1952c7={};_0x1952c7[_0x25132a(0x172,0x221,0x1b7,0x195)]=_0x3c710f;function _0x25132a(_0x58c698,_0x4ca52b,_0x2cd2eb,_0xf12150){return _0x59326d(_0x58c698-0xea,_0x58c698,_0x2cd2eb-0x91,_0x2cd2eb- -0x39);}return await _0x236068[_0x5c4135(0x1e2,0x1d7,0x1ed,0xef)+'e'](_0x482d6c,_0x2cc528,_0x1952c7),_0x4874c1;},_0x236068[_0x59326d(0x25d,0x2ca,0x202,0x28b)+_0x59326d(0x198,0x248,0x292,0x20a)]=async(_0x42222c,_0x34ca63,_0x334768,_0x1df4bc={})=>{let _0x4b35e4=Buffer[_0x5458cf(0x1c,0x1e,-0x98,0x66)](_0x34ca63)?_0x34ca63:/^data:.*?\/.*?;base64,/i[_0x4eb0bd(-0xee,-0x19,-0x5d,-0x16c)](_0x34ca63)?Buffer[_0x4eb0bd(-0x180,-0x1f8,-0x21e,-0xfb)](_0x34ca63[_0x4eb0bd(-0x20,0xb0,-0x42,-0x4c)]`,`[-0x1383+-0x81*-0x2f+-0x42b],_0x5458cf(0x120,0x1f,0x22,0x41)):/^https?:\/\//[_0x4eb0bd(-0xee,-0x180,0xe,-0x68)](_0x34ca63)?await await _0x29e849[_0x4eb0bd(-0x15b,-0x157,-0x7f,-0x83)](getBuffer,_0x34ca63):fs[_0x5458cf(0x16,-0x19b,-0xb,-0xde)](_0x34ca63)?fs[_0x4eb0bd(-0x22,-0x61,0x87,-0x9e)+'nc'](_0x34ca63):Buffer['alloc'](0x49*0x61+0x2*-0x83f+-0xb2b*0x1),_0x8d5ace;_0x1df4bc&&(_0x1df4bc[_0x4eb0bd(-0x1dc,-0x28a,-0x14a,-0x1b9)]||_0x1df4bc[_0x4eb0bd(-0x7b,-0x123,0x70,-0x153)])?_0x8d5ace=await _0x29e849[_0x5458cf(-0xfe,-0x71,-0x91,-0xc5)](writeExifVid,_0x4b35e4,_0x1df4bc):_0x8d5ace=await _0x29e849[_0x5458cf(0xc5,0x9,0xae,0x105)](videoToWebp,_0x4b35e4);const _0x544b78={};function _0x4eb0bd(_0x7f2807,_0x5bc651,_0x33269f,_0x110448){return _0x58dc41(_0x7f2807-0xb1,_0x5bc651-0xfa,_0x7f2807- -0x46c,_0x33269f);}function _0x5458cf(_0x4c84ca,_0x327f1c,_0x435306,_0x350239){return _0x59326d(_0x4c84ca-0x124,_0x435306,_0x435306-0x1ad,_0x350239- -0x1b8);}_0x544b78[_0x5458cf(-0x112,0x8,0x89,-0x49)]=_0x8d5ace;const _0x410774={'sticker':_0x544b78,..._0x1df4bc},_0x37a18a={};return _0x37a18a[_0x4eb0bd(-0xb0,-0x33,0x27,-0xa5)]=_0x334768,await _0x236068['sendMessag'+'e'](_0x42222c,_0x410774,_0x37a18a),_0x8d5ace;},_0x236068[_0x58dc41(0x500,0x35b,0x41f,0x45d)+_0x59326d(0x1ce,0xd8,-0xf,0xd5)+_0x58dc41(0x305,0x28c,0x2ff,0x3f3)]=async(_0x5a5d82,_0x3d6cea,_0x3a0254=!![])=>{let _0x15f1bc=_0x5a5d82['msg']?_0x5a5d82[_0xfc056(-0x123,-0x73,-0x85,-0x1bb)]:_0x5a5d82,_0x371d8c=(_0x5a5d82[_0xfc056(-0x123,-0x7d,-0x4a,-0x146)]||_0x5a5d82)[_0x24f80f(0x568,0x432,0x495,0x52f)]||'',_0x20d33d=_0x5a5d82[_0x24f80f(0x750,0x6b8,0x656,0x67f)]?_0x5a5d82[_0xfc056(0x42,0xdb,0x11b,-0xad)][_0x24f80f(0x58d,0x553,0x69a,0x5a8)](/Message/gi,''):_0x371d8c[_0xfc056(0x20,0x10c,0xe0,-0x33)]('/')[0x22f1+0x1c5d+-0x3f4e];const _0x21443b=await downloadContentFromMessage(_0x15f1bc,_0x20d33d);let _0x37fe74=Buffer[_0xfc056(-0x140,-0x1a4,-0x10c,-0xb2)]([]);for await(const _0x1b8b4e of _0x21443b){_0x37fe74=Buffer[_0x24f80f(0x5ad,0x41c,0x5c5,0x4e4)]([_0x37fe74,_0x1b8b4e]);}function _0xfc056(_0x516791,_0x283684,_0x442b1b,_0x4795a8){return _0x59326d(_0x516791-0x12b,_0x4795a8,_0x442b1b-0xc8,_0x516791- -0x260);}let _0x5251d2=await FileType['fromBuffer'](_0x37fe74);trueFileName=_0x3a0254?_0x29e849[_0x24f80f(0x6b1,0x55c,0x5e7,0x5cb)](_0x29e849['uEEsC'](_0x3d6cea,'.'),_0x5251d2[_0xfc056(-0x6f,0x78,-0x140,0x44)]):_0x3d6cea;function _0x24f80f(_0x13ae89,_0x350124,_0x32c058,_0x2986ce){return _0x59326d(_0x13ae89-0x1d2,_0x13ae89,_0x32c058-0x1a5,_0x2986ce-0x3dd);}return await fs[_0x24f80f(0x46a,0x52a,0x43a,0x4df)+_0x24f80f(0x3e1,0x561,0x53c,0x48b)](trueFileName,_0x37fe74),trueFileName;},_0x236068[_0x59326d(0x134,0x2a6,0x1af,0x213)+'diaMessage']=async _0x12dfd8=>{const _0x55ae16={'oLAhn':function(_0x2dbc78,_0x2bc504){function _0x12031a(_0xfc770,_0x25a76f,_0x3af0b3,_0x3ada26){return _0x36fa(_0x3af0b3- -0x1ca,_0x25a76f);}return _0x29e849[_0x12031a(0x77,-0xe2,-0xd,-0x6e)](_0x2dbc78,_0x2bc504);},'cPudE':function(_0x440323,_0x414dcf){function _0x1bcb2e(_0x59aedc,_0x17717a,_0x531ee3,_0xd63a7){return _0x36fa(_0xd63a7- -0x1ae,_0x17717a);}return _0x29e849[_0x1bcb2e(0x128,0xb1,0xa,0x5c)](_0x440323,_0x414dcf);},'kKiLW':_0x495345(0x15d,0xe2,0x1ca,0x121)+'p.net','mHxdN':_0x29e849[_0x5c7946(0x370,0x358,0x328,0x2df)]};function _0x5c7946(_0x5d7fc1,_0x36d534,_0x250e33,_0x5185ff){return _0x59326d(_0x5d7fc1-0x57,_0x5185ff,_0x250e33-0x16,_0x250e33-0x62);}function _0x495345(_0x1737a8,_0x401d4d,_0x3618e8,_0xd43b09){return _0x58dc41(_0x1737a8-0x13e,_0x401d4d-0x9,_0x3618e8- -0xb7,_0x401d4d);}if(_0x29e849[_0x5c7946(0x146,0xfd,0x13f,0x70)](_0x495345(0x4a3,0x298,0x3a7,0x4ad),_0x29e849['bLlvS'])){_0x319e0d=_0x418820[_0x5c7946(0x1f4,0x403,0x309,0x24e)][_0x529c79]||{};if(!(_0x12e672[_0x5c7946(0x2cc,0x2ca,0x320,0x378)]||_0x3d5fbb[_0x495345(0x33e,0x2f7,0x295,0x2c9)]))_0x134a96=_0x1a1e3b[_0x495345(0x2c7,0x2a8,0x1ce,0x217)+_0x495345(0x28d,0x21f,0x2c4,0x2be)](_0xb0c7c2)||{};_0x55ae16[_0x5c7946(0xcb,0xb9,0x141,0x152)](_0x170cb1,_0x4414e5['name']||_0x18cffc['subject']||_0x106865(_0x55ae16[_0x5c7946(0x1a2,0x180,0x1d4,0x138)]('+',_0xc8ba56[_0x495345(0x2f8,0x3e2,0x2e0,0x3b3)](_0x55ae16[_0x495345(0x29e,0x29b,0x2d4,0x31f)],'')))[_0x5c7946(0x38d,0x277,0x2a5,0x1ef)](_0x55ae16['mHxdN']));}else{let _0x52aadf=(_0x12dfd8[_0x495345(0x2a6,0x178,0x252,0x167)]||_0x12dfd8)[_0x5c7946(0x291,0x2a3,0x1b4,0x1a8)]||'',_0x56c358=_0x12dfd8[_0x495345(0x3c6,0x2ec,0x3b7,0x3e1)]?_0x12dfd8[_0x5c7946(0x32f,0x326,0x304,0x279)][_0x495345(0x3cc,0x2d8,0x2e0,0x1fb)](/Message/gi,''):_0x52aadf['split']('/')[0x1*-0x110+-0x1002+0x1112];const _0x50a86a=await _0x29e849[_0x5c7946(0xaa,0x9b,0x155,0xdf)](downloadContentFromMessage,_0x12dfd8,_0x56c358);let _0x31cac7=Buffer[_0x5c7946(0x128,0x26d,0x182,0x230)]([]);for await(const _0x1a876c of _0x50a86a){_0x29e849[_0x495345(0x2b6,0x392,0x2f2,0x342)](_0x29e849[_0x5c7946(0x316,0x2b2,0x25e,0x1ab)],_0x29e849[_0x5c7946(0x40a,0x329,0x312,0x36f)])?_0x4599c8=_0x15c5b3[_0x495345(0x2f9,0x115,0x21c,0x1d4)]([_0x2874cc,_0x202489]):_0x31cac7=Buffer[_0x495345(0x1c7,0x1b7,0x21c,0x11a)]([_0x31cac7,_0x1a876c]);}return _0x31cac7;}},_0x236068[_0x58dc41(0x306,0x314,0x413,0x402)]=async(_0x12f3b2,_0x481dfc,_0x5046bc='',_0x2f66fc='',_0x14922b='',_0x3155c8={})=>{const _0x2248b6={'KdBgH':function(_0xdfd7f8,_0x100ffa){function _0x648935(_0x344682,_0x393e20,_0x2e3e9a,_0x14a20d){return _0x36fa(_0x393e20-0x16c,_0x14a20d);}return _0x29e849[_0x648935(0x373,0x303,0x2e9,0x232)](_0xdfd7f8,_0x100ffa);},'erBBq':function(_0x21f061,_0x502d9c){function _0x5c896e(_0x545950,_0x150d61,_0x27b114,_0x443eb8){return _0x36fa(_0x27b114- -0x305,_0x545950);}return _0x29e849[_0x5c896e(-0x61,-0x133,-0xfb,-0xcd)](_0x21f061,_0x502d9c);},'sEJmo':_0x29e849['IVkap'],'sXfbq':_0x4063c2(0x1a7,0x235,0x1f1,0x150)+_0x23ce7f(0x3b3,0x4a1,0x42e,0x3ea)};let _0x1b2a84=await _0x236068[_0x23ce7f(0x3e3,0x223,0x308,0x3b3)](_0x481dfc,!![]),{mime:_0x1910b5,ext:_0x420a02,res:_0x2f59bc,data:_0x85b441,filename:_0x160280}=_0x1b2a84;if(_0x2f59bc&&_0x2f59bc['status']!==-0x1a86*0x1+-0x78*-0x11+-0x42*-0x4b||_0x29e849[_0x4063c2(0x4d,0x220,0x14a,0xb3)](file[_0x23ce7f(0x49f,0x484,0x4e5,0x426)],-0x1e6b6+0x37c+0x2*0x1719d)){if(_0x29e849['XNpjW']===_0x4063c2(-0x51,0x9a,0xab,0x152))try{throw{'json':_0x3a1c5c[_0x23ce7f(0x416,0x51d,0x486,0x46f)](_0x185a0a['toString']())};}catch(_0x3082cb){if(_0x3082cb['json'])throw _0x3082cb['json'];}else try{if(_0x29e849[_0x23ce7f(0x3b0,0x39a,0x4a8,0x4a1)]('ntzVS',_0x29e849[_0x23ce7f(0x4c9,0x543,0x4e6,0x4aa)])){_0x57d5c7=_0x1c630a[_0x23ce7f(0x408,0x513,0x455,0x3db)](_0x206ccf),_0x5b25f0=_0x15d9e9['withoutCon'+_0x4063c2(0x234,0x24f,0x28a,0x319)]||_0x5af266;let _0x485356;if(_0x1f6fb8[_0x4063c2(0x21e,0x23c,0x1b2,0xc0)](_0x29e849[_0x23ce7f(0x285,0x3fc,0x32b,0x222)]))return new _0x5bb924(async _0x28d373=>{_0x485356=_0x1d1d98[_0x57ef73(0x2da,0x22a,0x1f3,0x1be)][_0x5d740c]||{};function _0x6540e6(_0x464a04,_0x301004,_0x4f23d3,_0x12e72f){return _0x23ce7f(_0x464a04-0x1f3,_0x301004-0x88,_0x12e72f- -0x298,_0x301004);}if(!(_0x485356[_0x57ef73(0x2ef,0x241,0x1f9,0x263)]||_0x485356[_0x57ef73(0x191,0x103,0x161,0xb5)]))_0x485356=_0x425c48[_0x57ef73(0x6c,0x3c,0x11e,0x93)+_0x6540e6(0xbe,0x16e,0x14d,0x177)](_0x43dadd)||{};function _0x57ef73(_0x28c077,_0x2d5261,_0x4aec99,_0x4f13ea){return _0x23ce7f(_0x28c077-0x59,_0x2d5261-0x181,_0x2d5261- -0x2dd,_0x4aec99);}_0x2248b6[_0x57ef73(0x48,0x131,0x138,0x203)](_0x28d373,_0x485356[_0x6540e6(0x2dc,0x181,0x256,0x286)]||_0x485356[_0x57ef73(0x27,0x103,0x143,0xd3)]||_0x2248b6['KdBgH'](_0x25844b,_0x2248b6['erBBq']('+',_0xeaab5d['replace'](_0x2248b6['sEJmo'],'')))[_0x6540e6(0x232,0x25a,0x2f3,0x20b)](_0x2248b6[_0x6540e6(0x169,0x15d,0x138,0x108)]));});else _0x485356=_0x29e849['asyox'](_0x2c82f1,_0x29e849[_0x23ce7f(0x4b8,0x511,0x3ff,0x31e)])?{'id':_0x1d64c6,'name':_0x29e849['ivRmv']}:_0x29e849['oPFZJ'](_0x3346f3,_0x559161[_0x4063c2(0x29e,0x145,0x1b4,0x18d)](_0x4c1210[_0x23ce7f(0x3a8,0x4ea,0x491,0x55a)]['id']))?_0xcdee5c['user']:_0x25aab4['contacts'][_0xca61f]||{};return(_0x11e7e8?'':_0x485356[_0x23ce7f(0x50f,0x5c5,0x51e,0x408)])||_0x485356['subject']||_0x485356[_0x4063c2(0x1e5,0x11e,0x1c0,0x200)+'me']||_0x29e849[_0x4063c2(0xb6,0xaf,0xd4,0x183)](_0xaa4187,'+'+_0x382387['replace'](_0x29e849[_0x4063c2(0x15,0x6a,0xa4,0xfb)],''))[_0x4063c2(0x2e9,0x264,0x202,0x1d5)](_0x29e849[_0x23ce7f(0x5c6,0x4d1,0x526,0x5c2)]);}else throw{'json':JSON[_0x4063c2(0x187,0x1ab,0x1e5,0x1ab)](file['toString']())};}catch(_0x443a90){if(_0x443a90[_0x23ce7f(0x591,0x5a2,0x4bc,0x406)])throw _0x443a90[_0x4063c2(0x28a,0x1ed,0x21b,0x247)];}}let _0x5735e5='',_0x53b4af=_0x1910b5,_0x5947f7=_0x160280;if(_0x3155c8[_0x4063c2(0x27a,0x1fc,0x17a,0x121)])_0x5735e5=_0x29e849['izyRK'];function _0x23ce7f(_0x22bc8a,_0x14d4dc,_0x273d04,_0x2cab3f){return _0x59326d(_0x22bc8a-0xbe,_0x2cab3f,_0x273d04-0x1f4,_0x273d04-0x260);}if(_0x3155c8[_0x4063c2(0x120,0x15e,0x161,0xcb)]||/webp/[_0x4063c2(0x110,0x17b,0x171,0xf0)](_0x1910b5)){let {writeExif:_0x140ad4}=_0x29e849[_0x23ce7f(0x414,0x49f,0x524,0x52e)](require,_0x29e849[_0x23ce7f(0x456,0x523,0x4c6,0x574)]);const _0xbee975={};_0xbee975[_0x23ce7f(0x2de,0x424,0x3b2,0x455)]=_0x1910b5,_0xbee975[_0x23ce7f(0x50f,0x54f,0x4c9,0x440)]=_0x85b441;let _0x12bcf4=_0xbee975;const _0x2fe8dc={};_0x2fe8dc[_0x4063c2(0x53,0x108,0x83,0x126)]=_0x3155c8['packname']?_0x3155c8[_0x4063c2(-0x6a,-0x80,0x83,-0x76)]:global['packname'],_0x2fe8dc[_0x23ce7f(0x562,0x4b7,0x485,0x393)]=_0x3155c8[_0x4063c2(0x1e1,0x1f5,0x1e4,0x13f)]?_0x3155c8[_0x4063c2(0x2c5,0x2ca,0x1e4,0x25a)]:global[_0x23ce7f(0x45e,0x552,0x485,0x429)],_0x2fe8dc[_0x23ce7f(0x2ea,0x278,0x33c,0x24c)]=_0x3155c8[_0x23ce7f(0x2c5,0x2fb,0x33c,0x251)]?_0x3155c8[_0x23ce7f(0x38c,0x2f1,0x33c,0x358)]:[],_0x5947f7=await _0x29e849['phoZK'](_0x140ad4,_0x12bcf4,_0x2fe8dc),await fs[_0x4063c2(0x1e3,0x2e9,0x1d9,0x20b)][_0x23ce7f(0x371,0x381,0x47b,0x469)](_0x160280),_0x5735e5=_0x29e849[_0x23ce7f(0x5cc,0x3f6,0x4ff,0x5d0)],_0x53b4af=_0x29e849[_0x23ce7f(0x41e,0x437,0x48d,0x58c)];}else{if(/image/[_0x23ce7f(0x32d,0x49b,0x412,0x355)](_0x1910b5))_0x5735e5=_0x29e849[_0x4063c2(0xa9,0x22b,0x116,0x1af)];else{if(/video/['test'](_0x1910b5))_0x5735e5=_0x29e849['LBsPU'];else{if(/audio/[_0x23ce7f(0x383,0x3aa,0x412,0x3d9)](_0x1910b5))_0x5735e5=_0x29e849['KchFf'];else _0x5735e5=_0x23ce7f(0x3f2,0x44b,0x499,0x4e4);}}}const _0x2a1fca={};function _0x4063c2(_0x51e9a3,_0x5d097e,_0x134969,_0x34b400){return _0x59326d(_0x51e9a3-0x101,_0x51e9a3,_0x134969-0x1ab,_0x134969- -0x41);}_0x2a1fca[_0x23ce7f(0x308,0x4c0,0x3cf,0x4d9)]=_0x5947f7;const _0x375215={[_0x5735e5]:_0x2a1fca,'caption':_0x2f66fc,'mimetype':_0x53b4af,'fileName':_0x5046bc,..._0x3155c8},_0x10641b={'quoted':_0x14922b,..._0x3155c8};return await _0x236068['sendMessag'+'e'](_0x12f3b2,_0x375215,_0x10641b),fs['promises'][_0x4063c2(0x2a0,0x163,0x1da,0x1db)](_0x5947f7);},_0x236068[_0x58dc41(0x2f6,0x320,0x343,0x374)+'rd']=async(_0x44b1a5,_0x2b00ce,_0x3f45c5=![],_0x83ef34={})=>{function _0x2d1b2f(_0x235160,_0x2e45e5,_0x4be496,_0x339e17){return _0x59326d(_0x235160-0x20,_0x339e17,_0x4be496-0xb8,_0x235160- -0x312);}function _0x5cfd27(_0x3fd5d6,_0x31e554,_0x504a85,_0x18c8d3){return _0x59326d(_0x3fd5d6-0xf9,_0x31e554,_0x504a85-0xfd,_0x3fd5d6- -0x1e0);}if(_0x29e849[_0x5cfd27(-0x6f,-0x4f,-0x86,0x2a)](_0x2d1b2f(-0x112,-0x151,-0x1b4,-0x216),_0x29e849[_0x5cfd27(-0x18,-0x9d,-0xaf,-0x3a)]))_0x1d4a37['log'](_0x29e849[_0x5cfd27(-0xcf,-0x163,-0x179,-0x186)]),_0x1d82a3();else{let _0x4b8668;_0x83ef34[_0x2d1b2f(-0x25a,-0x262,-0x2e4,-0x1fa)+'ce']&&(_0x2b00ce[_0x5cfd27(-0x139,-0x9e,-0x205,-0x1a3)]=_0x2b00ce[_0x5cfd27(-0x139,-0x43,-0xcd,-0x129)]&&_0x2b00ce['message']['ephemeralM'+'essage']&&_0x2b00ce[_0x5cfd27(-0x139,-0xaa,-0xfb,-0xe2)]['ephemeralM'+_0x2d1b2f(-0x5c,0x90,-0xf9,-0x124)][_0x2d1b2f(-0x26b,-0x31f,-0x29b,-0x165)]?_0x2b00ce[_0x2d1b2f(-0x26b,-0x29a,-0x2d9,-0x25a)][_0x5cfd27(-0xdd,-0xbe,-0x124,-0x100)+'essage']['message']:_0x2b00ce['message']||undefined,_0x4b8668=Object[_0x5cfd27(0x7f,-0x35,0x7f,0x192)](_0x2b00ce[_0x2d1b2f(-0x26b,-0x203,-0x314,-0x264)]['viewOnceMe'+_0x2d1b2f(-0xc2,-0x7b,0xa,0x5)][_0x5cfd27(-0x139,-0x1b2,-0x222,-0x124)])[0x3*0x289+0xaa*-0x25+-0x2b*-0x65],delete(_0x2b00ce[_0x2d1b2f(-0x26b,-0x35c,-0x31b,-0x1a5)]&&_0x2b00ce[_0x5cfd27(-0x139,-0x1c9,-0x1ec,-0xbd)][_0x2d1b2f(-0x193,-0x243,-0x18c,-0x270)]?_0x2b00ce['message']['ignore']:_0x2b00ce['message']||undefined),delete _0x2b00ce[_0x2d1b2f(-0x26b,-0x2b4,-0x1cf,-0x271)][_0x2d1b2f(-0x16c,-0x84,-0x1d8,-0x1d8)+_0x5cfd27(0x70,0x15c,-0x36,0x99)][_0x2d1b2f(-0x26b,-0x322,-0x1c1,-0x290)][_0x4b8668][_0x2d1b2f(-0x218,-0x16d,-0x2c1,-0x1aa)],_0x2b00ce[_0x5cfd27(-0x139,-0x22d,-0xb7,-0x38)]={..._0x2b00ce[_0x2d1b2f(-0x26b,-0x37a,-0x21a,-0x336)][_0x5cfd27(-0x3a,-0x1,0xcc,-0x8)+'ssage']['message']});let _0x15294d=Object[_0x5cfd27(0x7f,0xfa,0x16,-0x2c)](_0x2b00ce[_0x2d1b2f(-0x26b,-0x32d,-0x18f,-0x284)])[0x1fa5+-0x80e*-0x2+-0x2fc1],_0x2b2fd6=await generateForwardMessageContent(_0x2b00ce,_0x3f45c5),_0xf0c14d=Object[_0x2d1b2f(-0xb3,-0x12f,-0xf9,-0x84)](_0x2b2fd6)[0x1b99+0x215b+-0x3cf4],_0x38eb6={};if(_0x29e849['lZAcF'](_0x15294d,_0x2d1b2f(-0x179,-0x136,-0x13f,-0x1ee)+'on'))_0x38eb6=_0x2b00ce[_0x5cfd27(-0x139,-0x51,-0x19a,-0xc1)][_0x15294d][_0x5cfd27(0xb5,0x22,-0x5c,0x1c8)+'o'];_0x2b2fd6[_0xf0c14d][_0x5cfd27(0xb5,0x16b,0x5,0x1bb)+'o']={..._0x38eb6,..._0x2b2fd6[_0xf0c14d][_0x2d1b2f(-0x7d,-0x7f,0x3b,-0x51)+'o']};const _0x132f5d=await generateWAMessageFromContent(_0x44b1a5,_0x2b2fd6,_0x83ef34?{..._0x2b2fd6[_0xf0c14d],..._0x83ef34,..._0x83ef34[_0x5cfd27(0xb5,0x70,0x9c,0x24)+'o']?{'contextInfo':{..._0x2b2fd6[_0xf0c14d][_0x5cfd27(0xb5,0x19d,0x3b,0xd6)+'o'],..._0x83ef34[_0x2d1b2f(-0x7d,-0x18,-0x192,0x43)+'o']}}:{}}:{});return await _0x236068[_0x5cfd27(-0x48,-0xdb,-0x5f,0x66)+'ge'](_0x44b1a5,_0x132f5d[_0x5cfd27(-0x139,-0x223,-0x218,-0x15d)],{'messageId':_0x132f5d[_0x5cfd27(0x32,0x110,0x5e,0x4d)]['id']}),_0x132f5d;}},_0x236068['cMod']=(_0x353c0e,_0x54f2ca,_0x92bf4c='',_0x263bec=_0x236068[_0x58dc41(0x3c4,0x408,0x3fd,0x4af)]['id'],_0x1c953d={})=>{let _0x5c472a=Object[_0x27ad7c(0x37,-0x175,-0x91,-0x5e)](_0x54f2ca[_0xc34613(0x33e,0x348,0x459,0x44c)])[0x19b*0x3+0x6de+-0x1*0xbaf],_0x1ed443=_0x29e849[_0x27ad7c(-0xeb,0x40,-0xa7,0x2f)](_0x5c472a,_0xc34613(0x4f0,0x46c,0x43a,0x4a8)+_0x27ad7c(-0xe,-0x82,-0x3a,0x71));function _0xc34613(_0x39ec94,_0x38d488,_0xeec41f,_0x160614){return _0x59326d(_0x39ec94-0x18d,_0xeec41f,_0xeec41f-0x5,_0x160614-0x3a5);}_0x1ed443&&(_0x5c472a=Object[_0xc34613(0x612,0x6c2,0x6d3,0x604)](_0x54f2ca[_0x27ad7c(-0x226,-0x218,-0x249,-0x21c)]['ephemeralM'+_0xc34613(0x6ed,0x685,0x6f5,0x65b)]['message'])[0x7*-0x272+-0xa*-0x336+-0xca*0x13]);let _0x658882=_0x1ed443?_0x54f2ca[_0xc34613(0x4a7,0x51d,0x42f,0x44c)][_0x27ad7c(-0x103,-0x1f9,-0x1ed,-0x285)+_0xc34613(0x579,0x65f,0x58c,0x65b)][_0x27ad7c(-0x1d0,-0x1ab,-0x249,-0x201)]:_0x54f2ca[_0x27ad7c(-0x149,-0x21b,-0x249,-0x34e)],_0xfaf545=_0x658882[_0x5c472a];function _0x27ad7c(_0x15f03f,_0x2c5d3e,_0x27a995,_0x2d8772){return _0x58dc41(_0x15f03f-0x19b,_0x2c5d3e-0x19e,_0x27a995- -0x4bc,_0x2d8772);}if(_0x29e849[_0xc34613(0x538,0x591,0x4f3,0x5f9)](typeof _0xfaf545,_0x29e849[_0x27ad7c(-0x2f,-0x38,-0x8f,-0x6c)]))_0x658882[_0x5c472a]=_0x29e849['YPYDZ'](_0x92bf4c,_0xfaf545);else{if(_0xfaf545[_0x27ad7c(-0x1ed,-0x2ad,-0x1d2,-0x11a)])_0xfaf545[_0x27ad7c(-0x25a,-0x18a,-0x1d2,-0xbf)]=_0x92bf4c||_0xfaf545[_0x27ad7c(-0x1b8,-0x167,-0x1d2,-0x2e6)];else{if(_0xfaf545[_0x27ad7c(-0x177,-0x14,-0x117,-0xad)])_0xfaf545[_0x27ad7c(-0x160,-0x14d,-0x117,-0x207)]=_0x92bf4c||_0xfaf545[_0xc34613(0x602,0x58c,0x67a,0x57e)];}}if(_0x29e849['oxihw'](typeof _0xfaf545,_0x29e849['cyCMT']))_0x658882[_0x5c472a]={..._0xfaf545,..._0x1c953d};if(_0x54f2ca['key'][_0xc34613(0x586,0x503,0x514,0x5c2)+'t'])_0x263bec=_0x54f2ca[_0xc34613(0x596,0x6c3,0x69c,0x5b7)][_0xc34613(0x64f,0x6c7,0x67d,0x5c2)+'t']=_0x263bec||_0x54f2ca[_0xc34613(0x58a,0x5eb,0x5f9,0x5b7)]['participan'+'t'];else{if(_0x54f2ca[_0x27ad7c(-0x1e5,0x33,-0xde,-0x131)]['participan'+'t'])_0x263bec=_0x54f2ca[_0x27ad7c(-0x183,-0xb0,-0xde,-0x1d)]['participan'+'t']=_0x263bec||_0x54f2ca[_0x27ad7c(-0xd9,-0x111,-0xde,-0x58)][_0x27ad7c(-0x6,0x1e,-0xd3,-0xe7)+'t'];}if(_0x54f2ca[_0xc34613(0x4bd,0x523,0x4bf,0x5b7)][_0xc34613(0x424,0x41a,0x519,0x462)][_0xc34613(0x46c,0x645,0x50d,0x576)](_0x29e849['IVkap']))_0x263bec=_0x263bec||_0x54f2ca['key']['remoteJid'];else{if(_0x54f2ca[_0xc34613(0x53a,0x5a6,0x5ec,0x5b7)][_0xc34613(0x46f,0x56c,0x469,0x462)][_0x27ad7c(-0x5d,-0xa9,-0x11f,-0x14b)](_0x29e849[_0xc34613(0x654,0x4de,0x499,0x5a9)]))_0x263bec=_0x263bec||_0x54f2ca[_0xc34613(0x6c9,0x6ac,0x55e,0x5b7)][_0xc34613(0x392,0x396,0x3b9,0x462)];}return _0x54f2ca[_0xc34613(0x59e,0x56e,0x693,0x5b7)]['remoteJid']=_0x353c0e,_0x54f2ca[_0xc34613(0x4f7,0x544,0x55d,0x5b7)][_0x27ad7c(-0x118,-0x46,-0x9e,-0x173)]=_0x263bec===_0x236068[_0x27ad7c(0x4a,-0xa0,-0xbf,-0x105)]['id'],proto[_0x27ad7c(-0x9b,-0x20a,-0x120,-0x86)+'Info']['fromObject'](_0x54f2ca);},_0x236068[_0x59326d(0x168,0x41,0x15c,0xa8)]=async(_0x6c7f82,_0x3b9d2f)=>{let _0x54b954,_0x3a672a=Buffer['isBuffer'](_0x6c7f82)?_0x6c7f82:/^data:.*?\/.*?;base64,/i[_0x12b56c(0x4e5,0x3f7,0x580,0x5a9)](_0x6c7f82)?Buffer['from'](_0x6c7f82['split']`,`[-0x19b6+0x2544+-0xb8d],_0x29e849[_0x9d1a25(0x404,0x50e,0x593,0x4f5)]):/^https?:\/\//['test'](_0x6c7f82)?await(_0x54b954=await _0x29e849[_0x12b56c(0x52a,0x582,0x58f,0x47f)](getBuffer,_0x6c7f82)):fs[_0x12b56c(0x40d,0x483,0x466,0x502)](_0x6c7f82)?(filename=_0x6c7f82,fs[_0x12b56c(0x5b1,0x616,0x624,0x4f5)+'nc'](_0x6c7f82)):typeof _0x6c7f82===_0x29e849[_0x12b56c(0x594,0x4ad,0x4ad,0x6aa)]?_0x6c7f82:Buffer[_0x12b56c(0x516,0x438,0x60f,0x44c)](0x25c+0x1154+-0x13b0);const _0x64d3a9={};function _0x12b56c(_0x1fe742,_0x21cce7,_0x20f579,_0x3a1c24){return _0x58dc41(_0x1fe742-0x1c7,_0x21cce7-0x1a9,_0x1fe742-0x167,_0x21cce7);}_0x64d3a9[_0x12b56c(0x5bb,0x548,0x68f,0x65d)]=_0x29e849[_0x9d1a25(0x4b1,0x3de,0x415,0x401)],_0x64d3a9[_0x9d1a25(0x48a,0x50d,0x4f5,0x45d)]=_0x29e849[_0x12b56c(0x3fa,0x310,0x2f4,0x4c5)];let _0x339b7a=await FileType[_0x9d1a25(0x3ee,0x517,0x4e0,0x503)](_0x3a672a)||_0x64d3a9;filename=path[_0x9d1a25(0x427,0x626,0x527,0x51b)](__filename,_0x29e849[_0x9d1a25(0x4b4,0x3b3,0x424,0x4ae)](_0x29e849[_0x9d1a25(0x402,0x3c3,0x4fe,0x45a)](_0x29e849[_0x12b56c(0x588,0x5ea,0x5c2,0x53b)],new Date()*(-0x2*0xdad+-0x1530+0x2db*0x11)),'.')+_0x339b7a[_0x12b56c(0x524,0x54a,0x575,0x514)]);if(_0x29e849['iDXDo'](_0x3a672a,_0x3b9d2f))fs[_0x12b56c(0x54d,0x47f,0x61c,0x60f)]['writeFile'](filename,_0x3a672a);function _0x9d1a25(_0x51ca6c,_0x3871de,_0x598315,_0x5cd881){return _0x59326d(_0x51ca6c-0x42,_0x598315,_0x598315-0x16,_0x5cd881-0x26c);}return{'res':_0x54b954,'filename':filename,'size':await _0x29e849[_0x12b56c(0x543,0x45c,0x4d1,0x58d)](getSizeMedia,_0x3a672a),..._0x339b7a,'data':_0x3a672a};},_0x236068;}startRedDragonMdNx();let file=require[_0x5ab899(-0x28,-0x3b,0x6a,-0x96)](__filename);fs['watchFile'](file,()=>{const _0x34dfa9={'mRLkD':function(_0x5d0543,_0x2f0449){return _0x5d0543(_0x2f0449);}};function _0x496fa0(_0x50bb8f,_0x48c339,_0x44daab,_0x31d332){return _0x5ab899(_0x31d332-0x39a,_0x48c339-0xdc,_0x44daab-0x14e,_0x50bb8f);}fs[_0x496fa0(0x2fd,0x3f0,0x30d,0x36a)+'e'](file),console[_0x496fa0(0x3e9,0x240,0x209,0x2f5)](chalk[_0x496fa0(0x335,0x4b3,0x4b4,0x3fa)](_0x496fa0(0x456,0x521,0x3e4,0x471)+__filename));function _0x30caba(_0x1f5af7,_0x283354,_0x439e8d,_0x35bbec){return _0x4680bc(_0x439e8d,_0x35bbec- -0x280,_0x439e8d-0x1,_0x35bbec-0xd3);}delete require[_0x30caba(0x24e,0x3c8,0x3a7,0x342)][file],_0x34dfa9[_0x30caba(0x402,0x4c0,0x4ab,0x3b0)](require,file);}); diff --git a/lib/ApkDown.js b/lib/ApkDown.js new file mode 100644 index 000000000..2ae70b2a1 --- /dev/null +++ b/lib/ApkDown.js @@ -0,0 +1,53 @@ +//════════════════════════════// +//If you want to recode, reupload +//or copy the codes/script, +//pls give credit +//no credit? i will take action immediately +//© 2022 Xeon Bot Inc. Cheems Bot MD +//Thank you to Lord Buddha, Family and Myself +//════════════════════════════// +//recode kar ke youtube pe upload kar rhe hai ya +//codes copy kar ke apne script me dal rhe +//hai to, description me xeon ka yt channel +// ka link paste kr dena as a cradit or github +//repo me bhi tag kardena baki jo +//bhi karna hai apki marzi, thank you!🦄 +//════════════════════════════// +//If you recode and uploading on your channel +//or copy pasting the codes in ur script, +//i give permission to do as long as you +//put Xeons youtube channel link in the video +//description and tag me on githuh repo, +//thank you🦄 +//════════════════════════════// + +const axios = require('axios') +const cheerio = require('cheerio') + +const ApkDown = async (url) => { +const res = await axios.get(url) +const $ = cheerio.load(res.data) +const total = [] +$(`div.entry-inner`).each(function(e,hasil){ +let desc = $(hasil).find('p').text() + +let title = $('div.post-inner.group').find('h1.post-title').text() + +let size = $('div#dlbox1').find('ul > li > span').text().split('size: ')[1].split('Update')[0] + +let vers = $('div#dlbox1').find('ul > li > span').text().split('Version: ')[1].split('File')[0] + +let up = $('div#dlbox1').find('ul > li > span').text().split('Update: ')[1] + +let link = $('div#dlbox12').find('li > a').attr('href') + +let thumb = $('div#dlbox').find('img').attr('data-src') + +total.push({title,size,vers,up,link,thumb,desc}) +console.log(total) +}) +return (total) +} + + +module.exports = { ApkDown } \ No newline at end of file diff --git a/lib/antispam.js b/lib/antispam.js new file mode 100644 index 000000000..3e29953a0 --- /dev/null +++ b/lib/antispam.js @@ -0,0 +1,41 @@ +//════════════════════════════// +//If you want to recode, reupload +//or copy the codes/script, +//pls give credit +//no credit? i will take action immediately +//© 2022 Xeon Bot Inc. Cheems Bot MD +//Thank you to Lord Buddha, Family and Myself +//════════════════════════════// +//recode kar ke youtube pe upload kar rhe hai ya +//codes copy kar ke apne script me dal rhe +//hai to, description me xeon ka yt channel +// ka link paste kr dena as a cradit or github +//repo me bhi tag kardena baki jo +//bhi karna hai apki marzi, thank you!🦄 +//════════════════════════════// +//If you recode and uploading on your channel +//or copy pasting the codes in ur script, +//i give permission to do as long as you +//put Xeons youtube channel link in the video +//description and tag me on githuh repo, +//thank you🦄 +//════════════════════════════// + +// Message Filter / Message Cooldowns +const usedCommandRecently = new Set(); + +const isFiltered = (from) => { + return !!usedCommandRecently.has(from); +}; + +const addFilter = (from) => { + usedCommandRecently.add(from); + setTimeout(() => { + return usedCommandRecently.delete(from); + }, 1500);// 1.5 sec is delay before processing next command; +}; +module.exports = { + msgFilter: { + isFiltered, + addFilter + }}; \ No newline at end of file diff --git a/lib/binary.js b/lib/binary.js index 0db1928b8..9a380d582 100644 --- a/lib/binary.js +++ b/lib/binary.js @@ -1,4 +1,4 @@ -//═══════════════════════════════════════════════════════// +//════════════════════════════// //If you want to recode, reupload //or copy the codes/script, //pls give credit @@ -6,6 +6,20 @@ //© 2022 Xeon Bot Inc. Cheems Bot MD //Thank you to Lord Buddha, Family and Myself //════════════════════════════// +//recode kar ke youtube pe upload kar rhe hai ya +//codes copy kar ke apne script me dal rhe +//hai to, description me xeon ka yt channel +// ka link paste kr dena as a cradit or github +//repo me bhi tag kardena baki jo +//bhi karna hai apki marzi, thank you!🦄 +//════════════════════════════// +//If you recode and uploading on your channel +//or copy pasting the codes in ur script, +//i give permission to do as long as you +//put Xeons youtube channel link in the video +//description and tag me on githuh repo, +//thank you🦄 +//════════════════════════════// async function dBinary(str) { var newBin = str.split(" ") var binCode = [] diff --git a/lib/cloudDBAdapter.js b/lib/cloudDBAdapter.js index b8dc88274..c183164c2 100644 --- a/lib/cloudDBAdapter.js +++ b/lib/cloudDBAdapter.js @@ -1,4 +1,4 @@ -//═══════════════════════════════════════════════════════// +//════════════════════════════// //If you want to recode, reupload //or copy the codes/script, //pls give credit @@ -6,6 +6,20 @@ //© 2022 Xeon Bot Inc. Cheems Bot MD //Thank you to Lord Buddha, Family and Myself //════════════════════════════// +//recode kar ke youtube pe upload kar rhe hai ya +//codes copy kar ke apne script me dal rhe +//hai to, description me xeon ka yt channel +// ka link paste kr dena as a cradit or github +//repo me bhi tag kardena baki jo +//bhi karna hai apki marzi, thank you!🦄 +//════════════════════════════// +//If you recode and uploading on your channel +//or copy pasting the codes in ur script, +//i give permission to do as long as you +//put Xeons youtube channel link in the video +//description and tag me on githuh repo, +//thank you🦄 +//════════════════════════════// const got = require('got') const stringify = obj => JSON.stringify(obj, null, 2) diff --git a/lib/converter.js b/lib/converter.js index 11aa016df..2220bc28a 100644 --- a/lib/converter.js +++ b/lib/converter.js @@ -1,4 +1,4 @@ -//═══════════════════════════════════════════════════════// +//════════════════════════════// //If you want to recode, reupload //or copy the codes/script, //pls give credit @@ -6,6 +6,20 @@ //© 2022 Xeon Bot Inc. Cheems Bot MD //Thank you to Lord Buddha, Family and Myself //════════════════════════════// +//recode kar ke youtube pe upload kar rhe hai ya +//codes copy kar ke apne script me dal rhe +//hai to, description me xeon ka yt channel +// ka link paste kr dena as a cradit or github +//repo me bhi tag kardena baki jo +//bhi karna hai apki marzi, thank you!🦄 +//════════════════════════════// +//If you recode and uploading on your channel +//or copy pasting the codes in ur script, +//i give permission to do as long as you +//put Xeons youtube channel link in the video +//description and tag me on githuh repo, +//thank you🦄 +//════════════════════════════// const fs = require('fs') const path = require('path') const { spawn } = require('child_process') diff --git a/lib/covid.js b/lib/covid.js new file mode 100644 index 000000000..0ee6b52ab --- /dev/null +++ b/lib/covid.js @@ -0,0 +1,18 @@ +// K.Prabhasha +const axios = require('axios') +const cheerio = require('cheerio') + +const covid = async () => { +const res = await axios.get(`https://www.worldometers.info/coronavirus/country/indonesia/`) +const $ = cheerio.load(res.data) +hasil = [] +a = $('div#maincounter-wrap') +kasus = $(a).find('div > span').eq(0).text() +kematian = $(a).find('div > span').eq(1).text() +sembuh = $(a).find('div > span').eq(2).text() +hasil.push({ kasus, kematian, sembuh}) +return hasil +} + + +module.exports = { covid } \ No newline at end of file diff --git a/lib/database.js b/lib/database.js index b52fdb374..9714d393e 100644 --- a/lib/database.js +++ b/lib/database.js @@ -1,4 +1,4 @@ -//═══════════════════════════════════════════════════════// +//════════════════════════════// //If you want to recode, reupload //or copy the codes/script, //pls give credit @@ -6,6 +6,20 @@ //© 2022 Xeon Bot Inc. Cheems Bot MD //Thank you to Lord Buddha, Family and Myself //════════════════════════════// +//recode kar ke youtube pe upload kar rhe hai ya +//codes copy kar ke apne script me dal rhe +//hai to, description me xeon ka yt channel +// ka link paste kr dena as a cradit or github +//repo me bhi tag kardena baki jo +//bhi karna hai apki marzi, thank you!🦄 +//════════════════════════════// +//If you recode and uploading on your channel +//or copy pasting the codes in ur script, +//i give permission to do as long as you +//put Xeons youtube channel link in the video +//description and tag me on githuh repo, +//thank you🦄 +//════════════════════════════// const path = require('path') const _fs = require('fs') const { promises: fs } = _fs diff --git a/lib/exif.js b/lib/exif.js index 58329daed..81807e191 100644 --- a/lib/exif.js +++ b/lib/exif.js @@ -1,4 +1,4 @@ -//═══════════════════════════════════════════════════════// +//════════════════════════════// //If you want to recode, reupload //or copy the codes/script, //pls give credit @@ -6,6 +6,20 @@ //© 2022 Xeon Bot Inc. Cheems Bot MD //Thank you to Lord Buddha, Family and Myself //════════════════════════════// +//recode kar ke youtube pe upload kar rhe hai ya +//codes copy kar ke apne script me dal rhe +//hai to, description me xeon ka yt channel +// ka link paste kr dena as a cradit or github +//repo me bhi tag kardena baki jo +//bhi karna hai apki marzi, thank you!🦄 +//════════════════════════════// +//If you recode and uploading on your channel +//or copy pasting the codes in ur script, +//i give permission to do as long as you +//put Xeons youtube channel link in the video +//description and tag me on githuh repo, +//thank you🦄 +//════════════════════════════// const fs = require('fs') const { tmpdir } = require("os") const Crypto = require("crypto") diff --git a/lib/gempa.js b/lib/gempa.js new file mode 100644 index 000000000..42565d0bc --- /dev/null +++ b/lib/gempa.js @@ -0,0 +1,45 @@ +// K.Prabhasha +const axios = require('axios'); +const cheerio = require('cheerio'); + +const Gempa = () => new Promise((resolve, reject) => { + + axios.get('https://www.bmkg.go.id/gempabumi/gempabumi-dirasakan.bmkg').then((response) => { + + const $ = cheerio.load(response.data) + + const urlElems = $('table.table-hover.table-striped') + + for (let i = 0; i < urlElems.length; i++) { + const urlSpan = $(urlElems[i]).find('tbody')[0] + + if (urlSpan) { + const urlData = $(urlSpan).find('tr')[0] + var Kapan = $(urlData).find('td')[1] + var Letak = $(urlData).find('td')[2] + var Magnitudo = $(urlData).find('td')[3] + var Kedalaman = $(urlData).find('td')[4] + var Wilayah = $(urlData).find('td')[5] + var lintang = $(Letak).text().split(' ')[0] + var bujur = $(Letak).text().split(' ')[2] + var hasil = { + status: true, + code: 200, + result: { + Waktu: $(Kapan).text(), + Lintang: lintang, + Bujur: bujur, + Magnitudo: $(Magnitudo).text(), + Kedalaman: $(Kedalaman).text().replace(/\t/g, '').replace(/I/g, ''), + Wilayah: $(Wilayah).text().replace(/\t/g, '').replace(/I/g, '').replace('-','').replace(/\r/g, '').split('\n')[0], + Map: $('div.row > div > img').attr('src') + } + } + // We then print the text on to the console + resolve(hasil); + } + } + }).catch(err => reject(err)) +}) + +exports.Gempa = Gempa \ No newline at end of file diff --git a/lib/jadwaltv.js b/lib/jadwaltv.js new file mode 100644 index 000000000..6b6a23bcf --- /dev/null +++ b/lib/jadwaltv.js @@ -0,0 +1,84 @@ +// K.Prabhasha +const {default: Axios} = require('axios') +const cheerio = require('cheerio') + +function jadwaltv(query) { + return new Promise(async (resolve, reject) => { +const channelna = query; + let stasiun = [ + "rcti", + "nettv", + "antv", + "gtv", + "indosiar", + "inewstv", + "kompastv", + "metrotv", + "mnctv", + "rtv", + "sctv", + "trans7", + "transtv", + "tvone", + "tvri", + ]; + let isist = `*Available channels* :\n\n`; + for (let i = 0;i < stasiun.length;i++) { + isist += `*➣* ${stasiun[i]}\n`; + } + try { + // const tv_switch = stasiun[0] + Axios.get("https://www.jadwaltv.net/channel/" + channelna) + .then(({ + data + }) => { + const $ = cheerio.load(data); + let isitable1 = []; + let isitable2 = []; + $("div > div > table:nth-child(3) > tbody > tr").each(function ( + i, + result + ) { + isitable1.push({ + jam: result.children[0].children[0].data, + tayang: result.children[1].children[0].data, + }); + }); + // console.log(isitable1) + $("div > div > table:nth-child(5) > tbody > tr").each(function ( + i, + result + ) { + isitable2.push({ + jam: result.children[0].children[0].data, + tayang: result.children[1].children[0].data, + }); + }); + const semuatable = []; + + for (let i = 0;i < isitable1.length;i++) { + semuatable.push(isitable1[i]); + } + for (let i = 0;i < isitable2.length;i++) { + semuatable.push(isitable2[i]); + } + // console.log(semuatable) + let daftartay = `*Menampilkan daftar tayang channel ${channelna}*\n\n`; + for (let i = 0;i < semuatable.length;i++) { + daftartay += `${semuatable[i].jam} ${semuatable[i].tayang}\n`; + } + resolve(daftartay); + // console.log(semuatable) + }) + .catch((e) => { + resolve(isist); + // console.log(e) + }); + } catch (e) { + resolve(isist); + console.log(e); + } + }) +} + +module.exports = {jadwaltv} \ No newline at end of file diff --git a/lib/lowdb/adapters/xeon.js b/lib/lowdb/adapters/xeon.js new file mode 100644 index 000000000..cac634cb6 --- /dev/null +++ b/lib/lowdb/adapters/xeon.js @@ -0,0 +1,3 @@ +{ + "name": "Cheems Bot Multi Device " +} \ No newline at end of file diff --git "a/lib/lowdb/adapters/\343\205\244" "b/lib/lowdb/adapters/\343\205\244" deleted file mode 100644 index 8b1378917..000000000 --- "a/lib/lowdb/adapters/\343\205\244" +++ /dev/null @@ -1 +0,0 @@ - diff --git "a/lib/lowdb/\343\205\244" "b/lib/lowdb/\343\205\244" deleted file mode 100644 index 8b1378917..000000000 --- "a/lib/lowdb/\343\205\244" +++ /dev/null @@ -1 +0,0 @@ - diff --git a/lib/math.js b/lib/math.js index 37b37c3e1..53557dec1 100644 --- a/lib/math.js +++ b/lib/math.js @@ -1,4 +1,4 @@ -//═══════════════════════════════════════════════════════// +//════════════════════════════// //If you want to recode, reupload //or copy the codes/script, //pls give credit @@ -6,6 +6,20 @@ //© 2022 Xeon Bot Inc. Cheems Bot MD //Thank you to Lord Buddha, Family and Myself //════════════════════════════// +//recode kar ke youtube pe upload kar rhe hai ya +//codes copy kar ke apne script me dal rhe +//hai to, description me xeon ka yt channel +// ka link paste kr dena as a cradit or github +//repo me bhi tag kardena baki jo +//bhi karna hai apki marzi, thank you!🦄 +//════════════════════════════// +//If you recode and uploading on your channel +//or copy pasting the codes in ur script, +//i give permission to do as long as you +//put Xeons youtube channel link in the video +//description and tag me on githuh repo, +//thank you🦄 +//════════════════════════════// let modes = { noob: [-3, 3,-3, 3, '+-', 15000, 10], easy: [-10, 10, -10, 10, '*/+-', 20000, 40], diff --git a/lib/mediafire.js b/lib/mediafire.js new file mode 100644 index 000000000..9c8dfb65d --- /dev/null +++ b/lib/mediafire.js @@ -0,0 +1,20 @@ +// K.Prabhasha +const axios = require('axios') +const cheerio = require('cheerio') + +const mediafireDl = async (url) => { +const res = await axios.get(url) +const $ = cheerio.load(res.data) +const hasil = [] +const link = $('a#downloadButton').attr('href') +const size = $('a#downloadButton').text().replace('Download', '').replace('(', '').replace(')', '').replace('\n', '').replace('\n', '').replace(' ', '') +const seplit = link.split('/') +const nama = seplit[5] +mime = nama.split('.') +mime = mime[1] +hasil.push({ nama, mime, size, link }) +return hasil +} + + +module.exports = { mediafireDl } \ No newline at end of file diff --git a/lib/mongoDB.js b/lib/mongoDB.js index e7e27e68b..b7dea1c76 100644 --- a/lib/mongoDB.js +++ b/lib/mongoDB.js @@ -1,4 +1,4 @@ -//═══════════════════════════════════════════════════════// +//════════════════════════════// //If you want to recode, reupload //or copy the codes/script, //pls give credit @@ -6,6 +6,20 @@ //© 2022 Xeon Bot Inc. Cheems Bot MD //Thank you to Lord Buddha, Family and Myself //════════════════════════════// +//recode kar ke youtube pe upload kar rhe hai ya +//codes copy kar ke apne script me dal rhe +//hai to, description me xeon ka yt channel +// ka link paste kr dena as a cradit or github +//repo me bhi tag kardena baki jo +//bhi karna hai apki marzi, thank you!🦄 +//════════════════════════════// +//If you recode and uploading on your channel +//or copy pasting the codes in ur script, +//i give permission to do as long as you +//put Xeons youtube channel link in the video +//description and tag me on githuh repo, +//thank you🦄 +//════════════════════════════// const mongoose = require('mongoose') const { Schema } = mongoose diff --git a/lib/myfunc.js b/lib/myfunc.js index 8f7d5da92..9a03ecf7c 100644 --- a/lib/myfunc.js +++ b/lib/myfunc.js @@ -1,9 +1,25 @@ -/** - * Create By Dika Ardnt. - * Contact Me on wa.me/6288292024190 - * Follow https://github.com/DikaArdnt -*/ - +//════════════════════════════// +//If you want to recode, reupload +//or copy the codes/script, +//pls give credit +//no credit? i will take action immediately +//© 2022 Xeon Bot Inc. Cheems Bot MD +//Thank you to Lord Buddha, Family and Myself +//════════════════════════════// +//recode kar ke youtube pe upload kar rhe hai ya +//codes copy kar ke apne script me dal rhe +//hai to, description me xeon ka yt channel +// ka link paste kr dena as a cradit or github +//repo me bhi tag kardena baki jo +//bhi karna hai apki marzi, thank you!🦄 +//════════════════════════════// +//If you recode and uploading on your channel +//or copy pasting the codes in ur script, +//i give permission to do as long as you +//put Xeons youtube channel link in the video +//description and tag me on githuh repo, +//thank you🦄 +//════════════════════════════// const { proto, delay, getContentType } = require('@adiwajshing/baileys') const chalk = require('chalk') const fs = require('fs') diff --git a/lib/myfunc2.js b/lib/myfunc2.js new file mode 100644 index 000000000..915fbc84d --- /dev/null +++ b/lib/myfunc2.js @@ -0,0 +1,424 @@ +//════════════════════════════// +//If you want to recode, reupload +//or copy the codes/script, +//pls give credit +//no credit? i will take action immediately +//© 2022 Xeon Bot Inc. Cheems Bot MD +//Thank you to Lord Buddha, Family and Myself +//════════════════════════════// +//recode kar ke youtube pe upload kar rhe hai ya +//codes copy kar ke apne script me dal rhe +//hai to, description me xeon ka yt channel +// ka link paste kr dena as a cradit or github +//repo me bhi tag kardena baki jo +//bhi karna hai apki marzi, thank you!🦄 +//════════════════════════════// +//If you recode and uploading on your channel +//or copy pasting the codes in ur script, +//i give permission to do as long as you +//put Xeons youtube channel link in the video +//description and tag me on githuh repo, +//thank you🦄 +//════════════════════════════// + +const { proto, delay, getContentType } = require('@adiwajshing/baileys') +const chalk = require('chalk') +const fs = require('fs') +const Crypto = require('crypto') +const axios = require('axios') +const cheerio = require('cheerio') +const moment = require('moment-timezone') +const { sizeFormatter } = require('human-readable') +const util = require('util') +const Jimp = require('jimp') +const { defaultMaxListeners } = require('stream') + + +const unixTimestampSeconds = (date = new Date()) => Math.floor(date.getTime() / 1000) + +exports.unixTimestampSeconds = unixTimestampSeconds + +exports.generateMessageTag = (epoch) => { + let tag = (0, exports.unixTimestampSeconds)().toString(); + if (epoch) + tag += '.--' + epoch; // attach epoch if provided + return tag; +} + +exports.processTime = (timestamp, now) => { + return moment.duration(now - moment(timestamp * 1000)).asSeconds() +} + +exports.getRandom = (ext) => { + return `${Math.floor(Math.random() * 10000)}${ext}` +} + +exports.getBuffer = async (url, options) => { + try { + options ? options : {} + const res = await axios({ + method: "get", + url, + headers: { + 'DNT': 1, + 'Upgrade-Insecure-Request': 1 + }, + ...options, + responseType: 'arraybuffer' + }) + return res.data + } catch (err) { + return err + } +} + +exports.fetchJson = async (url, options) => { + try { + options ? options : {} + const res = await axios({ + method: 'GET', + url: url, + headers: { + 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' + }, + ...options + }) + return res.data + } catch (err) { + return err + } +} + +exports.runtime = function(seconds) { + seconds = Number(seconds); + var d = Math.floor(seconds / (3600 * 24)); + var h = Math.floor(seconds % (3600 * 24) / 3600); + var m = Math.floor(seconds % 3600 / 60); + var s = Math.floor(seconds % 60); + var dDisplay = d > 0 ? d + (d == 1 ? " day, " : " days, ") : ""; + var hDisplay = h > 0 ? h + (h == 1 ? " hour, " : " hours, ") : ""; + var mDisplay = m > 0 ? m + (m == 1 ? " minute, " : " minutes, ") : ""; + var sDisplay = s > 0 ? s + (s == 1 ? " second" : " seconds") : ""; + return dDisplay + hDisplay + mDisplay + sDisplay; +} + +exports.clockString = (ms) => { + let h = isNaN(ms) ? '--' : Math.floor(ms / 3600000) + let m = isNaN(ms) ? '--' : Math.floor(ms / 60000) % 60 + let s = isNaN(ms) ? '--' : Math.floor(ms / 1000) % 60 + return [h, m, s].map(v => v.toString().padStart(2, 0)).join(':') +} + +exports.sleep = async (ms) => { + return new Promise(resolve => setTimeout(resolve, ms)); +} + +exports.isUrl = (url) => { + return url.match(new RegExp(/https?:\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_+.~#?&/=]*)/, 'gi')) +} + +exports.getTime = (format, date) => { + if (date) { + return moment(date).locale('id').format(format) + } else { + return moment.tz('Asia/Jakarta').locale('id').format(format) + } +} + +exports.formatDate = (n, locale = 'id') => { + let d = new Date(n) + return d.toLocaleDateString(locale, { + weekday: 'long', + day: 'numeric', + month: 'long', + year: 'numeric', + hour: 'numeric', + minute: 'numeric', + second: 'numeric' + }) +} + +exports.tanggal = (numer) => { + myMonths = ["Januari","Februari","Maret","April","Mei","Juni","Juli","Agustus","September","Oktober","November","Desember"]; + myDays = ['Minggu','Senin','Selasa','Rabu','Kamis','Jum’at','Sabtu']; + var tgl = new Date(numer); + var day = tgl.getDate() + bulan = tgl.getMonth() + var thisDay = tgl.getDay(), + thisDay = myDays[thisDay]; + var yy = tgl.getYear() + var year = (yy < 1000) ? yy + 1900 : yy; + const time = moment.tz('Asia/Jakarta').format('DD/MM HH:mm:ss') + let d = new Date + let locale = 'id' + let gmt = new Date(0).getTime() - new Date('1 January 1970').getTime() + let weton = ['Pahing', 'Pon','Wage','Kliwon','Legi'][Math.floor(((d * 1) + gmt) / 84600000) % 5] + + return`${thisDay}, ${day} - ${myMonths[bulan]} - ${year}` +} + +exports.rexdl = async (query) => { + return new Promise((resolve) => { + axios.get('https://rexdl.com/?s=' + query) + .then(({ + data + }) => { + const $ = cheerio.load(data) + const judul = []; + const jenis = []; + const date = []; + const desc = []; + const link = []; + const thumb = []; + const result = []; + $('div > div.post-content').each(function(a, b) { + judul.push($(b).find('h2.post-title > a').attr('title')) + jenis.push($(b).find('p.post-category').text()) + date.push($(b).find('p.post-date').text()) + desc.push($(b).find('div.entry.excerpt').text()) + link.push($(b).find('h2.post-title > a').attr('href')) + }) + $('div > div.post-thumbnail > a > img').each(function(a, b) { + thumb.push($(b).attr('data-src')) + }) + for (let i = 0; i < judul.length; i++) { + result.push({ + creator: 'Fajar Ihsana', + judul: judul[i], + kategori: jenis[i], + upload_date: date[i], + deskripsi: desc[i], + thumb: thumb[i], + link: link[i] + }) + } + resolve(result) + }) + }) +} + +exports.rexdldown = async (link) => { + return new Promise((resolve) => { + axios.get(link) + .then(({ + data + }) => { + const $ = cheerio.load(data) + const link = []; + const url = []; + const link_name = []; + const judul = $('#page > div > div > div > section > div:nth-child(2) > article > div > h1.post-title').text(); + const plink = $('#page > div > div > div > section > div:nth-child(2) > center:nth-child(3) > h2 > span > a').attr('href') + axios.get(plink) + .then(({ + data + }) => { + const $$ = cheerio.load(data) + $$('#dlbox > ul.dl > a > li > span').each(function(a, b) { + deta = $$(b).text(); + link_name.push(deta) + }) + $$('#dlbox > ul.dl > a').each(function(a, b) { + url.push($$(b).attr('href')) + }) + for (let i = 0; i < link_name.length; i++) { + link.push({ + link_name: link_name[i], + url: url[i] + }) + } + resolve({ + creator: 'Fajar Ihsana', + judul: judul, + update_date: $$('#dlbox > ul.dl-list > li.dl-update > span:nth-child(2)').text(), + version: $$('#dlbox > ul.dl-list > li.dl-version > span:nth-child(2)').text(), + size: $$('#dlbox > ul.dl-list > li.dl-size > span:nth-child(2)').text(), + download: link + }) + }) + }) + }) +} + +exports.formatp = sizeFormatter({ + std: 'JEDEC', //'SI' = default | 'IEC' | 'JEDEC' + decimalPlaces: 2, + keepTrailingZeroes: false, + render: (literal, symbol) => `${literal} ${symbol}B`, +}) + +exports.jsonformat = (string) => { + return JSON.stringify(string, null, 2) +} + +function format(...args) { + return util.format(...args) +} + +exports.logic = (check, inp, out) => { + if (inp.length !== out.length) throw new Error('Input and Output must have same length') + for (let i in inp) + if (util.isDeepStrictEqual(check, inp[i])) return out[i] + return null +} + +exports.generateProfilePicture = async (buffer) => { + const jimp = await Jimp.read(buffer) + const min = jimp.getWidth() + const max = jimp.getHeight() + const cropped = jimp.crop(0, 0, min, max) + return { + img: await cropped.scaleToFit(720, 720).getBufferAsync(Jimp.MIME_JPEG), + preview: await cropped.scaleToFit(720, 720).getBufferAsync(Jimp.MIME_JPEG) + } +} + +exports.bytesToSize = (bytes, decimals = 2) => { + if (bytes === 0) return '0 Bytes'; + + const k = 1024; + const dm = decimals < 0 ? 0 : decimals; + const sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB']; + + const i = Math.floor(Math.log(bytes) / Math.log(k)); + + return parseFloat((bytes / Math.pow(k, i)).toFixed(dm)) + ' ' + sizes[i]; +} + +exports.getSizeMedia = (path) => { + return new Promise((resolve, reject) => { + if (/http/.test(path)) { + axios.get(path) + .then((res) => { + let length = parseInt(res.headers['content-length']) + let size = exports.bytesToSize(length, 3) + if(!isNaN(length)) resolve(size) + }) + } else if (Buffer.isBuffer(path)) { + let length = Buffer.byteLength(path) + let size = exports.bytesToSize(length, 3) + if(!isNaN(length)) resolve(size) + } else { + reject('error gatau apah') + } + }) +} + +exports.parseMention = (text = '') => { + return [...text.matchAll(/@([0-9]{5,16}|0)/g)].map(v => v[1] + '@s.whatsapp.net') +} + + +/** + * Serialize Message + * @param {WAConnection} conn + * @param {Object} m + * @param {store} store + */ +exports.smsg = (conn, m, store) => { + if (!m) return m + let M = proto.WebMessageInfo + if (m.key) { + m.id = m.key.id + m.isBaileys = m.id.startsWith('BAE5') && m.id.length === 16 + m.chat = m.key.remoteJid + m.fromMe = m.key.fromMe + m.isGroup = m.chat.endsWith('@g.us') + m.sender = conn.decodeJid(m.fromMe && conn.user.id || m.participant || m.key.participant || m.chat || '') + if (m.isGroup) m.participant = conn.decodeJid(m.key.participant) || '' + } + if (m.message) { + m.mtype = getContentType(m.message) + m.msg = (m.mtype == 'viewOnceMessage' ? m.message[m.mtype].message[getContentType(m.message[m.mtype].message)] : m.message[m.mtype]) + m.body = m.message.conversation || m.msg.caption || m.msg.text || (m.mtype == 'listResponseMessage') && m.msg.singleSelectReply.selectedRowId || (m.mtype == 'buttonsResponseMessage') && m.msg.selectedButtonId || (m.mtype == 'viewOnceMessage') && m.msg.caption || m.text + let quoted = m.quoted = m.msg.contextInfo ? m.msg.contextInfo.quotedMessage : null + m.mentionedJid = m.msg.contextInfo ? m.msg.contextInfo.mentionedJid : [] + if (m.quoted) { + let type = getContentType(quoted) + m.quoted = m.quoted[type] + if (['productMessage'].includes(type)) { + type = getContentType(m.quoted) + m.quoted = m.quoted[type] + } + if (typeof m.quoted === 'string') m.quoted = { + text: m.quoted + } + m.quoted.mtype = type + m.quoted.id = m.msg.contextInfo.stanzaId + m.quoted.chat = m.msg.contextInfo.remoteJid || m.chat + m.quoted.isBaileys = m.quoted.id ? m.quoted.id.startsWith('BAE5') && m.quoted.id.length === 16 : false + m.quoted.sender = conn.decodeJid(m.msg.contextInfo.participant) + m.quoted.fromMe = m.quoted.sender === (conn.user && conn.user.id) + m.quoted.text = m.quoted.text || m.quoted.caption || m.quoted.conversation || m.quoted.contentText || m.quoted.selectedDisplayText || m.quoted.title || '' + m.quoted.mentionedJid = m.msg.contextInfo ? m.msg.contextInfo.mentionedJid : [] + m.getQuotedObj = m.getQuotedMessage = async () => { + if (!m.quoted.id) return false + let q = await store.loadMessage(m.chat, m.quoted.id, conn) + return exports.smsg(conn, q, store) + } + let vM = m.quoted.fakeObj = M.fromObject({ + key: { + remoteJid: m.quoted.chat, + fromMe: m.quoted.fromMe, + id: m.quoted.id + }, + message: quoted, + ...(m.isGroup ? { participant: m.quoted.sender } : {}) + }) + + /** + * + * @returns + */ + m.quoted.delete = () => conn.sendMessage(m.quoted.chat, { delete: vM.key }) + + /** + * + * @param {*} jid + * @param {*} forceForward + * @param {*} options + * @returns + */ + m.quoted.copyNForward = (jid, forceForward = false, options = {}) => conn.copyNForward(jid, vM, forceForward, options) + + /** + * + * @returns + */ + m.quoted.download = () => conn.downloadMediaMessage(m.quoted) + } + } + if (m.msg.url) m.download = () => conn.downloadMediaMessage(m.msg) + m.text = m.msg.text || m.msg.caption || m.message.conversation || m.msg.contentText || m.msg.selectedDisplayText || m.msg.title || '' + /** + * Reply to this message + * @param {String|Object} text + * @param {String|false} chatId + * @param {Object} options + */ + m.reply = (text, chatId = m.chat, options = {}) => Buffer.isBuffer(text) ? conn.sendMedia(chatId, text, 'file', '', m, { ...options }) : conn.sendText(chatId, text, m, { ...options }) + /** + * Copy this message + */ + m.copy = () => exports.smsg(conn, M.fromObject(M.toObject(m))) + + /** + * + * @param {*} jid + * @param {*} forceForward + * @param {*} options + * @returns + */ + m.copyNForward = (jid = m.chat, forceForward = false, options = {}) => conn.copyNForward(jid, m, forceForward, options) + + return m +} + + +let file = require.resolve(__filename) +fs.watchFile(file, () => { + fs.unwatchFile(file) + console.log(chalk.redBright(`Update ${__filename}`)) + delete require.cache[file] + require(file) +}) diff --git a/lib/nexus b/lib/nexus deleted file mode 100644 index 139597f9c..000000000 --- a/lib/nexus +++ /dev/null @@ -1,2 +0,0 @@ - - diff --git a/lib/pinterest.js b/lib/pinterest.js new file mode 100644 index 000000000..44af20107 --- /dev/null +++ b/lib/pinterest.js @@ -0,0 +1,42 @@ +//════════════════════════════// +//If you want to recode, reupload +//or copy the codes/script, +//pls give credit +//no credit? i will take action immediately +//© 2022 Xeon Bot Inc. Cheems Bot MD +//Thank you to Lord Buddha, Family and Myself +//════════════════════════════// +//recode kar ke youtube pe upload kar rhe hai ya +//codes copy kar ke apne script me dal rhe +//hai to, description me xeon ka yt channel +// ka link paste kr dena as a cradit or github +//repo me bhi tag kardena baki jo +//bhi karna hai apki marzi, thank you!🦄 +//════════════════════════════// +//If you recode and uploading on your channel +//or copy pasting the codes in ur script, +//i give permission to do as long as you +//put Xeons youtube channel link in the video +//description and tag me on githuh repo, +//thank you🦄 +//════════════════════════════// + +const gis = require("g-i-s") + +async function pinterest(query) { + return new Promise((resolve, reject) => { + let err = { status: 404, message: "There is an error" } + gis({ searchTerm: query + ' site:id.pinterest.com', }, (er, res) => { + if (er) return err + let hasil = { + status: 200, + creator: 'xeon', + result: [] + } + res.forEach(x => hasil.result.push(x.url)) + resolve(hasil) + }) + }) +} + +module.exports.pinterest = pinterest \ No newline at end of file diff --git a/lib/scraper.js b/lib/scraper.js index 17916bce7..7acf04c35 100644 --- a/lib/scraper.js +++ b/lib/scraper.js @@ -1,4 +1,4 @@ -//═══════════════════════════════════════════════════════// +//════════════════════════════// //If you want to recode, reupload //or copy the codes/script, //pls give credit @@ -6,6 +6,20 @@ //© 2022 Xeon Bot Inc. Cheems Bot MD //Thank you to Lord Buddha, Family and Myself //════════════════════════════// +//recode kar ke youtube pe upload kar rhe hai ya +//codes copy kar ke apne script me dal rhe +//hai to, description me xeon ka yt channel +// ka link paste kr dena as a cradit or github +//repo me bhi tag kardena baki jo +//bhi karna hai apki marzi, thank you!🦄 +//════════════════════════════// +//If you recode and uploading on your channel +//or copy pasting the codes in ur script, +//i give permission to do as long as you +//put Xeons youtube channel link in the video +//description and tag me on githuh repo, +//thank you🦄 +//════════════════════════════// const axios = require('axios') const cheerio = require('cheerio') diff --git a/lib/scraper2.js b/lib/scraper2.js new file mode 100644 index 000000000..f412c8815 --- /dev/null +++ b/lib/scraper2.js @@ -0,0 +1,169 @@ +// K.Prabhasha +const axios = require('axios') +const cheerio = require('cheerio') + +function pinterest(querry){ + return new Promise(async(resolve,reject) => { + axios.get('https://id.pinterest.com/search/pins/?autologin=true&q=' + querry, { + headers: { + "cookie" : "_auth=1; _b=\"AVna7S1p7l1C5I9u0+nR3YzijpvXOPc6d09SyCzO+DcwpersQH36SmGiYfymBKhZcGg=\"; _pinterest_sess=TWc9PSZHamJOZ0JobUFiSEpSN3Z4a2NsMk9wZ3gxL1NSc2k2NkFLaUw5bVY5cXR5alZHR0gxY2h2MVZDZlNQalNpUUJFRVR5L3NlYy9JZkthekp3bHo5bXFuaFZzVHJFMnkrR3lTbm56U3YvQXBBTW96VUgzVUhuK1Z4VURGKzczUi9hNHdDeTJ5Y2pBTmxhc2owZ2hkSGlDemtUSnYvVXh5dDNkaDN3TjZCTk8ycTdHRHVsOFg2b2NQWCtpOWxqeDNjNkk3cS85MkhhSklSb0hwTnZvZVFyZmJEUllwbG9UVnpCYVNTRzZxOXNJcmduOVc4aURtM3NtRFo3STlmWjJvSjlWTU5ITzg0VUg1NGhOTEZzME9SNFNhVWJRWjRJK3pGMFA4Q3UvcHBnWHdaYXZpa2FUNkx6Z3RNQjEzTFJEOHZoaHRvazc1c1UrYlRuUmdKcDg3ZEY4cjNtZlBLRTRBZjNYK0lPTXZJTzQ5dU8ybDdVS015bWJKT0tjTWYyRlBzclpiamdsNmtpeUZnRjlwVGJXUmdOMXdTUkFHRWloVjBMR0JlTE5YcmhxVHdoNzFHbDZ0YmFHZ1VLQXU1QnpkM1FqUTNMTnhYb3VKeDVGbnhNSkdkNXFSMXQybjRGL3pyZXRLR0ZTc0xHZ0JvbTJCNnAzQzE0cW1WTndIK0trY05HV1gxS09NRktadnFCSDR2YzBoWmRiUGZiWXFQNjcwWmZhaDZQRm1UbzNxc21pV1p5WDlabm1UWGQzanc1SGlrZXB1bDVDWXQvUis3elN2SVFDbm1DSVE5Z0d4YW1sa2hsSkZJb1h0MTFpck5BdDR0d0lZOW1Pa2RDVzNySWpXWmUwOUFhQmFSVUpaOFQ3WlhOQldNMkExeDIvMjZHeXdnNjdMYWdiQUhUSEFBUlhUVTdBMThRRmh1ekJMYWZ2YTJkNlg0cmFCdnU2WEpwcXlPOVZYcGNhNkZDd051S3lGZmo0eHV0ZE42NW8xRm5aRWpoQnNKNnNlSGFad1MzOHNkdWtER0xQTFN5Z3lmRERsZnZWWE5CZEJneVRlMDd2VmNPMjloK0g5eCswZUVJTS9CRkFweHc5RUh6K1JocGN6clc1JmZtL3JhRE1sc0NMTFlpMVErRGtPcllvTGdldz0=; _ir=0" + } + }).then(({ data }) => { + const $ = cheerio.load(data) + const result = []; + const hasil = []; + $('div > a').get().map(b => { + const link = $(b).find('img').attr('src') + result.push(link) + }); + result.forEach(v => { + if(v == undefined) return + hasil.push(v.replace(/236/g,'736')) + }) + hasil.shift(); + resolve(hasil) + }) + }) +} + +function wallpaper(title, page = '1') { + return new Promise((resolve, reject) => { + axios.get(`https://www.besthdwallpaper.com/search?CurrentPage=${page}&q=${title}`) + .then(({ data }) => { + let $ = cheerio.load(data) + let hasil = [] + $('div.grid-item').each(function (a, b) { + hasil.push({ + title: $(b).find('div.info > a > h3').text(), + type: $(b).find('div.info > a:nth-child(2)').text(), + source: 'https://www.besthdwallpaper.com/'+$(b).find('div > a:nth-child(3)').attr('href'), + image: [$(b).find('picture > img').attr('data-src') || $(b).find('picture > img').attr('src'), $(b).find('picture > source:nth-child(1)').attr('srcset'), $(b).find('picture > source:nth-child(2)').attr('srcset')] + }) + }) + resolve(hasil) + }) + }) +} + +function wikimedia(title) { + return new Promise((resolve, reject) => { + axios.get(`https://commons.wikimedia.org/w/index.php?search=${title}&title=Special:MediaSearch&go=Go&type=image`) + .then((res) => { + let $ = cheerio.load(res.data) + let hasil = [] + $('.sdms-search-results__list-wrapper > div > a').each(function (a, b) { + hasil.push({ + title: $(b).find('img').attr('alt'), + source: $(b).attr('href'), + image: $(b).find('img').attr('data-src') || $(b).find('img').attr('src') + }) + }) + resolve(hasil) + }) + }) +} + +function porno() { + return new Promise((resolve, reject) => { + axios.get('https://tikporntok.com/?random=1') + .then((res) => { + const $ = cheerio.load(res.data) + const hasil = {} + hasil.title = $('article > h1').text() + hasil.source = $('article > div.video-wrapper.vxplayer').attr('data-post') || 'Web Not Response' + hasil.thumb = $('article > div.video-wrapper.vxplayer > div.vx_el').attr('data-poster') || 'https://4.bp.blogspot.com/-hyMqjmQQq4o/W6al-Rk4IpI/AAAAAAAADJ4/m-lVBA_GC9Q5d4BIQg8ZO3fYmQQC3LqSACLcBGAs/s1600/404_not_found.png' + hasil.desc = $('article > div.intro').text() + hasil.upload = $('article > div.single-pre-meta.ws.clearfix > time').text() + hasil.like = $('article > div.single-pre-meta.ws.clearfix > div > span:nth-child(1) > span').text() + hasil.dislike = $('article > div.single-pre-meta.ws.clearfix > div > span:nth-child(2) > span').text() + hasil.favorite = $('article > div.single-pre-meta.ws.clearfix > div > span:nth-child(3) > span').text() + hasil.views = $('article > div.single-pre-meta.ws.clearfix > div > span:nth-child(4) > span').text() + hasil.tags = $('article > div.post-tags').text() + hasil.video = $('article > div.video-wrapper.vxplayer > div.vx_el').attr('src') || $('article > div.video-wrapper.vxplayer > div.vx_el').attr('data-src') || 'https://4.bp.blogspot.com/-hyMqjmQQq4o/W6al-Rk4IpI/AAAAAAAADJ4/m-lVBA_GC9Q5d4BIQg8ZO3fYmQQC3LqSACLcBGAs/s1600/404_not_found.png' + resolve(hasil) + }) + }) +} + +function hentai() { + return new Promise((resolve, reject) => { + const page = Math.floor(Math.random() * 1153) + axios.get('https://sfmcompile.club/page/'+page) + .then((data) => { + const $ = cheerio.load(data.data) + const hasil = [] + $('#primary > div > div > ul > li > article').each(function (a, b) { + hasil.push({ + title: $(b).find('header > h2').text(), + link: $(b).find('header > h2 > a').attr('href'), + category: $(b).find('header > div.entry-before-title > span > span').text().replace('in ', ''), + share_count: $(b).find('header > div.entry-after-title > p > span.entry-shares').text(), + views_count: $(b).find('header > div.entry-after-title > p > span.entry-views').text(), + type: $(b).find('source').attr('type') || 'image/jpeg', + video_1: $(b).find('source').attr('src') || $(b).find('img').attr('data-src'), + video_2: $(b).find('video > a').attr('href') || '' + }) + }) + resolve(hasil) + }) + }) +} + +function quotesAnime() { + return new Promise((resolve, reject) => { + const page = Math.floor(Math.random() * 184) + axios.get('https://otakotaku.com/quote/feed/'+page) + .then(({ data }) => { + const $ = cheerio.load(data) + const hasil = [] + $('div.kotodama-list').each(function(l, h) { + hasil.push({ + link: $(h).find('a').attr('href'), + gambar: $(h).find('img').attr('data-src'), + karakter: $(h).find('div.char-name').text().trim(), + anime: $(h).find('div.anime-title').text().trim(), + episode: $(h).find('div.meta').text(), + up_at: $(h).find('small.meta').text(), + quotes: $(h).find('div.quote').text().trim() + }) + }) + resolve(hasil) + }).catch(reject) + }) +} +function igstalk(username){ + return new Promise((resolve,reject) => { + axios.get('https://www.instagram.com/'+ username +'/?__a=1',{ + method: 'GET', + headers: { + "user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.114 Safari/537.36", + "cookie": "mid=XBXl1AALAAEbFoAEfNjZlMMG9dwX; ig_did=91E66A48-5AA2-445D-BFE6-84DC4456DE8F; fbm_124024574287414=base_domain=.instagram.com; ig_nrcb=1; shbid=\"12737\0544008624962\0541656157971:01f72a5102dc07af6845adf923ca70eb86e81ab95fa9dbfdaf157c9eef0e82fd1f10fe23\"; shbts=\"1624621971\0544008624962\0541656157971:01f74841fba8e77a0066b47ea891dec8fba6fdf9216c0816f9fb3532292f769828800ae2\"; fbsr_124024574287414=86D8femzH4_KFW4hd3Z6XFdowU6lG-uXsXRQDNl44VM.eyJ1c2VyX2lkIjoiMTAwMDA0Njc2MDc4Nzg5IiwiY29kZSI6IkFRQngzXzVOejdwVnBwby1LRGRUdEYxUFlzcUdDQXJjcmJfb05HaWFvYkNvOGtLN2paam50bHpvMTNOakFnTzVKOHQ5M0V3U3dvNkRtZ0RiY1l1Z3dQSTIybnExOUxLd3lpZTVfZll0bkNXZXBuM1hoYWFLX0w2R0pZaUpzaDBOTDBhb3pmTVBkRTVQRC12X3FnbUgxLXZYdGVmcHhfaFU0aUZNZVMxNHhFUk5OblJyMmxYTUpDa2RFYTdISXNCR2swdHhaaGF0NUt4UDR3cWZTamRwcVFfQ19sa1RUek5fU0taUTYtMjlzTkdnLUVWb3oxMUZWc3Q2OEx2ZnlIY0V0eFp0ZUxacXpiWmh6MzZrVl83VmFGd0FqVnVkTGFQN2VzT3ZRcmlTQ2pLUE5XbVcyNWhudzIzejJBSnVURW00YWR1cmN6a3ZLWU1icTd2SnN0SVdJV09RIiwib2F1dGhfdG9rZW4iOiJFQUFCd3pMaXhuallCQUJBZmJuQ3haQzZMd3h4MDFJV2MyZ3dsQ3k3Qmp0b05UNUY0WDY2NHBrUzRQeERNVXRsdmhWWkI3SXE0MGsyZ2hJQm55RHRPcW5iVjlPbUNiWGhyTFBaQUhBQjFzVFpBdHF6RFEzVTROUkhOU1V6MFVXWkNtTEdLcDNNWDRoazVIOURLbERHN0QwUlhZNHY4dHBCdVNNYjN4dnBTRGtQcHdYRlBXVU82VCIsImFsZ29yaXRobSI6IkhNQUMtU0hBMjU2IiwiaXNzdWVkX2F0IjoxNjI0NjIxOTgxfQ; fbsr_124024574287414=86D8femzH4_KFW4hd3Z6XFdowU6lG-uXsXRQDNl44VM.eyJ1c2VyX2lkIjoiMTAwMDA0Njc2MDc4Nzg5IiwiY29kZSI6IkFRQngzXzVOejdwVnBwby1LRGRUdEYxUFlzcUdDQXJjcmJfb05HaWFvYkNvOGtLN2paam50bHpvMTNOakFnTzVKOHQ5M0V3U3dvNkRtZ0RiY1l1Z3dQSTIybnExOUxLd3lpZTVfZll0bkNXZXBuM1hoYWFLX0w2R0pZaUpzaDBOTDBhb3pmTVBkRTVQRC12X3FnbUgxLXZYdGVmcHhfaFU0aUZNZVMxNHhFUk5OblJyMmxYTUpDa2RFYTdISXNCR2swdHhaaGF0NUt4UDR3cWZTamRwcVFfQ19sa1RUek5fU0taUTYtMjlzTkdnLUVWb3oxMUZWc3Q2OEx2ZnlIY0V0eFp0ZUxacXpiWmh6MzZrVl83VmFGd0FqVnVkTGFQN2VzT3ZRcmlTQ2pLUE5XbVcyNWhudzIzejJBSnVURW00YWR1cmN6a3ZLWU1icTd2SnN0SVdJV09RIiwib2F1dGhfdG9rZW4iOiJFQUFCd3pMaXhuallCQUJBZmJuQ3haQzZMd3h4MDFJV2MyZ3dsQ3k3Qmp0b05UNUY0WDY2NHBrUzRQeERNVXRsdmhWWkI3SXE0MGsyZ2hJQm55RHRPcW5iVjlPbUNiWGhyTFBaQUhBQjFzVFpBdHF6RFEzVTROUkhOU1V6MFVXWkNtTEdLcDNNWDRoazVIOURLbERHN0QwUlhZNHY4dHBCdVNNYjN4dnBTRGtQcHdYRlBXVU82VCIsImFsZ29yaXRobSI6IkhNQUMtU0hBMjU2IiwiaXNzdWVkX2F0IjoxNjI0NjIxOTgxfQ; csrftoken=PpiPMEl0R2pAwThsw4NXynO6cVIXHZDo; ds_user_id=38316792800; sessionid=38316792800:rQj5Tr3g5zkg7b:4; rur=\"RVA\05438316792800\0541656158332:01f759cf624bef147397144805bb4c26f6c8b36a232e0f5738c570ee492f6b629f84f6e5\"" + } + }) + .then( async data => { + const user = data.graphql.user + let result = { + message: 'By ZeeoneOfc', + id: user.id, + biography: user.biography, + followers: user.edge_followed_by.count, + following: user.edge_follow.count, + fullName: user.full_name, + highlightCount: user.highlight_reel_count, + isBusinessAccount: user.is_business_account, + isRecentUser: user.is_joined_recently, + accountCategory: user.business_category_name, + linkedFacebookPage: user.connected_fb_page, + isPrivate: user.is_private, + isVerified: user.is_verified, + profilePicHD: user.profile_pic_url_hd, + username: user.username, + postsCount: user.edge_owner_to_timeline_media.count + } + resolve(result) + }) + .catch(reject) + }) +} + +module.exports = { pinterest, wallpaper, wikimedia, porno, hentai, quotesAnime , igstalk} \ No newline at end of file diff --git a/lib/scraperW.js b/lib/scraperW.js new file mode 100644 index 000000000..ed3d8ce86 --- /dev/null +++ b/lib/scraperW.js @@ -0,0 +1,170 @@ +// K.Prabhasha +const axios = require('axios') +const cheerio = require('cheerio') + + +function pinterest(querry){ + return new Promise(async(resolve,reject) => { + axios.get('https://id.pinterest.com/search/pins/?autologin=true&q=' + querry, { + headers: { + "cookie" : "_auth=1; _b=\"AVna7S1p7l1C5I9u0+nR3YzijpvXOPc6d09SyCzO+DcwpersQH36SmGiYfymBKhZcGg=\"; _pinterest_sess=TWc9PSZHamJOZ0JobUFiSEpSN3Z4a2NsMk9wZ3gxL1NSc2k2NkFLaUw5bVY5cXR5alZHR0gxY2h2MVZDZlNQalNpUUJFRVR5L3NlYy9JZkthekp3bHo5bXFuaFZzVHJFMnkrR3lTbm56U3YvQXBBTW96VUgzVUhuK1Z4VURGKzczUi9hNHdDeTJ5Y2pBTmxhc2owZ2hkSGlDemtUSnYvVXh5dDNkaDN3TjZCTk8ycTdHRHVsOFg2b2NQWCtpOWxqeDNjNkk3cS85MkhhSklSb0hwTnZvZVFyZmJEUllwbG9UVnpCYVNTRzZxOXNJcmduOVc4aURtM3NtRFo3STlmWjJvSjlWTU5ITzg0VUg1NGhOTEZzME9SNFNhVWJRWjRJK3pGMFA4Q3UvcHBnWHdaYXZpa2FUNkx6Z3RNQjEzTFJEOHZoaHRvazc1c1UrYlRuUmdKcDg3ZEY4cjNtZlBLRTRBZjNYK0lPTXZJTzQ5dU8ybDdVS015bWJKT0tjTWYyRlBzclpiamdsNmtpeUZnRjlwVGJXUmdOMXdTUkFHRWloVjBMR0JlTE5YcmhxVHdoNzFHbDZ0YmFHZ1VLQXU1QnpkM1FqUTNMTnhYb3VKeDVGbnhNSkdkNXFSMXQybjRGL3pyZXRLR0ZTc0xHZ0JvbTJCNnAzQzE0cW1WTndIK0trY05HV1gxS09NRktadnFCSDR2YzBoWmRiUGZiWXFQNjcwWmZhaDZQRm1UbzNxc21pV1p5WDlabm1UWGQzanc1SGlrZXB1bDVDWXQvUis3elN2SVFDbm1DSVE5Z0d4YW1sa2hsSkZJb1h0MTFpck5BdDR0d0lZOW1Pa2RDVzNySWpXWmUwOUFhQmFSVUpaOFQ3WlhOQldNMkExeDIvMjZHeXdnNjdMYWdiQUhUSEFBUlhUVTdBMThRRmh1ekJMYWZ2YTJkNlg0cmFCdnU2WEpwcXlPOVZYcGNhNkZDd051S3lGZmo0eHV0ZE42NW8xRm5aRWpoQnNKNnNlSGFad1MzOHNkdWtER0xQTFN5Z3lmRERsZnZWWE5CZEJneVRlMDd2VmNPMjloK0g5eCswZUVJTS9CRkFweHc5RUh6K1JocGN6clc1JmZtL3JhRE1sc0NMTFlpMVErRGtPcllvTGdldz0=; _ir=0" + } + }).then(({ data }) => { + const $ = cheerio.load(data) + const result = []; + const hasil = []; + $('div > a').get().map(b => { + const link = $(b).find('img').attr('src') + result.push(link) + }); + result.forEach(v => { + if(v == undefined) return + hasil.push(v.replace(/236/g,'736')) + }) + hasil.shift(); + resolve(hasil) + }) + }) +} + +function wallpaper(title, page = '1') { + return new Promise((resolve, reject) => { + axios.get(`https://www.besthdwallpaper.com/search?CurrentPage=${page}&q=${title}`) + .then(({ data }) => { + let $ = cheerio.load(data) + let hasil = [] + $('div.grid-item').each(function (a, b) { + hasil.push({ + title: $(b).find('div.info > a > h3').text(), + type: $(b).find('div.info > a:nth-child(2)').text(), + source: 'https://www.besthdwallpaper.com/'+$(b).find('div > a:nth-child(3)').attr('href'), + image: [$(b).find('picture > img').attr('data-src') || $(b).find('picture > img').attr('src'), $(b).find('picture > source:nth-child(1)').attr('srcset'), $(b).find('picture > source:nth-child(2)').attr('srcset')] + }) + }) + resolve(hasil) + }) + }) +} + +function wikimedia(title) { + return new Promise((resolve, reject) => { + axios.get(`https://commons.wikimedia.org/w/index.php?search=${title}&title=Special:MediaSearch&go=Go&type=image`) + .then((res) => { + let $ = cheerio.load(res.data) + let hasil = [] + $('.sdms-search-results__list-wrapper > div > a').each(function (a, b) { + hasil.push({ + title: $(b).find('img').attr('alt'), + source: $(b).attr('href'), + image: $(b).find('img').attr('data-src') || $(b).find('img').attr('src') + }) + }) + resolve(hasil) + }) + }) +} + +function quotesAnime() { + return new Promise((resolve, reject) => { + const page = Math.floor(Math.random() * 184) + axios.get('https://otakotaku.com/quote/feed/'+page) + .then(({ data }) => { + const $ = cheerio.load(data) + const hasil = [] + $('div.kotodama-list').each(function(l, h) { + hasil.push({ + link: $(h).find('a').attr('href'), + gambar: $(h).find('img').attr('data-src'), + karakter: $(h).find('div.char-name').text().trim(), + anime: $(h).find('div.anime-title').text().trim(), + episode: $(h).find('div.meta').text(), + up_at: $(h).find('small.meta').text(), + quotes: $(h).find('div.quote').text().trim() + }) + }) + resolve(hasil) + }).catch(reject) + }) +} + +function aiovideodl(link) { + return new Promise((resolve, reject) => { + axios({ + url: 'https://aiovideodl.ml/', + method: 'GET', + headers: { + "user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36", + "cookie": "PHPSESSID=69ce1f8034b1567b99297eee2396c308; _ga=GA1.2.1360894709.1632723147; _gid=GA1.2.1782417082.1635161653" + } + }).then((src) => { + let a = cheerio.load(src.data) + let token = a('#token').attr('value') + axios({ + url: 'https://aiovideodl.ml/wp-json/aio-dl/video-data/', + method: 'POST', + headers: { + "user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36", + "cookie": "PHPSESSID=69ce1f8034b1567b99297eee2396c308; _ga=GA1.2.1360894709.1632723147; _gid=GA1.2.1782417082.1635161653" + }, + data: new URLSearchParams(Object.entries({ 'url': link, 'token': token })) + }).then(({ data }) => { + resolve(data) + }) + }) + }) +} + +function umma(url) { + return new Promise((resolve, reject) => { + axios.get(url) + .then((res) => { + let $ = cheerio.load(res.data) + let image = [] + $('#article-content > div').find('img').each(function (a, b) { + image.push($(b).attr('src')) + }) + let hasil = { + title: $('#wrap > div.content-container.font-6-16 > h1').text().trim(), + author: { + name: $('#wrap > div.content-container.font-6-16 > div.content-top > div > div.user-ame.font-6-16.fw').text().trim(), + profilePic: $('#wrap > div.content-container.font-6-16 > div.content-top > div > div.profile-photo > img.photo').attr('src') + }, + caption: $('#article-content > div > p').text().trim(), + media: $('#article-content > div > iframe').attr('src') ? [$('#article-content > div > iframe').attr('src')] : image, + type: $('#article-content > div > iframe').attr('src') ? 'video' : 'image', + like: $('#wrap > div.bottom-btns > div > button:nth-child(1) > div.text.font-6-12').text(), + } + resolve(hasil) + }) + }) +} + +function ringtone(title) { + return new Promise((resolve, reject) => { + axios.get('https://meloboom.com/en/search/'+title) + .then((get) => { + let $ = cheerio.load(get.data) + let hasil = [] + $('#__next > main > section > div.jsx-2244708474.container > div > div > div > div:nth-child(4) > div > div > div > ul > li').each(function (a, b) { + hasil.push({ title: $(b).find('h4').text(), source: 'https://meloboom.com/'+$(b).find('a').attr('href'), audio: $(b).find('audio').attr('src') }) + }) + resolve(hasil) + }) + }) +} + +function styletext(teks) { + return new Promise((resolve, reject) => { + axios.get('http://qaz.wtf/u/convert.cgi?text='+teks) + .then(({ data }) => { + let $ = cheerio.load(data) + let hasil = [] + $('table > tbody > tr').each(function (a, b) { + hasil.push({ name: $(b).find('td:nth-child(1) > span').text(), result: $(b).find('td:nth-child(2)').text().trim() }) + }) + resolve(hasil) + }) + }) +} + +module.exports = { pinterest, wallpaper, wikimedia, quotesAnime, aiovideodl, umma, ringtone, styletext } diff --git a/lib/textpro.js b/lib/textpro.js new file mode 100644 index 000000000..a2d9dad10 --- /dev/null +++ b/lib/textpro.js @@ -0,0 +1,94 @@ +// K.Prabhasha +const fetch = require("node-fetch"); +const cheerio = require("cheerio"); +const cookie = require("cookie"); +const FormData = require("form-data"); + +async function post(url, formdata = {}, cookies) { + let encode = encodeURIComponent; + let body = Object.keys(formdata) + .map((key) => { + let vals = formdata[key]; + let isArray = Array.isArray(vals); + let keys = encode(key + (isArray ? "[]" : "")); + if (!isArray) vals = [vals]; + let out = []; + for (let valq of vals) out.push(keys + "=" + encode(valq)); + return out.join("&"); + }) + .join("&"); + return await fetch(`${url}?${body}`, { + method: "GET", + headers: { + Accept: "*/*", + "Accept-Language": "en-US,en;q=0.9", + "User-Agent": "GoogleBot", + Cookie: cookies, + }, + }); +} + +/** + * TextPro Scraper + * @function + * @param {String} url - Your phootoxy url, example https://photooxy.com/logo-and-text-effects/make-tik-tok-text-effect-375.html. + * @param {String[]} text - Text (required). example ["text", "text 2 if any"] + */ + +async function textpro(url, text) { + if (!/^https:\/\/textpro\.me\/.+\.html$/.test(url)) + throw new Error("Url Salah!!"); + const geturl = await fetch(url, { + method: "GET", + headers: { + "User-Agent": "GoogleBot", + }, + }); + const caritoken = await geturl.text(); + let hasilcookie = geturl.headers + .get("set-cookie") + .split(",") + .map((v) => cookie.parse(v)) + .reduce((a, c) => { + return { ...a, ...c }; + }, {}); + hasilcookie = { + __cfduid: hasilcookie.__cfduid, + PHPSESSID: hasilcookie.PHPSESSID, + }; + hasilcookie = Object.entries(hasilcookie) + .map(([name, value]) => cookie.serialize(name, value)) + .join("; "); + const $ = cheerio.load(caritoken); + const token = $('input[name="token"]').attr("value"); + const form = new FormData(); + if (typeof text === "string") text = [text]; + for (let texts of text) form.append("text[]", texts); + form.append("submit", "Go"); + form.append("token", token); + form.append("build_server", "https://textpro.me"); + form.append("build_server_id", 1); + const geturl2 = await fetch(url, { + method: "POST", + headers: { + Accept: "*/*", + "Accept-Language": "en-US,en;q=0.9", + "User-Agent": "GoogleBot", + Cookie: hasilcookie, + ...form.getHeaders(), + }, + body: form.getBuffer(), + }); + const caritoken2 = await geturl2.text(); + const token2 = /(.*?)<\/div>/.exec(caritoken2); + if (!token2) throw new Error("Token Tidak Ditemukan!!"); + const prosesimage = await post( + "https://textpro.me/effect/create-image", + JSON.parse(token2[1]), + hasilcookie + ); + const hasil = await prosesimage.json(); + return `https://textpro.me${hasil.fullsize_image}`; +} + +module.exports = textpro diff --git a/lib/tictactoe.js b/lib/tictactoe.js index 9b631ba5d..afdba8995 100644 --- a/lib/tictactoe.js +++ b/lib/tictactoe.js @@ -1,4 +1,4 @@ -//═══════════════════════════════════════════════════════// +//════════════════════════════// //If you want to recode, reupload //or copy the codes/script, //pls give credit @@ -6,6 +6,20 @@ //© 2022 Xeon Bot Inc. Cheems Bot MD //Thank you to Lord Buddha, Family and Myself //════════════════════════════// +//recode kar ke youtube pe upload kar rhe hai ya +//codes copy kar ke apne script me dal rhe +//hai to, description me xeon ka yt channel +// ka link paste kr dena as a cradit or github +//repo me bhi tag kardena baki jo +//bhi karna hai apki marzi, thank you!🦄 +//════════════════════════════// +//If you recode and uploading on your channel +//or copy pasting the codes in ur script, +//i give permission to do as long as you +//put Xeons youtube channel link in the video +//description and tag me on githuh repo, +//thank you🦄 +//════════════════════════════// class TicTacToe { constructor(playerX = 'x', playerO = 'o') { this.playerX = playerX diff --git a/lib/tiktokbyxeon.js b/lib/tiktokbyxeon.js new file mode 100644 index 000000000..1eba36b75 --- /dev/null +++ b/lib/tiktokbyxeon.js @@ -0,0 +1,46 @@ +// K.Prabhasha +const axios = require('axios') +const cheerio = require('cheerio') + +async function KUMUTHUTiktok (Url) { + return new Promise (async (resolve, reject) => { + await axios.request({ + url: "https://ttdownloader.com/", + method: "GET", + headers: { + "accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9", + "accept-language": "en-US,en;q=0.9,id;q=0.8", + "user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36", + "cookie": "_ga=GA1.2.1240046717.1620835673; PHPSESSID=i14curq5t8omcljj1hlle52762; popCookie=1; _gid=GA1.2.1936694796.1623913934" + } + }).then(respon => { + const $ = cheerio.load(respon.data) + const token = $('#token').attr('value') + axios({ + url: "https://ttdownloader.com/req/", + method: "POST", + data: new URLSearchParams(Object.entries({url: Url, format: "", token: token})), + headers: { + "accept": "*/*", + "accept-language": "en-US,en;q=0.9,id;q=0.8", + "content-type": "application/x-www-form-urlencoded; charset=UTF-8", + "user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36", + "cookie": "_ga=GA1.2.1240046717.1620835673; PHPSESSID=i14curq5t8omcljj1hlle52762; popCookie=1; _gid=GA1.2.1936694796.1623913934" + } + }).then(res => { + const ch = cheerio.load(res.data) + const result = { + status: res.status, + result: { + nowatermark: ch('#results-list > div:nth-child(2)').find('div.download > a').attr('href'), + watermark: ch('#results-list > div:nth-child(3)').find('div.download > a').attr('href'), + audio: ch('#results-list > div:nth-child(4)').find(' div.download > a').attr('href') + } + } + resolve(result) + }).catch(reject) + }).catch(reject) + }) +} + +module.exports = { KUMUTHUTiktok } \ No newline at end of file diff --git a/lib/uploader.js b/lib/uploader.js index 0cd1cc108..5342025de 100644 --- a/lib/uploader.js +++ b/lib/uploader.js @@ -1,4 +1,4 @@ -//═══════════════════════════════════════════════════════// +//════════════════════════════// //If you want to recode, reupload //or copy the codes/script, //pls give credit @@ -6,6 +6,20 @@ //© 2022 Xeon Bot Inc. Cheems Bot MD //Thank you to Lord Buddha, Family and Myself //════════════════════════════// +//recode kar ke youtube pe upload kar rhe hai ya +//codes copy kar ke apne script me dal rhe +//hai to, description me xeon ka yt channel +// ka link paste kr dena as a cradit or github +//repo me bhi tag kardena baki jo +//bhi karna hai apki marzi, thank you!🦄 +//════════════════════════════// +//If you recode and uploading on your channel +//or copy pasting the codes in ur script, +//i give permission to do as long as you +//put Xeons youtube channel link in the video +//description and tag me on githuh repo, +//thank you🦄 +//════════════════════════════// let axios = require('axios') let BodyForm = require('form-data') let { fromBuffer } = require('file-type') diff --git a/lib/uploader2.js b/lib/uploader2.js new file mode 100644 index 000000000..f87b9f20f --- /dev/null +++ b/lib/uploader2.js @@ -0,0 +1,128 @@ +//════════════════════════════// +//If you want to recode, reupload +//or copy the codes/script, +//pls give credit +//no credit? i will take action immediately +//© 2022 Xeon Bot Inc. Cheems Bot MD +//Thank you to Lord Buddha, Family and Myself +//════════════════════════════// +//recode kar ke youtube pe upload kar rhe hai ya +//codes copy kar ke apne script me dal rhe +//hai to, description me xeon ka yt channel +// ka link paste kr dena as a cradit or github +//repo me bhi tag kardena baki jo +//bhi karna hai apki marzi, thank you!🦄 +//════════════════════════════// +//If you recode and uploading on your channel +//or copy pasting the codes in ur script, +//i give permission to do as long as you +//put Xeons youtube channel link in the video +//description and tag me on githuh repo, +//thank you🦄 +//════════════════════════════// + +let axios = require('axios') +let BodyForm = require('form-data') +let { fromBuffer } = require('file-type') +let fetch = require('node-fetch') +let fs = require('fs') +let cheerio = require('cheerio') + + + +function TelegraPh (Path) { + return new Promise (async (resolve, reject) => { + if (!fs.existsSync(Path)) return reject(new Error("File not Found")) + try { + const form = new BodyForm(); + form.append("file", fs.createReadStream(Path)) + const data = await axios({ + url: "https://telegra.ph/upload", + method: "POST", + headers: { + ...form.getHeaders() + }, + data: form + }) + return resolve("https://telegra.ph" + data.data[0].src) + } catch (err) { + return reject(new Error(String(err))) + } + }) +} + +async function UploadFileUgu (input) { + return new Promise (async (resolve, reject) => { + const form = new BodyForm(); + form.append("files[]", fs.createReadStream(input)) + await axios({ + url: "https://uguu.se/upload.php", + method: "POST", + headers: { + "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.212 Safari/537.36", + ...form.getHeaders() + }, + data: form + }).then((data) => { + resolve(data.data.files[0]) + }).catch((err) => reject(err)) + }) +} + +function webp2mp4File(path) { + return new Promise((resolve, reject) => { + const form = new BodyForm() + form.append('new-image-url', '') + form.append('new-image', fs.createReadStream(path)) + axios({ + method: 'post', + url: 'https://s6.ezgif.com/webp-to-mp4', + data: form, + headers: { + 'Content-Type': `multipart/form-data; boundary=${form._boundary}` + } + }).then(({ data }) => { + const bodyFormThen = new BodyForm() + const $ = cheerio.load(data) + const file = $('input[name="file"]').attr('value') + bodyFormThen.append('file', file) + bodyFormThen.append('convert', "Convert WebP to MP4!") + axios({ + method: 'post', + url: 'https://ezgif.com/webp-to-mp4/' + file, + data: bodyFormThen, + headers: { + 'Content-Type': `multipart/form-data; boundary=${bodyFormThen._boundary}` + } + }).then(({ data }) => { + const $ = cheerio.load(data) + const result = 'https:' + $('div#output > p.outfile > video > source').attr('src') + resolve({ + status: true, + message: "Created By MRHRTZ", + result: result + }) + }).catch(reject) + }).catch(reject) + }) +} + +async function floNime(medianya, options = {}) { +const { ext } = await fromBuffer(medianya) || options.ext + var form = new BodyForm() + form.append('file', medianya, 'tmp.'+ext) + jsonnya = await fetch('https://flonime.my.id/upload', { + method: 'POST', + body: form + }) + .then((response) => response.json()) + .then((result) => { + return result + }) + .catch(e => { + return e + }) + return jsonnya +} + +module.exports = { TelegraPh, UploadFileUgu, webp2mp4File, floNime } diff --git a/lib/xeonywiki.js b/lib/xeonywiki.js new file mode 100644 index 000000000..dea4222bf --- /dev/null +++ b/lib/xeonywiki.js @@ -0,0 +1,17 @@ +// K.Prabhasha +const axios = require('axios') +const cheerio = require('cheerio') + +const KUMUTHUWiki = async (query) => { +const res = await axios.get(`https://en.m.wikipedia.org/w/index.php?search=${query}`) +const $ = cheerio.load(res.data) +const hasil = [] +let wiki = $('#mf-section-0').find('p').text() +let thumb = $('#mf-section-0').find('div > div > a > img').attr('src') +thumb = thumb ? thumb : '//pngimg.com/uploads/wikipedia/wikipedia_PNG35.png' +thumb = 'https:' + thumb +let judul = $('h1#section_0').text() +hasil.push({ wiki, thumb, judul }) +return hasil +} +module.exports = { KUMUTHUWiki} \ No newline at end of file diff --git a/lib/y2mate.js b/lib/y2mate.js index b9d814243..93eb2cb11 100644 --- a/lib/y2mate.js +++ b/lib/y2mate.js @@ -1,4 +1,4 @@ -//═══════════════════════════════════════════════════════// +//════════════════════════════// //If you want to recode, reupload //or copy the codes/script, //pls give credit @@ -6,6 +6,20 @@ //© 2022 Xeon Bot Inc. Cheems Bot MD //Thank you to Lord Buddha, Family and Myself //════════════════════════════// +//recode kar ke youtube pe upload kar rhe hai ya +//codes copy kar ke apne script me dal rhe +//hai to, description me xeon ka yt channel +// ka link paste kr dena as a cradit or github +//repo me bhi tag kardena baki jo +//bhi karna hai apki marzi, thank you!🦄 +//════════════════════════════// +//If you recode and uploading on your channel +//or copy pasting the codes in ur script, +//i give permission to do as long as you +//put Xeons youtube channel link in the video +//description and tag me on githuh repo, +//thank you🦄 +//════════════════════════════// let fetch = require('node-fetch') let { JSDOM } = require('jsdom') diff --git a/node_modules/@adiwajshing/baileys/README.md b/node_modules/@adiwajshing/baileys/README.md index 33317d038..28fffaa84 100644 --- a/node_modules/@adiwajshing/baileys/README.md +++ b/node_modules/@adiwajshing/baileys/README.md @@ -15,7 +15,7 @@ ## Example -Do check out & run [example.ts](Example/example.ts) to see example usage of the library. +Do check out & run [example.ts](https://github.com/adiwajshing/Baileys/blob/master/Example/example.ts) to see example usage of the library. The script covers most common use cases. To run the example script, download or clone the repo and then type the following in terminal: 1. ``` cd path/to/Baileys ``` @@ -124,6 +124,8 @@ type SocketConfig = { fetchAgent?: Agent /** should the QR be printed in the terminal */ printQRInTerminal: boolean + /** fires a conversationTimestamp & read count update on CIPHERTEXT messages */ + treatCiphertextMessagesAsReal: boolean /** * fetch a message from your store * implement this so that messages failed to send (solves the "this message can take a while" issue) can be retried @@ -187,7 +189,7 @@ The events are typed up in a type map, as mentioned here: export type BaileysEventMap = { /** connection state has been updated -- WS closed, opened, connecting etc. */ - 'connection.update': Partial + 'connection.update': Partial /** auth credentials updated -- some pre key state, device ID etc. */ 'creds.update': Partial /** set chats (history sync), chats are reverse chronologically sorted */ @@ -316,6 +318,10 @@ import { MessageType, MessageOptions, Mimetype } from '@adiwajshing/baileys' const id = 'abcd@s.whatsapp.net' // the WhatsApp ID // send a simple text! const sentMsg = await sock.sendMessage(id, { text: 'oh hello there' }) +// send a reply messagge +const sentMsg = await sock.sendMessage(id, { text: 'oh hello there' }, { quoted: message }) +// send a mentions message +const sentMsg = await sock.sendMessage(id, { text: '@12345678901', mentions: ['12345678901@s.whatsapp.net'] }) // send a location! const sentMsg = await sock.sendMessage( id, @@ -396,6 +402,15 @@ const listMessage = { } const sendMsg = await sock.sendMessage(id, listMessage) + +const reactionMessage = { + react: { + text: "💖", + key: message.key + } +} + +const sendMsg = await sock.sendMessage(id, reactionMessage) ``` ### Media Messages @@ -459,7 +474,7 @@ const templateButtons = [ const buttonMessage = { text: "Hi it's a template message", footer: 'Hello World', - templateButtons: templateButttons, + templateButtons: templateButtons, image: {url: 'https://example.com/image.jpeg'} } @@ -480,14 +495,14 @@ const sendMsg = await sock.sendMessage(id, templateMessage) contextInfo: { forwardingScore: 2, isForwarded: true }, // some random context info (can show a forwarded message with this too) timestamp: Date(), // optional, if you want to manually set the timestamp of the message caption: "hello there!", // (for media messages) the caption to send with the media (cannot be sent with stickers though) - thumbnail: "23GD#4/==", /* (for location & media messages) has to be a base 64 encoded JPEG if you want to send a custom thumb, + jpegThumbnail: "23GD#4/==", /* (for location & media messages) has to be a base 64 encoded JPEG if you want to send a custom thumb, or set to null if you don't want to send a thumbnail. Do not enter this field if you want to automatically generate a thumb */ mimetype: Mimetype.pdf, /* (for media messages) specify the type of media (optional for all media types except documents), import {Mimetype} from '@adiwajshing/baileys' */ - filename: 'somefile.pdf', // (for media messages) file name for the media + fileName: 'somefile.pdf', // (for media messages) file name for the media /* will send audio messages as voice notes, if set to true */ ptt: true, // will detect links & generate a link preview automatically (default true) @@ -506,16 +521,19 @@ await sock.sendMessage('1234@s.whatsapp.net', { forward: msg }) // WA forward th ## Reading Messages -A set of message IDs must be explicitly marked read now. -Cannot mark an entire "chat" read as it were with Baileys Web. +A set of message keys must be explicitly marked read now. +In multi-device, you cannot mark an entire "chat" read as it were with Baileys Web. This does mean you have to keep track of unread messages. -``` ts -const id = '1234-123@g.us' -const messageID = 'AHASHH123123AHGA' // id of the message you want to read -const participant = '912121232@s.whatsapp.net' // the ID of the user that sent the message (undefined for individual chats) - -await sock.sendReadReceipt(id, participant, [messageID]) +``` ts +const key = { + remoteJid: '1234-123@g.us', + id: 'AHASHH123123AHGA', // id of the message you want to read + participant: '912121232@s.whatsapp.net' // the ID of the user that sent the message (undefined for individual chats) +} +// pass to readMessages function +// can pass multiple keys to read multiple messages as well +await sock.readMessages([key]) ``` The message ID is the unique identifier of the message that you are marking as read. On a `WAMessage`, the `messageID` can be accessed using ```messageID = message.key.id```. @@ -701,6 +719,8 @@ Of course, replace ``` xyz ``` with an actual ID. ``` ts // only allow admins to send messages await sock.groupSettingUpdate("abcd-xyz@g.us", 'announcement') + // allow everyone to send messages + await sock.groupSettingUpdate("abcd-xyz@g.us", 'not_announcement') // allow everyone to modify the group's settings -- like display picture etc. await sock.groupSettingUpdate("abcd-xyz@g.us", 'unlocked') // only allow admins to modify the group's settings @@ -732,6 +752,13 @@ Of course, replace ``` xyz ``` with an actual ID. ``` Of course, replace ``` xxx ``` with invitation code. + +- To join the group using groupInviteMessage + ``` ts + const response = await sock.groupAcceptInviteV4(groupInviteMessage) + console.log("joined to: " + response) + ``` + Of course, replace ``` xxx ``` with invitation code. ## Broadcast Lists & Stories **Note:** messages cannot be sent to broadcast lists from the MD version right now diff --git a/node_modules/@adiwajshing/baileys/WAProto/WAProto.proto b/node_modules/@adiwajshing/baileys/WAProto/WAProto.proto index 652d4a307..86c3b617e 100644 --- a/node_modules/@adiwajshing/baileys/WAProto/WAProto.proto +++ b/node_modules/@adiwajshing/baileys/WAProto/WAProto.proto @@ -1,6 +1,36 @@ syntax = "proto2"; package proto; +message ADVDeviceIdentity { + optional uint32 rawId = 1; + optional uint64 timestamp = 2; + optional uint32 keyIndex = 3; +} + +message ADVKeyIndexList { + optional uint32 rawId = 1; + optional uint64 timestamp = 2; + optional uint32 currentIndex = 3; + repeated uint32 validIndexes = 4 [packed=true]; +} + +message ADVSignedDeviceIdentity { + optional bytes details = 1; + optional bytes accountSignatureKey = 2; + optional bytes accountSignature = 3; + optional bytes deviceSignature = 4; +} + +message ADVSignedDeviceIdentityHMAC { + optional bytes details = 1; + optional bytes hmac = 2; +} + +message ADVSignedKeyIndexList { + optional bytes details = 1; + optional bytes accountSignature = 2; +} + message AppVersion { optional uint32 primary = 1; optional uint32 secondary = 2; @@ -9,910 +39,852 @@ message AppVersion { optional uint32 quinary = 5; } -message UserAgent { - enum UserAgentPlatform { - ANDROID = 0; - IOS = 1; - WINDOWS_PHONE = 2; - BLACKBERRY = 3; - BLACKBERRYX = 4; - S40 = 5; - S60 = 6; - PYTHON_CLIENT = 7; - TIZEN = 8; - ENTERPRISE = 9; - SMB_ANDROID = 10; - KAIOS = 11; - SMB_IOS = 12; - WINDOWS = 13; - WEB = 14; - PORTAL = 15; - GREEN_ANDROID = 16; - GREEN_IPHONE = 17; - BLUE_ANDROID = 18; - BLUE_IPHONE = 19; - FBLITE_ANDROID = 20; - MLITE_ANDROID = 21; - IGLITE_ANDROID = 22; - PAGE = 23; - MACOS = 24; - OCULUS_MSG = 25; - OCULUS_CALL = 26; - MILAN = 27; - CAPI = 28; - } - optional UserAgentPlatform platform = 1; - optional AppVersion appVersion = 2; - optional string mcc = 3; - optional string mnc = 4; - optional string osVersion = 5; - optional string manufacturer = 6; - optional string device = 7; - optional string osBuildNumber = 8; - optional string phoneId = 9; - enum UserAgentReleaseChannel { - RELEASE = 0; - BETA = 1; - ALPHA = 2; - DEBUG = 3; +message CompanionProps { + optional string os = 1; + optional AppVersion version = 2; + enum CompanionPropsPlatformType { + UNKNOWN = 0; + CHROME = 1; + FIREFOX = 2; + IE = 3; + OPERA = 4; + SAFARI = 5; + EDGE = 6; + DESKTOP = 7; + IPAD = 8; + ANDROID_TABLET = 9; + OHANA = 10; + ALOHA = 11; + CATALINA = 12; } - optional UserAgentReleaseChannel releaseChannel = 10; - optional string localeLanguageIso6391 = 11; - optional string localeCountryIso31661Alpha2 = 12; - optional string deviceBoard = 13; -} - -message WebdPayload { - optional bool usesParticipantInKey = 1; - optional bool supportsStarredMessages = 2; - optional bool supportsDocumentMessages = 3; - optional bool supportsUrlMessages = 4; - optional bool supportsMediaRetry = 5; - optional bool supportsE2EImage = 6; - optional bool supportsE2EVideo = 7; - optional bool supportsE2EAudio = 8; - optional bool supportsE2EDocument = 9; - optional string documentTypes = 10; - optional bytes features = 11; + optional CompanionPropsPlatformType platformType = 3; + optional bool requireFullSync = 4; } -message WebInfo { - optional string refToken = 1; - optional string version = 2; - optional WebdPayload webdPayload = 3; - enum WebInfoWebSubPlatform { - WEB_BROWSER = 0; - APP_STORE = 1; - WIN_STORE = 2; - DARWIN = 3; - WIN32 = 4; - } - optional WebInfoWebSubPlatform webSubPlatform = 4; +message ActionLink { + optional string url = 1; + optional string buttonTitle = 2; } -message DNSSource { - enum DNSSourceDNSResolutionMethod { - SYSTEM = 0; - GOOGLE = 1; - HARDCODED = 2; - OVERRIDE = 3; - FALLBACK = 4; +message AdReplyInfo { + optional string advertiserName = 1; + enum AdReplyInfoMediaType { + NONE = 0; + IMAGE = 1; + VIDEO = 2; } - optional DNSSourceDNSResolutionMethod dnsMethod = 15; - optional bool appCached = 16; + optional AdReplyInfoMediaType mediaType = 2; + optional bytes jpegThumbnail = 16; + optional string caption = 17; } -message CompanionRegData { - optional bytes eRegid = 1; - optional bytes eKeytype = 2; - optional bytes eIdent = 3; - optional bytes eSkeyId = 4; - optional bytes eSkeyVal = 5; - optional bytes eSkeySig = 6; - optional bytes buildHash = 7; - optional bytes companionProps = 8; +message AppStateFatalExceptionNotification { + repeated string collectionNames = 1; + optional int64 timestamp = 2; } -message ClientPayload { - optional uint64 username = 1; - optional bool passive = 3; - optional UserAgent userAgent = 5; - optional WebInfo webInfo = 6; - optional string pushName = 7; - optional sfixed32 sessionId = 9; - optional bool shortConnect = 10; - enum ClientPayloadConnectType { - CELLULAR_UNKNOWN = 0; - WIFI_UNKNOWN = 1; - CELLULAR_EDGE = 100; - CELLULAR_IDEN = 101; - CELLULAR_UMTS = 102; - CELLULAR_EVDO = 103; - CELLULAR_GPRS = 104; - CELLULAR_HSDPA = 105; - CELLULAR_HSUPA = 106; - CELLULAR_HSPA = 107; - CELLULAR_CDMA = 108; - CELLULAR_1XRTT = 109; - CELLULAR_EHRPD = 110; - CELLULAR_LTE = 111; - CELLULAR_HSPAP = 112; - } - optional ClientPayloadConnectType connectType = 12; - enum ClientPayloadConnectReason { - PUSH = 0; - USER_ACTIVATED = 1; - SCHEDULED = 2; - ERROR_RECONNECT = 3; - NETWORK_SWITCH = 4; - PING_RECONNECT = 5; - } - optional ClientPayloadConnectReason connectReason = 13; - repeated int32 shards = 14; - optional DNSSource dnsSource = 15; - optional uint32 connectAttemptCount = 16; - optional uint32 device = 18; - optional CompanionRegData regData = 19; - enum ClientPayloadProduct { - WHATSAPP = 0; - MESSENGER = 1; - } - optional ClientPayloadProduct product = 20; - optional bytes fbCat = 21; - optional bytes fbUserAgent = 22; - optional bool oc = 23; - optional int32 lc = 24; - enum ClientPayloadIOSAppExtension { - SHARE_EXTENSION = 0; - SERVICE_EXTENSION = 1; - INTENTS_EXTENSION = 2; - } - optional ClientPayloadIOSAppExtension iosAppExtension = 30; - optional uint64 fbAppId = 31; - optional bytes fbDeviceId = 32; +message AppStateSyncKey { + optional AppStateSyncKeyId keyId = 1; + optional AppStateSyncKeyData keyData = 2; } -// Renamed from Details -message NoiseCertificateDetails { - optional uint32 serial = 1; - optional string issuer = 2; - optional uint64 expires = 3; - optional string subject = 4; - optional bytes key = 5; +message AppStateSyncKeyData { + optional bytes keyData = 1; + optional AppStateSyncKeyFingerprint fingerprint = 2; + optional int64 timestamp = 3; } -message NoiseCertificate { - optional bytes details = 1; - optional bytes signature = 2; +message AppStateSyncKeyFingerprint { + optional uint32 rawId = 1; + optional uint32 currentIndex = 2; + repeated uint32 deviceIndexes = 3 [packed=true]; } -message ClientHello { - optional bytes ephemeral = 1; - optional bytes static = 2; - optional bytes payload = 3; +message AppStateSyncKeyId { + optional bytes keyId = 1; } -message ServerHello { - optional bytes ephemeral = 1; - optional bytes static = 2; - optional bytes payload = 3; +message AppStateSyncKeyRequest { + repeated AppStateSyncKeyId keyIds = 1; } -message ClientFinish { - optional bytes static = 1; - optional bytes payload = 2; +message AppStateSyncKeyShare { + repeated AppStateSyncKey keys = 1; } -message HandshakeMessage { - optional ClientHello clientHello = 2; - optional ServerHello serverHello = 3; - optional ClientFinish clientFinish = 4; +message AudioMessage { + optional string url = 1; + optional string mimetype = 2; + optional bytes fileSha256 = 3; + optional uint64 fileLength = 4; + optional uint32 seconds = 5; + optional bool ptt = 6; + optional bytes mediaKey = 7; + optional bytes fileEncSha256 = 8; + optional string directPath = 9; + optional int64 mediaKeyTimestamp = 10; + optional ContextInfo contextInfo = 17; + optional bytes streamingSidecar = 18; + optional bytes waveform = 19; } -message BizIdentityInfo { - enum BizIdentityInfoVerifiedLevelValue { +message Button { + optional string buttonId = 1; + optional ButtonText buttonText = 2; + enum ButtonType { UNKNOWN = 0; - LOW = 1; - HIGH = 2; - } - optional BizIdentityInfoVerifiedLevelValue vlevel = 1; - optional VerifiedNameCertificate vnameCert = 2; - optional bool signed = 3; - optional bool revoked = 4; - enum BizIdentityInfoHostStorageType { - ON_PREMISE = 0; - FACEBOOK = 1; - } - optional BizIdentityInfoHostStorageType hostStorage = 5; - enum BizIdentityInfoActualActorsType { - SELF = 0; - BSP = 1; + RESPONSE = 1; + NATIVE_FLOW = 2; } - optional BizIdentityInfoActualActorsType actualActors = 6; - optional uint64 privacyModeTs = 7; - optional uint64 featureControls = 8; + optional ButtonType type = 3; + optional NativeFlowInfo nativeFlowInfo = 4; } -message BizAccountLinkInfo { - optional uint64 whatsappBizAcctFbid = 1; - optional string whatsappAcctNumber = 2; - optional uint64 issueTime = 3; - enum BizAccountLinkInfoHostStorageType { - ON_PREMISE = 0; - FACEBOOK = 1; +message ButtonsMessage { + optional string contentText = 6; + optional string footerText = 7; + optional ContextInfo contextInfo = 8; + repeated Button buttons = 9; + enum ButtonsMessageHeaderType { + UNKNOWN = 0; + EMPTY = 1; + TEXT = 2; + DOCUMENT = 3; + IMAGE = 4; + VIDEO = 5; + LOCATION = 6; } - optional BizAccountLinkInfoHostStorageType hostStorage = 4; - enum BizAccountLinkInfoAccountType { - ENTERPRISE = 0; + optional ButtonsMessageHeaderType headerType = 10; + oneof header { + string text = 1; + DocumentMessage documentMessage = 2; + ImageMessage imageMessage = 3; + VideoMessage videoMessage = 4; + LocationMessage locationMessage = 5; } - optional BizAccountLinkInfoAccountType accountType = 5; -} - -message BizAccountPayload { - optional VerifiedNameCertificate vnameCert = 1; - optional bytes bizAcctLinkInfo = 2; -} - -// Renamed from Details -message VerifiedNameDetails { - optional uint64 serial = 1; - optional string issuer = 2; - optional string verifiedName = 4; - repeated LocalizedName localizedNames = 8; - optional uint64 issueTime = 10; } -message VerifiedNameCertificate { - optional bytes details = 1; - optional bytes signature = 2; - optional bytes serverSignature = 3; +message ButtonsResponseMessage { + optional string selectedButtonId = 1; + optional ContextInfo contextInfo = 3; + enum ButtonsResponseMessageType { + UNKNOWN = 0; + DISPLAY_TEXT = 1; + } + optional ButtonsResponseMessageType type = 4; + oneof response { + string selectedDisplayText = 2; + } } -message LocalizedName { - optional string lg = 1; - optional string lc = 2; - optional string verifiedName = 3; +message ButtonText { + optional string displayText = 1; } -message SyncActionData { - optional bytes index = 1; - optional SyncActionValue value = 2; - optional bytes padding = 3; - optional int32 version = 4; +message Call { + optional bytes callKey = 1; + optional string conversionSource = 2; + optional bytes conversionData = 3; + optional uint32 conversionDelaySeconds = 4; } -message StarAction { - optional bool starred = 1; +message CallButton { + optional HighlyStructuredMessage displayText = 1; + optional HighlyStructuredMessage phoneNumber = 2; } -message ContactAction { - optional string fullName = 1; - optional string firstName = 2; +message CancelPaymentRequestMessage { + optional MessageKey key = 1; } -message MuteAction { - optional bool muted = 1; - optional int64 muteEndTimestamp = 2; +message CatalogSnapshot { + optional ImageMessage catalogImage = 1; + optional string title = 2; + optional string description = 3; } -message PinAction { - optional bool pinned = 1; +message Chat { + optional string displayName = 1; + optional string id = 2; } -message SecurityNotificationSetting { - optional bool showNotification = 1; +message CollectionMessage { + optional string bizJid = 1; + optional string id = 2; + optional int32 messageVersion = 3; } -message PushNameSetting { - optional string name = 1; +message ContactMessage { + optional string displayName = 1; + optional string vcard = 16; + optional ContextInfo contextInfo = 17; } -message LocaleSetting { - optional string locale = 1; +message ContactsArrayMessage { + optional string displayName = 1; + repeated ContactMessage contacts = 2; + optional ContextInfo contextInfo = 17; } -message QuickReplyAction { - optional string shortcut = 1; - optional string message = 2; - repeated string keywords = 3; - optional int32 count = 4; - optional bool deleted = 5; +message ContextInfo { + optional string stanzaId = 1; + optional string participant = 2; + optional Message quotedMessage = 3; + optional string remoteJid = 4; + repeated string mentionedJid = 15; + optional string conversionSource = 18; + optional bytes conversionData = 19; + optional uint32 conversionDelaySeconds = 20; + optional uint32 forwardingScore = 21; + optional bool isForwarded = 22; + optional AdReplyInfo quotedAd = 23; + optional MessageKey placeholderKey = 24; + optional uint32 expiration = 25; + optional int64 ephemeralSettingTimestamp = 26; + optional bytes ephemeralSharedSecret = 27; + optional ExternalAdReplyInfo externalAdReply = 28; + optional string entryPointConversionSource = 29; + optional string entryPointConversionApp = 30; + optional uint32 entryPointConversionDelaySeconds = 31; + optional DisappearingMode disappearingMode = 32; + optional ActionLink actionLink = 33; + optional string groupSubject = 34; + optional string parentGroupJid = 35; } -message LabelAssociationAction { - optional bool labeled = 1; +message DeclinePaymentRequestMessage { + optional MessageKey key = 1; } -message LabelEditAction { - optional string name = 1; - optional int32 color = 2; - optional int32 predefinedId = 3; - optional bool deleted = 4; +message DeviceListMetadata { + optional bytes senderKeyHash = 1; + optional uint64 senderTimestamp = 2; + repeated uint32 senderKeyIndexes = 3 [packed=true]; + optional bytes recipientKeyHash = 8; + optional uint64 recipientTimestamp = 9; + repeated uint32 recipientKeyIndexes = 10 [packed=true]; } -message RecentStickerWeightsAction { - repeated RecentStickerWeight weights = 1; +message DeviceSentMessage { + optional string destinationJid = 1; + optional Message message = 2; + optional string phash = 3; } -message RecentStickerMetadata { - optional string directPath = 1; - optional string encFilehash = 2; - optional string mediaKey = 3; - optional string stanzaId = 4; - optional string chatJid = 5; - optional string participant = 6; - optional bool isSentByMe = 7; +message DisappearingMode { + enum DisappearingModeInitiator { + CHANGED_IN_CHAT = 0; + INITIATED_BY_ME = 1; + INITIATED_BY_OTHER = 2; + } + optional DisappearingModeInitiator initiator = 1; } -message RecentEmojiWeightsAction { - repeated RecentEmojiWeight weights = 1; +message DocumentMessage { + optional string url = 1; + optional string mimetype = 2; + optional string title = 3; + optional bytes fileSha256 = 4; + optional uint64 fileLength = 5; + optional uint32 pageCount = 6; + optional bytes mediaKey = 7; + optional string fileName = 8; + optional bytes fileEncSha256 = 9; + optional string directPath = 10; + optional int64 mediaKeyTimestamp = 11; + optional bool contactVcard = 12; + optional string thumbnailDirectPath = 13; + optional bytes thumbnailSha256 = 14; + optional bytes thumbnailEncSha256 = 15; + optional bytes jpegThumbnail = 16; + optional ContextInfo contextInfo = 17; + optional uint32 thumbnailHeight = 18; + optional uint32 thumbnailWidth = 19; } -message FavoriteStickerAction { - optional string directPath = 1; - optional string lastUploadTimestamp = 2; - optional string handle = 3; - optional string encFilehash = 4; - optional string stickerHashWithoutMeta = 5; - optional string mediaKey = 6; - optional int64 mediaKeyTimestamp = 7; - optional bool isFavorite = 8; -} +message ExtendedTextMessage { + optional string text = 1; + optional string matchedText = 2; + optional string canonicalUrl = 4; + optional string description = 5; + optional string title = 6; + optional fixed32 textArgb = 7; + optional fixed32 backgroundArgb = 8; + enum ExtendedTextMessageFontType { + SANS_SERIF = 0; + SERIF = 1; + NORICAN_REGULAR = 2; + BRYNDAN_WRITE = 3; + BEBASNEUE_REGULAR = 4; + OSWALD_HEAVY = 5; + } + optional ExtendedTextMessageFontType font = 9; + enum ExtendedTextMessagePreviewType { + NONE = 0; + VIDEO = 1; + } + optional ExtendedTextMessagePreviewType previewType = 10; + optional bytes jpegThumbnail = 16; + optional ContextInfo contextInfo = 17; + optional bool doNotPlayInline = 18; + optional string thumbnailDirectPath = 19; + optional bytes thumbnailSha256 = 20; + optional bytes thumbnailEncSha256 = 21; + optional bytes mediaKey = 22; + optional int64 mediaKeyTimestamp = 23; + optional uint32 thumbnailHeight = 24; + optional uint32 thumbnailWidth = 25; + enum ExtendedTextMessageInviteLinkGroupType { + DEFAULT = 0; + PARENT = 1; + } + optional ExtendedTextMessageInviteLinkGroupType inviteLinkGroupType = 26; +} -message ArchiveChatAction { - optional bool archived = 1; - optional SyncActionMessageRange messageRange = 2; +message ExternalAdReplyInfo { + optional string title = 1; + optional string body = 2; + enum ExternalAdReplyInfoMediaType { + NONE = 0; + IMAGE = 1; + VIDEO = 2; + } + optional ExternalAdReplyInfoMediaType mediaType = 3; + optional string thumbnailUrl = 4; + optional string mediaUrl = 5; + optional bytes thumbnail = 6; + optional string sourceType = 7; + optional string sourceId = 8; + optional string sourceUrl = 9; + optional bool containsAutoReply = 10; + optional bool renderLargerThumbnail = 11; + optional bool showAdAttribution = 12; } -message DeleteMessageForMeAction { - optional bool deleteMedia = 1; - optional int64 messageTimestamp = 2; +message Footer { + optional string text = 1; } -message MarkChatAsReadAction { - optional bool read = 1; - optional SyncActionMessageRange messageRange = 2; +message FourRowTemplate { + optional HighlyStructuredMessage content = 6; + optional HighlyStructuredMessage footer = 7; + repeated TemplateButton buttons = 8; + oneof title { + DocumentMessage documentMessage = 1; + HighlyStructuredMessage highlyStructuredMessage = 2; + ImageMessage imageMessage = 3; + VideoMessage videoMessage = 4; + LocationMessage locationMessage = 5; + } } -message ClearChatAction { - optional SyncActionMessageRange messageRange = 1; +message FutureProofMessage { + optional Message message = 1; } -message DeleteChatAction { - optional SyncActionMessageRange messageRange = 1; +message GroupInviteMessage { + optional string groupJid = 1; + optional string inviteCode = 2; + optional int64 inviteExpiration = 3; + optional string groupName = 4; + optional bytes jpegThumbnail = 5; + optional string caption = 6; + optional ContextInfo contextInfo = 7; + enum GroupInviteMessageGroupType { + DEFAULT = 0; + PARENT = 1; + } + optional GroupInviteMessageGroupType groupType = 8; } -message UnarchiveChatsSetting { - optional bool unarchiveChats = 1; +message Header { + optional string title = 1; + optional string subtitle = 2; + optional bool hasMediaAttachment = 5; + oneof media { + DocumentMessage documentMessage = 3; + ImageMessage imageMessage = 4; + bytes jpegThumbnail = 6; + VideoMessage videoMessage = 7; + } } -message SyncActionMessageRange { - optional int64 lastMessageTimestamp = 1; - optional int64 lastSystemMessageTimestamp = 2; - repeated SyncActionMessage messages = 3; +message HighlyStructuredMessage { + optional string namespace = 1; + optional string elementName = 2; + repeated string params = 3; + optional string fallbackLg = 4; + optional string fallbackLc = 5; + repeated HSMLocalizableParameter localizableParams = 6; + optional string deterministicLg = 7; + optional string deterministicLc = 8; + optional TemplateMessage hydratedHsm = 9; } -message SyncActionMessage { - optional MessageKey key = 1; - optional int64 timestamp = 2; +message HistorySyncNotification { + optional bytes fileSha256 = 1; + optional uint64 fileLength = 2; + optional bytes mediaKey = 3; + optional bytes fileEncSha256 = 4; + optional string directPath = 5; + enum HistorySyncNotificationHistorySyncType { + INITIAL_BOOTSTRAP = 0; + INITIAL_STATUS_V3 = 1; + FULL = 2; + RECENT = 3; + PUSH_NAME = 4; + } + optional HistorySyncNotificationHistorySyncType syncType = 6; + optional uint32 chunkOrder = 7; + optional string originalMessageId = 8; } -message KeyExpiration { - optional int32 expiredKeyEpoch = 1; +message HSMCurrency { + optional string currencyCode = 1; + optional int64 amount1000 = 2; } -message PrimaryFeature { - repeated string flags = 1; +message HSMDateTime { + oneof datetimeOneof { + HSMDateTimeComponent component = 1; + HSMDateTimeUnixEpoch unixEpoch = 2; + } } -message AndroidUnsupportedActions { - optional bool allowed = 1; +message HSMDateTimeComponent { + enum HSMDateTimeComponentDayOfWeekType { + MONDAY = 1; + TUESDAY = 2; + WEDNESDAY = 3; + THURSDAY = 4; + FRIDAY = 5; + SATURDAY = 6; + SUNDAY = 7; + } + optional HSMDateTimeComponentDayOfWeekType dayOfWeek = 1; + optional uint32 year = 2; + optional uint32 month = 3; + optional uint32 dayOfMonth = 4; + optional uint32 hour = 5; + optional uint32 minute = 6; + enum HSMDateTimeComponentCalendarType { + GREGORIAN = 1; + SOLAR_HIJRI = 2; + } + optional HSMDateTimeComponentCalendarType calendar = 7; } -message SyncActionValue { +message HSMDateTimeUnixEpoch { optional int64 timestamp = 1; - optional StarAction starAction = 2; - optional ContactAction contactAction = 3; - optional MuteAction muteAction = 4; - optional PinAction pinAction = 5; - optional SecurityNotificationSetting securityNotificationSetting = 6; - optional PushNameSetting pushNameSetting = 7; - optional QuickReplyAction quickReplyAction = 8; - optional RecentStickerWeightsAction recentStickerWeightsAction = 9; - optional RecentStickerMetadata recentStickerMetadata = 10; - optional RecentEmojiWeightsAction recentEmojiWeightsAction = 11; - optional LabelEditAction labelEditAction = 14; - optional LabelAssociationAction labelAssociationAction = 15; - optional LocaleSetting localeSetting = 16; - optional ArchiveChatAction archiveChatAction = 17; - optional DeleteMessageForMeAction deleteMessageForMeAction = 18; - optional KeyExpiration keyExpiration = 19; - optional MarkChatAsReadAction markChatAsReadAction = 20; - optional ClearChatAction clearChatAction = 21; - optional DeleteChatAction deleteChatAction = 22; - optional UnarchiveChatsSetting unarchiveChatsSetting = 23; - optional PrimaryFeature primaryFeature = 24; - optional FavoriteStickerAction favoriteStickerAction = 25; - optional AndroidUnsupportedActions androidUnsupportedActions = 26; } -message RecentEmojiWeight { - optional string emoji = 1; - optional float weight = 2; +message HSMLocalizableParameter { + optional string default = 1; + oneof paramOneof { + HSMCurrency currency = 2; + HSMDateTime dateTime = 3; + } } -message RecentStickerWeight { - optional string filehash = 1; - optional float weight = 2; +message HydratedCallButton { + optional string displayText = 1; + optional string phoneNumber = 2; } -message SyncdPatch { - optional SyncdVersion version = 1; - repeated SyncdMutation mutations = 2; - optional ExternalBlobReference externalMutations = 3; - optional bytes snapshotMac = 4; - optional bytes patchMac = 5; - optional KeyId keyId = 6; - optional ExitCode exitCode = 7; - optional uint32 deviceIndex = 8; +message HydratedFourRowTemplate { + optional string hydratedContentText = 6; + optional string hydratedFooterText = 7; + repeated HydratedTemplateButton hydratedButtons = 8; + optional string templateId = 9; + oneof title { + DocumentMessage documentMessage = 1; + string hydratedTitleText = 2; + ImageMessage imageMessage = 3; + VideoMessage videoMessage = 4; + LocationMessage locationMessage = 5; + } } -message SyncdMutation { - enum SyncdMutationSyncdOperation { - SET = 0; - REMOVE = 1; - } - optional SyncdMutationSyncdOperation operation = 1; - optional SyncdRecord record = 2; +message HydratedQuickReplyButton { + optional string displayText = 1; + optional string id = 2; } -message SyncdMutations { - repeated SyncdMutation mutations = 1; +message HydratedTemplateButton { + optional uint32 index = 4; + oneof hydratedButton { + HydratedQuickReplyButton quickReplyButton = 1; + HydratedURLButton urlButton = 2; + HydratedCallButton callButton = 3; + } } -message SyncdSnapshot { - optional SyncdVersion version = 1; - repeated SyncdRecord records = 2; - optional bytes mac = 3; - optional KeyId keyId = 4; +message HydratedURLButton { + optional string displayText = 1; + optional string url = 2; } -message ExternalBlobReference { - optional bytes mediaKey = 1; - optional string directPath = 2; - optional string handle = 3; - optional uint64 fileSizeBytes = 4; - optional bytes fileSha256 = 5; - optional bytes fileEncSha256 = 6; +message ImageMessage { + optional string url = 1; + optional string mimetype = 2; + optional string caption = 3; + optional bytes fileSha256 = 4; + optional uint64 fileLength = 5; + optional uint32 height = 6; + optional uint32 width = 7; + optional bytes mediaKey = 8; + optional bytes fileEncSha256 = 9; + repeated InteractiveAnnotation interactiveAnnotations = 10; + optional string directPath = 11; + optional int64 mediaKeyTimestamp = 12; + optional bytes jpegThumbnail = 16; + optional ContextInfo contextInfo = 17; + optional bytes firstScanSidecar = 18; + optional uint32 firstScanLength = 19; + optional uint32 experimentGroupId = 20; + optional bytes scansSidecar = 21; + repeated uint32 scanLengths = 22; + optional bytes midQualityFileSha256 = 23; + optional bytes midQualityFileEncSha256 = 24; + optional bool viewOnce = 25; + optional string thumbnailDirectPath = 26; + optional bytes thumbnailSha256 = 27; + optional bytes thumbnailEncSha256 = 28; + optional string staticUrl = 29; } -message SyncdRecord { - optional SyncdIndex index = 1; - optional SyncdValue value = 2; - optional KeyId keyId = 3; +message InitialSecurityNotificationSettingSync { + optional bool securityNotificationEnabled = 1; } -message KeyId { - optional bytes id = 1; +message InteractiveAnnotation { + repeated Point polygonVertices = 1; + oneof action { + Location location = 2; + } } -message SyncdValue { - optional bytes blob = 1; +message InteractiveMessage { + optional Header header = 1; + optional InteractiveMessageBody body = 2; + optional Footer footer = 3; + optional ContextInfo contextInfo = 15; + oneof interactiveMessage { + ShopMessage shopStorefrontMessage = 4; + CollectionMessage collectionMessage = 5; + NativeFlowMessage nativeFlowMessage = 6; + } } -message SyncdIndex { - optional bytes blob = 1; +// Renamed from Message$InteractiveMessage$Body +message InteractiveMessageBody { + optional string text = 1; } -message ExitCode { - optional uint64 code = 1; - optional string text = 2; +message InteractiveResponseMessage { + optional InteractiveResponseMessageBody body = 1; + optional ContextInfo contextInfo = 15; + oneof interactiveResponseMessage { + NativeFlowResponseMessage nativeFlowResponseMessage = 2; + } } -message SyncdVersion { - optional uint64 version = 1; +// Renamed from Message$InteractiveResponseMessage$Body +message InteractiveResponseMessageBody { + optional string text = 1; } -message ServerErrorReceipt { - optional string stanzaId = 1; +message InvoiceMessage { + optional string note = 1; + optional string token = 2; + enum InvoiceMessageAttachmentType { + IMAGE = 0; + PDF = 1; + } + optional InvoiceMessageAttachmentType attachmentType = 3; + optional string attachmentMimetype = 4; + optional bytes attachmentMediaKey = 5; + optional int64 attachmentMediaKeyTimestamp = 6; + optional bytes attachmentFileSha256 = 7; + optional bytes attachmentFileEncSha256 = 8; + optional string attachmentDirectPath = 9; + optional bytes attachmentJpegThumbnail = 10; } -message MediaRetryNotification { - optional string stanzaId = 1; - optional string directPath = 2; - enum MediaRetryNotificationResultType { - GENERAL_ERROR = 0; - SUCCESS = 1; - NOT_FOUND = 2; - DECRYPTION_ERROR = 3; +message ListMessage { + optional string title = 1; + optional string description = 2; + optional string buttonText = 3; + enum ListMessageListType { + UNKNOWN = 0; + SINGLE_SELECT = 1; + PRODUCT_LIST = 2; } - optional MediaRetryNotificationResultType result = 3; + optional ListMessageListType listType = 4; + repeated Section sections = 5; + optional ProductListInfo productListInfo = 6; + optional string footerText = 7; + optional ContextInfo contextInfo = 8; } -message MsgOpaqueData { - optional string body = 1; - optional string caption = 3; - optional double lng = 5; - optional double lat = 7; - optional int32 paymentAmount1000 = 8; - optional string paymentNoteMsgBody = 9; - optional string canonicalUrl = 10; - optional string matchedText = 11; - optional string title = 12; - optional string description = 13; - optional bytes futureproofBuffer = 14; - optional string clientUrl = 15; - optional string loc = 16; +message ListResponseMessage { + optional string title = 1; + enum ListResponseMessageListType { + UNKNOWN = 0; + SINGLE_SELECT = 1; + } + optional ListResponseMessageListType listType = 2; + optional SingleSelectReply singleSelectReply = 3; + optional ContextInfo contextInfo = 4; + optional string description = 5; } -message MsgRowOpaqueData { - optional MsgOpaqueData currentMsg = 1; - optional MsgOpaqueData quotedMsg = 2; +message LiveLocationMessage { + optional double degreesLatitude = 1; + optional double degreesLongitude = 2; + optional uint32 accuracyInMeters = 3; + optional float speedInMps = 4; + optional uint32 degreesClockwiseFromMagneticNorth = 5; + optional string caption = 6; + optional int64 sequenceNumber = 7; + optional uint32 timeOffset = 8; + optional bytes jpegThumbnail = 16; + optional ContextInfo contextInfo = 17; } -message GlobalSettings { - optional WallpaperSettings lightThemeWallpaper = 1; - optional MediaVisibility mediaVisibility = 2; - optional WallpaperSettings darkThemeWallpaper = 3; +message Location { + optional double degreesLatitude = 1; + optional double degreesLongitude = 2; + optional string name = 3; } -message WallpaperSettings { - optional string filename = 1; - optional uint32 opacity = 2; +message LocationMessage { + optional double degreesLatitude = 1; + optional double degreesLongitude = 2; + optional string name = 3; + optional string address = 4; + optional string url = 5; + optional bool isLive = 6; + optional uint32 accuracyInMeters = 7; + optional float speedInMps = 8; + optional uint32 degreesClockwiseFromMagneticNorth = 9; + optional string comment = 11; + optional bytes jpegThumbnail = 16; + optional ContextInfo contextInfo = 17; } -message GroupParticipant { - required string userJid = 1; - enum GroupParticipantRank { - REGULAR = 0; - ADMIN = 1; - SUPERADMIN = 2; - } - optional GroupParticipantRank rank = 2; +message Message { + optional string conversation = 1; + optional SenderKeyDistributionMessage senderKeyDistributionMessage = 2; + optional ImageMessage imageMessage = 3; + optional ContactMessage contactMessage = 4; + optional LocationMessage locationMessage = 5; + optional ExtendedTextMessage extendedTextMessage = 6; + optional DocumentMessage documentMessage = 7; + optional AudioMessage audioMessage = 8; + optional VideoMessage videoMessage = 9; + optional Call call = 10; + optional Chat chat = 11; + optional ProtocolMessage protocolMessage = 12; + optional ContactsArrayMessage contactsArrayMessage = 13; + optional HighlyStructuredMessage highlyStructuredMessage = 14; + optional SenderKeyDistributionMessage fastRatchetKeySenderKeyDistributionMessage = 15; + optional SendPaymentMessage sendPaymentMessage = 16; + optional LiveLocationMessage liveLocationMessage = 18; + optional RequestPaymentMessage requestPaymentMessage = 22; + optional DeclinePaymentRequestMessage declinePaymentRequestMessage = 23; + optional CancelPaymentRequestMessage cancelPaymentRequestMessage = 24; + optional TemplateMessage templateMessage = 25; + optional StickerMessage stickerMessage = 26; + optional GroupInviteMessage groupInviteMessage = 28; + optional TemplateButtonReplyMessage templateButtonReplyMessage = 29; + optional ProductMessage productMessage = 30; + optional DeviceSentMessage deviceSentMessage = 31; + optional MessageContextInfo messageContextInfo = 35; + optional ListMessage listMessage = 36; + optional FutureProofMessage viewOnceMessage = 37; + optional OrderMessage orderMessage = 38; + optional ListResponseMessage listResponseMessage = 39; + optional FutureProofMessage ephemeralMessage = 40; + optional InvoiceMessage invoiceMessage = 41; + optional ButtonsMessage buttonsMessage = 42; + optional ButtonsResponseMessage buttonsResponseMessage = 43; + optional PaymentInviteMessage paymentInviteMessage = 44; + optional InteractiveMessage interactiveMessage = 45; + optional ReactionMessage reactionMessage = 46; + optional StickerSyncRMRMessage stickerSyncRmrMessage = 47; + optional InteractiveResponseMessage interactiveResponseMessage = 48; + optional PollCreationMessage pollCreationMessage = 49; + optional PollUpdateMessage pollUpdateMessage = 50; } -message Pushname { - optional string id = 1; - optional string pushname = 2; +message MessageContextInfo { + optional DeviceListMetadata deviceListMetadata = 1; + optional int32 deviceListMetadataVersion = 2; } -message HistorySyncMsg { - optional WebMessageInfo message = 1; - optional uint64 msgOrderId = 2; +message Money { + optional int64 value = 1; + optional uint32 offset = 2; + optional string currencyCode = 3; } -message Conversation { - required string id = 1; - repeated HistorySyncMsg messages = 2; - optional string newJid = 3; - optional string oldJid = 4; - optional uint64 lastMsgTimestamp = 5; - optional uint32 unreadCount = 6; - optional bool readOnly = 7; - optional bool endOfHistoryTransfer = 8; - optional uint32 ephemeralExpiration = 9; - optional int64 ephemeralSettingTimestamp = 10; - enum ConversationEndOfHistoryTransferType { - COMPLETE_BUT_MORE_MESSAGES_REMAIN_ON_PRIMARY = 0; - COMPLETE_AND_NO_MORE_MESSAGE_REMAIN_ON_PRIMARY = 1; - } - optional ConversationEndOfHistoryTransferType endOfHistoryTransferType = 11; - optional uint64 conversationTimestamp = 12; - optional string name = 13; - optional string pHash = 14; - optional bool notSpam = 15; - optional bool archived = 16; - optional DisappearingMode disappearingMode = 17; - optional uint32 unreadMentionCount = 18; - optional bool markedAsUnread = 19; - repeated GroupParticipant participant = 20; - optional bytes tcToken = 21; - optional uint64 tcTokenTimestamp = 22; - optional bytes contactPrimaryIdentityKey = 23; - optional uint32 pinned = 24; - optional uint64 muteEndTime = 25; - optional WallpaperSettings wallpaper = 26; - optional MediaVisibility mediaVisibility = 27; - optional uint64 tcTokenSenderTimestamp = 28; - optional bool suspended = 29; +message NativeFlowButton { + optional string name = 1; + optional string buttonParamsJson = 2; } -message HistorySync { - enum HistorySyncHistorySyncType { - INITIAL_BOOTSTRAP = 0; - INITIAL_STATUS_V3 = 1; - FULL = 2; - RECENT = 3; - PUSH_NAME = 4; - } - required HistorySyncHistorySyncType syncType = 1; - repeated Conversation conversations = 2; - repeated WebMessageInfo statusV3Messages = 3; - optional uint32 chunkOrder = 5; - optional uint32 progress = 6; - repeated Pushname pushnames = 7; - optional GlobalSettings globalSettings = 8; - optional bytes threadIdUserSecret = 9; - optional uint32 threadDsTimeframeOffset = 10; +message NativeFlowInfo { + optional string name = 1; + optional string paramsJson = 2; } -enum MediaVisibility { - DEFAULT = 0; - OFF = 1; - ON = 2; -} -message EphemeralSetting { - optional sfixed32 duration = 1; - optional sfixed64 timestamp = 2; +message NativeFlowMessage { + repeated NativeFlowButton buttons = 1; + optional string messageParamsJson = 2; + optional int32 messageVersion = 3; } -message InteractiveAnnotation { - repeated Point polygonVertices = 1; - oneof action { - Location location = 2; - } +message NativeFlowResponseMessage { + optional string name = 1; + optional string paramsJson = 2; + optional int32 version = 3; } -message DeviceListMetadata { - optional bytes senderKeyHash = 1; - optional uint64 senderTimestamp = 2; - repeated uint32 senderKeyIndexes = 3 [packed=true]; - optional bytes recipientKeyHash = 8; - optional uint64 recipientTimestamp = 9; - repeated uint32 recipientKeyIndexes = 10 [packed=true]; +message Option { + optional string optionName = 1; } -message MessageContextInfo { - optional DeviceListMetadata deviceListMetadata = 1; - optional int32 deviceListMetadataVersion = 2; +message OrderMessage { + optional string orderId = 1; + optional bytes thumbnail = 2; + optional int32 itemCount = 3; + enum OrderMessageOrderStatus { + INQUIRY = 1; + } + optional OrderMessageOrderStatus status = 4; + enum OrderMessageOrderSurface { + CATALOG = 1; + } + optional OrderMessageOrderSurface surface = 5; + optional string message = 6; + optional string orderTitle = 7; + optional string sellerJid = 8; + optional string token = 9; + optional int64 totalAmount1000 = 10; + optional string totalCurrencyCode = 11; + optional ContextInfo contextInfo = 17; } -message AdReplyInfo { - optional string advertiserName = 1; - enum AdReplyInfoMediaType { - NONE = 0; - IMAGE = 1; - VIDEO = 2; +message PaymentBackground { + optional string id = 1; + optional uint64 fileLength = 2; + optional uint32 width = 3; + optional uint32 height = 4; + optional string mimetype = 5; + optional fixed32 placeholderArgb = 6; + optional fixed32 textArgb = 7; + optional fixed32 subtextArgb = 8; + optional PBMediaData mediaData = 9; + enum PaymentBackgroundType { + UNKNOWN = 0; + DEFAULT = 1; } - optional AdReplyInfoMediaType mediaType = 2; - optional bytes jpegThumbnail = 16; - optional string caption = 17; + optional PaymentBackgroundType type = 10; } -message ExternalAdReplyInfo { - optional string title = 1; - optional string body = 2; - enum ExternalAdReplyInfoMediaType { - NONE = 0; - IMAGE = 1; - VIDEO = 2; +message PaymentInviteMessage { + enum PaymentInviteMessageServiceType { + UNKNOWN = 0; + FBPAY = 1; + NOVI = 2; + UPI = 3; } - optional ExternalAdReplyInfoMediaType mediaType = 3; - optional string thumbnailUrl = 4; - optional string mediaUrl = 5; - optional bytes thumbnail = 6; - optional string sourceType = 7; - optional string sourceId = 8; - optional string sourceUrl = 9; - optional bool containsAutoReply = 10; + optional PaymentInviteMessageServiceType serviceType = 1; + optional int64 expiryTimestamp = 2; } -message ContextInfo { - optional string stanzaId = 1; - optional string participant = 2; - optional Message quotedMessage = 3; - optional string remoteJid = 4; - repeated string mentionedJid = 15; - optional string conversionSource = 18; - optional bytes conversionData = 19; - optional uint32 conversionDelaySeconds = 20; - optional uint32 forwardingScore = 21; - optional bool isForwarded = 22; - optional AdReplyInfo quotedAd = 23; - optional MessageKey placeholderKey = 24; - optional uint32 expiration = 25; - optional int64 ephemeralSettingTimestamp = 26; - optional bytes ephemeralSharedSecret = 27; - optional ExternalAdReplyInfo externalAdReply = 28; - optional string entryPointConversionSource = 29; - optional string entryPointConversionApp = 30; - optional uint32 entryPointConversionDelaySeconds = 31; - optional DisappearingMode disappearingMode = 32; - optional ActionLink actionLink = 33; - optional string groupSubject = 34; - optional string parentGroupJid = 35; +// Renamed from PaymentBackground$MediaData +message PBMediaData { + optional bytes mediaKey = 1; + optional int64 mediaKeyTimestamp = 2; + optional bytes fileSha256 = 3; + optional bytes fileEncSha256 = 4; + optional string directPath = 5; } -message SenderKeyDistributionMessage { - optional string groupId = 1; - optional bytes axolotlSenderKeyDistributionMessage = 2; +message Point { + optional int32 xDeprecated = 1; + optional int32 yDeprecated = 2; + optional double x = 3; + optional double y = 4; } -message ImageMessage { - optional string url = 1; - optional string mimetype = 2; - optional string caption = 3; - optional bytes fileSha256 = 4; - optional uint64 fileLength = 5; - optional uint32 height = 6; - optional uint32 width = 7; - optional bytes mediaKey = 8; - optional bytes fileEncSha256 = 9; - repeated InteractiveAnnotation interactiveAnnotations = 10; - optional string directPath = 11; - optional int64 mediaKeyTimestamp = 12; - optional bytes jpegThumbnail = 16; - optional ContextInfo contextInfo = 17; - optional bytes firstScanSidecar = 18; - optional uint32 firstScanLength = 19; - optional uint32 experimentGroupId = 20; - optional bytes scansSidecar = 21; - repeated uint32 scanLengths = 22; - optional bytes midQualityFileSha256 = 23; - optional bytes midQualityFileEncSha256 = 24; - optional bool viewOnce = 25; - optional string thumbnailDirectPath = 26; - optional bytes thumbnailSha256 = 27; - optional bytes thumbnailEncSha256 = 28; - optional string staticUrl = 29; +message PollCreationMessage { + optional bytes encKey = 1; + optional string name = 2; + repeated Option options = 3; + optional uint32 selectableOptionsCount = 4; } -message InvoiceMessage { - optional string note = 1; - optional string token = 2; - enum InvoiceMessageAttachmentType { - IMAGE = 0; - PDF = 1; +message PollUpdateMessage { + optional MessageKey pollCreationMessageKey = 1; + optional bytes encPayload = 2; + optional bytes encIv = 3; +} + +message PollUpdateMessageContent { + oneof update { + PollVoteMessage voteMessage = 1; } - optional InvoiceMessageAttachmentType attachmentType = 3; - optional string attachmentMimetype = 4; - optional bytes attachmentMediaKey = 5; - optional int64 attachmentMediaKeyTimestamp = 6; - optional bytes attachmentFileSha256 = 7; - optional bytes attachmentFileEncSha256 = 8; - optional string attachmentDirectPath = 9; - optional bytes attachmentJpegThumbnail = 10; } -message ContactMessage { - optional string displayName = 1; - optional string vcard = 16; - optional ContextInfo contextInfo = 17; +message PollVoteMessage { + repeated bytes selectedOptions = 1; + optional int64 senderTimestampMs = 2; } -message LocationMessage { - optional double degreesLatitude = 1; - optional double degreesLongitude = 2; - optional string name = 3; - optional string address = 4; - optional string url = 5; - optional bool isLive = 6; - optional uint32 accuracyInMeters = 7; - optional float speedInMps = 8; - optional uint32 degreesClockwiseFromMagneticNorth = 9; - optional string comment = 11; - optional bytes jpegThumbnail = 16; +message Product { + optional string productId = 1; +} + +message ProductListHeaderImage { + optional string productId = 1; + optional bytes jpegThumbnail = 2; +} + +message ProductListInfo { + repeated ProductSection productSections = 1; + optional ProductListHeaderImage headerImage = 2; + optional string businessOwnerJid = 3; +} + +message ProductMessage { + optional ProductSnapshot product = 1; + optional string businessOwnerJid = 2; + optional CatalogSnapshot catalog = 4; + optional string body = 5; + optional string footer = 6; optional ContextInfo contextInfo = 17; } -message ExtendedTextMessage { - optional string text = 1; - optional string matchedText = 2; - optional string canonicalUrl = 4; - optional string description = 5; - optional string title = 6; - optional fixed32 textArgb = 7; - optional fixed32 backgroundArgb = 8; - enum ExtendedTextMessageFontType { - SANS_SERIF = 0; - SERIF = 1; - NORICAN_REGULAR = 2; - BRYNDAN_WRITE = 3; - BEBASNEUE_REGULAR = 4; - OSWALD_HEAVY = 5; - } - optional ExtendedTextMessageFontType font = 9; - enum ExtendedTextMessagePreviewType { - NONE = 0; - VIDEO = 1; - } - optional ExtendedTextMessagePreviewType previewType = 10; - optional bytes jpegThumbnail = 16; - optional ContextInfo contextInfo = 17; - optional bool doNotPlayInline = 18; - optional string thumbnailDirectPath = 19; - optional bytes thumbnailSha256 = 20; - optional bytes thumbnailEncSha256 = 21; - optional bytes mediaKey = 22; - optional int64 mediaKeyTimestamp = 23; - optional uint32 thumbnailHeight = 24; - optional uint32 thumbnailWidth = 25; - enum ExtendedTextMessageInviteLinkGroupType { - DEFAULT = 0; - PARENT = 1; - } - optional ExtendedTextMessageInviteLinkGroupType inviteLinkGroupType = 26; +message ProductSection { + optional string title = 1; + repeated Product products = 2; } -message DocumentMessage { - optional string url = 1; - optional string mimetype = 2; +message ProductSnapshot { + optional ImageMessage productImage = 1; + optional string productId = 2; optional string title = 3; - optional bytes fileSha256 = 4; - optional uint64 fileLength = 5; - optional uint32 pageCount = 6; - optional bytes mediaKey = 7; - optional string fileName = 8; - optional bytes fileEncSha256 = 9; - optional string directPath = 10; - optional int64 mediaKeyTimestamp = 11; - optional bool contactVcard = 12; - optional string thumbnailDirectPath = 13; - optional bytes thumbnailSha256 = 14; - optional bytes thumbnailEncSha256 = 15; - optional bytes jpegThumbnail = 16; - optional ContextInfo contextInfo = 17; - optional uint32 thumbnailHeight = 18; - optional uint32 thumbnailWidth = 19; -} - -message AudioMessage { - optional string url = 1; - optional string mimetype = 2; - optional bytes fileSha256 = 3; - optional uint64 fileLength = 4; - optional uint32 seconds = 5; - optional bool ptt = 6; - optional bytes mediaKey = 7; - optional bytes fileEncSha256 = 8; - optional string directPath = 9; - optional int64 mediaKeyTimestamp = 10; - optional ContextInfo contextInfo = 17; - optional bytes streamingSidecar = 18; - optional bytes waveform = 19; -} - -message VideoMessage { - optional string url = 1; - optional string mimetype = 2; - optional bytes fileSha256 = 3; - optional uint64 fileLength = 4; - optional uint32 seconds = 5; - optional bytes mediaKey = 6; - optional string caption = 7; - optional bool gifPlayback = 8; - optional uint32 height = 9; - optional uint32 width = 10; - optional bytes fileEncSha256 = 11; - repeated InteractiveAnnotation interactiveAnnotations = 12; - optional string directPath = 13; - optional int64 mediaKeyTimestamp = 14; - optional bytes jpegThumbnail = 16; - optional ContextInfo contextInfo = 17; - optional bytes streamingSidecar = 18; - enum VideoMessageAttribution { - NONE = 0; - GIPHY = 1; - TENOR = 2; - } - optional VideoMessageAttribution gifAttribution = 19; - optional bool viewOnce = 20; - optional string thumbnailDirectPath = 21; - optional bytes thumbnailSha256 = 22; - optional bytes thumbnailEncSha256 = 23; - optional string staticUrl = 24; -} - -message Call { - optional bytes callKey = 1; - optional string conversionSource = 2; - optional bytes conversionData = 3; - optional uint32 conversionDelaySeconds = 4; -} - -message Chat { - optional string displayName = 1; - optional string id = 2; + optional string description = 4; + optional string currencyCode = 5; + optional int64 priceAmount1000 = 6; + optional string retailerId = 7; + optional string url = 8; + optional uint32 productImageCount = 9; + optional string firstImageId = 11; + optional int64 salePriceAmount1000 = 12; } message ProtocolMessage { @@ -939,721 +911,915 @@ message ProtocolMessage { optional DisappearingMode disappearingMode = 11; } -message HistorySyncNotification { - optional bytes fileSha256 = 1; - optional uint64 fileLength = 2; - optional bytes mediaKey = 3; - optional bytes fileEncSha256 = 4; - optional string directPath = 5; - enum HistorySyncNotificationHistorySyncType { - INITIAL_BOOTSTRAP = 0; - INITIAL_STATUS_V3 = 1; - FULL = 2; - RECENT = 3; - PUSH_NAME = 4; - } - optional HistorySyncNotificationHistorySyncType syncType = 6; - optional uint32 chunkOrder = 7; - optional string originalMessageId = 8; +message QuickReplyButton { + optional HighlyStructuredMessage displayText = 1; + optional string id = 2; } -message AppStateSyncKey { - optional AppStateSyncKeyId keyId = 1; - optional AppStateSyncKeyData keyData = 2; +message ReactionMessage { + optional MessageKey key = 1; + optional string text = 2; + optional string groupingKey = 3; + optional int64 senderTimestampMs = 4; } -message AppStateSyncKeyId { - optional bytes keyId = 1; +message RequestPaymentMessage { + optional Message noteMessage = 4; + optional string currencyCodeIso4217 = 1; + optional uint64 amount1000 = 2; + optional string requestFrom = 3; + optional int64 expiryTimestamp = 5; + optional Money amount = 6; + optional PaymentBackground background = 7; } -message AppStateSyncKeyFingerprint { - optional uint32 rawId = 1; - optional uint32 currentIndex = 2; - repeated uint32 deviceIndexes = 3 [packed=true]; +message Row { + optional string title = 1; + optional string description = 2; + optional string rowId = 3; } -message AppStateSyncKeyData { - optional bytes keyData = 1; - optional AppStateSyncKeyFingerprint fingerprint = 2; - optional int64 timestamp = 3; +message Section { + optional string title = 1; + repeated Row rows = 2; } -message AppStateSyncKeyShare { - repeated AppStateSyncKey keys = 1; +message SenderKeyDistributionMessage { + optional string groupId = 1; + optional bytes axolotlSenderKeyDistributionMessage = 2; } -message AppStateSyncKeyRequest { - repeated AppStateSyncKeyId keyIds = 1; +message SendPaymentMessage { + optional Message noteMessage = 2; + optional MessageKey requestMessageKey = 3; + optional PaymentBackground background = 4; } -message AppStateFatalExceptionNotification { - repeated string collectionNames = 1; - optional int64 timestamp = 2; +message ShopMessage { + optional string id = 1; + enum ShopMessageSurface { + UNKNOWN_SURFACE = 0; + FB = 1; + IG = 2; + WA = 3; + } + optional ShopMessageSurface surface = 2; + optional int32 messageVersion = 3; } -message InitialSecurityNotificationSettingSync { - optional bool securityNotificationEnabled = 1; +message SingleSelectReply { + optional string selectedRowId = 1; } -message ContactsArrayMessage { - optional string displayName = 1; - repeated ContactMessage contacts = 2; +message StickerMessage { + optional string url = 1; + optional bytes fileSha256 = 2; + optional bytes fileEncSha256 = 3; + optional bytes mediaKey = 4; + optional string mimetype = 5; + optional uint32 height = 6; + optional uint32 width = 7; + optional string directPath = 8; + optional uint64 fileLength = 9; + optional int64 mediaKeyTimestamp = 10; + optional uint32 firstFrameLength = 11; + optional bytes firstFrameSidecar = 12; + optional bool isAnimated = 13; + optional bytes pngThumbnail = 16; optional ContextInfo contextInfo = 17; } -message HSMCurrency { - optional string currencyCode = 1; - optional int64 amount1000 = 2; +message StickerSyncRMRMessage { + repeated string filehash = 1; + optional string rmrSource = 2; + optional int64 requestTimestamp = 3; } -message HSMDateTimeComponent { - enum HSMDateTimeComponentDayOfWeekType { - MONDAY = 1; - TUESDAY = 2; - WEDNESDAY = 3; - THURSDAY = 4; - FRIDAY = 5; - SATURDAY = 6; - SUNDAY = 7; - } - optional HSMDateTimeComponentDayOfWeekType dayOfWeek = 1; - optional uint32 year = 2; - optional uint32 month = 3; - optional uint32 dayOfMonth = 4; - optional uint32 hour = 5; - optional uint32 minute = 6; - enum HSMDateTimeComponentCalendarType { - GREGORIAN = 1; - SOLAR_HIJRI = 2; +message TemplateButton { + optional uint32 index = 4; + oneof button { + QuickReplyButton quickReplyButton = 1; + URLButton urlButton = 2; + CallButton callButton = 3; } - optional HSMDateTimeComponentCalendarType calendar = 7; } -message HSMDateTimeUnixEpoch { - optional int64 timestamp = 1; +message TemplateButtonReplyMessage { + optional string selectedId = 1; + optional string selectedDisplayText = 2; + optional ContextInfo contextInfo = 3; + optional uint32 selectedIndex = 4; } -message HSMDateTime { - oneof datetimeOneof { - HSMDateTimeComponent component = 1; - HSMDateTimeUnixEpoch unixEpoch = 2; +message TemplateMessage { + optional ContextInfo contextInfo = 3; + optional HydratedFourRowTemplate hydratedTemplate = 4; + oneof format { + FourRowTemplate fourRowTemplate = 1; + HydratedFourRowTemplate hydratedFourRowTemplate = 2; } } -message HSMLocalizableParameter { - optional string default = 1; - oneof paramOneof { - HSMCurrency currency = 2; - HSMDateTime dateTime = 3; - } +message URLButton { + optional HighlyStructuredMessage displayText = 1; + optional HighlyStructuredMessage url = 2; } -message HighlyStructuredMessage { - optional string namespace = 1; - optional string elementName = 2; - repeated string params = 3; - optional string fallbackLg = 4; - optional string fallbackLc = 5; - repeated HSMLocalizableParameter localizableParams = 6; - optional string deterministicLg = 7; - optional string deterministicLc = 8; - optional TemplateMessage hydratedHsm = 9; +message VideoMessage { + optional string url = 1; + optional string mimetype = 2; + optional bytes fileSha256 = 3; + optional uint64 fileLength = 4; + optional uint32 seconds = 5; + optional bytes mediaKey = 6; + optional string caption = 7; + optional bool gifPlayback = 8; + optional uint32 height = 9; + optional uint32 width = 10; + optional bytes fileEncSha256 = 11; + repeated InteractiveAnnotation interactiveAnnotations = 12; + optional string directPath = 13; + optional int64 mediaKeyTimestamp = 14; + optional bytes jpegThumbnail = 16; + optional ContextInfo contextInfo = 17; + optional bytes streamingSidecar = 18; + enum VideoMessageAttribution { + NONE = 0; + GIPHY = 1; + TENOR = 2; + } + optional VideoMessageAttribution gifAttribution = 19; + optional bool viewOnce = 20; + optional string thumbnailDirectPath = 21; + optional bytes thumbnailSha256 = 22; + optional bytes thumbnailEncSha256 = 23; + optional string staticUrl = 24; } -message SendPaymentMessage { - optional Message noteMessage = 2; - optional MessageKey requestMessageKey = 3; - optional PaymentBackground background = 4; +message EphemeralSetting { + optional sfixed32 duration = 1; + optional sfixed64 timestamp = 2; } -message RequestPaymentMessage { - optional Message noteMessage = 4; - optional string currencyCodeIso4217 = 1; - optional uint64 amount1000 = 2; - optional string requestFrom = 3; - optional int64 expiryTimestamp = 5; - optional Money amount = 6; - optional PaymentBackground background = 7; +message AutoDownloadSettings { + optional bool downloadImages = 1; + optional bool downloadAudio = 2; + optional bool downloadVideo = 3; + optional bool downloadDocuments = 4; } -message DeclinePaymentRequestMessage { - optional MessageKey key = 1; +message Conversation { + required string id = 1; + repeated HistorySyncMsg messages = 2; + optional string newJid = 3; + optional string oldJid = 4; + optional uint64 lastMsgTimestamp = 5; + optional uint32 unreadCount = 6; + optional bool readOnly = 7; + optional bool endOfHistoryTransfer = 8; + optional uint32 ephemeralExpiration = 9; + optional int64 ephemeralSettingTimestamp = 10; + enum ConversationEndOfHistoryTransferType { + COMPLETE_BUT_MORE_MESSAGES_REMAIN_ON_PRIMARY = 0; + COMPLETE_AND_NO_MORE_MESSAGE_REMAIN_ON_PRIMARY = 1; + } + optional ConversationEndOfHistoryTransferType endOfHistoryTransferType = 11; + optional uint64 conversationTimestamp = 12; + optional string name = 13; + optional string pHash = 14; + optional bool notSpam = 15; + optional bool archived = 16; + optional DisappearingMode disappearingMode = 17; + optional uint32 unreadMentionCount = 18; + optional bool markedAsUnread = 19; + repeated GroupParticipant participant = 20; + optional bytes tcToken = 21; + optional uint64 tcTokenTimestamp = 22; + optional bytes contactPrimaryIdentityKey = 23; + optional uint32 pinned = 24; + optional uint64 muteEndTime = 25; + optional WallpaperSettings wallpaper = 26; + optional MediaVisibility mediaVisibility = 27; + optional uint64 tcTokenSenderTimestamp = 28; + optional bool suspended = 29; } -message CancelPaymentRequestMessage { - optional MessageKey key = 1; +message GlobalSettings { + optional WallpaperSettings lightThemeWallpaper = 1; + optional MediaVisibility mediaVisibility = 2; + optional WallpaperSettings darkThemeWallpaper = 3; + optional AutoDownloadSettings autoDownloadWiFi = 4; + optional AutoDownloadSettings autoDownloadCellular = 5; + optional AutoDownloadSettings autoDownloadRoaming = 6; + optional bool showIndividualNotificationsPreview = 7; + optional bool showGroupNotificationsPreview = 8; } -message PaymentInviteMessage { - enum PaymentInviteMessageServiceType { - UNKNOWN = 0; - FBPAY = 1; - NOVI = 2; - UPI = 3; +message GroupParticipant { + required string userJid = 1; + enum GroupParticipantRank { + REGULAR = 0; + ADMIN = 1; + SUPERADMIN = 2; } - optional PaymentInviteMessageServiceType serviceType = 1; - optional int64 expiryTimestamp = 2; + optional GroupParticipantRank rank = 2; } -message LiveLocationMessage { - optional double degreesLatitude = 1; - optional double degreesLongitude = 2; - optional uint32 accuracyInMeters = 3; - optional float speedInMps = 4; - optional uint32 degreesClockwiseFromMagneticNorth = 5; - optional string caption = 6; - optional int64 sequenceNumber = 7; - optional uint32 timeOffset = 8; - optional bytes jpegThumbnail = 16; - optional ContextInfo contextInfo = 17; +message HistorySync { + enum HistorySyncHistorySyncType { + INITIAL_BOOTSTRAP = 0; + INITIAL_STATUS_V3 = 1; + FULL = 2; + RECENT = 3; + PUSH_NAME = 4; + } + required HistorySyncHistorySyncType syncType = 1; + repeated Conversation conversations = 2; + repeated WebMessageInfo statusV3Messages = 3; + optional uint32 chunkOrder = 5; + optional uint32 progress = 6; + repeated Pushname pushnames = 7; + optional GlobalSettings globalSettings = 8; + optional bytes threadIdUserSecret = 9; + optional uint32 threadDsTimeframeOffset = 10; } -message StickerMessage { - optional string url = 1; - optional bytes fileSha256 = 2; - optional bytes fileEncSha256 = 3; - optional bytes mediaKey = 4; - optional string mimetype = 5; - optional uint32 height = 6; - optional uint32 width = 7; - optional string directPath = 8; - optional uint64 fileLength = 9; - optional int64 mediaKeyTimestamp = 10; - optional uint32 firstFrameLength = 11; - optional bytes firstFrameSidecar = 12; - optional bool isAnimated = 13; - optional bytes pngThumbnail = 16; - optional ContextInfo contextInfo = 17; +message HistorySyncMsg { + optional WebMessageInfo message = 1; + optional uint64 msgOrderId = 2; } -message FourRowTemplate { - optional HighlyStructuredMessage content = 6; - optional HighlyStructuredMessage footer = 7; - repeated TemplateButton buttons = 8; - oneof title { - DocumentMessage documentMessage = 1; - HighlyStructuredMessage highlyStructuredMessage = 2; - ImageMessage imageMessage = 3; - VideoMessage videoMessage = 4; - LocationMessage locationMessage = 5; - } +enum MediaVisibility { + DEFAULT = 0; + OFF = 1; + ON = 2; } - -message HydratedFourRowTemplate { - optional string hydratedContentText = 6; - optional string hydratedFooterText = 7; - repeated HydratedTemplateButton hydratedButtons = 8; - optional string templateId = 9; - oneof title { - DocumentMessage documentMessage = 1; - string hydratedTitleText = 2; - ImageMessage imageMessage = 3; - VideoMessage videoMessage = 4; - LocationMessage locationMessage = 5; - } +message Pushname { + optional string id = 1; + optional string pushname = 2; } -message TemplateMessage { - optional ContextInfo contextInfo = 3; - optional HydratedFourRowTemplate hydratedTemplate = 4; - oneof format { - FourRowTemplate fourRowTemplate = 1; - HydratedFourRowTemplate hydratedFourRowTemplate = 2; - } +message WallpaperSettings { + optional string filename = 1; + optional uint32 opacity = 2; } -message TemplateButtonReplyMessage { - optional string selectedId = 1; - optional string selectedDisplayText = 2; - optional ContextInfo contextInfo = 3; - optional uint32 selectedIndex = 4; +message MsgOpaqueData { + optional string body = 1; + optional string caption = 3; + optional double lng = 5; + optional bool isLive = 6; + optional double lat = 7; + optional int32 paymentAmount1000 = 8; + optional string paymentNoteMsgBody = 9; + optional string canonicalUrl = 10; + optional string matchedText = 11; + optional string title = 12; + optional string description = 13; + optional bytes futureproofBuffer = 14; + optional string clientUrl = 15; + optional string loc = 16; } -message CatalogSnapshot { - optional ImageMessage catalogImage = 1; - optional string title = 2; - optional string description = 3; +message MsgRowOpaqueData { + optional MsgOpaqueData currentMsg = 1; + optional MsgOpaqueData quotedMsg = 2; } -message ProductSnapshot { - optional ImageMessage productImage = 1; - optional string productId = 2; - optional string title = 3; - optional string description = 4; - optional string currencyCode = 5; - optional int64 priceAmount1000 = 6; - optional string retailerId = 7; - optional string url = 8; - optional uint32 productImageCount = 9; - optional string firstImageId = 11; - optional int64 salePriceAmount1000 = 12; +message MediaRetryNotification { + optional string stanzaId = 1; + optional string directPath = 2; + enum MediaRetryNotificationResultType { + GENERAL_ERROR = 0; + SUCCESS = 1; + NOT_FOUND = 2; + DECRYPTION_ERROR = 3; + } + optional MediaRetryNotificationResultType result = 3; } -message ProductMessage { - optional ProductSnapshot product = 1; - optional string businessOwnerJid = 2; - optional CatalogSnapshot catalog = 4; - optional string body = 5; - optional string footer = 6; - optional ContextInfo contextInfo = 17; +message ServerErrorReceipt { + optional string stanzaId = 1; } -message OrderMessage { - optional string orderId = 1; - optional bytes thumbnail = 2; - optional int32 itemCount = 3; - enum OrderMessageOrderStatus { - INQUIRY = 1; - } - optional OrderMessageOrderStatus status = 4; - enum OrderMessageOrderSurface { - CATALOG = 1; - } - optional OrderMessageOrderSurface surface = 5; - optional string message = 6; - optional string orderTitle = 7; - optional string sellerJid = 8; - optional string token = 9; - optional int64 totalAmount1000 = 10; - optional string totalCurrencyCode = 11; - optional ContextInfo contextInfo = 17; +message MessageKey { + optional string remoteJid = 1; + optional bool fromMe = 2; + optional string id = 3; + optional string participant = 4; } -message Row { - optional string title = 1; - optional string description = 2; - optional string rowId = 3; -} +// Duplicate type omitted +//message MessageKey { +// optional string remoteJid = 1; +// optional bool fromMe = 2; +// optional string id = 3; +// optional string participant = 4; +//} -message Section { - optional string title = 1; - repeated Row rows = 2; +message ExitCode { + optional uint64 code = 1; + optional string text = 2; } -message Product { - optional string productId = 1; +message ExternalBlobReference { + optional bytes mediaKey = 1; + optional string directPath = 2; + optional string handle = 3; + optional uint64 fileSizeBytes = 4; + optional bytes fileSha256 = 5; + optional bytes fileEncSha256 = 6; } -message ProductSection { - optional string title = 1; - repeated Product products = 2; +message KeyId { + optional bytes id = 1; } -message ProductListHeaderImage { - optional string productId = 1; - optional bytes jpegThumbnail = 2; +message SyncdIndex { + optional bytes blob = 1; } -message ProductListInfo { - repeated ProductSection productSections = 1; - optional ProductListHeaderImage headerImage = 2; - optional string businessOwnerJid = 3; +message SyncdMutation { + enum SyncdMutationSyncdOperation { + SET = 0; + REMOVE = 1; + } + optional SyncdMutationSyncdOperation operation = 1; + optional SyncdRecord record = 2; } -message ListMessage { - optional string title = 1; - optional string description = 2; - optional string buttonText = 3; - enum ListMessageListType { - UNKNOWN = 0; - SINGLE_SELECT = 1; - PRODUCT_LIST = 2; - } - optional ListMessageListType listType = 4; - repeated Section sections = 5; - optional ProductListInfo productListInfo = 6; - optional string footerText = 7; - optional ContextInfo contextInfo = 8; +message SyncdMutations { + repeated SyncdMutation mutations = 1; } -message SingleSelectReply { - optional string selectedRowId = 1; +message SyncdPatch { + optional SyncdVersion version = 1; + repeated SyncdMutation mutations = 2; + optional ExternalBlobReference externalMutations = 3; + optional bytes snapshotMac = 4; + optional bytes patchMac = 5; + optional KeyId keyId = 6; + optional ExitCode exitCode = 7; + optional uint32 deviceIndex = 8; } -message ListResponseMessage { - optional string title = 1; - enum ListResponseMessageListType { - UNKNOWN = 0; - SINGLE_SELECT = 1; - } - optional ListResponseMessageListType listType = 2; - optional SingleSelectReply singleSelectReply = 3; - optional ContextInfo contextInfo = 4; - optional string description = 5; +message SyncdRecord { + optional SyncdIndex index = 1; + optional SyncdValue value = 2; + optional KeyId keyId = 3; } -message Header { - optional string title = 1; - optional string subtitle = 2; - optional bool hasMediaAttachment = 5; - oneof media { - DocumentMessage documentMessage = 3; - ImageMessage imageMessage = 4; - bytes jpegThumbnail = 6; - VideoMessage videoMessage = 7; - } +message SyncdSnapshot { + optional SyncdVersion version = 1; + repeated SyncdRecord records = 2; + optional bytes mac = 3; + optional KeyId keyId = 4; } -message Body { - optional string text = 1; +message SyncdValue { + optional bytes blob = 1; } -message Footer { - optional string text = 1; +message SyncdVersion { + optional uint64 version = 1; } -message ShopMessage { - optional string id = 1; - enum ShopMessageSurface { - UNKNOWN_SURFACE = 0; - FB = 1; - IG = 2; - WA = 3; - } - optional ShopMessageSurface surface = 2; - optional int32 messageVersion = 3; +message AndroidUnsupportedActions { + optional bool allowed = 1; } -message CollectionMessage { - optional string bizJid = 1; - optional string id = 2; - optional int32 messageVersion = 3; +message ArchiveChatAction { + optional bool archived = 1; + optional SyncActionMessageRange messageRange = 2; } -message NativeFlowButton { - optional string name = 1; - optional string buttonParamsJson = 2; +message ClearChatAction { + optional SyncActionMessageRange messageRange = 1; } -message NativeFlowMessage { - repeated NativeFlowButton buttons = 1; - optional string messageParamsJson = 2; - optional int32 messageVersion = 3; +message ContactAction { + optional string fullName = 1; + optional string firstName = 2; } -message InteractiveMessage { - optional Header header = 1; - optional Body body = 2; - optional Footer footer = 3; - optional ContextInfo contextInfo = 15; - oneof interactiveMessage { - ShopMessage shopStorefrontMessage = 4; - CollectionMessage collectionMessage = 5; - NativeFlowMessage nativeFlowMessage = 6; - } +message DeleteChatAction { + optional SyncActionMessageRange messageRange = 1; } -message GroupInviteMessage { - optional string groupJid = 1; - optional string inviteCode = 2; - optional int64 inviteExpiration = 3; - optional string groupName = 4; - optional bytes jpegThumbnail = 5; - optional string caption = 6; - optional ContextInfo contextInfo = 7; - enum GroupInviteMessageGroupType { - DEFAULT = 0; - PARENT = 1; - } - optional GroupInviteMessageGroupType groupType = 8; +message DeleteMessageForMeAction { + optional bool deleteMedia = 1; + optional int64 messageTimestamp = 2; } -message DeviceSentMessage { - optional string destinationJid = 1; - optional Message message = 2; - optional string phash = 3; +message FavoriteStickerAction { + optional string directPath = 1; + optional string lastUploadTimestamp = 2; + optional string handle = 3; + optional string encFilehash = 4; + optional string stickerHashWithoutMeta = 5; + optional string mediaKey = 6; + optional int64 mediaKeyTimestamp = 7; + optional bool isFavorite = 8; } -message FutureProofMessage { - optional Message message = 1; +message KeyExpiration { + optional int32 expiredKeyEpoch = 1; } -message ButtonText { - optional string displayText = 1; +message LabelAssociationAction { + optional bool labeled = 1; } -message NativeFlowInfo { +message LabelEditAction { optional string name = 1; - optional string paramsJson = 2; + optional int32 color = 2; + optional int32 predefinedId = 3; + optional bool deleted = 4; } -message Button { - optional string buttonId = 1; - optional ButtonText buttonText = 2; - enum ButtonType { - UNKNOWN = 0; - RESPONSE = 1; - NATIVE_FLOW = 2; - } - optional ButtonType type = 3; - optional NativeFlowInfo nativeFlowInfo = 4; +message LocaleSetting { + optional string locale = 1; } -message ButtonsMessage { - optional string contentText = 6; - optional string footerText = 7; - optional ContextInfo contextInfo = 8; - repeated Button buttons = 9; - enum ButtonsMessageHeaderType { - UNKNOWN = 0; - EMPTY = 1; - TEXT = 2; - DOCUMENT = 3; - IMAGE = 4; - VIDEO = 5; - LOCATION = 6; - } - optional ButtonsMessageHeaderType headerType = 10; - oneof header { - string text = 1; - DocumentMessage documentMessage = 2; - ImageMessage imageMessage = 3; - VideoMessage videoMessage = 4; - LocationMessage locationMessage = 5; - } +message MarkChatAsReadAction { + optional bool read = 1; + optional SyncActionMessageRange messageRange = 2; } -message ButtonsResponseMessage { - optional string selectedButtonId = 1; - optional ContextInfo contextInfo = 3; - enum ButtonsResponseMessageType { - UNKNOWN = 0; - DISPLAY_TEXT = 1; - } - optional ButtonsResponseMessageType type = 4; - oneof response { - string selectedDisplayText = 2; - } +message MuteAction { + optional bool muted = 1; + optional int64 muteEndTimestamp = 2; } -message ReactionMessage { +message PinAction { + optional bool pinned = 1; +} + +message PrimaryFeature { + repeated string flags = 1; +} + +message PushNameSetting { + optional string name = 1; +} + +message QuickReplyAction { + optional string shortcut = 1; + optional string message = 2; + repeated string keywords = 3; + optional int32 count = 4; + optional bool deleted = 5; +} + +message RecentEmojiWeight { + optional string emoji = 1; + optional float weight = 2; +} + +message RecentEmojiWeightsAction { + repeated RecentEmojiWeight weights = 1; +} + +message RecentStickerMetadata { + optional string directPath = 1; + optional string encFilehash = 2; + optional string mediaKey = 3; + optional string stanzaId = 4; + optional string chatJid = 5; + optional string participant = 6; + optional bool isSentByMe = 7; +} + +message RecentStickerWeight { + optional string filehash = 1; + optional float weight = 2; +} + +message RecentStickerWeightsAction { + repeated RecentStickerWeight weights = 1; +} + +message SecurityNotificationSetting { + optional bool showNotification = 1; +} + +message StarAction { + optional bool starred = 1; +} + +message SyncActionData { + optional bytes index = 1; + optional SyncActionValue value = 2; + optional bytes padding = 3; + optional int32 version = 4; +} + +message SyncActionMessage { optional MessageKey key = 1; - optional string text = 2; - optional string groupingKey = 3; - optional int64 senderTimestampMs = 4; + optional int64 timestamp = 2; } -message StickerSyncRMRMessage { - repeated string filehash = 1; - optional string rmrSource = 2; - optional int64 requestTimestamp = 3; +message SyncActionMessageRange { + optional int64 lastMessageTimestamp = 1; + optional int64 lastSystemMessageTimestamp = 2; + repeated SyncActionMessage messages = 3; } -message Message { - optional string conversation = 1; - optional SenderKeyDistributionMessage senderKeyDistributionMessage = 2; - optional ImageMessage imageMessage = 3; - optional ContactMessage contactMessage = 4; - optional LocationMessage locationMessage = 5; - optional ExtendedTextMessage extendedTextMessage = 6; - optional DocumentMessage documentMessage = 7; - optional AudioMessage audioMessage = 8; - optional VideoMessage videoMessage = 9; - optional Call call = 10; - optional Chat chat = 11; - optional ProtocolMessage protocolMessage = 12; - optional ContactsArrayMessage contactsArrayMessage = 13; - optional HighlyStructuredMessage highlyStructuredMessage = 14; - optional SenderKeyDistributionMessage fastRatchetKeySenderKeyDistributionMessage = 15; - optional SendPaymentMessage sendPaymentMessage = 16; - optional LiveLocationMessage liveLocationMessage = 18; - optional RequestPaymentMessage requestPaymentMessage = 22; - optional DeclinePaymentRequestMessage declinePaymentRequestMessage = 23; - optional CancelPaymentRequestMessage cancelPaymentRequestMessage = 24; - optional TemplateMessage templateMessage = 25; - optional StickerMessage stickerMessage = 26; - optional GroupInviteMessage groupInviteMessage = 28; - optional TemplateButtonReplyMessage templateButtonReplyMessage = 29; - optional ProductMessage productMessage = 30; - optional DeviceSentMessage deviceSentMessage = 31; - optional MessageContextInfo messageContextInfo = 35; - optional ListMessage listMessage = 36; - optional FutureProofMessage viewOnceMessage = 37; - optional OrderMessage orderMessage = 38; - optional ListResponseMessage listResponseMessage = 39; - optional FutureProofMessage ephemeralMessage = 40; - optional InvoiceMessage invoiceMessage = 41; - optional ButtonsMessage buttonsMessage = 42; - optional ButtonsResponseMessage buttonsResponseMessage = 43; - optional PaymentInviteMessage paymentInviteMessage = 44; - optional InteractiveMessage interactiveMessage = 45; - optional ReactionMessage reactionMessage = 46; - optional StickerSyncRMRMessage stickerSyncRmrMessage = 47; +message SyncActionValue { + optional int64 timestamp = 1; + optional StarAction starAction = 2; + optional ContactAction contactAction = 3; + optional MuteAction muteAction = 4; + optional PinAction pinAction = 5; + optional SecurityNotificationSetting securityNotificationSetting = 6; + optional PushNameSetting pushNameSetting = 7; + optional QuickReplyAction quickReplyAction = 8; + optional RecentStickerWeightsAction recentStickerWeightsAction = 9; + optional RecentStickerMetadata recentStickerMetadata = 10; + optional RecentEmojiWeightsAction recentEmojiWeightsAction = 11; + optional LabelEditAction labelEditAction = 14; + optional LabelAssociationAction labelAssociationAction = 15; + optional LocaleSetting localeSetting = 16; + optional ArchiveChatAction archiveChatAction = 17; + optional DeleteMessageForMeAction deleteMessageForMeAction = 18; + optional KeyExpiration keyExpiration = 19; + optional MarkChatAsReadAction markChatAsReadAction = 20; + optional ClearChatAction clearChatAction = 21; + optional DeleteChatAction deleteChatAction = 22; + optional UnarchiveChatsSetting unarchiveChatsSetting = 23; + optional PrimaryFeature primaryFeature = 24; + optional FavoriteStickerAction favoriteStickerAction = 25; + optional AndroidUnsupportedActions androidUnsupportedActions = 26; } -message ActionLink { - optional string url = 1; - optional string buttonTitle = 2; +message UnarchiveChatsSetting { + optional bool unarchiveChats = 1; } -message DisappearingMode { - enum DisappearingModeInitiator { - CHANGED_IN_CHAT = 0; - INITIATED_BY_ME = 1; - INITIATED_BY_OTHER = 2; +message BizAccountLinkInfo { + optional uint64 whatsappBizAcctFbid = 1; + optional string whatsappAcctNumber = 2; + optional uint64 issueTime = 3; + enum BizAccountLinkInfoHostStorageType { + ON_PREMISE = 0; + FACEBOOK = 1; } - optional DisappearingModeInitiator initiator = 1; + optional BizAccountLinkInfoHostStorageType hostStorage = 4; + enum BizAccountLinkInfoAccountType { + ENTERPRISE = 0; + } + optional BizAccountLinkInfoAccountType accountType = 5; } -// Renamed from MediaData -message PBMediaData { - optional bytes mediaKey = 1; - optional int64 mediaKeyTimestamp = 2; - optional bytes fileSha256 = 3; - optional bytes fileEncSha256 = 4; - optional string directPath = 5; +message BizAccountPayload { + optional VerifiedNameCertificate vnameCert = 1; + optional bytes bizAcctLinkInfo = 2; } -message PaymentBackground { - optional string id = 1; - optional uint64 fileLength = 2; - optional uint32 width = 3; - optional uint32 height = 4; - optional string mimetype = 5; - optional fixed32 placeholderArgb = 6; - optional fixed32 textArgb = 7; - optional fixed32 subtextArgb = 8; - optional PBMediaData mediaData = 9; - enum PaymentBackgroundType { +message BizIdentityInfo { + enum BizIdentityInfoVerifiedLevelValue { UNKNOWN = 0; - DEFAULT = 1; + LOW = 1; + HIGH = 2; } - optional PaymentBackgroundType type = 10; + optional BizIdentityInfoVerifiedLevelValue vlevel = 1; + optional VerifiedNameCertificate vnameCert = 2; + optional bool signed = 3; + optional bool revoked = 4; + enum BizIdentityInfoHostStorageType { + ON_PREMISE = 0; + FACEBOOK = 1; + } + optional BizIdentityInfoHostStorageType hostStorage = 5; + enum BizIdentityInfoActualActorsType { + SELF = 0; + BSP = 1; + } + optional BizIdentityInfoActualActorsType actualActors = 6; + optional uint64 privacyModeTs = 7; + optional uint64 featureControls = 8; } -message Money { - optional int64 value = 1; - optional uint32 offset = 2; - optional string currencyCode = 3; +message LocalizedName { + optional string lg = 1; + optional string lc = 2; + optional string verifiedName = 3; } -message HydratedQuickReplyButton { - optional string displayText = 1; - optional string id = 2; +message VerifiedNameCertificate { + optional bytes details = 1; + optional bytes signature = 2; + optional bytes serverSignature = 3; } -message HydratedURLButton { - optional string displayText = 1; - optional string url = 2; +// Renamed from VerifiedNameCertificate$Details +message VerifiedNameDetails { + optional uint64 serial = 1; + optional string issuer = 2; + optional string verifiedName = 4; + repeated LocalizedName localizedNames = 8; + optional uint64 issueTime = 10; } -message HydratedCallButton { - optional string displayText = 1; - optional string phoneNumber = 2; +// Duplicate type omitted +//message AppVersion { +// optional uint32 primary = 1; +// optional uint32 secondary = 2; +// optional uint32 tertiary = 3; +// optional uint32 quaternary = 4; +// optional uint32 quinary = 5; +//} + +message ClientFinish { + optional bytes static = 1; + optional bytes payload = 2; } -message HydratedTemplateButton { - optional uint32 index = 4; - oneof hydratedButton { - HydratedQuickReplyButton quickReplyButton = 1; - HydratedURLButton urlButton = 2; - HydratedCallButton callButton = 3; +message ClientHello { + optional bytes ephemeral = 1; + optional bytes static = 2; + optional bytes payload = 3; +} + +message ClientPayload { + optional uint64 username = 1; + optional bool passive = 3; + optional UserAgent userAgent = 5; + optional WebInfo webInfo = 6; + optional string pushName = 7; + optional sfixed32 sessionId = 9; + optional bool shortConnect = 10; + enum ClientPayloadConnectType { + CELLULAR_UNKNOWN = 0; + WIFI_UNKNOWN = 1; + CELLULAR_EDGE = 100; + CELLULAR_IDEN = 101; + CELLULAR_UMTS = 102; + CELLULAR_EVDO = 103; + CELLULAR_GPRS = 104; + CELLULAR_HSDPA = 105; + CELLULAR_HSUPA = 106; + CELLULAR_HSPA = 107; + CELLULAR_CDMA = 108; + CELLULAR_1XRTT = 109; + CELLULAR_EHRPD = 110; + CELLULAR_LTE = 111; + CELLULAR_HSPAP = 112; + } + optional ClientPayloadConnectType connectType = 12; + enum ClientPayloadConnectReason { + PUSH = 0; + USER_ACTIVATED = 1; + SCHEDULED = 2; + ERROR_RECONNECT = 3; + NETWORK_SWITCH = 4; + PING_RECONNECT = 5; } + optional ClientPayloadConnectReason connectReason = 13; + repeated int32 shards = 14; + optional DNSSource dnsSource = 15; + optional uint32 connectAttemptCount = 16; + optional uint32 device = 18; + optional CompanionRegData regData = 19; + enum ClientPayloadProduct { + WHATSAPP = 0; + MESSENGER = 1; + } + optional ClientPayloadProduct product = 20; + optional bytes fbCat = 21; + optional bytes fbUserAgent = 22; + optional bool oc = 23; + optional int32 lc = 24; + enum ClientPayloadIOSAppExtension { + SHARE_EXTENSION = 0; + SERVICE_EXTENSION = 1; + INTENTS_EXTENSION = 2; + } + optional ClientPayloadIOSAppExtension iosAppExtension = 30; + optional uint64 fbAppId = 31; + optional bytes fbDeviceId = 32; + optional bool pull = 33; } -message QuickReplyButton { - optional HighlyStructuredMessage displayText = 1; - optional string id = 2; +message CompanionRegData { + optional bytes eRegid = 1; + optional bytes eKeytype = 2; + optional bytes eIdent = 3; + optional bytes eSkeyId = 4; + optional bytes eSkeyVal = 5; + optional bytes eSkeySig = 6; + optional bytes buildHash = 7; + optional bytes companionProps = 8; } -message URLButton { - optional HighlyStructuredMessage displayText = 1; - optional HighlyStructuredMessage url = 2; +message DNSSource { + enum DNSSourceDNSResolutionMethod { + SYSTEM = 0; + GOOGLE = 1; + HARDCODED = 2; + OVERRIDE = 3; + FALLBACK = 4; + } + optional DNSSourceDNSResolutionMethod dnsMethod = 15; + optional bool appCached = 16; } -message CallButton { - optional HighlyStructuredMessage displayText = 1; - optional HighlyStructuredMessage phoneNumber = 2; +message HandshakeMessage { + optional ClientHello clientHello = 2; + optional ServerHello serverHello = 3; + optional ClientFinish clientFinish = 4; } -message TemplateButton { - optional uint32 index = 4; - oneof button { - QuickReplyButton quickReplyButton = 1; - URLButton urlButton = 2; - CallButton callButton = 3; - } +message NoiseCertificate { + optional bytes details = 1; + optional bytes signature = 2; } -message Location { - optional double degreesLatitude = 1; - optional double degreesLongitude = 2; - optional string name = 3; +// Renamed from NoiseCertificate$Details +message NoiseCertificateDetails { + optional uint32 serial = 1; + optional string issuer = 2; + optional uint64 expires = 3; + optional string subject = 4; + optional bytes key = 5; } -message Point { - optional int32 xDeprecated = 1; - optional int32 yDeprecated = 2; - optional double x = 3; - optional double y = 4; +message ServerHello { + optional bytes ephemeral = 1; + optional bytes static = 2; + optional bytes payload = 3; +} + +message UserAgent { + enum UserAgentPlatform { + ANDROID = 0; + IOS = 1; + WINDOWS_PHONE = 2; + BLACKBERRY = 3; + BLACKBERRYX = 4; + S40 = 5; + S60 = 6; + PYTHON_CLIENT = 7; + TIZEN = 8; + ENTERPRISE = 9; + SMB_ANDROID = 10; + KAIOS = 11; + SMB_IOS = 12; + WINDOWS = 13; + WEB = 14; + PORTAL = 15; + GREEN_ANDROID = 16; + GREEN_IPHONE = 17; + BLUE_ANDROID = 18; + BLUE_IPHONE = 19; + FBLITE_ANDROID = 20; + MLITE_ANDROID = 21; + IGLITE_ANDROID = 22; + PAGE = 23; + MACOS = 24; + OCULUS_MSG = 25; + OCULUS_CALL = 26; + MILAN = 27; + CAPI = 28; + } + optional UserAgentPlatform platform = 1; + optional AppVersion appVersion = 2; + optional string mcc = 3; + optional string mnc = 4; + optional string osVersion = 5; + optional string manufacturer = 6; + optional string device = 7; + optional string osBuildNumber = 8; + optional string phoneId = 9; + enum UserAgentReleaseChannel { + RELEASE = 0; + BETA = 1; + ALPHA = 2; + DEBUG = 3; + } + optional UserAgentReleaseChannel releaseChannel = 10; + optional string localeLanguageIso6391 = 11; + optional string localeCountryIso31661Alpha2 = 12; + optional string deviceBoard = 13; } -// Duplicate type omitted -//message AppVersion { -// optional uint32 primary = 1; -// optional uint32 secondary = 2; -// optional uint32 tertiary = 3; -// optional uint32 quaternary = 4; -// optional uint32 quinary = 5; -//} +message WebdPayload { + optional bool usesParticipantInKey = 1; + optional bool supportsStarredMessages = 2; + optional bool supportsDocumentMessages = 3; + optional bool supportsUrlMessages = 4; + optional bool supportsMediaRetry = 5; + optional bool supportsE2EImage = 6; + optional bool supportsE2EVideo = 7; + optional bool supportsE2EAudio = 8; + optional bool supportsE2EDocument = 9; + optional string documentTypes = 10; + optional bytes features = 11; +} -message CompanionProps { - optional string os = 1; - optional AppVersion version = 2; - enum CompanionPropsPlatformType { - UNKNOWN = 0; - CHROME = 1; - FIREFOX = 2; - IE = 3; - OPERA = 4; - SAFARI = 5; - EDGE = 6; - DESKTOP = 7; - IPAD = 8; - ANDROID_TABLET = 9; - OHANA = 10; - ALOHA = 11; - CATALINA = 12; +message WebInfo { + optional string refToken = 1; + optional string version = 2; + optional WebdPayload webdPayload = 3; + enum WebInfoWebSubPlatform { + WEB_BROWSER = 0; + APP_STORE = 1; + WIN_STORE = 2; + DARWIN = 3; + WIN32 = 4; } - optional CompanionPropsPlatformType platformType = 3; - optional bool requireFullSync = 4; + optional WebInfoWebSubPlatform webSubPlatform = 4; } -message ADVSignedDeviceIdentityHMAC { - optional bytes details = 1; - optional bytes hmac = 2; +message MediaData { + optional string localPath = 1; } -message ADVSignedDeviceIdentity { - optional bytes details = 1; - optional bytes accountSignatureKey = 2; - optional bytes accountSignature = 3; - optional bytes deviceSignature = 4; +message NotificationMessageInfo { + optional MessageKey key = 1; + optional Message message = 2; + optional uint64 messageTimestamp = 3; + optional string participant = 4; } -message ADVDeviceIdentity { - optional uint32 rawId = 1; - optional uint64 timestamp = 2; - optional uint32 keyIndex = 3; +message PaymentInfo { + enum PaymentInfoCurrency { + UNKNOWN_CURRENCY = 0; + INR = 1; + } + optional PaymentInfoCurrency currencyDeprecated = 1; + optional uint64 amount1000 = 2; + optional string receiverJid = 3; + enum PaymentInfoStatus { + UNKNOWN_STATUS = 0; + PROCESSING = 1; + SENT = 2; + NEED_TO_ACCEPT = 3; + COMPLETE = 4; + COULD_NOT_COMPLETE = 5; + REFUNDED = 6; + EXPIRED = 7; + REJECTED = 8; + CANCELLED = 9; + WAITING_FOR_PAYER = 10; + WAITING = 11; + } + optional PaymentInfoStatus status = 4; + optional uint64 transactionTimestamp = 5; + optional MessageKey requestMessageKey = 6; + optional uint64 expiryTimestamp = 7; + optional bool futureproofed = 8; + optional string currency = 9; + enum PaymentInfoTxnStatus { + UNKNOWN = 0; + PENDING_SETUP = 1; + PENDING_RECEIVER_SETUP = 2; + INIT = 3; + SUCCESS = 4; + COMPLETED = 5; + FAILED = 6; + FAILED_RISK = 7; + FAILED_PROCESSING = 8; + FAILED_RECEIVER_PROCESSING = 9; + FAILED_DA = 10; + FAILED_DA_FINAL = 11; + REFUNDED_TXN = 12; + REFUND_FAILED = 13; + REFUND_FAILED_PROCESSING = 14; + REFUND_FAILED_DA = 15; + EXPIRED_TXN = 16; + AUTH_CANCELED = 17; + AUTH_CANCEL_FAILED_PROCESSING = 18; + AUTH_CANCEL_FAILED = 19; + COLLECT_INIT = 20; + COLLECT_SUCCESS = 21; + COLLECT_FAILED = 22; + COLLECT_FAILED_RISK = 23; + COLLECT_REJECTED = 24; + COLLECT_EXPIRED = 25; + COLLECT_CANCELED = 26; + COLLECT_CANCELLING = 27; + IN_REVIEW = 28; + } + optional PaymentInfoTxnStatus txnStatus = 10; + optional bool useNoviFiatFormat = 11; + optional Money primaryAmount = 12; + optional Money exchangeAmount = 13; } -message ADVSignedKeyIndexList { - optional bytes details = 1; - optional bytes accountSignature = 2; +message PhotoChange { + optional bytes oldPhoto = 1; + optional bytes newPhoto = 2; + optional uint32 newPhotoId = 3; } -message ADVKeyIndexList { - optional uint32 rawId = 1; - optional uint64 timestamp = 2; - optional uint32 currentIndex = 3; - repeated uint32 validIndexes = 4 [packed=true]; +message PollAdditionalMetadata { + optional bool pollInvalidated = 1; } -message MessageKey { - optional string remoteJid = 1; - optional bool fromMe = 2; - optional string id = 3; - optional string participant = 4; +message PollUpdate { + optional MessageKey pollUpdateMessageKey = 1; + optional PollUpdateMessageContent pollUpdateMessage = 2; } message Reaction { @@ -1664,6 +1830,11 @@ message Reaction { optional bool unread = 5; } +message StatusPSA { + required string campaignId = 44; + optional uint64 campaignExpirationTimestamp = 45; +} + message UserReceipt { required string userJid = 1; optional int64 receiptTimestamp = 2; @@ -1673,21 +1844,6 @@ message UserReceipt { repeated string deliveredDeviceJid = 6; } -message StatusPSA { - required string campaignId = 44; - optional uint64 campaignExpirationTimestamp = 45; -} - -message PhotoChange { - optional bytes oldPhoto = 1; - optional bytes newPhoto = 2; - optional uint32 newPhotoId = 3; -} - -message MediaData { - optional string localPath = 1; -} - message WebFeatures { enum WebFeaturesFlag { NOT_STARTED = 0; @@ -1742,85 +1898,6 @@ message WebFeatures { optional WebFeaturesFlag noDeleteMessageTimeLimit = 49; } -message NotificationMessageInfo { - optional MessageKey key = 1; - optional Message message = 2; - optional uint64 messageTimestamp = 3; - optional string participant = 4; -} - -message WebNotificationsInfo { - optional uint64 timestamp = 2; - optional uint32 unreadChats = 3; - optional uint32 notifyMessageCount = 4; - repeated WebMessageInfo notifyMessages = 5; -} - -message PaymentInfo { - enum PaymentInfoCurrency { - UNKNOWN_CURRENCY = 0; - INR = 1; - } - optional PaymentInfoCurrency currencyDeprecated = 1; - optional uint64 amount1000 = 2; - optional string receiverJid = 3; - enum PaymentInfoStatus { - UNKNOWN_STATUS = 0; - PROCESSING = 1; - SENT = 2; - NEED_TO_ACCEPT = 3; - COMPLETE = 4; - COULD_NOT_COMPLETE = 5; - REFUNDED = 6; - EXPIRED = 7; - REJECTED = 8; - CANCELLED = 9; - WAITING_FOR_PAYER = 10; - WAITING = 11; - } - optional PaymentInfoStatus status = 4; - optional uint64 transactionTimestamp = 5; - optional MessageKey requestMessageKey = 6; - optional uint64 expiryTimestamp = 7; - optional bool futureproofed = 8; - optional string currency = 9; - enum PaymentInfoTxnStatus { - UNKNOWN = 0; - PENDING_SETUP = 1; - PENDING_RECEIVER_SETUP = 2; - INIT = 3; - SUCCESS = 4; - COMPLETED = 5; - FAILED = 6; - FAILED_RISK = 7; - FAILED_PROCESSING = 8; - FAILED_RECEIVER_PROCESSING = 9; - FAILED_DA = 10; - FAILED_DA_FINAL = 11; - REFUNDED_TXN = 12; - REFUND_FAILED = 13; - REFUND_FAILED_PROCESSING = 14; - REFUND_FAILED_DA = 15; - EXPIRED_TXN = 16; - AUTH_CANCELED = 17; - AUTH_CANCEL_FAILED_PROCESSING = 18; - AUTH_CANCEL_FAILED = 19; - COLLECT_INIT = 20; - COLLECT_SUCCESS = 21; - COLLECT_FAILED = 22; - COLLECT_FAILED_RISK = 23; - COLLECT_REJECTED = 24; - COLLECT_EXPIRED = 25; - COLLECT_CANCELED = 26; - COLLECT_CANCELLING = 27; - IN_REVIEW = 28; - } - optional PaymentInfoTxnStatus txnStatus = 10; - optional bool useNoviFiatFormat = 11; - optional Money primaryAmount = 12; - optional Money exchangeAmount = 13; -} - message WebMessageInfo { required MessageKey key = 1; optional Message message = 2; @@ -1979,6 +2056,9 @@ message WebMessageInfo { E2E_DEVICE_FETCH_FAILED = 131; ADMIN_REVOKE = 132; GROUP_INVITE_LINK_GROWTH_LOCKED = 133; + COMMUNITY_LINK_PARENT_GROUP = 134; + COMMUNITY_LINK_SIBLING_GROUP = 135; + COMMUNITY_LINK_SUB_GROUP = 136; } optional WebMessageInfoStubType messageStubType = 24; optional bool clearMedia = 25; @@ -2007,5 +2087,13 @@ message WebMessageInfo { optional MediaData quotedStickerData = 42; optional bytes futureproofData = 43; optional StatusPSA statusPsa = 44; + repeated PollUpdate pollUpdates = 45; + optional PollAdditionalMetadata pollAdditionalMetadata = 46; } +message WebNotificationsInfo { + optional uint64 timestamp = 2; + optional uint32 unreadChats = 3; + optional uint32 notifyMessageCount = 4; + repeated WebMessageInfo notifyMessages = 5; +} diff --git a/node_modules/@adiwajshing/baileys/WAProto/index.d.ts b/node_modules/@adiwajshing/baileys/WAProto/index.d.ts index 1bd988a40..ef0f51cf8 100644 --- a/node_modules/@adiwajshing/baileys/WAProto/index.d.ts +++ b/node_modules/@adiwajshing/baileys/WAProto/index.d.ts @@ -2,20110 +2,21164 @@ import * as $protobuf from "protobufjs"; /** Namespace proto. */ export namespace proto { - /** Properties of an AppVersion. */ - interface IAppVersion { - - /** AppVersion primary */ - primary?: (number|null); - - /** AppVersion secondary */ - secondary?: (number|null); + /** Properties of a ADVDeviceIdentity. */ + interface IADVDeviceIdentity { - /** AppVersion tertiary */ - tertiary?: (number|null); + /** ADVDeviceIdentity rawId */ + rawId?: (number|null); - /** AppVersion quaternary */ - quaternary?: (number|null); + /** ADVDeviceIdentity timestamp */ + timestamp?: (number|Long|null); - /** AppVersion quinary */ - quinary?: (number|null); + /** ADVDeviceIdentity keyIndex */ + keyIndex?: (number|null); } - /** Represents an AppVersion. */ - class AppVersion implements IAppVersion { + /** Represents a ADVDeviceIdentity. */ + class ADVDeviceIdentity implements IADVDeviceIdentity { /** - * Constructs a new AppVersion. + * Constructs a new ADVDeviceIdentity. * @param [properties] Properties to set */ - constructor(properties?: proto.IAppVersion); - - /** AppVersion primary. */ - public primary: number; - - /** AppVersion secondary. */ - public secondary: number; + constructor(properties?: proto.IADVDeviceIdentity); - /** AppVersion tertiary. */ - public tertiary: number; + /** ADVDeviceIdentity rawId. */ + public rawId: number; - /** AppVersion quaternary. */ - public quaternary: number; + /** ADVDeviceIdentity timestamp. */ + public timestamp: (number|Long); - /** AppVersion quinary. */ - public quinary: number; + /** ADVDeviceIdentity keyIndex. */ + public keyIndex: number; /** - * Creates a new AppVersion instance using the specified properties. + * Creates a new ADVDeviceIdentity instance using the specified properties. * @param [properties] Properties to set - * @returns AppVersion instance + * @returns ADVDeviceIdentity instance */ - public static create(properties?: proto.IAppVersion): proto.AppVersion; + public static create(properties?: proto.IADVDeviceIdentity): proto.ADVDeviceIdentity; /** - * Encodes the specified AppVersion message. Does not implicitly {@link proto.AppVersion.verify|verify} messages. - * @param message AppVersion message or plain object to encode + * Encodes the specified ADVDeviceIdentity message. Does not implicitly {@link proto.ADVDeviceIdentity.verify|verify} messages. + * @param message ADVDeviceIdentity message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: proto.IAppVersion, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: proto.IADVDeviceIdentity, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified AppVersion message, length delimited. Does not implicitly {@link proto.AppVersion.verify|verify} messages. - * @param message AppVersion message or plain object to encode + * Encodes the specified ADVDeviceIdentity message, length delimited. Does not implicitly {@link proto.ADVDeviceIdentity.verify|verify} messages. + * @param message ADVDeviceIdentity message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: proto.IAppVersion, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: proto.IADVDeviceIdentity, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an AppVersion message from the specified reader or buffer. + * Decodes a ADVDeviceIdentity message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns AppVersion + * @returns ADVDeviceIdentity * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.AppVersion; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.ADVDeviceIdentity; /** - * Decodes an AppVersion message from the specified reader or buffer, length delimited. + * Decodes a ADVDeviceIdentity message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns AppVersion + * @returns ADVDeviceIdentity * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.AppVersion; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.ADVDeviceIdentity; /** - * Verifies an AppVersion message. + * Verifies a ADVDeviceIdentity message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates an AppVersion message from a plain object. Also converts values to their respective internal types. + * Creates a ADVDeviceIdentity message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns AppVersion + * @returns ADVDeviceIdentity */ - public static fromObject(object: { [k: string]: any }): proto.AppVersion; + public static fromObject(object: { [k: string]: any }): proto.ADVDeviceIdentity; /** - * Creates a plain object from an AppVersion message. Also converts values to other types if specified. - * @param message AppVersion + * Creates a plain object from a ADVDeviceIdentity message. Also converts values to other types if specified. + * @param message ADVDeviceIdentity * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: proto.AppVersion, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: proto.ADVDeviceIdentity, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this AppVersion to JSON. + * Converts this ADVDeviceIdentity to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a UserAgent. */ - interface IUserAgent { - - /** UserAgent platform */ - platform?: (proto.UserAgent.UserAgentPlatform|null); - - /** UserAgent appVersion */ - appVersion?: (proto.IAppVersion|null); - - /** UserAgent mcc */ - mcc?: (string|null); - - /** UserAgent mnc */ - mnc?: (string|null); - - /** UserAgent osVersion */ - osVersion?: (string|null); - - /** UserAgent manufacturer */ - manufacturer?: (string|null); - - /** UserAgent device */ - device?: (string|null); - - /** UserAgent osBuildNumber */ - osBuildNumber?: (string|null); - - /** UserAgent phoneId */ - phoneId?: (string|null); + /** Properties of a ADVKeyIndexList. */ + interface IADVKeyIndexList { - /** UserAgent releaseChannel */ - releaseChannel?: (proto.UserAgent.UserAgentReleaseChannel|null); + /** ADVKeyIndexList rawId */ + rawId?: (number|null); - /** UserAgent localeLanguageIso6391 */ - localeLanguageIso6391?: (string|null); + /** ADVKeyIndexList timestamp */ + timestamp?: (number|Long|null); - /** UserAgent localeCountryIso31661Alpha2 */ - localeCountryIso31661Alpha2?: (string|null); + /** ADVKeyIndexList currentIndex */ + currentIndex?: (number|null); - /** UserAgent deviceBoard */ - deviceBoard?: (string|null); + /** ADVKeyIndexList validIndexes */ + validIndexes?: (number[]|null); } - /** Represents a UserAgent. */ - class UserAgent implements IUserAgent { + /** Represents a ADVKeyIndexList. */ + class ADVKeyIndexList implements IADVKeyIndexList { /** - * Constructs a new UserAgent. + * Constructs a new ADVKeyIndexList. * @param [properties] Properties to set */ - constructor(properties?: proto.IUserAgent); - - /** UserAgent platform. */ - public platform: proto.UserAgent.UserAgentPlatform; - - /** UserAgent appVersion. */ - public appVersion?: (proto.IAppVersion|null); - - /** UserAgent mcc. */ - public mcc: string; - - /** UserAgent mnc. */ - public mnc: string; - - /** UserAgent osVersion. */ - public osVersion: string; - - /** UserAgent manufacturer. */ - public manufacturer: string; - - /** UserAgent device. */ - public device: string; - - /** UserAgent osBuildNumber. */ - public osBuildNumber: string; - - /** UserAgent phoneId. */ - public phoneId: string; + constructor(properties?: proto.IADVKeyIndexList); - /** UserAgent releaseChannel. */ - public releaseChannel: proto.UserAgent.UserAgentReleaseChannel; + /** ADVKeyIndexList rawId. */ + public rawId: number; - /** UserAgent localeLanguageIso6391. */ - public localeLanguageIso6391: string; + /** ADVKeyIndexList timestamp. */ + public timestamp: (number|Long); - /** UserAgent localeCountryIso31661Alpha2. */ - public localeCountryIso31661Alpha2: string; + /** ADVKeyIndexList currentIndex. */ + public currentIndex: number; - /** UserAgent deviceBoard. */ - public deviceBoard: string; + /** ADVKeyIndexList validIndexes. */ + public validIndexes: number[]; /** - * Creates a new UserAgent instance using the specified properties. + * Creates a new ADVKeyIndexList instance using the specified properties. * @param [properties] Properties to set - * @returns UserAgent instance + * @returns ADVKeyIndexList instance */ - public static create(properties?: proto.IUserAgent): proto.UserAgent; + public static create(properties?: proto.IADVKeyIndexList): proto.ADVKeyIndexList; /** - * Encodes the specified UserAgent message. Does not implicitly {@link proto.UserAgent.verify|verify} messages. - * @param message UserAgent message or plain object to encode + * Encodes the specified ADVKeyIndexList message. Does not implicitly {@link proto.ADVKeyIndexList.verify|verify} messages. + * @param message ADVKeyIndexList message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: proto.IUserAgent, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: proto.IADVKeyIndexList, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified UserAgent message, length delimited. Does not implicitly {@link proto.UserAgent.verify|verify} messages. - * @param message UserAgent message or plain object to encode + * Encodes the specified ADVKeyIndexList message, length delimited. Does not implicitly {@link proto.ADVKeyIndexList.verify|verify} messages. + * @param message ADVKeyIndexList message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: proto.IUserAgent, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: proto.IADVKeyIndexList, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a UserAgent message from the specified reader or buffer. + * Decodes a ADVKeyIndexList message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns UserAgent + * @returns ADVKeyIndexList * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.UserAgent; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.ADVKeyIndexList; /** - * Decodes a UserAgent message from the specified reader or buffer, length delimited. + * Decodes a ADVKeyIndexList message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns UserAgent + * @returns ADVKeyIndexList * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.UserAgent; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.ADVKeyIndexList; /** - * Verifies a UserAgent message. + * Verifies a ADVKeyIndexList message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a UserAgent message from a plain object. Also converts values to their respective internal types. + * Creates a ADVKeyIndexList message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns UserAgent + * @returns ADVKeyIndexList */ - public static fromObject(object: { [k: string]: any }): proto.UserAgent; + public static fromObject(object: { [k: string]: any }): proto.ADVKeyIndexList; /** - * Creates a plain object from a UserAgent message. Also converts values to other types if specified. - * @param message UserAgent + * Creates a plain object from a ADVKeyIndexList message. Also converts values to other types if specified. + * @param message ADVKeyIndexList * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: proto.UserAgent, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: proto.ADVKeyIndexList, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this UserAgent to JSON. + * Converts this ADVKeyIndexList to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - namespace UserAgent { + /** Properties of a ADVSignedDeviceIdentity. */ + interface IADVSignedDeviceIdentity { - /** UserAgentPlatform enum. */ - enum UserAgentPlatform { - ANDROID = 0, - IOS = 1, - WINDOWS_PHONE = 2, - BLACKBERRY = 3, - BLACKBERRYX = 4, - S40 = 5, - S60 = 6, - PYTHON_CLIENT = 7, - TIZEN = 8, - ENTERPRISE = 9, - SMB_ANDROID = 10, - KAIOS = 11, - SMB_IOS = 12, - WINDOWS = 13, - WEB = 14, - PORTAL = 15, - GREEN_ANDROID = 16, - GREEN_IPHONE = 17, - BLUE_ANDROID = 18, - BLUE_IPHONE = 19, - FBLITE_ANDROID = 20, - MLITE_ANDROID = 21, - IGLITE_ANDROID = 22, - PAGE = 23, - MACOS = 24, - OCULUS_MSG = 25, - OCULUS_CALL = 26, - MILAN = 27, - CAPI = 28 - } - - /** UserAgentReleaseChannel enum. */ - enum UserAgentReleaseChannel { - RELEASE = 0, - BETA = 1, - ALPHA = 2, - DEBUG = 3 - } - } - - /** Properties of a WebdPayload. */ - interface IWebdPayload { - - /** WebdPayload usesParticipantInKey */ - usesParticipantInKey?: (boolean|null); - - /** WebdPayload supportsStarredMessages */ - supportsStarredMessages?: (boolean|null); - - /** WebdPayload supportsDocumentMessages */ - supportsDocumentMessages?: (boolean|null); - - /** WebdPayload supportsUrlMessages */ - supportsUrlMessages?: (boolean|null); - - /** WebdPayload supportsMediaRetry */ - supportsMediaRetry?: (boolean|null); - - /** WebdPayload supportsE2EImage */ - supportsE2EImage?: (boolean|null); - - /** WebdPayload supportsE2EVideo */ - supportsE2EVideo?: (boolean|null); - - /** WebdPayload supportsE2EAudio */ - supportsE2EAudio?: (boolean|null); + /** ADVSignedDeviceIdentity details */ + details?: (Uint8Array|null); - /** WebdPayload supportsE2EDocument */ - supportsE2EDocument?: (boolean|null); + /** ADVSignedDeviceIdentity accountSignatureKey */ + accountSignatureKey?: (Uint8Array|null); - /** WebdPayload documentTypes */ - documentTypes?: (string|null); + /** ADVSignedDeviceIdentity accountSignature */ + accountSignature?: (Uint8Array|null); - /** WebdPayload features */ - features?: (Uint8Array|null); + /** ADVSignedDeviceIdentity deviceSignature */ + deviceSignature?: (Uint8Array|null); } - /** Represents a WebdPayload. */ - class WebdPayload implements IWebdPayload { + /** Represents a ADVSignedDeviceIdentity. */ + class ADVSignedDeviceIdentity implements IADVSignedDeviceIdentity { /** - * Constructs a new WebdPayload. + * Constructs a new ADVSignedDeviceIdentity. * @param [properties] Properties to set */ - constructor(properties?: proto.IWebdPayload); - - /** WebdPayload usesParticipantInKey. */ - public usesParticipantInKey: boolean; - - /** WebdPayload supportsStarredMessages. */ - public supportsStarredMessages: boolean; - - /** WebdPayload supportsDocumentMessages. */ - public supportsDocumentMessages: boolean; - - /** WebdPayload supportsUrlMessages. */ - public supportsUrlMessages: boolean; - - /** WebdPayload supportsMediaRetry. */ - public supportsMediaRetry: boolean; - - /** WebdPayload supportsE2EImage. */ - public supportsE2EImage: boolean; - - /** WebdPayload supportsE2EVideo. */ - public supportsE2EVideo: boolean; + constructor(properties?: proto.IADVSignedDeviceIdentity); - /** WebdPayload supportsE2EAudio. */ - public supportsE2EAudio: boolean; + /** ADVSignedDeviceIdentity details. */ + public details: Uint8Array; - /** WebdPayload supportsE2EDocument. */ - public supportsE2EDocument: boolean; + /** ADVSignedDeviceIdentity accountSignatureKey. */ + public accountSignatureKey: Uint8Array; - /** WebdPayload documentTypes. */ - public documentTypes: string; + /** ADVSignedDeviceIdentity accountSignature. */ + public accountSignature: Uint8Array; - /** WebdPayload features. */ - public features: Uint8Array; + /** ADVSignedDeviceIdentity deviceSignature. */ + public deviceSignature: Uint8Array; /** - * Creates a new WebdPayload instance using the specified properties. + * Creates a new ADVSignedDeviceIdentity instance using the specified properties. * @param [properties] Properties to set - * @returns WebdPayload instance + * @returns ADVSignedDeviceIdentity instance */ - public static create(properties?: proto.IWebdPayload): proto.WebdPayload; + public static create(properties?: proto.IADVSignedDeviceIdentity): proto.ADVSignedDeviceIdentity; /** - * Encodes the specified WebdPayload message. Does not implicitly {@link proto.WebdPayload.verify|verify} messages. - * @param message WebdPayload message or plain object to encode + * Encodes the specified ADVSignedDeviceIdentity message. Does not implicitly {@link proto.ADVSignedDeviceIdentity.verify|verify} messages. + * @param message ADVSignedDeviceIdentity message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: proto.IWebdPayload, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: proto.IADVSignedDeviceIdentity, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified WebdPayload message, length delimited. Does not implicitly {@link proto.WebdPayload.verify|verify} messages. - * @param message WebdPayload message or plain object to encode + * Encodes the specified ADVSignedDeviceIdentity message, length delimited. Does not implicitly {@link proto.ADVSignedDeviceIdentity.verify|verify} messages. + * @param message ADVSignedDeviceIdentity message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: proto.IWebdPayload, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: proto.IADVSignedDeviceIdentity, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a WebdPayload message from the specified reader or buffer. + * Decodes a ADVSignedDeviceIdentity message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns WebdPayload + * @returns ADVSignedDeviceIdentity * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.WebdPayload; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.ADVSignedDeviceIdentity; /** - * Decodes a WebdPayload message from the specified reader or buffer, length delimited. + * Decodes a ADVSignedDeviceIdentity message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns WebdPayload + * @returns ADVSignedDeviceIdentity * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.WebdPayload; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.ADVSignedDeviceIdentity; /** - * Verifies a WebdPayload message. + * Verifies a ADVSignedDeviceIdentity message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a WebdPayload message from a plain object. Also converts values to their respective internal types. + * Creates a ADVSignedDeviceIdentity message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns WebdPayload + * @returns ADVSignedDeviceIdentity */ - public static fromObject(object: { [k: string]: any }): proto.WebdPayload; + public static fromObject(object: { [k: string]: any }): proto.ADVSignedDeviceIdentity; /** - * Creates a plain object from a WebdPayload message. Also converts values to other types if specified. - * @param message WebdPayload + * Creates a plain object from a ADVSignedDeviceIdentity message. Also converts values to other types if specified. + * @param message ADVSignedDeviceIdentity * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: proto.WebdPayload, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: proto.ADVSignedDeviceIdentity, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this WebdPayload to JSON. + * Converts this ADVSignedDeviceIdentity to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a WebInfo. */ - interface IWebInfo { - - /** WebInfo refToken */ - refToken?: (string|null); - - /** WebInfo version */ - version?: (string|null); + /** Properties of a ADVSignedDeviceIdentityHMAC. */ + interface IADVSignedDeviceIdentityHMAC { - /** WebInfo webdPayload */ - webdPayload?: (proto.IWebdPayload|null); + /** ADVSignedDeviceIdentityHMAC details */ + details?: (Uint8Array|null); - /** WebInfo webSubPlatform */ - webSubPlatform?: (proto.WebInfo.WebInfoWebSubPlatform|null); + /** ADVSignedDeviceIdentityHMAC hmac */ + hmac?: (Uint8Array|null); } - /** Represents a WebInfo. */ - class WebInfo implements IWebInfo { + /** Represents a ADVSignedDeviceIdentityHMAC. */ + class ADVSignedDeviceIdentityHMAC implements IADVSignedDeviceIdentityHMAC { /** - * Constructs a new WebInfo. + * Constructs a new ADVSignedDeviceIdentityHMAC. * @param [properties] Properties to set */ - constructor(properties?: proto.IWebInfo); - - /** WebInfo refToken. */ - public refToken: string; - - /** WebInfo version. */ - public version: string; + constructor(properties?: proto.IADVSignedDeviceIdentityHMAC); - /** WebInfo webdPayload. */ - public webdPayload?: (proto.IWebdPayload|null); + /** ADVSignedDeviceIdentityHMAC details. */ + public details: Uint8Array; - /** WebInfo webSubPlatform. */ - public webSubPlatform: proto.WebInfo.WebInfoWebSubPlatform; + /** ADVSignedDeviceIdentityHMAC hmac. */ + public hmac: Uint8Array; /** - * Creates a new WebInfo instance using the specified properties. + * Creates a new ADVSignedDeviceIdentityHMAC instance using the specified properties. * @param [properties] Properties to set - * @returns WebInfo instance + * @returns ADVSignedDeviceIdentityHMAC instance */ - public static create(properties?: proto.IWebInfo): proto.WebInfo; + public static create(properties?: proto.IADVSignedDeviceIdentityHMAC): proto.ADVSignedDeviceIdentityHMAC; /** - * Encodes the specified WebInfo message. Does not implicitly {@link proto.WebInfo.verify|verify} messages. - * @param message WebInfo message or plain object to encode + * Encodes the specified ADVSignedDeviceIdentityHMAC message. Does not implicitly {@link proto.ADVSignedDeviceIdentityHMAC.verify|verify} messages. + * @param message ADVSignedDeviceIdentityHMAC message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: proto.IWebInfo, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: proto.IADVSignedDeviceIdentityHMAC, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified WebInfo message, length delimited. Does not implicitly {@link proto.WebInfo.verify|verify} messages. - * @param message WebInfo message or plain object to encode + * Encodes the specified ADVSignedDeviceIdentityHMAC message, length delimited. Does not implicitly {@link proto.ADVSignedDeviceIdentityHMAC.verify|verify} messages. + * @param message ADVSignedDeviceIdentityHMAC message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: proto.IWebInfo, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: proto.IADVSignedDeviceIdentityHMAC, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a WebInfo message from the specified reader or buffer. + * Decodes a ADVSignedDeviceIdentityHMAC message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns WebInfo + * @returns ADVSignedDeviceIdentityHMAC * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.WebInfo; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.ADVSignedDeviceIdentityHMAC; /** - * Decodes a WebInfo message from the specified reader or buffer, length delimited. + * Decodes a ADVSignedDeviceIdentityHMAC message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns WebInfo + * @returns ADVSignedDeviceIdentityHMAC * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.WebInfo; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.ADVSignedDeviceIdentityHMAC; /** - * Verifies a WebInfo message. + * Verifies a ADVSignedDeviceIdentityHMAC message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a WebInfo message from a plain object. Also converts values to their respective internal types. + * Creates a ADVSignedDeviceIdentityHMAC message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns WebInfo + * @returns ADVSignedDeviceIdentityHMAC */ - public static fromObject(object: { [k: string]: any }): proto.WebInfo; + public static fromObject(object: { [k: string]: any }): proto.ADVSignedDeviceIdentityHMAC; /** - * Creates a plain object from a WebInfo message. Also converts values to other types if specified. - * @param message WebInfo + * Creates a plain object from a ADVSignedDeviceIdentityHMAC message. Also converts values to other types if specified. + * @param message ADVSignedDeviceIdentityHMAC * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: proto.WebInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: proto.ADVSignedDeviceIdentityHMAC, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this WebInfo to JSON. + * Converts this ADVSignedDeviceIdentityHMAC to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - namespace WebInfo { + /** Properties of a ADVSignedKeyIndexList. */ + interface IADVSignedKeyIndexList { - /** WebInfoWebSubPlatform enum. */ - enum WebInfoWebSubPlatform { - WEB_BROWSER = 0, - APP_STORE = 1, - WIN_STORE = 2, - DARWIN = 3, - WIN32 = 4 - } - } - - /** Properties of a DNSSource. */ - interface IDNSSource { - - /** DNSSource dnsMethod */ - dnsMethod?: (proto.DNSSource.DNSSourceDNSResolutionMethod|null); + /** ADVSignedKeyIndexList details */ + details?: (Uint8Array|null); - /** DNSSource appCached */ - appCached?: (boolean|null); + /** ADVSignedKeyIndexList accountSignature */ + accountSignature?: (Uint8Array|null); } - /** Represents a DNSSource. */ - class DNSSource implements IDNSSource { + /** Represents a ADVSignedKeyIndexList. */ + class ADVSignedKeyIndexList implements IADVSignedKeyIndexList { /** - * Constructs a new DNSSource. + * Constructs a new ADVSignedKeyIndexList. * @param [properties] Properties to set */ - constructor(properties?: proto.IDNSSource); + constructor(properties?: proto.IADVSignedKeyIndexList); - /** DNSSource dnsMethod. */ - public dnsMethod: proto.DNSSource.DNSSourceDNSResolutionMethod; + /** ADVSignedKeyIndexList details. */ + public details: Uint8Array; - /** DNSSource appCached. */ - public appCached: boolean; + /** ADVSignedKeyIndexList accountSignature. */ + public accountSignature: Uint8Array; /** - * Creates a new DNSSource instance using the specified properties. + * Creates a new ADVSignedKeyIndexList instance using the specified properties. * @param [properties] Properties to set - * @returns DNSSource instance + * @returns ADVSignedKeyIndexList instance */ - public static create(properties?: proto.IDNSSource): proto.DNSSource; + public static create(properties?: proto.IADVSignedKeyIndexList): proto.ADVSignedKeyIndexList; /** - * Encodes the specified DNSSource message. Does not implicitly {@link proto.DNSSource.verify|verify} messages. - * @param message DNSSource message or plain object to encode + * Encodes the specified ADVSignedKeyIndexList message. Does not implicitly {@link proto.ADVSignedKeyIndexList.verify|verify} messages. + * @param message ADVSignedKeyIndexList message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: proto.IDNSSource, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: proto.IADVSignedKeyIndexList, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified DNSSource message, length delimited. Does not implicitly {@link proto.DNSSource.verify|verify} messages. - * @param message DNSSource message or plain object to encode + * Encodes the specified ADVSignedKeyIndexList message, length delimited. Does not implicitly {@link proto.ADVSignedKeyIndexList.verify|verify} messages. + * @param message ADVSignedKeyIndexList message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: proto.IDNSSource, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: proto.IADVSignedKeyIndexList, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a DNSSource message from the specified reader or buffer. + * Decodes a ADVSignedKeyIndexList message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns DNSSource + * @returns ADVSignedKeyIndexList * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.DNSSource; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.ADVSignedKeyIndexList; /** - * Decodes a DNSSource message from the specified reader or buffer, length delimited. + * Decodes a ADVSignedKeyIndexList message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns DNSSource + * @returns ADVSignedKeyIndexList * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.DNSSource; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.ADVSignedKeyIndexList; /** - * Verifies a DNSSource message. + * Verifies a ADVSignedKeyIndexList message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a DNSSource message from a plain object. Also converts values to their respective internal types. + * Creates a ADVSignedKeyIndexList message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns DNSSource + * @returns ADVSignedKeyIndexList */ - public static fromObject(object: { [k: string]: any }): proto.DNSSource; + public static fromObject(object: { [k: string]: any }): proto.ADVSignedKeyIndexList; /** - * Creates a plain object from a DNSSource message. Also converts values to other types if specified. - * @param message DNSSource + * Creates a plain object from a ADVSignedKeyIndexList message. Also converts values to other types if specified. + * @param message ADVSignedKeyIndexList * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: proto.DNSSource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: proto.ADVSignedKeyIndexList, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this DNSSource to JSON. + * Converts this ADVSignedKeyIndexList to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - namespace DNSSource { - - /** DNSSourceDNSResolutionMethod enum. */ - enum DNSSourceDNSResolutionMethod { - SYSTEM = 0, - GOOGLE = 1, - HARDCODED = 2, - OVERRIDE = 3, - FALLBACK = 4 - } - } - - /** Properties of a CompanionRegData. */ - interface ICompanionRegData { - - /** CompanionRegData eRegid */ - eRegid?: (Uint8Array|null); - - /** CompanionRegData eKeytype */ - eKeytype?: (Uint8Array|null); - - /** CompanionRegData eIdent */ - eIdent?: (Uint8Array|null); + /** Properties of an AppVersion. */ + interface IAppVersion { - /** CompanionRegData eSkeyId */ - eSkeyId?: (Uint8Array|null); + /** AppVersion primary */ + primary?: (number|null); - /** CompanionRegData eSkeyVal */ - eSkeyVal?: (Uint8Array|null); + /** AppVersion secondary */ + secondary?: (number|null); - /** CompanionRegData eSkeySig */ - eSkeySig?: (Uint8Array|null); + /** AppVersion tertiary */ + tertiary?: (number|null); - /** CompanionRegData buildHash */ - buildHash?: (Uint8Array|null); + /** AppVersion quaternary */ + quaternary?: (number|null); - /** CompanionRegData companionProps */ - companionProps?: (Uint8Array|null); + /** AppVersion quinary */ + quinary?: (number|null); } - /** Represents a CompanionRegData. */ - class CompanionRegData implements ICompanionRegData { + /** Represents an AppVersion. */ + class AppVersion implements IAppVersion { /** - * Constructs a new CompanionRegData. + * Constructs a new AppVersion. * @param [properties] Properties to set */ - constructor(properties?: proto.ICompanionRegData); - - /** CompanionRegData eRegid. */ - public eRegid: Uint8Array; - - /** CompanionRegData eKeytype. */ - public eKeytype: Uint8Array; - - /** CompanionRegData eIdent. */ - public eIdent: Uint8Array; + constructor(properties?: proto.IAppVersion); - /** CompanionRegData eSkeyId. */ - public eSkeyId: Uint8Array; + /** AppVersion primary. */ + public primary: number; - /** CompanionRegData eSkeyVal. */ - public eSkeyVal: Uint8Array; + /** AppVersion secondary. */ + public secondary: number; - /** CompanionRegData eSkeySig. */ - public eSkeySig: Uint8Array; + /** AppVersion tertiary. */ + public tertiary: number; - /** CompanionRegData buildHash. */ - public buildHash: Uint8Array; + /** AppVersion quaternary. */ + public quaternary: number; - /** CompanionRegData companionProps. */ - public companionProps: Uint8Array; + /** AppVersion quinary. */ + public quinary: number; /** - * Creates a new CompanionRegData instance using the specified properties. + * Creates a new AppVersion instance using the specified properties. * @param [properties] Properties to set - * @returns CompanionRegData instance + * @returns AppVersion instance */ - public static create(properties?: proto.ICompanionRegData): proto.CompanionRegData; + public static create(properties?: proto.IAppVersion): proto.AppVersion; /** - * Encodes the specified CompanionRegData message. Does not implicitly {@link proto.CompanionRegData.verify|verify} messages. - * @param message CompanionRegData message or plain object to encode + * Encodes the specified AppVersion message. Does not implicitly {@link proto.AppVersion.verify|verify} messages. + * @param message AppVersion message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: proto.ICompanionRegData, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: proto.IAppVersion, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified CompanionRegData message, length delimited. Does not implicitly {@link proto.CompanionRegData.verify|verify} messages. - * @param message CompanionRegData message or plain object to encode + * Encodes the specified AppVersion message, length delimited. Does not implicitly {@link proto.AppVersion.verify|verify} messages. + * @param message AppVersion message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: proto.ICompanionRegData, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: proto.IAppVersion, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a CompanionRegData message from the specified reader or buffer. + * Decodes an AppVersion message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns CompanionRegData + * @returns AppVersion * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.CompanionRegData; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.AppVersion; /** - * Decodes a CompanionRegData message from the specified reader or buffer, length delimited. + * Decodes an AppVersion message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns CompanionRegData + * @returns AppVersion * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.CompanionRegData; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.AppVersion; /** - * Verifies a CompanionRegData message. + * Verifies an AppVersion message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a CompanionRegData message from a plain object. Also converts values to their respective internal types. + * Creates an AppVersion message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns CompanionRegData + * @returns AppVersion */ - public static fromObject(object: { [k: string]: any }): proto.CompanionRegData; + public static fromObject(object: { [k: string]: any }): proto.AppVersion; /** - * Creates a plain object from a CompanionRegData message. Also converts values to other types if specified. - * @param message CompanionRegData + * Creates a plain object from an AppVersion message. Also converts values to other types if specified. + * @param message AppVersion * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: proto.CompanionRegData, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: proto.AppVersion, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this CompanionRegData to JSON. + * Converts this AppVersion to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a ClientPayload. */ - interface IClientPayload { - - /** ClientPayload username */ - username?: (number|Long|null); - - /** ClientPayload passive */ - passive?: (boolean|null); + /** Properties of a CompanionProps. */ + interface ICompanionProps { - /** ClientPayload userAgent */ - userAgent?: (proto.IUserAgent|null); + /** CompanionProps os */ + os?: (string|null); - /** ClientPayload webInfo */ - webInfo?: (proto.IWebInfo|null); + /** CompanionProps version */ + version?: (proto.IAppVersion|null); - /** ClientPayload pushName */ - pushName?: (string|null); + /** CompanionProps platformType */ + platformType?: (proto.CompanionProps.CompanionPropsPlatformType|null); - /** ClientPayload sessionId */ - sessionId?: (number|null); + /** CompanionProps requireFullSync */ + requireFullSync?: (boolean|null); + } - /** ClientPayload shortConnect */ - shortConnect?: (boolean|null); + /** Represents a CompanionProps. */ + class CompanionProps implements ICompanionProps { - /** ClientPayload connectType */ - connectType?: (proto.ClientPayload.ClientPayloadConnectType|null); + /** + * Constructs a new CompanionProps. + * @param [properties] Properties to set + */ + constructor(properties?: proto.ICompanionProps); - /** ClientPayload connectReason */ - connectReason?: (proto.ClientPayload.ClientPayloadConnectReason|null); + /** CompanionProps os. */ + public os: string; - /** ClientPayload shards */ - shards?: (number[]|null); + /** CompanionProps version. */ + public version?: (proto.IAppVersion|null); - /** ClientPayload dnsSource */ - dnsSource?: (proto.IDNSSource|null); + /** CompanionProps platformType. */ + public platformType: proto.CompanionProps.CompanionPropsPlatformType; - /** ClientPayload connectAttemptCount */ - connectAttemptCount?: (number|null); - - /** ClientPayload device */ - device?: (number|null); - - /** ClientPayload regData */ - regData?: (proto.ICompanionRegData|null); - - /** ClientPayload product */ - product?: (proto.ClientPayload.ClientPayloadProduct|null); - - /** ClientPayload fbCat */ - fbCat?: (Uint8Array|null); - - /** ClientPayload fbUserAgent */ - fbUserAgent?: (Uint8Array|null); - - /** ClientPayload oc */ - oc?: (boolean|null); - - /** ClientPayload lc */ - lc?: (number|null); - - /** ClientPayload iosAppExtension */ - iosAppExtension?: (proto.ClientPayload.ClientPayloadIOSAppExtension|null); - - /** ClientPayload fbAppId */ - fbAppId?: (number|Long|null); - - /** ClientPayload fbDeviceId */ - fbDeviceId?: (Uint8Array|null); - } - - /** Represents a ClientPayload. */ - class ClientPayload implements IClientPayload { + /** CompanionProps requireFullSync. */ + public requireFullSync: boolean; /** - * Constructs a new ClientPayload. + * Creates a new CompanionProps instance using the specified properties. * @param [properties] Properties to set + * @returns CompanionProps instance */ - constructor(properties?: proto.IClientPayload); - - /** ClientPayload username. */ - public username: (number|Long); - - /** ClientPayload passive. */ - public passive: boolean; - - /** ClientPayload userAgent. */ - public userAgent?: (proto.IUserAgent|null); - - /** ClientPayload webInfo. */ - public webInfo?: (proto.IWebInfo|null); - - /** ClientPayload pushName. */ - public pushName: string; + public static create(properties?: proto.ICompanionProps): proto.CompanionProps; - /** ClientPayload sessionId. */ - public sessionId: number; + /** + * Encodes the specified CompanionProps message. Does not implicitly {@link proto.CompanionProps.verify|verify} messages. + * @param message CompanionProps message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: proto.ICompanionProps, writer?: $protobuf.Writer): $protobuf.Writer; - /** ClientPayload shortConnect. */ - public shortConnect: boolean; + /** + * Encodes the specified CompanionProps message, length delimited. Does not implicitly {@link proto.CompanionProps.verify|verify} messages. + * @param message CompanionProps message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: proto.ICompanionProps, writer?: $protobuf.Writer): $protobuf.Writer; - /** ClientPayload connectType. */ - public connectType: proto.ClientPayload.ClientPayloadConnectType; + /** + * Decodes a CompanionProps message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CompanionProps + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.CompanionProps; - /** ClientPayload connectReason. */ - public connectReason: proto.ClientPayload.ClientPayloadConnectReason; + /** + * Decodes a CompanionProps message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CompanionProps + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.CompanionProps; - /** ClientPayload shards. */ - public shards: number[]; + /** + * Verifies a CompanionProps message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** ClientPayload dnsSource. */ - public dnsSource?: (proto.IDNSSource|null); + /** + * Creates a CompanionProps message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CompanionProps + */ + public static fromObject(object: { [k: string]: any }): proto.CompanionProps; - /** ClientPayload connectAttemptCount. */ - public connectAttemptCount: number; + /** + * Creates a plain object from a CompanionProps message. Also converts values to other types if specified. + * @param message CompanionProps + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: proto.CompanionProps, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** ClientPayload device. */ - public device: number; + /** + * Converts this CompanionProps to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** ClientPayload regData. */ - public regData?: (proto.ICompanionRegData|null); + namespace CompanionProps { - /** ClientPayload product. */ - public product: proto.ClientPayload.ClientPayloadProduct; + /** CompanionPropsPlatformType enum. */ + enum CompanionPropsPlatformType { + UNKNOWN = 0, + CHROME = 1, + FIREFOX = 2, + IE = 3, + OPERA = 4, + SAFARI = 5, + EDGE = 6, + DESKTOP = 7, + IPAD = 8, + ANDROID_TABLET = 9, + OHANA = 10, + ALOHA = 11, + CATALINA = 12 + } + } - /** ClientPayload fbCat. */ - public fbCat: Uint8Array; + /** Properties of an ActionLink. */ + interface IActionLink { - /** ClientPayload fbUserAgent. */ - public fbUserAgent: Uint8Array; + /** ActionLink url */ + url?: (string|null); - /** ClientPayload oc. */ - public oc: boolean; + /** ActionLink buttonTitle */ + buttonTitle?: (string|null); + } - /** ClientPayload lc. */ - public lc: number; + /** Represents an ActionLink. */ + class ActionLink implements IActionLink { - /** ClientPayload iosAppExtension. */ - public iosAppExtension: proto.ClientPayload.ClientPayloadIOSAppExtension; + /** + * Constructs a new ActionLink. + * @param [properties] Properties to set + */ + constructor(properties?: proto.IActionLink); - /** ClientPayload fbAppId. */ - public fbAppId: (number|Long); + /** ActionLink url. */ + public url: string; - /** ClientPayload fbDeviceId. */ - public fbDeviceId: Uint8Array; + /** ActionLink buttonTitle. */ + public buttonTitle: string; /** - * Creates a new ClientPayload instance using the specified properties. + * Creates a new ActionLink instance using the specified properties. * @param [properties] Properties to set - * @returns ClientPayload instance + * @returns ActionLink instance */ - public static create(properties?: proto.IClientPayload): proto.ClientPayload; + public static create(properties?: proto.IActionLink): proto.ActionLink; /** - * Encodes the specified ClientPayload message. Does not implicitly {@link proto.ClientPayload.verify|verify} messages. - * @param message ClientPayload message or plain object to encode + * Encodes the specified ActionLink message. Does not implicitly {@link proto.ActionLink.verify|verify} messages. + * @param message ActionLink message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: proto.IClientPayload, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: proto.IActionLink, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ClientPayload message, length delimited. Does not implicitly {@link proto.ClientPayload.verify|verify} messages. - * @param message ClientPayload message or plain object to encode + * Encodes the specified ActionLink message, length delimited. Does not implicitly {@link proto.ActionLink.verify|verify} messages. + * @param message ActionLink message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: proto.IClientPayload, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: proto.IActionLink, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ClientPayload message from the specified reader or buffer. + * Decodes an ActionLink message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ClientPayload + * @returns ActionLink * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.ClientPayload; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.ActionLink; /** - * Decodes a ClientPayload message from the specified reader or buffer, length delimited. + * Decodes an ActionLink message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ClientPayload + * @returns ActionLink * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.ClientPayload; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.ActionLink; /** - * Verifies a ClientPayload message. + * Verifies an ActionLink message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a ClientPayload message from a plain object. Also converts values to their respective internal types. + * Creates an ActionLink message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ClientPayload + * @returns ActionLink */ - public static fromObject(object: { [k: string]: any }): proto.ClientPayload; + public static fromObject(object: { [k: string]: any }): proto.ActionLink; /** - * Creates a plain object from a ClientPayload message. Also converts values to other types if specified. - * @param message ClientPayload + * Creates a plain object from an ActionLink message. Also converts values to other types if specified. + * @param message ActionLink * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: proto.ClientPayload, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: proto.ActionLink, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ClientPayload to JSON. + * Converts this ActionLink to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - namespace ClientPayload { + /** Properties of an AdReplyInfo. */ + interface IAdReplyInfo { - /** ClientPayloadConnectType enum. */ - enum ClientPayloadConnectType { - CELLULAR_UNKNOWN = 0, - WIFI_UNKNOWN = 1, - CELLULAR_EDGE = 100, - CELLULAR_IDEN = 101, - CELLULAR_UMTS = 102, - CELLULAR_EVDO = 103, - CELLULAR_GPRS = 104, - CELLULAR_HSDPA = 105, - CELLULAR_HSUPA = 106, - CELLULAR_HSPA = 107, - CELLULAR_CDMA = 108, - CELLULAR_1XRTT = 109, - CELLULAR_EHRPD = 110, - CELLULAR_LTE = 111, - CELLULAR_HSPAP = 112 - } + /** AdReplyInfo advertiserName */ + advertiserName?: (string|null); - /** ClientPayloadConnectReason enum. */ - enum ClientPayloadConnectReason { - PUSH = 0, - USER_ACTIVATED = 1, - SCHEDULED = 2, - ERROR_RECONNECT = 3, - NETWORK_SWITCH = 4, - PING_RECONNECT = 5 - } - - /** ClientPayloadProduct enum. */ - enum ClientPayloadProduct { - WHATSAPP = 0, - MESSENGER = 1 - } - - /** ClientPayloadIOSAppExtension enum. */ - enum ClientPayloadIOSAppExtension { - SHARE_EXTENSION = 0, - SERVICE_EXTENSION = 1, - INTENTS_EXTENSION = 2 - } - } - - /** Properties of a NoiseCertificateDetails. */ - interface INoiseCertificateDetails { - - /** NoiseCertificateDetails serial */ - serial?: (number|null); - - /** NoiseCertificateDetails issuer */ - issuer?: (string|null); - - /** NoiseCertificateDetails expires */ - expires?: (number|Long|null); + /** AdReplyInfo mediaType */ + mediaType?: (proto.AdReplyInfo.AdReplyInfoMediaType|null); - /** NoiseCertificateDetails subject */ - subject?: (string|null); + /** AdReplyInfo jpegThumbnail */ + jpegThumbnail?: (Uint8Array|null); - /** NoiseCertificateDetails key */ - key?: (Uint8Array|null); + /** AdReplyInfo caption */ + caption?: (string|null); } - /** Represents a NoiseCertificateDetails. */ - class NoiseCertificateDetails implements INoiseCertificateDetails { + /** Represents an AdReplyInfo. */ + class AdReplyInfo implements IAdReplyInfo { /** - * Constructs a new NoiseCertificateDetails. + * Constructs a new AdReplyInfo. * @param [properties] Properties to set */ - constructor(properties?: proto.INoiseCertificateDetails); - - /** NoiseCertificateDetails serial. */ - public serial: number; + constructor(properties?: proto.IAdReplyInfo); - /** NoiseCertificateDetails issuer. */ - public issuer: string; + /** AdReplyInfo advertiserName. */ + public advertiserName: string; - /** NoiseCertificateDetails expires. */ - public expires: (number|Long); + /** AdReplyInfo mediaType. */ + public mediaType: proto.AdReplyInfo.AdReplyInfoMediaType; - /** NoiseCertificateDetails subject. */ - public subject: string; + /** AdReplyInfo jpegThumbnail. */ + public jpegThumbnail: Uint8Array; - /** NoiseCertificateDetails key. */ - public key: Uint8Array; + /** AdReplyInfo caption. */ + public caption: string; /** - * Creates a new NoiseCertificateDetails instance using the specified properties. + * Creates a new AdReplyInfo instance using the specified properties. * @param [properties] Properties to set - * @returns NoiseCertificateDetails instance + * @returns AdReplyInfo instance */ - public static create(properties?: proto.INoiseCertificateDetails): proto.NoiseCertificateDetails; + public static create(properties?: proto.IAdReplyInfo): proto.AdReplyInfo; /** - * Encodes the specified NoiseCertificateDetails message. Does not implicitly {@link proto.NoiseCertificateDetails.verify|verify} messages. - * @param message NoiseCertificateDetails message or plain object to encode + * Encodes the specified AdReplyInfo message. Does not implicitly {@link proto.AdReplyInfo.verify|verify} messages. + * @param message AdReplyInfo message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: proto.INoiseCertificateDetails, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: proto.IAdReplyInfo, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified NoiseCertificateDetails message, length delimited. Does not implicitly {@link proto.NoiseCertificateDetails.verify|verify} messages. - * @param message NoiseCertificateDetails message or plain object to encode + * Encodes the specified AdReplyInfo message, length delimited. Does not implicitly {@link proto.AdReplyInfo.verify|verify} messages. + * @param message AdReplyInfo message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: proto.INoiseCertificateDetails, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: proto.IAdReplyInfo, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a NoiseCertificateDetails message from the specified reader or buffer. + * Decodes an AdReplyInfo message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns NoiseCertificateDetails + * @returns AdReplyInfo * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.NoiseCertificateDetails; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.AdReplyInfo; /** - * Decodes a NoiseCertificateDetails message from the specified reader or buffer, length delimited. + * Decodes an AdReplyInfo message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns NoiseCertificateDetails + * @returns AdReplyInfo * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.NoiseCertificateDetails; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.AdReplyInfo; /** - * Verifies a NoiseCertificateDetails message. + * Verifies an AdReplyInfo message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a NoiseCertificateDetails message from a plain object. Also converts values to their respective internal types. + * Creates an AdReplyInfo message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns NoiseCertificateDetails + * @returns AdReplyInfo */ - public static fromObject(object: { [k: string]: any }): proto.NoiseCertificateDetails; + public static fromObject(object: { [k: string]: any }): proto.AdReplyInfo; /** - * Creates a plain object from a NoiseCertificateDetails message. Also converts values to other types if specified. - * @param message NoiseCertificateDetails + * Creates a plain object from an AdReplyInfo message. Also converts values to other types if specified. + * @param message AdReplyInfo * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: proto.NoiseCertificateDetails, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: proto.AdReplyInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this NoiseCertificateDetails to JSON. + * Converts this AdReplyInfo to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a NoiseCertificate. */ - interface INoiseCertificate { + namespace AdReplyInfo { - /** NoiseCertificate details */ - details?: (Uint8Array|null); + /** AdReplyInfoMediaType enum. */ + enum AdReplyInfoMediaType { + NONE = 0, + IMAGE = 1, + VIDEO = 2 + } + } - /** NoiseCertificate signature */ - signature?: (Uint8Array|null); + /** Properties of an AppStateFatalExceptionNotification. */ + interface IAppStateFatalExceptionNotification { + + /** AppStateFatalExceptionNotification collectionNames */ + collectionNames?: (string[]|null); + + /** AppStateFatalExceptionNotification timestamp */ + timestamp?: (number|Long|null); } - /** Represents a NoiseCertificate. */ - class NoiseCertificate implements INoiseCertificate { + /** Represents an AppStateFatalExceptionNotification. */ + class AppStateFatalExceptionNotification implements IAppStateFatalExceptionNotification { /** - * Constructs a new NoiseCertificate. + * Constructs a new AppStateFatalExceptionNotification. * @param [properties] Properties to set */ - constructor(properties?: proto.INoiseCertificate); + constructor(properties?: proto.IAppStateFatalExceptionNotification); - /** NoiseCertificate details. */ - public details: Uint8Array; + /** AppStateFatalExceptionNotification collectionNames. */ + public collectionNames: string[]; - /** NoiseCertificate signature. */ - public signature: Uint8Array; + /** AppStateFatalExceptionNotification timestamp. */ + public timestamp: (number|Long); /** - * Creates a new NoiseCertificate instance using the specified properties. + * Creates a new AppStateFatalExceptionNotification instance using the specified properties. * @param [properties] Properties to set - * @returns NoiseCertificate instance + * @returns AppStateFatalExceptionNotification instance */ - public static create(properties?: proto.INoiseCertificate): proto.NoiseCertificate; + public static create(properties?: proto.IAppStateFatalExceptionNotification): proto.AppStateFatalExceptionNotification; /** - * Encodes the specified NoiseCertificate message. Does not implicitly {@link proto.NoiseCertificate.verify|verify} messages. - * @param message NoiseCertificate message or plain object to encode + * Encodes the specified AppStateFatalExceptionNotification message. Does not implicitly {@link proto.AppStateFatalExceptionNotification.verify|verify} messages. + * @param message AppStateFatalExceptionNotification message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: proto.INoiseCertificate, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: proto.IAppStateFatalExceptionNotification, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified NoiseCertificate message, length delimited. Does not implicitly {@link proto.NoiseCertificate.verify|verify} messages. - * @param message NoiseCertificate message or plain object to encode + * Encodes the specified AppStateFatalExceptionNotification message, length delimited. Does not implicitly {@link proto.AppStateFatalExceptionNotification.verify|verify} messages. + * @param message AppStateFatalExceptionNotification message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: proto.INoiseCertificate, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: proto.IAppStateFatalExceptionNotification, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a NoiseCertificate message from the specified reader or buffer. + * Decodes an AppStateFatalExceptionNotification message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns NoiseCertificate + * @returns AppStateFatalExceptionNotification * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.NoiseCertificate; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.AppStateFatalExceptionNotification; /** - * Decodes a NoiseCertificate message from the specified reader or buffer, length delimited. + * Decodes an AppStateFatalExceptionNotification message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns NoiseCertificate + * @returns AppStateFatalExceptionNotification * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.NoiseCertificate; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.AppStateFatalExceptionNotification; /** - * Verifies a NoiseCertificate message. + * Verifies an AppStateFatalExceptionNotification message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a NoiseCertificate message from a plain object. Also converts values to their respective internal types. + * Creates an AppStateFatalExceptionNotification message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns NoiseCertificate + * @returns AppStateFatalExceptionNotification */ - public static fromObject(object: { [k: string]: any }): proto.NoiseCertificate; + public static fromObject(object: { [k: string]: any }): proto.AppStateFatalExceptionNotification; /** - * Creates a plain object from a NoiseCertificate message. Also converts values to other types if specified. - * @param message NoiseCertificate + * Creates a plain object from an AppStateFatalExceptionNotification message. Also converts values to other types if specified. + * @param message AppStateFatalExceptionNotification * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: proto.NoiseCertificate, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: proto.AppStateFatalExceptionNotification, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this NoiseCertificate to JSON. + * Converts this AppStateFatalExceptionNotification to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a ClientHello. */ - interface IClientHello { - - /** ClientHello ephemeral */ - ephemeral?: (Uint8Array|null); + /** Properties of an AppStateSyncKey. */ + interface IAppStateSyncKey { - /** ClientHello static */ - "static"?: (Uint8Array|null); + /** AppStateSyncKey keyId */ + keyId?: (proto.IAppStateSyncKeyId|null); - /** ClientHello payload */ - payload?: (Uint8Array|null); + /** AppStateSyncKey keyData */ + keyData?: (proto.IAppStateSyncKeyData|null); } - /** Represents a ClientHello. */ - class ClientHello implements IClientHello { + /** Represents an AppStateSyncKey. */ + class AppStateSyncKey implements IAppStateSyncKey { /** - * Constructs a new ClientHello. + * Constructs a new AppStateSyncKey. * @param [properties] Properties to set */ - constructor(properties?: proto.IClientHello); - - /** ClientHello ephemeral. */ - public ephemeral: Uint8Array; + constructor(properties?: proto.IAppStateSyncKey); - /** ClientHello static. */ - public static: Uint8Array; + /** AppStateSyncKey keyId. */ + public keyId?: (proto.IAppStateSyncKeyId|null); - /** ClientHello payload. */ - public payload: Uint8Array; + /** AppStateSyncKey keyData. */ + public keyData?: (proto.IAppStateSyncKeyData|null); /** - * Creates a new ClientHello instance using the specified properties. + * Creates a new AppStateSyncKey instance using the specified properties. * @param [properties] Properties to set - * @returns ClientHello instance + * @returns AppStateSyncKey instance */ - public static create(properties?: proto.IClientHello): proto.ClientHello; + public static create(properties?: proto.IAppStateSyncKey): proto.AppStateSyncKey; /** - * Encodes the specified ClientHello message. Does not implicitly {@link proto.ClientHello.verify|verify} messages. - * @param message ClientHello message or plain object to encode + * Encodes the specified AppStateSyncKey message. Does not implicitly {@link proto.AppStateSyncKey.verify|verify} messages. + * @param message AppStateSyncKey message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: proto.IClientHello, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: proto.IAppStateSyncKey, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ClientHello message, length delimited. Does not implicitly {@link proto.ClientHello.verify|verify} messages. - * @param message ClientHello message or plain object to encode + * Encodes the specified AppStateSyncKey message, length delimited. Does not implicitly {@link proto.AppStateSyncKey.verify|verify} messages. + * @param message AppStateSyncKey message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: proto.IClientHello, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: proto.IAppStateSyncKey, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ClientHello message from the specified reader or buffer. + * Decodes an AppStateSyncKey message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ClientHello + * @returns AppStateSyncKey * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.ClientHello; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.AppStateSyncKey; /** - * Decodes a ClientHello message from the specified reader or buffer, length delimited. + * Decodes an AppStateSyncKey message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ClientHello + * @returns AppStateSyncKey * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.ClientHello; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.AppStateSyncKey; /** - * Verifies a ClientHello message. + * Verifies an AppStateSyncKey message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a ClientHello message from a plain object. Also converts values to their respective internal types. + * Creates an AppStateSyncKey message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ClientHello + * @returns AppStateSyncKey */ - public static fromObject(object: { [k: string]: any }): proto.ClientHello; + public static fromObject(object: { [k: string]: any }): proto.AppStateSyncKey; /** - * Creates a plain object from a ClientHello message. Also converts values to other types if specified. - * @param message ClientHello + * Creates a plain object from an AppStateSyncKey message. Also converts values to other types if specified. + * @param message AppStateSyncKey * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: proto.ClientHello, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: proto.AppStateSyncKey, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ClientHello to JSON. + * Converts this AppStateSyncKey to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a ServerHello. */ - interface IServerHello { + /** Properties of an AppStateSyncKeyData. */ + interface IAppStateSyncKeyData { - /** ServerHello ephemeral */ - ephemeral?: (Uint8Array|null); + /** AppStateSyncKeyData keyData */ + keyData?: (Uint8Array|null); - /** ServerHello static */ - "static"?: (Uint8Array|null); + /** AppStateSyncKeyData fingerprint */ + fingerprint?: (proto.IAppStateSyncKeyFingerprint|null); - /** ServerHello payload */ - payload?: (Uint8Array|null); + /** AppStateSyncKeyData timestamp */ + timestamp?: (number|Long|null); } - /** Represents a ServerHello. */ - class ServerHello implements IServerHello { + /** Represents an AppStateSyncKeyData. */ + class AppStateSyncKeyData implements IAppStateSyncKeyData { /** - * Constructs a new ServerHello. + * Constructs a new AppStateSyncKeyData. * @param [properties] Properties to set */ - constructor(properties?: proto.IServerHello); + constructor(properties?: proto.IAppStateSyncKeyData); - /** ServerHello ephemeral. */ - public ephemeral: Uint8Array; + /** AppStateSyncKeyData keyData. */ + public keyData: Uint8Array; - /** ServerHello static. */ - public static: Uint8Array; + /** AppStateSyncKeyData fingerprint. */ + public fingerprint?: (proto.IAppStateSyncKeyFingerprint|null); - /** ServerHello payload. */ - public payload: Uint8Array; + /** AppStateSyncKeyData timestamp. */ + public timestamp: (number|Long); /** - * Creates a new ServerHello instance using the specified properties. + * Creates a new AppStateSyncKeyData instance using the specified properties. * @param [properties] Properties to set - * @returns ServerHello instance + * @returns AppStateSyncKeyData instance */ - public static create(properties?: proto.IServerHello): proto.ServerHello; + public static create(properties?: proto.IAppStateSyncKeyData): proto.AppStateSyncKeyData; /** - * Encodes the specified ServerHello message. Does not implicitly {@link proto.ServerHello.verify|verify} messages. - * @param message ServerHello message or plain object to encode + * Encodes the specified AppStateSyncKeyData message. Does not implicitly {@link proto.AppStateSyncKeyData.verify|verify} messages. + * @param message AppStateSyncKeyData message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: proto.IServerHello, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: proto.IAppStateSyncKeyData, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ServerHello message, length delimited. Does not implicitly {@link proto.ServerHello.verify|verify} messages. - * @param message ServerHello message or plain object to encode + * Encodes the specified AppStateSyncKeyData message, length delimited. Does not implicitly {@link proto.AppStateSyncKeyData.verify|verify} messages. + * @param message AppStateSyncKeyData message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: proto.IServerHello, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: proto.IAppStateSyncKeyData, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ServerHello message from the specified reader or buffer. + * Decodes an AppStateSyncKeyData message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ServerHello + * @returns AppStateSyncKeyData * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.ServerHello; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.AppStateSyncKeyData; /** - * Decodes a ServerHello message from the specified reader or buffer, length delimited. + * Decodes an AppStateSyncKeyData message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ServerHello + * @returns AppStateSyncKeyData * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.ServerHello; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.AppStateSyncKeyData; /** - * Verifies a ServerHello message. + * Verifies an AppStateSyncKeyData message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a ServerHello message from a plain object. Also converts values to their respective internal types. + * Creates an AppStateSyncKeyData message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ServerHello + * @returns AppStateSyncKeyData */ - public static fromObject(object: { [k: string]: any }): proto.ServerHello; + public static fromObject(object: { [k: string]: any }): proto.AppStateSyncKeyData; /** - * Creates a plain object from a ServerHello message. Also converts values to other types if specified. - * @param message ServerHello + * Creates a plain object from an AppStateSyncKeyData message. Also converts values to other types if specified. + * @param message AppStateSyncKeyData * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: proto.ServerHello, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: proto.AppStateSyncKeyData, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ServerHello to JSON. + * Converts this AppStateSyncKeyData to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a ClientFinish. */ - interface IClientFinish { + /** Properties of an AppStateSyncKeyFingerprint. */ + interface IAppStateSyncKeyFingerprint { - /** ClientFinish static */ - "static"?: (Uint8Array|null); + /** AppStateSyncKeyFingerprint rawId */ + rawId?: (number|null); - /** ClientFinish payload */ - payload?: (Uint8Array|null); + /** AppStateSyncKeyFingerprint currentIndex */ + currentIndex?: (number|null); + + /** AppStateSyncKeyFingerprint deviceIndexes */ + deviceIndexes?: (number[]|null); } - /** Represents a ClientFinish. */ - class ClientFinish implements IClientFinish { + /** Represents an AppStateSyncKeyFingerprint. */ + class AppStateSyncKeyFingerprint implements IAppStateSyncKeyFingerprint { /** - * Constructs a new ClientFinish. + * Constructs a new AppStateSyncKeyFingerprint. * @param [properties] Properties to set */ - constructor(properties?: proto.IClientFinish); + constructor(properties?: proto.IAppStateSyncKeyFingerprint); - /** ClientFinish static. */ - public static: Uint8Array; + /** AppStateSyncKeyFingerprint rawId. */ + public rawId: number; - /** ClientFinish payload. */ - public payload: Uint8Array; + /** AppStateSyncKeyFingerprint currentIndex. */ + public currentIndex: number; + + /** AppStateSyncKeyFingerprint deviceIndexes. */ + public deviceIndexes: number[]; /** - * Creates a new ClientFinish instance using the specified properties. + * Creates a new AppStateSyncKeyFingerprint instance using the specified properties. * @param [properties] Properties to set - * @returns ClientFinish instance + * @returns AppStateSyncKeyFingerprint instance */ - public static create(properties?: proto.IClientFinish): proto.ClientFinish; + public static create(properties?: proto.IAppStateSyncKeyFingerprint): proto.AppStateSyncKeyFingerprint; /** - * Encodes the specified ClientFinish message. Does not implicitly {@link proto.ClientFinish.verify|verify} messages. - * @param message ClientFinish message or plain object to encode + * Encodes the specified AppStateSyncKeyFingerprint message. Does not implicitly {@link proto.AppStateSyncKeyFingerprint.verify|verify} messages. + * @param message AppStateSyncKeyFingerprint message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: proto.IClientFinish, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: proto.IAppStateSyncKeyFingerprint, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ClientFinish message, length delimited. Does not implicitly {@link proto.ClientFinish.verify|verify} messages. - * @param message ClientFinish message or plain object to encode + * Encodes the specified AppStateSyncKeyFingerprint message, length delimited. Does not implicitly {@link proto.AppStateSyncKeyFingerprint.verify|verify} messages. + * @param message AppStateSyncKeyFingerprint message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: proto.IClientFinish, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: proto.IAppStateSyncKeyFingerprint, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ClientFinish message from the specified reader or buffer. + * Decodes an AppStateSyncKeyFingerprint message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ClientFinish + * @returns AppStateSyncKeyFingerprint * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.ClientFinish; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.AppStateSyncKeyFingerprint; /** - * Decodes a ClientFinish message from the specified reader or buffer, length delimited. + * Decodes an AppStateSyncKeyFingerprint message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ClientFinish + * @returns AppStateSyncKeyFingerprint * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.ClientFinish; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.AppStateSyncKeyFingerprint; /** - * Verifies a ClientFinish message. + * Verifies an AppStateSyncKeyFingerprint message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a ClientFinish message from a plain object. Also converts values to their respective internal types. + * Creates an AppStateSyncKeyFingerprint message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ClientFinish + * @returns AppStateSyncKeyFingerprint */ - public static fromObject(object: { [k: string]: any }): proto.ClientFinish; + public static fromObject(object: { [k: string]: any }): proto.AppStateSyncKeyFingerprint; /** - * Creates a plain object from a ClientFinish message. Also converts values to other types if specified. - * @param message ClientFinish + * Creates a plain object from an AppStateSyncKeyFingerprint message. Also converts values to other types if specified. + * @param message AppStateSyncKeyFingerprint * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: proto.ClientFinish, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: proto.AppStateSyncKeyFingerprint, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ClientFinish to JSON. + * Converts this AppStateSyncKeyFingerprint to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a HandshakeMessage. */ - interface IHandshakeMessage { - - /** HandshakeMessage clientHello */ - clientHello?: (proto.IClientHello|null); - - /** HandshakeMessage serverHello */ - serverHello?: (proto.IServerHello|null); + /** Properties of an AppStateSyncKeyId. */ + interface IAppStateSyncKeyId { - /** HandshakeMessage clientFinish */ - clientFinish?: (proto.IClientFinish|null); + /** AppStateSyncKeyId keyId */ + keyId?: (Uint8Array|null); } - /** Represents a HandshakeMessage. */ - class HandshakeMessage implements IHandshakeMessage { + /** Represents an AppStateSyncKeyId. */ + class AppStateSyncKeyId implements IAppStateSyncKeyId { /** - * Constructs a new HandshakeMessage. + * Constructs a new AppStateSyncKeyId. * @param [properties] Properties to set */ - constructor(properties?: proto.IHandshakeMessage); - - /** HandshakeMessage clientHello. */ - public clientHello?: (proto.IClientHello|null); - - /** HandshakeMessage serverHello. */ - public serverHello?: (proto.IServerHello|null); + constructor(properties?: proto.IAppStateSyncKeyId); - /** HandshakeMessage clientFinish. */ - public clientFinish?: (proto.IClientFinish|null); + /** AppStateSyncKeyId keyId. */ + public keyId: Uint8Array; /** - * Creates a new HandshakeMessage instance using the specified properties. + * Creates a new AppStateSyncKeyId instance using the specified properties. * @param [properties] Properties to set - * @returns HandshakeMessage instance + * @returns AppStateSyncKeyId instance */ - public static create(properties?: proto.IHandshakeMessage): proto.HandshakeMessage; + public static create(properties?: proto.IAppStateSyncKeyId): proto.AppStateSyncKeyId; /** - * Encodes the specified HandshakeMessage message. Does not implicitly {@link proto.HandshakeMessage.verify|verify} messages. - * @param message HandshakeMessage message or plain object to encode + * Encodes the specified AppStateSyncKeyId message. Does not implicitly {@link proto.AppStateSyncKeyId.verify|verify} messages. + * @param message AppStateSyncKeyId message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: proto.IHandshakeMessage, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: proto.IAppStateSyncKeyId, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified HandshakeMessage message, length delimited. Does not implicitly {@link proto.HandshakeMessage.verify|verify} messages. - * @param message HandshakeMessage message or plain object to encode + * Encodes the specified AppStateSyncKeyId message, length delimited. Does not implicitly {@link proto.AppStateSyncKeyId.verify|verify} messages. + * @param message AppStateSyncKeyId message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: proto.IHandshakeMessage, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: proto.IAppStateSyncKeyId, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a HandshakeMessage message from the specified reader or buffer. + * Decodes an AppStateSyncKeyId message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns HandshakeMessage + * @returns AppStateSyncKeyId * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.HandshakeMessage; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.AppStateSyncKeyId; /** - * Decodes a HandshakeMessage message from the specified reader or buffer, length delimited. + * Decodes an AppStateSyncKeyId message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns HandshakeMessage + * @returns AppStateSyncKeyId * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.HandshakeMessage; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.AppStateSyncKeyId; /** - * Verifies a HandshakeMessage message. + * Verifies an AppStateSyncKeyId message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a HandshakeMessage message from a plain object. Also converts values to their respective internal types. + * Creates an AppStateSyncKeyId message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns HandshakeMessage + * @returns AppStateSyncKeyId */ - public static fromObject(object: { [k: string]: any }): proto.HandshakeMessage; + public static fromObject(object: { [k: string]: any }): proto.AppStateSyncKeyId; /** - * Creates a plain object from a HandshakeMessage message. Also converts values to other types if specified. - * @param message HandshakeMessage + * Creates a plain object from an AppStateSyncKeyId message. Also converts values to other types if specified. + * @param message AppStateSyncKeyId * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: proto.HandshakeMessage, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: proto.AppStateSyncKeyId, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this HandshakeMessage to JSON. + * Converts this AppStateSyncKeyId to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a BizIdentityInfo. */ - interface IBizIdentityInfo { - - /** BizIdentityInfo vlevel */ - vlevel?: (proto.BizIdentityInfo.BizIdentityInfoVerifiedLevelValue|null); - - /** BizIdentityInfo vnameCert */ - vnameCert?: (proto.IVerifiedNameCertificate|null); - - /** BizIdentityInfo signed */ - signed?: (boolean|null); - - /** BizIdentityInfo revoked */ - revoked?: (boolean|null); - - /** BizIdentityInfo hostStorage */ - hostStorage?: (proto.BizIdentityInfo.BizIdentityInfoHostStorageType|null); - - /** BizIdentityInfo actualActors */ - actualActors?: (proto.BizIdentityInfo.BizIdentityInfoActualActorsType|null); - - /** BizIdentityInfo privacyModeTs */ - privacyModeTs?: (number|Long|null); + /** Properties of an AppStateSyncKeyRequest. */ + interface IAppStateSyncKeyRequest { - /** BizIdentityInfo featureControls */ - featureControls?: (number|Long|null); + /** AppStateSyncKeyRequest keyIds */ + keyIds?: (proto.IAppStateSyncKeyId[]|null); } - /** Represents a BizIdentityInfo. */ - class BizIdentityInfo implements IBizIdentityInfo { + /** Represents an AppStateSyncKeyRequest. */ + class AppStateSyncKeyRequest implements IAppStateSyncKeyRequest { /** - * Constructs a new BizIdentityInfo. + * Constructs a new AppStateSyncKeyRequest. * @param [properties] Properties to set */ - constructor(properties?: proto.IBizIdentityInfo); - - /** BizIdentityInfo vlevel. */ - public vlevel: proto.BizIdentityInfo.BizIdentityInfoVerifiedLevelValue; - - /** BizIdentityInfo vnameCert. */ - public vnameCert?: (proto.IVerifiedNameCertificate|null); - - /** BizIdentityInfo signed. */ - public signed: boolean; - - /** BizIdentityInfo revoked. */ - public revoked: boolean; - - /** BizIdentityInfo hostStorage. */ - public hostStorage: proto.BizIdentityInfo.BizIdentityInfoHostStorageType; - - /** BizIdentityInfo actualActors. */ - public actualActors: proto.BizIdentityInfo.BizIdentityInfoActualActorsType; - - /** BizIdentityInfo privacyModeTs. */ - public privacyModeTs: (number|Long); + constructor(properties?: proto.IAppStateSyncKeyRequest); - /** BizIdentityInfo featureControls. */ - public featureControls: (number|Long); + /** AppStateSyncKeyRequest keyIds. */ + public keyIds: proto.IAppStateSyncKeyId[]; /** - * Creates a new BizIdentityInfo instance using the specified properties. + * Creates a new AppStateSyncKeyRequest instance using the specified properties. * @param [properties] Properties to set - * @returns BizIdentityInfo instance + * @returns AppStateSyncKeyRequest instance */ - public static create(properties?: proto.IBizIdentityInfo): proto.BizIdentityInfo; + public static create(properties?: proto.IAppStateSyncKeyRequest): proto.AppStateSyncKeyRequest; /** - * Encodes the specified BizIdentityInfo message. Does not implicitly {@link proto.BizIdentityInfo.verify|verify} messages. - * @param message BizIdentityInfo message or plain object to encode + * Encodes the specified AppStateSyncKeyRequest message. Does not implicitly {@link proto.AppStateSyncKeyRequest.verify|verify} messages. + * @param message AppStateSyncKeyRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: proto.IBizIdentityInfo, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: proto.IAppStateSyncKeyRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified BizIdentityInfo message, length delimited. Does not implicitly {@link proto.BizIdentityInfo.verify|verify} messages. - * @param message BizIdentityInfo message or plain object to encode + * Encodes the specified AppStateSyncKeyRequest message, length delimited. Does not implicitly {@link proto.AppStateSyncKeyRequest.verify|verify} messages. + * @param message AppStateSyncKeyRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: proto.IBizIdentityInfo, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: proto.IAppStateSyncKeyRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a BizIdentityInfo message from the specified reader or buffer. + * Decodes an AppStateSyncKeyRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns BizIdentityInfo + * @returns AppStateSyncKeyRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.BizIdentityInfo; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.AppStateSyncKeyRequest; /** - * Decodes a BizIdentityInfo message from the specified reader or buffer, length delimited. + * Decodes an AppStateSyncKeyRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns BizIdentityInfo + * @returns AppStateSyncKeyRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.BizIdentityInfo; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.AppStateSyncKeyRequest; /** - * Verifies a BizIdentityInfo message. + * Verifies an AppStateSyncKeyRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a BizIdentityInfo message from a plain object. Also converts values to their respective internal types. + * Creates an AppStateSyncKeyRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns BizIdentityInfo + * @returns AppStateSyncKeyRequest */ - public static fromObject(object: { [k: string]: any }): proto.BizIdentityInfo; + public static fromObject(object: { [k: string]: any }): proto.AppStateSyncKeyRequest; /** - * Creates a plain object from a BizIdentityInfo message. Also converts values to other types if specified. - * @param message BizIdentityInfo + * Creates a plain object from an AppStateSyncKeyRequest message. Also converts values to other types if specified. + * @param message AppStateSyncKeyRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: proto.BizIdentityInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: proto.AppStateSyncKeyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this BizIdentityInfo to JSON. + * Converts this AppStateSyncKeyRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - namespace BizIdentityInfo { - - /** BizIdentityInfoVerifiedLevelValue enum. */ - enum BizIdentityInfoVerifiedLevelValue { - UNKNOWN = 0, - LOW = 1, - HIGH = 2 - } - - /** BizIdentityInfoHostStorageType enum. */ - enum BizIdentityInfoHostStorageType { - ON_PREMISE = 0, - FACEBOOK = 1 - } - - /** BizIdentityInfoActualActorsType enum. */ - enum BizIdentityInfoActualActorsType { - SELF = 0, - BSP = 1 - } - } - - /** Properties of a BizAccountLinkInfo. */ - interface IBizAccountLinkInfo { - - /** BizAccountLinkInfo whatsappBizAcctFbid */ - whatsappBizAcctFbid?: (number|Long|null); - - /** BizAccountLinkInfo whatsappAcctNumber */ - whatsappAcctNumber?: (string|null); - - /** BizAccountLinkInfo issueTime */ - issueTime?: (number|Long|null); - - /** BizAccountLinkInfo hostStorage */ - hostStorage?: (proto.BizAccountLinkInfo.BizAccountLinkInfoHostStorageType|null); + /** Properties of an AppStateSyncKeyShare. */ + interface IAppStateSyncKeyShare { - /** BizAccountLinkInfo accountType */ - accountType?: (proto.BizAccountLinkInfo.BizAccountLinkInfoAccountType|null); + /** AppStateSyncKeyShare keys */ + keys?: (proto.IAppStateSyncKey[]|null); } - /** Represents a BizAccountLinkInfo. */ - class BizAccountLinkInfo implements IBizAccountLinkInfo { + /** Represents an AppStateSyncKeyShare. */ + class AppStateSyncKeyShare implements IAppStateSyncKeyShare { /** - * Constructs a new BizAccountLinkInfo. + * Constructs a new AppStateSyncKeyShare. * @param [properties] Properties to set */ - constructor(properties?: proto.IBizAccountLinkInfo); - - /** BizAccountLinkInfo whatsappBizAcctFbid. */ - public whatsappBizAcctFbid: (number|Long); - - /** BizAccountLinkInfo whatsappAcctNumber. */ - public whatsappAcctNumber: string; - - /** BizAccountLinkInfo issueTime. */ - public issueTime: (number|Long); - - /** BizAccountLinkInfo hostStorage. */ - public hostStorage: proto.BizAccountLinkInfo.BizAccountLinkInfoHostStorageType; + constructor(properties?: proto.IAppStateSyncKeyShare); - /** BizAccountLinkInfo accountType. */ - public accountType: proto.BizAccountLinkInfo.BizAccountLinkInfoAccountType; + /** AppStateSyncKeyShare keys. */ + public keys: proto.IAppStateSyncKey[]; /** - * Creates a new BizAccountLinkInfo instance using the specified properties. + * Creates a new AppStateSyncKeyShare instance using the specified properties. * @param [properties] Properties to set - * @returns BizAccountLinkInfo instance + * @returns AppStateSyncKeyShare instance */ - public static create(properties?: proto.IBizAccountLinkInfo): proto.BizAccountLinkInfo; + public static create(properties?: proto.IAppStateSyncKeyShare): proto.AppStateSyncKeyShare; /** - * Encodes the specified BizAccountLinkInfo message. Does not implicitly {@link proto.BizAccountLinkInfo.verify|verify} messages. - * @param message BizAccountLinkInfo message or plain object to encode + * Encodes the specified AppStateSyncKeyShare message. Does not implicitly {@link proto.AppStateSyncKeyShare.verify|verify} messages. + * @param message AppStateSyncKeyShare message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: proto.IBizAccountLinkInfo, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: proto.IAppStateSyncKeyShare, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified BizAccountLinkInfo message, length delimited. Does not implicitly {@link proto.BizAccountLinkInfo.verify|verify} messages. - * @param message BizAccountLinkInfo message or plain object to encode + * Encodes the specified AppStateSyncKeyShare message, length delimited. Does not implicitly {@link proto.AppStateSyncKeyShare.verify|verify} messages. + * @param message AppStateSyncKeyShare message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: proto.IBizAccountLinkInfo, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: proto.IAppStateSyncKeyShare, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a BizAccountLinkInfo message from the specified reader or buffer. + * Decodes an AppStateSyncKeyShare message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns BizAccountLinkInfo + * @returns AppStateSyncKeyShare * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.BizAccountLinkInfo; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.AppStateSyncKeyShare; /** - * Decodes a BizAccountLinkInfo message from the specified reader or buffer, length delimited. + * Decodes an AppStateSyncKeyShare message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns BizAccountLinkInfo + * @returns AppStateSyncKeyShare * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.BizAccountLinkInfo; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.AppStateSyncKeyShare; /** - * Verifies a BizAccountLinkInfo message. + * Verifies an AppStateSyncKeyShare message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a BizAccountLinkInfo message from a plain object. Also converts values to their respective internal types. + * Creates an AppStateSyncKeyShare message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns BizAccountLinkInfo + * @returns AppStateSyncKeyShare */ - public static fromObject(object: { [k: string]: any }): proto.BizAccountLinkInfo; + public static fromObject(object: { [k: string]: any }): proto.AppStateSyncKeyShare; /** - * Creates a plain object from a BizAccountLinkInfo message. Also converts values to other types if specified. - * @param message BizAccountLinkInfo + * Creates a plain object from an AppStateSyncKeyShare message. Also converts values to other types if specified. + * @param message AppStateSyncKeyShare * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: proto.BizAccountLinkInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: proto.AppStateSyncKeyShare, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this BizAccountLinkInfo to JSON. + * Converts this AppStateSyncKeyShare to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - namespace BizAccountLinkInfo { - - /** BizAccountLinkInfoHostStorageType enum. */ - enum BizAccountLinkInfoHostStorageType { - ON_PREMISE = 0, - FACEBOOK = 1 - } + /** Properties of an AudioMessage. */ + interface IAudioMessage { - /** BizAccountLinkInfoAccountType enum. */ - enum BizAccountLinkInfoAccountType { - ENTERPRISE = 0 - } - } + /** AudioMessage url */ + url?: (string|null); - /** Properties of a BizAccountPayload. */ - interface IBizAccountPayload { + /** AudioMessage mimetype */ + mimetype?: (string|null); - /** BizAccountPayload vnameCert */ - vnameCert?: (proto.IVerifiedNameCertificate|null); + /** AudioMessage fileSha256 */ + fileSha256?: (Uint8Array|null); - /** BizAccountPayload bizAcctLinkInfo */ - bizAcctLinkInfo?: (Uint8Array|null); - } + /** AudioMessage fileLength */ + fileLength?: (number|Long|null); - /** Represents a BizAccountPayload. */ - class BizAccountPayload implements IBizAccountPayload { + /** AudioMessage seconds */ + seconds?: (number|null); + + /** AudioMessage ptt */ + ptt?: (boolean|null); + + /** AudioMessage mediaKey */ + mediaKey?: (Uint8Array|null); + + /** AudioMessage fileEncSha256 */ + fileEncSha256?: (Uint8Array|null); + + /** AudioMessage directPath */ + directPath?: (string|null); + + /** AudioMessage mediaKeyTimestamp */ + mediaKeyTimestamp?: (number|Long|null); + + /** AudioMessage contextInfo */ + contextInfo?: (proto.IContextInfo|null); + + /** AudioMessage streamingSidecar */ + streamingSidecar?: (Uint8Array|null); + + /** AudioMessage waveform */ + waveform?: (Uint8Array|null); + } + + /** Represents an AudioMessage. */ + class AudioMessage implements IAudioMessage { /** - * Constructs a new BizAccountPayload. + * Constructs a new AudioMessage. * @param [properties] Properties to set */ - constructor(properties?: proto.IBizAccountPayload); + constructor(properties?: proto.IAudioMessage); - /** BizAccountPayload vnameCert. */ - public vnameCert?: (proto.IVerifiedNameCertificate|null); + /** AudioMessage url. */ + public url: string; - /** BizAccountPayload bizAcctLinkInfo. */ - public bizAcctLinkInfo: Uint8Array; + /** AudioMessage mimetype. */ + public mimetype: string; + + /** AudioMessage fileSha256. */ + public fileSha256: Uint8Array; + + /** AudioMessage fileLength. */ + public fileLength: (number|Long); + + /** AudioMessage seconds. */ + public seconds: number; + + /** AudioMessage ptt. */ + public ptt: boolean; + + /** AudioMessage mediaKey. */ + public mediaKey: Uint8Array; + + /** AudioMessage fileEncSha256. */ + public fileEncSha256: Uint8Array; + + /** AudioMessage directPath. */ + public directPath: string; + + /** AudioMessage mediaKeyTimestamp. */ + public mediaKeyTimestamp: (number|Long); + + /** AudioMessage contextInfo. */ + public contextInfo?: (proto.IContextInfo|null); + + /** AudioMessage streamingSidecar. */ + public streamingSidecar: Uint8Array; + + /** AudioMessage waveform. */ + public waveform: Uint8Array; /** - * Creates a new BizAccountPayload instance using the specified properties. + * Creates a new AudioMessage instance using the specified properties. * @param [properties] Properties to set - * @returns BizAccountPayload instance + * @returns AudioMessage instance */ - public static create(properties?: proto.IBizAccountPayload): proto.BizAccountPayload; + public static create(properties?: proto.IAudioMessage): proto.AudioMessage; /** - * Encodes the specified BizAccountPayload message. Does not implicitly {@link proto.BizAccountPayload.verify|verify} messages. - * @param message BizAccountPayload message or plain object to encode + * Encodes the specified AudioMessage message. Does not implicitly {@link proto.AudioMessage.verify|verify} messages. + * @param message AudioMessage message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: proto.IBizAccountPayload, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: proto.IAudioMessage, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified BizAccountPayload message, length delimited. Does not implicitly {@link proto.BizAccountPayload.verify|verify} messages. - * @param message BizAccountPayload message or plain object to encode + * Encodes the specified AudioMessage message, length delimited. Does not implicitly {@link proto.AudioMessage.verify|verify} messages. + * @param message AudioMessage message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: proto.IBizAccountPayload, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: proto.IAudioMessage, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a BizAccountPayload message from the specified reader or buffer. + * Decodes an AudioMessage message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns BizAccountPayload + * @returns AudioMessage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.BizAccountPayload; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.AudioMessage; /** - * Decodes a BizAccountPayload message from the specified reader or buffer, length delimited. + * Decodes an AudioMessage message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns BizAccountPayload + * @returns AudioMessage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.BizAccountPayload; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.AudioMessage; /** - * Verifies a BizAccountPayload message. + * Verifies an AudioMessage message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a BizAccountPayload message from a plain object. Also converts values to their respective internal types. + * Creates an AudioMessage message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns BizAccountPayload + * @returns AudioMessage */ - public static fromObject(object: { [k: string]: any }): proto.BizAccountPayload; + public static fromObject(object: { [k: string]: any }): proto.AudioMessage; /** - * Creates a plain object from a BizAccountPayload message. Also converts values to other types if specified. - * @param message BizAccountPayload + * Creates a plain object from an AudioMessage message. Also converts values to other types if specified. + * @param message AudioMessage * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: proto.BizAccountPayload, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: proto.AudioMessage, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this BizAccountPayload to JSON. + * Converts this AudioMessage to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a VerifiedNameDetails. */ - interface IVerifiedNameDetails { - - /** VerifiedNameDetails serial */ - serial?: (number|Long|null); + /** Properties of a Button. */ + interface IButton { - /** VerifiedNameDetails issuer */ - issuer?: (string|null); + /** Button buttonId */ + buttonId?: (string|null); - /** VerifiedNameDetails verifiedName */ - verifiedName?: (string|null); + /** Button buttonText */ + buttonText?: (proto.IButtonText|null); - /** VerifiedNameDetails localizedNames */ - localizedNames?: (proto.ILocalizedName[]|null); + /** Button type */ + type?: (proto.Button.ButtonType|null); - /** VerifiedNameDetails issueTime */ - issueTime?: (number|Long|null); + /** Button nativeFlowInfo */ + nativeFlowInfo?: (proto.INativeFlowInfo|null); } - /** Represents a VerifiedNameDetails. */ - class VerifiedNameDetails implements IVerifiedNameDetails { + /** Represents a Button. */ + class Button implements IButton { /** - * Constructs a new VerifiedNameDetails. + * Constructs a new Button. * @param [properties] Properties to set */ - constructor(properties?: proto.IVerifiedNameDetails); - - /** VerifiedNameDetails serial. */ - public serial: (number|Long); + constructor(properties?: proto.IButton); - /** VerifiedNameDetails issuer. */ - public issuer: string; + /** Button buttonId. */ + public buttonId: string; - /** VerifiedNameDetails verifiedName. */ - public verifiedName: string; + /** Button buttonText. */ + public buttonText?: (proto.IButtonText|null); - /** VerifiedNameDetails localizedNames. */ - public localizedNames: proto.ILocalizedName[]; + /** Button type. */ + public type: proto.Button.ButtonType; - /** VerifiedNameDetails issueTime. */ - public issueTime: (number|Long); + /** Button nativeFlowInfo. */ + public nativeFlowInfo?: (proto.INativeFlowInfo|null); /** - * Creates a new VerifiedNameDetails instance using the specified properties. + * Creates a new Button instance using the specified properties. * @param [properties] Properties to set - * @returns VerifiedNameDetails instance + * @returns Button instance */ - public static create(properties?: proto.IVerifiedNameDetails): proto.VerifiedNameDetails; + public static create(properties?: proto.IButton): proto.Button; /** - * Encodes the specified VerifiedNameDetails message. Does not implicitly {@link proto.VerifiedNameDetails.verify|verify} messages. - * @param message VerifiedNameDetails message or plain object to encode + * Encodes the specified Button message. Does not implicitly {@link proto.Button.verify|verify} messages. + * @param message Button message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: proto.IVerifiedNameDetails, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: proto.IButton, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified VerifiedNameDetails message, length delimited. Does not implicitly {@link proto.VerifiedNameDetails.verify|verify} messages. - * @param message VerifiedNameDetails message or plain object to encode + * Encodes the specified Button message, length delimited. Does not implicitly {@link proto.Button.verify|verify} messages. + * @param message Button message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: proto.IVerifiedNameDetails, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: proto.IButton, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a VerifiedNameDetails message from the specified reader or buffer. + * Decodes a Button message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns VerifiedNameDetails + * @returns Button * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.VerifiedNameDetails; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.Button; /** - * Decodes a VerifiedNameDetails message from the specified reader or buffer, length delimited. + * Decodes a Button message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns VerifiedNameDetails + * @returns Button * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.VerifiedNameDetails; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.Button; /** - * Verifies a VerifiedNameDetails message. + * Verifies a Button message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a VerifiedNameDetails message from a plain object. Also converts values to their respective internal types. + * Creates a Button message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns VerifiedNameDetails + * @returns Button */ - public static fromObject(object: { [k: string]: any }): proto.VerifiedNameDetails; + public static fromObject(object: { [k: string]: any }): proto.Button; /** - * Creates a plain object from a VerifiedNameDetails message. Also converts values to other types if specified. - * @param message VerifiedNameDetails + * Creates a plain object from a Button message. Also converts values to other types if specified. + * @param message Button * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: proto.VerifiedNameDetails, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: proto.Button, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this VerifiedNameDetails to JSON. + * Converts this Button to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a VerifiedNameCertificate. */ - interface IVerifiedNameCertificate { - - /** VerifiedNameCertificate details */ - details?: (Uint8Array|null); - - /** VerifiedNameCertificate signature */ - signature?: (Uint8Array|null); + namespace Button { - /** VerifiedNameCertificate serverSignature */ - serverSignature?: (Uint8Array|null); + /** ButtonType enum. */ + enum ButtonType { + UNKNOWN = 0, + RESPONSE = 1, + NATIVE_FLOW = 2 + } } - /** Represents a VerifiedNameCertificate. */ - class VerifiedNameCertificate implements IVerifiedNameCertificate { + /** Properties of a ButtonsMessage. */ + interface IButtonsMessage { - /** - * Constructs a new VerifiedNameCertificate. - * @param [properties] Properties to set - */ - constructor(properties?: proto.IVerifiedNameCertificate); + /** ButtonsMessage contentText */ + contentText?: (string|null); - /** VerifiedNameCertificate details. */ - public details: Uint8Array; + /** ButtonsMessage footerText */ + footerText?: (string|null); - /** VerifiedNameCertificate signature. */ - public signature: Uint8Array; + /** ButtonsMessage contextInfo */ + contextInfo?: (proto.IContextInfo|null); - /** VerifiedNameCertificate serverSignature. */ - public serverSignature: Uint8Array; + /** ButtonsMessage buttons */ + buttons?: (proto.IButton[]|null); - /** - * Creates a new VerifiedNameCertificate instance using the specified properties. + /** ButtonsMessage headerType */ + headerType?: (proto.ButtonsMessage.ButtonsMessageHeaderType|null); + + /** ButtonsMessage text */ + text?: (string|null); + + /** ButtonsMessage documentMessage */ + documentMessage?: (proto.IDocumentMessage|null); + + /** ButtonsMessage imageMessage */ + imageMessage?: (proto.IImageMessage|null); + + /** ButtonsMessage videoMessage */ + videoMessage?: (proto.IVideoMessage|null); + + /** ButtonsMessage locationMessage */ + locationMessage?: (proto.ILocationMessage|null); + } + + /** Represents a ButtonsMessage. */ + class ButtonsMessage implements IButtonsMessage { + + /** + * Constructs a new ButtonsMessage. * @param [properties] Properties to set - * @returns VerifiedNameCertificate instance */ - public static create(properties?: proto.IVerifiedNameCertificate): proto.VerifiedNameCertificate; + constructor(properties?: proto.IButtonsMessage); + + /** ButtonsMessage contentText. */ + public contentText: string; + + /** ButtonsMessage footerText. */ + public footerText: string; + + /** ButtonsMessage contextInfo. */ + public contextInfo?: (proto.IContextInfo|null); + + /** ButtonsMessage buttons. */ + public buttons: proto.IButton[]; + + /** ButtonsMessage headerType. */ + public headerType: proto.ButtonsMessage.ButtonsMessageHeaderType; + + /** ButtonsMessage text. */ + public text?: (string|null); + + /** ButtonsMessage documentMessage. */ + public documentMessage?: (proto.IDocumentMessage|null); + + /** ButtonsMessage imageMessage. */ + public imageMessage?: (proto.IImageMessage|null); + + /** ButtonsMessage videoMessage. */ + public videoMessage?: (proto.IVideoMessage|null); + + /** ButtonsMessage locationMessage. */ + public locationMessage?: (proto.ILocationMessage|null); + + /** ButtonsMessage header. */ + public header?: ("text"|"documentMessage"|"imageMessage"|"videoMessage"|"locationMessage"); /** - * Encodes the specified VerifiedNameCertificate message. Does not implicitly {@link proto.VerifiedNameCertificate.verify|verify} messages. - * @param message VerifiedNameCertificate message or plain object to encode + * Creates a new ButtonsMessage instance using the specified properties. + * @param [properties] Properties to set + * @returns ButtonsMessage instance + */ + public static create(properties?: proto.IButtonsMessage): proto.ButtonsMessage; + + /** + * Encodes the specified ButtonsMessage message. Does not implicitly {@link proto.ButtonsMessage.verify|verify} messages. + * @param message ButtonsMessage message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: proto.IVerifiedNameCertificate, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: proto.IButtonsMessage, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified VerifiedNameCertificate message, length delimited. Does not implicitly {@link proto.VerifiedNameCertificate.verify|verify} messages. - * @param message VerifiedNameCertificate message or plain object to encode + * Encodes the specified ButtonsMessage message, length delimited. Does not implicitly {@link proto.ButtonsMessage.verify|verify} messages. + * @param message ButtonsMessage message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: proto.IVerifiedNameCertificate, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: proto.IButtonsMessage, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a VerifiedNameCertificate message from the specified reader or buffer. + * Decodes a ButtonsMessage message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns VerifiedNameCertificate + * @returns ButtonsMessage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.VerifiedNameCertificate; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.ButtonsMessage; /** - * Decodes a VerifiedNameCertificate message from the specified reader or buffer, length delimited. + * Decodes a ButtonsMessage message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns VerifiedNameCertificate + * @returns ButtonsMessage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.VerifiedNameCertificate; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.ButtonsMessage; /** - * Verifies a VerifiedNameCertificate message. + * Verifies a ButtonsMessage message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a VerifiedNameCertificate message from a plain object. Also converts values to their respective internal types. + * Creates a ButtonsMessage message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns VerifiedNameCertificate + * @returns ButtonsMessage */ - public static fromObject(object: { [k: string]: any }): proto.VerifiedNameCertificate; + public static fromObject(object: { [k: string]: any }): proto.ButtonsMessage; /** - * Creates a plain object from a VerifiedNameCertificate message. Also converts values to other types if specified. - * @param message VerifiedNameCertificate + * Creates a plain object from a ButtonsMessage message. Also converts values to other types if specified. + * @param message ButtonsMessage * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: proto.VerifiedNameCertificate, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: proto.ButtonsMessage, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this VerifiedNameCertificate to JSON. + * Converts this ButtonsMessage to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a LocalizedName. */ - interface ILocalizedName { + namespace ButtonsMessage { - /** LocalizedName lg */ - lg?: (string|null); + /** ButtonsMessageHeaderType enum. */ + enum ButtonsMessageHeaderType { + UNKNOWN = 0, + EMPTY = 1, + TEXT = 2, + DOCUMENT = 3, + IMAGE = 4, + VIDEO = 5, + LOCATION = 6 + } + } - /** LocalizedName lc */ - lc?: (string|null); + /** Properties of a ButtonsResponseMessage. */ + interface IButtonsResponseMessage { - /** LocalizedName verifiedName */ - verifiedName?: (string|null); + /** ButtonsResponseMessage selectedButtonId */ + selectedButtonId?: (string|null); + + /** ButtonsResponseMessage contextInfo */ + contextInfo?: (proto.IContextInfo|null); + + /** ButtonsResponseMessage type */ + type?: (proto.ButtonsResponseMessage.ButtonsResponseMessageType|null); + + /** ButtonsResponseMessage selectedDisplayText */ + selectedDisplayText?: (string|null); } - /** Represents a LocalizedName. */ - class LocalizedName implements ILocalizedName { + /** Represents a ButtonsResponseMessage. */ + class ButtonsResponseMessage implements IButtonsResponseMessage { /** - * Constructs a new LocalizedName. + * Constructs a new ButtonsResponseMessage. * @param [properties] Properties to set */ - constructor(properties?: proto.ILocalizedName); + constructor(properties?: proto.IButtonsResponseMessage); - /** LocalizedName lg. */ - public lg: string; + /** ButtonsResponseMessage selectedButtonId. */ + public selectedButtonId: string; - /** LocalizedName lc. */ - public lc: string; + /** ButtonsResponseMessage contextInfo. */ + public contextInfo?: (proto.IContextInfo|null); - /** LocalizedName verifiedName. */ - public verifiedName: string; + /** ButtonsResponseMessage type. */ + public type: proto.ButtonsResponseMessage.ButtonsResponseMessageType; + + /** ButtonsResponseMessage selectedDisplayText. */ + public selectedDisplayText?: (string|null); + + /** ButtonsResponseMessage response. */ + public response?: "selectedDisplayText"; /** - * Creates a new LocalizedName instance using the specified properties. + * Creates a new ButtonsResponseMessage instance using the specified properties. * @param [properties] Properties to set - * @returns LocalizedName instance + * @returns ButtonsResponseMessage instance */ - public static create(properties?: proto.ILocalizedName): proto.LocalizedName; + public static create(properties?: proto.IButtonsResponseMessage): proto.ButtonsResponseMessage; /** - * Encodes the specified LocalizedName message. Does not implicitly {@link proto.LocalizedName.verify|verify} messages. - * @param message LocalizedName message or plain object to encode + * Encodes the specified ButtonsResponseMessage message. Does not implicitly {@link proto.ButtonsResponseMessage.verify|verify} messages. + * @param message ButtonsResponseMessage message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: proto.ILocalizedName, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: proto.IButtonsResponseMessage, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified LocalizedName message, length delimited. Does not implicitly {@link proto.LocalizedName.verify|verify} messages. - * @param message LocalizedName message or plain object to encode + * Encodes the specified ButtonsResponseMessage message, length delimited. Does not implicitly {@link proto.ButtonsResponseMessage.verify|verify} messages. + * @param message ButtonsResponseMessage message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: proto.ILocalizedName, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: proto.IButtonsResponseMessage, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a LocalizedName message from the specified reader or buffer. + * Decodes a ButtonsResponseMessage message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns LocalizedName + * @returns ButtonsResponseMessage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.LocalizedName; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.ButtonsResponseMessage; /** - * Decodes a LocalizedName message from the specified reader or buffer, length delimited. + * Decodes a ButtonsResponseMessage message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns LocalizedName + * @returns ButtonsResponseMessage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.LocalizedName; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.ButtonsResponseMessage; /** - * Verifies a LocalizedName message. + * Verifies a ButtonsResponseMessage message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a LocalizedName message from a plain object. Also converts values to their respective internal types. + * Creates a ButtonsResponseMessage message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns LocalizedName + * @returns ButtonsResponseMessage */ - public static fromObject(object: { [k: string]: any }): proto.LocalizedName; + public static fromObject(object: { [k: string]: any }): proto.ButtonsResponseMessage; /** - * Creates a plain object from a LocalizedName message. Also converts values to other types if specified. - * @param message LocalizedName + * Creates a plain object from a ButtonsResponseMessage message. Also converts values to other types if specified. + * @param message ButtonsResponseMessage * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: proto.LocalizedName, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: proto.ButtonsResponseMessage, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this LocalizedName to JSON. + * Converts this ButtonsResponseMessage to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a SyncActionData. */ - interface ISyncActionData { - - /** SyncActionData index */ - index?: (Uint8Array|null); + namespace ButtonsResponseMessage { - /** SyncActionData value */ - value?: (proto.ISyncActionValue|null); + /** ButtonsResponseMessageType enum. */ + enum ButtonsResponseMessageType { + UNKNOWN = 0, + DISPLAY_TEXT = 1 + } + } - /** SyncActionData padding */ - padding?: (Uint8Array|null); + /** Properties of a ButtonText. */ + interface IButtonText { - /** SyncActionData version */ - version?: (number|null); + /** ButtonText displayText */ + displayText?: (string|null); } - /** Represents a SyncActionData. */ - class SyncActionData implements ISyncActionData { + /** Represents a ButtonText. */ + class ButtonText implements IButtonText { /** - * Constructs a new SyncActionData. + * Constructs a new ButtonText. * @param [properties] Properties to set */ - constructor(properties?: proto.ISyncActionData); - - /** SyncActionData index. */ - public index: Uint8Array; - - /** SyncActionData value. */ - public value?: (proto.ISyncActionValue|null); - - /** SyncActionData padding. */ - public padding: Uint8Array; + constructor(properties?: proto.IButtonText); - /** SyncActionData version. */ - public version: number; + /** ButtonText displayText. */ + public displayText: string; /** - * Creates a new SyncActionData instance using the specified properties. + * Creates a new ButtonText instance using the specified properties. * @param [properties] Properties to set - * @returns SyncActionData instance + * @returns ButtonText instance */ - public static create(properties?: proto.ISyncActionData): proto.SyncActionData; + public static create(properties?: proto.IButtonText): proto.ButtonText; /** - * Encodes the specified SyncActionData message. Does not implicitly {@link proto.SyncActionData.verify|verify} messages. - * @param message SyncActionData message or plain object to encode + * Encodes the specified ButtonText message. Does not implicitly {@link proto.ButtonText.verify|verify} messages. + * @param message ButtonText message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: proto.ISyncActionData, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: proto.IButtonText, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified SyncActionData message, length delimited. Does not implicitly {@link proto.SyncActionData.verify|verify} messages. - * @param message SyncActionData message or plain object to encode + * Encodes the specified ButtonText message, length delimited. Does not implicitly {@link proto.ButtonText.verify|verify} messages. + * @param message ButtonText message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: proto.ISyncActionData, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: proto.IButtonText, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a SyncActionData message from the specified reader or buffer. + * Decodes a ButtonText message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns SyncActionData + * @returns ButtonText * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.SyncActionData; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.ButtonText; /** - * Decodes a SyncActionData message from the specified reader or buffer, length delimited. + * Decodes a ButtonText message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns SyncActionData + * @returns ButtonText * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.SyncActionData; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.ButtonText; /** - * Verifies a SyncActionData message. + * Verifies a ButtonText message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a SyncActionData message from a plain object. Also converts values to their respective internal types. + * Creates a ButtonText message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns SyncActionData + * @returns ButtonText */ - public static fromObject(object: { [k: string]: any }): proto.SyncActionData; + public static fromObject(object: { [k: string]: any }): proto.ButtonText; /** - * Creates a plain object from a SyncActionData message. Also converts values to other types if specified. - * @param message SyncActionData + * Creates a plain object from a ButtonText message. Also converts values to other types if specified. + * @param message ButtonText * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: proto.SyncActionData, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: proto.ButtonText, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this SyncActionData to JSON. + * Converts this ButtonText to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a StarAction. */ - interface IStarAction { + /** Properties of a Call. */ + interface ICall { - /** StarAction starred */ - starred?: (boolean|null); + /** Call callKey */ + callKey?: (Uint8Array|null); + + /** Call conversionSource */ + conversionSource?: (string|null); + + /** Call conversionData */ + conversionData?: (Uint8Array|null); + + /** Call conversionDelaySeconds */ + conversionDelaySeconds?: (number|null); } - /** Represents a StarAction. */ - class StarAction implements IStarAction { + /** Represents a Call. */ + class Call implements ICall { /** - * Constructs a new StarAction. + * Constructs a new Call. * @param [properties] Properties to set */ - constructor(properties?: proto.IStarAction); + constructor(properties?: proto.ICall); - /** StarAction starred. */ - public starred: boolean; + /** Call callKey. */ + public callKey: Uint8Array; + + /** Call conversionSource. */ + public conversionSource: string; + + /** Call conversionData. */ + public conversionData: Uint8Array; + + /** Call conversionDelaySeconds. */ + public conversionDelaySeconds: number; /** - * Creates a new StarAction instance using the specified properties. + * Creates a new Call instance using the specified properties. * @param [properties] Properties to set - * @returns StarAction instance + * @returns Call instance */ - public static create(properties?: proto.IStarAction): proto.StarAction; + public static create(properties?: proto.ICall): proto.Call; /** - * Encodes the specified StarAction message. Does not implicitly {@link proto.StarAction.verify|verify} messages. - * @param message StarAction message or plain object to encode + * Encodes the specified Call message. Does not implicitly {@link proto.Call.verify|verify} messages. + * @param message Call message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: proto.IStarAction, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: proto.ICall, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified StarAction message, length delimited. Does not implicitly {@link proto.StarAction.verify|verify} messages. - * @param message StarAction message or plain object to encode + * Encodes the specified Call message, length delimited. Does not implicitly {@link proto.Call.verify|verify} messages. + * @param message Call message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: proto.IStarAction, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: proto.ICall, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a StarAction message from the specified reader or buffer. + * Decodes a Call message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns StarAction + * @returns Call * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.StarAction; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.Call; /** - * Decodes a StarAction message from the specified reader or buffer, length delimited. + * Decodes a Call message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns StarAction + * @returns Call * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.StarAction; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.Call; /** - * Verifies a StarAction message. + * Verifies a Call message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a StarAction message from a plain object. Also converts values to their respective internal types. + * Creates a Call message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns StarAction + * @returns Call */ - public static fromObject(object: { [k: string]: any }): proto.StarAction; + public static fromObject(object: { [k: string]: any }): proto.Call; /** - * Creates a plain object from a StarAction message. Also converts values to other types if specified. - * @param message StarAction + * Creates a plain object from a Call message. Also converts values to other types if specified. + * @param message Call * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: proto.StarAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: proto.Call, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this StarAction to JSON. + * Converts this Call to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a ContactAction. */ - interface IContactAction { + /** Properties of a CallButton. */ + interface ICallButton { - /** ContactAction fullName */ - fullName?: (string|null); + /** CallButton displayText */ + displayText?: (proto.IHighlyStructuredMessage|null); - /** ContactAction firstName */ - firstName?: (string|null); + /** CallButton phoneNumber */ + phoneNumber?: (proto.IHighlyStructuredMessage|null); } - /** Represents a ContactAction. */ - class ContactAction implements IContactAction { + /** Represents a CallButton. */ + class CallButton implements ICallButton { /** - * Constructs a new ContactAction. + * Constructs a new CallButton. * @param [properties] Properties to set */ - constructor(properties?: proto.IContactAction); + constructor(properties?: proto.ICallButton); - /** ContactAction fullName. */ - public fullName: string; + /** CallButton displayText. */ + public displayText?: (proto.IHighlyStructuredMessage|null); - /** ContactAction firstName. */ - public firstName: string; + /** CallButton phoneNumber. */ + public phoneNumber?: (proto.IHighlyStructuredMessage|null); /** - * Creates a new ContactAction instance using the specified properties. + * Creates a new CallButton instance using the specified properties. * @param [properties] Properties to set - * @returns ContactAction instance + * @returns CallButton instance */ - public static create(properties?: proto.IContactAction): proto.ContactAction; + public static create(properties?: proto.ICallButton): proto.CallButton; /** - * Encodes the specified ContactAction message. Does not implicitly {@link proto.ContactAction.verify|verify} messages. - * @param message ContactAction message or plain object to encode + * Encodes the specified CallButton message. Does not implicitly {@link proto.CallButton.verify|verify} messages. + * @param message CallButton message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: proto.IContactAction, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: proto.ICallButton, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ContactAction message, length delimited. Does not implicitly {@link proto.ContactAction.verify|verify} messages. - * @param message ContactAction message or plain object to encode + * Encodes the specified CallButton message, length delimited. Does not implicitly {@link proto.CallButton.verify|verify} messages. + * @param message CallButton message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: proto.IContactAction, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: proto.ICallButton, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ContactAction message from the specified reader or buffer. + * Decodes a CallButton message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ContactAction + * @returns CallButton * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.ContactAction; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.CallButton; /** - * Decodes a ContactAction message from the specified reader or buffer, length delimited. + * Decodes a CallButton message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ContactAction + * @returns CallButton * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.ContactAction; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.CallButton; /** - * Verifies a ContactAction message. + * Verifies a CallButton message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a ContactAction message from a plain object. Also converts values to their respective internal types. + * Creates a CallButton message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ContactAction + * @returns CallButton */ - public static fromObject(object: { [k: string]: any }): proto.ContactAction; + public static fromObject(object: { [k: string]: any }): proto.CallButton; /** - * Creates a plain object from a ContactAction message. Also converts values to other types if specified. - * @param message ContactAction + * Creates a plain object from a CallButton message. Also converts values to other types if specified. + * @param message CallButton * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: proto.ContactAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: proto.CallButton, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ContactAction to JSON. + * Converts this CallButton to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a MuteAction. */ - interface IMuteAction { - - /** MuteAction muted */ - muted?: (boolean|null); + /** Properties of a CancelPaymentRequestMessage. */ + interface ICancelPaymentRequestMessage { - /** MuteAction muteEndTimestamp */ - muteEndTimestamp?: (number|Long|null); + /** CancelPaymentRequestMessage key */ + key?: (proto.IMessageKey|null); } - /** Represents a MuteAction. */ - class MuteAction implements IMuteAction { + /** Represents a CancelPaymentRequestMessage. */ + class CancelPaymentRequestMessage implements ICancelPaymentRequestMessage { /** - * Constructs a new MuteAction. + * Constructs a new CancelPaymentRequestMessage. * @param [properties] Properties to set */ - constructor(properties?: proto.IMuteAction); - - /** MuteAction muted. */ - public muted: boolean; + constructor(properties?: proto.ICancelPaymentRequestMessage); - /** MuteAction muteEndTimestamp. */ - public muteEndTimestamp: (number|Long); + /** CancelPaymentRequestMessage key. */ + public key?: (proto.IMessageKey|null); /** - * Creates a new MuteAction instance using the specified properties. + * Creates a new CancelPaymentRequestMessage instance using the specified properties. * @param [properties] Properties to set - * @returns MuteAction instance + * @returns CancelPaymentRequestMessage instance */ - public static create(properties?: proto.IMuteAction): proto.MuteAction; + public static create(properties?: proto.ICancelPaymentRequestMessage): proto.CancelPaymentRequestMessage; /** - * Encodes the specified MuteAction message. Does not implicitly {@link proto.MuteAction.verify|verify} messages. - * @param message MuteAction message or plain object to encode + * Encodes the specified CancelPaymentRequestMessage message. Does not implicitly {@link proto.CancelPaymentRequestMessage.verify|verify} messages. + * @param message CancelPaymentRequestMessage message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: proto.IMuteAction, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: proto.ICancelPaymentRequestMessage, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified MuteAction message, length delimited. Does not implicitly {@link proto.MuteAction.verify|verify} messages. - * @param message MuteAction message or plain object to encode + * Encodes the specified CancelPaymentRequestMessage message, length delimited. Does not implicitly {@link proto.CancelPaymentRequestMessage.verify|verify} messages. + * @param message CancelPaymentRequestMessage message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: proto.IMuteAction, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: proto.ICancelPaymentRequestMessage, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a MuteAction message from the specified reader or buffer. + * Decodes a CancelPaymentRequestMessage message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns MuteAction + * @returns CancelPaymentRequestMessage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.MuteAction; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.CancelPaymentRequestMessage; /** - * Decodes a MuteAction message from the specified reader or buffer, length delimited. + * Decodes a CancelPaymentRequestMessage message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns MuteAction + * @returns CancelPaymentRequestMessage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.MuteAction; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.CancelPaymentRequestMessage; /** - * Verifies a MuteAction message. + * Verifies a CancelPaymentRequestMessage message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a MuteAction message from a plain object. Also converts values to their respective internal types. + * Creates a CancelPaymentRequestMessage message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns MuteAction + * @returns CancelPaymentRequestMessage */ - public static fromObject(object: { [k: string]: any }): proto.MuteAction; + public static fromObject(object: { [k: string]: any }): proto.CancelPaymentRequestMessage; /** - * Creates a plain object from a MuteAction message. Also converts values to other types if specified. - * @param message MuteAction + * Creates a plain object from a CancelPaymentRequestMessage message. Also converts values to other types if specified. + * @param message CancelPaymentRequestMessage * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: proto.MuteAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: proto.CancelPaymentRequestMessage, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this MuteAction to JSON. + * Converts this CancelPaymentRequestMessage to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a PinAction. */ - interface IPinAction { + /** Properties of a CatalogSnapshot. */ + interface ICatalogSnapshot { - /** PinAction pinned */ - pinned?: (boolean|null); + /** CatalogSnapshot catalogImage */ + catalogImage?: (proto.IImageMessage|null); + + /** CatalogSnapshot title */ + title?: (string|null); + + /** CatalogSnapshot description */ + description?: (string|null); } - /** Represents a PinAction. */ - class PinAction implements IPinAction { + /** Represents a CatalogSnapshot. */ + class CatalogSnapshot implements ICatalogSnapshot { /** - * Constructs a new PinAction. + * Constructs a new CatalogSnapshot. * @param [properties] Properties to set */ - constructor(properties?: proto.IPinAction); + constructor(properties?: proto.ICatalogSnapshot); - /** PinAction pinned. */ - public pinned: boolean; + /** CatalogSnapshot catalogImage. */ + public catalogImage?: (proto.IImageMessage|null); + + /** CatalogSnapshot title. */ + public title: string; + + /** CatalogSnapshot description. */ + public description: string; /** - * Creates a new PinAction instance using the specified properties. + * Creates a new CatalogSnapshot instance using the specified properties. * @param [properties] Properties to set - * @returns PinAction instance + * @returns CatalogSnapshot instance */ - public static create(properties?: proto.IPinAction): proto.PinAction; + public static create(properties?: proto.ICatalogSnapshot): proto.CatalogSnapshot; /** - * Encodes the specified PinAction message. Does not implicitly {@link proto.PinAction.verify|verify} messages. - * @param message PinAction message or plain object to encode + * Encodes the specified CatalogSnapshot message. Does not implicitly {@link proto.CatalogSnapshot.verify|verify} messages. + * @param message CatalogSnapshot message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: proto.IPinAction, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: proto.ICatalogSnapshot, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified PinAction message, length delimited. Does not implicitly {@link proto.PinAction.verify|verify} messages. - * @param message PinAction message or plain object to encode + * Encodes the specified CatalogSnapshot message, length delimited. Does not implicitly {@link proto.CatalogSnapshot.verify|verify} messages. + * @param message CatalogSnapshot message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: proto.IPinAction, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: proto.ICatalogSnapshot, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a PinAction message from the specified reader or buffer. + * Decodes a CatalogSnapshot message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns PinAction + * @returns CatalogSnapshot * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.PinAction; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.CatalogSnapshot; /** - * Decodes a PinAction message from the specified reader or buffer, length delimited. + * Decodes a CatalogSnapshot message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns PinAction + * @returns CatalogSnapshot * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.PinAction; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.CatalogSnapshot; /** - * Verifies a PinAction message. + * Verifies a CatalogSnapshot message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a PinAction message from a plain object. Also converts values to their respective internal types. + * Creates a CatalogSnapshot message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns PinAction + * @returns CatalogSnapshot */ - public static fromObject(object: { [k: string]: any }): proto.PinAction; + public static fromObject(object: { [k: string]: any }): proto.CatalogSnapshot; /** - * Creates a plain object from a PinAction message. Also converts values to other types if specified. - * @param message PinAction + * Creates a plain object from a CatalogSnapshot message. Also converts values to other types if specified. + * @param message CatalogSnapshot * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: proto.PinAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: proto.CatalogSnapshot, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this PinAction to JSON. + * Converts this CatalogSnapshot to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a SecurityNotificationSetting. */ - interface ISecurityNotificationSetting { + /** Properties of a Chat. */ + interface IChat { - /** SecurityNotificationSetting showNotification */ - showNotification?: (boolean|null); + /** Chat displayName */ + displayName?: (string|null); + + /** Chat id */ + id?: (string|null); } - /** Represents a SecurityNotificationSetting. */ - class SecurityNotificationSetting implements ISecurityNotificationSetting { + /** Represents a Chat. */ + class Chat implements IChat { /** - * Constructs a new SecurityNotificationSetting. + * Constructs a new Chat. * @param [properties] Properties to set */ - constructor(properties?: proto.ISecurityNotificationSetting); + constructor(properties?: proto.IChat); - /** SecurityNotificationSetting showNotification. */ - public showNotification: boolean; + /** Chat displayName. */ + public displayName: string; + + /** Chat id. */ + public id: string; /** - * Creates a new SecurityNotificationSetting instance using the specified properties. + * Creates a new Chat instance using the specified properties. * @param [properties] Properties to set - * @returns SecurityNotificationSetting instance + * @returns Chat instance */ - public static create(properties?: proto.ISecurityNotificationSetting): proto.SecurityNotificationSetting; + public static create(properties?: proto.IChat): proto.Chat; /** - * Encodes the specified SecurityNotificationSetting message. Does not implicitly {@link proto.SecurityNotificationSetting.verify|verify} messages. - * @param message SecurityNotificationSetting message or plain object to encode + * Encodes the specified Chat message. Does not implicitly {@link proto.Chat.verify|verify} messages. + * @param message Chat message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: proto.ISecurityNotificationSetting, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: proto.IChat, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified SecurityNotificationSetting message, length delimited. Does not implicitly {@link proto.SecurityNotificationSetting.verify|verify} messages. - * @param message SecurityNotificationSetting message or plain object to encode + * Encodes the specified Chat message, length delimited. Does not implicitly {@link proto.Chat.verify|verify} messages. + * @param message Chat message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: proto.ISecurityNotificationSetting, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: proto.IChat, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a SecurityNotificationSetting message from the specified reader or buffer. + * Decodes a Chat message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns SecurityNotificationSetting + * @returns Chat * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.SecurityNotificationSetting; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.Chat; /** - * Decodes a SecurityNotificationSetting message from the specified reader or buffer, length delimited. + * Decodes a Chat message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns SecurityNotificationSetting + * @returns Chat * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.SecurityNotificationSetting; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.Chat; /** - * Verifies a SecurityNotificationSetting message. + * Verifies a Chat message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a SecurityNotificationSetting message from a plain object. Also converts values to their respective internal types. + * Creates a Chat message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns SecurityNotificationSetting + * @returns Chat */ - public static fromObject(object: { [k: string]: any }): proto.SecurityNotificationSetting; + public static fromObject(object: { [k: string]: any }): proto.Chat; /** - * Creates a plain object from a SecurityNotificationSetting message. Also converts values to other types if specified. - * @param message SecurityNotificationSetting + * Creates a plain object from a Chat message. Also converts values to other types if specified. + * @param message Chat * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: proto.SecurityNotificationSetting, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: proto.Chat, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this SecurityNotificationSetting to JSON. + * Converts this Chat to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a PushNameSetting. */ - interface IPushNameSetting { + /** Properties of a CollectionMessage. */ + interface ICollectionMessage { - /** PushNameSetting name */ - name?: (string|null); + /** CollectionMessage bizJid */ + bizJid?: (string|null); + + /** CollectionMessage id */ + id?: (string|null); + + /** CollectionMessage messageVersion */ + messageVersion?: (number|null); } - /** Represents a PushNameSetting. */ - class PushNameSetting implements IPushNameSetting { + /** Represents a CollectionMessage. */ + class CollectionMessage implements ICollectionMessage { /** - * Constructs a new PushNameSetting. + * Constructs a new CollectionMessage. * @param [properties] Properties to set */ - constructor(properties?: proto.IPushNameSetting); + constructor(properties?: proto.ICollectionMessage); - /** PushNameSetting name. */ - public name: string; + /** CollectionMessage bizJid. */ + public bizJid: string; + + /** CollectionMessage id. */ + public id: string; + + /** CollectionMessage messageVersion. */ + public messageVersion: number; /** - * Creates a new PushNameSetting instance using the specified properties. + * Creates a new CollectionMessage instance using the specified properties. * @param [properties] Properties to set - * @returns PushNameSetting instance + * @returns CollectionMessage instance */ - public static create(properties?: proto.IPushNameSetting): proto.PushNameSetting; + public static create(properties?: proto.ICollectionMessage): proto.CollectionMessage; /** - * Encodes the specified PushNameSetting message. Does not implicitly {@link proto.PushNameSetting.verify|verify} messages. - * @param message PushNameSetting message or plain object to encode + * Encodes the specified CollectionMessage message. Does not implicitly {@link proto.CollectionMessage.verify|verify} messages. + * @param message CollectionMessage message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: proto.IPushNameSetting, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: proto.ICollectionMessage, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified PushNameSetting message, length delimited. Does not implicitly {@link proto.PushNameSetting.verify|verify} messages. - * @param message PushNameSetting message or plain object to encode + * Encodes the specified CollectionMessage message, length delimited. Does not implicitly {@link proto.CollectionMessage.verify|verify} messages. + * @param message CollectionMessage message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: proto.IPushNameSetting, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: proto.ICollectionMessage, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a PushNameSetting message from the specified reader or buffer. + * Decodes a CollectionMessage message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns PushNameSetting + * @returns CollectionMessage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.PushNameSetting; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.CollectionMessage; /** - * Decodes a PushNameSetting message from the specified reader or buffer, length delimited. + * Decodes a CollectionMessage message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns PushNameSetting + * @returns CollectionMessage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.PushNameSetting; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.CollectionMessage; /** - * Verifies a PushNameSetting message. + * Verifies a CollectionMessage message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a PushNameSetting message from a plain object. Also converts values to their respective internal types. + * Creates a CollectionMessage message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns PushNameSetting + * @returns CollectionMessage */ - public static fromObject(object: { [k: string]: any }): proto.PushNameSetting; + public static fromObject(object: { [k: string]: any }): proto.CollectionMessage; /** - * Creates a plain object from a PushNameSetting message. Also converts values to other types if specified. - * @param message PushNameSetting + * Creates a plain object from a CollectionMessage message. Also converts values to other types if specified. + * @param message CollectionMessage * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: proto.PushNameSetting, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: proto.CollectionMessage, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this PushNameSetting to JSON. + * Converts this CollectionMessage to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a LocaleSetting. */ - interface ILocaleSetting { - - /** LocaleSetting locale */ - locale?: (string|null); - } + /** Properties of a ContactMessage. */ + interface IContactMessage { - /** Represents a LocaleSetting. */ - class LocaleSetting implements ILocaleSetting { + /** ContactMessage displayName */ + displayName?: (string|null); + + /** ContactMessage vcard */ + vcard?: (string|null); + + /** ContactMessage contextInfo */ + contextInfo?: (proto.IContextInfo|null); + } + + /** Represents a ContactMessage. */ + class ContactMessage implements IContactMessage { /** - * Constructs a new LocaleSetting. + * Constructs a new ContactMessage. * @param [properties] Properties to set */ - constructor(properties?: proto.ILocaleSetting); + constructor(properties?: proto.IContactMessage); - /** LocaleSetting locale. */ - public locale: string; + /** ContactMessage displayName. */ + public displayName: string; + + /** ContactMessage vcard. */ + public vcard: string; + + /** ContactMessage contextInfo. */ + public contextInfo?: (proto.IContextInfo|null); /** - * Creates a new LocaleSetting instance using the specified properties. + * Creates a new ContactMessage instance using the specified properties. * @param [properties] Properties to set - * @returns LocaleSetting instance + * @returns ContactMessage instance */ - public static create(properties?: proto.ILocaleSetting): proto.LocaleSetting; + public static create(properties?: proto.IContactMessage): proto.ContactMessage; /** - * Encodes the specified LocaleSetting message. Does not implicitly {@link proto.LocaleSetting.verify|verify} messages. - * @param message LocaleSetting message or plain object to encode + * Encodes the specified ContactMessage message. Does not implicitly {@link proto.ContactMessage.verify|verify} messages. + * @param message ContactMessage message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: proto.ILocaleSetting, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: proto.IContactMessage, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified LocaleSetting message, length delimited. Does not implicitly {@link proto.LocaleSetting.verify|verify} messages. - * @param message LocaleSetting message or plain object to encode + * Encodes the specified ContactMessage message, length delimited. Does not implicitly {@link proto.ContactMessage.verify|verify} messages. + * @param message ContactMessage message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: proto.ILocaleSetting, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: proto.IContactMessage, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a LocaleSetting message from the specified reader or buffer. + * Decodes a ContactMessage message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns LocaleSetting + * @returns ContactMessage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.LocaleSetting; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.ContactMessage; /** - * Decodes a LocaleSetting message from the specified reader or buffer, length delimited. + * Decodes a ContactMessage message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns LocaleSetting + * @returns ContactMessage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.LocaleSetting; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.ContactMessage; /** - * Verifies a LocaleSetting message. + * Verifies a ContactMessage message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a LocaleSetting message from a plain object. Also converts values to their respective internal types. + * Creates a ContactMessage message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns LocaleSetting + * @returns ContactMessage */ - public static fromObject(object: { [k: string]: any }): proto.LocaleSetting; + public static fromObject(object: { [k: string]: any }): proto.ContactMessage; /** - * Creates a plain object from a LocaleSetting message. Also converts values to other types if specified. - * @param message LocaleSetting + * Creates a plain object from a ContactMessage message. Also converts values to other types if specified. + * @param message ContactMessage * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: proto.LocaleSetting, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: proto.ContactMessage, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this LocaleSetting to JSON. + * Converts this ContactMessage to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a QuickReplyAction. */ - interface IQuickReplyAction { - - /** QuickReplyAction shortcut */ - shortcut?: (string|null); - - /** QuickReplyAction message */ - message?: (string|null); + /** Properties of a ContactsArrayMessage. */ + interface IContactsArrayMessage { - /** QuickReplyAction keywords */ - keywords?: (string[]|null); + /** ContactsArrayMessage displayName */ + displayName?: (string|null); - /** QuickReplyAction count */ - count?: (number|null); + /** ContactsArrayMessage contacts */ + contacts?: (proto.IContactMessage[]|null); - /** QuickReplyAction deleted */ - deleted?: (boolean|null); + /** ContactsArrayMessage contextInfo */ + contextInfo?: (proto.IContextInfo|null); } - /** Represents a QuickReplyAction. */ - class QuickReplyAction implements IQuickReplyAction { + /** Represents a ContactsArrayMessage. */ + class ContactsArrayMessage implements IContactsArrayMessage { /** - * Constructs a new QuickReplyAction. + * Constructs a new ContactsArrayMessage. * @param [properties] Properties to set */ - constructor(properties?: proto.IQuickReplyAction); - - /** QuickReplyAction shortcut. */ - public shortcut: string; - - /** QuickReplyAction message. */ - public message: string; + constructor(properties?: proto.IContactsArrayMessage); - /** QuickReplyAction keywords. */ - public keywords: string[]; + /** ContactsArrayMessage displayName. */ + public displayName: string; - /** QuickReplyAction count. */ - public count: number; + /** ContactsArrayMessage contacts. */ + public contacts: proto.IContactMessage[]; - /** QuickReplyAction deleted. */ - public deleted: boolean; + /** ContactsArrayMessage contextInfo. */ + public contextInfo?: (proto.IContextInfo|null); /** - * Creates a new QuickReplyAction instance using the specified properties. + * Creates a new ContactsArrayMessage instance using the specified properties. * @param [properties] Properties to set - * @returns QuickReplyAction instance + * @returns ContactsArrayMessage instance */ - public static create(properties?: proto.IQuickReplyAction): proto.QuickReplyAction; + public static create(properties?: proto.IContactsArrayMessage): proto.ContactsArrayMessage; /** - * Encodes the specified QuickReplyAction message. Does not implicitly {@link proto.QuickReplyAction.verify|verify} messages. - * @param message QuickReplyAction message or plain object to encode + * Encodes the specified ContactsArrayMessage message. Does not implicitly {@link proto.ContactsArrayMessage.verify|verify} messages. + * @param message ContactsArrayMessage message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: proto.IQuickReplyAction, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: proto.IContactsArrayMessage, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified QuickReplyAction message, length delimited. Does not implicitly {@link proto.QuickReplyAction.verify|verify} messages. - * @param message QuickReplyAction message or plain object to encode + * Encodes the specified ContactsArrayMessage message, length delimited. Does not implicitly {@link proto.ContactsArrayMessage.verify|verify} messages. + * @param message ContactsArrayMessage message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: proto.IQuickReplyAction, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: proto.IContactsArrayMessage, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a QuickReplyAction message from the specified reader or buffer. + * Decodes a ContactsArrayMessage message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns QuickReplyAction + * @returns ContactsArrayMessage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.QuickReplyAction; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.ContactsArrayMessage; /** - * Decodes a QuickReplyAction message from the specified reader or buffer, length delimited. + * Decodes a ContactsArrayMessage message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns QuickReplyAction + * @returns ContactsArrayMessage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.QuickReplyAction; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.ContactsArrayMessage; /** - * Verifies a QuickReplyAction message. + * Verifies a ContactsArrayMessage message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a QuickReplyAction message from a plain object. Also converts values to their respective internal types. + * Creates a ContactsArrayMessage message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns QuickReplyAction + * @returns ContactsArrayMessage */ - public static fromObject(object: { [k: string]: any }): proto.QuickReplyAction; + public static fromObject(object: { [k: string]: any }): proto.ContactsArrayMessage; /** - * Creates a plain object from a QuickReplyAction message. Also converts values to other types if specified. - * @param message QuickReplyAction + * Creates a plain object from a ContactsArrayMessage message. Also converts values to other types if specified. + * @param message ContactsArrayMessage * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: proto.QuickReplyAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: proto.ContactsArrayMessage, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this QuickReplyAction to JSON. + * Converts this ContactsArrayMessage to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a LabelAssociationAction. */ - interface ILabelAssociationAction { + /** Properties of a ContextInfo. */ + interface IContextInfo { - /** LabelAssociationAction labeled */ - labeled?: (boolean|null); - } + /** ContextInfo stanzaId */ + stanzaId?: (string|null); - /** Represents a LabelAssociationAction. */ - class LabelAssociationAction implements ILabelAssociationAction { + /** ContextInfo participant */ + participant?: (string|null); - /** - * Constructs a new LabelAssociationAction. - * @param [properties] Properties to set - */ - constructor(properties?: proto.ILabelAssociationAction); + /** ContextInfo quotedMessage */ + quotedMessage?: (proto.IMessage|null); - /** LabelAssociationAction labeled. */ - public labeled: boolean; + /** ContextInfo remoteJid */ + remoteJid?: (string|null); - /** - * Creates a new LabelAssociationAction instance using the specified properties. - * @param [properties] Properties to set - * @returns LabelAssociationAction instance - */ - public static create(properties?: proto.ILabelAssociationAction): proto.LabelAssociationAction; + /** ContextInfo mentionedJid */ + mentionedJid?: (string[]|null); - /** - * Encodes the specified LabelAssociationAction message. Does not implicitly {@link proto.LabelAssociationAction.verify|verify} messages. - * @param message LabelAssociationAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: proto.ILabelAssociationAction, writer?: $protobuf.Writer): $protobuf.Writer; + /** ContextInfo conversionSource */ + conversionSource?: (string|null); - /** - * Encodes the specified LabelAssociationAction message, length delimited. Does not implicitly {@link proto.LabelAssociationAction.verify|verify} messages. - * @param message LabelAssociationAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: proto.ILabelAssociationAction, writer?: $protobuf.Writer): $protobuf.Writer; + /** ContextInfo conversionData */ + conversionData?: (Uint8Array|null); - /** - * Decodes a LabelAssociationAction message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns LabelAssociationAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.LabelAssociationAction; + /** ContextInfo conversionDelaySeconds */ + conversionDelaySeconds?: (number|null); - /** - * Decodes a LabelAssociationAction message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns LabelAssociationAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.LabelAssociationAction; + /** ContextInfo forwardingScore */ + forwardingScore?: (number|null); - /** - * Verifies a LabelAssociationAction message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** ContextInfo isForwarded */ + isForwarded?: (boolean|null); - /** - * Creates a LabelAssociationAction message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns LabelAssociationAction - */ - public static fromObject(object: { [k: string]: any }): proto.LabelAssociationAction; + /** ContextInfo quotedAd */ + quotedAd?: (proto.IAdReplyInfo|null); - /** - * Creates a plain object from a LabelAssociationAction message. Also converts values to other types if specified. - * @param message LabelAssociationAction - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: proto.LabelAssociationAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** ContextInfo placeholderKey */ + placeholderKey?: (proto.IMessageKey|null); - /** - * Converts this LabelAssociationAction to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** ContextInfo expiration */ + expiration?: (number|null); - /** Properties of a LabelEditAction. */ - interface ILabelEditAction { + /** ContextInfo ephemeralSettingTimestamp */ + ephemeralSettingTimestamp?: (number|Long|null); - /** LabelEditAction name */ - name?: (string|null); + /** ContextInfo ephemeralSharedSecret */ + ephemeralSharedSecret?: (Uint8Array|null); - /** LabelEditAction color */ - color?: (number|null); + /** ContextInfo externalAdReply */ + externalAdReply?: (proto.IExternalAdReplyInfo|null); - /** LabelEditAction predefinedId */ - predefinedId?: (number|null); + /** ContextInfo entryPointConversionSource */ + entryPointConversionSource?: (string|null); - /** LabelEditAction deleted */ - deleted?: (boolean|null); + /** ContextInfo entryPointConversionApp */ + entryPointConversionApp?: (string|null); + + /** ContextInfo entryPointConversionDelaySeconds */ + entryPointConversionDelaySeconds?: (number|null); + + /** ContextInfo disappearingMode */ + disappearingMode?: (proto.IDisappearingMode|null); + + /** ContextInfo actionLink */ + actionLink?: (proto.IActionLink|null); + + /** ContextInfo groupSubject */ + groupSubject?: (string|null); + + /** ContextInfo parentGroupJid */ + parentGroupJid?: (string|null); } - /** Represents a LabelEditAction. */ - class LabelEditAction implements ILabelEditAction { + /** Represents a ContextInfo. */ + class ContextInfo implements IContextInfo { /** - * Constructs a new LabelEditAction. + * Constructs a new ContextInfo. * @param [properties] Properties to set */ - constructor(properties?: proto.ILabelEditAction); + constructor(properties?: proto.IContextInfo); - /** LabelEditAction name. */ - public name: string; + /** ContextInfo stanzaId. */ + public stanzaId: string; - /** LabelEditAction color. */ - public color: number; + /** ContextInfo participant. */ + public participant: string; - /** LabelEditAction predefinedId. */ - public predefinedId: number; + /** ContextInfo quotedMessage. */ + public quotedMessage?: (proto.IMessage|null); - /** LabelEditAction deleted. */ - public deleted: boolean; + /** ContextInfo remoteJid. */ + public remoteJid: string; + + /** ContextInfo mentionedJid. */ + public mentionedJid: string[]; + + /** ContextInfo conversionSource. */ + public conversionSource: string; + + /** ContextInfo conversionData. */ + public conversionData: Uint8Array; + + /** ContextInfo conversionDelaySeconds. */ + public conversionDelaySeconds: number; + + /** ContextInfo forwardingScore. */ + public forwardingScore: number; + + /** ContextInfo isForwarded. */ + public isForwarded: boolean; + + /** ContextInfo quotedAd. */ + public quotedAd?: (proto.IAdReplyInfo|null); + + /** ContextInfo placeholderKey. */ + public placeholderKey?: (proto.IMessageKey|null); + + /** ContextInfo expiration. */ + public expiration: number; + + /** ContextInfo ephemeralSettingTimestamp. */ + public ephemeralSettingTimestamp: (number|Long); + + /** ContextInfo ephemeralSharedSecret. */ + public ephemeralSharedSecret: Uint8Array; + + /** ContextInfo externalAdReply. */ + public externalAdReply?: (proto.IExternalAdReplyInfo|null); + + /** ContextInfo entryPointConversionSource. */ + public entryPointConversionSource: string; + + /** ContextInfo entryPointConversionApp. */ + public entryPointConversionApp: string; + + /** ContextInfo entryPointConversionDelaySeconds. */ + public entryPointConversionDelaySeconds: number; + + /** ContextInfo disappearingMode. */ + public disappearingMode?: (proto.IDisappearingMode|null); + + /** ContextInfo actionLink. */ + public actionLink?: (proto.IActionLink|null); + + /** ContextInfo groupSubject. */ + public groupSubject: string; + + /** ContextInfo parentGroupJid. */ + public parentGroupJid: string; /** - * Creates a new LabelEditAction instance using the specified properties. + * Creates a new ContextInfo instance using the specified properties. * @param [properties] Properties to set - * @returns LabelEditAction instance + * @returns ContextInfo instance */ - public static create(properties?: proto.ILabelEditAction): proto.LabelEditAction; + public static create(properties?: proto.IContextInfo): proto.ContextInfo; /** - * Encodes the specified LabelEditAction message. Does not implicitly {@link proto.LabelEditAction.verify|verify} messages. - * @param message LabelEditAction message or plain object to encode + * Encodes the specified ContextInfo message. Does not implicitly {@link proto.ContextInfo.verify|verify} messages. + * @param message ContextInfo message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: proto.ILabelEditAction, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: proto.IContextInfo, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified LabelEditAction message, length delimited. Does not implicitly {@link proto.LabelEditAction.verify|verify} messages. - * @param message LabelEditAction message or plain object to encode + * Encodes the specified ContextInfo message, length delimited. Does not implicitly {@link proto.ContextInfo.verify|verify} messages. + * @param message ContextInfo message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: proto.ILabelEditAction, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: proto.IContextInfo, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a LabelEditAction message from the specified reader or buffer. + * Decodes a ContextInfo message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns LabelEditAction + * @returns ContextInfo * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.LabelEditAction; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.ContextInfo; /** - * Decodes a LabelEditAction message from the specified reader or buffer, length delimited. + * Decodes a ContextInfo message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns LabelEditAction + * @returns ContextInfo * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.LabelEditAction; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.ContextInfo; /** - * Verifies a LabelEditAction message. + * Verifies a ContextInfo message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a LabelEditAction message from a plain object. Also converts values to their respective internal types. + * Creates a ContextInfo message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns LabelEditAction + * @returns ContextInfo */ - public static fromObject(object: { [k: string]: any }): proto.LabelEditAction; + public static fromObject(object: { [k: string]: any }): proto.ContextInfo; /** - * Creates a plain object from a LabelEditAction message. Also converts values to other types if specified. - * @param message LabelEditAction + * Creates a plain object from a ContextInfo message. Also converts values to other types if specified. + * @param message ContextInfo * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: proto.LabelEditAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: proto.ContextInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this LabelEditAction to JSON. + * Converts this ContextInfo to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a RecentStickerWeightsAction. */ - interface IRecentStickerWeightsAction { + /** Properties of a DeclinePaymentRequestMessage. */ + interface IDeclinePaymentRequestMessage { - /** RecentStickerWeightsAction weights */ - weights?: (proto.IRecentStickerWeight[]|null); + /** DeclinePaymentRequestMessage key */ + key?: (proto.IMessageKey|null); } - /** Represents a RecentStickerWeightsAction. */ - class RecentStickerWeightsAction implements IRecentStickerWeightsAction { + /** Represents a DeclinePaymentRequestMessage. */ + class DeclinePaymentRequestMessage implements IDeclinePaymentRequestMessage { /** - * Constructs a new RecentStickerWeightsAction. + * Constructs a new DeclinePaymentRequestMessage. * @param [properties] Properties to set */ - constructor(properties?: proto.IRecentStickerWeightsAction); + constructor(properties?: proto.IDeclinePaymentRequestMessage); - /** RecentStickerWeightsAction weights. */ - public weights: proto.IRecentStickerWeight[]; + /** DeclinePaymentRequestMessage key. */ + public key?: (proto.IMessageKey|null); /** - * Creates a new RecentStickerWeightsAction instance using the specified properties. + * Creates a new DeclinePaymentRequestMessage instance using the specified properties. * @param [properties] Properties to set - * @returns RecentStickerWeightsAction instance + * @returns DeclinePaymentRequestMessage instance */ - public static create(properties?: proto.IRecentStickerWeightsAction): proto.RecentStickerWeightsAction; + public static create(properties?: proto.IDeclinePaymentRequestMessage): proto.DeclinePaymentRequestMessage; /** - * Encodes the specified RecentStickerWeightsAction message. Does not implicitly {@link proto.RecentStickerWeightsAction.verify|verify} messages. - * @param message RecentStickerWeightsAction message or plain object to encode + * Encodes the specified DeclinePaymentRequestMessage message. Does not implicitly {@link proto.DeclinePaymentRequestMessage.verify|verify} messages. + * @param message DeclinePaymentRequestMessage message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: proto.IRecentStickerWeightsAction, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: proto.IDeclinePaymentRequestMessage, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified RecentStickerWeightsAction message, length delimited. Does not implicitly {@link proto.RecentStickerWeightsAction.verify|verify} messages. - * @param message RecentStickerWeightsAction message or plain object to encode + * Encodes the specified DeclinePaymentRequestMessage message, length delimited. Does not implicitly {@link proto.DeclinePaymentRequestMessage.verify|verify} messages. + * @param message DeclinePaymentRequestMessage message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: proto.IRecentStickerWeightsAction, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: proto.IDeclinePaymentRequestMessage, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a RecentStickerWeightsAction message from the specified reader or buffer. + * Decodes a DeclinePaymentRequestMessage message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns RecentStickerWeightsAction + * @returns DeclinePaymentRequestMessage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.RecentStickerWeightsAction; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.DeclinePaymentRequestMessage; /** - * Decodes a RecentStickerWeightsAction message from the specified reader or buffer, length delimited. + * Decodes a DeclinePaymentRequestMessage message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns RecentStickerWeightsAction + * @returns DeclinePaymentRequestMessage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.RecentStickerWeightsAction; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.DeclinePaymentRequestMessage; /** - * Verifies a RecentStickerWeightsAction message. + * Verifies a DeclinePaymentRequestMessage message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a RecentStickerWeightsAction message from a plain object. Also converts values to their respective internal types. + * Creates a DeclinePaymentRequestMessage message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns RecentStickerWeightsAction + * @returns DeclinePaymentRequestMessage */ - public static fromObject(object: { [k: string]: any }): proto.RecentStickerWeightsAction; + public static fromObject(object: { [k: string]: any }): proto.DeclinePaymentRequestMessage; /** - * Creates a plain object from a RecentStickerWeightsAction message. Also converts values to other types if specified. - * @param message RecentStickerWeightsAction + * Creates a plain object from a DeclinePaymentRequestMessage message. Also converts values to other types if specified. + * @param message DeclinePaymentRequestMessage * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: proto.RecentStickerWeightsAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: proto.DeclinePaymentRequestMessage, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this RecentStickerWeightsAction to JSON. + * Converts this DeclinePaymentRequestMessage to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a RecentStickerMetadata. */ - interface IRecentStickerMetadata { + /** Properties of a DeviceListMetadata. */ + interface IDeviceListMetadata { - /** RecentStickerMetadata directPath */ - directPath?: (string|null); + /** DeviceListMetadata senderKeyHash */ + senderKeyHash?: (Uint8Array|null); - /** RecentStickerMetadata encFilehash */ - encFilehash?: (string|null); + /** DeviceListMetadata senderTimestamp */ + senderTimestamp?: (number|Long|null); - /** RecentStickerMetadata mediaKey */ - mediaKey?: (string|null); - - /** RecentStickerMetadata stanzaId */ - stanzaId?: (string|null); + /** DeviceListMetadata senderKeyIndexes */ + senderKeyIndexes?: (number[]|null); - /** RecentStickerMetadata chatJid */ - chatJid?: (string|null); + /** DeviceListMetadata recipientKeyHash */ + recipientKeyHash?: (Uint8Array|null); - /** RecentStickerMetadata participant */ - participant?: (string|null); + /** DeviceListMetadata recipientTimestamp */ + recipientTimestamp?: (number|Long|null); - /** RecentStickerMetadata isSentByMe */ - isSentByMe?: (boolean|null); + /** DeviceListMetadata recipientKeyIndexes */ + recipientKeyIndexes?: (number[]|null); } - /** Represents a RecentStickerMetadata. */ - class RecentStickerMetadata implements IRecentStickerMetadata { + /** Represents a DeviceListMetadata. */ + class DeviceListMetadata implements IDeviceListMetadata { /** - * Constructs a new RecentStickerMetadata. + * Constructs a new DeviceListMetadata. * @param [properties] Properties to set */ - constructor(properties?: proto.IRecentStickerMetadata); - - /** RecentStickerMetadata directPath. */ - public directPath: string; + constructor(properties?: proto.IDeviceListMetadata); - /** RecentStickerMetadata encFilehash. */ - public encFilehash: string; + /** DeviceListMetadata senderKeyHash. */ + public senderKeyHash: Uint8Array; - /** RecentStickerMetadata mediaKey. */ - public mediaKey: string; + /** DeviceListMetadata senderTimestamp. */ + public senderTimestamp: (number|Long); - /** RecentStickerMetadata stanzaId. */ - public stanzaId: string; + /** DeviceListMetadata senderKeyIndexes. */ + public senderKeyIndexes: number[]; - /** RecentStickerMetadata chatJid. */ - public chatJid: string; + /** DeviceListMetadata recipientKeyHash. */ + public recipientKeyHash: Uint8Array; - /** RecentStickerMetadata participant. */ - public participant: string; + /** DeviceListMetadata recipientTimestamp. */ + public recipientTimestamp: (number|Long); - /** RecentStickerMetadata isSentByMe. */ - public isSentByMe: boolean; + /** DeviceListMetadata recipientKeyIndexes. */ + public recipientKeyIndexes: number[]; /** - * Creates a new RecentStickerMetadata instance using the specified properties. + * Creates a new DeviceListMetadata instance using the specified properties. * @param [properties] Properties to set - * @returns RecentStickerMetadata instance + * @returns DeviceListMetadata instance */ - public static create(properties?: proto.IRecentStickerMetadata): proto.RecentStickerMetadata; + public static create(properties?: proto.IDeviceListMetadata): proto.DeviceListMetadata; /** - * Encodes the specified RecentStickerMetadata message. Does not implicitly {@link proto.RecentStickerMetadata.verify|verify} messages. - * @param message RecentStickerMetadata message or plain object to encode + * Encodes the specified DeviceListMetadata message. Does not implicitly {@link proto.DeviceListMetadata.verify|verify} messages. + * @param message DeviceListMetadata message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: proto.IRecentStickerMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: proto.IDeviceListMetadata, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified RecentStickerMetadata message, length delimited. Does not implicitly {@link proto.RecentStickerMetadata.verify|verify} messages. - * @param message RecentStickerMetadata message or plain object to encode + * Encodes the specified DeviceListMetadata message, length delimited. Does not implicitly {@link proto.DeviceListMetadata.verify|verify} messages. + * @param message DeviceListMetadata message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: proto.IRecentStickerMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: proto.IDeviceListMetadata, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a RecentStickerMetadata message from the specified reader or buffer. + * Decodes a DeviceListMetadata message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns RecentStickerMetadata + * @returns DeviceListMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.RecentStickerMetadata; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.DeviceListMetadata; /** - * Decodes a RecentStickerMetadata message from the specified reader or buffer, length delimited. + * Decodes a DeviceListMetadata message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns RecentStickerMetadata + * @returns DeviceListMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.RecentStickerMetadata; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.DeviceListMetadata; /** - * Verifies a RecentStickerMetadata message. + * Verifies a DeviceListMetadata message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a RecentStickerMetadata message from a plain object. Also converts values to their respective internal types. + * Creates a DeviceListMetadata message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns RecentStickerMetadata + * @returns DeviceListMetadata */ - public static fromObject(object: { [k: string]: any }): proto.RecentStickerMetadata; + public static fromObject(object: { [k: string]: any }): proto.DeviceListMetadata; /** - * Creates a plain object from a RecentStickerMetadata message. Also converts values to other types if specified. - * @param message RecentStickerMetadata + * Creates a plain object from a DeviceListMetadata message. Also converts values to other types if specified. + * @param message DeviceListMetadata * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: proto.RecentStickerMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: proto.DeviceListMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this RecentStickerMetadata to JSON. + * Converts this DeviceListMetadata to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a RecentEmojiWeightsAction. */ - interface IRecentEmojiWeightsAction { + /** Properties of a DeviceSentMessage. */ + interface IDeviceSentMessage { - /** RecentEmojiWeightsAction weights */ - weights?: (proto.IRecentEmojiWeight[]|null); + /** DeviceSentMessage destinationJid */ + destinationJid?: (string|null); + + /** DeviceSentMessage message */ + message?: (proto.IMessage|null); + + /** DeviceSentMessage phash */ + phash?: (string|null); } - /** Represents a RecentEmojiWeightsAction. */ - class RecentEmojiWeightsAction implements IRecentEmojiWeightsAction { + /** Represents a DeviceSentMessage. */ + class DeviceSentMessage implements IDeviceSentMessage { /** - * Constructs a new RecentEmojiWeightsAction. + * Constructs a new DeviceSentMessage. * @param [properties] Properties to set */ - constructor(properties?: proto.IRecentEmojiWeightsAction); + constructor(properties?: proto.IDeviceSentMessage); - /** RecentEmojiWeightsAction weights. */ - public weights: proto.IRecentEmojiWeight[]; + /** DeviceSentMessage destinationJid. */ + public destinationJid: string; + + /** DeviceSentMessage message. */ + public message?: (proto.IMessage|null); + + /** DeviceSentMessage phash. */ + public phash: string; /** - * Creates a new RecentEmojiWeightsAction instance using the specified properties. + * Creates a new DeviceSentMessage instance using the specified properties. * @param [properties] Properties to set - * @returns RecentEmojiWeightsAction instance + * @returns DeviceSentMessage instance */ - public static create(properties?: proto.IRecentEmojiWeightsAction): proto.RecentEmojiWeightsAction; + public static create(properties?: proto.IDeviceSentMessage): proto.DeviceSentMessage; /** - * Encodes the specified RecentEmojiWeightsAction message. Does not implicitly {@link proto.RecentEmojiWeightsAction.verify|verify} messages. - * @param message RecentEmojiWeightsAction message or plain object to encode + * Encodes the specified DeviceSentMessage message. Does not implicitly {@link proto.DeviceSentMessage.verify|verify} messages. + * @param message DeviceSentMessage message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: proto.IRecentEmojiWeightsAction, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: proto.IDeviceSentMessage, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified RecentEmojiWeightsAction message, length delimited. Does not implicitly {@link proto.RecentEmojiWeightsAction.verify|verify} messages. - * @param message RecentEmojiWeightsAction message or plain object to encode + * Encodes the specified DeviceSentMessage message, length delimited. Does not implicitly {@link proto.DeviceSentMessage.verify|verify} messages. + * @param message DeviceSentMessage message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: proto.IRecentEmojiWeightsAction, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: proto.IDeviceSentMessage, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a RecentEmojiWeightsAction message from the specified reader or buffer. + * Decodes a DeviceSentMessage message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns RecentEmojiWeightsAction + * @returns DeviceSentMessage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.RecentEmojiWeightsAction; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.DeviceSentMessage; /** - * Decodes a RecentEmojiWeightsAction message from the specified reader or buffer, length delimited. + * Decodes a DeviceSentMessage message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns RecentEmojiWeightsAction + * @returns DeviceSentMessage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.RecentEmojiWeightsAction; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.DeviceSentMessage; /** - * Verifies a RecentEmojiWeightsAction message. + * Verifies a DeviceSentMessage message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a RecentEmojiWeightsAction message from a plain object. Also converts values to their respective internal types. + * Creates a DeviceSentMessage message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns RecentEmojiWeightsAction + * @returns DeviceSentMessage */ - public static fromObject(object: { [k: string]: any }): proto.RecentEmojiWeightsAction; + public static fromObject(object: { [k: string]: any }): proto.DeviceSentMessage; /** - * Creates a plain object from a RecentEmojiWeightsAction message. Also converts values to other types if specified. - * @param message RecentEmojiWeightsAction + * Creates a plain object from a DeviceSentMessage message. Also converts values to other types if specified. + * @param message DeviceSentMessage * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: proto.RecentEmojiWeightsAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: proto.DeviceSentMessage, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this RecentEmojiWeightsAction to JSON. + * Converts this DeviceSentMessage to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a FavoriteStickerAction. */ - interface IFavoriteStickerAction { - - /** FavoriteStickerAction directPath */ - directPath?: (string|null); - - /** FavoriteStickerAction lastUploadTimestamp */ - lastUploadTimestamp?: (string|null); - - /** FavoriteStickerAction handle */ - handle?: (string|null); - - /** FavoriteStickerAction encFilehash */ - encFilehash?: (string|null); - - /** FavoriteStickerAction stickerHashWithoutMeta */ - stickerHashWithoutMeta?: (string|null); - - /** FavoriteStickerAction mediaKey */ - mediaKey?: (string|null); - - /** FavoriteStickerAction mediaKeyTimestamp */ - mediaKeyTimestamp?: (number|Long|null); + /** Properties of a DisappearingMode. */ + interface IDisappearingMode { - /** FavoriteStickerAction isFavorite */ - isFavorite?: (boolean|null); + /** DisappearingMode initiator */ + initiator?: (proto.DisappearingMode.DisappearingModeInitiator|null); } - /** Represents a FavoriteStickerAction. */ - class FavoriteStickerAction implements IFavoriteStickerAction { + /** Represents a DisappearingMode. */ + class DisappearingMode implements IDisappearingMode { /** - * Constructs a new FavoriteStickerAction. + * Constructs a new DisappearingMode. * @param [properties] Properties to set */ - constructor(properties?: proto.IFavoriteStickerAction); - - /** FavoriteStickerAction directPath. */ - public directPath: string; - - /** FavoriteStickerAction lastUploadTimestamp. */ - public lastUploadTimestamp: string; - - /** FavoriteStickerAction handle. */ - public handle: string; - - /** FavoriteStickerAction encFilehash. */ - public encFilehash: string; - - /** FavoriteStickerAction stickerHashWithoutMeta. */ - public stickerHashWithoutMeta: string; - - /** FavoriteStickerAction mediaKey. */ - public mediaKey: string; - - /** FavoriteStickerAction mediaKeyTimestamp. */ - public mediaKeyTimestamp: (number|Long); + constructor(properties?: proto.IDisappearingMode); - /** FavoriteStickerAction isFavorite. */ - public isFavorite: boolean; + /** DisappearingMode initiator. */ + public initiator: proto.DisappearingMode.DisappearingModeInitiator; /** - * Creates a new FavoriteStickerAction instance using the specified properties. + * Creates a new DisappearingMode instance using the specified properties. * @param [properties] Properties to set - * @returns FavoriteStickerAction instance + * @returns DisappearingMode instance */ - public static create(properties?: proto.IFavoriteStickerAction): proto.FavoriteStickerAction; + public static create(properties?: proto.IDisappearingMode): proto.DisappearingMode; /** - * Encodes the specified FavoriteStickerAction message. Does not implicitly {@link proto.FavoriteStickerAction.verify|verify} messages. - * @param message FavoriteStickerAction message or plain object to encode + * Encodes the specified DisappearingMode message. Does not implicitly {@link proto.DisappearingMode.verify|verify} messages. + * @param message DisappearingMode message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: proto.IFavoriteStickerAction, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: proto.IDisappearingMode, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified FavoriteStickerAction message, length delimited. Does not implicitly {@link proto.FavoriteStickerAction.verify|verify} messages. - * @param message FavoriteStickerAction message or plain object to encode + * Encodes the specified DisappearingMode message, length delimited. Does not implicitly {@link proto.DisappearingMode.verify|verify} messages. + * @param message DisappearingMode message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: proto.IFavoriteStickerAction, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: proto.IDisappearingMode, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a FavoriteStickerAction message from the specified reader or buffer. + * Decodes a DisappearingMode message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns FavoriteStickerAction + * @returns DisappearingMode * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.FavoriteStickerAction; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.DisappearingMode; /** - * Decodes a FavoriteStickerAction message from the specified reader or buffer, length delimited. + * Decodes a DisappearingMode message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns FavoriteStickerAction + * @returns DisappearingMode * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.FavoriteStickerAction; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.DisappearingMode; /** - * Verifies a FavoriteStickerAction message. + * Verifies a DisappearingMode message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a FavoriteStickerAction message from a plain object. Also converts values to their respective internal types. + * Creates a DisappearingMode message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns FavoriteStickerAction + * @returns DisappearingMode */ - public static fromObject(object: { [k: string]: any }): proto.FavoriteStickerAction; + public static fromObject(object: { [k: string]: any }): proto.DisappearingMode; /** - * Creates a plain object from a FavoriteStickerAction message. Also converts values to other types if specified. - * @param message FavoriteStickerAction + * Creates a plain object from a DisappearingMode message. Also converts values to other types if specified. + * @param message DisappearingMode * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: proto.FavoriteStickerAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: proto.DisappearingMode, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this FavoriteStickerAction to JSON. + * Converts this DisappearingMode to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of an ArchiveChatAction. */ - interface IArchiveChatAction { + namespace DisappearingMode { - /** ArchiveChatAction archived */ - archived?: (boolean|null); + /** DisappearingModeInitiator enum. */ + enum DisappearingModeInitiator { + CHANGED_IN_CHAT = 0, + INITIATED_BY_ME = 1, + INITIATED_BY_OTHER = 2 + } + } - /** ArchiveChatAction messageRange */ - messageRange?: (proto.ISyncActionMessageRange|null); + /** Properties of a DocumentMessage. */ + interface IDocumentMessage { + + /** DocumentMessage url */ + url?: (string|null); + + /** DocumentMessage mimetype */ + mimetype?: (string|null); + + /** DocumentMessage title */ + title?: (string|null); + + /** DocumentMessage fileSha256 */ + fileSha256?: (Uint8Array|null); + + /** DocumentMessage fileLength */ + fileLength?: (number|Long|null); + + /** DocumentMessage pageCount */ + pageCount?: (number|null); + + /** DocumentMessage mediaKey */ + mediaKey?: (Uint8Array|null); + + /** DocumentMessage fileName */ + fileName?: (string|null); + + /** DocumentMessage fileEncSha256 */ + fileEncSha256?: (Uint8Array|null); + + /** DocumentMessage directPath */ + directPath?: (string|null); + + /** DocumentMessage mediaKeyTimestamp */ + mediaKeyTimestamp?: (number|Long|null); + + /** DocumentMessage contactVcard */ + contactVcard?: (boolean|null); + + /** DocumentMessage thumbnailDirectPath */ + thumbnailDirectPath?: (string|null); + + /** DocumentMessage thumbnailSha256 */ + thumbnailSha256?: (Uint8Array|null); + + /** DocumentMessage thumbnailEncSha256 */ + thumbnailEncSha256?: (Uint8Array|null); + + /** DocumentMessage jpegThumbnail */ + jpegThumbnail?: (Uint8Array|null); + + /** DocumentMessage contextInfo */ + contextInfo?: (proto.IContextInfo|null); + + /** DocumentMessage thumbnailHeight */ + thumbnailHeight?: (number|null); + + /** DocumentMessage thumbnailWidth */ + thumbnailWidth?: (number|null); } - /** Represents an ArchiveChatAction. */ - class ArchiveChatAction implements IArchiveChatAction { + /** Represents a DocumentMessage. */ + class DocumentMessage implements IDocumentMessage { /** - * Constructs a new ArchiveChatAction. + * Constructs a new DocumentMessage. * @param [properties] Properties to set */ - constructor(properties?: proto.IArchiveChatAction); + constructor(properties?: proto.IDocumentMessage); - /** ArchiveChatAction archived. */ - public archived: boolean; + /** DocumentMessage url. */ + public url: string; - /** ArchiveChatAction messageRange. */ - public messageRange?: (proto.ISyncActionMessageRange|null); + /** DocumentMessage mimetype. */ + public mimetype: string; + + /** DocumentMessage title. */ + public title: string; + + /** DocumentMessage fileSha256. */ + public fileSha256: Uint8Array; + + /** DocumentMessage fileLength. */ + public fileLength: (number|Long); + + /** DocumentMessage pageCount. */ + public pageCount: number; + + /** DocumentMessage mediaKey. */ + public mediaKey: Uint8Array; + + /** DocumentMessage fileName. */ + public fileName: string; + + /** DocumentMessage fileEncSha256. */ + public fileEncSha256: Uint8Array; + + /** DocumentMessage directPath. */ + public directPath: string; + + /** DocumentMessage mediaKeyTimestamp. */ + public mediaKeyTimestamp: (number|Long); + + /** DocumentMessage contactVcard. */ + public contactVcard: boolean; + + /** DocumentMessage thumbnailDirectPath. */ + public thumbnailDirectPath: string; + + /** DocumentMessage thumbnailSha256. */ + public thumbnailSha256: Uint8Array; + + /** DocumentMessage thumbnailEncSha256. */ + public thumbnailEncSha256: Uint8Array; + + /** DocumentMessage jpegThumbnail. */ + public jpegThumbnail: Uint8Array; + + /** DocumentMessage contextInfo. */ + public contextInfo?: (proto.IContextInfo|null); + + /** DocumentMessage thumbnailHeight. */ + public thumbnailHeight: number; + + /** DocumentMessage thumbnailWidth. */ + public thumbnailWidth: number; /** - * Creates a new ArchiveChatAction instance using the specified properties. + * Creates a new DocumentMessage instance using the specified properties. * @param [properties] Properties to set - * @returns ArchiveChatAction instance + * @returns DocumentMessage instance */ - public static create(properties?: proto.IArchiveChatAction): proto.ArchiveChatAction; + public static create(properties?: proto.IDocumentMessage): proto.DocumentMessage; /** - * Encodes the specified ArchiveChatAction message. Does not implicitly {@link proto.ArchiveChatAction.verify|verify} messages. - * @param message ArchiveChatAction message or plain object to encode + * Encodes the specified DocumentMessage message. Does not implicitly {@link proto.DocumentMessage.verify|verify} messages. + * @param message DocumentMessage message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: proto.IArchiveChatAction, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: proto.IDocumentMessage, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ArchiveChatAction message, length delimited. Does not implicitly {@link proto.ArchiveChatAction.verify|verify} messages. - * @param message ArchiveChatAction message or plain object to encode + * Encodes the specified DocumentMessage message, length delimited. Does not implicitly {@link proto.DocumentMessage.verify|verify} messages. + * @param message DocumentMessage message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: proto.IArchiveChatAction, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: proto.IDocumentMessage, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an ArchiveChatAction message from the specified reader or buffer. + * Decodes a DocumentMessage message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ArchiveChatAction + * @returns DocumentMessage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.ArchiveChatAction; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.DocumentMessage; /** - * Decodes an ArchiveChatAction message from the specified reader or buffer, length delimited. + * Decodes a DocumentMessage message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ArchiveChatAction + * @returns DocumentMessage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.ArchiveChatAction; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.DocumentMessage; /** - * Verifies an ArchiveChatAction message. + * Verifies a DocumentMessage message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates an ArchiveChatAction message from a plain object. Also converts values to their respective internal types. + * Creates a DocumentMessage message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ArchiveChatAction + * @returns DocumentMessage */ - public static fromObject(object: { [k: string]: any }): proto.ArchiveChatAction; + public static fromObject(object: { [k: string]: any }): proto.DocumentMessage; /** - * Creates a plain object from an ArchiveChatAction message. Also converts values to other types if specified. - * @param message ArchiveChatAction + * Creates a plain object from a DocumentMessage message. Also converts values to other types if specified. + * @param message DocumentMessage * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: proto.ArchiveChatAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: proto.DocumentMessage, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ArchiveChatAction to JSON. + * Converts this DocumentMessage to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a DeleteMessageForMeAction. */ - interface IDeleteMessageForMeAction { + /** Properties of an ExtendedTextMessage. */ + interface IExtendedTextMessage { - /** DeleteMessageForMeAction deleteMedia */ - deleteMedia?: (boolean|null); + /** ExtendedTextMessage text */ + text?: (string|null); - /** DeleteMessageForMeAction messageTimestamp */ - messageTimestamp?: (number|Long|null); - } + /** ExtendedTextMessage matchedText */ + matchedText?: (string|null); - /** Represents a DeleteMessageForMeAction. */ - class DeleteMessageForMeAction implements IDeleteMessageForMeAction { + /** ExtendedTextMessage canonicalUrl */ + canonicalUrl?: (string|null); - /** - * Constructs a new DeleteMessageForMeAction. - * @param [properties] Properties to set - */ - constructor(properties?: proto.IDeleteMessageForMeAction); + /** ExtendedTextMessage description */ + description?: (string|null); - /** DeleteMessageForMeAction deleteMedia. */ - public deleteMedia: boolean; + /** ExtendedTextMessage title */ + title?: (string|null); - /** DeleteMessageForMeAction messageTimestamp. */ - public messageTimestamp: (number|Long); + /** ExtendedTextMessage textArgb */ + textArgb?: (number|null); - /** - * Creates a new DeleteMessageForMeAction instance using the specified properties. - * @param [properties] Properties to set - * @returns DeleteMessageForMeAction instance - */ - public static create(properties?: proto.IDeleteMessageForMeAction): proto.DeleteMessageForMeAction; + /** ExtendedTextMessage backgroundArgb */ + backgroundArgb?: (number|null); - /** - * Encodes the specified DeleteMessageForMeAction message. Does not implicitly {@link proto.DeleteMessageForMeAction.verify|verify} messages. - * @param message DeleteMessageForMeAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: proto.IDeleteMessageForMeAction, writer?: $protobuf.Writer): $protobuf.Writer; + /** ExtendedTextMessage font */ + font?: (proto.ExtendedTextMessage.ExtendedTextMessageFontType|null); - /** - * Encodes the specified DeleteMessageForMeAction message, length delimited. Does not implicitly {@link proto.DeleteMessageForMeAction.verify|verify} messages. - * @param message DeleteMessageForMeAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: proto.IDeleteMessageForMeAction, writer?: $protobuf.Writer): $protobuf.Writer; + /** ExtendedTextMessage previewType */ + previewType?: (proto.ExtendedTextMessage.ExtendedTextMessagePreviewType|null); - /** - * Decodes a DeleteMessageForMeAction message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DeleteMessageForMeAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.DeleteMessageForMeAction; + /** ExtendedTextMessage jpegThumbnail */ + jpegThumbnail?: (Uint8Array|null); - /** - * Decodes a DeleteMessageForMeAction message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DeleteMessageForMeAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.DeleteMessageForMeAction; + /** ExtendedTextMessage contextInfo */ + contextInfo?: (proto.IContextInfo|null); - /** - * Verifies a DeleteMessageForMeAction message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** ExtendedTextMessage doNotPlayInline */ + doNotPlayInline?: (boolean|null); - /** - * Creates a DeleteMessageForMeAction message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeleteMessageForMeAction - */ - public static fromObject(object: { [k: string]: any }): proto.DeleteMessageForMeAction; + /** ExtendedTextMessage thumbnailDirectPath */ + thumbnailDirectPath?: (string|null); - /** - * Creates a plain object from a DeleteMessageForMeAction message. Also converts values to other types if specified. - * @param message DeleteMessageForMeAction - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: proto.DeleteMessageForMeAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** ExtendedTextMessage thumbnailSha256 */ + thumbnailSha256?: (Uint8Array|null); - /** - * Converts this DeleteMessageForMeAction to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** ExtendedTextMessage thumbnailEncSha256 */ + thumbnailEncSha256?: (Uint8Array|null); - /** Properties of a MarkChatAsReadAction. */ - interface IMarkChatAsReadAction { + /** ExtendedTextMessage mediaKey */ + mediaKey?: (Uint8Array|null); - /** MarkChatAsReadAction read */ - read?: (boolean|null); + /** ExtendedTextMessage mediaKeyTimestamp */ + mediaKeyTimestamp?: (number|Long|null); - /** MarkChatAsReadAction messageRange */ - messageRange?: (proto.ISyncActionMessageRange|null); + /** ExtendedTextMessage thumbnailHeight */ + thumbnailHeight?: (number|null); + + /** ExtendedTextMessage thumbnailWidth */ + thumbnailWidth?: (number|null); + + /** ExtendedTextMessage inviteLinkGroupType */ + inviteLinkGroupType?: (proto.ExtendedTextMessage.ExtendedTextMessageInviteLinkGroupType|null); } - /** Represents a MarkChatAsReadAction. */ - class MarkChatAsReadAction implements IMarkChatAsReadAction { + /** Represents an ExtendedTextMessage. */ + class ExtendedTextMessage implements IExtendedTextMessage { /** - * Constructs a new MarkChatAsReadAction. + * Constructs a new ExtendedTextMessage. * @param [properties] Properties to set */ - constructor(properties?: proto.IMarkChatAsReadAction); + constructor(properties?: proto.IExtendedTextMessage); - /** MarkChatAsReadAction read. */ - public read: boolean; + /** ExtendedTextMessage text. */ + public text: string; - /** MarkChatAsReadAction messageRange. */ - public messageRange?: (proto.ISyncActionMessageRange|null); + /** ExtendedTextMessage matchedText. */ + public matchedText: string; + + /** ExtendedTextMessage canonicalUrl. */ + public canonicalUrl: string; + + /** ExtendedTextMessage description. */ + public description: string; + + /** ExtendedTextMessage title. */ + public title: string; + + /** ExtendedTextMessage textArgb. */ + public textArgb: number; + + /** ExtendedTextMessage backgroundArgb. */ + public backgroundArgb: number; + + /** ExtendedTextMessage font. */ + public font: proto.ExtendedTextMessage.ExtendedTextMessageFontType; + + /** ExtendedTextMessage previewType. */ + public previewType: proto.ExtendedTextMessage.ExtendedTextMessagePreviewType; + + /** ExtendedTextMessage jpegThumbnail. */ + public jpegThumbnail: Uint8Array; + + /** ExtendedTextMessage contextInfo. */ + public contextInfo?: (proto.IContextInfo|null); + + /** ExtendedTextMessage doNotPlayInline. */ + public doNotPlayInline: boolean; + + /** ExtendedTextMessage thumbnailDirectPath. */ + public thumbnailDirectPath: string; + + /** ExtendedTextMessage thumbnailSha256. */ + public thumbnailSha256: Uint8Array; + + /** ExtendedTextMessage thumbnailEncSha256. */ + public thumbnailEncSha256: Uint8Array; + + /** ExtendedTextMessage mediaKey. */ + public mediaKey: Uint8Array; + + /** ExtendedTextMessage mediaKeyTimestamp. */ + public mediaKeyTimestamp: (number|Long); + + /** ExtendedTextMessage thumbnailHeight. */ + public thumbnailHeight: number; + + /** ExtendedTextMessage thumbnailWidth. */ + public thumbnailWidth: number; + + /** ExtendedTextMessage inviteLinkGroupType. */ + public inviteLinkGroupType: proto.ExtendedTextMessage.ExtendedTextMessageInviteLinkGroupType; /** - * Creates a new MarkChatAsReadAction instance using the specified properties. + * Creates a new ExtendedTextMessage instance using the specified properties. * @param [properties] Properties to set - * @returns MarkChatAsReadAction instance + * @returns ExtendedTextMessage instance */ - public static create(properties?: proto.IMarkChatAsReadAction): proto.MarkChatAsReadAction; + public static create(properties?: proto.IExtendedTextMessage): proto.ExtendedTextMessage; /** - * Encodes the specified MarkChatAsReadAction message. Does not implicitly {@link proto.MarkChatAsReadAction.verify|verify} messages. - * @param message MarkChatAsReadAction message or plain object to encode + * Encodes the specified ExtendedTextMessage message. Does not implicitly {@link proto.ExtendedTextMessage.verify|verify} messages. + * @param message ExtendedTextMessage message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: proto.IMarkChatAsReadAction, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: proto.IExtendedTextMessage, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified MarkChatAsReadAction message, length delimited. Does not implicitly {@link proto.MarkChatAsReadAction.verify|verify} messages. - * @param message MarkChatAsReadAction message or plain object to encode + * Encodes the specified ExtendedTextMessage message, length delimited. Does not implicitly {@link proto.ExtendedTextMessage.verify|verify} messages. + * @param message ExtendedTextMessage message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: proto.IMarkChatAsReadAction, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: proto.IExtendedTextMessage, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a MarkChatAsReadAction message from the specified reader or buffer. + * Decodes an ExtendedTextMessage message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns MarkChatAsReadAction + * @returns ExtendedTextMessage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.MarkChatAsReadAction; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.ExtendedTextMessage; /** - * Decodes a MarkChatAsReadAction message from the specified reader or buffer, length delimited. + * Decodes an ExtendedTextMessage message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns MarkChatAsReadAction + * @returns ExtendedTextMessage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.MarkChatAsReadAction; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.ExtendedTextMessage; /** - * Verifies a MarkChatAsReadAction message. + * Verifies an ExtendedTextMessage message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a MarkChatAsReadAction message from a plain object. Also converts values to their respective internal types. + * Creates an ExtendedTextMessage message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns MarkChatAsReadAction + * @returns ExtendedTextMessage */ - public static fromObject(object: { [k: string]: any }): proto.MarkChatAsReadAction; + public static fromObject(object: { [k: string]: any }): proto.ExtendedTextMessage; /** - * Creates a plain object from a MarkChatAsReadAction message. Also converts values to other types if specified. - * @param message MarkChatAsReadAction + * Creates a plain object from an ExtendedTextMessage message. Also converts values to other types if specified. + * @param message ExtendedTextMessage * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: proto.MarkChatAsReadAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: proto.ExtendedTextMessage, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this MarkChatAsReadAction to JSON. + * Converts this ExtendedTextMessage to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a ClearChatAction. */ - interface IClearChatAction { + namespace ExtendedTextMessage { - /** ClearChatAction messageRange */ - messageRange?: (proto.ISyncActionMessageRange|null); + /** ExtendedTextMessageFontType enum. */ + enum ExtendedTextMessageFontType { + SANS_SERIF = 0, + SERIF = 1, + NORICAN_REGULAR = 2, + BRYNDAN_WRITE = 3, + BEBASNEUE_REGULAR = 4, + OSWALD_HEAVY = 5 + } + + /** ExtendedTextMessagePreviewType enum. */ + enum ExtendedTextMessagePreviewType { + NONE = 0, + VIDEO = 1 + } + + /** ExtendedTextMessageInviteLinkGroupType enum. */ + enum ExtendedTextMessageInviteLinkGroupType { + DEFAULT = 0, + PARENT = 1 + } } - /** Represents a ClearChatAction. */ - class ClearChatAction implements IClearChatAction { + /** Properties of an ExternalAdReplyInfo. */ + interface IExternalAdReplyInfo { - /** - * Constructs a new ClearChatAction. - * @param [properties] Properties to set - */ - constructor(properties?: proto.IClearChatAction); + /** ExternalAdReplyInfo title */ + title?: (string|null); - /** ClearChatAction messageRange. */ - public messageRange?: (proto.ISyncActionMessageRange|null); + /** ExternalAdReplyInfo body */ + body?: (string|null); - /** - * Creates a new ClearChatAction instance using the specified properties. - * @param [properties] Properties to set - * @returns ClearChatAction instance - */ - public static create(properties?: proto.IClearChatAction): proto.ClearChatAction; + /** ExternalAdReplyInfo mediaType */ + mediaType?: (proto.ExternalAdReplyInfo.ExternalAdReplyInfoMediaType|null); - /** - * Encodes the specified ClearChatAction message. Does not implicitly {@link proto.ClearChatAction.verify|verify} messages. - * @param message ClearChatAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: proto.IClearChatAction, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ClearChatAction message, length delimited. Does not implicitly {@link proto.ClearChatAction.verify|verify} messages. - * @param message ClearChatAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: proto.IClearChatAction, writer?: $protobuf.Writer): $protobuf.Writer; + /** ExternalAdReplyInfo thumbnailUrl */ + thumbnailUrl?: (string|null); - /** - * Decodes a ClearChatAction message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ClearChatAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.ClearChatAction; + /** ExternalAdReplyInfo mediaUrl */ + mediaUrl?: (string|null); - /** - * Decodes a ClearChatAction message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ClearChatAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.ClearChatAction; + /** ExternalAdReplyInfo thumbnail */ + thumbnail?: (Uint8Array|null); - /** - * Verifies a ClearChatAction message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** ExternalAdReplyInfo sourceType */ + sourceType?: (string|null); - /** - * Creates a ClearChatAction message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ClearChatAction - */ - public static fromObject(object: { [k: string]: any }): proto.ClearChatAction; + /** ExternalAdReplyInfo sourceId */ + sourceId?: (string|null); - /** - * Creates a plain object from a ClearChatAction message. Also converts values to other types if specified. - * @param message ClearChatAction - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: proto.ClearChatAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** ExternalAdReplyInfo sourceUrl */ + sourceUrl?: (string|null); - /** - * Converts this ClearChatAction to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** ExternalAdReplyInfo containsAutoReply */ + containsAutoReply?: (boolean|null); - /** Properties of a DeleteChatAction. */ - interface IDeleteChatAction { + /** ExternalAdReplyInfo renderLargerThumbnail */ + renderLargerThumbnail?: (boolean|null); - /** DeleteChatAction messageRange */ - messageRange?: (proto.ISyncActionMessageRange|null); + /** ExternalAdReplyInfo showAdAttribution */ + showAdAttribution?: (boolean|null); } - /** Represents a DeleteChatAction. */ - class DeleteChatAction implements IDeleteChatAction { + /** Represents an ExternalAdReplyInfo. */ + class ExternalAdReplyInfo implements IExternalAdReplyInfo { /** - * Constructs a new DeleteChatAction. + * Constructs a new ExternalAdReplyInfo. * @param [properties] Properties to set */ - constructor(properties?: proto.IDeleteChatAction); + constructor(properties?: proto.IExternalAdReplyInfo); - /** DeleteChatAction messageRange. */ - public messageRange?: (proto.ISyncActionMessageRange|null); + /** ExternalAdReplyInfo title. */ + public title: string; + + /** ExternalAdReplyInfo body. */ + public body: string; + + /** ExternalAdReplyInfo mediaType. */ + public mediaType: proto.ExternalAdReplyInfo.ExternalAdReplyInfoMediaType; + + /** ExternalAdReplyInfo thumbnailUrl. */ + public thumbnailUrl: string; + + /** ExternalAdReplyInfo mediaUrl. */ + public mediaUrl: string; + + /** ExternalAdReplyInfo thumbnail. */ + public thumbnail: Uint8Array; + + /** ExternalAdReplyInfo sourceType. */ + public sourceType: string; + + /** ExternalAdReplyInfo sourceId. */ + public sourceId: string; + + /** ExternalAdReplyInfo sourceUrl. */ + public sourceUrl: string; + + /** ExternalAdReplyInfo containsAutoReply. */ + public containsAutoReply: boolean; + + /** ExternalAdReplyInfo renderLargerThumbnail. */ + public renderLargerThumbnail: boolean; + + /** ExternalAdReplyInfo showAdAttribution. */ + public showAdAttribution: boolean; /** - * Creates a new DeleteChatAction instance using the specified properties. + * Creates a new ExternalAdReplyInfo instance using the specified properties. * @param [properties] Properties to set - * @returns DeleteChatAction instance + * @returns ExternalAdReplyInfo instance */ - public static create(properties?: proto.IDeleteChatAction): proto.DeleteChatAction; + public static create(properties?: proto.IExternalAdReplyInfo): proto.ExternalAdReplyInfo; /** - * Encodes the specified DeleteChatAction message. Does not implicitly {@link proto.DeleteChatAction.verify|verify} messages. - * @param message DeleteChatAction message or plain object to encode + * Encodes the specified ExternalAdReplyInfo message. Does not implicitly {@link proto.ExternalAdReplyInfo.verify|verify} messages. + * @param message ExternalAdReplyInfo message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: proto.IDeleteChatAction, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: proto.IExternalAdReplyInfo, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified DeleteChatAction message, length delimited. Does not implicitly {@link proto.DeleteChatAction.verify|verify} messages. - * @param message DeleteChatAction message or plain object to encode + * Encodes the specified ExternalAdReplyInfo message, length delimited. Does not implicitly {@link proto.ExternalAdReplyInfo.verify|verify} messages. + * @param message ExternalAdReplyInfo message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: proto.IDeleteChatAction, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: proto.IExternalAdReplyInfo, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a DeleteChatAction message from the specified reader or buffer. + * Decodes an ExternalAdReplyInfo message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns DeleteChatAction + * @returns ExternalAdReplyInfo * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.DeleteChatAction; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.ExternalAdReplyInfo; /** - * Decodes a DeleteChatAction message from the specified reader or buffer, length delimited. + * Decodes an ExternalAdReplyInfo message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns DeleteChatAction + * @returns ExternalAdReplyInfo * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.DeleteChatAction; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.ExternalAdReplyInfo; /** - * Verifies a DeleteChatAction message. + * Verifies an ExternalAdReplyInfo message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a DeleteChatAction message from a plain object. Also converts values to their respective internal types. + * Creates an ExternalAdReplyInfo message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns DeleteChatAction + * @returns ExternalAdReplyInfo */ - public static fromObject(object: { [k: string]: any }): proto.DeleteChatAction; + public static fromObject(object: { [k: string]: any }): proto.ExternalAdReplyInfo; /** - * Creates a plain object from a DeleteChatAction message. Also converts values to other types if specified. - * @param message DeleteChatAction + * Creates a plain object from an ExternalAdReplyInfo message. Also converts values to other types if specified. + * @param message ExternalAdReplyInfo * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: proto.DeleteChatAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: proto.ExternalAdReplyInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this DeleteChatAction to JSON. + * Converts this ExternalAdReplyInfo to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of an UnarchiveChatsSetting. */ - interface IUnarchiveChatsSetting { + namespace ExternalAdReplyInfo { - /** UnarchiveChatsSetting unarchiveChats */ - unarchiveChats?: (boolean|null); + /** ExternalAdReplyInfoMediaType enum. */ + enum ExternalAdReplyInfoMediaType { + NONE = 0, + IMAGE = 1, + VIDEO = 2 + } } - /** Represents an UnarchiveChatsSetting. */ - class UnarchiveChatsSetting implements IUnarchiveChatsSetting { + /** Properties of a Footer. */ + interface IFooter { + + /** Footer text */ + text?: (string|null); + } + + /** Represents a Footer. */ + class Footer implements IFooter { /** - * Constructs a new UnarchiveChatsSetting. + * Constructs a new Footer. * @param [properties] Properties to set */ - constructor(properties?: proto.IUnarchiveChatsSetting); + constructor(properties?: proto.IFooter); - /** UnarchiveChatsSetting unarchiveChats. */ - public unarchiveChats: boolean; + /** Footer text. */ + public text: string; /** - * Creates a new UnarchiveChatsSetting instance using the specified properties. + * Creates a new Footer instance using the specified properties. * @param [properties] Properties to set - * @returns UnarchiveChatsSetting instance + * @returns Footer instance */ - public static create(properties?: proto.IUnarchiveChatsSetting): proto.UnarchiveChatsSetting; + public static create(properties?: proto.IFooter): proto.Footer; /** - * Encodes the specified UnarchiveChatsSetting message. Does not implicitly {@link proto.UnarchiveChatsSetting.verify|verify} messages. - * @param message UnarchiveChatsSetting message or plain object to encode + * Encodes the specified Footer message. Does not implicitly {@link proto.Footer.verify|verify} messages. + * @param message Footer message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: proto.IUnarchiveChatsSetting, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: proto.IFooter, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified UnarchiveChatsSetting message, length delimited. Does not implicitly {@link proto.UnarchiveChatsSetting.verify|verify} messages. - * @param message UnarchiveChatsSetting message or plain object to encode + * Encodes the specified Footer message, length delimited. Does not implicitly {@link proto.Footer.verify|verify} messages. + * @param message Footer message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: proto.IUnarchiveChatsSetting, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: proto.IFooter, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an UnarchiveChatsSetting message from the specified reader or buffer. + * Decodes a Footer message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns UnarchiveChatsSetting + * @returns Footer * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.UnarchiveChatsSetting; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.Footer; /** - * Decodes an UnarchiveChatsSetting message from the specified reader or buffer, length delimited. + * Decodes a Footer message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns UnarchiveChatsSetting + * @returns Footer * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.UnarchiveChatsSetting; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.Footer; /** - * Verifies an UnarchiveChatsSetting message. + * Verifies a Footer message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates an UnarchiveChatsSetting message from a plain object. Also converts values to their respective internal types. + * Creates a Footer message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns UnarchiveChatsSetting + * @returns Footer */ - public static fromObject(object: { [k: string]: any }): proto.UnarchiveChatsSetting; + public static fromObject(object: { [k: string]: any }): proto.Footer; /** - * Creates a plain object from an UnarchiveChatsSetting message. Also converts values to other types if specified. - * @param message UnarchiveChatsSetting + * Creates a plain object from a Footer message. Also converts values to other types if specified. + * @param message Footer * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: proto.UnarchiveChatsSetting, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: proto.Footer, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this UnarchiveChatsSetting to JSON. + * Converts this Footer to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a SyncActionMessageRange. */ - interface ISyncActionMessageRange { + /** Properties of a FourRowTemplate. */ + interface IFourRowTemplate { - /** SyncActionMessageRange lastMessageTimestamp */ - lastMessageTimestamp?: (number|Long|null); + /** FourRowTemplate content */ + content?: (proto.IHighlyStructuredMessage|null); - /** SyncActionMessageRange lastSystemMessageTimestamp */ - lastSystemMessageTimestamp?: (number|Long|null); + /** FourRowTemplate footer */ + footer?: (proto.IHighlyStructuredMessage|null); - /** SyncActionMessageRange messages */ - messages?: (proto.ISyncActionMessage[]|null); - } + /** FourRowTemplate buttons */ + buttons?: (proto.ITemplateButton[]|null); - /** Represents a SyncActionMessageRange. */ - class SyncActionMessageRange implements ISyncActionMessageRange { + /** FourRowTemplate documentMessage */ + documentMessage?: (proto.IDocumentMessage|null); + + /** FourRowTemplate highlyStructuredMessage */ + highlyStructuredMessage?: (proto.IHighlyStructuredMessage|null); + + /** FourRowTemplate imageMessage */ + imageMessage?: (proto.IImageMessage|null); + + /** FourRowTemplate videoMessage */ + videoMessage?: (proto.IVideoMessage|null); + + /** FourRowTemplate locationMessage */ + locationMessage?: (proto.ILocationMessage|null); + } + + /** Represents a FourRowTemplate. */ + class FourRowTemplate implements IFourRowTemplate { /** - * Constructs a new SyncActionMessageRange. + * Constructs a new FourRowTemplate. * @param [properties] Properties to set */ - constructor(properties?: proto.ISyncActionMessageRange); + constructor(properties?: proto.IFourRowTemplate); - /** SyncActionMessageRange lastMessageTimestamp. */ - public lastMessageTimestamp: (number|Long); + /** FourRowTemplate content. */ + public content?: (proto.IHighlyStructuredMessage|null); - /** SyncActionMessageRange lastSystemMessageTimestamp. */ - public lastSystemMessageTimestamp: (number|Long); + /** FourRowTemplate footer. */ + public footer?: (proto.IHighlyStructuredMessage|null); - /** SyncActionMessageRange messages. */ - public messages: proto.ISyncActionMessage[]; + /** FourRowTemplate buttons. */ + public buttons: proto.ITemplateButton[]; + + /** FourRowTemplate documentMessage. */ + public documentMessage?: (proto.IDocumentMessage|null); + + /** FourRowTemplate highlyStructuredMessage. */ + public highlyStructuredMessage?: (proto.IHighlyStructuredMessage|null); + + /** FourRowTemplate imageMessage. */ + public imageMessage?: (proto.IImageMessage|null); + + /** FourRowTemplate videoMessage. */ + public videoMessage?: (proto.IVideoMessage|null); + + /** FourRowTemplate locationMessage. */ + public locationMessage?: (proto.ILocationMessage|null); + + /** FourRowTemplate title. */ + public title?: ("documentMessage"|"highlyStructuredMessage"|"imageMessage"|"videoMessage"|"locationMessage"); /** - * Creates a new SyncActionMessageRange instance using the specified properties. + * Creates a new FourRowTemplate instance using the specified properties. * @param [properties] Properties to set - * @returns SyncActionMessageRange instance + * @returns FourRowTemplate instance */ - public static create(properties?: proto.ISyncActionMessageRange): proto.SyncActionMessageRange; + public static create(properties?: proto.IFourRowTemplate): proto.FourRowTemplate; /** - * Encodes the specified SyncActionMessageRange message. Does not implicitly {@link proto.SyncActionMessageRange.verify|verify} messages. - * @param message SyncActionMessageRange message or plain object to encode + * Encodes the specified FourRowTemplate message. Does not implicitly {@link proto.FourRowTemplate.verify|verify} messages. + * @param message FourRowTemplate message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: proto.ISyncActionMessageRange, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: proto.IFourRowTemplate, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified SyncActionMessageRange message, length delimited. Does not implicitly {@link proto.SyncActionMessageRange.verify|verify} messages. - * @param message SyncActionMessageRange message or plain object to encode + * Encodes the specified FourRowTemplate message, length delimited. Does not implicitly {@link proto.FourRowTemplate.verify|verify} messages. + * @param message FourRowTemplate message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: proto.ISyncActionMessageRange, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: proto.IFourRowTemplate, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a SyncActionMessageRange message from the specified reader or buffer. + * Decodes a FourRowTemplate message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns SyncActionMessageRange + * @returns FourRowTemplate * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.SyncActionMessageRange; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.FourRowTemplate; /** - * Decodes a SyncActionMessageRange message from the specified reader or buffer, length delimited. + * Decodes a FourRowTemplate message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns SyncActionMessageRange + * @returns FourRowTemplate * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.SyncActionMessageRange; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.FourRowTemplate; /** - * Verifies a SyncActionMessageRange message. + * Verifies a FourRowTemplate message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a SyncActionMessageRange message from a plain object. Also converts values to their respective internal types. + * Creates a FourRowTemplate message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns SyncActionMessageRange + * @returns FourRowTemplate */ - public static fromObject(object: { [k: string]: any }): proto.SyncActionMessageRange; + public static fromObject(object: { [k: string]: any }): proto.FourRowTemplate; /** - * Creates a plain object from a SyncActionMessageRange message. Also converts values to other types if specified. - * @param message SyncActionMessageRange + * Creates a plain object from a FourRowTemplate message. Also converts values to other types if specified. + * @param message FourRowTemplate * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: proto.SyncActionMessageRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: proto.FourRowTemplate, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this SyncActionMessageRange to JSON. + * Converts this FourRowTemplate to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a SyncActionMessage. */ - interface ISyncActionMessage { - - /** SyncActionMessage key */ - key?: (proto.IMessageKey|null); + /** Properties of a FutureProofMessage. */ + interface IFutureProofMessage { - /** SyncActionMessage timestamp */ - timestamp?: (number|Long|null); + /** FutureProofMessage message */ + message?: (proto.IMessage|null); } - /** Represents a SyncActionMessage. */ - class SyncActionMessage implements ISyncActionMessage { + /** Represents a FutureProofMessage. */ + class FutureProofMessage implements IFutureProofMessage { /** - * Constructs a new SyncActionMessage. + * Constructs a new FutureProofMessage. * @param [properties] Properties to set */ - constructor(properties?: proto.ISyncActionMessage); - - /** SyncActionMessage key. */ - public key?: (proto.IMessageKey|null); + constructor(properties?: proto.IFutureProofMessage); - /** SyncActionMessage timestamp. */ - public timestamp: (number|Long); + /** FutureProofMessage message. */ + public message?: (proto.IMessage|null); /** - * Creates a new SyncActionMessage instance using the specified properties. + * Creates a new FutureProofMessage instance using the specified properties. * @param [properties] Properties to set - * @returns SyncActionMessage instance + * @returns FutureProofMessage instance */ - public static create(properties?: proto.ISyncActionMessage): proto.SyncActionMessage; + public static create(properties?: proto.IFutureProofMessage): proto.FutureProofMessage; /** - * Encodes the specified SyncActionMessage message. Does not implicitly {@link proto.SyncActionMessage.verify|verify} messages. - * @param message SyncActionMessage message or plain object to encode + * Encodes the specified FutureProofMessage message. Does not implicitly {@link proto.FutureProofMessage.verify|verify} messages. + * @param message FutureProofMessage message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: proto.ISyncActionMessage, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: proto.IFutureProofMessage, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified SyncActionMessage message, length delimited. Does not implicitly {@link proto.SyncActionMessage.verify|verify} messages. - * @param message SyncActionMessage message or plain object to encode + * Encodes the specified FutureProofMessage message, length delimited. Does not implicitly {@link proto.FutureProofMessage.verify|verify} messages. + * @param message FutureProofMessage message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: proto.ISyncActionMessage, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: proto.IFutureProofMessage, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a SyncActionMessage message from the specified reader or buffer. + * Decodes a FutureProofMessage message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns SyncActionMessage + * @returns FutureProofMessage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.SyncActionMessage; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.FutureProofMessage; /** - * Decodes a SyncActionMessage message from the specified reader or buffer, length delimited. + * Decodes a FutureProofMessage message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns SyncActionMessage + * @returns FutureProofMessage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.SyncActionMessage; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.FutureProofMessage; /** - * Verifies a SyncActionMessage message. + * Verifies a FutureProofMessage message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a SyncActionMessage message from a plain object. Also converts values to their respective internal types. + * Creates a FutureProofMessage message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns SyncActionMessage + * @returns FutureProofMessage */ - public static fromObject(object: { [k: string]: any }): proto.SyncActionMessage; + public static fromObject(object: { [k: string]: any }): proto.FutureProofMessage; /** - * Creates a plain object from a SyncActionMessage message. Also converts values to other types if specified. - * @param message SyncActionMessage + * Creates a plain object from a FutureProofMessage message. Also converts values to other types if specified. + * @param message FutureProofMessage * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: proto.SyncActionMessage, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: proto.FutureProofMessage, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this SyncActionMessage to JSON. + * Converts this FutureProofMessage to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a KeyExpiration. */ - interface IKeyExpiration { + /** Properties of a GroupInviteMessage. */ + interface IGroupInviteMessage { - /** KeyExpiration expiredKeyEpoch */ - expiredKeyEpoch?: (number|null); + /** GroupInviteMessage groupJid */ + groupJid?: (string|null); + + /** GroupInviteMessage inviteCode */ + inviteCode?: (string|null); + + /** GroupInviteMessage inviteExpiration */ + inviteExpiration?: (number|Long|null); + + /** GroupInviteMessage groupName */ + groupName?: (string|null); + + /** GroupInviteMessage jpegThumbnail */ + jpegThumbnail?: (Uint8Array|null); + + /** GroupInviteMessage caption */ + caption?: (string|null); + + /** GroupInviteMessage contextInfo */ + contextInfo?: (proto.IContextInfo|null); + + /** GroupInviteMessage groupType */ + groupType?: (proto.GroupInviteMessage.GroupInviteMessageGroupType|null); } - /** Represents a KeyExpiration. */ - class KeyExpiration implements IKeyExpiration { + /** Represents a GroupInviteMessage. */ + class GroupInviteMessage implements IGroupInviteMessage { /** - * Constructs a new KeyExpiration. + * Constructs a new GroupInviteMessage. * @param [properties] Properties to set */ - constructor(properties?: proto.IKeyExpiration); + constructor(properties?: proto.IGroupInviteMessage); - /** KeyExpiration expiredKeyEpoch. */ - public expiredKeyEpoch: number; + /** GroupInviteMessage groupJid. */ + public groupJid: string; + + /** GroupInviteMessage inviteCode. */ + public inviteCode: string; + + /** GroupInviteMessage inviteExpiration. */ + public inviteExpiration: (number|Long); + + /** GroupInviteMessage groupName. */ + public groupName: string; + + /** GroupInviteMessage jpegThumbnail. */ + public jpegThumbnail: Uint8Array; + + /** GroupInviteMessage caption. */ + public caption: string; + + /** GroupInviteMessage contextInfo. */ + public contextInfo?: (proto.IContextInfo|null); + + /** GroupInviteMessage groupType. */ + public groupType: proto.GroupInviteMessage.GroupInviteMessageGroupType; /** - * Creates a new KeyExpiration instance using the specified properties. + * Creates a new GroupInviteMessage instance using the specified properties. * @param [properties] Properties to set - * @returns KeyExpiration instance + * @returns GroupInviteMessage instance */ - public static create(properties?: proto.IKeyExpiration): proto.KeyExpiration; + public static create(properties?: proto.IGroupInviteMessage): proto.GroupInviteMessage; /** - * Encodes the specified KeyExpiration message. Does not implicitly {@link proto.KeyExpiration.verify|verify} messages. - * @param message KeyExpiration message or plain object to encode + * Encodes the specified GroupInviteMessage message. Does not implicitly {@link proto.GroupInviteMessage.verify|verify} messages. + * @param message GroupInviteMessage message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: proto.IKeyExpiration, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: proto.IGroupInviteMessage, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified KeyExpiration message, length delimited. Does not implicitly {@link proto.KeyExpiration.verify|verify} messages. - * @param message KeyExpiration message or plain object to encode + * Encodes the specified GroupInviteMessage message, length delimited. Does not implicitly {@link proto.GroupInviteMessage.verify|verify} messages. + * @param message GroupInviteMessage message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: proto.IKeyExpiration, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: proto.IGroupInviteMessage, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a KeyExpiration message from the specified reader or buffer. + * Decodes a GroupInviteMessage message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns KeyExpiration + * @returns GroupInviteMessage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.KeyExpiration; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.GroupInviteMessage; /** - * Decodes a KeyExpiration message from the specified reader or buffer, length delimited. + * Decodes a GroupInviteMessage message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns KeyExpiration + * @returns GroupInviteMessage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.KeyExpiration; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.GroupInviteMessage; /** - * Verifies a KeyExpiration message. + * Verifies a GroupInviteMessage message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a KeyExpiration message from a plain object. Also converts values to their respective internal types. + * Creates a GroupInviteMessage message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns KeyExpiration + * @returns GroupInviteMessage */ - public static fromObject(object: { [k: string]: any }): proto.KeyExpiration; + public static fromObject(object: { [k: string]: any }): proto.GroupInviteMessage; /** - * Creates a plain object from a KeyExpiration message. Also converts values to other types if specified. - * @param message KeyExpiration + * Creates a plain object from a GroupInviteMessage message. Also converts values to other types if specified. + * @param message GroupInviteMessage * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: proto.KeyExpiration, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: proto.GroupInviteMessage, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this KeyExpiration to JSON. + * Converts this GroupInviteMessage to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a PrimaryFeature. */ - interface IPrimaryFeature { + namespace GroupInviteMessage { - /** PrimaryFeature flags */ - flags?: (string[]|null); + /** GroupInviteMessageGroupType enum. */ + enum GroupInviteMessageGroupType { + DEFAULT = 0, + PARENT = 1 + } } - /** Represents a PrimaryFeature. */ - class PrimaryFeature implements IPrimaryFeature { + /** Properties of a Header. */ + interface IHeader { + + /** Header title */ + title?: (string|null); + + /** Header subtitle */ + subtitle?: (string|null); + + /** Header hasMediaAttachment */ + hasMediaAttachment?: (boolean|null); + + /** Header documentMessage */ + documentMessage?: (proto.IDocumentMessage|null); + + /** Header imageMessage */ + imageMessage?: (proto.IImageMessage|null); + + /** Header jpegThumbnail */ + jpegThumbnail?: (Uint8Array|null); + + /** Header videoMessage */ + videoMessage?: (proto.IVideoMessage|null); + } + + /** Represents a Header. */ + class Header implements IHeader { /** - * Constructs a new PrimaryFeature. + * Constructs a new Header. * @param [properties] Properties to set */ - constructor(properties?: proto.IPrimaryFeature); + constructor(properties?: proto.IHeader); - /** PrimaryFeature flags. */ - public flags: string[]; + /** Header title. */ + public title: string; + + /** Header subtitle. */ + public subtitle: string; + + /** Header hasMediaAttachment. */ + public hasMediaAttachment: boolean; + + /** Header documentMessage. */ + public documentMessage?: (proto.IDocumentMessage|null); + + /** Header imageMessage. */ + public imageMessage?: (proto.IImageMessage|null); + + /** Header jpegThumbnail. */ + public jpegThumbnail?: (Uint8Array|null); + + /** Header videoMessage. */ + public videoMessage?: (proto.IVideoMessage|null); + + /** Header media. */ + public media?: ("documentMessage"|"imageMessage"|"jpegThumbnail"|"videoMessage"); /** - * Creates a new PrimaryFeature instance using the specified properties. + * Creates a new Header instance using the specified properties. * @param [properties] Properties to set - * @returns PrimaryFeature instance + * @returns Header instance */ - public static create(properties?: proto.IPrimaryFeature): proto.PrimaryFeature; + public static create(properties?: proto.IHeader): proto.Header; /** - * Encodes the specified PrimaryFeature message. Does not implicitly {@link proto.PrimaryFeature.verify|verify} messages. - * @param message PrimaryFeature message or plain object to encode + * Encodes the specified Header message. Does not implicitly {@link proto.Header.verify|verify} messages. + * @param message Header message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: proto.IPrimaryFeature, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: proto.IHeader, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified PrimaryFeature message, length delimited. Does not implicitly {@link proto.PrimaryFeature.verify|verify} messages. - * @param message PrimaryFeature message or plain object to encode + * Encodes the specified Header message, length delimited. Does not implicitly {@link proto.Header.verify|verify} messages. + * @param message Header message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: proto.IPrimaryFeature, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: proto.IHeader, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a PrimaryFeature message from the specified reader or buffer. + * Decodes a Header message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns PrimaryFeature + * @returns Header * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.PrimaryFeature; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.Header; /** - * Decodes a PrimaryFeature message from the specified reader or buffer, length delimited. + * Decodes a Header message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns PrimaryFeature + * @returns Header * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.PrimaryFeature; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.Header; /** - * Verifies a PrimaryFeature message. + * Verifies a Header message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a PrimaryFeature message from a plain object. Also converts values to their respective internal types. + * Creates a Header message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns PrimaryFeature + * @returns Header */ - public static fromObject(object: { [k: string]: any }): proto.PrimaryFeature; + public static fromObject(object: { [k: string]: any }): proto.Header; /** - * Creates a plain object from a PrimaryFeature message. Also converts values to other types if specified. - * @param message PrimaryFeature + * Creates a plain object from a Header message. Also converts values to other types if specified. + * @param message Header * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: proto.PrimaryFeature, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: proto.Header, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this PrimaryFeature to JSON. + * Converts this Header to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of an AndroidUnsupportedActions. */ - interface IAndroidUnsupportedActions { + /** Properties of a HighlyStructuredMessage. */ + interface IHighlyStructuredMessage { - /** AndroidUnsupportedActions allowed */ - allowed?: (boolean|null); + /** HighlyStructuredMessage namespace */ + namespace?: (string|null); + + /** HighlyStructuredMessage elementName */ + elementName?: (string|null); + + /** HighlyStructuredMessage params */ + params?: (string[]|null); + + /** HighlyStructuredMessage fallbackLg */ + fallbackLg?: (string|null); + + /** HighlyStructuredMessage fallbackLc */ + fallbackLc?: (string|null); + + /** HighlyStructuredMessage localizableParams */ + localizableParams?: (proto.IHSMLocalizableParameter[]|null); + + /** HighlyStructuredMessage deterministicLg */ + deterministicLg?: (string|null); + + /** HighlyStructuredMessage deterministicLc */ + deterministicLc?: (string|null); + + /** HighlyStructuredMessage hydratedHsm */ + hydratedHsm?: (proto.ITemplateMessage|null); } - /** Represents an AndroidUnsupportedActions. */ - class AndroidUnsupportedActions implements IAndroidUnsupportedActions { + /** Represents a HighlyStructuredMessage. */ + class HighlyStructuredMessage implements IHighlyStructuredMessage { /** - * Constructs a new AndroidUnsupportedActions. + * Constructs a new HighlyStructuredMessage. * @param [properties] Properties to set */ - constructor(properties?: proto.IAndroidUnsupportedActions); + constructor(properties?: proto.IHighlyStructuredMessage); - /** AndroidUnsupportedActions allowed. */ - public allowed: boolean; + /** HighlyStructuredMessage namespace. */ + public namespace: string; + + /** HighlyStructuredMessage elementName. */ + public elementName: string; + + /** HighlyStructuredMessage params. */ + public params: string[]; + + /** HighlyStructuredMessage fallbackLg. */ + public fallbackLg: string; + + /** HighlyStructuredMessage fallbackLc. */ + public fallbackLc: string; + + /** HighlyStructuredMessage localizableParams. */ + public localizableParams: proto.IHSMLocalizableParameter[]; + + /** HighlyStructuredMessage deterministicLg. */ + public deterministicLg: string; + + /** HighlyStructuredMessage deterministicLc. */ + public deterministicLc: string; + + /** HighlyStructuredMessage hydratedHsm. */ + public hydratedHsm?: (proto.ITemplateMessage|null); /** - * Creates a new AndroidUnsupportedActions instance using the specified properties. + * Creates a new HighlyStructuredMessage instance using the specified properties. * @param [properties] Properties to set - * @returns AndroidUnsupportedActions instance + * @returns HighlyStructuredMessage instance */ - public static create(properties?: proto.IAndroidUnsupportedActions): proto.AndroidUnsupportedActions; + public static create(properties?: proto.IHighlyStructuredMessage): proto.HighlyStructuredMessage; /** - * Encodes the specified AndroidUnsupportedActions message. Does not implicitly {@link proto.AndroidUnsupportedActions.verify|verify} messages. - * @param message AndroidUnsupportedActions message or plain object to encode + * Encodes the specified HighlyStructuredMessage message. Does not implicitly {@link proto.HighlyStructuredMessage.verify|verify} messages. + * @param message HighlyStructuredMessage message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: proto.IAndroidUnsupportedActions, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: proto.IHighlyStructuredMessage, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified AndroidUnsupportedActions message, length delimited. Does not implicitly {@link proto.AndroidUnsupportedActions.verify|verify} messages. - * @param message AndroidUnsupportedActions message or plain object to encode + * Encodes the specified HighlyStructuredMessage message, length delimited. Does not implicitly {@link proto.HighlyStructuredMessage.verify|verify} messages. + * @param message HighlyStructuredMessage message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: proto.IAndroidUnsupportedActions, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: proto.IHighlyStructuredMessage, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an AndroidUnsupportedActions message from the specified reader or buffer. + * Decodes a HighlyStructuredMessage message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns AndroidUnsupportedActions + * @returns HighlyStructuredMessage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.AndroidUnsupportedActions; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.HighlyStructuredMessage; /** - * Decodes an AndroidUnsupportedActions message from the specified reader or buffer, length delimited. + * Decodes a HighlyStructuredMessage message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns AndroidUnsupportedActions + * @returns HighlyStructuredMessage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.AndroidUnsupportedActions; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.HighlyStructuredMessage; /** - * Verifies an AndroidUnsupportedActions message. + * Verifies a HighlyStructuredMessage message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates an AndroidUnsupportedActions message from a plain object. Also converts values to their respective internal types. + * Creates a HighlyStructuredMessage message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns AndroidUnsupportedActions + * @returns HighlyStructuredMessage */ - public static fromObject(object: { [k: string]: any }): proto.AndroidUnsupportedActions; + public static fromObject(object: { [k: string]: any }): proto.HighlyStructuredMessage; /** - * Creates a plain object from an AndroidUnsupportedActions message. Also converts values to other types if specified. - * @param message AndroidUnsupportedActions + * Creates a plain object from a HighlyStructuredMessage message. Also converts values to other types if specified. + * @param message HighlyStructuredMessage * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: proto.AndroidUnsupportedActions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: proto.HighlyStructuredMessage, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this AndroidUnsupportedActions to JSON. + * Converts this HighlyStructuredMessage to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a SyncActionValue. */ - interface ISyncActionValue { + /** Properties of a HistorySyncNotification. */ + interface IHistorySyncNotification { - /** SyncActionValue timestamp */ - timestamp?: (number|Long|null); - - /** SyncActionValue starAction */ - starAction?: (proto.IStarAction|null); - - /** SyncActionValue contactAction */ - contactAction?: (proto.IContactAction|null); - - /** SyncActionValue muteAction */ - muteAction?: (proto.IMuteAction|null); - - /** SyncActionValue pinAction */ - pinAction?: (proto.IPinAction|null); - - /** SyncActionValue securityNotificationSetting */ - securityNotificationSetting?: (proto.ISecurityNotificationSetting|null); - - /** SyncActionValue pushNameSetting */ - pushNameSetting?: (proto.IPushNameSetting|null); - - /** SyncActionValue quickReplyAction */ - quickReplyAction?: (proto.IQuickReplyAction|null); - - /** SyncActionValue recentStickerWeightsAction */ - recentStickerWeightsAction?: (proto.IRecentStickerWeightsAction|null); - - /** SyncActionValue recentStickerMetadata */ - recentStickerMetadata?: (proto.IRecentStickerMetadata|null); - - /** SyncActionValue recentEmojiWeightsAction */ - recentEmojiWeightsAction?: (proto.IRecentEmojiWeightsAction|null); - - /** SyncActionValue labelEditAction */ - labelEditAction?: (proto.ILabelEditAction|null); - - /** SyncActionValue labelAssociationAction */ - labelAssociationAction?: (proto.ILabelAssociationAction|null); - - /** SyncActionValue localeSetting */ - localeSetting?: (proto.ILocaleSetting|null); - - /** SyncActionValue archiveChatAction */ - archiveChatAction?: (proto.IArchiveChatAction|null); - - /** SyncActionValue deleteMessageForMeAction */ - deleteMessageForMeAction?: (proto.IDeleteMessageForMeAction|null); - - /** SyncActionValue keyExpiration */ - keyExpiration?: (proto.IKeyExpiration|null); + /** HistorySyncNotification fileSha256 */ + fileSha256?: (Uint8Array|null); - /** SyncActionValue markChatAsReadAction */ - markChatAsReadAction?: (proto.IMarkChatAsReadAction|null); + /** HistorySyncNotification fileLength */ + fileLength?: (number|Long|null); - /** SyncActionValue clearChatAction */ - clearChatAction?: (proto.IClearChatAction|null); + /** HistorySyncNotification mediaKey */ + mediaKey?: (Uint8Array|null); - /** SyncActionValue deleteChatAction */ - deleteChatAction?: (proto.IDeleteChatAction|null); + /** HistorySyncNotification fileEncSha256 */ + fileEncSha256?: (Uint8Array|null); - /** SyncActionValue unarchiveChatsSetting */ - unarchiveChatsSetting?: (proto.IUnarchiveChatsSetting|null); + /** HistorySyncNotification directPath */ + directPath?: (string|null); - /** SyncActionValue primaryFeature */ - primaryFeature?: (proto.IPrimaryFeature|null); + /** HistorySyncNotification syncType */ + syncType?: (proto.HistorySyncNotification.HistorySyncNotificationHistorySyncType|null); - /** SyncActionValue favoriteStickerAction */ - favoriteStickerAction?: (proto.IFavoriteStickerAction|null); + /** HistorySyncNotification chunkOrder */ + chunkOrder?: (number|null); - /** SyncActionValue androidUnsupportedActions */ - androidUnsupportedActions?: (proto.IAndroidUnsupportedActions|null); + /** HistorySyncNotification originalMessageId */ + originalMessageId?: (string|null); } - /** Represents a SyncActionValue. */ - class SyncActionValue implements ISyncActionValue { + /** Represents a HistorySyncNotification. */ + class HistorySyncNotification implements IHistorySyncNotification { /** - * Constructs a new SyncActionValue. + * Constructs a new HistorySyncNotification. * @param [properties] Properties to set */ - constructor(properties?: proto.ISyncActionValue); - - /** SyncActionValue timestamp. */ - public timestamp: (number|Long); - - /** SyncActionValue starAction. */ - public starAction?: (proto.IStarAction|null); - - /** SyncActionValue contactAction. */ - public contactAction?: (proto.IContactAction|null); - - /** SyncActionValue muteAction. */ - public muteAction?: (proto.IMuteAction|null); - - /** SyncActionValue pinAction. */ - public pinAction?: (proto.IPinAction|null); - - /** SyncActionValue securityNotificationSetting. */ - public securityNotificationSetting?: (proto.ISecurityNotificationSetting|null); - - /** SyncActionValue pushNameSetting. */ - public pushNameSetting?: (proto.IPushNameSetting|null); - - /** SyncActionValue quickReplyAction. */ - public quickReplyAction?: (proto.IQuickReplyAction|null); - - /** SyncActionValue recentStickerWeightsAction. */ - public recentStickerWeightsAction?: (proto.IRecentStickerWeightsAction|null); - - /** SyncActionValue recentStickerMetadata. */ - public recentStickerMetadata?: (proto.IRecentStickerMetadata|null); - - /** SyncActionValue recentEmojiWeightsAction. */ - public recentEmojiWeightsAction?: (proto.IRecentEmojiWeightsAction|null); - - /** SyncActionValue labelEditAction. */ - public labelEditAction?: (proto.ILabelEditAction|null); - - /** SyncActionValue labelAssociationAction. */ - public labelAssociationAction?: (proto.ILabelAssociationAction|null); - - /** SyncActionValue localeSetting. */ - public localeSetting?: (proto.ILocaleSetting|null); - - /** SyncActionValue archiveChatAction. */ - public archiveChatAction?: (proto.IArchiveChatAction|null); - - /** SyncActionValue deleteMessageForMeAction. */ - public deleteMessageForMeAction?: (proto.IDeleteMessageForMeAction|null); + constructor(properties?: proto.IHistorySyncNotification); - /** SyncActionValue keyExpiration. */ - public keyExpiration?: (proto.IKeyExpiration|null); + /** HistorySyncNotification fileSha256. */ + public fileSha256: Uint8Array; - /** SyncActionValue markChatAsReadAction. */ - public markChatAsReadAction?: (proto.IMarkChatAsReadAction|null); + /** HistorySyncNotification fileLength. */ + public fileLength: (number|Long); - /** SyncActionValue clearChatAction. */ - public clearChatAction?: (proto.IClearChatAction|null); + /** HistorySyncNotification mediaKey. */ + public mediaKey: Uint8Array; - /** SyncActionValue deleteChatAction. */ - public deleteChatAction?: (proto.IDeleteChatAction|null); + /** HistorySyncNotification fileEncSha256. */ + public fileEncSha256: Uint8Array; - /** SyncActionValue unarchiveChatsSetting. */ - public unarchiveChatsSetting?: (proto.IUnarchiveChatsSetting|null); + /** HistorySyncNotification directPath. */ + public directPath: string; - /** SyncActionValue primaryFeature. */ - public primaryFeature?: (proto.IPrimaryFeature|null); + /** HistorySyncNotification syncType. */ + public syncType: proto.HistorySyncNotification.HistorySyncNotificationHistorySyncType; - /** SyncActionValue favoriteStickerAction. */ - public favoriteStickerAction?: (proto.IFavoriteStickerAction|null); + /** HistorySyncNotification chunkOrder. */ + public chunkOrder: number; - /** SyncActionValue androidUnsupportedActions. */ - public androidUnsupportedActions?: (proto.IAndroidUnsupportedActions|null); + /** HistorySyncNotification originalMessageId. */ + public originalMessageId: string; /** - * Creates a new SyncActionValue instance using the specified properties. + * Creates a new HistorySyncNotification instance using the specified properties. * @param [properties] Properties to set - * @returns SyncActionValue instance + * @returns HistorySyncNotification instance */ - public static create(properties?: proto.ISyncActionValue): proto.SyncActionValue; + public static create(properties?: proto.IHistorySyncNotification): proto.HistorySyncNotification; /** - * Encodes the specified SyncActionValue message. Does not implicitly {@link proto.SyncActionValue.verify|verify} messages. - * @param message SyncActionValue message or plain object to encode + * Encodes the specified HistorySyncNotification message. Does not implicitly {@link proto.HistorySyncNotification.verify|verify} messages. + * @param message HistorySyncNotification message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: proto.ISyncActionValue, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: proto.IHistorySyncNotification, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified SyncActionValue message, length delimited. Does not implicitly {@link proto.SyncActionValue.verify|verify} messages. - * @param message SyncActionValue message or plain object to encode + * Encodes the specified HistorySyncNotification message, length delimited. Does not implicitly {@link proto.HistorySyncNotification.verify|verify} messages. + * @param message HistorySyncNotification message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: proto.ISyncActionValue, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: proto.IHistorySyncNotification, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a SyncActionValue message from the specified reader or buffer. + * Decodes a HistorySyncNotification message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns SyncActionValue + * @returns HistorySyncNotification * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.SyncActionValue; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.HistorySyncNotification; /** - * Decodes a SyncActionValue message from the specified reader or buffer, length delimited. + * Decodes a HistorySyncNotification message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns SyncActionValue + * @returns HistorySyncNotification * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.SyncActionValue; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.HistorySyncNotification; /** - * Verifies a SyncActionValue message. + * Verifies a HistorySyncNotification message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a SyncActionValue message from a plain object. Also converts values to their respective internal types. + * Creates a HistorySyncNotification message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns SyncActionValue + * @returns HistorySyncNotification */ - public static fromObject(object: { [k: string]: any }): proto.SyncActionValue; + public static fromObject(object: { [k: string]: any }): proto.HistorySyncNotification; /** - * Creates a plain object from a SyncActionValue message. Also converts values to other types if specified. - * @param message SyncActionValue + * Creates a plain object from a HistorySyncNotification message. Also converts values to other types if specified. + * @param message HistorySyncNotification * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: proto.SyncActionValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: proto.HistorySyncNotification, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this SyncActionValue to JSON. + * Converts this HistorySyncNotification to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a RecentEmojiWeight. */ - interface IRecentEmojiWeight { + namespace HistorySyncNotification { - /** RecentEmojiWeight emoji */ - emoji?: (string|null); + /** HistorySyncNotificationHistorySyncType enum. */ + enum HistorySyncNotificationHistorySyncType { + INITIAL_BOOTSTRAP = 0, + INITIAL_STATUS_V3 = 1, + FULL = 2, + RECENT = 3, + PUSH_NAME = 4 + } + } - /** RecentEmojiWeight weight */ - weight?: (number|null); + /** Properties of a HSMCurrency. */ + interface IHSMCurrency { + + /** HSMCurrency currencyCode */ + currencyCode?: (string|null); + + /** HSMCurrency amount1000 */ + amount1000?: (number|Long|null); } - /** Represents a RecentEmojiWeight. */ - class RecentEmojiWeight implements IRecentEmojiWeight { + /** Represents a HSMCurrency. */ + class HSMCurrency implements IHSMCurrency { /** - * Constructs a new RecentEmojiWeight. + * Constructs a new HSMCurrency. * @param [properties] Properties to set */ - constructor(properties?: proto.IRecentEmojiWeight); + constructor(properties?: proto.IHSMCurrency); - /** RecentEmojiWeight emoji. */ - public emoji: string; + /** HSMCurrency currencyCode. */ + public currencyCode: string; - /** RecentEmojiWeight weight. */ - public weight: number; + /** HSMCurrency amount1000. */ + public amount1000: (number|Long); /** - * Creates a new RecentEmojiWeight instance using the specified properties. + * Creates a new HSMCurrency instance using the specified properties. * @param [properties] Properties to set - * @returns RecentEmojiWeight instance + * @returns HSMCurrency instance */ - public static create(properties?: proto.IRecentEmojiWeight): proto.RecentEmojiWeight; + public static create(properties?: proto.IHSMCurrency): proto.HSMCurrency; /** - * Encodes the specified RecentEmojiWeight message. Does not implicitly {@link proto.RecentEmojiWeight.verify|verify} messages. - * @param message RecentEmojiWeight message or plain object to encode + * Encodes the specified HSMCurrency message. Does not implicitly {@link proto.HSMCurrency.verify|verify} messages. + * @param message HSMCurrency message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: proto.IRecentEmojiWeight, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: proto.IHSMCurrency, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified RecentEmojiWeight message, length delimited. Does not implicitly {@link proto.RecentEmojiWeight.verify|verify} messages. - * @param message RecentEmojiWeight message or plain object to encode + * Encodes the specified HSMCurrency message, length delimited. Does not implicitly {@link proto.HSMCurrency.verify|verify} messages. + * @param message HSMCurrency message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: proto.IRecentEmojiWeight, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: proto.IHSMCurrency, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a RecentEmojiWeight message from the specified reader or buffer. + * Decodes a HSMCurrency message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns RecentEmojiWeight + * @returns HSMCurrency * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.RecentEmojiWeight; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.HSMCurrency; /** - * Decodes a RecentEmojiWeight message from the specified reader or buffer, length delimited. + * Decodes a HSMCurrency message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns RecentEmojiWeight + * @returns HSMCurrency * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.RecentEmojiWeight; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.HSMCurrency; /** - * Verifies a RecentEmojiWeight message. + * Verifies a HSMCurrency message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a RecentEmojiWeight message from a plain object. Also converts values to their respective internal types. + * Creates a HSMCurrency message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns RecentEmojiWeight + * @returns HSMCurrency */ - public static fromObject(object: { [k: string]: any }): proto.RecentEmojiWeight; + public static fromObject(object: { [k: string]: any }): proto.HSMCurrency; /** - * Creates a plain object from a RecentEmojiWeight message. Also converts values to other types if specified. - * @param message RecentEmojiWeight + * Creates a plain object from a HSMCurrency message. Also converts values to other types if specified. + * @param message HSMCurrency * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: proto.RecentEmojiWeight, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: proto.HSMCurrency, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this RecentEmojiWeight to JSON. + * Converts this HSMCurrency to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a RecentStickerWeight. */ - interface IRecentStickerWeight { + /** Properties of a HSMDateTime. */ + interface IHSMDateTime { - /** RecentStickerWeight filehash */ - filehash?: (string|null); + /** HSMDateTime component */ + component?: (proto.IHSMDateTimeComponent|null); - /** RecentStickerWeight weight */ - weight?: (number|null); + /** HSMDateTime unixEpoch */ + unixEpoch?: (proto.IHSMDateTimeUnixEpoch|null); } - /** Represents a RecentStickerWeight. */ - class RecentStickerWeight implements IRecentStickerWeight { + /** Represents a HSMDateTime. */ + class HSMDateTime implements IHSMDateTime { /** - * Constructs a new RecentStickerWeight. + * Constructs a new HSMDateTime. * @param [properties] Properties to set */ - constructor(properties?: proto.IRecentStickerWeight); + constructor(properties?: proto.IHSMDateTime); - /** RecentStickerWeight filehash. */ - public filehash: string; + /** HSMDateTime component. */ + public component?: (proto.IHSMDateTimeComponent|null); - /** RecentStickerWeight weight. */ - public weight: number; + /** HSMDateTime unixEpoch. */ + public unixEpoch?: (proto.IHSMDateTimeUnixEpoch|null); + + /** HSMDateTime datetimeOneof. */ + public datetimeOneof?: ("component"|"unixEpoch"); /** - * Creates a new RecentStickerWeight instance using the specified properties. + * Creates a new HSMDateTime instance using the specified properties. * @param [properties] Properties to set - * @returns RecentStickerWeight instance + * @returns HSMDateTime instance */ - public static create(properties?: proto.IRecentStickerWeight): proto.RecentStickerWeight; + public static create(properties?: proto.IHSMDateTime): proto.HSMDateTime; /** - * Encodes the specified RecentStickerWeight message. Does not implicitly {@link proto.RecentStickerWeight.verify|verify} messages. - * @param message RecentStickerWeight message or plain object to encode + * Encodes the specified HSMDateTime message. Does not implicitly {@link proto.HSMDateTime.verify|verify} messages. + * @param message HSMDateTime message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: proto.IRecentStickerWeight, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: proto.IHSMDateTime, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified RecentStickerWeight message, length delimited. Does not implicitly {@link proto.RecentStickerWeight.verify|verify} messages. - * @param message RecentStickerWeight message or plain object to encode + * Encodes the specified HSMDateTime message, length delimited. Does not implicitly {@link proto.HSMDateTime.verify|verify} messages. + * @param message HSMDateTime message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: proto.IRecentStickerWeight, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: proto.IHSMDateTime, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a RecentStickerWeight message from the specified reader or buffer. + * Decodes a HSMDateTime message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns RecentStickerWeight + * @returns HSMDateTime * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.RecentStickerWeight; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.HSMDateTime; /** - * Decodes a RecentStickerWeight message from the specified reader or buffer, length delimited. + * Decodes a HSMDateTime message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns RecentStickerWeight + * @returns HSMDateTime * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.RecentStickerWeight; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.HSMDateTime; /** - * Verifies a RecentStickerWeight message. + * Verifies a HSMDateTime message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a RecentStickerWeight message from a plain object. Also converts values to their respective internal types. + * Creates a HSMDateTime message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns RecentStickerWeight + * @returns HSMDateTime */ - public static fromObject(object: { [k: string]: any }): proto.RecentStickerWeight; + public static fromObject(object: { [k: string]: any }): proto.HSMDateTime; /** - * Creates a plain object from a RecentStickerWeight message. Also converts values to other types if specified. - * @param message RecentStickerWeight + * Creates a plain object from a HSMDateTime message. Also converts values to other types if specified. + * @param message HSMDateTime * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: proto.RecentStickerWeight, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: proto.HSMDateTime, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this RecentStickerWeight to JSON. + * Converts this HSMDateTime to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a SyncdPatch. */ - interface ISyncdPatch { - - /** SyncdPatch version */ - version?: (proto.ISyncdVersion|null); + /** Properties of a HSMDateTimeComponent. */ + interface IHSMDateTimeComponent { - /** SyncdPatch mutations */ - mutations?: (proto.ISyncdMutation[]|null); + /** HSMDateTimeComponent dayOfWeek */ + dayOfWeek?: (proto.HSMDateTimeComponent.HSMDateTimeComponentDayOfWeekType|null); - /** SyncdPatch externalMutations */ - externalMutations?: (proto.IExternalBlobReference|null); + /** HSMDateTimeComponent year */ + year?: (number|null); - /** SyncdPatch snapshotMac */ - snapshotMac?: (Uint8Array|null); + /** HSMDateTimeComponent month */ + month?: (number|null); - /** SyncdPatch patchMac */ - patchMac?: (Uint8Array|null); + /** HSMDateTimeComponent dayOfMonth */ + dayOfMonth?: (number|null); - /** SyncdPatch keyId */ - keyId?: (proto.IKeyId|null); + /** HSMDateTimeComponent hour */ + hour?: (number|null); - /** SyncdPatch exitCode */ - exitCode?: (proto.IExitCode|null); + /** HSMDateTimeComponent minute */ + minute?: (number|null); - /** SyncdPatch deviceIndex */ - deviceIndex?: (number|null); + /** HSMDateTimeComponent calendar */ + calendar?: (proto.HSMDateTimeComponent.HSMDateTimeComponentCalendarType|null); } - /** Represents a SyncdPatch. */ - class SyncdPatch implements ISyncdPatch { + /** Represents a HSMDateTimeComponent. */ + class HSMDateTimeComponent implements IHSMDateTimeComponent { /** - * Constructs a new SyncdPatch. + * Constructs a new HSMDateTimeComponent. * @param [properties] Properties to set */ - constructor(properties?: proto.ISyncdPatch); - - /** SyncdPatch version. */ - public version?: (proto.ISyncdVersion|null); + constructor(properties?: proto.IHSMDateTimeComponent); - /** SyncdPatch mutations. */ - public mutations: proto.ISyncdMutation[]; + /** HSMDateTimeComponent dayOfWeek. */ + public dayOfWeek: proto.HSMDateTimeComponent.HSMDateTimeComponentDayOfWeekType; - /** SyncdPatch externalMutations. */ - public externalMutations?: (proto.IExternalBlobReference|null); + /** HSMDateTimeComponent year. */ + public year: number; - /** SyncdPatch snapshotMac. */ - public snapshotMac: Uint8Array; + /** HSMDateTimeComponent month. */ + public month: number; - /** SyncdPatch patchMac. */ - public patchMac: Uint8Array; + /** HSMDateTimeComponent dayOfMonth. */ + public dayOfMonth: number; - /** SyncdPatch keyId. */ - public keyId?: (proto.IKeyId|null); + /** HSMDateTimeComponent hour. */ + public hour: number; - /** SyncdPatch exitCode. */ - public exitCode?: (proto.IExitCode|null); + /** HSMDateTimeComponent minute. */ + public minute: number; - /** SyncdPatch deviceIndex. */ - public deviceIndex: number; + /** HSMDateTimeComponent calendar. */ + public calendar: proto.HSMDateTimeComponent.HSMDateTimeComponentCalendarType; /** - * Creates a new SyncdPatch instance using the specified properties. + * Creates a new HSMDateTimeComponent instance using the specified properties. * @param [properties] Properties to set - * @returns SyncdPatch instance + * @returns HSMDateTimeComponent instance */ - public static create(properties?: proto.ISyncdPatch): proto.SyncdPatch; + public static create(properties?: proto.IHSMDateTimeComponent): proto.HSMDateTimeComponent; /** - * Encodes the specified SyncdPatch message. Does not implicitly {@link proto.SyncdPatch.verify|verify} messages. - * @param message SyncdPatch message or plain object to encode + * Encodes the specified HSMDateTimeComponent message. Does not implicitly {@link proto.HSMDateTimeComponent.verify|verify} messages. + * @param message HSMDateTimeComponent message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: proto.ISyncdPatch, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: proto.IHSMDateTimeComponent, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified SyncdPatch message, length delimited. Does not implicitly {@link proto.SyncdPatch.verify|verify} messages. - * @param message SyncdPatch message or plain object to encode + * Encodes the specified HSMDateTimeComponent message, length delimited. Does not implicitly {@link proto.HSMDateTimeComponent.verify|verify} messages. + * @param message HSMDateTimeComponent message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: proto.ISyncdPatch, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: proto.IHSMDateTimeComponent, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a SyncdPatch message from the specified reader or buffer. + * Decodes a HSMDateTimeComponent message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns SyncdPatch + * @returns HSMDateTimeComponent * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.SyncdPatch; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.HSMDateTimeComponent; /** - * Decodes a SyncdPatch message from the specified reader or buffer, length delimited. + * Decodes a HSMDateTimeComponent message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns SyncdPatch + * @returns HSMDateTimeComponent * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.SyncdPatch; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.HSMDateTimeComponent; /** - * Verifies a SyncdPatch message. + * Verifies a HSMDateTimeComponent message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a SyncdPatch message from a plain object. Also converts values to their respective internal types. + * Creates a HSMDateTimeComponent message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns SyncdPatch + * @returns HSMDateTimeComponent */ - public static fromObject(object: { [k: string]: any }): proto.SyncdPatch; + public static fromObject(object: { [k: string]: any }): proto.HSMDateTimeComponent; /** - * Creates a plain object from a SyncdPatch message. Also converts values to other types if specified. - * @param message SyncdPatch + * Creates a plain object from a HSMDateTimeComponent message. Also converts values to other types if specified. + * @param message HSMDateTimeComponent * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: proto.SyncdPatch, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: proto.HSMDateTimeComponent, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this SyncdPatch to JSON. + * Converts this HSMDateTimeComponent to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a SyncdMutation. */ - interface ISyncdMutation { + namespace HSMDateTimeComponent { - /** SyncdMutation operation */ - operation?: (proto.SyncdMutation.SyncdMutationSyncdOperation|null); + /** HSMDateTimeComponentDayOfWeekType enum. */ + enum HSMDateTimeComponentDayOfWeekType { + MONDAY = 1, + TUESDAY = 2, + WEDNESDAY = 3, + THURSDAY = 4, + FRIDAY = 5, + SATURDAY = 6, + SUNDAY = 7 + } - /** SyncdMutation record */ - record?: (proto.ISyncdRecord|null); + /** HSMDateTimeComponentCalendarType enum. */ + enum HSMDateTimeComponentCalendarType { + GREGORIAN = 1, + SOLAR_HIJRI = 2 + } } - /** Represents a SyncdMutation. */ - class SyncdMutation implements ISyncdMutation { + /** Properties of a HSMDateTimeUnixEpoch. */ + interface IHSMDateTimeUnixEpoch { + + /** HSMDateTimeUnixEpoch timestamp */ + timestamp?: (number|Long|null); + } + + /** Represents a HSMDateTimeUnixEpoch. */ + class HSMDateTimeUnixEpoch implements IHSMDateTimeUnixEpoch { /** - * Constructs a new SyncdMutation. + * Constructs a new HSMDateTimeUnixEpoch. * @param [properties] Properties to set */ - constructor(properties?: proto.ISyncdMutation); - - /** SyncdMutation operation. */ - public operation: proto.SyncdMutation.SyncdMutationSyncdOperation; + constructor(properties?: proto.IHSMDateTimeUnixEpoch); - /** SyncdMutation record. */ - public record?: (proto.ISyncdRecord|null); + /** HSMDateTimeUnixEpoch timestamp. */ + public timestamp: (number|Long); /** - * Creates a new SyncdMutation instance using the specified properties. + * Creates a new HSMDateTimeUnixEpoch instance using the specified properties. * @param [properties] Properties to set - * @returns SyncdMutation instance + * @returns HSMDateTimeUnixEpoch instance */ - public static create(properties?: proto.ISyncdMutation): proto.SyncdMutation; + public static create(properties?: proto.IHSMDateTimeUnixEpoch): proto.HSMDateTimeUnixEpoch; /** - * Encodes the specified SyncdMutation message. Does not implicitly {@link proto.SyncdMutation.verify|verify} messages. - * @param message SyncdMutation message or plain object to encode + * Encodes the specified HSMDateTimeUnixEpoch message. Does not implicitly {@link proto.HSMDateTimeUnixEpoch.verify|verify} messages. + * @param message HSMDateTimeUnixEpoch message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: proto.ISyncdMutation, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: proto.IHSMDateTimeUnixEpoch, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified SyncdMutation message, length delimited. Does not implicitly {@link proto.SyncdMutation.verify|verify} messages. - * @param message SyncdMutation message or plain object to encode + * Encodes the specified HSMDateTimeUnixEpoch message, length delimited. Does not implicitly {@link proto.HSMDateTimeUnixEpoch.verify|verify} messages. + * @param message HSMDateTimeUnixEpoch message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: proto.ISyncdMutation, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: proto.IHSMDateTimeUnixEpoch, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a SyncdMutation message from the specified reader or buffer. + * Decodes a HSMDateTimeUnixEpoch message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns SyncdMutation + * @returns HSMDateTimeUnixEpoch * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.SyncdMutation; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.HSMDateTimeUnixEpoch; /** - * Decodes a SyncdMutation message from the specified reader or buffer, length delimited. + * Decodes a HSMDateTimeUnixEpoch message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns SyncdMutation + * @returns HSMDateTimeUnixEpoch * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.SyncdMutation; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.HSMDateTimeUnixEpoch; /** - * Verifies a SyncdMutation message. + * Verifies a HSMDateTimeUnixEpoch message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a SyncdMutation message from a plain object. Also converts values to their respective internal types. + * Creates a HSMDateTimeUnixEpoch message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns SyncdMutation + * @returns HSMDateTimeUnixEpoch */ - public static fromObject(object: { [k: string]: any }): proto.SyncdMutation; + public static fromObject(object: { [k: string]: any }): proto.HSMDateTimeUnixEpoch; /** - * Creates a plain object from a SyncdMutation message. Also converts values to other types if specified. - * @param message SyncdMutation + * Creates a plain object from a HSMDateTimeUnixEpoch message. Also converts values to other types if specified. + * @param message HSMDateTimeUnixEpoch * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: proto.SyncdMutation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: proto.HSMDateTimeUnixEpoch, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this SyncdMutation to JSON. + * Converts this HSMDateTimeUnixEpoch to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - namespace SyncdMutation { + /** Properties of a HSMLocalizableParameter. */ + interface IHSMLocalizableParameter { - /** SyncdMutationSyncdOperation enum. */ - enum SyncdMutationSyncdOperation { - SET = 0, - REMOVE = 1 - } - } + /** HSMLocalizableParameter default */ + "default"?: (string|null); - /** Properties of a SyncdMutations. */ - interface ISyncdMutations { + /** HSMLocalizableParameter currency */ + currency?: (proto.IHSMCurrency|null); - /** SyncdMutations mutations */ - mutations?: (proto.ISyncdMutation[]|null); + /** HSMLocalizableParameter dateTime */ + dateTime?: (proto.IHSMDateTime|null); } - /** Represents a SyncdMutations. */ - class SyncdMutations implements ISyncdMutations { + /** Represents a HSMLocalizableParameter. */ + class HSMLocalizableParameter implements IHSMLocalizableParameter { /** - * Constructs a new SyncdMutations. + * Constructs a new HSMLocalizableParameter. * @param [properties] Properties to set */ - constructor(properties?: proto.ISyncdMutations); + constructor(properties?: proto.IHSMLocalizableParameter); - /** SyncdMutations mutations. */ - public mutations: proto.ISyncdMutation[]; + /** HSMLocalizableParameter default. */ + public default: string; + + /** HSMLocalizableParameter currency. */ + public currency?: (proto.IHSMCurrency|null); + + /** HSMLocalizableParameter dateTime. */ + public dateTime?: (proto.IHSMDateTime|null); + + /** HSMLocalizableParameter paramOneof. */ + public paramOneof?: ("currency"|"dateTime"); /** - * Creates a new SyncdMutations instance using the specified properties. + * Creates a new HSMLocalizableParameter instance using the specified properties. * @param [properties] Properties to set - * @returns SyncdMutations instance + * @returns HSMLocalizableParameter instance */ - public static create(properties?: proto.ISyncdMutations): proto.SyncdMutations; + public static create(properties?: proto.IHSMLocalizableParameter): proto.HSMLocalizableParameter; /** - * Encodes the specified SyncdMutations message. Does not implicitly {@link proto.SyncdMutations.verify|verify} messages. - * @param message SyncdMutations message or plain object to encode + * Encodes the specified HSMLocalizableParameter message. Does not implicitly {@link proto.HSMLocalizableParameter.verify|verify} messages. + * @param message HSMLocalizableParameter message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: proto.ISyncdMutations, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: proto.IHSMLocalizableParameter, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified SyncdMutations message, length delimited. Does not implicitly {@link proto.SyncdMutations.verify|verify} messages. - * @param message SyncdMutations message or plain object to encode + * Encodes the specified HSMLocalizableParameter message, length delimited. Does not implicitly {@link proto.HSMLocalizableParameter.verify|verify} messages. + * @param message HSMLocalizableParameter message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: proto.ISyncdMutations, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: proto.IHSMLocalizableParameter, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a SyncdMutations message from the specified reader or buffer. + * Decodes a HSMLocalizableParameter message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns SyncdMutations + * @returns HSMLocalizableParameter * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.SyncdMutations; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.HSMLocalizableParameter; /** - * Decodes a SyncdMutations message from the specified reader or buffer, length delimited. + * Decodes a HSMLocalizableParameter message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns SyncdMutations + * @returns HSMLocalizableParameter * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.SyncdMutations; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.HSMLocalizableParameter; /** - * Verifies a SyncdMutations message. + * Verifies a HSMLocalizableParameter message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a SyncdMutations message from a plain object. Also converts values to their respective internal types. + * Creates a HSMLocalizableParameter message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns SyncdMutations + * @returns HSMLocalizableParameter */ - public static fromObject(object: { [k: string]: any }): proto.SyncdMutations; + public static fromObject(object: { [k: string]: any }): proto.HSMLocalizableParameter; /** - * Creates a plain object from a SyncdMutations message. Also converts values to other types if specified. - * @param message SyncdMutations + * Creates a plain object from a HSMLocalizableParameter message. Also converts values to other types if specified. + * @param message HSMLocalizableParameter * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: proto.SyncdMutations, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: proto.HSMLocalizableParameter, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this SyncdMutations to JSON. + * Converts this HSMLocalizableParameter to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a SyncdSnapshot. */ - interface ISyncdSnapshot { - - /** SyncdSnapshot version */ - version?: (proto.ISyncdVersion|null); - - /** SyncdSnapshot records */ - records?: (proto.ISyncdRecord[]|null); + /** Properties of a HydratedCallButton. */ + interface IHydratedCallButton { - /** SyncdSnapshot mac */ - mac?: (Uint8Array|null); + /** HydratedCallButton displayText */ + displayText?: (string|null); - /** SyncdSnapshot keyId */ - keyId?: (proto.IKeyId|null); + /** HydratedCallButton phoneNumber */ + phoneNumber?: (string|null); } - /** Represents a SyncdSnapshot. */ - class SyncdSnapshot implements ISyncdSnapshot { + /** Represents a HydratedCallButton. */ + class HydratedCallButton implements IHydratedCallButton { /** - * Constructs a new SyncdSnapshot. + * Constructs a new HydratedCallButton. * @param [properties] Properties to set */ - constructor(properties?: proto.ISyncdSnapshot); - - /** SyncdSnapshot version. */ - public version?: (proto.ISyncdVersion|null); - - /** SyncdSnapshot records. */ - public records: proto.ISyncdRecord[]; + constructor(properties?: proto.IHydratedCallButton); - /** SyncdSnapshot mac. */ - public mac: Uint8Array; + /** HydratedCallButton displayText. */ + public displayText: string; - /** SyncdSnapshot keyId. */ - public keyId?: (proto.IKeyId|null); + /** HydratedCallButton phoneNumber. */ + public phoneNumber: string; /** - * Creates a new SyncdSnapshot instance using the specified properties. + * Creates a new HydratedCallButton instance using the specified properties. * @param [properties] Properties to set - * @returns SyncdSnapshot instance + * @returns HydratedCallButton instance */ - public static create(properties?: proto.ISyncdSnapshot): proto.SyncdSnapshot; + public static create(properties?: proto.IHydratedCallButton): proto.HydratedCallButton; /** - * Encodes the specified SyncdSnapshot message. Does not implicitly {@link proto.SyncdSnapshot.verify|verify} messages. - * @param message SyncdSnapshot message or plain object to encode + * Encodes the specified HydratedCallButton message. Does not implicitly {@link proto.HydratedCallButton.verify|verify} messages. + * @param message HydratedCallButton message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: proto.ISyncdSnapshot, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: proto.IHydratedCallButton, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified SyncdSnapshot message, length delimited. Does not implicitly {@link proto.SyncdSnapshot.verify|verify} messages. - * @param message SyncdSnapshot message or plain object to encode + * Encodes the specified HydratedCallButton message, length delimited. Does not implicitly {@link proto.HydratedCallButton.verify|verify} messages. + * @param message HydratedCallButton message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: proto.ISyncdSnapshot, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: proto.IHydratedCallButton, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a SyncdSnapshot message from the specified reader or buffer. + * Decodes a HydratedCallButton message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns SyncdSnapshot + * @returns HydratedCallButton * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.SyncdSnapshot; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.HydratedCallButton; /** - * Decodes a SyncdSnapshot message from the specified reader or buffer, length delimited. + * Decodes a HydratedCallButton message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns SyncdSnapshot + * @returns HydratedCallButton * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.SyncdSnapshot; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.HydratedCallButton; /** - * Verifies a SyncdSnapshot message. + * Verifies a HydratedCallButton message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a SyncdSnapshot message from a plain object. Also converts values to their respective internal types. + * Creates a HydratedCallButton message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns SyncdSnapshot + * @returns HydratedCallButton */ - public static fromObject(object: { [k: string]: any }): proto.SyncdSnapshot; + public static fromObject(object: { [k: string]: any }): proto.HydratedCallButton; /** - * Creates a plain object from a SyncdSnapshot message. Also converts values to other types if specified. - * @param message SyncdSnapshot + * Creates a plain object from a HydratedCallButton message. Also converts values to other types if specified. + * @param message HydratedCallButton * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: proto.SyncdSnapshot, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: proto.HydratedCallButton, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this SyncdSnapshot to JSON. + * Converts this HydratedCallButton to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of an ExternalBlobReference. */ - interface IExternalBlobReference { - - /** ExternalBlobReference mediaKey */ - mediaKey?: (Uint8Array|null); + /** Properties of a HydratedFourRowTemplate. */ + interface IHydratedFourRowTemplate { - /** ExternalBlobReference directPath */ - directPath?: (string|null); + /** HydratedFourRowTemplate hydratedContentText */ + hydratedContentText?: (string|null); - /** ExternalBlobReference handle */ - handle?: (string|null); + /** HydratedFourRowTemplate hydratedFooterText */ + hydratedFooterText?: (string|null); - /** ExternalBlobReference fileSizeBytes */ - fileSizeBytes?: (number|Long|null); + /** HydratedFourRowTemplate hydratedButtons */ + hydratedButtons?: (proto.IHydratedTemplateButton[]|null); - /** ExternalBlobReference fileSha256 */ - fileSha256?: (Uint8Array|null); + /** HydratedFourRowTemplate templateId */ + templateId?: (string|null); - /** ExternalBlobReference fileEncSha256 */ - fileEncSha256?: (Uint8Array|null); + /** HydratedFourRowTemplate documentMessage */ + documentMessage?: (proto.IDocumentMessage|null); + + /** HydratedFourRowTemplate hydratedTitleText */ + hydratedTitleText?: (string|null); + + /** HydratedFourRowTemplate imageMessage */ + imageMessage?: (proto.IImageMessage|null); + + /** HydratedFourRowTemplate videoMessage */ + videoMessage?: (proto.IVideoMessage|null); + + /** HydratedFourRowTemplate locationMessage */ + locationMessage?: (proto.ILocationMessage|null); } - /** Represents an ExternalBlobReference. */ - class ExternalBlobReference implements IExternalBlobReference { + /** Represents a HydratedFourRowTemplate. */ + class HydratedFourRowTemplate implements IHydratedFourRowTemplate { /** - * Constructs a new ExternalBlobReference. + * Constructs a new HydratedFourRowTemplate. * @param [properties] Properties to set */ - constructor(properties?: proto.IExternalBlobReference); + constructor(properties?: proto.IHydratedFourRowTemplate); - /** ExternalBlobReference mediaKey. */ - public mediaKey: Uint8Array; + /** HydratedFourRowTemplate hydratedContentText. */ + public hydratedContentText: string; - /** ExternalBlobReference directPath. */ - public directPath: string; + /** HydratedFourRowTemplate hydratedFooterText. */ + public hydratedFooterText: string; - /** ExternalBlobReference handle. */ - public handle: string; + /** HydratedFourRowTemplate hydratedButtons. */ + public hydratedButtons: proto.IHydratedTemplateButton[]; - /** ExternalBlobReference fileSizeBytes. */ - public fileSizeBytes: (number|Long); + /** HydratedFourRowTemplate templateId. */ + public templateId: string; - /** ExternalBlobReference fileSha256. */ - public fileSha256: Uint8Array; + /** HydratedFourRowTemplate documentMessage. */ + public documentMessage?: (proto.IDocumentMessage|null); - /** ExternalBlobReference fileEncSha256. */ - public fileEncSha256: Uint8Array; + /** HydratedFourRowTemplate hydratedTitleText. */ + public hydratedTitleText?: (string|null); + + /** HydratedFourRowTemplate imageMessage. */ + public imageMessage?: (proto.IImageMessage|null); + + /** HydratedFourRowTemplate videoMessage. */ + public videoMessage?: (proto.IVideoMessage|null); + + /** HydratedFourRowTemplate locationMessage. */ + public locationMessage?: (proto.ILocationMessage|null); + + /** HydratedFourRowTemplate title. */ + public title?: ("documentMessage"|"hydratedTitleText"|"imageMessage"|"videoMessage"|"locationMessage"); /** - * Creates a new ExternalBlobReference instance using the specified properties. + * Creates a new HydratedFourRowTemplate instance using the specified properties. * @param [properties] Properties to set - * @returns ExternalBlobReference instance + * @returns HydratedFourRowTemplate instance */ - public static create(properties?: proto.IExternalBlobReference): proto.ExternalBlobReference; + public static create(properties?: proto.IHydratedFourRowTemplate): proto.HydratedFourRowTemplate; /** - * Encodes the specified ExternalBlobReference message. Does not implicitly {@link proto.ExternalBlobReference.verify|verify} messages. - * @param message ExternalBlobReference message or plain object to encode + * Encodes the specified HydratedFourRowTemplate message. Does not implicitly {@link proto.HydratedFourRowTemplate.verify|verify} messages. + * @param message HydratedFourRowTemplate message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: proto.IExternalBlobReference, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: proto.IHydratedFourRowTemplate, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ExternalBlobReference message, length delimited. Does not implicitly {@link proto.ExternalBlobReference.verify|verify} messages. - * @param message ExternalBlobReference message or plain object to encode + * Encodes the specified HydratedFourRowTemplate message, length delimited. Does not implicitly {@link proto.HydratedFourRowTemplate.verify|verify} messages. + * @param message HydratedFourRowTemplate message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: proto.IExternalBlobReference, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: proto.IHydratedFourRowTemplate, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an ExternalBlobReference message from the specified reader or buffer. + * Decodes a HydratedFourRowTemplate message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ExternalBlobReference + * @returns HydratedFourRowTemplate * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.ExternalBlobReference; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.HydratedFourRowTemplate; /** - * Decodes an ExternalBlobReference message from the specified reader or buffer, length delimited. + * Decodes a HydratedFourRowTemplate message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ExternalBlobReference + * @returns HydratedFourRowTemplate * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.ExternalBlobReference; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.HydratedFourRowTemplate; /** - * Verifies an ExternalBlobReference message. + * Verifies a HydratedFourRowTemplate message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates an ExternalBlobReference message from a plain object. Also converts values to their respective internal types. + * Creates a HydratedFourRowTemplate message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ExternalBlobReference + * @returns HydratedFourRowTemplate */ - public static fromObject(object: { [k: string]: any }): proto.ExternalBlobReference; + public static fromObject(object: { [k: string]: any }): proto.HydratedFourRowTemplate; /** - * Creates a plain object from an ExternalBlobReference message. Also converts values to other types if specified. - * @param message ExternalBlobReference + * Creates a plain object from a HydratedFourRowTemplate message. Also converts values to other types if specified. + * @param message HydratedFourRowTemplate * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: proto.ExternalBlobReference, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: proto.HydratedFourRowTemplate, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ExternalBlobReference to JSON. + * Converts this HydratedFourRowTemplate to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a SyncdRecord. */ - interface ISyncdRecord { - - /** SyncdRecord index */ - index?: (proto.ISyncdIndex|null); + /** Properties of a HydratedQuickReplyButton. */ + interface IHydratedQuickReplyButton { - /** SyncdRecord value */ - value?: (proto.ISyncdValue|null); + /** HydratedQuickReplyButton displayText */ + displayText?: (string|null); - /** SyncdRecord keyId */ - keyId?: (proto.IKeyId|null); + /** HydratedQuickReplyButton id */ + id?: (string|null); } - /** Represents a SyncdRecord. */ - class SyncdRecord implements ISyncdRecord { + /** Represents a HydratedQuickReplyButton. */ + class HydratedQuickReplyButton implements IHydratedQuickReplyButton { /** - * Constructs a new SyncdRecord. + * Constructs a new HydratedQuickReplyButton. * @param [properties] Properties to set */ - constructor(properties?: proto.ISyncdRecord); - - /** SyncdRecord index. */ - public index?: (proto.ISyncdIndex|null); + constructor(properties?: proto.IHydratedQuickReplyButton); - /** SyncdRecord value. */ - public value?: (proto.ISyncdValue|null); + /** HydratedQuickReplyButton displayText. */ + public displayText: string; - /** SyncdRecord keyId. */ - public keyId?: (proto.IKeyId|null); + /** HydratedQuickReplyButton id. */ + public id: string; /** - * Creates a new SyncdRecord instance using the specified properties. + * Creates a new HydratedQuickReplyButton instance using the specified properties. * @param [properties] Properties to set - * @returns SyncdRecord instance + * @returns HydratedQuickReplyButton instance */ - public static create(properties?: proto.ISyncdRecord): proto.SyncdRecord; + public static create(properties?: proto.IHydratedQuickReplyButton): proto.HydratedQuickReplyButton; /** - * Encodes the specified SyncdRecord message. Does not implicitly {@link proto.SyncdRecord.verify|verify} messages. - * @param message SyncdRecord message or plain object to encode + * Encodes the specified HydratedQuickReplyButton message. Does not implicitly {@link proto.HydratedQuickReplyButton.verify|verify} messages. + * @param message HydratedQuickReplyButton message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: proto.ISyncdRecord, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: proto.IHydratedQuickReplyButton, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified SyncdRecord message, length delimited. Does not implicitly {@link proto.SyncdRecord.verify|verify} messages. - * @param message SyncdRecord message or plain object to encode + * Encodes the specified HydratedQuickReplyButton message, length delimited. Does not implicitly {@link proto.HydratedQuickReplyButton.verify|verify} messages. + * @param message HydratedQuickReplyButton message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: proto.ISyncdRecord, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: proto.IHydratedQuickReplyButton, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a SyncdRecord message from the specified reader or buffer. + * Decodes a HydratedQuickReplyButton message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns SyncdRecord + * @returns HydratedQuickReplyButton * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.SyncdRecord; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.HydratedQuickReplyButton; /** - * Decodes a SyncdRecord message from the specified reader or buffer, length delimited. + * Decodes a HydratedQuickReplyButton message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns SyncdRecord + * @returns HydratedQuickReplyButton * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.SyncdRecord; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.HydratedQuickReplyButton; /** - * Verifies a SyncdRecord message. + * Verifies a HydratedQuickReplyButton message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a SyncdRecord message from a plain object. Also converts values to their respective internal types. + * Creates a HydratedQuickReplyButton message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns SyncdRecord + * @returns HydratedQuickReplyButton */ - public static fromObject(object: { [k: string]: any }): proto.SyncdRecord; + public static fromObject(object: { [k: string]: any }): proto.HydratedQuickReplyButton; /** - * Creates a plain object from a SyncdRecord message. Also converts values to other types if specified. - * @param message SyncdRecord + * Creates a plain object from a HydratedQuickReplyButton message. Also converts values to other types if specified. + * @param message HydratedQuickReplyButton * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: proto.SyncdRecord, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: proto.HydratedQuickReplyButton, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this SyncdRecord to JSON. + * Converts this HydratedQuickReplyButton to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a KeyId. */ - interface IKeyId { + /** Properties of a HydratedTemplateButton. */ + interface IHydratedTemplateButton { - /** KeyId id */ - id?: (Uint8Array|null); + /** HydratedTemplateButton index */ + index?: (number|null); + + /** HydratedTemplateButton quickReplyButton */ + quickReplyButton?: (proto.IHydratedQuickReplyButton|null); + + /** HydratedTemplateButton urlButton */ + urlButton?: (proto.IHydratedURLButton|null); + + /** HydratedTemplateButton callButton */ + callButton?: (proto.IHydratedCallButton|null); } - /** Represents a KeyId. */ - class KeyId implements IKeyId { + /** Represents a HydratedTemplateButton. */ + class HydratedTemplateButton implements IHydratedTemplateButton { /** - * Constructs a new KeyId. + * Constructs a new HydratedTemplateButton. * @param [properties] Properties to set */ - constructor(properties?: proto.IKeyId); + constructor(properties?: proto.IHydratedTemplateButton); - /** KeyId id. */ - public id: Uint8Array; + /** HydratedTemplateButton index. */ + public index: number; + + /** HydratedTemplateButton quickReplyButton. */ + public quickReplyButton?: (proto.IHydratedQuickReplyButton|null); + + /** HydratedTemplateButton urlButton. */ + public urlButton?: (proto.IHydratedURLButton|null); + + /** HydratedTemplateButton callButton. */ + public callButton?: (proto.IHydratedCallButton|null); + + /** HydratedTemplateButton hydratedButton. */ + public hydratedButton?: ("quickReplyButton"|"urlButton"|"callButton"); /** - * Creates a new KeyId instance using the specified properties. + * Creates a new HydratedTemplateButton instance using the specified properties. * @param [properties] Properties to set - * @returns KeyId instance + * @returns HydratedTemplateButton instance */ - public static create(properties?: proto.IKeyId): proto.KeyId; + public static create(properties?: proto.IHydratedTemplateButton): proto.HydratedTemplateButton; /** - * Encodes the specified KeyId message. Does not implicitly {@link proto.KeyId.verify|verify} messages. - * @param message KeyId message or plain object to encode + * Encodes the specified HydratedTemplateButton message. Does not implicitly {@link proto.HydratedTemplateButton.verify|verify} messages. + * @param message HydratedTemplateButton message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: proto.IKeyId, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: proto.IHydratedTemplateButton, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified KeyId message, length delimited. Does not implicitly {@link proto.KeyId.verify|verify} messages. - * @param message KeyId message or plain object to encode + * Encodes the specified HydratedTemplateButton message, length delimited. Does not implicitly {@link proto.HydratedTemplateButton.verify|verify} messages. + * @param message HydratedTemplateButton message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: proto.IKeyId, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: proto.IHydratedTemplateButton, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a KeyId message from the specified reader or buffer. + * Decodes a HydratedTemplateButton message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns KeyId + * @returns HydratedTemplateButton * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.KeyId; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.HydratedTemplateButton; /** - * Decodes a KeyId message from the specified reader or buffer, length delimited. + * Decodes a HydratedTemplateButton message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns KeyId + * @returns HydratedTemplateButton * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.KeyId; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.HydratedTemplateButton; /** - * Verifies a KeyId message. + * Verifies a HydratedTemplateButton message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a KeyId message from a plain object. Also converts values to their respective internal types. + * Creates a HydratedTemplateButton message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns KeyId + * @returns HydratedTemplateButton */ - public static fromObject(object: { [k: string]: any }): proto.KeyId; + public static fromObject(object: { [k: string]: any }): proto.HydratedTemplateButton; /** - * Creates a plain object from a KeyId message. Also converts values to other types if specified. - * @param message KeyId + * Creates a plain object from a HydratedTemplateButton message. Also converts values to other types if specified. + * @param message HydratedTemplateButton * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: proto.KeyId, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: proto.HydratedTemplateButton, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this KeyId to JSON. + * Converts this HydratedTemplateButton to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a SyncdValue. */ - interface ISyncdValue { + /** Properties of a HydratedURLButton. */ + interface IHydratedURLButton { - /** SyncdValue blob */ - blob?: (Uint8Array|null); + /** HydratedURLButton displayText */ + displayText?: (string|null); + + /** HydratedURLButton url */ + url?: (string|null); } - /** Represents a SyncdValue. */ - class SyncdValue implements ISyncdValue { + /** Represents a HydratedURLButton. */ + class HydratedURLButton implements IHydratedURLButton { /** - * Constructs a new SyncdValue. + * Constructs a new HydratedURLButton. * @param [properties] Properties to set */ - constructor(properties?: proto.ISyncdValue); + constructor(properties?: proto.IHydratedURLButton); - /** SyncdValue blob. */ - public blob: Uint8Array; + /** HydratedURLButton displayText. */ + public displayText: string; + + /** HydratedURLButton url. */ + public url: string; /** - * Creates a new SyncdValue instance using the specified properties. + * Creates a new HydratedURLButton instance using the specified properties. * @param [properties] Properties to set - * @returns SyncdValue instance + * @returns HydratedURLButton instance */ - public static create(properties?: proto.ISyncdValue): proto.SyncdValue; + public static create(properties?: proto.IHydratedURLButton): proto.HydratedURLButton; /** - * Encodes the specified SyncdValue message. Does not implicitly {@link proto.SyncdValue.verify|verify} messages. - * @param message SyncdValue message or plain object to encode + * Encodes the specified HydratedURLButton message. Does not implicitly {@link proto.HydratedURLButton.verify|verify} messages. + * @param message HydratedURLButton message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: proto.ISyncdValue, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: proto.IHydratedURLButton, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified SyncdValue message, length delimited. Does not implicitly {@link proto.SyncdValue.verify|verify} messages. - * @param message SyncdValue message or plain object to encode + * Encodes the specified HydratedURLButton message, length delimited. Does not implicitly {@link proto.HydratedURLButton.verify|verify} messages. + * @param message HydratedURLButton message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: proto.ISyncdValue, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: proto.IHydratedURLButton, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a SyncdValue message from the specified reader or buffer. + * Decodes a HydratedURLButton message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns SyncdValue + * @returns HydratedURLButton * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.SyncdValue; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.HydratedURLButton; /** - * Decodes a SyncdValue message from the specified reader or buffer, length delimited. + * Decodes a HydratedURLButton message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns SyncdValue + * @returns HydratedURLButton * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.SyncdValue; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.HydratedURLButton; /** - * Verifies a SyncdValue message. + * Verifies a HydratedURLButton message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a SyncdValue message from a plain object. Also converts values to their respective internal types. + * Creates a HydratedURLButton message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns SyncdValue + * @returns HydratedURLButton */ - public static fromObject(object: { [k: string]: any }): proto.SyncdValue; + public static fromObject(object: { [k: string]: any }): proto.HydratedURLButton; /** - * Creates a plain object from a SyncdValue message. Also converts values to other types if specified. - * @param message SyncdValue + * Creates a plain object from a HydratedURLButton message. Also converts values to other types if specified. + * @param message HydratedURLButton * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: proto.SyncdValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: proto.HydratedURLButton, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this SyncdValue to JSON. + * Converts this HydratedURLButton to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a SyncdIndex. */ - interface ISyncdIndex { + /** Properties of an ImageMessage. */ + interface IImageMessage { - /** SyncdIndex blob */ - blob?: (Uint8Array|null); - } + /** ImageMessage url */ + url?: (string|null); - /** Represents a SyncdIndex. */ - class SyncdIndex implements ISyncdIndex { + /** ImageMessage mimetype */ + mimetype?: (string|null); - /** - * Constructs a new SyncdIndex. - * @param [properties] Properties to set - */ - constructor(properties?: proto.ISyncdIndex); + /** ImageMessage caption */ + caption?: (string|null); - /** SyncdIndex blob. */ - public blob: Uint8Array; + /** ImageMessage fileSha256 */ + fileSha256?: (Uint8Array|null); - /** - * Creates a new SyncdIndex instance using the specified properties. - * @param [properties] Properties to set - * @returns SyncdIndex instance - */ - public static create(properties?: proto.ISyncdIndex): proto.SyncdIndex; + /** ImageMessage fileLength */ + fileLength?: (number|Long|null); - /** - * Encodes the specified SyncdIndex message. Does not implicitly {@link proto.SyncdIndex.verify|verify} messages. - * @param message SyncdIndex message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: proto.ISyncdIndex, writer?: $protobuf.Writer): $protobuf.Writer; + /** ImageMessage height */ + height?: (number|null); - /** - * Encodes the specified SyncdIndex message, length delimited. Does not implicitly {@link proto.SyncdIndex.verify|verify} messages. - * @param message SyncdIndex message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: proto.ISyncdIndex, writer?: $protobuf.Writer): $protobuf.Writer; + /** ImageMessage width */ + width?: (number|null); - /** - * Decodes a SyncdIndex message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SyncdIndex - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.SyncdIndex; + /** ImageMessage mediaKey */ + mediaKey?: (Uint8Array|null); - /** - * Decodes a SyncdIndex message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SyncdIndex - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.SyncdIndex; + /** ImageMessage fileEncSha256 */ + fileEncSha256?: (Uint8Array|null); - /** - * Verifies a SyncdIndex message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** ImageMessage interactiveAnnotations */ + interactiveAnnotations?: (proto.IInteractiveAnnotation[]|null); - /** - * Creates a SyncdIndex message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SyncdIndex - */ - public static fromObject(object: { [k: string]: any }): proto.SyncdIndex; + /** ImageMessage directPath */ + directPath?: (string|null); - /** - * Creates a plain object from a SyncdIndex message. Also converts values to other types if specified. - * @param message SyncdIndex - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: proto.SyncdIndex, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** ImageMessage mediaKeyTimestamp */ + mediaKeyTimestamp?: (number|Long|null); - /** - * Converts this SyncdIndex to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** ImageMessage jpegThumbnail */ + jpegThumbnail?: (Uint8Array|null); - /** Properties of an ExitCode. */ - interface IExitCode { + /** ImageMessage contextInfo */ + contextInfo?: (proto.IContextInfo|null); - /** ExitCode code */ - code?: (number|Long|null); + /** ImageMessage firstScanSidecar */ + firstScanSidecar?: (Uint8Array|null); - /** ExitCode text */ - text?: (string|null); - } + /** ImageMessage firstScanLength */ + firstScanLength?: (number|null); - /** Represents an ExitCode. */ - class ExitCode implements IExitCode { + /** ImageMessage experimentGroupId */ + experimentGroupId?: (number|null); - /** - * Constructs a new ExitCode. - * @param [properties] Properties to set - */ - constructor(properties?: proto.IExitCode); + /** ImageMessage scansSidecar */ + scansSidecar?: (Uint8Array|null); - /** ExitCode code. */ - public code: (number|Long); + /** ImageMessage scanLengths */ + scanLengths?: (number[]|null); - /** ExitCode text. */ - public text: string; + /** ImageMessage midQualityFileSha256 */ + midQualityFileSha256?: (Uint8Array|null); - /** - * Creates a new ExitCode instance using the specified properties. - * @param [properties] Properties to set - * @returns ExitCode instance - */ - public static create(properties?: proto.IExitCode): proto.ExitCode; + /** ImageMessage midQualityFileEncSha256 */ + midQualityFileEncSha256?: (Uint8Array|null); - /** - * Encodes the specified ExitCode message. Does not implicitly {@link proto.ExitCode.verify|verify} messages. - * @param message ExitCode message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: proto.IExitCode, writer?: $protobuf.Writer): $protobuf.Writer; + /** ImageMessage viewOnce */ + viewOnce?: (boolean|null); - /** - * Encodes the specified ExitCode message, length delimited. Does not implicitly {@link proto.ExitCode.verify|verify} messages. - * @param message ExitCode message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: proto.IExitCode, writer?: $protobuf.Writer): $protobuf.Writer; + /** ImageMessage thumbnailDirectPath */ + thumbnailDirectPath?: (string|null); - /** - * Decodes an ExitCode message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ExitCode - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.ExitCode; + /** ImageMessage thumbnailSha256 */ + thumbnailSha256?: (Uint8Array|null); - /** - * Decodes an ExitCode message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ExitCode - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.ExitCode; + /** ImageMessage thumbnailEncSha256 */ + thumbnailEncSha256?: (Uint8Array|null); - /** - * Verifies an ExitCode message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** ImageMessage staticUrl */ + staticUrl?: (string|null); + } - /** - * Creates an ExitCode message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ExitCode - */ - public static fromObject(object: { [k: string]: any }): proto.ExitCode; + /** Represents an ImageMessage. */ + class ImageMessage implements IImageMessage { /** - * Creates a plain object from an ExitCode message. Also converts values to other types if specified. - * @param message ExitCode - * @param [options] Conversion options - * @returns Plain object + * Constructs a new ImageMessage. + * @param [properties] Properties to set */ - public static toObject(message: proto.ExitCode, options?: $protobuf.IConversionOptions): { [k: string]: any }; + constructor(properties?: proto.IImageMessage); - /** - * Converts this ExitCode to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** ImageMessage url. */ + public url: string; - /** Properties of a SyncdVersion. */ - interface ISyncdVersion { + /** ImageMessage mimetype. */ + public mimetype: string; - /** SyncdVersion version */ - version?: (number|Long|null); - } + /** ImageMessage caption. */ + public caption: string; - /** Represents a SyncdVersion. */ - class SyncdVersion implements ISyncdVersion { + /** ImageMessage fileSha256. */ + public fileSha256: Uint8Array; - /** - * Constructs a new SyncdVersion. - * @param [properties] Properties to set - */ - constructor(properties?: proto.ISyncdVersion); + /** ImageMessage fileLength. */ + public fileLength: (number|Long); - /** SyncdVersion version. */ - public version: (number|Long); + /** ImageMessage height. */ + public height: number; + + /** ImageMessage width. */ + public width: number; + + /** ImageMessage mediaKey. */ + public mediaKey: Uint8Array; + + /** ImageMessage fileEncSha256. */ + public fileEncSha256: Uint8Array; + + /** ImageMessage interactiveAnnotations. */ + public interactiveAnnotations: proto.IInteractiveAnnotation[]; + + /** ImageMessage directPath. */ + public directPath: string; + + /** ImageMessage mediaKeyTimestamp. */ + public mediaKeyTimestamp: (number|Long); + + /** ImageMessage jpegThumbnail. */ + public jpegThumbnail: Uint8Array; + + /** ImageMessage contextInfo. */ + public contextInfo?: (proto.IContextInfo|null); + + /** ImageMessage firstScanSidecar. */ + public firstScanSidecar: Uint8Array; + + /** ImageMessage firstScanLength. */ + public firstScanLength: number; + + /** ImageMessage experimentGroupId. */ + public experimentGroupId: number; + + /** ImageMessage scansSidecar. */ + public scansSidecar: Uint8Array; + + /** ImageMessage scanLengths. */ + public scanLengths: number[]; + + /** ImageMessage midQualityFileSha256. */ + public midQualityFileSha256: Uint8Array; + + /** ImageMessage midQualityFileEncSha256. */ + public midQualityFileEncSha256: Uint8Array; + + /** ImageMessage viewOnce. */ + public viewOnce: boolean; + + /** ImageMessage thumbnailDirectPath. */ + public thumbnailDirectPath: string; + + /** ImageMessage thumbnailSha256. */ + public thumbnailSha256: Uint8Array; + + /** ImageMessage thumbnailEncSha256. */ + public thumbnailEncSha256: Uint8Array; + + /** ImageMessage staticUrl. */ + public staticUrl: string; /** - * Creates a new SyncdVersion instance using the specified properties. + * Creates a new ImageMessage instance using the specified properties. * @param [properties] Properties to set - * @returns SyncdVersion instance + * @returns ImageMessage instance */ - public static create(properties?: proto.ISyncdVersion): proto.SyncdVersion; + public static create(properties?: proto.IImageMessage): proto.ImageMessage; /** - * Encodes the specified SyncdVersion message. Does not implicitly {@link proto.SyncdVersion.verify|verify} messages. - * @param message SyncdVersion message or plain object to encode + * Encodes the specified ImageMessage message. Does not implicitly {@link proto.ImageMessage.verify|verify} messages. + * @param message ImageMessage message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: proto.ISyncdVersion, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: proto.IImageMessage, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified SyncdVersion message, length delimited. Does not implicitly {@link proto.SyncdVersion.verify|verify} messages. - * @param message SyncdVersion message or plain object to encode + * Encodes the specified ImageMessage message, length delimited. Does not implicitly {@link proto.ImageMessage.verify|verify} messages. + * @param message ImageMessage message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: proto.ISyncdVersion, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: proto.IImageMessage, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a SyncdVersion message from the specified reader or buffer. + * Decodes an ImageMessage message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns SyncdVersion + * @returns ImageMessage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.SyncdVersion; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.ImageMessage; /** - * Decodes a SyncdVersion message from the specified reader or buffer, length delimited. + * Decodes an ImageMessage message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns SyncdVersion + * @returns ImageMessage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.SyncdVersion; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.ImageMessage; /** - * Verifies a SyncdVersion message. + * Verifies an ImageMessage message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a SyncdVersion message from a plain object. Also converts values to their respective internal types. + * Creates an ImageMessage message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns SyncdVersion + * @returns ImageMessage */ - public static fromObject(object: { [k: string]: any }): proto.SyncdVersion; + public static fromObject(object: { [k: string]: any }): proto.ImageMessage; /** - * Creates a plain object from a SyncdVersion message. Also converts values to other types if specified. - * @param message SyncdVersion + * Creates a plain object from an ImageMessage message. Also converts values to other types if specified. + * @param message ImageMessage * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: proto.SyncdVersion, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: proto.ImageMessage, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this SyncdVersion to JSON. + * Converts this ImageMessage to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a ServerErrorReceipt. */ - interface IServerErrorReceipt { + /** Properties of an InitialSecurityNotificationSettingSync. */ + interface IInitialSecurityNotificationSettingSync { - /** ServerErrorReceipt stanzaId */ - stanzaId?: (string|null); + /** InitialSecurityNotificationSettingSync securityNotificationEnabled */ + securityNotificationEnabled?: (boolean|null); } - /** Represents a ServerErrorReceipt. */ - class ServerErrorReceipt implements IServerErrorReceipt { + /** Represents an InitialSecurityNotificationSettingSync. */ + class InitialSecurityNotificationSettingSync implements IInitialSecurityNotificationSettingSync { /** - * Constructs a new ServerErrorReceipt. + * Constructs a new InitialSecurityNotificationSettingSync. * @param [properties] Properties to set */ - constructor(properties?: proto.IServerErrorReceipt); + constructor(properties?: proto.IInitialSecurityNotificationSettingSync); - /** ServerErrorReceipt stanzaId. */ - public stanzaId: string; + /** InitialSecurityNotificationSettingSync securityNotificationEnabled. */ + public securityNotificationEnabled: boolean; /** - * Creates a new ServerErrorReceipt instance using the specified properties. + * Creates a new InitialSecurityNotificationSettingSync instance using the specified properties. * @param [properties] Properties to set - * @returns ServerErrorReceipt instance + * @returns InitialSecurityNotificationSettingSync instance */ - public static create(properties?: proto.IServerErrorReceipt): proto.ServerErrorReceipt; + public static create(properties?: proto.IInitialSecurityNotificationSettingSync): proto.InitialSecurityNotificationSettingSync; /** - * Encodes the specified ServerErrorReceipt message. Does not implicitly {@link proto.ServerErrorReceipt.verify|verify} messages. - * @param message ServerErrorReceipt message or plain object to encode + * Encodes the specified InitialSecurityNotificationSettingSync message. Does not implicitly {@link proto.InitialSecurityNotificationSettingSync.verify|verify} messages. + * @param message InitialSecurityNotificationSettingSync message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: proto.IServerErrorReceipt, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: proto.IInitialSecurityNotificationSettingSync, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ServerErrorReceipt message, length delimited. Does not implicitly {@link proto.ServerErrorReceipt.verify|verify} messages. - * @param message ServerErrorReceipt message or plain object to encode + * Encodes the specified InitialSecurityNotificationSettingSync message, length delimited. Does not implicitly {@link proto.InitialSecurityNotificationSettingSync.verify|verify} messages. + * @param message InitialSecurityNotificationSettingSync message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: proto.IServerErrorReceipt, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: proto.IInitialSecurityNotificationSettingSync, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ServerErrorReceipt message from the specified reader or buffer. + * Decodes an InitialSecurityNotificationSettingSync message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ServerErrorReceipt + * @returns InitialSecurityNotificationSettingSync * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.ServerErrorReceipt; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.InitialSecurityNotificationSettingSync; /** - * Decodes a ServerErrorReceipt message from the specified reader or buffer, length delimited. + * Decodes an InitialSecurityNotificationSettingSync message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ServerErrorReceipt + * @returns InitialSecurityNotificationSettingSync * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.ServerErrorReceipt; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.InitialSecurityNotificationSettingSync; /** - * Verifies a ServerErrorReceipt message. + * Verifies an InitialSecurityNotificationSettingSync message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a ServerErrorReceipt message from a plain object. Also converts values to their respective internal types. + * Creates an InitialSecurityNotificationSettingSync message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ServerErrorReceipt + * @returns InitialSecurityNotificationSettingSync */ - public static fromObject(object: { [k: string]: any }): proto.ServerErrorReceipt; + public static fromObject(object: { [k: string]: any }): proto.InitialSecurityNotificationSettingSync; /** - * Creates a plain object from a ServerErrorReceipt message. Also converts values to other types if specified. - * @param message ServerErrorReceipt + * Creates a plain object from an InitialSecurityNotificationSettingSync message. Also converts values to other types if specified. + * @param message InitialSecurityNotificationSettingSync * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: proto.ServerErrorReceipt, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: proto.InitialSecurityNotificationSettingSync, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ServerErrorReceipt to JSON. + * Converts this InitialSecurityNotificationSettingSync to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a MediaRetryNotification. */ - interface IMediaRetryNotification { - - /** MediaRetryNotification stanzaId */ - stanzaId?: (string|null); + /** Properties of an InteractiveAnnotation. */ + interface IInteractiveAnnotation { - /** MediaRetryNotification directPath */ - directPath?: (string|null); + /** InteractiveAnnotation polygonVertices */ + polygonVertices?: (proto.IPoint[]|null); - /** MediaRetryNotification result */ - result?: (proto.MediaRetryNotification.MediaRetryNotificationResultType|null); + /** InteractiveAnnotation location */ + location?: (proto.ILocation|null); } - /** Represents a MediaRetryNotification. */ - class MediaRetryNotification implements IMediaRetryNotification { + /** Represents an InteractiveAnnotation. */ + class InteractiveAnnotation implements IInteractiveAnnotation { /** - * Constructs a new MediaRetryNotification. + * Constructs a new InteractiveAnnotation. * @param [properties] Properties to set */ - constructor(properties?: proto.IMediaRetryNotification); + constructor(properties?: proto.IInteractiveAnnotation); - /** MediaRetryNotification stanzaId. */ - public stanzaId: string; + /** InteractiveAnnotation polygonVertices. */ + public polygonVertices: proto.IPoint[]; - /** MediaRetryNotification directPath. */ - public directPath: string; + /** InteractiveAnnotation location. */ + public location?: (proto.ILocation|null); - /** MediaRetryNotification result. */ - public result: proto.MediaRetryNotification.MediaRetryNotificationResultType; + /** InteractiveAnnotation action. */ + public action?: "location"; /** - * Creates a new MediaRetryNotification instance using the specified properties. + * Creates a new InteractiveAnnotation instance using the specified properties. * @param [properties] Properties to set - * @returns MediaRetryNotification instance + * @returns InteractiveAnnotation instance */ - public static create(properties?: proto.IMediaRetryNotification): proto.MediaRetryNotification; + public static create(properties?: proto.IInteractiveAnnotation): proto.InteractiveAnnotation; /** - * Encodes the specified MediaRetryNotification message. Does not implicitly {@link proto.MediaRetryNotification.verify|verify} messages. - * @param message MediaRetryNotification message or plain object to encode + * Encodes the specified InteractiveAnnotation message. Does not implicitly {@link proto.InteractiveAnnotation.verify|verify} messages. + * @param message InteractiveAnnotation message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: proto.IMediaRetryNotification, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: proto.IInteractiveAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified MediaRetryNotification message, length delimited. Does not implicitly {@link proto.MediaRetryNotification.verify|verify} messages. - * @param message MediaRetryNotification message or plain object to encode + * Encodes the specified InteractiveAnnotation message, length delimited. Does not implicitly {@link proto.InteractiveAnnotation.verify|verify} messages. + * @param message InteractiveAnnotation message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: proto.IMediaRetryNotification, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: proto.IInteractiveAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a MediaRetryNotification message from the specified reader or buffer. + * Decodes an InteractiveAnnotation message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns MediaRetryNotification + * @returns InteractiveAnnotation * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.MediaRetryNotification; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.InteractiveAnnotation; /** - * Decodes a MediaRetryNotification message from the specified reader or buffer, length delimited. + * Decodes an InteractiveAnnotation message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns MediaRetryNotification + * @returns InteractiveAnnotation * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.MediaRetryNotification; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.InteractiveAnnotation; /** - * Verifies a MediaRetryNotification message. + * Verifies an InteractiveAnnotation message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a MediaRetryNotification message from a plain object. Also converts values to their respective internal types. + * Creates an InteractiveAnnotation message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns MediaRetryNotification + * @returns InteractiveAnnotation */ - public static fromObject(object: { [k: string]: any }): proto.MediaRetryNotification; + public static fromObject(object: { [k: string]: any }): proto.InteractiveAnnotation; /** - * Creates a plain object from a MediaRetryNotification message. Also converts values to other types if specified. - * @param message MediaRetryNotification + * Creates a plain object from an InteractiveAnnotation message. Also converts values to other types if specified. + * @param message InteractiveAnnotation * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: proto.MediaRetryNotification, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: proto.InteractiveAnnotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this MediaRetryNotification to JSON. + * Converts this InteractiveAnnotation to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - namespace MediaRetryNotification { - - /** MediaRetryNotificationResultType enum. */ - enum MediaRetryNotificationResultType { - GENERAL_ERROR = 0, - SUCCESS = 1, - NOT_FOUND = 2, - DECRYPTION_ERROR = 3 - } - } - - /** Properties of a MsgOpaqueData. */ - interface IMsgOpaqueData { - - /** MsgOpaqueData body */ - body?: (string|null); - - /** MsgOpaqueData caption */ - caption?: (string|null); - - /** MsgOpaqueData lng */ - lng?: (number|null); - - /** MsgOpaqueData lat */ - lat?: (number|null); - - /** MsgOpaqueData paymentAmount1000 */ - paymentAmount1000?: (number|null); - - /** MsgOpaqueData paymentNoteMsgBody */ - paymentNoteMsgBody?: (string|null); + /** Properties of an InteractiveMessage. */ + interface IInteractiveMessage { - /** MsgOpaqueData canonicalUrl */ - canonicalUrl?: (string|null); + /** InteractiveMessage header */ + header?: (proto.IHeader|null); - /** MsgOpaqueData matchedText */ - matchedText?: (string|null); + /** InteractiveMessage body */ + body?: (proto.IInteractiveMessageBody|null); - /** MsgOpaqueData title */ - title?: (string|null); + /** InteractiveMessage footer */ + footer?: (proto.IFooter|null); - /** MsgOpaqueData description */ - description?: (string|null); + /** InteractiveMessage contextInfo */ + contextInfo?: (proto.IContextInfo|null); - /** MsgOpaqueData futureproofBuffer */ - futureproofBuffer?: (Uint8Array|null); + /** InteractiveMessage shopStorefrontMessage */ + shopStorefrontMessage?: (proto.IShopMessage|null); - /** MsgOpaqueData clientUrl */ - clientUrl?: (string|null); + /** InteractiveMessage collectionMessage */ + collectionMessage?: (proto.ICollectionMessage|null); - /** MsgOpaqueData loc */ - loc?: (string|null); + /** InteractiveMessage nativeFlowMessage */ + nativeFlowMessage?: (proto.INativeFlowMessage|null); } - /** Represents a MsgOpaqueData. */ - class MsgOpaqueData implements IMsgOpaqueData { + /** Represents an InteractiveMessage. */ + class InteractiveMessage implements IInteractiveMessage { /** - * Constructs a new MsgOpaqueData. + * Constructs a new InteractiveMessage. * @param [properties] Properties to set */ - constructor(properties?: proto.IMsgOpaqueData); - - /** MsgOpaqueData body. */ - public body: string; - - /** MsgOpaqueData caption. */ - public caption: string; - - /** MsgOpaqueData lng. */ - public lng: number; - - /** MsgOpaqueData lat. */ - public lat: number; - - /** MsgOpaqueData paymentAmount1000. */ - public paymentAmount1000: number; + constructor(properties?: proto.IInteractiveMessage); - /** MsgOpaqueData paymentNoteMsgBody. */ - public paymentNoteMsgBody: string; + /** InteractiveMessage header. */ + public header?: (proto.IHeader|null); - /** MsgOpaqueData canonicalUrl. */ - public canonicalUrl: string; + /** InteractiveMessage body. */ + public body?: (proto.IInteractiveMessageBody|null); - /** MsgOpaqueData matchedText. */ - public matchedText: string; + /** InteractiveMessage footer. */ + public footer?: (proto.IFooter|null); - /** MsgOpaqueData title. */ - public title: string; + /** InteractiveMessage contextInfo. */ + public contextInfo?: (proto.IContextInfo|null); - /** MsgOpaqueData description. */ - public description: string; + /** InteractiveMessage shopStorefrontMessage. */ + public shopStorefrontMessage?: (proto.IShopMessage|null); - /** MsgOpaqueData futureproofBuffer. */ - public futureproofBuffer: Uint8Array; + /** InteractiveMessage collectionMessage. */ + public collectionMessage?: (proto.ICollectionMessage|null); - /** MsgOpaqueData clientUrl. */ - public clientUrl: string; + /** InteractiveMessage nativeFlowMessage. */ + public nativeFlowMessage?: (proto.INativeFlowMessage|null); - /** MsgOpaqueData loc. */ - public loc: string; + /** InteractiveMessage interactiveMessage. */ + public interactiveMessage?: ("shopStorefrontMessage"|"collectionMessage"|"nativeFlowMessage"); /** - * Creates a new MsgOpaqueData instance using the specified properties. + * Creates a new InteractiveMessage instance using the specified properties. * @param [properties] Properties to set - * @returns MsgOpaqueData instance + * @returns InteractiveMessage instance */ - public static create(properties?: proto.IMsgOpaqueData): proto.MsgOpaqueData; + public static create(properties?: proto.IInteractiveMessage): proto.InteractiveMessage; /** - * Encodes the specified MsgOpaqueData message. Does not implicitly {@link proto.MsgOpaqueData.verify|verify} messages. - * @param message MsgOpaqueData message or plain object to encode + * Encodes the specified InteractiveMessage message. Does not implicitly {@link proto.InteractiveMessage.verify|verify} messages. + * @param message InteractiveMessage message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: proto.IMsgOpaqueData, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: proto.IInteractiveMessage, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified MsgOpaqueData message, length delimited. Does not implicitly {@link proto.MsgOpaqueData.verify|verify} messages. - * @param message MsgOpaqueData message or plain object to encode + * Encodes the specified InteractiveMessage message, length delimited. Does not implicitly {@link proto.InteractiveMessage.verify|verify} messages. + * @param message InteractiveMessage message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: proto.IMsgOpaqueData, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: proto.IInteractiveMessage, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a MsgOpaqueData message from the specified reader or buffer. + * Decodes an InteractiveMessage message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns MsgOpaqueData + * @returns InteractiveMessage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.MsgOpaqueData; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.InteractiveMessage; /** - * Decodes a MsgOpaqueData message from the specified reader or buffer, length delimited. + * Decodes an InteractiveMessage message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns MsgOpaqueData + * @returns InteractiveMessage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.MsgOpaqueData; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.InteractiveMessage; /** - * Verifies a MsgOpaqueData message. + * Verifies an InteractiveMessage message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a MsgOpaqueData message from a plain object. Also converts values to their respective internal types. + * Creates an InteractiveMessage message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns MsgOpaqueData + * @returns InteractiveMessage */ - public static fromObject(object: { [k: string]: any }): proto.MsgOpaqueData; + public static fromObject(object: { [k: string]: any }): proto.InteractiveMessage; /** - * Creates a plain object from a MsgOpaqueData message. Also converts values to other types if specified. - * @param message MsgOpaqueData + * Creates a plain object from an InteractiveMessage message. Also converts values to other types if specified. + * @param message InteractiveMessage * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: proto.MsgOpaqueData, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: proto.InteractiveMessage, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this MsgOpaqueData to JSON. + * Converts this InteractiveMessage to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a MsgRowOpaqueData. */ - interface IMsgRowOpaqueData { - - /** MsgRowOpaqueData currentMsg */ - currentMsg?: (proto.IMsgOpaqueData|null); + /** Properties of an InteractiveMessageBody. */ + interface IInteractiveMessageBody { - /** MsgRowOpaqueData quotedMsg */ - quotedMsg?: (proto.IMsgOpaqueData|null); + /** InteractiveMessageBody text */ + text?: (string|null); } - /** Represents a MsgRowOpaqueData. */ - class MsgRowOpaqueData implements IMsgRowOpaqueData { + /** Represents an InteractiveMessageBody. */ + class InteractiveMessageBody implements IInteractiveMessageBody { /** - * Constructs a new MsgRowOpaqueData. + * Constructs a new InteractiveMessageBody. * @param [properties] Properties to set */ - constructor(properties?: proto.IMsgRowOpaqueData); + constructor(properties?: proto.IInteractiveMessageBody); - /** MsgRowOpaqueData currentMsg. */ - public currentMsg?: (proto.IMsgOpaqueData|null); - - /** MsgRowOpaqueData quotedMsg. */ - public quotedMsg?: (proto.IMsgOpaqueData|null); + /** InteractiveMessageBody text. */ + public text: string; /** - * Creates a new MsgRowOpaqueData instance using the specified properties. + * Creates a new InteractiveMessageBody instance using the specified properties. * @param [properties] Properties to set - * @returns MsgRowOpaqueData instance + * @returns InteractiveMessageBody instance */ - public static create(properties?: proto.IMsgRowOpaqueData): proto.MsgRowOpaqueData; + public static create(properties?: proto.IInteractiveMessageBody): proto.InteractiveMessageBody; /** - * Encodes the specified MsgRowOpaqueData message. Does not implicitly {@link proto.MsgRowOpaqueData.verify|verify} messages. - * @param message MsgRowOpaqueData message or plain object to encode + * Encodes the specified InteractiveMessageBody message. Does not implicitly {@link proto.InteractiveMessageBody.verify|verify} messages. + * @param message InteractiveMessageBody message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: proto.IMsgRowOpaqueData, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: proto.IInteractiveMessageBody, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified MsgRowOpaqueData message, length delimited. Does not implicitly {@link proto.MsgRowOpaqueData.verify|verify} messages. - * @param message MsgRowOpaqueData message or plain object to encode + * Encodes the specified InteractiveMessageBody message, length delimited. Does not implicitly {@link proto.InteractiveMessageBody.verify|verify} messages. + * @param message InteractiveMessageBody message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: proto.IMsgRowOpaqueData, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: proto.IInteractiveMessageBody, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a MsgRowOpaqueData message from the specified reader or buffer. + * Decodes an InteractiveMessageBody message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns MsgRowOpaqueData + * @returns InteractiveMessageBody * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.MsgRowOpaqueData; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.InteractiveMessageBody; /** - * Decodes a MsgRowOpaqueData message from the specified reader or buffer, length delimited. + * Decodes an InteractiveMessageBody message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns MsgRowOpaqueData + * @returns InteractiveMessageBody * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.MsgRowOpaqueData; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.InteractiveMessageBody; /** - * Verifies a MsgRowOpaqueData message. + * Verifies an InteractiveMessageBody message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a MsgRowOpaqueData message from a plain object. Also converts values to their respective internal types. + * Creates an InteractiveMessageBody message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns MsgRowOpaqueData + * @returns InteractiveMessageBody */ - public static fromObject(object: { [k: string]: any }): proto.MsgRowOpaqueData; + public static fromObject(object: { [k: string]: any }): proto.InteractiveMessageBody; /** - * Creates a plain object from a MsgRowOpaqueData message. Also converts values to other types if specified. - * @param message MsgRowOpaqueData + * Creates a plain object from an InteractiveMessageBody message. Also converts values to other types if specified. + * @param message InteractiveMessageBody * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: proto.MsgRowOpaqueData, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: proto.InteractiveMessageBody, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this MsgRowOpaqueData to JSON. + * Converts this InteractiveMessageBody to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a GlobalSettings. */ - interface IGlobalSettings { + /** Properties of an InteractiveResponseMessage. */ + interface IInteractiveResponseMessage { - /** GlobalSettings lightThemeWallpaper */ - lightThemeWallpaper?: (proto.IWallpaperSettings|null); + /** InteractiveResponseMessage body */ + body?: (proto.IInteractiveResponseMessageBody|null); - /** GlobalSettings mediaVisibility */ - mediaVisibility?: (proto.MediaVisibility|null); + /** InteractiveResponseMessage contextInfo */ + contextInfo?: (proto.IContextInfo|null); - /** GlobalSettings darkThemeWallpaper */ - darkThemeWallpaper?: (proto.IWallpaperSettings|null); + /** InteractiveResponseMessage nativeFlowResponseMessage */ + nativeFlowResponseMessage?: (proto.INativeFlowResponseMessage|null); } - /** Represents a GlobalSettings. */ - class GlobalSettings implements IGlobalSettings { + /** Represents an InteractiveResponseMessage. */ + class InteractiveResponseMessage implements IInteractiveResponseMessage { /** - * Constructs a new GlobalSettings. + * Constructs a new InteractiveResponseMessage. * @param [properties] Properties to set */ - constructor(properties?: proto.IGlobalSettings); + constructor(properties?: proto.IInteractiveResponseMessage); - /** GlobalSettings lightThemeWallpaper. */ - public lightThemeWallpaper?: (proto.IWallpaperSettings|null); + /** InteractiveResponseMessage body. */ + public body?: (proto.IInteractiveResponseMessageBody|null); - /** GlobalSettings mediaVisibility. */ - public mediaVisibility: proto.MediaVisibility; + /** InteractiveResponseMessage contextInfo. */ + public contextInfo?: (proto.IContextInfo|null); - /** GlobalSettings darkThemeWallpaper. */ - public darkThemeWallpaper?: (proto.IWallpaperSettings|null); + /** InteractiveResponseMessage nativeFlowResponseMessage. */ + public nativeFlowResponseMessage?: (proto.INativeFlowResponseMessage|null); + + /** InteractiveResponseMessage interactiveResponseMessage. */ + public interactiveResponseMessage?: "nativeFlowResponseMessage"; /** - * Creates a new GlobalSettings instance using the specified properties. + * Creates a new InteractiveResponseMessage instance using the specified properties. * @param [properties] Properties to set - * @returns GlobalSettings instance + * @returns InteractiveResponseMessage instance */ - public static create(properties?: proto.IGlobalSettings): proto.GlobalSettings; + public static create(properties?: proto.IInteractiveResponseMessage): proto.InteractiveResponseMessage; /** - * Encodes the specified GlobalSettings message. Does not implicitly {@link proto.GlobalSettings.verify|verify} messages. - * @param message GlobalSettings message or plain object to encode + * Encodes the specified InteractiveResponseMessage message. Does not implicitly {@link proto.InteractiveResponseMessage.verify|verify} messages. + * @param message InteractiveResponseMessage message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: proto.IGlobalSettings, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: proto.IInteractiveResponseMessage, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified GlobalSettings message, length delimited. Does not implicitly {@link proto.GlobalSettings.verify|verify} messages. - * @param message GlobalSettings message or plain object to encode + * Encodes the specified InteractiveResponseMessage message, length delimited. Does not implicitly {@link proto.InteractiveResponseMessage.verify|verify} messages. + * @param message InteractiveResponseMessage message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: proto.IGlobalSettings, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: proto.IInteractiveResponseMessage, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a GlobalSettings message from the specified reader or buffer. + * Decodes an InteractiveResponseMessage message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns GlobalSettings + * @returns InteractiveResponseMessage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.GlobalSettings; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.InteractiveResponseMessage; /** - * Decodes a GlobalSettings message from the specified reader or buffer, length delimited. + * Decodes an InteractiveResponseMessage message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns GlobalSettings + * @returns InteractiveResponseMessage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.GlobalSettings; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.InteractiveResponseMessage; /** - * Verifies a GlobalSettings message. + * Verifies an InteractiveResponseMessage message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a GlobalSettings message from a plain object. Also converts values to their respective internal types. + * Creates an InteractiveResponseMessage message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns GlobalSettings + * @returns InteractiveResponseMessage */ - public static fromObject(object: { [k: string]: any }): proto.GlobalSettings; + public static fromObject(object: { [k: string]: any }): proto.InteractiveResponseMessage; /** - * Creates a plain object from a GlobalSettings message. Also converts values to other types if specified. - * @param message GlobalSettings + * Creates a plain object from an InteractiveResponseMessage message. Also converts values to other types if specified. + * @param message InteractiveResponseMessage * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: proto.GlobalSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: proto.InteractiveResponseMessage, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this GlobalSettings to JSON. + * Converts this InteractiveResponseMessage to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a WallpaperSettings. */ - interface IWallpaperSettings { - - /** WallpaperSettings filename */ - filename?: (string|null); + /** Properties of an InteractiveResponseMessageBody. */ + interface IInteractiveResponseMessageBody { - /** WallpaperSettings opacity */ - opacity?: (number|null); + /** InteractiveResponseMessageBody text */ + text?: (string|null); } - /** Represents a WallpaperSettings. */ - class WallpaperSettings implements IWallpaperSettings { + /** Represents an InteractiveResponseMessageBody. */ + class InteractiveResponseMessageBody implements IInteractiveResponseMessageBody { /** - * Constructs a new WallpaperSettings. + * Constructs a new InteractiveResponseMessageBody. * @param [properties] Properties to set */ - constructor(properties?: proto.IWallpaperSettings); - - /** WallpaperSettings filename. */ - public filename: string; + constructor(properties?: proto.IInteractiveResponseMessageBody); - /** WallpaperSettings opacity. */ - public opacity: number; + /** InteractiveResponseMessageBody text. */ + public text: string; /** - * Creates a new WallpaperSettings instance using the specified properties. + * Creates a new InteractiveResponseMessageBody instance using the specified properties. * @param [properties] Properties to set - * @returns WallpaperSettings instance + * @returns InteractiveResponseMessageBody instance */ - public static create(properties?: proto.IWallpaperSettings): proto.WallpaperSettings; + public static create(properties?: proto.IInteractiveResponseMessageBody): proto.InteractiveResponseMessageBody; /** - * Encodes the specified WallpaperSettings message. Does not implicitly {@link proto.WallpaperSettings.verify|verify} messages. - * @param message WallpaperSettings message or plain object to encode + * Encodes the specified InteractiveResponseMessageBody message. Does not implicitly {@link proto.InteractiveResponseMessageBody.verify|verify} messages. + * @param message InteractiveResponseMessageBody message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: proto.IWallpaperSettings, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: proto.IInteractiveResponseMessageBody, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified WallpaperSettings message, length delimited. Does not implicitly {@link proto.WallpaperSettings.verify|verify} messages. - * @param message WallpaperSettings message or plain object to encode + * Encodes the specified InteractiveResponseMessageBody message, length delimited. Does not implicitly {@link proto.InteractiveResponseMessageBody.verify|verify} messages. + * @param message InteractiveResponseMessageBody message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: proto.IWallpaperSettings, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: proto.IInteractiveResponseMessageBody, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a WallpaperSettings message from the specified reader or buffer. + * Decodes an InteractiveResponseMessageBody message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns WallpaperSettings + * @returns InteractiveResponseMessageBody * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.WallpaperSettings; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.InteractiveResponseMessageBody; /** - * Decodes a WallpaperSettings message from the specified reader or buffer, length delimited. + * Decodes an InteractiveResponseMessageBody message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns WallpaperSettings + * @returns InteractiveResponseMessageBody * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.WallpaperSettings; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.InteractiveResponseMessageBody; /** - * Verifies a WallpaperSettings message. + * Verifies an InteractiveResponseMessageBody message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a WallpaperSettings message from a plain object. Also converts values to their respective internal types. + * Creates an InteractiveResponseMessageBody message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns WallpaperSettings + * @returns InteractiveResponseMessageBody */ - public static fromObject(object: { [k: string]: any }): proto.WallpaperSettings; + public static fromObject(object: { [k: string]: any }): proto.InteractiveResponseMessageBody; /** - * Creates a plain object from a WallpaperSettings message. Also converts values to other types if specified. - * @param message WallpaperSettings + * Creates a plain object from an InteractiveResponseMessageBody message. Also converts values to other types if specified. + * @param message InteractiveResponseMessageBody * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: proto.WallpaperSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: proto.InteractiveResponseMessageBody, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this WallpaperSettings to JSON. + * Converts this InteractiveResponseMessageBody to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a GroupParticipant. */ - interface IGroupParticipant { + /** Properties of an InvoiceMessage. */ + interface IInvoiceMessage { - /** GroupParticipant userJid */ - userJid: string; + /** InvoiceMessage note */ + note?: (string|null); - /** GroupParticipant rank */ - rank?: (proto.GroupParticipant.GroupParticipantRank|null); + /** InvoiceMessage token */ + token?: (string|null); + + /** InvoiceMessage attachmentType */ + attachmentType?: (proto.InvoiceMessage.InvoiceMessageAttachmentType|null); + + /** InvoiceMessage attachmentMimetype */ + attachmentMimetype?: (string|null); + + /** InvoiceMessage attachmentMediaKey */ + attachmentMediaKey?: (Uint8Array|null); + + /** InvoiceMessage attachmentMediaKeyTimestamp */ + attachmentMediaKeyTimestamp?: (number|Long|null); + + /** InvoiceMessage attachmentFileSha256 */ + attachmentFileSha256?: (Uint8Array|null); + + /** InvoiceMessage attachmentFileEncSha256 */ + attachmentFileEncSha256?: (Uint8Array|null); + + /** InvoiceMessage attachmentDirectPath */ + attachmentDirectPath?: (string|null); + + /** InvoiceMessage attachmentJpegThumbnail */ + attachmentJpegThumbnail?: (Uint8Array|null); } - /** Represents a GroupParticipant. */ - class GroupParticipant implements IGroupParticipant { + /** Represents an InvoiceMessage. */ + class InvoiceMessage implements IInvoiceMessage { /** - * Constructs a new GroupParticipant. + * Constructs a new InvoiceMessage. * @param [properties] Properties to set */ - constructor(properties?: proto.IGroupParticipant); + constructor(properties?: proto.IInvoiceMessage); - /** GroupParticipant userJid. */ - public userJid: string; + /** InvoiceMessage note. */ + public note: string; - /** GroupParticipant rank. */ - public rank: proto.GroupParticipant.GroupParticipantRank; + /** InvoiceMessage token. */ + public token: string; + + /** InvoiceMessage attachmentType. */ + public attachmentType: proto.InvoiceMessage.InvoiceMessageAttachmentType; + + /** InvoiceMessage attachmentMimetype. */ + public attachmentMimetype: string; + + /** InvoiceMessage attachmentMediaKey. */ + public attachmentMediaKey: Uint8Array; + + /** InvoiceMessage attachmentMediaKeyTimestamp. */ + public attachmentMediaKeyTimestamp: (number|Long); + + /** InvoiceMessage attachmentFileSha256. */ + public attachmentFileSha256: Uint8Array; + + /** InvoiceMessage attachmentFileEncSha256. */ + public attachmentFileEncSha256: Uint8Array; + + /** InvoiceMessage attachmentDirectPath. */ + public attachmentDirectPath: string; + + /** InvoiceMessage attachmentJpegThumbnail. */ + public attachmentJpegThumbnail: Uint8Array; /** - * Creates a new GroupParticipant instance using the specified properties. + * Creates a new InvoiceMessage instance using the specified properties. * @param [properties] Properties to set - * @returns GroupParticipant instance + * @returns InvoiceMessage instance */ - public static create(properties?: proto.IGroupParticipant): proto.GroupParticipant; + public static create(properties?: proto.IInvoiceMessage): proto.InvoiceMessage; /** - * Encodes the specified GroupParticipant message. Does not implicitly {@link proto.GroupParticipant.verify|verify} messages. - * @param message GroupParticipant message or plain object to encode + * Encodes the specified InvoiceMessage message. Does not implicitly {@link proto.InvoiceMessage.verify|verify} messages. + * @param message InvoiceMessage message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: proto.IGroupParticipant, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: proto.IInvoiceMessage, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified GroupParticipant message, length delimited. Does not implicitly {@link proto.GroupParticipant.verify|verify} messages. - * @param message GroupParticipant message or plain object to encode + * Encodes the specified InvoiceMessage message, length delimited. Does not implicitly {@link proto.InvoiceMessage.verify|verify} messages. + * @param message InvoiceMessage message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: proto.IGroupParticipant, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: proto.IInvoiceMessage, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a GroupParticipant message from the specified reader or buffer. + * Decodes an InvoiceMessage message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns GroupParticipant + * @returns InvoiceMessage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.GroupParticipant; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.InvoiceMessage; /** - * Decodes a GroupParticipant message from the specified reader or buffer, length delimited. + * Decodes an InvoiceMessage message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns GroupParticipant + * @returns InvoiceMessage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.GroupParticipant; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.InvoiceMessage; /** - * Verifies a GroupParticipant message. + * Verifies an InvoiceMessage message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a GroupParticipant message from a plain object. Also converts values to their respective internal types. + * Creates an InvoiceMessage message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns GroupParticipant + * @returns InvoiceMessage */ - public static fromObject(object: { [k: string]: any }): proto.GroupParticipant; + public static fromObject(object: { [k: string]: any }): proto.InvoiceMessage; /** - * Creates a plain object from a GroupParticipant message. Also converts values to other types if specified. - * @param message GroupParticipant + * Creates a plain object from an InvoiceMessage message. Also converts values to other types if specified. + * @param message InvoiceMessage * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: proto.GroupParticipant, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: proto.InvoiceMessage, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this GroupParticipant to JSON. + * Converts this InvoiceMessage to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - namespace GroupParticipant { + namespace InvoiceMessage { - /** GroupParticipantRank enum. */ - enum GroupParticipantRank { - REGULAR = 0, - ADMIN = 1, - SUPERADMIN = 2 + /** InvoiceMessageAttachmentType enum. */ + enum InvoiceMessageAttachmentType { + IMAGE = 0, + PDF = 1 } } - /** Properties of a Pushname. */ - interface IPushname { + /** Properties of a ListMessage. */ + interface IListMessage { - /** Pushname id */ - id?: (string|null); + /** ListMessage title */ + title?: (string|null); - /** Pushname pushname */ - pushname?: (string|null); - } + /** ListMessage description */ + description?: (string|null); - /** Represents a Pushname. */ - class Pushname implements IPushname { + /** ListMessage buttonText */ + buttonText?: (string|null); + + /** ListMessage listType */ + listType?: (proto.ListMessage.ListMessageListType|null); + + /** ListMessage sections */ + sections?: (proto.ISection[]|null); + + /** ListMessage productListInfo */ + productListInfo?: (proto.IProductListInfo|null); + + /** ListMessage footerText */ + footerText?: (string|null); + + /** ListMessage contextInfo */ + contextInfo?: (proto.IContextInfo|null); + } + + /** Represents a ListMessage. */ + class ListMessage implements IListMessage { /** - * Constructs a new Pushname. + * Constructs a new ListMessage. * @param [properties] Properties to set */ - constructor(properties?: proto.IPushname); + constructor(properties?: proto.IListMessage); - /** Pushname id. */ - public id: string; + /** ListMessage title. */ + public title: string; - /** Pushname pushname. */ - public pushname: string; + /** ListMessage description. */ + public description: string; + + /** ListMessage buttonText. */ + public buttonText: string; + + /** ListMessage listType. */ + public listType: proto.ListMessage.ListMessageListType; + + /** ListMessage sections. */ + public sections: proto.ISection[]; + + /** ListMessage productListInfo. */ + public productListInfo?: (proto.IProductListInfo|null); + + /** ListMessage footerText. */ + public footerText: string; + + /** ListMessage contextInfo. */ + public contextInfo?: (proto.IContextInfo|null); /** - * Creates a new Pushname instance using the specified properties. + * Creates a new ListMessage instance using the specified properties. * @param [properties] Properties to set - * @returns Pushname instance + * @returns ListMessage instance */ - public static create(properties?: proto.IPushname): proto.Pushname; + public static create(properties?: proto.IListMessage): proto.ListMessage; /** - * Encodes the specified Pushname message. Does not implicitly {@link proto.Pushname.verify|verify} messages. - * @param message Pushname message or plain object to encode + * Encodes the specified ListMessage message. Does not implicitly {@link proto.ListMessage.verify|verify} messages. + * @param message ListMessage message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: proto.IPushname, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: proto.IListMessage, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified Pushname message, length delimited. Does not implicitly {@link proto.Pushname.verify|verify} messages. - * @param message Pushname message or plain object to encode + * Encodes the specified ListMessage message, length delimited. Does not implicitly {@link proto.ListMessage.verify|verify} messages. + * @param message ListMessage message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: proto.IPushname, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: proto.IListMessage, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a Pushname message from the specified reader or buffer. + * Decodes a ListMessage message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns Pushname + * @returns ListMessage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.Pushname; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.ListMessage; /** - * Decodes a Pushname message from the specified reader or buffer, length delimited. + * Decodes a ListMessage message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Pushname + * @returns ListMessage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.Pushname; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.ListMessage; /** - * Verifies a Pushname message. + * Verifies a ListMessage message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a Pushname message from a plain object. Also converts values to their respective internal types. + * Creates a ListMessage message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Pushname + * @returns ListMessage */ - public static fromObject(object: { [k: string]: any }): proto.Pushname; + public static fromObject(object: { [k: string]: any }): proto.ListMessage; /** - * Creates a plain object from a Pushname message. Also converts values to other types if specified. - * @param message Pushname + * Creates a plain object from a ListMessage message. Also converts values to other types if specified. + * @param message ListMessage * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: proto.Pushname, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: proto.ListMessage, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Pushname to JSON. + * Converts this ListMessage to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a HistorySyncMsg. */ - interface IHistorySyncMsg { + namespace ListMessage { - /** HistorySyncMsg message */ - message?: (proto.IWebMessageInfo|null); + /** ListMessageListType enum. */ + enum ListMessageListType { + UNKNOWN = 0, + SINGLE_SELECT = 1, + PRODUCT_LIST = 2 + } + } - /** HistorySyncMsg msgOrderId */ - msgOrderId?: (number|Long|null); + /** Properties of a ListResponseMessage. */ + interface IListResponseMessage { + + /** ListResponseMessage title */ + title?: (string|null); + + /** ListResponseMessage listType */ + listType?: (proto.ListResponseMessage.ListResponseMessageListType|null); + + /** ListResponseMessage singleSelectReply */ + singleSelectReply?: (proto.ISingleSelectReply|null); + + /** ListResponseMessage contextInfo */ + contextInfo?: (proto.IContextInfo|null); + + /** ListResponseMessage description */ + description?: (string|null); } - /** Represents a HistorySyncMsg. */ - class HistorySyncMsg implements IHistorySyncMsg { + /** Represents a ListResponseMessage. */ + class ListResponseMessage implements IListResponseMessage { /** - * Constructs a new HistorySyncMsg. + * Constructs a new ListResponseMessage. * @param [properties] Properties to set */ - constructor(properties?: proto.IHistorySyncMsg); + constructor(properties?: proto.IListResponseMessage); - /** HistorySyncMsg message. */ - public message?: (proto.IWebMessageInfo|null); + /** ListResponseMessage title. */ + public title: string; - /** HistorySyncMsg msgOrderId. */ - public msgOrderId: (number|Long); + /** ListResponseMessage listType. */ + public listType: proto.ListResponseMessage.ListResponseMessageListType; + + /** ListResponseMessage singleSelectReply. */ + public singleSelectReply?: (proto.ISingleSelectReply|null); + + /** ListResponseMessage contextInfo. */ + public contextInfo?: (proto.IContextInfo|null); + + /** ListResponseMessage description. */ + public description: string; /** - * Creates a new HistorySyncMsg instance using the specified properties. + * Creates a new ListResponseMessage instance using the specified properties. * @param [properties] Properties to set - * @returns HistorySyncMsg instance + * @returns ListResponseMessage instance */ - public static create(properties?: proto.IHistorySyncMsg): proto.HistorySyncMsg; + public static create(properties?: proto.IListResponseMessage): proto.ListResponseMessage; /** - * Encodes the specified HistorySyncMsg message. Does not implicitly {@link proto.HistorySyncMsg.verify|verify} messages. - * @param message HistorySyncMsg message or plain object to encode + * Encodes the specified ListResponseMessage message. Does not implicitly {@link proto.ListResponseMessage.verify|verify} messages. + * @param message ListResponseMessage message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: proto.IHistorySyncMsg, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: proto.IListResponseMessage, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified HistorySyncMsg message, length delimited. Does not implicitly {@link proto.HistorySyncMsg.verify|verify} messages. - * @param message HistorySyncMsg message or plain object to encode + * Encodes the specified ListResponseMessage message, length delimited. Does not implicitly {@link proto.ListResponseMessage.verify|verify} messages. + * @param message ListResponseMessage message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: proto.IHistorySyncMsg, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: proto.IListResponseMessage, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a HistorySyncMsg message from the specified reader or buffer. + * Decodes a ListResponseMessage message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns HistorySyncMsg + * @returns ListResponseMessage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.HistorySyncMsg; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.ListResponseMessage; /** - * Decodes a HistorySyncMsg message from the specified reader or buffer, length delimited. + * Decodes a ListResponseMessage message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns HistorySyncMsg + * @returns ListResponseMessage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.HistorySyncMsg; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.ListResponseMessage; /** - * Verifies a HistorySyncMsg message. + * Verifies a ListResponseMessage message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a HistorySyncMsg message from a plain object. Also converts values to their respective internal types. + * Creates a ListResponseMessage message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns HistorySyncMsg + * @returns ListResponseMessage */ - public static fromObject(object: { [k: string]: any }): proto.HistorySyncMsg; + public static fromObject(object: { [k: string]: any }): proto.ListResponseMessage; /** - * Creates a plain object from a HistorySyncMsg message. Also converts values to other types if specified. - * @param message HistorySyncMsg + * Creates a plain object from a ListResponseMessage message. Also converts values to other types if specified. + * @param message ListResponseMessage * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: proto.HistorySyncMsg, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: proto.ListResponseMessage, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this HistorySyncMsg to JSON. + * Converts this ListResponseMessage to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a Conversation. */ - interface IConversation { + namespace ListResponseMessage { - /** Conversation id */ - id: string; + /** ListResponseMessageListType enum. */ + enum ListResponseMessageListType { + UNKNOWN = 0, + SINGLE_SELECT = 1 + } + } - /** Conversation messages */ - messages?: (proto.IHistorySyncMsg[]|null); + /** Properties of a LiveLocationMessage. */ + interface ILiveLocationMessage { - /** Conversation newJid */ - newJid?: (string|null); + /** LiveLocationMessage degreesLatitude */ + degreesLatitude?: (number|null); - /** Conversation oldJid */ - oldJid?: (string|null); + /** LiveLocationMessage degreesLongitude */ + degreesLongitude?: (number|null); - /** Conversation lastMsgTimestamp */ - lastMsgTimestamp?: (number|Long|null); + /** LiveLocationMessage accuracyInMeters */ + accuracyInMeters?: (number|null); - /** Conversation unreadCount */ - unreadCount?: (number|null); + /** LiveLocationMessage speedInMps */ + speedInMps?: (number|null); - /** Conversation readOnly */ - readOnly?: (boolean|null); + /** LiveLocationMessage degreesClockwiseFromMagneticNorth */ + degreesClockwiseFromMagneticNorth?: (number|null); - /** Conversation endOfHistoryTransfer */ - endOfHistoryTransfer?: (boolean|null); + /** LiveLocationMessage caption */ + caption?: (string|null); - /** Conversation ephemeralExpiration */ - ephemeralExpiration?: (number|null); + /** LiveLocationMessage sequenceNumber */ + sequenceNumber?: (number|Long|null); - /** Conversation ephemeralSettingTimestamp */ - ephemeralSettingTimestamp?: (number|Long|null); + /** LiveLocationMessage timeOffset */ + timeOffset?: (number|null); - /** Conversation endOfHistoryTransferType */ - endOfHistoryTransferType?: (proto.Conversation.ConversationEndOfHistoryTransferType|null); + /** LiveLocationMessage jpegThumbnail */ + jpegThumbnail?: (Uint8Array|null); - /** Conversation conversationTimestamp */ - conversationTimestamp?: (number|Long|null); - - /** Conversation name */ - name?: (string|null); - - /** Conversation pHash */ - pHash?: (string|null); - - /** Conversation notSpam */ - notSpam?: (boolean|null); - - /** Conversation archived */ - archived?: (boolean|null); - - /** Conversation disappearingMode */ - disappearingMode?: (proto.IDisappearingMode|null); - - /** Conversation unreadMentionCount */ - unreadMentionCount?: (number|null); - - /** Conversation markedAsUnread */ - markedAsUnread?: (boolean|null); - - /** Conversation participant */ - participant?: (proto.IGroupParticipant[]|null); - - /** Conversation tcToken */ - tcToken?: (Uint8Array|null); - - /** Conversation tcTokenTimestamp */ - tcTokenTimestamp?: (number|Long|null); - - /** Conversation contactPrimaryIdentityKey */ - contactPrimaryIdentityKey?: (Uint8Array|null); - - /** Conversation pinned */ - pinned?: (number|null); - - /** Conversation muteEndTime */ - muteEndTime?: (number|Long|null); - - /** Conversation wallpaper */ - wallpaper?: (proto.IWallpaperSettings|null); - - /** Conversation mediaVisibility */ - mediaVisibility?: (proto.MediaVisibility|null); - - /** Conversation tcTokenSenderTimestamp */ - tcTokenSenderTimestamp?: (number|Long|null); - - /** Conversation suspended */ - suspended?: (boolean|null); + /** LiveLocationMessage contextInfo */ + contextInfo?: (proto.IContextInfo|null); } - /** Represents a Conversation. */ - class Conversation implements IConversation { + /** Represents a LiveLocationMessage. */ + class LiveLocationMessage implements ILiveLocationMessage { /** - * Constructs a new Conversation. + * Constructs a new LiveLocationMessage. * @param [properties] Properties to set */ - constructor(properties?: proto.IConversation); - - /** Conversation id. */ - public id: string; - - /** Conversation messages. */ - public messages: proto.IHistorySyncMsg[]; - - /** Conversation newJid. */ - public newJid: string; - - /** Conversation oldJid. */ - public oldJid: string; - - /** Conversation lastMsgTimestamp. */ - public lastMsgTimestamp: (number|Long); - - /** Conversation unreadCount. */ - public unreadCount: number; - - /** Conversation readOnly. */ - public readOnly: boolean; - - /** Conversation endOfHistoryTransfer. */ - public endOfHistoryTransfer: boolean; - - /** Conversation ephemeralExpiration. */ - public ephemeralExpiration: number; - - /** Conversation ephemeralSettingTimestamp. */ - public ephemeralSettingTimestamp: (number|Long); - - /** Conversation endOfHistoryTransferType. */ - public endOfHistoryTransferType: proto.Conversation.ConversationEndOfHistoryTransferType; - - /** Conversation conversationTimestamp. */ - public conversationTimestamp: (number|Long); - - /** Conversation name. */ - public name: string; - - /** Conversation pHash. */ - public pHash: string; - - /** Conversation notSpam. */ - public notSpam: boolean; - - /** Conversation archived. */ - public archived: boolean; - - /** Conversation disappearingMode. */ - public disappearingMode?: (proto.IDisappearingMode|null); - - /** Conversation unreadMentionCount. */ - public unreadMentionCount: number; - - /** Conversation markedAsUnread. */ - public markedAsUnread: boolean; + constructor(properties?: proto.ILiveLocationMessage); - /** Conversation participant. */ - public participant: proto.IGroupParticipant[]; + /** LiveLocationMessage degreesLatitude. */ + public degreesLatitude: number; - /** Conversation tcToken. */ - public tcToken: Uint8Array; + /** LiveLocationMessage degreesLongitude. */ + public degreesLongitude: number; - /** Conversation tcTokenTimestamp. */ - public tcTokenTimestamp: (number|Long); + /** LiveLocationMessage accuracyInMeters. */ + public accuracyInMeters: number; - /** Conversation contactPrimaryIdentityKey. */ - public contactPrimaryIdentityKey: Uint8Array; + /** LiveLocationMessage speedInMps. */ + public speedInMps: number; - /** Conversation pinned. */ - public pinned: number; + /** LiveLocationMessage degreesClockwiseFromMagneticNorth. */ + public degreesClockwiseFromMagneticNorth: number; - /** Conversation muteEndTime. */ - public muteEndTime: (number|Long); + /** LiveLocationMessage caption. */ + public caption: string; - /** Conversation wallpaper. */ - public wallpaper?: (proto.IWallpaperSettings|null); + /** LiveLocationMessage sequenceNumber. */ + public sequenceNumber: (number|Long); - /** Conversation mediaVisibility. */ - public mediaVisibility: proto.MediaVisibility; + /** LiveLocationMessage timeOffset. */ + public timeOffset: number; - /** Conversation tcTokenSenderTimestamp. */ - public tcTokenSenderTimestamp: (number|Long); + /** LiveLocationMessage jpegThumbnail. */ + public jpegThumbnail: Uint8Array; - /** Conversation suspended. */ - public suspended: boolean; + /** LiveLocationMessage contextInfo. */ + public contextInfo?: (proto.IContextInfo|null); /** - * Creates a new Conversation instance using the specified properties. + * Creates a new LiveLocationMessage instance using the specified properties. * @param [properties] Properties to set - * @returns Conversation instance + * @returns LiveLocationMessage instance */ - public static create(properties?: proto.IConversation): proto.Conversation; + public static create(properties?: proto.ILiveLocationMessage): proto.LiveLocationMessage; /** - * Encodes the specified Conversation message. Does not implicitly {@link proto.Conversation.verify|verify} messages. - * @param message Conversation message or plain object to encode + * Encodes the specified LiveLocationMessage message. Does not implicitly {@link proto.LiveLocationMessage.verify|verify} messages. + * @param message LiveLocationMessage message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: proto.IConversation, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: proto.ILiveLocationMessage, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified Conversation message, length delimited. Does not implicitly {@link proto.Conversation.verify|verify} messages. - * @param message Conversation message or plain object to encode + * Encodes the specified LiveLocationMessage message, length delimited. Does not implicitly {@link proto.LiveLocationMessage.verify|verify} messages. + * @param message LiveLocationMessage message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: proto.IConversation, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: proto.ILiveLocationMessage, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a Conversation message from the specified reader or buffer. + * Decodes a LiveLocationMessage message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns Conversation + * @returns LiveLocationMessage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.Conversation; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.LiveLocationMessage; /** - * Decodes a Conversation message from the specified reader or buffer, length delimited. + * Decodes a LiveLocationMessage message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Conversation + * @returns LiveLocationMessage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.Conversation; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.LiveLocationMessage; /** - * Verifies a Conversation message. + * Verifies a LiveLocationMessage message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a Conversation message from a plain object. Also converts values to their respective internal types. + * Creates a LiveLocationMessage message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Conversation + * @returns LiveLocationMessage */ - public static fromObject(object: { [k: string]: any }): proto.Conversation; + public static fromObject(object: { [k: string]: any }): proto.LiveLocationMessage; /** - * Creates a plain object from a Conversation message. Also converts values to other types if specified. - * @param message Conversation + * Creates a plain object from a LiveLocationMessage message. Also converts values to other types if specified. + * @param message LiveLocationMessage * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: proto.Conversation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: proto.LiveLocationMessage, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Conversation to JSON. + * Converts this LiveLocationMessage to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - namespace Conversation { - - /** ConversationEndOfHistoryTransferType enum. */ - enum ConversationEndOfHistoryTransferType { - COMPLETE_BUT_MORE_MESSAGES_REMAIN_ON_PRIMARY = 0, - COMPLETE_AND_NO_MORE_MESSAGE_REMAIN_ON_PRIMARY = 1 - } - } - - /** Properties of a HistorySync. */ - interface IHistorySync { - - /** HistorySync syncType */ - syncType: proto.HistorySync.HistorySyncHistorySyncType; - - /** HistorySync conversations */ - conversations?: (proto.IConversation[]|null); - - /** HistorySync statusV3Messages */ - statusV3Messages?: (proto.IWebMessageInfo[]|null); - - /** HistorySync chunkOrder */ - chunkOrder?: (number|null); - - /** HistorySync progress */ - progress?: (number|null); - - /** HistorySync pushnames */ - pushnames?: (proto.IPushname[]|null); + /** Properties of a Location. */ + interface ILocation { - /** HistorySync globalSettings */ - globalSettings?: (proto.IGlobalSettings|null); + /** Location degreesLatitude */ + degreesLatitude?: (number|null); - /** HistorySync threadIdUserSecret */ - threadIdUserSecret?: (Uint8Array|null); + /** Location degreesLongitude */ + degreesLongitude?: (number|null); - /** HistorySync threadDsTimeframeOffset */ - threadDsTimeframeOffset?: (number|null); + /** Location name */ + name?: (string|null); } - /** Represents a HistorySync. */ - class HistorySync implements IHistorySync { + /** Represents a Location. */ + class Location implements ILocation { /** - * Constructs a new HistorySync. + * Constructs a new Location. * @param [properties] Properties to set */ - constructor(properties?: proto.IHistorySync); + constructor(properties?: proto.ILocation); - /** HistorySync syncType. */ - public syncType: proto.HistorySync.HistorySyncHistorySyncType; - - /** HistorySync conversations. */ - public conversations: proto.IConversation[]; - - /** HistorySync statusV3Messages. */ - public statusV3Messages: proto.IWebMessageInfo[]; - - /** HistorySync chunkOrder. */ - public chunkOrder: number; - - /** HistorySync progress. */ - public progress: number; - - /** HistorySync pushnames. */ - public pushnames: proto.IPushname[]; - - /** HistorySync globalSettings. */ - public globalSettings?: (proto.IGlobalSettings|null); + /** Location degreesLatitude. */ + public degreesLatitude: number; - /** HistorySync threadIdUserSecret. */ - public threadIdUserSecret: Uint8Array; + /** Location degreesLongitude. */ + public degreesLongitude: number; - /** HistorySync threadDsTimeframeOffset. */ - public threadDsTimeframeOffset: number; + /** Location name. */ + public name: string; /** - * Creates a new HistorySync instance using the specified properties. + * Creates a new Location instance using the specified properties. * @param [properties] Properties to set - * @returns HistorySync instance + * @returns Location instance */ - public static create(properties?: proto.IHistorySync): proto.HistorySync; + public static create(properties?: proto.ILocation): proto.Location; /** - * Encodes the specified HistorySync message. Does not implicitly {@link proto.HistorySync.verify|verify} messages. - * @param message HistorySync message or plain object to encode + * Encodes the specified Location message. Does not implicitly {@link proto.Location.verify|verify} messages. + * @param message Location message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: proto.IHistorySync, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: proto.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified HistorySync message, length delimited. Does not implicitly {@link proto.HistorySync.verify|verify} messages. - * @param message HistorySync message or plain object to encode + * Encodes the specified Location message, length delimited. Does not implicitly {@link proto.Location.verify|verify} messages. + * @param message Location message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: proto.IHistorySync, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: proto.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a HistorySync message from the specified reader or buffer. + * Decodes a Location message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns HistorySync + * @returns Location * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.HistorySync; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.Location; /** - * Decodes a HistorySync message from the specified reader or buffer, length delimited. + * Decodes a Location message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns HistorySync + * @returns Location * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.HistorySync; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.Location; /** - * Verifies a HistorySync message. + * Verifies a Location message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a HistorySync message from a plain object. Also converts values to their respective internal types. + * Creates a Location message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns HistorySync + * @returns Location */ - public static fromObject(object: { [k: string]: any }): proto.HistorySync; + public static fromObject(object: { [k: string]: any }): proto.Location; /** - * Creates a plain object from a HistorySync message. Also converts values to other types if specified. - * @param message HistorySync + * Creates a plain object from a Location message. Also converts values to other types if specified. + * @param message Location * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: proto.HistorySync, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: proto.Location, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this HistorySync to JSON. + * Converts this Location to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - namespace HistorySync { + /** Properties of a LocationMessage. */ + interface ILocationMessage { - /** HistorySyncHistorySyncType enum. */ - enum HistorySyncHistorySyncType { - INITIAL_BOOTSTRAP = 0, - INITIAL_STATUS_V3 = 1, - FULL = 2, - RECENT = 3, - PUSH_NAME = 4 - } - } + /** LocationMessage degreesLatitude */ + degreesLatitude?: (number|null); - /** MediaVisibility enum. */ - enum MediaVisibility { - DEFAULT = 0, - OFF = 1, - ON = 2 - } + /** LocationMessage degreesLongitude */ + degreesLongitude?: (number|null); - /** Properties of an EphemeralSetting. */ - interface IEphemeralSetting { + /** LocationMessage name */ + name?: (string|null); - /** EphemeralSetting duration */ - duration?: (number|null); + /** LocationMessage address */ + address?: (string|null); - /** EphemeralSetting timestamp */ - timestamp?: (number|Long|null); + /** LocationMessage url */ + url?: (string|null); + + /** LocationMessage isLive */ + isLive?: (boolean|null); + + /** LocationMessage accuracyInMeters */ + accuracyInMeters?: (number|null); + + /** LocationMessage speedInMps */ + speedInMps?: (number|null); + + /** LocationMessage degreesClockwiseFromMagneticNorth */ + degreesClockwiseFromMagneticNorth?: (number|null); + + /** LocationMessage comment */ + comment?: (string|null); + + /** LocationMessage jpegThumbnail */ + jpegThumbnail?: (Uint8Array|null); + + /** LocationMessage contextInfo */ + contextInfo?: (proto.IContextInfo|null); } - /** Represents an EphemeralSetting. */ - class EphemeralSetting implements IEphemeralSetting { + /** Represents a LocationMessage. */ + class LocationMessage implements ILocationMessage { /** - * Constructs a new EphemeralSetting. + * Constructs a new LocationMessage. * @param [properties] Properties to set */ - constructor(properties?: proto.IEphemeralSetting); + constructor(properties?: proto.ILocationMessage); - /** EphemeralSetting duration. */ - public duration: number; + /** LocationMessage degreesLatitude. */ + public degreesLatitude: number; - /** EphemeralSetting timestamp. */ - public timestamp: (number|Long); + /** LocationMessage degreesLongitude. */ + public degreesLongitude: number; + + /** LocationMessage name. */ + public name: string; + + /** LocationMessage address. */ + public address: string; + + /** LocationMessage url. */ + public url: string; + + /** LocationMessage isLive. */ + public isLive: boolean; + + /** LocationMessage accuracyInMeters. */ + public accuracyInMeters: number; + + /** LocationMessage speedInMps. */ + public speedInMps: number; + + /** LocationMessage degreesClockwiseFromMagneticNorth. */ + public degreesClockwiseFromMagneticNorth: number; + + /** LocationMessage comment. */ + public comment: string; + + /** LocationMessage jpegThumbnail. */ + public jpegThumbnail: Uint8Array; + + /** LocationMessage contextInfo. */ + public contextInfo?: (proto.IContextInfo|null); /** - * Creates a new EphemeralSetting instance using the specified properties. + * Creates a new LocationMessage instance using the specified properties. * @param [properties] Properties to set - * @returns EphemeralSetting instance + * @returns LocationMessage instance */ - public static create(properties?: proto.IEphemeralSetting): proto.EphemeralSetting; + public static create(properties?: proto.ILocationMessage): proto.LocationMessage; /** - * Encodes the specified EphemeralSetting message. Does not implicitly {@link proto.EphemeralSetting.verify|verify} messages. - * @param message EphemeralSetting message or plain object to encode + * Encodes the specified LocationMessage message. Does not implicitly {@link proto.LocationMessage.verify|verify} messages. + * @param message LocationMessage message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: proto.IEphemeralSetting, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: proto.ILocationMessage, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified EphemeralSetting message, length delimited. Does not implicitly {@link proto.EphemeralSetting.verify|verify} messages. - * @param message EphemeralSetting message or plain object to encode + * Encodes the specified LocationMessage message, length delimited. Does not implicitly {@link proto.LocationMessage.verify|verify} messages. + * @param message LocationMessage message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: proto.IEphemeralSetting, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: proto.ILocationMessage, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an EphemeralSetting message from the specified reader or buffer. + * Decodes a LocationMessage message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns EphemeralSetting + * @returns LocationMessage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.EphemeralSetting; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.LocationMessage; /** - * Decodes an EphemeralSetting message from the specified reader or buffer, length delimited. + * Decodes a LocationMessage message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns EphemeralSetting + * @returns LocationMessage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.EphemeralSetting; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.LocationMessage; /** - * Verifies an EphemeralSetting message. + * Verifies a LocationMessage message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates an EphemeralSetting message from a plain object. Also converts values to their respective internal types. + * Creates a LocationMessage message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns EphemeralSetting + * @returns LocationMessage */ - public static fromObject(object: { [k: string]: any }): proto.EphemeralSetting; + public static fromObject(object: { [k: string]: any }): proto.LocationMessage; /** - * Creates a plain object from an EphemeralSetting message. Also converts values to other types if specified. - * @param message EphemeralSetting + * Creates a plain object from a LocationMessage message. Also converts values to other types if specified. + * @param message LocationMessage * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: proto.EphemeralSetting, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: proto.LocationMessage, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this EphemeralSetting to JSON. + * Converts this LocationMessage to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of an InteractiveAnnotation. */ - interface IInteractiveAnnotation { + /** Properties of a Message. */ + interface IMessage { - /** InteractiveAnnotation polygonVertices */ - polygonVertices?: (proto.IPoint[]|null); + /** Message conversation */ + conversation?: (string|null); - /** InteractiveAnnotation location */ - location?: (proto.ILocation|null); - } + /** Message senderKeyDistributionMessage */ + senderKeyDistributionMessage?: (proto.ISenderKeyDistributionMessage|null); - /** Represents an InteractiveAnnotation. */ - class InteractiveAnnotation implements IInteractiveAnnotation { + /** Message imageMessage */ + imageMessage?: (proto.IImageMessage|null); - /** - * Constructs a new InteractiveAnnotation. - * @param [properties] Properties to set - */ - constructor(properties?: proto.IInteractiveAnnotation); + /** Message contactMessage */ + contactMessage?: (proto.IContactMessage|null); - /** InteractiveAnnotation polygonVertices. */ - public polygonVertices: proto.IPoint[]; + /** Message locationMessage */ + locationMessage?: (proto.ILocationMessage|null); - /** InteractiveAnnotation location. */ - public location?: (proto.ILocation|null); + /** Message extendedTextMessage */ + extendedTextMessage?: (proto.IExtendedTextMessage|null); - /** InteractiveAnnotation action. */ - public action?: "location"; + /** Message documentMessage */ + documentMessage?: (proto.IDocumentMessage|null); + + /** Message audioMessage */ + audioMessage?: (proto.IAudioMessage|null); + + /** Message videoMessage */ + videoMessage?: (proto.IVideoMessage|null); + + /** Message call */ + call?: (proto.ICall|null); + + /** Message chat */ + chat?: (proto.IChat|null); + + /** Message protocolMessage */ + protocolMessage?: (proto.IProtocolMessage|null); + + /** Message contactsArrayMessage */ + contactsArrayMessage?: (proto.IContactsArrayMessage|null); + + /** Message highlyStructuredMessage */ + highlyStructuredMessage?: (proto.IHighlyStructuredMessage|null); + + /** Message fastRatchetKeySenderKeyDistributionMessage */ + fastRatchetKeySenderKeyDistributionMessage?: (proto.ISenderKeyDistributionMessage|null); + + /** Message sendPaymentMessage */ + sendPaymentMessage?: (proto.ISendPaymentMessage|null); + + /** Message liveLocationMessage */ + liveLocationMessage?: (proto.ILiveLocationMessage|null); + + /** Message requestPaymentMessage */ + requestPaymentMessage?: (proto.IRequestPaymentMessage|null); + + /** Message declinePaymentRequestMessage */ + declinePaymentRequestMessage?: (proto.IDeclinePaymentRequestMessage|null); + + /** Message cancelPaymentRequestMessage */ + cancelPaymentRequestMessage?: (proto.ICancelPaymentRequestMessage|null); + + /** Message templateMessage */ + templateMessage?: (proto.ITemplateMessage|null); + + /** Message stickerMessage */ + stickerMessage?: (proto.IStickerMessage|null); + + /** Message groupInviteMessage */ + groupInviteMessage?: (proto.IGroupInviteMessage|null); + + /** Message templateButtonReplyMessage */ + templateButtonReplyMessage?: (proto.ITemplateButtonReplyMessage|null); + + /** Message productMessage */ + productMessage?: (proto.IProductMessage|null); + + /** Message deviceSentMessage */ + deviceSentMessage?: (proto.IDeviceSentMessage|null); + + /** Message messageContextInfo */ + messageContextInfo?: (proto.IMessageContextInfo|null); + + /** Message listMessage */ + listMessage?: (proto.IListMessage|null); + + /** Message viewOnceMessage */ + viewOnceMessage?: (proto.IFutureProofMessage|null); + + /** Message orderMessage */ + orderMessage?: (proto.IOrderMessage|null); + + /** Message listResponseMessage */ + listResponseMessage?: (proto.IListResponseMessage|null); + + /** Message ephemeralMessage */ + ephemeralMessage?: (proto.IFutureProofMessage|null); + + /** Message invoiceMessage */ + invoiceMessage?: (proto.IInvoiceMessage|null); + + /** Message buttonsMessage */ + buttonsMessage?: (proto.IButtonsMessage|null); + + /** Message buttonsResponseMessage */ + buttonsResponseMessage?: (proto.IButtonsResponseMessage|null); + + /** Message paymentInviteMessage */ + paymentInviteMessage?: (proto.IPaymentInviteMessage|null); + + /** Message interactiveMessage */ + interactiveMessage?: (proto.IInteractiveMessage|null); + + /** Message reactionMessage */ + reactionMessage?: (proto.IReactionMessage|null); + + /** Message stickerSyncRmrMessage */ + stickerSyncRmrMessage?: (proto.IStickerSyncRMRMessage|null); + + /** Message interactiveResponseMessage */ + interactiveResponseMessage?: (proto.IInteractiveResponseMessage|null); + + /** Message pollCreationMessage */ + pollCreationMessage?: (proto.IPollCreationMessage|null); + + /** Message pollUpdateMessage */ + pollUpdateMessage?: (proto.IPollUpdateMessage|null); + } + + /** Represents a Message. */ + class Message implements IMessage { + + /** + * Constructs a new Message. + * @param [properties] Properties to set + */ + constructor(properties?: proto.IMessage); + + /** Message conversation. */ + public conversation: string; + + /** Message senderKeyDistributionMessage. */ + public senderKeyDistributionMessage?: (proto.ISenderKeyDistributionMessage|null); + + /** Message imageMessage. */ + public imageMessage?: (proto.IImageMessage|null); + + /** Message contactMessage. */ + public contactMessage?: (proto.IContactMessage|null); + + /** Message locationMessage. */ + public locationMessage?: (proto.ILocationMessage|null); + + /** Message extendedTextMessage. */ + public extendedTextMessage?: (proto.IExtendedTextMessage|null); + + /** Message documentMessage. */ + public documentMessage?: (proto.IDocumentMessage|null); + + /** Message audioMessage. */ + public audioMessage?: (proto.IAudioMessage|null); + + /** Message videoMessage. */ + public videoMessage?: (proto.IVideoMessage|null); + + /** Message call. */ + public call?: (proto.ICall|null); + + /** Message chat. */ + public chat?: (proto.IChat|null); + + /** Message protocolMessage. */ + public protocolMessage?: (proto.IProtocolMessage|null); + + /** Message contactsArrayMessage. */ + public contactsArrayMessage?: (proto.IContactsArrayMessage|null); + + /** Message highlyStructuredMessage. */ + public highlyStructuredMessage?: (proto.IHighlyStructuredMessage|null); + + /** Message fastRatchetKeySenderKeyDistributionMessage. */ + public fastRatchetKeySenderKeyDistributionMessage?: (proto.ISenderKeyDistributionMessage|null); + + /** Message sendPaymentMessage. */ + public sendPaymentMessage?: (proto.ISendPaymentMessage|null); + + /** Message liveLocationMessage. */ + public liveLocationMessage?: (proto.ILiveLocationMessage|null); + + /** Message requestPaymentMessage. */ + public requestPaymentMessage?: (proto.IRequestPaymentMessage|null); + + /** Message declinePaymentRequestMessage. */ + public declinePaymentRequestMessage?: (proto.IDeclinePaymentRequestMessage|null); + + /** Message cancelPaymentRequestMessage. */ + public cancelPaymentRequestMessage?: (proto.ICancelPaymentRequestMessage|null); + + /** Message templateMessage. */ + public templateMessage?: (proto.ITemplateMessage|null); + + /** Message stickerMessage. */ + public stickerMessage?: (proto.IStickerMessage|null); + + /** Message groupInviteMessage. */ + public groupInviteMessage?: (proto.IGroupInviteMessage|null); + + /** Message templateButtonReplyMessage. */ + public templateButtonReplyMessage?: (proto.ITemplateButtonReplyMessage|null); + + /** Message productMessage. */ + public productMessage?: (proto.IProductMessage|null); + + /** Message deviceSentMessage. */ + public deviceSentMessage?: (proto.IDeviceSentMessage|null); + + /** Message messageContextInfo. */ + public messageContextInfo?: (proto.IMessageContextInfo|null); + + /** Message listMessage. */ + public listMessage?: (proto.IListMessage|null); + + /** Message viewOnceMessage. */ + public viewOnceMessage?: (proto.IFutureProofMessage|null); + + /** Message orderMessage. */ + public orderMessage?: (proto.IOrderMessage|null); + + /** Message listResponseMessage. */ + public listResponseMessage?: (proto.IListResponseMessage|null); + + /** Message ephemeralMessage. */ + public ephemeralMessage?: (proto.IFutureProofMessage|null); + + /** Message invoiceMessage. */ + public invoiceMessage?: (proto.IInvoiceMessage|null); + + /** Message buttonsMessage. */ + public buttonsMessage?: (proto.IButtonsMessage|null); + + /** Message buttonsResponseMessage. */ + public buttonsResponseMessage?: (proto.IButtonsResponseMessage|null); + + /** Message paymentInviteMessage. */ + public paymentInviteMessage?: (proto.IPaymentInviteMessage|null); + + /** Message interactiveMessage. */ + public interactiveMessage?: (proto.IInteractiveMessage|null); + + /** Message reactionMessage. */ + public reactionMessage?: (proto.IReactionMessage|null); + + /** Message stickerSyncRmrMessage. */ + public stickerSyncRmrMessage?: (proto.IStickerSyncRMRMessage|null); + + /** Message interactiveResponseMessage. */ + public interactiveResponseMessage?: (proto.IInteractiveResponseMessage|null); + + /** Message pollCreationMessage. */ + public pollCreationMessage?: (proto.IPollCreationMessage|null); + + /** Message pollUpdateMessage. */ + public pollUpdateMessage?: (proto.IPollUpdateMessage|null); + + /** + * Creates a new Message instance using the specified properties. + * @param [properties] Properties to set + * @returns Message instance + */ + public static create(properties?: proto.IMessage): proto.Message; + + /** + * Encodes the specified Message message. Does not implicitly {@link proto.Message.verify|verify} messages. + * @param message Message message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: proto.IMessage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Message message, length delimited. Does not implicitly {@link proto.Message.verify|verify} messages. + * @param message Message message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: proto.IMessage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Message message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Message + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.Message; + + /** + * Decodes a Message message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Message + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.Message; + + /** + * Verifies a Message message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Message message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Message + */ + public static fromObject(object: { [k: string]: any }): proto.Message; + + /** + * Creates a plain object from a Message message. Also converts values to other types if specified. + * @param message Message + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: proto.Message, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Message to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a MessageContextInfo. */ + interface IMessageContextInfo { + + /** MessageContextInfo deviceListMetadata */ + deviceListMetadata?: (proto.IDeviceListMetadata|null); + + /** MessageContextInfo deviceListMetadataVersion */ + deviceListMetadataVersion?: (number|null); + } + + /** Represents a MessageContextInfo. */ + class MessageContextInfo implements IMessageContextInfo { + + /** + * Constructs a new MessageContextInfo. + * @param [properties] Properties to set + */ + constructor(properties?: proto.IMessageContextInfo); + + /** MessageContextInfo deviceListMetadata. */ + public deviceListMetadata?: (proto.IDeviceListMetadata|null); + + /** MessageContextInfo deviceListMetadataVersion. */ + public deviceListMetadataVersion: number; + + /** + * Creates a new MessageContextInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns MessageContextInfo instance + */ + public static create(properties?: proto.IMessageContextInfo): proto.MessageContextInfo; + + /** + * Encodes the specified MessageContextInfo message. Does not implicitly {@link proto.MessageContextInfo.verify|verify} messages. + * @param message MessageContextInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: proto.IMessageContextInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MessageContextInfo message, length delimited. Does not implicitly {@link proto.MessageContextInfo.verify|verify} messages. + * @param message MessageContextInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: proto.IMessageContextInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MessageContextInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MessageContextInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.MessageContextInfo; + + /** + * Decodes a MessageContextInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MessageContextInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.MessageContextInfo; + + /** + * Verifies a MessageContextInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MessageContextInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MessageContextInfo + */ + public static fromObject(object: { [k: string]: any }): proto.MessageContextInfo; + + /** + * Creates a plain object from a MessageContextInfo message. Also converts values to other types if specified. + * @param message MessageContextInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: proto.MessageContextInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MessageContextInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a Money. */ + interface IMoney { + + /** Money value */ + value?: (number|Long|null); + + /** Money offset */ + offset?: (number|null); + + /** Money currencyCode */ + currencyCode?: (string|null); + } + + /** Represents a Money. */ + class Money implements IMoney { + + /** + * Constructs a new Money. + * @param [properties] Properties to set + */ + constructor(properties?: proto.IMoney); + + /** Money value. */ + public value: (number|Long); + + /** Money offset. */ + public offset: number; + + /** Money currencyCode. */ + public currencyCode: string; + + /** + * Creates a new Money instance using the specified properties. + * @param [properties] Properties to set + * @returns Money instance + */ + public static create(properties?: proto.IMoney): proto.Money; + + /** + * Encodes the specified Money message. Does not implicitly {@link proto.Money.verify|verify} messages. + * @param message Money message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: proto.IMoney, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Money message, length delimited. Does not implicitly {@link proto.Money.verify|verify} messages. + * @param message Money message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: proto.IMoney, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Money message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Money + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.Money; + + /** + * Decodes a Money message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Money + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.Money; + + /** + * Verifies a Money message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Money message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Money + */ + public static fromObject(object: { [k: string]: any }): proto.Money; + + /** + * Creates a plain object from a Money message. Also converts values to other types if specified. + * @param message Money + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: proto.Money, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Money to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a NativeFlowButton. */ + interface INativeFlowButton { + + /** NativeFlowButton name */ + name?: (string|null); + + /** NativeFlowButton buttonParamsJson */ + buttonParamsJson?: (string|null); + } + + /** Represents a NativeFlowButton. */ + class NativeFlowButton implements INativeFlowButton { + + /** + * Constructs a new NativeFlowButton. + * @param [properties] Properties to set + */ + constructor(properties?: proto.INativeFlowButton); + + /** NativeFlowButton name. */ + public name: string; + + /** NativeFlowButton buttonParamsJson. */ + public buttonParamsJson: string; + + /** + * Creates a new NativeFlowButton instance using the specified properties. + * @param [properties] Properties to set + * @returns NativeFlowButton instance + */ + public static create(properties?: proto.INativeFlowButton): proto.NativeFlowButton; + + /** + * Encodes the specified NativeFlowButton message. Does not implicitly {@link proto.NativeFlowButton.verify|verify} messages. + * @param message NativeFlowButton message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: proto.INativeFlowButton, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NativeFlowButton message, length delimited. Does not implicitly {@link proto.NativeFlowButton.verify|verify} messages. + * @param message NativeFlowButton message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: proto.INativeFlowButton, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NativeFlowButton message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NativeFlowButton + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.NativeFlowButton; + + /** + * Decodes a NativeFlowButton message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NativeFlowButton + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.NativeFlowButton; + + /** + * Verifies a NativeFlowButton message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NativeFlowButton message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NativeFlowButton + */ + public static fromObject(object: { [k: string]: any }): proto.NativeFlowButton; + + /** + * Creates a plain object from a NativeFlowButton message. Also converts values to other types if specified. + * @param message NativeFlowButton + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: proto.NativeFlowButton, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NativeFlowButton to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a NativeFlowInfo. */ + interface INativeFlowInfo { + + /** NativeFlowInfo name */ + name?: (string|null); + + /** NativeFlowInfo paramsJson */ + paramsJson?: (string|null); + } + + /** Represents a NativeFlowInfo. */ + class NativeFlowInfo implements INativeFlowInfo { + + /** + * Constructs a new NativeFlowInfo. + * @param [properties] Properties to set + */ + constructor(properties?: proto.INativeFlowInfo); + + /** NativeFlowInfo name. */ + public name: string; + + /** NativeFlowInfo paramsJson. */ + public paramsJson: string; + + /** + * Creates a new NativeFlowInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns NativeFlowInfo instance + */ + public static create(properties?: proto.INativeFlowInfo): proto.NativeFlowInfo; + + /** + * Encodes the specified NativeFlowInfo message. Does not implicitly {@link proto.NativeFlowInfo.verify|verify} messages. + * @param message NativeFlowInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: proto.INativeFlowInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NativeFlowInfo message, length delimited. Does not implicitly {@link proto.NativeFlowInfo.verify|verify} messages. + * @param message NativeFlowInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: proto.INativeFlowInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NativeFlowInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NativeFlowInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.NativeFlowInfo; + + /** + * Decodes a NativeFlowInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NativeFlowInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.NativeFlowInfo; + + /** + * Verifies a NativeFlowInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NativeFlowInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NativeFlowInfo + */ + public static fromObject(object: { [k: string]: any }): proto.NativeFlowInfo; + + /** + * Creates a plain object from a NativeFlowInfo message. Also converts values to other types if specified. + * @param message NativeFlowInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: proto.NativeFlowInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NativeFlowInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a NativeFlowMessage. */ + interface INativeFlowMessage { + + /** NativeFlowMessage buttons */ + buttons?: (proto.INativeFlowButton[]|null); + + /** NativeFlowMessage messageParamsJson */ + messageParamsJson?: (string|null); + + /** NativeFlowMessage messageVersion */ + messageVersion?: (number|null); + } + + /** Represents a NativeFlowMessage. */ + class NativeFlowMessage implements INativeFlowMessage { + + /** + * Constructs a new NativeFlowMessage. + * @param [properties] Properties to set + */ + constructor(properties?: proto.INativeFlowMessage); + + /** NativeFlowMessage buttons. */ + public buttons: proto.INativeFlowButton[]; + + /** NativeFlowMessage messageParamsJson. */ + public messageParamsJson: string; + + /** NativeFlowMessage messageVersion. */ + public messageVersion: number; + + /** + * Creates a new NativeFlowMessage instance using the specified properties. + * @param [properties] Properties to set + * @returns NativeFlowMessage instance + */ + public static create(properties?: proto.INativeFlowMessage): proto.NativeFlowMessage; + + /** + * Encodes the specified NativeFlowMessage message. Does not implicitly {@link proto.NativeFlowMessage.verify|verify} messages. + * @param message NativeFlowMessage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: proto.INativeFlowMessage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NativeFlowMessage message, length delimited. Does not implicitly {@link proto.NativeFlowMessage.verify|verify} messages. + * @param message NativeFlowMessage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: proto.INativeFlowMessage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NativeFlowMessage message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NativeFlowMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.NativeFlowMessage; + + /** + * Decodes a NativeFlowMessage message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NativeFlowMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.NativeFlowMessage; + + /** + * Verifies a NativeFlowMessage message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NativeFlowMessage message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NativeFlowMessage + */ + public static fromObject(object: { [k: string]: any }): proto.NativeFlowMessage; + + /** + * Creates a plain object from a NativeFlowMessage message. Also converts values to other types if specified. + * @param message NativeFlowMessage + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: proto.NativeFlowMessage, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NativeFlowMessage to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a NativeFlowResponseMessage. */ + interface INativeFlowResponseMessage { + + /** NativeFlowResponseMessage name */ + name?: (string|null); + + /** NativeFlowResponseMessage paramsJson */ + paramsJson?: (string|null); + + /** NativeFlowResponseMessage version */ + version?: (number|null); + } + + /** Represents a NativeFlowResponseMessage. */ + class NativeFlowResponseMessage implements INativeFlowResponseMessage { + + /** + * Constructs a new NativeFlowResponseMessage. + * @param [properties] Properties to set + */ + constructor(properties?: proto.INativeFlowResponseMessage); + + /** NativeFlowResponseMessage name. */ + public name: string; + + /** NativeFlowResponseMessage paramsJson. */ + public paramsJson: string; + + /** NativeFlowResponseMessage version. */ + public version: number; + + /** + * Creates a new NativeFlowResponseMessage instance using the specified properties. + * @param [properties] Properties to set + * @returns NativeFlowResponseMessage instance + */ + public static create(properties?: proto.INativeFlowResponseMessage): proto.NativeFlowResponseMessage; + + /** + * Encodes the specified NativeFlowResponseMessage message. Does not implicitly {@link proto.NativeFlowResponseMessage.verify|verify} messages. + * @param message NativeFlowResponseMessage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: proto.INativeFlowResponseMessage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NativeFlowResponseMessage message, length delimited. Does not implicitly {@link proto.NativeFlowResponseMessage.verify|verify} messages. + * @param message NativeFlowResponseMessage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: proto.INativeFlowResponseMessage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NativeFlowResponseMessage message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NativeFlowResponseMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.NativeFlowResponseMessage; + + /** + * Decodes a NativeFlowResponseMessage message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NativeFlowResponseMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.NativeFlowResponseMessage; + + /** + * Verifies a NativeFlowResponseMessage message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NativeFlowResponseMessage message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NativeFlowResponseMessage + */ + public static fromObject(object: { [k: string]: any }): proto.NativeFlowResponseMessage; + + /** + * Creates a plain object from a NativeFlowResponseMessage message. Also converts values to other types if specified. + * @param message NativeFlowResponseMessage + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: proto.NativeFlowResponseMessage, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NativeFlowResponseMessage to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an Option. */ + interface IOption { + + /** Option optionName */ + optionName?: (string|null); + } + + /** Represents an Option. */ + class Option implements IOption { + + /** + * Constructs a new Option. + * @param [properties] Properties to set + */ + constructor(properties?: proto.IOption); + + /** Option optionName. */ + public optionName: string; + + /** + * Creates a new Option instance using the specified properties. + * @param [properties] Properties to set + * @returns Option instance + */ + public static create(properties?: proto.IOption): proto.Option; + + /** + * Encodes the specified Option message. Does not implicitly {@link proto.Option.verify|verify} messages. + * @param message Option message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: proto.IOption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Option message, length delimited. Does not implicitly {@link proto.Option.verify|verify} messages. + * @param message Option message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: proto.IOption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Option message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Option + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.Option; + + /** + * Decodes an Option message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Option + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.Option; + + /** + * Verifies an Option message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Option message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Option + */ + public static fromObject(object: { [k: string]: any }): proto.Option; + + /** + * Creates a plain object from an Option message. Also converts values to other types if specified. + * @param message Option + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: proto.Option, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Option to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an OrderMessage. */ + interface IOrderMessage { + + /** OrderMessage orderId */ + orderId?: (string|null); + + /** OrderMessage thumbnail */ + thumbnail?: (Uint8Array|null); + + /** OrderMessage itemCount */ + itemCount?: (number|null); + + /** OrderMessage status */ + status?: (proto.OrderMessage.OrderMessageOrderStatus|null); + + /** OrderMessage surface */ + surface?: (proto.OrderMessage.OrderMessageOrderSurface|null); + + /** OrderMessage message */ + message?: (string|null); + + /** OrderMessage orderTitle */ + orderTitle?: (string|null); + + /** OrderMessage sellerJid */ + sellerJid?: (string|null); + + /** OrderMessage token */ + token?: (string|null); + + /** OrderMessage totalAmount1000 */ + totalAmount1000?: (number|Long|null); + + /** OrderMessage totalCurrencyCode */ + totalCurrencyCode?: (string|null); + + /** OrderMessage contextInfo */ + contextInfo?: (proto.IContextInfo|null); + } + + /** Represents an OrderMessage. */ + class OrderMessage implements IOrderMessage { + + /** + * Constructs a new OrderMessage. + * @param [properties] Properties to set + */ + constructor(properties?: proto.IOrderMessage); + + /** OrderMessage orderId. */ + public orderId: string; + + /** OrderMessage thumbnail. */ + public thumbnail: Uint8Array; + + /** OrderMessage itemCount. */ + public itemCount: number; + + /** OrderMessage status. */ + public status: proto.OrderMessage.OrderMessageOrderStatus; + + /** OrderMessage surface. */ + public surface: proto.OrderMessage.OrderMessageOrderSurface; + + /** OrderMessage message. */ + public message: string; + + /** OrderMessage orderTitle. */ + public orderTitle: string; + + /** OrderMessage sellerJid. */ + public sellerJid: string; + + /** OrderMessage token. */ + public token: string; + + /** OrderMessage totalAmount1000. */ + public totalAmount1000: (number|Long); + + /** OrderMessage totalCurrencyCode. */ + public totalCurrencyCode: string; + + /** OrderMessage contextInfo. */ + public contextInfo?: (proto.IContextInfo|null); /** - * Creates a new InteractiveAnnotation instance using the specified properties. + * Creates a new OrderMessage instance using the specified properties. * @param [properties] Properties to set - * @returns InteractiveAnnotation instance + * @returns OrderMessage instance */ - public static create(properties?: proto.IInteractiveAnnotation): proto.InteractiveAnnotation; + public static create(properties?: proto.IOrderMessage): proto.OrderMessage; /** - * Encodes the specified InteractiveAnnotation message. Does not implicitly {@link proto.InteractiveAnnotation.verify|verify} messages. - * @param message InteractiveAnnotation message or plain object to encode + * Encodes the specified OrderMessage message. Does not implicitly {@link proto.OrderMessage.verify|verify} messages. + * @param message OrderMessage message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: proto.IInteractiveAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: proto.IOrderMessage, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified InteractiveAnnotation message, length delimited. Does not implicitly {@link proto.InteractiveAnnotation.verify|verify} messages. - * @param message InteractiveAnnotation message or plain object to encode + * Encodes the specified OrderMessage message, length delimited. Does not implicitly {@link proto.OrderMessage.verify|verify} messages. + * @param message OrderMessage message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: proto.IInteractiveAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: proto.IOrderMessage, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an InteractiveAnnotation message from the specified reader or buffer. + * Decodes an OrderMessage message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns InteractiveAnnotation + * @returns OrderMessage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.InteractiveAnnotation; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.OrderMessage; /** - * Decodes an InteractiveAnnotation message from the specified reader or buffer, length delimited. + * Decodes an OrderMessage message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns InteractiveAnnotation + * @returns OrderMessage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.InteractiveAnnotation; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.OrderMessage; /** - * Verifies an InteractiveAnnotation message. + * Verifies an OrderMessage message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates an InteractiveAnnotation message from a plain object. Also converts values to their respective internal types. + * Creates an OrderMessage message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns InteractiveAnnotation + * @returns OrderMessage */ - public static fromObject(object: { [k: string]: any }): proto.InteractiveAnnotation; + public static fromObject(object: { [k: string]: any }): proto.OrderMessage; /** - * Creates a plain object from an InteractiveAnnotation message. Also converts values to other types if specified. - * @param message InteractiveAnnotation + * Creates a plain object from an OrderMessage message. Also converts values to other types if specified. + * @param message OrderMessage * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: proto.InteractiveAnnotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: proto.OrderMessage, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this InteractiveAnnotation to JSON. + * Converts this OrderMessage to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a DeviceListMetadata. */ - interface IDeviceListMetadata { + namespace OrderMessage { - /** DeviceListMetadata senderKeyHash */ - senderKeyHash?: (Uint8Array|null); + /** OrderMessageOrderStatus enum. */ + enum OrderMessageOrderStatus { + INQUIRY = 1 + } - /** DeviceListMetadata senderTimestamp */ - senderTimestamp?: (number|Long|null); + /** OrderMessageOrderSurface enum. */ + enum OrderMessageOrderSurface { + CATALOG = 1 + } + } - /** DeviceListMetadata senderKeyIndexes */ - senderKeyIndexes?: (number[]|null); + /** Properties of a PaymentBackground. */ + interface IPaymentBackground { - /** DeviceListMetadata recipientKeyHash */ - recipientKeyHash?: (Uint8Array|null); + /** PaymentBackground id */ + id?: (string|null); - /** DeviceListMetadata recipientTimestamp */ - recipientTimestamp?: (number|Long|null); + /** PaymentBackground fileLength */ + fileLength?: (number|Long|null); + + /** PaymentBackground width */ + width?: (number|null); + + /** PaymentBackground height */ + height?: (number|null); + + /** PaymentBackground mimetype */ + mimetype?: (string|null); + + /** PaymentBackground placeholderArgb */ + placeholderArgb?: (number|null); + + /** PaymentBackground textArgb */ + textArgb?: (number|null); + + /** PaymentBackground subtextArgb */ + subtextArgb?: (number|null); + + /** PaymentBackground mediaData */ + mediaData?: (proto.IPBMediaData|null); + + /** PaymentBackground type */ + type?: (proto.PaymentBackground.PaymentBackgroundType|null); + } + + /** Represents a PaymentBackground. */ + class PaymentBackground implements IPaymentBackground { + + /** + * Constructs a new PaymentBackground. + * @param [properties] Properties to set + */ + constructor(properties?: proto.IPaymentBackground); + + /** PaymentBackground id. */ + public id: string; + + /** PaymentBackground fileLength. */ + public fileLength: (number|Long); + + /** PaymentBackground width. */ + public width: number; + + /** PaymentBackground height. */ + public height: number; + + /** PaymentBackground mimetype. */ + public mimetype: string; + + /** PaymentBackground placeholderArgb. */ + public placeholderArgb: number; + + /** PaymentBackground textArgb. */ + public textArgb: number; + + /** PaymentBackground subtextArgb. */ + public subtextArgb: number; + + /** PaymentBackground mediaData. */ + public mediaData?: (proto.IPBMediaData|null); + + /** PaymentBackground type. */ + public type: proto.PaymentBackground.PaymentBackgroundType; + + /** + * Creates a new PaymentBackground instance using the specified properties. + * @param [properties] Properties to set + * @returns PaymentBackground instance + */ + public static create(properties?: proto.IPaymentBackground): proto.PaymentBackground; + + /** + * Encodes the specified PaymentBackground message. Does not implicitly {@link proto.PaymentBackground.verify|verify} messages. + * @param message PaymentBackground message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: proto.IPaymentBackground, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PaymentBackground message, length delimited. Does not implicitly {@link proto.PaymentBackground.verify|verify} messages. + * @param message PaymentBackground message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: proto.IPaymentBackground, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PaymentBackground message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PaymentBackground + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.PaymentBackground; + + /** + * Decodes a PaymentBackground message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PaymentBackground + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.PaymentBackground; + + /** + * Verifies a PaymentBackground message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PaymentBackground message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PaymentBackground + */ + public static fromObject(object: { [k: string]: any }): proto.PaymentBackground; + + /** + * Creates a plain object from a PaymentBackground message. Also converts values to other types if specified. + * @param message PaymentBackground + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: proto.PaymentBackground, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PaymentBackground to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace PaymentBackground { + + /** PaymentBackgroundType enum. */ + enum PaymentBackgroundType { + UNKNOWN = 0, + DEFAULT = 1 + } + } + + /** Properties of a PaymentInviteMessage. */ + interface IPaymentInviteMessage { + + /** PaymentInviteMessage serviceType */ + serviceType?: (proto.PaymentInviteMessage.PaymentInviteMessageServiceType|null); - /** DeviceListMetadata recipientKeyIndexes */ - recipientKeyIndexes?: (number[]|null); + /** PaymentInviteMessage expiryTimestamp */ + expiryTimestamp?: (number|Long|null); } - /** Represents a DeviceListMetadata. */ - class DeviceListMetadata implements IDeviceListMetadata { + /** Represents a PaymentInviteMessage. */ + class PaymentInviteMessage implements IPaymentInviteMessage { /** - * Constructs a new DeviceListMetadata. + * Constructs a new PaymentInviteMessage. * @param [properties] Properties to set */ - constructor(properties?: proto.IDeviceListMetadata); - - /** DeviceListMetadata senderKeyHash. */ - public senderKeyHash: Uint8Array; - - /** DeviceListMetadata senderTimestamp. */ - public senderTimestamp: (number|Long); - - /** DeviceListMetadata senderKeyIndexes. */ - public senderKeyIndexes: number[]; - - /** DeviceListMetadata recipientKeyHash. */ - public recipientKeyHash: Uint8Array; + constructor(properties?: proto.IPaymentInviteMessage); - /** DeviceListMetadata recipientTimestamp. */ - public recipientTimestamp: (number|Long); + /** PaymentInviteMessage serviceType. */ + public serviceType: proto.PaymentInviteMessage.PaymentInviteMessageServiceType; - /** DeviceListMetadata recipientKeyIndexes. */ - public recipientKeyIndexes: number[]; + /** PaymentInviteMessage expiryTimestamp. */ + public expiryTimestamp: (number|Long); /** - * Creates a new DeviceListMetadata instance using the specified properties. + * Creates a new PaymentInviteMessage instance using the specified properties. * @param [properties] Properties to set - * @returns DeviceListMetadata instance + * @returns PaymentInviteMessage instance */ - public static create(properties?: proto.IDeviceListMetadata): proto.DeviceListMetadata; + public static create(properties?: proto.IPaymentInviteMessage): proto.PaymentInviteMessage; /** - * Encodes the specified DeviceListMetadata message. Does not implicitly {@link proto.DeviceListMetadata.verify|verify} messages. - * @param message DeviceListMetadata message or plain object to encode + * Encodes the specified PaymentInviteMessage message. Does not implicitly {@link proto.PaymentInviteMessage.verify|verify} messages. + * @param message PaymentInviteMessage message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: proto.IDeviceListMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: proto.IPaymentInviteMessage, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified DeviceListMetadata message, length delimited. Does not implicitly {@link proto.DeviceListMetadata.verify|verify} messages. - * @param message DeviceListMetadata message or plain object to encode + * Encodes the specified PaymentInviteMessage message, length delimited. Does not implicitly {@link proto.PaymentInviteMessage.verify|verify} messages. + * @param message PaymentInviteMessage message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: proto.IDeviceListMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: proto.IPaymentInviteMessage, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a DeviceListMetadata message from the specified reader or buffer. + * Decodes a PaymentInviteMessage message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns DeviceListMetadata + * @returns PaymentInviteMessage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.DeviceListMetadata; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.PaymentInviteMessage; /** - * Decodes a DeviceListMetadata message from the specified reader or buffer, length delimited. + * Decodes a PaymentInviteMessage message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns DeviceListMetadata + * @returns PaymentInviteMessage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.DeviceListMetadata; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.PaymentInviteMessage; /** - * Verifies a DeviceListMetadata message. + * Verifies a PaymentInviteMessage message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a DeviceListMetadata message from a plain object. Also converts values to their respective internal types. + * Creates a PaymentInviteMessage message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns DeviceListMetadata + * @returns PaymentInviteMessage */ - public static fromObject(object: { [k: string]: any }): proto.DeviceListMetadata; + public static fromObject(object: { [k: string]: any }): proto.PaymentInviteMessage; /** - * Creates a plain object from a DeviceListMetadata message. Also converts values to other types if specified. - * @param message DeviceListMetadata + * Creates a plain object from a PaymentInviteMessage message. Also converts values to other types if specified. + * @param message PaymentInviteMessage * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: proto.DeviceListMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: proto.PaymentInviteMessage, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this DeviceListMetadata to JSON. + * Converts this PaymentInviteMessage to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a MessageContextInfo. */ - interface IMessageContextInfo { + namespace PaymentInviteMessage { - /** MessageContextInfo deviceListMetadata */ - deviceListMetadata?: (proto.IDeviceListMetadata|null); + /** PaymentInviteMessageServiceType enum. */ + enum PaymentInviteMessageServiceType { + UNKNOWN = 0, + FBPAY = 1, + NOVI = 2, + UPI = 3 + } + } - /** MessageContextInfo deviceListMetadataVersion */ - deviceListMetadataVersion?: (number|null); + /** Properties of a PBMediaData. */ + interface IPBMediaData { + + /** PBMediaData mediaKey */ + mediaKey?: (Uint8Array|null); + + /** PBMediaData mediaKeyTimestamp */ + mediaKeyTimestamp?: (number|Long|null); + + /** PBMediaData fileSha256 */ + fileSha256?: (Uint8Array|null); + + /** PBMediaData fileEncSha256 */ + fileEncSha256?: (Uint8Array|null); + + /** PBMediaData directPath */ + directPath?: (string|null); } - /** Represents a MessageContextInfo. */ - class MessageContextInfo implements IMessageContextInfo { + /** Represents a PBMediaData. */ + class PBMediaData implements IPBMediaData { /** - * Constructs a new MessageContextInfo. + * Constructs a new PBMediaData. * @param [properties] Properties to set */ - constructor(properties?: proto.IMessageContextInfo); + constructor(properties?: proto.IPBMediaData); - /** MessageContextInfo deviceListMetadata. */ - public deviceListMetadata?: (proto.IDeviceListMetadata|null); + /** PBMediaData mediaKey. */ + public mediaKey: Uint8Array; - /** MessageContextInfo deviceListMetadataVersion. */ - public deviceListMetadataVersion: number; + /** PBMediaData mediaKeyTimestamp. */ + public mediaKeyTimestamp: (number|Long); + + /** PBMediaData fileSha256. */ + public fileSha256: Uint8Array; + + /** PBMediaData fileEncSha256. */ + public fileEncSha256: Uint8Array; + + /** PBMediaData directPath. */ + public directPath: string; /** - * Creates a new MessageContextInfo instance using the specified properties. + * Creates a new PBMediaData instance using the specified properties. * @param [properties] Properties to set - * @returns MessageContextInfo instance + * @returns PBMediaData instance */ - public static create(properties?: proto.IMessageContextInfo): proto.MessageContextInfo; + public static create(properties?: proto.IPBMediaData): proto.PBMediaData; /** - * Encodes the specified MessageContextInfo message. Does not implicitly {@link proto.MessageContextInfo.verify|verify} messages. - * @param message MessageContextInfo message or plain object to encode + * Encodes the specified PBMediaData message. Does not implicitly {@link proto.PBMediaData.verify|verify} messages. + * @param message PBMediaData message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: proto.IMessageContextInfo, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: proto.IPBMediaData, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified MessageContextInfo message, length delimited. Does not implicitly {@link proto.MessageContextInfo.verify|verify} messages. - * @param message MessageContextInfo message or plain object to encode + * Encodes the specified PBMediaData message, length delimited. Does not implicitly {@link proto.PBMediaData.verify|verify} messages. + * @param message PBMediaData message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: proto.IMessageContextInfo, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: proto.IPBMediaData, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a MessageContextInfo message from the specified reader or buffer. + * Decodes a PBMediaData message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns MessageContextInfo + * @returns PBMediaData * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.MessageContextInfo; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.PBMediaData; /** - * Decodes a MessageContextInfo message from the specified reader or buffer, length delimited. + * Decodes a PBMediaData message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns MessageContextInfo + * @returns PBMediaData * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.MessageContextInfo; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.PBMediaData; /** - * Verifies a MessageContextInfo message. + * Verifies a PBMediaData message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a MessageContextInfo message from a plain object. Also converts values to their respective internal types. + * Creates a PBMediaData message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns MessageContextInfo + * @returns PBMediaData */ - public static fromObject(object: { [k: string]: any }): proto.MessageContextInfo; + public static fromObject(object: { [k: string]: any }): proto.PBMediaData; /** - * Creates a plain object from a MessageContextInfo message. Also converts values to other types if specified. - * @param message MessageContextInfo + * Creates a plain object from a PBMediaData message. Also converts values to other types if specified. + * @param message PBMediaData * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: proto.MessageContextInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: proto.PBMediaData, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this MessageContextInfo to JSON. + * Converts this PBMediaData to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of an AdReplyInfo. */ - interface IAdReplyInfo { + /** Properties of a Point. */ + interface IPoint { - /** AdReplyInfo advertiserName */ - advertiserName?: (string|null); + /** Point xDeprecated */ + xDeprecated?: (number|null); - /** AdReplyInfo mediaType */ - mediaType?: (proto.AdReplyInfo.AdReplyInfoMediaType|null); + /** Point yDeprecated */ + yDeprecated?: (number|null); - /** AdReplyInfo jpegThumbnail */ - jpegThumbnail?: (Uint8Array|null); + /** Point x */ + x?: (number|null); - /** AdReplyInfo caption */ - caption?: (string|null); + /** Point y */ + y?: (number|null); } - /** Represents an AdReplyInfo. */ - class AdReplyInfo implements IAdReplyInfo { + /** Represents a Point. */ + class Point implements IPoint { /** - * Constructs a new AdReplyInfo. + * Constructs a new Point. * @param [properties] Properties to set */ - constructor(properties?: proto.IAdReplyInfo); + constructor(properties?: proto.IPoint); - /** AdReplyInfo advertiserName. */ - public advertiserName: string; + /** Point xDeprecated. */ + public xDeprecated: number; - /** AdReplyInfo mediaType. */ - public mediaType: proto.AdReplyInfo.AdReplyInfoMediaType; + /** Point yDeprecated. */ + public yDeprecated: number; - /** AdReplyInfo jpegThumbnail. */ - public jpegThumbnail: Uint8Array; + /** Point x. */ + public x: number; - /** AdReplyInfo caption. */ - public caption: string; + /** Point y. */ + public y: number; /** - * Creates a new AdReplyInfo instance using the specified properties. + * Creates a new Point instance using the specified properties. * @param [properties] Properties to set - * @returns AdReplyInfo instance + * @returns Point instance */ - public static create(properties?: proto.IAdReplyInfo): proto.AdReplyInfo; + public static create(properties?: proto.IPoint): proto.Point; /** - * Encodes the specified AdReplyInfo message. Does not implicitly {@link proto.AdReplyInfo.verify|verify} messages. - * @param message AdReplyInfo message or plain object to encode + * Encodes the specified Point message. Does not implicitly {@link proto.Point.verify|verify} messages. + * @param message Point message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: proto.IAdReplyInfo, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: proto.IPoint, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified AdReplyInfo message, length delimited. Does not implicitly {@link proto.AdReplyInfo.verify|verify} messages. - * @param message AdReplyInfo message or plain object to encode + * Encodes the specified Point message, length delimited. Does not implicitly {@link proto.Point.verify|verify} messages. + * @param message Point message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: proto.IAdReplyInfo, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: proto.IPoint, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an AdReplyInfo message from the specified reader or buffer. + * Decodes a Point message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns AdReplyInfo + * @returns Point * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.AdReplyInfo; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.Point; /** - * Decodes an AdReplyInfo message from the specified reader or buffer, length delimited. + * Decodes a Point message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns AdReplyInfo + * @returns Point * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.AdReplyInfo; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.Point; /** - * Verifies an AdReplyInfo message. + * Verifies a Point message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates an AdReplyInfo message from a plain object. Also converts values to their respective internal types. + * Creates a Point message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns AdReplyInfo + * @returns Point */ - public static fromObject(object: { [k: string]: any }): proto.AdReplyInfo; + public static fromObject(object: { [k: string]: any }): proto.Point; /** - * Creates a plain object from an AdReplyInfo message. Also converts values to other types if specified. - * @param message AdReplyInfo + * Creates a plain object from a Point message. Also converts values to other types if specified. + * @param message Point * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: proto.AdReplyInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: proto.Point, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this AdReplyInfo to JSON. + * Converts this Point to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - namespace AdReplyInfo { - - /** AdReplyInfoMediaType enum. */ - enum AdReplyInfoMediaType { - NONE = 0, - IMAGE = 1, - VIDEO = 2 - } - } - - /** Properties of an ExternalAdReplyInfo. */ - interface IExternalAdReplyInfo { - - /** ExternalAdReplyInfo title */ - title?: (string|null); - - /** ExternalAdReplyInfo body */ - body?: (string|null); - - /** ExternalAdReplyInfo mediaType */ - mediaType?: (proto.ExternalAdReplyInfo.ExternalAdReplyInfoMediaType|null); - - /** ExternalAdReplyInfo thumbnailUrl */ - thumbnailUrl?: (string|null); - - /** ExternalAdReplyInfo mediaUrl */ - mediaUrl?: (string|null); - - /** ExternalAdReplyInfo thumbnail */ - thumbnail?: (Uint8Array|null); + /** Properties of a PollCreationMessage. */ + interface IPollCreationMessage { - /** ExternalAdReplyInfo sourceType */ - sourceType?: (string|null); + /** PollCreationMessage encKey */ + encKey?: (Uint8Array|null); - /** ExternalAdReplyInfo sourceId */ - sourceId?: (string|null); + /** PollCreationMessage name */ + name?: (string|null); - /** ExternalAdReplyInfo sourceUrl */ - sourceUrl?: (string|null); + /** PollCreationMessage options */ + options?: (proto.IOption[]|null); - /** ExternalAdReplyInfo containsAutoReply */ - containsAutoReply?: (boolean|null); + /** PollCreationMessage selectableOptionsCount */ + selectableOptionsCount?: (number|null); } - /** Represents an ExternalAdReplyInfo. */ - class ExternalAdReplyInfo implements IExternalAdReplyInfo { + /** Represents a PollCreationMessage. */ + class PollCreationMessage implements IPollCreationMessage { /** - * Constructs a new ExternalAdReplyInfo. + * Constructs a new PollCreationMessage. * @param [properties] Properties to set */ - constructor(properties?: proto.IExternalAdReplyInfo); - - /** ExternalAdReplyInfo title. */ - public title: string; - - /** ExternalAdReplyInfo body. */ - public body: string; + constructor(properties?: proto.IPollCreationMessage); - /** ExternalAdReplyInfo mediaType. */ - public mediaType: proto.ExternalAdReplyInfo.ExternalAdReplyInfoMediaType; - - /** ExternalAdReplyInfo thumbnailUrl. */ - public thumbnailUrl: string; - - /** ExternalAdReplyInfo mediaUrl. */ - public mediaUrl: string; + /** PollCreationMessage encKey. */ + public encKey: Uint8Array; - /** ExternalAdReplyInfo thumbnail. */ - public thumbnail: Uint8Array; - - /** ExternalAdReplyInfo sourceType. */ - public sourceType: string; - - /** ExternalAdReplyInfo sourceId. */ - public sourceId: string; + /** PollCreationMessage name. */ + public name: string; - /** ExternalAdReplyInfo sourceUrl. */ - public sourceUrl: string; + /** PollCreationMessage options. */ + public options: proto.IOption[]; - /** ExternalAdReplyInfo containsAutoReply. */ - public containsAutoReply: boolean; + /** PollCreationMessage selectableOptionsCount. */ + public selectableOptionsCount: number; /** - * Creates a new ExternalAdReplyInfo instance using the specified properties. + * Creates a new PollCreationMessage instance using the specified properties. * @param [properties] Properties to set - * @returns ExternalAdReplyInfo instance + * @returns PollCreationMessage instance */ - public static create(properties?: proto.IExternalAdReplyInfo): proto.ExternalAdReplyInfo; + public static create(properties?: proto.IPollCreationMessage): proto.PollCreationMessage; /** - * Encodes the specified ExternalAdReplyInfo message. Does not implicitly {@link proto.ExternalAdReplyInfo.verify|verify} messages. - * @param message ExternalAdReplyInfo message or plain object to encode + * Encodes the specified PollCreationMessage message. Does not implicitly {@link proto.PollCreationMessage.verify|verify} messages. + * @param message PollCreationMessage message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: proto.IExternalAdReplyInfo, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: proto.IPollCreationMessage, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ExternalAdReplyInfo message, length delimited. Does not implicitly {@link proto.ExternalAdReplyInfo.verify|verify} messages. - * @param message ExternalAdReplyInfo message or plain object to encode + * Encodes the specified PollCreationMessage message, length delimited. Does not implicitly {@link proto.PollCreationMessage.verify|verify} messages. + * @param message PollCreationMessage message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: proto.IExternalAdReplyInfo, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: proto.IPollCreationMessage, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an ExternalAdReplyInfo message from the specified reader or buffer. + * Decodes a PollCreationMessage message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ExternalAdReplyInfo + * @returns PollCreationMessage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.ExternalAdReplyInfo; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.PollCreationMessage; /** - * Decodes an ExternalAdReplyInfo message from the specified reader or buffer, length delimited. + * Decodes a PollCreationMessage message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ExternalAdReplyInfo + * @returns PollCreationMessage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.ExternalAdReplyInfo; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.PollCreationMessage; /** - * Verifies an ExternalAdReplyInfo message. + * Verifies a PollCreationMessage message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates an ExternalAdReplyInfo message from a plain object. Also converts values to their respective internal types. + * Creates a PollCreationMessage message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ExternalAdReplyInfo + * @returns PollCreationMessage */ - public static fromObject(object: { [k: string]: any }): proto.ExternalAdReplyInfo; + public static fromObject(object: { [k: string]: any }): proto.PollCreationMessage; /** - * Creates a plain object from an ExternalAdReplyInfo message. Also converts values to other types if specified. - * @param message ExternalAdReplyInfo + * Creates a plain object from a PollCreationMessage message. Also converts values to other types if specified. + * @param message PollCreationMessage * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: proto.ExternalAdReplyInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: proto.PollCreationMessage, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ExternalAdReplyInfo to JSON. + * Converts this PollCreationMessage to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - namespace ExternalAdReplyInfo { - - /** ExternalAdReplyInfoMediaType enum. */ - enum ExternalAdReplyInfoMediaType { - NONE = 0, - IMAGE = 1, - VIDEO = 2 - } - } - - /** Properties of a ContextInfo. */ - interface IContextInfo { - - /** ContextInfo stanzaId */ - stanzaId?: (string|null); - - /** ContextInfo participant */ - participant?: (string|null); - - /** ContextInfo quotedMessage */ - quotedMessage?: (proto.IMessage|null); - - /** ContextInfo remoteJid */ - remoteJid?: (string|null); - - /** ContextInfo mentionedJid */ - mentionedJid?: (string[]|null); - - /** ContextInfo conversionSource */ - conversionSource?: (string|null); - - /** ContextInfo conversionData */ - conversionData?: (Uint8Array|null); - - /** ContextInfo conversionDelaySeconds */ - conversionDelaySeconds?: (number|null); - - /** ContextInfo forwardingScore */ - forwardingScore?: (number|null); - - /** ContextInfo isForwarded */ - isForwarded?: (boolean|null); - - /** ContextInfo quotedAd */ - quotedAd?: (proto.IAdReplyInfo|null); - - /** ContextInfo placeholderKey */ - placeholderKey?: (proto.IMessageKey|null); - - /** ContextInfo expiration */ - expiration?: (number|null); - - /** ContextInfo ephemeralSettingTimestamp */ - ephemeralSettingTimestamp?: (number|Long|null); - - /** ContextInfo ephemeralSharedSecret */ - ephemeralSharedSecret?: (Uint8Array|null); - - /** ContextInfo externalAdReply */ - externalAdReply?: (proto.IExternalAdReplyInfo|null); - - /** ContextInfo entryPointConversionSource */ - entryPointConversionSource?: (string|null); - - /** ContextInfo entryPointConversionApp */ - entryPointConversionApp?: (string|null); - - /** ContextInfo entryPointConversionDelaySeconds */ - entryPointConversionDelaySeconds?: (number|null); - - /** ContextInfo disappearingMode */ - disappearingMode?: (proto.IDisappearingMode|null); + /** Properties of a PollUpdateMessage. */ + interface IPollUpdateMessage { - /** ContextInfo actionLink */ - actionLink?: (proto.IActionLink|null); + /** PollUpdateMessage pollCreationMessageKey */ + pollCreationMessageKey?: (proto.IMessageKey|null); - /** ContextInfo groupSubject */ - groupSubject?: (string|null); + /** PollUpdateMessage encPayload */ + encPayload?: (Uint8Array|null); - /** ContextInfo parentGroupJid */ - parentGroupJid?: (string|null); + /** PollUpdateMessage encIv */ + encIv?: (Uint8Array|null); } - /** Represents a ContextInfo. */ - class ContextInfo implements IContextInfo { + /** Represents a PollUpdateMessage. */ + class PollUpdateMessage implements IPollUpdateMessage { /** - * Constructs a new ContextInfo. + * Constructs a new PollUpdateMessage. * @param [properties] Properties to set */ - constructor(properties?: proto.IContextInfo); - - /** ContextInfo stanzaId. */ - public stanzaId: string; - - /** ContextInfo participant. */ - public participant: string; - - /** ContextInfo quotedMessage. */ - public quotedMessage?: (proto.IMessage|null); - - /** ContextInfo remoteJid. */ - public remoteJid: string; - - /** ContextInfo mentionedJid. */ - public mentionedJid: string[]; - - /** ContextInfo conversionSource. */ - public conversionSource: string; - - /** ContextInfo conversionData. */ - public conversionData: Uint8Array; - - /** ContextInfo conversionDelaySeconds. */ - public conversionDelaySeconds: number; - - /** ContextInfo forwardingScore. */ - public forwardingScore: number; - - /** ContextInfo isForwarded. */ - public isForwarded: boolean; - - /** ContextInfo quotedAd. */ - public quotedAd?: (proto.IAdReplyInfo|null); - - /** ContextInfo placeholderKey. */ - public placeholderKey?: (proto.IMessageKey|null); - - /** ContextInfo expiration. */ - public expiration: number; - - /** ContextInfo ephemeralSettingTimestamp. */ - public ephemeralSettingTimestamp: (number|Long); - - /** ContextInfo ephemeralSharedSecret. */ - public ephemeralSharedSecret: Uint8Array; - - /** ContextInfo externalAdReply. */ - public externalAdReply?: (proto.IExternalAdReplyInfo|null); - - /** ContextInfo entryPointConversionSource. */ - public entryPointConversionSource: string; - - /** ContextInfo entryPointConversionApp. */ - public entryPointConversionApp: string; - - /** ContextInfo entryPointConversionDelaySeconds. */ - public entryPointConversionDelaySeconds: number; - - /** ContextInfo disappearingMode. */ - public disappearingMode?: (proto.IDisappearingMode|null); + constructor(properties?: proto.IPollUpdateMessage); - /** ContextInfo actionLink. */ - public actionLink?: (proto.IActionLink|null); + /** PollUpdateMessage pollCreationMessageKey. */ + public pollCreationMessageKey?: (proto.IMessageKey|null); - /** ContextInfo groupSubject. */ - public groupSubject: string; + /** PollUpdateMessage encPayload. */ + public encPayload: Uint8Array; - /** ContextInfo parentGroupJid. */ - public parentGroupJid: string; + /** PollUpdateMessage encIv. */ + public encIv: Uint8Array; /** - * Creates a new ContextInfo instance using the specified properties. + * Creates a new PollUpdateMessage instance using the specified properties. * @param [properties] Properties to set - * @returns ContextInfo instance + * @returns PollUpdateMessage instance */ - public static create(properties?: proto.IContextInfo): proto.ContextInfo; + public static create(properties?: proto.IPollUpdateMessage): proto.PollUpdateMessage; /** - * Encodes the specified ContextInfo message. Does not implicitly {@link proto.ContextInfo.verify|verify} messages. - * @param message ContextInfo message or plain object to encode + * Encodes the specified PollUpdateMessage message. Does not implicitly {@link proto.PollUpdateMessage.verify|verify} messages. + * @param message PollUpdateMessage message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: proto.IContextInfo, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: proto.IPollUpdateMessage, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ContextInfo message, length delimited. Does not implicitly {@link proto.ContextInfo.verify|verify} messages. - * @param message ContextInfo message or plain object to encode + * Encodes the specified PollUpdateMessage message, length delimited. Does not implicitly {@link proto.PollUpdateMessage.verify|verify} messages. + * @param message PollUpdateMessage message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: proto.IContextInfo, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: proto.IPollUpdateMessage, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ContextInfo message from the specified reader or buffer. + * Decodes a PollUpdateMessage message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ContextInfo + * @returns PollUpdateMessage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.ContextInfo; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.PollUpdateMessage; /** - * Decodes a ContextInfo message from the specified reader or buffer, length delimited. + * Decodes a PollUpdateMessage message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ContextInfo + * @returns PollUpdateMessage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.ContextInfo; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.PollUpdateMessage; /** - * Verifies a ContextInfo message. + * Verifies a PollUpdateMessage message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a ContextInfo message from a plain object. Also converts values to their respective internal types. + * Creates a PollUpdateMessage message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ContextInfo + * @returns PollUpdateMessage */ - public static fromObject(object: { [k: string]: any }): proto.ContextInfo; + public static fromObject(object: { [k: string]: any }): proto.PollUpdateMessage; /** - * Creates a plain object from a ContextInfo message. Also converts values to other types if specified. - * @param message ContextInfo + * Creates a plain object from a PollUpdateMessage message. Also converts values to other types if specified. + * @param message PollUpdateMessage * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: proto.ContextInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: proto.PollUpdateMessage, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ContextInfo to JSON. + * Converts this PollUpdateMessage to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a SenderKeyDistributionMessage. */ - interface ISenderKeyDistributionMessage { - - /** SenderKeyDistributionMessage groupId */ - groupId?: (string|null); + /** Properties of a PollUpdateMessageContent. */ + interface IPollUpdateMessageContent { - /** SenderKeyDistributionMessage axolotlSenderKeyDistributionMessage */ - axolotlSenderKeyDistributionMessage?: (Uint8Array|null); + /** PollUpdateMessageContent voteMessage */ + voteMessage?: (proto.IPollVoteMessage|null); } - /** Represents a SenderKeyDistributionMessage. */ - class SenderKeyDistributionMessage implements ISenderKeyDistributionMessage { + /** Represents a PollUpdateMessageContent. */ + class PollUpdateMessageContent implements IPollUpdateMessageContent { /** - * Constructs a new SenderKeyDistributionMessage. + * Constructs a new PollUpdateMessageContent. * @param [properties] Properties to set */ - constructor(properties?: proto.ISenderKeyDistributionMessage); + constructor(properties?: proto.IPollUpdateMessageContent); - /** SenderKeyDistributionMessage groupId. */ - public groupId: string; + /** PollUpdateMessageContent voteMessage. */ + public voteMessage?: (proto.IPollVoteMessage|null); - /** SenderKeyDistributionMessage axolotlSenderKeyDistributionMessage. */ - public axolotlSenderKeyDistributionMessage: Uint8Array; + /** PollUpdateMessageContent update. */ + public update?: "voteMessage"; /** - * Creates a new SenderKeyDistributionMessage instance using the specified properties. + * Creates a new PollUpdateMessageContent instance using the specified properties. * @param [properties] Properties to set - * @returns SenderKeyDistributionMessage instance + * @returns PollUpdateMessageContent instance */ - public static create(properties?: proto.ISenderKeyDistributionMessage): proto.SenderKeyDistributionMessage; + public static create(properties?: proto.IPollUpdateMessageContent): proto.PollUpdateMessageContent; /** - * Encodes the specified SenderKeyDistributionMessage message. Does not implicitly {@link proto.SenderKeyDistributionMessage.verify|verify} messages. - * @param message SenderKeyDistributionMessage message or plain object to encode + * Encodes the specified PollUpdateMessageContent message. Does not implicitly {@link proto.PollUpdateMessageContent.verify|verify} messages. + * @param message PollUpdateMessageContent message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: proto.ISenderKeyDistributionMessage, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: proto.IPollUpdateMessageContent, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified SenderKeyDistributionMessage message, length delimited. Does not implicitly {@link proto.SenderKeyDistributionMessage.verify|verify} messages. - * @param message SenderKeyDistributionMessage message or plain object to encode + * Encodes the specified PollUpdateMessageContent message, length delimited. Does not implicitly {@link proto.PollUpdateMessageContent.verify|verify} messages. + * @param message PollUpdateMessageContent message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: proto.ISenderKeyDistributionMessage, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: proto.IPollUpdateMessageContent, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a SenderKeyDistributionMessage message from the specified reader or buffer. + * Decodes a PollUpdateMessageContent message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns SenderKeyDistributionMessage + * @returns PollUpdateMessageContent * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.SenderKeyDistributionMessage; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.PollUpdateMessageContent; /** - * Decodes a SenderKeyDistributionMessage message from the specified reader or buffer, length delimited. + * Decodes a PollUpdateMessageContent message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns SenderKeyDistributionMessage + * @returns PollUpdateMessageContent * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.SenderKeyDistributionMessage; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.PollUpdateMessageContent; /** - * Verifies a SenderKeyDistributionMessage message. + * Verifies a PollUpdateMessageContent message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a SenderKeyDistributionMessage message from a plain object. Also converts values to their respective internal types. + * Creates a PollUpdateMessageContent message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns SenderKeyDistributionMessage + * @returns PollUpdateMessageContent */ - public static fromObject(object: { [k: string]: any }): proto.SenderKeyDistributionMessage; + public static fromObject(object: { [k: string]: any }): proto.PollUpdateMessageContent; /** - * Creates a plain object from a SenderKeyDistributionMessage message. Also converts values to other types if specified. - * @param message SenderKeyDistributionMessage + * Creates a plain object from a PollUpdateMessageContent message. Also converts values to other types if specified. + * @param message PollUpdateMessageContent * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: proto.SenderKeyDistributionMessage, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: proto.PollUpdateMessageContent, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this SenderKeyDistributionMessage to JSON. + * Converts this PollUpdateMessageContent to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of an ImageMessage. */ - interface IImageMessage { - - /** ImageMessage url */ - url?: (string|null); - - /** ImageMessage mimetype */ - mimetype?: (string|null); - - /** ImageMessage caption */ - caption?: (string|null); - - /** ImageMessage fileSha256 */ - fileSha256?: (Uint8Array|null); - - /** ImageMessage fileLength */ - fileLength?: (number|Long|null); - - /** ImageMessage height */ - height?: (number|null); - - /** ImageMessage width */ - width?: (number|null); - - /** ImageMessage mediaKey */ - mediaKey?: (Uint8Array|null); - - /** ImageMessage fileEncSha256 */ - fileEncSha256?: (Uint8Array|null); - - /** ImageMessage interactiveAnnotations */ - interactiveAnnotations?: (proto.IInteractiveAnnotation[]|null); - - /** ImageMessage directPath */ - directPath?: (string|null); - - /** ImageMessage mediaKeyTimestamp */ - mediaKeyTimestamp?: (number|Long|null); - - /** ImageMessage jpegThumbnail */ - jpegThumbnail?: (Uint8Array|null); - - /** ImageMessage contextInfo */ - contextInfo?: (proto.IContextInfo|null); - - /** ImageMessage firstScanSidecar */ - firstScanSidecar?: (Uint8Array|null); - - /** ImageMessage firstScanLength */ - firstScanLength?: (number|null); - - /** ImageMessage experimentGroupId */ - experimentGroupId?: (number|null); - - /** ImageMessage scansSidecar */ - scansSidecar?: (Uint8Array|null); - - /** ImageMessage scanLengths */ - scanLengths?: (number[]|null); - - /** ImageMessage midQualityFileSha256 */ - midQualityFileSha256?: (Uint8Array|null); - - /** ImageMessage midQualityFileEncSha256 */ - midQualityFileEncSha256?: (Uint8Array|null); - - /** ImageMessage viewOnce */ - viewOnce?: (boolean|null); - - /** ImageMessage thumbnailDirectPath */ - thumbnailDirectPath?: (string|null); - - /** ImageMessage thumbnailSha256 */ - thumbnailSha256?: (Uint8Array|null); + /** Properties of a PollVoteMessage. */ + interface IPollVoteMessage { - /** ImageMessage thumbnailEncSha256 */ - thumbnailEncSha256?: (Uint8Array|null); + /** PollVoteMessage selectedOptions */ + selectedOptions?: (Uint8Array[]|null); - /** ImageMessage staticUrl */ - staticUrl?: (string|null); + /** PollVoteMessage senderTimestampMs */ + senderTimestampMs?: (number|Long|null); } - /** Represents an ImageMessage. */ - class ImageMessage implements IImageMessage { + /** Represents a PollVoteMessage. */ + class PollVoteMessage implements IPollVoteMessage { /** - * Constructs a new ImageMessage. + * Constructs a new PollVoteMessage. * @param [properties] Properties to set */ - constructor(properties?: proto.IImageMessage); - - /** ImageMessage url. */ - public url: string; - - /** ImageMessage mimetype. */ - public mimetype: string; - - /** ImageMessage caption. */ - public caption: string; - - /** ImageMessage fileSha256. */ - public fileSha256: Uint8Array; - - /** ImageMessage fileLength. */ - public fileLength: (number|Long); - - /** ImageMessage height. */ - public height: number; - - /** ImageMessage width. */ - public width: number; - - /** ImageMessage mediaKey. */ - public mediaKey: Uint8Array; + constructor(properties?: proto.IPollVoteMessage); - /** ImageMessage fileEncSha256. */ - public fileEncSha256: Uint8Array; - - /** ImageMessage interactiveAnnotations. */ - public interactiveAnnotations: proto.IInteractiveAnnotation[]; - - /** ImageMessage directPath. */ - public directPath: string; + /** PollVoteMessage selectedOptions. */ + public selectedOptions: Uint8Array[]; - /** ImageMessage mediaKeyTimestamp. */ - public mediaKeyTimestamp: (number|Long); + /** PollVoteMessage senderTimestampMs. */ + public senderTimestampMs: (number|Long); - /** ImageMessage jpegThumbnail. */ - public jpegThumbnail: Uint8Array; + /** + * Creates a new PollVoteMessage instance using the specified properties. + * @param [properties] Properties to set + * @returns PollVoteMessage instance + */ + public static create(properties?: proto.IPollVoteMessage): proto.PollVoteMessage; - /** ImageMessage contextInfo. */ - public contextInfo?: (proto.IContextInfo|null); + /** + * Encodes the specified PollVoteMessage message. Does not implicitly {@link proto.PollVoteMessage.verify|verify} messages. + * @param message PollVoteMessage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: proto.IPollVoteMessage, writer?: $protobuf.Writer): $protobuf.Writer; - /** ImageMessage firstScanSidecar. */ - public firstScanSidecar: Uint8Array; + /** + * Encodes the specified PollVoteMessage message, length delimited. Does not implicitly {@link proto.PollVoteMessage.verify|verify} messages. + * @param message PollVoteMessage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: proto.IPollVoteMessage, writer?: $protobuf.Writer): $protobuf.Writer; - /** ImageMessage firstScanLength. */ - public firstScanLength: number; + /** + * Decodes a PollVoteMessage message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PollVoteMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.PollVoteMessage; - /** ImageMessage experimentGroupId. */ - public experimentGroupId: number; + /** + * Decodes a PollVoteMessage message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PollVoteMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.PollVoteMessage; - /** ImageMessage scansSidecar. */ - public scansSidecar: Uint8Array; + /** + * Verifies a PollVoteMessage message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** ImageMessage scanLengths. */ - public scanLengths: number[]; + /** + * Creates a PollVoteMessage message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PollVoteMessage + */ + public static fromObject(object: { [k: string]: any }): proto.PollVoteMessage; - /** ImageMessage midQualityFileSha256. */ - public midQualityFileSha256: Uint8Array; + /** + * Creates a plain object from a PollVoteMessage message. Also converts values to other types if specified. + * @param message PollVoteMessage + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: proto.PollVoteMessage, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** ImageMessage midQualityFileEncSha256. */ - public midQualityFileEncSha256: Uint8Array; + /** + * Converts this PollVoteMessage to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** ImageMessage viewOnce. */ - public viewOnce: boolean; + /** Properties of a Product. */ + interface IProduct { - /** ImageMessage thumbnailDirectPath. */ - public thumbnailDirectPath: string; + /** Product productId */ + productId?: (string|null); + } - /** ImageMessage thumbnailSha256. */ - public thumbnailSha256: Uint8Array; + /** Represents a Product. */ + class Product implements IProduct { - /** ImageMessage thumbnailEncSha256. */ - public thumbnailEncSha256: Uint8Array; + /** + * Constructs a new Product. + * @param [properties] Properties to set + */ + constructor(properties?: proto.IProduct); - /** ImageMessage staticUrl. */ - public staticUrl: string; + /** Product productId. */ + public productId: string; /** - * Creates a new ImageMessage instance using the specified properties. + * Creates a new Product instance using the specified properties. * @param [properties] Properties to set - * @returns ImageMessage instance + * @returns Product instance */ - public static create(properties?: proto.IImageMessage): proto.ImageMessage; + public static create(properties?: proto.IProduct): proto.Product; /** - * Encodes the specified ImageMessage message. Does not implicitly {@link proto.ImageMessage.verify|verify} messages. - * @param message ImageMessage message or plain object to encode + * Encodes the specified Product message. Does not implicitly {@link proto.Product.verify|verify} messages. + * @param message Product message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: proto.IImageMessage, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: proto.IProduct, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ImageMessage message, length delimited. Does not implicitly {@link proto.ImageMessage.verify|verify} messages. - * @param message ImageMessage message or plain object to encode + * Encodes the specified Product message, length delimited. Does not implicitly {@link proto.Product.verify|verify} messages. + * @param message Product message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: proto.IImageMessage, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: proto.IProduct, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an ImageMessage message from the specified reader or buffer. + * Decodes a Product message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ImageMessage + * @returns Product * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.ImageMessage; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.Product; /** - * Decodes an ImageMessage message from the specified reader or buffer, length delimited. + * Decodes a Product message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ImageMessage + * @returns Product * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.ImageMessage; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.Product; /** - * Verifies an ImageMessage message. + * Verifies a Product message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates an ImageMessage message from a plain object. Also converts values to their respective internal types. + * Creates a Product message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ImageMessage + * @returns Product */ - public static fromObject(object: { [k: string]: any }): proto.ImageMessage; + public static fromObject(object: { [k: string]: any }): proto.Product; /** - * Creates a plain object from an ImageMessage message. Also converts values to other types if specified. - * @param message ImageMessage + * Creates a plain object from a Product message. Also converts values to other types if specified. + * @param message Product * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: proto.ImageMessage, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: proto.Product, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ImageMessage to JSON. + * Converts this Product to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of an InvoiceMessage. */ - interface IInvoiceMessage { + /** Properties of a ProductListHeaderImage. */ + interface IProductListHeaderImage { - /** InvoiceMessage note */ - note?: (string|null); + /** ProductListHeaderImage productId */ + productId?: (string|null); - /** InvoiceMessage token */ - token?: (string|null); + /** ProductListHeaderImage jpegThumbnail */ + jpegThumbnail?: (Uint8Array|null); + } - /** InvoiceMessage attachmentType */ - attachmentType?: (proto.InvoiceMessage.InvoiceMessageAttachmentType|null); + /** Represents a ProductListHeaderImage. */ + class ProductListHeaderImage implements IProductListHeaderImage { - /** InvoiceMessage attachmentMimetype */ - attachmentMimetype?: (string|null); + /** + * Constructs a new ProductListHeaderImage. + * @param [properties] Properties to set + */ + constructor(properties?: proto.IProductListHeaderImage); - /** InvoiceMessage attachmentMediaKey */ - attachmentMediaKey?: (Uint8Array|null); + /** ProductListHeaderImage productId. */ + public productId: string; - /** InvoiceMessage attachmentMediaKeyTimestamp */ - attachmentMediaKeyTimestamp?: (number|Long|null); + /** ProductListHeaderImage jpegThumbnail. */ + public jpegThumbnail: Uint8Array; - /** InvoiceMessage attachmentFileSha256 */ - attachmentFileSha256?: (Uint8Array|null); + /** + * Creates a new ProductListHeaderImage instance using the specified properties. + * @param [properties] Properties to set + * @returns ProductListHeaderImage instance + */ + public static create(properties?: proto.IProductListHeaderImage): proto.ProductListHeaderImage; - /** InvoiceMessage attachmentFileEncSha256 */ - attachmentFileEncSha256?: (Uint8Array|null); + /** + * Encodes the specified ProductListHeaderImage message. Does not implicitly {@link proto.ProductListHeaderImage.verify|verify} messages. + * @param message ProductListHeaderImage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: proto.IProductListHeaderImage, writer?: $protobuf.Writer): $protobuf.Writer; - /** InvoiceMessage attachmentDirectPath */ - attachmentDirectPath?: (string|null); + /** + * Encodes the specified ProductListHeaderImage message, length delimited. Does not implicitly {@link proto.ProductListHeaderImage.verify|verify} messages. + * @param message ProductListHeaderImage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: proto.IProductListHeaderImage, writer?: $protobuf.Writer): $protobuf.Writer; - /** InvoiceMessage attachmentJpegThumbnail */ - attachmentJpegThumbnail?: (Uint8Array|null); - } + /** + * Decodes a ProductListHeaderImage message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ProductListHeaderImage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.ProductListHeaderImage; - /** Represents an InvoiceMessage. */ - class InvoiceMessage implements IInvoiceMessage { + /** + * Decodes a ProductListHeaderImage message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ProductListHeaderImage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.ProductListHeaderImage; /** - * Constructs a new InvoiceMessage. - * @param [properties] Properties to set + * Verifies a ProductListHeaderImage message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not */ - constructor(properties?: proto.IInvoiceMessage); + public static verify(message: { [k: string]: any }): (string|null); - /** InvoiceMessage note. */ - public note: string; + /** + * Creates a ProductListHeaderImage message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ProductListHeaderImage + */ + public static fromObject(object: { [k: string]: any }): proto.ProductListHeaderImage; - /** InvoiceMessage token. */ - public token: string; + /** + * Creates a plain object from a ProductListHeaderImage message. Also converts values to other types if specified. + * @param message ProductListHeaderImage + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: proto.ProductListHeaderImage, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** InvoiceMessage attachmentType. */ - public attachmentType: proto.InvoiceMessage.InvoiceMessageAttachmentType; + /** + * Converts this ProductListHeaderImage to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** InvoiceMessage attachmentMimetype. */ - public attachmentMimetype: string; + /** Properties of a ProductListInfo. */ + interface IProductListInfo { - /** InvoiceMessage attachmentMediaKey. */ - public attachmentMediaKey: Uint8Array; + /** ProductListInfo productSections */ + productSections?: (proto.IProductSection[]|null); - /** InvoiceMessage attachmentMediaKeyTimestamp. */ - public attachmentMediaKeyTimestamp: (number|Long); + /** ProductListInfo headerImage */ + headerImage?: (proto.IProductListHeaderImage|null); - /** InvoiceMessage attachmentFileSha256. */ - public attachmentFileSha256: Uint8Array; + /** ProductListInfo businessOwnerJid */ + businessOwnerJid?: (string|null); + } - /** InvoiceMessage attachmentFileEncSha256. */ - public attachmentFileEncSha256: Uint8Array; + /** Represents a ProductListInfo. */ + class ProductListInfo implements IProductListInfo { - /** InvoiceMessage attachmentDirectPath. */ - public attachmentDirectPath: string; + /** + * Constructs a new ProductListInfo. + * @param [properties] Properties to set + */ + constructor(properties?: proto.IProductListInfo); - /** InvoiceMessage attachmentJpegThumbnail. */ - public attachmentJpegThumbnail: Uint8Array; + /** ProductListInfo productSections. */ + public productSections: proto.IProductSection[]; + + /** ProductListInfo headerImage. */ + public headerImage?: (proto.IProductListHeaderImage|null); + + /** ProductListInfo businessOwnerJid. */ + public businessOwnerJid: string; /** - * Creates a new InvoiceMessage instance using the specified properties. + * Creates a new ProductListInfo instance using the specified properties. * @param [properties] Properties to set - * @returns InvoiceMessage instance + * @returns ProductListInfo instance */ - public static create(properties?: proto.IInvoiceMessage): proto.InvoiceMessage; + public static create(properties?: proto.IProductListInfo): proto.ProductListInfo; /** - * Encodes the specified InvoiceMessage message. Does not implicitly {@link proto.InvoiceMessage.verify|verify} messages. - * @param message InvoiceMessage message or plain object to encode + * Encodes the specified ProductListInfo message. Does not implicitly {@link proto.ProductListInfo.verify|verify} messages. + * @param message ProductListInfo message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: proto.IInvoiceMessage, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: proto.IProductListInfo, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified InvoiceMessage message, length delimited. Does not implicitly {@link proto.InvoiceMessage.verify|verify} messages. - * @param message InvoiceMessage message or plain object to encode + * Encodes the specified ProductListInfo message, length delimited. Does not implicitly {@link proto.ProductListInfo.verify|verify} messages. + * @param message ProductListInfo message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: proto.IInvoiceMessage, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: proto.IProductListInfo, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an InvoiceMessage message from the specified reader or buffer. + * Decodes a ProductListInfo message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns InvoiceMessage + * @returns ProductListInfo * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.InvoiceMessage; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.ProductListInfo; /** - * Decodes an InvoiceMessage message from the specified reader or buffer, length delimited. + * Decodes a ProductListInfo message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns InvoiceMessage + * @returns ProductListInfo * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.InvoiceMessage; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.ProductListInfo; /** - * Verifies an InvoiceMessage message. + * Verifies a ProductListInfo message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates an InvoiceMessage message from a plain object. Also converts values to their respective internal types. + * Creates a ProductListInfo message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns InvoiceMessage + * @returns ProductListInfo */ - public static fromObject(object: { [k: string]: any }): proto.InvoiceMessage; + public static fromObject(object: { [k: string]: any }): proto.ProductListInfo; /** - * Creates a plain object from an InvoiceMessage message. Also converts values to other types if specified. - * @param message InvoiceMessage + * Creates a plain object from a ProductListInfo message. Also converts values to other types if specified. + * @param message ProductListInfo * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: proto.InvoiceMessage, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: proto.ProductListInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this InvoiceMessage to JSON. + * Converts this ProductListInfo to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - namespace InvoiceMessage { - - /** InvoiceMessageAttachmentType enum. */ - enum InvoiceMessageAttachmentType { - IMAGE = 0, - PDF = 1 - } - } + /** Properties of a ProductMessage. */ + interface IProductMessage { - /** Properties of a ContactMessage. */ - interface IContactMessage { + /** ProductMessage product */ + product?: (proto.IProductSnapshot|null); - /** ContactMessage displayName */ - displayName?: (string|null); + /** ProductMessage businessOwnerJid */ + businessOwnerJid?: (string|null); - /** ContactMessage vcard */ - vcard?: (string|null); + /** ProductMessage catalog */ + catalog?: (proto.ICatalogSnapshot|null); - /** ContactMessage contextInfo */ + /** ProductMessage body */ + body?: (string|null); + + /** ProductMessage footer */ + footer?: (string|null); + + /** ProductMessage contextInfo */ contextInfo?: (proto.IContextInfo|null); } - /** Represents a ContactMessage. */ - class ContactMessage implements IContactMessage { + /** Represents a ProductMessage. */ + class ProductMessage implements IProductMessage { /** - * Constructs a new ContactMessage. + * Constructs a new ProductMessage. * @param [properties] Properties to set */ - constructor(properties?: proto.IContactMessage); + constructor(properties?: proto.IProductMessage); - /** ContactMessage displayName. */ - public displayName: string; + /** ProductMessage product. */ + public product?: (proto.IProductSnapshot|null); - /** ContactMessage vcard. */ - public vcard: string; + /** ProductMessage businessOwnerJid. */ + public businessOwnerJid: string; - /** ContactMessage contextInfo. */ + /** ProductMessage catalog. */ + public catalog?: (proto.ICatalogSnapshot|null); + + /** ProductMessage body. */ + public body: string; + + /** ProductMessage footer. */ + public footer: string; + + /** ProductMessage contextInfo. */ public contextInfo?: (proto.IContextInfo|null); /** - * Creates a new ContactMessage instance using the specified properties. + * Creates a new ProductMessage instance using the specified properties. * @param [properties] Properties to set - * @returns ContactMessage instance + * @returns ProductMessage instance */ - public static create(properties?: proto.IContactMessage): proto.ContactMessage; + public static create(properties?: proto.IProductMessage): proto.ProductMessage; /** - * Encodes the specified ContactMessage message. Does not implicitly {@link proto.ContactMessage.verify|verify} messages. - * @param message ContactMessage message or plain object to encode + * Encodes the specified ProductMessage message. Does not implicitly {@link proto.ProductMessage.verify|verify} messages. + * @param message ProductMessage message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: proto.IContactMessage, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: proto.IProductMessage, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ContactMessage message, length delimited. Does not implicitly {@link proto.ContactMessage.verify|verify} messages. - * @param message ContactMessage message or plain object to encode + * Encodes the specified ProductMessage message, length delimited. Does not implicitly {@link proto.ProductMessage.verify|verify} messages. + * @param message ProductMessage message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: proto.IContactMessage, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: proto.IProductMessage, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ContactMessage message from the specified reader or buffer. + * Decodes a ProductMessage message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ContactMessage + * @returns ProductMessage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.ContactMessage; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.ProductMessage; /** - * Decodes a ContactMessage message from the specified reader or buffer, length delimited. + * Decodes a ProductMessage message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ContactMessage + * @returns ProductMessage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.ContactMessage; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.ProductMessage; /** - * Verifies a ContactMessage message. + * Verifies a ProductMessage message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a ContactMessage message from a plain object. Also converts values to their respective internal types. + * Creates a ProductMessage message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ContactMessage + * @returns ProductMessage */ - public static fromObject(object: { [k: string]: any }): proto.ContactMessage; + public static fromObject(object: { [k: string]: any }): proto.ProductMessage; /** - * Creates a plain object from a ContactMessage message. Also converts values to other types if specified. - * @param message ContactMessage + * Creates a plain object from a ProductMessage message. Also converts values to other types if specified. + * @param message ProductMessage * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: proto.ContactMessage, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: proto.ProductMessage, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ContactMessage to JSON. + * Converts this ProductMessage to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a LocationMessage. */ - interface ILocationMessage { - - /** LocationMessage degreesLatitude */ - degreesLatitude?: (number|null); - - /** LocationMessage degreesLongitude */ - degreesLongitude?: (number|null); - - /** LocationMessage name */ - name?: (string|null); - - /** LocationMessage address */ - address?: (string|null); - - /** LocationMessage url */ - url?: (string|null); - - /** LocationMessage isLive */ - isLive?: (boolean|null); - - /** LocationMessage accuracyInMeters */ - accuracyInMeters?: (number|null); - - /** LocationMessage speedInMps */ - speedInMps?: (number|null); - - /** LocationMessage degreesClockwiseFromMagneticNorth */ - degreesClockwiseFromMagneticNorth?: (number|null); - - /** LocationMessage comment */ - comment?: (string|null); + /** Properties of a ProductSection. */ + interface IProductSection { - /** LocationMessage jpegThumbnail */ - jpegThumbnail?: (Uint8Array|null); + /** ProductSection title */ + title?: (string|null); - /** LocationMessage contextInfo */ - contextInfo?: (proto.IContextInfo|null); + /** ProductSection products */ + products?: (proto.IProduct[]|null); } - /** Represents a LocationMessage. */ - class LocationMessage implements ILocationMessage { + /** Represents a ProductSection. */ + class ProductSection implements IProductSection { /** - * Constructs a new LocationMessage. + * Constructs a new ProductSection. * @param [properties] Properties to set */ - constructor(properties?: proto.ILocationMessage); - - /** LocationMessage degreesLatitude. */ - public degreesLatitude: number; - - /** LocationMessage degreesLongitude. */ - public degreesLongitude: number; - - /** LocationMessage name. */ - public name: string; - - /** LocationMessage address. */ - public address: string; - - /** LocationMessage url. */ - public url: string; - - /** LocationMessage isLive. */ - public isLive: boolean; - - /** LocationMessage accuracyInMeters. */ - public accuracyInMeters: number; - - /** LocationMessage speedInMps. */ - public speedInMps: number; - - /** LocationMessage degreesClockwiseFromMagneticNorth. */ - public degreesClockwiseFromMagneticNorth: number; - - /** LocationMessage comment. */ - public comment: string; + constructor(properties?: proto.IProductSection); - /** LocationMessage jpegThumbnail. */ - public jpegThumbnail: Uint8Array; + /** ProductSection title. */ + public title: string; - /** LocationMessage contextInfo. */ - public contextInfo?: (proto.IContextInfo|null); + /** ProductSection products. */ + public products: proto.IProduct[]; /** - * Creates a new LocationMessage instance using the specified properties. + * Creates a new ProductSection instance using the specified properties. * @param [properties] Properties to set - * @returns LocationMessage instance + * @returns ProductSection instance */ - public static create(properties?: proto.ILocationMessage): proto.LocationMessage; + public static create(properties?: proto.IProductSection): proto.ProductSection; /** - * Encodes the specified LocationMessage message. Does not implicitly {@link proto.LocationMessage.verify|verify} messages. - * @param message LocationMessage message or plain object to encode + * Encodes the specified ProductSection message. Does not implicitly {@link proto.ProductSection.verify|verify} messages. + * @param message ProductSection message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: proto.ILocationMessage, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: proto.IProductSection, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified LocationMessage message, length delimited. Does not implicitly {@link proto.LocationMessage.verify|verify} messages. - * @param message LocationMessage message or plain object to encode + * Encodes the specified ProductSection message, length delimited. Does not implicitly {@link proto.ProductSection.verify|verify} messages. + * @param message ProductSection message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: proto.ILocationMessage, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: proto.IProductSection, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a LocationMessage message from the specified reader or buffer. + * Decodes a ProductSection message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns LocationMessage + * @returns ProductSection * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.LocationMessage; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.ProductSection; /** - * Decodes a LocationMessage message from the specified reader or buffer, length delimited. + * Decodes a ProductSection message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns LocationMessage + * @returns ProductSection * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.LocationMessage; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.ProductSection; /** - * Verifies a LocationMessage message. + * Verifies a ProductSection message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a LocationMessage message from a plain object. Also converts values to their respective internal types. + * Creates a ProductSection message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns LocationMessage + * @returns ProductSection */ - public static fromObject(object: { [k: string]: any }): proto.LocationMessage; + public static fromObject(object: { [k: string]: any }): proto.ProductSection; /** - * Creates a plain object from a LocationMessage message. Also converts values to other types if specified. - * @param message LocationMessage + * Creates a plain object from a ProductSection message. Also converts values to other types if specified. + * @param message ProductSection * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: proto.LocationMessage, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: proto.ProductSection, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this LocationMessage to JSON. + * Converts this ProductSection to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of an ExtendedTextMessage. */ - interface IExtendedTextMessage { - - /** ExtendedTextMessage text */ - text?: (string|null); - - /** ExtendedTextMessage matchedText */ - matchedText?: (string|null); - - /** ExtendedTextMessage canonicalUrl */ - canonicalUrl?: (string|null); - - /** ExtendedTextMessage description */ - description?: (string|null); - - /** ExtendedTextMessage title */ - title?: (string|null); - - /** ExtendedTextMessage textArgb */ - textArgb?: (number|null); - - /** ExtendedTextMessage backgroundArgb */ - backgroundArgb?: (number|null); - - /** ExtendedTextMessage font */ - font?: (proto.ExtendedTextMessage.ExtendedTextMessageFontType|null); - - /** ExtendedTextMessage previewType */ - previewType?: (proto.ExtendedTextMessage.ExtendedTextMessagePreviewType|null); + /** Properties of a ProductSnapshot. */ + interface IProductSnapshot { - /** ExtendedTextMessage jpegThumbnail */ - jpegThumbnail?: (Uint8Array|null); + /** ProductSnapshot productImage */ + productImage?: (proto.IImageMessage|null); - /** ExtendedTextMessage contextInfo */ - contextInfo?: (proto.IContextInfo|null); + /** ProductSnapshot productId */ + productId?: (string|null); - /** ExtendedTextMessage doNotPlayInline */ - doNotPlayInline?: (boolean|null); + /** ProductSnapshot title */ + title?: (string|null); - /** ExtendedTextMessage thumbnailDirectPath */ - thumbnailDirectPath?: (string|null); + /** ProductSnapshot description */ + description?: (string|null); - /** ExtendedTextMessage thumbnailSha256 */ - thumbnailSha256?: (Uint8Array|null); + /** ProductSnapshot currencyCode */ + currencyCode?: (string|null); - /** ExtendedTextMessage thumbnailEncSha256 */ - thumbnailEncSha256?: (Uint8Array|null); + /** ProductSnapshot priceAmount1000 */ + priceAmount1000?: (number|Long|null); - /** ExtendedTextMessage mediaKey */ - mediaKey?: (Uint8Array|null); + /** ProductSnapshot retailerId */ + retailerId?: (string|null); - /** ExtendedTextMessage mediaKeyTimestamp */ - mediaKeyTimestamp?: (number|Long|null); + /** ProductSnapshot url */ + url?: (string|null); - /** ExtendedTextMessage thumbnailHeight */ - thumbnailHeight?: (number|null); + /** ProductSnapshot productImageCount */ + productImageCount?: (number|null); - /** ExtendedTextMessage thumbnailWidth */ - thumbnailWidth?: (number|null); + /** ProductSnapshot firstImageId */ + firstImageId?: (string|null); - /** ExtendedTextMessage inviteLinkGroupType */ - inviteLinkGroupType?: (proto.ExtendedTextMessage.ExtendedTextMessageInviteLinkGroupType|null); + /** ProductSnapshot salePriceAmount1000 */ + salePriceAmount1000?: (number|Long|null); } - /** Represents an ExtendedTextMessage. */ - class ExtendedTextMessage implements IExtendedTextMessage { + /** Represents a ProductSnapshot. */ + class ProductSnapshot implements IProductSnapshot { /** - * Constructs a new ExtendedTextMessage. + * Constructs a new ProductSnapshot. * @param [properties] Properties to set */ - constructor(properties?: proto.IExtendedTextMessage); - - /** ExtendedTextMessage text. */ - public text: string; - - /** ExtendedTextMessage matchedText. */ - public matchedText: string; + constructor(properties?: proto.IProductSnapshot); - /** ExtendedTextMessage canonicalUrl. */ - public canonicalUrl: string; + /** ProductSnapshot productImage. */ + public productImage?: (proto.IImageMessage|null); - /** ExtendedTextMessage description. */ - public description: string; + /** ProductSnapshot productId. */ + public productId: string; - /** ExtendedTextMessage title. */ + /** ProductSnapshot title. */ public title: string; - /** ExtendedTextMessage textArgb. */ - public textArgb: number; - - /** ExtendedTextMessage backgroundArgb. */ - public backgroundArgb: number; - - /** ExtendedTextMessage font. */ - public font: proto.ExtendedTextMessage.ExtendedTextMessageFontType; - - /** ExtendedTextMessage previewType. */ - public previewType: proto.ExtendedTextMessage.ExtendedTextMessagePreviewType; - - /** ExtendedTextMessage jpegThumbnail. */ - public jpegThumbnail: Uint8Array; - - /** ExtendedTextMessage contextInfo. */ - public contextInfo?: (proto.IContextInfo|null); - - /** ExtendedTextMessage doNotPlayInline. */ - public doNotPlayInline: boolean; - - /** ExtendedTextMessage thumbnailDirectPath. */ - public thumbnailDirectPath: string; + /** ProductSnapshot description. */ + public description: string; - /** ExtendedTextMessage thumbnailSha256. */ - public thumbnailSha256: Uint8Array; + /** ProductSnapshot currencyCode. */ + public currencyCode: string; - /** ExtendedTextMessage thumbnailEncSha256. */ - public thumbnailEncSha256: Uint8Array; + /** ProductSnapshot priceAmount1000. */ + public priceAmount1000: (number|Long); - /** ExtendedTextMessage mediaKey. */ - public mediaKey: Uint8Array; + /** ProductSnapshot retailerId. */ + public retailerId: string; - /** ExtendedTextMessage mediaKeyTimestamp. */ - public mediaKeyTimestamp: (number|Long); + /** ProductSnapshot url. */ + public url: string; - /** ExtendedTextMessage thumbnailHeight. */ - public thumbnailHeight: number; + /** ProductSnapshot productImageCount. */ + public productImageCount: number; - /** ExtendedTextMessage thumbnailWidth. */ - public thumbnailWidth: number; + /** ProductSnapshot firstImageId. */ + public firstImageId: string; - /** ExtendedTextMessage inviteLinkGroupType. */ - public inviteLinkGroupType: proto.ExtendedTextMessage.ExtendedTextMessageInviteLinkGroupType; + /** ProductSnapshot salePriceAmount1000. */ + public salePriceAmount1000: (number|Long); /** - * Creates a new ExtendedTextMessage instance using the specified properties. + * Creates a new ProductSnapshot instance using the specified properties. * @param [properties] Properties to set - * @returns ExtendedTextMessage instance + * @returns ProductSnapshot instance */ - public static create(properties?: proto.IExtendedTextMessage): proto.ExtendedTextMessage; + public static create(properties?: proto.IProductSnapshot): proto.ProductSnapshot; /** - * Encodes the specified ExtendedTextMessage message. Does not implicitly {@link proto.ExtendedTextMessage.verify|verify} messages. - * @param message ExtendedTextMessage message or plain object to encode + * Encodes the specified ProductSnapshot message. Does not implicitly {@link proto.ProductSnapshot.verify|verify} messages. + * @param message ProductSnapshot message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: proto.IExtendedTextMessage, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: proto.IProductSnapshot, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ExtendedTextMessage message, length delimited. Does not implicitly {@link proto.ExtendedTextMessage.verify|verify} messages. - * @param message ExtendedTextMessage message or plain object to encode + * Encodes the specified ProductSnapshot message, length delimited. Does not implicitly {@link proto.ProductSnapshot.verify|verify} messages. + * @param message ProductSnapshot message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: proto.IExtendedTextMessage, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: proto.IProductSnapshot, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an ExtendedTextMessage message from the specified reader or buffer. + * Decodes a ProductSnapshot message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ExtendedTextMessage + * @returns ProductSnapshot * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.ExtendedTextMessage; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.ProductSnapshot; /** - * Decodes an ExtendedTextMessage message from the specified reader or buffer, length delimited. + * Decodes a ProductSnapshot message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ExtendedTextMessage + * @returns ProductSnapshot * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.ExtendedTextMessage; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.ProductSnapshot; /** - * Verifies an ExtendedTextMessage message. + * Verifies a ProductSnapshot message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates an ExtendedTextMessage message from a plain object. Also converts values to their respective internal types. + * Creates a ProductSnapshot message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ExtendedTextMessage + * @returns ProductSnapshot */ - public static fromObject(object: { [k: string]: any }): proto.ExtendedTextMessage; + public static fromObject(object: { [k: string]: any }): proto.ProductSnapshot; /** - * Creates a plain object from an ExtendedTextMessage message. Also converts values to other types if specified. - * @param message ExtendedTextMessage + * Creates a plain object from a ProductSnapshot message. Also converts values to other types if specified. + * @param message ProductSnapshot * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: proto.ExtendedTextMessage, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: proto.ProductSnapshot, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ExtendedTextMessage to JSON. + * Converts this ProductSnapshot to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - namespace ExtendedTextMessage { - - /** ExtendedTextMessageFontType enum. */ - enum ExtendedTextMessageFontType { - SANS_SERIF = 0, - SERIF = 1, - NORICAN_REGULAR = 2, - BRYNDAN_WRITE = 3, - BEBASNEUE_REGULAR = 4, - OSWALD_HEAVY = 5 - } - - /** ExtendedTextMessagePreviewType enum. */ - enum ExtendedTextMessagePreviewType { - NONE = 0, - VIDEO = 1 - } - - /** ExtendedTextMessageInviteLinkGroupType enum. */ - enum ExtendedTextMessageInviteLinkGroupType { - DEFAULT = 0, - PARENT = 1 - } - } - - /** Properties of a DocumentMessage. */ - interface IDocumentMessage { - - /** DocumentMessage url */ - url?: (string|null); - - /** DocumentMessage mimetype */ - mimetype?: (string|null); - - /** DocumentMessage title */ - title?: (string|null); - - /** DocumentMessage fileSha256 */ - fileSha256?: (Uint8Array|null); - - /** DocumentMessage fileLength */ - fileLength?: (number|Long|null); - - /** DocumentMessage pageCount */ - pageCount?: (number|null); - - /** DocumentMessage mediaKey */ - mediaKey?: (Uint8Array|null); - - /** DocumentMessage fileName */ - fileName?: (string|null); - - /** DocumentMessage fileEncSha256 */ - fileEncSha256?: (Uint8Array|null); - - /** DocumentMessage directPath */ - directPath?: (string|null); - - /** DocumentMessage mediaKeyTimestamp */ - mediaKeyTimestamp?: (number|Long|null); - - /** DocumentMessage contactVcard */ - contactVcard?: (boolean|null); - - /** DocumentMessage thumbnailDirectPath */ - thumbnailDirectPath?: (string|null); - - /** DocumentMessage thumbnailSha256 */ - thumbnailSha256?: (Uint8Array|null); - - /** DocumentMessage thumbnailEncSha256 */ - thumbnailEncSha256?: (Uint8Array|null); - - /** DocumentMessage jpegThumbnail */ - jpegThumbnail?: (Uint8Array|null); - - /** DocumentMessage contextInfo */ - contextInfo?: (proto.IContextInfo|null); - - /** DocumentMessage thumbnailHeight */ - thumbnailHeight?: (number|null); + /** Properties of a ProtocolMessage. */ + interface IProtocolMessage { - /** DocumentMessage thumbnailWidth */ - thumbnailWidth?: (number|null); - } + /** ProtocolMessage key */ + key?: (proto.IMessageKey|null); - /** Represents a DocumentMessage. */ - class DocumentMessage implements IDocumentMessage { + /** ProtocolMessage type */ + type?: (proto.ProtocolMessage.ProtocolMessageType|null); - /** - * Constructs a new DocumentMessage. - * @param [properties] Properties to set - */ - constructor(properties?: proto.IDocumentMessage); + /** ProtocolMessage ephemeralExpiration */ + ephemeralExpiration?: (number|null); - /** DocumentMessage url. */ - public url: string; + /** ProtocolMessage ephemeralSettingTimestamp */ + ephemeralSettingTimestamp?: (number|Long|null); - /** DocumentMessage mimetype. */ - public mimetype: string; + /** ProtocolMessage historySyncNotification */ + historySyncNotification?: (proto.IHistorySyncNotification|null); - /** DocumentMessage title. */ - public title: string; + /** ProtocolMessage appStateSyncKeyShare */ + appStateSyncKeyShare?: (proto.IAppStateSyncKeyShare|null); - /** DocumentMessage fileSha256. */ - public fileSha256: Uint8Array; + /** ProtocolMessage appStateSyncKeyRequest */ + appStateSyncKeyRequest?: (proto.IAppStateSyncKeyRequest|null); - /** DocumentMessage fileLength. */ - public fileLength: (number|Long); + /** ProtocolMessage initialSecurityNotificationSettingSync */ + initialSecurityNotificationSettingSync?: (proto.IInitialSecurityNotificationSettingSync|null); - /** DocumentMessage pageCount. */ - public pageCount: number; + /** ProtocolMessage appStateFatalExceptionNotification */ + appStateFatalExceptionNotification?: (proto.IAppStateFatalExceptionNotification|null); - /** DocumentMessage mediaKey. */ - public mediaKey: Uint8Array; + /** ProtocolMessage disappearingMode */ + disappearingMode?: (proto.IDisappearingMode|null); + } - /** DocumentMessage fileName. */ - public fileName: string; + /** Represents a ProtocolMessage. */ + class ProtocolMessage implements IProtocolMessage { - /** DocumentMessage fileEncSha256. */ - public fileEncSha256: Uint8Array; + /** + * Constructs a new ProtocolMessage. + * @param [properties] Properties to set + */ + constructor(properties?: proto.IProtocolMessage); - /** DocumentMessage directPath. */ - public directPath: string; + /** ProtocolMessage key. */ + public key?: (proto.IMessageKey|null); - /** DocumentMessage mediaKeyTimestamp. */ - public mediaKeyTimestamp: (number|Long); + /** ProtocolMessage type. */ + public type: proto.ProtocolMessage.ProtocolMessageType; - /** DocumentMessage contactVcard. */ - public contactVcard: boolean; + /** ProtocolMessage ephemeralExpiration. */ + public ephemeralExpiration: number; - /** DocumentMessage thumbnailDirectPath. */ - public thumbnailDirectPath: string; + /** ProtocolMessage ephemeralSettingTimestamp. */ + public ephemeralSettingTimestamp: (number|Long); - /** DocumentMessage thumbnailSha256. */ - public thumbnailSha256: Uint8Array; + /** ProtocolMessage historySyncNotification. */ + public historySyncNotification?: (proto.IHistorySyncNotification|null); - /** DocumentMessage thumbnailEncSha256. */ - public thumbnailEncSha256: Uint8Array; + /** ProtocolMessage appStateSyncKeyShare. */ + public appStateSyncKeyShare?: (proto.IAppStateSyncKeyShare|null); - /** DocumentMessage jpegThumbnail. */ - public jpegThumbnail: Uint8Array; + /** ProtocolMessage appStateSyncKeyRequest. */ + public appStateSyncKeyRequest?: (proto.IAppStateSyncKeyRequest|null); - /** DocumentMessage contextInfo. */ - public contextInfo?: (proto.IContextInfo|null); + /** ProtocolMessage initialSecurityNotificationSettingSync. */ + public initialSecurityNotificationSettingSync?: (proto.IInitialSecurityNotificationSettingSync|null); - /** DocumentMessage thumbnailHeight. */ - public thumbnailHeight: number; + /** ProtocolMessage appStateFatalExceptionNotification. */ + public appStateFatalExceptionNotification?: (proto.IAppStateFatalExceptionNotification|null); - /** DocumentMessage thumbnailWidth. */ - public thumbnailWidth: number; + /** ProtocolMessage disappearingMode. */ + public disappearingMode?: (proto.IDisappearingMode|null); /** - * Creates a new DocumentMessage instance using the specified properties. + * Creates a new ProtocolMessage instance using the specified properties. * @param [properties] Properties to set - * @returns DocumentMessage instance + * @returns ProtocolMessage instance */ - public static create(properties?: proto.IDocumentMessage): proto.DocumentMessage; + public static create(properties?: proto.IProtocolMessage): proto.ProtocolMessage; /** - * Encodes the specified DocumentMessage message. Does not implicitly {@link proto.DocumentMessage.verify|verify} messages. - * @param message DocumentMessage message or plain object to encode + * Encodes the specified ProtocolMessage message. Does not implicitly {@link proto.ProtocolMessage.verify|verify} messages. + * @param message ProtocolMessage message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: proto.IDocumentMessage, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: proto.IProtocolMessage, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified DocumentMessage message, length delimited. Does not implicitly {@link proto.DocumentMessage.verify|verify} messages. - * @param message DocumentMessage message or plain object to encode + * Encodes the specified ProtocolMessage message, length delimited. Does not implicitly {@link proto.ProtocolMessage.verify|verify} messages. + * @param message ProtocolMessage message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: proto.IDocumentMessage, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: proto.IProtocolMessage, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a DocumentMessage message from the specified reader or buffer. + * Decodes a ProtocolMessage message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns DocumentMessage + * @returns ProtocolMessage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.DocumentMessage; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.ProtocolMessage; /** - * Decodes a DocumentMessage message from the specified reader or buffer, length delimited. + * Decodes a ProtocolMessage message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns DocumentMessage + * @returns ProtocolMessage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.DocumentMessage; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.ProtocolMessage; /** - * Verifies a DocumentMessage message. + * Verifies a ProtocolMessage message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a DocumentMessage message from a plain object. Also converts values to their respective internal types. + * Creates a ProtocolMessage message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns DocumentMessage + * @returns ProtocolMessage */ - public static fromObject(object: { [k: string]: any }): proto.DocumentMessage; + public static fromObject(object: { [k: string]: any }): proto.ProtocolMessage; /** - * Creates a plain object from a DocumentMessage message. Also converts values to other types if specified. - * @param message DocumentMessage + * Creates a plain object from a ProtocolMessage message. Also converts values to other types if specified. + * @param message ProtocolMessage * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: proto.DocumentMessage, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: proto.ProtocolMessage, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this DocumentMessage to JSON. + * Converts this ProtocolMessage to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of an AudioMessage. */ - interface IAudioMessage { + namespace ProtocolMessage { - /** AudioMessage url */ - url?: (string|null); + /** ProtocolMessageType enum. */ + enum ProtocolMessageType { + REVOKE = 0, + EPHEMERAL_SETTING = 3, + EPHEMERAL_SYNC_RESPONSE = 4, + HISTORY_SYNC_NOTIFICATION = 5, + APP_STATE_SYNC_KEY_SHARE = 6, + APP_STATE_SYNC_KEY_REQUEST = 7, + MSG_FANOUT_BACKFILL_REQUEST = 8, + INITIAL_SECURITY_NOTIFICATION_SETTING_SYNC = 9, + APP_STATE_FATAL_EXCEPTION_NOTIFICATION = 10 + } + } - /** AudioMessage mimetype */ - mimetype?: (string|null); + /** Properties of a QuickReplyButton. */ + interface IQuickReplyButton { - /** AudioMessage fileSha256 */ - fileSha256?: (Uint8Array|null); + /** QuickReplyButton displayText */ + displayText?: (proto.IHighlyStructuredMessage|null); - /** AudioMessage fileLength */ - fileLength?: (number|Long|null); + /** QuickReplyButton id */ + id?: (string|null); + } - /** AudioMessage seconds */ - seconds?: (number|null); + /** Represents a QuickReplyButton. */ + class QuickReplyButton implements IQuickReplyButton { - /** AudioMessage ptt */ - ptt?: (boolean|null); + /** + * Constructs a new QuickReplyButton. + * @param [properties] Properties to set + */ + constructor(properties?: proto.IQuickReplyButton); - /** AudioMessage mediaKey */ - mediaKey?: (Uint8Array|null); + /** QuickReplyButton displayText. */ + public displayText?: (proto.IHighlyStructuredMessage|null); - /** AudioMessage fileEncSha256 */ - fileEncSha256?: (Uint8Array|null); + /** QuickReplyButton id. */ + public id: string; - /** AudioMessage directPath */ - directPath?: (string|null); + /** + * Creates a new QuickReplyButton instance using the specified properties. + * @param [properties] Properties to set + * @returns QuickReplyButton instance + */ + public static create(properties?: proto.IQuickReplyButton): proto.QuickReplyButton; - /** AudioMessage mediaKeyTimestamp */ - mediaKeyTimestamp?: (number|Long|null); + /** + * Encodes the specified QuickReplyButton message. Does not implicitly {@link proto.QuickReplyButton.verify|verify} messages. + * @param message QuickReplyButton message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: proto.IQuickReplyButton, writer?: $protobuf.Writer): $protobuf.Writer; - /** AudioMessage contextInfo */ - contextInfo?: (proto.IContextInfo|null); + /** + * Encodes the specified QuickReplyButton message, length delimited. Does not implicitly {@link proto.QuickReplyButton.verify|verify} messages. + * @param message QuickReplyButton message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: proto.IQuickReplyButton, writer?: $protobuf.Writer): $protobuf.Writer; - /** AudioMessage streamingSidecar */ - streamingSidecar?: (Uint8Array|null); + /** + * Decodes a QuickReplyButton message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns QuickReplyButton + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.QuickReplyButton; - /** AudioMessage waveform */ - waveform?: (Uint8Array|null); - } + /** + * Decodes a QuickReplyButton message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns QuickReplyButton + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.QuickReplyButton; - /** Represents an AudioMessage. */ - class AudioMessage implements IAudioMessage { + /** + * Verifies a QuickReplyButton message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a QuickReplyButton message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns QuickReplyButton + */ + public static fromObject(object: { [k: string]: any }): proto.QuickReplyButton; + + /** + * Creates a plain object from a QuickReplyButton message. Also converts values to other types if specified. + * @param message QuickReplyButton + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: proto.QuickReplyButton, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Constructs a new AudioMessage. - * @param [properties] Properties to set + * Converts this QuickReplyButton to JSON. + * @returns JSON object */ - constructor(properties?: proto.IAudioMessage); - - /** AudioMessage url. */ - public url: string; - - /** AudioMessage mimetype. */ - public mimetype: string; + public toJSON(): { [k: string]: any }; + } - /** AudioMessage fileSha256. */ - public fileSha256: Uint8Array; + /** Properties of a ReactionMessage. */ + interface IReactionMessage { - /** AudioMessage fileLength. */ - public fileLength: (number|Long); + /** ReactionMessage key */ + key?: (proto.IMessageKey|null); - /** AudioMessage seconds. */ - public seconds: number; + /** ReactionMessage text */ + text?: (string|null); - /** AudioMessage ptt. */ - public ptt: boolean; + /** ReactionMessage groupingKey */ + groupingKey?: (string|null); - /** AudioMessage mediaKey. */ - public mediaKey: Uint8Array; + /** ReactionMessage senderTimestampMs */ + senderTimestampMs?: (number|Long|null); + } - /** AudioMessage fileEncSha256. */ - public fileEncSha256: Uint8Array; + /** Represents a ReactionMessage. */ + class ReactionMessage implements IReactionMessage { - /** AudioMessage directPath. */ - public directPath: string; + /** + * Constructs a new ReactionMessage. + * @param [properties] Properties to set + */ + constructor(properties?: proto.IReactionMessage); - /** AudioMessage mediaKeyTimestamp. */ - public mediaKeyTimestamp: (number|Long); + /** ReactionMessage key. */ + public key?: (proto.IMessageKey|null); - /** AudioMessage contextInfo. */ - public contextInfo?: (proto.IContextInfo|null); + /** ReactionMessage text. */ + public text: string; - /** AudioMessage streamingSidecar. */ - public streamingSidecar: Uint8Array; + /** ReactionMessage groupingKey. */ + public groupingKey: string; - /** AudioMessage waveform. */ - public waveform: Uint8Array; + /** ReactionMessage senderTimestampMs. */ + public senderTimestampMs: (number|Long); /** - * Creates a new AudioMessage instance using the specified properties. + * Creates a new ReactionMessage instance using the specified properties. * @param [properties] Properties to set - * @returns AudioMessage instance + * @returns ReactionMessage instance */ - public static create(properties?: proto.IAudioMessage): proto.AudioMessage; + public static create(properties?: proto.IReactionMessage): proto.ReactionMessage; /** - * Encodes the specified AudioMessage message. Does not implicitly {@link proto.AudioMessage.verify|verify} messages. - * @param message AudioMessage message or plain object to encode + * Encodes the specified ReactionMessage message. Does not implicitly {@link proto.ReactionMessage.verify|verify} messages. + * @param message ReactionMessage message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: proto.IAudioMessage, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: proto.IReactionMessage, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified AudioMessage message, length delimited. Does not implicitly {@link proto.AudioMessage.verify|verify} messages. - * @param message AudioMessage message or plain object to encode + * Encodes the specified ReactionMessage message, length delimited. Does not implicitly {@link proto.ReactionMessage.verify|verify} messages. + * @param message ReactionMessage message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: proto.IAudioMessage, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: proto.IReactionMessage, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an AudioMessage message from the specified reader or buffer. + * Decodes a ReactionMessage message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns AudioMessage + * @returns ReactionMessage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.AudioMessage; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.ReactionMessage; /** - * Decodes an AudioMessage message from the specified reader or buffer, length delimited. + * Decodes a ReactionMessage message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns AudioMessage + * @returns ReactionMessage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.AudioMessage; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.ReactionMessage; /** - * Verifies an AudioMessage message. + * Verifies a ReactionMessage message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates an AudioMessage message from a plain object. Also converts values to their respective internal types. + * Creates a ReactionMessage message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns AudioMessage + * @returns ReactionMessage */ - public static fromObject(object: { [k: string]: any }): proto.AudioMessage; + public static fromObject(object: { [k: string]: any }): proto.ReactionMessage; /** - * Creates a plain object from an AudioMessage message. Also converts values to other types if specified. - * @param message AudioMessage + * Creates a plain object from a ReactionMessage message. Also converts values to other types if specified. + * @param message ReactionMessage * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: proto.AudioMessage, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: proto.ReactionMessage, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this AudioMessage to JSON. + * Converts this ReactionMessage to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a VideoMessage. */ - interface IVideoMessage { - - /** VideoMessage url */ - url?: (string|null); - - /** VideoMessage mimetype */ - mimetype?: (string|null); - - /** VideoMessage fileSha256 */ - fileSha256?: (Uint8Array|null); - - /** VideoMessage fileLength */ - fileLength?: (number|Long|null); - - /** VideoMessage seconds */ - seconds?: (number|null); - - /** VideoMessage mediaKey */ - mediaKey?: (Uint8Array|null); - - /** VideoMessage caption */ - caption?: (string|null); - - /** VideoMessage gifPlayback */ - gifPlayback?: (boolean|null); + /** Properties of a RequestPaymentMessage. */ + interface IRequestPaymentMessage { - /** VideoMessage height */ - height?: (number|null); + /** RequestPaymentMessage noteMessage */ + noteMessage?: (proto.IMessage|null); - /** VideoMessage width */ - width?: (number|null); + /** RequestPaymentMessage currencyCodeIso4217 */ + currencyCodeIso4217?: (string|null); - /** VideoMessage fileEncSha256 */ - fileEncSha256?: (Uint8Array|null); + /** RequestPaymentMessage amount1000 */ + amount1000?: (number|Long|null); - /** VideoMessage interactiveAnnotations */ - interactiveAnnotations?: (proto.IInteractiveAnnotation[]|null); + /** RequestPaymentMessage requestFrom */ + requestFrom?: (string|null); - /** VideoMessage directPath */ - directPath?: (string|null); + /** RequestPaymentMessage expiryTimestamp */ + expiryTimestamp?: (number|Long|null); - /** VideoMessage mediaKeyTimestamp */ - mediaKeyTimestamp?: (number|Long|null); + /** RequestPaymentMessage amount */ + amount?: (proto.IMoney|null); - /** VideoMessage jpegThumbnail */ - jpegThumbnail?: (Uint8Array|null); + /** RequestPaymentMessage background */ + background?: (proto.IPaymentBackground|null); + } - /** VideoMessage contextInfo */ - contextInfo?: (proto.IContextInfo|null); + /** Represents a RequestPaymentMessage. */ + class RequestPaymentMessage implements IRequestPaymentMessage { - /** VideoMessage streamingSidecar */ - streamingSidecar?: (Uint8Array|null); + /** + * Constructs a new RequestPaymentMessage. + * @param [properties] Properties to set + */ + constructor(properties?: proto.IRequestPaymentMessage); - /** VideoMessage gifAttribution */ - gifAttribution?: (proto.VideoMessage.VideoMessageAttribution|null); + /** RequestPaymentMessage noteMessage. */ + public noteMessage?: (proto.IMessage|null); - /** VideoMessage viewOnce */ - viewOnce?: (boolean|null); + /** RequestPaymentMessage currencyCodeIso4217. */ + public currencyCodeIso4217: string; - /** VideoMessage thumbnailDirectPath */ - thumbnailDirectPath?: (string|null); + /** RequestPaymentMessage amount1000. */ + public amount1000: (number|Long); - /** VideoMessage thumbnailSha256 */ - thumbnailSha256?: (Uint8Array|null); + /** RequestPaymentMessage requestFrom. */ + public requestFrom: string; - /** VideoMessage thumbnailEncSha256 */ - thumbnailEncSha256?: (Uint8Array|null); + /** RequestPaymentMessage expiryTimestamp. */ + public expiryTimestamp: (number|Long); - /** VideoMessage staticUrl */ - staticUrl?: (string|null); - } + /** RequestPaymentMessage amount. */ + public amount?: (proto.IMoney|null); - /** Represents a VideoMessage. */ - class VideoMessage implements IVideoMessage { + /** RequestPaymentMessage background. */ + public background?: (proto.IPaymentBackground|null); /** - * Constructs a new VideoMessage. + * Creates a new RequestPaymentMessage instance using the specified properties. * @param [properties] Properties to set + * @returns RequestPaymentMessage instance */ - constructor(properties?: proto.IVideoMessage); - - /** VideoMessage url. */ - public url: string; - - /** VideoMessage mimetype. */ - public mimetype: string; - - /** VideoMessage fileSha256. */ - public fileSha256: Uint8Array; - - /** VideoMessage fileLength. */ - public fileLength: (number|Long); - - /** VideoMessage seconds. */ - public seconds: number; - - /** VideoMessage mediaKey. */ - public mediaKey: Uint8Array; + public static create(properties?: proto.IRequestPaymentMessage): proto.RequestPaymentMessage; - /** VideoMessage caption. */ - public caption: string; + /** + * Encodes the specified RequestPaymentMessage message. Does not implicitly {@link proto.RequestPaymentMessage.verify|verify} messages. + * @param message RequestPaymentMessage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: proto.IRequestPaymentMessage, writer?: $protobuf.Writer): $protobuf.Writer; - /** VideoMessage gifPlayback. */ - public gifPlayback: boolean; + /** + * Encodes the specified RequestPaymentMessage message, length delimited. Does not implicitly {@link proto.RequestPaymentMessage.verify|verify} messages. + * @param message RequestPaymentMessage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: proto.IRequestPaymentMessage, writer?: $protobuf.Writer): $protobuf.Writer; - /** VideoMessage height. */ - public height: number; + /** + * Decodes a RequestPaymentMessage message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RequestPaymentMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.RequestPaymentMessage; - /** VideoMessage width. */ - public width: number; + /** + * Decodes a RequestPaymentMessage message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RequestPaymentMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.RequestPaymentMessage; - /** VideoMessage fileEncSha256. */ - public fileEncSha256: Uint8Array; + /** + * Verifies a RequestPaymentMessage message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** VideoMessage interactiveAnnotations. */ - public interactiveAnnotations: proto.IInteractiveAnnotation[]; + /** + * Creates a RequestPaymentMessage message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RequestPaymentMessage + */ + public static fromObject(object: { [k: string]: any }): proto.RequestPaymentMessage; - /** VideoMessage directPath. */ - public directPath: string; + /** + * Creates a plain object from a RequestPaymentMessage message. Also converts values to other types if specified. + * @param message RequestPaymentMessage + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: proto.RequestPaymentMessage, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** VideoMessage mediaKeyTimestamp. */ - public mediaKeyTimestamp: (number|Long); + /** + * Converts this RequestPaymentMessage to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** VideoMessage jpegThumbnail. */ - public jpegThumbnail: Uint8Array; + /** Properties of a Row. */ + interface IRow { - /** VideoMessage contextInfo. */ - public contextInfo?: (proto.IContextInfo|null); + /** Row title */ + title?: (string|null); - /** VideoMessage streamingSidecar. */ - public streamingSidecar: Uint8Array; + /** Row description */ + description?: (string|null); - /** VideoMessage gifAttribution. */ - public gifAttribution: proto.VideoMessage.VideoMessageAttribution; + /** Row rowId */ + rowId?: (string|null); + } - /** VideoMessage viewOnce. */ - public viewOnce: boolean; + /** Represents a Row. */ + class Row implements IRow { - /** VideoMessage thumbnailDirectPath. */ - public thumbnailDirectPath: string; + /** + * Constructs a new Row. + * @param [properties] Properties to set + */ + constructor(properties?: proto.IRow); - /** VideoMessage thumbnailSha256. */ - public thumbnailSha256: Uint8Array; + /** Row title. */ + public title: string; - /** VideoMessage thumbnailEncSha256. */ - public thumbnailEncSha256: Uint8Array; + /** Row description. */ + public description: string; - /** VideoMessage staticUrl. */ - public staticUrl: string; + /** Row rowId. */ + public rowId: string; /** - * Creates a new VideoMessage instance using the specified properties. + * Creates a new Row instance using the specified properties. * @param [properties] Properties to set - * @returns VideoMessage instance + * @returns Row instance */ - public static create(properties?: proto.IVideoMessage): proto.VideoMessage; + public static create(properties?: proto.IRow): proto.Row; /** - * Encodes the specified VideoMessage message. Does not implicitly {@link proto.VideoMessage.verify|verify} messages. - * @param message VideoMessage message or plain object to encode + * Encodes the specified Row message. Does not implicitly {@link proto.Row.verify|verify} messages. + * @param message Row message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: proto.IVideoMessage, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: proto.IRow, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified VideoMessage message, length delimited. Does not implicitly {@link proto.VideoMessage.verify|verify} messages. - * @param message VideoMessage message or plain object to encode + * Encodes the specified Row message, length delimited. Does not implicitly {@link proto.Row.verify|verify} messages. + * @param message Row message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: proto.IVideoMessage, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: proto.IRow, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a VideoMessage message from the specified reader or buffer. + * Decodes a Row message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns VideoMessage + * @returns Row * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.VideoMessage; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.Row; /** - * Decodes a VideoMessage message from the specified reader or buffer, length delimited. + * Decodes a Row message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns VideoMessage + * @returns Row * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.VideoMessage; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.Row; /** - * Verifies a VideoMessage message. + * Verifies a Row message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a VideoMessage message from a plain object. Also converts values to their respective internal types. + * Creates a Row message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns VideoMessage + * @returns Row */ - public static fromObject(object: { [k: string]: any }): proto.VideoMessage; + public static fromObject(object: { [k: string]: any }): proto.Row; /** - * Creates a plain object from a VideoMessage message. Also converts values to other types if specified. - * @param message VideoMessage + * Creates a plain object from a Row message. Also converts values to other types if specified. + * @param message Row * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: proto.VideoMessage, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: proto.Row, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this VideoMessage to JSON. + * Converts this Row to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - namespace VideoMessage { - - /** VideoMessageAttribution enum. */ - enum VideoMessageAttribution { - NONE = 0, - GIPHY = 1, - TENOR = 2 - } - } - - /** Properties of a Call. */ - interface ICall { - - /** Call callKey */ - callKey?: (Uint8Array|null); - - /** Call conversionSource */ - conversionSource?: (string|null); + /** Properties of a Section. */ + interface ISection { - /** Call conversionData */ - conversionData?: (Uint8Array|null); + /** Section title */ + title?: (string|null); - /** Call conversionDelaySeconds */ - conversionDelaySeconds?: (number|null); + /** Section rows */ + rows?: (proto.IRow[]|null); } - /** Represents a Call. */ - class Call implements ICall { + /** Represents a Section. */ + class Section implements ISection { /** - * Constructs a new Call. + * Constructs a new Section. * @param [properties] Properties to set */ - constructor(properties?: proto.ICall); - - /** Call callKey. */ - public callKey: Uint8Array; - - /** Call conversionSource. */ - public conversionSource: string; + constructor(properties?: proto.ISection); - /** Call conversionData. */ - public conversionData: Uint8Array; + /** Section title. */ + public title: string; - /** Call conversionDelaySeconds. */ - public conversionDelaySeconds: number; + /** Section rows. */ + public rows: proto.IRow[]; /** - * Creates a new Call instance using the specified properties. + * Creates a new Section instance using the specified properties. * @param [properties] Properties to set - * @returns Call instance + * @returns Section instance */ - public static create(properties?: proto.ICall): proto.Call; + public static create(properties?: proto.ISection): proto.Section; /** - * Encodes the specified Call message. Does not implicitly {@link proto.Call.verify|verify} messages. - * @param message Call message or plain object to encode + * Encodes the specified Section message. Does not implicitly {@link proto.Section.verify|verify} messages. + * @param message Section message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: proto.ICall, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: proto.ISection, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified Call message, length delimited. Does not implicitly {@link proto.Call.verify|verify} messages. - * @param message Call message or plain object to encode + * Encodes the specified Section message, length delimited. Does not implicitly {@link proto.Section.verify|verify} messages. + * @param message Section message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: proto.ICall, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: proto.ISection, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a Call message from the specified reader or buffer. + * Decodes a Section message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns Call + * @returns Section * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.Call; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.Section; /** - * Decodes a Call message from the specified reader or buffer, length delimited. + * Decodes a Section message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Call + * @returns Section * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.Call; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.Section; /** - * Verifies a Call message. + * Verifies a Section message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a Call message from a plain object. Also converts values to their respective internal types. + * Creates a Section message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Call + * @returns Section */ - public static fromObject(object: { [k: string]: any }): proto.Call; + public static fromObject(object: { [k: string]: any }): proto.Section; /** - * Creates a plain object from a Call message. Also converts values to other types if specified. - * @param message Call + * Creates a plain object from a Section message. Also converts values to other types if specified. + * @param message Section * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: proto.Call, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: proto.Section, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Call to JSON. + * Converts this Section to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a Chat. */ - interface IChat { + /** Properties of a SenderKeyDistributionMessage. */ + interface ISenderKeyDistributionMessage { - /** Chat displayName */ - displayName?: (string|null); + /** SenderKeyDistributionMessage groupId */ + groupId?: (string|null); - /** Chat id */ - id?: (string|null); + /** SenderKeyDistributionMessage axolotlSenderKeyDistributionMessage */ + axolotlSenderKeyDistributionMessage?: (Uint8Array|null); } - /** Represents a Chat. */ - class Chat implements IChat { + /** Represents a SenderKeyDistributionMessage. */ + class SenderKeyDistributionMessage implements ISenderKeyDistributionMessage { /** - * Constructs a new Chat. + * Constructs a new SenderKeyDistributionMessage. * @param [properties] Properties to set */ - constructor(properties?: proto.IChat); + constructor(properties?: proto.ISenderKeyDistributionMessage); - /** Chat displayName. */ - public displayName: string; + /** SenderKeyDistributionMessage groupId. */ + public groupId: string; - /** Chat id. */ - public id: string; + /** SenderKeyDistributionMessage axolotlSenderKeyDistributionMessage. */ + public axolotlSenderKeyDistributionMessage: Uint8Array; /** - * Creates a new Chat instance using the specified properties. + * Creates a new SenderKeyDistributionMessage instance using the specified properties. * @param [properties] Properties to set - * @returns Chat instance + * @returns SenderKeyDistributionMessage instance */ - public static create(properties?: proto.IChat): proto.Chat; + public static create(properties?: proto.ISenderKeyDistributionMessage): proto.SenderKeyDistributionMessage; /** - * Encodes the specified Chat message. Does not implicitly {@link proto.Chat.verify|verify} messages. - * @param message Chat message or plain object to encode + * Encodes the specified SenderKeyDistributionMessage message. Does not implicitly {@link proto.SenderKeyDistributionMessage.verify|verify} messages. + * @param message SenderKeyDistributionMessage message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: proto.IChat, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: proto.ISenderKeyDistributionMessage, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified Chat message, length delimited. Does not implicitly {@link proto.Chat.verify|verify} messages. - * @param message Chat message or plain object to encode + * Encodes the specified SenderKeyDistributionMessage message, length delimited. Does not implicitly {@link proto.SenderKeyDistributionMessage.verify|verify} messages. + * @param message SenderKeyDistributionMessage message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: proto.IChat, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: proto.ISenderKeyDistributionMessage, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a Chat message from the specified reader or buffer. + * Decodes a SenderKeyDistributionMessage message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns Chat + * @returns SenderKeyDistributionMessage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.Chat; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.SenderKeyDistributionMessage; /** - * Decodes a Chat message from the specified reader or buffer, length delimited. + * Decodes a SenderKeyDistributionMessage message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Chat + * @returns SenderKeyDistributionMessage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.Chat; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.SenderKeyDistributionMessage; /** - * Verifies a Chat message. + * Verifies a SenderKeyDistributionMessage message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a Chat message from a plain object. Also converts values to their respective internal types. + * Creates a SenderKeyDistributionMessage message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Chat + * @returns SenderKeyDistributionMessage */ - public static fromObject(object: { [k: string]: any }): proto.Chat; + public static fromObject(object: { [k: string]: any }): proto.SenderKeyDistributionMessage; /** - * Creates a plain object from a Chat message. Also converts values to other types if specified. - * @param message Chat + * Creates a plain object from a SenderKeyDistributionMessage message. Also converts values to other types if specified. + * @param message SenderKeyDistributionMessage * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: proto.Chat, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: proto.SenderKeyDistributionMessage, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Chat to JSON. + * Converts this SenderKeyDistributionMessage to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a ProtocolMessage. */ - interface IProtocolMessage { - - /** ProtocolMessage key */ - key?: (proto.IMessageKey|null); - - /** ProtocolMessage type */ - type?: (proto.ProtocolMessage.ProtocolMessageType|null); - - /** ProtocolMessage ephemeralExpiration */ - ephemeralExpiration?: (number|null); - - /** ProtocolMessage ephemeralSettingTimestamp */ - ephemeralSettingTimestamp?: (number|Long|null); - - /** ProtocolMessage historySyncNotification */ - historySyncNotification?: (proto.IHistorySyncNotification|null); - - /** ProtocolMessage appStateSyncKeyShare */ - appStateSyncKeyShare?: (proto.IAppStateSyncKeyShare|null); - - /** ProtocolMessage appStateSyncKeyRequest */ - appStateSyncKeyRequest?: (proto.IAppStateSyncKeyRequest|null); + /** Properties of a SendPaymentMessage. */ + interface ISendPaymentMessage { - /** ProtocolMessage initialSecurityNotificationSettingSync */ - initialSecurityNotificationSettingSync?: (proto.IInitialSecurityNotificationSettingSync|null); + /** SendPaymentMessage noteMessage */ + noteMessage?: (proto.IMessage|null); - /** ProtocolMessage appStateFatalExceptionNotification */ - appStateFatalExceptionNotification?: (proto.IAppStateFatalExceptionNotification|null); + /** SendPaymentMessage requestMessageKey */ + requestMessageKey?: (proto.IMessageKey|null); - /** ProtocolMessage disappearingMode */ - disappearingMode?: (proto.IDisappearingMode|null); + /** SendPaymentMessage background */ + background?: (proto.IPaymentBackground|null); } - /** Represents a ProtocolMessage. */ - class ProtocolMessage implements IProtocolMessage { + /** Represents a SendPaymentMessage. */ + class SendPaymentMessage implements ISendPaymentMessage { /** - * Constructs a new ProtocolMessage. + * Constructs a new SendPaymentMessage. * @param [properties] Properties to set */ - constructor(properties?: proto.IProtocolMessage); - - /** ProtocolMessage key. */ - public key?: (proto.IMessageKey|null); - - /** ProtocolMessage type. */ - public type: proto.ProtocolMessage.ProtocolMessageType; - - /** ProtocolMessage ephemeralExpiration. */ - public ephemeralExpiration: number; - - /** ProtocolMessage ephemeralSettingTimestamp. */ - public ephemeralSettingTimestamp: (number|Long); - - /** ProtocolMessage historySyncNotification. */ - public historySyncNotification?: (proto.IHistorySyncNotification|null); - - /** ProtocolMessage appStateSyncKeyShare. */ - public appStateSyncKeyShare?: (proto.IAppStateSyncKeyShare|null); - - /** ProtocolMessage appStateSyncKeyRequest. */ - public appStateSyncKeyRequest?: (proto.IAppStateSyncKeyRequest|null); + constructor(properties?: proto.ISendPaymentMessage); - /** ProtocolMessage initialSecurityNotificationSettingSync. */ - public initialSecurityNotificationSettingSync?: (proto.IInitialSecurityNotificationSettingSync|null); + /** SendPaymentMessage noteMessage. */ + public noteMessage?: (proto.IMessage|null); - /** ProtocolMessage appStateFatalExceptionNotification. */ - public appStateFatalExceptionNotification?: (proto.IAppStateFatalExceptionNotification|null); + /** SendPaymentMessage requestMessageKey. */ + public requestMessageKey?: (proto.IMessageKey|null); - /** ProtocolMessage disappearingMode. */ - public disappearingMode?: (proto.IDisappearingMode|null); + /** SendPaymentMessage background. */ + public background?: (proto.IPaymentBackground|null); /** - * Creates a new ProtocolMessage instance using the specified properties. + * Creates a new SendPaymentMessage instance using the specified properties. * @param [properties] Properties to set - * @returns ProtocolMessage instance + * @returns SendPaymentMessage instance */ - public static create(properties?: proto.IProtocolMessage): proto.ProtocolMessage; + public static create(properties?: proto.ISendPaymentMessage): proto.SendPaymentMessage; /** - * Encodes the specified ProtocolMessage message. Does not implicitly {@link proto.ProtocolMessage.verify|verify} messages. - * @param message ProtocolMessage message or plain object to encode + * Encodes the specified SendPaymentMessage message. Does not implicitly {@link proto.SendPaymentMessage.verify|verify} messages. + * @param message SendPaymentMessage message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: proto.IProtocolMessage, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: proto.ISendPaymentMessage, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ProtocolMessage message, length delimited. Does not implicitly {@link proto.ProtocolMessage.verify|verify} messages. - * @param message ProtocolMessage message or plain object to encode + * Encodes the specified SendPaymentMessage message, length delimited. Does not implicitly {@link proto.SendPaymentMessage.verify|verify} messages. + * @param message SendPaymentMessage message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: proto.IProtocolMessage, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: proto.ISendPaymentMessage, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ProtocolMessage message from the specified reader or buffer. + * Decodes a SendPaymentMessage message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ProtocolMessage + * @returns SendPaymentMessage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.ProtocolMessage; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.SendPaymentMessage; /** - * Decodes a ProtocolMessage message from the specified reader or buffer, length delimited. + * Decodes a SendPaymentMessage message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ProtocolMessage + * @returns SendPaymentMessage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.ProtocolMessage; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.SendPaymentMessage; /** - * Verifies a ProtocolMessage message. + * Verifies a SendPaymentMessage message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a ProtocolMessage message from a plain object. Also converts values to their respective internal types. + * Creates a SendPaymentMessage message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ProtocolMessage + * @returns SendPaymentMessage */ - public static fromObject(object: { [k: string]: any }): proto.ProtocolMessage; + public static fromObject(object: { [k: string]: any }): proto.SendPaymentMessage; /** - * Creates a plain object from a ProtocolMessage message. Also converts values to other types if specified. - * @param message ProtocolMessage + * Creates a plain object from a SendPaymentMessage message. Also converts values to other types if specified. + * @param message SendPaymentMessage * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: proto.ProtocolMessage, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: proto.SendPaymentMessage, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ProtocolMessage to JSON. + * Converts this SendPaymentMessage to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - namespace ProtocolMessage { - - /** ProtocolMessageType enum. */ - enum ProtocolMessageType { - REVOKE = 0, - EPHEMERAL_SETTING = 3, - EPHEMERAL_SYNC_RESPONSE = 4, - HISTORY_SYNC_NOTIFICATION = 5, - APP_STATE_SYNC_KEY_SHARE = 6, - APP_STATE_SYNC_KEY_REQUEST = 7, - MSG_FANOUT_BACKFILL_REQUEST = 8, - INITIAL_SECURITY_NOTIFICATION_SETTING_SYNC = 9, - APP_STATE_FATAL_EXCEPTION_NOTIFICATION = 10 - } - } - - /** Properties of a HistorySyncNotification. */ - interface IHistorySyncNotification { - - /** HistorySyncNotification fileSha256 */ - fileSha256?: (Uint8Array|null); - - /** HistorySyncNotification fileLength */ - fileLength?: (number|Long|null); - - /** HistorySyncNotification mediaKey */ - mediaKey?: (Uint8Array|null); - - /** HistorySyncNotification fileEncSha256 */ - fileEncSha256?: (Uint8Array|null); - - /** HistorySyncNotification directPath */ - directPath?: (string|null); + /** Properties of a ShopMessage. */ + interface IShopMessage { - /** HistorySyncNotification syncType */ - syncType?: (proto.HistorySyncNotification.HistorySyncNotificationHistorySyncType|null); + /** ShopMessage id */ + id?: (string|null); - /** HistorySyncNotification chunkOrder */ - chunkOrder?: (number|null); + /** ShopMessage surface */ + surface?: (proto.ShopMessage.ShopMessageSurface|null); - /** HistorySyncNotification originalMessageId */ - originalMessageId?: (string|null); + /** ShopMessage messageVersion */ + messageVersion?: (number|null); } - /** Represents a HistorySyncNotification. */ - class HistorySyncNotification implements IHistorySyncNotification { + /** Represents a ShopMessage. */ + class ShopMessage implements IShopMessage { /** - * Constructs a new HistorySyncNotification. + * Constructs a new ShopMessage. * @param [properties] Properties to set */ - constructor(properties?: proto.IHistorySyncNotification); - - /** HistorySyncNotification fileSha256. */ - public fileSha256: Uint8Array; - - /** HistorySyncNotification fileLength. */ - public fileLength: (number|Long); - - /** HistorySyncNotification mediaKey. */ - public mediaKey: Uint8Array; - - /** HistorySyncNotification fileEncSha256. */ - public fileEncSha256: Uint8Array; - - /** HistorySyncNotification directPath. */ - public directPath: string; + constructor(properties?: proto.IShopMessage); - /** HistorySyncNotification syncType. */ - public syncType: proto.HistorySyncNotification.HistorySyncNotificationHistorySyncType; + /** ShopMessage id. */ + public id: string; - /** HistorySyncNotification chunkOrder. */ - public chunkOrder: number; + /** ShopMessage surface. */ + public surface: proto.ShopMessage.ShopMessageSurface; - /** HistorySyncNotification originalMessageId. */ - public originalMessageId: string; + /** ShopMessage messageVersion. */ + public messageVersion: number; /** - * Creates a new HistorySyncNotification instance using the specified properties. + * Creates a new ShopMessage instance using the specified properties. * @param [properties] Properties to set - * @returns HistorySyncNotification instance + * @returns ShopMessage instance */ - public static create(properties?: proto.IHistorySyncNotification): proto.HistorySyncNotification; + public static create(properties?: proto.IShopMessage): proto.ShopMessage; /** - * Encodes the specified HistorySyncNotification message. Does not implicitly {@link proto.HistorySyncNotification.verify|verify} messages. - * @param message HistorySyncNotification message or plain object to encode + * Encodes the specified ShopMessage message. Does not implicitly {@link proto.ShopMessage.verify|verify} messages. + * @param message ShopMessage message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: proto.IHistorySyncNotification, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: proto.IShopMessage, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified HistorySyncNotification message, length delimited. Does not implicitly {@link proto.HistorySyncNotification.verify|verify} messages. - * @param message HistorySyncNotification message or plain object to encode + * Encodes the specified ShopMessage message, length delimited. Does not implicitly {@link proto.ShopMessage.verify|verify} messages. + * @param message ShopMessage message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: proto.IHistorySyncNotification, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: proto.IShopMessage, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a HistorySyncNotification message from the specified reader or buffer. + * Decodes a ShopMessage message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns HistorySyncNotification + * @returns ShopMessage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.HistorySyncNotification; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.ShopMessage; /** - * Decodes a HistorySyncNotification message from the specified reader or buffer, length delimited. + * Decodes a ShopMessage message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns HistorySyncNotification + * @returns ShopMessage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.HistorySyncNotification; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.ShopMessage; /** - * Verifies a HistorySyncNotification message. + * Verifies a ShopMessage message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a HistorySyncNotification message from a plain object. Also converts values to their respective internal types. + * Creates a ShopMessage message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns HistorySyncNotification + * @returns ShopMessage */ - public static fromObject(object: { [k: string]: any }): proto.HistorySyncNotification; + public static fromObject(object: { [k: string]: any }): proto.ShopMessage; /** - * Creates a plain object from a HistorySyncNotification message. Also converts values to other types if specified. - * @param message HistorySyncNotification + * Creates a plain object from a ShopMessage message. Also converts values to other types if specified. + * @param message ShopMessage * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: proto.HistorySyncNotification, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: proto.ShopMessage, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this HistorySyncNotification to JSON. + * Converts this ShopMessage to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - namespace HistorySyncNotification { + namespace ShopMessage { - /** HistorySyncNotificationHistorySyncType enum. */ - enum HistorySyncNotificationHistorySyncType { - INITIAL_BOOTSTRAP = 0, - INITIAL_STATUS_V3 = 1, - FULL = 2, - RECENT = 3, - PUSH_NAME = 4 + /** ShopMessageSurface enum. */ + enum ShopMessageSurface { + UNKNOWN_SURFACE = 0, + FB = 1, + IG = 2, + WA = 3 } } - /** Properties of an AppStateSyncKey. */ - interface IAppStateSyncKey { - - /** AppStateSyncKey keyId */ - keyId?: (proto.IAppStateSyncKeyId|null); + /** Properties of a SingleSelectReply. */ + interface ISingleSelectReply { - /** AppStateSyncKey keyData */ - keyData?: (proto.IAppStateSyncKeyData|null); + /** SingleSelectReply selectedRowId */ + selectedRowId?: (string|null); } - /** Represents an AppStateSyncKey. */ - class AppStateSyncKey implements IAppStateSyncKey { + /** Represents a SingleSelectReply. */ + class SingleSelectReply implements ISingleSelectReply { /** - * Constructs a new AppStateSyncKey. + * Constructs a new SingleSelectReply. * @param [properties] Properties to set */ - constructor(properties?: proto.IAppStateSyncKey); - - /** AppStateSyncKey keyId. */ - public keyId?: (proto.IAppStateSyncKeyId|null); + constructor(properties?: proto.ISingleSelectReply); - /** AppStateSyncKey keyData. */ - public keyData?: (proto.IAppStateSyncKeyData|null); + /** SingleSelectReply selectedRowId. */ + public selectedRowId: string; /** - * Creates a new AppStateSyncKey instance using the specified properties. + * Creates a new SingleSelectReply instance using the specified properties. * @param [properties] Properties to set - * @returns AppStateSyncKey instance + * @returns SingleSelectReply instance */ - public static create(properties?: proto.IAppStateSyncKey): proto.AppStateSyncKey; + public static create(properties?: proto.ISingleSelectReply): proto.SingleSelectReply; /** - * Encodes the specified AppStateSyncKey message. Does not implicitly {@link proto.AppStateSyncKey.verify|verify} messages. - * @param message AppStateSyncKey message or plain object to encode + * Encodes the specified SingleSelectReply message. Does not implicitly {@link proto.SingleSelectReply.verify|verify} messages. + * @param message SingleSelectReply message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: proto.IAppStateSyncKey, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: proto.ISingleSelectReply, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified AppStateSyncKey message, length delimited. Does not implicitly {@link proto.AppStateSyncKey.verify|verify} messages. - * @param message AppStateSyncKey message or plain object to encode + * Encodes the specified SingleSelectReply message, length delimited. Does not implicitly {@link proto.SingleSelectReply.verify|verify} messages. + * @param message SingleSelectReply message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: proto.IAppStateSyncKey, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: proto.ISingleSelectReply, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an AppStateSyncKey message from the specified reader or buffer. + * Decodes a SingleSelectReply message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns AppStateSyncKey + * @returns SingleSelectReply * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.AppStateSyncKey; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.SingleSelectReply; /** - * Decodes an AppStateSyncKey message from the specified reader or buffer, length delimited. + * Decodes a SingleSelectReply message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns AppStateSyncKey + * @returns SingleSelectReply * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.AppStateSyncKey; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.SingleSelectReply; /** - * Verifies an AppStateSyncKey message. + * Verifies a SingleSelectReply message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates an AppStateSyncKey message from a plain object. Also converts values to their respective internal types. + * Creates a SingleSelectReply message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns AppStateSyncKey + * @returns SingleSelectReply */ - public static fromObject(object: { [k: string]: any }): proto.AppStateSyncKey; + public static fromObject(object: { [k: string]: any }): proto.SingleSelectReply; /** - * Creates a plain object from an AppStateSyncKey message. Also converts values to other types if specified. - * @param message AppStateSyncKey + * Creates a plain object from a SingleSelectReply message. Also converts values to other types if specified. + * @param message SingleSelectReply * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: proto.AppStateSyncKey, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: proto.SingleSelectReply, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this AppStateSyncKey to JSON. + * Converts this SingleSelectReply to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of an AppStateSyncKeyId. */ - interface IAppStateSyncKeyId { + /** Properties of a StickerMessage. */ + interface IStickerMessage { - /** AppStateSyncKeyId keyId */ - keyId?: (Uint8Array|null); + /** StickerMessage url */ + url?: (string|null); + + /** StickerMessage fileSha256 */ + fileSha256?: (Uint8Array|null); + + /** StickerMessage fileEncSha256 */ + fileEncSha256?: (Uint8Array|null); + + /** StickerMessage mediaKey */ + mediaKey?: (Uint8Array|null); + + /** StickerMessage mimetype */ + mimetype?: (string|null); + + /** StickerMessage height */ + height?: (number|null); + + /** StickerMessage width */ + width?: (number|null); + + /** StickerMessage directPath */ + directPath?: (string|null); + + /** StickerMessage fileLength */ + fileLength?: (number|Long|null); + + /** StickerMessage mediaKeyTimestamp */ + mediaKeyTimestamp?: (number|Long|null); + + /** StickerMessage firstFrameLength */ + firstFrameLength?: (number|null); + + /** StickerMessage firstFrameSidecar */ + firstFrameSidecar?: (Uint8Array|null); + + /** StickerMessage isAnimated */ + isAnimated?: (boolean|null); + + /** StickerMessage pngThumbnail */ + pngThumbnail?: (Uint8Array|null); + + /** StickerMessage contextInfo */ + contextInfo?: (proto.IContextInfo|null); } - /** Represents an AppStateSyncKeyId. */ - class AppStateSyncKeyId implements IAppStateSyncKeyId { + /** Represents a StickerMessage. */ + class StickerMessage implements IStickerMessage { /** - * Constructs a new AppStateSyncKeyId. + * Constructs a new StickerMessage. * @param [properties] Properties to set */ - constructor(properties?: proto.IAppStateSyncKeyId); + constructor(properties?: proto.IStickerMessage); - /** AppStateSyncKeyId keyId. */ - public keyId: Uint8Array; + /** StickerMessage url. */ + public url: string; + + /** StickerMessage fileSha256. */ + public fileSha256: Uint8Array; + + /** StickerMessage fileEncSha256. */ + public fileEncSha256: Uint8Array; + + /** StickerMessage mediaKey. */ + public mediaKey: Uint8Array; + + /** StickerMessage mimetype. */ + public mimetype: string; + + /** StickerMessage height. */ + public height: number; + + /** StickerMessage width. */ + public width: number; + + /** StickerMessage directPath. */ + public directPath: string; + + /** StickerMessage fileLength. */ + public fileLength: (number|Long); + + /** StickerMessage mediaKeyTimestamp. */ + public mediaKeyTimestamp: (number|Long); + + /** StickerMessage firstFrameLength. */ + public firstFrameLength: number; + + /** StickerMessage firstFrameSidecar. */ + public firstFrameSidecar: Uint8Array; + + /** StickerMessage isAnimated. */ + public isAnimated: boolean; + + /** StickerMessage pngThumbnail. */ + public pngThumbnail: Uint8Array; + + /** StickerMessage contextInfo. */ + public contextInfo?: (proto.IContextInfo|null); /** - * Creates a new AppStateSyncKeyId instance using the specified properties. + * Creates a new StickerMessage instance using the specified properties. * @param [properties] Properties to set - * @returns AppStateSyncKeyId instance + * @returns StickerMessage instance */ - public static create(properties?: proto.IAppStateSyncKeyId): proto.AppStateSyncKeyId; + public static create(properties?: proto.IStickerMessage): proto.StickerMessage; /** - * Encodes the specified AppStateSyncKeyId message. Does not implicitly {@link proto.AppStateSyncKeyId.verify|verify} messages. - * @param message AppStateSyncKeyId message or plain object to encode + * Encodes the specified StickerMessage message. Does not implicitly {@link proto.StickerMessage.verify|verify} messages. + * @param message StickerMessage message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: proto.IAppStateSyncKeyId, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: proto.IStickerMessage, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified AppStateSyncKeyId message, length delimited. Does not implicitly {@link proto.AppStateSyncKeyId.verify|verify} messages. - * @param message AppStateSyncKeyId message or plain object to encode + * Encodes the specified StickerMessage message, length delimited. Does not implicitly {@link proto.StickerMessage.verify|verify} messages. + * @param message StickerMessage message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: proto.IAppStateSyncKeyId, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: proto.IStickerMessage, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an AppStateSyncKeyId message from the specified reader or buffer. + * Decodes a StickerMessage message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns AppStateSyncKeyId + * @returns StickerMessage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.AppStateSyncKeyId; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.StickerMessage; /** - * Decodes an AppStateSyncKeyId message from the specified reader or buffer, length delimited. + * Decodes a StickerMessage message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns AppStateSyncKeyId + * @returns StickerMessage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.AppStateSyncKeyId; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.StickerMessage; /** - * Verifies an AppStateSyncKeyId message. + * Verifies a StickerMessage message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates an AppStateSyncKeyId message from a plain object. Also converts values to their respective internal types. + * Creates a StickerMessage message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns AppStateSyncKeyId + * @returns StickerMessage */ - public static fromObject(object: { [k: string]: any }): proto.AppStateSyncKeyId; + public static fromObject(object: { [k: string]: any }): proto.StickerMessage; /** - * Creates a plain object from an AppStateSyncKeyId message. Also converts values to other types if specified. - * @param message AppStateSyncKeyId + * Creates a plain object from a StickerMessage message. Also converts values to other types if specified. + * @param message StickerMessage * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: proto.AppStateSyncKeyId, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: proto.StickerMessage, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this AppStateSyncKeyId to JSON. + * Converts this StickerMessage to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of an AppStateSyncKeyFingerprint. */ - interface IAppStateSyncKeyFingerprint { + /** Properties of a StickerSyncRMRMessage. */ + interface IStickerSyncRMRMessage { - /** AppStateSyncKeyFingerprint rawId */ - rawId?: (number|null); + /** StickerSyncRMRMessage filehash */ + filehash?: (string[]|null); - /** AppStateSyncKeyFingerprint currentIndex */ - currentIndex?: (number|null); + /** StickerSyncRMRMessage rmrSource */ + rmrSource?: (string|null); - /** AppStateSyncKeyFingerprint deviceIndexes */ - deviceIndexes?: (number[]|null); + /** StickerSyncRMRMessage requestTimestamp */ + requestTimestamp?: (number|Long|null); } - /** Represents an AppStateSyncKeyFingerprint. */ - class AppStateSyncKeyFingerprint implements IAppStateSyncKeyFingerprint { + /** Represents a StickerSyncRMRMessage. */ + class StickerSyncRMRMessage implements IStickerSyncRMRMessage { /** - * Constructs a new AppStateSyncKeyFingerprint. + * Constructs a new StickerSyncRMRMessage. * @param [properties] Properties to set */ - constructor(properties?: proto.IAppStateSyncKeyFingerprint); + constructor(properties?: proto.IStickerSyncRMRMessage); - /** AppStateSyncKeyFingerprint rawId. */ - public rawId: number; + /** StickerSyncRMRMessage filehash. */ + public filehash: string[]; - /** AppStateSyncKeyFingerprint currentIndex. */ - public currentIndex: number; + /** StickerSyncRMRMessage rmrSource. */ + public rmrSource: string; - /** AppStateSyncKeyFingerprint deviceIndexes. */ - public deviceIndexes: number[]; + /** StickerSyncRMRMessage requestTimestamp. */ + public requestTimestamp: (number|Long); /** - * Creates a new AppStateSyncKeyFingerprint instance using the specified properties. + * Creates a new StickerSyncRMRMessage instance using the specified properties. * @param [properties] Properties to set - * @returns AppStateSyncKeyFingerprint instance + * @returns StickerSyncRMRMessage instance */ - public static create(properties?: proto.IAppStateSyncKeyFingerprint): proto.AppStateSyncKeyFingerprint; + public static create(properties?: proto.IStickerSyncRMRMessage): proto.StickerSyncRMRMessage; /** - * Encodes the specified AppStateSyncKeyFingerprint message. Does not implicitly {@link proto.AppStateSyncKeyFingerprint.verify|verify} messages. - * @param message AppStateSyncKeyFingerprint message or plain object to encode + * Encodes the specified StickerSyncRMRMessage message. Does not implicitly {@link proto.StickerSyncRMRMessage.verify|verify} messages. + * @param message StickerSyncRMRMessage message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: proto.IAppStateSyncKeyFingerprint, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: proto.IStickerSyncRMRMessage, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified AppStateSyncKeyFingerprint message, length delimited. Does not implicitly {@link proto.AppStateSyncKeyFingerprint.verify|verify} messages. - * @param message AppStateSyncKeyFingerprint message or plain object to encode + * Encodes the specified StickerSyncRMRMessage message, length delimited. Does not implicitly {@link proto.StickerSyncRMRMessage.verify|verify} messages. + * @param message StickerSyncRMRMessage message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: proto.IAppStateSyncKeyFingerprint, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: proto.IStickerSyncRMRMessage, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an AppStateSyncKeyFingerprint message from the specified reader or buffer. + * Decodes a StickerSyncRMRMessage message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns AppStateSyncKeyFingerprint + * @returns StickerSyncRMRMessage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.AppStateSyncKeyFingerprint; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.StickerSyncRMRMessage; /** - * Decodes an AppStateSyncKeyFingerprint message from the specified reader or buffer, length delimited. + * Decodes a StickerSyncRMRMessage message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns AppStateSyncKeyFingerprint + * @returns StickerSyncRMRMessage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.AppStateSyncKeyFingerprint; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.StickerSyncRMRMessage; /** - * Verifies an AppStateSyncKeyFingerprint message. + * Verifies a StickerSyncRMRMessage message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates an AppStateSyncKeyFingerprint message from a plain object. Also converts values to their respective internal types. + * Creates a StickerSyncRMRMessage message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns AppStateSyncKeyFingerprint + * @returns StickerSyncRMRMessage */ - public static fromObject(object: { [k: string]: any }): proto.AppStateSyncKeyFingerprint; + public static fromObject(object: { [k: string]: any }): proto.StickerSyncRMRMessage; /** - * Creates a plain object from an AppStateSyncKeyFingerprint message. Also converts values to other types if specified. - * @param message AppStateSyncKeyFingerprint + * Creates a plain object from a StickerSyncRMRMessage message. Also converts values to other types if specified. + * @param message StickerSyncRMRMessage * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: proto.AppStateSyncKeyFingerprint, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: proto.StickerSyncRMRMessage, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this AppStateSyncKeyFingerprint to JSON. + * Converts this StickerSyncRMRMessage to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of an AppStateSyncKeyData. */ - interface IAppStateSyncKeyData { + /** Properties of a TemplateButton. */ + interface ITemplateButton { - /** AppStateSyncKeyData keyData */ - keyData?: (Uint8Array|null); + /** TemplateButton index */ + index?: (number|null); - /** AppStateSyncKeyData fingerprint */ - fingerprint?: (proto.IAppStateSyncKeyFingerprint|null); + /** TemplateButton quickReplyButton */ + quickReplyButton?: (proto.IQuickReplyButton|null); - /** AppStateSyncKeyData timestamp */ - timestamp?: (number|Long|null); + /** TemplateButton urlButton */ + urlButton?: (proto.IURLButton|null); + + /** TemplateButton callButton */ + callButton?: (proto.ICallButton|null); } - /** Represents an AppStateSyncKeyData. */ - class AppStateSyncKeyData implements IAppStateSyncKeyData { + /** Represents a TemplateButton. */ + class TemplateButton implements ITemplateButton { /** - * Constructs a new AppStateSyncKeyData. + * Constructs a new TemplateButton. * @param [properties] Properties to set */ - constructor(properties?: proto.IAppStateSyncKeyData); + constructor(properties?: proto.ITemplateButton); - /** AppStateSyncKeyData keyData. */ - public keyData: Uint8Array; + /** TemplateButton index. */ + public index: number; - /** AppStateSyncKeyData fingerprint. */ - public fingerprint?: (proto.IAppStateSyncKeyFingerprint|null); + /** TemplateButton quickReplyButton. */ + public quickReplyButton?: (proto.IQuickReplyButton|null); - /** AppStateSyncKeyData timestamp. */ - public timestamp: (number|Long); + /** TemplateButton urlButton. */ + public urlButton?: (proto.IURLButton|null); + + /** TemplateButton callButton. */ + public callButton?: (proto.ICallButton|null); + + /** TemplateButton button. */ + public button?: ("quickReplyButton"|"urlButton"|"callButton"); /** - * Creates a new AppStateSyncKeyData instance using the specified properties. + * Creates a new TemplateButton instance using the specified properties. * @param [properties] Properties to set - * @returns AppStateSyncKeyData instance + * @returns TemplateButton instance */ - public static create(properties?: proto.IAppStateSyncKeyData): proto.AppStateSyncKeyData; + public static create(properties?: proto.ITemplateButton): proto.TemplateButton; /** - * Encodes the specified AppStateSyncKeyData message. Does not implicitly {@link proto.AppStateSyncKeyData.verify|verify} messages. - * @param message AppStateSyncKeyData message or plain object to encode + * Encodes the specified TemplateButton message. Does not implicitly {@link proto.TemplateButton.verify|verify} messages. + * @param message TemplateButton message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: proto.IAppStateSyncKeyData, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: proto.ITemplateButton, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified AppStateSyncKeyData message, length delimited. Does not implicitly {@link proto.AppStateSyncKeyData.verify|verify} messages. - * @param message AppStateSyncKeyData message or plain object to encode + * Encodes the specified TemplateButton message, length delimited. Does not implicitly {@link proto.TemplateButton.verify|verify} messages. + * @param message TemplateButton message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: proto.IAppStateSyncKeyData, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: proto.ITemplateButton, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an AppStateSyncKeyData message from the specified reader or buffer. + * Decodes a TemplateButton message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns AppStateSyncKeyData + * @returns TemplateButton * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.AppStateSyncKeyData; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.TemplateButton; /** - * Decodes an AppStateSyncKeyData message from the specified reader or buffer, length delimited. + * Decodes a TemplateButton message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns AppStateSyncKeyData + * @returns TemplateButton * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.AppStateSyncKeyData; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.TemplateButton; /** - * Verifies an AppStateSyncKeyData message. + * Verifies a TemplateButton message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates an AppStateSyncKeyData message from a plain object. Also converts values to their respective internal types. + * Creates a TemplateButton message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns AppStateSyncKeyData + * @returns TemplateButton */ - public static fromObject(object: { [k: string]: any }): proto.AppStateSyncKeyData; + public static fromObject(object: { [k: string]: any }): proto.TemplateButton; /** - * Creates a plain object from an AppStateSyncKeyData message. Also converts values to other types if specified. - * @param message AppStateSyncKeyData + * Creates a plain object from a TemplateButton message. Also converts values to other types if specified. + * @param message TemplateButton * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: proto.AppStateSyncKeyData, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: proto.TemplateButton, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this AppStateSyncKeyData to JSON. + * Converts this TemplateButton to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of an AppStateSyncKeyShare. */ - interface IAppStateSyncKeyShare { + /** Properties of a TemplateButtonReplyMessage. */ + interface ITemplateButtonReplyMessage { - /** AppStateSyncKeyShare keys */ - keys?: (proto.IAppStateSyncKey[]|null); + /** TemplateButtonReplyMessage selectedId */ + selectedId?: (string|null); + + /** TemplateButtonReplyMessage selectedDisplayText */ + selectedDisplayText?: (string|null); + + /** TemplateButtonReplyMessage contextInfo */ + contextInfo?: (proto.IContextInfo|null); + + /** TemplateButtonReplyMessage selectedIndex */ + selectedIndex?: (number|null); } - /** Represents an AppStateSyncKeyShare. */ - class AppStateSyncKeyShare implements IAppStateSyncKeyShare { + /** Represents a TemplateButtonReplyMessage. */ + class TemplateButtonReplyMessage implements ITemplateButtonReplyMessage { /** - * Constructs a new AppStateSyncKeyShare. + * Constructs a new TemplateButtonReplyMessage. * @param [properties] Properties to set */ - constructor(properties?: proto.IAppStateSyncKeyShare); + constructor(properties?: proto.ITemplateButtonReplyMessage); - /** AppStateSyncKeyShare keys. */ - public keys: proto.IAppStateSyncKey[]; + /** TemplateButtonReplyMessage selectedId. */ + public selectedId: string; + + /** TemplateButtonReplyMessage selectedDisplayText. */ + public selectedDisplayText: string; + + /** TemplateButtonReplyMessage contextInfo. */ + public contextInfo?: (proto.IContextInfo|null); + + /** TemplateButtonReplyMessage selectedIndex. */ + public selectedIndex: number; /** - * Creates a new AppStateSyncKeyShare instance using the specified properties. + * Creates a new TemplateButtonReplyMessage instance using the specified properties. * @param [properties] Properties to set - * @returns AppStateSyncKeyShare instance + * @returns TemplateButtonReplyMessage instance */ - public static create(properties?: proto.IAppStateSyncKeyShare): proto.AppStateSyncKeyShare; + public static create(properties?: proto.ITemplateButtonReplyMessage): proto.TemplateButtonReplyMessage; /** - * Encodes the specified AppStateSyncKeyShare message. Does not implicitly {@link proto.AppStateSyncKeyShare.verify|verify} messages. - * @param message AppStateSyncKeyShare message or plain object to encode + * Encodes the specified TemplateButtonReplyMessage message. Does not implicitly {@link proto.TemplateButtonReplyMessage.verify|verify} messages. + * @param message TemplateButtonReplyMessage message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: proto.IAppStateSyncKeyShare, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: proto.ITemplateButtonReplyMessage, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified AppStateSyncKeyShare message, length delimited. Does not implicitly {@link proto.AppStateSyncKeyShare.verify|verify} messages. - * @param message AppStateSyncKeyShare message or plain object to encode + * Encodes the specified TemplateButtonReplyMessage message, length delimited. Does not implicitly {@link proto.TemplateButtonReplyMessage.verify|verify} messages. + * @param message TemplateButtonReplyMessage message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: proto.IAppStateSyncKeyShare, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: proto.ITemplateButtonReplyMessage, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an AppStateSyncKeyShare message from the specified reader or buffer. + * Decodes a TemplateButtonReplyMessage message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns AppStateSyncKeyShare + * @returns TemplateButtonReplyMessage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.AppStateSyncKeyShare; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.TemplateButtonReplyMessage; /** - * Decodes an AppStateSyncKeyShare message from the specified reader or buffer, length delimited. + * Decodes a TemplateButtonReplyMessage message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns AppStateSyncKeyShare + * @returns TemplateButtonReplyMessage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.AppStateSyncKeyShare; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.TemplateButtonReplyMessage; /** - * Verifies an AppStateSyncKeyShare message. + * Verifies a TemplateButtonReplyMessage message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates an AppStateSyncKeyShare message from a plain object. Also converts values to their respective internal types. + * Creates a TemplateButtonReplyMessage message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns AppStateSyncKeyShare + * @returns TemplateButtonReplyMessage */ - public static fromObject(object: { [k: string]: any }): proto.AppStateSyncKeyShare; + public static fromObject(object: { [k: string]: any }): proto.TemplateButtonReplyMessage; /** - * Creates a plain object from an AppStateSyncKeyShare message. Also converts values to other types if specified. - * @param message AppStateSyncKeyShare + * Creates a plain object from a TemplateButtonReplyMessage message. Also converts values to other types if specified. + * @param message TemplateButtonReplyMessage * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: proto.AppStateSyncKeyShare, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: proto.TemplateButtonReplyMessage, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this AppStateSyncKeyShare to JSON. + * Converts this TemplateButtonReplyMessage to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of an AppStateSyncKeyRequest. */ - interface IAppStateSyncKeyRequest { + /** Properties of a TemplateMessage. */ + interface ITemplateMessage { - /** AppStateSyncKeyRequest keyIds */ - keyIds?: (proto.IAppStateSyncKeyId[]|null); + /** TemplateMessage contextInfo */ + contextInfo?: (proto.IContextInfo|null); + + /** TemplateMessage hydratedTemplate */ + hydratedTemplate?: (proto.IHydratedFourRowTemplate|null); + + /** TemplateMessage fourRowTemplate */ + fourRowTemplate?: (proto.IFourRowTemplate|null); + + /** TemplateMessage hydratedFourRowTemplate */ + hydratedFourRowTemplate?: (proto.IHydratedFourRowTemplate|null); } - /** Represents an AppStateSyncKeyRequest. */ - class AppStateSyncKeyRequest implements IAppStateSyncKeyRequest { + /** Represents a TemplateMessage. */ + class TemplateMessage implements ITemplateMessage { /** - * Constructs a new AppStateSyncKeyRequest. + * Constructs a new TemplateMessage. * @param [properties] Properties to set */ - constructor(properties?: proto.IAppStateSyncKeyRequest); + constructor(properties?: proto.ITemplateMessage); - /** AppStateSyncKeyRequest keyIds. */ - public keyIds: proto.IAppStateSyncKeyId[]; + /** TemplateMessage contextInfo. */ + public contextInfo?: (proto.IContextInfo|null); + + /** TemplateMessage hydratedTemplate. */ + public hydratedTemplate?: (proto.IHydratedFourRowTemplate|null); + + /** TemplateMessage fourRowTemplate. */ + public fourRowTemplate?: (proto.IFourRowTemplate|null); + + /** TemplateMessage hydratedFourRowTemplate. */ + public hydratedFourRowTemplate?: (proto.IHydratedFourRowTemplate|null); + + /** TemplateMessage format. */ + public format?: ("fourRowTemplate"|"hydratedFourRowTemplate"); /** - * Creates a new AppStateSyncKeyRequest instance using the specified properties. + * Creates a new TemplateMessage instance using the specified properties. * @param [properties] Properties to set - * @returns AppStateSyncKeyRequest instance + * @returns TemplateMessage instance */ - public static create(properties?: proto.IAppStateSyncKeyRequest): proto.AppStateSyncKeyRequest; + public static create(properties?: proto.ITemplateMessage): proto.TemplateMessage; /** - * Encodes the specified AppStateSyncKeyRequest message. Does not implicitly {@link proto.AppStateSyncKeyRequest.verify|verify} messages. - * @param message AppStateSyncKeyRequest message or plain object to encode + * Encodes the specified TemplateMessage message. Does not implicitly {@link proto.TemplateMessage.verify|verify} messages. + * @param message TemplateMessage message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: proto.IAppStateSyncKeyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: proto.ITemplateMessage, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified AppStateSyncKeyRequest message, length delimited. Does not implicitly {@link proto.AppStateSyncKeyRequest.verify|verify} messages. - * @param message AppStateSyncKeyRequest message or plain object to encode + * Encodes the specified TemplateMessage message, length delimited. Does not implicitly {@link proto.TemplateMessage.verify|verify} messages. + * @param message TemplateMessage message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: proto.IAppStateSyncKeyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: proto.ITemplateMessage, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an AppStateSyncKeyRequest message from the specified reader or buffer. + * Decodes a TemplateMessage message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns AppStateSyncKeyRequest + * @returns TemplateMessage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.AppStateSyncKeyRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.TemplateMessage; /** - * Decodes an AppStateSyncKeyRequest message from the specified reader or buffer, length delimited. + * Decodes a TemplateMessage message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns AppStateSyncKeyRequest + * @returns TemplateMessage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.AppStateSyncKeyRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.TemplateMessage; /** - * Verifies an AppStateSyncKeyRequest message. + * Verifies a TemplateMessage message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates an AppStateSyncKeyRequest message from a plain object. Also converts values to their respective internal types. + * Creates a TemplateMessage message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns AppStateSyncKeyRequest + * @returns TemplateMessage */ - public static fromObject(object: { [k: string]: any }): proto.AppStateSyncKeyRequest; + public static fromObject(object: { [k: string]: any }): proto.TemplateMessage; /** - * Creates a plain object from an AppStateSyncKeyRequest message. Also converts values to other types if specified. - * @param message AppStateSyncKeyRequest + * Creates a plain object from a TemplateMessage message. Also converts values to other types if specified. + * @param message TemplateMessage * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: proto.AppStateSyncKeyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: proto.TemplateMessage, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this AppStateSyncKeyRequest to JSON. + * Converts this TemplateMessage to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of an AppStateFatalExceptionNotification. */ - interface IAppStateFatalExceptionNotification { + /** Properties of a URLButton. */ + interface IURLButton { - /** AppStateFatalExceptionNotification collectionNames */ - collectionNames?: (string[]|null); + /** URLButton displayText */ + displayText?: (proto.IHighlyStructuredMessage|null); - /** AppStateFatalExceptionNotification timestamp */ - timestamp?: (number|Long|null); + /** URLButton url */ + url?: (proto.IHighlyStructuredMessage|null); } - /** Represents an AppStateFatalExceptionNotification. */ - class AppStateFatalExceptionNotification implements IAppStateFatalExceptionNotification { + /** Represents a URLButton. */ + class URLButton implements IURLButton { /** - * Constructs a new AppStateFatalExceptionNotification. + * Constructs a new URLButton. * @param [properties] Properties to set */ - constructor(properties?: proto.IAppStateFatalExceptionNotification); + constructor(properties?: proto.IURLButton); - /** AppStateFatalExceptionNotification collectionNames. */ - public collectionNames: string[]; + /** URLButton displayText. */ + public displayText?: (proto.IHighlyStructuredMessage|null); - /** AppStateFatalExceptionNotification timestamp. */ - public timestamp: (number|Long); + /** URLButton url. */ + public url?: (proto.IHighlyStructuredMessage|null); /** - * Creates a new AppStateFatalExceptionNotification instance using the specified properties. + * Creates a new URLButton instance using the specified properties. * @param [properties] Properties to set - * @returns AppStateFatalExceptionNotification instance + * @returns URLButton instance */ - public static create(properties?: proto.IAppStateFatalExceptionNotification): proto.AppStateFatalExceptionNotification; + public static create(properties?: proto.IURLButton): proto.URLButton; /** - * Encodes the specified AppStateFatalExceptionNotification message. Does not implicitly {@link proto.AppStateFatalExceptionNotification.verify|verify} messages. - * @param message AppStateFatalExceptionNotification message or plain object to encode + * Encodes the specified URLButton message. Does not implicitly {@link proto.URLButton.verify|verify} messages. + * @param message URLButton message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: proto.IAppStateFatalExceptionNotification, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: proto.IURLButton, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified AppStateFatalExceptionNotification message, length delimited. Does not implicitly {@link proto.AppStateFatalExceptionNotification.verify|verify} messages. - * @param message AppStateFatalExceptionNotification message or plain object to encode + * Encodes the specified URLButton message, length delimited. Does not implicitly {@link proto.URLButton.verify|verify} messages. + * @param message URLButton message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: proto.IAppStateFatalExceptionNotification, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: proto.IURLButton, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an AppStateFatalExceptionNotification message from the specified reader or buffer. + * Decodes a URLButton message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns AppStateFatalExceptionNotification + * @returns URLButton * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.AppStateFatalExceptionNotification; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.URLButton; /** - * Decodes an AppStateFatalExceptionNotification message from the specified reader or buffer, length delimited. + * Decodes a URLButton message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns AppStateFatalExceptionNotification + * @returns URLButton * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.AppStateFatalExceptionNotification; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.URLButton; /** - * Verifies an AppStateFatalExceptionNotification message. + * Verifies a URLButton message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates an AppStateFatalExceptionNotification message from a plain object. Also converts values to their respective internal types. + * Creates a URLButton message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns AppStateFatalExceptionNotification + * @returns URLButton */ - public static fromObject(object: { [k: string]: any }): proto.AppStateFatalExceptionNotification; + public static fromObject(object: { [k: string]: any }): proto.URLButton; /** - * Creates a plain object from an AppStateFatalExceptionNotification message. Also converts values to other types if specified. - * @param message AppStateFatalExceptionNotification + * Creates a plain object from a URLButton message. Also converts values to other types if specified. + * @param message URLButton * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: proto.AppStateFatalExceptionNotification, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: proto.URLButton, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this AppStateFatalExceptionNotification to JSON. + * Converts this URLButton to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of an InitialSecurityNotificationSettingSync. */ - interface IInitialSecurityNotificationSettingSync { + /** Properties of a VideoMessage. */ + interface IVideoMessage { - /** InitialSecurityNotificationSettingSync securityNotificationEnabled */ - securityNotificationEnabled?: (boolean|null); + /** VideoMessage url */ + url?: (string|null); + + /** VideoMessage mimetype */ + mimetype?: (string|null); + + /** VideoMessage fileSha256 */ + fileSha256?: (Uint8Array|null); + + /** VideoMessage fileLength */ + fileLength?: (number|Long|null); + + /** VideoMessage seconds */ + seconds?: (number|null); + + /** VideoMessage mediaKey */ + mediaKey?: (Uint8Array|null); + + /** VideoMessage caption */ + caption?: (string|null); + + /** VideoMessage gifPlayback */ + gifPlayback?: (boolean|null); + + /** VideoMessage height */ + height?: (number|null); + + /** VideoMessage width */ + width?: (number|null); + + /** VideoMessage fileEncSha256 */ + fileEncSha256?: (Uint8Array|null); + + /** VideoMessage interactiveAnnotations */ + interactiveAnnotations?: (proto.IInteractiveAnnotation[]|null); + + /** VideoMessage directPath */ + directPath?: (string|null); + + /** VideoMessage mediaKeyTimestamp */ + mediaKeyTimestamp?: (number|Long|null); + + /** VideoMessage jpegThumbnail */ + jpegThumbnail?: (Uint8Array|null); + + /** VideoMessage contextInfo */ + contextInfo?: (proto.IContextInfo|null); + + /** VideoMessage streamingSidecar */ + streamingSidecar?: (Uint8Array|null); + + /** VideoMessage gifAttribution */ + gifAttribution?: (proto.VideoMessage.VideoMessageAttribution|null); + + /** VideoMessage viewOnce */ + viewOnce?: (boolean|null); + + /** VideoMessage thumbnailDirectPath */ + thumbnailDirectPath?: (string|null); + + /** VideoMessage thumbnailSha256 */ + thumbnailSha256?: (Uint8Array|null); + + /** VideoMessage thumbnailEncSha256 */ + thumbnailEncSha256?: (Uint8Array|null); + + /** VideoMessage staticUrl */ + staticUrl?: (string|null); } - /** Represents an InitialSecurityNotificationSettingSync. */ - class InitialSecurityNotificationSettingSync implements IInitialSecurityNotificationSettingSync { + /** Represents a VideoMessage. */ + class VideoMessage implements IVideoMessage { /** - * Constructs a new InitialSecurityNotificationSettingSync. + * Constructs a new VideoMessage. * @param [properties] Properties to set */ - constructor(properties?: proto.IInitialSecurityNotificationSettingSync); + constructor(properties?: proto.IVideoMessage); - /** InitialSecurityNotificationSettingSync securityNotificationEnabled. */ - public securityNotificationEnabled: boolean; + /** VideoMessage url. */ + public url: string; - /** - * Creates a new InitialSecurityNotificationSettingSync instance using the specified properties. - * @param [properties] Properties to set - * @returns InitialSecurityNotificationSettingSync instance - */ - public static create(properties?: proto.IInitialSecurityNotificationSettingSync): proto.InitialSecurityNotificationSettingSync; + /** VideoMessage mimetype. */ + public mimetype: string; - /** - * Encodes the specified InitialSecurityNotificationSettingSync message. Does not implicitly {@link proto.InitialSecurityNotificationSettingSync.verify|verify} messages. - * @param message InitialSecurityNotificationSettingSync message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: proto.IInitialSecurityNotificationSettingSync, writer?: $protobuf.Writer): $protobuf.Writer; + /** VideoMessage fileSha256. */ + public fileSha256: Uint8Array; - /** - * Encodes the specified InitialSecurityNotificationSettingSync message, length delimited. Does not implicitly {@link proto.InitialSecurityNotificationSettingSync.verify|verify} messages. - * @param message InitialSecurityNotificationSettingSync message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: proto.IInitialSecurityNotificationSettingSync, writer?: $protobuf.Writer): $protobuf.Writer; + /** VideoMessage fileLength. */ + public fileLength: (number|Long); - /** - * Decodes an InitialSecurityNotificationSettingSync message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns InitialSecurityNotificationSettingSync - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.InitialSecurityNotificationSettingSync; + /** VideoMessage seconds. */ + public seconds: number; - /** - * Decodes an InitialSecurityNotificationSettingSync message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns InitialSecurityNotificationSettingSync - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.InitialSecurityNotificationSettingSync; + /** VideoMessage mediaKey. */ + public mediaKey: Uint8Array; - /** - * Verifies an InitialSecurityNotificationSettingSync message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** VideoMessage caption. */ + public caption: string; - /** - * Creates an InitialSecurityNotificationSettingSync message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns InitialSecurityNotificationSettingSync - */ - public static fromObject(object: { [k: string]: any }): proto.InitialSecurityNotificationSettingSync; + /** VideoMessage gifPlayback. */ + public gifPlayback: boolean; - /** - * Creates a plain object from an InitialSecurityNotificationSettingSync message. Also converts values to other types if specified. - * @param message InitialSecurityNotificationSettingSync - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: proto.InitialSecurityNotificationSettingSync, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** VideoMessage height. */ + public height: number; - /** - * Converts this InitialSecurityNotificationSettingSync to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** VideoMessage width. */ + public width: number; - /** Properties of a ContactsArrayMessage. */ - interface IContactsArrayMessage { + /** VideoMessage fileEncSha256. */ + public fileEncSha256: Uint8Array; - /** ContactsArrayMessage displayName */ - displayName?: (string|null); + /** VideoMessage interactiveAnnotations. */ + public interactiveAnnotations: proto.IInteractiveAnnotation[]; - /** ContactsArrayMessage contacts */ - contacts?: (proto.IContactMessage[]|null); + /** VideoMessage directPath. */ + public directPath: string; - /** ContactsArrayMessage contextInfo */ - contextInfo?: (proto.IContextInfo|null); - } + /** VideoMessage mediaKeyTimestamp. */ + public mediaKeyTimestamp: (number|Long); - /** Represents a ContactsArrayMessage. */ - class ContactsArrayMessage implements IContactsArrayMessage { + /** VideoMessage jpegThumbnail. */ + public jpegThumbnail: Uint8Array; - /** - * Constructs a new ContactsArrayMessage. - * @param [properties] Properties to set - */ - constructor(properties?: proto.IContactsArrayMessage); + /** VideoMessage contextInfo. */ + public contextInfo?: (proto.IContextInfo|null); - /** ContactsArrayMessage displayName. */ - public displayName: string; + /** VideoMessage streamingSidecar. */ + public streamingSidecar: Uint8Array; - /** ContactsArrayMessage contacts. */ - public contacts: proto.IContactMessage[]; + /** VideoMessage gifAttribution. */ + public gifAttribution: proto.VideoMessage.VideoMessageAttribution; - /** ContactsArrayMessage contextInfo. */ - public contextInfo?: (proto.IContextInfo|null); + /** VideoMessage viewOnce. */ + public viewOnce: boolean; + + /** VideoMessage thumbnailDirectPath. */ + public thumbnailDirectPath: string; + + /** VideoMessage thumbnailSha256. */ + public thumbnailSha256: Uint8Array; + + /** VideoMessage thumbnailEncSha256. */ + public thumbnailEncSha256: Uint8Array; + + /** VideoMessage staticUrl. */ + public staticUrl: string; /** - * Creates a new ContactsArrayMessage instance using the specified properties. + * Creates a new VideoMessage instance using the specified properties. * @param [properties] Properties to set - * @returns ContactsArrayMessage instance + * @returns VideoMessage instance */ - public static create(properties?: proto.IContactsArrayMessage): proto.ContactsArrayMessage; + public static create(properties?: proto.IVideoMessage): proto.VideoMessage; /** - * Encodes the specified ContactsArrayMessage message. Does not implicitly {@link proto.ContactsArrayMessage.verify|verify} messages. - * @param message ContactsArrayMessage message or plain object to encode + * Encodes the specified VideoMessage message. Does not implicitly {@link proto.VideoMessage.verify|verify} messages. + * @param message VideoMessage message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: proto.IContactsArrayMessage, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: proto.IVideoMessage, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ContactsArrayMessage message, length delimited. Does not implicitly {@link proto.ContactsArrayMessage.verify|verify} messages. - * @param message ContactsArrayMessage message or plain object to encode + * Encodes the specified VideoMessage message, length delimited. Does not implicitly {@link proto.VideoMessage.verify|verify} messages. + * @param message VideoMessage message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: proto.IContactsArrayMessage, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: proto.IVideoMessage, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ContactsArrayMessage message from the specified reader or buffer. + * Decodes a VideoMessage message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ContactsArrayMessage + * @returns VideoMessage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.ContactsArrayMessage; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.VideoMessage; /** - * Decodes a ContactsArrayMessage message from the specified reader or buffer, length delimited. + * Decodes a VideoMessage message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ContactsArrayMessage + * @returns VideoMessage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.ContactsArrayMessage; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.VideoMessage; /** - * Verifies a ContactsArrayMessage message. + * Verifies a VideoMessage message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a ContactsArrayMessage message from a plain object. Also converts values to their respective internal types. + * Creates a VideoMessage message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ContactsArrayMessage + * @returns VideoMessage */ - public static fromObject(object: { [k: string]: any }): proto.ContactsArrayMessage; + public static fromObject(object: { [k: string]: any }): proto.VideoMessage; /** - * Creates a plain object from a ContactsArrayMessage message. Also converts values to other types if specified. - * @param message ContactsArrayMessage + * Creates a plain object from a VideoMessage message. Also converts values to other types if specified. + * @param message VideoMessage * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: proto.ContactsArrayMessage, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: proto.VideoMessage, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ContactsArrayMessage to JSON. + * Converts this VideoMessage to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a HSMCurrency. */ - interface IHSMCurrency { + namespace VideoMessage { - /** HSMCurrency currencyCode */ - currencyCode?: (string|null); + /** VideoMessageAttribution enum. */ + enum VideoMessageAttribution { + NONE = 0, + GIPHY = 1, + TENOR = 2 + } + } - /** HSMCurrency amount1000 */ - amount1000?: (number|Long|null); + /** Properties of an EphemeralSetting. */ + interface IEphemeralSetting { + + /** EphemeralSetting duration */ + duration?: (number|null); + + /** EphemeralSetting timestamp */ + timestamp?: (number|Long|null); } - /** Represents a HSMCurrency. */ - class HSMCurrency implements IHSMCurrency { + /** Represents an EphemeralSetting. */ + class EphemeralSetting implements IEphemeralSetting { /** - * Constructs a new HSMCurrency. + * Constructs a new EphemeralSetting. * @param [properties] Properties to set */ - constructor(properties?: proto.IHSMCurrency); + constructor(properties?: proto.IEphemeralSetting); - /** HSMCurrency currencyCode. */ - public currencyCode: string; + /** EphemeralSetting duration. */ + public duration: number; - /** HSMCurrency amount1000. */ - public amount1000: (number|Long); + /** EphemeralSetting timestamp. */ + public timestamp: (number|Long); /** - * Creates a new HSMCurrency instance using the specified properties. + * Creates a new EphemeralSetting instance using the specified properties. * @param [properties] Properties to set - * @returns HSMCurrency instance + * @returns EphemeralSetting instance */ - public static create(properties?: proto.IHSMCurrency): proto.HSMCurrency; + public static create(properties?: proto.IEphemeralSetting): proto.EphemeralSetting; /** - * Encodes the specified HSMCurrency message. Does not implicitly {@link proto.HSMCurrency.verify|verify} messages. - * @param message HSMCurrency message or plain object to encode + * Encodes the specified EphemeralSetting message. Does not implicitly {@link proto.EphemeralSetting.verify|verify} messages. + * @param message EphemeralSetting message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: proto.IHSMCurrency, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: proto.IEphemeralSetting, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified HSMCurrency message, length delimited. Does not implicitly {@link proto.HSMCurrency.verify|verify} messages. - * @param message HSMCurrency message or plain object to encode + * Encodes the specified EphemeralSetting message, length delimited. Does not implicitly {@link proto.EphemeralSetting.verify|verify} messages. + * @param message EphemeralSetting message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: proto.IHSMCurrency, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: proto.IEphemeralSetting, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a HSMCurrency message from the specified reader or buffer. + * Decodes an EphemeralSetting message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns HSMCurrency + * @returns EphemeralSetting * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.HSMCurrency; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.EphemeralSetting; /** - * Decodes a HSMCurrency message from the specified reader or buffer, length delimited. + * Decodes an EphemeralSetting message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns HSMCurrency + * @returns EphemeralSetting * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.HSMCurrency; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.EphemeralSetting; /** - * Verifies a HSMCurrency message. + * Verifies an EphemeralSetting message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a HSMCurrency message from a plain object. Also converts values to their respective internal types. + * Creates an EphemeralSetting message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns HSMCurrency + * @returns EphemeralSetting */ - public static fromObject(object: { [k: string]: any }): proto.HSMCurrency; + public static fromObject(object: { [k: string]: any }): proto.EphemeralSetting; /** - * Creates a plain object from a HSMCurrency message. Also converts values to other types if specified. - * @param message HSMCurrency + * Creates a plain object from an EphemeralSetting message. Also converts values to other types if specified. + * @param message EphemeralSetting * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: proto.HSMCurrency, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: proto.EphemeralSetting, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this HSMCurrency to JSON. + * Converts this EphemeralSetting to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a HSMDateTimeComponent. */ - interface IHSMDateTimeComponent { - - /** HSMDateTimeComponent dayOfWeek */ - dayOfWeek?: (proto.HSMDateTimeComponent.HSMDateTimeComponentDayOfWeekType|null); - - /** HSMDateTimeComponent year */ - year?: (number|null); - - /** HSMDateTimeComponent month */ - month?: (number|null); + /** Properties of an AutoDownloadSettings. */ + interface IAutoDownloadSettings { - /** HSMDateTimeComponent dayOfMonth */ - dayOfMonth?: (number|null); + /** AutoDownloadSettings downloadImages */ + downloadImages?: (boolean|null); - /** HSMDateTimeComponent hour */ - hour?: (number|null); + /** AutoDownloadSettings downloadAudio */ + downloadAudio?: (boolean|null); - /** HSMDateTimeComponent minute */ - minute?: (number|null); + /** AutoDownloadSettings downloadVideo */ + downloadVideo?: (boolean|null); - /** HSMDateTimeComponent calendar */ - calendar?: (proto.HSMDateTimeComponent.HSMDateTimeComponentCalendarType|null); + /** AutoDownloadSettings downloadDocuments */ + downloadDocuments?: (boolean|null); } - /** Represents a HSMDateTimeComponent. */ - class HSMDateTimeComponent implements IHSMDateTimeComponent { + /** Represents an AutoDownloadSettings. */ + class AutoDownloadSettings implements IAutoDownloadSettings { /** - * Constructs a new HSMDateTimeComponent. + * Constructs a new AutoDownloadSettings. * @param [properties] Properties to set */ - constructor(properties?: proto.IHSMDateTimeComponent); - - /** HSMDateTimeComponent dayOfWeek. */ - public dayOfWeek: proto.HSMDateTimeComponent.HSMDateTimeComponentDayOfWeekType; - - /** HSMDateTimeComponent year. */ - public year: number; - - /** HSMDateTimeComponent month. */ - public month: number; + constructor(properties?: proto.IAutoDownloadSettings); - /** HSMDateTimeComponent dayOfMonth. */ - public dayOfMonth: number; + /** AutoDownloadSettings downloadImages. */ + public downloadImages: boolean; - /** HSMDateTimeComponent hour. */ - public hour: number; + /** AutoDownloadSettings downloadAudio. */ + public downloadAudio: boolean; - /** HSMDateTimeComponent minute. */ - public minute: number; + /** AutoDownloadSettings downloadVideo. */ + public downloadVideo: boolean; - /** HSMDateTimeComponent calendar. */ - public calendar: proto.HSMDateTimeComponent.HSMDateTimeComponentCalendarType; + /** AutoDownloadSettings downloadDocuments. */ + public downloadDocuments: boolean; /** - * Creates a new HSMDateTimeComponent instance using the specified properties. + * Creates a new AutoDownloadSettings instance using the specified properties. * @param [properties] Properties to set - * @returns HSMDateTimeComponent instance + * @returns AutoDownloadSettings instance */ - public static create(properties?: proto.IHSMDateTimeComponent): proto.HSMDateTimeComponent; + public static create(properties?: proto.IAutoDownloadSettings): proto.AutoDownloadSettings; /** - * Encodes the specified HSMDateTimeComponent message. Does not implicitly {@link proto.HSMDateTimeComponent.verify|verify} messages. - * @param message HSMDateTimeComponent message or plain object to encode + * Encodes the specified AutoDownloadSettings message. Does not implicitly {@link proto.AutoDownloadSettings.verify|verify} messages. + * @param message AutoDownloadSettings message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: proto.IHSMDateTimeComponent, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: proto.IAutoDownloadSettings, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified HSMDateTimeComponent message, length delimited. Does not implicitly {@link proto.HSMDateTimeComponent.verify|verify} messages. - * @param message HSMDateTimeComponent message or plain object to encode + * Encodes the specified AutoDownloadSettings message, length delimited. Does not implicitly {@link proto.AutoDownloadSettings.verify|verify} messages. + * @param message AutoDownloadSettings message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: proto.IHSMDateTimeComponent, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: proto.IAutoDownloadSettings, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a HSMDateTimeComponent message from the specified reader or buffer. + * Decodes an AutoDownloadSettings message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns HSMDateTimeComponent + * @returns AutoDownloadSettings * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.HSMDateTimeComponent; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.AutoDownloadSettings; /** - * Decodes a HSMDateTimeComponent message from the specified reader or buffer, length delimited. + * Decodes an AutoDownloadSettings message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns HSMDateTimeComponent + * @returns AutoDownloadSettings * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.HSMDateTimeComponent; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.AutoDownloadSettings; /** - * Verifies a HSMDateTimeComponent message. + * Verifies an AutoDownloadSettings message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a HSMDateTimeComponent message from a plain object. Also converts values to their respective internal types. + * Creates an AutoDownloadSettings message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns HSMDateTimeComponent + * @returns AutoDownloadSettings */ - public static fromObject(object: { [k: string]: any }): proto.HSMDateTimeComponent; + public static fromObject(object: { [k: string]: any }): proto.AutoDownloadSettings; /** - * Creates a plain object from a HSMDateTimeComponent message. Also converts values to other types if specified. - * @param message HSMDateTimeComponent + * Creates a plain object from an AutoDownloadSettings message. Also converts values to other types if specified. + * @param message AutoDownloadSettings * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: proto.HSMDateTimeComponent, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: proto.AutoDownloadSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this HSMDateTimeComponent to JSON. + * Converts this AutoDownloadSettings to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - namespace HSMDateTimeComponent { + /** Properties of a Conversation. */ + interface IConversation { - /** HSMDateTimeComponentDayOfWeekType enum. */ - enum HSMDateTimeComponentDayOfWeekType { - MONDAY = 1, - TUESDAY = 2, - WEDNESDAY = 3, - THURSDAY = 4, - FRIDAY = 5, - SATURDAY = 6, - SUNDAY = 7 - } + /** Conversation id */ + id: string; + + /** Conversation messages */ + messages?: (proto.IHistorySyncMsg[]|null); + + /** Conversation newJid */ + newJid?: (string|null); + + /** Conversation oldJid */ + oldJid?: (string|null); + + /** Conversation lastMsgTimestamp */ + lastMsgTimestamp?: (number|Long|null); + + /** Conversation unreadCount */ + unreadCount?: (number|null); + + /** Conversation readOnly */ + readOnly?: (boolean|null); + + /** Conversation endOfHistoryTransfer */ + endOfHistoryTransfer?: (boolean|null); + + /** Conversation ephemeralExpiration */ + ephemeralExpiration?: (number|null); + + /** Conversation ephemeralSettingTimestamp */ + ephemeralSettingTimestamp?: (number|Long|null); + + /** Conversation endOfHistoryTransferType */ + endOfHistoryTransferType?: (proto.Conversation.ConversationEndOfHistoryTransferType|null); + + /** Conversation conversationTimestamp */ + conversationTimestamp?: (number|Long|null); + + /** Conversation name */ + name?: (string|null); + + /** Conversation pHash */ + pHash?: (string|null); + + /** Conversation notSpam */ + notSpam?: (boolean|null); + + /** Conversation archived */ + archived?: (boolean|null); + + /** Conversation disappearingMode */ + disappearingMode?: (proto.IDisappearingMode|null); + + /** Conversation unreadMentionCount */ + unreadMentionCount?: (number|null); + + /** Conversation markedAsUnread */ + markedAsUnread?: (boolean|null); + + /** Conversation participant */ + participant?: (proto.IGroupParticipant[]|null); + + /** Conversation tcToken */ + tcToken?: (Uint8Array|null); + + /** Conversation tcTokenTimestamp */ + tcTokenTimestamp?: (number|Long|null); + + /** Conversation contactPrimaryIdentityKey */ + contactPrimaryIdentityKey?: (Uint8Array|null); + + /** Conversation pinned */ + pinned?: (number|null); + + /** Conversation muteEndTime */ + muteEndTime?: (number|Long|null); + + /** Conversation wallpaper */ + wallpaper?: (proto.IWallpaperSettings|null); + + /** Conversation mediaVisibility */ + mediaVisibility?: (proto.MediaVisibility|null); + + /** Conversation tcTokenSenderTimestamp */ + tcTokenSenderTimestamp?: (number|Long|null); + + /** Conversation suspended */ + suspended?: (boolean|null); + } + + /** Represents a Conversation. */ + class Conversation implements IConversation { + + /** + * Constructs a new Conversation. + * @param [properties] Properties to set + */ + constructor(properties?: proto.IConversation); + + /** Conversation id. */ + public id: string; + + /** Conversation messages. */ + public messages: proto.IHistorySyncMsg[]; + + /** Conversation newJid. */ + public newJid: string; + + /** Conversation oldJid. */ + public oldJid: string; + + /** Conversation lastMsgTimestamp. */ + public lastMsgTimestamp: (number|Long); + + /** Conversation unreadCount. */ + public unreadCount: number; + + /** Conversation readOnly. */ + public readOnly: boolean; + + /** Conversation endOfHistoryTransfer. */ + public endOfHistoryTransfer: boolean; + + /** Conversation ephemeralExpiration. */ + public ephemeralExpiration: number; + + /** Conversation ephemeralSettingTimestamp. */ + public ephemeralSettingTimestamp: (number|Long); + + /** Conversation endOfHistoryTransferType. */ + public endOfHistoryTransferType: proto.Conversation.ConversationEndOfHistoryTransferType; + + /** Conversation conversationTimestamp. */ + public conversationTimestamp: (number|Long); + + /** Conversation name. */ + public name: string; + + /** Conversation pHash. */ + public pHash: string; + + /** Conversation notSpam. */ + public notSpam: boolean; + + /** Conversation archived. */ + public archived: boolean; + + /** Conversation disappearingMode. */ + public disappearingMode?: (proto.IDisappearingMode|null); + + /** Conversation unreadMentionCount. */ + public unreadMentionCount: number; + + /** Conversation markedAsUnread. */ + public markedAsUnread: boolean; + + /** Conversation participant. */ + public participant: proto.IGroupParticipant[]; + + /** Conversation tcToken. */ + public tcToken: Uint8Array; - /** HSMDateTimeComponentCalendarType enum. */ - enum HSMDateTimeComponentCalendarType { - GREGORIAN = 1, - SOLAR_HIJRI = 2 - } - } + /** Conversation tcTokenTimestamp. */ + public tcTokenTimestamp: (number|Long); - /** Properties of a HSMDateTimeUnixEpoch. */ - interface IHSMDateTimeUnixEpoch { + /** Conversation contactPrimaryIdentityKey. */ + public contactPrimaryIdentityKey: Uint8Array; - /** HSMDateTimeUnixEpoch timestamp */ - timestamp?: (number|Long|null); - } + /** Conversation pinned. */ + public pinned: number; - /** Represents a HSMDateTimeUnixEpoch. */ - class HSMDateTimeUnixEpoch implements IHSMDateTimeUnixEpoch { + /** Conversation muteEndTime. */ + public muteEndTime: (number|Long); - /** - * Constructs a new HSMDateTimeUnixEpoch. - * @param [properties] Properties to set - */ - constructor(properties?: proto.IHSMDateTimeUnixEpoch); + /** Conversation wallpaper. */ + public wallpaper?: (proto.IWallpaperSettings|null); - /** HSMDateTimeUnixEpoch timestamp. */ - public timestamp: (number|Long); + /** Conversation mediaVisibility. */ + public mediaVisibility: proto.MediaVisibility; + + /** Conversation tcTokenSenderTimestamp. */ + public tcTokenSenderTimestamp: (number|Long); + + /** Conversation suspended. */ + public suspended: boolean; /** - * Creates a new HSMDateTimeUnixEpoch instance using the specified properties. + * Creates a new Conversation instance using the specified properties. * @param [properties] Properties to set - * @returns HSMDateTimeUnixEpoch instance + * @returns Conversation instance */ - public static create(properties?: proto.IHSMDateTimeUnixEpoch): proto.HSMDateTimeUnixEpoch; + public static create(properties?: proto.IConversation): proto.Conversation; /** - * Encodes the specified HSMDateTimeUnixEpoch message. Does not implicitly {@link proto.HSMDateTimeUnixEpoch.verify|verify} messages. - * @param message HSMDateTimeUnixEpoch message or plain object to encode + * Encodes the specified Conversation message. Does not implicitly {@link proto.Conversation.verify|verify} messages. + * @param message Conversation message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: proto.IHSMDateTimeUnixEpoch, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: proto.IConversation, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified HSMDateTimeUnixEpoch message, length delimited. Does not implicitly {@link proto.HSMDateTimeUnixEpoch.verify|verify} messages. - * @param message HSMDateTimeUnixEpoch message or plain object to encode + * Encodes the specified Conversation message, length delimited. Does not implicitly {@link proto.Conversation.verify|verify} messages. + * @param message Conversation message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: proto.IHSMDateTimeUnixEpoch, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: proto.IConversation, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a HSMDateTimeUnixEpoch message from the specified reader or buffer. + * Decodes a Conversation message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns HSMDateTimeUnixEpoch + * @returns Conversation * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.HSMDateTimeUnixEpoch; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.Conversation; /** - * Decodes a HSMDateTimeUnixEpoch message from the specified reader or buffer, length delimited. + * Decodes a Conversation message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns HSMDateTimeUnixEpoch + * @returns Conversation * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.HSMDateTimeUnixEpoch; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.Conversation; /** - * Verifies a HSMDateTimeUnixEpoch message. + * Verifies a Conversation message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a HSMDateTimeUnixEpoch message from a plain object. Also converts values to their respective internal types. + * Creates a Conversation message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns HSMDateTimeUnixEpoch + * @returns Conversation */ - public static fromObject(object: { [k: string]: any }): proto.HSMDateTimeUnixEpoch; + public static fromObject(object: { [k: string]: any }): proto.Conversation; /** - * Creates a plain object from a HSMDateTimeUnixEpoch message. Also converts values to other types if specified. - * @param message HSMDateTimeUnixEpoch + * Creates a plain object from a Conversation message. Also converts values to other types if specified. + * @param message Conversation * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: proto.HSMDateTimeUnixEpoch, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: proto.Conversation, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this HSMDateTimeUnixEpoch to JSON. + * Converts this Conversation to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a HSMDateTime. */ - interface IHSMDateTime { + namespace Conversation { - /** HSMDateTime component */ - component?: (proto.IHSMDateTimeComponent|null); + /** ConversationEndOfHistoryTransferType enum. */ + enum ConversationEndOfHistoryTransferType { + COMPLETE_BUT_MORE_MESSAGES_REMAIN_ON_PRIMARY = 0, + COMPLETE_AND_NO_MORE_MESSAGE_REMAIN_ON_PRIMARY = 1 + } + } - /** HSMDateTime unixEpoch */ - unixEpoch?: (proto.IHSMDateTimeUnixEpoch|null); + /** Properties of a GlobalSettings. */ + interface IGlobalSettings { + + /** GlobalSettings lightThemeWallpaper */ + lightThemeWallpaper?: (proto.IWallpaperSettings|null); + + /** GlobalSettings mediaVisibility */ + mediaVisibility?: (proto.MediaVisibility|null); + + /** GlobalSettings darkThemeWallpaper */ + darkThemeWallpaper?: (proto.IWallpaperSettings|null); + + /** GlobalSettings autoDownloadWiFi */ + autoDownloadWiFi?: (proto.IAutoDownloadSettings|null); + + /** GlobalSettings autoDownloadCellular */ + autoDownloadCellular?: (proto.IAutoDownloadSettings|null); + + /** GlobalSettings autoDownloadRoaming */ + autoDownloadRoaming?: (proto.IAutoDownloadSettings|null); + + /** GlobalSettings showIndividualNotificationsPreview */ + showIndividualNotificationsPreview?: (boolean|null); + + /** GlobalSettings showGroupNotificationsPreview */ + showGroupNotificationsPreview?: (boolean|null); } - /** Represents a HSMDateTime. */ - class HSMDateTime implements IHSMDateTime { + /** Represents a GlobalSettings. */ + class GlobalSettings implements IGlobalSettings { /** - * Constructs a new HSMDateTime. + * Constructs a new GlobalSettings. * @param [properties] Properties to set */ - constructor(properties?: proto.IHSMDateTime); + constructor(properties?: proto.IGlobalSettings); - /** HSMDateTime component. */ - public component?: (proto.IHSMDateTimeComponent|null); + /** GlobalSettings lightThemeWallpaper. */ + public lightThemeWallpaper?: (proto.IWallpaperSettings|null); - /** HSMDateTime unixEpoch. */ - public unixEpoch?: (proto.IHSMDateTimeUnixEpoch|null); + /** GlobalSettings mediaVisibility. */ + public mediaVisibility: proto.MediaVisibility; - /** HSMDateTime datetimeOneof. */ - public datetimeOneof?: ("component"|"unixEpoch"); + /** GlobalSettings darkThemeWallpaper. */ + public darkThemeWallpaper?: (proto.IWallpaperSettings|null); + + /** GlobalSettings autoDownloadWiFi. */ + public autoDownloadWiFi?: (proto.IAutoDownloadSettings|null); + + /** GlobalSettings autoDownloadCellular. */ + public autoDownloadCellular?: (proto.IAutoDownloadSettings|null); + + /** GlobalSettings autoDownloadRoaming. */ + public autoDownloadRoaming?: (proto.IAutoDownloadSettings|null); + + /** GlobalSettings showIndividualNotificationsPreview. */ + public showIndividualNotificationsPreview: boolean; + + /** GlobalSettings showGroupNotificationsPreview. */ + public showGroupNotificationsPreview: boolean; /** - * Creates a new HSMDateTime instance using the specified properties. + * Creates a new GlobalSettings instance using the specified properties. * @param [properties] Properties to set - * @returns HSMDateTime instance + * @returns GlobalSettings instance */ - public static create(properties?: proto.IHSMDateTime): proto.HSMDateTime; + public static create(properties?: proto.IGlobalSettings): proto.GlobalSettings; /** - * Encodes the specified HSMDateTime message. Does not implicitly {@link proto.HSMDateTime.verify|verify} messages. - * @param message HSMDateTime message or plain object to encode + * Encodes the specified GlobalSettings message. Does not implicitly {@link proto.GlobalSettings.verify|verify} messages. + * @param message GlobalSettings message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: proto.IHSMDateTime, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: proto.IGlobalSettings, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified HSMDateTime message, length delimited. Does not implicitly {@link proto.HSMDateTime.verify|verify} messages. - * @param message HSMDateTime message or plain object to encode + * Encodes the specified GlobalSettings message, length delimited. Does not implicitly {@link proto.GlobalSettings.verify|verify} messages. + * @param message GlobalSettings message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: proto.IHSMDateTime, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: proto.IGlobalSettings, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a HSMDateTime message from the specified reader or buffer. + * Decodes a GlobalSettings message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns HSMDateTime + * @returns GlobalSettings * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.HSMDateTime; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.GlobalSettings; /** - * Decodes a HSMDateTime message from the specified reader or buffer, length delimited. + * Decodes a GlobalSettings message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns HSMDateTime + * @returns GlobalSettings * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.HSMDateTime; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.GlobalSettings; /** - * Verifies a HSMDateTime message. + * Verifies a GlobalSettings message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a HSMDateTime message from a plain object. Also converts values to their respective internal types. + * Creates a GlobalSettings message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns HSMDateTime + * @returns GlobalSettings */ - public static fromObject(object: { [k: string]: any }): proto.HSMDateTime; + public static fromObject(object: { [k: string]: any }): proto.GlobalSettings; /** - * Creates a plain object from a HSMDateTime message. Also converts values to other types if specified. - * @param message HSMDateTime + * Creates a plain object from a GlobalSettings message. Also converts values to other types if specified. + * @param message GlobalSettings * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: proto.HSMDateTime, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: proto.GlobalSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this HSMDateTime to JSON. + * Converts this GlobalSettings to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a HSMLocalizableParameter. */ - interface IHSMLocalizableParameter { - - /** HSMLocalizableParameter default */ - "default"?: (string|null); + /** Properties of a GroupParticipant. */ + interface IGroupParticipant { - /** HSMLocalizableParameter currency */ - currency?: (proto.IHSMCurrency|null); + /** GroupParticipant userJid */ + userJid: string; - /** HSMLocalizableParameter dateTime */ - dateTime?: (proto.IHSMDateTime|null); + /** GroupParticipant rank */ + rank?: (proto.GroupParticipant.GroupParticipantRank|null); } - /** Represents a HSMLocalizableParameter. */ - class HSMLocalizableParameter implements IHSMLocalizableParameter { + /** Represents a GroupParticipant. */ + class GroupParticipant implements IGroupParticipant { /** - * Constructs a new HSMLocalizableParameter. + * Constructs a new GroupParticipant. * @param [properties] Properties to set */ - constructor(properties?: proto.IHSMLocalizableParameter); - - /** HSMLocalizableParameter default. */ - public default: string; - - /** HSMLocalizableParameter currency. */ - public currency?: (proto.IHSMCurrency|null); + constructor(properties?: proto.IGroupParticipant); - /** HSMLocalizableParameter dateTime. */ - public dateTime?: (proto.IHSMDateTime|null); + /** GroupParticipant userJid. */ + public userJid: string; - /** HSMLocalizableParameter paramOneof. */ - public paramOneof?: ("currency"|"dateTime"); + /** GroupParticipant rank. */ + public rank: proto.GroupParticipant.GroupParticipantRank; /** - * Creates a new HSMLocalizableParameter instance using the specified properties. + * Creates a new GroupParticipant instance using the specified properties. * @param [properties] Properties to set - * @returns HSMLocalizableParameter instance + * @returns GroupParticipant instance */ - public static create(properties?: proto.IHSMLocalizableParameter): proto.HSMLocalizableParameter; + public static create(properties?: proto.IGroupParticipant): proto.GroupParticipant; /** - * Encodes the specified HSMLocalizableParameter message. Does not implicitly {@link proto.HSMLocalizableParameter.verify|verify} messages. - * @param message HSMLocalizableParameter message or plain object to encode + * Encodes the specified GroupParticipant message. Does not implicitly {@link proto.GroupParticipant.verify|verify} messages. + * @param message GroupParticipant message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: proto.IHSMLocalizableParameter, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: proto.IGroupParticipant, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified HSMLocalizableParameter message, length delimited. Does not implicitly {@link proto.HSMLocalizableParameter.verify|verify} messages. - * @param message HSMLocalizableParameter message or plain object to encode + * Encodes the specified GroupParticipant message, length delimited. Does not implicitly {@link proto.GroupParticipant.verify|verify} messages. + * @param message GroupParticipant message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: proto.IHSMLocalizableParameter, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: proto.IGroupParticipant, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a HSMLocalizableParameter message from the specified reader or buffer. + * Decodes a GroupParticipant message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns HSMLocalizableParameter + * @returns GroupParticipant * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.HSMLocalizableParameter; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.GroupParticipant; /** - * Decodes a HSMLocalizableParameter message from the specified reader or buffer, length delimited. + * Decodes a GroupParticipant message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns HSMLocalizableParameter + * @returns GroupParticipant * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.HSMLocalizableParameter; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.GroupParticipant; /** - * Verifies a HSMLocalizableParameter message. + * Verifies a GroupParticipant message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a HSMLocalizableParameter message from a plain object. Also converts values to their respective internal types. + * Creates a GroupParticipant message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns HSMLocalizableParameter + * @returns GroupParticipant */ - public static fromObject(object: { [k: string]: any }): proto.HSMLocalizableParameter; + public static fromObject(object: { [k: string]: any }): proto.GroupParticipant; /** - * Creates a plain object from a HSMLocalizableParameter message. Also converts values to other types if specified. - * @param message HSMLocalizableParameter + * Creates a plain object from a GroupParticipant message. Also converts values to other types if specified. + * @param message GroupParticipant * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: proto.HSMLocalizableParameter, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: proto.GroupParticipant, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this HSMLocalizableParameter to JSON. + * Converts this GroupParticipant to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a HighlyStructuredMessage. */ - interface IHighlyStructuredMessage { + namespace GroupParticipant { - /** HighlyStructuredMessage namespace */ - namespace?: (string|null); + /** GroupParticipantRank enum. */ + enum GroupParticipantRank { + REGULAR = 0, + ADMIN = 1, + SUPERADMIN = 2 + } + } - /** HighlyStructuredMessage elementName */ - elementName?: (string|null); + /** Properties of a HistorySync. */ + interface IHistorySync { - /** HighlyStructuredMessage params */ - params?: (string[]|null); + /** HistorySync syncType */ + syncType: proto.HistorySync.HistorySyncHistorySyncType; - /** HighlyStructuredMessage fallbackLg */ - fallbackLg?: (string|null); + /** HistorySync conversations */ + conversations?: (proto.IConversation[]|null); - /** HighlyStructuredMessage fallbackLc */ - fallbackLc?: (string|null); + /** HistorySync statusV3Messages */ + statusV3Messages?: (proto.IWebMessageInfo[]|null); - /** HighlyStructuredMessage localizableParams */ - localizableParams?: (proto.IHSMLocalizableParameter[]|null); + /** HistorySync chunkOrder */ + chunkOrder?: (number|null); - /** HighlyStructuredMessage deterministicLg */ - deterministicLg?: (string|null); + /** HistorySync progress */ + progress?: (number|null); - /** HighlyStructuredMessage deterministicLc */ - deterministicLc?: (string|null); + /** HistorySync pushnames */ + pushnames?: (proto.IPushname[]|null); - /** HighlyStructuredMessage hydratedHsm */ - hydratedHsm?: (proto.ITemplateMessage|null); + /** HistorySync globalSettings */ + globalSettings?: (proto.IGlobalSettings|null); + + /** HistorySync threadIdUserSecret */ + threadIdUserSecret?: (Uint8Array|null); + + /** HistorySync threadDsTimeframeOffset */ + threadDsTimeframeOffset?: (number|null); } - /** Represents a HighlyStructuredMessage. */ - class HighlyStructuredMessage implements IHighlyStructuredMessage { + /** Represents a HistorySync. */ + class HistorySync implements IHistorySync { /** - * Constructs a new HighlyStructuredMessage. + * Constructs a new HistorySync. * @param [properties] Properties to set */ - constructor(properties?: proto.IHighlyStructuredMessage); + constructor(properties?: proto.IHistorySync); - /** HighlyStructuredMessage namespace. */ - public namespace: string; + /** HistorySync syncType. */ + public syncType: proto.HistorySync.HistorySyncHistorySyncType; - /** HighlyStructuredMessage elementName. */ - public elementName: string; + /** HistorySync conversations. */ + public conversations: proto.IConversation[]; - /** HighlyStructuredMessage params. */ - public params: string[]; + /** HistorySync statusV3Messages. */ + public statusV3Messages: proto.IWebMessageInfo[]; - /** HighlyStructuredMessage fallbackLg. */ - public fallbackLg: string; + /** HistorySync chunkOrder. */ + public chunkOrder: number; - /** HighlyStructuredMessage fallbackLc. */ - public fallbackLc: string; + /** HistorySync progress. */ + public progress: number; - /** HighlyStructuredMessage localizableParams. */ - public localizableParams: proto.IHSMLocalizableParameter[]; + /** HistorySync pushnames. */ + public pushnames: proto.IPushname[]; - /** HighlyStructuredMessage deterministicLg. */ - public deterministicLg: string; + /** HistorySync globalSettings. */ + public globalSettings?: (proto.IGlobalSettings|null); - /** HighlyStructuredMessage deterministicLc. */ - public deterministicLc: string; + /** HistorySync threadIdUserSecret. */ + public threadIdUserSecret: Uint8Array; - /** HighlyStructuredMessage hydratedHsm. */ - public hydratedHsm?: (proto.ITemplateMessage|null); + /** HistorySync threadDsTimeframeOffset. */ + public threadDsTimeframeOffset: number; /** - * Creates a new HighlyStructuredMessage instance using the specified properties. + * Creates a new HistorySync instance using the specified properties. * @param [properties] Properties to set - * @returns HighlyStructuredMessage instance + * @returns HistorySync instance */ - public static create(properties?: proto.IHighlyStructuredMessage): proto.HighlyStructuredMessage; + public static create(properties?: proto.IHistorySync): proto.HistorySync; /** - * Encodes the specified HighlyStructuredMessage message. Does not implicitly {@link proto.HighlyStructuredMessage.verify|verify} messages. - * @param message HighlyStructuredMessage message or plain object to encode + * Encodes the specified HistorySync message. Does not implicitly {@link proto.HistorySync.verify|verify} messages. + * @param message HistorySync message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: proto.IHighlyStructuredMessage, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: proto.IHistorySync, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified HighlyStructuredMessage message, length delimited. Does not implicitly {@link proto.HighlyStructuredMessage.verify|verify} messages. - * @param message HighlyStructuredMessage message or plain object to encode + * Encodes the specified HistorySync message, length delimited. Does not implicitly {@link proto.HistorySync.verify|verify} messages. + * @param message HistorySync message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: proto.IHighlyStructuredMessage, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: proto.IHistorySync, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a HighlyStructuredMessage message from the specified reader or buffer. + * Decodes a HistorySync message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns HighlyStructuredMessage + * @returns HistorySync * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.HighlyStructuredMessage; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.HistorySync; /** - * Decodes a HighlyStructuredMessage message from the specified reader or buffer, length delimited. + * Decodes a HistorySync message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns HighlyStructuredMessage + * @returns HistorySync * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.HighlyStructuredMessage; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.HistorySync; /** - * Verifies a HighlyStructuredMessage message. + * Verifies a HistorySync message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a HighlyStructuredMessage message from a plain object. Also converts values to their respective internal types. + * Creates a HistorySync message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns HighlyStructuredMessage + * @returns HistorySync */ - public static fromObject(object: { [k: string]: any }): proto.HighlyStructuredMessage; + public static fromObject(object: { [k: string]: any }): proto.HistorySync; /** - * Creates a plain object from a HighlyStructuredMessage message. Also converts values to other types if specified. - * @param message HighlyStructuredMessage + * Creates a plain object from a HistorySync message. Also converts values to other types if specified. + * @param message HistorySync * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: proto.HighlyStructuredMessage, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: proto.HistorySync, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this HighlyStructuredMessage to JSON. + * Converts this HistorySync to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a SendPaymentMessage. */ - interface ISendPaymentMessage { + namespace HistorySync { - /** SendPaymentMessage noteMessage */ - noteMessage?: (proto.IMessage|null); + /** HistorySyncHistorySyncType enum. */ + enum HistorySyncHistorySyncType { + INITIAL_BOOTSTRAP = 0, + INITIAL_STATUS_V3 = 1, + FULL = 2, + RECENT = 3, + PUSH_NAME = 4 + } + } - /** SendPaymentMessage requestMessageKey */ - requestMessageKey?: (proto.IMessageKey|null); + /** Properties of a HistorySyncMsg. */ + interface IHistorySyncMsg { - /** SendPaymentMessage background */ - background?: (proto.IPaymentBackground|null); + /** HistorySyncMsg message */ + message?: (proto.IWebMessageInfo|null); + + /** HistorySyncMsg msgOrderId */ + msgOrderId?: (number|Long|null); } - /** Represents a SendPaymentMessage. */ - class SendPaymentMessage implements ISendPaymentMessage { + /** Represents a HistorySyncMsg. */ + class HistorySyncMsg implements IHistorySyncMsg { /** - * Constructs a new SendPaymentMessage. + * Constructs a new HistorySyncMsg. * @param [properties] Properties to set */ - constructor(properties?: proto.ISendPaymentMessage); - - /** SendPaymentMessage noteMessage. */ - public noteMessage?: (proto.IMessage|null); + constructor(properties?: proto.IHistorySyncMsg); - /** SendPaymentMessage requestMessageKey. */ - public requestMessageKey?: (proto.IMessageKey|null); + /** HistorySyncMsg message. */ + public message?: (proto.IWebMessageInfo|null); - /** SendPaymentMessage background. */ - public background?: (proto.IPaymentBackground|null); + /** HistorySyncMsg msgOrderId. */ + public msgOrderId: (number|Long); /** - * Creates a new SendPaymentMessage instance using the specified properties. + * Creates a new HistorySyncMsg instance using the specified properties. * @param [properties] Properties to set - * @returns SendPaymentMessage instance + * @returns HistorySyncMsg instance */ - public static create(properties?: proto.ISendPaymentMessage): proto.SendPaymentMessage; + public static create(properties?: proto.IHistorySyncMsg): proto.HistorySyncMsg; /** - * Encodes the specified SendPaymentMessage message. Does not implicitly {@link proto.SendPaymentMessage.verify|verify} messages. - * @param message SendPaymentMessage message or plain object to encode + * Encodes the specified HistorySyncMsg message. Does not implicitly {@link proto.HistorySyncMsg.verify|verify} messages. + * @param message HistorySyncMsg message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: proto.ISendPaymentMessage, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: proto.IHistorySyncMsg, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified SendPaymentMessage message, length delimited. Does not implicitly {@link proto.SendPaymentMessage.verify|verify} messages. - * @param message SendPaymentMessage message or plain object to encode + * Encodes the specified HistorySyncMsg message, length delimited. Does not implicitly {@link proto.HistorySyncMsg.verify|verify} messages. + * @param message HistorySyncMsg message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: proto.ISendPaymentMessage, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: proto.IHistorySyncMsg, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a SendPaymentMessage message from the specified reader or buffer. + * Decodes a HistorySyncMsg message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns SendPaymentMessage + * @returns HistorySyncMsg * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.SendPaymentMessage; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.HistorySyncMsg; /** - * Decodes a SendPaymentMessage message from the specified reader or buffer, length delimited. + * Decodes a HistorySyncMsg message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns SendPaymentMessage + * @returns HistorySyncMsg * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.SendPaymentMessage; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.HistorySyncMsg; /** - * Verifies a SendPaymentMessage message. + * Verifies a HistorySyncMsg message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a SendPaymentMessage message from a plain object. Also converts values to their respective internal types. + * Creates a HistorySyncMsg message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns SendPaymentMessage + * @returns HistorySyncMsg */ - public static fromObject(object: { [k: string]: any }): proto.SendPaymentMessage; + public static fromObject(object: { [k: string]: any }): proto.HistorySyncMsg; /** - * Creates a plain object from a SendPaymentMessage message. Also converts values to other types if specified. - * @param message SendPaymentMessage + * Creates a plain object from a HistorySyncMsg message. Also converts values to other types if specified. + * @param message HistorySyncMsg * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: proto.SendPaymentMessage, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SendPaymentMessage to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a RequestPaymentMessage. */ - interface IRequestPaymentMessage { - - /** RequestPaymentMessage noteMessage */ - noteMessage?: (proto.IMessage|null); - - /** RequestPaymentMessage currencyCodeIso4217 */ - currencyCodeIso4217?: (string|null); + * @returns Plain object + */ + public static toObject(message: proto.HistorySyncMsg, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** RequestPaymentMessage amount1000 */ - amount1000?: (number|Long|null); + /** + * Converts this HistorySyncMsg to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** RequestPaymentMessage requestFrom */ - requestFrom?: (string|null); + /** MediaVisibility enum. */ + enum MediaVisibility { + DEFAULT = 0, + OFF = 1, + ON = 2 + } - /** RequestPaymentMessage expiryTimestamp */ - expiryTimestamp?: (number|Long|null); + /** Properties of a Pushname. */ + interface IPushname { - /** RequestPaymentMessage amount */ - amount?: (proto.IMoney|null); + /** Pushname id */ + id?: (string|null); - /** RequestPaymentMessage background */ - background?: (proto.IPaymentBackground|null); + /** Pushname pushname */ + pushname?: (string|null); } - /** Represents a RequestPaymentMessage. */ - class RequestPaymentMessage implements IRequestPaymentMessage { + /** Represents a Pushname. */ + class Pushname implements IPushname { /** - * Constructs a new RequestPaymentMessage. + * Constructs a new Pushname. * @param [properties] Properties to set */ - constructor(properties?: proto.IRequestPaymentMessage); - - /** RequestPaymentMessage noteMessage. */ - public noteMessage?: (proto.IMessage|null); - - /** RequestPaymentMessage currencyCodeIso4217. */ - public currencyCodeIso4217: string; - - /** RequestPaymentMessage amount1000. */ - public amount1000: (number|Long); - - /** RequestPaymentMessage requestFrom. */ - public requestFrom: string; - - /** RequestPaymentMessage expiryTimestamp. */ - public expiryTimestamp: (number|Long); + constructor(properties?: proto.IPushname); - /** RequestPaymentMessage amount. */ - public amount?: (proto.IMoney|null); + /** Pushname id. */ + public id: string; - /** RequestPaymentMessage background. */ - public background?: (proto.IPaymentBackground|null); + /** Pushname pushname. */ + public pushname: string; /** - * Creates a new RequestPaymentMessage instance using the specified properties. + * Creates a new Pushname instance using the specified properties. * @param [properties] Properties to set - * @returns RequestPaymentMessage instance + * @returns Pushname instance */ - public static create(properties?: proto.IRequestPaymentMessage): proto.RequestPaymentMessage; + public static create(properties?: proto.IPushname): proto.Pushname; /** - * Encodes the specified RequestPaymentMessage message. Does not implicitly {@link proto.RequestPaymentMessage.verify|verify} messages. - * @param message RequestPaymentMessage message or plain object to encode + * Encodes the specified Pushname message. Does not implicitly {@link proto.Pushname.verify|verify} messages. + * @param message Pushname message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: proto.IRequestPaymentMessage, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: proto.IPushname, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified RequestPaymentMessage message, length delimited. Does not implicitly {@link proto.RequestPaymentMessage.verify|verify} messages. - * @param message RequestPaymentMessage message or plain object to encode + * Encodes the specified Pushname message, length delimited. Does not implicitly {@link proto.Pushname.verify|verify} messages. + * @param message Pushname message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: proto.IRequestPaymentMessage, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: proto.IPushname, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a RequestPaymentMessage message from the specified reader or buffer. + * Decodes a Pushname message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns RequestPaymentMessage + * @returns Pushname * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.RequestPaymentMessage; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.Pushname; /** - * Decodes a RequestPaymentMessage message from the specified reader or buffer, length delimited. + * Decodes a Pushname message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns RequestPaymentMessage + * @returns Pushname * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.RequestPaymentMessage; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.Pushname; /** - * Verifies a RequestPaymentMessage message. + * Verifies a Pushname message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a RequestPaymentMessage message from a plain object. Also converts values to their respective internal types. + * Creates a Pushname message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns RequestPaymentMessage + * @returns Pushname */ - public static fromObject(object: { [k: string]: any }): proto.RequestPaymentMessage; + public static fromObject(object: { [k: string]: any }): proto.Pushname; /** - * Creates a plain object from a RequestPaymentMessage message. Also converts values to other types if specified. - * @param message RequestPaymentMessage + * Creates a plain object from a Pushname message. Also converts values to other types if specified. + * @param message Pushname * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: proto.RequestPaymentMessage, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: proto.Pushname, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this RequestPaymentMessage to JSON. + * Converts this Pushname to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a DeclinePaymentRequestMessage. */ - interface IDeclinePaymentRequestMessage { + /** Properties of a WallpaperSettings. */ + interface IWallpaperSettings { - /** DeclinePaymentRequestMessage key */ - key?: (proto.IMessageKey|null); + /** WallpaperSettings filename */ + filename?: (string|null); + + /** WallpaperSettings opacity */ + opacity?: (number|null); } - /** Represents a DeclinePaymentRequestMessage. */ - class DeclinePaymentRequestMessage implements IDeclinePaymentRequestMessage { + /** Represents a WallpaperSettings. */ + class WallpaperSettings implements IWallpaperSettings { /** - * Constructs a new DeclinePaymentRequestMessage. + * Constructs a new WallpaperSettings. * @param [properties] Properties to set */ - constructor(properties?: proto.IDeclinePaymentRequestMessage); + constructor(properties?: proto.IWallpaperSettings); - /** DeclinePaymentRequestMessage key. */ - public key?: (proto.IMessageKey|null); + /** WallpaperSettings filename. */ + public filename: string; + + /** WallpaperSettings opacity. */ + public opacity: number; /** - * Creates a new DeclinePaymentRequestMessage instance using the specified properties. + * Creates a new WallpaperSettings instance using the specified properties. * @param [properties] Properties to set - * @returns DeclinePaymentRequestMessage instance + * @returns WallpaperSettings instance */ - public static create(properties?: proto.IDeclinePaymentRequestMessage): proto.DeclinePaymentRequestMessage; + public static create(properties?: proto.IWallpaperSettings): proto.WallpaperSettings; /** - * Encodes the specified DeclinePaymentRequestMessage message. Does not implicitly {@link proto.DeclinePaymentRequestMessage.verify|verify} messages. - * @param message DeclinePaymentRequestMessage message or plain object to encode + * Encodes the specified WallpaperSettings message. Does not implicitly {@link proto.WallpaperSettings.verify|verify} messages. + * @param message WallpaperSettings message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: proto.IDeclinePaymentRequestMessage, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: proto.IWallpaperSettings, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified DeclinePaymentRequestMessage message, length delimited. Does not implicitly {@link proto.DeclinePaymentRequestMessage.verify|verify} messages. - * @param message DeclinePaymentRequestMessage message or plain object to encode + * Encodes the specified WallpaperSettings message, length delimited. Does not implicitly {@link proto.WallpaperSettings.verify|verify} messages. + * @param message WallpaperSettings message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: proto.IDeclinePaymentRequestMessage, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: proto.IWallpaperSettings, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a DeclinePaymentRequestMessage message from the specified reader or buffer. + * Decodes a WallpaperSettings message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns DeclinePaymentRequestMessage + * @returns WallpaperSettings * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.DeclinePaymentRequestMessage; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.WallpaperSettings; /** - * Decodes a DeclinePaymentRequestMessage message from the specified reader or buffer, length delimited. + * Decodes a WallpaperSettings message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns DeclinePaymentRequestMessage + * @returns WallpaperSettings * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.DeclinePaymentRequestMessage; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.WallpaperSettings; /** - * Verifies a DeclinePaymentRequestMessage message. + * Verifies a WallpaperSettings message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a DeclinePaymentRequestMessage message from a plain object. Also converts values to their respective internal types. + * Creates a WallpaperSettings message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns DeclinePaymentRequestMessage + * @returns WallpaperSettings */ - public static fromObject(object: { [k: string]: any }): proto.DeclinePaymentRequestMessage; + public static fromObject(object: { [k: string]: any }): proto.WallpaperSettings; /** - * Creates a plain object from a DeclinePaymentRequestMessage message. Also converts values to other types if specified. - * @param message DeclinePaymentRequestMessage + * Creates a plain object from a WallpaperSettings message. Also converts values to other types if specified. + * @param message WallpaperSettings * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: proto.DeclinePaymentRequestMessage, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: proto.WallpaperSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WallpaperSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a MsgOpaqueData. */ + interface IMsgOpaqueData { + + /** MsgOpaqueData body */ + body?: (string|null); + + /** MsgOpaqueData caption */ + caption?: (string|null); + + /** MsgOpaqueData lng */ + lng?: (number|null); + + /** MsgOpaqueData isLive */ + isLive?: (boolean|null); + + /** MsgOpaqueData lat */ + lat?: (number|null); + + /** MsgOpaqueData paymentAmount1000 */ + paymentAmount1000?: (number|null); + + /** MsgOpaqueData paymentNoteMsgBody */ + paymentNoteMsgBody?: (string|null); + + /** MsgOpaqueData canonicalUrl */ + canonicalUrl?: (string|null); + + /** MsgOpaqueData matchedText */ + matchedText?: (string|null); + + /** MsgOpaqueData title */ + title?: (string|null); + + /** MsgOpaqueData description */ + description?: (string|null); + + /** MsgOpaqueData futureproofBuffer */ + futureproofBuffer?: (Uint8Array|null); + + /** MsgOpaqueData clientUrl */ + clientUrl?: (string|null); + + /** MsgOpaqueData loc */ + loc?: (string|null); + } + + /** Represents a MsgOpaqueData. */ + class MsgOpaqueData implements IMsgOpaqueData { + + /** + * Constructs a new MsgOpaqueData. + * @param [properties] Properties to set + */ + constructor(properties?: proto.IMsgOpaqueData); + + /** MsgOpaqueData body. */ + public body: string; + + /** MsgOpaqueData caption. */ + public caption: string; + + /** MsgOpaqueData lng. */ + public lng: number; + + /** MsgOpaqueData isLive. */ + public isLive: boolean; + + /** MsgOpaqueData lat. */ + public lat: number; + + /** MsgOpaqueData paymentAmount1000. */ + public paymentAmount1000: number; - /** - * Converts this DeclinePaymentRequestMessage to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** MsgOpaqueData paymentNoteMsgBody. */ + public paymentNoteMsgBody: string; - /** Properties of a CancelPaymentRequestMessage. */ - interface ICancelPaymentRequestMessage { + /** MsgOpaqueData canonicalUrl. */ + public canonicalUrl: string; - /** CancelPaymentRequestMessage key */ - key?: (proto.IMessageKey|null); - } + /** MsgOpaqueData matchedText. */ + public matchedText: string; - /** Represents a CancelPaymentRequestMessage. */ - class CancelPaymentRequestMessage implements ICancelPaymentRequestMessage { + /** MsgOpaqueData title. */ + public title: string; - /** - * Constructs a new CancelPaymentRequestMessage. - * @param [properties] Properties to set - */ - constructor(properties?: proto.ICancelPaymentRequestMessage); + /** MsgOpaqueData description. */ + public description: string; - /** CancelPaymentRequestMessage key. */ - public key?: (proto.IMessageKey|null); + /** MsgOpaqueData futureproofBuffer. */ + public futureproofBuffer: Uint8Array; + + /** MsgOpaqueData clientUrl. */ + public clientUrl: string; + + /** MsgOpaqueData loc. */ + public loc: string; /** - * Creates a new CancelPaymentRequestMessage instance using the specified properties. + * Creates a new MsgOpaqueData instance using the specified properties. * @param [properties] Properties to set - * @returns CancelPaymentRequestMessage instance + * @returns MsgOpaqueData instance */ - public static create(properties?: proto.ICancelPaymentRequestMessage): proto.CancelPaymentRequestMessage; + public static create(properties?: proto.IMsgOpaqueData): proto.MsgOpaqueData; /** - * Encodes the specified CancelPaymentRequestMessage message. Does not implicitly {@link proto.CancelPaymentRequestMessage.verify|verify} messages. - * @param message CancelPaymentRequestMessage message or plain object to encode + * Encodes the specified MsgOpaqueData message. Does not implicitly {@link proto.MsgOpaqueData.verify|verify} messages. + * @param message MsgOpaqueData message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: proto.ICancelPaymentRequestMessage, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: proto.IMsgOpaqueData, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified CancelPaymentRequestMessage message, length delimited. Does not implicitly {@link proto.CancelPaymentRequestMessage.verify|verify} messages. - * @param message CancelPaymentRequestMessage message or plain object to encode + * Encodes the specified MsgOpaqueData message, length delimited. Does not implicitly {@link proto.MsgOpaqueData.verify|verify} messages. + * @param message MsgOpaqueData message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: proto.ICancelPaymentRequestMessage, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: proto.IMsgOpaqueData, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a CancelPaymentRequestMessage message from the specified reader or buffer. + * Decodes a MsgOpaqueData message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns CancelPaymentRequestMessage + * @returns MsgOpaqueData * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.CancelPaymentRequestMessage; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.MsgOpaqueData; /** - * Decodes a CancelPaymentRequestMessage message from the specified reader or buffer, length delimited. + * Decodes a MsgOpaqueData message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns CancelPaymentRequestMessage + * @returns MsgOpaqueData * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.CancelPaymentRequestMessage; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.MsgOpaqueData; /** - * Verifies a CancelPaymentRequestMessage message. + * Verifies a MsgOpaqueData message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a CancelPaymentRequestMessage message from a plain object. Also converts values to their respective internal types. + * Creates a MsgOpaqueData message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns CancelPaymentRequestMessage + * @returns MsgOpaqueData */ - public static fromObject(object: { [k: string]: any }): proto.CancelPaymentRequestMessage; + public static fromObject(object: { [k: string]: any }): proto.MsgOpaqueData; /** - * Creates a plain object from a CancelPaymentRequestMessage message. Also converts values to other types if specified. - * @param message CancelPaymentRequestMessage + * Creates a plain object from a MsgOpaqueData message. Also converts values to other types if specified. + * @param message MsgOpaqueData * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: proto.CancelPaymentRequestMessage, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: proto.MsgOpaqueData, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this CancelPaymentRequestMessage to JSON. + * Converts this MsgOpaqueData to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a PaymentInviteMessage. */ - interface IPaymentInviteMessage { + /** Properties of a MsgRowOpaqueData. */ + interface IMsgRowOpaqueData { - /** PaymentInviteMessage serviceType */ - serviceType?: (proto.PaymentInviteMessage.PaymentInviteMessageServiceType|null); + /** MsgRowOpaqueData currentMsg */ + currentMsg?: (proto.IMsgOpaqueData|null); - /** PaymentInviteMessage expiryTimestamp */ - expiryTimestamp?: (number|Long|null); + /** MsgRowOpaqueData quotedMsg */ + quotedMsg?: (proto.IMsgOpaqueData|null); } - /** Represents a PaymentInviteMessage. */ - class PaymentInviteMessage implements IPaymentInviteMessage { + /** Represents a MsgRowOpaqueData. */ + class MsgRowOpaqueData implements IMsgRowOpaqueData { /** - * Constructs a new PaymentInviteMessage. + * Constructs a new MsgRowOpaqueData. * @param [properties] Properties to set */ - constructor(properties?: proto.IPaymentInviteMessage); + constructor(properties?: proto.IMsgRowOpaqueData); - /** PaymentInviteMessage serviceType. */ - public serviceType: proto.PaymentInviteMessage.PaymentInviteMessageServiceType; + /** MsgRowOpaqueData currentMsg. */ + public currentMsg?: (proto.IMsgOpaqueData|null); - /** PaymentInviteMessage expiryTimestamp. */ - public expiryTimestamp: (number|Long); + /** MsgRowOpaqueData quotedMsg. */ + public quotedMsg?: (proto.IMsgOpaqueData|null); /** - * Creates a new PaymentInviteMessage instance using the specified properties. + * Creates a new MsgRowOpaqueData instance using the specified properties. * @param [properties] Properties to set - * @returns PaymentInviteMessage instance + * @returns MsgRowOpaqueData instance */ - public static create(properties?: proto.IPaymentInviteMessage): proto.PaymentInviteMessage; + public static create(properties?: proto.IMsgRowOpaqueData): proto.MsgRowOpaqueData; /** - * Encodes the specified PaymentInviteMessage message. Does not implicitly {@link proto.PaymentInviteMessage.verify|verify} messages. - * @param message PaymentInviteMessage message or plain object to encode + * Encodes the specified MsgRowOpaqueData message. Does not implicitly {@link proto.MsgRowOpaqueData.verify|verify} messages. + * @param message MsgRowOpaqueData message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: proto.IPaymentInviteMessage, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: proto.IMsgRowOpaqueData, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified PaymentInviteMessage message, length delimited. Does not implicitly {@link proto.PaymentInviteMessage.verify|verify} messages. - * @param message PaymentInviteMessage message or plain object to encode + * Encodes the specified MsgRowOpaqueData message, length delimited. Does not implicitly {@link proto.MsgRowOpaqueData.verify|verify} messages. + * @param message MsgRowOpaqueData message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: proto.IPaymentInviteMessage, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: proto.IMsgRowOpaqueData, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a PaymentInviteMessage message from the specified reader or buffer. + * Decodes a MsgRowOpaqueData message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns PaymentInviteMessage + * @returns MsgRowOpaqueData * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.PaymentInviteMessage; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.MsgRowOpaqueData; /** - * Decodes a PaymentInviteMessage message from the specified reader or buffer, length delimited. + * Decodes a MsgRowOpaqueData message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns PaymentInviteMessage + * @returns MsgRowOpaqueData * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.PaymentInviteMessage; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.MsgRowOpaqueData; /** - * Verifies a PaymentInviteMessage message. + * Verifies a MsgRowOpaqueData message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a PaymentInviteMessage message from a plain object. Also converts values to their respective internal types. + * Creates a MsgRowOpaqueData message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns PaymentInviteMessage + * @returns MsgRowOpaqueData */ - public static fromObject(object: { [k: string]: any }): proto.PaymentInviteMessage; + public static fromObject(object: { [k: string]: any }): proto.MsgRowOpaqueData; /** - * Creates a plain object from a PaymentInviteMessage message. Also converts values to other types if specified. - * @param message PaymentInviteMessage + * Creates a plain object from a MsgRowOpaqueData message. Also converts values to other types if specified. + * @param message MsgRowOpaqueData * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: proto.PaymentInviteMessage, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: proto.MsgRowOpaqueData, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this PaymentInviteMessage to JSON. + * Converts this MsgRowOpaqueData to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - namespace PaymentInviteMessage { - - /** PaymentInviteMessageServiceType enum. */ - enum PaymentInviteMessageServiceType { - UNKNOWN = 0, - FBPAY = 1, - NOVI = 2, - UPI = 3 - } - } - - /** Properties of a LiveLocationMessage. */ - interface ILiveLocationMessage { - - /** LiveLocationMessage degreesLatitude */ - degreesLatitude?: (number|null); - - /** LiveLocationMessage degreesLongitude */ - degreesLongitude?: (number|null); - - /** LiveLocationMessage accuracyInMeters */ - accuracyInMeters?: (number|null); - - /** LiveLocationMessage speedInMps */ - speedInMps?: (number|null); - - /** LiveLocationMessage degreesClockwiseFromMagneticNorth */ - degreesClockwiseFromMagneticNorth?: (number|null); - - /** LiveLocationMessage caption */ - caption?: (string|null); - - /** LiveLocationMessage sequenceNumber */ - sequenceNumber?: (number|Long|null); + /** Properties of a MediaRetryNotification. */ + interface IMediaRetryNotification { - /** LiveLocationMessage timeOffset */ - timeOffset?: (number|null); + /** MediaRetryNotification stanzaId */ + stanzaId?: (string|null); - /** LiveLocationMessage jpegThumbnail */ - jpegThumbnail?: (Uint8Array|null); + /** MediaRetryNotification directPath */ + directPath?: (string|null); - /** LiveLocationMessage contextInfo */ - contextInfo?: (proto.IContextInfo|null); + /** MediaRetryNotification result */ + result?: (proto.MediaRetryNotification.MediaRetryNotificationResultType|null); } - /** Represents a LiveLocationMessage. */ - class LiveLocationMessage implements ILiveLocationMessage { + /** Represents a MediaRetryNotification. */ + class MediaRetryNotification implements IMediaRetryNotification { /** - * Constructs a new LiveLocationMessage. + * Constructs a new MediaRetryNotification. * @param [properties] Properties to set */ - constructor(properties?: proto.ILiveLocationMessage); - - /** LiveLocationMessage degreesLatitude. */ - public degreesLatitude: number; - - /** LiveLocationMessage degreesLongitude. */ - public degreesLongitude: number; - - /** LiveLocationMessage accuracyInMeters. */ - public accuracyInMeters: number; - - /** LiveLocationMessage speedInMps. */ - public speedInMps: number; - - /** LiveLocationMessage degreesClockwiseFromMagneticNorth. */ - public degreesClockwiseFromMagneticNorth: number; - - /** LiveLocationMessage caption. */ - public caption: string; - - /** LiveLocationMessage sequenceNumber. */ - public sequenceNumber: (number|Long); + constructor(properties?: proto.IMediaRetryNotification); - /** LiveLocationMessage timeOffset. */ - public timeOffset: number; + /** MediaRetryNotification stanzaId. */ + public stanzaId: string; - /** LiveLocationMessage jpegThumbnail. */ - public jpegThumbnail: Uint8Array; + /** MediaRetryNotification directPath. */ + public directPath: string; - /** LiveLocationMessage contextInfo. */ - public contextInfo?: (proto.IContextInfo|null); + /** MediaRetryNotification result. */ + public result: proto.MediaRetryNotification.MediaRetryNotificationResultType; /** - * Creates a new LiveLocationMessage instance using the specified properties. + * Creates a new MediaRetryNotification instance using the specified properties. * @param [properties] Properties to set - * @returns LiveLocationMessage instance + * @returns MediaRetryNotification instance */ - public static create(properties?: proto.ILiveLocationMessage): proto.LiveLocationMessage; + public static create(properties?: proto.IMediaRetryNotification): proto.MediaRetryNotification; /** - * Encodes the specified LiveLocationMessage message. Does not implicitly {@link proto.LiveLocationMessage.verify|verify} messages. - * @param message LiveLocationMessage message or plain object to encode + * Encodes the specified MediaRetryNotification message. Does not implicitly {@link proto.MediaRetryNotification.verify|verify} messages. + * @param message MediaRetryNotification message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: proto.ILiveLocationMessage, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: proto.IMediaRetryNotification, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified LiveLocationMessage message, length delimited. Does not implicitly {@link proto.LiveLocationMessage.verify|verify} messages. - * @param message LiveLocationMessage message or plain object to encode + * Encodes the specified MediaRetryNotification message, length delimited. Does not implicitly {@link proto.MediaRetryNotification.verify|verify} messages. + * @param message MediaRetryNotification message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: proto.ILiveLocationMessage, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: proto.IMediaRetryNotification, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a LiveLocationMessage message from the specified reader or buffer. + * Decodes a MediaRetryNotification message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns LiveLocationMessage + * @returns MediaRetryNotification * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.LiveLocationMessage; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.MediaRetryNotification; /** - * Decodes a LiveLocationMessage message from the specified reader or buffer, length delimited. + * Decodes a MediaRetryNotification message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns LiveLocationMessage + * @returns MediaRetryNotification * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.LiveLocationMessage; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.MediaRetryNotification; /** - * Verifies a LiveLocationMessage message. + * Verifies a MediaRetryNotification message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a LiveLocationMessage message from a plain object. Also converts values to their respective internal types. + * Creates a MediaRetryNotification message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns LiveLocationMessage + * @returns MediaRetryNotification */ - public static fromObject(object: { [k: string]: any }): proto.LiveLocationMessage; + public static fromObject(object: { [k: string]: any }): proto.MediaRetryNotification; /** - * Creates a plain object from a LiveLocationMessage message. Also converts values to other types if specified. - * @param message LiveLocationMessage + * Creates a plain object from a MediaRetryNotification message. Also converts values to other types if specified. + * @param message MediaRetryNotification * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: proto.LiveLocationMessage, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: proto.MediaRetryNotification, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this LiveLocationMessage to JSON. + * Converts this MediaRetryNotification to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a StickerMessage. */ - interface IStickerMessage { - - /** StickerMessage url */ - url?: (string|null); - - /** StickerMessage fileSha256 */ - fileSha256?: (Uint8Array|null); - - /** StickerMessage fileEncSha256 */ - fileEncSha256?: (Uint8Array|null); - - /** StickerMessage mediaKey */ - mediaKey?: (Uint8Array|null); - - /** StickerMessage mimetype */ - mimetype?: (string|null); - - /** StickerMessage height */ - height?: (number|null); - - /** StickerMessage width */ - width?: (number|null); - - /** StickerMessage directPath */ - directPath?: (string|null); - - /** StickerMessage fileLength */ - fileLength?: (number|Long|null); - - /** StickerMessage mediaKeyTimestamp */ - mediaKeyTimestamp?: (number|Long|null); - - /** StickerMessage firstFrameLength */ - firstFrameLength?: (number|null); - - /** StickerMessage firstFrameSidecar */ - firstFrameSidecar?: (Uint8Array|null); + namespace MediaRetryNotification { - /** StickerMessage isAnimated */ - isAnimated?: (boolean|null); + /** MediaRetryNotificationResultType enum. */ + enum MediaRetryNotificationResultType { + GENERAL_ERROR = 0, + SUCCESS = 1, + NOT_FOUND = 2, + DECRYPTION_ERROR = 3 + } + } - /** StickerMessage pngThumbnail */ - pngThumbnail?: (Uint8Array|null); + /** Properties of a ServerErrorReceipt. */ + interface IServerErrorReceipt { - /** StickerMessage contextInfo */ - contextInfo?: (proto.IContextInfo|null); + /** ServerErrorReceipt stanzaId */ + stanzaId?: (string|null); } - /** Represents a StickerMessage. */ - class StickerMessage implements IStickerMessage { + /** Represents a ServerErrorReceipt. */ + class ServerErrorReceipt implements IServerErrorReceipt { /** - * Constructs a new StickerMessage. + * Constructs a new ServerErrorReceipt. * @param [properties] Properties to set */ - constructor(properties?: proto.IStickerMessage); - - /** StickerMessage url. */ - public url: string; - - /** StickerMessage fileSha256. */ - public fileSha256: Uint8Array; - - /** StickerMessage fileEncSha256. */ - public fileEncSha256: Uint8Array; - - /** StickerMessage mediaKey. */ - public mediaKey: Uint8Array; - - /** StickerMessage mimetype. */ - public mimetype: string; - - /** StickerMessage height. */ - public height: number; - - /** StickerMessage width. */ - public width: number; - - /** StickerMessage directPath. */ - public directPath: string; - - /** StickerMessage fileLength. */ - public fileLength: (number|Long); - - /** StickerMessage mediaKeyTimestamp. */ - public mediaKeyTimestamp: (number|Long); - - /** StickerMessage firstFrameLength. */ - public firstFrameLength: number; - - /** StickerMessage firstFrameSidecar. */ - public firstFrameSidecar: Uint8Array; - - /** StickerMessage isAnimated. */ - public isAnimated: boolean; - - /** StickerMessage pngThumbnail. */ - public pngThumbnail: Uint8Array; + constructor(properties?: proto.IServerErrorReceipt); - /** StickerMessage contextInfo. */ - public contextInfo?: (proto.IContextInfo|null); + /** ServerErrorReceipt stanzaId. */ + public stanzaId: string; /** - * Creates a new StickerMessage instance using the specified properties. + * Creates a new ServerErrorReceipt instance using the specified properties. * @param [properties] Properties to set - * @returns StickerMessage instance + * @returns ServerErrorReceipt instance */ - public static create(properties?: proto.IStickerMessage): proto.StickerMessage; + public static create(properties?: proto.IServerErrorReceipt): proto.ServerErrorReceipt; /** - * Encodes the specified StickerMessage message. Does not implicitly {@link proto.StickerMessage.verify|verify} messages. - * @param message StickerMessage message or plain object to encode + * Encodes the specified ServerErrorReceipt message. Does not implicitly {@link proto.ServerErrorReceipt.verify|verify} messages. + * @param message ServerErrorReceipt message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: proto.IStickerMessage, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: proto.IServerErrorReceipt, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified StickerMessage message, length delimited. Does not implicitly {@link proto.StickerMessage.verify|verify} messages. - * @param message StickerMessage message or plain object to encode + * Encodes the specified ServerErrorReceipt message, length delimited. Does not implicitly {@link proto.ServerErrorReceipt.verify|verify} messages. + * @param message ServerErrorReceipt message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: proto.IStickerMessage, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: proto.IServerErrorReceipt, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a StickerMessage message from the specified reader or buffer. + * Decodes a ServerErrorReceipt message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns StickerMessage + * @returns ServerErrorReceipt * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.StickerMessage; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.ServerErrorReceipt; /** - * Decodes a StickerMessage message from the specified reader or buffer, length delimited. + * Decodes a ServerErrorReceipt message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns StickerMessage + * @returns ServerErrorReceipt * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.StickerMessage; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.ServerErrorReceipt; /** - * Verifies a StickerMessage message. + * Verifies a ServerErrorReceipt message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a StickerMessage message from a plain object. Also converts values to their respective internal types. + * Creates a ServerErrorReceipt message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns StickerMessage + * @returns ServerErrorReceipt */ - public static fromObject(object: { [k: string]: any }): proto.StickerMessage; + public static fromObject(object: { [k: string]: any }): proto.ServerErrorReceipt; /** - * Creates a plain object from a StickerMessage message. Also converts values to other types if specified. - * @param message StickerMessage + * Creates a plain object from a ServerErrorReceipt message. Also converts values to other types if specified. + * @param message ServerErrorReceipt * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: proto.StickerMessage, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: proto.ServerErrorReceipt, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this StickerMessage to JSON. + * Converts this ServerErrorReceipt to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a FourRowTemplate. */ - interface IFourRowTemplate { - - /** FourRowTemplate content */ - content?: (proto.IHighlyStructuredMessage|null); - - /** FourRowTemplate footer */ - footer?: (proto.IHighlyStructuredMessage|null); - - /** FourRowTemplate buttons */ - buttons?: (proto.ITemplateButton[]|null); - - /** FourRowTemplate documentMessage */ - documentMessage?: (proto.IDocumentMessage|null); + /** Properties of a MessageKey. */ + interface IMessageKey { - /** FourRowTemplate highlyStructuredMessage */ - highlyStructuredMessage?: (proto.IHighlyStructuredMessage|null); + /** MessageKey remoteJid */ + remoteJid?: (string|null); - /** FourRowTemplate imageMessage */ - imageMessage?: (proto.IImageMessage|null); + /** MessageKey fromMe */ + fromMe?: (boolean|null); - /** FourRowTemplate videoMessage */ - videoMessage?: (proto.IVideoMessage|null); + /** MessageKey id */ + id?: (string|null); - /** FourRowTemplate locationMessage */ - locationMessage?: (proto.ILocationMessage|null); + /** MessageKey participant */ + participant?: (string|null); } - /** Represents a FourRowTemplate. */ - class FourRowTemplate implements IFourRowTemplate { + /** Represents a MessageKey. */ + class MessageKey implements IMessageKey { /** - * Constructs a new FourRowTemplate. + * Constructs a new MessageKey. * @param [properties] Properties to set */ - constructor(properties?: proto.IFourRowTemplate); - - /** FourRowTemplate content. */ - public content?: (proto.IHighlyStructuredMessage|null); - - /** FourRowTemplate footer. */ - public footer?: (proto.IHighlyStructuredMessage|null); - - /** FourRowTemplate buttons. */ - public buttons: proto.ITemplateButton[]; - - /** FourRowTemplate documentMessage. */ - public documentMessage?: (proto.IDocumentMessage|null); - - /** FourRowTemplate highlyStructuredMessage. */ - public highlyStructuredMessage?: (proto.IHighlyStructuredMessage|null); + constructor(properties?: proto.IMessageKey); - /** FourRowTemplate imageMessage. */ - public imageMessage?: (proto.IImageMessage|null); + /** MessageKey remoteJid. */ + public remoteJid: string; - /** FourRowTemplate videoMessage. */ - public videoMessage?: (proto.IVideoMessage|null); + /** MessageKey fromMe. */ + public fromMe: boolean; - /** FourRowTemplate locationMessage. */ - public locationMessage?: (proto.ILocationMessage|null); + /** MessageKey id. */ + public id: string; - /** FourRowTemplate title. */ - public title?: ("documentMessage"|"highlyStructuredMessage"|"imageMessage"|"videoMessage"|"locationMessage"); + /** MessageKey participant. */ + public participant: string; /** - * Creates a new FourRowTemplate instance using the specified properties. + * Creates a new MessageKey instance using the specified properties. * @param [properties] Properties to set - * @returns FourRowTemplate instance + * @returns MessageKey instance */ - public static create(properties?: proto.IFourRowTemplate): proto.FourRowTemplate; + public static create(properties?: proto.IMessageKey): proto.MessageKey; /** - * Encodes the specified FourRowTemplate message. Does not implicitly {@link proto.FourRowTemplate.verify|verify} messages. - * @param message FourRowTemplate message or plain object to encode + * Encodes the specified MessageKey message. Does not implicitly {@link proto.MessageKey.verify|verify} messages. + * @param message MessageKey message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: proto.IFourRowTemplate, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: proto.IMessageKey, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified FourRowTemplate message, length delimited. Does not implicitly {@link proto.FourRowTemplate.verify|verify} messages. - * @param message FourRowTemplate message or plain object to encode + * Encodes the specified MessageKey message, length delimited. Does not implicitly {@link proto.MessageKey.verify|verify} messages. + * @param message MessageKey message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: proto.IFourRowTemplate, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: proto.IMessageKey, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a FourRowTemplate message from the specified reader or buffer. + * Decodes a MessageKey message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns FourRowTemplate + * @returns MessageKey * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.FourRowTemplate; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.MessageKey; /** - * Decodes a FourRowTemplate message from the specified reader or buffer, length delimited. + * Decodes a MessageKey message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns FourRowTemplate + * @returns MessageKey * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.FourRowTemplate; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.MessageKey; /** - * Verifies a FourRowTemplate message. + * Verifies a MessageKey message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a FourRowTemplate message from a plain object. Also converts values to their respective internal types. + * Creates a MessageKey message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns FourRowTemplate + * @returns MessageKey */ - public static fromObject(object: { [k: string]: any }): proto.FourRowTemplate; + public static fromObject(object: { [k: string]: any }): proto.MessageKey; /** - * Creates a plain object from a FourRowTemplate message. Also converts values to other types if specified. - * @param message FourRowTemplate + * Creates a plain object from a MessageKey message. Also converts values to other types if specified. + * @param message MessageKey * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: proto.FourRowTemplate, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: proto.MessageKey, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this FourRowTemplate to JSON. + * Converts this MessageKey to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a HydratedFourRowTemplate. */ - interface IHydratedFourRowTemplate { - - /** HydratedFourRowTemplate hydratedContentText */ - hydratedContentText?: (string|null); - - /** HydratedFourRowTemplate hydratedFooterText */ - hydratedFooterText?: (string|null); - - /** HydratedFourRowTemplate hydratedButtons */ - hydratedButtons?: (proto.IHydratedTemplateButton[]|null); - - /** HydratedFourRowTemplate templateId */ - templateId?: (string|null); - - /** HydratedFourRowTemplate documentMessage */ - documentMessage?: (proto.IDocumentMessage|null); - - /** HydratedFourRowTemplate hydratedTitleText */ - hydratedTitleText?: (string|null); - - /** HydratedFourRowTemplate imageMessage */ - imageMessage?: (proto.IImageMessage|null); + /** Properties of an ExitCode. */ + interface IExitCode { - /** HydratedFourRowTemplate videoMessage */ - videoMessage?: (proto.IVideoMessage|null); + /** ExitCode code */ + code?: (number|Long|null); - /** HydratedFourRowTemplate locationMessage */ - locationMessage?: (proto.ILocationMessage|null); + /** ExitCode text */ + text?: (string|null); } - /** Represents a HydratedFourRowTemplate. */ - class HydratedFourRowTemplate implements IHydratedFourRowTemplate { + /** Represents an ExitCode. */ + class ExitCode implements IExitCode { /** - * Constructs a new HydratedFourRowTemplate. + * Constructs a new ExitCode. * @param [properties] Properties to set */ - constructor(properties?: proto.IHydratedFourRowTemplate); - - /** HydratedFourRowTemplate hydratedContentText. */ - public hydratedContentText: string; - - /** HydratedFourRowTemplate hydratedFooterText. */ - public hydratedFooterText: string; - - /** HydratedFourRowTemplate hydratedButtons. */ - public hydratedButtons: proto.IHydratedTemplateButton[]; - - /** HydratedFourRowTemplate templateId. */ - public templateId: string; - - /** HydratedFourRowTemplate documentMessage. */ - public documentMessage?: (proto.IDocumentMessage|null); - - /** HydratedFourRowTemplate hydratedTitleText. */ - public hydratedTitleText?: (string|null); - - /** HydratedFourRowTemplate imageMessage. */ - public imageMessage?: (proto.IImageMessage|null); - - /** HydratedFourRowTemplate videoMessage. */ - public videoMessage?: (proto.IVideoMessage|null); + constructor(properties?: proto.IExitCode); - /** HydratedFourRowTemplate locationMessage. */ - public locationMessage?: (proto.ILocationMessage|null); + /** ExitCode code. */ + public code: (number|Long); - /** HydratedFourRowTemplate title. */ - public title?: ("documentMessage"|"hydratedTitleText"|"imageMessage"|"videoMessage"|"locationMessage"); + /** ExitCode text. */ + public text: string; /** - * Creates a new HydratedFourRowTemplate instance using the specified properties. + * Creates a new ExitCode instance using the specified properties. * @param [properties] Properties to set - * @returns HydratedFourRowTemplate instance + * @returns ExitCode instance */ - public static create(properties?: proto.IHydratedFourRowTemplate): proto.HydratedFourRowTemplate; + public static create(properties?: proto.IExitCode): proto.ExitCode; /** - * Encodes the specified HydratedFourRowTemplate message. Does not implicitly {@link proto.HydratedFourRowTemplate.verify|verify} messages. - * @param message HydratedFourRowTemplate message or plain object to encode + * Encodes the specified ExitCode message. Does not implicitly {@link proto.ExitCode.verify|verify} messages. + * @param message ExitCode message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: proto.IHydratedFourRowTemplate, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: proto.IExitCode, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified HydratedFourRowTemplate message, length delimited. Does not implicitly {@link proto.HydratedFourRowTemplate.verify|verify} messages. - * @param message HydratedFourRowTemplate message or plain object to encode + * Encodes the specified ExitCode message, length delimited. Does not implicitly {@link proto.ExitCode.verify|verify} messages. + * @param message ExitCode message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: proto.IHydratedFourRowTemplate, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: proto.IExitCode, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a HydratedFourRowTemplate message from the specified reader or buffer. + * Decodes an ExitCode message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns HydratedFourRowTemplate + * @returns ExitCode * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.HydratedFourRowTemplate; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.ExitCode; /** - * Decodes a HydratedFourRowTemplate message from the specified reader or buffer, length delimited. + * Decodes an ExitCode message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns HydratedFourRowTemplate + * @returns ExitCode * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.HydratedFourRowTemplate; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.ExitCode; /** - * Verifies a HydratedFourRowTemplate message. + * Verifies an ExitCode message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a HydratedFourRowTemplate message from a plain object. Also converts values to their respective internal types. + * Creates an ExitCode message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns HydratedFourRowTemplate + * @returns ExitCode */ - public static fromObject(object: { [k: string]: any }): proto.HydratedFourRowTemplate; + public static fromObject(object: { [k: string]: any }): proto.ExitCode; /** - * Creates a plain object from a HydratedFourRowTemplate message. Also converts values to other types if specified. - * @param message HydratedFourRowTemplate + * Creates a plain object from an ExitCode message. Also converts values to other types if specified. + * @param message ExitCode * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: proto.HydratedFourRowTemplate, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: proto.ExitCode, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this HydratedFourRowTemplate to JSON. + * Converts this ExitCode to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a TemplateMessage. */ - interface ITemplateMessage { + /** Properties of an ExternalBlobReference. */ + interface IExternalBlobReference { - /** TemplateMessage contextInfo */ - contextInfo?: (proto.IContextInfo|null); + /** ExternalBlobReference mediaKey */ + mediaKey?: (Uint8Array|null); - /** TemplateMessage hydratedTemplate */ - hydratedTemplate?: (proto.IHydratedFourRowTemplate|null); + /** ExternalBlobReference directPath */ + directPath?: (string|null); - /** TemplateMessage fourRowTemplate */ - fourRowTemplate?: (proto.IFourRowTemplate|null); + /** ExternalBlobReference handle */ + handle?: (string|null); - /** TemplateMessage hydratedFourRowTemplate */ - hydratedFourRowTemplate?: (proto.IHydratedFourRowTemplate|null); + /** ExternalBlobReference fileSizeBytes */ + fileSizeBytes?: (number|Long|null); + + /** ExternalBlobReference fileSha256 */ + fileSha256?: (Uint8Array|null); + + /** ExternalBlobReference fileEncSha256 */ + fileEncSha256?: (Uint8Array|null); } - /** Represents a TemplateMessage. */ - class TemplateMessage implements ITemplateMessage { + /** Represents an ExternalBlobReference. */ + class ExternalBlobReference implements IExternalBlobReference { /** - * Constructs a new TemplateMessage. + * Constructs a new ExternalBlobReference. * @param [properties] Properties to set */ - constructor(properties?: proto.ITemplateMessage); + constructor(properties?: proto.IExternalBlobReference); - /** TemplateMessage contextInfo. */ - public contextInfo?: (proto.IContextInfo|null); + /** ExternalBlobReference mediaKey. */ + public mediaKey: Uint8Array; - /** TemplateMessage hydratedTemplate. */ - public hydratedTemplate?: (proto.IHydratedFourRowTemplate|null); + /** ExternalBlobReference directPath. */ + public directPath: string; - /** TemplateMessage fourRowTemplate. */ - public fourRowTemplate?: (proto.IFourRowTemplate|null); + /** ExternalBlobReference handle. */ + public handle: string; - /** TemplateMessage hydratedFourRowTemplate. */ - public hydratedFourRowTemplate?: (proto.IHydratedFourRowTemplate|null); + /** ExternalBlobReference fileSizeBytes. */ + public fileSizeBytes: (number|Long); - /** TemplateMessage format. */ - public format?: ("fourRowTemplate"|"hydratedFourRowTemplate"); + /** ExternalBlobReference fileSha256. */ + public fileSha256: Uint8Array; + + /** ExternalBlobReference fileEncSha256. */ + public fileEncSha256: Uint8Array; /** - * Creates a new TemplateMessage instance using the specified properties. + * Creates a new ExternalBlobReference instance using the specified properties. * @param [properties] Properties to set - * @returns TemplateMessage instance + * @returns ExternalBlobReference instance */ - public static create(properties?: proto.ITemplateMessage): proto.TemplateMessage; + public static create(properties?: proto.IExternalBlobReference): proto.ExternalBlobReference; /** - * Encodes the specified TemplateMessage message. Does not implicitly {@link proto.TemplateMessage.verify|verify} messages. - * @param message TemplateMessage message or plain object to encode + * Encodes the specified ExternalBlobReference message. Does not implicitly {@link proto.ExternalBlobReference.verify|verify} messages. + * @param message ExternalBlobReference message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: proto.ITemplateMessage, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: proto.IExternalBlobReference, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified TemplateMessage message, length delimited. Does not implicitly {@link proto.TemplateMessage.verify|verify} messages. - * @param message TemplateMessage message or plain object to encode + * Encodes the specified ExternalBlobReference message, length delimited. Does not implicitly {@link proto.ExternalBlobReference.verify|verify} messages. + * @param message ExternalBlobReference message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: proto.ITemplateMessage, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: proto.IExternalBlobReference, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a TemplateMessage message from the specified reader or buffer. + * Decodes an ExternalBlobReference message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns TemplateMessage + * @returns ExternalBlobReference * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.TemplateMessage; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.ExternalBlobReference; /** - * Decodes a TemplateMessage message from the specified reader or buffer, length delimited. + * Decodes an ExternalBlobReference message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns TemplateMessage + * @returns ExternalBlobReference * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.TemplateMessage; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.ExternalBlobReference; /** - * Verifies a TemplateMessage message. + * Verifies an ExternalBlobReference message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a TemplateMessage message from a plain object. Also converts values to their respective internal types. + * Creates an ExternalBlobReference message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns TemplateMessage + * @returns ExternalBlobReference */ - public static fromObject(object: { [k: string]: any }): proto.TemplateMessage; + public static fromObject(object: { [k: string]: any }): proto.ExternalBlobReference; /** - * Creates a plain object from a TemplateMessage message. Also converts values to other types if specified. - * @param message TemplateMessage + * Creates a plain object from an ExternalBlobReference message. Also converts values to other types if specified. + * @param message ExternalBlobReference * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: proto.TemplateMessage, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: proto.ExternalBlobReference, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this TemplateMessage to JSON. + * Converts this ExternalBlobReference to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a TemplateButtonReplyMessage. */ - interface ITemplateButtonReplyMessage { - - /** TemplateButtonReplyMessage selectedId */ - selectedId?: (string|null); - - /** TemplateButtonReplyMessage selectedDisplayText */ - selectedDisplayText?: (string|null); - - /** TemplateButtonReplyMessage contextInfo */ - contextInfo?: (proto.IContextInfo|null); + /** Properties of a KeyId. */ + interface IKeyId { - /** TemplateButtonReplyMessage selectedIndex */ - selectedIndex?: (number|null); + /** KeyId id */ + id?: (Uint8Array|null); } - /** Represents a TemplateButtonReplyMessage. */ - class TemplateButtonReplyMessage implements ITemplateButtonReplyMessage { + /** Represents a KeyId. */ + class KeyId implements IKeyId { /** - * Constructs a new TemplateButtonReplyMessage. + * Constructs a new KeyId. * @param [properties] Properties to set */ - constructor(properties?: proto.ITemplateButtonReplyMessage); - - /** TemplateButtonReplyMessage selectedId. */ - public selectedId: string; - - /** TemplateButtonReplyMessage selectedDisplayText. */ - public selectedDisplayText: string; - - /** TemplateButtonReplyMessage contextInfo. */ - public contextInfo?: (proto.IContextInfo|null); + constructor(properties?: proto.IKeyId); - /** TemplateButtonReplyMessage selectedIndex. */ - public selectedIndex: number; + /** KeyId id. */ + public id: Uint8Array; /** - * Creates a new TemplateButtonReplyMessage instance using the specified properties. + * Creates a new KeyId instance using the specified properties. * @param [properties] Properties to set - * @returns TemplateButtonReplyMessage instance + * @returns KeyId instance */ - public static create(properties?: proto.ITemplateButtonReplyMessage): proto.TemplateButtonReplyMessage; + public static create(properties?: proto.IKeyId): proto.KeyId; /** - * Encodes the specified TemplateButtonReplyMessage message. Does not implicitly {@link proto.TemplateButtonReplyMessage.verify|verify} messages. - * @param message TemplateButtonReplyMessage message or plain object to encode + * Encodes the specified KeyId message. Does not implicitly {@link proto.KeyId.verify|verify} messages. + * @param message KeyId message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: proto.ITemplateButtonReplyMessage, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: proto.IKeyId, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified TemplateButtonReplyMessage message, length delimited. Does not implicitly {@link proto.TemplateButtonReplyMessage.verify|verify} messages. - * @param message TemplateButtonReplyMessage message or plain object to encode + * Encodes the specified KeyId message, length delimited. Does not implicitly {@link proto.KeyId.verify|verify} messages. + * @param message KeyId message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: proto.ITemplateButtonReplyMessage, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: proto.IKeyId, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a TemplateButtonReplyMessage message from the specified reader or buffer. + * Decodes a KeyId message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns TemplateButtonReplyMessage + * @returns KeyId * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.TemplateButtonReplyMessage; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.KeyId; /** - * Decodes a TemplateButtonReplyMessage message from the specified reader or buffer, length delimited. + * Decodes a KeyId message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns TemplateButtonReplyMessage + * @returns KeyId * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.TemplateButtonReplyMessage; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.KeyId; /** - * Verifies a TemplateButtonReplyMessage message. + * Verifies a KeyId message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a TemplateButtonReplyMessage message from a plain object. Also converts values to their respective internal types. + * Creates a KeyId message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns TemplateButtonReplyMessage + * @returns KeyId */ - public static fromObject(object: { [k: string]: any }): proto.TemplateButtonReplyMessage; + public static fromObject(object: { [k: string]: any }): proto.KeyId; /** - * Creates a plain object from a TemplateButtonReplyMessage message. Also converts values to other types if specified. - * @param message TemplateButtonReplyMessage + * Creates a plain object from a KeyId message. Also converts values to other types if specified. + * @param message KeyId * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: proto.TemplateButtonReplyMessage, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: proto.KeyId, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this TemplateButtonReplyMessage to JSON. + * Converts this KeyId to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a CatalogSnapshot. */ - interface ICatalogSnapshot { - - /** CatalogSnapshot catalogImage */ - catalogImage?: (proto.IImageMessage|null); - - /** CatalogSnapshot title */ - title?: (string|null); + /** Properties of a SyncdIndex. */ + interface ISyncdIndex { - /** CatalogSnapshot description */ - description?: (string|null); + /** SyncdIndex blob */ + blob?: (Uint8Array|null); } - /** Represents a CatalogSnapshot. */ - class CatalogSnapshot implements ICatalogSnapshot { + /** Represents a SyncdIndex. */ + class SyncdIndex implements ISyncdIndex { /** - * Constructs a new CatalogSnapshot. + * Constructs a new SyncdIndex. * @param [properties] Properties to set */ - constructor(properties?: proto.ICatalogSnapshot); - - /** CatalogSnapshot catalogImage. */ - public catalogImage?: (proto.IImageMessage|null); - - /** CatalogSnapshot title. */ - public title: string; + constructor(properties?: proto.ISyncdIndex); - /** CatalogSnapshot description. */ - public description: string; + /** SyncdIndex blob. */ + public blob: Uint8Array; /** - * Creates a new CatalogSnapshot instance using the specified properties. + * Creates a new SyncdIndex instance using the specified properties. * @param [properties] Properties to set - * @returns CatalogSnapshot instance + * @returns SyncdIndex instance */ - public static create(properties?: proto.ICatalogSnapshot): proto.CatalogSnapshot; + public static create(properties?: proto.ISyncdIndex): proto.SyncdIndex; /** - * Encodes the specified CatalogSnapshot message. Does not implicitly {@link proto.CatalogSnapshot.verify|verify} messages. - * @param message CatalogSnapshot message or plain object to encode + * Encodes the specified SyncdIndex message. Does not implicitly {@link proto.SyncdIndex.verify|verify} messages. + * @param message SyncdIndex message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: proto.ICatalogSnapshot, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: proto.ISyncdIndex, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified CatalogSnapshot message, length delimited. Does not implicitly {@link proto.CatalogSnapshot.verify|verify} messages. - * @param message CatalogSnapshot message or plain object to encode + * Encodes the specified SyncdIndex message, length delimited. Does not implicitly {@link proto.SyncdIndex.verify|verify} messages. + * @param message SyncdIndex message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: proto.ICatalogSnapshot, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: proto.ISyncdIndex, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a CatalogSnapshot message from the specified reader or buffer. + * Decodes a SyncdIndex message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns CatalogSnapshot + * @returns SyncdIndex * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.CatalogSnapshot; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.SyncdIndex; /** - * Decodes a CatalogSnapshot message from the specified reader or buffer, length delimited. + * Decodes a SyncdIndex message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns CatalogSnapshot + * @returns SyncdIndex * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.CatalogSnapshot; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.SyncdIndex; /** - * Verifies a CatalogSnapshot message. + * Verifies a SyncdIndex message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a CatalogSnapshot message from a plain object. Also converts values to their respective internal types. + * Creates a SyncdIndex message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns CatalogSnapshot + * @returns SyncdIndex */ - public static fromObject(object: { [k: string]: any }): proto.CatalogSnapshot; + public static fromObject(object: { [k: string]: any }): proto.SyncdIndex; /** - * Creates a plain object from a CatalogSnapshot message. Also converts values to other types if specified. - * @param message CatalogSnapshot + * Creates a plain object from a SyncdIndex message. Also converts values to other types if specified. + * @param message SyncdIndex * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: proto.CatalogSnapshot, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: proto.SyncdIndex, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this CatalogSnapshot to JSON. + * Converts this SyncdIndex to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a ProductSnapshot. */ - interface IProductSnapshot { - - /** ProductSnapshot productImage */ - productImage?: (proto.IImageMessage|null); - - /** ProductSnapshot productId */ - productId?: (string|null); - - /** ProductSnapshot title */ - title?: (string|null); - - /** ProductSnapshot description */ - description?: (string|null); - - /** ProductSnapshot currencyCode */ - currencyCode?: (string|null); - - /** ProductSnapshot priceAmount1000 */ - priceAmount1000?: (number|Long|null); - - /** ProductSnapshot retailerId */ - retailerId?: (string|null); - - /** ProductSnapshot url */ - url?: (string|null); - - /** ProductSnapshot productImageCount */ - productImageCount?: (number|null); + /** Properties of a SyncdMutation. */ + interface ISyncdMutation { - /** ProductSnapshot firstImageId */ - firstImageId?: (string|null); + /** SyncdMutation operation */ + operation?: (proto.SyncdMutation.SyncdMutationSyncdOperation|null); - /** ProductSnapshot salePriceAmount1000 */ - salePriceAmount1000?: (number|Long|null); + /** SyncdMutation record */ + record?: (proto.ISyncdRecord|null); } - /** Represents a ProductSnapshot. */ - class ProductSnapshot implements IProductSnapshot { + /** Represents a SyncdMutation. */ + class SyncdMutation implements ISyncdMutation { /** - * Constructs a new ProductSnapshot. + * Constructs a new SyncdMutation. * @param [properties] Properties to set */ - constructor(properties?: proto.IProductSnapshot); - - /** ProductSnapshot productImage. */ - public productImage?: (proto.IImageMessage|null); - - /** ProductSnapshot productId. */ - public productId: string; - - /** ProductSnapshot title. */ - public title: string; - - /** ProductSnapshot description. */ - public description: string; - - /** ProductSnapshot currencyCode. */ - public currencyCode: string; - - /** ProductSnapshot priceAmount1000. */ - public priceAmount1000: (number|Long); - - /** ProductSnapshot retailerId. */ - public retailerId: string; - - /** ProductSnapshot url. */ - public url: string; - - /** ProductSnapshot productImageCount. */ - public productImageCount: number; + constructor(properties?: proto.ISyncdMutation); - /** ProductSnapshot firstImageId. */ - public firstImageId: string; + /** SyncdMutation operation. */ + public operation: proto.SyncdMutation.SyncdMutationSyncdOperation; - /** ProductSnapshot salePriceAmount1000. */ - public salePriceAmount1000: (number|Long); + /** SyncdMutation record. */ + public record?: (proto.ISyncdRecord|null); /** - * Creates a new ProductSnapshot instance using the specified properties. + * Creates a new SyncdMutation instance using the specified properties. * @param [properties] Properties to set - * @returns ProductSnapshot instance + * @returns SyncdMutation instance */ - public static create(properties?: proto.IProductSnapshot): proto.ProductSnapshot; + public static create(properties?: proto.ISyncdMutation): proto.SyncdMutation; /** - * Encodes the specified ProductSnapshot message. Does not implicitly {@link proto.ProductSnapshot.verify|verify} messages. - * @param message ProductSnapshot message or plain object to encode + * Encodes the specified SyncdMutation message. Does not implicitly {@link proto.SyncdMutation.verify|verify} messages. + * @param message SyncdMutation message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: proto.IProductSnapshot, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: proto.ISyncdMutation, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ProductSnapshot message, length delimited. Does not implicitly {@link proto.ProductSnapshot.verify|verify} messages. - * @param message ProductSnapshot message or plain object to encode + * Encodes the specified SyncdMutation message, length delimited. Does not implicitly {@link proto.SyncdMutation.verify|verify} messages. + * @param message SyncdMutation message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: proto.IProductSnapshot, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: proto.ISyncdMutation, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ProductSnapshot message from the specified reader or buffer. + * Decodes a SyncdMutation message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ProductSnapshot + * @returns SyncdMutation * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.ProductSnapshot; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.SyncdMutation; /** - * Decodes a ProductSnapshot message from the specified reader or buffer, length delimited. + * Decodes a SyncdMutation message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ProductSnapshot + * @returns SyncdMutation * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.ProductSnapshot; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.SyncdMutation; /** - * Verifies a ProductSnapshot message. + * Verifies a SyncdMutation message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a ProductSnapshot message from a plain object. Also converts values to their respective internal types. + * Creates a SyncdMutation message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ProductSnapshot + * @returns SyncdMutation */ - public static fromObject(object: { [k: string]: any }): proto.ProductSnapshot; + public static fromObject(object: { [k: string]: any }): proto.SyncdMutation; /** - * Creates a plain object from a ProductSnapshot message. Also converts values to other types if specified. - * @param message ProductSnapshot + * Creates a plain object from a SyncdMutation message. Also converts values to other types if specified. + * @param message SyncdMutation * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: proto.ProductSnapshot, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: proto.SyncdMutation, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ProductSnapshot to JSON. + * Converts this SyncdMutation to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a ProductMessage. */ - interface IProductMessage { - - /** ProductMessage product */ - product?: (proto.IProductSnapshot|null); - - /** ProductMessage businessOwnerJid */ - businessOwnerJid?: (string|null); - - /** ProductMessage catalog */ - catalog?: (proto.ICatalogSnapshot|null); + namespace SyncdMutation { - /** ProductMessage body */ - body?: (string|null); + /** SyncdMutationSyncdOperation enum. */ + enum SyncdMutationSyncdOperation { + SET = 0, + REMOVE = 1 + } + } - /** ProductMessage footer */ - footer?: (string|null); + /** Properties of a SyncdMutations. */ + interface ISyncdMutations { - /** ProductMessage contextInfo */ - contextInfo?: (proto.IContextInfo|null); + /** SyncdMutations mutations */ + mutations?: (proto.ISyncdMutation[]|null); } - /** Represents a ProductMessage. */ - class ProductMessage implements IProductMessage { + /** Represents a SyncdMutations. */ + class SyncdMutations implements ISyncdMutations { /** - * Constructs a new ProductMessage. + * Constructs a new SyncdMutations. * @param [properties] Properties to set */ - constructor(properties?: proto.IProductMessage); - - /** ProductMessage product. */ - public product?: (proto.IProductSnapshot|null); - - /** ProductMessage businessOwnerJid. */ - public businessOwnerJid: string; - - /** ProductMessage catalog. */ - public catalog?: (proto.ICatalogSnapshot|null); - - /** ProductMessage body. */ - public body: string; - - /** ProductMessage footer. */ - public footer: string; + constructor(properties?: proto.ISyncdMutations); - /** ProductMessage contextInfo. */ - public contextInfo?: (proto.IContextInfo|null); + /** SyncdMutations mutations. */ + public mutations: proto.ISyncdMutation[]; /** - * Creates a new ProductMessage instance using the specified properties. + * Creates a new SyncdMutations instance using the specified properties. * @param [properties] Properties to set - * @returns ProductMessage instance + * @returns SyncdMutations instance */ - public static create(properties?: proto.IProductMessage): proto.ProductMessage; + public static create(properties?: proto.ISyncdMutations): proto.SyncdMutations; /** - * Encodes the specified ProductMessage message. Does not implicitly {@link proto.ProductMessage.verify|verify} messages. - * @param message ProductMessage message or plain object to encode + * Encodes the specified SyncdMutations message. Does not implicitly {@link proto.SyncdMutations.verify|verify} messages. + * @param message SyncdMutations message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: proto.IProductMessage, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: proto.ISyncdMutations, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ProductMessage message, length delimited. Does not implicitly {@link proto.ProductMessage.verify|verify} messages. - * @param message ProductMessage message or plain object to encode + * Encodes the specified SyncdMutations message, length delimited. Does not implicitly {@link proto.SyncdMutations.verify|verify} messages. + * @param message SyncdMutations message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: proto.IProductMessage, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: proto.ISyncdMutations, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ProductMessage message from the specified reader or buffer. + * Decodes a SyncdMutations message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ProductMessage + * @returns SyncdMutations * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.ProductMessage; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.SyncdMutations; /** - * Decodes a ProductMessage message from the specified reader or buffer, length delimited. + * Decodes a SyncdMutations message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ProductMessage + * @returns SyncdMutations * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.ProductMessage; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.SyncdMutations; /** - * Verifies a ProductMessage message. + * Verifies a SyncdMutations message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a ProductMessage message from a plain object. Also converts values to their respective internal types. + * Creates a SyncdMutations message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ProductMessage + * @returns SyncdMutations */ - public static fromObject(object: { [k: string]: any }): proto.ProductMessage; + public static fromObject(object: { [k: string]: any }): proto.SyncdMutations; /** - * Creates a plain object from a ProductMessage message. Also converts values to other types if specified. - * @param message ProductMessage + * Creates a plain object from a SyncdMutations message. Also converts values to other types if specified. + * @param message SyncdMutations * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: proto.ProductMessage, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: proto.SyncdMutations, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ProductMessage to JSON. + * Converts this SyncdMutations to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of an OrderMessage. */ - interface IOrderMessage { - - /** OrderMessage orderId */ - orderId?: (string|null); - - /** OrderMessage thumbnail */ - thumbnail?: (Uint8Array|null); - - /** OrderMessage itemCount */ - itemCount?: (number|null); - - /** OrderMessage status */ - status?: (proto.OrderMessage.OrderMessageOrderStatus|null); + /** Properties of a SyncdPatch. */ + interface ISyncdPatch { - /** OrderMessage surface */ - surface?: (proto.OrderMessage.OrderMessageOrderSurface|null); + /** SyncdPatch version */ + version?: (proto.ISyncdVersion|null); - /** OrderMessage message */ - message?: (string|null); + /** SyncdPatch mutations */ + mutations?: (proto.ISyncdMutation[]|null); - /** OrderMessage orderTitle */ - orderTitle?: (string|null); + /** SyncdPatch externalMutations */ + externalMutations?: (proto.IExternalBlobReference|null); - /** OrderMessage sellerJid */ - sellerJid?: (string|null); + /** SyncdPatch snapshotMac */ + snapshotMac?: (Uint8Array|null); - /** OrderMessage token */ - token?: (string|null); + /** SyncdPatch patchMac */ + patchMac?: (Uint8Array|null); - /** OrderMessage totalAmount1000 */ - totalAmount1000?: (number|Long|null); + /** SyncdPatch keyId */ + keyId?: (proto.IKeyId|null); - /** OrderMessage totalCurrencyCode */ - totalCurrencyCode?: (string|null); + /** SyncdPatch exitCode */ + exitCode?: (proto.IExitCode|null); - /** OrderMessage contextInfo */ - contextInfo?: (proto.IContextInfo|null); + /** SyncdPatch deviceIndex */ + deviceIndex?: (number|null); } - /** Represents an OrderMessage. */ - class OrderMessage implements IOrderMessage { + /** Represents a SyncdPatch. */ + class SyncdPatch implements ISyncdPatch { /** - * Constructs a new OrderMessage. + * Constructs a new SyncdPatch. * @param [properties] Properties to set */ - constructor(properties?: proto.IOrderMessage); - - /** OrderMessage orderId. */ - public orderId: string; - - /** OrderMessage thumbnail. */ - public thumbnail: Uint8Array; - - /** OrderMessage itemCount. */ - public itemCount: number; - - /** OrderMessage status. */ - public status: proto.OrderMessage.OrderMessageOrderStatus; + constructor(properties?: proto.ISyncdPatch); - /** OrderMessage surface. */ - public surface: proto.OrderMessage.OrderMessageOrderSurface; + /** SyncdPatch version. */ + public version?: (proto.ISyncdVersion|null); - /** OrderMessage message. */ - public message: string; + /** SyncdPatch mutations. */ + public mutations: proto.ISyncdMutation[]; - /** OrderMessage orderTitle. */ - public orderTitle: string; + /** SyncdPatch externalMutations. */ + public externalMutations?: (proto.IExternalBlobReference|null); - /** OrderMessage sellerJid. */ - public sellerJid: string; + /** SyncdPatch snapshotMac. */ + public snapshotMac: Uint8Array; - /** OrderMessage token. */ - public token: string; + /** SyncdPatch patchMac. */ + public patchMac: Uint8Array; - /** OrderMessage totalAmount1000. */ - public totalAmount1000: (number|Long); + /** SyncdPatch keyId. */ + public keyId?: (proto.IKeyId|null); - /** OrderMessage totalCurrencyCode. */ - public totalCurrencyCode: string; + /** SyncdPatch exitCode. */ + public exitCode?: (proto.IExitCode|null); - /** OrderMessage contextInfo. */ - public contextInfo?: (proto.IContextInfo|null); + /** SyncdPatch deviceIndex. */ + public deviceIndex: number; /** - * Creates a new OrderMessage instance using the specified properties. + * Creates a new SyncdPatch instance using the specified properties. * @param [properties] Properties to set - * @returns OrderMessage instance + * @returns SyncdPatch instance */ - public static create(properties?: proto.IOrderMessage): proto.OrderMessage; + public static create(properties?: proto.ISyncdPatch): proto.SyncdPatch; /** - * Encodes the specified OrderMessage message. Does not implicitly {@link proto.OrderMessage.verify|verify} messages. - * @param message OrderMessage message or plain object to encode + * Encodes the specified SyncdPatch message. Does not implicitly {@link proto.SyncdPatch.verify|verify} messages. + * @param message SyncdPatch message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: proto.IOrderMessage, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: proto.ISyncdPatch, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified OrderMessage message, length delimited. Does not implicitly {@link proto.OrderMessage.verify|verify} messages. - * @param message OrderMessage message or plain object to encode + * Encodes the specified SyncdPatch message, length delimited. Does not implicitly {@link proto.SyncdPatch.verify|verify} messages. + * @param message SyncdPatch message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: proto.IOrderMessage, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: proto.ISyncdPatch, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an OrderMessage message from the specified reader or buffer. + * Decodes a SyncdPatch message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns OrderMessage + * @returns SyncdPatch * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.OrderMessage; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.SyncdPatch; /** - * Decodes an OrderMessage message from the specified reader or buffer, length delimited. + * Decodes a SyncdPatch message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns OrderMessage + * @returns SyncdPatch * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.OrderMessage; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.SyncdPatch; /** - * Verifies an OrderMessage message. + * Verifies a SyncdPatch message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates an OrderMessage message from a plain object. Also converts values to their respective internal types. + * Creates a SyncdPatch message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns OrderMessage + * @returns SyncdPatch */ - public static fromObject(object: { [k: string]: any }): proto.OrderMessage; + public static fromObject(object: { [k: string]: any }): proto.SyncdPatch; /** - * Creates a plain object from an OrderMessage message. Also converts values to other types if specified. - * @param message OrderMessage + * Creates a plain object from a SyncdPatch message. Also converts values to other types if specified. + * @param message SyncdPatch * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: proto.OrderMessage, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: proto.SyncdPatch, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this OrderMessage to JSON. + * Converts this SyncdPatch to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - namespace OrderMessage { - - /** OrderMessageOrderStatus enum. */ - enum OrderMessageOrderStatus { - INQUIRY = 1 - } - - /** OrderMessageOrderSurface enum. */ - enum OrderMessageOrderSurface { - CATALOG = 1 - } - } - - /** Properties of a Row. */ - interface IRow { + /** Properties of a SyncdRecord. */ + interface ISyncdRecord { - /** Row title */ - title?: (string|null); + /** SyncdRecord index */ + index?: (proto.ISyncdIndex|null); - /** Row description */ - description?: (string|null); + /** SyncdRecord value */ + value?: (proto.ISyncdValue|null); - /** Row rowId */ - rowId?: (string|null); + /** SyncdRecord keyId */ + keyId?: (proto.IKeyId|null); } - /** Represents a Row. */ - class Row implements IRow { + /** Represents a SyncdRecord. */ + class SyncdRecord implements ISyncdRecord { /** - * Constructs a new Row. + * Constructs a new SyncdRecord. * @param [properties] Properties to set */ - constructor(properties?: proto.IRow); + constructor(properties?: proto.ISyncdRecord); - /** Row title. */ - public title: string; + /** SyncdRecord index. */ + public index?: (proto.ISyncdIndex|null); - /** Row description. */ - public description: string; + /** SyncdRecord value. */ + public value?: (proto.ISyncdValue|null); - /** Row rowId. */ - public rowId: string; + /** SyncdRecord keyId. */ + public keyId?: (proto.IKeyId|null); /** - * Creates a new Row instance using the specified properties. + * Creates a new SyncdRecord instance using the specified properties. * @param [properties] Properties to set - * @returns Row instance + * @returns SyncdRecord instance */ - public static create(properties?: proto.IRow): proto.Row; + public static create(properties?: proto.ISyncdRecord): proto.SyncdRecord; /** - * Encodes the specified Row message. Does not implicitly {@link proto.Row.verify|verify} messages. - * @param message Row message or plain object to encode + * Encodes the specified SyncdRecord message. Does not implicitly {@link proto.SyncdRecord.verify|verify} messages. + * @param message SyncdRecord message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: proto.IRow, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: proto.ISyncdRecord, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified Row message, length delimited. Does not implicitly {@link proto.Row.verify|verify} messages. - * @param message Row message or plain object to encode + * Encodes the specified SyncdRecord message, length delimited. Does not implicitly {@link proto.SyncdRecord.verify|verify} messages. + * @param message SyncdRecord message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: proto.IRow, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: proto.ISyncdRecord, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a Row message from the specified reader or buffer. + * Decodes a SyncdRecord message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns Row + * @returns SyncdRecord * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.Row; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.SyncdRecord; /** - * Decodes a Row message from the specified reader or buffer, length delimited. + * Decodes a SyncdRecord message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Row + * @returns SyncdRecord * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.Row; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.SyncdRecord; /** - * Verifies a Row message. + * Verifies a SyncdRecord message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a Row message from a plain object. Also converts values to their respective internal types. + * Creates a SyncdRecord message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Row + * @returns SyncdRecord */ - public static fromObject(object: { [k: string]: any }): proto.Row; + public static fromObject(object: { [k: string]: any }): proto.SyncdRecord; /** - * Creates a plain object from a Row message. Also converts values to other types if specified. - * @param message Row + * Creates a plain object from a SyncdRecord message. Also converts values to other types if specified. + * @param message SyncdRecord * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: proto.Row, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: proto.SyncdRecord, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Row to JSON. + * Converts this SyncdRecord to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a Section. */ - interface ISection { + /** Properties of a SyncdSnapshot. */ + interface ISyncdSnapshot { - /** Section title */ - title?: (string|null); + /** SyncdSnapshot version */ + version?: (proto.ISyncdVersion|null); - /** Section rows */ - rows?: (proto.IRow[]|null); + /** SyncdSnapshot records */ + records?: (proto.ISyncdRecord[]|null); + + /** SyncdSnapshot mac */ + mac?: (Uint8Array|null); + + /** SyncdSnapshot keyId */ + keyId?: (proto.IKeyId|null); } - /** Represents a Section. */ - class Section implements ISection { + /** Represents a SyncdSnapshot. */ + class SyncdSnapshot implements ISyncdSnapshot { /** - * Constructs a new Section. + * Constructs a new SyncdSnapshot. * @param [properties] Properties to set */ - constructor(properties?: proto.ISection); + constructor(properties?: proto.ISyncdSnapshot); - /** Section title. */ - public title: string; + /** SyncdSnapshot version. */ + public version?: (proto.ISyncdVersion|null); - /** Section rows. */ - public rows: proto.IRow[]; + /** SyncdSnapshot records. */ + public records: proto.ISyncdRecord[]; + + /** SyncdSnapshot mac. */ + public mac: Uint8Array; + + /** SyncdSnapshot keyId. */ + public keyId?: (proto.IKeyId|null); /** - * Creates a new Section instance using the specified properties. + * Creates a new SyncdSnapshot instance using the specified properties. * @param [properties] Properties to set - * @returns Section instance + * @returns SyncdSnapshot instance */ - public static create(properties?: proto.ISection): proto.Section; + public static create(properties?: proto.ISyncdSnapshot): proto.SyncdSnapshot; /** - * Encodes the specified Section message. Does not implicitly {@link proto.Section.verify|verify} messages. - * @param message Section message or plain object to encode + * Encodes the specified SyncdSnapshot message. Does not implicitly {@link proto.SyncdSnapshot.verify|verify} messages. + * @param message SyncdSnapshot message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: proto.ISection, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: proto.ISyncdSnapshot, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified Section message, length delimited. Does not implicitly {@link proto.Section.verify|verify} messages. - * @param message Section message or plain object to encode + * Encodes the specified SyncdSnapshot message, length delimited. Does not implicitly {@link proto.SyncdSnapshot.verify|verify} messages. + * @param message SyncdSnapshot message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: proto.ISection, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: proto.ISyncdSnapshot, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a Section message from the specified reader or buffer. + * Decodes a SyncdSnapshot message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns Section + * @returns SyncdSnapshot * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.Section; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.SyncdSnapshot; /** - * Decodes a Section message from the specified reader or buffer, length delimited. + * Decodes a SyncdSnapshot message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Section + * @returns SyncdSnapshot * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.Section; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.SyncdSnapshot; /** - * Verifies a Section message. + * Verifies a SyncdSnapshot message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a Section message from a plain object. Also converts values to their respective internal types. + * Creates a SyncdSnapshot message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Section + * @returns SyncdSnapshot */ - public static fromObject(object: { [k: string]: any }): proto.Section; + public static fromObject(object: { [k: string]: any }): proto.SyncdSnapshot; /** - * Creates a plain object from a Section message. Also converts values to other types if specified. - * @param message Section + * Creates a plain object from a SyncdSnapshot message. Also converts values to other types if specified. + * @param message SyncdSnapshot * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: proto.Section, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: proto.SyncdSnapshot, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Section to JSON. + * Converts this SyncdSnapshot to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a Product. */ - interface IProduct { + /** Properties of a SyncdValue. */ + interface ISyncdValue { - /** Product productId */ - productId?: (string|null); + /** SyncdValue blob */ + blob?: (Uint8Array|null); } - /** Represents a Product. */ - class Product implements IProduct { + /** Represents a SyncdValue. */ + class SyncdValue implements ISyncdValue { /** - * Constructs a new Product. + * Constructs a new SyncdValue. * @param [properties] Properties to set */ - constructor(properties?: proto.IProduct); + constructor(properties?: proto.ISyncdValue); - /** Product productId. */ - public productId: string; + /** SyncdValue blob. */ + public blob: Uint8Array; /** - * Creates a new Product instance using the specified properties. + * Creates a new SyncdValue instance using the specified properties. * @param [properties] Properties to set - * @returns Product instance + * @returns SyncdValue instance */ - public static create(properties?: proto.IProduct): proto.Product; + public static create(properties?: proto.ISyncdValue): proto.SyncdValue; /** - * Encodes the specified Product message. Does not implicitly {@link proto.Product.verify|verify} messages. - * @param message Product message or plain object to encode + * Encodes the specified SyncdValue message. Does not implicitly {@link proto.SyncdValue.verify|verify} messages. + * @param message SyncdValue message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: proto.IProduct, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: proto.ISyncdValue, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified Product message, length delimited. Does not implicitly {@link proto.Product.verify|verify} messages. - * @param message Product message or plain object to encode + * Encodes the specified SyncdValue message, length delimited. Does not implicitly {@link proto.SyncdValue.verify|verify} messages. + * @param message SyncdValue message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: proto.IProduct, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: proto.ISyncdValue, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a Product message from the specified reader or buffer. + * Decodes a SyncdValue message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns Product + * @returns SyncdValue * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.Product; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.SyncdValue; /** - * Decodes a Product message from the specified reader or buffer, length delimited. + * Decodes a SyncdValue message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Product + * @returns SyncdValue * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.Product; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.SyncdValue; /** - * Verifies a Product message. + * Verifies a SyncdValue message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a Product message from a plain object. Also converts values to their respective internal types. + * Creates a SyncdValue message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Product + * @returns SyncdValue */ - public static fromObject(object: { [k: string]: any }): proto.Product; + public static fromObject(object: { [k: string]: any }): proto.SyncdValue; /** - * Creates a plain object from a Product message. Also converts values to other types if specified. - * @param message Product + * Creates a plain object from a SyncdValue message. Also converts values to other types if specified. + * @param message SyncdValue * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: proto.Product, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: proto.SyncdValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Product to JSON. + * Converts this SyncdValue to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a ProductSection. */ - interface IProductSection { - - /** ProductSection title */ - title?: (string|null); + /** Properties of a SyncdVersion. */ + interface ISyncdVersion { - /** ProductSection products */ - products?: (proto.IProduct[]|null); + /** SyncdVersion version */ + version?: (number|Long|null); } - /** Represents a ProductSection. */ - class ProductSection implements IProductSection { + /** Represents a SyncdVersion. */ + class SyncdVersion implements ISyncdVersion { /** - * Constructs a new ProductSection. + * Constructs a new SyncdVersion. * @param [properties] Properties to set */ - constructor(properties?: proto.IProductSection); - - /** ProductSection title. */ - public title: string; + constructor(properties?: proto.ISyncdVersion); - /** ProductSection products. */ - public products: proto.IProduct[]; + /** SyncdVersion version. */ + public version: (number|Long); /** - * Creates a new ProductSection instance using the specified properties. + * Creates a new SyncdVersion instance using the specified properties. * @param [properties] Properties to set - * @returns ProductSection instance + * @returns SyncdVersion instance */ - public static create(properties?: proto.IProductSection): proto.ProductSection; + public static create(properties?: proto.ISyncdVersion): proto.SyncdVersion; /** - * Encodes the specified ProductSection message. Does not implicitly {@link proto.ProductSection.verify|verify} messages. - * @param message ProductSection message or plain object to encode + * Encodes the specified SyncdVersion message. Does not implicitly {@link proto.SyncdVersion.verify|verify} messages. + * @param message SyncdVersion message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: proto.IProductSection, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: proto.ISyncdVersion, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ProductSection message, length delimited. Does not implicitly {@link proto.ProductSection.verify|verify} messages. - * @param message ProductSection message or plain object to encode + * Encodes the specified SyncdVersion message, length delimited. Does not implicitly {@link proto.SyncdVersion.verify|verify} messages. + * @param message SyncdVersion message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: proto.IProductSection, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: proto.ISyncdVersion, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ProductSection message from the specified reader or buffer. + * Decodes a SyncdVersion message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ProductSection + * @returns SyncdVersion * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.ProductSection; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.SyncdVersion; /** - * Decodes a ProductSection message from the specified reader or buffer, length delimited. + * Decodes a SyncdVersion message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ProductSection + * @returns SyncdVersion * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.ProductSection; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.SyncdVersion; /** - * Verifies a ProductSection message. + * Verifies a SyncdVersion message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a ProductSection message from a plain object. Also converts values to their respective internal types. + * Creates a SyncdVersion message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ProductSection + * @returns SyncdVersion */ - public static fromObject(object: { [k: string]: any }): proto.ProductSection; + public static fromObject(object: { [k: string]: any }): proto.SyncdVersion; /** - * Creates a plain object from a ProductSection message. Also converts values to other types if specified. - * @param message ProductSection + * Creates a plain object from a SyncdVersion message. Also converts values to other types if specified. + * @param message SyncdVersion * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: proto.ProductSection, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: proto.SyncdVersion, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ProductSection to JSON. + * Converts this SyncdVersion to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a ProductListHeaderImage. */ - interface IProductListHeaderImage { - - /** ProductListHeaderImage productId */ - productId?: (string|null); + /** Properties of an AndroidUnsupportedActions. */ + interface IAndroidUnsupportedActions { - /** ProductListHeaderImage jpegThumbnail */ - jpegThumbnail?: (Uint8Array|null); + /** AndroidUnsupportedActions allowed */ + allowed?: (boolean|null); } - /** Represents a ProductListHeaderImage. */ - class ProductListHeaderImage implements IProductListHeaderImage { + /** Represents an AndroidUnsupportedActions. */ + class AndroidUnsupportedActions implements IAndroidUnsupportedActions { /** - * Constructs a new ProductListHeaderImage. + * Constructs a new AndroidUnsupportedActions. * @param [properties] Properties to set */ - constructor(properties?: proto.IProductListHeaderImage); - - /** ProductListHeaderImage productId. */ - public productId: string; + constructor(properties?: proto.IAndroidUnsupportedActions); - /** ProductListHeaderImage jpegThumbnail. */ - public jpegThumbnail: Uint8Array; + /** AndroidUnsupportedActions allowed. */ + public allowed: boolean; /** - * Creates a new ProductListHeaderImage instance using the specified properties. + * Creates a new AndroidUnsupportedActions instance using the specified properties. * @param [properties] Properties to set - * @returns ProductListHeaderImage instance + * @returns AndroidUnsupportedActions instance */ - public static create(properties?: proto.IProductListHeaderImage): proto.ProductListHeaderImage; + public static create(properties?: proto.IAndroidUnsupportedActions): proto.AndroidUnsupportedActions; /** - * Encodes the specified ProductListHeaderImage message. Does not implicitly {@link proto.ProductListHeaderImage.verify|verify} messages. - * @param message ProductListHeaderImage message or plain object to encode + * Encodes the specified AndroidUnsupportedActions message. Does not implicitly {@link proto.AndroidUnsupportedActions.verify|verify} messages. + * @param message AndroidUnsupportedActions message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: proto.IProductListHeaderImage, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: proto.IAndroidUnsupportedActions, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ProductListHeaderImage message, length delimited. Does not implicitly {@link proto.ProductListHeaderImage.verify|verify} messages. - * @param message ProductListHeaderImage message or plain object to encode + * Encodes the specified AndroidUnsupportedActions message, length delimited. Does not implicitly {@link proto.AndroidUnsupportedActions.verify|verify} messages. + * @param message AndroidUnsupportedActions message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: proto.IProductListHeaderImage, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: proto.IAndroidUnsupportedActions, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ProductListHeaderImage message from the specified reader or buffer. + * Decodes an AndroidUnsupportedActions message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ProductListHeaderImage + * @returns AndroidUnsupportedActions * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.ProductListHeaderImage; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.AndroidUnsupportedActions; /** - * Decodes a ProductListHeaderImage message from the specified reader or buffer, length delimited. + * Decodes an AndroidUnsupportedActions message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ProductListHeaderImage + * @returns AndroidUnsupportedActions * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.ProductListHeaderImage; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.AndroidUnsupportedActions; /** - * Verifies a ProductListHeaderImage message. + * Verifies an AndroidUnsupportedActions message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a ProductListHeaderImage message from a plain object. Also converts values to their respective internal types. + * Creates an AndroidUnsupportedActions message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ProductListHeaderImage + * @returns AndroidUnsupportedActions */ - public static fromObject(object: { [k: string]: any }): proto.ProductListHeaderImage; + public static fromObject(object: { [k: string]: any }): proto.AndroidUnsupportedActions; /** - * Creates a plain object from a ProductListHeaderImage message. Also converts values to other types if specified. - * @param message ProductListHeaderImage + * Creates a plain object from an AndroidUnsupportedActions message. Also converts values to other types if specified. + * @param message AndroidUnsupportedActions * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: proto.ProductListHeaderImage, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: proto.AndroidUnsupportedActions, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ProductListHeaderImage to JSON. + * Converts this AndroidUnsupportedActions to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a ProductListInfo. */ - interface IProductListInfo { - - /** ProductListInfo productSections */ - productSections?: (proto.IProductSection[]|null); + /** Properties of an ArchiveChatAction. */ + interface IArchiveChatAction { - /** ProductListInfo headerImage */ - headerImage?: (proto.IProductListHeaderImage|null); + /** ArchiveChatAction archived */ + archived?: (boolean|null); - /** ProductListInfo businessOwnerJid */ - businessOwnerJid?: (string|null); + /** ArchiveChatAction messageRange */ + messageRange?: (proto.ISyncActionMessageRange|null); } - /** Represents a ProductListInfo. */ - class ProductListInfo implements IProductListInfo { + /** Represents an ArchiveChatAction. */ + class ArchiveChatAction implements IArchiveChatAction { /** - * Constructs a new ProductListInfo. + * Constructs a new ArchiveChatAction. * @param [properties] Properties to set */ - constructor(properties?: proto.IProductListInfo); - - /** ProductListInfo productSections. */ - public productSections: proto.IProductSection[]; + constructor(properties?: proto.IArchiveChatAction); - /** ProductListInfo headerImage. */ - public headerImage?: (proto.IProductListHeaderImage|null); + /** ArchiveChatAction archived. */ + public archived: boolean; - /** ProductListInfo businessOwnerJid. */ - public businessOwnerJid: string; + /** ArchiveChatAction messageRange. */ + public messageRange?: (proto.ISyncActionMessageRange|null); /** - * Creates a new ProductListInfo instance using the specified properties. + * Creates a new ArchiveChatAction instance using the specified properties. * @param [properties] Properties to set - * @returns ProductListInfo instance + * @returns ArchiveChatAction instance */ - public static create(properties?: proto.IProductListInfo): proto.ProductListInfo; + public static create(properties?: proto.IArchiveChatAction): proto.ArchiveChatAction; /** - * Encodes the specified ProductListInfo message. Does not implicitly {@link proto.ProductListInfo.verify|verify} messages. - * @param message ProductListInfo message or plain object to encode + * Encodes the specified ArchiveChatAction message. Does not implicitly {@link proto.ArchiveChatAction.verify|verify} messages. + * @param message ArchiveChatAction message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: proto.IProductListInfo, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: proto.IArchiveChatAction, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ProductListInfo message, length delimited. Does not implicitly {@link proto.ProductListInfo.verify|verify} messages. - * @param message ProductListInfo message or plain object to encode + * Encodes the specified ArchiveChatAction message, length delimited. Does not implicitly {@link proto.ArchiveChatAction.verify|verify} messages. + * @param message ArchiveChatAction message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: proto.IProductListInfo, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: proto.IArchiveChatAction, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ProductListInfo message from the specified reader or buffer. + * Decodes an ArchiveChatAction message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ProductListInfo + * @returns ArchiveChatAction * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.ProductListInfo; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.ArchiveChatAction; /** - * Decodes a ProductListInfo message from the specified reader or buffer, length delimited. + * Decodes an ArchiveChatAction message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ProductListInfo + * @returns ArchiveChatAction * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.ProductListInfo; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.ArchiveChatAction; /** - * Verifies a ProductListInfo message. + * Verifies an ArchiveChatAction message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a ProductListInfo message from a plain object. Also converts values to their respective internal types. + * Creates an ArchiveChatAction message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ProductListInfo + * @returns ArchiveChatAction */ - public static fromObject(object: { [k: string]: any }): proto.ProductListInfo; + public static fromObject(object: { [k: string]: any }): proto.ArchiveChatAction; /** - * Creates a plain object from a ProductListInfo message. Also converts values to other types if specified. - * @param message ProductListInfo + * Creates a plain object from an ArchiveChatAction message. Also converts values to other types if specified. + * @param message ArchiveChatAction * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: proto.ProductListInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: proto.ArchiveChatAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ProductListInfo to JSON. + * Converts this ArchiveChatAction to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a ListMessage. */ - interface IListMessage { - - /** ListMessage title */ - title?: (string|null); - - /** ListMessage description */ - description?: (string|null); - - /** ListMessage buttonText */ - buttonText?: (string|null); - - /** ListMessage listType */ - listType?: (proto.ListMessage.ListMessageListType|null); - - /** ListMessage sections */ - sections?: (proto.ISection[]|null); - - /** ListMessage productListInfo */ - productListInfo?: (proto.IProductListInfo|null); - - /** ListMessage footerText */ - footerText?: (string|null); + /** Properties of a ClearChatAction. */ + interface IClearChatAction { - /** ListMessage contextInfo */ - contextInfo?: (proto.IContextInfo|null); + /** ClearChatAction messageRange */ + messageRange?: (proto.ISyncActionMessageRange|null); } - /** Represents a ListMessage. */ - class ListMessage implements IListMessage { + /** Represents a ClearChatAction. */ + class ClearChatAction implements IClearChatAction { /** - * Constructs a new ListMessage. + * Constructs a new ClearChatAction. * @param [properties] Properties to set */ - constructor(properties?: proto.IListMessage); - - /** ListMessage title. */ - public title: string; - - /** ListMessage description. */ - public description: string; - - /** ListMessage buttonText. */ - public buttonText: string; - - /** ListMessage listType. */ - public listType: proto.ListMessage.ListMessageListType; - - /** ListMessage sections. */ - public sections: proto.ISection[]; - - /** ListMessage productListInfo. */ - public productListInfo?: (proto.IProductListInfo|null); - - /** ListMessage footerText. */ - public footerText: string; + constructor(properties?: proto.IClearChatAction); - /** ListMessage contextInfo. */ - public contextInfo?: (proto.IContextInfo|null); + /** ClearChatAction messageRange. */ + public messageRange?: (proto.ISyncActionMessageRange|null); /** - * Creates a new ListMessage instance using the specified properties. + * Creates a new ClearChatAction instance using the specified properties. * @param [properties] Properties to set - * @returns ListMessage instance + * @returns ClearChatAction instance */ - public static create(properties?: proto.IListMessage): proto.ListMessage; + public static create(properties?: proto.IClearChatAction): proto.ClearChatAction; /** - * Encodes the specified ListMessage message. Does not implicitly {@link proto.ListMessage.verify|verify} messages. - * @param message ListMessage message or plain object to encode + * Encodes the specified ClearChatAction message. Does not implicitly {@link proto.ClearChatAction.verify|verify} messages. + * @param message ClearChatAction message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: proto.IListMessage, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: proto.IClearChatAction, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ListMessage message, length delimited. Does not implicitly {@link proto.ListMessage.verify|verify} messages. - * @param message ListMessage message or plain object to encode + * Encodes the specified ClearChatAction message, length delimited. Does not implicitly {@link proto.ClearChatAction.verify|verify} messages. + * @param message ClearChatAction message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: proto.IListMessage, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: proto.IClearChatAction, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ListMessage message from the specified reader or buffer. + * Decodes a ClearChatAction message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ListMessage + * @returns ClearChatAction * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.ListMessage; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.ClearChatAction; /** - * Decodes a ListMessage message from the specified reader or buffer, length delimited. + * Decodes a ClearChatAction message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ListMessage + * @returns ClearChatAction * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.ListMessage; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.ClearChatAction; /** - * Verifies a ListMessage message. + * Verifies a ClearChatAction message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a ListMessage message from a plain object. Also converts values to their respective internal types. + * Creates a ClearChatAction message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ListMessage + * @returns ClearChatAction */ - public static fromObject(object: { [k: string]: any }): proto.ListMessage; + public static fromObject(object: { [k: string]: any }): proto.ClearChatAction; /** - * Creates a plain object from a ListMessage message. Also converts values to other types if specified. - * @param message ListMessage + * Creates a plain object from a ClearChatAction message. Also converts values to other types if specified. + * @param message ClearChatAction * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: proto.ListMessage, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: proto.ClearChatAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ListMessage to JSON. + * Converts this ClearChatAction to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - namespace ListMessage { - - /** ListMessageListType enum. */ - enum ListMessageListType { - UNKNOWN = 0, - SINGLE_SELECT = 1, - PRODUCT_LIST = 2 - } - } + /** Properties of a ContactAction. */ + interface IContactAction { - /** Properties of a SingleSelectReply. */ - interface ISingleSelectReply { + /** ContactAction fullName */ + fullName?: (string|null); - /** SingleSelectReply selectedRowId */ - selectedRowId?: (string|null); + /** ContactAction firstName */ + firstName?: (string|null); } - /** Represents a SingleSelectReply. */ - class SingleSelectReply implements ISingleSelectReply { + /** Represents a ContactAction. */ + class ContactAction implements IContactAction { /** - * Constructs a new SingleSelectReply. + * Constructs a new ContactAction. * @param [properties] Properties to set */ - constructor(properties?: proto.ISingleSelectReply); + constructor(properties?: proto.IContactAction); - /** SingleSelectReply selectedRowId. */ - public selectedRowId: string; + /** ContactAction fullName. */ + public fullName: string; + + /** ContactAction firstName. */ + public firstName: string; /** - * Creates a new SingleSelectReply instance using the specified properties. + * Creates a new ContactAction instance using the specified properties. * @param [properties] Properties to set - * @returns SingleSelectReply instance + * @returns ContactAction instance */ - public static create(properties?: proto.ISingleSelectReply): proto.SingleSelectReply; + public static create(properties?: proto.IContactAction): proto.ContactAction; /** - * Encodes the specified SingleSelectReply message. Does not implicitly {@link proto.SingleSelectReply.verify|verify} messages. - * @param message SingleSelectReply message or plain object to encode + * Encodes the specified ContactAction message. Does not implicitly {@link proto.ContactAction.verify|verify} messages. + * @param message ContactAction message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: proto.ISingleSelectReply, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: proto.IContactAction, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified SingleSelectReply message, length delimited. Does not implicitly {@link proto.SingleSelectReply.verify|verify} messages. - * @param message SingleSelectReply message or plain object to encode + * Encodes the specified ContactAction message, length delimited. Does not implicitly {@link proto.ContactAction.verify|verify} messages. + * @param message ContactAction message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: proto.ISingleSelectReply, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: proto.IContactAction, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a SingleSelectReply message from the specified reader or buffer. + * Decodes a ContactAction message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns SingleSelectReply + * @returns ContactAction * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.SingleSelectReply; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.ContactAction; /** - * Decodes a SingleSelectReply message from the specified reader or buffer, length delimited. + * Decodes a ContactAction message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns SingleSelectReply + * @returns ContactAction * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.SingleSelectReply; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.ContactAction; /** - * Verifies a SingleSelectReply message. + * Verifies a ContactAction message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a SingleSelectReply message from a plain object. Also converts values to their respective internal types. + * Creates a ContactAction message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns SingleSelectReply + * @returns ContactAction */ - public static fromObject(object: { [k: string]: any }): proto.SingleSelectReply; + public static fromObject(object: { [k: string]: any }): proto.ContactAction; /** - * Creates a plain object from a SingleSelectReply message. Also converts values to other types if specified. - * @param message SingleSelectReply + * Creates a plain object from a ContactAction message. Also converts values to other types if specified. + * @param message ContactAction * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: proto.SingleSelectReply, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: proto.ContactAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this SingleSelectReply to JSON. + * Converts this ContactAction to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a ListResponseMessage. */ - interface IListResponseMessage { - - /** ListResponseMessage title */ - title?: (string|null); - - /** ListResponseMessage listType */ - listType?: (proto.ListResponseMessage.ListResponseMessageListType|null); - - /** ListResponseMessage singleSelectReply */ - singleSelectReply?: (proto.ISingleSelectReply|null); - - /** ListResponseMessage contextInfo */ - contextInfo?: (proto.IContextInfo|null); + /** Properties of a DeleteChatAction. */ + interface IDeleteChatAction { - /** ListResponseMessage description */ - description?: (string|null); + /** DeleteChatAction messageRange */ + messageRange?: (proto.ISyncActionMessageRange|null); } - /** Represents a ListResponseMessage. */ - class ListResponseMessage implements IListResponseMessage { + /** Represents a DeleteChatAction. */ + class DeleteChatAction implements IDeleteChatAction { /** - * Constructs a new ListResponseMessage. + * Constructs a new DeleteChatAction. * @param [properties] Properties to set */ - constructor(properties?: proto.IListResponseMessage); - - /** ListResponseMessage title. */ - public title: string; - - /** ListResponseMessage listType. */ - public listType: proto.ListResponseMessage.ListResponseMessageListType; - - /** ListResponseMessage singleSelectReply. */ - public singleSelectReply?: (proto.ISingleSelectReply|null); - - /** ListResponseMessage contextInfo. */ - public contextInfo?: (proto.IContextInfo|null); + constructor(properties?: proto.IDeleteChatAction); - /** ListResponseMessage description. */ - public description: string; + /** DeleteChatAction messageRange. */ + public messageRange?: (proto.ISyncActionMessageRange|null); /** - * Creates a new ListResponseMessage instance using the specified properties. + * Creates a new DeleteChatAction instance using the specified properties. * @param [properties] Properties to set - * @returns ListResponseMessage instance + * @returns DeleteChatAction instance */ - public static create(properties?: proto.IListResponseMessage): proto.ListResponseMessage; + public static create(properties?: proto.IDeleteChatAction): proto.DeleteChatAction; /** - * Encodes the specified ListResponseMessage message. Does not implicitly {@link proto.ListResponseMessage.verify|verify} messages. - * @param message ListResponseMessage message or plain object to encode + * Encodes the specified DeleteChatAction message. Does not implicitly {@link proto.DeleteChatAction.verify|verify} messages. + * @param message DeleteChatAction message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: proto.IListResponseMessage, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: proto.IDeleteChatAction, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ListResponseMessage message, length delimited. Does not implicitly {@link proto.ListResponseMessage.verify|verify} messages. - * @param message ListResponseMessage message or plain object to encode + * Encodes the specified DeleteChatAction message, length delimited. Does not implicitly {@link proto.DeleteChatAction.verify|verify} messages. + * @param message DeleteChatAction message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: proto.IListResponseMessage, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: proto.IDeleteChatAction, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ListResponseMessage message from the specified reader or buffer. + * Decodes a DeleteChatAction message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ListResponseMessage + * @returns DeleteChatAction * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.ListResponseMessage; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.DeleteChatAction; /** - * Decodes a ListResponseMessage message from the specified reader or buffer, length delimited. + * Decodes a DeleteChatAction message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ListResponseMessage + * @returns DeleteChatAction * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.ListResponseMessage; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.DeleteChatAction; /** - * Verifies a ListResponseMessage message. + * Verifies a DeleteChatAction message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a ListResponseMessage message from a plain object. Also converts values to their respective internal types. + * Creates a DeleteChatAction message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ListResponseMessage + * @returns DeleteChatAction */ - public static fromObject(object: { [k: string]: any }): proto.ListResponseMessage; + public static fromObject(object: { [k: string]: any }): proto.DeleteChatAction; /** - * Creates a plain object from a ListResponseMessage message. Also converts values to other types if specified. - * @param message ListResponseMessage + * Creates a plain object from a DeleteChatAction message. Also converts values to other types if specified. + * @param message DeleteChatAction * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: proto.ListResponseMessage, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: proto.DeleteChatAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ListResponseMessage to JSON. + * Converts this DeleteChatAction to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - namespace ListResponseMessage { - - /** ListResponseMessageListType enum. */ - enum ListResponseMessageListType { - UNKNOWN = 0, - SINGLE_SELECT = 1 - } - } - - /** Properties of a Header. */ - interface IHeader { - - /** Header title */ - title?: (string|null); - - /** Header subtitle */ - subtitle?: (string|null); - - /** Header hasMediaAttachment */ - hasMediaAttachment?: (boolean|null); - - /** Header documentMessage */ - documentMessage?: (proto.IDocumentMessage|null); - - /** Header imageMessage */ - imageMessage?: (proto.IImageMessage|null); + /** Properties of a DeleteMessageForMeAction. */ + interface IDeleteMessageForMeAction { - /** Header jpegThumbnail */ - jpegThumbnail?: (Uint8Array|null); + /** DeleteMessageForMeAction deleteMedia */ + deleteMedia?: (boolean|null); - /** Header videoMessage */ - videoMessage?: (proto.IVideoMessage|null); + /** DeleteMessageForMeAction messageTimestamp */ + messageTimestamp?: (number|Long|null); } - /** Represents a Header. */ - class Header implements IHeader { + /** Represents a DeleteMessageForMeAction. */ + class DeleteMessageForMeAction implements IDeleteMessageForMeAction { /** - * Constructs a new Header. + * Constructs a new DeleteMessageForMeAction. * @param [properties] Properties to set */ - constructor(properties?: proto.IHeader); - - /** Header title. */ - public title: string; - - /** Header subtitle. */ - public subtitle: string; - - /** Header hasMediaAttachment. */ - public hasMediaAttachment: boolean; - - /** Header documentMessage. */ - public documentMessage?: (proto.IDocumentMessage|null); - - /** Header imageMessage. */ - public imageMessage?: (proto.IImageMessage|null); - - /** Header jpegThumbnail. */ - public jpegThumbnail?: (Uint8Array|null); + constructor(properties?: proto.IDeleteMessageForMeAction); - /** Header videoMessage. */ - public videoMessage?: (proto.IVideoMessage|null); + /** DeleteMessageForMeAction deleteMedia. */ + public deleteMedia: boolean; - /** Header media. */ - public media?: ("documentMessage"|"imageMessage"|"jpegThumbnail"|"videoMessage"); + /** DeleteMessageForMeAction messageTimestamp. */ + public messageTimestamp: (number|Long); /** - * Creates a new Header instance using the specified properties. + * Creates a new DeleteMessageForMeAction instance using the specified properties. * @param [properties] Properties to set - * @returns Header instance + * @returns DeleteMessageForMeAction instance */ - public static create(properties?: proto.IHeader): proto.Header; + public static create(properties?: proto.IDeleteMessageForMeAction): proto.DeleteMessageForMeAction; /** - * Encodes the specified Header message. Does not implicitly {@link proto.Header.verify|verify} messages. - * @param message Header message or plain object to encode + * Encodes the specified DeleteMessageForMeAction message. Does not implicitly {@link proto.DeleteMessageForMeAction.verify|verify} messages. + * @param message DeleteMessageForMeAction message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: proto.IHeader, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: proto.IDeleteMessageForMeAction, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified Header message, length delimited. Does not implicitly {@link proto.Header.verify|verify} messages. - * @param message Header message or plain object to encode + * Encodes the specified DeleteMessageForMeAction message, length delimited. Does not implicitly {@link proto.DeleteMessageForMeAction.verify|verify} messages. + * @param message DeleteMessageForMeAction message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: proto.IHeader, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: proto.IDeleteMessageForMeAction, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a Header message from the specified reader or buffer. + * Decodes a DeleteMessageForMeAction message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns Header + * @returns DeleteMessageForMeAction * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.Header; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.DeleteMessageForMeAction; /** - * Decodes a Header message from the specified reader or buffer, length delimited. + * Decodes a DeleteMessageForMeAction message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Header + * @returns DeleteMessageForMeAction * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.Header; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.DeleteMessageForMeAction; /** - * Verifies a Header message. + * Verifies a DeleteMessageForMeAction message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a Header message from a plain object. Also converts values to their respective internal types. + * Creates a DeleteMessageForMeAction message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Header + * @returns DeleteMessageForMeAction */ - public static fromObject(object: { [k: string]: any }): proto.Header; + public static fromObject(object: { [k: string]: any }): proto.DeleteMessageForMeAction; /** - * Creates a plain object from a Header message. Also converts values to other types if specified. - * @param message Header + * Creates a plain object from a DeleteMessageForMeAction message. Also converts values to other types if specified. + * @param message DeleteMessageForMeAction * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: proto.Header, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: proto.DeleteMessageForMeAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Header to JSON. + * Converts this DeleteMessageForMeAction to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a Body. */ - interface IBody { + /** Properties of a FavoriteStickerAction. */ + interface IFavoriteStickerAction { + + /** FavoriteStickerAction directPath */ + directPath?: (string|null); + + /** FavoriteStickerAction lastUploadTimestamp */ + lastUploadTimestamp?: (string|null); - /** Body text */ - text?: (string|null); + /** FavoriteStickerAction handle */ + handle?: (string|null); + + /** FavoriteStickerAction encFilehash */ + encFilehash?: (string|null); + + /** FavoriteStickerAction stickerHashWithoutMeta */ + stickerHashWithoutMeta?: (string|null); + + /** FavoriteStickerAction mediaKey */ + mediaKey?: (string|null); + + /** FavoriteStickerAction mediaKeyTimestamp */ + mediaKeyTimestamp?: (number|Long|null); + + /** FavoriteStickerAction isFavorite */ + isFavorite?: (boolean|null); } - /** Represents a Body. */ - class Body implements IBody { + /** Represents a FavoriteStickerAction. */ + class FavoriteStickerAction implements IFavoriteStickerAction { /** - * Constructs a new Body. + * Constructs a new FavoriteStickerAction. * @param [properties] Properties to set */ - constructor(properties?: proto.IBody); + constructor(properties?: proto.IFavoriteStickerAction); - /** Body text. */ - public text: string; + /** FavoriteStickerAction directPath. */ + public directPath: string; + + /** FavoriteStickerAction lastUploadTimestamp. */ + public lastUploadTimestamp: string; + + /** FavoriteStickerAction handle. */ + public handle: string; + + /** FavoriteStickerAction encFilehash. */ + public encFilehash: string; + + /** FavoriteStickerAction stickerHashWithoutMeta. */ + public stickerHashWithoutMeta: string; + + /** FavoriteStickerAction mediaKey. */ + public mediaKey: string; + + /** FavoriteStickerAction mediaKeyTimestamp. */ + public mediaKeyTimestamp: (number|Long); + + /** FavoriteStickerAction isFavorite. */ + public isFavorite: boolean; /** - * Creates a new Body instance using the specified properties. + * Creates a new FavoriteStickerAction instance using the specified properties. * @param [properties] Properties to set - * @returns Body instance + * @returns FavoriteStickerAction instance */ - public static create(properties?: proto.IBody): proto.Body; + public static create(properties?: proto.IFavoriteStickerAction): proto.FavoriteStickerAction; /** - * Encodes the specified Body message. Does not implicitly {@link proto.Body.verify|verify} messages. - * @param message Body message or plain object to encode + * Encodes the specified FavoriteStickerAction message. Does not implicitly {@link proto.FavoriteStickerAction.verify|verify} messages. + * @param message FavoriteStickerAction message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: proto.IBody, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: proto.IFavoriteStickerAction, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified Body message, length delimited. Does not implicitly {@link proto.Body.verify|verify} messages. - * @param message Body message or plain object to encode + * Encodes the specified FavoriteStickerAction message, length delimited. Does not implicitly {@link proto.FavoriteStickerAction.verify|verify} messages. + * @param message FavoriteStickerAction message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: proto.IBody, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: proto.IFavoriteStickerAction, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a Body message from the specified reader or buffer. + * Decodes a FavoriteStickerAction message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns Body + * @returns FavoriteStickerAction * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.Body; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.FavoriteStickerAction; /** - * Decodes a Body message from the specified reader or buffer, length delimited. + * Decodes a FavoriteStickerAction message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Body + * @returns FavoriteStickerAction * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.Body; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.FavoriteStickerAction; /** - * Verifies a Body message. + * Verifies a FavoriteStickerAction message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a Body message from a plain object. Also converts values to their respective internal types. + * Creates a FavoriteStickerAction message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Body + * @returns FavoriteStickerAction */ - public static fromObject(object: { [k: string]: any }): proto.Body; + public static fromObject(object: { [k: string]: any }): proto.FavoriteStickerAction; /** - * Creates a plain object from a Body message. Also converts values to other types if specified. - * @param message Body + * Creates a plain object from a FavoriteStickerAction message. Also converts values to other types if specified. + * @param message FavoriteStickerAction * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: proto.Body, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: proto.FavoriteStickerAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Body to JSON. + * Converts this FavoriteStickerAction to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a Footer. */ - interface IFooter { + /** Properties of a KeyExpiration. */ + interface IKeyExpiration { - /** Footer text */ - text?: (string|null); + /** KeyExpiration expiredKeyEpoch */ + expiredKeyEpoch?: (number|null); } - /** Represents a Footer. */ - class Footer implements IFooter { + /** Represents a KeyExpiration. */ + class KeyExpiration implements IKeyExpiration { /** - * Constructs a new Footer. + * Constructs a new KeyExpiration. * @param [properties] Properties to set */ - constructor(properties?: proto.IFooter); + constructor(properties?: proto.IKeyExpiration); - /** Footer text. */ - public text: string; + /** KeyExpiration expiredKeyEpoch. */ + public expiredKeyEpoch: number; /** - * Creates a new Footer instance using the specified properties. + * Creates a new KeyExpiration instance using the specified properties. * @param [properties] Properties to set - * @returns Footer instance + * @returns KeyExpiration instance */ - public static create(properties?: proto.IFooter): proto.Footer; + public static create(properties?: proto.IKeyExpiration): proto.KeyExpiration; /** - * Encodes the specified Footer message. Does not implicitly {@link proto.Footer.verify|verify} messages. - * @param message Footer message or plain object to encode + * Encodes the specified KeyExpiration message. Does not implicitly {@link proto.KeyExpiration.verify|verify} messages. + * @param message KeyExpiration message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: proto.IFooter, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: proto.IKeyExpiration, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified Footer message, length delimited. Does not implicitly {@link proto.Footer.verify|verify} messages. - * @param message Footer message or plain object to encode + * Encodes the specified KeyExpiration message, length delimited. Does not implicitly {@link proto.KeyExpiration.verify|verify} messages. + * @param message KeyExpiration message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: proto.IFooter, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: proto.IKeyExpiration, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a Footer message from the specified reader or buffer. + * Decodes a KeyExpiration message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns Footer + * @returns KeyExpiration * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.Footer; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.KeyExpiration; /** - * Decodes a Footer message from the specified reader or buffer, length delimited. + * Decodes a KeyExpiration message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Footer + * @returns KeyExpiration * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.Footer; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.KeyExpiration; /** - * Verifies a Footer message. + * Verifies a KeyExpiration message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a Footer message from a plain object. Also converts values to their respective internal types. + * Creates a KeyExpiration message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Footer + * @returns KeyExpiration */ - public static fromObject(object: { [k: string]: any }): proto.Footer; + public static fromObject(object: { [k: string]: any }): proto.KeyExpiration; /** - * Creates a plain object from a Footer message. Also converts values to other types if specified. - * @param message Footer + * Creates a plain object from a KeyExpiration message. Also converts values to other types if specified. + * @param message KeyExpiration * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: proto.Footer, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: proto.KeyExpiration, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Footer to JSON. + * Converts this KeyExpiration to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a ShopMessage. */ - interface IShopMessage { - - /** ShopMessage id */ - id?: (string|null); - - /** ShopMessage surface */ - surface?: (proto.ShopMessage.ShopMessageSurface|null); + /** Properties of a LabelAssociationAction. */ + interface ILabelAssociationAction { - /** ShopMessage messageVersion */ - messageVersion?: (number|null); + /** LabelAssociationAction labeled */ + labeled?: (boolean|null); } - /** Represents a ShopMessage. */ - class ShopMessage implements IShopMessage { + /** Represents a LabelAssociationAction. */ + class LabelAssociationAction implements ILabelAssociationAction { /** - * Constructs a new ShopMessage. + * Constructs a new LabelAssociationAction. * @param [properties] Properties to set */ - constructor(properties?: proto.IShopMessage); - - /** ShopMessage id. */ - public id: string; - - /** ShopMessage surface. */ - public surface: proto.ShopMessage.ShopMessageSurface; + constructor(properties?: proto.ILabelAssociationAction); - /** ShopMessage messageVersion. */ - public messageVersion: number; + /** LabelAssociationAction labeled. */ + public labeled: boolean; /** - * Creates a new ShopMessage instance using the specified properties. + * Creates a new LabelAssociationAction instance using the specified properties. * @param [properties] Properties to set - * @returns ShopMessage instance + * @returns LabelAssociationAction instance */ - public static create(properties?: proto.IShopMessage): proto.ShopMessage; + public static create(properties?: proto.ILabelAssociationAction): proto.LabelAssociationAction; /** - * Encodes the specified ShopMessage message. Does not implicitly {@link proto.ShopMessage.verify|verify} messages. - * @param message ShopMessage message or plain object to encode + * Encodes the specified LabelAssociationAction message. Does not implicitly {@link proto.LabelAssociationAction.verify|verify} messages. + * @param message LabelAssociationAction message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: proto.IShopMessage, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: proto.ILabelAssociationAction, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ShopMessage message, length delimited. Does not implicitly {@link proto.ShopMessage.verify|verify} messages. - * @param message ShopMessage message or plain object to encode + * Encodes the specified LabelAssociationAction message, length delimited. Does not implicitly {@link proto.LabelAssociationAction.verify|verify} messages. + * @param message LabelAssociationAction message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: proto.IShopMessage, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: proto.ILabelAssociationAction, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ShopMessage message from the specified reader or buffer. + * Decodes a LabelAssociationAction message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ShopMessage + * @returns LabelAssociationAction * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.ShopMessage; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.LabelAssociationAction; /** - * Decodes a ShopMessage message from the specified reader or buffer, length delimited. + * Decodes a LabelAssociationAction message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ShopMessage + * @returns LabelAssociationAction * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.ShopMessage; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.LabelAssociationAction; /** - * Verifies a ShopMessage message. + * Verifies a LabelAssociationAction message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a ShopMessage message from a plain object. Also converts values to their respective internal types. + * Creates a LabelAssociationAction message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ShopMessage + * @returns LabelAssociationAction */ - public static fromObject(object: { [k: string]: any }): proto.ShopMessage; + public static fromObject(object: { [k: string]: any }): proto.LabelAssociationAction; /** - * Creates a plain object from a ShopMessage message. Also converts values to other types if specified. - * @param message ShopMessage + * Creates a plain object from a LabelAssociationAction message. Also converts values to other types if specified. + * @param message LabelAssociationAction * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: proto.ShopMessage, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: proto.LabelAssociationAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ShopMessage to JSON. + * Converts this LabelAssociationAction to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - namespace ShopMessage { - - /** ShopMessageSurface enum. */ - enum ShopMessageSurface { - UNKNOWN_SURFACE = 0, - FB = 1, - IG = 2, - WA = 3 - } - } + /** Properties of a LabelEditAction. */ + interface ILabelEditAction { - /** Properties of a CollectionMessage. */ - interface ICollectionMessage { + /** LabelEditAction name */ + name?: (string|null); - /** CollectionMessage bizJid */ - bizJid?: (string|null); + /** LabelEditAction color */ + color?: (number|null); - /** CollectionMessage id */ - id?: (string|null); + /** LabelEditAction predefinedId */ + predefinedId?: (number|null); - /** CollectionMessage messageVersion */ - messageVersion?: (number|null); + /** LabelEditAction deleted */ + deleted?: (boolean|null); } - /** Represents a CollectionMessage. */ - class CollectionMessage implements ICollectionMessage { + /** Represents a LabelEditAction. */ + class LabelEditAction implements ILabelEditAction { /** - * Constructs a new CollectionMessage. + * Constructs a new LabelEditAction. * @param [properties] Properties to set */ - constructor(properties?: proto.ICollectionMessage); + constructor(properties?: proto.ILabelEditAction); - /** CollectionMessage bizJid. */ - public bizJid: string; + /** LabelEditAction name. */ + public name: string; - /** CollectionMessage id. */ - public id: string; + /** LabelEditAction color. */ + public color: number; - /** CollectionMessage messageVersion. */ - public messageVersion: number; + /** LabelEditAction predefinedId. */ + public predefinedId: number; + + /** LabelEditAction deleted. */ + public deleted: boolean; /** - * Creates a new CollectionMessage instance using the specified properties. + * Creates a new LabelEditAction instance using the specified properties. * @param [properties] Properties to set - * @returns CollectionMessage instance + * @returns LabelEditAction instance */ - public static create(properties?: proto.ICollectionMessage): proto.CollectionMessage; + public static create(properties?: proto.ILabelEditAction): proto.LabelEditAction; /** - * Encodes the specified CollectionMessage message. Does not implicitly {@link proto.CollectionMessage.verify|verify} messages. - * @param message CollectionMessage message or plain object to encode + * Encodes the specified LabelEditAction message. Does not implicitly {@link proto.LabelEditAction.verify|verify} messages. + * @param message LabelEditAction message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: proto.ICollectionMessage, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: proto.ILabelEditAction, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified CollectionMessage message, length delimited. Does not implicitly {@link proto.CollectionMessage.verify|verify} messages. - * @param message CollectionMessage message or plain object to encode + * Encodes the specified LabelEditAction message, length delimited. Does not implicitly {@link proto.LabelEditAction.verify|verify} messages. + * @param message LabelEditAction message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: proto.ICollectionMessage, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: proto.ILabelEditAction, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a CollectionMessage message from the specified reader or buffer. + * Decodes a LabelEditAction message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns CollectionMessage + * @returns LabelEditAction * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.CollectionMessage; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.LabelEditAction; /** - * Decodes a CollectionMessage message from the specified reader or buffer, length delimited. + * Decodes a LabelEditAction message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns CollectionMessage + * @returns LabelEditAction * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.CollectionMessage; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.LabelEditAction; /** - * Verifies a CollectionMessage message. + * Verifies a LabelEditAction message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a CollectionMessage message from a plain object. Also converts values to their respective internal types. + * Creates a LabelEditAction message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns CollectionMessage + * @returns LabelEditAction */ - public static fromObject(object: { [k: string]: any }): proto.CollectionMessage; + public static fromObject(object: { [k: string]: any }): proto.LabelEditAction; /** - * Creates a plain object from a CollectionMessage message. Also converts values to other types if specified. - * @param message CollectionMessage + * Creates a plain object from a LabelEditAction message. Also converts values to other types if specified. + * @param message LabelEditAction * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: proto.CollectionMessage, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: proto.LabelEditAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this CollectionMessage to JSON. + * Converts this LabelEditAction to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a NativeFlowButton. */ - interface INativeFlowButton { - - /** NativeFlowButton name */ - name?: (string|null); + /** Properties of a LocaleSetting. */ + interface ILocaleSetting { - /** NativeFlowButton buttonParamsJson */ - buttonParamsJson?: (string|null); + /** LocaleSetting locale */ + locale?: (string|null); } - /** Represents a NativeFlowButton. */ - class NativeFlowButton implements INativeFlowButton { + /** Represents a LocaleSetting. */ + class LocaleSetting implements ILocaleSetting { /** - * Constructs a new NativeFlowButton. + * Constructs a new LocaleSetting. * @param [properties] Properties to set */ - constructor(properties?: proto.INativeFlowButton); - - /** NativeFlowButton name. */ - public name: string; + constructor(properties?: proto.ILocaleSetting); - /** NativeFlowButton buttonParamsJson. */ - public buttonParamsJson: string; + /** LocaleSetting locale. */ + public locale: string; /** - * Creates a new NativeFlowButton instance using the specified properties. + * Creates a new LocaleSetting instance using the specified properties. * @param [properties] Properties to set - * @returns NativeFlowButton instance + * @returns LocaleSetting instance */ - public static create(properties?: proto.INativeFlowButton): proto.NativeFlowButton; + public static create(properties?: proto.ILocaleSetting): proto.LocaleSetting; /** - * Encodes the specified NativeFlowButton message. Does not implicitly {@link proto.NativeFlowButton.verify|verify} messages. - * @param message NativeFlowButton message or plain object to encode + * Encodes the specified LocaleSetting message. Does not implicitly {@link proto.LocaleSetting.verify|verify} messages. + * @param message LocaleSetting message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: proto.INativeFlowButton, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: proto.ILocaleSetting, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified NativeFlowButton message, length delimited. Does not implicitly {@link proto.NativeFlowButton.verify|verify} messages. - * @param message NativeFlowButton message or plain object to encode + * Encodes the specified LocaleSetting message, length delimited. Does not implicitly {@link proto.LocaleSetting.verify|verify} messages. + * @param message LocaleSetting message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: proto.INativeFlowButton, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: proto.ILocaleSetting, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a NativeFlowButton message from the specified reader or buffer. + * Decodes a LocaleSetting message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns NativeFlowButton + * @returns LocaleSetting * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.NativeFlowButton; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.LocaleSetting; /** - * Decodes a NativeFlowButton message from the specified reader or buffer, length delimited. + * Decodes a LocaleSetting message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns NativeFlowButton + * @returns LocaleSetting * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.NativeFlowButton; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.LocaleSetting; /** - * Verifies a NativeFlowButton message. + * Verifies a LocaleSetting message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a NativeFlowButton message from a plain object. Also converts values to their respective internal types. + * Creates a LocaleSetting message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns NativeFlowButton + * @returns LocaleSetting */ - public static fromObject(object: { [k: string]: any }): proto.NativeFlowButton; + public static fromObject(object: { [k: string]: any }): proto.LocaleSetting; /** - * Creates a plain object from a NativeFlowButton message. Also converts values to other types if specified. - * @param message NativeFlowButton + * Creates a plain object from a LocaleSetting message. Also converts values to other types if specified. + * @param message LocaleSetting * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: proto.NativeFlowButton, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: proto.LocaleSetting, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this NativeFlowButton to JSON. + * Converts this LocaleSetting to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a NativeFlowMessage. */ - interface INativeFlowMessage { - - /** NativeFlowMessage buttons */ - buttons?: (proto.INativeFlowButton[]|null); + /** Properties of a MarkChatAsReadAction. */ + interface IMarkChatAsReadAction { - /** NativeFlowMessage messageParamsJson */ - messageParamsJson?: (string|null); + /** MarkChatAsReadAction read */ + read?: (boolean|null); - /** NativeFlowMessage messageVersion */ - messageVersion?: (number|null); + /** MarkChatAsReadAction messageRange */ + messageRange?: (proto.ISyncActionMessageRange|null); } - /** Represents a NativeFlowMessage. */ - class NativeFlowMessage implements INativeFlowMessage { + /** Represents a MarkChatAsReadAction. */ + class MarkChatAsReadAction implements IMarkChatAsReadAction { /** - * Constructs a new NativeFlowMessage. + * Constructs a new MarkChatAsReadAction. * @param [properties] Properties to set */ - constructor(properties?: proto.INativeFlowMessage); - - /** NativeFlowMessage buttons. */ - public buttons: proto.INativeFlowButton[]; + constructor(properties?: proto.IMarkChatAsReadAction); - /** NativeFlowMessage messageParamsJson. */ - public messageParamsJson: string; + /** MarkChatAsReadAction read. */ + public read: boolean; - /** NativeFlowMessage messageVersion. */ - public messageVersion: number; + /** MarkChatAsReadAction messageRange. */ + public messageRange?: (proto.ISyncActionMessageRange|null); /** - * Creates a new NativeFlowMessage instance using the specified properties. + * Creates a new MarkChatAsReadAction instance using the specified properties. * @param [properties] Properties to set - * @returns NativeFlowMessage instance + * @returns MarkChatAsReadAction instance */ - public static create(properties?: proto.INativeFlowMessage): proto.NativeFlowMessage; + public static create(properties?: proto.IMarkChatAsReadAction): proto.MarkChatAsReadAction; /** - * Encodes the specified NativeFlowMessage message. Does not implicitly {@link proto.NativeFlowMessage.verify|verify} messages. - * @param message NativeFlowMessage message or plain object to encode + * Encodes the specified MarkChatAsReadAction message. Does not implicitly {@link proto.MarkChatAsReadAction.verify|verify} messages. + * @param message MarkChatAsReadAction message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: proto.INativeFlowMessage, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: proto.IMarkChatAsReadAction, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified NativeFlowMessage message, length delimited. Does not implicitly {@link proto.NativeFlowMessage.verify|verify} messages. - * @param message NativeFlowMessage message or plain object to encode + * Encodes the specified MarkChatAsReadAction message, length delimited. Does not implicitly {@link proto.MarkChatAsReadAction.verify|verify} messages. + * @param message MarkChatAsReadAction message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: proto.INativeFlowMessage, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: proto.IMarkChatAsReadAction, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a NativeFlowMessage message from the specified reader or buffer. + * Decodes a MarkChatAsReadAction message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns NativeFlowMessage + * @returns MarkChatAsReadAction * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.NativeFlowMessage; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.MarkChatAsReadAction; /** - * Decodes a NativeFlowMessage message from the specified reader or buffer, length delimited. + * Decodes a MarkChatAsReadAction message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns NativeFlowMessage + * @returns MarkChatAsReadAction * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.NativeFlowMessage; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.MarkChatAsReadAction; /** - * Verifies a NativeFlowMessage message. + * Verifies a MarkChatAsReadAction message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a NativeFlowMessage message from a plain object. Also converts values to their respective internal types. + * Creates a MarkChatAsReadAction message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns NativeFlowMessage + * @returns MarkChatAsReadAction */ - public static fromObject(object: { [k: string]: any }): proto.NativeFlowMessage; + public static fromObject(object: { [k: string]: any }): proto.MarkChatAsReadAction; /** - * Creates a plain object from a NativeFlowMessage message. Also converts values to other types if specified. - * @param message NativeFlowMessage + * Creates a plain object from a MarkChatAsReadAction message. Also converts values to other types if specified. + * @param message MarkChatAsReadAction * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: proto.NativeFlowMessage, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: proto.MarkChatAsReadAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this NativeFlowMessage to JSON. + * Converts this MarkChatAsReadAction to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of an InteractiveMessage. */ - interface IInteractiveMessage { - - /** InteractiveMessage header */ - header?: (proto.IHeader|null); - - /** InteractiveMessage body */ - body?: (proto.IBody|null); - - /** InteractiveMessage footer */ - footer?: (proto.IFooter|null); - - /** InteractiveMessage contextInfo */ - contextInfo?: (proto.IContextInfo|null); - - /** InteractiveMessage shopStorefrontMessage */ - shopStorefrontMessage?: (proto.IShopMessage|null); + /** Properties of a MuteAction. */ + interface IMuteAction { - /** InteractiveMessage collectionMessage */ - collectionMessage?: (proto.ICollectionMessage|null); + /** MuteAction muted */ + muted?: (boolean|null); - /** InteractiveMessage nativeFlowMessage */ - nativeFlowMessage?: (proto.INativeFlowMessage|null); + /** MuteAction muteEndTimestamp */ + muteEndTimestamp?: (number|Long|null); } - /** Represents an InteractiveMessage. */ - class InteractiveMessage implements IInteractiveMessage { + /** Represents a MuteAction. */ + class MuteAction implements IMuteAction { /** - * Constructs a new InteractiveMessage. + * Constructs a new MuteAction. * @param [properties] Properties to set */ - constructor(properties?: proto.IInteractiveMessage); - - /** InteractiveMessage header. */ - public header?: (proto.IHeader|null); - - /** InteractiveMessage body. */ - public body?: (proto.IBody|null); - - /** InteractiveMessage footer. */ - public footer?: (proto.IFooter|null); - - /** InteractiveMessage contextInfo. */ - public contextInfo?: (proto.IContextInfo|null); - - /** InteractiveMessage shopStorefrontMessage. */ - public shopStorefrontMessage?: (proto.IShopMessage|null); - - /** InteractiveMessage collectionMessage. */ - public collectionMessage?: (proto.ICollectionMessage|null); + constructor(properties?: proto.IMuteAction); - /** InteractiveMessage nativeFlowMessage. */ - public nativeFlowMessage?: (proto.INativeFlowMessage|null); + /** MuteAction muted. */ + public muted: boolean; - /** InteractiveMessage interactiveMessage. */ - public interactiveMessage?: ("shopStorefrontMessage"|"collectionMessage"|"nativeFlowMessage"); + /** MuteAction muteEndTimestamp. */ + public muteEndTimestamp: (number|Long); /** - * Creates a new InteractiveMessage instance using the specified properties. + * Creates a new MuteAction instance using the specified properties. * @param [properties] Properties to set - * @returns InteractiveMessage instance + * @returns MuteAction instance */ - public static create(properties?: proto.IInteractiveMessage): proto.InteractiveMessage; + public static create(properties?: proto.IMuteAction): proto.MuteAction; /** - * Encodes the specified InteractiveMessage message. Does not implicitly {@link proto.InteractiveMessage.verify|verify} messages. - * @param message InteractiveMessage message or plain object to encode + * Encodes the specified MuteAction message. Does not implicitly {@link proto.MuteAction.verify|verify} messages. + * @param message MuteAction message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: proto.IInteractiveMessage, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: proto.IMuteAction, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified InteractiveMessage message, length delimited. Does not implicitly {@link proto.InteractiveMessage.verify|verify} messages. - * @param message InteractiveMessage message or plain object to encode + * Encodes the specified MuteAction message, length delimited. Does not implicitly {@link proto.MuteAction.verify|verify} messages. + * @param message MuteAction message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: proto.IInteractiveMessage, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: proto.IMuteAction, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an InteractiveMessage message from the specified reader or buffer. + * Decodes a MuteAction message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns InteractiveMessage + * @returns MuteAction * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.InteractiveMessage; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.MuteAction; /** - * Decodes an InteractiveMessage message from the specified reader or buffer, length delimited. + * Decodes a MuteAction message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns InteractiveMessage + * @returns MuteAction * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.InteractiveMessage; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.MuteAction; /** - * Verifies an InteractiveMessage message. + * Verifies a MuteAction message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates an InteractiveMessage message from a plain object. Also converts values to their respective internal types. + * Creates a MuteAction message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns InteractiveMessage + * @returns MuteAction */ - public static fromObject(object: { [k: string]: any }): proto.InteractiveMessage; + public static fromObject(object: { [k: string]: any }): proto.MuteAction; /** - * Creates a plain object from an InteractiveMessage message. Also converts values to other types if specified. - * @param message InteractiveMessage + * Creates a plain object from a MuteAction message. Also converts values to other types if specified. + * @param message MuteAction * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: proto.InteractiveMessage, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: proto.MuteAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this InteractiveMessage to JSON. + * Converts this MuteAction to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a GroupInviteMessage. */ - interface IGroupInviteMessage { - - /** GroupInviteMessage groupJid */ - groupJid?: (string|null); - - /** GroupInviteMessage inviteCode */ - inviteCode?: (string|null); - - /** GroupInviteMessage inviteExpiration */ - inviteExpiration?: (number|Long|null); - - /** GroupInviteMessage groupName */ - groupName?: (string|null); - - /** GroupInviteMessage jpegThumbnail */ - jpegThumbnail?: (Uint8Array|null); - - /** GroupInviteMessage caption */ - caption?: (string|null); - - /** GroupInviteMessage contextInfo */ - contextInfo?: (proto.IContextInfo|null); - - /** GroupInviteMessage groupType */ - groupType?: (proto.GroupInviteMessage.GroupInviteMessageGroupType|null); - } - - /** Represents a GroupInviteMessage. */ - class GroupInviteMessage implements IGroupInviteMessage { - - /** - * Constructs a new GroupInviteMessage. - * @param [properties] Properties to set - */ - constructor(properties?: proto.IGroupInviteMessage); - - /** GroupInviteMessage groupJid. */ - public groupJid: string; - - /** GroupInviteMessage inviteCode. */ - public inviteCode: string; - - /** GroupInviteMessage inviteExpiration. */ - public inviteExpiration: (number|Long); - - /** GroupInviteMessage groupName. */ - public groupName: string; + /** Properties of a PinAction. */ + interface IPinAction { - /** GroupInviteMessage jpegThumbnail. */ - public jpegThumbnail: Uint8Array; + /** PinAction pinned */ + pinned?: (boolean|null); + } - /** GroupInviteMessage caption. */ - public caption: string; + /** Represents a PinAction. */ + class PinAction implements IPinAction { - /** GroupInviteMessage contextInfo. */ - public contextInfo?: (proto.IContextInfo|null); + /** + * Constructs a new PinAction. + * @param [properties] Properties to set + */ + constructor(properties?: proto.IPinAction); - /** GroupInviteMessage groupType. */ - public groupType: proto.GroupInviteMessage.GroupInviteMessageGroupType; + /** PinAction pinned. */ + public pinned: boolean; /** - * Creates a new GroupInviteMessage instance using the specified properties. + * Creates a new PinAction instance using the specified properties. * @param [properties] Properties to set - * @returns GroupInviteMessage instance + * @returns PinAction instance */ - public static create(properties?: proto.IGroupInviteMessage): proto.GroupInviteMessage; + public static create(properties?: proto.IPinAction): proto.PinAction; /** - * Encodes the specified GroupInviteMessage message. Does not implicitly {@link proto.GroupInviteMessage.verify|verify} messages. - * @param message GroupInviteMessage message or plain object to encode + * Encodes the specified PinAction message. Does not implicitly {@link proto.PinAction.verify|verify} messages. + * @param message PinAction message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: proto.IGroupInviteMessage, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: proto.IPinAction, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified GroupInviteMessage message, length delimited. Does not implicitly {@link proto.GroupInviteMessage.verify|verify} messages. - * @param message GroupInviteMessage message or plain object to encode + * Encodes the specified PinAction message, length delimited. Does not implicitly {@link proto.PinAction.verify|verify} messages. + * @param message PinAction message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: proto.IGroupInviteMessage, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: proto.IPinAction, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a GroupInviteMessage message from the specified reader or buffer. + * Decodes a PinAction message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns GroupInviteMessage + * @returns PinAction * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.GroupInviteMessage; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.PinAction; /** - * Decodes a GroupInviteMessage message from the specified reader or buffer, length delimited. + * Decodes a PinAction message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns GroupInviteMessage + * @returns PinAction * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.GroupInviteMessage; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.PinAction; /** - * Verifies a GroupInviteMessage message. + * Verifies a PinAction message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a GroupInviteMessage message from a plain object. Also converts values to their respective internal types. + * Creates a PinAction message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns GroupInviteMessage + * @returns PinAction */ - public static fromObject(object: { [k: string]: any }): proto.GroupInviteMessage; + public static fromObject(object: { [k: string]: any }): proto.PinAction; /** - * Creates a plain object from a GroupInviteMessage message. Also converts values to other types if specified. - * @param message GroupInviteMessage + * Creates a plain object from a PinAction message. Also converts values to other types if specified. + * @param message PinAction * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: proto.GroupInviteMessage, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: proto.PinAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this GroupInviteMessage to JSON. + * Converts this PinAction to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - namespace GroupInviteMessage { - - /** GroupInviteMessageGroupType enum. */ - enum GroupInviteMessageGroupType { - DEFAULT = 0, - PARENT = 1 - } - } - - /** Properties of a DeviceSentMessage. */ - interface IDeviceSentMessage { - - /** DeviceSentMessage destinationJid */ - destinationJid?: (string|null); - - /** DeviceSentMessage message */ - message?: (proto.IMessage|null); + /** Properties of a PrimaryFeature. */ + interface IPrimaryFeature { - /** DeviceSentMessage phash */ - phash?: (string|null); + /** PrimaryFeature flags */ + flags?: (string[]|null); } - /** Represents a DeviceSentMessage. */ - class DeviceSentMessage implements IDeviceSentMessage { + /** Represents a PrimaryFeature. */ + class PrimaryFeature implements IPrimaryFeature { /** - * Constructs a new DeviceSentMessage. + * Constructs a new PrimaryFeature. * @param [properties] Properties to set */ - constructor(properties?: proto.IDeviceSentMessage); - - /** DeviceSentMessage destinationJid. */ - public destinationJid: string; - - /** DeviceSentMessage message. */ - public message?: (proto.IMessage|null); + constructor(properties?: proto.IPrimaryFeature); - /** DeviceSentMessage phash. */ - public phash: string; + /** PrimaryFeature flags. */ + public flags: string[]; /** - * Creates a new DeviceSentMessage instance using the specified properties. + * Creates a new PrimaryFeature instance using the specified properties. * @param [properties] Properties to set - * @returns DeviceSentMessage instance + * @returns PrimaryFeature instance */ - public static create(properties?: proto.IDeviceSentMessage): proto.DeviceSentMessage; + public static create(properties?: proto.IPrimaryFeature): proto.PrimaryFeature; /** - * Encodes the specified DeviceSentMessage message. Does not implicitly {@link proto.DeviceSentMessage.verify|verify} messages. - * @param message DeviceSentMessage message or plain object to encode + * Encodes the specified PrimaryFeature message. Does not implicitly {@link proto.PrimaryFeature.verify|verify} messages. + * @param message PrimaryFeature message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: proto.IDeviceSentMessage, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: proto.IPrimaryFeature, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified DeviceSentMessage message, length delimited. Does not implicitly {@link proto.DeviceSentMessage.verify|verify} messages. - * @param message DeviceSentMessage message or plain object to encode + * Encodes the specified PrimaryFeature message, length delimited. Does not implicitly {@link proto.PrimaryFeature.verify|verify} messages. + * @param message PrimaryFeature message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: proto.IDeviceSentMessage, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: proto.IPrimaryFeature, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a DeviceSentMessage message from the specified reader or buffer. + * Decodes a PrimaryFeature message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns DeviceSentMessage + * @returns PrimaryFeature * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.DeviceSentMessage; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.PrimaryFeature; /** - * Decodes a DeviceSentMessage message from the specified reader or buffer, length delimited. + * Decodes a PrimaryFeature message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns DeviceSentMessage + * @returns PrimaryFeature * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.DeviceSentMessage; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.PrimaryFeature; /** - * Verifies a DeviceSentMessage message. + * Verifies a PrimaryFeature message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a DeviceSentMessage message from a plain object. Also converts values to their respective internal types. + * Creates a PrimaryFeature message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns DeviceSentMessage + * @returns PrimaryFeature */ - public static fromObject(object: { [k: string]: any }): proto.DeviceSentMessage; + public static fromObject(object: { [k: string]: any }): proto.PrimaryFeature; /** - * Creates a plain object from a DeviceSentMessage message. Also converts values to other types if specified. - * @param message DeviceSentMessage + * Creates a plain object from a PrimaryFeature message. Also converts values to other types if specified. + * @param message PrimaryFeature * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: proto.DeviceSentMessage, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: proto.PrimaryFeature, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this DeviceSentMessage to JSON. + * Converts this PrimaryFeature to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a FutureProofMessage. */ - interface IFutureProofMessage { + /** Properties of a PushNameSetting. */ + interface IPushNameSetting { - /** FutureProofMessage message */ - message?: (proto.IMessage|null); + /** PushNameSetting name */ + name?: (string|null); } - /** Represents a FutureProofMessage. */ - class FutureProofMessage implements IFutureProofMessage { + /** Represents a PushNameSetting. */ + class PushNameSetting implements IPushNameSetting { /** - * Constructs a new FutureProofMessage. + * Constructs a new PushNameSetting. * @param [properties] Properties to set */ - constructor(properties?: proto.IFutureProofMessage); + constructor(properties?: proto.IPushNameSetting); - /** FutureProofMessage message. */ - public message?: (proto.IMessage|null); + /** PushNameSetting name. */ + public name: string; /** - * Creates a new FutureProofMessage instance using the specified properties. + * Creates a new PushNameSetting instance using the specified properties. * @param [properties] Properties to set - * @returns FutureProofMessage instance + * @returns PushNameSetting instance */ - public static create(properties?: proto.IFutureProofMessage): proto.FutureProofMessage; + public static create(properties?: proto.IPushNameSetting): proto.PushNameSetting; /** - * Encodes the specified FutureProofMessage message. Does not implicitly {@link proto.FutureProofMessage.verify|verify} messages. - * @param message FutureProofMessage message or plain object to encode + * Encodes the specified PushNameSetting message. Does not implicitly {@link proto.PushNameSetting.verify|verify} messages. + * @param message PushNameSetting message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: proto.IFutureProofMessage, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: proto.IPushNameSetting, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified FutureProofMessage message, length delimited. Does not implicitly {@link proto.FutureProofMessage.verify|verify} messages. - * @param message FutureProofMessage message or plain object to encode + * Encodes the specified PushNameSetting message, length delimited. Does not implicitly {@link proto.PushNameSetting.verify|verify} messages. + * @param message PushNameSetting message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: proto.IFutureProofMessage, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: proto.IPushNameSetting, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a FutureProofMessage message from the specified reader or buffer. + * Decodes a PushNameSetting message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns FutureProofMessage + * @returns PushNameSetting * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.FutureProofMessage; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.PushNameSetting; /** - * Decodes a FutureProofMessage message from the specified reader or buffer, length delimited. + * Decodes a PushNameSetting message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns FutureProofMessage + * @returns PushNameSetting * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.FutureProofMessage; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.PushNameSetting; /** - * Verifies a FutureProofMessage message. + * Verifies a PushNameSetting message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a FutureProofMessage message from a plain object. Also converts values to their respective internal types. + * Creates a PushNameSetting message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns FutureProofMessage + * @returns PushNameSetting */ - public static fromObject(object: { [k: string]: any }): proto.FutureProofMessage; + public static fromObject(object: { [k: string]: any }): proto.PushNameSetting; /** - * Creates a plain object from a FutureProofMessage message. Also converts values to other types if specified. - * @param message FutureProofMessage + * Creates a plain object from a PushNameSetting message. Also converts values to other types if specified. + * @param message PushNameSetting * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: proto.FutureProofMessage, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: proto.PushNameSetting, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this FutureProofMessage to JSON. + * Converts this PushNameSetting to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a ButtonText. */ - interface IButtonText { + /** Properties of a QuickReplyAction. */ + interface IQuickReplyAction { - /** ButtonText displayText */ - displayText?: (string|null); + /** QuickReplyAction shortcut */ + shortcut?: (string|null); + + /** QuickReplyAction message */ + message?: (string|null); + + /** QuickReplyAction keywords */ + keywords?: (string[]|null); + + /** QuickReplyAction count */ + count?: (number|null); + + /** QuickReplyAction deleted */ + deleted?: (boolean|null); } - /** Represents a ButtonText. */ - class ButtonText implements IButtonText { + /** Represents a QuickReplyAction. */ + class QuickReplyAction implements IQuickReplyAction { /** - * Constructs a new ButtonText. + * Constructs a new QuickReplyAction. * @param [properties] Properties to set */ - constructor(properties?: proto.IButtonText); + constructor(properties?: proto.IQuickReplyAction); + + /** QuickReplyAction shortcut. */ + public shortcut: string; + + /** QuickReplyAction message. */ + public message: string; + + /** QuickReplyAction keywords. */ + public keywords: string[]; - /** ButtonText displayText. */ - public displayText: string; + /** QuickReplyAction count. */ + public count: number; + + /** QuickReplyAction deleted. */ + public deleted: boolean; /** - * Creates a new ButtonText instance using the specified properties. + * Creates a new QuickReplyAction instance using the specified properties. * @param [properties] Properties to set - * @returns ButtonText instance + * @returns QuickReplyAction instance */ - public static create(properties?: proto.IButtonText): proto.ButtonText; + public static create(properties?: proto.IQuickReplyAction): proto.QuickReplyAction; /** - * Encodes the specified ButtonText message. Does not implicitly {@link proto.ButtonText.verify|verify} messages. - * @param message ButtonText message or plain object to encode + * Encodes the specified QuickReplyAction message. Does not implicitly {@link proto.QuickReplyAction.verify|verify} messages. + * @param message QuickReplyAction message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: proto.IButtonText, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: proto.IQuickReplyAction, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ButtonText message, length delimited. Does not implicitly {@link proto.ButtonText.verify|verify} messages. - * @param message ButtonText message or plain object to encode + * Encodes the specified QuickReplyAction message, length delimited. Does not implicitly {@link proto.QuickReplyAction.verify|verify} messages. + * @param message QuickReplyAction message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: proto.IButtonText, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: proto.IQuickReplyAction, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ButtonText message from the specified reader or buffer. + * Decodes a QuickReplyAction message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ButtonText + * @returns QuickReplyAction * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.ButtonText; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.QuickReplyAction; /** - * Decodes a ButtonText message from the specified reader or buffer, length delimited. + * Decodes a QuickReplyAction message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ButtonText + * @returns QuickReplyAction * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.ButtonText; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.QuickReplyAction; /** - * Verifies a ButtonText message. + * Verifies a QuickReplyAction message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a ButtonText message from a plain object. Also converts values to their respective internal types. + * Creates a QuickReplyAction message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ButtonText + * @returns QuickReplyAction */ - public static fromObject(object: { [k: string]: any }): proto.ButtonText; + public static fromObject(object: { [k: string]: any }): proto.QuickReplyAction; /** - * Creates a plain object from a ButtonText message. Also converts values to other types if specified. - * @param message ButtonText + * Creates a plain object from a QuickReplyAction message. Also converts values to other types if specified. + * @param message QuickReplyAction * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: proto.ButtonText, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: proto.QuickReplyAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ButtonText to JSON. + * Converts this QuickReplyAction to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a NativeFlowInfo. */ - interface INativeFlowInfo { + /** Properties of a RecentEmojiWeight. */ + interface IRecentEmojiWeight { - /** NativeFlowInfo name */ - name?: (string|null); + /** RecentEmojiWeight emoji */ + emoji?: (string|null); - /** NativeFlowInfo paramsJson */ - paramsJson?: (string|null); + /** RecentEmojiWeight weight */ + weight?: (number|null); } - /** Represents a NativeFlowInfo. */ - class NativeFlowInfo implements INativeFlowInfo { + /** Represents a RecentEmojiWeight. */ + class RecentEmojiWeight implements IRecentEmojiWeight { /** - * Constructs a new NativeFlowInfo. + * Constructs a new RecentEmojiWeight. * @param [properties] Properties to set */ - constructor(properties?: proto.INativeFlowInfo); + constructor(properties?: proto.IRecentEmojiWeight); - /** NativeFlowInfo name. */ - public name: string; + /** RecentEmojiWeight emoji. */ + public emoji: string; - /** NativeFlowInfo paramsJson. */ - public paramsJson: string; + /** RecentEmojiWeight weight. */ + public weight: number; /** - * Creates a new NativeFlowInfo instance using the specified properties. + * Creates a new RecentEmojiWeight instance using the specified properties. * @param [properties] Properties to set - * @returns NativeFlowInfo instance + * @returns RecentEmojiWeight instance */ - public static create(properties?: proto.INativeFlowInfo): proto.NativeFlowInfo; + public static create(properties?: proto.IRecentEmojiWeight): proto.RecentEmojiWeight; /** - * Encodes the specified NativeFlowInfo message. Does not implicitly {@link proto.NativeFlowInfo.verify|verify} messages. - * @param message NativeFlowInfo message or plain object to encode + * Encodes the specified RecentEmojiWeight message. Does not implicitly {@link proto.RecentEmojiWeight.verify|verify} messages. + * @param message RecentEmojiWeight message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: proto.INativeFlowInfo, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: proto.IRecentEmojiWeight, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified NativeFlowInfo message, length delimited. Does not implicitly {@link proto.NativeFlowInfo.verify|verify} messages. - * @param message NativeFlowInfo message or plain object to encode + * Encodes the specified RecentEmojiWeight message, length delimited. Does not implicitly {@link proto.RecentEmojiWeight.verify|verify} messages. + * @param message RecentEmojiWeight message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: proto.INativeFlowInfo, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: proto.IRecentEmojiWeight, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a NativeFlowInfo message from the specified reader or buffer. + * Decodes a RecentEmojiWeight message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns NativeFlowInfo + * @returns RecentEmojiWeight * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.NativeFlowInfo; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.RecentEmojiWeight; /** - * Decodes a NativeFlowInfo message from the specified reader or buffer, length delimited. + * Decodes a RecentEmojiWeight message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns NativeFlowInfo + * @returns RecentEmojiWeight * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.NativeFlowInfo; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.RecentEmojiWeight; /** - * Verifies a NativeFlowInfo message. + * Verifies a RecentEmojiWeight message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a NativeFlowInfo message from a plain object. Also converts values to their respective internal types. + * Creates a RecentEmojiWeight message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns NativeFlowInfo + * @returns RecentEmojiWeight */ - public static fromObject(object: { [k: string]: any }): proto.NativeFlowInfo; + public static fromObject(object: { [k: string]: any }): proto.RecentEmojiWeight; /** - * Creates a plain object from a NativeFlowInfo message. Also converts values to other types if specified. - * @param message NativeFlowInfo + * Creates a plain object from a RecentEmojiWeight message. Also converts values to other types if specified. + * @param message RecentEmojiWeight * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: proto.NativeFlowInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: proto.RecentEmojiWeight, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this NativeFlowInfo to JSON. + * Converts this RecentEmojiWeight to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a Button. */ - interface IButton { - - /** Button buttonId */ - buttonId?: (string|null); - - /** Button buttonText */ - buttonText?: (proto.IButtonText|null); - - /** Button type */ - type?: (proto.Button.ButtonType|null); + /** Properties of a RecentEmojiWeightsAction. */ + interface IRecentEmojiWeightsAction { - /** Button nativeFlowInfo */ - nativeFlowInfo?: (proto.INativeFlowInfo|null); + /** RecentEmojiWeightsAction weights */ + weights?: (proto.IRecentEmojiWeight[]|null); } - /** Represents a Button. */ - class Button implements IButton { + /** Represents a RecentEmojiWeightsAction. */ + class RecentEmojiWeightsAction implements IRecentEmojiWeightsAction { /** - * Constructs a new Button. + * Constructs a new RecentEmojiWeightsAction. * @param [properties] Properties to set */ - constructor(properties?: proto.IButton); - - /** Button buttonId. */ - public buttonId: string; - - /** Button buttonText. */ - public buttonText?: (proto.IButtonText|null); - - /** Button type. */ - public type: proto.Button.ButtonType; + constructor(properties?: proto.IRecentEmojiWeightsAction); - /** Button nativeFlowInfo. */ - public nativeFlowInfo?: (proto.INativeFlowInfo|null); + /** RecentEmojiWeightsAction weights. */ + public weights: proto.IRecentEmojiWeight[]; /** - * Creates a new Button instance using the specified properties. + * Creates a new RecentEmojiWeightsAction instance using the specified properties. * @param [properties] Properties to set - * @returns Button instance + * @returns RecentEmojiWeightsAction instance */ - public static create(properties?: proto.IButton): proto.Button; + public static create(properties?: proto.IRecentEmojiWeightsAction): proto.RecentEmojiWeightsAction; /** - * Encodes the specified Button message. Does not implicitly {@link proto.Button.verify|verify} messages. - * @param message Button message or plain object to encode + * Encodes the specified RecentEmojiWeightsAction message. Does not implicitly {@link proto.RecentEmojiWeightsAction.verify|verify} messages. + * @param message RecentEmojiWeightsAction message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: proto.IButton, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: proto.IRecentEmojiWeightsAction, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified Button message, length delimited. Does not implicitly {@link proto.Button.verify|verify} messages. - * @param message Button message or plain object to encode + * Encodes the specified RecentEmojiWeightsAction message, length delimited. Does not implicitly {@link proto.RecentEmojiWeightsAction.verify|verify} messages. + * @param message RecentEmojiWeightsAction message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: proto.IButton, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: proto.IRecentEmojiWeightsAction, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a Button message from the specified reader or buffer. + * Decodes a RecentEmojiWeightsAction message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns Button + * @returns RecentEmojiWeightsAction * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.Button; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.RecentEmojiWeightsAction; /** - * Decodes a Button message from the specified reader or buffer, length delimited. + * Decodes a RecentEmojiWeightsAction message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Button + * @returns RecentEmojiWeightsAction * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.Button; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.RecentEmojiWeightsAction; /** - * Verifies a Button message. + * Verifies a RecentEmojiWeightsAction message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a Button message from a plain object. Also converts values to their respective internal types. + * Creates a RecentEmojiWeightsAction message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Button + * @returns RecentEmojiWeightsAction */ - public static fromObject(object: { [k: string]: any }): proto.Button; + public static fromObject(object: { [k: string]: any }): proto.RecentEmojiWeightsAction; /** - * Creates a plain object from a Button message. Also converts values to other types if specified. - * @param message Button + * Creates a plain object from a RecentEmojiWeightsAction message. Also converts values to other types if specified. + * @param message RecentEmojiWeightsAction * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: proto.Button, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: proto.RecentEmojiWeightsAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Button to JSON. + * Converts this RecentEmojiWeightsAction to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - namespace Button { - - /** ButtonType enum. */ - enum ButtonType { - UNKNOWN = 0, - RESPONSE = 1, - NATIVE_FLOW = 2 - } - } - - /** Properties of a ButtonsMessage. */ - interface IButtonsMessage { - - /** ButtonsMessage contentText */ - contentText?: (string|null); - - /** ButtonsMessage footerText */ - footerText?: (string|null); - - /** ButtonsMessage contextInfo */ - contextInfo?: (proto.IContextInfo|null); + /** Properties of a RecentStickerMetadata. */ + interface IRecentStickerMetadata { - /** ButtonsMessage buttons */ - buttons?: (proto.IButton[]|null); + /** RecentStickerMetadata directPath */ + directPath?: (string|null); - /** ButtonsMessage headerType */ - headerType?: (proto.ButtonsMessage.ButtonsMessageHeaderType|null); + /** RecentStickerMetadata encFilehash */ + encFilehash?: (string|null); - /** ButtonsMessage text */ - text?: (string|null); + /** RecentStickerMetadata mediaKey */ + mediaKey?: (string|null); - /** ButtonsMessage documentMessage */ - documentMessage?: (proto.IDocumentMessage|null); + /** RecentStickerMetadata stanzaId */ + stanzaId?: (string|null); - /** ButtonsMessage imageMessage */ - imageMessage?: (proto.IImageMessage|null); + /** RecentStickerMetadata chatJid */ + chatJid?: (string|null); - /** ButtonsMessage videoMessage */ - videoMessage?: (proto.IVideoMessage|null); + /** RecentStickerMetadata participant */ + participant?: (string|null); - /** ButtonsMessage locationMessage */ - locationMessage?: (proto.ILocationMessage|null); + /** RecentStickerMetadata isSentByMe */ + isSentByMe?: (boolean|null); } - /** Represents a ButtonsMessage. */ - class ButtonsMessage implements IButtonsMessage { + /** Represents a RecentStickerMetadata. */ + class RecentStickerMetadata implements IRecentStickerMetadata { /** - * Constructs a new ButtonsMessage. + * Constructs a new RecentStickerMetadata. * @param [properties] Properties to set */ - constructor(properties?: proto.IButtonsMessage); - - /** ButtonsMessage contentText. */ - public contentText: string; - - /** ButtonsMessage footerText. */ - public footerText: string; - - /** ButtonsMessage contextInfo. */ - public contextInfo?: (proto.IContextInfo|null); - - /** ButtonsMessage buttons. */ - public buttons: proto.IButton[]; + constructor(properties?: proto.IRecentStickerMetadata); - /** ButtonsMessage headerType. */ - public headerType: proto.ButtonsMessage.ButtonsMessageHeaderType; + /** RecentStickerMetadata directPath. */ + public directPath: string; - /** ButtonsMessage text. */ - public text?: (string|null); + /** RecentStickerMetadata encFilehash. */ + public encFilehash: string; - /** ButtonsMessage documentMessage. */ - public documentMessage?: (proto.IDocumentMessage|null); + /** RecentStickerMetadata mediaKey. */ + public mediaKey: string; - /** ButtonsMessage imageMessage. */ - public imageMessage?: (proto.IImageMessage|null); + /** RecentStickerMetadata stanzaId. */ + public stanzaId: string; - /** ButtonsMessage videoMessage. */ - public videoMessage?: (proto.IVideoMessage|null); + /** RecentStickerMetadata chatJid. */ + public chatJid: string; - /** ButtonsMessage locationMessage. */ - public locationMessage?: (proto.ILocationMessage|null); + /** RecentStickerMetadata participant. */ + public participant: string; - /** ButtonsMessage header. */ - public header?: ("text"|"documentMessage"|"imageMessage"|"videoMessage"|"locationMessage"); + /** RecentStickerMetadata isSentByMe. */ + public isSentByMe: boolean; /** - * Creates a new ButtonsMessage instance using the specified properties. + * Creates a new RecentStickerMetadata instance using the specified properties. * @param [properties] Properties to set - * @returns ButtonsMessage instance + * @returns RecentStickerMetadata instance */ - public static create(properties?: proto.IButtonsMessage): proto.ButtonsMessage; + public static create(properties?: proto.IRecentStickerMetadata): proto.RecentStickerMetadata; /** - * Encodes the specified ButtonsMessage message. Does not implicitly {@link proto.ButtonsMessage.verify|verify} messages. - * @param message ButtonsMessage message or plain object to encode + * Encodes the specified RecentStickerMetadata message. Does not implicitly {@link proto.RecentStickerMetadata.verify|verify} messages. + * @param message RecentStickerMetadata message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: proto.IButtonsMessage, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: proto.IRecentStickerMetadata, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ButtonsMessage message, length delimited. Does not implicitly {@link proto.ButtonsMessage.verify|verify} messages. - * @param message ButtonsMessage message or plain object to encode + * Encodes the specified RecentStickerMetadata message, length delimited. Does not implicitly {@link proto.RecentStickerMetadata.verify|verify} messages. + * @param message RecentStickerMetadata message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: proto.IButtonsMessage, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: proto.IRecentStickerMetadata, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ButtonsMessage message from the specified reader or buffer. + * Decodes a RecentStickerMetadata message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ButtonsMessage + * @returns RecentStickerMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.ButtonsMessage; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.RecentStickerMetadata; /** - * Decodes a ButtonsMessage message from the specified reader or buffer, length delimited. + * Decodes a RecentStickerMetadata message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ButtonsMessage + * @returns RecentStickerMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.ButtonsMessage; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.RecentStickerMetadata; /** - * Verifies a ButtonsMessage message. + * Verifies a RecentStickerMetadata message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a ButtonsMessage message from a plain object. Also converts values to their respective internal types. + * Creates a RecentStickerMetadata message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ButtonsMessage + * @returns RecentStickerMetadata */ - public static fromObject(object: { [k: string]: any }): proto.ButtonsMessage; + public static fromObject(object: { [k: string]: any }): proto.RecentStickerMetadata; /** - * Creates a plain object from a ButtonsMessage message. Also converts values to other types if specified. - * @param message ButtonsMessage + * Creates a plain object from a RecentStickerMetadata message. Also converts values to other types if specified. + * @param message RecentStickerMetadata * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: proto.ButtonsMessage, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: proto.RecentStickerMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ButtonsMessage to JSON. + * Converts this RecentStickerMetadata to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - namespace ButtonsMessage { - - /** ButtonsMessageHeaderType enum. */ - enum ButtonsMessageHeaderType { - UNKNOWN = 0, - EMPTY = 1, - TEXT = 2, - DOCUMENT = 3, - IMAGE = 4, - VIDEO = 5, - LOCATION = 6 - } - } - - /** Properties of a ButtonsResponseMessage. */ - interface IButtonsResponseMessage { - - /** ButtonsResponseMessage selectedButtonId */ - selectedButtonId?: (string|null); - - /** ButtonsResponseMessage contextInfo */ - contextInfo?: (proto.IContextInfo|null); + /** Properties of a RecentStickerWeight. */ + interface IRecentStickerWeight { - /** ButtonsResponseMessage type */ - type?: (proto.ButtonsResponseMessage.ButtonsResponseMessageType|null); + /** RecentStickerWeight filehash */ + filehash?: (string|null); - /** ButtonsResponseMessage selectedDisplayText */ - selectedDisplayText?: (string|null); + /** RecentStickerWeight weight */ + weight?: (number|null); } - /** Represents a ButtonsResponseMessage. */ - class ButtonsResponseMessage implements IButtonsResponseMessage { + /** Represents a RecentStickerWeight. */ + class RecentStickerWeight implements IRecentStickerWeight { /** - * Constructs a new ButtonsResponseMessage. + * Constructs a new RecentStickerWeight. * @param [properties] Properties to set */ - constructor(properties?: proto.IButtonsResponseMessage); - - /** ButtonsResponseMessage selectedButtonId. */ - public selectedButtonId: string; - - /** ButtonsResponseMessage contextInfo. */ - public contextInfo?: (proto.IContextInfo|null); - - /** ButtonsResponseMessage type. */ - public type: proto.ButtonsResponseMessage.ButtonsResponseMessageType; + constructor(properties?: proto.IRecentStickerWeight); - /** ButtonsResponseMessage selectedDisplayText. */ - public selectedDisplayText?: (string|null); + /** RecentStickerWeight filehash. */ + public filehash: string; - /** ButtonsResponseMessage response. */ - public response?: "selectedDisplayText"; + /** RecentStickerWeight weight. */ + public weight: number; /** - * Creates a new ButtonsResponseMessage instance using the specified properties. + * Creates a new RecentStickerWeight instance using the specified properties. * @param [properties] Properties to set - * @returns ButtonsResponseMessage instance + * @returns RecentStickerWeight instance */ - public static create(properties?: proto.IButtonsResponseMessage): proto.ButtonsResponseMessage; + public static create(properties?: proto.IRecentStickerWeight): proto.RecentStickerWeight; /** - * Encodes the specified ButtonsResponseMessage message. Does not implicitly {@link proto.ButtonsResponseMessage.verify|verify} messages. - * @param message ButtonsResponseMessage message or plain object to encode + * Encodes the specified RecentStickerWeight message. Does not implicitly {@link proto.RecentStickerWeight.verify|verify} messages. + * @param message RecentStickerWeight message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: proto.IButtonsResponseMessage, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: proto.IRecentStickerWeight, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ButtonsResponseMessage message, length delimited. Does not implicitly {@link proto.ButtonsResponseMessage.verify|verify} messages. - * @param message ButtonsResponseMessage message or plain object to encode + * Encodes the specified RecentStickerWeight message, length delimited. Does not implicitly {@link proto.RecentStickerWeight.verify|verify} messages. + * @param message RecentStickerWeight message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: proto.IButtonsResponseMessage, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: proto.IRecentStickerWeight, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ButtonsResponseMessage message from the specified reader or buffer. + * Decodes a RecentStickerWeight message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ButtonsResponseMessage + * @returns RecentStickerWeight * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.ButtonsResponseMessage; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.RecentStickerWeight; /** - * Decodes a ButtonsResponseMessage message from the specified reader or buffer, length delimited. + * Decodes a RecentStickerWeight message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ButtonsResponseMessage + * @returns RecentStickerWeight * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.ButtonsResponseMessage; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.RecentStickerWeight; /** - * Verifies a ButtonsResponseMessage message. + * Verifies a RecentStickerWeight message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a ButtonsResponseMessage message from a plain object. Also converts values to their respective internal types. + * Creates a RecentStickerWeight message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ButtonsResponseMessage + * @returns RecentStickerWeight */ - public static fromObject(object: { [k: string]: any }): proto.ButtonsResponseMessage; + public static fromObject(object: { [k: string]: any }): proto.RecentStickerWeight; /** - * Creates a plain object from a ButtonsResponseMessage message. Also converts values to other types if specified. - * @param message ButtonsResponseMessage + * Creates a plain object from a RecentStickerWeight message. Also converts values to other types if specified. + * @param message RecentStickerWeight * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: proto.ButtonsResponseMessage, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: proto.RecentStickerWeight, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ButtonsResponseMessage to JSON. + * Converts this RecentStickerWeight to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - namespace ButtonsResponseMessage { - - /** ButtonsResponseMessageType enum. */ - enum ButtonsResponseMessageType { - UNKNOWN = 0, - DISPLAY_TEXT = 1 - } - } - - /** Properties of a ReactionMessage. */ - interface IReactionMessage { - - /** ReactionMessage key */ - key?: (proto.IMessageKey|null); - - /** ReactionMessage text */ - text?: (string|null); - - /** ReactionMessage groupingKey */ - groupingKey?: (string|null); + /** Properties of a RecentStickerWeightsAction. */ + interface IRecentStickerWeightsAction { - /** ReactionMessage senderTimestampMs */ - senderTimestampMs?: (number|Long|null); + /** RecentStickerWeightsAction weights */ + weights?: (proto.IRecentStickerWeight[]|null); } - /** Represents a ReactionMessage. */ - class ReactionMessage implements IReactionMessage { + /** Represents a RecentStickerWeightsAction. */ + class RecentStickerWeightsAction implements IRecentStickerWeightsAction { /** - * Constructs a new ReactionMessage. + * Constructs a new RecentStickerWeightsAction. * @param [properties] Properties to set */ - constructor(properties?: proto.IReactionMessage); - - /** ReactionMessage key. */ - public key?: (proto.IMessageKey|null); - - /** ReactionMessage text. */ - public text: string; - - /** ReactionMessage groupingKey. */ - public groupingKey: string; + constructor(properties?: proto.IRecentStickerWeightsAction); - /** ReactionMessage senderTimestampMs. */ - public senderTimestampMs: (number|Long); + /** RecentStickerWeightsAction weights. */ + public weights: proto.IRecentStickerWeight[]; /** - * Creates a new ReactionMessage instance using the specified properties. + * Creates a new RecentStickerWeightsAction instance using the specified properties. * @param [properties] Properties to set - * @returns ReactionMessage instance + * @returns RecentStickerWeightsAction instance */ - public static create(properties?: proto.IReactionMessage): proto.ReactionMessage; + public static create(properties?: proto.IRecentStickerWeightsAction): proto.RecentStickerWeightsAction; /** - * Encodes the specified ReactionMessage message. Does not implicitly {@link proto.ReactionMessage.verify|verify} messages. - * @param message ReactionMessage message or plain object to encode + * Encodes the specified RecentStickerWeightsAction message. Does not implicitly {@link proto.RecentStickerWeightsAction.verify|verify} messages. + * @param message RecentStickerWeightsAction message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: proto.IReactionMessage, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: proto.IRecentStickerWeightsAction, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ReactionMessage message, length delimited. Does not implicitly {@link proto.ReactionMessage.verify|verify} messages. - * @param message ReactionMessage message or plain object to encode + * Encodes the specified RecentStickerWeightsAction message, length delimited. Does not implicitly {@link proto.RecentStickerWeightsAction.verify|verify} messages. + * @param message RecentStickerWeightsAction message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: proto.IReactionMessage, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: proto.IRecentStickerWeightsAction, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ReactionMessage message from the specified reader or buffer. + * Decodes a RecentStickerWeightsAction message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ReactionMessage + * @returns RecentStickerWeightsAction * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.ReactionMessage; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.RecentStickerWeightsAction; /** - * Decodes a ReactionMessage message from the specified reader or buffer, length delimited. + * Decodes a RecentStickerWeightsAction message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ReactionMessage + * @returns RecentStickerWeightsAction * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.ReactionMessage; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.RecentStickerWeightsAction; /** - * Verifies a ReactionMessage message. + * Verifies a RecentStickerWeightsAction message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a ReactionMessage message from a plain object. Also converts values to their respective internal types. + * Creates a RecentStickerWeightsAction message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ReactionMessage + * @returns RecentStickerWeightsAction */ - public static fromObject(object: { [k: string]: any }): proto.ReactionMessage; + public static fromObject(object: { [k: string]: any }): proto.RecentStickerWeightsAction; /** - * Creates a plain object from a ReactionMessage message. Also converts values to other types if specified. - * @param message ReactionMessage + * Creates a plain object from a RecentStickerWeightsAction message. Also converts values to other types if specified. + * @param message RecentStickerWeightsAction * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: proto.ReactionMessage, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: proto.RecentStickerWeightsAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ReactionMessage to JSON. + * Converts this RecentStickerWeightsAction to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a StickerSyncRMRMessage. */ - interface IStickerSyncRMRMessage { - - /** StickerSyncRMRMessage filehash */ - filehash?: (string[]|null); - - /** StickerSyncRMRMessage rmrSource */ - rmrSource?: (string|null); + /** Properties of a SecurityNotificationSetting. */ + interface ISecurityNotificationSetting { - /** StickerSyncRMRMessage requestTimestamp */ - requestTimestamp?: (number|Long|null); + /** SecurityNotificationSetting showNotification */ + showNotification?: (boolean|null); } - /** Represents a StickerSyncRMRMessage. */ - class StickerSyncRMRMessage implements IStickerSyncRMRMessage { + /** Represents a SecurityNotificationSetting. */ + class SecurityNotificationSetting implements ISecurityNotificationSetting { /** - * Constructs a new StickerSyncRMRMessage. + * Constructs a new SecurityNotificationSetting. * @param [properties] Properties to set */ - constructor(properties?: proto.IStickerSyncRMRMessage); - - /** StickerSyncRMRMessage filehash. */ - public filehash: string[]; - - /** StickerSyncRMRMessage rmrSource. */ - public rmrSource: string; + constructor(properties?: proto.ISecurityNotificationSetting); - /** StickerSyncRMRMessage requestTimestamp. */ - public requestTimestamp: (number|Long); + /** SecurityNotificationSetting showNotification. */ + public showNotification: boolean; /** - * Creates a new StickerSyncRMRMessage instance using the specified properties. + * Creates a new SecurityNotificationSetting instance using the specified properties. * @param [properties] Properties to set - * @returns StickerSyncRMRMessage instance + * @returns SecurityNotificationSetting instance */ - public static create(properties?: proto.IStickerSyncRMRMessage): proto.StickerSyncRMRMessage; + public static create(properties?: proto.ISecurityNotificationSetting): proto.SecurityNotificationSetting; /** - * Encodes the specified StickerSyncRMRMessage message. Does not implicitly {@link proto.StickerSyncRMRMessage.verify|verify} messages. - * @param message StickerSyncRMRMessage message or plain object to encode + * Encodes the specified SecurityNotificationSetting message. Does not implicitly {@link proto.SecurityNotificationSetting.verify|verify} messages. + * @param message SecurityNotificationSetting message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: proto.IStickerSyncRMRMessage, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: proto.ISecurityNotificationSetting, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified StickerSyncRMRMessage message, length delimited. Does not implicitly {@link proto.StickerSyncRMRMessage.verify|verify} messages. - * @param message StickerSyncRMRMessage message or plain object to encode + * Encodes the specified SecurityNotificationSetting message, length delimited. Does not implicitly {@link proto.SecurityNotificationSetting.verify|verify} messages. + * @param message SecurityNotificationSetting message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: proto.IStickerSyncRMRMessage, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: proto.ISecurityNotificationSetting, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a StickerSyncRMRMessage message from the specified reader or buffer. + * Decodes a SecurityNotificationSetting message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns StickerSyncRMRMessage + * @returns SecurityNotificationSetting * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.StickerSyncRMRMessage; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.SecurityNotificationSetting; /** - * Decodes a StickerSyncRMRMessage message from the specified reader or buffer, length delimited. + * Decodes a SecurityNotificationSetting message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns StickerSyncRMRMessage + * @returns SecurityNotificationSetting * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.StickerSyncRMRMessage; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.SecurityNotificationSetting; /** - * Verifies a StickerSyncRMRMessage message. + * Verifies a SecurityNotificationSetting message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a StickerSyncRMRMessage message from a plain object. Also converts values to their respective internal types. + * Creates a SecurityNotificationSetting message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns StickerSyncRMRMessage + * @returns SecurityNotificationSetting */ - public static fromObject(object: { [k: string]: any }): proto.StickerSyncRMRMessage; + public static fromObject(object: { [k: string]: any }): proto.SecurityNotificationSetting; /** - * Creates a plain object from a StickerSyncRMRMessage message. Also converts values to other types if specified. - * @param message StickerSyncRMRMessage + * Creates a plain object from a SecurityNotificationSetting message. Also converts values to other types if specified. + * @param message SecurityNotificationSetting * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: proto.StickerSyncRMRMessage, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: proto.SecurityNotificationSetting, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this StickerSyncRMRMessage to JSON. + * Converts this SecurityNotificationSetting to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a Message. */ - interface IMessage { - - /** Message conversation */ - conversation?: (string|null); - - /** Message senderKeyDistributionMessage */ - senderKeyDistributionMessage?: (proto.ISenderKeyDistributionMessage|null); - - /** Message imageMessage */ - imageMessage?: (proto.IImageMessage|null); - - /** Message contactMessage */ - contactMessage?: (proto.IContactMessage|null); - - /** Message locationMessage */ - locationMessage?: (proto.ILocationMessage|null); - - /** Message extendedTextMessage */ - extendedTextMessage?: (proto.IExtendedTextMessage|null); - - /** Message documentMessage */ - documentMessage?: (proto.IDocumentMessage|null); - - /** Message audioMessage */ - audioMessage?: (proto.IAudioMessage|null); - - /** Message videoMessage */ - videoMessage?: (proto.IVideoMessage|null); - - /** Message call */ - call?: (proto.ICall|null); - - /** Message chat */ - chat?: (proto.IChat|null); - - /** Message protocolMessage */ - protocolMessage?: (proto.IProtocolMessage|null); - - /** Message contactsArrayMessage */ - contactsArrayMessage?: (proto.IContactsArrayMessage|null); - - /** Message highlyStructuredMessage */ - highlyStructuredMessage?: (proto.IHighlyStructuredMessage|null); - - /** Message fastRatchetKeySenderKeyDistributionMessage */ - fastRatchetKeySenderKeyDistributionMessage?: (proto.ISenderKeyDistributionMessage|null); - - /** Message sendPaymentMessage */ - sendPaymentMessage?: (proto.ISendPaymentMessage|null); - - /** Message liveLocationMessage */ - liveLocationMessage?: (proto.ILiveLocationMessage|null); - - /** Message requestPaymentMessage */ - requestPaymentMessage?: (proto.IRequestPaymentMessage|null); - - /** Message declinePaymentRequestMessage */ - declinePaymentRequestMessage?: (proto.IDeclinePaymentRequestMessage|null); - - /** Message cancelPaymentRequestMessage */ - cancelPaymentRequestMessage?: (proto.ICancelPaymentRequestMessage|null); - - /** Message templateMessage */ - templateMessage?: (proto.ITemplateMessage|null); - - /** Message stickerMessage */ - stickerMessage?: (proto.IStickerMessage|null); - - /** Message groupInviteMessage */ - groupInviteMessage?: (proto.IGroupInviteMessage|null); - - /** Message templateButtonReplyMessage */ - templateButtonReplyMessage?: (proto.ITemplateButtonReplyMessage|null); - - /** Message productMessage */ - productMessage?: (proto.IProductMessage|null); - - /** Message deviceSentMessage */ - deviceSentMessage?: (proto.IDeviceSentMessage|null); - - /** Message messageContextInfo */ - messageContextInfo?: (proto.IMessageContextInfo|null); - - /** Message listMessage */ - listMessage?: (proto.IListMessage|null); - - /** Message viewOnceMessage */ - viewOnceMessage?: (proto.IFutureProofMessage|null); - - /** Message orderMessage */ - orderMessage?: (proto.IOrderMessage|null); - - /** Message listResponseMessage */ - listResponseMessage?: (proto.IListResponseMessage|null); - - /** Message ephemeralMessage */ - ephemeralMessage?: (proto.IFutureProofMessage|null); - - /** Message invoiceMessage */ - invoiceMessage?: (proto.IInvoiceMessage|null); - - /** Message buttonsMessage */ - buttonsMessage?: (proto.IButtonsMessage|null); - - /** Message buttonsResponseMessage */ - buttonsResponseMessage?: (proto.IButtonsResponseMessage|null); - - /** Message paymentInviteMessage */ - paymentInviteMessage?: (proto.IPaymentInviteMessage|null); - - /** Message interactiveMessage */ - interactiveMessage?: (proto.IInteractiveMessage|null); - - /** Message reactionMessage */ - reactionMessage?: (proto.IReactionMessage|null); + /** Properties of a StarAction. */ + interface IStarAction { - /** Message stickerSyncRmrMessage */ - stickerSyncRmrMessage?: (proto.IStickerSyncRMRMessage|null); + /** StarAction starred */ + starred?: (boolean|null); } - /** Represents a Message. */ - class Message implements IMessage { + /** Represents a StarAction. */ + class StarAction implements IStarAction { /** - * Constructs a new Message. + * Constructs a new StarAction. * @param [properties] Properties to set */ - constructor(properties?: proto.IMessage); - - /** Message conversation. */ - public conversation: string; - - /** Message senderKeyDistributionMessage. */ - public senderKeyDistributionMessage?: (proto.ISenderKeyDistributionMessage|null); + constructor(properties?: proto.IStarAction); - /** Message imageMessage. */ - public imageMessage?: (proto.IImageMessage|null); + /** StarAction starred. */ + public starred: boolean; - /** Message contactMessage. */ - public contactMessage?: (proto.IContactMessage|null); + /** + * Creates a new StarAction instance using the specified properties. + * @param [properties] Properties to set + * @returns StarAction instance + */ + public static create(properties?: proto.IStarAction): proto.StarAction; - /** Message locationMessage. */ - public locationMessage?: (proto.ILocationMessage|null); + /** + * Encodes the specified StarAction message. Does not implicitly {@link proto.StarAction.verify|verify} messages. + * @param message StarAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: proto.IStarAction, writer?: $protobuf.Writer): $protobuf.Writer; - /** Message extendedTextMessage. */ - public extendedTextMessage?: (proto.IExtendedTextMessage|null); + /** + * Encodes the specified StarAction message, length delimited. Does not implicitly {@link proto.StarAction.verify|verify} messages. + * @param message StarAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: proto.IStarAction, writer?: $protobuf.Writer): $protobuf.Writer; - /** Message documentMessage. */ - public documentMessage?: (proto.IDocumentMessage|null); + /** + * Decodes a StarAction message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StarAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.StarAction; - /** Message audioMessage. */ - public audioMessage?: (proto.IAudioMessage|null); + /** + * Decodes a StarAction message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StarAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.StarAction; - /** Message videoMessage. */ - public videoMessage?: (proto.IVideoMessage|null); + /** + * Verifies a StarAction message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** Message call. */ - public call?: (proto.ICall|null); + /** + * Creates a StarAction message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StarAction + */ + public static fromObject(object: { [k: string]: any }): proto.StarAction; - /** Message chat. */ - public chat?: (proto.IChat|null); + /** + * Creates a plain object from a StarAction message. Also converts values to other types if specified. + * @param message StarAction + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: proto.StarAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** Message protocolMessage. */ - public protocolMessage?: (proto.IProtocolMessage|null); + /** + * Converts this StarAction to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** Message contactsArrayMessage. */ - public contactsArrayMessage?: (proto.IContactsArrayMessage|null); + /** Properties of a SyncActionData. */ + interface ISyncActionData { - /** Message highlyStructuredMessage. */ - public highlyStructuredMessage?: (proto.IHighlyStructuredMessage|null); + /** SyncActionData index */ + index?: (Uint8Array|null); - /** Message fastRatchetKeySenderKeyDistributionMessage. */ - public fastRatchetKeySenderKeyDistributionMessage?: (proto.ISenderKeyDistributionMessage|null); + /** SyncActionData value */ + value?: (proto.ISyncActionValue|null); - /** Message sendPaymentMessage. */ - public sendPaymentMessage?: (proto.ISendPaymentMessage|null); + /** SyncActionData padding */ + padding?: (Uint8Array|null); - /** Message liveLocationMessage. */ - public liveLocationMessage?: (proto.ILiveLocationMessage|null); + /** SyncActionData version */ + version?: (number|null); + } - /** Message requestPaymentMessage. */ - public requestPaymentMessage?: (proto.IRequestPaymentMessage|null); + /** Represents a SyncActionData. */ + class SyncActionData implements ISyncActionData { - /** Message declinePaymentRequestMessage. */ - public declinePaymentRequestMessage?: (proto.IDeclinePaymentRequestMessage|null); + /** + * Constructs a new SyncActionData. + * @param [properties] Properties to set + */ + constructor(properties?: proto.ISyncActionData); - /** Message cancelPaymentRequestMessage. */ - public cancelPaymentRequestMessage?: (proto.ICancelPaymentRequestMessage|null); + /** SyncActionData index. */ + public index: Uint8Array; - /** Message templateMessage. */ - public templateMessage?: (proto.ITemplateMessage|null); + /** SyncActionData value. */ + public value?: (proto.ISyncActionValue|null); - /** Message stickerMessage. */ - public stickerMessage?: (proto.IStickerMessage|null); + /** SyncActionData padding. */ + public padding: Uint8Array; - /** Message groupInviteMessage. */ - public groupInviteMessage?: (proto.IGroupInviteMessage|null); + /** SyncActionData version. */ + public version: number; - /** Message templateButtonReplyMessage. */ - public templateButtonReplyMessage?: (proto.ITemplateButtonReplyMessage|null); + /** + * Creates a new SyncActionData instance using the specified properties. + * @param [properties] Properties to set + * @returns SyncActionData instance + */ + public static create(properties?: proto.ISyncActionData): proto.SyncActionData; - /** Message productMessage. */ - public productMessage?: (proto.IProductMessage|null); + /** + * Encodes the specified SyncActionData message. Does not implicitly {@link proto.SyncActionData.verify|verify} messages. + * @param message SyncActionData message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: proto.ISyncActionData, writer?: $protobuf.Writer): $protobuf.Writer; - /** Message deviceSentMessage. */ - public deviceSentMessage?: (proto.IDeviceSentMessage|null); + /** + * Encodes the specified SyncActionData message, length delimited. Does not implicitly {@link proto.SyncActionData.verify|verify} messages. + * @param message SyncActionData message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: proto.ISyncActionData, writer?: $protobuf.Writer): $protobuf.Writer; - /** Message messageContextInfo. */ - public messageContextInfo?: (proto.IMessageContextInfo|null); + /** + * Decodes a SyncActionData message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SyncActionData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.SyncActionData; - /** Message listMessage. */ - public listMessage?: (proto.IListMessage|null); + /** + * Decodes a SyncActionData message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SyncActionData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.SyncActionData; - /** Message viewOnceMessage. */ - public viewOnceMessage?: (proto.IFutureProofMessage|null); + /** + * Verifies a SyncActionData message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** Message orderMessage. */ - public orderMessage?: (proto.IOrderMessage|null); + /** + * Creates a SyncActionData message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SyncActionData + */ + public static fromObject(object: { [k: string]: any }): proto.SyncActionData; - /** Message listResponseMessage. */ - public listResponseMessage?: (proto.IListResponseMessage|null); + /** + * Creates a plain object from a SyncActionData message. Also converts values to other types if specified. + * @param message SyncActionData + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: proto.SyncActionData, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** Message ephemeralMessage. */ - public ephemeralMessage?: (proto.IFutureProofMessage|null); + /** + * Converts this SyncActionData to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** Message invoiceMessage. */ - public invoiceMessage?: (proto.IInvoiceMessage|null); + /** Properties of a SyncActionMessage. */ + interface ISyncActionMessage { - /** Message buttonsMessage. */ - public buttonsMessage?: (proto.IButtonsMessage|null); + /** SyncActionMessage key */ + key?: (proto.IMessageKey|null); - /** Message buttonsResponseMessage. */ - public buttonsResponseMessage?: (proto.IButtonsResponseMessage|null); + /** SyncActionMessage timestamp */ + timestamp?: (number|Long|null); + } - /** Message paymentInviteMessage. */ - public paymentInviteMessage?: (proto.IPaymentInviteMessage|null); + /** Represents a SyncActionMessage. */ + class SyncActionMessage implements ISyncActionMessage { - /** Message interactiveMessage. */ - public interactiveMessage?: (proto.IInteractiveMessage|null); + /** + * Constructs a new SyncActionMessage. + * @param [properties] Properties to set + */ + constructor(properties?: proto.ISyncActionMessage); - /** Message reactionMessage. */ - public reactionMessage?: (proto.IReactionMessage|null); + /** SyncActionMessage key. */ + public key?: (proto.IMessageKey|null); - /** Message stickerSyncRmrMessage. */ - public stickerSyncRmrMessage?: (proto.IStickerSyncRMRMessage|null); + /** SyncActionMessage timestamp. */ + public timestamp: (number|Long); /** - * Creates a new Message instance using the specified properties. + * Creates a new SyncActionMessage instance using the specified properties. * @param [properties] Properties to set - * @returns Message instance + * @returns SyncActionMessage instance */ - public static create(properties?: proto.IMessage): proto.Message; + public static create(properties?: proto.ISyncActionMessage): proto.SyncActionMessage; /** - * Encodes the specified Message message. Does not implicitly {@link proto.Message.verify|verify} messages. - * @param message Message message or plain object to encode + * Encodes the specified SyncActionMessage message. Does not implicitly {@link proto.SyncActionMessage.verify|verify} messages. + * @param message SyncActionMessage message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: proto.IMessage, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: proto.ISyncActionMessage, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified Message message, length delimited. Does not implicitly {@link proto.Message.verify|verify} messages. - * @param message Message message or plain object to encode + * Encodes the specified SyncActionMessage message, length delimited. Does not implicitly {@link proto.SyncActionMessage.verify|verify} messages. + * @param message SyncActionMessage message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: proto.IMessage, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: proto.ISyncActionMessage, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a Message message from the specified reader or buffer. + * Decodes a SyncActionMessage message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns Message + * @returns SyncActionMessage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.Message; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.SyncActionMessage; /** - * Decodes a Message message from the specified reader or buffer, length delimited. + * Decodes a SyncActionMessage message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Message + * @returns SyncActionMessage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.Message; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.SyncActionMessage; /** - * Verifies a Message message. + * Verifies a SyncActionMessage message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a Message message from a plain object. Also converts values to their respective internal types. + * Creates a SyncActionMessage message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Message + * @returns SyncActionMessage */ - public static fromObject(object: { [k: string]: any }): proto.Message; + public static fromObject(object: { [k: string]: any }): proto.SyncActionMessage; /** - * Creates a plain object from a Message message. Also converts values to other types if specified. - * @param message Message + * Creates a plain object from a SyncActionMessage message. Also converts values to other types if specified. + * @param message SyncActionMessage * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: proto.Message, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: proto.SyncActionMessage, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Message to JSON. + * Converts this SyncActionMessage to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of an ActionLink. */ - interface IActionLink { + /** Properties of a SyncActionMessageRange. */ + interface ISyncActionMessageRange { - /** ActionLink url */ - url?: (string|null); + /** SyncActionMessageRange lastMessageTimestamp */ + lastMessageTimestamp?: (number|Long|null); - /** ActionLink buttonTitle */ - buttonTitle?: (string|null); + /** SyncActionMessageRange lastSystemMessageTimestamp */ + lastSystemMessageTimestamp?: (number|Long|null); + + /** SyncActionMessageRange messages */ + messages?: (proto.ISyncActionMessage[]|null); } - /** Represents an ActionLink. */ - class ActionLink implements IActionLink { + /** Represents a SyncActionMessageRange. */ + class SyncActionMessageRange implements ISyncActionMessageRange { /** - * Constructs a new ActionLink. + * Constructs a new SyncActionMessageRange. * @param [properties] Properties to set */ - constructor(properties?: proto.IActionLink); + constructor(properties?: proto.ISyncActionMessageRange); - /** ActionLink url. */ - public url: string; + /** SyncActionMessageRange lastMessageTimestamp. */ + public lastMessageTimestamp: (number|Long); - /** ActionLink buttonTitle. */ - public buttonTitle: string; + /** SyncActionMessageRange lastSystemMessageTimestamp. */ + public lastSystemMessageTimestamp: (number|Long); + + /** SyncActionMessageRange messages. */ + public messages: proto.ISyncActionMessage[]; /** - * Creates a new ActionLink instance using the specified properties. + * Creates a new SyncActionMessageRange instance using the specified properties. * @param [properties] Properties to set - * @returns ActionLink instance + * @returns SyncActionMessageRange instance */ - public static create(properties?: proto.IActionLink): proto.ActionLink; + public static create(properties?: proto.ISyncActionMessageRange): proto.SyncActionMessageRange; /** - * Encodes the specified ActionLink message. Does not implicitly {@link proto.ActionLink.verify|verify} messages. - * @param message ActionLink message or plain object to encode + * Encodes the specified SyncActionMessageRange message. Does not implicitly {@link proto.SyncActionMessageRange.verify|verify} messages. + * @param message SyncActionMessageRange message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: proto.IActionLink, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: proto.ISyncActionMessageRange, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ActionLink message, length delimited. Does not implicitly {@link proto.ActionLink.verify|verify} messages. - * @param message ActionLink message or plain object to encode + * Encodes the specified SyncActionMessageRange message, length delimited. Does not implicitly {@link proto.SyncActionMessageRange.verify|verify} messages. + * @param message SyncActionMessageRange message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: proto.IActionLink, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: proto.ISyncActionMessageRange, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an ActionLink message from the specified reader or buffer. + * Decodes a SyncActionMessageRange message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ActionLink + * @returns SyncActionMessageRange * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.ActionLink; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.SyncActionMessageRange; /** - * Decodes an ActionLink message from the specified reader or buffer, length delimited. + * Decodes a SyncActionMessageRange message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ActionLink + * @returns SyncActionMessageRange * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.ActionLink; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.SyncActionMessageRange; /** - * Verifies an ActionLink message. + * Verifies a SyncActionMessageRange message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates an ActionLink message from a plain object. Also converts values to their respective internal types. + * Creates a SyncActionMessageRange message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ActionLink + * @returns SyncActionMessageRange */ - public static fromObject(object: { [k: string]: any }): proto.ActionLink; + public static fromObject(object: { [k: string]: any }): proto.SyncActionMessageRange; /** - * Creates a plain object from an ActionLink message. Also converts values to other types if specified. - * @param message ActionLink + * Creates a plain object from a SyncActionMessageRange message. Also converts values to other types if specified. + * @param message SyncActionMessageRange * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: proto.ActionLink, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: proto.SyncActionMessageRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ActionLink to JSON. + * Converts this SyncActionMessageRange to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a DisappearingMode. */ - interface IDisappearingMode { + /** Properties of a SyncActionValue. */ + interface ISyncActionValue { + + /** SyncActionValue timestamp */ + timestamp?: (number|Long|null); + + /** SyncActionValue starAction */ + starAction?: (proto.IStarAction|null); + + /** SyncActionValue contactAction */ + contactAction?: (proto.IContactAction|null); + + /** SyncActionValue muteAction */ + muteAction?: (proto.IMuteAction|null); + + /** SyncActionValue pinAction */ + pinAction?: (proto.IPinAction|null); + + /** SyncActionValue securityNotificationSetting */ + securityNotificationSetting?: (proto.ISecurityNotificationSetting|null); + + /** SyncActionValue pushNameSetting */ + pushNameSetting?: (proto.IPushNameSetting|null); + + /** SyncActionValue quickReplyAction */ + quickReplyAction?: (proto.IQuickReplyAction|null); + + /** SyncActionValue recentStickerWeightsAction */ + recentStickerWeightsAction?: (proto.IRecentStickerWeightsAction|null); + + /** SyncActionValue recentStickerMetadata */ + recentStickerMetadata?: (proto.IRecentStickerMetadata|null); + + /** SyncActionValue recentEmojiWeightsAction */ + recentEmojiWeightsAction?: (proto.IRecentEmojiWeightsAction|null); + + /** SyncActionValue labelEditAction */ + labelEditAction?: (proto.ILabelEditAction|null); + + /** SyncActionValue labelAssociationAction */ + labelAssociationAction?: (proto.ILabelAssociationAction|null); + + /** SyncActionValue localeSetting */ + localeSetting?: (proto.ILocaleSetting|null); + + /** SyncActionValue archiveChatAction */ + archiveChatAction?: (proto.IArchiveChatAction|null); + + /** SyncActionValue deleteMessageForMeAction */ + deleteMessageForMeAction?: (proto.IDeleteMessageForMeAction|null); + + /** SyncActionValue keyExpiration */ + keyExpiration?: (proto.IKeyExpiration|null); + + /** SyncActionValue markChatAsReadAction */ + markChatAsReadAction?: (proto.IMarkChatAsReadAction|null); + + /** SyncActionValue clearChatAction */ + clearChatAction?: (proto.IClearChatAction|null); + + /** SyncActionValue deleteChatAction */ + deleteChatAction?: (proto.IDeleteChatAction|null); + + /** SyncActionValue unarchiveChatsSetting */ + unarchiveChatsSetting?: (proto.IUnarchiveChatsSetting|null); + + /** SyncActionValue primaryFeature */ + primaryFeature?: (proto.IPrimaryFeature|null); + + /** SyncActionValue favoriteStickerAction */ + favoriteStickerAction?: (proto.IFavoriteStickerAction|null); + + /** SyncActionValue androidUnsupportedActions */ + androidUnsupportedActions?: (proto.IAndroidUnsupportedActions|null); + } + + /** Represents a SyncActionValue. */ + class SyncActionValue implements ISyncActionValue { + + /** + * Constructs a new SyncActionValue. + * @param [properties] Properties to set + */ + constructor(properties?: proto.ISyncActionValue); + + /** SyncActionValue timestamp. */ + public timestamp: (number|Long); + + /** SyncActionValue starAction. */ + public starAction?: (proto.IStarAction|null); + + /** SyncActionValue contactAction. */ + public contactAction?: (proto.IContactAction|null); + + /** SyncActionValue muteAction. */ + public muteAction?: (proto.IMuteAction|null); + + /** SyncActionValue pinAction. */ + public pinAction?: (proto.IPinAction|null); + + /** SyncActionValue securityNotificationSetting. */ + public securityNotificationSetting?: (proto.ISecurityNotificationSetting|null); + + /** SyncActionValue pushNameSetting. */ + public pushNameSetting?: (proto.IPushNameSetting|null); + + /** SyncActionValue quickReplyAction. */ + public quickReplyAction?: (proto.IQuickReplyAction|null); + + /** SyncActionValue recentStickerWeightsAction. */ + public recentStickerWeightsAction?: (proto.IRecentStickerWeightsAction|null); + + /** SyncActionValue recentStickerMetadata. */ + public recentStickerMetadata?: (proto.IRecentStickerMetadata|null); + + /** SyncActionValue recentEmojiWeightsAction. */ + public recentEmojiWeightsAction?: (proto.IRecentEmojiWeightsAction|null); + + /** SyncActionValue labelEditAction. */ + public labelEditAction?: (proto.ILabelEditAction|null); + + /** SyncActionValue labelAssociationAction. */ + public labelAssociationAction?: (proto.ILabelAssociationAction|null); + + /** SyncActionValue localeSetting. */ + public localeSetting?: (proto.ILocaleSetting|null); + + /** SyncActionValue archiveChatAction. */ + public archiveChatAction?: (proto.IArchiveChatAction|null); + + /** SyncActionValue deleteMessageForMeAction. */ + public deleteMessageForMeAction?: (proto.IDeleteMessageForMeAction|null); + + /** SyncActionValue keyExpiration. */ + public keyExpiration?: (proto.IKeyExpiration|null); + + /** SyncActionValue markChatAsReadAction. */ + public markChatAsReadAction?: (proto.IMarkChatAsReadAction|null); + + /** SyncActionValue clearChatAction. */ + public clearChatAction?: (proto.IClearChatAction|null); + + /** SyncActionValue deleteChatAction. */ + public deleteChatAction?: (proto.IDeleteChatAction|null); - /** DisappearingMode initiator */ - initiator?: (proto.DisappearingMode.DisappearingModeInitiator|null); - } + /** SyncActionValue unarchiveChatsSetting. */ + public unarchiveChatsSetting?: (proto.IUnarchiveChatsSetting|null); - /** Represents a DisappearingMode. */ - class DisappearingMode implements IDisappearingMode { + /** SyncActionValue primaryFeature. */ + public primaryFeature?: (proto.IPrimaryFeature|null); - /** - * Constructs a new DisappearingMode. - * @param [properties] Properties to set - */ - constructor(properties?: proto.IDisappearingMode); + /** SyncActionValue favoriteStickerAction. */ + public favoriteStickerAction?: (proto.IFavoriteStickerAction|null); - /** DisappearingMode initiator. */ - public initiator: proto.DisappearingMode.DisappearingModeInitiator; + /** SyncActionValue androidUnsupportedActions. */ + public androidUnsupportedActions?: (proto.IAndroidUnsupportedActions|null); /** - * Creates a new DisappearingMode instance using the specified properties. + * Creates a new SyncActionValue instance using the specified properties. * @param [properties] Properties to set - * @returns DisappearingMode instance + * @returns SyncActionValue instance */ - public static create(properties?: proto.IDisappearingMode): proto.DisappearingMode; + public static create(properties?: proto.ISyncActionValue): proto.SyncActionValue; /** - * Encodes the specified DisappearingMode message. Does not implicitly {@link proto.DisappearingMode.verify|verify} messages. - * @param message DisappearingMode message or plain object to encode + * Encodes the specified SyncActionValue message. Does not implicitly {@link proto.SyncActionValue.verify|verify} messages. + * @param message SyncActionValue message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: proto.IDisappearingMode, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: proto.ISyncActionValue, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified DisappearingMode message, length delimited. Does not implicitly {@link proto.DisappearingMode.verify|verify} messages. - * @param message DisappearingMode message or plain object to encode + * Encodes the specified SyncActionValue message, length delimited. Does not implicitly {@link proto.SyncActionValue.verify|verify} messages. + * @param message SyncActionValue message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: proto.IDisappearingMode, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: proto.ISyncActionValue, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a DisappearingMode message from the specified reader or buffer. + * Decodes a SyncActionValue message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns DisappearingMode + * @returns SyncActionValue * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.DisappearingMode; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.SyncActionValue; /** - * Decodes a DisappearingMode message from the specified reader or buffer, length delimited. + * Decodes a SyncActionValue message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns DisappearingMode + * @returns SyncActionValue * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.DisappearingMode; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.SyncActionValue; /** - * Verifies a DisappearingMode message. + * Verifies a SyncActionValue message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a DisappearingMode message from a plain object. Also converts values to their respective internal types. + * Creates a SyncActionValue message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns DisappearingMode + * @returns SyncActionValue */ - public static fromObject(object: { [k: string]: any }): proto.DisappearingMode; + public static fromObject(object: { [k: string]: any }): proto.SyncActionValue; /** - * Creates a plain object from a DisappearingMode message. Also converts values to other types if specified. - * @param message DisappearingMode + * Creates a plain object from a SyncActionValue message. Also converts values to other types if specified. + * @param message SyncActionValue * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: proto.DisappearingMode, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: proto.SyncActionValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this DisappearingMode to JSON. + * Converts this SyncActionValue to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - namespace DisappearingMode { - - /** DisappearingModeInitiator enum. */ - enum DisappearingModeInitiator { - CHANGED_IN_CHAT = 0, - INITIATED_BY_ME = 1, - INITIATED_BY_OTHER = 2 - } - } - - /** Properties of a PBMediaData. */ - interface IPBMediaData { - - /** PBMediaData mediaKey */ - mediaKey?: (Uint8Array|null); - - /** PBMediaData mediaKeyTimestamp */ - mediaKeyTimestamp?: (number|Long|null); - - /** PBMediaData fileSha256 */ - fileSha256?: (Uint8Array|null); - - /** PBMediaData fileEncSha256 */ - fileEncSha256?: (Uint8Array|null); + /** Properties of an UnarchiveChatsSetting. */ + interface IUnarchiveChatsSetting { - /** PBMediaData directPath */ - directPath?: (string|null); + /** UnarchiveChatsSetting unarchiveChats */ + unarchiveChats?: (boolean|null); } - /** Represents a PBMediaData. */ - class PBMediaData implements IPBMediaData { + /** Represents an UnarchiveChatsSetting. */ + class UnarchiveChatsSetting implements IUnarchiveChatsSetting { /** - * Constructs a new PBMediaData. + * Constructs a new UnarchiveChatsSetting. * @param [properties] Properties to set */ - constructor(properties?: proto.IPBMediaData); - - /** PBMediaData mediaKey. */ - public mediaKey: Uint8Array; - - /** PBMediaData mediaKeyTimestamp. */ - public mediaKeyTimestamp: (number|Long); - - /** PBMediaData fileSha256. */ - public fileSha256: Uint8Array; - - /** PBMediaData fileEncSha256. */ - public fileEncSha256: Uint8Array; + constructor(properties?: proto.IUnarchiveChatsSetting); - /** PBMediaData directPath. */ - public directPath: string; + /** UnarchiveChatsSetting unarchiveChats. */ + public unarchiveChats: boolean; /** - * Creates a new PBMediaData instance using the specified properties. + * Creates a new UnarchiveChatsSetting instance using the specified properties. * @param [properties] Properties to set - * @returns PBMediaData instance + * @returns UnarchiveChatsSetting instance */ - public static create(properties?: proto.IPBMediaData): proto.PBMediaData; + public static create(properties?: proto.IUnarchiveChatsSetting): proto.UnarchiveChatsSetting; /** - * Encodes the specified PBMediaData message. Does not implicitly {@link proto.PBMediaData.verify|verify} messages. - * @param message PBMediaData message or plain object to encode + * Encodes the specified UnarchiveChatsSetting message. Does not implicitly {@link proto.UnarchiveChatsSetting.verify|verify} messages. + * @param message UnarchiveChatsSetting message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: proto.IPBMediaData, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: proto.IUnarchiveChatsSetting, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified PBMediaData message, length delimited. Does not implicitly {@link proto.PBMediaData.verify|verify} messages. - * @param message PBMediaData message or plain object to encode + * Encodes the specified UnarchiveChatsSetting message, length delimited. Does not implicitly {@link proto.UnarchiveChatsSetting.verify|verify} messages. + * @param message UnarchiveChatsSetting message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: proto.IPBMediaData, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: proto.IUnarchiveChatsSetting, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a PBMediaData message from the specified reader or buffer. + * Decodes an UnarchiveChatsSetting message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns PBMediaData + * @returns UnarchiveChatsSetting * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.PBMediaData; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.UnarchiveChatsSetting; /** - * Decodes a PBMediaData message from the specified reader or buffer, length delimited. + * Decodes an UnarchiveChatsSetting message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns PBMediaData + * @returns UnarchiveChatsSetting * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.PBMediaData; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.UnarchiveChatsSetting; /** - * Verifies a PBMediaData message. + * Verifies an UnarchiveChatsSetting message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a PBMediaData message from a plain object. Also converts values to their respective internal types. + * Creates an UnarchiveChatsSetting message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns PBMediaData + * @returns UnarchiveChatsSetting */ - public static fromObject(object: { [k: string]: any }): proto.PBMediaData; + public static fromObject(object: { [k: string]: any }): proto.UnarchiveChatsSetting; /** - * Creates a plain object from a PBMediaData message. Also converts values to other types if specified. - * @param message PBMediaData + * Creates a plain object from an UnarchiveChatsSetting message. Also converts values to other types if specified. + * @param message UnarchiveChatsSetting * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: proto.PBMediaData, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: proto.UnarchiveChatsSetting, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this PBMediaData to JSON. + * Converts this UnarchiveChatsSetting to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a PaymentBackground. */ - interface IPaymentBackground { - - /** PaymentBackground id */ - id?: (string|null); - - /** PaymentBackground fileLength */ - fileLength?: (number|Long|null); - - /** PaymentBackground width */ - width?: (number|null); - - /** PaymentBackground height */ - height?: (number|null); - - /** PaymentBackground mimetype */ - mimetype?: (string|null); + /** Properties of a BizAccountLinkInfo. */ + interface IBizAccountLinkInfo { - /** PaymentBackground placeholderArgb */ - placeholderArgb?: (number|null); + /** BizAccountLinkInfo whatsappBizAcctFbid */ + whatsappBizAcctFbid?: (number|Long|null); - /** PaymentBackground textArgb */ - textArgb?: (number|null); + /** BizAccountLinkInfo whatsappAcctNumber */ + whatsappAcctNumber?: (string|null); - /** PaymentBackground subtextArgb */ - subtextArgb?: (number|null); + /** BizAccountLinkInfo issueTime */ + issueTime?: (number|Long|null); - /** PaymentBackground mediaData */ - mediaData?: (proto.IPBMediaData|null); + /** BizAccountLinkInfo hostStorage */ + hostStorage?: (proto.BizAccountLinkInfo.BizAccountLinkInfoHostStorageType|null); - /** PaymentBackground type */ - type?: (proto.PaymentBackground.PaymentBackgroundType|null); + /** BizAccountLinkInfo accountType */ + accountType?: (proto.BizAccountLinkInfo.BizAccountLinkInfoAccountType|null); } - /** Represents a PaymentBackground. */ - class PaymentBackground implements IPaymentBackground { + /** Represents a BizAccountLinkInfo. */ + class BizAccountLinkInfo implements IBizAccountLinkInfo { /** - * Constructs a new PaymentBackground. + * Constructs a new BizAccountLinkInfo. * @param [properties] Properties to set */ - constructor(properties?: proto.IPaymentBackground); - - /** PaymentBackground id. */ - public id: string; - - /** PaymentBackground fileLength. */ - public fileLength: (number|Long); - - /** PaymentBackground width. */ - public width: number; - - /** PaymentBackground height. */ - public height: number; - - /** PaymentBackground mimetype. */ - public mimetype: string; + constructor(properties?: proto.IBizAccountLinkInfo); - /** PaymentBackground placeholderArgb. */ - public placeholderArgb: number; + /** BizAccountLinkInfo whatsappBizAcctFbid. */ + public whatsappBizAcctFbid: (number|Long); - /** PaymentBackground textArgb. */ - public textArgb: number; + /** BizAccountLinkInfo whatsappAcctNumber. */ + public whatsappAcctNumber: string; - /** PaymentBackground subtextArgb. */ - public subtextArgb: number; + /** BizAccountLinkInfo issueTime. */ + public issueTime: (number|Long); - /** PaymentBackground mediaData. */ - public mediaData?: (proto.IPBMediaData|null); + /** BizAccountLinkInfo hostStorage. */ + public hostStorage: proto.BizAccountLinkInfo.BizAccountLinkInfoHostStorageType; - /** PaymentBackground type. */ - public type: proto.PaymentBackground.PaymentBackgroundType; + /** BizAccountLinkInfo accountType. */ + public accountType: proto.BizAccountLinkInfo.BizAccountLinkInfoAccountType; /** - * Creates a new PaymentBackground instance using the specified properties. + * Creates a new BizAccountLinkInfo instance using the specified properties. * @param [properties] Properties to set - * @returns PaymentBackground instance + * @returns BizAccountLinkInfo instance */ - public static create(properties?: proto.IPaymentBackground): proto.PaymentBackground; + public static create(properties?: proto.IBizAccountLinkInfo): proto.BizAccountLinkInfo; /** - * Encodes the specified PaymentBackground message. Does not implicitly {@link proto.PaymentBackground.verify|verify} messages. - * @param message PaymentBackground message or plain object to encode + * Encodes the specified BizAccountLinkInfo message. Does not implicitly {@link proto.BizAccountLinkInfo.verify|verify} messages. + * @param message BizAccountLinkInfo message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: proto.IPaymentBackground, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: proto.IBizAccountLinkInfo, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified PaymentBackground message, length delimited. Does not implicitly {@link proto.PaymentBackground.verify|verify} messages. - * @param message PaymentBackground message or plain object to encode + * Encodes the specified BizAccountLinkInfo message, length delimited. Does not implicitly {@link proto.BizAccountLinkInfo.verify|verify} messages. + * @param message BizAccountLinkInfo message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: proto.IPaymentBackground, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: proto.IBizAccountLinkInfo, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a PaymentBackground message from the specified reader or buffer. + * Decodes a BizAccountLinkInfo message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns PaymentBackground + * @returns BizAccountLinkInfo * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.PaymentBackground; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.BizAccountLinkInfo; /** - * Decodes a PaymentBackground message from the specified reader or buffer, length delimited. + * Decodes a BizAccountLinkInfo message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns PaymentBackground + * @returns BizAccountLinkInfo * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.PaymentBackground; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.BizAccountLinkInfo; /** - * Verifies a PaymentBackground message. + * Verifies a BizAccountLinkInfo message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a PaymentBackground message from a plain object. Also converts values to their respective internal types. + * Creates a BizAccountLinkInfo message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns PaymentBackground + * @returns BizAccountLinkInfo */ - public static fromObject(object: { [k: string]: any }): proto.PaymentBackground; + public static fromObject(object: { [k: string]: any }): proto.BizAccountLinkInfo; /** - * Creates a plain object from a PaymentBackground message. Also converts values to other types if specified. - * @param message PaymentBackground + * Creates a plain object from a BizAccountLinkInfo message. Also converts values to other types if specified. + * @param message BizAccountLinkInfo * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: proto.PaymentBackground, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: proto.BizAccountLinkInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this PaymentBackground to JSON. + * Converts this BizAccountLinkInfo to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - namespace PaymentBackground { + namespace BizAccountLinkInfo { - /** PaymentBackgroundType enum. */ - enum PaymentBackgroundType { - UNKNOWN = 0, - DEFAULT = 1 + /** BizAccountLinkInfoHostStorageType enum. */ + enum BizAccountLinkInfoHostStorageType { + ON_PREMISE = 0, + FACEBOOK = 1 } - } - /** Properties of a Money. */ - interface IMoney { + /** BizAccountLinkInfoAccountType enum. */ + enum BizAccountLinkInfoAccountType { + ENTERPRISE = 0 + } + } - /** Money value */ - value?: (number|Long|null); + /** Properties of a BizAccountPayload. */ + interface IBizAccountPayload { - /** Money offset */ - offset?: (number|null); + /** BizAccountPayload vnameCert */ + vnameCert?: (proto.IVerifiedNameCertificate|null); - /** Money currencyCode */ - currencyCode?: (string|null); + /** BizAccountPayload bizAcctLinkInfo */ + bizAcctLinkInfo?: (Uint8Array|null); } - /** Represents a Money. */ - class Money implements IMoney { + /** Represents a BizAccountPayload. */ + class BizAccountPayload implements IBizAccountPayload { /** - * Constructs a new Money. + * Constructs a new BizAccountPayload. * @param [properties] Properties to set */ - constructor(properties?: proto.IMoney); - - /** Money value. */ - public value: (number|Long); + constructor(properties?: proto.IBizAccountPayload); - /** Money offset. */ - public offset: number; + /** BizAccountPayload vnameCert. */ + public vnameCert?: (proto.IVerifiedNameCertificate|null); - /** Money currencyCode. */ - public currencyCode: string; + /** BizAccountPayload bizAcctLinkInfo. */ + public bizAcctLinkInfo: Uint8Array; /** - * Creates a new Money instance using the specified properties. + * Creates a new BizAccountPayload instance using the specified properties. * @param [properties] Properties to set - * @returns Money instance + * @returns BizAccountPayload instance */ - public static create(properties?: proto.IMoney): proto.Money; + public static create(properties?: proto.IBizAccountPayload): proto.BizAccountPayload; /** - * Encodes the specified Money message. Does not implicitly {@link proto.Money.verify|verify} messages. - * @param message Money message or plain object to encode + * Encodes the specified BizAccountPayload message. Does not implicitly {@link proto.BizAccountPayload.verify|verify} messages. + * @param message BizAccountPayload message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: proto.IMoney, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: proto.IBizAccountPayload, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified Money message, length delimited. Does not implicitly {@link proto.Money.verify|verify} messages. - * @param message Money message or plain object to encode + * Encodes the specified BizAccountPayload message, length delimited. Does not implicitly {@link proto.BizAccountPayload.verify|verify} messages. + * @param message BizAccountPayload message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: proto.IMoney, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: proto.IBizAccountPayload, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a Money message from the specified reader or buffer. + * Decodes a BizAccountPayload message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns Money + * @returns BizAccountPayload * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.Money; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.BizAccountPayload; /** - * Decodes a Money message from the specified reader or buffer, length delimited. + * Decodes a BizAccountPayload message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Money + * @returns BizAccountPayload * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.Money; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.BizAccountPayload; /** - * Verifies a Money message. + * Verifies a BizAccountPayload message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a Money message from a plain object. Also converts values to their respective internal types. + * Creates a BizAccountPayload message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Money + * @returns BizAccountPayload */ - public static fromObject(object: { [k: string]: any }): proto.Money; + public static fromObject(object: { [k: string]: any }): proto.BizAccountPayload; /** - * Creates a plain object from a Money message. Also converts values to other types if specified. - * @param message Money + * Creates a plain object from a BizAccountPayload message. Also converts values to other types if specified. + * @param message BizAccountPayload * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: proto.Money, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: proto.BizAccountPayload, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Money to JSON. + * Converts this BizAccountPayload to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a HydratedQuickReplyButton. */ - interface IHydratedQuickReplyButton { + /** Properties of a BizIdentityInfo. */ + interface IBizIdentityInfo { - /** HydratedQuickReplyButton displayText */ - displayText?: (string|null); + /** BizIdentityInfo vlevel */ + vlevel?: (proto.BizIdentityInfo.BizIdentityInfoVerifiedLevelValue|null); - /** HydratedQuickReplyButton id */ - id?: (string|null); + /** BizIdentityInfo vnameCert */ + vnameCert?: (proto.IVerifiedNameCertificate|null); + + /** BizIdentityInfo signed */ + signed?: (boolean|null); + + /** BizIdentityInfo revoked */ + revoked?: (boolean|null); + + /** BizIdentityInfo hostStorage */ + hostStorage?: (proto.BizIdentityInfo.BizIdentityInfoHostStorageType|null); + + /** BizIdentityInfo actualActors */ + actualActors?: (proto.BizIdentityInfo.BizIdentityInfoActualActorsType|null); + + /** BizIdentityInfo privacyModeTs */ + privacyModeTs?: (number|Long|null); + + /** BizIdentityInfo featureControls */ + featureControls?: (number|Long|null); } - /** Represents a HydratedQuickReplyButton. */ - class HydratedQuickReplyButton implements IHydratedQuickReplyButton { + /** Represents a BizIdentityInfo. */ + class BizIdentityInfo implements IBizIdentityInfo { /** - * Constructs a new HydratedQuickReplyButton. + * Constructs a new BizIdentityInfo. * @param [properties] Properties to set */ - constructor(properties?: proto.IHydratedQuickReplyButton); + constructor(properties?: proto.IBizIdentityInfo); - /** HydratedQuickReplyButton displayText. */ - public displayText: string; + /** BizIdentityInfo vlevel. */ + public vlevel: proto.BizIdentityInfo.BizIdentityInfoVerifiedLevelValue; - /** HydratedQuickReplyButton id. */ - public id: string; + /** BizIdentityInfo vnameCert. */ + public vnameCert?: (proto.IVerifiedNameCertificate|null); + + /** BizIdentityInfo signed. */ + public signed: boolean; + + /** BizIdentityInfo revoked. */ + public revoked: boolean; + + /** BizIdentityInfo hostStorage. */ + public hostStorage: proto.BizIdentityInfo.BizIdentityInfoHostStorageType; + + /** BizIdentityInfo actualActors. */ + public actualActors: proto.BizIdentityInfo.BizIdentityInfoActualActorsType; + + /** BizIdentityInfo privacyModeTs. */ + public privacyModeTs: (number|Long); + + /** BizIdentityInfo featureControls. */ + public featureControls: (number|Long); /** - * Creates a new HydratedQuickReplyButton instance using the specified properties. + * Creates a new BizIdentityInfo instance using the specified properties. * @param [properties] Properties to set - * @returns HydratedQuickReplyButton instance + * @returns BizIdentityInfo instance */ - public static create(properties?: proto.IHydratedQuickReplyButton): proto.HydratedQuickReplyButton; + public static create(properties?: proto.IBizIdentityInfo): proto.BizIdentityInfo; /** - * Encodes the specified HydratedQuickReplyButton message. Does not implicitly {@link proto.HydratedQuickReplyButton.verify|verify} messages. - * @param message HydratedQuickReplyButton message or plain object to encode + * Encodes the specified BizIdentityInfo message. Does not implicitly {@link proto.BizIdentityInfo.verify|verify} messages. + * @param message BizIdentityInfo message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: proto.IHydratedQuickReplyButton, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: proto.IBizIdentityInfo, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified HydratedQuickReplyButton message, length delimited. Does not implicitly {@link proto.HydratedQuickReplyButton.verify|verify} messages. - * @param message HydratedQuickReplyButton message or plain object to encode + * Encodes the specified BizIdentityInfo message, length delimited. Does not implicitly {@link proto.BizIdentityInfo.verify|verify} messages. + * @param message BizIdentityInfo message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: proto.IHydratedQuickReplyButton, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: proto.IBizIdentityInfo, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a HydratedQuickReplyButton message from the specified reader or buffer. + * Decodes a BizIdentityInfo message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns HydratedQuickReplyButton + * @returns BizIdentityInfo * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.HydratedQuickReplyButton; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.BizIdentityInfo; /** - * Decodes a HydratedQuickReplyButton message from the specified reader or buffer, length delimited. + * Decodes a BizIdentityInfo message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns HydratedQuickReplyButton + * @returns BizIdentityInfo * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.HydratedQuickReplyButton; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.BizIdentityInfo; /** - * Verifies a HydratedQuickReplyButton message. + * Verifies a BizIdentityInfo message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a HydratedQuickReplyButton message from a plain object. Also converts values to their respective internal types. + * Creates a BizIdentityInfo message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns HydratedQuickReplyButton + * @returns BizIdentityInfo */ - public static fromObject(object: { [k: string]: any }): proto.HydratedQuickReplyButton; + public static fromObject(object: { [k: string]: any }): proto.BizIdentityInfo; /** - * Creates a plain object from a HydratedQuickReplyButton message. Also converts values to other types if specified. - * @param message HydratedQuickReplyButton + * Creates a plain object from a BizIdentityInfo message. Also converts values to other types if specified. + * @param message BizIdentityInfo * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: proto.HydratedQuickReplyButton, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: proto.BizIdentityInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BizIdentityInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace BizIdentityInfo { + + /** BizIdentityInfoVerifiedLevelValue enum. */ + enum BizIdentityInfoVerifiedLevelValue { + UNKNOWN = 0, + LOW = 1, + HIGH = 2 + } - /** - * Converts this HydratedQuickReplyButton to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** BizIdentityInfoHostStorageType enum. */ + enum BizIdentityInfoHostStorageType { + ON_PREMISE = 0, + FACEBOOK = 1 + } + + /** BizIdentityInfoActualActorsType enum. */ + enum BizIdentityInfoActualActorsType { + SELF = 0, + BSP = 1 + } } - /** Properties of a HydratedURLButton. */ - interface IHydratedURLButton { + /** Properties of a LocalizedName. */ + interface ILocalizedName { - /** HydratedURLButton displayText */ - displayText?: (string|null); + /** LocalizedName lg */ + lg?: (string|null); - /** HydratedURLButton url */ - url?: (string|null); + /** LocalizedName lc */ + lc?: (string|null); + + /** LocalizedName verifiedName */ + verifiedName?: (string|null); } - /** Represents a HydratedURLButton. */ - class HydratedURLButton implements IHydratedURLButton { + /** Represents a LocalizedName. */ + class LocalizedName implements ILocalizedName { /** - * Constructs a new HydratedURLButton. + * Constructs a new LocalizedName. * @param [properties] Properties to set */ - constructor(properties?: proto.IHydratedURLButton); + constructor(properties?: proto.ILocalizedName); - /** HydratedURLButton displayText. */ - public displayText: string; + /** LocalizedName lg. */ + public lg: string; - /** HydratedURLButton url. */ - public url: string; + /** LocalizedName lc. */ + public lc: string; + + /** LocalizedName verifiedName. */ + public verifiedName: string; /** - * Creates a new HydratedURLButton instance using the specified properties. + * Creates a new LocalizedName instance using the specified properties. * @param [properties] Properties to set - * @returns HydratedURLButton instance + * @returns LocalizedName instance */ - public static create(properties?: proto.IHydratedURLButton): proto.HydratedURLButton; + public static create(properties?: proto.ILocalizedName): proto.LocalizedName; /** - * Encodes the specified HydratedURLButton message. Does not implicitly {@link proto.HydratedURLButton.verify|verify} messages. - * @param message HydratedURLButton message or plain object to encode + * Encodes the specified LocalizedName message. Does not implicitly {@link proto.LocalizedName.verify|verify} messages. + * @param message LocalizedName message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: proto.IHydratedURLButton, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: proto.ILocalizedName, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified HydratedURLButton message, length delimited. Does not implicitly {@link proto.HydratedURLButton.verify|verify} messages. - * @param message HydratedURLButton message or plain object to encode + * Encodes the specified LocalizedName message, length delimited. Does not implicitly {@link proto.LocalizedName.verify|verify} messages. + * @param message LocalizedName message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: proto.IHydratedURLButton, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: proto.ILocalizedName, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a HydratedURLButton message from the specified reader or buffer. + * Decodes a LocalizedName message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns HydratedURLButton + * @returns LocalizedName * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.HydratedURLButton; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.LocalizedName; /** - * Decodes a HydratedURLButton message from the specified reader or buffer, length delimited. + * Decodes a LocalizedName message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns HydratedURLButton + * @returns LocalizedName * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.HydratedURLButton; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.LocalizedName; /** - * Verifies a HydratedURLButton message. + * Verifies a LocalizedName message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a HydratedURLButton message from a plain object. Also converts values to their respective internal types. + * Creates a LocalizedName message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns HydratedURLButton + * @returns LocalizedName */ - public static fromObject(object: { [k: string]: any }): proto.HydratedURLButton; + public static fromObject(object: { [k: string]: any }): proto.LocalizedName; /** - * Creates a plain object from a HydratedURLButton message. Also converts values to other types if specified. - * @param message HydratedURLButton + * Creates a plain object from a LocalizedName message. Also converts values to other types if specified. + * @param message LocalizedName * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: proto.HydratedURLButton, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: proto.LocalizedName, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this HydratedURLButton to JSON. + * Converts this LocalizedName to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a HydratedCallButton. */ - interface IHydratedCallButton { + /** Properties of a VerifiedNameCertificate. */ + interface IVerifiedNameCertificate { - /** HydratedCallButton displayText */ - displayText?: (string|null); + /** VerifiedNameCertificate details */ + details?: (Uint8Array|null); - /** HydratedCallButton phoneNumber */ - phoneNumber?: (string|null); + /** VerifiedNameCertificate signature */ + signature?: (Uint8Array|null); + + /** VerifiedNameCertificate serverSignature */ + serverSignature?: (Uint8Array|null); } - /** Represents a HydratedCallButton. */ - class HydratedCallButton implements IHydratedCallButton { + /** Represents a VerifiedNameCertificate. */ + class VerifiedNameCertificate implements IVerifiedNameCertificate { /** - * Constructs a new HydratedCallButton. + * Constructs a new VerifiedNameCertificate. * @param [properties] Properties to set */ - constructor(properties?: proto.IHydratedCallButton); + constructor(properties?: proto.IVerifiedNameCertificate); - /** HydratedCallButton displayText. */ - public displayText: string; + /** VerifiedNameCertificate details. */ + public details: Uint8Array; - /** HydratedCallButton phoneNumber. */ - public phoneNumber: string; + /** VerifiedNameCertificate signature. */ + public signature: Uint8Array; + + /** VerifiedNameCertificate serverSignature. */ + public serverSignature: Uint8Array; /** - * Creates a new HydratedCallButton instance using the specified properties. + * Creates a new VerifiedNameCertificate instance using the specified properties. * @param [properties] Properties to set - * @returns HydratedCallButton instance + * @returns VerifiedNameCertificate instance */ - public static create(properties?: proto.IHydratedCallButton): proto.HydratedCallButton; + public static create(properties?: proto.IVerifiedNameCertificate): proto.VerifiedNameCertificate; /** - * Encodes the specified HydratedCallButton message. Does not implicitly {@link proto.HydratedCallButton.verify|verify} messages. - * @param message HydratedCallButton message or plain object to encode + * Encodes the specified VerifiedNameCertificate message. Does not implicitly {@link proto.VerifiedNameCertificate.verify|verify} messages. + * @param message VerifiedNameCertificate message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: proto.IHydratedCallButton, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: proto.IVerifiedNameCertificate, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified HydratedCallButton message, length delimited. Does not implicitly {@link proto.HydratedCallButton.verify|verify} messages. - * @param message HydratedCallButton message or plain object to encode + * Encodes the specified VerifiedNameCertificate message, length delimited. Does not implicitly {@link proto.VerifiedNameCertificate.verify|verify} messages. + * @param message VerifiedNameCertificate message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: proto.IHydratedCallButton, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: proto.IVerifiedNameCertificate, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a HydratedCallButton message from the specified reader or buffer. + * Decodes a VerifiedNameCertificate message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns HydratedCallButton + * @returns VerifiedNameCertificate * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.HydratedCallButton; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.VerifiedNameCertificate; /** - * Decodes a HydratedCallButton message from the specified reader or buffer, length delimited. + * Decodes a VerifiedNameCertificate message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns HydratedCallButton + * @returns VerifiedNameCertificate * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.HydratedCallButton; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.VerifiedNameCertificate; /** - * Verifies a HydratedCallButton message. + * Verifies a VerifiedNameCertificate message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a HydratedCallButton message from a plain object. Also converts values to their respective internal types. + * Creates a VerifiedNameCertificate message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns HydratedCallButton + * @returns VerifiedNameCertificate */ - public static fromObject(object: { [k: string]: any }): proto.HydratedCallButton; + public static fromObject(object: { [k: string]: any }): proto.VerifiedNameCertificate; /** - * Creates a plain object from a HydratedCallButton message. Also converts values to other types if specified. - * @param message HydratedCallButton + * Creates a plain object from a VerifiedNameCertificate message. Also converts values to other types if specified. + * @param message VerifiedNameCertificate * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: proto.HydratedCallButton, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: proto.VerifiedNameCertificate, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this HydratedCallButton to JSON. + * Converts this VerifiedNameCertificate to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a HydratedTemplateButton. */ - interface IHydratedTemplateButton { + /** Properties of a VerifiedNameDetails. */ + interface IVerifiedNameDetails { - /** HydratedTemplateButton index */ - index?: (number|null); + /** VerifiedNameDetails serial */ + serial?: (number|Long|null); - /** HydratedTemplateButton quickReplyButton */ - quickReplyButton?: (proto.IHydratedQuickReplyButton|null); + /** VerifiedNameDetails issuer */ + issuer?: (string|null); - /** HydratedTemplateButton urlButton */ - urlButton?: (proto.IHydratedURLButton|null); + /** VerifiedNameDetails verifiedName */ + verifiedName?: (string|null); - /** HydratedTemplateButton callButton */ - callButton?: (proto.IHydratedCallButton|null); + /** VerifiedNameDetails localizedNames */ + localizedNames?: (proto.ILocalizedName[]|null); + + /** VerifiedNameDetails issueTime */ + issueTime?: (number|Long|null); } - /** Represents a HydratedTemplateButton. */ - class HydratedTemplateButton implements IHydratedTemplateButton { + /** Represents a VerifiedNameDetails. */ + class VerifiedNameDetails implements IVerifiedNameDetails { /** - * Constructs a new HydratedTemplateButton. + * Constructs a new VerifiedNameDetails. * @param [properties] Properties to set */ - constructor(properties?: proto.IHydratedTemplateButton); + constructor(properties?: proto.IVerifiedNameDetails); - /** HydratedTemplateButton index. */ - public index: number; + /** VerifiedNameDetails serial. */ + public serial: (number|Long); - /** HydratedTemplateButton quickReplyButton. */ - public quickReplyButton?: (proto.IHydratedQuickReplyButton|null); + /** VerifiedNameDetails issuer. */ + public issuer: string; - /** HydratedTemplateButton urlButton. */ - public urlButton?: (proto.IHydratedURLButton|null); + /** VerifiedNameDetails verifiedName. */ + public verifiedName: string; - /** HydratedTemplateButton callButton. */ - public callButton?: (proto.IHydratedCallButton|null); + /** VerifiedNameDetails localizedNames. */ + public localizedNames: proto.ILocalizedName[]; - /** HydratedTemplateButton hydratedButton. */ - public hydratedButton?: ("quickReplyButton"|"urlButton"|"callButton"); + /** VerifiedNameDetails issueTime. */ + public issueTime: (number|Long); /** - * Creates a new HydratedTemplateButton instance using the specified properties. + * Creates a new VerifiedNameDetails instance using the specified properties. * @param [properties] Properties to set - * @returns HydratedTemplateButton instance + * @returns VerifiedNameDetails instance */ - public static create(properties?: proto.IHydratedTemplateButton): proto.HydratedTemplateButton; + public static create(properties?: proto.IVerifiedNameDetails): proto.VerifiedNameDetails; /** - * Encodes the specified HydratedTemplateButton message. Does not implicitly {@link proto.HydratedTemplateButton.verify|verify} messages. - * @param message HydratedTemplateButton message or plain object to encode + * Encodes the specified VerifiedNameDetails message. Does not implicitly {@link proto.VerifiedNameDetails.verify|verify} messages. + * @param message VerifiedNameDetails message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: proto.IHydratedTemplateButton, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: proto.IVerifiedNameDetails, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified HydratedTemplateButton message, length delimited. Does not implicitly {@link proto.HydratedTemplateButton.verify|verify} messages. - * @param message HydratedTemplateButton message or plain object to encode + * Encodes the specified VerifiedNameDetails message, length delimited. Does not implicitly {@link proto.VerifiedNameDetails.verify|verify} messages. + * @param message VerifiedNameDetails message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: proto.IHydratedTemplateButton, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: proto.IVerifiedNameDetails, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a HydratedTemplateButton message from the specified reader or buffer. + * Decodes a VerifiedNameDetails message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns HydratedTemplateButton + * @returns VerifiedNameDetails * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.HydratedTemplateButton; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.VerifiedNameDetails; /** - * Decodes a HydratedTemplateButton message from the specified reader or buffer, length delimited. + * Decodes a VerifiedNameDetails message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns HydratedTemplateButton + * @returns VerifiedNameDetails * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.HydratedTemplateButton; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.VerifiedNameDetails; /** - * Verifies a HydratedTemplateButton message. + * Verifies a VerifiedNameDetails message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a HydratedTemplateButton message from a plain object. Also converts values to their respective internal types. + * Creates a VerifiedNameDetails message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns HydratedTemplateButton + * @returns VerifiedNameDetails */ - public static fromObject(object: { [k: string]: any }): proto.HydratedTemplateButton; + public static fromObject(object: { [k: string]: any }): proto.VerifiedNameDetails; /** - * Creates a plain object from a HydratedTemplateButton message. Also converts values to other types if specified. - * @param message HydratedTemplateButton + * Creates a plain object from a VerifiedNameDetails message. Also converts values to other types if specified. + * @param message VerifiedNameDetails * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: proto.HydratedTemplateButton, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: proto.VerifiedNameDetails, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this HydratedTemplateButton to JSON. + * Converts this VerifiedNameDetails to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a QuickReplyButton. */ - interface IQuickReplyButton { + /** Properties of a ClientFinish. */ + interface IClientFinish { - /** QuickReplyButton displayText */ - displayText?: (proto.IHighlyStructuredMessage|null); + /** ClientFinish static */ + "static"?: (Uint8Array|null); - /** QuickReplyButton id */ - id?: (string|null); + /** ClientFinish payload */ + payload?: (Uint8Array|null); } - /** Represents a QuickReplyButton. */ - class QuickReplyButton implements IQuickReplyButton { + /** Represents a ClientFinish. */ + class ClientFinish implements IClientFinish { /** - * Constructs a new QuickReplyButton. + * Constructs a new ClientFinish. * @param [properties] Properties to set */ - constructor(properties?: proto.IQuickReplyButton); + constructor(properties?: proto.IClientFinish); - /** QuickReplyButton displayText. */ - public displayText?: (proto.IHighlyStructuredMessage|null); + /** ClientFinish static. */ + public static: Uint8Array; - /** QuickReplyButton id. */ - public id: string; + /** ClientFinish payload. */ + public payload: Uint8Array; /** - * Creates a new QuickReplyButton instance using the specified properties. + * Creates a new ClientFinish instance using the specified properties. * @param [properties] Properties to set - * @returns QuickReplyButton instance + * @returns ClientFinish instance */ - public static create(properties?: proto.IQuickReplyButton): proto.QuickReplyButton; + public static create(properties?: proto.IClientFinish): proto.ClientFinish; /** - * Encodes the specified QuickReplyButton message. Does not implicitly {@link proto.QuickReplyButton.verify|verify} messages. - * @param message QuickReplyButton message or plain object to encode + * Encodes the specified ClientFinish message. Does not implicitly {@link proto.ClientFinish.verify|verify} messages. + * @param message ClientFinish message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: proto.IQuickReplyButton, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: proto.IClientFinish, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified QuickReplyButton message, length delimited. Does not implicitly {@link proto.QuickReplyButton.verify|verify} messages. - * @param message QuickReplyButton message or plain object to encode + * Encodes the specified ClientFinish message, length delimited. Does not implicitly {@link proto.ClientFinish.verify|verify} messages. + * @param message ClientFinish message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: proto.IQuickReplyButton, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: proto.IClientFinish, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a QuickReplyButton message from the specified reader or buffer. + * Decodes a ClientFinish message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns QuickReplyButton + * @returns ClientFinish * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.QuickReplyButton; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.ClientFinish; /** - * Decodes a QuickReplyButton message from the specified reader or buffer, length delimited. + * Decodes a ClientFinish message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns QuickReplyButton + * @returns ClientFinish * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.QuickReplyButton; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.ClientFinish; /** - * Verifies a QuickReplyButton message. + * Verifies a ClientFinish message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a QuickReplyButton message from a plain object. Also converts values to their respective internal types. + * Creates a ClientFinish message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns QuickReplyButton + * @returns ClientFinish */ - public static fromObject(object: { [k: string]: any }): proto.QuickReplyButton; + public static fromObject(object: { [k: string]: any }): proto.ClientFinish; /** - * Creates a plain object from a QuickReplyButton message. Also converts values to other types if specified. - * @param message QuickReplyButton + * Creates a plain object from a ClientFinish message. Also converts values to other types if specified. + * @param message ClientFinish * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: proto.QuickReplyButton, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: proto.ClientFinish, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this QuickReplyButton to JSON. + * Converts this ClientFinish to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a URLButton. */ - interface IURLButton { + /** Properties of a ClientHello. */ + interface IClientHello { - /** URLButton displayText */ - displayText?: (proto.IHighlyStructuredMessage|null); + /** ClientHello ephemeral */ + ephemeral?: (Uint8Array|null); - /** URLButton url */ - url?: (proto.IHighlyStructuredMessage|null); + /** ClientHello static */ + "static"?: (Uint8Array|null); + + /** ClientHello payload */ + payload?: (Uint8Array|null); } - /** Represents a URLButton. */ - class URLButton implements IURLButton { + /** Represents a ClientHello. */ + class ClientHello implements IClientHello { /** - * Constructs a new URLButton. + * Constructs a new ClientHello. * @param [properties] Properties to set */ - constructor(properties?: proto.IURLButton); + constructor(properties?: proto.IClientHello); - /** URLButton displayText. */ - public displayText?: (proto.IHighlyStructuredMessage|null); + /** ClientHello ephemeral. */ + public ephemeral: Uint8Array; - /** URLButton url. */ - public url?: (proto.IHighlyStructuredMessage|null); + /** ClientHello static. */ + public static: Uint8Array; + + /** ClientHello payload. */ + public payload: Uint8Array; /** - * Creates a new URLButton instance using the specified properties. + * Creates a new ClientHello instance using the specified properties. * @param [properties] Properties to set - * @returns URLButton instance + * @returns ClientHello instance */ - public static create(properties?: proto.IURLButton): proto.URLButton; + public static create(properties?: proto.IClientHello): proto.ClientHello; /** - * Encodes the specified URLButton message. Does not implicitly {@link proto.URLButton.verify|verify} messages. - * @param message URLButton message or plain object to encode + * Encodes the specified ClientHello message. Does not implicitly {@link proto.ClientHello.verify|verify} messages. + * @param message ClientHello message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: proto.IURLButton, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: proto.IClientHello, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified URLButton message, length delimited. Does not implicitly {@link proto.URLButton.verify|verify} messages. - * @param message URLButton message or plain object to encode + * Encodes the specified ClientHello message, length delimited. Does not implicitly {@link proto.ClientHello.verify|verify} messages. + * @param message ClientHello message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: proto.IURLButton, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: proto.IClientHello, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a URLButton message from the specified reader or buffer. + * Decodes a ClientHello message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns URLButton + * @returns ClientHello * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.URLButton; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.ClientHello; /** - * Decodes a URLButton message from the specified reader or buffer, length delimited. + * Decodes a ClientHello message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns URLButton + * @returns ClientHello * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.URLButton; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.ClientHello; /** - * Verifies a URLButton message. + * Verifies a ClientHello message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a URLButton message from a plain object. Also converts values to their respective internal types. + * Creates a ClientHello message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns URLButton + * @returns ClientHello */ - public static fromObject(object: { [k: string]: any }): proto.URLButton; + public static fromObject(object: { [k: string]: any }): proto.ClientHello; /** - * Creates a plain object from a URLButton message. Also converts values to other types if specified. - * @param message URLButton + * Creates a plain object from a ClientHello message. Also converts values to other types if specified. + * @param message ClientHello * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: proto.URLButton, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: proto.ClientHello, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this URLButton to JSON. + * Converts this ClientHello to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a CallButton. */ - interface ICallButton { + /** Properties of a ClientPayload. */ + interface IClientPayload { - /** CallButton displayText */ - displayText?: (proto.IHighlyStructuredMessage|null); + /** ClientPayload username */ + username?: (number|Long|null); - /** CallButton phoneNumber */ - phoneNumber?: (proto.IHighlyStructuredMessage|null); - } + /** ClientPayload passive */ + passive?: (boolean|null); - /** Represents a CallButton. */ - class CallButton implements ICallButton { + /** ClientPayload userAgent */ + userAgent?: (proto.IUserAgent|null); - /** - * Constructs a new CallButton. - * @param [properties] Properties to set - */ - constructor(properties?: proto.ICallButton); + /** ClientPayload webInfo */ + webInfo?: (proto.IWebInfo|null); - /** CallButton displayText. */ - public displayText?: (proto.IHighlyStructuredMessage|null); + /** ClientPayload pushName */ + pushName?: (string|null); - /** CallButton phoneNumber. */ - public phoneNumber?: (proto.IHighlyStructuredMessage|null); + /** ClientPayload sessionId */ + sessionId?: (number|null); + + /** ClientPayload shortConnect */ + shortConnect?: (boolean|null); + + /** ClientPayload connectType */ + connectType?: (proto.ClientPayload.ClientPayloadConnectType|null); + + /** ClientPayload connectReason */ + connectReason?: (proto.ClientPayload.ClientPayloadConnectReason|null); + + /** ClientPayload shards */ + shards?: (number[]|null); + + /** ClientPayload dnsSource */ + dnsSource?: (proto.IDNSSource|null); + + /** ClientPayload connectAttemptCount */ + connectAttemptCount?: (number|null); + + /** ClientPayload device */ + device?: (number|null); + + /** ClientPayload regData */ + regData?: (proto.ICompanionRegData|null); + + /** ClientPayload product */ + product?: (proto.ClientPayload.ClientPayloadProduct|null); + + /** ClientPayload fbCat */ + fbCat?: (Uint8Array|null); + + /** ClientPayload fbUserAgent */ + fbUserAgent?: (Uint8Array|null); + + /** ClientPayload oc */ + oc?: (boolean|null); + + /** ClientPayload lc */ + lc?: (number|null); + + /** ClientPayload iosAppExtension */ + iosAppExtension?: (proto.ClientPayload.ClientPayloadIOSAppExtension|null); + + /** ClientPayload fbAppId */ + fbAppId?: (number|Long|null); + + /** ClientPayload fbDeviceId */ + fbDeviceId?: (Uint8Array|null); + + /** ClientPayload pull */ + pull?: (boolean|null); + } + + /** Represents a ClientPayload. */ + class ClientPayload implements IClientPayload { /** - * Creates a new CallButton instance using the specified properties. + * Constructs a new ClientPayload. * @param [properties] Properties to set - * @returns CallButton instance */ - public static create(properties?: proto.ICallButton): proto.CallButton; + constructor(properties?: proto.IClientPayload); - /** - * Encodes the specified CallButton message. Does not implicitly {@link proto.CallButton.verify|verify} messages. - * @param message CallButton message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: proto.ICallButton, writer?: $protobuf.Writer): $protobuf.Writer; + /** ClientPayload username. */ + public username: (number|Long); - /** - * Encodes the specified CallButton message, length delimited. Does not implicitly {@link proto.CallButton.verify|verify} messages. - * @param message CallButton message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: proto.ICallButton, writer?: $protobuf.Writer): $protobuf.Writer; + /** ClientPayload passive. */ + public passive: boolean; - /** - * Decodes a CallButton message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CallButton - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.CallButton; + /** ClientPayload userAgent. */ + public userAgent?: (proto.IUserAgent|null); - /** - * Decodes a CallButton message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CallButton - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.CallButton; + /** ClientPayload webInfo. */ + public webInfo?: (proto.IWebInfo|null); - /** - * Verifies a CallButton message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** ClientPayload pushName. */ + public pushName: string; - /** - * Creates a CallButton message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CallButton - */ - public static fromObject(object: { [k: string]: any }): proto.CallButton; + /** ClientPayload sessionId. */ + public sessionId: number; - /** - * Creates a plain object from a CallButton message. Also converts values to other types if specified. - * @param message CallButton - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: proto.CallButton, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** ClientPayload shortConnect. */ + public shortConnect: boolean; - /** - * Converts this CallButton to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** ClientPayload connectType. */ + public connectType: proto.ClientPayload.ClientPayloadConnectType; - /** Properties of a TemplateButton. */ - interface ITemplateButton { + /** ClientPayload connectReason. */ + public connectReason: proto.ClientPayload.ClientPayloadConnectReason; - /** TemplateButton index */ - index?: (number|null); + /** ClientPayload shards. */ + public shards: number[]; - /** TemplateButton quickReplyButton */ - quickReplyButton?: (proto.IQuickReplyButton|null); + /** ClientPayload dnsSource. */ + public dnsSource?: (proto.IDNSSource|null); - /** TemplateButton urlButton */ - urlButton?: (proto.IURLButton|null); + /** ClientPayload connectAttemptCount. */ + public connectAttemptCount: number; - /** TemplateButton callButton */ - callButton?: (proto.ICallButton|null); - } + /** ClientPayload device. */ + public device: number; - /** Represents a TemplateButton. */ - class TemplateButton implements ITemplateButton { + /** ClientPayload regData. */ + public regData?: (proto.ICompanionRegData|null); - /** - * Constructs a new TemplateButton. - * @param [properties] Properties to set - */ - constructor(properties?: proto.ITemplateButton); + /** ClientPayload product. */ + public product: proto.ClientPayload.ClientPayloadProduct; - /** TemplateButton index. */ - public index: number; + /** ClientPayload fbCat. */ + public fbCat: Uint8Array; - /** TemplateButton quickReplyButton. */ - public quickReplyButton?: (proto.IQuickReplyButton|null); + /** ClientPayload fbUserAgent. */ + public fbUserAgent: Uint8Array; - /** TemplateButton urlButton. */ - public urlButton?: (proto.IURLButton|null); + /** ClientPayload oc. */ + public oc: boolean; - /** TemplateButton callButton. */ - public callButton?: (proto.ICallButton|null); + /** ClientPayload lc. */ + public lc: number; - /** TemplateButton button. */ - public button?: ("quickReplyButton"|"urlButton"|"callButton"); + /** ClientPayload iosAppExtension. */ + public iosAppExtension: proto.ClientPayload.ClientPayloadIOSAppExtension; + + /** ClientPayload fbAppId. */ + public fbAppId: (number|Long); + + /** ClientPayload fbDeviceId. */ + public fbDeviceId: Uint8Array; + + /** ClientPayload pull. */ + public pull: boolean; /** - * Creates a new TemplateButton instance using the specified properties. + * Creates a new ClientPayload instance using the specified properties. * @param [properties] Properties to set - * @returns TemplateButton instance + * @returns ClientPayload instance */ - public static create(properties?: proto.ITemplateButton): proto.TemplateButton; + public static create(properties?: proto.IClientPayload): proto.ClientPayload; /** - * Encodes the specified TemplateButton message. Does not implicitly {@link proto.TemplateButton.verify|verify} messages. - * @param message TemplateButton message or plain object to encode + * Encodes the specified ClientPayload message. Does not implicitly {@link proto.ClientPayload.verify|verify} messages. + * @param message ClientPayload message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: proto.ITemplateButton, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: proto.IClientPayload, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified TemplateButton message, length delimited. Does not implicitly {@link proto.TemplateButton.verify|verify} messages. - * @param message TemplateButton message or plain object to encode + * Encodes the specified ClientPayload message, length delimited. Does not implicitly {@link proto.ClientPayload.verify|verify} messages. + * @param message ClientPayload message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: proto.ITemplateButton, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: proto.IClientPayload, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a TemplateButton message from the specified reader or buffer. + * Decodes a ClientPayload message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns TemplateButton + * @returns ClientPayload * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.TemplateButton; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.ClientPayload; /** - * Decodes a TemplateButton message from the specified reader or buffer, length delimited. + * Decodes a ClientPayload message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns TemplateButton + * @returns ClientPayload * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.TemplateButton; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.ClientPayload; /** - * Verifies a TemplateButton message. + * Verifies a ClientPayload message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a TemplateButton message from a plain object. Also converts values to their respective internal types. + * Creates a ClientPayload message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns TemplateButton + * @returns ClientPayload */ - public static fromObject(object: { [k: string]: any }): proto.TemplateButton; + public static fromObject(object: { [k: string]: any }): proto.ClientPayload; /** - * Creates a plain object from a TemplateButton message. Also converts values to other types if specified. - * @param message TemplateButton + * Creates a plain object from a ClientPayload message. Also converts values to other types if specified. + * @param message ClientPayload * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: proto.TemplateButton, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: proto.ClientPayload, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this TemplateButton to JSON. + * Converts this ClientPayload to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a Location. */ - interface ILocation { + namespace ClientPayload { - /** Location degreesLatitude */ - degreesLatitude?: (number|null); + /** ClientPayloadConnectType enum. */ + enum ClientPayloadConnectType { + CELLULAR_UNKNOWN = 0, + WIFI_UNKNOWN = 1, + CELLULAR_EDGE = 100, + CELLULAR_IDEN = 101, + CELLULAR_UMTS = 102, + CELLULAR_EVDO = 103, + CELLULAR_GPRS = 104, + CELLULAR_HSDPA = 105, + CELLULAR_HSUPA = 106, + CELLULAR_HSPA = 107, + CELLULAR_CDMA = 108, + CELLULAR_1XRTT = 109, + CELLULAR_EHRPD = 110, + CELLULAR_LTE = 111, + CELLULAR_HSPAP = 112 + } - /** Location degreesLongitude */ - degreesLongitude?: (number|null); + /** ClientPayloadConnectReason enum. */ + enum ClientPayloadConnectReason { + PUSH = 0, + USER_ACTIVATED = 1, + SCHEDULED = 2, + ERROR_RECONNECT = 3, + NETWORK_SWITCH = 4, + PING_RECONNECT = 5 + } + + /** ClientPayloadProduct enum. */ + enum ClientPayloadProduct { + WHATSAPP = 0, + MESSENGER = 1 + } + + /** ClientPayloadIOSAppExtension enum. */ + enum ClientPayloadIOSAppExtension { + SHARE_EXTENSION = 0, + SERVICE_EXTENSION = 1, + INTENTS_EXTENSION = 2 + } + } + + /** Properties of a CompanionRegData. */ + interface ICompanionRegData { + + /** CompanionRegData eRegid */ + eRegid?: (Uint8Array|null); + + /** CompanionRegData eKeytype */ + eKeytype?: (Uint8Array|null); + + /** CompanionRegData eIdent */ + eIdent?: (Uint8Array|null); + + /** CompanionRegData eSkeyId */ + eSkeyId?: (Uint8Array|null); + + /** CompanionRegData eSkeyVal */ + eSkeyVal?: (Uint8Array|null); + + /** CompanionRegData eSkeySig */ + eSkeySig?: (Uint8Array|null); + + /** CompanionRegData buildHash */ + buildHash?: (Uint8Array|null); - /** Location name */ - name?: (string|null); + /** CompanionRegData companionProps */ + companionProps?: (Uint8Array|null); } - /** Represents a Location. */ - class Location implements ILocation { + /** Represents a CompanionRegData. */ + class CompanionRegData implements ICompanionRegData { /** - * Constructs a new Location. + * Constructs a new CompanionRegData. * @param [properties] Properties to set */ - constructor(properties?: proto.ILocation); + constructor(properties?: proto.ICompanionRegData); - /** Location degreesLatitude. */ - public degreesLatitude: number; + /** CompanionRegData eRegid. */ + public eRegid: Uint8Array; - /** Location degreesLongitude. */ - public degreesLongitude: number; + /** CompanionRegData eKeytype. */ + public eKeytype: Uint8Array; - /** Location name. */ - public name: string; + /** CompanionRegData eIdent. */ + public eIdent: Uint8Array; + + /** CompanionRegData eSkeyId. */ + public eSkeyId: Uint8Array; + + /** CompanionRegData eSkeyVal. */ + public eSkeyVal: Uint8Array; + + /** CompanionRegData eSkeySig. */ + public eSkeySig: Uint8Array; + + /** CompanionRegData buildHash. */ + public buildHash: Uint8Array; + + /** CompanionRegData companionProps. */ + public companionProps: Uint8Array; /** - * Creates a new Location instance using the specified properties. + * Creates a new CompanionRegData instance using the specified properties. * @param [properties] Properties to set - * @returns Location instance + * @returns CompanionRegData instance */ - public static create(properties?: proto.ILocation): proto.Location; + public static create(properties?: proto.ICompanionRegData): proto.CompanionRegData; /** - * Encodes the specified Location message. Does not implicitly {@link proto.Location.verify|verify} messages. - * @param message Location message or plain object to encode + * Encodes the specified CompanionRegData message. Does not implicitly {@link proto.CompanionRegData.verify|verify} messages. + * @param message CompanionRegData message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: proto.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: proto.ICompanionRegData, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified Location message, length delimited. Does not implicitly {@link proto.Location.verify|verify} messages. - * @param message Location message or plain object to encode + * Encodes the specified CompanionRegData message, length delimited. Does not implicitly {@link proto.CompanionRegData.verify|verify} messages. + * @param message CompanionRegData message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: proto.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: proto.ICompanionRegData, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a Location message from the specified reader or buffer. + * Decodes a CompanionRegData message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns Location + * @returns CompanionRegData * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.Location; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.CompanionRegData; /** - * Decodes a Location message from the specified reader or buffer, length delimited. + * Decodes a CompanionRegData message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Location + * @returns CompanionRegData * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.Location; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.CompanionRegData; /** - * Verifies a Location message. + * Verifies a CompanionRegData message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a Location message from a plain object. Also converts values to their respective internal types. + * Creates a CompanionRegData message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Location + * @returns CompanionRegData */ - public static fromObject(object: { [k: string]: any }): proto.Location; + public static fromObject(object: { [k: string]: any }): proto.CompanionRegData; /** - * Creates a plain object from a Location message. Also converts values to other types if specified. - * @param message Location + * Creates a plain object from a CompanionRegData message. Also converts values to other types if specified. + * @param message CompanionRegData * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: proto.Location, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: proto.CompanionRegData, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Location to JSON. + * Converts this CompanionRegData to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a Point. */ - interface IPoint { - - /** Point xDeprecated */ - xDeprecated?: (number|null); - - /** Point yDeprecated */ - yDeprecated?: (number|null); + /** Properties of a DNSSource. */ + interface IDNSSource { - /** Point x */ - x?: (number|null); + /** DNSSource dnsMethod */ + dnsMethod?: (proto.DNSSource.DNSSourceDNSResolutionMethod|null); - /** Point y */ - y?: (number|null); + /** DNSSource appCached */ + appCached?: (boolean|null); } - /** Represents a Point. */ - class Point implements IPoint { + /** Represents a DNSSource. */ + class DNSSource implements IDNSSource { /** - * Constructs a new Point. + * Constructs a new DNSSource. * @param [properties] Properties to set */ - constructor(properties?: proto.IPoint); - - /** Point xDeprecated. */ - public xDeprecated: number; - - /** Point yDeprecated. */ - public yDeprecated: number; + constructor(properties?: proto.IDNSSource); - /** Point x. */ - public x: number; + /** DNSSource dnsMethod. */ + public dnsMethod: proto.DNSSource.DNSSourceDNSResolutionMethod; - /** Point y. */ - public y: number; + /** DNSSource appCached. */ + public appCached: boolean; /** - * Creates a new Point instance using the specified properties. + * Creates a new DNSSource instance using the specified properties. * @param [properties] Properties to set - * @returns Point instance + * @returns DNSSource instance */ - public static create(properties?: proto.IPoint): proto.Point; + public static create(properties?: proto.IDNSSource): proto.DNSSource; /** - * Encodes the specified Point message. Does not implicitly {@link proto.Point.verify|verify} messages. - * @param message Point message or plain object to encode + * Encodes the specified DNSSource message. Does not implicitly {@link proto.DNSSource.verify|verify} messages. + * @param message DNSSource message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: proto.IPoint, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: proto.IDNSSource, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified Point message, length delimited. Does not implicitly {@link proto.Point.verify|verify} messages. - * @param message Point message or plain object to encode + * Encodes the specified DNSSource message, length delimited. Does not implicitly {@link proto.DNSSource.verify|verify} messages. + * @param message DNSSource message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: proto.IPoint, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: proto.IDNSSource, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a Point message from the specified reader or buffer. + * Decodes a DNSSource message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns Point + * @returns DNSSource * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.Point; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.DNSSource; /** - * Decodes a Point message from the specified reader or buffer, length delimited. + * Decodes a DNSSource message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Point + * @returns DNSSource * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.Point; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.DNSSource; /** - * Verifies a Point message. + * Verifies a DNSSource message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a Point message from a plain object. Also converts values to their respective internal types. + * Creates a DNSSource message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Point + * @returns DNSSource */ - public static fromObject(object: { [k: string]: any }): proto.Point; + public static fromObject(object: { [k: string]: any }): proto.DNSSource; /** - * Creates a plain object from a Point message. Also converts values to other types if specified. - * @param message Point + * Creates a plain object from a DNSSource message. Also converts values to other types if specified. + * @param message DNSSource * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: proto.Point, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: proto.DNSSource, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Point to JSON. + * Converts this DNSSource to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a CompanionProps. */ - interface ICompanionProps { + namespace DNSSource { - /** CompanionProps os */ - os?: (string|null); + /** DNSSourceDNSResolutionMethod enum. */ + enum DNSSourceDNSResolutionMethod { + SYSTEM = 0, + GOOGLE = 1, + HARDCODED = 2, + OVERRIDE = 3, + FALLBACK = 4 + } + } - /** CompanionProps version */ - version?: (proto.IAppVersion|null); + /** Properties of a HandshakeMessage. */ + interface IHandshakeMessage { - /** CompanionProps platformType */ - platformType?: (proto.CompanionProps.CompanionPropsPlatformType|null); + /** HandshakeMessage clientHello */ + clientHello?: (proto.IClientHello|null); - /** CompanionProps requireFullSync */ - requireFullSync?: (boolean|null); + /** HandshakeMessage serverHello */ + serverHello?: (proto.IServerHello|null); + + /** HandshakeMessage clientFinish */ + clientFinish?: (proto.IClientFinish|null); } - /** Represents a CompanionProps. */ - class CompanionProps implements ICompanionProps { + /** Represents a HandshakeMessage. */ + class HandshakeMessage implements IHandshakeMessage { /** - * Constructs a new CompanionProps. + * Constructs a new HandshakeMessage. * @param [properties] Properties to set */ - constructor(properties?: proto.ICompanionProps); - - /** CompanionProps os. */ - public os: string; + constructor(properties?: proto.IHandshakeMessage); - /** CompanionProps version. */ - public version?: (proto.IAppVersion|null); + /** HandshakeMessage clientHello. */ + public clientHello?: (proto.IClientHello|null); - /** CompanionProps platformType. */ - public platformType: proto.CompanionProps.CompanionPropsPlatformType; + /** HandshakeMessage serverHello. */ + public serverHello?: (proto.IServerHello|null); - /** CompanionProps requireFullSync. */ - public requireFullSync: boolean; + /** HandshakeMessage clientFinish. */ + public clientFinish?: (proto.IClientFinish|null); /** - * Creates a new CompanionProps instance using the specified properties. + * Creates a new HandshakeMessage instance using the specified properties. * @param [properties] Properties to set - * @returns CompanionProps instance + * @returns HandshakeMessage instance */ - public static create(properties?: proto.ICompanionProps): proto.CompanionProps; + public static create(properties?: proto.IHandshakeMessage): proto.HandshakeMessage; /** - * Encodes the specified CompanionProps message. Does not implicitly {@link proto.CompanionProps.verify|verify} messages. - * @param message CompanionProps message or plain object to encode + * Encodes the specified HandshakeMessage message. Does not implicitly {@link proto.HandshakeMessage.verify|verify} messages. + * @param message HandshakeMessage message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: proto.ICompanionProps, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: proto.IHandshakeMessage, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified CompanionProps message, length delimited. Does not implicitly {@link proto.CompanionProps.verify|verify} messages. - * @param message CompanionProps message or plain object to encode + * Encodes the specified HandshakeMessage message, length delimited. Does not implicitly {@link proto.HandshakeMessage.verify|verify} messages. + * @param message HandshakeMessage message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: proto.ICompanionProps, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: proto.IHandshakeMessage, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a CompanionProps message from the specified reader or buffer. + * Decodes a HandshakeMessage message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns CompanionProps + * @returns HandshakeMessage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.CompanionProps; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.HandshakeMessage; /** - * Decodes a CompanionProps message from the specified reader or buffer, length delimited. + * Decodes a HandshakeMessage message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns CompanionProps + * @returns HandshakeMessage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.CompanionProps; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.HandshakeMessage; /** - * Verifies a CompanionProps message. + * Verifies a HandshakeMessage message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a CompanionProps message from a plain object. Also converts values to their respective internal types. + * Creates a HandshakeMessage message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns CompanionProps + * @returns HandshakeMessage */ - public static fromObject(object: { [k: string]: any }): proto.CompanionProps; + public static fromObject(object: { [k: string]: any }): proto.HandshakeMessage; /** - * Creates a plain object from a CompanionProps message. Also converts values to other types if specified. - * @param message CompanionProps + * Creates a plain object from a HandshakeMessage message. Also converts values to other types if specified. + * @param message HandshakeMessage * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: proto.CompanionProps, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: proto.HandshakeMessage, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this CompanionProps to JSON. + * Converts this HandshakeMessage to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - namespace CompanionProps { - - /** CompanionPropsPlatformType enum. */ - enum CompanionPropsPlatformType { - UNKNOWN = 0, - CHROME = 1, - FIREFOX = 2, - IE = 3, - OPERA = 4, - SAFARI = 5, - EDGE = 6, - DESKTOP = 7, - IPAD = 8, - ANDROID_TABLET = 9, - OHANA = 10, - ALOHA = 11, - CATALINA = 12 - } - } - - /** Properties of a ADVSignedDeviceIdentityHMAC. */ - interface IADVSignedDeviceIdentityHMAC { + /** Properties of a NoiseCertificate. */ + interface INoiseCertificate { - /** ADVSignedDeviceIdentityHMAC details */ + /** NoiseCertificate details */ details?: (Uint8Array|null); - /** ADVSignedDeviceIdentityHMAC hmac */ - hmac?: (Uint8Array|null); + /** NoiseCertificate signature */ + signature?: (Uint8Array|null); } - /** Represents a ADVSignedDeviceIdentityHMAC. */ - class ADVSignedDeviceIdentityHMAC implements IADVSignedDeviceIdentityHMAC { + /** Represents a NoiseCertificate. */ + class NoiseCertificate implements INoiseCertificate { /** - * Constructs a new ADVSignedDeviceIdentityHMAC. + * Constructs a new NoiseCertificate. * @param [properties] Properties to set */ - constructor(properties?: proto.IADVSignedDeviceIdentityHMAC); + constructor(properties?: proto.INoiseCertificate); - /** ADVSignedDeviceIdentityHMAC details. */ + /** NoiseCertificate details. */ public details: Uint8Array; - /** ADVSignedDeviceIdentityHMAC hmac. */ - public hmac: Uint8Array; + /** NoiseCertificate signature. */ + public signature: Uint8Array; /** - * Creates a new ADVSignedDeviceIdentityHMAC instance using the specified properties. + * Creates a new NoiseCertificate instance using the specified properties. * @param [properties] Properties to set - * @returns ADVSignedDeviceIdentityHMAC instance + * @returns NoiseCertificate instance */ - public static create(properties?: proto.IADVSignedDeviceIdentityHMAC): proto.ADVSignedDeviceIdentityHMAC; + public static create(properties?: proto.INoiseCertificate): proto.NoiseCertificate; /** - * Encodes the specified ADVSignedDeviceIdentityHMAC message. Does not implicitly {@link proto.ADVSignedDeviceIdentityHMAC.verify|verify} messages. - * @param message ADVSignedDeviceIdentityHMAC message or plain object to encode + * Encodes the specified NoiseCertificate message. Does not implicitly {@link proto.NoiseCertificate.verify|verify} messages. + * @param message NoiseCertificate message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: proto.IADVSignedDeviceIdentityHMAC, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: proto.INoiseCertificate, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ADVSignedDeviceIdentityHMAC message, length delimited. Does not implicitly {@link proto.ADVSignedDeviceIdentityHMAC.verify|verify} messages. - * @param message ADVSignedDeviceIdentityHMAC message or plain object to encode + * Encodes the specified NoiseCertificate message, length delimited. Does not implicitly {@link proto.NoiseCertificate.verify|verify} messages. + * @param message NoiseCertificate message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: proto.IADVSignedDeviceIdentityHMAC, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: proto.INoiseCertificate, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ADVSignedDeviceIdentityHMAC message from the specified reader or buffer. + * Decodes a NoiseCertificate message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ADVSignedDeviceIdentityHMAC + * @returns NoiseCertificate * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.ADVSignedDeviceIdentityHMAC; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.NoiseCertificate; /** - * Decodes a ADVSignedDeviceIdentityHMAC message from the specified reader or buffer, length delimited. + * Decodes a NoiseCertificate message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ADVSignedDeviceIdentityHMAC + * @returns NoiseCertificate * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.ADVSignedDeviceIdentityHMAC; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.NoiseCertificate; /** - * Verifies a ADVSignedDeviceIdentityHMAC message. + * Verifies a NoiseCertificate message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a ADVSignedDeviceIdentityHMAC message from a plain object. Also converts values to their respective internal types. + * Creates a NoiseCertificate message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ADVSignedDeviceIdentityHMAC + * @returns NoiseCertificate */ - public static fromObject(object: { [k: string]: any }): proto.ADVSignedDeviceIdentityHMAC; + public static fromObject(object: { [k: string]: any }): proto.NoiseCertificate; /** - * Creates a plain object from a ADVSignedDeviceIdentityHMAC message. Also converts values to other types if specified. - * @param message ADVSignedDeviceIdentityHMAC + * Creates a plain object from a NoiseCertificate message. Also converts values to other types if specified. + * @param message NoiseCertificate * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: proto.ADVSignedDeviceIdentityHMAC, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: proto.NoiseCertificate, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ADVSignedDeviceIdentityHMAC to JSON. + * Converts this NoiseCertificate to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a ADVSignedDeviceIdentity. */ - interface IADVSignedDeviceIdentity { + /** Properties of a NoiseCertificateDetails. */ + interface INoiseCertificateDetails { - /** ADVSignedDeviceIdentity details */ - details?: (Uint8Array|null); + /** NoiseCertificateDetails serial */ + serial?: (number|null); - /** ADVSignedDeviceIdentity accountSignatureKey */ - accountSignatureKey?: (Uint8Array|null); + /** NoiseCertificateDetails issuer */ + issuer?: (string|null); - /** ADVSignedDeviceIdentity accountSignature */ - accountSignature?: (Uint8Array|null); + /** NoiseCertificateDetails expires */ + expires?: (number|Long|null); - /** ADVSignedDeviceIdentity deviceSignature */ - deviceSignature?: (Uint8Array|null); + /** NoiseCertificateDetails subject */ + subject?: (string|null); + + /** NoiseCertificateDetails key */ + key?: (Uint8Array|null); } - /** Represents a ADVSignedDeviceIdentity. */ - class ADVSignedDeviceIdentity implements IADVSignedDeviceIdentity { + /** Represents a NoiseCertificateDetails. */ + class NoiseCertificateDetails implements INoiseCertificateDetails { /** - * Constructs a new ADVSignedDeviceIdentity. + * Constructs a new NoiseCertificateDetails. * @param [properties] Properties to set */ - constructor(properties?: proto.IADVSignedDeviceIdentity); + constructor(properties?: proto.INoiseCertificateDetails); - /** ADVSignedDeviceIdentity details. */ - public details: Uint8Array; + /** NoiseCertificateDetails serial. */ + public serial: number; - /** ADVSignedDeviceIdentity accountSignatureKey. */ - public accountSignatureKey: Uint8Array; + /** NoiseCertificateDetails issuer. */ + public issuer: string; - /** ADVSignedDeviceIdentity accountSignature. */ - public accountSignature: Uint8Array; + /** NoiseCertificateDetails expires. */ + public expires: (number|Long); - /** ADVSignedDeviceIdentity deviceSignature. */ - public deviceSignature: Uint8Array; + /** NoiseCertificateDetails subject. */ + public subject: string; + + /** NoiseCertificateDetails key. */ + public key: Uint8Array; /** - * Creates a new ADVSignedDeviceIdentity instance using the specified properties. + * Creates a new NoiseCertificateDetails instance using the specified properties. * @param [properties] Properties to set - * @returns ADVSignedDeviceIdentity instance + * @returns NoiseCertificateDetails instance */ - public static create(properties?: proto.IADVSignedDeviceIdentity): proto.ADVSignedDeviceIdentity; + public static create(properties?: proto.INoiseCertificateDetails): proto.NoiseCertificateDetails; /** - * Encodes the specified ADVSignedDeviceIdentity message. Does not implicitly {@link proto.ADVSignedDeviceIdentity.verify|verify} messages. - * @param message ADVSignedDeviceIdentity message or plain object to encode + * Encodes the specified NoiseCertificateDetails message. Does not implicitly {@link proto.NoiseCertificateDetails.verify|verify} messages. + * @param message NoiseCertificateDetails message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: proto.IADVSignedDeviceIdentity, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: proto.INoiseCertificateDetails, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ADVSignedDeviceIdentity message, length delimited. Does not implicitly {@link proto.ADVSignedDeviceIdentity.verify|verify} messages. - * @param message ADVSignedDeviceIdentity message or plain object to encode + * Encodes the specified NoiseCertificateDetails message, length delimited. Does not implicitly {@link proto.NoiseCertificateDetails.verify|verify} messages. + * @param message NoiseCertificateDetails message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: proto.IADVSignedDeviceIdentity, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: proto.INoiseCertificateDetails, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ADVSignedDeviceIdentity message from the specified reader or buffer. + * Decodes a NoiseCertificateDetails message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ADVSignedDeviceIdentity + * @returns NoiseCertificateDetails * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.ADVSignedDeviceIdentity; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.NoiseCertificateDetails; /** - * Decodes a ADVSignedDeviceIdentity message from the specified reader or buffer, length delimited. + * Decodes a NoiseCertificateDetails message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ADVSignedDeviceIdentity + * @returns NoiseCertificateDetails * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.ADVSignedDeviceIdentity; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.NoiseCertificateDetails; /** - * Verifies a ADVSignedDeviceIdentity message. + * Verifies a NoiseCertificateDetails message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a ADVSignedDeviceIdentity message from a plain object. Also converts values to their respective internal types. + * Creates a NoiseCertificateDetails message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ADVSignedDeviceIdentity + * @returns NoiseCertificateDetails */ - public static fromObject(object: { [k: string]: any }): proto.ADVSignedDeviceIdentity; + public static fromObject(object: { [k: string]: any }): proto.NoiseCertificateDetails; /** - * Creates a plain object from a ADVSignedDeviceIdentity message. Also converts values to other types if specified. - * @param message ADVSignedDeviceIdentity + * Creates a plain object from a NoiseCertificateDetails message. Also converts values to other types if specified. + * @param message NoiseCertificateDetails * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: proto.ADVSignedDeviceIdentity, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: proto.NoiseCertificateDetails, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ADVSignedDeviceIdentity to JSON. + * Converts this NoiseCertificateDetails to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a ADVDeviceIdentity. */ - interface IADVDeviceIdentity { + /** Properties of a ServerHello. */ + interface IServerHello { - /** ADVDeviceIdentity rawId */ - rawId?: (number|null); + /** ServerHello ephemeral */ + ephemeral?: (Uint8Array|null); - /** ADVDeviceIdentity timestamp */ - timestamp?: (number|Long|null); + /** ServerHello static */ + "static"?: (Uint8Array|null); - /** ADVDeviceIdentity keyIndex */ - keyIndex?: (number|null); + /** ServerHello payload */ + payload?: (Uint8Array|null); } - /** Represents a ADVDeviceIdentity. */ - class ADVDeviceIdentity implements IADVDeviceIdentity { + /** Represents a ServerHello. */ + class ServerHello implements IServerHello { /** - * Constructs a new ADVDeviceIdentity. + * Constructs a new ServerHello. * @param [properties] Properties to set */ - constructor(properties?: proto.IADVDeviceIdentity); + constructor(properties?: proto.IServerHello); - /** ADVDeviceIdentity rawId. */ - public rawId: number; + /** ServerHello ephemeral. */ + public ephemeral: Uint8Array; - /** ADVDeviceIdentity timestamp. */ - public timestamp: (number|Long); + /** ServerHello static. */ + public static: Uint8Array; - /** ADVDeviceIdentity keyIndex. */ - public keyIndex: number; + /** ServerHello payload. */ + public payload: Uint8Array; /** - * Creates a new ADVDeviceIdentity instance using the specified properties. + * Creates a new ServerHello instance using the specified properties. * @param [properties] Properties to set - * @returns ADVDeviceIdentity instance + * @returns ServerHello instance */ - public static create(properties?: proto.IADVDeviceIdentity): proto.ADVDeviceIdentity; + public static create(properties?: proto.IServerHello): proto.ServerHello; /** - * Encodes the specified ADVDeviceIdentity message. Does not implicitly {@link proto.ADVDeviceIdentity.verify|verify} messages. - * @param message ADVDeviceIdentity message or plain object to encode + * Encodes the specified ServerHello message. Does not implicitly {@link proto.ServerHello.verify|verify} messages. + * @param message ServerHello message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: proto.IADVDeviceIdentity, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: proto.IServerHello, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ADVDeviceIdentity message, length delimited. Does not implicitly {@link proto.ADVDeviceIdentity.verify|verify} messages. - * @param message ADVDeviceIdentity message or plain object to encode + * Encodes the specified ServerHello message, length delimited. Does not implicitly {@link proto.ServerHello.verify|verify} messages. + * @param message ServerHello message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: proto.IADVDeviceIdentity, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: proto.IServerHello, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ADVDeviceIdentity message from the specified reader or buffer. + * Decodes a ServerHello message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ADVDeviceIdentity + * @returns ServerHello * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.ADVDeviceIdentity; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.ServerHello; /** - * Decodes a ADVDeviceIdentity message from the specified reader or buffer, length delimited. + * Decodes a ServerHello message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ADVDeviceIdentity + * @returns ServerHello * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.ADVDeviceIdentity; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.ServerHello; /** - * Verifies a ADVDeviceIdentity message. + * Verifies a ServerHello message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a ADVDeviceIdentity message from a plain object. Also converts values to their respective internal types. + * Creates a ServerHello message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ADVDeviceIdentity + * @returns ServerHello */ - public static fromObject(object: { [k: string]: any }): proto.ADVDeviceIdentity; + public static fromObject(object: { [k: string]: any }): proto.ServerHello; /** - * Creates a plain object from a ADVDeviceIdentity message. Also converts values to other types if specified. - * @param message ADVDeviceIdentity + * Creates a plain object from a ServerHello message. Also converts values to other types if specified. + * @param message ServerHello * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: proto.ADVDeviceIdentity, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: proto.ServerHello, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ADVDeviceIdentity to JSON. + * Converts this ServerHello to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a ADVSignedKeyIndexList. */ - interface IADVSignedKeyIndexList { + /** Properties of a UserAgent. */ + interface IUserAgent { - /** ADVSignedKeyIndexList details */ - details?: (Uint8Array|null); + /** UserAgent platform */ + platform?: (proto.UserAgent.UserAgentPlatform|null); - /** ADVSignedKeyIndexList accountSignature */ - accountSignature?: (Uint8Array|null); + /** UserAgent appVersion */ + appVersion?: (proto.IAppVersion|null); + + /** UserAgent mcc */ + mcc?: (string|null); + + /** UserAgent mnc */ + mnc?: (string|null); + + /** UserAgent osVersion */ + osVersion?: (string|null); + + /** UserAgent manufacturer */ + manufacturer?: (string|null); + + /** UserAgent device */ + device?: (string|null); + + /** UserAgent osBuildNumber */ + osBuildNumber?: (string|null); + + /** UserAgent phoneId */ + phoneId?: (string|null); + + /** UserAgent releaseChannel */ + releaseChannel?: (proto.UserAgent.UserAgentReleaseChannel|null); + + /** UserAgent localeLanguageIso6391 */ + localeLanguageIso6391?: (string|null); + + /** UserAgent localeCountryIso31661Alpha2 */ + localeCountryIso31661Alpha2?: (string|null); + + /** UserAgent deviceBoard */ + deviceBoard?: (string|null); } - /** Represents a ADVSignedKeyIndexList. */ - class ADVSignedKeyIndexList implements IADVSignedKeyIndexList { + /** Represents a UserAgent. */ + class UserAgent implements IUserAgent { /** - * Constructs a new ADVSignedKeyIndexList. + * Constructs a new UserAgent. * @param [properties] Properties to set */ - constructor(properties?: proto.IADVSignedKeyIndexList); + constructor(properties?: proto.IUserAgent); - /** ADVSignedKeyIndexList details. */ - public details: Uint8Array; + /** UserAgent platform. */ + public platform: proto.UserAgent.UserAgentPlatform; - /** ADVSignedKeyIndexList accountSignature. */ - public accountSignature: Uint8Array; + /** UserAgent appVersion. */ + public appVersion?: (proto.IAppVersion|null); + + /** UserAgent mcc. */ + public mcc: string; + + /** UserAgent mnc. */ + public mnc: string; + + /** UserAgent osVersion. */ + public osVersion: string; + + /** UserAgent manufacturer. */ + public manufacturer: string; + + /** UserAgent device. */ + public device: string; + + /** UserAgent osBuildNumber. */ + public osBuildNumber: string; + + /** UserAgent phoneId. */ + public phoneId: string; + + /** UserAgent releaseChannel. */ + public releaseChannel: proto.UserAgent.UserAgentReleaseChannel; + + /** UserAgent localeLanguageIso6391. */ + public localeLanguageIso6391: string; + + /** UserAgent localeCountryIso31661Alpha2. */ + public localeCountryIso31661Alpha2: string; + + /** UserAgent deviceBoard. */ + public deviceBoard: string; /** - * Creates a new ADVSignedKeyIndexList instance using the specified properties. + * Creates a new UserAgent instance using the specified properties. * @param [properties] Properties to set - * @returns ADVSignedKeyIndexList instance + * @returns UserAgent instance */ - public static create(properties?: proto.IADVSignedKeyIndexList): proto.ADVSignedKeyIndexList; + public static create(properties?: proto.IUserAgent): proto.UserAgent; /** - * Encodes the specified ADVSignedKeyIndexList message. Does not implicitly {@link proto.ADVSignedKeyIndexList.verify|verify} messages. - * @param message ADVSignedKeyIndexList message or plain object to encode + * Encodes the specified UserAgent message. Does not implicitly {@link proto.UserAgent.verify|verify} messages. + * @param message UserAgent message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: proto.IADVSignedKeyIndexList, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: proto.IUserAgent, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ADVSignedKeyIndexList message, length delimited. Does not implicitly {@link proto.ADVSignedKeyIndexList.verify|verify} messages. - * @param message ADVSignedKeyIndexList message or plain object to encode + * Encodes the specified UserAgent message, length delimited. Does not implicitly {@link proto.UserAgent.verify|verify} messages. + * @param message UserAgent message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: proto.IADVSignedKeyIndexList, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: proto.IUserAgent, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ADVSignedKeyIndexList message from the specified reader or buffer. + * Decodes a UserAgent message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ADVSignedKeyIndexList + * @returns UserAgent * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.ADVSignedKeyIndexList; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.UserAgent; /** - * Decodes a ADVSignedKeyIndexList message from the specified reader or buffer, length delimited. + * Decodes a UserAgent message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ADVSignedKeyIndexList + * @returns UserAgent * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.ADVSignedKeyIndexList; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.UserAgent; /** - * Verifies a ADVSignedKeyIndexList message. + * Verifies a UserAgent message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a ADVSignedKeyIndexList message from a plain object. Also converts values to their respective internal types. + * Creates a UserAgent message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ADVSignedKeyIndexList + * @returns UserAgent */ - public static fromObject(object: { [k: string]: any }): proto.ADVSignedKeyIndexList; + public static fromObject(object: { [k: string]: any }): proto.UserAgent; /** - * Creates a plain object from a ADVSignedKeyIndexList message. Also converts values to other types if specified. - * @param message ADVSignedKeyIndexList + * Creates a plain object from a UserAgent message. Also converts values to other types if specified. + * @param message UserAgent * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: proto.ADVSignedKeyIndexList, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: proto.UserAgent, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ADVSignedKeyIndexList to JSON. + * Converts this UserAgent to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a ADVKeyIndexList. */ - interface IADVKeyIndexList { + namespace UserAgent { + + /** UserAgentPlatform enum. */ + enum UserAgentPlatform { + ANDROID = 0, + IOS = 1, + WINDOWS_PHONE = 2, + BLACKBERRY = 3, + BLACKBERRYX = 4, + S40 = 5, + S60 = 6, + PYTHON_CLIENT = 7, + TIZEN = 8, + ENTERPRISE = 9, + SMB_ANDROID = 10, + KAIOS = 11, + SMB_IOS = 12, + WINDOWS = 13, + WEB = 14, + PORTAL = 15, + GREEN_ANDROID = 16, + GREEN_IPHONE = 17, + BLUE_ANDROID = 18, + BLUE_IPHONE = 19, + FBLITE_ANDROID = 20, + MLITE_ANDROID = 21, + IGLITE_ANDROID = 22, + PAGE = 23, + MACOS = 24, + OCULUS_MSG = 25, + OCULUS_CALL = 26, + MILAN = 27, + CAPI = 28 + } + + /** UserAgentReleaseChannel enum. */ + enum UserAgentReleaseChannel { + RELEASE = 0, + BETA = 1, + ALPHA = 2, + DEBUG = 3 + } + } + + /** Properties of a WebdPayload. */ + interface IWebdPayload { + + /** WebdPayload usesParticipantInKey */ + usesParticipantInKey?: (boolean|null); + + /** WebdPayload supportsStarredMessages */ + supportsStarredMessages?: (boolean|null); + + /** WebdPayload supportsDocumentMessages */ + supportsDocumentMessages?: (boolean|null); + + /** WebdPayload supportsUrlMessages */ + supportsUrlMessages?: (boolean|null); + + /** WebdPayload supportsMediaRetry */ + supportsMediaRetry?: (boolean|null); + + /** WebdPayload supportsE2EImage */ + supportsE2EImage?: (boolean|null); + + /** WebdPayload supportsE2EVideo */ + supportsE2EVideo?: (boolean|null); + + /** WebdPayload supportsE2EAudio */ + supportsE2EAudio?: (boolean|null); + + /** WebdPayload supportsE2EDocument */ + supportsE2EDocument?: (boolean|null); + + /** WebdPayload documentTypes */ + documentTypes?: (string|null); + + /** WebdPayload features */ + features?: (Uint8Array|null); + } + + /** Represents a WebdPayload. */ + class WebdPayload implements IWebdPayload { + + /** + * Constructs a new WebdPayload. + * @param [properties] Properties to set + */ + constructor(properties?: proto.IWebdPayload); + + /** WebdPayload usesParticipantInKey. */ + public usesParticipantInKey: boolean; - /** ADVKeyIndexList rawId */ - rawId?: (number|null); + /** WebdPayload supportsStarredMessages. */ + public supportsStarredMessages: boolean; - /** ADVKeyIndexList timestamp */ - timestamp?: (number|Long|null); + /** WebdPayload supportsDocumentMessages. */ + public supportsDocumentMessages: boolean; - /** ADVKeyIndexList currentIndex */ - currentIndex?: (number|null); + /** WebdPayload supportsUrlMessages. */ + public supportsUrlMessages: boolean; - /** ADVKeyIndexList validIndexes */ - validIndexes?: (number[]|null); - } + /** WebdPayload supportsMediaRetry. */ + public supportsMediaRetry: boolean; - /** Represents a ADVKeyIndexList. */ - class ADVKeyIndexList implements IADVKeyIndexList { + /** WebdPayload supportsE2EImage. */ + public supportsE2EImage: boolean; - /** - * Constructs a new ADVKeyIndexList. - * @param [properties] Properties to set - */ - constructor(properties?: proto.IADVKeyIndexList); + /** WebdPayload supportsE2EVideo. */ + public supportsE2EVideo: boolean; - /** ADVKeyIndexList rawId. */ - public rawId: number; + /** WebdPayload supportsE2EAudio. */ + public supportsE2EAudio: boolean; - /** ADVKeyIndexList timestamp. */ - public timestamp: (number|Long); + /** WebdPayload supportsE2EDocument. */ + public supportsE2EDocument: boolean; - /** ADVKeyIndexList currentIndex. */ - public currentIndex: number; + /** WebdPayload documentTypes. */ + public documentTypes: string; - /** ADVKeyIndexList validIndexes. */ - public validIndexes: number[]; + /** WebdPayload features. */ + public features: Uint8Array; /** - * Creates a new ADVKeyIndexList instance using the specified properties. + * Creates a new WebdPayload instance using the specified properties. * @param [properties] Properties to set - * @returns ADVKeyIndexList instance + * @returns WebdPayload instance */ - public static create(properties?: proto.IADVKeyIndexList): proto.ADVKeyIndexList; + public static create(properties?: proto.IWebdPayload): proto.WebdPayload; /** - * Encodes the specified ADVKeyIndexList message. Does not implicitly {@link proto.ADVKeyIndexList.verify|verify} messages. - * @param message ADVKeyIndexList message or plain object to encode + * Encodes the specified WebdPayload message. Does not implicitly {@link proto.WebdPayload.verify|verify} messages. + * @param message WebdPayload message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: proto.IADVKeyIndexList, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: proto.IWebdPayload, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ADVKeyIndexList message, length delimited. Does not implicitly {@link proto.ADVKeyIndexList.verify|verify} messages. - * @param message ADVKeyIndexList message or plain object to encode + * Encodes the specified WebdPayload message, length delimited. Does not implicitly {@link proto.WebdPayload.verify|verify} messages. + * @param message WebdPayload message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: proto.IADVKeyIndexList, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: proto.IWebdPayload, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ADVKeyIndexList message from the specified reader or buffer. + * Decodes a WebdPayload message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ADVKeyIndexList + * @returns WebdPayload * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.ADVKeyIndexList; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.WebdPayload; /** - * Decodes a ADVKeyIndexList message from the specified reader or buffer, length delimited. + * Decodes a WebdPayload message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ADVKeyIndexList + * @returns WebdPayload * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.ADVKeyIndexList; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.WebdPayload; /** - * Verifies a ADVKeyIndexList message. + * Verifies a WebdPayload message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a ADVKeyIndexList message from a plain object. Also converts values to their respective internal types. + * Creates a WebdPayload message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ADVKeyIndexList + * @returns WebdPayload */ - public static fromObject(object: { [k: string]: any }): proto.ADVKeyIndexList; + public static fromObject(object: { [k: string]: any }): proto.WebdPayload; /** - * Creates a plain object from a ADVKeyIndexList message. Also converts values to other types if specified. - * @param message ADVKeyIndexList + * Creates a plain object from a WebdPayload message. Also converts values to other types if specified. + * @param message WebdPayload * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: proto.ADVKeyIndexList, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: proto.WebdPayload, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ADVKeyIndexList to JSON. + * Converts this WebdPayload to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a MessageKey. */ - interface IMessageKey { + /** Properties of a WebInfo. */ + interface IWebInfo { - /** MessageKey remoteJid */ - remoteJid?: (string|null); + /** WebInfo refToken */ + refToken?: (string|null); - /** MessageKey fromMe */ - fromMe?: (boolean|null); + /** WebInfo version */ + version?: (string|null); - /** MessageKey id */ - id?: (string|null); + /** WebInfo webdPayload */ + webdPayload?: (proto.IWebdPayload|null); - /** MessageKey participant */ - participant?: (string|null); + /** WebInfo webSubPlatform */ + webSubPlatform?: (proto.WebInfo.WebInfoWebSubPlatform|null); } - /** Represents a MessageKey. */ - class MessageKey implements IMessageKey { + /** Represents a WebInfo. */ + class WebInfo implements IWebInfo { /** - * Constructs a new MessageKey. + * Constructs a new WebInfo. * @param [properties] Properties to set */ - constructor(properties?: proto.IMessageKey); + constructor(properties?: proto.IWebInfo); - /** MessageKey remoteJid. */ - public remoteJid: string; + /** WebInfo refToken. */ + public refToken: string; - /** MessageKey fromMe. */ - public fromMe: boolean; + /** WebInfo version. */ + public version: string; - /** MessageKey id. */ - public id: string; + /** WebInfo webdPayload. */ + public webdPayload?: (proto.IWebdPayload|null); - /** MessageKey participant. */ - public participant: string; + /** WebInfo webSubPlatform. */ + public webSubPlatform: proto.WebInfo.WebInfoWebSubPlatform; /** - * Creates a new MessageKey instance using the specified properties. + * Creates a new WebInfo instance using the specified properties. * @param [properties] Properties to set - * @returns MessageKey instance + * @returns WebInfo instance */ - public static create(properties?: proto.IMessageKey): proto.MessageKey; + public static create(properties?: proto.IWebInfo): proto.WebInfo; /** - * Encodes the specified MessageKey message. Does not implicitly {@link proto.MessageKey.verify|verify} messages. - * @param message MessageKey message or plain object to encode + * Encodes the specified WebInfo message. Does not implicitly {@link proto.WebInfo.verify|verify} messages. + * @param message WebInfo message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: proto.IMessageKey, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: proto.IWebInfo, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified MessageKey message, length delimited. Does not implicitly {@link proto.MessageKey.verify|verify} messages. - * @param message MessageKey message or plain object to encode + * Encodes the specified WebInfo message, length delimited. Does not implicitly {@link proto.WebInfo.verify|verify} messages. + * @param message WebInfo message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: proto.IMessageKey, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: proto.IWebInfo, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a MessageKey message from the specified reader or buffer. + * Decodes a WebInfo message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns MessageKey + * @returns WebInfo * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.MessageKey; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.WebInfo; /** - * Decodes a MessageKey message from the specified reader or buffer, length delimited. + * Decodes a WebInfo message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns MessageKey + * @returns WebInfo * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.MessageKey; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.WebInfo; /** - * Verifies a MessageKey message. + * Verifies a WebInfo message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a MessageKey message from a plain object. Also converts values to their respective internal types. + * Creates a WebInfo message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns MessageKey + * @returns WebInfo */ - public static fromObject(object: { [k: string]: any }): proto.MessageKey; + public static fromObject(object: { [k: string]: any }): proto.WebInfo; /** - * Creates a plain object from a MessageKey message. Also converts values to other types if specified. - * @param message MessageKey + * Creates a plain object from a WebInfo message. Also converts values to other types if specified. + * @param message WebInfo * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: proto.MessageKey, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: proto.WebInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this MessageKey to JSON. + * Converts this WebInfo to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a Reaction. */ - interface IReaction { - - /** Reaction key */ - key?: (proto.IMessageKey|null); - - /** Reaction text */ - text?: (string|null); + namespace WebInfo { - /** Reaction groupingKey */ - groupingKey?: (string|null); + /** WebInfoWebSubPlatform enum. */ + enum WebInfoWebSubPlatform { + WEB_BROWSER = 0, + APP_STORE = 1, + WIN_STORE = 2, + DARWIN = 3, + WIN32 = 4 + } + } - /** Reaction senderTimestampMs */ - senderTimestampMs?: (number|Long|null); + /** Properties of a MediaData. */ + interface IMediaData { - /** Reaction unread */ - unread?: (boolean|null); + /** MediaData localPath */ + localPath?: (string|null); } - /** Represents a Reaction. */ - class Reaction implements IReaction { + /** Represents a MediaData. */ + class MediaData implements IMediaData { /** - * Constructs a new Reaction. + * Constructs a new MediaData. * @param [properties] Properties to set */ - constructor(properties?: proto.IReaction); - - /** Reaction key. */ - public key?: (proto.IMessageKey|null); - - /** Reaction text. */ - public text: string; - - /** Reaction groupingKey. */ - public groupingKey: string; - - /** Reaction senderTimestampMs. */ - public senderTimestampMs: (number|Long); + constructor(properties?: proto.IMediaData); - /** Reaction unread. */ - public unread: boolean; + /** MediaData localPath. */ + public localPath: string; /** - * Creates a new Reaction instance using the specified properties. + * Creates a new MediaData instance using the specified properties. * @param [properties] Properties to set - * @returns Reaction instance + * @returns MediaData instance */ - public static create(properties?: proto.IReaction): proto.Reaction; + public static create(properties?: proto.IMediaData): proto.MediaData; /** - * Encodes the specified Reaction message. Does not implicitly {@link proto.Reaction.verify|verify} messages. - * @param message Reaction message or plain object to encode + * Encodes the specified MediaData message. Does not implicitly {@link proto.MediaData.verify|verify} messages. + * @param message MediaData message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: proto.IReaction, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: proto.IMediaData, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified Reaction message, length delimited. Does not implicitly {@link proto.Reaction.verify|verify} messages. - * @param message Reaction message or plain object to encode + * Encodes the specified MediaData message, length delimited. Does not implicitly {@link proto.MediaData.verify|verify} messages. + * @param message MediaData message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: proto.IReaction, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: proto.IMediaData, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a Reaction message from the specified reader or buffer. + * Decodes a MediaData message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns Reaction + * @returns MediaData * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.Reaction; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.MediaData; /** - * Decodes a Reaction message from the specified reader or buffer, length delimited. + * Decodes a MediaData message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Reaction + * @returns MediaData * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.Reaction; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.MediaData; /** - * Verifies a Reaction message. + * Verifies a MediaData message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a Reaction message from a plain object. Also converts values to their respective internal types. + * Creates a MediaData message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Reaction + * @returns MediaData */ - public static fromObject(object: { [k: string]: any }): proto.Reaction; + public static fromObject(object: { [k: string]: any }): proto.MediaData; /** - * Creates a plain object from a Reaction message. Also converts values to other types if specified. - * @param message Reaction + * Creates a plain object from a MediaData message. Also converts values to other types if specified. + * @param message MediaData * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: proto.Reaction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: proto.MediaData, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Reaction to JSON. + * Converts this MediaData to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a UserReceipt. */ - interface IUserReceipt { - - /** UserReceipt userJid */ - userJid: string; - - /** UserReceipt receiptTimestamp */ - receiptTimestamp?: (number|Long|null); + /** Properties of a NotificationMessageInfo. */ + interface INotificationMessageInfo { - /** UserReceipt readTimestamp */ - readTimestamp?: (number|Long|null); + /** NotificationMessageInfo key */ + key?: (proto.IMessageKey|null); - /** UserReceipt playedTimestamp */ - playedTimestamp?: (number|Long|null); + /** NotificationMessageInfo message */ + message?: (proto.IMessage|null); - /** UserReceipt pendingDeviceJid */ - pendingDeviceJid?: (string[]|null); + /** NotificationMessageInfo messageTimestamp */ + messageTimestamp?: (number|Long|null); - /** UserReceipt deliveredDeviceJid */ - deliveredDeviceJid?: (string[]|null); + /** NotificationMessageInfo participant */ + participant?: (string|null); } - /** Represents a UserReceipt. */ - class UserReceipt implements IUserReceipt { + /** Represents a NotificationMessageInfo. */ + class NotificationMessageInfo implements INotificationMessageInfo { /** - * Constructs a new UserReceipt. + * Constructs a new NotificationMessageInfo. * @param [properties] Properties to set */ - constructor(properties?: proto.IUserReceipt); - - /** UserReceipt userJid. */ - public userJid: string; - - /** UserReceipt receiptTimestamp. */ - public receiptTimestamp: (number|Long); + constructor(properties?: proto.INotificationMessageInfo); - /** UserReceipt readTimestamp. */ - public readTimestamp: (number|Long); + /** NotificationMessageInfo key. */ + public key?: (proto.IMessageKey|null); - /** UserReceipt playedTimestamp. */ - public playedTimestamp: (number|Long); + /** NotificationMessageInfo message. */ + public message?: (proto.IMessage|null); - /** UserReceipt pendingDeviceJid. */ - public pendingDeviceJid: string[]; + /** NotificationMessageInfo messageTimestamp. */ + public messageTimestamp: (number|Long); - /** UserReceipt deliveredDeviceJid. */ - public deliveredDeviceJid: string[]; + /** NotificationMessageInfo participant. */ + public participant: string; /** - * Creates a new UserReceipt instance using the specified properties. + * Creates a new NotificationMessageInfo instance using the specified properties. * @param [properties] Properties to set - * @returns UserReceipt instance + * @returns NotificationMessageInfo instance */ - public static create(properties?: proto.IUserReceipt): proto.UserReceipt; + public static create(properties?: proto.INotificationMessageInfo): proto.NotificationMessageInfo; /** - * Encodes the specified UserReceipt message. Does not implicitly {@link proto.UserReceipt.verify|verify} messages. - * @param message UserReceipt message or plain object to encode + * Encodes the specified NotificationMessageInfo message. Does not implicitly {@link proto.NotificationMessageInfo.verify|verify} messages. + * @param message NotificationMessageInfo message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: proto.IUserReceipt, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: proto.INotificationMessageInfo, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified UserReceipt message, length delimited. Does not implicitly {@link proto.UserReceipt.verify|verify} messages. - * @param message UserReceipt message or plain object to encode + * Encodes the specified NotificationMessageInfo message, length delimited. Does not implicitly {@link proto.NotificationMessageInfo.verify|verify} messages. + * @param message NotificationMessageInfo message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: proto.IUserReceipt, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: proto.INotificationMessageInfo, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a UserReceipt message from the specified reader or buffer. + * Decodes a NotificationMessageInfo message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns UserReceipt + * @returns NotificationMessageInfo * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.UserReceipt; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.NotificationMessageInfo; /** - * Decodes a UserReceipt message from the specified reader or buffer, length delimited. + * Decodes a NotificationMessageInfo message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns UserReceipt + * @returns NotificationMessageInfo * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.UserReceipt; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.NotificationMessageInfo; /** - * Verifies a UserReceipt message. + * Verifies a NotificationMessageInfo message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a UserReceipt message from a plain object. Also converts values to their respective internal types. + * Creates a NotificationMessageInfo message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns UserReceipt + * @returns NotificationMessageInfo */ - public static fromObject(object: { [k: string]: any }): proto.UserReceipt; + public static fromObject(object: { [k: string]: any }): proto.NotificationMessageInfo; /** - * Creates a plain object from a UserReceipt message. Also converts values to other types if specified. - * @param message UserReceipt + * Creates a plain object from a NotificationMessageInfo message. Also converts values to other types if specified. + * @param message NotificationMessageInfo * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: proto.UserReceipt, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: proto.NotificationMessageInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this UserReceipt to JSON. + * Converts this NotificationMessageInfo to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a StatusPSA. */ - interface IStatusPSA { + /** Properties of a PaymentInfo. */ + interface IPaymentInfo { - /** StatusPSA campaignId */ - campaignId: string; + /** PaymentInfo currencyDeprecated */ + currencyDeprecated?: (proto.PaymentInfo.PaymentInfoCurrency|null); - /** StatusPSA campaignExpirationTimestamp */ - campaignExpirationTimestamp?: (number|Long|null); + /** PaymentInfo amount1000 */ + amount1000?: (number|Long|null); + + /** PaymentInfo receiverJid */ + receiverJid?: (string|null); + + /** PaymentInfo status */ + status?: (proto.PaymentInfo.PaymentInfoStatus|null); + + /** PaymentInfo transactionTimestamp */ + transactionTimestamp?: (number|Long|null); + + /** PaymentInfo requestMessageKey */ + requestMessageKey?: (proto.IMessageKey|null); + + /** PaymentInfo expiryTimestamp */ + expiryTimestamp?: (number|Long|null); + + /** PaymentInfo futureproofed */ + futureproofed?: (boolean|null); + + /** PaymentInfo currency */ + currency?: (string|null); + + /** PaymentInfo txnStatus */ + txnStatus?: (proto.PaymentInfo.PaymentInfoTxnStatus|null); + + /** PaymentInfo useNoviFiatFormat */ + useNoviFiatFormat?: (boolean|null); + + /** PaymentInfo primaryAmount */ + primaryAmount?: (proto.IMoney|null); + + /** PaymentInfo exchangeAmount */ + exchangeAmount?: (proto.IMoney|null); } - /** Represents a StatusPSA. */ - class StatusPSA implements IStatusPSA { + /** Represents a PaymentInfo. */ + class PaymentInfo implements IPaymentInfo { /** - * Constructs a new StatusPSA. + * Constructs a new PaymentInfo. * @param [properties] Properties to set */ - constructor(properties?: proto.IStatusPSA); + constructor(properties?: proto.IPaymentInfo); - /** StatusPSA campaignId. */ - public campaignId: string; + /** PaymentInfo currencyDeprecated. */ + public currencyDeprecated: proto.PaymentInfo.PaymentInfoCurrency; - /** StatusPSA campaignExpirationTimestamp. */ - public campaignExpirationTimestamp: (number|Long); + /** PaymentInfo amount1000. */ + public amount1000: (number|Long); + + /** PaymentInfo receiverJid. */ + public receiverJid: string; + + /** PaymentInfo status. */ + public status: proto.PaymentInfo.PaymentInfoStatus; + + /** PaymentInfo transactionTimestamp. */ + public transactionTimestamp: (number|Long); + + /** PaymentInfo requestMessageKey. */ + public requestMessageKey?: (proto.IMessageKey|null); + + /** PaymentInfo expiryTimestamp. */ + public expiryTimestamp: (number|Long); + + /** PaymentInfo futureproofed. */ + public futureproofed: boolean; + + /** PaymentInfo currency. */ + public currency: string; + + /** PaymentInfo txnStatus. */ + public txnStatus: proto.PaymentInfo.PaymentInfoTxnStatus; + + /** PaymentInfo useNoviFiatFormat. */ + public useNoviFiatFormat: boolean; + + /** PaymentInfo primaryAmount. */ + public primaryAmount?: (proto.IMoney|null); + + /** PaymentInfo exchangeAmount. */ + public exchangeAmount?: (proto.IMoney|null); /** - * Creates a new StatusPSA instance using the specified properties. + * Creates a new PaymentInfo instance using the specified properties. * @param [properties] Properties to set - * @returns StatusPSA instance + * @returns PaymentInfo instance */ - public static create(properties?: proto.IStatusPSA): proto.StatusPSA; + public static create(properties?: proto.IPaymentInfo): proto.PaymentInfo; /** - * Encodes the specified StatusPSA message. Does not implicitly {@link proto.StatusPSA.verify|verify} messages. - * @param message StatusPSA message or plain object to encode + * Encodes the specified PaymentInfo message. Does not implicitly {@link proto.PaymentInfo.verify|verify} messages. + * @param message PaymentInfo message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: proto.IStatusPSA, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: proto.IPaymentInfo, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified StatusPSA message, length delimited. Does not implicitly {@link proto.StatusPSA.verify|verify} messages. - * @param message StatusPSA message or plain object to encode + * Encodes the specified PaymentInfo message, length delimited. Does not implicitly {@link proto.PaymentInfo.verify|verify} messages. + * @param message PaymentInfo message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: proto.IStatusPSA, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: proto.IPaymentInfo, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a StatusPSA message from the specified reader or buffer. + * Decodes a PaymentInfo message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns StatusPSA + * @returns PaymentInfo * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.StatusPSA; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.PaymentInfo; /** - * Decodes a StatusPSA message from the specified reader or buffer, length delimited. + * Decodes a PaymentInfo message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns StatusPSA + * @returns PaymentInfo * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.StatusPSA; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.PaymentInfo; /** - * Verifies a StatusPSA message. + * Verifies a PaymentInfo message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a StatusPSA message from a plain object. Also converts values to their respective internal types. + * Creates a PaymentInfo message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns StatusPSA + * @returns PaymentInfo */ - public static fromObject(object: { [k: string]: any }): proto.StatusPSA; + public static fromObject(object: { [k: string]: any }): proto.PaymentInfo; /** - * Creates a plain object from a StatusPSA message. Also converts values to other types if specified. - * @param message StatusPSA + * Creates a plain object from a PaymentInfo message. Also converts values to other types if specified. + * @param message PaymentInfo * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: proto.StatusPSA, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: proto.PaymentInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this StatusPSA to JSON. + * Converts this PaymentInfo to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } + namespace PaymentInfo { + + /** PaymentInfoCurrency enum. */ + enum PaymentInfoCurrency { + UNKNOWN_CURRENCY = 0, + INR = 1 + } + + /** PaymentInfoStatus enum. */ + enum PaymentInfoStatus { + UNKNOWN_STATUS = 0, + PROCESSING = 1, + SENT = 2, + NEED_TO_ACCEPT = 3, + COMPLETE = 4, + COULD_NOT_COMPLETE = 5, + REFUNDED = 6, + EXPIRED = 7, + REJECTED = 8, + CANCELLED = 9, + WAITING_FOR_PAYER = 10, + WAITING = 11 + } + + /** PaymentInfoTxnStatus enum. */ + enum PaymentInfoTxnStatus { + UNKNOWN = 0, + PENDING_SETUP = 1, + PENDING_RECEIVER_SETUP = 2, + INIT = 3, + SUCCESS = 4, + COMPLETED = 5, + FAILED = 6, + FAILED_RISK = 7, + FAILED_PROCESSING = 8, + FAILED_RECEIVER_PROCESSING = 9, + FAILED_DA = 10, + FAILED_DA_FINAL = 11, + REFUNDED_TXN = 12, + REFUND_FAILED = 13, + REFUND_FAILED_PROCESSING = 14, + REFUND_FAILED_DA = 15, + EXPIRED_TXN = 16, + AUTH_CANCELED = 17, + AUTH_CANCEL_FAILED_PROCESSING = 18, + AUTH_CANCEL_FAILED = 19, + COLLECT_INIT = 20, + COLLECT_SUCCESS = 21, + COLLECT_FAILED = 22, + COLLECT_FAILED_RISK = 23, + COLLECT_REJECTED = 24, + COLLECT_EXPIRED = 25, + COLLECT_CANCELED = 26, + COLLECT_CANCELLING = 27, + IN_REVIEW = 28 + } + } + /** Properties of a PhotoChange. */ interface IPhotoChange { @@ -20208,894 +21262,884 @@ export namespace proto { public toJSON(): { [k: string]: any }; } - /** Properties of a MediaData. */ - interface IMediaData { + /** Properties of a PollAdditionalMetadata. */ + interface IPollAdditionalMetadata { - /** MediaData localPath */ - localPath?: (string|null); + /** PollAdditionalMetadata pollInvalidated */ + pollInvalidated?: (boolean|null); } - /** Represents a MediaData. */ - class MediaData implements IMediaData { + /** Represents a PollAdditionalMetadata. */ + class PollAdditionalMetadata implements IPollAdditionalMetadata { /** - * Constructs a new MediaData. + * Constructs a new PollAdditionalMetadata. * @param [properties] Properties to set */ - constructor(properties?: proto.IMediaData); + constructor(properties?: proto.IPollAdditionalMetadata); - /** MediaData localPath. */ - public localPath: string; + /** PollAdditionalMetadata pollInvalidated. */ + public pollInvalidated: boolean; /** - * Creates a new MediaData instance using the specified properties. + * Creates a new PollAdditionalMetadata instance using the specified properties. * @param [properties] Properties to set - * @returns MediaData instance + * @returns PollAdditionalMetadata instance */ - public static create(properties?: proto.IMediaData): proto.MediaData; + public static create(properties?: proto.IPollAdditionalMetadata): proto.PollAdditionalMetadata; /** - * Encodes the specified MediaData message. Does not implicitly {@link proto.MediaData.verify|verify} messages. - * @param message MediaData message or plain object to encode + * Encodes the specified PollAdditionalMetadata message. Does not implicitly {@link proto.PollAdditionalMetadata.verify|verify} messages. + * @param message PollAdditionalMetadata message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: proto.IMediaData, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: proto.IPollAdditionalMetadata, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified MediaData message, length delimited. Does not implicitly {@link proto.MediaData.verify|verify} messages. - * @param message MediaData message or plain object to encode + * Encodes the specified PollAdditionalMetadata message, length delimited. Does not implicitly {@link proto.PollAdditionalMetadata.verify|verify} messages. + * @param message PollAdditionalMetadata message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: proto.IMediaData, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: proto.IPollAdditionalMetadata, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a MediaData message from the specified reader or buffer. + * Decodes a PollAdditionalMetadata message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns MediaData + * @returns PollAdditionalMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.MediaData; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.PollAdditionalMetadata; /** - * Decodes a MediaData message from the specified reader or buffer, length delimited. + * Decodes a PollAdditionalMetadata message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns MediaData + * @returns PollAdditionalMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.MediaData; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.PollAdditionalMetadata; /** - * Verifies a MediaData message. + * Verifies a PollAdditionalMetadata message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a MediaData message from a plain object. Also converts values to their respective internal types. + * Creates a PollAdditionalMetadata message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns MediaData + * @returns PollAdditionalMetadata */ - public static fromObject(object: { [k: string]: any }): proto.MediaData; + public static fromObject(object: { [k: string]: any }): proto.PollAdditionalMetadata; /** - * Creates a plain object from a MediaData message. Also converts values to other types if specified. - * @param message MediaData + * Creates a plain object from a PollAdditionalMetadata message. Also converts values to other types if specified. + * @param message PollAdditionalMetadata * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: proto.MediaData, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: proto.PollAdditionalMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this MediaData to JSON. + * Converts this PollAdditionalMetadata to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a WebFeatures. */ - interface IWebFeatures { - - /** WebFeatures labelsDisplay */ - labelsDisplay?: (proto.WebFeatures.WebFeaturesFlag|null); - - /** WebFeatures voipIndividualOutgoing */ - voipIndividualOutgoing?: (proto.WebFeatures.WebFeaturesFlag|null); - - /** WebFeatures groupsV3 */ - groupsV3?: (proto.WebFeatures.WebFeaturesFlag|null); - - /** WebFeatures groupsV3Create */ - groupsV3Create?: (proto.WebFeatures.WebFeaturesFlag|null); - - /** WebFeatures changeNumberV2 */ - changeNumberV2?: (proto.WebFeatures.WebFeaturesFlag|null); - - /** WebFeatures queryStatusV3Thumbnail */ - queryStatusV3Thumbnail?: (proto.WebFeatures.WebFeaturesFlag|null); - - /** WebFeatures liveLocations */ - liveLocations?: (proto.WebFeatures.WebFeaturesFlag|null); - - /** WebFeatures queryVname */ - queryVname?: (proto.WebFeatures.WebFeaturesFlag|null); - - /** WebFeatures voipIndividualIncoming */ - voipIndividualIncoming?: (proto.WebFeatures.WebFeaturesFlag|null); - - /** WebFeatures quickRepliesQuery */ - quickRepliesQuery?: (proto.WebFeatures.WebFeaturesFlag|null); - - /** WebFeatures payments */ - payments?: (proto.WebFeatures.WebFeaturesFlag|null); - - /** WebFeatures stickerPackQuery */ - stickerPackQuery?: (proto.WebFeatures.WebFeaturesFlag|null); - - /** WebFeatures liveLocationsFinal */ - liveLocationsFinal?: (proto.WebFeatures.WebFeaturesFlag|null); - - /** WebFeatures labelsEdit */ - labelsEdit?: (proto.WebFeatures.WebFeaturesFlag|null); - - /** WebFeatures mediaUpload */ - mediaUpload?: (proto.WebFeatures.WebFeaturesFlag|null); - - /** WebFeatures mediaUploadRichQuickReplies */ - mediaUploadRichQuickReplies?: (proto.WebFeatures.WebFeaturesFlag|null); - - /** WebFeatures vnameV2 */ - vnameV2?: (proto.WebFeatures.WebFeaturesFlag|null); - - /** WebFeatures videoPlaybackUrl */ - videoPlaybackUrl?: (proto.WebFeatures.WebFeaturesFlag|null); - - /** WebFeatures statusRanking */ - statusRanking?: (proto.WebFeatures.WebFeaturesFlag|null); - - /** WebFeatures voipIndividualVideo */ - voipIndividualVideo?: (proto.WebFeatures.WebFeaturesFlag|null); - - /** WebFeatures thirdPartyStickers */ - thirdPartyStickers?: (proto.WebFeatures.WebFeaturesFlag|null); - - /** WebFeatures frequentlyForwardedSetting */ - frequentlyForwardedSetting?: (proto.WebFeatures.WebFeaturesFlag|null); - - /** WebFeatures groupsV4JoinPermission */ - groupsV4JoinPermission?: (proto.WebFeatures.WebFeaturesFlag|null); - - /** WebFeatures recentStickers */ - recentStickers?: (proto.WebFeatures.WebFeaturesFlag|null); - - /** WebFeatures catalog */ - catalog?: (proto.WebFeatures.WebFeaturesFlag|null); - - /** WebFeatures starredStickers */ - starredStickers?: (proto.WebFeatures.WebFeaturesFlag|null); - - /** WebFeatures voipGroupCall */ - voipGroupCall?: (proto.WebFeatures.WebFeaturesFlag|null); - - /** WebFeatures templateMessage */ - templateMessage?: (proto.WebFeatures.WebFeaturesFlag|null); - - /** WebFeatures templateMessageInteractivity */ - templateMessageInteractivity?: (proto.WebFeatures.WebFeaturesFlag|null); - - /** WebFeatures ephemeralMessages */ - ephemeralMessages?: (proto.WebFeatures.WebFeaturesFlag|null); - - /** WebFeatures e2ENotificationSync */ - e2ENotificationSync?: (proto.WebFeatures.WebFeaturesFlag|null); - - /** WebFeatures recentStickersV2 */ - recentStickersV2?: (proto.WebFeatures.WebFeaturesFlag|null); - - /** WebFeatures recentStickersV3 */ - recentStickersV3?: (proto.WebFeatures.WebFeaturesFlag|null); - - /** WebFeatures userNotice */ - userNotice?: (proto.WebFeatures.WebFeaturesFlag|null); - - /** WebFeatures support */ - support?: (proto.WebFeatures.WebFeaturesFlag|null); - - /** WebFeatures groupUiiCleanup */ - groupUiiCleanup?: (proto.WebFeatures.WebFeaturesFlag|null); - - /** WebFeatures groupDogfoodingInternalOnly */ - groupDogfoodingInternalOnly?: (proto.WebFeatures.WebFeaturesFlag|null); - - /** WebFeatures settingsSync */ - settingsSync?: (proto.WebFeatures.WebFeaturesFlag|null); - - /** WebFeatures archiveV2 */ - archiveV2?: (proto.WebFeatures.WebFeaturesFlag|null); - - /** WebFeatures ephemeralAllowGroupMembers */ - ephemeralAllowGroupMembers?: (proto.WebFeatures.WebFeaturesFlag|null); - - /** WebFeatures ephemeral24HDuration */ - ephemeral24HDuration?: (proto.WebFeatures.WebFeaturesFlag|null); - - /** WebFeatures mdForceUpgrade */ - mdForceUpgrade?: (proto.WebFeatures.WebFeaturesFlag|null); - - /** WebFeatures disappearingMode */ - disappearingMode?: (proto.WebFeatures.WebFeaturesFlag|null); - - /** WebFeatures externalMdOptInAvailable */ - externalMdOptInAvailable?: (proto.WebFeatures.WebFeaturesFlag|null); - - /** WebFeatures noDeleteMessageTimeLimit */ - noDeleteMessageTimeLimit?: (proto.WebFeatures.WebFeaturesFlag|null); - } - - /** Represents a WebFeatures. */ - class WebFeatures implements IWebFeatures { - - /** - * Constructs a new WebFeatures. - * @param [properties] Properties to set - */ - constructor(properties?: proto.IWebFeatures); - - /** WebFeatures labelsDisplay. */ - public labelsDisplay: proto.WebFeatures.WebFeaturesFlag; - - /** WebFeatures voipIndividualOutgoing. */ - public voipIndividualOutgoing: proto.WebFeatures.WebFeaturesFlag; + /** Properties of a PollUpdate. */ + interface IPollUpdate { - /** WebFeatures groupsV3. */ - public groupsV3: proto.WebFeatures.WebFeaturesFlag; + /** PollUpdate pollUpdateMessageKey */ + pollUpdateMessageKey?: (proto.IMessageKey|null); - /** WebFeatures groupsV3Create. */ - public groupsV3Create: proto.WebFeatures.WebFeaturesFlag; + /** PollUpdate pollUpdateMessage */ + pollUpdateMessage?: (proto.IPollUpdateMessageContent|null); + } - /** WebFeatures changeNumberV2. */ - public changeNumberV2: proto.WebFeatures.WebFeaturesFlag; + /** Represents a PollUpdate. */ + class PollUpdate implements IPollUpdate { - /** WebFeatures queryStatusV3Thumbnail. */ - public queryStatusV3Thumbnail: proto.WebFeatures.WebFeaturesFlag; + /** + * Constructs a new PollUpdate. + * @param [properties] Properties to set + */ + constructor(properties?: proto.IPollUpdate); - /** WebFeatures liveLocations. */ - public liveLocations: proto.WebFeatures.WebFeaturesFlag; + /** PollUpdate pollUpdateMessageKey. */ + public pollUpdateMessageKey?: (proto.IMessageKey|null); - /** WebFeatures queryVname. */ - public queryVname: proto.WebFeatures.WebFeaturesFlag; + /** PollUpdate pollUpdateMessage. */ + public pollUpdateMessage?: (proto.IPollUpdateMessageContent|null); - /** WebFeatures voipIndividualIncoming. */ - public voipIndividualIncoming: proto.WebFeatures.WebFeaturesFlag; + /** + * Creates a new PollUpdate instance using the specified properties. + * @param [properties] Properties to set + * @returns PollUpdate instance + */ + public static create(properties?: proto.IPollUpdate): proto.PollUpdate; - /** WebFeatures quickRepliesQuery. */ - public quickRepliesQuery: proto.WebFeatures.WebFeaturesFlag; + /** + * Encodes the specified PollUpdate message. Does not implicitly {@link proto.PollUpdate.verify|verify} messages. + * @param message PollUpdate message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: proto.IPollUpdate, writer?: $protobuf.Writer): $protobuf.Writer; - /** WebFeatures payments. */ - public payments: proto.WebFeatures.WebFeaturesFlag; + /** + * Encodes the specified PollUpdate message, length delimited. Does not implicitly {@link proto.PollUpdate.verify|verify} messages. + * @param message PollUpdate message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: proto.IPollUpdate, writer?: $protobuf.Writer): $protobuf.Writer; - /** WebFeatures stickerPackQuery. */ - public stickerPackQuery: proto.WebFeatures.WebFeaturesFlag; + /** + * Decodes a PollUpdate message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PollUpdate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.PollUpdate; - /** WebFeatures liveLocationsFinal. */ - public liveLocationsFinal: proto.WebFeatures.WebFeaturesFlag; + /** + * Decodes a PollUpdate message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PollUpdate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.PollUpdate; - /** WebFeatures labelsEdit. */ - public labelsEdit: proto.WebFeatures.WebFeaturesFlag; + /** + * Verifies a PollUpdate message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** WebFeatures mediaUpload. */ - public mediaUpload: proto.WebFeatures.WebFeaturesFlag; + /** + * Creates a PollUpdate message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PollUpdate + */ + public static fromObject(object: { [k: string]: any }): proto.PollUpdate; - /** WebFeatures mediaUploadRichQuickReplies. */ - public mediaUploadRichQuickReplies: proto.WebFeatures.WebFeaturesFlag; + /** + * Creates a plain object from a PollUpdate message. Also converts values to other types if specified. + * @param message PollUpdate + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: proto.PollUpdate, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** WebFeatures vnameV2. */ - public vnameV2: proto.WebFeatures.WebFeaturesFlag; + /** + * Converts this PollUpdate to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** WebFeatures videoPlaybackUrl. */ - public videoPlaybackUrl: proto.WebFeatures.WebFeaturesFlag; + /** Properties of a Reaction. */ + interface IReaction { - /** WebFeatures statusRanking. */ - public statusRanking: proto.WebFeatures.WebFeaturesFlag; + /** Reaction key */ + key?: (proto.IMessageKey|null); - /** WebFeatures voipIndividualVideo. */ - public voipIndividualVideo: proto.WebFeatures.WebFeaturesFlag; + /** Reaction text */ + text?: (string|null); - /** WebFeatures thirdPartyStickers. */ - public thirdPartyStickers: proto.WebFeatures.WebFeaturesFlag; + /** Reaction groupingKey */ + groupingKey?: (string|null); - /** WebFeatures frequentlyForwardedSetting. */ - public frequentlyForwardedSetting: proto.WebFeatures.WebFeaturesFlag; + /** Reaction senderTimestampMs */ + senderTimestampMs?: (number|Long|null); - /** WebFeatures groupsV4JoinPermission. */ - public groupsV4JoinPermission: proto.WebFeatures.WebFeaturesFlag; + /** Reaction unread */ + unread?: (boolean|null); + } - /** WebFeatures recentStickers. */ - public recentStickers: proto.WebFeatures.WebFeaturesFlag; + /** Represents a Reaction. */ + class Reaction implements IReaction { - /** WebFeatures catalog. */ - public catalog: proto.WebFeatures.WebFeaturesFlag; + /** + * Constructs a new Reaction. + * @param [properties] Properties to set + */ + constructor(properties?: proto.IReaction); - /** WebFeatures starredStickers. */ - public starredStickers: proto.WebFeatures.WebFeaturesFlag; + /** Reaction key. */ + public key?: (proto.IMessageKey|null); - /** WebFeatures voipGroupCall. */ - public voipGroupCall: proto.WebFeatures.WebFeaturesFlag; + /** Reaction text. */ + public text: string; - /** WebFeatures templateMessage. */ - public templateMessage: proto.WebFeatures.WebFeaturesFlag; + /** Reaction groupingKey. */ + public groupingKey: string; - /** WebFeatures templateMessageInteractivity. */ - public templateMessageInteractivity: proto.WebFeatures.WebFeaturesFlag; + /** Reaction senderTimestampMs. */ + public senderTimestampMs: (number|Long); - /** WebFeatures ephemeralMessages. */ - public ephemeralMessages: proto.WebFeatures.WebFeaturesFlag; + /** Reaction unread. */ + public unread: boolean; - /** WebFeatures e2ENotificationSync. */ - public e2ENotificationSync: proto.WebFeatures.WebFeaturesFlag; + /** + * Creates a new Reaction instance using the specified properties. + * @param [properties] Properties to set + * @returns Reaction instance + */ + public static create(properties?: proto.IReaction): proto.Reaction; - /** WebFeatures recentStickersV2. */ - public recentStickersV2: proto.WebFeatures.WebFeaturesFlag; + /** + * Encodes the specified Reaction message. Does not implicitly {@link proto.Reaction.verify|verify} messages. + * @param message Reaction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: proto.IReaction, writer?: $protobuf.Writer): $protobuf.Writer; - /** WebFeatures recentStickersV3. */ - public recentStickersV3: proto.WebFeatures.WebFeaturesFlag; + /** + * Encodes the specified Reaction message, length delimited. Does not implicitly {@link proto.Reaction.verify|verify} messages. + * @param message Reaction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: proto.IReaction, writer?: $protobuf.Writer): $protobuf.Writer; - /** WebFeatures userNotice. */ - public userNotice: proto.WebFeatures.WebFeaturesFlag; + /** + * Decodes a Reaction message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Reaction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.Reaction; - /** WebFeatures support. */ - public support: proto.WebFeatures.WebFeaturesFlag; + /** + * Decodes a Reaction message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Reaction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.Reaction; - /** WebFeatures groupUiiCleanup. */ - public groupUiiCleanup: proto.WebFeatures.WebFeaturesFlag; + /** + * Verifies a Reaction message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** WebFeatures groupDogfoodingInternalOnly. */ - public groupDogfoodingInternalOnly: proto.WebFeatures.WebFeaturesFlag; + /** + * Creates a Reaction message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Reaction + */ + public static fromObject(object: { [k: string]: any }): proto.Reaction; - /** WebFeatures settingsSync. */ - public settingsSync: proto.WebFeatures.WebFeaturesFlag; + /** + * Creates a plain object from a Reaction message. Also converts values to other types if specified. + * @param message Reaction + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: proto.Reaction, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** WebFeatures archiveV2. */ - public archiveV2: proto.WebFeatures.WebFeaturesFlag; + /** + * Converts this Reaction to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** WebFeatures ephemeralAllowGroupMembers. */ - public ephemeralAllowGroupMembers: proto.WebFeatures.WebFeaturesFlag; + /** Properties of a StatusPSA. */ + interface IStatusPSA { - /** WebFeatures ephemeral24HDuration. */ - public ephemeral24HDuration: proto.WebFeatures.WebFeaturesFlag; + /** StatusPSA campaignId */ + campaignId: string; - /** WebFeatures mdForceUpgrade. */ - public mdForceUpgrade: proto.WebFeatures.WebFeaturesFlag; + /** StatusPSA campaignExpirationTimestamp */ + campaignExpirationTimestamp?: (number|Long|null); + } - /** WebFeatures disappearingMode. */ - public disappearingMode: proto.WebFeatures.WebFeaturesFlag; + /** Represents a StatusPSA. */ + class StatusPSA implements IStatusPSA { - /** WebFeatures externalMdOptInAvailable. */ - public externalMdOptInAvailable: proto.WebFeatures.WebFeaturesFlag; + /** + * Constructs a new StatusPSA. + * @param [properties] Properties to set + */ + constructor(properties?: proto.IStatusPSA); - /** WebFeatures noDeleteMessageTimeLimit. */ - public noDeleteMessageTimeLimit: proto.WebFeatures.WebFeaturesFlag; + /** StatusPSA campaignId. */ + public campaignId: string; + + /** StatusPSA campaignExpirationTimestamp. */ + public campaignExpirationTimestamp: (number|Long); /** - * Creates a new WebFeatures instance using the specified properties. + * Creates a new StatusPSA instance using the specified properties. * @param [properties] Properties to set - * @returns WebFeatures instance + * @returns StatusPSA instance */ - public static create(properties?: proto.IWebFeatures): proto.WebFeatures; + public static create(properties?: proto.IStatusPSA): proto.StatusPSA; /** - * Encodes the specified WebFeatures message. Does not implicitly {@link proto.WebFeatures.verify|verify} messages. - * @param message WebFeatures message or plain object to encode + * Encodes the specified StatusPSA message. Does not implicitly {@link proto.StatusPSA.verify|verify} messages. + * @param message StatusPSA message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: proto.IWebFeatures, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: proto.IStatusPSA, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified WebFeatures message, length delimited. Does not implicitly {@link proto.WebFeatures.verify|verify} messages. - * @param message WebFeatures message or plain object to encode + * Encodes the specified StatusPSA message, length delimited. Does not implicitly {@link proto.StatusPSA.verify|verify} messages. + * @param message StatusPSA message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: proto.IWebFeatures, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: proto.IStatusPSA, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a WebFeatures message from the specified reader or buffer. + * Decodes a StatusPSA message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns WebFeatures + * @returns StatusPSA * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.WebFeatures; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.StatusPSA; /** - * Decodes a WebFeatures message from the specified reader or buffer, length delimited. + * Decodes a StatusPSA message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns WebFeatures + * @returns StatusPSA * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.WebFeatures; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.StatusPSA; /** - * Verifies a WebFeatures message. + * Verifies a StatusPSA message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a WebFeatures message from a plain object. Also converts values to their respective internal types. + * Creates a StatusPSA message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns WebFeatures + * @returns StatusPSA */ - public static fromObject(object: { [k: string]: any }): proto.WebFeatures; + public static fromObject(object: { [k: string]: any }): proto.StatusPSA; /** - * Creates a plain object from a WebFeatures message. Also converts values to other types if specified. - * @param message WebFeatures + * Creates a plain object from a StatusPSA message. Also converts values to other types if specified. + * @param message StatusPSA * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: proto.WebFeatures, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: proto.StatusPSA, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this WebFeatures to JSON. + * Converts this StatusPSA to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - namespace WebFeatures { + /** Properties of a UserReceipt. */ + interface IUserReceipt { - /** WebFeaturesFlag enum. */ - enum WebFeaturesFlag { - NOT_STARTED = 0, - FORCE_UPGRADE = 1, - DEVELOPMENT = 2, - PRODUCTION = 3 - } - } + /** UserReceipt userJid */ + userJid: string; - /** Properties of a NotificationMessageInfo. */ - interface INotificationMessageInfo { + /** UserReceipt receiptTimestamp */ + receiptTimestamp?: (number|Long|null); - /** NotificationMessageInfo key */ - key?: (proto.IMessageKey|null); + /** UserReceipt readTimestamp */ + readTimestamp?: (number|Long|null); - /** NotificationMessageInfo message */ - message?: (proto.IMessage|null); + /** UserReceipt playedTimestamp */ + playedTimestamp?: (number|Long|null); - /** NotificationMessageInfo messageTimestamp */ - messageTimestamp?: (number|Long|null); + /** UserReceipt pendingDeviceJid */ + pendingDeviceJid?: (string[]|null); - /** NotificationMessageInfo participant */ - participant?: (string|null); + /** UserReceipt deliveredDeviceJid */ + deliveredDeviceJid?: (string[]|null); } - /** Represents a NotificationMessageInfo. */ - class NotificationMessageInfo implements INotificationMessageInfo { + /** Represents a UserReceipt. */ + class UserReceipt implements IUserReceipt { /** - * Constructs a new NotificationMessageInfo. + * Constructs a new UserReceipt. * @param [properties] Properties to set */ - constructor(properties?: proto.INotificationMessageInfo); + constructor(properties?: proto.IUserReceipt); - /** NotificationMessageInfo key. */ - public key?: (proto.IMessageKey|null); + /** UserReceipt userJid. */ + public userJid: string; - /** NotificationMessageInfo message. */ - public message?: (proto.IMessage|null); + /** UserReceipt receiptTimestamp. */ + public receiptTimestamp: (number|Long); - /** NotificationMessageInfo messageTimestamp. */ - public messageTimestamp: (number|Long); + /** UserReceipt readTimestamp. */ + public readTimestamp: (number|Long); - /** NotificationMessageInfo participant. */ - public participant: string; + /** UserReceipt playedTimestamp. */ + public playedTimestamp: (number|Long); + + /** UserReceipt pendingDeviceJid. */ + public pendingDeviceJid: string[]; + + /** UserReceipt deliveredDeviceJid. */ + public deliveredDeviceJid: string[]; /** - * Creates a new NotificationMessageInfo instance using the specified properties. + * Creates a new UserReceipt instance using the specified properties. * @param [properties] Properties to set - * @returns NotificationMessageInfo instance + * @returns UserReceipt instance */ - public static create(properties?: proto.INotificationMessageInfo): proto.NotificationMessageInfo; + public static create(properties?: proto.IUserReceipt): proto.UserReceipt; /** - * Encodes the specified NotificationMessageInfo message. Does not implicitly {@link proto.NotificationMessageInfo.verify|verify} messages. - * @param message NotificationMessageInfo message or plain object to encode + * Encodes the specified UserReceipt message. Does not implicitly {@link proto.UserReceipt.verify|verify} messages. + * @param message UserReceipt message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: proto.INotificationMessageInfo, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: proto.IUserReceipt, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified NotificationMessageInfo message, length delimited. Does not implicitly {@link proto.NotificationMessageInfo.verify|verify} messages. - * @param message NotificationMessageInfo message or plain object to encode + * Encodes the specified UserReceipt message, length delimited. Does not implicitly {@link proto.UserReceipt.verify|verify} messages. + * @param message UserReceipt message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: proto.INotificationMessageInfo, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: proto.IUserReceipt, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a NotificationMessageInfo message from the specified reader or buffer. + * Decodes a UserReceipt message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns NotificationMessageInfo + * @returns UserReceipt * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.NotificationMessageInfo; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.UserReceipt; /** - * Decodes a NotificationMessageInfo message from the specified reader or buffer, length delimited. + * Decodes a UserReceipt message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns NotificationMessageInfo + * @returns UserReceipt * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.NotificationMessageInfo; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.UserReceipt; + + /** + * Verifies a UserReceipt message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a UserReceipt message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UserReceipt + */ + public static fromObject(object: { [k: string]: any }): proto.UserReceipt; + + /** + * Creates a plain object from a UserReceipt message. Also converts values to other types if specified. + * @param message UserReceipt + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: proto.UserReceipt, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UserReceipt to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a WebFeatures. */ + interface IWebFeatures { + + /** WebFeatures labelsDisplay */ + labelsDisplay?: (proto.WebFeatures.WebFeaturesFlag|null); + + /** WebFeatures voipIndividualOutgoing */ + voipIndividualOutgoing?: (proto.WebFeatures.WebFeaturesFlag|null); + + /** WebFeatures groupsV3 */ + groupsV3?: (proto.WebFeatures.WebFeaturesFlag|null); + + /** WebFeatures groupsV3Create */ + groupsV3Create?: (proto.WebFeatures.WebFeaturesFlag|null); + + /** WebFeatures changeNumberV2 */ + changeNumberV2?: (proto.WebFeatures.WebFeaturesFlag|null); + + /** WebFeatures queryStatusV3Thumbnail */ + queryStatusV3Thumbnail?: (proto.WebFeatures.WebFeaturesFlag|null); + + /** WebFeatures liveLocations */ + liveLocations?: (proto.WebFeatures.WebFeaturesFlag|null); + + /** WebFeatures queryVname */ + queryVname?: (proto.WebFeatures.WebFeaturesFlag|null); + + /** WebFeatures voipIndividualIncoming */ + voipIndividualIncoming?: (proto.WebFeatures.WebFeaturesFlag|null); + + /** WebFeatures quickRepliesQuery */ + quickRepliesQuery?: (proto.WebFeatures.WebFeaturesFlag|null); + + /** WebFeatures payments */ + payments?: (proto.WebFeatures.WebFeaturesFlag|null); + + /** WebFeatures stickerPackQuery */ + stickerPackQuery?: (proto.WebFeatures.WebFeaturesFlag|null); + + /** WebFeatures liveLocationsFinal */ + liveLocationsFinal?: (proto.WebFeatures.WebFeaturesFlag|null); + + /** WebFeatures labelsEdit */ + labelsEdit?: (proto.WebFeatures.WebFeaturesFlag|null); + + /** WebFeatures mediaUpload */ + mediaUpload?: (proto.WebFeatures.WebFeaturesFlag|null); + + /** WebFeatures mediaUploadRichQuickReplies */ + mediaUploadRichQuickReplies?: (proto.WebFeatures.WebFeaturesFlag|null); + + /** WebFeatures vnameV2 */ + vnameV2?: (proto.WebFeatures.WebFeaturesFlag|null); + + /** WebFeatures videoPlaybackUrl */ + videoPlaybackUrl?: (proto.WebFeatures.WebFeaturesFlag|null); + + /** WebFeatures statusRanking */ + statusRanking?: (proto.WebFeatures.WebFeaturesFlag|null); + + /** WebFeatures voipIndividualVideo */ + voipIndividualVideo?: (proto.WebFeatures.WebFeaturesFlag|null); + + /** WebFeatures thirdPartyStickers */ + thirdPartyStickers?: (proto.WebFeatures.WebFeaturesFlag|null); + + /** WebFeatures frequentlyForwardedSetting */ + frequentlyForwardedSetting?: (proto.WebFeatures.WebFeaturesFlag|null); + + /** WebFeatures groupsV4JoinPermission */ + groupsV4JoinPermission?: (proto.WebFeatures.WebFeaturesFlag|null); + + /** WebFeatures recentStickers */ + recentStickers?: (proto.WebFeatures.WebFeaturesFlag|null); + + /** WebFeatures catalog */ + catalog?: (proto.WebFeatures.WebFeaturesFlag|null); + + /** WebFeatures starredStickers */ + starredStickers?: (proto.WebFeatures.WebFeaturesFlag|null); + + /** WebFeatures voipGroupCall */ + voipGroupCall?: (proto.WebFeatures.WebFeaturesFlag|null); + + /** WebFeatures templateMessage */ + templateMessage?: (proto.WebFeatures.WebFeaturesFlag|null); + + /** WebFeatures templateMessageInteractivity */ + templateMessageInteractivity?: (proto.WebFeatures.WebFeaturesFlag|null); + + /** WebFeatures ephemeralMessages */ + ephemeralMessages?: (proto.WebFeatures.WebFeaturesFlag|null); + + /** WebFeatures e2ENotificationSync */ + e2ENotificationSync?: (proto.WebFeatures.WebFeaturesFlag|null); + + /** WebFeatures recentStickersV2 */ + recentStickersV2?: (proto.WebFeatures.WebFeaturesFlag|null); + + /** WebFeatures recentStickersV3 */ + recentStickersV3?: (proto.WebFeatures.WebFeaturesFlag|null); + + /** WebFeatures userNotice */ + userNotice?: (proto.WebFeatures.WebFeaturesFlag|null); - /** - * Verifies a NotificationMessageInfo message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** WebFeatures support */ + support?: (proto.WebFeatures.WebFeaturesFlag|null); - /** - * Creates a NotificationMessageInfo message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns NotificationMessageInfo - */ - public static fromObject(object: { [k: string]: any }): proto.NotificationMessageInfo; + /** WebFeatures groupUiiCleanup */ + groupUiiCleanup?: (proto.WebFeatures.WebFeaturesFlag|null); - /** - * Creates a plain object from a NotificationMessageInfo message. Also converts values to other types if specified. - * @param message NotificationMessageInfo - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: proto.NotificationMessageInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** WebFeatures groupDogfoodingInternalOnly */ + groupDogfoodingInternalOnly?: (proto.WebFeatures.WebFeaturesFlag|null); - /** - * Converts this NotificationMessageInfo to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** WebFeatures settingsSync */ + settingsSync?: (proto.WebFeatures.WebFeaturesFlag|null); - /** Properties of a WebNotificationsInfo. */ - interface IWebNotificationsInfo { + /** WebFeatures archiveV2 */ + archiveV2?: (proto.WebFeatures.WebFeaturesFlag|null); - /** WebNotificationsInfo timestamp */ - timestamp?: (number|Long|null); + /** WebFeatures ephemeralAllowGroupMembers */ + ephemeralAllowGroupMembers?: (proto.WebFeatures.WebFeaturesFlag|null); - /** WebNotificationsInfo unreadChats */ - unreadChats?: (number|null); + /** WebFeatures ephemeral24HDuration */ + ephemeral24HDuration?: (proto.WebFeatures.WebFeaturesFlag|null); - /** WebNotificationsInfo notifyMessageCount */ - notifyMessageCount?: (number|null); + /** WebFeatures mdForceUpgrade */ + mdForceUpgrade?: (proto.WebFeatures.WebFeaturesFlag|null); - /** WebNotificationsInfo notifyMessages */ - notifyMessages?: (proto.IWebMessageInfo[]|null); + /** WebFeatures disappearingMode */ + disappearingMode?: (proto.WebFeatures.WebFeaturesFlag|null); + + /** WebFeatures externalMdOptInAvailable */ + externalMdOptInAvailable?: (proto.WebFeatures.WebFeaturesFlag|null); + + /** WebFeatures noDeleteMessageTimeLimit */ + noDeleteMessageTimeLimit?: (proto.WebFeatures.WebFeaturesFlag|null); } - /** Represents a WebNotificationsInfo. */ - class WebNotificationsInfo implements IWebNotificationsInfo { + /** Represents a WebFeatures. */ + class WebFeatures implements IWebFeatures { /** - * Constructs a new WebNotificationsInfo. + * Constructs a new WebFeatures. * @param [properties] Properties to set */ - constructor(properties?: proto.IWebNotificationsInfo); + constructor(properties?: proto.IWebFeatures); - /** WebNotificationsInfo timestamp. */ - public timestamp: (number|Long); + /** WebFeatures labelsDisplay. */ + public labelsDisplay: proto.WebFeatures.WebFeaturesFlag; - /** WebNotificationsInfo unreadChats. */ - public unreadChats: number; + /** WebFeatures voipIndividualOutgoing. */ + public voipIndividualOutgoing: proto.WebFeatures.WebFeaturesFlag; - /** WebNotificationsInfo notifyMessageCount. */ - public notifyMessageCount: number; + /** WebFeatures groupsV3. */ + public groupsV3: proto.WebFeatures.WebFeaturesFlag; - /** WebNotificationsInfo notifyMessages. */ - public notifyMessages: proto.IWebMessageInfo[]; + /** WebFeatures groupsV3Create. */ + public groupsV3Create: proto.WebFeatures.WebFeaturesFlag; - /** - * Creates a new WebNotificationsInfo instance using the specified properties. - * @param [properties] Properties to set - * @returns WebNotificationsInfo instance - */ - public static create(properties?: proto.IWebNotificationsInfo): proto.WebNotificationsInfo; + /** WebFeatures changeNumberV2. */ + public changeNumberV2: proto.WebFeatures.WebFeaturesFlag; - /** - * Encodes the specified WebNotificationsInfo message. Does not implicitly {@link proto.WebNotificationsInfo.verify|verify} messages. - * @param message WebNotificationsInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: proto.IWebNotificationsInfo, writer?: $protobuf.Writer): $protobuf.Writer; + /** WebFeatures queryStatusV3Thumbnail. */ + public queryStatusV3Thumbnail: proto.WebFeatures.WebFeaturesFlag; - /** - * Encodes the specified WebNotificationsInfo message, length delimited. Does not implicitly {@link proto.WebNotificationsInfo.verify|verify} messages. - * @param message WebNotificationsInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: proto.IWebNotificationsInfo, writer?: $protobuf.Writer): $protobuf.Writer; + /** WebFeatures liveLocations. */ + public liveLocations: proto.WebFeatures.WebFeaturesFlag; - /** - * Decodes a WebNotificationsInfo message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns WebNotificationsInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.WebNotificationsInfo; + /** WebFeatures queryVname. */ + public queryVname: proto.WebFeatures.WebFeaturesFlag; - /** - * Decodes a WebNotificationsInfo message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns WebNotificationsInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.WebNotificationsInfo; + /** WebFeatures voipIndividualIncoming. */ + public voipIndividualIncoming: proto.WebFeatures.WebFeaturesFlag; - /** - * Verifies a WebNotificationsInfo message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** WebFeatures quickRepliesQuery. */ + public quickRepliesQuery: proto.WebFeatures.WebFeaturesFlag; - /** - * Creates a WebNotificationsInfo message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns WebNotificationsInfo - */ - public static fromObject(object: { [k: string]: any }): proto.WebNotificationsInfo; + /** WebFeatures payments. */ + public payments: proto.WebFeatures.WebFeaturesFlag; - /** - * Creates a plain object from a WebNotificationsInfo message. Also converts values to other types if specified. - * @param message WebNotificationsInfo - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: proto.WebNotificationsInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** WebFeatures stickerPackQuery. */ + public stickerPackQuery: proto.WebFeatures.WebFeaturesFlag; - /** - * Converts this WebNotificationsInfo to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** WebFeatures liveLocationsFinal. */ + public liveLocationsFinal: proto.WebFeatures.WebFeaturesFlag; - /** Properties of a PaymentInfo. */ - interface IPaymentInfo { + /** WebFeatures labelsEdit. */ + public labelsEdit: proto.WebFeatures.WebFeaturesFlag; - /** PaymentInfo currencyDeprecated */ - currencyDeprecated?: (proto.PaymentInfo.PaymentInfoCurrency|null); + /** WebFeatures mediaUpload. */ + public mediaUpload: proto.WebFeatures.WebFeaturesFlag; - /** PaymentInfo amount1000 */ - amount1000?: (number|Long|null); + /** WebFeatures mediaUploadRichQuickReplies. */ + public mediaUploadRichQuickReplies: proto.WebFeatures.WebFeaturesFlag; - /** PaymentInfo receiverJid */ - receiverJid?: (string|null); + /** WebFeatures vnameV2. */ + public vnameV2: proto.WebFeatures.WebFeaturesFlag; - /** PaymentInfo status */ - status?: (proto.PaymentInfo.PaymentInfoStatus|null); + /** WebFeatures videoPlaybackUrl. */ + public videoPlaybackUrl: proto.WebFeatures.WebFeaturesFlag; - /** PaymentInfo transactionTimestamp */ - transactionTimestamp?: (number|Long|null); + /** WebFeatures statusRanking. */ + public statusRanking: proto.WebFeatures.WebFeaturesFlag; - /** PaymentInfo requestMessageKey */ - requestMessageKey?: (proto.IMessageKey|null); + /** WebFeatures voipIndividualVideo. */ + public voipIndividualVideo: proto.WebFeatures.WebFeaturesFlag; - /** PaymentInfo expiryTimestamp */ - expiryTimestamp?: (number|Long|null); + /** WebFeatures thirdPartyStickers. */ + public thirdPartyStickers: proto.WebFeatures.WebFeaturesFlag; - /** PaymentInfo futureproofed */ - futureproofed?: (boolean|null); + /** WebFeatures frequentlyForwardedSetting. */ + public frequentlyForwardedSetting: proto.WebFeatures.WebFeaturesFlag; - /** PaymentInfo currency */ - currency?: (string|null); + /** WebFeatures groupsV4JoinPermission. */ + public groupsV4JoinPermission: proto.WebFeatures.WebFeaturesFlag; - /** PaymentInfo txnStatus */ - txnStatus?: (proto.PaymentInfo.PaymentInfoTxnStatus|null); + /** WebFeatures recentStickers. */ + public recentStickers: proto.WebFeatures.WebFeaturesFlag; - /** PaymentInfo useNoviFiatFormat */ - useNoviFiatFormat?: (boolean|null); + /** WebFeatures catalog. */ + public catalog: proto.WebFeatures.WebFeaturesFlag; - /** PaymentInfo primaryAmount */ - primaryAmount?: (proto.IMoney|null); + /** WebFeatures starredStickers. */ + public starredStickers: proto.WebFeatures.WebFeaturesFlag; - /** PaymentInfo exchangeAmount */ - exchangeAmount?: (proto.IMoney|null); - } + /** WebFeatures voipGroupCall. */ + public voipGroupCall: proto.WebFeatures.WebFeaturesFlag; - /** Represents a PaymentInfo. */ - class PaymentInfo implements IPaymentInfo { + /** WebFeatures templateMessage. */ + public templateMessage: proto.WebFeatures.WebFeaturesFlag; - /** - * Constructs a new PaymentInfo. - * @param [properties] Properties to set - */ - constructor(properties?: proto.IPaymentInfo); + /** WebFeatures templateMessageInteractivity. */ + public templateMessageInteractivity: proto.WebFeatures.WebFeaturesFlag; - /** PaymentInfo currencyDeprecated. */ - public currencyDeprecated: proto.PaymentInfo.PaymentInfoCurrency; + /** WebFeatures ephemeralMessages. */ + public ephemeralMessages: proto.WebFeatures.WebFeaturesFlag; - /** PaymentInfo amount1000. */ - public amount1000: (number|Long); + /** WebFeatures e2ENotificationSync. */ + public e2ENotificationSync: proto.WebFeatures.WebFeaturesFlag; - /** PaymentInfo receiverJid. */ - public receiverJid: string; + /** WebFeatures recentStickersV2. */ + public recentStickersV2: proto.WebFeatures.WebFeaturesFlag; - /** PaymentInfo status. */ - public status: proto.PaymentInfo.PaymentInfoStatus; + /** WebFeatures recentStickersV3. */ + public recentStickersV3: proto.WebFeatures.WebFeaturesFlag; + + /** WebFeatures userNotice. */ + public userNotice: proto.WebFeatures.WebFeaturesFlag; + + /** WebFeatures support. */ + public support: proto.WebFeatures.WebFeaturesFlag; + + /** WebFeatures groupUiiCleanup. */ + public groupUiiCleanup: proto.WebFeatures.WebFeaturesFlag; - /** PaymentInfo transactionTimestamp. */ - public transactionTimestamp: (number|Long); + /** WebFeatures groupDogfoodingInternalOnly. */ + public groupDogfoodingInternalOnly: proto.WebFeatures.WebFeaturesFlag; - /** PaymentInfo requestMessageKey. */ - public requestMessageKey?: (proto.IMessageKey|null); + /** WebFeatures settingsSync. */ + public settingsSync: proto.WebFeatures.WebFeaturesFlag; - /** PaymentInfo expiryTimestamp. */ - public expiryTimestamp: (number|Long); + /** WebFeatures archiveV2. */ + public archiveV2: proto.WebFeatures.WebFeaturesFlag; - /** PaymentInfo futureproofed. */ - public futureproofed: boolean; + /** WebFeatures ephemeralAllowGroupMembers. */ + public ephemeralAllowGroupMembers: proto.WebFeatures.WebFeaturesFlag; - /** PaymentInfo currency. */ - public currency: string; + /** WebFeatures ephemeral24HDuration. */ + public ephemeral24HDuration: proto.WebFeatures.WebFeaturesFlag; - /** PaymentInfo txnStatus. */ - public txnStatus: proto.PaymentInfo.PaymentInfoTxnStatus; + /** WebFeatures mdForceUpgrade. */ + public mdForceUpgrade: proto.WebFeatures.WebFeaturesFlag; - /** PaymentInfo useNoviFiatFormat. */ - public useNoviFiatFormat: boolean; + /** WebFeatures disappearingMode. */ + public disappearingMode: proto.WebFeatures.WebFeaturesFlag; - /** PaymentInfo primaryAmount. */ - public primaryAmount?: (proto.IMoney|null); + /** WebFeatures externalMdOptInAvailable. */ + public externalMdOptInAvailable: proto.WebFeatures.WebFeaturesFlag; - /** PaymentInfo exchangeAmount. */ - public exchangeAmount?: (proto.IMoney|null); + /** WebFeatures noDeleteMessageTimeLimit. */ + public noDeleteMessageTimeLimit: proto.WebFeatures.WebFeaturesFlag; /** - * Creates a new PaymentInfo instance using the specified properties. + * Creates a new WebFeatures instance using the specified properties. * @param [properties] Properties to set - * @returns PaymentInfo instance + * @returns WebFeatures instance */ - public static create(properties?: proto.IPaymentInfo): proto.PaymentInfo; + public static create(properties?: proto.IWebFeatures): proto.WebFeatures; /** - * Encodes the specified PaymentInfo message. Does not implicitly {@link proto.PaymentInfo.verify|verify} messages. - * @param message PaymentInfo message or plain object to encode + * Encodes the specified WebFeatures message. Does not implicitly {@link proto.WebFeatures.verify|verify} messages. + * @param message WebFeatures message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: proto.IPaymentInfo, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: proto.IWebFeatures, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified PaymentInfo message, length delimited. Does not implicitly {@link proto.PaymentInfo.verify|verify} messages. - * @param message PaymentInfo message or plain object to encode + * Encodes the specified WebFeatures message, length delimited. Does not implicitly {@link proto.WebFeatures.verify|verify} messages. + * @param message WebFeatures message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: proto.IPaymentInfo, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: proto.IWebFeatures, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a PaymentInfo message from the specified reader or buffer. + * Decodes a WebFeatures message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns PaymentInfo + * @returns WebFeatures * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.PaymentInfo; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.WebFeatures; /** - * Decodes a PaymentInfo message from the specified reader or buffer, length delimited. + * Decodes a WebFeatures message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns PaymentInfo + * @returns WebFeatures * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.PaymentInfo; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.WebFeatures; /** - * Verifies a PaymentInfo message. + * Verifies a WebFeatures message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a PaymentInfo message from a plain object. Also converts values to their respective internal types. + * Creates a WebFeatures message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns PaymentInfo + * @returns WebFeatures */ - public static fromObject(object: { [k: string]: any }): proto.PaymentInfo; + public static fromObject(object: { [k: string]: any }): proto.WebFeatures; /** - * Creates a plain object from a PaymentInfo message. Also converts values to other types if specified. - * @param message PaymentInfo + * Creates a plain object from a WebFeatures message. Also converts values to other types if specified. + * @param message WebFeatures * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: proto.PaymentInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: proto.WebFeatures, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this PaymentInfo to JSON. + * Converts this WebFeatures to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - namespace PaymentInfo { - - /** PaymentInfoCurrency enum. */ - enum PaymentInfoCurrency { - UNKNOWN_CURRENCY = 0, - INR = 1 - } - - /** PaymentInfoStatus enum. */ - enum PaymentInfoStatus { - UNKNOWN_STATUS = 0, - PROCESSING = 1, - SENT = 2, - NEED_TO_ACCEPT = 3, - COMPLETE = 4, - COULD_NOT_COMPLETE = 5, - REFUNDED = 6, - EXPIRED = 7, - REJECTED = 8, - CANCELLED = 9, - WAITING_FOR_PAYER = 10, - WAITING = 11 - } + namespace WebFeatures { - /** PaymentInfoTxnStatus enum. */ - enum PaymentInfoTxnStatus { - UNKNOWN = 0, - PENDING_SETUP = 1, - PENDING_RECEIVER_SETUP = 2, - INIT = 3, - SUCCESS = 4, - COMPLETED = 5, - FAILED = 6, - FAILED_RISK = 7, - FAILED_PROCESSING = 8, - FAILED_RECEIVER_PROCESSING = 9, - FAILED_DA = 10, - FAILED_DA_FINAL = 11, - REFUNDED_TXN = 12, - REFUND_FAILED = 13, - REFUND_FAILED_PROCESSING = 14, - REFUND_FAILED_DA = 15, - EXPIRED_TXN = 16, - AUTH_CANCELED = 17, - AUTH_CANCEL_FAILED_PROCESSING = 18, - AUTH_CANCEL_FAILED = 19, - COLLECT_INIT = 20, - COLLECT_SUCCESS = 21, - COLLECT_FAILED = 22, - COLLECT_FAILED_RISK = 23, - COLLECT_REJECTED = 24, - COLLECT_EXPIRED = 25, - COLLECT_CANCELED = 26, - COLLECT_CANCELLING = 27, - IN_REVIEW = 28 + /** WebFeaturesFlag enum. */ + enum WebFeaturesFlag { + NOT_STARTED = 0, + FORCE_UPGRADE = 1, + DEVELOPMENT = 2, + PRODUCTION = 3 } } @@ -21206,6 +22250,12 @@ export namespace proto { /** WebMessageInfo statusPsa */ statusPsa?: (proto.IStatusPSA|null); + + /** WebMessageInfo pollUpdates */ + pollUpdates?: (proto.IPollUpdate[]|null); + + /** WebMessageInfo pollAdditionalMetadata */ + pollAdditionalMetadata?: (proto.IPollAdditionalMetadata|null); } /** Represents a WebMessageInfo. */ @@ -21322,6 +22372,12 @@ export namespace proto { /** WebMessageInfo statusPsa. */ public statusPsa?: (proto.IStatusPSA|null); + /** WebMessageInfo pollUpdates. */ + public pollUpdates: proto.IPollUpdate[]; + + /** WebMessageInfo pollAdditionalMetadata. */ + public pollAdditionalMetadata?: (proto.IPollAdditionalMetadata|null); + /** * Creates a new WebMessageInfo instance using the specified properties. * @param [properties] Properties to set @@ -21540,7 +22596,10 @@ export namespace proto { DISAPPEARING_MODE = 130, E2E_DEVICE_FETCH_FAILED = 131, ADMIN_REVOKE = 132, - GROUP_INVITE_LINK_GROWTH_LOCKED = 133 + GROUP_INVITE_LINK_GROWTH_LOCKED = 133, + COMMUNITY_LINK_PARENT_GROUP = 134, + COMMUNITY_LINK_SIBLING_GROUP = 135, + COMMUNITY_LINK_SUB_GROUP = 136 } /** WebMessageInfoBizPrivacyStatus enum. */ @@ -21551,4 +22610,112 @@ export namespace proto { BSP_AND_FB = 3 } } + + /** Properties of a WebNotificationsInfo. */ + interface IWebNotificationsInfo { + + /** WebNotificationsInfo timestamp */ + timestamp?: (number|Long|null); + + /** WebNotificationsInfo unreadChats */ + unreadChats?: (number|null); + + /** WebNotificationsInfo notifyMessageCount */ + notifyMessageCount?: (number|null); + + /** WebNotificationsInfo notifyMessages */ + notifyMessages?: (proto.IWebMessageInfo[]|null); + } + + /** Represents a WebNotificationsInfo. */ + class WebNotificationsInfo implements IWebNotificationsInfo { + + /** + * Constructs a new WebNotificationsInfo. + * @param [properties] Properties to set + */ + constructor(properties?: proto.IWebNotificationsInfo); + + /** WebNotificationsInfo timestamp. */ + public timestamp: (number|Long); + + /** WebNotificationsInfo unreadChats. */ + public unreadChats: number; + + /** WebNotificationsInfo notifyMessageCount. */ + public notifyMessageCount: number; + + /** WebNotificationsInfo notifyMessages. */ + public notifyMessages: proto.IWebMessageInfo[]; + + /** + * Creates a new WebNotificationsInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns WebNotificationsInfo instance + */ + public static create(properties?: proto.IWebNotificationsInfo): proto.WebNotificationsInfo; + + /** + * Encodes the specified WebNotificationsInfo message. Does not implicitly {@link proto.WebNotificationsInfo.verify|verify} messages. + * @param message WebNotificationsInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: proto.IWebNotificationsInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WebNotificationsInfo message, length delimited. Does not implicitly {@link proto.WebNotificationsInfo.verify|verify} messages. + * @param message WebNotificationsInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: proto.IWebNotificationsInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WebNotificationsInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WebNotificationsInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): proto.WebNotificationsInfo; + + /** + * Decodes a WebNotificationsInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WebNotificationsInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): proto.WebNotificationsInfo; + + /** + * Verifies a WebNotificationsInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a WebNotificationsInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WebNotificationsInfo + */ + public static fromObject(object: { [k: string]: any }): proto.WebNotificationsInfo; + + /** + * Creates a plain object from a WebNotificationsInfo message. Also converts values to other types if specified. + * @param message WebNotificationsInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: proto.WebNotificationsInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WebNotificationsInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } } diff --git a/node_modules/@adiwajshing/baileys/WAProto/index.js b/node_modules/@adiwajshing/baileys/WAProto/index.js index 0af8a116a..1353f36d7 100644 --- a/node_modules/@adiwajshing/baileys/WAProto/index.js +++ b/node_modules/@adiwajshing/baileys/WAProto/index.js @@ -18,28 +18,26 @@ $root.proto = (function() { */ var proto = {}; - proto.AppVersion = (function() { + proto.ADVDeviceIdentity = (function() { /** - * Properties of an AppVersion. + * Properties of a ADVDeviceIdentity. * @memberof proto - * @interface IAppVersion - * @property {number|null} [primary] AppVersion primary - * @property {number|null} [secondary] AppVersion secondary - * @property {number|null} [tertiary] AppVersion tertiary - * @property {number|null} [quaternary] AppVersion quaternary - * @property {number|null} [quinary] AppVersion quinary + * @interface IADVDeviceIdentity + * @property {number|null} [rawId] ADVDeviceIdentity rawId + * @property {number|Long|null} [timestamp] ADVDeviceIdentity timestamp + * @property {number|null} [keyIndex] ADVDeviceIdentity keyIndex */ /** - * Constructs a new AppVersion. + * Constructs a new ADVDeviceIdentity. * @memberof proto - * @classdesc Represents an AppVersion. - * @implements IAppVersion + * @classdesc Represents a ADVDeviceIdentity. + * @implements IADVDeviceIdentity * @constructor - * @param {proto.IAppVersion=} [properties] Properties to set + * @param {proto.IADVDeviceIdentity=} [properties] Properties to set */ - function AppVersion(properties) { + function ADVDeviceIdentity(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -47,127 +45,101 @@ $root.proto = (function() { } /** - * AppVersion primary. - * @member {number} primary - * @memberof proto.AppVersion - * @instance - */ - AppVersion.prototype.primary = 0; - - /** - * AppVersion secondary. - * @member {number} secondary - * @memberof proto.AppVersion - * @instance - */ - AppVersion.prototype.secondary = 0; - - /** - * AppVersion tertiary. - * @member {number} tertiary - * @memberof proto.AppVersion + * ADVDeviceIdentity rawId. + * @member {number} rawId + * @memberof proto.ADVDeviceIdentity * @instance */ - AppVersion.prototype.tertiary = 0; + ADVDeviceIdentity.prototype.rawId = 0; /** - * AppVersion quaternary. - * @member {number} quaternary - * @memberof proto.AppVersion + * ADVDeviceIdentity timestamp. + * @member {number|Long} timestamp + * @memberof proto.ADVDeviceIdentity * @instance */ - AppVersion.prototype.quaternary = 0; + ADVDeviceIdentity.prototype.timestamp = $util.Long ? $util.Long.fromBits(0,0,true) : 0; /** - * AppVersion quinary. - * @member {number} quinary - * @memberof proto.AppVersion + * ADVDeviceIdentity keyIndex. + * @member {number} keyIndex + * @memberof proto.ADVDeviceIdentity * @instance */ - AppVersion.prototype.quinary = 0; + ADVDeviceIdentity.prototype.keyIndex = 0; /** - * Creates a new AppVersion instance using the specified properties. + * Creates a new ADVDeviceIdentity instance using the specified properties. * @function create - * @memberof proto.AppVersion + * @memberof proto.ADVDeviceIdentity * @static - * @param {proto.IAppVersion=} [properties] Properties to set - * @returns {proto.AppVersion} AppVersion instance + * @param {proto.IADVDeviceIdentity=} [properties] Properties to set + * @returns {proto.ADVDeviceIdentity} ADVDeviceIdentity instance */ - AppVersion.create = function create(properties) { - return new AppVersion(properties); + ADVDeviceIdentity.create = function create(properties) { + return new ADVDeviceIdentity(properties); }; /** - * Encodes the specified AppVersion message. Does not implicitly {@link proto.AppVersion.verify|verify} messages. + * Encodes the specified ADVDeviceIdentity message. Does not implicitly {@link proto.ADVDeviceIdentity.verify|verify} messages. * @function encode - * @memberof proto.AppVersion + * @memberof proto.ADVDeviceIdentity * @static - * @param {proto.IAppVersion} message AppVersion message or plain object to encode + * @param {proto.IADVDeviceIdentity} message ADVDeviceIdentity message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AppVersion.encode = function encode(message, writer) { + ADVDeviceIdentity.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.primary != null && Object.hasOwnProperty.call(message, "primary")) - writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.primary); - if (message.secondary != null && Object.hasOwnProperty.call(message, "secondary")) - writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.secondary); - if (message.tertiary != null && Object.hasOwnProperty.call(message, "tertiary")) - writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.tertiary); - if (message.quaternary != null && Object.hasOwnProperty.call(message, "quaternary")) - writer.uint32(/* id 4, wireType 0 =*/32).uint32(message.quaternary); - if (message.quinary != null && Object.hasOwnProperty.call(message, "quinary")) - writer.uint32(/* id 5, wireType 0 =*/40).uint32(message.quinary); + if (message.rawId != null && Object.hasOwnProperty.call(message, "rawId")) + writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.rawId); + if (message.timestamp != null && Object.hasOwnProperty.call(message, "timestamp")) + writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.timestamp); + if (message.keyIndex != null && Object.hasOwnProperty.call(message, "keyIndex")) + writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.keyIndex); return writer; }; /** - * Encodes the specified AppVersion message, length delimited. Does not implicitly {@link proto.AppVersion.verify|verify} messages. + * Encodes the specified ADVDeviceIdentity message, length delimited. Does not implicitly {@link proto.ADVDeviceIdentity.verify|verify} messages. * @function encodeDelimited - * @memberof proto.AppVersion + * @memberof proto.ADVDeviceIdentity * @static - * @param {proto.IAppVersion} message AppVersion message or plain object to encode + * @param {proto.IADVDeviceIdentity} message ADVDeviceIdentity message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AppVersion.encodeDelimited = function encodeDelimited(message, writer) { + ADVDeviceIdentity.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an AppVersion message from the specified reader or buffer. + * Decodes a ADVDeviceIdentity message from the specified reader or buffer. * @function decode - * @memberof proto.AppVersion + * @memberof proto.ADVDeviceIdentity * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {proto.AppVersion} AppVersion + * @returns {proto.ADVDeviceIdentity} ADVDeviceIdentity * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - AppVersion.decode = function decode(reader, length) { + ADVDeviceIdentity.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.AppVersion(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.ADVDeviceIdentity(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.primary = reader.uint32(); + message.rawId = reader.uint32(); break; case 2: - message.secondary = reader.uint32(); + message.timestamp = reader.uint64(); break; case 3: - message.tertiary = reader.uint32(); - break; - case 4: - message.quaternary = reader.uint32(); - break; - case 5: - message.quinary = reader.uint32(); + message.keyIndex = reader.uint32(); break; default: reader.skipType(tag & 7); @@ -178,152 +150,142 @@ $root.proto = (function() { }; /** - * Decodes an AppVersion message from the specified reader or buffer, length delimited. + * Decodes a ADVDeviceIdentity message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof proto.AppVersion + * @memberof proto.ADVDeviceIdentity * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.AppVersion} AppVersion + * @returns {proto.ADVDeviceIdentity} ADVDeviceIdentity * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - AppVersion.decodeDelimited = function decodeDelimited(reader) { + ADVDeviceIdentity.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an AppVersion message. + * Verifies a ADVDeviceIdentity message. * @function verify - * @memberof proto.AppVersion + * @memberof proto.ADVDeviceIdentity * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - AppVersion.verify = function verify(message) { + ADVDeviceIdentity.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.primary != null && message.hasOwnProperty("primary")) - if (!$util.isInteger(message.primary)) - return "primary: integer expected"; - if (message.secondary != null && message.hasOwnProperty("secondary")) - if (!$util.isInteger(message.secondary)) - return "secondary: integer expected"; - if (message.tertiary != null && message.hasOwnProperty("tertiary")) - if (!$util.isInteger(message.tertiary)) - return "tertiary: integer expected"; - if (message.quaternary != null && message.hasOwnProperty("quaternary")) - if (!$util.isInteger(message.quaternary)) - return "quaternary: integer expected"; - if (message.quinary != null && message.hasOwnProperty("quinary")) - if (!$util.isInteger(message.quinary)) - return "quinary: integer expected"; + if (message.rawId != null && message.hasOwnProperty("rawId")) + if (!$util.isInteger(message.rawId)) + return "rawId: integer expected"; + if (message.timestamp != null && message.hasOwnProperty("timestamp")) + if (!$util.isInteger(message.timestamp) && !(message.timestamp && $util.isInteger(message.timestamp.low) && $util.isInteger(message.timestamp.high))) + return "timestamp: integer|Long expected"; + if (message.keyIndex != null && message.hasOwnProperty("keyIndex")) + if (!$util.isInteger(message.keyIndex)) + return "keyIndex: integer expected"; return null; }; /** - * Creates an AppVersion message from a plain object. Also converts values to their respective internal types. + * Creates a ADVDeviceIdentity message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof proto.AppVersion + * @memberof proto.ADVDeviceIdentity * @static * @param {Object.} object Plain object - * @returns {proto.AppVersion} AppVersion + * @returns {proto.ADVDeviceIdentity} ADVDeviceIdentity */ - AppVersion.fromObject = function fromObject(object) { - if (object instanceof $root.proto.AppVersion) + ADVDeviceIdentity.fromObject = function fromObject(object) { + if (object instanceof $root.proto.ADVDeviceIdentity) return object; - var message = new $root.proto.AppVersion(); - if (object.primary != null) - message.primary = object.primary >>> 0; - if (object.secondary != null) - message.secondary = object.secondary >>> 0; - if (object.tertiary != null) - message.tertiary = object.tertiary >>> 0; - if (object.quaternary != null) - message.quaternary = object.quaternary >>> 0; - if (object.quinary != null) - message.quinary = object.quinary >>> 0; + var message = new $root.proto.ADVDeviceIdentity(); + if (object.rawId != null) + message.rawId = object.rawId >>> 0; + if (object.timestamp != null) + if ($util.Long) + (message.timestamp = $util.Long.fromValue(object.timestamp)).unsigned = true; + else if (typeof object.timestamp === "string") + message.timestamp = parseInt(object.timestamp, 10); + else if (typeof object.timestamp === "number") + message.timestamp = object.timestamp; + else if (typeof object.timestamp === "object") + message.timestamp = new $util.LongBits(object.timestamp.low >>> 0, object.timestamp.high >>> 0).toNumber(true); + if (object.keyIndex != null) + message.keyIndex = object.keyIndex >>> 0; return message; }; /** - * Creates a plain object from an AppVersion message. Also converts values to other types if specified. + * Creates a plain object from a ADVDeviceIdentity message. Also converts values to other types if specified. * @function toObject - * @memberof proto.AppVersion + * @memberof proto.ADVDeviceIdentity * @static - * @param {proto.AppVersion} message AppVersion + * @param {proto.ADVDeviceIdentity} message ADVDeviceIdentity * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - AppVersion.toObject = function toObject(message, options) { + ADVDeviceIdentity.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.primary = 0; - object.secondary = 0; - object.tertiary = 0; - object.quaternary = 0; - object.quinary = 0; + object.rawId = 0; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.timestamp = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.timestamp = options.longs === String ? "0" : 0; + object.keyIndex = 0; } - if (message.primary != null && message.hasOwnProperty("primary")) - object.primary = message.primary; - if (message.secondary != null && message.hasOwnProperty("secondary")) - object.secondary = message.secondary; - if (message.tertiary != null && message.hasOwnProperty("tertiary")) - object.tertiary = message.tertiary; - if (message.quaternary != null && message.hasOwnProperty("quaternary")) - object.quaternary = message.quaternary; - if (message.quinary != null && message.hasOwnProperty("quinary")) - object.quinary = message.quinary; + if (message.rawId != null && message.hasOwnProperty("rawId")) + object.rawId = message.rawId; + if (message.timestamp != null && message.hasOwnProperty("timestamp")) + if (typeof message.timestamp === "number") + object.timestamp = options.longs === String ? String(message.timestamp) : message.timestamp; + else + object.timestamp = options.longs === String ? $util.Long.prototype.toString.call(message.timestamp) : options.longs === Number ? new $util.LongBits(message.timestamp.low >>> 0, message.timestamp.high >>> 0).toNumber(true) : message.timestamp; + if (message.keyIndex != null && message.hasOwnProperty("keyIndex")) + object.keyIndex = message.keyIndex; return object; }; /** - * Converts this AppVersion to JSON. + * Converts this ADVDeviceIdentity to JSON. * @function toJSON - * @memberof proto.AppVersion + * @memberof proto.ADVDeviceIdentity * @instance * @returns {Object.} JSON object */ - AppVersion.prototype.toJSON = function toJSON() { + ADVDeviceIdentity.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return AppVersion; + return ADVDeviceIdentity; })(); - proto.UserAgent = (function() { + proto.ADVKeyIndexList = (function() { /** - * Properties of a UserAgent. + * Properties of a ADVKeyIndexList. * @memberof proto - * @interface IUserAgent - * @property {proto.UserAgent.UserAgentPlatform|null} [platform] UserAgent platform - * @property {proto.IAppVersion|null} [appVersion] UserAgent appVersion - * @property {string|null} [mcc] UserAgent mcc - * @property {string|null} [mnc] UserAgent mnc - * @property {string|null} [osVersion] UserAgent osVersion - * @property {string|null} [manufacturer] UserAgent manufacturer - * @property {string|null} [device] UserAgent device - * @property {string|null} [osBuildNumber] UserAgent osBuildNumber - * @property {string|null} [phoneId] UserAgent phoneId - * @property {proto.UserAgent.UserAgentReleaseChannel|null} [releaseChannel] UserAgent releaseChannel - * @property {string|null} [localeLanguageIso6391] UserAgent localeLanguageIso6391 - * @property {string|null} [localeCountryIso31661Alpha2] UserAgent localeCountryIso31661Alpha2 - * @property {string|null} [deviceBoard] UserAgent deviceBoard + * @interface IADVKeyIndexList + * @property {number|null} [rawId] ADVKeyIndexList rawId + * @property {number|Long|null} [timestamp] ADVKeyIndexList timestamp + * @property {number|null} [currentIndex] ADVKeyIndexList currentIndex + * @property {Array.|null} [validIndexes] ADVKeyIndexList validIndexes */ /** - * Constructs a new UserAgent. + * Constructs a new ADVKeyIndexList. * @memberof proto - * @classdesc Represents a UserAgent. - * @implements IUserAgent + * @classdesc Represents a ADVKeyIndexList. + * @implements IADVKeyIndexList * @constructor - * @param {proto.IUserAgent=} [properties] Properties to set + * @param {proto.IADVKeyIndexList=} [properties] Properties to set */ - function UserAgent(properties) { + function ADVKeyIndexList(properties) { + this.validIndexes = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -331,231 +293,125 @@ $root.proto = (function() { } /** - * UserAgent platform. - * @member {proto.UserAgent.UserAgentPlatform} platform - * @memberof proto.UserAgent - * @instance - */ - UserAgent.prototype.platform = 0; - - /** - * UserAgent appVersion. - * @member {proto.IAppVersion|null|undefined} appVersion - * @memberof proto.UserAgent - * @instance - */ - UserAgent.prototype.appVersion = null; - - /** - * UserAgent mcc. - * @member {string} mcc - * @memberof proto.UserAgent - * @instance - */ - UserAgent.prototype.mcc = ""; - - /** - * UserAgent mnc. - * @member {string} mnc - * @memberof proto.UserAgent - * @instance - */ - UserAgent.prototype.mnc = ""; - - /** - * UserAgent osVersion. - * @member {string} osVersion - * @memberof proto.UserAgent - * @instance - */ - UserAgent.prototype.osVersion = ""; - - /** - * UserAgent manufacturer. - * @member {string} manufacturer - * @memberof proto.UserAgent - * @instance - */ - UserAgent.prototype.manufacturer = ""; - - /** - * UserAgent device. - * @member {string} device - * @memberof proto.UserAgent - * @instance - */ - UserAgent.prototype.device = ""; - - /** - * UserAgent osBuildNumber. - * @member {string} osBuildNumber - * @memberof proto.UserAgent - * @instance - */ - UserAgent.prototype.osBuildNumber = ""; - - /** - * UserAgent phoneId. - * @member {string} phoneId - * @memberof proto.UserAgent - * @instance - */ - UserAgent.prototype.phoneId = ""; - - /** - * UserAgent releaseChannel. - * @member {proto.UserAgent.UserAgentReleaseChannel} releaseChannel - * @memberof proto.UserAgent + * ADVKeyIndexList rawId. + * @member {number} rawId + * @memberof proto.ADVKeyIndexList * @instance */ - UserAgent.prototype.releaseChannel = 0; + ADVKeyIndexList.prototype.rawId = 0; /** - * UserAgent localeLanguageIso6391. - * @member {string} localeLanguageIso6391 - * @memberof proto.UserAgent + * ADVKeyIndexList timestamp. + * @member {number|Long} timestamp + * @memberof proto.ADVKeyIndexList * @instance */ - UserAgent.prototype.localeLanguageIso6391 = ""; + ADVKeyIndexList.prototype.timestamp = $util.Long ? $util.Long.fromBits(0,0,true) : 0; /** - * UserAgent localeCountryIso31661Alpha2. - * @member {string} localeCountryIso31661Alpha2 - * @memberof proto.UserAgent + * ADVKeyIndexList currentIndex. + * @member {number} currentIndex + * @memberof proto.ADVKeyIndexList * @instance */ - UserAgent.prototype.localeCountryIso31661Alpha2 = ""; + ADVKeyIndexList.prototype.currentIndex = 0; /** - * UserAgent deviceBoard. - * @member {string} deviceBoard - * @memberof proto.UserAgent + * ADVKeyIndexList validIndexes. + * @member {Array.} validIndexes + * @memberof proto.ADVKeyIndexList * @instance */ - UserAgent.prototype.deviceBoard = ""; + ADVKeyIndexList.prototype.validIndexes = $util.emptyArray; /** - * Creates a new UserAgent instance using the specified properties. + * Creates a new ADVKeyIndexList instance using the specified properties. * @function create - * @memberof proto.UserAgent + * @memberof proto.ADVKeyIndexList * @static - * @param {proto.IUserAgent=} [properties] Properties to set - * @returns {proto.UserAgent} UserAgent instance + * @param {proto.IADVKeyIndexList=} [properties] Properties to set + * @returns {proto.ADVKeyIndexList} ADVKeyIndexList instance */ - UserAgent.create = function create(properties) { - return new UserAgent(properties); + ADVKeyIndexList.create = function create(properties) { + return new ADVKeyIndexList(properties); }; /** - * Encodes the specified UserAgent message. Does not implicitly {@link proto.UserAgent.verify|verify} messages. + * Encodes the specified ADVKeyIndexList message. Does not implicitly {@link proto.ADVKeyIndexList.verify|verify} messages. * @function encode - * @memberof proto.UserAgent + * @memberof proto.ADVKeyIndexList * @static - * @param {proto.IUserAgent} message UserAgent message or plain object to encode + * @param {proto.IADVKeyIndexList} message ADVKeyIndexList message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UserAgent.encode = function encode(message, writer) { + ADVKeyIndexList.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.platform != null && Object.hasOwnProperty.call(message, "platform")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.platform); - if (message.appVersion != null && Object.hasOwnProperty.call(message, "appVersion")) - $root.proto.AppVersion.encode(message.appVersion, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.mcc != null && Object.hasOwnProperty.call(message, "mcc")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.mcc); - if (message.mnc != null && Object.hasOwnProperty.call(message, "mnc")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.mnc); - if (message.osVersion != null && Object.hasOwnProperty.call(message, "osVersion")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.osVersion); - if (message.manufacturer != null && Object.hasOwnProperty.call(message, "manufacturer")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.manufacturer); - if (message.device != null && Object.hasOwnProperty.call(message, "device")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.device); - if (message.osBuildNumber != null && Object.hasOwnProperty.call(message, "osBuildNumber")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.osBuildNumber); - if (message.phoneId != null && Object.hasOwnProperty.call(message, "phoneId")) - writer.uint32(/* id 9, wireType 2 =*/74).string(message.phoneId); - if (message.releaseChannel != null && Object.hasOwnProperty.call(message, "releaseChannel")) - writer.uint32(/* id 10, wireType 0 =*/80).int32(message.releaseChannel); - if (message.localeLanguageIso6391 != null && Object.hasOwnProperty.call(message, "localeLanguageIso6391")) - writer.uint32(/* id 11, wireType 2 =*/90).string(message.localeLanguageIso6391); - if (message.localeCountryIso31661Alpha2 != null && Object.hasOwnProperty.call(message, "localeCountryIso31661Alpha2")) - writer.uint32(/* id 12, wireType 2 =*/98).string(message.localeCountryIso31661Alpha2); - if (message.deviceBoard != null && Object.hasOwnProperty.call(message, "deviceBoard")) - writer.uint32(/* id 13, wireType 2 =*/106).string(message.deviceBoard); + if (message.rawId != null && Object.hasOwnProperty.call(message, "rawId")) + writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.rawId); + if (message.timestamp != null && Object.hasOwnProperty.call(message, "timestamp")) + writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.timestamp); + if (message.currentIndex != null && Object.hasOwnProperty.call(message, "currentIndex")) + writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.currentIndex); + if (message.validIndexes != null && message.validIndexes.length) { + writer.uint32(/* id 4, wireType 2 =*/34).fork(); + for (var i = 0; i < message.validIndexes.length; ++i) + writer.uint32(message.validIndexes[i]); + writer.ldelim(); + } return writer; }; /** - * Encodes the specified UserAgent message, length delimited. Does not implicitly {@link proto.UserAgent.verify|verify} messages. + * Encodes the specified ADVKeyIndexList message, length delimited. Does not implicitly {@link proto.ADVKeyIndexList.verify|verify} messages. * @function encodeDelimited - * @memberof proto.UserAgent + * @memberof proto.ADVKeyIndexList * @static - * @param {proto.IUserAgent} message UserAgent message or plain object to encode + * @param {proto.IADVKeyIndexList} message ADVKeyIndexList message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UserAgent.encodeDelimited = function encodeDelimited(message, writer) { + ADVKeyIndexList.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a UserAgent message from the specified reader or buffer. + * Decodes a ADVKeyIndexList message from the specified reader or buffer. * @function decode - * @memberof proto.UserAgent + * @memberof proto.ADVKeyIndexList * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {proto.UserAgent} UserAgent + * @returns {proto.ADVKeyIndexList} ADVKeyIndexList * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UserAgent.decode = function decode(reader, length) { + ADVKeyIndexList.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.UserAgent(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.ADVKeyIndexList(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.platform = reader.int32(); + message.rawId = reader.uint32(); break; case 2: - message.appVersion = $root.proto.AppVersion.decode(reader, reader.uint32()); + message.timestamp = reader.uint64(); break; case 3: - message.mcc = reader.string(); + message.currentIndex = reader.uint32(); break; case 4: - message.mnc = reader.string(); - break; - case 5: - message.osVersion = reader.string(); - break; - case 6: - message.manufacturer = reader.string(); - break; - case 7: - message.device = reader.string(); - break; - case 8: - message.osBuildNumber = reader.string(); - break; - case 9: - message.phoneId = reader.string(); - break; - case 10: - message.releaseChannel = reader.int32(); - break; - case 11: - message.localeLanguageIso6391 = reader.string(); - break; - case 12: - message.localeCountryIso31661Alpha2 = reader.string(); - break; - case 13: - message.deviceBoard = reader.string(); + if (!(message.validIndexes && message.validIndexes.length)) + message.validIndexes = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.validIndexes.push(reader.uint32()); + } else + message.validIndexes.push(reader.uint32()); break; default: reader.skipType(tag & 7); @@ -566,476 +422,162 @@ $root.proto = (function() { }; /** - * Decodes a UserAgent message from the specified reader or buffer, length delimited. + * Decodes a ADVKeyIndexList message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof proto.UserAgent + * @memberof proto.ADVKeyIndexList * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.UserAgent} UserAgent + * @returns {proto.ADVKeyIndexList} ADVKeyIndexList * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UserAgent.decodeDelimited = function decodeDelimited(reader) { + ADVKeyIndexList.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a UserAgent message. + * Verifies a ADVKeyIndexList message. * @function verify - * @memberof proto.UserAgent + * @memberof proto.ADVKeyIndexList * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - UserAgent.verify = function verify(message) { + ADVKeyIndexList.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.platform != null && message.hasOwnProperty("platform")) - switch (message.platform) { - default: - return "platform: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - case 8: - case 9: - case 10: - case 11: - case 12: - case 13: - case 14: - case 15: - case 16: - case 17: - case 18: - case 19: - case 20: - case 21: - case 22: - case 23: - case 24: - case 25: - case 26: - case 27: - case 28: - break; - } - if (message.appVersion != null && message.hasOwnProperty("appVersion")) { - var error = $root.proto.AppVersion.verify(message.appVersion); - if (error) - return "appVersion." + error; + if (message.rawId != null && message.hasOwnProperty("rawId")) + if (!$util.isInteger(message.rawId)) + return "rawId: integer expected"; + if (message.timestamp != null && message.hasOwnProperty("timestamp")) + if (!$util.isInteger(message.timestamp) && !(message.timestamp && $util.isInteger(message.timestamp.low) && $util.isInteger(message.timestamp.high))) + return "timestamp: integer|Long expected"; + if (message.currentIndex != null && message.hasOwnProperty("currentIndex")) + if (!$util.isInteger(message.currentIndex)) + return "currentIndex: integer expected"; + if (message.validIndexes != null && message.hasOwnProperty("validIndexes")) { + if (!Array.isArray(message.validIndexes)) + return "validIndexes: array expected"; + for (var i = 0; i < message.validIndexes.length; ++i) + if (!$util.isInteger(message.validIndexes[i])) + return "validIndexes: integer[] expected"; } - if (message.mcc != null && message.hasOwnProperty("mcc")) - if (!$util.isString(message.mcc)) - return "mcc: string expected"; - if (message.mnc != null && message.hasOwnProperty("mnc")) - if (!$util.isString(message.mnc)) - return "mnc: string expected"; - if (message.osVersion != null && message.hasOwnProperty("osVersion")) - if (!$util.isString(message.osVersion)) - return "osVersion: string expected"; - if (message.manufacturer != null && message.hasOwnProperty("manufacturer")) - if (!$util.isString(message.manufacturer)) - return "manufacturer: string expected"; - if (message.device != null && message.hasOwnProperty("device")) - if (!$util.isString(message.device)) - return "device: string expected"; - if (message.osBuildNumber != null && message.hasOwnProperty("osBuildNumber")) - if (!$util.isString(message.osBuildNumber)) - return "osBuildNumber: string expected"; - if (message.phoneId != null && message.hasOwnProperty("phoneId")) - if (!$util.isString(message.phoneId)) - return "phoneId: string expected"; - if (message.releaseChannel != null && message.hasOwnProperty("releaseChannel")) - switch (message.releaseChannel) { - default: - return "releaseChannel: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.localeLanguageIso6391 != null && message.hasOwnProperty("localeLanguageIso6391")) - if (!$util.isString(message.localeLanguageIso6391)) - return "localeLanguageIso6391: string expected"; - if (message.localeCountryIso31661Alpha2 != null && message.hasOwnProperty("localeCountryIso31661Alpha2")) - if (!$util.isString(message.localeCountryIso31661Alpha2)) - return "localeCountryIso31661Alpha2: string expected"; - if (message.deviceBoard != null && message.hasOwnProperty("deviceBoard")) - if (!$util.isString(message.deviceBoard)) - return "deviceBoard: string expected"; return null; }; /** - * Creates a UserAgent message from a plain object. Also converts values to their respective internal types. + * Creates a ADVKeyIndexList message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof proto.UserAgent + * @memberof proto.ADVKeyIndexList * @static * @param {Object.} object Plain object - * @returns {proto.UserAgent} UserAgent + * @returns {proto.ADVKeyIndexList} ADVKeyIndexList */ - UserAgent.fromObject = function fromObject(object) { - if (object instanceof $root.proto.UserAgent) + ADVKeyIndexList.fromObject = function fromObject(object) { + if (object instanceof $root.proto.ADVKeyIndexList) return object; - var message = new $root.proto.UserAgent(); - switch (object.platform) { - case "ANDROID": - case 0: - message.platform = 0; - break; - case "IOS": - case 1: - message.platform = 1; - break; - case "WINDOWS_PHONE": - case 2: - message.platform = 2; - break; - case "BLACKBERRY": - case 3: - message.platform = 3; - break; - case "BLACKBERRYX": - case 4: - message.platform = 4; - break; - case "S40": - case 5: - message.platform = 5; - break; - case "S60": - case 6: - message.platform = 6; - break; - case "PYTHON_CLIENT": - case 7: - message.platform = 7; - break; - case "TIZEN": - case 8: - message.platform = 8; - break; - case "ENTERPRISE": - case 9: - message.platform = 9; - break; - case "SMB_ANDROID": - case 10: - message.platform = 10; - break; - case "KAIOS": - case 11: - message.platform = 11; - break; - case "SMB_IOS": - case 12: - message.platform = 12; - break; - case "WINDOWS": - case 13: - message.platform = 13; - break; - case "WEB": - case 14: - message.platform = 14; - break; - case "PORTAL": - case 15: - message.platform = 15; - break; - case "GREEN_ANDROID": - case 16: - message.platform = 16; - break; - case "GREEN_IPHONE": - case 17: - message.platform = 17; - break; - case "BLUE_ANDROID": - case 18: - message.platform = 18; - break; - case "BLUE_IPHONE": - case 19: - message.platform = 19; - break; - case "FBLITE_ANDROID": - case 20: - message.platform = 20; - break; - case "MLITE_ANDROID": - case 21: - message.platform = 21; - break; - case "IGLITE_ANDROID": - case 22: - message.platform = 22; - break; - case "PAGE": - case 23: - message.platform = 23; - break; - case "MACOS": - case 24: - message.platform = 24; - break; - case "OCULUS_MSG": - case 25: - message.platform = 25; - break; - case "OCULUS_CALL": - case 26: - message.platform = 26; - break; - case "MILAN": - case 27: - message.platform = 27; - break; - case "CAPI": - case 28: - message.platform = 28; - break; - } - if (object.appVersion != null) { - if (typeof object.appVersion !== "object") - throw TypeError(".proto.UserAgent.appVersion: object expected"); - message.appVersion = $root.proto.AppVersion.fromObject(object.appVersion); - } - if (object.mcc != null) - message.mcc = String(object.mcc); - if (object.mnc != null) - message.mnc = String(object.mnc); - if (object.osVersion != null) - message.osVersion = String(object.osVersion); - if (object.manufacturer != null) - message.manufacturer = String(object.manufacturer); - if (object.device != null) - message.device = String(object.device); - if (object.osBuildNumber != null) - message.osBuildNumber = String(object.osBuildNumber); - if (object.phoneId != null) - message.phoneId = String(object.phoneId); - switch (object.releaseChannel) { - case "RELEASE": - case 0: - message.releaseChannel = 0; - break; - case "BETA": - case 1: - message.releaseChannel = 1; - break; - case "ALPHA": - case 2: - message.releaseChannel = 2; - break; - case "DEBUG": - case 3: - message.releaseChannel = 3; - break; + var message = new $root.proto.ADVKeyIndexList(); + if (object.rawId != null) + message.rawId = object.rawId >>> 0; + if (object.timestamp != null) + if ($util.Long) + (message.timestamp = $util.Long.fromValue(object.timestamp)).unsigned = true; + else if (typeof object.timestamp === "string") + message.timestamp = parseInt(object.timestamp, 10); + else if (typeof object.timestamp === "number") + message.timestamp = object.timestamp; + else if (typeof object.timestamp === "object") + message.timestamp = new $util.LongBits(object.timestamp.low >>> 0, object.timestamp.high >>> 0).toNumber(true); + if (object.currentIndex != null) + message.currentIndex = object.currentIndex >>> 0; + if (object.validIndexes) { + if (!Array.isArray(object.validIndexes)) + throw TypeError(".proto.ADVKeyIndexList.validIndexes: array expected"); + message.validIndexes = []; + for (var i = 0; i < object.validIndexes.length; ++i) + message.validIndexes[i] = object.validIndexes[i] >>> 0; } - if (object.localeLanguageIso6391 != null) - message.localeLanguageIso6391 = String(object.localeLanguageIso6391); - if (object.localeCountryIso31661Alpha2 != null) - message.localeCountryIso31661Alpha2 = String(object.localeCountryIso31661Alpha2); - if (object.deviceBoard != null) - message.deviceBoard = String(object.deviceBoard); return message; }; /** - * Creates a plain object from a UserAgent message. Also converts values to other types if specified. + * Creates a plain object from a ADVKeyIndexList message. Also converts values to other types if specified. * @function toObject - * @memberof proto.UserAgent + * @memberof proto.ADVKeyIndexList * @static - * @param {proto.UserAgent} message UserAgent + * @param {proto.ADVKeyIndexList} message ADVKeyIndexList * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - UserAgent.toObject = function toObject(message, options) { + ADVKeyIndexList.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.validIndexes = []; if (options.defaults) { - object.platform = options.enums === String ? "ANDROID" : 0; - object.appVersion = null; - object.mcc = ""; - object.mnc = ""; - object.osVersion = ""; - object.manufacturer = ""; - object.device = ""; - object.osBuildNumber = ""; - object.phoneId = ""; - object.releaseChannel = options.enums === String ? "RELEASE" : 0; - object.localeLanguageIso6391 = ""; - object.localeCountryIso31661Alpha2 = ""; - object.deviceBoard = ""; + object.rawId = 0; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.timestamp = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.timestamp = options.longs === String ? "0" : 0; + object.currentIndex = 0; + } + if (message.rawId != null && message.hasOwnProperty("rawId")) + object.rawId = message.rawId; + if (message.timestamp != null && message.hasOwnProperty("timestamp")) + if (typeof message.timestamp === "number") + object.timestamp = options.longs === String ? String(message.timestamp) : message.timestamp; + else + object.timestamp = options.longs === String ? $util.Long.prototype.toString.call(message.timestamp) : options.longs === Number ? new $util.LongBits(message.timestamp.low >>> 0, message.timestamp.high >>> 0).toNumber(true) : message.timestamp; + if (message.currentIndex != null && message.hasOwnProperty("currentIndex")) + object.currentIndex = message.currentIndex; + if (message.validIndexes && message.validIndexes.length) { + object.validIndexes = []; + for (var j = 0; j < message.validIndexes.length; ++j) + object.validIndexes[j] = message.validIndexes[j]; } - if (message.platform != null && message.hasOwnProperty("platform")) - object.platform = options.enums === String ? $root.proto.UserAgent.UserAgentPlatform[message.platform] : message.platform; - if (message.appVersion != null && message.hasOwnProperty("appVersion")) - object.appVersion = $root.proto.AppVersion.toObject(message.appVersion, options); - if (message.mcc != null && message.hasOwnProperty("mcc")) - object.mcc = message.mcc; - if (message.mnc != null && message.hasOwnProperty("mnc")) - object.mnc = message.mnc; - if (message.osVersion != null && message.hasOwnProperty("osVersion")) - object.osVersion = message.osVersion; - if (message.manufacturer != null && message.hasOwnProperty("manufacturer")) - object.manufacturer = message.manufacturer; - if (message.device != null && message.hasOwnProperty("device")) - object.device = message.device; - if (message.osBuildNumber != null && message.hasOwnProperty("osBuildNumber")) - object.osBuildNumber = message.osBuildNumber; - if (message.phoneId != null && message.hasOwnProperty("phoneId")) - object.phoneId = message.phoneId; - if (message.releaseChannel != null && message.hasOwnProperty("releaseChannel")) - object.releaseChannel = options.enums === String ? $root.proto.UserAgent.UserAgentReleaseChannel[message.releaseChannel] : message.releaseChannel; - if (message.localeLanguageIso6391 != null && message.hasOwnProperty("localeLanguageIso6391")) - object.localeLanguageIso6391 = message.localeLanguageIso6391; - if (message.localeCountryIso31661Alpha2 != null && message.hasOwnProperty("localeCountryIso31661Alpha2")) - object.localeCountryIso31661Alpha2 = message.localeCountryIso31661Alpha2; - if (message.deviceBoard != null && message.hasOwnProperty("deviceBoard")) - object.deviceBoard = message.deviceBoard; return object; }; /** - * Converts this UserAgent to JSON. + * Converts this ADVKeyIndexList to JSON. * @function toJSON - * @memberof proto.UserAgent + * @memberof proto.ADVKeyIndexList * @instance * @returns {Object.} JSON object */ - UserAgent.prototype.toJSON = function toJSON() { + ADVKeyIndexList.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - /** - * UserAgentPlatform enum. - * @name proto.UserAgent.UserAgentPlatform - * @enum {number} - * @property {number} ANDROID=0 ANDROID value - * @property {number} IOS=1 IOS value - * @property {number} WINDOWS_PHONE=2 WINDOWS_PHONE value - * @property {number} BLACKBERRY=3 BLACKBERRY value - * @property {number} BLACKBERRYX=4 BLACKBERRYX value - * @property {number} S40=5 S40 value - * @property {number} S60=6 S60 value - * @property {number} PYTHON_CLIENT=7 PYTHON_CLIENT value - * @property {number} TIZEN=8 TIZEN value - * @property {number} ENTERPRISE=9 ENTERPRISE value - * @property {number} SMB_ANDROID=10 SMB_ANDROID value - * @property {number} KAIOS=11 KAIOS value - * @property {number} SMB_IOS=12 SMB_IOS value - * @property {number} WINDOWS=13 WINDOWS value - * @property {number} WEB=14 WEB value - * @property {number} PORTAL=15 PORTAL value - * @property {number} GREEN_ANDROID=16 GREEN_ANDROID value - * @property {number} GREEN_IPHONE=17 GREEN_IPHONE value - * @property {number} BLUE_ANDROID=18 BLUE_ANDROID value - * @property {number} BLUE_IPHONE=19 BLUE_IPHONE value - * @property {number} FBLITE_ANDROID=20 FBLITE_ANDROID value - * @property {number} MLITE_ANDROID=21 MLITE_ANDROID value - * @property {number} IGLITE_ANDROID=22 IGLITE_ANDROID value - * @property {number} PAGE=23 PAGE value - * @property {number} MACOS=24 MACOS value - * @property {number} OCULUS_MSG=25 OCULUS_MSG value - * @property {number} OCULUS_CALL=26 OCULUS_CALL value - * @property {number} MILAN=27 MILAN value - * @property {number} CAPI=28 CAPI value - */ - UserAgent.UserAgentPlatform = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "ANDROID"] = 0; - values[valuesById[1] = "IOS"] = 1; - values[valuesById[2] = "WINDOWS_PHONE"] = 2; - values[valuesById[3] = "BLACKBERRY"] = 3; - values[valuesById[4] = "BLACKBERRYX"] = 4; - values[valuesById[5] = "S40"] = 5; - values[valuesById[6] = "S60"] = 6; - values[valuesById[7] = "PYTHON_CLIENT"] = 7; - values[valuesById[8] = "TIZEN"] = 8; - values[valuesById[9] = "ENTERPRISE"] = 9; - values[valuesById[10] = "SMB_ANDROID"] = 10; - values[valuesById[11] = "KAIOS"] = 11; - values[valuesById[12] = "SMB_IOS"] = 12; - values[valuesById[13] = "WINDOWS"] = 13; - values[valuesById[14] = "WEB"] = 14; - values[valuesById[15] = "PORTAL"] = 15; - values[valuesById[16] = "GREEN_ANDROID"] = 16; - values[valuesById[17] = "GREEN_IPHONE"] = 17; - values[valuesById[18] = "BLUE_ANDROID"] = 18; - values[valuesById[19] = "BLUE_IPHONE"] = 19; - values[valuesById[20] = "FBLITE_ANDROID"] = 20; - values[valuesById[21] = "MLITE_ANDROID"] = 21; - values[valuesById[22] = "IGLITE_ANDROID"] = 22; - values[valuesById[23] = "PAGE"] = 23; - values[valuesById[24] = "MACOS"] = 24; - values[valuesById[25] = "OCULUS_MSG"] = 25; - values[valuesById[26] = "OCULUS_CALL"] = 26; - values[valuesById[27] = "MILAN"] = 27; - values[valuesById[28] = "CAPI"] = 28; - return values; - })(); - - /** - * UserAgentReleaseChannel enum. - * @name proto.UserAgent.UserAgentReleaseChannel - * @enum {number} - * @property {number} RELEASE=0 RELEASE value - * @property {number} BETA=1 BETA value - * @property {number} ALPHA=2 ALPHA value - * @property {number} DEBUG=3 DEBUG value - */ - UserAgent.UserAgentReleaseChannel = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "RELEASE"] = 0; - values[valuesById[1] = "BETA"] = 1; - values[valuesById[2] = "ALPHA"] = 2; - values[valuesById[3] = "DEBUG"] = 3; - return values; - })(); - - return UserAgent; + return ADVKeyIndexList; })(); - proto.WebdPayload = (function() { + proto.ADVSignedDeviceIdentity = (function() { /** - * Properties of a WebdPayload. + * Properties of a ADVSignedDeviceIdentity. * @memberof proto - * @interface IWebdPayload - * @property {boolean|null} [usesParticipantInKey] WebdPayload usesParticipantInKey - * @property {boolean|null} [supportsStarredMessages] WebdPayload supportsStarredMessages - * @property {boolean|null} [supportsDocumentMessages] WebdPayload supportsDocumentMessages - * @property {boolean|null} [supportsUrlMessages] WebdPayload supportsUrlMessages - * @property {boolean|null} [supportsMediaRetry] WebdPayload supportsMediaRetry - * @property {boolean|null} [supportsE2EImage] WebdPayload supportsE2EImage - * @property {boolean|null} [supportsE2EVideo] WebdPayload supportsE2EVideo - * @property {boolean|null} [supportsE2EAudio] WebdPayload supportsE2EAudio - * @property {boolean|null} [supportsE2EDocument] WebdPayload supportsE2EDocument - * @property {string|null} [documentTypes] WebdPayload documentTypes - * @property {Uint8Array|null} [features] WebdPayload features + * @interface IADVSignedDeviceIdentity + * @property {Uint8Array|null} [details] ADVSignedDeviceIdentity details + * @property {Uint8Array|null} [accountSignatureKey] ADVSignedDeviceIdentity accountSignatureKey + * @property {Uint8Array|null} [accountSignature] ADVSignedDeviceIdentity accountSignature + * @property {Uint8Array|null} [deviceSignature] ADVSignedDeviceIdentity deviceSignature */ /** - * Constructs a new WebdPayload. + * Constructs a new ADVSignedDeviceIdentity. * @memberof proto - * @classdesc Represents a WebdPayload. - * @implements IWebdPayload + * @classdesc Represents a ADVSignedDeviceIdentity. + * @implements IADVSignedDeviceIdentity * @constructor - * @param {proto.IWebdPayload=} [properties] Properties to set + * @param {proto.IADVSignedDeviceIdentity=} [properties] Properties to set */ - function WebdPayload(properties) { + function ADVSignedDeviceIdentity(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -1043,205 +585,114 @@ $root.proto = (function() { } /** - * WebdPayload usesParticipantInKey. - * @member {boolean} usesParticipantInKey - * @memberof proto.WebdPayload + * ADVSignedDeviceIdentity details. + * @member {Uint8Array} details + * @memberof proto.ADVSignedDeviceIdentity * @instance */ - WebdPayload.prototype.usesParticipantInKey = false; + ADVSignedDeviceIdentity.prototype.details = $util.newBuffer([]); /** - * WebdPayload supportsStarredMessages. - * @member {boolean} supportsStarredMessages - * @memberof proto.WebdPayload + * ADVSignedDeviceIdentity accountSignatureKey. + * @member {Uint8Array} accountSignatureKey + * @memberof proto.ADVSignedDeviceIdentity * @instance */ - WebdPayload.prototype.supportsStarredMessages = false; + ADVSignedDeviceIdentity.prototype.accountSignatureKey = $util.newBuffer([]); /** - * WebdPayload supportsDocumentMessages. - * @member {boolean} supportsDocumentMessages - * @memberof proto.WebdPayload + * ADVSignedDeviceIdentity accountSignature. + * @member {Uint8Array} accountSignature + * @memberof proto.ADVSignedDeviceIdentity * @instance */ - WebdPayload.prototype.supportsDocumentMessages = false; + ADVSignedDeviceIdentity.prototype.accountSignature = $util.newBuffer([]); /** - * WebdPayload supportsUrlMessages. - * @member {boolean} supportsUrlMessages - * @memberof proto.WebdPayload - * @instance - */ - WebdPayload.prototype.supportsUrlMessages = false; - - /** - * WebdPayload supportsMediaRetry. - * @member {boolean} supportsMediaRetry - * @memberof proto.WebdPayload - * @instance - */ - WebdPayload.prototype.supportsMediaRetry = false; - - /** - * WebdPayload supportsE2EImage. - * @member {boolean} supportsE2EImage - * @memberof proto.WebdPayload - * @instance - */ - WebdPayload.prototype.supportsE2EImage = false; - - /** - * WebdPayload supportsE2EVideo. - * @member {boolean} supportsE2EVideo - * @memberof proto.WebdPayload - * @instance - */ - WebdPayload.prototype.supportsE2EVideo = false; - - /** - * WebdPayload supportsE2EAudio. - * @member {boolean} supportsE2EAudio - * @memberof proto.WebdPayload - * @instance - */ - WebdPayload.prototype.supportsE2EAudio = false; - - /** - * WebdPayload supportsE2EDocument. - * @member {boolean} supportsE2EDocument - * @memberof proto.WebdPayload - * @instance - */ - WebdPayload.prototype.supportsE2EDocument = false; - - /** - * WebdPayload documentTypes. - * @member {string} documentTypes - * @memberof proto.WebdPayload - * @instance - */ - WebdPayload.prototype.documentTypes = ""; - - /** - * WebdPayload features. - * @member {Uint8Array} features - * @memberof proto.WebdPayload + * ADVSignedDeviceIdentity deviceSignature. + * @member {Uint8Array} deviceSignature + * @memberof proto.ADVSignedDeviceIdentity * @instance */ - WebdPayload.prototype.features = $util.newBuffer([]); + ADVSignedDeviceIdentity.prototype.deviceSignature = $util.newBuffer([]); /** - * Creates a new WebdPayload instance using the specified properties. + * Creates a new ADVSignedDeviceIdentity instance using the specified properties. * @function create - * @memberof proto.WebdPayload + * @memberof proto.ADVSignedDeviceIdentity * @static - * @param {proto.IWebdPayload=} [properties] Properties to set - * @returns {proto.WebdPayload} WebdPayload instance + * @param {proto.IADVSignedDeviceIdentity=} [properties] Properties to set + * @returns {proto.ADVSignedDeviceIdentity} ADVSignedDeviceIdentity instance */ - WebdPayload.create = function create(properties) { - return new WebdPayload(properties); + ADVSignedDeviceIdentity.create = function create(properties) { + return new ADVSignedDeviceIdentity(properties); }; /** - * Encodes the specified WebdPayload message. Does not implicitly {@link proto.WebdPayload.verify|verify} messages. + * Encodes the specified ADVSignedDeviceIdentity message. Does not implicitly {@link proto.ADVSignedDeviceIdentity.verify|verify} messages. * @function encode - * @memberof proto.WebdPayload + * @memberof proto.ADVSignedDeviceIdentity * @static - * @param {proto.IWebdPayload} message WebdPayload message or plain object to encode + * @param {proto.IADVSignedDeviceIdentity} message ADVSignedDeviceIdentity message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - WebdPayload.encode = function encode(message, writer) { + ADVSignedDeviceIdentity.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.usesParticipantInKey != null && Object.hasOwnProperty.call(message, "usesParticipantInKey")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.usesParticipantInKey); - if (message.supportsStarredMessages != null && Object.hasOwnProperty.call(message, "supportsStarredMessages")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.supportsStarredMessages); - if (message.supportsDocumentMessages != null && Object.hasOwnProperty.call(message, "supportsDocumentMessages")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.supportsDocumentMessages); - if (message.supportsUrlMessages != null && Object.hasOwnProperty.call(message, "supportsUrlMessages")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.supportsUrlMessages); - if (message.supportsMediaRetry != null && Object.hasOwnProperty.call(message, "supportsMediaRetry")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.supportsMediaRetry); - if (message.supportsE2EImage != null && Object.hasOwnProperty.call(message, "supportsE2EImage")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.supportsE2EImage); - if (message.supportsE2EVideo != null && Object.hasOwnProperty.call(message, "supportsE2EVideo")) - writer.uint32(/* id 7, wireType 0 =*/56).bool(message.supportsE2EVideo); - if (message.supportsE2EAudio != null && Object.hasOwnProperty.call(message, "supportsE2EAudio")) - writer.uint32(/* id 8, wireType 0 =*/64).bool(message.supportsE2EAudio); - if (message.supportsE2EDocument != null && Object.hasOwnProperty.call(message, "supportsE2EDocument")) - writer.uint32(/* id 9, wireType 0 =*/72).bool(message.supportsE2EDocument); - if (message.documentTypes != null && Object.hasOwnProperty.call(message, "documentTypes")) - writer.uint32(/* id 10, wireType 2 =*/82).string(message.documentTypes); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - writer.uint32(/* id 11, wireType 2 =*/90).bytes(message.features); + if (message.details != null && Object.hasOwnProperty.call(message, "details")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.details); + if (message.accountSignatureKey != null && Object.hasOwnProperty.call(message, "accountSignatureKey")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.accountSignatureKey); + if (message.accountSignature != null && Object.hasOwnProperty.call(message, "accountSignature")) + writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.accountSignature); + if (message.deviceSignature != null && Object.hasOwnProperty.call(message, "deviceSignature")) + writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.deviceSignature); return writer; }; /** - * Encodes the specified WebdPayload message, length delimited. Does not implicitly {@link proto.WebdPayload.verify|verify} messages. + * Encodes the specified ADVSignedDeviceIdentity message, length delimited. Does not implicitly {@link proto.ADVSignedDeviceIdentity.verify|verify} messages. * @function encodeDelimited - * @memberof proto.WebdPayload + * @memberof proto.ADVSignedDeviceIdentity * @static - * @param {proto.IWebdPayload} message WebdPayload message or plain object to encode + * @param {proto.IADVSignedDeviceIdentity} message ADVSignedDeviceIdentity message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - WebdPayload.encodeDelimited = function encodeDelimited(message, writer) { + ADVSignedDeviceIdentity.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a WebdPayload message from the specified reader or buffer. + * Decodes a ADVSignedDeviceIdentity message from the specified reader or buffer. * @function decode - * @memberof proto.WebdPayload + * @memberof proto.ADVSignedDeviceIdentity * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {proto.WebdPayload} WebdPayload + * @returns {proto.ADVSignedDeviceIdentity} ADVSignedDeviceIdentity * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - WebdPayload.decode = function decode(reader, length) { + ADVSignedDeviceIdentity.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.WebdPayload(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.ADVSignedDeviceIdentity(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.usesParticipantInKey = reader.bool(); + message.details = reader.bytes(); break; case 2: - message.supportsStarredMessages = reader.bool(); + message.accountSignatureKey = reader.bytes(); break; case 3: - message.supportsDocumentMessages = reader.bool(); + message.accountSignature = reader.bytes(); break; case 4: - message.supportsUrlMessages = reader.bool(); - break; - case 5: - message.supportsMediaRetry = reader.bool(); - break; - case 6: - message.supportsE2EImage = reader.bool(); - break; - case 7: - message.supportsE2EVideo = reader.bool(); - break; - case 8: - message.supportsE2EAudio = reader.bool(); - break; - case 9: - message.supportsE2EDocument = reader.bool(); - break; - case 10: - message.documentTypes = reader.string(); - break; - case 11: - message.features = reader.bytes(); + message.deviceSignature = reader.bytes(); break; default: reader.skipType(tag & 7); @@ -1252,200 +703,169 @@ $root.proto = (function() { }; /** - * Decodes a WebdPayload message from the specified reader or buffer, length delimited. + * Decodes a ADVSignedDeviceIdentity message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof proto.WebdPayload + * @memberof proto.ADVSignedDeviceIdentity * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.WebdPayload} WebdPayload + * @returns {proto.ADVSignedDeviceIdentity} ADVSignedDeviceIdentity * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - WebdPayload.decodeDelimited = function decodeDelimited(reader) { + ADVSignedDeviceIdentity.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a WebdPayload message. + * Verifies a ADVSignedDeviceIdentity message. * @function verify - * @memberof proto.WebdPayload + * @memberof proto.ADVSignedDeviceIdentity * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - WebdPayload.verify = function verify(message) { + ADVSignedDeviceIdentity.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.usesParticipantInKey != null && message.hasOwnProperty("usesParticipantInKey")) - if (typeof message.usesParticipantInKey !== "boolean") - return "usesParticipantInKey: boolean expected"; - if (message.supportsStarredMessages != null && message.hasOwnProperty("supportsStarredMessages")) - if (typeof message.supportsStarredMessages !== "boolean") - return "supportsStarredMessages: boolean expected"; - if (message.supportsDocumentMessages != null && message.hasOwnProperty("supportsDocumentMessages")) - if (typeof message.supportsDocumentMessages !== "boolean") - return "supportsDocumentMessages: boolean expected"; - if (message.supportsUrlMessages != null && message.hasOwnProperty("supportsUrlMessages")) - if (typeof message.supportsUrlMessages !== "boolean") - return "supportsUrlMessages: boolean expected"; - if (message.supportsMediaRetry != null && message.hasOwnProperty("supportsMediaRetry")) - if (typeof message.supportsMediaRetry !== "boolean") - return "supportsMediaRetry: boolean expected"; - if (message.supportsE2EImage != null && message.hasOwnProperty("supportsE2EImage")) - if (typeof message.supportsE2EImage !== "boolean") - return "supportsE2EImage: boolean expected"; - if (message.supportsE2EVideo != null && message.hasOwnProperty("supportsE2EVideo")) - if (typeof message.supportsE2EVideo !== "boolean") - return "supportsE2EVideo: boolean expected"; - if (message.supportsE2EAudio != null && message.hasOwnProperty("supportsE2EAudio")) - if (typeof message.supportsE2EAudio !== "boolean") - return "supportsE2EAudio: boolean expected"; - if (message.supportsE2EDocument != null && message.hasOwnProperty("supportsE2EDocument")) - if (typeof message.supportsE2EDocument !== "boolean") - return "supportsE2EDocument: boolean expected"; - if (message.documentTypes != null && message.hasOwnProperty("documentTypes")) - if (!$util.isString(message.documentTypes)) - return "documentTypes: string expected"; - if (message.features != null && message.hasOwnProperty("features")) - if (!(message.features && typeof message.features.length === "number" || $util.isString(message.features))) - return "features: buffer expected"; + if (message.details != null && message.hasOwnProperty("details")) + if (!(message.details && typeof message.details.length === "number" || $util.isString(message.details))) + return "details: buffer expected"; + if (message.accountSignatureKey != null && message.hasOwnProperty("accountSignatureKey")) + if (!(message.accountSignatureKey && typeof message.accountSignatureKey.length === "number" || $util.isString(message.accountSignatureKey))) + return "accountSignatureKey: buffer expected"; + if (message.accountSignature != null && message.hasOwnProperty("accountSignature")) + if (!(message.accountSignature && typeof message.accountSignature.length === "number" || $util.isString(message.accountSignature))) + return "accountSignature: buffer expected"; + if (message.deviceSignature != null && message.hasOwnProperty("deviceSignature")) + if (!(message.deviceSignature && typeof message.deviceSignature.length === "number" || $util.isString(message.deviceSignature))) + return "deviceSignature: buffer expected"; return null; }; /** - * Creates a WebdPayload message from a plain object. Also converts values to their respective internal types. + * Creates a ADVSignedDeviceIdentity message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof proto.WebdPayload + * @memberof proto.ADVSignedDeviceIdentity * @static * @param {Object.} object Plain object - * @returns {proto.WebdPayload} WebdPayload + * @returns {proto.ADVSignedDeviceIdentity} ADVSignedDeviceIdentity */ - WebdPayload.fromObject = function fromObject(object) { - if (object instanceof $root.proto.WebdPayload) + ADVSignedDeviceIdentity.fromObject = function fromObject(object) { + if (object instanceof $root.proto.ADVSignedDeviceIdentity) return object; - var message = new $root.proto.WebdPayload(); - if (object.usesParticipantInKey != null) - message.usesParticipantInKey = Boolean(object.usesParticipantInKey); - if (object.supportsStarredMessages != null) - message.supportsStarredMessages = Boolean(object.supportsStarredMessages); - if (object.supportsDocumentMessages != null) - message.supportsDocumentMessages = Boolean(object.supportsDocumentMessages); - if (object.supportsUrlMessages != null) - message.supportsUrlMessages = Boolean(object.supportsUrlMessages); - if (object.supportsMediaRetry != null) - message.supportsMediaRetry = Boolean(object.supportsMediaRetry); - if (object.supportsE2EImage != null) - message.supportsE2EImage = Boolean(object.supportsE2EImage); - if (object.supportsE2EVideo != null) - message.supportsE2EVideo = Boolean(object.supportsE2EVideo); - if (object.supportsE2EAudio != null) - message.supportsE2EAudio = Boolean(object.supportsE2EAudio); - if (object.supportsE2EDocument != null) - message.supportsE2EDocument = Boolean(object.supportsE2EDocument); - if (object.documentTypes != null) - message.documentTypes = String(object.documentTypes); - if (object.features != null) - if (typeof object.features === "string") - $util.base64.decode(object.features, message.features = $util.newBuffer($util.base64.length(object.features)), 0); - else if (object.features.length) - message.features = object.features; + var message = new $root.proto.ADVSignedDeviceIdentity(); + if (object.details != null) + if (typeof object.details === "string") + $util.base64.decode(object.details, message.details = $util.newBuffer($util.base64.length(object.details)), 0); + else if (object.details.length) + message.details = object.details; + if (object.accountSignatureKey != null) + if (typeof object.accountSignatureKey === "string") + $util.base64.decode(object.accountSignatureKey, message.accountSignatureKey = $util.newBuffer($util.base64.length(object.accountSignatureKey)), 0); + else if (object.accountSignatureKey.length) + message.accountSignatureKey = object.accountSignatureKey; + if (object.accountSignature != null) + if (typeof object.accountSignature === "string") + $util.base64.decode(object.accountSignature, message.accountSignature = $util.newBuffer($util.base64.length(object.accountSignature)), 0); + else if (object.accountSignature.length) + message.accountSignature = object.accountSignature; + if (object.deviceSignature != null) + if (typeof object.deviceSignature === "string") + $util.base64.decode(object.deviceSignature, message.deviceSignature = $util.newBuffer($util.base64.length(object.deviceSignature)), 0); + else if (object.deviceSignature.length) + message.deviceSignature = object.deviceSignature; return message; }; /** - * Creates a plain object from a WebdPayload message. Also converts values to other types if specified. + * Creates a plain object from a ADVSignedDeviceIdentity message. Also converts values to other types if specified. * @function toObject - * @memberof proto.WebdPayload + * @memberof proto.ADVSignedDeviceIdentity * @static - * @param {proto.WebdPayload} message WebdPayload + * @param {proto.ADVSignedDeviceIdentity} message ADVSignedDeviceIdentity * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - WebdPayload.toObject = function toObject(message, options) { + ADVSignedDeviceIdentity.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.usesParticipantInKey = false; - object.supportsStarredMessages = false; - object.supportsDocumentMessages = false; - object.supportsUrlMessages = false; - object.supportsMediaRetry = false; - object.supportsE2EImage = false; - object.supportsE2EVideo = false; - object.supportsE2EAudio = false; - object.supportsE2EDocument = false; - object.documentTypes = ""; if (options.bytes === String) - object.features = ""; + object.details = ""; else { - object.features = []; + object.details = []; if (options.bytes !== Array) - object.features = $util.newBuffer(object.features); + object.details = $util.newBuffer(object.details); + } + if (options.bytes === String) + object.accountSignatureKey = ""; + else { + object.accountSignatureKey = []; + if (options.bytes !== Array) + object.accountSignatureKey = $util.newBuffer(object.accountSignatureKey); + } + if (options.bytes === String) + object.accountSignature = ""; + else { + object.accountSignature = []; + if (options.bytes !== Array) + object.accountSignature = $util.newBuffer(object.accountSignature); + } + if (options.bytes === String) + object.deviceSignature = ""; + else { + object.deviceSignature = []; + if (options.bytes !== Array) + object.deviceSignature = $util.newBuffer(object.deviceSignature); } } - if (message.usesParticipantInKey != null && message.hasOwnProperty("usesParticipantInKey")) - object.usesParticipantInKey = message.usesParticipantInKey; - if (message.supportsStarredMessages != null && message.hasOwnProperty("supportsStarredMessages")) - object.supportsStarredMessages = message.supportsStarredMessages; - if (message.supportsDocumentMessages != null && message.hasOwnProperty("supportsDocumentMessages")) - object.supportsDocumentMessages = message.supportsDocumentMessages; - if (message.supportsUrlMessages != null && message.hasOwnProperty("supportsUrlMessages")) - object.supportsUrlMessages = message.supportsUrlMessages; - if (message.supportsMediaRetry != null && message.hasOwnProperty("supportsMediaRetry")) - object.supportsMediaRetry = message.supportsMediaRetry; - if (message.supportsE2EImage != null && message.hasOwnProperty("supportsE2EImage")) - object.supportsE2EImage = message.supportsE2EImage; - if (message.supportsE2EVideo != null && message.hasOwnProperty("supportsE2EVideo")) - object.supportsE2EVideo = message.supportsE2EVideo; - if (message.supportsE2EAudio != null && message.hasOwnProperty("supportsE2EAudio")) - object.supportsE2EAudio = message.supportsE2EAudio; - if (message.supportsE2EDocument != null && message.hasOwnProperty("supportsE2EDocument")) - object.supportsE2EDocument = message.supportsE2EDocument; - if (message.documentTypes != null && message.hasOwnProperty("documentTypes")) - object.documentTypes = message.documentTypes; - if (message.features != null && message.hasOwnProperty("features")) - object.features = options.bytes === String ? $util.base64.encode(message.features, 0, message.features.length) : options.bytes === Array ? Array.prototype.slice.call(message.features) : message.features; + if (message.details != null && message.hasOwnProperty("details")) + object.details = options.bytes === String ? $util.base64.encode(message.details, 0, message.details.length) : options.bytes === Array ? Array.prototype.slice.call(message.details) : message.details; + if (message.accountSignatureKey != null && message.hasOwnProperty("accountSignatureKey")) + object.accountSignatureKey = options.bytes === String ? $util.base64.encode(message.accountSignatureKey, 0, message.accountSignatureKey.length) : options.bytes === Array ? Array.prototype.slice.call(message.accountSignatureKey) : message.accountSignatureKey; + if (message.accountSignature != null && message.hasOwnProperty("accountSignature")) + object.accountSignature = options.bytes === String ? $util.base64.encode(message.accountSignature, 0, message.accountSignature.length) : options.bytes === Array ? Array.prototype.slice.call(message.accountSignature) : message.accountSignature; + if (message.deviceSignature != null && message.hasOwnProperty("deviceSignature")) + object.deviceSignature = options.bytes === String ? $util.base64.encode(message.deviceSignature, 0, message.deviceSignature.length) : options.bytes === Array ? Array.prototype.slice.call(message.deviceSignature) : message.deviceSignature; return object; }; /** - * Converts this WebdPayload to JSON. + * Converts this ADVSignedDeviceIdentity to JSON. * @function toJSON - * @memberof proto.WebdPayload + * @memberof proto.ADVSignedDeviceIdentity * @instance * @returns {Object.} JSON object */ - WebdPayload.prototype.toJSON = function toJSON() { + ADVSignedDeviceIdentity.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return WebdPayload; + return ADVSignedDeviceIdentity; })(); - proto.WebInfo = (function() { + proto.ADVSignedDeviceIdentityHMAC = (function() { /** - * Properties of a WebInfo. + * Properties of a ADVSignedDeviceIdentityHMAC. * @memberof proto - * @interface IWebInfo - * @property {string|null} [refToken] WebInfo refToken - * @property {string|null} [version] WebInfo version - * @property {proto.IWebdPayload|null} [webdPayload] WebInfo webdPayload - * @property {proto.WebInfo.WebInfoWebSubPlatform|null} [webSubPlatform] WebInfo webSubPlatform + * @interface IADVSignedDeviceIdentityHMAC + * @property {Uint8Array|null} [details] ADVSignedDeviceIdentityHMAC details + * @property {Uint8Array|null} [hmac] ADVSignedDeviceIdentityHMAC hmac */ /** - * Constructs a new WebInfo. + * Constructs a new ADVSignedDeviceIdentityHMAC. * @memberof proto - * @classdesc Represents a WebInfo. - * @implements IWebInfo + * @classdesc Represents a ADVSignedDeviceIdentityHMAC. + * @implements IADVSignedDeviceIdentityHMAC * @constructor - * @param {proto.IWebInfo=} [properties] Properties to set + * @param {proto.IADVSignedDeviceIdentityHMAC=} [properties] Properties to set */ - function WebInfo(properties) { + function ADVSignedDeviceIdentityHMAC(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -1453,114 +873,88 @@ $root.proto = (function() { } /** - * WebInfo refToken. - * @member {string} refToken - * @memberof proto.WebInfo - * @instance - */ - WebInfo.prototype.refToken = ""; - - /** - * WebInfo version. - * @member {string} version - * @memberof proto.WebInfo - * @instance - */ - WebInfo.prototype.version = ""; - - /** - * WebInfo webdPayload. - * @member {proto.IWebdPayload|null|undefined} webdPayload - * @memberof proto.WebInfo + * ADVSignedDeviceIdentityHMAC details. + * @member {Uint8Array} details + * @memberof proto.ADVSignedDeviceIdentityHMAC * @instance */ - WebInfo.prototype.webdPayload = null; + ADVSignedDeviceIdentityHMAC.prototype.details = $util.newBuffer([]); /** - * WebInfo webSubPlatform. - * @member {proto.WebInfo.WebInfoWebSubPlatform} webSubPlatform - * @memberof proto.WebInfo + * ADVSignedDeviceIdentityHMAC hmac. + * @member {Uint8Array} hmac + * @memberof proto.ADVSignedDeviceIdentityHMAC * @instance */ - WebInfo.prototype.webSubPlatform = 0; + ADVSignedDeviceIdentityHMAC.prototype.hmac = $util.newBuffer([]); /** - * Creates a new WebInfo instance using the specified properties. + * Creates a new ADVSignedDeviceIdentityHMAC instance using the specified properties. * @function create - * @memberof proto.WebInfo + * @memberof proto.ADVSignedDeviceIdentityHMAC * @static - * @param {proto.IWebInfo=} [properties] Properties to set - * @returns {proto.WebInfo} WebInfo instance + * @param {proto.IADVSignedDeviceIdentityHMAC=} [properties] Properties to set + * @returns {proto.ADVSignedDeviceIdentityHMAC} ADVSignedDeviceIdentityHMAC instance */ - WebInfo.create = function create(properties) { - return new WebInfo(properties); + ADVSignedDeviceIdentityHMAC.create = function create(properties) { + return new ADVSignedDeviceIdentityHMAC(properties); }; /** - * Encodes the specified WebInfo message. Does not implicitly {@link proto.WebInfo.verify|verify} messages. + * Encodes the specified ADVSignedDeviceIdentityHMAC message. Does not implicitly {@link proto.ADVSignedDeviceIdentityHMAC.verify|verify} messages. * @function encode - * @memberof proto.WebInfo + * @memberof proto.ADVSignedDeviceIdentityHMAC * @static - * @param {proto.IWebInfo} message WebInfo message or plain object to encode + * @param {proto.IADVSignedDeviceIdentityHMAC} message ADVSignedDeviceIdentityHMAC message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - WebInfo.encode = function encode(message, writer) { + ADVSignedDeviceIdentityHMAC.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.refToken != null && Object.hasOwnProperty.call(message, "refToken")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.refToken); - if (message.version != null && Object.hasOwnProperty.call(message, "version")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.version); - if (message.webdPayload != null && Object.hasOwnProperty.call(message, "webdPayload")) - $root.proto.WebdPayload.encode(message.webdPayload, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.webSubPlatform != null && Object.hasOwnProperty.call(message, "webSubPlatform")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.webSubPlatform); + if (message.details != null && Object.hasOwnProperty.call(message, "details")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.details); + if (message.hmac != null && Object.hasOwnProperty.call(message, "hmac")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.hmac); return writer; }; /** - * Encodes the specified WebInfo message, length delimited. Does not implicitly {@link proto.WebInfo.verify|verify} messages. + * Encodes the specified ADVSignedDeviceIdentityHMAC message, length delimited. Does not implicitly {@link proto.ADVSignedDeviceIdentityHMAC.verify|verify} messages. * @function encodeDelimited - * @memberof proto.WebInfo + * @memberof proto.ADVSignedDeviceIdentityHMAC * @static - * @param {proto.IWebInfo} message WebInfo message or plain object to encode + * @param {proto.IADVSignedDeviceIdentityHMAC} message ADVSignedDeviceIdentityHMAC message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - WebInfo.encodeDelimited = function encodeDelimited(message, writer) { + ADVSignedDeviceIdentityHMAC.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a WebInfo message from the specified reader or buffer. + * Decodes a ADVSignedDeviceIdentityHMAC message from the specified reader or buffer. * @function decode - * @memberof proto.WebInfo + * @memberof proto.ADVSignedDeviceIdentityHMAC * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {proto.WebInfo} WebInfo + * @returns {proto.ADVSignedDeviceIdentityHMAC} ADVSignedDeviceIdentityHMAC * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - WebInfo.decode = function decode(reader, length) { + ADVSignedDeviceIdentityHMAC.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.WebInfo(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.ADVSignedDeviceIdentityHMAC(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.refToken = reader.string(); + message.details = reader.bytes(); break; case 2: - message.version = reader.string(); - break; - case 3: - message.webdPayload = $root.proto.WebdPayload.decode(reader, reader.uint32()); - break; - case 4: - message.webSubPlatform = reader.int32(); + message.hmac = reader.bytes(); break; default: reader.skipType(tag & 7); @@ -1571,186 +965,135 @@ $root.proto = (function() { }; /** - * Decodes a WebInfo message from the specified reader or buffer, length delimited. + * Decodes a ADVSignedDeviceIdentityHMAC message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof proto.WebInfo + * @memberof proto.ADVSignedDeviceIdentityHMAC * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.WebInfo} WebInfo + * @returns {proto.ADVSignedDeviceIdentityHMAC} ADVSignedDeviceIdentityHMAC * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - WebInfo.decodeDelimited = function decodeDelimited(reader) { + ADVSignedDeviceIdentityHMAC.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a WebInfo message. + * Verifies a ADVSignedDeviceIdentityHMAC message. * @function verify - * @memberof proto.WebInfo + * @memberof proto.ADVSignedDeviceIdentityHMAC * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - WebInfo.verify = function verify(message) { + ADVSignedDeviceIdentityHMAC.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.refToken != null && message.hasOwnProperty("refToken")) - if (!$util.isString(message.refToken)) - return "refToken: string expected"; - if (message.version != null && message.hasOwnProperty("version")) - if (!$util.isString(message.version)) - return "version: string expected"; - if (message.webdPayload != null && message.hasOwnProperty("webdPayload")) { - var error = $root.proto.WebdPayload.verify(message.webdPayload); - if (error) - return "webdPayload." + error; - } - if (message.webSubPlatform != null && message.hasOwnProperty("webSubPlatform")) - switch (message.webSubPlatform) { - default: - return "webSubPlatform: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - break; - } - return null; - }; + if (message.details != null && message.hasOwnProperty("details")) + if (!(message.details && typeof message.details.length === "number" || $util.isString(message.details))) + return "details: buffer expected"; + if (message.hmac != null && message.hasOwnProperty("hmac")) + if (!(message.hmac && typeof message.hmac.length === "number" || $util.isString(message.hmac))) + return "hmac: buffer expected"; + return null; + }; /** - * Creates a WebInfo message from a plain object. Also converts values to their respective internal types. + * Creates a ADVSignedDeviceIdentityHMAC message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof proto.WebInfo + * @memberof proto.ADVSignedDeviceIdentityHMAC * @static * @param {Object.} object Plain object - * @returns {proto.WebInfo} WebInfo + * @returns {proto.ADVSignedDeviceIdentityHMAC} ADVSignedDeviceIdentityHMAC */ - WebInfo.fromObject = function fromObject(object) { - if (object instanceof $root.proto.WebInfo) + ADVSignedDeviceIdentityHMAC.fromObject = function fromObject(object) { + if (object instanceof $root.proto.ADVSignedDeviceIdentityHMAC) return object; - var message = new $root.proto.WebInfo(); - if (object.refToken != null) - message.refToken = String(object.refToken); - if (object.version != null) - message.version = String(object.version); - if (object.webdPayload != null) { - if (typeof object.webdPayload !== "object") - throw TypeError(".proto.WebInfo.webdPayload: object expected"); - message.webdPayload = $root.proto.WebdPayload.fromObject(object.webdPayload); - } - switch (object.webSubPlatform) { - case "WEB_BROWSER": - case 0: - message.webSubPlatform = 0; - break; - case "APP_STORE": - case 1: - message.webSubPlatform = 1; - break; - case "WIN_STORE": - case 2: - message.webSubPlatform = 2; - break; - case "DARWIN": - case 3: - message.webSubPlatform = 3; - break; - case "WIN32": - case 4: - message.webSubPlatform = 4; - break; - } + var message = new $root.proto.ADVSignedDeviceIdentityHMAC(); + if (object.details != null) + if (typeof object.details === "string") + $util.base64.decode(object.details, message.details = $util.newBuffer($util.base64.length(object.details)), 0); + else if (object.details.length) + message.details = object.details; + if (object.hmac != null) + if (typeof object.hmac === "string") + $util.base64.decode(object.hmac, message.hmac = $util.newBuffer($util.base64.length(object.hmac)), 0); + else if (object.hmac.length) + message.hmac = object.hmac; return message; }; /** - * Creates a plain object from a WebInfo message. Also converts values to other types if specified. + * Creates a plain object from a ADVSignedDeviceIdentityHMAC message. Also converts values to other types if specified. * @function toObject - * @memberof proto.WebInfo + * @memberof proto.ADVSignedDeviceIdentityHMAC * @static - * @param {proto.WebInfo} message WebInfo + * @param {proto.ADVSignedDeviceIdentityHMAC} message ADVSignedDeviceIdentityHMAC * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - WebInfo.toObject = function toObject(message, options) { + ADVSignedDeviceIdentityHMAC.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.refToken = ""; - object.version = ""; - object.webdPayload = null; - object.webSubPlatform = options.enums === String ? "WEB_BROWSER" : 0; + if (options.bytes === String) + object.details = ""; + else { + object.details = []; + if (options.bytes !== Array) + object.details = $util.newBuffer(object.details); + } + if (options.bytes === String) + object.hmac = ""; + else { + object.hmac = []; + if (options.bytes !== Array) + object.hmac = $util.newBuffer(object.hmac); + } } - if (message.refToken != null && message.hasOwnProperty("refToken")) - object.refToken = message.refToken; - if (message.version != null && message.hasOwnProperty("version")) - object.version = message.version; - if (message.webdPayload != null && message.hasOwnProperty("webdPayload")) - object.webdPayload = $root.proto.WebdPayload.toObject(message.webdPayload, options); - if (message.webSubPlatform != null && message.hasOwnProperty("webSubPlatform")) - object.webSubPlatform = options.enums === String ? $root.proto.WebInfo.WebInfoWebSubPlatform[message.webSubPlatform] : message.webSubPlatform; + if (message.details != null && message.hasOwnProperty("details")) + object.details = options.bytes === String ? $util.base64.encode(message.details, 0, message.details.length) : options.bytes === Array ? Array.prototype.slice.call(message.details) : message.details; + if (message.hmac != null && message.hasOwnProperty("hmac")) + object.hmac = options.bytes === String ? $util.base64.encode(message.hmac, 0, message.hmac.length) : options.bytes === Array ? Array.prototype.slice.call(message.hmac) : message.hmac; return object; }; /** - * Converts this WebInfo to JSON. + * Converts this ADVSignedDeviceIdentityHMAC to JSON. * @function toJSON - * @memberof proto.WebInfo + * @memberof proto.ADVSignedDeviceIdentityHMAC * @instance * @returns {Object.} JSON object */ - WebInfo.prototype.toJSON = function toJSON() { + ADVSignedDeviceIdentityHMAC.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - /** - * WebInfoWebSubPlatform enum. - * @name proto.WebInfo.WebInfoWebSubPlatform - * @enum {number} - * @property {number} WEB_BROWSER=0 WEB_BROWSER value - * @property {number} APP_STORE=1 APP_STORE value - * @property {number} WIN_STORE=2 WIN_STORE value - * @property {number} DARWIN=3 DARWIN value - * @property {number} WIN32=4 WIN32 value - */ - WebInfo.WebInfoWebSubPlatform = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "WEB_BROWSER"] = 0; - values[valuesById[1] = "APP_STORE"] = 1; - values[valuesById[2] = "WIN_STORE"] = 2; - values[valuesById[3] = "DARWIN"] = 3; - values[valuesById[4] = "WIN32"] = 4; - return values; - })(); - - return WebInfo; + return ADVSignedDeviceIdentityHMAC; })(); - proto.DNSSource = (function() { + proto.ADVSignedKeyIndexList = (function() { /** - * Properties of a DNSSource. + * Properties of a ADVSignedKeyIndexList. * @memberof proto - * @interface IDNSSource - * @property {proto.DNSSource.DNSSourceDNSResolutionMethod|null} [dnsMethod] DNSSource dnsMethod - * @property {boolean|null} [appCached] DNSSource appCached + * @interface IADVSignedKeyIndexList + * @property {Uint8Array|null} [details] ADVSignedKeyIndexList details + * @property {Uint8Array|null} [accountSignature] ADVSignedKeyIndexList accountSignature */ /** - * Constructs a new DNSSource. + * Constructs a new ADVSignedKeyIndexList. * @memberof proto - * @classdesc Represents a DNSSource. - * @implements IDNSSource + * @classdesc Represents a ADVSignedKeyIndexList. + * @implements IADVSignedKeyIndexList * @constructor - * @param {proto.IDNSSource=} [properties] Properties to set + * @param {proto.IADVSignedKeyIndexList=} [properties] Properties to set */ - function DNSSource(properties) { + function ADVSignedKeyIndexList(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -1758,88 +1101,88 @@ $root.proto = (function() { } /** - * DNSSource dnsMethod. - * @member {proto.DNSSource.DNSSourceDNSResolutionMethod} dnsMethod - * @memberof proto.DNSSource + * ADVSignedKeyIndexList details. + * @member {Uint8Array} details + * @memberof proto.ADVSignedKeyIndexList * @instance */ - DNSSource.prototype.dnsMethod = 0; + ADVSignedKeyIndexList.prototype.details = $util.newBuffer([]); /** - * DNSSource appCached. - * @member {boolean} appCached - * @memberof proto.DNSSource + * ADVSignedKeyIndexList accountSignature. + * @member {Uint8Array} accountSignature + * @memberof proto.ADVSignedKeyIndexList * @instance */ - DNSSource.prototype.appCached = false; + ADVSignedKeyIndexList.prototype.accountSignature = $util.newBuffer([]); /** - * Creates a new DNSSource instance using the specified properties. + * Creates a new ADVSignedKeyIndexList instance using the specified properties. * @function create - * @memberof proto.DNSSource + * @memberof proto.ADVSignedKeyIndexList * @static - * @param {proto.IDNSSource=} [properties] Properties to set - * @returns {proto.DNSSource} DNSSource instance + * @param {proto.IADVSignedKeyIndexList=} [properties] Properties to set + * @returns {proto.ADVSignedKeyIndexList} ADVSignedKeyIndexList instance */ - DNSSource.create = function create(properties) { - return new DNSSource(properties); + ADVSignedKeyIndexList.create = function create(properties) { + return new ADVSignedKeyIndexList(properties); }; /** - * Encodes the specified DNSSource message. Does not implicitly {@link proto.DNSSource.verify|verify} messages. + * Encodes the specified ADVSignedKeyIndexList message. Does not implicitly {@link proto.ADVSignedKeyIndexList.verify|verify} messages. * @function encode - * @memberof proto.DNSSource + * @memberof proto.ADVSignedKeyIndexList * @static - * @param {proto.IDNSSource} message DNSSource message or plain object to encode + * @param {proto.IADVSignedKeyIndexList} message ADVSignedKeyIndexList message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DNSSource.encode = function encode(message, writer) { + ADVSignedKeyIndexList.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.dnsMethod != null && Object.hasOwnProperty.call(message, "dnsMethod")) - writer.uint32(/* id 15, wireType 0 =*/120).int32(message.dnsMethod); - if (message.appCached != null && Object.hasOwnProperty.call(message, "appCached")) - writer.uint32(/* id 16, wireType 0 =*/128).bool(message.appCached); + if (message.details != null && Object.hasOwnProperty.call(message, "details")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.details); + if (message.accountSignature != null && Object.hasOwnProperty.call(message, "accountSignature")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.accountSignature); return writer; }; /** - * Encodes the specified DNSSource message, length delimited. Does not implicitly {@link proto.DNSSource.verify|verify} messages. + * Encodes the specified ADVSignedKeyIndexList message, length delimited. Does not implicitly {@link proto.ADVSignedKeyIndexList.verify|verify} messages. * @function encodeDelimited - * @memberof proto.DNSSource + * @memberof proto.ADVSignedKeyIndexList * @static - * @param {proto.IDNSSource} message DNSSource message or plain object to encode + * @param {proto.IADVSignedKeyIndexList} message ADVSignedKeyIndexList message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DNSSource.encodeDelimited = function encodeDelimited(message, writer) { + ADVSignedKeyIndexList.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a DNSSource message from the specified reader or buffer. + * Decodes a ADVSignedKeyIndexList message from the specified reader or buffer. * @function decode - * @memberof proto.DNSSource + * @memberof proto.ADVSignedKeyIndexList * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {proto.DNSSource} DNSSource + * @returns {proto.ADVSignedKeyIndexList} ADVSignedKeyIndexList * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DNSSource.decode = function decode(reader, length) { + ADVSignedKeyIndexList.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.DNSSource(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.ADVSignedKeyIndexList(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 15: - message.dnsMethod = reader.int32(); + case 1: + message.details = reader.bytes(); break; - case 16: - message.appCached = reader.bool(); + case 2: + message.accountSignature = reader.bytes(); break; default: reader.skipType(tag & 7); @@ -1850,171 +1193,138 @@ $root.proto = (function() { }; /** - * Decodes a DNSSource message from the specified reader or buffer, length delimited. + * Decodes a ADVSignedKeyIndexList message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof proto.DNSSource + * @memberof proto.ADVSignedKeyIndexList * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.DNSSource} DNSSource + * @returns {proto.ADVSignedKeyIndexList} ADVSignedKeyIndexList * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DNSSource.decodeDelimited = function decodeDelimited(reader) { + ADVSignedKeyIndexList.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a DNSSource message. + * Verifies a ADVSignedKeyIndexList message. * @function verify - * @memberof proto.DNSSource + * @memberof proto.ADVSignedKeyIndexList * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - DNSSource.verify = function verify(message) { + ADVSignedKeyIndexList.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.dnsMethod != null && message.hasOwnProperty("dnsMethod")) - switch (message.dnsMethod) { - default: - return "dnsMethod: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - break; - } - if (message.appCached != null && message.hasOwnProperty("appCached")) - if (typeof message.appCached !== "boolean") - return "appCached: boolean expected"; + if (message.details != null && message.hasOwnProperty("details")) + if (!(message.details && typeof message.details.length === "number" || $util.isString(message.details))) + return "details: buffer expected"; + if (message.accountSignature != null && message.hasOwnProperty("accountSignature")) + if (!(message.accountSignature && typeof message.accountSignature.length === "number" || $util.isString(message.accountSignature))) + return "accountSignature: buffer expected"; return null; }; /** - * Creates a DNSSource message from a plain object. Also converts values to their respective internal types. + * Creates a ADVSignedKeyIndexList message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof proto.DNSSource + * @memberof proto.ADVSignedKeyIndexList * @static * @param {Object.} object Plain object - * @returns {proto.DNSSource} DNSSource + * @returns {proto.ADVSignedKeyIndexList} ADVSignedKeyIndexList */ - DNSSource.fromObject = function fromObject(object) { - if (object instanceof $root.proto.DNSSource) + ADVSignedKeyIndexList.fromObject = function fromObject(object) { + if (object instanceof $root.proto.ADVSignedKeyIndexList) return object; - var message = new $root.proto.DNSSource(); - switch (object.dnsMethod) { - case "SYSTEM": - case 0: - message.dnsMethod = 0; - break; - case "GOOGLE": - case 1: - message.dnsMethod = 1; - break; - case "HARDCODED": - case 2: - message.dnsMethod = 2; - break; - case "OVERRIDE": - case 3: - message.dnsMethod = 3; - break; - case "FALLBACK": - case 4: - message.dnsMethod = 4; - break; - } - if (object.appCached != null) - message.appCached = Boolean(object.appCached); + var message = new $root.proto.ADVSignedKeyIndexList(); + if (object.details != null) + if (typeof object.details === "string") + $util.base64.decode(object.details, message.details = $util.newBuffer($util.base64.length(object.details)), 0); + else if (object.details.length) + message.details = object.details; + if (object.accountSignature != null) + if (typeof object.accountSignature === "string") + $util.base64.decode(object.accountSignature, message.accountSignature = $util.newBuffer($util.base64.length(object.accountSignature)), 0); + else if (object.accountSignature.length) + message.accountSignature = object.accountSignature; return message; }; /** - * Creates a plain object from a DNSSource message. Also converts values to other types if specified. + * Creates a plain object from a ADVSignedKeyIndexList message. Also converts values to other types if specified. * @function toObject - * @memberof proto.DNSSource + * @memberof proto.ADVSignedKeyIndexList * @static - * @param {proto.DNSSource} message DNSSource + * @param {proto.ADVSignedKeyIndexList} message ADVSignedKeyIndexList * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DNSSource.toObject = function toObject(message, options) { + ADVSignedKeyIndexList.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.dnsMethod = options.enums === String ? "SYSTEM" : 0; - object.appCached = false; + if (options.bytes === String) + object.details = ""; + else { + object.details = []; + if (options.bytes !== Array) + object.details = $util.newBuffer(object.details); + } + if (options.bytes === String) + object.accountSignature = ""; + else { + object.accountSignature = []; + if (options.bytes !== Array) + object.accountSignature = $util.newBuffer(object.accountSignature); + } } - if (message.dnsMethod != null && message.hasOwnProperty("dnsMethod")) - object.dnsMethod = options.enums === String ? $root.proto.DNSSource.DNSSourceDNSResolutionMethod[message.dnsMethod] : message.dnsMethod; - if (message.appCached != null && message.hasOwnProperty("appCached")) - object.appCached = message.appCached; + if (message.details != null && message.hasOwnProperty("details")) + object.details = options.bytes === String ? $util.base64.encode(message.details, 0, message.details.length) : options.bytes === Array ? Array.prototype.slice.call(message.details) : message.details; + if (message.accountSignature != null && message.hasOwnProperty("accountSignature")) + object.accountSignature = options.bytes === String ? $util.base64.encode(message.accountSignature, 0, message.accountSignature.length) : options.bytes === Array ? Array.prototype.slice.call(message.accountSignature) : message.accountSignature; return object; }; /** - * Converts this DNSSource to JSON. + * Converts this ADVSignedKeyIndexList to JSON. * @function toJSON - * @memberof proto.DNSSource + * @memberof proto.ADVSignedKeyIndexList * @instance * @returns {Object.} JSON object */ - DNSSource.prototype.toJSON = function toJSON() { + ADVSignedKeyIndexList.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - /** - * DNSSourceDNSResolutionMethod enum. - * @name proto.DNSSource.DNSSourceDNSResolutionMethod - * @enum {number} - * @property {number} SYSTEM=0 SYSTEM value - * @property {number} GOOGLE=1 GOOGLE value - * @property {number} HARDCODED=2 HARDCODED value - * @property {number} OVERRIDE=3 OVERRIDE value - * @property {number} FALLBACK=4 FALLBACK value - */ - DNSSource.DNSSourceDNSResolutionMethod = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "SYSTEM"] = 0; - values[valuesById[1] = "GOOGLE"] = 1; - values[valuesById[2] = "HARDCODED"] = 2; - values[valuesById[3] = "OVERRIDE"] = 3; - values[valuesById[4] = "FALLBACK"] = 4; - return values; - })(); - - return DNSSource; + return ADVSignedKeyIndexList; })(); - proto.CompanionRegData = (function() { + proto.AppVersion = (function() { /** - * Properties of a CompanionRegData. + * Properties of an AppVersion. * @memberof proto - * @interface ICompanionRegData - * @property {Uint8Array|null} [eRegid] CompanionRegData eRegid - * @property {Uint8Array|null} [eKeytype] CompanionRegData eKeytype - * @property {Uint8Array|null} [eIdent] CompanionRegData eIdent - * @property {Uint8Array|null} [eSkeyId] CompanionRegData eSkeyId - * @property {Uint8Array|null} [eSkeyVal] CompanionRegData eSkeyVal - * @property {Uint8Array|null} [eSkeySig] CompanionRegData eSkeySig - * @property {Uint8Array|null} [buildHash] CompanionRegData buildHash - * @property {Uint8Array|null} [companionProps] CompanionRegData companionProps + * @interface IAppVersion + * @property {number|null} [primary] AppVersion primary + * @property {number|null} [secondary] AppVersion secondary + * @property {number|null} [tertiary] AppVersion tertiary + * @property {number|null} [quaternary] AppVersion quaternary + * @property {number|null} [quinary] AppVersion quinary */ /** - * Constructs a new CompanionRegData. + * Constructs a new AppVersion. * @memberof proto - * @classdesc Represents a CompanionRegData. - * @implements ICompanionRegData + * @classdesc Represents an AppVersion. + * @implements IAppVersion * @constructor - * @param {proto.ICompanionRegData=} [properties] Properties to set + * @param {proto.IAppVersion=} [properties] Properties to set */ - function CompanionRegData(properties) { + function AppVersion(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -2022,166 +1332,127 @@ $root.proto = (function() { } /** - * CompanionRegData eRegid. - * @member {Uint8Array} eRegid - * @memberof proto.CompanionRegData - * @instance - */ - CompanionRegData.prototype.eRegid = $util.newBuffer([]); - - /** - * CompanionRegData eKeytype. - * @member {Uint8Array} eKeytype - * @memberof proto.CompanionRegData - * @instance - */ - CompanionRegData.prototype.eKeytype = $util.newBuffer([]); - - /** - * CompanionRegData eIdent. - * @member {Uint8Array} eIdent - * @memberof proto.CompanionRegData - * @instance - */ - CompanionRegData.prototype.eIdent = $util.newBuffer([]); - - /** - * CompanionRegData eSkeyId. - * @member {Uint8Array} eSkeyId - * @memberof proto.CompanionRegData + * AppVersion primary. + * @member {number} primary + * @memberof proto.AppVersion * @instance */ - CompanionRegData.prototype.eSkeyId = $util.newBuffer([]); + AppVersion.prototype.primary = 0; /** - * CompanionRegData eSkeyVal. - * @member {Uint8Array} eSkeyVal - * @memberof proto.CompanionRegData + * AppVersion secondary. + * @member {number} secondary + * @memberof proto.AppVersion * @instance */ - CompanionRegData.prototype.eSkeyVal = $util.newBuffer([]); + AppVersion.prototype.secondary = 0; /** - * CompanionRegData eSkeySig. - * @member {Uint8Array} eSkeySig - * @memberof proto.CompanionRegData + * AppVersion tertiary. + * @member {number} tertiary + * @memberof proto.AppVersion * @instance */ - CompanionRegData.prototype.eSkeySig = $util.newBuffer([]); + AppVersion.prototype.tertiary = 0; /** - * CompanionRegData buildHash. - * @member {Uint8Array} buildHash - * @memberof proto.CompanionRegData + * AppVersion quaternary. + * @member {number} quaternary + * @memberof proto.AppVersion * @instance */ - CompanionRegData.prototype.buildHash = $util.newBuffer([]); + AppVersion.prototype.quaternary = 0; /** - * CompanionRegData companionProps. - * @member {Uint8Array} companionProps - * @memberof proto.CompanionRegData + * AppVersion quinary. + * @member {number} quinary + * @memberof proto.AppVersion * @instance */ - CompanionRegData.prototype.companionProps = $util.newBuffer([]); + AppVersion.prototype.quinary = 0; /** - * Creates a new CompanionRegData instance using the specified properties. + * Creates a new AppVersion instance using the specified properties. * @function create - * @memberof proto.CompanionRegData + * @memberof proto.AppVersion * @static - * @param {proto.ICompanionRegData=} [properties] Properties to set - * @returns {proto.CompanionRegData} CompanionRegData instance + * @param {proto.IAppVersion=} [properties] Properties to set + * @returns {proto.AppVersion} AppVersion instance */ - CompanionRegData.create = function create(properties) { - return new CompanionRegData(properties); + AppVersion.create = function create(properties) { + return new AppVersion(properties); }; /** - * Encodes the specified CompanionRegData message. Does not implicitly {@link proto.CompanionRegData.verify|verify} messages. + * Encodes the specified AppVersion message. Does not implicitly {@link proto.AppVersion.verify|verify} messages. * @function encode - * @memberof proto.CompanionRegData + * @memberof proto.AppVersion * @static - * @param {proto.ICompanionRegData} message CompanionRegData message or plain object to encode + * @param {proto.IAppVersion} message AppVersion message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CompanionRegData.encode = function encode(message, writer) { + AppVersion.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.eRegid != null && Object.hasOwnProperty.call(message, "eRegid")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.eRegid); - if (message.eKeytype != null && Object.hasOwnProperty.call(message, "eKeytype")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.eKeytype); - if (message.eIdent != null && Object.hasOwnProperty.call(message, "eIdent")) - writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.eIdent); - if (message.eSkeyId != null && Object.hasOwnProperty.call(message, "eSkeyId")) - writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.eSkeyId); - if (message.eSkeyVal != null && Object.hasOwnProperty.call(message, "eSkeyVal")) - writer.uint32(/* id 5, wireType 2 =*/42).bytes(message.eSkeyVal); - if (message.eSkeySig != null && Object.hasOwnProperty.call(message, "eSkeySig")) - writer.uint32(/* id 6, wireType 2 =*/50).bytes(message.eSkeySig); - if (message.buildHash != null && Object.hasOwnProperty.call(message, "buildHash")) - writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.buildHash); - if (message.companionProps != null && Object.hasOwnProperty.call(message, "companionProps")) - writer.uint32(/* id 8, wireType 2 =*/66).bytes(message.companionProps); + if (message.primary != null && Object.hasOwnProperty.call(message, "primary")) + writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.primary); + if (message.secondary != null && Object.hasOwnProperty.call(message, "secondary")) + writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.secondary); + if (message.tertiary != null && Object.hasOwnProperty.call(message, "tertiary")) + writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.tertiary); + if (message.quaternary != null && Object.hasOwnProperty.call(message, "quaternary")) + writer.uint32(/* id 4, wireType 0 =*/32).uint32(message.quaternary); + if (message.quinary != null && Object.hasOwnProperty.call(message, "quinary")) + writer.uint32(/* id 5, wireType 0 =*/40).uint32(message.quinary); return writer; }; /** - * Encodes the specified CompanionRegData message, length delimited. Does not implicitly {@link proto.CompanionRegData.verify|verify} messages. + * Encodes the specified AppVersion message, length delimited. Does not implicitly {@link proto.AppVersion.verify|verify} messages. * @function encodeDelimited - * @memberof proto.CompanionRegData + * @memberof proto.AppVersion * @static - * @param {proto.ICompanionRegData} message CompanionRegData message or plain object to encode + * @param {proto.IAppVersion} message AppVersion message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CompanionRegData.encodeDelimited = function encodeDelimited(message, writer) { + AppVersion.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a CompanionRegData message from the specified reader or buffer. + * Decodes an AppVersion message from the specified reader or buffer. * @function decode - * @memberof proto.CompanionRegData + * @memberof proto.AppVersion * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {proto.CompanionRegData} CompanionRegData + * @returns {proto.AppVersion} AppVersion * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CompanionRegData.decode = function decode(reader, length) { + AppVersion.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.CompanionRegData(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.AppVersion(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.eRegid = reader.bytes(); + message.primary = reader.uint32(); break; case 2: - message.eKeytype = reader.bytes(); + message.secondary = reader.uint32(); break; case 3: - message.eIdent = reader.bytes(); + message.tertiary = reader.uint32(); break; case 4: - message.eSkeyId = reader.bytes(); + message.quaternary = reader.uint32(); break; case 5: - message.eSkeyVal = reader.bytes(); - break; - case 6: - message.eSkeySig = reader.bytes(); - break; - case 7: - message.buildHash = reader.bytes(); - break; - case 8: - message.companionProps = reader.bytes(); + message.quinary = reader.uint32(); break; default: reader.skipType(tag & 7); @@ -2192,258 +1463,143 @@ $root.proto = (function() { }; /** - * Decodes a CompanionRegData message from the specified reader or buffer, length delimited. + * Decodes an AppVersion message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof proto.CompanionRegData + * @memberof proto.AppVersion * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.CompanionRegData} CompanionRegData + * @returns {proto.AppVersion} AppVersion * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CompanionRegData.decodeDelimited = function decodeDelimited(reader) { + AppVersion.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a CompanionRegData message. + * Verifies an AppVersion message. * @function verify - * @memberof proto.CompanionRegData + * @memberof proto.AppVersion * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - CompanionRegData.verify = function verify(message) { + AppVersion.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.eRegid != null && message.hasOwnProperty("eRegid")) - if (!(message.eRegid && typeof message.eRegid.length === "number" || $util.isString(message.eRegid))) - return "eRegid: buffer expected"; - if (message.eKeytype != null && message.hasOwnProperty("eKeytype")) - if (!(message.eKeytype && typeof message.eKeytype.length === "number" || $util.isString(message.eKeytype))) - return "eKeytype: buffer expected"; - if (message.eIdent != null && message.hasOwnProperty("eIdent")) - if (!(message.eIdent && typeof message.eIdent.length === "number" || $util.isString(message.eIdent))) - return "eIdent: buffer expected"; - if (message.eSkeyId != null && message.hasOwnProperty("eSkeyId")) - if (!(message.eSkeyId && typeof message.eSkeyId.length === "number" || $util.isString(message.eSkeyId))) - return "eSkeyId: buffer expected"; - if (message.eSkeyVal != null && message.hasOwnProperty("eSkeyVal")) - if (!(message.eSkeyVal && typeof message.eSkeyVal.length === "number" || $util.isString(message.eSkeyVal))) - return "eSkeyVal: buffer expected"; - if (message.eSkeySig != null && message.hasOwnProperty("eSkeySig")) - if (!(message.eSkeySig && typeof message.eSkeySig.length === "number" || $util.isString(message.eSkeySig))) - return "eSkeySig: buffer expected"; - if (message.buildHash != null && message.hasOwnProperty("buildHash")) - if (!(message.buildHash && typeof message.buildHash.length === "number" || $util.isString(message.buildHash))) - return "buildHash: buffer expected"; - if (message.companionProps != null && message.hasOwnProperty("companionProps")) - if (!(message.companionProps && typeof message.companionProps.length === "number" || $util.isString(message.companionProps))) - return "companionProps: buffer expected"; + if (message.primary != null && message.hasOwnProperty("primary")) + if (!$util.isInteger(message.primary)) + return "primary: integer expected"; + if (message.secondary != null && message.hasOwnProperty("secondary")) + if (!$util.isInteger(message.secondary)) + return "secondary: integer expected"; + if (message.tertiary != null && message.hasOwnProperty("tertiary")) + if (!$util.isInteger(message.tertiary)) + return "tertiary: integer expected"; + if (message.quaternary != null && message.hasOwnProperty("quaternary")) + if (!$util.isInteger(message.quaternary)) + return "quaternary: integer expected"; + if (message.quinary != null && message.hasOwnProperty("quinary")) + if (!$util.isInteger(message.quinary)) + return "quinary: integer expected"; return null; }; /** - * Creates a CompanionRegData message from a plain object. Also converts values to their respective internal types. + * Creates an AppVersion message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof proto.CompanionRegData + * @memberof proto.AppVersion * @static * @param {Object.} object Plain object - * @returns {proto.CompanionRegData} CompanionRegData + * @returns {proto.AppVersion} AppVersion */ - CompanionRegData.fromObject = function fromObject(object) { - if (object instanceof $root.proto.CompanionRegData) + AppVersion.fromObject = function fromObject(object) { + if (object instanceof $root.proto.AppVersion) return object; - var message = new $root.proto.CompanionRegData(); - if (object.eRegid != null) - if (typeof object.eRegid === "string") - $util.base64.decode(object.eRegid, message.eRegid = $util.newBuffer($util.base64.length(object.eRegid)), 0); - else if (object.eRegid.length) - message.eRegid = object.eRegid; - if (object.eKeytype != null) - if (typeof object.eKeytype === "string") - $util.base64.decode(object.eKeytype, message.eKeytype = $util.newBuffer($util.base64.length(object.eKeytype)), 0); - else if (object.eKeytype.length) - message.eKeytype = object.eKeytype; - if (object.eIdent != null) - if (typeof object.eIdent === "string") - $util.base64.decode(object.eIdent, message.eIdent = $util.newBuffer($util.base64.length(object.eIdent)), 0); - else if (object.eIdent.length) - message.eIdent = object.eIdent; - if (object.eSkeyId != null) - if (typeof object.eSkeyId === "string") - $util.base64.decode(object.eSkeyId, message.eSkeyId = $util.newBuffer($util.base64.length(object.eSkeyId)), 0); - else if (object.eSkeyId.length) - message.eSkeyId = object.eSkeyId; - if (object.eSkeyVal != null) - if (typeof object.eSkeyVal === "string") - $util.base64.decode(object.eSkeyVal, message.eSkeyVal = $util.newBuffer($util.base64.length(object.eSkeyVal)), 0); - else if (object.eSkeyVal.length) - message.eSkeyVal = object.eSkeyVal; - if (object.eSkeySig != null) - if (typeof object.eSkeySig === "string") - $util.base64.decode(object.eSkeySig, message.eSkeySig = $util.newBuffer($util.base64.length(object.eSkeySig)), 0); - else if (object.eSkeySig.length) - message.eSkeySig = object.eSkeySig; - if (object.buildHash != null) - if (typeof object.buildHash === "string") - $util.base64.decode(object.buildHash, message.buildHash = $util.newBuffer($util.base64.length(object.buildHash)), 0); - else if (object.buildHash.length) - message.buildHash = object.buildHash; - if (object.companionProps != null) - if (typeof object.companionProps === "string") - $util.base64.decode(object.companionProps, message.companionProps = $util.newBuffer($util.base64.length(object.companionProps)), 0); - else if (object.companionProps.length) - message.companionProps = object.companionProps; + var message = new $root.proto.AppVersion(); + if (object.primary != null) + message.primary = object.primary >>> 0; + if (object.secondary != null) + message.secondary = object.secondary >>> 0; + if (object.tertiary != null) + message.tertiary = object.tertiary >>> 0; + if (object.quaternary != null) + message.quaternary = object.quaternary >>> 0; + if (object.quinary != null) + message.quinary = object.quinary >>> 0; return message; }; /** - * Creates a plain object from a CompanionRegData message. Also converts values to other types if specified. + * Creates a plain object from an AppVersion message. Also converts values to other types if specified. * @function toObject - * @memberof proto.CompanionRegData + * @memberof proto.AppVersion * @static - * @param {proto.CompanionRegData} message CompanionRegData + * @param {proto.AppVersion} message AppVersion * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CompanionRegData.toObject = function toObject(message, options) { + AppVersion.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - if (options.bytes === String) - object.eRegid = ""; - else { - object.eRegid = []; - if (options.bytes !== Array) - object.eRegid = $util.newBuffer(object.eRegid); - } - if (options.bytes === String) - object.eKeytype = ""; - else { - object.eKeytype = []; - if (options.bytes !== Array) - object.eKeytype = $util.newBuffer(object.eKeytype); - } - if (options.bytes === String) - object.eIdent = ""; - else { - object.eIdent = []; - if (options.bytes !== Array) - object.eIdent = $util.newBuffer(object.eIdent); - } - if (options.bytes === String) - object.eSkeyId = ""; - else { - object.eSkeyId = []; - if (options.bytes !== Array) - object.eSkeyId = $util.newBuffer(object.eSkeyId); - } - if (options.bytes === String) - object.eSkeyVal = ""; - else { - object.eSkeyVal = []; - if (options.bytes !== Array) - object.eSkeyVal = $util.newBuffer(object.eSkeyVal); - } - if (options.bytes === String) - object.eSkeySig = ""; - else { - object.eSkeySig = []; - if (options.bytes !== Array) - object.eSkeySig = $util.newBuffer(object.eSkeySig); - } - if (options.bytes === String) - object.buildHash = ""; - else { - object.buildHash = []; - if (options.bytes !== Array) - object.buildHash = $util.newBuffer(object.buildHash); - } - if (options.bytes === String) - object.companionProps = ""; - else { - object.companionProps = []; - if (options.bytes !== Array) - object.companionProps = $util.newBuffer(object.companionProps); - } + object.primary = 0; + object.secondary = 0; + object.tertiary = 0; + object.quaternary = 0; + object.quinary = 0; } - if (message.eRegid != null && message.hasOwnProperty("eRegid")) - object.eRegid = options.bytes === String ? $util.base64.encode(message.eRegid, 0, message.eRegid.length) : options.bytes === Array ? Array.prototype.slice.call(message.eRegid) : message.eRegid; - if (message.eKeytype != null && message.hasOwnProperty("eKeytype")) - object.eKeytype = options.bytes === String ? $util.base64.encode(message.eKeytype, 0, message.eKeytype.length) : options.bytes === Array ? Array.prototype.slice.call(message.eKeytype) : message.eKeytype; - if (message.eIdent != null && message.hasOwnProperty("eIdent")) - object.eIdent = options.bytes === String ? $util.base64.encode(message.eIdent, 0, message.eIdent.length) : options.bytes === Array ? Array.prototype.slice.call(message.eIdent) : message.eIdent; - if (message.eSkeyId != null && message.hasOwnProperty("eSkeyId")) - object.eSkeyId = options.bytes === String ? $util.base64.encode(message.eSkeyId, 0, message.eSkeyId.length) : options.bytes === Array ? Array.prototype.slice.call(message.eSkeyId) : message.eSkeyId; - if (message.eSkeyVal != null && message.hasOwnProperty("eSkeyVal")) - object.eSkeyVal = options.bytes === String ? $util.base64.encode(message.eSkeyVal, 0, message.eSkeyVal.length) : options.bytes === Array ? Array.prototype.slice.call(message.eSkeyVal) : message.eSkeyVal; - if (message.eSkeySig != null && message.hasOwnProperty("eSkeySig")) - object.eSkeySig = options.bytes === String ? $util.base64.encode(message.eSkeySig, 0, message.eSkeySig.length) : options.bytes === Array ? Array.prototype.slice.call(message.eSkeySig) : message.eSkeySig; - if (message.buildHash != null && message.hasOwnProperty("buildHash")) - object.buildHash = options.bytes === String ? $util.base64.encode(message.buildHash, 0, message.buildHash.length) : options.bytes === Array ? Array.prototype.slice.call(message.buildHash) : message.buildHash; - if (message.companionProps != null && message.hasOwnProperty("companionProps")) - object.companionProps = options.bytes === String ? $util.base64.encode(message.companionProps, 0, message.companionProps.length) : options.bytes === Array ? Array.prototype.slice.call(message.companionProps) : message.companionProps; + if (message.primary != null && message.hasOwnProperty("primary")) + object.primary = message.primary; + if (message.secondary != null && message.hasOwnProperty("secondary")) + object.secondary = message.secondary; + if (message.tertiary != null && message.hasOwnProperty("tertiary")) + object.tertiary = message.tertiary; + if (message.quaternary != null && message.hasOwnProperty("quaternary")) + object.quaternary = message.quaternary; + if (message.quinary != null && message.hasOwnProperty("quinary")) + object.quinary = message.quinary; return object; }; /** - * Converts this CompanionRegData to JSON. + * Converts this AppVersion to JSON. * @function toJSON - * @memberof proto.CompanionRegData + * @memberof proto.AppVersion * @instance * @returns {Object.} JSON object */ - CompanionRegData.prototype.toJSON = function toJSON() { + AppVersion.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return CompanionRegData; + return AppVersion; })(); - proto.ClientPayload = (function() { + proto.CompanionProps = (function() { /** - * Properties of a ClientPayload. + * Properties of a CompanionProps. * @memberof proto - * @interface IClientPayload - * @property {number|Long|null} [username] ClientPayload username - * @property {boolean|null} [passive] ClientPayload passive - * @property {proto.IUserAgent|null} [userAgent] ClientPayload userAgent - * @property {proto.IWebInfo|null} [webInfo] ClientPayload webInfo - * @property {string|null} [pushName] ClientPayload pushName - * @property {number|null} [sessionId] ClientPayload sessionId - * @property {boolean|null} [shortConnect] ClientPayload shortConnect - * @property {proto.ClientPayload.ClientPayloadConnectType|null} [connectType] ClientPayload connectType - * @property {proto.ClientPayload.ClientPayloadConnectReason|null} [connectReason] ClientPayload connectReason - * @property {Array.|null} [shards] ClientPayload shards - * @property {proto.IDNSSource|null} [dnsSource] ClientPayload dnsSource - * @property {number|null} [connectAttemptCount] ClientPayload connectAttemptCount - * @property {number|null} [device] ClientPayload device - * @property {proto.ICompanionRegData|null} [regData] ClientPayload regData - * @property {proto.ClientPayload.ClientPayloadProduct|null} [product] ClientPayload product - * @property {Uint8Array|null} [fbCat] ClientPayload fbCat - * @property {Uint8Array|null} [fbUserAgent] ClientPayload fbUserAgent - * @property {boolean|null} [oc] ClientPayload oc - * @property {number|null} [lc] ClientPayload lc - * @property {proto.ClientPayload.ClientPayloadIOSAppExtension|null} [iosAppExtension] ClientPayload iosAppExtension - * @property {number|Long|null} [fbAppId] ClientPayload fbAppId - * @property {Uint8Array|null} [fbDeviceId] ClientPayload fbDeviceId + * @interface ICompanionProps + * @property {string|null} [os] CompanionProps os + * @property {proto.IAppVersion|null} [version] CompanionProps version + * @property {proto.CompanionProps.CompanionPropsPlatformType|null} [platformType] CompanionProps platformType + * @property {boolean|null} [requireFullSync] CompanionProps requireFullSync */ /** - * Constructs a new ClientPayload. + * Constructs a new CompanionProps. * @memberof proto - * @classdesc Represents a ClientPayload. - * @implements IClientPayload + * @classdesc Represents a CompanionProps. + * @implements ICompanionProps * @constructor - * @param {proto.IClientPayload=} [properties] Properties to set + * @param {proto.ICompanionProps=} [properties] Properties to set */ - function ClientPayload(properties) { - this.shards = []; + function CompanionProps(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -2451,356 +1607,449 @@ $root.proto = (function() { } /** - * ClientPayload username. - * @member {number|Long} username - * @memberof proto.ClientPayload - * @instance - */ - ClientPayload.prototype.username = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * ClientPayload passive. - * @member {boolean} passive - * @memberof proto.ClientPayload - * @instance - */ - ClientPayload.prototype.passive = false; - - /** - * ClientPayload userAgent. - * @member {proto.IUserAgent|null|undefined} userAgent - * @memberof proto.ClientPayload - * @instance - */ - ClientPayload.prototype.userAgent = null; - - /** - * ClientPayload webInfo. - * @member {proto.IWebInfo|null|undefined} webInfo - * @memberof proto.ClientPayload + * CompanionProps os. + * @member {string} os + * @memberof proto.CompanionProps * @instance */ - ClientPayload.prototype.webInfo = null; + CompanionProps.prototype.os = ""; /** - * ClientPayload pushName. - * @member {string} pushName - * @memberof proto.ClientPayload + * CompanionProps version. + * @member {proto.IAppVersion|null|undefined} version + * @memberof proto.CompanionProps * @instance */ - ClientPayload.prototype.pushName = ""; + CompanionProps.prototype.version = null; /** - * ClientPayload sessionId. - * @member {number} sessionId - * @memberof proto.ClientPayload + * CompanionProps platformType. + * @member {proto.CompanionProps.CompanionPropsPlatformType} platformType + * @memberof proto.CompanionProps * @instance */ - ClientPayload.prototype.sessionId = 0; + CompanionProps.prototype.platformType = 0; /** - * ClientPayload shortConnect. - * @member {boolean} shortConnect - * @memberof proto.ClientPayload + * CompanionProps requireFullSync. + * @member {boolean} requireFullSync + * @memberof proto.CompanionProps * @instance */ - ClientPayload.prototype.shortConnect = false; + CompanionProps.prototype.requireFullSync = false; /** - * ClientPayload connectType. - * @member {proto.ClientPayload.ClientPayloadConnectType} connectType - * @memberof proto.ClientPayload - * @instance + * Creates a new CompanionProps instance using the specified properties. + * @function create + * @memberof proto.CompanionProps + * @static + * @param {proto.ICompanionProps=} [properties] Properties to set + * @returns {proto.CompanionProps} CompanionProps instance */ - ClientPayload.prototype.connectType = 0; + CompanionProps.create = function create(properties) { + return new CompanionProps(properties); + }; /** - * ClientPayload connectReason. - * @member {proto.ClientPayload.ClientPayloadConnectReason} connectReason - * @memberof proto.ClientPayload - * @instance + * Encodes the specified CompanionProps message. Does not implicitly {@link proto.CompanionProps.verify|verify} messages. + * @function encode + * @memberof proto.CompanionProps + * @static + * @param {proto.ICompanionProps} message CompanionProps message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - ClientPayload.prototype.connectReason = 0; + CompanionProps.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.os != null && Object.hasOwnProperty.call(message, "os")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.os); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + $root.proto.AppVersion.encode(message.version, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.platformType != null && Object.hasOwnProperty.call(message, "platformType")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.platformType); + if (message.requireFullSync != null && Object.hasOwnProperty.call(message, "requireFullSync")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.requireFullSync); + return writer; + }; /** - * ClientPayload shards. - * @member {Array.} shards - * @memberof proto.ClientPayload - * @instance + * Encodes the specified CompanionProps message, length delimited. Does not implicitly {@link proto.CompanionProps.verify|verify} messages. + * @function encodeDelimited + * @memberof proto.CompanionProps + * @static + * @param {proto.ICompanionProps} message CompanionProps message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - ClientPayload.prototype.shards = $util.emptyArray; + CompanionProps.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; /** - * ClientPayload dnsSource. - * @member {proto.IDNSSource|null|undefined} dnsSource - * @memberof proto.ClientPayload - * @instance + * Decodes a CompanionProps message from the specified reader or buffer. + * @function decode + * @memberof proto.CompanionProps + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {proto.CompanionProps} CompanionProps + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ClientPayload.prototype.dnsSource = null; + CompanionProps.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.CompanionProps(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.os = reader.string(); + break; + case 2: + message.version = $root.proto.AppVersion.decode(reader, reader.uint32()); + break; + case 3: + message.platformType = reader.int32(); + break; + case 4: + message.requireFullSync = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; /** - * ClientPayload connectAttemptCount. - * @member {number} connectAttemptCount - * @memberof proto.ClientPayload - * @instance + * Decodes a CompanionProps message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof proto.CompanionProps + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {proto.CompanionProps} CompanionProps + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ClientPayload.prototype.connectAttemptCount = 0; + CompanionProps.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; /** - * ClientPayload device. - * @member {number} device - * @memberof proto.ClientPayload - * @instance + * Verifies a CompanionProps message. + * @function verify + * @memberof proto.CompanionProps + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ClientPayload.prototype.device = 0; + CompanionProps.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.os != null && message.hasOwnProperty("os")) + if (!$util.isString(message.os)) + return "os: string expected"; + if (message.version != null && message.hasOwnProperty("version")) { + var error = $root.proto.AppVersion.verify(message.version); + if (error) + return "version." + error; + } + if (message.platformType != null && message.hasOwnProperty("platformType")) + switch (message.platformType) { + default: + return "platformType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + break; + } + if (message.requireFullSync != null && message.hasOwnProperty("requireFullSync")) + if (typeof message.requireFullSync !== "boolean") + return "requireFullSync: boolean expected"; + return null; + }; /** - * ClientPayload regData. - * @member {proto.ICompanionRegData|null|undefined} regData - * @memberof proto.ClientPayload - * @instance + * Creates a CompanionProps message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof proto.CompanionProps + * @static + * @param {Object.} object Plain object + * @returns {proto.CompanionProps} CompanionProps */ - ClientPayload.prototype.regData = null; - - /** - * ClientPayload product. - * @member {proto.ClientPayload.ClientPayloadProduct} product - * @memberof proto.ClientPayload - * @instance - */ - ClientPayload.prototype.product = 0; + CompanionProps.fromObject = function fromObject(object) { + if (object instanceof $root.proto.CompanionProps) + return object; + var message = new $root.proto.CompanionProps(); + if (object.os != null) + message.os = String(object.os); + if (object.version != null) { + if (typeof object.version !== "object") + throw TypeError(".proto.CompanionProps.version: object expected"); + message.version = $root.proto.AppVersion.fromObject(object.version); + } + switch (object.platformType) { + case "UNKNOWN": + case 0: + message.platformType = 0; + break; + case "CHROME": + case 1: + message.platformType = 1; + break; + case "FIREFOX": + case 2: + message.platformType = 2; + break; + case "IE": + case 3: + message.platformType = 3; + break; + case "OPERA": + case 4: + message.platformType = 4; + break; + case "SAFARI": + case 5: + message.platformType = 5; + break; + case "EDGE": + case 6: + message.platformType = 6; + break; + case "DESKTOP": + case 7: + message.platformType = 7; + break; + case "IPAD": + case 8: + message.platformType = 8; + break; + case "ANDROID_TABLET": + case 9: + message.platformType = 9; + break; + case "OHANA": + case 10: + message.platformType = 10; + break; + case "ALOHA": + case 11: + message.platformType = 11; + break; + case "CATALINA": + case 12: + message.platformType = 12; + break; + } + if (object.requireFullSync != null) + message.requireFullSync = Boolean(object.requireFullSync); + return message; + }; /** - * ClientPayload fbCat. - * @member {Uint8Array} fbCat - * @memberof proto.ClientPayload - * @instance + * Creates a plain object from a CompanionProps message. Also converts values to other types if specified. + * @function toObject + * @memberof proto.CompanionProps + * @static + * @param {proto.CompanionProps} message CompanionProps + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object */ - ClientPayload.prototype.fbCat = $util.newBuffer([]); + CompanionProps.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.os = ""; + object.version = null; + object.platformType = options.enums === String ? "UNKNOWN" : 0; + object.requireFullSync = false; + } + if (message.os != null && message.hasOwnProperty("os")) + object.os = message.os; + if (message.version != null && message.hasOwnProperty("version")) + object.version = $root.proto.AppVersion.toObject(message.version, options); + if (message.platformType != null && message.hasOwnProperty("platformType")) + object.platformType = options.enums === String ? $root.proto.CompanionProps.CompanionPropsPlatformType[message.platformType] : message.platformType; + if (message.requireFullSync != null && message.hasOwnProperty("requireFullSync")) + object.requireFullSync = message.requireFullSync; + return object; + }; /** - * ClientPayload fbUserAgent. - * @member {Uint8Array} fbUserAgent - * @memberof proto.ClientPayload + * Converts this CompanionProps to JSON. + * @function toJSON + * @memberof proto.CompanionProps * @instance + * @returns {Object.} JSON object */ - ClientPayload.prototype.fbUserAgent = $util.newBuffer([]); + CompanionProps.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; /** - * ClientPayload oc. - * @member {boolean} oc - * @memberof proto.ClientPayload - * @instance + * CompanionPropsPlatformType enum. + * @name proto.CompanionProps.CompanionPropsPlatformType + * @enum {number} + * @property {number} UNKNOWN=0 UNKNOWN value + * @property {number} CHROME=1 CHROME value + * @property {number} FIREFOX=2 FIREFOX value + * @property {number} IE=3 IE value + * @property {number} OPERA=4 OPERA value + * @property {number} SAFARI=5 SAFARI value + * @property {number} EDGE=6 EDGE value + * @property {number} DESKTOP=7 DESKTOP value + * @property {number} IPAD=8 IPAD value + * @property {number} ANDROID_TABLET=9 ANDROID_TABLET value + * @property {number} OHANA=10 OHANA value + * @property {number} ALOHA=11 ALOHA value + * @property {number} CATALINA=12 CATALINA value */ - ClientPayload.prototype.oc = false; + CompanionProps.CompanionPropsPlatformType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNKNOWN"] = 0; + values[valuesById[1] = "CHROME"] = 1; + values[valuesById[2] = "FIREFOX"] = 2; + values[valuesById[3] = "IE"] = 3; + values[valuesById[4] = "OPERA"] = 4; + values[valuesById[5] = "SAFARI"] = 5; + values[valuesById[6] = "EDGE"] = 6; + values[valuesById[7] = "DESKTOP"] = 7; + values[valuesById[8] = "IPAD"] = 8; + values[valuesById[9] = "ANDROID_TABLET"] = 9; + values[valuesById[10] = "OHANA"] = 10; + values[valuesById[11] = "ALOHA"] = 11; + values[valuesById[12] = "CATALINA"] = 12; + return values; + })(); + + return CompanionProps; + })(); + + proto.ActionLink = (function() { /** - * ClientPayload lc. - * @member {number} lc - * @memberof proto.ClientPayload - * @instance + * Properties of an ActionLink. + * @memberof proto + * @interface IActionLink + * @property {string|null} [url] ActionLink url + * @property {string|null} [buttonTitle] ActionLink buttonTitle */ - ClientPayload.prototype.lc = 0; /** - * ClientPayload iosAppExtension. - * @member {proto.ClientPayload.ClientPayloadIOSAppExtension} iosAppExtension - * @memberof proto.ClientPayload - * @instance + * Constructs a new ActionLink. + * @memberof proto + * @classdesc Represents an ActionLink. + * @implements IActionLink + * @constructor + * @param {proto.IActionLink=} [properties] Properties to set */ - ClientPayload.prototype.iosAppExtension = 0; + function ActionLink(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } /** - * ClientPayload fbAppId. - * @member {number|Long} fbAppId - * @memberof proto.ClientPayload + * ActionLink url. + * @member {string} url + * @memberof proto.ActionLink * @instance */ - ClientPayload.prototype.fbAppId = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + ActionLink.prototype.url = ""; /** - * ClientPayload fbDeviceId. - * @member {Uint8Array} fbDeviceId - * @memberof proto.ClientPayload + * ActionLink buttonTitle. + * @member {string} buttonTitle + * @memberof proto.ActionLink * @instance */ - ClientPayload.prototype.fbDeviceId = $util.newBuffer([]); + ActionLink.prototype.buttonTitle = ""; /** - * Creates a new ClientPayload instance using the specified properties. + * Creates a new ActionLink instance using the specified properties. * @function create - * @memberof proto.ClientPayload + * @memberof proto.ActionLink * @static - * @param {proto.IClientPayload=} [properties] Properties to set - * @returns {proto.ClientPayload} ClientPayload instance + * @param {proto.IActionLink=} [properties] Properties to set + * @returns {proto.ActionLink} ActionLink instance */ - ClientPayload.create = function create(properties) { - return new ClientPayload(properties); + ActionLink.create = function create(properties) { + return new ActionLink(properties); }; /** - * Encodes the specified ClientPayload message. Does not implicitly {@link proto.ClientPayload.verify|verify} messages. + * Encodes the specified ActionLink message. Does not implicitly {@link proto.ActionLink.verify|verify} messages. * @function encode - * @memberof proto.ClientPayload + * @memberof proto.ActionLink * @static - * @param {proto.IClientPayload} message ClientPayload message or plain object to encode + * @param {proto.IActionLink} message ActionLink message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ClientPayload.encode = function encode(message, writer) { + ActionLink.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.username != null && Object.hasOwnProperty.call(message, "username")) - writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.username); - if (message.passive != null && Object.hasOwnProperty.call(message, "passive")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.passive); - if (message.userAgent != null && Object.hasOwnProperty.call(message, "userAgent")) - $root.proto.UserAgent.encode(message.userAgent, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.webInfo != null && Object.hasOwnProperty.call(message, "webInfo")) - $root.proto.WebInfo.encode(message.webInfo, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.pushName != null && Object.hasOwnProperty.call(message, "pushName")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.pushName); - if (message.sessionId != null && Object.hasOwnProperty.call(message, "sessionId")) - writer.uint32(/* id 9, wireType 5 =*/77).sfixed32(message.sessionId); - if (message.shortConnect != null && Object.hasOwnProperty.call(message, "shortConnect")) - writer.uint32(/* id 10, wireType 0 =*/80).bool(message.shortConnect); - if (message.connectType != null && Object.hasOwnProperty.call(message, "connectType")) - writer.uint32(/* id 12, wireType 0 =*/96).int32(message.connectType); - if (message.connectReason != null && Object.hasOwnProperty.call(message, "connectReason")) - writer.uint32(/* id 13, wireType 0 =*/104).int32(message.connectReason); - if (message.shards != null && message.shards.length) - for (var i = 0; i < message.shards.length; ++i) - writer.uint32(/* id 14, wireType 0 =*/112).int32(message.shards[i]); - if (message.dnsSource != null && Object.hasOwnProperty.call(message, "dnsSource")) - $root.proto.DNSSource.encode(message.dnsSource, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); - if (message.connectAttemptCount != null && Object.hasOwnProperty.call(message, "connectAttemptCount")) - writer.uint32(/* id 16, wireType 0 =*/128).uint32(message.connectAttemptCount); - if (message.device != null && Object.hasOwnProperty.call(message, "device")) - writer.uint32(/* id 18, wireType 0 =*/144).uint32(message.device); - if (message.regData != null && Object.hasOwnProperty.call(message, "regData")) - $root.proto.CompanionRegData.encode(message.regData, writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim(); - if (message.product != null && Object.hasOwnProperty.call(message, "product")) - writer.uint32(/* id 20, wireType 0 =*/160).int32(message.product); - if (message.fbCat != null && Object.hasOwnProperty.call(message, "fbCat")) - writer.uint32(/* id 21, wireType 2 =*/170).bytes(message.fbCat); - if (message.fbUserAgent != null && Object.hasOwnProperty.call(message, "fbUserAgent")) - writer.uint32(/* id 22, wireType 2 =*/178).bytes(message.fbUserAgent); - if (message.oc != null && Object.hasOwnProperty.call(message, "oc")) - writer.uint32(/* id 23, wireType 0 =*/184).bool(message.oc); - if (message.lc != null && Object.hasOwnProperty.call(message, "lc")) - writer.uint32(/* id 24, wireType 0 =*/192).int32(message.lc); - if (message.iosAppExtension != null && Object.hasOwnProperty.call(message, "iosAppExtension")) - writer.uint32(/* id 30, wireType 0 =*/240).int32(message.iosAppExtension); - if (message.fbAppId != null && Object.hasOwnProperty.call(message, "fbAppId")) - writer.uint32(/* id 31, wireType 0 =*/248).uint64(message.fbAppId); - if (message.fbDeviceId != null && Object.hasOwnProperty.call(message, "fbDeviceId")) - writer.uint32(/* id 32, wireType 2 =*/258).bytes(message.fbDeviceId); + if (message.url != null && Object.hasOwnProperty.call(message, "url")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.url); + if (message.buttonTitle != null && Object.hasOwnProperty.call(message, "buttonTitle")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.buttonTitle); return writer; }; /** - * Encodes the specified ClientPayload message, length delimited. Does not implicitly {@link proto.ClientPayload.verify|verify} messages. + * Encodes the specified ActionLink message, length delimited. Does not implicitly {@link proto.ActionLink.verify|verify} messages. * @function encodeDelimited - * @memberof proto.ClientPayload + * @memberof proto.ActionLink * @static - * @param {proto.IClientPayload} message ClientPayload message or plain object to encode + * @param {proto.IActionLink} message ActionLink message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ClientPayload.encodeDelimited = function encodeDelimited(message, writer) { + ActionLink.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ClientPayload message from the specified reader or buffer. + * Decodes an ActionLink message from the specified reader or buffer. * @function decode - * @memberof proto.ClientPayload + * @memberof proto.ActionLink * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {proto.ClientPayload} ClientPayload + * @returns {proto.ActionLink} ActionLink * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ClientPayload.decode = function decode(reader, length) { + ActionLink.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.ClientPayload(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.ActionLink(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.username = reader.uint64(); - break; - case 3: - message.passive = reader.bool(); - break; - case 5: - message.userAgent = $root.proto.UserAgent.decode(reader, reader.uint32()); - break; - case 6: - message.webInfo = $root.proto.WebInfo.decode(reader, reader.uint32()); - break; - case 7: - message.pushName = reader.string(); - break; - case 9: - message.sessionId = reader.sfixed32(); - break; - case 10: - message.shortConnect = reader.bool(); - break; - case 12: - message.connectType = reader.int32(); - break; - case 13: - message.connectReason = reader.int32(); - break; - case 14: - if (!(message.shards && message.shards.length)) - message.shards = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.shards.push(reader.int32()); - } else - message.shards.push(reader.int32()); - break; - case 15: - message.dnsSource = $root.proto.DNSSource.decode(reader, reader.uint32()); - break; - case 16: - message.connectAttemptCount = reader.uint32(); - break; - case 18: - message.device = reader.uint32(); - break; - case 19: - message.regData = $root.proto.CompanionRegData.decode(reader, reader.uint32()); - break; - case 20: - message.product = reader.int32(); - break; - case 21: - message.fbCat = reader.bytes(); - break; - case 22: - message.fbUserAgent = reader.bytes(); - break; - case 23: - message.oc = reader.bool(); - break; - case 24: - message.lc = reader.int32(); - break; - case 30: - message.iosAppExtension = reader.int32(); - break; - case 31: - message.fbAppId = reader.uint64(); + message.url = reader.string(); break; - case 32: - message.fbDeviceId = reader.bytes(); + case 2: + message.buttonTitle = reader.string(); break; default: reader.skipType(tag & 7); @@ -2811,602 +2060,119 @@ $root.proto = (function() { }; /** - * Decodes a ClientPayload message from the specified reader or buffer, length delimited. + * Decodes an ActionLink message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof proto.ClientPayload + * @memberof proto.ActionLink * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.ClientPayload} ClientPayload + * @returns {proto.ActionLink} ActionLink * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ClientPayload.decodeDelimited = function decodeDelimited(reader) { + ActionLink.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ClientPayload message. + * Verifies an ActionLink message. * @function verify - * @memberof proto.ClientPayload + * @memberof proto.ActionLink * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ClientPayload.verify = function verify(message) { + ActionLink.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.username != null && message.hasOwnProperty("username")) - if (!$util.isInteger(message.username) && !(message.username && $util.isInteger(message.username.low) && $util.isInteger(message.username.high))) - return "username: integer|Long expected"; - if (message.passive != null && message.hasOwnProperty("passive")) - if (typeof message.passive !== "boolean") - return "passive: boolean expected"; - if (message.userAgent != null && message.hasOwnProperty("userAgent")) { - var error = $root.proto.UserAgent.verify(message.userAgent); - if (error) - return "userAgent." + error; - } - if (message.webInfo != null && message.hasOwnProperty("webInfo")) { - var error = $root.proto.WebInfo.verify(message.webInfo); - if (error) - return "webInfo." + error; - } - if (message.pushName != null && message.hasOwnProperty("pushName")) - if (!$util.isString(message.pushName)) - return "pushName: string expected"; - if (message.sessionId != null && message.hasOwnProperty("sessionId")) - if (!$util.isInteger(message.sessionId)) - return "sessionId: integer expected"; - if (message.shortConnect != null && message.hasOwnProperty("shortConnect")) - if (typeof message.shortConnect !== "boolean") - return "shortConnect: boolean expected"; - if (message.connectType != null && message.hasOwnProperty("connectType")) - switch (message.connectType) { - default: - return "connectType: enum value expected"; - case 0: - case 1: - case 100: - case 101: - case 102: - case 103: - case 104: - case 105: - case 106: - case 107: - case 108: - case 109: - case 110: - case 111: - case 112: - break; - } - if (message.connectReason != null && message.hasOwnProperty("connectReason")) - switch (message.connectReason) { - default: - return "connectReason: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - break; - } - if (message.shards != null && message.hasOwnProperty("shards")) { - if (!Array.isArray(message.shards)) - return "shards: array expected"; - for (var i = 0; i < message.shards.length; ++i) - if (!$util.isInteger(message.shards[i])) - return "shards: integer[] expected"; - } - if (message.dnsSource != null && message.hasOwnProperty("dnsSource")) { - var error = $root.proto.DNSSource.verify(message.dnsSource); - if (error) - return "dnsSource." + error; - } - if (message.connectAttemptCount != null && message.hasOwnProperty("connectAttemptCount")) - if (!$util.isInteger(message.connectAttemptCount)) - return "connectAttemptCount: integer expected"; - if (message.device != null && message.hasOwnProperty("device")) - if (!$util.isInteger(message.device)) - return "device: integer expected"; - if (message.regData != null && message.hasOwnProperty("regData")) { - var error = $root.proto.CompanionRegData.verify(message.regData); - if (error) - return "regData." + error; - } - if (message.product != null && message.hasOwnProperty("product")) - switch (message.product) { - default: - return "product: enum value expected"; - case 0: - case 1: - break; - } - if (message.fbCat != null && message.hasOwnProperty("fbCat")) - if (!(message.fbCat && typeof message.fbCat.length === "number" || $util.isString(message.fbCat))) - return "fbCat: buffer expected"; - if (message.fbUserAgent != null && message.hasOwnProperty("fbUserAgent")) - if (!(message.fbUserAgent && typeof message.fbUserAgent.length === "number" || $util.isString(message.fbUserAgent))) - return "fbUserAgent: buffer expected"; - if (message.oc != null && message.hasOwnProperty("oc")) - if (typeof message.oc !== "boolean") - return "oc: boolean expected"; - if (message.lc != null && message.hasOwnProperty("lc")) - if (!$util.isInteger(message.lc)) - return "lc: integer expected"; - if (message.iosAppExtension != null && message.hasOwnProperty("iosAppExtension")) - switch (message.iosAppExtension) { - default: - return "iosAppExtension: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.fbAppId != null && message.hasOwnProperty("fbAppId")) - if (!$util.isInteger(message.fbAppId) && !(message.fbAppId && $util.isInteger(message.fbAppId.low) && $util.isInteger(message.fbAppId.high))) - return "fbAppId: integer|Long expected"; - if (message.fbDeviceId != null && message.hasOwnProperty("fbDeviceId")) - if (!(message.fbDeviceId && typeof message.fbDeviceId.length === "number" || $util.isString(message.fbDeviceId))) - return "fbDeviceId: buffer expected"; + if (message.url != null && message.hasOwnProperty("url")) + if (!$util.isString(message.url)) + return "url: string expected"; + if (message.buttonTitle != null && message.hasOwnProperty("buttonTitle")) + if (!$util.isString(message.buttonTitle)) + return "buttonTitle: string expected"; return null; }; /** - * Creates a ClientPayload message from a plain object. Also converts values to their respective internal types. + * Creates an ActionLink message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof proto.ClientPayload + * @memberof proto.ActionLink * @static * @param {Object.} object Plain object - * @returns {proto.ClientPayload} ClientPayload + * @returns {proto.ActionLink} ActionLink */ - ClientPayload.fromObject = function fromObject(object) { - if (object instanceof $root.proto.ClientPayload) + ActionLink.fromObject = function fromObject(object) { + if (object instanceof $root.proto.ActionLink) return object; - var message = new $root.proto.ClientPayload(); - if (object.username != null) - if ($util.Long) - (message.username = $util.Long.fromValue(object.username)).unsigned = true; - else if (typeof object.username === "string") - message.username = parseInt(object.username, 10); - else if (typeof object.username === "number") - message.username = object.username; - else if (typeof object.username === "object") - message.username = new $util.LongBits(object.username.low >>> 0, object.username.high >>> 0).toNumber(true); - if (object.passive != null) - message.passive = Boolean(object.passive); - if (object.userAgent != null) { - if (typeof object.userAgent !== "object") - throw TypeError(".proto.ClientPayload.userAgent: object expected"); - message.userAgent = $root.proto.UserAgent.fromObject(object.userAgent); - } - if (object.webInfo != null) { - if (typeof object.webInfo !== "object") - throw TypeError(".proto.ClientPayload.webInfo: object expected"); - message.webInfo = $root.proto.WebInfo.fromObject(object.webInfo); - } - if (object.pushName != null) - message.pushName = String(object.pushName); - if (object.sessionId != null) - message.sessionId = object.sessionId | 0; - if (object.shortConnect != null) - message.shortConnect = Boolean(object.shortConnect); - switch (object.connectType) { - case "CELLULAR_UNKNOWN": - case 0: - message.connectType = 0; - break; - case "WIFI_UNKNOWN": - case 1: - message.connectType = 1; - break; - case "CELLULAR_EDGE": - case 100: - message.connectType = 100; - break; - case "CELLULAR_IDEN": - case 101: - message.connectType = 101; - break; - case "CELLULAR_UMTS": - case 102: - message.connectType = 102; - break; - case "CELLULAR_EVDO": - case 103: - message.connectType = 103; - break; - case "CELLULAR_GPRS": - case 104: - message.connectType = 104; - break; - case "CELLULAR_HSDPA": - case 105: - message.connectType = 105; - break; - case "CELLULAR_HSUPA": - case 106: - message.connectType = 106; - break; - case "CELLULAR_HSPA": - case 107: - message.connectType = 107; - break; - case "CELLULAR_CDMA": - case 108: - message.connectType = 108; - break; - case "CELLULAR_1XRTT": - case 109: - message.connectType = 109; - break; - case "CELLULAR_EHRPD": - case 110: - message.connectType = 110; - break; - case "CELLULAR_LTE": - case 111: - message.connectType = 111; - break; - case "CELLULAR_HSPAP": - case 112: - message.connectType = 112; - break; - } - switch (object.connectReason) { - case "PUSH": - case 0: - message.connectReason = 0; - break; - case "USER_ACTIVATED": - case 1: - message.connectReason = 1; - break; - case "SCHEDULED": - case 2: - message.connectReason = 2; - break; - case "ERROR_RECONNECT": - case 3: - message.connectReason = 3; - break; - case "NETWORK_SWITCH": - case 4: - message.connectReason = 4; - break; - case "PING_RECONNECT": - case 5: - message.connectReason = 5; - break; - } - if (object.shards) { - if (!Array.isArray(object.shards)) - throw TypeError(".proto.ClientPayload.shards: array expected"); - message.shards = []; - for (var i = 0; i < object.shards.length; ++i) - message.shards[i] = object.shards[i] | 0; - } - if (object.dnsSource != null) { - if (typeof object.dnsSource !== "object") - throw TypeError(".proto.ClientPayload.dnsSource: object expected"); - message.dnsSource = $root.proto.DNSSource.fromObject(object.dnsSource); - } - if (object.connectAttemptCount != null) - message.connectAttemptCount = object.connectAttemptCount >>> 0; - if (object.device != null) - message.device = object.device >>> 0; - if (object.regData != null) { - if (typeof object.regData !== "object") - throw TypeError(".proto.ClientPayload.regData: object expected"); - message.regData = $root.proto.CompanionRegData.fromObject(object.regData); - } - switch (object.product) { - case "WHATSAPP": - case 0: - message.product = 0; - break; - case "MESSENGER": - case 1: - message.product = 1; - break; - } - if (object.fbCat != null) - if (typeof object.fbCat === "string") - $util.base64.decode(object.fbCat, message.fbCat = $util.newBuffer($util.base64.length(object.fbCat)), 0); - else if (object.fbCat.length) - message.fbCat = object.fbCat; - if (object.fbUserAgent != null) - if (typeof object.fbUserAgent === "string") - $util.base64.decode(object.fbUserAgent, message.fbUserAgent = $util.newBuffer($util.base64.length(object.fbUserAgent)), 0); - else if (object.fbUserAgent.length) - message.fbUserAgent = object.fbUserAgent; - if (object.oc != null) - message.oc = Boolean(object.oc); - if (object.lc != null) - message.lc = object.lc | 0; - switch (object.iosAppExtension) { - case "SHARE_EXTENSION": - case 0: - message.iosAppExtension = 0; - break; - case "SERVICE_EXTENSION": - case 1: - message.iosAppExtension = 1; - break; - case "INTENTS_EXTENSION": - case 2: - message.iosAppExtension = 2; - break; - } - if (object.fbAppId != null) - if ($util.Long) - (message.fbAppId = $util.Long.fromValue(object.fbAppId)).unsigned = true; - else if (typeof object.fbAppId === "string") - message.fbAppId = parseInt(object.fbAppId, 10); - else if (typeof object.fbAppId === "number") - message.fbAppId = object.fbAppId; - else if (typeof object.fbAppId === "object") - message.fbAppId = new $util.LongBits(object.fbAppId.low >>> 0, object.fbAppId.high >>> 0).toNumber(true); - if (object.fbDeviceId != null) - if (typeof object.fbDeviceId === "string") - $util.base64.decode(object.fbDeviceId, message.fbDeviceId = $util.newBuffer($util.base64.length(object.fbDeviceId)), 0); - else if (object.fbDeviceId.length) - message.fbDeviceId = object.fbDeviceId; + var message = new $root.proto.ActionLink(); + if (object.url != null) + message.url = String(object.url); + if (object.buttonTitle != null) + message.buttonTitle = String(object.buttonTitle); return message; }; /** - * Creates a plain object from a ClientPayload message. Also converts values to other types if specified. + * Creates a plain object from an ActionLink message. Also converts values to other types if specified. * @function toObject - * @memberof proto.ClientPayload + * @memberof proto.ActionLink * @static - * @param {proto.ClientPayload} message ClientPayload + * @param {proto.ActionLink} message ActionLink * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ClientPayload.toObject = function toObject(message, options) { + ActionLink.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.shards = []; if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.username = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.username = options.longs === String ? "0" : 0; - object.passive = false; - object.userAgent = null; - object.webInfo = null; - object.pushName = ""; - object.sessionId = 0; - object.shortConnect = false; - object.connectType = options.enums === String ? "CELLULAR_UNKNOWN" : 0; - object.connectReason = options.enums === String ? "PUSH" : 0; - object.dnsSource = null; - object.connectAttemptCount = 0; - object.device = 0; - object.regData = null; - object.product = options.enums === String ? "WHATSAPP" : 0; - if (options.bytes === String) - object.fbCat = ""; - else { - object.fbCat = []; - if (options.bytes !== Array) - object.fbCat = $util.newBuffer(object.fbCat); - } - if (options.bytes === String) - object.fbUserAgent = ""; - else { - object.fbUserAgent = []; - if (options.bytes !== Array) - object.fbUserAgent = $util.newBuffer(object.fbUserAgent); - } - object.oc = false; - object.lc = 0; - object.iosAppExtension = options.enums === String ? "SHARE_EXTENSION" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.fbAppId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.fbAppId = options.longs === String ? "0" : 0; - if (options.bytes === String) - object.fbDeviceId = ""; - else { - object.fbDeviceId = []; - if (options.bytes !== Array) - object.fbDeviceId = $util.newBuffer(object.fbDeviceId); - } - } - if (message.username != null && message.hasOwnProperty("username")) - if (typeof message.username === "number") - object.username = options.longs === String ? String(message.username) : message.username; - else - object.username = options.longs === String ? $util.Long.prototype.toString.call(message.username) : options.longs === Number ? new $util.LongBits(message.username.low >>> 0, message.username.high >>> 0).toNumber(true) : message.username; - if (message.passive != null && message.hasOwnProperty("passive")) - object.passive = message.passive; - if (message.userAgent != null && message.hasOwnProperty("userAgent")) - object.userAgent = $root.proto.UserAgent.toObject(message.userAgent, options); - if (message.webInfo != null && message.hasOwnProperty("webInfo")) - object.webInfo = $root.proto.WebInfo.toObject(message.webInfo, options); - if (message.pushName != null && message.hasOwnProperty("pushName")) - object.pushName = message.pushName; - if (message.sessionId != null && message.hasOwnProperty("sessionId")) - object.sessionId = message.sessionId; - if (message.shortConnect != null && message.hasOwnProperty("shortConnect")) - object.shortConnect = message.shortConnect; - if (message.connectType != null && message.hasOwnProperty("connectType")) - object.connectType = options.enums === String ? $root.proto.ClientPayload.ClientPayloadConnectType[message.connectType] : message.connectType; - if (message.connectReason != null && message.hasOwnProperty("connectReason")) - object.connectReason = options.enums === String ? $root.proto.ClientPayload.ClientPayloadConnectReason[message.connectReason] : message.connectReason; - if (message.shards && message.shards.length) { - object.shards = []; - for (var j = 0; j < message.shards.length; ++j) - object.shards[j] = message.shards[j]; + object.url = ""; + object.buttonTitle = ""; } - if (message.dnsSource != null && message.hasOwnProperty("dnsSource")) - object.dnsSource = $root.proto.DNSSource.toObject(message.dnsSource, options); - if (message.connectAttemptCount != null && message.hasOwnProperty("connectAttemptCount")) - object.connectAttemptCount = message.connectAttemptCount; - if (message.device != null && message.hasOwnProperty("device")) - object.device = message.device; - if (message.regData != null && message.hasOwnProperty("regData")) - object.regData = $root.proto.CompanionRegData.toObject(message.regData, options); - if (message.product != null && message.hasOwnProperty("product")) - object.product = options.enums === String ? $root.proto.ClientPayload.ClientPayloadProduct[message.product] : message.product; - if (message.fbCat != null && message.hasOwnProperty("fbCat")) - object.fbCat = options.bytes === String ? $util.base64.encode(message.fbCat, 0, message.fbCat.length) : options.bytes === Array ? Array.prototype.slice.call(message.fbCat) : message.fbCat; - if (message.fbUserAgent != null && message.hasOwnProperty("fbUserAgent")) - object.fbUserAgent = options.bytes === String ? $util.base64.encode(message.fbUserAgent, 0, message.fbUserAgent.length) : options.bytes === Array ? Array.prototype.slice.call(message.fbUserAgent) : message.fbUserAgent; - if (message.oc != null && message.hasOwnProperty("oc")) - object.oc = message.oc; - if (message.lc != null && message.hasOwnProperty("lc")) - object.lc = message.lc; - if (message.iosAppExtension != null && message.hasOwnProperty("iosAppExtension")) - object.iosAppExtension = options.enums === String ? $root.proto.ClientPayload.ClientPayloadIOSAppExtension[message.iosAppExtension] : message.iosAppExtension; - if (message.fbAppId != null && message.hasOwnProperty("fbAppId")) - if (typeof message.fbAppId === "number") - object.fbAppId = options.longs === String ? String(message.fbAppId) : message.fbAppId; - else - object.fbAppId = options.longs === String ? $util.Long.prototype.toString.call(message.fbAppId) : options.longs === Number ? new $util.LongBits(message.fbAppId.low >>> 0, message.fbAppId.high >>> 0).toNumber(true) : message.fbAppId; - if (message.fbDeviceId != null && message.hasOwnProperty("fbDeviceId")) - object.fbDeviceId = options.bytes === String ? $util.base64.encode(message.fbDeviceId, 0, message.fbDeviceId.length) : options.bytes === Array ? Array.prototype.slice.call(message.fbDeviceId) : message.fbDeviceId; + if (message.url != null && message.hasOwnProperty("url")) + object.url = message.url; + if (message.buttonTitle != null && message.hasOwnProperty("buttonTitle")) + object.buttonTitle = message.buttonTitle; return object; }; /** - * Converts this ClientPayload to JSON. + * Converts this ActionLink to JSON. * @function toJSON - * @memberof proto.ClientPayload + * @memberof proto.ActionLink * @instance * @returns {Object.} JSON object */ - ClientPayload.prototype.toJSON = function toJSON() { + ActionLink.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - /** - * ClientPayloadConnectType enum. - * @name proto.ClientPayload.ClientPayloadConnectType - * @enum {number} - * @property {number} CELLULAR_UNKNOWN=0 CELLULAR_UNKNOWN value - * @property {number} WIFI_UNKNOWN=1 WIFI_UNKNOWN value - * @property {number} CELLULAR_EDGE=100 CELLULAR_EDGE value - * @property {number} CELLULAR_IDEN=101 CELLULAR_IDEN value - * @property {number} CELLULAR_UMTS=102 CELLULAR_UMTS value - * @property {number} CELLULAR_EVDO=103 CELLULAR_EVDO value - * @property {number} CELLULAR_GPRS=104 CELLULAR_GPRS value - * @property {number} CELLULAR_HSDPA=105 CELLULAR_HSDPA value - * @property {number} CELLULAR_HSUPA=106 CELLULAR_HSUPA value - * @property {number} CELLULAR_HSPA=107 CELLULAR_HSPA value - * @property {number} CELLULAR_CDMA=108 CELLULAR_CDMA value - * @property {number} CELLULAR_1XRTT=109 CELLULAR_1XRTT value - * @property {number} CELLULAR_EHRPD=110 CELLULAR_EHRPD value - * @property {number} CELLULAR_LTE=111 CELLULAR_LTE value - * @property {number} CELLULAR_HSPAP=112 CELLULAR_HSPAP value - */ - ClientPayload.ClientPayloadConnectType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "CELLULAR_UNKNOWN"] = 0; - values[valuesById[1] = "WIFI_UNKNOWN"] = 1; - values[valuesById[100] = "CELLULAR_EDGE"] = 100; - values[valuesById[101] = "CELLULAR_IDEN"] = 101; - values[valuesById[102] = "CELLULAR_UMTS"] = 102; - values[valuesById[103] = "CELLULAR_EVDO"] = 103; - values[valuesById[104] = "CELLULAR_GPRS"] = 104; - values[valuesById[105] = "CELLULAR_HSDPA"] = 105; - values[valuesById[106] = "CELLULAR_HSUPA"] = 106; - values[valuesById[107] = "CELLULAR_HSPA"] = 107; - values[valuesById[108] = "CELLULAR_CDMA"] = 108; - values[valuesById[109] = "CELLULAR_1XRTT"] = 109; - values[valuesById[110] = "CELLULAR_EHRPD"] = 110; - values[valuesById[111] = "CELLULAR_LTE"] = 111; - values[valuesById[112] = "CELLULAR_HSPAP"] = 112; - return values; - })(); - - /** - * ClientPayloadConnectReason enum. - * @name proto.ClientPayload.ClientPayloadConnectReason - * @enum {number} - * @property {number} PUSH=0 PUSH value - * @property {number} USER_ACTIVATED=1 USER_ACTIVATED value - * @property {number} SCHEDULED=2 SCHEDULED value - * @property {number} ERROR_RECONNECT=3 ERROR_RECONNECT value - * @property {number} NETWORK_SWITCH=4 NETWORK_SWITCH value - * @property {number} PING_RECONNECT=5 PING_RECONNECT value - */ - ClientPayload.ClientPayloadConnectReason = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "PUSH"] = 0; - values[valuesById[1] = "USER_ACTIVATED"] = 1; - values[valuesById[2] = "SCHEDULED"] = 2; - values[valuesById[3] = "ERROR_RECONNECT"] = 3; - values[valuesById[4] = "NETWORK_SWITCH"] = 4; - values[valuesById[5] = "PING_RECONNECT"] = 5; - return values; - })(); - - /** - * ClientPayloadProduct enum. - * @name proto.ClientPayload.ClientPayloadProduct - * @enum {number} - * @property {number} WHATSAPP=0 WHATSAPP value - * @property {number} MESSENGER=1 MESSENGER value - */ - ClientPayload.ClientPayloadProduct = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "WHATSAPP"] = 0; - values[valuesById[1] = "MESSENGER"] = 1; - return values; - })(); - - /** - * ClientPayloadIOSAppExtension enum. - * @name proto.ClientPayload.ClientPayloadIOSAppExtension - * @enum {number} - * @property {number} SHARE_EXTENSION=0 SHARE_EXTENSION value - * @property {number} SERVICE_EXTENSION=1 SERVICE_EXTENSION value - * @property {number} INTENTS_EXTENSION=2 INTENTS_EXTENSION value - */ - ClientPayload.ClientPayloadIOSAppExtension = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "SHARE_EXTENSION"] = 0; - values[valuesById[1] = "SERVICE_EXTENSION"] = 1; - values[valuesById[2] = "INTENTS_EXTENSION"] = 2; - return values; - })(); - - return ClientPayload; + return ActionLink; })(); - proto.NoiseCertificateDetails = (function() { + proto.AdReplyInfo = (function() { /** - * Properties of a NoiseCertificateDetails. + * Properties of an AdReplyInfo. * @memberof proto - * @interface INoiseCertificateDetails - * @property {number|null} [serial] NoiseCertificateDetails serial - * @property {string|null} [issuer] NoiseCertificateDetails issuer - * @property {number|Long|null} [expires] NoiseCertificateDetails expires - * @property {string|null} [subject] NoiseCertificateDetails subject - * @property {Uint8Array|null} [key] NoiseCertificateDetails key + * @interface IAdReplyInfo + * @property {string|null} [advertiserName] AdReplyInfo advertiserName + * @property {proto.AdReplyInfo.AdReplyInfoMediaType|null} [mediaType] AdReplyInfo mediaType + * @property {Uint8Array|null} [jpegThumbnail] AdReplyInfo jpegThumbnail + * @property {string|null} [caption] AdReplyInfo caption */ /** - * Constructs a new NoiseCertificateDetails. + * Constructs a new AdReplyInfo. * @memberof proto - * @classdesc Represents a NoiseCertificateDetails. - * @implements INoiseCertificateDetails + * @classdesc Represents an AdReplyInfo. + * @implements IAdReplyInfo * @constructor - * @param {proto.INoiseCertificateDetails=} [properties] Properties to set + * @param {proto.IAdReplyInfo=} [properties] Properties to set */ - function NoiseCertificateDetails(properties) { + function AdReplyInfo(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -3414,127 +2180,114 @@ $root.proto = (function() { } /** - * NoiseCertificateDetails serial. - * @member {number} serial - * @memberof proto.NoiseCertificateDetails - * @instance - */ - NoiseCertificateDetails.prototype.serial = 0; - - /** - * NoiseCertificateDetails issuer. - * @member {string} issuer - * @memberof proto.NoiseCertificateDetails + * AdReplyInfo advertiserName. + * @member {string} advertiserName + * @memberof proto.AdReplyInfo * @instance */ - NoiseCertificateDetails.prototype.issuer = ""; + AdReplyInfo.prototype.advertiserName = ""; /** - * NoiseCertificateDetails expires. - * @member {number|Long} expires - * @memberof proto.NoiseCertificateDetails + * AdReplyInfo mediaType. + * @member {proto.AdReplyInfo.AdReplyInfoMediaType} mediaType + * @memberof proto.AdReplyInfo * @instance */ - NoiseCertificateDetails.prototype.expires = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + AdReplyInfo.prototype.mediaType = 0; /** - * NoiseCertificateDetails subject. - * @member {string} subject - * @memberof proto.NoiseCertificateDetails + * AdReplyInfo jpegThumbnail. + * @member {Uint8Array} jpegThumbnail + * @memberof proto.AdReplyInfo * @instance */ - NoiseCertificateDetails.prototype.subject = ""; + AdReplyInfo.prototype.jpegThumbnail = $util.newBuffer([]); /** - * NoiseCertificateDetails key. - * @member {Uint8Array} key - * @memberof proto.NoiseCertificateDetails + * AdReplyInfo caption. + * @member {string} caption + * @memberof proto.AdReplyInfo * @instance */ - NoiseCertificateDetails.prototype.key = $util.newBuffer([]); + AdReplyInfo.prototype.caption = ""; /** - * Creates a new NoiseCertificateDetails instance using the specified properties. + * Creates a new AdReplyInfo instance using the specified properties. * @function create - * @memberof proto.NoiseCertificateDetails + * @memberof proto.AdReplyInfo * @static - * @param {proto.INoiseCertificateDetails=} [properties] Properties to set - * @returns {proto.NoiseCertificateDetails} NoiseCertificateDetails instance + * @param {proto.IAdReplyInfo=} [properties] Properties to set + * @returns {proto.AdReplyInfo} AdReplyInfo instance */ - NoiseCertificateDetails.create = function create(properties) { - return new NoiseCertificateDetails(properties); + AdReplyInfo.create = function create(properties) { + return new AdReplyInfo(properties); }; /** - * Encodes the specified NoiseCertificateDetails message. Does not implicitly {@link proto.NoiseCertificateDetails.verify|verify} messages. + * Encodes the specified AdReplyInfo message. Does not implicitly {@link proto.AdReplyInfo.verify|verify} messages. * @function encode - * @memberof proto.NoiseCertificateDetails + * @memberof proto.AdReplyInfo * @static - * @param {proto.INoiseCertificateDetails} message NoiseCertificateDetails message or plain object to encode + * @param {proto.IAdReplyInfo} message AdReplyInfo message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - NoiseCertificateDetails.encode = function encode(message, writer) { + AdReplyInfo.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.serial != null && Object.hasOwnProperty.call(message, "serial")) - writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.serial); - if (message.issuer != null && Object.hasOwnProperty.call(message, "issuer")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.issuer); - if (message.expires != null && Object.hasOwnProperty.call(message, "expires")) - writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.expires); - if (message.subject != null && Object.hasOwnProperty.call(message, "subject")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.subject); - if (message.key != null && Object.hasOwnProperty.call(message, "key")) - writer.uint32(/* id 5, wireType 2 =*/42).bytes(message.key); + if (message.advertiserName != null && Object.hasOwnProperty.call(message, "advertiserName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.advertiserName); + if (message.mediaType != null && Object.hasOwnProperty.call(message, "mediaType")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.mediaType); + if (message.jpegThumbnail != null && Object.hasOwnProperty.call(message, "jpegThumbnail")) + writer.uint32(/* id 16, wireType 2 =*/130).bytes(message.jpegThumbnail); + if (message.caption != null && Object.hasOwnProperty.call(message, "caption")) + writer.uint32(/* id 17, wireType 2 =*/138).string(message.caption); return writer; }; /** - * Encodes the specified NoiseCertificateDetails message, length delimited. Does not implicitly {@link proto.NoiseCertificateDetails.verify|verify} messages. + * Encodes the specified AdReplyInfo message, length delimited. Does not implicitly {@link proto.AdReplyInfo.verify|verify} messages. * @function encodeDelimited - * @memberof proto.NoiseCertificateDetails + * @memberof proto.AdReplyInfo * @static - * @param {proto.INoiseCertificateDetails} message NoiseCertificateDetails message or plain object to encode + * @param {proto.IAdReplyInfo} message AdReplyInfo message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - NoiseCertificateDetails.encodeDelimited = function encodeDelimited(message, writer) { + AdReplyInfo.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a NoiseCertificateDetails message from the specified reader or buffer. + * Decodes an AdReplyInfo message from the specified reader or buffer. * @function decode - * @memberof proto.NoiseCertificateDetails + * @memberof proto.AdReplyInfo * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {proto.NoiseCertificateDetails} NoiseCertificateDetails + * @returns {proto.AdReplyInfo} AdReplyInfo * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - NoiseCertificateDetails.decode = function decode(reader, length) { + AdReplyInfo.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.NoiseCertificateDetails(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.AdReplyInfo(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.serial = reader.uint32(); + message.advertiserName = reader.string(); break; case 2: - message.issuer = reader.string(); - break; - case 3: - message.expires = reader.uint64(); + message.mediaType = reader.int32(); break; - case 4: - message.subject = reader.string(); + case 16: + message.jpegThumbnail = reader.bytes(); break; - case 5: - message.key = reader.bytes(); + case 17: + message.caption = reader.string(); break; default: reader.skipType(tag & 7); @@ -3545,164 +2298,177 @@ $root.proto = (function() { }; /** - * Decodes a NoiseCertificateDetails message from the specified reader or buffer, length delimited. + * Decodes an AdReplyInfo message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof proto.NoiseCertificateDetails + * @memberof proto.AdReplyInfo * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.NoiseCertificateDetails} NoiseCertificateDetails + * @returns {proto.AdReplyInfo} AdReplyInfo * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - NoiseCertificateDetails.decodeDelimited = function decodeDelimited(reader) { + AdReplyInfo.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a NoiseCertificateDetails message. + * Verifies an AdReplyInfo message. * @function verify - * @memberof proto.NoiseCertificateDetails + * @memberof proto.AdReplyInfo * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - NoiseCertificateDetails.verify = function verify(message) { + AdReplyInfo.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.serial != null && message.hasOwnProperty("serial")) - if (!$util.isInteger(message.serial)) - return "serial: integer expected"; - if (message.issuer != null && message.hasOwnProperty("issuer")) - if (!$util.isString(message.issuer)) - return "issuer: string expected"; - if (message.expires != null && message.hasOwnProperty("expires")) - if (!$util.isInteger(message.expires) && !(message.expires && $util.isInteger(message.expires.low) && $util.isInteger(message.expires.high))) - return "expires: integer|Long expected"; - if (message.subject != null && message.hasOwnProperty("subject")) - if (!$util.isString(message.subject)) - return "subject: string expected"; - if (message.key != null && message.hasOwnProperty("key")) - if (!(message.key && typeof message.key.length === "number" || $util.isString(message.key))) - return "key: buffer expected"; + if (message.advertiserName != null && message.hasOwnProperty("advertiserName")) + if (!$util.isString(message.advertiserName)) + return "advertiserName: string expected"; + if (message.mediaType != null && message.hasOwnProperty("mediaType")) + switch (message.mediaType) { + default: + return "mediaType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.jpegThumbnail != null && message.hasOwnProperty("jpegThumbnail")) + if (!(message.jpegThumbnail && typeof message.jpegThumbnail.length === "number" || $util.isString(message.jpegThumbnail))) + return "jpegThumbnail: buffer expected"; + if (message.caption != null && message.hasOwnProperty("caption")) + if (!$util.isString(message.caption)) + return "caption: string expected"; return null; }; /** - * Creates a NoiseCertificateDetails message from a plain object. Also converts values to their respective internal types. + * Creates an AdReplyInfo message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof proto.NoiseCertificateDetails + * @memberof proto.AdReplyInfo * @static * @param {Object.} object Plain object - * @returns {proto.NoiseCertificateDetails} NoiseCertificateDetails + * @returns {proto.AdReplyInfo} AdReplyInfo */ - NoiseCertificateDetails.fromObject = function fromObject(object) { - if (object instanceof $root.proto.NoiseCertificateDetails) + AdReplyInfo.fromObject = function fromObject(object) { + if (object instanceof $root.proto.AdReplyInfo) return object; - var message = new $root.proto.NoiseCertificateDetails(); - if (object.serial != null) - message.serial = object.serial >>> 0; - if (object.issuer != null) - message.issuer = String(object.issuer); - if (object.expires != null) - if ($util.Long) - (message.expires = $util.Long.fromValue(object.expires)).unsigned = true; - else if (typeof object.expires === "string") - message.expires = parseInt(object.expires, 10); - else if (typeof object.expires === "number") - message.expires = object.expires; - else if (typeof object.expires === "object") - message.expires = new $util.LongBits(object.expires.low >>> 0, object.expires.high >>> 0).toNumber(true); - if (object.subject != null) - message.subject = String(object.subject); - if (object.key != null) - if (typeof object.key === "string") - $util.base64.decode(object.key, message.key = $util.newBuffer($util.base64.length(object.key)), 0); - else if (object.key.length) - message.key = object.key; + var message = new $root.proto.AdReplyInfo(); + if (object.advertiserName != null) + message.advertiserName = String(object.advertiserName); + switch (object.mediaType) { + case "NONE": + case 0: + message.mediaType = 0; + break; + case "IMAGE": + case 1: + message.mediaType = 1; + break; + case "VIDEO": + case 2: + message.mediaType = 2; + break; + } + if (object.jpegThumbnail != null) + if (typeof object.jpegThumbnail === "string") + $util.base64.decode(object.jpegThumbnail, message.jpegThumbnail = $util.newBuffer($util.base64.length(object.jpegThumbnail)), 0); + else if (object.jpegThumbnail.length) + message.jpegThumbnail = object.jpegThumbnail; + if (object.caption != null) + message.caption = String(object.caption); return message; }; /** - * Creates a plain object from a NoiseCertificateDetails message. Also converts values to other types if specified. + * Creates a plain object from an AdReplyInfo message. Also converts values to other types if specified. * @function toObject - * @memberof proto.NoiseCertificateDetails + * @memberof proto.AdReplyInfo * @static - * @param {proto.NoiseCertificateDetails} message NoiseCertificateDetails + * @param {proto.AdReplyInfo} message AdReplyInfo * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - NoiseCertificateDetails.toObject = function toObject(message, options) { + AdReplyInfo.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.serial = 0; - object.issuer = ""; - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.expires = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.expires = options.longs === String ? "0" : 0; - object.subject = ""; + object.advertiserName = ""; + object.mediaType = options.enums === String ? "NONE" : 0; if (options.bytes === String) - object.key = ""; + object.jpegThumbnail = ""; else { - object.key = []; + object.jpegThumbnail = []; if (options.bytes !== Array) - object.key = $util.newBuffer(object.key); + object.jpegThumbnail = $util.newBuffer(object.jpegThumbnail); } + object.caption = ""; } - if (message.serial != null && message.hasOwnProperty("serial")) - object.serial = message.serial; - if (message.issuer != null && message.hasOwnProperty("issuer")) - object.issuer = message.issuer; - if (message.expires != null && message.hasOwnProperty("expires")) - if (typeof message.expires === "number") - object.expires = options.longs === String ? String(message.expires) : message.expires; - else - object.expires = options.longs === String ? $util.Long.prototype.toString.call(message.expires) : options.longs === Number ? new $util.LongBits(message.expires.low >>> 0, message.expires.high >>> 0).toNumber(true) : message.expires; - if (message.subject != null && message.hasOwnProperty("subject")) - object.subject = message.subject; - if (message.key != null && message.hasOwnProperty("key")) - object.key = options.bytes === String ? $util.base64.encode(message.key, 0, message.key.length) : options.bytes === Array ? Array.prototype.slice.call(message.key) : message.key; + if (message.advertiserName != null && message.hasOwnProperty("advertiserName")) + object.advertiserName = message.advertiserName; + if (message.mediaType != null && message.hasOwnProperty("mediaType")) + object.mediaType = options.enums === String ? $root.proto.AdReplyInfo.AdReplyInfoMediaType[message.mediaType] : message.mediaType; + if (message.jpegThumbnail != null && message.hasOwnProperty("jpegThumbnail")) + object.jpegThumbnail = options.bytes === String ? $util.base64.encode(message.jpegThumbnail, 0, message.jpegThumbnail.length) : options.bytes === Array ? Array.prototype.slice.call(message.jpegThumbnail) : message.jpegThumbnail; + if (message.caption != null && message.hasOwnProperty("caption")) + object.caption = message.caption; return object; }; /** - * Converts this NoiseCertificateDetails to JSON. + * Converts this AdReplyInfo to JSON. * @function toJSON - * @memberof proto.NoiseCertificateDetails + * @memberof proto.AdReplyInfo * @instance * @returns {Object.} JSON object */ - NoiseCertificateDetails.prototype.toJSON = function toJSON() { + AdReplyInfo.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return NoiseCertificateDetails; + /** + * AdReplyInfoMediaType enum. + * @name proto.AdReplyInfo.AdReplyInfoMediaType + * @enum {number} + * @property {number} NONE=0 NONE value + * @property {number} IMAGE=1 IMAGE value + * @property {number} VIDEO=2 VIDEO value + */ + AdReplyInfo.AdReplyInfoMediaType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NONE"] = 0; + values[valuesById[1] = "IMAGE"] = 1; + values[valuesById[2] = "VIDEO"] = 2; + return values; + })(); + + return AdReplyInfo; })(); - proto.NoiseCertificate = (function() { + proto.AppStateFatalExceptionNotification = (function() { /** - * Properties of a NoiseCertificate. + * Properties of an AppStateFatalExceptionNotification. * @memberof proto - * @interface INoiseCertificate - * @property {Uint8Array|null} [details] NoiseCertificate details - * @property {Uint8Array|null} [signature] NoiseCertificate signature + * @interface IAppStateFatalExceptionNotification + * @property {Array.|null} [collectionNames] AppStateFatalExceptionNotification collectionNames + * @property {number|Long|null} [timestamp] AppStateFatalExceptionNotification timestamp */ /** - * Constructs a new NoiseCertificate. + * Constructs a new AppStateFatalExceptionNotification. * @memberof proto - * @classdesc Represents a NoiseCertificate. - * @implements INoiseCertificate + * @classdesc Represents an AppStateFatalExceptionNotification. + * @implements IAppStateFatalExceptionNotification * @constructor - * @param {proto.INoiseCertificate=} [properties] Properties to set + * @param {proto.IAppStateFatalExceptionNotification=} [properties] Properties to set */ - function NoiseCertificate(properties) { + function AppStateFatalExceptionNotification(properties) { + this.collectionNames = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -3710,88 +2476,91 @@ $root.proto = (function() { } /** - * NoiseCertificate details. - * @member {Uint8Array} details - * @memberof proto.NoiseCertificate + * AppStateFatalExceptionNotification collectionNames. + * @member {Array.} collectionNames + * @memberof proto.AppStateFatalExceptionNotification * @instance */ - NoiseCertificate.prototype.details = $util.newBuffer([]); + AppStateFatalExceptionNotification.prototype.collectionNames = $util.emptyArray; /** - * NoiseCertificate signature. - * @member {Uint8Array} signature - * @memberof proto.NoiseCertificate + * AppStateFatalExceptionNotification timestamp. + * @member {number|Long} timestamp + * @memberof proto.AppStateFatalExceptionNotification * @instance */ - NoiseCertificate.prototype.signature = $util.newBuffer([]); + AppStateFatalExceptionNotification.prototype.timestamp = $util.Long ? $util.Long.fromBits(0,0,false) : 0; /** - * Creates a new NoiseCertificate instance using the specified properties. + * Creates a new AppStateFatalExceptionNotification instance using the specified properties. * @function create - * @memberof proto.NoiseCertificate + * @memberof proto.AppStateFatalExceptionNotification * @static - * @param {proto.INoiseCertificate=} [properties] Properties to set - * @returns {proto.NoiseCertificate} NoiseCertificate instance + * @param {proto.IAppStateFatalExceptionNotification=} [properties] Properties to set + * @returns {proto.AppStateFatalExceptionNotification} AppStateFatalExceptionNotification instance */ - NoiseCertificate.create = function create(properties) { - return new NoiseCertificate(properties); + AppStateFatalExceptionNotification.create = function create(properties) { + return new AppStateFatalExceptionNotification(properties); }; /** - * Encodes the specified NoiseCertificate message. Does not implicitly {@link proto.NoiseCertificate.verify|verify} messages. + * Encodes the specified AppStateFatalExceptionNotification message. Does not implicitly {@link proto.AppStateFatalExceptionNotification.verify|verify} messages. * @function encode - * @memberof proto.NoiseCertificate + * @memberof proto.AppStateFatalExceptionNotification * @static - * @param {proto.INoiseCertificate} message NoiseCertificate message or plain object to encode + * @param {proto.IAppStateFatalExceptionNotification} message AppStateFatalExceptionNotification message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - NoiseCertificate.encode = function encode(message, writer) { + AppStateFatalExceptionNotification.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.details != null && Object.hasOwnProperty.call(message, "details")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.details); - if (message.signature != null && Object.hasOwnProperty.call(message, "signature")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.signature); + if (message.collectionNames != null && message.collectionNames.length) + for (var i = 0; i < message.collectionNames.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.collectionNames[i]); + if (message.timestamp != null && Object.hasOwnProperty.call(message, "timestamp")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.timestamp); return writer; }; /** - * Encodes the specified NoiseCertificate message, length delimited. Does not implicitly {@link proto.NoiseCertificate.verify|verify} messages. + * Encodes the specified AppStateFatalExceptionNotification message, length delimited. Does not implicitly {@link proto.AppStateFatalExceptionNotification.verify|verify} messages. * @function encodeDelimited - * @memberof proto.NoiseCertificate + * @memberof proto.AppStateFatalExceptionNotification * @static - * @param {proto.INoiseCertificate} message NoiseCertificate message or plain object to encode + * @param {proto.IAppStateFatalExceptionNotification} message AppStateFatalExceptionNotification message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - NoiseCertificate.encodeDelimited = function encodeDelimited(message, writer) { + AppStateFatalExceptionNotification.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a NoiseCertificate message from the specified reader or buffer. + * Decodes an AppStateFatalExceptionNotification message from the specified reader or buffer. * @function decode - * @memberof proto.NoiseCertificate + * @memberof proto.AppStateFatalExceptionNotification * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {proto.NoiseCertificate} NoiseCertificate + * @returns {proto.AppStateFatalExceptionNotification} AppStateFatalExceptionNotification * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - NoiseCertificate.decode = function decode(reader, length) { + AppStateFatalExceptionNotification.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.NoiseCertificate(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.AppStateFatalExceptionNotification(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.details = reader.bytes(); + if (!(message.collectionNames && message.collectionNames.length)) + message.collectionNames = []; + message.collectionNames.push(reader.string()); break; case 2: - message.signature = reader.bytes(); + message.timestamp = reader.int64(); break; default: reader.skipType(tag & 7); @@ -3802,136 +2571,143 @@ $root.proto = (function() { }; /** - * Decodes a NoiseCertificate message from the specified reader or buffer, length delimited. + * Decodes an AppStateFatalExceptionNotification message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof proto.NoiseCertificate + * @memberof proto.AppStateFatalExceptionNotification * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.NoiseCertificate} NoiseCertificate + * @returns {proto.AppStateFatalExceptionNotification} AppStateFatalExceptionNotification * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - NoiseCertificate.decodeDelimited = function decodeDelimited(reader) { + AppStateFatalExceptionNotification.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a NoiseCertificate message. + * Verifies an AppStateFatalExceptionNotification message. * @function verify - * @memberof proto.NoiseCertificate + * @memberof proto.AppStateFatalExceptionNotification * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - NoiseCertificate.verify = function verify(message) { + AppStateFatalExceptionNotification.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.details != null && message.hasOwnProperty("details")) - if (!(message.details && typeof message.details.length === "number" || $util.isString(message.details))) - return "details: buffer expected"; - if (message.signature != null && message.hasOwnProperty("signature")) - if (!(message.signature && typeof message.signature.length === "number" || $util.isString(message.signature))) - return "signature: buffer expected"; + if (message.collectionNames != null && message.hasOwnProperty("collectionNames")) { + if (!Array.isArray(message.collectionNames)) + return "collectionNames: array expected"; + for (var i = 0; i < message.collectionNames.length; ++i) + if (!$util.isString(message.collectionNames[i])) + return "collectionNames: string[] expected"; + } + if (message.timestamp != null && message.hasOwnProperty("timestamp")) + if (!$util.isInteger(message.timestamp) && !(message.timestamp && $util.isInteger(message.timestamp.low) && $util.isInteger(message.timestamp.high))) + return "timestamp: integer|Long expected"; return null; }; /** - * Creates a NoiseCertificate message from a plain object. Also converts values to their respective internal types. + * Creates an AppStateFatalExceptionNotification message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof proto.NoiseCertificate + * @memberof proto.AppStateFatalExceptionNotification * @static * @param {Object.} object Plain object - * @returns {proto.NoiseCertificate} NoiseCertificate + * @returns {proto.AppStateFatalExceptionNotification} AppStateFatalExceptionNotification */ - NoiseCertificate.fromObject = function fromObject(object) { - if (object instanceof $root.proto.NoiseCertificate) + AppStateFatalExceptionNotification.fromObject = function fromObject(object) { + if (object instanceof $root.proto.AppStateFatalExceptionNotification) return object; - var message = new $root.proto.NoiseCertificate(); - if (object.details != null) - if (typeof object.details === "string") - $util.base64.decode(object.details, message.details = $util.newBuffer($util.base64.length(object.details)), 0); - else if (object.details.length) - message.details = object.details; - if (object.signature != null) - if (typeof object.signature === "string") - $util.base64.decode(object.signature, message.signature = $util.newBuffer($util.base64.length(object.signature)), 0); - else if (object.signature.length) - message.signature = object.signature; + var message = new $root.proto.AppStateFatalExceptionNotification(); + if (object.collectionNames) { + if (!Array.isArray(object.collectionNames)) + throw TypeError(".proto.AppStateFatalExceptionNotification.collectionNames: array expected"); + message.collectionNames = []; + for (var i = 0; i < object.collectionNames.length; ++i) + message.collectionNames[i] = String(object.collectionNames[i]); + } + if (object.timestamp != null) + if ($util.Long) + (message.timestamp = $util.Long.fromValue(object.timestamp)).unsigned = false; + else if (typeof object.timestamp === "string") + message.timestamp = parseInt(object.timestamp, 10); + else if (typeof object.timestamp === "number") + message.timestamp = object.timestamp; + else if (typeof object.timestamp === "object") + message.timestamp = new $util.LongBits(object.timestamp.low >>> 0, object.timestamp.high >>> 0).toNumber(); return message; }; /** - * Creates a plain object from a NoiseCertificate message. Also converts values to other types if specified. + * Creates a plain object from an AppStateFatalExceptionNotification message. Also converts values to other types if specified. * @function toObject - * @memberof proto.NoiseCertificate + * @memberof proto.AppStateFatalExceptionNotification * @static - * @param {proto.NoiseCertificate} message NoiseCertificate + * @param {proto.AppStateFatalExceptionNotification} message AppStateFatalExceptionNotification * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - NoiseCertificate.toObject = function toObject(message, options) { + AppStateFatalExceptionNotification.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - if (options.bytes === String) - object.details = ""; - else { - object.details = []; - if (options.bytes !== Array) - object.details = $util.newBuffer(object.details); - } - if (options.bytes === String) - object.signature = ""; - else { - object.signature = []; - if (options.bytes !== Array) - object.signature = $util.newBuffer(object.signature); - } + if (options.arrays || options.defaults) + object.collectionNames = []; + if (options.defaults) + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.timestamp = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.timestamp = options.longs === String ? "0" : 0; + if (message.collectionNames && message.collectionNames.length) { + object.collectionNames = []; + for (var j = 0; j < message.collectionNames.length; ++j) + object.collectionNames[j] = message.collectionNames[j]; } - if (message.details != null && message.hasOwnProperty("details")) - object.details = options.bytes === String ? $util.base64.encode(message.details, 0, message.details.length) : options.bytes === Array ? Array.prototype.slice.call(message.details) : message.details; - if (message.signature != null && message.hasOwnProperty("signature")) - object.signature = options.bytes === String ? $util.base64.encode(message.signature, 0, message.signature.length) : options.bytes === Array ? Array.prototype.slice.call(message.signature) : message.signature; + if (message.timestamp != null && message.hasOwnProperty("timestamp")) + if (typeof message.timestamp === "number") + object.timestamp = options.longs === String ? String(message.timestamp) : message.timestamp; + else + object.timestamp = options.longs === String ? $util.Long.prototype.toString.call(message.timestamp) : options.longs === Number ? new $util.LongBits(message.timestamp.low >>> 0, message.timestamp.high >>> 0).toNumber() : message.timestamp; return object; }; /** - * Converts this NoiseCertificate to JSON. + * Converts this AppStateFatalExceptionNotification to JSON. * @function toJSON - * @memberof proto.NoiseCertificate + * @memberof proto.AppStateFatalExceptionNotification * @instance * @returns {Object.} JSON object */ - NoiseCertificate.prototype.toJSON = function toJSON() { + AppStateFatalExceptionNotification.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return NoiseCertificate; + return AppStateFatalExceptionNotification; })(); - proto.ClientHello = (function() { + proto.AppStateSyncKey = (function() { /** - * Properties of a ClientHello. + * Properties of an AppStateSyncKey. * @memberof proto - * @interface IClientHello - * @property {Uint8Array|null} [ephemeral] ClientHello ephemeral - * @property {Uint8Array|null} ["static"] ClientHello static - * @property {Uint8Array|null} [payload] ClientHello payload + * @interface IAppStateSyncKey + * @property {proto.IAppStateSyncKeyId|null} [keyId] AppStateSyncKey keyId + * @property {proto.IAppStateSyncKeyData|null} [keyData] AppStateSyncKey keyData */ /** - * Constructs a new ClientHello. + * Constructs a new AppStateSyncKey. * @memberof proto - * @classdesc Represents a ClientHello. - * @implements IClientHello + * @classdesc Represents an AppStateSyncKey. + * @implements IAppStateSyncKey * @constructor - * @param {proto.IClientHello=} [properties] Properties to set + * @param {proto.IAppStateSyncKey=} [properties] Properties to set */ - function ClientHello(properties) { + function AppStateSyncKey(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -3939,101 +2715,88 @@ $root.proto = (function() { } /** - * ClientHello ephemeral. - * @member {Uint8Array} ephemeral - * @memberof proto.ClientHello - * @instance - */ - ClientHello.prototype.ephemeral = $util.newBuffer([]); - - /** - * ClientHello static. - * @member {Uint8Array} static - * @memberof proto.ClientHello + * AppStateSyncKey keyId. + * @member {proto.IAppStateSyncKeyId|null|undefined} keyId + * @memberof proto.AppStateSyncKey * @instance */ - ClientHello.prototype["static"] = $util.newBuffer([]); + AppStateSyncKey.prototype.keyId = null; /** - * ClientHello payload. - * @member {Uint8Array} payload - * @memberof proto.ClientHello + * AppStateSyncKey keyData. + * @member {proto.IAppStateSyncKeyData|null|undefined} keyData + * @memberof proto.AppStateSyncKey * @instance */ - ClientHello.prototype.payload = $util.newBuffer([]); + AppStateSyncKey.prototype.keyData = null; /** - * Creates a new ClientHello instance using the specified properties. + * Creates a new AppStateSyncKey instance using the specified properties. * @function create - * @memberof proto.ClientHello + * @memberof proto.AppStateSyncKey * @static - * @param {proto.IClientHello=} [properties] Properties to set - * @returns {proto.ClientHello} ClientHello instance + * @param {proto.IAppStateSyncKey=} [properties] Properties to set + * @returns {proto.AppStateSyncKey} AppStateSyncKey instance */ - ClientHello.create = function create(properties) { - return new ClientHello(properties); + AppStateSyncKey.create = function create(properties) { + return new AppStateSyncKey(properties); }; /** - * Encodes the specified ClientHello message. Does not implicitly {@link proto.ClientHello.verify|verify} messages. + * Encodes the specified AppStateSyncKey message. Does not implicitly {@link proto.AppStateSyncKey.verify|verify} messages. * @function encode - * @memberof proto.ClientHello + * @memberof proto.AppStateSyncKey * @static - * @param {proto.IClientHello} message ClientHello message or plain object to encode + * @param {proto.IAppStateSyncKey} message AppStateSyncKey message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ClientHello.encode = function encode(message, writer) { + AppStateSyncKey.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.ephemeral != null && Object.hasOwnProperty.call(message, "ephemeral")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.ephemeral); - if (message["static"] != null && Object.hasOwnProperty.call(message, "static")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message["static"]); - if (message.payload != null && Object.hasOwnProperty.call(message, "payload")) - writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.payload); + if (message.keyId != null && Object.hasOwnProperty.call(message, "keyId")) + $root.proto.AppStateSyncKeyId.encode(message.keyId, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.keyData != null && Object.hasOwnProperty.call(message, "keyData")) + $root.proto.AppStateSyncKeyData.encode(message.keyData, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** - * Encodes the specified ClientHello message, length delimited. Does not implicitly {@link proto.ClientHello.verify|verify} messages. + * Encodes the specified AppStateSyncKey message, length delimited. Does not implicitly {@link proto.AppStateSyncKey.verify|verify} messages. * @function encodeDelimited - * @memberof proto.ClientHello + * @memberof proto.AppStateSyncKey * @static - * @param {proto.IClientHello} message ClientHello message or plain object to encode + * @param {proto.IAppStateSyncKey} message AppStateSyncKey message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ClientHello.encodeDelimited = function encodeDelimited(message, writer) { + AppStateSyncKey.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ClientHello message from the specified reader or buffer. + * Decodes an AppStateSyncKey message from the specified reader or buffer. * @function decode - * @memberof proto.ClientHello + * @memberof proto.AppStateSyncKey * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {proto.ClientHello} ClientHello + * @returns {proto.AppStateSyncKey} AppStateSyncKey * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ClientHello.decode = function decode(reader, length) { + AppStateSyncKey.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.ClientHello(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.AppStateSyncKey(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.ephemeral = reader.bytes(); + message.keyId = $root.proto.AppStateSyncKeyId.decode(reader, reader.uint32()); break; case 2: - message["static"] = reader.bytes(); - break; - case 3: - message.payload = reader.bytes(); + message.keyData = $root.proto.AppStateSyncKeyData.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -4044,153 +2807,128 @@ $root.proto = (function() { }; /** - * Decodes a ClientHello message from the specified reader or buffer, length delimited. + * Decodes an AppStateSyncKey message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof proto.ClientHello + * @memberof proto.AppStateSyncKey * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.ClientHello} ClientHello + * @returns {proto.AppStateSyncKey} AppStateSyncKey * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ClientHello.decodeDelimited = function decodeDelimited(reader) { + AppStateSyncKey.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ClientHello message. + * Verifies an AppStateSyncKey message. * @function verify - * @memberof proto.ClientHello + * @memberof proto.AppStateSyncKey * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ClientHello.verify = function verify(message) { + AppStateSyncKey.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.ephemeral != null && message.hasOwnProperty("ephemeral")) - if (!(message.ephemeral && typeof message.ephemeral.length === "number" || $util.isString(message.ephemeral))) - return "ephemeral: buffer expected"; - if (message["static"] != null && message.hasOwnProperty("static")) - if (!(message["static"] && typeof message["static"].length === "number" || $util.isString(message["static"]))) - return "static: buffer expected"; - if (message.payload != null && message.hasOwnProperty("payload")) - if (!(message.payload && typeof message.payload.length === "number" || $util.isString(message.payload))) - return "payload: buffer expected"; + if (message.keyId != null && message.hasOwnProperty("keyId")) { + var error = $root.proto.AppStateSyncKeyId.verify(message.keyId); + if (error) + return "keyId." + error; + } + if (message.keyData != null && message.hasOwnProperty("keyData")) { + var error = $root.proto.AppStateSyncKeyData.verify(message.keyData); + if (error) + return "keyData." + error; + } return null; }; /** - * Creates a ClientHello message from a plain object. Also converts values to their respective internal types. + * Creates an AppStateSyncKey message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof proto.ClientHello + * @memberof proto.AppStateSyncKey * @static * @param {Object.} object Plain object - * @returns {proto.ClientHello} ClientHello + * @returns {proto.AppStateSyncKey} AppStateSyncKey */ - ClientHello.fromObject = function fromObject(object) { - if (object instanceof $root.proto.ClientHello) + AppStateSyncKey.fromObject = function fromObject(object) { + if (object instanceof $root.proto.AppStateSyncKey) return object; - var message = new $root.proto.ClientHello(); - if (object.ephemeral != null) - if (typeof object.ephemeral === "string") - $util.base64.decode(object.ephemeral, message.ephemeral = $util.newBuffer($util.base64.length(object.ephemeral)), 0); - else if (object.ephemeral.length) - message.ephemeral = object.ephemeral; - if (object["static"] != null) - if (typeof object["static"] === "string") - $util.base64.decode(object["static"], message["static"] = $util.newBuffer($util.base64.length(object["static"])), 0); - else if (object["static"].length) - message["static"] = object["static"]; - if (object.payload != null) - if (typeof object.payload === "string") - $util.base64.decode(object.payload, message.payload = $util.newBuffer($util.base64.length(object.payload)), 0); - else if (object.payload.length) - message.payload = object.payload; + var message = new $root.proto.AppStateSyncKey(); + if (object.keyId != null) { + if (typeof object.keyId !== "object") + throw TypeError(".proto.AppStateSyncKey.keyId: object expected"); + message.keyId = $root.proto.AppStateSyncKeyId.fromObject(object.keyId); + } + if (object.keyData != null) { + if (typeof object.keyData !== "object") + throw TypeError(".proto.AppStateSyncKey.keyData: object expected"); + message.keyData = $root.proto.AppStateSyncKeyData.fromObject(object.keyData); + } return message; }; /** - * Creates a plain object from a ClientHello message. Also converts values to other types if specified. + * Creates a plain object from an AppStateSyncKey message. Also converts values to other types if specified. * @function toObject - * @memberof proto.ClientHello + * @memberof proto.AppStateSyncKey * @static - * @param {proto.ClientHello} message ClientHello + * @param {proto.AppStateSyncKey} message AppStateSyncKey * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ClientHello.toObject = function toObject(message, options) { + AppStateSyncKey.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - if (options.bytes === String) - object.ephemeral = ""; - else { - object.ephemeral = []; - if (options.bytes !== Array) - object.ephemeral = $util.newBuffer(object.ephemeral); - } - if (options.bytes === String) - object["static"] = ""; - else { - object["static"] = []; - if (options.bytes !== Array) - object["static"] = $util.newBuffer(object["static"]); - } - if (options.bytes === String) - object.payload = ""; - else { - object.payload = []; - if (options.bytes !== Array) - object.payload = $util.newBuffer(object.payload); - } + object.keyId = null; + object.keyData = null; } - if (message.ephemeral != null && message.hasOwnProperty("ephemeral")) - object.ephemeral = options.bytes === String ? $util.base64.encode(message.ephemeral, 0, message.ephemeral.length) : options.bytes === Array ? Array.prototype.slice.call(message.ephemeral) : message.ephemeral; - if (message["static"] != null && message.hasOwnProperty("static")) - object["static"] = options.bytes === String ? $util.base64.encode(message["static"], 0, message["static"].length) : options.bytes === Array ? Array.prototype.slice.call(message["static"]) : message["static"]; - if (message.payload != null && message.hasOwnProperty("payload")) - object.payload = options.bytes === String ? $util.base64.encode(message.payload, 0, message.payload.length) : options.bytes === Array ? Array.prototype.slice.call(message.payload) : message.payload; + if (message.keyId != null && message.hasOwnProperty("keyId")) + object.keyId = $root.proto.AppStateSyncKeyId.toObject(message.keyId, options); + if (message.keyData != null && message.hasOwnProperty("keyData")) + object.keyData = $root.proto.AppStateSyncKeyData.toObject(message.keyData, options); return object; }; /** - * Converts this ClientHello to JSON. + * Converts this AppStateSyncKey to JSON. * @function toJSON - * @memberof proto.ClientHello + * @memberof proto.AppStateSyncKey * @instance * @returns {Object.} JSON object */ - ClientHello.prototype.toJSON = function toJSON() { + AppStateSyncKey.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ClientHello; + return AppStateSyncKey; })(); - proto.ServerHello = (function() { + proto.AppStateSyncKeyData = (function() { /** - * Properties of a ServerHello. + * Properties of an AppStateSyncKeyData. * @memberof proto - * @interface IServerHello - * @property {Uint8Array|null} [ephemeral] ServerHello ephemeral - * @property {Uint8Array|null} ["static"] ServerHello static - * @property {Uint8Array|null} [payload] ServerHello payload + * @interface IAppStateSyncKeyData + * @property {Uint8Array|null} [keyData] AppStateSyncKeyData keyData + * @property {proto.IAppStateSyncKeyFingerprint|null} [fingerprint] AppStateSyncKeyData fingerprint + * @property {number|Long|null} [timestamp] AppStateSyncKeyData timestamp */ /** - * Constructs a new ServerHello. + * Constructs a new AppStateSyncKeyData. * @memberof proto - * @classdesc Represents a ServerHello. - * @implements IServerHello + * @classdesc Represents an AppStateSyncKeyData. + * @implements IAppStateSyncKeyData * @constructor - * @param {proto.IServerHello=} [properties] Properties to set + * @param {proto.IAppStateSyncKeyData=} [properties] Properties to set */ - function ServerHello(properties) { + function AppStateSyncKeyData(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -4198,101 +2936,101 @@ $root.proto = (function() { } /** - * ServerHello ephemeral. - * @member {Uint8Array} ephemeral - * @memberof proto.ServerHello + * AppStateSyncKeyData keyData. + * @member {Uint8Array} keyData + * @memberof proto.AppStateSyncKeyData * @instance */ - ServerHello.prototype.ephemeral = $util.newBuffer([]); + AppStateSyncKeyData.prototype.keyData = $util.newBuffer([]); /** - * ServerHello static. - * @member {Uint8Array} static - * @memberof proto.ServerHello + * AppStateSyncKeyData fingerprint. + * @member {proto.IAppStateSyncKeyFingerprint|null|undefined} fingerprint + * @memberof proto.AppStateSyncKeyData * @instance */ - ServerHello.prototype["static"] = $util.newBuffer([]); + AppStateSyncKeyData.prototype.fingerprint = null; /** - * ServerHello payload. - * @member {Uint8Array} payload - * @memberof proto.ServerHello + * AppStateSyncKeyData timestamp. + * @member {number|Long} timestamp + * @memberof proto.AppStateSyncKeyData * @instance */ - ServerHello.prototype.payload = $util.newBuffer([]); + AppStateSyncKeyData.prototype.timestamp = $util.Long ? $util.Long.fromBits(0,0,false) : 0; /** - * Creates a new ServerHello instance using the specified properties. + * Creates a new AppStateSyncKeyData instance using the specified properties. * @function create - * @memberof proto.ServerHello + * @memberof proto.AppStateSyncKeyData * @static - * @param {proto.IServerHello=} [properties] Properties to set - * @returns {proto.ServerHello} ServerHello instance + * @param {proto.IAppStateSyncKeyData=} [properties] Properties to set + * @returns {proto.AppStateSyncKeyData} AppStateSyncKeyData instance */ - ServerHello.create = function create(properties) { - return new ServerHello(properties); + AppStateSyncKeyData.create = function create(properties) { + return new AppStateSyncKeyData(properties); }; /** - * Encodes the specified ServerHello message. Does not implicitly {@link proto.ServerHello.verify|verify} messages. + * Encodes the specified AppStateSyncKeyData message. Does not implicitly {@link proto.AppStateSyncKeyData.verify|verify} messages. * @function encode - * @memberof proto.ServerHello + * @memberof proto.AppStateSyncKeyData * @static - * @param {proto.IServerHello} message ServerHello message or plain object to encode + * @param {proto.IAppStateSyncKeyData} message AppStateSyncKeyData message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ServerHello.encode = function encode(message, writer) { + AppStateSyncKeyData.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.ephemeral != null && Object.hasOwnProperty.call(message, "ephemeral")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.ephemeral); - if (message["static"] != null && Object.hasOwnProperty.call(message, "static")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message["static"]); - if (message.payload != null && Object.hasOwnProperty.call(message, "payload")) - writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.payload); + if (message.keyData != null && Object.hasOwnProperty.call(message, "keyData")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.keyData); + if (message.fingerprint != null && Object.hasOwnProperty.call(message, "fingerprint")) + $root.proto.AppStateSyncKeyFingerprint.encode(message.fingerprint, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.timestamp != null && Object.hasOwnProperty.call(message, "timestamp")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.timestamp); return writer; }; /** - * Encodes the specified ServerHello message, length delimited. Does not implicitly {@link proto.ServerHello.verify|verify} messages. + * Encodes the specified AppStateSyncKeyData message, length delimited. Does not implicitly {@link proto.AppStateSyncKeyData.verify|verify} messages. * @function encodeDelimited - * @memberof proto.ServerHello + * @memberof proto.AppStateSyncKeyData * @static - * @param {proto.IServerHello} message ServerHello message or plain object to encode + * @param {proto.IAppStateSyncKeyData} message AppStateSyncKeyData message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ServerHello.encodeDelimited = function encodeDelimited(message, writer) { + AppStateSyncKeyData.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ServerHello message from the specified reader or buffer. + * Decodes an AppStateSyncKeyData message from the specified reader or buffer. * @function decode - * @memberof proto.ServerHello + * @memberof proto.AppStateSyncKeyData * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {proto.ServerHello} ServerHello + * @returns {proto.AppStateSyncKeyData} AppStateSyncKeyData * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ServerHello.decode = function decode(reader, length) { + AppStateSyncKeyData.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.ServerHello(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.AppStateSyncKeyData(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.ephemeral = reader.bytes(); + message.keyData = reader.bytes(); break; case 2: - message["static"] = reader.bytes(); + message.fingerprint = $root.proto.AppStateSyncKeyFingerprint.decode(reader, reader.uint32()); break; case 3: - message.payload = reader.bytes(); + message.timestamp = reader.int64(); break; default: reader.skipType(tag & 7); @@ -4303,152 +3041,155 @@ $root.proto = (function() { }; /** - * Decodes a ServerHello message from the specified reader or buffer, length delimited. + * Decodes an AppStateSyncKeyData message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof proto.ServerHello + * @memberof proto.AppStateSyncKeyData * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.ServerHello} ServerHello + * @returns {proto.AppStateSyncKeyData} AppStateSyncKeyData * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ServerHello.decodeDelimited = function decodeDelimited(reader) { + AppStateSyncKeyData.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ServerHello message. + * Verifies an AppStateSyncKeyData message. * @function verify - * @memberof proto.ServerHello + * @memberof proto.AppStateSyncKeyData * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ServerHello.verify = function verify(message) { + AppStateSyncKeyData.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.ephemeral != null && message.hasOwnProperty("ephemeral")) - if (!(message.ephemeral && typeof message.ephemeral.length === "number" || $util.isString(message.ephemeral))) - return "ephemeral: buffer expected"; - if (message["static"] != null && message.hasOwnProperty("static")) - if (!(message["static"] && typeof message["static"].length === "number" || $util.isString(message["static"]))) - return "static: buffer expected"; - if (message.payload != null && message.hasOwnProperty("payload")) - if (!(message.payload && typeof message.payload.length === "number" || $util.isString(message.payload))) - return "payload: buffer expected"; + if (message.keyData != null && message.hasOwnProperty("keyData")) + if (!(message.keyData && typeof message.keyData.length === "number" || $util.isString(message.keyData))) + return "keyData: buffer expected"; + if (message.fingerprint != null && message.hasOwnProperty("fingerprint")) { + var error = $root.proto.AppStateSyncKeyFingerprint.verify(message.fingerprint); + if (error) + return "fingerprint." + error; + } + if (message.timestamp != null && message.hasOwnProperty("timestamp")) + if (!$util.isInteger(message.timestamp) && !(message.timestamp && $util.isInteger(message.timestamp.low) && $util.isInteger(message.timestamp.high))) + return "timestamp: integer|Long expected"; return null; }; /** - * Creates a ServerHello message from a plain object. Also converts values to their respective internal types. + * Creates an AppStateSyncKeyData message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof proto.ServerHello + * @memberof proto.AppStateSyncKeyData * @static * @param {Object.} object Plain object - * @returns {proto.ServerHello} ServerHello + * @returns {proto.AppStateSyncKeyData} AppStateSyncKeyData */ - ServerHello.fromObject = function fromObject(object) { - if (object instanceof $root.proto.ServerHello) + AppStateSyncKeyData.fromObject = function fromObject(object) { + if (object instanceof $root.proto.AppStateSyncKeyData) return object; - var message = new $root.proto.ServerHello(); - if (object.ephemeral != null) - if (typeof object.ephemeral === "string") - $util.base64.decode(object.ephemeral, message.ephemeral = $util.newBuffer($util.base64.length(object.ephemeral)), 0); - else if (object.ephemeral.length) - message.ephemeral = object.ephemeral; - if (object["static"] != null) - if (typeof object["static"] === "string") - $util.base64.decode(object["static"], message["static"] = $util.newBuffer($util.base64.length(object["static"])), 0); - else if (object["static"].length) - message["static"] = object["static"]; - if (object.payload != null) - if (typeof object.payload === "string") - $util.base64.decode(object.payload, message.payload = $util.newBuffer($util.base64.length(object.payload)), 0); - else if (object.payload.length) - message.payload = object.payload; + var message = new $root.proto.AppStateSyncKeyData(); + if (object.keyData != null) + if (typeof object.keyData === "string") + $util.base64.decode(object.keyData, message.keyData = $util.newBuffer($util.base64.length(object.keyData)), 0); + else if (object.keyData.length) + message.keyData = object.keyData; + if (object.fingerprint != null) { + if (typeof object.fingerprint !== "object") + throw TypeError(".proto.AppStateSyncKeyData.fingerprint: object expected"); + message.fingerprint = $root.proto.AppStateSyncKeyFingerprint.fromObject(object.fingerprint); + } + if (object.timestamp != null) + if ($util.Long) + (message.timestamp = $util.Long.fromValue(object.timestamp)).unsigned = false; + else if (typeof object.timestamp === "string") + message.timestamp = parseInt(object.timestamp, 10); + else if (typeof object.timestamp === "number") + message.timestamp = object.timestamp; + else if (typeof object.timestamp === "object") + message.timestamp = new $util.LongBits(object.timestamp.low >>> 0, object.timestamp.high >>> 0).toNumber(); return message; }; /** - * Creates a plain object from a ServerHello message. Also converts values to other types if specified. + * Creates a plain object from an AppStateSyncKeyData message. Also converts values to other types if specified. * @function toObject - * @memberof proto.ServerHello + * @memberof proto.AppStateSyncKeyData * @static - * @param {proto.ServerHello} message ServerHello + * @param {proto.AppStateSyncKeyData} message AppStateSyncKeyData * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ServerHello.toObject = function toObject(message, options) { + AppStateSyncKeyData.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { if (options.bytes === String) - object.ephemeral = ""; - else { - object.ephemeral = []; - if (options.bytes !== Array) - object.ephemeral = $util.newBuffer(object.ephemeral); - } - if (options.bytes === String) - object["static"] = ""; - else { - object["static"] = []; - if (options.bytes !== Array) - object["static"] = $util.newBuffer(object["static"]); - } - if (options.bytes === String) - object.payload = ""; + object.keyData = ""; else { - object.payload = []; + object.keyData = []; if (options.bytes !== Array) - object.payload = $util.newBuffer(object.payload); + object.keyData = $util.newBuffer(object.keyData); } + object.fingerprint = null; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.timestamp = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.timestamp = options.longs === String ? "0" : 0; } - if (message.ephemeral != null && message.hasOwnProperty("ephemeral")) - object.ephemeral = options.bytes === String ? $util.base64.encode(message.ephemeral, 0, message.ephemeral.length) : options.bytes === Array ? Array.prototype.slice.call(message.ephemeral) : message.ephemeral; - if (message["static"] != null && message.hasOwnProperty("static")) - object["static"] = options.bytes === String ? $util.base64.encode(message["static"], 0, message["static"].length) : options.bytes === Array ? Array.prototype.slice.call(message["static"]) : message["static"]; - if (message.payload != null && message.hasOwnProperty("payload")) - object.payload = options.bytes === String ? $util.base64.encode(message.payload, 0, message.payload.length) : options.bytes === Array ? Array.prototype.slice.call(message.payload) : message.payload; + if (message.keyData != null && message.hasOwnProperty("keyData")) + object.keyData = options.bytes === String ? $util.base64.encode(message.keyData, 0, message.keyData.length) : options.bytes === Array ? Array.prototype.slice.call(message.keyData) : message.keyData; + if (message.fingerprint != null && message.hasOwnProperty("fingerprint")) + object.fingerprint = $root.proto.AppStateSyncKeyFingerprint.toObject(message.fingerprint, options); + if (message.timestamp != null && message.hasOwnProperty("timestamp")) + if (typeof message.timestamp === "number") + object.timestamp = options.longs === String ? String(message.timestamp) : message.timestamp; + else + object.timestamp = options.longs === String ? $util.Long.prototype.toString.call(message.timestamp) : options.longs === Number ? new $util.LongBits(message.timestamp.low >>> 0, message.timestamp.high >>> 0).toNumber() : message.timestamp; return object; }; /** - * Converts this ServerHello to JSON. + * Converts this AppStateSyncKeyData to JSON. * @function toJSON - * @memberof proto.ServerHello + * @memberof proto.AppStateSyncKeyData * @instance * @returns {Object.} JSON object */ - ServerHello.prototype.toJSON = function toJSON() { + AppStateSyncKeyData.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ServerHello; + return AppStateSyncKeyData; })(); - proto.ClientFinish = (function() { + proto.AppStateSyncKeyFingerprint = (function() { /** - * Properties of a ClientFinish. + * Properties of an AppStateSyncKeyFingerprint. * @memberof proto - * @interface IClientFinish - * @property {Uint8Array|null} ["static"] ClientFinish static - * @property {Uint8Array|null} [payload] ClientFinish payload + * @interface IAppStateSyncKeyFingerprint + * @property {number|null} [rawId] AppStateSyncKeyFingerprint rawId + * @property {number|null} [currentIndex] AppStateSyncKeyFingerprint currentIndex + * @property {Array.|null} [deviceIndexes] AppStateSyncKeyFingerprint deviceIndexes */ /** - * Constructs a new ClientFinish. + * Constructs a new AppStateSyncKeyFingerprint. * @memberof proto - * @classdesc Represents a ClientFinish. - * @implements IClientFinish + * @classdesc Represents an AppStateSyncKeyFingerprint. + * @implements IAppStateSyncKeyFingerprint * @constructor - * @param {proto.IClientFinish=} [properties] Properties to set + * @param {proto.IAppStateSyncKeyFingerprint=} [properties] Properties to set */ - function ClientFinish(properties) { + function AppStateSyncKeyFingerprint(properties) { + this.deviceIndexes = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -4456,88 +3197,112 @@ $root.proto = (function() { } /** - * ClientFinish static. - * @member {Uint8Array} static - * @memberof proto.ClientFinish + * AppStateSyncKeyFingerprint rawId. + * @member {number} rawId + * @memberof proto.AppStateSyncKeyFingerprint * @instance */ - ClientFinish.prototype["static"] = $util.newBuffer([]); + AppStateSyncKeyFingerprint.prototype.rawId = 0; /** - * ClientFinish payload. - * @member {Uint8Array} payload - * @memberof proto.ClientFinish + * AppStateSyncKeyFingerprint currentIndex. + * @member {number} currentIndex + * @memberof proto.AppStateSyncKeyFingerprint * @instance */ - ClientFinish.prototype.payload = $util.newBuffer([]); + AppStateSyncKeyFingerprint.prototype.currentIndex = 0; /** - * Creates a new ClientFinish instance using the specified properties. + * AppStateSyncKeyFingerprint deviceIndexes. + * @member {Array.} deviceIndexes + * @memberof proto.AppStateSyncKeyFingerprint + * @instance + */ + AppStateSyncKeyFingerprint.prototype.deviceIndexes = $util.emptyArray; + + /** + * Creates a new AppStateSyncKeyFingerprint instance using the specified properties. * @function create - * @memberof proto.ClientFinish + * @memberof proto.AppStateSyncKeyFingerprint * @static - * @param {proto.IClientFinish=} [properties] Properties to set - * @returns {proto.ClientFinish} ClientFinish instance + * @param {proto.IAppStateSyncKeyFingerprint=} [properties] Properties to set + * @returns {proto.AppStateSyncKeyFingerprint} AppStateSyncKeyFingerprint instance */ - ClientFinish.create = function create(properties) { - return new ClientFinish(properties); + AppStateSyncKeyFingerprint.create = function create(properties) { + return new AppStateSyncKeyFingerprint(properties); }; /** - * Encodes the specified ClientFinish message. Does not implicitly {@link proto.ClientFinish.verify|verify} messages. + * Encodes the specified AppStateSyncKeyFingerprint message. Does not implicitly {@link proto.AppStateSyncKeyFingerprint.verify|verify} messages. * @function encode - * @memberof proto.ClientFinish + * @memberof proto.AppStateSyncKeyFingerprint * @static - * @param {proto.IClientFinish} message ClientFinish message or plain object to encode + * @param {proto.IAppStateSyncKeyFingerprint} message AppStateSyncKeyFingerprint message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ClientFinish.encode = function encode(message, writer) { + AppStateSyncKeyFingerprint.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message["static"] != null && Object.hasOwnProperty.call(message, "static")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message["static"]); - if (message.payload != null && Object.hasOwnProperty.call(message, "payload")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.payload); + if (message.rawId != null && Object.hasOwnProperty.call(message, "rawId")) + writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.rawId); + if (message.currentIndex != null && Object.hasOwnProperty.call(message, "currentIndex")) + writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.currentIndex); + if (message.deviceIndexes != null && message.deviceIndexes.length) { + writer.uint32(/* id 3, wireType 2 =*/26).fork(); + for (var i = 0; i < message.deviceIndexes.length; ++i) + writer.uint32(message.deviceIndexes[i]); + writer.ldelim(); + } return writer; }; /** - * Encodes the specified ClientFinish message, length delimited. Does not implicitly {@link proto.ClientFinish.verify|verify} messages. + * Encodes the specified AppStateSyncKeyFingerprint message, length delimited. Does not implicitly {@link proto.AppStateSyncKeyFingerprint.verify|verify} messages. * @function encodeDelimited - * @memberof proto.ClientFinish + * @memberof proto.AppStateSyncKeyFingerprint * @static - * @param {proto.IClientFinish} message ClientFinish message or plain object to encode + * @param {proto.IAppStateSyncKeyFingerprint} message AppStateSyncKeyFingerprint message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ClientFinish.encodeDelimited = function encodeDelimited(message, writer) { + AppStateSyncKeyFingerprint.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ClientFinish message from the specified reader or buffer. + * Decodes an AppStateSyncKeyFingerprint message from the specified reader or buffer. * @function decode - * @memberof proto.ClientFinish + * @memberof proto.AppStateSyncKeyFingerprint * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {proto.ClientFinish} ClientFinish + * @returns {proto.AppStateSyncKeyFingerprint} AppStateSyncKeyFingerprint * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ClientFinish.decode = function decode(reader, length) { + AppStateSyncKeyFingerprint.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.ClientFinish(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.AppStateSyncKeyFingerprint(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message["static"] = reader.bytes(); + message.rawId = reader.uint32(); break; case 2: - message.payload = reader.bytes(); + message.currentIndex = reader.uint32(); + break; + case 3: + if (!(message.deviceIndexes && message.deviceIndexes.length)) + message.deviceIndexes = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.deviceIndexes.push(reader.uint32()); + } else + message.deviceIndexes.push(reader.uint32()); break; default: reader.skipType(tag & 7); @@ -4548,136 +3313,137 @@ $root.proto = (function() { }; /** - * Decodes a ClientFinish message from the specified reader or buffer, length delimited. + * Decodes an AppStateSyncKeyFingerprint message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof proto.ClientFinish + * @memberof proto.AppStateSyncKeyFingerprint * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.ClientFinish} ClientFinish + * @returns {proto.AppStateSyncKeyFingerprint} AppStateSyncKeyFingerprint * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ClientFinish.decodeDelimited = function decodeDelimited(reader) { + AppStateSyncKeyFingerprint.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ClientFinish message. + * Verifies an AppStateSyncKeyFingerprint message. * @function verify - * @memberof proto.ClientFinish + * @memberof proto.AppStateSyncKeyFingerprint * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ClientFinish.verify = function verify(message) { + AppStateSyncKeyFingerprint.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message["static"] != null && message.hasOwnProperty("static")) - if (!(message["static"] && typeof message["static"].length === "number" || $util.isString(message["static"]))) - return "static: buffer expected"; - if (message.payload != null && message.hasOwnProperty("payload")) - if (!(message.payload && typeof message.payload.length === "number" || $util.isString(message.payload))) - return "payload: buffer expected"; + if (message.rawId != null && message.hasOwnProperty("rawId")) + if (!$util.isInteger(message.rawId)) + return "rawId: integer expected"; + if (message.currentIndex != null && message.hasOwnProperty("currentIndex")) + if (!$util.isInteger(message.currentIndex)) + return "currentIndex: integer expected"; + if (message.deviceIndexes != null && message.hasOwnProperty("deviceIndexes")) { + if (!Array.isArray(message.deviceIndexes)) + return "deviceIndexes: array expected"; + for (var i = 0; i < message.deviceIndexes.length; ++i) + if (!$util.isInteger(message.deviceIndexes[i])) + return "deviceIndexes: integer[] expected"; + } return null; }; /** - * Creates a ClientFinish message from a plain object. Also converts values to their respective internal types. + * Creates an AppStateSyncKeyFingerprint message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof proto.ClientFinish + * @memberof proto.AppStateSyncKeyFingerprint * @static * @param {Object.} object Plain object - * @returns {proto.ClientFinish} ClientFinish + * @returns {proto.AppStateSyncKeyFingerprint} AppStateSyncKeyFingerprint */ - ClientFinish.fromObject = function fromObject(object) { - if (object instanceof $root.proto.ClientFinish) + AppStateSyncKeyFingerprint.fromObject = function fromObject(object) { + if (object instanceof $root.proto.AppStateSyncKeyFingerprint) return object; - var message = new $root.proto.ClientFinish(); - if (object["static"] != null) - if (typeof object["static"] === "string") - $util.base64.decode(object["static"], message["static"] = $util.newBuffer($util.base64.length(object["static"])), 0); - else if (object["static"].length) - message["static"] = object["static"]; - if (object.payload != null) - if (typeof object.payload === "string") - $util.base64.decode(object.payload, message.payload = $util.newBuffer($util.base64.length(object.payload)), 0); - else if (object.payload.length) - message.payload = object.payload; + var message = new $root.proto.AppStateSyncKeyFingerprint(); + if (object.rawId != null) + message.rawId = object.rawId >>> 0; + if (object.currentIndex != null) + message.currentIndex = object.currentIndex >>> 0; + if (object.deviceIndexes) { + if (!Array.isArray(object.deviceIndexes)) + throw TypeError(".proto.AppStateSyncKeyFingerprint.deviceIndexes: array expected"); + message.deviceIndexes = []; + for (var i = 0; i < object.deviceIndexes.length; ++i) + message.deviceIndexes[i] = object.deviceIndexes[i] >>> 0; + } return message; }; /** - * Creates a plain object from a ClientFinish message. Also converts values to other types if specified. + * Creates a plain object from an AppStateSyncKeyFingerprint message. Also converts values to other types if specified. * @function toObject - * @memberof proto.ClientFinish + * @memberof proto.AppStateSyncKeyFingerprint * @static - * @param {proto.ClientFinish} message ClientFinish + * @param {proto.AppStateSyncKeyFingerprint} message AppStateSyncKeyFingerprint * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ClientFinish.toObject = function toObject(message, options) { + AppStateSyncKeyFingerprint.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.deviceIndexes = []; if (options.defaults) { - if (options.bytes === String) - object["static"] = ""; - else { - object["static"] = []; - if (options.bytes !== Array) - object["static"] = $util.newBuffer(object["static"]); - } - if (options.bytes === String) - object.payload = ""; - else { - object.payload = []; - if (options.bytes !== Array) - object.payload = $util.newBuffer(object.payload); - } + object.rawId = 0; + object.currentIndex = 0; + } + if (message.rawId != null && message.hasOwnProperty("rawId")) + object.rawId = message.rawId; + if (message.currentIndex != null && message.hasOwnProperty("currentIndex")) + object.currentIndex = message.currentIndex; + if (message.deviceIndexes && message.deviceIndexes.length) { + object.deviceIndexes = []; + for (var j = 0; j < message.deviceIndexes.length; ++j) + object.deviceIndexes[j] = message.deviceIndexes[j]; } - if (message["static"] != null && message.hasOwnProperty("static")) - object["static"] = options.bytes === String ? $util.base64.encode(message["static"], 0, message["static"].length) : options.bytes === Array ? Array.prototype.slice.call(message["static"]) : message["static"]; - if (message.payload != null && message.hasOwnProperty("payload")) - object.payload = options.bytes === String ? $util.base64.encode(message.payload, 0, message.payload.length) : options.bytes === Array ? Array.prototype.slice.call(message.payload) : message.payload; return object; }; /** - * Converts this ClientFinish to JSON. + * Converts this AppStateSyncKeyFingerprint to JSON. * @function toJSON - * @memberof proto.ClientFinish + * @memberof proto.AppStateSyncKeyFingerprint * @instance * @returns {Object.} JSON object */ - ClientFinish.prototype.toJSON = function toJSON() { + AppStateSyncKeyFingerprint.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ClientFinish; + return AppStateSyncKeyFingerprint; })(); - proto.HandshakeMessage = (function() { + proto.AppStateSyncKeyId = (function() { /** - * Properties of a HandshakeMessage. + * Properties of an AppStateSyncKeyId. * @memberof proto - * @interface IHandshakeMessage - * @property {proto.IClientHello|null} [clientHello] HandshakeMessage clientHello - * @property {proto.IServerHello|null} [serverHello] HandshakeMessage serverHello - * @property {proto.IClientFinish|null} [clientFinish] HandshakeMessage clientFinish + * @interface IAppStateSyncKeyId + * @property {Uint8Array|null} [keyId] AppStateSyncKeyId keyId */ /** - * Constructs a new HandshakeMessage. + * Constructs a new AppStateSyncKeyId. * @memberof proto - * @classdesc Represents a HandshakeMessage. - * @implements IHandshakeMessage + * @classdesc Represents an AppStateSyncKeyId. + * @implements IAppStateSyncKeyId * @constructor - * @param {proto.IHandshakeMessage=} [properties] Properties to set + * @param {proto.IAppStateSyncKeyId=} [properties] Properties to set */ - function HandshakeMessage(properties) { + function AppStateSyncKeyId(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -4685,101 +3451,75 @@ $root.proto = (function() { } /** - * HandshakeMessage clientHello. - * @member {proto.IClientHello|null|undefined} clientHello - * @memberof proto.HandshakeMessage - * @instance - */ - HandshakeMessage.prototype.clientHello = null; - - /** - * HandshakeMessage serverHello. - * @member {proto.IServerHello|null|undefined} serverHello - * @memberof proto.HandshakeMessage - * @instance - */ - HandshakeMessage.prototype.serverHello = null; - - /** - * HandshakeMessage clientFinish. - * @member {proto.IClientFinish|null|undefined} clientFinish - * @memberof proto.HandshakeMessage + * AppStateSyncKeyId keyId. + * @member {Uint8Array} keyId + * @memberof proto.AppStateSyncKeyId * @instance */ - HandshakeMessage.prototype.clientFinish = null; + AppStateSyncKeyId.prototype.keyId = $util.newBuffer([]); /** - * Creates a new HandshakeMessage instance using the specified properties. + * Creates a new AppStateSyncKeyId instance using the specified properties. * @function create - * @memberof proto.HandshakeMessage + * @memberof proto.AppStateSyncKeyId * @static - * @param {proto.IHandshakeMessage=} [properties] Properties to set - * @returns {proto.HandshakeMessage} HandshakeMessage instance + * @param {proto.IAppStateSyncKeyId=} [properties] Properties to set + * @returns {proto.AppStateSyncKeyId} AppStateSyncKeyId instance */ - HandshakeMessage.create = function create(properties) { - return new HandshakeMessage(properties); + AppStateSyncKeyId.create = function create(properties) { + return new AppStateSyncKeyId(properties); }; /** - * Encodes the specified HandshakeMessage message. Does not implicitly {@link proto.HandshakeMessage.verify|verify} messages. + * Encodes the specified AppStateSyncKeyId message. Does not implicitly {@link proto.AppStateSyncKeyId.verify|verify} messages. * @function encode - * @memberof proto.HandshakeMessage + * @memberof proto.AppStateSyncKeyId * @static - * @param {proto.IHandshakeMessage} message HandshakeMessage message or plain object to encode + * @param {proto.IAppStateSyncKeyId} message AppStateSyncKeyId message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - HandshakeMessage.encode = function encode(message, writer) { + AppStateSyncKeyId.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.clientHello != null && Object.hasOwnProperty.call(message, "clientHello")) - $root.proto.ClientHello.encode(message.clientHello, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.serverHello != null && Object.hasOwnProperty.call(message, "serverHello")) - $root.proto.ServerHello.encode(message.serverHello, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.clientFinish != null && Object.hasOwnProperty.call(message, "clientFinish")) - $root.proto.ClientFinish.encode(message.clientFinish, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.keyId != null && Object.hasOwnProperty.call(message, "keyId")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.keyId); return writer; }; /** - * Encodes the specified HandshakeMessage message, length delimited. Does not implicitly {@link proto.HandshakeMessage.verify|verify} messages. + * Encodes the specified AppStateSyncKeyId message, length delimited. Does not implicitly {@link proto.AppStateSyncKeyId.verify|verify} messages. * @function encodeDelimited - * @memberof proto.HandshakeMessage + * @memberof proto.AppStateSyncKeyId * @static - * @param {proto.IHandshakeMessage} message HandshakeMessage message or plain object to encode + * @param {proto.IAppStateSyncKeyId} message AppStateSyncKeyId message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - HandshakeMessage.encodeDelimited = function encodeDelimited(message, writer) { + AppStateSyncKeyId.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a HandshakeMessage message from the specified reader or buffer. + * Decodes an AppStateSyncKeyId message from the specified reader or buffer. * @function decode - * @memberof proto.HandshakeMessage + * @memberof proto.AppStateSyncKeyId * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {proto.HandshakeMessage} HandshakeMessage + * @returns {proto.AppStateSyncKeyId} AppStateSyncKeyId * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - HandshakeMessage.decode = function decode(reader, length) { + AppStateSyncKeyId.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.HandshakeMessage(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.AppStateSyncKeyId(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 2: - message.clientHello = $root.proto.ClientHello.decode(reader, reader.uint32()); - break; - case 3: - message.serverHello = $root.proto.ServerHello.decode(reader, reader.uint32()); - break; - case 4: - message.clientFinish = $root.proto.ClientFinish.decode(reader, reader.uint32()); + case 1: + message.keyId = reader.bytes(); break; default: reader.skipType(tag & 7); @@ -4790,146 +3530,117 @@ $root.proto = (function() { }; /** - * Decodes a HandshakeMessage message from the specified reader or buffer, length delimited. + * Decodes an AppStateSyncKeyId message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof proto.HandshakeMessage + * @memberof proto.AppStateSyncKeyId * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.HandshakeMessage} HandshakeMessage + * @returns {proto.AppStateSyncKeyId} AppStateSyncKeyId * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - HandshakeMessage.decodeDelimited = function decodeDelimited(reader) { + AppStateSyncKeyId.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a HandshakeMessage message. + * Verifies an AppStateSyncKeyId message. * @function verify - * @memberof proto.HandshakeMessage + * @memberof proto.AppStateSyncKeyId * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - HandshakeMessage.verify = function verify(message) { + AppStateSyncKeyId.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.clientHello != null && message.hasOwnProperty("clientHello")) { - var error = $root.proto.ClientHello.verify(message.clientHello); - if (error) - return "clientHello." + error; - } - if (message.serverHello != null && message.hasOwnProperty("serverHello")) { - var error = $root.proto.ServerHello.verify(message.serverHello); - if (error) - return "serverHello." + error; - } - if (message.clientFinish != null && message.hasOwnProperty("clientFinish")) { - var error = $root.proto.ClientFinish.verify(message.clientFinish); - if (error) - return "clientFinish." + error; - } + if (message.keyId != null && message.hasOwnProperty("keyId")) + if (!(message.keyId && typeof message.keyId.length === "number" || $util.isString(message.keyId))) + return "keyId: buffer expected"; return null; }; /** - * Creates a HandshakeMessage message from a plain object. Also converts values to their respective internal types. + * Creates an AppStateSyncKeyId message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof proto.HandshakeMessage + * @memberof proto.AppStateSyncKeyId * @static * @param {Object.} object Plain object - * @returns {proto.HandshakeMessage} HandshakeMessage + * @returns {proto.AppStateSyncKeyId} AppStateSyncKeyId */ - HandshakeMessage.fromObject = function fromObject(object) { - if (object instanceof $root.proto.HandshakeMessage) + AppStateSyncKeyId.fromObject = function fromObject(object) { + if (object instanceof $root.proto.AppStateSyncKeyId) return object; - var message = new $root.proto.HandshakeMessage(); - if (object.clientHello != null) { - if (typeof object.clientHello !== "object") - throw TypeError(".proto.HandshakeMessage.clientHello: object expected"); - message.clientHello = $root.proto.ClientHello.fromObject(object.clientHello); - } - if (object.serverHello != null) { - if (typeof object.serverHello !== "object") - throw TypeError(".proto.HandshakeMessage.serverHello: object expected"); - message.serverHello = $root.proto.ServerHello.fromObject(object.serverHello); - } - if (object.clientFinish != null) { - if (typeof object.clientFinish !== "object") - throw TypeError(".proto.HandshakeMessage.clientFinish: object expected"); - message.clientFinish = $root.proto.ClientFinish.fromObject(object.clientFinish); - } + var message = new $root.proto.AppStateSyncKeyId(); + if (object.keyId != null) + if (typeof object.keyId === "string") + $util.base64.decode(object.keyId, message.keyId = $util.newBuffer($util.base64.length(object.keyId)), 0); + else if (object.keyId.length) + message.keyId = object.keyId; return message; }; /** - * Creates a plain object from a HandshakeMessage message. Also converts values to other types if specified. + * Creates a plain object from an AppStateSyncKeyId message. Also converts values to other types if specified. * @function toObject - * @memberof proto.HandshakeMessage + * @memberof proto.AppStateSyncKeyId * @static - * @param {proto.HandshakeMessage} message HandshakeMessage + * @param {proto.AppStateSyncKeyId} message AppStateSyncKeyId * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - HandshakeMessage.toObject = function toObject(message, options) { + AppStateSyncKeyId.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.clientHello = null; - object.serverHello = null; - object.clientFinish = null; - } - if (message.clientHello != null && message.hasOwnProperty("clientHello")) - object.clientHello = $root.proto.ClientHello.toObject(message.clientHello, options); - if (message.serverHello != null && message.hasOwnProperty("serverHello")) - object.serverHello = $root.proto.ServerHello.toObject(message.serverHello, options); - if (message.clientFinish != null && message.hasOwnProperty("clientFinish")) - object.clientFinish = $root.proto.ClientFinish.toObject(message.clientFinish, options); + if (options.defaults) + if (options.bytes === String) + object.keyId = ""; + else { + object.keyId = []; + if (options.bytes !== Array) + object.keyId = $util.newBuffer(object.keyId); + } + if (message.keyId != null && message.hasOwnProperty("keyId")) + object.keyId = options.bytes === String ? $util.base64.encode(message.keyId, 0, message.keyId.length) : options.bytes === Array ? Array.prototype.slice.call(message.keyId) : message.keyId; return object; }; /** - * Converts this HandshakeMessage to JSON. + * Converts this AppStateSyncKeyId to JSON. * @function toJSON - * @memberof proto.HandshakeMessage + * @memberof proto.AppStateSyncKeyId * @instance * @returns {Object.} JSON object */ - HandshakeMessage.prototype.toJSON = function toJSON() { + AppStateSyncKeyId.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return HandshakeMessage; + return AppStateSyncKeyId; })(); - proto.BizIdentityInfo = (function() { + proto.AppStateSyncKeyRequest = (function() { /** - * Properties of a BizIdentityInfo. + * Properties of an AppStateSyncKeyRequest. * @memberof proto - * @interface IBizIdentityInfo - * @property {proto.BizIdentityInfo.BizIdentityInfoVerifiedLevelValue|null} [vlevel] BizIdentityInfo vlevel - * @property {proto.IVerifiedNameCertificate|null} [vnameCert] BizIdentityInfo vnameCert - * @property {boolean|null} [signed] BizIdentityInfo signed - * @property {boolean|null} [revoked] BizIdentityInfo revoked - * @property {proto.BizIdentityInfo.BizIdentityInfoHostStorageType|null} [hostStorage] BizIdentityInfo hostStorage - * @property {proto.BizIdentityInfo.BizIdentityInfoActualActorsType|null} [actualActors] BizIdentityInfo actualActors - * @property {number|Long|null} [privacyModeTs] BizIdentityInfo privacyModeTs - * @property {number|Long|null} [featureControls] BizIdentityInfo featureControls + * @interface IAppStateSyncKeyRequest + * @property {Array.|null} [keyIds] AppStateSyncKeyRequest keyIds */ /** - * Constructs a new BizIdentityInfo. + * Constructs a new AppStateSyncKeyRequest. * @memberof proto - * @classdesc Represents a BizIdentityInfo. - * @implements IBizIdentityInfo + * @classdesc Represents an AppStateSyncKeyRequest. + * @implements IAppStateSyncKeyRequest * @constructor - * @param {proto.IBizIdentityInfo=} [properties] Properties to set + * @param {proto.IAppStateSyncKeyRequest=} [properties] Properties to set */ - function BizIdentityInfo(properties) { + function AppStateSyncKeyRequest(properties) { + this.keyIds = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -4937,166 +3648,78 @@ $root.proto = (function() { } /** - * BizIdentityInfo vlevel. - * @member {proto.BizIdentityInfo.BizIdentityInfoVerifiedLevelValue} vlevel - * @memberof proto.BizIdentityInfo - * @instance - */ - BizIdentityInfo.prototype.vlevel = 0; - - /** - * BizIdentityInfo vnameCert. - * @member {proto.IVerifiedNameCertificate|null|undefined} vnameCert - * @memberof proto.BizIdentityInfo - * @instance - */ - BizIdentityInfo.prototype.vnameCert = null; - - /** - * BizIdentityInfo signed. - * @member {boolean} signed - * @memberof proto.BizIdentityInfo - * @instance - */ - BizIdentityInfo.prototype.signed = false; - - /** - * BizIdentityInfo revoked. - * @member {boolean} revoked - * @memberof proto.BizIdentityInfo - * @instance - */ - BizIdentityInfo.prototype.revoked = false; - - /** - * BizIdentityInfo hostStorage. - * @member {proto.BizIdentityInfo.BizIdentityInfoHostStorageType} hostStorage - * @memberof proto.BizIdentityInfo - * @instance - */ - BizIdentityInfo.prototype.hostStorage = 0; - - /** - * BizIdentityInfo actualActors. - * @member {proto.BizIdentityInfo.BizIdentityInfoActualActorsType} actualActors - * @memberof proto.BizIdentityInfo - * @instance - */ - BizIdentityInfo.prototype.actualActors = 0; - - /** - * BizIdentityInfo privacyModeTs. - * @member {number|Long} privacyModeTs - * @memberof proto.BizIdentityInfo - * @instance - */ - BizIdentityInfo.prototype.privacyModeTs = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * BizIdentityInfo featureControls. - * @member {number|Long} featureControls - * @memberof proto.BizIdentityInfo + * AppStateSyncKeyRequest keyIds. + * @member {Array.} keyIds + * @memberof proto.AppStateSyncKeyRequest * @instance */ - BizIdentityInfo.prototype.featureControls = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + AppStateSyncKeyRequest.prototype.keyIds = $util.emptyArray; /** - * Creates a new BizIdentityInfo instance using the specified properties. + * Creates a new AppStateSyncKeyRequest instance using the specified properties. * @function create - * @memberof proto.BizIdentityInfo + * @memberof proto.AppStateSyncKeyRequest * @static - * @param {proto.IBizIdentityInfo=} [properties] Properties to set - * @returns {proto.BizIdentityInfo} BizIdentityInfo instance + * @param {proto.IAppStateSyncKeyRequest=} [properties] Properties to set + * @returns {proto.AppStateSyncKeyRequest} AppStateSyncKeyRequest instance */ - BizIdentityInfo.create = function create(properties) { - return new BizIdentityInfo(properties); + AppStateSyncKeyRequest.create = function create(properties) { + return new AppStateSyncKeyRequest(properties); }; /** - * Encodes the specified BizIdentityInfo message. Does not implicitly {@link proto.BizIdentityInfo.verify|verify} messages. + * Encodes the specified AppStateSyncKeyRequest message. Does not implicitly {@link proto.AppStateSyncKeyRequest.verify|verify} messages. * @function encode - * @memberof proto.BizIdentityInfo + * @memberof proto.AppStateSyncKeyRequest * @static - * @param {proto.IBizIdentityInfo} message BizIdentityInfo message or plain object to encode + * @param {proto.IAppStateSyncKeyRequest} message AppStateSyncKeyRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BizIdentityInfo.encode = function encode(message, writer) { + AppStateSyncKeyRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.vlevel != null && Object.hasOwnProperty.call(message, "vlevel")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.vlevel); - if (message.vnameCert != null && Object.hasOwnProperty.call(message, "vnameCert")) - $root.proto.VerifiedNameCertificate.encode(message.vnameCert, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.signed != null && Object.hasOwnProperty.call(message, "signed")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.signed); - if (message.revoked != null && Object.hasOwnProperty.call(message, "revoked")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.revoked); - if (message.hostStorage != null && Object.hasOwnProperty.call(message, "hostStorage")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.hostStorage); - if (message.actualActors != null && Object.hasOwnProperty.call(message, "actualActors")) - writer.uint32(/* id 6, wireType 0 =*/48).int32(message.actualActors); - if (message.privacyModeTs != null && Object.hasOwnProperty.call(message, "privacyModeTs")) - writer.uint32(/* id 7, wireType 0 =*/56).uint64(message.privacyModeTs); - if (message.featureControls != null && Object.hasOwnProperty.call(message, "featureControls")) - writer.uint32(/* id 8, wireType 0 =*/64).uint64(message.featureControls); + if (message.keyIds != null && message.keyIds.length) + for (var i = 0; i < message.keyIds.length; ++i) + $root.proto.AppStateSyncKeyId.encode(message.keyIds[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; /** - * Encodes the specified BizIdentityInfo message, length delimited. Does not implicitly {@link proto.BizIdentityInfo.verify|verify} messages. + * Encodes the specified AppStateSyncKeyRequest message, length delimited. Does not implicitly {@link proto.AppStateSyncKeyRequest.verify|verify} messages. * @function encodeDelimited - * @memberof proto.BizIdentityInfo + * @memberof proto.AppStateSyncKeyRequest * @static - * @param {proto.IBizIdentityInfo} message BizIdentityInfo message or plain object to encode + * @param {proto.IAppStateSyncKeyRequest} message AppStateSyncKeyRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BizIdentityInfo.encodeDelimited = function encodeDelimited(message, writer) { + AppStateSyncKeyRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a BizIdentityInfo message from the specified reader or buffer. + * Decodes an AppStateSyncKeyRequest message from the specified reader or buffer. * @function decode - * @memberof proto.BizIdentityInfo + * @memberof proto.AppStateSyncKeyRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {proto.BizIdentityInfo} BizIdentityInfo + * @returns {proto.AppStateSyncKeyRequest} AppStateSyncKeyRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - BizIdentityInfo.decode = function decode(reader, length) { + AppStateSyncKeyRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.BizIdentityInfo(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.AppStateSyncKeyRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.vlevel = reader.int32(); - break; - case 2: - message.vnameCert = $root.proto.VerifiedNameCertificate.decode(reader, reader.uint32()); - break; - case 3: - message.signed = reader.bool(); - break; - case 4: - message.revoked = reader.bool(); - break; - case 5: - message.hostStorage = reader.int32(); - break; - case 6: - message.actualActors = reader.int32(); - break; - case 7: - message.privacyModeTs = reader.uint64(); - break; - case 8: - message.featureControls = reader.uint64(); + if (!(message.keyIds && message.keyIds.length)) + message.keyIds = []; + message.keyIds.push($root.proto.AppStateSyncKeyId.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -5107,289 +3730,125 @@ $root.proto = (function() { }; /** - * Decodes a BizIdentityInfo message from the specified reader or buffer, length delimited. + * Decodes an AppStateSyncKeyRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof proto.BizIdentityInfo + * @memberof proto.AppStateSyncKeyRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.BizIdentityInfo} BizIdentityInfo + * @returns {proto.AppStateSyncKeyRequest} AppStateSyncKeyRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - BizIdentityInfo.decodeDelimited = function decodeDelimited(reader) { + AppStateSyncKeyRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a BizIdentityInfo message. + * Verifies an AppStateSyncKeyRequest message. * @function verify - * @memberof proto.BizIdentityInfo + * @memberof proto.AppStateSyncKeyRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - BizIdentityInfo.verify = function verify(message) { + AppStateSyncKeyRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.vlevel != null && message.hasOwnProperty("vlevel")) - switch (message.vlevel) { - default: - return "vlevel: enum value expected"; - case 0: - case 1: - case 2: - break; + if (message.keyIds != null && message.hasOwnProperty("keyIds")) { + if (!Array.isArray(message.keyIds)) + return "keyIds: array expected"; + for (var i = 0; i < message.keyIds.length; ++i) { + var error = $root.proto.AppStateSyncKeyId.verify(message.keyIds[i]); + if (error) + return "keyIds." + error; } - if (message.vnameCert != null && message.hasOwnProperty("vnameCert")) { - var error = $root.proto.VerifiedNameCertificate.verify(message.vnameCert); - if (error) - return "vnameCert." + error; } - if (message.signed != null && message.hasOwnProperty("signed")) - if (typeof message.signed !== "boolean") - return "signed: boolean expected"; - if (message.revoked != null && message.hasOwnProperty("revoked")) - if (typeof message.revoked !== "boolean") - return "revoked: boolean expected"; - if (message.hostStorage != null && message.hasOwnProperty("hostStorage")) - switch (message.hostStorage) { - default: - return "hostStorage: enum value expected"; - case 0: - case 1: - break; - } - if (message.actualActors != null && message.hasOwnProperty("actualActors")) - switch (message.actualActors) { - default: - return "actualActors: enum value expected"; - case 0: - case 1: - break; - } - if (message.privacyModeTs != null && message.hasOwnProperty("privacyModeTs")) - if (!$util.isInteger(message.privacyModeTs) && !(message.privacyModeTs && $util.isInteger(message.privacyModeTs.low) && $util.isInteger(message.privacyModeTs.high))) - return "privacyModeTs: integer|Long expected"; - if (message.featureControls != null && message.hasOwnProperty("featureControls")) - if (!$util.isInteger(message.featureControls) && !(message.featureControls && $util.isInteger(message.featureControls.low) && $util.isInteger(message.featureControls.high))) - return "featureControls: integer|Long expected"; return null; }; /** - * Creates a BizIdentityInfo message from a plain object. Also converts values to their respective internal types. + * Creates an AppStateSyncKeyRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof proto.BizIdentityInfo + * @memberof proto.AppStateSyncKeyRequest * @static * @param {Object.} object Plain object - * @returns {proto.BizIdentityInfo} BizIdentityInfo + * @returns {proto.AppStateSyncKeyRequest} AppStateSyncKeyRequest */ - BizIdentityInfo.fromObject = function fromObject(object) { - if (object instanceof $root.proto.BizIdentityInfo) + AppStateSyncKeyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.proto.AppStateSyncKeyRequest) return object; - var message = new $root.proto.BizIdentityInfo(); - switch (object.vlevel) { - case "UNKNOWN": - case 0: - message.vlevel = 0; - break; - case "LOW": - case 1: - message.vlevel = 1; - break; - case "HIGH": - case 2: - message.vlevel = 2; - break; - } - if (object.vnameCert != null) { - if (typeof object.vnameCert !== "object") - throw TypeError(".proto.BizIdentityInfo.vnameCert: object expected"); - message.vnameCert = $root.proto.VerifiedNameCertificate.fromObject(object.vnameCert); - } - if (object.signed != null) - message.signed = Boolean(object.signed); - if (object.revoked != null) - message.revoked = Boolean(object.revoked); - switch (object.hostStorage) { - case "ON_PREMISE": - case 0: - message.hostStorage = 0; - break; - case "FACEBOOK": - case 1: - message.hostStorage = 1; - break; - } - switch (object.actualActors) { - case "SELF": - case 0: - message.actualActors = 0; - break; - case "BSP": - case 1: - message.actualActors = 1; - break; + var message = new $root.proto.AppStateSyncKeyRequest(); + if (object.keyIds) { + if (!Array.isArray(object.keyIds)) + throw TypeError(".proto.AppStateSyncKeyRequest.keyIds: array expected"); + message.keyIds = []; + for (var i = 0; i < object.keyIds.length; ++i) { + if (typeof object.keyIds[i] !== "object") + throw TypeError(".proto.AppStateSyncKeyRequest.keyIds: object expected"); + message.keyIds[i] = $root.proto.AppStateSyncKeyId.fromObject(object.keyIds[i]); + } } - if (object.privacyModeTs != null) - if ($util.Long) - (message.privacyModeTs = $util.Long.fromValue(object.privacyModeTs)).unsigned = true; - else if (typeof object.privacyModeTs === "string") - message.privacyModeTs = parseInt(object.privacyModeTs, 10); - else if (typeof object.privacyModeTs === "number") - message.privacyModeTs = object.privacyModeTs; - else if (typeof object.privacyModeTs === "object") - message.privacyModeTs = new $util.LongBits(object.privacyModeTs.low >>> 0, object.privacyModeTs.high >>> 0).toNumber(true); - if (object.featureControls != null) - if ($util.Long) - (message.featureControls = $util.Long.fromValue(object.featureControls)).unsigned = true; - else if (typeof object.featureControls === "string") - message.featureControls = parseInt(object.featureControls, 10); - else if (typeof object.featureControls === "number") - message.featureControls = object.featureControls; - else if (typeof object.featureControls === "object") - message.featureControls = new $util.LongBits(object.featureControls.low >>> 0, object.featureControls.high >>> 0).toNumber(true); return message; }; /** - * Creates a plain object from a BizIdentityInfo message. Also converts values to other types if specified. + * Creates a plain object from an AppStateSyncKeyRequest message. Also converts values to other types if specified. * @function toObject - * @memberof proto.BizIdentityInfo + * @memberof proto.AppStateSyncKeyRequest * @static - * @param {proto.BizIdentityInfo} message BizIdentityInfo + * @param {proto.AppStateSyncKeyRequest} message AppStateSyncKeyRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - BizIdentityInfo.toObject = function toObject(message, options) { + AppStateSyncKeyRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.vlevel = options.enums === String ? "UNKNOWN" : 0; - object.vnameCert = null; - object.signed = false; - object.revoked = false; - object.hostStorage = options.enums === String ? "ON_PREMISE" : 0; - object.actualActors = options.enums === String ? "SELF" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.privacyModeTs = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.privacyModeTs = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.featureControls = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.featureControls = options.longs === String ? "0" : 0; + if (options.arrays || options.defaults) + object.keyIds = []; + if (message.keyIds && message.keyIds.length) { + object.keyIds = []; + for (var j = 0; j < message.keyIds.length; ++j) + object.keyIds[j] = $root.proto.AppStateSyncKeyId.toObject(message.keyIds[j], options); } - if (message.vlevel != null && message.hasOwnProperty("vlevel")) - object.vlevel = options.enums === String ? $root.proto.BizIdentityInfo.BizIdentityInfoVerifiedLevelValue[message.vlevel] : message.vlevel; - if (message.vnameCert != null && message.hasOwnProperty("vnameCert")) - object.vnameCert = $root.proto.VerifiedNameCertificate.toObject(message.vnameCert, options); - if (message.signed != null && message.hasOwnProperty("signed")) - object.signed = message.signed; - if (message.revoked != null && message.hasOwnProperty("revoked")) - object.revoked = message.revoked; - if (message.hostStorage != null && message.hasOwnProperty("hostStorage")) - object.hostStorage = options.enums === String ? $root.proto.BizIdentityInfo.BizIdentityInfoHostStorageType[message.hostStorage] : message.hostStorage; - if (message.actualActors != null && message.hasOwnProperty("actualActors")) - object.actualActors = options.enums === String ? $root.proto.BizIdentityInfo.BizIdentityInfoActualActorsType[message.actualActors] : message.actualActors; - if (message.privacyModeTs != null && message.hasOwnProperty("privacyModeTs")) - if (typeof message.privacyModeTs === "number") - object.privacyModeTs = options.longs === String ? String(message.privacyModeTs) : message.privacyModeTs; - else - object.privacyModeTs = options.longs === String ? $util.Long.prototype.toString.call(message.privacyModeTs) : options.longs === Number ? new $util.LongBits(message.privacyModeTs.low >>> 0, message.privacyModeTs.high >>> 0).toNumber(true) : message.privacyModeTs; - if (message.featureControls != null && message.hasOwnProperty("featureControls")) - if (typeof message.featureControls === "number") - object.featureControls = options.longs === String ? String(message.featureControls) : message.featureControls; - else - object.featureControls = options.longs === String ? $util.Long.prototype.toString.call(message.featureControls) : options.longs === Number ? new $util.LongBits(message.featureControls.low >>> 0, message.featureControls.high >>> 0).toNumber(true) : message.featureControls; return object; }; /** - * Converts this BizIdentityInfo to JSON. + * Converts this AppStateSyncKeyRequest to JSON. * @function toJSON - * @memberof proto.BizIdentityInfo + * @memberof proto.AppStateSyncKeyRequest * @instance * @returns {Object.} JSON object */ - BizIdentityInfo.prototype.toJSON = function toJSON() { + AppStateSyncKeyRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - /** - * BizIdentityInfoVerifiedLevelValue enum. - * @name proto.BizIdentityInfo.BizIdentityInfoVerifiedLevelValue - * @enum {number} - * @property {number} UNKNOWN=0 UNKNOWN value - * @property {number} LOW=1 LOW value - * @property {number} HIGH=2 HIGH value - */ - BizIdentityInfo.BizIdentityInfoVerifiedLevelValue = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "UNKNOWN"] = 0; - values[valuesById[1] = "LOW"] = 1; - values[valuesById[2] = "HIGH"] = 2; - return values; - })(); - - /** - * BizIdentityInfoHostStorageType enum. - * @name proto.BizIdentityInfo.BizIdentityInfoHostStorageType - * @enum {number} - * @property {number} ON_PREMISE=0 ON_PREMISE value - * @property {number} FACEBOOK=1 FACEBOOK value - */ - BizIdentityInfo.BizIdentityInfoHostStorageType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "ON_PREMISE"] = 0; - values[valuesById[1] = "FACEBOOK"] = 1; - return values; - })(); - - /** - * BizIdentityInfoActualActorsType enum. - * @name proto.BizIdentityInfo.BizIdentityInfoActualActorsType - * @enum {number} - * @property {number} SELF=0 SELF value - * @property {number} BSP=1 BSP value - */ - BizIdentityInfo.BizIdentityInfoActualActorsType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "SELF"] = 0; - values[valuesById[1] = "BSP"] = 1; - return values; - })(); - - return BizIdentityInfo; + return AppStateSyncKeyRequest; })(); - proto.BizAccountLinkInfo = (function() { + proto.AppStateSyncKeyShare = (function() { /** - * Properties of a BizAccountLinkInfo. + * Properties of an AppStateSyncKeyShare. * @memberof proto - * @interface IBizAccountLinkInfo - * @property {number|Long|null} [whatsappBizAcctFbid] BizAccountLinkInfo whatsappBizAcctFbid - * @property {string|null} [whatsappAcctNumber] BizAccountLinkInfo whatsappAcctNumber - * @property {number|Long|null} [issueTime] BizAccountLinkInfo issueTime - * @property {proto.BizAccountLinkInfo.BizAccountLinkInfoHostStorageType|null} [hostStorage] BizAccountLinkInfo hostStorage - * @property {proto.BizAccountLinkInfo.BizAccountLinkInfoAccountType|null} [accountType] BizAccountLinkInfo accountType + * @interface IAppStateSyncKeyShare + * @property {Array.|null} [keys] AppStateSyncKeyShare keys */ /** - * Constructs a new BizAccountLinkInfo. + * Constructs a new AppStateSyncKeyShare. * @memberof proto - * @classdesc Represents a BizAccountLinkInfo. - * @implements IBizAccountLinkInfo + * @classdesc Represents an AppStateSyncKeyShare. + * @implements IAppStateSyncKeyShare * @constructor - * @param {proto.IBizAccountLinkInfo=} [properties] Properties to set + * @param {proto.IAppStateSyncKeyShare=} [properties] Properties to set */ - function BizAccountLinkInfo(properties) { + function AppStateSyncKeyShare(properties) { + this.keys = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -5397,127 +3856,78 @@ $root.proto = (function() { } /** - * BizAccountLinkInfo whatsappBizAcctFbid. - * @member {number|Long} whatsappBizAcctFbid - * @memberof proto.BizAccountLinkInfo - * @instance - */ - BizAccountLinkInfo.prototype.whatsappBizAcctFbid = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * BizAccountLinkInfo whatsappAcctNumber. - * @member {string} whatsappAcctNumber - * @memberof proto.BizAccountLinkInfo - * @instance - */ - BizAccountLinkInfo.prototype.whatsappAcctNumber = ""; - - /** - * BizAccountLinkInfo issueTime. - * @member {number|Long} issueTime - * @memberof proto.BizAccountLinkInfo - * @instance - */ - BizAccountLinkInfo.prototype.issueTime = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * BizAccountLinkInfo hostStorage. - * @member {proto.BizAccountLinkInfo.BizAccountLinkInfoHostStorageType} hostStorage - * @memberof proto.BizAccountLinkInfo - * @instance - */ - BizAccountLinkInfo.prototype.hostStorage = 0; - - /** - * BizAccountLinkInfo accountType. - * @member {proto.BizAccountLinkInfo.BizAccountLinkInfoAccountType} accountType - * @memberof proto.BizAccountLinkInfo + * AppStateSyncKeyShare keys. + * @member {Array.} keys + * @memberof proto.AppStateSyncKeyShare * @instance */ - BizAccountLinkInfo.prototype.accountType = 0; + AppStateSyncKeyShare.prototype.keys = $util.emptyArray; /** - * Creates a new BizAccountLinkInfo instance using the specified properties. + * Creates a new AppStateSyncKeyShare instance using the specified properties. * @function create - * @memberof proto.BizAccountLinkInfo + * @memberof proto.AppStateSyncKeyShare * @static - * @param {proto.IBizAccountLinkInfo=} [properties] Properties to set - * @returns {proto.BizAccountLinkInfo} BizAccountLinkInfo instance + * @param {proto.IAppStateSyncKeyShare=} [properties] Properties to set + * @returns {proto.AppStateSyncKeyShare} AppStateSyncKeyShare instance */ - BizAccountLinkInfo.create = function create(properties) { - return new BizAccountLinkInfo(properties); + AppStateSyncKeyShare.create = function create(properties) { + return new AppStateSyncKeyShare(properties); }; /** - * Encodes the specified BizAccountLinkInfo message. Does not implicitly {@link proto.BizAccountLinkInfo.verify|verify} messages. + * Encodes the specified AppStateSyncKeyShare message. Does not implicitly {@link proto.AppStateSyncKeyShare.verify|verify} messages. * @function encode - * @memberof proto.BizAccountLinkInfo + * @memberof proto.AppStateSyncKeyShare * @static - * @param {proto.IBizAccountLinkInfo} message BizAccountLinkInfo message or plain object to encode + * @param {proto.IAppStateSyncKeyShare} message AppStateSyncKeyShare message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BizAccountLinkInfo.encode = function encode(message, writer) { + AppStateSyncKeyShare.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.whatsappBizAcctFbid != null && Object.hasOwnProperty.call(message, "whatsappBizAcctFbid")) - writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.whatsappBizAcctFbid); - if (message.whatsappAcctNumber != null && Object.hasOwnProperty.call(message, "whatsappAcctNumber")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.whatsappAcctNumber); - if (message.issueTime != null && Object.hasOwnProperty.call(message, "issueTime")) - writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.issueTime); - if (message.hostStorage != null && Object.hasOwnProperty.call(message, "hostStorage")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.hostStorage); - if (message.accountType != null && Object.hasOwnProperty.call(message, "accountType")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.accountType); + if (message.keys != null && message.keys.length) + for (var i = 0; i < message.keys.length; ++i) + $root.proto.AppStateSyncKey.encode(message.keys[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; /** - * Encodes the specified BizAccountLinkInfo message, length delimited. Does not implicitly {@link proto.BizAccountLinkInfo.verify|verify} messages. + * Encodes the specified AppStateSyncKeyShare message, length delimited. Does not implicitly {@link proto.AppStateSyncKeyShare.verify|verify} messages. * @function encodeDelimited - * @memberof proto.BizAccountLinkInfo + * @memberof proto.AppStateSyncKeyShare * @static - * @param {proto.IBizAccountLinkInfo} message BizAccountLinkInfo message or plain object to encode + * @param {proto.IAppStateSyncKeyShare} message AppStateSyncKeyShare message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BizAccountLinkInfo.encodeDelimited = function encodeDelimited(message, writer) { + AppStateSyncKeyShare.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a BizAccountLinkInfo message from the specified reader or buffer. + * Decodes an AppStateSyncKeyShare message from the specified reader or buffer. * @function decode - * @memberof proto.BizAccountLinkInfo + * @memberof proto.AppStateSyncKeyShare * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {proto.BizAccountLinkInfo} BizAccountLinkInfo + * @returns {proto.AppStateSyncKeyShare} AppStateSyncKeyShare * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - BizAccountLinkInfo.decode = function decode(reader, length) { + AppStateSyncKeyShare.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.BizAccountLinkInfo(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.AppStateSyncKeyShare(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.whatsappBizAcctFbid = reader.uint64(); - break; - case 2: - message.whatsappAcctNumber = reader.string(); - break; - case 3: - message.issueTime = reader.uint64(); - break; - case 4: - message.hostStorage = reader.int32(); - break; - case 5: - message.accountType = reader.int32(); + if (!(message.keys && message.keys.length)) + message.keys = []; + message.keys.push($root.proto.AppStateSyncKey.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -5528,216 +3938,136 @@ $root.proto = (function() { }; /** - * Decodes a BizAccountLinkInfo message from the specified reader or buffer, length delimited. + * Decodes an AppStateSyncKeyShare message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof proto.BizAccountLinkInfo + * @memberof proto.AppStateSyncKeyShare * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.BizAccountLinkInfo} BizAccountLinkInfo + * @returns {proto.AppStateSyncKeyShare} AppStateSyncKeyShare * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - BizAccountLinkInfo.decodeDelimited = function decodeDelimited(reader) { + AppStateSyncKeyShare.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a BizAccountLinkInfo message. + * Verifies an AppStateSyncKeyShare message. * @function verify - * @memberof proto.BizAccountLinkInfo + * @memberof proto.AppStateSyncKeyShare * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - BizAccountLinkInfo.verify = function verify(message) { + AppStateSyncKeyShare.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.whatsappBizAcctFbid != null && message.hasOwnProperty("whatsappBizAcctFbid")) - if (!$util.isInteger(message.whatsappBizAcctFbid) && !(message.whatsappBizAcctFbid && $util.isInteger(message.whatsappBizAcctFbid.low) && $util.isInteger(message.whatsappBizAcctFbid.high))) - return "whatsappBizAcctFbid: integer|Long expected"; - if (message.whatsappAcctNumber != null && message.hasOwnProperty("whatsappAcctNumber")) - if (!$util.isString(message.whatsappAcctNumber)) - return "whatsappAcctNumber: string expected"; - if (message.issueTime != null && message.hasOwnProperty("issueTime")) - if (!$util.isInteger(message.issueTime) && !(message.issueTime && $util.isInteger(message.issueTime.low) && $util.isInteger(message.issueTime.high))) - return "issueTime: integer|Long expected"; - if (message.hostStorage != null && message.hasOwnProperty("hostStorage")) - switch (message.hostStorage) { - default: - return "hostStorage: enum value expected"; - case 0: - case 1: - break; - } - if (message.accountType != null && message.hasOwnProperty("accountType")) - switch (message.accountType) { - default: - return "accountType: enum value expected"; - case 0: - break; + if (message.keys != null && message.hasOwnProperty("keys")) { + if (!Array.isArray(message.keys)) + return "keys: array expected"; + for (var i = 0; i < message.keys.length; ++i) { + var error = $root.proto.AppStateSyncKey.verify(message.keys[i]); + if (error) + return "keys." + error; } + } return null; }; /** - * Creates a BizAccountLinkInfo message from a plain object. Also converts values to their respective internal types. + * Creates an AppStateSyncKeyShare message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof proto.BizAccountLinkInfo + * @memberof proto.AppStateSyncKeyShare * @static * @param {Object.} object Plain object - * @returns {proto.BizAccountLinkInfo} BizAccountLinkInfo + * @returns {proto.AppStateSyncKeyShare} AppStateSyncKeyShare */ - BizAccountLinkInfo.fromObject = function fromObject(object) { - if (object instanceof $root.proto.BizAccountLinkInfo) + AppStateSyncKeyShare.fromObject = function fromObject(object) { + if (object instanceof $root.proto.AppStateSyncKeyShare) return object; - var message = new $root.proto.BizAccountLinkInfo(); - if (object.whatsappBizAcctFbid != null) - if ($util.Long) - (message.whatsappBizAcctFbid = $util.Long.fromValue(object.whatsappBizAcctFbid)).unsigned = true; - else if (typeof object.whatsappBizAcctFbid === "string") - message.whatsappBizAcctFbid = parseInt(object.whatsappBizAcctFbid, 10); - else if (typeof object.whatsappBizAcctFbid === "number") - message.whatsappBizAcctFbid = object.whatsappBizAcctFbid; - else if (typeof object.whatsappBizAcctFbid === "object") - message.whatsappBizAcctFbid = new $util.LongBits(object.whatsappBizAcctFbid.low >>> 0, object.whatsappBizAcctFbid.high >>> 0).toNumber(true); - if (object.whatsappAcctNumber != null) - message.whatsappAcctNumber = String(object.whatsappAcctNumber); - if (object.issueTime != null) - if ($util.Long) - (message.issueTime = $util.Long.fromValue(object.issueTime)).unsigned = true; - else if (typeof object.issueTime === "string") - message.issueTime = parseInt(object.issueTime, 10); - else if (typeof object.issueTime === "number") - message.issueTime = object.issueTime; - else if (typeof object.issueTime === "object") - message.issueTime = new $util.LongBits(object.issueTime.low >>> 0, object.issueTime.high >>> 0).toNumber(true); - switch (object.hostStorage) { - case "ON_PREMISE": - case 0: - message.hostStorage = 0; - break; - case "FACEBOOK": - case 1: - message.hostStorage = 1; - break; - } - switch (object.accountType) { - case "ENTERPRISE": - case 0: - message.accountType = 0; - break; + var message = new $root.proto.AppStateSyncKeyShare(); + if (object.keys) { + if (!Array.isArray(object.keys)) + throw TypeError(".proto.AppStateSyncKeyShare.keys: array expected"); + message.keys = []; + for (var i = 0; i < object.keys.length; ++i) { + if (typeof object.keys[i] !== "object") + throw TypeError(".proto.AppStateSyncKeyShare.keys: object expected"); + message.keys[i] = $root.proto.AppStateSyncKey.fromObject(object.keys[i]); + } } return message; }; /** - * Creates a plain object from a BizAccountLinkInfo message. Also converts values to other types if specified. + * Creates a plain object from an AppStateSyncKeyShare message. Also converts values to other types if specified. * @function toObject - * @memberof proto.BizAccountLinkInfo + * @memberof proto.AppStateSyncKeyShare * @static - * @param {proto.BizAccountLinkInfo} message BizAccountLinkInfo + * @param {proto.AppStateSyncKeyShare} message AppStateSyncKeyShare * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - BizAccountLinkInfo.toObject = function toObject(message, options) { + AppStateSyncKeyShare.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.whatsappBizAcctFbid = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.whatsappBizAcctFbid = options.longs === String ? "0" : 0; - object.whatsappAcctNumber = ""; - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.issueTime = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.issueTime = options.longs === String ? "0" : 0; - object.hostStorage = options.enums === String ? "ON_PREMISE" : 0; - object.accountType = options.enums === String ? "ENTERPRISE" : 0; + if (options.arrays || options.defaults) + object.keys = []; + if (message.keys && message.keys.length) { + object.keys = []; + for (var j = 0; j < message.keys.length; ++j) + object.keys[j] = $root.proto.AppStateSyncKey.toObject(message.keys[j], options); } - if (message.whatsappBizAcctFbid != null && message.hasOwnProperty("whatsappBizAcctFbid")) - if (typeof message.whatsappBizAcctFbid === "number") - object.whatsappBizAcctFbid = options.longs === String ? String(message.whatsappBizAcctFbid) : message.whatsappBizAcctFbid; - else - object.whatsappBizAcctFbid = options.longs === String ? $util.Long.prototype.toString.call(message.whatsappBizAcctFbid) : options.longs === Number ? new $util.LongBits(message.whatsappBizAcctFbid.low >>> 0, message.whatsappBizAcctFbid.high >>> 0).toNumber(true) : message.whatsappBizAcctFbid; - if (message.whatsappAcctNumber != null && message.hasOwnProperty("whatsappAcctNumber")) - object.whatsappAcctNumber = message.whatsappAcctNumber; - if (message.issueTime != null && message.hasOwnProperty("issueTime")) - if (typeof message.issueTime === "number") - object.issueTime = options.longs === String ? String(message.issueTime) : message.issueTime; - else - object.issueTime = options.longs === String ? $util.Long.prototype.toString.call(message.issueTime) : options.longs === Number ? new $util.LongBits(message.issueTime.low >>> 0, message.issueTime.high >>> 0).toNumber(true) : message.issueTime; - if (message.hostStorage != null && message.hasOwnProperty("hostStorage")) - object.hostStorage = options.enums === String ? $root.proto.BizAccountLinkInfo.BizAccountLinkInfoHostStorageType[message.hostStorage] : message.hostStorage; - if (message.accountType != null && message.hasOwnProperty("accountType")) - object.accountType = options.enums === String ? $root.proto.BizAccountLinkInfo.BizAccountLinkInfoAccountType[message.accountType] : message.accountType; return object; }; /** - * Converts this BizAccountLinkInfo to JSON. + * Converts this AppStateSyncKeyShare to JSON. * @function toJSON - * @memberof proto.BizAccountLinkInfo + * @memberof proto.AppStateSyncKeyShare * @instance * @returns {Object.} JSON object */ - BizAccountLinkInfo.prototype.toJSON = function toJSON() { + AppStateSyncKeyShare.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - /** - * BizAccountLinkInfoHostStorageType enum. - * @name proto.BizAccountLinkInfo.BizAccountLinkInfoHostStorageType - * @enum {number} - * @property {number} ON_PREMISE=0 ON_PREMISE value - * @property {number} FACEBOOK=1 FACEBOOK value - */ - BizAccountLinkInfo.BizAccountLinkInfoHostStorageType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "ON_PREMISE"] = 0; - values[valuesById[1] = "FACEBOOK"] = 1; - return values; - })(); - - /** - * BizAccountLinkInfoAccountType enum. - * @name proto.BizAccountLinkInfo.BizAccountLinkInfoAccountType - * @enum {number} - * @property {number} ENTERPRISE=0 ENTERPRISE value - */ - BizAccountLinkInfo.BizAccountLinkInfoAccountType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "ENTERPRISE"] = 0; - return values; - })(); - - return BizAccountLinkInfo; + return AppStateSyncKeyShare; })(); - proto.BizAccountPayload = (function() { + proto.AudioMessage = (function() { /** - * Properties of a BizAccountPayload. + * Properties of an AudioMessage. * @memberof proto - * @interface IBizAccountPayload - * @property {proto.IVerifiedNameCertificate|null} [vnameCert] BizAccountPayload vnameCert - * @property {Uint8Array|null} [bizAcctLinkInfo] BizAccountPayload bizAcctLinkInfo + * @interface IAudioMessage + * @property {string|null} [url] AudioMessage url + * @property {string|null} [mimetype] AudioMessage mimetype + * @property {Uint8Array|null} [fileSha256] AudioMessage fileSha256 + * @property {number|Long|null} [fileLength] AudioMessage fileLength + * @property {number|null} [seconds] AudioMessage seconds + * @property {boolean|null} [ptt] AudioMessage ptt + * @property {Uint8Array|null} [mediaKey] AudioMessage mediaKey + * @property {Uint8Array|null} [fileEncSha256] AudioMessage fileEncSha256 + * @property {string|null} [directPath] AudioMessage directPath + * @property {number|Long|null} [mediaKeyTimestamp] AudioMessage mediaKeyTimestamp + * @property {proto.IContextInfo|null} [contextInfo] AudioMessage contextInfo + * @property {Uint8Array|null} [streamingSidecar] AudioMessage streamingSidecar + * @property {Uint8Array|null} [waveform] AudioMessage waveform */ /** - * Constructs a new BizAccountPayload. + * Constructs a new AudioMessage. * @memberof proto - * @classdesc Represents a BizAccountPayload. - * @implements IBizAccountPayload + * @classdesc Represents an AudioMessage. + * @implements IAudioMessage * @constructor - * @param {proto.IBizAccountPayload=} [properties] Properties to set + * @param {proto.IAudioMessage=} [properties] Properties to set */ - function BizAccountPayload(properties) { + function AudioMessage(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -5745,88 +4075,231 @@ $root.proto = (function() { } /** - * BizAccountPayload vnameCert. - * @member {proto.IVerifiedNameCertificate|null|undefined} vnameCert - * @memberof proto.BizAccountPayload + * AudioMessage url. + * @member {string} url + * @memberof proto.AudioMessage * @instance */ - BizAccountPayload.prototype.vnameCert = null; + AudioMessage.prototype.url = ""; /** - * BizAccountPayload bizAcctLinkInfo. - * @member {Uint8Array} bizAcctLinkInfo - * @memberof proto.BizAccountPayload + * AudioMessage mimetype. + * @member {string} mimetype + * @memberof proto.AudioMessage * @instance */ - BizAccountPayload.prototype.bizAcctLinkInfo = $util.newBuffer([]); + AudioMessage.prototype.mimetype = ""; /** - * Creates a new BizAccountPayload instance using the specified properties. + * AudioMessage fileSha256. + * @member {Uint8Array} fileSha256 + * @memberof proto.AudioMessage + * @instance + */ + AudioMessage.prototype.fileSha256 = $util.newBuffer([]); + + /** + * AudioMessage fileLength. + * @member {number|Long} fileLength + * @memberof proto.AudioMessage + * @instance + */ + AudioMessage.prototype.fileLength = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * AudioMessage seconds. + * @member {number} seconds + * @memberof proto.AudioMessage + * @instance + */ + AudioMessage.prototype.seconds = 0; + + /** + * AudioMessage ptt. + * @member {boolean} ptt + * @memberof proto.AudioMessage + * @instance + */ + AudioMessage.prototype.ptt = false; + + /** + * AudioMessage mediaKey. + * @member {Uint8Array} mediaKey + * @memberof proto.AudioMessage + * @instance + */ + AudioMessage.prototype.mediaKey = $util.newBuffer([]); + + /** + * AudioMessage fileEncSha256. + * @member {Uint8Array} fileEncSha256 + * @memberof proto.AudioMessage + * @instance + */ + AudioMessage.prototype.fileEncSha256 = $util.newBuffer([]); + + /** + * AudioMessage directPath. + * @member {string} directPath + * @memberof proto.AudioMessage + * @instance + */ + AudioMessage.prototype.directPath = ""; + + /** + * AudioMessage mediaKeyTimestamp. + * @member {number|Long} mediaKeyTimestamp + * @memberof proto.AudioMessage + * @instance + */ + AudioMessage.prototype.mediaKeyTimestamp = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * AudioMessage contextInfo. + * @member {proto.IContextInfo|null|undefined} contextInfo + * @memberof proto.AudioMessage + * @instance + */ + AudioMessage.prototype.contextInfo = null; + + /** + * AudioMessage streamingSidecar. + * @member {Uint8Array} streamingSidecar + * @memberof proto.AudioMessage + * @instance + */ + AudioMessage.prototype.streamingSidecar = $util.newBuffer([]); + + /** + * AudioMessage waveform. + * @member {Uint8Array} waveform + * @memberof proto.AudioMessage + * @instance + */ + AudioMessage.prototype.waveform = $util.newBuffer([]); + + /** + * Creates a new AudioMessage instance using the specified properties. * @function create - * @memberof proto.BizAccountPayload + * @memberof proto.AudioMessage * @static - * @param {proto.IBizAccountPayload=} [properties] Properties to set - * @returns {proto.BizAccountPayload} BizAccountPayload instance + * @param {proto.IAudioMessage=} [properties] Properties to set + * @returns {proto.AudioMessage} AudioMessage instance */ - BizAccountPayload.create = function create(properties) { - return new BizAccountPayload(properties); + AudioMessage.create = function create(properties) { + return new AudioMessage(properties); }; /** - * Encodes the specified BizAccountPayload message. Does not implicitly {@link proto.BizAccountPayload.verify|verify} messages. + * Encodes the specified AudioMessage message. Does not implicitly {@link proto.AudioMessage.verify|verify} messages. * @function encode - * @memberof proto.BizAccountPayload + * @memberof proto.AudioMessage * @static - * @param {proto.IBizAccountPayload} message BizAccountPayload message or plain object to encode + * @param {proto.IAudioMessage} message AudioMessage message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BizAccountPayload.encode = function encode(message, writer) { + AudioMessage.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.vnameCert != null && Object.hasOwnProperty.call(message, "vnameCert")) - $root.proto.VerifiedNameCertificate.encode(message.vnameCert, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.bizAcctLinkInfo != null && Object.hasOwnProperty.call(message, "bizAcctLinkInfo")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.bizAcctLinkInfo); + if (message.url != null && Object.hasOwnProperty.call(message, "url")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.url); + if (message.mimetype != null && Object.hasOwnProperty.call(message, "mimetype")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.mimetype); + if (message.fileSha256 != null && Object.hasOwnProperty.call(message, "fileSha256")) + writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.fileSha256); + if (message.fileLength != null && Object.hasOwnProperty.call(message, "fileLength")) + writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.fileLength); + if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) + writer.uint32(/* id 5, wireType 0 =*/40).uint32(message.seconds); + if (message.ptt != null && Object.hasOwnProperty.call(message, "ptt")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.ptt); + if (message.mediaKey != null && Object.hasOwnProperty.call(message, "mediaKey")) + writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.mediaKey); + if (message.fileEncSha256 != null && Object.hasOwnProperty.call(message, "fileEncSha256")) + writer.uint32(/* id 8, wireType 2 =*/66).bytes(message.fileEncSha256); + if (message.directPath != null && Object.hasOwnProperty.call(message, "directPath")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.directPath); + if (message.mediaKeyTimestamp != null && Object.hasOwnProperty.call(message, "mediaKeyTimestamp")) + writer.uint32(/* id 10, wireType 0 =*/80).int64(message.mediaKeyTimestamp); + if (message.contextInfo != null && Object.hasOwnProperty.call(message, "contextInfo")) + $root.proto.ContextInfo.encode(message.contextInfo, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); + if (message.streamingSidecar != null && Object.hasOwnProperty.call(message, "streamingSidecar")) + writer.uint32(/* id 18, wireType 2 =*/146).bytes(message.streamingSidecar); + if (message.waveform != null && Object.hasOwnProperty.call(message, "waveform")) + writer.uint32(/* id 19, wireType 2 =*/154).bytes(message.waveform); return writer; }; /** - * Encodes the specified BizAccountPayload message, length delimited. Does not implicitly {@link proto.BizAccountPayload.verify|verify} messages. + * Encodes the specified AudioMessage message, length delimited. Does not implicitly {@link proto.AudioMessage.verify|verify} messages. * @function encodeDelimited - * @memberof proto.BizAccountPayload + * @memberof proto.AudioMessage * @static - * @param {proto.IBizAccountPayload} message BizAccountPayload message or plain object to encode + * @param {proto.IAudioMessage} message AudioMessage message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BizAccountPayload.encodeDelimited = function encodeDelimited(message, writer) { + AudioMessage.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a BizAccountPayload message from the specified reader or buffer. + * Decodes an AudioMessage message from the specified reader or buffer. * @function decode - * @memberof proto.BizAccountPayload + * @memberof proto.AudioMessage * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {proto.BizAccountPayload} BizAccountPayload + * @returns {proto.AudioMessage} AudioMessage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - BizAccountPayload.decode = function decode(reader, length) { + AudioMessage.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.BizAccountPayload(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.AudioMessage(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.vnameCert = $root.proto.VerifiedNameCertificate.decode(reader, reader.uint32()); + message.url = reader.string(); break; case 2: - message.bizAcctLinkInfo = reader.bytes(); + message.mimetype = reader.string(); + break; + case 3: + message.fileSha256 = reader.bytes(); + break; + case 4: + message.fileLength = reader.uint64(); + break; + case 5: + message.seconds = reader.uint32(); + break; + case 6: + message.ptt = reader.bool(); + break; + case 7: + message.mediaKey = reader.bytes(); + break; + case 8: + message.fileEncSha256 = reader.bytes(); + break; + case 9: + message.directPath = reader.string(); + break; + case 10: + message.mediaKeyTimestamp = reader.int64(); + break; + case 17: + message.contextInfo = $root.proto.ContextInfo.decode(reader, reader.uint32()); + break; + case 18: + message.streamingSidecar = reader.bytes(); + break; + case 19: + message.waveform = reader.bytes(); break; default: reader.skipType(tag & 7); @@ -5837,135 +4310,285 @@ $root.proto = (function() { }; /** - * Decodes a BizAccountPayload message from the specified reader or buffer, length delimited. + * Decodes an AudioMessage message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof proto.BizAccountPayload + * @memberof proto.AudioMessage * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.BizAccountPayload} BizAccountPayload + * @returns {proto.AudioMessage} AudioMessage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - BizAccountPayload.decodeDelimited = function decodeDelimited(reader) { + AudioMessage.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a BizAccountPayload message. + * Verifies an AudioMessage message. * @function verify - * @memberof proto.BizAccountPayload + * @memberof proto.AudioMessage * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - BizAccountPayload.verify = function verify(message) { + AudioMessage.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.vnameCert != null && message.hasOwnProperty("vnameCert")) { - var error = $root.proto.VerifiedNameCertificate.verify(message.vnameCert); + if (message.url != null && message.hasOwnProperty("url")) + if (!$util.isString(message.url)) + return "url: string expected"; + if (message.mimetype != null && message.hasOwnProperty("mimetype")) + if (!$util.isString(message.mimetype)) + return "mimetype: string expected"; + if (message.fileSha256 != null && message.hasOwnProperty("fileSha256")) + if (!(message.fileSha256 && typeof message.fileSha256.length === "number" || $util.isString(message.fileSha256))) + return "fileSha256: buffer expected"; + if (message.fileLength != null && message.hasOwnProperty("fileLength")) + if (!$util.isInteger(message.fileLength) && !(message.fileLength && $util.isInteger(message.fileLength.low) && $util.isInteger(message.fileLength.high))) + return "fileLength: integer|Long expected"; + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (!$util.isInteger(message.seconds)) + return "seconds: integer expected"; + if (message.ptt != null && message.hasOwnProperty("ptt")) + if (typeof message.ptt !== "boolean") + return "ptt: boolean expected"; + if (message.mediaKey != null && message.hasOwnProperty("mediaKey")) + if (!(message.mediaKey && typeof message.mediaKey.length === "number" || $util.isString(message.mediaKey))) + return "mediaKey: buffer expected"; + if (message.fileEncSha256 != null && message.hasOwnProperty("fileEncSha256")) + if (!(message.fileEncSha256 && typeof message.fileEncSha256.length === "number" || $util.isString(message.fileEncSha256))) + return "fileEncSha256: buffer expected"; + if (message.directPath != null && message.hasOwnProperty("directPath")) + if (!$util.isString(message.directPath)) + return "directPath: string expected"; + if (message.mediaKeyTimestamp != null && message.hasOwnProperty("mediaKeyTimestamp")) + if (!$util.isInteger(message.mediaKeyTimestamp) && !(message.mediaKeyTimestamp && $util.isInteger(message.mediaKeyTimestamp.low) && $util.isInteger(message.mediaKeyTimestamp.high))) + return "mediaKeyTimestamp: integer|Long expected"; + if (message.contextInfo != null && message.hasOwnProperty("contextInfo")) { + var error = $root.proto.ContextInfo.verify(message.contextInfo); if (error) - return "vnameCert." + error; + return "contextInfo." + error; } - if (message.bizAcctLinkInfo != null && message.hasOwnProperty("bizAcctLinkInfo")) - if (!(message.bizAcctLinkInfo && typeof message.bizAcctLinkInfo.length === "number" || $util.isString(message.bizAcctLinkInfo))) - return "bizAcctLinkInfo: buffer expected"; + if (message.streamingSidecar != null && message.hasOwnProperty("streamingSidecar")) + if (!(message.streamingSidecar && typeof message.streamingSidecar.length === "number" || $util.isString(message.streamingSidecar))) + return "streamingSidecar: buffer expected"; + if (message.waveform != null && message.hasOwnProperty("waveform")) + if (!(message.waveform && typeof message.waveform.length === "number" || $util.isString(message.waveform))) + return "waveform: buffer expected"; return null; }; /** - * Creates a BizAccountPayload message from a plain object. Also converts values to their respective internal types. + * Creates an AudioMessage message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof proto.BizAccountPayload + * @memberof proto.AudioMessage * @static * @param {Object.} object Plain object - * @returns {proto.BizAccountPayload} BizAccountPayload + * @returns {proto.AudioMessage} AudioMessage */ - BizAccountPayload.fromObject = function fromObject(object) { - if (object instanceof $root.proto.BizAccountPayload) + AudioMessage.fromObject = function fromObject(object) { + if (object instanceof $root.proto.AudioMessage) return object; - var message = new $root.proto.BizAccountPayload(); - if (object.vnameCert != null) { - if (typeof object.vnameCert !== "object") - throw TypeError(".proto.BizAccountPayload.vnameCert: object expected"); - message.vnameCert = $root.proto.VerifiedNameCertificate.fromObject(object.vnameCert); + var message = new $root.proto.AudioMessage(); + if (object.url != null) + message.url = String(object.url); + if (object.mimetype != null) + message.mimetype = String(object.mimetype); + if (object.fileSha256 != null) + if (typeof object.fileSha256 === "string") + $util.base64.decode(object.fileSha256, message.fileSha256 = $util.newBuffer($util.base64.length(object.fileSha256)), 0); + else if (object.fileSha256.length) + message.fileSha256 = object.fileSha256; + if (object.fileLength != null) + if ($util.Long) + (message.fileLength = $util.Long.fromValue(object.fileLength)).unsigned = true; + else if (typeof object.fileLength === "string") + message.fileLength = parseInt(object.fileLength, 10); + else if (typeof object.fileLength === "number") + message.fileLength = object.fileLength; + else if (typeof object.fileLength === "object") + message.fileLength = new $util.LongBits(object.fileLength.low >>> 0, object.fileLength.high >>> 0).toNumber(true); + if (object.seconds != null) + message.seconds = object.seconds >>> 0; + if (object.ptt != null) + message.ptt = Boolean(object.ptt); + if (object.mediaKey != null) + if (typeof object.mediaKey === "string") + $util.base64.decode(object.mediaKey, message.mediaKey = $util.newBuffer($util.base64.length(object.mediaKey)), 0); + else if (object.mediaKey.length) + message.mediaKey = object.mediaKey; + if (object.fileEncSha256 != null) + if (typeof object.fileEncSha256 === "string") + $util.base64.decode(object.fileEncSha256, message.fileEncSha256 = $util.newBuffer($util.base64.length(object.fileEncSha256)), 0); + else if (object.fileEncSha256.length) + message.fileEncSha256 = object.fileEncSha256; + if (object.directPath != null) + message.directPath = String(object.directPath); + if (object.mediaKeyTimestamp != null) + if ($util.Long) + (message.mediaKeyTimestamp = $util.Long.fromValue(object.mediaKeyTimestamp)).unsigned = false; + else if (typeof object.mediaKeyTimestamp === "string") + message.mediaKeyTimestamp = parseInt(object.mediaKeyTimestamp, 10); + else if (typeof object.mediaKeyTimestamp === "number") + message.mediaKeyTimestamp = object.mediaKeyTimestamp; + else if (typeof object.mediaKeyTimestamp === "object") + message.mediaKeyTimestamp = new $util.LongBits(object.mediaKeyTimestamp.low >>> 0, object.mediaKeyTimestamp.high >>> 0).toNumber(); + if (object.contextInfo != null) { + if (typeof object.contextInfo !== "object") + throw TypeError(".proto.AudioMessage.contextInfo: object expected"); + message.contextInfo = $root.proto.ContextInfo.fromObject(object.contextInfo); } - if (object.bizAcctLinkInfo != null) - if (typeof object.bizAcctLinkInfo === "string") - $util.base64.decode(object.bizAcctLinkInfo, message.bizAcctLinkInfo = $util.newBuffer($util.base64.length(object.bizAcctLinkInfo)), 0); - else if (object.bizAcctLinkInfo.length) - message.bizAcctLinkInfo = object.bizAcctLinkInfo; + if (object.streamingSidecar != null) + if (typeof object.streamingSidecar === "string") + $util.base64.decode(object.streamingSidecar, message.streamingSidecar = $util.newBuffer($util.base64.length(object.streamingSidecar)), 0); + else if (object.streamingSidecar.length) + message.streamingSidecar = object.streamingSidecar; + if (object.waveform != null) + if (typeof object.waveform === "string") + $util.base64.decode(object.waveform, message.waveform = $util.newBuffer($util.base64.length(object.waveform)), 0); + else if (object.waveform.length) + message.waveform = object.waveform; return message; }; /** - * Creates a plain object from a BizAccountPayload message. Also converts values to other types if specified. + * Creates a plain object from an AudioMessage message. Also converts values to other types if specified. * @function toObject - * @memberof proto.BizAccountPayload + * @memberof proto.AudioMessage * @static - * @param {proto.BizAccountPayload} message BizAccountPayload + * @param {proto.AudioMessage} message AudioMessage * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - BizAccountPayload.toObject = function toObject(message, options) { + AudioMessage.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.vnameCert = null; + object.url = ""; + object.mimetype = ""; if (options.bytes === String) - object.bizAcctLinkInfo = ""; + object.fileSha256 = ""; else { - object.bizAcctLinkInfo = []; + object.fileSha256 = []; if (options.bytes !== Array) - object.bizAcctLinkInfo = $util.newBuffer(object.bizAcctLinkInfo); + object.fileSha256 = $util.newBuffer(object.fileSha256); + } + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.fileLength = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.fileLength = options.longs === String ? "0" : 0; + object.seconds = 0; + object.ptt = false; + if (options.bytes === String) + object.mediaKey = ""; + else { + object.mediaKey = []; + if (options.bytes !== Array) + object.mediaKey = $util.newBuffer(object.mediaKey); + } + if (options.bytes === String) + object.fileEncSha256 = ""; + else { + object.fileEncSha256 = []; + if (options.bytes !== Array) + object.fileEncSha256 = $util.newBuffer(object.fileEncSha256); + } + object.directPath = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.mediaKeyTimestamp = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.mediaKeyTimestamp = options.longs === String ? "0" : 0; + object.contextInfo = null; + if (options.bytes === String) + object.streamingSidecar = ""; + else { + object.streamingSidecar = []; + if (options.bytes !== Array) + object.streamingSidecar = $util.newBuffer(object.streamingSidecar); + } + if (options.bytes === String) + object.waveform = ""; + else { + object.waveform = []; + if (options.bytes !== Array) + object.waveform = $util.newBuffer(object.waveform); } } - if (message.vnameCert != null && message.hasOwnProperty("vnameCert")) - object.vnameCert = $root.proto.VerifiedNameCertificate.toObject(message.vnameCert, options); - if (message.bizAcctLinkInfo != null && message.hasOwnProperty("bizAcctLinkInfo")) - object.bizAcctLinkInfo = options.bytes === String ? $util.base64.encode(message.bizAcctLinkInfo, 0, message.bizAcctLinkInfo.length) : options.bytes === Array ? Array.prototype.slice.call(message.bizAcctLinkInfo) : message.bizAcctLinkInfo; + if (message.url != null && message.hasOwnProperty("url")) + object.url = message.url; + if (message.mimetype != null && message.hasOwnProperty("mimetype")) + object.mimetype = message.mimetype; + if (message.fileSha256 != null && message.hasOwnProperty("fileSha256")) + object.fileSha256 = options.bytes === String ? $util.base64.encode(message.fileSha256, 0, message.fileSha256.length) : options.bytes === Array ? Array.prototype.slice.call(message.fileSha256) : message.fileSha256; + if (message.fileLength != null && message.hasOwnProperty("fileLength")) + if (typeof message.fileLength === "number") + object.fileLength = options.longs === String ? String(message.fileLength) : message.fileLength; + else + object.fileLength = options.longs === String ? $util.Long.prototype.toString.call(message.fileLength) : options.longs === Number ? new $util.LongBits(message.fileLength.low >>> 0, message.fileLength.high >>> 0).toNumber(true) : message.fileLength; + if (message.seconds != null && message.hasOwnProperty("seconds")) + object.seconds = message.seconds; + if (message.ptt != null && message.hasOwnProperty("ptt")) + object.ptt = message.ptt; + if (message.mediaKey != null && message.hasOwnProperty("mediaKey")) + object.mediaKey = options.bytes === String ? $util.base64.encode(message.mediaKey, 0, message.mediaKey.length) : options.bytes === Array ? Array.prototype.slice.call(message.mediaKey) : message.mediaKey; + if (message.fileEncSha256 != null && message.hasOwnProperty("fileEncSha256")) + object.fileEncSha256 = options.bytes === String ? $util.base64.encode(message.fileEncSha256, 0, message.fileEncSha256.length) : options.bytes === Array ? Array.prototype.slice.call(message.fileEncSha256) : message.fileEncSha256; + if (message.directPath != null && message.hasOwnProperty("directPath")) + object.directPath = message.directPath; + if (message.mediaKeyTimestamp != null && message.hasOwnProperty("mediaKeyTimestamp")) + if (typeof message.mediaKeyTimestamp === "number") + object.mediaKeyTimestamp = options.longs === String ? String(message.mediaKeyTimestamp) : message.mediaKeyTimestamp; + else + object.mediaKeyTimestamp = options.longs === String ? $util.Long.prototype.toString.call(message.mediaKeyTimestamp) : options.longs === Number ? new $util.LongBits(message.mediaKeyTimestamp.low >>> 0, message.mediaKeyTimestamp.high >>> 0).toNumber() : message.mediaKeyTimestamp; + if (message.contextInfo != null && message.hasOwnProperty("contextInfo")) + object.contextInfo = $root.proto.ContextInfo.toObject(message.contextInfo, options); + if (message.streamingSidecar != null && message.hasOwnProperty("streamingSidecar")) + object.streamingSidecar = options.bytes === String ? $util.base64.encode(message.streamingSidecar, 0, message.streamingSidecar.length) : options.bytes === Array ? Array.prototype.slice.call(message.streamingSidecar) : message.streamingSidecar; + if (message.waveform != null && message.hasOwnProperty("waveform")) + object.waveform = options.bytes === String ? $util.base64.encode(message.waveform, 0, message.waveform.length) : options.bytes === Array ? Array.prototype.slice.call(message.waveform) : message.waveform; return object; }; /** - * Converts this BizAccountPayload to JSON. + * Converts this AudioMessage to JSON. * @function toJSON - * @memberof proto.BizAccountPayload + * @memberof proto.AudioMessage * @instance * @returns {Object.} JSON object */ - BizAccountPayload.prototype.toJSON = function toJSON() { + AudioMessage.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return BizAccountPayload; + return AudioMessage; })(); - proto.VerifiedNameDetails = (function() { + proto.Button = (function() { /** - * Properties of a VerifiedNameDetails. + * Properties of a Button. * @memberof proto - * @interface IVerifiedNameDetails - * @property {number|Long|null} [serial] VerifiedNameDetails serial - * @property {string|null} [issuer] VerifiedNameDetails issuer - * @property {string|null} [verifiedName] VerifiedNameDetails verifiedName - * @property {Array.|null} [localizedNames] VerifiedNameDetails localizedNames - * @property {number|Long|null} [issueTime] VerifiedNameDetails issueTime + * @interface IButton + * @property {string|null} [buttonId] Button buttonId + * @property {proto.IButtonText|null} [buttonText] Button buttonText + * @property {proto.Button.ButtonType|null} [type] Button type + * @property {proto.INativeFlowInfo|null} [nativeFlowInfo] Button nativeFlowInfo */ /** - * Constructs a new VerifiedNameDetails. + * Constructs a new Button. * @memberof proto - * @classdesc Represents a VerifiedNameDetails. - * @implements IVerifiedNameDetails + * @classdesc Represents a Button. + * @implements IButton * @constructor - * @param {proto.IVerifiedNameDetails=} [properties] Properties to set + * @param {proto.IButton=} [properties] Properties to set */ - function VerifiedNameDetails(properties) { - this.localizedNames = []; + function Button(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -5973,130 +4596,114 @@ $root.proto = (function() { } /** - * VerifiedNameDetails serial. - * @member {number|Long} serial - * @memberof proto.VerifiedNameDetails + * Button buttonId. + * @member {string} buttonId + * @memberof proto.Button * @instance */ - VerifiedNameDetails.prototype.serial = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + Button.prototype.buttonId = ""; /** - * VerifiedNameDetails issuer. - * @member {string} issuer - * @memberof proto.VerifiedNameDetails + * Button buttonText. + * @member {proto.IButtonText|null|undefined} buttonText + * @memberof proto.Button * @instance */ - VerifiedNameDetails.prototype.issuer = ""; + Button.prototype.buttonText = null; /** - * VerifiedNameDetails verifiedName. - * @member {string} verifiedName - * @memberof proto.VerifiedNameDetails + * Button type. + * @member {proto.Button.ButtonType} type + * @memberof proto.Button * @instance */ - VerifiedNameDetails.prototype.verifiedName = ""; + Button.prototype.type = 0; /** - * VerifiedNameDetails localizedNames. - * @member {Array.} localizedNames - * @memberof proto.VerifiedNameDetails + * Button nativeFlowInfo. + * @member {proto.INativeFlowInfo|null|undefined} nativeFlowInfo + * @memberof proto.Button * @instance */ - VerifiedNameDetails.prototype.localizedNames = $util.emptyArray; - - /** - * VerifiedNameDetails issueTime. - * @member {number|Long} issueTime - * @memberof proto.VerifiedNameDetails - * @instance - */ - VerifiedNameDetails.prototype.issueTime = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + Button.prototype.nativeFlowInfo = null; /** - * Creates a new VerifiedNameDetails instance using the specified properties. + * Creates a new Button instance using the specified properties. * @function create - * @memberof proto.VerifiedNameDetails + * @memberof proto.Button * @static - * @param {proto.IVerifiedNameDetails=} [properties] Properties to set - * @returns {proto.VerifiedNameDetails} VerifiedNameDetails instance + * @param {proto.IButton=} [properties] Properties to set + * @returns {proto.Button} Button instance */ - VerifiedNameDetails.create = function create(properties) { - return new VerifiedNameDetails(properties); + Button.create = function create(properties) { + return new Button(properties); }; /** - * Encodes the specified VerifiedNameDetails message. Does not implicitly {@link proto.VerifiedNameDetails.verify|verify} messages. + * Encodes the specified Button message. Does not implicitly {@link proto.Button.verify|verify} messages. * @function encode - * @memberof proto.VerifiedNameDetails + * @memberof proto.Button * @static - * @param {proto.IVerifiedNameDetails} message VerifiedNameDetails message or plain object to encode + * @param {proto.IButton} message Button message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - VerifiedNameDetails.encode = function encode(message, writer) { + Button.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.serial != null && Object.hasOwnProperty.call(message, "serial")) - writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.serial); - if (message.issuer != null && Object.hasOwnProperty.call(message, "issuer")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.issuer); - if (message.verifiedName != null && Object.hasOwnProperty.call(message, "verifiedName")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.verifiedName); - if (message.localizedNames != null && message.localizedNames.length) - for (var i = 0; i < message.localizedNames.length; ++i) - $root.proto.LocalizedName.encode(message.localizedNames[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.issueTime != null && Object.hasOwnProperty.call(message, "issueTime")) - writer.uint32(/* id 10, wireType 0 =*/80).uint64(message.issueTime); + if (message.buttonId != null && Object.hasOwnProperty.call(message, "buttonId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.buttonId); + if (message.buttonText != null && Object.hasOwnProperty.call(message, "buttonText")) + $root.proto.ButtonText.encode(message.buttonText, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.type); + if (message.nativeFlowInfo != null && Object.hasOwnProperty.call(message, "nativeFlowInfo")) + $root.proto.NativeFlowInfo.encode(message.nativeFlowInfo, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); return writer; }; /** - * Encodes the specified VerifiedNameDetails message, length delimited. Does not implicitly {@link proto.VerifiedNameDetails.verify|verify} messages. + * Encodes the specified Button message, length delimited. Does not implicitly {@link proto.Button.verify|verify} messages. * @function encodeDelimited - * @memberof proto.VerifiedNameDetails + * @memberof proto.Button * @static - * @param {proto.IVerifiedNameDetails} message VerifiedNameDetails message or plain object to encode + * @param {proto.IButton} message Button message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - VerifiedNameDetails.encodeDelimited = function encodeDelimited(message, writer) { + Button.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a VerifiedNameDetails message from the specified reader or buffer. + * Decodes a Button message from the specified reader or buffer. * @function decode - * @memberof proto.VerifiedNameDetails + * @memberof proto.Button * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {proto.VerifiedNameDetails} VerifiedNameDetails + * @returns {proto.Button} Button * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - VerifiedNameDetails.decode = function decode(reader, length) { + Button.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.VerifiedNameDetails(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.Button(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.serial = reader.uint64(); + message.buttonId = reader.string(); break; case 2: - message.issuer = reader.string(); - break; - case 4: - message.verifiedName = reader.string(); + message.buttonText = $root.proto.ButtonText.decode(reader, reader.uint32()); break; - case 8: - if (!(message.localizedNames && message.localizedNames.length)) - message.localizedNames = []; - message.localizedNames.push($root.proto.LocalizedName.decode(reader, reader.uint32())); + case 3: + message.type = reader.int32(); break; - case 10: - message.issueTime = reader.uint64(); + case 4: + message.nativeFlowInfo = $root.proto.NativeFlowInfo.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -6107,188 +4714,186 @@ $root.proto = (function() { }; /** - * Decodes a VerifiedNameDetails message from the specified reader or buffer, length delimited. + * Decodes a Button message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof proto.VerifiedNameDetails + * @memberof proto.Button * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.VerifiedNameDetails} VerifiedNameDetails + * @returns {proto.Button} Button * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - VerifiedNameDetails.decodeDelimited = function decodeDelimited(reader) { + Button.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a VerifiedNameDetails message. + * Verifies a Button message. * @function verify - * @memberof proto.VerifiedNameDetails + * @memberof proto.Button * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - VerifiedNameDetails.verify = function verify(message) { + Button.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.serial != null && message.hasOwnProperty("serial")) - if (!$util.isInteger(message.serial) && !(message.serial && $util.isInteger(message.serial.low) && $util.isInteger(message.serial.high))) - return "serial: integer|Long expected"; - if (message.issuer != null && message.hasOwnProperty("issuer")) - if (!$util.isString(message.issuer)) - return "issuer: string expected"; - if (message.verifiedName != null && message.hasOwnProperty("verifiedName")) - if (!$util.isString(message.verifiedName)) - return "verifiedName: string expected"; - if (message.localizedNames != null && message.hasOwnProperty("localizedNames")) { - if (!Array.isArray(message.localizedNames)) - return "localizedNames: array expected"; - for (var i = 0; i < message.localizedNames.length; ++i) { - var error = $root.proto.LocalizedName.verify(message.localizedNames[i]); - if (error) - return "localizedNames." + error; + if (message.buttonId != null && message.hasOwnProperty("buttonId")) + if (!$util.isString(message.buttonId)) + return "buttonId: string expected"; + if (message.buttonText != null && message.hasOwnProperty("buttonText")) { + var error = $root.proto.ButtonText.verify(message.buttonText); + if (error) + return "buttonText." + error; + } + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + break; } + if (message.nativeFlowInfo != null && message.hasOwnProperty("nativeFlowInfo")) { + var error = $root.proto.NativeFlowInfo.verify(message.nativeFlowInfo); + if (error) + return "nativeFlowInfo." + error; } - if (message.issueTime != null && message.hasOwnProperty("issueTime")) - if (!$util.isInteger(message.issueTime) && !(message.issueTime && $util.isInteger(message.issueTime.low) && $util.isInteger(message.issueTime.high))) - return "issueTime: integer|Long expected"; return null; }; /** - * Creates a VerifiedNameDetails message from a plain object. Also converts values to their respective internal types. + * Creates a Button message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof proto.VerifiedNameDetails + * @memberof proto.Button * @static * @param {Object.} object Plain object - * @returns {proto.VerifiedNameDetails} VerifiedNameDetails + * @returns {proto.Button} Button */ - VerifiedNameDetails.fromObject = function fromObject(object) { - if (object instanceof $root.proto.VerifiedNameDetails) + Button.fromObject = function fromObject(object) { + if (object instanceof $root.proto.Button) return object; - var message = new $root.proto.VerifiedNameDetails(); - if (object.serial != null) - if ($util.Long) - (message.serial = $util.Long.fromValue(object.serial)).unsigned = true; - else if (typeof object.serial === "string") - message.serial = parseInt(object.serial, 10); - else if (typeof object.serial === "number") - message.serial = object.serial; - else if (typeof object.serial === "object") - message.serial = new $util.LongBits(object.serial.low >>> 0, object.serial.high >>> 0).toNumber(true); - if (object.issuer != null) - message.issuer = String(object.issuer); - if (object.verifiedName != null) - message.verifiedName = String(object.verifiedName); - if (object.localizedNames) { - if (!Array.isArray(object.localizedNames)) - throw TypeError(".proto.VerifiedNameDetails.localizedNames: array expected"); - message.localizedNames = []; - for (var i = 0; i < object.localizedNames.length; ++i) { - if (typeof object.localizedNames[i] !== "object") - throw TypeError(".proto.VerifiedNameDetails.localizedNames: object expected"); - message.localizedNames[i] = $root.proto.LocalizedName.fromObject(object.localizedNames[i]); - } + var message = new $root.proto.Button(); + if (object.buttonId != null) + message.buttonId = String(object.buttonId); + if (object.buttonText != null) { + if (typeof object.buttonText !== "object") + throw TypeError(".proto.Button.buttonText: object expected"); + message.buttonText = $root.proto.ButtonText.fromObject(object.buttonText); + } + switch (object.type) { + case "UNKNOWN": + case 0: + message.type = 0; + break; + case "RESPONSE": + case 1: + message.type = 1; + break; + case "NATIVE_FLOW": + case 2: + message.type = 2; + break; + } + if (object.nativeFlowInfo != null) { + if (typeof object.nativeFlowInfo !== "object") + throw TypeError(".proto.Button.nativeFlowInfo: object expected"); + message.nativeFlowInfo = $root.proto.NativeFlowInfo.fromObject(object.nativeFlowInfo); } - if (object.issueTime != null) - if ($util.Long) - (message.issueTime = $util.Long.fromValue(object.issueTime)).unsigned = true; - else if (typeof object.issueTime === "string") - message.issueTime = parseInt(object.issueTime, 10); - else if (typeof object.issueTime === "number") - message.issueTime = object.issueTime; - else if (typeof object.issueTime === "object") - message.issueTime = new $util.LongBits(object.issueTime.low >>> 0, object.issueTime.high >>> 0).toNumber(true); return message; }; /** - * Creates a plain object from a VerifiedNameDetails message. Also converts values to other types if specified. + * Creates a plain object from a Button message. Also converts values to other types if specified. * @function toObject - * @memberof proto.VerifiedNameDetails + * @memberof proto.Button * @static - * @param {proto.VerifiedNameDetails} message VerifiedNameDetails + * @param {proto.Button} message Button * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - VerifiedNameDetails.toObject = function toObject(message, options) { + Button.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.localizedNames = []; if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.serial = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.serial = options.longs === String ? "0" : 0; - object.issuer = ""; - object.verifiedName = ""; - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.issueTime = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.issueTime = options.longs === String ? "0" : 0; - } - if (message.serial != null && message.hasOwnProperty("serial")) - if (typeof message.serial === "number") - object.serial = options.longs === String ? String(message.serial) : message.serial; - else - object.serial = options.longs === String ? $util.Long.prototype.toString.call(message.serial) : options.longs === Number ? new $util.LongBits(message.serial.low >>> 0, message.serial.high >>> 0).toNumber(true) : message.serial; - if (message.issuer != null && message.hasOwnProperty("issuer")) - object.issuer = message.issuer; - if (message.verifiedName != null && message.hasOwnProperty("verifiedName")) - object.verifiedName = message.verifiedName; - if (message.localizedNames && message.localizedNames.length) { - object.localizedNames = []; - for (var j = 0; j < message.localizedNames.length; ++j) - object.localizedNames[j] = $root.proto.LocalizedName.toObject(message.localizedNames[j], options); + object.buttonId = ""; + object.buttonText = null; + object.type = options.enums === String ? "UNKNOWN" : 0; + object.nativeFlowInfo = null; } - if (message.issueTime != null && message.hasOwnProperty("issueTime")) - if (typeof message.issueTime === "number") - object.issueTime = options.longs === String ? String(message.issueTime) : message.issueTime; - else - object.issueTime = options.longs === String ? $util.Long.prototype.toString.call(message.issueTime) : options.longs === Number ? new $util.LongBits(message.issueTime.low >>> 0, message.issueTime.high >>> 0).toNumber(true) : message.issueTime; + if (message.buttonId != null && message.hasOwnProperty("buttonId")) + object.buttonId = message.buttonId; + if (message.buttonText != null && message.hasOwnProperty("buttonText")) + object.buttonText = $root.proto.ButtonText.toObject(message.buttonText, options); + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.proto.Button.ButtonType[message.type] : message.type; + if (message.nativeFlowInfo != null && message.hasOwnProperty("nativeFlowInfo")) + object.nativeFlowInfo = $root.proto.NativeFlowInfo.toObject(message.nativeFlowInfo, options); return object; }; /** - * Converts this VerifiedNameDetails to JSON. + * Converts this Button to JSON. * @function toJSON - * @memberof proto.VerifiedNameDetails + * @memberof proto.Button * @instance * @returns {Object.} JSON object */ - VerifiedNameDetails.prototype.toJSON = function toJSON() { + Button.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return VerifiedNameDetails; + /** + * ButtonType enum. + * @name proto.Button.ButtonType + * @enum {number} + * @property {number} UNKNOWN=0 UNKNOWN value + * @property {number} RESPONSE=1 RESPONSE value + * @property {number} NATIVE_FLOW=2 NATIVE_FLOW value + */ + Button.ButtonType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNKNOWN"] = 0; + values[valuesById[1] = "RESPONSE"] = 1; + values[valuesById[2] = "NATIVE_FLOW"] = 2; + return values; + })(); + + return Button; })(); - proto.VerifiedNameCertificate = (function() { + proto.ButtonsMessage = (function() { /** - * Properties of a VerifiedNameCertificate. + * Properties of a ButtonsMessage. * @memberof proto - * @interface IVerifiedNameCertificate - * @property {Uint8Array|null} [details] VerifiedNameCertificate details - * @property {Uint8Array|null} [signature] VerifiedNameCertificate signature - * @property {Uint8Array|null} [serverSignature] VerifiedNameCertificate serverSignature + * @interface IButtonsMessage + * @property {string|null} [contentText] ButtonsMessage contentText + * @property {string|null} [footerText] ButtonsMessage footerText + * @property {proto.IContextInfo|null} [contextInfo] ButtonsMessage contextInfo + * @property {Array.|null} [buttons] ButtonsMessage buttons + * @property {proto.ButtonsMessage.ButtonsMessageHeaderType|null} [headerType] ButtonsMessage headerType + * @property {string|null} [text] ButtonsMessage text + * @property {proto.IDocumentMessage|null} [documentMessage] ButtonsMessage documentMessage + * @property {proto.IImageMessage|null} [imageMessage] ButtonsMessage imageMessage + * @property {proto.IVideoMessage|null} [videoMessage] ButtonsMessage videoMessage + * @property {proto.ILocationMessage|null} [locationMessage] ButtonsMessage locationMessage */ /** - * Constructs a new VerifiedNameCertificate. + * Constructs a new ButtonsMessage. * @memberof proto - * @classdesc Represents a VerifiedNameCertificate. - * @implements IVerifiedNameCertificate + * @classdesc Represents a ButtonsMessage. + * @implements IButtonsMessage * @constructor - * @param {proto.IVerifiedNameCertificate=} [properties] Properties to set + * @param {proto.IButtonsMessage=} [properties] Properties to set */ - function VerifiedNameCertificate(properties) { + function ButtonsMessage(properties) { + this.buttons = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -6296,101 +4901,209 @@ $root.proto = (function() { } /** - * VerifiedNameCertificate details. - * @member {Uint8Array} details - * @memberof proto.VerifiedNameCertificate + * ButtonsMessage contentText. + * @member {string} contentText + * @memberof proto.ButtonsMessage * @instance */ - VerifiedNameCertificate.prototype.details = $util.newBuffer([]); + ButtonsMessage.prototype.contentText = ""; /** - * VerifiedNameCertificate signature. - * @member {Uint8Array} signature - * @memberof proto.VerifiedNameCertificate + * ButtonsMessage footerText. + * @member {string} footerText + * @memberof proto.ButtonsMessage * @instance */ - VerifiedNameCertificate.prototype.signature = $util.newBuffer([]); + ButtonsMessage.prototype.footerText = ""; /** - * VerifiedNameCertificate serverSignature. - * @member {Uint8Array} serverSignature - * @memberof proto.VerifiedNameCertificate + * ButtonsMessage contextInfo. + * @member {proto.IContextInfo|null|undefined} contextInfo + * @memberof proto.ButtonsMessage * @instance */ - VerifiedNameCertificate.prototype.serverSignature = $util.newBuffer([]); + ButtonsMessage.prototype.contextInfo = null; /** - * Creates a new VerifiedNameCertificate instance using the specified properties. + * ButtonsMessage buttons. + * @member {Array.} buttons + * @memberof proto.ButtonsMessage + * @instance + */ + ButtonsMessage.prototype.buttons = $util.emptyArray; + + /** + * ButtonsMessage headerType. + * @member {proto.ButtonsMessage.ButtonsMessageHeaderType} headerType + * @memberof proto.ButtonsMessage + * @instance + */ + ButtonsMessage.prototype.headerType = 0; + + /** + * ButtonsMessage text. + * @member {string|null|undefined} text + * @memberof proto.ButtonsMessage + * @instance + */ + ButtonsMessage.prototype.text = null; + + /** + * ButtonsMessage documentMessage. + * @member {proto.IDocumentMessage|null|undefined} documentMessage + * @memberof proto.ButtonsMessage + * @instance + */ + ButtonsMessage.prototype.documentMessage = null; + + /** + * ButtonsMessage imageMessage. + * @member {proto.IImageMessage|null|undefined} imageMessage + * @memberof proto.ButtonsMessage + * @instance + */ + ButtonsMessage.prototype.imageMessage = null; + + /** + * ButtonsMessage videoMessage. + * @member {proto.IVideoMessage|null|undefined} videoMessage + * @memberof proto.ButtonsMessage + * @instance + */ + ButtonsMessage.prototype.videoMessage = null; + + /** + * ButtonsMessage locationMessage. + * @member {proto.ILocationMessage|null|undefined} locationMessage + * @memberof proto.ButtonsMessage + * @instance + */ + ButtonsMessage.prototype.locationMessage = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ButtonsMessage header. + * @member {"text"|"documentMessage"|"imageMessage"|"videoMessage"|"locationMessage"|undefined} header + * @memberof proto.ButtonsMessage + * @instance + */ + Object.defineProperty(ButtonsMessage.prototype, "header", { + get: $util.oneOfGetter($oneOfFields = ["text", "documentMessage", "imageMessage", "videoMessage", "locationMessage"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ButtonsMessage instance using the specified properties. * @function create - * @memberof proto.VerifiedNameCertificate + * @memberof proto.ButtonsMessage * @static - * @param {proto.IVerifiedNameCertificate=} [properties] Properties to set - * @returns {proto.VerifiedNameCertificate} VerifiedNameCertificate instance + * @param {proto.IButtonsMessage=} [properties] Properties to set + * @returns {proto.ButtonsMessage} ButtonsMessage instance */ - VerifiedNameCertificate.create = function create(properties) { - return new VerifiedNameCertificate(properties); + ButtonsMessage.create = function create(properties) { + return new ButtonsMessage(properties); }; /** - * Encodes the specified VerifiedNameCertificate message. Does not implicitly {@link proto.VerifiedNameCertificate.verify|verify} messages. + * Encodes the specified ButtonsMessage message. Does not implicitly {@link proto.ButtonsMessage.verify|verify} messages. * @function encode - * @memberof proto.VerifiedNameCertificate + * @memberof proto.ButtonsMessage * @static - * @param {proto.IVerifiedNameCertificate} message VerifiedNameCertificate message or plain object to encode + * @param {proto.IButtonsMessage} message ButtonsMessage message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - VerifiedNameCertificate.encode = function encode(message, writer) { + ButtonsMessage.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.details != null && Object.hasOwnProperty.call(message, "details")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.details); - if (message.signature != null && Object.hasOwnProperty.call(message, "signature")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.signature); - if (message.serverSignature != null && Object.hasOwnProperty.call(message, "serverSignature")) - writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.serverSignature); + if (message.text != null && Object.hasOwnProperty.call(message, "text")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.text); + if (message.documentMessage != null && Object.hasOwnProperty.call(message, "documentMessage")) + $root.proto.DocumentMessage.encode(message.documentMessage, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.imageMessage != null && Object.hasOwnProperty.call(message, "imageMessage")) + $root.proto.ImageMessage.encode(message.imageMessage, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.videoMessage != null && Object.hasOwnProperty.call(message, "videoMessage")) + $root.proto.VideoMessage.encode(message.videoMessage, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.locationMessage != null && Object.hasOwnProperty.call(message, "locationMessage")) + $root.proto.LocationMessage.encode(message.locationMessage, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.contentText != null && Object.hasOwnProperty.call(message, "contentText")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.contentText); + if (message.footerText != null && Object.hasOwnProperty.call(message, "footerText")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.footerText); + if (message.contextInfo != null && Object.hasOwnProperty.call(message, "contextInfo")) + $root.proto.ContextInfo.encode(message.contextInfo, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.buttons != null && message.buttons.length) + for (var i = 0; i < message.buttons.length; ++i) + $root.proto.Button.encode(message.buttons[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.headerType != null && Object.hasOwnProperty.call(message, "headerType")) + writer.uint32(/* id 10, wireType 0 =*/80).int32(message.headerType); return writer; }; /** - * Encodes the specified VerifiedNameCertificate message, length delimited. Does not implicitly {@link proto.VerifiedNameCertificate.verify|verify} messages. + * Encodes the specified ButtonsMessage message, length delimited. Does not implicitly {@link proto.ButtonsMessage.verify|verify} messages. * @function encodeDelimited - * @memberof proto.VerifiedNameCertificate + * @memberof proto.ButtonsMessage * @static - * @param {proto.IVerifiedNameCertificate} message VerifiedNameCertificate message or plain object to encode + * @param {proto.IButtonsMessage} message ButtonsMessage message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - VerifiedNameCertificate.encodeDelimited = function encodeDelimited(message, writer) { + ButtonsMessage.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a VerifiedNameCertificate message from the specified reader or buffer. + * Decodes a ButtonsMessage message from the specified reader or buffer. * @function decode - * @memberof proto.VerifiedNameCertificate + * @memberof proto.ButtonsMessage * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {proto.VerifiedNameCertificate} VerifiedNameCertificate + * @returns {proto.ButtonsMessage} ButtonsMessage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - VerifiedNameCertificate.decode = function decode(reader, length) { + ButtonsMessage.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.VerifiedNameCertificate(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.ButtonsMessage(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { + case 6: + message.contentText = reader.string(); + break; + case 7: + message.footerText = reader.string(); + break; + case 8: + message.contextInfo = $root.proto.ContextInfo.decode(reader, reader.uint32()); + break; + case 9: + if (!(message.buttons && message.buttons.length)) + message.buttons = []; + message.buttons.push($root.proto.Button.decode(reader, reader.uint32())); + break; + case 10: + message.headerType = reader.int32(); + break; case 1: - message.details = reader.bytes(); + message.text = reader.string(); break; case 2: - message.signature = reader.bytes(); + message.documentMessage = $root.proto.DocumentMessage.decode(reader, reader.uint32()); break; case 3: - message.serverSignature = reader.bytes(); + message.imageMessage = $root.proto.ImageMessage.decode(reader, reader.uint32()); + break; + case 4: + message.videoMessage = $root.proto.VideoMessage.decode(reader, reader.uint32()); + break; + case 5: + message.locationMessage = $root.proto.LocationMessage.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -6401,153 +5114,321 @@ $root.proto = (function() { }; /** - * Decodes a VerifiedNameCertificate message from the specified reader or buffer, length delimited. + * Decodes a ButtonsMessage message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof proto.VerifiedNameCertificate + * @memberof proto.ButtonsMessage * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.VerifiedNameCertificate} VerifiedNameCertificate + * @returns {proto.ButtonsMessage} ButtonsMessage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - VerifiedNameCertificate.decodeDelimited = function decodeDelimited(reader) { + ButtonsMessage.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a VerifiedNameCertificate message. + * Verifies a ButtonsMessage message. * @function verify - * @memberof proto.VerifiedNameCertificate + * @memberof proto.ButtonsMessage * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - VerifiedNameCertificate.verify = function verify(message) { + ButtonsMessage.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.details != null && message.hasOwnProperty("details")) - if (!(message.details && typeof message.details.length === "number" || $util.isString(message.details))) - return "details: buffer expected"; - if (message.signature != null && message.hasOwnProperty("signature")) - if (!(message.signature && typeof message.signature.length === "number" || $util.isString(message.signature))) - return "signature: buffer expected"; - if (message.serverSignature != null && message.hasOwnProperty("serverSignature")) - if (!(message.serverSignature && typeof message.serverSignature.length === "number" || $util.isString(message.serverSignature))) - return "serverSignature: buffer expected"; + var properties = {}; + if (message.contentText != null && message.hasOwnProperty("contentText")) + if (!$util.isString(message.contentText)) + return "contentText: string expected"; + if (message.footerText != null && message.hasOwnProperty("footerText")) + if (!$util.isString(message.footerText)) + return "footerText: string expected"; + if (message.contextInfo != null && message.hasOwnProperty("contextInfo")) { + var error = $root.proto.ContextInfo.verify(message.contextInfo); + if (error) + return "contextInfo." + error; + } + if (message.buttons != null && message.hasOwnProperty("buttons")) { + if (!Array.isArray(message.buttons)) + return "buttons: array expected"; + for (var i = 0; i < message.buttons.length; ++i) { + var error = $root.proto.Button.verify(message.buttons[i]); + if (error) + return "buttons." + error; + } + } + if (message.headerType != null && message.hasOwnProperty("headerType")) + switch (message.headerType) { + default: + return "headerType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + break; + } + if (message.text != null && message.hasOwnProperty("text")) { + properties.header = 1; + if (!$util.isString(message.text)) + return "text: string expected"; + } + if (message.documentMessage != null && message.hasOwnProperty("documentMessage")) { + if (properties.header === 1) + return "header: multiple values"; + properties.header = 1; + { + var error = $root.proto.DocumentMessage.verify(message.documentMessage); + if (error) + return "documentMessage." + error; + } + } + if (message.imageMessage != null && message.hasOwnProperty("imageMessage")) { + if (properties.header === 1) + return "header: multiple values"; + properties.header = 1; + { + var error = $root.proto.ImageMessage.verify(message.imageMessage); + if (error) + return "imageMessage." + error; + } + } + if (message.videoMessage != null && message.hasOwnProperty("videoMessage")) { + if (properties.header === 1) + return "header: multiple values"; + properties.header = 1; + { + var error = $root.proto.VideoMessage.verify(message.videoMessage); + if (error) + return "videoMessage." + error; + } + } + if (message.locationMessage != null && message.hasOwnProperty("locationMessage")) { + if (properties.header === 1) + return "header: multiple values"; + properties.header = 1; + { + var error = $root.proto.LocationMessage.verify(message.locationMessage); + if (error) + return "locationMessage." + error; + } + } return null; }; /** - * Creates a VerifiedNameCertificate message from a plain object. Also converts values to their respective internal types. + * Creates a ButtonsMessage message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof proto.VerifiedNameCertificate + * @memberof proto.ButtonsMessage * @static * @param {Object.} object Plain object - * @returns {proto.VerifiedNameCertificate} VerifiedNameCertificate + * @returns {proto.ButtonsMessage} ButtonsMessage */ - VerifiedNameCertificate.fromObject = function fromObject(object) { - if (object instanceof $root.proto.VerifiedNameCertificate) + ButtonsMessage.fromObject = function fromObject(object) { + if (object instanceof $root.proto.ButtonsMessage) return object; - var message = new $root.proto.VerifiedNameCertificate(); - if (object.details != null) - if (typeof object.details === "string") - $util.base64.decode(object.details, message.details = $util.newBuffer($util.base64.length(object.details)), 0); - else if (object.details.length) - message.details = object.details; - if (object.signature != null) - if (typeof object.signature === "string") - $util.base64.decode(object.signature, message.signature = $util.newBuffer($util.base64.length(object.signature)), 0); - else if (object.signature.length) - message.signature = object.signature; - if (object.serverSignature != null) - if (typeof object.serverSignature === "string") - $util.base64.decode(object.serverSignature, message.serverSignature = $util.newBuffer($util.base64.length(object.serverSignature)), 0); - else if (object.serverSignature.length) - message.serverSignature = object.serverSignature; + var message = new $root.proto.ButtonsMessage(); + if (object.contentText != null) + message.contentText = String(object.contentText); + if (object.footerText != null) + message.footerText = String(object.footerText); + if (object.contextInfo != null) { + if (typeof object.contextInfo !== "object") + throw TypeError(".proto.ButtonsMessage.contextInfo: object expected"); + message.contextInfo = $root.proto.ContextInfo.fromObject(object.contextInfo); + } + if (object.buttons) { + if (!Array.isArray(object.buttons)) + throw TypeError(".proto.ButtonsMessage.buttons: array expected"); + message.buttons = []; + for (var i = 0; i < object.buttons.length; ++i) { + if (typeof object.buttons[i] !== "object") + throw TypeError(".proto.ButtonsMessage.buttons: object expected"); + message.buttons[i] = $root.proto.Button.fromObject(object.buttons[i]); + } + } + switch (object.headerType) { + case "UNKNOWN": + case 0: + message.headerType = 0; + break; + case "EMPTY": + case 1: + message.headerType = 1; + break; + case "TEXT": + case 2: + message.headerType = 2; + break; + case "DOCUMENT": + case 3: + message.headerType = 3; + break; + case "IMAGE": + case 4: + message.headerType = 4; + break; + case "VIDEO": + case 5: + message.headerType = 5; + break; + case "LOCATION": + case 6: + message.headerType = 6; + break; + } + if (object.text != null) + message.text = String(object.text); + if (object.documentMessage != null) { + if (typeof object.documentMessage !== "object") + throw TypeError(".proto.ButtonsMessage.documentMessage: object expected"); + message.documentMessage = $root.proto.DocumentMessage.fromObject(object.documentMessage); + } + if (object.imageMessage != null) { + if (typeof object.imageMessage !== "object") + throw TypeError(".proto.ButtonsMessage.imageMessage: object expected"); + message.imageMessage = $root.proto.ImageMessage.fromObject(object.imageMessage); + } + if (object.videoMessage != null) { + if (typeof object.videoMessage !== "object") + throw TypeError(".proto.ButtonsMessage.videoMessage: object expected"); + message.videoMessage = $root.proto.VideoMessage.fromObject(object.videoMessage); + } + if (object.locationMessage != null) { + if (typeof object.locationMessage !== "object") + throw TypeError(".proto.ButtonsMessage.locationMessage: object expected"); + message.locationMessage = $root.proto.LocationMessage.fromObject(object.locationMessage); + } return message; }; /** - * Creates a plain object from a VerifiedNameCertificate message. Also converts values to other types if specified. + * Creates a plain object from a ButtonsMessage message. Also converts values to other types if specified. * @function toObject - * @memberof proto.VerifiedNameCertificate + * @memberof proto.ButtonsMessage * @static - * @param {proto.VerifiedNameCertificate} message VerifiedNameCertificate + * @param {proto.ButtonsMessage} message ButtonsMessage * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - VerifiedNameCertificate.toObject = function toObject(message, options) { + ButtonsMessage.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.buttons = []; if (options.defaults) { - if (options.bytes === String) - object.details = ""; - else { - object.details = []; - if (options.bytes !== Array) - object.details = $util.newBuffer(object.details); - } - if (options.bytes === String) - object.signature = ""; - else { - object.signature = []; - if (options.bytes !== Array) - object.signature = $util.newBuffer(object.signature); - } - if (options.bytes === String) - object.serverSignature = ""; - else { - object.serverSignature = []; - if (options.bytes !== Array) - object.serverSignature = $util.newBuffer(object.serverSignature); - } + object.contentText = ""; + object.footerText = ""; + object.contextInfo = null; + object.headerType = options.enums === String ? "UNKNOWN" : 0; } - if (message.details != null && message.hasOwnProperty("details")) - object.details = options.bytes === String ? $util.base64.encode(message.details, 0, message.details.length) : options.bytes === Array ? Array.prototype.slice.call(message.details) : message.details; - if (message.signature != null && message.hasOwnProperty("signature")) - object.signature = options.bytes === String ? $util.base64.encode(message.signature, 0, message.signature.length) : options.bytes === Array ? Array.prototype.slice.call(message.signature) : message.signature; - if (message.serverSignature != null && message.hasOwnProperty("serverSignature")) - object.serverSignature = options.bytes === String ? $util.base64.encode(message.serverSignature, 0, message.serverSignature.length) : options.bytes === Array ? Array.prototype.slice.call(message.serverSignature) : message.serverSignature; + if (message.text != null && message.hasOwnProperty("text")) { + object.text = message.text; + if (options.oneofs) + object.header = "text"; + } + if (message.documentMessage != null && message.hasOwnProperty("documentMessage")) { + object.documentMessage = $root.proto.DocumentMessage.toObject(message.documentMessage, options); + if (options.oneofs) + object.header = "documentMessage"; + } + if (message.imageMessage != null && message.hasOwnProperty("imageMessage")) { + object.imageMessage = $root.proto.ImageMessage.toObject(message.imageMessage, options); + if (options.oneofs) + object.header = "imageMessage"; + } + if (message.videoMessage != null && message.hasOwnProperty("videoMessage")) { + object.videoMessage = $root.proto.VideoMessage.toObject(message.videoMessage, options); + if (options.oneofs) + object.header = "videoMessage"; + } + if (message.locationMessage != null && message.hasOwnProperty("locationMessage")) { + object.locationMessage = $root.proto.LocationMessage.toObject(message.locationMessage, options); + if (options.oneofs) + object.header = "locationMessage"; + } + if (message.contentText != null && message.hasOwnProperty("contentText")) + object.contentText = message.contentText; + if (message.footerText != null && message.hasOwnProperty("footerText")) + object.footerText = message.footerText; + if (message.contextInfo != null && message.hasOwnProperty("contextInfo")) + object.contextInfo = $root.proto.ContextInfo.toObject(message.contextInfo, options); + if (message.buttons && message.buttons.length) { + object.buttons = []; + for (var j = 0; j < message.buttons.length; ++j) + object.buttons[j] = $root.proto.Button.toObject(message.buttons[j], options); + } + if (message.headerType != null && message.hasOwnProperty("headerType")) + object.headerType = options.enums === String ? $root.proto.ButtonsMessage.ButtonsMessageHeaderType[message.headerType] : message.headerType; return object; }; /** - * Converts this VerifiedNameCertificate to JSON. + * Converts this ButtonsMessage to JSON. * @function toJSON - * @memberof proto.VerifiedNameCertificate + * @memberof proto.ButtonsMessage * @instance * @returns {Object.} JSON object */ - VerifiedNameCertificate.prototype.toJSON = function toJSON() { + ButtonsMessage.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return VerifiedNameCertificate; + /** + * ButtonsMessageHeaderType enum. + * @name proto.ButtonsMessage.ButtonsMessageHeaderType + * @enum {number} + * @property {number} UNKNOWN=0 UNKNOWN value + * @property {number} EMPTY=1 EMPTY value + * @property {number} TEXT=2 TEXT value + * @property {number} DOCUMENT=3 DOCUMENT value + * @property {number} IMAGE=4 IMAGE value + * @property {number} VIDEO=5 VIDEO value + * @property {number} LOCATION=6 LOCATION value + */ + ButtonsMessage.ButtonsMessageHeaderType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNKNOWN"] = 0; + values[valuesById[1] = "EMPTY"] = 1; + values[valuesById[2] = "TEXT"] = 2; + values[valuesById[3] = "DOCUMENT"] = 3; + values[valuesById[4] = "IMAGE"] = 4; + values[valuesById[5] = "VIDEO"] = 5; + values[valuesById[6] = "LOCATION"] = 6; + return values; + })(); + + return ButtonsMessage; })(); - proto.LocalizedName = (function() { + proto.ButtonsResponseMessage = (function() { /** - * Properties of a LocalizedName. + * Properties of a ButtonsResponseMessage. * @memberof proto - * @interface ILocalizedName - * @property {string|null} [lg] LocalizedName lg - * @property {string|null} [lc] LocalizedName lc - * @property {string|null} [verifiedName] LocalizedName verifiedName + * @interface IButtonsResponseMessage + * @property {string|null} [selectedButtonId] ButtonsResponseMessage selectedButtonId + * @property {proto.IContextInfo|null} [contextInfo] ButtonsResponseMessage contextInfo + * @property {proto.ButtonsResponseMessage.ButtonsResponseMessageType|null} [type] ButtonsResponseMessage type + * @property {string|null} [selectedDisplayText] ButtonsResponseMessage selectedDisplayText */ /** - * Constructs a new LocalizedName. + * Constructs a new ButtonsResponseMessage. * @memberof proto - * @classdesc Represents a LocalizedName. - * @implements ILocalizedName + * @classdesc Represents a ButtonsResponseMessage. + * @implements IButtonsResponseMessage * @constructor - * @param {proto.ILocalizedName=} [properties] Properties to set + * @param {proto.IButtonsResponseMessage=} [properties] Properties to set */ - function LocalizedName(properties) { + function ButtonsResponseMessage(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -6555,101 +5436,128 @@ $root.proto = (function() { } /** - * LocalizedName lg. - * @member {string} lg - * @memberof proto.LocalizedName + * ButtonsResponseMessage selectedButtonId. + * @member {string} selectedButtonId + * @memberof proto.ButtonsResponseMessage * @instance */ - LocalizedName.prototype.lg = ""; + ButtonsResponseMessage.prototype.selectedButtonId = ""; /** - * LocalizedName lc. - * @member {string} lc - * @memberof proto.LocalizedName + * ButtonsResponseMessage contextInfo. + * @member {proto.IContextInfo|null|undefined} contextInfo + * @memberof proto.ButtonsResponseMessage * @instance */ - LocalizedName.prototype.lc = ""; + ButtonsResponseMessage.prototype.contextInfo = null; /** - * LocalizedName verifiedName. - * @member {string} verifiedName - * @memberof proto.LocalizedName + * ButtonsResponseMessage type. + * @member {proto.ButtonsResponseMessage.ButtonsResponseMessageType} type + * @memberof proto.ButtonsResponseMessage * @instance */ - LocalizedName.prototype.verifiedName = ""; + ButtonsResponseMessage.prototype.type = 0; /** - * Creates a new LocalizedName instance using the specified properties. + * ButtonsResponseMessage selectedDisplayText. + * @member {string|null|undefined} selectedDisplayText + * @memberof proto.ButtonsResponseMessage + * @instance + */ + ButtonsResponseMessage.prototype.selectedDisplayText = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ButtonsResponseMessage response. + * @member {"selectedDisplayText"|undefined} response + * @memberof proto.ButtonsResponseMessage + * @instance + */ + Object.defineProperty(ButtonsResponseMessage.prototype, "response", { + get: $util.oneOfGetter($oneOfFields = ["selectedDisplayText"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ButtonsResponseMessage instance using the specified properties. * @function create - * @memberof proto.LocalizedName + * @memberof proto.ButtonsResponseMessage * @static - * @param {proto.ILocalizedName=} [properties] Properties to set - * @returns {proto.LocalizedName} LocalizedName instance + * @param {proto.IButtonsResponseMessage=} [properties] Properties to set + * @returns {proto.ButtonsResponseMessage} ButtonsResponseMessage instance */ - LocalizedName.create = function create(properties) { - return new LocalizedName(properties); + ButtonsResponseMessage.create = function create(properties) { + return new ButtonsResponseMessage(properties); }; /** - * Encodes the specified LocalizedName message. Does not implicitly {@link proto.LocalizedName.verify|verify} messages. + * Encodes the specified ButtonsResponseMessage message. Does not implicitly {@link proto.ButtonsResponseMessage.verify|verify} messages. * @function encode - * @memberof proto.LocalizedName + * @memberof proto.ButtonsResponseMessage * @static - * @param {proto.ILocalizedName} message LocalizedName message or plain object to encode + * @param {proto.IButtonsResponseMessage} message ButtonsResponseMessage message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - LocalizedName.encode = function encode(message, writer) { + ButtonsResponseMessage.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.lg != null && Object.hasOwnProperty.call(message, "lg")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.lg); - if (message.lc != null && Object.hasOwnProperty.call(message, "lc")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.lc); - if (message.verifiedName != null && Object.hasOwnProperty.call(message, "verifiedName")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.verifiedName); + if (message.selectedButtonId != null && Object.hasOwnProperty.call(message, "selectedButtonId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.selectedButtonId); + if (message.selectedDisplayText != null && Object.hasOwnProperty.call(message, "selectedDisplayText")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.selectedDisplayText); + if (message.contextInfo != null && Object.hasOwnProperty.call(message, "contextInfo")) + $root.proto.ContextInfo.encode(message.contextInfo, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.type); return writer; }; /** - * Encodes the specified LocalizedName message, length delimited. Does not implicitly {@link proto.LocalizedName.verify|verify} messages. + * Encodes the specified ButtonsResponseMessage message, length delimited. Does not implicitly {@link proto.ButtonsResponseMessage.verify|verify} messages. * @function encodeDelimited - * @memberof proto.LocalizedName + * @memberof proto.ButtonsResponseMessage * @static - * @param {proto.ILocalizedName} message LocalizedName message or plain object to encode + * @param {proto.IButtonsResponseMessage} message ButtonsResponseMessage message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - LocalizedName.encodeDelimited = function encodeDelimited(message, writer) { + ButtonsResponseMessage.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a LocalizedName message from the specified reader or buffer. + * Decodes a ButtonsResponseMessage message from the specified reader or buffer. * @function decode - * @memberof proto.LocalizedName + * @memberof proto.ButtonsResponseMessage * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {proto.LocalizedName} LocalizedName + * @returns {proto.ButtonsResponseMessage} ButtonsResponseMessage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - LocalizedName.decode = function decode(reader, length) { + ButtonsResponseMessage.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.LocalizedName(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.ButtonsResponseMessage(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.lg = reader.string(); - break; - case 2: - message.lc = reader.string(); + message.selectedButtonId = reader.string(); break; case 3: - message.verifiedName = reader.string(); + message.contextInfo = $root.proto.ContextInfo.decode(reader, reader.uint32()); + break; + case 4: + message.type = reader.int32(); + break; + case 2: + message.selectedDisplayText = reader.string(); break; default: reader.skipType(tag & 7); @@ -6660,127 +5568,169 @@ $root.proto = (function() { }; /** - * Decodes a LocalizedName message from the specified reader or buffer, length delimited. + * Decodes a ButtonsResponseMessage message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof proto.LocalizedName + * @memberof proto.ButtonsResponseMessage * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.LocalizedName} LocalizedName + * @returns {proto.ButtonsResponseMessage} ButtonsResponseMessage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - LocalizedName.decodeDelimited = function decodeDelimited(reader) { + ButtonsResponseMessage.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a LocalizedName message. + * Verifies a ButtonsResponseMessage message. * @function verify - * @memberof proto.LocalizedName + * @memberof proto.ButtonsResponseMessage * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - LocalizedName.verify = function verify(message) { + ButtonsResponseMessage.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.lg != null && message.hasOwnProperty("lg")) - if (!$util.isString(message.lg)) - return "lg: string expected"; - if (message.lc != null && message.hasOwnProperty("lc")) - if (!$util.isString(message.lc)) - return "lc: string expected"; - if (message.verifiedName != null && message.hasOwnProperty("verifiedName")) - if (!$util.isString(message.verifiedName)) - return "verifiedName: string expected"; + var properties = {}; + if (message.selectedButtonId != null && message.hasOwnProperty("selectedButtonId")) + if (!$util.isString(message.selectedButtonId)) + return "selectedButtonId: string expected"; + if (message.contextInfo != null && message.hasOwnProperty("contextInfo")) { + var error = $root.proto.ContextInfo.verify(message.contextInfo); + if (error) + return "contextInfo." + error; + } + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + break; + } + if (message.selectedDisplayText != null && message.hasOwnProperty("selectedDisplayText")) { + properties.response = 1; + if (!$util.isString(message.selectedDisplayText)) + return "selectedDisplayText: string expected"; + } return null; }; /** - * Creates a LocalizedName message from a plain object. Also converts values to their respective internal types. + * Creates a ButtonsResponseMessage message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof proto.LocalizedName + * @memberof proto.ButtonsResponseMessage * @static * @param {Object.} object Plain object - * @returns {proto.LocalizedName} LocalizedName + * @returns {proto.ButtonsResponseMessage} ButtonsResponseMessage */ - LocalizedName.fromObject = function fromObject(object) { - if (object instanceof $root.proto.LocalizedName) + ButtonsResponseMessage.fromObject = function fromObject(object) { + if (object instanceof $root.proto.ButtonsResponseMessage) return object; - var message = new $root.proto.LocalizedName(); - if (object.lg != null) - message.lg = String(object.lg); - if (object.lc != null) - message.lc = String(object.lc); - if (object.verifiedName != null) - message.verifiedName = String(object.verifiedName); - return message; - }; - - /** - * Creates a plain object from a LocalizedName message. Also converts values to other types if specified. - * @function toObject - * @memberof proto.LocalizedName - * @static - * @param {proto.LocalizedName} message LocalizedName - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - LocalizedName.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.lg = ""; - object.lc = ""; - object.verifiedName = ""; + var message = new $root.proto.ButtonsResponseMessage(); + if (object.selectedButtonId != null) + message.selectedButtonId = String(object.selectedButtonId); + if (object.contextInfo != null) { + if (typeof object.contextInfo !== "object") + throw TypeError(".proto.ButtonsResponseMessage.contextInfo: object expected"); + message.contextInfo = $root.proto.ContextInfo.fromObject(object.contextInfo); } - if (message.lg != null && message.hasOwnProperty("lg")) - object.lg = message.lg; - if (message.lc != null && message.hasOwnProperty("lc")) - object.lc = message.lc; - if (message.verifiedName != null && message.hasOwnProperty("verifiedName")) - object.verifiedName = message.verifiedName; + switch (object.type) { + case "UNKNOWN": + case 0: + message.type = 0; + break; + case "DISPLAY_TEXT": + case 1: + message.type = 1; + break; + } + if (object.selectedDisplayText != null) + message.selectedDisplayText = String(object.selectedDisplayText); + return message; + }; + + /** + * Creates a plain object from a ButtonsResponseMessage message. Also converts values to other types if specified. + * @function toObject + * @memberof proto.ButtonsResponseMessage + * @static + * @param {proto.ButtonsResponseMessage} message ButtonsResponseMessage + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ButtonsResponseMessage.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.selectedButtonId = ""; + object.contextInfo = null; + object.type = options.enums === String ? "UNKNOWN" : 0; + } + if (message.selectedButtonId != null && message.hasOwnProperty("selectedButtonId")) + object.selectedButtonId = message.selectedButtonId; + if (message.selectedDisplayText != null && message.hasOwnProperty("selectedDisplayText")) { + object.selectedDisplayText = message.selectedDisplayText; + if (options.oneofs) + object.response = "selectedDisplayText"; + } + if (message.contextInfo != null && message.hasOwnProperty("contextInfo")) + object.contextInfo = $root.proto.ContextInfo.toObject(message.contextInfo, options); + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.proto.ButtonsResponseMessage.ButtonsResponseMessageType[message.type] : message.type; return object; }; /** - * Converts this LocalizedName to JSON. + * Converts this ButtonsResponseMessage to JSON. * @function toJSON - * @memberof proto.LocalizedName + * @memberof proto.ButtonsResponseMessage * @instance * @returns {Object.} JSON object */ - LocalizedName.prototype.toJSON = function toJSON() { + ButtonsResponseMessage.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return LocalizedName; + /** + * ButtonsResponseMessageType enum. + * @name proto.ButtonsResponseMessage.ButtonsResponseMessageType + * @enum {number} + * @property {number} UNKNOWN=0 UNKNOWN value + * @property {number} DISPLAY_TEXT=1 DISPLAY_TEXT value + */ + ButtonsResponseMessage.ButtonsResponseMessageType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNKNOWN"] = 0; + values[valuesById[1] = "DISPLAY_TEXT"] = 1; + return values; + })(); + + return ButtonsResponseMessage; })(); - proto.SyncActionData = (function() { + proto.ButtonText = (function() { /** - * Properties of a SyncActionData. + * Properties of a ButtonText. * @memberof proto - * @interface ISyncActionData - * @property {Uint8Array|null} [index] SyncActionData index - * @property {proto.ISyncActionValue|null} [value] SyncActionData value - * @property {Uint8Array|null} [padding] SyncActionData padding - * @property {number|null} [version] SyncActionData version + * @interface IButtonText + * @property {string|null} [displayText] ButtonText displayText */ /** - * Constructs a new SyncActionData. + * Constructs a new ButtonText. * @memberof proto - * @classdesc Represents a SyncActionData. - * @implements ISyncActionData + * @classdesc Represents a ButtonText. + * @implements IButtonText * @constructor - * @param {proto.ISyncActionData=} [properties] Properties to set + * @param {proto.IButtonText=} [properties] Properties to set */ - function SyncActionData(properties) { + function ButtonText(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -6788,114 +5738,75 @@ $root.proto = (function() { } /** - * SyncActionData index. - * @member {Uint8Array} index - * @memberof proto.SyncActionData - * @instance - */ - SyncActionData.prototype.index = $util.newBuffer([]); - - /** - * SyncActionData value. - * @member {proto.ISyncActionValue|null|undefined} value - * @memberof proto.SyncActionData - * @instance - */ - SyncActionData.prototype.value = null; - - /** - * SyncActionData padding. - * @member {Uint8Array} padding - * @memberof proto.SyncActionData - * @instance - */ - SyncActionData.prototype.padding = $util.newBuffer([]); - - /** - * SyncActionData version. - * @member {number} version - * @memberof proto.SyncActionData + * ButtonText displayText. + * @member {string} displayText + * @memberof proto.ButtonText * @instance */ - SyncActionData.prototype.version = 0; + ButtonText.prototype.displayText = ""; /** - * Creates a new SyncActionData instance using the specified properties. + * Creates a new ButtonText instance using the specified properties. * @function create - * @memberof proto.SyncActionData + * @memberof proto.ButtonText * @static - * @param {proto.ISyncActionData=} [properties] Properties to set - * @returns {proto.SyncActionData} SyncActionData instance + * @param {proto.IButtonText=} [properties] Properties to set + * @returns {proto.ButtonText} ButtonText instance */ - SyncActionData.create = function create(properties) { - return new SyncActionData(properties); + ButtonText.create = function create(properties) { + return new ButtonText(properties); }; /** - * Encodes the specified SyncActionData message. Does not implicitly {@link proto.SyncActionData.verify|verify} messages. + * Encodes the specified ButtonText message. Does not implicitly {@link proto.ButtonText.verify|verify} messages. * @function encode - * @memberof proto.SyncActionData + * @memberof proto.ButtonText * @static - * @param {proto.ISyncActionData} message SyncActionData message or plain object to encode + * @param {proto.IButtonText} message ButtonText message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SyncActionData.encode = function encode(message, writer) { + ButtonText.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.index != null && Object.hasOwnProperty.call(message, "index")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.index); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - $root.proto.SyncActionValue.encode(message.value, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.padding != null && Object.hasOwnProperty.call(message, "padding")) - writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.padding); - if (message.version != null && Object.hasOwnProperty.call(message, "version")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.version); + if (message.displayText != null && Object.hasOwnProperty.call(message, "displayText")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.displayText); return writer; }; /** - * Encodes the specified SyncActionData message, length delimited. Does not implicitly {@link proto.SyncActionData.verify|verify} messages. + * Encodes the specified ButtonText message, length delimited. Does not implicitly {@link proto.ButtonText.verify|verify} messages. * @function encodeDelimited - * @memberof proto.SyncActionData + * @memberof proto.ButtonText * @static - * @param {proto.ISyncActionData} message SyncActionData message or plain object to encode + * @param {proto.IButtonText} message ButtonText message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SyncActionData.encodeDelimited = function encodeDelimited(message, writer) { + ButtonText.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a SyncActionData message from the specified reader or buffer. + * Decodes a ButtonText message from the specified reader or buffer. * @function decode - * @memberof proto.SyncActionData + * @memberof proto.ButtonText * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {proto.SyncActionData} SyncActionData + * @returns {proto.ButtonText} ButtonText * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SyncActionData.decode = function decode(reader, length) { + ButtonText.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.SyncActionData(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.ButtonText(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.index = reader.bytes(); - break; - case 2: - message.value = $root.proto.SyncActionValue.decode(reader, reader.uint32()); - break; - case 3: - message.padding = reader.bytes(); - break; - case 4: - message.version = reader.int32(); + message.displayText = reader.string(); break; default: reader.skipType(tag & 7); @@ -6906,155 +5817,110 @@ $root.proto = (function() { }; /** - * Decodes a SyncActionData message from the specified reader or buffer, length delimited. + * Decodes a ButtonText message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof proto.SyncActionData + * @memberof proto.ButtonText * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.SyncActionData} SyncActionData + * @returns {proto.ButtonText} ButtonText * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SyncActionData.decodeDelimited = function decodeDelimited(reader) { + ButtonText.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a SyncActionData message. + * Verifies a ButtonText message. * @function verify - * @memberof proto.SyncActionData + * @memberof proto.ButtonText * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - SyncActionData.verify = function verify(message) { + ButtonText.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.index != null && message.hasOwnProperty("index")) - if (!(message.index && typeof message.index.length === "number" || $util.isString(message.index))) - return "index: buffer expected"; - if (message.value != null && message.hasOwnProperty("value")) { - var error = $root.proto.SyncActionValue.verify(message.value); - if (error) - return "value." + error; - } - if (message.padding != null && message.hasOwnProperty("padding")) - if (!(message.padding && typeof message.padding.length === "number" || $util.isString(message.padding))) - return "padding: buffer expected"; - if (message.version != null && message.hasOwnProperty("version")) - if (!$util.isInteger(message.version)) - return "version: integer expected"; + if (message.displayText != null && message.hasOwnProperty("displayText")) + if (!$util.isString(message.displayText)) + return "displayText: string expected"; return null; }; /** - * Creates a SyncActionData message from a plain object. Also converts values to their respective internal types. + * Creates a ButtonText message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof proto.SyncActionData + * @memberof proto.ButtonText * @static * @param {Object.} object Plain object - * @returns {proto.SyncActionData} SyncActionData + * @returns {proto.ButtonText} ButtonText */ - SyncActionData.fromObject = function fromObject(object) { - if (object instanceof $root.proto.SyncActionData) + ButtonText.fromObject = function fromObject(object) { + if (object instanceof $root.proto.ButtonText) return object; - var message = new $root.proto.SyncActionData(); - if (object.index != null) - if (typeof object.index === "string") - $util.base64.decode(object.index, message.index = $util.newBuffer($util.base64.length(object.index)), 0); - else if (object.index.length) - message.index = object.index; - if (object.value != null) { - if (typeof object.value !== "object") - throw TypeError(".proto.SyncActionData.value: object expected"); - message.value = $root.proto.SyncActionValue.fromObject(object.value); - } - if (object.padding != null) - if (typeof object.padding === "string") - $util.base64.decode(object.padding, message.padding = $util.newBuffer($util.base64.length(object.padding)), 0); - else if (object.padding.length) - message.padding = object.padding; - if (object.version != null) - message.version = object.version | 0; + var message = new $root.proto.ButtonText(); + if (object.displayText != null) + message.displayText = String(object.displayText); return message; }; /** - * Creates a plain object from a SyncActionData message. Also converts values to other types if specified. + * Creates a plain object from a ButtonText message. Also converts values to other types if specified. * @function toObject - * @memberof proto.SyncActionData + * @memberof proto.ButtonText * @static - * @param {proto.SyncActionData} message SyncActionData + * @param {proto.ButtonText} message ButtonText * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SyncActionData.toObject = function toObject(message, options) { + ButtonText.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - if (options.bytes === String) - object.index = ""; - else { - object.index = []; - if (options.bytes !== Array) - object.index = $util.newBuffer(object.index); - } - object.value = null; - if (options.bytes === String) - object.padding = ""; - else { - object.padding = []; - if (options.bytes !== Array) - object.padding = $util.newBuffer(object.padding); - } - object.version = 0; - } - if (message.index != null && message.hasOwnProperty("index")) - object.index = options.bytes === String ? $util.base64.encode(message.index, 0, message.index.length) : options.bytes === Array ? Array.prototype.slice.call(message.index) : message.index; - if (message.value != null && message.hasOwnProperty("value")) - object.value = $root.proto.SyncActionValue.toObject(message.value, options); - if (message.padding != null && message.hasOwnProperty("padding")) - object.padding = options.bytes === String ? $util.base64.encode(message.padding, 0, message.padding.length) : options.bytes === Array ? Array.prototype.slice.call(message.padding) : message.padding; - if (message.version != null && message.hasOwnProperty("version")) - object.version = message.version; + if (options.defaults) + object.displayText = ""; + if (message.displayText != null && message.hasOwnProperty("displayText")) + object.displayText = message.displayText; return object; }; /** - * Converts this SyncActionData to JSON. + * Converts this ButtonText to JSON. * @function toJSON - * @memberof proto.SyncActionData + * @memberof proto.ButtonText * @instance * @returns {Object.} JSON object */ - SyncActionData.prototype.toJSON = function toJSON() { + ButtonText.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return SyncActionData; + return ButtonText; })(); - proto.StarAction = (function() { + proto.Call = (function() { /** - * Properties of a StarAction. + * Properties of a Call. * @memberof proto - * @interface IStarAction - * @property {boolean|null} [starred] StarAction starred + * @interface ICall + * @property {Uint8Array|null} [callKey] Call callKey + * @property {string|null} [conversionSource] Call conversionSource + * @property {Uint8Array|null} [conversionData] Call conversionData + * @property {number|null} [conversionDelaySeconds] Call conversionDelaySeconds */ /** - * Constructs a new StarAction. + * Constructs a new Call. * @memberof proto - * @classdesc Represents a StarAction. - * @implements IStarAction + * @classdesc Represents a Call. + * @implements ICall * @constructor - * @param {proto.IStarAction=} [properties] Properties to set + * @param {proto.ICall=} [properties] Properties to set */ - function StarAction(properties) { + function Call(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -7062,75 +5928,114 @@ $root.proto = (function() { } /** - * StarAction starred. - * @member {boolean} starred - * @memberof proto.StarAction + * Call callKey. + * @member {Uint8Array} callKey + * @memberof proto.Call * @instance */ - StarAction.prototype.starred = false; + Call.prototype.callKey = $util.newBuffer([]); /** - * Creates a new StarAction instance using the specified properties. + * Call conversionSource. + * @member {string} conversionSource + * @memberof proto.Call + * @instance + */ + Call.prototype.conversionSource = ""; + + /** + * Call conversionData. + * @member {Uint8Array} conversionData + * @memberof proto.Call + * @instance + */ + Call.prototype.conversionData = $util.newBuffer([]); + + /** + * Call conversionDelaySeconds. + * @member {number} conversionDelaySeconds + * @memberof proto.Call + * @instance + */ + Call.prototype.conversionDelaySeconds = 0; + + /** + * Creates a new Call instance using the specified properties. * @function create - * @memberof proto.StarAction + * @memberof proto.Call * @static - * @param {proto.IStarAction=} [properties] Properties to set - * @returns {proto.StarAction} StarAction instance + * @param {proto.ICall=} [properties] Properties to set + * @returns {proto.Call} Call instance */ - StarAction.create = function create(properties) { - return new StarAction(properties); + Call.create = function create(properties) { + return new Call(properties); }; /** - * Encodes the specified StarAction message. Does not implicitly {@link proto.StarAction.verify|verify} messages. + * Encodes the specified Call message. Does not implicitly {@link proto.Call.verify|verify} messages. * @function encode - * @memberof proto.StarAction + * @memberof proto.Call * @static - * @param {proto.IStarAction} message StarAction message or plain object to encode + * @param {proto.ICall} message Call message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - StarAction.encode = function encode(message, writer) { + Call.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.starred != null && Object.hasOwnProperty.call(message, "starred")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.starred); + if (message.callKey != null && Object.hasOwnProperty.call(message, "callKey")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.callKey); + if (message.conversionSource != null && Object.hasOwnProperty.call(message, "conversionSource")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.conversionSource); + if (message.conversionData != null && Object.hasOwnProperty.call(message, "conversionData")) + writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.conversionData); + if (message.conversionDelaySeconds != null && Object.hasOwnProperty.call(message, "conversionDelaySeconds")) + writer.uint32(/* id 4, wireType 0 =*/32).uint32(message.conversionDelaySeconds); return writer; }; /** - * Encodes the specified StarAction message, length delimited. Does not implicitly {@link proto.StarAction.verify|verify} messages. + * Encodes the specified Call message, length delimited. Does not implicitly {@link proto.Call.verify|verify} messages. * @function encodeDelimited - * @memberof proto.StarAction + * @memberof proto.Call * @static - * @param {proto.IStarAction} message StarAction message or plain object to encode + * @param {proto.ICall} message Call message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - StarAction.encodeDelimited = function encodeDelimited(message, writer) { + Call.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a StarAction message from the specified reader or buffer. + * Decodes a Call message from the specified reader or buffer. * @function decode - * @memberof proto.StarAction + * @memberof proto.Call * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {proto.StarAction} StarAction + * @returns {proto.Call} Call * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - StarAction.decode = function decode(reader, length) { + Call.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.StarAction(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.Call(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.starred = reader.bool(); + message.callKey = reader.bytes(); + break; + case 2: + message.conversionSource = reader.string(); + break; + case 3: + message.conversionData = reader.bytes(); + break; + case 4: + message.conversionDelaySeconds = reader.uint32(); break; default: reader.skipType(tag & 7); @@ -7141,108 +6046,151 @@ $root.proto = (function() { }; /** - * Decodes a StarAction message from the specified reader or buffer, length delimited. + * Decodes a Call message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof proto.StarAction + * @memberof proto.Call * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.StarAction} StarAction + * @returns {proto.Call} Call * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - StarAction.decodeDelimited = function decodeDelimited(reader) { + Call.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a StarAction message. + * Verifies a Call message. * @function verify - * @memberof proto.StarAction + * @memberof proto.Call * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - StarAction.verify = function verify(message) { + Call.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.starred != null && message.hasOwnProperty("starred")) - if (typeof message.starred !== "boolean") - return "starred: boolean expected"; + if (message.callKey != null && message.hasOwnProperty("callKey")) + if (!(message.callKey && typeof message.callKey.length === "number" || $util.isString(message.callKey))) + return "callKey: buffer expected"; + if (message.conversionSource != null && message.hasOwnProperty("conversionSource")) + if (!$util.isString(message.conversionSource)) + return "conversionSource: string expected"; + if (message.conversionData != null && message.hasOwnProperty("conversionData")) + if (!(message.conversionData && typeof message.conversionData.length === "number" || $util.isString(message.conversionData))) + return "conversionData: buffer expected"; + if (message.conversionDelaySeconds != null && message.hasOwnProperty("conversionDelaySeconds")) + if (!$util.isInteger(message.conversionDelaySeconds)) + return "conversionDelaySeconds: integer expected"; return null; }; /** - * Creates a StarAction message from a plain object. Also converts values to their respective internal types. + * Creates a Call message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof proto.StarAction + * @memberof proto.Call * @static * @param {Object.} object Plain object - * @returns {proto.StarAction} StarAction + * @returns {proto.Call} Call */ - StarAction.fromObject = function fromObject(object) { - if (object instanceof $root.proto.StarAction) + Call.fromObject = function fromObject(object) { + if (object instanceof $root.proto.Call) return object; - var message = new $root.proto.StarAction(); - if (object.starred != null) - message.starred = Boolean(object.starred); + var message = new $root.proto.Call(); + if (object.callKey != null) + if (typeof object.callKey === "string") + $util.base64.decode(object.callKey, message.callKey = $util.newBuffer($util.base64.length(object.callKey)), 0); + else if (object.callKey.length) + message.callKey = object.callKey; + if (object.conversionSource != null) + message.conversionSource = String(object.conversionSource); + if (object.conversionData != null) + if (typeof object.conversionData === "string") + $util.base64.decode(object.conversionData, message.conversionData = $util.newBuffer($util.base64.length(object.conversionData)), 0); + else if (object.conversionData.length) + message.conversionData = object.conversionData; + if (object.conversionDelaySeconds != null) + message.conversionDelaySeconds = object.conversionDelaySeconds >>> 0; return message; }; /** - * Creates a plain object from a StarAction message. Also converts values to other types if specified. + * Creates a plain object from a Call message. Also converts values to other types if specified. * @function toObject - * @memberof proto.StarAction + * @memberof proto.Call * @static - * @param {proto.StarAction} message StarAction + * @param {proto.Call} message Call * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - StarAction.toObject = function toObject(message, options) { + Call.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) - object.starred = false; - if (message.starred != null && message.hasOwnProperty("starred")) - object.starred = message.starred; + if (options.defaults) { + if (options.bytes === String) + object.callKey = ""; + else { + object.callKey = []; + if (options.bytes !== Array) + object.callKey = $util.newBuffer(object.callKey); + } + object.conversionSource = ""; + if (options.bytes === String) + object.conversionData = ""; + else { + object.conversionData = []; + if (options.bytes !== Array) + object.conversionData = $util.newBuffer(object.conversionData); + } + object.conversionDelaySeconds = 0; + } + if (message.callKey != null && message.hasOwnProperty("callKey")) + object.callKey = options.bytes === String ? $util.base64.encode(message.callKey, 0, message.callKey.length) : options.bytes === Array ? Array.prototype.slice.call(message.callKey) : message.callKey; + if (message.conversionSource != null && message.hasOwnProperty("conversionSource")) + object.conversionSource = message.conversionSource; + if (message.conversionData != null && message.hasOwnProperty("conversionData")) + object.conversionData = options.bytes === String ? $util.base64.encode(message.conversionData, 0, message.conversionData.length) : options.bytes === Array ? Array.prototype.slice.call(message.conversionData) : message.conversionData; + if (message.conversionDelaySeconds != null && message.hasOwnProperty("conversionDelaySeconds")) + object.conversionDelaySeconds = message.conversionDelaySeconds; return object; }; /** - * Converts this StarAction to JSON. + * Converts this Call to JSON. * @function toJSON - * @memberof proto.StarAction + * @memberof proto.Call * @instance * @returns {Object.} JSON object */ - StarAction.prototype.toJSON = function toJSON() { + Call.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return StarAction; + return Call; })(); - proto.ContactAction = (function() { + proto.CallButton = (function() { /** - * Properties of a ContactAction. + * Properties of a CallButton. * @memberof proto - * @interface IContactAction - * @property {string|null} [fullName] ContactAction fullName - * @property {string|null} [firstName] ContactAction firstName + * @interface ICallButton + * @property {proto.IHighlyStructuredMessage|null} [displayText] CallButton displayText + * @property {proto.IHighlyStructuredMessage|null} [phoneNumber] CallButton phoneNumber */ /** - * Constructs a new ContactAction. + * Constructs a new CallButton. * @memberof proto - * @classdesc Represents a ContactAction. - * @implements IContactAction + * @classdesc Represents a CallButton. + * @implements ICallButton * @constructor - * @param {proto.IContactAction=} [properties] Properties to set + * @param {proto.ICallButton=} [properties] Properties to set */ - function ContactAction(properties) { + function CallButton(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -7250,88 +6198,88 @@ $root.proto = (function() { } /** - * ContactAction fullName. - * @member {string} fullName - * @memberof proto.ContactAction + * CallButton displayText. + * @member {proto.IHighlyStructuredMessage|null|undefined} displayText + * @memberof proto.CallButton * @instance */ - ContactAction.prototype.fullName = ""; + CallButton.prototype.displayText = null; /** - * ContactAction firstName. - * @member {string} firstName - * @memberof proto.ContactAction + * CallButton phoneNumber. + * @member {proto.IHighlyStructuredMessage|null|undefined} phoneNumber + * @memberof proto.CallButton * @instance */ - ContactAction.prototype.firstName = ""; + CallButton.prototype.phoneNumber = null; /** - * Creates a new ContactAction instance using the specified properties. + * Creates a new CallButton instance using the specified properties. * @function create - * @memberof proto.ContactAction + * @memberof proto.CallButton * @static - * @param {proto.IContactAction=} [properties] Properties to set - * @returns {proto.ContactAction} ContactAction instance + * @param {proto.ICallButton=} [properties] Properties to set + * @returns {proto.CallButton} CallButton instance */ - ContactAction.create = function create(properties) { - return new ContactAction(properties); + CallButton.create = function create(properties) { + return new CallButton(properties); }; /** - * Encodes the specified ContactAction message. Does not implicitly {@link proto.ContactAction.verify|verify} messages. + * Encodes the specified CallButton message. Does not implicitly {@link proto.CallButton.verify|verify} messages. * @function encode - * @memberof proto.ContactAction + * @memberof proto.CallButton * @static - * @param {proto.IContactAction} message ContactAction message or plain object to encode + * @param {proto.ICallButton} message CallButton message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ContactAction.encode = function encode(message, writer) { + CallButton.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.fullName != null && Object.hasOwnProperty.call(message, "fullName")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.fullName); - if (message.firstName != null && Object.hasOwnProperty.call(message, "firstName")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.firstName); + if (message.displayText != null && Object.hasOwnProperty.call(message, "displayText")) + $root.proto.HighlyStructuredMessage.encode(message.displayText, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.phoneNumber != null && Object.hasOwnProperty.call(message, "phoneNumber")) + $root.proto.HighlyStructuredMessage.encode(message.phoneNumber, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** - * Encodes the specified ContactAction message, length delimited. Does not implicitly {@link proto.ContactAction.verify|verify} messages. + * Encodes the specified CallButton message, length delimited. Does not implicitly {@link proto.CallButton.verify|verify} messages. * @function encodeDelimited - * @memberof proto.ContactAction + * @memberof proto.CallButton * @static - * @param {proto.IContactAction} message ContactAction message or plain object to encode + * @param {proto.ICallButton} message CallButton message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ContactAction.encodeDelimited = function encodeDelimited(message, writer) { + CallButton.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ContactAction message from the specified reader or buffer. + * Decodes a CallButton message from the specified reader or buffer. * @function decode - * @memberof proto.ContactAction + * @memberof proto.CallButton * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {proto.ContactAction} ContactAction + * @returns {proto.CallButton} CallButton * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ContactAction.decode = function decode(reader, length) { + CallButton.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.ContactAction(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.CallButton(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.fullName = reader.string(); + message.displayText = $root.proto.HighlyStructuredMessage.decode(reader, reader.uint32()); break; case 2: - message.firstName = reader.string(); + message.phoneNumber = $root.proto.HighlyStructuredMessage.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -7342,117 +6290,126 @@ $root.proto = (function() { }; /** - * Decodes a ContactAction message from the specified reader or buffer, length delimited. + * Decodes a CallButton message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof proto.ContactAction + * @memberof proto.CallButton * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.ContactAction} ContactAction + * @returns {proto.CallButton} CallButton * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ContactAction.decodeDelimited = function decodeDelimited(reader) { + CallButton.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ContactAction message. + * Verifies a CallButton message. * @function verify - * @memberof proto.ContactAction + * @memberof proto.CallButton * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ContactAction.verify = function verify(message) { + CallButton.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.fullName != null && message.hasOwnProperty("fullName")) - if (!$util.isString(message.fullName)) - return "fullName: string expected"; - if (message.firstName != null && message.hasOwnProperty("firstName")) - if (!$util.isString(message.firstName)) - return "firstName: string expected"; + if (message.displayText != null && message.hasOwnProperty("displayText")) { + var error = $root.proto.HighlyStructuredMessage.verify(message.displayText); + if (error) + return "displayText." + error; + } + if (message.phoneNumber != null && message.hasOwnProperty("phoneNumber")) { + var error = $root.proto.HighlyStructuredMessage.verify(message.phoneNumber); + if (error) + return "phoneNumber." + error; + } return null; }; /** - * Creates a ContactAction message from a plain object. Also converts values to their respective internal types. + * Creates a CallButton message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof proto.ContactAction + * @memberof proto.CallButton * @static * @param {Object.} object Plain object - * @returns {proto.ContactAction} ContactAction + * @returns {proto.CallButton} CallButton */ - ContactAction.fromObject = function fromObject(object) { - if (object instanceof $root.proto.ContactAction) + CallButton.fromObject = function fromObject(object) { + if (object instanceof $root.proto.CallButton) return object; - var message = new $root.proto.ContactAction(); - if (object.fullName != null) - message.fullName = String(object.fullName); - if (object.firstName != null) - message.firstName = String(object.firstName); + var message = new $root.proto.CallButton(); + if (object.displayText != null) { + if (typeof object.displayText !== "object") + throw TypeError(".proto.CallButton.displayText: object expected"); + message.displayText = $root.proto.HighlyStructuredMessage.fromObject(object.displayText); + } + if (object.phoneNumber != null) { + if (typeof object.phoneNumber !== "object") + throw TypeError(".proto.CallButton.phoneNumber: object expected"); + message.phoneNumber = $root.proto.HighlyStructuredMessage.fromObject(object.phoneNumber); + } return message; }; /** - * Creates a plain object from a ContactAction message. Also converts values to other types if specified. + * Creates a plain object from a CallButton message. Also converts values to other types if specified. * @function toObject - * @memberof proto.ContactAction + * @memberof proto.CallButton * @static - * @param {proto.ContactAction} message ContactAction + * @param {proto.CallButton} message CallButton * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ContactAction.toObject = function toObject(message, options) { + CallButton.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.fullName = ""; - object.firstName = ""; + object.displayText = null; + object.phoneNumber = null; } - if (message.fullName != null && message.hasOwnProperty("fullName")) - object.fullName = message.fullName; - if (message.firstName != null && message.hasOwnProperty("firstName")) - object.firstName = message.firstName; + if (message.displayText != null && message.hasOwnProperty("displayText")) + object.displayText = $root.proto.HighlyStructuredMessage.toObject(message.displayText, options); + if (message.phoneNumber != null && message.hasOwnProperty("phoneNumber")) + object.phoneNumber = $root.proto.HighlyStructuredMessage.toObject(message.phoneNumber, options); return object; }; /** - * Converts this ContactAction to JSON. + * Converts this CallButton to JSON. * @function toJSON - * @memberof proto.ContactAction + * @memberof proto.CallButton * @instance * @returns {Object.} JSON object */ - ContactAction.prototype.toJSON = function toJSON() { + CallButton.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ContactAction; + return CallButton; })(); - proto.MuteAction = (function() { + proto.CancelPaymentRequestMessage = (function() { /** - * Properties of a MuteAction. + * Properties of a CancelPaymentRequestMessage. * @memberof proto - * @interface IMuteAction - * @property {boolean|null} [muted] MuteAction muted - * @property {number|Long|null} [muteEndTimestamp] MuteAction muteEndTimestamp + * @interface ICancelPaymentRequestMessage + * @property {proto.IMessageKey|null} [key] CancelPaymentRequestMessage key */ /** - * Constructs a new MuteAction. + * Constructs a new CancelPaymentRequestMessage. * @memberof proto - * @classdesc Represents a MuteAction. - * @implements IMuteAction + * @classdesc Represents a CancelPaymentRequestMessage. + * @implements ICancelPaymentRequestMessage * @constructor - * @param {proto.IMuteAction=} [properties] Properties to set + * @param {proto.ICancelPaymentRequestMessage=} [properties] Properties to set */ - function MuteAction(properties) { + function CancelPaymentRequestMessage(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -7460,88 +6417,75 @@ $root.proto = (function() { } /** - * MuteAction muted. - * @member {boolean} muted - * @memberof proto.MuteAction - * @instance - */ - MuteAction.prototype.muted = false; - - /** - * MuteAction muteEndTimestamp. - * @member {number|Long} muteEndTimestamp - * @memberof proto.MuteAction + * CancelPaymentRequestMessage key. + * @member {proto.IMessageKey|null|undefined} key + * @memberof proto.CancelPaymentRequestMessage * @instance */ - MuteAction.prototype.muteEndTimestamp = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + CancelPaymentRequestMessage.prototype.key = null; /** - * Creates a new MuteAction instance using the specified properties. + * Creates a new CancelPaymentRequestMessage instance using the specified properties. * @function create - * @memberof proto.MuteAction + * @memberof proto.CancelPaymentRequestMessage * @static - * @param {proto.IMuteAction=} [properties] Properties to set - * @returns {proto.MuteAction} MuteAction instance + * @param {proto.ICancelPaymentRequestMessage=} [properties] Properties to set + * @returns {proto.CancelPaymentRequestMessage} CancelPaymentRequestMessage instance */ - MuteAction.create = function create(properties) { - return new MuteAction(properties); + CancelPaymentRequestMessage.create = function create(properties) { + return new CancelPaymentRequestMessage(properties); }; /** - * Encodes the specified MuteAction message. Does not implicitly {@link proto.MuteAction.verify|verify} messages. + * Encodes the specified CancelPaymentRequestMessage message. Does not implicitly {@link proto.CancelPaymentRequestMessage.verify|verify} messages. * @function encode - * @memberof proto.MuteAction + * @memberof proto.CancelPaymentRequestMessage * @static - * @param {proto.IMuteAction} message MuteAction message or plain object to encode + * @param {proto.ICancelPaymentRequestMessage} message CancelPaymentRequestMessage message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - MuteAction.encode = function encode(message, writer) { + CancelPaymentRequestMessage.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.muted != null && Object.hasOwnProperty.call(message, "muted")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.muted); - if (message.muteEndTimestamp != null && Object.hasOwnProperty.call(message, "muteEndTimestamp")) - writer.uint32(/* id 2, wireType 0 =*/16).int64(message.muteEndTimestamp); + if (message.key != null && Object.hasOwnProperty.call(message, "key")) + $root.proto.MessageKey.encode(message.key, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; /** - * Encodes the specified MuteAction message, length delimited. Does not implicitly {@link proto.MuteAction.verify|verify} messages. + * Encodes the specified CancelPaymentRequestMessage message, length delimited. Does not implicitly {@link proto.CancelPaymentRequestMessage.verify|verify} messages. * @function encodeDelimited - * @memberof proto.MuteAction + * @memberof proto.CancelPaymentRequestMessage * @static - * @param {proto.IMuteAction} message MuteAction message or plain object to encode + * @param {proto.ICancelPaymentRequestMessage} message CancelPaymentRequestMessage message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - MuteAction.encodeDelimited = function encodeDelimited(message, writer) { + CancelPaymentRequestMessage.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a MuteAction message from the specified reader or buffer. + * Decodes a CancelPaymentRequestMessage message from the specified reader or buffer. * @function decode - * @memberof proto.MuteAction + * @memberof proto.CancelPaymentRequestMessage * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {proto.MuteAction} MuteAction + * @returns {proto.CancelPaymentRequestMessage} CancelPaymentRequestMessage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - MuteAction.decode = function decode(reader, length) { + CancelPaymentRequestMessage.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.MuteAction(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.CancelPaymentRequestMessage(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.muted = reader.bool(); - break; - case 2: - message.muteEndTimestamp = reader.int64(); + message.key = $root.proto.MessageKey.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -7552,130 +6496,114 @@ $root.proto = (function() { }; /** - * Decodes a MuteAction message from the specified reader or buffer, length delimited. + * Decodes a CancelPaymentRequestMessage message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof proto.MuteAction + * @memberof proto.CancelPaymentRequestMessage * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.MuteAction} MuteAction + * @returns {proto.CancelPaymentRequestMessage} CancelPaymentRequestMessage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - MuteAction.decodeDelimited = function decodeDelimited(reader) { + CancelPaymentRequestMessage.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a MuteAction message. + * Verifies a CancelPaymentRequestMessage message. * @function verify - * @memberof proto.MuteAction + * @memberof proto.CancelPaymentRequestMessage * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - MuteAction.verify = function verify(message) { + CancelPaymentRequestMessage.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.muted != null && message.hasOwnProperty("muted")) - if (typeof message.muted !== "boolean") - return "muted: boolean expected"; - if (message.muteEndTimestamp != null && message.hasOwnProperty("muteEndTimestamp")) - if (!$util.isInteger(message.muteEndTimestamp) && !(message.muteEndTimestamp && $util.isInteger(message.muteEndTimestamp.low) && $util.isInteger(message.muteEndTimestamp.high))) - return "muteEndTimestamp: integer|Long expected"; + if (message.key != null && message.hasOwnProperty("key")) { + var error = $root.proto.MessageKey.verify(message.key); + if (error) + return "key." + error; + } return null; }; /** - * Creates a MuteAction message from a plain object. Also converts values to their respective internal types. + * Creates a CancelPaymentRequestMessage message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof proto.MuteAction + * @memberof proto.CancelPaymentRequestMessage * @static * @param {Object.} object Plain object - * @returns {proto.MuteAction} MuteAction + * @returns {proto.CancelPaymentRequestMessage} CancelPaymentRequestMessage */ - MuteAction.fromObject = function fromObject(object) { - if (object instanceof $root.proto.MuteAction) + CancelPaymentRequestMessage.fromObject = function fromObject(object) { + if (object instanceof $root.proto.CancelPaymentRequestMessage) return object; - var message = new $root.proto.MuteAction(); - if (object.muted != null) - message.muted = Boolean(object.muted); - if (object.muteEndTimestamp != null) - if ($util.Long) - (message.muteEndTimestamp = $util.Long.fromValue(object.muteEndTimestamp)).unsigned = false; - else if (typeof object.muteEndTimestamp === "string") - message.muteEndTimestamp = parseInt(object.muteEndTimestamp, 10); - else if (typeof object.muteEndTimestamp === "number") - message.muteEndTimestamp = object.muteEndTimestamp; - else if (typeof object.muteEndTimestamp === "object") - message.muteEndTimestamp = new $util.LongBits(object.muteEndTimestamp.low >>> 0, object.muteEndTimestamp.high >>> 0).toNumber(); + var message = new $root.proto.CancelPaymentRequestMessage(); + if (object.key != null) { + if (typeof object.key !== "object") + throw TypeError(".proto.CancelPaymentRequestMessage.key: object expected"); + message.key = $root.proto.MessageKey.fromObject(object.key); + } return message; }; /** - * Creates a plain object from a MuteAction message. Also converts values to other types if specified. + * Creates a plain object from a CancelPaymentRequestMessage message. Also converts values to other types if specified. * @function toObject - * @memberof proto.MuteAction + * @memberof proto.CancelPaymentRequestMessage * @static - * @param {proto.MuteAction} message MuteAction + * @param {proto.CancelPaymentRequestMessage} message CancelPaymentRequestMessage * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - MuteAction.toObject = function toObject(message, options) { + CancelPaymentRequestMessage.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.muted = false; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.muteEndTimestamp = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.muteEndTimestamp = options.longs === String ? "0" : 0; - } - if (message.muted != null && message.hasOwnProperty("muted")) - object.muted = message.muted; - if (message.muteEndTimestamp != null && message.hasOwnProperty("muteEndTimestamp")) - if (typeof message.muteEndTimestamp === "number") - object.muteEndTimestamp = options.longs === String ? String(message.muteEndTimestamp) : message.muteEndTimestamp; - else - object.muteEndTimestamp = options.longs === String ? $util.Long.prototype.toString.call(message.muteEndTimestamp) : options.longs === Number ? new $util.LongBits(message.muteEndTimestamp.low >>> 0, message.muteEndTimestamp.high >>> 0).toNumber() : message.muteEndTimestamp; + if (options.defaults) + object.key = null; + if (message.key != null && message.hasOwnProperty("key")) + object.key = $root.proto.MessageKey.toObject(message.key, options); return object; }; /** - * Converts this MuteAction to JSON. + * Converts this CancelPaymentRequestMessage to JSON. * @function toJSON - * @memberof proto.MuteAction + * @memberof proto.CancelPaymentRequestMessage * @instance * @returns {Object.} JSON object */ - MuteAction.prototype.toJSON = function toJSON() { + CancelPaymentRequestMessage.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return MuteAction; + return CancelPaymentRequestMessage; })(); - proto.PinAction = (function() { + proto.CatalogSnapshot = (function() { /** - * Properties of a PinAction. + * Properties of a CatalogSnapshot. * @memberof proto - * @interface IPinAction - * @property {boolean|null} [pinned] PinAction pinned + * @interface ICatalogSnapshot + * @property {proto.IImageMessage|null} [catalogImage] CatalogSnapshot catalogImage + * @property {string|null} [title] CatalogSnapshot title + * @property {string|null} [description] CatalogSnapshot description */ /** - * Constructs a new PinAction. + * Constructs a new CatalogSnapshot. * @memberof proto - * @classdesc Represents a PinAction. - * @implements IPinAction + * @classdesc Represents a CatalogSnapshot. + * @implements ICatalogSnapshot * @constructor - * @param {proto.IPinAction=} [properties] Properties to set + * @param {proto.ICatalogSnapshot=} [properties] Properties to set */ - function PinAction(properties) { + function CatalogSnapshot(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -7683,75 +6611,101 @@ $root.proto = (function() { } /** - * PinAction pinned. - * @member {boolean} pinned - * @memberof proto.PinAction + * CatalogSnapshot catalogImage. + * @member {proto.IImageMessage|null|undefined} catalogImage + * @memberof proto.CatalogSnapshot * @instance */ - PinAction.prototype.pinned = false; + CatalogSnapshot.prototype.catalogImage = null; /** - * Creates a new PinAction instance using the specified properties. + * CatalogSnapshot title. + * @member {string} title + * @memberof proto.CatalogSnapshot + * @instance + */ + CatalogSnapshot.prototype.title = ""; + + /** + * CatalogSnapshot description. + * @member {string} description + * @memberof proto.CatalogSnapshot + * @instance + */ + CatalogSnapshot.prototype.description = ""; + + /** + * Creates a new CatalogSnapshot instance using the specified properties. * @function create - * @memberof proto.PinAction + * @memberof proto.CatalogSnapshot * @static - * @param {proto.IPinAction=} [properties] Properties to set - * @returns {proto.PinAction} PinAction instance + * @param {proto.ICatalogSnapshot=} [properties] Properties to set + * @returns {proto.CatalogSnapshot} CatalogSnapshot instance */ - PinAction.create = function create(properties) { - return new PinAction(properties); + CatalogSnapshot.create = function create(properties) { + return new CatalogSnapshot(properties); }; /** - * Encodes the specified PinAction message. Does not implicitly {@link proto.PinAction.verify|verify} messages. + * Encodes the specified CatalogSnapshot message. Does not implicitly {@link proto.CatalogSnapshot.verify|verify} messages. * @function encode - * @memberof proto.PinAction + * @memberof proto.CatalogSnapshot * @static - * @param {proto.IPinAction} message PinAction message or plain object to encode + * @param {proto.ICatalogSnapshot} message CatalogSnapshot message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PinAction.encode = function encode(message, writer) { + CatalogSnapshot.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.pinned != null && Object.hasOwnProperty.call(message, "pinned")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.pinned); + if (message.catalogImage != null && Object.hasOwnProperty.call(message, "catalogImage")) + $root.proto.ImageMessage.encode(message.catalogImage, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.title != null && Object.hasOwnProperty.call(message, "title")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.title); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); return writer; }; /** - * Encodes the specified PinAction message, length delimited. Does not implicitly {@link proto.PinAction.verify|verify} messages. + * Encodes the specified CatalogSnapshot message, length delimited. Does not implicitly {@link proto.CatalogSnapshot.verify|verify} messages. * @function encodeDelimited - * @memberof proto.PinAction + * @memberof proto.CatalogSnapshot * @static - * @param {proto.IPinAction} message PinAction message or plain object to encode + * @param {proto.ICatalogSnapshot} message CatalogSnapshot message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PinAction.encodeDelimited = function encodeDelimited(message, writer) { + CatalogSnapshot.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a PinAction message from the specified reader or buffer. + * Decodes a CatalogSnapshot message from the specified reader or buffer. * @function decode - * @memberof proto.PinAction + * @memberof proto.CatalogSnapshot * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {proto.PinAction} PinAction + * @returns {proto.CatalogSnapshot} CatalogSnapshot * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - PinAction.decode = function decode(reader, length) { + CatalogSnapshot.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.PinAction(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.CatalogSnapshot(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.pinned = reader.bool(); + message.catalogImage = $root.proto.ImageMessage.decode(reader, reader.uint32()); + break; + case 2: + message.title = reader.string(); + break; + case 3: + message.description = reader.string(); break; default: reader.skipType(tag & 7); @@ -7762,107 +6716,130 @@ $root.proto = (function() { }; /** - * Decodes a PinAction message from the specified reader or buffer, length delimited. + * Decodes a CatalogSnapshot message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof proto.PinAction + * @memberof proto.CatalogSnapshot * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.PinAction} PinAction + * @returns {proto.CatalogSnapshot} CatalogSnapshot * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - PinAction.decodeDelimited = function decodeDelimited(reader) { + CatalogSnapshot.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a PinAction message. + * Verifies a CatalogSnapshot message. * @function verify - * @memberof proto.PinAction + * @memberof proto.CatalogSnapshot * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - PinAction.verify = function verify(message) { + CatalogSnapshot.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.pinned != null && message.hasOwnProperty("pinned")) - if (typeof message.pinned !== "boolean") - return "pinned: boolean expected"; + if (message.catalogImage != null && message.hasOwnProperty("catalogImage")) { + var error = $root.proto.ImageMessage.verify(message.catalogImage); + if (error) + return "catalogImage." + error; + } + if (message.title != null && message.hasOwnProperty("title")) + if (!$util.isString(message.title)) + return "title: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; return null; }; /** - * Creates a PinAction message from a plain object. Also converts values to their respective internal types. + * Creates a CatalogSnapshot message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof proto.PinAction + * @memberof proto.CatalogSnapshot * @static * @param {Object.} object Plain object - * @returns {proto.PinAction} PinAction + * @returns {proto.CatalogSnapshot} CatalogSnapshot */ - PinAction.fromObject = function fromObject(object) { - if (object instanceof $root.proto.PinAction) + CatalogSnapshot.fromObject = function fromObject(object) { + if (object instanceof $root.proto.CatalogSnapshot) return object; - var message = new $root.proto.PinAction(); - if (object.pinned != null) - message.pinned = Boolean(object.pinned); + var message = new $root.proto.CatalogSnapshot(); + if (object.catalogImage != null) { + if (typeof object.catalogImage !== "object") + throw TypeError(".proto.CatalogSnapshot.catalogImage: object expected"); + message.catalogImage = $root.proto.ImageMessage.fromObject(object.catalogImage); + } + if (object.title != null) + message.title = String(object.title); + if (object.description != null) + message.description = String(object.description); return message; }; /** - * Creates a plain object from a PinAction message. Also converts values to other types if specified. + * Creates a plain object from a CatalogSnapshot message. Also converts values to other types if specified. * @function toObject - * @memberof proto.PinAction + * @memberof proto.CatalogSnapshot * @static - * @param {proto.PinAction} message PinAction + * @param {proto.CatalogSnapshot} message CatalogSnapshot * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - PinAction.toObject = function toObject(message, options) { + CatalogSnapshot.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) - object.pinned = false; - if (message.pinned != null && message.hasOwnProperty("pinned")) - object.pinned = message.pinned; - return object; - }; - - /** - * Converts this PinAction to JSON. + if (options.defaults) { + object.catalogImage = null; + object.title = ""; + object.description = ""; + } + if (message.catalogImage != null && message.hasOwnProperty("catalogImage")) + object.catalogImage = $root.proto.ImageMessage.toObject(message.catalogImage, options); + if (message.title != null && message.hasOwnProperty("title")) + object.title = message.title; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + return object; + }; + + /** + * Converts this CatalogSnapshot to JSON. * @function toJSON - * @memberof proto.PinAction + * @memberof proto.CatalogSnapshot * @instance * @returns {Object.} JSON object */ - PinAction.prototype.toJSON = function toJSON() { + CatalogSnapshot.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return PinAction; + return CatalogSnapshot; })(); - proto.SecurityNotificationSetting = (function() { + proto.Chat = (function() { /** - * Properties of a SecurityNotificationSetting. + * Properties of a Chat. * @memberof proto - * @interface ISecurityNotificationSetting - * @property {boolean|null} [showNotification] SecurityNotificationSetting showNotification + * @interface IChat + * @property {string|null} [displayName] Chat displayName + * @property {string|null} [id] Chat id */ /** - * Constructs a new SecurityNotificationSetting. + * Constructs a new Chat. * @memberof proto - * @classdesc Represents a SecurityNotificationSetting. - * @implements ISecurityNotificationSetting + * @classdesc Represents a Chat. + * @implements IChat * @constructor - * @param {proto.ISecurityNotificationSetting=} [properties] Properties to set + * @param {proto.IChat=} [properties] Properties to set */ - function SecurityNotificationSetting(properties) { + function Chat(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -7870,75 +6847,88 @@ $root.proto = (function() { } /** - * SecurityNotificationSetting showNotification. - * @member {boolean} showNotification - * @memberof proto.SecurityNotificationSetting + * Chat displayName. + * @member {string} displayName + * @memberof proto.Chat * @instance */ - SecurityNotificationSetting.prototype.showNotification = false; + Chat.prototype.displayName = ""; /** - * Creates a new SecurityNotificationSetting instance using the specified properties. + * Chat id. + * @member {string} id + * @memberof proto.Chat + * @instance + */ + Chat.prototype.id = ""; + + /** + * Creates a new Chat instance using the specified properties. * @function create - * @memberof proto.SecurityNotificationSetting + * @memberof proto.Chat * @static - * @param {proto.ISecurityNotificationSetting=} [properties] Properties to set - * @returns {proto.SecurityNotificationSetting} SecurityNotificationSetting instance + * @param {proto.IChat=} [properties] Properties to set + * @returns {proto.Chat} Chat instance */ - SecurityNotificationSetting.create = function create(properties) { - return new SecurityNotificationSetting(properties); + Chat.create = function create(properties) { + return new Chat(properties); }; /** - * Encodes the specified SecurityNotificationSetting message. Does not implicitly {@link proto.SecurityNotificationSetting.verify|verify} messages. + * Encodes the specified Chat message. Does not implicitly {@link proto.Chat.verify|verify} messages. * @function encode - * @memberof proto.SecurityNotificationSetting + * @memberof proto.Chat * @static - * @param {proto.ISecurityNotificationSetting} message SecurityNotificationSetting message or plain object to encode + * @param {proto.IChat} message Chat message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SecurityNotificationSetting.encode = function encode(message, writer) { + Chat.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.showNotification != null && Object.hasOwnProperty.call(message, "showNotification")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.showNotification); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.displayName); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.id); return writer; }; /** - * Encodes the specified SecurityNotificationSetting message, length delimited. Does not implicitly {@link proto.SecurityNotificationSetting.verify|verify} messages. + * Encodes the specified Chat message, length delimited. Does not implicitly {@link proto.Chat.verify|verify} messages. * @function encodeDelimited - * @memberof proto.SecurityNotificationSetting + * @memberof proto.Chat * @static - * @param {proto.ISecurityNotificationSetting} message SecurityNotificationSetting message or plain object to encode + * @param {proto.IChat} message Chat message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SecurityNotificationSetting.encodeDelimited = function encodeDelimited(message, writer) { + Chat.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a SecurityNotificationSetting message from the specified reader or buffer. + * Decodes a Chat message from the specified reader or buffer. * @function decode - * @memberof proto.SecurityNotificationSetting + * @memberof proto.Chat * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {proto.SecurityNotificationSetting} SecurityNotificationSetting + * @returns {proto.Chat} Chat * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SecurityNotificationSetting.decode = function decode(reader, length) { + Chat.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.SecurityNotificationSetting(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.Chat(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.showNotification = reader.bool(); + message.displayName = reader.string(); + break; + case 2: + message.id = reader.string(); break; default: reader.skipType(tag & 7); @@ -7949,107 +6939,118 @@ $root.proto = (function() { }; /** - * Decodes a SecurityNotificationSetting message from the specified reader or buffer, length delimited. + * Decodes a Chat message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof proto.SecurityNotificationSetting + * @memberof proto.Chat * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.SecurityNotificationSetting} SecurityNotificationSetting + * @returns {proto.Chat} Chat * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SecurityNotificationSetting.decodeDelimited = function decodeDelimited(reader) { + Chat.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a SecurityNotificationSetting message. + * Verifies a Chat message. * @function verify - * @memberof proto.SecurityNotificationSetting + * @memberof proto.Chat * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - SecurityNotificationSetting.verify = function verify(message) { + Chat.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.showNotification != null && message.hasOwnProperty("showNotification")) - if (typeof message.showNotification !== "boolean") - return "showNotification: boolean expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.id != null && message.hasOwnProperty("id")) + if (!$util.isString(message.id)) + return "id: string expected"; return null; }; /** - * Creates a SecurityNotificationSetting message from a plain object. Also converts values to their respective internal types. + * Creates a Chat message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof proto.SecurityNotificationSetting + * @memberof proto.Chat * @static * @param {Object.} object Plain object - * @returns {proto.SecurityNotificationSetting} SecurityNotificationSetting + * @returns {proto.Chat} Chat */ - SecurityNotificationSetting.fromObject = function fromObject(object) { - if (object instanceof $root.proto.SecurityNotificationSetting) + Chat.fromObject = function fromObject(object) { + if (object instanceof $root.proto.Chat) return object; - var message = new $root.proto.SecurityNotificationSetting(); - if (object.showNotification != null) - message.showNotification = Boolean(object.showNotification); + var message = new $root.proto.Chat(); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.id != null) + message.id = String(object.id); return message; }; /** - * Creates a plain object from a SecurityNotificationSetting message. Also converts values to other types if specified. + * Creates a plain object from a Chat message. Also converts values to other types if specified. * @function toObject - * @memberof proto.SecurityNotificationSetting + * @memberof proto.Chat * @static - * @param {proto.SecurityNotificationSetting} message SecurityNotificationSetting + * @param {proto.Chat} message Chat * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SecurityNotificationSetting.toObject = function toObject(message, options) { + Chat.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) - object.showNotification = false; - if (message.showNotification != null && message.hasOwnProperty("showNotification")) - object.showNotification = message.showNotification; + if (options.defaults) { + object.displayName = ""; + object.id = ""; + } + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; return object; }; /** - * Converts this SecurityNotificationSetting to JSON. + * Converts this Chat to JSON. * @function toJSON - * @memberof proto.SecurityNotificationSetting + * @memberof proto.Chat * @instance * @returns {Object.} JSON object */ - SecurityNotificationSetting.prototype.toJSON = function toJSON() { + Chat.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return SecurityNotificationSetting; + return Chat; })(); - proto.PushNameSetting = (function() { + proto.CollectionMessage = (function() { /** - * Properties of a PushNameSetting. + * Properties of a CollectionMessage. * @memberof proto - * @interface IPushNameSetting - * @property {string|null} [name] PushNameSetting name + * @interface ICollectionMessage + * @property {string|null} [bizJid] CollectionMessage bizJid + * @property {string|null} [id] CollectionMessage id + * @property {number|null} [messageVersion] CollectionMessage messageVersion */ /** - * Constructs a new PushNameSetting. + * Constructs a new CollectionMessage. * @memberof proto - * @classdesc Represents a PushNameSetting. - * @implements IPushNameSetting + * @classdesc Represents a CollectionMessage. + * @implements ICollectionMessage * @constructor - * @param {proto.IPushNameSetting=} [properties] Properties to set + * @param {proto.ICollectionMessage=} [properties] Properties to set */ - function PushNameSetting(properties) { + function CollectionMessage(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -8057,75 +7058,101 @@ $root.proto = (function() { } /** - * PushNameSetting name. - * @member {string} name - * @memberof proto.PushNameSetting + * CollectionMessage bizJid. + * @member {string} bizJid + * @memberof proto.CollectionMessage * @instance */ - PushNameSetting.prototype.name = ""; + CollectionMessage.prototype.bizJid = ""; /** - * Creates a new PushNameSetting instance using the specified properties. + * CollectionMessage id. + * @member {string} id + * @memberof proto.CollectionMessage + * @instance + */ + CollectionMessage.prototype.id = ""; + + /** + * CollectionMessage messageVersion. + * @member {number} messageVersion + * @memberof proto.CollectionMessage + * @instance + */ + CollectionMessage.prototype.messageVersion = 0; + + /** + * Creates a new CollectionMessage instance using the specified properties. * @function create - * @memberof proto.PushNameSetting + * @memberof proto.CollectionMessage * @static - * @param {proto.IPushNameSetting=} [properties] Properties to set - * @returns {proto.PushNameSetting} PushNameSetting instance + * @param {proto.ICollectionMessage=} [properties] Properties to set + * @returns {proto.CollectionMessage} CollectionMessage instance */ - PushNameSetting.create = function create(properties) { - return new PushNameSetting(properties); + CollectionMessage.create = function create(properties) { + return new CollectionMessage(properties); }; /** - * Encodes the specified PushNameSetting message. Does not implicitly {@link proto.PushNameSetting.verify|verify} messages. + * Encodes the specified CollectionMessage message. Does not implicitly {@link proto.CollectionMessage.verify|verify} messages. * @function encode - * @memberof proto.PushNameSetting + * @memberof proto.CollectionMessage * @static - * @param {proto.IPushNameSetting} message PushNameSetting message or plain object to encode + * @param {proto.ICollectionMessage} message CollectionMessage message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PushNameSetting.encode = function encode(message, writer) { + CollectionMessage.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.bizJid != null && Object.hasOwnProperty.call(message, "bizJid")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.bizJid); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.id); + if (message.messageVersion != null && Object.hasOwnProperty.call(message, "messageVersion")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.messageVersion); return writer; }; /** - * Encodes the specified PushNameSetting message, length delimited. Does not implicitly {@link proto.PushNameSetting.verify|verify} messages. + * Encodes the specified CollectionMessage message, length delimited. Does not implicitly {@link proto.CollectionMessage.verify|verify} messages. * @function encodeDelimited - * @memberof proto.PushNameSetting + * @memberof proto.CollectionMessage * @static - * @param {proto.IPushNameSetting} message PushNameSetting message or plain object to encode + * @param {proto.ICollectionMessage} message CollectionMessage message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PushNameSetting.encodeDelimited = function encodeDelimited(message, writer) { + CollectionMessage.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a PushNameSetting message from the specified reader or buffer. + * Decodes a CollectionMessage message from the specified reader or buffer. * @function decode - * @memberof proto.PushNameSetting + * @memberof proto.CollectionMessage * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {proto.PushNameSetting} PushNameSetting + * @returns {proto.CollectionMessage} CollectionMessage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - PushNameSetting.decode = function decode(reader, length) { + CollectionMessage.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.PushNameSetting(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.CollectionMessage(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.name = reader.string(); + message.bizJid = reader.string(); + break; + case 2: + message.id = reader.string(); + break; + case 3: + message.messageVersion = reader.int32(); break; default: reader.skipType(tag & 7); @@ -8136,107 +7163,126 @@ $root.proto = (function() { }; /** - * Decodes a PushNameSetting message from the specified reader or buffer, length delimited. + * Decodes a CollectionMessage message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof proto.PushNameSetting + * @memberof proto.CollectionMessage * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.PushNameSetting} PushNameSetting + * @returns {proto.CollectionMessage} CollectionMessage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - PushNameSetting.decodeDelimited = function decodeDelimited(reader) { + CollectionMessage.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a PushNameSetting message. + * Verifies a CollectionMessage message. * @function verify - * @memberof proto.PushNameSetting + * @memberof proto.CollectionMessage * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - PushNameSetting.verify = function verify(message) { + CollectionMessage.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; + if (message.bizJid != null && message.hasOwnProperty("bizJid")) + if (!$util.isString(message.bizJid)) + return "bizJid: string expected"; + if (message.id != null && message.hasOwnProperty("id")) + if (!$util.isString(message.id)) + return "id: string expected"; + if (message.messageVersion != null && message.hasOwnProperty("messageVersion")) + if (!$util.isInteger(message.messageVersion)) + return "messageVersion: integer expected"; return null; }; /** - * Creates a PushNameSetting message from a plain object. Also converts values to their respective internal types. + * Creates a CollectionMessage message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof proto.PushNameSetting + * @memberof proto.CollectionMessage * @static * @param {Object.} object Plain object - * @returns {proto.PushNameSetting} PushNameSetting + * @returns {proto.CollectionMessage} CollectionMessage */ - PushNameSetting.fromObject = function fromObject(object) { - if (object instanceof $root.proto.PushNameSetting) + CollectionMessage.fromObject = function fromObject(object) { + if (object instanceof $root.proto.CollectionMessage) return object; - var message = new $root.proto.PushNameSetting(); - if (object.name != null) - message.name = String(object.name); + var message = new $root.proto.CollectionMessage(); + if (object.bizJid != null) + message.bizJid = String(object.bizJid); + if (object.id != null) + message.id = String(object.id); + if (object.messageVersion != null) + message.messageVersion = object.messageVersion | 0; return message; }; /** - * Creates a plain object from a PushNameSetting message. Also converts values to other types if specified. + * Creates a plain object from a CollectionMessage message. Also converts values to other types if specified. * @function toObject - * @memberof proto.PushNameSetting + * @memberof proto.CollectionMessage * @static - * @param {proto.PushNameSetting} message PushNameSetting + * @param {proto.CollectionMessage} message CollectionMessage * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - PushNameSetting.toObject = function toObject(message, options) { + CollectionMessage.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) - object.name = ""; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; + if (options.defaults) { + object.bizJid = ""; + object.id = ""; + object.messageVersion = 0; + } + if (message.bizJid != null && message.hasOwnProperty("bizJid")) + object.bizJid = message.bizJid; + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; + if (message.messageVersion != null && message.hasOwnProperty("messageVersion")) + object.messageVersion = message.messageVersion; return object; }; /** - * Converts this PushNameSetting to JSON. + * Converts this CollectionMessage to JSON. * @function toJSON - * @memberof proto.PushNameSetting + * @memberof proto.CollectionMessage * @instance * @returns {Object.} JSON object */ - PushNameSetting.prototype.toJSON = function toJSON() { + CollectionMessage.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return PushNameSetting; + return CollectionMessage; })(); - proto.LocaleSetting = (function() { + proto.ContactMessage = (function() { /** - * Properties of a LocaleSetting. + * Properties of a ContactMessage. * @memberof proto - * @interface ILocaleSetting - * @property {string|null} [locale] LocaleSetting locale + * @interface IContactMessage + * @property {string|null} [displayName] ContactMessage displayName + * @property {string|null} [vcard] ContactMessage vcard + * @property {proto.IContextInfo|null} [contextInfo] ContactMessage contextInfo */ /** - * Constructs a new LocaleSetting. + * Constructs a new ContactMessage. * @memberof proto - * @classdesc Represents a LocaleSetting. - * @implements ILocaleSetting + * @classdesc Represents a ContactMessage. + * @implements IContactMessage * @constructor - * @param {proto.ILocaleSetting=} [properties] Properties to set + * @param {proto.IContactMessage=} [properties] Properties to set */ - function LocaleSetting(properties) { + function ContactMessage(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -8244,75 +7290,101 @@ $root.proto = (function() { } /** - * LocaleSetting locale. - * @member {string} locale - * @memberof proto.LocaleSetting + * ContactMessage displayName. + * @member {string} displayName + * @memberof proto.ContactMessage * @instance */ - LocaleSetting.prototype.locale = ""; + ContactMessage.prototype.displayName = ""; /** - * Creates a new LocaleSetting instance using the specified properties. + * ContactMessage vcard. + * @member {string} vcard + * @memberof proto.ContactMessage + * @instance + */ + ContactMessage.prototype.vcard = ""; + + /** + * ContactMessage contextInfo. + * @member {proto.IContextInfo|null|undefined} contextInfo + * @memberof proto.ContactMessage + * @instance + */ + ContactMessage.prototype.contextInfo = null; + + /** + * Creates a new ContactMessage instance using the specified properties. * @function create - * @memberof proto.LocaleSetting + * @memberof proto.ContactMessage * @static - * @param {proto.ILocaleSetting=} [properties] Properties to set - * @returns {proto.LocaleSetting} LocaleSetting instance + * @param {proto.IContactMessage=} [properties] Properties to set + * @returns {proto.ContactMessage} ContactMessage instance */ - LocaleSetting.create = function create(properties) { - return new LocaleSetting(properties); + ContactMessage.create = function create(properties) { + return new ContactMessage(properties); }; /** - * Encodes the specified LocaleSetting message. Does not implicitly {@link proto.LocaleSetting.verify|verify} messages. + * Encodes the specified ContactMessage message. Does not implicitly {@link proto.ContactMessage.verify|verify} messages. * @function encode - * @memberof proto.LocaleSetting + * @memberof proto.ContactMessage * @static - * @param {proto.ILocaleSetting} message LocaleSetting message or plain object to encode + * @param {proto.IContactMessage} message ContactMessage message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - LocaleSetting.encode = function encode(message, writer) { + ContactMessage.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.locale != null && Object.hasOwnProperty.call(message, "locale")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.locale); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.displayName); + if (message.vcard != null && Object.hasOwnProperty.call(message, "vcard")) + writer.uint32(/* id 16, wireType 2 =*/130).string(message.vcard); + if (message.contextInfo != null && Object.hasOwnProperty.call(message, "contextInfo")) + $root.proto.ContextInfo.encode(message.contextInfo, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); return writer; }; /** - * Encodes the specified LocaleSetting message, length delimited. Does not implicitly {@link proto.LocaleSetting.verify|verify} messages. + * Encodes the specified ContactMessage message, length delimited. Does not implicitly {@link proto.ContactMessage.verify|verify} messages. * @function encodeDelimited - * @memberof proto.LocaleSetting + * @memberof proto.ContactMessage * @static - * @param {proto.ILocaleSetting} message LocaleSetting message or plain object to encode + * @param {proto.IContactMessage} message ContactMessage message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - LocaleSetting.encodeDelimited = function encodeDelimited(message, writer) { + ContactMessage.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a LocaleSetting message from the specified reader or buffer. + * Decodes a ContactMessage message from the specified reader or buffer. * @function decode - * @memberof proto.LocaleSetting + * @memberof proto.ContactMessage * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {proto.LocaleSetting} LocaleSetting + * @returns {proto.ContactMessage} ContactMessage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - LocaleSetting.decode = function decode(reader, length) { + ContactMessage.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.LocaleSetting(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.ContactMessage(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.locale = reader.string(); + message.displayName = reader.string(); + break; + case 16: + message.vcard = reader.string(); + break; + case 17: + message.contextInfo = $root.proto.ContextInfo.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -8323,112 +7395,132 @@ $root.proto = (function() { }; /** - * Decodes a LocaleSetting message from the specified reader or buffer, length delimited. + * Decodes a ContactMessage message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof proto.LocaleSetting + * @memberof proto.ContactMessage * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.LocaleSetting} LocaleSetting + * @returns {proto.ContactMessage} ContactMessage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - LocaleSetting.decodeDelimited = function decodeDelimited(reader) { + ContactMessage.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a LocaleSetting message. + * Verifies a ContactMessage message. * @function verify - * @memberof proto.LocaleSetting + * @memberof proto.ContactMessage * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - LocaleSetting.verify = function verify(message) { + ContactMessage.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.locale != null && message.hasOwnProperty("locale")) - if (!$util.isString(message.locale)) - return "locale: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.vcard != null && message.hasOwnProperty("vcard")) + if (!$util.isString(message.vcard)) + return "vcard: string expected"; + if (message.contextInfo != null && message.hasOwnProperty("contextInfo")) { + var error = $root.proto.ContextInfo.verify(message.contextInfo); + if (error) + return "contextInfo." + error; + } return null; }; /** - * Creates a LocaleSetting message from a plain object. Also converts values to their respective internal types. + * Creates a ContactMessage message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof proto.LocaleSetting + * @memberof proto.ContactMessage * @static * @param {Object.} object Plain object - * @returns {proto.LocaleSetting} LocaleSetting + * @returns {proto.ContactMessage} ContactMessage */ - LocaleSetting.fromObject = function fromObject(object) { - if (object instanceof $root.proto.LocaleSetting) + ContactMessage.fromObject = function fromObject(object) { + if (object instanceof $root.proto.ContactMessage) return object; - var message = new $root.proto.LocaleSetting(); - if (object.locale != null) - message.locale = String(object.locale); + var message = new $root.proto.ContactMessage(); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.vcard != null) + message.vcard = String(object.vcard); + if (object.contextInfo != null) { + if (typeof object.contextInfo !== "object") + throw TypeError(".proto.ContactMessage.contextInfo: object expected"); + message.contextInfo = $root.proto.ContextInfo.fromObject(object.contextInfo); + } return message; }; /** - * Creates a plain object from a LocaleSetting message. Also converts values to other types if specified. + * Creates a plain object from a ContactMessage message. Also converts values to other types if specified. * @function toObject - * @memberof proto.LocaleSetting + * @memberof proto.ContactMessage * @static - * @param {proto.LocaleSetting} message LocaleSetting + * @param {proto.ContactMessage} message ContactMessage * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - LocaleSetting.toObject = function toObject(message, options) { + ContactMessage.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) - object.locale = ""; - if (message.locale != null && message.hasOwnProperty("locale")) - object.locale = message.locale; - return object; + if (options.defaults) { + object.displayName = ""; + object.vcard = ""; + object.contextInfo = null; + } + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.vcard != null && message.hasOwnProperty("vcard")) + object.vcard = message.vcard; + if (message.contextInfo != null && message.hasOwnProperty("contextInfo")) + object.contextInfo = $root.proto.ContextInfo.toObject(message.contextInfo, options); + return object; }; /** - * Converts this LocaleSetting to JSON. + * Converts this ContactMessage to JSON. * @function toJSON - * @memberof proto.LocaleSetting + * @memberof proto.ContactMessage * @instance * @returns {Object.} JSON object */ - LocaleSetting.prototype.toJSON = function toJSON() { + ContactMessage.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return LocaleSetting; + return ContactMessage; })(); - proto.QuickReplyAction = (function() { + proto.ContactsArrayMessage = (function() { /** - * Properties of a QuickReplyAction. + * Properties of a ContactsArrayMessage. * @memberof proto - * @interface IQuickReplyAction - * @property {string|null} [shortcut] QuickReplyAction shortcut - * @property {string|null} [message] QuickReplyAction message - * @property {Array.|null} [keywords] QuickReplyAction keywords - * @property {number|null} [count] QuickReplyAction count - * @property {boolean|null} [deleted] QuickReplyAction deleted + * @interface IContactsArrayMessage + * @property {string|null} [displayName] ContactsArrayMessage displayName + * @property {Array.|null} [contacts] ContactsArrayMessage contacts + * @property {proto.IContextInfo|null} [contextInfo] ContactsArrayMessage contextInfo */ /** - * Constructs a new QuickReplyAction. + * Constructs a new ContactsArrayMessage. * @memberof proto - * @classdesc Represents a QuickReplyAction. - * @implements IQuickReplyAction + * @classdesc Represents a ContactsArrayMessage. + * @implements IContactsArrayMessage * @constructor - * @param {proto.IQuickReplyAction=} [properties] Properties to set + * @param {proto.IContactsArrayMessage=} [properties] Properties to set */ - function QuickReplyAction(properties) { - this.keywords = []; + function ContactsArrayMessage(properties) { + this.contacts = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -8436,130 +7528,104 @@ $root.proto = (function() { } /** - * QuickReplyAction shortcut. - * @member {string} shortcut - * @memberof proto.QuickReplyAction - * @instance - */ - QuickReplyAction.prototype.shortcut = ""; - - /** - * QuickReplyAction message. - * @member {string} message - * @memberof proto.QuickReplyAction - * @instance - */ - QuickReplyAction.prototype.message = ""; - - /** - * QuickReplyAction keywords. - * @member {Array.} keywords - * @memberof proto.QuickReplyAction + * ContactsArrayMessage displayName. + * @member {string} displayName + * @memberof proto.ContactsArrayMessage * @instance */ - QuickReplyAction.prototype.keywords = $util.emptyArray; + ContactsArrayMessage.prototype.displayName = ""; /** - * QuickReplyAction count. - * @member {number} count - * @memberof proto.QuickReplyAction + * ContactsArrayMessage contacts. + * @member {Array.} contacts + * @memberof proto.ContactsArrayMessage * @instance */ - QuickReplyAction.prototype.count = 0; + ContactsArrayMessage.prototype.contacts = $util.emptyArray; /** - * QuickReplyAction deleted. - * @member {boolean} deleted - * @memberof proto.QuickReplyAction + * ContactsArrayMessage contextInfo. + * @member {proto.IContextInfo|null|undefined} contextInfo + * @memberof proto.ContactsArrayMessage * @instance */ - QuickReplyAction.prototype.deleted = false; + ContactsArrayMessage.prototype.contextInfo = null; /** - * Creates a new QuickReplyAction instance using the specified properties. + * Creates a new ContactsArrayMessage instance using the specified properties. * @function create - * @memberof proto.QuickReplyAction + * @memberof proto.ContactsArrayMessage * @static - * @param {proto.IQuickReplyAction=} [properties] Properties to set - * @returns {proto.QuickReplyAction} QuickReplyAction instance + * @param {proto.IContactsArrayMessage=} [properties] Properties to set + * @returns {proto.ContactsArrayMessage} ContactsArrayMessage instance */ - QuickReplyAction.create = function create(properties) { - return new QuickReplyAction(properties); + ContactsArrayMessage.create = function create(properties) { + return new ContactsArrayMessage(properties); }; /** - * Encodes the specified QuickReplyAction message. Does not implicitly {@link proto.QuickReplyAction.verify|verify} messages. + * Encodes the specified ContactsArrayMessage message. Does not implicitly {@link proto.ContactsArrayMessage.verify|verify} messages. * @function encode - * @memberof proto.QuickReplyAction + * @memberof proto.ContactsArrayMessage * @static - * @param {proto.IQuickReplyAction} message QuickReplyAction message or plain object to encode + * @param {proto.IContactsArrayMessage} message ContactsArrayMessage message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - QuickReplyAction.encode = function encode(message, writer) { + ContactsArrayMessage.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.shortcut != null && Object.hasOwnProperty.call(message, "shortcut")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.shortcut); - if (message.message != null && Object.hasOwnProperty.call(message, "message")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.message); - if (message.keywords != null && message.keywords.length) - for (var i = 0; i < message.keywords.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.keywords[i]); - if (message.count != null && Object.hasOwnProperty.call(message, "count")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.count); - if (message.deleted != null && Object.hasOwnProperty.call(message, "deleted")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.deleted); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.displayName); + if (message.contacts != null && message.contacts.length) + for (var i = 0; i < message.contacts.length; ++i) + $root.proto.ContactMessage.encode(message.contacts[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.contextInfo != null && Object.hasOwnProperty.call(message, "contextInfo")) + $root.proto.ContextInfo.encode(message.contextInfo, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); return writer; }; /** - * Encodes the specified QuickReplyAction message, length delimited. Does not implicitly {@link proto.QuickReplyAction.verify|verify} messages. + * Encodes the specified ContactsArrayMessage message, length delimited. Does not implicitly {@link proto.ContactsArrayMessage.verify|verify} messages. * @function encodeDelimited - * @memberof proto.QuickReplyAction + * @memberof proto.ContactsArrayMessage * @static - * @param {proto.IQuickReplyAction} message QuickReplyAction message or plain object to encode + * @param {proto.IContactsArrayMessage} message ContactsArrayMessage message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - QuickReplyAction.encodeDelimited = function encodeDelimited(message, writer) { + ContactsArrayMessage.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a QuickReplyAction message from the specified reader or buffer. + * Decodes a ContactsArrayMessage message from the specified reader or buffer. * @function decode - * @memberof proto.QuickReplyAction + * @memberof proto.ContactsArrayMessage * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {proto.QuickReplyAction} QuickReplyAction + * @returns {proto.ContactsArrayMessage} ContactsArrayMessage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - QuickReplyAction.decode = function decode(reader, length) { + ContactsArrayMessage.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.QuickReplyAction(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.ContactsArrayMessage(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.shortcut = reader.string(); + message.displayName = reader.string(); break; case 2: - message.message = reader.string(); - break; - case 3: - if (!(message.keywords && message.keywords.length)) - message.keywords = []; - message.keywords.push(reader.string()); - break; - case 4: - message.count = reader.int32(); + if (!(message.contacts && message.contacts.length)) + message.contacts = []; + message.contacts.push($root.proto.ContactMessage.decode(reader, reader.uint32())); break; - case 5: - message.deleted = reader.bool(); + case 17: + message.contextInfo = $root.proto.ContextInfo.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -8570,153 +7636,170 @@ $root.proto = (function() { }; /** - * Decodes a QuickReplyAction message from the specified reader or buffer, length delimited. + * Decodes a ContactsArrayMessage message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof proto.QuickReplyAction + * @memberof proto.ContactsArrayMessage * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.QuickReplyAction} QuickReplyAction + * @returns {proto.ContactsArrayMessage} ContactsArrayMessage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - QuickReplyAction.decodeDelimited = function decodeDelimited(reader) { + ContactsArrayMessage.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a QuickReplyAction message. + * Verifies a ContactsArrayMessage message. * @function verify - * @memberof proto.QuickReplyAction + * @memberof proto.ContactsArrayMessage * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - QuickReplyAction.verify = function verify(message) { + ContactsArrayMessage.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.shortcut != null && message.hasOwnProperty("shortcut")) - if (!$util.isString(message.shortcut)) - return "shortcut: string expected"; - if (message.message != null && message.hasOwnProperty("message")) - if (!$util.isString(message.message)) - return "message: string expected"; - if (message.keywords != null && message.hasOwnProperty("keywords")) { - if (!Array.isArray(message.keywords)) - return "keywords: array expected"; - for (var i = 0; i < message.keywords.length; ++i) - if (!$util.isString(message.keywords[i])) - return "keywords: string[] expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.contacts != null && message.hasOwnProperty("contacts")) { + if (!Array.isArray(message.contacts)) + return "contacts: array expected"; + for (var i = 0; i < message.contacts.length; ++i) { + var error = $root.proto.ContactMessage.verify(message.contacts[i]); + if (error) + return "contacts." + error; + } + } + if (message.contextInfo != null && message.hasOwnProperty("contextInfo")) { + var error = $root.proto.ContextInfo.verify(message.contextInfo); + if (error) + return "contextInfo." + error; } - if (message.count != null && message.hasOwnProperty("count")) - if (!$util.isInteger(message.count)) - return "count: integer expected"; - if (message.deleted != null && message.hasOwnProperty("deleted")) - if (typeof message.deleted !== "boolean") - return "deleted: boolean expected"; return null; }; /** - * Creates a QuickReplyAction message from a plain object. Also converts values to their respective internal types. + * Creates a ContactsArrayMessage message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof proto.QuickReplyAction + * @memberof proto.ContactsArrayMessage * @static * @param {Object.} object Plain object - * @returns {proto.QuickReplyAction} QuickReplyAction + * @returns {proto.ContactsArrayMessage} ContactsArrayMessage */ - QuickReplyAction.fromObject = function fromObject(object) { - if (object instanceof $root.proto.QuickReplyAction) + ContactsArrayMessage.fromObject = function fromObject(object) { + if (object instanceof $root.proto.ContactsArrayMessage) return object; - var message = new $root.proto.QuickReplyAction(); - if (object.shortcut != null) - message.shortcut = String(object.shortcut); - if (object.message != null) - message.message = String(object.message); - if (object.keywords) { - if (!Array.isArray(object.keywords)) - throw TypeError(".proto.QuickReplyAction.keywords: array expected"); - message.keywords = []; - for (var i = 0; i < object.keywords.length; ++i) - message.keywords[i] = String(object.keywords[i]); + var message = new $root.proto.ContactsArrayMessage(); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.contacts) { + if (!Array.isArray(object.contacts)) + throw TypeError(".proto.ContactsArrayMessage.contacts: array expected"); + message.contacts = []; + for (var i = 0; i < object.contacts.length; ++i) { + if (typeof object.contacts[i] !== "object") + throw TypeError(".proto.ContactsArrayMessage.contacts: object expected"); + message.contacts[i] = $root.proto.ContactMessage.fromObject(object.contacts[i]); + } + } + if (object.contextInfo != null) { + if (typeof object.contextInfo !== "object") + throw TypeError(".proto.ContactsArrayMessage.contextInfo: object expected"); + message.contextInfo = $root.proto.ContextInfo.fromObject(object.contextInfo); } - if (object.count != null) - message.count = object.count | 0; - if (object.deleted != null) - message.deleted = Boolean(object.deleted); return message; }; /** - * Creates a plain object from a QuickReplyAction message. Also converts values to other types if specified. + * Creates a plain object from a ContactsArrayMessage message. Also converts values to other types if specified. * @function toObject - * @memberof proto.QuickReplyAction + * @memberof proto.ContactsArrayMessage * @static - * @param {proto.QuickReplyAction} message QuickReplyAction + * @param {proto.ContactsArrayMessage} message ContactsArrayMessage * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - QuickReplyAction.toObject = function toObject(message, options) { + ContactsArrayMessage.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) - object.keywords = []; + object.contacts = []; if (options.defaults) { - object.shortcut = ""; - object.message = ""; - object.count = 0; - object.deleted = false; + object.displayName = ""; + object.contextInfo = null; } - if (message.shortcut != null && message.hasOwnProperty("shortcut")) - object.shortcut = message.shortcut; - if (message.message != null && message.hasOwnProperty("message")) - object.message = message.message; - if (message.keywords && message.keywords.length) { - object.keywords = []; - for (var j = 0; j < message.keywords.length; ++j) - object.keywords[j] = message.keywords[j]; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.contacts && message.contacts.length) { + object.contacts = []; + for (var j = 0; j < message.contacts.length; ++j) + object.contacts[j] = $root.proto.ContactMessage.toObject(message.contacts[j], options); } - if (message.count != null && message.hasOwnProperty("count")) - object.count = message.count; - if (message.deleted != null && message.hasOwnProperty("deleted")) - object.deleted = message.deleted; + if (message.contextInfo != null && message.hasOwnProperty("contextInfo")) + object.contextInfo = $root.proto.ContextInfo.toObject(message.contextInfo, options); return object; }; /** - * Converts this QuickReplyAction to JSON. + * Converts this ContactsArrayMessage to JSON. * @function toJSON - * @memberof proto.QuickReplyAction + * @memberof proto.ContactsArrayMessage * @instance * @returns {Object.} JSON object */ - QuickReplyAction.prototype.toJSON = function toJSON() { + ContactsArrayMessage.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return QuickReplyAction; + return ContactsArrayMessage; })(); - proto.LabelAssociationAction = (function() { + proto.ContextInfo = (function() { /** - * Properties of a LabelAssociationAction. + * Properties of a ContextInfo. * @memberof proto - * @interface ILabelAssociationAction - * @property {boolean|null} [labeled] LabelAssociationAction labeled + * @interface IContextInfo + * @property {string|null} [stanzaId] ContextInfo stanzaId + * @property {string|null} [participant] ContextInfo participant + * @property {proto.IMessage|null} [quotedMessage] ContextInfo quotedMessage + * @property {string|null} [remoteJid] ContextInfo remoteJid + * @property {Array.|null} [mentionedJid] ContextInfo mentionedJid + * @property {string|null} [conversionSource] ContextInfo conversionSource + * @property {Uint8Array|null} [conversionData] ContextInfo conversionData + * @property {number|null} [conversionDelaySeconds] ContextInfo conversionDelaySeconds + * @property {number|null} [forwardingScore] ContextInfo forwardingScore + * @property {boolean|null} [isForwarded] ContextInfo isForwarded + * @property {proto.IAdReplyInfo|null} [quotedAd] ContextInfo quotedAd + * @property {proto.IMessageKey|null} [placeholderKey] ContextInfo placeholderKey + * @property {number|null} [expiration] ContextInfo expiration + * @property {number|Long|null} [ephemeralSettingTimestamp] ContextInfo ephemeralSettingTimestamp + * @property {Uint8Array|null} [ephemeralSharedSecret] ContextInfo ephemeralSharedSecret + * @property {proto.IExternalAdReplyInfo|null} [externalAdReply] ContextInfo externalAdReply + * @property {string|null} [entryPointConversionSource] ContextInfo entryPointConversionSource + * @property {string|null} [entryPointConversionApp] ContextInfo entryPointConversionApp + * @property {number|null} [entryPointConversionDelaySeconds] ContextInfo entryPointConversionDelaySeconds + * @property {proto.IDisappearingMode|null} [disappearingMode] ContextInfo disappearingMode + * @property {proto.IActionLink|null} [actionLink] ContextInfo actionLink + * @property {string|null} [groupSubject] ContextInfo groupSubject + * @property {string|null} [parentGroupJid] ContextInfo parentGroupJid */ /** - * Constructs a new LabelAssociationAction. + * Constructs a new ContextInfo. * @memberof proto - * @classdesc Represents a LabelAssociationAction. - * @implements ILabelAssociationAction + * @classdesc Represents a ContextInfo. + * @implements IContextInfo * @constructor - * @param {proto.ILabelAssociationAction=} [properties] Properties to set + * @param {proto.IContextInfo=} [properties] Properties to set */ - function LabelAssociationAction(properties) { + function ContextInfo(properties) { + this.mentionedJid = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -8724,304 +7807,364 @@ $root.proto = (function() { } /** - * LabelAssociationAction labeled. - * @member {boolean} labeled - * @memberof proto.LabelAssociationAction + * ContextInfo stanzaId. + * @member {string} stanzaId + * @memberof proto.ContextInfo * @instance */ - LabelAssociationAction.prototype.labeled = false; + ContextInfo.prototype.stanzaId = ""; /** - * Creates a new LabelAssociationAction instance using the specified properties. - * @function create - * @memberof proto.LabelAssociationAction - * @static - * @param {proto.ILabelAssociationAction=} [properties] Properties to set - * @returns {proto.LabelAssociationAction} LabelAssociationAction instance + * ContextInfo participant. + * @member {string} participant + * @memberof proto.ContextInfo + * @instance */ - LabelAssociationAction.create = function create(properties) { - return new LabelAssociationAction(properties); - }; + ContextInfo.prototype.participant = ""; /** - * Encodes the specified LabelAssociationAction message. Does not implicitly {@link proto.LabelAssociationAction.verify|verify} messages. - * @function encode - * @memberof proto.LabelAssociationAction - * @static - * @param {proto.ILabelAssociationAction} message LabelAssociationAction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * ContextInfo quotedMessage. + * @member {proto.IMessage|null|undefined} quotedMessage + * @memberof proto.ContextInfo + * @instance */ - LabelAssociationAction.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.labeled != null && Object.hasOwnProperty.call(message, "labeled")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.labeled); - return writer; - }; + ContextInfo.prototype.quotedMessage = null; /** - * Encodes the specified LabelAssociationAction message, length delimited. Does not implicitly {@link proto.LabelAssociationAction.verify|verify} messages. - * @function encodeDelimited - * @memberof proto.LabelAssociationAction - * @static - * @param {proto.ILabelAssociationAction} message LabelAssociationAction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * ContextInfo remoteJid. + * @member {string} remoteJid + * @memberof proto.ContextInfo + * @instance */ - LabelAssociationAction.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + ContextInfo.prototype.remoteJid = ""; /** - * Decodes a LabelAssociationAction message from the specified reader or buffer. - * @function decode - * @memberof proto.LabelAssociationAction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {proto.LabelAssociationAction} LabelAssociationAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * ContextInfo mentionedJid. + * @member {Array.} mentionedJid + * @memberof proto.ContextInfo + * @instance */ - LabelAssociationAction.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.LabelAssociationAction(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.labeled = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + ContextInfo.prototype.mentionedJid = $util.emptyArray; /** - * Decodes a LabelAssociationAction message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof proto.LabelAssociationAction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.LabelAssociationAction} LabelAssociationAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * ContextInfo conversionSource. + * @member {string} conversionSource + * @memberof proto.ContextInfo + * @instance */ - LabelAssociationAction.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + ContextInfo.prototype.conversionSource = ""; /** - * Verifies a LabelAssociationAction message. - * @function verify - * @memberof proto.LabelAssociationAction - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not + * ContextInfo conversionData. + * @member {Uint8Array} conversionData + * @memberof proto.ContextInfo + * @instance */ - LabelAssociationAction.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.labeled != null && message.hasOwnProperty("labeled")) - if (typeof message.labeled !== "boolean") - return "labeled: boolean expected"; - return null; - }; + ContextInfo.prototype.conversionData = $util.newBuffer([]); /** - * Creates a LabelAssociationAction message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof proto.LabelAssociationAction - * @static - * @param {Object.} object Plain object - * @returns {proto.LabelAssociationAction} LabelAssociationAction + * ContextInfo conversionDelaySeconds. + * @member {number} conversionDelaySeconds + * @memberof proto.ContextInfo + * @instance */ - LabelAssociationAction.fromObject = function fromObject(object) { - if (object instanceof $root.proto.LabelAssociationAction) - return object; - var message = new $root.proto.LabelAssociationAction(); - if (object.labeled != null) - message.labeled = Boolean(object.labeled); - return message; - }; + ContextInfo.prototype.conversionDelaySeconds = 0; /** - * Creates a plain object from a LabelAssociationAction message. Also converts values to other types if specified. - * @function toObject - * @memberof proto.LabelAssociationAction - * @static - * @param {proto.LabelAssociationAction} message LabelAssociationAction - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object + * ContextInfo forwardingScore. + * @member {number} forwardingScore + * @memberof proto.ContextInfo + * @instance */ - LabelAssociationAction.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.labeled = false; - if (message.labeled != null && message.hasOwnProperty("labeled")) - object.labeled = message.labeled; - return object; - }; + ContextInfo.prototype.forwardingScore = 0; /** - * Converts this LabelAssociationAction to JSON. - * @function toJSON - * @memberof proto.LabelAssociationAction + * ContextInfo isForwarded. + * @member {boolean} isForwarded + * @memberof proto.ContextInfo * @instance - * @returns {Object.} JSON object */ - LabelAssociationAction.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + ContextInfo.prototype.isForwarded = false; - return LabelAssociationAction; - })(); + /** + * ContextInfo quotedAd. + * @member {proto.IAdReplyInfo|null|undefined} quotedAd + * @memberof proto.ContextInfo + * @instance + */ + ContextInfo.prototype.quotedAd = null; - proto.LabelEditAction = (function() { + /** + * ContextInfo placeholderKey. + * @member {proto.IMessageKey|null|undefined} placeholderKey + * @memberof proto.ContextInfo + * @instance + */ + ContextInfo.prototype.placeholderKey = null; /** - * Properties of a LabelEditAction. - * @memberof proto - * @interface ILabelEditAction - * @property {string|null} [name] LabelEditAction name - * @property {number|null} [color] LabelEditAction color - * @property {number|null} [predefinedId] LabelEditAction predefinedId - * @property {boolean|null} [deleted] LabelEditAction deleted + * ContextInfo expiration. + * @member {number} expiration + * @memberof proto.ContextInfo + * @instance */ + ContextInfo.prototype.expiration = 0; /** - * Constructs a new LabelEditAction. - * @memberof proto - * @classdesc Represents a LabelEditAction. - * @implements ILabelEditAction - * @constructor - * @param {proto.ILabelEditAction=} [properties] Properties to set + * ContextInfo ephemeralSettingTimestamp. + * @member {number|Long} ephemeralSettingTimestamp + * @memberof proto.ContextInfo + * @instance */ - function LabelEditAction(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + ContextInfo.prototype.ephemeralSettingTimestamp = $util.Long ? $util.Long.fromBits(0,0,false) : 0; /** - * LabelEditAction name. - * @member {string} name - * @memberof proto.LabelEditAction + * ContextInfo ephemeralSharedSecret. + * @member {Uint8Array} ephemeralSharedSecret + * @memberof proto.ContextInfo * @instance */ - LabelEditAction.prototype.name = ""; + ContextInfo.prototype.ephemeralSharedSecret = $util.newBuffer([]); /** - * LabelEditAction color. - * @member {number} color - * @memberof proto.LabelEditAction + * ContextInfo externalAdReply. + * @member {proto.IExternalAdReplyInfo|null|undefined} externalAdReply + * @memberof proto.ContextInfo * @instance */ - LabelEditAction.prototype.color = 0; + ContextInfo.prototype.externalAdReply = null; /** - * LabelEditAction predefinedId. - * @member {number} predefinedId - * @memberof proto.LabelEditAction + * ContextInfo entryPointConversionSource. + * @member {string} entryPointConversionSource + * @memberof proto.ContextInfo * @instance */ - LabelEditAction.prototype.predefinedId = 0; + ContextInfo.prototype.entryPointConversionSource = ""; /** - * LabelEditAction deleted. - * @member {boolean} deleted - * @memberof proto.LabelEditAction + * ContextInfo entryPointConversionApp. + * @member {string} entryPointConversionApp + * @memberof proto.ContextInfo * @instance */ - LabelEditAction.prototype.deleted = false; + ContextInfo.prototype.entryPointConversionApp = ""; /** - * Creates a new LabelEditAction instance using the specified properties. + * ContextInfo entryPointConversionDelaySeconds. + * @member {number} entryPointConversionDelaySeconds + * @memberof proto.ContextInfo + * @instance + */ + ContextInfo.prototype.entryPointConversionDelaySeconds = 0; + + /** + * ContextInfo disappearingMode. + * @member {proto.IDisappearingMode|null|undefined} disappearingMode + * @memberof proto.ContextInfo + * @instance + */ + ContextInfo.prototype.disappearingMode = null; + + /** + * ContextInfo actionLink. + * @member {proto.IActionLink|null|undefined} actionLink + * @memberof proto.ContextInfo + * @instance + */ + ContextInfo.prototype.actionLink = null; + + /** + * ContextInfo groupSubject. + * @member {string} groupSubject + * @memberof proto.ContextInfo + * @instance + */ + ContextInfo.prototype.groupSubject = ""; + + /** + * ContextInfo parentGroupJid. + * @member {string} parentGroupJid + * @memberof proto.ContextInfo + * @instance + */ + ContextInfo.prototype.parentGroupJid = ""; + + /** + * Creates a new ContextInfo instance using the specified properties. * @function create - * @memberof proto.LabelEditAction + * @memberof proto.ContextInfo * @static - * @param {proto.ILabelEditAction=} [properties] Properties to set - * @returns {proto.LabelEditAction} LabelEditAction instance + * @param {proto.IContextInfo=} [properties] Properties to set + * @returns {proto.ContextInfo} ContextInfo instance */ - LabelEditAction.create = function create(properties) { - return new LabelEditAction(properties); + ContextInfo.create = function create(properties) { + return new ContextInfo(properties); }; /** - * Encodes the specified LabelEditAction message. Does not implicitly {@link proto.LabelEditAction.verify|verify} messages. + * Encodes the specified ContextInfo message. Does not implicitly {@link proto.ContextInfo.verify|verify} messages. * @function encode - * @memberof proto.LabelEditAction + * @memberof proto.ContextInfo * @static - * @param {proto.ILabelEditAction} message LabelEditAction message or plain object to encode + * @param {proto.IContextInfo} message ContextInfo message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - LabelEditAction.encode = function encode(message, writer) { + ContextInfo.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.color != null && Object.hasOwnProperty.call(message, "color")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.color); - if (message.predefinedId != null && Object.hasOwnProperty.call(message, "predefinedId")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.predefinedId); - if (message.deleted != null && Object.hasOwnProperty.call(message, "deleted")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.deleted); + if (message.stanzaId != null && Object.hasOwnProperty.call(message, "stanzaId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.stanzaId); + if (message.participant != null && Object.hasOwnProperty.call(message, "participant")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.participant); + if (message.quotedMessage != null && Object.hasOwnProperty.call(message, "quotedMessage")) + $root.proto.Message.encode(message.quotedMessage, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.remoteJid != null && Object.hasOwnProperty.call(message, "remoteJid")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.remoteJid); + if (message.mentionedJid != null && message.mentionedJid.length) + for (var i = 0; i < message.mentionedJid.length; ++i) + writer.uint32(/* id 15, wireType 2 =*/122).string(message.mentionedJid[i]); + if (message.conversionSource != null && Object.hasOwnProperty.call(message, "conversionSource")) + writer.uint32(/* id 18, wireType 2 =*/146).string(message.conversionSource); + if (message.conversionData != null && Object.hasOwnProperty.call(message, "conversionData")) + writer.uint32(/* id 19, wireType 2 =*/154).bytes(message.conversionData); + if (message.conversionDelaySeconds != null && Object.hasOwnProperty.call(message, "conversionDelaySeconds")) + writer.uint32(/* id 20, wireType 0 =*/160).uint32(message.conversionDelaySeconds); + if (message.forwardingScore != null && Object.hasOwnProperty.call(message, "forwardingScore")) + writer.uint32(/* id 21, wireType 0 =*/168).uint32(message.forwardingScore); + if (message.isForwarded != null && Object.hasOwnProperty.call(message, "isForwarded")) + writer.uint32(/* id 22, wireType 0 =*/176).bool(message.isForwarded); + if (message.quotedAd != null && Object.hasOwnProperty.call(message, "quotedAd")) + $root.proto.AdReplyInfo.encode(message.quotedAd, writer.uint32(/* id 23, wireType 2 =*/186).fork()).ldelim(); + if (message.placeholderKey != null && Object.hasOwnProperty.call(message, "placeholderKey")) + $root.proto.MessageKey.encode(message.placeholderKey, writer.uint32(/* id 24, wireType 2 =*/194).fork()).ldelim(); + if (message.expiration != null && Object.hasOwnProperty.call(message, "expiration")) + writer.uint32(/* id 25, wireType 0 =*/200).uint32(message.expiration); + if (message.ephemeralSettingTimestamp != null && Object.hasOwnProperty.call(message, "ephemeralSettingTimestamp")) + writer.uint32(/* id 26, wireType 0 =*/208).int64(message.ephemeralSettingTimestamp); + if (message.ephemeralSharedSecret != null && Object.hasOwnProperty.call(message, "ephemeralSharedSecret")) + writer.uint32(/* id 27, wireType 2 =*/218).bytes(message.ephemeralSharedSecret); + if (message.externalAdReply != null && Object.hasOwnProperty.call(message, "externalAdReply")) + $root.proto.ExternalAdReplyInfo.encode(message.externalAdReply, writer.uint32(/* id 28, wireType 2 =*/226).fork()).ldelim(); + if (message.entryPointConversionSource != null && Object.hasOwnProperty.call(message, "entryPointConversionSource")) + writer.uint32(/* id 29, wireType 2 =*/234).string(message.entryPointConversionSource); + if (message.entryPointConversionApp != null && Object.hasOwnProperty.call(message, "entryPointConversionApp")) + writer.uint32(/* id 30, wireType 2 =*/242).string(message.entryPointConversionApp); + if (message.entryPointConversionDelaySeconds != null && Object.hasOwnProperty.call(message, "entryPointConversionDelaySeconds")) + writer.uint32(/* id 31, wireType 0 =*/248).uint32(message.entryPointConversionDelaySeconds); + if (message.disappearingMode != null && Object.hasOwnProperty.call(message, "disappearingMode")) + $root.proto.DisappearingMode.encode(message.disappearingMode, writer.uint32(/* id 32, wireType 2 =*/258).fork()).ldelim(); + if (message.actionLink != null && Object.hasOwnProperty.call(message, "actionLink")) + $root.proto.ActionLink.encode(message.actionLink, writer.uint32(/* id 33, wireType 2 =*/266).fork()).ldelim(); + if (message.groupSubject != null && Object.hasOwnProperty.call(message, "groupSubject")) + writer.uint32(/* id 34, wireType 2 =*/274).string(message.groupSubject); + if (message.parentGroupJid != null && Object.hasOwnProperty.call(message, "parentGroupJid")) + writer.uint32(/* id 35, wireType 2 =*/282).string(message.parentGroupJid); return writer; }; /** - * Encodes the specified LabelEditAction message, length delimited. Does not implicitly {@link proto.LabelEditAction.verify|verify} messages. + * Encodes the specified ContextInfo message, length delimited. Does not implicitly {@link proto.ContextInfo.verify|verify} messages. * @function encodeDelimited - * @memberof proto.LabelEditAction + * @memberof proto.ContextInfo * @static - * @param {proto.ILabelEditAction} message LabelEditAction message or plain object to encode + * @param {proto.IContextInfo} message ContextInfo message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - LabelEditAction.encodeDelimited = function encodeDelimited(message, writer) { + ContextInfo.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a LabelEditAction message from the specified reader or buffer. + * Decodes a ContextInfo message from the specified reader or buffer. * @function decode - * @memberof proto.LabelEditAction + * @memberof proto.ContextInfo * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {proto.LabelEditAction} LabelEditAction + * @returns {proto.ContextInfo} ContextInfo * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - LabelEditAction.decode = function decode(reader, length) { + ContextInfo.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.LabelEditAction(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.ContextInfo(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.name = reader.string(); + message.stanzaId = reader.string(); break; case 2: - message.color = reader.int32(); + message.participant = reader.string(); break; case 3: - message.predefinedId = reader.int32(); + message.quotedMessage = $root.proto.Message.decode(reader, reader.uint32()); break; case 4: - message.deleted = reader.bool(); + message.remoteJid = reader.string(); + break; + case 15: + if (!(message.mentionedJid && message.mentionedJid.length)) + message.mentionedJid = []; + message.mentionedJid.push(reader.string()); + break; + case 18: + message.conversionSource = reader.string(); + break; + case 19: + message.conversionData = reader.bytes(); + break; + case 20: + message.conversionDelaySeconds = reader.uint32(); + break; + case 21: + message.forwardingScore = reader.uint32(); + break; + case 22: + message.isForwarded = reader.bool(); + break; + case 23: + message.quotedAd = $root.proto.AdReplyInfo.decode(reader, reader.uint32()); + break; + case 24: + message.placeholderKey = $root.proto.MessageKey.decode(reader, reader.uint32()); + break; + case 25: + message.expiration = reader.uint32(); + break; + case 26: + message.ephemeralSettingTimestamp = reader.int64(); + break; + case 27: + message.ephemeralSharedSecret = reader.bytes(); + break; + case 28: + message.externalAdReply = $root.proto.ExternalAdReplyInfo.decode(reader, reader.uint32()); + break; + case 29: + message.entryPointConversionSource = reader.string(); + break; + case 30: + message.entryPointConversionApp = reader.string(); + break; + case 31: + message.entryPointConversionDelaySeconds = reader.uint32(); + break; + case 32: + message.disappearingMode = $root.proto.DisappearingMode.decode(reader, reader.uint32()); + break; + case 33: + message.actionLink = $root.proto.ActionLink.decode(reader, reader.uint32()); + break; + case 34: + message.groupSubject = reader.string(); + break; + case 35: + message.parentGroupJid = reader.string(); break; default: reader.skipType(tag & 7); @@ -9032,133 +8175,359 @@ $root.proto = (function() { }; /** - * Decodes a LabelEditAction message from the specified reader or buffer, length delimited. + * Decodes a ContextInfo message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof proto.LabelEditAction + * @memberof proto.ContextInfo * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.LabelEditAction} LabelEditAction + * @returns {proto.ContextInfo} ContextInfo * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - LabelEditAction.decodeDelimited = function decodeDelimited(reader) { + ContextInfo.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a LabelEditAction message. + * Verifies a ContextInfo message. * @function verify - * @memberof proto.LabelEditAction + * @memberof proto.ContextInfo * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - LabelEditAction.verify = function verify(message) { + ContextInfo.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.color != null && message.hasOwnProperty("color")) - if (!$util.isInteger(message.color)) - return "color: integer expected"; - if (message.predefinedId != null && message.hasOwnProperty("predefinedId")) - if (!$util.isInteger(message.predefinedId)) - return "predefinedId: integer expected"; - if (message.deleted != null && message.hasOwnProperty("deleted")) - if (typeof message.deleted !== "boolean") - return "deleted: boolean expected"; + if (message.stanzaId != null && message.hasOwnProperty("stanzaId")) + if (!$util.isString(message.stanzaId)) + return "stanzaId: string expected"; + if (message.participant != null && message.hasOwnProperty("participant")) + if (!$util.isString(message.participant)) + return "participant: string expected"; + if (message.quotedMessage != null && message.hasOwnProperty("quotedMessage")) { + var error = $root.proto.Message.verify(message.quotedMessage); + if (error) + return "quotedMessage." + error; + } + if (message.remoteJid != null && message.hasOwnProperty("remoteJid")) + if (!$util.isString(message.remoteJid)) + return "remoteJid: string expected"; + if (message.mentionedJid != null && message.hasOwnProperty("mentionedJid")) { + if (!Array.isArray(message.mentionedJid)) + return "mentionedJid: array expected"; + for (var i = 0; i < message.mentionedJid.length; ++i) + if (!$util.isString(message.mentionedJid[i])) + return "mentionedJid: string[] expected"; + } + if (message.conversionSource != null && message.hasOwnProperty("conversionSource")) + if (!$util.isString(message.conversionSource)) + return "conversionSource: string expected"; + if (message.conversionData != null && message.hasOwnProperty("conversionData")) + if (!(message.conversionData && typeof message.conversionData.length === "number" || $util.isString(message.conversionData))) + return "conversionData: buffer expected"; + if (message.conversionDelaySeconds != null && message.hasOwnProperty("conversionDelaySeconds")) + if (!$util.isInteger(message.conversionDelaySeconds)) + return "conversionDelaySeconds: integer expected"; + if (message.forwardingScore != null && message.hasOwnProperty("forwardingScore")) + if (!$util.isInteger(message.forwardingScore)) + return "forwardingScore: integer expected"; + if (message.isForwarded != null && message.hasOwnProperty("isForwarded")) + if (typeof message.isForwarded !== "boolean") + return "isForwarded: boolean expected"; + if (message.quotedAd != null && message.hasOwnProperty("quotedAd")) { + var error = $root.proto.AdReplyInfo.verify(message.quotedAd); + if (error) + return "quotedAd." + error; + } + if (message.placeholderKey != null && message.hasOwnProperty("placeholderKey")) { + var error = $root.proto.MessageKey.verify(message.placeholderKey); + if (error) + return "placeholderKey." + error; + } + if (message.expiration != null && message.hasOwnProperty("expiration")) + if (!$util.isInteger(message.expiration)) + return "expiration: integer expected"; + if (message.ephemeralSettingTimestamp != null && message.hasOwnProperty("ephemeralSettingTimestamp")) + if (!$util.isInteger(message.ephemeralSettingTimestamp) && !(message.ephemeralSettingTimestamp && $util.isInteger(message.ephemeralSettingTimestamp.low) && $util.isInteger(message.ephemeralSettingTimestamp.high))) + return "ephemeralSettingTimestamp: integer|Long expected"; + if (message.ephemeralSharedSecret != null && message.hasOwnProperty("ephemeralSharedSecret")) + if (!(message.ephemeralSharedSecret && typeof message.ephemeralSharedSecret.length === "number" || $util.isString(message.ephemeralSharedSecret))) + return "ephemeralSharedSecret: buffer expected"; + if (message.externalAdReply != null && message.hasOwnProperty("externalAdReply")) { + var error = $root.proto.ExternalAdReplyInfo.verify(message.externalAdReply); + if (error) + return "externalAdReply." + error; + } + if (message.entryPointConversionSource != null && message.hasOwnProperty("entryPointConversionSource")) + if (!$util.isString(message.entryPointConversionSource)) + return "entryPointConversionSource: string expected"; + if (message.entryPointConversionApp != null && message.hasOwnProperty("entryPointConversionApp")) + if (!$util.isString(message.entryPointConversionApp)) + return "entryPointConversionApp: string expected"; + if (message.entryPointConversionDelaySeconds != null && message.hasOwnProperty("entryPointConversionDelaySeconds")) + if (!$util.isInteger(message.entryPointConversionDelaySeconds)) + return "entryPointConversionDelaySeconds: integer expected"; + if (message.disappearingMode != null && message.hasOwnProperty("disappearingMode")) { + var error = $root.proto.DisappearingMode.verify(message.disappearingMode); + if (error) + return "disappearingMode." + error; + } + if (message.actionLink != null && message.hasOwnProperty("actionLink")) { + var error = $root.proto.ActionLink.verify(message.actionLink); + if (error) + return "actionLink." + error; + } + if (message.groupSubject != null && message.hasOwnProperty("groupSubject")) + if (!$util.isString(message.groupSubject)) + return "groupSubject: string expected"; + if (message.parentGroupJid != null && message.hasOwnProperty("parentGroupJid")) + if (!$util.isString(message.parentGroupJid)) + return "parentGroupJid: string expected"; return null; }; /** - * Creates a LabelEditAction message from a plain object. Also converts values to their respective internal types. + * Creates a ContextInfo message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof proto.LabelEditAction + * @memberof proto.ContextInfo * @static * @param {Object.} object Plain object - * @returns {proto.LabelEditAction} LabelEditAction + * @returns {proto.ContextInfo} ContextInfo */ - LabelEditAction.fromObject = function fromObject(object) { - if (object instanceof $root.proto.LabelEditAction) + ContextInfo.fromObject = function fromObject(object) { + if (object instanceof $root.proto.ContextInfo) return object; - var message = new $root.proto.LabelEditAction(); - if (object.name != null) - message.name = String(object.name); - if (object.color != null) - message.color = object.color | 0; - if (object.predefinedId != null) - message.predefinedId = object.predefinedId | 0; - if (object.deleted != null) - message.deleted = Boolean(object.deleted); + var message = new $root.proto.ContextInfo(); + if (object.stanzaId != null) + message.stanzaId = String(object.stanzaId); + if (object.participant != null) + message.participant = String(object.participant); + if (object.quotedMessage != null) { + if (typeof object.quotedMessage !== "object") + throw TypeError(".proto.ContextInfo.quotedMessage: object expected"); + message.quotedMessage = $root.proto.Message.fromObject(object.quotedMessage); + } + if (object.remoteJid != null) + message.remoteJid = String(object.remoteJid); + if (object.mentionedJid) { + if (!Array.isArray(object.mentionedJid)) + throw TypeError(".proto.ContextInfo.mentionedJid: array expected"); + message.mentionedJid = []; + for (var i = 0; i < object.mentionedJid.length; ++i) + message.mentionedJid[i] = String(object.mentionedJid[i]); + } + if (object.conversionSource != null) + message.conversionSource = String(object.conversionSource); + if (object.conversionData != null) + if (typeof object.conversionData === "string") + $util.base64.decode(object.conversionData, message.conversionData = $util.newBuffer($util.base64.length(object.conversionData)), 0); + else if (object.conversionData.length) + message.conversionData = object.conversionData; + if (object.conversionDelaySeconds != null) + message.conversionDelaySeconds = object.conversionDelaySeconds >>> 0; + if (object.forwardingScore != null) + message.forwardingScore = object.forwardingScore >>> 0; + if (object.isForwarded != null) + message.isForwarded = Boolean(object.isForwarded); + if (object.quotedAd != null) { + if (typeof object.quotedAd !== "object") + throw TypeError(".proto.ContextInfo.quotedAd: object expected"); + message.quotedAd = $root.proto.AdReplyInfo.fromObject(object.quotedAd); + } + if (object.placeholderKey != null) { + if (typeof object.placeholderKey !== "object") + throw TypeError(".proto.ContextInfo.placeholderKey: object expected"); + message.placeholderKey = $root.proto.MessageKey.fromObject(object.placeholderKey); + } + if (object.expiration != null) + message.expiration = object.expiration >>> 0; + if (object.ephemeralSettingTimestamp != null) + if ($util.Long) + (message.ephemeralSettingTimestamp = $util.Long.fromValue(object.ephemeralSettingTimestamp)).unsigned = false; + else if (typeof object.ephemeralSettingTimestamp === "string") + message.ephemeralSettingTimestamp = parseInt(object.ephemeralSettingTimestamp, 10); + else if (typeof object.ephemeralSettingTimestamp === "number") + message.ephemeralSettingTimestamp = object.ephemeralSettingTimestamp; + else if (typeof object.ephemeralSettingTimestamp === "object") + message.ephemeralSettingTimestamp = new $util.LongBits(object.ephemeralSettingTimestamp.low >>> 0, object.ephemeralSettingTimestamp.high >>> 0).toNumber(); + if (object.ephemeralSharedSecret != null) + if (typeof object.ephemeralSharedSecret === "string") + $util.base64.decode(object.ephemeralSharedSecret, message.ephemeralSharedSecret = $util.newBuffer($util.base64.length(object.ephemeralSharedSecret)), 0); + else if (object.ephemeralSharedSecret.length) + message.ephemeralSharedSecret = object.ephemeralSharedSecret; + if (object.externalAdReply != null) { + if (typeof object.externalAdReply !== "object") + throw TypeError(".proto.ContextInfo.externalAdReply: object expected"); + message.externalAdReply = $root.proto.ExternalAdReplyInfo.fromObject(object.externalAdReply); + } + if (object.entryPointConversionSource != null) + message.entryPointConversionSource = String(object.entryPointConversionSource); + if (object.entryPointConversionApp != null) + message.entryPointConversionApp = String(object.entryPointConversionApp); + if (object.entryPointConversionDelaySeconds != null) + message.entryPointConversionDelaySeconds = object.entryPointConversionDelaySeconds >>> 0; + if (object.disappearingMode != null) { + if (typeof object.disappearingMode !== "object") + throw TypeError(".proto.ContextInfo.disappearingMode: object expected"); + message.disappearingMode = $root.proto.DisappearingMode.fromObject(object.disappearingMode); + } + if (object.actionLink != null) { + if (typeof object.actionLink !== "object") + throw TypeError(".proto.ContextInfo.actionLink: object expected"); + message.actionLink = $root.proto.ActionLink.fromObject(object.actionLink); + } + if (object.groupSubject != null) + message.groupSubject = String(object.groupSubject); + if (object.parentGroupJid != null) + message.parentGroupJid = String(object.parentGroupJid); return message; }; /** - * Creates a plain object from a LabelEditAction message. Also converts values to other types if specified. + * Creates a plain object from a ContextInfo message. Also converts values to other types if specified. * @function toObject - * @memberof proto.LabelEditAction + * @memberof proto.ContextInfo * @static - * @param {proto.LabelEditAction} message LabelEditAction + * @param {proto.ContextInfo} message ContextInfo * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - LabelEditAction.toObject = function toObject(message, options) { + ContextInfo.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.mentionedJid = []; if (options.defaults) { - object.name = ""; - object.color = 0; - object.predefinedId = 0; - object.deleted = false; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.color != null && message.hasOwnProperty("color")) - object.color = message.color; - if (message.predefinedId != null && message.hasOwnProperty("predefinedId")) - object.predefinedId = message.predefinedId; - if (message.deleted != null && message.hasOwnProperty("deleted")) - object.deleted = message.deleted; + object.stanzaId = ""; + object.participant = ""; + object.quotedMessage = null; + object.remoteJid = ""; + object.conversionSource = ""; + if (options.bytes === String) + object.conversionData = ""; + else { + object.conversionData = []; + if (options.bytes !== Array) + object.conversionData = $util.newBuffer(object.conversionData); + } + object.conversionDelaySeconds = 0; + object.forwardingScore = 0; + object.isForwarded = false; + object.quotedAd = null; + object.placeholderKey = null; + object.expiration = 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.ephemeralSettingTimestamp = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.ephemeralSettingTimestamp = options.longs === String ? "0" : 0; + if (options.bytes === String) + object.ephemeralSharedSecret = ""; + else { + object.ephemeralSharedSecret = []; + if (options.bytes !== Array) + object.ephemeralSharedSecret = $util.newBuffer(object.ephemeralSharedSecret); + } + object.externalAdReply = null; + object.entryPointConversionSource = ""; + object.entryPointConversionApp = ""; + object.entryPointConversionDelaySeconds = 0; + object.disappearingMode = null; + object.actionLink = null; + object.groupSubject = ""; + object.parentGroupJid = ""; + } + if (message.stanzaId != null && message.hasOwnProperty("stanzaId")) + object.stanzaId = message.stanzaId; + if (message.participant != null && message.hasOwnProperty("participant")) + object.participant = message.participant; + if (message.quotedMessage != null && message.hasOwnProperty("quotedMessage")) + object.quotedMessage = $root.proto.Message.toObject(message.quotedMessage, options); + if (message.remoteJid != null && message.hasOwnProperty("remoteJid")) + object.remoteJid = message.remoteJid; + if (message.mentionedJid && message.mentionedJid.length) { + object.mentionedJid = []; + for (var j = 0; j < message.mentionedJid.length; ++j) + object.mentionedJid[j] = message.mentionedJid[j]; + } + if (message.conversionSource != null && message.hasOwnProperty("conversionSource")) + object.conversionSource = message.conversionSource; + if (message.conversionData != null && message.hasOwnProperty("conversionData")) + object.conversionData = options.bytes === String ? $util.base64.encode(message.conversionData, 0, message.conversionData.length) : options.bytes === Array ? Array.prototype.slice.call(message.conversionData) : message.conversionData; + if (message.conversionDelaySeconds != null && message.hasOwnProperty("conversionDelaySeconds")) + object.conversionDelaySeconds = message.conversionDelaySeconds; + if (message.forwardingScore != null && message.hasOwnProperty("forwardingScore")) + object.forwardingScore = message.forwardingScore; + if (message.isForwarded != null && message.hasOwnProperty("isForwarded")) + object.isForwarded = message.isForwarded; + if (message.quotedAd != null && message.hasOwnProperty("quotedAd")) + object.quotedAd = $root.proto.AdReplyInfo.toObject(message.quotedAd, options); + if (message.placeholderKey != null && message.hasOwnProperty("placeholderKey")) + object.placeholderKey = $root.proto.MessageKey.toObject(message.placeholderKey, options); + if (message.expiration != null && message.hasOwnProperty("expiration")) + object.expiration = message.expiration; + if (message.ephemeralSettingTimestamp != null && message.hasOwnProperty("ephemeralSettingTimestamp")) + if (typeof message.ephemeralSettingTimestamp === "number") + object.ephemeralSettingTimestamp = options.longs === String ? String(message.ephemeralSettingTimestamp) : message.ephemeralSettingTimestamp; + else + object.ephemeralSettingTimestamp = options.longs === String ? $util.Long.prototype.toString.call(message.ephemeralSettingTimestamp) : options.longs === Number ? new $util.LongBits(message.ephemeralSettingTimestamp.low >>> 0, message.ephemeralSettingTimestamp.high >>> 0).toNumber() : message.ephemeralSettingTimestamp; + if (message.ephemeralSharedSecret != null && message.hasOwnProperty("ephemeralSharedSecret")) + object.ephemeralSharedSecret = options.bytes === String ? $util.base64.encode(message.ephemeralSharedSecret, 0, message.ephemeralSharedSecret.length) : options.bytes === Array ? Array.prototype.slice.call(message.ephemeralSharedSecret) : message.ephemeralSharedSecret; + if (message.externalAdReply != null && message.hasOwnProperty("externalAdReply")) + object.externalAdReply = $root.proto.ExternalAdReplyInfo.toObject(message.externalAdReply, options); + if (message.entryPointConversionSource != null && message.hasOwnProperty("entryPointConversionSource")) + object.entryPointConversionSource = message.entryPointConversionSource; + if (message.entryPointConversionApp != null && message.hasOwnProperty("entryPointConversionApp")) + object.entryPointConversionApp = message.entryPointConversionApp; + if (message.entryPointConversionDelaySeconds != null && message.hasOwnProperty("entryPointConversionDelaySeconds")) + object.entryPointConversionDelaySeconds = message.entryPointConversionDelaySeconds; + if (message.disappearingMode != null && message.hasOwnProperty("disappearingMode")) + object.disappearingMode = $root.proto.DisappearingMode.toObject(message.disappearingMode, options); + if (message.actionLink != null && message.hasOwnProperty("actionLink")) + object.actionLink = $root.proto.ActionLink.toObject(message.actionLink, options); + if (message.groupSubject != null && message.hasOwnProperty("groupSubject")) + object.groupSubject = message.groupSubject; + if (message.parentGroupJid != null && message.hasOwnProperty("parentGroupJid")) + object.parentGroupJid = message.parentGroupJid; return object; }; /** - * Converts this LabelEditAction to JSON. + * Converts this ContextInfo to JSON. * @function toJSON - * @memberof proto.LabelEditAction + * @memberof proto.ContextInfo * @instance * @returns {Object.} JSON object */ - LabelEditAction.prototype.toJSON = function toJSON() { + ContextInfo.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return LabelEditAction; + return ContextInfo; })(); - proto.RecentStickerWeightsAction = (function() { + proto.DeclinePaymentRequestMessage = (function() { /** - * Properties of a RecentStickerWeightsAction. + * Properties of a DeclinePaymentRequestMessage. * @memberof proto - * @interface IRecentStickerWeightsAction - * @property {Array.|null} [weights] RecentStickerWeightsAction weights + * @interface IDeclinePaymentRequestMessage + * @property {proto.IMessageKey|null} [key] DeclinePaymentRequestMessage key */ /** - * Constructs a new RecentStickerWeightsAction. + * Constructs a new DeclinePaymentRequestMessage. * @memberof proto - * @classdesc Represents a RecentStickerWeightsAction. - * @implements IRecentStickerWeightsAction + * @classdesc Represents a DeclinePaymentRequestMessage. + * @implements IDeclinePaymentRequestMessage * @constructor - * @param {proto.IRecentStickerWeightsAction=} [properties] Properties to set + * @param {proto.IDeclinePaymentRequestMessage=} [properties] Properties to set */ - function RecentStickerWeightsAction(properties) { - this.weights = []; + function DeclinePaymentRequestMessage(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -9166,78 +8535,75 @@ $root.proto = (function() { } /** - * RecentStickerWeightsAction weights. - * @member {Array.} weights - * @memberof proto.RecentStickerWeightsAction + * DeclinePaymentRequestMessage key. + * @member {proto.IMessageKey|null|undefined} key + * @memberof proto.DeclinePaymentRequestMessage * @instance */ - RecentStickerWeightsAction.prototype.weights = $util.emptyArray; + DeclinePaymentRequestMessage.prototype.key = null; /** - * Creates a new RecentStickerWeightsAction instance using the specified properties. + * Creates a new DeclinePaymentRequestMessage instance using the specified properties. * @function create - * @memberof proto.RecentStickerWeightsAction + * @memberof proto.DeclinePaymentRequestMessage * @static - * @param {proto.IRecentStickerWeightsAction=} [properties] Properties to set - * @returns {proto.RecentStickerWeightsAction} RecentStickerWeightsAction instance + * @param {proto.IDeclinePaymentRequestMessage=} [properties] Properties to set + * @returns {proto.DeclinePaymentRequestMessage} DeclinePaymentRequestMessage instance */ - RecentStickerWeightsAction.create = function create(properties) { - return new RecentStickerWeightsAction(properties); + DeclinePaymentRequestMessage.create = function create(properties) { + return new DeclinePaymentRequestMessage(properties); }; /** - * Encodes the specified RecentStickerWeightsAction message. Does not implicitly {@link proto.RecentStickerWeightsAction.verify|verify} messages. + * Encodes the specified DeclinePaymentRequestMessage message. Does not implicitly {@link proto.DeclinePaymentRequestMessage.verify|verify} messages. * @function encode - * @memberof proto.RecentStickerWeightsAction + * @memberof proto.DeclinePaymentRequestMessage * @static - * @param {proto.IRecentStickerWeightsAction} message RecentStickerWeightsAction message or plain object to encode + * @param {proto.IDeclinePaymentRequestMessage} message DeclinePaymentRequestMessage message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - RecentStickerWeightsAction.encode = function encode(message, writer) { + DeclinePaymentRequestMessage.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.weights != null && message.weights.length) - for (var i = 0; i < message.weights.length; ++i) - $root.proto.RecentStickerWeight.encode(message.weights[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.key != null && Object.hasOwnProperty.call(message, "key")) + $root.proto.MessageKey.encode(message.key, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; /** - * Encodes the specified RecentStickerWeightsAction message, length delimited. Does not implicitly {@link proto.RecentStickerWeightsAction.verify|verify} messages. + * Encodes the specified DeclinePaymentRequestMessage message, length delimited. Does not implicitly {@link proto.DeclinePaymentRequestMessage.verify|verify} messages. * @function encodeDelimited - * @memberof proto.RecentStickerWeightsAction + * @memberof proto.DeclinePaymentRequestMessage * @static - * @param {proto.IRecentStickerWeightsAction} message RecentStickerWeightsAction message or plain object to encode + * @param {proto.IDeclinePaymentRequestMessage} message DeclinePaymentRequestMessage message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - RecentStickerWeightsAction.encodeDelimited = function encodeDelimited(message, writer) { + DeclinePaymentRequestMessage.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a RecentStickerWeightsAction message from the specified reader or buffer. + * Decodes a DeclinePaymentRequestMessage message from the specified reader or buffer. * @function decode - * @memberof proto.RecentStickerWeightsAction + * @memberof proto.DeclinePaymentRequestMessage * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {proto.RecentStickerWeightsAction} RecentStickerWeightsAction + * @returns {proto.DeclinePaymentRequestMessage} DeclinePaymentRequestMessage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - RecentStickerWeightsAction.decode = function decode(reader, length) { + DeclinePaymentRequestMessage.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.RecentStickerWeightsAction(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.DeclinePaymentRequestMessage(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - if (!(message.weights && message.weights.length)) - message.weights = []; - message.weights.push($root.proto.RecentStickerWeight.decode(reader, reader.uint32())); + message.key = $root.proto.MessageKey.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -9248,130 +8614,119 @@ $root.proto = (function() { }; /** - * Decodes a RecentStickerWeightsAction message from the specified reader or buffer, length delimited. + * Decodes a DeclinePaymentRequestMessage message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof proto.RecentStickerWeightsAction + * @memberof proto.DeclinePaymentRequestMessage * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.RecentStickerWeightsAction} RecentStickerWeightsAction + * @returns {proto.DeclinePaymentRequestMessage} DeclinePaymentRequestMessage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - RecentStickerWeightsAction.decodeDelimited = function decodeDelimited(reader) { + DeclinePaymentRequestMessage.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a RecentStickerWeightsAction message. + * Verifies a DeclinePaymentRequestMessage message. * @function verify - * @memberof proto.RecentStickerWeightsAction + * @memberof proto.DeclinePaymentRequestMessage * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - RecentStickerWeightsAction.verify = function verify(message) { + DeclinePaymentRequestMessage.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.weights != null && message.hasOwnProperty("weights")) { - if (!Array.isArray(message.weights)) - return "weights: array expected"; - for (var i = 0; i < message.weights.length; ++i) { - var error = $root.proto.RecentStickerWeight.verify(message.weights[i]); - if (error) - return "weights." + error; - } + if (message.key != null && message.hasOwnProperty("key")) { + var error = $root.proto.MessageKey.verify(message.key); + if (error) + return "key." + error; } return null; }; /** - * Creates a RecentStickerWeightsAction message from a plain object. Also converts values to their respective internal types. + * Creates a DeclinePaymentRequestMessage message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof proto.RecentStickerWeightsAction + * @memberof proto.DeclinePaymentRequestMessage * @static * @param {Object.} object Plain object - * @returns {proto.RecentStickerWeightsAction} RecentStickerWeightsAction + * @returns {proto.DeclinePaymentRequestMessage} DeclinePaymentRequestMessage */ - RecentStickerWeightsAction.fromObject = function fromObject(object) { - if (object instanceof $root.proto.RecentStickerWeightsAction) + DeclinePaymentRequestMessage.fromObject = function fromObject(object) { + if (object instanceof $root.proto.DeclinePaymentRequestMessage) return object; - var message = new $root.proto.RecentStickerWeightsAction(); - if (object.weights) { - if (!Array.isArray(object.weights)) - throw TypeError(".proto.RecentStickerWeightsAction.weights: array expected"); - message.weights = []; - for (var i = 0; i < object.weights.length; ++i) { - if (typeof object.weights[i] !== "object") - throw TypeError(".proto.RecentStickerWeightsAction.weights: object expected"); - message.weights[i] = $root.proto.RecentStickerWeight.fromObject(object.weights[i]); - } + var message = new $root.proto.DeclinePaymentRequestMessage(); + if (object.key != null) { + if (typeof object.key !== "object") + throw TypeError(".proto.DeclinePaymentRequestMessage.key: object expected"); + message.key = $root.proto.MessageKey.fromObject(object.key); } return message; }; /** - * Creates a plain object from a RecentStickerWeightsAction message. Also converts values to other types if specified. + * Creates a plain object from a DeclinePaymentRequestMessage message. Also converts values to other types if specified. * @function toObject - * @memberof proto.RecentStickerWeightsAction + * @memberof proto.DeclinePaymentRequestMessage * @static - * @param {proto.RecentStickerWeightsAction} message RecentStickerWeightsAction + * @param {proto.DeclinePaymentRequestMessage} message DeclinePaymentRequestMessage * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - RecentStickerWeightsAction.toObject = function toObject(message, options) { + DeclinePaymentRequestMessage.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.weights = []; - if (message.weights && message.weights.length) { - object.weights = []; - for (var j = 0; j < message.weights.length; ++j) - object.weights[j] = $root.proto.RecentStickerWeight.toObject(message.weights[j], options); - } + if (options.defaults) + object.key = null; + if (message.key != null && message.hasOwnProperty("key")) + object.key = $root.proto.MessageKey.toObject(message.key, options); return object; }; /** - * Converts this RecentStickerWeightsAction to JSON. + * Converts this DeclinePaymentRequestMessage to JSON. * @function toJSON - * @memberof proto.RecentStickerWeightsAction + * @memberof proto.DeclinePaymentRequestMessage * @instance * @returns {Object.} JSON object */ - RecentStickerWeightsAction.prototype.toJSON = function toJSON() { + DeclinePaymentRequestMessage.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return RecentStickerWeightsAction; + return DeclinePaymentRequestMessage; })(); - proto.RecentStickerMetadata = (function() { + proto.DeviceListMetadata = (function() { /** - * Properties of a RecentStickerMetadata. + * Properties of a DeviceListMetadata. * @memberof proto - * @interface IRecentStickerMetadata - * @property {string|null} [directPath] RecentStickerMetadata directPath - * @property {string|null} [encFilehash] RecentStickerMetadata encFilehash - * @property {string|null} [mediaKey] RecentStickerMetadata mediaKey - * @property {string|null} [stanzaId] RecentStickerMetadata stanzaId - * @property {string|null} [chatJid] RecentStickerMetadata chatJid - * @property {string|null} [participant] RecentStickerMetadata participant - * @property {boolean|null} [isSentByMe] RecentStickerMetadata isSentByMe + * @interface IDeviceListMetadata + * @property {Uint8Array|null} [senderKeyHash] DeviceListMetadata senderKeyHash + * @property {number|Long|null} [senderTimestamp] DeviceListMetadata senderTimestamp + * @property {Array.|null} [senderKeyIndexes] DeviceListMetadata senderKeyIndexes + * @property {Uint8Array|null} [recipientKeyHash] DeviceListMetadata recipientKeyHash + * @property {number|Long|null} [recipientTimestamp] DeviceListMetadata recipientTimestamp + * @property {Array.|null} [recipientKeyIndexes] DeviceListMetadata recipientKeyIndexes */ /** - * Constructs a new RecentStickerMetadata. + * Constructs a new DeviceListMetadata. * @memberof proto - * @classdesc Represents a RecentStickerMetadata. - * @implements IRecentStickerMetadata + * @classdesc Represents a DeviceListMetadata. + * @implements IDeviceListMetadata * @constructor - * @param {proto.IRecentStickerMetadata=} [properties] Properties to set + * @param {proto.IDeviceListMetadata=} [properties] Properties to set */ - function RecentStickerMetadata(properties) { + function DeviceListMetadata(properties) { + this.senderKeyIndexes = []; + this.recipientKeyIndexes = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -9379,153 +8734,162 @@ $root.proto = (function() { } /** - * RecentStickerMetadata directPath. - * @member {string} directPath - * @memberof proto.RecentStickerMetadata - * @instance - */ - RecentStickerMetadata.prototype.directPath = ""; - - /** - * RecentStickerMetadata encFilehash. - * @member {string} encFilehash - * @memberof proto.RecentStickerMetadata + * DeviceListMetadata senderKeyHash. + * @member {Uint8Array} senderKeyHash + * @memberof proto.DeviceListMetadata * @instance */ - RecentStickerMetadata.prototype.encFilehash = ""; + DeviceListMetadata.prototype.senderKeyHash = $util.newBuffer([]); /** - * RecentStickerMetadata mediaKey. - * @member {string} mediaKey - * @memberof proto.RecentStickerMetadata + * DeviceListMetadata senderTimestamp. + * @member {number|Long} senderTimestamp + * @memberof proto.DeviceListMetadata * @instance */ - RecentStickerMetadata.prototype.mediaKey = ""; + DeviceListMetadata.prototype.senderTimestamp = $util.Long ? $util.Long.fromBits(0,0,true) : 0; /** - * RecentStickerMetadata stanzaId. - * @member {string} stanzaId - * @memberof proto.RecentStickerMetadata + * DeviceListMetadata senderKeyIndexes. + * @member {Array.} senderKeyIndexes + * @memberof proto.DeviceListMetadata * @instance */ - RecentStickerMetadata.prototype.stanzaId = ""; + DeviceListMetadata.prototype.senderKeyIndexes = $util.emptyArray; /** - * RecentStickerMetadata chatJid. - * @member {string} chatJid - * @memberof proto.RecentStickerMetadata + * DeviceListMetadata recipientKeyHash. + * @member {Uint8Array} recipientKeyHash + * @memberof proto.DeviceListMetadata * @instance */ - RecentStickerMetadata.prototype.chatJid = ""; + DeviceListMetadata.prototype.recipientKeyHash = $util.newBuffer([]); /** - * RecentStickerMetadata participant. - * @member {string} participant - * @memberof proto.RecentStickerMetadata + * DeviceListMetadata recipientTimestamp. + * @member {number|Long} recipientTimestamp + * @memberof proto.DeviceListMetadata * @instance */ - RecentStickerMetadata.prototype.participant = ""; + DeviceListMetadata.prototype.recipientTimestamp = $util.Long ? $util.Long.fromBits(0,0,true) : 0; /** - * RecentStickerMetadata isSentByMe. - * @member {boolean} isSentByMe - * @memberof proto.RecentStickerMetadata + * DeviceListMetadata recipientKeyIndexes. + * @member {Array.} recipientKeyIndexes + * @memberof proto.DeviceListMetadata * @instance */ - RecentStickerMetadata.prototype.isSentByMe = false; + DeviceListMetadata.prototype.recipientKeyIndexes = $util.emptyArray; /** - * Creates a new RecentStickerMetadata instance using the specified properties. + * Creates a new DeviceListMetadata instance using the specified properties. * @function create - * @memberof proto.RecentStickerMetadata + * @memberof proto.DeviceListMetadata * @static - * @param {proto.IRecentStickerMetadata=} [properties] Properties to set - * @returns {proto.RecentStickerMetadata} RecentStickerMetadata instance + * @param {proto.IDeviceListMetadata=} [properties] Properties to set + * @returns {proto.DeviceListMetadata} DeviceListMetadata instance */ - RecentStickerMetadata.create = function create(properties) { - return new RecentStickerMetadata(properties); + DeviceListMetadata.create = function create(properties) { + return new DeviceListMetadata(properties); }; /** - * Encodes the specified RecentStickerMetadata message. Does not implicitly {@link proto.RecentStickerMetadata.verify|verify} messages. + * Encodes the specified DeviceListMetadata message. Does not implicitly {@link proto.DeviceListMetadata.verify|verify} messages. * @function encode - * @memberof proto.RecentStickerMetadata + * @memberof proto.DeviceListMetadata * @static - * @param {proto.IRecentStickerMetadata} message RecentStickerMetadata message or plain object to encode + * @param {proto.IDeviceListMetadata} message DeviceListMetadata message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - RecentStickerMetadata.encode = function encode(message, writer) { + DeviceListMetadata.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.directPath != null && Object.hasOwnProperty.call(message, "directPath")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.directPath); - if (message.encFilehash != null && Object.hasOwnProperty.call(message, "encFilehash")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.encFilehash); - if (message.mediaKey != null && Object.hasOwnProperty.call(message, "mediaKey")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.mediaKey); - if (message.stanzaId != null && Object.hasOwnProperty.call(message, "stanzaId")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.stanzaId); - if (message.chatJid != null && Object.hasOwnProperty.call(message, "chatJid")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.chatJid); - if (message.participant != null && Object.hasOwnProperty.call(message, "participant")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.participant); - if (message.isSentByMe != null && Object.hasOwnProperty.call(message, "isSentByMe")) - writer.uint32(/* id 7, wireType 0 =*/56).bool(message.isSentByMe); + if (message.senderKeyHash != null && Object.hasOwnProperty.call(message, "senderKeyHash")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.senderKeyHash); + if (message.senderTimestamp != null && Object.hasOwnProperty.call(message, "senderTimestamp")) + writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.senderTimestamp); + if (message.senderKeyIndexes != null && message.senderKeyIndexes.length) { + writer.uint32(/* id 3, wireType 2 =*/26).fork(); + for (var i = 0; i < message.senderKeyIndexes.length; ++i) + writer.uint32(message.senderKeyIndexes[i]); + writer.ldelim(); + } + if (message.recipientKeyHash != null && Object.hasOwnProperty.call(message, "recipientKeyHash")) + writer.uint32(/* id 8, wireType 2 =*/66).bytes(message.recipientKeyHash); + if (message.recipientTimestamp != null && Object.hasOwnProperty.call(message, "recipientTimestamp")) + writer.uint32(/* id 9, wireType 0 =*/72).uint64(message.recipientTimestamp); + if (message.recipientKeyIndexes != null && message.recipientKeyIndexes.length) { + writer.uint32(/* id 10, wireType 2 =*/82).fork(); + for (var i = 0; i < message.recipientKeyIndexes.length; ++i) + writer.uint32(message.recipientKeyIndexes[i]); + writer.ldelim(); + } return writer; }; /** - * Encodes the specified RecentStickerMetadata message, length delimited. Does not implicitly {@link proto.RecentStickerMetadata.verify|verify} messages. + * Encodes the specified DeviceListMetadata message, length delimited. Does not implicitly {@link proto.DeviceListMetadata.verify|verify} messages. * @function encodeDelimited - * @memberof proto.RecentStickerMetadata + * @memberof proto.DeviceListMetadata * @static - * @param {proto.IRecentStickerMetadata} message RecentStickerMetadata message or plain object to encode + * @param {proto.IDeviceListMetadata} message DeviceListMetadata message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - RecentStickerMetadata.encodeDelimited = function encodeDelimited(message, writer) { + DeviceListMetadata.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a RecentStickerMetadata message from the specified reader or buffer. + * Decodes a DeviceListMetadata message from the specified reader or buffer. * @function decode - * @memberof proto.RecentStickerMetadata + * @memberof proto.DeviceListMetadata * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {proto.RecentStickerMetadata} RecentStickerMetadata + * @returns {proto.DeviceListMetadata} DeviceListMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - RecentStickerMetadata.decode = function decode(reader, length) { + DeviceListMetadata.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.RecentStickerMetadata(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.DeviceListMetadata(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.directPath = reader.string(); + message.senderKeyHash = reader.bytes(); break; case 2: - message.encFilehash = reader.string(); + message.senderTimestamp = reader.uint64(); break; case 3: - message.mediaKey = reader.string(); - break; - case 4: - message.stanzaId = reader.string(); + if (!(message.senderKeyIndexes && message.senderKeyIndexes.length)) + message.senderKeyIndexes = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.senderKeyIndexes.push(reader.uint32()); + } else + message.senderKeyIndexes.push(reader.uint32()); break; - case 5: - message.chatJid = reader.string(); + case 8: + message.recipientKeyHash = reader.bytes(); break; - case 6: - message.participant = reader.string(); + case 9: + message.recipientTimestamp = reader.uint64(); break; - case 7: - message.isSentByMe = reader.bool(); + case 10: + if (!(message.recipientKeyIndexes && message.recipientKeyIndexes.length)) + message.recipientKeyIndexes = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.recipientKeyIndexes.push(reader.uint32()); + } else + message.recipientKeyIndexes.push(reader.uint32()); break; default: reader.skipType(tag & 7); @@ -9536,157 +8900,222 @@ $root.proto = (function() { }; /** - * Decodes a RecentStickerMetadata message from the specified reader or buffer, length delimited. + * Decodes a DeviceListMetadata message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof proto.RecentStickerMetadata + * @memberof proto.DeviceListMetadata * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.RecentStickerMetadata} RecentStickerMetadata + * @returns {proto.DeviceListMetadata} DeviceListMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - RecentStickerMetadata.decodeDelimited = function decodeDelimited(reader) { + DeviceListMetadata.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a RecentStickerMetadata message. + * Verifies a DeviceListMetadata message. * @function verify - * @memberof proto.RecentStickerMetadata + * @memberof proto.DeviceListMetadata * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - RecentStickerMetadata.verify = function verify(message) { + DeviceListMetadata.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.directPath != null && message.hasOwnProperty("directPath")) - if (!$util.isString(message.directPath)) - return "directPath: string expected"; - if (message.encFilehash != null && message.hasOwnProperty("encFilehash")) - if (!$util.isString(message.encFilehash)) - return "encFilehash: string expected"; - if (message.mediaKey != null && message.hasOwnProperty("mediaKey")) - if (!$util.isString(message.mediaKey)) - return "mediaKey: string expected"; - if (message.stanzaId != null && message.hasOwnProperty("stanzaId")) - if (!$util.isString(message.stanzaId)) - return "stanzaId: string expected"; - if (message.chatJid != null && message.hasOwnProperty("chatJid")) - if (!$util.isString(message.chatJid)) - return "chatJid: string expected"; - if (message.participant != null && message.hasOwnProperty("participant")) - if (!$util.isString(message.participant)) - return "participant: string expected"; - if (message.isSentByMe != null && message.hasOwnProperty("isSentByMe")) - if (typeof message.isSentByMe !== "boolean") - return "isSentByMe: boolean expected"; + if (message.senderKeyHash != null && message.hasOwnProperty("senderKeyHash")) + if (!(message.senderKeyHash && typeof message.senderKeyHash.length === "number" || $util.isString(message.senderKeyHash))) + return "senderKeyHash: buffer expected"; + if (message.senderTimestamp != null && message.hasOwnProperty("senderTimestamp")) + if (!$util.isInteger(message.senderTimestamp) && !(message.senderTimestamp && $util.isInteger(message.senderTimestamp.low) && $util.isInteger(message.senderTimestamp.high))) + return "senderTimestamp: integer|Long expected"; + if (message.senderKeyIndexes != null && message.hasOwnProperty("senderKeyIndexes")) { + if (!Array.isArray(message.senderKeyIndexes)) + return "senderKeyIndexes: array expected"; + for (var i = 0; i < message.senderKeyIndexes.length; ++i) + if (!$util.isInteger(message.senderKeyIndexes[i])) + return "senderKeyIndexes: integer[] expected"; + } + if (message.recipientKeyHash != null && message.hasOwnProperty("recipientKeyHash")) + if (!(message.recipientKeyHash && typeof message.recipientKeyHash.length === "number" || $util.isString(message.recipientKeyHash))) + return "recipientKeyHash: buffer expected"; + if (message.recipientTimestamp != null && message.hasOwnProperty("recipientTimestamp")) + if (!$util.isInteger(message.recipientTimestamp) && !(message.recipientTimestamp && $util.isInteger(message.recipientTimestamp.low) && $util.isInteger(message.recipientTimestamp.high))) + return "recipientTimestamp: integer|Long expected"; + if (message.recipientKeyIndexes != null && message.hasOwnProperty("recipientKeyIndexes")) { + if (!Array.isArray(message.recipientKeyIndexes)) + return "recipientKeyIndexes: array expected"; + for (var i = 0; i < message.recipientKeyIndexes.length; ++i) + if (!$util.isInteger(message.recipientKeyIndexes[i])) + return "recipientKeyIndexes: integer[] expected"; + } return null; }; /** - * Creates a RecentStickerMetadata message from a plain object. Also converts values to their respective internal types. + * Creates a DeviceListMetadata message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof proto.RecentStickerMetadata + * @memberof proto.DeviceListMetadata * @static * @param {Object.} object Plain object - * @returns {proto.RecentStickerMetadata} RecentStickerMetadata + * @returns {proto.DeviceListMetadata} DeviceListMetadata */ - RecentStickerMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.proto.RecentStickerMetadata) + DeviceListMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.proto.DeviceListMetadata) return object; - var message = new $root.proto.RecentStickerMetadata(); - if (object.directPath != null) - message.directPath = String(object.directPath); - if (object.encFilehash != null) - message.encFilehash = String(object.encFilehash); - if (object.mediaKey != null) - message.mediaKey = String(object.mediaKey); - if (object.stanzaId != null) - message.stanzaId = String(object.stanzaId); - if (object.chatJid != null) - message.chatJid = String(object.chatJid); - if (object.participant != null) - message.participant = String(object.participant); - if (object.isSentByMe != null) - message.isSentByMe = Boolean(object.isSentByMe); + var message = new $root.proto.DeviceListMetadata(); + if (object.senderKeyHash != null) + if (typeof object.senderKeyHash === "string") + $util.base64.decode(object.senderKeyHash, message.senderKeyHash = $util.newBuffer($util.base64.length(object.senderKeyHash)), 0); + else if (object.senderKeyHash.length) + message.senderKeyHash = object.senderKeyHash; + if (object.senderTimestamp != null) + if ($util.Long) + (message.senderTimestamp = $util.Long.fromValue(object.senderTimestamp)).unsigned = true; + else if (typeof object.senderTimestamp === "string") + message.senderTimestamp = parseInt(object.senderTimestamp, 10); + else if (typeof object.senderTimestamp === "number") + message.senderTimestamp = object.senderTimestamp; + else if (typeof object.senderTimestamp === "object") + message.senderTimestamp = new $util.LongBits(object.senderTimestamp.low >>> 0, object.senderTimestamp.high >>> 0).toNumber(true); + if (object.senderKeyIndexes) { + if (!Array.isArray(object.senderKeyIndexes)) + throw TypeError(".proto.DeviceListMetadata.senderKeyIndexes: array expected"); + message.senderKeyIndexes = []; + for (var i = 0; i < object.senderKeyIndexes.length; ++i) + message.senderKeyIndexes[i] = object.senderKeyIndexes[i] >>> 0; + } + if (object.recipientKeyHash != null) + if (typeof object.recipientKeyHash === "string") + $util.base64.decode(object.recipientKeyHash, message.recipientKeyHash = $util.newBuffer($util.base64.length(object.recipientKeyHash)), 0); + else if (object.recipientKeyHash.length) + message.recipientKeyHash = object.recipientKeyHash; + if (object.recipientTimestamp != null) + if ($util.Long) + (message.recipientTimestamp = $util.Long.fromValue(object.recipientTimestamp)).unsigned = true; + else if (typeof object.recipientTimestamp === "string") + message.recipientTimestamp = parseInt(object.recipientTimestamp, 10); + else if (typeof object.recipientTimestamp === "number") + message.recipientTimestamp = object.recipientTimestamp; + else if (typeof object.recipientTimestamp === "object") + message.recipientTimestamp = new $util.LongBits(object.recipientTimestamp.low >>> 0, object.recipientTimestamp.high >>> 0).toNumber(true); + if (object.recipientKeyIndexes) { + if (!Array.isArray(object.recipientKeyIndexes)) + throw TypeError(".proto.DeviceListMetadata.recipientKeyIndexes: array expected"); + message.recipientKeyIndexes = []; + for (var i = 0; i < object.recipientKeyIndexes.length; ++i) + message.recipientKeyIndexes[i] = object.recipientKeyIndexes[i] >>> 0; + } return message; }; /** - * Creates a plain object from a RecentStickerMetadata message. Also converts values to other types if specified. + * Creates a plain object from a DeviceListMetadata message. Also converts values to other types if specified. * @function toObject - * @memberof proto.RecentStickerMetadata + * @memberof proto.DeviceListMetadata * @static - * @param {proto.RecentStickerMetadata} message RecentStickerMetadata + * @param {proto.DeviceListMetadata} message DeviceListMetadata * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - RecentStickerMetadata.toObject = function toObject(message, options) { + DeviceListMetadata.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) { + object.senderKeyIndexes = []; + object.recipientKeyIndexes = []; + } if (options.defaults) { - object.directPath = ""; - object.encFilehash = ""; - object.mediaKey = ""; - object.stanzaId = ""; - object.chatJid = ""; - object.participant = ""; - object.isSentByMe = false; + if (options.bytes === String) + object.senderKeyHash = ""; + else { + object.senderKeyHash = []; + if (options.bytes !== Array) + object.senderKeyHash = $util.newBuffer(object.senderKeyHash); + } + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.senderTimestamp = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.senderTimestamp = options.longs === String ? "0" : 0; + if (options.bytes === String) + object.recipientKeyHash = ""; + else { + object.recipientKeyHash = []; + if (options.bytes !== Array) + object.recipientKeyHash = $util.newBuffer(object.recipientKeyHash); + } + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.recipientTimestamp = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.recipientTimestamp = options.longs === String ? "0" : 0; + } + if (message.senderKeyHash != null && message.hasOwnProperty("senderKeyHash")) + object.senderKeyHash = options.bytes === String ? $util.base64.encode(message.senderKeyHash, 0, message.senderKeyHash.length) : options.bytes === Array ? Array.prototype.slice.call(message.senderKeyHash) : message.senderKeyHash; + if (message.senderTimestamp != null && message.hasOwnProperty("senderTimestamp")) + if (typeof message.senderTimestamp === "number") + object.senderTimestamp = options.longs === String ? String(message.senderTimestamp) : message.senderTimestamp; + else + object.senderTimestamp = options.longs === String ? $util.Long.prototype.toString.call(message.senderTimestamp) : options.longs === Number ? new $util.LongBits(message.senderTimestamp.low >>> 0, message.senderTimestamp.high >>> 0).toNumber(true) : message.senderTimestamp; + if (message.senderKeyIndexes && message.senderKeyIndexes.length) { + object.senderKeyIndexes = []; + for (var j = 0; j < message.senderKeyIndexes.length; ++j) + object.senderKeyIndexes[j] = message.senderKeyIndexes[j]; + } + if (message.recipientKeyHash != null && message.hasOwnProperty("recipientKeyHash")) + object.recipientKeyHash = options.bytes === String ? $util.base64.encode(message.recipientKeyHash, 0, message.recipientKeyHash.length) : options.bytes === Array ? Array.prototype.slice.call(message.recipientKeyHash) : message.recipientKeyHash; + if (message.recipientTimestamp != null && message.hasOwnProperty("recipientTimestamp")) + if (typeof message.recipientTimestamp === "number") + object.recipientTimestamp = options.longs === String ? String(message.recipientTimestamp) : message.recipientTimestamp; + else + object.recipientTimestamp = options.longs === String ? $util.Long.prototype.toString.call(message.recipientTimestamp) : options.longs === Number ? new $util.LongBits(message.recipientTimestamp.low >>> 0, message.recipientTimestamp.high >>> 0).toNumber(true) : message.recipientTimestamp; + if (message.recipientKeyIndexes && message.recipientKeyIndexes.length) { + object.recipientKeyIndexes = []; + for (var j = 0; j < message.recipientKeyIndexes.length; ++j) + object.recipientKeyIndexes[j] = message.recipientKeyIndexes[j]; } - if (message.directPath != null && message.hasOwnProperty("directPath")) - object.directPath = message.directPath; - if (message.encFilehash != null && message.hasOwnProperty("encFilehash")) - object.encFilehash = message.encFilehash; - if (message.mediaKey != null && message.hasOwnProperty("mediaKey")) - object.mediaKey = message.mediaKey; - if (message.stanzaId != null && message.hasOwnProperty("stanzaId")) - object.stanzaId = message.stanzaId; - if (message.chatJid != null && message.hasOwnProperty("chatJid")) - object.chatJid = message.chatJid; - if (message.participant != null && message.hasOwnProperty("participant")) - object.participant = message.participant; - if (message.isSentByMe != null && message.hasOwnProperty("isSentByMe")) - object.isSentByMe = message.isSentByMe; return object; }; /** - * Converts this RecentStickerMetadata to JSON. + * Converts this DeviceListMetadata to JSON. * @function toJSON - * @memberof proto.RecentStickerMetadata + * @memberof proto.DeviceListMetadata * @instance * @returns {Object.} JSON object */ - RecentStickerMetadata.prototype.toJSON = function toJSON() { + DeviceListMetadata.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return RecentStickerMetadata; + return DeviceListMetadata; })(); - proto.RecentEmojiWeightsAction = (function() { + proto.DeviceSentMessage = (function() { /** - * Properties of a RecentEmojiWeightsAction. + * Properties of a DeviceSentMessage. * @memberof proto - * @interface IRecentEmojiWeightsAction - * @property {Array.|null} [weights] RecentEmojiWeightsAction weights + * @interface IDeviceSentMessage + * @property {string|null} [destinationJid] DeviceSentMessage destinationJid + * @property {proto.IMessage|null} [message] DeviceSentMessage message + * @property {string|null} [phash] DeviceSentMessage phash */ /** - * Constructs a new RecentEmojiWeightsAction. + * Constructs a new DeviceSentMessage. * @memberof proto - * @classdesc Represents a RecentEmojiWeightsAction. - * @implements IRecentEmojiWeightsAction + * @classdesc Represents a DeviceSentMessage. + * @implements IDeviceSentMessage * @constructor - * @param {proto.IRecentEmojiWeightsAction=} [properties] Properties to set + * @param {proto.IDeviceSentMessage=} [properties] Properties to set */ - function RecentEmojiWeightsAction(properties) { - this.weights = []; + function DeviceSentMessage(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -9694,78 +9123,101 @@ $root.proto = (function() { } /** - * RecentEmojiWeightsAction weights. - * @member {Array.} weights - * @memberof proto.RecentEmojiWeightsAction + * DeviceSentMessage destinationJid. + * @member {string} destinationJid + * @memberof proto.DeviceSentMessage * @instance */ - RecentEmojiWeightsAction.prototype.weights = $util.emptyArray; + DeviceSentMessage.prototype.destinationJid = ""; /** - * Creates a new RecentEmojiWeightsAction instance using the specified properties. + * DeviceSentMessage message. + * @member {proto.IMessage|null|undefined} message + * @memberof proto.DeviceSentMessage + * @instance + */ + DeviceSentMessage.prototype.message = null; + + /** + * DeviceSentMessage phash. + * @member {string} phash + * @memberof proto.DeviceSentMessage + * @instance + */ + DeviceSentMessage.prototype.phash = ""; + + /** + * Creates a new DeviceSentMessage instance using the specified properties. * @function create - * @memberof proto.RecentEmojiWeightsAction + * @memberof proto.DeviceSentMessage * @static - * @param {proto.IRecentEmojiWeightsAction=} [properties] Properties to set - * @returns {proto.RecentEmojiWeightsAction} RecentEmojiWeightsAction instance + * @param {proto.IDeviceSentMessage=} [properties] Properties to set + * @returns {proto.DeviceSentMessage} DeviceSentMessage instance */ - RecentEmojiWeightsAction.create = function create(properties) { - return new RecentEmojiWeightsAction(properties); + DeviceSentMessage.create = function create(properties) { + return new DeviceSentMessage(properties); }; /** - * Encodes the specified RecentEmojiWeightsAction message. Does not implicitly {@link proto.RecentEmojiWeightsAction.verify|verify} messages. + * Encodes the specified DeviceSentMessage message. Does not implicitly {@link proto.DeviceSentMessage.verify|verify} messages. * @function encode - * @memberof proto.RecentEmojiWeightsAction + * @memberof proto.DeviceSentMessage * @static - * @param {proto.IRecentEmojiWeightsAction} message RecentEmojiWeightsAction message or plain object to encode + * @param {proto.IDeviceSentMessage} message DeviceSentMessage message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - RecentEmojiWeightsAction.encode = function encode(message, writer) { + DeviceSentMessage.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.weights != null && message.weights.length) - for (var i = 0; i < message.weights.length; ++i) - $root.proto.RecentEmojiWeight.encode(message.weights[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.destinationJid != null && Object.hasOwnProperty.call(message, "destinationJid")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.destinationJid); + if (message.message != null && Object.hasOwnProperty.call(message, "message")) + $root.proto.Message.encode(message.message, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.phash != null && Object.hasOwnProperty.call(message, "phash")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.phash); return writer; }; /** - * Encodes the specified RecentEmojiWeightsAction message, length delimited. Does not implicitly {@link proto.RecentEmojiWeightsAction.verify|verify} messages. + * Encodes the specified DeviceSentMessage message, length delimited. Does not implicitly {@link proto.DeviceSentMessage.verify|verify} messages. * @function encodeDelimited - * @memberof proto.RecentEmojiWeightsAction + * @memberof proto.DeviceSentMessage * @static - * @param {proto.IRecentEmojiWeightsAction} message RecentEmojiWeightsAction message or plain object to encode + * @param {proto.IDeviceSentMessage} message DeviceSentMessage message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - RecentEmojiWeightsAction.encodeDelimited = function encodeDelimited(message, writer) { + DeviceSentMessage.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a RecentEmojiWeightsAction message from the specified reader or buffer. + * Decodes a DeviceSentMessage message from the specified reader or buffer. * @function decode - * @memberof proto.RecentEmojiWeightsAction + * @memberof proto.DeviceSentMessage * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {proto.RecentEmojiWeightsAction} RecentEmojiWeightsAction + * @returns {proto.DeviceSentMessage} DeviceSentMessage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - RecentEmojiWeightsAction.decode = function decode(reader, length) { + DeviceSentMessage.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.RecentEmojiWeightsAction(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.DeviceSentMessage(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - if (!(message.weights && message.weights.length)) - message.weights = []; - message.weights.push($root.proto.RecentEmojiWeight.decode(reader, reader.uint32())); + message.destinationJid = reader.string(); + break; + case 2: + message.message = $root.proto.Message.decode(reader, reader.uint32()); + break; + case 3: + message.phash = reader.string(); break; default: reader.skipType(tag & 7); @@ -9776,131 +9228,129 @@ $root.proto = (function() { }; /** - * Decodes a RecentEmojiWeightsAction message from the specified reader or buffer, length delimited. + * Decodes a DeviceSentMessage message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof proto.RecentEmojiWeightsAction + * @memberof proto.DeviceSentMessage * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.RecentEmojiWeightsAction} RecentEmojiWeightsAction + * @returns {proto.DeviceSentMessage} DeviceSentMessage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - RecentEmojiWeightsAction.decodeDelimited = function decodeDelimited(reader) { + DeviceSentMessage.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a RecentEmojiWeightsAction message. + * Verifies a DeviceSentMessage message. * @function verify - * @memberof proto.RecentEmojiWeightsAction + * @memberof proto.DeviceSentMessage * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - RecentEmojiWeightsAction.verify = function verify(message) { + DeviceSentMessage.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.weights != null && message.hasOwnProperty("weights")) { - if (!Array.isArray(message.weights)) - return "weights: array expected"; - for (var i = 0; i < message.weights.length; ++i) { - var error = $root.proto.RecentEmojiWeight.verify(message.weights[i]); - if (error) - return "weights." + error; - } + if (message.destinationJid != null && message.hasOwnProperty("destinationJid")) + if (!$util.isString(message.destinationJid)) + return "destinationJid: string expected"; + if (message.message != null && message.hasOwnProperty("message")) { + var error = $root.proto.Message.verify(message.message); + if (error) + return "message." + error; } + if (message.phash != null && message.hasOwnProperty("phash")) + if (!$util.isString(message.phash)) + return "phash: string expected"; return null; }; /** - * Creates a RecentEmojiWeightsAction message from a plain object. Also converts values to their respective internal types. + * Creates a DeviceSentMessage message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof proto.RecentEmojiWeightsAction + * @memberof proto.DeviceSentMessage * @static * @param {Object.} object Plain object - * @returns {proto.RecentEmojiWeightsAction} RecentEmojiWeightsAction + * @returns {proto.DeviceSentMessage} DeviceSentMessage */ - RecentEmojiWeightsAction.fromObject = function fromObject(object) { - if (object instanceof $root.proto.RecentEmojiWeightsAction) + DeviceSentMessage.fromObject = function fromObject(object) { + if (object instanceof $root.proto.DeviceSentMessage) return object; - var message = new $root.proto.RecentEmojiWeightsAction(); - if (object.weights) { - if (!Array.isArray(object.weights)) - throw TypeError(".proto.RecentEmojiWeightsAction.weights: array expected"); - message.weights = []; - for (var i = 0; i < object.weights.length; ++i) { - if (typeof object.weights[i] !== "object") - throw TypeError(".proto.RecentEmojiWeightsAction.weights: object expected"); - message.weights[i] = $root.proto.RecentEmojiWeight.fromObject(object.weights[i]); - } + var message = new $root.proto.DeviceSentMessage(); + if (object.destinationJid != null) + message.destinationJid = String(object.destinationJid); + if (object.message != null) { + if (typeof object.message !== "object") + throw TypeError(".proto.DeviceSentMessage.message: object expected"); + message.message = $root.proto.Message.fromObject(object.message); } + if (object.phash != null) + message.phash = String(object.phash); return message; }; /** - * Creates a plain object from a RecentEmojiWeightsAction message. Also converts values to other types if specified. + * Creates a plain object from a DeviceSentMessage message. Also converts values to other types if specified. * @function toObject - * @memberof proto.RecentEmojiWeightsAction + * @memberof proto.DeviceSentMessage * @static - * @param {proto.RecentEmojiWeightsAction} message RecentEmojiWeightsAction + * @param {proto.DeviceSentMessage} message DeviceSentMessage * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - RecentEmojiWeightsAction.toObject = function toObject(message, options) { + DeviceSentMessage.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.weights = []; - if (message.weights && message.weights.length) { - object.weights = []; - for (var j = 0; j < message.weights.length; ++j) - object.weights[j] = $root.proto.RecentEmojiWeight.toObject(message.weights[j], options); + if (options.defaults) { + object.destinationJid = ""; + object.message = null; + object.phash = ""; } + if (message.destinationJid != null && message.hasOwnProperty("destinationJid")) + object.destinationJid = message.destinationJid; + if (message.message != null && message.hasOwnProperty("message")) + object.message = $root.proto.Message.toObject(message.message, options); + if (message.phash != null && message.hasOwnProperty("phash")) + object.phash = message.phash; return object; }; /** - * Converts this RecentEmojiWeightsAction to JSON. + * Converts this DeviceSentMessage to JSON. * @function toJSON - * @memberof proto.RecentEmojiWeightsAction + * @memberof proto.DeviceSentMessage * @instance * @returns {Object.} JSON object */ - RecentEmojiWeightsAction.prototype.toJSON = function toJSON() { + DeviceSentMessage.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return RecentEmojiWeightsAction; + return DeviceSentMessage; })(); - proto.FavoriteStickerAction = (function() { + proto.DisappearingMode = (function() { /** - * Properties of a FavoriteStickerAction. + * Properties of a DisappearingMode. * @memberof proto - * @interface IFavoriteStickerAction - * @property {string|null} [directPath] FavoriteStickerAction directPath - * @property {string|null} [lastUploadTimestamp] FavoriteStickerAction lastUploadTimestamp - * @property {string|null} [handle] FavoriteStickerAction handle - * @property {string|null} [encFilehash] FavoriteStickerAction encFilehash - * @property {string|null} [stickerHashWithoutMeta] FavoriteStickerAction stickerHashWithoutMeta - * @property {string|null} [mediaKey] FavoriteStickerAction mediaKey - * @property {number|Long|null} [mediaKeyTimestamp] FavoriteStickerAction mediaKeyTimestamp - * @property {boolean|null} [isFavorite] FavoriteStickerAction isFavorite + * @interface IDisappearingMode + * @property {proto.DisappearingMode.DisappearingModeInitiator|null} [initiator] DisappearingMode initiator */ /** - * Constructs a new FavoriteStickerAction. + * Constructs a new DisappearingMode. * @memberof proto - * @classdesc Represents a FavoriteStickerAction. - * @implements IFavoriteStickerAction + * @classdesc Represents a DisappearingMode. + * @implements IDisappearingMode * @constructor - * @param {proto.IFavoriteStickerAction=} [properties] Properties to set + * @param {proto.IDisappearingMode=} [properties] Properties to set */ - function FavoriteStickerAction(properties) { + function DisappearingMode(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -9908,169 +9358,78 @@ $root.proto = (function() { } /** - * FavoriteStickerAction directPath. - * @member {string} directPath - * @memberof proto.FavoriteStickerAction - * @instance - */ - FavoriteStickerAction.prototype.directPath = ""; - - /** - * FavoriteStickerAction lastUploadTimestamp. - * @member {string} lastUploadTimestamp - * @memberof proto.FavoriteStickerAction - * @instance - */ - FavoriteStickerAction.prototype.lastUploadTimestamp = ""; - - /** - * FavoriteStickerAction handle. - * @member {string} handle - * @memberof proto.FavoriteStickerAction - * @instance - */ - FavoriteStickerAction.prototype.handle = ""; - - /** - * FavoriteStickerAction encFilehash. - * @member {string} encFilehash - * @memberof proto.FavoriteStickerAction - * @instance - */ - FavoriteStickerAction.prototype.encFilehash = ""; - - /** - * FavoriteStickerAction stickerHashWithoutMeta. - * @member {string} stickerHashWithoutMeta - * @memberof proto.FavoriteStickerAction - * @instance - */ - FavoriteStickerAction.prototype.stickerHashWithoutMeta = ""; - - /** - * FavoriteStickerAction mediaKey. - * @member {string} mediaKey - * @memberof proto.FavoriteStickerAction - * @instance - */ - FavoriteStickerAction.prototype.mediaKey = ""; - - /** - * FavoriteStickerAction mediaKeyTimestamp. - * @member {number|Long} mediaKeyTimestamp - * @memberof proto.FavoriteStickerAction - * @instance - */ - FavoriteStickerAction.prototype.mediaKeyTimestamp = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * FavoriteStickerAction isFavorite. - * @member {boolean} isFavorite - * @memberof proto.FavoriteStickerAction + * DisappearingMode initiator. + * @member {proto.DisappearingMode.DisappearingModeInitiator} initiator + * @memberof proto.DisappearingMode * @instance */ - FavoriteStickerAction.prototype.isFavorite = false; + DisappearingMode.prototype.initiator = 0; /** - * Creates a new FavoriteStickerAction instance using the specified properties. + * Creates a new DisappearingMode instance using the specified properties. * @function create - * @memberof proto.FavoriteStickerAction + * @memberof proto.DisappearingMode * @static - * @param {proto.IFavoriteStickerAction=} [properties] Properties to set - * @returns {proto.FavoriteStickerAction} FavoriteStickerAction instance + * @param {proto.IDisappearingMode=} [properties] Properties to set + * @returns {proto.DisappearingMode} DisappearingMode instance */ - FavoriteStickerAction.create = function create(properties) { - return new FavoriteStickerAction(properties); + DisappearingMode.create = function create(properties) { + return new DisappearingMode(properties); }; /** - * Encodes the specified FavoriteStickerAction message. Does not implicitly {@link proto.FavoriteStickerAction.verify|verify} messages. + * Encodes the specified DisappearingMode message. Does not implicitly {@link proto.DisappearingMode.verify|verify} messages. * @function encode - * @memberof proto.FavoriteStickerAction + * @memberof proto.DisappearingMode * @static - * @param {proto.IFavoriteStickerAction} message FavoriteStickerAction message or plain object to encode + * @param {proto.IDisappearingMode} message DisappearingMode message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - FavoriteStickerAction.encode = function encode(message, writer) { + DisappearingMode.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.directPath != null && Object.hasOwnProperty.call(message, "directPath")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.directPath); - if (message.lastUploadTimestamp != null && Object.hasOwnProperty.call(message, "lastUploadTimestamp")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.lastUploadTimestamp); - if (message.handle != null && Object.hasOwnProperty.call(message, "handle")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.handle); - if (message.encFilehash != null && Object.hasOwnProperty.call(message, "encFilehash")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.encFilehash); - if (message.stickerHashWithoutMeta != null && Object.hasOwnProperty.call(message, "stickerHashWithoutMeta")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.stickerHashWithoutMeta); - if (message.mediaKey != null && Object.hasOwnProperty.call(message, "mediaKey")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.mediaKey); - if (message.mediaKeyTimestamp != null && Object.hasOwnProperty.call(message, "mediaKeyTimestamp")) - writer.uint32(/* id 7, wireType 0 =*/56).int64(message.mediaKeyTimestamp); - if (message.isFavorite != null && Object.hasOwnProperty.call(message, "isFavorite")) - writer.uint32(/* id 8, wireType 0 =*/64).bool(message.isFavorite); + if (message.initiator != null && Object.hasOwnProperty.call(message, "initiator")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.initiator); return writer; }; /** - * Encodes the specified FavoriteStickerAction message, length delimited. Does not implicitly {@link proto.FavoriteStickerAction.verify|verify} messages. + * Encodes the specified DisappearingMode message, length delimited. Does not implicitly {@link proto.DisappearingMode.verify|verify} messages. * @function encodeDelimited - * @memberof proto.FavoriteStickerAction + * @memberof proto.DisappearingMode * @static - * @param {proto.IFavoriteStickerAction} message FavoriteStickerAction message or plain object to encode + * @param {proto.IDisappearingMode} message DisappearingMode message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - FavoriteStickerAction.encodeDelimited = function encodeDelimited(message, writer) { + DisappearingMode.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a FavoriteStickerAction message from the specified reader or buffer. + * Decodes a DisappearingMode message from the specified reader or buffer. * @function decode - * @memberof proto.FavoriteStickerAction + * @memberof proto.DisappearingMode * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {proto.FavoriteStickerAction} FavoriteStickerAction + * @returns {proto.DisappearingMode} DisappearingMode * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - FavoriteStickerAction.decode = function decode(reader, length) { + DisappearingMode.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.FavoriteStickerAction(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.DisappearingMode(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.directPath = reader.string(); - break; - case 2: - message.lastUploadTimestamp = reader.string(); - break; - case 3: - message.handle = reader.string(); - break; - case 4: - message.encFilehash = reader.string(); - break; - case 5: - message.stickerHashWithoutMeta = reader.string(); + message.initiator = reader.int32(); break; - case 6: - message.mediaKey = reader.string(); - break; - case 7: - message.mediaKeyTimestamp = reader.int64(); - break; - case 8: - message.isFavorite = reader.bool(); - break; - default: - reader.skipType(tag & 7); + default: + reader.skipType(tag & 7); break; } } @@ -10078,179 +9437,159 @@ $root.proto = (function() { }; /** - * Decodes a FavoriteStickerAction message from the specified reader or buffer, length delimited. + * Decodes a DisappearingMode message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof proto.FavoriteStickerAction + * @memberof proto.DisappearingMode * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.FavoriteStickerAction} FavoriteStickerAction + * @returns {proto.DisappearingMode} DisappearingMode * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - FavoriteStickerAction.decodeDelimited = function decodeDelimited(reader) { + DisappearingMode.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a FavoriteStickerAction message. + * Verifies a DisappearingMode message. * @function verify - * @memberof proto.FavoriteStickerAction + * @memberof proto.DisappearingMode * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - FavoriteStickerAction.verify = function verify(message) { + DisappearingMode.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.directPath != null && message.hasOwnProperty("directPath")) - if (!$util.isString(message.directPath)) - return "directPath: string expected"; - if (message.lastUploadTimestamp != null && message.hasOwnProperty("lastUploadTimestamp")) - if (!$util.isString(message.lastUploadTimestamp)) - return "lastUploadTimestamp: string expected"; - if (message.handle != null && message.hasOwnProperty("handle")) - if (!$util.isString(message.handle)) - return "handle: string expected"; - if (message.encFilehash != null && message.hasOwnProperty("encFilehash")) - if (!$util.isString(message.encFilehash)) - return "encFilehash: string expected"; - if (message.stickerHashWithoutMeta != null && message.hasOwnProperty("stickerHashWithoutMeta")) - if (!$util.isString(message.stickerHashWithoutMeta)) - return "stickerHashWithoutMeta: string expected"; - if (message.mediaKey != null && message.hasOwnProperty("mediaKey")) - if (!$util.isString(message.mediaKey)) - return "mediaKey: string expected"; - if (message.mediaKeyTimestamp != null && message.hasOwnProperty("mediaKeyTimestamp")) - if (!$util.isInteger(message.mediaKeyTimestamp) && !(message.mediaKeyTimestamp && $util.isInteger(message.mediaKeyTimestamp.low) && $util.isInteger(message.mediaKeyTimestamp.high))) - return "mediaKeyTimestamp: integer|Long expected"; - if (message.isFavorite != null && message.hasOwnProperty("isFavorite")) - if (typeof message.isFavorite !== "boolean") - return "isFavorite: boolean expected"; + if (message.initiator != null && message.hasOwnProperty("initiator")) + switch (message.initiator) { + default: + return "initiator: enum value expected"; + case 0: + case 1: + case 2: + break; + } return null; }; /** - * Creates a FavoriteStickerAction message from a plain object. Also converts values to their respective internal types. + * Creates a DisappearingMode message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof proto.FavoriteStickerAction + * @memberof proto.DisappearingMode * @static * @param {Object.} object Plain object - * @returns {proto.FavoriteStickerAction} FavoriteStickerAction + * @returns {proto.DisappearingMode} DisappearingMode */ - FavoriteStickerAction.fromObject = function fromObject(object) { - if (object instanceof $root.proto.FavoriteStickerAction) + DisappearingMode.fromObject = function fromObject(object) { + if (object instanceof $root.proto.DisappearingMode) return object; - var message = new $root.proto.FavoriteStickerAction(); - if (object.directPath != null) - message.directPath = String(object.directPath); - if (object.lastUploadTimestamp != null) - message.lastUploadTimestamp = String(object.lastUploadTimestamp); - if (object.handle != null) - message.handle = String(object.handle); - if (object.encFilehash != null) - message.encFilehash = String(object.encFilehash); - if (object.stickerHashWithoutMeta != null) - message.stickerHashWithoutMeta = String(object.stickerHashWithoutMeta); - if (object.mediaKey != null) - message.mediaKey = String(object.mediaKey); - if (object.mediaKeyTimestamp != null) - if ($util.Long) - (message.mediaKeyTimestamp = $util.Long.fromValue(object.mediaKeyTimestamp)).unsigned = false; - else if (typeof object.mediaKeyTimestamp === "string") - message.mediaKeyTimestamp = parseInt(object.mediaKeyTimestamp, 10); - else if (typeof object.mediaKeyTimestamp === "number") - message.mediaKeyTimestamp = object.mediaKeyTimestamp; - else if (typeof object.mediaKeyTimestamp === "object") - message.mediaKeyTimestamp = new $util.LongBits(object.mediaKeyTimestamp.low >>> 0, object.mediaKeyTimestamp.high >>> 0).toNumber(); - if (object.isFavorite != null) - message.isFavorite = Boolean(object.isFavorite); + var message = new $root.proto.DisappearingMode(); + switch (object.initiator) { + case "CHANGED_IN_CHAT": + case 0: + message.initiator = 0; + break; + case "INITIATED_BY_ME": + case 1: + message.initiator = 1; + break; + case "INITIATED_BY_OTHER": + case 2: + message.initiator = 2; + break; + } return message; }; /** - * Creates a plain object from a FavoriteStickerAction message. Also converts values to other types if specified. + * Creates a plain object from a DisappearingMode message. Also converts values to other types if specified. * @function toObject - * @memberof proto.FavoriteStickerAction + * @memberof proto.DisappearingMode * @static - * @param {proto.FavoriteStickerAction} message FavoriteStickerAction + * @param {proto.DisappearingMode} message DisappearingMode * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - FavoriteStickerAction.toObject = function toObject(message, options) { + DisappearingMode.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.directPath = ""; - object.lastUploadTimestamp = ""; - object.handle = ""; - object.encFilehash = ""; - object.stickerHashWithoutMeta = ""; - object.mediaKey = ""; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.mediaKeyTimestamp = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.mediaKeyTimestamp = options.longs === String ? "0" : 0; - object.isFavorite = false; - } - if (message.directPath != null && message.hasOwnProperty("directPath")) - object.directPath = message.directPath; - if (message.lastUploadTimestamp != null && message.hasOwnProperty("lastUploadTimestamp")) - object.lastUploadTimestamp = message.lastUploadTimestamp; - if (message.handle != null && message.hasOwnProperty("handle")) - object.handle = message.handle; - if (message.encFilehash != null && message.hasOwnProperty("encFilehash")) - object.encFilehash = message.encFilehash; - if (message.stickerHashWithoutMeta != null && message.hasOwnProperty("stickerHashWithoutMeta")) - object.stickerHashWithoutMeta = message.stickerHashWithoutMeta; - if (message.mediaKey != null && message.hasOwnProperty("mediaKey")) - object.mediaKey = message.mediaKey; - if (message.mediaKeyTimestamp != null && message.hasOwnProperty("mediaKeyTimestamp")) - if (typeof message.mediaKeyTimestamp === "number") - object.mediaKeyTimestamp = options.longs === String ? String(message.mediaKeyTimestamp) : message.mediaKeyTimestamp; - else - object.mediaKeyTimestamp = options.longs === String ? $util.Long.prototype.toString.call(message.mediaKeyTimestamp) : options.longs === Number ? new $util.LongBits(message.mediaKeyTimestamp.low >>> 0, message.mediaKeyTimestamp.high >>> 0).toNumber() : message.mediaKeyTimestamp; - if (message.isFavorite != null && message.hasOwnProperty("isFavorite")) - object.isFavorite = message.isFavorite; + if (options.defaults) + object.initiator = options.enums === String ? "CHANGED_IN_CHAT" : 0; + if (message.initiator != null && message.hasOwnProperty("initiator")) + object.initiator = options.enums === String ? $root.proto.DisappearingMode.DisappearingModeInitiator[message.initiator] : message.initiator; return object; }; /** - * Converts this FavoriteStickerAction to JSON. + * Converts this DisappearingMode to JSON. * @function toJSON - * @memberof proto.FavoriteStickerAction + * @memberof proto.DisappearingMode * @instance * @returns {Object.} JSON object */ - FavoriteStickerAction.prototype.toJSON = function toJSON() { + DisappearingMode.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return FavoriteStickerAction; + /** + * DisappearingModeInitiator enum. + * @name proto.DisappearingMode.DisappearingModeInitiator + * @enum {number} + * @property {number} CHANGED_IN_CHAT=0 CHANGED_IN_CHAT value + * @property {number} INITIATED_BY_ME=1 INITIATED_BY_ME value + * @property {number} INITIATED_BY_OTHER=2 INITIATED_BY_OTHER value + */ + DisappearingMode.DisappearingModeInitiator = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CHANGED_IN_CHAT"] = 0; + values[valuesById[1] = "INITIATED_BY_ME"] = 1; + values[valuesById[2] = "INITIATED_BY_OTHER"] = 2; + return values; + })(); + + return DisappearingMode; })(); - proto.ArchiveChatAction = (function() { + proto.DocumentMessage = (function() { /** - * Properties of an ArchiveChatAction. + * Properties of a DocumentMessage. * @memberof proto - * @interface IArchiveChatAction - * @property {boolean|null} [archived] ArchiveChatAction archived - * @property {proto.ISyncActionMessageRange|null} [messageRange] ArchiveChatAction messageRange + * @interface IDocumentMessage + * @property {string|null} [url] DocumentMessage url + * @property {string|null} [mimetype] DocumentMessage mimetype + * @property {string|null} [title] DocumentMessage title + * @property {Uint8Array|null} [fileSha256] DocumentMessage fileSha256 + * @property {number|Long|null} [fileLength] DocumentMessage fileLength + * @property {number|null} [pageCount] DocumentMessage pageCount + * @property {Uint8Array|null} [mediaKey] DocumentMessage mediaKey + * @property {string|null} [fileName] DocumentMessage fileName + * @property {Uint8Array|null} [fileEncSha256] DocumentMessage fileEncSha256 + * @property {string|null} [directPath] DocumentMessage directPath + * @property {number|Long|null} [mediaKeyTimestamp] DocumentMessage mediaKeyTimestamp + * @property {boolean|null} [contactVcard] DocumentMessage contactVcard + * @property {string|null} [thumbnailDirectPath] DocumentMessage thumbnailDirectPath + * @property {Uint8Array|null} [thumbnailSha256] DocumentMessage thumbnailSha256 + * @property {Uint8Array|null} [thumbnailEncSha256] DocumentMessage thumbnailEncSha256 + * @property {Uint8Array|null} [jpegThumbnail] DocumentMessage jpegThumbnail + * @property {proto.IContextInfo|null} [contextInfo] DocumentMessage contextInfo + * @property {number|null} [thumbnailHeight] DocumentMessage thumbnailHeight + * @property {number|null} [thumbnailWidth] DocumentMessage thumbnailWidth */ /** - * Constructs a new ArchiveChatAction. + * Constructs a new DocumentMessage. * @memberof proto - * @classdesc Represents an ArchiveChatAction. - * @implements IArchiveChatAction + * @classdesc Represents a DocumentMessage. + * @implements IDocumentMessage * @constructor - * @param {proto.IArchiveChatAction=} [properties] Properties to set + * @param {proto.IDocumentMessage=} [properties] Properties to set */ - function ArchiveChatAction(properties) { + function DocumentMessage(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -10258,88 +9597,309 @@ $root.proto = (function() { } /** - * ArchiveChatAction archived. - * @member {boolean} archived - * @memberof proto.ArchiveChatAction + * DocumentMessage url. + * @member {string} url + * @memberof proto.DocumentMessage * @instance */ - ArchiveChatAction.prototype.archived = false; + DocumentMessage.prototype.url = ""; /** - * ArchiveChatAction messageRange. - * @member {proto.ISyncActionMessageRange|null|undefined} messageRange - * @memberof proto.ArchiveChatAction + * DocumentMessage mimetype. + * @member {string} mimetype + * @memberof proto.DocumentMessage * @instance */ - ArchiveChatAction.prototype.messageRange = null; + DocumentMessage.prototype.mimetype = ""; /** - * Creates a new ArchiveChatAction instance using the specified properties. + * DocumentMessage title. + * @member {string} title + * @memberof proto.DocumentMessage + * @instance + */ + DocumentMessage.prototype.title = ""; + + /** + * DocumentMessage fileSha256. + * @member {Uint8Array} fileSha256 + * @memberof proto.DocumentMessage + * @instance + */ + DocumentMessage.prototype.fileSha256 = $util.newBuffer([]); + + /** + * DocumentMessage fileLength. + * @member {number|Long} fileLength + * @memberof proto.DocumentMessage + * @instance + */ + DocumentMessage.prototype.fileLength = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * DocumentMessage pageCount. + * @member {number} pageCount + * @memberof proto.DocumentMessage + * @instance + */ + DocumentMessage.prototype.pageCount = 0; + + /** + * DocumentMessage mediaKey. + * @member {Uint8Array} mediaKey + * @memberof proto.DocumentMessage + * @instance + */ + DocumentMessage.prototype.mediaKey = $util.newBuffer([]); + + /** + * DocumentMessage fileName. + * @member {string} fileName + * @memberof proto.DocumentMessage + * @instance + */ + DocumentMessage.prototype.fileName = ""; + + /** + * DocumentMessage fileEncSha256. + * @member {Uint8Array} fileEncSha256 + * @memberof proto.DocumentMessage + * @instance + */ + DocumentMessage.prototype.fileEncSha256 = $util.newBuffer([]); + + /** + * DocumentMessage directPath. + * @member {string} directPath + * @memberof proto.DocumentMessage + * @instance + */ + DocumentMessage.prototype.directPath = ""; + + /** + * DocumentMessage mediaKeyTimestamp. + * @member {number|Long} mediaKeyTimestamp + * @memberof proto.DocumentMessage + * @instance + */ + DocumentMessage.prototype.mediaKeyTimestamp = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * DocumentMessage contactVcard. + * @member {boolean} contactVcard + * @memberof proto.DocumentMessage + * @instance + */ + DocumentMessage.prototype.contactVcard = false; + + /** + * DocumentMessage thumbnailDirectPath. + * @member {string} thumbnailDirectPath + * @memberof proto.DocumentMessage + * @instance + */ + DocumentMessage.prototype.thumbnailDirectPath = ""; + + /** + * DocumentMessage thumbnailSha256. + * @member {Uint8Array} thumbnailSha256 + * @memberof proto.DocumentMessage + * @instance + */ + DocumentMessage.prototype.thumbnailSha256 = $util.newBuffer([]); + + /** + * DocumentMessage thumbnailEncSha256. + * @member {Uint8Array} thumbnailEncSha256 + * @memberof proto.DocumentMessage + * @instance + */ + DocumentMessage.prototype.thumbnailEncSha256 = $util.newBuffer([]); + + /** + * DocumentMessage jpegThumbnail. + * @member {Uint8Array} jpegThumbnail + * @memberof proto.DocumentMessage + * @instance + */ + DocumentMessage.prototype.jpegThumbnail = $util.newBuffer([]); + + /** + * DocumentMessage contextInfo. + * @member {proto.IContextInfo|null|undefined} contextInfo + * @memberof proto.DocumentMessage + * @instance + */ + DocumentMessage.prototype.contextInfo = null; + + /** + * DocumentMessage thumbnailHeight. + * @member {number} thumbnailHeight + * @memberof proto.DocumentMessage + * @instance + */ + DocumentMessage.prototype.thumbnailHeight = 0; + + /** + * DocumentMessage thumbnailWidth. + * @member {number} thumbnailWidth + * @memberof proto.DocumentMessage + * @instance + */ + DocumentMessage.prototype.thumbnailWidth = 0; + + /** + * Creates a new DocumentMessage instance using the specified properties. * @function create - * @memberof proto.ArchiveChatAction + * @memberof proto.DocumentMessage * @static - * @param {proto.IArchiveChatAction=} [properties] Properties to set - * @returns {proto.ArchiveChatAction} ArchiveChatAction instance + * @param {proto.IDocumentMessage=} [properties] Properties to set + * @returns {proto.DocumentMessage} DocumentMessage instance */ - ArchiveChatAction.create = function create(properties) { - return new ArchiveChatAction(properties); + DocumentMessage.create = function create(properties) { + return new DocumentMessage(properties); }; /** - * Encodes the specified ArchiveChatAction message. Does not implicitly {@link proto.ArchiveChatAction.verify|verify} messages. + * Encodes the specified DocumentMessage message. Does not implicitly {@link proto.DocumentMessage.verify|verify} messages. * @function encode - * @memberof proto.ArchiveChatAction + * @memberof proto.DocumentMessage * @static - * @param {proto.IArchiveChatAction} message ArchiveChatAction message or plain object to encode + * @param {proto.IDocumentMessage} message DocumentMessage message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ArchiveChatAction.encode = function encode(message, writer) { + DocumentMessage.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.archived != null && Object.hasOwnProperty.call(message, "archived")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.archived); - if (message.messageRange != null && Object.hasOwnProperty.call(message, "messageRange")) - $root.proto.SyncActionMessageRange.encode(message.messageRange, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.url != null && Object.hasOwnProperty.call(message, "url")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.url); + if (message.mimetype != null && Object.hasOwnProperty.call(message, "mimetype")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.mimetype); + if (message.title != null && Object.hasOwnProperty.call(message, "title")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.title); + if (message.fileSha256 != null && Object.hasOwnProperty.call(message, "fileSha256")) + writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.fileSha256); + if (message.fileLength != null && Object.hasOwnProperty.call(message, "fileLength")) + writer.uint32(/* id 5, wireType 0 =*/40).uint64(message.fileLength); + if (message.pageCount != null && Object.hasOwnProperty.call(message, "pageCount")) + writer.uint32(/* id 6, wireType 0 =*/48).uint32(message.pageCount); + if (message.mediaKey != null && Object.hasOwnProperty.call(message, "mediaKey")) + writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.mediaKey); + if (message.fileName != null && Object.hasOwnProperty.call(message, "fileName")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.fileName); + if (message.fileEncSha256 != null && Object.hasOwnProperty.call(message, "fileEncSha256")) + writer.uint32(/* id 9, wireType 2 =*/74).bytes(message.fileEncSha256); + if (message.directPath != null && Object.hasOwnProperty.call(message, "directPath")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.directPath); + if (message.mediaKeyTimestamp != null && Object.hasOwnProperty.call(message, "mediaKeyTimestamp")) + writer.uint32(/* id 11, wireType 0 =*/88).int64(message.mediaKeyTimestamp); + if (message.contactVcard != null && Object.hasOwnProperty.call(message, "contactVcard")) + writer.uint32(/* id 12, wireType 0 =*/96).bool(message.contactVcard); + if (message.thumbnailDirectPath != null && Object.hasOwnProperty.call(message, "thumbnailDirectPath")) + writer.uint32(/* id 13, wireType 2 =*/106).string(message.thumbnailDirectPath); + if (message.thumbnailSha256 != null && Object.hasOwnProperty.call(message, "thumbnailSha256")) + writer.uint32(/* id 14, wireType 2 =*/114).bytes(message.thumbnailSha256); + if (message.thumbnailEncSha256 != null && Object.hasOwnProperty.call(message, "thumbnailEncSha256")) + writer.uint32(/* id 15, wireType 2 =*/122).bytes(message.thumbnailEncSha256); + if (message.jpegThumbnail != null && Object.hasOwnProperty.call(message, "jpegThumbnail")) + writer.uint32(/* id 16, wireType 2 =*/130).bytes(message.jpegThumbnail); + if (message.contextInfo != null && Object.hasOwnProperty.call(message, "contextInfo")) + $root.proto.ContextInfo.encode(message.contextInfo, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); + if (message.thumbnailHeight != null && Object.hasOwnProperty.call(message, "thumbnailHeight")) + writer.uint32(/* id 18, wireType 0 =*/144).uint32(message.thumbnailHeight); + if (message.thumbnailWidth != null && Object.hasOwnProperty.call(message, "thumbnailWidth")) + writer.uint32(/* id 19, wireType 0 =*/152).uint32(message.thumbnailWidth); return writer; }; /** - * Encodes the specified ArchiveChatAction message, length delimited. Does not implicitly {@link proto.ArchiveChatAction.verify|verify} messages. + * Encodes the specified DocumentMessage message, length delimited. Does not implicitly {@link proto.DocumentMessage.verify|verify} messages. * @function encodeDelimited - * @memberof proto.ArchiveChatAction + * @memberof proto.DocumentMessage * @static - * @param {proto.IArchiveChatAction} message ArchiveChatAction message or plain object to encode + * @param {proto.IDocumentMessage} message DocumentMessage message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ArchiveChatAction.encodeDelimited = function encodeDelimited(message, writer) { + DocumentMessage.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an ArchiveChatAction message from the specified reader or buffer. + * Decodes a DocumentMessage message from the specified reader or buffer. * @function decode - * @memberof proto.ArchiveChatAction + * @memberof proto.DocumentMessage * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {proto.ArchiveChatAction} ArchiveChatAction + * @returns {proto.DocumentMessage} DocumentMessage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ArchiveChatAction.decode = function decode(reader, length) { + DocumentMessage.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.ArchiveChatAction(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.DocumentMessage(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.archived = reader.bool(); + message.url = reader.string(); break; case 2: - message.messageRange = $root.proto.SyncActionMessageRange.decode(reader, reader.uint32()); + message.mimetype = reader.string(); + break; + case 3: + message.title = reader.string(); + break; + case 4: + message.fileSha256 = reader.bytes(); + break; + case 5: + message.fileLength = reader.uint64(); + break; + case 6: + message.pageCount = reader.uint32(); + break; + case 7: + message.mediaKey = reader.bytes(); + break; + case 8: + message.fileName = reader.string(); + break; + case 9: + message.fileEncSha256 = reader.bytes(); + break; + case 10: + message.directPath = reader.string(); + break; + case 11: + message.mediaKeyTimestamp = reader.int64(); + break; + case 12: + message.contactVcard = reader.bool(); + break; + case 13: + message.thumbnailDirectPath = reader.string(); + break; + case 14: + message.thumbnailSha256 = reader.bytes(); + break; + case 15: + message.thumbnailEncSha256 = reader.bytes(); + break; + case 16: + message.jpegThumbnail = reader.bytes(); + break; + case 17: + message.contextInfo = $root.proto.ContextInfo.decode(reader, reader.uint32()); + break; + case 18: + message.thumbnailHeight = reader.uint32(); + break; + case 19: + message.thumbnailWidth = reader.uint32(); break; default: reader.skipType(tag & 7); @@ -10350,122 +9910,358 @@ $root.proto = (function() { }; /** - * Decodes an ArchiveChatAction message from the specified reader or buffer, length delimited. + * Decodes a DocumentMessage message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof proto.ArchiveChatAction + * @memberof proto.DocumentMessage * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.ArchiveChatAction} ArchiveChatAction + * @returns {proto.DocumentMessage} DocumentMessage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ArchiveChatAction.decodeDelimited = function decodeDelimited(reader) { + DocumentMessage.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an ArchiveChatAction message. + * Verifies a DocumentMessage message. * @function verify - * @memberof proto.ArchiveChatAction + * @memberof proto.DocumentMessage * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ArchiveChatAction.verify = function verify(message) { + DocumentMessage.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.archived != null && message.hasOwnProperty("archived")) - if (typeof message.archived !== "boolean") - return "archived: boolean expected"; - if (message.messageRange != null && message.hasOwnProperty("messageRange")) { - var error = $root.proto.SyncActionMessageRange.verify(message.messageRange); + if (message.url != null && message.hasOwnProperty("url")) + if (!$util.isString(message.url)) + return "url: string expected"; + if (message.mimetype != null && message.hasOwnProperty("mimetype")) + if (!$util.isString(message.mimetype)) + return "mimetype: string expected"; + if (message.title != null && message.hasOwnProperty("title")) + if (!$util.isString(message.title)) + return "title: string expected"; + if (message.fileSha256 != null && message.hasOwnProperty("fileSha256")) + if (!(message.fileSha256 && typeof message.fileSha256.length === "number" || $util.isString(message.fileSha256))) + return "fileSha256: buffer expected"; + if (message.fileLength != null && message.hasOwnProperty("fileLength")) + if (!$util.isInteger(message.fileLength) && !(message.fileLength && $util.isInteger(message.fileLength.low) && $util.isInteger(message.fileLength.high))) + return "fileLength: integer|Long expected"; + if (message.pageCount != null && message.hasOwnProperty("pageCount")) + if (!$util.isInteger(message.pageCount)) + return "pageCount: integer expected"; + if (message.mediaKey != null && message.hasOwnProperty("mediaKey")) + if (!(message.mediaKey && typeof message.mediaKey.length === "number" || $util.isString(message.mediaKey))) + return "mediaKey: buffer expected"; + if (message.fileName != null && message.hasOwnProperty("fileName")) + if (!$util.isString(message.fileName)) + return "fileName: string expected"; + if (message.fileEncSha256 != null && message.hasOwnProperty("fileEncSha256")) + if (!(message.fileEncSha256 && typeof message.fileEncSha256.length === "number" || $util.isString(message.fileEncSha256))) + return "fileEncSha256: buffer expected"; + if (message.directPath != null && message.hasOwnProperty("directPath")) + if (!$util.isString(message.directPath)) + return "directPath: string expected"; + if (message.mediaKeyTimestamp != null && message.hasOwnProperty("mediaKeyTimestamp")) + if (!$util.isInteger(message.mediaKeyTimestamp) && !(message.mediaKeyTimestamp && $util.isInteger(message.mediaKeyTimestamp.low) && $util.isInteger(message.mediaKeyTimestamp.high))) + return "mediaKeyTimestamp: integer|Long expected"; + if (message.contactVcard != null && message.hasOwnProperty("contactVcard")) + if (typeof message.contactVcard !== "boolean") + return "contactVcard: boolean expected"; + if (message.thumbnailDirectPath != null && message.hasOwnProperty("thumbnailDirectPath")) + if (!$util.isString(message.thumbnailDirectPath)) + return "thumbnailDirectPath: string expected"; + if (message.thumbnailSha256 != null && message.hasOwnProperty("thumbnailSha256")) + if (!(message.thumbnailSha256 && typeof message.thumbnailSha256.length === "number" || $util.isString(message.thumbnailSha256))) + return "thumbnailSha256: buffer expected"; + if (message.thumbnailEncSha256 != null && message.hasOwnProperty("thumbnailEncSha256")) + if (!(message.thumbnailEncSha256 && typeof message.thumbnailEncSha256.length === "number" || $util.isString(message.thumbnailEncSha256))) + return "thumbnailEncSha256: buffer expected"; + if (message.jpegThumbnail != null && message.hasOwnProperty("jpegThumbnail")) + if (!(message.jpegThumbnail && typeof message.jpegThumbnail.length === "number" || $util.isString(message.jpegThumbnail))) + return "jpegThumbnail: buffer expected"; + if (message.contextInfo != null && message.hasOwnProperty("contextInfo")) { + var error = $root.proto.ContextInfo.verify(message.contextInfo); if (error) - return "messageRange." + error; + return "contextInfo." + error; } + if (message.thumbnailHeight != null && message.hasOwnProperty("thumbnailHeight")) + if (!$util.isInteger(message.thumbnailHeight)) + return "thumbnailHeight: integer expected"; + if (message.thumbnailWidth != null && message.hasOwnProperty("thumbnailWidth")) + if (!$util.isInteger(message.thumbnailWidth)) + return "thumbnailWidth: integer expected"; return null; }; /** - * Creates an ArchiveChatAction message from a plain object. Also converts values to their respective internal types. + * Creates a DocumentMessage message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof proto.ArchiveChatAction + * @memberof proto.DocumentMessage * @static * @param {Object.} object Plain object - * @returns {proto.ArchiveChatAction} ArchiveChatAction + * @returns {proto.DocumentMessage} DocumentMessage */ - ArchiveChatAction.fromObject = function fromObject(object) { - if (object instanceof $root.proto.ArchiveChatAction) + DocumentMessage.fromObject = function fromObject(object) { + if (object instanceof $root.proto.DocumentMessage) return object; - var message = new $root.proto.ArchiveChatAction(); - if (object.archived != null) - message.archived = Boolean(object.archived); - if (object.messageRange != null) { - if (typeof object.messageRange !== "object") - throw TypeError(".proto.ArchiveChatAction.messageRange: object expected"); - message.messageRange = $root.proto.SyncActionMessageRange.fromObject(object.messageRange); + var message = new $root.proto.DocumentMessage(); + if (object.url != null) + message.url = String(object.url); + if (object.mimetype != null) + message.mimetype = String(object.mimetype); + if (object.title != null) + message.title = String(object.title); + if (object.fileSha256 != null) + if (typeof object.fileSha256 === "string") + $util.base64.decode(object.fileSha256, message.fileSha256 = $util.newBuffer($util.base64.length(object.fileSha256)), 0); + else if (object.fileSha256.length) + message.fileSha256 = object.fileSha256; + if (object.fileLength != null) + if ($util.Long) + (message.fileLength = $util.Long.fromValue(object.fileLength)).unsigned = true; + else if (typeof object.fileLength === "string") + message.fileLength = parseInt(object.fileLength, 10); + else if (typeof object.fileLength === "number") + message.fileLength = object.fileLength; + else if (typeof object.fileLength === "object") + message.fileLength = new $util.LongBits(object.fileLength.low >>> 0, object.fileLength.high >>> 0).toNumber(true); + if (object.pageCount != null) + message.pageCount = object.pageCount >>> 0; + if (object.mediaKey != null) + if (typeof object.mediaKey === "string") + $util.base64.decode(object.mediaKey, message.mediaKey = $util.newBuffer($util.base64.length(object.mediaKey)), 0); + else if (object.mediaKey.length) + message.mediaKey = object.mediaKey; + if (object.fileName != null) + message.fileName = String(object.fileName); + if (object.fileEncSha256 != null) + if (typeof object.fileEncSha256 === "string") + $util.base64.decode(object.fileEncSha256, message.fileEncSha256 = $util.newBuffer($util.base64.length(object.fileEncSha256)), 0); + else if (object.fileEncSha256.length) + message.fileEncSha256 = object.fileEncSha256; + if (object.directPath != null) + message.directPath = String(object.directPath); + if (object.mediaKeyTimestamp != null) + if ($util.Long) + (message.mediaKeyTimestamp = $util.Long.fromValue(object.mediaKeyTimestamp)).unsigned = false; + else if (typeof object.mediaKeyTimestamp === "string") + message.mediaKeyTimestamp = parseInt(object.mediaKeyTimestamp, 10); + else if (typeof object.mediaKeyTimestamp === "number") + message.mediaKeyTimestamp = object.mediaKeyTimestamp; + else if (typeof object.mediaKeyTimestamp === "object") + message.mediaKeyTimestamp = new $util.LongBits(object.mediaKeyTimestamp.low >>> 0, object.mediaKeyTimestamp.high >>> 0).toNumber(); + if (object.contactVcard != null) + message.contactVcard = Boolean(object.contactVcard); + if (object.thumbnailDirectPath != null) + message.thumbnailDirectPath = String(object.thumbnailDirectPath); + if (object.thumbnailSha256 != null) + if (typeof object.thumbnailSha256 === "string") + $util.base64.decode(object.thumbnailSha256, message.thumbnailSha256 = $util.newBuffer($util.base64.length(object.thumbnailSha256)), 0); + else if (object.thumbnailSha256.length) + message.thumbnailSha256 = object.thumbnailSha256; + if (object.thumbnailEncSha256 != null) + if (typeof object.thumbnailEncSha256 === "string") + $util.base64.decode(object.thumbnailEncSha256, message.thumbnailEncSha256 = $util.newBuffer($util.base64.length(object.thumbnailEncSha256)), 0); + else if (object.thumbnailEncSha256.length) + message.thumbnailEncSha256 = object.thumbnailEncSha256; + if (object.jpegThumbnail != null) + if (typeof object.jpegThumbnail === "string") + $util.base64.decode(object.jpegThumbnail, message.jpegThumbnail = $util.newBuffer($util.base64.length(object.jpegThumbnail)), 0); + else if (object.jpegThumbnail.length) + message.jpegThumbnail = object.jpegThumbnail; + if (object.contextInfo != null) { + if (typeof object.contextInfo !== "object") + throw TypeError(".proto.DocumentMessage.contextInfo: object expected"); + message.contextInfo = $root.proto.ContextInfo.fromObject(object.contextInfo); } + if (object.thumbnailHeight != null) + message.thumbnailHeight = object.thumbnailHeight >>> 0; + if (object.thumbnailWidth != null) + message.thumbnailWidth = object.thumbnailWidth >>> 0; return message; }; /** - * Creates a plain object from an ArchiveChatAction message. Also converts values to other types if specified. + * Creates a plain object from a DocumentMessage message. Also converts values to other types if specified. * @function toObject - * @memberof proto.ArchiveChatAction + * @memberof proto.DocumentMessage * @static - * @param {proto.ArchiveChatAction} message ArchiveChatAction + * @param {proto.DocumentMessage} message DocumentMessage * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ArchiveChatAction.toObject = function toObject(message, options) { + DocumentMessage.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.archived = false; - object.messageRange = null; + object.url = ""; + object.mimetype = ""; + object.title = ""; + if (options.bytes === String) + object.fileSha256 = ""; + else { + object.fileSha256 = []; + if (options.bytes !== Array) + object.fileSha256 = $util.newBuffer(object.fileSha256); + } + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.fileLength = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.fileLength = options.longs === String ? "0" : 0; + object.pageCount = 0; + if (options.bytes === String) + object.mediaKey = ""; + else { + object.mediaKey = []; + if (options.bytes !== Array) + object.mediaKey = $util.newBuffer(object.mediaKey); + } + object.fileName = ""; + if (options.bytes === String) + object.fileEncSha256 = ""; + else { + object.fileEncSha256 = []; + if (options.bytes !== Array) + object.fileEncSha256 = $util.newBuffer(object.fileEncSha256); + } + object.directPath = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.mediaKeyTimestamp = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.mediaKeyTimestamp = options.longs === String ? "0" : 0; + object.contactVcard = false; + object.thumbnailDirectPath = ""; + if (options.bytes === String) + object.thumbnailSha256 = ""; + else { + object.thumbnailSha256 = []; + if (options.bytes !== Array) + object.thumbnailSha256 = $util.newBuffer(object.thumbnailSha256); + } + if (options.bytes === String) + object.thumbnailEncSha256 = ""; + else { + object.thumbnailEncSha256 = []; + if (options.bytes !== Array) + object.thumbnailEncSha256 = $util.newBuffer(object.thumbnailEncSha256); + } + if (options.bytes === String) + object.jpegThumbnail = ""; + else { + object.jpegThumbnail = []; + if (options.bytes !== Array) + object.jpegThumbnail = $util.newBuffer(object.jpegThumbnail); + } + object.contextInfo = null; + object.thumbnailHeight = 0; + object.thumbnailWidth = 0; } - if (message.archived != null && message.hasOwnProperty("archived")) - object.archived = message.archived; - if (message.messageRange != null && message.hasOwnProperty("messageRange")) - object.messageRange = $root.proto.SyncActionMessageRange.toObject(message.messageRange, options); + if (message.url != null && message.hasOwnProperty("url")) + object.url = message.url; + if (message.mimetype != null && message.hasOwnProperty("mimetype")) + object.mimetype = message.mimetype; + if (message.title != null && message.hasOwnProperty("title")) + object.title = message.title; + if (message.fileSha256 != null && message.hasOwnProperty("fileSha256")) + object.fileSha256 = options.bytes === String ? $util.base64.encode(message.fileSha256, 0, message.fileSha256.length) : options.bytes === Array ? Array.prototype.slice.call(message.fileSha256) : message.fileSha256; + if (message.fileLength != null && message.hasOwnProperty("fileLength")) + if (typeof message.fileLength === "number") + object.fileLength = options.longs === String ? String(message.fileLength) : message.fileLength; + else + object.fileLength = options.longs === String ? $util.Long.prototype.toString.call(message.fileLength) : options.longs === Number ? new $util.LongBits(message.fileLength.low >>> 0, message.fileLength.high >>> 0).toNumber(true) : message.fileLength; + if (message.pageCount != null && message.hasOwnProperty("pageCount")) + object.pageCount = message.pageCount; + if (message.mediaKey != null && message.hasOwnProperty("mediaKey")) + object.mediaKey = options.bytes === String ? $util.base64.encode(message.mediaKey, 0, message.mediaKey.length) : options.bytes === Array ? Array.prototype.slice.call(message.mediaKey) : message.mediaKey; + if (message.fileName != null && message.hasOwnProperty("fileName")) + object.fileName = message.fileName; + if (message.fileEncSha256 != null && message.hasOwnProperty("fileEncSha256")) + object.fileEncSha256 = options.bytes === String ? $util.base64.encode(message.fileEncSha256, 0, message.fileEncSha256.length) : options.bytes === Array ? Array.prototype.slice.call(message.fileEncSha256) : message.fileEncSha256; + if (message.directPath != null && message.hasOwnProperty("directPath")) + object.directPath = message.directPath; + if (message.mediaKeyTimestamp != null && message.hasOwnProperty("mediaKeyTimestamp")) + if (typeof message.mediaKeyTimestamp === "number") + object.mediaKeyTimestamp = options.longs === String ? String(message.mediaKeyTimestamp) : message.mediaKeyTimestamp; + else + object.mediaKeyTimestamp = options.longs === String ? $util.Long.prototype.toString.call(message.mediaKeyTimestamp) : options.longs === Number ? new $util.LongBits(message.mediaKeyTimestamp.low >>> 0, message.mediaKeyTimestamp.high >>> 0).toNumber() : message.mediaKeyTimestamp; + if (message.contactVcard != null && message.hasOwnProperty("contactVcard")) + object.contactVcard = message.contactVcard; + if (message.thumbnailDirectPath != null && message.hasOwnProperty("thumbnailDirectPath")) + object.thumbnailDirectPath = message.thumbnailDirectPath; + if (message.thumbnailSha256 != null && message.hasOwnProperty("thumbnailSha256")) + object.thumbnailSha256 = options.bytes === String ? $util.base64.encode(message.thumbnailSha256, 0, message.thumbnailSha256.length) : options.bytes === Array ? Array.prototype.slice.call(message.thumbnailSha256) : message.thumbnailSha256; + if (message.thumbnailEncSha256 != null && message.hasOwnProperty("thumbnailEncSha256")) + object.thumbnailEncSha256 = options.bytes === String ? $util.base64.encode(message.thumbnailEncSha256, 0, message.thumbnailEncSha256.length) : options.bytes === Array ? Array.prototype.slice.call(message.thumbnailEncSha256) : message.thumbnailEncSha256; + if (message.jpegThumbnail != null && message.hasOwnProperty("jpegThumbnail")) + object.jpegThumbnail = options.bytes === String ? $util.base64.encode(message.jpegThumbnail, 0, message.jpegThumbnail.length) : options.bytes === Array ? Array.prototype.slice.call(message.jpegThumbnail) : message.jpegThumbnail; + if (message.contextInfo != null && message.hasOwnProperty("contextInfo")) + object.contextInfo = $root.proto.ContextInfo.toObject(message.contextInfo, options); + if (message.thumbnailHeight != null && message.hasOwnProperty("thumbnailHeight")) + object.thumbnailHeight = message.thumbnailHeight; + if (message.thumbnailWidth != null && message.hasOwnProperty("thumbnailWidth")) + object.thumbnailWidth = message.thumbnailWidth; return object; }; /** - * Converts this ArchiveChatAction to JSON. + * Converts this DocumentMessage to JSON. * @function toJSON - * @memberof proto.ArchiveChatAction + * @memberof proto.DocumentMessage * @instance * @returns {Object.} JSON object */ - ArchiveChatAction.prototype.toJSON = function toJSON() { + DocumentMessage.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ArchiveChatAction; + return DocumentMessage; })(); - proto.DeleteMessageForMeAction = (function() { + proto.ExtendedTextMessage = (function() { /** - * Properties of a DeleteMessageForMeAction. + * Properties of an ExtendedTextMessage. * @memberof proto - * @interface IDeleteMessageForMeAction - * @property {boolean|null} [deleteMedia] DeleteMessageForMeAction deleteMedia - * @property {number|Long|null} [messageTimestamp] DeleteMessageForMeAction messageTimestamp + * @interface IExtendedTextMessage + * @property {string|null} [text] ExtendedTextMessage text + * @property {string|null} [matchedText] ExtendedTextMessage matchedText + * @property {string|null} [canonicalUrl] ExtendedTextMessage canonicalUrl + * @property {string|null} [description] ExtendedTextMessage description + * @property {string|null} [title] ExtendedTextMessage title + * @property {number|null} [textArgb] ExtendedTextMessage textArgb + * @property {number|null} [backgroundArgb] ExtendedTextMessage backgroundArgb + * @property {proto.ExtendedTextMessage.ExtendedTextMessageFontType|null} [font] ExtendedTextMessage font + * @property {proto.ExtendedTextMessage.ExtendedTextMessagePreviewType|null} [previewType] ExtendedTextMessage previewType + * @property {Uint8Array|null} [jpegThumbnail] ExtendedTextMessage jpegThumbnail + * @property {proto.IContextInfo|null} [contextInfo] ExtendedTextMessage contextInfo + * @property {boolean|null} [doNotPlayInline] ExtendedTextMessage doNotPlayInline + * @property {string|null} [thumbnailDirectPath] ExtendedTextMessage thumbnailDirectPath + * @property {Uint8Array|null} [thumbnailSha256] ExtendedTextMessage thumbnailSha256 + * @property {Uint8Array|null} [thumbnailEncSha256] ExtendedTextMessage thumbnailEncSha256 + * @property {Uint8Array|null} [mediaKey] ExtendedTextMessage mediaKey + * @property {number|Long|null} [mediaKeyTimestamp] ExtendedTextMessage mediaKeyTimestamp + * @property {number|null} [thumbnailHeight] ExtendedTextMessage thumbnailHeight + * @property {number|null} [thumbnailWidth] ExtendedTextMessage thumbnailWidth + * @property {proto.ExtendedTextMessage.ExtendedTextMessageInviteLinkGroupType|null} [inviteLinkGroupType] ExtendedTextMessage inviteLinkGroupType */ /** - * Constructs a new DeleteMessageForMeAction. + * Constructs a new ExtendedTextMessage. * @memberof proto - * @classdesc Represents a DeleteMessageForMeAction. - * @implements IDeleteMessageForMeAction + * @classdesc Represents an ExtendedTextMessage. + * @implements IExtendedTextMessage * @constructor - * @param {proto.IDeleteMessageForMeAction=} [properties] Properties to set + * @param {proto.IExtendedTextMessage=} [properties] Properties to set */ - function DeleteMessageForMeAction(properties) { + function ExtendedTextMessage(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -10473,312 +10269,322 @@ $root.proto = (function() { } /** - * DeleteMessageForMeAction deleteMedia. - * @member {boolean} deleteMedia - * @memberof proto.DeleteMessageForMeAction + * ExtendedTextMessage text. + * @member {string} text + * @memberof proto.ExtendedTextMessage * @instance */ - DeleteMessageForMeAction.prototype.deleteMedia = false; + ExtendedTextMessage.prototype.text = ""; /** - * DeleteMessageForMeAction messageTimestamp. - * @member {number|Long} messageTimestamp - * @memberof proto.DeleteMessageForMeAction + * ExtendedTextMessage matchedText. + * @member {string} matchedText + * @memberof proto.ExtendedTextMessage * @instance */ - DeleteMessageForMeAction.prototype.messageTimestamp = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + ExtendedTextMessage.prototype.matchedText = ""; /** - * Creates a new DeleteMessageForMeAction instance using the specified properties. - * @function create - * @memberof proto.DeleteMessageForMeAction - * @static - * @param {proto.IDeleteMessageForMeAction=} [properties] Properties to set - * @returns {proto.DeleteMessageForMeAction} DeleteMessageForMeAction instance + * ExtendedTextMessage canonicalUrl. + * @member {string} canonicalUrl + * @memberof proto.ExtendedTextMessage + * @instance */ - DeleteMessageForMeAction.create = function create(properties) { - return new DeleteMessageForMeAction(properties); - }; + ExtendedTextMessage.prototype.canonicalUrl = ""; /** - * Encodes the specified DeleteMessageForMeAction message. Does not implicitly {@link proto.DeleteMessageForMeAction.verify|verify} messages. - * @function encode - * @memberof proto.DeleteMessageForMeAction - * @static - * @param {proto.IDeleteMessageForMeAction} message DeleteMessageForMeAction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * ExtendedTextMessage description. + * @member {string} description + * @memberof proto.ExtendedTextMessage + * @instance */ - DeleteMessageForMeAction.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.deleteMedia != null && Object.hasOwnProperty.call(message, "deleteMedia")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.deleteMedia); - if (message.messageTimestamp != null && Object.hasOwnProperty.call(message, "messageTimestamp")) - writer.uint32(/* id 2, wireType 0 =*/16).int64(message.messageTimestamp); - return writer; - }; + ExtendedTextMessage.prototype.description = ""; /** - * Encodes the specified DeleteMessageForMeAction message, length delimited. Does not implicitly {@link proto.DeleteMessageForMeAction.verify|verify} messages. - * @function encodeDelimited - * @memberof proto.DeleteMessageForMeAction - * @static - * @param {proto.IDeleteMessageForMeAction} message DeleteMessageForMeAction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * ExtendedTextMessage title. + * @member {string} title + * @memberof proto.ExtendedTextMessage + * @instance */ - DeleteMessageForMeAction.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + ExtendedTextMessage.prototype.title = ""; /** - * Decodes a DeleteMessageForMeAction message from the specified reader or buffer. - * @function decode - * @memberof proto.DeleteMessageForMeAction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {proto.DeleteMessageForMeAction} DeleteMessageForMeAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * ExtendedTextMessage textArgb. + * @member {number} textArgb + * @memberof proto.ExtendedTextMessage + * @instance */ - DeleteMessageForMeAction.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.DeleteMessageForMeAction(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.deleteMedia = reader.bool(); - break; - case 2: - message.messageTimestamp = reader.int64(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + ExtendedTextMessage.prototype.textArgb = 0; /** - * Decodes a DeleteMessageForMeAction message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof proto.DeleteMessageForMeAction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.DeleteMessageForMeAction} DeleteMessageForMeAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * ExtendedTextMessage backgroundArgb. + * @member {number} backgroundArgb + * @memberof proto.ExtendedTextMessage + * @instance */ - DeleteMessageForMeAction.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + ExtendedTextMessage.prototype.backgroundArgb = 0; /** - * Verifies a DeleteMessageForMeAction message. - * @function verify - * @memberof proto.DeleteMessageForMeAction - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not + * ExtendedTextMessage font. + * @member {proto.ExtendedTextMessage.ExtendedTextMessageFontType} font + * @memberof proto.ExtendedTextMessage + * @instance */ - DeleteMessageForMeAction.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.deleteMedia != null && message.hasOwnProperty("deleteMedia")) - if (typeof message.deleteMedia !== "boolean") - return "deleteMedia: boolean expected"; - if (message.messageTimestamp != null && message.hasOwnProperty("messageTimestamp")) - if (!$util.isInteger(message.messageTimestamp) && !(message.messageTimestamp && $util.isInteger(message.messageTimestamp.low) && $util.isInteger(message.messageTimestamp.high))) - return "messageTimestamp: integer|Long expected"; - return null; - }; + ExtendedTextMessage.prototype.font = 0; /** - * Creates a DeleteMessageForMeAction message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof proto.DeleteMessageForMeAction - * @static - * @param {Object.} object Plain object - * @returns {proto.DeleteMessageForMeAction} DeleteMessageForMeAction + * ExtendedTextMessage previewType. + * @member {proto.ExtendedTextMessage.ExtendedTextMessagePreviewType} previewType + * @memberof proto.ExtendedTextMessage + * @instance */ - DeleteMessageForMeAction.fromObject = function fromObject(object) { - if (object instanceof $root.proto.DeleteMessageForMeAction) - return object; - var message = new $root.proto.DeleteMessageForMeAction(); - if (object.deleteMedia != null) - message.deleteMedia = Boolean(object.deleteMedia); - if (object.messageTimestamp != null) - if ($util.Long) - (message.messageTimestamp = $util.Long.fromValue(object.messageTimestamp)).unsigned = false; - else if (typeof object.messageTimestamp === "string") - message.messageTimestamp = parseInt(object.messageTimestamp, 10); - else if (typeof object.messageTimestamp === "number") - message.messageTimestamp = object.messageTimestamp; - else if (typeof object.messageTimestamp === "object") - message.messageTimestamp = new $util.LongBits(object.messageTimestamp.low >>> 0, object.messageTimestamp.high >>> 0).toNumber(); - return message; - }; + ExtendedTextMessage.prototype.previewType = 0; /** - * Creates a plain object from a DeleteMessageForMeAction message. Also converts values to other types if specified. - * @function toObject - * @memberof proto.DeleteMessageForMeAction - * @static - * @param {proto.DeleteMessageForMeAction} message DeleteMessageForMeAction - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object + * ExtendedTextMessage jpegThumbnail. + * @member {Uint8Array} jpegThumbnail + * @memberof proto.ExtendedTextMessage + * @instance */ - DeleteMessageForMeAction.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.deleteMedia = false; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.messageTimestamp = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.messageTimestamp = options.longs === String ? "0" : 0; - } - if (message.deleteMedia != null && message.hasOwnProperty("deleteMedia")) - object.deleteMedia = message.deleteMedia; - if (message.messageTimestamp != null && message.hasOwnProperty("messageTimestamp")) - if (typeof message.messageTimestamp === "number") - object.messageTimestamp = options.longs === String ? String(message.messageTimestamp) : message.messageTimestamp; - else - object.messageTimestamp = options.longs === String ? $util.Long.prototype.toString.call(message.messageTimestamp) : options.longs === Number ? new $util.LongBits(message.messageTimestamp.low >>> 0, message.messageTimestamp.high >>> 0).toNumber() : message.messageTimestamp; - return object; - }; + ExtendedTextMessage.prototype.jpegThumbnail = $util.newBuffer([]); /** - * Converts this DeleteMessageForMeAction to JSON. - * @function toJSON - * @memberof proto.DeleteMessageForMeAction + * ExtendedTextMessage contextInfo. + * @member {proto.IContextInfo|null|undefined} contextInfo + * @memberof proto.ExtendedTextMessage * @instance - * @returns {Object.} JSON object */ - DeleteMessageForMeAction.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + ExtendedTextMessage.prototype.contextInfo = null; - return DeleteMessageForMeAction; - })(); + /** + * ExtendedTextMessage doNotPlayInline. + * @member {boolean} doNotPlayInline + * @memberof proto.ExtendedTextMessage + * @instance + */ + ExtendedTextMessage.prototype.doNotPlayInline = false; - proto.MarkChatAsReadAction = (function() { + /** + * ExtendedTextMessage thumbnailDirectPath. + * @member {string} thumbnailDirectPath + * @memberof proto.ExtendedTextMessage + * @instance + */ + ExtendedTextMessage.prototype.thumbnailDirectPath = ""; /** - * Properties of a MarkChatAsReadAction. - * @memberof proto - * @interface IMarkChatAsReadAction - * @property {boolean|null} [read] MarkChatAsReadAction read - * @property {proto.ISyncActionMessageRange|null} [messageRange] MarkChatAsReadAction messageRange + * ExtendedTextMessage thumbnailSha256. + * @member {Uint8Array} thumbnailSha256 + * @memberof proto.ExtendedTextMessage + * @instance */ + ExtendedTextMessage.prototype.thumbnailSha256 = $util.newBuffer([]); /** - * Constructs a new MarkChatAsReadAction. - * @memberof proto - * @classdesc Represents a MarkChatAsReadAction. - * @implements IMarkChatAsReadAction - * @constructor - * @param {proto.IMarkChatAsReadAction=} [properties] Properties to set + * ExtendedTextMessage thumbnailEncSha256. + * @member {Uint8Array} thumbnailEncSha256 + * @memberof proto.ExtendedTextMessage + * @instance */ - function MarkChatAsReadAction(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + ExtendedTextMessage.prototype.thumbnailEncSha256 = $util.newBuffer([]); /** - * MarkChatAsReadAction read. - * @member {boolean} read - * @memberof proto.MarkChatAsReadAction + * ExtendedTextMessage mediaKey. + * @member {Uint8Array} mediaKey + * @memberof proto.ExtendedTextMessage * @instance */ - MarkChatAsReadAction.prototype.read = false; + ExtendedTextMessage.prototype.mediaKey = $util.newBuffer([]); /** - * MarkChatAsReadAction messageRange. - * @member {proto.ISyncActionMessageRange|null|undefined} messageRange - * @memberof proto.MarkChatAsReadAction + * ExtendedTextMessage mediaKeyTimestamp. + * @member {number|Long} mediaKeyTimestamp + * @memberof proto.ExtendedTextMessage * @instance */ - MarkChatAsReadAction.prototype.messageRange = null; + ExtendedTextMessage.prototype.mediaKeyTimestamp = $util.Long ? $util.Long.fromBits(0,0,false) : 0; /** - * Creates a new MarkChatAsReadAction instance using the specified properties. + * ExtendedTextMessage thumbnailHeight. + * @member {number} thumbnailHeight + * @memberof proto.ExtendedTextMessage + * @instance + */ + ExtendedTextMessage.prototype.thumbnailHeight = 0; + + /** + * ExtendedTextMessage thumbnailWidth. + * @member {number} thumbnailWidth + * @memberof proto.ExtendedTextMessage + * @instance + */ + ExtendedTextMessage.prototype.thumbnailWidth = 0; + + /** + * ExtendedTextMessage inviteLinkGroupType. + * @member {proto.ExtendedTextMessage.ExtendedTextMessageInviteLinkGroupType} inviteLinkGroupType + * @memberof proto.ExtendedTextMessage + * @instance + */ + ExtendedTextMessage.prototype.inviteLinkGroupType = 0; + + /** + * Creates a new ExtendedTextMessage instance using the specified properties. * @function create - * @memberof proto.MarkChatAsReadAction + * @memberof proto.ExtendedTextMessage * @static - * @param {proto.IMarkChatAsReadAction=} [properties] Properties to set - * @returns {proto.MarkChatAsReadAction} MarkChatAsReadAction instance + * @param {proto.IExtendedTextMessage=} [properties] Properties to set + * @returns {proto.ExtendedTextMessage} ExtendedTextMessage instance */ - MarkChatAsReadAction.create = function create(properties) { - return new MarkChatAsReadAction(properties); + ExtendedTextMessage.create = function create(properties) { + return new ExtendedTextMessage(properties); }; /** - * Encodes the specified MarkChatAsReadAction message. Does not implicitly {@link proto.MarkChatAsReadAction.verify|verify} messages. + * Encodes the specified ExtendedTextMessage message. Does not implicitly {@link proto.ExtendedTextMessage.verify|verify} messages. * @function encode - * @memberof proto.MarkChatAsReadAction + * @memberof proto.ExtendedTextMessage * @static - * @param {proto.IMarkChatAsReadAction} message MarkChatAsReadAction message or plain object to encode + * @param {proto.IExtendedTextMessage} message ExtendedTextMessage message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - MarkChatAsReadAction.encode = function encode(message, writer) { + ExtendedTextMessage.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.read != null && Object.hasOwnProperty.call(message, "read")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.read); - if (message.messageRange != null && Object.hasOwnProperty.call(message, "messageRange")) - $root.proto.SyncActionMessageRange.encode(message.messageRange, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.text != null && Object.hasOwnProperty.call(message, "text")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.text); + if (message.matchedText != null && Object.hasOwnProperty.call(message, "matchedText")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.matchedText); + if (message.canonicalUrl != null && Object.hasOwnProperty.call(message, "canonicalUrl")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.canonicalUrl); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.description); + if (message.title != null && Object.hasOwnProperty.call(message, "title")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.title); + if (message.textArgb != null && Object.hasOwnProperty.call(message, "textArgb")) + writer.uint32(/* id 7, wireType 5 =*/61).fixed32(message.textArgb); + if (message.backgroundArgb != null && Object.hasOwnProperty.call(message, "backgroundArgb")) + writer.uint32(/* id 8, wireType 5 =*/69).fixed32(message.backgroundArgb); + if (message.font != null && Object.hasOwnProperty.call(message, "font")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.font); + if (message.previewType != null && Object.hasOwnProperty.call(message, "previewType")) + writer.uint32(/* id 10, wireType 0 =*/80).int32(message.previewType); + if (message.jpegThumbnail != null && Object.hasOwnProperty.call(message, "jpegThumbnail")) + writer.uint32(/* id 16, wireType 2 =*/130).bytes(message.jpegThumbnail); + if (message.contextInfo != null && Object.hasOwnProperty.call(message, "contextInfo")) + $root.proto.ContextInfo.encode(message.contextInfo, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); + if (message.doNotPlayInline != null && Object.hasOwnProperty.call(message, "doNotPlayInline")) + writer.uint32(/* id 18, wireType 0 =*/144).bool(message.doNotPlayInline); + if (message.thumbnailDirectPath != null && Object.hasOwnProperty.call(message, "thumbnailDirectPath")) + writer.uint32(/* id 19, wireType 2 =*/154).string(message.thumbnailDirectPath); + if (message.thumbnailSha256 != null && Object.hasOwnProperty.call(message, "thumbnailSha256")) + writer.uint32(/* id 20, wireType 2 =*/162).bytes(message.thumbnailSha256); + if (message.thumbnailEncSha256 != null && Object.hasOwnProperty.call(message, "thumbnailEncSha256")) + writer.uint32(/* id 21, wireType 2 =*/170).bytes(message.thumbnailEncSha256); + if (message.mediaKey != null && Object.hasOwnProperty.call(message, "mediaKey")) + writer.uint32(/* id 22, wireType 2 =*/178).bytes(message.mediaKey); + if (message.mediaKeyTimestamp != null && Object.hasOwnProperty.call(message, "mediaKeyTimestamp")) + writer.uint32(/* id 23, wireType 0 =*/184).int64(message.mediaKeyTimestamp); + if (message.thumbnailHeight != null && Object.hasOwnProperty.call(message, "thumbnailHeight")) + writer.uint32(/* id 24, wireType 0 =*/192).uint32(message.thumbnailHeight); + if (message.thumbnailWidth != null && Object.hasOwnProperty.call(message, "thumbnailWidth")) + writer.uint32(/* id 25, wireType 0 =*/200).uint32(message.thumbnailWidth); + if (message.inviteLinkGroupType != null && Object.hasOwnProperty.call(message, "inviteLinkGroupType")) + writer.uint32(/* id 26, wireType 0 =*/208).int32(message.inviteLinkGroupType); return writer; }; /** - * Encodes the specified MarkChatAsReadAction message, length delimited. Does not implicitly {@link proto.MarkChatAsReadAction.verify|verify} messages. + * Encodes the specified ExtendedTextMessage message, length delimited. Does not implicitly {@link proto.ExtendedTextMessage.verify|verify} messages. * @function encodeDelimited - * @memberof proto.MarkChatAsReadAction + * @memberof proto.ExtendedTextMessage * @static - * @param {proto.IMarkChatAsReadAction} message MarkChatAsReadAction message or plain object to encode + * @param {proto.IExtendedTextMessage} message ExtendedTextMessage message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - MarkChatAsReadAction.encodeDelimited = function encodeDelimited(message, writer) { + ExtendedTextMessage.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a MarkChatAsReadAction message from the specified reader or buffer. + * Decodes an ExtendedTextMessage message from the specified reader or buffer. * @function decode - * @memberof proto.MarkChatAsReadAction + * @memberof proto.ExtendedTextMessage * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {proto.MarkChatAsReadAction} MarkChatAsReadAction + * @returns {proto.ExtendedTextMessage} ExtendedTextMessage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - MarkChatAsReadAction.decode = function decode(reader, length) { + ExtendedTextMessage.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.MarkChatAsReadAction(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.ExtendedTextMessage(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.read = reader.bool(); + message.text = reader.string(); break; case 2: - message.messageRange = $root.proto.SyncActionMessageRange.decode(reader, reader.uint32()); + message.matchedText = reader.string(); + break; + case 4: + message.canonicalUrl = reader.string(); + break; + case 5: + message.description = reader.string(); + break; + case 6: + message.title = reader.string(); + break; + case 7: + message.textArgb = reader.fixed32(); + break; + case 8: + message.backgroundArgb = reader.fixed32(); + break; + case 9: + message.font = reader.int32(); + break; + case 10: + message.previewType = reader.int32(); + break; + case 16: + message.jpegThumbnail = reader.bytes(); + break; + case 17: + message.contextInfo = $root.proto.ContextInfo.decode(reader, reader.uint32()); + break; + case 18: + message.doNotPlayInline = reader.bool(); + break; + case 19: + message.thumbnailDirectPath = reader.string(); + break; + case 20: + message.thumbnailSha256 = reader.bytes(); + break; + case 21: + message.thumbnailEncSha256 = reader.bytes(); + break; + case 22: + message.mediaKey = reader.bytes(); + break; + case 23: + message.mediaKeyTimestamp = reader.int64(); + break; + case 24: + message.thumbnailHeight = reader.uint32(); + break; + case 25: + message.thumbnailWidth = reader.uint32(); + break; + case 26: + message.inviteLinkGroupType = reader.int32(); break; default: reader.skipType(tag & 7); @@ -10789,389 +10595,654 @@ $root.proto = (function() { }; /** - * Decodes a MarkChatAsReadAction message from the specified reader or buffer, length delimited. + * Decodes an ExtendedTextMessage message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof proto.MarkChatAsReadAction + * @memberof proto.ExtendedTextMessage * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.MarkChatAsReadAction} MarkChatAsReadAction + * @returns {proto.ExtendedTextMessage} ExtendedTextMessage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - MarkChatAsReadAction.decodeDelimited = function decodeDelimited(reader) { + ExtendedTextMessage.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a MarkChatAsReadAction message. + * Verifies an ExtendedTextMessage message. * @function verify - * @memberof proto.MarkChatAsReadAction + * @memberof proto.ExtendedTextMessage * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - MarkChatAsReadAction.verify = function verify(message) { + ExtendedTextMessage.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.read != null && message.hasOwnProperty("read")) - if (typeof message.read !== "boolean") - return "read: boolean expected"; - if (message.messageRange != null && message.hasOwnProperty("messageRange")) { - var error = $root.proto.SyncActionMessageRange.verify(message.messageRange); + if (message.text != null && message.hasOwnProperty("text")) + if (!$util.isString(message.text)) + return "text: string expected"; + if (message.matchedText != null && message.hasOwnProperty("matchedText")) + if (!$util.isString(message.matchedText)) + return "matchedText: string expected"; + if (message.canonicalUrl != null && message.hasOwnProperty("canonicalUrl")) + if (!$util.isString(message.canonicalUrl)) + return "canonicalUrl: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.title != null && message.hasOwnProperty("title")) + if (!$util.isString(message.title)) + return "title: string expected"; + if (message.textArgb != null && message.hasOwnProperty("textArgb")) + if (!$util.isInteger(message.textArgb)) + return "textArgb: integer expected"; + if (message.backgroundArgb != null && message.hasOwnProperty("backgroundArgb")) + if (!$util.isInteger(message.backgroundArgb)) + return "backgroundArgb: integer expected"; + if (message.font != null && message.hasOwnProperty("font")) + switch (message.font) { + default: + return "font: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.previewType != null && message.hasOwnProperty("previewType")) + switch (message.previewType) { + default: + return "previewType: enum value expected"; + case 0: + case 1: + break; + } + if (message.jpegThumbnail != null && message.hasOwnProperty("jpegThumbnail")) + if (!(message.jpegThumbnail && typeof message.jpegThumbnail.length === "number" || $util.isString(message.jpegThumbnail))) + return "jpegThumbnail: buffer expected"; + if (message.contextInfo != null && message.hasOwnProperty("contextInfo")) { + var error = $root.proto.ContextInfo.verify(message.contextInfo); if (error) - return "messageRange." + error; + return "contextInfo." + error; } + if (message.doNotPlayInline != null && message.hasOwnProperty("doNotPlayInline")) + if (typeof message.doNotPlayInline !== "boolean") + return "doNotPlayInline: boolean expected"; + if (message.thumbnailDirectPath != null && message.hasOwnProperty("thumbnailDirectPath")) + if (!$util.isString(message.thumbnailDirectPath)) + return "thumbnailDirectPath: string expected"; + if (message.thumbnailSha256 != null && message.hasOwnProperty("thumbnailSha256")) + if (!(message.thumbnailSha256 && typeof message.thumbnailSha256.length === "number" || $util.isString(message.thumbnailSha256))) + return "thumbnailSha256: buffer expected"; + if (message.thumbnailEncSha256 != null && message.hasOwnProperty("thumbnailEncSha256")) + if (!(message.thumbnailEncSha256 && typeof message.thumbnailEncSha256.length === "number" || $util.isString(message.thumbnailEncSha256))) + return "thumbnailEncSha256: buffer expected"; + if (message.mediaKey != null && message.hasOwnProperty("mediaKey")) + if (!(message.mediaKey && typeof message.mediaKey.length === "number" || $util.isString(message.mediaKey))) + return "mediaKey: buffer expected"; + if (message.mediaKeyTimestamp != null && message.hasOwnProperty("mediaKeyTimestamp")) + if (!$util.isInteger(message.mediaKeyTimestamp) && !(message.mediaKeyTimestamp && $util.isInteger(message.mediaKeyTimestamp.low) && $util.isInteger(message.mediaKeyTimestamp.high))) + return "mediaKeyTimestamp: integer|Long expected"; + if (message.thumbnailHeight != null && message.hasOwnProperty("thumbnailHeight")) + if (!$util.isInteger(message.thumbnailHeight)) + return "thumbnailHeight: integer expected"; + if (message.thumbnailWidth != null && message.hasOwnProperty("thumbnailWidth")) + if (!$util.isInteger(message.thumbnailWidth)) + return "thumbnailWidth: integer expected"; + if (message.inviteLinkGroupType != null && message.hasOwnProperty("inviteLinkGroupType")) + switch (message.inviteLinkGroupType) { + default: + return "inviteLinkGroupType: enum value expected"; + case 0: + case 1: + break; + } return null; }; /** - * Creates a MarkChatAsReadAction message from a plain object. Also converts values to their respective internal types. + * Creates an ExtendedTextMessage message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof proto.MarkChatAsReadAction + * @memberof proto.ExtendedTextMessage * @static * @param {Object.} object Plain object - * @returns {proto.MarkChatAsReadAction} MarkChatAsReadAction + * @returns {proto.ExtendedTextMessage} ExtendedTextMessage */ - MarkChatAsReadAction.fromObject = function fromObject(object) { - if (object instanceof $root.proto.MarkChatAsReadAction) + ExtendedTextMessage.fromObject = function fromObject(object) { + if (object instanceof $root.proto.ExtendedTextMessage) return object; - var message = new $root.proto.MarkChatAsReadAction(); - if (object.read != null) - message.read = Boolean(object.read); - if (object.messageRange != null) { - if (typeof object.messageRange !== "object") - throw TypeError(".proto.MarkChatAsReadAction.messageRange: object expected"); - message.messageRange = $root.proto.SyncActionMessageRange.fromObject(object.messageRange); + var message = new $root.proto.ExtendedTextMessage(); + if (object.text != null) + message.text = String(object.text); + if (object.matchedText != null) + message.matchedText = String(object.matchedText); + if (object.canonicalUrl != null) + message.canonicalUrl = String(object.canonicalUrl); + if (object.description != null) + message.description = String(object.description); + if (object.title != null) + message.title = String(object.title); + if (object.textArgb != null) + message.textArgb = object.textArgb >>> 0; + if (object.backgroundArgb != null) + message.backgroundArgb = object.backgroundArgb >>> 0; + switch (object.font) { + case "SANS_SERIF": + case 0: + message.font = 0; + break; + case "SERIF": + case 1: + message.font = 1; + break; + case "NORICAN_REGULAR": + case 2: + message.font = 2; + break; + case "BRYNDAN_WRITE": + case 3: + message.font = 3; + break; + case "BEBASNEUE_REGULAR": + case 4: + message.font = 4; + break; + case "OSWALD_HEAVY": + case 5: + message.font = 5; + break; + } + switch (object.previewType) { + case "NONE": + case 0: + message.previewType = 0; + break; + case "VIDEO": + case 1: + message.previewType = 1; + break; + } + if (object.jpegThumbnail != null) + if (typeof object.jpegThumbnail === "string") + $util.base64.decode(object.jpegThumbnail, message.jpegThumbnail = $util.newBuffer($util.base64.length(object.jpegThumbnail)), 0); + else if (object.jpegThumbnail.length) + message.jpegThumbnail = object.jpegThumbnail; + if (object.contextInfo != null) { + if (typeof object.contextInfo !== "object") + throw TypeError(".proto.ExtendedTextMessage.contextInfo: object expected"); + message.contextInfo = $root.proto.ContextInfo.fromObject(object.contextInfo); + } + if (object.doNotPlayInline != null) + message.doNotPlayInline = Boolean(object.doNotPlayInline); + if (object.thumbnailDirectPath != null) + message.thumbnailDirectPath = String(object.thumbnailDirectPath); + if (object.thumbnailSha256 != null) + if (typeof object.thumbnailSha256 === "string") + $util.base64.decode(object.thumbnailSha256, message.thumbnailSha256 = $util.newBuffer($util.base64.length(object.thumbnailSha256)), 0); + else if (object.thumbnailSha256.length) + message.thumbnailSha256 = object.thumbnailSha256; + if (object.thumbnailEncSha256 != null) + if (typeof object.thumbnailEncSha256 === "string") + $util.base64.decode(object.thumbnailEncSha256, message.thumbnailEncSha256 = $util.newBuffer($util.base64.length(object.thumbnailEncSha256)), 0); + else if (object.thumbnailEncSha256.length) + message.thumbnailEncSha256 = object.thumbnailEncSha256; + if (object.mediaKey != null) + if (typeof object.mediaKey === "string") + $util.base64.decode(object.mediaKey, message.mediaKey = $util.newBuffer($util.base64.length(object.mediaKey)), 0); + else if (object.mediaKey.length) + message.mediaKey = object.mediaKey; + if (object.mediaKeyTimestamp != null) + if ($util.Long) + (message.mediaKeyTimestamp = $util.Long.fromValue(object.mediaKeyTimestamp)).unsigned = false; + else if (typeof object.mediaKeyTimestamp === "string") + message.mediaKeyTimestamp = parseInt(object.mediaKeyTimestamp, 10); + else if (typeof object.mediaKeyTimestamp === "number") + message.mediaKeyTimestamp = object.mediaKeyTimestamp; + else if (typeof object.mediaKeyTimestamp === "object") + message.mediaKeyTimestamp = new $util.LongBits(object.mediaKeyTimestamp.low >>> 0, object.mediaKeyTimestamp.high >>> 0).toNumber(); + if (object.thumbnailHeight != null) + message.thumbnailHeight = object.thumbnailHeight >>> 0; + if (object.thumbnailWidth != null) + message.thumbnailWidth = object.thumbnailWidth >>> 0; + switch (object.inviteLinkGroupType) { + case "DEFAULT": + case 0: + message.inviteLinkGroupType = 0; + break; + case "PARENT": + case 1: + message.inviteLinkGroupType = 1; + break; } return message; }; /** - * Creates a plain object from a MarkChatAsReadAction message. Also converts values to other types if specified. + * Creates a plain object from an ExtendedTextMessage message. Also converts values to other types if specified. * @function toObject - * @memberof proto.MarkChatAsReadAction + * @memberof proto.ExtendedTextMessage * @static - * @param {proto.MarkChatAsReadAction} message MarkChatAsReadAction + * @param {proto.ExtendedTextMessage} message ExtendedTextMessage * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - MarkChatAsReadAction.toObject = function toObject(message, options) { + ExtendedTextMessage.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.read = false; - object.messageRange = null; - } - if (message.read != null && message.hasOwnProperty("read")) - object.read = message.read; - if (message.messageRange != null && message.hasOwnProperty("messageRange")) - object.messageRange = $root.proto.SyncActionMessageRange.toObject(message.messageRange, options); - return object; - }; - - /** - * Converts this MarkChatAsReadAction to JSON. - * @function toJSON - * @memberof proto.MarkChatAsReadAction - * @instance - * @returns {Object.} JSON object - */ - MarkChatAsReadAction.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return MarkChatAsReadAction; - })(); - - proto.ClearChatAction = (function() { - - /** - * Properties of a ClearChatAction. - * @memberof proto - * @interface IClearChatAction - * @property {proto.ISyncActionMessageRange|null} [messageRange] ClearChatAction messageRange - */ - - /** - * Constructs a new ClearChatAction. - * @memberof proto - * @classdesc Represents a ClearChatAction. - * @implements IClearChatAction - * @constructor - * @param {proto.IClearChatAction=} [properties] Properties to set - */ - function ClearChatAction(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + object.text = ""; + object.matchedText = ""; + object.canonicalUrl = ""; + object.description = ""; + object.title = ""; + object.textArgb = 0; + object.backgroundArgb = 0; + object.font = options.enums === String ? "SANS_SERIF" : 0; + object.previewType = options.enums === String ? "NONE" : 0; + if (options.bytes === String) + object.jpegThumbnail = ""; + else { + object.jpegThumbnail = []; + if (options.bytes !== Array) + object.jpegThumbnail = $util.newBuffer(object.jpegThumbnail); + } + object.contextInfo = null; + object.doNotPlayInline = false; + object.thumbnailDirectPath = ""; + if (options.bytes === String) + object.thumbnailSha256 = ""; + else { + object.thumbnailSha256 = []; + if (options.bytes !== Array) + object.thumbnailSha256 = $util.newBuffer(object.thumbnailSha256); + } + if (options.bytes === String) + object.thumbnailEncSha256 = ""; + else { + object.thumbnailEncSha256 = []; + if (options.bytes !== Array) + object.thumbnailEncSha256 = $util.newBuffer(object.thumbnailEncSha256); + } + if (options.bytes === String) + object.mediaKey = ""; + else { + object.mediaKey = []; + if (options.bytes !== Array) + object.mediaKey = $util.newBuffer(object.mediaKey); + } + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.mediaKeyTimestamp = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.mediaKeyTimestamp = options.longs === String ? "0" : 0; + object.thumbnailHeight = 0; + object.thumbnailWidth = 0; + object.inviteLinkGroupType = options.enums === String ? "DEFAULT" : 0; + } + if (message.text != null && message.hasOwnProperty("text")) + object.text = message.text; + if (message.matchedText != null && message.hasOwnProperty("matchedText")) + object.matchedText = message.matchedText; + if (message.canonicalUrl != null && message.hasOwnProperty("canonicalUrl")) + object.canonicalUrl = message.canonicalUrl; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.title != null && message.hasOwnProperty("title")) + object.title = message.title; + if (message.textArgb != null && message.hasOwnProperty("textArgb")) + object.textArgb = message.textArgb; + if (message.backgroundArgb != null && message.hasOwnProperty("backgroundArgb")) + object.backgroundArgb = message.backgroundArgb; + if (message.font != null && message.hasOwnProperty("font")) + object.font = options.enums === String ? $root.proto.ExtendedTextMessage.ExtendedTextMessageFontType[message.font] : message.font; + if (message.previewType != null && message.hasOwnProperty("previewType")) + object.previewType = options.enums === String ? $root.proto.ExtendedTextMessage.ExtendedTextMessagePreviewType[message.previewType] : message.previewType; + if (message.jpegThumbnail != null && message.hasOwnProperty("jpegThumbnail")) + object.jpegThumbnail = options.bytes === String ? $util.base64.encode(message.jpegThumbnail, 0, message.jpegThumbnail.length) : options.bytes === Array ? Array.prototype.slice.call(message.jpegThumbnail) : message.jpegThumbnail; + if (message.contextInfo != null && message.hasOwnProperty("contextInfo")) + object.contextInfo = $root.proto.ContextInfo.toObject(message.contextInfo, options); + if (message.doNotPlayInline != null && message.hasOwnProperty("doNotPlayInline")) + object.doNotPlayInline = message.doNotPlayInline; + if (message.thumbnailDirectPath != null && message.hasOwnProperty("thumbnailDirectPath")) + object.thumbnailDirectPath = message.thumbnailDirectPath; + if (message.thumbnailSha256 != null && message.hasOwnProperty("thumbnailSha256")) + object.thumbnailSha256 = options.bytes === String ? $util.base64.encode(message.thumbnailSha256, 0, message.thumbnailSha256.length) : options.bytes === Array ? Array.prototype.slice.call(message.thumbnailSha256) : message.thumbnailSha256; + if (message.thumbnailEncSha256 != null && message.hasOwnProperty("thumbnailEncSha256")) + object.thumbnailEncSha256 = options.bytes === String ? $util.base64.encode(message.thumbnailEncSha256, 0, message.thumbnailEncSha256.length) : options.bytes === Array ? Array.prototype.slice.call(message.thumbnailEncSha256) : message.thumbnailEncSha256; + if (message.mediaKey != null && message.hasOwnProperty("mediaKey")) + object.mediaKey = options.bytes === String ? $util.base64.encode(message.mediaKey, 0, message.mediaKey.length) : options.bytes === Array ? Array.prototype.slice.call(message.mediaKey) : message.mediaKey; + if (message.mediaKeyTimestamp != null && message.hasOwnProperty("mediaKeyTimestamp")) + if (typeof message.mediaKeyTimestamp === "number") + object.mediaKeyTimestamp = options.longs === String ? String(message.mediaKeyTimestamp) : message.mediaKeyTimestamp; + else + object.mediaKeyTimestamp = options.longs === String ? $util.Long.prototype.toString.call(message.mediaKeyTimestamp) : options.longs === Number ? new $util.LongBits(message.mediaKeyTimestamp.low >>> 0, message.mediaKeyTimestamp.high >>> 0).toNumber() : message.mediaKeyTimestamp; + if (message.thumbnailHeight != null && message.hasOwnProperty("thumbnailHeight")) + object.thumbnailHeight = message.thumbnailHeight; + if (message.thumbnailWidth != null && message.hasOwnProperty("thumbnailWidth")) + object.thumbnailWidth = message.thumbnailWidth; + if (message.inviteLinkGroupType != null && message.hasOwnProperty("inviteLinkGroupType")) + object.inviteLinkGroupType = options.enums === String ? $root.proto.ExtendedTextMessage.ExtendedTextMessageInviteLinkGroupType[message.inviteLinkGroupType] : message.inviteLinkGroupType; + return object; + }; /** - * ClearChatAction messageRange. - * @member {proto.ISyncActionMessageRange|null|undefined} messageRange - * @memberof proto.ClearChatAction + * Converts this ExtendedTextMessage to JSON. + * @function toJSON + * @memberof proto.ExtendedTextMessage * @instance + * @returns {Object.} JSON object */ - ClearChatAction.prototype.messageRange = null; + ExtendedTextMessage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; /** - * Creates a new ClearChatAction instance using the specified properties. - * @function create - * @memberof proto.ClearChatAction - * @static - * @param {proto.IClearChatAction=} [properties] Properties to set - * @returns {proto.ClearChatAction} ClearChatAction instance + * ExtendedTextMessageFontType enum. + * @name proto.ExtendedTextMessage.ExtendedTextMessageFontType + * @enum {number} + * @property {number} SANS_SERIF=0 SANS_SERIF value + * @property {number} SERIF=1 SERIF value + * @property {number} NORICAN_REGULAR=2 NORICAN_REGULAR value + * @property {number} BRYNDAN_WRITE=3 BRYNDAN_WRITE value + * @property {number} BEBASNEUE_REGULAR=4 BEBASNEUE_REGULAR value + * @property {number} OSWALD_HEAVY=5 OSWALD_HEAVY value */ - ClearChatAction.create = function create(properties) { - return new ClearChatAction(properties); - }; + ExtendedTextMessage.ExtendedTextMessageFontType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SANS_SERIF"] = 0; + values[valuesById[1] = "SERIF"] = 1; + values[valuesById[2] = "NORICAN_REGULAR"] = 2; + values[valuesById[3] = "BRYNDAN_WRITE"] = 3; + values[valuesById[4] = "BEBASNEUE_REGULAR"] = 4; + values[valuesById[5] = "OSWALD_HEAVY"] = 5; + return values; + })(); /** - * Encodes the specified ClearChatAction message. Does not implicitly {@link proto.ClearChatAction.verify|verify} messages. - * @function encode - * @memberof proto.ClearChatAction - * @static - * @param {proto.IClearChatAction} message ClearChatAction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * ExtendedTextMessagePreviewType enum. + * @name proto.ExtendedTextMessage.ExtendedTextMessagePreviewType + * @enum {number} + * @property {number} NONE=0 NONE value + * @property {number} VIDEO=1 VIDEO value */ - ClearChatAction.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.messageRange != null && Object.hasOwnProperty.call(message, "messageRange")) - $root.proto.SyncActionMessageRange.encode(message.messageRange, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; + ExtendedTextMessage.ExtendedTextMessagePreviewType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NONE"] = 0; + values[valuesById[1] = "VIDEO"] = 1; + return values; + })(); /** - * Encodes the specified ClearChatAction message, length delimited. Does not implicitly {@link proto.ClearChatAction.verify|verify} messages. - * @function encodeDelimited - * @memberof proto.ClearChatAction - * @static - * @param {proto.IClearChatAction} message ClearChatAction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * ExtendedTextMessageInviteLinkGroupType enum. + * @name proto.ExtendedTextMessage.ExtendedTextMessageInviteLinkGroupType + * @enum {number} + * @property {number} DEFAULT=0 DEFAULT value + * @property {number} PARENT=1 PARENT value */ - ClearChatAction.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + ExtendedTextMessage.ExtendedTextMessageInviteLinkGroupType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DEFAULT"] = 0; + values[valuesById[1] = "PARENT"] = 1; + return values; + })(); + + return ExtendedTextMessage; + })(); + + proto.ExternalAdReplyInfo = (function() { /** - * Decodes a ClearChatAction message from the specified reader or buffer. - * @function decode - * @memberof proto.ClearChatAction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {proto.ClearChatAction} ClearChatAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Properties of an ExternalAdReplyInfo. + * @memberof proto + * @interface IExternalAdReplyInfo + * @property {string|null} [title] ExternalAdReplyInfo title + * @property {string|null} [body] ExternalAdReplyInfo body + * @property {proto.ExternalAdReplyInfo.ExternalAdReplyInfoMediaType|null} [mediaType] ExternalAdReplyInfo mediaType + * @property {string|null} [thumbnailUrl] ExternalAdReplyInfo thumbnailUrl + * @property {string|null} [mediaUrl] ExternalAdReplyInfo mediaUrl + * @property {Uint8Array|null} [thumbnail] ExternalAdReplyInfo thumbnail + * @property {string|null} [sourceType] ExternalAdReplyInfo sourceType + * @property {string|null} [sourceId] ExternalAdReplyInfo sourceId + * @property {string|null} [sourceUrl] ExternalAdReplyInfo sourceUrl + * @property {boolean|null} [containsAutoReply] ExternalAdReplyInfo containsAutoReply + * @property {boolean|null} [renderLargerThumbnail] ExternalAdReplyInfo renderLargerThumbnail + * @property {boolean|null} [showAdAttribution] ExternalAdReplyInfo showAdAttribution */ - ClearChatAction.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.ClearChatAction(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.messageRange = $root.proto.SyncActionMessageRange.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; /** - * Decodes a ClearChatAction message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof proto.ClearChatAction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.ClearChatAction} ClearChatAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Constructs a new ExternalAdReplyInfo. + * @memberof proto + * @classdesc Represents an ExternalAdReplyInfo. + * @implements IExternalAdReplyInfo + * @constructor + * @param {proto.IExternalAdReplyInfo=} [properties] Properties to set */ - ClearChatAction.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + function ExternalAdReplyInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } /** - * Verifies a ClearChatAction message. - * @function verify - * @memberof proto.ClearChatAction - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not + * ExternalAdReplyInfo title. + * @member {string} title + * @memberof proto.ExternalAdReplyInfo + * @instance */ - ClearChatAction.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.messageRange != null && message.hasOwnProperty("messageRange")) { - var error = $root.proto.SyncActionMessageRange.verify(message.messageRange); - if (error) - return "messageRange." + error; - } - return null; - }; + ExternalAdReplyInfo.prototype.title = ""; /** - * Creates a ClearChatAction message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof proto.ClearChatAction - * @static - * @param {Object.} object Plain object - * @returns {proto.ClearChatAction} ClearChatAction + * ExternalAdReplyInfo body. + * @member {string} body + * @memberof proto.ExternalAdReplyInfo + * @instance */ - ClearChatAction.fromObject = function fromObject(object) { - if (object instanceof $root.proto.ClearChatAction) - return object; - var message = new $root.proto.ClearChatAction(); - if (object.messageRange != null) { - if (typeof object.messageRange !== "object") - throw TypeError(".proto.ClearChatAction.messageRange: object expected"); - message.messageRange = $root.proto.SyncActionMessageRange.fromObject(object.messageRange); - } - return message; - }; + ExternalAdReplyInfo.prototype.body = ""; /** - * Creates a plain object from a ClearChatAction message. Also converts values to other types if specified. - * @function toObject - * @memberof proto.ClearChatAction - * @static - * @param {proto.ClearChatAction} message ClearChatAction - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object + * ExternalAdReplyInfo mediaType. + * @member {proto.ExternalAdReplyInfo.ExternalAdReplyInfoMediaType} mediaType + * @memberof proto.ExternalAdReplyInfo + * @instance */ - ClearChatAction.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.messageRange = null; - if (message.messageRange != null && message.hasOwnProperty("messageRange")) - object.messageRange = $root.proto.SyncActionMessageRange.toObject(message.messageRange, options); - return object; - }; + ExternalAdReplyInfo.prototype.mediaType = 0; /** - * Converts this ClearChatAction to JSON. - * @function toJSON - * @memberof proto.ClearChatAction + * ExternalAdReplyInfo thumbnailUrl. + * @member {string} thumbnailUrl + * @memberof proto.ExternalAdReplyInfo * @instance - * @returns {Object.} JSON object */ - ClearChatAction.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + ExternalAdReplyInfo.prototype.thumbnailUrl = ""; - return ClearChatAction; - })(); + /** + * ExternalAdReplyInfo mediaUrl. + * @member {string} mediaUrl + * @memberof proto.ExternalAdReplyInfo + * @instance + */ + ExternalAdReplyInfo.prototype.mediaUrl = ""; - proto.DeleteChatAction = (function() { + /** + * ExternalAdReplyInfo thumbnail. + * @member {Uint8Array} thumbnail + * @memberof proto.ExternalAdReplyInfo + * @instance + */ + ExternalAdReplyInfo.prototype.thumbnail = $util.newBuffer([]); /** - * Properties of a DeleteChatAction. - * @memberof proto - * @interface IDeleteChatAction - * @property {proto.ISyncActionMessageRange|null} [messageRange] DeleteChatAction messageRange + * ExternalAdReplyInfo sourceType. + * @member {string} sourceType + * @memberof proto.ExternalAdReplyInfo + * @instance */ + ExternalAdReplyInfo.prototype.sourceType = ""; /** - * Constructs a new DeleteChatAction. - * @memberof proto - * @classdesc Represents a DeleteChatAction. - * @implements IDeleteChatAction - * @constructor - * @param {proto.IDeleteChatAction=} [properties] Properties to set + * ExternalAdReplyInfo sourceId. + * @member {string} sourceId + * @memberof proto.ExternalAdReplyInfo + * @instance */ - function DeleteChatAction(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + ExternalAdReplyInfo.prototype.sourceId = ""; /** - * DeleteChatAction messageRange. - * @member {proto.ISyncActionMessageRange|null|undefined} messageRange - * @memberof proto.DeleteChatAction + * ExternalAdReplyInfo sourceUrl. + * @member {string} sourceUrl + * @memberof proto.ExternalAdReplyInfo * @instance */ - DeleteChatAction.prototype.messageRange = null; + ExternalAdReplyInfo.prototype.sourceUrl = ""; /** - * Creates a new DeleteChatAction instance using the specified properties. + * ExternalAdReplyInfo containsAutoReply. + * @member {boolean} containsAutoReply + * @memberof proto.ExternalAdReplyInfo + * @instance + */ + ExternalAdReplyInfo.prototype.containsAutoReply = false; + + /** + * ExternalAdReplyInfo renderLargerThumbnail. + * @member {boolean} renderLargerThumbnail + * @memberof proto.ExternalAdReplyInfo + * @instance + */ + ExternalAdReplyInfo.prototype.renderLargerThumbnail = false; + + /** + * ExternalAdReplyInfo showAdAttribution. + * @member {boolean} showAdAttribution + * @memberof proto.ExternalAdReplyInfo + * @instance + */ + ExternalAdReplyInfo.prototype.showAdAttribution = false; + + /** + * Creates a new ExternalAdReplyInfo instance using the specified properties. * @function create - * @memberof proto.DeleteChatAction + * @memberof proto.ExternalAdReplyInfo * @static - * @param {proto.IDeleteChatAction=} [properties] Properties to set - * @returns {proto.DeleteChatAction} DeleteChatAction instance + * @param {proto.IExternalAdReplyInfo=} [properties] Properties to set + * @returns {proto.ExternalAdReplyInfo} ExternalAdReplyInfo instance */ - DeleteChatAction.create = function create(properties) { - return new DeleteChatAction(properties); + ExternalAdReplyInfo.create = function create(properties) { + return new ExternalAdReplyInfo(properties); }; /** - * Encodes the specified DeleteChatAction message. Does not implicitly {@link proto.DeleteChatAction.verify|verify} messages. + * Encodes the specified ExternalAdReplyInfo message. Does not implicitly {@link proto.ExternalAdReplyInfo.verify|verify} messages. * @function encode - * @memberof proto.DeleteChatAction + * @memberof proto.ExternalAdReplyInfo * @static - * @param {proto.IDeleteChatAction} message DeleteChatAction message or plain object to encode + * @param {proto.IExternalAdReplyInfo} message ExternalAdReplyInfo message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeleteChatAction.encode = function encode(message, writer) { + ExternalAdReplyInfo.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.messageRange != null && Object.hasOwnProperty.call(message, "messageRange")) - $root.proto.SyncActionMessageRange.encode(message.messageRange, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.title != null && Object.hasOwnProperty.call(message, "title")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.title); + if (message.body != null && Object.hasOwnProperty.call(message, "body")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.body); + if (message.mediaType != null && Object.hasOwnProperty.call(message, "mediaType")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.mediaType); + if (message.thumbnailUrl != null && Object.hasOwnProperty.call(message, "thumbnailUrl")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.thumbnailUrl); + if (message.mediaUrl != null && Object.hasOwnProperty.call(message, "mediaUrl")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.mediaUrl); + if (message.thumbnail != null && Object.hasOwnProperty.call(message, "thumbnail")) + writer.uint32(/* id 6, wireType 2 =*/50).bytes(message.thumbnail); + if (message.sourceType != null && Object.hasOwnProperty.call(message, "sourceType")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.sourceType); + if (message.sourceId != null && Object.hasOwnProperty.call(message, "sourceId")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.sourceId); + if (message.sourceUrl != null && Object.hasOwnProperty.call(message, "sourceUrl")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.sourceUrl); + if (message.containsAutoReply != null && Object.hasOwnProperty.call(message, "containsAutoReply")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.containsAutoReply); + if (message.renderLargerThumbnail != null && Object.hasOwnProperty.call(message, "renderLargerThumbnail")) + writer.uint32(/* id 11, wireType 0 =*/88).bool(message.renderLargerThumbnail); + if (message.showAdAttribution != null && Object.hasOwnProperty.call(message, "showAdAttribution")) + writer.uint32(/* id 12, wireType 0 =*/96).bool(message.showAdAttribution); return writer; }; /** - * Encodes the specified DeleteChatAction message, length delimited. Does not implicitly {@link proto.DeleteChatAction.verify|verify} messages. + * Encodes the specified ExternalAdReplyInfo message, length delimited. Does not implicitly {@link proto.ExternalAdReplyInfo.verify|verify} messages. * @function encodeDelimited - * @memberof proto.DeleteChatAction + * @memberof proto.ExternalAdReplyInfo * @static - * @param {proto.IDeleteChatAction} message DeleteChatAction message or plain object to encode + * @param {proto.IExternalAdReplyInfo} message ExternalAdReplyInfo message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeleteChatAction.encodeDelimited = function encodeDelimited(message, writer) { + ExternalAdReplyInfo.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a DeleteChatAction message from the specified reader or buffer. + * Decodes an ExternalAdReplyInfo message from the specified reader or buffer. * @function decode - * @memberof proto.DeleteChatAction + * @memberof proto.ExternalAdReplyInfo * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {proto.DeleteChatAction} DeleteChatAction + * @returns {proto.ExternalAdReplyInfo} ExternalAdReplyInfo * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DeleteChatAction.decode = function decode(reader, length) { + ExternalAdReplyInfo.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.DeleteChatAction(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.ExternalAdReplyInfo(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.messageRange = $root.proto.SyncActionMessageRange.decode(reader, reader.uint32()); + message.title = reader.string(); + break; + case 2: + message.body = reader.string(); + break; + case 3: + message.mediaType = reader.int32(); + break; + case 4: + message.thumbnailUrl = reader.string(); + break; + case 5: + message.mediaUrl = reader.string(); + break; + case 6: + message.thumbnail = reader.bytes(); + break; + case 7: + message.sourceType = reader.string(); + break; + case 8: + message.sourceId = reader.string(); + break; + case 9: + message.sourceUrl = reader.string(); + break; + case 10: + message.containsAutoReply = reader.bool(); + break; + case 11: + message.renderLargerThumbnail = reader.bool(); + break; + case 12: + message.showAdAttribution = reader.bool(); break; default: reader.skipType(tag & 7); @@ -11182,112 +11253,239 @@ $root.proto = (function() { }; /** - * Decodes a DeleteChatAction message from the specified reader or buffer, length delimited. + * Decodes an ExternalAdReplyInfo message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof proto.DeleteChatAction + * @memberof proto.ExternalAdReplyInfo * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.DeleteChatAction} DeleteChatAction + * @returns {proto.ExternalAdReplyInfo} ExternalAdReplyInfo * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DeleteChatAction.decodeDelimited = function decodeDelimited(reader) { + ExternalAdReplyInfo.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a DeleteChatAction message. + * Verifies an ExternalAdReplyInfo message. * @function verify - * @memberof proto.DeleteChatAction + * @memberof proto.ExternalAdReplyInfo * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - DeleteChatAction.verify = function verify(message) { + ExternalAdReplyInfo.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.messageRange != null && message.hasOwnProperty("messageRange")) { - var error = $root.proto.SyncActionMessageRange.verify(message.messageRange); - if (error) - return "messageRange." + error; - } - return null; - }; - - /** - * Creates a DeleteChatAction message from a plain object. Also converts values to their respective internal types. + if (message.title != null && message.hasOwnProperty("title")) + if (!$util.isString(message.title)) + return "title: string expected"; + if (message.body != null && message.hasOwnProperty("body")) + if (!$util.isString(message.body)) + return "body: string expected"; + if (message.mediaType != null && message.hasOwnProperty("mediaType")) + switch (message.mediaType) { + default: + return "mediaType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.thumbnailUrl != null && message.hasOwnProperty("thumbnailUrl")) + if (!$util.isString(message.thumbnailUrl)) + return "thumbnailUrl: string expected"; + if (message.mediaUrl != null && message.hasOwnProperty("mediaUrl")) + if (!$util.isString(message.mediaUrl)) + return "mediaUrl: string expected"; + if (message.thumbnail != null && message.hasOwnProperty("thumbnail")) + if (!(message.thumbnail && typeof message.thumbnail.length === "number" || $util.isString(message.thumbnail))) + return "thumbnail: buffer expected"; + if (message.sourceType != null && message.hasOwnProperty("sourceType")) + if (!$util.isString(message.sourceType)) + return "sourceType: string expected"; + if (message.sourceId != null && message.hasOwnProperty("sourceId")) + if (!$util.isString(message.sourceId)) + return "sourceId: string expected"; + if (message.sourceUrl != null && message.hasOwnProperty("sourceUrl")) + if (!$util.isString(message.sourceUrl)) + return "sourceUrl: string expected"; + if (message.containsAutoReply != null && message.hasOwnProperty("containsAutoReply")) + if (typeof message.containsAutoReply !== "boolean") + return "containsAutoReply: boolean expected"; + if (message.renderLargerThumbnail != null && message.hasOwnProperty("renderLargerThumbnail")) + if (typeof message.renderLargerThumbnail !== "boolean") + return "renderLargerThumbnail: boolean expected"; + if (message.showAdAttribution != null && message.hasOwnProperty("showAdAttribution")) + if (typeof message.showAdAttribution !== "boolean") + return "showAdAttribution: boolean expected"; + return null; + }; + + /** + * Creates an ExternalAdReplyInfo message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof proto.DeleteChatAction + * @memberof proto.ExternalAdReplyInfo * @static * @param {Object.} object Plain object - * @returns {proto.DeleteChatAction} DeleteChatAction + * @returns {proto.ExternalAdReplyInfo} ExternalAdReplyInfo */ - DeleteChatAction.fromObject = function fromObject(object) { - if (object instanceof $root.proto.DeleteChatAction) + ExternalAdReplyInfo.fromObject = function fromObject(object) { + if (object instanceof $root.proto.ExternalAdReplyInfo) return object; - var message = new $root.proto.DeleteChatAction(); - if (object.messageRange != null) { - if (typeof object.messageRange !== "object") - throw TypeError(".proto.DeleteChatAction.messageRange: object expected"); - message.messageRange = $root.proto.SyncActionMessageRange.fromObject(object.messageRange); + var message = new $root.proto.ExternalAdReplyInfo(); + if (object.title != null) + message.title = String(object.title); + if (object.body != null) + message.body = String(object.body); + switch (object.mediaType) { + case "NONE": + case 0: + message.mediaType = 0; + break; + case "IMAGE": + case 1: + message.mediaType = 1; + break; + case "VIDEO": + case 2: + message.mediaType = 2; + break; } + if (object.thumbnailUrl != null) + message.thumbnailUrl = String(object.thumbnailUrl); + if (object.mediaUrl != null) + message.mediaUrl = String(object.mediaUrl); + if (object.thumbnail != null) + if (typeof object.thumbnail === "string") + $util.base64.decode(object.thumbnail, message.thumbnail = $util.newBuffer($util.base64.length(object.thumbnail)), 0); + else if (object.thumbnail.length) + message.thumbnail = object.thumbnail; + if (object.sourceType != null) + message.sourceType = String(object.sourceType); + if (object.sourceId != null) + message.sourceId = String(object.sourceId); + if (object.sourceUrl != null) + message.sourceUrl = String(object.sourceUrl); + if (object.containsAutoReply != null) + message.containsAutoReply = Boolean(object.containsAutoReply); + if (object.renderLargerThumbnail != null) + message.renderLargerThumbnail = Boolean(object.renderLargerThumbnail); + if (object.showAdAttribution != null) + message.showAdAttribution = Boolean(object.showAdAttribution); return message; }; /** - * Creates a plain object from a DeleteChatAction message. Also converts values to other types if specified. + * Creates a plain object from an ExternalAdReplyInfo message. Also converts values to other types if specified. * @function toObject - * @memberof proto.DeleteChatAction + * @memberof proto.ExternalAdReplyInfo * @static - * @param {proto.DeleteChatAction} message DeleteChatAction + * @param {proto.ExternalAdReplyInfo} message ExternalAdReplyInfo * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DeleteChatAction.toObject = function toObject(message, options) { + ExternalAdReplyInfo.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) - object.messageRange = null; - if (message.messageRange != null && message.hasOwnProperty("messageRange")) - object.messageRange = $root.proto.SyncActionMessageRange.toObject(message.messageRange, options); + if (options.defaults) { + object.title = ""; + object.body = ""; + object.mediaType = options.enums === String ? "NONE" : 0; + object.thumbnailUrl = ""; + object.mediaUrl = ""; + if (options.bytes === String) + object.thumbnail = ""; + else { + object.thumbnail = []; + if (options.bytes !== Array) + object.thumbnail = $util.newBuffer(object.thumbnail); + } + object.sourceType = ""; + object.sourceId = ""; + object.sourceUrl = ""; + object.containsAutoReply = false; + object.renderLargerThumbnail = false; + object.showAdAttribution = false; + } + if (message.title != null && message.hasOwnProperty("title")) + object.title = message.title; + if (message.body != null && message.hasOwnProperty("body")) + object.body = message.body; + if (message.mediaType != null && message.hasOwnProperty("mediaType")) + object.mediaType = options.enums === String ? $root.proto.ExternalAdReplyInfo.ExternalAdReplyInfoMediaType[message.mediaType] : message.mediaType; + if (message.thumbnailUrl != null && message.hasOwnProperty("thumbnailUrl")) + object.thumbnailUrl = message.thumbnailUrl; + if (message.mediaUrl != null && message.hasOwnProperty("mediaUrl")) + object.mediaUrl = message.mediaUrl; + if (message.thumbnail != null && message.hasOwnProperty("thumbnail")) + object.thumbnail = options.bytes === String ? $util.base64.encode(message.thumbnail, 0, message.thumbnail.length) : options.bytes === Array ? Array.prototype.slice.call(message.thumbnail) : message.thumbnail; + if (message.sourceType != null && message.hasOwnProperty("sourceType")) + object.sourceType = message.sourceType; + if (message.sourceId != null && message.hasOwnProperty("sourceId")) + object.sourceId = message.sourceId; + if (message.sourceUrl != null && message.hasOwnProperty("sourceUrl")) + object.sourceUrl = message.sourceUrl; + if (message.containsAutoReply != null && message.hasOwnProperty("containsAutoReply")) + object.containsAutoReply = message.containsAutoReply; + if (message.renderLargerThumbnail != null && message.hasOwnProperty("renderLargerThumbnail")) + object.renderLargerThumbnail = message.renderLargerThumbnail; + if (message.showAdAttribution != null && message.hasOwnProperty("showAdAttribution")) + object.showAdAttribution = message.showAdAttribution; return object; }; /** - * Converts this DeleteChatAction to JSON. + * Converts this ExternalAdReplyInfo to JSON. * @function toJSON - * @memberof proto.DeleteChatAction + * @memberof proto.ExternalAdReplyInfo * @instance * @returns {Object.} JSON object */ - DeleteChatAction.prototype.toJSON = function toJSON() { + ExternalAdReplyInfo.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return DeleteChatAction; + /** + * ExternalAdReplyInfoMediaType enum. + * @name proto.ExternalAdReplyInfo.ExternalAdReplyInfoMediaType + * @enum {number} + * @property {number} NONE=0 NONE value + * @property {number} IMAGE=1 IMAGE value + * @property {number} VIDEO=2 VIDEO value + */ + ExternalAdReplyInfo.ExternalAdReplyInfoMediaType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NONE"] = 0; + values[valuesById[1] = "IMAGE"] = 1; + values[valuesById[2] = "VIDEO"] = 2; + return values; + })(); + + return ExternalAdReplyInfo; })(); - proto.UnarchiveChatsSetting = (function() { + proto.Footer = (function() { /** - * Properties of an UnarchiveChatsSetting. + * Properties of a Footer. * @memberof proto - * @interface IUnarchiveChatsSetting - * @property {boolean|null} [unarchiveChats] UnarchiveChatsSetting unarchiveChats + * @interface IFooter + * @property {string|null} [text] Footer text */ /** - * Constructs a new UnarchiveChatsSetting. + * Constructs a new Footer. * @memberof proto - * @classdesc Represents an UnarchiveChatsSetting. - * @implements IUnarchiveChatsSetting + * @classdesc Represents a Footer. + * @implements IFooter * @constructor - * @param {proto.IUnarchiveChatsSetting=} [properties] Properties to set + * @param {proto.IFooter=} [properties] Properties to set */ - function UnarchiveChatsSetting(properties) { + function Footer(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -11295,75 +11493,75 @@ $root.proto = (function() { } /** - * UnarchiveChatsSetting unarchiveChats. - * @member {boolean} unarchiveChats - * @memberof proto.UnarchiveChatsSetting + * Footer text. + * @member {string} text + * @memberof proto.Footer * @instance */ - UnarchiveChatsSetting.prototype.unarchiveChats = false; + Footer.prototype.text = ""; /** - * Creates a new UnarchiveChatsSetting instance using the specified properties. + * Creates a new Footer instance using the specified properties. * @function create - * @memberof proto.UnarchiveChatsSetting + * @memberof proto.Footer * @static - * @param {proto.IUnarchiveChatsSetting=} [properties] Properties to set - * @returns {proto.UnarchiveChatsSetting} UnarchiveChatsSetting instance + * @param {proto.IFooter=} [properties] Properties to set + * @returns {proto.Footer} Footer instance */ - UnarchiveChatsSetting.create = function create(properties) { - return new UnarchiveChatsSetting(properties); + Footer.create = function create(properties) { + return new Footer(properties); }; /** - * Encodes the specified UnarchiveChatsSetting message. Does not implicitly {@link proto.UnarchiveChatsSetting.verify|verify} messages. + * Encodes the specified Footer message. Does not implicitly {@link proto.Footer.verify|verify} messages. * @function encode - * @memberof proto.UnarchiveChatsSetting + * @memberof proto.Footer * @static - * @param {proto.IUnarchiveChatsSetting} message UnarchiveChatsSetting message or plain object to encode + * @param {proto.IFooter} message Footer message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UnarchiveChatsSetting.encode = function encode(message, writer) { + Footer.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.unarchiveChats != null && Object.hasOwnProperty.call(message, "unarchiveChats")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.unarchiveChats); + if (message.text != null && Object.hasOwnProperty.call(message, "text")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.text); return writer; }; /** - * Encodes the specified UnarchiveChatsSetting message, length delimited. Does not implicitly {@link proto.UnarchiveChatsSetting.verify|verify} messages. + * Encodes the specified Footer message, length delimited. Does not implicitly {@link proto.Footer.verify|verify} messages. * @function encodeDelimited - * @memberof proto.UnarchiveChatsSetting + * @memberof proto.Footer * @static - * @param {proto.IUnarchiveChatsSetting} message UnarchiveChatsSetting message or plain object to encode + * @param {proto.IFooter} message Footer message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UnarchiveChatsSetting.encodeDelimited = function encodeDelimited(message, writer) { + Footer.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an UnarchiveChatsSetting message from the specified reader or buffer. + * Decodes a Footer message from the specified reader or buffer. * @function decode - * @memberof proto.UnarchiveChatsSetting + * @memberof proto.Footer * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {proto.UnarchiveChatsSetting} UnarchiveChatsSetting + * @returns {proto.Footer} Footer * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UnarchiveChatsSetting.decode = function decode(reader, length) { + Footer.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.UnarchiveChatsSetting(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.Footer(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.unarchiveChats = reader.bool(); + message.text = reader.string(); break; default: reader.skipType(tag & 7); @@ -11374,110 +11572,115 @@ $root.proto = (function() { }; /** - * Decodes an UnarchiveChatsSetting message from the specified reader or buffer, length delimited. + * Decodes a Footer message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof proto.UnarchiveChatsSetting + * @memberof proto.Footer * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.UnarchiveChatsSetting} UnarchiveChatsSetting + * @returns {proto.Footer} Footer * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UnarchiveChatsSetting.decodeDelimited = function decodeDelimited(reader) { + Footer.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an UnarchiveChatsSetting message. + * Verifies a Footer message. * @function verify - * @memberof proto.UnarchiveChatsSetting + * @memberof proto.Footer * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - UnarchiveChatsSetting.verify = function verify(message) { + Footer.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.unarchiveChats != null && message.hasOwnProperty("unarchiveChats")) - if (typeof message.unarchiveChats !== "boolean") - return "unarchiveChats: boolean expected"; + if (message.text != null && message.hasOwnProperty("text")) + if (!$util.isString(message.text)) + return "text: string expected"; return null; }; /** - * Creates an UnarchiveChatsSetting message from a plain object. Also converts values to their respective internal types. + * Creates a Footer message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof proto.UnarchiveChatsSetting + * @memberof proto.Footer * @static * @param {Object.} object Plain object - * @returns {proto.UnarchiveChatsSetting} UnarchiveChatsSetting + * @returns {proto.Footer} Footer */ - UnarchiveChatsSetting.fromObject = function fromObject(object) { - if (object instanceof $root.proto.UnarchiveChatsSetting) + Footer.fromObject = function fromObject(object) { + if (object instanceof $root.proto.Footer) return object; - var message = new $root.proto.UnarchiveChatsSetting(); - if (object.unarchiveChats != null) - message.unarchiveChats = Boolean(object.unarchiveChats); + var message = new $root.proto.Footer(); + if (object.text != null) + message.text = String(object.text); return message; }; /** - * Creates a plain object from an UnarchiveChatsSetting message. Also converts values to other types if specified. + * Creates a plain object from a Footer message. Also converts values to other types if specified. * @function toObject - * @memberof proto.UnarchiveChatsSetting + * @memberof proto.Footer * @static - * @param {proto.UnarchiveChatsSetting} message UnarchiveChatsSetting + * @param {proto.Footer} message Footer * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - UnarchiveChatsSetting.toObject = function toObject(message, options) { + Footer.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) - object.unarchiveChats = false; - if (message.unarchiveChats != null && message.hasOwnProperty("unarchiveChats")) - object.unarchiveChats = message.unarchiveChats; + object.text = ""; + if (message.text != null && message.hasOwnProperty("text")) + object.text = message.text; return object; }; /** - * Converts this UnarchiveChatsSetting to JSON. + * Converts this Footer to JSON. * @function toJSON - * @memberof proto.UnarchiveChatsSetting + * @memberof proto.Footer * @instance * @returns {Object.} JSON object */ - UnarchiveChatsSetting.prototype.toJSON = function toJSON() { + Footer.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return UnarchiveChatsSetting; + return Footer; })(); - proto.SyncActionMessageRange = (function() { + proto.FourRowTemplate = (function() { /** - * Properties of a SyncActionMessageRange. + * Properties of a FourRowTemplate. * @memberof proto - * @interface ISyncActionMessageRange - * @property {number|Long|null} [lastMessageTimestamp] SyncActionMessageRange lastMessageTimestamp - * @property {number|Long|null} [lastSystemMessageTimestamp] SyncActionMessageRange lastSystemMessageTimestamp - * @property {Array.|null} [messages] SyncActionMessageRange messages + * @interface IFourRowTemplate + * @property {proto.IHighlyStructuredMessage|null} [content] FourRowTemplate content + * @property {proto.IHighlyStructuredMessage|null} [footer] FourRowTemplate footer + * @property {Array.|null} [buttons] FourRowTemplate buttons + * @property {proto.IDocumentMessage|null} [documentMessage] FourRowTemplate documentMessage + * @property {proto.IHighlyStructuredMessage|null} [highlyStructuredMessage] FourRowTemplate highlyStructuredMessage + * @property {proto.IImageMessage|null} [imageMessage] FourRowTemplate imageMessage + * @property {proto.IVideoMessage|null} [videoMessage] FourRowTemplate videoMessage + * @property {proto.ILocationMessage|null} [locationMessage] FourRowTemplate locationMessage */ /** - * Constructs a new SyncActionMessageRange. + * Constructs a new FourRowTemplate. * @memberof proto - * @classdesc Represents a SyncActionMessageRange. - * @implements ISyncActionMessageRange + * @classdesc Represents a FourRowTemplate. + * @implements IFourRowTemplate * @constructor - * @param {proto.ISyncActionMessageRange=} [properties] Properties to set + * @param {proto.IFourRowTemplate=} [properties] Properties to set */ - function SyncActionMessageRange(properties) { - this.messages = []; + function FourRowTemplate(properties) { + this.buttons = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -11485,104 +11688,183 @@ $root.proto = (function() { } /** - * SyncActionMessageRange lastMessageTimestamp. - * @member {number|Long} lastMessageTimestamp - * @memberof proto.SyncActionMessageRange + * FourRowTemplate content. + * @member {proto.IHighlyStructuredMessage|null|undefined} content + * @memberof proto.FourRowTemplate * @instance */ - SyncActionMessageRange.prototype.lastMessageTimestamp = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + FourRowTemplate.prototype.content = null; /** - * SyncActionMessageRange lastSystemMessageTimestamp. - * @member {number|Long} lastSystemMessageTimestamp - * @memberof proto.SyncActionMessageRange + * FourRowTemplate footer. + * @member {proto.IHighlyStructuredMessage|null|undefined} footer + * @memberof proto.FourRowTemplate * @instance */ - SyncActionMessageRange.prototype.lastSystemMessageTimestamp = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + FourRowTemplate.prototype.footer = null; /** - * SyncActionMessageRange messages. - * @member {Array.} messages - * @memberof proto.SyncActionMessageRange + * FourRowTemplate buttons. + * @member {Array.} buttons + * @memberof proto.FourRowTemplate * @instance */ - SyncActionMessageRange.prototype.messages = $util.emptyArray; + FourRowTemplate.prototype.buttons = $util.emptyArray; /** - * Creates a new SyncActionMessageRange instance using the specified properties. + * FourRowTemplate documentMessage. + * @member {proto.IDocumentMessage|null|undefined} documentMessage + * @memberof proto.FourRowTemplate + * @instance + */ + FourRowTemplate.prototype.documentMessage = null; + + /** + * FourRowTemplate highlyStructuredMessage. + * @member {proto.IHighlyStructuredMessage|null|undefined} highlyStructuredMessage + * @memberof proto.FourRowTemplate + * @instance + */ + FourRowTemplate.prototype.highlyStructuredMessage = null; + + /** + * FourRowTemplate imageMessage. + * @member {proto.IImageMessage|null|undefined} imageMessage + * @memberof proto.FourRowTemplate + * @instance + */ + FourRowTemplate.prototype.imageMessage = null; + + /** + * FourRowTemplate videoMessage. + * @member {proto.IVideoMessage|null|undefined} videoMessage + * @memberof proto.FourRowTemplate + * @instance + */ + FourRowTemplate.prototype.videoMessage = null; + + /** + * FourRowTemplate locationMessage. + * @member {proto.ILocationMessage|null|undefined} locationMessage + * @memberof proto.FourRowTemplate + * @instance + */ + FourRowTemplate.prototype.locationMessage = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * FourRowTemplate title. + * @member {"documentMessage"|"highlyStructuredMessage"|"imageMessage"|"videoMessage"|"locationMessage"|undefined} title + * @memberof proto.FourRowTemplate + * @instance + */ + Object.defineProperty(FourRowTemplate.prototype, "title", { + get: $util.oneOfGetter($oneOfFields = ["documentMessage", "highlyStructuredMessage", "imageMessage", "videoMessage", "locationMessage"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new FourRowTemplate instance using the specified properties. * @function create - * @memberof proto.SyncActionMessageRange + * @memberof proto.FourRowTemplate * @static - * @param {proto.ISyncActionMessageRange=} [properties] Properties to set - * @returns {proto.SyncActionMessageRange} SyncActionMessageRange instance + * @param {proto.IFourRowTemplate=} [properties] Properties to set + * @returns {proto.FourRowTemplate} FourRowTemplate instance */ - SyncActionMessageRange.create = function create(properties) { - return new SyncActionMessageRange(properties); + FourRowTemplate.create = function create(properties) { + return new FourRowTemplate(properties); }; /** - * Encodes the specified SyncActionMessageRange message. Does not implicitly {@link proto.SyncActionMessageRange.verify|verify} messages. + * Encodes the specified FourRowTemplate message. Does not implicitly {@link proto.FourRowTemplate.verify|verify} messages. * @function encode - * @memberof proto.SyncActionMessageRange + * @memberof proto.FourRowTemplate * @static - * @param {proto.ISyncActionMessageRange} message SyncActionMessageRange message or plain object to encode + * @param {proto.IFourRowTemplate} message FourRowTemplate message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SyncActionMessageRange.encode = function encode(message, writer) { + FourRowTemplate.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.lastMessageTimestamp != null && Object.hasOwnProperty.call(message, "lastMessageTimestamp")) - writer.uint32(/* id 1, wireType 0 =*/8).int64(message.lastMessageTimestamp); - if (message.lastSystemMessageTimestamp != null && Object.hasOwnProperty.call(message, "lastSystemMessageTimestamp")) - writer.uint32(/* id 2, wireType 0 =*/16).int64(message.lastSystemMessageTimestamp); - if (message.messages != null && message.messages.length) - for (var i = 0; i < message.messages.length; ++i) - $root.proto.SyncActionMessage.encode(message.messages[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.documentMessage != null && Object.hasOwnProperty.call(message, "documentMessage")) + $root.proto.DocumentMessage.encode(message.documentMessage, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.highlyStructuredMessage != null && Object.hasOwnProperty.call(message, "highlyStructuredMessage")) + $root.proto.HighlyStructuredMessage.encode(message.highlyStructuredMessage, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.imageMessage != null && Object.hasOwnProperty.call(message, "imageMessage")) + $root.proto.ImageMessage.encode(message.imageMessage, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.videoMessage != null && Object.hasOwnProperty.call(message, "videoMessage")) + $root.proto.VideoMessage.encode(message.videoMessage, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.locationMessage != null && Object.hasOwnProperty.call(message, "locationMessage")) + $root.proto.LocationMessage.encode(message.locationMessage, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.content != null && Object.hasOwnProperty.call(message, "content")) + $root.proto.HighlyStructuredMessage.encode(message.content, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.footer != null && Object.hasOwnProperty.call(message, "footer")) + $root.proto.HighlyStructuredMessage.encode(message.footer, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.buttons != null && message.buttons.length) + for (var i = 0; i < message.buttons.length; ++i) + $root.proto.TemplateButton.encode(message.buttons[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); return writer; }; /** - * Encodes the specified SyncActionMessageRange message, length delimited. Does not implicitly {@link proto.SyncActionMessageRange.verify|verify} messages. + * Encodes the specified FourRowTemplate message, length delimited. Does not implicitly {@link proto.FourRowTemplate.verify|verify} messages. * @function encodeDelimited - * @memberof proto.SyncActionMessageRange + * @memberof proto.FourRowTemplate * @static - * @param {proto.ISyncActionMessageRange} message SyncActionMessageRange message or plain object to encode + * @param {proto.IFourRowTemplate} message FourRowTemplate message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SyncActionMessageRange.encodeDelimited = function encodeDelimited(message, writer) { + FourRowTemplate.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a SyncActionMessageRange message from the specified reader or buffer. + * Decodes a FourRowTemplate message from the specified reader or buffer. * @function decode - * @memberof proto.SyncActionMessageRange + * @memberof proto.FourRowTemplate * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {proto.SyncActionMessageRange} SyncActionMessageRange + * @returns {proto.FourRowTemplate} FourRowTemplate * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SyncActionMessageRange.decode = function decode(reader, length) { + FourRowTemplate.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.SyncActionMessageRange(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.FourRowTemplate(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { + case 6: + message.content = $root.proto.HighlyStructuredMessage.decode(reader, reader.uint32()); + break; + case 7: + message.footer = $root.proto.HighlyStructuredMessage.decode(reader, reader.uint32()); + break; + case 8: + if (!(message.buttons && message.buttons.length)) + message.buttons = []; + message.buttons.push($root.proto.TemplateButton.decode(reader, reader.uint32())); + break; case 1: - message.lastMessageTimestamp = reader.int64(); + message.documentMessage = $root.proto.DocumentMessage.decode(reader, reader.uint32()); break; case 2: - message.lastSystemMessageTimestamp = reader.int64(); + message.highlyStructuredMessage = $root.proto.HighlyStructuredMessage.decode(reader, reader.uint32()); break; case 3: - if (!(message.messages && message.messages.length)) - message.messages = []; - message.messages.push($root.proto.SyncActionMessage.decode(reader, reader.uint32())); + message.imageMessage = $root.proto.ImageMessage.decode(reader, reader.uint32()); + break; + case 4: + message.videoMessage = $root.proto.VideoMessage.decode(reader, reader.uint32()); + break; + case 5: + message.locationMessage = $root.proto.LocationMessage.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -11593,171 +11875,251 @@ $root.proto = (function() { }; /** - * Decodes a SyncActionMessageRange message from the specified reader or buffer, length delimited. + * Decodes a FourRowTemplate message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof proto.SyncActionMessageRange + * @memberof proto.FourRowTemplate * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.SyncActionMessageRange} SyncActionMessageRange + * @returns {proto.FourRowTemplate} FourRowTemplate * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SyncActionMessageRange.decodeDelimited = function decodeDelimited(reader) { + FourRowTemplate.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a SyncActionMessageRange message. + * Verifies a FourRowTemplate message. * @function verify - * @memberof proto.SyncActionMessageRange + * @memberof proto.FourRowTemplate * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - SyncActionMessageRange.verify = function verify(message) { + FourRowTemplate.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.lastMessageTimestamp != null && message.hasOwnProperty("lastMessageTimestamp")) - if (!$util.isInteger(message.lastMessageTimestamp) && !(message.lastMessageTimestamp && $util.isInteger(message.lastMessageTimestamp.low) && $util.isInteger(message.lastMessageTimestamp.high))) - return "lastMessageTimestamp: integer|Long expected"; - if (message.lastSystemMessageTimestamp != null && message.hasOwnProperty("lastSystemMessageTimestamp")) - if (!$util.isInteger(message.lastSystemMessageTimestamp) && !(message.lastSystemMessageTimestamp && $util.isInteger(message.lastSystemMessageTimestamp.low) && $util.isInteger(message.lastSystemMessageTimestamp.high))) - return "lastSystemMessageTimestamp: integer|Long expected"; - if (message.messages != null && message.hasOwnProperty("messages")) { - if (!Array.isArray(message.messages)) - return "messages: array expected"; - for (var i = 0; i < message.messages.length; ++i) { - var error = $root.proto.SyncActionMessage.verify(message.messages[i]); - if (error) - return "messages." + error; + var properties = {}; + if (message.content != null && message.hasOwnProperty("content")) { + var error = $root.proto.HighlyStructuredMessage.verify(message.content); + if (error) + return "content." + error; + } + if (message.footer != null && message.hasOwnProperty("footer")) { + var error = $root.proto.HighlyStructuredMessage.verify(message.footer); + if (error) + return "footer." + error; + } + if (message.buttons != null && message.hasOwnProperty("buttons")) { + if (!Array.isArray(message.buttons)) + return "buttons: array expected"; + for (var i = 0; i < message.buttons.length; ++i) { + var error = $root.proto.TemplateButton.verify(message.buttons[i]); + if (error) + return "buttons." + error; + } + } + if (message.documentMessage != null && message.hasOwnProperty("documentMessage")) { + properties.title = 1; + { + var error = $root.proto.DocumentMessage.verify(message.documentMessage); + if (error) + return "documentMessage." + error; + } + } + if (message.highlyStructuredMessage != null && message.hasOwnProperty("highlyStructuredMessage")) { + if (properties.title === 1) + return "title: multiple values"; + properties.title = 1; + { + var error = $root.proto.HighlyStructuredMessage.verify(message.highlyStructuredMessage); + if (error) + return "highlyStructuredMessage." + error; + } + } + if (message.imageMessage != null && message.hasOwnProperty("imageMessage")) { + if (properties.title === 1) + return "title: multiple values"; + properties.title = 1; + { + var error = $root.proto.ImageMessage.verify(message.imageMessage); + if (error) + return "imageMessage." + error; + } + } + if (message.videoMessage != null && message.hasOwnProperty("videoMessage")) { + if (properties.title === 1) + return "title: multiple values"; + properties.title = 1; + { + var error = $root.proto.VideoMessage.verify(message.videoMessage); + if (error) + return "videoMessage." + error; + } + } + if (message.locationMessage != null && message.hasOwnProperty("locationMessage")) { + if (properties.title === 1) + return "title: multiple values"; + properties.title = 1; + { + var error = $root.proto.LocationMessage.verify(message.locationMessage); + if (error) + return "locationMessage." + error; } } return null; }; /** - * Creates a SyncActionMessageRange message from a plain object. Also converts values to their respective internal types. + * Creates a FourRowTemplate message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof proto.SyncActionMessageRange + * @memberof proto.FourRowTemplate * @static * @param {Object.} object Plain object - * @returns {proto.SyncActionMessageRange} SyncActionMessageRange + * @returns {proto.FourRowTemplate} FourRowTemplate */ - SyncActionMessageRange.fromObject = function fromObject(object) { - if (object instanceof $root.proto.SyncActionMessageRange) + FourRowTemplate.fromObject = function fromObject(object) { + if (object instanceof $root.proto.FourRowTemplate) return object; - var message = new $root.proto.SyncActionMessageRange(); - if (object.lastMessageTimestamp != null) - if ($util.Long) - (message.lastMessageTimestamp = $util.Long.fromValue(object.lastMessageTimestamp)).unsigned = false; - else if (typeof object.lastMessageTimestamp === "string") - message.lastMessageTimestamp = parseInt(object.lastMessageTimestamp, 10); - else if (typeof object.lastMessageTimestamp === "number") - message.lastMessageTimestamp = object.lastMessageTimestamp; - else if (typeof object.lastMessageTimestamp === "object") - message.lastMessageTimestamp = new $util.LongBits(object.lastMessageTimestamp.low >>> 0, object.lastMessageTimestamp.high >>> 0).toNumber(); - if (object.lastSystemMessageTimestamp != null) - if ($util.Long) - (message.lastSystemMessageTimestamp = $util.Long.fromValue(object.lastSystemMessageTimestamp)).unsigned = false; - else if (typeof object.lastSystemMessageTimestamp === "string") - message.lastSystemMessageTimestamp = parseInt(object.lastSystemMessageTimestamp, 10); - else if (typeof object.lastSystemMessageTimestamp === "number") - message.lastSystemMessageTimestamp = object.lastSystemMessageTimestamp; - else if (typeof object.lastSystemMessageTimestamp === "object") - message.lastSystemMessageTimestamp = new $util.LongBits(object.lastSystemMessageTimestamp.low >>> 0, object.lastSystemMessageTimestamp.high >>> 0).toNumber(); - if (object.messages) { - if (!Array.isArray(object.messages)) - throw TypeError(".proto.SyncActionMessageRange.messages: array expected"); - message.messages = []; - for (var i = 0; i < object.messages.length; ++i) { - if (typeof object.messages[i] !== "object") - throw TypeError(".proto.SyncActionMessageRange.messages: object expected"); - message.messages[i] = $root.proto.SyncActionMessage.fromObject(object.messages[i]); + var message = new $root.proto.FourRowTemplate(); + if (object.content != null) { + if (typeof object.content !== "object") + throw TypeError(".proto.FourRowTemplate.content: object expected"); + message.content = $root.proto.HighlyStructuredMessage.fromObject(object.content); + } + if (object.footer != null) { + if (typeof object.footer !== "object") + throw TypeError(".proto.FourRowTemplate.footer: object expected"); + message.footer = $root.proto.HighlyStructuredMessage.fromObject(object.footer); + } + if (object.buttons) { + if (!Array.isArray(object.buttons)) + throw TypeError(".proto.FourRowTemplate.buttons: array expected"); + message.buttons = []; + for (var i = 0; i < object.buttons.length; ++i) { + if (typeof object.buttons[i] !== "object") + throw TypeError(".proto.FourRowTemplate.buttons: object expected"); + message.buttons[i] = $root.proto.TemplateButton.fromObject(object.buttons[i]); } } + if (object.documentMessage != null) { + if (typeof object.documentMessage !== "object") + throw TypeError(".proto.FourRowTemplate.documentMessage: object expected"); + message.documentMessage = $root.proto.DocumentMessage.fromObject(object.documentMessage); + } + if (object.highlyStructuredMessage != null) { + if (typeof object.highlyStructuredMessage !== "object") + throw TypeError(".proto.FourRowTemplate.highlyStructuredMessage: object expected"); + message.highlyStructuredMessage = $root.proto.HighlyStructuredMessage.fromObject(object.highlyStructuredMessage); + } + if (object.imageMessage != null) { + if (typeof object.imageMessage !== "object") + throw TypeError(".proto.FourRowTemplate.imageMessage: object expected"); + message.imageMessage = $root.proto.ImageMessage.fromObject(object.imageMessage); + } + if (object.videoMessage != null) { + if (typeof object.videoMessage !== "object") + throw TypeError(".proto.FourRowTemplate.videoMessage: object expected"); + message.videoMessage = $root.proto.VideoMessage.fromObject(object.videoMessage); + } + if (object.locationMessage != null) { + if (typeof object.locationMessage !== "object") + throw TypeError(".proto.FourRowTemplate.locationMessage: object expected"); + message.locationMessage = $root.proto.LocationMessage.fromObject(object.locationMessage); + } return message; }; /** - * Creates a plain object from a SyncActionMessageRange message. Also converts values to other types if specified. + * Creates a plain object from a FourRowTemplate message. Also converts values to other types if specified. * @function toObject - * @memberof proto.SyncActionMessageRange + * @memberof proto.FourRowTemplate * @static - * @param {proto.SyncActionMessageRange} message SyncActionMessageRange + * @param {proto.FourRowTemplate} message FourRowTemplate * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SyncActionMessageRange.toObject = function toObject(message, options) { + FourRowTemplate.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) - object.messages = []; + object.buttons = []; if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.lastMessageTimestamp = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.lastMessageTimestamp = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.lastSystemMessageTimestamp = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.lastSystemMessageTimestamp = options.longs === String ? "0" : 0; + object.content = null; + object.footer = null; } - if (message.lastMessageTimestamp != null && message.hasOwnProperty("lastMessageTimestamp")) - if (typeof message.lastMessageTimestamp === "number") - object.lastMessageTimestamp = options.longs === String ? String(message.lastMessageTimestamp) : message.lastMessageTimestamp; - else - object.lastMessageTimestamp = options.longs === String ? $util.Long.prototype.toString.call(message.lastMessageTimestamp) : options.longs === Number ? new $util.LongBits(message.lastMessageTimestamp.low >>> 0, message.lastMessageTimestamp.high >>> 0).toNumber() : message.lastMessageTimestamp; - if (message.lastSystemMessageTimestamp != null && message.hasOwnProperty("lastSystemMessageTimestamp")) - if (typeof message.lastSystemMessageTimestamp === "number") - object.lastSystemMessageTimestamp = options.longs === String ? String(message.lastSystemMessageTimestamp) : message.lastSystemMessageTimestamp; - else - object.lastSystemMessageTimestamp = options.longs === String ? $util.Long.prototype.toString.call(message.lastSystemMessageTimestamp) : options.longs === Number ? new $util.LongBits(message.lastSystemMessageTimestamp.low >>> 0, message.lastSystemMessageTimestamp.high >>> 0).toNumber() : message.lastSystemMessageTimestamp; - if (message.messages && message.messages.length) { - object.messages = []; - for (var j = 0; j < message.messages.length; ++j) - object.messages[j] = $root.proto.SyncActionMessage.toObject(message.messages[j], options); + if (message.documentMessage != null && message.hasOwnProperty("documentMessage")) { + object.documentMessage = $root.proto.DocumentMessage.toObject(message.documentMessage, options); + if (options.oneofs) + object.title = "documentMessage"; + } + if (message.highlyStructuredMessage != null && message.hasOwnProperty("highlyStructuredMessage")) { + object.highlyStructuredMessage = $root.proto.HighlyStructuredMessage.toObject(message.highlyStructuredMessage, options); + if (options.oneofs) + object.title = "highlyStructuredMessage"; + } + if (message.imageMessage != null && message.hasOwnProperty("imageMessage")) { + object.imageMessage = $root.proto.ImageMessage.toObject(message.imageMessage, options); + if (options.oneofs) + object.title = "imageMessage"; + } + if (message.videoMessage != null && message.hasOwnProperty("videoMessage")) { + object.videoMessage = $root.proto.VideoMessage.toObject(message.videoMessage, options); + if (options.oneofs) + object.title = "videoMessage"; + } + if (message.locationMessage != null && message.hasOwnProperty("locationMessage")) { + object.locationMessage = $root.proto.LocationMessage.toObject(message.locationMessage, options); + if (options.oneofs) + object.title = "locationMessage"; + } + if (message.content != null && message.hasOwnProperty("content")) + object.content = $root.proto.HighlyStructuredMessage.toObject(message.content, options); + if (message.footer != null && message.hasOwnProperty("footer")) + object.footer = $root.proto.HighlyStructuredMessage.toObject(message.footer, options); + if (message.buttons && message.buttons.length) { + object.buttons = []; + for (var j = 0; j < message.buttons.length; ++j) + object.buttons[j] = $root.proto.TemplateButton.toObject(message.buttons[j], options); } return object; }; /** - * Converts this SyncActionMessageRange to JSON. + * Converts this FourRowTemplate to JSON. * @function toJSON - * @memberof proto.SyncActionMessageRange + * @memberof proto.FourRowTemplate * @instance * @returns {Object.} JSON object */ - SyncActionMessageRange.prototype.toJSON = function toJSON() { + FourRowTemplate.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return SyncActionMessageRange; + return FourRowTemplate; })(); - proto.SyncActionMessage = (function() { + proto.FutureProofMessage = (function() { /** - * Properties of a SyncActionMessage. + * Properties of a FutureProofMessage. * @memberof proto - * @interface ISyncActionMessage - * @property {proto.IMessageKey|null} [key] SyncActionMessage key - * @property {number|Long|null} [timestamp] SyncActionMessage timestamp + * @interface IFutureProofMessage + * @property {proto.IMessage|null} [message] FutureProofMessage message */ /** - * Constructs a new SyncActionMessage. + * Constructs a new FutureProofMessage. * @memberof proto - * @classdesc Represents a SyncActionMessage. - * @implements ISyncActionMessage + * @classdesc Represents a FutureProofMessage. + * @implements IFutureProofMessage * @constructor - * @param {proto.ISyncActionMessage=} [properties] Properties to set + * @param {proto.IFutureProofMessage=} [properties] Properties to set */ - function SyncActionMessage(properties) { + function FutureProofMessage(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -11765,88 +12127,75 @@ $root.proto = (function() { } /** - * SyncActionMessage key. - * @member {proto.IMessageKey|null|undefined} key - * @memberof proto.SyncActionMessage - * @instance - */ - SyncActionMessage.prototype.key = null; - - /** - * SyncActionMessage timestamp. - * @member {number|Long} timestamp - * @memberof proto.SyncActionMessage + * FutureProofMessage message. + * @member {proto.IMessage|null|undefined} message + * @memberof proto.FutureProofMessage * @instance */ - SyncActionMessage.prototype.timestamp = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + FutureProofMessage.prototype.message = null; /** - * Creates a new SyncActionMessage instance using the specified properties. + * Creates a new FutureProofMessage instance using the specified properties. * @function create - * @memberof proto.SyncActionMessage + * @memberof proto.FutureProofMessage * @static - * @param {proto.ISyncActionMessage=} [properties] Properties to set - * @returns {proto.SyncActionMessage} SyncActionMessage instance + * @param {proto.IFutureProofMessage=} [properties] Properties to set + * @returns {proto.FutureProofMessage} FutureProofMessage instance */ - SyncActionMessage.create = function create(properties) { - return new SyncActionMessage(properties); + FutureProofMessage.create = function create(properties) { + return new FutureProofMessage(properties); }; /** - * Encodes the specified SyncActionMessage message. Does not implicitly {@link proto.SyncActionMessage.verify|verify} messages. + * Encodes the specified FutureProofMessage message. Does not implicitly {@link proto.FutureProofMessage.verify|verify} messages. * @function encode - * @memberof proto.SyncActionMessage + * @memberof proto.FutureProofMessage * @static - * @param {proto.ISyncActionMessage} message SyncActionMessage message or plain object to encode + * @param {proto.IFutureProofMessage} message FutureProofMessage message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SyncActionMessage.encode = function encode(message, writer) { + FutureProofMessage.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.key != null && Object.hasOwnProperty.call(message, "key")) - $root.proto.MessageKey.encode(message.key, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.timestamp != null && Object.hasOwnProperty.call(message, "timestamp")) - writer.uint32(/* id 2, wireType 0 =*/16).int64(message.timestamp); + if (message.message != null && Object.hasOwnProperty.call(message, "message")) + $root.proto.Message.encode(message.message, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; /** - * Encodes the specified SyncActionMessage message, length delimited. Does not implicitly {@link proto.SyncActionMessage.verify|verify} messages. + * Encodes the specified FutureProofMessage message, length delimited. Does not implicitly {@link proto.FutureProofMessage.verify|verify} messages. * @function encodeDelimited - * @memberof proto.SyncActionMessage + * @memberof proto.FutureProofMessage * @static - * @param {proto.ISyncActionMessage} message SyncActionMessage message or plain object to encode + * @param {proto.IFutureProofMessage} message FutureProofMessage message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SyncActionMessage.encodeDelimited = function encodeDelimited(message, writer) { + FutureProofMessage.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a SyncActionMessage message from the specified reader or buffer. + * Decodes a FutureProofMessage message from the specified reader or buffer. * @function decode - * @memberof proto.SyncActionMessage + * @memberof proto.FutureProofMessage * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {proto.SyncActionMessage} SyncActionMessage + * @returns {proto.FutureProofMessage} FutureProofMessage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SyncActionMessage.decode = function decode(reader, length) { + FutureProofMessage.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.SyncActionMessage(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.FutureProofMessage(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.key = $root.proto.MessageKey.decode(reader, reader.uint32()); - break; - case 2: - message.timestamp = reader.int64(); + message.message = $root.proto.Message.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -11857,135 +12206,119 @@ $root.proto = (function() { }; /** - * Decodes a SyncActionMessage message from the specified reader or buffer, length delimited. + * Decodes a FutureProofMessage message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof proto.SyncActionMessage + * @memberof proto.FutureProofMessage * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.SyncActionMessage} SyncActionMessage + * @returns {proto.FutureProofMessage} FutureProofMessage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SyncActionMessage.decodeDelimited = function decodeDelimited(reader) { + FutureProofMessage.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a SyncActionMessage message. + * Verifies a FutureProofMessage message. * @function verify - * @memberof proto.SyncActionMessage + * @memberof proto.FutureProofMessage * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - SyncActionMessage.verify = function verify(message) { + FutureProofMessage.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.key != null && message.hasOwnProperty("key")) { - var error = $root.proto.MessageKey.verify(message.key); + if (message.message != null && message.hasOwnProperty("message")) { + var error = $root.proto.Message.verify(message.message); if (error) - return "key." + error; + return "message." + error; } - if (message.timestamp != null && message.hasOwnProperty("timestamp")) - if (!$util.isInteger(message.timestamp) && !(message.timestamp && $util.isInteger(message.timestamp.low) && $util.isInteger(message.timestamp.high))) - return "timestamp: integer|Long expected"; return null; }; /** - * Creates a SyncActionMessage message from a plain object. Also converts values to their respective internal types. + * Creates a FutureProofMessage message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof proto.SyncActionMessage + * @memberof proto.FutureProofMessage * @static * @param {Object.} object Plain object - * @returns {proto.SyncActionMessage} SyncActionMessage + * @returns {proto.FutureProofMessage} FutureProofMessage */ - SyncActionMessage.fromObject = function fromObject(object) { - if (object instanceof $root.proto.SyncActionMessage) + FutureProofMessage.fromObject = function fromObject(object) { + if (object instanceof $root.proto.FutureProofMessage) return object; - var message = new $root.proto.SyncActionMessage(); - if (object.key != null) { - if (typeof object.key !== "object") - throw TypeError(".proto.SyncActionMessage.key: object expected"); - message.key = $root.proto.MessageKey.fromObject(object.key); + var message = new $root.proto.FutureProofMessage(); + if (object.message != null) { + if (typeof object.message !== "object") + throw TypeError(".proto.FutureProofMessage.message: object expected"); + message.message = $root.proto.Message.fromObject(object.message); } - if (object.timestamp != null) - if ($util.Long) - (message.timestamp = $util.Long.fromValue(object.timestamp)).unsigned = false; - else if (typeof object.timestamp === "string") - message.timestamp = parseInt(object.timestamp, 10); - else if (typeof object.timestamp === "number") - message.timestamp = object.timestamp; - else if (typeof object.timestamp === "object") - message.timestamp = new $util.LongBits(object.timestamp.low >>> 0, object.timestamp.high >>> 0).toNumber(); return message; }; /** - * Creates a plain object from a SyncActionMessage message. Also converts values to other types if specified. + * Creates a plain object from a FutureProofMessage message. Also converts values to other types if specified. * @function toObject - * @memberof proto.SyncActionMessage + * @memberof proto.FutureProofMessage * @static - * @param {proto.SyncActionMessage} message SyncActionMessage + * @param {proto.FutureProofMessage} message FutureProofMessage * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SyncActionMessage.toObject = function toObject(message, options) { + FutureProofMessage.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.key = null; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.timestamp = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.timestamp = options.longs === String ? "0" : 0; - } - if (message.key != null && message.hasOwnProperty("key")) - object.key = $root.proto.MessageKey.toObject(message.key, options); - if (message.timestamp != null && message.hasOwnProperty("timestamp")) - if (typeof message.timestamp === "number") - object.timestamp = options.longs === String ? String(message.timestamp) : message.timestamp; - else - object.timestamp = options.longs === String ? $util.Long.prototype.toString.call(message.timestamp) : options.longs === Number ? new $util.LongBits(message.timestamp.low >>> 0, message.timestamp.high >>> 0).toNumber() : message.timestamp; + if (options.defaults) + object.message = null; + if (message.message != null && message.hasOwnProperty("message")) + object.message = $root.proto.Message.toObject(message.message, options); return object; }; /** - * Converts this SyncActionMessage to JSON. + * Converts this FutureProofMessage to JSON. * @function toJSON - * @memberof proto.SyncActionMessage + * @memberof proto.FutureProofMessage * @instance * @returns {Object.} JSON object */ - SyncActionMessage.prototype.toJSON = function toJSON() { + FutureProofMessage.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return SyncActionMessage; + return FutureProofMessage; })(); - proto.KeyExpiration = (function() { + proto.GroupInviteMessage = (function() { /** - * Properties of a KeyExpiration. + * Properties of a GroupInviteMessage. * @memberof proto - * @interface IKeyExpiration - * @property {number|null} [expiredKeyEpoch] KeyExpiration expiredKeyEpoch + * @interface IGroupInviteMessage + * @property {string|null} [groupJid] GroupInviteMessage groupJid + * @property {string|null} [inviteCode] GroupInviteMessage inviteCode + * @property {number|Long|null} [inviteExpiration] GroupInviteMessage inviteExpiration + * @property {string|null} [groupName] GroupInviteMessage groupName + * @property {Uint8Array|null} [jpegThumbnail] GroupInviteMessage jpegThumbnail + * @property {string|null} [caption] GroupInviteMessage caption + * @property {proto.IContextInfo|null} [contextInfo] GroupInviteMessage contextInfo + * @property {proto.GroupInviteMessage.GroupInviteMessageGroupType|null} [groupType] GroupInviteMessage groupType */ /** - * Constructs a new KeyExpiration. + * Constructs a new GroupInviteMessage. * @memberof proto - * @classdesc Represents a KeyExpiration. - * @implements IKeyExpiration + * @classdesc Represents a GroupInviteMessage. + * @implements IGroupInviteMessage * @constructor - * @param {proto.IKeyExpiration=} [properties] Properties to set + * @param {proto.IGroupInviteMessage=} [properties] Properties to set */ - function KeyExpiration(properties) { + function GroupInviteMessage(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -11993,75 +12326,166 @@ $root.proto = (function() { } /** - * KeyExpiration expiredKeyEpoch. - * @member {number} expiredKeyEpoch - * @memberof proto.KeyExpiration + * GroupInviteMessage groupJid. + * @member {string} groupJid + * @memberof proto.GroupInviteMessage * @instance */ - KeyExpiration.prototype.expiredKeyEpoch = 0; + GroupInviteMessage.prototype.groupJid = ""; /** - * Creates a new KeyExpiration instance using the specified properties. + * GroupInviteMessage inviteCode. + * @member {string} inviteCode + * @memberof proto.GroupInviteMessage + * @instance + */ + GroupInviteMessage.prototype.inviteCode = ""; + + /** + * GroupInviteMessage inviteExpiration. + * @member {number|Long} inviteExpiration + * @memberof proto.GroupInviteMessage + * @instance + */ + GroupInviteMessage.prototype.inviteExpiration = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * GroupInviteMessage groupName. + * @member {string} groupName + * @memberof proto.GroupInviteMessage + * @instance + */ + GroupInviteMessage.prototype.groupName = ""; + + /** + * GroupInviteMessage jpegThumbnail. + * @member {Uint8Array} jpegThumbnail + * @memberof proto.GroupInviteMessage + * @instance + */ + GroupInviteMessage.prototype.jpegThumbnail = $util.newBuffer([]); + + /** + * GroupInviteMessage caption. + * @member {string} caption + * @memberof proto.GroupInviteMessage + * @instance + */ + GroupInviteMessage.prototype.caption = ""; + + /** + * GroupInviteMessage contextInfo. + * @member {proto.IContextInfo|null|undefined} contextInfo + * @memberof proto.GroupInviteMessage + * @instance + */ + GroupInviteMessage.prototype.contextInfo = null; + + /** + * GroupInviteMessage groupType. + * @member {proto.GroupInviteMessage.GroupInviteMessageGroupType} groupType + * @memberof proto.GroupInviteMessage + * @instance + */ + GroupInviteMessage.prototype.groupType = 0; + + /** + * Creates a new GroupInviteMessage instance using the specified properties. * @function create - * @memberof proto.KeyExpiration + * @memberof proto.GroupInviteMessage * @static - * @param {proto.IKeyExpiration=} [properties] Properties to set - * @returns {proto.KeyExpiration} KeyExpiration instance + * @param {proto.IGroupInviteMessage=} [properties] Properties to set + * @returns {proto.GroupInviteMessage} GroupInviteMessage instance */ - KeyExpiration.create = function create(properties) { - return new KeyExpiration(properties); + GroupInviteMessage.create = function create(properties) { + return new GroupInviteMessage(properties); }; /** - * Encodes the specified KeyExpiration message. Does not implicitly {@link proto.KeyExpiration.verify|verify} messages. + * Encodes the specified GroupInviteMessage message. Does not implicitly {@link proto.GroupInviteMessage.verify|verify} messages. * @function encode - * @memberof proto.KeyExpiration + * @memberof proto.GroupInviteMessage * @static - * @param {proto.IKeyExpiration} message KeyExpiration message or plain object to encode + * @param {proto.IGroupInviteMessage} message GroupInviteMessage message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - KeyExpiration.encode = function encode(message, writer) { + GroupInviteMessage.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.expiredKeyEpoch != null && Object.hasOwnProperty.call(message, "expiredKeyEpoch")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.expiredKeyEpoch); - return writer; - }; - - /** - * Encodes the specified KeyExpiration message, length delimited. Does not implicitly {@link proto.KeyExpiration.verify|verify} messages. + if (message.groupJid != null && Object.hasOwnProperty.call(message, "groupJid")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.groupJid); + if (message.inviteCode != null && Object.hasOwnProperty.call(message, "inviteCode")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.inviteCode); + if (message.inviteExpiration != null && Object.hasOwnProperty.call(message, "inviteExpiration")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.inviteExpiration); + if (message.groupName != null && Object.hasOwnProperty.call(message, "groupName")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.groupName); + if (message.jpegThumbnail != null && Object.hasOwnProperty.call(message, "jpegThumbnail")) + writer.uint32(/* id 5, wireType 2 =*/42).bytes(message.jpegThumbnail); + if (message.caption != null && Object.hasOwnProperty.call(message, "caption")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.caption); + if (message.contextInfo != null && Object.hasOwnProperty.call(message, "contextInfo")) + $root.proto.ContextInfo.encode(message.contextInfo, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.groupType != null && Object.hasOwnProperty.call(message, "groupType")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.groupType); + return writer; + }; + + /** + * Encodes the specified GroupInviteMessage message, length delimited. Does not implicitly {@link proto.GroupInviteMessage.verify|verify} messages. * @function encodeDelimited - * @memberof proto.KeyExpiration + * @memberof proto.GroupInviteMessage * @static - * @param {proto.IKeyExpiration} message KeyExpiration message or plain object to encode + * @param {proto.IGroupInviteMessage} message GroupInviteMessage message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - KeyExpiration.encodeDelimited = function encodeDelimited(message, writer) { + GroupInviteMessage.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a KeyExpiration message from the specified reader or buffer. + * Decodes a GroupInviteMessage message from the specified reader or buffer. * @function decode - * @memberof proto.KeyExpiration + * @memberof proto.GroupInviteMessage * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {proto.KeyExpiration} KeyExpiration + * @returns {proto.GroupInviteMessage} GroupInviteMessage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - KeyExpiration.decode = function decode(reader, length) { + GroupInviteMessage.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.KeyExpiration(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.GroupInviteMessage(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.expiredKeyEpoch = reader.int32(); + message.groupJid = reader.string(); + break; + case 2: + message.inviteCode = reader.string(); + break; + case 3: + message.inviteExpiration = reader.int64(); + break; + case 4: + message.groupName = reader.string(); + break; + case 5: + message.jpegThumbnail = reader.bytes(); + break; + case 6: + message.caption = reader.string(); + break; + case 7: + message.contextInfo = $root.proto.ContextInfo.decode(reader, reader.uint32()); + break; + case 8: + message.groupType = reader.int32(); break; default: reader.skipType(tag & 7); @@ -12072,108 +12496,225 @@ $root.proto = (function() { }; /** - * Decodes a KeyExpiration message from the specified reader or buffer, length delimited. + * Decodes a GroupInviteMessage message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof proto.KeyExpiration + * @memberof proto.GroupInviteMessage * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.KeyExpiration} KeyExpiration + * @returns {proto.GroupInviteMessage} GroupInviteMessage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - KeyExpiration.decodeDelimited = function decodeDelimited(reader) { + GroupInviteMessage.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a KeyExpiration message. + * Verifies a GroupInviteMessage message. * @function verify - * @memberof proto.KeyExpiration + * @memberof proto.GroupInviteMessage * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - KeyExpiration.verify = function verify(message) { + GroupInviteMessage.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.expiredKeyEpoch != null && message.hasOwnProperty("expiredKeyEpoch")) - if (!$util.isInteger(message.expiredKeyEpoch)) - return "expiredKeyEpoch: integer expected"; + if (message.groupJid != null && message.hasOwnProperty("groupJid")) + if (!$util.isString(message.groupJid)) + return "groupJid: string expected"; + if (message.inviteCode != null && message.hasOwnProperty("inviteCode")) + if (!$util.isString(message.inviteCode)) + return "inviteCode: string expected"; + if (message.inviteExpiration != null && message.hasOwnProperty("inviteExpiration")) + if (!$util.isInteger(message.inviteExpiration) && !(message.inviteExpiration && $util.isInteger(message.inviteExpiration.low) && $util.isInteger(message.inviteExpiration.high))) + return "inviteExpiration: integer|Long expected"; + if (message.groupName != null && message.hasOwnProperty("groupName")) + if (!$util.isString(message.groupName)) + return "groupName: string expected"; + if (message.jpegThumbnail != null && message.hasOwnProperty("jpegThumbnail")) + if (!(message.jpegThumbnail && typeof message.jpegThumbnail.length === "number" || $util.isString(message.jpegThumbnail))) + return "jpegThumbnail: buffer expected"; + if (message.caption != null && message.hasOwnProperty("caption")) + if (!$util.isString(message.caption)) + return "caption: string expected"; + if (message.contextInfo != null && message.hasOwnProperty("contextInfo")) { + var error = $root.proto.ContextInfo.verify(message.contextInfo); + if (error) + return "contextInfo." + error; + } + if (message.groupType != null && message.hasOwnProperty("groupType")) + switch (message.groupType) { + default: + return "groupType: enum value expected"; + case 0: + case 1: + break; + } return null; }; /** - * Creates a KeyExpiration message from a plain object. Also converts values to their respective internal types. + * Creates a GroupInviteMessage message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof proto.KeyExpiration + * @memberof proto.GroupInviteMessage * @static * @param {Object.} object Plain object - * @returns {proto.KeyExpiration} KeyExpiration + * @returns {proto.GroupInviteMessage} GroupInviteMessage */ - KeyExpiration.fromObject = function fromObject(object) { - if (object instanceof $root.proto.KeyExpiration) + GroupInviteMessage.fromObject = function fromObject(object) { + if (object instanceof $root.proto.GroupInviteMessage) return object; - var message = new $root.proto.KeyExpiration(); - if (object.expiredKeyEpoch != null) - message.expiredKeyEpoch = object.expiredKeyEpoch | 0; + var message = new $root.proto.GroupInviteMessage(); + if (object.groupJid != null) + message.groupJid = String(object.groupJid); + if (object.inviteCode != null) + message.inviteCode = String(object.inviteCode); + if (object.inviteExpiration != null) + if ($util.Long) + (message.inviteExpiration = $util.Long.fromValue(object.inviteExpiration)).unsigned = false; + else if (typeof object.inviteExpiration === "string") + message.inviteExpiration = parseInt(object.inviteExpiration, 10); + else if (typeof object.inviteExpiration === "number") + message.inviteExpiration = object.inviteExpiration; + else if (typeof object.inviteExpiration === "object") + message.inviteExpiration = new $util.LongBits(object.inviteExpiration.low >>> 0, object.inviteExpiration.high >>> 0).toNumber(); + if (object.groupName != null) + message.groupName = String(object.groupName); + if (object.jpegThumbnail != null) + if (typeof object.jpegThumbnail === "string") + $util.base64.decode(object.jpegThumbnail, message.jpegThumbnail = $util.newBuffer($util.base64.length(object.jpegThumbnail)), 0); + else if (object.jpegThumbnail.length) + message.jpegThumbnail = object.jpegThumbnail; + if (object.caption != null) + message.caption = String(object.caption); + if (object.contextInfo != null) { + if (typeof object.contextInfo !== "object") + throw TypeError(".proto.GroupInviteMessage.contextInfo: object expected"); + message.contextInfo = $root.proto.ContextInfo.fromObject(object.contextInfo); + } + switch (object.groupType) { + case "DEFAULT": + case 0: + message.groupType = 0; + break; + case "PARENT": + case 1: + message.groupType = 1; + break; + } return message; }; /** - * Creates a plain object from a KeyExpiration message. Also converts values to other types if specified. + * Creates a plain object from a GroupInviteMessage message. Also converts values to other types if specified. * @function toObject - * @memberof proto.KeyExpiration + * @memberof proto.GroupInviteMessage * @static - * @param {proto.KeyExpiration} message KeyExpiration + * @param {proto.GroupInviteMessage} message GroupInviteMessage * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - KeyExpiration.toObject = function toObject(message, options) { + GroupInviteMessage.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) - object.expiredKeyEpoch = 0; - if (message.expiredKeyEpoch != null && message.hasOwnProperty("expiredKeyEpoch")) - object.expiredKeyEpoch = message.expiredKeyEpoch; + if (options.defaults) { + object.groupJid = ""; + object.inviteCode = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.inviteExpiration = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.inviteExpiration = options.longs === String ? "0" : 0; + object.groupName = ""; + if (options.bytes === String) + object.jpegThumbnail = ""; + else { + object.jpegThumbnail = []; + if (options.bytes !== Array) + object.jpegThumbnail = $util.newBuffer(object.jpegThumbnail); + } + object.caption = ""; + object.contextInfo = null; + object.groupType = options.enums === String ? "DEFAULT" : 0; + } + if (message.groupJid != null && message.hasOwnProperty("groupJid")) + object.groupJid = message.groupJid; + if (message.inviteCode != null && message.hasOwnProperty("inviteCode")) + object.inviteCode = message.inviteCode; + if (message.inviteExpiration != null && message.hasOwnProperty("inviteExpiration")) + if (typeof message.inviteExpiration === "number") + object.inviteExpiration = options.longs === String ? String(message.inviteExpiration) : message.inviteExpiration; + else + object.inviteExpiration = options.longs === String ? $util.Long.prototype.toString.call(message.inviteExpiration) : options.longs === Number ? new $util.LongBits(message.inviteExpiration.low >>> 0, message.inviteExpiration.high >>> 0).toNumber() : message.inviteExpiration; + if (message.groupName != null && message.hasOwnProperty("groupName")) + object.groupName = message.groupName; + if (message.jpegThumbnail != null && message.hasOwnProperty("jpegThumbnail")) + object.jpegThumbnail = options.bytes === String ? $util.base64.encode(message.jpegThumbnail, 0, message.jpegThumbnail.length) : options.bytes === Array ? Array.prototype.slice.call(message.jpegThumbnail) : message.jpegThumbnail; + if (message.caption != null && message.hasOwnProperty("caption")) + object.caption = message.caption; + if (message.contextInfo != null && message.hasOwnProperty("contextInfo")) + object.contextInfo = $root.proto.ContextInfo.toObject(message.contextInfo, options); + if (message.groupType != null && message.hasOwnProperty("groupType")) + object.groupType = options.enums === String ? $root.proto.GroupInviteMessage.GroupInviteMessageGroupType[message.groupType] : message.groupType; return object; }; /** - * Converts this KeyExpiration to JSON. + * Converts this GroupInviteMessage to JSON. * @function toJSON - * @memberof proto.KeyExpiration + * @memberof proto.GroupInviteMessage * @instance * @returns {Object.} JSON object */ - KeyExpiration.prototype.toJSON = function toJSON() { + GroupInviteMessage.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return KeyExpiration; + /** + * GroupInviteMessageGroupType enum. + * @name proto.GroupInviteMessage.GroupInviteMessageGroupType + * @enum {number} + * @property {number} DEFAULT=0 DEFAULT value + * @property {number} PARENT=1 PARENT value + */ + GroupInviteMessage.GroupInviteMessageGroupType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DEFAULT"] = 0; + values[valuesById[1] = "PARENT"] = 1; + return values; + })(); + + return GroupInviteMessage; })(); - proto.PrimaryFeature = (function() { + proto.Header = (function() { /** - * Properties of a PrimaryFeature. + * Properties of a Header. * @memberof proto - * @interface IPrimaryFeature - * @property {Array.|null} [flags] PrimaryFeature flags + * @interface IHeader + * @property {string|null} [title] Header title + * @property {string|null} [subtitle] Header subtitle + * @property {boolean|null} [hasMediaAttachment] Header hasMediaAttachment + * @property {proto.IDocumentMessage|null} [documentMessage] Header documentMessage + * @property {proto.IImageMessage|null} [imageMessage] Header imageMessage + * @property {Uint8Array|null} [jpegThumbnail] Header jpegThumbnail + * @property {proto.IVideoMessage|null} [videoMessage] Header videoMessage */ /** - * Constructs a new PrimaryFeature. + * Constructs a new Header. * @memberof proto - * @classdesc Represents a PrimaryFeature. - * @implements IPrimaryFeature + * @classdesc Represents a Header. + * @implements IHeader * @constructor - * @param {proto.IPrimaryFeature=} [properties] Properties to set + * @param {proto.IHeader=} [properties] Properties to set */ - function PrimaryFeature(properties) { - this.flags = []; + function Header(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -12181,78 +12722,167 @@ $root.proto = (function() { } /** - * PrimaryFeature flags. - * @member {Array.} flags - * @memberof proto.PrimaryFeature + * Header title. + * @member {string} title + * @memberof proto.Header * @instance */ - PrimaryFeature.prototype.flags = $util.emptyArray; + Header.prototype.title = ""; /** - * Creates a new PrimaryFeature instance using the specified properties. + * Header subtitle. + * @member {string} subtitle + * @memberof proto.Header + * @instance + */ + Header.prototype.subtitle = ""; + + /** + * Header hasMediaAttachment. + * @member {boolean} hasMediaAttachment + * @memberof proto.Header + * @instance + */ + Header.prototype.hasMediaAttachment = false; + + /** + * Header documentMessage. + * @member {proto.IDocumentMessage|null|undefined} documentMessage + * @memberof proto.Header + * @instance + */ + Header.prototype.documentMessage = null; + + /** + * Header imageMessage. + * @member {proto.IImageMessage|null|undefined} imageMessage + * @memberof proto.Header + * @instance + */ + Header.prototype.imageMessage = null; + + /** + * Header jpegThumbnail. + * @member {Uint8Array|null|undefined} jpegThumbnail + * @memberof proto.Header + * @instance + */ + Header.prototype.jpegThumbnail = null; + + /** + * Header videoMessage. + * @member {proto.IVideoMessage|null|undefined} videoMessage + * @memberof proto.Header + * @instance + */ + Header.prototype.videoMessage = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Header media. + * @member {"documentMessage"|"imageMessage"|"jpegThumbnail"|"videoMessage"|undefined} media + * @memberof proto.Header + * @instance + */ + Object.defineProperty(Header.prototype, "media", { + get: $util.oneOfGetter($oneOfFields = ["documentMessage", "imageMessage", "jpegThumbnail", "videoMessage"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Header instance using the specified properties. * @function create - * @memberof proto.PrimaryFeature + * @memberof proto.Header * @static - * @param {proto.IPrimaryFeature=} [properties] Properties to set - * @returns {proto.PrimaryFeature} PrimaryFeature instance + * @param {proto.IHeader=} [properties] Properties to set + * @returns {proto.Header} Header instance */ - PrimaryFeature.create = function create(properties) { - return new PrimaryFeature(properties); + Header.create = function create(properties) { + return new Header(properties); }; /** - * Encodes the specified PrimaryFeature message. Does not implicitly {@link proto.PrimaryFeature.verify|verify} messages. + * Encodes the specified Header message. Does not implicitly {@link proto.Header.verify|verify} messages. * @function encode - * @memberof proto.PrimaryFeature + * @memberof proto.Header * @static - * @param {proto.IPrimaryFeature} message PrimaryFeature message or plain object to encode + * @param {proto.IHeader} message Header message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PrimaryFeature.encode = function encode(message, writer) { + Header.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.flags != null && message.flags.length) - for (var i = 0; i < message.flags.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.flags[i]); + if (message.title != null && Object.hasOwnProperty.call(message, "title")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.title); + if (message.subtitle != null && Object.hasOwnProperty.call(message, "subtitle")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.subtitle); + if (message.documentMessage != null && Object.hasOwnProperty.call(message, "documentMessage")) + $root.proto.DocumentMessage.encode(message.documentMessage, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.imageMessage != null && Object.hasOwnProperty.call(message, "imageMessage")) + $root.proto.ImageMessage.encode(message.imageMessage, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.hasMediaAttachment != null && Object.hasOwnProperty.call(message, "hasMediaAttachment")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.hasMediaAttachment); + if (message.jpegThumbnail != null && Object.hasOwnProperty.call(message, "jpegThumbnail")) + writer.uint32(/* id 6, wireType 2 =*/50).bytes(message.jpegThumbnail); + if (message.videoMessage != null && Object.hasOwnProperty.call(message, "videoMessage")) + $root.proto.VideoMessage.encode(message.videoMessage, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); return writer; }; /** - * Encodes the specified PrimaryFeature message, length delimited. Does not implicitly {@link proto.PrimaryFeature.verify|verify} messages. + * Encodes the specified Header message, length delimited. Does not implicitly {@link proto.Header.verify|verify} messages. * @function encodeDelimited - * @memberof proto.PrimaryFeature + * @memberof proto.Header * @static - * @param {proto.IPrimaryFeature} message PrimaryFeature message or plain object to encode + * @param {proto.IHeader} message Header message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PrimaryFeature.encodeDelimited = function encodeDelimited(message, writer) { + Header.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a PrimaryFeature message from the specified reader or buffer. + * Decodes a Header message from the specified reader or buffer. * @function decode - * @memberof proto.PrimaryFeature + * @memberof proto.Header * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {proto.PrimaryFeature} PrimaryFeature + * @returns {proto.Header} Header * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - PrimaryFeature.decode = function decode(reader, length) { + Header.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.PrimaryFeature(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.Header(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - if (!(message.flags && message.flags.length)) - message.flags = []; - message.flags.push(reader.string()); + message.title = reader.string(); + break; + case 2: + message.subtitle = reader.string(); + break; + case 5: + message.hasMediaAttachment = reader.bool(); + break; + case 3: + message.documentMessage = $root.proto.DocumentMessage.decode(reader, reader.uint32()); + break; + case 4: + message.imageMessage = $root.proto.ImageMessage.decode(reader, reader.uint32()); + break; + case 6: + message.jpegThumbnail = reader.bytes(); + break; + case 7: + message.videoMessage = $root.proto.VideoMessage.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -12263,119 +12893,210 @@ $root.proto = (function() { }; /** - * Decodes a PrimaryFeature message from the specified reader or buffer, length delimited. + * Decodes a Header message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof proto.PrimaryFeature + * @memberof proto.Header * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.PrimaryFeature} PrimaryFeature + * @returns {proto.Header} Header * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - PrimaryFeature.decodeDelimited = function decodeDelimited(reader) { + Header.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a PrimaryFeature message. + * Verifies a Header message. * @function verify - * @memberof proto.PrimaryFeature + * @memberof proto.Header * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - PrimaryFeature.verify = function verify(message) { + Header.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.flags != null && message.hasOwnProperty("flags")) { - if (!Array.isArray(message.flags)) - return "flags: array expected"; - for (var i = 0; i < message.flags.length; ++i) - if (!$util.isString(message.flags[i])) - return "flags: string[] expected"; + var properties = {}; + if (message.title != null && message.hasOwnProperty("title")) + if (!$util.isString(message.title)) + return "title: string expected"; + if (message.subtitle != null && message.hasOwnProperty("subtitle")) + if (!$util.isString(message.subtitle)) + return "subtitle: string expected"; + if (message.hasMediaAttachment != null && message.hasOwnProperty("hasMediaAttachment")) + if (typeof message.hasMediaAttachment !== "boolean") + return "hasMediaAttachment: boolean expected"; + if (message.documentMessage != null && message.hasOwnProperty("documentMessage")) { + properties.media = 1; + { + var error = $root.proto.DocumentMessage.verify(message.documentMessage); + if (error) + return "documentMessage." + error; + } + } + if (message.imageMessage != null && message.hasOwnProperty("imageMessage")) { + if (properties.media === 1) + return "media: multiple values"; + properties.media = 1; + { + var error = $root.proto.ImageMessage.verify(message.imageMessage); + if (error) + return "imageMessage." + error; + } + } + if (message.jpegThumbnail != null && message.hasOwnProperty("jpegThumbnail")) { + if (properties.media === 1) + return "media: multiple values"; + properties.media = 1; + if (!(message.jpegThumbnail && typeof message.jpegThumbnail.length === "number" || $util.isString(message.jpegThumbnail))) + return "jpegThumbnail: buffer expected"; + } + if (message.videoMessage != null && message.hasOwnProperty("videoMessage")) { + if (properties.media === 1) + return "media: multiple values"; + properties.media = 1; + { + var error = $root.proto.VideoMessage.verify(message.videoMessage); + if (error) + return "videoMessage." + error; + } } return null; }; /** - * Creates a PrimaryFeature message from a plain object. Also converts values to their respective internal types. + * Creates a Header message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof proto.PrimaryFeature + * @memberof proto.Header * @static * @param {Object.} object Plain object - * @returns {proto.PrimaryFeature} PrimaryFeature + * @returns {proto.Header} Header */ - PrimaryFeature.fromObject = function fromObject(object) { - if (object instanceof $root.proto.PrimaryFeature) + Header.fromObject = function fromObject(object) { + if (object instanceof $root.proto.Header) return object; - var message = new $root.proto.PrimaryFeature(); - if (object.flags) { - if (!Array.isArray(object.flags)) - throw TypeError(".proto.PrimaryFeature.flags: array expected"); - message.flags = []; - for (var i = 0; i < object.flags.length; ++i) - message.flags[i] = String(object.flags[i]); + var message = new $root.proto.Header(); + if (object.title != null) + message.title = String(object.title); + if (object.subtitle != null) + message.subtitle = String(object.subtitle); + if (object.hasMediaAttachment != null) + message.hasMediaAttachment = Boolean(object.hasMediaAttachment); + if (object.documentMessage != null) { + if (typeof object.documentMessage !== "object") + throw TypeError(".proto.Header.documentMessage: object expected"); + message.documentMessage = $root.proto.DocumentMessage.fromObject(object.documentMessage); + } + if (object.imageMessage != null) { + if (typeof object.imageMessage !== "object") + throw TypeError(".proto.Header.imageMessage: object expected"); + message.imageMessage = $root.proto.ImageMessage.fromObject(object.imageMessage); + } + if (object.jpegThumbnail != null) + if (typeof object.jpegThumbnail === "string") + $util.base64.decode(object.jpegThumbnail, message.jpegThumbnail = $util.newBuffer($util.base64.length(object.jpegThumbnail)), 0); + else if (object.jpegThumbnail.length) + message.jpegThumbnail = object.jpegThumbnail; + if (object.videoMessage != null) { + if (typeof object.videoMessage !== "object") + throw TypeError(".proto.Header.videoMessage: object expected"); + message.videoMessage = $root.proto.VideoMessage.fromObject(object.videoMessage); } return message; }; /** - * Creates a plain object from a PrimaryFeature message. Also converts values to other types if specified. + * Creates a plain object from a Header message. Also converts values to other types if specified. * @function toObject - * @memberof proto.PrimaryFeature + * @memberof proto.Header * @static - * @param {proto.PrimaryFeature} message PrimaryFeature + * @param {proto.Header} message Header * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - PrimaryFeature.toObject = function toObject(message, options) { + Header.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.flags = []; - if (message.flags && message.flags.length) { - object.flags = []; - for (var j = 0; j < message.flags.length; ++j) - object.flags[j] = message.flags[j]; + if (options.defaults) { + object.title = ""; + object.subtitle = ""; + object.hasMediaAttachment = false; + } + if (message.title != null && message.hasOwnProperty("title")) + object.title = message.title; + if (message.subtitle != null && message.hasOwnProperty("subtitle")) + object.subtitle = message.subtitle; + if (message.documentMessage != null && message.hasOwnProperty("documentMessage")) { + object.documentMessage = $root.proto.DocumentMessage.toObject(message.documentMessage, options); + if (options.oneofs) + object.media = "documentMessage"; + } + if (message.imageMessage != null && message.hasOwnProperty("imageMessage")) { + object.imageMessage = $root.proto.ImageMessage.toObject(message.imageMessage, options); + if (options.oneofs) + object.media = "imageMessage"; + } + if (message.hasMediaAttachment != null && message.hasOwnProperty("hasMediaAttachment")) + object.hasMediaAttachment = message.hasMediaAttachment; + if (message.jpegThumbnail != null && message.hasOwnProperty("jpegThumbnail")) { + object.jpegThumbnail = options.bytes === String ? $util.base64.encode(message.jpegThumbnail, 0, message.jpegThumbnail.length) : options.bytes === Array ? Array.prototype.slice.call(message.jpegThumbnail) : message.jpegThumbnail; + if (options.oneofs) + object.media = "jpegThumbnail"; + } + if (message.videoMessage != null && message.hasOwnProperty("videoMessage")) { + object.videoMessage = $root.proto.VideoMessage.toObject(message.videoMessage, options); + if (options.oneofs) + object.media = "videoMessage"; } return object; }; /** - * Converts this PrimaryFeature to JSON. + * Converts this Header to JSON. * @function toJSON - * @memberof proto.PrimaryFeature + * @memberof proto.Header * @instance * @returns {Object.} JSON object */ - PrimaryFeature.prototype.toJSON = function toJSON() { + Header.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return PrimaryFeature; + return Header; })(); - proto.AndroidUnsupportedActions = (function() { + proto.HighlyStructuredMessage = (function() { /** - * Properties of an AndroidUnsupportedActions. + * Properties of a HighlyStructuredMessage. * @memberof proto - * @interface IAndroidUnsupportedActions - * @property {boolean|null} [allowed] AndroidUnsupportedActions allowed + * @interface IHighlyStructuredMessage + * @property {string|null} [namespace] HighlyStructuredMessage namespace + * @property {string|null} [elementName] HighlyStructuredMessage elementName + * @property {Array.|null} [params] HighlyStructuredMessage params + * @property {string|null} [fallbackLg] HighlyStructuredMessage fallbackLg + * @property {string|null} [fallbackLc] HighlyStructuredMessage fallbackLc + * @property {Array.|null} [localizableParams] HighlyStructuredMessage localizableParams + * @property {string|null} [deterministicLg] HighlyStructuredMessage deterministicLg + * @property {string|null} [deterministicLc] HighlyStructuredMessage deterministicLc + * @property {proto.ITemplateMessage|null} [hydratedHsm] HighlyStructuredMessage hydratedHsm */ /** - * Constructs a new AndroidUnsupportedActions. + * Constructs a new HighlyStructuredMessage. * @memberof proto - * @classdesc Represents an AndroidUnsupportedActions. - * @implements IAndroidUnsupportedActions + * @classdesc Represents a HighlyStructuredMessage. + * @implements IHighlyStructuredMessage * @constructor - * @param {proto.IAndroidUnsupportedActions=} [properties] Properties to set + * @param {proto.IHighlyStructuredMessage=} [properties] Properties to set */ - function AndroidUnsupportedActions(properties) { + function HighlyStructuredMessage(properties) { + this.params = []; + this.localizableParams = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -12383,75 +13104,185 @@ $root.proto = (function() { } /** - * AndroidUnsupportedActions allowed. - * @member {boolean} allowed - * @memberof proto.AndroidUnsupportedActions + * HighlyStructuredMessage namespace. + * @member {string} namespace + * @memberof proto.HighlyStructuredMessage * @instance */ - AndroidUnsupportedActions.prototype.allowed = false; + HighlyStructuredMessage.prototype.namespace = ""; /** - * Creates a new AndroidUnsupportedActions instance using the specified properties. + * HighlyStructuredMessage elementName. + * @member {string} elementName + * @memberof proto.HighlyStructuredMessage + * @instance + */ + HighlyStructuredMessage.prototype.elementName = ""; + + /** + * HighlyStructuredMessage params. + * @member {Array.} params + * @memberof proto.HighlyStructuredMessage + * @instance + */ + HighlyStructuredMessage.prototype.params = $util.emptyArray; + + /** + * HighlyStructuredMessage fallbackLg. + * @member {string} fallbackLg + * @memberof proto.HighlyStructuredMessage + * @instance + */ + HighlyStructuredMessage.prototype.fallbackLg = ""; + + /** + * HighlyStructuredMessage fallbackLc. + * @member {string} fallbackLc + * @memberof proto.HighlyStructuredMessage + * @instance + */ + HighlyStructuredMessage.prototype.fallbackLc = ""; + + /** + * HighlyStructuredMessage localizableParams. + * @member {Array.} localizableParams + * @memberof proto.HighlyStructuredMessage + * @instance + */ + HighlyStructuredMessage.prototype.localizableParams = $util.emptyArray; + + /** + * HighlyStructuredMessage deterministicLg. + * @member {string} deterministicLg + * @memberof proto.HighlyStructuredMessage + * @instance + */ + HighlyStructuredMessage.prototype.deterministicLg = ""; + + /** + * HighlyStructuredMessage deterministicLc. + * @member {string} deterministicLc + * @memberof proto.HighlyStructuredMessage + * @instance + */ + HighlyStructuredMessage.prototype.deterministicLc = ""; + + /** + * HighlyStructuredMessage hydratedHsm. + * @member {proto.ITemplateMessage|null|undefined} hydratedHsm + * @memberof proto.HighlyStructuredMessage + * @instance + */ + HighlyStructuredMessage.prototype.hydratedHsm = null; + + /** + * Creates a new HighlyStructuredMessage instance using the specified properties. * @function create - * @memberof proto.AndroidUnsupportedActions + * @memberof proto.HighlyStructuredMessage * @static - * @param {proto.IAndroidUnsupportedActions=} [properties] Properties to set - * @returns {proto.AndroidUnsupportedActions} AndroidUnsupportedActions instance + * @param {proto.IHighlyStructuredMessage=} [properties] Properties to set + * @returns {proto.HighlyStructuredMessage} HighlyStructuredMessage instance */ - AndroidUnsupportedActions.create = function create(properties) { - return new AndroidUnsupportedActions(properties); + HighlyStructuredMessage.create = function create(properties) { + return new HighlyStructuredMessage(properties); }; /** - * Encodes the specified AndroidUnsupportedActions message. Does not implicitly {@link proto.AndroidUnsupportedActions.verify|verify} messages. + * Encodes the specified HighlyStructuredMessage message. Does not implicitly {@link proto.HighlyStructuredMessage.verify|verify} messages. * @function encode - * @memberof proto.AndroidUnsupportedActions + * @memberof proto.HighlyStructuredMessage * @static - * @param {proto.IAndroidUnsupportedActions} message AndroidUnsupportedActions message or plain object to encode + * @param {proto.IHighlyStructuredMessage} message HighlyStructuredMessage message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AndroidUnsupportedActions.encode = function encode(message, writer) { + HighlyStructuredMessage.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.allowed != null && Object.hasOwnProperty.call(message, "allowed")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.allowed); + if (message.namespace != null && Object.hasOwnProperty.call(message, "namespace")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.namespace); + if (message.elementName != null && Object.hasOwnProperty.call(message, "elementName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.elementName); + if (message.params != null && message.params.length) + for (var i = 0; i < message.params.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.params[i]); + if (message.fallbackLg != null && Object.hasOwnProperty.call(message, "fallbackLg")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.fallbackLg); + if (message.fallbackLc != null && Object.hasOwnProperty.call(message, "fallbackLc")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.fallbackLc); + if (message.localizableParams != null && message.localizableParams.length) + for (var i = 0; i < message.localizableParams.length; ++i) + $root.proto.HSMLocalizableParameter.encode(message.localizableParams[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.deterministicLg != null && Object.hasOwnProperty.call(message, "deterministicLg")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.deterministicLg); + if (message.deterministicLc != null && Object.hasOwnProperty.call(message, "deterministicLc")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.deterministicLc); + if (message.hydratedHsm != null && Object.hasOwnProperty.call(message, "hydratedHsm")) + $root.proto.TemplateMessage.encode(message.hydratedHsm, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); return writer; }; /** - * Encodes the specified AndroidUnsupportedActions message, length delimited. Does not implicitly {@link proto.AndroidUnsupportedActions.verify|verify} messages. + * Encodes the specified HighlyStructuredMessage message, length delimited. Does not implicitly {@link proto.HighlyStructuredMessage.verify|verify} messages. * @function encodeDelimited - * @memberof proto.AndroidUnsupportedActions + * @memberof proto.HighlyStructuredMessage * @static - * @param {proto.IAndroidUnsupportedActions} message AndroidUnsupportedActions message or plain object to encode + * @param {proto.IHighlyStructuredMessage} message HighlyStructuredMessage message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AndroidUnsupportedActions.encodeDelimited = function encodeDelimited(message, writer) { + HighlyStructuredMessage.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an AndroidUnsupportedActions message from the specified reader or buffer. + * Decodes a HighlyStructuredMessage message from the specified reader or buffer. * @function decode - * @memberof proto.AndroidUnsupportedActions + * @memberof proto.HighlyStructuredMessage * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {proto.AndroidUnsupportedActions} AndroidUnsupportedActions + * @returns {proto.HighlyStructuredMessage} HighlyStructuredMessage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - AndroidUnsupportedActions.decode = function decode(reader, length) { + HighlyStructuredMessage.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.AndroidUnsupportedActions(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.HighlyStructuredMessage(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.allowed = reader.bool(); + message.namespace = reader.string(); + break; + case 2: + message.elementName = reader.string(); + break; + case 3: + if (!(message.params && message.params.length)) + message.params = []; + message.params.push(reader.string()); + break; + case 4: + message.fallbackLg = reader.string(); + break; + case 5: + message.fallbackLc = reader.string(); + break; + case 6: + if (!(message.localizableParams && message.localizableParams.length)) + message.localizableParams = []; + message.localizableParams.push($root.proto.HSMLocalizableParameter.decode(reader, reader.uint32())); + break; + case 7: + message.deterministicLg = reader.string(); + break; + case 8: + message.deterministicLc = reader.string(); + break; + case 9: + message.hydratedHsm = $root.proto.TemplateMessage.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -12462,130 +13293,215 @@ $root.proto = (function() { }; /** - * Decodes an AndroidUnsupportedActions message from the specified reader or buffer, length delimited. + * Decodes a HighlyStructuredMessage message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof proto.AndroidUnsupportedActions + * @memberof proto.HighlyStructuredMessage * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.AndroidUnsupportedActions} AndroidUnsupportedActions + * @returns {proto.HighlyStructuredMessage} HighlyStructuredMessage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - AndroidUnsupportedActions.decodeDelimited = function decodeDelimited(reader) { + HighlyStructuredMessage.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an AndroidUnsupportedActions message. + * Verifies a HighlyStructuredMessage message. * @function verify - * @memberof proto.AndroidUnsupportedActions + * @memberof proto.HighlyStructuredMessage * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - AndroidUnsupportedActions.verify = function verify(message) { + HighlyStructuredMessage.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.allowed != null && message.hasOwnProperty("allowed")) - if (typeof message.allowed !== "boolean") - return "allowed: boolean expected"; + if (message.namespace != null && message.hasOwnProperty("namespace")) + if (!$util.isString(message.namespace)) + return "namespace: string expected"; + if (message.elementName != null && message.hasOwnProperty("elementName")) + if (!$util.isString(message.elementName)) + return "elementName: string expected"; + if (message.params != null && message.hasOwnProperty("params")) { + if (!Array.isArray(message.params)) + return "params: array expected"; + for (var i = 0; i < message.params.length; ++i) + if (!$util.isString(message.params[i])) + return "params: string[] expected"; + } + if (message.fallbackLg != null && message.hasOwnProperty("fallbackLg")) + if (!$util.isString(message.fallbackLg)) + return "fallbackLg: string expected"; + if (message.fallbackLc != null && message.hasOwnProperty("fallbackLc")) + if (!$util.isString(message.fallbackLc)) + return "fallbackLc: string expected"; + if (message.localizableParams != null && message.hasOwnProperty("localizableParams")) { + if (!Array.isArray(message.localizableParams)) + return "localizableParams: array expected"; + for (var i = 0; i < message.localizableParams.length; ++i) { + var error = $root.proto.HSMLocalizableParameter.verify(message.localizableParams[i]); + if (error) + return "localizableParams." + error; + } + } + if (message.deterministicLg != null && message.hasOwnProperty("deterministicLg")) + if (!$util.isString(message.deterministicLg)) + return "deterministicLg: string expected"; + if (message.deterministicLc != null && message.hasOwnProperty("deterministicLc")) + if (!$util.isString(message.deterministicLc)) + return "deterministicLc: string expected"; + if (message.hydratedHsm != null && message.hasOwnProperty("hydratedHsm")) { + var error = $root.proto.TemplateMessage.verify(message.hydratedHsm); + if (error) + return "hydratedHsm." + error; + } return null; }; /** - * Creates an AndroidUnsupportedActions message from a plain object. Also converts values to their respective internal types. + * Creates a HighlyStructuredMessage message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof proto.AndroidUnsupportedActions + * @memberof proto.HighlyStructuredMessage * @static * @param {Object.} object Plain object - * @returns {proto.AndroidUnsupportedActions} AndroidUnsupportedActions + * @returns {proto.HighlyStructuredMessage} HighlyStructuredMessage */ - AndroidUnsupportedActions.fromObject = function fromObject(object) { - if (object instanceof $root.proto.AndroidUnsupportedActions) + HighlyStructuredMessage.fromObject = function fromObject(object) { + if (object instanceof $root.proto.HighlyStructuredMessage) return object; - var message = new $root.proto.AndroidUnsupportedActions(); - if (object.allowed != null) - message.allowed = Boolean(object.allowed); + var message = new $root.proto.HighlyStructuredMessage(); + if (object.namespace != null) + message.namespace = String(object.namespace); + if (object.elementName != null) + message.elementName = String(object.elementName); + if (object.params) { + if (!Array.isArray(object.params)) + throw TypeError(".proto.HighlyStructuredMessage.params: array expected"); + message.params = []; + for (var i = 0; i < object.params.length; ++i) + message.params[i] = String(object.params[i]); + } + if (object.fallbackLg != null) + message.fallbackLg = String(object.fallbackLg); + if (object.fallbackLc != null) + message.fallbackLc = String(object.fallbackLc); + if (object.localizableParams) { + if (!Array.isArray(object.localizableParams)) + throw TypeError(".proto.HighlyStructuredMessage.localizableParams: array expected"); + message.localizableParams = []; + for (var i = 0; i < object.localizableParams.length; ++i) { + if (typeof object.localizableParams[i] !== "object") + throw TypeError(".proto.HighlyStructuredMessage.localizableParams: object expected"); + message.localizableParams[i] = $root.proto.HSMLocalizableParameter.fromObject(object.localizableParams[i]); + } + } + if (object.deterministicLg != null) + message.deterministicLg = String(object.deterministicLg); + if (object.deterministicLc != null) + message.deterministicLc = String(object.deterministicLc); + if (object.hydratedHsm != null) { + if (typeof object.hydratedHsm !== "object") + throw TypeError(".proto.HighlyStructuredMessage.hydratedHsm: object expected"); + message.hydratedHsm = $root.proto.TemplateMessage.fromObject(object.hydratedHsm); + } return message; }; /** - * Creates a plain object from an AndroidUnsupportedActions message. Also converts values to other types if specified. + * Creates a plain object from a HighlyStructuredMessage message. Also converts values to other types if specified. * @function toObject - * @memberof proto.AndroidUnsupportedActions + * @memberof proto.HighlyStructuredMessage * @static - * @param {proto.AndroidUnsupportedActions} message AndroidUnsupportedActions + * @param {proto.HighlyStructuredMessage} message HighlyStructuredMessage * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - AndroidUnsupportedActions.toObject = function toObject(message, options) { + HighlyStructuredMessage.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) - object.allowed = false; - if (message.allowed != null && message.hasOwnProperty("allowed")) - object.allowed = message.allowed; + if (options.arrays || options.defaults) { + object.params = []; + object.localizableParams = []; + } + if (options.defaults) { + object.namespace = ""; + object.elementName = ""; + object.fallbackLg = ""; + object.fallbackLc = ""; + object.deterministicLg = ""; + object.deterministicLc = ""; + object.hydratedHsm = null; + } + if (message.namespace != null && message.hasOwnProperty("namespace")) + object.namespace = message.namespace; + if (message.elementName != null && message.hasOwnProperty("elementName")) + object.elementName = message.elementName; + if (message.params && message.params.length) { + object.params = []; + for (var j = 0; j < message.params.length; ++j) + object.params[j] = message.params[j]; + } + if (message.fallbackLg != null && message.hasOwnProperty("fallbackLg")) + object.fallbackLg = message.fallbackLg; + if (message.fallbackLc != null && message.hasOwnProperty("fallbackLc")) + object.fallbackLc = message.fallbackLc; + if (message.localizableParams && message.localizableParams.length) { + object.localizableParams = []; + for (var j = 0; j < message.localizableParams.length; ++j) + object.localizableParams[j] = $root.proto.HSMLocalizableParameter.toObject(message.localizableParams[j], options); + } + if (message.deterministicLg != null && message.hasOwnProperty("deterministicLg")) + object.deterministicLg = message.deterministicLg; + if (message.deterministicLc != null && message.hasOwnProperty("deterministicLc")) + object.deterministicLc = message.deterministicLc; + if (message.hydratedHsm != null && message.hasOwnProperty("hydratedHsm")) + object.hydratedHsm = $root.proto.TemplateMessage.toObject(message.hydratedHsm, options); return object; }; /** - * Converts this AndroidUnsupportedActions to JSON. + * Converts this HighlyStructuredMessage to JSON. * @function toJSON - * @memberof proto.AndroidUnsupportedActions + * @memberof proto.HighlyStructuredMessage * @instance * @returns {Object.} JSON object */ - AndroidUnsupportedActions.prototype.toJSON = function toJSON() { + HighlyStructuredMessage.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return AndroidUnsupportedActions; + return HighlyStructuredMessage; })(); - proto.SyncActionValue = (function() { + proto.HistorySyncNotification = (function() { /** - * Properties of a SyncActionValue. + * Properties of a HistorySyncNotification. * @memberof proto - * @interface ISyncActionValue - * @property {number|Long|null} [timestamp] SyncActionValue timestamp - * @property {proto.IStarAction|null} [starAction] SyncActionValue starAction - * @property {proto.IContactAction|null} [contactAction] SyncActionValue contactAction - * @property {proto.IMuteAction|null} [muteAction] SyncActionValue muteAction - * @property {proto.IPinAction|null} [pinAction] SyncActionValue pinAction - * @property {proto.ISecurityNotificationSetting|null} [securityNotificationSetting] SyncActionValue securityNotificationSetting - * @property {proto.IPushNameSetting|null} [pushNameSetting] SyncActionValue pushNameSetting - * @property {proto.IQuickReplyAction|null} [quickReplyAction] SyncActionValue quickReplyAction - * @property {proto.IRecentStickerWeightsAction|null} [recentStickerWeightsAction] SyncActionValue recentStickerWeightsAction - * @property {proto.IRecentStickerMetadata|null} [recentStickerMetadata] SyncActionValue recentStickerMetadata - * @property {proto.IRecentEmojiWeightsAction|null} [recentEmojiWeightsAction] SyncActionValue recentEmojiWeightsAction - * @property {proto.ILabelEditAction|null} [labelEditAction] SyncActionValue labelEditAction - * @property {proto.ILabelAssociationAction|null} [labelAssociationAction] SyncActionValue labelAssociationAction - * @property {proto.ILocaleSetting|null} [localeSetting] SyncActionValue localeSetting - * @property {proto.IArchiveChatAction|null} [archiveChatAction] SyncActionValue archiveChatAction - * @property {proto.IDeleteMessageForMeAction|null} [deleteMessageForMeAction] SyncActionValue deleteMessageForMeAction - * @property {proto.IKeyExpiration|null} [keyExpiration] SyncActionValue keyExpiration - * @property {proto.IMarkChatAsReadAction|null} [markChatAsReadAction] SyncActionValue markChatAsReadAction - * @property {proto.IClearChatAction|null} [clearChatAction] SyncActionValue clearChatAction - * @property {proto.IDeleteChatAction|null} [deleteChatAction] SyncActionValue deleteChatAction - * @property {proto.IUnarchiveChatsSetting|null} [unarchiveChatsSetting] SyncActionValue unarchiveChatsSetting - * @property {proto.IPrimaryFeature|null} [primaryFeature] SyncActionValue primaryFeature - * @property {proto.IFavoriteStickerAction|null} [favoriteStickerAction] SyncActionValue favoriteStickerAction - * @property {proto.IAndroidUnsupportedActions|null} [androidUnsupportedActions] SyncActionValue androidUnsupportedActions + * @interface IHistorySyncNotification + * @property {Uint8Array|null} [fileSha256] HistorySyncNotification fileSha256 + * @property {number|Long|null} [fileLength] HistorySyncNotification fileLength + * @property {Uint8Array|null} [mediaKey] HistorySyncNotification mediaKey + * @property {Uint8Array|null} [fileEncSha256] HistorySyncNotification fileEncSha256 + * @property {string|null} [directPath] HistorySyncNotification directPath + * @property {proto.HistorySyncNotification.HistorySyncNotificationHistorySyncType|null} [syncType] HistorySyncNotification syncType + * @property {number|null} [chunkOrder] HistorySyncNotification chunkOrder + * @property {string|null} [originalMessageId] HistorySyncNotification originalMessageId */ /** - * Constructs a new SyncActionValue. + * Constructs a new HistorySyncNotification. * @memberof proto - * @classdesc Represents a SyncActionValue. - * @implements ISyncActionValue + * @classdesc Represents a HistorySyncNotification. + * @implements IHistorySyncNotification * @constructor - * @param {proto.ISyncActionValue=} [properties] Properties to set + * @param {proto.IHistorySyncNotification=} [properties] Properties to set */ - function SyncActionValue(properties) { + function HistorySyncNotification(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -12593,374 +13509,166 @@ $root.proto = (function() { } /** - * SyncActionValue timestamp. - * @member {number|Long} timestamp - * @memberof proto.SyncActionValue + * HistorySyncNotification fileSha256. + * @member {Uint8Array} fileSha256 + * @memberof proto.HistorySyncNotification * @instance */ - SyncActionValue.prototype.timestamp = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + HistorySyncNotification.prototype.fileSha256 = $util.newBuffer([]); /** - * SyncActionValue starAction. - * @member {proto.IStarAction|null|undefined} starAction - * @memberof proto.SyncActionValue + * HistorySyncNotification fileLength. + * @member {number|Long} fileLength + * @memberof proto.HistorySyncNotification * @instance */ - SyncActionValue.prototype.starAction = null; + HistorySyncNotification.prototype.fileLength = $util.Long ? $util.Long.fromBits(0,0,true) : 0; /** - * SyncActionValue contactAction. - * @member {proto.IContactAction|null|undefined} contactAction - * @memberof proto.SyncActionValue + * HistorySyncNotification mediaKey. + * @member {Uint8Array} mediaKey + * @memberof proto.HistorySyncNotification * @instance */ - SyncActionValue.prototype.contactAction = null; + HistorySyncNotification.prototype.mediaKey = $util.newBuffer([]); /** - * SyncActionValue muteAction. - * @member {proto.IMuteAction|null|undefined} muteAction - * @memberof proto.SyncActionValue + * HistorySyncNotification fileEncSha256. + * @member {Uint8Array} fileEncSha256 + * @memberof proto.HistorySyncNotification * @instance */ - SyncActionValue.prototype.muteAction = null; + HistorySyncNotification.prototype.fileEncSha256 = $util.newBuffer([]); /** - * SyncActionValue pinAction. - * @member {proto.IPinAction|null|undefined} pinAction - * @memberof proto.SyncActionValue + * HistorySyncNotification directPath. + * @member {string} directPath + * @memberof proto.HistorySyncNotification * @instance */ - SyncActionValue.prototype.pinAction = null; + HistorySyncNotification.prototype.directPath = ""; /** - * SyncActionValue securityNotificationSetting. - * @member {proto.ISecurityNotificationSetting|null|undefined} securityNotificationSetting - * @memberof proto.SyncActionValue + * HistorySyncNotification syncType. + * @member {proto.HistorySyncNotification.HistorySyncNotificationHistorySyncType} syncType + * @memberof proto.HistorySyncNotification * @instance */ - SyncActionValue.prototype.securityNotificationSetting = null; + HistorySyncNotification.prototype.syncType = 0; /** - * SyncActionValue pushNameSetting. - * @member {proto.IPushNameSetting|null|undefined} pushNameSetting - * @memberof proto.SyncActionValue + * HistorySyncNotification chunkOrder. + * @member {number} chunkOrder + * @memberof proto.HistorySyncNotification * @instance */ - SyncActionValue.prototype.pushNameSetting = null; + HistorySyncNotification.prototype.chunkOrder = 0; /** - * SyncActionValue quickReplyAction. - * @member {proto.IQuickReplyAction|null|undefined} quickReplyAction - * @memberof proto.SyncActionValue + * HistorySyncNotification originalMessageId. + * @member {string} originalMessageId + * @memberof proto.HistorySyncNotification * @instance */ - SyncActionValue.prototype.quickReplyAction = null; - - /** - * SyncActionValue recentStickerWeightsAction. - * @member {proto.IRecentStickerWeightsAction|null|undefined} recentStickerWeightsAction - * @memberof proto.SyncActionValue - * @instance - */ - SyncActionValue.prototype.recentStickerWeightsAction = null; - - /** - * SyncActionValue recentStickerMetadata. - * @member {proto.IRecentStickerMetadata|null|undefined} recentStickerMetadata - * @memberof proto.SyncActionValue - * @instance - */ - SyncActionValue.prototype.recentStickerMetadata = null; - - /** - * SyncActionValue recentEmojiWeightsAction. - * @member {proto.IRecentEmojiWeightsAction|null|undefined} recentEmojiWeightsAction - * @memberof proto.SyncActionValue - * @instance - */ - SyncActionValue.prototype.recentEmojiWeightsAction = null; - - /** - * SyncActionValue labelEditAction. - * @member {proto.ILabelEditAction|null|undefined} labelEditAction - * @memberof proto.SyncActionValue - * @instance - */ - SyncActionValue.prototype.labelEditAction = null; - - /** - * SyncActionValue labelAssociationAction. - * @member {proto.ILabelAssociationAction|null|undefined} labelAssociationAction - * @memberof proto.SyncActionValue - * @instance - */ - SyncActionValue.prototype.labelAssociationAction = null; - - /** - * SyncActionValue localeSetting. - * @member {proto.ILocaleSetting|null|undefined} localeSetting - * @memberof proto.SyncActionValue - * @instance - */ - SyncActionValue.prototype.localeSetting = null; - - /** - * SyncActionValue archiveChatAction. - * @member {proto.IArchiveChatAction|null|undefined} archiveChatAction - * @memberof proto.SyncActionValue - * @instance - */ - SyncActionValue.prototype.archiveChatAction = null; - - /** - * SyncActionValue deleteMessageForMeAction. - * @member {proto.IDeleteMessageForMeAction|null|undefined} deleteMessageForMeAction - * @memberof proto.SyncActionValue - * @instance - */ - SyncActionValue.prototype.deleteMessageForMeAction = null; - - /** - * SyncActionValue keyExpiration. - * @member {proto.IKeyExpiration|null|undefined} keyExpiration - * @memberof proto.SyncActionValue - * @instance - */ - SyncActionValue.prototype.keyExpiration = null; - - /** - * SyncActionValue markChatAsReadAction. - * @member {proto.IMarkChatAsReadAction|null|undefined} markChatAsReadAction - * @memberof proto.SyncActionValue - * @instance - */ - SyncActionValue.prototype.markChatAsReadAction = null; - - /** - * SyncActionValue clearChatAction. - * @member {proto.IClearChatAction|null|undefined} clearChatAction - * @memberof proto.SyncActionValue - * @instance - */ - SyncActionValue.prototype.clearChatAction = null; - - /** - * SyncActionValue deleteChatAction. - * @member {proto.IDeleteChatAction|null|undefined} deleteChatAction - * @memberof proto.SyncActionValue - * @instance - */ - SyncActionValue.prototype.deleteChatAction = null; - - /** - * SyncActionValue unarchiveChatsSetting. - * @member {proto.IUnarchiveChatsSetting|null|undefined} unarchiveChatsSetting - * @memberof proto.SyncActionValue - * @instance - */ - SyncActionValue.prototype.unarchiveChatsSetting = null; - - /** - * SyncActionValue primaryFeature. - * @member {proto.IPrimaryFeature|null|undefined} primaryFeature - * @memberof proto.SyncActionValue - * @instance - */ - SyncActionValue.prototype.primaryFeature = null; - - /** - * SyncActionValue favoriteStickerAction. - * @member {proto.IFavoriteStickerAction|null|undefined} favoriteStickerAction - * @memberof proto.SyncActionValue - * @instance - */ - SyncActionValue.prototype.favoriteStickerAction = null; - - /** - * SyncActionValue androidUnsupportedActions. - * @member {proto.IAndroidUnsupportedActions|null|undefined} androidUnsupportedActions - * @memberof proto.SyncActionValue - * @instance - */ - SyncActionValue.prototype.androidUnsupportedActions = null; + HistorySyncNotification.prototype.originalMessageId = ""; /** - * Creates a new SyncActionValue instance using the specified properties. + * Creates a new HistorySyncNotification instance using the specified properties. * @function create - * @memberof proto.SyncActionValue + * @memberof proto.HistorySyncNotification * @static - * @param {proto.ISyncActionValue=} [properties] Properties to set - * @returns {proto.SyncActionValue} SyncActionValue instance + * @param {proto.IHistorySyncNotification=} [properties] Properties to set + * @returns {proto.HistorySyncNotification} HistorySyncNotification instance */ - SyncActionValue.create = function create(properties) { - return new SyncActionValue(properties); + HistorySyncNotification.create = function create(properties) { + return new HistorySyncNotification(properties); }; /** - * Encodes the specified SyncActionValue message. Does not implicitly {@link proto.SyncActionValue.verify|verify} messages. + * Encodes the specified HistorySyncNotification message. Does not implicitly {@link proto.HistorySyncNotification.verify|verify} messages. * @function encode - * @memberof proto.SyncActionValue + * @memberof proto.HistorySyncNotification * @static - * @param {proto.ISyncActionValue} message SyncActionValue message or plain object to encode + * @param {proto.IHistorySyncNotification} message HistorySyncNotification message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SyncActionValue.encode = function encode(message, writer) { + HistorySyncNotification.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.timestamp != null && Object.hasOwnProperty.call(message, "timestamp")) - writer.uint32(/* id 1, wireType 0 =*/8).int64(message.timestamp); - if (message.starAction != null && Object.hasOwnProperty.call(message, "starAction")) - $root.proto.StarAction.encode(message.starAction, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.contactAction != null && Object.hasOwnProperty.call(message, "contactAction")) - $root.proto.ContactAction.encode(message.contactAction, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.muteAction != null && Object.hasOwnProperty.call(message, "muteAction")) - $root.proto.MuteAction.encode(message.muteAction, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.pinAction != null && Object.hasOwnProperty.call(message, "pinAction")) - $root.proto.PinAction.encode(message.pinAction, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.securityNotificationSetting != null && Object.hasOwnProperty.call(message, "securityNotificationSetting")) - $root.proto.SecurityNotificationSetting.encode(message.securityNotificationSetting, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.pushNameSetting != null && Object.hasOwnProperty.call(message, "pushNameSetting")) - $root.proto.PushNameSetting.encode(message.pushNameSetting, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.quickReplyAction != null && Object.hasOwnProperty.call(message, "quickReplyAction")) - $root.proto.QuickReplyAction.encode(message.quickReplyAction, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.recentStickerWeightsAction != null && Object.hasOwnProperty.call(message, "recentStickerWeightsAction")) - $root.proto.RecentStickerWeightsAction.encode(message.recentStickerWeightsAction, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.recentStickerMetadata != null && Object.hasOwnProperty.call(message, "recentStickerMetadata")) - $root.proto.RecentStickerMetadata.encode(message.recentStickerMetadata, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); - if (message.recentEmojiWeightsAction != null && Object.hasOwnProperty.call(message, "recentEmojiWeightsAction")) - $root.proto.RecentEmojiWeightsAction.encode(message.recentEmojiWeightsAction, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); - if (message.labelEditAction != null && Object.hasOwnProperty.call(message, "labelEditAction")) - $root.proto.LabelEditAction.encode(message.labelEditAction, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); - if (message.labelAssociationAction != null && Object.hasOwnProperty.call(message, "labelAssociationAction")) - $root.proto.LabelAssociationAction.encode(message.labelAssociationAction, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); - if (message.localeSetting != null && Object.hasOwnProperty.call(message, "localeSetting")) - $root.proto.LocaleSetting.encode(message.localeSetting, writer.uint32(/* id 16, wireType 2 =*/130).fork()).ldelim(); - if (message.archiveChatAction != null && Object.hasOwnProperty.call(message, "archiveChatAction")) - $root.proto.ArchiveChatAction.encode(message.archiveChatAction, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); - if (message.deleteMessageForMeAction != null && Object.hasOwnProperty.call(message, "deleteMessageForMeAction")) - $root.proto.DeleteMessageForMeAction.encode(message.deleteMessageForMeAction, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); - if (message.keyExpiration != null && Object.hasOwnProperty.call(message, "keyExpiration")) - $root.proto.KeyExpiration.encode(message.keyExpiration, writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim(); - if (message.markChatAsReadAction != null && Object.hasOwnProperty.call(message, "markChatAsReadAction")) - $root.proto.MarkChatAsReadAction.encode(message.markChatAsReadAction, writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); - if (message.clearChatAction != null && Object.hasOwnProperty.call(message, "clearChatAction")) - $root.proto.ClearChatAction.encode(message.clearChatAction, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); - if (message.deleteChatAction != null && Object.hasOwnProperty.call(message, "deleteChatAction")) - $root.proto.DeleteChatAction.encode(message.deleteChatAction, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); - if (message.unarchiveChatsSetting != null && Object.hasOwnProperty.call(message, "unarchiveChatsSetting")) - $root.proto.UnarchiveChatsSetting.encode(message.unarchiveChatsSetting, writer.uint32(/* id 23, wireType 2 =*/186).fork()).ldelim(); - if (message.primaryFeature != null && Object.hasOwnProperty.call(message, "primaryFeature")) - $root.proto.PrimaryFeature.encode(message.primaryFeature, writer.uint32(/* id 24, wireType 2 =*/194).fork()).ldelim(); - if (message.favoriteStickerAction != null && Object.hasOwnProperty.call(message, "favoriteStickerAction")) - $root.proto.FavoriteStickerAction.encode(message.favoriteStickerAction, writer.uint32(/* id 25, wireType 2 =*/202).fork()).ldelim(); - if (message.androidUnsupportedActions != null && Object.hasOwnProperty.call(message, "androidUnsupportedActions")) - $root.proto.AndroidUnsupportedActions.encode(message.androidUnsupportedActions, writer.uint32(/* id 26, wireType 2 =*/210).fork()).ldelim(); + if (message.fileSha256 != null && Object.hasOwnProperty.call(message, "fileSha256")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.fileSha256); + if (message.fileLength != null && Object.hasOwnProperty.call(message, "fileLength")) + writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.fileLength); + if (message.mediaKey != null && Object.hasOwnProperty.call(message, "mediaKey")) + writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.mediaKey); + if (message.fileEncSha256 != null && Object.hasOwnProperty.call(message, "fileEncSha256")) + writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.fileEncSha256); + if (message.directPath != null && Object.hasOwnProperty.call(message, "directPath")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.directPath); + if (message.syncType != null && Object.hasOwnProperty.call(message, "syncType")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.syncType); + if (message.chunkOrder != null && Object.hasOwnProperty.call(message, "chunkOrder")) + writer.uint32(/* id 7, wireType 0 =*/56).uint32(message.chunkOrder); + if (message.originalMessageId != null && Object.hasOwnProperty.call(message, "originalMessageId")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.originalMessageId); return writer; }; /** - * Encodes the specified SyncActionValue message, length delimited. Does not implicitly {@link proto.SyncActionValue.verify|verify} messages. + * Encodes the specified HistorySyncNotification message, length delimited. Does not implicitly {@link proto.HistorySyncNotification.verify|verify} messages. * @function encodeDelimited - * @memberof proto.SyncActionValue + * @memberof proto.HistorySyncNotification * @static - * @param {proto.ISyncActionValue} message SyncActionValue message or plain object to encode + * @param {proto.IHistorySyncNotification} message HistorySyncNotification message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SyncActionValue.encodeDelimited = function encodeDelimited(message, writer) { + HistorySyncNotification.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a SyncActionValue message from the specified reader or buffer. + * Decodes a HistorySyncNotification message from the specified reader or buffer. * @function decode - * @memberof proto.SyncActionValue + * @memberof proto.HistorySyncNotification * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {proto.SyncActionValue} SyncActionValue + * @returns {proto.HistorySyncNotification} HistorySyncNotification * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SyncActionValue.decode = function decode(reader, length) { + HistorySyncNotification.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.SyncActionValue(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.HistorySyncNotification(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.timestamp = reader.int64(); + message.fileSha256 = reader.bytes(); break; case 2: - message.starAction = $root.proto.StarAction.decode(reader, reader.uint32()); + message.fileLength = reader.uint64(); break; case 3: - message.contactAction = $root.proto.ContactAction.decode(reader, reader.uint32()); + message.mediaKey = reader.bytes(); break; case 4: - message.muteAction = $root.proto.MuteAction.decode(reader, reader.uint32()); + message.fileEncSha256 = reader.bytes(); break; case 5: - message.pinAction = $root.proto.PinAction.decode(reader, reader.uint32()); + message.directPath = reader.string(); break; case 6: - message.securityNotificationSetting = $root.proto.SecurityNotificationSetting.decode(reader, reader.uint32()); + message.syncType = reader.int32(); break; case 7: - message.pushNameSetting = $root.proto.PushNameSetting.decode(reader, reader.uint32()); + message.chunkOrder = reader.uint32(); break; case 8: - message.quickReplyAction = $root.proto.QuickReplyAction.decode(reader, reader.uint32()); - break; - case 9: - message.recentStickerWeightsAction = $root.proto.RecentStickerWeightsAction.decode(reader, reader.uint32()); - break; - case 10: - message.recentStickerMetadata = $root.proto.RecentStickerMetadata.decode(reader, reader.uint32()); - break; - case 11: - message.recentEmojiWeightsAction = $root.proto.RecentEmojiWeightsAction.decode(reader, reader.uint32()); - break; - case 14: - message.labelEditAction = $root.proto.LabelEditAction.decode(reader, reader.uint32()); - break; - case 15: - message.labelAssociationAction = $root.proto.LabelAssociationAction.decode(reader, reader.uint32()); - break; - case 16: - message.localeSetting = $root.proto.LocaleSetting.decode(reader, reader.uint32()); - break; - case 17: - message.archiveChatAction = $root.proto.ArchiveChatAction.decode(reader, reader.uint32()); - break; - case 18: - message.deleteMessageForMeAction = $root.proto.DeleteMessageForMeAction.decode(reader, reader.uint32()); - break; - case 19: - message.keyExpiration = $root.proto.KeyExpiration.decode(reader, reader.uint32()); - break; - case 20: - message.markChatAsReadAction = $root.proto.MarkChatAsReadAction.decode(reader, reader.uint32()); - break; - case 21: - message.clearChatAction = $root.proto.ClearChatAction.decode(reader, reader.uint32()); - break; - case 22: - message.deleteChatAction = $root.proto.DeleteChatAction.decode(reader, reader.uint32()); - break; - case 23: - message.unarchiveChatsSetting = $root.proto.UnarchiveChatsSetting.decode(reader, reader.uint32()); - break; - case 24: - message.primaryFeature = $root.proto.PrimaryFeature.decode(reader, reader.uint32()); - break; - case 25: - message.favoriteStickerAction = $root.proto.FavoriteStickerAction.decode(reader, reader.uint32()); - break; - case 26: - message.androidUnsupportedActions = $root.proto.AndroidUnsupportedActions.decode(reader, reader.uint32()); + message.originalMessageId = reader.string(); break; default: reader.skipType(tag & 7); @@ -12971,422 +13679,254 @@ $root.proto = (function() { }; /** - * Decodes a SyncActionValue message from the specified reader or buffer, length delimited. + * Decodes a HistorySyncNotification message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof proto.SyncActionValue + * @memberof proto.HistorySyncNotification * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.SyncActionValue} SyncActionValue + * @returns {proto.HistorySyncNotification} HistorySyncNotification * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SyncActionValue.decodeDelimited = function decodeDelimited(reader) { + HistorySyncNotification.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a SyncActionValue message. + * Verifies a HistorySyncNotification message. * @function verify - * @memberof proto.SyncActionValue + * @memberof proto.HistorySyncNotification * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - SyncActionValue.verify = function verify(message) { + HistorySyncNotification.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.timestamp != null && message.hasOwnProperty("timestamp")) - if (!$util.isInteger(message.timestamp) && !(message.timestamp && $util.isInteger(message.timestamp.low) && $util.isInteger(message.timestamp.high))) - return "timestamp: integer|Long expected"; - if (message.starAction != null && message.hasOwnProperty("starAction")) { - var error = $root.proto.StarAction.verify(message.starAction); - if (error) - return "starAction." + error; - } - if (message.contactAction != null && message.hasOwnProperty("contactAction")) { - var error = $root.proto.ContactAction.verify(message.contactAction); - if (error) - return "contactAction." + error; - } - if (message.muteAction != null && message.hasOwnProperty("muteAction")) { - var error = $root.proto.MuteAction.verify(message.muteAction); - if (error) - return "muteAction." + error; - } - if (message.pinAction != null && message.hasOwnProperty("pinAction")) { - var error = $root.proto.PinAction.verify(message.pinAction); - if (error) - return "pinAction." + error; - } - if (message.securityNotificationSetting != null && message.hasOwnProperty("securityNotificationSetting")) { - var error = $root.proto.SecurityNotificationSetting.verify(message.securityNotificationSetting); - if (error) - return "securityNotificationSetting." + error; - } - if (message.pushNameSetting != null && message.hasOwnProperty("pushNameSetting")) { - var error = $root.proto.PushNameSetting.verify(message.pushNameSetting); - if (error) - return "pushNameSetting." + error; - } - if (message.quickReplyAction != null && message.hasOwnProperty("quickReplyAction")) { - var error = $root.proto.QuickReplyAction.verify(message.quickReplyAction); - if (error) - return "quickReplyAction." + error; - } - if (message.recentStickerWeightsAction != null && message.hasOwnProperty("recentStickerWeightsAction")) { - var error = $root.proto.RecentStickerWeightsAction.verify(message.recentStickerWeightsAction); - if (error) - return "recentStickerWeightsAction." + error; - } - if (message.recentStickerMetadata != null && message.hasOwnProperty("recentStickerMetadata")) { - var error = $root.proto.RecentStickerMetadata.verify(message.recentStickerMetadata); - if (error) - return "recentStickerMetadata." + error; - } - if (message.recentEmojiWeightsAction != null && message.hasOwnProperty("recentEmojiWeightsAction")) { - var error = $root.proto.RecentEmojiWeightsAction.verify(message.recentEmojiWeightsAction); - if (error) - return "recentEmojiWeightsAction." + error; - } - if (message.labelEditAction != null && message.hasOwnProperty("labelEditAction")) { - var error = $root.proto.LabelEditAction.verify(message.labelEditAction); - if (error) - return "labelEditAction." + error; - } - if (message.labelAssociationAction != null && message.hasOwnProperty("labelAssociationAction")) { - var error = $root.proto.LabelAssociationAction.verify(message.labelAssociationAction); - if (error) - return "labelAssociationAction." + error; - } - if (message.localeSetting != null && message.hasOwnProperty("localeSetting")) { - var error = $root.proto.LocaleSetting.verify(message.localeSetting); - if (error) - return "localeSetting." + error; - } - if (message.archiveChatAction != null && message.hasOwnProperty("archiveChatAction")) { - var error = $root.proto.ArchiveChatAction.verify(message.archiveChatAction); - if (error) - return "archiveChatAction." + error; - } - if (message.deleteMessageForMeAction != null && message.hasOwnProperty("deleteMessageForMeAction")) { - var error = $root.proto.DeleteMessageForMeAction.verify(message.deleteMessageForMeAction); - if (error) - return "deleteMessageForMeAction." + error; - } - if (message.keyExpiration != null && message.hasOwnProperty("keyExpiration")) { - var error = $root.proto.KeyExpiration.verify(message.keyExpiration); - if (error) - return "keyExpiration." + error; - } - if (message.markChatAsReadAction != null && message.hasOwnProperty("markChatAsReadAction")) { - var error = $root.proto.MarkChatAsReadAction.verify(message.markChatAsReadAction); - if (error) - return "markChatAsReadAction." + error; - } - if (message.clearChatAction != null && message.hasOwnProperty("clearChatAction")) { - var error = $root.proto.ClearChatAction.verify(message.clearChatAction); - if (error) - return "clearChatAction." + error; - } - if (message.deleteChatAction != null && message.hasOwnProperty("deleteChatAction")) { - var error = $root.proto.DeleteChatAction.verify(message.deleteChatAction); - if (error) - return "deleteChatAction." + error; - } - if (message.unarchiveChatsSetting != null && message.hasOwnProperty("unarchiveChatsSetting")) { - var error = $root.proto.UnarchiveChatsSetting.verify(message.unarchiveChatsSetting); - if (error) - return "unarchiveChatsSetting." + error; - } - if (message.primaryFeature != null && message.hasOwnProperty("primaryFeature")) { - var error = $root.proto.PrimaryFeature.verify(message.primaryFeature); - if (error) - return "primaryFeature." + error; - } - if (message.favoriteStickerAction != null && message.hasOwnProperty("favoriteStickerAction")) { - var error = $root.proto.FavoriteStickerAction.verify(message.favoriteStickerAction); - if (error) - return "favoriteStickerAction." + error; - } - if (message.androidUnsupportedActions != null && message.hasOwnProperty("androidUnsupportedActions")) { - var error = $root.proto.AndroidUnsupportedActions.verify(message.androidUnsupportedActions); - if (error) - return "androidUnsupportedActions." + error; - } + if (message.fileSha256 != null && message.hasOwnProperty("fileSha256")) + if (!(message.fileSha256 && typeof message.fileSha256.length === "number" || $util.isString(message.fileSha256))) + return "fileSha256: buffer expected"; + if (message.fileLength != null && message.hasOwnProperty("fileLength")) + if (!$util.isInteger(message.fileLength) && !(message.fileLength && $util.isInteger(message.fileLength.low) && $util.isInteger(message.fileLength.high))) + return "fileLength: integer|Long expected"; + if (message.mediaKey != null && message.hasOwnProperty("mediaKey")) + if (!(message.mediaKey && typeof message.mediaKey.length === "number" || $util.isString(message.mediaKey))) + return "mediaKey: buffer expected"; + if (message.fileEncSha256 != null && message.hasOwnProperty("fileEncSha256")) + if (!(message.fileEncSha256 && typeof message.fileEncSha256.length === "number" || $util.isString(message.fileEncSha256))) + return "fileEncSha256: buffer expected"; + if (message.directPath != null && message.hasOwnProperty("directPath")) + if (!$util.isString(message.directPath)) + return "directPath: string expected"; + if (message.syncType != null && message.hasOwnProperty("syncType")) + switch (message.syncType) { + default: + return "syncType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.chunkOrder != null && message.hasOwnProperty("chunkOrder")) + if (!$util.isInteger(message.chunkOrder)) + return "chunkOrder: integer expected"; + if (message.originalMessageId != null && message.hasOwnProperty("originalMessageId")) + if (!$util.isString(message.originalMessageId)) + return "originalMessageId: string expected"; return null; }; /** - * Creates a SyncActionValue message from a plain object. Also converts values to their respective internal types. + * Creates a HistorySyncNotification message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof proto.SyncActionValue + * @memberof proto.HistorySyncNotification * @static * @param {Object.} object Plain object - * @returns {proto.SyncActionValue} SyncActionValue + * @returns {proto.HistorySyncNotification} HistorySyncNotification */ - SyncActionValue.fromObject = function fromObject(object) { - if (object instanceof $root.proto.SyncActionValue) + HistorySyncNotification.fromObject = function fromObject(object) { + if (object instanceof $root.proto.HistorySyncNotification) return object; - var message = new $root.proto.SyncActionValue(); - if (object.timestamp != null) + var message = new $root.proto.HistorySyncNotification(); + if (object.fileSha256 != null) + if (typeof object.fileSha256 === "string") + $util.base64.decode(object.fileSha256, message.fileSha256 = $util.newBuffer($util.base64.length(object.fileSha256)), 0); + else if (object.fileSha256.length) + message.fileSha256 = object.fileSha256; + if (object.fileLength != null) if ($util.Long) - (message.timestamp = $util.Long.fromValue(object.timestamp)).unsigned = false; - else if (typeof object.timestamp === "string") - message.timestamp = parseInt(object.timestamp, 10); - else if (typeof object.timestamp === "number") - message.timestamp = object.timestamp; - else if (typeof object.timestamp === "object") - message.timestamp = new $util.LongBits(object.timestamp.low >>> 0, object.timestamp.high >>> 0).toNumber(); - if (object.starAction != null) { - if (typeof object.starAction !== "object") - throw TypeError(".proto.SyncActionValue.starAction: object expected"); - message.starAction = $root.proto.StarAction.fromObject(object.starAction); - } - if (object.contactAction != null) { - if (typeof object.contactAction !== "object") - throw TypeError(".proto.SyncActionValue.contactAction: object expected"); - message.contactAction = $root.proto.ContactAction.fromObject(object.contactAction); - } - if (object.muteAction != null) { - if (typeof object.muteAction !== "object") - throw TypeError(".proto.SyncActionValue.muteAction: object expected"); - message.muteAction = $root.proto.MuteAction.fromObject(object.muteAction); - } - if (object.pinAction != null) { - if (typeof object.pinAction !== "object") - throw TypeError(".proto.SyncActionValue.pinAction: object expected"); - message.pinAction = $root.proto.PinAction.fromObject(object.pinAction); - } - if (object.securityNotificationSetting != null) { - if (typeof object.securityNotificationSetting !== "object") - throw TypeError(".proto.SyncActionValue.securityNotificationSetting: object expected"); - message.securityNotificationSetting = $root.proto.SecurityNotificationSetting.fromObject(object.securityNotificationSetting); - } - if (object.pushNameSetting != null) { - if (typeof object.pushNameSetting !== "object") - throw TypeError(".proto.SyncActionValue.pushNameSetting: object expected"); - message.pushNameSetting = $root.proto.PushNameSetting.fromObject(object.pushNameSetting); - } - if (object.quickReplyAction != null) { - if (typeof object.quickReplyAction !== "object") - throw TypeError(".proto.SyncActionValue.quickReplyAction: object expected"); - message.quickReplyAction = $root.proto.QuickReplyAction.fromObject(object.quickReplyAction); - } - if (object.recentStickerWeightsAction != null) { - if (typeof object.recentStickerWeightsAction !== "object") - throw TypeError(".proto.SyncActionValue.recentStickerWeightsAction: object expected"); - message.recentStickerWeightsAction = $root.proto.RecentStickerWeightsAction.fromObject(object.recentStickerWeightsAction); - } - if (object.recentStickerMetadata != null) { - if (typeof object.recentStickerMetadata !== "object") - throw TypeError(".proto.SyncActionValue.recentStickerMetadata: object expected"); - message.recentStickerMetadata = $root.proto.RecentStickerMetadata.fromObject(object.recentStickerMetadata); - } - if (object.recentEmojiWeightsAction != null) { - if (typeof object.recentEmojiWeightsAction !== "object") - throw TypeError(".proto.SyncActionValue.recentEmojiWeightsAction: object expected"); - message.recentEmojiWeightsAction = $root.proto.RecentEmojiWeightsAction.fromObject(object.recentEmojiWeightsAction); - } - if (object.labelEditAction != null) { - if (typeof object.labelEditAction !== "object") - throw TypeError(".proto.SyncActionValue.labelEditAction: object expected"); - message.labelEditAction = $root.proto.LabelEditAction.fromObject(object.labelEditAction); - } - if (object.labelAssociationAction != null) { - if (typeof object.labelAssociationAction !== "object") - throw TypeError(".proto.SyncActionValue.labelAssociationAction: object expected"); - message.labelAssociationAction = $root.proto.LabelAssociationAction.fromObject(object.labelAssociationAction); - } - if (object.localeSetting != null) { - if (typeof object.localeSetting !== "object") - throw TypeError(".proto.SyncActionValue.localeSetting: object expected"); - message.localeSetting = $root.proto.LocaleSetting.fromObject(object.localeSetting); - } - if (object.archiveChatAction != null) { - if (typeof object.archiveChatAction !== "object") - throw TypeError(".proto.SyncActionValue.archiveChatAction: object expected"); - message.archiveChatAction = $root.proto.ArchiveChatAction.fromObject(object.archiveChatAction); - } - if (object.deleteMessageForMeAction != null) { - if (typeof object.deleteMessageForMeAction !== "object") - throw TypeError(".proto.SyncActionValue.deleteMessageForMeAction: object expected"); - message.deleteMessageForMeAction = $root.proto.DeleteMessageForMeAction.fromObject(object.deleteMessageForMeAction); - } - if (object.keyExpiration != null) { - if (typeof object.keyExpiration !== "object") - throw TypeError(".proto.SyncActionValue.keyExpiration: object expected"); - message.keyExpiration = $root.proto.KeyExpiration.fromObject(object.keyExpiration); - } - if (object.markChatAsReadAction != null) { - if (typeof object.markChatAsReadAction !== "object") - throw TypeError(".proto.SyncActionValue.markChatAsReadAction: object expected"); - message.markChatAsReadAction = $root.proto.MarkChatAsReadAction.fromObject(object.markChatAsReadAction); - } - if (object.clearChatAction != null) { - if (typeof object.clearChatAction !== "object") - throw TypeError(".proto.SyncActionValue.clearChatAction: object expected"); - message.clearChatAction = $root.proto.ClearChatAction.fromObject(object.clearChatAction); - } - if (object.deleteChatAction != null) { - if (typeof object.deleteChatAction !== "object") - throw TypeError(".proto.SyncActionValue.deleteChatAction: object expected"); - message.deleteChatAction = $root.proto.DeleteChatAction.fromObject(object.deleteChatAction); - } - if (object.unarchiveChatsSetting != null) { - if (typeof object.unarchiveChatsSetting !== "object") - throw TypeError(".proto.SyncActionValue.unarchiveChatsSetting: object expected"); - message.unarchiveChatsSetting = $root.proto.UnarchiveChatsSetting.fromObject(object.unarchiveChatsSetting); - } - if (object.primaryFeature != null) { - if (typeof object.primaryFeature !== "object") - throw TypeError(".proto.SyncActionValue.primaryFeature: object expected"); - message.primaryFeature = $root.proto.PrimaryFeature.fromObject(object.primaryFeature); - } - if (object.favoriteStickerAction != null) { - if (typeof object.favoriteStickerAction !== "object") - throw TypeError(".proto.SyncActionValue.favoriteStickerAction: object expected"); - message.favoriteStickerAction = $root.proto.FavoriteStickerAction.fromObject(object.favoriteStickerAction); - } - if (object.androidUnsupportedActions != null) { - if (typeof object.androidUnsupportedActions !== "object") - throw TypeError(".proto.SyncActionValue.androidUnsupportedActions: object expected"); - message.androidUnsupportedActions = $root.proto.AndroidUnsupportedActions.fromObject(object.androidUnsupportedActions); + (message.fileLength = $util.Long.fromValue(object.fileLength)).unsigned = true; + else if (typeof object.fileLength === "string") + message.fileLength = parseInt(object.fileLength, 10); + else if (typeof object.fileLength === "number") + message.fileLength = object.fileLength; + else if (typeof object.fileLength === "object") + message.fileLength = new $util.LongBits(object.fileLength.low >>> 0, object.fileLength.high >>> 0).toNumber(true); + if (object.mediaKey != null) + if (typeof object.mediaKey === "string") + $util.base64.decode(object.mediaKey, message.mediaKey = $util.newBuffer($util.base64.length(object.mediaKey)), 0); + else if (object.mediaKey.length) + message.mediaKey = object.mediaKey; + if (object.fileEncSha256 != null) + if (typeof object.fileEncSha256 === "string") + $util.base64.decode(object.fileEncSha256, message.fileEncSha256 = $util.newBuffer($util.base64.length(object.fileEncSha256)), 0); + else if (object.fileEncSha256.length) + message.fileEncSha256 = object.fileEncSha256; + if (object.directPath != null) + message.directPath = String(object.directPath); + switch (object.syncType) { + case "INITIAL_BOOTSTRAP": + case 0: + message.syncType = 0; + break; + case "INITIAL_STATUS_V3": + case 1: + message.syncType = 1; + break; + case "FULL": + case 2: + message.syncType = 2; + break; + case "RECENT": + case 3: + message.syncType = 3; + break; + case "PUSH_NAME": + case 4: + message.syncType = 4; + break; } + if (object.chunkOrder != null) + message.chunkOrder = object.chunkOrder >>> 0; + if (object.originalMessageId != null) + message.originalMessageId = String(object.originalMessageId); return message; }; /** - * Creates a plain object from a SyncActionValue message. Also converts values to other types if specified. + * Creates a plain object from a HistorySyncNotification message. Also converts values to other types if specified. * @function toObject - * @memberof proto.SyncActionValue + * @memberof proto.HistorySyncNotification * @static - * @param {proto.SyncActionValue} message SyncActionValue + * @param {proto.HistorySyncNotification} message HistorySyncNotification * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SyncActionValue.toObject = function toObject(message, options) { + HistorySyncNotification.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { + if (options.bytes === String) + object.fileSha256 = ""; + else { + object.fileSha256 = []; + if (options.bytes !== Array) + object.fileSha256 = $util.newBuffer(object.fileSha256); + } if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.timestamp = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + var long = new $util.Long(0, 0, true); + object.fileLength = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; } else - object.timestamp = options.longs === String ? "0" : 0; - object.starAction = null; - object.contactAction = null; - object.muteAction = null; - object.pinAction = null; - object.securityNotificationSetting = null; - object.pushNameSetting = null; - object.quickReplyAction = null; - object.recentStickerWeightsAction = null; - object.recentStickerMetadata = null; - object.recentEmojiWeightsAction = null; - object.labelEditAction = null; - object.labelAssociationAction = null; - object.localeSetting = null; - object.archiveChatAction = null; - object.deleteMessageForMeAction = null; - object.keyExpiration = null; - object.markChatAsReadAction = null; - object.clearChatAction = null; - object.deleteChatAction = null; - object.unarchiveChatsSetting = null; - object.primaryFeature = null; - object.favoriteStickerAction = null; - object.androidUnsupportedActions = null; + object.fileLength = options.longs === String ? "0" : 0; + if (options.bytes === String) + object.mediaKey = ""; + else { + object.mediaKey = []; + if (options.bytes !== Array) + object.mediaKey = $util.newBuffer(object.mediaKey); + } + if (options.bytes === String) + object.fileEncSha256 = ""; + else { + object.fileEncSha256 = []; + if (options.bytes !== Array) + object.fileEncSha256 = $util.newBuffer(object.fileEncSha256); + } + object.directPath = ""; + object.syncType = options.enums === String ? "INITIAL_BOOTSTRAP" : 0; + object.chunkOrder = 0; + object.originalMessageId = ""; } - if (message.timestamp != null && message.hasOwnProperty("timestamp")) - if (typeof message.timestamp === "number") - object.timestamp = options.longs === String ? String(message.timestamp) : message.timestamp; + if (message.fileSha256 != null && message.hasOwnProperty("fileSha256")) + object.fileSha256 = options.bytes === String ? $util.base64.encode(message.fileSha256, 0, message.fileSha256.length) : options.bytes === Array ? Array.prototype.slice.call(message.fileSha256) : message.fileSha256; + if (message.fileLength != null && message.hasOwnProperty("fileLength")) + if (typeof message.fileLength === "number") + object.fileLength = options.longs === String ? String(message.fileLength) : message.fileLength; else - object.timestamp = options.longs === String ? $util.Long.prototype.toString.call(message.timestamp) : options.longs === Number ? new $util.LongBits(message.timestamp.low >>> 0, message.timestamp.high >>> 0).toNumber() : message.timestamp; - if (message.starAction != null && message.hasOwnProperty("starAction")) - object.starAction = $root.proto.StarAction.toObject(message.starAction, options); - if (message.contactAction != null && message.hasOwnProperty("contactAction")) - object.contactAction = $root.proto.ContactAction.toObject(message.contactAction, options); - if (message.muteAction != null && message.hasOwnProperty("muteAction")) - object.muteAction = $root.proto.MuteAction.toObject(message.muteAction, options); - if (message.pinAction != null && message.hasOwnProperty("pinAction")) - object.pinAction = $root.proto.PinAction.toObject(message.pinAction, options); - if (message.securityNotificationSetting != null && message.hasOwnProperty("securityNotificationSetting")) - object.securityNotificationSetting = $root.proto.SecurityNotificationSetting.toObject(message.securityNotificationSetting, options); - if (message.pushNameSetting != null && message.hasOwnProperty("pushNameSetting")) - object.pushNameSetting = $root.proto.PushNameSetting.toObject(message.pushNameSetting, options); - if (message.quickReplyAction != null && message.hasOwnProperty("quickReplyAction")) - object.quickReplyAction = $root.proto.QuickReplyAction.toObject(message.quickReplyAction, options); - if (message.recentStickerWeightsAction != null && message.hasOwnProperty("recentStickerWeightsAction")) - object.recentStickerWeightsAction = $root.proto.RecentStickerWeightsAction.toObject(message.recentStickerWeightsAction, options); - if (message.recentStickerMetadata != null && message.hasOwnProperty("recentStickerMetadata")) - object.recentStickerMetadata = $root.proto.RecentStickerMetadata.toObject(message.recentStickerMetadata, options); - if (message.recentEmojiWeightsAction != null && message.hasOwnProperty("recentEmojiWeightsAction")) - object.recentEmojiWeightsAction = $root.proto.RecentEmojiWeightsAction.toObject(message.recentEmojiWeightsAction, options); - if (message.labelEditAction != null && message.hasOwnProperty("labelEditAction")) - object.labelEditAction = $root.proto.LabelEditAction.toObject(message.labelEditAction, options); - if (message.labelAssociationAction != null && message.hasOwnProperty("labelAssociationAction")) - object.labelAssociationAction = $root.proto.LabelAssociationAction.toObject(message.labelAssociationAction, options); - if (message.localeSetting != null && message.hasOwnProperty("localeSetting")) - object.localeSetting = $root.proto.LocaleSetting.toObject(message.localeSetting, options); - if (message.archiveChatAction != null && message.hasOwnProperty("archiveChatAction")) - object.archiveChatAction = $root.proto.ArchiveChatAction.toObject(message.archiveChatAction, options); - if (message.deleteMessageForMeAction != null && message.hasOwnProperty("deleteMessageForMeAction")) - object.deleteMessageForMeAction = $root.proto.DeleteMessageForMeAction.toObject(message.deleteMessageForMeAction, options); - if (message.keyExpiration != null && message.hasOwnProperty("keyExpiration")) - object.keyExpiration = $root.proto.KeyExpiration.toObject(message.keyExpiration, options); - if (message.markChatAsReadAction != null && message.hasOwnProperty("markChatAsReadAction")) - object.markChatAsReadAction = $root.proto.MarkChatAsReadAction.toObject(message.markChatAsReadAction, options); - if (message.clearChatAction != null && message.hasOwnProperty("clearChatAction")) - object.clearChatAction = $root.proto.ClearChatAction.toObject(message.clearChatAction, options); - if (message.deleteChatAction != null && message.hasOwnProperty("deleteChatAction")) - object.deleteChatAction = $root.proto.DeleteChatAction.toObject(message.deleteChatAction, options); - if (message.unarchiveChatsSetting != null && message.hasOwnProperty("unarchiveChatsSetting")) - object.unarchiveChatsSetting = $root.proto.UnarchiveChatsSetting.toObject(message.unarchiveChatsSetting, options); - if (message.primaryFeature != null && message.hasOwnProperty("primaryFeature")) - object.primaryFeature = $root.proto.PrimaryFeature.toObject(message.primaryFeature, options); - if (message.favoriteStickerAction != null && message.hasOwnProperty("favoriteStickerAction")) - object.favoriteStickerAction = $root.proto.FavoriteStickerAction.toObject(message.favoriteStickerAction, options); - if (message.androidUnsupportedActions != null && message.hasOwnProperty("androidUnsupportedActions")) - object.androidUnsupportedActions = $root.proto.AndroidUnsupportedActions.toObject(message.androidUnsupportedActions, options); + object.fileLength = options.longs === String ? $util.Long.prototype.toString.call(message.fileLength) : options.longs === Number ? new $util.LongBits(message.fileLength.low >>> 0, message.fileLength.high >>> 0).toNumber(true) : message.fileLength; + if (message.mediaKey != null && message.hasOwnProperty("mediaKey")) + object.mediaKey = options.bytes === String ? $util.base64.encode(message.mediaKey, 0, message.mediaKey.length) : options.bytes === Array ? Array.prototype.slice.call(message.mediaKey) : message.mediaKey; + if (message.fileEncSha256 != null && message.hasOwnProperty("fileEncSha256")) + object.fileEncSha256 = options.bytes === String ? $util.base64.encode(message.fileEncSha256, 0, message.fileEncSha256.length) : options.bytes === Array ? Array.prototype.slice.call(message.fileEncSha256) : message.fileEncSha256; + if (message.directPath != null && message.hasOwnProperty("directPath")) + object.directPath = message.directPath; + if (message.syncType != null && message.hasOwnProperty("syncType")) + object.syncType = options.enums === String ? $root.proto.HistorySyncNotification.HistorySyncNotificationHistorySyncType[message.syncType] : message.syncType; + if (message.chunkOrder != null && message.hasOwnProperty("chunkOrder")) + object.chunkOrder = message.chunkOrder; + if (message.originalMessageId != null && message.hasOwnProperty("originalMessageId")) + object.originalMessageId = message.originalMessageId; return object; }; /** - * Converts this SyncActionValue to JSON. + * Converts this HistorySyncNotification to JSON. * @function toJSON - * @memberof proto.SyncActionValue + * @memberof proto.HistorySyncNotification * @instance * @returns {Object.} JSON object */ - SyncActionValue.prototype.toJSON = function toJSON() { + HistorySyncNotification.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return SyncActionValue; + /** + * HistorySyncNotificationHistorySyncType enum. + * @name proto.HistorySyncNotification.HistorySyncNotificationHistorySyncType + * @enum {number} + * @property {number} INITIAL_BOOTSTRAP=0 INITIAL_BOOTSTRAP value + * @property {number} INITIAL_STATUS_V3=1 INITIAL_STATUS_V3 value + * @property {number} FULL=2 FULL value + * @property {number} RECENT=3 RECENT value + * @property {number} PUSH_NAME=4 PUSH_NAME value + */ + HistorySyncNotification.HistorySyncNotificationHistorySyncType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "INITIAL_BOOTSTRAP"] = 0; + values[valuesById[1] = "INITIAL_STATUS_V3"] = 1; + values[valuesById[2] = "FULL"] = 2; + values[valuesById[3] = "RECENT"] = 3; + values[valuesById[4] = "PUSH_NAME"] = 4; + return values; + })(); + + return HistorySyncNotification; })(); - proto.RecentEmojiWeight = (function() { + proto.HSMCurrency = (function() { /** - * Properties of a RecentEmojiWeight. + * Properties of a HSMCurrency. * @memberof proto - * @interface IRecentEmojiWeight - * @property {string|null} [emoji] RecentEmojiWeight emoji - * @property {number|null} [weight] RecentEmojiWeight weight + * @interface IHSMCurrency + * @property {string|null} [currencyCode] HSMCurrency currencyCode + * @property {number|Long|null} [amount1000] HSMCurrency amount1000 */ /** - * Constructs a new RecentEmojiWeight. + * Constructs a new HSMCurrency. * @memberof proto - * @classdesc Represents a RecentEmojiWeight. - * @implements IRecentEmojiWeight + * @classdesc Represents a HSMCurrency. + * @implements IHSMCurrency * @constructor - * @param {proto.IRecentEmojiWeight=} [properties] Properties to set + * @param {proto.IHSMCurrency=} [properties] Properties to set */ - function RecentEmojiWeight(properties) { + function HSMCurrency(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -13394,88 +13934,88 @@ $root.proto = (function() { } /** - * RecentEmojiWeight emoji. - * @member {string} emoji - * @memberof proto.RecentEmojiWeight + * HSMCurrency currencyCode. + * @member {string} currencyCode + * @memberof proto.HSMCurrency * @instance */ - RecentEmojiWeight.prototype.emoji = ""; + HSMCurrency.prototype.currencyCode = ""; /** - * RecentEmojiWeight weight. - * @member {number} weight - * @memberof proto.RecentEmojiWeight + * HSMCurrency amount1000. + * @member {number|Long} amount1000 + * @memberof proto.HSMCurrency * @instance */ - RecentEmojiWeight.prototype.weight = 0; + HSMCurrency.prototype.amount1000 = $util.Long ? $util.Long.fromBits(0,0,false) : 0; /** - * Creates a new RecentEmojiWeight instance using the specified properties. + * Creates a new HSMCurrency instance using the specified properties. * @function create - * @memberof proto.RecentEmojiWeight + * @memberof proto.HSMCurrency * @static - * @param {proto.IRecentEmojiWeight=} [properties] Properties to set - * @returns {proto.RecentEmojiWeight} RecentEmojiWeight instance + * @param {proto.IHSMCurrency=} [properties] Properties to set + * @returns {proto.HSMCurrency} HSMCurrency instance */ - RecentEmojiWeight.create = function create(properties) { - return new RecentEmojiWeight(properties); + HSMCurrency.create = function create(properties) { + return new HSMCurrency(properties); }; /** - * Encodes the specified RecentEmojiWeight message. Does not implicitly {@link proto.RecentEmojiWeight.verify|verify} messages. + * Encodes the specified HSMCurrency message. Does not implicitly {@link proto.HSMCurrency.verify|verify} messages. * @function encode - * @memberof proto.RecentEmojiWeight + * @memberof proto.HSMCurrency * @static - * @param {proto.IRecentEmojiWeight} message RecentEmojiWeight message or plain object to encode + * @param {proto.IHSMCurrency} message HSMCurrency message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - RecentEmojiWeight.encode = function encode(message, writer) { + HSMCurrency.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.emoji != null && Object.hasOwnProperty.call(message, "emoji")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.emoji); - if (message.weight != null && Object.hasOwnProperty.call(message, "weight")) - writer.uint32(/* id 2, wireType 5 =*/21).float(message.weight); + if (message.currencyCode != null && Object.hasOwnProperty.call(message, "currencyCode")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.currencyCode); + if (message.amount1000 != null && Object.hasOwnProperty.call(message, "amount1000")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.amount1000); return writer; }; /** - * Encodes the specified RecentEmojiWeight message, length delimited. Does not implicitly {@link proto.RecentEmojiWeight.verify|verify} messages. + * Encodes the specified HSMCurrency message, length delimited. Does not implicitly {@link proto.HSMCurrency.verify|verify} messages. * @function encodeDelimited - * @memberof proto.RecentEmojiWeight + * @memberof proto.HSMCurrency * @static - * @param {proto.IRecentEmojiWeight} message RecentEmojiWeight message or plain object to encode + * @param {proto.IHSMCurrency} message HSMCurrency message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - RecentEmojiWeight.encodeDelimited = function encodeDelimited(message, writer) { + HSMCurrency.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a RecentEmojiWeight message from the specified reader or buffer. + * Decodes a HSMCurrency message from the specified reader or buffer. * @function decode - * @memberof proto.RecentEmojiWeight + * @memberof proto.HSMCurrency * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {proto.RecentEmojiWeight} RecentEmojiWeight + * @returns {proto.HSMCurrency} HSMCurrency * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - RecentEmojiWeight.decode = function decode(reader, length) { + HSMCurrency.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.RecentEmojiWeight(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.HSMCurrency(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.emoji = reader.string(); + message.currencyCode = reader.string(); break; case 2: - message.weight = reader.float(); + message.amount1000 = reader.int64(); break; default: reader.skipType(tag & 7); @@ -13486,117 +14026,131 @@ $root.proto = (function() { }; /** - * Decodes a RecentEmojiWeight message from the specified reader or buffer, length delimited. + * Decodes a HSMCurrency message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof proto.RecentEmojiWeight + * @memberof proto.HSMCurrency * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.RecentEmojiWeight} RecentEmojiWeight + * @returns {proto.HSMCurrency} HSMCurrency * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - RecentEmojiWeight.decodeDelimited = function decodeDelimited(reader) { + HSMCurrency.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a RecentEmojiWeight message. + * Verifies a HSMCurrency message. * @function verify - * @memberof proto.RecentEmojiWeight + * @memberof proto.HSMCurrency * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - RecentEmojiWeight.verify = function verify(message) { + HSMCurrency.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.emoji != null && message.hasOwnProperty("emoji")) - if (!$util.isString(message.emoji)) - return "emoji: string expected"; - if (message.weight != null && message.hasOwnProperty("weight")) - if (typeof message.weight !== "number") - return "weight: number expected"; + if (message.currencyCode != null && message.hasOwnProperty("currencyCode")) + if (!$util.isString(message.currencyCode)) + return "currencyCode: string expected"; + if (message.amount1000 != null && message.hasOwnProperty("amount1000")) + if (!$util.isInteger(message.amount1000) && !(message.amount1000 && $util.isInteger(message.amount1000.low) && $util.isInteger(message.amount1000.high))) + return "amount1000: integer|Long expected"; return null; }; /** - * Creates a RecentEmojiWeight message from a plain object. Also converts values to their respective internal types. + * Creates a HSMCurrency message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof proto.RecentEmojiWeight + * @memberof proto.HSMCurrency * @static * @param {Object.} object Plain object - * @returns {proto.RecentEmojiWeight} RecentEmojiWeight + * @returns {proto.HSMCurrency} HSMCurrency */ - RecentEmojiWeight.fromObject = function fromObject(object) { - if (object instanceof $root.proto.RecentEmojiWeight) + HSMCurrency.fromObject = function fromObject(object) { + if (object instanceof $root.proto.HSMCurrency) return object; - var message = new $root.proto.RecentEmojiWeight(); - if (object.emoji != null) - message.emoji = String(object.emoji); - if (object.weight != null) - message.weight = Number(object.weight); + var message = new $root.proto.HSMCurrency(); + if (object.currencyCode != null) + message.currencyCode = String(object.currencyCode); + if (object.amount1000 != null) + if ($util.Long) + (message.amount1000 = $util.Long.fromValue(object.amount1000)).unsigned = false; + else if (typeof object.amount1000 === "string") + message.amount1000 = parseInt(object.amount1000, 10); + else if (typeof object.amount1000 === "number") + message.amount1000 = object.amount1000; + else if (typeof object.amount1000 === "object") + message.amount1000 = new $util.LongBits(object.amount1000.low >>> 0, object.amount1000.high >>> 0).toNumber(); return message; }; /** - * Creates a plain object from a RecentEmojiWeight message. Also converts values to other types if specified. + * Creates a plain object from a HSMCurrency message. Also converts values to other types if specified. * @function toObject - * @memberof proto.RecentEmojiWeight + * @memberof proto.HSMCurrency * @static - * @param {proto.RecentEmojiWeight} message RecentEmojiWeight + * @param {proto.HSMCurrency} message HSMCurrency * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - RecentEmojiWeight.toObject = function toObject(message, options) { + HSMCurrency.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.emoji = ""; - object.weight = 0; + object.currencyCode = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.amount1000 = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.amount1000 = options.longs === String ? "0" : 0; } - if (message.emoji != null && message.hasOwnProperty("emoji")) - object.emoji = message.emoji; - if (message.weight != null && message.hasOwnProperty("weight")) - object.weight = options.json && !isFinite(message.weight) ? String(message.weight) : message.weight; + if (message.currencyCode != null && message.hasOwnProperty("currencyCode")) + object.currencyCode = message.currencyCode; + if (message.amount1000 != null && message.hasOwnProperty("amount1000")) + if (typeof message.amount1000 === "number") + object.amount1000 = options.longs === String ? String(message.amount1000) : message.amount1000; + else + object.amount1000 = options.longs === String ? $util.Long.prototype.toString.call(message.amount1000) : options.longs === Number ? new $util.LongBits(message.amount1000.low >>> 0, message.amount1000.high >>> 0).toNumber() : message.amount1000; return object; }; /** - * Converts this RecentEmojiWeight to JSON. + * Converts this HSMCurrency to JSON. * @function toJSON - * @memberof proto.RecentEmojiWeight + * @memberof proto.HSMCurrency * @instance * @returns {Object.} JSON object */ - RecentEmojiWeight.prototype.toJSON = function toJSON() { + HSMCurrency.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return RecentEmojiWeight; + return HSMCurrency; })(); - proto.RecentStickerWeight = (function() { + proto.HSMDateTime = (function() { /** - * Properties of a RecentStickerWeight. + * Properties of a HSMDateTime. * @memberof proto - * @interface IRecentStickerWeight - * @property {string|null} [filehash] RecentStickerWeight filehash - * @property {number|null} [weight] RecentStickerWeight weight + * @interface IHSMDateTime + * @property {proto.IHSMDateTimeComponent|null} [component] HSMDateTime component + * @property {proto.IHSMDateTimeUnixEpoch|null} [unixEpoch] HSMDateTime unixEpoch */ /** - * Constructs a new RecentStickerWeight. + * Constructs a new HSMDateTime. * @memberof proto - * @classdesc Represents a RecentStickerWeight. - * @implements IRecentStickerWeight + * @classdesc Represents a HSMDateTime. + * @implements IHSMDateTime * @constructor - * @param {proto.IRecentStickerWeight=} [properties] Properties to set + * @param {proto.IHSMDateTime=} [properties] Properties to set */ - function RecentStickerWeight(properties) { + function HSMDateTime(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -13604,88 +14158,102 @@ $root.proto = (function() { } /** - * RecentStickerWeight filehash. - * @member {string} filehash - * @memberof proto.RecentStickerWeight + * HSMDateTime component. + * @member {proto.IHSMDateTimeComponent|null|undefined} component + * @memberof proto.HSMDateTime * @instance */ - RecentStickerWeight.prototype.filehash = ""; + HSMDateTime.prototype.component = null; /** - * RecentStickerWeight weight. - * @member {number} weight - * @memberof proto.RecentStickerWeight + * HSMDateTime unixEpoch. + * @member {proto.IHSMDateTimeUnixEpoch|null|undefined} unixEpoch + * @memberof proto.HSMDateTime * @instance */ - RecentStickerWeight.prototype.weight = 0; + HSMDateTime.prototype.unixEpoch = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; /** - * Creates a new RecentStickerWeight instance using the specified properties. - * @function create - * @memberof proto.RecentStickerWeight - * @static - * @param {proto.IRecentStickerWeight=} [properties] Properties to set - * @returns {proto.RecentStickerWeight} RecentStickerWeight instance - */ - RecentStickerWeight.create = function create(properties) { - return new RecentStickerWeight(properties); + * HSMDateTime datetimeOneof. + * @member {"component"|"unixEpoch"|undefined} datetimeOneof + * @memberof proto.HSMDateTime + * @instance + */ + Object.defineProperty(HSMDateTime.prototype, "datetimeOneof", { + get: $util.oneOfGetter($oneOfFields = ["component", "unixEpoch"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new HSMDateTime instance using the specified properties. + * @function create + * @memberof proto.HSMDateTime + * @static + * @param {proto.IHSMDateTime=} [properties] Properties to set + * @returns {proto.HSMDateTime} HSMDateTime instance + */ + HSMDateTime.create = function create(properties) { + return new HSMDateTime(properties); }; /** - * Encodes the specified RecentStickerWeight message. Does not implicitly {@link proto.RecentStickerWeight.verify|verify} messages. + * Encodes the specified HSMDateTime message. Does not implicitly {@link proto.HSMDateTime.verify|verify} messages. * @function encode - * @memberof proto.RecentStickerWeight + * @memberof proto.HSMDateTime * @static - * @param {proto.IRecentStickerWeight} message RecentStickerWeight message or plain object to encode + * @param {proto.IHSMDateTime} message HSMDateTime message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - RecentStickerWeight.encode = function encode(message, writer) { + HSMDateTime.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.filehash != null && Object.hasOwnProperty.call(message, "filehash")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.filehash); - if (message.weight != null && Object.hasOwnProperty.call(message, "weight")) - writer.uint32(/* id 2, wireType 5 =*/21).float(message.weight); + if (message.component != null && Object.hasOwnProperty.call(message, "component")) + $root.proto.HSMDateTimeComponent.encode(message.component, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.unixEpoch != null && Object.hasOwnProperty.call(message, "unixEpoch")) + $root.proto.HSMDateTimeUnixEpoch.encode(message.unixEpoch, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** - * Encodes the specified RecentStickerWeight message, length delimited. Does not implicitly {@link proto.RecentStickerWeight.verify|verify} messages. + * Encodes the specified HSMDateTime message, length delimited. Does not implicitly {@link proto.HSMDateTime.verify|verify} messages. * @function encodeDelimited - * @memberof proto.RecentStickerWeight + * @memberof proto.HSMDateTime * @static - * @param {proto.IRecentStickerWeight} message RecentStickerWeight message or plain object to encode + * @param {proto.IHSMDateTime} message HSMDateTime message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - RecentStickerWeight.encodeDelimited = function encodeDelimited(message, writer) { + HSMDateTime.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a RecentStickerWeight message from the specified reader or buffer. + * Decodes a HSMDateTime message from the specified reader or buffer. * @function decode - * @memberof proto.RecentStickerWeight + * @memberof proto.HSMDateTime * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {proto.RecentStickerWeight} RecentStickerWeight + * @returns {proto.HSMDateTime} HSMDateTime * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - RecentStickerWeight.decode = function decode(reader, length) { + HSMDateTime.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.RecentStickerWeight(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.HSMDateTime(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.filehash = reader.string(); + message.component = $root.proto.HSMDateTimeComponent.decode(reader, reader.uint32()); break; case 2: - message.weight = reader.float(); + message.unixEpoch = $root.proto.HSMDateTimeUnixEpoch.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -13696,124 +14264,143 @@ $root.proto = (function() { }; /** - * Decodes a RecentStickerWeight message from the specified reader or buffer, length delimited. + * Decodes a HSMDateTime message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof proto.RecentStickerWeight + * @memberof proto.HSMDateTime * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.RecentStickerWeight} RecentStickerWeight + * @returns {proto.HSMDateTime} HSMDateTime * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - RecentStickerWeight.decodeDelimited = function decodeDelimited(reader) { + HSMDateTime.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a RecentStickerWeight message. + * Verifies a HSMDateTime message. * @function verify - * @memberof proto.RecentStickerWeight + * @memberof proto.HSMDateTime * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - RecentStickerWeight.verify = function verify(message) { + HSMDateTime.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.filehash != null && message.hasOwnProperty("filehash")) - if (!$util.isString(message.filehash)) - return "filehash: string expected"; - if (message.weight != null && message.hasOwnProperty("weight")) - if (typeof message.weight !== "number") - return "weight: number expected"; + var properties = {}; + if (message.component != null && message.hasOwnProperty("component")) { + properties.datetimeOneof = 1; + { + var error = $root.proto.HSMDateTimeComponent.verify(message.component); + if (error) + return "component." + error; + } + } + if (message.unixEpoch != null && message.hasOwnProperty("unixEpoch")) { + if (properties.datetimeOneof === 1) + return "datetimeOneof: multiple values"; + properties.datetimeOneof = 1; + { + var error = $root.proto.HSMDateTimeUnixEpoch.verify(message.unixEpoch); + if (error) + return "unixEpoch." + error; + } + } return null; }; /** - * Creates a RecentStickerWeight message from a plain object. Also converts values to their respective internal types. + * Creates a HSMDateTime message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof proto.RecentStickerWeight + * @memberof proto.HSMDateTime * @static * @param {Object.} object Plain object - * @returns {proto.RecentStickerWeight} RecentStickerWeight + * @returns {proto.HSMDateTime} HSMDateTime */ - RecentStickerWeight.fromObject = function fromObject(object) { - if (object instanceof $root.proto.RecentStickerWeight) + HSMDateTime.fromObject = function fromObject(object) { + if (object instanceof $root.proto.HSMDateTime) return object; - var message = new $root.proto.RecentStickerWeight(); - if (object.filehash != null) - message.filehash = String(object.filehash); - if (object.weight != null) - message.weight = Number(object.weight); + var message = new $root.proto.HSMDateTime(); + if (object.component != null) { + if (typeof object.component !== "object") + throw TypeError(".proto.HSMDateTime.component: object expected"); + message.component = $root.proto.HSMDateTimeComponent.fromObject(object.component); + } + if (object.unixEpoch != null) { + if (typeof object.unixEpoch !== "object") + throw TypeError(".proto.HSMDateTime.unixEpoch: object expected"); + message.unixEpoch = $root.proto.HSMDateTimeUnixEpoch.fromObject(object.unixEpoch); + } return message; }; /** - * Creates a plain object from a RecentStickerWeight message. Also converts values to other types if specified. + * Creates a plain object from a HSMDateTime message. Also converts values to other types if specified. * @function toObject - * @memberof proto.RecentStickerWeight + * @memberof proto.HSMDateTime * @static - * @param {proto.RecentStickerWeight} message RecentStickerWeight + * @param {proto.HSMDateTime} message HSMDateTime * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - RecentStickerWeight.toObject = function toObject(message, options) { + HSMDateTime.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.filehash = ""; - object.weight = 0; + if (message.component != null && message.hasOwnProperty("component")) { + object.component = $root.proto.HSMDateTimeComponent.toObject(message.component, options); + if (options.oneofs) + object.datetimeOneof = "component"; + } + if (message.unixEpoch != null && message.hasOwnProperty("unixEpoch")) { + object.unixEpoch = $root.proto.HSMDateTimeUnixEpoch.toObject(message.unixEpoch, options); + if (options.oneofs) + object.datetimeOneof = "unixEpoch"; } - if (message.filehash != null && message.hasOwnProperty("filehash")) - object.filehash = message.filehash; - if (message.weight != null && message.hasOwnProperty("weight")) - object.weight = options.json && !isFinite(message.weight) ? String(message.weight) : message.weight; return object; }; /** - * Converts this RecentStickerWeight to JSON. + * Converts this HSMDateTime to JSON. * @function toJSON - * @memberof proto.RecentStickerWeight + * @memberof proto.HSMDateTime * @instance * @returns {Object.} JSON object */ - RecentStickerWeight.prototype.toJSON = function toJSON() { + HSMDateTime.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return RecentStickerWeight; + return HSMDateTime; })(); - proto.SyncdPatch = (function() { + proto.HSMDateTimeComponent = (function() { /** - * Properties of a SyncdPatch. + * Properties of a HSMDateTimeComponent. * @memberof proto - * @interface ISyncdPatch - * @property {proto.ISyncdVersion|null} [version] SyncdPatch version - * @property {Array.|null} [mutations] SyncdPatch mutations - * @property {proto.IExternalBlobReference|null} [externalMutations] SyncdPatch externalMutations - * @property {Uint8Array|null} [snapshotMac] SyncdPatch snapshotMac - * @property {Uint8Array|null} [patchMac] SyncdPatch patchMac - * @property {proto.IKeyId|null} [keyId] SyncdPatch keyId - * @property {proto.IExitCode|null} [exitCode] SyncdPatch exitCode - * @property {number|null} [deviceIndex] SyncdPatch deviceIndex + * @interface IHSMDateTimeComponent + * @property {proto.HSMDateTimeComponent.HSMDateTimeComponentDayOfWeekType|null} [dayOfWeek] HSMDateTimeComponent dayOfWeek + * @property {number|null} [year] HSMDateTimeComponent year + * @property {number|null} [month] HSMDateTimeComponent month + * @property {number|null} [dayOfMonth] HSMDateTimeComponent dayOfMonth + * @property {number|null} [hour] HSMDateTimeComponent hour + * @property {number|null} [minute] HSMDateTimeComponent minute + * @property {proto.HSMDateTimeComponent.HSMDateTimeComponentCalendarType|null} [calendar] HSMDateTimeComponent calendar */ /** - * Constructs a new SyncdPatch. + * Constructs a new HSMDateTimeComponent. * @memberof proto - * @classdesc Represents a SyncdPatch. - * @implements ISyncdPatch + * @classdesc Represents a HSMDateTimeComponent. + * @implements IHSMDateTimeComponent * @constructor - * @param {proto.ISyncdPatch=} [properties] Properties to set + * @param {proto.IHSMDateTimeComponent=} [properties] Properties to set */ - function SyncdPatch(properties) { - this.mutations = []; + function HSMDateTimeComponent(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -13821,169 +14408,153 @@ $root.proto = (function() { } /** - * SyncdPatch version. - * @member {proto.ISyncdVersion|null|undefined} version - * @memberof proto.SyncdPatch - * @instance - */ - SyncdPatch.prototype.version = null; - - /** - * SyncdPatch mutations. - * @member {Array.} mutations - * @memberof proto.SyncdPatch + * HSMDateTimeComponent dayOfWeek. + * @member {proto.HSMDateTimeComponent.HSMDateTimeComponentDayOfWeekType} dayOfWeek + * @memberof proto.HSMDateTimeComponent * @instance */ - SyncdPatch.prototype.mutations = $util.emptyArray; + HSMDateTimeComponent.prototype.dayOfWeek = 1; /** - * SyncdPatch externalMutations. - * @member {proto.IExternalBlobReference|null|undefined} externalMutations - * @memberof proto.SyncdPatch + * HSMDateTimeComponent year. + * @member {number} year + * @memberof proto.HSMDateTimeComponent * @instance */ - SyncdPatch.prototype.externalMutations = null; + HSMDateTimeComponent.prototype.year = 0; /** - * SyncdPatch snapshotMac. - * @member {Uint8Array} snapshotMac - * @memberof proto.SyncdPatch + * HSMDateTimeComponent month. + * @member {number} month + * @memberof proto.HSMDateTimeComponent * @instance */ - SyncdPatch.prototype.snapshotMac = $util.newBuffer([]); + HSMDateTimeComponent.prototype.month = 0; /** - * SyncdPatch patchMac. - * @member {Uint8Array} patchMac - * @memberof proto.SyncdPatch + * HSMDateTimeComponent dayOfMonth. + * @member {number} dayOfMonth + * @memberof proto.HSMDateTimeComponent * @instance */ - SyncdPatch.prototype.patchMac = $util.newBuffer([]); + HSMDateTimeComponent.prototype.dayOfMonth = 0; /** - * SyncdPatch keyId. - * @member {proto.IKeyId|null|undefined} keyId - * @memberof proto.SyncdPatch + * HSMDateTimeComponent hour. + * @member {number} hour + * @memberof proto.HSMDateTimeComponent * @instance */ - SyncdPatch.prototype.keyId = null; + HSMDateTimeComponent.prototype.hour = 0; /** - * SyncdPatch exitCode. - * @member {proto.IExitCode|null|undefined} exitCode - * @memberof proto.SyncdPatch + * HSMDateTimeComponent minute. + * @member {number} minute + * @memberof proto.HSMDateTimeComponent * @instance */ - SyncdPatch.prototype.exitCode = null; + HSMDateTimeComponent.prototype.minute = 0; /** - * SyncdPatch deviceIndex. - * @member {number} deviceIndex - * @memberof proto.SyncdPatch + * HSMDateTimeComponent calendar. + * @member {proto.HSMDateTimeComponent.HSMDateTimeComponentCalendarType} calendar + * @memberof proto.HSMDateTimeComponent * @instance */ - SyncdPatch.prototype.deviceIndex = 0; + HSMDateTimeComponent.prototype.calendar = 1; /** - * Creates a new SyncdPatch instance using the specified properties. + * Creates a new HSMDateTimeComponent instance using the specified properties. * @function create - * @memberof proto.SyncdPatch + * @memberof proto.HSMDateTimeComponent * @static - * @param {proto.ISyncdPatch=} [properties] Properties to set - * @returns {proto.SyncdPatch} SyncdPatch instance + * @param {proto.IHSMDateTimeComponent=} [properties] Properties to set + * @returns {proto.HSMDateTimeComponent} HSMDateTimeComponent instance */ - SyncdPatch.create = function create(properties) { - return new SyncdPatch(properties); + HSMDateTimeComponent.create = function create(properties) { + return new HSMDateTimeComponent(properties); }; /** - * Encodes the specified SyncdPatch message. Does not implicitly {@link proto.SyncdPatch.verify|verify} messages. + * Encodes the specified HSMDateTimeComponent message. Does not implicitly {@link proto.HSMDateTimeComponent.verify|verify} messages. * @function encode - * @memberof proto.SyncdPatch + * @memberof proto.HSMDateTimeComponent * @static - * @param {proto.ISyncdPatch} message SyncdPatch message or plain object to encode + * @param {proto.IHSMDateTimeComponent} message HSMDateTimeComponent message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SyncdPatch.encode = function encode(message, writer) { + HSMDateTimeComponent.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.version != null && Object.hasOwnProperty.call(message, "version")) - $root.proto.SyncdVersion.encode(message.version, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.mutations != null && message.mutations.length) - for (var i = 0; i < message.mutations.length; ++i) - $root.proto.SyncdMutation.encode(message.mutations[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.externalMutations != null && Object.hasOwnProperty.call(message, "externalMutations")) - $root.proto.ExternalBlobReference.encode(message.externalMutations, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.snapshotMac != null && Object.hasOwnProperty.call(message, "snapshotMac")) - writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.snapshotMac); - if (message.patchMac != null && Object.hasOwnProperty.call(message, "patchMac")) - writer.uint32(/* id 5, wireType 2 =*/42).bytes(message.patchMac); - if (message.keyId != null && Object.hasOwnProperty.call(message, "keyId")) - $root.proto.KeyId.encode(message.keyId, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.exitCode != null && Object.hasOwnProperty.call(message, "exitCode")) - $root.proto.ExitCode.encode(message.exitCode, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.deviceIndex != null && Object.hasOwnProperty.call(message, "deviceIndex")) - writer.uint32(/* id 8, wireType 0 =*/64).uint32(message.deviceIndex); + if (message.dayOfWeek != null && Object.hasOwnProperty.call(message, "dayOfWeek")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.dayOfWeek); + if (message.year != null && Object.hasOwnProperty.call(message, "year")) + writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.year); + if (message.month != null && Object.hasOwnProperty.call(message, "month")) + writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.month); + if (message.dayOfMonth != null && Object.hasOwnProperty.call(message, "dayOfMonth")) + writer.uint32(/* id 4, wireType 0 =*/32).uint32(message.dayOfMonth); + if (message.hour != null && Object.hasOwnProperty.call(message, "hour")) + writer.uint32(/* id 5, wireType 0 =*/40).uint32(message.hour); + if (message.minute != null && Object.hasOwnProperty.call(message, "minute")) + writer.uint32(/* id 6, wireType 0 =*/48).uint32(message.minute); + if (message.calendar != null && Object.hasOwnProperty.call(message, "calendar")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.calendar); return writer; }; /** - * Encodes the specified SyncdPatch message, length delimited. Does not implicitly {@link proto.SyncdPatch.verify|verify} messages. + * Encodes the specified HSMDateTimeComponent message, length delimited. Does not implicitly {@link proto.HSMDateTimeComponent.verify|verify} messages. * @function encodeDelimited - * @memberof proto.SyncdPatch + * @memberof proto.HSMDateTimeComponent * @static - * @param {proto.ISyncdPatch} message SyncdPatch message or plain object to encode + * @param {proto.IHSMDateTimeComponent} message HSMDateTimeComponent message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SyncdPatch.encodeDelimited = function encodeDelimited(message, writer) { + HSMDateTimeComponent.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a SyncdPatch message from the specified reader or buffer. + * Decodes a HSMDateTimeComponent message from the specified reader or buffer. * @function decode - * @memberof proto.SyncdPatch + * @memberof proto.HSMDateTimeComponent * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {proto.SyncdPatch} SyncdPatch + * @returns {proto.HSMDateTimeComponent} HSMDateTimeComponent * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SyncdPatch.decode = function decode(reader, length) { + HSMDateTimeComponent.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.SyncdPatch(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.HSMDateTimeComponent(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.version = $root.proto.SyncdVersion.decode(reader, reader.uint32()); + message.dayOfWeek = reader.int32(); break; case 2: - if (!(message.mutations && message.mutations.length)) - message.mutations = []; - message.mutations.push($root.proto.SyncdMutation.decode(reader, reader.uint32())); + message.year = reader.uint32(); break; case 3: - message.externalMutations = $root.proto.ExternalBlobReference.decode(reader, reader.uint32()); + message.month = reader.uint32(); break; case 4: - message.snapshotMac = reader.bytes(); + message.dayOfMonth = reader.uint32(); break; case 5: - message.patchMac = reader.bytes(); + message.hour = reader.uint32(); break; case 6: - message.keyId = $root.proto.KeyId.decode(reader, reader.uint32()); + message.minute = reader.uint32(); break; case 7: - message.exitCode = $root.proto.ExitCode.decode(reader, reader.uint32()); - break; - case 8: - message.deviceIndex = reader.uint32(); + message.calendar = reader.int32(); break; default: reader.skipType(tag & 7); @@ -13994,221 +14565,245 @@ $root.proto = (function() { }; /** - * Decodes a SyncdPatch message from the specified reader or buffer, length delimited. + * Decodes a HSMDateTimeComponent message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof proto.SyncdPatch + * @memberof proto.HSMDateTimeComponent * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.SyncdPatch} SyncdPatch + * @returns {proto.HSMDateTimeComponent} HSMDateTimeComponent * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SyncdPatch.decodeDelimited = function decodeDelimited(reader) { + HSMDateTimeComponent.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a SyncdPatch message. + * Verifies a HSMDateTimeComponent message. * @function verify - * @memberof proto.SyncdPatch + * @memberof proto.HSMDateTimeComponent * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - SyncdPatch.verify = function verify(message) { + HSMDateTimeComponent.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.version != null && message.hasOwnProperty("version")) { - var error = $root.proto.SyncdVersion.verify(message.version); - if (error) - return "version." + error; - } - if (message.mutations != null && message.hasOwnProperty("mutations")) { - if (!Array.isArray(message.mutations)) - return "mutations: array expected"; - for (var i = 0; i < message.mutations.length; ++i) { - var error = $root.proto.SyncdMutation.verify(message.mutations[i]); - if (error) - return "mutations." + error; + if (message.dayOfWeek != null && message.hasOwnProperty("dayOfWeek")) + switch (message.dayOfWeek) { + default: + return "dayOfWeek: enum value expected"; + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + break; + } + if (message.year != null && message.hasOwnProperty("year")) + if (!$util.isInteger(message.year)) + return "year: integer expected"; + if (message.month != null && message.hasOwnProperty("month")) + if (!$util.isInteger(message.month)) + return "month: integer expected"; + if (message.dayOfMonth != null && message.hasOwnProperty("dayOfMonth")) + if (!$util.isInteger(message.dayOfMonth)) + return "dayOfMonth: integer expected"; + if (message.hour != null && message.hasOwnProperty("hour")) + if (!$util.isInteger(message.hour)) + return "hour: integer expected"; + if (message.minute != null && message.hasOwnProperty("minute")) + if (!$util.isInteger(message.minute)) + return "minute: integer expected"; + if (message.calendar != null && message.hasOwnProperty("calendar")) + switch (message.calendar) { + default: + return "calendar: enum value expected"; + case 1: + case 2: + break; } - } - if (message.externalMutations != null && message.hasOwnProperty("externalMutations")) { - var error = $root.proto.ExternalBlobReference.verify(message.externalMutations); - if (error) - return "externalMutations." + error; - } - if (message.snapshotMac != null && message.hasOwnProperty("snapshotMac")) - if (!(message.snapshotMac && typeof message.snapshotMac.length === "number" || $util.isString(message.snapshotMac))) - return "snapshotMac: buffer expected"; - if (message.patchMac != null && message.hasOwnProperty("patchMac")) - if (!(message.patchMac && typeof message.patchMac.length === "number" || $util.isString(message.patchMac))) - return "patchMac: buffer expected"; - if (message.keyId != null && message.hasOwnProperty("keyId")) { - var error = $root.proto.KeyId.verify(message.keyId); - if (error) - return "keyId." + error; - } - if (message.exitCode != null && message.hasOwnProperty("exitCode")) { - var error = $root.proto.ExitCode.verify(message.exitCode); - if (error) - return "exitCode." + error; - } - if (message.deviceIndex != null && message.hasOwnProperty("deviceIndex")) - if (!$util.isInteger(message.deviceIndex)) - return "deviceIndex: integer expected"; return null; }; /** - * Creates a SyncdPatch message from a plain object. Also converts values to their respective internal types. + * Creates a HSMDateTimeComponent message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof proto.SyncdPatch + * @memberof proto.HSMDateTimeComponent * @static * @param {Object.} object Plain object - * @returns {proto.SyncdPatch} SyncdPatch + * @returns {proto.HSMDateTimeComponent} HSMDateTimeComponent */ - SyncdPatch.fromObject = function fromObject(object) { - if (object instanceof $root.proto.SyncdPatch) + HSMDateTimeComponent.fromObject = function fromObject(object) { + if (object instanceof $root.proto.HSMDateTimeComponent) return object; - var message = new $root.proto.SyncdPatch(); - if (object.version != null) { - if (typeof object.version !== "object") - throw TypeError(".proto.SyncdPatch.version: object expected"); - message.version = $root.proto.SyncdVersion.fromObject(object.version); - } - if (object.mutations) { - if (!Array.isArray(object.mutations)) - throw TypeError(".proto.SyncdPatch.mutations: array expected"); - message.mutations = []; - for (var i = 0; i < object.mutations.length; ++i) { - if (typeof object.mutations[i] !== "object") - throw TypeError(".proto.SyncdPatch.mutations: object expected"); - message.mutations[i] = $root.proto.SyncdMutation.fromObject(object.mutations[i]); - } + var message = new $root.proto.HSMDateTimeComponent(); + switch (object.dayOfWeek) { + case "MONDAY": + case 1: + message.dayOfWeek = 1; + break; + case "TUESDAY": + case 2: + message.dayOfWeek = 2; + break; + case "WEDNESDAY": + case 3: + message.dayOfWeek = 3; + break; + case "THURSDAY": + case 4: + message.dayOfWeek = 4; + break; + case "FRIDAY": + case 5: + message.dayOfWeek = 5; + break; + case "SATURDAY": + case 6: + message.dayOfWeek = 6; + break; + case "SUNDAY": + case 7: + message.dayOfWeek = 7; + break; } - if (object.externalMutations != null) { - if (typeof object.externalMutations !== "object") - throw TypeError(".proto.SyncdPatch.externalMutations: object expected"); - message.externalMutations = $root.proto.ExternalBlobReference.fromObject(object.externalMutations); + if (object.year != null) + message.year = object.year >>> 0; + if (object.month != null) + message.month = object.month >>> 0; + if (object.dayOfMonth != null) + message.dayOfMonth = object.dayOfMonth >>> 0; + if (object.hour != null) + message.hour = object.hour >>> 0; + if (object.minute != null) + message.minute = object.minute >>> 0; + switch (object.calendar) { + case "GREGORIAN": + case 1: + message.calendar = 1; + break; + case "SOLAR_HIJRI": + case 2: + message.calendar = 2; + break; } - if (object.snapshotMac != null) - if (typeof object.snapshotMac === "string") - $util.base64.decode(object.snapshotMac, message.snapshotMac = $util.newBuffer($util.base64.length(object.snapshotMac)), 0); - else if (object.snapshotMac.length) - message.snapshotMac = object.snapshotMac; - if (object.patchMac != null) - if (typeof object.patchMac === "string") - $util.base64.decode(object.patchMac, message.patchMac = $util.newBuffer($util.base64.length(object.patchMac)), 0); - else if (object.patchMac.length) - message.patchMac = object.patchMac; - if (object.keyId != null) { - if (typeof object.keyId !== "object") - throw TypeError(".proto.SyncdPatch.keyId: object expected"); - message.keyId = $root.proto.KeyId.fromObject(object.keyId); - } - if (object.exitCode != null) { - if (typeof object.exitCode !== "object") - throw TypeError(".proto.SyncdPatch.exitCode: object expected"); - message.exitCode = $root.proto.ExitCode.fromObject(object.exitCode); - } - if (object.deviceIndex != null) - message.deviceIndex = object.deviceIndex >>> 0; return message; }; /** - * Creates a plain object from a SyncdPatch message. Also converts values to other types if specified. + * Creates a plain object from a HSMDateTimeComponent message. Also converts values to other types if specified. * @function toObject - * @memberof proto.SyncdPatch + * @memberof proto.HSMDateTimeComponent * @static - * @param {proto.SyncdPatch} message SyncdPatch + * @param {proto.HSMDateTimeComponent} message HSMDateTimeComponent * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SyncdPatch.toObject = function toObject(message, options) { + HSMDateTimeComponent.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.mutations = []; if (options.defaults) { - object.version = null; - object.externalMutations = null; - if (options.bytes === String) - object.snapshotMac = ""; - else { - object.snapshotMac = []; - if (options.bytes !== Array) - object.snapshotMac = $util.newBuffer(object.snapshotMac); - } - if (options.bytes === String) - object.patchMac = ""; - else { - object.patchMac = []; - if (options.bytes !== Array) - object.patchMac = $util.newBuffer(object.patchMac); - } - object.keyId = null; - object.exitCode = null; - object.deviceIndex = 0; - } - if (message.version != null && message.hasOwnProperty("version")) - object.version = $root.proto.SyncdVersion.toObject(message.version, options); - if (message.mutations && message.mutations.length) { - object.mutations = []; - for (var j = 0; j < message.mutations.length; ++j) - object.mutations[j] = $root.proto.SyncdMutation.toObject(message.mutations[j], options); + object.dayOfWeek = options.enums === String ? "MONDAY" : 1; + object.year = 0; + object.month = 0; + object.dayOfMonth = 0; + object.hour = 0; + object.minute = 0; + object.calendar = options.enums === String ? "GREGORIAN" : 1; } - if (message.externalMutations != null && message.hasOwnProperty("externalMutations")) - object.externalMutations = $root.proto.ExternalBlobReference.toObject(message.externalMutations, options); - if (message.snapshotMac != null && message.hasOwnProperty("snapshotMac")) - object.snapshotMac = options.bytes === String ? $util.base64.encode(message.snapshotMac, 0, message.snapshotMac.length) : options.bytes === Array ? Array.prototype.slice.call(message.snapshotMac) : message.snapshotMac; - if (message.patchMac != null && message.hasOwnProperty("patchMac")) - object.patchMac = options.bytes === String ? $util.base64.encode(message.patchMac, 0, message.patchMac.length) : options.bytes === Array ? Array.prototype.slice.call(message.patchMac) : message.patchMac; - if (message.keyId != null && message.hasOwnProperty("keyId")) - object.keyId = $root.proto.KeyId.toObject(message.keyId, options); - if (message.exitCode != null && message.hasOwnProperty("exitCode")) - object.exitCode = $root.proto.ExitCode.toObject(message.exitCode, options); - if (message.deviceIndex != null && message.hasOwnProperty("deviceIndex")) - object.deviceIndex = message.deviceIndex; + if (message.dayOfWeek != null && message.hasOwnProperty("dayOfWeek")) + object.dayOfWeek = options.enums === String ? $root.proto.HSMDateTimeComponent.HSMDateTimeComponentDayOfWeekType[message.dayOfWeek] : message.dayOfWeek; + if (message.year != null && message.hasOwnProperty("year")) + object.year = message.year; + if (message.month != null && message.hasOwnProperty("month")) + object.month = message.month; + if (message.dayOfMonth != null && message.hasOwnProperty("dayOfMonth")) + object.dayOfMonth = message.dayOfMonth; + if (message.hour != null && message.hasOwnProperty("hour")) + object.hour = message.hour; + if (message.minute != null && message.hasOwnProperty("minute")) + object.minute = message.minute; + if (message.calendar != null && message.hasOwnProperty("calendar")) + object.calendar = options.enums === String ? $root.proto.HSMDateTimeComponent.HSMDateTimeComponentCalendarType[message.calendar] : message.calendar; return object; }; /** - * Converts this SyncdPatch to JSON. + * Converts this HSMDateTimeComponent to JSON. * @function toJSON - * @memberof proto.SyncdPatch + * @memberof proto.HSMDateTimeComponent * @instance * @returns {Object.} JSON object */ - SyncdPatch.prototype.toJSON = function toJSON() { + HSMDateTimeComponent.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return SyncdPatch; + /** + * HSMDateTimeComponentDayOfWeekType enum. + * @name proto.HSMDateTimeComponent.HSMDateTimeComponentDayOfWeekType + * @enum {number} + * @property {number} MONDAY=1 MONDAY value + * @property {number} TUESDAY=2 TUESDAY value + * @property {number} WEDNESDAY=3 WEDNESDAY value + * @property {number} THURSDAY=4 THURSDAY value + * @property {number} FRIDAY=5 FRIDAY value + * @property {number} SATURDAY=6 SATURDAY value + * @property {number} SUNDAY=7 SUNDAY value + */ + HSMDateTimeComponent.HSMDateTimeComponentDayOfWeekType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "MONDAY"] = 1; + values[valuesById[2] = "TUESDAY"] = 2; + values[valuesById[3] = "WEDNESDAY"] = 3; + values[valuesById[4] = "THURSDAY"] = 4; + values[valuesById[5] = "FRIDAY"] = 5; + values[valuesById[6] = "SATURDAY"] = 6; + values[valuesById[7] = "SUNDAY"] = 7; + return values; + })(); + + /** + * HSMDateTimeComponentCalendarType enum. + * @name proto.HSMDateTimeComponent.HSMDateTimeComponentCalendarType + * @enum {number} + * @property {number} GREGORIAN=1 GREGORIAN value + * @property {number} SOLAR_HIJRI=2 SOLAR_HIJRI value + */ + HSMDateTimeComponent.HSMDateTimeComponentCalendarType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "GREGORIAN"] = 1; + values[valuesById[2] = "SOLAR_HIJRI"] = 2; + return values; + })(); + + return HSMDateTimeComponent; })(); - proto.SyncdMutation = (function() { + proto.HSMDateTimeUnixEpoch = (function() { /** - * Properties of a SyncdMutation. + * Properties of a HSMDateTimeUnixEpoch. * @memberof proto - * @interface ISyncdMutation - * @property {proto.SyncdMutation.SyncdMutationSyncdOperation|null} [operation] SyncdMutation operation - * @property {proto.ISyncdRecord|null} [record] SyncdMutation record + * @interface IHSMDateTimeUnixEpoch + * @property {number|Long|null} [timestamp] HSMDateTimeUnixEpoch timestamp */ /** - * Constructs a new SyncdMutation. + * Constructs a new HSMDateTimeUnixEpoch. * @memberof proto - * @classdesc Represents a SyncdMutation. - * @implements ISyncdMutation + * @classdesc Represents a HSMDateTimeUnixEpoch. + * @implements IHSMDateTimeUnixEpoch * @constructor - * @param {proto.ISyncdMutation=} [properties] Properties to set + * @param {proto.IHSMDateTimeUnixEpoch=} [properties] Properties to set */ - function SyncdMutation(properties) { + function HSMDateTimeUnixEpoch(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -14216,88 +14811,75 @@ $root.proto = (function() { } /** - * SyncdMutation operation. - * @member {proto.SyncdMutation.SyncdMutationSyncdOperation} operation - * @memberof proto.SyncdMutation - * @instance - */ - SyncdMutation.prototype.operation = 0; - - /** - * SyncdMutation record. - * @member {proto.ISyncdRecord|null|undefined} record - * @memberof proto.SyncdMutation + * HSMDateTimeUnixEpoch timestamp. + * @member {number|Long} timestamp + * @memberof proto.HSMDateTimeUnixEpoch * @instance */ - SyncdMutation.prototype.record = null; + HSMDateTimeUnixEpoch.prototype.timestamp = $util.Long ? $util.Long.fromBits(0,0,false) : 0; /** - * Creates a new SyncdMutation instance using the specified properties. + * Creates a new HSMDateTimeUnixEpoch instance using the specified properties. * @function create - * @memberof proto.SyncdMutation + * @memberof proto.HSMDateTimeUnixEpoch * @static - * @param {proto.ISyncdMutation=} [properties] Properties to set - * @returns {proto.SyncdMutation} SyncdMutation instance + * @param {proto.IHSMDateTimeUnixEpoch=} [properties] Properties to set + * @returns {proto.HSMDateTimeUnixEpoch} HSMDateTimeUnixEpoch instance */ - SyncdMutation.create = function create(properties) { - return new SyncdMutation(properties); + HSMDateTimeUnixEpoch.create = function create(properties) { + return new HSMDateTimeUnixEpoch(properties); }; /** - * Encodes the specified SyncdMutation message. Does not implicitly {@link proto.SyncdMutation.verify|verify} messages. + * Encodes the specified HSMDateTimeUnixEpoch message. Does not implicitly {@link proto.HSMDateTimeUnixEpoch.verify|verify} messages. * @function encode - * @memberof proto.SyncdMutation + * @memberof proto.HSMDateTimeUnixEpoch * @static - * @param {proto.ISyncdMutation} message SyncdMutation message or plain object to encode + * @param {proto.IHSMDateTimeUnixEpoch} message HSMDateTimeUnixEpoch message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SyncdMutation.encode = function encode(message, writer) { + HSMDateTimeUnixEpoch.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.operation != null && Object.hasOwnProperty.call(message, "operation")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.operation); - if (message.record != null && Object.hasOwnProperty.call(message, "record")) - $root.proto.SyncdRecord.encode(message.record, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.timestamp != null && Object.hasOwnProperty.call(message, "timestamp")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.timestamp); return writer; }; /** - * Encodes the specified SyncdMutation message, length delimited. Does not implicitly {@link proto.SyncdMutation.verify|verify} messages. + * Encodes the specified HSMDateTimeUnixEpoch message, length delimited. Does not implicitly {@link proto.HSMDateTimeUnixEpoch.verify|verify} messages. * @function encodeDelimited - * @memberof proto.SyncdMutation + * @memberof proto.HSMDateTimeUnixEpoch * @static - * @param {proto.ISyncdMutation} message SyncdMutation message or plain object to encode + * @param {proto.IHSMDateTimeUnixEpoch} message HSMDateTimeUnixEpoch message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SyncdMutation.encodeDelimited = function encodeDelimited(message, writer) { + HSMDateTimeUnixEpoch.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a SyncdMutation message from the specified reader or buffer. + * Decodes a HSMDateTimeUnixEpoch message from the specified reader or buffer. * @function decode - * @memberof proto.SyncdMutation + * @memberof proto.HSMDateTimeUnixEpoch * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {proto.SyncdMutation} SyncdMutation + * @returns {proto.HSMDateTimeUnixEpoch} HSMDateTimeUnixEpoch * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SyncdMutation.decode = function decode(reader, length) { + HSMDateTimeUnixEpoch.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.SyncdMutation(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.HSMDateTimeUnixEpoch(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.operation = reader.int32(); - break; - case 2: - message.record = $root.proto.SyncdRecord.decode(reader, reader.uint32()); + message.timestamp = reader.int64(); break; default: reader.skipType(tag & 7); @@ -14308,149 +14890,123 @@ $root.proto = (function() { }; /** - * Decodes a SyncdMutation message from the specified reader or buffer, length delimited. + * Decodes a HSMDateTimeUnixEpoch message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof proto.SyncdMutation + * @memberof proto.HSMDateTimeUnixEpoch * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.SyncdMutation} SyncdMutation + * @returns {proto.HSMDateTimeUnixEpoch} HSMDateTimeUnixEpoch * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SyncdMutation.decodeDelimited = function decodeDelimited(reader) { + HSMDateTimeUnixEpoch.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a SyncdMutation message. + * Verifies a HSMDateTimeUnixEpoch message. * @function verify - * @memberof proto.SyncdMutation + * @memberof proto.HSMDateTimeUnixEpoch * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - SyncdMutation.verify = function verify(message) { + HSMDateTimeUnixEpoch.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.operation != null && message.hasOwnProperty("operation")) - switch (message.operation) { - default: - return "operation: enum value expected"; - case 0: - case 1: - break; - } - if (message.record != null && message.hasOwnProperty("record")) { - var error = $root.proto.SyncdRecord.verify(message.record); - if (error) - return "record." + error; - } + if (message.timestamp != null && message.hasOwnProperty("timestamp")) + if (!$util.isInteger(message.timestamp) && !(message.timestamp && $util.isInteger(message.timestamp.low) && $util.isInteger(message.timestamp.high))) + return "timestamp: integer|Long expected"; return null; }; /** - * Creates a SyncdMutation message from a plain object. Also converts values to their respective internal types. + * Creates a HSMDateTimeUnixEpoch message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof proto.SyncdMutation + * @memberof proto.HSMDateTimeUnixEpoch * @static * @param {Object.} object Plain object - * @returns {proto.SyncdMutation} SyncdMutation + * @returns {proto.HSMDateTimeUnixEpoch} HSMDateTimeUnixEpoch */ - SyncdMutation.fromObject = function fromObject(object) { - if (object instanceof $root.proto.SyncdMutation) + HSMDateTimeUnixEpoch.fromObject = function fromObject(object) { + if (object instanceof $root.proto.HSMDateTimeUnixEpoch) return object; - var message = new $root.proto.SyncdMutation(); - switch (object.operation) { - case "SET": - case 0: - message.operation = 0; - break; - case "REMOVE": - case 1: - message.operation = 1; - break; - } - if (object.record != null) { - if (typeof object.record !== "object") - throw TypeError(".proto.SyncdMutation.record: object expected"); - message.record = $root.proto.SyncdRecord.fromObject(object.record); - } + var message = new $root.proto.HSMDateTimeUnixEpoch(); + if (object.timestamp != null) + if ($util.Long) + (message.timestamp = $util.Long.fromValue(object.timestamp)).unsigned = false; + else if (typeof object.timestamp === "string") + message.timestamp = parseInt(object.timestamp, 10); + else if (typeof object.timestamp === "number") + message.timestamp = object.timestamp; + else if (typeof object.timestamp === "object") + message.timestamp = new $util.LongBits(object.timestamp.low >>> 0, object.timestamp.high >>> 0).toNumber(); return message; }; /** - * Creates a plain object from a SyncdMutation message. Also converts values to other types if specified. + * Creates a plain object from a HSMDateTimeUnixEpoch message. Also converts values to other types if specified. * @function toObject - * @memberof proto.SyncdMutation + * @memberof proto.HSMDateTimeUnixEpoch * @static - * @param {proto.SyncdMutation} message SyncdMutation + * @param {proto.HSMDateTimeUnixEpoch} message HSMDateTimeUnixEpoch * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SyncdMutation.toObject = function toObject(message, options) { + HSMDateTimeUnixEpoch.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.operation = options.enums === String ? "SET" : 0; - object.record = null; - } - if (message.operation != null && message.hasOwnProperty("operation")) - object.operation = options.enums === String ? $root.proto.SyncdMutation.SyncdMutationSyncdOperation[message.operation] : message.operation; - if (message.record != null && message.hasOwnProperty("record")) - object.record = $root.proto.SyncdRecord.toObject(message.record, options); + if (options.defaults) + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.timestamp = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.timestamp = options.longs === String ? "0" : 0; + if (message.timestamp != null && message.hasOwnProperty("timestamp")) + if (typeof message.timestamp === "number") + object.timestamp = options.longs === String ? String(message.timestamp) : message.timestamp; + else + object.timestamp = options.longs === String ? $util.Long.prototype.toString.call(message.timestamp) : options.longs === Number ? new $util.LongBits(message.timestamp.low >>> 0, message.timestamp.high >>> 0).toNumber() : message.timestamp; return object; }; /** - * Converts this SyncdMutation to JSON. + * Converts this HSMDateTimeUnixEpoch to JSON. * @function toJSON - * @memberof proto.SyncdMutation + * @memberof proto.HSMDateTimeUnixEpoch * @instance * @returns {Object.} JSON object */ - SyncdMutation.prototype.toJSON = function toJSON() { + HSMDateTimeUnixEpoch.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - /** - * SyncdMutationSyncdOperation enum. - * @name proto.SyncdMutation.SyncdMutationSyncdOperation - * @enum {number} - * @property {number} SET=0 SET value - * @property {number} REMOVE=1 REMOVE value - */ - SyncdMutation.SyncdMutationSyncdOperation = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "SET"] = 0; - values[valuesById[1] = "REMOVE"] = 1; - return values; - })(); - - return SyncdMutation; + return HSMDateTimeUnixEpoch; })(); - proto.SyncdMutations = (function() { + proto.HSMLocalizableParameter = (function() { /** - * Properties of a SyncdMutations. + * Properties of a HSMLocalizableParameter. * @memberof proto - * @interface ISyncdMutations - * @property {Array.|null} [mutations] SyncdMutations mutations + * @interface IHSMLocalizableParameter + * @property {string|null} ["default"] HSMLocalizableParameter default + * @property {proto.IHSMCurrency|null} [currency] HSMLocalizableParameter currency + * @property {proto.IHSMDateTime|null} [dateTime] HSMLocalizableParameter dateTime */ /** - * Constructs a new SyncdMutations. + * Constructs a new HSMLocalizableParameter. * @memberof proto - * @classdesc Represents a SyncdMutations. - * @implements ISyncdMutations + * @classdesc Represents a HSMLocalizableParameter. + * @implements IHSMLocalizableParameter * @constructor - * @param {proto.ISyncdMutations=} [properties] Properties to set + * @param {proto.IHSMLocalizableParameter=} [properties] Properties to set */ - function SyncdMutations(properties) { - this.mutations = []; + function HSMLocalizableParameter(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -14458,78 +15014,115 @@ $root.proto = (function() { } /** - * SyncdMutations mutations. - * @member {Array.} mutations - * @memberof proto.SyncdMutations + * HSMLocalizableParameter default. + * @member {string} default + * @memberof proto.HSMLocalizableParameter * @instance */ - SyncdMutations.prototype.mutations = $util.emptyArray; + HSMLocalizableParameter.prototype["default"] = ""; /** - * Creates a new SyncdMutations instance using the specified properties. + * HSMLocalizableParameter currency. + * @member {proto.IHSMCurrency|null|undefined} currency + * @memberof proto.HSMLocalizableParameter + * @instance + */ + HSMLocalizableParameter.prototype.currency = null; + + /** + * HSMLocalizableParameter dateTime. + * @member {proto.IHSMDateTime|null|undefined} dateTime + * @memberof proto.HSMLocalizableParameter + * @instance + */ + HSMLocalizableParameter.prototype.dateTime = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * HSMLocalizableParameter paramOneof. + * @member {"currency"|"dateTime"|undefined} paramOneof + * @memberof proto.HSMLocalizableParameter + * @instance + */ + Object.defineProperty(HSMLocalizableParameter.prototype, "paramOneof", { + get: $util.oneOfGetter($oneOfFields = ["currency", "dateTime"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new HSMLocalizableParameter instance using the specified properties. * @function create - * @memberof proto.SyncdMutations + * @memberof proto.HSMLocalizableParameter * @static - * @param {proto.ISyncdMutations=} [properties] Properties to set - * @returns {proto.SyncdMutations} SyncdMutations instance + * @param {proto.IHSMLocalizableParameter=} [properties] Properties to set + * @returns {proto.HSMLocalizableParameter} HSMLocalizableParameter instance */ - SyncdMutations.create = function create(properties) { - return new SyncdMutations(properties); + HSMLocalizableParameter.create = function create(properties) { + return new HSMLocalizableParameter(properties); }; /** - * Encodes the specified SyncdMutations message. Does not implicitly {@link proto.SyncdMutations.verify|verify} messages. + * Encodes the specified HSMLocalizableParameter message. Does not implicitly {@link proto.HSMLocalizableParameter.verify|verify} messages. * @function encode - * @memberof proto.SyncdMutations + * @memberof proto.HSMLocalizableParameter * @static - * @param {proto.ISyncdMutations} message SyncdMutations message or plain object to encode + * @param {proto.IHSMLocalizableParameter} message HSMLocalizableParameter message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SyncdMutations.encode = function encode(message, writer) { + HSMLocalizableParameter.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.mutations != null && message.mutations.length) - for (var i = 0; i < message.mutations.length; ++i) - $root.proto.SyncdMutation.encode(message.mutations[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message["default"] != null && Object.hasOwnProperty.call(message, "default")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message["default"]); + if (message.currency != null && Object.hasOwnProperty.call(message, "currency")) + $root.proto.HSMCurrency.encode(message.currency, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.dateTime != null && Object.hasOwnProperty.call(message, "dateTime")) + $root.proto.HSMDateTime.encode(message.dateTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; /** - * Encodes the specified SyncdMutations message, length delimited. Does not implicitly {@link proto.SyncdMutations.verify|verify} messages. + * Encodes the specified HSMLocalizableParameter message, length delimited. Does not implicitly {@link proto.HSMLocalizableParameter.verify|verify} messages. * @function encodeDelimited - * @memberof proto.SyncdMutations + * @memberof proto.HSMLocalizableParameter * @static - * @param {proto.ISyncdMutations} message SyncdMutations message or plain object to encode + * @param {proto.IHSMLocalizableParameter} message HSMLocalizableParameter message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SyncdMutations.encodeDelimited = function encodeDelimited(message, writer) { + HSMLocalizableParameter.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a SyncdMutations message from the specified reader or buffer. + * Decodes a HSMLocalizableParameter message from the specified reader or buffer. * @function decode - * @memberof proto.SyncdMutations + * @memberof proto.HSMLocalizableParameter * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {proto.SyncdMutations} SyncdMutations + * @returns {proto.HSMLocalizableParameter} HSMLocalizableParameter * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SyncdMutations.decode = function decode(reader, length) { + HSMLocalizableParameter.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.SyncdMutations(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.HSMLocalizableParameter(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - if (!(message.mutations && message.mutations.length)) - message.mutations = []; - message.mutations.push($root.proto.SyncdMutation.decode(reader, reader.uint32())); + message["default"] = reader.string(); + break; + case 2: + message.currency = $root.proto.HSMCurrency.decode(reader, reader.uint32()); + break; + case 3: + message.dateTime = $root.proto.HSMDateTime.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -14540,128 +15133,147 @@ $root.proto = (function() { }; /** - * Decodes a SyncdMutations message from the specified reader or buffer, length delimited. + * Decodes a HSMLocalizableParameter message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof proto.SyncdMutations + * @memberof proto.HSMLocalizableParameter * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.SyncdMutations} SyncdMutations + * @returns {proto.HSMLocalizableParameter} HSMLocalizableParameter * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SyncdMutations.decodeDelimited = function decodeDelimited(reader) { + HSMLocalizableParameter.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a SyncdMutations message. + * Verifies a HSMLocalizableParameter message. * @function verify - * @memberof proto.SyncdMutations + * @memberof proto.HSMLocalizableParameter * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - SyncdMutations.verify = function verify(message) { + HSMLocalizableParameter.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.mutations != null && message.hasOwnProperty("mutations")) { - if (!Array.isArray(message.mutations)) - return "mutations: array expected"; - for (var i = 0; i < message.mutations.length; ++i) { - var error = $root.proto.SyncdMutation.verify(message.mutations[i]); + var properties = {}; + if (message["default"] != null && message.hasOwnProperty("default")) + if (!$util.isString(message["default"])) + return "default: string expected"; + if (message.currency != null && message.hasOwnProperty("currency")) { + properties.paramOneof = 1; + { + var error = $root.proto.HSMCurrency.verify(message.currency); if (error) - return "mutations." + error; + return "currency." + error; + } + } + if (message.dateTime != null && message.hasOwnProperty("dateTime")) { + if (properties.paramOneof === 1) + return "paramOneof: multiple values"; + properties.paramOneof = 1; + { + var error = $root.proto.HSMDateTime.verify(message.dateTime); + if (error) + return "dateTime." + error; } } return null; }; /** - * Creates a SyncdMutations message from a plain object. Also converts values to their respective internal types. + * Creates a HSMLocalizableParameter message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof proto.SyncdMutations + * @memberof proto.HSMLocalizableParameter * @static * @param {Object.} object Plain object - * @returns {proto.SyncdMutations} SyncdMutations + * @returns {proto.HSMLocalizableParameter} HSMLocalizableParameter */ - SyncdMutations.fromObject = function fromObject(object) { - if (object instanceof $root.proto.SyncdMutations) + HSMLocalizableParameter.fromObject = function fromObject(object) { + if (object instanceof $root.proto.HSMLocalizableParameter) return object; - var message = new $root.proto.SyncdMutations(); - if (object.mutations) { - if (!Array.isArray(object.mutations)) - throw TypeError(".proto.SyncdMutations.mutations: array expected"); - message.mutations = []; - for (var i = 0; i < object.mutations.length; ++i) { - if (typeof object.mutations[i] !== "object") - throw TypeError(".proto.SyncdMutations.mutations: object expected"); - message.mutations[i] = $root.proto.SyncdMutation.fromObject(object.mutations[i]); - } + var message = new $root.proto.HSMLocalizableParameter(); + if (object["default"] != null) + message["default"] = String(object["default"]); + if (object.currency != null) { + if (typeof object.currency !== "object") + throw TypeError(".proto.HSMLocalizableParameter.currency: object expected"); + message.currency = $root.proto.HSMCurrency.fromObject(object.currency); } - return message; - }; - + if (object.dateTime != null) { + if (typeof object.dateTime !== "object") + throw TypeError(".proto.HSMLocalizableParameter.dateTime: object expected"); + message.dateTime = $root.proto.HSMDateTime.fromObject(object.dateTime); + } + return message; + }; + /** - * Creates a plain object from a SyncdMutations message. Also converts values to other types if specified. + * Creates a plain object from a HSMLocalizableParameter message. Also converts values to other types if specified. * @function toObject - * @memberof proto.SyncdMutations + * @memberof proto.HSMLocalizableParameter * @static - * @param {proto.SyncdMutations} message SyncdMutations + * @param {proto.HSMLocalizableParameter} message HSMLocalizableParameter * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SyncdMutations.toObject = function toObject(message, options) { + HSMLocalizableParameter.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.mutations = []; - if (message.mutations && message.mutations.length) { - object.mutations = []; - for (var j = 0; j < message.mutations.length; ++j) - object.mutations[j] = $root.proto.SyncdMutation.toObject(message.mutations[j], options); + if (options.defaults) + object["default"] = ""; + if (message["default"] != null && message.hasOwnProperty("default")) + object["default"] = message["default"]; + if (message.currency != null && message.hasOwnProperty("currency")) { + object.currency = $root.proto.HSMCurrency.toObject(message.currency, options); + if (options.oneofs) + object.paramOneof = "currency"; + } + if (message.dateTime != null && message.hasOwnProperty("dateTime")) { + object.dateTime = $root.proto.HSMDateTime.toObject(message.dateTime, options); + if (options.oneofs) + object.paramOneof = "dateTime"; } return object; }; /** - * Converts this SyncdMutations to JSON. + * Converts this HSMLocalizableParameter to JSON. * @function toJSON - * @memberof proto.SyncdMutations + * @memberof proto.HSMLocalizableParameter * @instance * @returns {Object.} JSON object */ - SyncdMutations.prototype.toJSON = function toJSON() { + HSMLocalizableParameter.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return SyncdMutations; + return HSMLocalizableParameter; })(); - proto.SyncdSnapshot = (function() { + proto.HydratedCallButton = (function() { /** - * Properties of a SyncdSnapshot. + * Properties of a HydratedCallButton. * @memberof proto - * @interface ISyncdSnapshot - * @property {proto.ISyncdVersion|null} [version] SyncdSnapshot version - * @property {Array.|null} [records] SyncdSnapshot records - * @property {Uint8Array|null} [mac] SyncdSnapshot mac - * @property {proto.IKeyId|null} [keyId] SyncdSnapshot keyId + * @interface IHydratedCallButton + * @property {string|null} [displayText] HydratedCallButton displayText + * @property {string|null} [phoneNumber] HydratedCallButton phoneNumber */ /** - * Constructs a new SyncdSnapshot. + * Constructs a new HydratedCallButton. * @memberof proto - * @classdesc Represents a SyncdSnapshot. - * @implements ISyncdSnapshot + * @classdesc Represents a HydratedCallButton. + * @implements IHydratedCallButton * @constructor - * @param {proto.ISyncdSnapshot=} [properties] Properties to set + * @param {proto.IHydratedCallButton=} [properties] Properties to set */ - function SyncdSnapshot(properties) { - this.records = []; + function HydratedCallButton(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -14669,117 +15281,88 @@ $root.proto = (function() { } /** - * SyncdSnapshot version. - * @member {proto.ISyncdVersion|null|undefined} version - * @memberof proto.SyncdSnapshot - * @instance - */ - SyncdSnapshot.prototype.version = null; - - /** - * SyncdSnapshot records. - * @member {Array.} records - * @memberof proto.SyncdSnapshot - * @instance - */ - SyncdSnapshot.prototype.records = $util.emptyArray; - - /** - * SyncdSnapshot mac. - * @member {Uint8Array} mac - * @memberof proto.SyncdSnapshot + * HydratedCallButton displayText. + * @member {string} displayText + * @memberof proto.HydratedCallButton * @instance */ - SyncdSnapshot.prototype.mac = $util.newBuffer([]); + HydratedCallButton.prototype.displayText = ""; /** - * SyncdSnapshot keyId. - * @member {proto.IKeyId|null|undefined} keyId - * @memberof proto.SyncdSnapshot + * HydratedCallButton phoneNumber. + * @member {string} phoneNumber + * @memberof proto.HydratedCallButton * @instance */ - SyncdSnapshot.prototype.keyId = null; + HydratedCallButton.prototype.phoneNumber = ""; /** - * Creates a new SyncdSnapshot instance using the specified properties. + * Creates a new HydratedCallButton instance using the specified properties. * @function create - * @memberof proto.SyncdSnapshot + * @memberof proto.HydratedCallButton * @static - * @param {proto.ISyncdSnapshot=} [properties] Properties to set - * @returns {proto.SyncdSnapshot} SyncdSnapshot instance + * @param {proto.IHydratedCallButton=} [properties] Properties to set + * @returns {proto.HydratedCallButton} HydratedCallButton instance */ - SyncdSnapshot.create = function create(properties) { - return new SyncdSnapshot(properties); + HydratedCallButton.create = function create(properties) { + return new HydratedCallButton(properties); }; /** - * Encodes the specified SyncdSnapshot message. Does not implicitly {@link proto.SyncdSnapshot.verify|verify} messages. + * Encodes the specified HydratedCallButton message. Does not implicitly {@link proto.HydratedCallButton.verify|verify} messages. * @function encode - * @memberof proto.SyncdSnapshot + * @memberof proto.HydratedCallButton * @static - * @param {proto.ISyncdSnapshot} message SyncdSnapshot message or plain object to encode + * @param {proto.IHydratedCallButton} message HydratedCallButton message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SyncdSnapshot.encode = function encode(message, writer) { + HydratedCallButton.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.version != null && Object.hasOwnProperty.call(message, "version")) - $root.proto.SyncdVersion.encode(message.version, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.records != null && message.records.length) - for (var i = 0; i < message.records.length; ++i) - $root.proto.SyncdRecord.encode(message.records[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.mac != null && Object.hasOwnProperty.call(message, "mac")) - writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.mac); - if (message.keyId != null && Object.hasOwnProperty.call(message, "keyId")) - $root.proto.KeyId.encode(message.keyId, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.displayText != null && Object.hasOwnProperty.call(message, "displayText")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.displayText); + if (message.phoneNumber != null && Object.hasOwnProperty.call(message, "phoneNumber")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.phoneNumber); return writer; }; /** - * Encodes the specified SyncdSnapshot message, length delimited. Does not implicitly {@link proto.SyncdSnapshot.verify|verify} messages. + * Encodes the specified HydratedCallButton message, length delimited. Does not implicitly {@link proto.HydratedCallButton.verify|verify} messages. * @function encodeDelimited - * @memberof proto.SyncdSnapshot + * @memberof proto.HydratedCallButton * @static - * @param {proto.ISyncdSnapshot} message SyncdSnapshot message or plain object to encode + * @param {proto.IHydratedCallButton} message HydratedCallButton message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SyncdSnapshot.encodeDelimited = function encodeDelimited(message, writer) { + HydratedCallButton.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a SyncdSnapshot message from the specified reader or buffer. + * Decodes a HydratedCallButton message from the specified reader or buffer. * @function decode - * @memberof proto.SyncdSnapshot + * @memberof proto.HydratedCallButton * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {proto.SyncdSnapshot} SyncdSnapshot + * @returns {proto.HydratedCallButton} HydratedCallButton * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SyncdSnapshot.decode = function decode(reader, length) { + HydratedCallButton.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.SyncdSnapshot(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.HydratedCallButton(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.version = $root.proto.SyncdVersion.decode(reader, reader.uint32()); + message.displayText = reader.string(); break; case 2: - if (!(message.records && message.records.length)) - message.records = []; - message.records.push($root.proto.SyncdRecord.decode(reader, reader.uint32())); - break; - case 3: - message.mac = reader.bytes(); - break; - case 4: - message.keyId = $root.proto.KeyId.decode(reader, reader.uint32()); + message.phoneNumber = reader.string(); break; default: reader.skipType(tag & 7); @@ -14790,174 +15373,125 @@ $root.proto = (function() { }; /** - * Decodes a SyncdSnapshot message from the specified reader or buffer, length delimited. + * Decodes a HydratedCallButton message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof proto.SyncdSnapshot + * @memberof proto.HydratedCallButton * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.SyncdSnapshot} SyncdSnapshot + * @returns {proto.HydratedCallButton} HydratedCallButton * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SyncdSnapshot.decodeDelimited = function decodeDelimited(reader) { + HydratedCallButton.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a SyncdSnapshot message. + * Verifies a HydratedCallButton message. * @function verify - * @memberof proto.SyncdSnapshot + * @memberof proto.HydratedCallButton * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - SyncdSnapshot.verify = function verify(message) { + HydratedCallButton.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.version != null && message.hasOwnProperty("version")) { - var error = $root.proto.SyncdVersion.verify(message.version); - if (error) - return "version." + error; - } - if (message.records != null && message.hasOwnProperty("records")) { - if (!Array.isArray(message.records)) - return "records: array expected"; - for (var i = 0; i < message.records.length; ++i) { - var error = $root.proto.SyncdRecord.verify(message.records[i]); - if (error) - return "records." + error; - } - } - if (message.mac != null && message.hasOwnProperty("mac")) - if (!(message.mac && typeof message.mac.length === "number" || $util.isString(message.mac))) - return "mac: buffer expected"; - if (message.keyId != null && message.hasOwnProperty("keyId")) { - var error = $root.proto.KeyId.verify(message.keyId); - if (error) - return "keyId." + error; - } + if (message.displayText != null && message.hasOwnProperty("displayText")) + if (!$util.isString(message.displayText)) + return "displayText: string expected"; + if (message.phoneNumber != null && message.hasOwnProperty("phoneNumber")) + if (!$util.isString(message.phoneNumber)) + return "phoneNumber: string expected"; return null; }; /** - * Creates a SyncdSnapshot message from a plain object. Also converts values to their respective internal types. + * Creates a HydratedCallButton message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof proto.SyncdSnapshot + * @memberof proto.HydratedCallButton * @static * @param {Object.} object Plain object - * @returns {proto.SyncdSnapshot} SyncdSnapshot + * @returns {proto.HydratedCallButton} HydratedCallButton */ - SyncdSnapshot.fromObject = function fromObject(object) { - if (object instanceof $root.proto.SyncdSnapshot) + HydratedCallButton.fromObject = function fromObject(object) { + if (object instanceof $root.proto.HydratedCallButton) return object; - var message = new $root.proto.SyncdSnapshot(); - if (object.version != null) { - if (typeof object.version !== "object") - throw TypeError(".proto.SyncdSnapshot.version: object expected"); - message.version = $root.proto.SyncdVersion.fromObject(object.version); - } - if (object.records) { - if (!Array.isArray(object.records)) - throw TypeError(".proto.SyncdSnapshot.records: array expected"); - message.records = []; - for (var i = 0; i < object.records.length; ++i) { - if (typeof object.records[i] !== "object") - throw TypeError(".proto.SyncdSnapshot.records: object expected"); - message.records[i] = $root.proto.SyncdRecord.fromObject(object.records[i]); - } - } - if (object.mac != null) - if (typeof object.mac === "string") - $util.base64.decode(object.mac, message.mac = $util.newBuffer($util.base64.length(object.mac)), 0); - else if (object.mac.length) - message.mac = object.mac; - if (object.keyId != null) { - if (typeof object.keyId !== "object") - throw TypeError(".proto.SyncdSnapshot.keyId: object expected"); - message.keyId = $root.proto.KeyId.fromObject(object.keyId); - } + var message = new $root.proto.HydratedCallButton(); + if (object.displayText != null) + message.displayText = String(object.displayText); + if (object.phoneNumber != null) + message.phoneNumber = String(object.phoneNumber); return message; }; /** - * Creates a plain object from a SyncdSnapshot message. Also converts values to other types if specified. + * Creates a plain object from a HydratedCallButton message. Also converts values to other types if specified. * @function toObject - * @memberof proto.SyncdSnapshot + * @memberof proto.HydratedCallButton * @static - * @param {proto.SyncdSnapshot} message SyncdSnapshot + * @param {proto.HydratedCallButton} message HydratedCallButton * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SyncdSnapshot.toObject = function toObject(message, options) { + HydratedCallButton.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.records = []; if (options.defaults) { - object.version = null; - if (options.bytes === String) - object.mac = ""; - else { - object.mac = []; - if (options.bytes !== Array) - object.mac = $util.newBuffer(object.mac); - } - object.keyId = null; - } - if (message.version != null && message.hasOwnProperty("version")) - object.version = $root.proto.SyncdVersion.toObject(message.version, options); - if (message.records && message.records.length) { - object.records = []; - for (var j = 0; j < message.records.length; ++j) - object.records[j] = $root.proto.SyncdRecord.toObject(message.records[j], options); + object.displayText = ""; + object.phoneNumber = ""; } - if (message.mac != null && message.hasOwnProperty("mac")) - object.mac = options.bytes === String ? $util.base64.encode(message.mac, 0, message.mac.length) : options.bytes === Array ? Array.prototype.slice.call(message.mac) : message.mac; - if (message.keyId != null && message.hasOwnProperty("keyId")) - object.keyId = $root.proto.KeyId.toObject(message.keyId, options); + if (message.displayText != null && message.hasOwnProperty("displayText")) + object.displayText = message.displayText; + if (message.phoneNumber != null && message.hasOwnProperty("phoneNumber")) + object.phoneNumber = message.phoneNumber; return object; }; /** - * Converts this SyncdSnapshot to JSON. + * Converts this HydratedCallButton to JSON. * @function toJSON - * @memberof proto.SyncdSnapshot + * @memberof proto.HydratedCallButton * @instance * @returns {Object.} JSON object */ - SyncdSnapshot.prototype.toJSON = function toJSON() { + HydratedCallButton.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return SyncdSnapshot; + return HydratedCallButton; })(); - proto.ExternalBlobReference = (function() { + proto.HydratedFourRowTemplate = (function() { /** - * Properties of an ExternalBlobReference. + * Properties of a HydratedFourRowTemplate. * @memberof proto - * @interface IExternalBlobReference - * @property {Uint8Array|null} [mediaKey] ExternalBlobReference mediaKey - * @property {string|null} [directPath] ExternalBlobReference directPath - * @property {string|null} [handle] ExternalBlobReference handle - * @property {number|Long|null} [fileSizeBytes] ExternalBlobReference fileSizeBytes - * @property {Uint8Array|null} [fileSha256] ExternalBlobReference fileSha256 - * @property {Uint8Array|null} [fileEncSha256] ExternalBlobReference fileEncSha256 + * @interface IHydratedFourRowTemplate + * @property {string|null} [hydratedContentText] HydratedFourRowTemplate hydratedContentText + * @property {string|null} [hydratedFooterText] HydratedFourRowTemplate hydratedFooterText + * @property {Array.|null} [hydratedButtons] HydratedFourRowTemplate hydratedButtons + * @property {string|null} [templateId] HydratedFourRowTemplate templateId + * @property {proto.IDocumentMessage|null} [documentMessage] HydratedFourRowTemplate documentMessage + * @property {string|null} [hydratedTitleText] HydratedFourRowTemplate hydratedTitleText + * @property {proto.IImageMessage|null} [imageMessage] HydratedFourRowTemplate imageMessage + * @property {proto.IVideoMessage|null} [videoMessage] HydratedFourRowTemplate videoMessage + * @property {proto.ILocationMessage|null} [locationMessage] HydratedFourRowTemplate locationMessage */ /** - * Constructs a new ExternalBlobReference. + * Constructs a new HydratedFourRowTemplate. * @memberof proto - * @classdesc Represents an ExternalBlobReference. - * @implements IExternalBlobReference + * @classdesc Represents a HydratedFourRowTemplate. + * @implements IHydratedFourRowTemplate * @constructor - * @param {proto.IExternalBlobReference=} [properties] Properties to set + * @param {proto.IHydratedFourRowTemplate=} [properties] Properties to set */ - function ExternalBlobReference(properties) { + function HydratedFourRowTemplate(properties) { + this.hydratedButtons = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -14965,140 +15499,196 @@ $root.proto = (function() { } /** - * ExternalBlobReference mediaKey. - * @member {Uint8Array} mediaKey - * @memberof proto.ExternalBlobReference + * HydratedFourRowTemplate hydratedContentText. + * @member {string} hydratedContentText + * @memberof proto.HydratedFourRowTemplate * @instance */ - ExternalBlobReference.prototype.mediaKey = $util.newBuffer([]); + HydratedFourRowTemplate.prototype.hydratedContentText = ""; /** - * ExternalBlobReference directPath. - * @member {string} directPath - * @memberof proto.ExternalBlobReference + * HydratedFourRowTemplate hydratedFooterText. + * @member {string} hydratedFooterText + * @memberof proto.HydratedFourRowTemplate * @instance */ - ExternalBlobReference.prototype.directPath = ""; + HydratedFourRowTemplate.prototype.hydratedFooterText = ""; /** - * ExternalBlobReference handle. - * @member {string} handle - * @memberof proto.ExternalBlobReference + * HydratedFourRowTemplate hydratedButtons. + * @member {Array.} hydratedButtons + * @memberof proto.HydratedFourRowTemplate * @instance */ - ExternalBlobReference.prototype.handle = ""; + HydratedFourRowTemplate.prototype.hydratedButtons = $util.emptyArray; /** - * ExternalBlobReference fileSizeBytes. - * @member {number|Long} fileSizeBytes - * @memberof proto.ExternalBlobReference + * HydratedFourRowTemplate templateId. + * @member {string} templateId + * @memberof proto.HydratedFourRowTemplate * @instance */ - ExternalBlobReference.prototype.fileSizeBytes = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + HydratedFourRowTemplate.prototype.templateId = ""; /** - * ExternalBlobReference fileSha256. - * @member {Uint8Array} fileSha256 - * @memberof proto.ExternalBlobReference + * HydratedFourRowTemplate documentMessage. + * @member {proto.IDocumentMessage|null|undefined} documentMessage + * @memberof proto.HydratedFourRowTemplate * @instance */ - ExternalBlobReference.prototype.fileSha256 = $util.newBuffer([]); + HydratedFourRowTemplate.prototype.documentMessage = null; /** - * ExternalBlobReference fileEncSha256. - * @member {Uint8Array} fileEncSha256 - * @memberof proto.ExternalBlobReference + * HydratedFourRowTemplate hydratedTitleText. + * @member {string|null|undefined} hydratedTitleText + * @memberof proto.HydratedFourRowTemplate * @instance */ - ExternalBlobReference.prototype.fileEncSha256 = $util.newBuffer([]); + HydratedFourRowTemplate.prototype.hydratedTitleText = null; /** - * Creates a new ExternalBlobReference instance using the specified properties. + * HydratedFourRowTemplate imageMessage. + * @member {proto.IImageMessage|null|undefined} imageMessage + * @memberof proto.HydratedFourRowTemplate + * @instance + */ + HydratedFourRowTemplate.prototype.imageMessage = null; + + /** + * HydratedFourRowTemplate videoMessage. + * @member {proto.IVideoMessage|null|undefined} videoMessage + * @memberof proto.HydratedFourRowTemplate + * @instance + */ + HydratedFourRowTemplate.prototype.videoMessage = null; + + /** + * HydratedFourRowTemplate locationMessage. + * @member {proto.ILocationMessage|null|undefined} locationMessage + * @memberof proto.HydratedFourRowTemplate + * @instance + */ + HydratedFourRowTemplate.prototype.locationMessage = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * HydratedFourRowTemplate title. + * @member {"documentMessage"|"hydratedTitleText"|"imageMessage"|"videoMessage"|"locationMessage"|undefined} title + * @memberof proto.HydratedFourRowTemplate + * @instance + */ + Object.defineProperty(HydratedFourRowTemplate.prototype, "title", { + get: $util.oneOfGetter($oneOfFields = ["documentMessage", "hydratedTitleText", "imageMessage", "videoMessage", "locationMessage"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new HydratedFourRowTemplate instance using the specified properties. * @function create - * @memberof proto.ExternalBlobReference + * @memberof proto.HydratedFourRowTemplate * @static - * @param {proto.IExternalBlobReference=} [properties] Properties to set - * @returns {proto.ExternalBlobReference} ExternalBlobReference instance + * @param {proto.IHydratedFourRowTemplate=} [properties] Properties to set + * @returns {proto.HydratedFourRowTemplate} HydratedFourRowTemplate instance */ - ExternalBlobReference.create = function create(properties) { - return new ExternalBlobReference(properties); + HydratedFourRowTemplate.create = function create(properties) { + return new HydratedFourRowTemplate(properties); }; /** - * Encodes the specified ExternalBlobReference message. Does not implicitly {@link proto.ExternalBlobReference.verify|verify} messages. + * Encodes the specified HydratedFourRowTemplate message. Does not implicitly {@link proto.HydratedFourRowTemplate.verify|verify} messages. * @function encode - * @memberof proto.ExternalBlobReference + * @memberof proto.HydratedFourRowTemplate * @static - * @param {proto.IExternalBlobReference} message ExternalBlobReference message or plain object to encode + * @param {proto.IHydratedFourRowTemplate} message HydratedFourRowTemplate message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ExternalBlobReference.encode = function encode(message, writer) { + HydratedFourRowTemplate.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.mediaKey != null && Object.hasOwnProperty.call(message, "mediaKey")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.mediaKey); - if (message.directPath != null && Object.hasOwnProperty.call(message, "directPath")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.directPath); - if (message.handle != null && Object.hasOwnProperty.call(message, "handle")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.handle); - if (message.fileSizeBytes != null && Object.hasOwnProperty.call(message, "fileSizeBytes")) - writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.fileSizeBytes); - if (message.fileSha256 != null && Object.hasOwnProperty.call(message, "fileSha256")) - writer.uint32(/* id 5, wireType 2 =*/42).bytes(message.fileSha256); - if (message.fileEncSha256 != null && Object.hasOwnProperty.call(message, "fileEncSha256")) - writer.uint32(/* id 6, wireType 2 =*/50).bytes(message.fileEncSha256); + if (message.documentMessage != null && Object.hasOwnProperty.call(message, "documentMessage")) + $root.proto.DocumentMessage.encode(message.documentMessage, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.hydratedTitleText != null && Object.hasOwnProperty.call(message, "hydratedTitleText")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.hydratedTitleText); + if (message.imageMessage != null && Object.hasOwnProperty.call(message, "imageMessage")) + $root.proto.ImageMessage.encode(message.imageMessage, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.videoMessage != null && Object.hasOwnProperty.call(message, "videoMessage")) + $root.proto.VideoMessage.encode(message.videoMessage, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.locationMessage != null && Object.hasOwnProperty.call(message, "locationMessage")) + $root.proto.LocationMessage.encode(message.locationMessage, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.hydratedContentText != null && Object.hasOwnProperty.call(message, "hydratedContentText")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.hydratedContentText); + if (message.hydratedFooterText != null && Object.hasOwnProperty.call(message, "hydratedFooterText")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.hydratedFooterText); + if (message.hydratedButtons != null && message.hydratedButtons.length) + for (var i = 0; i < message.hydratedButtons.length; ++i) + $root.proto.HydratedTemplateButton.encode(message.hydratedButtons[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.templateId != null && Object.hasOwnProperty.call(message, "templateId")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.templateId); return writer; }; /** - * Encodes the specified ExternalBlobReference message, length delimited. Does not implicitly {@link proto.ExternalBlobReference.verify|verify} messages. + * Encodes the specified HydratedFourRowTemplate message, length delimited. Does not implicitly {@link proto.HydratedFourRowTemplate.verify|verify} messages. * @function encodeDelimited - * @memberof proto.ExternalBlobReference + * @memberof proto.HydratedFourRowTemplate * @static - * @param {proto.IExternalBlobReference} message ExternalBlobReference message or plain object to encode + * @param {proto.IHydratedFourRowTemplate} message HydratedFourRowTemplate message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ExternalBlobReference.encodeDelimited = function encodeDelimited(message, writer) { + HydratedFourRowTemplate.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an ExternalBlobReference message from the specified reader or buffer. + * Decodes a HydratedFourRowTemplate message from the specified reader or buffer. * @function decode - * @memberof proto.ExternalBlobReference + * @memberof proto.HydratedFourRowTemplate * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {proto.ExternalBlobReference} ExternalBlobReference + * @returns {proto.HydratedFourRowTemplate} HydratedFourRowTemplate * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ExternalBlobReference.decode = function decode(reader, length) { + HydratedFourRowTemplate.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.ExternalBlobReference(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.HydratedFourRowTemplate(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { + case 6: + message.hydratedContentText = reader.string(); + break; + case 7: + message.hydratedFooterText = reader.string(); + break; + case 8: + if (!(message.hydratedButtons && message.hydratedButtons.length)) + message.hydratedButtons = []; + message.hydratedButtons.push($root.proto.HydratedTemplateButton.decode(reader, reader.uint32())); + break; + case 9: + message.templateId = reader.string(); + break; case 1: - message.mediaKey = reader.bytes(); + message.documentMessage = $root.proto.DocumentMessage.decode(reader, reader.uint32()); break; case 2: - message.directPath = reader.string(); + message.hydratedTitleText = reader.string(); break; case 3: - message.handle = reader.string(); + message.imageMessage = $root.proto.ImageMessage.decode(reader, reader.uint32()); break; case 4: - message.fileSizeBytes = reader.uint64(); + message.videoMessage = $root.proto.VideoMessage.decode(reader, reader.uint32()); break; case 5: - message.fileSha256 = reader.bytes(); - break; - case 6: - message.fileEncSha256 = reader.bytes(); + message.locationMessage = $root.proto.LocationMessage.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -15109,191 +15699,244 @@ $root.proto = (function() { }; /** - * Decodes an ExternalBlobReference message from the specified reader or buffer, length delimited. + * Decodes a HydratedFourRowTemplate message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof proto.ExternalBlobReference + * @memberof proto.HydratedFourRowTemplate * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.ExternalBlobReference} ExternalBlobReference + * @returns {proto.HydratedFourRowTemplate} HydratedFourRowTemplate * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ExternalBlobReference.decodeDelimited = function decodeDelimited(reader) { + HydratedFourRowTemplate.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an ExternalBlobReference message. + * Verifies a HydratedFourRowTemplate message. * @function verify - * @memberof proto.ExternalBlobReference + * @memberof proto.HydratedFourRowTemplate * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ExternalBlobReference.verify = function verify(message) { + HydratedFourRowTemplate.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.mediaKey != null && message.hasOwnProperty("mediaKey")) - if (!(message.mediaKey && typeof message.mediaKey.length === "number" || $util.isString(message.mediaKey))) - return "mediaKey: buffer expected"; - if (message.directPath != null && message.hasOwnProperty("directPath")) - if (!$util.isString(message.directPath)) - return "directPath: string expected"; - if (message.handle != null && message.hasOwnProperty("handle")) - if (!$util.isString(message.handle)) - return "handle: string expected"; - if (message.fileSizeBytes != null && message.hasOwnProperty("fileSizeBytes")) - if (!$util.isInteger(message.fileSizeBytes) && !(message.fileSizeBytes && $util.isInteger(message.fileSizeBytes.low) && $util.isInteger(message.fileSizeBytes.high))) - return "fileSizeBytes: integer|Long expected"; - if (message.fileSha256 != null && message.hasOwnProperty("fileSha256")) - if (!(message.fileSha256 && typeof message.fileSha256.length === "number" || $util.isString(message.fileSha256))) - return "fileSha256: buffer expected"; - if (message.fileEncSha256 != null && message.hasOwnProperty("fileEncSha256")) - if (!(message.fileEncSha256 && typeof message.fileEncSha256.length === "number" || $util.isString(message.fileEncSha256))) - return "fileEncSha256: buffer expected"; + var properties = {}; + if (message.hydratedContentText != null && message.hasOwnProperty("hydratedContentText")) + if (!$util.isString(message.hydratedContentText)) + return "hydratedContentText: string expected"; + if (message.hydratedFooterText != null && message.hasOwnProperty("hydratedFooterText")) + if (!$util.isString(message.hydratedFooterText)) + return "hydratedFooterText: string expected"; + if (message.hydratedButtons != null && message.hasOwnProperty("hydratedButtons")) { + if (!Array.isArray(message.hydratedButtons)) + return "hydratedButtons: array expected"; + for (var i = 0; i < message.hydratedButtons.length; ++i) { + var error = $root.proto.HydratedTemplateButton.verify(message.hydratedButtons[i]); + if (error) + return "hydratedButtons." + error; + } + } + if (message.templateId != null && message.hasOwnProperty("templateId")) + if (!$util.isString(message.templateId)) + return "templateId: string expected"; + if (message.documentMessage != null && message.hasOwnProperty("documentMessage")) { + properties.title = 1; + { + var error = $root.proto.DocumentMessage.verify(message.documentMessage); + if (error) + return "documentMessage." + error; + } + } + if (message.hydratedTitleText != null && message.hasOwnProperty("hydratedTitleText")) { + if (properties.title === 1) + return "title: multiple values"; + properties.title = 1; + if (!$util.isString(message.hydratedTitleText)) + return "hydratedTitleText: string expected"; + } + if (message.imageMessage != null && message.hasOwnProperty("imageMessage")) { + if (properties.title === 1) + return "title: multiple values"; + properties.title = 1; + { + var error = $root.proto.ImageMessage.verify(message.imageMessage); + if (error) + return "imageMessage." + error; + } + } + if (message.videoMessage != null && message.hasOwnProperty("videoMessage")) { + if (properties.title === 1) + return "title: multiple values"; + properties.title = 1; + { + var error = $root.proto.VideoMessage.verify(message.videoMessage); + if (error) + return "videoMessage." + error; + } + } + if (message.locationMessage != null && message.hasOwnProperty("locationMessage")) { + if (properties.title === 1) + return "title: multiple values"; + properties.title = 1; + { + var error = $root.proto.LocationMessage.verify(message.locationMessage); + if (error) + return "locationMessage." + error; + } + } return null; }; /** - * Creates an ExternalBlobReference message from a plain object. Also converts values to their respective internal types. + * Creates a HydratedFourRowTemplate message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof proto.ExternalBlobReference + * @memberof proto.HydratedFourRowTemplate * @static * @param {Object.} object Plain object - * @returns {proto.ExternalBlobReference} ExternalBlobReference + * @returns {proto.HydratedFourRowTemplate} HydratedFourRowTemplate */ - ExternalBlobReference.fromObject = function fromObject(object) { - if (object instanceof $root.proto.ExternalBlobReference) + HydratedFourRowTemplate.fromObject = function fromObject(object) { + if (object instanceof $root.proto.HydratedFourRowTemplate) return object; - var message = new $root.proto.ExternalBlobReference(); - if (object.mediaKey != null) - if (typeof object.mediaKey === "string") - $util.base64.decode(object.mediaKey, message.mediaKey = $util.newBuffer($util.base64.length(object.mediaKey)), 0); - else if (object.mediaKey.length) - message.mediaKey = object.mediaKey; - if (object.directPath != null) - message.directPath = String(object.directPath); - if (object.handle != null) - message.handle = String(object.handle); - if (object.fileSizeBytes != null) - if ($util.Long) - (message.fileSizeBytes = $util.Long.fromValue(object.fileSizeBytes)).unsigned = true; - else if (typeof object.fileSizeBytes === "string") - message.fileSizeBytes = parseInt(object.fileSizeBytes, 10); - else if (typeof object.fileSizeBytes === "number") - message.fileSizeBytes = object.fileSizeBytes; - else if (typeof object.fileSizeBytes === "object") - message.fileSizeBytes = new $util.LongBits(object.fileSizeBytes.low >>> 0, object.fileSizeBytes.high >>> 0).toNumber(true); - if (object.fileSha256 != null) - if (typeof object.fileSha256 === "string") - $util.base64.decode(object.fileSha256, message.fileSha256 = $util.newBuffer($util.base64.length(object.fileSha256)), 0); - else if (object.fileSha256.length) - message.fileSha256 = object.fileSha256; - if (object.fileEncSha256 != null) - if (typeof object.fileEncSha256 === "string") - $util.base64.decode(object.fileEncSha256, message.fileEncSha256 = $util.newBuffer($util.base64.length(object.fileEncSha256)), 0); - else if (object.fileEncSha256.length) - message.fileEncSha256 = object.fileEncSha256; + var message = new $root.proto.HydratedFourRowTemplate(); + if (object.hydratedContentText != null) + message.hydratedContentText = String(object.hydratedContentText); + if (object.hydratedFooterText != null) + message.hydratedFooterText = String(object.hydratedFooterText); + if (object.hydratedButtons) { + if (!Array.isArray(object.hydratedButtons)) + throw TypeError(".proto.HydratedFourRowTemplate.hydratedButtons: array expected"); + message.hydratedButtons = []; + for (var i = 0; i < object.hydratedButtons.length; ++i) { + if (typeof object.hydratedButtons[i] !== "object") + throw TypeError(".proto.HydratedFourRowTemplate.hydratedButtons: object expected"); + message.hydratedButtons[i] = $root.proto.HydratedTemplateButton.fromObject(object.hydratedButtons[i]); + } + } + if (object.templateId != null) + message.templateId = String(object.templateId); + if (object.documentMessage != null) { + if (typeof object.documentMessage !== "object") + throw TypeError(".proto.HydratedFourRowTemplate.documentMessage: object expected"); + message.documentMessage = $root.proto.DocumentMessage.fromObject(object.documentMessage); + } + if (object.hydratedTitleText != null) + message.hydratedTitleText = String(object.hydratedTitleText); + if (object.imageMessage != null) { + if (typeof object.imageMessage !== "object") + throw TypeError(".proto.HydratedFourRowTemplate.imageMessage: object expected"); + message.imageMessage = $root.proto.ImageMessage.fromObject(object.imageMessage); + } + if (object.videoMessage != null) { + if (typeof object.videoMessage !== "object") + throw TypeError(".proto.HydratedFourRowTemplate.videoMessage: object expected"); + message.videoMessage = $root.proto.VideoMessage.fromObject(object.videoMessage); + } + if (object.locationMessage != null) { + if (typeof object.locationMessage !== "object") + throw TypeError(".proto.HydratedFourRowTemplate.locationMessage: object expected"); + message.locationMessage = $root.proto.LocationMessage.fromObject(object.locationMessage); + } return message; }; /** - * Creates a plain object from an ExternalBlobReference message. Also converts values to other types if specified. + * Creates a plain object from a HydratedFourRowTemplate message. Also converts values to other types if specified. * @function toObject - * @memberof proto.ExternalBlobReference + * @memberof proto.HydratedFourRowTemplate * @static - * @param {proto.ExternalBlobReference} message ExternalBlobReference + * @param {proto.HydratedFourRowTemplate} message HydratedFourRowTemplate * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ExternalBlobReference.toObject = function toObject(message, options) { + HydratedFourRowTemplate.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.hydratedButtons = []; if (options.defaults) { - if (options.bytes === String) - object.mediaKey = ""; - else { - object.mediaKey = []; - if (options.bytes !== Array) - object.mediaKey = $util.newBuffer(object.mediaKey); - } - object.directPath = ""; - object.handle = ""; - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.fileSizeBytes = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.fileSizeBytes = options.longs === String ? "0" : 0; - if (options.bytes === String) - object.fileSha256 = ""; - else { - object.fileSha256 = []; - if (options.bytes !== Array) - object.fileSha256 = $util.newBuffer(object.fileSha256); - } - if (options.bytes === String) - object.fileEncSha256 = ""; - else { - object.fileEncSha256 = []; - if (options.bytes !== Array) - object.fileEncSha256 = $util.newBuffer(object.fileEncSha256); - } + object.hydratedContentText = ""; + object.hydratedFooterText = ""; + object.templateId = ""; } - if (message.mediaKey != null && message.hasOwnProperty("mediaKey")) - object.mediaKey = options.bytes === String ? $util.base64.encode(message.mediaKey, 0, message.mediaKey.length) : options.bytes === Array ? Array.prototype.slice.call(message.mediaKey) : message.mediaKey; - if (message.directPath != null && message.hasOwnProperty("directPath")) - object.directPath = message.directPath; - if (message.handle != null && message.hasOwnProperty("handle")) - object.handle = message.handle; - if (message.fileSizeBytes != null && message.hasOwnProperty("fileSizeBytes")) - if (typeof message.fileSizeBytes === "number") - object.fileSizeBytes = options.longs === String ? String(message.fileSizeBytes) : message.fileSizeBytes; - else - object.fileSizeBytes = options.longs === String ? $util.Long.prototype.toString.call(message.fileSizeBytes) : options.longs === Number ? new $util.LongBits(message.fileSizeBytes.low >>> 0, message.fileSizeBytes.high >>> 0).toNumber(true) : message.fileSizeBytes; - if (message.fileSha256 != null && message.hasOwnProperty("fileSha256")) - object.fileSha256 = options.bytes === String ? $util.base64.encode(message.fileSha256, 0, message.fileSha256.length) : options.bytes === Array ? Array.prototype.slice.call(message.fileSha256) : message.fileSha256; - if (message.fileEncSha256 != null && message.hasOwnProperty("fileEncSha256")) - object.fileEncSha256 = options.bytes === String ? $util.base64.encode(message.fileEncSha256, 0, message.fileEncSha256.length) : options.bytes === Array ? Array.prototype.slice.call(message.fileEncSha256) : message.fileEncSha256; + if (message.documentMessage != null && message.hasOwnProperty("documentMessage")) { + object.documentMessage = $root.proto.DocumentMessage.toObject(message.documentMessage, options); + if (options.oneofs) + object.title = "documentMessage"; + } + if (message.hydratedTitleText != null && message.hasOwnProperty("hydratedTitleText")) { + object.hydratedTitleText = message.hydratedTitleText; + if (options.oneofs) + object.title = "hydratedTitleText"; + } + if (message.imageMessage != null && message.hasOwnProperty("imageMessage")) { + object.imageMessage = $root.proto.ImageMessage.toObject(message.imageMessage, options); + if (options.oneofs) + object.title = "imageMessage"; + } + if (message.videoMessage != null && message.hasOwnProperty("videoMessage")) { + object.videoMessage = $root.proto.VideoMessage.toObject(message.videoMessage, options); + if (options.oneofs) + object.title = "videoMessage"; + } + if (message.locationMessage != null && message.hasOwnProperty("locationMessage")) { + object.locationMessage = $root.proto.LocationMessage.toObject(message.locationMessage, options); + if (options.oneofs) + object.title = "locationMessage"; + } + if (message.hydratedContentText != null && message.hasOwnProperty("hydratedContentText")) + object.hydratedContentText = message.hydratedContentText; + if (message.hydratedFooterText != null && message.hasOwnProperty("hydratedFooterText")) + object.hydratedFooterText = message.hydratedFooterText; + if (message.hydratedButtons && message.hydratedButtons.length) { + object.hydratedButtons = []; + for (var j = 0; j < message.hydratedButtons.length; ++j) + object.hydratedButtons[j] = $root.proto.HydratedTemplateButton.toObject(message.hydratedButtons[j], options); + } + if (message.templateId != null && message.hasOwnProperty("templateId")) + object.templateId = message.templateId; return object; }; /** - * Converts this ExternalBlobReference to JSON. + * Converts this HydratedFourRowTemplate to JSON. * @function toJSON - * @memberof proto.ExternalBlobReference + * @memberof proto.HydratedFourRowTemplate * @instance * @returns {Object.} JSON object */ - ExternalBlobReference.prototype.toJSON = function toJSON() { + HydratedFourRowTemplate.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ExternalBlobReference; + return HydratedFourRowTemplate; })(); - proto.SyncdRecord = (function() { + proto.HydratedQuickReplyButton = (function() { /** - * Properties of a SyncdRecord. + * Properties of a HydratedQuickReplyButton. * @memberof proto - * @interface ISyncdRecord - * @property {proto.ISyncdIndex|null} [index] SyncdRecord index - * @property {proto.ISyncdValue|null} [value] SyncdRecord value - * @property {proto.IKeyId|null} [keyId] SyncdRecord keyId + * @interface IHydratedQuickReplyButton + * @property {string|null} [displayText] HydratedQuickReplyButton displayText + * @property {string|null} [id] HydratedQuickReplyButton id */ /** - * Constructs a new SyncdRecord. + * Constructs a new HydratedQuickReplyButton. * @memberof proto - * @classdesc Represents a SyncdRecord. - * @implements ISyncdRecord + * @classdesc Represents a HydratedQuickReplyButton. + * @implements IHydratedQuickReplyButton * @constructor - * @param {proto.ISyncdRecord=} [properties] Properties to set + * @param {proto.IHydratedQuickReplyButton=} [properties] Properties to set */ - function SyncdRecord(properties) { + function HydratedQuickReplyButton(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -15301,101 +15944,88 @@ $root.proto = (function() { } /** - * SyncdRecord index. - * @member {proto.ISyncdIndex|null|undefined} index - * @memberof proto.SyncdRecord - * @instance - */ - SyncdRecord.prototype.index = null; - - /** - * SyncdRecord value. - * @member {proto.ISyncdValue|null|undefined} value - * @memberof proto.SyncdRecord + * HydratedQuickReplyButton displayText. + * @member {string} displayText + * @memberof proto.HydratedQuickReplyButton * @instance */ - SyncdRecord.prototype.value = null; + HydratedQuickReplyButton.prototype.displayText = ""; /** - * SyncdRecord keyId. - * @member {proto.IKeyId|null|undefined} keyId - * @memberof proto.SyncdRecord + * HydratedQuickReplyButton id. + * @member {string} id + * @memberof proto.HydratedQuickReplyButton * @instance */ - SyncdRecord.prototype.keyId = null; + HydratedQuickReplyButton.prototype.id = ""; /** - * Creates a new SyncdRecord instance using the specified properties. + * Creates a new HydratedQuickReplyButton instance using the specified properties. * @function create - * @memberof proto.SyncdRecord + * @memberof proto.HydratedQuickReplyButton * @static - * @param {proto.ISyncdRecord=} [properties] Properties to set - * @returns {proto.SyncdRecord} SyncdRecord instance + * @param {proto.IHydratedQuickReplyButton=} [properties] Properties to set + * @returns {proto.HydratedQuickReplyButton} HydratedQuickReplyButton instance */ - SyncdRecord.create = function create(properties) { - return new SyncdRecord(properties); + HydratedQuickReplyButton.create = function create(properties) { + return new HydratedQuickReplyButton(properties); }; /** - * Encodes the specified SyncdRecord message. Does not implicitly {@link proto.SyncdRecord.verify|verify} messages. + * Encodes the specified HydratedQuickReplyButton message. Does not implicitly {@link proto.HydratedQuickReplyButton.verify|verify} messages. * @function encode - * @memberof proto.SyncdRecord + * @memberof proto.HydratedQuickReplyButton * @static - * @param {proto.ISyncdRecord} message SyncdRecord message or plain object to encode + * @param {proto.IHydratedQuickReplyButton} message HydratedQuickReplyButton message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SyncdRecord.encode = function encode(message, writer) { + HydratedQuickReplyButton.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.index != null && Object.hasOwnProperty.call(message, "index")) - $root.proto.SyncdIndex.encode(message.index, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - $root.proto.SyncdValue.encode(message.value, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.keyId != null && Object.hasOwnProperty.call(message, "keyId")) - $root.proto.KeyId.encode(message.keyId, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.displayText != null && Object.hasOwnProperty.call(message, "displayText")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.displayText); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.id); return writer; }; /** - * Encodes the specified SyncdRecord message, length delimited. Does not implicitly {@link proto.SyncdRecord.verify|verify} messages. + * Encodes the specified HydratedQuickReplyButton message, length delimited. Does not implicitly {@link proto.HydratedQuickReplyButton.verify|verify} messages. * @function encodeDelimited - * @memberof proto.SyncdRecord + * @memberof proto.HydratedQuickReplyButton * @static - * @param {proto.ISyncdRecord} message SyncdRecord message or plain object to encode + * @param {proto.IHydratedQuickReplyButton} message HydratedQuickReplyButton message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SyncdRecord.encodeDelimited = function encodeDelimited(message, writer) { + HydratedQuickReplyButton.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a SyncdRecord message from the specified reader or buffer. + * Decodes a HydratedQuickReplyButton message from the specified reader or buffer. * @function decode - * @memberof proto.SyncdRecord + * @memberof proto.HydratedQuickReplyButton * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {proto.SyncdRecord} SyncdRecord + * @returns {proto.HydratedQuickReplyButton} HydratedQuickReplyButton * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SyncdRecord.decode = function decode(reader, length) { + HydratedQuickReplyButton.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.SyncdRecord(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.HydratedQuickReplyButton(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.index = $root.proto.SyncdIndex.decode(reader, reader.uint32()); + message.displayText = reader.string(); break; case 2: - message.value = $root.proto.SyncdValue.decode(reader, reader.uint32()); - break; - case 3: - message.keyId = $root.proto.KeyId.decode(reader, reader.uint32()); + message.id = reader.string(); break; default: reader.skipType(tag & 7); @@ -15406,139 +16036,119 @@ $root.proto = (function() { }; /** - * Decodes a SyncdRecord message from the specified reader or buffer, length delimited. + * Decodes a HydratedQuickReplyButton message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof proto.SyncdRecord + * @memberof proto.HydratedQuickReplyButton * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.SyncdRecord} SyncdRecord + * @returns {proto.HydratedQuickReplyButton} HydratedQuickReplyButton * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SyncdRecord.decodeDelimited = function decodeDelimited(reader) { + HydratedQuickReplyButton.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a SyncdRecord message. + * Verifies a HydratedQuickReplyButton message. * @function verify - * @memberof proto.SyncdRecord + * @memberof proto.HydratedQuickReplyButton * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - SyncdRecord.verify = function verify(message) { + HydratedQuickReplyButton.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.index != null && message.hasOwnProperty("index")) { - var error = $root.proto.SyncdIndex.verify(message.index); - if (error) - return "index." + error; - } - if (message.value != null && message.hasOwnProperty("value")) { - var error = $root.proto.SyncdValue.verify(message.value); - if (error) - return "value." + error; - } - if (message.keyId != null && message.hasOwnProperty("keyId")) { - var error = $root.proto.KeyId.verify(message.keyId); - if (error) - return "keyId." + error; - } + if (message.displayText != null && message.hasOwnProperty("displayText")) + if (!$util.isString(message.displayText)) + return "displayText: string expected"; + if (message.id != null && message.hasOwnProperty("id")) + if (!$util.isString(message.id)) + return "id: string expected"; return null; }; /** - * Creates a SyncdRecord message from a plain object. Also converts values to their respective internal types. + * Creates a HydratedQuickReplyButton message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof proto.SyncdRecord + * @memberof proto.HydratedQuickReplyButton * @static * @param {Object.} object Plain object - * @returns {proto.SyncdRecord} SyncdRecord + * @returns {proto.HydratedQuickReplyButton} HydratedQuickReplyButton */ - SyncdRecord.fromObject = function fromObject(object) { - if (object instanceof $root.proto.SyncdRecord) + HydratedQuickReplyButton.fromObject = function fromObject(object) { + if (object instanceof $root.proto.HydratedQuickReplyButton) return object; - var message = new $root.proto.SyncdRecord(); - if (object.index != null) { - if (typeof object.index !== "object") - throw TypeError(".proto.SyncdRecord.index: object expected"); - message.index = $root.proto.SyncdIndex.fromObject(object.index); - } - if (object.value != null) { - if (typeof object.value !== "object") - throw TypeError(".proto.SyncdRecord.value: object expected"); - message.value = $root.proto.SyncdValue.fromObject(object.value); - } - if (object.keyId != null) { - if (typeof object.keyId !== "object") - throw TypeError(".proto.SyncdRecord.keyId: object expected"); - message.keyId = $root.proto.KeyId.fromObject(object.keyId); - } + var message = new $root.proto.HydratedQuickReplyButton(); + if (object.displayText != null) + message.displayText = String(object.displayText); + if (object.id != null) + message.id = String(object.id); return message; }; /** - * Creates a plain object from a SyncdRecord message. Also converts values to other types if specified. + * Creates a plain object from a HydratedQuickReplyButton message. Also converts values to other types if specified. * @function toObject - * @memberof proto.SyncdRecord + * @memberof proto.HydratedQuickReplyButton * @static - * @param {proto.SyncdRecord} message SyncdRecord + * @param {proto.HydratedQuickReplyButton} message HydratedQuickReplyButton * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SyncdRecord.toObject = function toObject(message, options) { + HydratedQuickReplyButton.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.index = null; - object.value = null; - object.keyId = null; + object.displayText = ""; + object.id = ""; } - if (message.index != null && message.hasOwnProperty("index")) - object.index = $root.proto.SyncdIndex.toObject(message.index, options); - if (message.value != null && message.hasOwnProperty("value")) - object.value = $root.proto.SyncdValue.toObject(message.value, options); - if (message.keyId != null && message.hasOwnProperty("keyId")) - object.keyId = $root.proto.KeyId.toObject(message.keyId, options); + if (message.displayText != null && message.hasOwnProperty("displayText")) + object.displayText = message.displayText; + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; return object; }; /** - * Converts this SyncdRecord to JSON. + * Converts this HydratedQuickReplyButton to JSON. * @function toJSON - * @memberof proto.SyncdRecord + * @memberof proto.HydratedQuickReplyButton * @instance * @returns {Object.} JSON object */ - SyncdRecord.prototype.toJSON = function toJSON() { + HydratedQuickReplyButton.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return SyncdRecord; + return HydratedQuickReplyButton; })(); - proto.KeyId = (function() { + proto.HydratedTemplateButton = (function() { /** - * Properties of a KeyId. + * Properties of a HydratedTemplateButton. * @memberof proto - * @interface IKeyId - * @property {Uint8Array|null} [id] KeyId id + * @interface IHydratedTemplateButton + * @property {number|null} [index] HydratedTemplateButton index + * @property {proto.IHydratedQuickReplyButton|null} [quickReplyButton] HydratedTemplateButton quickReplyButton + * @property {proto.IHydratedURLButton|null} [urlButton] HydratedTemplateButton urlButton + * @property {proto.IHydratedCallButton|null} [callButton] HydratedTemplateButton callButton */ /** - * Constructs a new KeyId. + * Constructs a new HydratedTemplateButton. * @memberof proto - * @classdesc Represents a KeyId. - * @implements IKeyId + * @classdesc Represents a HydratedTemplateButton. + * @implements IHydratedTemplateButton * @constructor - * @param {proto.IKeyId=} [properties] Properties to set + * @param {proto.IHydratedTemplateButton=} [properties] Properties to set */ - function KeyId(properties) { + function HydratedTemplateButton(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -15546,75 +16156,128 @@ $root.proto = (function() { } /** - * KeyId id. - * @member {Uint8Array} id - * @memberof proto.KeyId + * HydratedTemplateButton index. + * @member {number} index + * @memberof proto.HydratedTemplateButton * @instance */ - KeyId.prototype.id = $util.newBuffer([]); + HydratedTemplateButton.prototype.index = 0; /** - * Creates a new KeyId instance using the specified properties. - * @function create - * @memberof proto.KeyId - * @static - * @param {proto.IKeyId=} [properties] Properties to set - * @returns {proto.KeyId} KeyId instance + * HydratedTemplateButton quickReplyButton. + * @member {proto.IHydratedQuickReplyButton|null|undefined} quickReplyButton + * @memberof proto.HydratedTemplateButton + * @instance */ - KeyId.create = function create(properties) { - return new KeyId(properties); - }; + HydratedTemplateButton.prototype.quickReplyButton = null; /** - * Encodes the specified KeyId message. Does not implicitly {@link proto.KeyId.verify|verify} messages. - * @function encode - * @memberof proto.KeyId - * @static - * @param {proto.IKeyId} message KeyId message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - KeyId.encode = function encode(message, writer) { + * HydratedTemplateButton urlButton. + * @member {proto.IHydratedURLButton|null|undefined} urlButton + * @memberof proto.HydratedTemplateButton + * @instance + */ + HydratedTemplateButton.prototype.urlButton = null; + + /** + * HydratedTemplateButton callButton. + * @member {proto.IHydratedCallButton|null|undefined} callButton + * @memberof proto.HydratedTemplateButton + * @instance + */ + HydratedTemplateButton.prototype.callButton = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * HydratedTemplateButton hydratedButton. + * @member {"quickReplyButton"|"urlButton"|"callButton"|undefined} hydratedButton + * @memberof proto.HydratedTemplateButton + * @instance + */ + Object.defineProperty(HydratedTemplateButton.prototype, "hydratedButton", { + get: $util.oneOfGetter($oneOfFields = ["quickReplyButton", "urlButton", "callButton"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new HydratedTemplateButton instance using the specified properties. + * @function create + * @memberof proto.HydratedTemplateButton + * @static + * @param {proto.IHydratedTemplateButton=} [properties] Properties to set + * @returns {proto.HydratedTemplateButton} HydratedTemplateButton instance + */ + HydratedTemplateButton.create = function create(properties) { + return new HydratedTemplateButton(properties); + }; + + /** + * Encodes the specified HydratedTemplateButton message. Does not implicitly {@link proto.HydratedTemplateButton.verify|verify} messages. + * @function encode + * @memberof proto.HydratedTemplateButton + * @static + * @param {proto.IHydratedTemplateButton} message HydratedTemplateButton message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HydratedTemplateButton.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.id != null && Object.hasOwnProperty.call(message, "id")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.id); + if (message.quickReplyButton != null && Object.hasOwnProperty.call(message, "quickReplyButton")) + $root.proto.HydratedQuickReplyButton.encode(message.quickReplyButton, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.urlButton != null && Object.hasOwnProperty.call(message, "urlButton")) + $root.proto.HydratedURLButton.encode(message.urlButton, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.callButton != null && Object.hasOwnProperty.call(message, "callButton")) + $root.proto.HydratedCallButton.encode(message.callButton, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.index != null && Object.hasOwnProperty.call(message, "index")) + writer.uint32(/* id 4, wireType 0 =*/32).uint32(message.index); return writer; }; /** - * Encodes the specified KeyId message, length delimited. Does not implicitly {@link proto.KeyId.verify|verify} messages. + * Encodes the specified HydratedTemplateButton message, length delimited. Does not implicitly {@link proto.HydratedTemplateButton.verify|verify} messages. * @function encodeDelimited - * @memberof proto.KeyId + * @memberof proto.HydratedTemplateButton * @static - * @param {proto.IKeyId} message KeyId message or plain object to encode + * @param {proto.IHydratedTemplateButton} message HydratedTemplateButton message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - KeyId.encodeDelimited = function encodeDelimited(message, writer) { + HydratedTemplateButton.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a KeyId message from the specified reader or buffer. + * Decodes a HydratedTemplateButton message from the specified reader or buffer. * @function decode - * @memberof proto.KeyId + * @memberof proto.HydratedTemplateButton * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {proto.KeyId} KeyId + * @returns {proto.HydratedTemplateButton} HydratedTemplateButton * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - KeyId.decode = function decode(reader, length) { + HydratedTemplateButton.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.KeyId(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.HydratedTemplateButton(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { + case 4: + message.index = reader.uint32(); + break; case 1: - message.id = reader.bytes(); + message.quickReplyButton = $root.proto.HydratedQuickReplyButton.decode(reader, reader.uint32()); + break; + case 2: + message.urlButton = $root.proto.HydratedURLButton.decode(reader, reader.uint32()); + break; + case 3: + message.callButton = $root.proto.HydratedCallButton.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -15625,116 +16288,167 @@ $root.proto = (function() { }; /** - * Decodes a KeyId message from the specified reader or buffer, length delimited. + * Decodes a HydratedTemplateButton message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof proto.KeyId + * @memberof proto.HydratedTemplateButton * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.KeyId} KeyId + * @returns {proto.HydratedTemplateButton} HydratedTemplateButton * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - KeyId.decodeDelimited = function decodeDelimited(reader) { + HydratedTemplateButton.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a KeyId message. + * Verifies a HydratedTemplateButton message. * @function verify - * @memberof proto.KeyId + * @memberof proto.HydratedTemplateButton * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - KeyId.verify = function verify(message) { + HydratedTemplateButton.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.id != null && message.hasOwnProperty("id")) - if (!(message.id && typeof message.id.length === "number" || $util.isString(message.id))) - return "id: buffer expected"; + var properties = {}; + if (message.index != null && message.hasOwnProperty("index")) + if (!$util.isInteger(message.index)) + return "index: integer expected"; + if (message.quickReplyButton != null && message.hasOwnProperty("quickReplyButton")) { + properties.hydratedButton = 1; + { + var error = $root.proto.HydratedQuickReplyButton.verify(message.quickReplyButton); + if (error) + return "quickReplyButton." + error; + } + } + if (message.urlButton != null && message.hasOwnProperty("urlButton")) { + if (properties.hydratedButton === 1) + return "hydratedButton: multiple values"; + properties.hydratedButton = 1; + { + var error = $root.proto.HydratedURLButton.verify(message.urlButton); + if (error) + return "urlButton." + error; + } + } + if (message.callButton != null && message.hasOwnProperty("callButton")) { + if (properties.hydratedButton === 1) + return "hydratedButton: multiple values"; + properties.hydratedButton = 1; + { + var error = $root.proto.HydratedCallButton.verify(message.callButton); + if (error) + return "callButton." + error; + } + } return null; }; /** - * Creates a KeyId message from a plain object. Also converts values to their respective internal types. + * Creates a HydratedTemplateButton message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof proto.KeyId + * @memberof proto.HydratedTemplateButton * @static * @param {Object.} object Plain object - * @returns {proto.KeyId} KeyId + * @returns {proto.HydratedTemplateButton} HydratedTemplateButton */ - KeyId.fromObject = function fromObject(object) { - if (object instanceof $root.proto.KeyId) + HydratedTemplateButton.fromObject = function fromObject(object) { + if (object instanceof $root.proto.HydratedTemplateButton) return object; - var message = new $root.proto.KeyId(); - if (object.id != null) - if (typeof object.id === "string") - $util.base64.decode(object.id, message.id = $util.newBuffer($util.base64.length(object.id)), 0); - else if (object.id.length) - message.id = object.id; + var message = new $root.proto.HydratedTemplateButton(); + if (object.index != null) + message.index = object.index >>> 0; + if (object.quickReplyButton != null) { + if (typeof object.quickReplyButton !== "object") + throw TypeError(".proto.HydratedTemplateButton.quickReplyButton: object expected"); + message.quickReplyButton = $root.proto.HydratedQuickReplyButton.fromObject(object.quickReplyButton); + } + if (object.urlButton != null) { + if (typeof object.urlButton !== "object") + throw TypeError(".proto.HydratedTemplateButton.urlButton: object expected"); + message.urlButton = $root.proto.HydratedURLButton.fromObject(object.urlButton); + } + if (object.callButton != null) { + if (typeof object.callButton !== "object") + throw TypeError(".proto.HydratedTemplateButton.callButton: object expected"); + message.callButton = $root.proto.HydratedCallButton.fromObject(object.callButton); + } return message; }; /** - * Creates a plain object from a KeyId message. Also converts values to other types if specified. + * Creates a plain object from a HydratedTemplateButton message. Also converts values to other types if specified. * @function toObject - * @memberof proto.KeyId + * @memberof proto.HydratedTemplateButton * @static - * @param {proto.KeyId} message KeyId + * @param {proto.HydratedTemplateButton} message HydratedTemplateButton * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - KeyId.toObject = function toObject(message, options) { + HydratedTemplateButton.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) - if (options.bytes === String) - object.id = ""; - else { - object.id = []; - if (options.bytes !== Array) - object.id = $util.newBuffer(object.id); - } - if (message.id != null && message.hasOwnProperty("id")) - object.id = options.bytes === String ? $util.base64.encode(message.id, 0, message.id.length) : options.bytes === Array ? Array.prototype.slice.call(message.id) : message.id; + object.index = 0; + if (message.quickReplyButton != null && message.hasOwnProperty("quickReplyButton")) { + object.quickReplyButton = $root.proto.HydratedQuickReplyButton.toObject(message.quickReplyButton, options); + if (options.oneofs) + object.hydratedButton = "quickReplyButton"; + } + if (message.urlButton != null && message.hasOwnProperty("urlButton")) { + object.urlButton = $root.proto.HydratedURLButton.toObject(message.urlButton, options); + if (options.oneofs) + object.hydratedButton = "urlButton"; + } + if (message.callButton != null && message.hasOwnProperty("callButton")) { + object.callButton = $root.proto.HydratedCallButton.toObject(message.callButton, options); + if (options.oneofs) + object.hydratedButton = "callButton"; + } + if (message.index != null && message.hasOwnProperty("index")) + object.index = message.index; return object; }; /** - * Converts this KeyId to JSON. + * Converts this HydratedTemplateButton to JSON. * @function toJSON - * @memberof proto.KeyId + * @memberof proto.HydratedTemplateButton * @instance * @returns {Object.} JSON object */ - KeyId.prototype.toJSON = function toJSON() { + HydratedTemplateButton.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return KeyId; + return HydratedTemplateButton; })(); - proto.SyncdValue = (function() { + proto.HydratedURLButton = (function() { /** - * Properties of a SyncdValue. + * Properties of a HydratedURLButton. * @memberof proto - * @interface ISyncdValue - * @property {Uint8Array|null} [blob] SyncdValue blob + * @interface IHydratedURLButton + * @property {string|null} [displayText] HydratedURLButton displayText + * @property {string|null} [url] HydratedURLButton url */ /** - * Constructs a new SyncdValue. + * Constructs a new HydratedURLButton. * @memberof proto - * @classdesc Represents a SyncdValue. - * @implements ISyncdValue + * @classdesc Represents a HydratedURLButton. + * @implements IHydratedURLButton * @constructor - * @param {proto.ISyncdValue=} [properties] Properties to set + * @param {proto.IHydratedURLButton=} [properties] Properties to set */ - function SyncdValue(properties) { + function HydratedURLButton(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -15742,75 +16456,88 @@ $root.proto = (function() { } /** - * SyncdValue blob. - * @member {Uint8Array} blob - * @memberof proto.SyncdValue + * HydratedURLButton displayText. + * @member {string} displayText + * @memberof proto.HydratedURLButton * @instance */ - SyncdValue.prototype.blob = $util.newBuffer([]); + HydratedURLButton.prototype.displayText = ""; /** - * Creates a new SyncdValue instance using the specified properties. + * HydratedURLButton url. + * @member {string} url + * @memberof proto.HydratedURLButton + * @instance + */ + HydratedURLButton.prototype.url = ""; + + /** + * Creates a new HydratedURLButton instance using the specified properties. * @function create - * @memberof proto.SyncdValue + * @memberof proto.HydratedURLButton * @static - * @param {proto.ISyncdValue=} [properties] Properties to set - * @returns {proto.SyncdValue} SyncdValue instance + * @param {proto.IHydratedURLButton=} [properties] Properties to set + * @returns {proto.HydratedURLButton} HydratedURLButton instance */ - SyncdValue.create = function create(properties) { - return new SyncdValue(properties); + HydratedURLButton.create = function create(properties) { + return new HydratedURLButton(properties); }; /** - * Encodes the specified SyncdValue message. Does not implicitly {@link proto.SyncdValue.verify|verify} messages. + * Encodes the specified HydratedURLButton message. Does not implicitly {@link proto.HydratedURLButton.verify|verify} messages. * @function encode - * @memberof proto.SyncdValue + * @memberof proto.HydratedURLButton * @static - * @param {proto.ISyncdValue} message SyncdValue message or plain object to encode + * @param {proto.IHydratedURLButton} message HydratedURLButton message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SyncdValue.encode = function encode(message, writer) { + HydratedURLButton.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.blob != null && Object.hasOwnProperty.call(message, "blob")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.blob); + if (message.displayText != null && Object.hasOwnProperty.call(message, "displayText")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.displayText); + if (message.url != null && Object.hasOwnProperty.call(message, "url")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.url); return writer; }; /** - * Encodes the specified SyncdValue message, length delimited. Does not implicitly {@link proto.SyncdValue.verify|verify} messages. + * Encodes the specified HydratedURLButton message, length delimited. Does not implicitly {@link proto.HydratedURLButton.verify|verify} messages. * @function encodeDelimited - * @memberof proto.SyncdValue + * @memberof proto.HydratedURLButton * @static - * @param {proto.ISyncdValue} message SyncdValue message or plain object to encode + * @param {proto.IHydratedURLButton} message HydratedURLButton message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SyncdValue.encodeDelimited = function encodeDelimited(message, writer) { + HydratedURLButton.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a SyncdValue message from the specified reader or buffer. + * Decodes a HydratedURLButton message from the specified reader or buffer. * @function decode - * @memberof proto.SyncdValue + * @memberof proto.HydratedURLButton * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {proto.SyncdValue} SyncdValue + * @returns {proto.HydratedURLButton} HydratedURLButton * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SyncdValue.decode = function decode(reader, length) { + HydratedURLButton.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.SyncdValue(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.HydratedURLButton(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.blob = reader.bytes(); + message.displayText = reader.string(); + break; + case 2: + message.url = reader.string(); break; default: reader.skipType(tag & 7); @@ -15821,116 +16548,143 @@ $root.proto = (function() { }; /** - * Decodes a SyncdValue message from the specified reader or buffer, length delimited. + * Decodes a HydratedURLButton message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof proto.SyncdValue + * @memberof proto.HydratedURLButton * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.SyncdValue} SyncdValue + * @returns {proto.HydratedURLButton} HydratedURLButton * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SyncdValue.decodeDelimited = function decodeDelimited(reader) { + HydratedURLButton.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a SyncdValue message. + * Verifies a HydratedURLButton message. * @function verify - * @memberof proto.SyncdValue + * @memberof proto.HydratedURLButton * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - SyncdValue.verify = function verify(message) { + HydratedURLButton.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.blob != null && message.hasOwnProperty("blob")) - if (!(message.blob && typeof message.blob.length === "number" || $util.isString(message.blob))) - return "blob: buffer expected"; + if (message.displayText != null && message.hasOwnProperty("displayText")) + if (!$util.isString(message.displayText)) + return "displayText: string expected"; + if (message.url != null && message.hasOwnProperty("url")) + if (!$util.isString(message.url)) + return "url: string expected"; return null; }; /** - * Creates a SyncdValue message from a plain object. Also converts values to their respective internal types. + * Creates a HydratedURLButton message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof proto.SyncdValue + * @memberof proto.HydratedURLButton * @static * @param {Object.} object Plain object - * @returns {proto.SyncdValue} SyncdValue + * @returns {proto.HydratedURLButton} HydratedURLButton */ - SyncdValue.fromObject = function fromObject(object) { - if (object instanceof $root.proto.SyncdValue) + HydratedURLButton.fromObject = function fromObject(object) { + if (object instanceof $root.proto.HydratedURLButton) return object; - var message = new $root.proto.SyncdValue(); - if (object.blob != null) - if (typeof object.blob === "string") - $util.base64.decode(object.blob, message.blob = $util.newBuffer($util.base64.length(object.blob)), 0); - else if (object.blob.length) - message.blob = object.blob; + var message = new $root.proto.HydratedURLButton(); + if (object.displayText != null) + message.displayText = String(object.displayText); + if (object.url != null) + message.url = String(object.url); return message; }; /** - * Creates a plain object from a SyncdValue message. Also converts values to other types if specified. + * Creates a plain object from a HydratedURLButton message. Also converts values to other types if specified. * @function toObject - * @memberof proto.SyncdValue + * @memberof proto.HydratedURLButton * @static - * @param {proto.SyncdValue} message SyncdValue + * @param {proto.HydratedURLButton} message HydratedURLButton * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SyncdValue.toObject = function toObject(message, options) { + HydratedURLButton.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) - if (options.bytes === String) - object.blob = ""; - else { - object.blob = []; - if (options.bytes !== Array) - object.blob = $util.newBuffer(object.blob); - } - if (message.blob != null && message.hasOwnProperty("blob")) - object.blob = options.bytes === String ? $util.base64.encode(message.blob, 0, message.blob.length) : options.bytes === Array ? Array.prototype.slice.call(message.blob) : message.blob; + if (options.defaults) { + object.displayText = ""; + object.url = ""; + } + if (message.displayText != null && message.hasOwnProperty("displayText")) + object.displayText = message.displayText; + if (message.url != null && message.hasOwnProperty("url")) + object.url = message.url; return object; }; /** - * Converts this SyncdValue to JSON. + * Converts this HydratedURLButton to JSON. * @function toJSON - * @memberof proto.SyncdValue + * @memberof proto.HydratedURLButton * @instance * @returns {Object.} JSON object */ - SyncdValue.prototype.toJSON = function toJSON() { + HydratedURLButton.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return SyncdValue; + return HydratedURLButton; })(); - proto.SyncdIndex = (function() { + proto.ImageMessage = (function() { /** - * Properties of a SyncdIndex. + * Properties of an ImageMessage. * @memberof proto - * @interface ISyncdIndex - * @property {Uint8Array|null} [blob] SyncdIndex blob + * @interface IImageMessage + * @property {string|null} [url] ImageMessage url + * @property {string|null} [mimetype] ImageMessage mimetype + * @property {string|null} [caption] ImageMessage caption + * @property {Uint8Array|null} [fileSha256] ImageMessage fileSha256 + * @property {number|Long|null} [fileLength] ImageMessage fileLength + * @property {number|null} [height] ImageMessage height + * @property {number|null} [width] ImageMessage width + * @property {Uint8Array|null} [mediaKey] ImageMessage mediaKey + * @property {Uint8Array|null} [fileEncSha256] ImageMessage fileEncSha256 + * @property {Array.|null} [interactiveAnnotations] ImageMessage interactiveAnnotations + * @property {string|null} [directPath] ImageMessage directPath + * @property {number|Long|null} [mediaKeyTimestamp] ImageMessage mediaKeyTimestamp + * @property {Uint8Array|null} [jpegThumbnail] ImageMessage jpegThumbnail + * @property {proto.IContextInfo|null} [contextInfo] ImageMessage contextInfo + * @property {Uint8Array|null} [firstScanSidecar] ImageMessage firstScanSidecar + * @property {number|null} [firstScanLength] ImageMessage firstScanLength + * @property {number|null} [experimentGroupId] ImageMessage experimentGroupId + * @property {Uint8Array|null} [scansSidecar] ImageMessage scansSidecar + * @property {Array.|null} [scanLengths] ImageMessage scanLengths + * @property {Uint8Array|null} [midQualityFileSha256] ImageMessage midQualityFileSha256 + * @property {Uint8Array|null} [midQualityFileEncSha256] ImageMessage midQualityFileEncSha256 + * @property {boolean|null} [viewOnce] ImageMessage viewOnce + * @property {string|null} [thumbnailDirectPath] ImageMessage thumbnailDirectPath + * @property {Uint8Array|null} [thumbnailSha256] ImageMessage thumbnailSha256 + * @property {Uint8Array|null} [thumbnailEncSha256] ImageMessage thumbnailEncSha256 + * @property {string|null} [staticUrl] ImageMessage staticUrl */ /** - * Constructs a new SyncdIndex. + * Constructs a new ImageMessage. * @memberof proto - * @classdesc Represents a SyncdIndex. - * @implements ISyncdIndex + * @classdesc Represents an ImageMessage. + * @implements IImageMessage * @constructor - * @param {proto.ISyncdIndex=} [properties] Properties to set + * @param {proto.IImageMessage=} [properties] Properties to set */ - function SyncdIndex(properties) { + function ImageMessage(properties) { + this.interactiveAnnotations = []; + this.scanLengths = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -15938,696 +16692,411 @@ $root.proto = (function() { } /** - * SyncdIndex blob. - * @member {Uint8Array} blob - * @memberof proto.SyncdIndex + * ImageMessage url. + * @member {string} url + * @memberof proto.ImageMessage * @instance */ - SyncdIndex.prototype.blob = $util.newBuffer([]); + ImageMessage.prototype.url = ""; /** - * Creates a new SyncdIndex instance using the specified properties. - * @function create - * @memberof proto.SyncdIndex - * @static - * @param {proto.ISyncdIndex=} [properties] Properties to set - * @returns {proto.SyncdIndex} SyncdIndex instance + * ImageMessage mimetype. + * @member {string} mimetype + * @memberof proto.ImageMessage + * @instance */ - SyncdIndex.create = function create(properties) { - return new SyncdIndex(properties); - }; + ImageMessage.prototype.mimetype = ""; /** - * Encodes the specified SyncdIndex message. Does not implicitly {@link proto.SyncdIndex.verify|verify} messages. - * @function encode - * @memberof proto.SyncdIndex - * @static - * @param {proto.ISyncdIndex} message SyncdIndex message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * ImageMessage caption. + * @member {string} caption + * @memberof proto.ImageMessage + * @instance */ - SyncdIndex.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.blob != null && Object.hasOwnProperty.call(message, "blob")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.blob); - return writer; - }; + ImageMessage.prototype.caption = ""; /** - * Encodes the specified SyncdIndex message, length delimited. Does not implicitly {@link proto.SyncdIndex.verify|verify} messages. - * @function encodeDelimited - * @memberof proto.SyncdIndex - * @static - * @param {proto.ISyncdIndex} message SyncdIndex message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * ImageMessage fileSha256. + * @member {Uint8Array} fileSha256 + * @memberof proto.ImageMessage + * @instance */ - SyncdIndex.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + ImageMessage.prototype.fileSha256 = $util.newBuffer([]); /** - * Decodes a SyncdIndex message from the specified reader or buffer. - * @function decode - * @memberof proto.SyncdIndex - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {proto.SyncdIndex} SyncdIndex - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * ImageMessage fileLength. + * @member {number|Long} fileLength + * @memberof proto.ImageMessage + * @instance */ - SyncdIndex.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.SyncdIndex(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.blob = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + ImageMessage.prototype.fileLength = $util.Long ? $util.Long.fromBits(0,0,true) : 0; /** - * Decodes a SyncdIndex message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof proto.SyncdIndex - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.SyncdIndex} SyncdIndex - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * ImageMessage height. + * @member {number} height + * @memberof proto.ImageMessage + * @instance */ - SyncdIndex.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + ImageMessage.prototype.height = 0; /** - * Verifies a SyncdIndex message. - * @function verify - * @memberof proto.SyncdIndex - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not + * ImageMessage width. + * @member {number} width + * @memberof proto.ImageMessage + * @instance */ - SyncdIndex.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.blob != null && message.hasOwnProperty("blob")) - if (!(message.blob && typeof message.blob.length === "number" || $util.isString(message.blob))) - return "blob: buffer expected"; - return null; - }; + ImageMessage.prototype.width = 0; /** - * Creates a SyncdIndex message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof proto.SyncdIndex - * @static - * @param {Object.} object Plain object - * @returns {proto.SyncdIndex} SyncdIndex + * ImageMessage mediaKey. + * @member {Uint8Array} mediaKey + * @memberof proto.ImageMessage + * @instance */ - SyncdIndex.fromObject = function fromObject(object) { - if (object instanceof $root.proto.SyncdIndex) - return object; - var message = new $root.proto.SyncdIndex(); - if (object.blob != null) - if (typeof object.blob === "string") - $util.base64.decode(object.blob, message.blob = $util.newBuffer($util.base64.length(object.blob)), 0); - else if (object.blob.length) - message.blob = object.blob; - return message; - }; + ImageMessage.prototype.mediaKey = $util.newBuffer([]); /** - * Creates a plain object from a SyncdIndex message. Also converts values to other types if specified. - * @function toObject - * @memberof proto.SyncdIndex - * @static - * @param {proto.SyncdIndex} message SyncdIndex - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object + * ImageMessage fileEncSha256. + * @member {Uint8Array} fileEncSha256 + * @memberof proto.ImageMessage + * @instance */ - SyncdIndex.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - if (options.bytes === String) - object.blob = ""; - else { - object.blob = []; - if (options.bytes !== Array) - object.blob = $util.newBuffer(object.blob); - } - if (message.blob != null && message.hasOwnProperty("blob")) - object.blob = options.bytes === String ? $util.base64.encode(message.blob, 0, message.blob.length) : options.bytes === Array ? Array.prototype.slice.call(message.blob) : message.blob; - return object; - }; + ImageMessage.prototype.fileEncSha256 = $util.newBuffer([]); /** - * Converts this SyncdIndex to JSON. - * @function toJSON - * @memberof proto.SyncdIndex + * ImageMessage interactiveAnnotations. + * @member {Array.} interactiveAnnotations + * @memberof proto.ImageMessage * @instance - * @returns {Object.} JSON object */ - SyncdIndex.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return SyncdIndex; - })(); - - proto.ExitCode = (function() { + ImageMessage.prototype.interactiveAnnotations = $util.emptyArray; /** - * Properties of an ExitCode. - * @memberof proto - * @interface IExitCode - * @property {number|Long|null} [code] ExitCode code - * @property {string|null} [text] ExitCode text + * ImageMessage directPath. + * @member {string} directPath + * @memberof proto.ImageMessage + * @instance */ + ImageMessage.prototype.directPath = ""; /** - * Constructs a new ExitCode. - * @memberof proto - * @classdesc Represents an ExitCode. - * @implements IExitCode - * @constructor - * @param {proto.IExitCode=} [properties] Properties to set + * ImageMessage mediaKeyTimestamp. + * @member {number|Long} mediaKeyTimestamp + * @memberof proto.ImageMessage + * @instance */ - function ExitCode(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + ImageMessage.prototype.mediaKeyTimestamp = $util.Long ? $util.Long.fromBits(0,0,false) : 0; /** - * ExitCode code. - * @member {number|Long} code - * @memberof proto.ExitCode + * ImageMessage jpegThumbnail. + * @member {Uint8Array} jpegThumbnail + * @memberof proto.ImageMessage * @instance */ - ExitCode.prototype.code = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + ImageMessage.prototype.jpegThumbnail = $util.newBuffer([]); /** - * ExitCode text. - * @member {string} text - * @memberof proto.ExitCode + * ImageMessage contextInfo. + * @member {proto.IContextInfo|null|undefined} contextInfo + * @memberof proto.ImageMessage * @instance */ - ExitCode.prototype.text = ""; + ImageMessage.prototype.contextInfo = null; /** - * Creates a new ExitCode instance using the specified properties. - * @function create - * @memberof proto.ExitCode - * @static - * @param {proto.IExitCode=} [properties] Properties to set - * @returns {proto.ExitCode} ExitCode instance + * ImageMessage firstScanSidecar. + * @member {Uint8Array} firstScanSidecar + * @memberof proto.ImageMessage + * @instance */ - ExitCode.create = function create(properties) { - return new ExitCode(properties); - }; + ImageMessage.prototype.firstScanSidecar = $util.newBuffer([]); /** - * Encodes the specified ExitCode message. Does not implicitly {@link proto.ExitCode.verify|verify} messages. - * @function encode - * @memberof proto.ExitCode - * @static - * @param {proto.IExitCode} message ExitCode message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * ImageMessage firstScanLength. + * @member {number} firstScanLength + * @memberof proto.ImageMessage + * @instance */ - ExitCode.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.code != null && Object.hasOwnProperty.call(message, "code")) - writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.code); - if (message.text != null && Object.hasOwnProperty.call(message, "text")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.text); - return writer; - }; + ImageMessage.prototype.firstScanLength = 0; /** - * Encodes the specified ExitCode message, length delimited. Does not implicitly {@link proto.ExitCode.verify|verify} messages. - * @function encodeDelimited - * @memberof proto.ExitCode - * @static - * @param {proto.IExitCode} message ExitCode message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * ImageMessage experimentGroupId. + * @member {number} experimentGroupId + * @memberof proto.ImageMessage + * @instance */ - ExitCode.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + ImageMessage.prototype.experimentGroupId = 0; /** - * Decodes an ExitCode message from the specified reader or buffer. - * @function decode - * @memberof proto.ExitCode - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {proto.ExitCode} ExitCode - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * ImageMessage scansSidecar. + * @member {Uint8Array} scansSidecar + * @memberof proto.ImageMessage + * @instance */ - ExitCode.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.ExitCode(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.code = reader.uint64(); - break; - case 2: - message.text = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + ImageMessage.prototype.scansSidecar = $util.newBuffer([]); /** - * Decodes an ExitCode message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof proto.ExitCode - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.ExitCode} ExitCode - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * ImageMessage scanLengths. + * @member {Array.} scanLengths + * @memberof proto.ImageMessage + * @instance */ - ExitCode.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + ImageMessage.prototype.scanLengths = $util.emptyArray; /** - * Verifies an ExitCode message. - * @function verify - * @memberof proto.ExitCode - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not + * ImageMessage midQualityFileSha256. + * @member {Uint8Array} midQualityFileSha256 + * @memberof proto.ImageMessage + * @instance */ - ExitCode.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.code != null && message.hasOwnProperty("code")) - if (!$util.isInteger(message.code) && !(message.code && $util.isInteger(message.code.low) && $util.isInteger(message.code.high))) - return "code: integer|Long expected"; - if (message.text != null && message.hasOwnProperty("text")) - if (!$util.isString(message.text)) - return "text: string expected"; - return null; - }; + ImageMessage.prototype.midQualityFileSha256 = $util.newBuffer([]); /** - * Creates an ExitCode message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof proto.ExitCode - * @static - * @param {Object.} object Plain object - * @returns {proto.ExitCode} ExitCode + * ImageMessage midQualityFileEncSha256. + * @member {Uint8Array} midQualityFileEncSha256 + * @memberof proto.ImageMessage + * @instance */ - ExitCode.fromObject = function fromObject(object) { - if (object instanceof $root.proto.ExitCode) - return object; - var message = new $root.proto.ExitCode(); - if (object.code != null) - if ($util.Long) - (message.code = $util.Long.fromValue(object.code)).unsigned = true; - else if (typeof object.code === "string") - message.code = parseInt(object.code, 10); - else if (typeof object.code === "number") - message.code = object.code; - else if (typeof object.code === "object") - message.code = new $util.LongBits(object.code.low >>> 0, object.code.high >>> 0).toNumber(true); - if (object.text != null) - message.text = String(object.text); - return message; - }; + ImageMessage.prototype.midQualityFileEncSha256 = $util.newBuffer([]); /** - * Creates a plain object from an ExitCode message. Also converts values to other types if specified. - * @function toObject - * @memberof proto.ExitCode - * @static - * @param {proto.ExitCode} message ExitCode - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object + * ImageMessage viewOnce. + * @member {boolean} viewOnce + * @memberof proto.ImageMessage + * @instance */ - ExitCode.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.code = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.code = options.longs === String ? "0" : 0; - object.text = ""; - } - if (message.code != null && message.hasOwnProperty("code")) - if (typeof message.code === "number") - object.code = options.longs === String ? String(message.code) : message.code; - else - object.code = options.longs === String ? $util.Long.prototype.toString.call(message.code) : options.longs === Number ? new $util.LongBits(message.code.low >>> 0, message.code.high >>> 0).toNumber(true) : message.code; - if (message.text != null && message.hasOwnProperty("text")) - object.text = message.text; - return object; - }; + ImageMessage.prototype.viewOnce = false; /** - * Converts this ExitCode to JSON. - * @function toJSON - * @memberof proto.ExitCode + * ImageMessage thumbnailDirectPath. + * @member {string} thumbnailDirectPath + * @memberof proto.ImageMessage * @instance - * @returns {Object.} JSON object */ - ExitCode.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ExitCode; - })(); - - proto.SyncdVersion = (function() { + ImageMessage.prototype.thumbnailDirectPath = ""; /** - * Properties of a SyncdVersion. - * @memberof proto - * @interface ISyncdVersion - * @property {number|Long|null} [version] SyncdVersion version + * ImageMessage thumbnailSha256. + * @member {Uint8Array} thumbnailSha256 + * @memberof proto.ImageMessage + * @instance */ + ImageMessage.prototype.thumbnailSha256 = $util.newBuffer([]); /** - * Constructs a new SyncdVersion. - * @memberof proto - * @classdesc Represents a SyncdVersion. - * @implements ISyncdVersion - * @constructor - * @param {proto.ISyncdVersion=} [properties] Properties to set + * ImageMessage thumbnailEncSha256. + * @member {Uint8Array} thumbnailEncSha256 + * @memberof proto.ImageMessage + * @instance */ - function SyncdVersion(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + ImageMessage.prototype.thumbnailEncSha256 = $util.newBuffer([]); /** - * SyncdVersion version. - * @member {number|Long} version - * @memberof proto.SyncdVersion + * ImageMessage staticUrl. + * @member {string} staticUrl + * @memberof proto.ImageMessage * @instance */ - SyncdVersion.prototype.version = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + ImageMessage.prototype.staticUrl = ""; /** - * Creates a new SyncdVersion instance using the specified properties. + * Creates a new ImageMessage instance using the specified properties. * @function create - * @memberof proto.SyncdVersion + * @memberof proto.ImageMessage * @static - * @param {proto.ISyncdVersion=} [properties] Properties to set - * @returns {proto.SyncdVersion} SyncdVersion instance + * @param {proto.IImageMessage=} [properties] Properties to set + * @returns {proto.ImageMessage} ImageMessage instance */ - SyncdVersion.create = function create(properties) { - return new SyncdVersion(properties); + ImageMessage.create = function create(properties) { + return new ImageMessage(properties); }; /** - * Encodes the specified SyncdVersion message. Does not implicitly {@link proto.SyncdVersion.verify|verify} messages. + * Encodes the specified ImageMessage message. Does not implicitly {@link proto.ImageMessage.verify|verify} messages. * @function encode - * @memberof proto.SyncdVersion + * @memberof proto.ImageMessage * @static - * @param {proto.ISyncdVersion} message SyncdVersion message or plain object to encode + * @param {proto.IImageMessage} message ImageMessage message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SyncdVersion.encode = function encode(message, writer) { + ImageMessage.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.version != null && Object.hasOwnProperty.call(message, "version")) - writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.version); + if (message.url != null && Object.hasOwnProperty.call(message, "url")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.url); + if (message.mimetype != null && Object.hasOwnProperty.call(message, "mimetype")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.mimetype); + if (message.caption != null && Object.hasOwnProperty.call(message, "caption")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.caption); + if (message.fileSha256 != null && Object.hasOwnProperty.call(message, "fileSha256")) + writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.fileSha256); + if (message.fileLength != null && Object.hasOwnProperty.call(message, "fileLength")) + writer.uint32(/* id 5, wireType 0 =*/40).uint64(message.fileLength); + if (message.height != null && Object.hasOwnProperty.call(message, "height")) + writer.uint32(/* id 6, wireType 0 =*/48).uint32(message.height); + if (message.width != null && Object.hasOwnProperty.call(message, "width")) + writer.uint32(/* id 7, wireType 0 =*/56).uint32(message.width); + if (message.mediaKey != null && Object.hasOwnProperty.call(message, "mediaKey")) + writer.uint32(/* id 8, wireType 2 =*/66).bytes(message.mediaKey); + if (message.fileEncSha256 != null && Object.hasOwnProperty.call(message, "fileEncSha256")) + writer.uint32(/* id 9, wireType 2 =*/74).bytes(message.fileEncSha256); + if (message.interactiveAnnotations != null && message.interactiveAnnotations.length) + for (var i = 0; i < message.interactiveAnnotations.length; ++i) + $root.proto.InteractiveAnnotation.encode(message.interactiveAnnotations[i], writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.directPath != null && Object.hasOwnProperty.call(message, "directPath")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.directPath); + if (message.mediaKeyTimestamp != null && Object.hasOwnProperty.call(message, "mediaKeyTimestamp")) + writer.uint32(/* id 12, wireType 0 =*/96).int64(message.mediaKeyTimestamp); + if (message.jpegThumbnail != null && Object.hasOwnProperty.call(message, "jpegThumbnail")) + writer.uint32(/* id 16, wireType 2 =*/130).bytes(message.jpegThumbnail); + if (message.contextInfo != null && Object.hasOwnProperty.call(message, "contextInfo")) + $root.proto.ContextInfo.encode(message.contextInfo, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); + if (message.firstScanSidecar != null && Object.hasOwnProperty.call(message, "firstScanSidecar")) + writer.uint32(/* id 18, wireType 2 =*/146).bytes(message.firstScanSidecar); + if (message.firstScanLength != null && Object.hasOwnProperty.call(message, "firstScanLength")) + writer.uint32(/* id 19, wireType 0 =*/152).uint32(message.firstScanLength); + if (message.experimentGroupId != null && Object.hasOwnProperty.call(message, "experimentGroupId")) + writer.uint32(/* id 20, wireType 0 =*/160).uint32(message.experimentGroupId); + if (message.scansSidecar != null && Object.hasOwnProperty.call(message, "scansSidecar")) + writer.uint32(/* id 21, wireType 2 =*/170).bytes(message.scansSidecar); + if (message.scanLengths != null && message.scanLengths.length) + for (var i = 0; i < message.scanLengths.length; ++i) + writer.uint32(/* id 22, wireType 0 =*/176).uint32(message.scanLengths[i]); + if (message.midQualityFileSha256 != null && Object.hasOwnProperty.call(message, "midQualityFileSha256")) + writer.uint32(/* id 23, wireType 2 =*/186).bytes(message.midQualityFileSha256); + if (message.midQualityFileEncSha256 != null && Object.hasOwnProperty.call(message, "midQualityFileEncSha256")) + writer.uint32(/* id 24, wireType 2 =*/194).bytes(message.midQualityFileEncSha256); + if (message.viewOnce != null && Object.hasOwnProperty.call(message, "viewOnce")) + writer.uint32(/* id 25, wireType 0 =*/200).bool(message.viewOnce); + if (message.thumbnailDirectPath != null && Object.hasOwnProperty.call(message, "thumbnailDirectPath")) + writer.uint32(/* id 26, wireType 2 =*/210).string(message.thumbnailDirectPath); + if (message.thumbnailSha256 != null && Object.hasOwnProperty.call(message, "thumbnailSha256")) + writer.uint32(/* id 27, wireType 2 =*/218).bytes(message.thumbnailSha256); + if (message.thumbnailEncSha256 != null && Object.hasOwnProperty.call(message, "thumbnailEncSha256")) + writer.uint32(/* id 28, wireType 2 =*/226).bytes(message.thumbnailEncSha256); + if (message.staticUrl != null && Object.hasOwnProperty.call(message, "staticUrl")) + writer.uint32(/* id 29, wireType 2 =*/234).string(message.staticUrl); return writer; }; /** - * Encodes the specified SyncdVersion message, length delimited. Does not implicitly {@link proto.SyncdVersion.verify|verify} messages. + * Encodes the specified ImageMessage message, length delimited. Does not implicitly {@link proto.ImageMessage.verify|verify} messages. * @function encodeDelimited - * @memberof proto.SyncdVersion + * @memberof proto.ImageMessage * @static - * @param {proto.ISyncdVersion} message SyncdVersion message or plain object to encode + * @param {proto.IImageMessage} message ImageMessage message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SyncdVersion.encodeDelimited = function encodeDelimited(message, writer) { + ImageMessage.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a SyncdVersion message from the specified reader or buffer. + * Decodes an ImageMessage message from the specified reader or buffer. * @function decode - * @memberof proto.SyncdVersion + * @memberof proto.ImageMessage * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {proto.SyncdVersion} SyncdVersion + * @returns {proto.ImageMessage} ImageMessage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SyncdVersion.decode = function decode(reader, length) { + ImageMessage.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.SyncdVersion(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.ImageMessage(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.version = reader.uint64(); + message.url = reader.string(); break; - default: - reader.skipType(tag & 7); + case 2: + message.mimetype = reader.string(); break; - } - } - return message; - }; - - /** - * Decodes a SyncdVersion message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof proto.SyncdVersion - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.SyncdVersion} SyncdVersion - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SyncdVersion.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SyncdVersion message. - * @function verify - * @memberof proto.SyncdVersion - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SyncdVersion.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.version != null && message.hasOwnProperty("version")) - if (!$util.isInteger(message.version) && !(message.version && $util.isInteger(message.version.low) && $util.isInteger(message.version.high))) - return "version: integer|Long expected"; - return null; - }; - - /** - * Creates a SyncdVersion message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof proto.SyncdVersion - * @static - * @param {Object.} object Plain object - * @returns {proto.SyncdVersion} SyncdVersion - */ - SyncdVersion.fromObject = function fromObject(object) { - if (object instanceof $root.proto.SyncdVersion) - return object; - var message = new $root.proto.SyncdVersion(); - if (object.version != null) - if ($util.Long) - (message.version = $util.Long.fromValue(object.version)).unsigned = true; - else if (typeof object.version === "string") - message.version = parseInt(object.version, 10); - else if (typeof object.version === "number") - message.version = object.version; - else if (typeof object.version === "object") - message.version = new $util.LongBits(object.version.low >>> 0, object.version.high >>> 0).toNumber(true); - return message; - }; - - /** - * Creates a plain object from a SyncdVersion message. Also converts values to other types if specified. - * @function toObject - * @memberof proto.SyncdVersion - * @static - * @param {proto.SyncdVersion} message SyncdVersion - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SyncdVersion.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.version = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.version = options.longs === String ? "0" : 0; - if (message.version != null && message.hasOwnProperty("version")) - if (typeof message.version === "number") - object.version = options.longs === String ? String(message.version) : message.version; - else - object.version = options.longs === String ? $util.Long.prototype.toString.call(message.version) : options.longs === Number ? new $util.LongBits(message.version.low >>> 0, message.version.high >>> 0).toNumber(true) : message.version; - return object; - }; - - /** - * Converts this SyncdVersion to JSON. - * @function toJSON - * @memberof proto.SyncdVersion - * @instance - * @returns {Object.} JSON object - */ - SyncdVersion.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return SyncdVersion; - })(); - - proto.ServerErrorReceipt = (function() { - - /** - * Properties of a ServerErrorReceipt. - * @memberof proto - * @interface IServerErrorReceipt - * @property {string|null} [stanzaId] ServerErrorReceipt stanzaId - */ - - /** - * Constructs a new ServerErrorReceipt. - * @memberof proto - * @classdesc Represents a ServerErrorReceipt. - * @implements IServerErrorReceipt - * @constructor - * @param {proto.IServerErrorReceipt=} [properties] Properties to set - */ - function ServerErrorReceipt(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ServerErrorReceipt stanzaId. - * @member {string} stanzaId - * @memberof proto.ServerErrorReceipt - * @instance - */ - ServerErrorReceipt.prototype.stanzaId = ""; - - /** - * Creates a new ServerErrorReceipt instance using the specified properties. - * @function create - * @memberof proto.ServerErrorReceipt - * @static - * @param {proto.IServerErrorReceipt=} [properties] Properties to set - * @returns {proto.ServerErrorReceipt} ServerErrorReceipt instance - */ - ServerErrorReceipt.create = function create(properties) { - return new ServerErrorReceipt(properties); - }; - - /** - * Encodes the specified ServerErrorReceipt message. Does not implicitly {@link proto.ServerErrorReceipt.verify|verify} messages. - * @function encode - * @memberof proto.ServerErrorReceipt - * @static - * @param {proto.IServerErrorReceipt} message ServerErrorReceipt message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ServerErrorReceipt.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.stanzaId != null && Object.hasOwnProperty.call(message, "stanzaId")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.stanzaId); - return writer; - }; - - /** - * Encodes the specified ServerErrorReceipt message, length delimited. Does not implicitly {@link proto.ServerErrorReceipt.verify|verify} messages. - * @function encodeDelimited - * @memberof proto.ServerErrorReceipt - * @static - * @param {proto.IServerErrorReceipt} message ServerErrorReceipt message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ServerErrorReceipt.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ServerErrorReceipt message from the specified reader or buffer. - * @function decode - * @memberof proto.ServerErrorReceipt - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {proto.ServerErrorReceipt} ServerErrorReceipt - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ServerErrorReceipt.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.ServerErrorReceipt(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.stanzaId = reader.string(); + case 3: + message.caption = reader.string(); + break; + case 4: + message.fileSha256 = reader.bytes(); + break; + case 5: + message.fileLength = reader.uint64(); + break; + case 6: + message.height = reader.uint32(); + break; + case 7: + message.width = reader.uint32(); + break; + case 8: + message.mediaKey = reader.bytes(); + break; + case 9: + message.fileEncSha256 = reader.bytes(); + break; + case 10: + if (!(message.interactiveAnnotations && message.interactiveAnnotations.length)) + message.interactiveAnnotations = []; + message.interactiveAnnotations.push($root.proto.InteractiveAnnotation.decode(reader, reader.uint32())); + break; + case 11: + message.directPath = reader.string(); + break; + case 12: + message.mediaKeyTimestamp = reader.int64(); + break; + case 16: + message.jpegThumbnail = reader.bytes(); + break; + case 17: + message.contextInfo = $root.proto.ContextInfo.decode(reader, reader.uint32()); + break; + case 18: + message.firstScanSidecar = reader.bytes(); + break; + case 19: + message.firstScanLength = reader.uint32(); + break; + case 20: + message.experimentGroupId = reader.uint32(); + break; + case 21: + message.scansSidecar = reader.bytes(); + break; + case 22: + if (!(message.scanLengths && message.scanLengths.length)) + message.scanLengths = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.scanLengths.push(reader.uint32()); + } else + message.scanLengths.push(reader.uint32()); + break; + case 23: + message.midQualityFileSha256 = reader.bytes(); + break; + case 24: + message.midQualityFileEncSha256 = reader.bytes(); + break; + case 25: + message.viewOnce = reader.bool(); + break; + case 26: + message.thumbnailDirectPath = reader.string(); + break; + case 27: + message.thumbnailSha256 = reader.bytes(); + break; + case 28: + message.thumbnailEncSha256 = reader.bytes(); + break; + case 29: + message.staticUrl = reader.string(); break; default: reader.skipType(tag & 7); @@ -16638,109 +17107,462 @@ $root.proto = (function() { }; /** - * Decodes a ServerErrorReceipt message from the specified reader or buffer, length delimited. + * Decodes an ImageMessage message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof proto.ServerErrorReceipt + * @memberof proto.ImageMessage * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.ServerErrorReceipt} ServerErrorReceipt + * @returns {proto.ImageMessage} ImageMessage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ServerErrorReceipt.decodeDelimited = function decodeDelimited(reader) { + ImageMessage.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ServerErrorReceipt message. + * Verifies an ImageMessage message. * @function verify - * @memberof proto.ServerErrorReceipt + * @memberof proto.ImageMessage * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ServerErrorReceipt.verify = function verify(message) { + ImageMessage.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.stanzaId != null && message.hasOwnProperty("stanzaId")) - if (!$util.isString(message.stanzaId)) - return "stanzaId: string expected"; + if (message.url != null && message.hasOwnProperty("url")) + if (!$util.isString(message.url)) + return "url: string expected"; + if (message.mimetype != null && message.hasOwnProperty("mimetype")) + if (!$util.isString(message.mimetype)) + return "mimetype: string expected"; + if (message.caption != null && message.hasOwnProperty("caption")) + if (!$util.isString(message.caption)) + return "caption: string expected"; + if (message.fileSha256 != null && message.hasOwnProperty("fileSha256")) + if (!(message.fileSha256 && typeof message.fileSha256.length === "number" || $util.isString(message.fileSha256))) + return "fileSha256: buffer expected"; + if (message.fileLength != null && message.hasOwnProperty("fileLength")) + if (!$util.isInteger(message.fileLength) && !(message.fileLength && $util.isInteger(message.fileLength.low) && $util.isInteger(message.fileLength.high))) + return "fileLength: integer|Long expected"; + if (message.height != null && message.hasOwnProperty("height")) + if (!$util.isInteger(message.height)) + return "height: integer expected"; + if (message.width != null && message.hasOwnProperty("width")) + if (!$util.isInteger(message.width)) + return "width: integer expected"; + if (message.mediaKey != null && message.hasOwnProperty("mediaKey")) + if (!(message.mediaKey && typeof message.mediaKey.length === "number" || $util.isString(message.mediaKey))) + return "mediaKey: buffer expected"; + if (message.fileEncSha256 != null && message.hasOwnProperty("fileEncSha256")) + if (!(message.fileEncSha256 && typeof message.fileEncSha256.length === "number" || $util.isString(message.fileEncSha256))) + return "fileEncSha256: buffer expected"; + if (message.interactiveAnnotations != null && message.hasOwnProperty("interactiveAnnotations")) { + if (!Array.isArray(message.interactiveAnnotations)) + return "interactiveAnnotations: array expected"; + for (var i = 0; i < message.interactiveAnnotations.length; ++i) { + var error = $root.proto.InteractiveAnnotation.verify(message.interactiveAnnotations[i]); + if (error) + return "interactiveAnnotations." + error; + } + } + if (message.directPath != null && message.hasOwnProperty("directPath")) + if (!$util.isString(message.directPath)) + return "directPath: string expected"; + if (message.mediaKeyTimestamp != null && message.hasOwnProperty("mediaKeyTimestamp")) + if (!$util.isInteger(message.mediaKeyTimestamp) && !(message.mediaKeyTimestamp && $util.isInteger(message.mediaKeyTimestamp.low) && $util.isInteger(message.mediaKeyTimestamp.high))) + return "mediaKeyTimestamp: integer|Long expected"; + if (message.jpegThumbnail != null && message.hasOwnProperty("jpegThumbnail")) + if (!(message.jpegThumbnail && typeof message.jpegThumbnail.length === "number" || $util.isString(message.jpegThumbnail))) + return "jpegThumbnail: buffer expected"; + if (message.contextInfo != null && message.hasOwnProperty("contextInfo")) { + var error = $root.proto.ContextInfo.verify(message.contextInfo); + if (error) + return "contextInfo." + error; + } + if (message.firstScanSidecar != null && message.hasOwnProperty("firstScanSidecar")) + if (!(message.firstScanSidecar && typeof message.firstScanSidecar.length === "number" || $util.isString(message.firstScanSidecar))) + return "firstScanSidecar: buffer expected"; + if (message.firstScanLength != null && message.hasOwnProperty("firstScanLength")) + if (!$util.isInteger(message.firstScanLength)) + return "firstScanLength: integer expected"; + if (message.experimentGroupId != null && message.hasOwnProperty("experimentGroupId")) + if (!$util.isInteger(message.experimentGroupId)) + return "experimentGroupId: integer expected"; + if (message.scansSidecar != null && message.hasOwnProperty("scansSidecar")) + if (!(message.scansSidecar && typeof message.scansSidecar.length === "number" || $util.isString(message.scansSidecar))) + return "scansSidecar: buffer expected"; + if (message.scanLengths != null && message.hasOwnProperty("scanLengths")) { + if (!Array.isArray(message.scanLengths)) + return "scanLengths: array expected"; + for (var i = 0; i < message.scanLengths.length; ++i) + if (!$util.isInteger(message.scanLengths[i])) + return "scanLengths: integer[] expected"; + } + if (message.midQualityFileSha256 != null && message.hasOwnProperty("midQualityFileSha256")) + if (!(message.midQualityFileSha256 && typeof message.midQualityFileSha256.length === "number" || $util.isString(message.midQualityFileSha256))) + return "midQualityFileSha256: buffer expected"; + if (message.midQualityFileEncSha256 != null && message.hasOwnProperty("midQualityFileEncSha256")) + if (!(message.midQualityFileEncSha256 && typeof message.midQualityFileEncSha256.length === "number" || $util.isString(message.midQualityFileEncSha256))) + return "midQualityFileEncSha256: buffer expected"; + if (message.viewOnce != null && message.hasOwnProperty("viewOnce")) + if (typeof message.viewOnce !== "boolean") + return "viewOnce: boolean expected"; + if (message.thumbnailDirectPath != null && message.hasOwnProperty("thumbnailDirectPath")) + if (!$util.isString(message.thumbnailDirectPath)) + return "thumbnailDirectPath: string expected"; + if (message.thumbnailSha256 != null && message.hasOwnProperty("thumbnailSha256")) + if (!(message.thumbnailSha256 && typeof message.thumbnailSha256.length === "number" || $util.isString(message.thumbnailSha256))) + return "thumbnailSha256: buffer expected"; + if (message.thumbnailEncSha256 != null && message.hasOwnProperty("thumbnailEncSha256")) + if (!(message.thumbnailEncSha256 && typeof message.thumbnailEncSha256.length === "number" || $util.isString(message.thumbnailEncSha256))) + return "thumbnailEncSha256: buffer expected"; + if (message.staticUrl != null && message.hasOwnProperty("staticUrl")) + if (!$util.isString(message.staticUrl)) + return "staticUrl: string expected"; return null; }; /** - * Creates a ServerErrorReceipt message from a plain object. Also converts values to their respective internal types. + * Creates an ImageMessage message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof proto.ServerErrorReceipt + * @memberof proto.ImageMessage * @static * @param {Object.} object Plain object - * @returns {proto.ServerErrorReceipt} ServerErrorReceipt + * @returns {proto.ImageMessage} ImageMessage */ - ServerErrorReceipt.fromObject = function fromObject(object) { - if (object instanceof $root.proto.ServerErrorReceipt) + ImageMessage.fromObject = function fromObject(object) { + if (object instanceof $root.proto.ImageMessage) return object; - var message = new $root.proto.ServerErrorReceipt(); - if (object.stanzaId != null) - message.stanzaId = String(object.stanzaId); + var message = new $root.proto.ImageMessage(); + if (object.url != null) + message.url = String(object.url); + if (object.mimetype != null) + message.mimetype = String(object.mimetype); + if (object.caption != null) + message.caption = String(object.caption); + if (object.fileSha256 != null) + if (typeof object.fileSha256 === "string") + $util.base64.decode(object.fileSha256, message.fileSha256 = $util.newBuffer($util.base64.length(object.fileSha256)), 0); + else if (object.fileSha256.length) + message.fileSha256 = object.fileSha256; + if (object.fileLength != null) + if ($util.Long) + (message.fileLength = $util.Long.fromValue(object.fileLength)).unsigned = true; + else if (typeof object.fileLength === "string") + message.fileLength = parseInt(object.fileLength, 10); + else if (typeof object.fileLength === "number") + message.fileLength = object.fileLength; + else if (typeof object.fileLength === "object") + message.fileLength = new $util.LongBits(object.fileLength.low >>> 0, object.fileLength.high >>> 0).toNumber(true); + if (object.height != null) + message.height = object.height >>> 0; + if (object.width != null) + message.width = object.width >>> 0; + if (object.mediaKey != null) + if (typeof object.mediaKey === "string") + $util.base64.decode(object.mediaKey, message.mediaKey = $util.newBuffer($util.base64.length(object.mediaKey)), 0); + else if (object.mediaKey.length) + message.mediaKey = object.mediaKey; + if (object.fileEncSha256 != null) + if (typeof object.fileEncSha256 === "string") + $util.base64.decode(object.fileEncSha256, message.fileEncSha256 = $util.newBuffer($util.base64.length(object.fileEncSha256)), 0); + else if (object.fileEncSha256.length) + message.fileEncSha256 = object.fileEncSha256; + if (object.interactiveAnnotations) { + if (!Array.isArray(object.interactiveAnnotations)) + throw TypeError(".proto.ImageMessage.interactiveAnnotations: array expected"); + message.interactiveAnnotations = []; + for (var i = 0; i < object.interactiveAnnotations.length; ++i) { + if (typeof object.interactiveAnnotations[i] !== "object") + throw TypeError(".proto.ImageMessage.interactiveAnnotations: object expected"); + message.interactiveAnnotations[i] = $root.proto.InteractiveAnnotation.fromObject(object.interactiveAnnotations[i]); + } + } + if (object.directPath != null) + message.directPath = String(object.directPath); + if (object.mediaKeyTimestamp != null) + if ($util.Long) + (message.mediaKeyTimestamp = $util.Long.fromValue(object.mediaKeyTimestamp)).unsigned = false; + else if (typeof object.mediaKeyTimestamp === "string") + message.mediaKeyTimestamp = parseInt(object.mediaKeyTimestamp, 10); + else if (typeof object.mediaKeyTimestamp === "number") + message.mediaKeyTimestamp = object.mediaKeyTimestamp; + else if (typeof object.mediaKeyTimestamp === "object") + message.mediaKeyTimestamp = new $util.LongBits(object.mediaKeyTimestamp.low >>> 0, object.mediaKeyTimestamp.high >>> 0).toNumber(); + if (object.jpegThumbnail != null) + if (typeof object.jpegThumbnail === "string") + $util.base64.decode(object.jpegThumbnail, message.jpegThumbnail = $util.newBuffer($util.base64.length(object.jpegThumbnail)), 0); + else if (object.jpegThumbnail.length) + message.jpegThumbnail = object.jpegThumbnail; + if (object.contextInfo != null) { + if (typeof object.contextInfo !== "object") + throw TypeError(".proto.ImageMessage.contextInfo: object expected"); + message.contextInfo = $root.proto.ContextInfo.fromObject(object.contextInfo); + } + if (object.firstScanSidecar != null) + if (typeof object.firstScanSidecar === "string") + $util.base64.decode(object.firstScanSidecar, message.firstScanSidecar = $util.newBuffer($util.base64.length(object.firstScanSidecar)), 0); + else if (object.firstScanSidecar.length) + message.firstScanSidecar = object.firstScanSidecar; + if (object.firstScanLength != null) + message.firstScanLength = object.firstScanLength >>> 0; + if (object.experimentGroupId != null) + message.experimentGroupId = object.experimentGroupId >>> 0; + if (object.scansSidecar != null) + if (typeof object.scansSidecar === "string") + $util.base64.decode(object.scansSidecar, message.scansSidecar = $util.newBuffer($util.base64.length(object.scansSidecar)), 0); + else if (object.scansSidecar.length) + message.scansSidecar = object.scansSidecar; + if (object.scanLengths) { + if (!Array.isArray(object.scanLengths)) + throw TypeError(".proto.ImageMessage.scanLengths: array expected"); + message.scanLengths = []; + for (var i = 0; i < object.scanLengths.length; ++i) + message.scanLengths[i] = object.scanLengths[i] >>> 0; + } + if (object.midQualityFileSha256 != null) + if (typeof object.midQualityFileSha256 === "string") + $util.base64.decode(object.midQualityFileSha256, message.midQualityFileSha256 = $util.newBuffer($util.base64.length(object.midQualityFileSha256)), 0); + else if (object.midQualityFileSha256.length) + message.midQualityFileSha256 = object.midQualityFileSha256; + if (object.midQualityFileEncSha256 != null) + if (typeof object.midQualityFileEncSha256 === "string") + $util.base64.decode(object.midQualityFileEncSha256, message.midQualityFileEncSha256 = $util.newBuffer($util.base64.length(object.midQualityFileEncSha256)), 0); + else if (object.midQualityFileEncSha256.length) + message.midQualityFileEncSha256 = object.midQualityFileEncSha256; + if (object.viewOnce != null) + message.viewOnce = Boolean(object.viewOnce); + if (object.thumbnailDirectPath != null) + message.thumbnailDirectPath = String(object.thumbnailDirectPath); + if (object.thumbnailSha256 != null) + if (typeof object.thumbnailSha256 === "string") + $util.base64.decode(object.thumbnailSha256, message.thumbnailSha256 = $util.newBuffer($util.base64.length(object.thumbnailSha256)), 0); + else if (object.thumbnailSha256.length) + message.thumbnailSha256 = object.thumbnailSha256; + if (object.thumbnailEncSha256 != null) + if (typeof object.thumbnailEncSha256 === "string") + $util.base64.decode(object.thumbnailEncSha256, message.thumbnailEncSha256 = $util.newBuffer($util.base64.length(object.thumbnailEncSha256)), 0); + else if (object.thumbnailEncSha256.length) + message.thumbnailEncSha256 = object.thumbnailEncSha256; + if (object.staticUrl != null) + message.staticUrl = String(object.staticUrl); return message; }; /** - * Creates a plain object from a ServerErrorReceipt message. Also converts values to other types if specified. + * Creates a plain object from an ImageMessage message. Also converts values to other types if specified. * @function toObject - * @memberof proto.ServerErrorReceipt + * @memberof proto.ImageMessage * @static - * @param {proto.ServerErrorReceipt} message ServerErrorReceipt + * @param {proto.ImageMessage} message ImageMessage * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ServerErrorReceipt.toObject = function toObject(message, options) { + ImageMessage.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) - object.stanzaId = ""; - if (message.stanzaId != null && message.hasOwnProperty("stanzaId")) - object.stanzaId = message.stanzaId; - return object; - }; - - /** - * Converts this ServerErrorReceipt to JSON. - * @function toJSON - * @memberof proto.ServerErrorReceipt - * @instance - * @returns {Object.} JSON object - */ - ServerErrorReceipt.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ServerErrorReceipt; - })(); - - proto.MediaRetryNotification = (function() { - - /** - * Properties of a MediaRetryNotification. - * @memberof proto - * @interface IMediaRetryNotification - * @property {string|null} [stanzaId] MediaRetryNotification stanzaId - * @property {string|null} [directPath] MediaRetryNotification directPath - * @property {proto.MediaRetryNotification.MediaRetryNotificationResultType|null} [result] MediaRetryNotification result + if (options.arrays || options.defaults) { + object.interactiveAnnotations = []; + object.scanLengths = []; + } + if (options.defaults) { + object.url = ""; + object.mimetype = ""; + object.caption = ""; + if (options.bytes === String) + object.fileSha256 = ""; + else { + object.fileSha256 = []; + if (options.bytes !== Array) + object.fileSha256 = $util.newBuffer(object.fileSha256); + } + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.fileLength = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.fileLength = options.longs === String ? "0" : 0; + object.height = 0; + object.width = 0; + if (options.bytes === String) + object.mediaKey = ""; + else { + object.mediaKey = []; + if (options.bytes !== Array) + object.mediaKey = $util.newBuffer(object.mediaKey); + } + if (options.bytes === String) + object.fileEncSha256 = ""; + else { + object.fileEncSha256 = []; + if (options.bytes !== Array) + object.fileEncSha256 = $util.newBuffer(object.fileEncSha256); + } + object.directPath = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.mediaKeyTimestamp = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.mediaKeyTimestamp = options.longs === String ? "0" : 0; + if (options.bytes === String) + object.jpegThumbnail = ""; + else { + object.jpegThumbnail = []; + if (options.bytes !== Array) + object.jpegThumbnail = $util.newBuffer(object.jpegThumbnail); + } + object.contextInfo = null; + if (options.bytes === String) + object.firstScanSidecar = ""; + else { + object.firstScanSidecar = []; + if (options.bytes !== Array) + object.firstScanSidecar = $util.newBuffer(object.firstScanSidecar); + } + object.firstScanLength = 0; + object.experimentGroupId = 0; + if (options.bytes === String) + object.scansSidecar = ""; + else { + object.scansSidecar = []; + if (options.bytes !== Array) + object.scansSidecar = $util.newBuffer(object.scansSidecar); + } + if (options.bytes === String) + object.midQualityFileSha256 = ""; + else { + object.midQualityFileSha256 = []; + if (options.bytes !== Array) + object.midQualityFileSha256 = $util.newBuffer(object.midQualityFileSha256); + } + if (options.bytes === String) + object.midQualityFileEncSha256 = ""; + else { + object.midQualityFileEncSha256 = []; + if (options.bytes !== Array) + object.midQualityFileEncSha256 = $util.newBuffer(object.midQualityFileEncSha256); + } + object.viewOnce = false; + object.thumbnailDirectPath = ""; + if (options.bytes === String) + object.thumbnailSha256 = ""; + else { + object.thumbnailSha256 = []; + if (options.bytes !== Array) + object.thumbnailSha256 = $util.newBuffer(object.thumbnailSha256); + } + if (options.bytes === String) + object.thumbnailEncSha256 = ""; + else { + object.thumbnailEncSha256 = []; + if (options.bytes !== Array) + object.thumbnailEncSha256 = $util.newBuffer(object.thumbnailEncSha256); + } + object.staticUrl = ""; + } + if (message.url != null && message.hasOwnProperty("url")) + object.url = message.url; + if (message.mimetype != null && message.hasOwnProperty("mimetype")) + object.mimetype = message.mimetype; + if (message.caption != null && message.hasOwnProperty("caption")) + object.caption = message.caption; + if (message.fileSha256 != null && message.hasOwnProperty("fileSha256")) + object.fileSha256 = options.bytes === String ? $util.base64.encode(message.fileSha256, 0, message.fileSha256.length) : options.bytes === Array ? Array.prototype.slice.call(message.fileSha256) : message.fileSha256; + if (message.fileLength != null && message.hasOwnProperty("fileLength")) + if (typeof message.fileLength === "number") + object.fileLength = options.longs === String ? String(message.fileLength) : message.fileLength; + else + object.fileLength = options.longs === String ? $util.Long.prototype.toString.call(message.fileLength) : options.longs === Number ? new $util.LongBits(message.fileLength.low >>> 0, message.fileLength.high >>> 0).toNumber(true) : message.fileLength; + if (message.height != null && message.hasOwnProperty("height")) + object.height = message.height; + if (message.width != null && message.hasOwnProperty("width")) + object.width = message.width; + if (message.mediaKey != null && message.hasOwnProperty("mediaKey")) + object.mediaKey = options.bytes === String ? $util.base64.encode(message.mediaKey, 0, message.mediaKey.length) : options.bytes === Array ? Array.prototype.slice.call(message.mediaKey) : message.mediaKey; + if (message.fileEncSha256 != null && message.hasOwnProperty("fileEncSha256")) + object.fileEncSha256 = options.bytes === String ? $util.base64.encode(message.fileEncSha256, 0, message.fileEncSha256.length) : options.bytes === Array ? Array.prototype.slice.call(message.fileEncSha256) : message.fileEncSha256; + if (message.interactiveAnnotations && message.interactiveAnnotations.length) { + object.interactiveAnnotations = []; + for (var j = 0; j < message.interactiveAnnotations.length; ++j) + object.interactiveAnnotations[j] = $root.proto.InteractiveAnnotation.toObject(message.interactiveAnnotations[j], options); + } + if (message.directPath != null && message.hasOwnProperty("directPath")) + object.directPath = message.directPath; + if (message.mediaKeyTimestamp != null && message.hasOwnProperty("mediaKeyTimestamp")) + if (typeof message.mediaKeyTimestamp === "number") + object.mediaKeyTimestamp = options.longs === String ? String(message.mediaKeyTimestamp) : message.mediaKeyTimestamp; + else + object.mediaKeyTimestamp = options.longs === String ? $util.Long.prototype.toString.call(message.mediaKeyTimestamp) : options.longs === Number ? new $util.LongBits(message.mediaKeyTimestamp.low >>> 0, message.mediaKeyTimestamp.high >>> 0).toNumber() : message.mediaKeyTimestamp; + if (message.jpegThumbnail != null && message.hasOwnProperty("jpegThumbnail")) + object.jpegThumbnail = options.bytes === String ? $util.base64.encode(message.jpegThumbnail, 0, message.jpegThumbnail.length) : options.bytes === Array ? Array.prototype.slice.call(message.jpegThumbnail) : message.jpegThumbnail; + if (message.contextInfo != null && message.hasOwnProperty("contextInfo")) + object.contextInfo = $root.proto.ContextInfo.toObject(message.contextInfo, options); + if (message.firstScanSidecar != null && message.hasOwnProperty("firstScanSidecar")) + object.firstScanSidecar = options.bytes === String ? $util.base64.encode(message.firstScanSidecar, 0, message.firstScanSidecar.length) : options.bytes === Array ? Array.prototype.slice.call(message.firstScanSidecar) : message.firstScanSidecar; + if (message.firstScanLength != null && message.hasOwnProperty("firstScanLength")) + object.firstScanLength = message.firstScanLength; + if (message.experimentGroupId != null && message.hasOwnProperty("experimentGroupId")) + object.experimentGroupId = message.experimentGroupId; + if (message.scansSidecar != null && message.hasOwnProperty("scansSidecar")) + object.scansSidecar = options.bytes === String ? $util.base64.encode(message.scansSidecar, 0, message.scansSidecar.length) : options.bytes === Array ? Array.prototype.slice.call(message.scansSidecar) : message.scansSidecar; + if (message.scanLengths && message.scanLengths.length) { + object.scanLengths = []; + for (var j = 0; j < message.scanLengths.length; ++j) + object.scanLengths[j] = message.scanLengths[j]; + } + if (message.midQualityFileSha256 != null && message.hasOwnProperty("midQualityFileSha256")) + object.midQualityFileSha256 = options.bytes === String ? $util.base64.encode(message.midQualityFileSha256, 0, message.midQualityFileSha256.length) : options.bytes === Array ? Array.prototype.slice.call(message.midQualityFileSha256) : message.midQualityFileSha256; + if (message.midQualityFileEncSha256 != null && message.hasOwnProperty("midQualityFileEncSha256")) + object.midQualityFileEncSha256 = options.bytes === String ? $util.base64.encode(message.midQualityFileEncSha256, 0, message.midQualityFileEncSha256.length) : options.bytes === Array ? Array.prototype.slice.call(message.midQualityFileEncSha256) : message.midQualityFileEncSha256; + if (message.viewOnce != null && message.hasOwnProperty("viewOnce")) + object.viewOnce = message.viewOnce; + if (message.thumbnailDirectPath != null && message.hasOwnProperty("thumbnailDirectPath")) + object.thumbnailDirectPath = message.thumbnailDirectPath; + if (message.thumbnailSha256 != null && message.hasOwnProperty("thumbnailSha256")) + object.thumbnailSha256 = options.bytes === String ? $util.base64.encode(message.thumbnailSha256, 0, message.thumbnailSha256.length) : options.bytes === Array ? Array.prototype.slice.call(message.thumbnailSha256) : message.thumbnailSha256; + if (message.thumbnailEncSha256 != null && message.hasOwnProperty("thumbnailEncSha256")) + object.thumbnailEncSha256 = options.bytes === String ? $util.base64.encode(message.thumbnailEncSha256, 0, message.thumbnailEncSha256.length) : options.bytes === Array ? Array.prototype.slice.call(message.thumbnailEncSha256) : message.thumbnailEncSha256; + if (message.staticUrl != null && message.hasOwnProperty("staticUrl")) + object.staticUrl = message.staticUrl; + return object; + }; + + /** + * Converts this ImageMessage to JSON. + * @function toJSON + * @memberof proto.ImageMessage + * @instance + * @returns {Object.} JSON object */ + ImageMessage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ImageMessage; + })(); + + proto.InitialSecurityNotificationSettingSync = (function() { /** - * Constructs a new MediaRetryNotification. + * Properties of an InitialSecurityNotificationSettingSync. * @memberof proto - * @classdesc Represents a MediaRetryNotification. - * @implements IMediaRetryNotification + * @interface IInitialSecurityNotificationSettingSync + * @property {boolean|null} [securityNotificationEnabled] InitialSecurityNotificationSettingSync securityNotificationEnabled + */ + + /** + * Constructs a new InitialSecurityNotificationSettingSync. + * @memberof proto + * @classdesc Represents an InitialSecurityNotificationSettingSync. + * @implements IInitialSecurityNotificationSettingSync * @constructor - * @param {proto.IMediaRetryNotification=} [properties] Properties to set + * @param {proto.IInitialSecurityNotificationSettingSync=} [properties] Properties to set */ - function MediaRetryNotification(properties) { + function InitialSecurityNotificationSettingSync(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -16748,101 +17570,75 @@ $root.proto = (function() { } /** - * MediaRetryNotification stanzaId. - * @member {string} stanzaId - * @memberof proto.MediaRetryNotification - * @instance - */ - MediaRetryNotification.prototype.stanzaId = ""; - - /** - * MediaRetryNotification directPath. - * @member {string} directPath - * @memberof proto.MediaRetryNotification - * @instance - */ - MediaRetryNotification.prototype.directPath = ""; - - /** - * MediaRetryNotification result. - * @member {proto.MediaRetryNotification.MediaRetryNotificationResultType} result - * @memberof proto.MediaRetryNotification + * InitialSecurityNotificationSettingSync securityNotificationEnabled. + * @member {boolean} securityNotificationEnabled + * @memberof proto.InitialSecurityNotificationSettingSync * @instance */ - MediaRetryNotification.prototype.result = 0; + InitialSecurityNotificationSettingSync.prototype.securityNotificationEnabled = false; /** - * Creates a new MediaRetryNotification instance using the specified properties. + * Creates a new InitialSecurityNotificationSettingSync instance using the specified properties. * @function create - * @memberof proto.MediaRetryNotification + * @memberof proto.InitialSecurityNotificationSettingSync * @static - * @param {proto.IMediaRetryNotification=} [properties] Properties to set - * @returns {proto.MediaRetryNotification} MediaRetryNotification instance + * @param {proto.IInitialSecurityNotificationSettingSync=} [properties] Properties to set + * @returns {proto.InitialSecurityNotificationSettingSync} InitialSecurityNotificationSettingSync instance */ - MediaRetryNotification.create = function create(properties) { - return new MediaRetryNotification(properties); + InitialSecurityNotificationSettingSync.create = function create(properties) { + return new InitialSecurityNotificationSettingSync(properties); }; /** - * Encodes the specified MediaRetryNotification message. Does not implicitly {@link proto.MediaRetryNotification.verify|verify} messages. + * Encodes the specified InitialSecurityNotificationSettingSync message. Does not implicitly {@link proto.InitialSecurityNotificationSettingSync.verify|verify} messages. * @function encode - * @memberof proto.MediaRetryNotification + * @memberof proto.InitialSecurityNotificationSettingSync * @static - * @param {proto.IMediaRetryNotification} message MediaRetryNotification message or plain object to encode + * @param {proto.IInitialSecurityNotificationSettingSync} message InitialSecurityNotificationSettingSync message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - MediaRetryNotification.encode = function encode(message, writer) { + InitialSecurityNotificationSettingSync.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.stanzaId != null && Object.hasOwnProperty.call(message, "stanzaId")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.stanzaId); - if (message.directPath != null && Object.hasOwnProperty.call(message, "directPath")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.directPath); - if (message.result != null && Object.hasOwnProperty.call(message, "result")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.result); + if (message.securityNotificationEnabled != null && Object.hasOwnProperty.call(message, "securityNotificationEnabled")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.securityNotificationEnabled); return writer; }; /** - * Encodes the specified MediaRetryNotification message, length delimited. Does not implicitly {@link proto.MediaRetryNotification.verify|verify} messages. + * Encodes the specified InitialSecurityNotificationSettingSync message, length delimited. Does not implicitly {@link proto.InitialSecurityNotificationSettingSync.verify|verify} messages. * @function encodeDelimited - * @memberof proto.MediaRetryNotification + * @memberof proto.InitialSecurityNotificationSettingSync * @static - * @param {proto.IMediaRetryNotification} message MediaRetryNotification message or plain object to encode + * @param {proto.IInitialSecurityNotificationSettingSync} message InitialSecurityNotificationSettingSync message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - MediaRetryNotification.encodeDelimited = function encodeDelimited(message, writer) { + InitialSecurityNotificationSettingSync.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a MediaRetryNotification message from the specified reader or buffer. + * Decodes an InitialSecurityNotificationSettingSync message from the specified reader or buffer. * @function decode - * @memberof proto.MediaRetryNotification + * @memberof proto.InitialSecurityNotificationSettingSync * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {proto.MediaRetryNotification} MediaRetryNotification + * @returns {proto.InitialSecurityNotificationSettingSync} InitialSecurityNotificationSettingSync * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - MediaRetryNotification.decode = function decode(reader, length) { + InitialSecurityNotificationSettingSync.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.MediaRetryNotification(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.InitialSecurityNotificationSettingSync(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.stanzaId = reader.string(); - break; - case 2: - message.directPath = reader.string(); - break; - case 3: - message.result = reader.int32(); + message.securityNotificationEnabled = reader.bool(); break; default: reader.skipType(tag & 7); @@ -16853,177 +17649,109 @@ $root.proto = (function() { }; /** - * Decodes a MediaRetryNotification message from the specified reader or buffer, length delimited. + * Decodes an InitialSecurityNotificationSettingSync message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof proto.MediaRetryNotification + * @memberof proto.InitialSecurityNotificationSettingSync * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.MediaRetryNotification} MediaRetryNotification + * @returns {proto.InitialSecurityNotificationSettingSync} InitialSecurityNotificationSettingSync * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - MediaRetryNotification.decodeDelimited = function decodeDelimited(reader) { + InitialSecurityNotificationSettingSync.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a MediaRetryNotification message. + * Verifies an InitialSecurityNotificationSettingSync message. * @function verify - * @memberof proto.MediaRetryNotification + * @memberof proto.InitialSecurityNotificationSettingSync * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - MediaRetryNotification.verify = function verify(message) { + InitialSecurityNotificationSettingSync.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.stanzaId != null && message.hasOwnProperty("stanzaId")) - if (!$util.isString(message.stanzaId)) - return "stanzaId: string expected"; - if (message.directPath != null && message.hasOwnProperty("directPath")) - if (!$util.isString(message.directPath)) - return "directPath: string expected"; - if (message.result != null && message.hasOwnProperty("result")) - switch (message.result) { - default: - return "result: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } + if (message.securityNotificationEnabled != null && message.hasOwnProperty("securityNotificationEnabled")) + if (typeof message.securityNotificationEnabled !== "boolean") + return "securityNotificationEnabled: boolean expected"; return null; }; /** - * Creates a MediaRetryNotification message from a plain object. Also converts values to their respective internal types. + * Creates an InitialSecurityNotificationSettingSync message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof proto.MediaRetryNotification + * @memberof proto.InitialSecurityNotificationSettingSync * @static * @param {Object.} object Plain object - * @returns {proto.MediaRetryNotification} MediaRetryNotification + * @returns {proto.InitialSecurityNotificationSettingSync} InitialSecurityNotificationSettingSync */ - MediaRetryNotification.fromObject = function fromObject(object) { - if (object instanceof $root.proto.MediaRetryNotification) + InitialSecurityNotificationSettingSync.fromObject = function fromObject(object) { + if (object instanceof $root.proto.InitialSecurityNotificationSettingSync) return object; - var message = new $root.proto.MediaRetryNotification(); - if (object.stanzaId != null) - message.stanzaId = String(object.stanzaId); - if (object.directPath != null) - message.directPath = String(object.directPath); - switch (object.result) { - case "GENERAL_ERROR": - case 0: - message.result = 0; - break; - case "SUCCESS": - case 1: - message.result = 1; - break; - case "NOT_FOUND": - case 2: - message.result = 2; - break; - case "DECRYPTION_ERROR": - case 3: - message.result = 3; - break; - } + var message = new $root.proto.InitialSecurityNotificationSettingSync(); + if (object.securityNotificationEnabled != null) + message.securityNotificationEnabled = Boolean(object.securityNotificationEnabled); return message; }; /** - * Creates a plain object from a MediaRetryNotification message. Also converts values to other types if specified. + * Creates a plain object from an InitialSecurityNotificationSettingSync message. Also converts values to other types if specified. * @function toObject - * @memberof proto.MediaRetryNotification + * @memberof proto.InitialSecurityNotificationSettingSync * @static - * @param {proto.MediaRetryNotification} message MediaRetryNotification + * @param {proto.InitialSecurityNotificationSettingSync} message InitialSecurityNotificationSettingSync * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - MediaRetryNotification.toObject = function toObject(message, options) { + InitialSecurityNotificationSettingSync.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.stanzaId = ""; - object.directPath = ""; - object.result = options.enums === String ? "GENERAL_ERROR" : 0; - } - if (message.stanzaId != null && message.hasOwnProperty("stanzaId")) - object.stanzaId = message.stanzaId; - if (message.directPath != null && message.hasOwnProperty("directPath")) - object.directPath = message.directPath; - if (message.result != null && message.hasOwnProperty("result")) - object.result = options.enums === String ? $root.proto.MediaRetryNotification.MediaRetryNotificationResultType[message.result] : message.result; + if (options.defaults) + object.securityNotificationEnabled = false; + if (message.securityNotificationEnabled != null && message.hasOwnProperty("securityNotificationEnabled")) + object.securityNotificationEnabled = message.securityNotificationEnabled; return object; }; /** - * Converts this MediaRetryNotification to JSON. + * Converts this InitialSecurityNotificationSettingSync to JSON. * @function toJSON - * @memberof proto.MediaRetryNotification + * @memberof proto.InitialSecurityNotificationSettingSync * @instance * @returns {Object.} JSON object */ - MediaRetryNotification.prototype.toJSON = function toJSON() { + InitialSecurityNotificationSettingSync.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - /** - * MediaRetryNotificationResultType enum. - * @name proto.MediaRetryNotification.MediaRetryNotificationResultType - * @enum {number} - * @property {number} GENERAL_ERROR=0 GENERAL_ERROR value - * @property {number} SUCCESS=1 SUCCESS value - * @property {number} NOT_FOUND=2 NOT_FOUND value - * @property {number} DECRYPTION_ERROR=3 DECRYPTION_ERROR value - */ - MediaRetryNotification.MediaRetryNotificationResultType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "GENERAL_ERROR"] = 0; - values[valuesById[1] = "SUCCESS"] = 1; - values[valuesById[2] = "NOT_FOUND"] = 2; - values[valuesById[3] = "DECRYPTION_ERROR"] = 3; - return values; - })(); - - return MediaRetryNotification; + return InitialSecurityNotificationSettingSync; })(); - proto.MsgOpaqueData = (function() { + proto.InteractiveAnnotation = (function() { /** - * Properties of a MsgOpaqueData. + * Properties of an InteractiveAnnotation. * @memberof proto - * @interface IMsgOpaqueData - * @property {string|null} [body] MsgOpaqueData body - * @property {string|null} [caption] MsgOpaqueData caption - * @property {number|null} [lng] MsgOpaqueData lng - * @property {number|null} [lat] MsgOpaqueData lat - * @property {number|null} [paymentAmount1000] MsgOpaqueData paymentAmount1000 - * @property {string|null} [paymentNoteMsgBody] MsgOpaqueData paymentNoteMsgBody - * @property {string|null} [canonicalUrl] MsgOpaqueData canonicalUrl - * @property {string|null} [matchedText] MsgOpaqueData matchedText - * @property {string|null} [title] MsgOpaqueData title - * @property {string|null} [description] MsgOpaqueData description - * @property {Uint8Array|null} [futureproofBuffer] MsgOpaqueData futureproofBuffer - * @property {string|null} [clientUrl] MsgOpaqueData clientUrl - * @property {string|null} [loc] MsgOpaqueData loc + * @interface IInteractiveAnnotation + * @property {Array.|null} [polygonVertices] InteractiveAnnotation polygonVertices + * @property {proto.ILocation|null} [location] InteractiveAnnotation location */ /** - * Constructs a new MsgOpaqueData. + * Constructs a new InteractiveAnnotation. * @memberof proto - * @classdesc Represents a MsgOpaqueData. - * @implements IMsgOpaqueData + * @classdesc Represents an InteractiveAnnotation. + * @implements IInteractiveAnnotation * @constructor - * @param {proto.IMsgOpaqueData=} [properties] Properties to set + * @param {proto.IInteractiveAnnotation=} [properties] Properties to set */ - function MsgOpaqueData(properties) { + function InteractiveAnnotation(properties) { + this.polygonVertices = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -17031,231 +17759,105 @@ $root.proto = (function() { } /** - * MsgOpaqueData body. - * @member {string} body - * @memberof proto.MsgOpaqueData + * InteractiveAnnotation polygonVertices. + * @member {Array.} polygonVertices + * @memberof proto.InteractiveAnnotation * @instance */ - MsgOpaqueData.prototype.body = ""; + InteractiveAnnotation.prototype.polygonVertices = $util.emptyArray; /** - * MsgOpaqueData caption. - * @member {string} caption - * @memberof proto.MsgOpaqueData + * InteractiveAnnotation location. + * @member {proto.ILocation|null|undefined} location + * @memberof proto.InteractiveAnnotation * @instance */ - MsgOpaqueData.prototype.caption = ""; + InteractiveAnnotation.prototype.location = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; /** - * MsgOpaqueData lng. - * @member {number} lng - * @memberof proto.MsgOpaqueData + * InteractiveAnnotation action. + * @member {"location"|undefined} action + * @memberof proto.InteractiveAnnotation * @instance */ - MsgOpaqueData.prototype.lng = 0; + Object.defineProperty(InteractiveAnnotation.prototype, "action", { + get: $util.oneOfGetter($oneOfFields = ["location"]), + set: $util.oneOfSetter($oneOfFields) + }); /** - * MsgOpaqueData lat. - * @member {number} lat - * @memberof proto.MsgOpaqueData - * @instance + * Creates a new InteractiveAnnotation instance using the specified properties. + * @function create + * @memberof proto.InteractiveAnnotation + * @static + * @param {proto.IInteractiveAnnotation=} [properties] Properties to set + * @returns {proto.InteractiveAnnotation} InteractiveAnnotation instance */ - MsgOpaqueData.prototype.lat = 0; + InteractiveAnnotation.create = function create(properties) { + return new InteractiveAnnotation(properties); + }; /** - * MsgOpaqueData paymentAmount1000. - * @member {number} paymentAmount1000 - * @memberof proto.MsgOpaqueData - * @instance + * Encodes the specified InteractiveAnnotation message. Does not implicitly {@link proto.InteractiveAnnotation.verify|verify} messages. + * @function encode + * @memberof proto.InteractiveAnnotation + * @static + * @param {proto.IInteractiveAnnotation} message InteractiveAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - MsgOpaqueData.prototype.paymentAmount1000 = 0; + InteractiveAnnotation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.polygonVertices != null && message.polygonVertices.length) + for (var i = 0; i < message.polygonVertices.length; ++i) + $root.proto.Point.encode(message.polygonVertices[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + $root.proto.Location.encode(message.location, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; /** - * MsgOpaqueData paymentNoteMsgBody. - * @member {string} paymentNoteMsgBody - * @memberof proto.MsgOpaqueData - * @instance + * Encodes the specified InteractiveAnnotation message, length delimited. Does not implicitly {@link proto.InteractiveAnnotation.verify|verify} messages. + * @function encodeDelimited + * @memberof proto.InteractiveAnnotation + * @static + * @param {proto.IInteractiveAnnotation} message InteractiveAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - MsgOpaqueData.prototype.paymentNoteMsgBody = ""; + InteractiveAnnotation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; /** - * MsgOpaqueData canonicalUrl. - * @member {string} canonicalUrl - * @memberof proto.MsgOpaqueData - * @instance - */ - MsgOpaqueData.prototype.canonicalUrl = ""; - - /** - * MsgOpaqueData matchedText. - * @member {string} matchedText - * @memberof proto.MsgOpaqueData - * @instance - */ - MsgOpaqueData.prototype.matchedText = ""; - - /** - * MsgOpaqueData title. - * @member {string} title - * @memberof proto.MsgOpaqueData - * @instance - */ - MsgOpaqueData.prototype.title = ""; - - /** - * MsgOpaqueData description. - * @member {string} description - * @memberof proto.MsgOpaqueData - * @instance - */ - MsgOpaqueData.prototype.description = ""; - - /** - * MsgOpaqueData futureproofBuffer. - * @member {Uint8Array} futureproofBuffer - * @memberof proto.MsgOpaqueData - * @instance - */ - MsgOpaqueData.prototype.futureproofBuffer = $util.newBuffer([]); - - /** - * MsgOpaqueData clientUrl. - * @member {string} clientUrl - * @memberof proto.MsgOpaqueData - * @instance - */ - MsgOpaqueData.prototype.clientUrl = ""; - - /** - * MsgOpaqueData loc. - * @member {string} loc - * @memberof proto.MsgOpaqueData - * @instance - */ - MsgOpaqueData.prototype.loc = ""; - - /** - * Creates a new MsgOpaqueData instance using the specified properties. - * @function create - * @memberof proto.MsgOpaqueData - * @static - * @param {proto.IMsgOpaqueData=} [properties] Properties to set - * @returns {proto.MsgOpaqueData} MsgOpaqueData instance - */ - MsgOpaqueData.create = function create(properties) { - return new MsgOpaqueData(properties); - }; - - /** - * Encodes the specified MsgOpaqueData message. Does not implicitly {@link proto.MsgOpaqueData.verify|verify} messages. - * @function encode - * @memberof proto.MsgOpaqueData - * @static - * @param {proto.IMsgOpaqueData} message MsgOpaqueData message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgOpaqueData.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.body != null && Object.hasOwnProperty.call(message, "body")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.body); - if (message.caption != null && Object.hasOwnProperty.call(message, "caption")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.caption); - if (message.lng != null && Object.hasOwnProperty.call(message, "lng")) - writer.uint32(/* id 5, wireType 1 =*/41).double(message.lng); - if (message.lat != null && Object.hasOwnProperty.call(message, "lat")) - writer.uint32(/* id 7, wireType 1 =*/57).double(message.lat); - if (message.paymentAmount1000 != null && Object.hasOwnProperty.call(message, "paymentAmount1000")) - writer.uint32(/* id 8, wireType 0 =*/64).int32(message.paymentAmount1000); - if (message.paymentNoteMsgBody != null && Object.hasOwnProperty.call(message, "paymentNoteMsgBody")) - writer.uint32(/* id 9, wireType 2 =*/74).string(message.paymentNoteMsgBody); - if (message.canonicalUrl != null && Object.hasOwnProperty.call(message, "canonicalUrl")) - writer.uint32(/* id 10, wireType 2 =*/82).string(message.canonicalUrl); - if (message.matchedText != null && Object.hasOwnProperty.call(message, "matchedText")) - writer.uint32(/* id 11, wireType 2 =*/90).string(message.matchedText); - if (message.title != null && Object.hasOwnProperty.call(message, "title")) - writer.uint32(/* id 12, wireType 2 =*/98).string(message.title); - if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 13, wireType 2 =*/106).string(message.description); - if (message.futureproofBuffer != null && Object.hasOwnProperty.call(message, "futureproofBuffer")) - writer.uint32(/* id 14, wireType 2 =*/114).bytes(message.futureproofBuffer); - if (message.clientUrl != null && Object.hasOwnProperty.call(message, "clientUrl")) - writer.uint32(/* id 15, wireType 2 =*/122).string(message.clientUrl); - if (message.loc != null && Object.hasOwnProperty.call(message, "loc")) - writer.uint32(/* id 16, wireType 2 =*/130).string(message.loc); - return writer; - }; - - /** - * Encodes the specified MsgOpaqueData message, length delimited. Does not implicitly {@link proto.MsgOpaqueData.verify|verify} messages. - * @function encodeDelimited - * @memberof proto.MsgOpaqueData - * @static - * @param {proto.IMsgOpaqueData} message MsgOpaqueData message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgOpaqueData.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MsgOpaqueData message from the specified reader or buffer. + * Decodes an InteractiveAnnotation message from the specified reader or buffer. * @function decode - * @memberof proto.MsgOpaqueData + * @memberof proto.InteractiveAnnotation * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {proto.MsgOpaqueData} MsgOpaqueData + * @returns {proto.InteractiveAnnotation} InteractiveAnnotation * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - MsgOpaqueData.decode = function decode(reader, length) { + InteractiveAnnotation.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.MsgOpaqueData(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.InteractiveAnnotation(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.body = reader.string(); - break; - case 3: - message.caption = reader.string(); - break; - case 5: - message.lng = reader.double(); - break; - case 7: - message.lat = reader.double(); - break; - case 8: - message.paymentAmount1000 = reader.int32(); - break; - case 9: - message.paymentNoteMsgBody = reader.string(); - break; - case 10: - message.canonicalUrl = reader.string(); - break; - case 11: - message.matchedText = reader.string(); - break; - case 12: - message.title = reader.string(); - break; - case 13: - message.description = reader.string(); - break; - case 14: - message.futureproofBuffer = reader.bytes(); - break; - case 15: - message.clientUrl = reader.string(); + if (!(message.polygonVertices && message.polygonVertices.length)) + message.polygonVertices = []; + message.polygonVertices.push($root.proto.Point.decode(reader, reader.uint32())); break; - case 16: - message.loc = reader.string(); + case 2: + message.location = $root.proto.Location.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -17266,214 +17868,149 @@ $root.proto = (function() { }; /** - * Decodes a MsgOpaqueData message from the specified reader or buffer, length delimited. + * Decodes an InteractiveAnnotation message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof proto.MsgOpaqueData + * @memberof proto.InteractiveAnnotation * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.MsgOpaqueData} MsgOpaqueData + * @returns {proto.InteractiveAnnotation} InteractiveAnnotation * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - MsgOpaqueData.decodeDelimited = function decodeDelimited(reader) { + InteractiveAnnotation.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a MsgOpaqueData message. + * Verifies an InteractiveAnnotation message. * @function verify - * @memberof proto.MsgOpaqueData + * @memberof proto.InteractiveAnnotation * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - MsgOpaqueData.verify = function verify(message) { + InteractiveAnnotation.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.body != null && message.hasOwnProperty("body")) - if (!$util.isString(message.body)) - return "body: string expected"; - if (message.caption != null && message.hasOwnProperty("caption")) - if (!$util.isString(message.caption)) - return "caption: string expected"; - if (message.lng != null && message.hasOwnProperty("lng")) - if (typeof message.lng !== "number") - return "lng: number expected"; - if (message.lat != null && message.hasOwnProperty("lat")) - if (typeof message.lat !== "number") - return "lat: number expected"; - if (message.paymentAmount1000 != null && message.hasOwnProperty("paymentAmount1000")) - if (!$util.isInteger(message.paymentAmount1000)) - return "paymentAmount1000: integer expected"; - if (message.paymentNoteMsgBody != null && message.hasOwnProperty("paymentNoteMsgBody")) - if (!$util.isString(message.paymentNoteMsgBody)) - return "paymentNoteMsgBody: string expected"; - if (message.canonicalUrl != null && message.hasOwnProperty("canonicalUrl")) - if (!$util.isString(message.canonicalUrl)) - return "canonicalUrl: string expected"; - if (message.matchedText != null && message.hasOwnProperty("matchedText")) - if (!$util.isString(message.matchedText)) - return "matchedText: string expected"; - if (message.title != null && message.hasOwnProperty("title")) - if (!$util.isString(message.title)) - return "title: string expected"; - if (message.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: string expected"; - if (message.futureproofBuffer != null && message.hasOwnProperty("futureproofBuffer")) - if (!(message.futureproofBuffer && typeof message.futureproofBuffer.length === "number" || $util.isString(message.futureproofBuffer))) - return "futureproofBuffer: buffer expected"; - if (message.clientUrl != null && message.hasOwnProperty("clientUrl")) - if (!$util.isString(message.clientUrl)) - return "clientUrl: string expected"; - if (message.loc != null && message.hasOwnProperty("loc")) - if (!$util.isString(message.loc)) - return "loc: string expected"; + var properties = {}; + if (message.polygonVertices != null && message.hasOwnProperty("polygonVertices")) { + if (!Array.isArray(message.polygonVertices)) + return "polygonVertices: array expected"; + for (var i = 0; i < message.polygonVertices.length; ++i) { + var error = $root.proto.Point.verify(message.polygonVertices[i]); + if (error) + return "polygonVertices." + error; + } + } + if (message.location != null && message.hasOwnProperty("location")) { + properties.action = 1; + { + var error = $root.proto.Location.verify(message.location); + if (error) + return "location." + error; + } + } return null; }; /** - * Creates a MsgOpaqueData message from a plain object. Also converts values to their respective internal types. + * Creates an InteractiveAnnotation message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof proto.MsgOpaqueData + * @memberof proto.InteractiveAnnotation * @static * @param {Object.} object Plain object - * @returns {proto.MsgOpaqueData} MsgOpaqueData + * @returns {proto.InteractiveAnnotation} InteractiveAnnotation */ - MsgOpaqueData.fromObject = function fromObject(object) { - if (object instanceof $root.proto.MsgOpaqueData) + InteractiveAnnotation.fromObject = function fromObject(object) { + if (object instanceof $root.proto.InteractiveAnnotation) return object; - var message = new $root.proto.MsgOpaqueData(); - if (object.body != null) - message.body = String(object.body); - if (object.caption != null) - message.caption = String(object.caption); - if (object.lng != null) - message.lng = Number(object.lng); - if (object.lat != null) - message.lat = Number(object.lat); - if (object.paymentAmount1000 != null) - message.paymentAmount1000 = object.paymentAmount1000 | 0; - if (object.paymentNoteMsgBody != null) - message.paymentNoteMsgBody = String(object.paymentNoteMsgBody); - if (object.canonicalUrl != null) - message.canonicalUrl = String(object.canonicalUrl); - if (object.matchedText != null) - message.matchedText = String(object.matchedText); - if (object.title != null) - message.title = String(object.title); - if (object.description != null) - message.description = String(object.description); - if (object.futureproofBuffer != null) - if (typeof object.futureproofBuffer === "string") - $util.base64.decode(object.futureproofBuffer, message.futureproofBuffer = $util.newBuffer($util.base64.length(object.futureproofBuffer)), 0); - else if (object.futureproofBuffer.length) - message.futureproofBuffer = object.futureproofBuffer; - if (object.clientUrl != null) - message.clientUrl = String(object.clientUrl); - if (object.loc != null) - message.loc = String(object.loc); + var message = new $root.proto.InteractiveAnnotation(); + if (object.polygonVertices) { + if (!Array.isArray(object.polygonVertices)) + throw TypeError(".proto.InteractiveAnnotation.polygonVertices: array expected"); + message.polygonVertices = []; + for (var i = 0; i < object.polygonVertices.length; ++i) { + if (typeof object.polygonVertices[i] !== "object") + throw TypeError(".proto.InteractiveAnnotation.polygonVertices: object expected"); + message.polygonVertices[i] = $root.proto.Point.fromObject(object.polygonVertices[i]); + } + } + if (object.location != null) { + if (typeof object.location !== "object") + throw TypeError(".proto.InteractiveAnnotation.location: object expected"); + message.location = $root.proto.Location.fromObject(object.location); + } return message; }; /** - * Creates a plain object from a MsgOpaqueData message. Also converts values to other types if specified. + * Creates a plain object from an InteractiveAnnotation message. Also converts values to other types if specified. * @function toObject - * @memberof proto.MsgOpaqueData + * @memberof proto.InteractiveAnnotation * @static - * @param {proto.MsgOpaqueData} message MsgOpaqueData + * @param {proto.InteractiveAnnotation} message InteractiveAnnotation * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - MsgOpaqueData.toObject = function toObject(message, options) { + InteractiveAnnotation.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.body = ""; - object.caption = ""; - object.lng = 0; - object.lat = 0; - object.paymentAmount1000 = 0; - object.paymentNoteMsgBody = ""; - object.canonicalUrl = ""; - object.matchedText = ""; - object.title = ""; - object.description = ""; - if (options.bytes === String) - object.futureproofBuffer = ""; - else { - object.futureproofBuffer = []; - if (options.bytes !== Array) - object.futureproofBuffer = $util.newBuffer(object.futureproofBuffer); - } - object.clientUrl = ""; - object.loc = ""; + if (options.arrays || options.defaults) + object.polygonVertices = []; + if (message.polygonVertices && message.polygonVertices.length) { + object.polygonVertices = []; + for (var j = 0; j < message.polygonVertices.length; ++j) + object.polygonVertices[j] = $root.proto.Point.toObject(message.polygonVertices[j], options); + } + if (message.location != null && message.hasOwnProperty("location")) { + object.location = $root.proto.Location.toObject(message.location, options); + if (options.oneofs) + object.action = "location"; } - if (message.body != null && message.hasOwnProperty("body")) - object.body = message.body; - if (message.caption != null && message.hasOwnProperty("caption")) - object.caption = message.caption; - if (message.lng != null && message.hasOwnProperty("lng")) - object.lng = options.json && !isFinite(message.lng) ? String(message.lng) : message.lng; - if (message.lat != null && message.hasOwnProperty("lat")) - object.lat = options.json && !isFinite(message.lat) ? String(message.lat) : message.lat; - if (message.paymentAmount1000 != null && message.hasOwnProperty("paymentAmount1000")) - object.paymentAmount1000 = message.paymentAmount1000; - if (message.paymentNoteMsgBody != null && message.hasOwnProperty("paymentNoteMsgBody")) - object.paymentNoteMsgBody = message.paymentNoteMsgBody; - if (message.canonicalUrl != null && message.hasOwnProperty("canonicalUrl")) - object.canonicalUrl = message.canonicalUrl; - if (message.matchedText != null && message.hasOwnProperty("matchedText")) - object.matchedText = message.matchedText; - if (message.title != null && message.hasOwnProperty("title")) - object.title = message.title; - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; - if (message.futureproofBuffer != null && message.hasOwnProperty("futureproofBuffer")) - object.futureproofBuffer = options.bytes === String ? $util.base64.encode(message.futureproofBuffer, 0, message.futureproofBuffer.length) : options.bytes === Array ? Array.prototype.slice.call(message.futureproofBuffer) : message.futureproofBuffer; - if (message.clientUrl != null && message.hasOwnProperty("clientUrl")) - object.clientUrl = message.clientUrl; - if (message.loc != null && message.hasOwnProperty("loc")) - object.loc = message.loc; return object; }; /** - * Converts this MsgOpaqueData to JSON. + * Converts this InteractiveAnnotation to JSON. * @function toJSON - * @memberof proto.MsgOpaqueData + * @memberof proto.InteractiveAnnotation * @instance * @returns {Object.} JSON object */ - MsgOpaqueData.prototype.toJSON = function toJSON() { + InteractiveAnnotation.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return MsgOpaqueData; + return InteractiveAnnotation; })(); - proto.MsgRowOpaqueData = (function() { + proto.InteractiveMessage = (function() { /** - * Properties of a MsgRowOpaqueData. + * Properties of an InteractiveMessage. * @memberof proto - * @interface IMsgRowOpaqueData - * @property {proto.IMsgOpaqueData|null} [currentMsg] MsgRowOpaqueData currentMsg - * @property {proto.IMsgOpaqueData|null} [quotedMsg] MsgRowOpaqueData quotedMsg + * @interface IInteractiveMessage + * @property {proto.IHeader|null} [header] InteractiveMessage header + * @property {proto.IInteractiveMessageBody|null} [body] InteractiveMessage body + * @property {proto.IFooter|null} [footer] InteractiveMessage footer + * @property {proto.IContextInfo|null} [contextInfo] InteractiveMessage contextInfo + * @property {proto.IShopMessage|null} [shopStorefrontMessage] InteractiveMessage shopStorefrontMessage + * @property {proto.ICollectionMessage|null} [collectionMessage] InteractiveMessage collectionMessage + * @property {proto.INativeFlowMessage|null} [nativeFlowMessage] InteractiveMessage nativeFlowMessage */ /** - * Constructs a new MsgRowOpaqueData. + * Constructs a new InteractiveMessage. * @memberof proto - * @classdesc Represents a MsgRowOpaqueData. - * @implements IMsgRowOpaqueData + * @classdesc Represents an InteractiveMessage. + * @implements IInteractiveMessage * @constructor - * @param {proto.IMsgRowOpaqueData=} [properties] Properties to set + * @param {proto.IInteractiveMessage=} [properties] Properties to set */ - function MsgRowOpaqueData(properties) { + function InteractiveMessage(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -17481,88 +18018,167 @@ $root.proto = (function() { } /** - * MsgRowOpaqueData currentMsg. - * @member {proto.IMsgOpaqueData|null|undefined} currentMsg - * @memberof proto.MsgRowOpaqueData + * InteractiveMessage header. + * @member {proto.IHeader|null|undefined} header + * @memberof proto.InteractiveMessage * @instance */ - MsgRowOpaqueData.prototype.currentMsg = null; + InteractiveMessage.prototype.header = null; /** - * MsgRowOpaqueData quotedMsg. - * @member {proto.IMsgOpaqueData|null|undefined} quotedMsg - * @memberof proto.MsgRowOpaqueData + * InteractiveMessage body. + * @member {proto.IInteractiveMessageBody|null|undefined} body + * @memberof proto.InteractiveMessage * @instance */ - MsgRowOpaqueData.prototype.quotedMsg = null; + InteractiveMessage.prototype.body = null; /** - * Creates a new MsgRowOpaqueData instance using the specified properties. + * InteractiveMessage footer. + * @member {proto.IFooter|null|undefined} footer + * @memberof proto.InteractiveMessage + * @instance + */ + InteractiveMessage.prototype.footer = null; + + /** + * InteractiveMessage contextInfo. + * @member {proto.IContextInfo|null|undefined} contextInfo + * @memberof proto.InteractiveMessage + * @instance + */ + InteractiveMessage.prototype.contextInfo = null; + + /** + * InteractiveMessage shopStorefrontMessage. + * @member {proto.IShopMessage|null|undefined} shopStorefrontMessage + * @memberof proto.InteractiveMessage + * @instance + */ + InteractiveMessage.prototype.shopStorefrontMessage = null; + + /** + * InteractiveMessage collectionMessage. + * @member {proto.ICollectionMessage|null|undefined} collectionMessage + * @memberof proto.InteractiveMessage + * @instance + */ + InteractiveMessage.prototype.collectionMessage = null; + + /** + * InteractiveMessage nativeFlowMessage. + * @member {proto.INativeFlowMessage|null|undefined} nativeFlowMessage + * @memberof proto.InteractiveMessage + * @instance + */ + InteractiveMessage.prototype.nativeFlowMessage = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * InteractiveMessage interactiveMessage. + * @member {"shopStorefrontMessage"|"collectionMessage"|"nativeFlowMessage"|undefined} interactiveMessage + * @memberof proto.InteractiveMessage + * @instance + */ + Object.defineProperty(InteractiveMessage.prototype, "interactiveMessage", { + get: $util.oneOfGetter($oneOfFields = ["shopStorefrontMessage", "collectionMessage", "nativeFlowMessage"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new InteractiveMessage instance using the specified properties. * @function create - * @memberof proto.MsgRowOpaqueData + * @memberof proto.InteractiveMessage * @static - * @param {proto.IMsgRowOpaqueData=} [properties] Properties to set - * @returns {proto.MsgRowOpaqueData} MsgRowOpaqueData instance + * @param {proto.IInteractiveMessage=} [properties] Properties to set + * @returns {proto.InteractiveMessage} InteractiveMessage instance */ - MsgRowOpaqueData.create = function create(properties) { - return new MsgRowOpaqueData(properties); + InteractiveMessage.create = function create(properties) { + return new InteractiveMessage(properties); }; /** - * Encodes the specified MsgRowOpaqueData message. Does not implicitly {@link proto.MsgRowOpaqueData.verify|verify} messages. + * Encodes the specified InteractiveMessage message. Does not implicitly {@link proto.InteractiveMessage.verify|verify} messages. * @function encode - * @memberof proto.MsgRowOpaqueData + * @memberof proto.InteractiveMessage * @static - * @param {proto.IMsgRowOpaqueData} message MsgRowOpaqueData message or plain object to encode + * @param {proto.IInteractiveMessage} message InteractiveMessage message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - MsgRowOpaqueData.encode = function encode(message, writer) { + InteractiveMessage.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.currentMsg != null && Object.hasOwnProperty.call(message, "currentMsg")) - $root.proto.MsgOpaqueData.encode(message.currentMsg, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.quotedMsg != null && Object.hasOwnProperty.call(message, "quotedMsg")) - $root.proto.MsgOpaqueData.encode(message.quotedMsg, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.header != null && Object.hasOwnProperty.call(message, "header")) + $root.proto.Header.encode(message.header, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.body != null && Object.hasOwnProperty.call(message, "body")) + $root.proto.InteractiveMessageBody.encode(message.body, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.footer != null && Object.hasOwnProperty.call(message, "footer")) + $root.proto.Footer.encode(message.footer, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.shopStorefrontMessage != null && Object.hasOwnProperty.call(message, "shopStorefrontMessage")) + $root.proto.ShopMessage.encode(message.shopStorefrontMessage, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.collectionMessage != null && Object.hasOwnProperty.call(message, "collectionMessage")) + $root.proto.CollectionMessage.encode(message.collectionMessage, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.nativeFlowMessage != null && Object.hasOwnProperty.call(message, "nativeFlowMessage")) + $root.proto.NativeFlowMessage.encode(message.nativeFlowMessage, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.contextInfo != null && Object.hasOwnProperty.call(message, "contextInfo")) + $root.proto.ContextInfo.encode(message.contextInfo, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); return writer; }; /** - * Encodes the specified MsgRowOpaqueData message, length delimited. Does not implicitly {@link proto.MsgRowOpaqueData.verify|verify} messages. + * Encodes the specified InteractiveMessage message, length delimited. Does not implicitly {@link proto.InteractiveMessage.verify|verify} messages. * @function encodeDelimited - * @memberof proto.MsgRowOpaqueData + * @memberof proto.InteractiveMessage * @static - * @param {proto.IMsgRowOpaqueData} message MsgRowOpaqueData message or plain object to encode + * @param {proto.IInteractiveMessage} message InteractiveMessage message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - MsgRowOpaqueData.encodeDelimited = function encodeDelimited(message, writer) { + InteractiveMessage.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a MsgRowOpaqueData message from the specified reader or buffer. + * Decodes an InteractiveMessage message from the specified reader or buffer. * @function decode - * @memberof proto.MsgRowOpaqueData + * @memberof proto.InteractiveMessage * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {proto.MsgRowOpaqueData} MsgRowOpaqueData + * @returns {proto.InteractiveMessage} InteractiveMessage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - MsgRowOpaqueData.decode = function decode(reader, length) { + InteractiveMessage.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.MsgRowOpaqueData(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.InteractiveMessage(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.currentMsg = $root.proto.MsgOpaqueData.decode(reader, reader.uint32()); + message.header = $root.proto.Header.decode(reader, reader.uint32()); break; case 2: - message.quotedMsg = $root.proto.MsgOpaqueData.decode(reader, reader.uint32()); + message.body = $root.proto.InteractiveMessageBody.decode(reader, reader.uint32()); + break; + case 3: + message.footer = $root.proto.Footer.decode(reader, reader.uint32()); + break; + case 15: + message.contextInfo = $root.proto.ContextInfo.decode(reader, reader.uint32()); + break; + case 4: + message.shopStorefrontMessage = $root.proto.ShopMessage.decode(reader, reader.uint32()); + break; + case 5: + message.collectionMessage = $root.proto.CollectionMessage.decode(reader, reader.uint32()); + break; + case 6: + message.nativeFlowMessage = $root.proto.NativeFlowMessage.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -17573,128 +18189,211 @@ $root.proto = (function() { }; /** - * Decodes a MsgRowOpaqueData message from the specified reader or buffer, length delimited. + * Decodes an InteractiveMessage message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof proto.MsgRowOpaqueData + * @memberof proto.InteractiveMessage * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.MsgRowOpaqueData} MsgRowOpaqueData + * @returns {proto.InteractiveMessage} InteractiveMessage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - MsgRowOpaqueData.decodeDelimited = function decodeDelimited(reader) { + InteractiveMessage.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a MsgRowOpaqueData message. + * Verifies an InteractiveMessage message. * @function verify - * @memberof proto.MsgRowOpaqueData + * @memberof proto.InteractiveMessage * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - MsgRowOpaqueData.verify = function verify(message) { + InteractiveMessage.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.currentMsg != null && message.hasOwnProperty("currentMsg")) { - var error = $root.proto.MsgOpaqueData.verify(message.currentMsg); + var properties = {}; + if (message.header != null && message.hasOwnProperty("header")) { + var error = $root.proto.Header.verify(message.header); if (error) - return "currentMsg." + error; + return "header." + error; } - if (message.quotedMsg != null && message.hasOwnProperty("quotedMsg")) { - var error = $root.proto.MsgOpaqueData.verify(message.quotedMsg); + if (message.body != null && message.hasOwnProperty("body")) { + var error = $root.proto.InteractiveMessageBody.verify(message.body); if (error) - return "quotedMsg." + error; + return "body." + error; + } + if (message.footer != null && message.hasOwnProperty("footer")) { + var error = $root.proto.Footer.verify(message.footer); + if (error) + return "footer." + error; + } + if (message.contextInfo != null && message.hasOwnProperty("contextInfo")) { + var error = $root.proto.ContextInfo.verify(message.contextInfo); + if (error) + return "contextInfo." + error; + } + if (message.shopStorefrontMessage != null && message.hasOwnProperty("shopStorefrontMessage")) { + properties.interactiveMessage = 1; + { + var error = $root.proto.ShopMessage.verify(message.shopStorefrontMessage); + if (error) + return "shopStorefrontMessage." + error; + } + } + if (message.collectionMessage != null && message.hasOwnProperty("collectionMessage")) { + if (properties.interactiveMessage === 1) + return "interactiveMessage: multiple values"; + properties.interactiveMessage = 1; + { + var error = $root.proto.CollectionMessage.verify(message.collectionMessage); + if (error) + return "collectionMessage." + error; + } + } + if (message.nativeFlowMessage != null && message.hasOwnProperty("nativeFlowMessage")) { + if (properties.interactiveMessage === 1) + return "interactiveMessage: multiple values"; + properties.interactiveMessage = 1; + { + var error = $root.proto.NativeFlowMessage.verify(message.nativeFlowMessage); + if (error) + return "nativeFlowMessage." + error; + } } return null; }; /** - * Creates a MsgRowOpaqueData message from a plain object. Also converts values to their respective internal types. + * Creates an InteractiveMessage message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof proto.MsgRowOpaqueData + * @memberof proto.InteractiveMessage * @static * @param {Object.} object Plain object - * @returns {proto.MsgRowOpaqueData} MsgRowOpaqueData + * @returns {proto.InteractiveMessage} InteractiveMessage */ - MsgRowOpaqueData.fromObject = function fromObject(object) { - if (object instanceof $root.proto.MsgRowOpaqueData) + InteractiveMessage.fromObject = function fromObject(object) { + if (object instanceof $root.proto.InteractiveMessage) return object; - var message = new $root.proto.MsgRowOpaqueData(); - if (object.currentMsg != null) { - if (typeof object.currentMsg !== "object") - throw TypeError(".proto.MsgRowOpaqueData.currentMsg: object expected"); - message.currentMsg = $root.proto.MsgOpaqueData.fromObject(object.currentMsg); + var message = new $root.proto.InteractiveMessage(); + if (object.header != null) { + if (typeof object.header !== "object") + throw TypeError(".proto.InteractiveMessage.header: object expected"); + message.header = $root.proto.Header.fromObject(object.header); } - if (object.quotedMsg != null) { - if (typeof object.quotedMsg !== "object") - throw TypeError(".proto.MsgRowOpaqueData.quotedMsg: object expected"); - message.quotedMsg = $root.proto.MsgOpaqueData.fromObject(object.quotedMsg); + if (object.body != null) { + if (typeof object.body !== "object") + throw TypeError(".proto.InteractiveMessage.body: object expected"); + message.body = $root.proto.InteractiveMessageBody.fromObject(object.body); + } + if (object.footer != null) { + if (typeof object.footer !== "object") + throw TypeError(".proto.InteractiveMessage.footer: object expected"); + message.footer = $root.proto.Footer.fromObject(object.footer); + } + if (object.contextInfo != null) { + if (typeof object.contextInfo !== "object") + throw TypeError(".proto.InteractiveMessage.contextInfo: object expected"); + message.contextInfo = $root.proto.ContextInfo.fromObject(object.contextInfo); + } + if (object.shopStorefrontMessage != null) { + if (typeof object.shopStorefrontMessage !== "object") + throw TypeError(".proto.InteractiveMessage.shopStorefrontMessage: object expected"); + message.shopStorefrontMessage = $root.proto.ShopMessage.fromObject(object.shopStorefrontMessage); + } + if (object.collectionMessage != null) { + if (typeof object.collectionMessage !== "object") + throw TypeError(".proto.InteractiveMessage.collectionMessage: object expected"); + message.collectionMessage = $root.proto.CollectionMessage.fromObject(object.collectionMessage); + } + if (object.nativeFlowMessage != null) { + if (typeof object.nativeFlowMessage !== "object") + throw TypeError(".proto.InteractiveMessage.nativeFlowMessage: object expected"); + message.nativeFlowMessage = $root.proto.NativeFlowMessage.fromObject(object.nativeFlowMessage); } return message; }; /** - * Creates a plain object from a MsgRowOpaqueData message. Also converts values to other types if specified. + * Creates a plain object from an InteractiveMessage message. Also converts values to other types if specified. * @function toObject - * @memberof proto.MsgRowOpaqueData + * @memberof proto.InteractiveMessage * @static - * @param {proto.MsgRowOpaqueData} message MsgRowOpaqueData + * @param {proto.InteractiveMessage} message InteractiveMessage * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - MsgRowOpaqueData.toObject = function toObject(message, options) { + InteractiveMessage.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.currentMsg = null; - object.quotedMsg = null; + object.header = null; + object.body = null; + object.footer = null; + object.contextInfo = null; } - if (message.currentMsg != null && message.hasOwnProperty("currentMsg")) - object.currentMsg = $root.proto.MsgOpaqueData.toObject(message.currentMsg, options); - if (message.quotedMsg != null && message.hasOwnProperty("quotedMsg")) - object.quotedMsg = $root.proto.MsgOpaqueData.toObject(message.quotedMsg, options); + if (message.header != null && message.hasOwnProperty("header")) + object.header = $root.proto.Header.toObject(message.header, options); + if (message.body != null && message.hasOwnProperty("body")) + object.body = $root.proto.InteractiveMessageBody.toObject(message.body, options); + if (message.footer != null && message.hasOwnProperty("footer")) + object.footer = $root.proto.Footer.toObject(message.footer, options); + if (message.shopStorefrontMessage != null && message.hasOwnProperty("shopStorefrontMessage")) { + object.shopStorefrontMessage = $root.proto.ShopMessage.toObject(message.shopStorefrontMessage, options); + if (options.oneofs) + object.interactiveMessage = "shopStorefrontMessage"; + } + if (message.collectionMessage != null && message.hasOwnProperty("collectionMessage")) { + object.collectionMessage = $root.proto.CollectionMessage.toObject(message.collectionMessage, options); + if (options.oneofs) + object.interactiveMessage = "collectionMessage"; + } + if (message.nativeFlowMessage != null && message.hasOwnProperty("nativeFlowMessage")) { + object.nativeFlowMessage = $root.proto.NativeFlowMessage.toObject(message.nativeFlowMessage, options); + if (options.oneofs) + object.interactiveMessage = "nativeFlowMessage"; + } + if (message.contextInfo != null && message.hasOwnProperty("contextInfo")) + object.contextInfo = $root.proto.ContextInfo.toObject(message.contextInfo, options); return object; }; /** - * Converts this MsgRowOpaqueData to JSON. + * Converts this InteractiveMessage to JSON. * @function toJSON - * @memberof proto.MsgRowOpaqueData + * @memberof proto.InteractiveMessage * @instance * @returns {Object.} JSON object */ - MsgRowOpaqueData.prototype.toJSON = function toJSON() { + InteractiveMessage.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return MsgRowOpaqueData; + return InteractiveMessage; })(); - proto.GlobalSettings = (function() { + proto.InteractiveMessageBody = (function() { /** - * Properties of a GlobalSettings. + * Properties of an InteractiveMessageBody. * @memberof proto - * @interface IGlobalSettings - * @property {proto.IWallpaperSettings|null} [lightThemeWallpaper] GlobalSettings lightThemeWallpaper - * @property {proto.MediaVisibility|null} [mediaVisibility] GlobalSettings mediaVisibility - * @property {proto.IWallpaperSettings|null} [darkThemeWallpaper] GlobalSettings darkThemeWallpaper + * @interface IInteractiveMessageBody + * @property {string|null} [text] InteractiveMessageBody text */ /** - * Constructs a new GlobalSettings. + * Constructs a new InteractiveMessageBody. * @memberof proto - * @classdesc Represents a GlobalSettings. - * @implements IGlobalSettings + * @classdesc Represents an InteractiveMessageBody. + * @implements IInteractiveMessageBody * @constructor - * @param {proto.IGlobalSettings=} [properties] Properties to set + * @param {proto.IInteractiveMessageBody=} [properties] Properties to set */ - function GlobalSettings(properties) { + function InteractiveMessageBody(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -17702,101 +18401,75 @@ $root.proto = (function() { } /** - * GlobalSettings lightThemeWallpaper. - * @member {proto.IWallpaperSettings|null|undefined} lightThemeWallpaper - * @memberof proto.GlobalSettings - * @instance - */ - GlobalSettings.prototype.lightThemeWallpaper = null; - - /** - * GlobalSettings mediaVisibility. - * @member {proto.MediaVisibility} mediaVisibility - * @memberof proto.GlobalSettings - * @instance - */ - GlobalSettings.prototype.mediaVisibility = 0; - - /** - * GlobalSettings darkThemeWallpaper. - * @member {proto.IWallpaperSettings|null|undefined} darkThemeWallpaper - * @memberof proto.GlobalSettings + * InteractiveMessageBody text. + * @member {string} text + * @memberof proto.InteractiveMessageBody * @instance */ - GlobalSettings.prototype.darkThemeWallpaper = null; + InteractiveMessageBody.prototype.text = ""; /** - * Creates a new GlobalSettings instance using the specified properties. + * Creates a new InteractiveMessageBody instance using the specified properties. * @function create - * @memberof proto.GlobalSettings + * @memberof proto.InteractiveMessageBody * @static - * @param {proto.IGlobalSettings=} [properties] Properties to set - * @returns {proto.GlobalSettings} GlobalSettings instance + * @param {proto.IInteractiveMessageBody=} [properties] Properties to set + * @returns {proto.InteractiveMessageBody} InteractiveMessageBody instance */ - GlobalSettings.create = function create(properties) { - return new GlobalSettings(properties); + InteractiveMessageBody.create = function create(properties) { + return new InteractiveMessageBody(properties); }; /** - * Encodes the specified GlobalSettings message. Does not implicitly {@link proto.GlobalSettings.verify|verify} messages. + * Encodes the specified InteractiveMessageBody message. Does not implicitly {@link proto.InteractiveMessageBody.verify|verify} messages. * @function encode - * @memberof proto.GlobalSettings + * @memberof proto.InteractiveMessageBody * @static - * @param {proto.IGlobalSettings} message GlobalSettings message or plain object to encode + * @param {proto.IInteractiveMessageBody} message InteractiveMessageBody message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GlobalSettings.encode = function encode(message, writer) { + InteractiveMessageBody.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.lightThemeWallpaper != null && Object.hasOwnProperty.call(message, "lightThemeWallpaper")) - $root.proto.WallpaperSettings.encode(message.lightThemeWallpaper, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.mediaVisibility != null && Object.hasOwnProperty.call(message, "mediaVisibility")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.mediaVisibility); - if (message.darkThemeWallpaper != null && Object.hasOwnProperty.call(message, "darkThemeWallpaper")) - $root.proto.WallpaperSettings.encode(message.darkThemeWallpaper, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.text != null && Object.hasOwnProperty.call(message, "text")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.text); return writer; }; /** - * Encodes the specified GlobalSettings message, length delimited. Does not implicitly {@link proto.GlobalSettings.verify|verify} messages. + * Encodes the specified InteractiveMessageBody message, length delimited. Does not implicitly {@link proto.InteractiveMessageBody.verify|verify} messages. * @function encodeDelimited - * @memberof proto.GlobalSettings + * @memberof proto.InteractiveMessageBody * @static - * @param {proto.IGlobalSettings} message GlobalSettings message or plain object to encode + * @param {proto.IInteractiveMessageBody} message InteractiveMessageBody message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GlobalSettings.encodeDelimited = function encodeDelimited(message, writer) { + InteractiveMessageBody.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GlobalSettings message from the specified reader or buffer. + * Decodes an InteractiveMessageBody message from the specified reader or buffer. * @function decode - * @memberof proto.GlobalSettings + * @memberof proto.InteractiveMessageBody * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {proto.GlobalSettings} GlobalSettings + * @returns {proto.InteractiveMessageBody} InteractiveMessageBody * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GlobalSettings.decode = function decode(reader, length) { + InteractiveMessageBody.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.GlobalSettings(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.InteractiveMessageBody(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.lightThemeWallpaper = $root.proto.WallpaperSettings.decode(reader, reader.uint32()); - break; - case 2: - message.mediaVisibility = reader.int32(); - break; - case 3: - message.darkThemeWallpaper = $root.proto.WallpaperSettings.decode(reader, reader.uint32()); + message.text = reader.string(); break; default: reader.skipType(tag & 7); @@ -17807,153 +18480,109 @@ $root.proto = (function() { }; /** - * Decodes a GlobalSettings message from the specified reader or buffer, length delimited. + * Decodes an InteractiveMessageBody message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof proto.GlobalSettings + * @memberof proto.InteractiveMessageBody * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.GlobalSettings} GlobalSettings + * @returns {proto.InteractiveMessageBody} InteractiveMessageBody * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GlobalSettings.decodeDelimited = function decodeDelimited(reader) { + InteractiveMessageBody.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GlobalSettings message. + * Verifies an InteractiveMessageBody message. * @function verify - * @memberof proto.GlobalSettings + * @memberof proto.InteractiveMessageBody * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GlobalSettings.verify = function verify(message) { + InteractiveMessageBody.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.lightThemeWallpaper != null && message.hasOwnProperty("lightThemeWallpaper")) { - var error = $root.proto.WallpaperSettings.verify(message.lightThemeWallpaper); - if (error) - return "lightThemeWallpaper." + error; - } - if (message.mediaVisibility != null && message.hasOwnProperty("mediaVisibility")) - switch (message.mediaVisibility) { - default: - return "mediaVisibility: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.darkThemeWallpaper != null && message.hasOwnProperty("darkThemeWallpaper")) { - var error = $root.proto.WallpaperSettings.verify(message.darkThemeWallpaper); - if (error) - return "darkThemeWallpaper." + error; - } + if (message.text != null && message.hasOwnProperty("text")) + if (!$util.isString(message.text)) + return "text: string expected"; return null; }; /** - * Creates a GlobalSettings message from a plain object. Also converts values to their respective internal types. + * Creates an InteractiveMessageBody message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof proto.GlobalSettings + * @memberof proto.InteractiveMessageBody * @static * @param {Object.} object Plain object - * @returns {proto.GlobalSettings} GlobalSettings + * @returns {proto.InteractiveMessageBody} InteractiveMessageBody */ - GlobalSettings.fromObject = function fromObject(object) { - if (object instanceof $root.proto.GlobalSettings) + InteractiveMessageBody.fromObject = function fromObject(object) { + if (object instanceof $root.proto.InteractiveMessageBody) return object; - var message = new $root.proto.GlobalSettings(); - if (object.lightThemeWallpaper != null) { - if (typeof object.lightThemeWallpaper !== "object") - throw TypeError(".proto.GlobalSettings.lightThemeWallpaper: object expected"); - message.lightThemeWallpaper = $root.proto.WallpaperSettings.fromObject(object.lightThemeWallpaper); - } - switch (object.mediaVisibility) { - case "DEFAULT": - case 0: - message.mediaVisibility = 0; - break; - case "OFF": - case 1: - message.mediaVisibility = 1; - break; - case "ON": - case 2: - message.mediaVisibility = 2; - break; - } - if (object.darkThemeWallpaper != null) { - if (typeof object.darkThemeWallpaper !== "object") - throw TypeError(".proto.GlobalSettings.darkThemeWallpaper: object expected"); - message.darkThemeWallpaper = $root.proto.WallpaperSettings.fromObject(object.darkThemeWallpaper); - } + var message = new $root.proto.InteractiveMessageBody(); + if (object.text != null) + message.text = String(object.text); return message; }; /** - * Creates a plain object from a GlobalSettings message. Also converts values to other types if specified. + * Creates a plain object from an InteractiveMessageBody message. Also converts values to other types if specified. * @function toObject - * @memberof proto.GlobalSettings + * @memberof proto.InteractiveMessageBody * @static - * @param {proto.GlobalSettings} message GlobalSettings + * @param {proto.InteractiveMessageBody} message InteractiveMessageBody * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GlobalSettings.toObject = function toObject(message, options) { + InteractiveMessageBody.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.lightThemeWallpaper = null; - object.mediaVisibility = options.enums === String ? "DEFAULT" : 0; - object.darkThemeWallpaper = null; - } - if (message.lightThemeWallpaper != null && message.hasOwnProperty("lightThemeWallpaper")) - object.lightThemeWallpaper = $root.proto.WallpaperSettings.toObject(message.lightThemeWallpaper, options); - if (message.mediaVisibility != null && message.hasOwnProperty("mediaVisibility")) - object.mediaVisibility = options.enums === String ? $root.proto.MediaVisibility[message.mediaVisibility] : message.mediaVisibility; - if (message.darkThemeWallpaper != null && message.hasOwnProperty("darkThemeWallpaper")) - object.darkThemeWallpaper = $root.proto.WallpaperSettings.toObject(message.darkThemeWallpaper, options); + if (options.defaults) + object.text = ""; + if (message.text != null && message.hasOwnProperty("text")) + object.text = message.text; return object; }; /** - * Converts this GlobalSettings to JSON. + * Converts this InteractiveMessageBody to JSON. * @function toJSON - * @memberof proto.GlobalSettings + * @memberof proto.InteractiveMessageBody * @instance * @returns {Object.} JSON object */ - GlobalSettings.prototype.toJSON = function toJSON() { + InteractiveMessageBody.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return GlobalSettings; + return InteractiveMessageBody; })(); - proto.WallpaperSettings = (function() { + proto.InteractiveResponseMessage = (function() { /** - * Properties of a WallpaperSettings. + * Properties of an InteractiveResponseMessage. * @memberof proto - * @interface IWallpaperSettings - * @property {string|null} [filename] WallpaperSettings filename - * @property {number|null} [opacity] WallpaperSettings opacity + * @interface IInteractiveResponseMessage + * @property {proto.IInteractiveResponseMessageBody|null} [body] InteractiveResponseMessage body + * @property {proto.IContextInfo|null} [contextInfo] InteractiveResponseMessage contextInfo + * @property {proto.INativeFlowResponseMessage|null} [nativeFlowResponseMessage] InteractiveResponseMessage nativeFlowResponseMessage */ /** - * Constructs a new WallpaperSettings. + * Constructs a new InteractiveResponseMessage. * @memberof proto - * @classdesc Represents a WallpaperSettings. - * @implements IWallpaperSettings + * @classdesc Represents an InteractiveResponseMessage. + * @implements IInteractiveResponseMessage * @constructor - * @param {proto.IWallpaperSettings=} [properties] Properties to set + * @param {proto.IInteractiveResponseMessage=} [properties] Properties to set */ - function WallpaperSettings(properties) { + function InteractiveResponseMessage(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -17961,88 +18590,115 @@ $root.proto = (function() { } /** - * WallpaperSettings filename. - * @member {string} filename - * @memberof proto.WallpaperSettings + * InteractiveResponseMessage body. + * @member {proto.IInteractiveResponseMessageBody|null|undefined} body + * @memberof proto.InteractiveResponseMessage * @instance */ - WallpaperSettings.prototype.filename = ""; + InteractiveResponseMessage.prototype.body = null; /** - * WallpaperSettings opacity. - * @member {number} opacity - * @memberof proto.WallpaperSettings + * InteractiveResponseMessage contextInfo. + * @member {proto.IContextInfo|null|undefined} contextInfo + * @memberof proto.InteractiveResponseMessage * @instance */ - WallpaperSettings.prototype.opacity = 0; + InteractiveResponseMessage.prototype.contextInfo = null; /** - * Creates a new WallpaperSettings instance using the specified properties. + * InteractiveResponseMessage nativeFlowResponseMessage. + * @member {proto.INativeFlowResponseMessage|null|undefined} nativeFlowResponseMessage + * @memberof proto.InteractiveResponseMessage + * @instance + */ + InteractiveResponseMessage.prototype.nativeFlowResponseMessage = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * InteractiveResponseMessage interactiveResponseMessage. + * @member {"nativeFlowResponseMessage"|undefined} interactiveResponseMessage + * @memberof proto.InteractiveResponseMessage + * @instance + */ + Object.defineProperty(InteractiveResponseMessage.prototype, "interactiveResponseMessage", { + get: $util.oneOfGetter($oneOfFields = ["nativeFlowResponseMessage"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new InteractiveResponseMessage instance using the specified properties. * @function create - * @memberof proto.WallpaperSettings + * @memberof proto.InteractiveResponseMessage * @static - * @param {proto.IWallpaperSettings=} [properties] Properties to set - * @returns {proto.WallpaperSettings} WallpaperSettings instance + * @param {proto.IInteractiveResponseMessage=} [properties] Properties to set + * @returns {proto.InteractiveResponseMessage} InteractiveResponseMessage instance */ - WallpaperSettings.create = function create(properties) { - return new WallpaperSettings(properties); + InteractiveResponseMessage.create = function create(properties) { + return new InteractiveResponseMessage(properties); }; /** - * Encodes the specified WallpaperSettings message. Does not implicitly {@link proto.WallpaperSettings.verify|verify} messages. + * Encodes the specified InteractiveResponseMessage message. Does not implicitly {@link proto.InteractiveResponseMessage.verify|verify} messages. * @function encode - * @memberof proto.WallpaperSettings + * @memberof proto.InteractiveResponseMessage * @static - * @param {proto.IWallpaperSettings} message WallpaperSettings message or plain object to encode + * @param {proto.IInteractiveResponseMessage} message InteractiveResponseMessage message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - WallpaperSettings.encode = function encode(message, writer) { + InteractiveResponseMessage.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.filename != null && Object.hasOwnProperty.call(message, "filename")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.filename); - if (message.opacity != null && Object.hasOwnProperty.call(message, "opacity")) - writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.opacity); + if (message.body != null && Object.hasOwnProperty.call(message, "body")) + $root.proto.InteractiveResponseMessageBody.encode(message.body, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nativeFlowResponseMessage != null && Object.hasOwnProperty.call(message, "nativeFlowResponseMessage")) + $root.proto.NativeFlowResponseMessage.encode(message.nativeFlowResponseMessage, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.contextInfo != null && Object.hasOwnProperty.call(message, "contextInfo")) + $root.proto.ContextInfo.encode(message.contextInfo, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); return writer; }; /** - * Encodes the specified WallpaperSettings message, length delimited. Does not implicitly {@link proto.WallpaperSettings.verify|verify} messages. + * Encodes the specified InteractiveResponseMessage message, length delimited. Does not implicitly {@link proto.InteractiveResponseMessage.verify|verify} messages. * @function encodeDelimited - * @memberof proto.WallpaperSettings + * @memberof proto.InteractiveResponseMessage * @static - * @param {proto.IWallpaperSettings} message WallpaperSettings message or plain object to encode + * @param {proto.IInteractiveResponseMessage} message InteractiveResponseMessage message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - WallpaperSettings.encodeDelimited = function encodeDelimited(message, writer) { + InteractiveResponseMessage.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a WallpaperSettings message from the specified reader or buffer. + * Decodes an InteractiveResponseMessage message from the specified reader or buffer. * @function decode - * @memberof proto.WallpaperSettings + * @memberof proto.InteractiveResponseMessage * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {proto.WallpaperSettings} WallpaperSettings + * @returns {proto.InteractiveResponseMessage} InteractiveResponseMessage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - WallpaperSettings.decode = function decode(reader, length) { + InteractiveResponseMessage.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.WallpaperSettings(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.InteractiveResponseMessage(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.filename = reader.string(); + message.body = $root.proto.InteractiveResponseMessageBody.decode(reader, reader.uint32()); + break; + case 15: + message.contextInfo = $root.proto.ContextInfo.decode(reader, reader.uint32()); break; case 2: - message.opacity = reader.uint32(); + message.nativeFlowResponseMessage = $root.proto.NativeFlowResponseMessage.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -18053,117 +18709,145 @@ $root.proto = (function() { }; /** - * Decodes a WallpaperSettings message from the specified reader or buffer, length delimited. + * Decodes an InteractiveResponseMessage message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof proto.WallpaperSettings + * @memberof proto.InteractiveResponseMessage * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.WallpaperSettings} WallpaperSettings + * @returns {proto.InteractiveResponseMessage} InteractiveResponseMessage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - WallpaperSettings.decodeDelimited = function decodeDelimited(reader) { + InteractiveResponseMessage.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a WallpaperSettings message. + * Verifies an InteractiveResponseMessage message. * @function verify - * @memberof proto.WallpaperSettings + * @memberof proto.InteractiveResponseMessage * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - WallpaperSettings.verify = function verify(message) { + InteractiveResponseMessage.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.filename != null && message.hasOwnProperty("filename")) - if (!$util.isString(message.filename)) - return "filename: string expected"; - if (message.opacity != null && message.hasOwnProperty("opacity")) - if (!$util.isInteger(message.opacity)) - return "opacity: integer expected"; + var properties = {}; + if (message.body != null && message.hasOwnProperty("body")) { + var error = $root.proto.InteractiveResponseMessageBody.verify(message.body); + if (error) + return "body." + error; + } + if (message.contextInfo != null && message.hasOwnProperty("contextInfo")) { + var error = $root.proto.ContextInfo.verify(message.contextInfo); + if (error) + return "contextInfo." + error; + } + if (message.nativeFlowResponseMessage != null && message.hasOwnProperty("nativeFlowResponseMessage")) { + properties.interactiveResponseMessage = 1; + { + var error = $root.proto.NativeFlowResponseMessage.verify(message.nativeFlowResponseMessage); + if (error) + return "nativeFlowResponseMessage." + error; + } + } return null; }; /** - * Creates a WallpaperSettings message from a plain object. Also converts values to their respective internal types. + * Creates an InteractiveResponseMessage message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof proto.WallpaperSettings + * @memberof proto.InteractiveResponseMessage * @static * @param {Object.} object Plain object - * @returns {proto.WallpaperSettings} WallpaperSettings + * @returns {proto.InteractiveResponseMessage} InteractiveResponseMessage */ - WallpaperSettings.fromObject = function fromObject(object) { - if (object instanceof $root.proto.WallpaperSettings) + InteractiveResponseMessage.fromObject = function fromObject(object) { + if (object instanceof $root.proto.InteractiveResponseMessage) return object; - var message = new $root.proto.WallpaperSettings(); - if (object.filename != null) - message.filename = String(object.filename); - if (object.opacity != null) - message.opacity = object.opacity >>> 0; + var message = new $root.proto.InteractiveResponseMessage(); + if (object.body != null) { + if (typeof object.body !== "object") + throw TypeError(".proto.InteractiveResponseMessage.body: object expected"); + message.body = $root.proto.InteractiveResponseMessageBody.fromObject(object.body); + } + if (object.contextInfo != null) { + if (typeof object.contextInfo !== "object") + throw TypeError(".proto.InteractiveResponseMessage.contextInfo: object expected"); + message.contextInfo = $root.proto.ContextInfo.fromObject(object.contextInfo); + } + if (object.nativeFlowResponseMessage != null) { + if (typeof object.nativeFlowResponseMessage !== "object") + throw TypeError(".proto.InteractiveResponseMessage.nativeFlowResponseMessage: object expected"); + message.nativeFlowResponseMessage = $root.proto.NativeFlowResponseMessage.fromObject(object.nativeFlowResponseMessage); + } return message; }; /** - * Creates a plain object from a WallpaperSettings message. Also converts values to other types if specified. + * Creates a plain object from an InteractiveResponseMessage message. Also converts values to other types if specified. * @function toObject - * @memberof proto.WallpaperSettings + * @memberof proto.InteractiveResponseMessage * @static - * @param {proto.WallpaperSettings} message WallpaperSettings + * @param {proto.InteractiveResponseMessage} message InteractiveResponseMessage * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - WallpaperSettings.toObject = function toObject(message, options) { + InteractiveResponseMessage.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.filename = ""; - object.opacity = 0; + object.body = null; + object.contextInfo = null; } - if (message.filename != null && message.hasOwnProperty("filename")) - object.filename = message.filename; - if (message.opacity != null && message.hasOwnProperty("opacity")) - object.opacity = message.opacity; + if (message.body != null && message.hasOwnProperty("body")) + object.body = $root.proto.InteractiveResponseMessageBody.toObject(message.body, options); + if (message.nativeFlowResponseMessage != null && message.hasOwnProperty("nativeFlowResponseMessage")) { + object.nativeFlowResponseMessage = $root.proto.NativeFlowResponseMessage.toObject(message.nativeFlowResponseMessage, options); + if (options.oneofs) + object.interactiveResponseMessage = "nativeFlowResponseMessage"; + } + if (message.contextInfo != null && message.hasOwnProperty("contextInfo")) + object.contextInfo = $root.proto.ContextInfo.toObject(message.contextInfo, options); return object; }; /** - * Converts this WallpaperSettings to JSON. + * Converts this InteractiveResponseMessage to JSON. * @function toJSON - * @memberof proto.WallpaperSettings + * @memberof proto.InteractiveResponseMessage * @instance * @returns {Object.} JSON object */ - WallpaperSettings.prototype.toJSON = function toJSON() { + InteractiveResponseMessage.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return WallpaperSettings; + return InteractiveResponseMessage; })(); - proto.GroupParticipant = (function() { + proto.InteractiveResponseMessageBody = (function() { /** - * Properties of a GroupParticipant. + * Properties of an InteractiveResponseMessageBody. * @memberof proto - * @interface IGroupParticipant - * @property {string} userJid GroupParticipant userJid - * @property {proto.GroupParticipant.GroupParticipantRank|null} [rank] GroupParticipant rank + * @interface IInteractiveResponseMessageBody + * @property {string|null} [text] InteractiveResponseMessageBody text */ /** - * Constructs a new GroupParticipant. + * Constructs a new InteractiveResponseMessageBody. * @memberof proto - * @classdesc Represents a GroupParticipant. - * @implements IGroupParticipant + * @classdesc Represents an InteractiveResponseMessageBody. + * @implements IInteractiveResponseMessageBody * @constructor - * @param {proto.IGroupParticipant=} [properties] Properties to set + * @param {proto.IInteractiveResponseMessageBody=} [properties] Properties to set */ - function GroupParticipant(properties) { + function InteractiveResponseMessageBody(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -18171,243 +18855,195 @@ $root.proto = (function() { } /** - * GroupParticipant userJid. - * @member {string} userJid - * @memberof proto.GroupParticipant - * @instance - */ - GroupParticipant.prototype.userJid = ""; - - /** - * GroupParticipant rank. - * @member {proto.GroupParticipant.GroupParticipantRank} rank - * @memberof proto.GroupParticipant + * InteractiveResponseMessageBody text. + * @member {string} text + * @memberof proto.InteractiveResponseMessageBody * @instance */ - GroupParticipant.prototype.rank = 0; + InteractiveResponseMessageBody.prototype.text = ""; /** - * Creates a new GroupParticipant instance using the specified properties. + * Creates a new InteractiveResponseMessageBody instance using the specified properties. * @function create - * @memberof proto.GroupParticipant + * @memberof proto.InteractiveResponseMessageBody * @static - * @param {proto.IGroupParticipant=} [properties] Properties to set - * @returns {proto.GroupParticipant} GroupParticipant instance + * @param {proto.IInteractiveResponseMessageBody=} [properties] Properties to set + * @returns {proto.InteractiveResponseMessageBody} InteractiveResponseMessageBody instance */ - GroupParticipant.create = function create(properties) { - return new GroupParticipant(properties); + InteractiveResponseMessageBody.create = function create(properties) { + return new InteractiveResponseMessageBody(properties); }; /** - * Encodes the specified GroupParticipant message. Does not implicitly {@link proto.GroupParticipant.verify|verify} messages. + * Encodes the specified InteractiveResponseMessageBody message. Does not implicitly {@link proto.InteractiveResponseMessageBody.verify|verify} messages. * @function encode - * @memberof proto.GroupParticipant + * @memberof proto.InteractiveResponseMessageBody * @static - * @param {proto.IGroupParticipant} message GroupParticipant message or plain object to encode + * @param {proto.IInteractiveResponseMessageBody} message InteractiveResponseMessageBody message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GroupParticipant.encode = function encode(message, writer) { + InteractiveResponseMessageBody.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - writer.uint32(/* id 1, wireType 2 =*/10).string(message.userJid); - if (message.rank != null && Object.hasOwnProperty.call(message, "rank")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.rank); + if (message.text != null && Object.hasOwnProperty.call(message, "text")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.text); return writer; }; /** - * Encodes the specified GroupParticipant message, length delimited. Does not implicitly {@link proto.GroupParticipant.verify|verify} messages. + * Encodes the specified InteractiveResponseMessageBody message, length delimited. Does not implicitly {@link proto.InteractiveResponseMessageBody.verify|verify} messages. * @function encodeDelimited - * @memberof proto.GroupParticipant + * @memberof proto.InteractiveResponseMessageBody * @static - * @param {proto.IGroupParticipant} message GroupParticipant message or plain object to encode + * @param {proto.IInteractiveResponseMessageBody} message InteractiveResponseMessageBody message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GroupParticipant.encodeDelimited = function encodeDelimited(message, writer) { + InteractiveResponseMessageBody.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GroupParticipant message from the specified reader or buffer. + * Decodes an InteractiveResponseMessageBody message from the specified reader or buffer. * @function decode - * @memberof proto.GroupParticipant + * @memberof proto.InteractiveResponseMessageBody * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {proto.GroupParticipant} GroupParticipant + * @returns {proto.InteractiveResponseMessageBody} InteractiveResponseMessageBody * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GroupParticipant.decode = function decode(reader, length) { + InteractiveResponseMessageBody.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.GroupParticipant(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.InteractiveResponseMessageBody(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.userJid = reader.string(); - break; - case 2: - message.rank = reader.int32(); + message.text = reader.string(); break; default: reader.skipType(tag & 7); break; } } - if (!message.hasOwnProperty("userJid")) - throw $util.ProtocolError("missing required 'userJid'", { instance: message }); return message; }; /** - * Decodes a GroupParticipant message from the specified reader or buffer, length delimited. + * Decodes an InteractiveResponseMessageBody message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof proto.GroupParticipant + * @memberof proto.InteractiveResponseMessageBody * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.GroupParticipant} GroupParticipant + * @returns {proto.InteractiveResponseMessageBody} InteractiveResponseMessageBody * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GroupParticipant.decodeDelimited = function decodeDelimited(reader) { + InteractiveResponseMessageBody.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GroupParticipant message. + * Verifies an InteractiveResponseMessageBody message. * @function verify - * @memberof proto.GroupParticipant + * @memberof proto.InteractiveResponseMessageBody * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GroupParticipant.verify = function verify(message) { + InteractiveResponseMessageBody.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (!$util.isString(message.userJid)) - return "userJid: string expected"; - if (message.rank != null && message.hasOwnProperty("rank")) - switch (message.rank) { - default: - return "rank: enum value expected"; - case 0: - case 1: - case 2: - break; - } + if (message.text != null && message.hasOwnProperty("text")) + if (!$util.isString(message.text)) + return "text: string expected"; return null; }; /** - * Creates a GroupParticipant message from a plain object. Also converts values to their respective internal types. + * Creates an InteractiveResponseMessageBody message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof proto.GroupParticipant + * @memberof proto.InteractiveResponseMessageBody * @static * @param {Object.} object Plain object - * @returns {proto.GroupParticipant} GroupParticipant + * @returns {proto.InteractiveResponseMessageBody} InteractiveResponseMessageBody */ - GroupParticipant.fromObject = function fromObject(object) { - if (object instanceof $root.proto.GroupParticipant) + InteractiveResponseMessageBody.fromObject = function fromObject(object) { + if (object instanceof $root.proto.InteractiveResponseMessageBody) return object; - var message = new $root.proto.GroupParticipant(); - if (object.userJid != null) - message.userJid = String(object.userJid); - switch (object.rank) { - case "REGULAR": - case 0: - message.rank = 0; - break; - case "ADMIN": - case 1: - message.rank = 1; - break; - case "SUPERADMIN": - case 2: - message.rank = 2; - break; - } + var message = new $root.proto.InteractiveResponseMessageBody(); + if (object.text != null) + message.text = String(object.text); return message; }; /** - * Creates a plain object from a GroupParticipant message. Also converts values to other types if specified. + * Creates a plain object from an InteractiveResponseMessageBody message. Also converts values to other types if specified. * @function toObject - * @memberof proto.GroupParticipant + * @memberof proto.InteractiveResponseMessageBody * @static - * @param {proto.GroupParticipant} message GroupParticipant + * @param {proto.InteractiveResponseMessageBody} message InteractiveResponseMessageBody * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GroupParticipant.toObject = function toObject(message, options) { + InteractiveResponseMessageBody.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.userJid = ""; - object.rank = options.enums === String ? "REGULAR" : 0; - } - if (message.userJid != null && message.hasOwnProperty("userJid")) - object.userJid = message.userJid; - if (message.rank != null && message.hasOwnProperty("rank")) - object.rank = options.enums === String ? $root.proto.GroupParticipant.GroupParticipantRank[message.rank] : message.rank; + if (options.defaults) + object.text = ""; + if (message.text != null && message.hasOwnProperty("text")) + object.text = message.text; return object; }; /** - * Converts this GroupParticipant to JSON. + * Converts this InteractiveResponseMessageBody to JSON. * @function toJSON - * @memberof proto.GroupParticipant + * @memberof proto.InteractiveResponseMessageBody * @instance * @returns {Object.} JSON object */ - GroupParticipant.prototype.toJSON = function toJSON() { + InteractiveResponseMessageBody.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - /** - * GroupParticipantRank enum. - * @name proto.GroupParticipant.GroupParticipantRank - * @enum {number} - * @property {number} REGULAR=0 REGULAR value - * @property {number} ADMIN=1 ADMIN value - * @property {number} SUPERADMIN=2 SUPERADMIN value - */ - GroupParticipant.GroupParticipantRank = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "REGULAR"] = 0; - values[valuesById[1] = "ADMIN"] = 1; - values[valuesById[2] = "SUPERADMIN"] = 2; - return values; - })(); - - return GroupParticipant; + return InteractiveResponseMessageBody; })(); - proto.Pushname = (function() { + proto.InvoiceMessage = (function() { /** - * Properties of a Pushname. + * Properties of an InvoiceMessage. * @memberof proto - * @interface IPushname - * @property {string|null} [id] Pushname id - * @property {string|null} [pushname] Pushname pushname + * @interface IInvoiceMessage + * @property {string|null} [note] InvoiceMessage note + * @property {string|null} [token] InvoiceMessage token + * @property {proto.InvoiceMessage.InvoiceMessageAttachmentType|null} [attachmentType] InvoiceMessage attachmentType + * @property {string|null} [attachmentMimetype] InvoiceMessage attachmentMimetype + * @property {Uint8Array|null} [attachmentMediaKey] InvoiceMessage attachmentMediaKey + * @property {number|Long|null} [attachmentMediaKeyTimestamp] InvoiceMessage attachmentMediaKeyTimestamp + * @property {Uint8Array|null} [attachmentFileSha256] InvoiceMessage attachmentFileSha256 + * @property {Uint8Array|null} [attachmentFileEncSha256] InvoiceMessage attachmentFileEncSha256 + * @property {string|null} [attachmentDirectPath] InvoiceMessage attachmentDirectPath + * @property {Uint8Array|null} [attachmentJpegThumbnail] InvoiceMessage attachmentJpegThumbnail */ /** - * Constructs a new Pushname. + * Constructs a new InvoiceMessage. * @memberof proto - * @classdesc Represents a Pushname. - * @implements IPushname + * @classdesc Represents an InvoiceMessage. + * @implements IInvoiceMessage * @constructor - * @param {proto.IPushname=} [properties] Properties to set + * @param {proto.IInvoiceMessage=} [properties] Properties to set */ - function Pushname(properties) { + function InvoiceMessage(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -18415,88 +19051,192 @@ $root.proto = (function() { } /** - * Pushname id. - * @member {string} id - * @memberof proto.Pushname + * InvoiceMessage note. + * @member {string} note + * @memberof proto.InvoiceMessage * @instance */ - Pushname.prototype.id = ""; + InvoiceMessage.prototype.note = ""; /** - * Pushname pushname. - * @member {string} pushname - * @memberof proto.Pushname + * InvoiceMessage token. + * @member {string} token + * @memberof proto.InvoiceMessage * @instance */ - Pushname.prototype.pushname = ""; + InvoiceMessage.prototype.token = ""; /** - * Creates a new Pushname instance using the specified properties. + * InvoiceMessage attachmentType. + * @member {proto.InvoiceMessage.InvoiceMessageAttachmentType} attachmentType + * @memberof proto.InvoiceMessage + * @instance + */ + InvoiceMessage.prototype.attachmentType = 0; + + /** + * InvoiceMessage attachmentMimetype. + * @member {string} attachmentMimetype + * @memberof proto.InvoiceMessage + * @instance + */ + InvoiceMessage.prototype.attachmentMimetype = ""; + + /** + * InvoiceMessage attachmentMediaKey. + * @member {Uint8Array} attachmentMediaKey + * @memberof proto.InvoiceMessage + * @instance + */ + InvoiceMessage.prototype.attachmentMediaKey = $util.newBuffer([]); + + /** + * InvoiceMessage attachmentMediaKeyTimestamp. + * @member {number|Long} attachmentMediaKeyTimestamp + * @memberof proto.InvoiceMessage + * @instance + */ + InvoiceMessage.prototype.attachmentMediaKeyTimestamp = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * InvoiceMessage attachmentFileSha256. + * @member {Uint8Array} attachmentFileSha256 + * @memberof proto.InvoiceMessage + * @instance + */ + InvoiceMessage.prototype.attachmentFileSha256 = $util.newBuffer([]); + + /** + * InvoiceMessage attachmentFileEncSha256. + * @member {Uint8Array} attachmentFileEncSha256 + * @memberof proto.InvoiceMessage + * @instance + */ + InvoiceMessage.prototype.attachmentFileEncSha256 = $util.newBuffer([]); + + /** + * InvoiceMessage attachmentDirectPath. + * @member {string} attachmentDirectPath + * @memberof proto.InvoiceMessage + * @instance + */ + InvoiceMessage.prototype.attachmentDirectPath = ""; + + /** + * InvoiceMessage attachmentJpegThumbnail. + * @member {Uint8Array} attachmentJpegThumbnail + * @memberof proto.InvoiceMessage + * @instance + */ + InvoiceMessage.prototype.attachmentJpegThumbnail = $util.newBuffer([]); + + /** + * Creates a new InvoiceMessage instance using the specified properties. * @function create - * @memberof proto.Pushname + * @memberof proto.InvoiceMessage * @static - * @param {proto.IPushname=} [properties] Properties to set - * @returns {proto.Pushname} Pushname instance + * @param {proto.IInvoiceMessage=} [properties] Properties to set + * @returns {proto.InvoiceMessage} InvoiceMessage instance */ - Pushname.create = function create(properties) { - return new Pushname(properties); + InvoiceMessage.create = function create(properties) { + return new InvoiceMessage(properties); }; /** - * Encodes the specified Pushname message. Does not implicitly {@link proto.Pushname.verify|verify} messages. + * Encodes the specified InvoiceMessage message. Does not implicitly {@link proto.InvoiceMessage.verify|verify} messages. * @function encode - * @memberof proto.Pushname + * @memberof proto.InvoiceMessage * @static - * @param {proto.IPushname} message Pushname message or plain object to encode + * @param {proto.IInvoiceMessage} message InvoiceMessage message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Pushname.encode = function encode(message, writer) { + InvoiceMessage.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.id != null && Object.hasOwnProperty.call(message, "id")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.id); - if (message.pushname != null && Object.hasOwnProperty.call(message, "pushname")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.pushname); + if (message.note != null && Object.hasOwnProperty.call(message, "note")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.note); + if (message.token != null && Object.hasOwnProperty.call(message, "token")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.token); + if (message.attachmentType != null && Object.hasOwnProperty.call(message, "attachmentType")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.attachmentType); + if (message.attachmentMimetype != null && Object.hasOwnProperty.call(message, "attachmentMimetype")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.attachmentMimetype); + if (message.attachmentMediaKey != null && Object.hasOwnProperty.call(message, "attachmentMediaKey")) + writer.uint32(/* id 5, wireType 2 =*/42).bytes(message.attachmentMediaKey); + if (message.attachmentMediaKeyTimestamp != null && Object.hasOwnProperty.call(message, "attachmentMediaKeyTimestamp")) + writer.uint32(/* id 6, wireType 0 =*/48).int64(message.attachmentMediaKeyTimestamp); + if (message.attachmentFileSha256 != null && Object.hasOwnProperty.call(message, "attachmentFileSha256")) + writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.attachmentFileSha256); + if (message.attachmentFileEncSha256 != null && Object.hasOwnProperty.call(message, "attachmentFileEncSha256")) + writer.uint32(/* id 8, wireType 2 =*/66).bytes(message.attachmentFileEncSha256); + if (message.attachmentDirectPath != null && Object.hasOwnProperty.call(message, "attachmentDirectPath")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.attachmentDirectPath); + if (message.attachmentJpegThumbnail != null && Object.hasOwnProperty.call(message, "attachmentJpegThumbnail")) + writer.uint32(/* id 10, wireType 2 =*/82).bytes(message.attachmentJpegThumbnail); return writer; }; /** - * Encodes the specified Pushname message, length delimited. Does not implicitly {@link proto.Pushname.verify|verify} messages. + * Encodes the specified InvoiceMessage message, length delimited. Does not implicitly {@link proto.InvoiceMessage.verify|verify} messages. * @function encodeDelimited - * @memberof proto.Pushname + * @memberof proto.InvoiceMessage * @static - * @param {proto.IPushname} message Pushname message or plain object to encode + * @param {proto.IInvoiceMessage} message InvoiceMessage message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Pushname.encodeDelimited = function encodeDelimited(message, writer) { + InvoiceMessage.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Pushname message from the specified reader or buffer. + * Decodes an InvoiceMessage message from the specified reader or buffer. * @function decode - * @memberof proto.Pushname + * @memberof proto.InvoiceMessage * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {proto.Pushname} Pushname + * @returns {proto.InvoiceMessage} InvoiceMessage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Pushname.decode = function decode(reader, length) { + InvoiceMessage.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.Pushname(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.InvoiceMessage(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.id = reader.string(); + message.note = reader.string(); break; case 2: - message.pushname = reader.string(); + message.token = reader.string(); + break; + case 3: + message.attachmentType = reader.int32(); + break; + case 4: + message.attachmentMimetype = reader.string(); + break; + case 5: + message.attachmentMediaKey = reader.bytes(); + break; + case 6: + message.attachmentMediaKeyTimestamp = reader.int64(); + break; + case 7: + message.attachmentFileSha256 = reader.bytes(); + break; + case 8: + message.attachmentFileEncSha256 = reader.bytes(); + break; + case 9: + message.attachmentDirectPath = reader.string(); + break; + case 10: + message.attachmentJpegThumbnail = reader.bytes(); break; default: reader.skipType(tag & 7); @@ -18507,117 +19247,265 @@ $root.proto = (function() { }; /** - * Decodes a Pushname message from the specified reader or buffer, length delimited. + * Decodes an InvoiceMessage message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof proto.Pushname + * @memberof proto.InvoiceMessage * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.Pushname} Pushname + * @returns {proto.InvoiceMessage} InvoiceMessage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Pushname.decodeDelimited = function decodeDelimited(reader) { + InvoiceMessage.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Pushname message. + * Verifies an InvoiceMessage message. * @function verify - * @memberof proto.Pushname + * @memberof proto.InvoiceMessage * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Pushname.verify = function verify(message) { + InvoiceMessage.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.id != null && message.hasOwnProperty("id")) - if (!$util.isString(message.id)) - return "id: string expected"; - if (message.pushname != null && message.hasOwnProperty("pushname")) - if (!$util.isString(message.pushname)) - return "pushname: string expected"; + if (message.note != null && message.hasOwnProperty("note")) + if (!$util.isString(message.note)) + return "note: string expected"; + if (message.token != null && message.hasOwnProperty("token")) + if (!$util.isString(message.token)) + return "token: string expected"; + if (message.attachmentType != null && message.hasOwnProperty("attachmentType")) + switch (message.attachmentType) { + default: + return "attachmentType: enum value expected"; + case 0: + case 1: + break; + } + if (message.attachmentMimetype != null && message.hasOwnProperty("attachmentMimetype")) + if (!$util.isString(message.attachmentMimetype)) + return "attachmentMimetype: string expected"; + if (message.attachmentMediaKey != null && message.hasOwnProperty("attachmentMediaKey")) + if (!(message.attachmentMediaKey && typeof message.attachmentMediaKey.length === "number" || $util.isString(message.attachmentMediaKey))) + return "attachmentMediaKey: buffer expected"; + if (message.attachmentMediaKeyTimestamp != null && message.hasOwnProperty("attachmentMediaKeyTimestamp")) + if (!$util.isInteger(message.attachmentMediaKeyTimestamp) && !(message.attachmentMediaKeyTimestamp && $util.isInteger(message.attachmentMediaKeyTimestamp.low) && $util.isInteger(message.attachmentMediaKeyTimestamp.high))) + return "attachmentMediaKeyTimestamp: integer|Long expected"; + if (message.attachmentFileSha256 != null && message.hasOwnProperty("attachmentFileSha256")) + if (!(message.attachmentFileSha256 && typeof message.attachmentFileSha256.length === "number" || $util.isString(message.attachmentFileSha256))) + return "attachmentFileSha256: buffer expected"; + if (message.attachmentFileEncSha256 != null && message.hasOwnProperty("attachmentFileEncSha256")) + if (!(message.attachmentFileEncSha256 && typeof message.attachmentFileEncSha256.length === "number" || $util.isString(message.attachmentFileEncSha256))) + return "attachmentFileEncSha256: buffer expected"; + if (message.attachmentDirectPath != null && message.hasOwnProperty("attachmentDirectPath")) + if (!$util.isString(message.attachmentDirectPath)) + return "attachmentDirectPath: string expected"; + if (message.attachmentJpegThumbnail != null && message.hasOwnProperty("attachmentJpegThumbnail")) + if (!(message.attachmentJpegThumbnail && typeof message.attachmentJpegThumbnail.length === "number" || $util.isString(message.attachmentJpegThumbnail))) + return "attachmentJpegThumbnail: buffer expected"; return null; }; /** - * Creates a Pushname message from a plain object. Also converts values to their respective internal types. + * Creates an InvoiceMessage message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof proto.Pushname + * @memberof proto.InvoiceMessage * @static * @param {Object.} object Plain object - * @returns {proto.Pushname} Pushname + * @returns {proto.InvoiceMessage} InvoiceMessage */ - Pushname.fromObject = function fromObject(object) { - if (object instanceof $root.proto.Pushname) + InvoiceMessage.fromObject = function fromObject(object) { + if (object instanceof $root.proto.InvoiceMessage) return object; - var message = new $root.proto.Pushname(); - if (object.id != null) - message.id = String(object.id); - if (object.pushname != null) - message.pushname = String(object.pushname); + var message = new $root.proto.InvoiceMessage(); + if (object.note != null) + message.note = String(object.note); + if (object.token != null) + message.token = String(object.token); + switch (object.attachmentType) { + case "IMAGE": + case 0: + message.attachmentType = 0; + break; + case "PDF": + case 1: + message.attachmentType = 1; + break; + } + if (object.attachmentMimetype != null) + message.attachmentMimetype = String(object.attachmentMimetype); + if (object.attachmentMediaKey != null) + if (typeof object.attachmentMediaKey === "string") + $util.base64.decode(object.attachmentMediaKey, message.attachmentMediaKey = $util.newBuffer($util.base64.length(object.attachmentMediaKey)), 0); + else if (object.attachmentMediaKey.length) + message.attachmentMediaKey = object.attachmentMediaKey; + if (object.attachmentMediaKeyTimestamp != null) + if ($util.Long) + (message.attachmentMediaKeyTimestamp = $util.Long.fromValue(object.attachmentMediaKeyTimestamp)).unsigned = false; + else if (typeof object.attachmentMediaKeyTimestamp === "string") + message.attachmentMediaKeyTimestamp = parseInt(object.attachmentMediaKeyTimestamp, 10); + else if (typeof object.attachmentMediaKeyTimestamp === "number") + message.attachmentMediaKeyTimestamp = object.attachmentMediaKeyTimestamp; + else if (typeof object.attachmentMediaKeyTimestamp === "object") + message.attachmentMediaKeyTimestamp = new $util.LongBits(object.attachmentMediaKeyTimestamp.low >>> 0, object.attachmentMediaKeyTimestamp.high >>> 0).toNumber(); + if (object.attachmentFileSha256 != null) + if (typeof object.attachmentFileSha256 === "string") + $util.base64.decode(object.attachmentFileSha256, message.attachmentFileSha256 = $util.newBuffer($util.base64.length(object.attachmentFileSha256)), 0); + else if (object.attachmentFileSha256.length) + message.attachmentFileSha256 = object.attachmentFileSha256; + if (object.attachmentFileEncSha256 != null) + if (typeof object.attachmentFileEncSha256 === "string") + $util.base64.decode(object.attachmentFileEncSha256, message.attachmentFileEncSha256 = $util.newBuffer($util.base64.length(object.attachmentFileEncSha256)), 0); + else if (object.attachmentFileEncSha256.length) + message.attachmentFileEncSha256 = object.attachmentFileEncSha256; + if (object.attachmentDirectPath != null) + message.attachmentDirectPath = String(object.attachmentDirectPath); + if (object.attachmentJpegThumbnail != null) + if (typeof object.attachmentJpegThumbnail === "string") + $util.base64.decode(object.attachmentJpegThumbnail, message.attachmentJpegThumbnail = $util.newBuffer($util.base64.length(object.attachmentJpegThumbnail)), 0); + else if (object.attachmentJpegThumbnail.length) + message.attachmentJpegThumbnail = object.attachmentJpegThumbnail; return message; }; /** - * Creates a plain object from a Pushname message. Also converts values to other types if specified. + * Creates a plain object from an InvoiceMessage message. Also converts values to other types if specified. * @function toObject - * @memberof proto.Pushname + * @memberof proto.InvoiceMessage * @static - * @param {proto.Pushname} message Pushname + * @param {proto.InvoiceMessage} message InvoiceMessage * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Pushname.toObject = function toObject(message, options) { + InvoiceMessage.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.id = ""; - object.pushname = ""; + object.note = ""; + object.token = ""; + object.attachmentType = options.enums === String ? "IMAGE" : 0; + object.attachmentMimetype = ""; + if (options.bytes === String) + object.attachmentMediaKey = ""; + else { + object.attachmentMediaKey = []; + if (options.bytes !== Array) + object.attachmentMediaKey = $util.newBuffer(object.attachmentMediaKey); + } + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.attachmentMediaKeyTimestamp = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.attachmentMediaKeyTimestamp = options.longs === String ? "0" : 0; + if (options.bytes === String) + object.attachmentFileSha256 = ""; + else { + object.attachmentFileSha256 = []; + if (options.bytes !== Array) + object.attachmentFileSha256 = $util.newBuffer(object.attachmentFileSha256); + } + if (options.bytes === String) + object.attachmentFileEncSha256 = ""; + else { + object.attachmentFileEncSha256 = []; + if (options.bytes !== Array) + object.attachmentFileEncSha256 = $util.newBuffer(object.attachmentFileEncSha256); + } + object.attachmentDirectPath = ""; + if (options.bytes === String) + object.attachmentJpegThumbnail = ""; + else { + object.attachmentJpegThumbnail = []; + if (options.bytes !== Array) + object.attachmentJpegThumbnail = $util.newBuffer(object.attachmentJpegThumbnail); + } } - if (message.id != null && message.hasOwnProperty("id")) - object.id = message.id; - if (message.pushname != null && message.hasOwnProperty("pushname")) - object.pushname = message.pushname; + if (message.note != null && message.hasOwnProperty("note")) + object.note = message.note; + if (message.token != null && message.hasOwnProperty("token")) + object.token = message.token; + if (message.attachmentType != null && message.hasOwnProperty("attachmentType")) + object.attachmentType = options.enums === String ? $root.proto.InvoiceMessage.InvoiceMessageAttachmentType[message.attachmentType] : message.attachmentType; + if (message.attachmentMimetype != null && message.hasOwnProperty("attachmentMimetype")) + object.attachmentMimetype = message.attachmentMimetype; + if (message.attachmentMediaKey != null && message.hasOwnProperty("attachmentMediaKey")) + object.attachmentMediaKey = options.bytes === String ? $util.base64.encode(message.attachmentMediaKey, 0, message.attachmentMediaKey.length) : options.bytes === Array ? Array.prototype.slice.call(message.attachmentMediaKey) : message.attachmentMediaKey; + if (message.attachmentMediaKeyTimestamp != null && message.hasOwnProperty("attachmentMediaKeyTimestamp")) + if (typeof message.attachmentMediaKeyTimestamp === "number") + object.attachmentMediaKeyTimestamp = options.longs === String ? String(message.attachmentMediaKeyTimestamp) : message.attachmentMediaKeyTimestamp; + else + object.attachmentMediaKeyTimestamp = options.longs === String ? $util.Long.prototype.toString.call(message.attachmentMediaKeyTimestamp) : options.longs === Number ? new $util.LongBits(message.attachmentMediaKeyTimestamp.low >>> 0, message.attachmentMediaKeyTimestamp.high >>> 0).toNumber() : message.attachmentMediaKeyTimestamp; + if (message.attachmentFileSha256 != null && message.hasOwnProperty("attachmentFileSha256")) + object.attachmentFileSha256 = options.bytes === String ? $util.base64.encode(message.attachmentFileSha256, 0, message.attachmentFileSha256.length) : options.bytes === Array ? Array.prototype.slice.call(message.attachmentFileSha256) : message.attachmentFileSha256; + if (message.attachmentFileEncSha256 != null && message.hasOwnProperty("attachmentFileEncSha256")) + object.attachmentFileEncSha256 = options.bytes === String ? $util.base64.encode(message.attachmentFileEncSha256, 0, message.attachmentFileEncSha256.length) : options.bytes === Array ? Array.prototype.slice.call(message.attachmentFileEncSha256) : message.attachmentFileEncSha256; + if (message.attachmentDirectPath != null && message.hasOwnProperty("attachmentDirectPath")) + object.attachmentDirectPath = message.attachmentDirectPath; + if (message.attachmentJpegThumbnail != null && message.hasOwnProperty("attachmentJpegThumbnail")) + object.attachmentJpegThumbnail = options.bytes === String ? $util.base64.encode(message.attachmentJpegThumbnail, 0, message.attachmentJpegThumbnail.length) : options.bytes === Array ? Array.prototype.slice.call(message.attachmentJpegThumbnail) : message.attachmentJpegThumbnail; return object; }; /** - * Converts this Pushname to JSON. + * Converts this InvoiceMessage to JSON. * @function toJSON - * @memberof proto.Pushname + * @memberof proto.InvoiceMessage * @instance * @returns {Object.} JSON object */ - Pushname.prototype.toJSON = function toJSON() { + InvoiceMessage.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return Pushname; + /** + * InvoiceMessageAttachmentType enum. + * @name proto.InvoiceMessage.InvoiceMessageAttachmentType + * @enum {number} + * @property {number} IMAGE=0 IMAGE value + * @property {number} PDF=1 PDF value + */ + InvoiceMessage.InvoiceMessageAttachmentType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "IMAGE"] = 0; + values[valuesById[1] = "PDF"] = 1; + return values; + })(); + + return InvoiceMessage; })(); - proto.HistorySyncMsg = (function() { + proto.ListMessage = (function() { /** - * Properties of a HistorySyncMsg. + * Properties of a ListMessage. * @memberof proto - * @interface IHistorySyncMsg - * @property {proto.IWebMessageInfo|null} [message] HistorySyncMsg message - * @property {number|Long|null} [msgOrderId] HistorySyncMsg msgOrderId - */ + * @interface IListMessage + * @property {string|null} [title] ListMessage title + * @property {string|null} [description] ListMessage description + * @property {string|null} [buttonText] ListMessage buttonText + * @property {proto.ListMessage.ListMessageListType|null} [listType] ListMessage listType + * @property {Array.|null} [sections] ListMessage sections + * @property {proto.IProductListInfo|null} [productListInfo] ListMessage productListInfo + * @property {string|null} [footerText] ListMessage footerText + * @property {proto.IContextInfo|null} [contextInfo] ListMessage contextInfo + */ /** - * Constructs a new HistorySyncMsg. + * Constructs a new ListMessage. * @memberof proto - * @classdesc Represents a HistorySyncMsg. - * @implements IHistorySyncMsg + * @classdesc Represents a ListMessage. + * @implements IListMessage * @constructor - * @param {proto.IHistorySyncMsg=} [properties] Properties to set + * @param {proto.IListMessage=} [properties] Properties to set */ - function HistorySyncMsg(properties) { + function ListMessage(properties) { + this.sections = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -18625,88 +19513,169 @@ $root.proto = (function() { } /** - * HistorySyncMsg message. - * @member {proto.IWebMessageInfo|null|undefined} message - * @memberof proto.HistorySyncMsg + * ListMessage title. + * @member {string} title + * @memberof proto.ListMessage * @instance */ - HistorySyncMsg.prototype.message = null; + ListMessage.prototype.title = ""; /** - * HistorySyncMsg msgOrderId. - * @member {number|Long} msgOrderId - * @memberof proto.HistorySyncMsg + * ListMessage description. + * @member {string} description + * @memberof proto.ListMessage * @instance */ - HistorySyncMsg.prototype.msgOrderId = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + ListMessage.prototype.description = ""; /** - * Creates a new HistorySyncMsg instance using the specified properties. + * ListMessage buttonText. + * @member {string} buttonText + * @memberof proto.ListMessage + * @instance + */ + ListMessage.prototype.buttonText = ""; + + /** + * ListMessage listType. + * @member {proto.ListMessage.ListMessageListType} listType + * @memberof proto.ListMessage + * @instance + */ + ListMessage.prototype.listType = 0; + + /** + * ListMessage sections. + * @member {Array.} sections + * @memberof proto.ListMessage + * @instance + */ + ListMessage.prototype.sections = $util.emptyArray; + + /** + * ListMessage productListInfo. + * @member {proto.IProductListInfo|null|undefined} productListInfo + * @memberof proto.ListMessage + * @instance + */ + ListMessage.prototype.productListInfo = null; + + /** + * ListMessage footerText. + * @member {string} footerText + * @memberof proto.ListMessage + * @instance + */ + ListMessage.prototype.footerText = ""; + + /** + * ListMessage contextInfo. + * @member {proto.IContextInfo|null|undefined} contextInfo + * @memberof proto.ListMessage + * @instance + */ + ListMessage.prototype.contextInfo = null; + + /** + * Creates a new ListMessage instance using the specified properties. * @function create - * @memberof proto.HistorySyncMsg + * @memberof proto.ListMessage * @static - * @param {proto.IHistorySyncMsg=} [properties] Properties to set - * @returns {proto.HistorySyncMsg} HistorySyncMsg instance + * @param {proto.IListMessage=} [properties] Properties to set + * @returns {proto.ListMessage} ListMessage instance */ - HistorySyncMsg.create = function create(properties) { - return new HistorySyncMsg(properties); + ListMessage.create = function create(properties) { + return new ListMessage(properties); }; /** - * Encodes the specified HistorySyncMsg message. Does not implicitly {@link proto.HistorySyncMsg.verify|verify} messages. + * Encodes the specified ListMessage message. Does not implicitly {@link proto.ListMessage.verify|verify} messages. * @function encode - * @memberof proto.HistorySyncMsg + * @memberof proto.ListMessage * @static - * @param {proto.IHistorySyncMsg} message HistorySyncMsg message or plain object to encode + * @param {proto.IListMessage} message ListMessage message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - HistorySyncMsg.encode = function encode(message, writer) { + ListMessage.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.message != null && Object.hasOwnProperty.call(message, "message")) - $root.proto.WebMessageInfo.encode(message.message, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.msgOrderId != null && Object.hasOwnProperty.call(message, "msgOrderId")) - writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.msgOrderId); + if (message.title != null && Object.hasOwnProperty.call(message, "title")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.title); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); + if (message.buttonText != null && Object.hasOwnProperty.call(message, "buttonText")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.buttonText); + if (message.listType != null && Object.hasOwnProperty.call(message, "listType")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.listType); + if (message.sections != null && message.sections.length) + for (var i = 0; i < message.sections.length; ++i) + $root.proto.Section.encode(message.sections[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.productListInfo != null && Object.hasOwnProperty.call(message, "productListInfo")) + $root.proto.ProductListInfo.encode(message.productListInfo, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.footerText != null && Object.hasOwnProperty.call(message, "footerText")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.footerText); + if (message.contextInfo != null && Object.hasOwnProperty.call(message, "contextInfo")) + $root.proto.ContextInfo.encode(message.contextInfo, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); return writer; }; /** - * Encodes the specified HistorySyncMsg message, length delimited. Does not implicitly {@link proto.HistorySyncMsg.verify|verify} messages. + * Encodes the specified ListMessage message, length delimited. Does not implicitly {@link proto.ListMessage.verify|verify} messages. * @function encodeDelimited - * @memberof proto.HistorySyncMsg + * @memberof proto.ListMessage * @static - * @param {proto.IHistorySyncMsg} message HistorySyncMsg message or plain object to encode + * @param {proto.IListMessage} message ListMessage message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - HistorySyncMsg.encodeDelimited = function encodeDelimited(message, writer) { + ListMessage.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a HistorySyncMsg message from the specified reader or buffer. + * Decodes a ListMessage message from the specified reader or buffer. * @function decode - * @memberof proto.HistorySyncMsg + * @memberof proto.ListMessage * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {proto.HistorySyncMsg} HistorySyncMsg + * @returns {proto.ListMessage} ListMessage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - HistorySyncMsg.decode = function decode(reader, length) { + ListMessage.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.HistorySyncMsg(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.ListMessage(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.message = $root.proto.WebMessageInfo.decode(reader, reader.uint32()); + message.title = reader.string(); break; case 2: - message.msgOrderId = reader.uint64(); + message.description = reader.string(); + break; + case 3: + message.buttonText = reader.string(); + break; + case 4: + message.listType = reader.int32(); + break; + case 5: + if (!(message.sections && message.sections.length)) + message.sections = []; + message.sections.push($root.proto.Section.decode(reader, reader.uint32())); + break; + case 6: + message.productListInfo = $root.proto.ProductListInfo.decode(reader, reader.uint32()); + break; + case 7: + message.footerText = reader.string(); + break; + case 8: + message.contextInfo = $root.proto.ContextInfo.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -18717,165 +19686,230 @@ $root.proto = (function() { }; /** - * Decodes a HistorySyncMsg message from the specified reader or buffer, length delimited. + * Decodes a ListMessage message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof proto.HistorySyncMsg + * @memberof proto.ListMessage * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.HistorySyncMsg} HistorySyncMsg + * @returns {proto.ListMessage} ListMessage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - HistorySyncMsg.decodeDelimited = function decodeDelimited(reader) { + ListMessage.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a HistorySyncMsg message. + * Verifies a ListMessage message. * @function verify - * @memberof proto.HistorySyncMsg + * @memberof proto.ListMessage * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - HistorySyncMsg.verify = function verify(message) { + ListMessage.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.message != null && message.hasOwnProperty("message")) { - var error = $root.proto.WebMessageInfo.verify(message.message); + if (message.title != null && message.hasOwnProperty("title")) + if (!$util.isString(message.title)) + return "title: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.buttonText != null && message.hasOwnProperty("buttonText")) + if (!$util.isString(message.buttonText)) + return "buttonText: string expected"; + if (message.listType != null && message.hasOwnProperty("listType")) + switch (message.listType) { + default: + return "listType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.sections != null && message.hasOwnProperty("sections")) { + if (!Array.isArray(message.sections)) + return "sections: array expected"; + for (var i = 0; i < message.sections.length; ++i) { + var error = $root.proto.Section.verify(message.sections[i]); + if (error) + return "sections." + error; + } + } + if (message.productListInfo != null && message.hasOwnProperty("productListInfo")) { + var error = $root.proto.ProductListInfo.verify(message.productListInfo); if (error) - return "message." + error; + return "productListInfo." + error; + } + if (message.footerText != null && message.hasOwnProperty("footerText")) + if (!$util.isString(message.footerText)) + return "footerText: string expected"; + if (message.contextInfo != null && message.hasOwnProperty("contextInfo")) { + var error = $root.proto.ContextInfo.verify(message.contextInfo); + if (error) + return "contextInfo." + error; } - if (message.msgOrderId != null && message.hasOwnProperty("msgOrderId")) - if (!$util.isInteger(message.msgOrderId) && !(message.msgOrderId && $util.isInteger(message.msgOrderId.low) && $util.isInteger(message.msgOrderId.high))) - return "msgOrderId: integer|Long expected"; return null; }; /** - * Creates a HistorySyncMsg message from a plain object. Also converts values to their respective internal types. + * Creates a ListMessage message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof proto.HistorySyncMsg + * @memberof proto.ListMessage * @static * @param {Object.} object Plain object - * @returns {proto.HistorySyncMsg} HistorySyncMsg + * @returns {proto.ListMessage} ListMessage */ - HistorySyncMsg.fromObject = function fromObject(object) { - if (object instanceof $root.proto.HistorySyncMsg) + ListMessage.fromObject = function fromObject(object) { + if (object instanceof $root.proto.ListMessage) return object; - var message = new $root.proto.HistorySyncMsg(); - if (object.message != null) { - if (typeof object.message !== "object") - throw TypeError(".proto.HistorySyncMsg.message: object expected"); - message.message = $root.proto.WebMessageInfo.fromObject(object.message); + var message = new $root.proto.ListMessage(); + if (object.title != null) + message.title = String(object.title); + if (object.description != null) + message.description = String(object.description); + if (object.buttonText != null) + message.buttonText = String(object.buttonText); + switch (object.listType) { + case "UNKNOWN": + case 0: + message.listType = 0; + break; + case "SINGLE_SELECT": + case 1: + message.listType = 1; + break; + case "PRODUCT_LIST": + case 2: + message.listType = 2; + break; + } + if (object.sections) { + if (!Array.isArray(object.sections)) + throw TypeError(".proto.ListMessage.sections: array expected"); + message.sections = []; + for (var i = 0; i < object.sections.length; ++i) { + if (typeof object.sections[i] !== "object") + throw TypeError(".proto.ListMessage.sections: object expected"); + message.sections[i] = $root.proto.Section.fromObject(object.sections[i]); + } + } + if (object.productListInfo != null) { + if (typeof object.productListInfo !== "object") + throw TypeError(".proto.ListMessage.productListInfo: object expected"); + message.productListInfo = $root.proto.ProductListInfo.fromObject(object.productListInfo); + } + if (object.footerText != null) + message.footerText = String(object.footerText); + if (object.contextInfo != null) { + if (typeof object.contextInfo !== "object") + throw TypeError(".proto.ListMessage.contextInfo: object expected"); + message.contextInfo = $root.proto.ContextInfo.fromObject(object.contextInfo); } - if (object.msgOrderId != null) - if ($util.Long) - (message.msgOrderId = $util.Long.fromValue(object.msgOrderId)).unsigned = true; - else if (typeof object.msgOrderId === "string") - message.msgOrderId = parseInt(object.msgOrderId, 10); - else if (typeof object.msgOrderId === "number") - message.msgOrderId = object.msgOrderId; - else if (typeof object.msgOrderId === "object") - message.msgOrderId = new $util.LongBits(object.msgOrderId.low >>> 0, object.msgOrderId.high >>> 0).toNumber(true); return message; }; /** - * Creates a plain object from a HistorySyncMsg message. Also converts values to other types if specified. + * Creates a plain object from a ListMessage message. Also converts values to other types if specified. * @function toObject - * @memberof proto.HistorySyncMsg + * @memberof proto.ListMessage * @static - * @param {proto.HistorySyncMsg} message HistorySyncMsg + * @param {proto.ListMessage} message ListMessage * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - HistorySyncMsg.toObject = function toObject(message, options) { + ListMessage.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.sections = []; if (options.defaults) { - object.message = null; - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.msgOrderId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.msgOrderId = options.longs === String ? "0" : 0; + object.title = ""; + object.description = ""; + object.buttonText = ""; + object.listType = options.enums === String ? "UNKNOWN" : 0; + object.productListInfo = null; + object.footerText = ""; + object.contextInfo = null; } - if (message.message != null && message.hasOwnProperty("message")) - object.message = $root.proto.WebMessageInfo.toObject(message.message, options); - if (message.msgOrderId != null && message.hasOwnProperty("msgOrderId")) - if (typeof message.msgOrderId === "number") - object.msgOrderId = options.longs === String ? String(message.msgOrderId) : message.msgOrderId; - else - object.msgOrderId = options.longs === String ? $util.Long.prototype.toString.call(message.msgOrderId) : options.longs === Number ? new $util.LongBits(message.msgOrderId.low >>> 0, message.msgOrderId.high >>> 0).toNumber(true) : message.msgOrderId; + if (message.title != null && message.hasOwnProperty("title")) + object.title = message.title; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.buttonText != null && message.hasOwnProperty("buttonText")) + object.buttonText = message.buttonText; + if (message.listType != null && message.hasOwnProperty("listType")) + object.listType = options.enums === String ? $root.proto.ListMessage.ListMessageListType[message.listType] : message.listType; + if (message.sections && message.sections.length) { + object.sections = []; + for (var j = 0; j < message.sections.length; ++j) + object.sections[j] = $root.proto.Section.toObject(message.sections[j], options); + } + if (message.productListInfo != null && message.hasOwnProperty("productListInfo")) + object.productListInfo = $root.proto.ProductListInfo.toObject(message.productListInfo, options); + if (message.footerText != null && message.hasOwnProperty("footerText")) + object.footerText = message.footerText; + if (message.contextInfo != null && message.hasOwnProperty("contextInfo")) + object.contextInfo = $root.proto.ContextInfo.toObject(message.contextInfo, options); return object; }; /** - * Converts this HistorySyncMsg to JSON. + * Converts this ListMessage to JSON. * @function toJSON - * @memberof proto.HistorySyncMsg + * @memberof proto.ListMessage * @instance * @returns {Object.} JSON object */ - HistorySyncMsg.prototype.toJSON = function toJSON() { + ListMessage.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return HistorySyncMsg; + /** + * ListMessageListType enum. + * @name proto.ListMessage.ListMessageListType + * @enum {number} + * @property {number} UNKNOWN=0 UNKNOWN value + * @property {number} SINGLE_SELECT=1 SINGLE_SELECT value + * @property {number} PRODUCT_LIST=2 PRODUCT_LIST value + */ + ListMessage.ListMessageListType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNKNOWN"] = 0; + values[valuesById[1] = "SINGLE_SELECT"] = 1; + values[valuesById[2] = "PRODUCT_LIST"] = 2; + return values; + })(); + + return ListMessage; })(); - proto.Conversation = (function() { + proto.ListResponseMessage = (function() { /** - * Properties of a Conversation. + * Properties of a ListResponseMessage. * @memberof proto - * @interface IConversation - * @property {string} id Conversation id - * @property {Array.|null} [messages] Conversation messages - * @property {string|null} [newJid] Conversation newJid - * @property {string|null} [oldJid] Conversation oldJid - * @property {number|Long|null} [lastMsgTimestamp] Conversation lastMsgTimestamp - * @property {number|null} [unreadCount] Conversation unreadCount - * @property {boolean|null} [readOnly] Conversation readOnly - * @property {boolean|null} [endOfHistoryTransfer] Conversation endOfHistoryTransfer - * @property {number|null} [ephemeralExpiration] Conversation ephemeralExpiration - * @property {number|Long|null} [ephemeralSettingTimestamp] Conversation ephemeralSettingTimestamp - * @property {proto.Conversation.ConversationEndOfHistoryTransferType|null} [endOfHistoryTransferType] Conversation endOfHistoryTransferType - * @property {number|Long|null} [conversationTimestamp] Conversation conversationTimestamp - * @property {string|null} [name] Conversation name - * @property {string|null} [pHash] Conversation pHash - * @property {boolean|null} [notSpam] Conversation notSpam - * @property {boolean|null} [archived] Conversation archived - * @property {proto.IDisappearingMode|null} [disappearingMode] Conversation disappearingMode - * @property {number|null} [unreadMentionCount] Conversation unreadMentionCount - * @property {boolean|null} [markedAsUnread] Conversation markedAsUnread - * @property {Array.|null} [participant] Conversation participant - * @property {Uint8Array|null} [tcToken] Conversation tcToken - * @property {number|Long|null} [tcTokenTimestamp] Conversation tcTokenTimestamp - * @property {Uint8Array|null} [contactPrimaryIdentityKey] Conversation contactPrimaryIdentityKey - * @property {number|null} [pinned] Conversation pinned - * @property {number|Long|null} [muteEndTime] Conversation muteEndTime - * @property {proto.IWallpaperSettings|null} [wallpaper] Conversation wallpaper - * @property {proto.MediaVisibility|null} [mediaVisibility] Conversation mediaVisibility - * @property {number|Long|null} [tcTokenSenderTimestamp] Conversation tcTokenSenderTimestamp - * @property {boolean|null} [suspended] Conversation suspended + * @interface IListResponseMessage + * @property {string|null} [title] ListResponseMessage title + * @property {proto.ListResponseMessage.ListResponseMessageListType|null} [listType] ListResponseMessage listType + * @property {proto.ISingleSelectReply|null} [singleSelectReply] ListResponseMessage singleSelectReply + * @property {proto.IContextInfo|null} [contextInfo] ListResponseMessage contextInfo + * @property {string|null} [description] ListResponseMessage description */ /** - * Constructs a new Conversation. + * Constructs a new ListResponseMessage. * @memberof proto - * @classdesc Represents a Conversation. - * @implements IConversation + * @classdesc Represents a ListResponseMessage. + * @implements IListResponseMessage * @constructor - * @param {proto.IConversation=} [properties] Properties to set + * @param {proto.IListResponseMessage=} [properties] Properties to set */ - function Conversation(properties) { - this.messages = []; - this.participant = []; + function ListResponseMessage(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -18883,985 +19917,724 @@ $root.proto = (function() { } /** - * Conversation id. - * @member {string} id - * @memberof proto.Conversation + * ListResponseMessage title. + * @member {string} title + * @memberof proto.ListResponseMessage * @instance */ - Conversation.prototype.id = ""; + ListResponseMessage.prototype.title = ""; /** - * Conversation messages. - * @member {Array.} messages - * @memberof proto.Conversation + * ListResponseMessage listType. + * @member {proto.ListResponseMessage.ListResponseMessageListType} listType + * @memberof proto.ListResponseMessage * @instance */ - Conversation.prototype.messages = $util.emptyArray; + ListResponseMessage.prototype.listType = 0; /** - * Conversation newJid. - * @member {string} newJid - * @memberof proto.Conversation + * ListResponseMessage singleSelectReply. + * @member {proto.ISingleSelectReply|null|undefined} singleSelectReply + * @memberof proto.ListResponseMessage * @instance */ - Conversation.prototype.newJid = ""; + ListResponseMessage.prototype.singleSelectReply = null; /** - * Conversation oldJid. - * @member {string} oldJid - * @memberof proto.Conversation + * ListResponseMessage contextInfo. + * @member {proto.IContextInfo|null|undefined} contextInfo + * @memberof proto.ListResponseMessage * @instance */ - Conversation.prototype.oldJid = ""; + ListResponseMessage.prototype.contextInfo = null; /** - * Conversation lastMsgTimestamp. - * @member {number|Long} lastMsgTimestamp - * @memberof proto.Conversation + * ListResponseMessage description. + * @member {string} description + * @memberof proto.ListResponseMessage * @instance */ - Conversation.prototype.lastMsgTimestamp = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + ListResponseMessage.prototype.description = ""; /** - * Conversation unreadCount. - * @member {number} unreadCount - * @memberof proto.Conversation - * @instance + * Creates a new ListResponseMessage instance using the specified properties. + * @function create + * @memberof proto.ListResponseMessage + * @static + * @param {proto.IListResponseMessage=} [properties] Properties to set + * @returns {proto.ListResponseMessage} ListResponseMessage instance */ - Conversation.prototype.unreadCount = 0; + ListResponseMessage.create = function create(properties) { + return new ListResponseMessage(properties); + }; /** - * Conversation readOnly. - * @member {boolean} readOnly - * @memberof proto.Conversation - * @instance + * Encodes the specified ListResponseMessage message. Does not implicitly {@link proto.ListResponseMessage.verify|verify} messages. + * @function encode + * @memberof proto.ListResponseMessage + * @static + * @param {proto.IListResponseMessage} message ListResponseMessage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - Conversation.prototype.readOnly = false; + ListResponseMessage.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.title != null && Object.hasOwnProperty.call(message, "title")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.title); + if (message.listType != null && Object.hasOwnProperty.call(message, "listType")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.listType); + if (message.singleSelectReply != null && Object.hasOwnProperty.call(message, "singleSelectReply")) + $root.proto.SingleSelectReply.encode(message.singleSelectReply, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.contextInfo != null && Object.hasOwnProperty.call(message, "contextInfo")) + $root.proto.ContextInfo.encode(message.contextInfo, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.description); + return writer; + }; /** - * Conversation endOfHistoryTransfer. - * @member {boolean} endOfHistoryTransfer - * @memberof proto.Conversation - * @instance + * Encodes the specified ListResponseMessage message, length delimited. Does not implicitly {@link proto.ListResponseMessage.verify|verify} messages. + * @function encodeDelimited + * @memberof proto.ListResponseMessage + * @static + * @param {proto.IListResponseMessage} message ListResponseMessage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - Conversation.prototype.endOfHistoryTransfer = false; - - /** - * Conversation ephemeralExpiration. - * @member {number} ephemeralExpiration - * @memberof proto.Conversation - * @instance - */ - Conversation.prototype.ephemeralExpiration = 0; + ListResponseMessage.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; /** - * Conversation ephemeralSettingTimestamp. - * @member {number|Long} ephemeralSettingTimestamp - * @memberof proto.Conversation - * @instance + * Decodes a ListResponseMessage message from the specified reader or buffer. + * @function decode + * @memberof proto.ListResponseMessage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {proto.ListResponseMessage} ListResponseMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Conversation.prototype.ephemeralSettingTimestamp = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + ListResponseMessage.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.ListResponseMessage(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.title = reader.string(); + break; + case 2: + message.listType = reader.int32(); + break; + case 3: + message.singleSelectReply = $root.proto.SingleSelectReply.decode(reader, reader.uint32()); + break; + case 4: + message.contextInfo = $root.proto.ContextInfo.decode(reader, reader.uint32()); + break; + case 5: + message.description = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; /** - * Conversation endOfHistoryTransferType. - * @member {proto.Conversation.ConversationEndOfHistoryTransferType} endOfHistoryTransferType - * @memberof proto.Conversation - * @instance + * Decodes a ListResponseMessage message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof proto.ListResponseMessage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {proto.ListResponseMessage} ListResponseMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Conversation.prototype.endOfHistoryTransferType = 0; + ListResponseMessage.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; /** - * Conversation conversationTimestamp. - * @member {number|Long} conversationTimestamp - * @memberof proto.Conversation - * @instance + * Verifies a ListResponseMessage message. + * @function verify + * @memberof proto.ListResponseMessage + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Conversation.prototype.conversationTimestamp = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + ListResponseMessage.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.title != null && message.hasOwnProperty("title")) + if (!$util.isString(message.title)) + return "title: string expected"; + if (message.listType != null && message.hasOwnProperty("listType")) + switch (message.listType) { + default: + return "listType: enum value expected"; + case 0: + case 1: + break; + } + if (message.singleSelectReply != null && message.hasOwnProperty("singleSelectReply")) { + var error = $root.proto.SingleSelectReply.verify(message.singleSelectReply); + if (error) + return "singleSelectReply." + error; + } + if (message.contextInfo != null && message.hasOwnProperty("contextInfo")) { + var error = $root.proto.ContextInfo.verify(message.contextInfo); + if (error) + return "contextInfo." + error; + } + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + return null; + }; /** - * Conversation name. - * @member {string} name - * @memberof proto.Conversation - * @instance + * Creates a ListResponseMessage message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof proto.ListResponseMessage + * @static + * @param {Object.} object Plain object + * @returns {proto.ListResponseMessage} ListResponseMessage */ - Conversation.prototype.name = ""; + ListResponseMessage.fromObject = function fromObject(object) { + if (object instanceof $root.proto.ListResponseMessage) + return object; + var message = new $root.proto.ListResponseMessage(); + if (object.title != null) + message.title = String(object.title); + switch (object.listType) { + case "UNKNOWN": + case 0: + message.listType = 0; + break; + case "SINGLE_SELECT": + case 1: + message.listType = 1; + break; + } + if (object.singleSelectReply != null) { + if (typeof object.singleSelectReply !== "object") + throw TypeError(".proto.ListResponseMessage.singleSelectReply: object expected"); + message.singleSelectReply = $root.proto.SingleSelectReply.fromObject(object.singleSelectReply); + } + if (object.contextInfo != null) { + if (typeof object.contextInfo !== "object") + throw TypeError(".proto.ListResponseMessage.contextInfo: object expected"); + message.contextInfo = $root.proto.ContextInfo.fromObject(object.contextInfo); + } + if (object.description != null) + message.description = String(object.description); + return message; + }; /** - * Conversation pHash. - * @member {string} pHash - * @memberof proto.Conversation - * @instance + * Creates a plain object from a ListResponseMessage message. Also converts values to other types if specified. + * @function toObject + * @memberof proto.ListResponseMessage + * @static + * @param {proto.ListResponseMessage} message ListResponseMessage + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object */ - Conversation.prototype.pHash = ""; + ListResponseMessage.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.title = ""; + object.listType = options.enums === String ? "UNKNOWN" : 0; + object.singleSelectReply = null; + object.contextInfo = null; + object.description = ""; + } + if (message.title != null && message.hasOwnProperty("title")) + object.title = message.title; + if (message.listType != null && message.hasOwnProperty("listType")) + object.listType = options.enums === String ? $root.proto.ListResponseMessage.ListResponseMessageListType[message.listType] : message.listType; + if (message.singleSelectReply != null && message.hasOwnProperty("singleSelectReply")) + object.singleSelectReply = $root.proto.SingleSelectReply.toObject(message.singleSelectReply, options); + if (message.contextInfo != null && message.hasOwnProperty("contextInfo")) + object.contextInfo = $root.proto.ContextInfo.toObject(message.contextInfo, options); + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + return object; + }; /** - * Conversation notSpam. - * @member {boolean} notSpam - * @memberof proto.Conversation + * Converts this ListResponseMessage to JSON. + * @function toJSON + * @memberof proto.ListResponseMessage * @instance + * @returns {Object.} JSON object */ - Conversation.prototype.notSpam = false; + ListResponseMessage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; /** - * Conversation archived. - * @member {boolean} archived - * @memberof proto.Conversation - * @instance + * ListResponseMessageListType enum. + * @name proto.ListResponseMessage.ListResponseMessageListType + * @enum {number} + * @property {number} UNKNOWN=0 UNKNOWN value + * @property {number} SINGLE_SELECT=1 SINGLE_SELECT value */ - Conversation.prototype.archived = false; + ListResponseMessage.ListResponseMessageListType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNKNOWN"] = 0; + values[valuesById[1] = "SINGLE_SELECT"] = 1; + return values; + })(); - /** - * Conversation disappearingMode. - * @member {proto.IDisappearingMode|null|undefined} disappearingMode - * @memberof proto.Conversation - * @instance - */ - Conversation.prototype.disappearingMode = null; + return ListResponseMessage; + })(); + + proto.LiveLocationMessage = (function() { /** - * Conversation unreadMentionCount. - * @member {number} unreadMentionCount - * @memberof proto.Conversation - * @instance + * Properties of a LiveLocationMessage. + * @memberof proto + * @interface ILiveLocationMessage + * @property {number|null} [degreesLatitude] LiveLocationMessage degreesLatitude + * @property {number|null} [degreesLongitude] LiveLocationMessage degreesLongitude + * @property {number|null} [accuracyInMeters] LiveLocationMessage accuracyInMeters + * @property {number|null} [speedInMps] LiveLocationMessage speedInMps + * @property {number|null} [degreesClockwiseFromMagneticNorth] LiveLocationMessage degreesClockwiseFromMagneticNorth + * @property {string|null} [caption] LiveLocationMessage caption + * @property {number|Long|null} [sequenceNumber] LiveLocationMessage sequenceNumber + * @property {number|null} [timeOffset] LiveLocationMessage timeOffset + * @property {Uint8Array|null} [jpegThumbnail] LiveLocationMessage jpegThumbnail + * @property {proto.IContextInfo|null} [contextInfo] LiveLocationMessage contextInfo */ - Conversation.prototype.unreadMentionCount = 0; /** - * Conversation markedAsUnread. - * @member {boolean} markedAsUnread - * @memberof proto.Conversation - * @instance + * Constructs a new LiveLocationMessage. + * @memberof proto + * @classdesc Represents a LiveLocationMessage. + * @implements ILiveLocationMessage + * @constructor + * @param {proto.ILiveLocationMessage=} [properties] Properties to set */ - Conversation.prototype.markedAsUnread = false; + function LiveLocationMessage(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } /** - * Conversation participant. - * @member {Array.} participant - * @memberof proto.Conversation + * LiveLocationMessage degreesLatitude. + * @member {number} degreesLatitude + * @memberof proto.LiveLocationMessage * @instance */ - Conversation.prototype.participant = $util.emptyArray; + LiveLocationMessage.prototype.degreesLatitude = 0; /** - * Conversation tcToken. - * @member {Uint8Array} tcToken - * @memberof proto.Conversation + * LiveLocationMessage degreesLongitude. + * @member {number} degreesLongitude + * @memberof proto.LiveLocationMessage * @instance */ - Conversation.prototype.tcToken = $util.newBuffer([]); + LiveLocationMessage.prototype.degreesLongitude = 0; /** - * Conversation tcTokenTimestamp. - * @member {number|Long} tcTokenTimestamp - * @memberof proto.Conversation + * LiveLocationMessage accuracyInMeters. + * @member {number} accuracyInMeters + * @memberof proto.LiveLocationMessage * @instance */ - Conversation.prototype.tcTokenTimestamp = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + LiveLocationMessage.prototype.accuracyInMeters = 0; /** - * Conversation contactPrimaryIdentityKey. - * @member {Uint8Array} contactPrimaryIdentityKey - * @memberof proto.Conversation + * LiveLocationMessage speedInMps. + * @member {number} speedInMps + * @memberof proto.LiveLocationMessage * @instance */ - Conversation.prototype.contactPrimaryIdentityKey = $util.newBuffer([]); + LiveLocationMessage.prototype.speedInMps = 0; /** - * Conversation pinned. - * @member {number} pinned - * @memberof proto.Conversation + * LiveLocationMessage degreesClockwiseFromMagneticNorth. + * @member {number} degreesClockwiseFromMagneticNorth + * @memberof proto.LiveLocationMessage * @instance */ - Conversation.prototype.pinned = 0; + LiveLocationMessage.prototype.degreesClockwiseFromMagneticNorth = 0; /** - * Conversation muteEndTime. - * @member {number|Long} muteEndTime - * @memberof proto.Conversation + * LiveLocationMessage caption. + * @member {string} caption + * @memberof proto.LiveLocationMessage * @instance */ - Conversation.prototype.muteEndTime = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + LiveLocationMessage.prototype.caption = ""; /** - * Conversation wallpaper. - * @member {proto.IWallpaperSettings|null|undefined} wallpaper - * @memberof proto.Conversation + * LiveLocationMessage sequenceNumber. + * @member {number|Long} sequenceNumber + * @memberof proto.LiveLocationMessage * @instance */ - Conversation.prototype.wallpaper = null; + LiveLocationMessage.prototype.sequenceNumber = $util.Long ? $util.Long.fromBits(0,0,false) : 0; /** - * Conversation mediaVisibility. - * @member {proto.MediaVisibility} mediaVisibility - * @memberof proto.Conversation + * LiveLocationMessage timeOffset. + * @member {number} timeOffset + * @memberof proto.LiveLocationMessage * @instance */ - Conversation.prototype.mediaVisibility = 0; + LiveLocationMessage.prototype.timeOffset = 0; /** - * Conversation tcTokenSenderTimestamp. - * @member {number|Long} tcTokenSenderTimestamp - * @memberof proto.Conversation + * LiveLocationMessage jpegThumbnail. + * @member {Uint8Array} jpegThumbnail + * @memberof proto.LiveLocationMessage * @instance */ - Conversation.prototype.tcTokenSenderTimestamp = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + LiveLocationMessage.prototype.jpegThumbnail = $util.newBuffer([]); /** - * Conversation suspended. - * @member {boolean} suspended - * @memberof proto.Conversation + * LiveLocationMessage contextInfo. + * @member {proto.IContextInfo|null|undefined} contextInfo + * @memberof proto.LiveLocationMessage * @instance */ - Conversation.prototype.suspended = false; + LiveLocationMessage.prototype.contextInfo = null; /** - * Creates a new Conversation instance using the specified properties. + * Creates a new LiveLocationMessage instance using the specified properties. * @function create - * @memberof proto.Conversation + * @memberof proto.LiveLocationMessage * @static - * @param {proto.IConversation=} [properties] Properties to set - * @returns {proto.Conversation} Conversation instance + * @param {proto.ILiveLocationMessage=} [properties] Properties to set + * @returns {proto.LiveLocationMessage} LiveLocationMessage instance */ - Conversation.create = function create(properties) { - return new Conversation(properties); + LiveLocationMessage.create = function create(properties) { + return new LiveLocationMessage(properties); }; /** - * Encodes the specified Conversation message. Does not implicitly {@link proto.Conversation.verify|verify} messages. + * Encodes the specified LiveLocationMessage message. Does not implicitly {@link proto.LiveLocationMessage.verify|verify} messages. * @function encode - * @memberof proto.Conversation + * @memberof proto.LiveLocationMessage * @static - * @param {proto.IConversation} message Conversation message or plain object to encode + * @param {proto.ILiveLocationMessage} message LiveLocationMessage message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Conversation.encode = function encode(message, writer) { + LiveLocationMessage.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - writer.uint32(/* id 1, wireType 2 =*/10).string(message.id); - if (message.messages != null && message.messages.length) - for (var i = 0; i < message.messages.length; ++i) - $root.proto.HistorySyncMsg.encode(message.messages[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.newJid != null && Object.hasOwnProperty.call(message, "newJid")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.newJid); - if (message.oldJid != null && Object.hasOwnProperty.call(message, "oldJid")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.oldJid); - if (message.lastMsgTimestamp != null && Object.hasOwnProperty.call(message, "lastMsgTimestamp")) - writer.uint32(/* id 5, wireType 0 =*/40).uint64(message.lastMsgTimestamp); - if (message.unreadCount != null && Object.hasOwnProperty.call(message, "unreadCount")) - writer.uint32(/* id 6, wireType 0 =*/48).uint32(message.unreadCount); - if (message.readOnly != null && Object.hasOwnProperty.call(message, "readOnly")) - writer.uint32(/* id 7, wireType 0 =*/56).bool(message.readOnly); - if (message.endOfHistoryTransfer != null && Object.hasOwnProperty.call(message, "endOfHistoryTransfer")) - writer.uint32(/* id 8, wireType 0 =*/64).bool(message.endOfHistoryTransfer); - if (message.ephemeralExpiration != null && Object.hasOwnProperty.call(message, "ephemeralExpiration")) - writer.uint32(/* id 9, wireType 0 =*/72).uint32(message.ephemeralExpiration); - if (message.ephemeralSettingTimestamp != null && Object.hasOwnProperty.call(message, "ephemeralSettingTimestamp")) - writer.uint32(/* id 10, wireType 0 =*/80).int64(message.ephemeralSettingTimestamp); - if (message.endOfHistoryTransferType != null && Object.hasOwnProperty.call(message, "endOfHistoryTransferType")) - writer.uint32(/* id 11, wireType 0 =*/88).int32(message.endOfHistoryTransferType); - if (message.conversationTimestamp != null && Object.hasOwnProperty.call(message, "conversationTimestamp")) - writer.uint32(/* id 12, wireType 0 =*/96).uint64(message.conversationTimestamp); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 13, wireType 2 =*/106).string(message.name); - if (message.pHash != null && Object.hasOwnProperty.call(message, "pHash")) - writer.uint32(/* id 14, wireType 2 =*/114).string(message.pHash); - if (message.notSpam != null && Object.hasOwnProperty.call(message, "notSpam")) - writer.uint32(/* id 15, wireType 0 =*/120).bool(message.notSpam); - if (message.archived != null && Object.hasOwnProperty.call(message, "archived")) - writer.uint32(/* id 16, wireType 0 =*/128).bool(message.archived); - if (message.disappearingMode != null && Object.hasOwnProperty.call(message, "disappearingMode")) - $root.proto.DisappearingMode.encode(message.disappearingMode, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); - if (message.unreadMentionCount != null && Object.hasOwnProperty.call(message, "unreadMentionCount")) - writer.uint32(/* id 18, wireType 0 =*/144).uint32(message.unreadMentionCount); - if (message.markedAsUnread != null && Object.hasOwnProperty.call(message, "markedAsUnread")) - writer.uint32(/* id 19, wireType 0 =*/152).bool(message.markedAsUnread); - if (message.participant != null && message.participant.length) - for (var i = 0; i < message.participant.length; ++i) - $root.proto.GroupParticipant.encode(message.participant[i], writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); - if (message.tcToken != null && Object.hasOwnProperty.call(message, "tcToken")) - writer.uint32(/* id 21, wireType 2 =*/170).bytes(message.tcToken); - if (message.tcTokenTimestamp != null && Object.hasOwnProperty.call(message, "tcTokenTimestamp")) - writer.uint32(/* id 22, wireType 0 =*/176).uint64(message.tcTokenTimestamp); - if (message.contactPrimaryIdentityKey != null && Object.hasOwnProperty.call(message, "contactPrimaryIdentityKey")) - writer.uint32(/* id 23, wireType 2 =*/186).bytes(message.contactPrimaryIdentityKey); - if (message.pinned != null && Object.hasOwnProperty.call(message, "pinned")) - writer.uint32(/* id 24, wireType 0 =*/192).uint32(message.pinned); - if (message.muteEndTime != null && Object.hasOwnProperty.call(message, "muteEndTime")) - writer.uint32(/* id 25, wireType 0 =*/200).uint64(message.muteEndTime); - if (message.wallpaper != null && Object.hasOwnProperty.call(message, "wallpaper")) - $root.proto.WallpaperSettings.encode(message.wallpaper, writer.uint32(/* id 26, wireType 2 =*/210).fork()).ldelim(); - if (message.mediaVisibility != null && Object.hasOwnProperty.call(message, "mediaVisibility")) - writer.uint32(/* id 27, wireType 0 =*/216).int32(message.mediaVisibility); - if (message.tcTokenSenderTimestamp != null && Object.hasOwnProperty.call(message, "tcTokenSenderTimestamp")) - writer.uint32(/* id 28, wireType 0 =*/224).uint64(message.tcTokenSenderTimestamp); - if (message.suspended != null && Object.hasOwnProperty.call(message, "suspended")) - writer.uint32(/* id 29, wireType 0 =*/232).bool(message.suspended); + if (message.degreesLatitude != null && Object.hasOwnProperty.call(message, "degreesLatitude")) + writer.uint32(/* id 1, wireType 1 =*/9).double(message.degreesLatitude); + if (message.degreesLongitude != null && Object.hasOwnProperty.call(message, "degreesLongitude")) + writer.uint32(/* id 2, wireType 1 =*/17).double(message.degreesLongitude); + if (message.accuracyInMeters != null && Object.hasOwnProperty.call(message, "accuracyInMeters")) + writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.accuracyInMeters); + if (message.speedInMps != null && Object.hasOwnProperty.call(message, "speedInMps")) + writer.uint32(/* id 4, wireType 5 =*/37).float(message.speedInMps); + if (message.degreesClockwiseFromMagneticNorth != null && Object.hasOwnProperty.call(message, "degreesClockwiseFromMagneticNorth")) + writer.uint32(/* id 5, wireType 0 =*/40).uint32(message.degreesClockwiseFromMagneticNorth); + if (message.caption != null && Object.hasOwnProperty.call(message, "caption")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.caption); + if (message.sequenceNumber != null && Object.hasOwnProperty.call(message, "sequenceNumber")) + writer.uint32(/* id 7, wireType 0 =*/56).int64(message.sequenceNumber); + if (message.timeOffset != null && Object.hasOwnProperty.call(message, "timeOffset")) + writer.uint32(/* id 8, wireType 0 =*/64).uint32(message.timeOffset); + if (message.jpegThumbnail != null && Object.hasOwnProperty.call(message, "jpegThumbnail")) + writer.uint32(/* id 16, wireType 2 =*/130).bytes(message.jpegThumbnail); + if (message.contextInfo != null && Object.hasOwnProperty.call(message, "contextInfo")) + $root.proto.ContextInfo.encode(message.contextInfo, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); return writer; }; /** - * Encodes the specified Conversation message, length delimited. Does not implicitly {@link proto.Conversation.verify|verify} messages. + * Encodes the specified LiveLocationMessage message, length delimited. Does not implicitly {@link proto.LiveLocationMessage.verify|verify} messages. * @function encodeDelimited - * @memberof proto.Conversation + * @memberof proto.LiveLocationMessage * @static - * @param {proto.IConversation} message Conversation message or plain object to encode + * @param {proto.ILiveLocationMessage} message LiveLocationMessage message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Conversation.encodeDelimited = function encodeDelimited(message, writer) { + LiveLocationMessage.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Conversation message from the specified reader or buffer. + * Decodes a LiveLocationMessage message from the specified reader or buffer. * @function decode - * @memberof proto.Conversation + * @memberof proto.LiveLocationMessage * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {proto.Conversation} Conversation + * @returns {proto.LiveLocationMessage} LiveLocationMessage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Conversation.decode = function decode(reader, length) { + LiveLocationMessage.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.Conversation(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.LiveLocationMessage(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.id = reader.string(); + message.degreesLatitude = reader.double(); break; case 2: - if (!(message.messages && message.messages.length)) - message.messages = []; - message.messages.push($root.proto.HistorySyncMsg.decode(reader, reader.uint32())); + message.degreesLongitude = reader.double(); break; case 3: - message.newJid = reader.string(); + message.accuracyInMeters = reader.uint32(); break; case 4: - message.oldJid = reader.string(); + message.speedInMps = reader.float(); break; case 5: - message.lastMsgTimestamp = reader.uint64(); + message.degreesClockwiseFromMagneticNorth = reader.uint32(); break; case 6: - message.unreadCount = reader.uint32(); + message.caption = reader.string(); break; case 7: - message.readOnly = reader.bool(); + message.sequenceNumber = reader.int64(); break; case 8: - message.endOfHistoryTransfer = reader.bool(); - break; - case 9: - message.ephemeralExpiration = reader.uint32(); - break; - case 10: - message.ephemeralSettingTimestamp = reader.int64(); - break; - case 11: - message.endOfHistoryTransferType = reader.int32(); - break; - case 12: - message.conversationTimestamp = reader.uint64(); - break; - case 13: - message.name = reader.string(); - break; - case 14: - message.pHash = reader.string(); - break; - case 15: - message.notSpam = reader.bool(); + message.timeOffset = reader.uint32(); break; case 16: - message.archived = reader.bool(); + message.jpegThumbnail = reader.bytes(); break; case 17: - message.disappearingMode = $root.proto.DisappearingMode.decode(reader, reader.uint32()); - break; - case 18: - message.unreadMentionCount = reader.uint32(); - break; - case 19: - message.markedAsUnread = reader.bool(); + message.contextInfo = $root.proto.ContextInfo.decode(reader, reader.uint32()); break; - case 20: - if (!(message.participant && message.participant.length)) - message.participant = []; - message.participant.push($root.proto.GroupParticipant.decode(reader, reader.uint32())); - break; - case 21: - message.tcToken = reader.bytes(); - break; - case 22: - message.tcTokenTimestamp = reader.uint64(); - break; - case 23: - message.contactPrimaryIdentityKey = reader.bytes(); - break; - case 24: - message.pinned = reader.uint32(); - break; - case 25: - message.muteEndTime = reader.uint64(); - break; - case 26: - message.wallpaper = $root.proto.WallpaperSettings.decode(reader, reader.uint32()); - break; - case 27: - message.mediaVisibility = reader.int32(); - break; - case 28: - message.tcTokenSenderTimestamp = reader.uint64(); - break; - case 29: - message.suspended = reader.bool(); - break; - default: - reader.skipType(tag & 7); + default: + reader.skipType(tag & 7); break; } } - if (!message.hasOwnProperty("id")) - throw $util.ProtocolError("missing required 'id'", { instance: message }); return message; }; /** - * Decodes a Conversation message from the specified reader or buffer, length delimited. + * Decodes a LiveLocationMessage message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof proto.Conversation + * @memberof proto.LiveLocationMessage * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.Conversation} Conversation + * @returns {proto.LiveLocationMessage} LiveLocationMessage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Conversation.decodeDelimited = function decodeDelimited(reader) { + LiveLocationMessage.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Conversation message. + * Verifies a LiveLocationMessage message. * @function verify - * @memberof proto.Conversation + * @memberof proto.LiveLocationMessage * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Conversation.verify = function verify(message) { + LiveLocationMessage.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (!$util.isString(message.id)) - return "id: string expected"; - if (message.messages != null && message.hasOwnProperty("messages")) { - if (!Array.isArray(message.messages)) - return "messages: array expected"; - for (var i = 0; i < message.messages.length; ++i) { - var error = $root.proto.HistorySyncMsg.verify(message.messages[i]); - if (error) - return "messages." + error; - } - } - if (message.newJid != null && message.hasOwnProperty("newJid")) - if (!$util.isString(message.newJid)) - return "newJid: string expected"; - if (message.oldJid != null && message.hasOwnProperty("oldJid")) - if (!$util.isString(message.oldJid)) - return "oldJid: string expected"; - if (message.lastMsgTimestamp != null && message.hasOwnProperty("lastMsgTimestamp")) - if (!$util.isInteger(message.lastMsgTimestamp) && !(message.lastMsgTimestamp && $util.isInteger(message.lastMsgTimestamp.low) && $util.isInteger(message.lastMsgTimestamp.high))) - return "lastMsgTimestamp: integer|Long expected"; - if (message.unreadCount != null && message.hasOwnProperty("unreadCount")) - if (!$util.isInteger(message.unreadCount)) - return "unreadCount: integer expected"; - if (message.readOnly != null && message.hasOwnProperty("readOnly")) - if (typeof message.readOnly !== "boolean") - return "readOnly: boolean expected"; - if (message.endOfHistoryTransfer != null && message.hasOwnProperty("endOfHistoryTransfer")) - if (typeof message.endOfHistoryTransfer !== "boolean") - return "endOfHistoryTransfer: boolean expected"; - if (message.ephemeralExpiration != null && message.hasOwnProperty("ephemeralExpiration")) - if (!$util.isInteger(message.ephemeralExpiration)) - return "ephemeralExpiration: integer expected"; - if (message.ephemeralSettingTimestamp != null && message.hasOwnProperty("ephemeralSettingTimestamp")) - if (!$util.isInteger(message.ephemeralSettingTimestamp) && !(message.ephemeralSettingTimestamp && $util.isInteger(message.ephemeralSettingTimestamp.low) && $util.isInteger(message.ephemeralSettingTimestamp.high))) - return "ephemeralSettingTimestamp: integer|Long expected"; - if (message.endOfHistoryTransferType != null && message.hasOwnProperty("endOfHistoryTransferType")) - switch (message.endOfHistoryTransferType) { - default: - return "endOfHistoryTransferType: enum value expected"; - case 0: - case 1: - break; - } - if (message.conversationTimestamp != null && message.hasOwnProperty("conversationTimestamp")) - if (!$util.isInteger(message.conversationTimestamp) && !(message.conversationTimestamp && $util.isInteger(message.conversationTimestamp.low) && $util.isInteger(message.conversationTimestamp.high))) - return "conversationTimestamp: integer|Long expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.pHash != null && message.hasOwnProperty("pHash")) - if (!$util.isString(message.pHash)) - return "pHash: string expected"; - if (message.notSpam != null && message.hasOwnProperty("notSpam")) - if (typeof message.notSpam !== "boolean") - return "notSpam: boolean expected"; - if (message.archived != null && message.hasOwnProperty("archived")) - if (typeof message.archived !== "boolean") - return "archived: boolean expected"; - if (message.disappearingMode != null && message.hasOwnProperty("disappearingMode")) { - var error = $root.proto.DisappearingMode.verify(message.disappearingMode); - if (error) - return "disappearingMode." + error; - } - if (message.unreadMentionCount != null && message.hasOwnProperty("unreadMentionCount")) - if (!$util.isInteger(message.unreadMentionCount)) - return "unreadMentionCount: integer expected"; - if (message.markedAsUnread != null && message.hasOwnProperty("markedAsUnread")) - if (typeof message.markedAsUnread !== "boolean") - return "markedAsUnread: boolean expected"; - if (message.participant != null && message.hasOwnProperty("participant")) { - if (!Array.isArray(message.participant)) - return "participant: array expected"; - for (var i = 0; i < message.participant.length; ++i) { - var error = $root.proto.GroupParticipant.verify(message.participant[i]); - if (error) - return "participant." + error; - } - } - if (message.tcToken != null && message.hasOwnProperty("tcToken")) - if (!(message.tcToken && typeof message.tcToken.length === "number" || $util.isString(message.tcToken))) - return "tcToken: buffer expected"; - if (message.tcTokenTimestamp != null && message.hasOwnProperty("tcTokenTimestamp")) - if (!$util.isInteger(message.tcTokenTimestamp) && !(message.tcTokenTimestamp && $util.isInteger(message.tcTokenTimestamp.low) && $util.isInteger(message.tcTokenTimestamp.high))) - return "tcTokenTimestamp: integer|Long expected"; - if (message.contactPrimaryIdentityKey != null && message.hasOwnProperty("contactPrimaryIdentityKey")) - if (!(message.contactPrimaryIdentityKey && typeof message.contactPrimaryIdentityKey.length === "number" || $util.isString(message.contactPrimaryIdentityKey))) - return "contactPrimaryIdentityKey: buffer expected"; - if (message.pinned != null && message.hasOwnProperty("pinned")) - if (!$util.isInteger(message.pinned)) - return "pinned: integer expected"; - if (message.muteEndTime != null && message.hasOwnProperty("muteEndTime")) - if (!$util.isInteger(message.muteEndTime) && !(message.muteEndTime && $util.isInteger(message.muteEndTime.low) && $util.isInteger(message.muteEndTime.high))) - return "muteEndTime: integer|Long expected"; - if (message.wallpaper != null && message.hasOwnProperty("wallpaper")) { - var error = $root.proto.WallpaperSettings.verify(message.wallpaper); + if (message.degreesLatitude != null && message.hasOwnProperty("degreesLatitude")) + if (typeof message.degreesLatitude !== "number") + return "degreesLatitude: number expected"; + if (message.degreesLongitude != null && message.hasOwnProperty("degreesLongitude")) + if (typeof message.degreesLongitude !== "number") + return "degreesLongitude: number expected"; + if (message.accuracyInMeters != null && message.hasOwnProperty("accuracyInMeters")) + if (!$util.isInteger(message.accuracyInMeters)) + return "accuracyInMeters: integer expected"; + if (message.speedInMps != null && message.hasOwnProperty("speedInMps")) + if (typeof message.speedInMps !== "number") + return "speedInMps: number expected"; + if (message.degreesClockwiseFromMagneticNorth != null && message.hasOwnProperty("degreesClockwiseFromMagneticNorth")) + if (!$util.isInteger(message.degreesClockwiseFromMagneticNorth)) + return "degreesClockwiseFromMagneticNorth: integer expected"; + if (message.caption != null && message.hasOwnProperty("caption")) + if (!$util.isString(message.caption)) + return "caption: string expected"; + if (message.sequenceNumber != null && message.hasOwnProperty("sequenceNumber")) + if (!$util.isInteger(message.sequenceNumber) && !(message.sequenceNumber && $util.isInteger(message.sequenceNumber.low) && $util.isInteger(message.sequenceNumber.high))) + return "sequenceNumber: integer|Long expected"; + if (message.timeOffset != null && message.hasOwnProperty("timeOffset")) + if (!$util.isInteger(message.timeOffset)) + return "timeOffset: integer expected"; + if (message.jpegThumbnail != null && message.hasOwnProperty("jpegThumbnail")) + if (!(message.jpegThumbnail && typeof message.jpegThumbnail.length === "number" || $util.isString(message.jpegThumbnail))) + return "jpegThumbnail: buffer expected"; + if (message.contextInfo != null && message.hasOwnProperty("contextInfo")) { + var error = $root.proto.ContextInfo.verify(message.contextInfo); if (error) - return "wallpaper." + error; + return "contextInfo." + error; } - if (message.mediaVisibility != null && message.hasOwnProperty("mediaVisibility")) - switch (message.mediaVisibility) { - default: - return "mediaVisibility: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.tcTokenSenderTimestamp != null && message.hasOwnProperty("tcTokenSenderTimestamp")) - if (!$util.isInteger(message.tcTokenSenderTimestamp) && !(message.tcTokenSenderTimestamp && $util.isInteger(message.tcTokenSenderTimestamp.low) && $util.isInteger(message.tcTokenSenderTimestamp.high))) - return "tcTokenSenderTimestamp: integer|Long expected"; - if (message.suspended != null && message.hasOwnProperty("suspended")) - if (typeof message.suspended !== "boolean") - return "suspended: boolean expected"; return null; }; /** - * Creates a Conversation message from a plain object. Also converts values to their respective internal types. + * Creates a LiveLocationMessage message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof proto.Conversation + * @memberof proto.LiveLocationMessage * @static * @param {Object.} object Plain object - * @returns {proto.Conversation} Conversation + * @returns {proto.LiveLocationMessage} LiveLocationMessage */ - Conversation.fromObject = function fromObject(object) { - if (object instanceof $root.proto.Conversation) + LiveLocationMessage.fromObject = function fromObject(object) { + if (object instanceof $root.proto.LiveLocationMessage) return object; - var message = new $root.proto.Conversation(); - if (object.id != null) - message.id = String(object.id); - if (object.messages) { - if (!Array.isArray(object.messages)) - throw TypeError(".proto.Conversation.messages: array expected"); - message.messages = []; - for (var i = 0; i < object.messages.length; ++i) { - if (typeof object.messages[i] !== "object") - throw TypeError(".proto.Conversation.messages: object expected"); - message.messages[i] = $root.proto.HistorySyncMsg.fromObject(object.messages[i]); - } - } - if (object.newJid != null) - message.newJid = String(object.newJid); - if (object.oldJid != null) - message.oldJid = String(object.oldJid); - if (object.lastMsgTimestamp != null) - if ($util.Long) - (message.lastMsgTimestamp = $util.Long.fromValue(object.lastMsgTimestamp)).unsigned = true; - else if (typeof object.lastMsgTimestamp === "string") - message.lastMsgTimestamp = parseInt(object.lastMsgTimestamp, 10); - else if (typeof object.lastMsgTimestamp === "number") - message.lastMsgTimestamp = object.lastMsgTimestamp; - else if (typeof object.lastMsgTimestamp === "object") - message.lastMsgTimestamp = new $util.LongBits(object.lastMsgTimestamp.low >>> 0, object.lastMsgTimestamp.high >>> 0).toNumber(true); - if (object.unreadCount != null) - message.unreadCount = object.unreadCount >>> 0; - if (object.readOnly != null) - message.readOnly = Boolean(object.readOnly); - if (object.endOfHistoryTransfer != null) - message.endOfHistoryTransfer = Boolean(object.endOfHistoryTransfer); - if (object.ephemeralExpiration != null) - message.ephemeralExpiration = object.ephemeralExpiration >>> 0; - if (object.ephemeralSettingTimestamp != null) - if ($util.Long) - (message.ephemeralSettingTimestamp = $util.Long.fromValue(object.ephemeralSettingTimestamp)).unsigned = false; - else if (typeof object.ephemeralSettingTimestamp === "string") - message.ephemeralSettingTimestamp = parseInt(object.ephemeralSettingTimestamp, 10); - else if (typeof object.ephemeralSettingTimestamp === "number") - message.ephemeralSettingTimestamp = object.ephemeralSettingTimestamp; - else if (typeof object.ephemeralSettingTimestamp === "object") - message.ephemeralSettingTimestamp = new $util.LongBits(object.ephemeralSettingTimestamp.low >>> 0, object.ephemeralSettingTimestamp.high >>> 0).toNumber(); - switch (object.endOfHistoryTransferType) { - case "COMPLETE_BUT_MORE_MESSAGES_REMAIN_ON_PRIMARY": - case 0: - message.endOfHistoryTransferType = 0; - break; - case "COMPLETE_AND_NO_MORE_MESSAGE_REMAIN_ON_PRIMARY": - case 1: - message.endOfHistoryTransferType = 1; - break; - } - if (object.conversationTimestamp != null) - if ($util.Long) - (message.conversationTimestamp = $util.Long.fromValue(object.conversationTimestamp)).unsigned = true; - else if (typeof object.conversationTimestamp === "string") - message.conversationTimestamp = parseInt(object.conversationTimestamp, 10); - else if (typeof object.conversationTimestamp === "number") - message.conversationTimestamp = object.conversationTimestamp; - else if (typeof object.conversationTimestamp === "object") - message.conversationTimestamp = new $util.LongBits(object.conversationTimestamp.low >>> 0, object.conversationTimestamp.high >>> 0).toNumber(true); - if (object.name != null) - message.name = String(object.name); - if (object.pHash != null) - message.pHash = String(object.pHash); - if (object.notSpam != null) - message.notSpam = Boolean(object.notSpam); - if (object.archived != null) - message.archived = Boolean(object.archived); - if (object.disappearingMode != null) { - if (typeof object.disappearingMode !== "object") - throw TypeError(".proto.Conversation.disappearingMode: object expected"); - message.disappearingMode = $root.proto.DisappearingMode.fromObject(object.disappearingMode); - } - if (object.unreadMentionCount != null) - message.unreadMentionCount = object.unreadMentionCount >>> 0; - if (object.markedAsUnread != null) - message.markedAsUnread = Boolean(object.markedAsUnread); - if (object.participant) { - if (!Array.isArray(object.participant)) - throw TypeError(".proto.Conversation.participant: array expected"); - message.participant = []; - for (var i = 0; i < object.participant.length; ++i) { - if (typeof object.participant[i] !== "object") - throw TypeError(".proto.Conversation.participant: object expected"); - message.participant[i] = $root.proto.GroupParticipant.fromObject(object.participant[i]); - } - } - if (object.tcToken != null) - if (typeof object.tcToken === "string") - $util.base64.decode(object.tcToken, message.tcToken = $util.newBuffer($util.base64.length(object.tcToken)), 0); - else if (object.tcToken.length) - message.tcToken = object.tcToken; - if (object.tcTokenTimestamp != null) - if ($util.Long) - (message.tcTokenTimestamp = $util.Long.fromValue(object.tcTokenTimestamp)).unsigned = true; - else if (typeof object.tcTokenTimestamp === "string") - message.tcTokenTimestamp = parseInt(object.tcTokenTimestamp, 10); - else if (typeof object.tcTokenTimestamp === "number") - message.tcTokenTimestamp = object.tcTokenTimestamp; - else if (typeof object.tcTokenTimestamp === "object") - message.tcTokenTimestamp = new $util.LongBits(object.tcTokenTimestamp.low >>> 0, object.tcTokenTimestamp.high >>> 0).toNumber(true); - if (object.contactPrimaryIdentityKey != null) - if (typeof object.contactPrimaryIdentityKey === "string") - $util.base64.decode(object.contactPrimaryIdentityKey, message.contactPrimaryIdentityKey = $util.newBuffer($util.base64.length(object.contactPrimaryIdentityKey)), 0); - else if (object.contactPrimaryIdentityKey.length) - message.contactPrimaryIdentityKey = object.contactPrimaryIdentityKey; - if (object.pinned != null) - message.pinned = object.pinned >>> 0; - if (object.muteEndTime != null) + var message = new $root.proto.LiveLocationMessage(); + if (object.degreesLatitude != null) + message.degreesLatitude = Number(object.degreesLatitude); + if (object.degreesLongitude != null) + message.degreesLongitude = Number(object.degreesLongitude); + if (object.accuracyInMeters != null) + message.accuracyInMeters = object.accuracyInMeters >>> 0; + if (object.speedInMps != null) + message.speedInMps = Number(object.speedInMps); + if (object.degreesClockwiseFromMagneticNorth != null) + message.degreesClockwiseFromMagneticNorth = object.degreesClockwiseFromMagneticNorth >>> 0; + if (object.caption != null) + message.caption = String(object.caption); + if (object.sequenceNumber != null) if ($util.Long) - (message.muteEndTime = $util.Long.fromValue(object.muteEndTime)).unsigned = true; - else if (typeof object.muteEndTime === "string") - message.muteEndTime = parseInt(object.muteEndTime, 10); - else if (typeof object.muteEndTime === "number") - message.muteEndTime = object.muteEndTime; - else if (typeof object.muteEndTime === "object") - message.muteEndTime = new $util.LongBits(object.muteEndTime.low >>> 0, object.muteEndTime.high >>> 0).toNumber(true); - if (object.wallpaper != null) { - if (typeof object.wallpaper !== "object") - throw TypeError(".proto.Conversation.wallpaper: object expected"); - message.wallpaper = $root.proto.WallpaperSettings.fromObject(object.wallpaper); - } - switch (object.mediaVisibility) { - case "DEFAULT": - case 0: - message.mediaVisibility = 0; - break; - case "OFF": - case 1: - message.mediaVisibility = 1; - break; - case "ON": - case 2: - message.mediaVisibility = 2; - break; + (message.sequenceNumber = $util.Long.fromValue(object.sequenceNumber)).unsigned = false; + else if (typeof object.sequenceNumber === "string") + message.sequenceNumber = parseInt(object.sequenceNumber, 10); + else if (typeof object.sequenceNumber === "number") + message.sequenceNumber = object.sequenceNumber; + else if (typeof object.sequenceNumber === "object") + message.sequenceNumber = new $util.LongBits(object.sequenceNumber.low >>> 0, object.sequenceNumber.high >>> 0).toNumber(); + if (object.timeOffset != null) + message.timeOffset = object.timeOffset >>> 0; + if (object.jpegThumbnail != null) + if (typeof object.jpegThumbnail === "string") + $util.base64.decode(object.jpegThumbnail, message.jpegThumbnail = $util.newBuffer($util.base64.length(object.jpegThumbnail)), 0); + else if (object.jpegThumbnail.length) + message.jpegThumbnail = object.jpegThumbnail; + if (object.contextInfo != null) { + if (typeof object.contextInfo !== "object") + throw TypeError(".proto.LiveLocationMessage.contextInfo: object expected"); + message.contextInfo = $root.proto.ContextInfo.fromObject(object.contextInfo); } - if (object.tcTokenSenderTimestamp != null) - if ($util.Long) - (message.tcTokenSenderTimestamp = $util.Long.fromValue(object.tcTokenSenderTimestamp)).unsigned = true; - else if (typeof object.tcTokenSenderTimestamp === "string") - message.tcTokenSenderTimestamp = parseInt(object.tcTokenSenderTimestamp, 10); - else if (typeof object.tcTokenSenderTimestamp === "number") - message.tcTokenSenderTimestamp = object.tcTokenSenderTimestamp; - else if (typeof object.tcTokenSenderTimestamp === "object") - message.tcTokenSenderTimestamp = new $util.LongBits(object.tcTokenSenderTimestamp.low >>> 0, object.tcTokenSenderTimestamp.high >>> 0).toNumber(true); - if (object.suspended != null) - message.suspended = Boolean(object.suspended); return message; }; /** - * Creates a plain object from a Conversation message. Also converts values to other types if specified. + * Creates a plain object from a LiveLocationMessage message. Also converts values to other types if specified. * @function toObject - * @memberof proto.Conversation + * @memberof proto.LiveLocationMessage * @static - * @param {proto.Conversation} message Conversation + * @param {proto.LiveLocationMessage} message LiveLocationMessage * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Conversation.toObject = function toObject(message, options) { + LiveLocationMessage.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) { - object.messages = []; - object.participant = []; - } if (options.defaults) { - object.id = ""; - object.newJid = ""; - object.oldJid = ""; - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.lastMsgTimestamp = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.lastMsgTimestamp = options.longs === String ? "0" : 0; - object.unreadCount = 0; - object.readOnly = false; - object.endOfHistoryTransfer = false; - object.ephemeralExpiration = 0; + object.degreesLatitude = 0; + object.degreesLongitude = 0; + object.accuracyInMeters = 0; + object.speedInMps = 0; + object.degreesClockwiseFromMagneticNorth = 0; + object.caption = ""; if ($util.Long) { var long = new $util.Long(0, 0, false); - object.ephemeralSettingTimestamp = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.ephemeralSettingTimestamp = options.longs === String ? "0" : 0; - object.endOfHistoryTransferType = options.enums === String ? "COMPLETE_BUT_MORE_MESSAGES_REMAIN_ON_PRIMARY" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.conversationTimestamp = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.conversationTimestamp = options.longs === String ? "0" : 0; - object.name = ""; - object.pHash = ""; - object.notSpam = false; - object.archived = false; - object.disappearingMode = null; - object.unreadMentionCount = 0; - object.markedAsUnread = false; - if (options.bytes === String) - object.tcToken = ""; - else { - object.tcToken = []; - if (options.bytes !== Array) - object.tcToken = $util.newBuffer(object.tcToken); - } - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.tcTokenTimestamp = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + object.sequenceNumber = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; } else - object.tcTokenTimestamp = options.longs === String ? "0" : 0; + object.sequenceNumber = options.longs === String ? "0" : 0; + object.timeOffset = 0; if (options.bytes === String) - object.contactPrimaryIdentityKey = ""; + object.jpegThumbnail = ""; else { - object.contactPrimaryIdentityKey = []; + object.jpegThumbnail = []; if (options.bytes !== Array) - object.contactPrimaryIdentityKey = $util.newBuffer(object.contactPrimaryIdentityKey); + object.jpegThumbnail = $util.newBuffer(object.jpegThumbnail); } - object.pinned = 0; - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.muteEndTime = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.muteEndTime = options.longs === String ? "0" : 0; - object.wallpaper = null; - object.mediaVisibility = options.enums === String ? "DEFAULT" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.tcTokenSenderTimestamp = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.tcTokenSenderTimestamp = options.longs === String ? "0" : 0; - object.suspended = false; - } - if (message.id != null && message.hasOwnProperty("id")) - object.id = message.id; - if (message.messages && message.messages.length) { - object.messages = []; - for (var j = 0; j < message.messages.length; ++j) - object.messages[j] = $root.proto.HistorySyncMsg.toObject(message.messages[j], options); + object.contextInfo = null; } - if (message.newJid != null && message.hasOwnProperty("newJid")) - object.newJid = message.newJid; - if (message.oldJid != null && message.hasOwnProperty("oldJid")) - object.oldJid = message.oldJid; - if (message.lastMsgTimestamp != null && message.hasOwnProperty("lastMsgTimestamp")) - if (typeof message.lastMsgTimestamp === "number") - object.lastMsgTimestamp = options.longs === String ? String(message.lastMsgTimestamp) : message.lastMsgTimestamp; - else - object.lastMsgTimestamp = options.longs === String ? $util.Long.prototype.toString.call(message.lastMsgTimestamp) : options.longs === Number ? new $util.LongBits(message.lastMsgTimestamp.low >>> 0, message.lastMsgTimestamp.high >>> 0).toNumber(true) : message.lastMsgTimestamp; - if (message.unreadCount != null && message.hasOwnProperty("unreadCount")) - object.unreadCount = message.unreadCount; - if (message.readOnly != null && message.hasOwnProperty("readOnly")) - object.readOnly = message.readOnly; - if (message.endOfHistoryTransfer != null && message.hasOwnProperty("endOfHistoryTransfer")) - object.endOfHistoryTransfer = message.endOfHistoryTransfer; - if (message.ephemeralExpiration != null && message.hasOwnProperty("ephemeralExpiration")) - object.ephemeralExpiration = message.ephemeralExpiration; - if (message.ephemeralSettingTimestamp != null && message.hasOwnProperty("ephemeralSettingTimestamp")) - if (typeof message.ephemeralSettingTimestamp === "number") - object.ephemeralSettingTimestamp = options.longs === String ? String(message.ephemeralSettingTimestamp) : message.ephemeralSettingTimestamp; - else - object.ephemeralSettingTimestamp = options.longs === String ? $util.Long.prototype.toString.call(message.ephemeralSettingTimestamp) : options.longs === Number ? new $util.LongBits(message.ephemeralSettingTimestamp.low >>> 0, message.ephemeralSettingTimestamp.high >>> 0).toNumber() : message.ephemeralSettingTimestamp; - if (message.endOfHistoryTransferType != null && message.hasOwnProperty("endOfHistoryTransferType")) - object.endOfHistoryTransferType = options.enums === String ? $root.proto.Conversation.ConversationEndOfHistoryTransferType[message.endOfHistoryTransferType] : message.endOfHistoryTransferType; - if (message.conversationTimestamp != null && message.hasOwnProperty("conversationTimestamp")) - if (typeof message.conversationTimestamp === "number") - object.conversationTimestamp = options.longs === String ? String(message.conversationTimestamp) : message.conversationTimestamp; + if (message.degreesLatitude != null && message.hasOwnProperty("degreesLatitude")) + object.degreesLatitude = options.json && !isFinite(message.degreesLatitude) ? String(message.degreesLatitude) : message.degreesLatitude; + if (message.degreesLongitude != null && message.hasOwnProperty("degreesLongitude")) + object.degreesLongitude = options.json && !isFinite(message.degreesLongitude) ? String(message.degreesLongitude) : message.degreesLongitude; + if (message.accuracyInMeters != null && message.hasOwnProperty("accuracyInMeters")) + object.accuracyInMeters = message.accuracyInMeters; + if (message.speedInMps != null && message.hasOwnProperty("speedInMps")) + object.speedInMps = options.json && !isFinite(message.speedInMps) ? String(message.speedInMps) : message.speedInMps; + if (message.degreesClockwiseFromMagneticNorth != null && message.hasOwnProperty("degreesClockwiseFromMagneticNorth")) + object.degreesClockwiseFromMagneticNorth = message.degreesClockwiseFromMagneticNorth; + if (message.caption != null && message.hasOwnProperty("caption")) + object.caption = message.caption; + if (message.sequenceNumber != null && message.hasOwnProperty("sequenceNumber")) + if (typeof message.sequenceNumber === "number") + object.sequenceNumber = options.longs === String ? String(message.sequenceNumber) : message.sequenceNumber; else - object.conversationTimestamp = options.longs === String ? $util.Long.prototype.toString.call(message.conversationTimestamp) : options.longs === Number ? new $util.LongBits(message.conversationTimestamp.low >>> 0, message.conversationTimestamp.high >>> 0).toNumber(true) : message.conversationTimestamp; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.pHash != null && message.hasOwnProperty("pHash")) - object.pHash = message.pHash; - if (message.notSpam != null && message.hasOwnProperty("notSpam")) - object.notSpam = message.notSpam; - if (message.archived != null && message.hasOwnProperty("archived")) - object.archived = message.archived; - if (message.disappearingMode != null && message.hasOwnProperty("disappearingMode")) - object.disappearingMode = $root.proto.DisappearingMode.toObject(message.disappearingMode, options); - if (message.unreadMentionCount != null && message.hasOwnProperty("unreadMentionCount")) - object.unreadMentionCount = message.unreadMentionCount; - if (message.markedAsUnread != null && message.hasOwnProperty("markedAsUnread")) - object.markedAsUnread = message.markedAsUnread; - if (message.participant && message.participant.length) { - object.participant = []; - for (var j = 0; j < message.participant.length; ++j) - object.participant[j] = $root.proto.GroupParticipant.toObject(message.participant[j], options); - } - if (message.tcToken != null && message.hasOwnProperty("tcToken")) - object.tcToken = options.bytes === String ? $util.base64.encode(message.tcToken, 0, message.tcToken.length) : options.bytes === Array ? Array.prototype.slice.call(message.tcToken) : message.tcToken; - if (message.tcTokenTimestamp != null && message.hasOwnProperty("tcTokenTimestamp")) - if (typeof message.tcTokenTimestamp === "number") - object.tcTokenTimestamp = options.longs === String ? String(message.tcTokenTimestamp) : message.tcTokenTimestamp; - else - object.tcTokenTimestamp = options.longs === String ? $util.Long.prototype.toString.call(message.tcTokenTimestamp) : options.longs === Number ? new $util.LongBits(message.tcTokenTimestamp.low >>> 0, message.tcTokenTimestamp.high >>> 0).toNumber(true) : message.tcTokenTimestamp; - if (message.contactPrimaryIdentityKey != null && message.hasOwnProperty("contactPrimaryIdentityKey")) - object.contactPrimaryIdentityKey = options.bytes === String ? $util.base64.encode(message.contactPrimaryIdentityKey, 0, message.contactPrimaryIdentityKey.length) : options.bytes === Array ? Array.prototype.slice.call(message.contactPrimaryIdentityKey) : message.contactPrimaryIdentityKey; - if (message.pinned != null && message.hasOwnProperty("pinned")) - object.pinned = message.pinned; - if (message.muteEndTime != null && message.hasOwnProperty("muteEndTime")) - if (typeof message.muteEndTime === "number") - object.muteEndTime = options.longs === String ? String(message.muteEndTime) : message.muteEndTime; - else - object.muteEndTime = options.longs === String ? $util.Long.prototype.toString.call(message.muteEndTime) : options.longs === Number ? new $util.LongBits(message.muteEndTime.low >>> 0, message.muteEndTime.high >>> 0).toNumber(true) : message.muteEndTime; - if (message.wallpaper != null && message.hasOwnProperty("wallpaper")) - object.wallpaper = $root.proto.WallpaperSettings.toObject(message.wallpaper, options); - if (message.mediaVisibility != null && message.hasOwnProperty("mediaVisibility")) - object.mediaVisibility = options.enums === String ? $root.proto.MediaVisibility[message.mediaVisibility] : message.mediaVisibility; - if (message.tcTokenSenderTimestamp != null && message.hasOwnProperty("tcTokenSenderTimestamp")) - if (typeof message.tcTokenSenderTimestamp === "number") - object.tcTokenSenderTimestamp = options.longs === String ? String(message.tcTokenSenderTimestamp) : message.tcTokenSenderTimestamp; - else - object.tcTokenSenderTimestamp = options.longs === String ? $util.Long.prototype.toString.call(message.tcTokenSenderTimestamp) : options.longs === Number ? new $util.LongBits(message.tcTokenSenderTimestamp.low >>> 0, message.tcTokenSenderTimestamp.high >>> 0).toNumber(true) : message.tcTokenSenderTimestamp; - if (message.suspended != null && message.hasOwnProperty("suspended")) - object.suspended = message.suspended; + object.sequenceNumber = options.longs === String ? $util.Long.prototype.toString.call(message.sequenceNumber) : options.longs === Number ? new $util.LongBits(message.sequenceNumber.low >>> 0, message.sequenceNumber.high >>> 0).toNumber() : message.sequenceNumber; + if (message.timeOffset != null && message.hasOwnProperty("timeOffset")) + object.timeOffset = message.timeOffset; + if (message.jpegThumbnail != null && message.hasOwnProperty("jpegThumbnail")) + object.jpegThumbnail = options.bytes === String ? $util.base64.encode(message.jpegThumbnail, 0, message.jpegThumbnail.length) : options.bytes === Array ? Array.prototype.slice.call(message.jpegThumbnail) : message.jpegThumbnail; + if (message.contextInfo != null && message.hasOwnProperty("contextInfo")) + object.contextInfo = $root.proto.ContextInfo.toObject(message.contextInfo, options); return object; }; /** - * Converts this Conversation to JSON. + * Converts this LiveLocationMessage to JSON. * @function toJSON - * @memberof proto.Conversation + * @memberof proto.LiveLocationMessage * @instance * @returns {Object.} JSON object */ - Conversation.prototype.toJSON = function toJSON() { + LiveLocationMessage.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - /** - * ConversationEndOfHistoryTransferType enum. - * @name proto.Conversation.ConversationEndOfHistoryTransferType - * @enum {number} - * @property {number} COMPLETE_BUT_MORE_MESSAGES_REMAIN_ON_PRIMARY=0 COMPLETE_BUT_MORE_MESSAGES_REMAIN_ON_PRIMARY value - * @property {number} COMPLETE_AND_NO_MORE_MESSAGE_REMAIN_ON_PRIMARY=1 COMPLETE_AND_NO_MORE_MESSAGE_REMAIN_ON_PRIMARY value - */ - Conversation.ConversationEndOfHistoryTransferType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "COMPLETE_BUT_MORE_MESSAGES_REMAIN_ON_PRIMARY"] = 0; - values[valuesById[1] = "COMPLETE_AND_NO_MORE_MESSAGE_REMAIN_ON_PRIMARY"] = 1; - return values; - })(); - - return Conversation; + return LiveLocationMessage; })(); - proto.HistorySync = (function() { + proto.Location = (function() { /** - * Properties of a HistorySync. + * Properties of a Location. * @memberof proto - * @interface IHistorySync - * @property {proto.HistorySync.HistorySyncHistorySyncType} syncType HistorySync syncType - * @property {Array.|null} [conversations] HistorySync conversations - * @property {Array.|null} [statusV3Messages] HistorySync statusV3Messages - * @property {number|null} [chunkOrder] HistorySync chunkOrder - * @property {number|null} [progress] HistorySync progress - * @property {Array.|null} [pushnames] HistorySync pushnames - * @property {proto.IGlobalSettings|null} [globalSettings] HistorySync globalSettings - * @property {Uint8Array|null} [threadIdUserSecret] HistorySync threadIdUserSecret - * @property {number|null} [threadDsTimeframeOffset] HistorySync threadDsTimeframeOffset + * @interface ILocation + * @property {number|null} [degreesLatitude] Location degreesLatitude + * @property {number|null} [degreesLongitude] Location degreesLongitude + * @property {string|null} [name] Location name */ /** - * Constructs a new HistorySync. + * Constructs a new Location. * @memberof proto - * @classdesc Represents a HistorySync. - * @implements IHistorySync + * @classdesc Represents a Location. + * @implements ILocation * @constructor - * @param {proto.IHistorySync=} [properties] Properties to set + * @param {proto.ILocation=} [properties] Properties to set */ - function HistorySync(properties) { - this.conversations = []; - this.statusV3Messages = []; - this.pushnames = []; + function Location(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -19869,496 +20642,240 @@ $root.proto = (function() { } /** - * HistorySync syncType. - * @member {proto.HistorySync.HistorySyncHistorySyncType} syncType - * @memberof proto.HistorySync - * @instance - */ - HistorySync.prototype.syncType = 0; - - /** - * HistorySync conversations. - * @member {Array.} conversations - * @memberof proto.HistorySync - * @instance - */ - HistorySync.prototype.conversations = $util.emptyArray; - - /** - * HistorySync statusV3Messages. - * @member {Array.} statusV3Messages - * @memberof proto.HistorySync - * @instance - */ - HistorySync.prototype.statusV3Messages = $util.emptyArray; - - /** - * HistorySync chunkOrder. - * @member {number} chunkOrder - * @memberof proto.HistorySync - * @instance - */ - HistorySync.prototype.chunkOrder = 0; - - /** - * HistorySync progress. - * @member {number} progress - * @memberof proto.HistorySync - * @instance - */ - HistorySync.prototype.progress = 0; - - /** - * HistorySync pushnames. - * @member {Array.} pushnames - * @memberof proto.HistorySync - * @instance - */ - HistorySync.prototype.pushnames = $util.emptyArray; - - /** - * HistorySync globalSettings. - * @member {proto.IGlobalSettings|null|undefined} globalSettings - * @memberof proto.HistorySync + * Location degreesLatitude. + * @member {number} degreesLatitude + * @memberof proto.Location * @instance */ - HistorySync.prototype.globalSettings = null; + Location.prototype.degreesLatitude = 0; /** - * HistorySync threadIdUserSecret. - * @member {Uint8Array} threadIdUserSecret - * @memberof proto.HistorySync + * Location degreesLongitude. + * @member {number} degreesLongitude + * @memberof proto.Location * @instance */ - HistorySync.prototype.threadIdUserSecret = $util.newBuffer([]); + Location.prototype.degreesLongitude = 0; /** - * HistorySync threadDsTimeframeOffset. - * @member {number} threadDsTimeframeOffset - * @memberof proto.HistorySync + * Location name. + * @member {string} name + * @memberof proto.Location * @instance */ - HistorySync.prototype.threadDsTimeframeOffset = 0; + Location.prototype.name = ""; /** - * Creates a new HistorySync instance using the specified properties. + * Creates a new Location instance using the specified properties. * @function create - * @memberof proto.HistorySync + * @memberof proto.Location * @static - * @param {proto.IHistorySync=} [properties] Properties to set - * @returns {proto.HistorySync} HistorySync instance + * @param {proto.ILocation=} [properties] Properties to set + * @returns {proto.Location} Location instance */ - HistorySync.create = function create(properties) { - return new HistorySync(properties); + Location.create = function create(properties) { + return new Location(properties); }; /** - * Encodes the specified HistorySync message. Does not implicitly {@link proto.HistorySync.verify|verify} messages. + * Encodes the specified Location message. Does not implicitly {@link proto.Location.verify|verify} messages. * @function encode - * @memberof proto.HistorySync + * @memberof proto.Location * @static - * @param {proto.IHistorySync} message HistorySync message or plain object to encode + * @param {proto.ILocation} message Location message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - HistorySync.encode = function encode(message, writer) { + Location.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.syncType); - if (message.conversations != null && message.conversations.length) - for (var i = 0; i < message.conversations.length; ++i) - $root.proto.Conversation.encode(message.conversations[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.statusV3Messages != null && message.statusV3Messages.length) - for (var i = 0; i < message.statusV3Messages.length; ++i) - $root.proto.WebMessageInfo.encode(message.statusV3Messages[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.chunkOrder != null && Object.hasOwnProperty.call(message, "chunkOrder")) - writer.uint32(/* id 5, wireType 0 =*/40).uint32(message.chunkOrder); - if (message.progress != null && Object.hasOwnProperty.call(message, "progress")) - writer.uint32(/* id 6, wireType 0 =*/48).uint32(message.progress); - if (message.pushnames != null && message.pushnames.length) - for (var i = 0; i < message.pushnames.length; ++i) - $root.proto.Pushname.encode(message.pushnames[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.globalSettings != null && Object.hasOwnProperty.call(message, "globalSettings")) - $root.proto.GlobalSettings.encode(message.globalSettings, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.threadIdUserSecret != null && Object.hasOwnProperty.call(message, "threadIdUserSecret")) - writer.uint32(/* id 9, wireType 2 =*/74).bytes(message.threadIdUserSecret); - if (message.threadDsTimeframeOffset != null && Object.hasOwnProperty.call(message, "threadDsTimeframeOffset")) - writer.uint32(/* id 10, wireType 0 =*/80).uint32(message.threadDsTimeframeOffset); + if (message.degreesLatitude != null && Object.hasOwnProperty.call(message, "degreesLatitude")) + writer.uint32(/* id 1, wireType 1 =*/9).double(message.degreesLatitude); + if (message.degreesLongitude != null && Object.hasOwnProperty.call(message, "degreesLongitude")) + writer.uint32(/* id 2, wireType 1 =*/17).double(message.degreesLongitude); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.name); return writer; }; /** - * Encodes the specified HistorySync message, length delimited. Does not implicitly {@link proto.HistorySync.verify|verify} messages. + * Encodes the specified Location message, length delimited. Does not implicitly {@link proto.Location.verify|verify} messages. * @function encodeDelimited - * @memberof proto.HistorySync + * @memberof proto.Location * @static - * @param {proto.IHistorySync} message HistorySync message or plain object to encode + * @param {proto.ILocation} message Location message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - HistorySync.encodeDelimited = function encodeDelimited(message, writer) { + Location.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a HistorySync message from the specified reader or buffer. + * Decodes a Location message from the specified reader or buffer. * @function decode - * @memberof proto.HistorySync + * @memberof proto.Location * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {proto.HistorySync} HistorySync + * @returns {proto.Location} Location * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - HistorySync.decode = function decode(reader, length) { + Location.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.HistorySync(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.Location(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.syncType = reader.int32(); + message.degreesLatitude = reader.double(); break; case 2: - if (!(message.conversations && message.conversations.length)) - message.conversations = []; - message.conversations.push($root.proto.Conversation.decode(reader, reader.uint32())); + message.degreesLongitude = reader.double(); break; case 3: - if (!(message.statusV3Messages && message.statusV3Messages.length)) - message.statusV3Messages = []; - message.statusV3Messages.push($root.proto.WebMessageInfo.decode(reader, reader.uint32())); - break; - case 5: - message.chunkOrder = reader.uint32(); - break; - case 6: - message.progress = reader.uint32(); - break; - case 7: - if (!(message.pushnames && message.pushnames.length)) - message.pushnames = []; - message.pushnames.push($root.proto.Pushname.decode(reader, reader.uint32())); - break; - case 8: - message.globalSettings = $root.proto.GlobalSettings.decode(reader, reader.uint32()); - break; - case 9: - message.threadIdUserSecret = reader.bytes(); - break; - case 10: - message.threadDsTimeframeOffset = reader.uint32(); + message.name = reader.string(); break; default: reader.skipType(tag & 7); break; } } - if (!message.hasOwnProperty("syncType")) - throw $util.ProtocolError("missing required 'syncType'", { instance: message }); return message; }; /** - * Decodes a HistorySync message from the specified reader or buffer, length delimited. + * Decodes a Location message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof proto.HistorySync + * @memberof proto.Location * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.HistorySync} HistorySync + * @returns {proto.Location} Location * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - HistorySync.decodeDelimited = function decodeDelimited(reader) { + Location.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a HistorySync message. + * Verifies a Location message. * @function verify - * @memberof proto.HistorySync + * @memberof proto.Location * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - HistorySync.verify = function verify(message) { + Location.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - switch (message.syncType) { - default: - return "syncType: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - break; - } - if (message.conversations != null && message.hasOwnProperty("conversations")) { - if (!Array.isArray(message.conversations)) - return "conversations: array expected"; - for (var i = 0; i < message.conversations.length; ++i) { - var error = $root.proto.Conversation.verify(message.conversations[i]); - if (error) - return "conversations." + error; - } - } - if (message.statusV3Messages != null && message.hasOwnProperty("statusV3Messages")) { - if (!Array.isArray(message.statusV3Messages)) - return "statusV3Messages: array expected"; - for (var i = 0; i < message.statusV3Messages.length; ++i) { - var error = $root.proto.WebMessageInfo.verify(message.statusV3Messages[i]); - if (error) - return "statusV3Messages." + error; - } - } - if (message.chunkOrder != null && message.hasOwnProperty("chunkOrder")) - if (!$util.isInteger(message.chunkOrder)) - return "chunkOrder: integer expected"; - if (message.progress != null && message.hasOwnProperty("progress")) - if (!$util.isInteger(message.progress)) - return "progress: integer expected"; - if (message.pushnames != null && message.hasOwnProperty("pushnames")) { - if (!Array.isArray(message.pushnames)) - return "pushnames: array expected"; - for (var i = 0; i < message.pushnames.length; ++i) { - var error = $root.proto.Pushname.verify(message.pushnames[i]); - if (error) - return "pushnames." + error; - } - } - if (message.globalSettings != null && message.hasOwnProperty("globalSettings")) { - var error = $root.proto.GlobalSettings.verify(message.globalSettings); - if (error) - return "globalSettings." + error; - } - if (message.threadIdUserSecret != null && message.hasOwnProperty("threadIdUserSecret")) - if (!(message.threadIdUserSecret && typeof message.threadIdUserSecret.length === "number" || $util.isString(message.threadIdUserSecret))) - return "threadIdUserSecret: buffer expected"; - if (message.threadDsTimeframeOffset != null && message.hasOwnProperty("threadDsTimeframeOffset")) - if (!$util.isInteger(message.threadDsTimeframeOffset)) - return "threadDsTimeframeOffset: integer expected"; + if (message.degreesLatitude != null && message.hasOwnProperty("degreesLatitude")) + if (typeof message.degreesLatitude !== "number") + return "degreesLatitude: number expected"; + if (message.degreesLongitude != null && message.hasOwnProperty("degreesLongitude")) + if (typeof message.degreesLongitude !== "number") + return "degreesLongitude: number expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; return null; }; /** - * Creates a HistorySync message from a plain object. Also converts values to their respective internal types. + * Creates a Location message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof proto.HistorySync + * @memberof proto.Location * @static * @param {Object.} object Plain object - * @returns {proto.HistorySync} HistorySync + * @returns {proto.Location} Location */ - HistorySync.fromObject = function fromObject(object) { - if (object instanceof $root.proto.HistorySync) + Location.fromObject = function fromObject(object) { + if (object instanceof $root.proto.Location) return object; - var message = new $root.proto.HistorySync(); - switch (object.syncType) { - case "INITIAL_BOOTSTRAP": - case 0: - message.syncType = 0; - break; - case "INITIAL_STATUS_V3": - case 1: - message.syncType = 1; - break; - case "FULL": - case 2: - message.syncType = 2; - break; - case "RECENT": - case 3: - message.syncType = 3; - break; - case "PUSH_NAME": - case 4: - message.syncType = 4; - break; - } - if (object.conversations) { - if (!Array.isArray(object.conversations)) - throw TypeError(".proto.HistorySync.conversations: array expected"); - message.conversations = []; - for (var i = 0; i < object.conversations.length; ++i) { - if (typeof object.conversations[i] !== "object") - throw TypeError(".proto.HistorySync.conversations: object expected"); - message.conversations[i] = $root.proto.Conversation.fromObject(object.conversations[i]); - } - } - if (object.statusV3Messages) { - if (!Array.isArray(object.statusV3Messages)) - throw TypeError(".proto.HistorySync.statusV3Messages: array expected"); - message.statusV3Messages = []; - for (var i = 0; i < object.statusV3Messages.length; ++i) { - if (typeof object.statusV3Messages[i] !== "object") - throw TypeError(".proto.HistorySync.statusV3Messages: object expected"); - message.statusV3Messages[i] = $root.proto.WebMessageInfo.fromObject(object.statusV3Messages[i]); - } - } - if (object.chunkOrder != null) - message.chunkOrder = object.chunkOrder >>> 0; - if (object.progress != null) - message.progress = object.progress >>> 0; - if (object.pushnames) { - if (!Array.isArray(object.pushnames)) - throw TypeError(".proto.HistorySync.pushnames: array expected"); - message.pushnames = []; - for (var i = 0; i < object.pushnames.length; ++i) { - if (typeof object.pushnames[i] !== "object") - throw TypeError(".proto.HistorySync.pushnames: object expected"); - message.pushnames[i] = $root.proto.Pushname.fromObject(object.pushnames[i]); - } - } - if (object.globalSettings != null) { - if (typeof object.globalSettings !== "object") - throw TypeError(".proto.HistorySync.globalSettings: object expected"); - message.globalSettings = $root.proto.GlobalSettings.fromObject(object.globalSettings); - } - if (object.threadIdUserSecret != null) - if (typeof object.threadIdUserSecret === "string") - $util.base64.decode(object.threadIdUserSecret, message.threadIdUserSecret = $util.newBuffer($util.base64.length(object.threadIdUserSecret)), 0); - else if (object.threadIdUserSecret.length) - message.threadIdUserSecret = object.threadIdUserSecret; - if (object.threadDsTimeframeOffset != null) - message.threadDsTimeframeOffset = object.threadDsTimeframeOffset >>> 0; + var message = new $root.proto.Location(); + if (object.degreesLatitude != null) + message.degreesLatitude = Number(object.degreesLatitude); + if (object.degreesLongitude != null) + message.degreesLongitude = Number(object.degreesLongitude); + if (object.name != null) + message.name = String(object.name); return message; }; /** - * Creates a plain object from a HistorySync message. Also converts values to other types if specified. + * Creates a plain object from a Location message. Also converts values to other types if specified. * @function toObject - * @memberof proto.HistorySync + * @memberof proto.Location * @static - * @param {proto.HistorySync} message HistorySync + * @param {proto.Location} message Location * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - HistorySync.toObject = function toObject(message, options) { + Location.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) { - object.conversations = []; - object.statusV3Messages = []; - object.pushnames = []; - } if (options.defaults) { - object.syncType = options.enums === String ? "INITIAL_BOOTSTRAP" : 0; - object.chunkOrder = 0; - object.progress = 0; - object.globalSettings = null; - if (options.bytes === String) - object.threadIdUserSecret = ""; - else { - object.threadIdUserSecret = []; - if (options.bytes !== Array) - object.threadIdUserSecret = $util.newBuffer(object.threadIdUserSecret); - } - object.threadDsTimeframeOffset = 0; - } - if (message.syncType != null && message.hasOwnProperty("syncType")) - object.syncType = options.enums === String ? $root.proto.HistorySync.HistorySyncHistorySyncType[message.syncType] : message.syncType; - if (message.conversations && message.conversations.length) { - object.conversations = []; - for (var j = 0; j < message.conversations.length; ++j) - object.conversations[j] = $root.proto.Conversation.toObject(message.conversations[j], options); - } - if (message.statusV3Messages && message.statusV3Messages.length) { - object.statusV3Messages = []; - for (var j = 0; j < message.statusV3Messages.length; ++j) - object.statusV3Messages[j] = $root.proto.WebMessageInfo.toObject(message.statusV3Messages[j], options); - } - if (message.chunkOrder != null && message.hasOwnProperty("chunkOrder")) - object.chunkOrder = message.chunkOrder; - if (message.progress != null && message.hasOwnProperty("progress")) - object.progress = message.progress; - if (message.pushnames && message.pushnames.length) { - object.pushnames = []; - for (var j = 0; j < message.pushnames.length; ++j) - object.pushnames[j] = $root.proto.Pushname.toObject(message.pushnames[j], options); + object.degreesLatitude = 0; + object.degreesLongitude = 0; + object.name = ""; } - if (message.globalSettings != null && message.hasOwnProperty("globalSettings")) - object.globalSettings = $root.proto.GlobalSettings.toObject(message.globalSettings, options); - if (message.threadIdUserSecret != null && message.hasOwnProperty("threadIdUserSecret")) - object.threadIdUserSecret = options.bytes === String ? $util.base64.encode(message.threadIdUserSecret, 0, message.threadIdUserSecret.length) : options.bytes === Array ? Array.prototype.slice.call(message.threadIdUserSecret) : message.threadIdUserSecret; - if (message.threadDsTimeframeOffset != null && message.hasOwnProperty("threadDsTimeframeOffset")) - object.threadDsTimeframeOffset = message.threadDsTimeframeOffset; + if (message.degreesLatitude != null && message.hasOwnProperty("degreesLatitude")) + object.degreesLatitude = options.json && !isFinite(message.degreesLatitude) ? String(message.degreesLatitude) : message.degreesLatitude; + if (message.degreesLongitude != null && message.hasOwnProperty("degreesLongitude")) + object.degreesLongitude = options.json && !isFinite(message.degreesLongitude) ? String(message.degreesLongitude) : message.degreesLongitude; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; return object; }; /** - * Converts this HistorySync to JSON. + * Converts this Location to JSON. * @function toJSON - * @memberof proto.HistorySync + * @memberof proto.Location * @instance * @returns {Object.} JSON object */ - HistorySync.prototype.toJSON = function toJSON() { + Location.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + return Location; + })(); + + proto.LocationMessage = (function() { + /** - * HistorySyncHistorySyncType enum. - * @name proto.HistorySync.HistorySyncHistorySyncType - * @enum {number} - * @property {number} INITIAL_BOOTSTRAP=0 INITIAL_BOOTSTRAP value - * @property {number} INITIAL_STATUS_V3=1 INITIAL_STATUS_V3 value - * @property {number} FULL=2 FULL value - * @property {number} RECENT=3 RECENT value - * @property {number} PUSH_NAME=4 PUSH_NAME value - */ - HistorySync.HistorySyncHistorySyncType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "INITIAL_BOOTSTRAP"] = 0; - values[valuesById[1] = "INITIAL_STATUS_V3"] = 1; - values[valuesById[2] = "FULL"] = 2; - values[valuesById[3] = "RECENT"] = 3; - values[valuesById[4] = "PUSH_NAME"] = 4; - return values; - })(); - - return HistorySync; - })(); - - /** - * MediaVisibility enum. - * @name proto.MediaVisibility - * @enum {number} - * @property {number} DEFAULT=0 DEFAULT value - * @property {number} OFF=1 OFF value - * @property {number} ON=2 ON value - */ - proto.MediaVisibility = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "DEFAULT"] = 0; - values[valuesById[1] = "OFF"] = 1; - values[valuesById[2] = "ON"] = 2; - return values; - })(); - - proto.EphemeralSetting = (function() { - - /** - * Properties of an EphemeralSetting. + * Properties of a LocationMessage. * @memberof proto - * @interface IEphemeralSetting - * @property {number|null} [duration] EphemeralSetting duration - * @property {number|Long|null} [timestamp] EphemeralSetting timestamp + * @interface ILocationMessage + * @property {number|null} [degreesLatitude] LocationMessage degreesLatitude + * @property {number|null} [degreesLongitude] LocationMessage degreesLongitude + * @property {string|null} [name] LocationMessage name + * @property {string|null} [address] LocationMessage address + * @property {string|null} [url] LocationMessage url + * @property {boolean|null} [isLive] LocationMessage isLive + * @property {number|null} [accuracyInMeters] LocationMessage accuracyInMeters + * @property {number|null} [speedInMps] LocationMessage speedInMps + * @property {number|null} [degreesClockwiseFromMagneticNorth] LocationMessage degreesClockwiseFromMagneticNorth + * @property {string|null} [comment] LocationMessage comment + * @property {Uint8Array|null} [jpegThumbnail] LocationMessage jpegThumbnail + * @property {proto.IContextInfo|null} [contextInfo] LocationMessage contextInfo */ /** - * Constructs a new EphemeralSetting. + * Constructs a new LocationMessage. * @memberof proto - * @classdesc Represents an EphemeralSetting. - * @implements IEphemeralSetting + * @classdesc Represents a LocationMessage. + * @implements ILocationMessage * @constructor - * @param {proto.IEphemeralSetting=} [properties] Properties to set + * @param {proto.ILocationMessage=} [properties] Properties to set */ - function EphemeralSetting(properties) { + function LocationMessage(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -20366,88 +20883,218 @@ $root.proto = (function() { } /** - * EphemeralSetting duration. - * @member {number} duration - * @memberof proto.EphemeralSetting + * LocationMessage degreesLatitude. + * @member {number} degreesLatitude + * @memberof proto.LocationMessage * @instance */ - EphemeralSetting.prototype.duration = 0; + LocationMessage.prototype.degreesLatitude = 0; /** - * EphemeralSetting timestamp. - * @member {number|Long} timestamp - * @memberof proto.EphemeralSetting + * LocationMessage degreesLongitude. + * @member {number} degreesLongitude + * @memberof proto.LocationMessage * @instance */ - EphemeralSetting.prototype.timestamp = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + LocationMessage.prototype.degreesLongitude = 0; /** - * Creates a new EphemeralSetting instance using the specified properties. + * LocationMessage name. + * @member {string} name + * @memberof proto.LocationMessage + * @instance + */ + LocationMessage.prototype.name = ""; + + /** + * LocationMessage address. + * @member {string} address + * @memberof proto.LocationMessage + * @instance + */ + LocationMessage.prototype.address = ""; + + /** + * LocationMessage url. + * @member {string} url + * @memberof proto.LocationMessage + * @instance + */ + LocationMessage.prototype.url = ""; + + /** + * LocationMessage isLive. + * @member {boolean} isLive + * @memberof proto.LocationMessage + * @instance + */ + LocationMessage.prototype.isLive = false; + + /** + * LocationMessage accuracyInMeters. + * @member {number} accuracyInMeters + * @memberof proto.LocationMessage + * @instance + */ + LocationMessage.prototype.accuracyInMeters = 0; + + /** + * LocationMessage speedInMps. + * @member {number} speedInMps + * @memberof proto.LocationMessage + * @instance + */ + LocationMessage.prototype.speedInMps = 0; + + /** + * LocationMessage degreesClockwiseFromMagneticNorth. + * @member {number} degreesClockwiseFromMagneticNorth + * @memberof proto.LocationMessage + * @instance + */ + LocationMessage.prototype.degreesClockwiseFromMagneticNorth = 0; + + /** + * LocationMessage comment. + * @member {string} comment + * @memberof proto.LocationMessage + * @instance + */ + LocationMessage.prototype.comment = ""; + + /** + * LocationMessage jpegThumbnail. + * @member {Uint8Array} jpegThumbnail + * @memberof proto.LocationMessage + * @instance + */ + LocationMessage.prototype.jpegThumbnail = $util.newBuffer([]); + + /** + * LocationMessage contextInfo. + * @member {proto.IContextInfo|null|undefined} contextInfo + * @memberof proto.LocationMessage + * @instance + */ + LocationMessage.prototype.contextInfo = null; + + /** + * Creates a new LocationMessage instance using the specified properties. * @function create - * @memberof proto.EphemeralSetting + * @memberof proto.LocationMessage * @static - * @param {proto.IEphemeralSetting=} [properties] Properties to set - * @returns {proto.EphemeralSetting} EphemeralSetting instance + * @param {proto.ILocationMessage=} [properties] Properties to set + * @returns {proto.LocationMessage} LocationMessage instance */ - EphemeralSetting.create = function create(properties) { - return new EphemeralSetting(properties); + LocationMessage.create = function create(properties) { + return new LocationMessage(properties); }; /** - * Encodes the specified EphemeralSetting message. Does not implicitly {@link proto.EphemeralSetting.verify|verify} messages. + * Encodes the specified LocationMessage message. Does not implicitly {@link proto.LocationMessage.verify|verify} messages. * @function encode - * @memberof proto.EphemeralSetting + * @memberof proto.LocationMessage * @static - * @param {proto.IEphemeralSetting} message EphemeralSetting message or plain object to encode + * @param {proto.ILocationMessage} message LocationMessage message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - EphemeralSetting.encode = function encode(message, writer) { + LocationMessage.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.duration != null && Object.hasOwnProperty.call(message, "duration")) - writer.uint32(/* id 1, wireType 5 =*/13).sfixed32(message.duration); - if (message.timestamp != null && Object.hasOwnProperty.call(message, "timestamp")) - writer.uint32(/* id 2, wireType 1 =*/17).sfixed64(message.timestamp); + if (message.degreesLatitude != null && Object.hasOwnProperty.call(message, "degreesLatitude")) + writer.uint32(/* id 1, wireType 1 =*/9).double(message.degreesLatitude); + if (message.degreesLongitude != null && Object.hasOwnProperty.call(message, "degreesLongitude")) + writer.uint32(/* id 2, wireType 1 =*/17).double(message.degreesLongitude); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.name); + if (message.address != null && Object.hasOwnProperty.call(message, "address")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.address); + if (message.url != null && Object.hasOwnProperty.call(message, "url")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.url); + if (message.isLive != null && Object.hasOwnProperty.call(message, "isLive")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.isLive); + if (message.accuracyInMeters != null && Object.hasOwnProperty.call(message, "accuracyInMeters")) + writer.uint32(/* id 7, wireType 0 =*/56).uint32(message.accuracyInMeters); + if (message.speedInMps != null && Object.hasOwnProperty.call(message, "speedInMps")) + writer.uint32(/* id 8, wireType 5 =*/69).float(message.speedInMps); + if (message.degreesClockwiseFromMagneticNorth != null && Object.hasOwnProperty.call(message, "degreesClockwiseFromMagneticNorth")) + writer.uint32(/* id 9, wireType 0 =*/72).uint32(message.degreesClockwiseFromMagneticNorth); + if (message.comment != null && Object.hasOwnProperty.call(message, "comment")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.comment); + if (message.jpegThumbnail != null && Object.hasOwnProperty.call(message, "jpegThumbnail")) + writer.uint32(/* id 16, wireType 2 =*/130).bytes(message.jpegThumbnail); + if (message.contextInfo != null && Object.hasOwnProperty.call(message, "contextInfo")) + $root.proto.ContextInfo.encode(message.contextInfo, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); return writer; }; /** - * Encodes the specified EphemeralSetting message, length delimited. Does not implicitly {@link proto.EphemeralSetting.verify|verify} messages. + * Encodes the specified LocationMessage message, length delimited. Does not implicitly {@link proto.LocationMessage.verify|verify} messages. * @function encodeDelimited - * @memberof proto.EphemeralSetting + * @memberof proto.LocationMessage * @static - * @param {proto.IEphemeralSetting} message EphemeralSetting message or plain object to encode + * @param {proto.ILocationMessage} message LocationMessage message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - EphemeralSetting.encodeDelimited = function encodeDelimited(message, writer) { + LocationMessage.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an EphemeralSetting message from the specified reader or buffer. + * Decodes a LocationMessage message from the specified reader or buffer. * @function decode - * @memberof proto.EphemeralSetting + * @memberof proto.LocationMessage * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {proto.EphemeralSetting} EphemeralSetting + * @returns {proto.LocationMessage} LocationMessage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - EphemeralSetting.decode = function decode(reader, length) { + LocationMessage.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.EphemeralSetting(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.LocationMessage(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.duration = reader.sfixed32(); + message.degreesLatitude = reader.double(); break; case 2: - message.timestamp = reader.sfixed64(); + message.degreesLongitude = reader.double(); + break; + case 3: + message.name = reader.string(); + break; + case 4: + message.address = reader.string(); + break; + case 5: + message.url = reader.string(); + break; + case 6: + message.isLive = reader.bool(); + break; + case 7: + message.accuracyInMeters = reader.uint32(); + break; + case 8: + message.speedInMps = reader.float(); + break; + case 9: + message.degreesClockwiseFromMagneticNorth = reader.uint32(); + break; + case 11: + message.comment = reader.string(); + break; + case 16: + message.jpegThumbnail = reader.bytes(); + break; + case 17: + message.contextInfo = $root.proto.ContextInfo.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -20458,132 +21105,251 @@ $root.proto = (function() { }; /** - * Decodes an EphemeralSetting message from the specified reader or buffer, length delimited. + * Decodes a LocationMessage message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof proto.EphemeralSetting + * @memberof proto.LocationMessage * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.EphemeralSetting} EphemeralSetting + * @returns {proto.LocationMessage} LocationMessage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - EphemeralSetting.decodeDelimited = function decodeDelimited(reader) { + LocationMessage.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an EphemeralSetting message. + * Verifies a LocationMessage message. * @function verify - * @memberof proto.EphemeralSetting + * @memberof proto.LocationMessage * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - EphemeralSetting.verify = function verify(message) { + LocationMessage.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.duration != null && message.hasOwnProperty("duration")) - if (!$util.isInteger(message.duration)) - return "duration: integer expected"; - if (message.timestamp != null && message.hasOwnProperty("timestamp")) - if (!$util.isInteger(message.timestamp) && !(message.timestamp && $util.isInteger(message.timestamp.low) && $util.isInteger(message.timestamp.high))) - return "timestamp: integer|Long expected"; + if (message.degreesLatitude != null && message.hasOwnProperty("degreesLatitude")) + if (typeof message.degreesLatitude !== "number") + return "degreesLatitude: number expected"; + if (message.degreesLongitude != null && message.hasOwnProperty("degreesLongitude")) + if (typeof message.degreesLongitude !== "number") + return "degreesLongitude: number expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.address != null && message.hasOwnProperty("address")) + if (!$util.isString(message.address)) + return "address: string expected"; + if (message.url != null && message.hasOwnProperty("url")) + if (!$util.isString(message.url)) + return "url: string expected"; + if (message.isLive != null && message.hasOwnProperty("isLive")) + if (typeof message.isLive !== "boolean") + return "isLive: boolean expected"; + if (message.accuracyInMeters != null && message.hasOwnProperty("accuracyInMeters")) + if (!$util.isInteger(message.accuracyInMeters)) + return "accuracyInMeters: integer expected"; + if (message.speedInMps != null && message.hasOwnProperty("speedInMps")) + if (typeof message.speedInMps !== "number") + return "speedInMps: number expected"; + if (message.degreesClockwiseFromMagneticNorth != null && message.hasOwnProperty("degreesClockwiseFromMagneticNorth")) + if (!$util.isInteger(message.degreesClockwiseFromMagneticNorth)) + return "degreesClockwiseFromMagneticNorth: integer expected"; + if (message.comment != null && message.hasOwnProperty("comment")) + if (!$util.isString(message.comment)) + return "comment: string expected"; + if (message.jpegThumbnail != null && message.hasOwnProperty("jpegThumbnail")) + if (!(message.jpegThumbnail && typeof message.jpegThumbnail.length === "number" || $util.isString(message.jpegThumbnail))) + return "jpegThumbnail: buffer expected"; + if (message.contextInfo != null && message.hasOwnProperty("contextInfo")) { + var error = $root.proto.ContextInfo.verify(message.contextInfo); + if (error) + return "contextInfo." + error; + } return null; }; /** - * Creates an EphemeralSetting message from a plain object. Also converts values to their respective internal types. + * Creates a LocationMessage message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof proto.EphemeralSetting + * @memberof proto.LocationMessage * @static * @param {Object.} object Plain object - * @returns {proto.EphemeralSetting} EphemeralSetting + * @returns {proto.LocationMessage} LocationMessage */ - EphemeralSetting.fromObject = function fromObject(object) { - if (object instanceof $root.proto.EphemeralSetting) + LocationMessage.fromObject = function fromObject(object) { + if (object instanceof $root.proto.LocationMessage) return object; - var message = new $root.proto.EphemeralSetting(); - if (object.duration != null) - message.duration = object.duration | 0; - if (object.timestamp != null) - if ($util.Long) - (message.timestamp = $util.Long.fromValue(object.timestamp)).unsigned = false; - else if (typeof object.timestamp === "string") - message.timestamp = parseInt(object.timestamp, 10); - else if (typeof object.timestamp === "number") - message.timestamp = object.timestamp; - else if (typeof object.timestamp === "object") - message.timestamp = new $util.LongBits(object.timestamp.low >>> 0, object.timestamp.high >>> 0).toNumber(); + var message = new $root.proto.LocationMessage(); + if (object.degreesLatitude != null) + message.degreesLatitude = Number(object.degreesLatitude); + if (object.degreesLongitude != null) + message.degreesLongitude = Number(object.degreesLongitude); + if (object.name != null) + message.name = String(object.name); + if (object.address != null) + message.address = String(object.address); + if (object.url != null) + message.url = String(object.url); + if (object.isLive != null) + message.isLive = Boolean(object.isLive); + if (object.accuracyInMeters != null) + message.accuracyInMeters = object.accuracyInMeters >>> 0; + if (object.speedInMps != null) + message.speedInMps = Number(object.speedInMps); + if (object.degreesClockwiseFromMagneticNorth != null) + message.degreesClockwiseFromMagneticNorth = object.degreesClockwiseFromMagneticNorth >>> 0; + if (object.comment != null) + message.comment = String(object.comment); + if (object.jpegThumbnail != null) + if (typeof object.jpegThumbnail === "string") + $util.base64.decode(object.jpegThumbnail, message.jpegThumbnail = $util.newBuffer($util.base64.length(object.jpegThumbnail)), 0); + else if (object.jpegThumbnail.length) + message.jpegThumbnail = object.jpegThumbnail; + if (object.contextInfo != null) { + if (typeof object.contextInfo !== "object") + throw TypeError(".proto.LocationMessage.contextInfo: object expected"); + message.contextInfo = $root.proto.ContextInfo.fromObject(object.contextInfo); + } return message; }; /** - * Creates a plain object from an EphemeralSetting message. Also converts values to other types if specified. + * Creates a plain object from a LocationMessage message. Also converts values to other types if specified. * @function toObject - * @memberof proto.EphemeralSetting + * @memberof proto.LocationMessage * @static - * @param {proto.EphemeralSetting} message EphemeralSetting + * @param {proto.LocationMessage} message LocationMessage * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - EphemeralSetting.toObject = function toObject(message, options) { + LocationMessage.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.duration = 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.timestamp = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.timestamp = options.longs === String ? "0" : 0; + object.degreesLatitude = 0; + object.degreesLongitude = 0; + object.name = ""; + object.address = ""; + object.url = ""; + object.isLive = false; + object.accuracyInMeters = 0; + object.speedInMps = 0; + object.degreesClockwiseFromMagneticNorth = 0; + object.comment = ""; + if (options.bytes === String) + object.jpegThumbnail = ""; + else { + object.jpegThumbnail = []; + if (options.bytes !== Array) + object.jpegThumbnail = $util.newBuffer(object.jpegThumbnail); + } + object.contextInfo = null; } - if (message.duration != null && message.hasOwnProperty("duration")) - object.duration = message.duration; - if (message.timestamp != null && message.hasOwnProperty("timestamp")) - if (typeof message.timestamp === "number") - object.timestamp = options.longs === String ? String(message.timestamp) : message.timestamp; - else - object.timestamp = options.longs === String ? $util.Long.prototype.toString.call(message.timestamp) : options.longs === Number ? new $util.LongBits(message.timestamp.low >>> 0, message.timestamp.high >>> 0).toNumber() : message.timestamp; + if (message.degreesLatitude != null && message.hasOwnProperty("degreesLatitude")) + object.degreesLatitude = options.json && !isFinite(message.degreesLatitude) ? String(message.degreesLatitude) : message.degreesLatitude; + if (message.degreesLongitude != null && message.hasOwnProperty("degreesLongitude")) + object.degreesLongitude = options.json && !isFinite(message.degreesLongitude) ? String(message.degreesLongitude) : message.degreesLongitude; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.address != null && message.hasOwnProperty("address")) + object.address = message.address; + if (message.url != null && message.hasOwnProperty("url")) + object.url = message.url; + if (message.isLive != null && message.hasOwnProperty("isLive")) + object.isLive = message.isLive; + if (message.accuracyInMeters != null && message.hasOwnProperty("accuracyInMeters")) + object.accuracyInMeters = message.accuracyInMeters; + if (message.speedInMps != null && message.hasOwnProperty("speedInMps")) + object.speedInMps = options.json && !isFinite(message.speedInMps) ? String(message.speedInMps) : message.speedInMps; + if (message.degreesClockwiseFromMagneticNorth != null && message.hasOwnProperty("degreesClockwiseFromMagneticNorth")) + object.degreesClockwiseFromMagneticNorth = message.degreesClockwiseFromMagneticNorth; + if (message.comment != null && message.hasOwnProperty("comment")) + object.comment = message.comment; + if (message.jpegThumbnail != null && message.hasOwnProperty("jpegThumbnail")) + object.jpegThumbnail = options.bytes === String ? $util.base64.encode(message.jpegThumbnail, 0, message.jpegThumbnail.length) : options.bytes === Array ? Array.prototype.slice.call(message.jpegThumbnail) : message.jpegThumbnail; + if (message.contextInfo != null && message.hasOwnProperty("contextInfo")) + object.contextInfo = $root.proto.ContextInfo.toObject(message.contextInfo, options); return object; }; /** - * Converts this EphemeralSetting to JSON. + * Converts this LocationMessage to JSON. * @function toJSON - * @memberof proto.EphemeralSetting + * @memberof proto.LocationMessage * @instance * @returns {Object.} JSON object */ - EphemeralSetting.prototype.toJSON = function toJSON() { + LocationMessage.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return EphemeralSetting; + return LocationMessage; })(); - proto.InteractiveAnnotation = (function() { + proto.Message = (function() { /** - * Properties of an InteractiveAnnotation. + * Properties of a Message. * @memberof proto - * @interface IInteractiveAnnotation - * @property {Array.|null} [polygonVertices] InteractiveAnnotation polygonVertices - * @property {proto.ILocation|null} [location] InteractiveAnnotation location + * @interface IMessage + * @property {string|null} [conversation] Message conversation + * @property {proto.ISenderKeyDistributionMessage|null} [senderKeyDistributionMessage] Message senderKeyDistributionMessage + * @property {proto.IImageMessage|null} [imageMessage] Message imageMessage + * @property {proto.IContactMessage|null} [contactMessage] Message contactMessage + * @property {proto.ILocationMessage|null} [locationMessage] Message locationMessage + * @property {proto.IExtendedTextMessage|null} [extendedTextMessage] Message extendedTextMessage + * @property {proto.IDocumentMessage|null} [documentMessage] Message documentMessage + * @property {proto.IAudioMessage|null} [audioMessage] Message audioMessage + * @property {proto.IVideoMessage|null} [videoMessage] Message videoMessage + * @property {proto.ICall|null} [call] Message call + * @property {proto.IChat|null} [chat] Message chat + * @property {proto.IProtocolMessage|null} [protocolMessage] Message protocolMessage + * @property {proto.IContactsArrayMessage|null} [contactsArrayMessage] Message contactsArrayMessage + * @property {proto.IHighlyStructuredMessage|null} [highlyStructuredMessage] Message highlyStructuredMessage + * @property {proto.ISenderKeyDistributionMessage|null} [fastRatchetKeySenderKeyDistributionMessage] Message fastRatchetKeySenderKeyDistributionMessage + * @property {proto.ISendPaymentMessage|null} [sendPaymentMessage] Message sendPaymentMessage + * @property {proto.ILiveLocationMessage|null} [liveLocationMessage] Message liveLocationMessage + * @property {proto.IRequestPaymentMessage|null} [requestPaymentMessage] Message requestPaymentMessage + * @property {proto.IDeclinePaymentRequestMessage|null} [declinePaymentRequestMessage] Message declinePaymentRequestMessage + * @property {proto.ICancelPaymentRequestMessage|null} [cancelPaymentRequestMessage] Message cancelPaymentRequestMessage + * @property {proto.ITemplateMessage|null} [templateMessage] Message templateMessage + * @property {proto.IStickerMessage|null} [stickerMessage] Message stickerMessage + * @property {proto.IGroupInviteMessage|null} [groupInviteMessage] Message groupInviteMessage + * @property {proto.ITemplateButtonReplyMessage|null} [templateButtonReplyMessage] Message templateButtonReplyMessage + * @property {proto.IProductMessage|null} [productMessage] Message productMessage + * @property {proto.IDeviceSentMessage|null} [deviceSentMessage] Message deviceSentMessage + * @property {proto.IMessageContextInfo|null} [messageContextInfo] Message messageContextInfo + * @property {proto.IListMessage|null} [listMessage] Message listMessage + * @property {proto.IFutureProofMessage|null} [viewOnceMessage] Message viewOnceMessage + * @property {proto.IOrderMessage|null} [orderMessage] Message orderMessage + * @property {proto.IListResponseMessage|null} [listResponseMessage] Message listResponseMessage + * @property {proto.IFutureProofMessage|null} [ephemeralMessage] Message ephemeralMessage + * @property {proto.IInvoiceMessage|null} [invoiceMessage] Message invoiceMessage + * @property {proto.IButtonsMessage|null} [buttonsMessage] Message buttonsMessage + * @property {proto.IButtonsResponseMessage|null} [buttonsResponseMessage] Message buttonsResponseMessage + * @property {proto.IPaymentInviteMessage|null} [paymentInviteMessage] Message paymentInviteMessage + * @property {proto.IInteractiveMessage|null} [interactiveMessage] Message interactiveMessage + * @property {proto.IReactionMessage|null} [reactionMessage] Message reactionMessage + * @property {proto.IStickerSyncRMRMessage|null} [stickerSyncRmrMessage] Message stickerSyncRmrMessage + * @property {proto.IInteractiveResponseMessage|null} [interactiveResponseMessage] Message interactiveResponseMessage + * @property {proto.IPollCreationMessage|null} [pollCreationMessage] Message pollCreationMessage + * @property {proto.IPollUpdateMessage|null} [pollUpdateMessage] Message pollUpdateMessage */ /** - * Constructs a new InteractiveAnnotation. + * Constructs a new Message. * @memberof proto - * @classdesc Represents an InteractiveAnnotation. - * @implements IInteractiveAnnotation + * @classdesc Represents a Message. + * @implements IMessage * @constructor - * @param {proto.IInteractiveAnnotation=} [properties] Properties to set + * @param {proto.IMessage=} [properties] Properties to set */ - function InteractiveAnnotation(properties) { - this.polygonVertices = []; + function Message(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -20591,736 +21357,608 @@ $root.proto = (function() { } /** - * InteractiveAnnotation polygonVertices. - * @member {Array.} polygonVertices - * @memberof proto.InteractiveAnnotation + * Message conversation. + * @member {string} conversation + * @memberof proto.Message * @instance */ - InteractiveAnnotation.prototype.polygonVertices = $util.emptyArray; + Message.prototype.conversation = ""; /** - * InteractiveAnnotation location. - * @member {proto.ILocation|null|undefined} location - * @memberof proto.InteractiveAnnotation + * Message senderKeyDistributionMessage. + * @member {proto.ISenderKeyDistributionMessage|null|undefined} senderKeyDistributionMessage + * @memberof proto.Message * @instance */ - InteractiveAnnotation.prototype.location = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + Message.prototype.senderKeyDistributionMessage = null; /** - * InteractiveAnnotation action. - * @member {"location"|undefined} action - * @memberof proto.InteractiveAnnotation + * Message imageMessage. + * @member {proto.IImageMessage|null|undefined} imageMessage + * @memberof proto.Message * @instance */ - Object.defineProperty(InteractiveAnnotation.prototype, "action", { - get: $util.oneOfGetter($oneOfFields = ["location"]), - set: $util.oneOfSetter($oneOfFields) - }); + Message.prototype.imageMessage = null; /** - * Creates a new InteractiveAnnotation instance using the specified properties. - * @function create - * @memberof proto.InteractiveAnnotation - * @static - * @param {proto.IInteractiveAnnotation=} [properties] Properties to set - * @returns {proto.InteractiveAnnotation} InteractiveAnnotation instance + * Message contactMessage. + * @member {proto.IContactMessage|null|undefined} contactMessage + * @memberof proto.Message + * @instance */ - InteractiveAnnotation.create = function create(properties) { - return new InteractiveAnnotation(properties); - }; + Message.prototype.contactMessage = null; /** - * Encodes the specified InteractiveAnnotation message. Does not implicitly {@link proto.InteractiveAnnotation.verify|verify} messages. - * @function encode - * @memberof proto.InteractiveAnnotation - * @static - * @param {proto.IInteractiveAnnotation} message InteractiveAnnotation message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * Message locationMessage. + * @member {proto.ILocationMessage|null|undefined} locationMessage + * @memberof proto.Message + * @instance */ - InteractiveAnnotation.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.polygonVertices != null && message.polygonVertices.length) - for (var i = 0; i < message.polygonVertices.length; ++i) - $root.proto.Point.encode(message.polygonVertices[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.location != null && Object.hasOwnProperty.call(message, "location")) - $root.proto.Location.encode(message.location, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; + Message.prototype.locationMessage = null; /** - * Encodes the specified InteractiveAnnotation message, length delimited. Does not implicitly {@link proto.InteractiveAnnotation.verify|verify} messages. - * @function encodeDelimited - * @memberof proto.InteractiveAnnotation - * @static - * @param {proto.IInteractiveAnnotation} message InteractiveAnnotation message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * Message extendedTextMessage. + * @member {proto.IExtendedTextMessage|null|undefined} extendedTextMessage + * @memberof proto.Message + * @instance */ - InteractiveAnnotation.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + Message.prototype.extendedTextMessage = null; /** - * Decodes an InteractiveAnnotation message from the specified reader or buffer. - * @function decode - * @memberof proto.InteractiveAnnotation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {proto.InteractiveAnnotation} InteractiveAnnotation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Message documentMessage. + * @member {proto.IDocumentMessage|null|undefined} documentMessage + * @memberof proto.Message + * @instance */ - InteractiveAnnotation.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.InteractiveAnnotation(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.polygonVertices && message.polygonVertices.length)) - message.polygonVertices = []; - message.polygonVertices.push($root.proto.Point.decode(reader, reader.uint32())); - break; - case 2: - message.location = $root.proto.Location.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + Message.prototype.documentMessage = null; /** - * Decodes an InteractiveAnnotation message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof proto.InteractiveAnnotation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.InteractiveAnnotation} InteractiveAnnotation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Message audioMessage. + * @member {proto.IAudioMessage|null|undefined} audioMessage + * @memberof proto.Message + * @instance */ - InteractiveAnnotation.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + Message.prototype.audioMessage = null; /** - * Verifies an InteractiveAnnotation message. - * @function verify - * @memberof proto.InteractiveAnnotation - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not + * Message videoMessage. + * @member {proto.IVideoMessage|null|undefined} videoMessage + * @memberof proto.Message + * @instance */ - InteractiveAnnotation.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.polygonVertices != null && message.hasOwnProperty("polygonVertices")) { - if (!Array.isArray(message.polygonVertices)) - return "polygonVertices: array expected"; - for (var i = 0; i < message.polygonVertices.length; ++i) { - var error = $root.proto.Point.verify(message.polygonVertices[i]); - if (error) - return "polygonVertices." + error; - } - } - if (message.location != null && message.hasOwnProperty("location")) { - properties.action = 1; - { - var error = $root.proto.Location.verify(message.location); - if (error) - return "location." + error; - } - } - return null; - }; + Message.prototype.videoMessage = null; /** - * Creates an InteractiveAnnotation message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof proto.InteractiveAnnotation - * @static - * @param {Object.} object Plain object - * @returns {proto.InteractiveAnnotation} InteractiveAnnotation + * Message call. + * @member {proto.ICall|null|undefined} call + * @memberof proto.Message + * @instance */ - InteractiveAnnotation.fromObject = function fromObject(object) { - if (object instanceof $root.proto.InteractiveAnnotation) - return object; - var message = new $root.proto.InteractiveAnnotation(); - if (object.polygonVertices) { - if (!Array.isArray(object.polygonVertices)) - throw TypeError(".proto.InteractiveAnnotation.polygonVertices: array expected"); - message.polygonVertices = []; - for (var i = 0; i < object.polygonVertices.length; ++i) { - if (typeof object.polygonVertices[i] !== "object") - throw TypeError(".proto.InteractiveAnnotation.polygonVertices: object expected"); - message.polygonVertices[i] = $root.proto.Point.fromObject(object.polygonVertices[i]); - } - } - if (object.location != null) { - if (typeof object.location !== "object") - throw TypeError(".proto.InteractiveAnnotation.location: object expected"); - message.location = $root.proto.Location.fromObject(object.location); - } - return message; - }; + Message.prototype.call = null; /** - * Creates a plain object from an InteractiveAnnotation message. Also converts values to other types if specified. - * @function toObject - * @memberof proto.InteractiveAnnotation - * @static - * @param {proto.InteractiveAnnotation} message InteractiveAnnotation - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object + * Message chat. + * @member {proto.IChat|null|undefined} chat + * @memberof proto.Message + * @instance */ - InteractiveAnnotation.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.polygonVertices = []; - if (message.polygonVertices && message.polygonVertices.length) { - object.polygonVertices = []; - for (var j = 0; j < message.polygonVertices.length; ++j) - object.polygonVertices[j] = $root.proto.Point.toObject(message.polygonVertices[j], options); - } - if (message.location != null && message.hasOwnProperty("location")) { - object.location = $root.proto.Location.toObject(message.location, options); - if (options.oneofs) - object.action = "location"; - } - return object; - }; + Message.prototype.chat = null; /** - * Converts this InteractiveAnnotation to JSON. - * @function toJSON - * @memberof proto.InteractiveAnnotation + * Message protocolMessage. + * @member {proto.IProtocolMessage|null|undefined} protocolMessage + * @memberof proto.Message * @instance - * @returns {Object.} JSON object */ - InteractiveAnnotation.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + Message.prototype.protocolMessage = null; - return InteractiveAnnotation; - })(); + /** + * Message contactsArrayMessage. + * @member {proto.IContactsArrayMessage|null|undefined} contactsArrayMessage + * @memberof proto.Message + * @instance + */ + Message.prototype.contactsArrayMessage = null; - proto.DeviceListMetadata = (function() { + /** + * Message highlyStructuredMessage. + * @member {proto.IHighlyStructuredMessage|null|undefined} highlyStructuredMessage + * @memberof proto.Message + * @instance + */ + Message.prototype.highlyStructuredMessage = null; /** - * Properties of a DeviceListMetadata. - * @memberof proto - * @interface IDeviceListMetadata - * @property {Uint8Array|null} [senderKeyHash] DeviceListMetadata senderKeyHash - * @property {number|Long|null} [senderTimestamp] DeviceListMetadata senderTimestamp - * @property {Array.|null} [senderKeyIndexes] DeviceListMetadata senderKeyIndexes - * @property {Uint8Array|null} [recipientKeyHash] DeviceListMetadata recipientKeyHash - * @property {number|Long|null} [recipientTimestamp] DeviceListMetadata recipientTimestamp - * @property {Array.|null} [recipientKeyIndexes] DeviceListMetadata recipientKeyIndexes + * Message fastRatchetKeySenderKeyDistributionMessage. + * @member {proto.ISenderKeyDistributionMessage|null|undefined} fastRatchetKeySenderKeyDistributionMessage + * @memberof proto.Message + * @instance */ + Message.prototype.fastRatchetKeySenderKeyDistributionMessage = null; /** - * Constructs a new DeviceListMetadata. - * @memberof proto - * @classdesc Represents a DeviceListMetadata. - * @implements IDeviceListMetadata - * @constructor - * @param {proto.IDeviceListMetadata=} [properties] Properties to set + * Message sendPaymentMessage. + * @member {proto.ISendPaymentMessage|null|undefined} sendPaymentMessage + * @memberof proto.Message + * @instance */ - function DeviceListMetadata(properties) { - this.senderKeyIndexes = []; - this.recipientKeyIndexes = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + Message.prototype.sendPaymentMessage = null; /** - * DeviceListMetadata senderKeyHash. - * @member {Uint8Array} senderKeyHash - * @memberof proto.DeviceListMetadata + * Message liveLocationMessage. + * @member {proto.ILiveLocationMessage|null|undefined} liveLocationMessage + * @memberof proto.Message * @instance */ - DeviceListMetadata.prototype.senderKeyHash = $util.newBuffer([]); + Message.prototype.liveLocationMessage = null; /** - * DeviceListMetadata senderTimestamp. - * @member {number|Long} senderTimestamp - * @memberof proto.DeviceListMetadata + * Message requestPaymentMessage. + * @member {proto.IRequestPaymentMessage|null|undefined} requestPaymentMessage + * @memberof proto.Message * @instance */ - DeviceListMetadata.prototype.senderTimestamp = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + Message.prototype.requestPaymentMessage = null; /** - * DeviceListMetadata senderKeyIndexes. - * @member {Array.} senderKeyIndexes - * @memberof proto.DeviceListMetadata + * Message declinePaymentRequestMessage. + * @member {proto.IDeclinePaymentRequestMessage|null|undefined} declinePaymentRequestMessage + * @memberof proto.Message * @instance */ - DeviceListMetadata.prototype.senderKeyIndexes = $util.emptyArray; + Message.prototype.declinePaymentRequestMessage = null; /** - * DeviceListMetadata recipientKeyHash. - * @member {Uint8Array} recipientKeyHash - * @memberof proto.DeviceListMetadata + * Message cancelPaymentRequestMessage. + * @member {proto.ICancelPaymentRequestMessage|null|undefined} cancelPaymentRequestMessage + * @memberof proto.Message * @instance */ - DeviceListMetadata.prototype.recipientKeyHash = $util.newBuffer([]); + Message.prototype.cancelPaymentRequestMessage = null; /** - * DeviceListMetadata recipientTimestamp. - * @member {number|Long} recipientTimestamp - * @memberof proto.DeviceListMetadata + * Message templateMessage. + * @member {proto.ITemplateMessage|null|undefined} templateMessage + * @memberof proto.Message * @instance */ - DeviceListMetadata.prototype.recipientTimestamp = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + Message.prototype.templateMessage = null; /** - * DeviceListMetadata recipientKeyIndexes. - * @member {Array.} recipientKeyIndexes - * @memberof proto.DeviceListMetadata + * Message stickerMessage. + * @member {proto.IStickerMessage|null|undefined} stickerMessage + * @memberof proto.Message * @instance */ - DeviceListMetadata.prototype.recipientKeyIndexes = $util.emptyArray; + Message.prototype.stickerMessage = null; /** - * Creates a new DeviceListMetadata instance using the specified properties. - * @function create - * @memberof proto.DeviceListMetadata - * @static - * @param {proto.IDeviceListMetadata=} [properties] Properties to set - * @returns {proto.DeviceListMetadata} DeviceListMetadata instance + * Message groupInviteMessage. + * @member {proto.IGroupInviteMessage|null|undefined} groupInviteMessage + * @memberof proto.Message + * @instance */ - DeviceListMetadata.create = function create(properties) { - return new DeviceListMetadata(properties); - }; + Message.prototype.groupInviteMessage = null; /** - * Encodes the specified DeviceListMetadata message. Does not implicitly {@link proto.DeviceListMetadata.verify|verify} messages. - * @function encode - * @memberof proto.DeviceListMetadata - * @static - * @param {proto.IDeviceListMetadata} message DeviceListMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * Message templateButtonReplyMessage. + * @member {proto.ITemplateButtonReplyMessage|null|undefined} templateButtonReplyMessage + * @memberof proto.Message + * @instance */ - DeviceListMetadata.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.senderKeyHash != null && Object.hasOwnProperty.call(message, "senderKeyHash")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.senderKeyHash); - if (message.senderTimestamp != null && Object.hasOwnProperty.call(message, "senderTimestamp")) - writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.senderTimestamp); - if (message.senderKeyIndexes != null && message.senderKeyIndexes.length) { - writer.uint32(/* id 3, wireType 2 =*/26).fork(); - for (var i = 0; i < message.senderKeyIndexes.length; ++i) - writer.uint32(message.senderKeyIndexes[i]); - writer.ldelim(); - } - if (message.recipientKeyHash != null && Object.hasOwnProperty.call(message, "recipientKeyHash")) - writer.uint32(/* id 8, wireType 2 =*/66).bytes(message.recipientKeyHash); - if (message.recipientTimestamp != null && Object.hasOwnProperty.call(message, "recipientTimestamp")) - writer.uint32(/* id 9, wireType 0 =*/72).uint64(message.recipientTimestamp); - if (message.recipientKeyIndexes != null && message.recipientKeyIndexes.length) { - writer.uint32(/* id 10, wireType 2 =*/82).fork(); - for (var i = 0; i < message.recipientKeyIndexes.length; ++i) - writer.uint32(message.recipientKeyIndexes[i]); - writer.ldelim(); - } - return writer; - }; + Message.prototype.templateButtonReplyMessage = null; /** - * Encodes the specified DeviceListMetadata message, length delimited. Does not implicitly {@link proto.DeviceListMetadata.verify|verify} messages. - * @function encodeDelimited - * @memberof proto.DeviceListMetadata - * @static - * @param {proto.IDeviceListMetadata} message DeviceListMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * Message productMessage. + * @member {proto.IProductMessage|null|undefined} productMessage + * @memberof proto.Message + * @instance */ - DeviceListMetadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + Message.prototype.productMessage = null; /** - * Decodes a DeviceListMetadata message from the specified reader or buffer. - * @function decode - * @memberof proto.DeviceListMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {proto.DeviceListMetadata} DeviceListMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Message deviceSentMessage. + * @member {proto.IDeviceSentMessage|null|undefined} deviceSentMessage + * @memberof proto.Message + * @instance */ - DeviceListMetadata.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.DeviceListMetadata(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.senderKeyHash = reader.bytes(); - break; - case 2: - message.senderTimestamp = reader.uint64(); - break; - case 3: - if (!(message.senderKeyIndexes && message.senderKeyIndexes.length)) - message.senderKeyIndexes = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.senderKeyIndexes.push(reader.uint32()); - } else - message.senderKeyIndexes.push(reader.uint32()); - break; - case 8: - message.recipientKeyHash = reader.bytes(); - break; - case 9: - message.recipientTimestamp = reader.uint64(); - break; - case 10: - if (!(message.recipientKeyIndexes && message.recipientKeyIndexes.length)) - message.recipientKeyIndexes = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.recipientKeyIndexes.push(reader.uint32()); - } else - message.recipientKeyIndexes.push(reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + Message.prototype.deviceSentMessage = null; /** - * Decodes a DeviceListMetadata message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof proto.DeviceListMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.DeviceListMetadata} DeviceListMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Message messageContextInfo. + * @member {proto.IMessageContextInfo|null|undefined} messageContextInfo + * @memberof proto.Message + * @instance */ - DeviceListMetadata.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + Message.prototype.messageContextInfo = null; /** - * Verifies a DeviceListMetadata message. - * @function verify - * @memberof proto.DeviceListMetadata - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not + * Message listMessage. + * @member {proto.IListMessage|null|undefined} listMessage + * @memberof proto.Message + * @instance */ - DeviceListMetadata.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.senderKeyHash != null && message.hasOwnProperty("senderKeyHash")) - if (!(message.senderKeyHash && typeof message.senderKeyHash.length === "number" || $util.isString(message.senderKeyHash))) - return "senderKeyHash: buffer expected"; - if (message.senderTimestamp != null && message.hasOwnProperty("senderTimestamp")) - if (!$util.isInteger(message.senderTimestamp) && !(message.senderTimestamp && $util.isInteger(message.senderTimestamp.low) && $util.isInteger(message.senderTimestamp.high))) - return "senderTimestamp: integer|Long expected"; - if (message.senderKeyIndexes != null && message.hasOwnProperty("senderKeyIndexes")) { - if (!Array.isArray(message.senderKeyIndexes)) - return "senderKeyIndexes: array expected"; - for (var i = 0; i < message.senderKeyIndexes.length; ++i) - if (!$util.isInteger(message.senderKeyIndexes[i])) - return "senderKeyIndexes: integer[] expected"; - } - if (message.recipientKeyHash != null && message.hasOwnProperty("recipientKeyHash")) - if (!(message.recipientKeyHash && typeof message.recipientKeyHash.length === "number" || $util.isString(message.recipientKeyHash))) - return "recipientKeyHash: buffer expected"; - if (message.recipientTimestamp != null && message.hasOwnProperty("recipientTimestamp")) - if (!$util.isInteger(message.recipientTimestamp) && !(message.recipientTimestamp && $util.isInteger(message.recipientTimestamp.low) && $util.isInteger(message.recipientTimestamp.high))) - return "recipientTimestamp: integer|Long expected"; - if (message.recipientKeyIndexes != null && message.hasOwnProperty("recipientKeyIndexes")) { - if (!Array.isArray(message.recipientKeyIndexes)) - return "recipientKeyIndexes: array expected"; - for (var i = 0; i < message.recipientKeyIndexes.length; ++i) - if (!$util.isInteger(message.recipientKeyIndexes[i])) - return "recipientKeyIndexes: integer[] expected"; - } - return null; - }; + Message.prototype.listMessage = null; /** - * Creates a DeviceListMetadata message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof proto.DeviceListMetadata - * @static - * @param {Object.} object Plain object - * @returns {proto.DeviceListMetadata} DeviceListMetadata + * Message viewOnceMessage. + * @member {proto.IFutureProofMessage|null|undefined} viewOnceMessage + * @memberof proto.Message + * @instance */ - DeviceListMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.proto.DeviceListMetadata) - return object; - var message = new $root.proto.DeviceListMetadata(); - if (object.senderKeyHash != null) - if (typeof object.senderKeyHash === "string") - $util.base64.decode(object.senderKeyHash, message.senderKeyHash = $util.newBuffer($util.base64.length(object.senderKeyHash)), 0); - else if (object.senderKeyHash.length) - message.senderKeyHash = object.senderKeyHash; - if (object.senderTimestamp != null) - if ($util.Long) - (message.senderTimestamp = $util.Long.fromValue(object.senderTimestamp)).unsigned = true; - else if (typeof object.senderTimestamp === "string") - message.senderTimestamp = parseInt(object.senderTimestamp, 10); - else if (typeof object.senderTimestamp === "number") - message.senderTimestamp = object.senderTimestamp; - else if (typeof object.senderTimestamp === "object") - message.senderTimestamp = new $util.LongBits(object.senderTimestamp.low >>> 0, object.senderTimestamp.high >>> 0).toNumber(true); - if (object.senderKeyIndexes) { - if (!Array.isArray(object.senderKeyIndexes)) - throw TypeError(".proto.DeviceListMetadata.senderKeyIndexes: array expected"); - message.senderKeyIndexes = []; - for (var i = 0; i < object.senderKeyIndexes.length; ++i) - message.senderKeyIndexes[i] = object.senderKeyIndexes[i] >>> 0; - } - if (object.recipientKeyHash != null) - if (typeof object.recipientKeyHash === "string") - $util.base64.decode(object.recipientKeyHash, message.recipientKeyHash = $util.newBuffer($util.base64.length(object.recipientKeyHash)), 0); - else if (object.recipientKeyHash.length) - message.recipientKeyHash = object.recipientKeyHash; - if (object.recipientTimestamp != null) - if ($util.Long) - (message.recipientTimestamp = $util.Long.fromValue(object.recipientTimestamp)).unsigned = true; - else if (typeof object.recipientTimestamp === "string") - message.recipientTimestamp = parseInt(object.recipientTimestamp, 10); - else if (typeof object.recipientTimestamp === "number") - message.recipientTimestamp = object.recipientTimestamp; - else if (typeof object.recipientTimestamp === "object") - message.recipientTimestamp = new $util.LongBits(object.recipientTimestamp.low >>> 0, object.recipientTimestamp.high >>> 0).toNumber(true); - if (object.recipientKeyIndexes) { - if (!Array.isArray(object.recipientKeyIndexes)) - throw TypeError(".proto.DeviceListMetadata.recipientKeyIndexes: array expected"); - message.recipientKeyIndexes = []; - for (var i = 0; i < object.recipientKeyIndexes.length; ++i) - message.recipientKeyIndexes[i] = object.recipientKeyIndexes[i] >>> 0; - } - return message; - }; + Message.prototype.viewOnceMessage = null; /** - * Creates a plain object from a DeviceListMetadata message. Also converts values to other types if specified. - * @function toObject - * @memberof proto.DeviceListMetadata - * @static - * @param {proto.DeviceListMetadata} message DeviceListMetadata - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object + * Message orderMessage. + * @member {proto.IOrderMessage|null|undefined} orderMessage + * @memberof proto.Message + * @instance */ - DeviceListMetadata.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.senderKeyIndexes = []; - object.recipientKeyIndexes = []; - } - if (options.defaults) { - if (options.bytes === String) - object.senderKeyHash = ""; - else { - object.senderKeyHash = []; - if (options.bytes !== Array) - object.senderKeyHash = $util.newBuffer(object.senderKeyHash); - } - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.senderTimestamp = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.senderTimestamp = options.longs === String ? "0" : 0; - if (options.bytes === String) - object.recipientKeyHash = ""; - else { - object.recipientKeyHash = []; - if (options.bytes !== Array) - object.recipientKeyHash = $util.newBuffer(object.recipientKeyHash); - } - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.recipientTimestamp = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.recipientTimestamp = options.longs === String ? "0" : 0; - } - if (message.senderKeyHash != null && message.hasOwnProperty("senderKeyHash")) - object.senderKeyHash = options.bytes === String ? $util.base64.encode(message.senderKeyHash, 0, message.senderKeyHash.length) : options.bytes === Array ? Array.prototype.slice.call(message.senderKeyHash) : message.senderKeyHash; - if (message.senderTimestamp != null && message.hasOwnProperty("senderTimestamp")) - if (typeof message.senderTimestamp === "number") - object.senderTimestamp = options.longs === String ? String(message.senderTimestamp) : message.senderTimestamp; - else - object.senderTimestamp = options.longs === String ? $util.Long.prototype.toString.call(message.senderTimestamp) : options.longs === Number ? new $util.LongBits(message.senderTimestamp.low >>> 0, message.senderTimestamp.high >>> 0).toNumber(true) : message.senderTimestamp; - if (message.senderKeyIndexes && message.senderKeyIndexes.length) { - object.senderKeyIndexes = []; - for (var j = 0; j < message.senderKeyIndexes.length; ++j) - object.senderKeyIndexes[j] = message.senderKeyIndexes[j]; - } - if (message.recipientKeyHash != null && message.hasOwnProperty("recipientKeyHash")) - object.recipientKeyHash = options.bytes === String ? $util.base64.encode(message.recipientKeyHash, 0, message.recipientKeyHash.length) : options.bytes === Array ? Array.prototype.slice.call(message.recipientKeyHash) : message.recipientKeyHash; - if (message.recipientTimestamp != null && message.hasOwnProperty("recipientTimestamp")) - if (typeof message.recipientTimestamp === "number") - object.recipientTimestamp = options.longs === String ? String(message.recipientTimestamp) : message.recipientTimestamp; - else - object.recipientTimestamp = options.longs === String ? $util.Long.prototype.toString.call(message.recipientTimestamp) : options.longs === Number ? new $util.LongBits(message.recipientTimestamp.low >>> 0, message.recipientTimestamp.high >>> 0).toNumber(true) : message.recipientTimestamp; - if (message.recipientKeyIndexes && message.recipientKeyIndexes.length) { - object.recipientKeyIndexes = []; - for (var j = 0; j < message.recipientKeyIndexes.length; ++j) - object.recipientKeyIndexes[j] = message.recipientKeyIndexes[j]; - } - return object; - }; + Message.prototype.orderMessage = null; /** - * Converts this DeviceListMetadata to JSON. - * @function toJSON - * @memberof proto.DeviceListMetadata + * Message listResponseMessage. + * @member {proto.IListResponseMessage|null|undefined} listResponseMessage + * @memberof proto.Message * @instance - * @returns {Object.} JSON object */ - DeviceListMetadata.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + Message.prototype.listResponseMessage = null; - return DeviceListMetadata; - })(); + /** + * Message ephemeralMessage. + * @member {proto.IFutureProofMessage|null|undefined} ephemeralMessage + * @memberof proto.Message + * @instance + */ + Message.prototype.ephemeralMessage = null; - proto.MessageContextInfo = (function() { + /** + * Message invoiceMessage. + * @member {proto.IInvoiceMessage|null|undefined} invoiceMessage + * @memberof proto.Message + * @instance + */ + Message.prototype.invoiceMessage = null; /** - * Properties of a MessageContextInfo. - * @memberof proto - * @interface IMessageContextInfo - * @property {proto.IDeviceListMetadata|null} [deviceListMetadata] MessageContextInfo deviceListMetadata - * @property {number|null} [deviceListMetadataVersion] MessageContextInfo deviceListMetadataVersion + * Message buttonsMessage. + * @member {proto.IButtonsMessage|null|undefined} buttonsMessage + * @memberof proto.Message + * @instance */ + Message.prototype.buttonsMessage = null; /** - * Constructs a new MessageContextInfo. - * @memberof proto - * @classdesc Represents a MessageContextInfo. - * @implements IMessageContextInfo - * @constructor - * @param {proto.IMessageContextInfo=} [properties] Properties to set + * Message buttonsResponseMessage. + * @member {proto.IButtonsResponseMessage|null|undefined} buttonsResponseMessage + * @memberof proto.Message + * @instance */ - function MessageContextInfo(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + Message.prototype.buttonsResponseMessage = null; /** - * MessageContextInfo deviceListMetadata. - * @member {proto.IDeviceListMetadata|null|undefined} deviceListMetadata - * @memberof proto.MessageContextInfo + * Message paymentInviteMessage. + * @member {proto.IPaymentInviteMessage|null|undefined} paymentInviteMessage + * @memberof proto.Message * @instance */ - MessageContextInfo.prototype.deviceListMetadata = null; + Message.prototype.paymentInviteMessage = null; /** - * MessageContextInfo deviceListMetadataVersion. - * @member {number} deviceListMetadataVersion - * @memberof proto.MessageContextInfo + * Message interactiveMessage. + * @member {proto.IInteractiveMessage|null|undefined} interactiveMessage + * @memberof proto.Message * @instance */ - MessageContextInfo.prototype.deviceListMetadataVersion = 0; + Message.prototype.interactiveMessage = null; /** - * Creates a new MessageContextInfo instance using the specified properties. + * Message reactionMessage. + * @member {proto.IReactionMessage|null|undefined} reactionMessage + * @memberof proto.Message + * @instance + */ + Message.prototype.reactionMessage = null; + + /** + * Message stickerSyncRmrMessage. + * @member {proto.IStickerSyncRMRMessage|null|undefined} stickerSyncRmrMessage + * @memberof proto.Message + * @instance + */ + Message.prototype.stickerSyncRmrMessage = null; + + /** + * Message interactiveResponseMessage. + * @member {proto.IInteractiveResponseMessage|null|undefined} interactiveResponseMessage + * @memberof proto.Message + * @instance + */ + Message.prototype.interactiveResponseMessage = null; + + /** + * Message pollCreationMessage. + * @member {proto.IPollCreationMessage|null|undefined} pollCreationMessage + * @memberof proto.Message + * @instance + */ + Message.prototype.pollCreationMessage = null; + + /** + * Message pollUpdateMessage. + * @member {proto.IPollUpdateMessage|null|undefined} pollUpdateMessage + * @memberof proto.Message + * @instance + */ + Message.prototype.pollUpdateMessage = null; + + /** + * Creates a new Message instance using the specified properties. * @function create - * @memberof proto.MessageContextInfo + * @memberof proto.Message * @static - * @param {proto.IMessageContextInfo=} [properties] Properties to set - * @returns {proto.MessageContextInfo} MessageContextInfo instance + * @param {proto.IMessage=} [properties] Properties to set + * @returns {proto.Message} Message instance */ - MessageContextInfo.create = function create(properties) { - return new MessageContextInfo(properties); + Message.create = function create(properties) { + return new Message(properties); }; /** - * Encodes the specified MessageContextInfo message. Does not implicitly {@link proto.MessageContextInfo.verify|verify} messages. + * Encodes the specified Message message. Does not implicitly {@link proto.Message.verify|verify} messages. * @function encode - * @memberof proto.MessageContextInfo + * @memberof proto.Message * @static - * @param {proto.IMessageContextInfo} message MessageContextInfo message or plain object to encode + * @param {proto.IMessage} message Message message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - MessageContextInfo.encode = function encode(message, writer) { + Message.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.deviceListMetadata != null && Object.hasOwnProperty.call(message, "deviceListMetadata")) - $root.proto.DeviceListMetadata.encode(message.deviceListMetadata, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.deviceListMetadataVersion != null && Object.hasOwnProperty.call(message, "deviceListMetadataVersion")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.deviceListMetadataVersion); + if (message.conversation != null && Object.hasOwnProperty.call(message, "conversation")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.conversation); + if (message.senderKeyDistributionMessage != null && Object.hasOwnProperty.call(message, "senderKeyDistributionMessage")) + $root.proto.SenderKeyDistributionMessage.encode(message.senderKeyDistributionMessage, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.imageMessage != null && Object.hasOwnProperty.call(message, "imageMessage")) + $root.proto.ImageMessage.encode(message.imageMessage, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.contactMessage != null && Object.hasOwnProperty.call(message, "contactMessage")) + $root.proto.ContactMessage.encode(message.contactMessage, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.locationMessage != null && Object.hasOwnProperty.call(message, "locationMessage")) + $root.proto.LocationMessage.encode(message.locationMessage, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.extendedTextMessage != null && Object.hasOwnProperty.call(message, "extendedTextMessage")) + $root.proto.ExtendedTextMessage.encode(message.extendedTextMessage, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.documentMessage != null && Object.hasOwnProperty.call(message, "documentMessage")) + $root.proto.DocumentMessage.encode(message.documentMessage, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.audioMessage != null && Object.hasOwnProperty.call(message, "audioMessage")) + $root.proto.AudioMessage.encode(message.audioMessage, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.videoMessage != null && Object.hasOwnProperty.call(message, "videoMessage")) + $root.proto.VideoMessage.encode(message.videoMessage, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.call != null && Object.hasOwnProperty.call(message, "call")) + $root.proto.Call.encode(message.call, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.chat != null && Object.hasOwnProperty.call(message, "chat")) + $root.proto.Chat.encode(message.chat, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.protocolMessage != null && Object.hasOwnProperty.call(message, "protocolMessage")) + $root.proto.ProtocolMessage.encode(message.protocolMessage, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.contactsArrayMessage != null && Object.hasOwnProperty.call(message, "contactsArrayMessage")) + $root.proto.ContactsArrayMessage.encode(message.contactsArrayMessage, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + if (message.highlyStructuredMessage != null && Object.hasOwnProperty.call(message, "highlyStructuredMessage")) + $root.proto.HighlyStructuredMessage.encode(message.highlyStructuredMessage, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); + if (message.fastRatchetKeySenderKeyDistributionMessage != null && Object.hasOwnProperty.call(message, "fastRatchetKeySenderKeyDistributionMessage")) + $root.proto.SenderKeyDistributionMessage.encode(message.fastRatchetKeySenderKeyDistributionMessage, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); + if (message.sendPaymentMessage != null && Object.hasOwnProperty.call(message, "sendPaymentMessage")) + $root.proto.SendPaymentMessage.encode(message.sendPaymentMessage, writer.uint32(/* id 16, wireType 2 =*/130).fork()).ldelim(); + if (message.liveLocationMessage != null && Object.hasOwnProperty.call(message, "liveLocationMessage")) + $root.proto.LiveLocationMessage.encode(message.liveLocationMessage, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); + if (message.requestPaymentMessage != null && Object.hasOwnProperty.call(message, "requestPaymentMessage")) + $root.proto.RequestPaymentMessage.encode(message.requestPaymentMessage, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); + if (message.declinePaymentRequestMessage != null && Object.hasOwnProperty.call(message, "declinePaymentRequestMessage")) + $root.proto.DeclinePaymentRequestMessage.encode(message.declinePaymentRequestMessage, writer.uint32(/* id 23, wireType 2 =*/186).fork()).ldelim(); + if (message.cancelPaymentRequestMessage != null && Object.hasOwnProperty.call(message, "cancelPaymentRequestMessage")) + $root.proto.CancelPaymentRequestMessage.encode(message.cancelPaymentRequestMessage, writer.uint32(/* id 24, wireType 2 =*/194).fork()).ldelim(); + if (message.templateMessage != null && Object.hasOwnProperty.call(message, "templateMessage")) + $root.proto.TemplateMessage.encode(message.templateMessage, writer.uint32(/* id 25, wireType 2 =*/202).fork()).ldelim(); + if (message.stickerMessage != null && Object.hasOwnProperty.call(message, "stickerMessage")) + $root.proto.StickerMessage.encode(message.stickerMessage, writer.uint32(/* id 26, wireType 2 =*/210).fork()).ldelim(); + if (message.groupInviteMessage != null && Object.hasOwnProperty.call(message, "groupInviteMessage")) + $root.proto.GroupInviteMessage.encode(message.groupInviteMessage, writer.uint32(/* id 28, wireType 2 =*/226).fork()).ldelim(); + if (message.templateButtonReplyMessage != null && Object.hasOwnProperty.call(message, "templateButtonReplyMessage")) + $root.proto.TemplateButtonReplyMessage.encode(message.templateButtonReplyMessage, writer.uint32(/* id 29, wireType 2 =*/234).fork()).ldelim(); + if (message.productMessage != null && Object.hasOwnProperty.call(message, "productMessage")) + $root.proto.ProductMessage.encode(message.productMessage, writer.uint32(/* id 30, wireType 2 =*/242).fork()).ldelim(); + if (message.deviceSentMessage != null && Object.hasOwnProperty.call(message, "deviceSentMessage")) + $root.proto.DeviceSentMessage.encode(message.deviceSentMessage, writer.uint32(/* id 31, wireType 2 =*/250).fork()).ldelim(); + if (message.messageContextInfo != null && Object.hasOwnProperty.call(message, "messageContextInfo")) + $root.proto.MessageContextInfo.encode(message.messageContextInfo, writer.uint32(/* id 35, wireType 2 =*/282).fork()).ldelim(); + if (message.listMessage != null && Object.hasOwnProperty.call(message, "listMessage")) + $root.proto.ListMessage.encode(message.listMessage, writer.uint32(/* id 36, wireType 2 =*/290).fork()).ldelim(); + if (message.viewOnceMessage != null && Object.hasOwnProperty.call(message, "viewOnceMessage")) + $root.proto.FutureProofMessage.encode(message.viewOnceMessage, writer.uint32(/* id 37, wireType 2 =*/298).fork()).ldelim(); + if (message.orderMessage != null && Object.hasOwnProperty.call(message, "orderMessage")) + $root.proto.OrderMessage.encode(message.orderMessage, writer.uint32(/* id 38, wireType 2 =*/306).fork()).ldelim(); + if (message.listResponseMessage != null && Object.hasOwnProperty.call(message, "listResponseMessage")) + $root.proto.ListResponseMessage.encode(message.listResponseMessage, writer.uint32(/* id 39, wireType 2 =*/314).fork()).ldelim(); + if (message.ephemeralMessage != null && Object.hasOwnProperty.call(message, "ephemeralMessage")) + $root.proto.FutureProofMessage.encode(message.ephemeralMessage, writer.uint32(/* id 40, wireType 2 =*/322).fork()).ldelim(); + if (message.invoiceMessage != null && Object.hasOwnProperty.call(message, "invoiceMessage")) + $root.proto.InvoiceMessage.encode(message.invoiceMessage, writer.uint32(/* id 41, wireType 2 =*/330).fork()).ldelim(); + if (message.buttonsMessage != null && Object.hasOwnProperty.call(message, "buttonsMessage")) + $root.proto.ButtonsMessage.encode(message.buttonsMessage, writer.uint32(/* id 42, wireType 2 =*/338).fork()).ldelim(); + if (message.buttonsResponseMessage != null && Object.hasOwnProperty.call(message, "buttonsResponseMessage")) + $root.proto.ButtonsResponseMessage.encode(message.buttonsResponseMessage, writer.uint32(/* id 43, wireType 2 =*/346).fork()).ldelim(); + if (message.paymentInviteMessage != null && Object.hasOwnProperty.call(message, "paymentInviteMessage")) + $root.proto.PaymentInviteMessage.encode(message.paymentInviteMessage, writer.uint32(/* id 44, wireType 2 =*/354).fork()).ldelim(); + if (message.interactiveMessage != null && Object.hasOwnProperty.call(message, "interactiveMessage")) + $root.proto.InteractiveMessage.encode(message.interactiveMessage, writer.uint32(/* id 45, wireType 2 =*/362).fork()).ldelim(); + if (message.reactionMessage != null && Object.hasOwnProperty.call(message, "reactionMessage")) + $root.proto.ReactionMessage.encode(message.reactionMessage, writer.uint32(/* id 46, wireType 2 =*/370).fork()).ldelim(); + if (message.stickerSyncRmrMessage != null && Object.hasOwnProperty.call(message, "stickerSyncRmrMessage")) + $root.proto.StickerSyncRMRMessage.encode(message.stickerSyncRmrMessage, writer.uint32(/* id 47, wireType 2 =*/378).fork()).ldelim(); + if (message.interactiveResponseMessage != null && Object.hasOwnProperty.call(message, "interactiveResponseMessage")) + $root.proto.InteractiveResponseMessage.encode(message.interactiveResponseMessage, writer.uint32(/* id 48, wireType 2 =*/386).fork()).ldelim(); + if (message.pollCreationMessage != null && Object.hasOwnProperty.call(message, "pollCreationMessage")) + $root.proto.PollCreationMessage.encode(message.pollCreationMessage, writer.uint32(/* id 49, wireType 2 =*/394).fork()).ldelim(); + if (message.pollUpdateMessage != null && Object.hasOwnProperty.call(message, "pollUpdateMessage")) + $root.proto.PollUpdateMessage.encode(message.pollUpdateMessage, writer.uint32(/* id 50, wireType 2 =*/402).fork()).ldelim(); return writer; }; /** - * Encodes the specified MessageContextInfo message, length delimited. Does not implicitly {@link proto.MessageContextInfo.verify|verify} messages. + * Encodes the specified Message message, length delimited. Does not implicitly {@link proto.Message.verify|verify} messages. * @function encodeDelimited - * @memberof proto.MessageContextInfo + * @memberof proto.Message * @static - * @param {proto.IMessageContextInfo} message MessageContextInfo message or plain object to encode + * @param {proto.IMessage} message Message message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - MessageContextInfo.encodeDelimited = function encodeDelimited(message, writer) { + Message.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a MessageContextInfo message from the specified reader or buffer. + * Decodes a Message message from the specified reader or buffer. * @function decode - * @memberof proto.MessageContextInfo + * @memberof proto.Message * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {proto.MessageContextInfo} MessageContextInfo + * @returns {proto.Message} Message * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - MessageContextInfo.decode = function decode(reader, length) { + Message.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.MessageContextInfo(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.Message(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.deviceListMetadata = $root.proto.DeviceListMetadata.decode(reader, reader.uint32()); + message.conversation = reader.string(); break; case 2: - message.deviceListMetadataVersion = reader.int32(); + message.senderKeyDistributionMessage = $root.proto.SenderKeyDistributionMessage.decode(reader, reader.uint32()); + break; + case 3: + message.imageMessage = $root.proto.ImageMessage.decode(reader, reader.uint32()); + break; + case 4: + message.contactMessage = $root.proto.ContactMessage.decode(reader, reader.uint32()); + break; + case 5: + message.locationMessage = $root.proto.LocationMessage.decode(reader, reader.uint32()); + break; + case 6: + message.extendedTextMessage = $root.proto.ExtendedTextMessage.decode(reader, reader.uint32()); + break; + case 7: + message.documentMessage = $root.proto.DocumentMessage.decode(reader, reader.uint32()); + break; + case 8: + message.audioMessage = $root.proto.AudioMessage.decode(reader, reader.uint32()); + break; + case 9: + message.videoMessage = $root.proto.VideoMessage.decode(reader, reader.uint32()); + break; + case 10: + message.call = $root.proto.Call.decode(reader, reader.uint32()); + break; + case 11: + message.chat = $root.proto.Chat.decode(reader, reader.uint32()); + break; + case 12: + message.protocolMessage = $root.proto.ProtocolMessage.decode(reader, reader.uint32()); + break; + case 13: + message.contactsArrayMessage = $root.proto.ContactsArrayMessage.decode(reader, reader.uint32()); + break; + case 14: + message.highlyStructuredMessage = $root.proto.HighlyStructuredMessage.decode(reader, reader.uint32()); + break; + case 15: + message.fastRatchetKeySenderKeyDistributionMessage = $root.proto.SenderKeyDistributionMessage.decode(reader, reader.uint32()); + break; + case 16: + message.sendPaymentMessage = $root.proto.SendPaymentMessage.decode(reader, reader.uint32()); + break; + case 18: + message.liveLocationMessage = $root.proto.LiveLocationMessage.decode(reader, reader.uint32()); + break; + case 22: + message.requestPaymentMessage = $root.proto.RequestPaymentMessage.decode(reader, reader.uint32()); + break; + case 23: + message.declinePaymentRequestMessage = $root.proto.DeclinePaymentRequestMessage.decode(reader, reader.uint32()); + break; + case 24: + message.cancelPaymentRequestMessage = $root.proto.CancelPaymentRequestMessage.decode(reader, reader.uint32()); + break; + case 25: + message.templateMessage = $root.proto.TemplateMessage.decode(reader, reader.uint32()); + break; + case 26: + message.stickerMessage = $root.proto.StickerMessage.decode(reader, reader.uint32()); + break; + case 28: + message.groupInviteMessage = $root.proto.GroupInviteMessage.decode(reader, reader.uint32()); + break; + case 29: + message.templateButtonReplyMessage = $root.proto.TemplateButtonReplyMessage.decode(reader, reader.uint32()); + break; + case 30: + message.productMessage = $root.proto.ProductMessage.decode(reader, reader.uint32()); + break; + case 31: + message.deviceSentMessage = $root.proto.DeviceSentMessage.decode(reader, reader.uint32()); + break; + case 35: + message.messageContextInfo = $root.proto.MessageContextInfo.decode(reader, reader.uint32()); + break; + case 36: + message.listMessage = $root.proto.ListMessage.decode(reader, reader.uint32()); + break; + case 37: + message.viewOnceMessage = $root.proto.FutureProofMessage.decode(reader, reader.uint32()); + break; + case 38: + message.orderMessage = $root.proto.OrderMessage.decode(reader, reader.uint32()); + break; + case 39: + message.listResponseMessage = $root.proto.ListResponseMessage.decode(reader, reader.uint32()); + break; + case 40: + message.ephemeralMessage = $root.proto.FutureProofMessage.decode(reader, reader.uint32()); + break; + case 41: + message.invoiceMessage = $root.proto.InvoiceMessage.decode(reader, reader.uint32()); + break; + case 42: + message.buttonsMessage = $root.proto.ButtonsMessage.decode(reader, reader.uint32()); + break; + case 43: + message.buttonsResponseMessage = $root.proto.ButtonsResponseMessage.decode(reader, reader.uint32()); + break; + case 44: + message.paymentInviteMessage = $root.proto.PaymentInviteMessage.decode(reader, reader.uint32()); + break; + case 45: + message.interactiveMessage = $root.proto.InteractiveMessage.decode(reader, reader.uint32()); + break; + case 46: + message.reactionMessage = $root.proto.ReactionMessage.decode(reader, reader.uint32()); + break; + case 47: + message.stickerSyncRmrMessage = $root.proto.StickerSyncRMRMessage.decode(reader, reader.uint32()); + break; + case 48: + message.interactiveResponseMessage = $root.proto.InteractiveResponseMessage.decode(reader, reader.uint32()); + break; + case 49: + message.pollCreationMessage = $root.proto.PollCreationMessage.decode(reader, reader.uint32()); + break; + case 50: + message.pollUpdateMessage = $root.proto.PollUpdateMessage.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -21331,239 +21969,731 @@ $root.proto = (function() { }; /** - * Decodes a MessageContextInfo message from the specified reader or buffer, length delimited. + * Decodes a Message message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof proto.MessageContextInfo + * @memberof proto.Message * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.MessageContextInfo} MessageContextInfo + * @returns {proto.Message} Message * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - MessageContextInfo.decodeDelimited = function decodeDelimited(reader) { + Message.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a MessageContextInfo message. + * Verifies a Message message. * @function verify - * @memberof proto.MessageContextInfo + * @memberof proto.Message * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - MessageContextInfo.verify = function verify(message) { + Message.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.deviceListMetadata != null && message.hasOwnProperty("deviceListMetadata")) { - var error = $root.proto.DeviceListMetadata.verify(message.deviceListMetadata); + if (message.conversation != null && message.hasOwnProperty("conversation")) + if (!$util.isString(message.conversation)) + return "conversation: string expected"; + if (message.senderKeyDistributionMessage != null && message.hasOwnProperty("senderKeyDistributionMessage")) { + var error = $root.proto.SenderKeyDistributionMessage.verify(message.senderKeyDistributionMessage); if (error) - return "deviceListMetadata." + error; + return "senderKeyDistributionMessage." + error; } - if (message.deviceListMetadataVersion != null && message.hasOwnProperty("deviceListMetadataVersion")) - if (!$util.isInteger(message.deviceListMetadataVersion)) - return "deviceListMetadataVersion: integer expected"; - return null; - }; - - /** - * Creates a MessageContextInfo message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof proto.MessageContextInfo - * @static - * @param {Object.} object Plain object - * @returns {proto.MessageContextInfo} MessageContextInfo - */ - MessageContextInfo.fromObject = function fromObject(object) { - if (object instanceof $root.proto.MessageContextInfo) - return object; - var message = new $root.proto.MessageContextInfo(); - if (object.deviceListMetadata != null) { - if (typeof object.deviceListMetadata !== "object") - throw TypeError(".proto.MessageContextInfo.deviceListMetadata: object expected"); - message.deviceListMetadata = $root.proto.DeviceListMetadata.fromObject(object.deviceListMetadata); + if (message.imageMessage != null && message.hasOwnProperty("imageMessage")) { + var error = $root.proto.ImageMessage.verify(message.imageMessage); + if (error) + return "imageMessage." + error; + } + if (message.contactMessage != null && message.hasOwnProperty("contactMessage")) { + var error = $root.proto.ContactMessage.verify(message.contactMessage); + if (error) + return "contactMessage." + error; + } + if (message.locationMessage != null && message.hasOwnProperty("locationMessage")) { + var error = $root.proto.LocationMessage.verify(message.locationMessage); + if (error) + return "locationMessage." + error; + } + if (message.extendedTextMessage != null && message.hasOwnProperty("extendedTextMessage")) { + var error = $root.proto.ExtendedTextMessage.verify(message.extendedTextMessage); + if (error) + return "extendedTextMessage." + error; + } + if (message.documentMessage != null && message.hasOwnProperty("documentMessage")) { + var error = $root.proto.DocumentMessage.verify(message.documentMessage); + if (error) + return "documentMessage." + error; + } + if (message.audioMessage != null && message.hasOwnProperty("audioMessage")) { + var error = $root.proto.AudioMessage.verify(message.audioMessage); + if (error) + return "audioMessage." + error; + } + if (message.videoMessage != null && message.hasOwnProperty("videoMessage")) { + var error = $root.proto.VideoMessage.verify(message.videoMessage); + if (error) + return "videoMessage." + error; + } + if (message.call != null && message.hasOwnProperty("call")) { + var error = $root.proto.Call.verify(message.call); + if (error) + return "call." + error; + } + if (message.chat != null && message.hasOwnProperty("chat")) { + var error = $root.proto.Chat.verify(message.chat); + if (error) + return "chat." + error; + } + if (message.protocolMessage != null && message.hasOwnProperty("protocolMessage")) { + var error = $root.proto.ProtocolMessage.verify(message.protocolMessage); + if (error) + return "protocolMessage." + error; + } + if (message.contactsArrayMessage != null && message.hasOwnProperty("contactsArrayMessage")) { + var error = $root.proto.ContactsArrayMessage.verify(message.contactsArrayMessage); + if (error) + return "contactsArrayMessage." + error; + } + if (message.highlyStructuredMessage != null && message.hasOwnProperty("highlyStructuredMessage")) { + var error = $root.proto.HighlyStructuredMessage.verify(message.highlyStructuredMessage); + if (error) + return "highlyStructuredMessage." + error; + } + if (message.fastRatchetKeySenderKeyDistributionMessage != null && message.hasOwnProperty("fastRatchetKeySenderKeyDistributionMessage")) { + var error = $root.proto.SenderKeyDistributionMessage.verify(message.fastRatchetKeySenderKeyDistributionMessage); + if (error) + return "fastRatchetKeySenderKeyDistributionMessage." + error; + } + if (message.sendPaymentMessage != null && message.hasOwnProperty("sendPaymentMessage")) { + var error = $root.proto.SendPaymentMessage.verify(message.sendPaymentMessage); + if (error) + return "sendPaymentMessage." + error; + } + if (message.liveLocationMessage != null && message.hasOwnProperty("liveLocationMessage")) { + var error = $root.proto.LiveLocationMessage.verify(message.liveLocationMessage); + if (error) + return "liveLocationMessage." + error; + } + if (message.requestPaymentMessage != null && message.hasOwnProperty("requestPaymentMessage")) { + var error = $root.proto.RequestPaymentMessage.verify(message.requestPaymentMessage); + if (error) + return "requestPaymentMessage." + error; + } + if (message.declinePaymentRequestMessage != null && message.hasOwnProperty("declinePaymentRequestMessage")) { + var error = $root.proto.DeclinePaymentRequestMessage.verify(message.declinePaymentRequestMessage); + if (error) + return "declinePaymentRequestMessage." + error; + } + if (message.cancelPaymentRequestMessage != null && message.hasOwnProperty("cancelPaymentRequestMessage")) { + var error = $root.proto.CancelPaymentRequestMessage.verify(message.cancelPaymentRequestMessage); + if (error) + return "cancelPaymentRequestMessage." + error; + } + if (message.templateMessage != null && message.hasOwnProperty("templateMessage")) { + var error = $root.proto.TemplateMessage.verify(message.templateMessage); + if (error) + return "templateMessage." + error; + } + if (message.stickerMessage != null && message.hasOwnProperty("stickerMessage")) { + var error = $root.proto.StickerMessage.verify(message.stickerMessage); + if (error) + return "stickerMessage." + error; + } + if (message.groupInviteMessage != null && message.hasOwnProperty("groupInviteMessage")) { + var error = $root.proto.GroupInviteMessage.verify(message.groupInviteMessage); + if (error) + return "groupInviteMessage." + error; + } + if (message.templateButtonReplyMessage != null && message.hasOwnProperty("templateButtonReplyMessage")) { + var error = $root.proto.TemplateButtonReplyMessage.verify(message.templateButtonReplyMessage); + if (error) + return "templateButtonReplyMessage." + error; + } + if (message.productMessage != null && message.hasOwnProperty("productMessage")) { + var error = $root.proto.ProductMessage.verify(message.productMessage); + if (error) + return "productMessage." + error; + } + if (message.deviceSentMessage != null && message.hasOwnProperty("deviceSentMessage")) { + var error = $root.proto.DeviceSentMessage.verify(message.deviceSentMessage); + if (error) + return "deviceSentMessage." + error; + } + if (message.messageContextInfo != null && message.hasOwnProperty("messageContextInfo")) { + var error = $root.proto.MessageContextInfo.verify(message.messageContextInfo); + if (error) + return "messageContextInfo." + error; + } + if (message.listMessage != null && message.hasOwnProperty("listMessage")) { + var error = $root.proto.ListMessage.verify(message.listMessage); + if (error) + return "listMessage." + error; + } + if (message.viewOnceMessage != null && message.hasOwnProperty("viewOnceMessage")) { + var error = $root.proto.FutureProofMessage.verify(message.viewOnceMessage); + if (error) + return "viewOnceMessage." + error; + } + if (message.orderMessage != null && message.hasOwnProperty("orderMessage")) { + var error = $root.proto.OrderMessage.verify(message.orderMessage); + if (error) + return "orderMessage." + error; + } + if (message.listResponseMessage != null && message.hasOwnProperty("listResponseMessage")) { + var error = $root.proto.ListResponseMessage.verify(message.listResponseMessage); + if (error) + return "listResponseMessage." + error; + } + if (message.ephemeralMessage != null && message.hasOwnProperty("ephemeralMessage")) { + var error = $root.proto.FutureProofMessage.verify(message.ephemeralMessage); + if (error) + return "ephemeralMessage." + error; + } + if (message.invoiceMessage != null && message.hasOwnProperty("invoiceMessage")) { + var error = $root.proto.InvoiceMessage.verify(message.invoiceMessage); + if (error) + return "invoiceMessage." + error; + } + if (message.buttonsMessage != null && message.hasOwnProperty("buttonsMessage")) { + var error = $root.proto.ButtonsMessage.verify(message.buttonsMessage); + if (error) + return "buttonsMessage." + error; + } + if (message.buttonsResponseMessage != null && message.hasOwnProperty("buttonsResponseMessage")) { + var error = $root.proto.ButtonsResponseMessage.verify(message.buttonsResponseMessage); + if (error) + return "buttonsResponseMessage." + error; + } + if (message.paymentInviteMessage != null && message.hasOwnProperty("paymentInviteMessage")) { + var error = $root.proto.PaymentInviteMessage.verify(message.paymentInviteMessage); + if (error) + return "paymentInviteMessage." + error; + } + if (message.interactiveMessage != null && message.hasOwnProperty("interactiveMessage")) { + var error = $root.proto.InteractiveMessage.verify(message.interactiveMessage); + if (error) + return "interactiveMessage." + error; + } + if (message.reactionMessage != null && message.hasOwnProperty("reactionMessage")) { + var error = $root.proto.ReactionMessage.verify(message.reactionMessage); + if (error) + return "reactionMessage." + error; + } + if (message.stickerSyncRmrMessage != null && message.hasOwnProperty("stickerSyncRmrMessage")) { + var error = $root.proto.StickerSyncRMRMessage.verify(message.stickerSyncRmrMessage); + if (error) + return "stickerSyncRmrMessage." + error; + } + if (message.interactiveResponseMessage != null && message.hasOwnProperty("interactiveResponseMessage")) { + var error = $root.proto.InteractiveResponseMessage.verify(message.interactiveResponseMessage); + if (error) + return "interactiveResponseMessage." + error; + } + if (message.pollCreationMessage != null && message.hasOwnProperty("pollCreationMessage")) { + var error = $root.proto.PollCreationMessage.verify(message.pollCreationMessage); + if (error) + return "pollCreationMessage." + error; + } + if (message.pollUpdateMessage != null && message.hasOwnProperty("pollUpdateMessage")) { + var error = $root.proto.PollUpdateMessage.verify(message.pollUpdateMessage); + if (error) + return "pollUpdateMessage." + error; + } + return null; + }; + + /** + * Creates a Message message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof proto.Message + * @static + * @param {Object.} object Plain object + * @returns {proto.Message} Message + */ + Message.fromObject = function fromObject(object) { + if (object instanceof $root.proto.Message) + return object; + var message = new $root.proto.Message(); + if (object.conversation != null) + message.conversation = String(object.conversation); + if (object.senderKeyDistributionMessage != null) { + if (typeof object.senderKeyDistributionMessage !== "object") + throw TypeError(".proto.Message.senderKeyDistributionMessage: object expected"); + message.senderKeyDistributionMessage = $root.proto.SenderKeyDistributionMessage.fromObject(object.senderKeyDistributionMessage); + } + if (object.imageMessage != null) { + if (typeof object.imageMessage !== "object") + throw TypeError(".proto.Message.imageMessage: object expected"); + message.imageMessage = $root.proto.ImageMessage.fromObject(object.imageMessage); + } + if (object.contactMessage != null) { + if (typeof object.contactMessage !== "object") + throw TypeError(".proto.Message.contactMessage: object expected"); + message.contactMessage = $root.proto.ContactMessage.fromObject(object.contactMessage); + } + if (object.locationMessage != null) { + if (typeof object.locationMessage !== "object") + throw TypeError(".proto.Message.locationMessage: object expected"); + message.locationMessage = $root.proto.LocationMessage.fromObject(object.locationMessage); + } + if (object.extendedTextMessage != null) { + if (typeof object.extendedTextMessage !== "object") + throw TypeError(".proto.Message.extendedTextMessage: object expected"); + message.extendedTextMessage = $root.proto.ExtendedTextMessage.fromObject(object.extendedTextMessage); + } + if (object.documentMessage != null) { + if (typeof object.documentMessage !== "object") + throw TypeError(".proto.Message.documentMessage: object expected"); + message.documentMessage = $root.proto.DocumentMessage.fromObject(object.documentMessage); + } + if (object.audioMessage != null) { + if (typeof object.audioMessage !== "object") + throw TypeError(".proto.Message.audioMessage: object expected"); + message.audioMessage = $root.proto.AudioMessage.fromObject(object.audioMessage); + } + if (object.videoMessage != null) { + if (typeof object.videoMessage !== "object") + throw TypeError(".proto.Message.videoMessage: object expected"); + message.videoMessage = $root.proto.VideoMessage.fromObject(object.videoMessage); + } + if (object.call != null) { + if (typeof object.call !== "object") + throw TypeError(".proto.Message.call: object expected"); + message.call = $root.proto.Call.fromObject(object.call); + } + if (object.chat != null) { + if (typeof object.chat !== "object") + throw TypeError(".proto.Message.chat: object expected"); + message.chat = $root.proto.Chat.fromObject(object.chat); + } + if (object.protocolMessage != null) { + if (typeof object.protocolMessage !== "object") + throw TypeError(".proto.Message.protocolMessage: object expected"); + message.protocolMessage = $root.proto.ProtocolMessage.fromObject(object.protocolMessage); + } + if (object.contactsArrayMessage != null) { + if (typeof object.contactsArrayMessage !== "object") + throw TypeError(".proto.Message.contactsArrayMessage: object expected"); + message.contactsArrayMessage = $root.proto.ContactsArrayMessage.fromObject(object.contactsArrayMessage); + } + if (object.highlyStructuredMessage != null) { + if (typeof object.highlyStructuredMessage !== "object") + throw TypeError(".proto.Message.highlyStructuredMessage: object expected"); + message.highlyStructuredMessage = $root.proto.HighlyStructuredMessage.fromObject(object.highlyStructuredMessage); + } + if (object.fastRatchetKeySenderKeyDistributionMessage != null) { + if (typeof object.fastRatchetKeySenderKeyDistributionMessage !== "object") + throw TypeError(".proto.Message.fastRatchetKeySenderKeyDistributionMessage: object expected"); + message.fastRatchetKeySenderKeyDistributionMessage = $root.proto.SenderKeyDistributionMessage.fromObject(object.fastRatchetKeySenderKeyDistributionMessage); + } + if (object.sendPaymentMessage != null) { + if (typeof object.sendPaymentMessage !== "object") + throw TypeError(".proto.Message.sendPaymentMessage: object expected"); + message.sendPaymentMessage = $root.proto.SendPaymentMessage.fromObject(object.sendPaymentMessage); + } + if (object.liveLocationMessage != null) { + if (typeof object.liveLocationMessage !== "object") + throw TypeError(".proto.Message.liveLocationMessage: object expected"); + message.liveLocationMessage = $root.proto.LiveLocationMessage.fromObject(object.liveLocationMessage); + } + if (object.requestPaymentMessage != null) { + if (typeof object.requestPaymentMessage !== "object") + throw TypeError(".proto.Message.requestPaymentMessage: object expected"); + message.requestPaymentMessage = $root.proto.RequestPaymentMessage.fromObject(object.requestPaymentMessage); + } + if (object.declinePaymentRequestMessage != null) { + if (typeof object.declinePaymentRequestMessage !== "object") + throw TypeError(".proto.Message.declinePaymentRequestMessage: object expected"); + message.declinePaymentRequestMessage = $root.proto.DeclinePaymentRequestMessage.fromObject(object.declinePaymentRequestMessage); + } + if (object.cancelPaymentRequestMessage != null) { + if (typeof object.cancelPaymentRequestMessage !== "object") + throw TypeError(".proto.Message.cancelPaymentRequestMessage: object expected"); + message.cancelPaymentRequestMessage = $root.proto.CancelPaymentRequestMessage.fromObject(object.cancelPaymentRequestMessage); + } + if (object.templateMessage != null) { + if (typeof object.templateMessage !== "object") + throw TypeError(".proto.Message.templateMessage: object expected"); + message.templateMessage = $root.proto.TemplateMessage.fromObject(object.templateMessage); + } + if (object.stickerMessage != null) { + if (typeof object.stickerMessage !== "object") + throw TypeError(".proto.Message.stickerMessage: object expected"); + message.stickerMessage = $root.proto.StickerMessage.fromObject(object.stickerMessage); + } + if (object.groupInviteMessage != null) { + if (typeof object.groupInviteMessage !== "object") + throw TypeError(".proto.Message.groupInviteMessage: object expected"); + message.groupInviteMessage = $root.proto.GroupInviteMessage.fromObject(object.groupInviteMessage); + } + if (object.templateButtonReplyMessage != null) { + if (typeof object.templateButtonReplyMessage !== "object") + throw TypeError(".proto.Message.templateButtonReplyMessage: object expected"); + message.templateButtonReplyMessage = $root.proto.TemplateButtonReplyMessage.fromObject(object.templateButtonReplyMessage); + } + if (object.productMessage != null) { + if (typeof object.productMessage !== "object") + throw TypeError(".proto.Message.productMessage: object expected"); + message.productMessage = $root.proto.ProductMessage.fromObject(object.productMessage); + } + if (object.deviceSentMessage != null) { + if (typeof object.deviceSentMessage !== "object") + throw TypeError(".proto.Message.deviceSentMessage: object expected"); + message.deviceSentMessage = $root.proto.DeviceSentMessage.fromObject(object.deviceSentMessage); + } + if (object.messageContextInfo != null) { + if (typeof object.messageContextInfo !== "object") + throw TypeError(".proto.Message.messageContextInfo: object expected"); + message.messageContextInfo = $root.proto.MessageContextInfo.fromObject(object.messageContextInfo); + } + if (object.listMessage != null) { + if (typeof object.listMessage !== "object") + throw TypeError(".proto.Message.listMessage: object expected"); + message.listMessage = $root.proto.ListMessage.fromObject(object.listMessage); + } + if (object.viewOnceMessage != null) { + if (typeof object.viewOnceMessage !== "object") + throw TypeError(".proto.Message.viewOnceMessage: object expected"); + message.viewOnceMessage = $root.proto.FutureProofMessage.fromObject(object.viewOnceMessage); + } + if (object.orderMessage != null) { + if (typeof object.orderMessage !== "object") + throw TypeError(".proto.Message.orderMessage: object expected"); + message.orderMessage = $root.proto.OrderMessage.fromObject(object.orderMessage); + } + if (object.listResponseMessage != null) { + if (typeof object.listResponseMessage !== "object") + throw TypeError(".proto.Message.listResponseMessage: object expected"); + message.listResponseMessage = $root.proto.ListResponseMessage.fromObject(object.listResponseMessage); + } + if (object.ephemeralMessage != null) { + if (typeof object.ephemeralMessage !== "object") + throw TypeError(".proto.Message.ephemeralMessage: object expected"); + message.ephemeralMessage = $root.proto.FutureProofMessage.fromObject(object.ephemeralMessage); + } + if (object.invoiceMessage != null) { + if (typeof object.invoiceMessage !== "object") + throw TypeError(".proto.Message.invoiceMessage: object expected"); + message.invoiceMessage = $root.proto.InvoiceMessage.fromObject(object.invoiceMessage); + } + if (object.buttonsMessage != null) { + if (typeof object.buttonsMessage !== "object") + throw TypeError(".proto.Message.buttonsMessage: object expected"); + message.buttonsMessage = $root.proto.ButtonsMessage.fromObject(object.buttonsMessage); + } + if (object.buttonsResponseMessage != null) { + if (typeof object.buttonsResponseMessage !== "object") + throw TypeError(".proto.Message.buttonsResponseMessage: object expected"); + message.buttonsResponseMessage = $root.proto.ButtonsResponseMessage.fromObject(object.buttonsResponseMessage); + } + if (object.paymentInviteMessage != null) { + if (typeof object.paymentInviteMessage !== "object") + throw TypeError(".proto.Message.paymentInviteMessage: object expected"); + message.paymentInviteMessage = $root.proto.PaymentInviteMessage.fromObject(object.paymentInviteMessage); + } + if (object.interactiveMessage != null) { + if (typeof object.interactiveMessage !== "object") + throw TypeError(".proto.Message.interactiveMessage: object expected"); + message.interactiveMessage = $root.proto.InteractiveMessage.fromObject(object.interactiveMessage); + } + if (object.reactionMessage != null) { + if (typeof object.reactionMessage !== "object") + throw TypeError(".proto.Message.reactionMessage: object expected"); + message.reactionMessage = $root.proto.ReactionMessage.fromObject(object.reactionMessage); + } + if (object.stickerSyncRmrMessage != null) { + if (typeof object.stickerSyncRmrMessage !== "object") + throw TypeError(".proto.Message.stickerSyncRmrMessage: object expected"); + message.stickerSyncRmrMessage = $root.proto.StickerSyncRMRMessage.fromObject(object.stickerSyncRmrMessage); + } + if (object.interactiveResponseMessage != null) { + if (typeof object.interactiveResponseMessage !== "object") + throw TypeError(".proto.Message.interactiveResponseMessage: object expected"); + message.interactiveResponseMessage = $root.proto.InteractiveResponseMessage.fromObject(object.interactiveResponseMessage); + } + if (object.pollCreationMessage != null) { + if (typeof object.pollCreationMessage !== "object") + throw TypeError(".proto.Message.pollCreationMessage: object expected"); + message.pollCreationMessage = $root.proto.PollCreationMessage.fromObject(object.pollCreationMessage); + } + if (object.pollUpdateMessage != null) { + if (typeof object.pollUpdateMessage !== "object") + throw TypeError(".proto.Message.pollUpdateMessage: object expected"); + message.pollUpdateMessage = $root.proto.PollUpdateMessage.fromObject(object.pollUpdateMessage); } - if (object.deviceListMetadataVersion != null) - message.deviceListMetadataVersion = object.deviceListMetadataVersion | 0; return message; }; /** - * Creates a plain object from a MessageContextInfo message. Also converts values to other types if specified. + * Creates a plain object from a Message message. Also converts values to other types if specified. * @function toObject - * @memberof proto.MessageContextInfo + * @memberof proto.Message * @static - * @param {proto.MessageContextInfo} message MessageContextInfo + * @param {proto.Message} message Message * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - MessageContextInfo.toObject = function toObject(message, options) { + Message.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.deviceListMetadata = null; - object.deviceListMetadataVersion = 0; + object.conversation = ""; + object.senderKeyDistributionMessage = null; + object.imageMessage = null; + object.contactMessage = null; + object.locationMessage = null; + object.extendedTextMessage = null; + object.documentMessage = null; + object.audioMessage = null; + object.videoMessage = null; + object.call = null; + object.chat = null; + object.protocolMessage = null; + object.contactsArrayMessage = null; + object.highlyStructuredMessage = null; + object.fastRatchetKeySenderKeyDistributionMessage = null; + object.sendPaymentMessage = null; + object.liveLocationMessage = null; + object.requestPaymentMessage = null; + object.declinePaymentRequestMessage = null; + object.cancelPaymentRequestMessage = null; + object.templateMessage = null; + object.stickerMessage = null; + object.groupInviteMessage = null; + object.templateButtonReplyMessage = null; + object.productMessage = null; + object.deviceSentMessage = null; + object.messageContextInfo = null; + object.listMessage = null; + object.viewOnceMessage = null; + object.orderMessage = null; + object.listResponseMessage = null; + object.ephemeralMessage = null; + object.invoiceMessage = null; + object.buttonsMessage = null; + object.buttonsResponseMessage = null; + object.paymentInviteMessage = null; + object.interactiveMessage = null; + object.reactionMessage = null; + object.stickerSyncRmrMessage = null; + object.interactiveResponseMessage = null; + object.pollCreationMessage = null; + object.pollUpdateMessage = null; } - if (message.deviceListMetadata != null && message.hasOwnProperty("deviceListMetadata")) - object.deviceListMetadata = $root.proto.DeviceListMetadata.toObject(message.deviceListMetadata, options); - if (message.deviceListMetadataVersion != null && message.hasOwnProperty("deviceListMetadataVersion")) - object.deviceListMetadataVersion = message.deviceListMetadataVersion; - return object; - }; - - /** - * Converts this MessageContextInfo to JSON. - * @function toJSON - * @memberof proto.MessageContextInfo - * @instance - * @returns {Object.} JSON object - */ - MessageContextInfo.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return MessageContextInfo; - })(); - - proto.AdReplyInfo = (function() { - - /** - * Properties of an AdReplyInfo. - * @memberof proto - * @interface IAdReplyInfo - * @property {string|null} [advertiserName] AdReplyInfo advertiserName - * @property {proto.AdReplyInfo.AdReplyInfoMediaType|null} [mediaType] AdReplyInfo mediaType - * @property {Uint8Array|null} [jpegThumbnail] AdReplyInfo jpegThumbnail - * @property {string|null} [caption] AdReplyInfo caption - */ - - /** - * Constructs a new AdReplyInfo. - * @memberof proto - * @classdesc Represents an AdReplyInfo. - * @implements IAdReplyInfo - * @constructor - * @param {proto.IAdReplyInfo=} [properties] Properties to set - */ - function AdReplyInfo(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * AdReplyInfo advertiserName. - * @member {string} advertiserName - * @memberof proto.AdReplyInfo - * @instance - */ - AdReplyInfo.prototype.advertiserName = ""; - + if (message.conversation != null && message.hasOwnProperty("conversation")) + object.conversation = message.conversation; + if (message.senderKeyDistributionMessage != null && message.hasOwnProperty("senderKeyDistributionMessage")) + object.senderKeyDistributionMessage = $root.proto.SenderKeyDistributionMessage.toObject(message.senderKeyDistributionMessage, options); + if (message.imageMessage != null && message.hasOwnProperty("imageMessage")) + object.imageMessage = $root.proto.ImageMessage.toObject(message.imageMessage, options); + if (message.contactMessage != null && message.hasOwnProperty("contactMessage")) + object.contactMessage = $root.proto.ContactMessage.toObject(message.contactMessage, options); + if (message.locationMessage != null && message.hasOwnProperty("locationMessage")) + object.locationMessage = $root.proto.LocationMessage.toObject(message.locationMessage, options); + if (message.extendedTextMessage != null && message.hasOwnProperty("extendedTextMessage")) + object.extendedTextMessage = $root.proto.ExtendedTextMessage.toObject(message.extendedTextMessage, options); + if (message.documentMessage != null && message.hasOwnProperty("documentMessage")) + object.documentMessage = $root.proto.DocumentMessage.toObject(message.documentMessage, options); + if (message.audioMessage != null && message.hasOwnProperty("audioMessage")) + object.audioMessage = $root.proto.AudioMessage.toObject(message.audioMessage, options); + if (message.videoMessage != null && message.hasOwnProperty("videoMessage")) + object.videoMessage = $root.proto.VideoMessage.toObject(message.videoMessage, options); + if (message.call != null && message.hasOwnProperty("call")) + object.call = $root.proto.Call.toObject(message.call, options); + if (message.chat != null && message.hasOwnProperty("chat")) + object.chat = $root.proto.Chat.toObject(message.chat, options); + if (message.protocolMessage != null && message.hasOwnProperty("protocolMessage")) + object.protocolMessage = $root.proto.ProtocolMessage.toObject(message.protocolMessage, options); + if (message.contactsArrayMessage != null && message.hasOwnProperty("contactsArrayMessage")) + object.contactsArrayMessage = $root.proto.ContactsArrayMessage.toObject(message.contactsArrayMessage, options); + if (message.highlyStructuredMessage != null && message.hasOwnProperty("highlyStructuredMessage")) + object.highlyStructuredMessage = $root.proto.HighlyStructuredMessage.toObject(message.highlyStructuredMessage, options); + if (message.fastRatchetKeySenderKeyDistributionMessage != null && message.hasOwnProperty("fastRatchetKeySenderKeyDistributionMessage")) + object.fastRatchetKeySenderKeyDistributionMessage = $root.proto.SenderKeyDistributionMessage.toObject(message.fastRatchetKeySenderKeyDistributionMessage, options); + if (message.sendPaymentMessage != null && message.hasOwnProperty("sendPaymentMessage")) + object.sendPaymentMessage = $root.proto.SendPaymentMessage.toObject(message.sendPaymentMessage, options); + if (message.liveLocationMessage != null && message.hasOwnProperty("liveLocationMessage")) + object.liveLocationMessage = $root.proto.LiveLocationMessage.toObject(message.liveLocationMessage, options); + if (message.requestPaymentMessage != null && message.hasOwnProperty("requestPaymentMessage")) + object.requestPaymentMessage = $root.proto.RequestPaymentMessage.toObject(message.requestPaymentMessage, options); + if (message.declinePaymentRequestMessage != null && message.hasOwnProperty("declinePaymentRequestMessage")) + object.declinePaymentRequestMessage = $root.proto.DeclinePaymentRequestMessage.toObject(message.declinePaymentRequestMessage, options); + if (message.cancelPaymentRequestMessage != null && message.hasOwnProperty("cancelPaymentRequestMessage")) + object.cancelPaymentRequestMessage = $root.proto.CancelPaymentRequestMessage.toObject(message.cancelPaymentRequestMessage, options); + if (message.templateMessage != null && message.hasOwnProperty("templateMessage")) + object.templateMessage = $root.proto.TemplateMessage.toObject(message.templateMessage, options); + if (message.stickerMessage != null && message.hasOwnProperty("stickerMessage")) + object.stickerMessage = $root.proto.StickerMessage.toObject(message.stickerMessage, options); + if (message.groupInviteMessage != null && message.hasOwnProperty("groupInviteMessage")) + object.groupInviteMessage = $root.proto.GroupInviteMessage.toObject(message.groupInviteMessage, options); + if (message.templateButtonReplyMessage != null && message.hasOwnProperty("templateButtonReplyMessage")) + object.templateButtonReplyMessage = $root.proto.TemplateButtonReplyMessage.toObject(message.templateButtonReplyMessage, options); + if (message.productMessage != null && message.hasOwnProperty("productMessage")) + object.productMessage = $root.proto.ProductMessage.toObject(message.productMessage, options); + if (message.deviceSentMessage != null && message.hasOwnProperty("deviceSentMessage")) + object.deviceSentMessage = $root.proto.DeviceSentMessage.toObject(message.deviceSentMessage, options); + if (message.messageContextInfo != null && message.hasOwnProperty("messageContextInfo")) + object.messageContextInfo = $root.proto.MessageContextInfo.toObject(message.messageContextInfo, options); + if (message.listMessage != null && message.hasOwnProperty("listMessage")) + object.listMessage = $root.proto.ListMessage.toObject(message.listMessage, options); + if (message.viewOnceMessage != null && message.hasOwnProperty("viewOnceMessage")) + object.viewOnceMessage = $root.proto.FutureProofMessage.toObject(message.viewOnceMessage, options); + if (message.orderMessage != null && message.hasOwnProperty("orderMessage")) + object.orderMessage = $root.proto.OrderMessage.toObject(message.orderMessage, options); + if (message.listResponseMessage != null && message.hasOwnProperty("listResponseMessage")) + object.listResponseMessage = $root.proto.ListResponseMessage.toObject(message.listResponseMessage, options); + if (message.ephemeralMessage != null && message.hasOwnProperty("ephemeralMessage")) + object.ephemeralMessage = $root.proto.FutureProofMessage.toObject(message.ephemeralMessage, options); + if (message.invoiceMessage != null && message.hasOwnProperty("invoiceMessage")) + object.invoiceMessage = $root.proto.InvoiceMessage.toObject(message.invoiceMessage, options); + if (message.buttonsMessage != null && message.hasOwnProperty("buttonsMessage")) + object.buttonsMessage = $root.proto.ButtonsMessage.toObject(message.buttonsMessage, options); + if (message.buttonsResponseMessage != null && message.hasOwnProperty("buttonsResponseMessage")) + object.buttonsResponseMessage = $root.proto.ButtonsResponseMessage.toObject(message.buttonsResponseMessage, options); + if (message.paymentInviteMessage != null && message.hasOwnProperty("paymentInviteMessage")) + object.paymentInviteMessage = $root.proto.PaymentInviteMessage.toObject(message.paymentInviteMessage, options); + if (message.interactiveMessage != null && message.hasOwnProperty("interactiveMessage")) + object.interactiveMessage = $root.proto.InteractiveMessage.toObject(message.interactiveMessage, options); + if (message.reactionMessage != null && message.hasOwnProperty("reactionMessage")) + object.reactionMessage = $root.proto.ReactionMessage.toObject(message.reactionMessage, options); + if (message.stickerSyncRmrMessage != null && message.hasOwnProperty("stickerSyncRmrMessage")) + object.stickerSyncRmrMessage = $root.proto.StickerSyncRMRMessage.toObject(message.stickerSyncRmrMessage, options); + if (message.interactiveResponseMessage != null && message.hasOwnProperty("interactiveResponseMessage")) + object.interactiveResponseMessage = $root.proto.InteractiveResponseMessage.toObject(message.interactiveResponseMessage, options); + if (message.pollCreationMessage != null && message.hasOwnProperty("pollCreationMessage")) + object.pollCreationMessage = $root.proto.PollCreationMessage.toObject(message.pollCreationMessage, options); + if (message.pollUpdateMessage != null && message.hasOwnProperty("pollUpdateMessage")) + object.pollUpdateMessage = $root.proto.PollUpdateMessage.toObject(message.pollUpdateMessage, options); + return object; + }; + /** - * AdReplyInfo mediaType. - * @member {proto.AdReplyInfo.AdReplyInfoMediaType} mediaType - * @memberof proto.AdReplyInfo + * Converts this Message to JSON. + * @function toJSON + * @memberof proto.Message * @instance + * @returns {Object.} JSON object */ - AdReplyInfo.prototype.mediaType = 0; + Message.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Message; + })(); + + proto.MessageContextInfo = (function() { /** - * AdReplyInfo jpegThumbnail. - * @member {Uint8Array} jpegThumbnail - * @memberof proto.AdReplyInfo + * Properties of a MessageContextInfo. + * @memberof proto + * @interface IMessageContextInfo + * @property {proto.IDeviceListMetadata|null} [deviceListMetadata] MessageContextInfo deviceListMetadata + * @property {number|null} [deviceListMetadataVersion] MessageContextInfo deviceListMetadataVersion + */ + + /** + * Constructs a new MessageContextInfo. + * @memberof proto + * @classdesc Represents a MessageContextInfo. + * @implements IMessageContextInfo + * @constructor + * @param {proto.IMessageContextInfo=} [properties] Properties to set + */ + function MessageContextInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MessageContextInfo deviceListMetadata. + * @member {proto.IDeviceListMetadata|null|undefined} deviceListMetadata + * @memberof proto.MessageContextInfo * @instance */ - AdReplyInfo.prototype.jpegThumbnail = $util.newBuffer([]); + MessageContextInfo.prototype.deviceListMetadata = null; /** - * AdReplyInfo caption. - * @member {string} caption - * @memberof proto.AdReplyInfo + * MessageContextInfo deviceListMetadataVersion. + * @member {number} deviceListMetadataVersion + * @memberof proto.MessageContextInfo * @instance */ - AdReplyInfo.prototype.caption = ""; + MessageContextInfo.prototype.deviceListMetadataVersion = 0; /** - * Creates a new AdReplyInfo instance using the specified properties. + * Creates a new MessageContextInfo instance using the specified properties. * @function create - * @memberof proto.AdReplyInfo + * @memberof proto.MessageContextInfo * @static - * @param {proto.IAdReplyInfo=} [properties] Properties to set - * @returns {proto.AdReplyInfo} AdReplyInfo instance + * @param {proto.IMessageContextInfo=} [properties] Properties to set + * @returns {proto.MessageContextInfo} MessageContextInfo instance */ - AdReplyInfo.create = function create(properties) { - return new AdReplyInfo(properties); + MessageContextInfo.create = function create(properties) { + return new MessageContextInfo(properties); }; /** - * Encodes the specified AdReplyInfo message. Does not implicitly {@link proto.AdReplyInfo.verify|verify} messages. + * Encodes the specified MessageContextInfo message. Does not implicitly {@link proto.MessageContextInfo.verify|verify} messages. * @function encode - * @memberof proto.AdReplyInfo + * @memberof proto.MessageContextInfo * @static - * @param {proto.IAdReplyInfo} message AdReplyInfo message or plain object to encode + * @param {proto.IMessageContextInfo} message MessageContextInfo message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AdReplyInfo.encode = function encode(message, writer) { + MessageContextInfo.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.advertiserName != null && Object.hasOwnProperty.call(message, "advertiserName")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.advertiserName); - if (message.mediaType != null && Object.hasOwnProperty.call(message, "mediaType")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.mediaType); - if (message.jpegThumbnail != null && Object.hasOwnProperty.call(message, "jpegThumbnail")) - writer.uint32(/* id 16, wireType 2 =*/130).bytes(message.jpegThumbnail); - if (message.caption != null && Object.hasOwnProperty.call(message, "caption")) - writer.uint32(/* id 17, wireType 2 =*/138).string(message.caption); + if (message.deviceListMetadata != null && Object.hasOwnProperty.call(message, "deviceListMetadata")) + $root.proto.DeviceListMetadata.encode(message.deviceListMetadata, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.deviceListMetadataVersion != null && Object.hasOwnProperty.call(message, "deviceListMetadataVersion")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.deviceListMetadataVersion); return writer; }; /** - * Encodes the specified AdReplyInfo message, length delimited. Does not implicitly {@link proto.AdReplyInfo.verify|verify} messages. + * Encodes the specified MessageContextInfo message, length delimited. Does not implicitly {@link proto.MessageContextInfo.verify|verify} messages. * @function encodeDelimited - * @memberof proto.AdReplyInfo + * @memberof proto.MessageContextInfo * @static - * @param {proto.IAdReplyInfo} message AdReplyInfo message or plain object to encode + * @param {proto.IMessageContextInfo} message MessageContextInfo message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AdReplyInfo.encodeDelimited = function encodeDelimited(message, writer) { + MessageContextInfo.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an AdReplyInfo message from the specified reader or buffer. + * Decodes a MessageContextInfo message from the specified reader or buffer. * @function decode - * @memberof proto.AdReplyInfo + * @memberof proto.MessageContextInfo * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {proto.AdReplyInfo} AdReplyInfo + * @returns {proto.MessageContextInfo} MessageContextInfo * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - AdReplyInfo.decode = function decode(reader, length) { + MessageContextInfo.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.AdReplyInfo(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.MessageContextInfo(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.advertiserName = reader.string(); + message.deviceListMetadata = $root.proto.DeviceListMetadata.decode(reader, reader.uint32()); break; case 2: - message.mediaType = reader.int32(); - break; - case 16: - message.jpegThumbnail = reader.bytes(); - break; - case 17: - message.caption = reader.string(); + message.deviceListMetadataVersion = reader.int32(); break; default: reader.skipType(tag & 7); @@ -21574,184 +22704,123 @@ $root.proto = (function() { }; /** - * Decodes an AdReplyInfo message from the specified reader or buffer, length delimited. + * Decodes a MessageContextInfo message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof proto.AdReplyInfo + * @memberof proto.MessageContextInfo * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.AdReplyInfo} AdReplyInfo + * @returns {proto.MessageContextInfo} MessageContextInfo * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - AdReplyInfo.decodeDelimited = function decodeDelimited(reader) { + MessageContextInfo.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an AdReplyInfo message. + * Verifies a MessageContextInfo message. * @function verify - * @memberof proto.AdReplyInfo + * @memberof proto.MessageContextInfo * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - AdReplyInfo.verify = function verify(message) { + MessageContextInfo.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.advertiserName != null && message.hasOwnProperty("advertiserName")) - if (!$util.isString(message.advertiserName)) - return "advertiserName: string expected"; - if (message.mediaType != null && message.hasOwnProperty("mediaType")) - switch (message.mediaType) { - default: - return "mediaType: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.jpegThumbnail != null && message.hasOwnProperty("jpegThumbnail")) - if (!(message.jpegThumbnail && typeof message.jpegThumbnail.length === "number" || $util.isString(message.jpegThumbnail))) - return "jpegThumbnail: buffer expected"; - if (message.caption != null && message.hasOwnProperty("caption")) - if (!$util.isString(message.caption)) - return "caption: string expected"; + if (message.deviceListMetadata != null && message.hasOwnProperty("deviceListMetadata")) { + var error = $root.proto.DeviceListMetadata.verify(message.deviceListMetadata); + if (error) + return "deviceListMetadata." + error; + } + if (message.deviceListMetadataVersion != null && message.hasOwnProperty("deviceListMetadataVersion")) + if (!$util.isInteger(message.deviceListMetadataVersion)) + return "deviceListMetadataVersion: integer expected"; return null; }; /** - * Creates an AdReplyInfo message from a plain object. Also converts values to their respective internal types. + * Creates a MessageContextInfo message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof proto.AdReplyInfo + * @memberof proto.MessageContextInfo * @static * @param {Object.} object Plain object - * @returns {proto.AdReplyInfo} AdReplyInfo + * @returns {proto.MessageContextInfo} MessageContextInfo */ - AdReplyInfo.fromObject = function fromObject(object) { - if (object instanceof $root.proto.AdReplyInfo) + MessageContextInfo.fromObject = function fromObject(object) { + if (object instanceof $root.proto.MessageContextInfo) return object; - var message = new $root.proto.AdReplyInfo(); - if (object.advertiserName != null) - message.advertiserName = String(object.advertiserName); - switch (object.mediaType) { - case "NONE": - case 0: - message.mediaType = 0; - break; - case "IMAGE": - case 1: - message.mediaType = 1; - break; - case "VIDEO": - case 2: - message.mediaType = 2; - break; + var message = new $root.proto.MessageContextInfo(); + if (object.deviceListMetadata != null) { + if (typeof object.deviceListMetadata !== "object") + throw TypeError(".proto.MessageContextInfo.deviceListMetadata: object expected"); + message.deviceListMetadata = $root.proto.DeviceListMetadata.fromObject(object.deviceListMetadata); } - if (object.jpegThumbnail != null) - if (typeof object.jpegThumbnail === "string") - $util.base64.decode(object.jpegThumbnail, message.jpegThumbnail = $util.newBuffer($util.base64.length(object.jpegThumbnail)), 0); - else if (object.jpegThumbnail.length) - message.jpegThumbnail = object.jpegThumbnail; - if (object.caption != null) - message.caption = String(object.caption); + if (object.deviceListMetadataVersion != null) + message.deviceListMetadataVersion = object.deviceListMetadataVersion | 0; return message; }; /** - * Creates a plain object from an AdReplyInfo message. Also converts values to other types if specified. + * Creates a plain object from a MessageContextInfo message. Also converts values to other types if specified. * @function toObject - * @memberof proto.AdReplyInfo + * @memberof proto.MessageContextInfo * @static - * @param {proto.AdReplyInfo} message AdReplyInfo + * @param {proto.MessageContextInfo} message MessageContextInfo * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - AdReplyInfo.toObject = function toObject(message, options) { + MessageContextInfo.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.advertiserName = ""; - object.mediaType = options.enums === String ? "NONE" : 0; - if (options.bytes === String) - object.jpegThumbnail = ""; - else { - object.jpegThumbnail = []; - if (options.bytes !== Array) - object.jpegThumbnail = $util.newBuffer(object.jpegThumbnail); - } - object.caption = ""; + object.deviceListMetadata = null; + object.deviceListMetadataVersion = 0; } - if (message.advertiserName != null && message.hasOwnProperty("advertiserName")) - object.advertiserName = message.advertiserName; - if (message.mediaType != null && message.hasOwnProperty("mediaType")) - object.mediaType = options.enums === String ? $root.proto.AdReplyInfo.AdReplyInfoMediaType[message.mediaType] : message.mediaType; - if (message.jpegThumbnail != null && message.hasOwnProperty("jpegThumbnail")) - object.jpegThumbnail = options.bytes === String ? $util.base64.encode(message.jpegThumbnail, 0, message.jpegThumbnail.length) : options.bytes === Array ? Array.prototype.slice.call(message.jpegThumbnail) : message.jpegThumbnail; - if (message.caption != null && message.hasOwnProperty("caption")) - object.caption = message.caption; + if (message.deviceListMetadata != null && message.hasOwnProperty("deviceListMetadata")) + object.deviceListMetadata = $root.proto.DeviceListMetadata.toObject(message.deviceListMetadata, options); + if (message.deviceListMetadataVersion != null && message.hasOwnProperty("deviceListMetadataVersion")) + object.deviceListMetadataVersion = message.deviceListMetadataVersion; return object; }; /** - * Converts this AdReplyInfo to JSON. + * Converts this MessageContextInfo to JSON. * @function toJSON - * @memberof proto.AdReplyInfo + * @memberof proto.MessageContextInfo * @instance * @returns {Object.} JSON object */ - AdReplyInfo.prototype.toJSON = function toJSON() { + MessageContextInfo.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - /** - * AdReplyInfoMediaType enum. - * @name proto.AdReplyInfo.AdReplyInfoMediaType - * @enum {number} - * @property {number} NONE=0 NONE value - * @property {number} IMAGE=1 IMAGE value - * @property {number} VIDEO=2 VIDEO value - */ - AdReplyInfo.AdReplyInfoMediaType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "NONE"] = 0; - values[valuesById[1] = "IMAGE"] = 1; - values[valuesById[2] = "VIDEO"] = 2; - return values; - })(); - - return AdReplyInfo; + return MessageContextInfo; })(); - proto.ExternalAdReplyInfo = (function() { + proto.Money = (function() { /** - * Properties of an ExternalAdReplyInfo. + * Properties of a Money. * @memberof proto - * @interface IExternalAdReplyInfo - * @property {string|null} [title] ExternalAdReplyInfo title - * @property {string|null} [body] ExternalAdReplyInfo body - * @property {proto.ExternalAdReplyInfo.ExternalAdReplyInfoMediaType|null} [mediaType] ExternalAdReplyInfo mediaType - * @property {string|null} [thumbnailUrl] ExternalAdReplyInfo thumbnailUrl - * @property {string|null} [mediaUrl] ExternalAdReplyInfo mediaUrl - * @property {Uint8Array|null} [thumbnail] ExternalAdReplyInfo thumbnail - * @property {string|null} [sourceType] ExternalAdReplyInfo sourceType - * @property {string|null} [sourceId] ExternalAdReplyInfo sourceId - * @property {string|null} [sourceUrl] ExternalAdReplyInfo sourceUrl - * @property {boolean|null} [containsAutoReply] ExternalAdReplyInfo containsAutoReply + * @interface IMoney + * @property {number|Long|null} [value] Money value + * @property {number|null} [offset] Money offset + * @property {string|null} [currencyCode] Money currencyCode */ /** - * Constructs a new ExternalAdReplyInfo. + * Constructs a new Money. * @memberof proto - * @classdesc Represents an ExternalAdReplyInfo. - * @implements IExternalAdReplyInfo + * @classdesc Represents a Money. + * @implements IMoney * @constructor - * @param {proto.IExternalAdReplyInfo=} [properties] Properties to set + * @param {proto.IMoney=} [properties] Properties to set */ - function ExternalAdReplyInfo(properties) { + function Money(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -21759,192 +22828,101 @@ $root.proto = (function() { } /** - * ExternalAdReplyInfo title. - * @member {string} title - * @memberof proto.ExternalAdReplyInfo - * @instance - */ - ExternalAdReplyInfo.prototype.title = ""; - - /** - * ExternalAdReplyInfo body. - * @member {string} body - * @memberof proto.ExternalAdReplyInfo - * @instance - */ - ExternalAdReplyInfo.prototype.body = ""; - - /** - * ExternalAdReplyInfo mediaType. - * @member {proto.ExternalAdReplyInfo.ExternalAdReplyInfoMediaType} mediaType - * @memberof proto.ExternalAdReplyInfo - * @instance - */ - ExternalAdReplyInfo.prototype.mediaType = 0; - - /** - * ExternalAdReplyInfo thumbnailUrl. - * @member {string} thumbnailUrl - * @memberof proto.ExternalAdReplyInfo - * @instance - */ - ExternalAdReplyInfo.prototype.thumbnailUrl = ""; - - /** - * ExternalAdReplyInfo mediaUrl. - * @member {string} mediaUrl - * @memberof proto.ExternalAdReplyInfo - * @instance - */ - ExternalAdReplyInfo.prototype.mediaUrl = ""; - - /** - * ExternalAdReplyInfo thumbnail. - * @member {Uint8Array} thumbnail - * @memberof proto.ExternalAdReplyInfo - * @instance - */ - ExternalAdReplyInfo.prototype.thumbnail = $util.newBuffer([]); - - /** - * ExternalAdReplyInfo sourceType. - * @member {string} sourceType - * @memberof proto.ExternalAdReplyInfo - * @instance - */ - ExternalAdReplyInfo.prototype.sourceType = ""; - - /** - * ExternalAdReplyInfo sourceId. - * @member {string} sourceId - * @memberof proto.ExternalAdReplyInfo + * Money value. + * @member {number|Long} value + * @memberof proto.Money * @instance */ - ExternalAdReplyInfo.prototype.sourceId = ""; + Money.prototype.value = $util.Long ? $util.Long.fromBits(0,0,false) : 0; /** - * ExternalAdReplyInfo sourceUrl. - * @member {string} sourceUrl - * @memberof proto.ExternalAdReplyInfo + * Money offset. + * @member {number} offset + * @memberof proto.Money * @instance */ - ExternalAdReplyInfo.prototype.sourceUrl = ""; + Money.prototype.offset = 0; /** - * ExternalAdReplyInfo containsAutoReply. - * @member {boolean} containsAutoReply - * @memberof proto.ExternalAdReplyInfo + * Money currencyCode. + * @member {string} currencyCode + * @memberof proto.Money * @instance */ - ExternalAdReplyInfo.prototype.containsAutoReply = false; + Money.prototype.currencyCode = ""; /** - * Creates a new ExternalAdReplyInfo instance using the specified properties. + * Creates a new Money instance using the specified properties. * @function create - * @memberof proto.ExternalAdReplyInfo + * @memberof proto.Money * @static - * @param {proto.IExternalAdReplyInfo=} [properties] Properties to set - * @returns {proto.ExternalAdReplyInfo} ExternalAdReplyInfo instance + * @param {proto.IMoney=} [properties] Properties to set + * @returns {proto.Money} Money instance */ - ExternalAdReplyInfo.create = function create(properties) { - return new ExternalAdReplyInfo(properties); + Money.create = function create(properties) { + return new Money(properties); }; /** - * Encodes the specified ExternalAdReplyInfo message. Does not implicitly {@link proto.ExternalAdReplyInfo.verify|verify} messages. + * Encodes the specified Money message. Does not implicitly {@link proto.Money.verify|verify} messages. * @function encode - * @memberof proto.ExternalAdReplyInfo + * @memberof proto.Money * @static - * @param {proto.IExternalAdReplyInfo} message ExternalAdReplyInfo message or plain object to encode + * @param {proto.IMoney} message Money message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ExternalAdReplyInfo.encode = function encode(message, writer) { + Money.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.title != null && Object.hasOwnProperty.call(message, "title")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.title); - if (message.body != null && Object.hasOwnProperty.call(message, "body")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.body); - if (message.mediaType != null && Object.hasOwnProperty.call(message, "mediaType")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.mediaType); - if (message.thumbnailUrl != null && Object.hasOwnProperty.call(message, "thumbnailUrl")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.thumbnailUrl); - if (message.mediaUrl != null && Object.hasOwnProperty.call(message, "mediaUrl")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.mediaUrl); - if (message.thumbnail != null && Object.hasOwnProperty.call(message, "thumbnail")) - writer.uint32(/* id 6, wireType 2 =*/50).bytes(message.thumbnail); - if (message.sourceType != null && Object.hasOwnProperty.call(message, "sourceType")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.sourceType); - if (message.sourceId != null && Object.hasOwnProperty.call(message, "sourceId")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.sourceId); - if (message.sourceUrl != null && Object.hasOwnProperty.call(message, "sourceUrl")) - writer.uint32(/* id 9, wireType 2 =*/74).string(message.sourceUrl); - if (message.containsAutoReply != null && Object.hasOwnProperty.call(message, "containsAutoReply")) - writer.uint32(/* id 10, wireType 0 =*/80).bool(message.containsAutoReply); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.value); + if (message.offset != null && Object.hasOwnProperty.call(message, "offset")) + writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.offset); + if (message.currencyCode != null && Object.hasOwnProperty.call(message, "currencyCode")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.currencyCode); return writer; }; /** - * Encodes the specified ExternalAdReplyInfo message, length delimited. Does not implicitly {@link proto.ExternalAdReplyInfo.verify|verify} messages. + * Encodes the specified Money message, length delimited. Does not implicitly {@link proto.Money.verify|verify} messages. * @function encodeDelimited - * @memberof proto.ExternalAdReplyInfo + * @memberof proto.Money * @static - * @param {proto.IExternalAdReplyInfo} message ExternalAdReplyInfo message or plain object to encode + * @param {proto.IMoney} message Money message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ExternalAdReplyInfo.encodeDelimited = function encodeDelimited(message, writer) { + Money.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an ExternalAdReplyInfo message from the specified reader or buffer. + * Decodes a Money message from the specified reader or buffer. * @function decode - * @memberof proto.ExternalAdReplyInfo + * @memberof proto.Money * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {proto.ExternalAdReplyInfo} ExternalAdReplyInfo + * @returns {proto.Money} Money * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ExternalAdReplyInfo.decode = function decode(reader, length) { + Money.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.ExternalAdReplyInfo(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.Money(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.title = reader.string(); + message.value = reader.int64(); break; case 2: - message.body = reader.string(); + message.offset = reader.uint32(); break; case 3: - message.mediaType = reader.int32(); - break; - case 4: - message.thumbnailUrl = reader.string(); - break; - case 5: - message.mediaUrl = reader.string(); - break; - case 6: - message.thumbnail = reader.bytes(); - break; - case 7: - message.sourceType = reader.string(); - break; - case 8: - message.sourceId = reader.string(); - break; - case 9: - message.sourceUrl = reader.string(); - break; - case 10: - message.containsAutoReply = reader.bool(); + message.currencyCode = reader.string(); break; default: reader.skipType(tag & 7); @@ -21955,246 +22933,139 @@ $root.proto = (function() { }; /** - * Decodes an ExternalAdReplyInfo message from the specified reader or buffer, length delimited. + * Decodes a Money message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof proto.ExternalAdReplyInfo + * @memberof proto.Money * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.ExternalAdReplyInfo} ExternalAdReplyInfo + * @returns {proto.Money} Money * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ExternalAdReplyInfo.decodeDelimited = function decodeDelimited(reader) { + Money.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an ExternalAdReplyInfo message. + * Verifies a Money message. * @function verify - * @memberof proto.ExternalAdReplyInfo + * @memberof proto.Money * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ExternalAdReplyInfo.verify = function verify(message) { + Money.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.title != null && message.hasOwnProperty("title")) - if (!$util.isString(message.title)) - return "title: string expected"; - if (message.body != null && message.hasOwnProperty("body")) - if (!$util.isString(message.body)) - return "body: string expected"; - if (message.mediaType != null && message.hasOwnProperty("mediaType")) - switch (message.mediaType) { - default: - return "mediaType: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.thumbnailUrl != null && message.hasOwnProperty("thumbnailUrl")) - if (!$util.isString(message.thumbnailUrl)) - return "thumbnailUrl: string expected"; - if (message.mediaUrl != null && message.hasOwnProperty("mediaUrl")) - if (!$util.isString(message.mediaUrl)) - return "mediaUrl: string expected"; - if (message.thumbnail != null && message.hasOwnProperty("thumbnail")) - if (!(message.thumbnail && typeof message.thumbnail.length === "number" || $util.isString(message.thumbnail))) - return "thumbnail: buffer expected"; - if (message.sourceType != null && message.hasOwnProperty("sourceType")) - if (!$util.isString(message.sourceType)) - return "sourceType: string expected"; - if (message.sourceId != null && message.hasOwnProperty("sourceId")) - if (!$util.isString(message.sourceId)) - return "sourceId: string expected"; - if (message.sourceUrl != null && message.hasOwnProperty("sourceUrl")) - if (!$util.isString(message.sourceUrl)) - return "sourceUrl: string expected"; - if (message.containsAutoReply != null && message.hasOwnProperty("containsAutoReply")) - if (typeof message.containsAutoReply !== "boolean") - return "containsAutoReply: boolean expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isInteger(message.value) && !(message.value && $util.isInteger(message.value.low) && $util.isInteger(message.value.high))) + return "value: integer|Long expected"; + if (message.offset != null && message.hasOwnProperty("offset")) + if (!$util.isInteger(message.offset)) + return "offset: integer expected"; + if (message.currencyCode != null && message.hasOwnProperty("currencyCode")) + if (!$util.isString(message.currencyCode)) + return "currencyCode: string expected"; return null; }; /** - * Creates an ExternalAdReplyInfo message from a plain object. Also converts values to their respective internal types. + * Creates a Money message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof proto.ExternalAdReplyInfo + * @memberof proto.Money * @static * @param {Object.} object Plain object - * @returns {proto.ExternalAdReplyInfo} ExternalAdReplyInfo + * @returns {proto.Money} Money */ - ExternalAdReplyInfo.fromObject = function fromObject(object) { - if (object instanceof $root.proto.ExternalAdReplyInfo) + Money.fromObject = function fromObject(object) { + if (object instanceof $root.proto.Money) return object; - var message = new $root.proto.ExternalAdReplyInfo(); - if (object.title != null) - message.title = String(object.title); - if (object.body != null) - message.body = String(object.body); - switch (object.mediaType) { - case "NONE": - case 0: - message.mediaType = 0; - break; - case "IMAGE": - case 1: - message.mediaType = 1; - break; - case "VIDEO": - case 2: - message.mediaType = 2; - break; - } - if (object.thumbnailUrl != null) - message.thumbnailUrl = String(object.thumbnailUrl); - if (object.mediaUrl != null) - message.mediaUrl = String(object.mediaUrl); - if (object.thumbnail != null) - if (typeof object.thumbnail === "string") - $util.base64.decode(object.thumbnail, message.thumbnail = $util.newBuffer($util.base64.length(object.thumbnail)), 0); - else if (object.thumbnail.length) - message.thumbnail = object.thumbnail; - if (object.sourceType != null) - message.sourceType = String(object.sourceType); - if (object.sourceId != null) - message.sourceId = String(object.sourceId); - if (object.sourceUrl != null) - message.sourceUrl = String(object.sourceUrl); - if (object.containsAutoReply != null) - message.containsAutoReply = Boolean(object.containsAutoReply); + var message = new $root.proto.Money(); + if (object.value != null) + if ($util.Long) + (message.value = $util.Long.fromValue(object.value)).unsigned = false; + else if (typeof object.value === "string") + message.value = parseInt(object.value, 10); + else if (typeof object.value === "number") + message.value = object.value; + else if (typeof object.value === "object") + message.value = new $util.LongBits(object.value.low >>> 0, object.value.high >>> 0).toNumber(); + if (object.offset != null) + message.offset = object.offset >>> 0; + if (object.currencyCode != null) + message.currencyCode = String(object.currencyCode); return message; }; /** - * Creates a plain object from an ExternalAdReplyInfo message. Also converts values to other types if specified. + * Creates a plain object from a Money message. Also converts values to other types if specified. * @function toObject - * @memberof proto.ExternalAdReplyInfo + * @memberof proto.Money * @static - * @param {proto.ExternalAdReplyInfo} message ExternalAdReplyInfo + * @param {proto.Money} message Money * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ExternalAdReplyInfo.toObject = function toObject(message, options) { + Money.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.title = ""; - object.body = ""; - object.mediaType = options.enums === String ? "NONE" : 0; - object.thumbnailUrl = ""; - object.mediaUrl = ""; - if (options.bytes === String) - object.thumbnail = ""; - else { - object.thumbnail = []; - if (options.bytes !== Array) - object.thumbnail = $util.newBuffer(object.thumbnail); - } - object.sourceType = ""; - object.sourceId = ""; - object.sourceUrl = ""; - object.containsAutoReply = false; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.value = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.value = options.longs === String ? "0" : 0; + object.offset = 0; + object.currencyCode = ""; } - if (message.title != null && message.hasOwnProperty("title")) - object.title = message.title; - if (message.body != null && message.hasOwnProperty("body")) - object.body = message.body; - if (message.mediaType != null && message.hasOwnProperty("mediaType")) - object.mediaType = options.enums === String ? $root.proto.ExternalAdReplyInfo.ExternalAdReplyInfoMediaType[message.mediaType] : message.mediaType; - if (message.thumbnailUrl != null && message.hasOwnProperty("thumbnailUrl")) - object.thumbnailUrl = message.thumbnailUrl; - if (message.mediaUrl != null && message.hasOwnProperty("mediaUrl")) - object.mediaUrl = message.mediaUrl; - if (message.thumbnail != null && message.hasOwnProperty("thumbnail")) - object.thumbnail = options.bytes === String ? $util.base64.encode(message.thumbnail, 0, message.thumbnail.length) : options.bytes === Array ? Array.prototype.slice.call(message.thumbnail) : message.thumbnail; - if (message.sourceType != null && message.hasOwnProperty("sourceType")) - object.sourceType = message.sourceType; - if (message.sourceId != null && message.hasOwnProperty("sourceId")) - object.sourceId = message.sourceId; - if (message.sourceUrl != null && message.hasOwnProperty("sourceUrl")) - object.sourceUrl = message.sourceUrl; - if (message.containsAutoReply != null && message.hasOwnProperty("containsAutoReply")) - object.containsAutoReply = message.containsAutoReply; + if (message.value != null && message.hasOwnProperty("value")) + if (typeof message.value === "number") + object.value = options.longs === String ? String(message.value) : message.value; + else + object.value = options.longs === String ? $util.Long.prototype.toString.call(message.value) : options.longs === Number ? new $util.LongBits(message.value.low >>> 0, message.value.high >>> 0).toNumber() : message.value; + if (message.offset != null && message.hasOwnProperty("offset")) + object.offset = message.offset; + if (message.currencyCode != null && message.hasOwnProperty("currencyCode")) + object.currencyCode = message.currencyCode; return object; }; /** - * Converts this ExternalAdReplyInfo to JSON. + * Converts this Money to JSON. * @function toJSON - * @memberof proto.ExternalAdReplyInfo + * @memberof proto.Money * @instance * @returns {Object.} JSON object */ - ExternalAdReplyInfo.prototype.toJSON = function toJSON() { + Money.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - /** - * ExternalAdReplyInfoMediaType enum. - * @name proto.ExternalAdReplyInfo.ExternalAdReplyInfoMediaType - * @enum {number} - * @property {number} NONE=0 NONE value - * @property {number} IMAGE=1 IMAGE value - * @property {number} VIDEO=2 VIDEO value - */ - ExternalAdReplyInfo.ExternalAdReplyInfoMediaType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "NONE"] = 0; - values[valuesById[1] = "IMAGE"] = 1; - values[valuesById[2] = "VIDEO"] = 2; - return values; - })(); - - return ExternalAdReplyInfo; + return Money; })(); - proto.ContextInfo = (function() { + proto.NativeFlowButton = (function() { /** - * Properties of a ContextInfo. + * Properties of a NativeFlowButton. * @memberof proto - * @interface IContextInfo - * @property {string|null} [stanzaId] ContextInfo stanzaId - * @property {string|null} [participant] ContextInfo participant - * @property {proto.IMessage|null} [quotedMessage] ContextInfo quotedMessage - * @property {string|null} [remoteJid] ContextInfo remoteJid - * @property {Array.|null} [mentionedJid] ContextInfo mentionedJid - * @property {string|null} [conversionSource] ContextInfo conversionSource - * @property {Uint8Array|null} [conversionData] ContextInfo conversionData - * @property {number|null} [conversionDelaySeconds] ContextInfo conversionDelaySeconds - * @property {number|null} [forwardingScore] ContextInfo forwardingScore - * @property {boolean|null} [isForwarded] ContextInfo isForwarded - * @property {proto.IAdReplyInfo|null} [quotedAd] ContextInfo quotedAd - * @property {proto.IMessageKey|null} [placeholderKey] ContextInfo placeholderKey - * @property {number|null} [expiration] ContextInfo expiration - * @property {number|Long|null} [ephemeralSettingTimestamp] ContextInfo ephemeralSettingTimestamp - * @property {Uint8Array|null} [ephemeralSharedSecret] ContextInfo ephemeralSharedSecret - * @property {proto.IExternalAdReplyInfo|null} [externalAdReply] ContextInfo externalAdReply - * @property {string|null} [entryPointConversionSource] ContextInfo entryPointConversionSource - * @property {string|null} [entryPointConversionApp] ContextInfo entryPointConversionApp - * @property {number|null} [entryPointConversionDelaySeconds] ContextInfo entryPointConversionDelaySeconds - * @property {proto.IDisappearingMode|null} [disappearingMode] ContextInfo disappearingMode - * @property {proto.IActionLink|null} [actionLink] ContextInfo actionLink - * @property {string|null} [groupSubject] ContextInfo groupSubject - * @property {string|null} [parentGroupJid] ContextInfo parentGroupJid + * @interface INativeFlowButton + * @property {string|null} [name] NativeFlowButton name + * @property {string|null} [buttonParamsJson] NativeFlowButton buttonParamsJson */ /** - * Constructs a new ContextInfo. + * Constructs a new NativeFlowButton. * @memberof proto - * @classdesc Represents a ContextInfo. - * @implements IContextInfo + * @classdesc Represents a NativeFlowButton. + * @implements INativeFlowButton * @constructor - * @param {proto.IContextInfo=} [properties] Properties to set + * @param {proto.INativeFlowButton=} [properties] Properties to set */ - function ContextInfo(properties) { - this.mentionedJid = []; + function NativeFlowButton(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -22202,364 +23073,526 @@ $root.proto = (function() { } /** - * ContextInfo stanzaId. - * @member {string} stanzaId - * @memberof proto.ContextInfo + * NativeFlowButton name. + * @member {string} name + * @memberof proto.NativeFlowButton * @instance */ - ContextInfo.prototype.stanzaId = ""; + NativeFlowButton.prototype.name = ""; /** - * ContextInfo participant. - * @member {string} participant - * @memberof proto.ContextInfo + * NativeFlowButton buttonParamsJson. + * @member {string} buttonParamsJson + * @memberof proto.NativeFlowButton * @instance */ - ContextInfo.prototype.participant = ""; + NativeFlowButton.prototype.buttonParamsJson = ""; /** - * ContextInfo quotedMessage. - * @member {proto.IMessage|null|undefined} quotedMessage - * @memberof proto.ContextInfo - * @instance + * Creates a new NativeFlowButton instance using the specified properties. + * @function create + * @memberof proto.NativeFlowButton + * @static + * @param {proto.INativeFlowButton=} [properties] Properties to set + * @returns {proto.NativeFlowButton} NativeFlowButton instance */ - ContextInfo.prototype.quotedMessage = null; + NativeFlowButton.create = function create(properties) { + return new NativeFlowButton(properties); + }; /** - * ContextInfo remoteJid. - * @member {string} remoteJid - * @memberof proto.ContextInfo - * @instance + * Encodes the specified NativeFlowButton message. Does not implicitly {@link proto.NativeFlowButton.verify|verify} messages. + * @function encode + * @memberof proto.NativeFlowButton + * @static + * @param {proto.INativeFlowButton} message NativeFlowButton message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - ContextInfo.prototype.remoteJid = ""; + NativeFlowButton.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.buttonParamsJson != null && Object.hasOwnProperty.call(message, "buttonParamsJson")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.buttonParamsJson); + return writer; + }; /** - * ContextInfo mentionedJid. - * @member {Array.} mentionedJid - * @memberof proto.ContextInfo - * @instance + * Encodes the specified NativeFlowButton message, length delimited. Does not implicitly {@link proto.NativeFlowButton.verify|verify} messages. + * @function encodeDelimited + * @memberof proto.NativeFlowButton + * @static + * @param {proto.INativeFlowButton} message NativeFlowButton message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - ContextInfo.prototype.mentionedJid = $util.emptyArray; + NativeFlowButton.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; /** - * ContextInfo conversionSource. - * @member {string} conversionSource - * @memberof proto.ContextInfo - * @instance + * Decodes a NativeFlowButton message from the specified reader or buffer. + * @function decode + * @memberof proto.NativeFlowButton + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {proto.NativeFlowButton} NativeFlowButton + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ContextInfo.prototype.conversionSource = ""; + NativeFlowButton.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.NativeFlowButton(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.buttonParamsJson = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; /** - * ContextInfo conversionData. - * @member {Uint8Array} conversionData - * @memberof proto.ContextInfo - * @instance + * Decodes a NativeFlowButton message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof proto.NativeFlowButton + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {proto.NativeFlowButton} NativeFlowButton + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ContextInfo.prototype.conversionData = $util.newBuffer([]); + NativeFlowButton.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; /** - * ContextInfo conversionDelaySeconds. - * @member {number} conversionDelaySeconds - * @memberof proto.ContextInfo - * @instance + * Verifies a NativeFlowButton message. + * @function verify + * @memberof proto.NativeFlowButton + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ContextInfo.prototype.conversionDelaySeconds = 0; + NativeFlowButton.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.buttonParamsJson != null && message.hasOwnProperty("buttonParamsJson")) + if (!$util.isString(message.buttonParamsJson)) + return "buttonParamsJson: string expected"; + return null; + }; /** - * ContextInfo forwardingScore. - * @member {number} forwardingScore - * @memberof proto.ContextInfo - * @instance + * Creates a NativeFlowButton message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof proto.NativeFlowButton + * @static + * @param {Object.} object Plain object + * @returns {proto.NativeFlowButton} NativeFlowButton */ - ContextInfo.prototype.forwardingScore = 0; + NativeFlowButton.fromObject = function fromObject(object) { + if (object instanceof $root.proto.NativeFlowButton) + return object; + var message = new $root.proto.NativeFlowButton(); + if (object.name != null) + message.name = String(object.name); + if (object.buttonParamsJson != null) + message.buttonParamsJson = String(object.buttonParamsJson); + return message; + }; /** - * ContextInfo isForwarded. - * @member {boolean} isForwarded - * @memberof proto.ContextInfo - * @instance + * Creates a plain object from a NativeFlowButton message. Also converts values to other types if specified. + * @function toObject + * @memberof proto.NativeFlowButton + * @static + * @param {proto.NativeFlowButton} message NativeFlowButton + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object */ - ContextInfo.prototype.isForwarded = false; + NativeFlowButton.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.buttonParamsJson = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.buttonParamsJson != null && message.hasOwnProperty("buttonParamsJson")) + object.buttonParamsJson = message.buttonParamsJson; + return object; + }; /** - * ContextInfo quotedAd. - * @member {proto.IAdReplyInfo|null|undefined} quotedAd - * @memberof proto.ContextInfo + * Converts this NativeFlowButton to JSON. + * @function toJSON + * @memberof proto.NativeFlowButton * @instance + * @returns {Object.} JSON object */ - ContextInfo.prototype.quotedAd = null; + NativeFlowButton.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return NativeFlowButton; + })(); + + proto.NativeFlowInfo = (function() { /** - * ContextInfo placeholderKey. - * @member {proto.IMessageKey|null|undefined} placeholderKey - * @memberof proto.ContextInfo - * @instance + * Properties of a NativeFlowInfo. + * @memberof proto + * @interface INativeFlowInfo + * @property {string|null} [name] NativeFlowInfo name + * @property {string|null} [paramsJson] NativeFlowInfo paramsJson */ - ContextInfo.prototype.placeholderKey = null; /** - * ContextInfo expiration. - * @member {number} expiration - * @memberof proto.ContextInfo - * @instance + * Constructs a new NativeFlowInfo. + * @memberof proto + * @classdesc Represents a NativeFlowInfo. + * @implements INativeFlowInfo + * @constructor + * @param {proto.INativeFlowInfo=} [properties] Properties to set */ - ContextInfo.prototype.expiration = 0; + function NativeFlowInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } /** - * ContextInfo ephemeralSettingTimestamp. - * @member {number|Long} ephemeralSettingTimestamp - * @memberof proto.ContextInfo + * NativeFlowInfo name. + * @member {string} name + * @memberof proto.NativeFlowInfo * @instance */ - ContextInfo.prototype.ephemeralSettingTimestamp = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + NativeFlowInfo.prototype.name = ""; /** - * ContextInfo ephemeralSharedSecret. - * @member {Uint8Array} ephemeralSharedSecret - * @memberof proto.ContextInfo + * NativeFlowInfo paramsJson. + * @member {string} paramsJson + * @memberof proto.NativeFlowInfo * @instance */ - ContextInfo.prototype.ephemeralSharedSecret = $util.newBuffer([]); + NativeFlowInfo.prototype.paramsJson = ""; /** - * ContextInfo externalAdReply. - * @member {proto.IExternalAdReplyInfo|null|undefined} externalAdReply - * @memberof proto.ContextInfo - * @instance + * Creates a new NativeFlowInfo instance using the specified properties. + * @function create + * @memberof proto.NativeFlowInfo + * @static + * @param {proto.INativeFlowInfo=} [properties] Properties to set + * @returns {proto.NativeFlowInfo} NativeFlowInfo instance */ - ContextInfo.prototype.externalAdReply = null; + NativeFlowInfo.create = function create(properties) { + return new NativeFlowInfo(properties); + }; /** - * ContextInfo entryPointConversionSource. - * @member {string} entryPointConversionSource - * @memberof proto.ContextInfo - * @instance + * Encodes the specified NativeFlowInfo message. Does not implicitly {@link proto.NativeFlowInfo.verify|verify} messages. + * @function encode + * @memberof proto.NativeFlowInfo + * @static + * @param {proto.INativeFlowInfo} message NativeFlowInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - ContextInfo.prototype.entryPointConversionSource = ""; + NativeFlowInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.paramsJson != null && Object.hasOwnProperty.call(message, "paramsJson")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.paramsJson); + return writer; + }; /** - * ContextInfo entryPointConversionApp. - * @member {string} entryPointConversionApp - * @memberof proto.ContextInfo - * @instance + * Encodes the specified NativeFlowInfo message, length delimited. Does not implicitly {@link proto.NativeFlowInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof proto.NativeFlowInfo + * @static + * @param {proto.INativeFlowInfo} message NativeFlowInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - ContextInfo.prototype.entryPointConversionApp = ""; + NativeFlowInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; /** - * ContextInfo entryPointConversionDelaySeconds. - * @member {number} entryPointConversionDelaySeconds - * @memberof proto.ContextInfo - * @instance + * Decodes a NativeFlowInfo message from the specified reader or buffer. + * @function decode + * @memberof proto.NativeFlowInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {proto.NativeFlowInfo} NativeFlowInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ContextInfo.prototype.entryPointConversionDelaySeconds = 0; + NativeFlowInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.NativeFlowInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.paramsJson = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; /** - * ContextInfo disappearingMode. - * @member {proto.IDisappearingMode|null|undefined} disappearingMode - * @memberof proto.ContextInfo + * Decodes a NativeFlowInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof proto.NativeFlowInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {proto.NativeFlowInfo} NativeFlowInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NativeFlowInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NativeFlowInfo message. + * @function verify + * @memberof proto.NativeFlowInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NativeFlowInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.paramsJson != null && message.hasOwnProperty("paramsJson")) + if (!$util.isString(message.paramsJson)) + return "paramsJson: string expected"; + return null; + }; + + /** + * Creates a NativeFlowInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof proto.NativeFlowInfo + * @static + * @param {Object.} object Plain object + * @returns {proto.NativeFlowInfo} NativeFlowInfo + */ + NativeFlowInfo.fromObject = function fromObject(object) { + if (object instanceof $root.proto.NativeFlowInfo) + return object; + var message = new $root.proto.NativeFlowInfo(); + if (object.name != null) + message.name = String(object.name); + if (object.paramsJson != null) + message.paramsJson = String(object.paramsJson); + return message; + }; + + /** + * Creates a plain object from a NativeFlowInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof proto.NativeFlowInfo + * @static + * @param {proto.NativeFlowInfo} message NativeFlowInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NativeFlowInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.paramsJson = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.paramsJson != null && message.hasOwnProperty("paramsJson")) + object.paramsJson = message.paramsJson; + return object; + }; + + /** + * Converts this NativeFlowInfo to JSON. + * @function toJSON + * @memberof proto.NativeFlowInfo * @instance + * @returns {Object.} JSON object */ - ContextInfo.prototype.disappearingMode = null; + NativeFlowInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return NativeFlowInfo; + })(); + + proto.NativeFlowMessage = (function() { /** - * ContextInfo actionLink. - * @member {proto.IActionLink|null|undefined} actionLink - * @memberof proto.ContextInfo + * Properties of a NativeFlowMessage. + * @memberof proto + * @interface INativeFlowMessage + * @property {Array.|null} [buttons] NativeFlowMessage buttons + * @property {string|null} [messageParamsJson] NativeFlowMessage messageParamsJson + * @property {number|null} [messageVersion] NativeFlowMessage messageVersion + */ + + /** + * Constructs a new NativeFlowMessage. + * @memberof proto + * @classdesc Represents a NativeFlowMessage. + * @implements INativeFlowMessage + * @constructor + * @param {proto.INativeFlowMessage=} [properties] Properties to set + */ + function NativeFlowMessage(properties) { + this.buttons = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NativeFlowMessage buttons. + * @member {Array.} buttons + * @memberof proto.NativeFlowMessage * @instance */ - ContextInfo.prototype.actionLink = null; + NativeFlowMessage.prototype.buttons = $util.emptyArray; /** - * ContextInfo groupSubject. - * @member {string} groupSubject - * @memberof proto.ContextInfo + * NativeFlowMessage messageParamsJson. + * @member {string} messageParamsJson + * @memberof proto.NativeFlowMessage * @instance */ - ContextInfo.prototype.groupSubject = ""; + NativeFlowMessage.prototype.messageParamsJson = ""; /** - * ContextInfo parentGroupJid. - * @member {string} parentGroupJid - * @memberof proto.ContextInfo + * NativeFlowMessage messageVersion. + * @member {number} messageVersion + * @memberof proto.NativeFlowMessage * @instance */ - ContextInfo.prototype.parentGroupJid = ""; + NativeFlowMessage.prototype.messageVersion = 0; /** - * Creates a new ContextInfo instance using the specified properties. + * Creates a new NativeFlowMessage instance using the specified properties. * @function create - * @memberof proto.ContextInfo + * @memberof proto.NativeFlowMessage * @static - * @param {proto.IContextInfo=} [properties] Properties to set - * @returns {proto.ContextInfo} ContextInfo instance + * @param {proto.INativeFlowMessage=} [properties] Properties to set + * @returns {proto.NativeFlowMessage} NativeFlowMessage instance */ - ContextInfo.create = function create(properties) { - return new ContextInfo(properties); + NativeFlowMessage.create = function create(properties) { + return new NativeFlowMessage(properties); }; /** - * Encodes the specified ContextInfo message. Does not implicitly {@link proto.ContextInfo.verify|verify} messages. + * Encodes the specified NativeFlowMessage message. Does not implicitly {@link proto.NativeFlowMessage.verify|verify} messages. * @function encode - * @memberof proto.ContextInfo + * @memberof proto.NativeFlowMessage * @static - * @param {proto.IContextInfo} message ContextInfo message or plain object to encode + * @param {proto.INativeFlowMessage} message NativeFlowMessage message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ContextInfo.encode = function encode(message, writer) { + NativeFlowMessage.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.stanzaId != null && Object.hasOwnProperty.call(message, "stanzaId")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.stanzaId); - if (message.participant != null && Object.hasOwnProperty.call(message, "participant")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.participant); - if (message.quotedMessage != null && Object.hasOwnProperty.call(message, "quotedMessage")) - $root.proto.Message.encode(message.quotedMessage, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.remoteJid != null && Object.hasOwnProperty.call(message, "remoteJid")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.remoteJid); - if (message.mentionedJid != null && message.mentionedJid.length) - for (var i = 0; i < message.mentionedJid.length; ++i) - writer.uint32(/* id 15, wireType 2 =*/122).string(message.mentionedJid[i]); - if (message.conversionSource != null && Object.hasOwnProperty.call(message, "conversionSource")) - writer.uint32(/* id 18, wireType 2 =*/146).string(message.conversionSource); - if (message.conversionData != null && Object.hasOwnProperty.call(message, "conversionData")) - writer.uint32(/* id 19, wireType 2 =*/154).bytes(message.conversionData); - if (message.conversionDelaySeconds != null && Object.hasOwnProperty.call(message, "conversionDelaySeconds")) - writer.uint32(/* id 20, wireType 0 =*/160).uint32(message.conversionDelaySeconds); - if (message.forwardingScore != null && Object.hasOwnProperty.call(message, "forwardingScore")) - writer.uint32(/* id 21, wireType 0 =*/168).uint32(message.forwardingScore); - if (message.isForwarded != null && Object.hasOwnProperty.call(message, "isForwarded")) - writer.uint32(/* id 22, wireType 0 =*/176).bool(message.isForwarded); - if (message.quotedAd != null && Object.hasOwnProperty.call(message, "quotedAd")) - $root.proto.AdReplyInfo.encode(message.quotedAd, writer.uint32(/* id 23, wireType 2 =*/186).fork()).ldelim(); - if (message.placeholderKey != null && Object.hasOwnProperty.call(message, "placeholderKey")) - $root.proto.MessageKey.encode(message.placeholderKey, writer.uint32(/* id 24, wireType 2 =*/194).fork()).ldelim(); - if (message.expiration != null && Object.hasOwnProperty.call(message, "expiration")) - writer.uint32(/* id 25, wireType 0 =*/200).uint32(message.expiration); - if (message.ephemeralSettingTimestamp != null && Object.hasOwnProperty.call(message, "ephemeralSettingTimestamp")) - writer.uint32(/* id 26, wireType 0 =*/208).int64(message.ephemeralSettingTimestamp); - if (message.ephemeralSharedSecret != null && Object.hasOwnProperty.call(message, "ephemeralSharedSecret")) - writer.uint32(/* id 27, wireType 2 =*/218).bytes(message.ephemeralSharedSecret); - if (message.externalAdReply != null && Object.hasOwnProperty.call(message, "externalAdReply")) - $root.proto.ExternalAdReplyInfo.encode(message.externalAdReply, writer.uint32(/* id 28, wireType 2 =*/226).fork()).ldelim(); - if (message.entryPointConversionSource != null && Object.hasOwnProperty.call(message, "entryPointConversionSource")) - writer.uint32(/* id 29, wireType 2 =*/234).string(message.entryPointConversionSource); - if (message.entryPointConversionApp != null && Object.hasOwnProperty.call(message, "entryPointConversionApp")) - writer.uint32(/* id 30, wireType 2 =*/242).string(message.entryPointConversionApp); - if (message.entryPointConversionDelaySeconds != null && Object.hasOwnProperty.call(message, "entryPointConversionDelaySeconds")) - writer.uint32(/* id 31, wireType 0 =*/248).uint32(message.entryPointConversionDelaySeconds); - if (message.disappearingMode != null && Object.hasOwnProperty.call(message, "disappearingMode")) - $root.proto.DisappearingMode.encode(message.disappearingMode, writer.uint32(/* id 32, wireType 2 =*/258).fork()).ldelim(); - if (message.actionLink != null && Object.hasOwnProperty.call(message, "actionLink")) - $root.proto.ActionLink.encode(message.actionLink, writer.uint32(/* id 33, wireType 2 =*/266).fork()).ldelim(); - if (message.groupSubject != null && Object.hasOwnProperty.call(message, "groupSubject")) - writer.uint32(/* id 34, wireType 2 =*/274).string(message.groupSubject); - if (message.parentGroupJid != null && Object.hasOwnProperty.call(message, "parentGroupJid")) - writer.uint32(/* id 35, wireType 2 =*/282).string(message.parentGroupJid); + if (message.buttons != null && message.buttons.length) + for (var i = 0; i < message.buttons.length; ++i) + $root.proto.NativeFlowButton.encode(message.buttons[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.messageParamsJson != null && Object.hasOwnProperty.call(message, "messageParamsJson")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.messageParamsJson); + if (message.messageVersion != null && Object.hasOwnProperty.call(message, "messageVersion")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.messageVersion); return writer; }; /** - * Encodes the specified ContextInfo message, length delimited. Does not implicitly {@link proto.ContextInfo.verify|verify} messages. + * Encodes the specified NativeFlowMessage message, length delimited. Does not implicitly {@link proto.NativeFlowMessage.verify|verify} messages. * @function encodeDelimited - * @memberof proto.ContextInfo + * @memberof proto.NativeFlowMessage * @static - * @param {proto.IContextInfo} message ContextInfo message or plain object to encode + * @param {proto.INativeFlowMessage} message NativeFlowMessage message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ContextInfo.encodeDelimited = function encodeDelimited(message, writer) { + NativeFlowMessage.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ContextInfo message from the specified reader or buffer. + * Decodes a NativeFlowMessage message from the specified reader or buffer. * @function decode - * @memberof proto.ContextInfo + * @memberof proto.NativeFlowMessage * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {proto.ContextInfo} ContextInfo + * @returns {proto.NativeFlowMessage} NativeFlowMessage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ContextInfo.decode = function decode(reader, length) { + NativeFlowMessage.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.ContextInfo(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.NativeFlowMessage(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.stanzaId = reader.string(); + if (!(message.buttons && message.buttons.length)) + message.buttons = []; + message.buttons.push($root.proto.NativeFlowButton.decode(reader, reader.uint32())); break; case 2: - message.participant = reader.string(); + message.messageParamsJson = reader.string(); break; case 3: - message.quotedMessage = $root.proto.Message.decode(reader, reader.uint32()); - break; - case 4: - message.remoteJid = reader.string(); - break; - case 15: - if (!(message.mentionedJid && message.mentionedJid.length)) - message.mentionedJid = []; - message.mentionedJid.push(reader.string()); - break; - case 18: - message.conversionSource = reader.string(); - break; - case 19: - message.conversionData = reader.bytes(); - break; - case 20: - message.conversionDelaySeconds = reader.uint32(); - break; - case 21: - message.forwardingScore = reader.uint32(); - break; - case 22: - message.isForwarded = reader.bool(); - break; - case 23: - message.quotedAd = $root.proto.AdReplyInfo.decode(reader, reader.uint32()); - break; - case 24: - message.placeholderKey = $root.proto.MessageKey.decode(reader, reader.uint32()); - break; - case 25: - message.expiration = reader.uint32(); - break; - case 26: - message.ephemeralSettingTimestamp = reader.int64(); - break; - case 27: - message.ephemeralSharedSecret = reader.bytes(); - break; - case 28: - message.externalAdReply = $root.proto.ExternalAdReplyInfo.decode(reader, reader.uint32()); - break; - case 29: - message.entryPointConversionSource = reader.string(); - break; - case 30: - message.entryPointConversionApp = reader.string(); - break; - case 31: - message.entryPointConversionDelaySeconds = reader.uint32(); - break; - case 32: - message.disappearingMode = $root.proto.DisappearingMode.decode(reader, reader.uint32()); - break; - case 33: - message.actionLink = $root.proto.ActionLink.decode(reader, reader.uint32()); - break; - case 34: - message.groupSubject = reader.string(); - break; - case 35: - message.parentGroupJid = reader.string(); + message.messageVersion = reader.int32(); break; default: reader.skipType(tag & 7); @@ -22570,360 +23603,144 @@ $root.proto = (function() { }; /** - * Decodes a ContextInfo message from the specified reader or buffer, length delimited. + * Decodes a NativeFlowMessage message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof proto.ContextInfo + * @memberof proto.NativeFlowMessage * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.ContextInfo} ContextInfo + * @returns {proto.NativeFlowMessage} NativeFlowMessage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ContextInfo.decodeDelimited = function decodeDelimited(reader) { + NativeFlowMessage.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ContextInfo message. + * Verifies a NativeFlowMessage message. * @function verify - * @memberof proto.ContextInfo + * @memberof proto.NativeFlowMessage * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ContextInfo.verify = function verify(message) { + NativeFlowMessage.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.stanzaId != null && message.hasOwnProperty("stanzaId")) - if (!$util.isString(message.stanzaId)) - return "stanzaId: string expected"; - if (message.participant != null && message.hasOwnProperty("participant")) - if (!$util.isString(message.participant)) - return "participant: string expected"; - if (message.quotedMessage != null && message.hasOwnProperty("quotedMessage")) { - var error = $root.proto.Message.verify(message.quotedMessage); - if (error) - return "quotedMessage." + error; - } - if (message.remoteJid != null && message.hasOwnProperty("remoteJid")) - if (!$util.isString(message.remoteJid)) - return "remoteJid: string expected"; - if (message.mentionedJid != null && message.hasOwnProperty("mentionedJid")) { - if (!Array.isArray(message.mentionedJid)) - return "mentionedJid: array expected"; - for (var i = 0; i < message.mentionedJid.length; ++i) - if (!$util.isString(message.mentionedJid[i])) - return "mentionedJid: string[] expected"; - } - if (message.conversionSource != null && message.hasOwnProperty("conversionSource")) - if (!$util.isString(message.conversionSource)) - return "conversionSource: string expected"; - if (message.conversionData != null && message.hasOwnProperty("conversionData")) - if (!(message.conversionData && typeof message.conversionData.length === "number" || $util.isString(message.conversionData))) - return "conversionData: buffer expected"; - if (message.conversionDelaySeconds != null && message.hasOwnProperty("conversionDelaySeconds")) - if (!$util.isInteger(message.conversionDelaySeconds)) - return "conversionDelaySeconds: integer expected"; - if (message.forwardingScore != null && message.hasOwnProperty("forwardingScore")) - if (!$util.isInteger(message.forwardingScore)) - return "forwardingScore: integer expected"; - if (message.isForwarded != null && message.hasOwnProperty("isForwarded")) - if (typeof message.isForwarded !== "boolean") - return "isForwarded: boolean expected"; - if (message.quotedAd != null && message.hasOwnProperty("quotedAd")) { - var error = $root.proto.AdReplyInfo.verify(message.quotedAd); - if (error) - return "quotedAd." + error; - } - if (message.placeholderKey != null && message.hasOwnProperty("placeholderKey")) { - var error = $root.proto.MessageKey.verify(message.placeholderKey); - if (error) - return "placeholderKey." + error; - } - if (message.expiration != null && message.hasOwnProperty("expiration")) - if (!$util.isInteger(message.expiration)) - return "expiration: integer expected"; - if (message.ephemeralSettingTimestamp != null && message.hasOwnProperty("ephemeralSettingTimestamp")) - if (!$util.isInteger(message.ephemeralSettingTimestamp) && !(message.ephemeralSettingTimestamp && $util.isInteger(message.ephemeralSettingTimestamp.low) && $util.isInteger(message.ephemeralSettingTimestamp.high))) - return "ephemeralSettingTimestamp: integer|Long expected"; - if (message.ephemeralSharedSecret != null && message.hasOwnProperty("ephemeralSharedSecret")) - if (!(message.ephemeralSharedSecret && typeof message.ephemeralSharedSecret.length === "number" || $util.isString(message.ephemeralSharedSecret))) - return "ephemeralSharedSecret: buffer expected"; - if (message.externalAdReply != null && message.hasOwnProperty("externalAdReply")) { - var error = $root.proto.ExternalAdReplyInfo.verify(message.externalAdReply); - if (error) - return "externalAdReply." + error; - } - if (message.entryPointConversionSource != null && message.hasOwnProperty("entryPointConversionSource")) - if (!$util.isString(message.entryPointConversionSource)) - return "entryPointConversionSource: string expected"; - if (message.entryPointConversionApp != null && message.hasOwnProperty("entryPointConversionApp")) - if (!$util.isString(message.entryPointConversionApp)) - return "entryPointConversionApp: string expected"; - if (message.entryPointConversionDelaySeconds != null && message.hasOwnProperty("entryPointConversionDelaySeconds")) - if (!$util.isInteger(message.entryPointConversionDelaySeconds)) - return "entryPointConversionDelaySeconds: integer expected"; - if (message.disappearingMode != null && message.hasOwnProperty("disappearingMode")) { - var error = $root.proto.DisappearingMode.verify(message.disappearingMode); - if (error) - return "disappearingMode." + error; - } - if (message.actionLink != null && message.hasOwnProperty("actionLink")) { - var error = $root.proto.ActionLink.verify(message.actionLink); - if (error) - return "actionLink." + error; + if (message.buttons != null && message.hasOwnProperty("buttons")) { + if (!Array.isArray(message.buttons)) + return "buttons: array expected"; + for (var i = 0; i < message.buttons.length; ++i) { + var error = $root.proto.NativeFlowButton.verify(message.buttons[i]); + if (error) + return "buttons." + error; + } } - if (message.groupSubject != null && message.hasOwnProperty("groupSubject")) - if (!$util.isString(message.groupSubject)) - return "groupSubject: string expected"; - if (message.parentGroupJid != null && message.hasOwnProperty("parentGroupJid")) - if (!$util.isString(message.parentGroupJid)) - return "parentGroupJid: string expected"; + if (message.messageParamsJson != null && message.hasOwnProperty("messageParamsJson")) + if (!$util.isString(message.messageParamsJson)) + return "messageParamsJson: string expected"; + if (message.messageVersion != null && message.hasOwnProperty("messageVersion")) + if (!$util.isInteger(message.messageVersion)) + return "messageVersion: integer expected"; return null; }; /** - * Creates a ContextInfo message from a plain object. Also converts values to their respective internal types. + * Creates a NativeFlowMessage message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof proto.ContextInfo + * @memberof proto.NativeFlowMessage * @static * @param {Object.} object Plain object - * @returns {proto.ContextInfo} ContextInfo + * @returns {proto.NativeFlowMessage} NativeFlowMessage */ - ContextInfo.fromObject = function fromObject(object) { - if (object instanceof $root.proto.ContextInfo) + NativeFlowMessage.fromObject = function fromObject(object) { + if (object instanceof $root.proto.NativeFlowMessage) return object; - var message = new $root.proto.ContextInfo(); - if (object.stanzaId != null) - message.stanzaId = String(object.stanzaId); - if (object.participant != null) - message.participant = String(object.participant); - if (object.quotedMessage != null) { - if (typeof object.quotedMessage !== "object") - throw TypeError(".proto.ContextInfo.quotedMessage: object expected"); - message.quotedMessage = $root.proto.Message.fromObject(object.quotedMessage); - } - if (object.remoteJid != null) - message.remoteJid = String(object.remoteJid); - if (object.mentionedJid) { - if (!Array.isArray(object.mentionedJid)) - throw TypeError(".proto.ContextInfo.mentionedJid: array expected"); - message.mentionedJid = []; - for (var i = 0; i < object.mentionedJid.length; ++i) - message.mentionedJid[i] = String(object.mentionedJid[i]); - } - if (object.conversionSource != null) - message.conversionSource = String(object.conversionSource); - if (object.conversionData != null) - if (typeof object.conversionData === "string") - $util.base64.decode(object.conversionData, message.conversionData = $util.newBuffer($util.base64.length(object.conversionData)), 0); - else if (object.conversionData.length) - message.conversionData = object.conversionData; - if (object.conversionDelaySeconds != null) - message.conversionDelaySeconds = object.conversionDelaySeconds >>> 0; - if (object.forwardingScore != null) - message.forwardingScore = object.forwardingScore >>> 0; - if (object.isForwarded != null) - message.isForwarded = Boolean(object.isForwarded); - if (object.quotedAd != null) { - if (typeof object.quotedAd !== "object") - throw TypeError(".proto.ContextInfo.quotedAd: object expected"); - message.quotedAd = $root.proto.AdReplyInfo.fromObject(object.quotedAd); - } - if (object.placeholderKey != null) { - if (typeof object.placeholderKey !== "object") - throw TypeError(".proto.ContextInfo.placeholderKey: object expected"); - message.placeholderKey = $root.proto.MessageKey.fromObject(object.placeholderKey); - } - if (object.expiration != null) - message.expiration = object.expiration >>> 0; - if (object.ephemeralSettingTimestamp != null) - if ($util.Long) - (message.ephemeralSettingTimestamp = $util.Long.fromValue(object.ephemeralSettingTimestamp)).unsigned = false; - else if (typeof object.ephemeralSettingTimestamp === "string") - message.ephemeralSettingTimestamp = parseInt(object.ephemeralSettingTimestamp, 10); - else if (typeof object.ephemeralSettingTimestamp === "number") - message.ephemeralSettingTimestamp = object.ephemeralSettingTimestamp; - else if (typeof object.ephemeralSettingTimestamp === "object") - message.ephemeralSettingTimestamp = new $util.LongBits(object.ephemeralSettingTimestamp.low >>> 0, object.ephemeralSettingTimestamp.high >>> 0).toNumber(); - if (object.ephemeralSharedSecret != null) - if (typeof object.ephemeralSharedSecret === "string") - $util.base64.decode(object.ephemeralSharedSecret, message.ephemeralSharedSecret = $util.newBuffer($util.base64.length(object.ephemeralSharedSecret)), 0); - else if (object.ephemeralSharedSecret.length) - message.ephemeralSharedSecret = object.ephemeralSharedSecret; - if (object.externalAdReply != null) { - if (typeof object.externalAdReply !== "object") - throw TypeError(".proto.ContextInfo.externalAdReply: object expected"); - message.externalAdReply = $root.proto.ExternalAdReplyInfo.fromObject(object.externalAdReply); - } - if (object.entryPointConversionSource != null) - message.entryPointConversionSource = String(object.entryPointConversionSource); - if (object.entryPointConversionApp != null) - message.entryPointConversionApp = String(object.entryPointConversionApp); - if (object.entryPointConversionDelaySeconds != null) - message.entryPointConversionDelaySeconds = object.entryPointConversionDelaySeconds >>> 0; - if (object.disappearingMode != null) { - if (typeof object.disappearingMode !== "object") - throw TypeError(".proto.ContextInfo.disappearingMode: object expected"); - message.disappearingMode = $root.proto.DisappearingMode.fromObject(object.disappearingMode); - } - if (object.actionLink != null) { - if (typeof object.actionLink !== "object") - throw TypeError(".proto.ContextInfo.actionLink: object expected"); - message.actionLink = $root.proto.ActionLink.fromObject(object.actionLink); + var message = new $root.proto.NativeFlowMessage(); + if (object.buttons) { + if (!Array.isArray(object.buttons)) + throw TypeError(".proto.NativeFlowMessage.buttons: array expected"); + message.buttons = []; + for (var i = 0; i < object.buttons.length; ++i) { + if (typeof object.buttons[i] !== "object") + throw TypeError(".proto.NativeFlowMessage.buttons: object expected"); + message.buttons[i] = $root.proto.NativeFlowButton.fromObject(object.buttons[i]); + } } - if (object.groupSubject != null) - message.groupSubject = String(object.groupSubject); - if (object.parentGroupJid != null) - message.parentGroupJid = String(object.parentGroupJid); + if (object.messageParamsJson != null) + message.messageParamsJson = String(object.messageParamsJson); + if (object.messageVersion != null) + message.messageVersion = object.messageVersion | 0; return message; }; /** - * Creates a plain object from a ContextInfo message. Also converts values to other types if specified. + * Creates a plain object from a NativeFlowMessage message. Also converts values to other types if specified. * @function toObject - * @memberof proto.ContextInfo + * @memberof proto.NativeFlowMessage * @static - * @param {proto.ContextInfo} message ContextInfo + * @param {proto.NativeFlowMessage} message NativeFlowMessage * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ContextInfo.toObject = function toObject(message, options) { + NativeFlowMessage.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) - object.mentionedJid = []; + object.buttons = []; if (options.defaults) { - object.stanzaId = ""; - object.participant = ""; - object.quotedMessage = null; - object.remoteJid = ""; - object.conversionSource = ""; - if (options.bytes === String) - object.conversionData = ""; - else { - object.conversionData = []; - if (options.bytes !== Array) - object.conversionData = $util.newBuffer(object.conversionData); - } - object.conversionDelaySeconds = 0; - object.forwardingScore = 0; - object.isForwarded = false; - object.quotedAd = null; - object.placeholderKey = null; - object.expiration = 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.ephemeralSettingTimestamp = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.ephemeralSettingTimestamp = options.longs === String ? "0" : 0; - if (options.bytes === String) - object.ephemeralSharedSecret = ""; - else { - object.ephemeralSharedSecret = []; - if (options.bytes !== Array) - object.ephemeralSharedSecret = $util.newBuffer(object.ephemeralSharedSecret); - } - object.externalAdReply = null; - object.entryPointConversionSource = ""; - object.entryPointConversionApp = ""; - object.entryPointConversionDelaySeconds = 0; - object.disappearingMode = null; - object.actionLink = null; - object.groupSubject = ""; - object.parentGroupJid = ""; + object.messageParamsJson = ""; + object.messageVersion = 0; } - if (message.stanzaId != null && message.hasOwnProperty("stanzaId")) - object.stanzaId = message.stanzaId; - if (message.participant != null && message.hasOwnProperty("participant")) - object.participant = message.participant; - if (message.quotedMessage != null && message.hasOwnProperty("quotedMessage")) - object.quotedMessage = $root.proto.Message.toObject(message.quotedMessage, options); - if (message.remoteJid != null && message.hasOwnProperty("remoteJid")) - object.remoteJid = message.remoteJid; - if (message.mentionedJid && message.mentionedJid.length) { - object.mentionedJid = []; - for (var j = 0; j < message.mentionedJid.length; ++j) - object.mentionedJid[j] = message.mentionedJid[j]; + if (message.buttons && message.buttons.length) { + object.buttons = []; + for (var j = 0; j < message.buttons.length; ++j) + object.buttons[j] = $root.proto.NativeFlowButton.toObject(message.buttons[j], options); } - if (message.conversionSource != null && message.hasOwnProperty("conversionSource")) - object.conversionSource = message.conversionSource; - if (message.conversionData != null && message.hasOwnProperty("conversionData")) - object.conversionData = options.bytes === String ? $util.base64.encode(message.conversionData, 0, message.conversionData.length) : options.bytes === Array ? Array.prototype.slice.call(message.conversionData) : message.conversionData; - if (message.conversionDelaySeconds != null && message.hasOwnProperty("conversionDelaySeconds")) - object.conversionDelaySeconds = message.conversionDelaySeconds; - if (message.forwardingScore != null && message.hasOwnProperty("forwardingScore")) - object.forwardingScore = message.forwardingScore; - if (message.isForwarded != null && message.hasOwnProperty("isForwarded")) - object.isForwarded = message.isForwarded; - if (message.quotedAd != null && message.hasOwnProperty("quotedAd")) - object.quotedAd = $root.proto.AdReplyInfo.toObject(message.quotedAd, options); - if (message.placeholderKey != null && message.hasOwnProperty("placeholderKey")) - object.placeholderKey = $root.proto.MessageKey.toObject(message.placeholderKey, options); - if (message.expiration != null && message.hasOwnProperty("expiration")) - object.expiration = message.expiration; - if (message.ephemeralSettingTimestamp != null && message.hasOwnProperty("ephemeralSettingTimestamp")) - if (typeof message.ephemeralSettingTimestamp === "number") - object.ephemeralSettingTimestamp = options.longs === String ? String(message.ephemeralSettingTimestamp) : message.ephemeralSettingTimestamp; - else - object.ephemeralSettingTimestamp = options.longs === String ? $util.Long.prototype.toString.call(message.ephemeralSettingTimestamp) : options.longs === Number ? new $util.LongBits(message.ephemeralSettingTimestamp.low >>> 0, message.ephemeralSettingTimestamp.high >>> 0).toNumber() : message.ephemeralSettingTimestamp; - if (message.ephemeralSharedSecret != null && message.hasOwnProperty("ephemeralSharedSecret")) - object.ephemeralSharedSecret = options.bytes === String ? $util.base64.encode(message.ephemeralSharedSecret, 0, message.ephemeralSharedSecret.length) : options.bytes === Array ? Array.prototype.slice.call(message.ephemeralSharedSecret) : message.ephemeralSharedSecret; - if (message.externalAdReply != null && message.hasOwnProperty("externalAdReply")) - object.externalAdReply = $root.proto.ExternalAdReplyInfo.toObject(message.externalAdReply, options); - if (message.entryPointConversionSource != null && message.hasOwnProperty("entryPointConversionSource")) - object.entryPointConversionSource = message.entryPointConversionSource; - if (message.entryPointConversionApp != null && message.hasOwnProperty("entryPointConversionApp")) - object.entryPointConversionApp = message.entryPointConversionApp; - if (message.entryPointConversionDelaySeconds != null && message.hasOwnProperty("entryPointConversionDelaySeconds")) - object.entryPointConversionDelaySeconds = message.entryPointConversionDelaySeconds; - if (message.disappearingMode != null && message.hasOwnProperty("disappearingMode")) - object.disappearingMode = $root.proto.DisappearingMode.toObject(message.disappearingMode, options); - if (message.actionLink != null && message.hasOwnProperty("actionLink")) - object.actionLink = $root.proto.ActionLink.toObject(message.actionLink, options); - if (message.groupSubject != null && message.hasOwnProperty("groupSubject")) - object.groupSubject = message.groupSubject; - if (message.parentGroupJid != null && message.hasOwnProperty("parentGroupJid")) - object.parentGroupJid = message.parentGroupJid; + if (message.messageParamsJson != null && message.hasOwnProperty("messageParamsJson")) + object.messageParamsJson = message.messageParamsJson; + if (message.messageVersion != null && message.hasOwnProperty("messageVersion")) + object.messageVersion = message.messageVersion; return object; }; /** - * Converts this ContextInfo to JSON. + * Converts this NativeFlowMessage to JSON. * @function toJSON - * @memberof proto.ContextInfo + * @memberof proto.NativeFlowMessage * @instance * @returns {Object.} JSON object */ - ContextInfo.prototype.toJSON = function toJSON() { + NativeFlowMessage.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ContextInfo; + return NativeFlowMessage; })(); - proto.SenderKeyDistributionMessage = (function() { + proto.NativeFlowResponseMessage = (function() { /** - * Properties of a SenderKeyDistributionMessage. + * Properties of a NativeFlowResponseMessage. * @memberof proto - * @interface ISenderKeyDistributionMessage - * @property {string|null} [groupId] SenderKeyDistributionMessage groupId - * @property {Uint8Array|null} [axolotlSenderKeyDistributionMessage] SenderKeyDistributionMessage axolotlSenderKeyDistributionMessage + * @interface INativeFlowResponseMessage + * @property {string|null} [name] NativeFlowResponseMessage name + * @property {string|null} [paramsJson] NativeFlowResponseMessage paramsJson + * @property {number|null} [version] NativeFlowResponseMessage version */ /** - * Constructs a new SenderKeyDistributionMessage. + * Constructs a new NativeFlowResponseMessage. * @memberof proto - * @classdesc Represents a SenderKeyDistributionMessage. - * @implements ISenderKeyDistributionMessage + * @classdesc Represents a NativeFlowResponseMessage. + * @implements INativeFlowResponseMessage * @constructor - * @param {proto.ISenderKeyDistributionMessage=} [properties] Properties to set + * @param {proto.INativeFlowResponseMessage=} [properties] Properties to set */ - function SenderKeyDistributionMessage(properties) { + function NativeFlowResponseMessage(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -22931,88 +23748,101 @@ $root.proto = (function() { } /** - * SenderKeyDistributionMessage groupId. - * @member {string} groupId - * @memberof proto.SenderKeyDistributionMessage + * NativeFlowResponseMessage name. + * @member {string} name + * @memberof proto.NativeFlowResponseMessage * @instance */ - SenderKeyDistributionMessage.prototype.groupId = ""; + NativeFlowResponseMessage.prototype.name = ""; /** - * SenderKeyDistributionMessage axolotlSenderKeyDistributionMessage. - * @member {Uint8Array} axolotlSenderKeyDistributionMessage - * @memberof proto.SenderKeyDistributionMessage + * NativeFlowResponseMessage paramsJson. + * @member {string} paramsJson + * @memberof proto.NativeFlowResponseMessage * @instance */ - SenderKeyDistributionMessage.prototype.axolotlSenderKeyDistributionMessage = $util.newBuffer([]); + NativeFlowResponseMessage.prototype.paramsJson = ""; /** - * Creates a new SenderKeyDistributionMessage instance using the specified properties. + * NativeFlowResponseMessage version. + * @member {number} version + * @memberof proto.NativeFlowResponseMessage + * @instance + */ + NativeFlowResponseMessage.prototype.version = 0; + + /** + * Creates a new NativeFlowResponseMessage instance using the specified properties. * @function create - * @memberof proto.SenderKeyDistributionMessage + * @memberof proto.NativeFlowResponseMessage * @static - * @param {proto.ISenderKeyDistributionMessage=} [properties] Properties to set - * @returns {proto.SenderKeyDistributionMessage} SenderKeyDistributionMessage instance + * @param {proto.INativeFlowResponseMessage=} [properties] Properties to set + * @returns {proto.NativeFlowResponseMessage} NativeFlowResponseMessage instance */ - SenderKeyDistributionMessage.create = function create(properties) { - return new SenderKeyDistributionMessage(properties); + NativeFlowResponseMessage.create = function create(properties) { + return new NativeFlowResponseMessage(properties); }; /** - * Encodes the specified SenderKeyDistributionMessage message. Does not implicitly {@link proto.SenderKeyDistributionMessage.verify|verify} messages. + * Encodes the specified NativeFlowResponseMessage message. Does not implicitly {@link proto.NativeFlowResponseMessage.verify|verify} messages. * @function encode - * @memberof proto.SenderKeyDistributionMessage + * @memberof proto.NativeFlowResponseMessage * @static - * @param {proto.ISenderKeyDistributionMessage} message SenderKeyDistributionMessage message or plain object to encode + * @param {proto.INativeFlowResponseMessage} message NativeFlowResponseMessage message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SenderKeyDistributionMessage.encode = function encode(message, writer) { + NativeFlowResponseMessage.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.groupId != null && Object.hasOwnProperty.call(message, "groupId")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.groupId); - if (message.axolotlSenderKeyDistributionMessage != null && Object.hasOwnProperty.call(message, "axolotlSenderKeyDistributionMessage")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.axolotlSenderKeyDistributionMessage); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.paramsJson != null && Object.hasOwnProperty.call(message, "paramsJson")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.paramsJson); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.version); return writer; }; /** - * Encodes the specified SenderKeyDistributionMessage message, length delimited. Does not implicitly {@link proto.SenderKeyDistributionMessage.verify|verify} messages. + * Encodes the specified NativeFlowResponseMessage message, length delimited. Does not implicitly {@link proto.NativeFlowResponseMessage.verify|verify} messages. * @function encodeDelimited - * @memberof proto.SenderKeyDistributionMessage + * @memberof proto.NativeFlowResponseMessage * @static - * @param {proto.ISenderKeyDistributionMessage} message SenderKeyDistributionMessage message or plain object to encode + * @param {proto.INativeFlowResponseMessage} message NativeFlowResponseMessage message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SenderKeyDistributionMessage.encodeDelimited = function encodeDelimited(message, writer) { + NativeFlowResponseMessage.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a SenderKeyDistributionMessage message from the specified reader or buffer. + * Decodes a NativeFlowResponseMessage message from the specified reader or buffer. * @function decode - * @memberof proto.SenderKeyDistributionMessage + * @memberof proto.NativeFlowResponseMessage * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {proto.SenderKeyDistributionMessage} SenderKeyDistributionMessage + * @returns {proto.NativeFlowResponseMessage} NativeFlowResponseMessage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SenderKeyDistributionMessage.decode = function decode(reader, length) { + NativeFlowResponseMessage.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.SenderKeyDistributionMessage(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.NativeFlowResponseMessage(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.groupId = reader.string(); + message.name = reader.string(); break; case 2: - message.axolotlSenderKeyDistributionMessage = reader.bytes(); + message.paramsJson = reader.string(); + break; + case 3: + message.version = reader.int32(); break; default: reader.skipType(tag & 7); @@ -23023,152 +23853,124 @@ $root.proto = (function() { }; /** - * Decodes a SenderKeyDistributionMessage message from the specified reader or buffer, length delimited. + * Decodes a NativeFlowResponseMessage message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof proto.SenderKeyDistributionMessage + * @memberof proto.NativeFlowResponseMessage * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.SenderKeyDistributionMessage} SenderKeyDistributionMessage + * @returns {proto.NativeFlowResponseMessage} NativeFlowResponseMessage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SenderKeyDistributionMessage.decodeDelimited = function decodeDelimited(reader) { + NativeFlowResponseMessage.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a SenderKeyDistributionMessage message. + * Verifies a NativeFlowResponseMessage message. * @function verify - * @memberof proto.SenderKeyDistributionMessage + * @memberof proto.NativeFlowResponseMessage * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - SenderKeyDistributionMessage.verify = function verify(message) { + NativeFlowResponseMessage.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.groupId != null && message.hasOwnProperty("groupId")) - if (!$util.isString(message.groupId)) - return "groupId: string expected"; - if (message.axolotlSenderKeyDistributionMessage != null && message.hasOwnProperty("axolotlSenderKeyDistributionMessage")) - if (!(message.axolotlSenderKeyDistributionMessage && typeof message.axolotlSenderKeyDistributionMessage.length === "number" || $util.isString(message.axolotlSenderKeyDistributionMessage))) - return "axolotlSenderKeyDistributionMessage: buffer expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.paramsJson != null && message.hasOwnProperty("paramsJson")) + if (!$util.isString(message.paramsJson)) + return "paramsJson: string expected"; + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isInteger(message.version)) + return "version: integer expected"; return null; }; /** - * Creates a SenderKeyDistributionMessage message from a plain object. Also converts values to their respective internal types. + * Creates a NativeFlowResponseMessage message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof proto.SenderKeyDistributionMessage + * @memberof proto.NativeFlowResponseMessage * @static * @param {Object.} object Plain object - * @returns {proto.SenderKeyDistributionMessage} SenderKeyDistributionMessage + * @returns {proto.NativeFlowResponseMessage} NativeFlowResponseMessage */ - SenderKeyDistributionMessage.fromObject = function fromObject(object) { - if (object instanceof $root.proto.SenderKeyDistributionMessage) + NativeFlowResponseMessage.fromObject = function fromObject(object) { + if (object instanceof $root.proto.NativeFlowResponseMessage) return object; - var message = new $root.proto.SenderKeyDistributionMessage(); - if (object.groupId != null) - message.groupId = String(object.groupId); - if (object.axolotlSenderKeyDistributionMessage != null) - if (typeof object.axolotlSenderKeyDistributionMessage === "string") - $util.base64.decode(object.axolotlSenderKeyDistributionMessage, message.axolotlSenderKeyDistributionMessage = $util.newBuffer($util.base64.length(object.axolotlSenderKeyDistributionMessage)), 0); - else if (object.axolotlSenderKeyDistributionMessage.length) - message.axolotlSenderKeyDistributionMessage = object.axolotlSenderKeyDistributionMessage; + var message = new $root.proto.NativeFlowResponseMessage(); + if (object.name != null) + message.name = String(object.name); + if (object.paramsJson != null) + message.paramsJson = String(object.paramsJson); + if (object.version != null) + message.version = object.version | 0; return message; }; /** - * Creates a plain object from a SenderKeyDistributionMessage message. Also converts values to other types if specified. + * Creates a plain object from a NativeFlowResponseMessage message. Also converts values to other types if specified. * @function toObject - * @memberof proto.SenderKeyDistributionMessage + * @memberof proto.NativeFlowResponseMessage * @static - * @param {proto.SenderKeyDistributionMessage} message SenderKeyDistributionMessage + * @param {proto.NativeFlowResponseMessage} message NativeFlowResponseMessage * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SenderKeyDistributionMessage.toObject = function toObject(message, options) { + NativeFlowResponseMessage.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.groupId = ""; - if (options.bytes === String) - object.axolotlSenderKeyDistributionMessage = ""; - else { - object.axolotlSenderKeyDistributionMessage = []; - if (options.bytes !== Array) - object.axolotlSenderKeyDistributionMessage = $util.newBuffer(object.axolotlSenderKeyDistributionMessage); - } + object.name = ""; + object.paramsJson = ""; + object.version = 0; } - if (message.groupId != null && message.hasOwnProperty("groupId")) - object.groupId = message.groupId; - if (message.axolotlSenderKeyDistributionMessage != null && message.hasOwnProperty("axolotlSenderKeyDistributionMessage")) - object.axolotlSenderKeyDistributionMessage = options.bytes === String ? $util.base64.encode(message.axolotlSenderKeyDistributionMessage, 0, message.axolotlSenderKeyDistributionMessage.length) : options.bytes === Array ? Array.prototype.slice.call(message.axolotlSenderKeyDistributionMessage) : message.axolotlSenderKeyDistributionMessage; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.paramsJson != null && message.hasOwnProperty("paramsJson")) + object.paramsJson = message.paramsJson; + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; return object; }; /** - * Converts this SenderKeyDistributionMessage to JSON. + * Converts this NativeFlowResponseMessage to JSON. * @function toJSON - * @memberof proto.SenderKeyDistributionMessage + * @memberof proto.NativeFlowResponseMessage * @instance * @returns {Object.} JSON object */ - SenderKeyDistributionMessage.prototype.toJSON = function toJSON() { + NativeFlowResponseMessage.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return SenderKeyDistributionMessage; + return NativeFlowResponseMessage; })(); - proto.ImageMessage = (function() { + proto.Option = (function() { /** - * Properties of an ImageMessage. + * Properties of an Option. * @memberof proto - * @interface IImageMessage - * @property {string|null} [url] ImageMessage url - * @property {string|null} [mimetype] ImageMessage mimetype - * @property {string|null} [caption] ImageMessage caption - * @property {Uint8Array|null} [fileSha256] ImageMessage fileSha256 - * @property {number|Long|null} [fileLength] ImageMessage fileLength - * @property {number|null} [height] ImageMessage height - * @property {number|null} [width] ImageMessage width - * @property {Uint8Array|null} [mediaKey] ImageMessage mediaKey - * @property {Uint8Array|null} [fileEncSha256] ImageMessage fileEncSha256 - * @property {Array.|null} [interactiveAnnotations] ImageMessage interactiveAnnotations - * @property {string|null} [directPath] ImageMessage directPath - * @property {number|Long|null} [mediaKeyTimestamp] ImageMessage mediaKeyTimestamp - * @property {Uint8Array|null} [jpegThumbnail] ImageMessage jpegThumbnail - * @property {proto.IContextInfo|null} [contextInfo] ImageMessage contextInfo - * @property {Uint8Array|null} [firstScanSidecar] ImageMessage firstScanSidecar - * @property {number|null} [firstScanLength] ImageMessage firstScanLength - * @property {number|null} [experimentGroupId] ImageMessage experimentGroupId - * @property {Uint8Array|null} [scansSidecar] ImageMessage scansSidecar - * @property {Array.|null} [scanLengths] ImageMessage scanLengths - * @property {Uint8Array|null} [midQualityFileSha256] ImageMessage midQualityFileSha256 - * @property {Uint8Array|null} [midQualityFileEncSha256] ImageMessage midQualityFileEncSha256 - * @property {boolean|null} [viewOnce] ImageMessage viewOnce - * @property {string|null} [thumbnailDirectPath] ImageMessage thumbnailDirectPath - * @property {Uint8Array|null} [thumbnailSha256] ImageMessage thumbnailSha256 - * @property {Uint8Array|null} [thumbnailEncSha256] ImageMessage thumbnailEncSha256 - * @property {string|null} [staticUrl] ImageMessage staticUrl + * @interface IOption + * @property {string|null} [optionName] Option optionName */ /** - * Constructs a new ImageMessage. + * Constructs a new Option. * @memberof proto - * @classdesc Represents an ImageMessage. - * @implements IImageMessage + * @classdesc Represents an Option. + * @implements IOption * @constructor - * @param {proto.IImageMessage=} [properties] Properties to set + * @param {proto.IOption=} [properties] Properties to set */ - function ImageMessage(properties) { - this.interactiveAnnotations = []; - this.scanLengths = []; + function Option(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -23176,412 +23978,417 @@ $root.proto = (function() { } /** - * ImageMessage url. - * @member {string} url - * @memberof proto.ImageMessage + * Option optionName. + * @member {string} optionName + * @memberof proto.Option * @instance */ - ImageMessage.prototype.url = ""; + Option.prototype.optionName = ""; /** - * ImageMessage mimetype. - * @member {string} mimetype - * @memberof proto.ImageMessage - * @instance + * Creates a new Option instance using the specified properties. + * @function create + * @memberof proto.Option + * @static + * @param {proto.IOption=} [properties] Properties to set + * @returns {proto.Option} Option instance */ - ImageMessage.prototype.mimetype = ""; + Option.create = function create(properties) { + return new Option(properties); + }; /** - * ImageMessage caption. - * @member {string} caption - * @memberof proto.ImageMessage - * @instance + * Encodes the specified Option message. Does not implicitly {@link proto.Option.verify|verify} messages. + * @function encode + * @memberof proto.Option + * @static + * @param {proto.IOption} message Option message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - ImageMessage.prototype.caption = ""; + Option.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.optionName != null && Object.hasOwnProperty.call(message, "optionName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.optionName); + return writer; + }; /** - * ImageMessage fileSha256. - * @member {Uint8Array} fileSha256 - * @memberof proto.ImageMessage - * @instance + * Encodes the specified Option message, length delimited. Does not implicitly {@link proto.Option.verify|verify} messages. + * @function encodeDelimited + * @memberof proto.Option + * @static + * @param {proto.IOption} message Option message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - ImageMessage.prototype.fileSha256 = $util.newBuffer([]); + Option.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; /** - * ImageMessage fileLength. - * @member {number|Long} fileLength - * @memberof proto.ImageMessage - * @instance + * Decodes an Option message from the specified reader or buffer. + * @function decode + * @memberof proto.Option + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {proto.Option} Option + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ImageMessage.prototype.fileLength = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + Option.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.Option(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.optionName = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; /** - * ImageMessage height. - * @member {number} height - * @memberof proto.ImageMessage - * @instance + * Decodes an Option message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof proto.Option + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {proto.Option} Option + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ImageMessage.prototype.height = 0; + Option.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; /** - * ImageMessage width. - * @member {number} width - * @memberof proto.ImageMessage - * @instance + * Verifies an Option message. + * @function verify + * @memberof proto.Option + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ImageMessage.prototype.width = 0; + Option.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.optionName != null && message.hasOwnProperty("optionName")) + if (!$util.isString(message.optionName)) + return "optionName: string expected"; + return null; + }; /** - * ImageMessage mediaKey. - * @member {Uint8Array} mediaKey - * @memberof proto.ImageMessage - * @instance + * Creates an Option message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof proto.Option + * @static + * @param {Object.} object Plain object + * @returns {proto.Option} Option */ - ImageMessage.prototype.mediaKey = $util.newBuffer([]); + Option.fromObject = function fromObject(object) { + if (object instanceof $root.proto.Option) + return object; + var message = new $root.proto.Option(); + if (object.optionName != null) + message.optionName = String(object.optionName); + return message; + }; /** - * ImageMessage fileEncSha256. - * @member {Uint8Array} fileEncSha256 - * @memberof proto.ImageMessage - * @instance + * Creates a plain object from an Option message. Also converts values to other types if specified. + * @function toObject + * @memberof proto.Option + * @static + * @param {proto.Option} message Option + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object */ - ImageMessage.prototype.fileEncSha256 = $util.newBuffer([]); + Option.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.optionName = ""; + if (message.optionName != null && message.hasOwnProperty("optionName")) + object.optionName = message.optionName; + return object; + }; /** - * ImageMessage interactiveAnnotations. - * @member {Array.} interactiveAnnotations - * @memberof proto.ImageMessage + * Converts this Option to JSON. + * @function toJSON + * @memberof proto.Option * @instance + * @returns {Object.} JSON object */ - ImageMessage.prototype.interactiveAnnotations = $util.emptyArray; + Option.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * ImageMessage directPath. - * @member {string} directPath - * @memberof proto.ImageMessage - * @instance - */ - ImageMessage.prototype.directPath = ""; + return Option; + })(); + + proto.OrderMessage = (function() { /** - * ImageMessage mediaKeyTimestamp. - * @member {number|Long} mediaKeyTimestamp - * @memberof proto.ImageMessage - * @instance - */ - ImageMessage.prototype.mediaKeyTimestamp = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * ImageMessage jpegThumbnail. - * @member {Uint8Array} jpegThumbnail - * @memberof proto.ImageMessage - * @instance + * Properties of an OrderMessage. + * @memberof proto + * @interface IOrderMessage + * @property {string|null} [orderId] OrderMessage orderId + * @property {Uint8Array|null} [thumbnail] OrderMessage thumbnail + * @property {number|null} [itemCount] OrderMessage itemCount + * @property {proto.OrderMessage.OrderMessageOrderStatus|null} [status] OrderMessage status + * @property {proto.OrderMessage.OrderMessageOrderSurface|null} [surface] OrderMessage surface + * @property {string|null} [message] OrderMessage message + * @property {string|null} [orderTitle] OrderMessage orderTitle + * @property {string|null} [sellerJid] OrderMessage sellerJid + * @property {string|null} [token] OrderMessage token + * @property {number|Long|null} [totalAmount1000] OrderMessage totalAmount1000 + * @property {string|null} [totalCurrencyCode] OrderMessage totalCurrencyCode + * @property {proto.IContextInfo|null} [contextInfo] OrderMessage contextInfo */ - ImageMessage.prototype.jpegThumbnail = $util.newBuffer([]); /** - * ImageMessage contextInfo. - * @member {proto.IContextInfo|null|undefined} contextInfo - * @memberof proto.ImageMessage - * @instance + * Constructs a new OrderMessage. + * @memberof proto + * @classdesc Represents an OrderMessage. + * @implements IOrderMessage + * @constructor + * @param {proto.IOrderMessage=} [properties] Properties to set */ - ImageMessage.prototype.contextInfo = null; + function OrderMessage(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } /** - * ImageMessage firstScanSidecar. - * @member {Uint8Array} firstScanSidecar - * @memberof proto.ImageMessage + * OrderMessage orderId. + * @member {string} orderId + * @memberof proto.OrderMessage * @instance */ - ImageMessage.prototype.firstScanSidecar = $util.newBuffer([]); + OrderMessage.prototype.orderId = ""; /** - * ImageMessage firstScanLength. - * @member {number} firstScanLength - * @memberof proto.ImageMessage + * OrderMessage thumbnail. + * @member {Uint8Array} thumbnail + * @memberof proto.OrderMessage * @instance */ - ImageMessage.prototype.firstScanLength = 0; + OrderMessage.prototype.thumbnail = $util.newBuffer([]); /** - * ImageMessage experimentGroupId. - * @member {number} experimentGroupId - * @memberof proto.ImageMessage + * OrderMessage itemCount. + * @member {number} itemCount + * @memberof proto.OrderMessage * @instance */ - ImageMessage.prototype.experimentGroupId = 0; + OrderMessage.prototype.itemCount = 0; /** - * ImageMessage scansSidecar. - * @member {Uint8Array} scansSidecar - * @memberof proto.ImageMessage + * OrderMessage status. + * @member {proto.OrderMessage.OrderMessageOrderStatus} status + * @memberof proto.OrderMessage * @instance */ - ImageMessage.prototype.scansSidecar = $util.newBuffer([]); + OrderMessage.prototype.status = 1; /** - * ImageMessage scanLengths. - * @member {Array.} scanLengths - * @memberof proto.ImageMessage + * OrderMessage surface. + * @member {proto.OrderMessage.OrderMessageOrderSurface} surface + * @memberof proto.OrderMessage * @instance */ - ImageMessage.prototype.scanLengths = $util.emptyArray; + OrderMessage.prototype.surface = 1; /** - * ImageMessage midQualityFileSha256. - * @member {Uint8Array} midQualityFileSha256 - * @memberof proto.ImageMessage + * OrderMessage message. + * @member {string} message + * @memberof proto.OrderMessage * @instance */ - ImageMessage.prototype.midQualityFileSha256 = $util.newBuffer([]); + OrderMessage.prototype.message = ""; /** - * ImageMessage midQualityFileEncSha256. - * @member {Uint8Array} midQualityFileEncSha256 - * @memberof proto.ImageMessage + * OrderMessage orderTitle. + * @member {string} orderTitle + * @memberof proto.OrderMessage * @instance */ - ImageMessage.prototype.midQualityFileEncSha256 = $util.newBuffer([]); + OrderMessage.prototype.orderTitle = ""; /** - * ImageMessage viewOnce. - * @member {boolean} viewOnce - * @memberof proto.ImageMessage + * OrderMessage sellerJid. + * @member {string} sellerJid + * @memberof proto.OrderMessage * @instance */ - ImageMessage.prototype.viewOnce = false; + OrderMessage.prototype.sellerJid = ""; /** - * ImageMessage thumbnailDirectPath. - * @member {string} thumbnailDirectPath - * @memberof proto.ImageMessage + * OrderMessage token. + * @member {string} token + * @memberof proto.OrderMessage * @instance */ - ImageMessage.prototype.thumbnailDirectPath = ""; + OrderMessage.prototype.token = ""; /** - * ImageMessage thumbnailSha256. - * @member {Uint8Array} thumbnailSha256 - * @memberof proto.ImageMessage + * OrderMessage totalAmount1000. + * @member {number|Long} totalAmount1000 + * @memberof proto.OrderMessage * @instance */ - ImageMessage.prototype.thumbnailSha256 = $util.newBuffer([]); + OrderMessage.prototype.totalAmount1000 = $util.Long ? $util.Long.fromBits(0,0,false) : 0; /** - * ImageMessage thumbnailEncSha256. - * @member {Uint8Array} thumbnailEncSha256 - * @memberof proto.ImageMessage + * OrderMessage totalCurrencyCode. + * @member {string} totalCurrencyCode + * @memberof proto.OrderMessage * @instance */ - ImageMessage.prototype.thumbnailEncSha256 = $util.newBuffer([]); + OrderMessage.prototype.totalCurrencyCode = ""; /** - * ImageMessage staticUrl. - * @member {string} staticUrl - * @memberof proto.ImageMessage + * OrderMessage contextInfo. + * @member {proto.IContextInfo|null|undefined} contextInfo + * @memberof proto.OrderMessage * @instance */ - ImageMessage.prototype.staticUrl = ""; + OrderMessage.prototype.contextInfo = null; /** - * Creates a new ImageMessage instance using the specified properties. + * Creates a new OrderMessage instance using the specified properties. * @function create - * @memberof proto.ImageMessage + * @memberof proto.OrderMessage * @static - * @param {proto.IImageMessage=} [properties] Properties to set - * @returns {proto.ImageMessage} ImageMessage instance + * @param {proto.IOrderMessage=} [properties] Properties to set + * @returns {proto.OrderMessage} OrderMessage instance */ - ImageMessage.create = function create(properties) { - return new ImageMessage(properties); + OrderMessage.create = function create(properties) { + return new OrderMessage(properties); }; /** - * Encodes the specified ImageMessage message. Does not implicitly {@link proto.ImageMessage.verify|verify} messages. + * Encodes the specified OrderMessage message. Does not implicitly {@link proto.OrderMessage.verify|verify} messages. * @function encode - * @memberof proto.ImageMessage + * @memberof proto.OrderMessage * @static - * @param {proto.IImageMessage} message ImageMessage message or plain object to encode + * @param {proto.IOrderMessage} message OrderMessage message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ImageMessage.encode = function encode(message, writer) { + OrderMessage.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.url != null && Object.hasOwnProperty.call(message, "url")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.url); - if (message.mimetype != null && Object.hasOwnProperty.call(message, "mimetype")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.mimetype); - if (message.caption != null && Object.hasOwnProperty.call(message, "caption")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.caption); - if (message.fileSha256 != null && Object.hasOwnProperty.call(message, "fileSha256")) - writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.fileSha256); - if (message.fileLength != null && Object.hasOwnProperty.call(message, "fileLength")) - writer.uint32(/* id 5, wireType 0 =*/40).uint64(message.fileLength); - if (message.height != null && Object.hasOwnProperty.call(message, "height")) - writer.uint32(/* id 6, wireType 0 =*/48).uint32(message.height); - if (message.width != null && Object.hasOwnProperty.call(message, "width")) - writer.uint32(/* id 7, wireType 0 =*/56).uint32(message.width); - if (message.mediaKey != null && Object.hasOwnProperty.call(message, "mediaKey")) - writer.uint32(/* id 8, wireType 2 =*/66).bytes(message.mediaKey); - if (message.fileEncSha256 != null && Object.hasOwnProperty.call(message, "fileEncSha256")) - writer.uint32(/* id 9, wireType 2 =*/74).bytes(message.fileEncSha256); - if (message.interactiveAnnotations != null && message.interactiveAnnotations.length) - for (var i = 0; i < message.interactiveAnnotations.length; ++i) - $root.proto.InteractiveAnnotation.encode(message.interactiveAnnotations[i], writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); - if (message.directPath != null && Object.hasOwnProperty.call(message, "directPath")) - writer.uint32(/* id 11, wireType 2 =*/90).string(message.directPath); - if (message.mediaKeyTimestamp != null && Object.hasOwnProperty.call(message, "mediaKeyTimestamp")) - writer.uint32(/* id 12, wireType 0 =*/96).int64(message.mediaKeyTimestamp); - if (message.jpegThumbnail != null && Object.hasOwnProperty.call(message, "jpegThumbnail")) - writer.uint32(/* id 16, wireType 2 =*/130).bytes(message.jpegThumbnail); + if (message.orderId != null && Object.hasOwnProperty.call(message, "orderId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.orderId); + if (message.thumbnail != null && Object.hasOwnProperty.call(message, "thumbnail")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.thumbnail); + if (message.itemCount != null && Object.hasOwnProperty.call(message, "itemCount")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.itemCount); + if (message.status != null && Object.hasOwnProperty.call(message, "status")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.status); + if (message.surface != null && Object.hasOwnProperty.call(message, "surface")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.surface); + if (message.message != null && Object.hasOwnProperty.call(message, "message")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.message); + if (message.orderTitle != null && Object.hasOwnProperty.call(message, "orderTitle")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.orderTitle); + if (message.sellerJid != null && Object.hasOwnProperty.call(message, "sellerJid")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.sellerJid); + if (message.token != null && Object.hasOwnProperty.call(message, "token")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.token); + if (message.totalAmount1000 != null && Object.hasOwnProperty.call(message, "totalAmount1000")) + writer.uint32(/* id 10, wireType 0 =*/80).int64(message.totalAmount1000); + if (message.totalCurrencyCode != null && Object.hasOwnProperty.call(message, "totalCurrencyCode")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.totalCurrencyCode); if (message.contextInfo != null && Object.hasOwnProperty.call(message, "contextInfo")) $root.proto.ContextInfo.encode(message.contextInfo, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); - if (message.firstScanSidecar != null && Object.hasOwnProperty.call(message, "firstScanSidecar")) - writer.uint32(/* id 18, wireType 2 =*/146).bytes(message.firstScanSidecar); - if (message.firstScanLength != null && Object.hasOwnProperty.call(message, "firstScanLength")) - writer.uint32(/* id 19, wireType 0 =*/152).uint32(message.firstScanLength); - if (message.experimentGroupId != null && Object.hasOwnProperty.call(message, "experimentGroupId")) - writer.uint32(/* id 20, wireType 0 =*/160).uint32(message.experimentGroupId); - if (message.scansSidecar != null && Object.hasOwnProperty.call(message, "scansSidecar")) - writer.uint32(/* id 21, wireType 2 =*/170).bytes(message.scansSidecar); - if (message.scanLengths != null && message.scanLengths.length) - for (var i = 0; i < message.scanLengths.length; ++i) - writer.uint32(/* id 22, wireType 0 =*/176).uint32(message.scanLengths[i]); - if (message.midQualityFileSha256 != null && Object.hasOwnProperty.call(message, "midQualityFileSha256")) - writer.uint32(/* id 23, wireType 2 =*/186).bytes(message.midQualityFileSha256); - if (message.midQualityFileEncSha256 != null && Object.hasOwnProperty.call(message, "midQualityFileEncSha256")) - writer.uint32(/* id 24, wireType 2 =*/194).bytes(message.midQualityFileEncSha256); - if (message.viewOnce != null && Object.hasOwnProperty.call(message, "viewOnce")) - writer.uint32(/* id 25, wireType 0 =*/200).bool(message.viewOnce); - if (message.thumbnailDirectPath != null && Object.hasOwnProperty.call(message, "thumbnailDirectPath")) - writer.uint32(/* id 26, wireType 2 =*/210).string(message.thumbnailDirectPath); - if (message.thumbnailSha256 != null && Object.hasOwnProperty.call(message, "thumbnailSha256")) - writer.uint32(/* id 27, wireType 2 =*/218).bytes(message.thumbnailSha256); - if (message.thumbnailEncSha256 != null && Object.hasOwnProperty.call(message, "thumbnailEncSha256")) - writer.uint32(/* id 28, wireType 2 =*/226).bytes(message.thumbnailEncSha256); - if (message.staticUrl != null && Object.hasOwnProperty.call(message, "staticUrl")) - writer.uint32(/* id 29, wireType 2 =*/234).string(message.staticUrl); return writer; }; /** - * Encodes the specified ImageMessage message, length delimited. Does not implicitly {@link proto.ImageMessage.verify|verify} messages. + * Encodes the specified OrderMessage message, length delimited. Does not implicitly {@link proto.OrderMessage.verify|verify} messages. * @function encodeDelimited - * @memberof proto.ImageMessage + * @memberof proto.OrderMessage * @static - * @param {proto.IImageMessage} message ImageMessage message or plain object to encode + * @param {proto.IOrderMessage} message OrderMessage message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ImageMessage.encodeDelimited = function encodeDelimited(message, writer) { + OrderMessage.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an ImageMessage message from the specified reader or buffer. + * Decodes an OrderMessage message from the specified reader or buffer. * @function decode - * @memberof proto.ImageMessage + * @memberof proto.OrderMessage * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {proto.ImageMessage} ImageMessage + * @returns {proto.OrderMessage} OrderMessage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ImageMessage.decode = function decode(reader, length) { + OrderMessage.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.ImageMessage(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.OrderMessage(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.url = reader.string(); + message.orderId = reader.string(); break; case 2: - message.mimetype = reader.string(); + message.thumbnail = reader.bytes(); break; case 3: - message.caption = reader.string(); + message.itemCount = reader.int32(); break; case 4: - message.fileSha256 = reader.bytes(); + message.status = reader.int32(); break; case 5: - message.fileLength = reader.uint64(); + message.surface = reader.int32(); break; case 6: - message.height = reader.uint32(); + message.message = reader.string(); break; case 7: - message.width = reader.uint32(); + message.orderTitle = reader.string(); break; case 8: - message.mediaKey = reader.bytes(); + message.sellerJid = reader.string(); break; case 9: - message.fileEncSha256 = reader.bytes(); + message.token = reader.string(); break; case 10: - if (!(message.interactiveAnnotations && message.interactiveAnnotations.length)) - message.interactiveAnnotations = []; - message.interactiveAnnotations.push($root.proto.InteractiveAnnotation.decode(reader, reader.uint32())); + message.totalAmount1000 = reader.int64(); break; case 11: - message.directPath = reader.string(); - break; - case 12: - message.mediaKeyTimestamp = reader.int64(); - break; - case 16: - message.jpegThumbnail = reader.bytes(); + message.totalCurrencyCode = reader.string(); break; case 17: message.contextInfo = $root.proto.ContextInfo.decode(reader, reader.uint32()); break; - case 18: - message.firstScanSidecar = reader.bytes(); - break; - case 19: - message.firstScanLength = reader.uint32(); - break; - case 20: - message.experimentGroupId = reader.uint32(); - break; - case 21: - message.scansSidecar = reader.bytes(); - break; - case 22: - if (!(message.scanLengths && message.scanLengths.length)) - message.scanLengths = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.scanLengths.push(reader.uint32()); - } else - message.scanLengths.push(reader.uint32()); - break; - case 23: - message.midQualityFileSha256 = reader.bytes(); - break; - case 24: - message.midQualityFileEncSha256 = reader.bytes(); - break; - case 25: - message.viewOnce = reader.bool(); - break; - case 26: - message.thumbnailDirectPath = reader.string(); - break; - case 27: - message.thumbnailSha256 = reader.bytes(); - break; - case 28: - message.thumbnailEncSha256 = reader.bytes(); - break; - case 29: - message.staticUrl = reader.string(); - break; default: reader.skipType(tag & 7); break; @@ -23591,471 +24398,273 @@ $root.proto = (function() { }; /** - * Decodes an ImageMessage message from the specified reader or buffer, length delimited. + * Decodes an OrderMessage message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof proto.ImageMessage + * @memberof proto.OrderMessage * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.ImageMessage} ImageMessage + * @returns {proto.OrderMessage} OrderMessage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ImageMessage.decodeDelimited = function decodeDelimited(reader) { + OrderMessage.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an ImageMessage message. + * Verifies an OrderMessage message. * @function verify - * @memberof proto.ImageMessage + * @memberof proto.OrderMessage * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ImageMessage.verify = function verify(message) { + OrderMessage.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.url != null && message.hasOwnProperty("url")) - if (!$util.isString(message.url)) - return "url: string expected"; - if (message.mimetype != null && message.hasOwnProperty("mimetype")) - if (!$util.isString(message.mimetype)) - return "mimetype: string expected"; - if (message.caption != null && message.hasOwnProperty("caption")) - if (!$util.isString(message.caption)) - return "caption: string expected"; - if (message.fileSha256 != null && message.hasOwnProperty("fileSha256")) - if (!(message.fileSha256 && typeof message.fileSha256.length === "number" || $util.isString(message.fileSha256))) - return "fileSha256: buffer expected"; - if (message.fileLength != null && message.hasOwnProperty("fileLength")) - if (!$util.isInteger(message.fileLength) && !(message.fileLength && $util.isInteger(message.fileLength.low) && $util.isInteger(message.fileLength.high))) - return "fileLength: integer|Long expected"; - if (message.height != null && message.hasOwnProperty("height")) - if (!$util.isInteger(message.height)) - return "height: integer expected"; - if (message.width != null && message.hasOwnProperty("width")) - if (!$util.isInteger(message.width)) - return "width: integer expected"; - if (message.mediaKey != null && message.hasOwnProperty("mediaKey")) - if (!(message.mediaKey && typeof message.mediaKey.length === "number" || $util.isString(message.mediaKey))) - return "mediaKey: buffer expected"; - if (message.fileEncSha256 != null && message.hasOwnProperty("fileEncSha256")) - if (!(message.fileEncSha256 && typeof message.fileEncSha256.length === "number" || $util.isString(message.fileEncSha256))) - return "fileEncSha256: buffer expected"; - if (message.interactiveAnnotations != null && message.hasOwnProperty("interactiveAnnotations")) { - if (!Array.isArray(message.interactiveAnnotations)) - return "interactiveAnnotations: array expected"; - for (var i = 0; i < message.interactiveAnnotations.length; ++i) { - var error = $root.proto.InteractiveAnnotation.verify(message.interactiveAnnotations[i]); - if (error) - return "interactiveAnnotations." + error; + if (message.orderId != null && message.hasOwnProperty("orderId")) + if (!$util.isString(message.orderId)) + return "orderId: string expected"; + if (message.thumbnail != null && message.hasOwnProperty("thumbnail")) + if (!(message.thumbnail && typeof message.thumbnail.length === "number" || $util.isString(message.thumbnail))) + return "thumbnail: buffer expected"; + if (message.itemCount != null && message.hasOwnProperty("itemCount")) + if (!$util.isInteger(message.itemCount)) + return "itemCount: integer expected"; + if (message.status != null && message.hasOwnProperty("status")) + switch (message.status) { + default: + return "status: enum value expected"; + case 1: + break; } - } - if (message.directPath != null && message.hasOwnProperty("directPath")) - if (!$util.isString(message.directPath)) - return "directPath: string expected"; - if (message.mediaKeyTimestamp != null && message.hasOwnProperty("mediaKeyTimestamp")) - if (!$util.isInteger(message.mediaKeyTimestamp) && !(message.mediaKeyTimestamp && $util.isInteger(message.mediaKeyTimestamp.low) && $util.isInteger(message.mediaKeyTimestamp.high))) - return "mediaKeyTimestamp: integer|Long expected"; - if (message.jpegThumbnail != null && message.hasOwnProperty("jpegThumbnail")) - if (!(message.jpegThumbnail && typeof message.jpegThumbnail.length === "number" || $util.isString(message.jpegThumbnail))) - return "jpegThumbnail: buffer expected"; + if (message.surface != null && message.hasOwnProperty("surface")) + switch (message.surface) { + default: + return "surface: enum value expected"; + case 1: + break; + } + if (message.message != null && message.hasOwnProperty("message")) + if (!$util.isString(message.message)) + return "message: string expected"; + if (message.orderTitle != null && message.hasOwnProperty("orderTitle")) + if (!$util.isString(message.orderTitle)) + return "orderTitle: string expected"; + if (message.sellerJid != null && message.hasOwnProperty("sellerJid")) + if (!$util.isString(message.sellerJid)) + return "sellerJid: string expected"; + if (message.token != null && message.hasOwnProperty("token")) + if (!$util.isString(message.token)) + return "token: string expected"; + if (message.totalAmount1000 != null && message.hasOwnProperty("totalAmount1000")) + if (!$util.isInteger(message.totalAmount1000) && !(message.totalAmount1000 && $util.isInteger(message.totalAmount1000.low) && $util.isInteger(message.totalAmount1000.high))) + return "totalAmount1000: integer|Long expected"; + if (message.totalCurrencyCode != null && message.hasOwnProperty("totalCurrencyCode")) + if (!$util.isString(message.totalCurrencyCode)) + return "totalCurrencyCode: string expected"; if (message.contextInfo != null && message.hasOwnProperty("contextInfo")) { var error = $root.proto.ContextInfo.verify(message.contextInfo); if (error) return "contextInfo." + error; } - if (message.firstScanSidecar != null && message.hasOwnProperty("firstScanSidecar")) - if (!(message.firstScanSidecar && typeof message.firstScanSidecar.length === "number" || $util.isString(message.firstScanSidecar))) - return "firstScanSidecar: buffer expected"; - if (message.firstScanLength != null && message.hasOwnProperty("firstScanLength")) - if (!$util.isInteger(message.firstScanLength)) - return "firstScanLength: integer expected"; - if (message.experimentGroupId != null && message.hasOwnProperty("experimentGroupId")) - if (!$util.isInteger(message.experimentGroupId)) - return "experimentGroupId: integer expected"; - if (message.scansSidecar != null && message.hasOwnProperty("scansSidecar")) - if (!(message.scansSidecar && typeof message.scansSidecar.length === "number" || $util.isString(message.scansSidecar))) - return "scansSidecar: buffer expected"; - if (message.scanLengths != null && message.hasOwnProperty("scanLengths")) { - if (!Array.isArray(message.scanLengths)) - return "scanLengths: array expected"; - for (var i = 0; i < message.scanLengths.length; ++i) - if (!$util.isInteger(message.scanLengths[i])) - return "scanLengths: integer[] expected"; - } - if (message.midQualityFileSha256 != null && message.hasOwnProperty("midQualityFileSha256")) - if (!(message.midQualityFileSha256 && typeof message.midQualityFileSha256.length === "number" || $util.isString(message.midQualityFileSha256))) - return "midQualityFileSha256: buffer expected"; - if (message.midQualityFileEncSha256 != null && message.hasOwnProperty("midQualityFileEncSha256")) - if (!(message.midQualityFileEncSha256 && typeof message.midQualityFileEncSha256.length === "number" || $util.isString(message.midQualityFileEncSha256))) - return "midQualityFileEncSha256: buffer expected"; - if (message.viewOnce != null && message.hasOwnProperty("viewOnce")) - if (typeof message.viewOnce !== "boolean") - return "viewOnce: boolean expected"; - if (message.thumbnailDirectPath != null && message.hasOwnProperty("thumbnailDirectPath")) - if (!$util.isString(message.thumbnailDirectPath)) - return "thumbnailDirectPath: string expected"; - if (message.thumbnailSha256 != null && message.hasOwnProperty("thumbnailSha256")) - if (!(message.thumbnailSha256 && typeof message.thumbnailSha256.length === "number" || $util.isString(message.thumbnailSha256))) - return "thumbnailSha256: buffer expected"; - if (message.thumbnailEncSha256 != null && message.hasOwnProperty("thumbnailEncSha256")) - if (!(message.thumbnailEncSha256 && typeof message.thumbnailEncSha256.length === "number" || $util.isString(message.thumbnailEncSha256))) - return "thumbnailEncSha256: buffer expected"; - if (message.staticUrl != null && message.hasOwnProperty("staticUrl")) - if (!$util.isString(message.staticUrl)) - return "staticUrl: string expected"; return null; }; /** - * Creates an ImageMessage message from a plain object. Also converts values to their respective internal types. + * Creates an OrderMessage message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof proto.ImageMessage + * @memberof proto.OrderMessage * @static * @param {Object.} object Plain object - * @returns {proto.ImageMessage} ImageMessage + * @returns {proto.OrderMessage} OrderMessage */ - ImageMessage.fromObject = function fromObject(object) { - if (object instanceof $root.proto.ImageMessage) + OrderMessage.fromObject = function fromObject(object) { + if (object instanceof $root.proto.OrderMessage) return object; - var message = new $root.proto.ImageMessage(); - if (object.url != null) - message.url = String(object.url); - if (object.mimetype != null) - message.mimetype = String(object.mimetype); - if (object.caption != null) - message.caption = String(object.caption); - if (object.fileSha256 != null) - if (typeof object.fileSha256 === "string") - $util.base64.decode(object.fileSha256, message.fileSha256 = $util.newBuffer($util.base64.length(object.fileSha256)), 0); - else if (object.fileSha256.length) - message.fileSha256 = object.fileSha256; - if (object.fileLength != null) - if ($util.Long) - (message.fileLength = $util.Long.fromValue(object.fileLength)).unsigned = true; - else if (typeof object.fileLength === "string") - message.fileLength = parseInt(object.fileLength, 10); - else if (typeof object.fileLength === "number") - message.fileLength = object.fileLength; - else if (typeof object.fileLength === "object") - message.fileLength = new $util.LongBits(object.fileLength.low >>> 0, object.fileLength.high >>> 0).toNumber(true); - if (object.height != null) - message.height = object.height >>> 0; - if (object.width != null) - message.width = object.width >>> 0; - if (object.mediaKey != null) - if (typeof object.mediaKey === "string") - $util.base64.decode(object.mediaKey, message.mediaKey = $util.newBuffer($util.base64.length(object.mediaKey)), 0); - else if (object.mediaKey.length) - message.mediaKey = object.mediaKey; - if (object.fileEncSha256 != null) - if (typeof object.fileEncSha256 === "string") - $util.base64.decode(object.fileEncSha256, message.fileEncSha256 = $util.newBuffer($util.base64.length(object.fileEncSha256)), 0); - else if (object.fileEncSha256.length) - message.fileEncSha256 = object.fileEncSha256; - if (object.interactiveAnnotations) { - if (!Array.isArray(object.interactiveAnnotations)) - throw TypeError(".proto.ImageMessage.interactiveAnnotations: array expected"); - message.interactiveAnnotations = []; - for (var i = 0; i < object.interactiveAnnotations.length; ++i) { - if (typeof object.interactiveAnnotations[i] !== "object") - throw TypeError(".proto.ImageMessage.interactiveAnnotations: object expected"); - message.interactiveAnnotations[i] = $root.proto.InteractiveAnnotation.fromObject(object.interactiveAnnotations[i]); - } + var message = new $root.proto.OrderMessage(); + if (object.orderId != null) + message.orderId = String(object.orderId); + if (object.thumbnail != null) + if (typeof object.thumbnail === "string") + $util.base64.decode(object.thumbnail, message.thumbnail = $util.newBuffer($util.base64.length(object.thumbnail)), 0); + else if (object.thumbnail.length) + message.thumbnail = object.thumbnail; + if (object.itemCount != null) + message.itemCount = object.itemCount | 0; + switch (object.status) { + case "INQUIRY": + case 1: + message.status = 1; + break; } - if (object.directPath != null) - message.directPath = String(object.directPath); - if (object.mediaKeyTimestamp != null) + switch (object.surface) { + case "CATALOG": + case 1: + message.surface = 1; + break; + } + if (object.message != null) + message.message = String(object.message); + if (object.orderTitle != null) + message.orderTitle = String(object.orderTitle); + if (object.sellerJid != null) + message.sellerJid = String(object.sellerJid); + if (object.token != null) + message.token = String(object.token); + if (object.totalAmount1000 != null) if ($util.Long) - (message.mediaKeyTimestamp = $util.Long.fromValue(object.mediaKeyTimestamp)).unsigned = false; - else if (typeof object.mediaKeyTimestamp === "string") - message.mediaKeyTimestamp = parseInt(object.mediaKeyTimestamp, 10); - else if (typeof object.mediaKeyTimestamp === "number") - message.mediaKeyTimestamp = object.mediaKeyTimestamp; - else if (typeof object.mediaKeyTimestamp === "object") - message.mediaKeyTimestamp = new $util.LongBits(object.mediaKeyTimestamp.low >>> 0, object.mediaKeyTimestamp.high >>> 0).toNumber(); - if (object.jpegThumbnail != null) - if (typeof object.jpegThumbnail === "string") - $util.base64.decode(object.jpegThumbnail, message.jpegThumbnail = $util.newBuffer($util.base64.length(object.jpegThumbnail)), 0); - else if (object.jpegThumbnail.length) - message.jpegThumbnail = object.jpegThumbnail; + (message.totalAmount1000 = $util.Long.fromValue(object.totalAmount1000)).unsigned = false; + else if (typeof object.totalAmount1000 === "string") + message.totalAmount1000 = parseInt(object.totalAmount1000, 10); + else if (typeof object.totalAmount1000 === "number") + message.totalAmount1000 = object.totalAmount1000; + else if (typeof object.totalAmount1000 === "object") + message.totalAmount1000 = new $util.LongBits(object.totalAmount1000.low >>> 0, object.totalAmount1000.high >>> 0).toNumber(); + if (object.totalCurrencyCode != null) + message.totalCurrencyCode = String(object.totalCurrencyCode); if (object.contextInfo != null) { if (typeof object.contextInfo !== "object") - throw TypeError(".proto.ImageMessage.contextInfo: object expected"); + throw TypeError(".proto.OrderMessage.contextInfo: object expected"); message.contextInfo = $root.proto.ContextInfo.fromObject(object.contextInfo); } - if (object.firstScanSidecar != null) - if (typeof object.firstScanSidecar === "string") - $util.base64.decode(object.firstScanSidecar, message.firstScanSidecar = $util.newBuffer($util.base64.length(object.firstScanSidecar)), 0); - else if (object.firstScanSidecar.length) - message.firstScanSidecar = object.firstScanSidecar; - if (object.firstScanLength != null) - message.firstScanLength = object.firstScanLength >>> 0; - if (object.experimentGroupId != null) - message.experimentGroupId = object.experimentGroupId >>> 0; - if (object.scansSidecar != null) - if (typeof object.scansSidecar === "string") - $util.base64.decode(object.scansSidecar, message.scansSidecar = $util.newBuffer($util.base64.length(object.scansSidecar)), 0); - else if (object.scansSidecar.length) - message.scansSidecar = object.scansSidecar; - if (object.scanLengths) { - if (!Array.isArray(object.scanLengths)) - throw TypeError(".proto.ImageMessage.scanLengths: array expected"); - message.scanLengths = []; - for (var i = 0; i < object.scanLengths.length; ++i) - message.scanLengths[i] = object.scanLengths[i] >>> 0; - } - if (object.midQualityFileSha256 != null) - if (typeof object.midQualityFileSha256 === "string") - $util.base64.decode(object.midQualityFileSha256, message.midQualityFileSha256 = $util.newBuffer($util.base64.length(object.midQualityFileSha256)), 0); - else if (object.midQualityFileSha256.length) - message.midQualityFileSha256 = object.midQualityFileSha256; - if (object.midQualityFileEncSha256 != null) - if (typeof object.midQualityFileEncSha256 === "string") - $util.base64.decode(object.midQualityFileEncSha256, message.midQualityFileEncSha256 = $util.newBuffer($util.base64.length(object.midQualityFileEncSha256)), 0); - else if (object.midQualityFileEncSha256.length) - message.midQualityFileEncSha256 = object.midQualityFileEncSha256; - if (object.viewOnce != null) - message.viewOnce = Boolean(object.viewOnce); - if (object.thumbnailDirectPath != null) - message.thumbnailDirectPath = String(object.thumbnailDirectPath); - if (object.thumbnailSha256 != null) - if (typeof object.thumbnailSha256 === "string") - $util.base64.decode(object.thumbnailSha256, message.thumbnailSha256 = $util.newBuffer($util.base64.length(object.thumbnailSha256)), 0); - else if (object.thumbnailSha256.length) - message.thumbnailSha256 = object.thumbnailSha256; - if (object.thumbnailEncSha256 != null) - if (typeof object.thumbnailEncSha256 === "string") - $util.base64.decode(object.thumbnailEncSha256, message.thumbnailEncSha256 = $util.newBuffer($util.base64.length(object.thumbnailEncSha256)), 0); - else if (object.thumbnailEncSha256.length) - message.thumbnailEncSha256 = object.thumbnailEncSha256; - if (object.staticUrl != null) - message.staticUrl = String(object.staticUrl); return message; }; /** - * Creates a plain object from an ImageMessage message. Also converts values to other types if specified. + * Creates a plain object from an OrderMessage message. Also converts values to other types if specified. * @function toObject - * @memberof proto.ImageMessage + * @memberof proto.OrderMessage * @static - * @param {proto.ImageMessage} message ImageMessage + * @param {proto.OrderMessage} message OrderMessage * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ImageMessage.toObject = function toObject(message, options) { + OrderMessage.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) { - object.interactiveAnnotations = []; - object.scanLengths = []; - } if (options.defaults) { - object.url = ""; - object.mimetype = ""; - object.caption = ""; - if (options.bytes === String) - object.fileSha256 = ""; - else { - object.fileSha256 = []; - if (options.bytes !== Array) - object.fileSha256 = $util.newBuffer(object.fileSha256); - } - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.fileLength = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.fileLength = options.longs === String ? "0" : 0; - object.height = 0; - object.width = 0; - if (options.bytes === String) - object.mediaKey = ""; - else { - object.mediaKey = []; - if (options.bytes !== Array) - object.mediaKey = $util.newBuffer(object.mediaKey); - } + object.orderId = ""; if (options.bytes === String) - object.fileEncSha256 = ""; + object.thumbnail = ""; else { - object.fileEncSha256 = []; + object.thumbnail = []; if (options.bytes !== Array) - object.fileEncSha256 = $util.newBuffer(object.fileEncSha256); + object.thumbnail = $util.newBuffer(object.thumbnail); } - object.directPath = ""; + object.itemCount = 0; + object.status = options.enums === String ? "INQUIRY" : 1; + object.surface = options.enums === String ? "CATALOG" : 1; + object.message = ""; + object.orderTitle = ""; + object.sellerJid = ""; + object.token = ""; if ($util.Long) { var long = new $util.Long(0, 0, false); - object.mediaKeyTimestamp = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + object.totalAmount1000 = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; } else - object.mediaKeyTimestamp = options.longs === String ? "0" : 0; - if (options.bytes === String) - object.jpegThumbnail = ""; - else { - object.jpegThumbnail = []; - if (options.bytes !== Array) - object.jpegThumbnail = $util.newBuffer(object.jpegThumbnail); - } + object.totalAmount1000 = options.longs === String ? "0" : 0; + object.totalCurrencyCode = ""; object.contextInfo = null; - if (options.bytes === String) - object.firstScanSidecar = ""; - else { - object.firstScanSidecar = []; - if (options.bytes !== Array) - object.firstScanSidecar = $util.newBuffer(object.firstScanSidecar); - } - object.firstScanLength = 0; - object.experimentGroupId = 0; - if (options.bytes === String) - object.scansSidecar = ""; - else { - object.scansSidecar = []; - if (options.bytes !== Array) - object.scansSidecar = $util.newBuffer(object.scansSidecar); - } - if (options.bytes === String) - object.midQualityFileSha256 = ""; - else { - object.midQualityFileSha256 = []; - if (options.bytes !== Array) - object.midQualityFileSha256 = $util.newBuffer(object.midQualityFileSha256); - } - if (options.bytes === String) - object.midQualityFileEncSha256 = ""; - else { - object.midQualityFileEncSha256 = []; - if (options.bytes !== Array) - object.midQualityFileEncSha256 = $util.newBuffer(object.midQualityFileEncSha256); - } - object.viewOnce = false; - object.thumbnailDirectPath = ""; - if (options.bytes === String) - object.thumbnailSha256 = ""; - else { - object.thumbnailSha256 = []; - if (options.bytes !== Array) - object.thumbnailSha256 = $util.newBuffer(object.thumbnailSha256); - } - if (options.bytes === String) - object.thumbnailEncSha256 = ""; - else { - object.thumbnailEncSha256 = []; - if (options.bytes !== Array) - object.thumbnailEncSha256 = $util.newBuffer(object.thumbnailEncSha256); - } - object.staticUrl = ""; - } - if (message.url != null && message.hasOwnProperty("url")) - object.url = message.url; - if (message.mimetype != null && message.hasOwnProperty("mimetype")) - object.mimetype = message.mimetype; - if (message.caption != null && message.hasOwnProperty("caption")) - object.caption = message.caption; - if (message.fileSha256 != null && message.hasOwnProperty("fileSha256")) - object.fileSha256 = options.bytes === String ? $util.base64.encode(message.fileSha256, 0, message.fileSha256.length) : options.bytes === Array ? Array.prototype.slice.call(message.fileSha256) : message.fileSha256; - if (message.fileLength != null && message.hasOwnProperty("fileLength")) - if (typeof message.fileLength === "number") - object.fileLength = options.longs === String ? String(message.fileLength) : message.fileLength; - else - object.fileLength = options.longs === String ? $util.Long.prototype.toString.call(message.fileLength) : options.longs === Number ? new $util.LongBits(message.fileLength.low >>> 0, message.fileLength.high >>> 0).toNumber(true) : message.fileLength; - if (message.height != null && message.hasOwnProperty("height")) - object.height = message.height; - if (message.width != null && message.hasOwnProperty("width")) - object.width = message.width; - if (message.mediaKey != null && message.hasOwnProperty("mediaKey")) - object.mediaKey = options.bytes === String ? $util.base64.encode(message.mediaKey, 0, message.mediaKey.length) : options.bytes === Array ? Array.prototype.slice.call(message.mediaKey) : message.mediaKey; - if (message.fileEncSha256 != null && message.hasOwnProperty("fileEncSha256")) - object.fileEncSha256 = options.bytes === String ? $util.base64.encode(message.fileEncSha256, 0, message.fileEncSha256.length) : options.bytes === Array ? Array.prototype.slice.call(message.fileEncSha256) : message.fileEncSha256; - if (message.interactiveAnnotations && message.interactiveAnnotations.length) { - object.interactiveAnnotations = []; - for (var j = 0; j < message.interactiveAnnotations.length; ++j) - object.interactiveAnnotations[j] = $root.proto.InteractiveAnnotation.toObject(message.interactiveAnnotations[j], options); } - if (message.directPath != null && message.hasOwnProperty("directPath")) - object.directPath = message.directPath; - if (message.mediaKeyTimestamp != null && message.hasOwnProperty("mediaKeyTimestamp")) - if (typeof message.mediaKeyTimestamp === "number") - object.mediaKeyTimestamp = options.longs === String ? String(message.mediaKeyTimestamp) : message.mediaKeyTimestamp; + if (message.orderId != null && message.hasOwnProperty("orderId")) + object.orderId = message.orderId; + if (message.thumbnail != null && message.hasOwnProperty("thumbnail")) + object.thumbnail = options.bytes === String ? $util.base64.encode(message.thumbnail, 0, message.thumbnail.length) : options.bytes === Array ? Array.prototype.slice.call(message.thumbnail) : message.thumbnail; + if (message.itemCount != null && message.hasOwnProperty("itemCount")) + object.itemCount = message.itemCount; + if (message.status != null && message.hasOwnProperty("status")) + object.status = options.enums === String ? $root.proto.OrderMessage.OrderMessageOrderStatus[message.status] : message.status; + if (message.surface != null && message.hasOwnProperty("surface")) + object.surface = options.enums === String ? $root.proto.OrderMessage.OrderMessageOrderSurface[message.surface] : message.surface; + if (message.message != null && message.hasOwnProperty("message")) + object.message = message.message; + if (message.orderTitle != null && message.hasOwnProperty("orderTitle")) + object.orderTitle = message.orderTitle; + if (message.sellerJid != null && message.hasOwnProperty("sellerJid")) + object.sellerJid = message.sellerJid; + if (message.token != null && message.hasOwnProperty("token")) + object.token = message.token; + if (message.totalAmount1000 != null && message.hasOwnProperty("totalAmount1000")) + if (typeof message.totalAmount1000 === "number") + object.totalAmount1000 = options.longs === String ? String(message.totalAmount1000) : message.totalAmount1000; else - object.mediaKeyTimestamp = options.longs === String ? $util.Long.prototype.toString.call(message.mediaKeyTimestamp) : options.longs === Number ? new $util.LongBits(message.mediaKeyTimestamp.low >>> 0, message.mediaKeyTimestamp.high >>> 0).toNumber() : message.mediaKeyTimestamp; - if (message.jpegThumbnail != null && message.hasOwnProperty("jpegThumbnail")) - object.jpegThumbnail = options.bytes === String ? $util.base64.encode(message.jpegThumbnail, 0, message.jpegThumbnail.length) : options.bytes === Array ? Array.prototype.slice.call(message.jpegThumbnail) : message.jpegThumbnail; + object.totalAmount1000 = options.longs === String ? $util.Long.prototype.toString.call(message.totalAmount1000) : options.longs === Number ? new $util.LongBits(message.totalAmount1000.low >>> 0, message.totalAmount1000.high >>> 0).toNumber() : message.totalAmount1000; + if (message.totalCurrencyCode != null && message.hasOwnProperty("totalCurrencyCode")) + object.totalCurrencyCode = message.totalCurrencyCode; if (message.contextInfo != null && message.hasOwnProperty("contextInfo")) object.contextInfo = $root.proto.ContextInfo.toObject(message.contextInfo, options); - if (message.firstScanSidecar != null && message.hasOwnProperty("firstScanSidecar")) - object.firstScanSidecar = options.bytes === String ? $util.base64.encode(message.firstScanSidecar, 0, message.firstScanSidecar.length) : options.bytes === Array ? Array.prototype.slice.call(message.firstScanSidecar) : message.firstScanSidecar; - if (message.firstScanLength != null && message.hasOwnProperty("firstScanLength")) - object.firstScanLength = message.firstScanLength; - if (message.experimentGroupId != null && message.hasOwnProperty("experimentGroupId")) - object.experimentGroupId = message.experimentGroupId; - if (message.scansSidecar != null && message.hasOwnProperty("scansSidecar")) - object.scansSidecar = options.bytes === String ? $util.base64.encode(message.scansSidecar, 0, message.scansSidecar.length) : options.bytes === Array ? Array.prototype.slice.call(message.scansSidecar) : message.scansSidecar; - if (message.scanLengths && message.scanLengths.length) { - object.scanLengths = []; - for (var j = 0; j < message.scanLengths.length; ++j) - object.scanLengths[j] = message.scanLengths[j]; - } - if (message.midQualityFileSha256 != null && message.hasOwnProperty("midQualityFileSha256")) - object.midQualityFileSha256 = options.bytes === String ? $util.base64.encode(message.midQualityFileSha256, 0, message.midQualityFileSha256.length) : options.bytes === Array ? Array.prototype.slice.call(message.midQualityFileSha256) : message.midQualityFileSha256; - if (message.midQualityFileEncSha256 != null && message.hasOwnProperty("midQualityFileEncSha256")) - object.midQualityFileEncSha256 = options.bytes === String ? $util.base64.encode(message.midQualityFileEncSha256, 0, message.midQualityFileEncSha256.length) : options.bytes === Array ? Array.prototype.slice.call(message.midQualityFileEncSha256) : message.midQualityFileEncSha256; - if (message.viewOnce != null && message.hasOwnProperty("viewOnce")) - object.viewOnce = message.viewOnce; - if (message.thumbnailDirectPath != null && message.hasOwnProperty("thumbnailDirectPath")) - object.thumbnailDirectPath = message.thumbnailDirectPath; - if (message.thumbnailSha256 != null && message.hasOwnProperty("thumbnailSha256")) - object.thumbnailSha256 = options.bytes === String ? $util.base64.encode(message.thumbnailSha256, 0, message.thumbnailSha256.length) : options.bytes === Array ? Array.prototype.slice.call(message.thumbnailSha256) : message.thumbnailSha256; - if (message.thumbnailEncSha256 != null && message.hasOwnProperty("thumbnailEncSha256")) - object.thumbnailEncSha256 = options.bytes === String ? $util.base64.encode(message.thumbnailEncSha256, 0, message.thumbnailEncSha256.length) : options.bytes === Array ? Array.prototype.slice.call(message.thumbnailEncSha256) : message.thumbnailEncSha256; - if (message.staticUrl != null && message.hasOwnProperty("staticUrl")) - object.staticUrl = message.staticUrl; return object; }; /** - * Converts this ImageMessage to JSON. + * Converts this OrderMessage to JSON. * @function toJSON - * @memberof proto.ImageMessage + * @memberof proto.OrderMessage * @instance * @returns {Object.} JSON object */ - ImageMessage.prototype.toJSON = function toJSON() { + OrderMessage.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ImageMessage; + /** + * OrderMessageOrderStatus enum. + * @name proto.OrderMessage.OrderMessageOrderStatus + * @enum {number} + * @property {number} INQUIRY=1 INQUIRY value + */ + OrderMessage.OrderMessageOrderStatus = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "INQUIRY"] = 1; + return values; + })(); + + /** + * OrderMessageOrderSurface enum. + * @name proto.OrderMessage.OrderMessageOrderSurface + * @enum {number} + * @property {number} CATALOG=1 CATALOG value + */ + OrderMessage.OrderMessageOrderSurface = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "CATALOG"] = 1; + return values; + })(); + + return OrderMessage; })(); - proto.InvoiceMessage = (function() { + proto.PaymentBackground = (function() { /** - * Properties of an InvoiceMessage. + * Properties of a PaymentBackground. * @memberof proto - * @interface IInvoiceMessage - * @property {string|null} [note] InvoiceMessage note - * @property {string|null} [token] InvoiceMessage token - * @property {proto.InvoiceMessage.InvoiceMessageAttachmentType|null} [attachmentType] InvoiceMessage attachmentType - * @property {string|null} [attachmentMimetype] InvoiceMessage attachmentMimetype - * @property {Uint8Array|null} [attachmentMediaKey] InvoiceMessage attachmentMediaKey - * @property {number|Long|null} [attachmentMediaKeyTimestamp] InvoiceMessage attachmentMediaKeyTimestamp - * @property {Uint8Array|null} [attachmentFileSha256] InvoiceMessage attachmentFileSha256 - * @property {Uint8Array|null} [attachmentFileEncSha256] InvoiceMessage attachmentFileEncSha256 - * @property {string|null} [attachmentDirectPath] InvoiceMessage attachmentDirectPath - * @property {Uint8Array|null} [attachmentJpegThumbnail] InvoiceMessage attachmentJpegThumbnail + * @interface IPaymentBackground + * @property {string|null} [id] PaymentBackground id + * @property {number|Long|null} [fileLength] PaymentBackground fileLength + * @property {number|null} [width] PaymentBackground width + * @property {number|null} [height] PaymentBackground height + * @property {string|null} [mimetype] PaymentBackground mimetype + * @property {number|null} [placeholderArgb] PaymentBackground placeholderArgb + * @property {number|null} [textArgb] PaymentBackground textArgb + * @property {number|null} [subtextArgb] PaymentBackground subtextArgb + * @property {proto.IPBMediaData|null} [mediaData] PaymentBackground mediaData + * @property {proto.PaymentBackground.PaymentBackgroundType|null} [type] PaymentBackground type */ /** - * Constructs a new InvoiceMessage. + * Constructs a new PaymentBackground. * @memberof proto - * @classdesc Represents an InvoiceMessage. - * @implements IInvoiceMessage + * @classdesc Represents a PaymentBackground. + * @implements IPaymentBackground * @constructor - * @param {proto.IInvoiceMessage=} [properties] Properties to set + * @param {proto.IPaymentBackground=} [properties] Properties to set */ - function InvoiceMessage(properties) { + function PaymentBackground(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -24063,192 +24672,192 @@ $root.proto = (function() { } /** - * InvoiceMessage note. - * @member {string} note - * @memberof proto.InvoiceMessage + * PaymentBackground id. + * @member {string} id + * @memberof proto.PaymentBackground * @instance */ - InvoiceMessage.prototype.note = ""; + PaymentBackground.prototype.id = ""; /** - * InvoiceMessage token. - * @member {string} token - * @memberof proto.InvoiceMessage + * PaymentBackground fileLength. + * @member {number|Long} fileLength + * @memberof proto.PaymentBackground * @instance */ - InvoiceMessage.prototype.token = ""; + PaymentBackground.prototype.fileLength = $util.Long ? $util.Long.fromBits(0,0,true) : 0; /** - * InvoiceMessage attachmentType. - * @member {proto.InvoiceMessage.InvoiceMessageAttachmentType} attachmentType - * @memberof proto.InvoiceMessage + * PaymentBackground width. + * @member {number} width + * @memberof proto.PaymentBackground * @instance */ - InvoiceMessage.prototype.attachmentType = 0; + PaymentBackground.prototype.width = 0; /** - * InvoiceMessage attachmentMimetype. - * @member {string} attachmentMimetype - * @memberof proto.InvoiceMessage + * PaymentBackground height. + * @member {number} height + * @memberof proto.PaymentBackground * @instance */ - InvoiceMessage.prototype.attachmentMimetype = ""; + PaymentBackground.prototype.height = 0; /** - * InvoiceMessage attachmentMediaKey. - * @member {Uint8Array} attachmentMediaKey - * @memberof proto.InvoiceMessage + * PaymentBackground mimetype. + * @member {string} mimetype + * @memberof proto.PaymentBackground * @instance */ - InvoiceMessage.prototype.attachmentMediaKey = $util.newBuffer([]); + PaymentBackground.prototype.mimetype = ""; /** - * InvoiceMessage attachmentMediaKeyTimestamp. - * @member {number|Long} attachmentMediaKeyTimestamp - * @memberof proto.InvoiceMessage + * PaymentBackground placeholderArgb. + * @member {number} placeholderArgb + * @memberof proto.PaymentBackground * @instance */ - InvoiceMessage.prototype.attachmentMediaKeyTimestamp = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + PaymentBackground.prototype.placeholderArgb = 0; /** - * InvoiceMessage attachmentFileSha256. - * @member {Uint8Array} attachmentFileSha256 - * @memberof proto.InvoiceMessage + * PaymentBackground textArgb. + * @member {number} textArgb + * @memberof proto.PaymentBackground * @instance */ - InvoiceMessage.prototype.attachmentFileSha256 = $util.newBuffer([]); + PaymentBackground.prototype.textArgb = 0; /** - * InvoiceMessage attachmentFileEncSha256. - * @member {Uint8Array} attachmentFileEncSha256 - * @memberof proto.InvoiceMessage + * PaymentBackground subtextArgb. + * @member {number} subtextArgb + * @memberof proto.PaymentBackground * @instance */ - InvoiceMessage.prototype.attachmentFileEncSha256 = $util.newBuffer([]); + PaymentBackground.prototype.subtextArgb = 0; /** - * InvoiceMessage attachmentDirectPath. - * @member {string} attachmentDirectPath - * @memberof proto.InvoiceMessage + * PaymentBackground mediaData. + * @member {proto.IPBMediaData|null|undefined} mediaData + * @memberof proto.PaymentBackground * @instance */ - InvoiceMessage.prototype.attachmentDirectPath = ""; + PaymentBackground.prototype.mediaData = null; /** - * InvoiceMessage attachmentJpegThumbnail. - * @member {Uint8Array} attachmentJpegThumbnail - * @memberof proto.InvoiceMessage + * PaymentBackground type. + * @member {proto.PaymentBackground.PaymentBackgroundType} type + * @memberof proto.PaymentBackground * @instance */ - InvoiceMessage.prototype.attachmentJpegThumbnail = $util.newBuffer([]); + PaymentBackground.prototype.type = 0; /** - * Creates a new InvoiceMessage instance using the specified properties. + * Creates a new PaymentBackground instance using the specified properties. * @function create - * @memberof proto.InvoiceMessage + * @memberof proto.PaymentBackground * @static - * @param {proto.IInvoiceMessage=} [properties] Properties to set - * @returns {proto.InvoiceMessage} InvoiceMessage instance + * @param {proto.IPaymentBackground=} [properties] Properties to set + * @returns {proto.PaymentBackground} PaymentBackground instance */ - InvoiceMessage.create = function create(properties) { - return new InvoiceMessage(properties); + PaymentBackground.create = function create(properties) { + return new PaymentBackground(properties); }; /** - * Encodes the specified InvoiceMessage message. Does not implicitly {@link proto.InvoiceMessage.verify|verify} messages. + * Encodes the specified PaymentBackground message. Does not implicitly {@link proto.PaymentBackground.verify|verify} messages. * @function encode - * @memberof proto.InvoiceMessage + * @memberof proto.PaymentBackground * @static - * @param {proto.IInvoiceMessage} message InvoiceMessage message or plain object to encode + * @param {proto.IPaymentBackground} message PaymentBackground message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - InvoiceMessage.encode = function encode(message, writer) { + PaymentBackground.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.note != null && Object.hasOwnProperty.call(message, "note")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.note); - if (message.token != null && Object.hasOwnProperty.call(message, "token")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.token); - if (message.attachmentType != null && Object.hasOwnProperty.call(message, "attachmentType")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.attachmentType); - if (message.attachmentMimetype != null && Object.hasOwnProperty.call(message, "attachmentMimetype")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.attachmentMimetype); - if (message.attachmentMediaKey != null && Object.hasOwnProperty.call(message, "attachmentMediaKey")) - writer.uint32(/* id 5, wireType 2 =*/42).bytes(message.attachmentMediaKey); - if (message.attachmentMediaKeyTimestamp != null && Object.hasOwnProperty.call(message, "attachmentMediaKeyTimestamp")) - writer.uint32(/* id 6, wireType 0 =*/48).int64(message.attachmentMediaKeyTimestamp); - if (message.attachmentFileSha256 != null && Object.hasOwnProperty.call(message, "attachmentFileSha256")) - writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.attachmentFileSha256); - if (message.attachmentFileEncSha256 != null && Object.hasOwnProperty.call(message, "attachmentFileEncSha256")) - writer.uint32(/* id 8, wireType 2 =*/66).bytes(message.attachmentFileEncSha256); - if (message.attachmentDirectPath != null && Object.hasOwnProperty.call(message, "attachmentDirectPath")) - writer.uint32(/* id 9, wireType 2 =*/74).string(message.attachmentDirectPath); - if (message.attachmentJpegThumbnail != null && Object.hasOwnProperty.call(message, "attachmentJpegThumbnail")) - writer.uint32(/* id 10, wireType 2 =*/82).bytes(message.attachmentJpegThumbnail); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.id); + if (message.fileLength != null && Object.hasOwnProperty.call(message, "fileLength")) + writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.fileLength); + if (message.width != null && Object.hasOwnProperty.call(message, "width")) + writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.width); + if (message.height != null && Object.hasOwnProperty.call(message, "height")) + writer.uint32(/* id 4, wireType 0 =*/32).uint32(message.height); + if (message.mimetype != null && Object.hasOwnProperty.call(message, "mimetype")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.mimetype); + if (message.placeholderArgb != null && Object.hasOwnProperty.call(message, "placeholderArgb")) + writer.uint32(/* id 6, wireType 5 =*/53).fixed32(message.placeholderArgb); + if (message.textArgb != null && Object.hasOwnProperty.call(message, "textArgb")) + writer.uint32(/* id 7, wireType 5 =*/61).fixed32(message.textArgb); + if (message.subtextArgb != null && Object.hasOwnProperty.call(message, "subtextArgb")) + writer.uint32(/* id 8, wireType 5 =*/69).fixed32(message.subtextArgb); + if (message.mediaData != null && Object.hasOwnProperty.call(message, "mediaData")) + $root.proto.PBMediaData.encode(message.mediaData, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 10, wireType 0 =*/80).int32(message.type); return writer; }; /** - * Encodes the specified InvoiceMessage message, length delimited. Does not implicitly {@link proto.InvoiceMessage.verify|verify} messages. + * Encodes the specified PaymentBackground message, length delimited. Does not implicitly {@link proto.PaymentBackground.verify|verify} messages. * @function encodeDelimited - * @memberof proto.InvoiceMessage + * @memberof proto.PaymentBackground * @static - * @param {proto.IInvoiceMessage} message InvoiceMessage message or plain object to encode + * @param {proto.IPaymentBackground} message PaymentBackground message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - InvoiceMessage.encodeDelimited = function encodeDelimited(message, writer) { + PaymentBackground.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an InvoiceMessage message from the specified reader or buffer. + * Decodes a PaymentBackground message from the specified reader or buffer. * @function decode - * @memberof proto.InvoiceMessage + * @memberof proto.PaymentBackground * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {proto.InvoiceMessage} InvoiceMessage + * @returns {proto.PaymentBackground} PaymentBackground * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - InvoiceMessage.decode = function decode(reader, length) { + PaymentBackground.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.InvoiceMessage(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.PaymentBackground(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.note = reader.string(); + message.id = reader.string(); break; case 2: - message.token = reader.string(); + message.fileLength = reader.uint64(); break; case 3: - message.attachmentType = reader.int32(); + message.width = reader.uint32(); break; case 4: - message.attachmentMimetype = reader.string(); + message.height = reader.uint32(); break; case 5: - message.attachmentMediaKey = reader.bytes(); + message.mimetype = reader.string(); break; case 6: - message.attachmentMediaKeyTimestamp = reader.int64(); + message.placeholderArgb = reader.fixed32(); break; case 7: - message.attachmentFileSha256 = reader.bytes(); + message.textArgb = reader.fixed32(); break; case 8: - message.attachmentFileEncSha256 = reader.bytes(); + message.subtextArgb = reader.fixed32(); break; case 9: - message.attachmentDirectPath = reader.string(); + message.mediaData = $root.proto.PBMediaData.decode(reader, reader.uint32()); break; case 10: - message.attachmentJpegThumbnail = reader.bytes(); + message.type = reader.int32(); break; default: reader.skipType(tag & 7); @@ -24259,259 +24868,227 @@ $root.proto = (function() { }; /** - * Decodes an InvoiceMessage message from the specified reader or buffer, length delimited. + * Decodes a PaymentBackground message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof proto.InvoiceMessage + * @memberof proto.PaymentBackground * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.InvoiceMessage} InvoiceMessage + * @returns {proto.PaymentBackground} PaymentBackground * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - InvoiceMessage.decodeDelimited = function decodeDelimited(reader) { + PaymentBackground.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an InvoiceMessage message. + * Verifies a PaymentBackground message. * @function verify - * @memberof proto.InvoiceMessage + * @memberof proto.PaymentBackground * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - InvoiceMessage.verify = function verify(message) { + PaymentBackground.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.note != null && message.hasOwnProperty("note")) - if (!$util.isString(message.note)) - return "note: string expected"; - if (message.token != null && message.hasOwnProperty("token")) - if (!$util.isString(message.token)) - return "token: string expected"; - if (message.attachmentType != null && message.hasOwnProperty("attachmentType")) - switch (message.attachmentType) { + if (message.id != null && message.hasOwnProperty("id")) + if (!$util.isString(message.id)) + return "id: string expected"; + if (message.fileLength != null && message.hasOwnProperty("fileLength")) + if (!$util.isInteger(message.fileLength) && !(message.fileLength && $util.isInteger(message.fileLength.low) && $util.isInteger(message.fileLength.high))) + return "fileLength: integer|Long expected"; + if (message.width != null && message.hasOwnProperty("width")) + if (!$util.isInteger(message.width)) + return "width: integer expected"; + if (message.height != null && message.hasOwnProperty("height")) + if (!$util.isInteger(message.height)) + return "height: integer expected"; + if (message.mimetype != null && message.hasOwnProperty("mimetype")) + if (!$util.isString(message.mimetype)) + return "mimetype: string expected"; + if (message.placeholderArgb != null && message.hasOwnProperty("placeholderArgb")) + if (!$util.isInteger(message.placeholderArgb)) + return "placeholderArgb: integer expected"; + if (message.textArgb != null && message.hasOwnProperty("textArgb")) + if (!$util.isInteger(message.textArgb)) + return "textArgb: integer expected"; + if (message.subtextArgb != null && message.hasOwnProperty("subtextArgb")) + if (!$util.isInteger(message.subtextArgb)) + return "subtextArgb: integer expected"; + if (message.mediaData != null && message.hasOwnProperty("mediaData")) { + var error = $root.proto.PBMediaData.verify(message.mediaData); + if (error) + return "mediaData." + error; + } + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { default: - return "attachmentType: enum value expected"; + return "type: enum value expected"; case 0: case 1: break; } - if (message.attachmentMimetype != null && message.hasOwnProperty("attachmentMimetype")) - if (!$util.isString(message.attachmentMimetype)) - return "attachmentMimetype: string expected"; - if (message.attachmentMediaKey != null && message.hasOwnProperty("attachmentMediaKey")) - if (!(message.attachmentMediaKey && typeof message.attachmentMediaKey.length === "number" || $util.isString(message.attachmentMediaKey))) - return "attachmentMediaKey: buffer expected"; - if (message.attachmentMediaKeyTimestamp != null && message.hasOwnProperty("attachmentMediaKeyTimestamp")) - if (!$util.isInteger(message.attachmentMediaKeyTimestamp) && !(message.attachmentMediaKeyTimestamp && $util.isInteger(message.attachmentMediaKeyTimestamp.low) && $util.isInteger(message.attachmentMediaKeyTimestamp.high))) - return "attachmentMediaKeyTimestamp: integer|Long expected"; - if (message.attachmentFileSha256 != null && message.hasOwnProperty("attachmentFileSha256")) - if (!(message.attachmentFileSha256 && typeof message.attachmentFileSha256.length === "number" || $util.isString(message.attachmentFileSha256))) - return "attachmentFileSha256: buffer expected"; - if (message.attachmentFileEncSha256 != null && message.hasOwnProperty("attachmentFileEncSha256")) - if (!(message.attachmentFileEncSha256 && typeof message.attachmentFileEncSha256.length === "number" || $util.isString(message.attachmentFileEncSha256))) - return "attachmentFileEncSha256: buffer expected"; - if (message.attachmentDirectPath != null && message.hasOwnProperty("attachmentDirectPath")) - if (!$util.isString(message.attachmentDirectPath)) - return "attachmentDirectPath: string expected"; - if (message.attachmentJpegThumbnail != null && message.hasOwnProperty("attachmentJpegThumbnail")) - if (!(message.attachmentJpegThumbnail && typeof message.attachmentJpegThumbnail.length === "number" || $util.isString(message.attachmentJpegThumbnail))) - return "attachmentJpegThumbnail: buffer expected"; return null; }; /** - * Creates an InvoiceMessage message from a plain object. Also converts values to their respective internal types. + * Creates a PaymentBackground message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof proto.InvoiceMessage + * @memberof proto.PaymentBackground * @static * @param {Object.} object Plain object - * @returns {proto.InvoiceMessage} InvoiceMessage + * @returns {proto.PaymentBackground} PaymentBackground */ - InvoiceMessage.fromObject = function fromObject(object) { - if (object instanceof $root.proto.InvoiceMessage) + PaymentBackground.fromObject = function fromObject(object) { + if (object instanceof $root.proto.PaymentBackground) return object; - var message = new $root.proto.InvoiceMessage(); - if (object.note != null) - message.note = String(object.note); - if (object.token != null) - message.token = String(object.token); - switch (object.attachmentType) { - case "IMAGE": + var message = new $root.proto.PaymentBackground(); + if (object.id != null) + message.id = String(object.id); + if (object.fileLength != null) + if ($util.Long) + (message.fileLength = $util.Long.fromValue(object.fileLength)).unsigned = true; + else if (typeof object.fileLength === "string") + message.fileLength = parseInt(object.fileLength, 10); + else if (typeof object.fileLength === "number") + message.fileLength = object.fileLength; + else if (typeof object.fileLength === "object") + message.fileLength = new $util.LongBits(object.fileLength.low >>> 0, object.fileLength.high >>> 0).toNumber(true); + if (object.width != null) + message.width = object.width >>> 0; + if (object.height != null) + message.height = object.height >>> 0; + if (object.mimetype != null) + message.mimetype = String(object.mimetype); + if (object.placeholderArgb != null) + message.placeholderArgb = object.placeholderArgb >>> 0; + if (object.textArgb != null) + message.textArgb = object.textArgb >>> 0; + if (object.subtextArgb != null) + message.subtextArgb = object.subtextArgb >>> 0; + if (object.mediaData != null) { + if (typeof object.mediaData !== "object") + throw TypeError(".proto.PaymentBackground.mediaData: object expected"); + message.mediaData = $root.proto.PBMediaData.fromObject(object.mediaData); + } + switch (object.type) { + case "UNKNOWN": case 0: - message.attachmentType = 0; + message.type = 0; break; - case "PDF": + case "DEFAULT": case 1: - message.attachmentType = 1; + message.type = 1; break; } - if (object.attachmentMimetype != null) - message.attachmentMimetype = String(object.attachmentMimetype); - if (object.attachmentMediaKey != null) - if (typeof object.attachmentMediaKey === "string") - $util.base64.decode(object.attachmentMediaKey, message.attachmentMediaKey = $util.newBuffer($util.base64.length(object.attachmentMediaKey)), 0); - else if (object.attachmentMediaKey.length) - message.attachmentMediaKey = object.attachmentMediaKey; - if (object.attachmentMediaKeyTimestamp != null) - if ($util.Long) - (message.attachmentMediaKeyTimestamp = $util.Long.fromValue(object.attachmentMediaKeyTimestamp)).unsigned = false; - else if (typeof object.attachmentMediaKeyTimestamp === "string") - message.attachmentMediaKeyTimestamp = parseInt(object.attachmentMediaKeyTimestamp, 10); - else if (typeof object.attachmentMediaKeyTimestamp === "number") - message.attachmentMediaKeyTimestamp = object.attachmentMediaKeyTimestamp; - else if (typeof object.attachmentMediaKeyTimestamp === "object") - message.attachmentMediaKeyTimestamp = new $util.LongBits(object.attachmentMediaKeyTimestamp.low >>> 0, object.attachmentMediaKeyTimestamp.high >>> 0).toNumber(); - if (object.attachmentFileSha256 != null) - if (typeof object.attachmentFileSha256 === "string") - $util.base64.decode(object.attachmentFileSha256, message.attachmentFileSha256 = $util.newBuffer($util.base64.length(object.attachmentFileSha256)), 0); - else if (object.attachmentFileSha256.length) - message.attachmentFileSha256 = object.attachmentFileSha256; - if (object.attachmentFileEncSha256 != null) - if (typeof object.attachmentFileEncSha256 === "string") - $util.base64.decode(object.attachmentFileEncSha256, message.attachmentFileEncSha256 = $util.newBuffer($util.base64.length(object.attachmentFileEncSha256)), 0); - else if (object.attachmentFileEncSha256.length) - message.attachmentFileEncSha256 = object.attachmentFileEncSha256; - if (object.attachmentDirectPath != null) - message.attachmentDirectPath = String(object.attachmentDirectPath); - if (object.attachmentJpegThumbnail != null) - if (typeof object.attachmentJpegThumbnail === "string") - $util.base64.decode(object.attachmentJpegThumbnail, message.attachmentJpegThumbnail = $util.newBuffer($util.base64.length(object.attachmentJpegThumbnail)), 0); - else if (object.attachmentJpegThumbnail.length) - message.attachmentJpegThumbnail = object.attachmentJpegThumbnail; return message; }; /** - * Creates a plain object from an InvoiceMessage message. Also converts values to other types if specified. + * Creates a plain object from a PaymentBackground message. Also converts values to other types if specified. * @function toObject - * @memberof proto.InvoiceMessage + * @memberof proto.PaymentBackground * @static - * @param {proto.InvoiceMessage} message InvoiceMessage + * @param {proto.PaymentBackground} message PaymentBackground * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - InvoiceMessage.toObject = function toObject(message, options) { + PaymentBackground.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.note = ""; - object.token = ""; - object.attachmentType = options.enums === String ? "IMAGE" : 0; - object.attachmentMimetype = ""; - if (options.bytes === String) - object.attachmentMediaKey = ""; - else { - object.attachmentMediaKey = []; - if (options.bytes !== Array) - object.attachmentMediaKey = $util.newBuffer(object.attachmentMediaKey); - } + object.id = ""; if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.attachmentMediaKeyTimestamp = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + var long = new $util.Long(0, 0, true); + object.fileLength = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; } else - object.attachmentMediaKeyTimestamp = options.longs === String ? "0" : 0; - if (options.bytes === String) - object.attachmentFileSha256 = ""; - else { - object.attachmentFileSha256 = []; - if (options.bytes !== Array) - object.attachmentFileSha256 = $util.newBuffer(object.attachmentFileSha256); - } - if (options.bytes === String) - object.attachmentFileEncSha256 = ""; - else { - object.attachmentFileEncSha256 = []; - if (options.bytes !== Array) - object.attachmentFileEncSha256 = $util.newBuffer(object.attachmentFileEncSha256); - } - object.attachmentDirectPath = ""; - if (options.bytes === String) - object.attachmentJpegThumbnail = ""; - else { - object.attachmentJpegThumbnail = []; - if (options.bytes !== Array) - object.attachmentJpegThumbnail = $util.newBuffer(object.attachmentJpegThumbnail); - } + object.fileLength = options.longs === String ? "0" : 0; + object.width = 0; + object.height = 0; + object.mimetype = ""; + object.placeholderArgb = 0; + object.textArgb = 0; + object.subtextArgb = 0; + object.mediaData = null; + object.type = options.enums === String ? "UNKNOWN" : 0; } - if (message.note != null && message.hasOwnProperty("note")) - object.note = message.note; - if (message.token != null && message.hasOwnProperty("token")) - object.token = message.token; - if (message.attachmentType != null && message.hasOwnProperty("attachmentType")) - object.attachmentType = options.enums === String ? $root.proto.InvoiceMessage.InvoiceMessageAttachmentType[message.attachmentType] : message.attachmentType; - if (message.attachmentMimetype != null && message.hasOwnProperty("attachmentMimetype")) - object.attachmentMimetype = message.attachmentMimetype; - if (message.attachmentMediaKey != null && message.hasOwnProperty("attachmentMediaKey")) - object.attachmentMediaKey = options.bytes === String ? $util.base64.encode(message.attachmentMediaKey, 0, message.attachmentMediaKey.length) : options.bytes === Array ? Array.prototype.slice.call(message.attachmentMediaKey) : message.attachmentMediaKey; - if (message.attachmentMediaKeyTimestamp != null && message.hasOwnProperty("attachmentMediaKeyTimestamp")) - if (typeof message.attachmentMediaKeyTimestamp === "number") - object.attachmentMediaKeyTimestamp = options.longs === String ? String(message.attachmentMediaKeyTimestamp) : message.attachmentMediaKeyTimestamp; + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; + if (message.fileLength != null && message.hasOwnProperty("fileLength")) + if (typeof message.fileLength === "number") + object.fileLength = options.longs === String ? String(message.fileLength) : message.fileLength; else - object.attachmentMediaKeyTimestamp = options.longs === String ? $util.Long.prototype.toString.call(message.attachmentMediaKeyTimestamp) : options.longs === Number ? new $util.LongBits(message.attachmentMediaKeyTimestamp.low >>> 0, message.attachmentMediaKeyTimestamp.high >>> 0).toNumber() : message.attachmentMediaKeyTimestamp; - if (message.attachmentFileSha256 != null && message.hasOwnProperty("attachmentFileSha256")) - object.attachmentFileSha256 = options.bytes === String ? $util.base64.encode(message.attachmentFileSha256, 0, message.attachmentFileSha256.length) : options.bytes === Array ? Array.prototype.slice.call(message.attachmentFileSha256) : message.attachmentFileSha256; - if (message.attachmentFileEncSha256 != null && message.hasOwnProperty("attachmentFileEncSha256")) - object.attachmentFileEncSha256 = options.bytes === String ? $util.base64.encode(message.attachmentFileEncSha256, 0, message.attachmentFileEncSha256.length) : options.bytes === Array ? Array.prototype.slice.call(message.attachmentFileEncSha256) : message.attachmentFileEncSha256; - if (message.attachmentDirectPath != null && message.hasOwnProperty("attachmentDirectPath")) - object.attachmentDirectPath = message.attachmentDirectPath; - if (message.attachmentJpegThumbnail != null && message.hasOwnProperty("attachmentJpegThumbnail")) - object.attachmentJpegThumbnail = options.bytes === String ? $util.base64.encode(message.attachmentJpegThumbnail, 0, message.attachmentJpegThumbnail.length) : options.bytes === Array ? Array.prototype.slice.call(message.attachmentJpegThumbnail) : message.attachmentJpegThumbnail; + object.fileLength = options.longs === String ? $util.Long.prototype.toString.call(message.fileLength) : options.longs === Number ? new $util.LongBits(message.fileLength.low >>> 0, message.fileLength.high >>> 0).toNumber(true) : message.fileLength; + if (message.width != null && message.hasOwnProperty("width")) + object.width = message.width; + if (message.height != null && message.hasOwnProperty("height")) + object.height = message.height; + if (message.mimetype != null && message.hasOwnProperty("mimetype")) + object.mimetype = message.mimetype; + if (message.placeholderArgb != null && message.hasOwnProperty("placeholderArgb")) + object.placeholderArgb = message.placeholderArgb; + if (message.textArgb != null && message.hasOwnProperty("textArgb")) + object.textArgb = message.textArgb; + if (message.subtextArgb != null && message.hasOwnProperty("subtextArgb")) + object.subtextArgb = message.subtextArgb; + if (message.mediaData != null && message.hasOwnProperty("mediaData")) + object.mediaData = $root.proto.PBMediaData.toObject(message.mediaData, options); + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.proto.PaymentBackground.PaymentBackgroundType[message.type] : message.type; return object; }; /** - * Converts this InvoiceMessage to JSON. + * Converts this PaymentBackground to JSON. * @function toJSON - * @memberof proto.InvoiceMessage + * @memberof proto.PaymentBackground * @instance * @returns {Object.} JSON object */ - InvoiceMessage.prototype.toJSON = function toJSON() { + PaymentBackground.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * InvoiceMessageAttachmentType enum. - * @name proto.InvoiceMessage.InvoiceMessageAttachmentType + * PaymentBackgroundType enum. + * @name proto.PaymentBackground.PaymentBackgroundType * @enum {number} - * @property {number} IMAGE=0 IMAGE value - * @property {number} PDF=1 PDF value + * @property {number} UNKNOWN=0 UNKNOWN value + * @property {number} DEFAULT=1 DEFAULT value */ - InvoiceMessage.InvoiceMessageAttachmentType = (function() { + PaymentBackground.PaymentBackgroundType = (function() { var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "IMAGE"] = 0; - values[valuesById[1] = "PDF"] = 1; + values[valuesById[0] = "UNKNOWN"] = 0; + values[valuesById[1] = "DEFAULT"] = 1; return values; })(); - return InvoiceMessage; + return PaymentBackground; })(); - proto.ContactMessage = (function() { + proto.PaymentInviteMessage = (function() { /** - * Properties of a ContactMessage. + * Properties of a PaymentInviteMessage. * @memberof proto - * @interface IContactMessage - * @property {string|null} [displayName] ContactMessage displayName - * @property {string|null} [vcard] ContactMessage vcard - * @property {proto.IContextInfo|null} [contextInfo] ContactMessage contextInfo + * @interface IPaymentInviteMessage + * @property {proto.PaymentInviteMessage.PaymentInviteMessageServiceType|null} [serviceType] PaymentInviteMessage serviceType + * @property {number|Long|null} [expiryTimestamp] PaymentInviteMessage expiryTimestamp */ /** - * Constructs a new ContactMessage. + * Constructs a new PaymentInviteMessage. * @memberof proto - * @classdesc Represents a ContactMessage. - * @implements IContactMessage + * @classdesc Represents a PaymentInviteMessage. + * @implements IPaymentInviteMessage * @constructor - * @param {proto.IContactMessage=} [properties] Properties to set + * @param {proto.IPaymentInviteMessage=} [properties] Properties to set */ - function ContactMessage(properties) { + function PaymentInviteMessage(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -24519,101 +25096,88 @@ $root.proto = (function() { } /** - * ContactMessage displayName. - * @member {string} displayName - * @memberof proto.ContactMessage - * @instance - */ - ContactMessage.prototype.displayName = ""; - - /** - * ContactMessage vcard. - * @member {string} vcard - * @memberof proto.ContactMessage + * PaymentInviteMessage serviceType. + * @member {proto.PaymentInviteMessage.PaymentInviteMessageServiceType} serviceType + * @memberof proto.PaymentInviteMessage * @instance */ - ContactMessage.prototype.vcard = ""; + PaymentInviteMessage.prototype.serviceType = 0; /** - * ContactMessage contextInfo. - * @member {proto.IContextInfo|null|undefined} contextInfo - * @memberof proto.ContactMessage + * PaymentInviteMessage expiryTimestamp. + * @member {number|Long} expiryTimestamp + * @memberof proto.PaymentInviteMessage * @instance */ - ContactMessage.prototype.contextInfo = null; + PaymentInviteMessage.prototype.expiryTimestamp = $util.Long ? $util.Long.fromBits(0,0,false) : 0; /** - * Creates a new ContactMessage instance using the specified properties. + * Creates a new PaymentInviteMessage instance using the specified properties. * @function create - * @memberof proto.ContactMessage + * @memberof proto.PaymentInviteMessage * @static - * @param {proto.IContactMessage=} [properties] Properties to set - * @returns {proto.ContactMessage} ContactMessage instance + * @param {proto.IPaymentInviteMessage=} [properties] Properties to set + * @returns {proto.PaymentInviteMessage} PaymentInviteMessage instance */ - ContactMessage.create = function create(properties) { - return new ContactMessage(properties); + PaymentInviteMessage.create = function create(properties) { + return new PaymentInviteMessage(properties); }; /** - * Encodes the specified ContactMessage message. Does not implicitly {@link proto.ContactMessage.verify|verify} messages. + * Encodes the specified PaymentInviteMessage message. Does not implicitly {@link proto.PaymentInviteMessage.verify|verify} messages. * @function encode - * @memberof proto.ContactMessage + * @memberof proto.PaymentInviteMessage * @static - * @param {proto.IContactMessage} message ContactMessage message or plain object to encode + * @param {proto.IPaymentInviteMessage} message PaymentInviteMessage message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ContactMessage.encode = function encode(message, writer) { + PaymentInviteMessage.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.displayName); - if (message.vcard != null && Object.hasOwnProperty.call(message, "vcard")) - writer.uint32(/* id 16, wireType 2 =*/130).string(message.vcard); - if (message.contextInfo != null && Object.hasOwnProperty.call(message, "contextInfo")) - $root.proto.ContextInfo.encode(message.contextInfo, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); + if (message.serviceType != null && Object.hasOwnProperty.call(message, "serviceType")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.serviceType); + if (message.expiryTimestamp != null && Object.hasOwnProperty.call(message, "expiryTimestamp")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.expiryTimestamp); return writer; }; /** - * Encodes the specified ContactMessage message, length delimited. Does not implicitly {@link proto.ContactMessage.verify|verify} messages. + * Encodes the specified PaymentInviteMessage message, length delimited. Does not implicitly {@link proto.PaymentInviteMessage.verify|verify} messages. * @function encodeDelimited - * @memberof proto.ContactMessage + * @memberof proto.PaymentInviteMessage * @static - * @param {proto.IContactMessage} message ContactMessage message or plain object to encode + * @param {proto.IPaymentInviteMessage} message PaymentInviteMessage message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ContactMessage.encodeDelimited = function encodeDelimited(message, writer) { + PaymentInviteMessage.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ContactMessage message from the specified reader or buffer. + * Decodes a PaymentInviteMessage message from the specified reader or buffer. * @function decode - * @memberof proto.ContactMessage + * @memberof proto.PaymentInviteMessage * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {proto.ContactMessage} ContactMessage + * @returns {proto.PaymentInviteMessage} PaymentInviteMessage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ContactMessage.decode = function decode(reader, length) { + PaymentInviteMessage.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.ContactMessage(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.PaymentInviteMessage(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.displayName = reader.string(); - break; - case 16: - message.vcard = reader.string(); + message.serviceType = reader.int32(); break; - case 17: - message.contextInfo = $root.proto.ContextInfo.decode(reader, reader.uint32()); + case 2: + message.expiryTimestamp = reader.int64(); break; default: reader.skipType(tag & 7); @@ -24624,140 +25188,175 @@ $root.proto = (function() { }; /** - * Decodes a ContactMessage message from the specified reader or buffer, length delimited. + * Decodes a PaymentInviteMessage message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof proto.ContactMessage + * @memberof proto.PaymentInviteMessage * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.ContactMessage} ContactMessage + * @returns {proto.PaymentInviteMessage} PaymentInviteMessage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ContactMessage.decodeDelimited = function decodeDelimited(reader) { + PaymentInviteMessage.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ContactMessage message. + * Verifies a PaymentInviteMessage message. * @function verify - * @memberof proto.ContactMessage + * @memberof proto.PaymentInviteMessage * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ContactMessage.verify = function verify(message) { + PaymentInviteMessage.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.displayName != null && message.hasOwnProperty("displayName")) - if (!$util.isString(message.displayName)) - return "displayName: string expected"; - if (message.vcard != null && message.hasOwnProperty("vcard")) - if (!$util.isString(message.vcard)) - return "vcard: string expected"; - if (message.contextInfo != null && message.hasOwnProperty("contextInfo")) { - var error = $root.proto.ContextInfo.verify(message.contextInfo); - if (error) - return "contextInfo." + error; - } + if (message.serviceType != null && message.hasOwnProperty("serviceType")) + switch (message.serviceType) { + default: + return "serviceType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.expiryTimestamp != null && message.hasOwnProperty("expiryTimestamp")) + if (!$util.isInteger(message.expiryTimestamp) && !(message.expiryTimestamp && $util.isInteger(message.expiryTimestamp.low) && $util.isInteger(message.expiryTimestamp.high))) + return "expiryTimestamp: integer|Long expected"; return null; }; /** - * Creates a ContactMessage message from a plain object. Also converts values to their respective internal types. + * Creates a PaymentInviteMessage message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof proto.ContactMessage + * @memberof proto.PaymentInviteMessage * @static * @param {Object.} object Plain object - * @returns {proto.ContactMessage} ContactMessage + * @returns {proto.PaymentInviteMessage} PaymentInviteMessage */ - ContactMessage.fromObject = function fromObject(object) { - if (object instanceof $root.proto.ContactMessage) + PaymentInviteMessage.fromObject = function fromObject(object) { + if (object instanceof $root.proto.PaymentInviteMessage) return object; - var message = new $root.proto.ContactMessage(); - if (object.displayName != null) - message.displayName = String(object.displayName); - if (object.vcard != null) - message.vcard = String(object.vcard); - if (object.contextInfo != null) { - if (typeof object.contextInfo !== "object") - throw TypeError(".proto.ContactMessage.contextInfo: object expected"); - message.contextInfo = $root.proto.ContextInfo.fromObject(object.contextInfo); + var message = new $root.proto.PaymentInviteMessage(); + switch (object.serviceType) { + case "UNKNOWN": + case 0: + message.serviceType = 0; + break; + case "FBPAY": + case 1: + message.serviceType = 1; + break; + case "NOVI": + case 2: + message.serviceType = 2; + break; + case "UPI": + case 3: + message.serviceType = 3; + break; } + if (object.expiryTimestamp != null) + if ($util.Long) + (message.expiryTimestamp = $util.Long.fromValue(object.expiryTimestamp)).unsigned = false; + else if (typeof object.expiryTimestamp === "string") + message.expiryTimestamp = parseInt(object.expiryTimestamp, 10); + else if (typeof object.expiryTimestamp === "number") + message.expiryTimestamp = object.expiryTimestamp; + else if (typeof object.expiryTimestamp === "object") + message.expiryTimestamp = new $util.LongBits(object.expiryTimestamp.low >>> 0, object.expiryTimestamp.high >>> 0).toNumber(); return message; }; /** - * Creates a plain object from a ContactMessage message. Also converts values to other types if specified. + * Creates a plain object from a PaymentInviteMessage message. Also converts values to other types if specified. * @function toObject - * @memberof proto.ContactMessage + * @memberof proto.PaymentInviteMessage * @static - * @param {proto.ContactMessage} message ContactMessage + * @param {proto.PaymentInviteMessage} message PaymentInviteMessage * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ContactMessage.toObject = function toObject(message, options) { + PaymentInviteMessage.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.displayName = ""; - object.vcard = ""; - object.contextInfo = null; + object.serviceType = options.enums === String ? "UNKNOWN" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.expiryTimestamp = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.expiryTimestamp = options.longs === String ? "0" : 0; } - if (message.displayName != null && message.hasOwnProperty("displayName")) - object.displayName = message.displayName; - if (message.vcard != null && message.hasOwnProperty("vcard")) - object.vcard = message.vcard; - if (message.contextInfo != null && message.hasOwnProperty("contextInfo")) - object.contextInfo = $root.proto.ContextInfo.toObject(message.contextInfo, options); + if (message.serviceType != null && message.hasOwnProperty("serviceType")) + object.serviceType = options.enums === String ? $root.proto.PaymentInviteMessage.PaymentInviteMessageServiceType[message.serviceType] : message.serviceType; + if (message.expiryTimestamp != null && message.hasOwnProperty("expiryTimestamp")) + if (typeof message.expiryTimestamp === "number") + object.expiryTimestamp = options.longs === String ? String(message.expiryTimestamp) : message.expiryTimestamp; + else + object.expiryTimestamp = options.longs === String ? $util.Long.prototype.toString.call(message.expiryTimestamp) : options.longs === Number ? new $util.LongBits(message.expiryTimestamp.low >>> 0, message.expiryTimestamp.high >>> 0).toNumber() : message.expiryTimestamp; return object; }; /** - * Converts this ContactMessage to JSON. + * Converts this PaymentInviteMessage to JSON. * @function toJSON - * @memberof proto.ContactMessage + * @memberof proto.PaymentInviteMessage * @instance * @returns {Object.} JSON object */ - ContactMessage.prototype.toJSON = function toJSON() { + PaymentInviteMessage.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ContactMessage; + /** + * PaymentInviteMessageServiceType enum. + * @name proto.PaymentInviteMessage.PaymentInviteMessageServiceType + * @enum {number} + * @property {number} UNKNOWN=0 UNKNOWN value + * @property {number} FBPAY=1 FBPAY value + * @property {number} NOVI=2 NOVI value + * @property {number} UPI=3 UPI value + */ + PaymentInviteMessage.PaymentInviteMessageServiceType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNKNOWN"] = 0; + values[valuesById[1] = "FBPAY"] = 1; + values[valuesById[2] = "NOVI"] = 2; + values[valuesById[3] = "UPI"] = 3; + return values; + })(); + + return PaymentInviteMessage; })(); - proto.LocationMessage = (function() { + proto.PBMediaData = (function() { /** - * Properties of a LocationMessage. + * Properties of a PBMediaData. * @memberof proto - * @interface ILocationMessage - * @property {number|null} [degreesLatitude] LocationMessage degreesLatitude - * @property {number|null} [degreesLongitude] LocationMessage degreesLongitude - * @property {string|null} [name] LocationMessage name - * @property {string|null} [address] LocationMessage address - * @property {string|null} [url] LocationMessage url - * @property {boolean|null} [isLive] LocationMessage isLive - * @property {number|null} [accuracyInMeters] LocationMessage accuracyInMeters - * @property {number|null} [speedInMps] LocationMessage speedInMps - * @property {number|null} [degreesClockwiseFromMagneticNorth] LocationMessage degreesClockwiseFromMagneticNorth - * @property {string|null} [comment] LocationMessage comment - * @property {Uint8Array|null} [jpegThumbnail] LocationMessage jpegThumbnail - * @property {proto.IContextInfo|null} [contextInfo] LocationMessage contextInfo + * @interface IPBMediaData + * @property {Uint8Array|null} [mediaKey] PBMediaData mediaKey + * @property {number|Long|null} [mediaKeyTimestamp] PBMediaData mediaKeyTimestamp + * @property {Uint8Array|null} [fileSha256] PBMediaData fileSha256 + * @property {Uint8Array|null} [fileEncSha256] PBMediaData fileEncSha256 + * @property {string|null} [directPath] PBMediaData directPath */ /** - * Constructs a new LocationMessage. + * Constructs a new PBMediaData. * @memberof proto - * @classdesc Represents a LocationMessage. - * @implements ILocationMessage + * @classdesc Represents a PBMediaData. + * @implements IPBMediaData * @constructor - * @param {proto.ILocationMessage=} [properties] Properties to set + * @param {proto.IPBMediaData=} [properties] Properties to set */ - function LocationMessage(properties) { + function PBMediaData(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -24765,218 +25364,127 @@ $root.proto = (function() { } /** - * LocationMessage degreesLatitude. - * @member {number} degreesLatitude - * @memberof proto.LocationMessage - * @instance - */ - LocationMessage.prototype.degreesLatitude = 0; - - /** - * LocationMessage degreesLongitude. - * @member {number} degreesLongitude - * @memberof proto.LocationMessage - * @instance - */ - LocationMessage.prototype.degreesLongitude = 0; - - /** - * LocationMessage name. - * @member {string} name - * @memberof proto.LocationMessage - * @instance - */ - LocationMessage.prototype.name = ""; - - /** - * LocationMessage address. - * @member {string} address - * @memberof proto.LocationMessage - * @instance - */ - LocationMessage.prototype.address = ""; - - /** - * LocationMessage url. - * @member {string} url - * @memberof proto.LocationMessage - * @instance - */ - LocationMessage.prototype.url = ""; - - /** - * LocationMessage isLive. - * @member {boolean} isLive - * @memberof proto.LocationMessage - * @instance - */ - LocationMessage.prototype.isLive = false; - - /** - * LocationMessage accuracyInMeters. - * @member {number} accuracyInMeters - * @memberof proto.LocationMessage - * @instance - */ - LocationMessage.prototype.accuracyInMeters = 0; - - /** - * LocationMessage speedInMps. - * @member {number} speedInMps - * @memberof proto.LocationMessage + * PBMediaData mediaKey. + * @member {Uint8Array} mediaKey + * @memberof proto.PBMediaData * @instance */ - LocationMessage.prototype.speedInMps = 0; + PBMediaData.prototype.mediaKey = $util.newBuffer([]); /** - * LocationMessage degreesClockwiseFromMagneticNorth. - * @member {number} degreesClockwiseFromMagneticNorth - * @memberof proto.LocationMessage + * PBMediaData mediaKeyTimestamp. + * @member {number|Long} mediaKeyTimestamp + * @memberof proto.PBMediaData * @instance */ - LocationMessage.prototype.degreesClockwiseFromMagneticNorth = 0; + PBMediaData.prototype.mediaKeyTimestamp = $util.Long ? $util.Long.fromBits(0,0,false) : 0; /** - * LocationMessage comment. - * @member {string} comment - * @memberof proto.LocationMessage + * PBMediaData fileSha256. + * @member {Uint8Array} fileSha256 + * @memberof proto.PBMediaData * @instance */ - LocationMessage.prototype.comment = ""; + PBMediaData.prototype.fileSha256 = $util.newBuffer([]); /** - * LocationMessage jpegThumbnail. - * @member {Uint8Array} jpegThumbnail - * @memberof proto.LocationMessage + * PBMediaData fileEncSha256. + * @member {Uint8Array} fileEncSha256 + * @memberof proto.PBMediaData * @instance */ - LocationMessage.prototype.jpegThumbnail = $util.newBuffer([]); + PBMediaData.prototype.fileEncSha256 = $util.newBuffer([]); /** - * LocationMessage contextInfo. - * @member {proto.IContextInfo|null|undefined} contextInfo - * @memberof proto.LocationMessage + * PBMediaData directPath. + * @member {string} directPath + * @memberof proto.PBMediaData * @instance */ - LocationMessage.prototype.contextInfo = null; + PBMediaData.prototype.directPath = ""; /** - * Creates a new LocationMessage instance using the specified properties. + * Creates a new PBMediaData instance using the specified properties. * @function create - * @memberof proto.LocationMessage + * @memberof proto.PBMediaData * @static - * @param {proto.ILocationMessage=} [properties] Properties to set - * @returns {proto.LocationMessage} LocationMessage instance + * @param {proto.IPBMediaData=} [properties] Properties to set + * @returns {proto.PBMediaData} PBMediaData instance */ - LocationMessage.create = function create(properties) { - return new LocationMessage(properties); + PBMediaData.create = function create(properties) { + return new PBMediaData(properties); }; /** - * Encodes the specified LocationMessage message. Does not implicitly {@link proto.LocationMessage.verify|verify} messages. + * Encodes the specified PBMediaData message. Does not implicitly {@link proto.PBMediaData.verify|verify} messages. * @function encode - * @memberof proto.LocationMessage + * @memberof proto.PBMediaData * @static - * @param {proto.ILocationMessage} message LocationMessage message or plain object to encode + * @param {proto.IPBMediaData} message PBMediaData message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - LocationMessage.encode = function encode(message, writer) { + PBMediaData.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.degreesLatitude != null && Object.hasOwnProperty.call(message, "degreesLatitude")) - writer.uint32(/* id 1, wireType 1 =*/9).double(message.degreesLatitude); - if (message.degreesLongitude != null && Object.hasOwnProperty.call(message, "degreesLongitude")) - writer.uint32(/* id 2, wireType 1 =*/17).double(message.degreesLongitude); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.name); - if (message.address != null && Object.hasOwnProperty.call(message, "address")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.address); - if (message.url != null && Object.hasOwnProperty.call(message, "url")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.url); - if (message.isLive != null && Object.hasOwnProperty.call(message, "isLive")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.isLive); - if (message.accuracyInMeters != null && Object.hasOwnProperty.call(message, "accuracyInMeters")) - writer.uint32(/* id 7, wireType 0 =*/56).uint32(message.accuracyInMeters); - if (message.speedInMps != null && Object.hasOwnProperty.call(message, "speedInMps")) - writer.uint32(/* id 8, wireType 5 =*/69).float(message.speedInMps); - if (message.degreesClockwiseFromMagneticNorth != null && Object.hasOwnProperty.call(message, "degreesClockwiseFromMagneticNorth")) - writer.uint32(/* id 9, wireType 0 =*/72).uint32(message.degreesClockwiseFromMagneticNorth); - if (message.comment != null && Object.hasOwnProperty.call(message, "comment")) - writer.uint32(/* id 11, wireType 2 =*/90).string(message.comment); - if (message.jpegThumbnail != null && Object.hasOwnProperty.call(message, "jpegThumbnail")) - writer.uint32(/* id 16, wireType 2 =*/130).bytes(message.jpegThumbnail); - if (message.contextInfo != null && Object.hasOwnProperty.call(message, "contextInfo")) - $root.proto.ContextInfo.encode(message.contextInfo, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); + if (message.mediaKey != null && Object.hasOwnProperty.call(message, "mediaKey")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.mediaKey); + if (message.mediaKeyTimestamp != null && Object.hasOwnProperty.call(message, "mediaKeyTimestamp")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.mediaKeyTimestamp); + if (message.fileSha256 != null && Object.hasOwnProperty.call(message, "fileSha256")) + writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.fileSha256); + if (message.fileEncSha256 != null && Object.hasOwnProperty.call(message, "fileEncSha256")) + writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.fileEncSha256); + if (message.directPath != null && Object.hasOwnProperty.call(message, "directPath")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.directPath); return writer; }; /** - * Encodes the specified LocationMessage message, length delimited. Does not implicitly {@link proto.LocationMessage.verify|verify} messages. + * Encodes the specified PBMediaData message, length delimited. Does not implicitly {@link proto.PBMediaData.verify|verify} messages. * @function encodeDelimited - * @memberof proto.LocationMessage + * @memberof proto.PBMediaData * @static - * @param {proto.ILocationMessage} message LocationMessage message or plain object to encode + * @param {proto.IPBMediaData} message PBMediaData message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - LocationMessage.encodeDelimited = function encodeDelimited(message, writer) { + PBMediaData.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a LocationMessage message from the specified reader or buffer. + * Decodes a PBMediaData message from the specified reader or buffer. * @function decode - * @memberof proto.LocationMessage + * @memberof proto.PBMediaData * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {proto.LocationMessage} LocationMessage + * @returns {proto.PBMediaData} PBMediaData * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - LocationMessage.decode = function decode(reader, length) { + PBMediaData.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.LocationMessage(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.PBMediaData(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.degreesLatitude = reader.double(); + message.mediaKey = reader.bytes(); break; case 2: - message.degreesLongitude = reader.double(); + message.mediaKeyTimestamp = reader.int64(); break; case 3: - message.name = reader.string(); + message.fileSha256 = reader.bytes(); break; case 4: - message.address = reader.string(); + message.fileEncSha256 = reader.bytes(); break; case 5: - message.url = reader.string(); - break; - case 6: - message.isLive = reader.bool(); - break; - case 7: - message.accuracyInMeters = reader.uint32(); - break; - case 8: - message.speedInMps = reader.float(); - break; - case 9: - message.degreesClockwiseFromMagneticNorth = reader.uint32(); - break; - case 11: - message.comment = reader.string(); - break; - case 16: - message.jpegThumbnail = reader.bytes(); - break; - case 17: - message.contextInfo = $root.proto.ContextInfo.decode(reader, reader.uint32()); + message.directPath = reader.string(); break; default: reader.skipType(tag & 7); @@ -24987,229 +25495,184 @@ $root.proto = (function() { }; /** - * Decodes a LocationMessage message from the specified reader or buffer, length delimited. + * Decodes a PBMediaData message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof proto.LocationMessage + * @memberof proto.PBMediaData * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.LocationMessage} LocationMessage + * @returns {proto.PBMediaData} PBMediaData * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - LocationMessage.decodeDelimited = function decodeDelimited(reader) { + PBMediaData.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a LocationMessage message. + * Verifies a PBMediaData message. * @function verify - * @memberof proto.LocationMessage + * @memberof proto.PBMediaData * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - LocationMessage.verify = function verify(message) { + PBMediaData.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.degreesLatitude != null && message.hasOwnProperty("degreesLatitude")) - if (typeof message.degreesLatitude !== "number") - return "degreesLatitude: number expected"; - if (message.degreesLongitude != null && message.hasOwnProperty("degreesLongitude")) - if (typeof message.degreesLongitude !== "number") - return "degreesLongitude: number expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.address != null && message.hasOwnProperty("address")) - if (!$util.isString(message.address)) - return "address: string expected"; - if (message.url != null && message.hasOwnProperty("url")) - if (!$util.isString(message.url)) - return "url: string expected"; - if (message.isLive != null && message.hasOwnProperty("isLive")) - if (typeof message.isLive !== "boolean") - return "isLive: boolean expected"; - if (message.accuracyInMeters != null && message.hasOwnProperty("accuracyInMeters")) - if (!$util.isInteger(message.accuracyInMeters)) - return "accuracyInMeters: integer expected"; - if (message.speedInMps != null && message.hasOwnProperty("speedInMps")) - if (typeof message.speedInMps !== "number") - return "speedInMps: number expected"; - if (message.degreesClockwiseFromMagneticNorth != null && message.hasOwnProperty("degreesClockwiseFromMagneticNorth")) - if (!$util.isInteger(message.degreesClockwiseFromMagneticNorth)) - return "degreesClockwiseFromMagneticNorth: integer expected"; - if (message.comment != null && message.hasOwnProperty("comment")) - if (!$util.isString(message.comment)) - return "comment: string expected"; - if (message.jpegThumbnail != null && message.hasOwnProperty("jpegThumbnail")) - if (!(message.jpegThumbnail && typeof message.jpegThumbnail.length === "number" || $util.isString(message.jpegThumbnail))) - return "jpegThumbnail: buffer expected"; - if (message.contextInfo != null && message.hasOwnProperty("contextInfo")) { - var error = $root.proto.ContextInfo.verify(message.contextInfo); - if (error) - return "contextInfo." + error; - } + if (message.mediaKey != null && message.hasOwnProperty("mediaKey")) + if (!(message.mediaKey && typeof message.mediaKey.length === "number" || $util.isString(message.mediaKey))) + return "mediaKey: buffer expected"; + if (message.mediaKeyTimestamp != null && message.hasOwnProperty("mediaKeyTimestamp")) + if (!$util.isInteger(message.mediaKeyTimestamp) && !(message.mediaKeyTimestamp && $util.isInteger(message.mediaKeyTimestamp.low) && $util.isInteger(message.mediaKeyTimestamp.high))) + return "mediaKeyTimestamp: integer|Long expected"; + if (message.fileSha256 != null && message.hasOwnProperty("fileSha256")) + if (!(message.fileSha256 && typeof message.fileSha256.length === "number" || $util.isString(message.fileSha256))) + return "fileSha256: buffer expected"; + if (message.fileEncSha256 != null && message.hasOwnProperty("fileEncSha256")) + if (!(message.fileEncSha256 && typeof message.fileEncSha256.length === "number" || $util.isString(message.fileEncSha256))) + return "fileEncSha256: buffer expected"; + if (message.directPath != null && message.hasOwnProperty("directPath")) + if (!$util.isString(message.directPath)) + return "directPath: string expected"; return null; }; /** - * Creates a LocationMessage message from a plain object. Also converts values to their respective internal types. + * Creates a PBMediaData message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof proto.LocationMessage + * @memberof proto.PBMediaData * @static * @param {Object.} object Plain object - * @returns {proto.LocationMessage} LocationMessage + * @returns {proto.PBMediaData} PBMediaData */ - LocationMessage.fromObject = function fromObject(object) { - if (object instanceof $root.proto.LocationMessage) + PBMediaData.fromObject = function fromObject(object) { + if (object instanceof $root.proto.PBMediaData) return object; - var message = new $root.proto.LocationMessage(); - if (object.degreesLatitude != null) - message.degreesLatitude = Number(object.degreesLatitude); - if (object.degreesLongitude != null) - message.degreesLongitude = Number(object.degreesLongitude); - if (object.name != null) - message.name = String(object.name); - if (object.address != null) - message.address = String(object.address); - if (object.url != null) - message.url = String(object.url); - if (object.isLive != null) - message.isLive = Boolean(object.isLive); - if (object.accuracyInMeters != null) - message.accuracyInMeters = object.accuracyInMeters >>> 0; - if (object.speedInMps != null) - message.speedInMps = Number(object.speedInMps); - if (object.degreesClockwiseFromMagneticNorth != null) - message.degreesClockwiseFromMagneticNorth = object.degreesClockwiseFromMagneticNorth >>> 0; - if (object.comment != null) - message.comment = String(object.comment); - if (object.jpegThumbnail != null) - if (typeof object.jpegThumbnail === "string") - $util.base64.decode(object.jpegThumbnail, message.jpegThumbnail = $util.newBuffer($util.base64.length(object.jpegThumbnail)), 0); - else if (object.jpegThumbnail.length) - message.jpegThumbnail = object.jpegThumbnail; - if (object.contextInfo != null) { - if (typeof object.contextInfo !== "object") - throw TypeError(".proto.LocationMessage.contextInfo: object expected"); - message.contextInfo = $root.proto.ContextInfo.fromObject(object.contextInfo); - } + var message = new $root.proto.PBMediaData(); + if (object.mediaKey != null) + if (typeof object.mediaKey === "string") + $util.base64.decode(object.mediaKey, message.mediaKey = $util.newBuffer($util.base64.length(object.mediaKey)), 0); + else if (object.mediaKey.length) + message.mediaKey = object.mediaKey; + if (object.mediaKeyTimestamp != null) + if ($util.Long) + (message.mediaKeyTimestamp = $util.Long.fromValue(object.mediaKeyTimestamp)).unsigned = false; + else if (typeof object.mediaKeyTimestamp === "string") + message.mediaKeyTimestamp = parseInt(object.mediaKeyTimestamp, 10); + else if (typeof object.mediaKeyTimestamp === "number") + message.mediaKeyTimestamp = object.mediaKeyTimestamp; + else if (typeof object.mediaKeyTimestamp === "object") + message.mediaKeyTimestamp = new $util.LongBits(object.mediaKeyTimestamp.low >>> 0, object.mediaKeyTimestamp.high >>> 0).toNumber(); + if (object.fileSha256 != null) + if (typeof object.fileSha256 === "string") + $util.base64.decode(object.fileSha256, message.fileSha256 = $util.newBuffer($util.base64.length(object.fileSha256)), 0); + else if (object.fileSha256.length) + message.fileSha256 = object.fileSha256; + if (object.fileEncSha256 != null) + if (typeof object.fileEncSha256 === "string") + $util.base64.decode(object.fileEncSha256, message.fileEncSha256 = $util.newBuffer($util.base64.length(object.fileEncSha256)), 0); + else if (object.fileEncSha256.length) + message.fileEncSha256 = object.fileEncSha256; + if (object.directPath != null) + message.directPath = String(object.directPath); return message; }; /** - * Creates a plain object from a LocationMessage message. Also converts values to other types if specified. + * Creates a plain object from a PBMediaData message. Also converts values to other types if specified. * @function toObject - * @memberof proto.LocationMessage + * @memberof proto.PBMediaData * @static - * @param {proto.LocationMessage} message LocationMessage + * @param {proto.PBMediaData} message PBMediaData * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - LocationMessage.toObject = function toObject(message, options) { + PBMediaData.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.degreesLatitude = 0; - object.degreesLongitude = 0; - object.name = ""; - object.address = ""; - object.url = ""; - object.isLive = false; - object.accuracyInMeters = 0; - object.speedInMps = 0; - object.degreesClockwiseFromMagneticNorth = 0; - object.comment = ""; if (options.bytes === String) - object.jpegThumbnail = ""; + object.mediaKey = ""; else { - object.jpegThumbnail = []; + object.mediaKey = []; if (options.bytes !== Array) - object.jpegThumbnail = $util.newBuffer(object.jpegThumbnail); + object.mediaKey = $util.newBuffer(object.mediaKey); } - object.contextInfo = null; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.mediaKeyTimestamp = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.mediaKeyTimestamp = options.longs === String ? "0" : 0; + if (options.bytes === String) + object.fileSha256 = ""; + else { + object.fileSha256 = []; + if (options.bytes !== Array) + object.fileSha256 = $util.newBuffer(object.fileSha256); + } + if (options.bytes === String) + object.fileEncSha256 = ""; + else { + object.fileEncSha256 = []; + if (options.bytes !== Array) + object.fileEncSha256 = $util.newBuffer(object.fileEncSha256); + } + object.directPath = ""; } - if (message.degreesLatitude != null && message.hasOwnProperty("degreesLatitude")) - object.degreesLatitude = options.json && !isFinite(message.degreesLatitude) ? String(message.degreesLatitude) : message.degreesLatitude; - if (message.degreesLongitude != null && message.hasOwnProperty("degreesLongitude")) - object.degreesLongitude = options.json && !isFinite(message.degreesLongitude) ? String(message.degreesLongitude) : message.degreesLongitude; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.address != null && message.hasOwnProperty("address")) - object.address = message.address; - if (message.url != null && message.hasOwnProperty("url")) - object.url = message.url; - if (message.isLive != null && message.hasOwnProperty("isLive")) - object.isLive = message.isLive; - if (message.accuracyInMeters != null && message.hasOwnProperty("accuracyInMeters")) - object.accuracyInMeters = message.accuracyInMeters; - if (message.speedInMps != null && message.hasOwnProperty("speedInMps")) - object.speedInMps = options.json && !isFinite(message.speedInMps) ? String(message.speedInMps) : message.speedInMps; - if (message.degreesClockwiseFromMagneticNorth != null && message.hasOwnProperty("degreesClockwiseFromMagneticNorth")) - object.degreesClockwiseFromMagneticNorth = message.degreesClockwiseFromMagneticNorth; - if (message.comment != null && message.hasOwnProperty("comment")) - object.comment = message.comment; - if (message.jpegThumbnail != null && message.hasOwnProperty("jpegThumbnail")) - object.jpegThumbnail = options.bytes === String ? $util.base64.encode(message.jpegThumbnail, 0, message.jpegThumbnail.length) : options.bytes === Array ? Array.prototype.slice.call(message.jpegThumbnail) : message.jpegThumbnail; - if (message.contextInfo != null && message.hasOwnProperty("contextInfo")) - object.contextInfo = $root.proto.ContextInfo.toObject(message.contextInfo, options); + if (message.mediaKey != null && message.hasOwnProperty("mediaKey")) + object.mediaKey = options.bytes === String ? $util.base64.encode(message.mediaKey, 0, message.mediaKey.length) : options.bytes === Array ? Array.prototype.slice.call(message.mediaKey) : message.mediaKey; + if (message.mediaKeyTimestamp != null && message.hasOwnProperty("mediaKeyTimestamp")) + if (typeof message.mediaKeyTimestamp === "number") + object.mediaKeyTimestamp = options.longs === String ? String(message.mediaKeyTimestamp) : message.mediaKeyTimestamp; + else + object.mediaKeyTimestamp = options.longs === String ? $util.Long.prototype.toString.call(message.mediaKeyTimestamp) : options.longs === Number ? new $util.LongBits(message.mediaKeyTimestamp.low >>> 0, message.mediaKeyTimestamp.high >>> 0).toNumber() : message.mediaKeyTimestamp; + if (message.fileSha256 != null && message.hasOwnProperty("fileSha256")) + object.fileSha256 = options.bytes === String ? $util.base64.encode(message.fileSha256, 0, message.fileSha256.length) : options.bytes === Array ? Array.prototype.slice.call(message.fileSha256) : message.fileSha256; + if (message.fileEncSha256 != null && message.hasOwnProperty("fileEncSha256")) + object.fileEncSha256 = options.bytes === String ? $util.base64.encode(message.fileEncSha256, 0, message.fileEncSha256.length) : options.bytes === Array ? Array.prototype.slice.call(message.fileEncSha256) : message.fileEncSha256; + if (message.directPath != null && message.hasOwnProperty("directPath")) + object.directPath = message.directPath; return object; }; /** - * Converts this LocationMessage to JSON. + * Converts this PBMediaData to JSON. * @function toJSON - * @memberof proto.LocationMessage + * @memberof proto.PBMediaData * @instance * @returns {Object.} JSON object */ - LocationMessage.prototype.toJSON = function toJSON() { + PBMediaData.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return LocationMessage; + return PBMediaData; })(); - proto.ExtendedTextMessage = (function() { + proto.Point = (function() { /** - * Properties of an ExtendedTextMessage. + * Properties of a Point. * @memberof proto - * @interface IExtendedTextMessage - * @property {string|null} [text] ExtendedTextMessage text - * @property {string|null} [matchedText] ExtendedTextMessage matchedText - * @property {string|null} [canonicalUrl] ExtendedTextMessage canonicalUrl - * @property {string|null} [description] ExtendedTextMessage description - * @property {string|null} [title] ExtendedTextMessage title - * @property {number|null} [textArgb] ExtendedTextMessage textArgb - * @property {number|null} [backgroundArgb] ExtendedTextMessage backgroundArgb - * @property {proto.ExtendedTextMessage.ExtendedTextMessageFontType|null} [font] ExtendedTextMessage font - * @property {proto.ExtendedTextMessage.ExtendedTextMessagePreviewType|null} [previewType] ExtendedTextMessage previewType - * @property {Uint8Array|null} [jpegThumbnail] ExtendedTextMessage jpegThumbnail - * @property {proto.IContextInfo|null} [contextInfo] ExtendedTextMessage contextInfo - * @property {boolean|null} [doNotPlayInline] ExtendedTextMessage doNotPlayInline - * @property {string|null} [thumbnailDirectPath] ExtendedTextMessage thumbnailDirectPath - * @property {Uint8Array|null} [thumbnailSha256] ExtendedTextMessage thumbnailSha256 - * @property {Uint8Array|null} [thumbnailEncSha256] ExtendedTextMessage thumbnailEncSha256 - * @property {Uint8Array|null} [mediaKey] ExtendedTextMessage mediaKey - * @property {number|Long|null} [mediaKeyTimestamp] ExtendedTextMessage mediaKeyTimestamp - * @property {number|null} [thumbnailHeight] ExtendedTextMessage thumbnailHeight - * @property {number|null} [thumbnailWidth] ExtendedTextMessage thumbnailWidth - * @property {proto.ExtendedTextMessage.ExtendedTextMessageInviteLinkGroupType|null} [inviteLinkGroupType] ExtendedTextMessage inviteLinkGroupType + * @interface IPoint + * @property {number|null} [xDeprecated] Point xDeprecated + * @property {number|null} [yDeprecated] Point yDeprecated + * @property {number|null} [x] Point x + * @property {number|null} [y] Point y */ /** - * Constructs a new ExtendedTextMessage. + * Constructs a new Point. * @memberof proto - * @classdesc Represents an ExtendedTextMessage. - * @implements IExtendedTextMessage + * @classdesc Represents a Point. + * @implements IPoint * @constructor - * @param {proto.IExtendedTextMessage=} [properties] Properties to set + * @param {proto.IPoint=} [properties] Properties to set */ - function ExtendedTextMessage(properties) { + function Point(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -25217,322 +25680,372 @@ $root.proto = (function() { } /** - * ExtendedTextMessage text. - * @member {string} text - * @memberof proto.ExtendedTextMessage + * Point xDeprecated. + * @member {number} xDeprecated + * @memberof proto.Point * @instance */ - ExtendedTextMessage.prototype.text = ""; + Point.prototype.xDeprecated = 0; /** - * ExtendedTextMessage matchedText. - * @member {string} matchedText - * @memberof proto.ExtendedTextMessage + * Point yDeprecated. + * @member {number} yDeprecated + * @memberof proto.Point * @instance */ - ExtendedTextMessage.prototype.matchedText = ""; + Point.prototype.yDeprecated = 0; /** - * ExtendedTextMessage canonicalUrl. - * @member {string} canonicalUrl - * @memberof proto.ExtendedTextMessage + * Point x. + * @member {number} x + * @memberof proto.Point * @instance */ - ExtendedTextMessage.prototype.canonicalUrl = ""; + Point.prototype.x = 0; /** - * ExtendedTextMessage description. - * @member {string} description - * @memberof proto.ExtendedTextMessage + * Point y. + * @member {number} y + * @memberof proto.Point * @instance */ - ExtendedTextMessage.prototype.description = ""; + Point.prototype.y = 0; /** - * ExtendedTextMessage title. - * @member {string} title - * @memberof proto.ExtendedTextMessage - * @instance + * Creates a new Point instance using the specified properties. + * @function create + * @memberof proto.Point + * @static + * @param {proto.IPoint=} [properties] Properties to set + * @returns {proto.Point} Point instance */ - ExtendedTextMessage.prototype.title = ""; + Point.create = function create(properties) { + return new Point(properties); + }; /** - * ExtendedTextMessage textArgb. - * @member {number} textArgb - * @memberof proto.ExtendedTextMessage - * @instance + * Encodes the specified Point message. Does not implicitly {@link proto.Point.verify|verify} messages. + * @function encode + * @memberof proto.Point + * @static + * @param {proto.IPoint} message Point message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - ExtendedTextMessage.prototype.textArgb = 0; + Point.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.xDeprecated != null && Object.hasOwnProperty.call(message, "xDeprecated")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.xDeprecated); + if (message.yDeprecated != null && Object.hasOwnProperty.call(message, "yDeprecated")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.yDeprecated); + if (message.x != null && Object.hasOwnProperty.call(message, "x")) + writer.uint32(/* id 3, wireType 1 =*/25).double(message.x); + if (message.y != null && Object.hasOwnProperty.call(message, "y")) + writer.uint32(/* id 4, wireType 1 =*/33).double(message.y); + return writer; + }; /** - * ExtendedTextMessage backgroundArgb. - * @member {number} backgroundArgb - * @memberof proto.ExtendedTextMessage - * @instance + * Encodes the specified Point message, length delimited. Does not implicitly {@link proto.Point.verify|verify} messages. + * @function encodeDelimited + * @memberof proto.Point + * @static + * @param {proto.IPoint} message Point message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - ExtendedTextMessage.prototype.backgroundArgb = 0; + Point.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; /** - * ExtendedTextMessage font. - * @member {proto.ExtendedTextMessage.ExtendedTextMessageFontType} font - * @memberof proto.ExtendedTextMessage - * @instance + * Decodes a Point message from the specified reader or buffer. + * @function decode + * @memberof proto.Point + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {proto.Point} Point + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ExtendedTextMessage.prototype.font = 0; + Point.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.Point(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.xDeprecated = reader.int32(); + break; + case 2: + message.yDeprecated = reader.int32(); + break; + case 3: + message.x = reader.double(); + break; + case 4: + message.y = reader.double(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; /** - * ExtendedTextMessage previewType. - * @member {proto.ExtendedTextMessage.ExtendedTextMessagePreviewType} previewType - * @memberof proto.ExtendedTextMessage - * @instance + * Decodes a Point message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof proto.Point + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {proto.Point} Point + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ExtendedTextMessage.prototype.previewType = 0; + Point.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; /** - * ExtendedTextMessage jpegThumbnail. - * @member {Uint8Array} jpegThumbnail - * @memberof proto.ExtendedTextMessage - * @instance + * Verifies a Point message. + * @function verify + * @memberof proto.Point + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ExtendedTextMessage.prototype.jpegThumbnail = $util.newBuffer([]); + Point.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.xDeprecated != null && message.hasOwnProperty("xDeprecated")) + if (!$util.isInteger(message.xDeprecated)) + return "xDeprecated: integer expected"; + if (message.yDeprecated != null && message.hasOwnProperty("yDeprecated")) + if (!$util.isInteger(message.yDeprecated)) + return "yDeprecated: integer expected"; + if (message.x != null && message.hasOwnProperty("x")) + if (typeof message.x !== "number") + return "x: number expected"; + if (message.y != null && message.hasOwnProperty("y")) + if (typeof message.y !== "number") + return "y: number expected"; + return null; + }; /** - * ExtendedTextMessage contextInfo. - * @member {proto.IContextInfo|null|undefined} contextInfo - * @memberof proto.ExtendedTextMessage - * @instance + * Creates a Point message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof proto.Point + * @static + * @param {Object.} object Plain object + * @returns {proto.Point} Point */ - ExtendedTextMessage.prototype.contextInfo = null; + Point.fromObject = function fromObject(object) { + if (object instanceof $root.proto.Point) + return object; + var message = new $root.proto.Point(); + if (object.xDeprecated != null) + message.xDeprecated = object.xDeprecated | 0; + if (object.yDeprecated != null) + message.yDeprecated = object.yDeprecated | 0; + if (object.x != null) + message.x = Number(object.x); + if (object.y != null) + message.y = Number(object.y); + return message; + }; /** - * ExtendedTextMessage doNotPlayInline. - * @member {boolean} doNotPlayInline - * @memberof proto.ExtendedTextMessage - * @instance + * Creates a plain object from a Point message. Also converts values to other types if specified. + * @function toObject + * @memberof proto.Point + * @static + * @param {proto.Point} message Point + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object */ - ExtendedTextMessage.prototype.doNotPlayInline = false; + Point.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.xDeprecated = 0; + object.yDeprecated = 0; + object.x = 0; + object.y = 0; + } + if (message.xDeprecated != null && message.hasOwnProperty("xDeprecated")) + object.xDeprecated = message.xDeprecated; + if (message.yDeprecated != null && message.hasOwnProperty("yDeprecated")) + object.yDeprecated = message.yDeprecated; + if (message.x != null && message.hasOwnProperty("x")) + object.x = options.json && !isFinite(message.x) ? String(message.x) : message.x; + if (message.y != null && message.hasOwnProperty("y")) + object.y = options.json && !isFinite(message.y) ? String(message.y) : message.y; + return object; + }; /** - * ExtendedTextMessage thumbnailDirectPath. - * @member {string} thumbnailDirectPath - * @memberof proto.ExtendedTextMessage + * Converts this Point to JSON. + * @function toJSON + * @memberof proto.Point * @instance + * @returns {Object.} JSON object */ - ExtendedTextMessage.prototype.thumbnailDirectPath = ""; + Point.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * ExtendedTextMessage thumbnailSha256. - * @member {Uint8Array} thumbnailSha256 - * @memberof proto.ExtendedTextMessage - * @instance - */ - ExtendedTextMessage.prototype.thumbnailSha256 = $util.newBuffer([]); + return Point; + })(); + + proto.PollCreationMessage = (function() { /** - * ExtendedTextMessage thumbnailEncSha256. - * @member {Uint8Array} thumbnailEncSha256 - * @memberof proto.ExtendedTextMessage - * @instance + * Properties of a PollCreationMessage. + * @memberof proto + * @interface IPollCreationMessage + * @property {Uint8Array|null} [encKey] PollCreationMessage encKey + * @property {string|null} [name] PollCreationMessage name + * @property {Array.|null} [options] PollCreationMessage options + * @property {number|null} [selectableOptionsCount] PollCreationMessage selectableOptionsCount */ - ExtendedTextMessage.prototype.thumbnailEncSha256 = $util.newBuffer([]); /** - * ExtendedTextMessage mediaKey. - * @member {Uint8Array} mediaKey - * @memberof proto.ExtendedTextMessage - * @instance + * Constructs a new PollCreationMessage. + * @memberof proto + * @classdesc Represents a PollCreationMessage. + * @implements IPollCreationMessage + * @constructor + * @param {proto.IPollCreationMessage=} [properties] Properties to set */ - ExtendedTextMessage.prototype.mediaKey = $util.newBuffer([]); + function PollCreationMessage(properties) { + this.options = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } /** - * ExtendedTextMessage mediaKeyTimestamp. - * @member {number|Long} mediaKeyTimestamp - * @memberof proto.ExtendedTextMessage + * PollCreationMessage encKey. + * @member {Uint8Array} encKey + * @memberof proto.PollCreationMessage * @instance */ - ExtendedTextMessage.prototype.mediaKeyTimestamp = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + PollCreationMessage.prototype.encKey = $util.newBuffer([]); /** - * ExtendedTextMessage thumbnailHeight. - * @member {number} thumbnailHeight - * @memberof proto.ExtendedTextMessage + * PollCreationMessage name. + * @member {string} name + * @memberof proto.PollCreationMessage * @instance */ - ExtendedTextMessage.prototype.thumbnailHeight = 0; + PollCreationMessage.prototype.name = ""; /** - * ExtendedTextMessage thumbnailWidth. - * @member {number} thumbnailWidth - * @memberof proto.ExtendedTextMessage + * PollCreationMessage options. + * @member {Array.} options + * @memberof proto.PollCreationMessage * @instance */ - ExtendedTextMessage.prototype.thumbnailWidth = 0; + PollCreationMessage.prototype.options = $util.emptyArray; /** - * ExtendedTextMessage inviteLinkGroupType. - * @member {proto.ExtendedTextMessage.ExtendedTextMessageInviteLinkGroupType} inviteLinkGroupType - * @memberof proto.ExtendedTextMessage + * PollCreationMessage selectableOptionsCount. + * @member {number} selectableOptionsCount + * @memberof proto.PollCreationMessage * @instance */ - ExtendedTextMessage.prototype.inviteLinkGroupType = 0; + PollCreationMessage.prototype.selectableOptionsCount = 0; /** - * Creates a new ExtendedTextMessage instance using the specified properties. + * Creates a new PollCreationMessage instance using the specified properties. * @function create - * @memberof proto.ExtendedTextMessage + * @memberof proto.PollCreationMessage * @static - * @param {proto.IExtendedTextMessage=} [properties] Properties to set - * @returns {proto.ExtendedTextMessage} ExtendedTextMessage instance + * @param {proto.IPollCreationMessage=} [properties] Properties to set + * @returns {proto.PollCreationMessage} PollCreationMessage instance */ - ExtendedTextMessage.create = function create(properties) { - return new ExtendedTextMessage(properties); + PollCreationMessage.create = function create(properties) { + return new PollCreationMessage(properties); }; /** - * Encodes the specified ExtendedTextMessage message. Does not implicitly {@link proto.ExtendedTextMessage.verify|verify} messages. + * Encodes the specified PollCreationMessage message. Does not implicitly {@link proto.PollCreationMessage.verify|verify} messages. * @function encode - * @memberof proto.ExtendedTextMessage + * @memberof proto.PollCreationMessage * @static - * @param {proto.IExtendedTextMessage} message ExtendedTextMessage message or plain object to encode + * @param {proto.IPollCreationMessage} message PollCreationMessage message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ExtendedTextMessage.encode = function encode(message, writer) { + PollCreationMessage.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.text != null && Object.hasOwnProperty.call(message, "text")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.text); - if (message.matchedText != null && Object.hasOwnProperty.call(message, "matchedText")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.matchedText); - if (message.canonicalUrl != null && Object.hasOwnProperty.call(message, "canonicalUrl")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.canonicalUrl); - if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.description); - if (message.title != null && Object.hasOwnProperty.call(message, "title")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.title); - if (message.textArgb != null && Object.hasOwnProperty.call(message, "textArgb")) - writer.uint32(/* id 7, wireType 5 =*/61).fixed32(message.textArgb); - if (message.backgroundArgb != null && Object.hasOwnProperty.call(message, "backgroundArgb")) - writer.uint32(/* id 8, wireType 5 =*/69).fixed32(message.backgroundArgb); - if (message.font != null && Object.hasOwnProperty.call(message, "font")) - writer.uint32(/* id 9, wireType 0 =*/72).int32(message.font); - if (message.previewType != null && Object.hasOwnProperty.call(message, "previewType")) - writer.uint32(/* id 10, wireType 0 =*/80).int32(message.previewType); - if (message.jpegThumbnail != null && Object.hasOwnProperty.call(message, "jpegThumbnail")) - writer.uint32(/* id 16, wireType 2 =*/130).bytes(message.jpegThumbnail); - if (message.contextInfo != null && Object.hasOwnProperty.call(message, "contextInfo")) - $root.proto.ContextInfo.encode(message.contextInfo, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); - if (message.doNotPlayInline != null && Object.hasOwnProperty.call(message, "doNotPlayInline")) - writer.uint32(/* id 18, wireType 0 =*/144).bool(message.doNotPlayInline); - if (message.thumbnailDirectPath != null && Object.hasOwnProperty.call(message, "thumbnailDirectPath")) - writer.uint32(/* id 19, wireType 2 =*/154).string(message.thumbnailDirectPath); - if (message.thumbnailSha256 != null && Object.hasOwnProperty.call(message, "thumbnailSha256")) - writer.uint32(/* id 20, wireType 2 =*/162).bytes(message.thumbnailSha256); - if (message.thumbnailEncSha256 != null && Object.hasOwnProperty.call(message, "thumbnailEncSha256")) - writer.uint32(/* id 21, wireType 2 =*/170).bytes(message.thumbnailEncSha256); - if (message.mediaKey != null && Object.hasOwnProperty.call(message, "mediaKey")) - writer.uint32(/* id 22, wireType 2 =*/178).bytes(message.mediaKey); - if (message.mediaKeyTimestamp != null && Object.hasOwnProperty.call(message, "mediaKeyTimestamp")) - writer.uint32(/* id 23, wireType 0 =*/184).int64(message.mediaKeyTimestamp); - if (message.thumbnailHeight != null && Object.hasOwnProperty.call(message, "thumbnailHeight")) - writer.uint32(/* id 24, wireType 0 =*/192).uint32(message.thumbnailHeight); - if (message.thumbnailWidth != null && Object.hasOwnProperty.call(message, "thumbnailWidth")) - writer.uint32(/* id 25, wireType 0 =*/200).uint32(message.thumbnailWidth); - if (message.inviteLinkGroupType != null && Object.hasOwnProperty.call(message, "inviteLinkGroupType")) - writer.uint32(/* id 26, wireType 0 =*/208).int32(message.inviteLinkGroupType); + if (message.encKey != null && Object.hasOwnProperty.call(message, "encKey")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.encKey); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.name); + if (message.options != null && message.options.length) + for (var i = 0; i < message.options.length; ++i) + $root.proto.Option.encode(message.options[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.selectableOptionsCount != null && Object.hasOwnProperty.call(message, "selectableOptionsCount")) + writer.uint32(/* id 4, wireType 0 =*/32).uint32(message.selectableOptionsCount); return writer; }; /** - * Encodes the specified ExtendedTextMessage message, length delimited. Does not implicitly {@link proto.ExtendedTextMessage.verify|verify} messages. + * Encodes the specified PollCreationMessage message, length delimited. Does not implicitly {@link proto.PollCreationMessage.verify|verify} messages. * @function encodeDelimited - * @memberof proto.ExtendedTextMessage + * @memberof proto.PollCreationMessage * @static - * @param {proto.IExtendedTextMessage} message ExtendedTextMessage message or plain object to encode + * @param {proto.IPollCreationMessage} message PollCreationMessage message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ExtendedTextMessage.encodeDelimited = function encodeDelimited(message, writer) { + PollCreationMessage.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an ExtendedTextMessage message from the specified reader or buffer. + * Decodes a PollCreationMessage message from the specified reader or buffer. * @function decode - * @memberof proto.ExtendedTextMessage + * @memberof proto.PollCreationMessage * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {proto.ExtendedTextMessage} ExtendedTextMessage + * @returns {proto.PollCreationMessage} PollCreationMessage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ExtendedTextMessage.decode = function decode(reader, length) { + PollCreationMessage.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.ExtendedTextMessage(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.PollCreationMessage(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.text = reader.string(); + message.encKey = reader.bytes(); break; case 2: - message.matchedText = reader.string(); - break; - case 4: - message.canonicalUrl = reader.string(); - break; - case 5: - message.description = reader.string(); - break; - case 6: - message.title = reader.string(); - break; - case 7: - message.textArgb = reader.fixed32(); - break; - case 8: - message.backgroundArgb = reader.fixed32(); - break; - case 9: - message.font = reader.int32(); - break; - case 10: - message.previewType = reader.int32(); - break; - case 16: - message.jpegThumbnail = reader.bytes(); - break; - case 17: - message.contextInfo = $root.proto.ContextInfo.decode(reader, reader.uint32()); - break; - case 18: - message.doNotPlayInline = reader.bool(); - break; - case 19: - message.thumbnailDirectPath = reader.string(); - break; - case 20: - message.thumbnailSha256 = reader.bytes(); - break; - case 21: - message.thumbnailEncSha256 = reader.bytes(); - break; - case 22: - message.mediaKey = reader.bytes(); - break; - case 23: - message.mediaKeyTimestamp = reader.int64(); - break; - case 24: - message.thumbnailHeight = reader.uint32(); + message.name = reader.string(); break; - case 25: - message.thumbnailWidth = reader.uint32(); + case 3: + if (!(message.options && message.options.length)) + message.options = []; + message.options.push($root.proto.Option.decode(reader, reader.uint32())); break; - case 26: - message.inviteLinkGroupType = reader.int32(); + case 4: + message.selectableOptionsCount = reader.uint32(); break; default: reader.skipType(tag & 7); @@ -25543,442 +26056,161 @@ $root.proto = (function() { }; /** - * Decodes an ExtendedTextMessage message from the specified reader or buffer, length delimited. + * Decodes a PollCreationMessage message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof proto.ExtendedTextMessage + * @memberof proto.PollCreationMessage * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.ExtendedTextMessage} ExtendedTextMessage + * @returns {proto.PollCreationMessage} PollCreationMessage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ExtendedTextMessage.decodeDelimited = function decodeDelimited(reader) { + PollCreationMessage.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an ExtendedTextMessage message. + * Verifies a PollCreationMessage message. * @function verify - * @memberof proto.ExtendedTextMessage + * @memberof proto.PollCreationMessage * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ExtendedTextMessage.verify = function verify(message) { + PollCreationMessage.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.text != null && message.hasOwnProperty("text")) - if (!$util.isString(message.text)) - return "text: string expected"; - if (message.matchedText != null && message.hasOwnProperty("matchedText")) - if (!$util.isString(message.matchedText)) - return "matchedText: string expected"; - if (message.canonicalUrl != null && message.hasOwnProperty("canonicalUrl")) - if (!$util.isString(message.canonicalUrl)) - return "canonicalUrl: string expected"; - if (message.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: string expected"; - if (message.title != null && message.hasOwnProperty("title")) - if (!$util.isString(message.title)) - return "title: string expected"; - if (message.textArgb != null && message.hasOwnProperty("textArgb")) - if (!$util.isInteger(message.textArgb)) - return "textArgb: integer expected"; - if (message.backgroundArgb != null && message.hasOwnProperty("backgroundArgb")) - if (!$util.isInteger(message.backgroundArgb)) - return "backgroundArgb: integer expected"; - if (message.font != null && message.hasOwnProperty("font")) - switch (message.font) { - default: - return "font: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - break; + if (message.encKey != null && message.hasOwnProperty("encKey")) + if (!(message.encKey && typeof message.encKey.length === "number" || $util.isString(message.encKey))) + return "encKey: buffer expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + if (!Array.isArray(message.options)) + return "options: array expected"; + for (var i = 0; i < message.options.length; ++i) { + var error = $root.proto.Option.verify(message.options[i]); + if (error) + return "options." + error; } - if (message.previewType != null && message.hasOwnProperty("previewType")) - switch (message.previewType) { - default: - return "previewType: enum value expected"; - case 0: - case 1: - break; + } + if (message.selectableOptionsCount != null && message.hasOwnProperty("selectableOptionsCount")) + if (!$util.isInteger(message.selectableOptionsCount)) + return "selectableOptionsCount: integer expected"; + return null; + }; + + /** + * Creates a PollCreationMessage message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof proto.PollCreationMessage + * @static + * @param {Object.} object Plain object + * @returns {proto.PollCreationMessage} PollCreationMessage + */ + PollCreationMessage.fromObject = function fromObject(object) { + if (object instanceof $root.proto.PollCreationMessage) + return object; + var message = new $root.proto.PollCreationMessage(); + if (object.encKey != null) + if (typeof object.encKey === "string") + $util.base64.decode(object.encKey, message.encKey = $util.newBuffer($util.base64.length(object.encKey)), 0); + else if (object.encKey.length) + message.encKey = object.encKey; + if (object.name != null) + message.name = String(object.name); + if (object.options) { + if (!Array.isArray(object.options)) + throw TypeError(".proto.PollCreationMessage.options: array expected"); + message.options = []; + for (var i = 0; i < object.options.length; ++i) { + if (typeof object.options[i] !== "object") + throw TypeError(".proto.PollCreationMessage.options: object expected"); + message.options[i] = $root.proto.Option.fromObject(object.options[i]); } - if (message.jpegThumbnail != null && message.hasOwnProperty("jpegThumbnail")) - if (!(message.jpegThumbnail && typeof message.jpegThumbnail.length === "number" || $util.isString(message.jpegThumbnail))) - return "jpegThumbnail: buffer expected"; - if (message.contextInfo != null && message.hasOwnProperty("contextInfo")) { - var error = $root.proto.ContextInfo.verify(message.contextInfo); - if (error) - return "contextInfo." + error; - } - if (message.doNotPlayInline != null && message.hasOwnProperty("doNotPlayInline")) - if (typeof message.doNotPlayInline !== "boolean") - return "doNotPlayInline: boolean expected"; - if (message.thumbnailDirectPath != null && message.hasOwnProperty("thumbnailDirectPath")) - if (!$util.isString(message.thumbnailDirectPath)) - return "thumbnailDirectPath: string expected"; - if (message.thumbnailSha256 != null && message.hasOwnProperty("thumbnailSha256")) - if (!(message.thumbnailSha256 && typeof message.thumbnailSha256.length === "number" || $util.isString(message.thumbnailSha256))) - return "thumbnailSha256: buffer expected"; - if (message.thumbnailEncSha256 != null && message.hasOwnProperty("thumbnailEncSha256")) - if (!(message.thumbnailEncSha256 && typeof message.thumbnailEncSha256.length === "number" || $util.isString(message.thumbnailEncSha256))) - return "thumbnailEncSha256: buffer expected"; - if (message.mediaKey != null && message.hasOwnProperty("mediaKey")) - if (!(message.mediaKey && typeof message.mediaKey.length === "number" || $util.isString(message.mediaKey))) - return "mediaKey: buffer expected"; - if (message.mediaKeyTimestamp != null && message.hasOwnProperty("mediaKeyTimestamp")) - if (!$util.isInteger(message.mediaKeyTimestamp) && !(message.mediaKeyTimestamp && $util.isInteger(message.mediaKeyTimestamp.low) && $util.isInteger(message.mediaKeyTimestamp.high))) - return "mediaKeyTimestamp: integer|Long expected"; - if (message.thumbnailHeight != null && message.hasOwnProperty("thumbnailHeight")) - if (!$util.isInteger(message.thumbnailHeight)) - return "thumbnailHeight: integer expected"; - if (message.thumbnailWidth != null && message.hasOwnProperty("thumbnailWidth")) - if (!$util.isInteger(message.thumbnailWidth)) - return "thumbnailWidth: integer expected"; - if (message.inviteLinkGroupType != null && message.hasOwnProperty("inviteLinkGroupType")) - switch (message.inviteLinkGroupType) { - default: - return "inviteLinkGroupType: enum value expected"; - case 0: - case 1: - break; - } - return null; - }; - - /** - * Creates an ExtendedTextMessage message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof proto.ExtendedTextMessage - * @static - * @param {Object.} object Plain object - * @returns {proto.ExtendedTextMessage} ExtendedTextMessage - */ - ExtendedTextMessage.fromObject = function fromObject(object) { - if (object instanceof $root.proto.ExtendedTextMessage) - return object; - var message = new $root.proto.ExtendedTextMessage(); - if (object.text != null) - message.text = String(object.text); - if (object.matchedText != null) - message.matchedText = String(object.matchedText); - if (object.canonicalUrl != null) - message.canonicalUrl = String(object.canonicalUrl); - if (object.description != null) - message.description = String(object.description); - if (object.title != null) - message.title = String(object.title); - if (object.textArgb != null) - message.textArgb = object.textArgb >>> 0; - if (object.backgroundArgb != null) - message.backgroundArgb = object.backgroundArgb >>> 0; - switch (object.font) { - case "SANS_SERIF": - case 0: - message.font = 0; - break; - case "SERIF": - case 1: - message.font = 1; - break; - case "NORICAN_REGULAR": - case 2: - message.font = 2; - break; - case "BRYNDAN_WRITE": - case 3: - message.font = 3; - break; - case "BEBASNEUE_REGULAR": - case 4: - message.font = 4; - break; - case "OSWALD_HEAVY": - case 5: - message.font = 5; - break; - } - switch (object.previewType) { - case "NONE": - case 0: - message.previewType = 0; - break; - case "VIDEO": - case 1: - message.previewType = 1; - break; - } - if (object.jpegThumbnail != null) - if (typeof object.jpegThumbnail === "string") - $util.base64.decode(object.jpegThumbnail, message.jpegThumbnail = $util.newBuffer($util.base64.length(object.jpegThumbnail)), 0); - else if (object.jpegThumbnail.length) - message.jpegThumbnail = object.jpegThumbnail; - if (object.contextInfo != null) { - if (typeof object.contextInfo !== "object") - throw TypeError(".proto.ExtendedTextMessage.contextInfo: object expected"); - message.contextInfo = $root.proto.ContextInfo.fromObject(object.contextInfo); - } - if (object.doNotPlayInline != null) - message.doNotPlayInline = Boolean(object.doNotPlayInline); - if (object.thumbnailDirectPath != null) - message.thumbnailDirectPath = String(object.thumbnailDirectPath); - if (object.thumbnailSha256 != null) - if (typeof object.thumbnailSha256 === "string") - $util.base64.decode(object.thumbnailSha256, message.thumbnailSha256 = $util.newBuffer($util.base64.length(object.thumbnailSha256)), 0); - else if (object.thumbnailSha256.length) - message.thumbnailSha256 = object.thumbnailSha256; - if (object.thumbnailEncSha256 != null) - if (typeof object.thumbnailEncSha256 === "string") - $util.base64.decode(object.thumbnailEncSha256, message.thumbnailEncSha256 = $util.newBuffer($util.base64.length(object.thumbnailEncSha256)), 0); - else if (object.thumbnailEncSha256.length) - message.thumbnailEncSha256 = object.thumbnailEncSha256; - if (object.mediaKey != null) - if (typeof object.mediaKey === "string") - $util.base64.decode(object.mediaKey, message.mediaKey = $util.newBuffer($util.base64.length(object.mediaKey)), 0); - else if (object.mediaKey.length) - message.mediaKey = object.mediaKey; - if (object.mediaKeyTimestamp != null) - if ($util.Long) - (message.mediaKeyTimestamp = $util.Long.fromValue(object.mediaKeyTimestamp)).unsigned = false; - else if (typeof object.mediaKeyTimestamp === "string") - message.mediaKeyTimestamp = parseInt(object.mediaKeyTimestamp, 10); - else if (typeof object.mediaKeyTimestamp === "number") - message.mediaKeyTimestamp = object.mediaKeyTimestamp; - else if (typeof object.mediaKeyTimestamp === "object") - message.mediaKeyTimestamp = new $util.LongBits(object.mediaKeyTimestamp.low >>> 0, object.mediaKeyTimestamp.high >>> 0).toNumber(); - if (object.thumbnailHeight != null) - message.thumbnailHeight = object.thumbnailHeight >>> 0; - if (object.thumbnailWidth != null) - message.thumbnailWidth = object.thumbnailWidth >>> 0; - switch (object.inviteLinkGroupType) { - case "DEFAULT": - case 0: - message.inviteLinkGroupType = 0; - break; - case "PARENT": - case 1: - message.inviteLinkGroupType = 1; - break; } + if (object.selectableOptionsCount != null) + message.selectableOptionsCount = object.selectableOptionsCount >>> 0; return message; }; /** - * Creates a plain object from an ExtendedTextMessage message. Also converts values to other types if specified. + * Creates a plain object from a PollCreationMessage message. Also converts values to other types if specified. * @function toObject - * @memberof proto.ExtendedTextMessage + * @memberof proto.PollCreationMessage * @static - * @param {proto.ExtendedTextMessage} message ExtendedTextMessage + * @param {proto.PollCreationMessage} message PollCreationMessage * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ExtendedTextMessage.toObject = function toObject(message, options) { + PollCreationMessage.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.options = []; if (options.defaults) { - object.text = ""; - object.matchedText = ""; - object.canonicalUrl = ""; - object.description = ""; - object.title = ""; - object.textArgb = 0; - object.backgroundArgb = 0; - object.font = options.enums === String ? "SANS_SERIF" : 0; - object.previewType = options.enums === String ? "NONE" : 0; - if (options.bytes === String) - object.jpegThumbnail = ""; - else { - object.jpegThumbnail = []; - if (options.bytes !== Array) - object.jpegThumbnail = $util.newBuffer(object.jpegThumbnail); - } - object.contextInfo = null; - object.doNotPlayInline = false; - object.thumbnailDirectPath = ""; - if (options.bytes === String) - object.thumbnailSha256 = ""; - else { - object.thumbnailSha256 = []; - if (options.bytes !== Array) - object.thumbnailSha256 = $util.newBuffer(object.thumbnailSha256); - } - if (options.bytes === String) - object.thumbnailEncSha256 = ""; - else { - object.thumbnailEncSha256 = []; - if (options.bytes !== Array) - object.thumbnailEncSha256 = $util.newBuffer(object.thumbnailEncSha256); - } if (options.bytes === String) - object.mediaKey = ""; + object.encKey = ""; else { - object.mediaKey = []; + object.encKey = []; if (options.bytes !== Array) - object.mediaKey = $util.newBuffer(object.mediaKey); + object.encKey = $util.newBuffer(object.encKey); } - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.mediaKeyTimestamp = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.mediaKeyTimestamp = options.longs === String ? "0" : 0; - object.thumbnailHeight = 0; - object.thumbnailWidth = 0; - object.inviteLinkGroupType = options.enums === String ? "DEFAULT" : 0; + object.name = ""; + object.selectableOptionsCount = 0; } - if (message.text != null && message.hasOwnProperty("text")) - object.text = message.text; - if (message.matchedText != null && message.hasOwnProperty("matchedText")) - object.matchedText = message.matchedText; - if (message.canonicalUrl != null && message.hasOwnProperty("canonicalUrl")) - object.canonicalUrl = message.canonicalUrl; - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; - if (message.title != null && message.hasOwnProperty("title")) - object.title = message.title; - if (message.textArgb != null && message.hasOwnProperty("textArgb")) - object.textArgb = message.textArgb; - if (message.backgroundArgb != null && message.hasOwnProperty("backgroundArgb")) - object.backgroundArgb = message.backgroundArgb; - if (message.font != null && message.hasOwnProperty("font")) - object.font = options.enums === String ? $root.proto.ExtendedTextMessage.ExtendedTextMessageFontType[message.font] : message.font; - if (message.previewType != null && message.hasOwnProperty("previewType")) - object.previewType = options.enums === String ? $root.proto.ExtendedTextMessage.ExtendedTextMessagePreviewType[message.previewType] : message.previewType; - if (message.jpegThumbnail != null && message.hasOwnProperty("jpegThumbnail")) - object.jpegThumbnail = options.bytes === String ? $util.base64.encode(message.jpegThumbnail, 0, message.jpegThumbnail.length) : options.bytes === Array ? Array.prototype.slice.call(message.jpegThumbnail) : message.jpegThumbnail; - if (message.contextInfo != null && message.hasOwnProperty("contextInfo")) - object.contextInfo = $root.proto.ContextInfo.toObject(message.contextInfo, options); - if (message.doNotPlayInline != null && message.hasOwnProperty("doNotPlayInline")) - object.doNotPlayInline = message.doNotPlayInline; - if (message.thumbnailDirectPath != null && message.hasOwnProperty("thumbnailDirectPath")) - object.thumbnailDirectPath = message.thumbnailDirectPath; - if (message.thumbnailSha256 != null && message.hasOwnProperty("thumbnailSha256")) - object.thumbnailSha256 = options.bytes === String ? $util.base64.encode(message.thumbnailSha256, 0, message.thumbnailSha256.length) : options.bytes === Array ? Array.prototype.slice.call(message.thumbnailSha256) : message.thumbnailSha256; - if (message.thumbnailEncSha256 != null && message.hasOwnProperty("thumbnailEncSha256")) - object.thumbnailEncSha256 = options.bytes === String ? $util.base64.encode(message.thumbnailEncSha256, 0, message.thumbnailEncSha256.length) : options.bytes === Array ? Array.prototype.slice.call(message.thumbnailEncSha256) : message.thumbnailEncSha256; - if (message.mediaKey != null && message.hasOwnProperty("mediaKey")) - object.mediaKey = options.bytes === String ? $util.base64.encode(message.mediaKey, 0, message.mediaKey.length) : options.bytes === Array ? Array.prototype.slice.call(message.mediaKey) : message.mediaKey; - if (message.mediaKeyTimestamp != null && message.hasOwnProperty("mediaKeyTimestamp")) - if (typeof message.mediaKeyTimestamp === "number") - object.mediaKeyTimestamp = options.longs === String ? String(message.mediaKeyTimestamp) : message.mediaKeyTimestamp; - else - object.mediaKeyTimestamp = options.longs === String ? $util.Long.prototype.toString.call(message.mediaKeyTimestamp) : options.longs === Number ? new $util.LongBits(message.mediaKeyTimestamp.low >>> 0, message.mediaKeyTimestamp.high >>> 0).toNumber() : message.mediaKeyTimestamp; - if (message.thumbnailHeight != null && message.hasOwnProperty("thumbnailHeight")) - object.thumbnailHeight = message.thumbnailHeight; - if (message.thumbnailWidth != null && message.hasOwnProperty("thumbnailWidth")) - object.thumbnailWidth = message.thumbnailWidth; - if (message.inviteLinkGroupType != null && message.hasOwnProperty("inviteLinkGroupType")) - object.inviteLinkGroupType = options.enums === String ? $root.proto.ExtendedTextMessage.ExtendedTextMessageInviteLinkGroupType[message.inviteLinkGroupType] : message.inviteLinkGroupType; + if (message.encKey != null && message.hasOwnProperty("encKey")) + object.encKey = options.bytes === String ? $util.base64.encode(message.encKey, 0, message.encKey.length) : options.bytes === Array ? Array.prototype.slice.call(message.encKey) : message.encKey; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.options && message.options.length) { + object.options = []; + for (var j = 0; j < message.options.length; ++j) + object.options[j] = $root.proto.Option.toObject(message.options[j], options); + } + if (message.selectableOptionsCount != null && message.hasOwnProperty("selectableOptionsCount")) + object.selectableOptionsCount = message.selectableOptionsCount; return object; }; /** - * Converts this ExtendedTextMessage to JSON. + * Converts this PollCreationMessage to JSON. * @function toJSON - * @memberof proto.ExtendedTextMessage + * @memberof proto.PollCreationMessage * @instance * @returns {Object.} JSON object */ - ExtendedTextMessage.prototype.toJSON = function toJSON() { + PollCreationMessage.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - /** - * ExtendedTextMessageFontType enum. - * @name proto.ExtendedTextMessage.ExtendedTextMessageFontType - * @enum {number} - * @property {number} SANS_SERIF=0 SANS_SERIF value - * @property {number} SERIF=1 SERIF value - * @property {number} NORICAN_REGULAR=2 NORICAN_REGULAR value - * @property {number} BRYNDAN_WRITE=3 BRYNDAN_WRITE value - * @property {number} BEBASNEUE_REGULAR=4 BEBASNEUE_REGULAR value - * @property {number} OSWALD_HEAVY=5 OSWALD_HEAVY value - */ - ExtendedTextMessage.ExtendedTextMessageFontType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "SANS_SERIF"] = 0; - values[valuesById[1] = "SERIF"] = 1; - values[valuesById[2] = "NORICAN_REGULAR"] = 2; - values[valuesById[3] = "BRYNDAN_WRITE"] = 3; - values[valuesById[4] = "BEBASNEUE_REGULAR"] = 4; - values[valuesById[5] = "OSWALD_HEAVY"] = 5; - return values; - })(); - - /** - * ExtendedTextMessagePreviewType enum. - * @name proto.ExtendedTextMessage.ExtendedTextMessagePreviewType - * @enum {number} - * @property {number} NONE=0 NONE value - * @property {number} VIDEO=1 VIDEO value - */ - ExtendedTextMessage.ExtendedTextMessagePreviewType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "NONE"] = 0; - values[valuesById[1] = "VIDEO"] = 1; - return values; - })(); - - /** - * ExtendedTextMessageInviteLinkGroupType enum. - * @name proto.ExtendedTextMessage.ExtendedTextMessageInviteLinkGroupType - * @enum {number} - * @property {number} DEFAULT=0 DEFAULT value - * @property {number} PARENT=1 PARENT value - */ - ExtendedTextMessage.ExtendedTextMessageInviteLinkGroupType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "DEFAULT"] = 0; - values[valuesById[1] = "PARENT"] = 1; - return values; - })(); - - return ExtendedTextMessage; + return PollCreationMessage; })(); - proto.DocumentMessage = (function() { + proto.PollUpdateMessage = (function() { /** - * Properties of a DocumentMessage. + * Properties of a PollUpdateMessage. * @memberof proto - * @interface IDocumentMessage - * @property {string|null} [url] DocumentMessage url - * @property {string|null} [mimetype] DocumentMessage mimetype - * @property {string|null} [title] DocumentMessage title - * @property {Uint8Array|null} [fileSha256] DocumentMessage fileSha256 - * @property {number|Long|null} [fileLength] DocumentMessage fileLength - * @property {number|null} [pageCount] DocumentMessage pageCount - * @property {Uint8Array|null} [mediaKey] DocumentMessage mediaKey - * @property {string|null} [fileName] DocumentMessage fileName - * @property {Uint8Array|null} [fileEncSha256] DocumentMessage fileEncSha256 - * @property {string|null} [directPath] DocumentMessage directPath - * @property {number|Long|null} [mediaKeyTimestamp] DocumentMessage mediaKeyTimestamp - * @property {boolean|null} [contactVcard] DocumentMessage contactVcard - * @property {string|null} [thumbnailDirectPath] DocumentMessage thumbnailDirectPath - * @property {Uint8Array|null} [thumbnailSha256] DocumentMessage thumbnailSha256 - * @property {Uint8Array|null} [thumbnailEncSha256] DocumentMessage thumbnailEncSha256 - * @property {Uint8Array|null} [jpegThumbnail] DocumentMessage jpegThumbnail - * @property {proto.IContextInfo|null} [contextInfo] DocumentMessage contextInfo - * @property {number|null} [thumbnailHeight] DocumentMessage thumbnailHeight - * @property {number|null} [thumbnailWidth] DocumentMessage thumbnailWidth + * @interface IPollUpdateMessage + * @property {proto.IMessageKey|null} [pollCreationMessageKey] PollUpdateMessage pollCreationMessageKey + * @property {Uint8Array|null} [encPayload] PollUpdateMessage encPayload + * @property {Uint8Array|null} [encIv] PollUpdateMessage encIv */ /** - * Constructs a new DocumentMessage. + * Constructs a new PollUpdateMessage. * @memberof proto - * @classdesc Represents a DocumentMessage. - * @implements IDocumentMessage + * @classdesc Represents a PollUpdateMessage. + * @implements IPollUpdateMessage * @constructor - * @param {proto.IDocumentMessage=} [properties] Properties to set + * @param {proto.IPollUpdateMessage=} [properties] Properties to set */ - function DocumentMessage(properties) { + function PollUpdateMessage(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -25986,309 +26218,342 @@ $root.proto = (function() { } /** - * DocumentMessage url. - * @member {string} url - * @memberof proto.DocumentMessage + * PollUpdateMessage pollCreationMessageKey. + * @member {proto.IMessageKey|null|undefined} pollCreationMessageKey + * @memberof proto.PollUpdateMessage * @instance */ - DocumentMessage.prototype.url = ""; + PollUpdateMessage.prototype.pollCreationMessageKey = null; /** - * DocumentMessage mimetype. - * @member {string} mimetype - * @memberof proto.DocumentMessage + * PollUpdateMessage encPayload. + * @member {Uint8Array} encPayload + * @memberof proto.PollUpdateMessage * @instance */ - DocumentMessage.prototype.mimetype = ""; + PollUpdateMessage.prototype.encPayload = $util.newBuffer([]); /** - * DocumentMessage title. - * @member {string} title - * @memberof proto.DocumentMessage + * PollUpdateMessage encIv. + * @member {Uint8Array} encIv + * @memberof proto.PollUpdateMessage * @instance */ - DocumentMessage.prototype.title = ""; + PollUpdateMessage.prototype.encIv = $util.newBuffer([]); /** - * DocumentMessage fileSha256. - * @member {Uint8Array} fileSha256 - * @memberof proto.DocumentMessage - * @instance + * Creates a new PollUpdateMessage instance using the specified properties. + * @function create + * @memberof proto.PollUpdateMessage + * @static + * @param {proto.IPollUpdateMessage=} [properties] Properties to set + * @returns {proto.PollUpdateMessage} PollUpdateMessage instance */ - DocumentMessage.prototype.fileSha256 = $util.newBuffer([]); + PollUpdateMessage.create = function create(properties) { + return new PollUpdateMessage(properties); + }; /** - * DocumentMessage fileLength. - * @member {number|Long} fileLength - * @memberof proto.DocumentMessage - * @instance + * Encodes the specified PollUpdateMessage message. Does not implicitly {@link proto.PollUpdateMessage.verify|verify} messages. + * @function encode + * @memberof proto.PollUpdateMessage + * @static + * @param {proto.IPollUpdateMessage} message PollUpdateMessage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - DocumentMessage.prototype.fileLength = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + PollUpdateMessage.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pollCreationMessageKey != null && Object.hasOwnProperty.call(message, "pollCreationMessageKey")) + $root.proto.MessageKey.encode(message.pollCreationMessageKey, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.encPayload != null && Object.hasOwnProperty.call(message, "encPayload")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.encPayload); + if (message.encIv != null && Object.hasOwnProperty.call(message, "encIv")) + writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.encIv); + return writer; + }; /** - * DocumentMessage pageCount. - * @member {number} pageCount - * @memberof proto.DocumentMessage - * @instance + * Encodes the specified PollUpdateMessage message, length delimited. Does not implicitly {@link proto.PollUpdateMessage.verify|verify} messages. + * @function encodeDelimited + * @memberof proto.PollUpdateMessage + * @static + * @param {proto.IPollUpdateMessage} message PollUpdateMessage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - DocumentMessage.prototype.pageCount = 0; + PollUpdateMessage.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; /** - * DocumentMessage mediaKey. - * @member {Uint8Array} mediaKey - * @memberof proto.DocumentMessage - * @instance + * Decodes a PollUpdateMessage message from the specified reader or buffer. + * @function decode + * @memberof proto.PollUpdateMessage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {proto.PollUpdateMessage} PollUpdateMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DocumentMessage.prototype.mediaKey = $util.newBuffer([]); + PollUpdateMessage.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.PollUpdateMessage(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.pollCreationMessageKey = $root.proto.MessageKey.decode(reader, reader.uint32()); + break; + case 2: + message.encPayload = reader.bytes(); + break; + case 3: + message.encIv = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; /** - * DocumentMessage fileName. - * @member {string} fileName - * @memberof proto.DocumentMessage - * @instance + * Decodes a PollUpdateMessage message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof proto.PollUpdateMessage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {proto.PollUpdateMessage} PollUpdateMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DocumentMessage.prototype.fileName = ""; + PollUpdateMessage.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; /** - * DocumentMessage fileEncSha256. - * @member {Uint8Array} fileEncSha256 - * @memberof proto.DocumentMessage - * @instance + * Verifies a PollUpdateMessage message. + * @function verify + * @memberof proto.PollUpdateMessage + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - DocumentMessage.prototype.fileEncSha256 = $util.newBuffer([]); + PollUpdateMessage.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.pollCreationMessageKey != null && message.hasOwnProperty("pollCreationMessageKey")) { + var error = $root.proto.MessageKey.verify(message.pollCreationMessageKey); + if (error) + return "pollCreationMessageKey." + error; + } + if (message.encPayload != null && message.hasOwnProperty("encPayload")) + if (!(message.encPayload && typeof message.encPayload.length === "number" || $util.isString(message.encPayload))) + return "encPayload: buffer expected"; + if (message.encIv != null && message.hasOwnProperty("encIv")) + if (!(message.encIv && typeof message.encIv.length === "number" || $util.isString(message.encIv))) + return "encIv: buffer expected"; + return null; + }; /** - * DocumentMessage directPath. - * @member {string} directPath - * @memberof proto.DocumentMessage - * @instance + * Creates a PollUpdateMessage message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof proto.PollUpdateMessage + * @static + * @param {Object.} object Plain object + * @returns {proto.PollUpdateMessage} PollUpdateMessage */ - DocumentMessage.prototype.directPath = ""; + PollUpdateMessage.fromObject = function fromObject(object) { + if (object instanceof $root.proto.PollUpdateMessage) + return object; + var message = new $root.proto.PollUpdateMessage(); + if (object.pollCreationMessageKey != null) { + if (typeof object.pollCreationMessageKey !== "object") + throw TypeError(".proto.PollUpdateMessage.pollCreationMessageKey: object expected"); + message.pollCreationMessageKey = $root.proto.MessageKey.fromObject(object.pollCreationMessageKey); + } + if (object.encPayload != null) + if (typeof object.encPayload === "string") + $util.base64.decode(object.encPayload, message.encPayload = $util.newBuffer($util.base64.length(object.encPayload)), 0); + else if (object.encPayload.length) + message.encPayload = object.encPayload; + if (object.encIv != null) + if (typeof object.encIv === "string") + $util.base64.decode(object.encIv, message.encIv = $util.newBuffer($util.base64.length(object.encIv)), 0); + else if (object.encIv.length) + message.encIv = object.encIv; + return message; + }; /** - * DocumentMessage mediaKeyTimestamp. - * @member {number|Long} mediaKeyTimestamp - * @memberof proto.DocumentMessage - * @instance + * Creates a plain object from a PollUpdateMessage message. Also converts values to other types if specified. + * @function toObject + * @memberof proto.PollUpdateMessage + * @static + * @param {proto.PollUpdateMessage} message PollUpdateMessage + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object */ - DocumentMessage.prototype.mediaKeyTimestamp = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + PollUpdateMessage.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.pollCreationMessageKey = null; + if (options.bytes === String) + object.encPayload = ""; + else { + object.encPayload = []; + if (options.bytes !== Array) + object.encPayload = $util.newBuffer(object.encPayload); + } + if (options.bytes === String) + object.encIv = ""; + else { + object.encIv = []; + if (options.bytes !== Array) + object.encIv = $util.newBuffer(object.encIv); + } + } + if (message.pollCreationMessageKey != null && message.hasOwnProperty("pollCreationMessageKey")) + object.pollCreationMessageKey = $root.proto.MessageKey.toObject(message.pollCreationMessageKey, options); + if (message.encPayload != null && message.hasOwnProperty("encPayload")) + object.encPayload = options.bytes === String ? $util.base64.encode(message.encPayload, 0, message.encPayload.length) : options.bytes === Array ? Array.prototype.slice.call(message.encPayload) : message.encPayload; + if (message.encIv != null && message.hasOwnProperty("encIv")) + object.encIv = options.bytes === String ? $util.base64.encode(message.encIv, 0, message.encIv.length) : options.bytes === Array ? Array.prototype.slice.call(message.encIv) : message.encIv; + return object; + }; /** - * DocumentMessage contactVcard. - * @member {boolean} contactVcard - * @memberof proto.DocumentMessage + * Converts this PollUpdateMessage to JSON. + * @function toJSON + * @memberof proto.PollUpdateMessage * @instance + * @returns {Object.} JSON object */ - DocumentMessage.prototype.contactVcard = false; + PollUpdateMessage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return PollUpdateMessage; + })(); + + proto.PollUpdateMessageContent = (function() { /** - * DocumentMessage thumbnailDirectPath. - * @member {string} thumbnailDirectPath - * @memberof proto.DocumentMessage - * @instance + * Properties of a PollUpdateMessageContent. + * @memberof proto + * @interface IPollUpdateMessageContent + * @property {proto.IPollVoteMessage|null} [voteMessage] PollUpdateMessageContent voteMessage */ - DocumentMessage.prototype.thumbnailDirectPath = ""; /** - * DocumentMessage thumbnailSha256. - * @member {Uint8Array} thumbnailSha256 - * @memberof proto.DocumentMessage - * @instance + * Constructs a new PollUpdateMessageContent. + * @memberof proto + * @classdesc Represents a PollUpdateMessageContent. + * @implements IPollUpdateMessageContent + * @constructor + * @param {proto.IPollUpdateMessageContent=} [properties] Properties to set */ - DocumentMessage.prototype.thumbnailSha256 = $util.newBuffer([]); + function PollUpdateMessageContent(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } /** - * DocumentMessage thumbnailEncSha256. - * @member {Uint8Array} thumbnailEncSha256 - * @memberof proto.DocumentMessage + * PollUpdateMessageContent voteMessage. + * @member {proto.IPollVoteMessage|null|undefined} voteMessage + * @memberof proto.PollUpdateMessageContent * @instance */ - DocumentMessage.prototype.thumbnailEncSha256 = $util.newBuffer([]); + PollUpdateMessageContent.prototype.voteMessage = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; /** - * DocumentMessage jpegThumbnail. - * @member {Uint8Array} jpegThumbnail - * @memberof proto.DocumentMessage + * PollUpdateMessageContent update. + * @member {"voteMessage"|undefined} update + * @memberof proto.PollUpdateMessageContent * @instance */ - DocumentMessage.prototype.jpegThumbnail = $util.newBuffer([]); + Object.defineProperty(PollUpdateMessageContent.prototype, "update", { + get: $util.oneOfGetter($oneOfFields = ["voteMessage"]), + set: $util.oneOfSetter($oneOfFields) + }); /** - * DocumentMessage contextInfo. - * @member {proto.IContextInfo|null|undefined} contextInfo - * @memberof proto.DocumentMessage - * @instance + * Creates a new PollUpdateMessageContent instance using the specified properties. + * @function create + * @memberof proto.PollUpdateMessageContent + * @static + * @param {proto.IPollUpdateMessageContent=} [properties] Properties to set + * @returns {proto.PollUpdateMessageContent} PollUpdateMessageContent instance */ - DocumentMessage.prototype.contextInfo = null; + PollUpdateMessageContent.create = function create(properties) { + return new PollUpdateMessageContent(properties); + }; /** - * DocumentMessage thumbnailHeight. - * @member {number} thumbnailHeight - * @memberof proto.DocumentMessage - * @instance - */ - DocumentMessage.prototype.thumbnailHeight = 0; - - /** - * DocumentMessage thumbnailWidth. - * @member {number} thumbnailWidth - * @memberof proto.DocumentMessage - * @instance - */ - DocumentMessage.prototype.thumbnailWidth = 0; - - /** - * Creates a new DocumentMessage instance using the specified properties. - * @function create - * @memberof proto.DocumentMessage - * @static - * @param {proto.IDocumentMessage=} [properties] Properties to set - * @returns {proto.DocumentMessage} DocumentMessage instance - */ - DocumentMessage.create = function create(properties) { - return new DocumentMessage(properties); - }; - - /** - * Encodes the specified DocumentMessage message. Does not implicitly {@link proto.DocumentMessage.verify|verify} messages. + * Encodes the specified PollUpdateMessageContent message. Does not implicitly {@link proto.PollUpdateMessageContent.verify|verify} messages. * @function encode - * @memberof proto.DocumentMessage + * @memberof proto.PollUpdateMessageContent * @static - * @param {proto.IDocumentMessage} message DocumentMessage message or plain object to encode + * @param {proto.IPollUpdateMessageContent} message PollUpdateMessageContent message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DocumentMessage.encode = function encode(message, writer) { + PollUpdateMessageContent.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.url != null && Object.hasOwnProperty.call(message, "url")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.url); - if (message.mimetype != null && Object.hasOwnProperty.call(message, "mimetype")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.mimetype); - if (message.title != null && Object.hasOwnProperty.call(message, "title")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.title); - if (message.fileSha256 != null && Object.hasOwnProperty.call(message, "fileSha256")) - writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.fileSha256); - if (message.fileLength != null && Object.hasOwnProperty.call(message, "fileLength")) - writer.uint32(/* id 5, wireType 0 =*/40).uint64(message.fileLength); - if (message.pageCount != null && Object.hasOwnProperty.call(message, "pageCount")) - writer.uint32(/* id 6, wireType 0 =*/48).uint32(message.pageCount); - if (message.mediaKey != null && Object.hasOwnProperty.call(message, "mediaKey")) - writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.mediaKey); - if (message.fileName != null && Object.hasOwnProperty.call(message, "fileName")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.fileName); - if (message.fileEncSha256 != null && Object.hasOwnProperty.call(message, "fileEncSha256")) - writer.uint32(/* id 9, wireType 2 =*/74).bytes(message.fileEncSha256); - if (message.directPath != null && Object.hasOwnProperty.call(message, "directPath")) - writer.uint32(/* id 10, wireType 2 =*/82).string(message.directPath); - if (message.mediaKeyTimestamp != null && Object.hasOwnProperty.call(message, "mediaKeyTimestamp")) - writer.uint32(/* id 11, wireType 0 =*/88).int64(message.mediaKeyTimestamp); - if (message.contactVcard != null && Object.hasOwnProperty.call(message, "contactVcard")) - writer.uint32(/* id 12, wireType 0 =*/96).bool(message.contactVcard); - if (message.thumbnailDirectPath != null && Object.hasOwnProperty.call(message, "thumbnailDirectPath")) - writer.uint32(/* id 13, wireType 2 =*/106).string(message.thumbnailDirectPath); - if (message.thumbnailSha256 != null && Object.hasOwnProperty.call(message, "thumbnailSha256")) - writer.uint32(/* id 14, wireType 2 =*/114).bytes(message.thumbnailSha256); - if (message.thumbnailEncSha256 != null && Object.hasOwnProperty.call(message, "thumbnailEncSha256")) - writer.uint32(/* id 15, wireType 2 =*/122).bytes(message.thumbnailEncSha256); - if (message.jpegThumbnail != null && Object.hasOwnProperty.call(message, "jpegThumbnail")) - writer.uint32(/* id 16, wireType 2 =*/130).bytes(message.jpegThumbnail); - if (message.contextInfo != null && Object.hasOwnProperty.call(message, "contextInfo")) - $root.proto.ContextInfo.encode(message.contextInfo, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); - if (message.thumbnailHeight != null && Object.hasOwnProperty.call(message, "thumbnailHeight")) - writer.uint32(/* id 18, wireType 0 =*/144).uint32(message.thumbnailHeight); - if (message.thumbnailWidth != null && Object.hasOwnProperty.call(message, "thumbnailWidth")) - writer.uint32(/* id 19, wireType 0 =*/152).uint32(message.thumbnailWidth); + if (message.voteMessage != null && Object.hasOwnProperty.call(message, "voteMessage")) + $root.proto.PollVoteMessage.encode(message.voteMessage, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; /** - * Encodes the specified DocumentMessage message, length delimited. Does not implicitly {@link proto.DocumentMessage.verify|verify} messages. + * Encodes the specified PollUpdateMessageContent message, length delimited. Does not implicitly {@link proto.PollUpdateMessageContent.verify|verify} messages. * @function encodeDelimited - * @memberof proto.DocumentMessage + * @memberof proto.PollUpdateMessageContent * @static - * @param {proto.IDocumentMessage} message DocumentMessage message or plain object to encode + * @param {proto.IPollUpdateMessageContent} message PollUpdateMessageContent message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DocumentMessage.encodeDelimited = function encodeDelimited(message, writer) { + PollUpdateMessageContent.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a DocumentMessage message from the specified reader or buffer. + * Decodes a PollUpdateMessageContent message from the specified reader or buffer. * @function decode - * @memberof proto.DocumentMessage + * @memberof proto.PollUpdateMessageContent * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {proto.DocumentMessage} DocumentMessage + * @returns {proto.PollUpdateMessageContent} PollUpdateMessageContent * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DocumentMessage.decode = function decode(reader, length) { + PollUpdateMessageContent.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.DocumentMessage(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.PollUpdateMessageContent(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.url = reader.string(); - break; - case 2: - message.mimetype = reader.string(); - break; - case 3: - message.title = reader.string(); - break; - case 4: - message.fileSha256 = reader.bytes(); - break; - case 5: - message.fileLength = reader.uint64(); - break; - case 6: - message.pageCount = reader.uint32(); - break; - case 7: - message.mediaKey = reader.bytes(); - break; - case 8: - message.fileName = reader.string(); - break; - case 9: - message.fileEncSha256 = reader.bytes(); - break; - case 10: - message.directPath = reader.string(); - break; - case 11: - message.mediaKeyTimestamp = reader.int64(); - break; - case 12: - message.contactVcard = reader.bool(); - break; - case 13: - message.thumbnailDirectPath = reader.string(); - break; - case 14: - message.thumbnailSha256 = reader.bytes(); - break; - case 15: - message.thumbnailEncSha256 = reader.bytes(); - break; - case 16: - message.jpegThumbnail = reader.bytes(); - break; - case 17: - message.contextInfo = $root.proto.ContextInfo.decode(reader, reader.uint32()); - break; - case 18: - message.thumbnailHeight = reader.uint32(); - break; - case 19: - message.thumbnailWidth = reader.uint32(); + message.voteMessage = $root.proto.PollVoteMessage.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -26299,351 +26564,119 @@ $root.proto = (function() { }; /** - * Decodes a DocumentMessage message from the specified reader or buffer, length delimited. + * Decodes a PollUpdateMessageContent message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof proto.DocumentMessage + * @memberof proto.PollUpdateMessageContent * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.DocumentMessage} DocumentMessage + * @returns {proto.PollUpdateMessageContent} PollUpdateMessageContent * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DocumentMessage.decodeDelimited = function decodeDelimited(reader) { + PollUpdateMessageContent.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a DocumentMessage message. + * Verifies a PollUpdateMessageContent message. * @function verify - * @memberof proto.DocumentMessage + * @memberof proto.PollUpdateMessageContent * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - DocumentMessage.verify = function verify(message) { + PollUpdateMessageContent.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.url != null && message.hasOwnProperty("url")) - if (!$util.isString(message.url)) - return "url: string expected"; - if (message.mimetype != null && message.hasOwnProperty("mimetype")) - if (!$util.isString(message.mimetype)) - return "mimetype: string expected"; - if (message.title != null && message.hasOwnProperty("title")) - if (!$util.isString(message.title)) - return "title: string expected"; - if (message.fileSha256 != null && message.hasOwnProperty("fileSha256")) - if (!(message.fileSha256 && typeof message.fileSha256.length === "number" || $util.isString(message.fileSha256))) - return "fileSha256: buffer expected"; - if (message.fileLength != null && message.hasOwnProperty("fileLength")) - if (!$util.isInteger(message.fileLength) && !(message.fileLength && $util.isInteger(message.fileLength.low) && $util.isInteger(message.fileLength.high))) - return "fileLength: integer|Long expected"; - if (message.pageCount != null && message.hasOwnProperty("pageCount")) - if (!$util.isInteger(message.pageCount)) - return "pageCount: integer expected"; - if (message.mediaKey != null && message.hasOwnProperty("mediaKey")) - if (!(message.mediaKey && typeof message.mediaKey.length === "number" || $util.isString(message.mediaKey))) - return "mediaKey: buffer expected"; - if (message.fileName != null && message.hasOwnProperty("fileName")) - if (!$util.isString(message.fileName)) - return "fileName: string expected"; - if (message.fileEncSha256 != null && message.hasOwnProperty("fileEncSha256")) - if (!(message.fileEncSha256 && typeof message.fileEncSha256.length === "number" || $util.isString(message.fileEncSha256))) - return "fileEncSha256: buffer expected"; - if (message.directPath != null && message.hasOwnProperty("directPath")) - if (!$util.isString(message.directPath)) - return "directPath: string expected"; - if (message.mediaKeyTimestamp != null && message.hasOwnProperty("mediaKeyTimestamp")) - if (!$util.isInteger(message.mediaKeyTimestamp) && !(message.mediaKeyTimestamp && $util.isInteger(message.mediaKeyTimestamp.low) && $util.isInteger(message.mediaKeyTimestamp.high))) - return "mediaKeyTimestamp: integer|Long expected"; - if (message.contactVcard != null && message.hasOwnProperty("contactVcard")) - if (typeof message.contactVcard !== "boolean") - return "contactVcard: boolean expected"; - if (message.thumbnailDirectPath != null && message.hasOwnProperty("thumbnailDirectPath")) - if (!$util.isString(message.thumbnailDirectPath)) - return "thumbnailDirectPath: string expected"; - if (message.thumbnailSha256 != null && message.hasOwnProperty("thumbnailSha256")) - if (!(message.thumbnailSha256 && typeof message.thumbnailSha256.length === "number" || $util.isString(message.thumbnailSha256))) - return "thumbnailSha256: buffer expected"; - if (message.thumbnailEncSha256 != null && message.hasOwnProperty("thumbnailEncSha256")) - if (!(message.thumbnailEncSha256 && typeof message.thumbnailEncSha256.length === "number" || $util.isString(message.thumbnailEncSha256))) - return "thumbnailEncSha256: buffer expected"; - if (message.jpegThumbnail != null && message.hasOwnProperty("jpegThumbnail")) - if (!(message.jpegThumbnail && typeof message.jpegThumbnail.length === "number" || $util.isString(message.jpegThumbnail))) - return "jpegThumbnail: buffer expected"; - if (message.contextInfo != null && message.hasOwnProperty("contextInfo")) { - var error = $root.proto.ContextInfo.verify(message.contextInfo); - if (error) - return "contextInfo." + error; + var properties = {}; + if (message.voteMessage != null && message.hasOwnProperty("voteMessage")) { + properties.update = 1; + { + var error = $root.proto.PollVoteMessage.verify(message.voteMessage); + if (error) + return "voteMessage." + error; + } } - if (message.thumbnailHeight != null && message.hasOwnProperty("thumbnailHeight")) - if (!$util.isInteger(message.thumbnailHeight)) - return "thumbnailHeight: integer expected"; - if (message.thumbnailWidth != null && message.hasOwnProperty("thumbnailWidth")) - if (!$util.isInteger(message.thumbnailWidth)) - return "thumbnailWidth: integer expected"; return null; }; /** - * Creates a DocumentMessage message from a plain object. Also converts values to their respective internal types. + * Creates a PollUpdateMessageContent message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof proto.DocumentMessage + * @memberof proto.PollUpdateMessageContent * @static * @param {Object.} object Plain object - * @returns {proto.DocumentMessage} DocumentMessage + * @returns {proto.PollUpdateMessageContent} PollUpdateMessageContent */ - DocumentMessage.fromObject = function fromObject(object) { - if (object instanceof $root.proto.DocumentMessage) + PollUpdateMessageContent.fromObject = function fromObject(object) { + if (object instanceof $root.proto.PollUpdateMessageContent) return object; - var message = new $root.proto.DocumentMessage(); - if (object.url != null) - message.url = String(object.url); - if (object.mimetype != null) - message.mimetype = String(object.mimetype); - if (object.title != null) - message.title = String(object.title); - if (object.fileSha256 != null) - if (typeof object.fileSha256 === "string") - $util.base64.decode(object.fileSha256, message.fileSha256 = $util.newBuffer($util.base64.length(object.fileSha256)), 0); - else if (object.fileSha256.length) - message.fileSha256 = object.fileSha256; - if (object.fileLength != null) - if ($util.Long) - (message.fileLength = $util.Long.fromValue(object.fileLength)).unsigned = true; - else if (typeof object.fileLength === "string") - message.fileLength = parseInt(object.fileLength, 10); - else if (typeof object.fileLength === "number") - message.fileLength = object.fileLength; - else if (typeof object.fileLength === "object") - message.fileLength = new $util.LongBits(object.fileLength.low >>> 0, object.fileLength.high >>> 0).toNumber(true); - if (object.pageCount != null) - message.pageCount = object.pageCount >>> 0; - if (object.mediaKey != null) - if (typeof object.mediaKey === "string") - $util.base64.decode(object.mediaKey, message.mediaKey = $util.newBuffer($util.base64.length(object.mediaKey)), 0); - else if (object.mediaKey.length) - message.mediaKey = object.mediaKey; - if (object.fileName != null) - message.fileName = String(object.fileName); - if (object.fileEncSha256 != null) - if (typeof object.fileEncSha256 === "string") - $util.base64.decode(object.fileEncSha256, message.fileEncSha256 = $util.newBuffer($util.base64.length(object.fileEncSha256)), 0); - else if (object.fileEncSha256.length) - message.fileEncSha256 = object.fileEncSha256; - if (object.directPath != null) - message.directPath = String(object.directPath); - if (object.mediaKeyTimestamp != null) - if ($util.Long) - (message.mediaKeyTimestamp = $util.Long.fromValue(object.mediaKeyTimestamp)).unsigned = false; - else if (typeof object.mediaKeyTimestamp === "string") - message.mediaKeyTimestamp = parseInt(object.mediaKeyTimestamp, 10); - else if (typeof object.mediaKeyTimestamp === "number") - message.mediaKeyTimestamp = object.mediaKeyTimestamp; - else if (typeof object.mediaKeyTimestamp === "object") - message.mediaKeyTimestamp = new $util.LongBits(object.mediaKeyTimestamp.low >>> 0, object.mediaKeyTimestamp.high >>> 0).toNumber(); - if (object.contactVcard != null) - message.contactVcard = Boolean(object.contactVcard); - if (object.thumbnailDirectPath != null) - message.thumbnailDirectPath = String(object.thumbnailDirectPath); - if (object.thumbnailSha256 != null) - if (typeof object.thumbnailSha256 === "string") - $util.base64.decode(object.thumbnailSha256, message.thumbnailSha256 = $util.newBuffer($util.base64.length(object.thumbnailSha256)), 0); - else if (object.thumbnailSha256.length) - message.thumbnailSha256 = object.thumbnailSha256; - if (object.thumbnailEncSha256 != null) - if (typeof object.thumbnailEncSha256 === "string") - $util.base64.decode(object.thumbnailEncSha256, message.thumbnailEncSha256 = $util.newBuffer($util.base64.length(object.thumbnailEncSha256)), 0); - else if (object.thumbnailEncSha256.length) - message.thumbnailEncSha256 = object.thumbnailEncSha256; - if (object.jpegThumbnail != null) - if (typeof object.jpegThumbnail === "string") - $util.base64.decode(object.jpegThumbnail, message.jpegThumbnail = $util.newBuffer($util.base64.length(object.jpegThumbnail)), 0); - else if (object.jpegThumbnail.length) - message.jpegThumbnail = object.jpegThumbnail; - if (object.contextInfo != null) { - if (typeof object.contextInfo !== "object") - throw TypeError(".proto.DocumentMessage.contextInfo: object expected"); - message.contextInfo = $root.proto.ContextInfo.fromObject(object.contextInfo); + var message = new $root.proto.PollUpdateMessageContent(); + if (object.voteMessage != null) { + if (typeof object.voteMessage !== "object") + throw TypeError(".proto.PollUpdateMessageContent.voteMessage: object expected"); + message.voteMessage = $root.proto.PollVoteMessage.fromObject(object.voteMessage); } - if (object.thumbnailHeight != null) - message.thumbnailHeight = object.thumbnailHeight >>> 0; - if (object.thumbnailWidth != null) - message.thumbnailWidth = object.thumbnailWidth >>> 0; return message; }; /** - * Creates a plain object from a DocumentMessage message. Also converts values to other types if specified. + * Creates a plain object from a PollUpdateMessageContent message. Also converts values to other types if specified. * @function toObject - * @memberof proto.DocumentMessage + * @memberof proto.PollUpdateMessageContent * @static - * @param {proto.DocumentMessage} message DocumentMessage + * @param {proto.PollUpdateMessageContent} message PollUpdateMessageContent * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DocumentMessage.toObject = function toObject(message, options) { + PollUpdateMessageContent.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.url = ""; - object.mimetype = ""; - object.title = ""; - if (options.bytes === String) - object.fileSha256 = ""; - else { - object.fileSha256 = []; - if (options.bytes !== Array) - object.fileSha256 = $util.newBuffer(object.fileSha256); - } - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.fileLength = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.fileLength = options.longs === String ? "0" : 0; - object.pageCount = 0; - if (options.bytes === String) - object.mediaKey = ""; - else { - object.mediaKey = []; - if (options.bytes !== Array) - object.mediaKey = $util.newBuffer(object.mediaKey); - } - object.fileName = ""; - if (options.bytes === String) - object.fileEncSha256 = ""; - else { - object.fileEncSha256 = []; - if (options.bytes !== Array) - object.fileEncSha256 = $util.newBuffer(object.fileEncSha256); - } - object.directPath = ""; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.mediaKeyTimestamp = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.mediaKeyTimestamp = options.longs === String ? "0" : 0; - object.contactVcard = false; - object.thumbnailDirectPath = ""; - if (options.bytes === String) - object.thumbnailSha256 = ""; - else { - object.thumbnailSha256 = []; - if (options.bytes !== Array) - object.thumbnailSha256 = $util.newBuffer(object.thumbnailSha256); - } - if (options.bytes === String) - object.thumbnailEncSha256 = ""; - else { - object.thumbnailEncSha256 = []; - if (options.bytes !== Array) - object.thumbnailEncSha256 = $util.newBuffer(object.thumbnailEncSha256); - } - if (options.bytes === String) - object.jpegThumbnail = ""; - else { - object.jpegThumbnail = []; - if (options.bytes !== Array) - object.jpegThumbnail = $util.newBuffer(object.jpegThumbnail); - } - object.contextInfo = null; - object.thumbnailHeight = 0; - object.thumbnailWidth = 0; + if (message.voteMessage != null && message.hasOwnProperty("voteMessage")) { + object.voteMessage = $root.proto.PollVoteMessage.toObject(message.voteMessage, options); + if (options.oneofs) + object.update = "voteMessage"; } - if (message.url != null && message.hasOwnProperty("url")) - object.url = message.url; - if (message.mimetype != null && message.hasOwnProperty("mimetype")) - object.mimetype = message.mimetype; - if (message.title != null && message.hasOwnProperty("title")) - object.title = message.title; - if (message.fileSha256 != null && message.hasOwnProperty("fileSha256")) - object.fileSha256 = options.bytes === String ? $util.base64.encode(message.fileSha256, 0, message.fileSha256.length) : options.bytes === Array ? Array.prototype.slice.call(message.fileSha256) : message.fileSha256; - if (message.fileLength != null && message.hasOwnProperty("fileLength")) - if (typeof message.fileLength === "number") - object.fileLength = options.longs === String ? String(message.fileLength) : message.fileLength; - else - object.fileLength = options.longs === String ? $util.Long.prototype.toString.call(message.fileLength) : options.longs === Number ? new $util.LongBits(message.fileLength.low >>> 0, message.fileLength.high >>> 0).toNumber(true) : message.fileLength; - if (message.pageCount != null && message.hasOwnProperty("pageCount")) - object.pageCount = message.pageCount; - if (message.mediaKey != null && message.hasOwnProperty("mediaKey")) - object.mediaKey = options.bytes === String ? $util.base64.encode(message.mediaKey, 0, message.mediaKey.length) : options.bytes === Array ? Array.prototype.slice.call(message.mediaKey) : message.mediaKey; - if (message.fileName != null && message.hasOwnProperty("fileName")) - object.fileName = message.fileName; - if (message.fileEncSha256 != null && message.hasOwnProperty("fileEncSha256")) - object.fileEncSha256 = options.bytes === String ? $util.base64.encode(message.fileEncSha256, 0, message.fileEncSha256.length) : options.bytes === Array ? Array.prototype.slice.call(message.fileEncSha256) : message.fileEncSha256; - if (message.directPath != null && message.hasOwnProperty("directPath")) - object.directPath = message.directPath; - if (message.mediaKeyTimestamp != null && message.hasOwnProperty("mediaKeyTimestamp")) - if (typeof message.mediaKeyTimestamp === "number") - object.mediaKeyTimestamp = options.longs === String ? String(message.mediaKeyTimestamp) : message.mediaKeyTimestamp; - else - object.mediaKeyTimestamp = options.longs === String ? $util.Long.prototype.toString.call(message.mediaKeyTimestamp) : options.longs === Number ? new $util.LongBits(message.mediaKeyTimestamp.low >>> 0, message.mediaKeyTimestamp.high >>> 0).toNumber() : message.mediaKeyTimestamp; - if (message.contactVcard != null && message.hasOwnProperty("contactVcard")) - object.contactVcard = message.contactVcard; - if (message.thumbnailDirectPath != null && message.hasOwnProperty("thumbnailDirectPath")) - object.thumbnailDirectPath = message.thumbnailDirectPath; - if (message.thumbnailSha256 != null && message.hasOwnProperty("thumbnailSha256")) - object.thumbnailSha256 = options.bytes === String ? $util.base64.encode(message.thumbnailSha256, 0, message.thumbnailSha256.length) : options.bytes === Array ? Array.prototype.slice.call(message.thumbnailSha256) : message.thumbnailSha256; - if (message.thumbnailEncSha256 != null && message.hasOwnProperty("thumbnailEncSha256")) - object.thumbnailEncSha256 = options.bytes === String ? $util.base64.encode(message.thumbnailEncSha256, 0, message.thumbnailEncSha256.length) : options.bytes === Array ? Array.prototype.slice.call(message.thumbnailEncSha256) : message.thumbnailEncSha256; - if (message.jpegThumbnail != null && message.hasOwnProperty("jpegThumbnail")) - object.jpegThumbnail = options.bytes === String ? $util.base64.encode(message.jpegThumbnail, 0, message.jpegThumbnail.length) : options.bytes === Array ? Array.prototype.slice.call(message.jpegThumbnail) : message.jpegThumbnail; - if (message.contextInfo != null && message.hasOwnProperty("contextInfo")) - object.contextInfo = $root.proto.ContextInfo.toObject(message.contextInfo, options); - if (message.thumbnailHeight != null && message.hasOwnProperty("thumbnailHeight")) - object.thumbnailHeight = message.thumbnailHeight; - if (message.thumbnailWidth != null && message.hasOwnProperty("thumbnailWidth")) - object.thumbnailWidth = message.thumbnailWidth; return object; }; /** - * Converts this DocumentMessage to JSON. + * Converts this PollUpdateMessageContent to JSON. * @function toJSON - * @memberof proto.DocumentMessage + * @memberof proto.PollUpdateMessageContent * @instance * @returns {Object.} JSON object */ - DocumentMessage.prototype.toJSON = function toJSON() { + PollUpdateMessageContent.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return DocumentMessage; + return PollUpdateMessageContent; })(); - proto.AudioMessage = (function() { + proto.PollVoteMessage = (function() { /** - * Properties of an AudioMessage. + * Properties of a PollVoteMessage. * @memberof proto - * @interface IAudioMessage - * @property {string|null} [url] AudioMessage url - * @property {string|null} [mimetype] AudioMessage mimetype - * @property {Uint8Array|null} [fileSha256] AudioMessage fileSha256 - * @property {number|Long|null} [fileLength] AudioMessage fileLength - * @property {number|null} [seconds] AudioMessage seconds - * @property {boolean|null} [ptt] AudioMessage ptt - * @property {Uint8Array|null} [mediaKey] AudioMessage mediaKey - * @property {Uint8Array|null} [fileEncSha256] AudioMessage fileEncSha256 - * @property {string|null} [directPath] AudioMessage directPath - * @property {number|Long|null} [mediaKeyTimestamp] AudioMessage mediaKeyTimestamp - * @property {proto.IContextInfo|null} [contextInfo] AudioMessage contextInfo - * @property {Uint8Array|null} [streamingSidecar] AudioMessage streamingSidecar - * @property {Uint8Array|null} [waveform] AudioMessage waveform + * @interface IPollVoteMessage + * @property {Array.|null} [selectedOptions] PollVoteMessage selectedOptions + * @property {number|Long|null} [senderTimestampMs] PollVoteMessage senderTimestampMs */ /** - * Constructs a new AudioMessage. + * Constructs a new PollVoteMessage. * @memberof proto - * @classdesc Represents an AudioMessage. - * @implements IAudioMessage + * @classdesc Represents a PollVoteMessage. + * @implements IPollVoteMessage * @constructor - * @param {proto.IAudioMessage=} [properties] Properties to set + * @param {proto.IPollVoteMessage=} [properties] Properties to set */ - function AudioMessage(properties) { + function PollVoteMessage(properties) { + this.selectedOptions = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -26651,231 +26684,316 @@ $root.proto = (function() { } /** - * AudioMessage url. - * @member {string} url - * @memberof proto.AudioMessage + * PollVoteMessage selectedOptions. + * @member {Array.} selectedOptions + * @memberof proto.PollVoteMessage * @instance */ - AudioMessage.prototype.url = ""; + PollVoteMessage.prototype.selectedOptions = $util.emptyArray; /** - * AudioMessage mimetype. - * @member {string} mimetype - * @memberof proto.AudioMessage + * PollVoteMessage senderTimestampMs. + * @member {number|Long} senderTimestampMs + * @memberof proto.PollVoteMessage * @instance */ - AudioMessage.prototype.mimetype = ""; + PollVoteMessage.prototype.senderTimestampMs = $util.Long ? $util.Long.fromBits(0,0,false) : 0; /** - * AudioMessage fileSha256. - * @member {Uint8Array} fileSha256 - * @memberof proto.AudioMessage - * @instance + * Creates a new PollVoteMessage instance using the specified properties. + * @function create + * @memberof proto.PollVoteMessage + * @static + * @param {proto.IPollVoteMessage=} [properties] Properties to set + * @returns {proto.PollVoteMessage} PollVoteMessage instance */ - AudioMessage.prototype.fileSha256 = $util.newBuffer([]); + PollVoteMessage.create = function create(properties) { + return new PollVoteMessage(properties); + }; /** - * AudioMessage fileLength. - * @member {number|Long} fileLength - * @memberof proto.AudioMessage - * @instance + * Encodes the specified PollVoteMessage message. Does not implicitly {@link proto.PollVoteMessage.verify|verify} messages. + * @function encode + * @memberof proto.PollVoteMessage + * @static + * @param {proto.IPollVoteMessage} message PollVoteMessage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - AudioMessage.prototype.fileLength = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + PollVoteMessage.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.selectedOptions != null && message.selectedOptions.length) + for (var i = 0; i < message.selectedOptions.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.selectedOptions[i]); + if (message.senderTimestampMs != null && Object.hasOwnProperty.call(message, "senderTimestampMs")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.senderTimestampMs); + return writer; + }; /** - * AudioMessage seconds. - * @member {number} seconds - * @memberof proto.AudioMessage - * @instance + * Encodes the specified PollVoteMessage message, length delimited. Does not implicitly {@link proto.PollVoteMessage.verify|verify} messages. + * @function encodeDelimited + * @memberof proto.PollVoteMessage + * @static + * @param {proto.IPollVoteMessage} message PollVoteMessage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - AudioMessage.prototype.seconds = 0; + PollVoteMessage.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; /** - * AudioMessage ptt. - * @member {boolean} ptt - * @memberof proto.AudioMessage - * @instance + * Decodes a PollVoteMessage message from the specified reader or buffer. + * @function decode + * @memberof proto.PollVoteMessage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {proto.PollVoteMessage} PollVoteMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - AudioMessage.prototype.ptt = false; + PollVoteMessage.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.PollVoteMessage(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.selectedOptions && message.selectedOptions.length)) + message.selectedOptions = []; + message.selectedOptions.push(reader.bytes()); + break; + case 2: + message.senderTimestampMs = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; /** - * AudioMessage mediaKey. - * @member {Uint8Array} mediaKey - * @memberof proto.AudioMessage - * @instance + * Decodes a PollVoteMessage message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof proto.PollVoteMessage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {proto.PollVoteMessage} PollVoteMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - AudioMessage.prototype.mediaKey = $util.newBuffer([]); + PollVoteMessage.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; /** - * AudioMessage fileEncSha256. - * @member {Uint8Array} fileEncSha256 - * @memberof proto.AudioMessage - * @instance + * Verifies a PollVoteMessage message. + * @function verify + * @memberof proto.PollVoteMessage + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - AudioMessage.prototype.fileEncSha256 = $util.newBuffer([]); - - /** - * AudioMessage directPath. - * @member {string} directPath - * @memberof proto.AudioMessage - * @instance + PollVoteMessage.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.selectedOptions != null && message.hasOwnProperty("selectedOptions")) { + if (!Array.isArray(message.selectedOptions)) + return "selectedOptions: array expected"; + for (var i = 0; i < message.selectedOptions.length; ++i) + if (!(message.selectedOptions[i] && typeof message.selectedOptions[i].length === "number" || $util.isString(message.selectedOptions[i]))) + return "selectedOptions: buffer[] expected"; + } + if (message.senderTimestampMs != null && message.hasOwnProperty("senderTimestampMs")) + if (!$util.isInteger(message.senderTimestampMs) && !(message.senderTimestampMs && $util.isInteger(message.senderTimestampMs.low) && $util.isInteger(message.senderTimestampMs.high))) + return "senderTimestampMs: integer|Long expected"; + return null; + }; + + /** + * Creates a PollVoteMessage message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof proto.PollVoteMessage + * @static + * @param {Object.} object Plain object + * @returns {proto.PollVoteMessage} PollVoteMessage */ - AudioMessage.prototype.directPath = ""; + PollVoteMessage.fromObject = function fromObject(object) { + if (object instanceof $root.proto.PollVoteMessage) + return object; + var message = new $root.proto.PollVoteMessage(); + if (object.selectedOptions) { + if (!Array.isArray(object.selectedOptions)) + throw TypeError(".proto.PollVoteMessage.selectedOptions: array expected"); + message.selectedOptions = []; + for (var i = 0; i < object.selectedOptions.length; ++i) + if (typeof object.selectedOptions[i] === "string") + $util.base64.decode(object.selectedOptions[i], message.selectedOptions[i] = $util.newBuffer($util.base64.length(object.selectedOptions[i])), 0); + else if (object.selectedOptions[i].length) + message.selectedOptions[i] = object.selectedOptions[i]; + } + if (object.senderTimestampMs != null) + if ($util.Long) + (message.senderTimestampMs = $util.Long.fromValue(object.senderTimestampMs)).unsigned = false; + else if (typeof object.senderTimestampMs === "string") + message.senderTimestampMs = parseInt(object.senderTimestampMs, 10); + else if (typeof object.senderTimestampMs === "number") + message.senderTimestampMs = object.senderTimestampMs; + else if (typeof object.senderTimestampMs === "object") + message.senderTimestampMs = new $util.LongBits(object.senderTimestampMs.low >>> 0, object.senderTimestampMs.high >>> 0).toNumber(); + return message; + }; /** - * AudioMessage mediaKeyTimestamp. - * @member {number|Long} mediaKeyTimestamp - * @memberof proto.AudioMessage - * @instance + * Creates a plain object from a PollVoteMessage message. Also converts values to other types if specified. + * @function toObject + * @memberof proto.PollVoteMessage + * @static + * @param {proto.PollVoteMessage} message PollVoteMessage + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object */ - AudioMessage.prototype.mediaKeyTimestamp = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + PollVoteMessage.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.selectedOptions = []; + if (options.defaults) + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.senderTimestampMs = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.senderTimestampMs = options.longs === String ? "0" : 0; + if (message.selectedOptions && message.selectedOptions.length) { + object.selectedOptions = []; + for (var j = 0; j < message.selectedOptions.length; ++j) + object.selectedOptions[j] = options.bytes === String ? $util.base64.encode(message.selectedOptions[j], 0, message.selectedOptions[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.selectedOptions[j]) : message.selectedOptions[j]; + } + if (message.senderTimestampMs != null && message.hasOwnProperty("senderTimestampMs")) + if (typeof message.senderTimestampMs === "number") + object.senderTimestampMs = options.longs === String ? String(message.senderTimestampMs) : message.senderTimestampMs; + else + object.senderTimestampMs = options.longs === String ? $util.Long.prototype.toString.call(message.senderTimestampMs) : options.longs === Number ? new $util.LongBits(message.senderTimestampMs.low >>> 0, message.senderTimestampMs.high >>> 0).toNumber() : message.senderTimestampMs; + return object; + }; /** - * AudioMessage contextInfo. - * @member {proto.IContextInfo|null|undefined} contextInfo - * @memberof proto.AudioMessage + * Converts this PollVoteMessage to JSON. + * @function toJSON + * @memberof proto.PollVoteMessage * @instance + * @returns {Object.} JSON object */ - AudioMessage.prototype.contextInfo = null; + PollVoteMessage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return PollVoteMessage; + })(); + + proto.Product = (function() { /** - * AudioMessage streamingSidecar. - * @member {Uint8Array} streamingSidecar - * @memberof proto.AudioMessage - * @instance + * Properties of a Product. + * @memberof proto + * @interface IProduct + * @property {string|null} [productId] Product productId */ - AudioMessage.prototype.streamingSidecar = $util.newBuffer([]); /** - * AudioMessage waveform. - * @member {Uint8Array} waveform - * @memberof proto.AudioMessage + * Constructs a new Product. + * @memberof proto + * @classdesc Represents a Product. + * @implements IProduct + * @constructor + * @param {proto.IProduct=} [properties] Properties to set + */ + function Product(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Product productId. + * @member {string} productId + * @memberof proto.Product * @instance */ - AudioMessage.prototype.waveform = $util.newBuffer([]); + Product.prototype.productId = ""; /** - * Creates a new AudioMessage instance using the specified properties. + * Creates a new Product instance using the specified properties. * @function create - * @memberof proto.AudioMessage + * @memberof proto.Product * @static - * @param {proto.IAudioMessage=} [properties] Properties to set - * @returns {proto.AudioMessage} AudioMessage instance + * @param {proto.IProduct=} [properties] Properties to set + * @returns {proto.Product} Product instance */ - AudioMessage.create = function create(properties) { - return new AudioMessage(properties); + Product.create = function create(properties) { + return new Product(properties); }; /** - * Encodes the specified AudioMessage message. Does not implicitly {@link proto.AudioMessage.verify|verify} messages. + * Encodes the specified Product message. Does not implicitly {@link proto.Product.verify|verify} messages. * @function encode - * @memberof proto.AudioMessage + * @memberof proto.Product * @static - * @param {proto.IAudioMessage} message AudioMessage message or plain object to encode + * @param {proto.IProduct} message Product message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AudioMessage.encode = function encode(message, writer) { + Product.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.url != null && Object.hasOwnProperty.call(message, "url")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.url); - if (message.mimetype != null && Object.hasOwnProperty.call(message, "mimetype")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.mimetype); - if (message.fileSha256 != null && Object.hasOwnProperty.call(message, "fileSha256")) - writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.fileSha256); - if (message.fileLength != null && Object.hasOwnProperty.call(message, "fileLength")) - writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.fileLength); - if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) - writer.uint32(/* id 5, wireType 0 =*/40).uint32(message.seconds); - if (message.ptt != null && Object.hasOwnProperty.call(message, "ptt")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.ptt); - if (message.mediaKey != null && Object.hasOwnProperty.call(message, "mediaKey")) - writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.mediaKey); - if (message.fileEncSha256 != null && Object.hasOwnProperty.call(message, "fileEncSha256")) - writer.uint32(/* id 8, wireType 2 =*/66).bytes(message.fileEncSha256); - if (message.directPath != null && Object.hasOwnProperty.call(message, "directPath")) - writer.uint32(/* id 9, wireType 2 =*/74).string(message.directPath); - if (message.mediaKeyTimestamp != null && Object.hasOwnProperty.call(message, "mediaKeyTimestamp")) - writer.uint32(/* id 10, wireType 0 =*/80).int64(message.mediaKeyTimestamp); - if (message.contextInfo != null && Object.hasOwnProperty.call(message, "contextInfo")) - $root.proto.ContextInfo.encode(message.contextInfo, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); - if (message.streamingSidecar != null && Object.hasOwnProperty.call(message, "streamingSidecar")) - writer.uint32(/* id 18, wireType 2 =*/146).bytes(message.streamingSidecar); - if (message.waveform != null && Object.hasOwnProperty.call(message, "waveform")) - writer.uint32(/* id 19, wireType 2 =*/154).bytes(message.waveform); + if (message.productId != null && Object.hasOwnProperty.call(message, "productId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.productId); return writer; }; /** - * Encodes the specified AudioMessage message, length delimited. Does not implicitly {@link proto.AudioMessage.verify|verify} messages. + * Encodes the specified Product message, length delimited. Does not implicitly {@link proto.Product.verify|verify} messages. * @function encodeDelimited - * @memberof proto.AudioMessage + * @memberof proto.Product * @static - * @param {proto.IAudioMessage} message AudioMessage message or plain object to encode + * @param {proto.IProduct} message Product message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AudioMessage.encodeDelimited = function encodeDelimited(message, writer) { + Product.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an AudioMessage message from the specified reader or buffer. + * Decodes a Product message from the specified reader or buffer. * @function decode - * @memberof proto.AudioMessage + * @memberof proto.Product * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {proto.AudioMessage} AudioMessage + * @returns {proto.Product} Product * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - AudioMessage.decode = function decode(reader, length) { + Product.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.AudioMessage(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.Product(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.url = reader.string(); - break; - case 2: - message.mimetype = reader.string(); - break; - case 3: - message.fileSha256 = reader.bytes(); - break; - case 4: - message.fileLength = reader.uint64(); - break; - case 5: - message.seconds = reader.uint32(); - break; - case 6: - message.ptt = reader.bool(); - break; - case 7: - message.mediaKey = reader.bytes(); - break; - case 8: - message.fileEncSha256 = reader.bytes(); - break; - case 9: - message.directPath = reader.string(); - break; - case 10: - message.mediaKeyTimestamp = reader.int64(); - break; - case 17: - message.contextInfo = $root.proto.ContextInfo.decode(reader, reader.uint32()); - break; - case 18: - message.streamingSidecar = reader.bytes(); - break; - case 19: - message.waveform = reader.bytes(); + message.productId = reader.string(); break; default: reader.skipType(tag & 7); @@ -26886,305 +27004,108 @@ $root.proto = (function() { }; /** - * Decodes an AudioMessage message from the specified reader or buffer, length delimited. + * Decodes a Product message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof proto.AudioMessage + * @memberof proto.Product * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.AudioMessage} AudioMessage + * @returns {proto.Product} Product * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - AudioMessage.decodeDelimited = function decodeDelimited(reader) { + Product.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an AudioMessage message. + * Verifies a Product message. * @function verify - * @memberof proto.AudioMessage + * @memberof proto.Product * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - AudioMessage.verify = function verify(message) { + Product.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.url != null && message.hasOwnProperty("url")) - if (!$util.isString(message.url)) - return "url: string expected"; - if (message.mimetype != null && message.hasOwnProperty("mimetype")) - if (!$util.isString(message.mimetype)) - return "mimetype: string expected"; - if (message.fileSha256 != null && message.hasOwnProperty("fileSha256")) - if (!(message.fileSha256 && typeof message.fileSha256.length === "number" || $util.isString(message.fileSha256))) - return "fileSha256: buffer expected"; - if (message.fileLength != null && message.hasOwnProperty("fileLength")) - if (!$util.isInteger(message.fileLength) && !(message.fileLength && $util.isInteger(message.fileLength.low) && $util.isInteger(message.fileLength.high))) - return "fileLength: integer|Long expected"; - if (message.seconds != null && message.hasOwnProperty("seconds")) - if (!$util.isInteger(message.seconds)) - return "seconds: integer expected"; - if (message.ptt != null && message.hasOwnProperty("ptt")) - if (typeof message.ptt !== "boolean") - return "ptt: boolean expected"; - if (message.mediaKey != null && message.hasOwnProperty("mediaKey")) - if (!(message.mediaKey && typeof message.mediaKey.length === "number" || $util.isString(message.mediaKey))) - return "mediaKey: buffer expected"; - if (message.fileEncSha256 != null && message.hasOwnProperty("fileEncSha256")) - if (!(message.fileEncSha256 && typeof message.fileEncSha256.length === "number" || $util.isString(message.fileEncSha256))) - return "fileEncSha256: buffer expected"; - if (message.directPath != null && message.hasOwnProperty("directPath")) - if (!$util.isString(message.directPath)) - return "directPath: string expected"; - if (message.mediaKeyTimestamp != null && message.hasOwnProperty("mediaKeyTimestamp")) - if (!$util.isInteger(message.mediaKeyTimestamp) && !(message.mediaKeyTimestamp && $util.isInteger(message.mediaKeyTimestamp.low) && $util.isInteger(message.mediaKeyTimestamp.high))) - return "mediaKeyTimestamp: integer|Long expected"; - if (message.contextInfo != null && message.hasOwnProperty("contextInfo")) { - var error = $root.proto.ContextInfo.verify(message.contextInfo); - if (error) - return "contextInfo." + error; - } - if (message.streamingSidecar != null && message.hasOwnProperty("streamingSidecar")) - if (!(message.streamingSidecar && typeof message.streamingSidecar.length === "number" || $util.isString(message.streamingSidecar))) - return "streamingSidecar: buffer expected"; - if (message.waveform != null && message.hasOwnProperty("waveform")) - if (!(message.waveform && typeof message.waveform.length === "number" || $util.isString(message.waveform))) - return "waveform: buffer expected"; + if (message.productId != null && message.hasOwnProperty("productId")) + if (!$util.isString(message.productId)) + return "productId: string expected"; return null; }; /** - * Creates an AudioMessage message from a plain object. Also converts values to their respective internal types. + * Creates a Product message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof proto.AudioMessage + * @memberof proto.Product * @static * @param {Object.} object Plain object - * @returns {proto.AudioMessage} AudioMessage + * @returns {proto.Product} Product */ - AudioMessage.fromObject = function fromObject(object) { - if (object instanceof $root.proto.AudioMessage) + Product.fromObject = function fromObject(object) { + if (object instanceof $root.proto.Product) return object; - var message = new $root.proto.AudioMessage(); - if (object.url != null) - message.url = String(object.url); - if (object.mimetype != null) - message.mimetype = String(object.mimetype); - if (object.fileSha256 != null) - if (typeof object.fileSha256 === "string") - $util.base64.decode(object.fileSha256, message.fileSha256 = $util.newBuffer($util.base64.length(object.fileSha256)), 0); - else if (object.fileSha256.length) - message.fileSha256 = object.fileSha256; - if (object.fileLength != null) - if ($util.Long) - (message.fileLength = $util.Long.fromValue(object.fileLength)).unsigned = true; - else if (typeof object.fileLength === "string") - message.fileLength = parseInt(object.fileLength, 10); - else if (typeof object.fileLength === "number") - message.fileLength = object.fileLength; - else if (typeof object.fileLength === "object") - message.fileLength = new $util.LongBits(object.fileLength.low >>> 0, object.fileLength.high >>> 0).toNumber(true); - if (object.seconds != null) - message.seconds = object.seconds >>> 0; - if (object.ptt != null) - message.ptt = Boolean(object.ptt); - if (object.mediaKey != null) - if (typeof object.mediaKey === "string") - $util.base64.decode(object.mediaKey, message.mediaKey = $util.newBuffer($util.base64.length(object.mediaKey)), 0); - else if (object.mediaKey.length) - message.mediaKey = object.mediaKey; - if (object.fileEncSha256 != null) - if (typeof object.fileEncSha256 === "string") - $util.base64.decode(object.fileEncSha256, message.fileEncSha256 = $util.newBuffer($util.base64.length(object.fileEncSha256)), 0); - else if (object.fileEncSha256.length) - message.fileEncSha256 = object.fileEncSha256; - if (object.directPath != null) - message.directPath = String(object.directPath); - if (object.mediaKeyTimestamp != null) - if ($util.Long) - (message.mediaKeyTimestamp = $util.Long.fromValue(object.mediaKeyTimestamp)).unsigned = false; - else if (typeof object.mediaKeyTimestamp === "string") - message.mediaKeyTimestamp = parseInt(object.mediaKeyTimestamp, 10); - else if (typeof object.mediaKeyTimestamp === "number") - message.mediaKeyTimestamp = object.mediaKeyTimestamp; - else if (typeof object.mediaKeyTimestamp === "object") - message.mediaKeyTimestamp = new $util.LongBits(object.mediaKeyTimestamp.low >>> 0, object.mediaKeyTimestamp.high >>> 0).toNumber(); - if (object.contextInfo != null) { - if (typeof object.contextInfo !== "object") - throw TypeError(".proto.AudioMessage.contextInfo: object expected"); - message.contextInfo = $root.proto.ContextInfo.fromObject(object.contextInfo); - } - if (object.streamingSidecar != null) - if (typeof object.streamingSidecar === "string") - $util.base64.decode(object.streamingSidecar, message.streamingSidecar = $util.newBuffer($util.base64.length(object.streamingSidecar)), 0); - else if (object.streamingSidecar.length) - message.streamingSidecar = object.streamingSidecar; - if (object.waveform != null) - if (typeof object.waveform === "string") - $util.base64.decode(object.waveform, message.waveform = $util.newBuffer($util.base64.length(object.waveform)), 0); - else if (object.waveform.length) - message.waveform = object.waveform; + var message = new $root.proto.Product(); + if (object.productId != null) + message.productId = String(object.productId); return message; }; /** - * Creates a plain object from an AudioMessage message. Also converts values to other types if specified. + * Creates a plain object from a Product message. Also converts values to other types if specified. * @function toObject - * @memberof proto.AudioMessage + * @memberof proto.Product * @static - * @param {proto.AudioMessage} message AudioMessage + * @param {proto.Product} message Product * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - AudioMessage.toObject = function toObject(message, options) { + Product.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.url = ""; - object.mimetype = ""; - if (options.bytes === String) - object.fileSha256 = ""; - else { - object.fileSha256 = []; - if (options.bytes !== Array) - object.fileSha256 = $util.newBuffer(object.fileSha256); - } - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.fileLength = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.fileLength = options.longs === String ? "0" : 0; - object.seconds = 0; - object.ptt = false; - if (options.bytes === String) - object.mediaKey = ""; - else { - object.mediaKey = []; - if (options.bytes !== Array) - object.mediaKey = $util.newBuffer(object.mediaKey); - } - if (options.bytes === String) - object.fileEncSha256 = ""; - else { - object.fileEncSha256 = []; - if (options.bytes !== Array) - object.fileEncSha256 = $util.newBuffer(object.fileEncSha256); - } - object.directPath = ""; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.mediaKeyTimestamp = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.mediaKeyTimestamp = options.longs === String ? "0" : 0; - object.contextInfo = null; - if (options.bytes === String) - object.streamingSidecar = ""; - else { - object.streamingSidecar = []; - if (options.bytes !== Array) - object.streamingSidecar = $util.newBuffer(object.streamingSidecar); - } - if (options.bytes === String) - object.waveform = ""; - else { - object.waveform = []; - if (options.bytes !== Array) - object.waveform = $util.newBuffer(object.waveform); - } - } - if (message.url != null && message.hasOwnProperty("url")) - object.url = message.url; - if (message.mimetype != null && message.hasOwnProperty("mimetype")) - object.mimetype = message.mimetype; - if (message.fileSha256 != null && message.hasOwnProperty("fileSha256")) - object.fileSha256 = options.bytes === String ? $util.base64.encode(message.fileSha256, 0, message.fileSha256.length) : options.bytes === Array ? Array.prototype.slice.call(message.fileSha256) : message.fileSha256; - if (message.fileLength != null && message.hasOwnProperty("fileLength")) - if (typeof message.fileLength === "number") - object.fileLength = options.longs === String ? String(message.fileLength) : message.fileLength; - else - object.fileLength = options.longs === String ? $util.Long.prototype.toString.call(message.fileLength) : options.longs === Number ? new $util.LongBits(message.fileLength.low >>> 0, message.fileLength.high >>> 0).toNumber(true) : message.fileLength; - if (message.seconds != null && message.hasOwnProperty("seconds")) - object.seconds = message.seconds; - if (message.ptt != null && message.hasOwnProperty("ptt")) - object.ptt = message.ptt; - if (message.mediaKey != null && message.hasOwnProperty("mediaKey")) - object.mediaKey = options.bytes === String ? $util.base64.encode(message.mediaKey, 0, message.mediaKey.length) : options.bytes === Array ? Array.prototype.slice.call(message.mediaKey) : message.mediaKey; - if (message.fileEncSha256 != null && message.hasOwnProperty("fileEncSha256")) - object.fileEncSha256 = options.bytes === String ? $util.base64.encode(message.fileEncSha256, 0, message.fileEncSha256.length) : options.bytes === Array ? Array.prototype.slice.call(message.fileEncSha256) : message.fileEncSha256; - if (message.directPath != null && message.hasOwnProperty("directPath")) - object.directPath = message.directPath; - if (message.mediaKeyTimestamp != null && message.hasOwnProperty("mediaKeyTimestamp")) - if (typeof message.mediaKeyTimestamp === "number") - object.mediaKeyTimestamp = options.longs === String ? String(message.mediaKeyTimestamp) : message.mediaKeyTimestamp; - else - object.mediaKeyTimestamp = options.longs === String ? $util.Long.prototype.toString.call(message.mediaKeyTimestamp) : options.longs === Number ? new $util.LongBits(message.mediaKeyTimestamp.low >>> 0, message.mediaKeyTimestamp.high >>> 0).toNumber() : message.mediaKeyTimestamp; - if (message.contextInfo != null && message.hasOwnProperty("contextInfo")) - object.contextInfo = $root.proto.ContextInfo.toObject(message.contextInfo, options); - if (message.streamingSidecar != null && message.hasOwnProperty("streamingSidecar")) - object.streamingSidecar = options.bytes === String ? $util.base64.encode(message.streamingSidecar, 0, message.streamingSidecar.length) : options.bytes === Array ? Array.prototype.slice.call(message.streamingSidecar) : message.streamingSidecar; - if (message.waveform != null && message.hasOwnProperty("waveform")) - object.waveform = options.bytes === String ? $util.base64.encode(message.waveform, 0, message.waveform.length) : options.bytes === Array ? Array.prototype.slice.call(message.waveform) : message.waveform; + if (options.defaults) + object.productId = ""; + if (message.productId != null && message.hasOwnProperty("productId")) + object.productId = message.productId; return object; }; /** - * Converts this AudioMessage to JSON. + * Converts this Product to JSON. * @function toJSON - * @memberof proto.AudioMessage + * @memberof proto.Product * @instance * @returns {Object.} JSON object */ - AudioMessage.prototype.toJSON = function toJSON() { + Product.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return AudioMessage; + return Product; })(); - proto.VideoMessage = (function() { + proto.ProductListHeaderImage = (function() { /** - * Properties of a VideoMessage. + * Properties of a ProductListHeaderImage. * @memberof proto - * @interface IVideoMessage - * @property {string|null} [url] VideoMessage url - * @property {string|null} [mimetype] VideoMessage mimetype - * @property {Uint8Array|null} [fileSha256] VideoMessage fileSha256 - * @property {number|Long|null} [fileLength] VideoMessage fileLength - * @property {number|null} [seconds] VideoMessage seconds - * @property {Uint8Array|null} [mediaKey] VideoMessage mediaKey - * @property {string|null} [caption] VideoMessage caption - * @property {boolean|null} [gifPlayback] VideoMessage gifPlayback - * @property {number|null} [height] VideoMessage height - * @property {number|null} [width] VideoMessage width - * @property {Uint8Array|null} [fileEncSha256] VideoMessage fileEncSha256 - * @property {Array.|null} [interactiveAnnotations] VideoMessage interactiveAnnotations - * @property {string|null} [directPath] VideoMessage directPath - * @property {number|Long|null} [mediaKeyTimestamp] VideoMessage mediaKeyTimestamp - * @property {Uint8Array|null} [jpegThumbnail] VideoMessage jpegThumbnail - * @property {proto.IContextInfo|null} [contextInfo] VideoMessage contextInfo - * @property {Uint8Array|null} [streamingSidecar] VideoMessage streamingSidecar - * @property {proto.VideoMessage.VideoMessageAttribution|null} [gifAttribution] VideoMessage gifAttribution - * @property {boolean|null} [viewOnce] VideoMessage viewOnce - * @property {string|null} [thumbnailDirectPath] VideoMessage thumbnailDirectPath - * @property {Uint8Array|null} [thumbnailSha256] VideoMessage thumbnailSha256 - * @property {Uint8Array|null} [thumbnailEncSha256] VideoMessage thumbnailEncSha256 - * @property {string|null} [staticUrl] VideoMessage staticUrl + * @interface IProductListHeaderImage + * @property {string|null} [productId] ProductListHeaderImage productId + * @property {Uint8Array|null} [jpegThumbnail] ProductListHeaderImage jpegThumbnail */ /** - * Constructs a new VideoMessage. + * Constructs a new ProductListHeaderImage. * @memberof proto - * @classdesc Represents a VideoMessage. - * @implements IVideoMessage + * @classdesc Represents a ProductListHeaderImage. + * @implements IProductListHeaderImage * @constructor - * @param {proto.IVideoMessage=} [properties] Properties to set + * @param {proto.IProductListHeaderImage=} [properties] Properties to set */ - function VideoMessage(properties) { - this.interactiveAnnotations = []; + function ProductListHeaderImage(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -27192,364 +27113,325 @@ $root.proto = (function() { } /** - * VideoMessage url. - * @member {string} url - * @memberof proto.VideoMessage + * ProductListHeaderImage productId. + * @member {string} productId + * @memberof proto.ProductListHeaderImage * @instance */ - VideoMessage.prototype.url = ""; + ProductListHeaderImage.prototype.productId = ""; /** - * VideoMessage mimetype. - * @member {string} mimetype - * @memberof proto.VideoMessage + * ProductListHeaderImage jpegThumbnail. + * @member {Uint8Array} jpegThumbnail + * @memberof proto.ProductListHeaderImage * @instance */ - VideoMessage.prototype.mimetype = ""; + ProductListHeaderImage.prototype.jpegThumbnail = $util.newBuffer([]); /** - * VideoMessage fileSha256. - * @member {Uint8Array} fileSha256 - * @memberof proto.VideoMessage - * @instance + * Creates a new ProductListHeaderImage instance using the specified properties. + * @function create + * @memberof proto.ProductListHeaderImage + * @static + * @param {proto.IProductListHeaderImage=} [properties] Properties to set + * @returns {proto.ProductListHeaderImage} ProductListHeaderImage instance */ - VideoMessage.prototype.fileSha256 = $util.newBuffer([]); + ProductListHeaderImage.create = function create(properties) { + return new ProductListHeaderImage(properties); + }; /** - * VideoMessage fileLength. - * @member {number|Long} fileLength - * @memberof proto.VideoMessage - * @instance - */ - VideoMessage.prototype.fileLength = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * VideoMessage seconds. - * @member {number} seconds - * @memberof proto.VideoMessage - * @instance - */ - VideoMessage.prototype.seconds = 0; - - /** - * VideoMessage mediaKey. - * @member {Uint8Array} mediaKey - * @memberof proto.VideoMessage - * @instance - */ - VideoMessage.prototype.mediaKey = $util.newBuffer([]); - - /** - * VideoMessage caption. - * @member {string} caption - * @memberof proto.VideoMessage - * @instance - */ - VideoMessage.prototype.caption = ""; - - /** - * VideoMessage gifPlayback. - * @member {boolean} gifPlayback - * @memberof proto.VideoMessage - * @instance - */ - VideoMessage.prototype.gifPlayback = false; - - /** - * VideoMessage height. - * @member {number} height - * @memberof proto.VideoMessage - * @instance + * Encodes the specified ProductListHeaderImage message. Does not implicitly {@link proto.ProductListHeaderImage.verify|verify} messages. + * @function encode + * @memberof proto.ProductListHeaderImage + * @static + * @param {proto.IProductListHeaderImage} message ProductListHeaderImage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - VideoMessage.prototype.height = 0; + ProductListHeaderImage.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.productId != null && Object.hasOwnProperty.call(message, "productId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.productId); + if (message.jpegThumbnail != null && Object.hasOwnProperty.call(message, "jpegThumbnail")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.jpegThumbnail); + return writer; + }; /** - * VideoMessage width. - * @member {number} width - * @memberof proto.VideoMessage - * @instance + * Encodes the specified ProductListHeaderImage message, length delimited. Does not implicitly {@link proto.ProductListHeaderImage.verify|verify} messages. + * @function encodeDelimited + * @memberof proto.ProductListHeaderImage + * @static + * @param {proto.IProductListHeaderImage} message ProductListHeaderImage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - VideoMessage.prototype.width = 0; + ProductListHeaderImage.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; /** - * VideoMessage fileEncSha256. - * @member {Uint8Array} fileEncSha256 - * @memberof proto.VideoMessage - * @instance + * Decodes a ProductListHeaderImage message from the specified reader or buffer. + * @function decode + * @memberof proto.ProductListHeaderImage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {proto.ProductListHeaderImage} ProductListHeaderImage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - VideoMessage.prototype.fileEncSha256 = $util.newBuffer([]); + ProductListHeaderImage.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.ProductListHeaderImage(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.productId = reader.string(); + break; + case 2: + message.jpegThumbnail = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; /** - * VideoMessage interactiveAnnotations. - * @member {Array.} interactiveAnnotations - * @memberof proto.VideoMessage - * @instance + * Decodes a ProductListHeaderImage message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof proto.ProductListHeaderImage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {proto.ProductListHeaderImage} ProductListHeaderImage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - VideoMessage.prototype.interactiveAnnotations = $util.emptyArray; + ProductListHeaderImage.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; /** - * VideoMessage directPath. - * @member {string} directPath - * @memberof proto.VideoMessage - * @instance + * Verifies a ProductListHeaderImage message. + * @function verify + * @memberof proto.ProductListHeaderImage + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - VideoMessage.prototype.directPath = ""; + ProductListHeaderImage.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.productId != null && message.hasOwnProperty("productId")) + if (!$util.isString(message.productId)) + return "productId: string expected"; + if (message.jpegThumbnail != null && message.hasOwnProperty("jpegThumbnail")) + if (!(message.jpegThumbnail && typeof message.jpegThumbnail.length === "number" || $util.isString(message.jpegThumbnail))) + return "jpegThumbnail: buffer expected"; + return null; + }; /** - * VideoMessage mediaKeyTimestamp. - * @member {number|Long} mediaKeyTimestamp - * @memberof proto.VideoMessage - * @instance + * Creates a ProductListHeaderImage message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof proto.ProductListHeaderImage + * @static + * @param {Object.} object Plain object + * @returns {proto.ProductListHeaderImage} ProductListHeaderImage */ - VideoMessage.prototype.mediaKeyTimestamp = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + ProductListHeaderImage.fromObject = function fromObject(object) { + if (object instanceof $root.proto.ProductListHeaderImage) + return object; + var message = new $root.proto.ProductListHeaderImage(); + if (object.productId != null) + message.productId = String(object.productId); + if (object.jpegThumbnail != null) + if (typeof object.jpegThumbnail === "string") + $util.base64.decode(object.jpegThumbnail, message.jpegThumbnail = $util.newBuffer($util.base64.length(object.jpegThumbnail)), 0); + else if (object.jpegThumbnail.length) + message.jpegThumbnail = object.jpegThumbnail; + return message; + }; /** - * VideoMessage jpegThumbnail. - * @member {Uint8Array} jpegThumbnail - * @memberof proto.VideoMessage - * @instance + * Creates a plain object from a ProductListHeaderImage message. Also converts values to other types if specified. + * @function toObject + * @memberof proto.ProductListHeaderImage + * @static + * @param {proto.ProductListHeaderImage} message ProductListHeaderImage + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object */ - VideoMessage.prototype.jpegThumbnail = $util.newBuffer([]); + ProductListHeaderImage.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.productId = ""; + if (options.bytes === String) + object.jpegThumbnail = ""; + else { + object.jpegThumbnail = []; + if (options.bytes !== Array) + object.jpegThumbnail = $util.newBuffer(object.jpegThumbnail); + } + } + if (message.productId != null && message.hasOwnProperty("productId")) + object.productId = message.productId; + if (message.jpegThumbnail != null && message.hasOwnProperty("jpegThumbnail")) + object.jpegThumbnail = options.bytes === String ? $util.base64.encode(message.jpegThumbnail, 0, message.jpegThumbnail.length) : options.bytes === Array ? Array.prototype.slice.call(message.jpegThumbnail) : message.jpegThumbnail; + return object; + }; /** - * VideoMessage contextInfo. - * @member {proto.IContextInfo|null|undefined} contextInfo - * @memberof proto.VideoMessage + * Converts this ProductListHeaderImage to JSON. + * @function toJSON + * @memberof proto.ProductListHeaderImage * @instance + * @returns {Object.} JSON object */ - VideoMessage.prototype.contextInfo = null; + ProductListHeaderImage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * VideoMessage streamingSidecar. - * @member {Uint8Array} streamingSidecar - * @memberof proto.VideoMessage - * @instance - */ - VideoMessage.prototype.streamingSidecar = $util.newBuffer([]); + return ProductListHeaderImage; + })(); - /** - * VideoMessage gifAttribution. - * @member {proto.VideoMessage.VideoMessageAttribution} gifAttribution - * @memberof proto.VideoMessage - * @instance - */ - VideoMessage.prototype.gifAttribution = 0; + proto.ProductListInfo = (function() { /** - * VideoMessage viewOnce. - * @member {boolean} viewOnce - * @memberof proto.VideoMessage - * @instance + * Properties of a ProductListInfo. + * @memberof proto + * @interface IProductListInfo + * @property {Array.|null} [productSections] ProductListInfo productSections + * @property {proto.IProductListHeaderImage|null} [headerImage] ProductListInfo headerImage + * @property {string|null} [businessOwnerJid] ProductListInfo businessOwnerJid */ - VideoMessage.prototype.viewOnce = false; /** - * VideoMessage thumbnailDirectPath. - * @member {string} thumbnailDirectPath - * @memberof proto.VideoMessage - * @instance + * Constructs a new ProductListInfo. + * @memberof proto + * @classdesc Represents a ProductListInfo. + * @implements IProductListInfo + * @constructor + * @param {proto.IProductListInfo=} [properties] Properties to set */ - VideoMessage.prototype.thumbnailDirectPath = ""; + function ProductListInfo(properties) { + this.productSections = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } /** - * VideoMessage thumbnailSha256. - * @member {Uint8Array} thumbnailSha256 - * @memberof proto.VideoMessage + * ProductListInfo productSections. + * @member {Array.} productSections + * @memberof proto.ProductListInfo * @instance */ - VideoMessage.prototype.thumbnailSha256 = $util.newBuffer([]); + ProductListInfo.prototype.productSections = $util.emptyArray; /** - * VideoMessage thumbnailEncSha256. - * @member {Uint8Array} thumbnailEncSha256 - * @memberof proto.VideoMessage + * ProductListInfo headerImage. + * @member {proto.IProductListHeaderImage|null|undefined} headerImage + * @memberof proto.ProductListInfo * @instance */ - VideoMessage.prototype.thumbnailEncSha256 = $util.newBuffer([]); + ProductListInfo.prototype.headerImage = null; /** - * VideoMessage staticUrl. - * @member {string} staticUrl - * @memberof proto.VideoMessage + * ProductListInfo businessOwnerJid. + * @member {string} businessOwnerJid + * @memberof proto.ProductListInfo * @instance */ - VideoMessage.prototype.staticUrl = ""; + ProductListInfo.prototype.businessOwnerJid = ""; /** - * Creates a new VideoMessage instance using the specified properties. + * Creates a new ProductListInfo instance using the specified properties. * @function create - * @memberof proto.VideoMessage + * @memberof proto.ProductListInfo * @static - * @param {proto.IVideoMessage=} [properties] Properties to set - * @returns {proto.VideoMessage} VideoMessage instance + * @param {proto.IProductListInfo=} [properties] Properties to set + * @returns {proto.ProductListInfo} ProductListInfo instance */ - VideoMessage.create = function create(properties) { - return new VideoMessage(properties); + ProductListInfo.create = function create(properties) { + return new ProductListInfo(properties); }; /** - * Encodes the specified VideoMessage message. Does not implicitly {@link proto.VideoMessage.verify|verify} messages. + * Encodes the specified ProductListInfo message. Does not implicitly {@link proto.ProductListInfo.verify|verify} messages. * @function encode - * @memberof proto.VideoMessage + * @memberof proto.ProductListInfo * @static - * @param {proto.IVideoMessage} message VideoMessage message or plain object to encode + * @param {proto.IProductListInfo} message ProductListInfo message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - VideoMessage.encode = function encode(message, writer) { + ProductListInfo.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.url != null && Object.hasOwnProperty.call(message, "url")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.url); - if (message.mimetype != null && Object.hasOwnProperty.call(message, "mimetype")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.mimetype); - if (message.fileSha256 != null && Object.hasOwnProperty.call(message, "fileSha256")) - writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.fileSha256); - if (message.fileLength != null && Object.hasOwnProperty.call(message, "fileLength")) - writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.fileLength); - if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) - writer.uint32(/* id 5, wireType 0 =*/40).uint32(message.seconds); - if (message.mediaKey != null && Object.hasOwnProperty.call(message, "mediaKey")) - writer.uint32(/* id 6, wireType 2 =*/50).bytes(message.mediaKey); - if (message.caption != null && Object.hasOwnProperty.call(message, "caption")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.caption); - if (message.gifPlayback != null && Object.hasOwnProperty.call(message, "gifPlayback")) - writer.uint32(/* id 8, wireType 0 =*/64).bool(message.gifPlayback); - if (message.height != null && Object.hasOwnProperty.call(message, "height")) - writer.uint32(/* id 9, wireType 0 =*/72).uint32(message.height); - if (message.width != null && Object.hasOwnProperty.call(message, "width")) - writer.uint32(/* id 10, wireType 0 =*/80).uint32(message.width); - if (message.fileEncSha256 != null && Object.hasOwnProperty.call(message, "fileEncSha256")) - writer.uint32(/* id 11, wireType 2 =*/90).bytes(message.fileEncSha256); - if (message.interactiveAnnotations != null && message.interactiveAnnotations.length) - for (var i = 0; i < message.interactiveAnnotations.length; ++i) - $root.proto.InteractiveAnnotation.encode(message.interactiveAnnotations[i], writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); - if (message.directPath != null && Object.hasOwnProperty.call(message, "directPath")) - writer.uint32(/* id 13, wireType 2 =*/106).string(message.directPath); - if (message.mediaKeyTimestamp != null && Object.hasOwnProperty.call(message, "mediaKeyTimestamp")) - writer.uint32(/* id 14, wireType 0 =*/112).int64(message.mediaKeyTimestamp); - if (message.jpegThumbnail != null && Object.hasOwnProperty.call(message, "jpegThumbnail")) - writer.uint32(/* id 16, wireType 2 =*/130).bytes(message.jpegThumbnail); - if (message.contextInfo != null && Object.hasOwnProperty.call(message, "contextInfo")) - $root.proto.ContextInfo.encode(message.contextInfo, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); - if (message.streamingSidecar != null && Object.hasOwnProperty.call(message, "streamingSidecar")) - writer.uint32(/* id 18, wireType 2 =*/146).bytes(message.streamingSidecar); - if (message.gifAttribution != null && Object.hasOwnProperty.call(message, "gifAttribution")) - writer.uint32(/* id 19, wireType 0 =*/152).int32(message.gifAttribution); - if (message.viewOnce != null && Object.hasOwnProperty.call(message, "viewOnce")) - writer.uint32(/* id 20, wireType 0 =*/160).bool(message.viewOnce); - if (message.thumbnailDirectPath != null && Object.hasOwnProperty.call(message, "thumbnailDirectPath")) - writer.uint32(/* id 21, wireType 2 =*/170).string(message.thumbnailDirectPath); - if (message.thumbnailSha256 != null && Object.hasOwnProperty.call(message, "thumbnailSha256")) - writer.uint32(/* id 22, wireType 2 =*/178).bytes(message.thumbnailSha256); - if (message.thumbnailEncSha256 != null && Object.hasOwnProperty.call(message, "thumbnailEncSha256")) - writer.uint32(/* id 23, wireType 2 =*/186).bytes(message.thumbnailEncSha256); - if (message.staticUrl != null && Object.hasOwnProperty.call(message, "staticUrl")) - writer.uint32(/* id 24, wireType 2 =*/194).string(message.staticUrl); + if (message.productSections != null && message.productSections.length) + for (var i = 0; i < message.productSections.length; ++i) + $root.proto.ProductSection.encode(message.productSections[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.headerImage != null && Object.hasOwnProperty.call(message, "headerImage")) + $root.proto.ProductListHeaderImage.encode(message.headerImage, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.businessOwnerJid != null && Object.hasOwnProperty.call(message, "businessOwnerJid")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.businessOwnerJid); return writer; }; /** - * Encodes the specified VideoMessage message, length delimited. Does not implicitly {@link proto.VideoMessage.verify|verify} messages. + * Encodes the specified ProductListInfo message, length delimited. Does not implicitly {@link proto.ProductListInfo.verify|verify} messages. * @function encodeDelimited - * @memberof proto.VideoMessage + * @memberof proto.ProductListInfo * @static - * @param {proto.IVideoMessage} message VideoMessage message or plain object to encode + * @param {proto.IProductListInfo} message ProductListInfo message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - VideoMessage.encodeDelimited = function encodeDelimited(message, writer) { + ProductListInfo.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a VideoMessage message from the specified reader or buffer. + * Decodes a ProductListInfo message from the specified reader or buffer. * @function decode - * @memberof proto.VideoMessage + * @memberof proto.ProductListInfo * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {proto.VideoMessage} VideoMessage + * @returns {proto.ProductListInfo} ProductListInfo * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - VideoMessage.decode = function decode(reader, length) { + ProductListInfo.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.VideoMessage(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.ProductListInfo(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.url = reader.string(); + if (!(message.productSections && message.productSections.length)) + message.productSections = []; + message.productSections.push($root.proto.ProductSection.decode(reader, reader.uint32())); break; case 2: - message.mimetype = reader.string(); + message.headerImage = $root.proto.ProductListHeaderImage.decode(reader, reader.uint32()); break; case 3: - message.fileSha256 = reader.bytes(); - break; - case 4: - message.fileLength = reader.uint64(); - break; - case 5: - message.seconds = reader.uint32(); - break; - case 6: - message.mediaKey = reader.bytes(); - break; - case 7: - message.caption = reader.string(); - break; - case 8: - message.gifPlayback = reader.bool(); - break; - case 9: - message.height = reader.uint32(); - break; - case 10: - message.width = reader.uint32(); - break; - case 11: - message.fileEncSha256 = reader.bytes(); - break; - case 12: - if (!(message.interactiveAnnotations && message.interactiveAnnotations.length)) - message.interactiveAnnotations = []; - message.interactiveAnnotations.push($root.proto.InteractiveAnnotation.decode(reader, reader.uint32())); - break; - case 13: - message.directPath = reader.string(); - break; - case 14: - message.mediaKeyTimestamp = reader.int64(); - break; - case 16: - message.jpegThumbnail = reader.bytes(); - break; - case 17: - message.contextInfo = $root.proto.ContextInfo.decode(reader, reader.uint32()); - break; - case 18: - message.streamingSidecar = reader.bytes(); - break; - case 19: - message.gifAttribution = reader.int32(); - break; - case 20: - message.viewOnce = reader.bool(); - break; - case 21: - message.thumbnailDirectPath = reader.string(); - break; - case 22: - message.thumbnailSha256 = reader.bytes(); - break; - case 23: - message.thumbnailEncSha256 = reader.bytes(); - break; - case 24: - message.staticUrl = reader.string(); + message.businessOwnerJid = reader.string(); break; default: reader.skipType(tag & 7); @@ -27560,435 +27442,152 @@ $root.proto = (function() { }; /** - * Decodes a VideoMessage message from the specified reader or buffer, length delimited. + * Decodes a ProductListInfo message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof proto.VideoMessage + * @memberof proto.ProductListInfo * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.VideoMessage} VideoMessage + * @returns {proto.ProductListInfo} ProductListInfo * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - VideoMessage.decodeDelimited = function decodeDelimited(reader) { + ProductListInfo.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a VideoMessage message. + * Verifies a ProductListInfo message. * @function verify - * @memberof proto.VideoMessage + * @memberof proto.ProductListInfo * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - VideoMessage.verify = function verify(message) { + ProductListInfo.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.url != null && message.hasOwnProperty("url")) - if (!$util.isString(message.url)) - return "url: string expected"; - if (message.mimetype != null && message.hasOwnProperty("mimetype")) - if (!$util.isString(message.mimetype)) - return "mimetype: string expected"; - if (message.fileSha256 != null && message.hasOwnProperty("fileSha256")) - if (!(message.fileSha256 && typeof message.fileSha256.length === "number" || $util.isString(message.fileSha256))) - return "fileSha256: buffer expected"; - if (message.fileLength != null && message.hasOwnProperty("fileLength")) - if (!$util.isInteger(message.fileLength) && !(message.fileLength && $util.isInteger(message.fileLength.low) && $util.isInteger(message.fileLength.high))) - return "fileLength: integer|Long expected"; - if (message.seconds != null && message.hasOwnProperty("seconds")) - if (!$util.isInteger(message.seconds)) - return "seconds: integer expected"; - if (message.mediaKey != null && message.hasOwnProperty("mediaKey")) - if (!(message.mediaKey && typeof message.mediaKey.length === "number" || $util.isString(message.mediaKey))) - return "mediaKey: buffer expected"; - if (message.caption != null && message.hasOwnProperty("caption")) - if (!$util.isString(message.caption)) - return "caption: string expected"; - if (message.gifPlayback != null && message.hasOwnProperty("gifPlayback")) - if (typeof message.gifPlayback !== "boolean") - return "gifPlayback: boolean expected"; - if (message.height != null && message.hasOwnProperty("height")) - if (!$util.isInteger(message.height)) - return "height: integer expected"; - if (message.width != null && message.hasOwnProperty("width")) - if (!$util.isInteger(message.width)) - return "width: integer expected"; - if (message.fileEncSha256 != null && message.hasOwnProperty("fileEncSha256")) - if (!(message.fileEncSha256 && typeof message.fileEncSha256.length === "number" || $util.isString(message.fileEncSha256))) - return "fileEncSha256: buffer expected"; - if (message.interactiveAnnotations != null && message.hasOwnProperty("interactiveAnnotations")) { - if (!Array.isArray(message.interactiveAnnotations)) - return "interactiveAnnotations: array expected"; - for (var i = 0; i < message.interactiveAnnotations.length; ++i) { - var error = $root.proto.InteractiveAnnotation.verify(message.interactiveAnnotations[i]); + if (message.productSections != null && message.hasOwnProperty("productSections")) { + if (!Array.isArray(message.productSections)) + return "productSections: array expected"; + for (var i = 0; i < message.productSections.length; ++i) { + var error = $root.proto.ProductSection.verify(message.productSections[i]); if (error) - return "interactiveAnnotations." + error; + return "productSections." + error; } } - if (message.directPath != null && message.hasOwnProperty("directPath")) - if (!$util.isString(message.directPath)) - return "directPath: string expected"; - if (message.mediaKeyTimestamp != null && message.hasOwnProperty("mediaKeyTimestamp")) - if (!$util.isInteger(message.mediaKeyTimestamp) && !(message.mediaKeyTimestamp && $util.isInteger(message.mediaKeyTimestamp.low) && $util.isInteger(message.mediaKeyTimestamp.high))) - return "mediaKeyTimestamp: integer|Long expected"; - if (message.jpegThumbnail != null && message.hasOwnProperty("jpegThumbnail")) - if (!(message.jpegThumbnail && typeof message.jpegThumbnail.length === "number" || $util.isString(message.jpegThumbnail))) - return "jpegThumbnail: buffer expected"; - if (message.contextInfo != null && message.hasOwnProperty("contextInfo")) { - var error = $root.proto.ContextInfo.verify(message.contextInfo); + if (message.headerImage != null && message.hasOwnProperty("headerImage")) { + var error = $root.proto.ProductListHeaderImage.verify(message.headerImage); if (error) - return "contextInfo." + error; + return "headerImage." + error; } - if (message.streamingSidecar != null && message.hasOwnProperty("streamingSidecar")) - if (!(message.streamingSidecar && typeof message.streamingSidecar.length === "number" || $util.isString(message.streamingSidecar))) - return "streamingSidecar: buffer expected"; - if (message.gifAttribution != null && message.hasOwnProperty("gifAttribution")) - switch (message.gifAttribution) { - default: - return "gifAttribution: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.viewOnce != null && message.hasOwnProperty("viewOnce")) - if (typeof message.viewOnce !== "boolean") - return "viewOnce: boolean expected"; - if (message.thumbnailDirectPath != null && message.hasOwnProperty("thumbnailDirectPath")) - if (!$util.isString(message.thumbnailDirectPath)) - return "thumbnailDirectPath: string expected"; - if (message.thumbnailSha256 != null && message.hasOwnProperty("thumbnailSha256")) - if (!(message.thumbnailSha256 && typeof message.thumbnailSha256.length === "number" || $util.isString(message.thumbnailSha256))) - return "thumbnailSha256: buffer expected"; - if (message.thumbnailEncSha256 != null && message.hasOwnProperty("thumbnailEncSha256")) - if (!(message.thumbnailEncSha256 && typeof message.thumbnailEncSha256.length === "number" || $util.isString(message.thumbnailEncSha256))) - return "thumbnailEncSha256: buffer expected"; - if (message.staticUrl != null && message.hasOwnProperty("staticUrl")) - if (!$util.isString(message.staticUrl)) - return "staticUrl: string expected"; + if (message.businessOwnerJid != null && message.hasOwnProperty("businessOwnerJid")) + if (!$util.isString(message.businessOwnerJid)) + return "businessOwnerJid: string expected"; return null; }; /** - * Creates a VideoMessage message from a plain object. Also converts values to their respective internal types. + * Creates a ProductListInfo message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof proto.VideoMessage + * @memberof proto.ProductListInfo * @static * @param {Object.} object Plain object - * @returns {proto.VideoMessage} VideoMessage + * @returns {proto.ProductListInfo} ProductListInfo */ - VideoMessage.fromObject = function fromObject(object) { - if (object instanceof $root.proto.VideoMessage) + ProductListInfo.fromObject = function fromObject(object) { + if (object instanceof $root.proto.ProductListInfo) return object; - var message = new $root.proto.VideoMessage(); - if (object.url != null) - message.url = String(object.url); - if (object.mimetype != null) - message.mimetype = String(object.mimetype); - if (object.fileSha256 != null) - if (typeof object.fileSha256 === "string") - $util.base64.decode(object.fileSha256, message.fileSha256 = $util.newBuffer($util.base64.length(object.fileSha256)), 0); - else if (object.fileSha256.length) - message.fileSha256 = object.fileSha256; - if (object.fileLength != null) - if ($util.Long) - (message.fileLength = $util.Long.fromValue(object.fileLength)).unsigned = true; - else if (typeof object.fileLength === "string") - message.fileLength = parseInt(object.fileLength, 10); - else if (typeof object.fileLength === "number") - message.fileLength = object.fileLength; - else if (typeof object.fileLength === "object") - message.fileLength = new $util.LongBits(object.fileLength.low >>> 0, object.fileLength.high >>> 0).toNumber(true); - if (object.seconds != null) - message.seconds = object.seconds >>> 0; - if (object.mediaKey != null) - if (typeof object.mediaKey === "string") - $util.base64.decode(object.mediaKey, message.mediaKey = $util.newBuffer($util.base64.length(object.mediaKey)), 0); - else if (object.mediaKey.length) - message.mediaKey = object.mediaKey; - if (object.caption != null) - message.caption = String(object.caption); - if (object.gifPlayback != null) - message.gifPlayback = Boolean(object.gifPlayback); - if (object.height != null) - message.height = object.height >>> 0; - if (object.width != null) - message.width = object.width >>> 0; - if (object.fileEncSha256 != null) - if (typeof object.fileEncSha256 === "string") - $util.base64.decode(object.fileEncSha256, message.fileEncSha256 = $util.newBuffer($util.base64.length(object.fileEncSha256)), 0); - else if (object.fileEncSha256.length) - message.fileEncSha256 = object.fileEncSha256; - if (object.interactiveAnnotations) { - if (!Array.isArray(object.interactiveAnnotations)) - throw TypeError(".proto.VideoMessage.interactiveAnnotations: array expected"); - message.interactiveAnnotations = []; - for (var i = 0; i < object.interactiveAnnotations.length; ++i) { - if (typeof object.interactiveAnnotations[i] !== "object") - throw TypeError(".proto.VideoMessage.interactiveAnnotations: object expected"); - message.interactiveAnnotations[i] = $root.proto.InteractiveAnnotation.fromObject(object.interactiveAnnotations[i]); + var message = new $root.proto.ProductListInfo(); + if (object.productSections) { + if (!Array.isArray(object.productSections)) + throw TypeError(".proto.ProductListInfo.productSections: array expected"); + message.productSections = []; + for (var i = 0; i < object.productSections.length; ++i) { + if (typeof object.productSections[i] !== "object") + throw TypeError(".proto.ProductListInfo.productSections: object expected"); + message.productSections[i] = $root.proto.ProductSection.fromObject(object.productSections[i]); } } - if (object.directPath != null) - message.directPath = String(object.directPath); - if (object.mediaKeyTimestamp != null) - if ($util.Long) - (message.mediaKeyTimestamp = $util.Long.fromValue(object.mediaKeyTimestamp)).unsigned = false; - else if (typeof object.mediaKeyTimestamp === "string") - message.mediaKeyTimestamp = parseInt(object.mediaKeyTimestamp, 10); - else if (typeof object.mediaKeyTimestamp === "number") - message.mediaKeyTimestamp = object.mediaKeyTimestamp; - else if (typeof object.mediaKeyTimestamp === "object") - message.mediaKeyTimestamp = new $util.LongBits(object.mediaKeyTimestamp.low >>> 0, object.mediaKeyTimestamp.high >>> 0).toNumber(); - if (object.jpegThumbnail != null) - if (typeof object.jpegThumbnail === "string") - $util.base64.decode(object.jpegThumbnail, message.jpegThumbnail = $util.newBuffer($util.base64.length(object.jpegThumbnail)), 0); - else if (object.jpegThumbnail.length) - message.jpegThumbnail = object.jpegThumbnail; - if (object.contextInfo != null) { - if (typeof object.contextInfo !== "object") - throw TypeError(".proto.VideoMessage.contextInfo: object expected"); - message.contextInfo = $root.proto.ContextInfo.fromObject(object.contextInfo); - } - if (object.streamingSidecar != null) - if (typeof object.streamingSidecar === "string") - $util.base64.decode(object.streamingSidecar, message.streamingSidecar = $util.newBuffer($util.base64.length(object.streamingSidecar)), 0); - else if (object.streamingSidecar.length) - message.streamingSidecar = object.streamingSidecar; - switch (object.gifAttribution) { - case "NONE": - case 0: - message.gifAttribution = 0; - break; - case "GIPHY": - case 1: - message.gifAttribution = 1; - break; - case "TENOR": - case 2: - message.gifAttribution = 2; - break; + if (object.headerImage != null) { + if (typeof object.headerImage !== "object") + throw TypeError(".proto.ProductListInfo.headerImage: object expected"); + message.headerImage = $root.proto.ProductListHeaderImage.fromObject(object.headerImage); } - if (object.viewOnce != null) - message.viewOnce = Boolean(object.viewOnce); - if (object.thumbnailDirectPath != null) - message.thumbnailDirectPath = String(object.thumbnailDirectPath); - if (object.thumbnailSha256 != null) - if (typeof object.thumbnailSha256 === "string") - $util.base64.decode(object.thumbnailSha256, message.thumbnailSha256 = $util.newBuffer($util.base64.length(object.thumbnailSha256)), 0); - else if (object.thumbnailSha256.length) - message.thumbnailSha256 = object.thumbnailSha256; - if (object.thumbnailEncSha256 != null) - if (typeof object.thumbnailEncSha256 === "string") - $util.base64.decode(object.thumbnailEncSha256, message.thumbnailEncSha256 = $util.newBuffer($util.base64.length(object.thumbnailEncSha256)), 0); - else if (object.thumbnailEncSha256.length) - message.thumbnailEncSha256 = object.thumbnailEncSha256; - if (object.staticUrl != null) - message.staticUrl = String(object.staticUrl); + if (object.businessOwnerJid != null) + message.businessOwnerJid = String(object.businessOwnerJid); return message; }; /** - * Creates a plain object from a VideoMessage message. Also converts values to other types if specified. + * Creates a plain object from a ProductListInfo message. Also converts values to other types if specified. * @function toObject - * @memberof proto.VideoMessage + * @memberof proto.ProductListInfo * @static - * @param {proto.VideoMessage} message VideoMessage + * @param {proto.ProductListInfo} message ProductListInfo * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - VideoMessage.toObject = function toObject(message, options) { + ProductListInfo.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) - object.interactiveAnnotations = []; + object.productSections = []; if (options.defaults) { - object.url = ""; - object.mimetype = ""; - if (options.bytes === String) - object.fileSha256 = ""; - else { - object.fileSha256 = []; - if (options.bytes !== Array) - object.fileSha256 = $util.newBuffer(object.fileSha256); - } - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.fileLength = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.fileLength = options.longs === String ? "0" : 0; - object.seconds = 0; - if (options.bytes === String) - object.mediaKey = ""; - else { - object.mediaKey = []; - if (options.bytes !== Array) - object.mediaKey = $util.newBuffer(object.mediaKey); - } - object.caption = ""; - object.gifPlayback = false; - object.height = 0; - object.width = 0; - if (options.bytes === String) - object.fileEncSha256 = ""; - else { - object.fileEncSha256 = []; - if (options.bytes !== Array) - object.fileEncSha256 = $util.newBuffer(object.fileEncSha256); - } - object.directPath = ""; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.mediaKeyTimestamp = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.mediaKeyTimestamp = options.longs === String ? "0" : 0; - if (options.bytes === String) - object.jpegThumbnail = ""; - else { - object.jpegThumbnail = []; - if (options.bytes !== Array) - object.jpegThumbnail = $util.newBuffer(object.jpegThumbnail); - } - object.contextInfo = null; - if (options.bytes === String) - object.streamingSidecar = ""; - else { - object.streamingSidecar = []; - if (options.bytes !== Array) - object.streamingSidecar = $util.newBuffer(object.streamingSidecar); - } - object.gifAttribution = options.enums === String ? "NONE" : 0; - object.viewOnce = false; - object.thumbnailDirectPath = ""; - if (options.bytes === String) - object.thumbnailSha256 = ""; - else { - object.thumbnailSha256 = []; - if (options.bytes !== Array) - object.thumbnailSha256 = $util.newBuffer(object.thumbnailSha256); - } - if (options.bytes === String) - object.thumbnailEncSha256 = ""; - else { - object.thumbnailEncSha256 = []; - if (options.bytes !== Array) - object.thumbnailEncSha256 = $util.newBuffer(object.thumbnailEncSha256); - } - object.staticUrl = ""; + object.headerImage = null; + object.businessOwnerJid = ""; } - if (message.url != null && message.hasOwnProperty("url")) - object.url = message.url; - if (message.mimetype != null && message.hasOwnProperty("mimetype")) - object.mimetype = message.mimetype; - if (message.fileSha256 != null && message.hasOwnProperty("fileSha256")) - object.fileSha256 = options.bytes === String ? $util.base64.encode(message.fileSha256, 0, message.fileSha256.length) : options.bytes === Array ? Array.prototype.slice.call(message.fileSha256) : message.fileSha256; - if (message.fileLength != null && message.hasOwnProperty("fileLength")) - if (typeof message.fileLength === "number") - object.fileLength = options.longs === String ? String(message.fileLength) : message.fileLength; - else - object.fileLength = options.longs === String ? $util.Long.prototype.toString.call(message.fileLength) : options.longs === Number ? new $util.LongBits(message.fileLength.low >>> 0, message.fileLength.high >>> 0).toNumber(true) : message.fileLength; - if (message.seconds != null && message.hasOwnProperty("seconds")) - object.seconds = message.seconds; - if (message.mediaKey != null && message.hasOwnProperty("mediaKey")) - object.mediaKey = options.bytes === String ? $util.base64.encode(message.mediaKey, 0, message.mediaKey.length) : options.bytes === Array ? Array.prototype.slice.call(message.mediaKey) : message.mediaKey; - if (message.caption != null && message.hasOwnProperty("caption")) - object.caption = message.caption; - if (message.gifPlayback != null && message.hasOwnProperty("gifPlayback")) - object.gifPlayback = message.gifPlayback; - if (message.height != null && message.hasOwnProperty("height")) - object.height = message.height; - if (message.width != null && message.hasOwnProperty("width")) - object.width = message.width; - if (message.fileEncSha256 != null && message.hasOwnProperty("fileEncSha256")) - object.fileEncSha256 = options.bytes === String ? $util.base64.encode(message.fileEncSha256, 0, message.fileEncSha256.length) : options.bytes === Array ? Array.prototype.slice.call(message.fileEncSha256) : message.fileEncSha256; - if (message.interactiveAnnotations && message.interactiveAnnotations.length) { - object.interactiveAnnotations = []; - for (var j = 0; j < message.interactiveAnnotations.length; ++j) - object.interactiveAnnotations[j] = $root.proto.InteractiveAnnotation.toObject(message.interactiveAnnotations[j], options); + if (message.productSections && message.productSections.length) { + object.productSections = []; + for (var j = 0; j < message.productSections.length; ++j) + object.productSections[j] = $root.proto.ProductSection.toObject(message.productSections[j], options); } - if (message.directPath != null && message.hasOwnProperty("directPath")) - object.directPath = message.directPath; - if (message.mediaKeyTimestamp != null && message.hasOwnProperty("mediaKeyTimestamp")) - if (typeof message.mediaKeyTimestamp === "number") - object.mediaKeyTimestamp = options.longs === String ? String(message.mediaKeyTimestamp) : message.mediaKeyTimestamp; - else - object.mediaKeyTimestamp = options.longs === String ? $util.Long.prototype.toString.call(message.mediaKeyTimestamp) : options.longs === Number ? new $util.LongBits(message.mediaKeyTimestamp.low >>> 0, message.mediaKeyTimestamp.high >>> 0).toNumber() : message.mediaKeyTimestamp; - if (message.jpegThumbnail != null && message.hasOwnProperty("jpegThumbnail")) - object.jpegThumbnail = options.bytes === String ? $util.base64.encode(message.jpegThumbnail, 0, message.jpegThumbnail.length) : options.bytes === Array ? Array.prototype.slice.call(message.jpegThumbnail) : message.jpegThumbnail; - if (message.contextInfo != null && message.hasOwnProperty("contextInfo")) - object.contextInfo = $root.proto.ContextInfo.toObject(message.contextInfo, options); - if (message.streamingSidecar != null && message.hasOwnProperty("streamingSidecar")) - object.streamingSidecar = options.bytes === String ? $util.base64.encode(message.streamingSidecar, 0, message.streamingSidecar.length) : options.bytes === Array ? Array.prototype.slice.call(message.streamingSidecar) : message.streamingSidecar; - if (message.gifAttribution != null && message.hasOwnProperty("gifAttribution")) - object.gifAttribution = options.enums === String ? $root.proto.VideoMessage.VideoMessageAttribution[message.gifAttribution] : message.gifAttribution; - if (message.viewOnce != null && message.hasOwnProperty("viewOnce")) - object.viewOnce = message.viewOnce; - if (message.thumbnailDirectPath != null && message.hasOwnProperty("thumbnailDirectPath")) - object.thumbnailDirectPath = message.thumbnailDirectPath; - if (message.thumbnailSha256 != null && message.hasOwnProperty("thumbnailSha256")) - object.thumbnailSha256 = options.bytes === String ? $util.base64.encode(message.thumbnailSha256, 0, message.thumbnailSha256.length) : options.bytes === Array ? Array.prototype.slice.call(message.thumbnailSha256) : message.thumbnailSha256; - if (message.thumbnailEncSha256 != null && message.hasOwnProperty("thumbnailEncSha256")) - object.thumbnailEncSha256 = options.bytes === String ? $util.base64.encode(message.thumbnailEncSha256, 0, message.thumbnailEncSha256.length) : options.bytes === Array ? Array.prototype.slice.call(message.thumbnailEncSha256) : message.thumbnailEncSha256; - if (message.staticUrl != null && message.hasOwnProperty("staticUrl")) - object.staticUrl = message.staticUrl; + if (message.headerImage != null && message.hasOwnProperty("headerImage")) + object.headerImage = $root.proto.ProductListHeaderImage.toObject(message.headerImage, options); + if (message.businessOwnerJid != null && message.hasOwnProperty("businessOwnerJid")) + object.businessOwnerJid = message.businessOwnerJid; return object; }; /** - * Converts this VideoMessage to JSON. + * Converts this ProductListInfo to JSON. * @function toJSON - * @memberof proto.VideoMessage + * @memberof proto.ProductListInfo * @instance * @returns {Object.} JSON object */ - VideoMessage.prototype.toJSON = function toJSON() { + ProductListInfo.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - /** - * VideoMessageAttribution enum. - * @name proto.VideoMessage.VideoMessageAttribution - * @enum {number} - * @property {number} NONE=0 NONE value - * @property {number} GIPHY=1 GIPHY value - * @property {number} TENOR=2 TENOR value - */ - VideoMessage.VideoMessageAttribution = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "NONE"] = 0; - values[valuesById[1] = "GIPHY"] = 1; - values[valuesById[2] = "TENOR"] = 2; - return values; - })(); - - return VideoMessage; + return ProductListInfo; })(); - proto.Call = (function() { + proto.ProductMessage = (function() { /** - * Properties of a Call. + * Properties of a ProductMessage. * @memberof proto - * @interface ICall - * @property {Uint8Array|null} [callKey] Call callKey - * @property {string|null} [conversionSource] Call conversionSource - * @property {Uint8Array|null} [conversionData] Call conversionData - * @property {number|null} [conversionDelaySeconds] Call conversionDelaySeconds + * @interface IProductMessage + * @property {proto.IProductSnapshot|null} [product] ProductMessage product + * @property {string|null} [businessOwnerJid] ProductMessage businessOwnerJid + * @property {proto.ICatalogSnapshot|null} [catalog] ProductMessage catalog + * @property {string|null} [body] ProductMessage body + * @property {string|null} [footer] ProductMessage footer + * @property {proto.IContextInfo|null} [contextInfo] ProductMessage contextInfo */ /** - * Constructs a new Call. + * Constructs a new ProductMessage. * @memberof proto - * @classdesc Represents a Call. - * @implements ICall + * @classdesc Represents a ProductMessage. + * @implements IProductMessage * @constructor - * @param {proto.ICall=} [properties] Properties to set + * @param {proto.IProductMessage=} [properties] Properties to set */ - function Call(properties) { + function ProductMessage(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -27996,114 +27595,140 @@ $root.proto = (function() { } /** - * Call callKey. - * @member {Uint8Array} callKey - * @memberof proto.Call + * ProductMessage product. + * @member {proto.IProductSnapshot|null|undefined} product + * @memberof proto.ProductMessage * @instance */ - Call.prototype.callKey = $util.newBuffer([]); + ProductMessage.prototype.product = null; /** - * Call conversionSource. - * @member {string} conversionSource - * @memberof proto.Call + * ProductMessage businessOwnerJid. + * @member {string} businessOwnerJid + * @memberof proto.ProductMessage * @instance */ - Call.prototype.conversionSource = ""; + ProductMessage.prototype.businessOwnerJid = ""; /** - * Call conversionData. - * @member {Uint8Array} conversionData - * @memberof proto.Call + * ProductMessage catalog. + * @member {proto.ICatalogSnapshot|null|undefined} catalog + * @memberof proto.ProductMessage * @instance */ - Call.prototype.conversionData = $util.newBuffer([]); + ProductMessage.prototype.catalog = null; /** - * Call conversionDelaySeconds. - * @member {number} conversionDelaySeconds - * @memberof proto.Call + * ProductMessage body. + * @member {string} body + * @memberof proto.ProductMessage * @instance */ - Call.prototype.conversionDelaySeconds = 0; + ProductMessage.prototype.body = ""; /** - * Creates a new Call instance using the specified properties. + * ProductMessage footer. + * @member {string} footer + * @memberof proto.ProductMessage + * @instance + */ + ProductMessage.prototype.footer = ""; + + /** + * ProductMessage contextInfo. + * @member {proto.IContextInfo|null|undefined} contextInfo + * @memberof proto.ProductMessage + * @instance + */ + ProductMessage.prototype.contextInfo = null; + + /** + * Creates a new ProductMessage instance using the specified properties. * @function create - * @memberof proto.Call + * @memberof proto.ProductMessage * @static - * @param {proto.ICall=} [properties] Properties to set - * @returns {proto.Call} Call instance + * @param {proto.IProductMessage=} [properties] Properties to set + * @returns {proto.ProductMessage} ProductMessage instance */ - Call.create = function create(properties) { - return new Call(properties); + ProductMessage.create = function create(properties) { + return new ProductMessage(properties); }; /** - * Encodes the specified Call message. Does not implicitly {@link proto.Call.verify|verify} messages. + * Encodes the specified ProductMessage message. Does not implicitly {@link proto.ProductMessage.verify|verify} messages. * @function encode - * @memberof proto.Call + * @memberof proto.ProductMessage * @static - * @param {proto.ICall} message Call message or plain object to encode + * @param {proto.IProductMessage} message ProductMessage message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Call.encode = function encode(message, writer) { + ProductMessage.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.callKey != null && Object.hasOwnProperty.call(message, "callKey")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.callKey); - if (message.conversionSource != null && Object.hasOwnProperty.call(message, "conversionSource")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.conversionSource); - if (message.conversionData != null && Object.hasOwnProperty.call(message, "conversionData")) - writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.conversionData); - if (message.conversionDelaySeconds != null && Object.hasOwnProperty.call(message, "conversionDelaySeconds")) - writer.uint32(/* id 4, wireType 0 =*/32).uint32(message.conversionDelaySeconds); + if (message.product != null && Object.hasOwnProperty.call(message, "product")) + $root.proto.ProductSnapshot.encode(message.product, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.businessOwnerJid != null && Object.hasOwnProperty.call(message, "businessOwnerJid")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.businessOwnerJid); + if (message.catalog != null && Object.hasOwnProperty.call(message, "catalog")) + $root.proto.CatalogSnapshot.encode(message.catalog, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.body != null && Object.hasOwnProperty.call(message, "body")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.body); + if (message.footer != null && Object.hasOwnProperty.call(message, "footer")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.footer); + if (message.contextInfo != null && Object.hasOwnProperty.call(message, "contextInfo")) + $root.proto.ContextInfo.encode(message.contextInfo, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); return writer; }; /** - * Encodes the specified Call message, length delimited. Does not implicitly {@link proto.Call.verify|verify} messages. + * Encodes the specified ProductMessage message, length delimited. Does not implicitly {@link proto.ProductMessage.verify|verify} messages. * @function encodeDelimited - * @memberof proto.Call + * @memberof proto.ProductMessage * @static - * @param {proto.ICall} message Call message or plain object to encode + * @param {proto.IProductMessage} message ProductMessage message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Call.encodeDelimited = function encodeDelimited(message, writer) { + ProductMessage.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Call message from the specified reader or buffer. + * Decodes a ProductMessage message from the specified reader or buffer. * @function decode - * @memberof proto.Call + * @memberof proto.ProductMessage * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {proto.Call} Call + * @returns {proto.ProductMessage} ProductMessage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Call.decode = function decode(reader, length) { + ProductMessage.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.Call(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.ProductMessage(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.callKey = reader.bytes(); + message.product = $root.proto.ProductSnapshot.decode(reader, reader.uint32()); break; case 2: - message.conversionSource = reader.string(); - break; - case 3: - message.conversionData = reader.bytes(); + message.businessOwnerJid = reader.string(); break; case 4: - message.conversionDelaySeconds = reader.uint32(); + message.catalog = $root.proto.CatalogSnapshot.decode(reader, reader.uint32()); + break; + case 5: + message.body = reader.string(); + break; + case 6: + message.footer = reader.string(); + break; + case 17: + message.contextInfo = $root.proto.ContextInfo.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -28114,151 +27739,165 @@ $root.proto = (function() { }; /** - * Decodes a Call message from the specified reader or buffer, length delimited. + * Decodes a ProductMessage message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof proto.Call + * @memberof proto.ProductMessage * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.Call} Call + * @returns {proto.ProductMessage} ProductMessage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Call.decodeDelimited = function decodeDelimited(reader) { + ProductMessage.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Call message. + * Verifies a ProductMessage message. * @function verify - * @memberof proto.Call + * @memberof proto.ProductMessage * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Call.verify = function verify(message) { + ProductMessage.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.callKey != null && message.hasOwnProperty("callKey")) - if (!(message.callKey && typeof message.callKey.length === "number" || $util.isString(message.callKey))) - return "callKey: buffer expected"; - if (message.conversionSource != null && message.hasOwnProperty("conversionSource")) - if (!$util.isString(message.conversionSource)) - return "conversionSource: string expected"; - if (message.conversionData != null && message.hasOwnProperty("conversionData")) - if (!(message.conversionData && typeof message.conversionData.length === "number" || $util.isString(message.conversionData))) - return "conversionData: buffer expected"; - if (message.conversionDelaySeconds != null && message.hasOwnProperty("conversionDelaySeconds")) - if (!$util.isInteger(message.conversionDelaySeconds)) - return "conversionDelaySeconds: integer expected"; + if (message.product != null && message.hasOwnProperty("product")) { + var error = $root.proto.ProductSnapshot.verify(message.product); + if (error) + return "product." + error; + } + if (message.businessOwnerJid != null && message.hasOwnProperty("businessOwnerJid")) + if (!$util.isString(message.businessOwnerJid)) + return "businessOwnerJid: string expected"; + if (message.catalog != null && message.hasOwnProperty("catalog")) { + var error = $root.proto.CatalogSnapshot.verify(message.catalog); + if (error) + return "catalog." + error; + } + if (message.body != null && message.hasOwnProperty("body")) + if (!$util.isString(message.body)) + return "body: string expected"; + if (message.footer != null && message.hasOwnProperty("footer")) + if (!$util.isString(message.footer)) + return "footer: string expected"; + if (message.contextInfo != null && message.hasOwnProperty("contextInfo")) { + var error = $root.proto.ContextInfo.verify(message.contextInfo); + if (error) + return "contextInfo." + error; + } return null; }; /** - * Creates a Call message from a plain object. Also converts values to their respective internal types. + * Creates a ProductMessage message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof proto.Call + * @memberof proto.ProductMessage * @static * @param {Object.} object Plain object - * @returns {proto.Call} Call + * @returns {proto.ProductMessage} ProductMessage */ - Call.fromObject = function fromObject(object) { - if (object instanceof $root.proto.Call) + ProductMessage.fromObject = function fromObject(object) { + if (object instanceof $root.proto.ProductMessage) return object; - var message = new $root.proto.Call(); - if (object.callKey != null) - if (typeof object.callKey === "string") - $util.base64.decode(object.callKey, message.callKey = $util.newBuffer($util.base64.length(object.callKey)), 0); - else if (object.callKey.length) - message.callKey = object.callKey; - if (object.conversionSource != null) - message.conversionSource = String(object.conversionSource); - if (object.conversionData != null) - if (typeof object.conversionData === "string") - $util.base64.decode(object.conversionData, message.conversionData = $util.newBuffer($util.base64.length(object.conversionData)), 0); - else if (object.conversionData.length) - message.conversionData = object.conversionData; - if (object.conversionDelaySeconds != null) - message.conversionDelaySeconds = object.conversionDelaySeconds >>> 0; + var message = new $root.proto.ProductMessage(); + if (object.product != null) { + if (typeof object.product !== "object") + throw TypeError(".proto.ProductMessage.product: object expected"); + message.product = $root.proto.ProductSnapshot.fromObject(object.product); + } + if (object.businessOwnerJid != null) + message.businessOwnerJid = String(object.businessOwnerJid); + if (object.catalog != null) { + if (typeof object.catalog !== "object") + throw TypeError(".proto.ProductMessage.catalog: object expected"); + message.catalog = $root.proto.CatalogSnapshot.fromObject(object.catalog); + } + if (object.body != null) + message.body = String(object.body); + if (object.footer != null) + message.footer = String(object.footer); + if (object.contextInfo != null) { + if (typeof object.contextInfo !== "object") + throw TypeError(".proto.ProductMessage.contextInfo: object expected"); + message.contextInfo = $root.proto.ContextInfo.fromObject(object.contextInfo); + } return message; }; /** - * Creates a plain object from a Call message. Also converts values to other types if specified. + * Creates a plain object from a ProductMessage message. Also converts values to other types if specified. * @function toObject - * @memberof proto.Call + * @memberof proto.ProductMessage * @static - * @param {proto.Call} message Call + * @param {proto.ProductMessage} message ProductMessage * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Call.toObject = function toObject(message, options) { + ProductMessage.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - if (options.bytes === String) - object.callKey = ""; - else { - object.callKey = []; - if (options.bytes !== Array) - object.callKey = $util.newBuffer(object.callKey); - } - object.conversionSource = ""; - if (options.bytes === String) - object.conversionData = ""; - else { - object.conversionData = []; - if (options.bytes !== Array) - object.conversionData = $util.newBuffer(object.conversionData); - } - object.conversionDelaySeconds = 0; + object.product = null; + object.businessOwnerJid = ""; + object.catalog = null; + object.body = ""; + object.footer = ""; + object.contextInfo = null; } - if (message.callKey != null && message.hasOwnProperty("callKey")) - object.callKey = options.bytes === String ? $util.base64.encode(message.callKey, 0, message.callKey.length) : options.bytes === Array ? Array.prototype.slice.call(message.callKey) : message.callKey; - if (message.conversionSource != null && message.hasOwnProperty("conversionSource")) - object.conversionSource = message.conversionSource; - if (message.conversionData != null && message.hasOwnProperty("conversionData")) - object.conversionData = options.bytes === String ? $util.base64.encode(message.conversionData, 0, message.conversionData.length) : options.bytes === Array ? Array.prototype.slice.call(message.conversionData) : message.conversionData; - if (message.conversionDelaySeconds != null && message.hasOwnProperty("conversionDelaySeconds")) - object.conversionDelaySeconds = message.conversionDelaySeconds; + if (message.product != null && message.hasOwnProperty("product")) + object.product = $root.proto.ProductSnapshot.toObject(message.product, options); + if (message.businessOwnerJid != null && message.hasOwnProperty("businessOwnerJid")) + object.businessOwnerJid = message.businessOwnerJid; + if (message.catalog != null && message.hasOwnProperty("catalog")) + object.catalog = $root.proto.CatalogSnapshot.toObject(message.catalog, options); + if (message.body != null && message.hasOwnProperty("body")) + object.body = message.body; + if (message.footer != null && message.hasOwnProperty("footer")) + object.footer = message.footer; + if (message.contextInfo != null && message.hasOwnProperty("contextInfo")) + object.contextInfo = $root.proto.ContextInfo.toObject(message.contextInfo, options); return object; }; /** - * Converts this Call to JSON. + * Converts this ProductMessage to JSON. * @function toJSON - * @memberof proto.Call + * @memberof proto.ProductMessage * @instance * @returns {Object.} JSON object */ - Call.prototype.toJSON = function toJSON() { + ProductMessage.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return Call; + return ProductMessage; })(); - proto.Chat = (function() { + proto.ProductSection = (function() { /** - * Properties of a Chat. + * Properties of a ProductSection. * @memberof proto - * @interface IChat - * @property {string|null} [displayName] Chat displayName - * @property {string|null} [id] Chat id + * @interface IProductSection + * @property {string|null} [title] ProductSection title + * @property {Array.|null} [products] ProductSection products */ /** - * Constructs a new Chat. + * Constructs a new ProductSection. * @memberof proto - * @classdesc Represents a Chat. - * @implements IChat + * @classdesc Represents a ProductSection. + * @implements IProductSection * @constructor - * @param {proto.IChat=} [properties] Properties to set + * @param {proto.IProductSection=} [properties] Properties to set */ - function Chat(properties) { + function ProductSection(properties) { + this.products = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -28266,88 +27905,91 @@ $root.proto = (function() { } /** - * Chat displayName. - * @member {string} displayName - * @memberof proto.Chat + * ProductSection title. + * @member {string} title + * @memberof proto.ProductSection * @instance */ - Chat.prototype.displayName = ""; + ProductSection.prototype.title = ""; /** - * Chat id. - * @member {string} id - * @memberof proto.Chat + * ProductSection products. + * @member {Array.} products + * @memberof proto.ProductSection * @instance */ - Chat.prototype.id = ""; + ProductSection.prototype.products = $util.emptyArray; /** - * Creates a new Chat instance using the specified properties. + * Creates a new ProductSection instance using the specified properties. * @function create - * @memberof proto.Chat + * @memberof proto.ProductSection * @static - * @param {proto.IChat=} [properties] Properties to set - * @returns {proto.Chat} Chat instance + * @param {proto.IProductSection=} [properties] Properties to set + * @returns {proto.ProductSection} ProductSection instance */ - Chat.create = function create(properties) { - return new Chat(properties); + ProductSection.create = function create(properties) { + return new ProductSection(properties); }; /** - * Encodes the specified Chat message. Does not implicitly {@link proto.Chat.verify|verify} messages. + * Encodes the specified ProductSection message. Does not implicitly {@link proto.ProductSection.verify|verify} messages. * @function encode - * @memberof proto.Chat + * @memberof proto.ProductSection * @static - * @param {proto.IChat} message Chat message or plain object to encode + * @param {proto.IProductSection} message ProductSection message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Chat.encode = function encode(message, writer) { + ProductSection.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.displayName); - if (message.id != null && Object.hasOwnProperty.call(message, "id")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.id); + if (message.title != null && Object.hasOwnProperty.call(message, "title")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.title); + if (message.products != null && message.products.length) + for (var i = 0; i < message.products.length; ++i) + $root.proto.Product.encode(message.products[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** - * Encodes the specified Chat message, length delimited. Does not implicitly {@link proto.Chat.verify|verify} messages. + * Encodes the specified ProductSection message, length delimited. Does not implicitly {@link proto.ProductSection.verify|verify} messages. * @function encodeDelimited - * @memberof proto.Chat + * @memberof proto.ProductSection * @static - * @param {proto.IChat} message Chat message or plain object to encode + * @param {proto.IProductSection} message ProductSection message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Chat.encodeDelimited = function encodeDelimited(message, writer) { + ProductSection.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Chat message from the specified reader or buffer. + * Decodes a ProductSection message from the specified reader or buffer. * @function decode - * @memberof proto.Chat + * @memberof proto.ProductSection * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {proto.Chat} Chat + * @returns {proto.ProductSection} ProductSection * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Chat.decode = function decode(reader, length) { + ProductSection.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.Chat(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.ProductSection(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.displayName = reader.string(); + message.title = reader.string(); break; case 2: - message.id = reader.string(); + if (!(message.products && message.products.length)) + message.products = []; + message.products.push($root.proto.Product.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -28358,125 +28000,143 @@ $root.proto = (function() { }; /** - * Decodes a Chat message from the specified reader or buffer, length delimited. + * Decodes a ProductSection message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof proto.Chat + * @memberof proto.ProductSection * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.Chat} Chat + * @returns {proto.ProductSection} ProductSection * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Chat.decodeDelimited = function decodeDelimited(reader) { + ProductSection.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Chat message. + * Verifies a ProductSection message. * @function verify - * @memberof proto.Chat + * @memberof proto.ProductSection * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Chat.verify = function verify(message) { + ProductSection.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.displayName != null && message.hasOwnProperty("displayName")) - if (!$util.isString(message.displayName)) - return "displayName: string expected"; - if (message.id != null && message.hasOwnProperty("id")) - if (!$util.isString(message.id)) - return "id: string expected"; + if (message.title != null && message.hasOwnProperty("title")) + if (!$util.isString(message.title)) + return "title: string expected"; + if (message.products != null && message.hasOwnProperty("products")) { + if (!Array.isArray(message.products)) + return "products: array expected"; + for (var i = 0; i < message.products.length; ++i) { + var error = $root.proto.Product.verify(message.products[i]); + if (error) + return "products." + error; + } + } return null; }; /** - * Creates a Chat message from a plain object. Also converts values to their respective internal types. + * Creates a ProductSection message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof proto.Chat + * @memberof proto.ProductSection * @static * @param {Object.} object Plain object - * @returns {proto.Chat} Chat + * @returns {proto.ProductSection} ProductSection */ - Chat.fromObject = function fromObject(object) { - if (object instanceof $root.proto.Chat) + ProductSection.fromObject = function fromObject(object) { + if (object instanceof $root.proto.ProductSection) return object; - var message = new $root.proto.Chat(); - if (object.displayName != null) - message.displayName = String(object.displayName); - if (object.id != null) - message.id = String(object.id); + var message = new $root.proto.ProductSection(); + if (object.title != null) + message.title = String(object.title); + if (object.products) { + if (!Array.isArray(object.products)) + throw TypeError(".proto.ProductSection.products: array expected"); + message.products = []; + for (var i = 0; i < object.products.length; ++i) { + if (typeof object.products[i] !== "object") + throw TypeError(".proto.ProductSection.products: object expected"); + message.products[i] = $root.proto.Product.fromObject(object.products[i]); + } + } return message; }; /** - * Creates a plain object from a Chat message. Also converts values to other types if specified. + * Creates a plain object from a ProductSection message. Also converts values to other types if specified. * @function toObject - * @memberof proto.Chat + * @memberof proto.ProductSection * @static - * @param {proto.Chat} message Chat + * @param {proto.ProductSection} message ProductSection * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Chat.toObject = function toObject(message, options) { + ProductSection.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.displayName = ""; - object.id = ""; + if (options.arrays || options.defaults) + object.products = []; + if (options.defaults) + object.title = ""; + if (message.title != null && message.hasOwnProperty("title")) + object.title = message.title; + if (message.products && message.products.length) { + object.products = []; + for (var j = 0; j < message.products.length; ++j) + object.products[j] = $root.proto.Product.toObject(message.products[j], options); } - if (message.displayName != null && message.hasOwnProperty("displayName")) - object.displayName = message.displayName; - if (message.id != null && message.hasOwnProperty("id")) - object.id = message.id; return object; }; /** - * Converts this Chat to JSON. + * Converts this ProductSection to JSON. * @function toJSON - * @memberof proto.Chat + * @memberof proto.ProductSection * @instance * @returns {Object.} JSON object */ - Chat.prototype.toJSON = function toJSON() { + ProductSection.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return Chat; + return ProductSection; })(); - proto.ProtocolMessage = (function() { + proto.ProductSnapshot = (function() { /** - * Properties of a ProtocolMessage. + * Properties of a ProductSnapshot. * @memberof proto - * @interface IProtocolMessage - * @property {proto.IMessageKey|null} [key] ProtocolMessage key - * @property {proto.ProtocolMessage.ProtocolMessageType|null} [type] ProtocolMessage type - * @property {number|null} [ephemeralExpiration] ProtocolMessage ephemeralExpiration - * @property {number|Long|null} [ephemeralSettingTimestamp] ProtocolMessage ephemeralSettingTimestamp - * @property {proto.IHistorySyncNotification|null} [historySyncNotification] ProtocolMessage historySyncNotification - * @property {proto.IAppStateSyncKeyShare|null} [appStateSyncKeyShare] ProtocolMessage appStateSyncKeyShare - * @property {proto.IAppStateSyncKeyRequest|null} [appStateSyncKeyRequest] ProtocolMessage appStateSyncKeyRequest - * @property {proto.IInitialSecurityNotificationSettingSync|null} [initialSecurityNotificationSettingSync] ProtocolMessage initialSecurityNotificationSettingSync - * @property {proto.IAppStateFatalExceptionNotification|null} [appStateFatalExceptionNotification] ProtocolMessage appStateFatalExceptionNotification - * @property {proto.IDisappearingMode|null} [disappearingMode] ProtocolMessage disappearingMode + * @interface IProductSnapshot + * @property {proto.IImageMessage|null} [productImage] ProductSnapshot productImage + * @property {string|null} [productId] ProductSnapshot productId + * @property {string|null} [title] ProductSnapshot title + * @property {string|null} [description] ProductSnapshot description + * @property {string|null} [currencyCode] ProductSnapshot currencyCode + * @property {number|Long|null} [priceAmount1000] ProductSnapshot priceAmount1000 + * @property {string|null} [retailerId] ProductSnapshot retailerId + * @property {string|null} [url] ProductSnapshot url + * @property {number|null} [productImageCount] ProductSnapshot productImageCount + * @property {string|null} [firstImageId] ProductSnapshot firstImageId + * @property {number|Long|null} [salePriceAmount1000] ProductSnapshot salePriceAmount1000 */ /** - * Constructs a new ProtocolMessage. + * Constructs a new ProductSnapshot. * @memberof proto - * @classdesc Represents a ProtocolMessage. - * @implements IProtocolMessage + * @classdesc Represents a ProductSnapshot. + * @implements IProductSnapshot * @constructor - * @param {proto.IProtocolMessage=} [properties] Properties to set + * @param {proto.IProductSnapshot=} [properties] Properties to set */ - function ProtocolMessage(properties) { + function ProductSnapshot(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -28484,149 +28144,589 @@ $root.proto = (function() { } /** - * ProtocolMessage key. - * @member {proto.IMessageKey|null|undefined} key - * @memberof proto.ProtocolMessage + * ProductSnapshot productImage. + * @member {proto.IImageMessage|null|undefined} productImage + * @memberof proto.ProductSnapshot * @instance */ - ProtocolMessage.prototype.key = null; + ProductSnapshot.prototype.productImage = null; /** - * ProtocolMessage type. - * @member {proto.ProtocolMessage.ProtocolMessageType} type - * @memberof proto.ProtocolMessage + * ProductSnapshot productId. + * @member {string} productId + * @memberof proto.ProductSnapshot * @instance */ - ProtocolMessage.prototype.type = 0; + ProductSnapshot.prototype.productId = ""; /** - * ProtocolMessage ephemeralExpiration. - * @member {number} ephemeralExpiration - * @memberof proto.ProtocolMessage + * ProductSnapshot title. + * @member {string} title + * @memberof proto.ProductSnapshot * @instance */ - ProtocolMessage.prototype.ephemeralExpiration = 0; + ProductSnapshot.prototype.title = ""; /** - * ProtocolMessage ephemeralSettingTimestamp. - * @member {number|Long} ephemeralSettingTimestamp - * @memberof proto.ProtocolMessage + * ProductSnapshot description. + * @member {string} description + * @memberof proto.ProductSnapshot * @instance */ - ProtocolMessage.prototype.ephemeralSettingTimestamp = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + ProductSnapshot.prototype.description = ""; /** - * ProtocolMessage historySyncNotification. - * @member {proto.IHistorySyncNotification|null|undefined} historySyncNotification - * @memberof proto.ProtocolMessage + * ProductSnapshot currencyCode. + * @member {string} currencyCode + * @memberof proto.ProductSnapshot * @instance */ - ProtocolMessage.prototype.historySyncNotification = null; + ProductSnapshot.prototype.currencyCode = ""; /** - * ProtocolMessage appStateSyncKeyShare. - * @member {proto.IAppStateSyncKeyShare|null|undefined} appStateSyncKeyShare - * @memberof proto.ProtocolMessage + * ProductSnapshot priceAmount1000. + * @member {number|Long} priceAmount1000 + * @memberof proto.ProductSnapshot * @instance */ - ProtocolMessage.prototype.appStateSyncKeyShare = null; + ProductSnapshot.prototype.priceAmount1000 = $util.Long ? $util.Long.fromBits(0,0,false) : 0; /** - * ProtocolMessage appStateSyncKeyRequest. - * @member {proto.IAppStateSyncKeyRequest|null|undefined} appStateSyncKeyRequest - * @memberof proto.ProtocolMessage + * ProductSnapshot retailerId. + * @member {string} retailerId + * @memberof proto.ProductSnapshot * @instance */ - ProtocolMessage.prototype.appStateSyncKeyRequest = null; + ProductSnapshot.prototype.retailerId = ""; /** - * ProtocolMessage initialSecurityNotificationSettingSync. - * @member {proto.IInitialSecurityNotificationSettingSync|null|undefined} initialSecurityNotificationSettingSync - * @memberof proto.ProtocolMessage + * ProductSnapshot url. + * @member {string} url + * @memberof proto.ProductSnapshot * @instance */ - ProtocolMessage.prototype.initialSecurityNotificationSettingSync = null; + ProductSnapshot.prototype.url = ""; /** - * ProtocolMessage appStateFatalExceptionNotification. - * @member {proto.IAppStateFatalExceptionNotification|null|undefined} appStateFatalExceptionNotification - * @memberof proto.ProtocolMessage + * ProductSnapshot productImageCount. + * @member {number} productImageCount + * @memberof proto.ProductSnapshot * @instance */ - ProtocolMessage.prototype.appStateFatalExceptionNotification = null; + ProductSnapshot.prototype.productImageCount = 0; /** - * ProtocolMessage disappearingMode. - * @member {proto.IDisappearingMode|null|undefined} disappearingMode - * @memberof proto.ProtocolMessage + * ProductSnapshot firstImageId. + * @member {string} firstImageId + * @memberof proto.ProductSnapshot * @instance */ - ProtocolMessage.prototype.disappearingMode = null; + ProductSnapshot.prototype.firstImageId = ""; /** - * Creates a new ProtocolMessage instance using the specified properties. + * ProductSnapshot salePriceAmount1000. + * @member {number|Long} salePriceAmount1000 + * @memberof proto.ProductSnapshot + * @instance + */ + ProductSnapshot.prototype.salePriceAmount1000 = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new ProductSnapshot instance using the specified properties. * @function create - * @memberof proto.ProtocolMessage + * @memberof proto.ProductSnapshot * @static - * @param {proto.IProtocolMessage=} [properties] Properties to set - * @returns {proto.ProtocolMessage} ProtocolMessage instance + * @param {proto.IProductSnapshot=} [properties] Properties to set + * @returns {proto.ProductSnapshot} ProductSnapshot instance */ - ProtocolMessage.create = function create(properties) { - return new ProtocolMessage(properties); + ProductSnapshot.create = function create(properties) { + return new ProductSnapshot(properties); }; /** - * Encodes the specified ProtocolMessage message. Does not implicitly {@link proto.ProtocolMessage.verify|verify} messages. + * Encodes the specified ProductSnapshot message. Does not implicitly {@link proto.ProductSnapshot.verify|verify} messages. * @function encode - * @memberof proto.ProtocolMessage + * @memberof proto.ProductSnapshot * @static - * @param {proto.IProtocolMessage} message ProtocolMessage message or plain object to encode + * @param {proto.IProductSnapshot} message ProductSnapshot message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ProtocolMessage.encode = function encode(message, writer) { + ProductSnapshot.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.key != null && Object.hasOwnProperty.call(message, "key")) - $root.proto.MessageKey.encode(message.key, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.type); - if (message.ephemeralExpiration != null && Object.hasOwnProperty.call(message, "ephemeralExpiration")) - writer.uint32(/* id 4, wireType 0 =*/32).uint32(message.ephemeralExpiration); - if (message.ephemeralSettingTimestamp != null && Object.hasOwnProperty.call(message, "ephemeralSettingTimestamp")) - writer.uint32(/* id 5, wireType 0 =*/40).int64(message.ephemeralSettingTimestamp); - if (message.historySyncNotification != null && Object.hasOwnProperty.call(message, "historySyncNotification")) - $root.proto.HistorySyncNotification.encode(message.historySyncNotification, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.appStateSyncKeyShare != null && Object.hasOwnProperty.call(message, "appStateSyncKeyShare")) - $root.proto.AppStateSyncKeyShare.encode(message.appStateSyncKeyShare, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.appStateSyncKeyRequest != null && Object.hasOwnProperty.call(message, "appStateSyncKeyRequest")) - $root.proto.AppStateSyncKeyRequest.encode(message.appStateSyncKeyRequest, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.initialSecurityNotificationSettingSync != null && Object.hasOwnProperty.call(message, "initialSecurityNotificationSettingSync")) - $root.proto.InitialSecurityNotificationSettingSync.encode(message.initialSecurityNotificationSettingSync, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.appStateFatalExceptionNotification != null && Object.hasOwnProperty.call(message, "appStateFatalExceptionNotification")) - $root.proto.AppStateFatalExceptionNotification.encode(message.appStateFatalExceptionNotification, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); - if (message.disappearingMode != null && Object.hasOwnProperty.call(message, "disappearingMode")) - $root.proto.DisappearingMode.encode(message.disappearingMode, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.productImage != null && Object.hasOwnProperty.call(message, "productImage")) + $root.proto.ImageMessage.encode(message.productImage, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.productId != null && Object.hasOwnProperty.call(message, "productId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.productId); + if (message.title != null && Object.hasOwnProperty.call(message, "title")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.title); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.description); + if (message.currencyCode != null && Object.hasOwnProperty.call(message, "currencyCode")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.currencyCode); + if (message.priceAmount1000 != null && Object.hasOwnProperty.call(message, "priceAmount1000")) + writer.uint32(/* id 6, wireType 0 =*/48).int64(message.priceAmount1000); + if (message.retailerId != null && Object.hasOwnProperty.call(message, "retailerId")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.retailerId); + if (message.url != null && Object.hasOwnProperty.call(message, "url")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.url); + if (message.productImageCount != null && Object.hasOwnProperty.call(message, "productImageCount")) + writer.uint32(/* id 9, wireType 0 =*/72).uint32(message.productImageCount); + if (message.firstImageId != null && Object.hasOwnProperty.call(message, "firstImageId")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.firstImageId); + if (message.salePriceAmount1000 != null && Object.hasOwnProperty.call(message, "salePriceAmount1000")) + writer.uint32(/* id 12, wireType 0 =*/96).int64(message.salePriceAmount1000); return writer; }; /** - * Encodes the specified ProtocolMessage message, length delimited. Does not implicitly {@link proto.ProtocolMessage.verify|verify} messages. + * Encodes the specified ProductSnapshot message, length delimited. Does not implicitly {@link proto.ProductSnapshot.verify|verify} messages. * @function encodeDelimited - * @memberof proto.ProtocolMessage + * @memberof proto.ProductSnapshot * @static - * @param {proto.IProtocolMessage} message ProtocolMessage message or plain object to encode + * @param {proto.IProductSnapshot} message ProductSnapshot message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ProtocolMessage.encodeDelimited = function encodeDelimited(message, writer) { + ProductSnapshot.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ProtocolMessage message from the specified reader or buffer. + * Decodes a ProductSnapshot message from the specified reader or buffer. * @function decode - * @memberof proto.ProtocolMessage + * @memberof proto.ProductSnapshot + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {proto.ProductSnapshot} ProductSnapshot + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ProductSnapshot.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.ProductSnapshot(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.productImage = $root.proto.ImageMessage.decode(reader, reader.uint32()); + break; + case 2: + message.productId = reader.string(); + break; + case 3: + message.title = reader.string(); + break; + case 4: + message.description = reader.string(); + break; + case 5: + message.currencyCode = reader.string(); + break; + case 6: + message.priceAmount1000 = reader.int64(); + break; + case 7: + message.retailerId = reader.string(); + break; + case 8: + message.url = reader.string(); + break; + case 9: + message.productImageCount = reader.uint32(); + break; + case 11: + message.firstImageId = reader.string(); + break; + case 12: + message.salePriceAmount1000 = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ProductSnapshot message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof proto.ProductSnapshot + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {proto.ProductSnapshot} ProductSnapshot + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ProductSnapshot.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ProductSnapshot message. + * @function verify + * @memberof proto.ProductSnapshot + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ProductSnapshot.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.productImage != null && message.hasOwnProperty("productImage")) { + var error = $root.proto.ImageMessage.verify(message.productImage); + if (error) + return "productImage." + error; + } + if (message.productId != null && message.hasOwnProperty("productId")) + if (!$util.isString(message.productId)) + return "productId: string expected"; + if (message.title != null && message.hasOwnProperty("title")) + if (!$util.isString(message.title)) + return "title: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.currencyCode != null && message.hasOwnProperty("currencyCode")) + if (!$util.isString(message.currencyCode)) + return "currencyCode: string expected"; + if (message.priceAmount1000 != null && message.hasOwnProperty("priceAmount1000")) + if (!$util.isInteger(message.priceAmount1000) && !(message.priceAmount1000 && $util.isInteger(message.priceAmount1000.low) && $util.isInteger(message.priceAmount1000.high))) + return "priceAmount1000: integer|Long expected"; + if (message.retailerId != null && message.hasOwnProperty("retailerId")) + if (!$util.isString(message.retailerId)) + return "retailerId: string expected"; + if (message.url != null && message.hasOwnProperty("url")) + if (!$util.isString(message.url)) + return "url: string expected"; + if (message.productImageCount != null && message.hasOwnProperty("productImageCount")) + if (!$util.isInteger(message.productImageCount)) + return "productImageCount: integer expected"; + if (message.firstImageId != null && message.hasOwnProperty("firstImageId")) + if (!$util.isString(message.firstImageId)) + return "firstImageId: string expected"; + if (message.salePriceAmount1000 != null && message.hasOwnProperty("salePriceAmount1000")) + if (!$util.isInteger(message.salePriceAmount1000) && !(message.salePriceAmount1000 && $util.isInteger(message.salePriceAmount1000.low) && $util.isInteger(message.salePriceAmount1000.high))) + return "salePriceAmount1000: integer|Long expected"; + return null; + }; + + /** + * Creates a ProductSnapshot message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof proto.ProductSnapshot + * @static + * @param {Object.} object Plain object + * @returns {proto.ProductSnapshot} ProductSnapshot + */ + ProductSnapshot.fromObject = function fromObject(object) { + if (object instanceof $root.proto.ProductSnapshot) + return object; + var message = new $root.proto.ProductSnapshot(); + if (object.productImage != null) { + if (typeof object.productImage !== "object") + throw TypeError(".proto.ProductSnapshot.productImage: object expected"); + message.productImage = $root.proto.ImageMessage.fromObject(object.productImage); + } + if (object.productId != null) + message.productId = String(object.productId); + if (object.title != null) + message.title = String(object.title); + if (object.description != null) + message.description = String(object.description); + if (object.currencyCode != null) + message.currencyCode = String(object.currencyCode); + if (object.priceAmount1000 != null) + if ($util.Long) + (message.priceAmount1000 = $util.Long.fromValue(object.priceAmount1000)).unsigned = false; + else if (typeof object.priceAmount1000 === "string") + message.priceAmount1000 = parseInt(object.priceAmount1000, 10); + else if (typeof object.priceAmount1000 === "number") + message.priceAmount1000 = object.priceAmount1000; + else if (typeof object.priceAmount1000 === "object") + message.priceAmount1000 = new $util.LongBits(object.priceAmount1000.low >>> 0, object.priceAmount1000.high >>> 0).toNumber(); + if (object.retailerId != null) + message.retailerId = String(object.retailerId); + if (object.url != null) + message.url = String(object.url); + if (object.productImageCount != null) + message.productImageCount = object.productImageCount >>> 0; + if (object.firstImageId != null) + message.firstImageId = String(object.firstImageId); + if (object.salePriceAmount1000 != null) + if ($util.Long) + (message.salePriceAmount1000 = $util.Long.fromValue(object.salePriceAmount1000)).unsigned = false; + else if (typeof object.salePriceAmount1000 === "string") + message.salePriceAmount1000 = parseInt(object.salePriceAmount1000, 10); + else if (typeof object.salePriceAmount1000 === "number") + message.salePriceAmount1000 = object.salePriceAmount1000; + else if (typeof object.salePriceAmount1000 === "object") + message.salePriceAmount1000 = new $util.LongBits(object.salePriceAmount1000.low >>> 0, object.salePriceAmount1000.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a ProductSnapshot message. Also converts values to other types if specified. + * @function toObject + * @memberof proto.ProductSnapshot + * @static + * @param {proto.ProductSnapshot} message ProductSnapshot + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ProductSnapshot.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.productImage = null; + object.productId = ""; + object.title = ""; + object.description = ""; + object.currencyCode = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.priceAmount1000 = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.priceAmount1000 = options.longs === String ? "0" : 0; + object.retailerId = ""; + object.url = ""; + object.productImageCount = 0; + object.firstImageId = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.salePriceAmount1000 = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.salePriceAmount1000 = options.longs === String ? "0" : 0; + } + if (message.productImage != null && message.hasOwnProperty("productImage")) + object.productImage = $root.proto.ImageMessage.toObject(message.productImage, options); + if (message.productId != null && message.hasOwnProperty("productId")) + object.productId = message.productId; + if (message.title != null && message.hasOwnProperty("title")) + object.title = message.title; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.currencyCode != null && message.hasOwnProperty("currencyCode")) + object.currencyCode = message.currencyCode; + if (message.priceAmount1000 != null && message.hasOwnProperty("priceAmount1000")) + if (typeof message.priceAmount1000 === "number") + object.priceAmount1000 = options.longs === String ? String(message.priceAmount1000) : message.priceAmount1000; + else + object.priceAmount1000 = options.longs === String ? $util.Long.prototype.toString.call(message.priceAmount1000) : options.longs === Number ? new $util.LongBits(message.priceAmount1000.low >>> 0, message.priceAmount1000.high >>> 0).toNumber() : message.priceAmount1000; + if (message.retailerId != null && message.hasOwnProperty("retailerId")) + object.retailerId = message.retailerId; + if (message.url != null && message.hasOwnProperty("url")) + object.url = message.url; + if (message.productImageCount != null && message.hasOwnProperty("productImageCount")) + object.productImageCount = message.productImageCount; + if (message.firstImageId != null && message.hasOwnProperty("firstImageId")) + object.firstImageId = message.firstImageId; + if (message.salePriceAmount1000 != null && message.hasOwnProperty("salePriceAmount1000")) + if (typeof message.salePriceAmount1000 === "number") + object.salePriceAmount1000 = options.longs === String ? String(message.salePriceAmount1000) : message.salePriceAmount1000; + else + object.salePriceAmount1000 = options.longs === String ? $util.Long.prototype.toString.call(message.salePriceAmount1000) : options.longs === Number ? new $util.LongBits(message.salePriceAmount1000.low >>> 0, message.salePriceAmount1000.high >>> 0).toNumber() : message.salePriceAmount1000; + return object; + }; + + /** + * Converts this ProductSnapshot to JSON. + * @function toJSON + * @memberof proto.ProductSnapshot + * @instance + * @returns {Object.} JSON object + */ + ProductSnapshot.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ProductSnapshot; + })(); + + proto.ProtocolMessage = (function() { + + /** + * Properties of a ProtocolMessage. + * @memberof proto + * @interface IProtocolMessage + * @property {proto.IMessageKey|null} [key] ProtocolMessage key + * @property {proto.ProtocolMessage.ProtocolMessageType|null} [type] ProtocolMessage type + * @property {number|null} [ephemeralExpiration] ProtocolMessage ephemeralExpiration + * @property {number|Long|null} [ephemeralSettingTimestamp] ProtocolMessage ephemeralSettingTimestamp + * @property {proto.IHistorySyncNotification|null} [historySyncNotification] ProtocolMessage historySyncNotification + * @property {proto.IAppStateSyncKeyShare|null} [appStateSyncKeyShare] ProtocolMessage appStateSyncKeyShare + * @property {proto.IAppStateSyncKeyRequest|null} [appStateSyncKeyRequest] ProtocolMessage appStateSyncKeyRequest + * @property {proto.IInitialSecurityNotificationSettingSync|null} [initialSecurityNotificationSettingSync] ProtocolMessage initialSecurityNotificationSettingSync + * @property {proto.IAppStateFatalExceptionNotification|null} [appStateFatalExceptionNotification] ProtocolMessage appStateFatalExceptionNotification + * @property {proto.IDisappearingMode|null} [disappearingMode] ProtocolMessage disappearingMode + */ + + /** + * Constructs a new ProtocolMessage. + * @memberof proto + * @classdesc Represents a ProtocolMessage. + * @implements IProtocolMessage + * @constructor + * @param {proto.IProtocolMessage=} [properties] Properties to set + */ + function ProtocolMessage(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ProtocolMessage key. + * @member {proto.IMessageKey|null|undefined} key + * @memberof proto.ProtocolMessage + * @instance + */ + ProtocolMessage.prototype.key = null; + + /** + * ProtocolMessage type. + * @member {proto.ProtocolMessage.ProtocolMessageType} type + * @memberof proto.ProtocolMessage + * @instance + */ + ProtocolMessage.prototype.type = 0; + + /** + * ProtocolMessage ephemeralExpiration. + * @member {number} ephemeralExpiration + * @memberof proto.ProtocolMessage + * @instance + */ + ProtocolMessage.prototype.ephemeralExpiration = 0; + + /** + * ProtocolMessage ephemeralSettingTimestamp. + * @member {number|Long} ephemeralSettingTimestamp + * @memberof proto.ProtocolMessage + * @instance + */ + ProtocolMessage.prototype.ephemeralSettingTimestamp = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * ProtocolMessage historySyncNotification. + * @member {proto.IHistorySyncNotification|null|undefined} historySyncNotification + * @memberof proto.ProtocolMessage + * @instance + */ + ProtocolMessage.prototype.historySyncNotification = null; + + /** + * ProtocolMessage appStateSyncKeyShare. + * @member {proto.IAppStateSyncKeyShare|null|undefined} appStateSyncKeyShare + * @memberof proto.ProtocolMessage + * @instance + */ + ProtocolMessage.prototype.appStateSyncKeyShare = null; + + /** + * ProtocolMessage appStateSyncKeyRequest. + * @member {proto.IAppStateSyncKeyRequest|null|undefined} appStateSyncKeyRequest + * @memberof proto.ProtocolMessage + * @instance + */ + ProtocolMessage.prototype.appStateSyncKeyRequest = null; + + /** + * ProtocolMessage initialSecurityNotificationSettingSync. + * @member {proto.IInitialSecurityNotificationSettingSync|null|undefined} initialSecurityNotificationSettingSync + * @memberof proto.ProtocolMessage + * @instance + */ + ProtocolMessage.prototype.initialSecurityNotificationSettingSync = null; + + /** + * ProtocolMessage appStateFatalExceptionNotification. + * @member {proto.IAppStateFatalExceptionNotification|null|undefined} appStateFatalExceptionNotification + * @memberof proto.ProtocolMessage + * @instance + */ + ProtocolMessage.prototype.appStateFatalExceptionNotification = null; + + /** + * ProtocolMessage disappearingMode. + * @member {proto.IDisappearingMode|null|undefined} disappearingMode + * @memberof proto.ProtocolMessage + * @instance + */ + ProtocolMessage.prototype.disappearingMode = null; + + /** + * Creates a new ProtocolMessage instance using the specified properties. + * @function create + * @memberof proto.ProtocolMessage + * @static + * @param {proto.IProtocolMessage=} [properties] Properties to set + * @returns {proto.ProtocolMessage} ProtocolMessage instance + */ + ProtocolMessage.create = function create(properties) { + return new ProtocolMessage(properties); + }; + + /** + * Encodes the specified ProtocolMessage message. Does not implicitly {@link proto.ProtocolMessage.verify|verify} messages. + * @function encode + * @memberof proto.ProtocolMessage + * @static + * @param {proto.IProtocolMessage} message ProtocolMessage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ProtocolMessage.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.key != null && Object.hasOwnProperty.call(message, "key")) + $root.proto.MessageKey.encode(message.key, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.type); + if (message.ephemeralExpiration != null && Object.hasOwnProperty.call(message, "ephemeralExpiration")) + writer.uint32(/* id 4, wireType 0 =*/32).uint32(message.ephemeralExpiration); + if (message.ephemeralSettingTimestamp != null && Object.hasOwnProperty.call(message, "ephemeralSettingTimestamp")) + writer.uint32(/* id 5, wireType 0 =*/40).int64(message.ephemeralSettingTimestamp); + if (message.historySyncNotification != null && Object.hasOwnProperty.call(message, "historySyncNotification")) + $root.proto.HistorySyncNotification.encode(message.historySyncNotification, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.appStateSyncKeyShare != null && Object.hasOwnProperty.call(message, "appStateSyncKeyShare")) + $root.proto.AppStateSyncKeyShare.encode(message.appStateSyncKeyShare, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.appStateSyncKeyRequest != null && Object.hasOwnProperty.call(message, "appStateSyncKeyRequest")) + $root.proto.AppStateSyncKeyRequest.encode(message.appStateSyncKeyRequest, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.initialSecurityNotificationSettingSync != null && Object.hasOwnProperty.call(message, "initialSecurityNotificationSettingSync")) + $root.proto.InitialSecurityNotificationSettingSync.encode(message.initialSecurityNotificationSettingSync, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.appStateFatalExceptionNotification != null && Object.hasOwnProperty.call(message, "appStateFatalExceptionNotification")) + $root.proto.AppStateFatalExceptionNotification.encode(message.appStateFatalExceptionNotification, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.disappearingMode != null && Object.hasOwnProperty.call(message, "disappearingMode")) + $root.proto.DisappearingMode.encode(message.disappearingMode, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ProtocolMessage message, length delimited. Does not implicitly {@link proto.ProtocolMessage.verify|verify} messages. + * @function encodeDelimited + * @memberof proto.ProtocolMessage + * @static + * @param {proto.IProtocolMessage} message ProtocolMessage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ProtocolMessage.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ProtocolMessage message from the specified reader or buffer. + * @function decode + * @memberof proto.ProtocolMessage * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand @@ -28961,31 +29061,25 @@ $root.proto = (function() { return ProtocolMessage; })(); - proto.HistorySyncNotification = (function() { + proto.QuickReplyButton = (function() { /** - * Properties of a HistorySyncNotification. + * Properties of a QuickReplyButton. * @memberof proto - * @interface IHistorySyncNotification - * @property {Uint8Array|null} [fileSha256] HistorySyncNotification fileSha256 - * @property {number|Long|null} [fileLength] HistorySyncNotification fileLength - * @property {Uint8Array|null} [mediaKey] HistorySyncNotification mediaKey - * @property {Uint8Array|null} [fileEncSha256] HistorySyncNotification fileEncSha256 - * @property {string|null} [directPath] HistorySyncNotification directPath - * @property {proto.HistorySyncNotification.HistorySyncNotificationHistorySyncType|null} [syncType] HistorySyncNotification syncType - * @property {number|null} [chunkOrder] HistorySyncNotification chunkOrder - * @property {string|null} [originalMessageId] HistorySyncNotification originalMessageId + * @interface IQuickReplyButton + * @property {proto.IHighlyStructuredMessage|null} [displayText] QuickReplyButton displayText + * @property {string|null} [id] QuickReplyButton id */ /** - * Constructs a new HistorySyncNotification. + * Constructs a new QuickReplyButton. * @memberof proto - * @classdesc Represents a HistorySyncNotification. - * @implements IHistorySyncNotification + * @classdesc Represents a QuickReplyButton. + * @implements IQuickReplyButton * @constructor - * @param {proto.IHistorySyncNotification=} [properties] Properties to set + * @param {proto.IQuickReplyButton=} [properties] Properties to set */ - function HistorySyncNotification(properties) { + function QuickReplyButton(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -28993,166 +29087,88 @@ $root.proto = (function() { } /** - * HistorySyncNotification fileSha256. - * @member {Uint8Array} fileSha256 - * @memberof proto.HistorySyncNotification + * QuickReplyButton displayText. + * @member {proto.IHighlyStructuredMessage|null|undefined} displayText + * @memberof proto.QuickReplyButton * @instance */ - HistorySyncNotification.prototype.fileSha256 = $util.newBuffer([]); + QuickReplyButton.prototype.displayText = null; /** - * HistorySyncNotification fileLength. - * @member {number|Long} fileLength - * @memberof proto.HistorySyncNotification + * QuickReplyButton id. + * @member {string} id + * @memberof proto.QuickReplyButton * @instance */ - HistorySyncNotification.prototype.fileLength = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + QuickReplyButton.prototype.id = ""; /** - * HistorySyncNotification mediaKey. - * @member {Uint8Array} mediaKey - * @memberof proto.HistorySyncNotification - * @instance + * Creates a new QuickReplyButton instance using the specified properties. + * @function create + * @memberof proto.QuickReplyButton + * @static + * @param {proto.IQuickReplyButton=} [properties] Properties to set + * @returns {proto.QuickReplyButton} QuickReplyButton instance */ - HistorySyncNotification.prototype.mediaKey = $util.newBuffer([]); + QuickReplyButton.create = function create(properties) { + return new QuickReplyButton(properties); + }; /** - * HistorySyncNotification fileEncSha256. - * @member {Uint8Array} fileEncSha256 - * @memberof proto.HistorySyncNotification - * @instance + * Encodes the specified QuickReplyButton message. Does not implicitly {@link proto.QuickReplyButton.verify|verify} messages. + * @function encode + * @memberof proto.QuickReplyButton + * @static + * @param {proto.IQuickReplyButton} message QuickReplyButton message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - HistorySyncNotification.prototype.fileEncSha256 = $util.newBuffer([]); + QuickReplyButton.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.displayText != null && Object.hasOwnProperty.call(message, "displayText")) + $root.proto.HighlyStructuredMessage.encode(message.displayText, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.id); + return writer; + }; /** - * HistorySyncNotification directPath. - * @member {string} directPath - * @memberof proto.HistorySyncNotification - * @instance - */ - HistorySyncNotification.prototype.directPath = ""; - - /** - * HistorySyncNotification syncType. - * @member {proto.HistorySyncNotification.HistorySyncNotificationHistorySyncType} syncType - * @memberof proto.HistorySyncNotification - * @instance - */ - HistorySyncNotification.prototype.syncType = 0; - - /** - * HistorySyncNotification chunkOrder. - * @member {number} chunkOrder - * @memberof proto.HistorySyncNotification - * @instance - */ - HistorySyncNotification.prototype.chunkOrder = 0; - - /** - * HistorySyncNotification originalMessageId. - * @member {string} originalMessageId - * @memberof proto.HistorySyncNotification - * @instance - */ - HistorySyncNotification.prototype.originalMessageId = ""; - - /** - * Creates a new HistorySyncNotification instance using the specified properties. - * @function create - * @memberof proto.HistorySyncNotification - * @static - * @param {proto.IHistorySyncNotification=} [properties] Properties to set - * @returns {proto.HistorySyncNotification} HistorySyncNotification instance - */ - HistorySyncNotification.create = function create(properties) { - return new HistorySyncNotification(properties); - }; - - /** - * Encodes the specified HistorySyncNotification message. Does not implicitly {@link proto.HistorySyncNotification.verify|verify} messages. - * @function encode - * @memberof proto.HistorySyncNotification - * @static - * @param {proto.IHistorySyncNotification} message HistorySyncNotification message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - HistorySyncNotification.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.fileSha256 != null && Object.hasOwnProperty.call(message, "fileSha256")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.fileSha256); - if (message.fileLength != null && Object.hasOwnProperty.call(message, "fileLength")) - writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.fileLength); - if (message.mediaKey != null && Object.hasOwnProperty.call(message, "mediaKey")) - writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.mediaKey); - if (message.fileEncSha256 != null && Object.hasOwnProperty.call(message, "fileEncSha256")) - writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.fileEncSha256); - if (message.directPath != null && Object.hasOwnProperty.call(message, "directPath")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.directPath); - if (message.syncType != null && Object.hasOwnProperty.call(message, "syncType")) - writer.uint32(/* id 6, wireType 0 =*/48).int32(message.syncType); - if (message.chunkOrder != null && Object.hasOwnProperty.call(message, "chunkOrder")) - writer.uint32(/* id 7, wireType 0 =*/56).uint32(message.chunkOrder); - if (message.originalMessageId != null && Object.hasOwnProperty.call(message, "originalMessageId")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.originalMessageId); - return writer; - }; - - /** - * Encodes the specified HistorySyncNotification message, length delimited. Does not implicitly {@link proto.HistorySyncNotification.verify|verify} messages. + * Encodes the specified QuickReplyButton message, length delimited. Does not implicitly {@link proto.QuickReplyButton.verify|verify} messages. * @function encodeDelimited - * @memberof proto.HistorySyncNotification + * @memberof proto.QuickReplyButton * @static - * @param {proto.IHistorySyncNotification} message HistorySyncNotification message or plain object to encode + * @param {proto.IQuickReplyButton} message QuickReplyButton message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - HistorySyncNotification.encodeDelimited = function encodeDelimited(message, writer) { + QuickReplyButton.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a HistorySyncNotification message from the specified reader or buffer. + * Decodes a QuickReplyButton message from the specified reader or buffer. * @function decode - * @memberof proto.HistorySyncNotification + * @memberof proto.QuickReplyButton * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {proto.HistorySyncNotification} HistorySyncNotification + * @returns {proto.QuickReplyButton} QuickReplyButton * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - HistorySyncNotification.decode = function decode(reader, length) { + QuickReplyButton.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.HistorySyncNotification(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.QuickReplyButton(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.fileSha256 = reader.bytes(); + message.displayText = $root.proto.HighlyStructuredMessage.decode(reader, reader.uint32()); break; case 2: - message.fileLength = reader.uint64(); - break; - case 3: - message.mediaKey = reader.bytes(); - break; - case 4: - message.fileEncSha256 = reader.bytes(); - break; - case 5: - message.directPath = reader.string(); - break; - case 6: - message.syncType = reader.int32(); - break; - case 7: - message.chunkOrder = reader.uint32(); - break; - case 8: - message.originalMessageId = reader.string(); + message.id = reader.string(); break; default: reader.skipType(tag & 7); @@ -29163,254 +29179,124 @@ $root.proto = (function() { }; /** - * Decodes a HistorySyncNotification message from the specified reader or buffer, length delimited. + * Decodes a QuickReplyButton message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof proto.HistorySyncNotification + * @memberof proto.QuickReplyButton * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.HistorySyncNotification} HistorySyncNotification + * @returns {proto.QuickReplyButton} QuickReplyButton * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - HistorySyncNotification.decodeDelimited = function decodeDelimited(reader) { + QuickReplyButton.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a HistorySyncNotification message. + * Verifies a QuickReplyButton message. * @function verify - * @memberof proto.HistorySyncNotification + * @memberof proto.QuickReplyButton * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - HistorySyncNotification.verify = function verify(message) { + QuickReplyButton.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.fileSha256 != null && message.hasOwnProperty("fileSha256")) - if (!(message.fileSha256 && typeof message.fileSha256.length === "number" || $util.isString(message.fileSha256))) - return "fileSha256: buffer expected"; - if (message.fileLength != null && message.hasOwnProperty("fileLength")) - if (!$util.isInteger(message.fileLength) && !(message.fileLength && $util.isInteger(message.fileLength.low) && $util.isInteger(message.fileLength.high))) - return "fileLength: integer|Long expected"; - if (message.mediaKey != null && message.hasOwnProperty("mediaKey")) - if (!(message.mediaKey && typeof message.mediaKey.length === "number" || $util.isString(message.mediaKey))) - return "mediaKey: buffer expected"; - if (message.fileEncSha256 != null && message.hasOwnProperty("fileEncSha256")) - if (!(message.fileEncSha256 && typeof message.fileEncSha256.length === "number" || $util.isString(message.fileEncSha256))) - return "fileEncSha256: buffer expected"; - if (message.directPath != null && message.hasOwnProperty("directPath")) - if (!$util.isString(message.directPath)) - return "directPath: string expected"; - if (message.syncType != null && message.hasOwnProperty("syncType")) - switch (message.syncType) { - default: - return "syncType: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - break; - } - if (message.chunkOrder != null && message.hasOwnProperty("chunkOrder")) - if (!$util.isInteger(message.chunkOrder)) - return "chunkOrder: integer expected"; - if (message.originalMessageId != null && message.hasOwnProperty("originalMessageId")) - if (!$util.isString(message.originalMessageId)) - return "originalMessageId: string expected"; + if (message.displayText != null && message.hasOwnProperty("displayText")) { + var error = $root.proto.HighlyStructuredMessage.verify(message.displayText); + if (error) + return "displayText." + error; + } + if (message.id != null && message.hasOwnProperty("id")) + if (!$util.isString(message.id)) + return "id: string expected"; return null; }; /** - * Creates a HistorySyncNotification message from a plain object. Also converts values to their respective internal types. + * Creates a QuickReplyButton message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof proto.HistorySyncNotification + * @memberof proto.QuickReplyButton * @static * @param {Object.} object Plain object - * @returns {proto.HistorySyncNotification} HistorySyncNotification + * @returns {proto.QuickReplyButton} QuickReplyButton */ - HistorySyncNotification.fromObject = function fromObject(object) { - if (object instanceof $root.proto.HistorySyncNotification) + QuickReplyButton.fromObject = function fromObject(object) { + if (object instanceof $root.proto.QuickReplyButton) return object; - var message = new $root.proto.HistorySyncNotification(); - if (object.fileSha256 != null) - if (typeof object.fileSha256 === "string") - $util.base64.decode(object.fileSha256, message.fileSha256 = $util.newBuffer($util.base64.length(object.fileSha256)), 0); - else if (object.fileSha256.length) - message.fileSha256 = object.fileSha256; - if (object.fileLength != null) - if ($util.Long) - (message.fileLength = $util.Long.fromValue(object.fileLength)).unsigned = true; - else if (typeof object.fileLength === "string") - message.fileLength = parseInt(object.fileLength, 10); - else if (typeof object.fileLength === "number") - message.fileLength = object.fileLength; - else if (typeof object.fileLength === "object") - message.fileLength = new $util.LongBits(object.fileLength.low >>> 0, object.fileLength.high >>> 0).toNumber(true); - if (object.mediaKey != null) - if (typeof object.mediaKey === "string") - $util.base64.decode(object.mediaKey, message.mediaKey = $util.newBuffer($util.base64.length(object.mediaKey)), 0); - else if (object.mediaKey.length) - message.mediaKey = object.mediaKey; - if (object.fileEncSha256 != null) - if (typeof object.fileEncSha256 === "string") - $util.base64.decode(object.fileEncSha256, message.fileEncSha256 = $util.newBuffer($util.base64.length(object.fileEncSha256)), 0); - else if (object.fileEncSha256.length) - message.fileEncSha256 = object.fileEncSha256; - if (object.directPath != null) - message.directPath = String(object.directPath); - switch (object.syncType) { - case "INITIAL_BOOTSTRAP": - case 0: - message.syncType = 0; - break; - case "INITIAL_STATUS_V3": - case 1: - message.syncType = 1; - break; - case "FULL": - case 2: - message.syncType = 2; - break; - case "RECENT": - case 3: - message.syncType = 3; - break; - case "PUSH_NAME": - case 4: - message.syncType = 4; - break; + var message = new $root.proto.QuickReplyButton(); + if (object.displayText != null) { + if (typeof object.displayText !== "object") + throw TypeError(".proto.QuickReplyButton.displayText: object expected"); + message.displayText = $root.proto.HighlyStructuredMessage.fromObject(object.displayText); } - if (object.chunkOrder != null) - message.chunkOrder = object.chunkOrder >>> 0; - if (object.originalMessageId != null) - message.originalMessageId = String(object.originalMessageId); + if (object.id != null) + message.id = String(object.id); return message; }; /** - * Creates a plain object from a HistorySyncNotification message. Also converts values to other types if specified. + * Creates a plain object from a QuickReplyButton message. Also converts values to other types if specified. * @function toObject - * @memberof proto.HistorySyncNotification + * @memberof proto.QuickReplyButton * @static - * @param {proto.HistorySyncNotification} message HistorySyncNotification + * @param {proto.QuickReplyButton} message QuickReplyButton * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - HistorySyncNotification.toObject = function toObject(message, options) { + QuickReplyButton.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - if (options.bytes === String) - object.fileSha256 = ""; - else { - object.fileSha256 = []; - if (options.bytes !== Array) - object.fileSha256 = $util.newBuffer(object.fileSha256); - } - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.fileLength = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.fileLength = options.longs === String ? "0" : 0; - if (options.bytes === String) - object.mediaKey = ""; - else { - object.mediaKey = []; - if (options.bytes !== Array) - object.mediaKey = $util.newBuffer(object.mediaKey); - } - if (options.bytes === String) - object.fileEncSha256 = ""; - else { - object.fileEncSha256 = []; - if (options.bytes !== Array) - object.fileEncSha256 = $util.newBuffer(object.fileEncSha256); - } - object.directPath = ""; - object.syncType = options.enums === String ? "INITIAL_BOOTSTRAP" : 0; - object.chunkOrder = 0; - object.originalMessageId = ""; + object.displayText = null; + object.id = ""; } - if (message.fileSha256 != null && message.hasOwnProperty("fileSha256")) - object.fileSha256 = options.bytes === String ? $util.base64.encode(message.fileSha256, 0, message.fileSha256.length) : options.bytes === Array ? Array.prototype.slice.call(message.fileSha256) : message.fileSha256; - if (message.fileLength != null && message.hasOwnProperty("fileLength")) - if (typeof message.fileLength === "number") - object.fileLength = options.longs === String ? String(message.fileLength) : message.fileLength; - else - object.fileLength = options.longs === String ? $util.Long.prototype.toString.call(message.fileLength) : options.longs === Number ? new $util.LongBits(message.fileLength.low >>> 0, message.fileLength.high >>> 0).toNumber(true) : message.fileLength; - if (message.mediaKey != null && message.hasOwnProperty("mediaKey")) - object.mediaKey = options.bytes === String ? $util.base64.encode(message.mediaKey, 0, message.mediaKey.length) : options.bytes === Array ? Array.prototype.slice.call(message.mediaKey) : message.mediaKey; - if (message.fileEncSha256 != null && message.hasOwnProperty("fileEncSha256")) - object.fileEncSha256 = options.bytes === String ? $util.base64.encode(message.fileEncSha256, 0, message.fileEncSha256.length) : options.bytes === Array ? Array.prototype.slice.call(message.fileEncSha256) : message.fileEncSha256; - if (message.directPath != null && message.hasOwnProperty("directPath")) - object.directPath = message.directPath; - if (message.syncType != null && message.hasOwnProperty("syncType")) - object.syncType = options.enums === String ? $root.proto.HistorySyncNotification.HistorySyncNotificationHistorySyncType[message.syncType] : message.syncType; - if (message.chunkOrder != null && message.hasOwnProperty("chunkOrder")) - object.chunkOrder = message.chunkOrder; - if (message.originalMessageId != null && message.hasOwnProperty("originalMessageId")) - object.originalMessageId = message.originalMessageId; + if (message.displayText != null && message.hasOwnProperty("displayText")) + object.displayText = $root.proto.HighlyStructuredMessage.toObject(message.displayText, options); + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; return object; }; /** - * Converts this HistorySyncNotification to JSON. + * Converts this QuickReplyButton to JSON. * @function toJSON - * @memberof proto.HistorySyncNotification + * @memberof proto.QuickReplyButton * @instance * @returns {Object.} JSON object */ - HistorySyncNotification.prototype.toJSON = function toJSON() { + QuickReplyButton.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - /** - * HistorySyncNotificationHistorySyncType enum. - * @name proto.HistorySyncNotification.HistorySyncNotificationHistorySyncType - * @enum {number} - * @property {number} INITIAL_BOOTSTRAP=0 INITIAL_BOOTSTRAP value - * @property {number} INITIAL_STATUS_V3=1 INITIAL_STATUS_V3 value - * @property {number} FULL=2 FULL value - * @property {number} RECENT=3 RECENT value - * @property {number} PUSH_NAME=4 PUSH_NAME value - */ - HistorySyncNotification.HistorySyncNotificationHistorySyncType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "INITIAL_BOOTSTRAP"] = 0; - values[valuesById[1] = "INITIAL_STATUS_V3"] = 1; - values[valuesById[2] = "FULL"] = 2; - values[valuesById[3] = "RECENT"] = 3; - values[valuesById[4] = "PUSH_NAME"] = 4; - return values; - })(); - - return HistorySyncNotification; + return QuickReplyButton; })(); - proto.AppStateSyncKey = (function() { + proto.ReactionMessage = (function() { /** - * Properties of an AppStateSyncKey. + * Properties of a ReactionMessage. * @memberof proto - * @interface IAppStateSyncKey - * @property {proto.IAppStateSyncKeyId|null} [keyId] AppStateSyncKey keyId - * @property {proto.IAppStateSyncKeyData|null} [keyData] AppStateSyncKey keyData + * @interface IReactionMessage + * @property {proto.IMessageKey|null} [key] ReactionMessage key + * @property {string|null} [text] ReactionMessage text + * @property {string|null} [groupingKey] ReactionMessage groupingKey + * @property {number|Long|null} [senderTimestampMs] ReactionMessage senderTimestampMs */ /** - * Constructs a new AppStateSyncKey. + * Constructs a new ReactionMessage. * @memberof proto - * @classdesc Represents an AppStateSyncKey. - * @implements IAppStateSyncKey + * @classdesc Represents a ReactionMessage. + * @implements IReactionMessage * @constructor - * @param {proto.IAppStateSyncKey=} [properties] Properties to set + * @param {proto.IReactionMessage=} [properties] Properties to set */ - function AppStateSyncKey(properties) { + function ReactionMessage(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -29418,88 +29304,114 @@ $root.proto = (function() { } /** - * AppStateSyncKey keyId. - * @member {proto.IAppStateSyncKeyId|null|undefined} keyId - * @memberof proto.AppStateSyncKey + * ReactionMessage key. + * @member {proto.IMessageKey|null|undefined} key + * @memberof proto.ReactionMessage * @instance */ - AppStateSyncKey.prototype.keyId = null; + ReactionMessage.prototype.key = null; /** - * AppStateSyncKey keyData. - * @member {proto.IAppStateSyncKeyData|null|undefined} keyData - * @memberof proto.AppStateSyncKey + * ReactionMessage text. + * @member {string} text + * @memberof proto.ReactionMessage * @instance */ - AppStateSyncKey.prototype.keyData = null; + ReactionMessage.prototype.text = ""; /** - * Creates a new AppStateSyncKey instance using the specified properties. + * ReactionMessage groupingKey. + * @member {string} groupingKey + * @memberof proto.ReactionMessage + * @instance + */ + ReactionMessage.prototype.groupingKey = ""; + + /** + * ReactionMessage senderTimestampMs. + * @member {number|Long} senderTimestampMs + * @memberof proto.ReactionMessage + * @instance + */ + ReactionMessage.prototype.senderTimestampMs = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new ReactionMessage instance using the specified properties. * @function create - * @memberof proto.AppStateSyncKey + * @memberof proto.ReactionMessage * @static - * @param {proto.IAppStateSyncKey=} [properties] Properties to set - * @returns {proto.AppStateSyncKey} AppStateSyncKey instance + * @param {proto.IReactionMessage=} [properties] Properties to set + * @returns {proto.ReactionMessage} ReactionMessage instance */ - AppStateSyncKey.create = function create(properties) { - return new AppStateSyncKey(properties); + ReactionMessage.create = function create(properties) { + return new ReactionMessage(properties); }; /** - * Encodes the specified AppStateSyncKey message. Does not implicitly {@link proto.AppStateSyncKey.verify|verify} messages. + * Encodes the specified ReactionMessage message. Does not implicitly {@link proto.ReactionMessage.verify|verify} messages. * @function encode - * @memberof proto.AppStateSyncKey + * @memberof proto.ReactionMessage * @static - * @param {proto.IAppStateSyncKey} message AppStateSyncKey message or plain object to encode + * @param {proto.IReactionMessage} message ReactionMessage message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AppStateSyncKey.encode = function encode(message, writer) { + ReactionMessage.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.keyId != null && Object.hasOwnProperty.call(message, "keyId")) - $root.proto.AppStateSyncKeyId.encode(message.keyId, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.keyData != null && Object.hasOwnProperty.call(message, "keyData")) - $root.proto.AppStateSyncKeyData.encode(message.keyData, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.key != null && Object.hasOwnProperty.call(message, "key")) + $root.proto.MessageKey.encode(message.key, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.text != null && Object.hasOwnProperty.call(message, "text")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.text); + if (message.groupingKey != null && Object.hasOwnProperty.call(message, "groupingKey")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.groupingKey); + if (message.senderTimestampMs != null && Object.hasOwnProperty.call(message, "senderTimestampMs")) + writer.uint32(/* id 4, wireType 0 =*/32).int64(message.senderTimestampMs); return writer; }; /** - * Encodes the specified AppStateSyncKey message, length delimited. Does not implicitly {@link proto.AppStateSyncKey.verify|verify} messages. + * Encodes the specified ReactionMessage message, length delimited. Does not implicitly {@link proto.ReactionMessage.verify|verify} messages. * @function encodeDelimited - * @memberof proto.AppStateSyncKey + * @memberof proto.ReactionMessage * @static - * @param {proto.IAppStateSyncKey} message AppStateSyncKey message or plain object to encode + * @param {proto.IReactionMessage} message ReactionMessage message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AppStateSyncKey.encodeDelimited = function encodeDelimited(message, writer) { + ReactionMessage.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an AppStateSyncKey message from the specified reader or buffer. + * Decodes a ReactionMessage message from the specified reader or buffer. * @function decode - * @memberof proto.AppStateSyncKey + * @memberof proto.ReactionMessage * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {proto.AppStateSyncKey} AppStateSyncKey + * @returns {proto.ReactionMessage} ReactionMessage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - AppStateSyncKey.decode = function decode(reader, length) { + ReactionMessage.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.AppStateSyncKey(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.ReactionMessage(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.keyId = $root.proto.AppStateSyncKeyId.decode(reader, reader.uint32()); + message.key = $root.proto.MessageKey.decode(reader, reader.uint32()); break; case 2: - message.keyData = $root.proto.AppStateSyncKeyData.decode(reader, reader.uint32()); + message.text = reader.string(); + break; + case 3: + message.groupingKey = reader.string(); + break; + case 4: + message.senderTimestampMs = reader.int64(); break; default: reader.skipType(tag & 7); @@ -29510,126 +29422,157 @@ $root.proto = (function() { }; /** - * Decodes an AppStateSyncKey message from the specified reader or buffer, length delimited. + * Decodes a ReactionMessage message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof proto.AppStateSyncKey + * @memberof proto.ReactionMessage * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.AppStateSyncKey} AppStateSyncKey + * @returns {proto.ReactionMessage} ReactionMessage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - AppStateSyncKey.decodeDelimited = function decodeDelimited(reader) { + ReactionMessage.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an AppStateSyncKey message. + * Verifies a ReactionMessage message. * @function verify - * @memberof proto.AppStateSyncKey + * @memberof proto.ReactionMessage * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - AppStateSyncKey.verify = function verify(message) { + ReactionMessage.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.keyId != null && message.hasOwnProperty("keyId")) { - var error = $root.proto.AppStateSyncKeyId.verify(message.keyId); - if (error) - return "keyId." + error; - } - if (message.keyData != null && message.hasOwnProperty("keyData")) { - var error = $root.proto.AppStateSyncKeyData.verify(message.keyData); + if (message.key != null && message.hasOwnProperty("key")) { + var error = $root.proto.MessageKey.verify(message.key); if (error) - return "keyData." + error; + return "key." + error; } + if (message.text != null && message.hasOwnProperty("text")) + if (!$util.isString(message.text)) + return "text: string expected"; + if (message.groupingKey != null && message.hasOwnProperty("groupingKey")) + if (!$util.isString(message.groupingKey)) + return "groupingKey: string expected"; + if (message.senderTimestampMs != null && message.hasOwnProperty("senderTimestampMs")) + if (!$util.isInteger(message.senderTimestampMs) && !(message.senderTimestampMs && $util.isInteger(message.senderTimestampMs.low) && $util.isInteger(message.senderTimestampMs.high))) + return "senderTimestampMs: integer|Long expected"; return null; }; /** - * Creates an AppStateSyncKey message from a plain object. Also converts values to their respective internal types. + * Creates a ReactionMessage message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof proto.AppStateSyncKey + * @memberof proto.ReactionMessage * @static * @param {Object.} object Plain object - * @returns {proto.AppStateSyncKey} AppStateSyncKey + * @returns {proto.ReactionMessage} ReactionMessage */ - AppStateSyncKey.fromObject = function fromObject(object) { - if (object instanceof $root.proto.AppStateSyncKey) + ReactionMessage.fromObject = function fromObject(object) { + if (object instanceof $root.proto.ReactionMessage) return object; - var message = new $root.proto.AppStateSyncKey(); - if (object.keyId != null) { - if (typeof object.keyId !== "object") - throw TypeError(".proto.AppStateSyncKey.keyId: object expected"); - message.keyId = $root.proto.AppStateSyncKeyId.fromObject(object.keyId); - } - if (object.keyData != null) { - if (typeof object.keyData !== "object") - throw TypeError(".proto.AppStateSyncKey.keyData: object expected"); - message.keyData = $root.proto.AppStateSyncKeyData.fromObject(object.keyData); + var message = new $root.proto.ReactionMessage(); + if (object.key != null) { + if (typeof object.key !== "object") + throw TypeError(".proto.ReactionMessage.key: object expected"); + message.key = $root.proto.MessageKey.fromObject(object.key); } + if (object.text != null) + message.text = String(object.text); + if (object.groupingKey != null) + message.groupingKey = String(object.groupingKey); + if (object.senderTimestampMs != null) + if ($util.Long) + (message.senderTimestampMs = $util.Long.fromValue(object.senderTimestampMs)).unsigned = false; + else if (typeof object.senderTimestampMs === "string") + message.senderTimestampMs = parseInt(object.senderTimestampMs, 10); + else if (typeof object.senderTimestampMs === "number") + message.senderTimestampMs = object.senderTimestampMs; + else if (typeof object.senderTimestampMs === "object") + message.senderTimestampMs = new $util.LongBits(object.senderTimestampMs.low >>> 0, object.senderTimestampMs.high >>> 0).toNumber(); return message; }; /** - * Creates a plain object from an AppStateSyncKey message. Also converts values to other types if specified. + * Creates a plain object from a ReactionMessage message. Also converts values to other types if specified. * @function toObject - * @memberof proto.AppStateSyncKey + * @memberof proto.ReactionMessage * @static - * @param {proto.AppStateSyncKey} message AppStateSyncKey + * @param {proto.ReactionMessage} message ReactionMessage * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - AppStateSyncKey.toObject = function toObject(message, options) { + ReactionMessage.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.keyId = null; - object.keyData = null; + object.key = null; + object.text = ""; + object.groupingKey = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.senderTimestampMs = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.senderTimestampMs = options.longs === String ? "0" : 0; } - if (message.keyId != null && message.hasOwnProperty("keyId")) - object.keyId = $root.proto.AppStateSyncKeyId.toObject(message.keyId, options); - if (message.keyData != null && message.hasOwnProperty("keyData")) - object.keyData = $root.proto.AppStateSyncKeyData.toObject(message.keyData, options); + if (message.key != null && message.hasOwnProperty("key")) + object.key = $root.proto.MessageKey.toObject(message.key, options); + if (message.text != null && message.hasOwnProperty("text")) + object.text = message.text; + if (message.groupingKey != null && message.hasOwnProperty("groupingKey")) + object.groupingKey = message.groupingKey; + if (message.senderTimestampMs != null && message.hasOwnProperty("senderTimestampMs")) + if (typeof message.senderTimestampMs === "number") + object.senderTimestampMs = options.longs === String ? String(message.senderTimestampMs) : message.senderTimestampMs; + else + object.senderTimestampMs = options.longs === String ? $util.Long.prototype.toString.call(message.senderTimestampMs) : options.longs === Number ? new $util.LongBits(message.senderTimestampMs.low >>> 0, message.senderTimestampMs.high >>> 0).toNumber() : message.senderTimestampMs; return object; }; /** - * Converts this AppStateSyncKey to JSON. + * Converts this ReactionMessage to JSON. * @function toJSON - * @memberof proto.AppStateSyncKey + * @memberof proto.ReactionMessage * @instance * @returns {Object.} JSON object */ - AppStateSyncKey.prototype.toJSON = function toJSON() { + ReactionMessage.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return AppStateSyncKey; + return ReactionMessage; })(); - proto.AppStateSyncKeyId = (function() { + proto.RequestPaymentMessage = (function() { /** - * Properties of an AppStateSyncKeyId. + * Properties of a RequestPaymentMessage. * @memberof proto - * @interface IAppStateSyncKeyId - * @property {Uint8Array|null} [keyId] AppStateSyncKeyId keyId + * @interface IRequestPaymentMessage + * @property {proto.IMessage|null} [noteMessage] RequestPaymentMessage noteMessage + * @property {string|null} [currencyCodeIso4217] RequestPaymentMessage currencyCodeIso4217 + * @property {number|Long|null} [amount1000] RequestPaymentMessage amount1000 + * @property {string|null} [requestFrom] RequestPaymentMessage requestFrom + * @property {number|Long|null} [expiryTimestamp] RequestPaymentMessage expiryTimestamp + * @property {proto.IMoney|null} [amount] RequestPaymentMessage amount + * @property {proto.IPaymentBackground|null} [background] RequestPaymentMessage background */ /** - * Constructs a new AppStateSyncKeyId. + * Constructs a new RequestPaymentMessage. * @memberof proto - * @classdesc Represents an AppStateSyncKeyId. - * @implements IAppStateSyncKeyId + * @classdesc Represents a RequestPaymentMessage. + * @implements IRequestPaymentMessage * @constructor - * @param {proto.IAppStateSyncKeyId=} [properties] Properties to set + * @param {proto.IRequestPaymentMessage=} [properties] Properties to set */ - function AppStateSyncKeyId(properties) { + function RequestPaymentMessage(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -29637,75 +29580,153 @@ $root.proto = (function() { } /** - * AppStateSyncKeyId keyId. - * @member {Uint8Array} keyId - * @memberof proto.AppStateSyncKeyId + * RequestPaymentMessage noteMessage. + * @member {proto.IMessage|null|undefined} noteMessage + * @memberof proto.RequestPaymentMessage * @instance */ - AppStateSyncKeyId.prototype.keyId = $util.newBuffer([]); + RequestPaymentMessage.prototype.noteMessage = null; /** - * Creates a new AppStateSyncKeyId instance using the specified properties. + * RequestPaymentMessage currencyCodeIso4217. + * @member {string} currencyCodeIso4217 + * @memberof proto.RequestPaymentMessage + * @instance + */ + RequestPaymentMessage.prototype.currencyCodeIso4217 = ""; + + /** + * RequestPaymentMessage amount1000. + * @member {number|Long} amount1000 + * @memberof proto.RequestPaymentMessage + * @instance + */ + RequestPaymentMessage.prototype.amount1000 = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * RequestPaymentMessage requestFrom. + * @member {string} requestFrom + * @memberof proto.RequestPaymentMessage + * @instance + */ + RequestPaymentMessage.prototype.requestFrom = ""; + + /** + * RequestPaymentMessage expiryTimestamp. + * @member {number|Long} expiryTimestamp + * @memberof proto.RequestPaymentMessage + * @instance + */ + RequestPaymentMessage.prototype.expiryTimestamp = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * RequestPaymentMessage amount. + * @member {proto.IMoney|null|undefined} amount + * @memberof proto.RequestPaymentMessage + * @instance + */ + RequestPaymentMessage.prototype.amount = null; + + /** + * RequestPaymentMessage background. + * @member {proto.IPaymentBackground|null|undefined} background + * @memberof proto.RequestPaymentMessage + * @instance + */ + RequestPaymentMessage.prototype.background = null; + + /** + * Creates a new RequestPaymentMessage instance using the specified properties. * @function create - * @memberof proto.AppStateSyncKeyId + * @memberof proto.RequestPaymentMessage * @static - * @param {proto.IAppStateSyncKeyId=} [properties] Properties to set - * @returns {proto.AppStateSyncKeyId} AppStateSyncKeyId instance + * @param {proto.IRequestPaymentMessage=} [properties] Properties to set + * @returns {proto.RequestPaymentMessage} RequestPaymentMessage instance */ - AppStateSyncKeyId.create = function create(properties) { - return new AppStateSyncKeyId(properties); + RequestPaymentMessage.create = function create(properties) { + return new RequestPaymentMessage(properties); }; /** - * Encodes the specified AppStateSyncKeyId message. Does not implicitly {@link proto.AppStateSyncKeyId.verify|verify} messages. + * Encodes the specified RequestPaymentMessage message. Does not implicitly {@link proto.RequestPaymentMessage.verify|verify} messages. * @function encode - * @memberof proto.AppStateSyncKeyId + * @memberof proto.RequestPaymentMessage * @static - * @param {proto.IAppStateSyncKeyId} message AppStateSyncKeyId message or plain object to encode + * @param {proto.IRequestPaymentMessage} message RequestPaymentMessage message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AppStateSyncKeyId.encode = function encode(message, writer) { + RequestPaymentMessage.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.keyId != null && Object.hasOwnProperty.call(message, "keyId")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.keyId); + if (message.currencyCodeIso4217 != null && Object.hasOwnProperty.call(message, "currencyCodeIso4217")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.currencyCodeIso4217); + if (message.amount1000 != null && Object.hasOwnProperty.call(message, "amount1000")) + writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.amount1000); + if (message.requestFrom != null && Object.hasOwnProperty.call(message, "requestFrom")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestFrom); + if (message.noteMessage != null && Object.hasOwnProperty.call(message, "noteMessage")) + $root.proto.Message.encode(message.noteMessage, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.expiryTimestamp != null && Object.hasOwnProperty.call(message, "expiryTimestamp")) + writer.uint32(/* id 5, wireType 0 =*/40).int64(message.expiryTimestamp); + if (message.amount != null && Object.hasOwnProperty.call(message, "amount")) + $root.proto.Money.encode(message.amount, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.background != null && Object.hasOwnProperty.call(message, "background")) + $root.proto.PaymentBackground.encode(message.background, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); return writer; }; /** - * Encodes the specified AppStateSyncKeyId message, length delimited. Does not implicitly {@link proto.AppStateSyncKeyId.verify|verify} messages. + * Encodes the specified RequestPaymentMessage message, length delimited. Does not implicitly {@link proto.RequestPaymentMessage.verify|verify} messages. * @function encodeDelimited - * @memberof proto.AppStateSyncKeyId + * @memberof proto.RequestPaymentMessage * @static - * @param {proto.IAppStateSyncKeyId} message AppStateSyncKeyId message or plain object to encode + * @param {proto.IRequestPaymentMessage} message RequestPaymentMessage message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AppStateSyncKeyId.encodeDelimited = function encodeDelimited(message, writer) { + RequestPaymentMessage.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an AppStateSyncKeyId message from the specified reader or buffer. + * Decodes a RequestPaymentMessage message from the specified reader or buffer. * @function decode - * @memberof proto.AppStateSyncKeyId + * @memberof proto.RequestPaymentMessage * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {proto.AppStateSyncKeyId} AppStateSyncKeyId + * @returns {proto.RequestPaymentMessage} RequestPaymentMessage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - AppStateSyncKeyId.decode = function decode(reader, length) { + RequestPaymentMessage.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.AppStateSyncKeyId(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.RequestPaymentMessage(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { + case 4: + message.noteMessage = $root.proto.Message.decode(reader, reader.uint32()); + break; case 1: - message.keyId = reader.bytes(); + message.currencyCodeIso4217 = reader.string(); + break; + case 2: + message.amount1000 = reader.uint64(); + break; + case 3: + message.requestFrom = reader.string(); + break; + case 5: + message.expiryTimestamp = reader.int64(); + break; + case 6: + message.amount = $root.proto.Money.decode(reader, reader.uint32()); + break; + case 7: + message.background = $root.proto.PaymentBackground.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -29716,119 +29737,201 @@ $root.proto = (function() { }; /** - * Decodes an AppStateSyncKeyId message from the specified reader or buffer, length delimited. + * Decodes a RequestPaymentMessage message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof proto.AppStateSyncKeyId + * @memberof proto.RequestPaymentMessage * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.AppStateSyncKeyId} AppStateSyncKeyId + * @returns {proto.RequestPaymentMessage} RequestPaymentMessage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - AppStateSyncKeyId.decodeDelimited = function decodeDelimited(reader) { + RequestPaymentMessage.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an AppStateSyncKeyId message. + * Verifies a RequestPaymentMessage message. * @function verify - * @memberof proto.AppStateSyncKeyId + * @memberof proto.RequestPaymentMessage * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - AppStateSyncKeyId.verify = function verify(message) { + RequestPaymentMessage.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.keyId != null && message.hasOwnProperty("keyId")) - if (!(message.keyId && typeof message.keyId.length === "number" || $util.isString(message.keyId))) - return "keyId: buffer expected"; + if (message.noteMessage != null && message.hasOwnProperty("noteMessage")) { + var error = $root.proto.Message.verify(message.noteMessage); + if (error) + return "noteMessage." + error; + } + if (message.currencyCodeIso4217 != null && message.hasOwnProperty("currencyCodeIso4217")) + if (!$util.isString(message.currencyCodeIso4217)) + return "currencyCodeIso4217: string expected"; + if (message.amount1000 != null && message.hasOwnProperty("amount1000")) + if (!$util.isInteger(message.amount1000) && !(message.amount1000 && $util.isInteger(message.amount1000.low) && $util.isInteger(message.amount1000.high))) + return "amount1000: integer|Long expected"; + if (message.requestFrom != null && message.hasOwnProperty("requestFrom")) + if (!$util.isString(message.requestFrom)) + return "requestFrom: string expected"; + if (message.expiryTimestamp != null && message.hasOwnProperty("expiryTimestamp")) + if (!$util.isInteger(message.expiryTimestamp) && !(message.expiryTimestamp && $util.isInteger(message.expiryTimestamp.low) && $util.isInteger(message.expiryTimestamp.high))) + return "expiryTimestamp: integer|Long expected"; + if (message.amount != null && message.hasOwnProperty("amount")) { + var error = $root.proto.Money.verify(message.amount); + if (error) + return "amount." + error; + } + if (message.background != null && message.hasOwnProperty("background")) { + var error = $root.proto.PaymentBackground.verify(message.background); + if (error) + return "background." + error; + } return null; }; /** - * Creates an AppStateSyncKeyId message from a plain object. Also converts values to their respective internal types. + * Creates a RequestPaymentMessage message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof proto.AppStateSyncKeyId + * @memberof proto.RequestPaymentMessage * @static * @param {Object.} object Plain object - * @returns {proto.AppStateSyncKeyId} AppStateSyncKeyId + * @returns {proto.RequestPaymentMessage} RequestPaymentMessage */ - AppStateSyncKeyId.fromObject = function fromObject(object) { - if (object instanceof $root.proto.AppStateSyncKeyId) + RequestPaymentMessage.fromObject = function fromObject(object) { + if (object instanceof $root.proto.RequestPaymentMessage) return object; - var message = new $root.proto.AppStateSyncKeyId(); - if (object.keyId != null) - if (typeof object.keyId === "string") - $util.base64.decode(object.keyId, message.keyId = $util.newBuffer($util.base64.length(object.keyId)), 0); - else if (object.keyId.length) - message.keyId = object.keyId; + var message = new $root.proto.RequestPaymentMessage(); + if (object.noteMessage != null) { + if (typeof object.noteMessage !== "object") + throw TypeError(".proto.RequestPaymentMessage.noteMessage: object expected"); + message.noteMessage = $root.proto.Message.fromObject(object.noteMessage); + } + if (object.currencyCodeIso4217 != null) + message.currencyCodeIso4217 = String(object.currencyCodeIso4217); + if (object.amount1000 != null) + if ($util.Long) + (message.amount1000 = $util.Long.fromValue(object.amount1000)).unsigned = true; + else if (typeof object.amount1000 === "string") + message.amount1000 = parseInt(object.amount1000, 10); + else if (typeof object.amount1000 === "number") + message.amount1000 = object.amount1000; + else if (typeof object.amount1000 === "object") + message.amount1000 = new $util.LongBits(object.amount1000.low >>> 0, object.amount1000.high >>> 0).toNumber(true); + if (object.requestFrom != null) + message.requestFrom = String(object.requestFrom); + if (object.expiryTimestamp != null) + if ($util.Long) + (message.expiryTimestamp = $util.Long.fromValue(object.expiryTimestamp)).unsigned = false; + else if (typeof object.expiryTimestamp === "string") + message.expiryTimestamp = parseInt(object.expiryTimestamp, 10); + else if (typeof object.expiryTimestamp === "number") + message.expiryTimestamp = object.expiryTimestamp; + else if (typeof object.expiryTimestamp === "object") + message.expiryTimestamp = new $util.LongBits(object.expiryTimestamp.low >>> 0, object.expiryTimestamp.high >>> 0).toNumber(); + if (object.amount != null) { + if (typeof object.amount !== "object") + throw TypeError(".proto.RequestPaymentMessage.amount: object expected"); + message.amount = $root.proto.Money.fromObject(object.amount); + } + if (object.background != null) { + if (typeof object.background !== "object") + throw TypeError(".proto.RequestPaymentMessage.background: object expected"); + message.background = $root.proto.PaymentBackground.fromObject(object.background); + } return message; }; /** - * Creates a plain object from an AppStateSyncKeyId message. Also converts values to other types if specified. + * Creates a plain object from a RequestPaymentMessage message. Also converts values to other types if specified. * @function toObject - * @memberof proto.AppStateSyncKeyId + * @memberof proto.RequestPaymentMessage * @static - * @param {proto.AppStateSyncKeyId} message AppStateSyncKeyId + * @param {proto.RequestPaymentMessage} message RequestPaymentMessage * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - AppStateSyncKeyId.toObject = function toObject(message, options) { + RequestPaymentMessage.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) - if (options.bytes === String) - object.keyId = ""; - else { - object.keyId = []; - if (options.bytes !== Array) - object.keyId = $util.newBuffer(object.keyId); - } - if (message.keyId != null && message.hasOwnProperty("keyId")) - object.keyId = options.bytes === String ? $util.base64.encode(message.keyId, 0, message.keyId.length) : options.bytes === Array ? Array.prototype.slice.call(message.keyId) : message.keyId; + if (options.defaults) { + object.currencyCodeIso4217 = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.amount1000 = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.amount1000 = options.longs === String ? "0" : 0; + object.requestFrom = ""; + object.noteMessage = null; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.expiryTimestamp = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.expiryTimestamp = options.longs === String ? "0" : 0; + object.amount = null; + object.background = null; + } + if (message.currencyCodeIso4217 != null && message.hasOwnProperty("currencyCodeIso4217")) + object.currencyCodeIso4217 = message.currencyCodeIso4217; + if (message.amount1000 != null && message.hasOwnProperty("amount1000")) + if (typeof message.amount1000 === "number") + object.amount1000 = options.longs === String ? String(message.amount1000) : message.amount1000; + else + object.amount1000 = options.longs === String ? $util.Long.prototype.toString.call(message.amount1000) : options.longs === Number ? new $util.LongBits(message.amount1000.low >>> 0, message.amount1000.high >>> 0).toNumber(true) : message.amount1000; + if (message.requestFrom != null && message.hasOwnProperty("requestFrom")) + object.requestFrom = message.requestFrom; + if (message.noteMessage != null && message.hasOwnProperty("noteMessage")) + object.noteMessage = $root.proto.Message.toObject(message.noteMessage, options); + if (message.expiryTimestamp != null && message.hasOwnProperty("expiryTimestamp")) + if (typeof message.expiryTimestamp === "number") + object.expiryTimestamp = options.longs === String ? String(message.expiryTimestamp) : message.expiryTimestamp; + else + object.expiryTimestamp = options.longs === String ? $util.Long.prototype.toString.call(message.expiryTimestamp) : options.longs === Number ? new $util.LongBits(message.expiryTimestamp.low >>> 0, message.expiryTimestamp.high >>> 0).toNumber() : message.expiryTimestamp; + if (message.amount != null && message.hasOwnProperty("amount")) + object.amount = $root.proto.Money.toObject(message.amount, options); + if (message.background != null && message.hasOwnProperty("background")) + object.background = $root.proto.PaymentBackground.toObject(message.background, options); return object; }; /** - * Converts this AppStateSyncKeyId to JSON. + * Converts this RequestPaymentMessage to JSON. * @function toJSON - * @memberof proto.AppStateSyncKeyId + * @memberof proto.RequestPaymentMessage * @instance * @returns {Object.} JSON object */ - AppStateSyncKeyId.prototype.toJSON = function toJSON() { + RequestPaymentMessage.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return AppStateSyncKeyId; + return RequestPaymentMessage; })(); - proto.AppStateSyncKeyFingerprint = (function() { + proto.Row = (function() { /** - * Properties of an AppStateSyncKeyFingerprint. + * Properties of a Row. * @memberof proto - * @interface IAppStateSyncKeyFingerprint - * @property {number|null} [rawId] AppStateSyncKeyFingerprint rawId - * @property {number|null} [currentIndex] AppStateSyncKeyFingerprint currentIndex - * @property {Array.|null} [deviceIndexes] AppStateSyncKeyFingerprint deviceIndexes + * @interface IRow + * @property {string|null} [title] Row title + * @property {string|null} [description] Row description + * @property {string|null} [rowId] Row rowId */ /** - * Constructs a new AppStateSyncKeyFingerprint. + * Constructs a new Row. * @memberof proto - * @classdesc Represents an AppStateSyncKeyFingerprint. - * @implements IAppStateSyncKeyFingerprint + * @classdesc Represents a Row. + * @implements IRow * @constructor - * @param {proto.IAppStateSyncKeyFingerprint=} [properties] Properties to set + * @param {proto.IRow=} [properties] Properties to set */ - function AppStateSyncKeyFingerprint(properties) { - this.deviceIndexes = []; + function Row(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -29836,112 +29939,101 @@ $root.proto = (function() { } /** - * AppStateSyncKeyFingerprint rawId. - * @member {number} rawId - * @memberof proto.AppStateSyncKeyFingerprint + * Row title. + * @member {string} title + * @memberof proto.Row * @instance */ - AppStateSyncKeyFingerprint.prototype.rawId = 0; + Row.prototype.title = ""; /** - * AppStateSyncKeyFingerprint currentIndex. - * @member {number} currentIndex - * @memberof proto.AppStateSyncKeyFingerprint + * Row description. + * @member {string} description + * @memberof proto.Row * @instance */ - AppStateSyncKeyFingerprint.prototype.currentIndex = 0; + Row.prototype.description = ""; /** - * AppStateSyncKeyFingerprint deviceIndexes. - * @member {Array.} deviceIndexes - * @memberof proto.AppStateSyncKeyFingerprint + * Row rowId. + * @member {string} rowId + * @memberof proto.Row * @instance */ - AppStateSyncKeyFingerprint.prototype.deviceIndexes = $util.emptyArray; + Row.prototype.rowId = ""; /** - * Creates a new AppStateSyncKeyFingerprint instance using the specified properties. + * Creates a new Row instance using the specified properties. * @function create - * @memberof proto.AppStateSyncKeyFingerprint + * @memberof proto.Row * @static - * @param {proto.IAppStateSyncKeyFingerprint=} [properties] Properties to set - * @returns {proto.AppStateSyncKeyFingerprint} AppStateSyncKeyFingerprint instance + * @param {proto.IRow=} [properties] Properties to set + * @returns {proto.Row} Row instance */ - AppStateSyncKeyFingerprint.create = function create(properties) { - return new AppStateSyncKeyFingerprint(properties); + Row.create = function create(properties) { + return new Row(properties); }; /** - * Encodes the specified AppStateSyncKeyFingerprint message. Does not implicitly {@link proto.AppStateSyncKeyFingerprint.verify|verify} messages. + * Encodes the specified Row message. Does not implicitly {@link proto.Row.verify|verify} messages. * @function encode - * @memberof proto.AppStateSyncKeyFingerprint + * @memberof proto.Row * @static - * @param {proto.IAppStateSyncKeyFingerprint} message AppStateSyncKeyFingerprint message or plain object to encode + * @param {proto.IRow} message Row message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AppStateSyncKeyFingerprint.encode = function encode(message, writer) { + Row.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.rawId != null && Object.hasOwnProperty.call(message, "rawId")) - writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.rawId); - if (message.currentIndex != null && Object.hasOwnProperty.call(message, "currentIndex")) - writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.currentIndex); - if (message.deviceIndexes != null && message.deviceIndexes.length) { - writer.uint32(/* id 3, wireType 2 =*/26).fork(); - for (var i = 0; i < message.deviceIndexes.length; ++i) - writer.uint32(message.deviceIndexes[i]); - writer.ldelim(); - } + if (message.title != null && Object.hasOwnProperty.call(message, "title")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.title); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); + if (message.rowId != null && Object.hasOwnProperty.call(message, "rowId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.rowId); return writer; }; /** - * Encodes the specified AppStateSyncKeyFingerprint message, length delimited. Does not implicitly {@link proto.AppStateSyncKeyFingerprint.verify|verify} messages. + * Encodes the specified Row message, length delimited. Does not implicitly {@link proto.Row.verify|verify} messages. * @function encodeDelimited - * @memberof proto.AppStateSyncKeyFingerprint + * @memberof proto.Row * @static - * @param {proto.IAppStateSyncKeyFingerprint} message AppStateSyncKeyFingerprint message or plain object to encode + * @param {proto.IRow} message Row message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AppStateSyncKeyFingerprint.encodeDelimited = function encodeDelimited(message, writer) { + Row.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an AppStateSyncKeyFingerprint message from the specified reader or buffer. + * Decodes a Row message from the specified reader or buffer. * @function decode - * @memberof proto.AppStateSyncKeyFingerprint + * @memberof proto.Row * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {proto.AppStateSyncKeyFingerprint} AppStateSyncKeyFingerprint + * @returns {proto.Row} Row * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - AppStateSyncKeyFingerprint.decode = function decode(reader, length) { + Row.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.AppStateSyncKeyFingerprint(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.Row(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.rawId = reader.uint32(); + message.title = reader.string(); break; case 2: - message.currentIndex = reader.uint32(); + message.description = reader.string(); break; case 3: - if (!(message.deviceIndexes && message.deviceIndexes.length)) - message.deviceIndexes = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.deviceIndexes.push(reader.uint32()); - } else - message.deviceIndexes.push(reader.uint32()); + message.rowId = reader.string(); break; default: reader.skipType(tag & 7); @@ -29952,139 +30044,126 @@ $root.proto = (function() { }; /** - * Decodes an AppStateSyncKeyFingerprint message from the specified reader or buffer, length delimited. + * Decodes a Row message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof proto.AppStateSyncKeyFingerprint + * @memberof proto.Row * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.AppStateSyncKeyFingerprint} AppStateSyncKeyFingerprint + * @returns {proto.Row} Row * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - AppStateSyncKeyFingerprint.decodeDelimited = function decodeDelimited(reader) { + Row.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an AppStateSyncKeyFingerprint message. + * Verifies a Row message. * @function verify - * @memberof proto.AppStateSyncKeyFingerprint + * @memberof proto.Row * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - AppStateSyncKeyFingerprint.verify = function verify(message) { + Row.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.rawId != null && message.hasOwnProperty("rawId")) - if (!$util.isInteger(message.rawId)) - return "rawId: integer expected"; - if (message.currentIndex != null && message.hasOwnProperty("currentIndex")) - if (!$util.isInteger(message.currentIndex)) - return "currentIndex: integer expected"; - if (message.deviceIndexes != null && message.hasOwnProperty("deviceIndexes")) { - if (!Array.isArray(message.deviceIndexes)) - return "deviceIndexes: array expected"; - for (var i = 0; i < message.deviceIndexes.length; ++i) - if (!$util.isInteger(message.deviceIndexes[i])) - return "deviceIndexes: integer[] expected"; - } + if (message.title != null && message.hasOwnProperty("title")) + if (!$util.isString(message.title)) + return "title: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.rowId != null && message.hasOwnProperty("rowId")) + if (!$util.isString(message.rowId)) + return "rowId: string expected"; return null; }; /** - * Creates an AppStateSyncKeyFingerprint message from a plain object. Also converts values to their respective internal types. + * Creates a Row message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof proto.AppStateSyncKeyFingerprint + * @memberof proto.Row * @static * @param {Object.} object Plain object - * @returns {proto.AppStateSyncKeyFingerprint} AppStateSyncKeyFingerprint + * @returns {proto.Row} Row */ - AppStateSyncKeyFingerprint.fromObject = function fromObject(object) { - if (object instanceof $root.proto.AppStateSyncKeyFingerprint) + Row.fromObject = function fromObject(object) { + if (object instanceof $root.proto.Row) return object; - var message = new $root.proto.AppStateSyncKeyFingerprint(); - if (object.rawId != null) - message.rawId = object.rawId >>> 0; - if (object.currentIndex != null) - message.currentIndex = object.currentIndex >>> 0; - if (object.deviceIndexes) { - if (!Array.isArray(object.deviceIndexes)) - throw TypeError(".proto.AppStateSyncKeyFingerprint.deviceIndexes: array expected"); - message.deviceIndexes = []; - for (var i = 0; i < object.deviceIndexes.length; ++i) - message.deviceIndexes[i] = object.deviceIndexes[i] >>> 0; - } + var message = new $root.proto.Row(); + if (object.title != null) + message.title = String(object.title); + if (object.description != null) + message.description = String(object.description); + if (object.rowId != null) + message.rowId = String(object.rowId); return message; }; /** - * Creates a plain object from an AppStateSyncKeyFingerprint message. Also converts values to other types if specified. + * Creates a plain object from a Row message. Also converts values to other types if specified. * @function toObject - * @memberof proto.AppStateSyncKeyFingerprint + * @memberof proto.Row * @static - * @param {proto.AppStateSyncKeyFingerprint} message AppStateSyncKeyFingerprint + * @param {proto.Row} message Row * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - AppStateSyncKeyFingerprint.toObject = function toObject(message, options) { + Row.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.deviceIndexes = []; if (options.defaults) { - object.rawId = 0; - object.currentIndex = 0; - } - if (message.rawId != null && message.hasOwnProperty("rawId")) - object.rawId = message.rawId; - if (message.currentIndex != null && message.hasOwnProperty("currentIndex")) - object.currentIndex = message.currentIndex; - if (message.deviceIndexes && message.deviceIndexes.length) { - object.deviceIndexes = []; - for (var j = 0; j < message.deviceIndexes.length; ++j) - object.deviceIndexes[j] = message.deviceIndexes[j]; + object.title = ""; + object.description = ""; + object.rowId = ""; } + if (message.title != null && message.hasOwnProperty("title")) + object.title = message.title; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.rowId != null && message.hasOwnProperty("rowId")) + object.rowId = message.rowId; return object; }; /** - * Converts this AppStateSyncKeyFingerprint to JSON. + * Converts this Row to JSON. * @function toJSON - * @memberof proto.AppStateSyncKeyFingerprint + * @memberof proto.Row * @instance * @returns {Object.} JSON object */ - AppStateSyncKeyFingerprint.prototype.toJSON = function toJSON() { + Row.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return AppStateSyncKeyFingerprint; + return Row; })(); - proto.AppStateSyncKeyData = (function() { + proto.Section = (function() { /** - * Properties of an AppStateSyncKeyData. + * Properties of a Section. * @memberof proto - * @interface IAppStateSyncKeyData - * @property {Uint8Array|null} [keyData] AppStateSyncKeyData keyData - * @property {proto.IAppStateSyncKeyFingerprint|null} [fingerprint] AppStateSyncKeyData fingerprint - * @property {number|Long|null} [timestamp] AppStateSyncKeyData timestamp + * @interface ISection + * @property {string|null} [title] Section title + * @property {Array.|null} [rows] Section rows */ /** - * Constructs a new AppStateSyncKeyData. + * Constructs a new Section. * @memberof proto - * @classdesc Represents an AppStateSyncKeyData. - * @implements IAppStateSyncKeyData + * @classdesc Represents a Section. + * @implements ISection * @constructor - * @param {proto.IAppStateSyncKeyData=} [properties] Properties to set + * @param {proto.ISection=} [properties] Properties to set */ - function AppStateSyncKeyData(properties) { + function Section(properties) { + this.rows = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -30092,101 +30171,91 @@ $root.proto = (function() { } /** - * AppStateSyncKeyData keyData. - * @member {Uint8Array} keyData - * @memberof proto.AppStateSyncKeyData - * @instance - */ - AppStateSyncKeyData.prototype.keyData = $util.newBuffer([]); - - /** - * AppStateSyncKeyData fingerprint. - * @member {proto.IAppStateSyncKeyFingerprint|null|undefined} fingerprint - * @memberof proto.AppStateSyncKeyData + * Section title. + * @member {string} title + * @memberof proto.Section * @instance */ - AppStateSyncKeyData.prototype.fingerprint = null; + Section.prototype.title = ""; /** - * AppStateSyncKeyData timestamp. - * @member {number|Long} timestamp - * @memberof proto.AppStateSyncKeyData + * Section rows. + * @member {Array.} rows + * @memberof proto.Section * @instance */ - AppStateSyncKeyData.prototype.timestamp = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + Section.prototype.rows = $util.emptyArray; /** - * Creates a new AppStateSyncKeyData instance using the specified properties. + * Creates a new Section instance using the specified properties. * @function create - * @memberof proto.AppStateSyncKeyData + * @memberof proto.Section * @static - * @param {proto.IAppStateSyncKeyData=} [properties] Properties to set - * @returns {proto.AppStateSyncKeyData} AppStateSyncKeyData instance + * @param {proto.ISection=} [properties] Properties to set + * @returns {proto.Section} Section instance */ - AppStateSyncKeyData.create = function create(properties) { - return new AppStateSyncKeyData(properties); + Section.create = function create(properties) { + return new Section(properties); }; /** - * Encodes the specified AppStateSyncKeyData message. Does not implicitly {@link proto.AppStateSyncKeyData.verify|verify} messages. + * Encodes the specified Section message. Does not implicitly {@link proto.Section.verify|verify} messages. * @function encode - * @memberof proto.AppStateSyncKeyData + * @memberof proto.Section * @static - * @param {proto.IAppStateSyncKeyData} message AppStateSyncKeyData message or plain object to encode + * @param {proto.ISection} message Section message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AppStateSyncKeyData.encode = function encode(message, writer) { + Section.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.keyData != null && Object.hasOwnProperty.call(message, "keyData")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.keyData); - if (message.fingerprint != null && Object.hasOwnProperty.call(message, "fingerprint")) - $root.proto.AppStateSyncKeyFingerprint.encode(message.fingerprint, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.timestamp != null && Object.hasOwnProperty.call(message, "timestamp")) - writer.uint32(/* id 3, wireType 0 =*/24).int64(message.timestamp); + if (message.title != null && Object.hasOwnProperty.call(message, "title")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.title); + if (message.rows != null && message.rows.length) + for (var i = 0; i < message.rows.length; ++i) + $root.proto.Row.encode(message.rows[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** - * Encodes the specified AppStateSyncKeyData message, length delimited. Does not implicitly {@link proto.AppStateSyncKeyData.verify|verify} messages. + * Encodes the specified Section message, length delimited. Does not implicitly {@link proto.Section.verify|verify} messages. * @function encodeDelimited - * @memberof proto.AppStateSyncKeyData + * @memberof proto.Section * @static - * @param {proto.IAppStateSyncKeyData} message AppStateSyncKeyData message or plain object to encode + * @param {proto.ISection} message Section message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AppStateSyncKeyData.encodeDelimited = function encodeDelimited(message, writer) { + Section.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an AppStateSyncKeyData message from the specified reader or buffer. + * Decodes a Section message from the specified reader or buffer. * @function decode - * @memberof proto.AppStateSyncKeyData + * @memberof proto.Section * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {proto.AppStateSyncKeyData} AppStateSyncKeyData + * @returns {proto.Section} Section * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - AppStateSyncKeyData.decode = function decode(reader, length) { + Section.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.AppStateSyncKeyData(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.Section(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.keyData = reader.bytes(); + message.title = reader.string(); break; case 2: - message.fingerprint = $root.proto.AppStateSyncKeyFingerprint.decode(reader, reader.uint32()); - break; - case 3: - message.timestamp = reader.int64(); + if (!(message.rows && message.rows.length)) + message.rows = []; + message.rows.push($root.proto.Row.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -30197,153 +30266,134 @@ $root.proto = (function() { }; /** - * Decodes an AppStateSyncKeyData message from the specified reader or buffer, length delimited. + * Decodes a Section message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof proto.AppStateSyncKeyData + * @memberof proto.Section * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.AppStateSyncKeyData} AppStateSyncKeyData + * @returns {proto.Section} Section * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - AppStateSyncKeyData.decodeDelimited = function decodeDelimited(reader) { + Section.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an AppStateSyncKeyData message. + * Verifies a Section message. * @function verify - * @memberof proto.AppStateSyncKeyData + * @memberof proto.Section * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - AppStateSyncKeyData.verify = function verify(message) { + Section.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.keyData != null && message.hasOwnProperty("keyData")) - if (!(message.keyData && typeof message.keyData.length === "number" || $util.isString(message.keyData))) - return "keyData: buffer expected"; - if (message.fingerprint != null && message.hasOwnProperty("fingerprint")) { - var error = $root.proto.AppStateSyncKeyFingerprint.verify(message.fingerprint); - if (error) - return "fingerprint." + error; + if (message.title != null && message.hasOwnProperty("title")) + if (!$util.isString(message.title)) + return "title: string expected"; + if (message.rows != null && message.hasOwnProperty("rows")) { + if (!Array.isArray(message.rows)) + return "rows: array expected"; + for (var i = 0; i < message.rows.length; ++i) { + var error = $root.proto.Row.verify(message.rows[i]); + if (error) + return "rows." + error; + } } - if (message.timestamp != null && message.hasOwnProperty("timestamp")) - if (!$util.isInteger(message.timestamp) && !(message.timestamp && $util.isInteger(message.timestamp.low) && $util.isInteger(message.timestamp.high))) - return "timestamp: integer|Long expected"; return null; }; /** - * Creates an AppStateSyncKeyData message from a plain object. Also converts values to their respective internal types. + * Creates a Section message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof proto.AppStateSyncKeyData + * @memberof proto.Section * @static * @param {Object.} object Plain object - * @returns {proto.AppStateSyncKeyData} AppStateSyncKeyData + * @returns {proto.Section} Section */ - AppStateSyncKeyData.fromObject = function fromObject(object) { - if (object instanceof $root.proto.AppStateSyncKeyData) + Section.fromObject = function fromObject(object) { + if (object instanceof $root.proto.Section) return object; - var message = new $root.proto.AppStateSyncKeyData(); - if (object.keyData != null) - if (typeof object.keyData === "string") - $util.base64.decode(object.keyData, message.keyData = $util.newBuffer($util.base64.length(object.keyData)), 0); - else if (object.keyData.length) - message.keyData = object.keyData; - if (object.fingerprint != null) { - if (typeof object.fingerprint !== "object") - throw TypeError(".proto.AppStateSyncKeyData.fingerprint: object expected"); - message.fingerprint = $root.proto.AppStateSyncKeyFingerprint.fromObject(object.fingerprint); + var message = new $root.proto.Section(); + if (object.title != null) + message.title = String(object.title); + if (object.rows) { + if (!Array.isArray(object.rows)) + throw TypeError(".proto.Section.rows: array expected"); + message.rows = []; + for (var i = 0; i < object.rows.length; ++i) { + if (typeof object.rows[i] !== "object") + throw TypeError(".proto.Section.rows: object expected"); + message.rows[i] = $root.proto.Row.fromObject(object.rows[i]); + } } - if (object.timestamp != null) - if ($util.Long) - (message.timestamp = $util.Long.fromValue(object.timestamp)).unsigned = false; - else if (typeof object.timestamp === "string") - message.timestamp = parseInt(object.timestamp, 10); - else if (typeof object.timestamp === "number") - message.timestamp = object.timestamp; - else if (typeof object.timestamp === "object") - message.timestamp = new $util.LongBits(object.timestamp.low >>> 0, object.timestamp.high >>> 0).toNumber(); return message; }; /** - * Creates a plain object from an AppStateSyncKeyData message. Also converts values to other types if specified. + * Creates a plain object from a Section message. Also converts values to other types if specified. * @function toObject - * @memberof proto.AppStateSyncKeyData + * @memberof proto.Section * @static - * @param {proto.AppStateSyncKeyData} message AppStateSyncKeyData + * @param {proto.Section} message Section * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - AppStateSyncKeyData.toObject = function toObject(message, options) { + Section.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - if (options.bytes === String) - object.keyData = ""; - else { - object.keyData = []; - if (options.bytes !== Array) - object.keyData = $util.newBuffer(object.keyData); - } - object.fingerprint = null; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.timestamp = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.timestamp = options.longs === String ? "0" : 0; + if (options.arrays || options.defaults) + object.rows = []; + if (options.defaults) + object.title = ""; + if (message.title != null && message.hasOwnProperty("title")) + object.title = message.title; + if (message.rows && message.rows.length) { + object.rows = []; + for (var j = 0; j < message.rows.length; ++j) + object.rows[j] = $root.proto.Row.toObject(message.rows[j], options); } - if (message.keyData != null && message.hasOwnProperty("keyData")) - object.keyData = options.bytes === String ? $util.base64.encode(message.keyData, 0, message.keyData.length) : options.bytes === Array ? Array.prototype.slice.call(message.keyData) : message.keyData; - if (message.fingerprint != null && message.hasOwnProperty("fingerprint")) - object.fingerprint = $root.proto.AppStateSyncKeyFingerprint.toObject(message.fingerprint, options); - if (message.timestamp != null && message.hasOwnProperty("timestamp")) - if (typeof message.timestamp === "number") - object.timestamp = options.longs === String ? String(message.timestamp) : message.timestamp; - else - object.timestamp = options.longs === String ? $util.Long.prototype.toString.call(message.timestamp) : options.longs === Number ? new $util.LongBits(message.timestamp.low >>> 0, message.timestamp.high >>> 0).toNumber() : message.timestamp; return object; }; /** - * Converts this AppStateSyncKeyData to JSON. + * Converts this Section to JSON. * @function toJSON - * @memberof proto.AppStateSyncKeyData + * @memberof proto.Section * @instance * @returns {Object.} JSON object */ - AppStateSyncKeyData.prototype.toJSON = function toJSON() { + Section.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return AppStateSyncKeyData; + return Section; })(); - proto.AppStateSyncKeyShare = (function() { + proto.SenderKeyDistributionMessage = (function() { /** - * Properties of an AppStateSyncKeyShare. + * Properties of a SenderKeyDistributionMessage. * @memberof proto - * @interface IAppStateSyncKeyShare - * @property {Array.|null} [keys] AppStateSyncKeyShare keys + * @interface ISenderKeyDistributionMessage + * @property {string|null} [groupId] SenderKeyDistributionMessage groupId + * @property {Uint8Array|null} [axolotlSenderKeyDistributionMessage] SenderKeyDistributionMessage axolotlSenderKeyDistributionMessage */ /** - * Constructs a new AppStateSyncKeyShare. + * Constructs a new SenderKeyDistributionMessage. * @memberof proto - * @classdesc Represents an AppStateSyncKeyShare. - * @implements IAppStateSyncKeyShare + * @classdesc Represents a SenderKeyDistributionMessage. + * @implements ISenderKeyDistributionMessage * @constructor - * @param {proto.IAppStateSyncKeyShare=} [properties] Properties to set + * @param {proto.ISenderKeyDistributionMessage=} [properties] Properties to set */ - function AppStateSyncKeyShare(properties) { - this.keys = []; + function SenderKeyDistributionMessage(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -30351,78 +30401,88 @@ $root.proto = (function() { } /** - * AppStateSyncKeyShare keys. - * @member {Array.} keys - * @memberof proto.AppStateSyncKeyShare + * SenderKeyDistributionMessage groupId. + * @member {string} groupId + * @memberof proto.SenderKeyDistributionMessage * @instance */ - AppStateSyncKeyShare.prototype.keys = $util.emptyArray; + SenderKeyDistributionMessage.prototype.groupId = ""; /** - * Creates a new AppStateSyncKeyShare instance using the specified properties. + * SenderKeyDistributionMessage axolotlSenderKeyDistributionMessage. + * @member {Uint8Array} axolotlSenderKeyDistributionMessage + * @memberof proto.SenderKeyDistributionMessage + * @instance + */ + SenderKeyDistributionMessage.prototype.axolotlSenderKeyDistributionMessage = $util.newBuffer([]); + + /** + * Creates a new SenderKeyDistributionMessage instance using the specified properties. * @function create - * @memberof proto.AppStateSyncKeyShare + * @memberof proto.SenderKeyDistributionMessage * @static - * @param {proto.IAppStateSyncKeyShare=} [properties] Properties to set - * @returns {proto.AppStateSyncKeyShare} AppStateSyncKeyShare instance + * @param {proto.ISenderKeyDistributionMessage=} [properties] Properties to set + * @returns {proto.SenderKeyDistributionMessage} SenderKeyDistributionMessage instance */ - AppStateSyncKeyShare.create = function create(properties) { - return new AppStateSyncKeyShare(properties); + SenderKeyDistributionMessage.create = function create(properties) { + return new SenderKeyDistributionMessage(properties); }; /** - * Encodes the specified AppStateSyncKeyShare message. Does not implicitly {@link proto.AppStateSyncKeyShare.verify|verify} messages. + * Encodes the specified SenderKeyDistributionMessage message. Does not implicitly {@link proto.SenderKeyDistributionMessage.verify|verify} messages. * @function encode - * @memberof proto.AppStateSyncKeyShare + * @memberof proto.SenderKeyDistributionMessage * @static - * @param {proto.IAppStateSyncKeyShare} message AppStateSyncKeyShare message or plain object to encode + * @param {proto.ISenderKeyDistributionMessage} message SenderKeyDistributionMessage message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AppStateSyncKeyShare.encode = function encode(message, writer) { + SenderKeyDistributionMessage.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.keys != null && message.keys.length) - for (var i = 0; i < message.keys.length; ++i) - $root.proto.AppStateSyncKey.encode(message.keys[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.groupId != null && Object.hasOwnProperty.call(message, "groupId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.groupId); + if (message.axolotlSenderKeyDistributionMessage != null && Object.hasOwnProperty.call(message, "axolotlSenderKeyDistributionMessage")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.axolotlSenderKeyDistributionMessage); return writer; }; /** - * Encodes the specified AppStateSyncKeyShare message, length delimited. Does not implicitly {@link proto.AppStateSyncKeyShare.verify|verify} messages. + * Encodes the specified SenderKeyDistributionMessage message, length delimited. Does not implicitly {@link proto.SenderKeyDistributionMessage.verify|verify} messages. * @function encodeDelimited - * @memberof proto.AppStateSyncKeyShare + * @memberof proto.SenderKeyDistributionMessage * @static - * @param {proto.IAppStateSyncKeyShare} message AppStateSyncKeyShare message or plain object to encode + * @param {proto.ISenderKeyDistributionMessage} message SenderKeyDistributionMessage message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AppStateSyncKeyShare.encodeDelimited = function encodeDelimited(message, writer) { + SenderKeyDistributionMessage.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an AppStateSyncKeyShare message from the specified reader or buffer. + * Decodes a SenderKeyDistributionMessage message from the specified reader or buffer. * @function decode - * @memberof proto.AppStateSyncKeyShare + * @memberof proto.SenderKeyDistributionMessage * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {proto.AppStateSyncKeyShare} AppStateSyncKeyShare + * @returns {proto.SenderKeyDistributionMessage} SenderKeyDistributionMessage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - AppStateSyncKeyShare.decode = function decode(reader, length) { + SenderKeyDistributionMessage.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.AppStateSyncKeyShare(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.SenderKeyDistributionMessage(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - if (!(message.keys && message.keys.length)) - message.keys = []; - message.keys.push($root.proto.AppStateSyncKey.decode(reader, reader.uint32())); + message.groupId = reader.string(); + break; + case 2: + message.axolotlSenderKeyDistributionMessage = reader.bytes(); break; default: reader.skipType(tag & 7); @@ -30433,125 +30493,127 @@ $root.proto = (function() { }; /** - * Decodes an AppStateSyncKeyShare message from the specified reader or buffer, length delimited. + * Decodes a SenderKeyDistributionMessage message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof proto.AppStateSyncKeyShare + * @memberof proto.SenderKeyDistributionMessage * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.AppStateSyncKeyShare} AppStateSyncKeyShare + * @returns {proto.SenderKeyDistributionMessage} SenderKeyDistributionMessage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - AppStateSyncKeyShare.decodeDelimited = function decodeDelimited(reader) { + SenderKeyDistributionMessage.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an AppStateSyncKeyShare message. + * Verifies a SenderKeyDistributionMessage message. * @function verify - * @memberof proto.AppStateSyncKeyShare + * @memberof proto.SenderKeyDistributionMessage * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - AppStateSyncKeyShare.verify = function verify(message) { + SenderKeyDistributionMessage.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.keys != null && message.hasOwnProperty("keys")) { - if (!Array.isArray(message.keys)) - return "keys: array expected"; - for (var i = 0; i < message.keys.length; ++i) { - var error = $root.proto.AppStateSyncKey.verify(message.keys[i]); - if (error) - return "keys." + error; - } - } + if (message.groupId != null && message.hasOwnProperty("groupId")) + if (!$util.isString(message.groupId)) + return "groupId: string expected"; + if (message.axolotlSenderKeyDistributionMessage != null && message.hasOwnProperty("axolotlSenderKeyDistributionMessage")) + if (!(message.axolotlSenderKeyDistributionMessage && typeof message.axolotlSenderKeyDistributionMessage.length === "number" || $util.isString(message.axolotlSenderKeyDistributionMessage))) + return "axolotlSenderKeyDistributionMessage: buffer expected"; return null; }; /** - * Creates an AppStateSyncKeyShare message from a plain object. Also converts values to their respective internal types. + * Creates a SenderKeyDistributionMessage message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof proto.AppStateSyncKeyShare + * @memberof proto.SenderKeyDistributionMessage * @static * @param {Object.} object Plain object - * @returns {proto.AppStateSyncKeyShare} AppStateSyncKeyShare + * @returns {proto.SenderKeyDistributionMessage} SenderKeyDistributionMessage */ - AppStateSyncKeyShare.fromObject = function fromObject(object) { - if (object instanceof $root.proto.AppStateSyncKeyShare) + SenderKeyDistributionMessage.fromObject = function fromObject(object) { + if (object instanceof $root.proto.SenderKeyDistributionMessage) return object; - var message = new $root.proto.AppStateSyncKeyShare(); - if (object.keys) { - if (!Array.isArray(object.keys)) - throw TypeError(".proto.AppStateSyncKeyShare.keys: array expected"); - message.keys = []; - for (var i = 0; i < object.keys.length; ++i) { - if (typeof object.keys[i] !== "object") - throw TypeError(".proto.AppStateSyncKeyShare.keys: object expected"); - message.keys[i] = $root.proto.AppStateSyncKey.fromObject(object.keys[i]); - } - } + var message = new $root.proto.SenderKeyDistributionMessage(); + if (object.groupId != null) + message.groupId = String(object.groupId); + if (object.axolotlSenderKeyDistributionMessage != null) + if (typeof object.axolotlSenderKeyDistributionMessage === "string") + $util.base64.decode(object.axolotlSenderKeyDistributionMessage, message.axolotlSenderKeyDistributionMessage = $util.newBuffer($util.base64.length(object.axolotlSenderKeyDistributionMessage)), 0); + else if (object.axolotlSenderKeyDistributionMessage.length) + message.axolotlSenderKeyDistributionMessage = object.axolotlSenderKeyDistributionMessage; return message; }; /** - * Creates a plain object from an AppStateSyncKeyShare message. Also converts values to other types if specified. + * Creates a plain object from a SenderKeyDistributionMessage message. Also converts values to other types if specified. * @function toObject - * @memberof proto.AppStateSyncKeyShare + * @memberof proto.SenderKeyDistributionMessage * @static - * @param {proto.AppStateSyncKeyShare} message AppStateSyncKeyShare + * @param {proto.SenderKeyDistributionMessage} message SenderKeyDistributionMessage * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - AppStateSyncKeyShare.toObject = function toObject(message, options) { + SenderKeyDistributionMessage.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.keys = []; - if (message.keys && message.keys.length) { - object.keys = []; - for (var j = 0; j < message.keys.length; ++j) - object.keys[j] = $root.proto.AppStateSyncKey.toObject(message.keys[j], options); + if (options.defaults) { + object.groupId = ""; + if (options.bytes === String) + object.axolotlSenderKeyDistributionMessage = ""; + else { + object.axolotlSenderKeyDistributionMessage = []; + if (options.bytes !== Array) + object.axolotlSenderKeyDistributionMessage = $util.newBuffer(object.axolotlSenderKeyDistributionMessage); + } } + if (message.groupId != null && message.hasOwnProperty("groupId")) + object.groupId = message.groupId; + if (message.axolotlSenderKeyDistributionMessage != null && message.hasOwnProperty("axolotlSenderKeyDistributionMessage")) + object.axolotlSenderKeyDistributionMessage = options.bytes === String ? $util.base64.encode(message.axolotlSenderKeyDistributionMessage, 0, message.axolotlSenderKeyDistributionMessage.length) : options.bytes === Array ? Array.prototype.slice.call(message.axolotlSenderKeyDistributionMessage) : message.axolotlSenderKeyDistributionMessage; return object; }; /** - * Converts this AppStateSyncKeyShare to JSON. + * Converts this SenderKeyDistributionMessage to JSON. * @function toJSON - * @memberof proto.AppStateSyncKeyShare + * @memberof proto.SenderKeyDistributionMessage * @instance * @returns {Object.} JSON object */ - AppStateSyncKeyShare.prototype.toJSON = function toJSON() { + SenderKeyDistributionMessage.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return AppStateSyncKeyShare; + return SenderKeyDistributionMessage; })(); - proto.AppStateSyncKeyRequest = (function() { + proto.SendPaymentMessage = (function() { /** - * Properties of an AppStateSyncKeyRequest. + * Properties of a SendPaymentMessage. * @memberof proto - * @interface IAppStateSyncKeyRequest - * @property {Array.|null} [keyIds] AppStateSyncKeyRequest keyIds + * @interface ISendPaymentMessage + * @property {proto.IMessage|null} [noteMessage] SendPaymentMessage noteMessage + * @property {proto.IMessageKey|null} [requestMessageKey] SendPaymentMessage requestMessageKey + * @property {proto.IPaymentBackground|null} [background] SendPaymentMessage background */ /** - * Constructs a new AppStateSyncKeyRequest. + * Constructs a new SendPaymentMessage. * @memberof proto - * @classdesc Represents an AppStateSyncKeyRequest. - * @implements IAppStateSyncKeyRequest + * @classdesc Represents a SendPaymentMessage. + * @implements ISendPaymentMessage * @constructor - * @param {proto.IAppStateSyncKeyRequest=} [properties] Properties to set + * @param {proto.ISendPaymentMessage=} [properties] Properties to set */ - function AppStateSyncKeyRequest(properties) { - this.keyIds = []; + function SendPaymentMessage(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -30559,78 +30621,101 @@ $root.proto = (function() { } /** - * AppStateSyncKeyRequest keyIds. - * @member {Array.} keyIds - * @memberof proto.AppStateSyncKeyRequest + * SendPaymentMessage noteMessage. + * @member {proto.IMessage|null|undefined} noteMessage + * @memberof proto.SendPaymentMessage * @instance */ - AppStateSyncKeyRequest.prototype.keyIds = $util.emptyArray; + SendPaymentMessage.prototype.noteMessage = null; /** - * Creates a new AppStateSyncKeyRequest instance using the specified properties. - * @function create - * @memberof proto.AppStateSyncKeyRequest - * @static - * @param {proto.IAppStateSyncKeyRequest=} [properties] Properties to set - * @returns {proto.AppStateSyncKeyRequest} AppStateSyncKeyRequest instance + * SendPaymentMessage requestMessageKey. + * @member {proto.IMessageKey|null|undefined} requestMessageKey + * @memberof proto.SendPaymentMessage + * @instance */ - AppStateSyncKeyRequest.create = function create(properties) { - return new AppStateSyncKeyRequest(properties); - }; + SendPaymentMessage.prototype.requestMessageKey = null; /** - * Encodes the specified AppStateSyncKeyRequest message. Does not implicitly {@link proto.AppStateSyncKeyRequest.verify|verify} messages. + * SendPaymentMessage background. + * @member {proto.IPaymentBackground|null|undefined} background + * @memberof proto.SendPaymentMessage + * @instance + */ + SendPaymentMessage.prototype.background = null; + + /** + * Creates a new SendPaymentMessage instance using the specified properties. + * @function create + * @memberof proto.SendPaymentMessage + * @static + * @param {proto.ISendPaymentMessage=} [properties] Properties to set + * @returns {proto.SendPaymentMessage} SendPaymentMessage instance + */ + SendPaymentMessage.create = function create(properties) { + return new SendPaymentMessage(properties); + }; + + /** + * Encodes the specified SendPaymentMessage message. Does not implicitly {@link proto.SendPaymentMessage.verify|verify} messages. * @function encode - * @memberof proto.AppStateSyncKeyRequest + * @memberof proto.SendPaymentMessage * @static - * @param {proto.IAppStateSyncKeyRequest} message AppStateSyncKeyRequest message or plain object to encode + * @param {proto.ISendPaymentMessage} message SendPaymentMessage message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AppStateSyncKeyRequest.encode = function encode(message, writer) { + SendPaymentMessage.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.keyIds != null && message.keyIds.length) - for (var i = 0; i < message.keyIds.length; ++i) - $root.proto.AppStateSyncKeyId.encode(message.keyIds[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.noteMessage != null && Object.hasOwnProperty.call(message, "noteMessage")) + $root.proto.Message.encode(message.noteMessage, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.requestMessageKey != null && Object.hasOwnProperty.call(message, "requestMessageKey")) + $root.proto.MessageKey.encode(message.requestMessageKey, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.background != null && Object.hasOwnProperty.call(message, "background")) + $root.proto.PaymentBackground.encode(message.background, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); return writer; }; /** - * Encodes the specified AppStateSyncKeyRequest message, length delimited. Does not implicitly {@link proto.AppStateSyncKeyRequest.verify|verify} messages. + * Encodes the specified SendPaymentMessage message, length delimited. Does not implicitly {@link proto.SendPaymentMessage.verify|verify} messages. * @function encodeDelimited - * @memberof proto.AppStateSyncKeyRequest + * @memberof proto.SendPaymentMessage * @static - * @param {proto.IAppStateSyncKeyRequest} message AppStateSyncKeyRequest message or plain object to encode + * @param {proto.ISendPaymentMessage} message SendPaymentMessage message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AppStateSyncKeyRequest.encodeDelimited = function encodeDelimited(message, writer) { + SendPaymentMessage.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an AppStateSyncKeyRequest message from the specified reader or buffer. + * Decodes a SendPaymentMessage message from the specified reader or buffer. * @function decode - * @memberof proto.AppStateSyncKeyRequest + * @memberof proto.SendPaymentMessage * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {proto.AppStateSyncKeyRequest} AppStateSyncKeyRequest + * @returns {proto.SendPaymentMessage} SendPaymentMessage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - AppStateSyncKeyRequest.decode = function decode(reader, length) { + SendPaymentMessage.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.AppStateSyncKeyRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.SendPaymentMessage(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - if (!(message.keyIds && message.keyIds.length)) - message.keyIds = []; - message.keyIds.push($root.proto.AppStateSyncKeyId.decode(reader, reader.uint32())); + case 2: + message.noteMessage = $root.proto.Message.decode(reader, reader.uint32()); + break; + case 3: + message.requestMessageKey = $root.proto.MessageKey.decode(reader, reader.uint32()); + break; + case 4: + message.background = $root.proto.PaymentBackground.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -30641,126 +30726,141 @@ $root.proto = (function() { }; /** - * Decodes an AppStateSyncKeyRequest message from the specified reader or buffer, length delimited. + * Decodes a SendPaymentMessage message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof proto.AppStateSyncKeyRequest + * @memberof proto.SendPaymentMessage * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.AppStateSyncKeyRequest} AppStateSyncKeyRequest + * @returns {proto.SendPaymentMessage} SendPaymentMessage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - AppStateSyncKeyRequest.decodeDelimited = function decodeDelimited(reader) { + SendPaymentMessage.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an AppStateSyncKeyRequest message. + * Verifies a SendPaymentMessage message. * @function verify - * @memberof proto.AppStateSyncKeyRequest + * @memberof proto.SendPaymentMessage * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - AppStateSyncKeyRequest.verify = function verify(message) { + SendPaymentMessage.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.keyIds != null && message.hasOwnProperty("keyIds")) { - if (!Array.isArray(message.keyIds)) - return "keyIds: array expected"; - for (var i = 0; i < message.keyIds.length; ++i) { - var error = $root.proto.AppStateSyncKeyId.verify(message.keyIds[i]); - if (error) - return "keyIds." + error; - } + if (message.noteMessage != null && message.hasOwnProperty("noteMessage")) { + var error = $root.proto.Message.verify(message.noteMessage); + if (error) + return "noteMessage." + error; + } + if (message.requestMessageKey != null && message.hasOwnProperty("requestMessageKey")) { + var error = $root.proto.MessageKey.verify(message.requestMessageKey); + if (error) + return "requestMessageKey." + error; + } + if (message.background != null && message.hasOwnProperty("background")) { + var error = $root.proto.PaymentBackground.verify(message.background); + if (error) + return "background." + error; } return null; }; /** - * Creates an AppStateSyncKeyRequest message from a plain object. Also converts values to their respective internal types. + * Creates a SendPaymentMessage message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof proto.AppStateSyncKeyRequest + * @memberof proto.SendPaymentMessage * @static * @param {Object.} object Plain object - * @returns {proto.AppStateSyncKeyRequest} AppStateSyncKeyRequest + * @returns {proto.SendPaymentMessage} SendPaymentMessage */ - AppStateSyncKeyRequest.fromObject = function fromObject(object) { - if (object instanceof $root.proto.AppStateSyncKeyRequest) + SendPaymentMessage.fromObject = function fromObject(object) { + if (object instanceof $root.proto.SendPaymentMessage) return object; - var message = new $root.proto.AppStateSyncKeyRequest(); - if (object.keyIds) { - if (!Array.isArray(object.keyIds)) - throw TypeError(".proto.AppStateSyncKeyRequest.keyIds: array expected"); - message.keyIds = []; - for (var i = 0; i < object.keyIds.length; ++i) { - if (typeof object.keyIds[i] !== "object") - throw TypeError(".proto.AppStateSyncKeyRequest.keyIds: object expected"); - message.keyIds[i] = $root.proto.AppStateSyncKeyId.fromObject(object.keyIds[i]); - } + var message = new $root.proto.SendPaymentMessage(); + if (object.noteMessage != null) { + if (typeof object.noteMessage !== "object") + throw TypeError(".proto.SendPaymentMessage.noteMessage: object expected"); + message.noteMessage = $root.proto.Message.fromObject(object.noteMessage); + } + if (object.requestMessageKey != null) { + if (typeof object.requestMessageKey !== "object") + throw TypeError(".proto.SendPaymentMessage.requestMessageKey: object expected"); + message.requestMessageKey = $root.proto.MessageKey.fromObject(object.requestMessageKey); + } + if (object.background != null) { + if (typeof object.background !== "object") + throw TypeError(".proto.SendPaymentMessage.background: object expected"); + message.background = $root.proto.PaymentBackground.fromObject(object.background); } return message; }; /** - * Creates a plain object from an AppStateSyncKeyRequest message. Also converts values to other types if specified. + * Creates a plain object from a SendPaymentMessage message. Also converts values to other types if specified. * @function toObject - * @memberof proto.AppStateSyncKeyRequest + * @memberof proto.SendPaymentMessage * @static - * @param {proto.AppStateSyncKeyRequest} message AppStateSyncKeyRequest + * @param {proto.SendPaymentMessage} message SendPaymentMessage * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - AppStateSyncKeyRequest.toObject = function toObject(message, options) { + SendPaymentMessage.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.keyIds = []; - if (message.keyIds && message.keyIds.length) { - object.keyIds = []; - for (var j = 0; j < message.keyIds.length; ++j) - object.keyIds[j] = $root.proto.AppStateSyncKeyId.toObject(message.keyIds[j], options); + if (options.defaults) { + object.noteMessage = null; + object.requestMessageKey = null; + object.background = null; } + if (message.noteMessage != null && message.hasOwnProperty("noteMessage")) + object.noteMessage = $root.proto.Message.toObject(message.noteMessage, options); + if (message.requestMessageKey != null && message.hasOwnProperty("requestMessageKey")) + object.requestMessageKey = $root.proto.MessageKey.toObject(message.requestMessageKey, options); + if (message.background != null && message.hasOwnProperty("background")) + object.background = $root.proto.PaymentBackground.toObject(message.background, options); return object; }; /** - * Converts this AppStateSyncKeyRequest to JSON. + * Converts this SendPaymentMessage to JSON. * @function toJSON - * @memberof proto.AppStateSyncKeyRequest + * @memberof proto.SendPaymentMessage * @instance * @returns {Object.} JSON object */ - AppStateSyncKeyRequest.prototype.toJSON = function toJSON() { + SendPaymentMessage.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return AppStateSyncKeyRequest; + return SendPaymentMessage; })(); - proto.AppStateFatalExceptionNotification = (function() { + proto.ShopMessage = (function() { /** - * Properties of an AppStateFatalExceptionNotification. + * Properties of a ShopMessage. * @memberof proto - * @interface IAppStateFatalExceptionNotification - * @property {Array.|null} [collectionNames] AppStateFatalExceptionNotification collectionNames - * @property {number|Long|null} [timestamp] AppStateFatalExceptionNotification timestamp + * @interface IShopMessage + * @property {string|null} [id] ShopMessage id + * @property {proto.ShopMessage.ShopMessageSurface|null} [surface] ShopMessage surface + * @property {number|null} [messageVersion] ShopMessage messageVersion */ /** - * Constructs a new AppStateFatalExceptionNotification. + * Constructs a new ShopMessage. * @memberof proto - * @classdesc Represents an AppStateFatalExceptionNotification. - * @implements IAppStateFatalExceptionNotification + * @classdesc Represents a ShopMessage. + * @implements IShopMessage * @constructor - * @param {proto.IAppStateFatalExceptionNotification=} [properties] Properties to set + * @param {proto.IShopMessage=} [properties] Properties to set */ - function AppStateFatalExceptionNotification(properties) { - this.collectionNames = []; + function ShopMessage(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -30768,91 +30868,101 @@ $root.proto = (function() { } /** - * AppStateFatalExceptionNotification collectionNames. - * @member {Array.} collectionNames - * @memberof proto.AppStateFatalExceptionNotification + * ShopMessage id. + * @member {string} id + * @memberof proto.ShopMessage * @instance */ - AppStateFatalExceptionNotification.prototype.collectionNames = $util.emptyArray; + ShopMessage.prototype.id = ""; /** - * AppStateFatalExceptionNotification timestamp. - * @member {number|Long} timestamp - * @memberof proto.AppStateFatalExceptionNotification + * ShopMessage surface. + * @member {proto.ShopMessage.ShopMessageSurface} surface + * @memberof proto.ShopMessage * @instance */ - AppStateFatalExceptionNotification.prototype.timestamp = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + ShopMessage.prototype.surface = 0; /** - * Creates a new AppStateFatalExceptionNotification instance using the specified properties. + * ShopMessage messageVersion. + * @member {number} messageVersion + * @memberof proto.ShopMessage + * @instance + */ + ShopMessage.prototype.messageVersion = 0; + + /** + * Creates a new ShopMessage instance using the specified properties. * @function create - * @memberof proto.AppStateFatalExceptionNotification + * @memberof proto.ShopMessage * @static - * @param {proto.IAppStateFatalExceptionNotification=} [properties] Properties to set - * @returns {proto.AppStateFatalExceptionNotification} AppStateFatalExceptionNotification instance + * @param {proto.IShopMessage=} [properties] Properties to set + * @returns {proto.ShopMessage} ShopMessage instance */ - AppStateFatalExceptionNotification.create = function create(properties) { - return new AppStateFatalExceptionNotification(properties); + ShopMessage.create = function create(properties) { + return new ShopMessage(properties); }; /** - * Encodes the specified AppStateFatalExceptionNotification message. Does not implicitly {@link proto.AppStateFatalExceptionNotification.verify|verify} messages. + * Encodes the specified ShopMessage message. Does not implicitly {@link proto.ShopMessage.verify|verify} messages. * @function encode - * @memberof proto.AppStateFatalExceptionNotification + * @memberof proto.ShopMessage * @static - * @param {proto.IAppStateFatalExceptionNotification} message AppStateFatalExceptionNotification message or plain object to encode + * @param {proto.IShopMessage} message ShopMessage message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AppStateFatalExceptionNotification.encode = function encode(message, writer) { + ShopMessage.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.collectionNames != null && message.collectionNames.length) - for (var i = 0; i < message.collectionNames.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.collectionNames[i]); - if (message.timestamp != null && Object.hasOwnProperty.call(message, "timestamp")) - writer.uint32(/* id 2, wireType 0 =*/16).int64(message.timestamp); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.id); + if (message.surface != null && Object.hasOwnProperty.call(message, "surface")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.surface); + if (message.messageVersion != null && Object.hasOwnProperty.call(message, "messageVersion")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.messageVersion); return writer; }; /** - * Encodes the specified AppStateFatalExceptionNotification message, length delimited. Does not implicitly {@link proto.AppStateFatalExceptionNotification.verify|verify} messages. + * Encodes the specified ShopMessage message, length delimited. Does not implicitly {@link proto.ShopMessage.verify|verify} messages. * @function encodeDelimited - * @memberof proto.AppStateFatalExceptionNotification + * @memberof proto.ShopMessage * @static - * @param {proto.IAppStateFatalExceptionNotification} message AppStateFatalExceptionNotification message or plain object to encode + * @param {proto.IShopMessage} message ShopMessage message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AppStateFatalExceptionNotification.encodeDelimited = function encodeDelimited(message, writer) { + ShopMessage.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an AppStateFatalExceptionNotification message from the specified reader or buffer. + * Decodes a ShopMessage message from the specified reader or buffer. * @function decode - * @memberof proto.AppStateFatalExceptionNotification + * @memberof proto.ShopMessage * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {proto.AppStateFatalExceptionNotification} AppStateFatalExceptionNotification + * @returns {proto.ShopMessage} ShopMessage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - AppStateFatalExceptionNotification.decode = function decode(reader, length) { + ShopMessage.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.AppStateFatalExceptionNotification(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.ShopMessage(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - if (!(message.collectionNames && message.collectionNames.length)) - message.collectionNames = []; - message.collectionNames.push(reader.string()); + message.id = reader.string(); break; case 2: - message.timestamp = reader.int64(); + message.surface = reader.int32(); + break; + case 3: + message.messageVersion = reader.int32(); break; default: reader.skipType(tag & 7); @@ -30863,142 +30973,165 @@ $root.proto = (function() { }; /** - * Decodes an AppStateFatalExceptionNotification message from the specified reader or buffer, length delimited. + * Decodes a ShopMessage message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof proto.AppStateFatalExceptionNotification + * @memberof proto.ShopMessage * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.AppStateFatalExceptionNotification} AppStateFatalExceptionNotification + * @returns {proto.ShopMessage} ShopMessage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - AppStateFatalExceptionNotification.decodeDelimited = function decodeDelimited(reader) { + ShopMessage.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an AppStateFatalExceptionNotification message. + * Verifies a ShopMessage message. * @function verify - * @memberof proto.AppStateFatalExceptionNotification + * @memberof proto.ShopMessage * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - AppStateFatalExceptionNotification.verify = function verify(message) { + ShopMessage.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.collectionNames != null && message.hasOwnProperty("collectionNames")) { - if (!Array.isArray(message.collectionNames)) - return "collectionNames: array expected"; - for (var i = 0; i < message.collectionNames.length; ++i) - if (!$util.isString(message.collectionNames[i])) - return "collectionNames: string[] expected"; - } - if (message.timestamp != null && message.hasOwnProperty("timestamp")) - if (!$util.isInteger(message.timestamp) && !(message.timestamp && $util.isInteger(message.timestamp.low) && $util.isInteger(message.timestamp.high))) - return "timestamp: integer|Long expected"; + if (message.id != null && message.hasOwnProperty("id")) + if (!$util.isString(message.id)) + return "id: string expected"; + if (message.surface != null && message.hasOwnProperty("surface")) + switch (message.surface) { + default: + return "surface: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.messageVersion != null && message.hasOwnProperty("messageVersion")) + if (!$util.isInteger(message.messageVersion)) + return "messageVersion: integer expected"; return null; }; /** - * Creates an AppStateFatalExceptionNotification message from a plain object. Also converts values to their respective internal types. + * Creates a ShopMessage message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof proto.AppStateFatalExceptionNotification + * @memberof proto.ShopMessage * @static * @param {Object.} object Plain object - * @returns {proto.AppStateFatalExceptionNotification} AppStateFatalExceptionNotification + * @returns {proto.ShopMessage} ShopMessage */ - AppStateFatalExceptionNotification.fromObject = function fromObject(object) { - if (object instanceof $root.proto.AppStateFatalExceptionNotification) + ShopMessage.fromObject = function fromObject(object) { + if (object instanceof $root.proto.ShopMessage) return object; - var message = new $root.proto.AppStateFatalExceptionNotification(); - if (object.collectionNames) { - if (!Array.isArray(object.collectionNames)) - throw TypeError(".proto.AppStateFatalExceptionNotification.collectionNames: array expected"); - message.collectionNames = []; - for (var i = 0; i < object.collectionNames.length; ++i) - message.collectionNames[i] = String(object.collectionNames[i]); + var message = new $root.proto.ShopMessage(); + if (object.id != null) + message.id = String(object.id); + switch (object.surface) { + case "UNKNOWN_SURFACE": + case 0: + message.surface = 0; + break; + case "FB": + case 1: + message.surface = 1; + break; + case "IG": + case 2: + message.surface = 2; + break; + case "WA": + case 3: + message.surface = 3; + break; } - if (object.timestamp != null) - if ($util.Long) - (message.timestamp = $util.Long.fromValue(object.timestamp)).unsigned = false; - else if (typeof object.timestamp === "string") - message.timestamp = parseInt(object.timestamp, 10); - else if (typeof object.timestamp === "number") - message.timestamp = object.timestamp; - else if (typeof object.timestamp === "object") - message.timestamp = new $util.LongBits(object.timestamp.low >>> 0, object.timestamp.high >>> 0).toNumber(); + if (object.messageVersion != null) + message.messageVersion = object.messageVersion | 0; return message; }; /** - * Creates a plain object from an AppStateFatalExceptionNotification message. Also converts values to other types if specified. + * Creates a plain object from a ShopMessage message. Also converts values to other types if specified. * @function toObject - * @memberof proto.AppStateFatalExceptionNotification + * @memberof proto.ShopMessage * @static - * @param {proto.AppStateFatalExceptionNotification} message AppStateFatalExceptionNotification + * @param {proto.ShopMessage} message ShopMessage * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - AppStateFatalExceptionNotification.toObject = function toObject(message, options) { + ShopMessage.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.collectionNames = []; - if (options.defaults) - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.timestamp = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.timestamp = options.longs === String ? "0" : 0; - if (message.collectionNames && message.collectionNames.length) { - object.collectionNames = []; - for (var j = 0; j < message.collectionNames.length; ++j) - object.collectionNames[j] = message.collectionNames[j]; + if (options.defaults) { + object.id = ""; + object.surface = options.enums === String ? "UNKNOWN_SURFACE" : 0; + object.messageVersion = 0; } - if (message.timestamp != null && message.hasOwnProperty("timestamp")) - if (typeof message.timestamp === "number") - object.timestamp = options.longs === String ? String(message.timestamp) : message.timestamp; - else - object.timestamp = options.longs === String ? $util.Long.prototype.toString.call(message.timestamp) : options.longs === Number ? new $util.LongBits(message.timestamp.low >>> 0, message.timestamp.high >>> 0).toNumber() : message.timestamp; + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; + if (message.surface != null && message.hasOwnProperty("surface")) + object.surface = options.enums === String ? $root.proto.ShopMessage.ShopMessageSurface[message.surface] : message.surface; + if (message.messageVersion != null && message.hasOwnProperty("messageVersion")) + object.messageVersion = message.messageVersion; return object; }; /** - * Converts this AppStateFatalExceptionNotification to JSON. + * Converts this ShopMessage to JSON. * @function toJSON - * @memberof proto.AppStateFatalExceptionNotification + * @memberof proto.ShopMessage * @instance * @returns {Object.} JSON object */ - AppStateFatalExceptionNotification.prototype.toJSON = function toJSON() { + ShopMessage.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return AppStateFatalExceptionNotification; + /** + * ShopMessageSurface enum. + * @name proto.ShopMessage.ShopMessageSurface + * @enum {number} + * @property {number} UNKNOWN_SURFACE=0 UNKNOWN_SURFACE value + * @property {number} FB=1 FB value + * @property {number} IG=2 IG value + * @property {number} WA=3 WA value + */ + ShopMessage.ShopMessageSurface = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNKNOWN_SURFACE"] = 0; + values[valuesById[1] = "FB"] = 1; + values[valuesById[2] = "IG"] = 2; + values[valuesById[3] = "WA"] = 3; + return values; + })(); + + return ShopMessage; })(); - proto.InitialSecurityNotificationSettingSync = (function() { + proto.SingleSelectReply = (function() { /** - * Properties of an InitialSecurityNotificationSettingSync. + * Properties of a SingleSelectReply. * @memberof proto - * @interface IInitialSecurityNotificationSettingSync - * @property {boolean|null} [securityNotificationEnabled] InitialSecurityNotificationSettingSync securityNotificationEnabled + * @interface ISingleSelectReply + * @property {string|null} [selectedRowId] SingleSelectReply selectedRowId */ /** - * Constructs a new InitialSecurityNotificationSettingSync. + * Constructs a new SingleSelectReply. * @memberof proto - * @classdesc Represents an InitialSecurityNotificationSettingSync. - * @implements IInitialSecurityNotificationSettingSync + * @classdesc Represents a SingleSelectReply. + * @implements ISingleSelectReply * @constructor - * @param {proto.IInitialSecurityNotificationSettingSync=} [properties] Properties to set + * @param {proto.ISingleSelectReply=} [properties] Properties to set */ - function InitialSecurityNotificationSettingSync(properties) { + function SingleSelectReply(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -31006,75 +31139,75 @@ $root.proto = (function() { } /** - * InitialSecurityNotificationSettingSync securityNotificationEnabled. - * @member {boolean} securityNotificationEnabled - * @memberof proto.InitialSecurityNotificationSettingSync + * SingleSelectReply selectedRowId. + * @member {string} selectedRowId + * @memberof proto.SingleSelectReply * @instance */ - InitialSecurityNotificationSettingSync.prototype.securityNotificationEnabled = false; + SingleSelectReply.prototype.selectedRowId = ""; /** - * Creates a new InitialSecurityNotificationSettingSync instance using the specified properties. + * Creates a new SingleSelectReply instance using the specified properties. * @function create - * @memberof proto.InitialSecurityNotificationSettingSync + * @memberof proto.SingleSelectReply * @static - * @param {proto.IInitialSecurityNotificationSettingSync=} [properties] Properties to set - * @returns {proto.InitialSecurityNotificationSettingSync} InitialSecurityNotificationSettingSync instance + * @param {proto.ISingleSelectReply=} [properties] Properties to set + * @returns {proto.SingleSelectReply} SingleSelectReply instance */ - InitialSecurityNotificationSettingSync.create = function create(properties) { - return new InitialSecurityNotificationSettingSync(properties); + SingleSelectReply.create = function create(properties) { + return new SingleSelectReply(properties); }; /** - * Encodes the specified InitialSecurityNotificationSettingSync message. Does not implicitly {@link proto.InitialSecurityNotificationSettingSync.verify|verify} messages. + * Encodes the specified SingleSelectReply message. Does not implicitly {@link proto.SingleSelectReply.verify|verify} messages. * @function encode - * @memberof proto.InitialSecurityNotificationSettingSync + * @memberof proto.SingleSelectReply * @static - * @param {proto.IInitialSecurityNotificationSettingSync} message InitialSecurityNotificationSettingSync message or plain object to encode + * @param {proto.ISingleSelectReply} message SingleSelectReply message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - InitialSecurityNotificationSettingSync.encode = function encode(message, writer) { + SingleSelectReply.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.securityNotificationEnabled != null && Object.hasOwnProperty.call(message, "securityNotificationEnabled")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.securityNotificationEnabled); + if (message.selectedRowId != null && Object.hasOwnProperty.call(message, "selectedRowId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.selectedRowId); return writer; }; /** - * Encodes the specified InitialSecurityNotificationSettingSync message, length delimited. Does not implicitly {@link proto.InitialSecurityNotificationSettingSync.verify|verify} messages. + * Encodes the specified SingleSelectReply message, length delimited. Does not implicitly {@link proto.SingleSelectReply.verify|verify} messages. * @function encodeDelimited - * @memberof proto.InitialSecurityNotificationSettingSync + * @memberof proto.SingleSelectReply * @static - * @param {proto.IInitialSecurityNotificationSettingSync} message InitialSecurityNotificationSettingSync message or plain object to encode + * @param {proto.ISingleSelectReply} message SingleSelectReply message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - InitialSecurityNotificationSettingSync.encodeDelimited = function encodeDelimited(message, writer) { + SingleSelectReply.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an InitialSecurityNotificationSettingSync message from the specified reader or buffer. + * Decodes a SingleSelectReply message from the specified reader or buffer. * @function decode - * @memberof proto.InitialSecurityNotificationSettingSync + * @memberof proto.SingleSelectReply * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {proto.InitialSecurityNotificationSettingSync} InitialSecurityNotificationSettingSync + * @returns {proto.SingleSelectReply} SingleSelectReply * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - InitialSecurityNotificationSettingSync.decode = function decode(reader, length) { + SingleSelectReply.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.InitialSecurityNotificationSettingSync(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.SingleSelectReply(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.securityNotificationEnabled = reader.bool(); + message.selectedRowId = reader.string(); break; default: reader.skipType(tag & 7); @@ -31085,110 +31218,121 @@ $root.proto = (function() { }; /** - * Decodes an InitialSecurityNotificationSettingSync message from the specified reader or buffer, length delimited. + * Decodes a SingleSelectReply message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof proto.InitialSecurityNotificationSettingSync + * @memberof proto.SingleSelectReply * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.InitialSecurityNotificationSettingSync} InitialSecurityNotificationSettingSync + * @returns {proto.SingleSelectReply} SingleSelectReply * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - InitialSecurityNotificationSettingSync.decodeDelimited = function decodeDelimited(reader) { + SingleSelectReply.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an InitialSecurityNotificationSettingSync message. + * Verifies a SingleSelectReply message. * @function verify - * @memberof proto.InitialSecurityNotificationSettingSync + * @memberof proto.SingleSelectReply * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - InitialSecurityNotificationSettingSync.verify = function verify(message) { + SingleSelectReply.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.securityNotificationEnabled != null && message.hasOwnProperty("securityNotificationEnabled")) - if (typeof message.securityNotificationEnabled !== "boolean") - return "securityNotificationEnabled: boolean expected"; - return null; - }; + if (message.selectedRowId != null && message.hasOwnProperty("selectedRowId")) + if (!$util.isString(message.selectedRowId)) + return "selectedRowId: string expected"; + return null; + }; /** - * Creates an InitialSecurityNotificationSettingSync message from a plain object. Also converts values to their respective internal types. + * Creates a SingleSelectReply message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof proto.InitialSecurityNotificationSettingSync + * @memberof proto.SingleSelectReply * @static * @param {Object.} object Plain object - * @returns {proto.InitialSecurityNotificationSettingSync} InitialSecurityNotificationSettingSync + * @returns {proto.SingleSelectReply} SingleSelectReply */ - InitialSecurityNotificationSettingSync.fromObject = function fromObject(object) { - if (object instanceof $root.proto.InitialSecurityNotificationSettingSync) + SingleSelectReply.fromObject = function fromObject(object) { + if (object instanceof $root.proto.SingleSelectReply) return object; - var message = new $root.proto.InitialSecurityNotificationSettingSync(); - if (object.securityNotificationEnabled != null) - message.securityNotificationEnabled = Boolean(object.securityNotificationEnabled); + var message = new $root.proto.SingleSelectReply(); + if (object.selectedRowId != null) + message.selectedRowId = String(object.selectedRowId); return message; }; /** - * Creates a plain object from an InitialSecurityNotificationSettingSync message. Also converts values to other types if specified. + * Creates a plain object from a SingleSelectReply message. Also converts values to other types if specified. * @function toObject - * @memberof proto.InitialSecurityNotificationSettingSync + * @memberof proto.SingleSelectReply * @static - * @param {proto.InitialSecurityNotificationSettingSync} message InitialSecurityNotificationSettingSync + * @param {proto.SingleSelectReply} message SingleSelectReply * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - InitialSecurityNotificationSettingSync.toObject = function toObject(message, options) { + SingleSelectReply.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) - object.securityNotificationEnabled = false; - if (message.securityNotificationEnabled != null && message.hasOwnProperty("securityNotificationEnabled")) - object.securityNotificationEnabled = message.securityNotificationEnabled; + object.selectedRowId = ""; + if (message.selectedRowId != null && message.hasOwnProperty("selectedRowId")) + object.selectedRowId = message.selectedRowId; return object; }; /** - * Converts this InitialSecurityNotificationSettingSync to JSON. + * Converts this SingleSelectReply to JSON. * @function toJSON - * @memberof proto.InitialSecurityNotificationSettingSync + * @memberof proto.SingleSelectReply * @instance * @returns {Object.} JSON object */ - InitialSecurityNotificationSettingSync.prototype.toJSON = function toJSON() { + SingleSelectReply.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return InitialSecurityNotificationSettingSync; + return SingleSelectReply; })(); - proto.ContactsArrayMessage = (function() { + proto.StickerMessage = (function() { /** - * Properties of a ContactsArrayMessage. + * Properties of a StickerMessage. * @memberof proto - * @interface IContactsArrayMessage - * @property {string|null} [displayName] ContactsArrayMessage displayName - * @property {Array.|null} [contacts] ContactsArrayMessage contacts - * @property {proto.IContextInfo|null} [contextInfo] ContactsArrayMessage contextInfo + * @interface IStickerMessage + * @property {string|null} [url] StickerMessage url + * @property {Uint8Array|null} [fileSha256] StickerMessage fileSha256 + * @property {Uint8Array|null} [fileEncSha256] StickerMessage fileEncSha256 + * @property {Uint8Array|null} [mediaKey] StickerMessage mediaKey + * @property {string|null} [mimetype] StickerMessage mimetype + * @property {number|null} [height] StickerMessage height + * @property {number|null} [width] StickerMessage width + * @property {string|null} [directPath] StickerMessage directPath + * @property {number|Long|null} [fileLength] StickerMessage fileLength + * @property {number|Long|null} [mediaKeyTimestamp] StickerMessage mediaKeyTimestamp + * @property {number|null} [firstFrameLength] StickerMessage firstFrameLength + * @property {Uint8Array|null} [firstFrameSidecar] StickerMessage firstFrameSidecar + * @property {boolean|null} [isAnimated] StickerMessage isAnimated + * @property {Uint8Array|null} [pngThumbnail] StickerMessage pngThumbnail + * @property {proto.IContextInfo|null} [contextInfo] StickerMessage contextInfo */ /** - * Constructs a new ContactsArrayMessage. + * Constructs a new StickerMessage. * @memberof proto - * @classdesc Represents a ContactsArrayMessage. - * @implements IContactsArrayMessage + * @classdesc Represents a StickerMessage. + * @implements IStickerMessage * @constructor - * @param {proto.IContactsArrayMessage=} [properties] Properties to set + * @param {proto.IStickerMessage=} [properties] Properties to set */ - function ContactsArrayMessage(properties) { - this.contacts = []; + function StickerMessage(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -31196,345 +31340,257 @@ $root.proto = (function() { } /** - * ContactsArrayMessage displayName. - * @member {string} displayName - * @memberof proto.ContactsArrayMessage + * StickerMessage url. + * @member {string} url + * @memberof proto.StickerMessage * @instance */ - ContactsArrayMessage.prototype.displayName = ""; + StickerMessage.prototype.url = ""; /** - * ContactsArrayMessage contacts. - * @member {Array.} contacts - * @memberof proto.ContactsArrayMessage + * StickerMessage fileSha256. + * @member {Uint8Array} fileSha256 + * @memberof proto.StickerMessage * @instance */ - ContactsArrayMessage.prototype.contacts = $util.emptyArray; + StickerMessage.prototype.fileSha256 = $util.newBuffer([]); /** - * ContactsArrayMessage contextInfo. - * @member {proto.IContextInfo|null|undefined} contextInfo - * @memberof proto.ContactsArrayMessage + * StickerMessage fileEncSha256. + * @member {Uint8Array} fileEncSha256 + * @memberof proto.StickerMessage * @instance */ - ContactsArrayMessage.prototype.contextInfo = null; - - /** - * Creates a new ContactsArrayMessage instance using the specified properties. - * @function create - * @memberof proto.ContactsArrayMessage - * @static - * @param {proto.IContactsArrayMessage=} [properties] Properties to set - * @returns {proto.ContactsArrayMessage} ContactsArrayMessage instance - */ - ContactsArrayMessage.create = function create(properties) { - return new ContactsArrayMessage(properties); - }; + StickerMessage.prototype.fileEncSha256 = $util.newBuffer([]); /** - * Encodes the specified ContactsArrayMessage message. Does not implicitly {@link proto.ContactsArrayMessage.verify|verify} messages. - * @function encode - * @memberof proto.ContactsArrayMessage - * @static - * @param {proto.IContactsArrayMessage} message ContactsArrayMessage message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * StickerMessage mediaKey. + * @member {Uint8Array} mediaKey + * @memberof proto.StickerMessage + * @instance */ - ContactsArrayMessage.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.displayName); - if (message.contacts != null && message.contacts.length) - for (var i = 0; i < message.contacts.length; ++i) - $root.proto.ContactMessage.encode(message.contacts[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.contextInfo != null && Object.hasOwnProperty.call(message, "contextInfo")) - $root.proto.ContextInfo.encode(message.contextInfo, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); - return writer; - }; + StickerMessage.prototype.mediaKey = $util.newBuffer([]); /** - * Encodes the specified ContactsArrayMessage message, length delimited. Does not implicitly {@link proto.ContactsArrayMessage.verify|verify} messages. - * @function encodeDelimited - * @memberof proto.ContactsArrayMessage - * @static - * @param {proto.IContactsArrayMessage} message ContactsArrayMessage message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * StickerMessage mimetype. + * @member {string} mimetype + * @memberof proto.StickerMessage + * @instance */ - ContactsArrayMessage.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + StickerMessage.prototype.mimetype = ""; /** - * Decodes a ContactsArrayMessage message from the specified reader or buffer. - * @function decode - * @memberof proto.ContactsArrayMessage - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {proto.ContactsArrayMessage} ContactsArrayMessage - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * StickerMessage height. + * @member {number} height + * @memberof proto.StickerMessage + * @instance */ - ContactsArrayMessage.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.ContactsArrayMessage(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.displayName = reader.string(); - break; - case 2: - if (!(message.contacts && message.contacts.length)) - message.contacts = []; - message.contacts.push($root.proto.ContactMessage.decode(reader, reader.uint32())); - break; - case 17: - message.contextInfo = $root.proto.ContextInfo.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + StickerMessage.prototype.height = 0; /** - * Decodes a ContactsArrayMessage message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof proto.ContactsArrayMessage - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.ContactsArrayMessage} ContactsArrayMessage - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * StickerMessage width. + * @member {number} width + * @memberof proto.StickerMessage + * @instance */ - ContactsArrayMessage.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + StickerMessage.prototype.width = 0; /** - * Verifies a ContactsArrayMessage message. - * @function verify - * @memberof proto.ContactsArrayMessage - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not + * StickerMessage directPath. + * @member {string} directPath + * @memberof proto.StickerMessage + * @instance */ - ContactsArrayMessage.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.displayName != null && message.hasOwnProperty("displayName")) - if (!$util.isString(message.displayName)) - return "displayName: string expected"; - if (message.contacts != null && message.hasOwnProperty("contacts")) { - if (!Array.isArray(message.contacts)) - return "contacts: array expected"; - for (var i = 0; i < message.contacts.length; ++i) { - var error = $root.proto.ContactMessage.verify(message.contacts[i]); - if (error) - return "contacts." + error; - } - } - if (message.contextInfo != null && message.hasOwnProperty("contextInfo")) { - var error = $root.proto.ContextInfo.verify(message.contextInfo); - if (error) - return "contextInfo." + error; - } - return null; - }; + StickerMessage.prototype.directPath = ""; /** - * Creates a ContactsArrayMessage message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof proto.ContactsArrayMessage - * @static - * @param {Object.} object Plain object - * @returns {proto.ContactsArrayMessage} ContactsArrayMessage + * StickerMessage fileLength. + * @member {number|Long} fileLength + * @memberof proto.StickerMessage + * @instance */ - ContactsArrayMessage.fromObject = function fromObject(object) { - if (object instanceof $root.proto.ContactsArrayMessage) - return object; - var message = new $root.proto.ContactsArrayMessage(); - if (object.displayName != null) - message.displayName = String(object.displayName); - if (object.contacts) { - if (!Array.isArray(object.contacts)) - throw TypeError(".proto.ContactsArrayMessage.contacts: array expected"); - message.contacts = []; - for (var i = 0; i < object.contacts.length; ++i) { - if (typeof object.contacts[i] !== "object") - throw TypeError(".proto.ContactsArrayMessage.contacts: object expected"); - message.contacts[i] = $root.proto.ContactMessage.fromObject(object.contacts[i]); - } - } - if (object.contextInfo != null) { - if (typeof object.contextInfo !== "object") - throw TypeError(".proto.ContactsArrayMessage.contextInfo: object expected"); - message.contextInfo = $root.proto.ContextInfo.fromObject(object.contextInfo); - } - return message; - }; + StickerMessage.prototype.fileLength = $util.Long ? $util.Long.fromBits(0,0,true) : 0; /** - * Creates a plain object from a ContactsArrayMessage message. Also converts values to other types if specified. - * @function toObject - * @memberof proto.ContactsArrayMessage - * @static - * @param {proto.ContactsArrayMessage} message ContactsArrayMessage - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object + * StickerMessage mediaKeyTimestamp. + * @member {number|Long} mediaKeyTimestamp + * @memberof proto.StickerMessage + * @instance */ - ContactsArrayMessage.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.contacts = []; - if (options.defaults) { - object.displayName = ""; - object.contextInfo = null; - } - if (message.displayName != null && message.hasOwnProperty("displayName")) - object.displayName = message.displayName; - if (message.contacts && message.contacts.length) { - object.contacts = []; - for (var j = 0; j < message.contacts.length; ++j) - object.contacts[j] = $root.proto.ContactMessage.toObject(message.contacts[j], options); - } - if (message.contextInfo != null && message.hasOwnProperty("contextInfo")) - object.contextInfo = $root.proto.ContextInfo.toObject(message.contextInfo, options); - return object; - }; + StickerMessage.prototype.mediaKeyTimestamp = $util.Long ? $util.Long.fromBits(0,0,false) : 0; /** - * Converts this ContactsArrayMessage to JSON. - * @function toJSON - * @memberof proto.ContactsArrayMessage + * StickerMessage firstFrameLength. + * @member {number} firstFrameLength + * @memberof proto.StickerMessage * @instance - * @returns {Object.} JSON object */ - ContactsArrayMessage.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ContactsArrayMessage; - })(); - - proto.HSMCurrency = (function() { + StickerMessage.prototype.firstFrameLength = 0; /** - * Properties of a HSMCurrency. - * @memberof proto - * @interface IHSMCurrency - * @property {string|null} [currencyCode] HSMCurrency currencyCode - * @property {number|Long|null} [amount1000] HSMCurrency amount1000 + * StickerMessage firstFrameSidecar. + * @member {Uint8Array} firstFrameSidecar + * @memberof proto.StickerMessage + * @instance */ + StickerMessage.prototype.firstFrameSidecar = $util.newBuffer([]); /** - * Constructs a new HSMCurrency. - * @memberof proto - * @classdesc Represents a HSMCurrency. - * @implements IHSMCurrency - * @constructor - * @param {proto.IHSMCurrency=} [properties] Properties to set + * StickerMessage isAnimated. + * @member {boolean} isAnimated + * @memberof proto.StickerMessage + * @instance */ - function HSMCurrency(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + StickerMessage.prototype.isAnimated = false; /** - * HSMCurrency currencyCode. - * @member {string} currencyCode - * @memberof proto.HSMCurrency + * StickerMessage pngThumbnail. + * @member {Uint8Array} pngThumbnail + * @memberof proto.StickerMessage * @instance */ - HSMCurrency.prototype.currencyCode = ""; + StickerMessage.prototype.pngThumbnail = $util.newBuffer([]); /** - * HSMCurrency amount1000. - * @member {number|Long} amount1000 - * @memberof proto.HSMCurrency + * StickerMessage contextInfo. + * @member {proto.IContextInfo|null|undefined} contextInfo + * @memberof proto.StickerMessage * @instance */ - HSMCurrency.prototype.amount1000 = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + StickerMessage.prototype.contextInfo = null; /** - * Creates a new HSMCurrency instance using the specified properties. + * Creates a new StickerMessage instance using the specified properties. * @function create - * @memberof proto.HSMCurrency + * @memberof proto.StickerMessage * @static - * @param {proto.IHSMCurrency=} [properties] Properties to set - * @returns {proto.HSMCurrency} HSMCurrency instance + * @param {proto.IStickerMessage=} [properties] Properties to set + * @returns {proto.StickerMessage} StickerMessage instance */ - HSMCurrency.create = function create(properties) { - return new HSMCurrency(properties); + StickerMessage.create = function create(properties) { + return new StickerMessage(properties); }; /** - * Encodes the specified HSMCurrency message. Does not implicitly {@link proto.HSMCurrency.verify|verify} messages. + * Encodes the specified StickerMessage message. Does not implicitly {@link proto.StickerMessage.verify|verify} messages. * @function encode - * @memberof proto.HSMCurrency + * @memberof proto.StickerMessage * @static - * @param {proto.IHSMCurrency} message HSMCurrency message or plain object to encode + * @param {proto.IStickerMessage} message StickerMessage message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - HSMCurrency.encode = function encode(message, writer) { + StickerMessage.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.currencyCode != null && Object.hasOwnProperty.call(message, "currencyCode")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.currencyCode); - if (message.amount1000 != null && Object.hasOwnProperty.call(message, "amount1000")) - writer.uint32(/* id 2, wireType 0 =*/16).int64(message.amount1000); + if (message.url != null && Object.hasOwnProperty.call(message, "url")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.url); + if (message.fileSha256 != null && Object.hasOwnProperty.call(message, "fileSha256")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.fileSha256); + if (message.fileEncSha256 != null && Object.hasOwnProperty.call(message, "fileEncSha256")) + writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.fileEncSha256); + if (message.mediaKey != null && Object.hasOwnProperty.call(message, "mediaKey")) + writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.mediaKey); + if (message.mimetype != null && Object.hasOwnProperty.call(message, "mimetype")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.mimetype); + if (message.height != null && Object.hasOwnProperty.call(message, "height")) + writer.uint32(/* id 6, wireType 0 =*/48).uint32(message.height); + if (message.width != null && Object.hasOwnProperty.call(message, "width")) + writer.uint32(/* id 7, wireType 0 =*/56).uint32(message.width); + if (message.directPath != null && Object.hasOwnProperty.call(message, "directPath")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.directPath); + if (message.fileLength != null && Object.hasOwnProperty.call(message, "fileLength")) + writer.uint32(/* id 9, wireType 0 =*/72).uint64(message.fileLength); + if (message.mediaKeyTimestamp != null && Object.hasOwnProperty.call(message, "mediaKeyTimestamp")) + writer.uint32(/* id 10, wireType 0 =*/80).int64(message.mediaKeyTimestamp); + if (message.firstFrameLength != null && Object.hasOwnProperty.call(message, "firstFrameLength")) + writer.uint32(/* id 11, wireType 0 =*/88).uint32(message.firstFrameLength); + if (message.firstFrameSidecar != null && Object.hasOwnProperty.call(message, "firstFrameSidecar")) + writer.uint32(/* id 12, wireType 2 =*/98).bytes(message.firstFrameSidecar); + if (message.isAnimated != null && Object.hasOwnProperty.call(message, "isAnimated")) + writer.uint32(/* id 13, wireType 0 =*/104).bool(message.isAnimated); + if (message.pngThumbnail != null && Object.hasOwnProperty.call(message, "pngThumbnail")) + writer.uint32(/* id 16, wireType 2 =*/130).bytes(message.pngThumbnail); + if (message.contextInfo != null && Object.hasOwnProperty.call(message, "contextInfo")) + $root.proto.ContextInfo.encode(message.contextInfo, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); return writer; }; /** - * Encodes the specified HSMCurrency message, length delimited. Does not implicitly {@link proto.HSMCurrency.verify|verify} messages. + * Encodes the specified StickerMessage message, length delimited. Does not implicitly {@link proto.StickerMessage.verify|verify} messages. * @function encodeDelimited - * @memberof proto.HSMCurrency + * @memberof proto.StickerMessage * @static - * @param {proto.IHSMCurrency} message HSMCurrency message or plain object to encode + * @param {proto.IStickerMessage} message StickerMessage message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - HSMCurrency.encodeDelimited = function encodeDelimited(message, writer) { + StickerMessage.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a HSMCurrency message from the specified reader or buffer. + * Decodes a StickerMessage message from the specified reader or buffer. * @function decode - * @memberof proto.HSMCurrency + * @memberof proto.StickerMessage * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {proto.HSMCurrency} HSMCurrency + * @returns {proto.StickerMessage} StickerMessage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - HSMCurrency.decode = function decode(reader, length) { + StickerMessage.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.HSMCurrency(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.StickerMessage(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.currencyCode = reader.string(); + message.url = reader.string(); break; case 2: - message.amount1000 = reader.int64(); + message.fileSha256 = reader.bytes(); + break; + case 3: + message.fileEncSha256 = reader.bytes(); + break; + case 4: + message.mediaKey = reader.bytes(); + break; + case 5: + message.mimetype = reader.string(); + break; + case 6: + message.height = reader.uint32(); + break; + case 7: + message.width = reader.uint32(); + break; + case 8: + message.directPath = reader.string(); + break; + case 9: + message.fileLength = reader.uint64(); + break; + case 10: + message.mediaKeyTimestamp = reader.int64(); + break; + case 11: + message.firstFrameLength = reader.uint32(); + break; + case 12: + message.firstFrameSidecar = reader.bytes(); + break; + case 13: + message.isAnimated = reader.bool(); + break; + case 16: + message.pngThumbnail = reader.bytes(); + break; + case 17: + message.contextInfo = $root.proto.ContextInfo.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -31545,136 +31601,301 @@ $root.proto = (function() { }; /** - * Decodes a HSMCurrency message from the specified reader or buffer, length delimited. + * Decodes a StickerMessage message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof proto.HSMCurrency + * @memberof proto.StickerMessage * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.HSMCurrency} HSMCurrency + * @returns {proto.StickerMessage} StickerMessage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - HSMCurrency.decodeDelimited = function decodeDelimited(reader) { + StickerMessage.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a HSMCurrency message. + * Verifies a StickerMessage message. * @function verify - * @memberof proto.HSMCurrency + * @memberof proto.StickerMessage * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - HSMCurrency.verify = function verify(message) { + StickerMessage.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.currencyCode != null && message.hasOwnProperty("currencyCode")) - if (!$util.isString(message.currencyCode)) - return "currencyCode: string expected"; - if (message.amount1000 != null && message.hasOwnProperty("amount1000")) - if (!$util.isInteger(message.amount1000) && !(message.amount1000 && $util.isInteger(message.amount1000.low) && $util.isInteger(message.amount1000.high))) - return "amount1000: integer|Long expected"; - return null; - }; - - /** - * Creates a HSMCurrency message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof proto.HSMCurrency - * @static + if (message.url != null && message.hasOwnProperty("url")) + if (!$util.isString(message.url)) + return "url: string expected"; + if (message.fileSha256 != null && message.hasOwnProperty("fileSha256")) + if (!(message.fileSha256 && typeof message.fileSha256.length === "number" || $util.isString(message.fileSha256))) + return "fileSha256: buffer expected"; + if (message.fileEncSha256 != null && message.hasOwnProperty("fileEncSha256")) + if (!(message.fileEncSha256 && typeof message.fileEncSha256.length === "number" || $util.isString(message.fileEncSha256))) + return "fileEncSha256: buffer expected"; + if (message.mediaKey != null && message.hasOwnProperty("mediaKey")) + if (!(message.mediaKey && typeof message.mediaKey.length === "number" || $util.isString(message.mediaKey))) + return "mediaKey: buffer expected"; + if (message.mimetype != null && message.hasOwnProperty("mimetype")) + if (!$util.isString(message.mimetype)) + return "mimetype: string expected"; + if (message.height != null && message.hasOwnProperty("height")) + if (!$util.isInteger(message.height)) + return "height: integer expected"; + if (message.width != null && message.hasOwnProperty("width")) + if (!$util.isInteger(message.width)) + return "width: integer expected"; + if (message.directPath != null && message.hasOwnProperty("directPath")) + if (!$util.isString(message.directPath)) + return "directPath: string expected"; + if (message.fileLength != null && message.hasOwnProperty("fileLength")) + if (!$util.isInteger(message.fileLength) && !(message.fileLength && $util.isInteger(message.fileLength.low) && $util.isInteger(message.fileLength.high))) + return "fileLength: integer|Long expected"; + if (message.mediaKeyTimestamp != null && message.hasOwnProperty("mediaKeyTimestamp")) + if (!$util.isInteger(message.mediaKeyTimestamp) && !(message.mediaKeyTimestamp && $util.isInteger(message.mediaKeyTimestamp.low) && $util.isInteger(message.mediaKeyTimestamp.high))) + return "mediaKeyTimestamp: integer|Long expected"; + if (message.firstFrameLength != null && message.hasOwnProperty("firstFrameLength")) + if (!$util.isInteger(message.firstFrameLength)) + return "firstFrameLength: integer expected"; + if (message.firstFrameSidecar != null && message.hasOwnProperty("firstFrameSidecar")) + if (!(message.firstFrameSidecar && typeof message.firstFrameSidecar.length === "number" || $util.isString(message.firstFrameSidecar))) + return "firstFrameSidecar: buffer expected"; + if (message.isAnimated != null && message.hasOwnProperty("isAnimated")) + if (typeof message.isAnimated !== "boolean") + return "isAnimated: boolean expected"; + if (message.pngThumbnail != null && message.hasOwnProperty("pngThumbnail")) + if (!(message.pngThumbnail && typeof message.pngThumbnail.length === "number" || $util.isString(message.pngThumbnail))) + return "pngThumbnail: buffer expected"; + if (message.contextInfo != null && message.hasOwnProperty("contextInfo")) { + var error = $root.proto.ContextInfo.verify(message.contextInfo); + if (error) + return "contextInfo." + error; + } + return null; + }; + + /** + * Creates a StickerMessage message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof proto.StickerMessage + * @static * @param {Object.} object Plain object - * @returns {proto.HSMCurrency} HSMCurrency + * @returns {proto.StickerMessage} StickerMessage */ - HSMCurrency.fromObject = function fromObject(object) { - if (object instanceof $root.proto.HSMCurrency) + StickerMessage.fromObject = function fromObject(object) { + if (object instanceof $root.proto.StickerMessage) return object; - var message = new $root.proto.HSMCurrency(); - if (object.currencyCode != null) - message.currencyCode = String(object.currencyCode); - if (object.amount1000 != null) + var message = new $root.proto.StickerMessage(); + if (object.url != null) + message.url = String(object.url); + if (object.fileSha256 != null) + if (typeof object.fileSha256 === "string") + $util.base64.decode(object.fileSha256, message.fileSha256 = $util.newBuffer($util.base64.length(object.fileSha256)), 0); + else if (object.fileSha256.length) + message.fileSha256 = object.fileSha256; + if (object.fileEncSha256 != null) + if (typeof object.fileEncSha256 === "string") + $util.base64.decode(object.fileEncSha256, message.fileEncSha256 = $util.newBuffer($util.base64.length(object.fileEncSha256)), 0); + else if (object.fileEncSha256.length) + message.fileEncSha256 = object.fileEncSha256; + if (object.mediaKey != null) + if (typeof object.mediaKey === "string") + $util.base64.decode(object.mediaKey, message.mediaKey = $util.newBuffer($util.base64.length(object.mediaKey)), 0); + else if (object.mediaKey.length) + message.mediaKey = object.mediaKey; + if (object.mimetype != null) + message.mimetype = String(object.mimetype); + if (object.height != null) + message.height = object.height >>> 0; + if (object.width != null) + message.width = object.width >>> 0; + if (object.directPath != null) + message.directPath = String(object.directPath); + if (object.fileLength != null) if ($util.Long) - (message.amount1000 = $util.Long.fromValue(object.amount1000)).unsigned = false; - else if (typeof object.amount1000 === "string") - message.amount1000 = parseInt(object.amount1000, 10); - else if (typeof object.amount1000 === "number") - message.amount1000 = object.amount1000; - else if (typeof object.amount1000 === "object") - message.amount1000 = new $util.LongBits(object.amount1000.low >>> 0, object.amount1000.high >>> 0).toNumber(); + (message.fileLength = $util.Long.fromValue(object.fileLength)).unsigned = true; + else if (typeof object.fileLength === "string") + message.fileLength = parseInt(object.fileLength, 10); + else if (typeof object.fileLength === "number") + message.fileLength = object.fileLength; + else if (typeof object.fileLength === "object") + message.fileLength = new $util.LongBits(object.fileLength.low >>> 0, object.fileLength.high >>> 0).toNumber(true); + if (object.mediaKeyTimestamp != null) + if ($util.Long) + (message.mediaKeyTimestamp = $util.Long.fromValue(object.mediaKeyTimestamp)).unsigned = false; + else if (typeof object.mediaKeyTimestamp === "string") + message.mediaKeyTimestamp = parseInt(object.mediaKeyTimestamp, 10); + else if (typeof object.mediaKeyTimestamp === "number") + message.mediaKeyTimestamp = object.mediaKeyTimestamp; + else if (typeof object.mediaKeyTimestamp === "object") + message.mediaKeyTimestamp = new $util.LongBits(object.mediaKeyTimestamp.low >>> 0, object.mediaKeyTimestamp.high >>> 0).toNumber(); + if (object.firstFrameLength != null) + message.firstFrameLength = object.firstFrameLength >>> 0; + if (object.firstFrameSidecar != null) + if (typeof object.firstFrameSidecar === "string") + $util.base64.decode(object.firstFrameSidecar, message.firstFrameSidecar = $util.newBuffer($util.base64.length(object.firstFrameSidecar)), 0); + else if (object.firstFrameSidecar.length) + message.firstFrameSidecar = object.firstFrameSidecar; + if (object.isAnimated != null) + message.isAnimated = Boolean(object.isAnimated); + if (object.pngThumbnail != null) + if (typeof object.pngThumbnail === "string") + $util.base64.decode(object.pngThumbnail, message.pngThumbnail = $util.newBuffer($util.base64.length(object.pngThumbnail)), 0); + else if (object.pngThumbnail.length) + message.pngThumbnail = object.pngThumbnail; + if (object.contextInfo != null) { + if (typeof object.contextInfo !== "object") + throw TypeError(".proto.StickerMessage.contextInfo: object expected"); + message.contextInfo = $root.proto.ContextInfo.fromObject(object.contextInfo); + } return message; }; /** - * Creates a plain object from a HSMCurrency message. Also converts values to other types if specified. + * Creates a plain object from a StickerMessage message. Also converts values to other types if specified. * @function toObject - * @memberof proto.HSMCurrency + * @memberof proto.StickerMessage * @static - * @param {proto.HSMCurrency} message HSMCurrency + * @param {proto.StickerMessage} message StickerMessage * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - HSMCurrency.toObject = function toObject(message, options) { + StickerMessage.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.currencyCode = ""; + object.url = ""; + if (options.bytes === String) + object.fileSha256 = ""; + else { + object.fileSha256 = []; + if (options.bytes !== Array) + object.fileSha256 = $util.newBuffer(object.fileSha256); + } + if (options.bytes === String) + object.fileEncSha256 = ""; + else { + object.fileEncSha256 = []; + if (options.bytes !== Array) + object.fileEncSha256 = $util.newBuffer(object.fileEncSha256); + } + if (options.bytes === String) + object.mediaKey = ""; + else { + object.mediaKey = []; + if (options.bytes !== Array) + object.mediaKey = $util.newBuffer(object.mediaKey); + } + object.mimetype = ""; + object.height = 0; + object.width = 0; + object.directPath = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.fileLength = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.fileLength = options.longs === String ? "0" : 0; if ($util.Long) { var long = new $util.Long(0, 0, false); - object.amount1000 = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + object.mediaKeyTimestamp = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; } else - object.amount1000 = options.longs === String ? "0" : 0; + object.mediaKeyTimestamp = options.longs === String ? "0" : 0; + object.firstFrameLength = 0; + if (options.bytes === String) + object.firstFrameSidecar = ""; + else { + object.firstFrameSidecar = []; + if (options.bytes !== Array) + object.firstFrameSidecar = $util.newBuffer(object.firstFrameSidecar); + } + object.isAnimated = false; + if (options.bytes === String) + object.pngThumbnail = ""; + else { + object.pngThumbnail = []; + if (options.bytes !== Array) + object.pngThumbnail = $util.newBuffer(object.pngThumbnail); + } + object.contextInfo = null; } - if (message.currencyCode != null && message.hasOwnProperty("currencyCode")) - object.currencyCode = message.currencyCode; - if (message.amount1000 != null && message.hasOwnProperty("amount1000")) - if (typeof message.amount1000 === "number") - object.amount1000 = options.longs === String ? String(message.amount1000) : message.amount1000; + if (message.url != null && message.hasOwnProperty("url")) + object.url = message.url; + if (message.fileSha256 != null && message.hasOwnProperty("fileSha256")) + object.fileSha256 = options.bytes === String ? $util.base64.encode(message.fileSha256, 0, message.fileSha256.length) : options.bytes === Array ? Array.prototype.slice.call(message.fileSha256) : message.fileSha256; + if (message.fileEncSha256 != null && message.hasOwnProperty("fileEncSha256")) + object.fileEncSha256 = options.bytes === String ? $util.base64.encode(message.fileEncSha256, 0, message.fileEncSha256.length) : options.bytes === Array ? Array.prototype.slice.call(message.fileEncSha256) : message.fileEncSha256; + if (message.mediaKey != null && message.hasOwnProperty("mediaKey")) + object.mediaKey = options.bytes === String ? $util.base64.encode(message.mediaKey, 0, message.mediaKey.length) : options.bytes === Array ? Array.prototype.slice.call(message.mediaKey) : message.mediaKey; + if (message.mimetype != null && message.hasOwnProperty("mimetype")) + object.mimetype = message.mimetype; + if (message.height != null && message.hasOwnProperty("height")) + object.height = message.height; + if (message.width != null && message.hasOwnProperty("width")) + object.width = message.width; + if (message.directPath != null && message.hasOwnProperty("directPath")) + object.directPath = message.directPath; + if (message.fileLength != null && message.hasOwnProperty("fileLength")) + if (typeof message.fileLength === "number") + object.fileLength = options.longs === String ? String(message.fileLength) : message.fileLength; else - object.amount1000 = options.longs === String ? $util.Long.prototype.toString.call(message.amount1000) : options.longs === Number ? new $util.LongBits(message.amount1000.low >>> 0, message.amount1000.high >>> 0).toNumber() : message.amount1000; + object.fileLength = options.longs === String ? $util.Long.prototype.toString.call(message.fileLength) : options.longs === Number ? new $util.LongBits(message.fileLength.low >>> 0, message.fileLength.high >>> 0).toNumber(true) : message.fileLength; + if (message.mediaKeyTimestamp != null && message.hasOwnProperty("mediaKeyTimestamp")) + if (typeof message.mediaKeyTimestamp === "number") + object.mediaKeyTimestamp = options.longs === String ? String(message.mediaKeyTimestamp) : message.mediaKeyTimestamp; + else + object.mediaKeyTimestamp = options.longs === String ? $util.Long.prototype.toString.call(message.mediaKeyTimestamp) : options.longs === Number ? new $util.LongBits(message.mediaKeyTimestamp.low >>> 0, message.mediaKeyTimestamp.high >>> 0).toNumber() : message.mediaKeyTimestamp; + if (message.firstFrameLength != null && message.hasOwnProperty("firstFrameLength")) + object.firstFrameLength = message.firstFrameLength; + if (message.firstFrameSidecar != null && message.hasOwnProperty("firstFrameSidecar")) + object.firstFrameSidecar = options.bytes === String ? $util.base64.encode(message.firstFrameSidecar, 0, message.firstFrameSidecar.length) : options.bytes === Array ? Array.prototype.slice.call(message.firstFrameSidecar) : message.firstFrameSidecar; + if (message.isAnimated != null && message.hasOwnProperty("isAnimated")) + object.isAnimated = message.isAnimated; + if (message.pngThumbnail != null && message.hasOwnProperty("pngThumbnail")) + object.pngThumbnail = options.bytes === String ? $util.base64.encode(message.pngThumbnail, 0, message.pngThumbnail.length) : options.bytes === Array ? Array.prototype.slice.call(message.pngThumbnail) : message.pngThumbnail; + if (message.contextInfo != null && message.hasOwnProperty("contextInfo")) + object.contextInfo = $root.proto.ContextInfo.toObject(message.contextInfo, options); return object; }; /** - * Converts this HSMCurrency to JSON. + * Converts this StickerMessage to JSON. * @function toJSON - * @memberof proto.HSMCurrency + * @memberof proto.StickerMessage * @instance * @returns {Object.} JSON object */ - HSMCurrency.prototype.toJSON = function toJSON() { + StickerMessage.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return HSMCurrency; + return StickerMessage; })(); - proto.HSMDateTimeComponent = (function() { + proto.StickerSyncRMRMessage = (function() { /** - * Properties of a HSMDateTimeComponent. + * Properties of a StickerSyncRMRMessage. * @memberof proto - * @interface IHSMDateTimeComponent - * @property {proto.HSMDateTimeComponent.HSMDateTimeComponentDayOfWeekType|null} [dayOfWeek] HSMDateTimeComponent dayOfWeek - * @property {number|null} [year] HSMDateTimeComponent year - * @property {number|null} [month] HSMDateTimeComponent month - * @property {number|null} [dayOfMonth] HSMDateTimeComponent dayOfMonth - * @property {number|null} [hour] HSMDateTimeComponent hour - * @property {number|null} [minute] HSMDateTimeComponent minute - * @property {proto.HSMDateTimeComponent.HSMDateTimeComponentCalendarType|null} [calendar] HSMDateTimeComponent calendar + * @interface IStickerSyncRMRMessage + * @property {Array.|null} [filehash] StickerSyncRMRMessage filehash + * @property {string|null} [rmrSource] StickerSyncRMRMessage rmrSource + * @property {number|Long|null} [requestTimestamp] StickerSyncRMRMessage requestTimestamp */ /** - * Constructs a new HSMDateTimeComponent. + * Constructs a new StickerSyncRMRMessage. * @memberof proto - * @classdesc Represents a HSMDateTimeComponent. - * @implements IHSMDateTimeComponent + * @classdesc Represents a StickerSyncRMRMessage. + * @implements IStickerSyncRMRMessage * @constructor - * @param {proto.IHSMDateTimeComponent=} [properties] Properties to set + * @param {proto.IStickerSyncRMRMessage=} [properties] Properties to set */ - function HSMDateTimeComponent(properties) { + function StickerSyncRMRMessage(properties) { + this.filehash = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -31682,153 +31903,104 @@ $root.proto = (function() { } /** - * HSMDateTimeComponent dayOfWeek. - * @member {proto.HSMDateTimeComponent.HSMDateTimeComponentDayOfWeekType} dayOfWeek - * @memberof proto.HSMDateTimeComponent - * @instance - */ - HSMDateTimeComponent.prototype.dayOfWeek = 1; - - /** - * HSMDateTimeComponent year. - * @member {number} year - * @memberof proto.HSMDateTimeComponent - * @instance - */ - HSMDateTimeComponent.prototype.year = 0; - - /** - * HSMDateTimeComponent month. - * @member {number} month - * @memberof proto.HSMDateTimeComponent - * @instance - */ - HSMDateTimeComponent.prototype.month = 0; - - /** - * HSMDateTimeComponent dayOfMonth. - * @member {number} dayOfMonth - * @memberof proto.HSMDateTimeComponent - * @instance - */ - HSMDateTimeComponent.prototype.dayOfMonth = 0; - - /** - * HSMDateTimeComponent hour. - * @member {number} hour - * @memberof proto.HSMDateTimeComponent + * StickerSyncRMRMessage filehash. + * @member {Array.} filehash + * @memberof proto.StickerSyncRMRMessage * @instance */ - HSMDateTimeComponent.prototype.hour = 0; + StickerSyncRMRMessage.prototype.filehash = $util.emptyArray; /** - * HSMDateTimeComponent minute. - * @member {number} minute - * @memberof proto.HSMDateTimeComponent + * StickerSyncRMRMessage rmrSource. + * @member {string} rmrSource + * @memberof proto.StickerSyncRMRMessage * @instance */ - HSMDateTimeComponent.prototype.minute = 0; + StickerSyncRMRMessage.prototype.rmrSource = ""; /** - * HSMDateTimeComponent calendar. - * @member {proto.HSMDateTimeComponent.HSMDateTimeComponentCalendarType} calendar - * @memberof proto.HSMDateTimeComponent + * StickerSyncRMRMessage requestTimestamp. + * @member {number|Long} requestTimestamp + * @memberof proto.StickerSyncRMRMessage * @instance */ - HSMDateTimeComponent.prototype.calendar = 1; + StickerSyncRMRMessage.prototype.requestTimestamp = $util.Long ? $util.Long.fromBits(0,0,false) : 0; /** - * Creates a new HSMDateTimeComponent instance using the specified properties. + * Creates a new StickerSyncRMRMessage instance using the specified properties. * @function create - * @memberof proto.HSMDateTimeComponent + * @memberof proto.StickerSyncRMRMessage * @static - * @param {proto.IHSMDateTimeComponent=} [properties] Properties to set - * @returns {proto.HSMDateTimeComponent} HSMDateTimeComponent instance + * @param {proto.IStickerSyncRMRMessage=} [properties] Properties to set + * @returns {proto.StickerSyncRMRMessage} StickerSyncRMRMessage instance */ - HSMDateTimeComponent.create = function create(properties) { - return new HSMDateTimeComponent(properties); + StickerSyncRMRMessage.create = function create(properties) { + return new StickerSyncRMRMessage(properties); }; /** - * Encodes the specified HSMDateTimeComponent message. Does not implicitly {@link proto.HSMDateTimeComponent.verify|verify} messages. + * Encodes the specified StickerSyncRMRMessage message. Does not implicitly {@link proto.StickerSyncRMRMessage.verify|verify} messages. * @function encode - * @memberof proto.HSMDateTimeComponent + * @memberof proto.StickerSyncRMRMessage * @static - * @param {proto.IHSMDateTimeComponent} message HSMDateTimeComponent message or plain object to encode + * @param {proto.IStickerSyncRMRMessage} message StickerSyncRMRMessage message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - HSMDateTimeComponent.encode = function encode(message, writer) { + StickerSyncRMRMessage.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.dayOfWeek != null && Object.hasOwnProperty.call(message, "dayOfWeek")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.dayOfWeek); - if (message.year != null && Object.hasOwnProperty.call(message, "year")) - writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.year); - if (message.month != null && Object.hasOwnProperty.call(message, "month")) - writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.month); - if (message.dayOfMonth != null && Object.hasOwnProperty.call(message, "dayOfMonth")) - writer.uint32(/* id 4, wireType 0 =*/32).uint32(message.dayOfMonth); - if (message.hour != null && Object.hasOwnProperty.call(message, "hour")) - writer.uint32(/* id 5, wireType 0 =*/40).uint32(message.hour); - if (message.minute != null && Object.hasOwnProperty.call(message, "minute")) - writer.uint32(/* id 6, wireType 0 =*/48).uint32(message.minute); - if (message.calendar != null && Object.hasOwnProperty.call(message, "calendar")) - writer.uint32(/* id 7, wireType 0 =*/56).int32(message.calendar); + if (message.filehash != null && message.filehash.length) + for (var i = 0; i < message.filehash.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.filehash[i]); + if (message.rmrSource != null && Object.hasOwnProperty.call(message, "rmrSource")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.rmrSource); + if (message.requestTimestamp != null && Object.hasOwnProperty.call(message, "requestTimestamp")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.requestTimestamp); return writer; }; /** - * Encodes the specified HSMDateTimeComponent message, length delimited. Does not implicitly {@link proto.HSMDateTimeComponent.verify|verify} messages. + * Encodes the specified StickerSyncRMRMessage message, length delimited. Does not implicitly {@link proto.StickerSyncRMRMessage.verify|verify} messages. * @function encodeDelimited - * @memberof proto.HSMDateTimeComponent + * @memberof proto.StickerSyncRMRMessage * @static - * @param {proto.IHSMDateTimeComponent} message HSMDateTimeComponent message or plain object to encode + * @param {proto.IStickerSyncRMRMessage} message StickerSyncRMRMessage message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - HSMDateTimeComponent.encodeDelimited = function encodeDelimited(message, writer) { + StickerSyncRMRMessage.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a HSMDateTimeComponent message from the specified reader or buffer. + * Decodes a StickerSyncRMRMessage message from the specified reader or buffer. * @function decode - * @memberof proto.HSMDateTimeComponent + * @memberof proto.StickerSyncRMRMessage * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {proto.HSMDateTimeComponent} HSMDateTimeComponent + * @returns {proto.StickerSyncRMRMessage} StickerSyncRMRMessage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - HSMDateTimeComponent.decode = function decode(reader, length) { + StickerSyncRMRMessage.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.HSMDateTimeComponent(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.StickerSyncRMRMessage(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.dayOfWeek = reader.int32(); + if (!(message.filehash && message.filehash.length)) + message.filehash = []; + message.filehash.push(reader.string()); break; case 2: - message.year = reader.uint32(); + message.rmrSource = reader.string(); break; case 3: - message.month = reader.uint32(); - break; - case 4: - message.dayOfMonth = reader.uint32(); - break; - case 5: - message.hour = reader.uint32(); - break; - case 6: - message.minute = reader.uint32(); - break; - case 7: - message.calendar = reader.int32(); + message.requestTimestamp = reader.int64(); break; default: reader.skipType(tag & 7); @@ -31839,245 +32011,154 @@ $root.proto = (function() { }; /** - * Decodes a HSMDateTimeComponent message from the specified reader or buffer, length delimited. + * Decodes a StickerSyncRMRMessage message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof proto.HSMDateTimeComponent + * @memberof proto.StickerSyncRMRMessage * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.HSMDateTimeComponent} HSMDateTimeComponent + * @returns {proto.StickerSyncRMRMessage} StickerSyncRMRMessage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - HSMDateTimeComponent.decodeDelimited = function decodeDelimited(reader) { + StickerSyncRMRMessage.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a HSMDateTimeComponent message. + * Verifies a StickerSyncRMRMessage message. * @function verify - * @memberof proto.HSMDateTimeComponent + * @memberof proto.StickerSyncRMRMessage * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - HSMDateTimeComponent.verify = function verify(message) { + StickerSyncRMRMessage.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.dayOfWeek != null && message.hasOwnProperty("dayOfWeek")) - switch (message.dayOfWeek) { - default: - return "dayOfWeek: enum value expected"; - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - break; - } - if (message.year != null && message.hasOwnProperty("year")) - if (!$util.isInteger(message.year)) - return "year: integer expected"; - if (message.month != null && message.hasOwnProperty("month")) - if (!$util.isInteger(message.month)) - return "month: integer expected"; - if (message.dayOfMonth != null && message.hasOwnProperty("dayOfMonth")) - if (!$util.isInteger(message.dayOfMonth)) - return "dayOfMonth: integer expected"; - if (message.hour != null && message.hasOwnProperty("hour")) - if (!$util.isInteger(message.hour)) - return "hour: integer expected"; - if (message.minute != null && message.hasOwnProperty("minute")) - if (!$util.isInteger(message.minute)) - return "minute: integer expected"; - if (message.calendar != null && message.hasOwnProperty("calendar")) - switch (message.calendar) { - default: - return "calendar: enum value expected"; - case 1: - case 2: - break; - } + if (message.filehash != null && message.hasOwnProperty("filehash")) { + if (!Array.isArray(message.filehash)) + return "filehash: array expected"; + for (var i = 0; i < message.filehash.length; ++i) + if (!$util.isString(message.filehash[i])) + return "filehash: string[] expected"; + } + if (message.rmrSource != null && message.hasOwnProperty("rmrSource")) + if (!$util.isString(message.rmrSource)) + return "rmrSource: string expected"; + if (message.requestTimestamp != null && message.hasOwnProperty("requestTimestamp")) + if (!$util.isInteger(message.requestTimestamp) && !(message.requestTimestamp && $util.isInteger(message.requestTimestamp.low) && $util.isInteger(message.requestTimestamp.high))) + return "requestTimestamp: integer|Long expected"; return null; }; /** - * Creates a HSMDateTimeComponent message from a plain object. Also converts values to their respective internal types. + * Creates a StickerSyncRMRMessage message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof proto.HSMDateTimeComponent + * @memberof proto.StickerSyncRMRMessage * @static * @param {Object.} object Plain object - * @returns {proto.HSMDateTimeComponent} HSMDateTimeComponent + * @returns {proto.StickerSyncRMRMessage} StickerSyncRMRMessage */ - HSMDateTimeComponent.fromObject = function fromObject(object) { - if (object instanceof $root.proto.HSMDateTimeComponent) + StickerSyncRMRMessage.fromObject = function fromObject(object) { + if (object instanceof $root.proto.StickerSyncRMRMessage) return object; - var message = new $root.proto.HSMDateTimeComponent(); - switch (object.dayOfWeek) { - case "MONDAY": - case 1: - message.dayOfWeek = 1; - break; - case "TUESDAY": - case 2: - message.dayOfWeek = 2; - break; - case "WEDNESDAY": - case 3: - message.dayOfWeek = 3; - break; - case "THURSDAY": - case 4: - message.dayOfWeek = 4; - break; - case "FRIDAY": - case 5: - message.dayOfWeek = 5; - break; - case "SATURDAY": - case 6: - message.dayOfWeek = 6; - break; - case "SUNDAY": - case 7: - message.dayOfWeek = 7; - break; - } - if (object.year != null) - message.year = object.year >>> 0; - if (object.month != null) - message.month = object.month >>> 0; - if (object.dayOfMonth != null) - message.dayOfMonth = object.dayOfMonth >>> 0; - if (object.hour != null) - message.hour = object.hour >>> 0; - if (object.minute != null) - message.minute = object.minute >>> 0; - switch (object.calendar) { - case "GREGORIAN": - case 1: - message.calendar = 1; - break; - case "SOLAR_HIJRI": - case 2: - message.calendar = 2; - break; + var message = new $root.proto.StickerSyncRMRMessage(); + if (object.filehash) { + if (!Array.isArray(object.filehash)) + throw TypeError(".proto.StickerSyncRMRMessage.filehash: array expected"); + message.filehash = []; + for (var i = 0; i < object.filehash.length; ++i) + message.filehash[i] = String(object.filehash[i]); } + if (object.rmrSource != null) + message.rmrSource = String(object.rmrSource); + if (object.requestTimestamp != null) + if ($util.Long) + (message.requestTimestamp = $util.Long.fromValue(object.requestTimestamp)).unsigned = false; + else if (typeof object.requestTimestamp === "string") + message.requestTimestamp = parseInt(object.requestTimestamp, 10); + else if (typeof object.requestTimestamp === "number") + message.requestTimestamp = object.requestTimestamp; + else if (typeof object.requestTimestamp === "object") + message.requestTimestamp = new $util.LongBits(object.requestTimestamp.low >>> 0, object.requestTimestamp.high >>> 0).toNumber(); return message; }; /** - * Creates a plain object from a HSMDateTimeComponent message. Also converts values to other types if specified. + * Creates a plain object from a StickerSyncRMRMessage message. Also converts values to other types if specified. * @function toObject - * @memberof proto.HSMDateTimeComponent + * @memberof proto.StickerSyncRMRMessage * @static - * @param {proto.HSMDateTimeComponent} message HSMDateTimeComponent + * @param {proto.StickerSyncRMRMessage} message StickerSyncRMRMessage * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - HSMDateTimeComponent.toObject = function toObject(message, options) { + StickerSyncRMRMessage.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.filehash = []; if (options.defaults) { - object.dayOfWeek = options.enums === String ? "MONDAY" : 1; - object.year = 0; - object.month = 0; - object.dayOfMonth = 0; - object.hour = 0; - object.minute = 0; - object.calendar = options.enums === String ? "GREGORIAN" : 1; + object.rmrSource = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.requestTimestamp = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.requestTimestamp = options.longs === String ? "0" : 0; } - if (message.dayOfWeek != null && message.hasOwnProperty("dayOfWeek")) - object.dayOfWeek = options.enums === String ? $root.proto.HSMDateTimeComponent.HSMDateTimeComponentDayOfWeekType[message.dayOfWeek] : message.dayOfWeek; - if (message.year != null && message.hasOwnProperty("year")) - object.year = message.year; - if (message.month != null && message.hasOwnProperty("month")) - object.month = message.month; - if (message.dayOfMonth != null && message.hasOwnProperty("dayOfMonth")) - object.dayOfMonth = message.dayOfMonth; - if (message.hour != null && message.hasOwnProperty("hour")) - object.hour = message.hour; - if (message.minute != null && message.hasOwnProperty("minute")) - object.minute = message.minute; - if (message.calendar != null && message.hasOwnProperty("calendar")) - object.calendar = options.enums === String ? $root.proto.HSMDateTimeComponent.HSMDateTimeComponentCalendarType[message.calendar] : message.calendar; + if (message.filehash && message.filehash.length) { + object.filehash = []; + for (var j = 0; j < message.filehash.length; ++j) + object.filehash[j] = message.filehash[j]; + } + if (message.rmrSource != null && message.hasOwnProperty("rmrSource")) + object.rmrSource = message.rmrSource; + if (message.requestTimestamp != null && message.hasOwnProperty("requestTimestamp")) + if (typeof message.requestTimestamp === "number") + object.requestTimestamp = options.longs === String ? String(message.requestTimestamp) : message.requestTimestamp; + else + object.requestTimestamp = options.longs === String ? $util.Long.prototype.toString.call(message.requestTimestamp) : options.longs === Number ? new $util.LongBits(message.requestTimestamp.low >>> 0, message.requestTimestamp.high >>> 0).toNumber() : message.requestTimestamp; return object; }; /** - * Converts this HSMDateTimeComponent to JSON. + * Converts this StickerSyncRMRMessage to JSON. * @function toJSON - * @memberof proto.HSMDateTimeComponent + * @memberof proto.StickerSyncRMRMessage * @instance * @returns {Object.} JSON object */ - HSMDateTimeComponent.prototype.toJSON = function toJSON() { + StickerSyncRMRMessage.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - /** - * HSMDateTimeComponentDayOfWeekType enum. - * @name proto.HSMDateTimeComponent.HSMDateTimeComponentDayOfWeekType - * @enum {number} - * @property {number} MONDAY=1 MONDAY value - * @property {number} TUESDAY=2 TUESDAY value - * @property {number} WEDNESDAY=3 WEDNESDAY value - * @property {number} THURSDAY=4 THURSDAY value - * @property {number} FRIDAY=5 FRIDAY value - * @property {number} SATURDAY=6 SATURDAY value - * @property {number} SUNDAY=7 SUNDAY value - */ - HSMDateTimeComponent.HSMDateTimeComponentDayOfWeekType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[1] = "MONDAY"] = 1; - values[valuesById[2] = "TUESDAY"] = 2; - values[valuesById[3] = "WEDNESDAY"] = 3; - values[valuesById[4] = "THURSDAY"] = 4; - values[valuesById[5] = "FRIDAY"] = 5; - values[valuesById[6] = "SATURDAY"] = 6; - values[valuesById[7] = "SUNDAY"] = 7; - return values; - })(); - - /** - * HSMDateTimeComponentCalendarType enum. - * @name proto.HSMDateTimeComponent.HSMDateTimeComponentCalendarType - * @enum {number} - * @property {number} GREGORIAN=1 GREGORIAN value - * @property {number} SOLAR_HIJRI=2 SOLAR_HIJRI value - */ - HSMDateTimeComponent.HSMDateTimeComponentCalendarType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[1] = "GREGORIAN"] = 1; - values[valuesById[2] = "SOLAR_HIJRI"] = 2; - return values; - })(); - - return HSMDateTimeComponent; + return StickerSyncRMRMessage; })(); - proto.HSMDateTimeUnixEpoch = (function() { + proto.TemplateButton = (function() { /** - * Properties of a HSMDateTimeUnixEpoch. + * Properties of a TemplateButton. * @memberof proto - * @interface IHSMDateTimeUnixEpoch - * @property {number|Long|null} [timestamp] HSMDateTimeUnixEpoch timestamp + * @interface ITemplateButton + * @property {number|null} [index] TemplateButton index + * @property {proto.IQuickReplyButton|null} [quickReplyButton] TemplateButton quickReplyButton + * @property {proto.IURLButton|null} [urlButton] TemplateButton urlButton + * @property {proto.ICallButton|null} [callButton] TemplateButton callButton */ /** - * Constructs a new HSMDateTimeUnixEpoch. + * Constructs a new TemplateButton. * @memberof proto - * @classdesc Represents a HSMDateTimeUnixEpoch. - * @implements IHSMDateTimeUnixEpoch + * @classdesc Represents a TemplateButton. + * @implements ITemplateButton * @constructor - * @param {proto.IHSMDateTimeUnixEpoch=} [properties] Properties to set + * @param {proto.ITemplateButton=} [properties] Properties to set */ - function HSMDateTimeUnixEpoch(properties) { + function TemplateButton(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -32085,75 +32166,128 @@ $root.proto = (function() { } /** - * HSMDateTimeUnixEpoch timestamp. - * @member {number|Long} timestamp - * @memberof proto.HSMDateTimeUnixEpoch + * TemplateButton index. + * @member {number} index + * @memberof proto.TemplateButton * @instance */ - HSMDateTimeUnixEpoch.prototype.timestamp = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + TemplateButton.prototype.index = 0; /** - * Creates a new HSMDateTimeUnixEpoch instance using the specified properties. + * TemplateButton quickReplyButton. + * @member {proto.IQuickReplyButton|null|undefined} quickReplyButton + * @memberof proto.TemplateButton + * @instance + */ + TemplateButton.prototype.quickReplyButton = null; + + /** + * TemplateButton urlButton. + * @member {proto.IURLButton|null|undefined} urlButton + * @memberof proto.TemplateButton + * @instance + */ + TemplateButton.prototype.urlButton = null; + + /** + * TemplateButton callButton. + * @member {proto.ICallButton|null|undefined} callButton + * @memberof proto.TemplateButton + * @instance + */ + TemplateButton.prototype.callButton = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * TemplateButton button. + * @member {"quickReplyButton"|"urlButton"|"callButton"|undefined} button + * @memberof proto.TemplateButton + * @instance + */ + Object.defineProperty(TemplateButton.prototype, "button", { + get: $util.oneOfGetter($oneOfFields = ["quickReplyButton", "urlButton", "callButton"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TemplateButton instance using the specified properties. * @function create - * @memberof proto.HSMDateTimeUnixEpoch + * @memberof proto.TemplateButton * @static - * @param {proto.IHSMDateTimeUnixEpoch=} [properties] Properties to set - * @returns {proto.HSMDateTimeUnixEpoch} HSMDateTimeUnixEpoch instance + * @param {proto.ITemplateButton=} [properties] Properties to set + * @returns {proto.TemplateButton} TemplateButton instance */ - HSMDateTimeUnixEpoch.create = function create(properties) { - return new HSMDateTimeUnixEpoch(properties); + TemplateButton.create = function create(properties) { + return new TemplateButton(properties); }; /** - * Encodes the specified HSMDateTimeUnixEpoch message. Does not implicitly {@link proto.HSMDateTimeUnixEpoch.verify|verify} messages. + * Encodes the specified TemplateButton message. Does not implicitly {@link proto.TemplateButton.verify|verify} messages. * @function encode - * @memberof proto.HSMDateTimeUnixEpoch + * @memberof proto.TemplateButton * @static - * @param {proto.IHSMDateTimeUnixEpoch} message HSMDateTimeUnixEpoch message or plain object to encode + * @param {proto.ITemplateButton} message TemplateButton message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - HSMDateTimeUnixEpoch.encode = function encode(message, writer) { + TemplateButton.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.timestamp != null && Object.hasOwnProperty.call(message, "timestamp")) - writer.uint32(/* id 1, wireType 0 =*/8).int64(message.timestamp); + if (message.quickReplyButton != null && Object.hasOwnProperty.call(message, "quickReplyButton")) + $root.proto.QuickReplyButton.encode(message.quickReplyButton, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.urlButton != null && Object.hasOwnProperty.call(message, "urlButton")) + $root.proto.URLButton.encode(message.urlButton, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.callButton != null && Object.hasOwnProperty.call(message, "callButton")) + $root.proto.CallButton.encode(message.callButton, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.index != null && Object.hasOwnProperty.call(message, "index")) + writer.uint32(/* id 4, wireType 0 =*/32).uint32(message.index); return writer; }; /** - * Encodes the specified HSMDateTimeUnixEpoch message, length delimited. Does not implicitly {@link proto.HSMDateTimeUnixEpoch.verify|verify} messages. + * Encodes the specified TemplateButton message, length delimited. Does not implicitly {@link proto.TemplateButton.verify|verify} messages. * @function encodeDelimited - * @memberof proto.HSMDateTimeUnixEpoch + * @memberof proto.TemplateButton * @static - * @param {proto.IHSMDateTimeUnixEpoch} message HSMDateTimeUnixEpoch message or plain object to encode + * @param {proto.ITemplateButton} message TemplateButton message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - HSMDateTimeUnixEpoch.encodeDelimited = function encodeDelimited(message, writer) { + TemplateButton.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a HSMDateTimeUnixEpoch message from the specified reader or buffer. + * Decodes a TemplateButton message from the specified reader or buffer. * @function decode - * @memberof proto.HSMDateTimeUnixEpoch + * @memberof proto.TemplateButton * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {proto.HSMDateTimeUnixEpoch} HSMDateTimeUnixEpoch + * @returns {proto.TemplateButton} TemplateButton * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - HSMDateTimeUnixEpoch.decode = function decode(reader, length) { + TemplateButton.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.HSMDateTimeUnixEpoch(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.TemplateButton(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { + case 4: + message.index = reader.uint32(); + break; case 1: - message.timestamp = reader.int64(); + message.quickReplyButton = $root.proto.QuickReplyButton.decode(reader, reader.uint32()); + break; + case 2: + message.urlButton = $root.proto.URLButton.decode(reader, reader.uint32()); + break; + case 3: + message.callButton = $root.proto.CallButton.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -32164,122 +32298,169 @@ $root.proto = (function() { }; /** - * Decodes a HSMDateTimeUnixEpoch message from the specified reader or buffer, length delimited. + * Decodes a TemplateButton message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof proto.HSMDateTimeUnixEpoch + * @memberof proto.TemplateButton * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.HSMDateTimeUnixEpoch} HSMDateTimeUnixEpoch + * @returns {proto.TemplateButton} TemplateButton * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - HSMDateTimeUnixEpoch.decodeDelimited = function decodeDelimited(reader) { + TemplateButton.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a HSMDateTimeUnixEpoch message. + * Verifies a TemplateButton message. * @function verify - * @memberof proto.HSMDateTimeUnixEpoch + * @memberof proto.TemplateButton * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - HSMDateTimeUnixEpoch.verify = function verify(message) { + TemplateButton.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.timestamp != null && message.hasOwnProperty("timestamp")) - if (!$util.isInteger(message.timestamp) && !(message.timestamp && $util.isInteger(message.timestamp.low) && $util.isInteger(message.timestamp.high))) - return "timestamp: integer|Long expected"; + var properties = {}; + if (message.index != null && message.hasOwnProperty("index")) + if (!$util.isInteger(message.index)) + return "index: integer expected"; + if (message.quickReplyButton != null && message.hasOwnProperty("quickReplyButton")) { + properties.button = 1; + { + var error = $root.proto.QuickReplyButton.verify(message.quickReplyButton); + if (error) + return "quickReplyButton." + error; + } + } + if (message.urlButton != null && message.hasOwnProperty("urlButton")) { + if (properties.button === 1) + return "button: multiple values"; + properties.button = 1; + { + var error = $root.proto.URLButton.verify(message.urlButton); + if (error) + return "urlButton." + error; + } + } + if (message.callButton != null && message.hasOwnProperty("callButton")) { + if (properties.button === 1) + return "button: multiple values"; + properties.button = 1; + { + var error = $root.proto.CallButton.verify(message.callButton); + if (error) + return "callButton." + error; + } + } return null; }; /** - * Creates a HSMDateTimeUnixEpoch message from a plain object. Also converts values to their respective internal types. + * Creates a TemplateButton message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof proto.HSMDateTimeUnixEpoch + * @memberof proto.TemplateButton * @static * @param {Object.} object Plain object - * @returns {proto.HSMDateTimeUnixEpoch} HSMDateTimeUnixEpoch + * @returns {proto.TemplateButton} TemplateButton */ - HSMDateTimeUnixEpoch.fromObject = function fromObject(object) { - if (object instanceof $root.proto.HSMDateTimeUnixEpoch) + TemplateButton.fromObject = function fromObject(object) { + if (object instanceof $root.proto.TemplateButton) return object; - var message = new $root.proto.HSMDateTimeUnixEpoch(); - if (object.timestamp != null) - if ($util.Long) - (message.timestamp = $util.Long.fromValue(object.timestamp)).unsigned = false; - else if (typeof object.timestamp === "string") - message.timestamp = parseInt(object.timestamp, 10); - else if (typeof object.timestamp === "number") - message.timestamp = object.timestamp; - else if (typeof object.timestamp === "object") - message.timestamp = new $util.LongBits(object.timestamp.low >>> 0, object.timestamp.high >>> 0).toNumber(); + var message = new $root.proto.TemplateButton(); + if (object.index != null) + message.index = object.index >>> 0; + if (object.quickReplyButton != null) { + if (typeof object.quickReplyButton !== "object") + throw TypeError(".proto.TemplateButton.quickReplyButton: object expected"); + message.quickReplyButton = $root.proto.QuickReplyButton.fromObject(object.quickReplyButton); + } + if (object.urlButton != null) { + if (typeof object.urlButton !== "object") + throw TypeError(".proto.TemplateButton.urlButton: object expected"); + message.urlButton = $root.proto.URLButton.fromObject(object.urlButton); + } + if (object.callButton != null) { + if (typeof object.callButton !== "object") + throw TypeError(".proto.TemplateButton.callButton: object expected"); + message.callButton = $root.proto.CallButton.fromObject(object.callButton); + } return message; }; /** - * Creates a plain object from a HSMDateTimeUnixEpoch message. Also converts values to other types if specified. + * Creates a plain object from a TemplateButton message. Also converts values to other types if specified. * @function toObject - * @memberof proto.HSMDateTimeUnixEpoch + * @memberof proto.TemplateButton * @static - * @param {proto.HSMDateTimeUnixEpoch} message HSMDateTimeUnixEpoch + * @param {proto.TemplateButton} message TemplateButton * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - HSMDateTimeUnixEpoch.toObject = function toObject(message, options) { + TemplateButton.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.timestamp = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.timestamp = options.longs === String ? "0" : 0; - if (message.timestamp != null && message.hasOwnProperty("timestamp")) - if (typeof message.timestamp === "number") - object.timestamp = options.longs === String ? String(message.timestamp) : message.timestamp; - else - object.timestamp = options.longs === String ? $util.Long.prototype.toString.call(message.timestamp) : options.longs === Number ? new $util.LongBits(message.timestamp.low >>> 0, message.timestamp.high >>> 0).toNumber() : message.timestamp; + object.index = 0; + if (message.quickReplyButton != null && message.hasOwnProperty("quickReplyButton")) { + object.quickReplyButton = $root.proto.QuickReplyButton.toObject(message.quickReplyButton, options); + if (options.oneofs) + object.button = "quickReplyButton"; + } + if (message.urlButton != null && message.hasOwnProperty("urlButton")) { + object.urlButton = $root.proto.URLButton.toObject(message.urlButton, options); + if (options.oneofs) + object.button = "urlButton"; + } + if (message.callButton != null && message.hasOwnProperty("callButton")) { + object.callButton = $root.proto.CallButton.toObject(message.callButton, options); + if (options.oneofs) + object.button = "callButton"; + } + if (message.index != null && message.hasOwnProperty("index")) + object.index = message.index; return object; }; /** - * Converts this HSMDateTimeUnixEpoch to JSON. + * Converts this TemplateButton to JSON. * @function toJSON - * @memberof proto.HSMDateTimeUnixEpoch + * @memberof proto.TemplateButton * @instance * @returns {Object.} JSON object */ - HSMDateTimeUnixEpoch.prototype.toJSON = function toJSON() { + TemplateButton.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return HSMDateTimeUnixEpoch; + return TemplateButton; })(); - proto.HSMDateTime = (function() { + proto.TemplateButtonReplyMessage = (function() { /** - * Properties of a HSMDateTime. + * Properties of a TemplateButtonReplyMessage. * @memberof proto - * @interface IHSMDateTime - * @property {proto.IHSMDateTimeComponent|null} [component] HSMDateTime component - * @property {proto.IHSMDateTimeUnixEpoch|null} [unixEpoch] HSMDateTime unixEpoch + * @interface ITemplateButtonReplyMessage + * @property {string|null} [selectedId] TemplateButtonReplyMessage selectedId + * @property {string|null} [selectedDisplayText] TemplateButtonReplyMessage selectedDisplayText + * @property {proto.IContextInfo|null} [contextInfo] TemplateButtonReplyMessage contextInfo + * @property {number|null} [selectedIndex] TemplateButtonReplyMessage selectedIndex */ /** - * Constructs a new HSMDateTime. + * Constructs a new TemplateButtonReplyMessage. * @memberof proto - * @classdesc Represents a HSMDateTime. - * @implements IHSMDateTime + * @classdesc Represents a TemplateButtonReplyMessage. + * @implements ITemplateButtonReplyMessage * @constructor - * @param {proto.IHSMDateTime=} [properties] Properties to set + * @param {proto.ITemplateButtonReplyMessage=} [properties] Properties to set */ - function HSMDateTime(properties) { + function TemplateButtonReplyMessage(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -32287,102 +32468,114 @@ $root.proto = (function() { } /** - * HSMDateTime component. - * @member {proto.IHSMDateTimeComponent|null|undefined} component - * @memberof proto.HSMDateTime + * TemplateButtonReplyMessage selectedId. + * @member {string} selectedId + * @memberof proto.TemplateButtonReplyMessage * @instance */ - HSMDateTime.prototype.component = null; + TemplateButtonReplyMessage.prototype.selectedId = ""; /** - * HSMDateTime unixEpoch. - * @member {proto.IHSMDateTimeUnixEpoch|null|undefined} unixEpoch - * @memberof proto.HSMDateTime + * TemplateButtonReplyMessage selectedDisplayText. + * @member {string} selectedDisplayText + * @memberof proto.TemplateButtonReplyMessage * @instance */ - HSMDateTime.prototype.unixEpoch = null; + TemplateButtonReplyMessage.prototype.selectedDisplayText = ""; - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + /** + * TemplateButtonReplyMessage contextInfo. + * @member {proto.IContextInfo|null|undefined} contextInfo + * @memberof proto.TemplateButtonReplyMessage + * @instance + */ + TemplateButtonReplyMessage.prototype.contextInfo = null; /** - * HSMDateTime datetimeOneof. - * @member {"component"|"unixEpoch"|undefined} datetimeOneof - * @memberof proto.HSMDateTime + * TemplateButtonReplyMessage selectedIndex. + * @member {number} selectedIndex + * @memberof proto.TemplateButtonReplyMessage * @instance */ - Object.defineProperty(HSMDateTime.prototype, "datetimeOneof", { - get: $util.oneOfGetter($oneOfFields = ["component", "unixEpoch"]), - set: $util.oneOfSetter($oneOfFields) - }); + TemplateButtonReplyMessage.prototype.selectedIndex = 0; /** - * Creates a new HSMDateTime instance using the specified properties. + * Creates a new TemplateButtonReplyMessage instance using the specified properties. * @function create - * @memberof proto.HSMDateTime + * @memberof proto.TemplateButtonReplyMessage * @static - * @param {proto.IHSMDateTime=} [properties] Properties to set - * @returns {proto.HSMDateTime} HSMDateTime instance + * @param {proto.ITemplateButtonReplyMessage=} [properties] Properties to set + * @returns {proto.TemplateButtonReplyMessage} TemplateButtonReplyMessage instance */ - HSMDateTime.create = function create(properties) { - return new HSMDateTime(properties); + TemplateButtonReplyMessage.create = function create(properties) { + return new TemplateButtonReplyMessage(properties); }; /** - * Encodes the specified HSMDateTime message. Does not implicitly {@link proto.HSMDateTime.verify|verify} messages. + * Encodes the specified TemplateButtonReplyMessage message. Does not implicitly {@link proto.TemplateButtonReplyMessage.verify|verify} messages. * @function encode - * @memberof proto.HSMDateTime + * @memberof proto.TemplateButtonReplyMessage * @static - * @param {proto.IHSMDateTime} message HSMDateTime message or plain object to encode + * @param {proto.ITemplateButtonReplyMessage} message TemplateButtonReplyMessage message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - HSMDateTime.encode = function encode(message, writer) { + TemplateButtonReplyMessage.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.component != null && Object.hasOwnProperty.call(message, "component")) - $root.proto.HSMDateTimeComponent.encode(message.component, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.unixEpoch != null && Object.hasOwnProperty.call(message, "unixEpoch")) - $root.proto.HSMDateTimeUnixEpoch.encode(message.unixEpoch, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.selectedId != null && Object.hasOwnProperty.call(message, "selectedId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.selectedId); + if (message.selectedDisplayText != null && Object.hasOwnProperty.call(message, "selectedDisplayText")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.selectedDisplayText); + if (message.contextInfo != null && Object.hasOwnProperty.call(message, "contextInfo")) + $root.proto.ContextInfo.encode(message.contextInfo, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.selectedIndex != null && Object.hasOwnProperty.call(message, "selectedIndex")) + writer.uint32(/* id 4, wireType 0 =*/32).uint32(message.selectedIndex); return writer; }; /** - * Encodes the specified HSMDateTime message, length delimited. Does not implicitly {@link proto.HSMDateTime.verify|verify} messages. + * Encodes the specified TemplateButtonReplyMessage message, length delimited. Does not implicitly {@link proto.TemplateButtonReplyMessage.verify|verify} messages. * @function encodeDelimited - * @memberof proto.HSMDateTime + * @memberof proto.TemplateButtonReplyMessage * @static - * @param {proto.IHSMDateTime} message HSMDateTime message or plain object to encode + * @param {proto.ITemplateButtonReplyMessage} message TemplateButtonReplyMessage message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - HSMDateTime.encodeDelimited = function encodeDelimited(message, writer) { + TemplateButtonReplyMessage.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a HSMDateTime message from the specified reader or buffer. + * Decodes a TemplateButtonReplyMessage message from the specified reader or buffer. * @function decode - * @memberof proto.HSMDateTime + * @memberof proto.TemplateButtonReplyMessage * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {proto.HSMDateTime} HSMDateTime + * @returns {proto.TemplateButtonReplyMessage} TemplateButtonReplyMessage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - HSMDateTime.decode = function decode(reader, length) { + TemplateButtonReplyMessage.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.HSMDateTime(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.TemplateButtonReplyMessage(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.component = $root.proto.HSMDateTimeComponent.decode(reader, reader.uint32()); + message.selectedId = reader.string(); break; case 2: - message.unixEpoch = $root.proto.HSMDateTimeUnixEpoch.decode(reader, reader.uint32()); + message.selectedDisplayText = reader.string(); + break; + case 3: + message.contextInfo = $root.proto.ContextInfo.decode(reader, reader.uint32()); + break; + case 4: + message.selectedIndex = reader.uint32(); break; default: reader.skipType(tag & 7); @@ -32393,139 +32586,140 @@ $root.proto = (function() { }; /** - * Decodes a HSMDateTime message from the specified reader or buffer, length delimited. + * Decodes a TemplateButtonReplyMessage message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof proto.HSMDateTime + * @memberof proto.TemplateButtonReplyMessage * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.HSMDateTime} HSMDateTime + * @returns {proto.TemplateButtonReplyMessage} TemplateButtonReplyMessage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - HSMDateTime.decodeDelimited = function decodeDelimited(reader) { + TemplateButtonReplyMessage.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a HSMDateTime message. + * Verifies a TemplateButtonReplyMessage message. * @function verify - * @memberof proto.HSMDateTime + * @memberof proto.TemplateButtonReplyMessage * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - HSMDateTime.verify = function verify(message) { + TemplateButtonReplyMessage.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - var properties = {}; - if (message.component != null && message.hasOwnProperty("component")) { - properties.datetimeOneof = 1; - { - var error = $root.proto.HSMDateTimeComponent.verify(message.component); - if (error) - return "component." + error; - } - } - if (message.unixEpoch != null && message.hasOwnProperty("unixEpoch")) { - if (properties.datetimeOneof === 1) - return "datetimeOneof: multiple values"; - properties.datetimeOneof = 1; - { - var error = $root.proto.HSMDateTimeUnixEpoch.verify(message.unixEpoch); - if (error) - return "unixEpoch." + error; - } + if (message.selectedId != null && message.hasOwnProperty("selectedId")) + if (!$util.isString(message.selectedId)) + return "selectedId: string expected"; + if (message.selectedDisplayText != null && message.hasOwnProperty("selectedDisplayText")) + if (!$util.isString(message.selectedDisplayText)) + return "selectedDisplayText: string expected"; + if (message.contextInfo != null && message.hasOwnProperty("contextInfo")) { + var error = $root.proto.ContextInfo.verify(message.contextInfo); + if (error) + return "contextInfo." + error; } + if (message.selectedIndex != null && message.hasOwnProperty("selectedIndex")) + if (!$util.isInteger(message.selectedIndex)) + return "selectedIndex: integer expected"; return null; }; /** - * Creates a HSMDateTime message from a plain object. Also converts values to their respective internal types. + * Creates a TemplateButtonReplyMessage message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof proto.HSMDateTime + * @memberof proto.TemplateButtonReplyMessage * @static * @param {Object.} object Plain object - * @returns {proto.HSMDateTime} HSMDateTime + * @returns {proto.TemplateButtonReplyMessage} TemplateButtonReplyMessage */ - HSMDateTime.fromObject = function fromObject(object) { - if (object instanceof $root.proto.HSMDateTime) + TemplateButtonReplyMessage.fromObject = function fromObject(object) { + if (object instanceof $root.proto.TemplateButtonReplyMessage) return object; - var message = new $root.proto.HSMDateTime(); - if (object.component != null) { - if (typeof object.component !== "object") - throw TypeError(".proto.HSMDateTime.component: object expected"); - message.component = $root.proto.HSMDateTimeComponent.fromObject(object.component); - } - if (object.unixEpoch != null) { - if (typeof object.unixEpoch !== "object") - throw TypeError(".proto.HSMDateTime.unixEpoch: object expected"); - message.unixEpoch = $root.proto.HSMDateTimeUnixEpoch.fromObject(object.unixEpoch); + var message = new $root.proto.TemplateButtonReplyMessage(); + if (object.selectedId != null) + message.selectedId = String(object.selectedId); + if (object.selectedDisplayText != null) + message.selectedDisplayText = String(object.selectedDisplayText); + if (object.contextInfo != null) { + if (typeof object.contextInfo !== "object") + throw TypeError(".proto.TemplateButtonReplyMessage.contextInfo: object expected"); + message.contextInfo = $root.proto.ContextInfo.fromObject(object.contextInfo); } + if (object.selectedIndex != null) + message.selectedIndex = object.selectedIndex >>> 0; return message; }; /** - * Creates a plain object from a HSMDateTime message. Also converts values to other types if specified. + * Creates a plain object from a TemplateButtonReplyMessage message. Also converts values to other types if specified. * @function toObject - * @memberof proto.HSMDateTime + * @memberof proto.TemplateButtonReplyMessage * @static - * @param {proto.HSMDateTime} message HSMDateTime + * @param {proto.TemplateButtonReplyMessage} message TemplateButtonReplyMessage * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - HSMDateTime.toObject = function toObject(message, options) { + TemplateButtonReplyMessage.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (message.component != null && message.hasOwnProperty("component")) { - object.component = $root.proto.HSMDateTimeComponent.toObject(message.component, options); - if (options.oneofs) - object.datetimeOneof = "component"; - } - if (message.unixEpoch != null && message.hasOwnProperty("unixEpoch")) { - object.unixEpoch = $root.proto.HSMDateTimeUnixEpoch.toObject(message.unixEpoch, options); - if (options.oneofs) - object.datetimeOneof = "unixEpoch"; + if (options.defaults) { + object.selectedId = ""; + object.selectedDisplayText = ""; + object.contextInfo = null; + object.selectedIndex = 0; } + if (message.selectedId != null && message.hasOwnProperty("selectedId")) + object.selectedId = message.selectedId; + if (message.selectedDisplayText != null && message.hasOwnProperty("selectedDisplayText")) + object.selectedDisplayText = message.selectedDisplayText; + if (message.contextInfo != null && message.hasOwnProperty("contextInfo")) + object.contextInfo = $root.proto.ContextInfo.toObject(message.contextInfo, options); + if (message.selectedIndex != null && message.hasOwnProperty("selectedIndex")) + object.selectedIndex = message.selectedIndex; return object; }; /** - * Converts this HSMDateTime to JSON. + * Converts this TemplateButtonReplyMessage to JSON. * @function toJSON - * @memberof proto.HSMDateTime + * @memberof proto.TemplateButtonReplyMessage * @instance * @returns {Object.} JSON object */ - HSMDateTime.prototype.toJSON = function toJSON() { + TemplateButtonReplyMessage.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return HSMDateTime; + return TemplateButtonReplyMessage; })(); - proto.HSMLocalizableParameter = (function() { + proto.TemplateMessage = (function() { /** - * Properties of a HSMLocalizableParameter. + * Properties of a TemplateMessage. * @memberof proto - * @interface IHSMLocalizableParameter - * @property {string|null} ["default"] HSMLocalizableParameter default - * @property {proto.IHSMCurrency|null} [currency] HSMLocalizableParameter currency - * @property {proto.IHSMDateTime|null} [dateTime] HSMLocalizableParameter dateTime + * @interface ITemplateMessage + * @property {proto.IContextInfo|null} [contextInfo] TemplateMessage contextInfo + * @property {proto.IHydratedFourRowTemplate|null} [hydratedTemplate] TemplateMessage hydratedTemplate + * @property {proto.IFourRowTemplate|null} [fourRowTemplate] TemplateMessage fourRowTemplate + * @property {proto.IHydratedFourRowTemplate|null} [hydratedFourRowTemplate] TemplateMessage hydratedFourRowTemplate */ /** - * Constructs a new HSMLocalizableParameter. + * Constructs a new TemplateMessage. * @memberof proto - * @classdesc Represents a HSMLocalizableParameter. - * @implements IHSMLocalizableParameter + * @classdesc Represents a TemplateMessage. + * @implements ITemplateMessage * @constructor - * @param {proto.IHSMLocalizableParameter=} [properties] Properties to set + * @param {proto.ITemplateMessage=} [properties] Properties to set */ - function HSMLocalizableParameter(properties) { + function TemplateMessage(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -32533,115 +32727,128 @@ $root.proto = (function() { } /** - * HSMLocalizableParameter default. - * @member {string} default - * @memberof proto.HSMLocalizableParameter + * TemplateMessage contextInfo. + * @member {proto.IContextInfo|null|undefined} contextInfo + * @memberof proto.TemplateMessage * @instance */ - HSMLocalizableParameter.prototype["default"] = ""; + TemplateMessage.prototype.contextInfo = null; /** - * HSMLocalizableParameter currency. - * @member {proto.IHSMCurrency|null|undefined} currency - * @memberof proto.HSMLocalizableParameter + * TemplateMessage hydratedTemplate. + * @member {proto.IHydratedFourRowTemplate|null|undefined} hydratedTemplate + * @memberof proto.TemplateMessage * @instance */ - HSMLocalizableParameter.prototype.currency = null; + TemplateMessage.prototype.hydratedTemplate = null; /** - * HSMLocalizableParameter dateTime. - * @member {proto.IHSMDateTime|null|undefined} dateTime - * @memberof proto.HSMLocalizableParameter + * TemplateMessage fourRowTemplate. + * @member {proto.IFourRowTemplate|null|undefined} fourRowTemplate + * @memberof proto.TemplateMessage * @instance */ - HSMLocalizableParameter.prototype.dateTime = null; + TemplateMessage.prototype.fourRowTemplate = null; + + /** + * TemplateMessage hydratedFourRowTemplate. + * @member {proto.IHydratedFourRowTemplate|null|undefined} hydratedFourRowTemplate + * @memberof proto.TemplateMessage + * @instance + */ + TemplateMessage.prototype.hydratedFourRowTemplate = null; // OneOf field names bound to virtual getters and setters var $oneOfFields; /** - * HSMLocalizableParameter paramOneof. - * @member {"currency"|"dateTime"|undefined} paramOneof - * @memberof proto.HSMLocalizableParameter + * TemplateMessage format. + * @member {"fourRowTemplate"|"hydratedFourRowTemplate"|undefined} format + * @memberof proto.TemplateMessage * @instance */ - Object.defineProperty(HSMLocalizableParameter.prototype, "paramOneof", { - get: $util.oneOfGetter($oneOfFields = ["currency", "dateTime"]), + Object.defineProperty(TemplateMessage.prototype, "format", { + get: $util.oneOfGetter($oneOfFields = ["fourRowTemplate", "hydratedFourRowTemplate"]), set: $util.oneOfSetter($oneOfFields) }); /** - * Creates a new HSMLocalizableParameter instance using the specified properties. + * Creates a new TemplateMessage instance using the specified properties. * @function create - * @memberof proto.HSMLocalizableParameter + * @memberof proto.TemplateMessage * @static - * @param {proto.IHSMLocalizableParameter=} [properties] Properties to set - * @returns {proto.HSMLocalizableParameter} HSMLocalizableParameter instance + * @param {proto.ITemplateMessage=} [properties] Properties to set + * @returns {proto.TemplateMessage} TemplateMessage instance */ - HSMLocalizableParameter.create = function create(properties) { - return new HSMLocalizableParameter(properties); + TemplateMessage.create = function create(properties) { + return new TemplateMessage(properties); }; /** - * Encodes the specified HSMLocalizableParameter message. Does not implicitly {@link proto.HSMLocalizableParameter.verify|verify} messages. + * Encodes the specified TemplateMessage message. Does not implicitly {@link proto.TemplateMessage.verify|verify} messages. * @function encode - * @memberof proto.HSMLocalizableParameter + * @memberof proto.TemplateMessage * @static - * @param {proto.IHSMLocalizableParameter} message HSMLocalizableParameter message or plain object to encode + * @param {proto.ITemplateMessage} message TemplateMessage message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - HSMLocalizableParameter.encode = function encode(message, writer) { + TemplateMessage.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message["default"] != null && Object.hasOwnProperty.call(message, "default")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message["default"]); - if (message.currency != null && Object.hasOwnProperty.call(message, "currency")) - $root.proto.HSMCurrency.encode(message.currency, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.dateTime != null && Object.hasOwnProperty.call(message, "dateTime")) - $root.proto.HSMDateTime.encode(message.dateTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.fourRowTemplate != null && Object.hasOwnProperty.call(message, "fourRowTemplate")) + $root.proto.FourRowTemplate.encode(message.fourRowTemplate, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.hydratedFourRowTemplate != null && Object.hasOwnProperty.call(message, "hydratedFourRowTemplate")) + $root.proto.HydratedFourRowTemplate.encode(message.hydratedFourRowTemplate, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.contextInfo != null && Object.hasOwnProperty.call(message, "contextInfo")) + $root.proto.ContextInfo.encode(message.contextInfo, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.hydratedTemplate != null && Object.hasOwnProperty.call(message, "hydratedTemplate")) + $root.proto.HydratedFourRowTemplate.encode(message.hydratedTemplate, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); return writer; }; /** - * Encodes the specified HSMLocalizableParameter message, length delimited. Does not implicitly {@link proto.HSMLocalizableParameter.verify|verify} messages. + * Encodes the specified TemplateMessage message, length delimited. Does not implicitly {@link proto.TemplateMessage.verify|verify} messages. * @function encodeDelimited - * @memberof proto.HSMLocalizableParameter + * @memberof proto.TemplateMessage * @static - * @param {proto.IHSMLocalizableParameter} message HSMLocalizableParameter message or plain object to encode + * @param {proto.ITemplateMessage} message TemplateMessage message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - HSMLocalizableParameter.encodeDelimited = function encodeDelimited(message, writer) { + TemplateMessage.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a HSMLocalizableParameter message from the specified reader or buffer. + * Decodes a TemplateMessage message from the specified reader or buffer. * @function decode - * @memberof proto.HSMLocalizableParameter + * @memberof proto.TemplateMessage * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {proto.HSMLocalizableParameter} HSMLocalizableParameter + * @returns {proto.TemplateMessage} TemplateMessage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - HSMLocalizableParameter.decode = function decode(reader, length) { + TemplateMessage.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.HSMLocalizableParameter(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.TemplateMessage(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { + case 3: + message.contextInfo = $root.proto.ContextInfo.decode(reader, reader.uint32()); + break; + case 4: + message.hydratedTemplate = $root.proto.HydratedFourRowTemplate.decode(reader, reader.uint32()); + break; case 1: - message["default"] = reader.string(); + message.fourRowTemplate = $root.proto.FourRowTemplate.decode(reader, reader.uint32()); break; case 2: - message.currency = $root.proto.HSMCurrency.decode(reader, reader.uint32()); - break; - case 3: - message.dateTime = $root.proto.HSMDateTime.decode(reader, reader.uint32()); + message.hydratedFourRowTemplate = $root.proto.HydratedFourRowTemplate.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -32652,156 +32859,166 @@ $root.proto = (function() { }; /** - * Decodes a HSMLocalizableParameter message from the specified reader or buffer, length delimited. + * Decodes a TemplateMessage message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof proto.HSMLocalizableParameter + * @memberof proto.TemplateMessage * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.HSMLocalizableParameter} HSMLocalizableParameter + * @returns {proto.TemplateMessage} TemplateMessage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - HSMLocalizableParameter.decodeDelimited = function decodeDelimited(reader) { + TemplateMessage.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a HSMLocalizableParameter message. + * Verifies a TemplateMessage message. * @function verify - * @memberof proto.HSMLocalizableParameter + * @memberof proto.TemplateMessage * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - HSMLocalizableParameter.verify = function verify(message) { + TemplateMessage.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; var properties = {}; - if (message["default"] != null && message.hasOwnProperty("default")) - if (!$util.isString(message["default"])) - return "default: string expected"; - if (message.currency != null && message.hasOwnProperty("currency")) { - properties.paramOneof = 1; + if (message.contextInfo != null && message.hasOwnProperty("contextInfo")) { + var error = $root.proto.ContextInfo.verify(message.contextInfo); + if (error) + return "contextInfo." + error; + } + if (message.hydratedTemplate != null && message.hasOwnProperty("hydratedTemplate")) { + var error = $root.proto.HydratedFourRowTemplate.verify(message.hydratedTemplate); + if (error) + return "hydratedTemplate." + error; + } + if (message.fourRowTemplate != null && message.hasOwnProperty("fourRowTemplate")) { + properties.format = 1; { - var error = $root.proto.HSMCurrency.verify(message.currency); + var error = $root.proto.FourRowTemplate.verify(message.fourRowTemplate); if (error) - return "currency." + error; + return "fourRowTemplate." + error; } } - if (message.dateTime != null && message.hasOwnProperty("dateTime")) { - if (properties.paramOneof === 1) - return "paramOneof: multiple values"; - properties.paramOneof = 1; + if (message.hydratedFourRowTemplate != null && message.hasOwnProperty("hydratedFourRowTemplate")) { + if (properties.format === 1) + return "format: multiple values"; + properties.format = 1; { - var error = $root.proto.HSMDateTime.verify(message.dateTime); + var error = $root.proto.HydratedFourRowTemplate.verify(message.hydratedFourRowTemplate); if (error) - return "dateTime." + error; + return "hydratedFourRowTemplate." + error; } } return null; }; /** - * Creates a HSMLocalizableParameter message from a plain object. Also converts values to their respective internal types. + * Creates a TemplateMessage message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof proto.HSMLocalizableParameter + * @memberof proto.TemplateMessage * @static * @param {Object.} object Plain object - * @returns {proto.HSMLocalizableParameter} HSMLocalizableParameter + * @returns {proto.TemplateMessage} TemplateMessage */ - HSMLocalizableParameter.fromObject = function fromObject(object) { - if (object instanceof $root.proto.HSMLocalizableParameter) + TemplateMessage.fromObject = function fromObject(object) { + if (object instanceof $root.proto.TemplateMessage) return object; - var message = new $root.proto.HSMLocalizableParameter(); - if (object["default"] != null) - message["default"] = String(object["default"]); - if (object.currency != null) { - if (typeof object.currency !== "object") - throw TypeError(".proto.HSMLocalizableParameter.currency: object expected"); - message.currency = $root.proto.HSMCurrency.fromObject(object.currency); + var message = new $root.proto.TemplateMessage(); + if (object.contextInfo != null) { + if (typeof object.contextInfo !== "object") + throw TypeError(".proto.TemplateMessage.contextInfo: object expected"); + message.contextInfo = $root.proto.ContextInfo.fromObject(object.contextInfo); } - if (object.dateTime != null) { - if (typeof object.dateTime !== "object") - throw TypeError(".proto.HSMLocalizableParameter.dateTime: object expected"); - message.dateTime = $root.proto.HSMDateTime.fromObject(object.dateTime); + if (object.hydratedTemplate != null) { + if (typeof object.hydratedTemplate !== "object") + throw TypeError(".proto.TemplateMessage.hydratedTemplate: object expected"); + message.hydratedTemplate = $root.proto.HydratedFourRowTemplate.fromObject(object.hydratedTemplate); + } + if (object.fourRowTemplate != null) { + if (typeof object.fourRowTemplate !== "object") + throw TypeError(".proto.TemplateMessage.fourRowTemplate: object expected"); + message.fourRowTemplate = $root.proto.FourRowTemplate.fromObject(object.fourRowTemplate); + } + if (object.hydratedFourRowTemplate != null) { + if (typeof object.hydratedFourRowTemplate !== "object") + throw TypeError(".proto.TemplateMessage.hydratedFourRowTemplate: object expected"); + message.hydratedFourRowTemplate = $root.proto.HydratedFourRowTemplate.fromObject(object.hydratedFourRowTemplate); } return message; }; /** - * Creates a plain object from a HSMLocalizableParameter message. Also converts values to other types if specified. + * Creates a plain object from a TemplateMessage message. Also converts values to other types if specified. * @function toObject - * @memberof proto.HSMLocalizableParameter + * @memberof proto.TemplateMessage * @static - * @param {proto.HSMLocalizableParameter} message HSMLocalizableParameter + * @param {proto.TemplateMessage} message TemplateMessage * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - HSMLocalizableParameter.toObject = function toObject(message, options) { + TemplateMessage.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) - object["default"] = ""; - if (message["default"] != null && message.hasOwnProperty("default")) - object["default"] = message["default"]; - if (message.currency != null && message.hasOwnProperty("currency")) { - object.currency = $root.proto.HSMCurrency.toObject(message.currency, options); + if (options.defaults) { + object.contextInfo = null; + object.hydratedTemplate = null; + } + if (message.fourRowTemplate != null && message.hasOwnProperty("fourRowTemplate")) { + object.fourRowTemplate = $root.proto.FourRowTemplate.toObject(message.fourRowTemplate, options); if (options.oneofs) - object.paramOneof = "currency"; + object.format = "fourRowTemplate"; } - if (message.dateTime != null && message.hasOwnProperty("dateTime")) { - object.dateTime = $root.proto.HSMDateTime.toObject(message.dateTime, options); + if (message.hydratedFourRowTemplate != null && message.hasOwnProperty("hydratedFourRowTemplate")) { + object.hydratedFourRowTemplate = $root.proto.HydratedFourRowTemplate.toObject(message.hydratedFourRowTemplate, options); if (options.oneofs) - object.paramOneof = "dateTime"; + object.format = "hydratedFourRowTemplate"; } + if (message.contextInfo != null && message.hasOwnProperty("contextInfo")) + object.contextInfo = $root.proto.ContextInfo.toObject(message.contextInfo, options); + if (message.hydratedTemplate != null && message.hasOwnProperty("hydratedTemplate")) + object.hydratedTemplate = $root.proto.HydratedFourRowTemplate.toObject(message.hydratedTemplate, options); return object; }; /** - * Converts this HSMLocalizableParameter to JSON. + * Converts this TemplateMessage to JSON. * @function toJSON - * @memberof proto.HSMLocalizableParameter + * @memberof proto.TemplateMessage * @instance * @returns {Object.} JSON object */ - HSMLocalizableParameter.prototype.toJSON = function toJSON() { + TemplateMessage.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return HSMLocalizableParameter; + return TemplateMessage; })(); - proto.HighlyStructuredMessage = (function() { + proto.URLButton = (function() { /** - * Properties of a HighlyStructuredMessage. + * Properties of a URLButton. * @memberof proto - * @interface IHighlyStructuredMessage - * @property {string|null} [namespace] HighlyStructuredMessage namespace - * @property {string|null} [elementName] HighlyStructuredMessage elementName - * @property {Array.|null} [params] HighlyStructuredMessage params - * @property {string|null} [fallbackLg] HighlyStructuredMessage fallbackLg - * @property {string|null} [fallbackLc] HighlyStructuredMessage fallbackLc - * @property {Array.|null} [localizableParams] HighlyStructuredMessage localizableParams - * @property {string|null} [deterministicLg] HighlyStructuredMessage deterministicLg - * @property {string|null} [deterministicLc] HighlyStructuredMessage deterministicLc - * @property {proto.ITemplateMessage|null} [hydratedHsm] HighlyStructuredMessage hydratedHsm + * @interface IURLButton + * @property {proto.IHighlyStructuredMessage|null} [displayText] URLButton displayText + * @property {proto.IHighlyStructuredMessage|null} [url] URLButton url */ /** - * Constructs a new HighlyStructuredMessage. + * Constructs a new URLButton. * @memberof proto - * @classdesc Represents a HighlyStructuredMessage. - * @implements IHighlyStructuredMessage + * @classdesc Represents a URLButton. + * @implements IURLButton * @constructor - * @param {proto.IHighlyStructuredMessage=} [properties] Properties to set + * @param {proto.IURLButton=} [properties] Properties to set */ - function HighlyStructuredMessage(properties) { - this.params = []; - this.localizableParams = []; + function URLButton(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -32809,185 +33026,88 @@ $root.proto = (function() { } /** - * HighlyStructuredMessage namespace. - * @member {string} namespace - * @memberof proto.HighlyStructuredMessage - * @instance - */ - HighlyStructuredMessage.prototype.namespace = ""; - - /** - * HighlyStructuredMessage elementName. - * @member {string} elementName - * @memberof proto.HighlyStructuredMessage - * @instance - */ - HighlyStructuredMessage.prototype.elementName = ""; - - /** - * HighlyStructuredMessage params. - * @member {Array.} params - * @memberof proto.HighlyStructuredMessage - * @instance - */ - HighlyStructuredMessage.prototype.params = $util.emptyArray; - - /** - * HighlyStructuredMessage fallbackLg. - * @member {string} fallbackLg - * @memberof proto.HighlyStructuredMessage - * @instance - */ - HighlyStructuredMessage.prototype.fallbackLg = ""; - - /** - * HighlyStructuredMessage fallbackLc. - * @member {string} fallbackLc - * @memberof proto.HighlyStructuredMessage - * @instance - */ - HighlyStructuredMessage.prototype.fallbackLc = ""; - - /** - * HighlyStructuredMessage localizableParams. - * @member {Array.} localizableParams - * @memberof proto.HighlyStructuredMessage - * @instance - */ - HighlyStructuredMessage.prototype.localizableParams = $util.emptyArray; - - /** - * HighlyStructuredMessage deterministicLg. - * @member {string} deterministicLg - * @memberof proto.HighlyStructuredMessage - * @instance - */ - HighlyStructuredMessage.prototype.deterministicLg = ""; - - /** - * HighlyStructuredMessage deterministicLc. - * @member {string} deterministicLc - * @memberof proto.HighlyStructuredMessage + * URLButton displayText. + * @member {proto.IHighlyStructuredMessage|null|undefined} displayText + * @memberof proto.URLButton * @instance */ - HighlyStructuredMessage.prototype.deterministicLc = ""; + URLButton.prototype.displayText = null; /** - * HighlyStructuredMessage hydratedHsm. - * @member {proto.ITemplateMessage|null|undefined} hydratedHsm - * @memberof proto.HighlyStructuredMessage + * URLButton url. + * @member {proto.IHighlyStructuredMessage|null|undefined} url + * @memberof proto.URLButton * @instance */ - HighlyStructuredMessage.prototype.hydratedHsm = null; + URLButton.prototype.url = null; /** - * Creates a new HighlyStructuredMessage instance using the specified properties. + * Creates a new URLButton instance using the specified properties. * @function create - * @memberof proto.HighlyStructuredMessage + * @memberof proto.URLButton * @static - * @param {proto.IHighlyStructuredMessage=} [properties] Properties to set - * @returns {proto.HighlyStructuredMessage} HighlyStructuredMessage instance + * @param {proto.IURLButton=} [properties] Properties to set + * @returns {proto.URLButton} URLButton instance */ - HighlyStructuredMessage.create = function create(properties) { - return new HighlyStructuredMessage(properties); + URLButton.create = function create(properties) { + return new URLButton(properties); }; /** - * Encodes the specified HighlyStructuredMessage message. Does not implicitly {@link proto.HighlyStructuredMessage.verify|verify} messages. + * Encodes the specified URLButton message. Does not implicitly {@link proto.URLButton.verify|verify} messages. * @function encode - * @memberof proto.HighlyStructuredMessage + * @memberof proto.URLButton * @static - * @param {proto.IHighlyStructuredMessage} message HighlyStructuredMessage message or plain object to encode + * @param {proto.IURLButton} message URLButton message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - HighlyStructuredMessage.encode = function encode(message, writer) { + URLButton.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.namespace != null && Object.hasOwnProperty.call(message, "namespace")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.namespace); - if (message.elementName != null && Object.hasOwnProperty.call(message, "elementName")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.elementName); - if (message.params != null && message.params.length) - for (var i = 0; i < message.params.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.params[i]); - if (message.fallbackLg != null && Object.hasOwnProperty.call(message, "fallbackLg")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.fallbackLg); - if (message.fallbackLc != null && Object.hasOwnProperty.call(message, "fallbackLc")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.fallbackLc); - if (message.localizableParams != null && message.localizableParams.length) - for (var i = 0; i < message.localizableParams.length; ++i) - $root.proto.HSMLocalizableParameter.encode(message.localizableParams[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.deterministicLg != null && Object.hasOwnProperty.call(message, "deterministicLg")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.deterministicLg); - if (message.deterministicLc != null && Object.hasOwnProperty.call(message, "deterministicLc")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.deterministicLc); - if (message.hydratedHsm != null && Object.hasOwnProperty.call(message, "hydratedHsm")) - $root.proto.TemplateMessage.encode(message.hydratedHsm, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.displayText != null && Object.hasOwnProperty.call(message, "displayText")) + $root.proto.HighlyStructuredMessage.encode(message.displayText, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.url != null && Object.hasOwnProperty.call(message, "url")) + $root.proto.HighlyStructuredMessage.encode(message.url, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** - * Encodes the specified HighlyStructuredMessage message, length delimited. Does not implicitly {@link proto.HighlyStructuredMessage.verify|verify} messages. + * Encodes the specified URLButton message, length delimited. Does not implicitly {@link proto.URLButton.verify|verify} messages. * @function encodeDelimited - * @memberof proto.HighlyStructuredMessage + * @memberof proto.URLButton * @static - * @param {proto.IHighlyStructuredMessage} message HighlyStructuredMessage message or plain object to encode + * @param {proto.IURLButton} message URLButton message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - HighlyStructuredMessage.encodeDelimited = function encodeDelimited(message, writer) { + URLButton.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a HighlyStructuredMessage message from the specified reader or buffer. + * Decodes a URLButton message from the specified reader or buffer. * @function decode - * @memberof proto.HighlyStructuredMessage + * @memberof proto.URLButton * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {proto.HighlyStructuredMessage} HighlyStructuredMessage + * @returns {proto.URLButton} URLButton * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - HighlyStructuredMessage.decode = function decode(reader, length) { + URLButton.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.HighlyStructuredMessage(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.URLButton(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.namespace = reader.string(); + message.displayText = $root.proto.HighlyStructuredMessage.decode(reader, reader.uint32()); break; case 2: - message.elementName = reader.string(); - break; - case 3: - if (!(message.params && message.params.length)) - message.params = []; - message.params.push(reader.string()); - break; - case 4: - message.fallbackLg = reader.string(); - break; - case 5: - message.fallbackLc = reader.string(); - break; - case 6: - if (!(message.localizableParams && message.localizableParams.length)) - message.localizableParams = []; - message.localizableParams.push($root.proto.HSMLocalizableParameter.decode(reader, reader.uint32())); - break; - case 7: - message.deterministicLg = reader.string(); - break; - case 8: - message.deterministicLc = reader.string(); - break; - case 9: - message.hydratedHsm = $root.proto.TemplateMessage.decode(reader, reader.uint32()); + message.url = $root.proto.HighlyStructuredMessage.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -32998,210 +33118,149 @@ $root.proto = (function() { }; /** - * Decodes a HighlyStructuredMessage message from the specified reader or buffer, length delimited. + * Decodes a URLButton message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof proto.HighlyStructuredMessage + * @memberof proto.URLButton * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.HighlyStructuredMessage} HighlyStructuredMessage + * @returns {proto.URLButton} URLButton * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - HighlyStructuredMessage.decodeDelimited = function decodeDelimited(reader) { + URLButton.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a HighlyStructuredMessage message. + * Verifies a URLButton message. * @function verify - * @memberof proto.HighlyStructuredMessage + * @memberof proto.URLButton * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - HighlyStructuredMessage.verify = function verify(message) { + URLButton.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.namespace != null && message.hasOwnProperty("namespace")) - if (!$util.isString(message.namespace)) - return "namespace: string expected"; - if (message.elementName != null && message.hasOwnProperty("elementName")) - if (!$util.isString(message.elementName)) - return "elementName: string expected"; - if (message.params != null && message.hasOwnProperty("params")) { - if (!Array.isArray(message.params)) - return "params: array expected"; - for (var i = 0; i < message.params.length; ++i) - if (!$util.isString(message.params[i])) - return "params: string[] expected"; - } - if (message.fallbackLg != null && message.hasOwnProperty("fallbackLg")) - if (!$util.isString(message.fallbackLg)) - return "fallbackLg: string expected"; - if (message.fallbackLc != null && message.hasOwnProperty("fallbackLc")) - if (!$util.isString(message.fallbackLc)) - return "fallbackLc: string expected"; - if (message.localizableParams != null && message.hasOwnProperty("localizableParams")) { - if (!Array.isArray(message.localizableParams)) - return "localizableParams: array expected"; - for (var i = 0; i < message.localizableParams.length; ++i) { - var error = $root.proto.HSMLocalizableParameter.verify(message.localizableParams[i]); - if (error) - return "localizableParams." + error; - } + if (message.displayText != null && message.hasOwnProperty("displayText")) { + var error = $root.proto.HighlyStructuredMessage.verify(message.displayText); + if (error) + return "displayText." + error; } - if (message.deterministicLg != null && message.hasOwnProperty("deterministicLg")) - if (!$util.isString(message.deterministicLg)) - return "deterministicLg: string expected"; - if (message.deterministicLc != null && message.hasOwnProperty("deterministicLc")) - if (!$util.isString(message.deterministicLc)) - return "deterministicLc: string expected"; - if (message.hydratedHsm != null && message.hasOwnProperty("hydratedHsm")) { - var error = $root.proto.TemplateMessage.verify(message.hydratedHsm); + if (message.url != null && message.hasOwnProperty("url")) { + var error = $root.proto.HighlyStructuredMessage.verify(message.url); if (error) - return "hydratedHsm." + error; + return "url." + error; } return null; }; /** - * Creates a HighlyStructuredMessage message from a plain object. Also converts values to their respective internal types. + * Creates a URLButton message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof proto.HighlyStructuredMessage + * @memberof proto.URLButton * @static * @param {Object.} object Plain object - * @returns {proto.HighlyStructuredMessage} HighlyStructuredMessage + * @returns {proto.URLButton} URLButton */ - HighlyStructuredMessage.fromObject = function fromObject(object) { - if (object instanceof $root.proto.HighlyStructuredMessage) + URLButton.fromObject = function fromObject(object) { + if (object instanceof $root.proto.URLButton) return object; - var message = new $root.proto.HighlyStructuredMessage(); - if (object.namespace != null) - message.namespace = String(object.namespace); - if (object.elementName != null) - message.elementName = String(object.elementName); - if (object.params) { - if (!Array.isArray(object.params)) - throw TypeError(".proto.HighlyStructuredMessage.params: array expected"); - message.params = []; - for (var i = 0; i < object.params.length; ++i) - message.params[i] = String(object.params[i]); - } - if (object.fallbackLg != null) - message.fallbackLg = String(object.fallbackLg); - if (object.fallbackLc != null) - message.fallbackLc = String(object.fallbackLc); - if (object.localizableParams) { - if (!Array.isArray(object.localizableParams)) - throw TypeError(".proto.HighlyStructuredMessage.localizableParams: array expected"); - message.localizableParams = []; - for (var i = 0; i < object.localizableParams.length; ++i) { - if (typeof object.localizableParams[i] !== "object") - throw TypeError(".proto.HighlyStructuredMessage.localizableParams: object expected"); - message.localizableParams[i] = $root.proto.HSMLocalizableParameter.fromObject(object.localizableParams[i]); - } + var message = new $root.proto.URLButton(); + if (object.displayText != null) { + if (typeof object.displayText !== "object") + throw TypeError(".proto.URLButton.displayText: object expected"); + message.displayText = $root.proto.HighlyStructuredMessage.fromObject(object.displayText); } - if (object.deterministicLg != null) - message.deterministicLg = String(object.deterministicLg); - if (object.deterministicLc != null) - message.deterministicLc = String(object.deterministicLc); - if (object.hydratedHsm != null) { - if (typeof object.hydratedHsm !== "object") - throw TypeError(".proto.HighlyStructuredMessage.hydratedHsm: object expected"); - message.hydratedHsm = $root.proto.TemplateMessage.fromObject(object.hydratedHsm); + if (object.url != null) { + if (typeof object.url !== "object") + throw TypeError(".proto.URLButton.url: object expected"); + message.url = $root.proto.HighlyStructuredMessage.fromObject(object.url); } return message; }; /** - * Creates a plain object from a HighlyStructuredMessage message. Also converts values to other types if specified. + * Creates a plain object from a URLButton message. Also converts values to other types if specified. * @function toObject - * @memberof proto.HighlyStructuredMessage + * @memberof proto.URLButton * @static - * @param {proto.HighlyStructuredMessage} message HighlyStructuredMessage + * @param {proto.URLButton} message URLButton * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - HighlyStructuredMessage.toObject = function toObject(message, options) { + URLButton.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) { - object.params = []; - object.localizableParams = []; - } if (options.defaults) { - object.namespace = ""; - object.elementName = ""; - object.fallbackLg = ""; - object.fallbackLc = ""; - object.deterministicLg = ""; - object.deterministicLc = ""; - object.hydratedHsm = null; - } - if (message.namespace != null && message.hasOwnProperty("namespace")) - object.namespace = message.namespace; - if (message.elementName != null && message.hasOwnProperty("elementName")) - object.elementName = message.elementName; - if (message.params && message.params.length) { - object.params = []; - for (var j = 0; j < message.params.length; ++j) - object.params[j] = message.params[j]; - } - if (message.fallbackLg != null && message.hasOwnProperty("fallbackLg")) - object.fallbackLg = message.fallbackLg; - if (message.fallbackLc != null && message.hasOwnProperty("fallbackLc")) - object.fallbackLc = message.fallbackLc; - if (message.localizableParams && message.localizableParams.length) { - object.localizableParams = []; - for (var j = 0; j < message.localizableParams.length; ++j) - object.localizableParams[j] = $root.proto.HSMLocalizableParameter.toObject(message.localizableParams[j], options); + object.displayText = null; + object.url = null; } - if (message.deterministicLg != null && message.hasOwnProperty("deterministicLg")) - object.deterministicLg = message.deterministicLg; - if (message.deterministicLc != null && message.hasOwnProperty("deterministicLc")) - object.deterministicLc = message.deterministicLc; - if (message.hydratedHsm != null && message.hasOwnProperty("hydratedHsm")) - object.hydratedHsm = $root.proto.TemplateMessage.toObject(message.hydratedHsm, options); + if (message.displayText != null && message.hasOwnProperty("displayText")) + object.displayText = $root.proto.HighlyStructuredMessage.toObject(message.displayText, options); + if (message.url != null && message.hasOwnProperty("url")) + object.url = $root.proto.HighlyStructuredMessage.toObject(message.url, options); return object; }; /** - * Converts this HighlyStructuredMessage to JSON. + * Converts this URLButton to JSON. * @function toJSON - * @memberof proto.HighlyStructuredMessage + * @memberof proto.URLButton * @instance * @returns {Object.} JSON object */ - HighlyStructuredMessage.prototype.toJSON = function toJSON() { + URLButton.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return HighlyStructuredMessage; + return URLButton; })(); - proto.SendPaymentMessage = (function() { + proto.VideoMessage = (function() { /** - * Properties of a SendPaymentMessage. + * Properties of a VideoMessage. * @memberof proto - * @interface ISendPaymentMessage - * @property {proto.IMessage|null} [noteMessage] SendPaymentMessage noteMessage - * @property {proto.IMessageKey|null} [requestMessageKey] SendPaymentMessage requestMessageKey - * @property {proto.IPaymentBackground|null} [background] SendPaymentMessage background + * @interface IVideoMessage + * @property {string|null} [url] VideoMessage url + * @property {string|null} [mimetype] VideoMessage mimetype + * @property {Uint8Array|null} [fileSha256] VideoMessage fileSha256 + * @property {number|Long|null} [fileLength] VideoMessage fileLength + * @property {number|null} [seconds] VideoMessage seconds + * @property {Uint8Array|null} [mediaKey] VideoMessage mediaKey + * @property {string|null} [caption] VideoMessage caption + * @property {boolean|null} [gifPlayback] VideoMessage gifPlayback + * @property {number|null} [height] VideoMessage height + * @property {number|null} [width] VideoMessage width + * @property {Uint8Array|null} [fileEncSha256] VideoMessage fileEncSha256 + * @property {Array.|null} [interactiveAnnotations] VideoMessage interactiveAnnotations + * @property {string|null} [directPath] VideoMessage directPath + * @property {number|Long|null} [mediaKeyTimestamp] VideoMessage mediaKeyTimestamp + * @property {Uint8Array|null} [jpegThumbnail] VideoMessage jpegThumbnail + * @property {proto.IContextInfo|null} [contextInfo] VideoMessage contextInfo + * @property {Uint8Array|null} [streamingSidecar] VideoMessage streamingSidecar + * @property {proto.VideoMessage.VideoMessageAttribution|null} [gifAttribution] VideoMessage gifAttribution + * @property {boolean|null} [viewOnce] VideoMessage viewOnce + * @property {string|null} [thumbnailDirectPath] VideoMessage thumbnailDirectPath + * @property {Uint8Array|null} [thumbnailSha256] VideoMessage thumbnailSha256 + * @property {Uint8Array|null} [thumbnailEncSha256] VideoMessage thumbnailEncSha256 + * @property {string|null} [staticUrl] VideoMessage staticUrl */ /** - * Constructs a new SendPaymentMessage. + * Constructs a new VideoMessage. * @memberof proto - * @classdesc Represents a SendPaymentMessage. - * @implements ISendPaymentMessage + * @classdesc Represents a VideoMessage. + * @implements IVideoMessage * @constructor - * @param {proto.ISendPaymentMessage=} [properties] Properties to set + * @param {proto.IVideoMessage=} [properties] Properties to set */ - function SendPaymentMessage(properties) { + function VideoMessage(properties) { + this.interactiveAnnotations = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -33209,404 +33268,364 @@ $root.proto = (function() { } /** - * SendPaymentMessage noteMessage. - * @member {proto.IMessage|null|undefined} noteMessage - * @memberof proto.SendPaymentMessage + * VideoMessage url. + * @member {string} url + * @memberof proto.VideoMessage * @instance */ - SendPaymentMessage.prototype.noteMessage = null; + VideoMessage.prototype.url = ""; /** - * SendPaymentMessage requestMessageKey. - * @member {proto.IMessageKey|null|undefined} requestMessageKey - * @memberof proto.SendPaymentMessage + * VideoMessage mimetype. + * @member {string} mimetype + * @memberof proto.VideoMessage * @instance */ - SendPaymentMessage.prototype.requestMessageKey = null; + VideoMessage.prototype.mimetype = ""; /** - * SendPaymentMessage background. - * @member {proto.IPaymentBackground|null|undefined} background - * @memberof proto.SendPaymentMessage + * VideoMessage fileSha256. + * @member {Uint8Array} fileSha256 + * @memberof proto.VideoMessage * @instance */ - SendPaymentMessage.prototype.background = null; + VideoMessage.prototype.fileSha256 = $util.newBuffer([]); /** - * Creates a new SendPaymentMessage instance using the specified properties. - * @function create - * @memberof proto.SendPaymentMessage - * @static - * @param {proto.ISendPaymentMessage=} [properties] Properties to set - * @returns {proto.SendPaymentMessage} SendPaymentMessage instance + * VideoMessage fileLength. + * @member {number|Long} fileLength + * @memberof proto.VideoMessage + * @instance */ - SendPaymentMessage.create = function create(properties) { - return new SendPaymentMessage(properties); - }; + VideoMessage.prototype.fileLength = $util.Long ? $util.Long.fromBits(0,0,true) : 0; /** - * Encodes the specified SendPaymentMessage message. Does not implicitly {@link proto.SendPaymentMessage.verify|verify} messages. - * @function encode - * @memberof proto.SendPaymentMessage - * @static - * @param {proto.ISendPaymentMessage} message SendPaymentMessage message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * VideoMessage seconds. + * @member {number} seconds + * @memberof proto.VideoMessage + * @instance */ - SendPaymentMessage.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.noteMessage != null && Object.hasOwnProperty.call(message, "noteMessage")) - $root.proto.Message.encode(message.noteMessage, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.requestMessageKey != null && Object.hasOwnProperty.call(message, "requestMessageKey")) - $root.proto.MessageKey.encode(message.requestMessageKey, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.background != null && Object.hasOwnProperty.call(message, "background")) - $root.proto.PaymentBackground.encode(message.background, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; + VideoMessage.prototype.seconds = 0; /** - * Encodes the specified SendPaymentMessage message, length delimited. Does not implicitly {@link proto.SendPaymentMessage.verify|verify} messages. - * @function encodeDelimited - * @memberof proto.SendPaymentMessage - * @static - * @param {proto.ISendPaymentMessage} message SendPaymentMessage message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * VideoMessage mediaKey. + * @member {Uint8Array} mediaKey + * @memberof proto.VideoMessage + * @instance */ - SendPaymentMessage.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + VideoMessage.prototype.mediaKey = $util.newBuffer([]); /** - * Decodes a SendPaymentMessage message from the specified reader or buffer. - * @function decode - * @memberof proto.SendPaymentMessage - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {proto.SendPaymentMessage} SendPaymentMessage - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * VideoMessage caption. + * @member {string} caption + * @memberof proto.VideoMessage + * @instance */ - SendPaymentMessage.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.SendPaymentMessage(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 2: - message.noteMessage = $root.proto.Message.decode(reader, reader.uint32()); - break; - case 3: - message.requestMessageKey = $root.proto.MessageKey.decode(reader, reader.uint32()); - break; - case 4: - message.background = $root.proto.PaymentBackground.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + VideoMessage.prototype.caption = ""; /** - * Decodes a SendPaymentMessage message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof proto.SendPaymentMessage - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.SendPaymentMessage} SendPaymentMessage - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * VideoMessage gifPlayback. + * @member {boolean} gifPlayback + * @memberof proto.VideoMessage + * @instance */ - SendPaymentMessage.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + VideoMessage.prototype.gifPlayback = false; /** - * Verifies a SendPaymentMessage message. - * @function verify - * @memberof proto.SendPaymentMessage - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not + * VideoMessage height. + * @member {number} height + * @memberof proto.VideoMessage + * @instance */ - SendPaymentMessage.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.noteMessage != null && message.hasOwnProperty("noteMessage")) { - var error = $root.proto.Message.verify(message.noteMessage); - if (error) - return "noteMessage." + error; - } - if (message.requestMessageKey != null && message.hasOwnProperty("requestMessageKey")) { - var error = $root.proto.MessageKey.verify(message.requestMessageKey); - if (error) - return "requestMessageKey." + error; - } - if (message.background != null && message.hasOwnProperty("background")) { - var error = $root.proto.PaymentBackground.verify(message.background); - if (error) - return "background." + error; - } - return null; - }; + VideoMessage.prototype.height = 0; /** - * Creates a SendPaymentMessage message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof proto.SendPaymentMessage - * @static - * @param {Object.} object Plain object - * @returns {proto.SendPaymentMessage} SendPaymentMessage + * VideoMessage width. + * @member {number} width + * @memberof proto.VideoMessage + * @instance */ - SendPaymentMessage.fromObject = function fromObject(object) { - if (object instanceof $root.proto.SendPaymentMessage) - return object; - var message = new $root.proto.SendPaymentMessage(); - if (object.noteMessage != null) { - if (typeof object.noteMessage !== "object") - throw TypeError(".proto.SendPaymentMessage.noteMessage: object expected"); - message.noteMessage = $root.proto.Message.fromObject(object.noteMessage); - } - if (object.requestMessageKey != null) { - if (typeof object.requestMessageKey !== "object") - throw TypeError(".proto.SendPaymentMessage.requestMessageKey: object expected"); - message.requestMessageKey = $root.proto.MessageKey.fromObject(object.requestMessageKey); - } - if (object.background != null) { - if (typeof object.background !== "object") - throw TypeError(".proto.SendPaymentMessage.background: object expected"); - message.background = $root.proto.PaymentBackground.fromObject(object.background); - } - return message; - }; + VideoMessage.prototype.width = 0; /** - * Creates a plain object from a SendPaymentMessage message. Also converts values to other types if specified. - * @function toObject - * @memberof proto.SendPaymentMessage - * @static - * @param {proto.SendPaymentMessage} message SendPaymentMessage - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object + * VideoMessage fileEncSha256. + * @member {Uint8Array} fileEncSha256 + * @memberof proto.VideoMessage + * @instance */ - SendPaymentMessage.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.noteMessage = null; - object.requestMessageKey = null; - object.background = null; - } - if (message.noteMessage != null && message.hasOwnProperty("noteMessage")) - object.noteMessage = $root.proto.Message.toObject(message.noteMessage, options); - if (message.requestMessageKey != null && message.hasOwnProperty("requestMessageKey")) - object.requestMessageKey = $root.proto.MessageKey.toObject(message.requestMessageKey, options); - if (message.background != null && message.hasOwnProperty("background")) - object.background = $root.proto.PaymentBackground.toObject(message.background, options); - return object; - }; + VideoMessage.prototype.fileEncSha256 = $util.newBuffer([]); /** - * Converts this SendPaymentMessage to JSON. - * @function toJSON - * @memberof proto.SendPaymentMessage + * VideoMessage interactiveAnnotations. + * @member {Array.} interactiveAnnotations + * @memberof proto.VideoMessage * @instance - * @returns {Object.} JSON object */ - SendPaymentMessage.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return SendPaymentMessage; - })(); - - proto.RequestPaymentMessage = (function() { + VideoMessage.prototype.interactiveAnnotations = $util.emptyArray; /** - * Properties of a RequestPaymentMessage. - * @memberof proto - * @interface IRequestPaymentMessage - * @property {proto.IMessage|null} [noteMessage] RequestPaymentMessage noteMessage - * @property {string|null} [currencyCodeIso4217] RequestPaymentMessage currencyCodeIso4217 - * @property {number|Long|null} [amount1000] RequestPaymentMessage amount1000 - * @property {string|null} [requestFrom] RequestPaymentMessage requestFrom - * @property {number|Long|null} [expiryTimestamp] RequestPaymentMessage expiryTimestamp - * @property {proto.IMoney|null} [amount] RequestPaymentMessage amount - * @property {proto.IPaymentBackground|null} [background] RequestPaymentMessage background + * VideoMessage directPath. + * @member {string} directPath + * @memberof proto.VideoMessage + * @instance */ + VideoMessage.prototype.directPath = ""; /** - * Constructs a new RequestPaymentMessage. - * @memberof proto - * @classdesc Represents a RequestPaymentMessage. - * @implements IRequestPaymentMessage - * @constructor - * @param {proto.IRequestPaymentMessage=} [properties] Properties to set + * VideoMessage mediaKeyTimestamp. + * @member {number|Long} mediaKeyTimestamp + * @memberof proto.VideoMessage + * @instance */ - function RequestPaymentMessage(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + VideoMessage.prototype.mediaKeyTimestamp = $util.Long ? $util.Long.fromBits(0,0,false) : 0; /** - * RequestPaymentMessage noteMessage. - * @member {proto.IMessage|null|undefined} noteMessage - * @memberof proto.RequestPaymentMessage + * VideoMessage jpegThumbnail. + * @member {Uint8Array} jpegThumbnail + * @memberof proto.VideoMessage * @instance */ - RequestPaymentMessage.prototype.noteMessage = null; + VideoMessage.prototype.jpegThumbnail = $util.newBuffer([]); /** - * RequestPaymentMessage currencyCodeIso4217. - * @member {string} currencyCodeIso4217 - * @memberof proto.RequestPaymentMessage + * VideoMessage contextInfo. + * @member {proto.IContextInfo|null|undefined} contextInfo + * @memberof proto.VideoMessage * @instance */ - RequestPaymentMessage.prototype.currencyCodeIso4217 = ""; + VideoMessage.prototype.contextInfo = null; /** - * RequestPaymentMessage amount1000. - * @member {number|Long} amount1000 - * @memberof proto.RequestPaymentMessage + * VideoMessage streamingSidecar. + * @member {Uint8Array} streamingSidecar + * @memberof proto.VideoMessage * @instance */ - RequestPaymentMessage.prototype.amount1000 = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + VideoMessage.prototype.streamingSidecar = $util.newBuffer([]); /** - * RequestPaymentMessage requestFrom. - * @member {string} requestFrom - * @memberof proto.RequestPaymentMessage + * VideoMessage gifAttribution. + * @member {proto.VideoMessage.VideoMessageAttribution} gifAttribution + * @memberof proto.VideoMessage * @instance */ - RequestPaymentMessage.prototype.requestFrom = ""; + VideoMessage.prototype.gifAttribution = 0; /** - * RequestPaymentMessage expiryTimestamp. - * @member {number|Long} expiryTimestamp - * @memberof proto.RequestPaymentMessage + * VideoMessage viewOnce. + * @member {boolean} viewOnce + * @memberof proto.VideoMessage * @instance */ - RequestPaymentMessage.prototype.expiryTimestamp = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + VideoMessage.prototype.viewOnce = false; /** - * RequestPaymentMessage amount. - * @member {proto.IMoney|null|undefined} amount - * @memberof proto.RequestPaymentMessage + * VideoMessage thumbnailDirectPath. + * @member {string} thumbnailDirectPath + * @memberof proto.VideoMessage * @instance */ - RequestPaymentMessage.prototype.amount = null; + VideoMessage.prototype.thumbnailDirectPath = ""; /** - * RequestPaymentMessage background. - * @member {proto.IPaymentBackground|null|undefined} background - * @memberof proto.RequestPaymentMessage + * VideoMessage thumbnailSha256. + * @member {Uint8Array} thumbnailSha256 + * @memberof proto.VideoMessage * @instance */ - RequestPaymentMessage.prototype.background = null; + VideoMessage.prototype.thumbnailSha256 = $util.newBuffer([]); /** - * Creates a new RequestPaymentMessage instance using the specified properties. + * VideoMessage thumbnailEncSha256. + * @member {Uint8Array} thumbnailEncSha256 + * @memberof proto.VideoMessage + * @instance + */ + VideoMessage.prototype.thumbnailEncSha256 = $util.newBuffer([]); + + /** + * VideoMessage staticUrl. + * @member {string} staticUrl + * @memberof proto.VideoMessage + * @instance + */ + VideoMessage.prototype.staticUrl = ""; + + /** + * Creates a new VideoMessage instance using the specified properties. * @function create - * @memberof proto.RequestPaymentMessage + * @memberof proto.VideoMessage * @static - * @param {proto.IRequestPaymentMessage=} [properties] Properties to set - * @returns {proto.RequestPaymentMessage} RequestPaymentMessage instance + * @param {proto.IVideoMessage=} [properties] Properties to set + * @returns {proto.VideoMessage} VideoMessage instance */ - RequestPaymentMessage.create = function create(properties) { - return new RequestPaymentMessage(properties); + VideoMessage.create = function create(properties) { + return new VideoMessage(properties); }; /** - * Encodes the specified RequestPaymentMessage message. Does not implicitly {@link proto.RequestPaymentMessage.verify|verify} messages. + * Encodes the specified VideoMessage message. Does not implicitly {@link proto.VideoMessage.verify|verify} messages. * @function encode - * @memberof proto.RequestPaymentMessage + * @memberof proto.VideoMessage * @static - * @param {proto.IRequestPaymentMessage} message RequestPaymentMessage message or plain object to encode + * @param {proto.IVideoMessage} message VideoMessage message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - RequestPaymentMessage.encode = function encode(message, writer) { + VideoMessage.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.currencyCodeIso4217 != null && Object.hasOwnProperty.call(message, "currencyCodeIso4217")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.currencyCodeIso4217); - if (message.amount1000 != null && Object.hasOwnProperty.call(message, "amount1000")) - writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.amount1000); - if (message.requestFrom != null && Object.hasOwnProperty.call(message, "requestFrom")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestFrom); - if (message.noteMessage != null && Object.hasOwnProperty.call(message, "noteMessage")) - $root.proto.Message.encode(message.noteMessage, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.expiryTimestamp != null && Object.hasOwnProperty.call(message, "expiryTimestamp")) - writer.uint32(/* id 5, wireType 0 =*/40).int64(message.expiryTimestamp); - if (message.amount != null && Object.hasOwnProperty.call(message, "amount")) - $root.proto.Money.encode(message.amount, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.background != null && Object.hasOwnProperty.call(message, "background")) - $root.proto.PaymentBackground.encode(message.background, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.url != null && Object.hasOwnProperty.call(message, "url")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.url); + if (message.mimetype != null && Object.hasOwnProperty.call(message, "mimetype")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.mimetype); + if (message.fileSha256 != null && Object.hasOwnProperty.call(message, "fileSha256")) + writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.fileSha256); + if (message.fileLength != null && Object.hasOwnProperty.call(message, "fileLength")) + writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.fileLength); + if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) + writer.uint32(/* id 5, wireType 0 =*/40).uint32(message.seconds); + if (message.mediaKey != null && Object.hasOwnProperty.call(message, "mediaKey")) + writer.uint32(/* id 6, wireType 2 =*/50).bytes(message.mediaKey); + if (message.caption != null && Object.hasOwnProperty.call(message, "caption")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.caption); + if (message.gifPlayback != null && Object.hasOwnProperty.call(message, "gifPlayback")) + writer.uint32(/* id 8, wireType 0 =*/64).bool(message.gifPlayback); + if (message.height != null && Object.hasOwnProperty.call(message, "height")) + writer.uint32(/* id 9, wireType 0 =*/72).uint32(message.height); + if (message.width != null && Object.hasOwnProperty.call(message, "width")) + writer.uint32(/* id 10, wireType 0 =*/80).uint32(message.width); + if (message.fileEncSha256 != null && Object.hasOwnProperty.call(message, "fileEncSha256")) + writer.uint32(/* id 11, wireType 2 =*/90).bytes(message.fileEncSha256); + if (message.interactiveAnnotations != null && message.interactiveAnnotations.length) + for (var i = 0; i < message.interactiveAnnotations.length; ++i) + $root.proto.InteractiveAnnotation.encode(message.interactiveAnnotations[i], writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.directPath != null && Object.hasOwnProperty.call(message, "directPath")) + writer.uint32(/* id 13, wireType 2 =*/106).string(message.directPath); + if (message.mediaKeyTimestamp != null && Object.hasOwnProperty.call(message, "mediaKeyTimestamp")) + writer.uint32(/* id 14, wireType 0 =*/112).int64(message.mediaKeyTimestamp); + if (message.jpegThumbnail != null && Object.hasOwnProperty.call(message, "jpegThumbnail")) + writer.uint32(/* id 16, wireType 2 =*/130).bytes(message.jpegThumbnail); + if (message.contextInfo != null && Object.hasOwnProperty.call(message, "contextInfo")) + $root.proto.ContextInfo.encode(message.contextInfo, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); + if (message.streamingSidecar != null && Object.hasOwnProperty.call(message, "streamingSidecar")) + writer.uint32(/* id 18, wireType 2 =*/146).bytes(message.streamingSidecar); + if (message.gifAttribution != null && Object.hasOwnProperty.call(message, "gifAttribution")) + writer.uint32(/* id 19, wireType 0 =*/152).int32(message.gifAttribution); + if (message.viewOnce != null && Object.hasOwnProperty.call(message, "viewOnce")) + writer.uint32(/* id 20, wireType 0 =*/160).bool(message.viewOnce); + if (message.thumbnailDirectPath != null && Object.hasOwnProperty.call(message, "thumbnailDirectPath")) + writer.uint32(/* id 21, wireType 2 =*/170).string(message.thumbnailDirectPath); + if (message.thumbnailSha256 != null && Object.hasOwnProperty.call(message, "thumbnailSha256")) + writer.uint32(/* id 22, wireType 2 =*/178).bytes(message.thumbnailSha256); + if (message.thumbnailEncSha256 != null && Object.hasOwnProperty.call(message, "thumbnailEncSha256")) + writer.uint32(/* id 23, wireType 2 =*/186).bytes(message.thumbnailEncSha256); + if (message.staticUrl != null && Object.hasOwnProperty.call(message, "staticUrl")) + writer.uint32(/* id 24, wireType 2 =*/194).string(message.staticUrl); return writer; }; /** - * Encodes the specified RequestPaymentMessage message, length delimited. Does not implicitly {@link proto.RequestPaymentMessage.verify|verify} messages. + * Encodes the specified VideoMessage message, length delimited. Does not implicitly {@link proto.VideoMessage.verify|verify} messages. * @function encodeDelimited - * @memberof proto.RequestPaymentMessage + * @memberof proto.VideoMessage * @static - * @param {proto.IRequestPaymentMessage} message RequestPaymentMessage message or plain object to encode + * @param {proto.IVideoMessage} message VideoMessage message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - RequestPaymentMessage.encodeDelimited = function encodeDelimited(message, writer) { + VideoMessage.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a RequestPaymentMessage message from the specified reader or buffer. + * Decodes a VideoMessage message from the specified reader or buffer. * @function decode - * @memberof proto.RequestPaymentMessage + * @memberof proto.VideoMessage * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {proto.RequestPaymentMessage} RequestPaymentMessage + * @returns {proto.VideoMessage} VideoMessage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - RequestPaymentMessage.decode = function decode(reader, length) { + VideoMessage.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.RequestPaymentMessage(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.VideoMessage(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 4: - message.noteMessage = $root.proto.Message.decode(reader, reader.uint32()); - break; case 1: - message.currencyCodeIso4217 = reader.string(); + message.url = reader.string(); break; case 2: - message.amount1000 = reader.uint64(); + message.mimetype = reader.string(); break; case 3: - message.requestFrom = reader.string(); + message.fileSha256 = reader.bytes(); + break; + case 4: + message.fileLength = reader.uint64(); break; case 5: - message.expiryTimestamp = reader.int64(); + message.seconds = reader.uint32(); break; case 6: - message.amount = $root.proto.Money.decode(reader, reader.uint32()); + message.mediaKey = reader.bytes(); break; case 7: - message.background = $root.proto.PaymentBackground.decode(reader, reader.uint32()); + message.caption = reader.string(); + break; + case 8: + message.gifPlayback = reader.bool(); + break; + case 9: + message.height = reader.uint32(); + break; + case 10: + message.width = reader.uint32(); + break; + case 11: + message.fileEncSha256 = reader.bytes(); + break; + case 12: + if (!(message.interactiveAnnotations && message.interactiveAnnotations.length)) + message.interactiveAnnotations = []; + message.interactiveAnnotations.push($root.proto.InteractiveAnnotation.decode(reader, reader.uint32())); + break; + case 13: + message.directPath = reader.string(); + break; + case 14: + message.mediaKeyTimestamp = reader.int64(); + break; + case 16: + message.jpegThumbnail = reader.bytes(); + break; + case 17: + message.contextInfo = $root.proto.ContextInfo.decode(reader, reader.uint32()); + break; + case 18: + message.streamingSidecar = reader.bytes(); + break; + case 19: + message.gifAttribution = reader.int32(); + break; + case 20: + message.viewOnce = reader.bool(); + break; + case 21: + message.thumbnailDirectPath = reader.string(); + break; + case 22: + message.thumbnailSha256 = reader.bytes(); + break; + case 23: + message.thumbnailEncSha256 = reader.bytes(); + break; + case 24: + message.staticUrl = reader.string(); break; default: reader.skipType(tag & 7); @@ -33617,199 +33636,433 @@ $root.proto = (function() { }; /** - * Decodes a RequestPaymentMessage message from the specified reader or buffer, length delimited. + * Decodes a VideoMessage message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof proto.RequestPaymentMessage + * @memberof proto.VideoMessage * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.RequestPaymentMessage} RequestPaymentMessage + * @returns {proto.VideoMessage} VideoMessage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - RequestPaymentMessage.decodeDelimited = function decodeDelimited(reader) { + VideoMessage.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a RequestPaymentMessage message. + * Verifies a VideoMessage message. * @function verify - * @memberof proto.RequestPaymentMessage + * @memberof proto.VideoMessage * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - RequestPaymentMessage.verify = function verify(message) { + VideoMessage.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.noteMessage != null && message.hasOwnProperty("noteMessage")) { - var error = $root.proto.Message.verify(message.noteMessage); - if (error) - return "noteMessage." + error; - } - if (message.currencyCodeIso4217 != null && message.hasOwnProperty("currencyCodeIso4217")) - if (!$util.isString(message.currencyCodeIso4217)) - return "currencyCodeIso4217: string expected"; - if (message.amount1000 != null && message.hasOwnProperty("amount1000")) - if (!$util.isInteger(message.amount1000) && !(message.amount1000 && $util.isInteger(message.amount1000.low) && $util.isInteger(message.amount1000.high))) - return "amount1000: integer|Long expected"; - if (message.requestFrom != null && message.hasOwnProperty("requestFrom")) - if (!$util.isString(message.requestFrom)) - return "requestFrom: string expected"; - if (message.expiryTimestamp != null && message.hasOwnProperty("expiryTimestamp")) - if (!$util.isInteger(message.expiryTimestamp) && !(message.expiryTimestamp && $util.isInteger(message.expiryTimestamp.low) && $util.isInteger(message.expiryTimestamp.high))) - return "expiryTimestamp: integer|Long expected"; - if (message.amount != null && message.hasOwnProperty("amount")) { - var error = $root.proto.Money.verify(message.amount); - if (error) - return "amount." + error; + if (message.url != null && message.hasOwnProperty("url")) + if (!$util.isString(message.url)) + return "url: string expected"; + if (message.mimetype != null && message.hasOwnProperty("mimetype")) + if (!$util.isString(message.mimetype)) + return "mimetype: string expected"; + if (message.fileSha256 != null && message.hasOwnProperty("fileSha256")) + if (!(message.fileSha256 && typeof message.fileSha256.length === "number" || $util.isString(message.fileSha256))) + return "fileSha256: buffer expected"; + if (message.fileLength != null && message.hasOwnProperty("fileLength")) + if (!$util.isInteger(message.fileLength) && !(message.fileLength && $util.isInteger(message.fileLength.low) && $util.isInteger(message.fileLength.high))) + return "fileLength: integer|Long expected"; + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (!$util.isInteger(message.seconds)) + return "seconds: integer expected"; + if (message.mediaKey != null && message.hasOwnProperty("mediaKey")) + if (!(message.mediaKey && typeof message.mediaKey.length === "number" || $util.isString(message.mediaKey))) + return "mediaKey: buffer expected"; + if (message.caption != null && message.hasOwnProperty("caption")) + if (!$util.isString(message.caption)) + return "caption: string expected"; + if (message.gifPlayback != null && message.hasOwnProperty("gifPlayback")) + if (typeof message.gifPlayback !== "boolean") + return "gifPlayback: boolean expected"; + if (message.height != null && message.hasOwnProperty("height")) + if (!$util.isInteger(message.height)) + return "height: integer expected"; + if (message.width != null && message.hasOwnProperty("width")) + if (!$util.isInteger(message.width)) + return "width: integer expected"; + if (message.fileEncSha256 != null && message.hasOwnProperty("fileEncSha256")) + if (!(message.fileEncSha256 && typeof message.fileEncSha256.length === "number" || $util.isString(message.fileEncSha256))) + return "fileEncSha256: buffer expected"; + if (message.interactiveAnnotations != null && message.hasOwnProperty("interactiveAnnotations")) { + if (!Array.isArray(message.interactiveAnnotations)) + return "interactiveAnnotations: array expected"; + for (var i = 0; i < message.interactiveAnnotations.length; ++i) { + var error = $root.proto.InteractiveAnnotation.verify(message.interactiveAnnotations[i]); + if (error) + return "interactiveAnnotations." + error; + } } - if (message.background != null && message.hasOwnProperty("background")) { - var error = $root.proto.PaymentBackground.verify(message.background); + if (message.directPath != null && message.hasOwnProperty("directPath")) + if (!$util.isString(message.directPath)) + return "directPath: string expected"; + if (message.mediaKeyTimestamp != null && message.hasOwnProperty("mediaKeyTimestamp")) + if (!$util.isInteger(message.mediaKeyTimestamp) && !(message.mediaKeyTimestamp && $util.isInteger(message.mediaKeyTimestamp.low) && $util.isInteger(message.mediaKeyTimestamp.high))) + return "mediaKeyTimestamp: integer|Long expected"; + if (message.jpegThumbnail != null && message.hasOwnProperty("jpegThumbnail")) + if (!(message.jpegThumbnail && typeof message.jpegThumbnail.length === "number" || $util.isString(message.jpegThumbnail))) + return "jpegThumbnail: buffer expected"; + if (message.contextInfo != null && message.hasOwnProperty("contextInfo")) { + var error = $root.proto.ContextInfo.verify(message.contextInfo); if (error) - return "background." + error; + return "contextInfo." + error; } + if (message.streamingSidecar != null && message.hasOwnProperty("streamingSidecar")) + if (!(message.streamingSidecar && typeof message.streamingSidecar.length === "number" || $util.isString(message.streamingSidecar))) + return "streamingSidecar: buffer expected"; + if (message.gifAttribution != null && message.hasOwnProperty("gifAttribution")) + switch (message.gifAttribution) { + default: + return "gifAttribution: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.viewOnce != null && message.hasOwnProperty("viewOnce")) + if (typeof message.viewOnce !== "boolean") + return "viewOnce: boolean expected"; + if (message.thumbnailDirectPath != null && message.hasOwnProperty("thumbnailDirectPath")) + if (!$util.isString(message.thumbnailDirectPath)) + return "thumbnailDirectPath: string expected"; + if (message.thumbnailSha256 != null && message.hasOwnProperty("thumbnailSha256")) + if (!(message.thumbnailSha256 && typeof message.thumbnailSha256.length === "number" || $util.isString(message.thumbnailSha256))) + return "thumbnailSha256: buffer expected"; + if (message.thumbnailEncSha256 != null && message.hasOwnProperty("thumbnailEncSha256")) + if (!(message.thumbnailEncSha256 && typeof message.thumbnailEncSha256.length === "number" || $util.isString(message.thumbnailEncSha256))) + return "thumbnailEncSha256: buffer expected"; + if (message.staticUrl != null && message.hasOwnProperty("staticUrl")) + if (!$util.isString(message.staticUrl)) + return "staticUrl: string expected"; return null; }; /** - * Creates a RequestPaymentMessage message from a plain object. Also converts values to their respective internal types. + * Creates a VideoMessage message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof proto.RequestPaymentMessage + * @memberof proto.VideoMessage * @static * @param {Object.} object Plain object - * @returns {proto.RequestPaymentMessage} RequestPaymentMessage + * @returns {proto.VideoMessage} VideoMessage */ - RequestPaymentMessage.fromObject = function fromObject(object) { - if (object instanceof $root.proto.RequestPaymentMessage) + VideoMessage.fromObject = function fromObject(object) { + if (object instanceof $root.proto.VideoMessage) return object; - var message = new $root.proto.RequestPaymentMessage(); - if (object.noteMessage != null) { - if (typeof object.noteMessage !== "object") - throw TypeError(".proto.RequestPaymentMessage.noteMessage: object expected"); - message.noteMessage = $root.proto.Message.fromObject(object.noteMessage); - } - if (object.currencyCodeIso4217 != null) - message.currencyCodeIso4217 = String(object.currencyCodeIso4217); - if (object.amount1000 != null) + var message = new $root.proto.VideoMessage(); + if (object.url != null) + message.url = String(object.url); + if (object.mimetype != null) + message.mimetype = String(object.mimetype); + if (object.fileSha256 != null) + if (typeof object.fileSha256 === "string") + $util.base64.decode(object.fileSha256, message.fileSha256 = $util.newBuffer($util.base64.length(object.fileSha256)), 0); + else if (object.fileSha256.length) + message.fileSha256 = object.fileSha256; + if (object.fileLength != null) if ($util.Long) - (message.amount1000 = $util.Long.fromValue(object.amount1000)).unsigned = true; - else if (typeof object.amount1000 === "string") - message.amount1000 = parseInt(object.amount1000, 10); - else if (typeof object.amount1000 === "number") - message.amount1000 = object.amount1000; - else if (typeof object.amount1000 === "object") - message.amount1000 = new $util.LongBits(object.amount1000.low >>> 0, object.amount1000.high >>> 0).toNumber(true); - if (object.requestFrom != null) - message.requestFrom = String(object.requestFrom); - if (object.expiryTimestamp != null) + (message.fileLength = $util.Long.fromValue(object.fileLength)).unsigned = true; + else if (typeof object.fileLength === "string") + message.fileLength = parseInt(object.fileLength, 10); + else if (typeof object.fileLength === "number") + message.fileLength = object.fileLength; + else if (typeof object.fileLength === "object") + message.fileLength = new $util.LongBits(object.fileLength.low >>> 0, object.fileLength.high >>> 0).toNumber(true); + if (object.seconds != null) + message.seconds = object.seconds >>> 0; + if (object.mediaKey != null) + if (typeof object.mediaKey === "string") + $util.base64.decode(object.mediaKey, message.mediaKey = $util.newBuffer($util.base64.length(object.mediaKey)), 0); + else if (object.mediaKey.length) + message.mediaKey = object.mediaKey; + if (object.caption != null) + message.caption = String(object.caption); + if (object.gifPlayback != null) + message.gifPlayback = Boolean(object.gifPlayback); + if (object.height != null) + message.height = object.height >>> 0; + if (object.width != null) + message.width = object.width >>> 0; + if (object.fileEncSha256 != null) + if (typeof object.fileEncSha256 === "string") + $util.base64.decode(object.fileEncSha256, message.fileEncSha256 = $util.newBuffer($util.base64.length(object.fileEncSha256)), 0); + else if (object.fileEncSha256.length) + message.fileEncSha256 = object.fileEncSha256; + if (object.interactiveAnnotations) { + if (!Array.isArray(object.interactiveAnnotations)) + throw TypeError(".proto.VideoMessage.interactiveAnnotations: array expected"); + message.interactiveAnnotations = []; + for (var i = 0; i < object.interactiveAnnotations.length; ++i) { + if (typeof object.interactiveAnnotations[i] !== "object") + throw TypeError(".proto.VideoMessage.interactiveAnnotations: object expected"); + message.interactiveAnnotations[i] = $root.proto.InteractiveAnnotation.fromObject(object.interactiveAnnotations[i]); + } + } + if (object.directPath != null) + message.directPath = String(object.directPath); + if (object.mediaKeyTimestamp != null) if ($util.Long) - (message.expiryTimestamp = $util.Long.fromValue(object.expiryTimestamp)).unsigned = false; - else if (typeof object.expiryTimestamp === "string") - message.expiryTimestamp = parseInt(object.expiryTimestamp, 10); - else if (typeof object.expiryTimestamp === "number") - message.expiryTimestamp = object.expiryTimestamp; - else if (typeof object.expiryTimestamp === "object") - message.expiryTimestamp = new $util.LongBits(object.expiryTimestamp.low >>> 0, object.expiryTimestamp.high >>> 0).toNumber(); - if (object.amount != null) { - if (typeof object.amount !== "object") - throw TypeError(".proto.RequestPaymentMessage.amount: object expected"); - message.amount = $root.proto.Money.fromObject(object.amount); + (message.mediaKeyTimestamp = $util.Long.fromValue(object.mediaKeyTimestamp)).unsigned = false; + else if (typeof object.mediaKeyTimestamp === "string") + message.mediaKeyTimestamp = parseInt(object.mediaKeyTimestamp, 10); + else if (typeof object.mediaKeyTimestamp === "number") + message.mediaKeyTimestamp = object.mediaKeyTimestamp; + else if (typeof object.mediaKeyTimestamp === "object") + message.mediaKeyTimestamp = new $util.LongBits(object.mediaKeyTimestamp.low >>> 0, object.mediaKeyTimestamp.high >>> 0).toNumber(); + if (object.jpegThumbnail != null) + if (typeof object.jpegThumbnail === "string") + $util.base64.decode(object.jpegThumbnail, message.jpegThumbnail = $util.newBuffer($util.base64.length(object.jpegThumbnail)), 0); + else if (object.jpegThumbnail.length) + message.jpegThumbnail = object.jpegThumbnail; + if (object.contextInfo != null) { + if (typeof object.contextInfo !== "object") + throw TypeError(".proto.VideoMessage.contextInfo: object expected"); + message.contextInfo = $root.proto.ContextInfo.fromObject(object.contextInfo); } - if (object.background != null) { - if (typeof object.background !== "object") - throw TypeError(".proto.RequestPaymentMessage.background: object expected"); - message.background = $root.proto.PaymentBackground.fromObject(object.background); + if (object.streamingSidecar != null) + if (typeof object.streamingSidecar === "string") + $util.base64.decode(object.streamingSidecar, message.streamingSidecar = $util.newBuffer($util.base64.length(object.streamingSidecar)), 0); + else if (object.streamingSidecar.length) + message.streamingSidecar = object.streamingSidecar; + switch (object.gifAttribution) { + case "NONE": + case 0: + message.gifAttribution = 0; + break; + case "GIPHY": + case 1: + message.gifAttribution = 1; + break; + case "TENOR": + case 2: + message.gifAttribution = 2; + break; } - return message; - }; - - /** - * Creates a plain object from a RequestPaymentMessage message. Also converts values to other types if specified. - * @function toObject - * @memberof proto.RequestPaymentMessage - * @static - * @param {proto.RequestPaymentMessage} message RequestPaymentMessage - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RequestPaymentMessage.toObject = function toObject(message, options) { - if (!options) + if (object.viewOnce != null) + message.viewOnce = Boolean(object.viewOnce); + if (object.thumbnailDirectPath != null) + message.thumbnailDirectPath = String(object.thumbnailDirectPath); + if (object.thumbnailSha256 != null) + if (typeof object.thumbnailSha256 === "string") + $util.base64.decode(object.thumbnailSha256, message.thumbnailSha256 = $util.newBuffer($util.base64.length(object.thumbnailSha256)), 0); + else if (object.thumbnailSha256.length) + message.thumbnailSha256 = object.thumbnailSha256; + if (object.thumbnailEncSha256 != null) + if (typeof object.thumbnailEncSha256 === "string") + $util.base64.decode(object.thumbnailEncSha256, message.thumbnailEncSha256 = $util.newBuffer($util.base64.length(object.thumbnailEncSha256)), 0); + else if (object.thumbnailEncSha256.length) + message.thumbnailEncSha256 = object.thumbnailEncSha256; + if (object.staticUrl != null) + message.staticUrl = String(object.staticUrl); + return message; + }; + + /** + * Creates a plain object from a VideoMessage message. Also converts values to other types if specified. + * @function toObject + * @memberof proto.VideoMessage + * @static + * @param {proto.VideoMessage} message VideoMessage + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VideoMessage.toObject = function toObject(message, options) { + if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.interactiveAnnotations = []; if (options.defaults) { - object.currencyCodeIso4217 = ""; + object.url = ""; + object.mimetype = ""; + if (options.bytes === String) + object.fileSha256 = ""; + else { + object.fileSha256 = []; + if (options.bytes !== Array) + object.fileSha256 = $util.newBuffer(object.fileSha256); + } if ($util.Long) { var long = new $util.Long(0, 0, true); - object.amount1000 = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + object.fileLength = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; } else - object.amount1000 = options.longs === String ? "0" : 0; - object.requestFrom = ""; - object.noteMessage = null; + object.fileLength = options.longs === String ? "0" : 0; + object.seconds = 0; + if (options.bytes === String) + object.mediaKey = ""; + else { + object.mediaKey = []; + if (options.bytes !== Array) + object.mediaKey = $util.newBuffer(object.mediaKey); + } + object.caption = ""; + object.gifPlayback = false; + object.height = 0; + object.width = 0; + if (options.bytes === String) + object.fileEncSha256 = ""; + else { + object.fileEncSha256 = []; + if (options.bytes !== Array) + object.fileEncSha256 = $util.newBuffer(object.fileEncSha256); + } + object.directPath = ""; if ($util.Long) { var long = new $util.Long(0, 0, false); - object.expiryTimestamp = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + object.mediaKeyTimestamp = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; } else - object.expiryTimestamp = options.longs === String ? "0" : 0; - object.amount = null; - object.background = null; + object.mediaKeyTimestamp = options.longs === String ? "0" : 0; + if (options.bytes === String) + object.jpegThumbnail = ""; + else { + object.jpegThumbnail = []; + if (options.bytes !== Array) + object.jpegThumbnail = $util.newBuffer(object.jpegThumbnail); + } + object.contextInfo = null; + if (options.bytes === String) + object.streamingSidecar = ""; + else { + object.streamingSidecar = []; + if (options.bytes !== Array) + object.streamingSidecar = $util.newBuffer(object.streamingSidecar); + } + object.gifAttribution = options.enums === String ? "NONE" : 0; + object.viewOnce = false; + object.thumbnailDirectPath = ""; + if (options.bytes === String) + object.thumbnailSha256 = ""; + else { + object.thumbnailSha256 = []; + if (options.bytes !== Array) + object.thumbnailSha256 = $util.newBuffer(object.thumbnailSha256); + } + if (options.bytes === String) + object.thumbnailEncSha256 = ""; + else { + object.thumbnailEncSha256 = []; + if (options.bytes !== Array) + object.thumbnailEncSha256 = $util.newBuffer(object.thumbnailEncSha256); + } + object.staticUrl = ""; } - if (message.currencyCodeIso4217 != null && message.hasOwnProperty("currencyCodeIso4217")) - object.currencyCodeIso4217 = message.currencyCodeIso4217; - if (message.amount1000 != null && message.hasOwnProperty("amount1000")) - if (typeof message.amount1000 === "number") - object.amount1000 = options.longs === String ? String(message.amount1000) : message.amount1000; + if (message.url != null && message.hasOwnProperty("url")) + object.url = message.url; + if (message.mimetype != null && message.hasOwnProperty("mimetype")) + object.mimetype = message.mimetype; + if (message.fileSha256 != null && message.hasOwnProperty("fileSha256")) + object.fileSha256 = options.bytes === String ? $util.base64.encode(message.fileSha256, 0, message.fileSha256.length) : options.bytes === Array ? Array.prototype.slice.call(message.fileSha256) : message.fileSha256; + if (message.fileLength != null && message.hasOwnProperty("fileLength")) + if (typeof message.fileLength === "number") + object.fileLength = options.longs === String ? String(message.fileLength) : message.fileLength; else - object.amount1000 = options.longs === String ? $util.Long.prototype.toString.call(message.amount1000) : options.longs === Number ? new $util.LongBits(message.amount1000.low >>> 0, message.amount1000.high >>> 0).toNumber(true) : message.amount1000; - if (message.requestFrom != null && message.hasOwnProperty("requestFrom")) - object.requestFrom = message.requestFrom; - if (message.noteMessage != null && message.hasOwnProperty("noteMessage")) - object.noteMessage = $root.proto.Message.toObject(message.noteMessage, options); - if (message.expiryTimestamp != null && message.hasOwnProperty("expiryTimestamp")) - if (typeof message.expiryTimestamp === "number") - object.expiryTimestamp = options.longs === String ? String(message.expiryTimestamp) : message.expiryTimestamp; + object.fileLength = options.longs === String ? $util.Long.prototype.toString.call(message.fileLength) : options.longs === Number ? new $util.LongBits(message.fileLength.low >>> 0, message.fileLength.high >>> 0).toNumber(true) : message.fileLength; + if (message.seconds != null && message.hasOwnProperty("seconds")) + object.seconds = message.seconds; + if (message.mediaKey != null && message.hasOwnProperty("mediaKey")) + object.mediaKey = options.bytes === String ? $util.base64.encode(message.mediaKey, 0, message.mediaKey.length) : options.bytes === Array ? Array.prototype.slice.call(message.mediaKey) : message.mediaKey; + if (message.caption != null && message.hasOwnProperty("caption")) + object.caption = message.caption; + if (message.gifPlayback != null && message.hasOwnProperty("gifPlayback")) + object.gifPlayback = message.gifPlayback; + if (message.height != null && message.hasOwnProperty("height")) + object.height = message.height; + if (message.width != null && message.hasOwnProperty("width")) + object.width = message.width; + if (message.fileEncSha256 != null && message.hasOwnProperty("fileEncSha256")) + object.fileEncSha256 = options.bytes === String ? $util.base64.encode(message.fileEncSha256, 0, message.fileEncSha256.length) : options.bytes === Array ? Array.prototype.slice.call(message.fileEncSha256) : message.fileEncSha256; + if (message.interactiveAnnotations && message.interactiveAnnotations.length) { + object.interactiveAnnotations = []; + for (var j = 0; j < message.interactiveAnnotations.length; ++j) + object.interactiveAnnotations[j] = $root.proto.InteractiveAnnotation.toObject(message.interactiveAnnotations[j], options); + } + if (message.directPath != null && message.hasOwnProperty("directPath")) + object.directPath = message.directPath; + if (message.mediaKeyTimestamp != null && message.hasOwnProperty("mediaKeyTimestamp")) + if (typeof message.mediaKeyTimestamp === "number") + object.mediaKeyTimestamp = options.longs === String ? String(message.mediaKeyTimestamp) : message.mediaKeyTimestamp; else - object.expiryTimestamp = options.longs === String ? $util.Long.prototype.toString.call(message.expiryTimestamp) : options.longs === Number ? new $util.LongBits(message.expiryTimestamp.low >>> 0, message.expiryTimestamp.high >>> 0).toNumber() : message.expiryTimestamp; - if (message.amount != null && message.hasOwnProperty("amount")) - object.amount = $root.proto.Money.toObject(message.amount, options); - if (message.background != null && message.hasOwnProperty("background")) - object.background = $root.proto.PaymentBackground.toObject(message.background, options); + object.mediaKeyTimestamp = options.longs === String ? $util.Long.prototype.toString.call(message.mediaKeyTimestamp) : options.longs === Number ? new $util.LongBits(message.mediaKeyTimestamp.low >>> 0, message.mediaKeyTimestamp.high >>> 0).toNumber() : message.mediaKeyTimestamp; + if (message.jpegThumbnail != null && message.hasOwnProperty("jpegThumbnail")) + object.jpegThumbnail = options.bytes === String ? $util.base64.encode(message.jpegThumbnail, 0, message.jpegThumbnail.length) : options.bytes === Array ? Array.prototype.slice.call(message.jpegThumbnail) : message.jpegThumbnail; + if (message.contextInfo != null && message.hasOwnProperty("contextInfo")) + object.contextInfo = $root.proto.ContextInfo.toObject(message.contextInfo, options); + if (message.streamingSidecar != null && message.hasOwnProperty("streamingSidecar")) + object.streamingSidecar = options.bytes === String ? $util.base64.encode(message.streamingSidecar, 0, message.streamingSidecar.length) : options.bytes === Array ? Array.prototype.slice.call(message.streamingSidecar) : message.streamingSidecar; + if (message.gifAttribution != null && message.hasOwnProperty("gifAttribution")) + object.gifAttribution = options.enums === String ? $root.proto.VideoMessage.VideoMessageAttribution[message.gifAttribution] : message.gifAttribution; + if (message.viewOnce != null && message.hasOwnProperty("viewOnce")) + object.viewOnce = message.viewOnce; + if (message.thumbnailDirectPath != null && message.hasOwnProperty("thumbnailDirectPath")) + object.thumbnailDirectPath = message.thumbnailDirectPath; + if (message.thumbnailSha256 != null && message.hasOwnProperty("thumbnailSha256")) + object.thumbnailSha256 = options.bytes === String ? $util.base64.encode(message.thumbnailSha256, 0, message.thumbnailSha256.length) : options.bytes === Array ? Array.prototype.slice.call(message.thumbnailSha256) : message.thumbnailSha256; + if (message.thumbnailEncSha256 != null && message.hasOwnProperty("thumbnailEncSha256")) + object.thumbnailEncSha256 = options.bytes === String ? $util.base64.encode(message.thumbnailEncSha256, 0, message.thumbnailEncSha256.length) : options.bytes === Array ? Array.prototype.slice.call(message.thumbnailEncSha256) : message.thumbnailEncSha256; + if (message.staticUrl != null && message.hasOwnProperty("staticUrl")) + object.staticUrl = message.staticUrl; return object; }; /** - * Converts this RequestPaymentMessage to JSON. + * Converts this VideoMessage to JSON. * @function toJSON - * @memberof proto.RequestPaymentMessage + * @memberof proto.VideoMessage * @instance * @returns {Object.} JSON object */ - RequestPaymentMessage.prototype.toJSON = function toJSON() { + VideoMessage.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return RequestPaymentMessage; + /** + * VideoMessageAttribution enum. + * @name proto.VideoMessage.VideoMessageAttribution + * @enum {number} + * @property {number} NONE=0 NONE value + * @property {number} GIPHY=1 GIPHY value + * @property {number} TENOR=2 TENOR value + */ + VideoMessage.VideoMessageAttribution = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NONE"] = 0; + values[valuesById[1] = "GIPHY"] = 1; + values[valuesById[2] = "TENOR"] = 2; + return values; + })(); + + return VideoMessage; })(); - proto.DeclinePaymentRequestMessage = (function() { + proto.EphemeralSetting = (function() { /** - * Properties of a DeclinePaymentRequestMessage. + * Properties of an EphemeralSetting. * @memberof proto - * @interface IDeclinePaymentRequestMessage - * @property {proto.IMessageKey|null} [key] DeclinePaymentRequestMessage key + * @interface IEphemeralSetting + * @property {number|null} [duration] EphemeralSetting duration + * @property {number|Long|null} [timestamp] EphemeralSetting timestamp */ /** - * Constructs a new DeclinePaymentRequestMessage. + * Constructs a new EphemeralSetting. * @memberof proto - * @classdesc Represents a DeclinePaymentRequestMessage. - * @implements IDeclinePaymentRequestMessage + * @classdesc Represents an EphemeralSetting. + * @implements IEphemeralSetting * @constructor - * @param {proto.IDeclinePaymentRequestMessage=} [properties] Properties to set + * @param {proto.IEphemeralSetting=} [properties] Properties to set */ - function DeclinePaymentRequestMessage(properties) { + function EphemeralSetting(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -33817,75 +34070,88 @@ $root.proto = (function() { } /** - * DeclinePaymentRequestMessage key. - * @member {proto.IMessageKey|null|undefined} key - * @memberof proto.DeclinePaymentRequestMessage + * EphemeralSetting duration. + * @member {number} duration + * @memberof proto.EphemeralSetting * @instance */ - DeclinePaymentRequestMessage.prototype.key = null; + EphemeralSetting.prototype.duration = 0; /** - * Creates a new DeclinePaymentRequestMessage instance using the specified properties. + * EphemeralSetting timestamp. + * @member {number|Long} timestamp + * @memberof proto.EphemeralSetting + * @instance + */ + EphemeralSetting.prototype.timestamp = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new EphemeralSetting instance using the specified properties. * @function create - * @memberof proto.DeclinePaymentRequestMessage + * @memberof proto.EphemeralSetting * @static - * @param {proto.IDeclinePaymentRequestMessage=} [properties] Properties to set - * @returns {proto.DeclinePaymentRequestMessage} DeclinePaymentRequestMessage instance + * @param {proto.IEphemeralSetting=} [properties] Properties to set + * @returns {proto.EphemeralSetting} EphemeralSetting instance */ - DeclinePaymentRequestMessage.create = function create(properties) { - return new DeclinePaymentRequestMessage(properties); + EphemeralSetting.create = function create(properties) { + return new EphemeralSetting(properties); }; /** - * Encodes the specified DeclinePaymentRequestMessage message. Does not implicitly {@link proto.DeclinePaymentRequestMessage.verify|verify} messages. + * Encodes the specified EphemeralSetting message. Does not implicitly {@link proto.EphemeralSetting.verify|verify} messages. * @function encode - * @memberof proto.DeclinePaymentRequestMessage + * @memberof proto.EphemeralSetting * @static - * @param {proto.IDeclinePaymentRequestMessage} message DeclinePaymentRequestMessage message or plain object to encode + * @param {proto.IEphemeralSetting} message EphemeralSetting message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeclinePaymentRequestMessage.encode = function encode(message, writer) { + EphemeralSetting.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.key != null && Object.hasOwnProperty.call(message, "key")) - $root.proto.MessageKey.encode(message.key, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.duration != null && Object.hasOwnProperty.call(message, "duration")) + writer.uint32(/* id 1, wireType 5 =*/13).sfixed32(message.duration); + if (message.timestamp != null && Object.hasOwnProperty.call(message, "timestamp")) + writer.uint32(/* id 2, wireType 1 =*/17).sfixed64(message.timestamp); return writer; }; /** - * Encodes the specified DeclinePaymentRequestMessage message, length delimited. Does not implicitly {@link proto.DeclinePaymentRequestMessage.verify|verify} messages. + * Encodes the specified EphemeralSetting message, length delimited. Does not implicitly {@link proto.EphemeralSetting.verify|verify} messages. * @function encodeDelimited - * @memberof proto.DeclinePaymentRequestMessage + * @memberof proto.EphemeralSetting * @static - * @param {proto.IDeclinePaymentRequestMessage} message DeclinePaymentRequestMessage message or plain object to encode + * @param {proto.IEphemeralSetting} message EphemeralSetting message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeclinePaymentRequestMessage.encodeDelimited = function encodeDelimited(message, writer) { + EphemeralSetting.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a DeclinePaymentRequestMessage message from the specified reader or buffer. + * Decodes an EphemeralSetting message from the specified reader or buffer. * @function decode - * @memberof proto.DeclinePaymentRequestMessage + * @memberof proto.EphemeralSetting * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {proto.DeclinePaymentRequestMessage} DeclinePaymentRequestMessage + * @returns {proto.EphemeralSetting} EphemeralSetting * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DeclinePaymentRequestMessage.decode = function decode(reader, length) { + EphemeralSetting.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.DeclinePaymentRequestMessage(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.EphemeralSetting(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.key = $root.proto.MessageKey.decode(reader, reader.uint32()); + message.duration = reader.sfixed32(); + break; + case 2: + message.timestamp = reader.sfixed64(); break; default: reader.skipType(tag & 7); @@ -33896,112 +34162,133 @@ $root.proto = (function() { }; /** - * Decodes a DeclinePaymentRequestMessage message from the specified reader or buffer, length delimited. + * Decodes an EphemeralSetting message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof proto.DeclinePaymentRequestMessage + * @memberof proto.EphemeralSetting * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.DeclinePaymentRequestMessage} DeclinePaymentRequestMessage + * @returns {proto.EphemeralSetting} EphemeralSetting * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DeclinePaymentRequestMessage.decodeDelimited = function decodeDelimited(reader) { + EphemeralSetting.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a DeclinePaymentRequestMessage message. + * Verifies an EphemeralSetting message. * @function verify - * @memberof proto.DeclinePaymentRequestMessage + * @memberof proto.EphemeralSetting * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - DeclinePaymentRequestMessage.verify = function verify(message) { + EphemeralSetting.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.key != null && message.hasOwnProperty("key")) { - var error = $root.proto.MessageKey.verify(message.key); - if (error) - return "key." + error; - } + if (message.duration != null && message.hasOwnProperty("duration")) + if (!$util.isInteger(message.duration)) + return "duration: integer expected"; + if (message.timestamp != null && message.hasOwnProperty("timestamp")) + if (!$util.isInteger(message.timestamp) && !(message.timestamp && $util.isInteger(message.timestamp.low) && $util.isInteger(message.timestamp.high))) + return "timestamp: integer|Long expected"; return null; }; /** - * Creates a DeclinePaymentRequestMessage message from a plain object. Also converts values to their respective internal types. + * Creates an EphemeralSetting message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof proto.DeclinePaymentRequestMessage + * @memberof proto.EphemeralSetting * @static * @param {Object.} object Plain object - * @returns {proto.DeclinePaymentRequestMessage} DeclinePaymentRequestMessage + * @returns {proto.EphemeralSetting} EphemeralSetting */ - DeclinePaymentRequestMessage.fromObject = function fromObject(object) { - if (object instanceof $root.proto.DeclinePaymentRequestMessage) + EphemeralSetting.fromObject = function fromObject(object) { + if (object instanceof $root.proto.EphemeralSetting) return object; - var message = new $root.proto.DeclinePaymentRequestMessage(); - if (object.key != null) { - if (typeof object.key !== "object") - throw TypeError(".proto.DeclinePaymentRequestMessage.key: object expected"); - message.key = $root.proto.MessageKey.fromObject(object.key); - } + var message = new $root.proto.EphemeralSetting(); + if (object.duration != null) + message.duration = object.duration | 0; + if (object.timestamp != null) + if ($util.Long) + (message.timestamp = $util.Long.fromValue(object.timestamp)).unsigned = false; + else if (typeof object.timestamp === "string") + message.timestamp = parseInt(object.timestamp, 10); + else if (typeof object.timestamp === "number") + message.timestamp = object.timestamp; + else if (typeof object.timestamp === "object") + message.timestamp = new $util.LongBits(object.timestamp.low >>> 0, object.timestamp.high >>> 0).toNumber(); return message; }; /** - * Creates a plain object from a DeclinePaymentRequestMessage message. Also converts values to other types if specified. + * Creates a plain object from an EphemeralSetting message. Also converts values to other types if specified. * @function toObject - * @memberof proto.DeclinePaymentRequestMessage + * @memberof proto.EphemeralSetting * @static - * @param {proto.DeclinePaymentRequestMessage} message DeclinePaymentRequestMessage + * @param {proto.EphemeralSetting} message EphemeralSetting * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DeclinePaymentRequestMessage.toObject = function toObject(message, options) { + EphemeralSetting.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) - object.key = null; - if (message.key != null && message.hasOwnProperty("key")) - object.key = $root.proto.MessageKey.toObject(message.key, options); + if (options.defaults) { + object.duration = 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.timestamp = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.timestamp = options.longs === String ? "0" : 0; + } + if (message.duration != null && message.hasOwnProperty("duration")) + object.duration = message.duration; + if (message.timestamp != null && message.hasOwnProperty("timestamp")) + if (typeof message.timestamp === "number") + object.timestamp = options.longs === String ? String(message.timestamp) : message.timestamp; + else + object.timestamp = options.longs === String ? $util.Long.prototype.toString.call(message.timestamp) : options.longs === Number ? new $util.LongBits(message.timestamp.low >>> 0, message.timestamp.high >>> 0).toNumber() : message.timestamp; return object; }; /** - * Converts this DeclinePaymentRequestMessage to JSON. + * Converts this EphemeralSetting to JSON. * @function toJSON - * @memberof proto.DeclinePaymentRequestMessage + * @memberof proto.EphemeralSetting * @instance * @returns {Object.} JSON object */ - DeclinePaymentRequestMessage.prototype.toJSON = function toJSON() { + EphemeralSetting.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return DeclinePaymentRequestMessage; + return EphemeralSetting; })(); - proto.CancelPaymentRequestMessage = (function() { + proto.AutoDownloadSettings = (function() { /** - * Properties of a CancelPaymentRequestMessage. + * Properties of an AutoDownloadSettings. * @memberof proto - * @interface ICancelPaymentRequestMessage - * @property {proto.IMessageKey|null} [key] CancelPaymentRequestMessage key + * @interface IAutoDownloadSettings + * @property {boolean|null} [downloadImages] AutoDownloadSettings downloadImages + * @property {boolean|null} [downloadAudio] AutoDownloadSettings downloadAudio + * @property {boolean|null} [downloadVideo] AutoDownloadSettings downloadVideo + * @property {boolean|null} [downloadDocuments] AutoDownloadSettings downloadDocuments */ /** - * Constructs a new CancelPaymentRequestMessage. + * Constructs a new AutoDownloadSettings. * @memberof proto - * @classdesc Represents a CancelPaymentRequestMessage. - * @implements ICancelPaymentRequestMessage + * @classdesc Represents an AutoDownloadSettings. + * @implements IAutoDownloadSettings * @constructor - * @param {proto.ICancelPaymentRequestMessage=} [properties] Properties to set + * @param {proto.IAutoDownloadSettings=} [properties] Properties to set */ - function CancelPaymentRequestMessage(properties) { + function AutoDownloadSettings(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -34009,75 +34296,114 @@ $root.proto = (function() { } /** - * CancelPaymentRequestMessage key. - * @member {proto.IMessageKey|null|undefined} key - * @memberof proto.CancelPaymentRequestMessage + * AutoDownloadSettings downloadImages. + * @member {boolean} downloadImages + * @memberof proto.AutoDownloadSettings * @instance */ - CancelPaymentRequestMessage.prototype.key = null; + AutoDownloadSettings.prototype.downloadImages = false; /** - * Creates a new CancelPaymentRequestMessage instance using the specified properties. + * AutoDownloadSettings downloadAudio. + * @member {boolean} downloadAudio + * @memberof proto.AutoDownloadSettings + * @instance + */ + AutoDownloadSettings.prototype.downloadAudio = false; + + /** + * AutoDownloadSettings downloadVideo. + * @member {boolean} downloadVideo + * @memberof proto.AutoDownloadSettings + * @instance + */ + AutoDownloadSettings.prototype.downloadVideo = false; + + /** + * AutoDownloadSettings downloadDocuments. + * @member {boolean} downloadDocuments + * @memberof proto.AutoDownloadSettings + * @instance + */ + AutoDownloadSettings.prototype.downloadDocuments = false; + + /** + * Creates a new AutoDownloadSettings instance using the specified properties. * @function create - * @memberof proto.CancelPaymentRequestMessage + * @memberof proto.AutoDownloadSettings * @static - * @param {proto.ICancelPaymentRequestMessage=} [properties] Properties to set - * @returns {proto.CancelPaymentRequestMessage} CancelPaymentRequestMessage instance + * @param {proto.IAutoDownloadSettings=} [properties] Properties to set + * @returns {proto.AutoDownloadSettings} AutoDownloadSettings instance */ - CancelPaymentRequestMessage.create = function create(properties) { - return new CancelPaymentRequestMessage(properties); + AutoDownloadSettings.create = function create(properties) { + return new AutoDownloadSettings(properties); }; /** - * Encodes the specified CancelPaymentRequestMessage message. Does not implicitly {@link proto.CancelPaymentRequestMessage.verify|verify} messages. + * Encodes the specified AutoDownloadSettings message. Does not implicitly {@link proto.AutoDownloadSettings.verify|verify} messages. * @function encode - * @memberof proto.CancelPaymentRequestMessage + * @memberof proto.AutoDownloadSettings * @static - * @param {proto.ICancelPaymentRequestMessage} message CancelPaymentRequestMessage message or plain object to encode + * @param {proto.IAutoDownloadSettings} message AutoDownloadSettings message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CancelPaymentRequestMessage.encode = function encode(message, writer) { + AutoDownloadSettings.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.key != null && Object.hasOwnProperty.call(message, "key")) - $root.proto.MessageKey.encode(message.key, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.downloadImages != null && Object.hasOwnProperty.call(message, "downloadImages")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.downloadImages); + if (message.downloadAudio != null && Object.hasOwnProperty.call(message, "downloadAudio")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.downloadAudio); + if (message.downloadVideo != null && Object.hasOwnProperty.call(message, "downloadVideo")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.downloadVideo); + if (message.downloadDocuments != null && Object.hasOwnProperty.call(message, "downloadDocuments")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.downloadDocuments); return writer; }; /** - * Encodes the specified CancelPaymentRequestMessage message, length delimited. Does not implicitly {@link proto.CancelPaymentRequestMessage.verify|verify} messages. + * Encodes the specified AutoDownloadSettings message, length delimited. Does not implicitly {@link proto.AutoDownloadSettings.verify|verify} messages. * @function encodeDelimited - * @memberof proto.CancelPaymentRequestMessage + * @memberof proto.AutoDownloadSettings * @static - * @param {proto.ICancelPaymentRequestMessage} message CancelPaymentRequestMessage message or plain object to encode + * @param {proto.IAutoDownloadSettings} message AutoDownloadSettings message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CancelPaymentRequestMessage.encodeDelimited = function encodeDelimited(message, writer) { + AutoDownloadSettings.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a CancelPaymentRequestMessage message from the specified reader or buffer. + * Decodes an AutoDownloadSettings message from the specified reader or buffer. * @function decode - * @memberof proto.CancelPaymentRequestMessage + * @memberof proto.AutoDownloadSettings * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {proto.CancelPaymentRequestMessage} CancelPaymentRequestMessage + * @returns {proto.AutoDownloadSettings} AutoDownloadSettings * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CancelPaymentRequestMessage.decode = function decode(reader, length) { + AutoDownloadSettings.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.CancelPaymentRequestMessage(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.AutoDownloadSettings(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.key = $root.proto.MessageKey.decode(reader, reader.uint32()); + message.downloadImages = reader.bool(); + break; + case 2: + message.downloadAudio = reader.bool(); + break; + case 3: + message.downloadVideo = reader.bool(); + break; + case 4: + message.downloadDocuments = reader.bool(); break; default: reader.skipType(tag & 7); @@ -34088,113 +34414,162 @@ $root.proto = (function() { }; /** - * Decodes a CancelPaymentRequestMessage message from the specified reader or buffer, length delimited. + * Decodes an AutoDownloadSettings message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof proto.CancelPaymentRequestMessage + * @memberof proto.AutoDownloadSettings * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.CancelPaymentRequestMessage} CancelPaymentRequestMessage + * @returns {proto.AutoDownloadSettings} AutoDownloadSettings * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CancelPaymentRequestMessage.decodeDelimited = function decodeDelimited(reader) { + AutoDownloadSettings.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a CancelPaymentRequestMessage message. + * Verifies an AutoDownloadSettings message. * @function verify - * @memberof proto.CancelPaymentRequestMessage + * @memberof proto.AutoDownloadSettings * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - CancelPaymentRequestMessage.verify = function verify(message) { + AutoDownloadSettings.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.key != null && message.hasOwnProperty("key")) { - var error = $root.proto.MessageKey.verify(message.key); - if (error) - return "key." + error; - } + if (message.downloadImages != null && message.hasOwnProperty("downloadImages")) + if (typeof message.downloadImages !== "boolean") + return "downloadImages: boolean expected"; + if (message.downloadAudio != null && message.hasOwnProperty("downloadAudio")) + if (typeof message.downloadAudio !== "boolean") + return "downloadAudio: boolean expected"; + if (message.downloadVideo != null && message.hasOwnProperty("downloadVideo")) + if (typeof message.downloadVideo !== "boolean") + return "downloadVideo: boolean expected"; + if (message.downloadDocuments != null && message.hasOwnProperty("downloadDocuments")) + if (typeof message.downloadDocuments !== "boolean") + return "downloadDocuments: boolean expected"; return null; }; /** - * Creates a CancelPaymentRequestMessage message from a plain object. Also converts values to their respective internal types. + * Creates an AutoDownloadSettings message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof proto.CancelPaymentRequestMessage + * @memberof proto.AutoDownloadSettings * @static * @param {Object.} object Plain object - * @returns {proto.CancelPaymentRequestMessage} CancelPaymentRequestMessage + * @returns {proto.AutoDownloadSettings} AutoDownloadSettings */ - CancelPaymentRequestMessage.fromObject = function fromObject(object) { - if (object instanceof $root.proto.CancelPaymentRequestMessage) + AutoDownloadSettings.fromObject = function fromObject(object) { + if (object instanceof $root.proto.AutoDownloadSettings) return object; - var message = new $root.proto.CancelPaymentRequestMessage(); - if (object.key != null) { - if (typeof object.key !== "object") - throw TypeError(".proto.CancelPaymentRequestMessage.key: object expected"); - message.key = $root.proto.MessageKey.fromObject(object.key); - } + var message = new $root.proto.AutoDownloadSettings(); + if (object.downloadImages != null) + message.downloadImages = Boolean(object.downloadImages); + if (object.downloadAudio != null) + message.downloadAudio = Boolean(object.downloadAudio); + if (object.downloadVideo != null) + message.downloadVideo = Boolean(object.downloadVideo); + if (object.downloadDocuments != null) + message.downloadDocuments = Boolean(object.downloadDocuments); return message; }; /** - * Creates a plain object from a CancelPaymentRequestMessage message. Also converts values to other types if specified. + * Creates a plain object from an AutoDownloadSettings message. Also converts values to other types if specified. * @function toObject - * @memberof proto.CancelPaymentRequestMessage + * @memberof proto.AutoDownloadSettings * @static - * @param {proto.CancelPaymentRequestMessage} message CancelPaymentRequestMessage + * @param {proto.AutoDownloadSettings} message AutoDownloadSettings * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CancelPaymentRequestMessage.toObject = function toObject(message, options) { + AutoDownloadSettings.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) - object.key = null; - if (message.key != null && message.hasOwnProperty("key")) - object.key = $root.proto.MessageKey.toObject(message.key, options); + if (options.defaults) { + object.downloadImages = false; + object.downloadAudio = false; + object.downloadVideo = false; + object.downloadDocuments = false; + } + if (message.downloadImages != null && message.hasOwnProperty("downloadImages")) + object.downloadImages = message.downloadImages; + if (message.downloadAudio != null && message.hasOwnProperty("downloadAudio")) + object.downloadAudio = message.downloadAudio; + if (message.downloadVideo != null && message.hasOwnProperty("downloadVideo")) + object.downloadVideo = message.downloadVideo; + if (message.downloadDocuments != null && message.hasOwnProperty("downloadDocuments")) + object.downloadDocuments = message.downloadDocuments; return object; }; /** - * Converts this CancelPaymentRequestMessage to JSON. + * Converts this AutoDownloadSettings to JSON. * @function toJSON - * @memberof proto.CancelPaymentRequestMessage + * @memberof proto.AutoDownloadSettings * @instance * @returns {Object.} JSON object */ - CancelPaymentRequestMessage.prototype.toJSON = function toJSON() { + AutoDownloadSettings.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return CancelPaymentRequestMessage; + return AutoDownloadSettings; })(); - proto.PaymentInviteMessage = (function() { + proto.Conversation = (function() { /** - * Properties of a PaymentInviteMessage. + * Properties of a Conversation. * @memberof proto - * @interface IPaymentInviteMessage - * @property {proto.PaymentInviteMessage.PaymentInviteMessageServiceType|null} [serviceType] PaymentInviteMessage serviceType - * @property {number|Long|null} [expiryTimestamp] PaymentInviteMessage expiryTimestamp + * @interface IConversation + * @property {string} id Conversation id + * @property {Array.|null} [messages] Conversation messages + * @property {string|null} [newJid] Conversation newJid + * @property {string|null} [oldJid] Conversation oldJid + * @property {number|Long|null} [lastMsgTimestamp] Conversation lastMsgTimestamp + * @property {number|null} [unreadCount] Conversation unreadCount + * @property {boolean|null} [readOnly] Conversation readOnly + * @property {boolean|null} [endOfHistoryTransfer] Conversation endOfHistoryTransfer + * @property {number|null} [ephemeralExpiration] Conversation ephemeralExpiration + * @property {number|Long|null} [ephemeralSettingTimestamp] Conversation ephemeralSettingTimestamp + * @property {proto.Conversation.ConversationEndOfHistoryTransferType|null} [endOfHistoryTransferType] Conversation endOfHistoryTransferType + * @property {number|Long|null} [conversationTimestamp] Conversation conversationTimestamp + * @property {string|null} [name] Conversation name + * @property {string|null} [pHash] Conversation pHash + * @property {boolean|null} [notSpam] Conversation notSpam + * @property {boolean|null} [archived] Conversation archived + * @property {proto.IDisappearingMode|null} [disappearingMode] Conversation disappearingMode + * @property {number|null} [unreadMentionCount] Conversation unreadMentionCount + * @property {boolean|null} [markedAsUnread] Conversation markedAsUnread + * @property {Array.|null} [participant] Conversation participant + * @property {Uint8Array|null} [tcToken] Conversation tcToken + * @property {number|Long|null} [tcTokenTimestamp] Conversation tcTokenTimestamp + * @property {Uint8Array|null} [contactPrimaryIdentityKey] Conversation contactPrimaryIdentityKey + * @property {number|null} [pinned] Conversation pinned + * @property {number|Long|null} [muteEndTime] Conversation muteEndTime + * @property {proto.IWallpaperSettings|null} [wallpaper] Conversation wallpaper + * @property {proto.MediaVisibility|null} [mediaVisibility] Conversation mediaVisibility + * @property {number|Long|null} [tcTokenSenderTimestamp] Conversation tcTokenSenderTimestamp + * @property {boolean|null} [suspended] Conversation suspended */ /** - * Constructs a new PaymentInviteMessage. + * Constructs a new Conversation. * @memberof proto - * @classdesc Represents a PaymentInviteMessage. - * @implements IPaymentInviteMessage + * @classdesc Represents a Conversation. + * @implements IConversation * @constructor - * @param {proto.IPaymentInviteMessage=} [properties] Properties to set + * @param {proto.IConversation=} [properties] Properties to set */ - function PaymentInviteMessage(properties) { + function Conversation(properties) { + this.messages = []; + this.participant = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -34202,691 +34577,981 @@ $root.proto = (function() { } /** - * PaymentInviteMessage serviceType. - * @member {proto.PaymentInviteMessage.PaymentInviteMessageServiceType} serviceType - * @memberof proto.PaymentInviteMessage + * Conversation id. + * @member {string} id + * @memberof proto.Conversation * @instance */ - PaymentInviteMessage.prototype.serviceType = 0; + Conversation.prototype.id = ""; /** - * PaymentInviteMessage expiryTimestamp. - * @member {number|Long} expiryTimestamp - * @memberof proto.PaymentInviteMessage + * Conversation messages. + * @member {Array.} messages + * @memberof proto.Conversation * @instance */ - PaymentInviteMessage.prototype.expiryTimestamp = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + Conversation.prototype.messages = $util.emptyArray; /** - * Creates a new PaymentInviteMessage instance using the specified properties. - * @function create - * @memberof proto.PaymentInviteMessage - * @static - * @param {proto.IPaymentInviteMessage=} [properties] Properties to set - * @returns {proto.PaymentInviteMessage} PaymentInviteMessage instance + * Conversation newJid. + * @member {string} newJid + * @memberof proto.Conversation + * @instance */ - PaymentInviteMessage.create = function create(properties) { - return new PaymentInviteMessage(properties); - }; + Conversation.prototype.newJid = ""; /** - * Encodes the specified PaymentInviteMessage message. Does not implicitly {@link proto.PaymentInviteMessage.verify|verify} messages. - * @function encode - * @memberof proto.PaymentInviteMessage - * @static - * @param {proto.IPaymentInviteMessage} message PaymentInviteMessage message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * Conversation oldJid. + * @member {string} oldJid + * @memberof proto.Conversation + * @instance */ - PaymentInviteMessage.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.serviceType != null && Object.hasOwnProperty.call(message, "serviceType")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.serviceType); - if (message.expiryTimestamp != null && Object.hasOwnProperty.call(message, "expiryTimestamp")) - writer.uint32(/* id 2, wireType 0 =*/16).int64(message.expiryTimestamp); - return writer; - }; + Conversation.prototype.oldJid = ""; /** - * Encodes the specified PaymentInviteMessage message, length delimited. Does not implicitly {@link proto.PaymentInviteMessage.verify|verify} messages. - * @function encodeDelimited - * @memberof proto.PaymentInviteMessage - * @static - * @param {proto.IPaymentInviteMessage} message PaymentInviteMessage message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * Conversation lastMsgTimestamp. + * @member {number|Long} lastMsgTimestamp + * @memberof proto.Conversation + * @instance */ - PaymentInviteMessage.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + Conversation.prototype.lastMsgTimestamp = $util.Long ? $util.Long.fromBits(0,0,true) : 0; /** - * Decodes a PaymentInviteMessage message from the specified reader or buffer. - * @function decode - * @memberof proto.PaymentInviteMessage - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {proto.PaymentInviteMessage} PaymentInviteMessage - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Conversation unreadCount. + * @member {number} unreadCount + * @memberof proto.Conversation + * @instance */ - PaymentInviteMessage.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.PaymentInviteMessage(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.serviceType = reader.int32(); - break; - case 2: - message.expiryTimestamp = reader.int64(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + Conversation.prototype.unreadCount = 0; /** - * Decodes a PaymentInviteMessage message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof proto.PaymentInviteMessage - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.PaymentInviteMessage} PaymentInviteMessage - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Conversation readOnly. + * @member {boolean} readOnly + * @memberof proto.Conversation + * @instance */ - PaymentInviteMessage.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + Conversation.prototype.readOnly = false; /** - * Verifies a PaymentInviteMessage message. - * @function verify - * @memberof proto.PaymentInviteMessage - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not + * Conversation endOfHistoryTransfer. + * @member {boolean} endOfHistoryTransfer + * @memberof proto.Conversation + * @instance */ - PaymentInviteMessage.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.serviceType != null && message.hasOwnProperty("serviceType")) - switch (message.serviceType) { - default: - return "serviceType: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.expiryTimestamp != null && message.hasOwnProperty("expiryTimestamp")) - if (!$util.isInteger(message.expiryTimestamp) && !(message.expiryTimestamp && $util.isInteger(message.expiryTimestamp.low) && $util.isInteger(message.expiryTimestamp.high))) - return "expiryTimestamp: integer|Long expected"; - return null; - }; + Conversation.prototype.endOfHistoryTransfer = false; /** - * Creates a PaymentInviteMessage message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof proto.PaymentInviteMessage - * @static - * @param {Object.} object Plain object - * @returns {proto.PaymentInviteMessage} PaymentInviteMessage + * Conversation ephemeralExpiration. + * @member {number} ephemeralExpiration + * @memberof proto.Conversation + * @instance */ - PaymentInviteMessage.fromObject = function fromObject(object) { - if (object instanceof $root.proto.PaymentInviteMessage) - return object; - var message = new $root.proto.PaymentInviteMessage(); - switch (object.serviceType) { - case "UNKNOWN": - case 0: - message.serviceType = 0; - break; - case "FBPAY": - case 1: - message.serviceType = 1; - break; - case "NOVI": - case 2: - message.serviceType = 2; - break; - case "UPI": - case 3: - message.serviceType = 3; - break; - } - if (object.expiryTimestamp != null) - if ($util.Long) - (message.expiryTimestamp = $util.Long.fromValue(object.expiryTimestamp)).unsigned = false; - else if (typeof object.expiryTimestamp === "string") - message.expiryTimestamp = parseInt(object.expiryTimestamp, 10); - else if (typeof object.expiryTimestamp === "number") - message.expiryTimestamp = object.expiryTimestamp; - else if (typeof object.expiryTimestamp === "object") - message.expiryTimestamp = new $util.LongBits(object.expiryTimestamp.low >>> 0, object.expiryTimestamp.high >>> 0).toNumber(); - return message; - }; + Conversation.prototype.ephemeralExpiration = 0; /** - * Creates a plain object from a PaymentInviteMessage message. Also converts values to other types if specified. - * @function toObject - * @memberof proto.PaymentInviteMessage - * @static - * @param {proto.PaymentInviteMessage} message PaymentInviteMessage - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object + * Conversation ephemeralSettingTimestamp. + * @member {number|Long} ephemeralSettingTimestamp + * @memberof proto.Conversation + * @instance */ - PaymentInviteMessage.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.serviceType = options.enums === String ? "UNKNOWN" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.expiryTimestamp = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.expiryTimestamp = options.longs === String ? "0" : 0; - } - if (message.serviceType != null && message.hasOwnProperty("serviceType")) - object.serviceType = options.enums === String ? $root.proto.PaymentInviteMessage.PaymentInviteMessageServiceType[message.serviceType] : message.serviceType; - if (message.expiryTimestamp != null && message.hasOwnProperty("expiryTimestamp")) - if (typeof message.expiryTimestamp === "number") - object.expiryTimestamp = options.longs === String ? String(message.expiryTimestamp) : message.expiryTimestamp; - else - object.expiryTimestamp = options.longs === String ? $util.Long.prototype.toString.call(message.expiryTimestamp) : options.longs === Number ? new $util.LongBits(message.expiryTimestamp.low >>> 0, message.expiryTimestamp.high >>> 0).toNumber() : message.expiryTimestamp; - return object; - }; + Conversation.prototype.ephemeralSettingTimestamp = $util.Long ? $util.Long.fromBits(0,0,false) : 0; /** - * Converts this PaymentInviteMessage to JSON. - * @function toJSON - * @memberof proto.PaymentInviteMessage + * Conversation endOfHistoryTransferType. + * @member {proto.Conversation.ConversationEndOfHistoryTransferType} endOfHistoryTransferType + * @memberof proto.Conversation * @instance - * @returns {Object.} JSON object */ - PaymentInviteMessage.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + Conversation.prototype.endOfHistoryTransferType = 0; /** - * PaymentInviteMessageServiceType enum. - * @name proto.PaymentInviteMessage.PaymentInviteMessageServiceType - * @enum {number} - * @property {number} UNKNOWN=0 UNKNOWN value - * @property {number} FBPAY=1 FBPAY value - * @property {number} NOVI=2 NOVI value - * @property {number} UPI=3 UPI value + * Conversation conversationTimestamp. + * @member {number|Long} conversationTimestamp + * @memberof proto.Conversation + * @instance */ - PaymentInviteMessage.PaymentInviteMessageServiceType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "UNKNOWN"] = 0; - values[valuesById[1] = "FBPAY"] = 1; - values[valuesById[2] = "NOVI"] = 2; - values[valuesById[3] = "UPI"] = 3; - return values; - })(); + Conversation.prototype.conversationTimestamp = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - return PaymentInviteMessage; - })(); + /** + * Conversation name. + * @member {string} name + * @memberof proto.Conversation + * @instance + */ + Conversation.prototype.name = ""; - proto.LiveLocationMessage = (function() { + /** + * Conversation pHash. + * @member {string} pHash + * @memberof proto.Conversation + * @instance + */ + Conversation.prototype.pHash = ""; /** - * Properties of a LiveLocationMessage. - * @memberof proto - * @interface ILiveLocationMessage - * @property {number|null} [degreesLatitude] LiveLocationMessage degreesLatitude - * @property {number|null} [degreesLongitude] LiveLocationMessage degreesLongitude - * @property {number|null} [accuracyInMeters] LiveLocationMessage accuracyInMeters - * @property {number|null} [speedInMps] LiveLocationMessage speedInMps - * @property {number|null} [degreesClockwiseFromMagneticNorth] LiveLocationMessage degreesClockwiseFromMagneticNorth - * @property {string|null} [caption] LiveLocationMessage caption - * @property {number|Long|null} [sequenceNumber] LiveLocationMessage sequenceNumber - * @property {number|null} [timeOffset] LiveLocationMessage timeOffset - * @property {Uint8Array|null} [jpegThumbnail] LiveLocationMessage jpegThumbnail - * @property {proto.IContextInfo|null} [contextInfo] LiveLocationMessage contextInfo + * Conversation notSpam. + * @member {boolean} notSpam + * @memberof proto.Conversation + * @instance */ + Conversation.prototype.notSpam = false; /** - * Constructs a new LiveLocationMessage. - * @memberof proto - * @classdesc Represents a LiveLocationMessage. - * @implements ILiveLocationMessage - * @constructor - * @param {proto.ILiveLocationMessage=} [properties] Properties to set + * Conversation archived. + * @member {boolean} archived + * @memberof proto.Conversation + * @instance */ - function LiveLocationMessage(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + Conversation.prototype.archived = false; /** - * LiveLocationMessage degreesLatitude. - * @member {number} degreesLatitude - * @memberof proto.LiveLocationMessage + * Conversation disappearingMode. + * @member {proto.IDisappearingMode|null|undefined} disappearingMode + * @memberof proto.Conversation * @instance */ - LiveLocationMessage.prototype.degreesLatitude = 0; + Conversation.prototype.disappearingMode = null; /** - * LiveLocationMessage degreesLongitude. - * @member {number} degreesLongitude - * @memberof proto.LiveLocationMessage + * Conversation unreadMentionCount. + * @member {number} unreadMentionCount + * @memberof proto.Conversation * @instance */ - LiveLocationMessage.prototype.degreesLongitude = 0; + Conversation.prototype.unreadMentionCount = 0; /** - * LiveLocationMessage accuracyInMeters. - * @member {number} accuracyInMeters - * @memberof proto.LiveLocationMessage + * Conversation markedAsUnread. + * @member {boolean} markedAsUnread + * @memberof proto.Conversation * @instance */ - LiveLocationMessage.prototype.accuracyInMeters = 0; + Conversation.prototype.markedAsUnread = false; /** - * LiveLocationMessage speedInMps. - * @member {number} speedInMps - * @memberof proto.LiveLocationMessage + * Conversation participant. + * @member {Array.} participant + * @memberof proto.Conversation * @instance */ - LiveLocationMessage.prototype.speedInMps = 0; + Conversation.prototype.participant = $util.emptyArray; /** - * LiveLocationMessage degreesClockwiseFromMagneticNorth. - * @member {number} degreesClockwiseFromMagneticNorth - * @memberof proto.LiveLocationMessage + * Conversation tcToken. + * @member {Uint8Array} tcToken + * @memberof proto.Conversation * @instance */ - LiveLocationMessage.prototype.degreesClockwiseFromMagneticNorth = 0; + Conversation.prototype.tcToken = $util.newBuffer([]); /** - * LiveLocationMessage caption. - * @member {string} caption - * @memberof proto.LiveLocationMessage + * Conversation tcTokenTimestamp. + * @member {number|Long} tcTokenTimestamp + * @memberof proto.Conversation * @instance */ - LiveLocationMessage.prototype.caption = ""; + Conversation.prototype.tcTokenTimestamp = $util.Long ? $util.Long.fromBits(0,0,true) : 0; /** - * LiveLocationMessage sequenceNumber. - * @member {number|Long} sequenceNumber - * @memberof proto.LiveLocationMessage + * Conversation contactPrimaryIdentityKey. + * @member {Uint8Array} contactPrimaryIdentityKey + * @memberof proto.Conversation * @instance */ - LiveLocationMessage.prototype.sequenceNumber = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + Conversation.prototype.contactPrimaryIdentityKey = $util.newBuffer([]); /** - * LiveLocationMessage timeOffset. - * @member {number} timeOffset - * @memberof proto.LiveLocationMessage + * Conversation pinned. + * @member {number} pinned + * @memberof proto.Conversation * @instance */ - LiveLocationMessage.prototype.timeOffset = 0; + Conversation.prototype.pinned = 0; /** - * LiveLocationMessage jpegThumbnail. - * @member {Uint8Array} jpegThumbnail - * @memberof proto.LiveLocationMessage + * Conversation muteEndTime. + * @member {number|Long} muteEndTime + * @memberof proto.Conversation * @instance */ - LiveLocationMessage.prototype.jpegThumbnail = $util.newBuffer([]); + Conversation.prototype.muteEndTime = $util.Long ? $util.Long.fromBits(0,0,true) : 0; /** - * LiveLocationMessage contextInfo. - * @member {proto.IContextInfo|null|undefined} contextInfo - * @memberof proto.LiveLocationMessage + * Conversation wallpaper. + * @member {proto.IWallpaperSettings|null|undefined} wallpaper + * @memberof proto.Conversation * @instance */ - LiveLocationMessage.prototype.contextInfo = null; + Conversation.prototype.wallpaper = null; /** - * Creates a new LiveLocationMessage instance using the specified properties. + * Conversation mediaVisibility. + * @member {proto.MediaVisibility} mediaVisibility + * @memberof proto.Conversation + * @instance + */ + Conversation.prototype.mediaVisibility = 0; + + /** + * Conversation tcTokenSenderTimestamp. + * @member {number|Long} tcTokenSenderTimestamp + * @memberof proto.Conversation + * @instance + */ + Conversation.prototype.tcTokenSenderTimestamp = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Conversation suspended. + * @member {boolean} suspended + * @memberof proto.Conversation + * @instance + */ + Conversation.prototype.suspended = false; + + /** + * Creates a new Conversation instance using the specified properties. * @function create - * @memberof proto.LiveLocationMessage + * @memberof proto.Conversation * @static - * @param {proto.ILiveLocationMessage=} [properties] Properties to set - * @returns {proto.LiveLocationMessage} LiveLocationMessage instance + * @param {proto.IConversation=} [properties] Properties to set + * @returns {proto.Conversation} Conversation instance */ - LiveLocationMessage.create = function create(properties) { - return new LiveLocationMessage(properties); + Conversation.create = function create(properties) { + return new Conversation(properties); }; /** - * Encodes the specified LiveLocationMessage message. Does not implicitly {@link proto.LiveLocationMessage.verify|verify} messages. + * Encodes the specified Conversation message. Does not implicitly {@link proto.Conversation.verify|verify} messages. * @function encode - * @memberof proto.LiveLocationMessage + * @memberof proto.Conversation * @static - * @param {proto.ILiveLocationMessage} message LiveLocationMessage message or plain object to encode + * @param {proto.IConversation} message Conversation message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - LiveLocationMessage.encode = function encode(message, writer) { + Conversation.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.degreesLatitude != null && Object.hasOwnProperty.call(message, "degreesLatitude")) - writer.uint32(/* id 1, wireType 1 =*/9).double(message.degreesLatitude); - if (message.degreesLongitude != null && Object.hasOwnProperty.call(message, "degreesLongitude")) - writer.uint32(/* id 2, wireType 1 =*/17).double(message.degreesLongitude); - if (message.accuracyInMeters != null && Object.hasOwnProperty.call(message, "accuracyInMeters")) - writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.accuracyInMeters); - if (message.speedInMps != null && Object.hasOwnProperty.call(message, "speedInMps")) - writer.uint32(/* id 4, wireType 5 =*/37).float(message.speedInMps); - if (message.degreesClockwiseFromMagneticNorth != null && Object.hasOwnProperty.call(message, "degreesClockwiseFromMagneticNorth")) - writer.uint32(/* id 5, wireType 0 =*/40).uint32(message.degreesClockwiseFromMagneticNorth); - if (message.caption != null && Object.hasOwnProperty.call(message, "caption")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.caption); - if (message.sequenceNumber != null && Object.hasOwnProperty.call(message, "sequenceNumber")) - writer.uint32(/* id 7, wireType 0 =*/56).int64(message.sequenceNumber); - if (message.timeOffset != null && Object.hasOwnProperty.call(message, "timeOffset")) - writer.uint32(/* id 8, wireType 0 =*/64).uint32(message.timeOffset); - if (message.jpegThumbnail != null && Object.hasOwnProperty.call(message, "jpegThumbnail")) - writer.uint32(/* id 16, wireType 2 =*/130).bytes(message.jpegThumbnail); - if (message.contextInfo != null && Object.hasOwnProperty.call(message, "contextInfo")) - $root.proto.ContextInfo.encode(message.contextInfo, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); + writer.uint32(/* id 1, wireType 2 =*/10).string(message.id); + if (message.messages != null && message.messages.length) + for (var i = 0; i < message.messages.length; ++i) + $root.proto.HistorySyncMsg.encode(message.messages[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.newJid != null && Object.hasOwnProperty.call(message, "newJid")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.newJid); + if (message.oldJid != null && Object.hasOwnProperty.call(message, "oldJid")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.oldJid); + if (message.lastMsgTimestamp != null && Object.hasOwnProperty.call(message, "lastMsgTimestamp")) + writer.uint32(/* id 5, wireType 0 =*/40).uint64(message.lastMsgTimestamp); + if (message.unreadCount != null && Object.hasOwnProperty.call(message, "unreadCount")) + writer.uint32(/* id 6, wireType 0 =*/48).uint32(message.unreadCount); + if (message.readOnly != null && Object.hasOwnProperty.call(message, "readOnly")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.readOnly); + if (message.endOfHistoryTransfer != null && Object.hasOwnProperty.call(message, "endOfHistoryTransfer")) + writer.uint32(/* id 8, wireType 0 =*/64).bool(message.endOfHistoryTransfer); + if (message.ephemeralExpiration != null && Object.hasOwnProperty.call(message, "ephemeralExpiration")) + writer.uint32(/* id 9, wireType 0 =*/72).uint32(message.ephemeralExpiration); + if (message.ephemeralSettingTimestamp != null && Object.hasOwnProperty.call(message, "ephemeralSettingTimestamp")) + writer.uint32(/* id 10, wireType 0 =*/80).int64(message.ephemeralSettingTimestamp); + if (message.endOfHistoryTransferType != null && Object.hasOwnProperty.call(message, "endOfHistoryTransferType")) + writer.uint32(/* id 11, wireType 0 =*/88).int32(message.endOfHistoryTransferType); + if (message.conversationTimestamp != null && Object.hasOwnProperty.call(message, "conversationTimestamp")) + writer.uint32(/* id 12, wireType 0 =*/96).uint64(message.conversationTimestamp); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 13, wireType 2 =*/106).string(message.name); + if (message.pHash != null && Object.hasOwnProperty.call(message, "pHash")) + writer.uint32(/* id 14, wireType 2 =*/114).string(message.pHash); + if (message.notSpam != null && Object.hasOwnProperty.call(message, "notSpam")) + writer.uint32(/* id 15, wireType 0 =*/120).bool(message.notSpam); + if (message.archived != null && Object.hasOwnProperty.call(message, "archived")) + writer.uint32(/* id 16, wireType 0 =*/128).bool(message.archived); + if (message.disappearingMode != null && Object.hasOwnProperty.call(message, "disappearingMode")) + $root.proto.DisappearingMode.encode(message.disappearingMode, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); + if (message.unreadMentionCount != null && Object.hasOwnProperty.call(message, "unreadMentionCount")) + writer.uint32(/* id 18, wireType 0 =*/144).uint32(message.unreadMentionCount); + if (message.markedAsUnread != null && Object.hasOwnProperty.call(message, "markedAsUnread")) + writer.uint32(/* id 19, wireType 0 =*/152).bool(message.markedAsUnread); + if (message.participant != null && message.participant.length) + for (var i = 0; i < message.participant.length; ++i) + $root.proto.GroupParticipant.encode(message.participant[i], writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); + if (message.tcToken != null && Object.hasOwnProperty.call(message, "tcToken")) + writer.uint32(/* id 21, wireType 2 =*/170).bytes(message.tcToken); + if (message.tcTokenTimestamp != null && Object.hasOwnProperty.call(message, "tcTokenTimestamp")) + writer.uint32(/* id 22, wireType 0 =*/176).uint64(message.tcTokenTimestamp); + if (message.contactPrimaryIdentityKey != null && Object.hasOwnProperty.call(message, "contactPrimaryIdentityKey")) + writer.uint32(/* id 23, wireType 2 =*/186).bytes(message.contactPrimaryIdentityKey); + if (message.pinned != null && Object.hasOwnProperty.call(message, "pinned")) + writer.uint32(/* id 24, wireType 0 =*/192).uint32(message.pinned); + if (message.muteEndTime != null && Object.hasOwnProperty.call(message, "muteEndTime")) + writer.uint32(/* id 25, wireType 0 =*/200).uint64(message.muteEndTime); + if (message.wallpaper != null && Object.hasOwnProperty.call(message, "wallpaper")) + $root.proto.WallpaperSettings.encode(message.wallpaper, writer.uint32(/* id 26, wireType 2 =*/210).fork()).ldelim(); + if (message.mediaVisibility != null && Object.hasOwnProperty.call(message, "mediaVisibility")) + writer.uint32(/* id 27, wireType 0 =*/216).int32(message.mediaVisibility); + if (message.tcTokenSenderTimestamp != null && Object.hasOwnProperty.call(message, "tcTokenSenderTimestamp")) + writer.uint32(/* id 28, wireType 0 =*/224).uint64(message.tcTokenSenderTimestamp); + if (message.suspended != null && Object.hasOwnProperty.call(message, "suspended")) + writer.uint32(/* id 29, wireType 0 =*/232).bool(message.suspended); return writer; }; /** - * Encodes the specified LiveLocationMessage message, length delimited. Does not implicitly {@link proto.LiveLocationMessage.verify|verify} messages. + * Encodes the specified Conversation message, length delimited. Does not implicitly {@link proto.Conversation.verify|verify} messages. * @function encodeDelimited - * @memberof proto.LiveLocationMessage + * @memberof proto.Conversation * @static - * @param {proto.ILiveLocationMessage} message LiveLocationMessage message or plain object to encode + * @param {proto.IConversation} message Conversation message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - LiveLocationMessage.encodeDelimited = function encodeDelimited(message, writer) { + Conversation.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a LiveLocationMessage message from the specified reader or buffer. + * Decodes a Conversation message from the specified reader or buffer. * @function decode - * @memberof proto.LiveLocationMessage + * @memberof proto.Conversation * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {proto.LiveLocationMessage} LiveLocationMessage + * @returns {proto.Conversation} Conversation * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - LiveLocationMessage.decode = function decode(reader, length) { + Conversation.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.LiveLocationMessage(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.Conversation(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.degreesLatitude = reader.double(); + message.id = reader.string(); break; case 2: - message.degreesLongitude = reader.double(); + if (!(message.messages && message.messages.length)) + message.messages = []; + message.messages.push($root.proto.HistorySyncMsg.decode(reader, reader.uint32())); break; case 3: - message.accuracyInMeters = reader.uint32(); + message.newJid = reader.string(); break; case 4: - message.speedInMps = reader.float(); + message.oldJid = reader.string(); break; case 5: - message.degreesClockwiseFromMagneticNorth = reader.uint32(); + message.lastMsgTimestamp = reader.uint64(); break; case 6: - message.caption = reader.string(); + message.unreadCount = reader.uint32(); break; case 7: - message.sequenceNumber = reader.int64(); + message.readOnly = reader.bool(); break; case 8: - message.timeOffset = reader.uint32(); + message.endOfHistoryTransfer = reader.bool(); + break; + case 9: + message.ephemeralExpiration = reader.uint32(); + break; + case 10: + message.ephemeralSettingTimestamp = reader.int64(); + break; + case 11: + message.endOfHistoryTransferType = reader.int32(); + break; + case 12: + message.conversationTimestamp = reader.uint64(); + break; + case 13: + message.name = reader.string(); + break; + case 14: + message.pHash = reader.string(); + break; + case 15: + message.notSpam = reader.bool(); break; case 16: - message.jpegThumbnail = reader.bytes(); + message.archived = reader.bool(); break; case 17: - message.contextInfo = $root.proto.ContextInfo.decode(reader, reader.uint32()); + message.disappearingMode = $root.proto.DisappearingMode.decode(reader, reader.uint32()); + break; + case 18: + message.unreadMentionCount = reader.uint32(); + break; + case 19: + message.markedAsUnread = reader.bool(); + break; + case 20: + if (!(message.participant && message.participant.length)) + message.participant = []; + message.participant.push($root.proto.GroupParticipant.decode(reader, reader.uint32())); + break; + case 21: + message.tcToken = reader.bytes(); + break; + case 22: + message.tcTokenTimestamp = reader.uint64(); + break; + case 23: + message.contactPrimaryIdentityKey = reader.bytes(); + break; + case 24: + message.pinned = reader.uint32(); + break; + case 25: + message.muteEndTime = reader.uint64(); + break; + case 26: + message.wallpaper = $root.proto.WallpaperSettings.decode(reader, reader.uint32()); + break; + case 27: + message.mediaVisibility = reader.int32(); + break; + case 28: + message.tcTokenSenderTimestamp = reader.uint64(); + break; + case 29: + message.suspended = reader.bool(); break; default: reader.skipType(tag & 7); break; } } + if (!message.hasOwnProperty("id")) + throw $util.ProtocolError("missing required 'id'", { instance: message }); return message; }; /** - * Decodes a LiveLocationMessage message from the specified reader or buffer, length delimited. + * Decodes a Conversation message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof proto.LiveLocationMessage + * @memberof proto.Conversation * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.LiveLocationMessage} LiveLocationMessage + * @returns {proto.Conversation} Conversation * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - LiveLocationMessage.decodeDelimited = function decodeDelimited(reader) { + Conversation.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a LiveLocationMessage message. + * Verifies a Conversation message. * @function verify - * @memberof proto.LiveLocationMessage + * @memberof proto.Conversation * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - LiveLocationMessage.verify = function verify(message) { + Conversation.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.degreesLatitude != null && message.hasOwnProperty("degreesLatitude")) - if (typeof message.degreesLatitude !== "number") - return "degreesLatitude: number expected"; - if (message.degreesLongitude != null && message.hasOwnProperty("degreesLongitude")) - if (typeof message.degreesLongitude !== "number") - return "degreesLongitude: number expected"; - if (message.accuracyInMeters != null && message.hasOwnProperty("accuracyInMeters")) - if (!$util.isInteger(message.accuracyInMeters)) - return "accuracyInMeters: integer expected"; - if (message.speedInMps != null && message.hasOwnProperty("speedInMps")) - if (typeof message.speedInMps !== "number") - return "speedInMps: number expected"; - if (message.degreesClockwiseFromMagneticNorth != null && message.hasOwnProperty("degreesClockwiseFromMagneticNorth")) - if (!$util.isInteger(message.degreesClockwiseFromMagneticNorth)) - return "degreesClockwiseFromMagneticNorth: integer expected"; - if (message.caption != null && message.hasOwnProperty("caption")) - if (!$util.isString(message.caption)) - return "caption: string expected"; - if (message.sequenceNumber != null && message.hasOwnProperty("sequenceNumber")) - if (!$util.isInteger(message.sequenceNumber) && !(message.sequenceNumber && $util.isInteger(message.sequenceNumber.low) && $util.isInteger(message.sequenceNumber.high))) - return "sequenceNumber: integer|Long expected"; - if (message.timeOffset != null && message.hasOwnProperty("timeOffset")) - if (!$util.isInteger(message.timeOffset)) - return "timeOffset: integer expected"; - if (message.jpegThumbnail != null && message.hasOwnProperty("jpegThumbnail")) - if (!(message.jpegThumbnail && typeof message.jpegThumbnail.length === "number" || $util.isString(message.jpegThumbnail))) - return "jpegThumbnail: buffer expected"; - if (message.contextInfo != null && message.hasOwnProperty("contextInfo")) { - var error = $root.proto.ContextInfo.verify(message.contextInfo); + if (!$util.isString(message.id)) + return "id: string expected"; + if (message.messages != null && message.hasOwnProperty("messages")) { + if (!Array.isArray(message.messages)) + return "messages: array expected"; + for (var i = 0; i < message.messages.length; ++i) { + var error = $root.proto.HistorySyncMsg.verify(message.messages[i]); + if (error) + return "messages." + error; + } + } + if (message.newJid != null && message.hasOwnProperty("newJid")) + if (!$util.isString(message.newJid)) + return "newJid: string expected"; + if (message.oldJid != null && message.hasOwnProperty("oldJid")) + if (!$util.isString(message.oldJid)) + return "oldJid: string expected"; + if (message.lastMsgTimestamp != null && message.hasOwnProperty("lastMsgTimestamp")) + if (!$util.isInteger(message.lastMsgTimestamp) && !(message.lastMsgTimestamp && $util.isInteger(message.lastMsgTimestamp.low) && $util.isInteger(message.lastMsgTimestamp.high))) + return "lastMsgTimestamp: integer|Long expected"; + if (message.unreadCount != null && message.hasOwnProperty("unreadCount")) + if (!$util.isInteger(message.unreadCount)) + return "unreadCount: integer expected"; + if (message.readOnly != null && message.hasOwnProperty("readOnly")) + if (typeof message.readOnly !== "boolean") + return "readOnly: boolean expected"; + if (message.endOfHistoryTransfer != null && message.hasOwnProperty("endOfHistoryTransfer")) + if (typeof message.endOfHistoryTransfer !== "boolean") + return "endOfHistoryTransfer: boolean expected"; + if (message.ephemeralExpiration != null && message.hasOwnProperty("ephemeralExpiration")) + if (!$util.isInteger(message.ephemeralExpiration)) + return "ephemeralExpiration: integer expected"; + if (message.ephemeralSettingTimestamp != null && message.hasOwnProperty("ephemeralSettingTimestamp")) + if (!$util.isInteger(message.ephemeralSettingTimestamp) && !(message.ephemeralSettingTimestamp && $util.isInteger(message.ephemeralSettingTimestamp.low) && $util.isInteger(message.ephemeralSettingTimestamp.high))) + return "ephemeralSettingTimestamp: integer|Long expected"; + if (message.endOfHistoryTransferType != null && message.hasOwnProperty("endOfHistoryTransferType")) + switch (message.endOfHistoryTransferType) { + default: + return "endOfHistoryTransferType: enum value expected"; + case 0: + case 1: + break; + } + if (message.conversationTimestamp != null && message.hasOwnProperty("conversationTimestamp")) + if (!$util.isInteger(message.conversationTimestamp) && !(message.conversationTimestamp && $util.isInteger(message.conversationTimestamp.low) && $util.isInteger(message.conversationTimestamp.high))) + return "conversationTimestamp: integer|Long expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.pHash != null && message.hasOwnProperty("pHash")) + if (!$util.isString(message.pHash)) + return "pHash: string expected"; + if (message.notSpam != null && message.hasOwnProperty("notSpam")) + if (typeof message.notSpam !== "boolean") + return "notSpam: boolean expected"; + if (message.archived != null && message.hasOwnProperty("archived")) + if (typeof message.archived !== "boolean") + return "archived: boolean expected"; + if (message.disappearingMode != null && message.hasOwnProperty("disappearingMode")) { + var error = $root.proto.DisappearingMode.verify(message.disappearingMode); if (error) - return "contextInfo." + error; + return "disappearingMode." + error; + } + if (message.unreadMentionCount != null && message.hasOwnProperty("unreadMentionCount")) + if (!$util.isInteger(message.unreadMentionCount)) + return "unreadMentionCount: integer expected"; + if (message.markedAsUnread != null && message.hasOwnProperty("markedAsUnread")) + if (typeof message.markedAsUnread !== "boolean") + return "markedAsUnread: boolean expected"; + if (message.participant != null && message.hasOwnProperty("participant")) { + if (!Array.isArray(message.participant)) + return "participant: array expected"; + for (var i = 0; i < message.participant.length; ++i) { + var error = $root.proto.GroupParticipant.verify(message.participant[i]); + if (error) + return "participant." + error; + } + } + if (message.tcToken != null && message.hasOwnProperty("tcToken")) + if (!(message.tcToken && typeof message.tcToken.length === "number" || $util.isString(message.tcToken))) + return "tcToken: buffer expected"; + if (message.tcTokenTimestamp != null && message.hasOwnProperty("tcTokenTimestamp")) + if (!$util.isInteger(message.tcTokenTimestamp) && !(message.tcTokenTimestamp && $util.isInteger(message.tcTokenTimestamp.low) && $util.isInteger(message.tcTokenTimestamp.high))) + return "tcTokenTimestamp: integer|Long expected"; + if (message.contactPrimaryIdentityKey != null && message.hasOwnProperty("contactPrimaryIdentityKey")) + if (!(message.contactPrimaryIdentityKey && typeof message.contactPrimaryIdentityKey.length === "number" || $util.isString(message.contactPrimaryIdentityKey))) + return "contactPrimaryIdentityKey: buffer expected"; + if (message.pinned != null && message.hasOwnProperty("pinned")) + if (!$util.isInteger(message.pinned)) + return "pinned: integer expected"; + if (message.muteEndTime != null && message.hasOwnProperty("muteEndTime")) + if (!$util.isInteger(message.muteEndTime) && !(message.muteEndTime && $util.isInteger(message.muteEndTime.low) && $util.isInteger(message.muteEndTime.high))) + return "muteEndTime: integer|Long expected"; + if (message.wallpaper != null && message.hasOwnProperty("wallpaper")) { + var error = $root.proto.WallpaperSettings.verify(message.wallpaper); + if (error) + return "wallpaper." + error; } + if (message.mediaVisibility != null && message.hasOwnProperty("mediaVisibility")) + switch (message.mediaVisibility) { + default: + return "mediaVisibility: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.tcTokenSenderTimestamp != null && message.hasOwnProperty("tcTokenSenderTimestamp")) + if (!$util.isInteger(message.tcTokenSenderTimestamp) && !(message.tcTokenSenderTimestamp && $util.isInteger(message.tcTokenSenderTimestamp.low) && $util.isInteger(message.tcTokenSenderTimestamp.high))) + return "tcTokenSenderTimestamp: integer|Long expected"; + if (message.suspended != null && message.hasOwnProperty("suspended")) + if (typeof message.suspended !== "boolean") + return "suspended: boolean expected"; return null; }; /** - * Creates a LiveLocationMessage message from a plain object. Also converts values to their respective internal types. + * Creates a Conversation message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof proto.LiveLocationMessage + * @memberof proto.Conversation * @static * @param {Object.} object Plain object - * @returns {proto.LiveLocationMessage} LiveLocationMessage + * @returns {proto.Conversation} Conversation */ - LiveLocationMessage.fromObject = function fromObject(object) { - if (object instanceof $root.proto.LiveLocationMessage) + Conversation.fromObject = function fromObject(object) { + if (object instanceof $root.proto.Conversation) return object; - var message = new $root.proto.LiveLocationMessage(); - if (object.degreesLatitude != null) - message.degreesLatitude = Number(object.degreesLatitude); - if (object.degreesLongitude != null) - message.degreesLongitude = Number(object.degreesLongitude); - if (object.accuracyInMeters != null) - message.accuracyInMeters = object.accuracyInMeters >>> 0; - if (object.speedInMps != null) - message.speedInMps = Number(object.speedInMps); - if (object.degreesClockwiseFromMagneticNorth != null) - message.degreesClockwiseFromMagneticNorth = object.degreesClockwiseFromMagneticNorth >>> 0; - if (object.caption != null) - message.caption = String(object.caption); - if (object.sequenceNumber != null) + var message = new $root.proto.Conversation(); + if (object.id != null) + message.id = String(object.id); + if (object.messages) { + if (!Array.isArray(object.messages)) + throw TypeError(".proto.Conversation.messages: array expected"); + message.messages = []; + for (var i = 0; i < object.messages.length; ++i) { + if (typeof object.messages[i] !== "object") + throw TypeError(".proto.Conversation.messages: object expected"); + message.messages[i] = $root.proto.HistorySyncMsg.fromObject(object.messages[i]); + } + } + if (object.newJid != null) + message.newJid = String(object.newJid); + if (object.oldJid != null) + message.oldJid = String(object.oldJid); + if (object.lastMsgTimestamp != null) if ($util.Long) - (message.sequenceNumber = $util.Long.fromValue(object.sequenceNumber)).unsigned = false; - else if (typeof object.sequenceNumber === "string") - message.sequenceNumber = parseInt(object.sequenceNumber, 10); - else if (typeof object.sequenceNumber === "number") - message.sequenceNumber = object.sequenceNumber; - else if (typeof object.sequenceNumber === "object") - message.sequenceNumber = new $util.LongBits(object.sequenceNumber.low >>> 0, object.sequenceNumber.high >>> 0).toNumber(); - if (object.timeOffset != null) - message.timeOffset = object.timeOffset >>> 0; - if (object.jpegThumbnail != null) - if (typeof object.jpegThumbnail === "string") - $util.base64.decode(object.jpegThumbnail, message.jpegThumbnail = $util.newBuffer($util.base64.length(object.jpegThumbnail)), 0); - else if (object.jpegThumbnail.length) - message.jpegThumbnail = object.jpegThumbnail; - if (object.contextInfo != null) { - if (typeof object.contextInfo !== "object") - throw TypeError(".proto.LiveLocationMessage.contextInfo: object expected"); - message.contextInfo = $root.proto.ContextInfo.fromObject(object.contextInfo); + (message.lastMsgTimestamp = $util.Long.fromValue(object.lastMsgTimestamp)).unsigned = true; + else if (typeof object.lastMsgTimestamp === "string") + message.lastMsgTimestamp = parseInt(object.lastMsgTimestamp, 10); + else if (typeof object.lastMsgTimestamp === "number") + message.lastMsgTimestamp = object.lastMsgTimestamp; + else if (typeof object.lastMsgTimestamp === "object") + message.lastMsgTimestamp = new $util.LongBits(object.lastMsgTimestamp.low >>> 0, object.lastMsgTimestamp.high >>> 0).toNumber(true); + if (object.unreadCount != null) + message.unreadCount = object.unreadCount >>> 0; + if (object.readOnly != null) + message.readOnly = Boolean(object.readOnly); + if (object.endOfHistoryTransfer != null) + message.endOfHistoryTransfer = Boolean(object.endOfHistoryTransfer); + if (object.ephemeralExpiration != null) + message.ephemeralExpiration = object.ephemeralExpiration >>> 0; + if (object.ephemeralSettingTimestamp != null) + if ($util.Long) + (message.ephemeralSettingTimestamp = $util.Long.fromValue(object.ephemeralSettingTimestamp)).unsigned = false; + else if (typeof object.ephemeralSettingTimestamp === "string") + message.ephemeralSettingTimestamp = parseInt(object.ephemeralSettingTimestamp, 10); + else if (typeof object.ephemeralSettingTimestamp === "number") + message.ephemeralSettingTimestamp = object.ephemeralSettingTimestamp; + else if (typeof object.ephemeralSettingTimestamp === "object") + message.ephemeralSettingTimestamp = new $util.LongBits(object.ephemeralSettingTimestamp.low >>> 0, object.ephemeralSettingTimestamp.high >>> 0).toNumber(); + switch (object.endOfHistoryTransferType) { + case "COMPLETE_BUT_MORE_MESSAGES_REMAIN_ON_PRIMARY": + case 0: + message.endOfHistoryTransferType = 0; + break; + case "COMPLETE_AND_NO_MORE_MESSAGE_REMAIN_ON_PRIMARY": + case 1: + message.endOfHistoryTransferType = 1; + break; + } + if (object.conversationTimestamp != null) + if ($util.Long) + (message.conversationTimestamp = $util.Long.fromValue(object.conversationTimestamp)).unsigned = true; + else if (typeof object.conversationTimestamp === "string") + message.conversationTimestamp = parseInt(object.conversationTimestamp, 10); + else if (typeof object.conversationTimestamp === "number") + message.conversationTimestamp = object.conversationTimestamp; + else if (typeof object.conversationTimestamp === "object") + message.conversationTimestamp = new $util.LongBits(object.conversationTimestamp.low >>> 0, object.conversationTimestamp.high >>> 0).toNumber(true); + if (object.name != null) + message.name = String(object.name); + if (object.pHash != null) + message.pHash = String(object.pHash); + if (object.notSpam != null) + message.notSpam = Boolean(object.notSpam); + if (object.archived != null) + message.archived = Boolean(object.archived); + if (object.disappearingMode != null) { + if (typeof object.disappearingMode !== "object") + throw TypeError(".proto.Conversation.disappearingMode: object expected"); + message.disappearingMode = $root.proto.DisappearingMode.fromObject(object.disappearingMode); + } + if (object.unreadMentionCount != null) + message.unreadMentionCount = object.unreadMentionCount >>> 0; + if (object.markedAsUnread != null) + message.markedAsUnread = Boolean(object.markedAsUnread); + if (object.participant) { + if (!Array.isArray(object.participant)) + throw TypeError(".proto.Conversation.participant: array expected"); + message.participant = []; + for (var i = 0; i < object.participant.length; ++i) { + if (typeof object.participant[i] !== "object") + throw TypeError(".proto.Conversation.participant: object expected"); + message.participant[i] = $root.proto.GroupParticipant.fromObject(object.participant[i]); + } + } + if (object.tcToken != null) + if (typeof object.tcToken === "string") + $util.base64.decode(object.tcToken, message.tcToken = $util.newBuffer($util.base64.length(object.tcToken)), 0); + else if (object.tcToken.length) + message.tcToken = object.tcToken; + if (object.tcTokenTimestamp != null) + if ($util.Long) + (message.tcTokenTimestamp = $util.Long.fromValue(object.tcTokenTimestamp)).unsigned = true; + else if (typeof object.tcTokenTimestamp === "string") + message.tcTokenTimestamp = parseInt(object.tcTokenTimestamp, 10); + else if (typeof object.tcTokenTimestamp === "number") + message.tcTokenTimestamp = object.tcTokenTimestamp; + else if (typeof object.tcTokenTimestamp === "object") + message.tcTokenTimestamp = new $util.LongBits(object.tcTokenTimestamp.low >>> 0, object.tcTokenTimestamp.high >>> 0).toNumber(true); + if (object.contactPrimaryIdentityKey != null) + if (typeof object.contactPrimaryIdentityKey === "string") + $util.base64.decode(object.contactPrimaryIdentityKey, message.contactPrimaryIdentityKey = $util.newBuffer($util.base64.length(object.contactPrimaryIdentityKey)), 0); + else if (object.contactPrimaryIdentityKey.length) + message.contactPrimaryIdentityKey = object.contactPrimaryIdentityKey; + if (object.pinned != null) + message.pinned = object.pinned >>> 0; + if (object.muteEndTime != null) + if ($util.Long) + (message.muteEndTime = $util.Long.fromValue(object.muteEndTime)).unsigned = true; + else if (typeof object.muteEndTime === "string") + message.muteEndTime = parseInt(object.muteEndTime, 10); + else if (typeof object.muteEndTime === "number") + message.muteEndTime = object.muteEndTime; + else if (typeof object.muteEndTime === "object") + message.muteEndTime = new $util.LongBits(object.muteEndTime.low >>> 0, object.muteEndTime.high >>> 0).toNumber(true); + if (object.wallpaper != null) { + if (typeof object.wallpaper !== "object") + throw TypeError(".proto.Conversation.wallpaper: object expected"); + message.wallpaper = $root.proto.WallpaperSettings.fromObject(object.wallpaper); + } + switch (object.mediaVisibility) { + case "DEFAULT": + case 0: + message.mediaVisibility = 0; + break; + case "OFF": + case 1: + message.mediaVisibility = 1; + break; + case "ON": + case 2: + message.mediaVisibility = 2; + break; } + if (object.tcTokenSenderTimestamp != null) + if ($util.Long) + (message.tcTokenSenderTimestamp = $util.Long.fromValue(object.tcTokenSenderTimestamp)).unsigned = true; + else if (typeof object.tcTokenSenderTimestamp === "string") + message.tcTokenSenderTimestamp = parseInt(object.tcTokenSenderTimestamp, 10); + else if (typeof object.tcTokenSenderTimestamp === "number") + message.tcTokenSenderTimestamp = object.tcTokenSenderTimestamp; + else if (typeof object.tcTokenSenderTimestamp === "object") + message.tcTokenSenderTimestamp = new $util.LongBits(object.tcTokenSenderTimestamp.low >>> 0, object.tcTokenSenderTimestamp.high >>> 0).toNumber(true); + if (object.suspended != null) + message.suspended = Boolean(object.suspended); return message; }; /** - * Creates a plain object from a LiveLocationMessage message. Also converts values to other types if specified. + * Creates a plain object from a Conversation message. Also converts values to other types if specified. * @function toObject - * @memberof proto.LiveLocationMessage + * @memberof proto.Conversation * @static - * @param {proto.LiveLocationMessage} message LiveLocationMessage + * @param {proto.Conversation} message Conversation * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - LiveLocationMessage.toObject = function toObject(message, options) { + Conversation.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) { + object.messages = []; + object.participant = []; + } if (options.defaults) { - object.degreesLatitude = 0; - object.degreesLongitude = 0; - object.accuracyInMeters = 0; - object.speedInMps = 0; - object.degreesClockwiseFromMagneticNorth = 0; - object.caption = ""; + object.id = ""; + object.newJid = ""; + object.oldJid = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.lastMsgTimestamp = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.lastMsgTimestamp = options.longs === String ? "0" : 0; + object.unreadCount = 0; + object.readOnly = false; + object.endOfHistoryTransfer = false; + object.ephemeralExpiration = 0; if ($util.Long) { var long = new $util.Long(0, 0, false); - object.sequenceNumber = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + object.ephemeralSettingTimestamp = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; } else - object.sequenceNumber = options.longs === String ? "0" : 0; - object.timeOffset = 0; + object.ephemeralSettingTimestamp = options.longs === String ? "0" : 0; + object.endOfHistoryTransferType = options.enums === String ? "COMPLETE_BUT_MORE_MESSAGES_REMAIN_ON_PRIMARY" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.conversationTimestamp = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.conversationTimestamp = options.longs === String ? "0" : 0; + object.name = ""; + object.pHash = ""; + object.notSpam = false; + object.archived = false; + object.disappearingMode = null; + object.unreadMentionCount = 0; + object.markedAsUnread = false; if (options.bytes === String) - object.jpegThumbnail = ""; + object.tcToken = ""; else { - object.jpegThumbnail = []; + object.tcToken = []; if (options.bytes !== Array) - object.jpegThumbnail = $util.newBuffer(object.jpegThumbnail); + object.tcToken = $util.newBuffer(object.tcToken); } - object.contextInfo = null; - } - if (message.degreesLatitude != null && message.hasOwnProperty("degreesLatitude")) - object.degreesLatitude = options.json && !isFinite(message.degreesLatitude) ? String(message.degreesLatitude) : message.degreesLatitude; - if (message.degreesLongitude != null && message.hasOwnProperty("degreesLongitude")) - object.degreesLongitude = options.json && !isFinite(message.degreesLongitude) ? String(message.degreesLongitude) : message.degreesLongitude; - if (message.accuracyInMeters != null && message.hasOwnProperty("accuracyInMeters")) - object.accuracyInMeters = message.accuracyInMeters; - if (message.speedInMps != null && message.hasOwnProperty("speedInMps")) - object.speedInMps = options.json && !isFinite(message.speedInMps) ? String(message.speedInMps) : message.speedInMps; - if (message.degreesClockwiseFromMagneticNorth != null && message.hasOwnProperty("degreesClockwiseFromMagneticNorth")) - object.degreesClockwiseFromMagneticNorth = message.degreesClockwiseFromMagneticNorth; - if (message.caption != null && message.hasOwnProperty("caption")) - object.caption = message.caption; - if (message.sequenceNumber != null && message.hasOwnProperty("sequenceNumber")) - if (typeof message.sequenceNumber === "number") - object.sequenceNumber = options.longs === String ? String(message.sequenceNumber) : message.sequenceNumber; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.tcTokenTimestamp = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.tcTokenTimestamp = options.longs === String ? "0" : 0; + if (options.bytes === String) + object.contactPrimaryIdentityKey = ""; + else { + object.contactPrimaryIdentityKey = []; + if (options.bytes !== Array) + object.contactPrimaryIdentityKey = $util.newBuffer(object.contactPrimaryIdentityKey); + } + object.pinned = 0; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.muteEndTime = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.muteEndTime = options.longs === String ? "0" : 0; + object.wallpaper = null; + object.mediaVisibility = options.enums === String ? "DEFAULT" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.tcTokenSenderTimestamp = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.tcTokenSenderTimestamp = options.longs === String ? "0" : 0; + object.suspended = false; + } + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; + if (message.messages && message.messages.length) { + object.messages = []; + for (var j = 0; j < message.messages.length; ++j) + object.messages[j] = $root.proto.HistorySyncMsg.toObject(message.messages[j], options); + } + if (message.newJid != null && message.hasOwnProperty("newJid")) + object.newJid = message.newJid; + if (message.oldJid != null && message.hasOwnProperty("oldJid")) + object.oldJid = message.oldJid; + if (message.lastMsgTimestamp != null && message.hasOwnProperty("lastMsgTimestamp")) + if (typeof message.lastMsgTimestamp === "number") + object.lastMsgTimestamp = options.longs === String ? String(message.lastMsgTimestamp) : message.lastMsgTimestamp; else - object.sequenceNumber = options.longs === String ? $util.Long.prototype.toString.call(message.sequenceNumber) : options.longs === Number ? new $util.LongBits(message.sequenceNumber.low >>> 0, message.sequenceNumber.high >>> 0).toNumber() : message.sequenceNumber; - if (message.timeOffset != null && message.hasOwnProperty("timeOffset")) - object.timeOffset = message.timeOffset; - if (message.jpegThumbnail != null && message.hasOwnProperty("jpegThumbnail")) - object.jpegThumbnail = options.bytes === String ? $util.base64.encode(message.jpegThumbnail, 0, message.jpegThumbnail.length) : options.bytes === Array ? Array.prototype.slice.call(message.jpegThumbnail) : message.jpegThumbnail; - if (message.contextInfo != null && message.hasOwnProperty("contextInfo")) - object.contextInfo = $root.proto.ContextInfo.toObject(message.contextInfo, options); + object.lastMsgTimestamp = options.longs === String ? $util.Long.prototype.toString.call(message.lastMsgTimestamp) : options.longs === Number ? new $util.LongBits(message.lastMsgTimestamp.low >>> 0, message.lastMsgTimestamp.high >>> 0).toNumber(true) : message.lastMsgTimestamp; + if (message.unreadCount != null && message.hasOwnProperty("unreadCount")) + object.unreadCount = message.unreadCount; + if (message.readOnly != null && message.hasOwnProperty("readOnly")) + object.readOnly = message.readOnly; + if (message.endOfHistoryTransfer != null && message.hasOwnProperty("endOfHistoryTransfer")) + object.endOfHistoryTransfer = message.endOfHistoryTransfer; + if (message.ephemeralExpiration != null && message.hasOwnProperty("ephemeralExpiration")) + object.ephemeralExpiration = message.ephemeralExpiration; + if (message.ephemeralSettingTimestamp != null && message.hasOwnProperty("ephemeralSettingTimestamp")) + if (typeof message.ephemeralSettingTimestamp === "number") + object.ephemeralSettingTimestamp = options.longs === String ? String(message.ephemeralSettingTimestamp) : message.ephemeralSettingTimestamp; + else + object.ephemeralSettingTimestamp = options.longs === String ? $util.Long.prototype.toString.call(message.ephemeralSettingTimestamp) : options.longs === Number ? new $util.LongBits(message.ephemeralSettingTimestamp.low >>> 0, message.ephemeralSettingTimestamp.high >>> 0).toNumber() : message.ephemeralSettingTimestamp; + if (message.endOfHistoryTransferType != null && message.hasOwnProperty("endOfHistoryTransferType")) + object.endOfHistoryTransferType = options.enums === String ? $root.proto.Conversation.ConversationEndOfHistoryTransferType[message.endOfHistoryTransferType] : message.endOfHistoryTransferType; + if (message.conversationTimestamp != null && message.hasOwnProperty("conversationTimestamp")) + if (typeof message.conversationTimestamp === "number") + object.conversationTimestamp = options.longs === String ? String(message.conversationTimestamp) : message.conversationTimestamp; + else + object.conversationTimestamp = options.longs === String ? $util.Long.prototype.toString.call(message.conversationTimestamp) : options.longs === Number ? new $util.LongBits(message.conversationTimestamp.low >>> 0, message.conversationTimestamp.high >>> 0).toNumber(true) : message.conversationTimestamp; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.pHash != null && message.hasOwnProperty("pHash")) + object.pHash = message.pHash; + if (message.notSpam != null && message.hasOwnProperty("notSpam")) + object.notSpam = message.notSpam; + if (message.archived != null && message.hasOwnProperty("archived")) + object.archived = message.archived; + if (message.disappearingMode != null && message.hasOwnProperty("disappearingMode")) + object.disappearingMode = $root.proto.DisappearingMode.toObject(message.disappearingMode, options); + if (message.unreadMentionCount != null && message.hasOwnProperty("unreadMentionCount")) + object.unreadMentionCount = message.unreadMentionCount; + if (message.markedAsUnread != null && message.hasOwnProperty("markedAsUnread")) + object.markedAsUnread = message.markedAsUnread; + if (message.participant && message.participant.length) { + object.participant = []; + for (var j = 0; j < message.participant.length; ++j) + object.participant[j] = $root.proto.GroupParticipant.toObject(message.participant[j], options); + } + if (message.tcToken != null && message.hasOwnProperty("tcToken")) + object.tcToken = options.bytes === String ? $util.base64.encode(message.tcToken, 0, message.tcToken.length) : options.bytes === Array ? Array.prototype.slice.call(message.tcToken) : message.tcToken; + if (message.tcTokenTimestamp != null && message.hasOwnProperty("tcTokenTimestamp")) + if (typeof message.tcTokenTimestamp === "number") + object.tcTokenTimestamp = options.longs === String ? String(message.tcTokenTimestamp) : message.tcTokenTimestamp; + else + object.tcTokenTimestamp = options.longs === String ? $util.Long.prototype.toString.call(message.tcTokenTimestamp) : options.longs === Number ? new $util.LongBits(message.tcTokenTimestamp.low >>> 0, message.tcTokenTimestamp.high >>> 0).toNumber(true) : message.tcTokenTimestamp; + if (message.contactPrimaryIdentityKey != null && message.hasOwnProperty("contactPrimaryIdentityKey")) + object.contactPrimaryIdentityKey = options.bytes === String ? $util.base64.encode(message.contactPrimaryIdentityKey, 0, message.contactPrimaryIdentityKey.length) : options.bytes === Array ? Array.prototype.slice.call(message.contactPrimaryIdentityKey) : message.contactPrimaryIdentityKey; + if (message.pinned != null && message.hasOwnProperty("pinned")) + object.pinned = message.pinned; + if (message.muteEndTime != null && message.hasOwnProperty("muteEndTime")) + if (typeof message.muteEndTime === "number") + object.muteEndTime = options.longs === String ? String(message.muteEndTime) : message.muteEndTime; + else + object.muteEndTime = options.longs === String ? $util.Long.prototype.toString.call(message.muteEndTime) : options.longs === Number ? new $util.LongBits(message.muteEndTime.low >>> 0, message.muteEndTime.high >>> 0).toNumber(true) : message.muteEndTime; + if (message.wallpaper != null && message.hasOwnProperty("wallpaper")) + object.wallpaper = $root.proto.WallpaperSettings.toObject(message.wallpaper, options); + if (message.mediaVisibility != null && message.hasOwnProperty("mediaVisibility")) + object.mediaVisibility = options.enums === String ? $root.proto.MediaVisibility[message.mediaVisibility] : message.mediaVisibility; + if (message.tcTokenSenderTimestamp != null && message.hasOwnProperty("tcTokenSenderTimestamp")) + if (typeof message.tcTokenSenderTimestamp === "number") + object.tcTokenSenderTimestamp = options.longs === String ? String(message.tcTokenSenderTimestamp) : message.tcTokenSenderTimestamp; + else + object.tcTokenSenderTimestamp = options.longs === String ? $util.Long.prototype.toString.call(message.tcTokenSenderTimestamp) : options.longs === Number ? new $util.LongBits(message.tcTokenSenderTimestamp.low >>> 0, message.tcTokenSenderTimestamp.high >>> 0).toNumber(true) : message.tcTokenSenderTimestamp; + if (message.suspended != null && message.hasOwnProperty("suspended")) + object.suspended = message.suspended; return object; }; /** - * Converts this LiveLocationMessage to JSON. + * Converts this Conversation to JSON. * @function toJSON - * @memberof proto.LiveLocationMessage + * @memberof proto.Conversation * @instance * @returns {Object.} JSON object */ - LiveLocationMessage.prototype.toJSON = function toJSON() { + Conversation.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return LiveLocationMessage; + /** + * ConversationEndOfHistoryTransferType enum. + * @name proto.Conversation.ConversationEndOfHistoryTransferType + * @enum {number} + * @property {number} COMPLETE_BUT_MORE_MESSAGES_REMAIN_ON_PRIMARY=0 COMPLETE_BUT_MORE_MESSAGES_REMAIN_ON_PRIMARY value + * @property {number} COMPLETE_AND_NO_MORE_MESSAGE_REMAIN_ON_PRIMARY=1 COMPLETE_AND_NO_MORE_MESSAGE_REMAIN_ON_PRIMARY value + */ + Conversation.ConversationEndOfHistoryTransferType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "COMPLETE_BUT_MORE_MESSAGES_REMAIN_ON_PRIMARY"] = 0; + values[valuesById[1] = "COMPLETE_AND_NO_MORE_MESSAGE_REMAIN_ON_PRIMARY"] = 1; + return values; + })(); + + return Conversation; })(); - proto.StickerMessage = (function() { + proto.GlobalSettings = (function() { /** - * Properties of a StickerMessage. + * Properties of a GlobalSettings. * @memberof proto - * @interface IStickerMessage - * @property {string|null} [url] StickerMessage url - * @property {Uint8Array|null} [fileSha256] StickerMessage fileSha256 - * @property {Uint8Array|null} [fileEncSha256] StickerMessage fileEncSha256 - * @property {Uint8Array|null} [mediaKey] StickerMessage mediaKey - * @property {string|null} [mimetype] StickerMessage mimetype - * @property {number|null} [height] StickerMessage height - * @property {number|null} [width] StickerMessage width - * @property {string|null} [directPath] StickerMessage directPath - * @property {number|Long|null} [fileLength] StickerMessage fileLength - * @property {number|Long|null} [mediaKeyTimestamp] StickerMessage mediaKeyTimestamp - * @property {number|null} [firstFrameLength] StickerMessage firstFrameLength - * @property {Uint8Array|null} [firstFrameSidecar] StickerMessage firstFrameSidecar - * @property {boolean|null} [isAnimated] StickerMessage isAnimated - * @property {Uint8Array|null} [pngThumbnail] StickerMessage pngThumbnail - * @property {proto.IContextInfo|null} [contextInfo] StickerMessage contextInfo + * @interface IGlobalSettings + * @property {proto.IWallpaperSettings|null} [lightThemeWallpaper] GlobalSettings lightThemeWallpaper + * @property {proto.MediaVisibility|null} [mediaVisibility] GlobalSettings mediaVisibility + * @property {proto.IWallpaperSettings|null} [darkThemeWallpaper] GlobalSettings darkThemeWallpaper + * @property {proto.IAutoDownloadSettings|null} [autoDownloadWiFi] GlobalSettings autoDownloadWiFi + * @property {proto.IAutoDownloadSettings|null} [autoDownloadCellular] GlobalSettings autoDownloadCellular + * @property {proto.IAutoDownloadSettings|null} [autoDownloadRoaming] GlobalSettings autoDownloadRoaming + * @property {boolean|null} [showIndividualNotificationsPreview] GlobalSettings showIndividualNotificationsPreview + * @property {boolean|null} [showGroupNotificationsPreview] GlobalSettings showGroupNotificationsPreview */ /** - * Constructs a new StickerMessage. + * Constructs a new GlobalSettings. * @memberof proto - * @classdesc Represents a StickerMessage. - * @implements IStickerMessage + * @classdesc Represents a GlobalSettings. + * @implements IGlobalSettings * @constructor - * @param {proto.IStickerMessage=} [properties] Properties to set + * @param {proto.IGlobalSettings=} [properties] Properties to set */ - function StickerMessage(properties) { + function GlobalSettings(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -34894,257 +35559,166 @@ $root.proto = (function() { } /** - * StickerMessage url. - * @member {string} url - * @memberof proto.StickerMessage - * @instance - */ - StickerMessage.prototype.url = ""; - - /** - * StickerMessage fileSha256. - * @member {Uint8Array} fileSha256 - * @memberof proto.StickerMessage - * @instance - */ - StickerMessage.prototype.fileSha256 = $util.newBuffer([]); - - /** - * StickerMessage fileEncSha256. - * @member {Uint8Array} fileEncSha256 - * @memberof proto.StickerMessage - * @instance - */ - StickerMessage.prototype.fileEncSha256 = $util.newBuffer([]); - - /** - * StickerMessage mediaKey. - * @member {Uint8Array} mediaKey - * @memberof proto.StickerMessage - * @instance - */ - StickerMessage.prototype.mediaKey = $util.newBuffer([]); - - /** - * StickerMessage mimetype. - * @member {string} mimetype - * @memberof proto.StickerMessage - * @instance - */ - StickerMessage.prototype.mimetype = ""; - - /** - * StickerMessage height. - * @member {number} height - * @memberof proto.StickerMessage - * @instance - */ - StickerMessage.prototype.height = 0; - - /** - * StickerMessage width. - * @member {number} width - * @memberof proto.StickerMessage - * @instance - */ - StickerMessage.prototype.width = 0; - - /** - * StickerMessage directPath. - * @member {string} directPath - * @memberof proto.StickerMessage + * GlobalSettings lightThemeWallpaper. + * @member {proto.IWallpaperSettings|null|undefined} lightThemeWallpaper + * @memberof proto.GlobalSettings * @instance */ - StickerMessage.prototype.directPath = ""; + GlobalSettings.prototype.lightThemeWallpaper = null; /** - * StickerMessage fileLength. - * @member {number|Long} fileLength - * @memberof proto.StickerMessage + * GlobalSettings mediaVisibility. + * @member {proto.MediaVisibility} mediaVisibility + * @memberof proto.GlobalSettings * @instance */ - StickerMessage.prototype.fileLength = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + GlobalSettings.prototype.mediaVisibility = 0; /** - * StickerMessage mediaKeyTimestamp. - * @member {number|Long} mediaKeyTimestamp - * @memberof proto.StickerMessage + * GlobalSettings darkThemeWallpaper. + * @member {proto.IWallpaperSettings|null|undefined} darkThemeWallpaper + * @memberof proto.GlobalSettings * @instance */ - StickerMessage.prototype.mediaKeyTimestamp = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + GlobalSettings.prototype.darkThemeWallpaper = null; /** - * StickerMessage firstFrameLength. - * @member {number} firstFrameLength - * @memberof proto.StickerMessage + * GlobalSettings autoDownloadWiFi. + * @member {proto.IAutoDownloadSettings|null|undefined} autoDownloadWiFi + * @memberof proto.GlobalSettings * @instance */ - StickerMessage.prototype.firstFrameLength = 0; + GlobalSettings.prototype.autoDownloadWiFi = null; /** - * StickerMessage firstFrameSidecar. - * @member {Uint8Array} firstFrameSidecar - * @memberof proto.StickerMessage + * GlobalSettings autoDownloadCellular. + * @member {proto.IAutoDownloadSettings|null|undefined} autoDownloadCellular + * @memberof proto.GlobalSettings * @instance */ - StickerMessage.prototype.firstFrameSidecar = $util.newBuffer([]); + GlobalSettings.prototype.autoDownloadCellular = null; /** - * StickerMessage isAnimated. - * @member {boolean} isAnimated - * @memberof proto.StickerMessage + * GlobalSettings autoDownloadRoaming. + * @member {proto.IAutoDownloadSettings|null|undefined} autoDownloadRoaming + * @memberof proto.GlobalSettings * @instance */ - StickerMessage.prototype.isAnimated = false; + GlobalSettings.prototype.autoDownloadRoaming = null; /** - * StickerMessage pngThumbnail. - * @member {Uint8Array} pngThumbnail - * @memberof proto.StickerMessage + * GlobalSettings showIndividualNotificationsPreview. + * @member {boolean} showIndividualNotificationsPreview + * @memberof proto.GlobalSettings * @instance */ - StickerMessage.prototype.pngThumbnail = $util.newBuffer([]); + GlobalSettings.prototype.showIndividualNotificationsPreview = false; /** - * StickerMessage contextInfo. - * @member {proto.IContextInfo|null|undefined} contextInfo - * @memberof proto.StickerMessage + * GlobalSettings showGroupNotificationsPreview. + * @member {boolean} showGroupNotificationsPreview + * @memberof proto.GlobalSettings * @instance */ - StickerMessage.prototype.contextInfo = null; + GlobalSettings.prototype.showGroupNotificationsPreview = false; /** - * Creates a new StickerMessage instance using the specified properties. + * Creates a new GlobalSettings instance using the specified properties. * @function create - * @memberof proto.StickerMessage + * @memberof proto.GlobalSettings * @static - * @param {proto.IStickerMessage=} [properties] Properties to set - * @returns {proto.StickerMessage} StickerMessage instance + * @param {proto.IGlobalSettings=} [properties] Properties to set + * @returns {proto.GlobalSettings} GlobalSettings instance */ - StickerMessage.create = function create(properties) { - return new StickerMessage(properties); + GlobalSettings.create = function create(properties) { + return new GlobalSettings(properties); }; /** - * Encodes the specified StickerMessage message. Does not implicitly {@link proto.StickerMessage.verify|verify} messages. + * Encodes the specified GlobalSettings message. Does not implicitly {@link proto.GlobalSettings.verify|verify} messages. * @function encode - * @memberof proto.StickerMessage + * @memberof proto.GlobalSettings * @static - * @param {proto.IStickerMessage} message StickerMessage message or plain object to encode + * @param {proto.IGlobalSettings} message GlobalSettings message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - StickerMessage.encode = function encode(message, writer) { + GlobalSettings.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.url != null && Object.hasOwnProperty.call(message, "url")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.url); - if (message.fileSha256 != null && Object.hasOwnProperty.call(message, "fileSha256")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.fileSha256); - if (message.fileEncSha256 != null && Object.hasOwnProperty.call(message, "fileEncSha256")) - writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.fileEncSha256); - if (message.mediaKey != null && Object.hasOwnProperty.call(message, "mediaKey")) - writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.mediaKey); - if (message.mimetype != null && Object.hasOwnProperty.call(message, "mimetype")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.mimetype); - if (message.height != null && Object.hasOwnProperty.call(message, "height")) - writer.uint32(/* id 6, wireType 0 =*/48).uint32(message.height); - if (message.width != null && Object.hasOwnProperty.call(message, "width")) - writer.uint32(/* id 7, wireType 0 =*/56).uint32(message.width); - if (message.directPath != null && Object.hasOwnProperty.call(message, "directPath")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.directPath); - if (message.fileLength != null && Object.hasOwnProperty.call(message, "fileLength")) - writer.uint32(/* id 9, wireType 0 =*/72).uint64(message.fileLength); - if (message.mediaKeyTimestamp != null && Object.hasOwnProperty.call(message, "mediaKeyTimestamp")) - writer.uint32(/* id 10, wireType 0 =*/80).int64(message.mediaKeyTimestamp); - if (message.firstFrameLength != null && Object.hasOwnProperty.call(message, "firstFrameLength")) - writer.uint32(/* id 11, wireType 0 =*/88).uint32(message.firstFrameLength); - if (message.firstFrameSidecar != null && Object.hasOwnProperty.call(message, "firstFrameSidecar")) - writer.uint32(/* id 12, wireType 2 =*/98).bytes(message.firstFrameSidecar); - if (message.isAnimated != null && Object.hasOwnProperty.call(message, "isAnimated")) - writer.uint32(/* id 13, wireType 0 =*/104).bool(message.isAnimated); - if (message.pngThumbnail != null && Object.hasOwnProperty.call(message, "pngThumbnail")) - writer.uint32(/* id 16, wireType 2 =*/130).bytes(message.pngThumbnail); - if (message.contextInfo != null && Object.hasOwnProperty.call(message, "contextInfo")) - $root.proto.ContextInfo.encode(message.contextInfo, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); + if (message.lightThemeWallpaper != null && Object.hasOwnProperty.call(message, "lightThemeWallpaper")) + $root.proto.WallpaperSettings.encode(message.lightThemeWallpaper, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.mediaVisibility != null && Object.hasOwnProperty.call(message, "mediaVisibility")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.mediaVisibility); + if (message.darkThemeWallpaper != null && Object.hasOwnProperty.call(message, "darkThemeWallpaper")) + $root.proto.WallpaperSettings.encode(message.darkThemeWallpaper, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.autoDownloadWiFi != null && Object.hasOwnProperty.call(message, "autoDownloadWiFi")) + $root.proto.AutoDownloadSettings.encode(message.autoDownloadWiFi, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.autoDownloadCellular != null && Object.hasOwnProperty.call(message, "autoDownloadCellular")) + $root.proto.AutoDownloadSettings.encode(message.autoDownloadCellular, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.autoDownloadRoaming != null && Object.hasOwnProperty.call(message, "autoDownloadRoaming")) + $root.proto.AutoDownloadSettings.encode(message.autoDownloadRoaming, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.showIndividualNotificationsPreview != null && Object.hasOwnProperty.call(message, "showIndividualNotificationsPreview")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.showIndividualNotificationsPreview); + if (message.showGroupNotificationsPreview != null && Object.hasOwnProperty.call(message, "showGroupNotificationsPreview")) + writer.uint32(/* id 8, wireType 0 =*/64).bool(message.showGroupNotificationsPreview); return writer; }; /** - * Encodes the specified StickerMessage message, length delimited. Does not implicitly {@link proto.StickerMessage.verify|verify} messages. + * Encodes the specified GlobalSettings message, length delimited. Does not implicitly {@link proto.GlobalSettings.verify|verify} messages. * @function encodeDelimited - * @memberof proto.StickerMessage + * @memberof proto.GlobalSettings * @static - * @param {proto.IStickerMessage} message StickerMessage message or plain object to encode + * @param {proto.IGlobalSettings} message GlobalSettings message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - StickerMessage.encodeDelimited = function encodeDelimited(message, writer) { + GlobalSettings.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a StickerMessage message from the specified reader or buffer. + * Decodes a GlobalSettings message from the specified reader or buffer. * @function decode - * @memberof proto.StickerMessage + * @memberof proto.GlobalSettings * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {proto.StickerMessage} StickerMessage + * @returns {proto.GlobalSettings} GlobalSettings * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - StickerMessage.decode = function decode(reader, length) { + GlobalSettings.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.StickerMessage(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.GlobalSettings(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.url = reader.string(); + message.lightThemeWallpaper = $root.proto.WallpaperSettings.decode(reader, reader.uint32()); break; case 2: - message.fileSha256 = reader.bytes(); + message.mediaVisibility = reader.int32(); break; case 3: - message.fileEncSha256 = reader.bytes(); + message.darkThemeWallpaper = $root.proto.WallpaperSettings.decode(reader, reader.uint32()); break; case 4: - message.mediaKey = reader.bytes(); + message.autoDownloadWiFi = $root.proto.AutoDownloadSettings.decode(reader, reader.uint32()); break; case 5: - message.mimetype = reader.string(); + message.autoDownloadCellular = $root.proto.AutoDownloadSettings.decode(reader, reader.uint32()); break; case 6: - message.height = reader.uint32(); + message.autoDownloadRoaming = $root.proto.AutoDownloadSettings.decode(reader, reader.uint32()); break; case 7: - message.width = reader.uint32(); + message.showIndividualNotificationsPreview = reader.bool(); break; case 8: - message.directPath = reader.string(); - break; - case 9: - message.fileLength = reader.uint64(); - break; - case 10: - message.mediaKeyTimestamp = reader.int64(); - break; - case 11: - message.firstFrameLength = reader.uint32(); - break; - case 12: - message.firstFrameSidecar = reader.bytes(); - break; - case 13: - message.isAnimated = reader.bool(); - break; - case 16: - message.pngThumbnail = reader.bytes(); - break; - case 17: - message.contextInfo = $root.proto.ContextInfo.decode(reader, reader.uint32()); + message.showGroupNotificationsPreview = reader.bool(); break; default: reader.skipType(tag & 7); @@ -35155,306 +35729,208 @@ $root.proto = (function() { }; /** - * Decodes a StickerMessage message from the specified reader or buffer, length delimited. + * Decodes a GlobalSettings message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof proto.StickerMessage + * @memberof proto.GlobalSettings * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.StickerMessage} StickerMessage + * @returns {proto.GlobalSettings} GlobalSettings * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - StickerMessage.decodeDelimited = function decodeDelimited(reader) { + GlobalSettings.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a StickerMessage message. + * Verifies a GlobalSettings message. * @function verify - * @memberof proto.StickerMessage + * @memberof proto.GlobalSettings * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - StickerMessage.verify = function verify(message) { + GlobalSettings.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.url != null && message.hasOwnProperty("url")) - if (!$util.isString(message.url)) - return "url: string expected"; - if (message.fileSha256 != null && message.hasOwnProperty("fileSha256")) - if (!(message.fileSha256 && typeof message.fileSha256.length === "number" || $util.isString(message.fileSha256))) - return "fileSha256: buffer expected"; - if (message.fileEncSha256 != null && message.hasOwnProperty("fileEncSha256")) - if (!(message.fileEncSha256 && typeof message.fileEncSha256.length === "number" || $util.isString(message.fileEncSha256))) - return "fileEncSha256: buffer expected"; - if (message.mediaKey != null && message.hasOwnProperty("mediaKey")) - if (!(message.mediaKey && typeof message.mediaKey.length === "number" || $util.isString(message.mediaKey))) - return "mediaKey: buffer expected"; - if (message.mimetype != null && message.hasOwnProperty("mimetype")) - if (!$util.isString(message.mimetype)) - return "mimetype: string expected"; - if (message.height != null && message.hasOwnProperty("height")) - if (!$util.isInteger(message.height)) - return "height: integer expected"; - if (message.width != null && message.hasOwnProperty("width")) - if (!$util.isInteger(message.width)) - return "width: integer expected"; - if (message.directPath != null && message.hasOwnProperty("directPath")) - if (!$util.isString(message.directPath)) - return "directPath: string expected"; - if (message.fileLength != null && message.hasOwnProperty("fileLength")) - if (!$util.isInteger(message.fileLength) && !(message.fileLength && $util.isInteger(message.fileLength.low) && $util.isInteger(message.fileLength.high))) - return "fileLength: integer|Long expected"; - if (message.mediaKeyTimestamp != null && message.hasOwnProperty("mediaKeyTimestamp")) - if (!$util.isInteger(message.mediaKeyTimestamp) && !(message.mediaKeyTimestamp && $util.isInteger(message.mediaKeyTimestamp.low) && $util.isInteger(message.mediaKeyTimestamp.high))) - return "mediaKeyTimestamp: integer|Long expected"; - if (message.firstFrameLength != null && message.hasOwnProperty("firstFrameLength")) - if (!$util.isInteger(message.firstFrameLength)) - return "firstFrameLength: integer expected"; - if (message.firstFrameSidecar != null && message.hasOwnProperty("firstFrameSidecar")) - if (!(message.firstFrameSidecar && typeof message.firstFrameSidecar.length === "number" || $util.isString(message.firstFrameSidecar))) - return "firstFrameSidecar: buffer expected"; - if (message.isAnimated != null && message.hasOwnProperty("isAnimated")) - if (typeof message.isAnimated !== "boolean") - return "isAnimated: boolean expected"; - if (message.pngThumbnail != null && message.hasOwnProperty("pngThumbnail")) - if (!(message.pngThumbnail && typeof message.pngThumbnail.length === "number" || $util.isString(message.pngThumbnail))) - return "pngThumbnail: buffer expected"; - if (message.contextInfo != null && message.hasOwnProperty("contextInfo")) { - var error = $root.proto.ContextInfo.verify(message.contextInfo); + if (message.lightThemeWallpaper != null && message.hasOwnProperty("lightThemeWallpaper")) { + var error = $root.proto.WallpaperSettings.verify(message.lightThemeWallpaper); if (error) - return "contextInfo." + error; + return "lightThemeWallpaper." + error; + } + if (message.mediaVisibility != null && message.hasOwnProperty("mediaVisibility")) + switch (message.mediaVisibility) { + default: + return "mediaVisibility: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.darkThemeWallpaper != null && message.hasOwnProperty("darkThemeWallpaper")) { + var error = $root.proto.WallpaperSettings.verify(message.darkThemeWallpaper); + if (error) + return "darkThemeWallpaper." + error; + } + if (message.autoDownloadWiFi != null && message.hasOwnProperty("autoDownloadWiFi")) { + var error = $root.proto.AutoDownloadSettings.verify(message.autoDownloadWiFi); + if (error) + return "autoDownloadWiFi." + error; + } + if (message.autoDownloadCellular != null && message.hasOwnProperty("autoDownloadCellular")) { + var error = $root.proto.AutoDownloadSettings.verify(message.autoDownloadCellular); + if (error) + return "autoDownloadCellular." + error; } + if (message.autoDownloadRoaming != null && message.hasOwnProperty("autoDownloadRoaming")) { + var error = $root.proto.AutoDownloadSettings.verify(message.autoDownloadRoaming); + if (error) + return "autoDownloadRoaming." + error; + } + if (message.showIndividualNotificationsPreview != null && message.hasOwnProperty("showIndividualNotificationsPreview")) + if (typeof message.showIndividualNotificationsPreview !== "boolean") + return "showIndividualNotificationsPreview: boolean expected"; + if (message.showGroupNotificationsPreview != null && message.hasOwnProperty("showGroupNotificationsPreview")) + if (typeof message.showGroupNotificationsPreview !== "boolean") + return "showGroupNotificationsPreview: boolean expected"; return null; }; /** - * Creates a StickerMessage message from a plain object. Also converts values to their respective internal types. + * Creates a GlobalSettings message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof proto.StickerMessage + * @memberof proto.GlobalSettings * @static * @param {Object.} object Plain object - * @returns {proto.StickerMessage} StickerMessage + * @returns {proto.GlobalSettings} GlobalSettings */ - StickerMessage.fromObject = function fromObject(object) { - if (object instanceof $root.proto.StickerMessage) + GlobalSettings.fromObject = function fromObject(object) { + if (object instanceof $root.proto.GlobalSettings) return object; - var message = new $root.proto.StickerMessage(); - if (object.url != null) - message.url = String(object.url); - if (object.fileSha256 != null) - if (typeof object.fileSha256 === "string") - $util.base64.decode(object.fileSha256, message.fileSha256 = $util.newBuffer($util.base64.length(object.fileSha256)), 0); - else if (object.fileSha256.length) - message.fileSha256 = object.fileSha256; - if (object.fileEncSha256 != null) - if (typeof object.fileEncSha256 === "string") - $util.base64.decode(object.fileEncSha256, message.fileEncSha256 = $util.newBuffer($util.base64.length(object.fileEncSha256)), 0); - else if (object.fileEncSha256.length) - message.fileEncSha256 = object.fileEncSha256; - if (object.mediaKey != null) - if (typeof object.mediaKey === "string") - $util.base64.decode(object.mediaKey, message.mediaKey = $util.newBuffer($util.base64.length(object.mediaKey)), 0); - else if (object.mediaKey.length) - message.mediaKey = object.mediaKey; - if (object.mimetype != null) - message.mimetype = String(object.mimetype); - if (object.height != null) - message.height = object.height >>> 0; - if (object.width != null) - message.width = object.width >>> 0; - if (object.directPath != null) - message.directPath = String(object.directPath); - if (object.fileLength != null) - if ($util.Long) - (message.fileLength = $util.Long.fromValue(object.fileLength)).unsigned = true; - else if (typeof object.fileLength === "string") - message.fileLength = parseInt(object.fileLength, 10); - else if (typeof object.fileLength === "number") - message.fileLength = object.fileLength; - else if (typeof object.fileLength === "object") - message.fileLength = new $util.LongBits(object.fileLength.low >>> 0, object.fileLength.high >>> 0).toNumber(true); - if (object.mediaKeyTimestamp != null) - if ($util.Long) - (message.mediaKeyTimestamp = $util.Long.fromValue(object.mediaKeyTimestamp)).unsigned = false; - else if (typeof object.mediaKeyTimestamp === "string") - message.mediaKeyTimestamp = parseInt(object.mediaKeyTimestamp, 10); - else if (typeof object.mediaKeyTimestamp === "number") - message.mediaKeyTimestamp = object.mediaKeyTimestamp; - else if (typeof object.mediaKeyTimestamp === "object") - message.mediaKeyTimestamp = new $util.LongBits(object.mediaKeyTimestamp.low >>> 0, object.mediaKeyTimestamp.high >>> 0).toNumber(); - if (object.firstFrameLength != null) - message.firstFrameLength = object.firstFrameLength >>> 0; - if (object.firstFrameSidecar != null) - if (typeof object.firstFrameSidecar === "string") - $util.base64.decode(object.firstFrameSidecar, message.firstFrameSidecar = $util.newBuffer($util.base64.length(object.firstFrameSidecar)), 0); - else if (object.firstFrameSidecar.length) - message.firstFrameSidecar = object.firstFrameSidecar; - if (object.isAnimated != null) - message.isAnimated = Boolean(object.isAnimated); - if (object.pngThumbnail != null) - if (typeof object.pngThumbnail === "string") - $util.base64.decode(object.pngThumbnail, message.pngThumbnail = $util.newBuffer($util.base64.length(object.pngThumbnail)), 0); - else if (object.pngThumbnail.length) - message.pngThumbnail = object.pngThumbnail; - if (object.contextInfo != null) { - if (typeof object.contextInfo !== "object") - throw TypeError(".proto.StickerMessage.contextInfo: object expected"); - message.contextInfo = $root.proto.ContextInfo.fromObject(object.contextInfo); + var message = new $root.proto.GlobalSettings(); + if (object.lightThemeWallpaper != null) { + if (typeof object.lightThemeWallpaper !== "object") + throw TypeError(".proto.GlobalSettings.lightThemeWallpaper: object expected"); + message.lightThemeWallpaper = $root.proto.WallpaperSettings.fromObject(object.lightThemeWallpaper); + } + switch (object.mediaVisibility) { + case "DEFAULT": + case 0: + message.mediaVisibility = 0; + break; + case "OFF": + case 1: + message.mediaVisibility = 1; + break; + case "ON": + case 2: + message.mediaVisibility = 2; + break; + } + if (object.darkThemeWallpaper != null) { + if (typeof object.darkThemeWallpaper !== "object") + throw TypeError(".proto.GlobalSettings.darkThemeWallpaper: object expected"); + message.darkThemeWallpaper = $root.proto.WallpaperSettings.fromObject(object.darkThemeWallpaper); + } + if (object.autoDownloadWiFi != null) { + if (typeof object.autoDownloadWiFi !== "object") + throw TypeError(".proto.GlobalSettings.autoDownloadWiFi: object expected"); + message.autoDownloadWiFi = $root.proto.AutoDownloadSettings.fromObject(object.autoDownloadWiFi); + } + if (object.autoDownloadCellular != null) { + if (typeof object.autoDownloadCellular !== "object") + throw TypeError(".proto.GlobalSettings.autoDownloadCellular: object expected"); + message.autoDownloadCellular = $root.proto.AutoDownloadSettings.fromObject(object.autoDownloadCellular); + } + if (object.autoDownloadRoaming != null) { + if (typeof object.autoDownloadRoaming !== "object") + throw TypeError(".proto.GlobalSettings.autoDownloadRoaming: object expected"); + message.autoDownloadRoaming = $root.proto.AutoDownloadSettings.fromObject(object.autoDownloadRoaming); } + if (object.showIndividualNotificationsPreview != null) + message.showIndividualNotificationsPreview = Boolean(object.showIndividualNotificationsPreview); + if (object.showGroupNotificationsPreview != null) + message.showGroupNotificationsPreview = Boolean(object.showGroupNotificationsPreview); return message; }; /** - * Creates a plain object from a StickerMessage message. Also converts values to other types if specified. + * Creates a plain object from a GlobalSettings message. Also converts values to other types if specified. * @function toObject - * @memberof proto.StickerMessage + * @memberof proto.GlobalSettings * @static - * @param {proto.StickerMessage} message StickerMessage + * @param {proto.GlobalSettings} message GlobalSettings * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - StickerMessage.toObject = function toObject(message, options) { + GlobalSettings.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.url = ""; - if (options.bytes === String) - object.fileSha256 = ""; - else { - object.fileSha256 = []; - if (options.bytes !== Array) - object.fileSha256 = $util.newBuffer(object.fileSha256); - } - if (options.bytes === String) - object.fileEncSha256 = ""; - else { - object.fileEncSha256 = []; - if (options.bytes !== Array) - object.fileEncSha256 = $util.newBuffer(object.fileEncSha256); - } - if (options.bytes === String) - object.mediaKey = ""; - else { - object.mediaKey = []; - if (options.bytes !== Array) - object.mediaKey = $util.newBuffer(object.mediaKey); - } - object.mimetype = ""; - object.height = 0; - object.width = 0; - object.directPath = ""; - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.fileLength = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.fileLength = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.mediaKeyTimestamp = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.mediaKeyTimestamp = options.longs === String ? "0" : 0; - object.firstFrameLength = 0; - if (options.bytes === String) - object.firstFrameSidecar = ""; - else { - object.firstFrameSidecar = []; - if (options.bytes !== Array) - object.firstFrameSidecar = $util.newBuffer(object.firstFrameSidecar); - } - object.isAnimated = false; - if (options.bytes === String) - object.pngThumbnail = ""; - else { - object.pngThumbnail = []; - if (options.bytes !== Array) - object.pngThumbnail = $util.newBuffer(object.pngThumbnail); - } - object.contextInfo = null; + object.lightThemeWallpaper = null; + object.mediaVisibility = options.enums === String ? "DEFAULT" : 0; + object.darkThemeWallpaper = null; + object.autoDownloadWiFi = null; + object.autoDownloadCellular = null; + object.autoDownloadRoaming = null; + object.showIndividualNotificationsPreview = false; + object.showGroupNotificationsPreview = false; } - if (message.url != null && message.hasOwnProperty("url")) - object.url = message.url; - if (message.fileSha256 != null && message.hasOwnProperty("fileSha256")) - object.fileSha256 = options.bytes === String ? $util.base64.encode(message.fileSha256, 0, message.fileSha256.length) : options.bytes === Array ? Array.prototype.slice.call(message.fileSha256) : message.fileSha256; - if (message.fileEncSha256 != null && message.hasOwnProperty("fileEncSha256")) - object.fileEncSha256 = options.bytes === String ? $util.base64.encode(message.fileEncSha256, 0, message.fileEncSha256.length) : options.bytes === Array ? Array.prototype.slice.call(message.fileEncSha256) : message.fileEncSha256; - if (message.mediaKey != null && message.hasOwnProperty("mediaKey")) - object.mediaKey = options.bytes === String ? $util.base64.encode(message.mediaKey, 0, message.mediaKey.length) : options.bytes === Array ? Array.prototype.slice.call(message.mediaKey) : message.mediaKey; - if (message.mimetype != null && message.hasOwnProperty("mimetype")) - object.mimetype = message.mimetype; - if (message.height != null && message.hasOwnProperty("height")) - object.height = message.height; - if (message.width != null && message.hasOwnProperty("width")) - object.width = message.width; - if (message.directPath != null && message.hasOwnProperty("directPath")) - object.directPath = message.directPath; - if (message.fileLength != null && message.hasOwnProperty("fileLength")) - if (typeof message.fileLength === "number") - object.fileLength = options.longs === String ? String(message.fileLength) : message.fileLength; - else - object.fileLength = options.longs === String ? $util.Long.prototype.toString.call(message.fileLength) : options.longs === Number ? new $util.LongBits(message.fileLength.low >>> 0, message.fileLength.high >>> 0).toNumber(true) : message.fileLength; - if (message.mediaKeyTimestamp != null && message.hasOwnProperty("mediaKeyTimestamp")) - if (typeof message.mediaKeyTimestamp === "number") - object.mediaKeyTimestamp = options.longs === String ? String(message.mediaKeyTimestamp) : message.mediaKeyTimestamp; - else - object.mediaKeyTimestamp = options.longs === String ? $util.Long.prototype.toString.call(message.mediaKeyTimestamp) : options.longs === Number ? new $util.LongBits(message.mediaKeyTimestamp.low >>> 0, message.mediaKeyTimestamp.high >>> 0).toNumber() : message.mediaKeyTimestamp; - if (message.firstFrameLength != null && message.hasOwnProperty("firstFrameLength")) - object.firstFrameLength = message.firstFrameLength; - if (message.firstFrameSidecar != null && message.hasOwnProperty("firstFrameSidecar")) - object.firstFrameSidecar = options.bytes === String ? $util.base64.encode(message.firstFrameSidecar, 0, message.firstFrameSidecar.length) : options.bytes === Array ? Array.prototype.slice.call(message.firstFrameSidecar) : message.firstFrameSidecar; - if (message.isAnimated != null && message.hasOwnProperty("isAnimated")) - object.isAnimated = message.isAnimated; - if (message.pngThumbnail != null && message.hasOwnProperty("pngThumbnail")) - object.pngThumbnail = options.bytes === String ? $util.base64.encode(message.pngThumbnail, 0, message.pngThumbnail.length) : options.bytes === Array ? Array.prototype.slice.call(message.pngThumbnail) : message.pngThumbnail; - if (message.contextInfo != null && message.hasOwnProperty("contextInfo")) - object.contextInfo = $root.proto.ContextInfo.toObject(message.contextInfo, options); + if (message.lightThemeWallpaper != null && message.hasOwnProperty("lightThemeWallpaper")) + object.lightThemeWallpaper = $root.proto.WallpaperSettings.toObject(message.lightThemeWallpaper, options); + if (message.mediaVisibility != null && message.hasOwnProperty("mediaVisibility")) + object.mediaVisibility = options.enums === String ? $root.proto.MediaVisibility[message.mediaVisibility] : message.mediaVisibility; + if (message.darkThemeWallpaper != null && message.hasOwnProperty("darkThemeWallpaper")) + object.darkThemeWallpaper = $root.proto.WallpaperSettings.toObject(message.darkThemeWallpaper, options); + if (message.autoDownloadWiFi != null && message.hasOwnProperty("autoDownloadWiFi")) + object.autoDownloadWiFi = $root.proto.AutoDownloadSettings.toObject(message.autoDownloadWiFi, options); + if (message.autoDownloadCellular != null && message.hasOwnProperty("autoDownloadCellular")) + object.autoDownloadCellular = $root.proto.AutoDownloadSettings.toObject(message.autoDownloadCellular, options); + if (message.autoDownloadRoaming != null && message.hasOwnProperty("autoDownloadRoaming")) + object.autoDownloadRoaming = $root.proto.AutoDownloadSettings.toObject(message.autoDownloadRoaming, options); + if (message.showIndividualNotificationsPreview != null && message.hasOwnProperty("showIndividualNotificationsPreview")) + object.showIndividualNotificationsPreview = message.showIndividualNotificationsPreview; + if (message.showGroupNotificationsPreview != null && message.hasOwnProperty("showGroupNotificationsPreview")) + object.showGroupNotificationsPreview = message.showGroupNotificationsPreview; return object; }; /** - * Converts this StickerMessage to JSON. + * Converts this GlobalSettings to JSON. * @function toJSON - * @memberof proto.StickerMessage + * @memberof proto.GlobalSettings * @instance * @returns {Object.} JSON object */ - StickerMessage.prototype.toJSON = function toJSON() { + GlobalSettings.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return StickerMessage; + return GlobalSettings; })(); - proto.FourRowTemplate = (function() { + proto.GroupParticipant = (function() { /** - * Properties of a FourRowTemplate. + * Properties of a GroupParticipant. * @memberof proto - * @interface IFourRowTemplate - * @property {proto.IHighlyStructuredMessage|null} [content] FourRowTemplate content - * @property {proto.IHighlyStructuredMessage|null} [footer] FourRowTemplate footer - * @property {Array.|null} [buttons] FourRowTemplate buttons - * @property {proto.IDocumentMessage|null} [documentMessage] FourRowTemplate documentMessage - * @property {proto.IHighlyStructuredMessage|null} [highlyStructuredMessage] FourRowTemplate highlyStructuredMessage - * @property {proto.IImageMessage|null} [imageMessage] FourRowTemplate imageMessage - * @property {proto.IVideoMessage|null} [videoMessage] FourRowTemplate videoMessage - * @property {proto.ILocationMessage|null} [locationMessage] FourRowTemplate locationMessage + * @interface IGroupParticipant + * @property {string} userJid GroupParticipant userJid + * @property {proto.GroupParticipant.GroupParticipantRank|null} [rank] GroupParticipant rank */ /** - * Constructs a new FourRowTemplate. + * Constructs a new GroupParticipant. * @memberof proto - * @classdesc Represents a FourRowTemplate. - * @implements IFourRowTemplate + * @classdesc Represents a GroupParticipant. + * @implements IGroupParticipant * @constructor - * @param {proto.IFourRowTemplate=} [properties] Properties to set + * @param {proto.IGroupParticipant=} [properties] Properties to set */ - function FourRowTemplate(properties) { - this.buttons = []; + function GroupParticipant(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -35462,447 +35938,253 @@ $root.proto = (function() { } /** - * FourRowTemplate content. - * @member {proto.IHighlyStructuredMessage|null|undefined} content - * @memberof proto.FourRowTemplate - * @instance - */ - FourRowTemplate.prototype.content = null; - - /** - * FourRowTemplate footer. - * @member {proto.IHighlyStructuredMessage|null|undefined} footer - * @memberof proto.FourRowTemplate - * @instance - */ - FourRowTemplate.prototype.footer = null; - - /** - * FourRowTemplate buttons. - * @member {Array.} buttons - * @memberof proto.FourRowTemplate - * @instance - */ - FourRowTemplate.prototype.buttons = $util.emptyArray; - - /** - * FourRowTemplate documentMessage. - * @member {proto.IDocumentMessage|null|undefined} documentMessage - * @memberof proto.FourRowTemplate - * @instance - */ - FourRowTemplate.prototype.documentMessage = null; - - /** - * FourRowTemplate highlyStructuredMessage. - * @member {proto.IHighlyStructuredMessage|null|undefined} highlyStructuredMessage - * @memberof proto.FourRowTemplate - * @instance - */ - FourRowTemplate.prototype.highlyStructuredMessage = null; - - /** - * FourRowTemplate imageMessage. - * @member {proto.IImageMessage|null|undefined} imageMessage - * @memberof proto.FourRowTemplate - * @instance - */ - FourRowTemplate.prototype.imageMessage = null; - - /** - * FourRowTemplate videoMessage. - * @member {proto.IVideoMessage|null|undefined} videoMessage - * @memberof proto.FourRowTemplate - * @instance - */ - FourRowTemplate.prototype.videoMessage = null; - - /** - * FourRowTemplate locationMessage. - * @member {proto.ILocationMessage|null|undefined} locationMessage - * @memberof proto.FourRowTemplate + * GroupParticipant userJid. + * @member {string} userJid + * @memberof proto.GroupParticipant * @instance */ - FourRowTemplate.prototype.locationMessage = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + GroupParticipant.prototype.userJid = ""; /** - * FourRowTemplate title. - * @member {"documentMessage"|"highlyStructuredMessage"|"imageMessage"|"videoMessage"|"locationMessage"|undefined} title - * @memberof proto.FourRowTemplate + * GroupParticipant rank. + * @member {proto.GroupParticipant.GroupParticipantRank} rank + * @memberof proto.GroupParticipant * @instance */ - Object.defineProperty(FourRowTemplate.prototype, "title", { - get: $util.oneOfGetter($oneOfFields = ["documentMessage", "highlyStructuredMessage", "imageMessage", "videoMessage", "locationMessage"]), - set: $util.oneOfSetter($oneOfFields) - }); + GroupParticipant.prototype.rank = 0; /** - * Creates a new FourRowTemplate instance using the specified properties. + * Creates a new GroupParticipant instance using the specified properties. * @function create - * @memberof proto.FourRowTemplate + * @memberof proto.GroupParticipant * @static - * @param {proto.IFourRowTemplate=} [properties] Properties to set - * @returns {proto.FourRowTemplate} FourRowTemplate instance + * @param {proto.IGroupParticipant=} [properties] Properties to set + * @returns {proto.GroupParticipant} GroupParticipant instance */ - FourRowTemplate.create = function create(properties) { - return new FourRowTemplate(properties); + GroupParticipant.create = function create(properties) { + return new GroupParticipant(properties); }; /** - * Encodes the specified FourRowTemplate message. Does not implicitly {@link proto.FourRowTemplate.verify|verify} messages. + * Encodes the specified GroupParticipant message. Does not implicitly {@link proto.GroupParticipant.verify|verify} messages. * @function encode - * @memberof proto.FourRowTemplate + * @memberof proto.GroupParticipant * @static - * @param {proto.IFourRowTemplate} message FourRowTemplate message or plain object to encode + * @param {proto.IGroupParticipant} message GroupParticipant message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - FourRowTemplate.encode = function encode(message, writer) { + GroupParticipant.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.documentMessage != null && Object.hasOwnProperty.call(message, "documentMessage")) - $root.proto.DocumentMessage.encode(message.documentMessage, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.highlyStructuredMessage != null && Object.hasOwnProperty.call(message, "highlyStructuredMessage")) - $root.proto.HighlyStructuredMessage.encode(message.highlyStructuredMessage, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.imageMessage != null && Object.hasOwnProperty.call(message, "imageMessage")) - $root.proto.ImageMessage.encode(message.imageMessage, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.videoMessage != null && Object.hasOwnProperty.call(message, "videoMessage")) - $root.proto.VideoMessage.encode(message.videoMessage, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.locationMessage != null && Object.hasOwnProperty.call(message, "locationMessage")) - $root.proto.LocationMessage.encode(message.locationMessage, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.content != null && Object.hasOwnProperty.call(message, "content")) - $root.proto.HighlyStructuredMessage.encode(message.content, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.footer != null && Object.hasOwnProperty.call(message, "footer")) - $root.proto.HighlyStructuredMessage.encode(message.footer, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.buttons != null && message.buttons.length) - for (var i = 0; i < message.buttons.length; ++i) - $root.proto.TemplateButton.encode(message.buttons[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + writer.uint32(/* id 1, wireType 2 =*/10).string(message.userJid); + if (message.rank != null && Object.hasOwnProperty.call(message, "rank")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.rank); return writer; }; /** - * Encodes the specified FourRowTemplate message, length delimited. Does not implicitly {@link proto.FourRowTemplate.verify|verify} messages. + * Encodes the specified GroupParticipant message, length delimited. Does not implicitly {@link proto.GroupParticipant.verify|verify} messages. * @function encodeDelimited - * @memberof proto.FourRowTemplate + * @memberof proto.GroupParticipant * @static - * @param {proto.IFourRowTemplate} message FourRowTemplate message or plain object to encode + * @param {proto.IGroupParticipant} message GroupParticipant message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - FourRowTemplate.encodeDelimited = function encodeDelimited(message, writer) { + GroupParticipant.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a FourRowTemplate message from the specified reader or buffer. + * Decodes a GroupParticipant message from the specified reader or buffer. * @function decode - * @memberof proto.FourRowTemplate + * @memberof proto.GroupParticipant * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {proto.FourRowTemplate} FourRowTemplate + * @returns {proto.GroupParticipant} GroupParticipant * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - FourRowTemplate.decode = function decode(reader, length) { + GroupParticipant.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.FourRowTemplate(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.GroupParticipant(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 6: - message.content = $root.proto.HighlyStructuredMessage.decode(reader, reader.uint32()); - break; - case 7: - message.footer = $root.proto.HighlyStructuredMessage.decode(reader, reader.uint32()); - break; - case 8: - if (!(message.buttons && message.buttons.length)) - message.buttons = []; - message.buttons.push($root.proto.TemplateButton.decode(reader, reader.uint32())); - break; case 1: - message.documentMessage = $root.proto.DocumentMessage.decode(reader, reader.uint32()); + message.userJid = reader.string(); break; case 2: - message.highlyStructuredMessage = $root.proto.HighlyStructuredMessage.decode(reader, reader.uint32()); - break; - case 3: - message.imageMessage = $root.proto.ImageMessage.decode(reader, reader.uint32()); - break; - case 4: - message.videoMessage = $root.proto.VideoMessage.decode(reader, reader.uint32()); - break; - case 5: - message.locationMessage = $root.proto.LocationMessage.decode(reader, reader.uint32()); + message.rank = reader.int32(); break; default: reader.skipType(tag & 7); break; } } + if (!message.hasOwnProperty("userJid")) + throw $util.ProtocolError("missing required 'userJid'", { instance: message }); return message; }; /** - * Decodes a FourRowTemplate message from the specified reader or buffer, length delimited. + * Decodes a GroupParticipant message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof proto.FourRowTemplate + * @memberof proto.GroupParticipant * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.FourRowTemplate} FourRowTemplate + * @returns {proto.GroupParticipant} GroupParticipant * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - FourRowTemplate.decodeDelimited = function decodeDelimited(reader) { + GroupParticipant.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a FourRowTemplate message. + * Verifies a GroupParticipant message. * @function verify - * @memberof proto.FourRowTemplate + * @memberof proto.GroupParticipant * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - FourRowTemplate.verify = function verify(message) { + GroupParticipant.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - var properties = {}; - if (message.content != null && message.hasOwnProperty("content")) { - var error = $root.proto.HighlyStructuredMessage.verify(message.content); - if (error) - return "content." + error; - } - if (message.footer != null && message.hasOwnProperty("footer")) { - var error = $root.proto.HighlyStructuredMessage.verify(message.footer); - if (error) - return "footer." + error; - } - if (message.buttons != null && message.hasOwnProperty("buttons")) { - if (!Array.isArray(message.buttons)) - return "buttons: array expected"; - for (var i = 0; i < message.buttons.length; ++i) { - var error = $root.proto.TemplateButton.verify(message.buttons[i]); - if (error) - return "buttons." + error; - } - } - if (message.documentMessage != null && message.hasOwnProperty("documentMessage")) { - properties.title = 1; - { - var error = $root.proto.DocumentMessage.verify(message.documentMessage); - if (error) - return "documentMessage." + error; - } - } - if (message.highlyStructuredMessage != null && message.hasOwnProperty("highlyStructuredMessage")) { - if (properties.title === 1) - return "title: multiple values"; - properties.title = 1; - { - var error = $root.proto.HighlyStructuredMessage.verify(message.highlyStructuredMessage); - if (error) - return "highlyStructuredMessage." + error; - } - } - if (message.imageMessage != null && message.hasOwnProperty("imageMessage")) { - if (properties.title === 1) - return "title: multiple values"; - properties.title = 1; - { - var error = $root.proto.ImageMessage.verify(message.imageMessage); - if (error) - return "imageMessage." + error; - } - } - if (message.videoMessage != null && message.hasOwnProperty("videoMessage")) { - if (properties.title === 1) - return "title: multiple values"; - properties.title = 1; - { - var error = $root.proto.VideoMessage.verify(message.videoMessage); - if (error) - return "videoMessage." + error; - } - } - if (message.locationMessage != null && message.hasOwnProperty("locationMessage")) { - if (properties.title === 1) - return "title: multiple values"; - properties.title = 1; - { - var error = $root.proto.LocationMessage.verify(message.locationMessage); - if (error) - return "locationMessage." + error; + if (!$util.isString(message.userJid)) + return "userJid: string expected"; + if (message.rank != null && message.hasOwnProperty("rank")) + switch (message.rank) { + default: + return "rank: enum value expected"; + case 0: + case 1: + case 2: + break; } - } return null; }; /** - * Creates a FourRowTemplate message from a plain object. Also converts values to their respective internal types. + * Creates a GroupParticipant message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof proto.FourRowTemplate + * @memberof proto.GroupParticipant * @static * @param {Object.} object Plain object - * @returns {proto.FourRowTemplate} FourRowTemplate + * @returns {proto.GroupParticipant} GroupParticipant */ - FourRowTemplate.fromObject = function fromObject(object) { - if (object instanceof $root.proto.FourRowTemplate) + GroupParticipant.fromObject = function fromObject(object) { + if (object instanceof $root.proto.GroupParticipant) return object; - var message = new $root.proto.FourRowTemplate(); - if (object.content != null) { - if (typeof object.content !== "object") - throw TypeError(".proto.FourRowTemplate.content: object expected"); - message.content = $root.proto.HighlyStructuredMessage.fromObject(object.content); - } - if (object.footer != null) { - if (typeof object.footer !== "object") - throw TypeError(".proto.FourRowTemplate.footer: object expected"); - message.footer = $root.proto.HighlyStructuredMessage.fromObject(object.footer); + var message = new $root.proto.GroupParticipant(); + if (object.userJid != null) + message.userJid = String(object.userJid); + switch (object.rank) { + case "REGULAR": + case 0: + message.rank = 0; + break; + case "ADMIN": + case 1: + message.rank = 1; + break; + case "SUPERADMIN": + case 2: + message.rank = 2; + break; } - if (object.buttons) { - if (!Array.isArray(object.buttons)) - throw TypeError(".proto.FourRowTemplate.buttons: array expected"); - message.buttons = []; - for (var i = 0; i < object.buttons.length; ++i) { - if (typeof object.buttons[i] !== "object") - throw TypeError(".proto.FourRowTemplate.buttons: object expected"); - message.buttons[i] = $root.proto.TemplateButton.fromObject(object.buttons[i]); - } - } - if (object.documentMessage != null) { - if (typeof object.documentMessage !== "object") - throw TypeError(".proto.FourRowTemplate.documentMessage: object expected"); - message.documentMessage = $root.proto.DocumentMessage.fromObject(object.documentMessage); - } - if (object.highlyStructuredMessage != null) { - if (typeof object.highlyStructuredMessage !== "object") - throw TypeError(".proto.FourRowTemplate.highlyStructuredMessage: object expected"); - message.highlyStructuredMessage = $root.proto.HighlyStructuredMessage.fromObject(object.highlyStructuredMessage); - } - if (object.imageMessage != null) { - if (typeof object.imageMessage !== "object") - throw TypeError(".proto.FourRowTemplate.imageMessage: object expected"); - message.imageMessage = $root.proto.ImageMessage.fromObject(object.imageMessage); - } - if (object.videoMessage != null) { - if (typeof object.videoMessage !== "object") - throw TypeError(".proto.FourRowTemplate.videoMessage: object expected"); - message.videoMessage = $root.proto.VideoMessage.fromObject(object.videoMessage); - } - if (object.locationMessage != null) { - if (typeof object.locationMessage !== "object") - throw TypeError(".proto.FourRowTemplate.locationMessage: object expected"); - message.locationMessage = $root.proto.LocationMessage.fromObject(object.locationMessage); - } - return message; - }; - - /** - * Creates a plain object from a FourRowTemplate message. Also converts values to other types if specified. - * @function toObject - * @memberof proto.FourRowTemplate - * @static - * @param {proto.FourRowTemplate} message FourRowTemplate - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FourRowTemplate.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.buttons = []; - if (options.defaults) { - object.content = null; - object.footer = null; - } - if (message.documentMessage != null && message.hasOwnProperty("documentMessage")) { - object.documentMessage = $root.proto.DocumentMessage.toObject(message.documentMessage, options); - if (options.oneofs) - object.title = "documentMessage"; - } - if (message.highlyStructuredMessage != null && message.hasOwnProperty("highlyStructuredMessage")) { - object.highlyStructuredMessage = $root.proto.HighlyStructuredMessage.toObject(message.highlyStructuredMessage, options); - if (options.oneofs) - object.title = "highlyStructuredMessage"; - } - if (message.imageMessage != null && message.hasOwnProperty("imageMessage")) { - object.imageMessage = $root.proto.ImageMessage.toObject(message.imageMessage, options); - if (options.oneofs) - object.title = "imageMessage"; - } - if (message.videoMessage != null && message.hasOwnProperty("videoMessage")) { - object.videoMessage = $root.proto.VideoMessage.toObject(message.videoMessage, options); - if (options.oneofs) - object.title = "videoMessage"; - } - if (message.locationMessage != null && message.hasOwnProperty("locationMessage")) { - object.locationMessage = $root.proto.LocationMessage.toObject(message.locationMessage, options); - if (options.oneofs) - object.title = "locationMessage"; - } - if (message.content != null && message.hasOwnProperty("content")) - object.content = $root.proto.HighlyStructuredMessage.toObject(message.content, options); - if (message.footer != null && message.hasOwnProperty("footer")) - object.footer = $root.proto.HighlyStructuredMessage.toObject(message.footer, options); - if (message.buttons && message.buttons.length) { - object.buttons = []; - for (var j = 0; j < message.buttons.length; ++j) - object.buttons[j] = $root.proto.TemplateButton.toObject(message.buttons[j], options); + return message; + }; + + /** + * Creates a plain object from a GroupParticipant message. Also converts values to other types if specified. + * @function toObject + * @memberof proto.GroupParticipant + * @static + * @param {proto.GroupParticipant} message GroupParticipant + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GroupParticipant.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.userJid = ""; + object.rank = options.enums === String ? "REGULAR" : 0; } + if (message.userJid != null && message.hasOwnProperty("userJid")) + object.userJid = message.userJid; + if (message.rank != null && message.hasOwnProperty("rank")) + object.rank = options.enums === String ? $root.proto.GroupParticipant.GroupParticipantRank[message.rank] : message.rank; return object; }; /** - * Converts this FourRowTemplate to JSON. + * Converts this GroupParticipant to JSON. * @function toJSON - * @memberof proto.FourRowTemplate + * @memberof proto.GroupParticipant * @instance * @returns {Object.} JSON object */ - FourRowTemplate.prototype.toJSON = function toJSON() { + GroupParticipant.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return FourRowTemplate; + /** + * GroupParticipantRank enum. + * @name proto.GroupParticipant.GroupParticipantRank + * @enum {number} + * @property {number} REGULAR=0 REGULAR value + * @property {number} ADMIN=1 ADMIN value + * @property {number} SUPERADMIN=2 SUPERADMIN value + */ + GroupParticipant.GroupParticipantRank = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "REGULAR"] = 0; + values[valuesById[1] = "ADMIN"] = 1; + values[valuesById[2] = "SUPERADMIN"] = 2; + return values; + })(); + + return GroupParticipant; })(); - proto.HydratedFourRowTemplate = (function() { + proto.HistorySync = (function() { /** - * Properties of a HydratedFourRowTemplate. + * Properties of a HistorySync. * @memberof proto - * @interface IHydratedFourRowTemplate - * @property {string|null} [hydratedContentText] HydratedFourRowTemplate hydratedContentText - * @property {string|null} [hydratedFooterText] HydratedFourRowTemplate hydratedFooterText - * @property {Array.|null} [hydratedButtons] HydratedFourRowTemplate hydratedButtons - * @property {string|null} [templateId] HydratedFourRowTemplate templateId - * @property {proto.IDocumentMessage|null} [documentMessage] HydratedFourRowTemplate documentMessage - * @property {string|null} [hydratedTitleText] HydratedFourRowTemplate hydratedTitleText - * @property {proto.IImageMessage|null} [imageMessage] HydratedFourRowTemplate imageMessage - * @property {proto.IVideoMessage|null} [videoMessage] HydratedFourRowTemplate videoMessage - * @property {proto.ILocationMessage|null} [locationMessage] HydratedFourRowTemplate locationMessage + * @interface IHistorySync + * @property {proto.HistorySync.HistorySyncHistorySyncType} syncType HistorySync syncType + * @property {Array.|null} [conversations] HistorySync conversations + * @property {Array.|null} [statusV3Messages] HistorySync statusV3Messages + * @property {number|null} [chunkOrder] HistorySync chunkOrder + * @property {number|null} [progress] HistorySync progress + * @property {Array.|null} [pushnames] HistorySync pushnames + * @property {proto.IGlobalSettings|null} [globalSettings] HistorySync globalSettings + * @property {Uint8Array|null} [threadIdUserSecret] HistorySync threadIdUserSecret + * @property {number|null} [threadDsTimeframeOffset] HistorySync threadDsTimeframeOffset */ /** - * Constructs a new HydratedFourRowTemplate. + * Constructs a new HistorySync. * @memberof proto - * @classdesc Represents a HydratedFourRowTemplate. - * @implements IHydratedFourRowTemplate + * @classdesc Represents a HistorySync. + * @implements IHistorySync * @constructor - * @param {proto.IHydratedFourRowTemplate=} [properties] Properties to set + * @param {proto.IHistorySync=} [properties] Properties to set */ - function HydratedFourRowTemplate(properties) { - this.hydratedButtons = []; + function HistorySync(properties) { + this.conversations = []; + this.statusV3Messages = []; + this.pushnames = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -35910,446 +36192,480 @@ $root.proto = (function() { } /** - * HydratedFourRowTemplate hydratedContentText. - * @member {string} hydratedContentText - * @memberof proto.HydratedFourRowTemplate - * @instance - */ - HydratedFourRowTemplate.prototype.hydratedContentText = ""; - - /** - * HydratedFourRowTemplate hydratedFooterText. - * @member {string} hydratedFooterText - * @memberof proto.HydratedFourRowTemplate + * HistorySync syncType. + * @member {proto.HistorySync.HistorySyncHistorySyncType} syncType + * @memberof proto.HistorySync * @instance */ - HydratedFourRowTemplate.prototype.hydratedFooterText = ""; + HistorySync.prototype.syncType = 0; /** - * HydratedFourRowTemplate hydratedButtons. - * @member {Array.} hydratedButtons - * @memberof proto.HydratedFourRowTemplate + * HistorySync conversations. + * @member {Array.} conversations + * @memberof proto.HistorySync * @instance */ - HydratedFourRowTemplate.prototype.hydratedButtons = $util.emptyArray; + HistorySync.prototype.conversations = $util.emptyArray; /** - * HydratedFourRowTemplate templateId. - * @member {string} templateId - * @memberof proto.HydratedFourRowTemplate + * HistorySync statusV3Messages. + * @member {Array.} statusV3Messages + * @memberof proto.HistorySync * @instance */ - HydratedFourRowTemplate.prototype.templateId = ""; + HistorySync.prototype.statusV3Messages = $util.emptyArray; /** - * HydratedFourRowTemplate documentMessage. - * @member {proto.IDocumentMessage|null|undefined} documentMessage - * @memberof proto.HydratedFourRowTemplate + * HistorySync chunkOrder. + * @member {number} chunkOrder + * @memberof proto.HistorySync * @instance */ - HydratedFourRowTemplate.prototype.documentMessage = null; + HistorySync.prototype.chunkOrder = 0; /** - * HydratedFourRowTemplate hydratedTitleText. - * @member {string|null|undefined} hydratedTitleText - * @memberof proto.HydratedFourRowTemplate + * HistorySync progress. + * @member {number} progress + * @memberof proto.HistorySync * @instance */ - HydratedFourRowTemplate.prototype.hydratedTitleText = null; + HistorySync.prototype.progress = 0; /** - * HydratedFourRowTemplate imageMessage. - * @member {proto.IImageMessage|null|undefined} imageMessage - * @memberof proto.HydratedFourRowTemplate + * HistorySync pushnames. + * @member {Array.} pushnames + * @memberof proto.HistorySync * @instance */ - HydratedFourRowTemplate.prototype.imageMessage = null; + HistorySync.prototype.pushnames = $util.emptyArray; /** - * HydratedFourRowTemplate videoMessage. - * @member {proto.IVideoMessage|null|undefined} videoMessage - * @memberof proto.HydratedFourRowTemplate + * HistorySync globalSettings. + * @member {proto.IGlobalSettings|null|undefined} globalSettings + * @memberof proto.HistorySync * @instance */ - HydratedFourRowTemplate.prototype.videoMessage = null; + HistorySync.prototype.globalSettings = null; /** - * HydratedFourRowTemplate locationMessage. - * @member {proto.ILocationMessage|null|undefined} locationMessage - * @memberof proto.HydratedFourRowTemplate + * HistorySync threadIdUserSecret. + * @member {Uint8Array} threadIdUserSecret + * @memberof proto.HistorySync * @instance */ - HydratedFourRowTemplate.prototype.locationMessage = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + HistorySync.prototype.threadIdUserSecret = $util.newBuffer([]); /** - * HydratedFourRowTemplate title. - * @member {"documentMessage"|"hydratedTitleText"|"imageMessage"|"videoMessage"|"locationMessage"|undefined} title - * @memberof proto.HydratedFourRowTemplate + * HistorySync threadDsTimeframeOffset. + * @member {number} threadDsTimeframeOffset + * @memberof proto.HistorySync * @instance */ - Object.defineProperty(HydratedFourRowTemplate.prototype, "title", { - get: $util.oneOfGetter($oneOfFields = ["documentMessage", "hydratedTitleText", "imageMessage", "videoMessage", "locationMessage"]), - set: $util.oneOfSetter($oneOfFields) - }); + HistorySync.prototype.threadDsTimeframeOffset = 0; /** - * Creates a new HydratedFourRowTemplate instance using the specified properties. + * Creates a new HistorySync instance using the specified properties. * @function create - * @memberof proto.HydratedFourRowTemplate + * @memberof proto.HistorySync * @static - * @param {proto.IHydratedFourRowTemplate=} [properties] Properties to set - * @returns {proto.HydratedFourRowTemplate} HydratedFourRowTemplate instance + * @param {proto.IHistorySync=} [properties] Properties to set + * @returns {proto.HistorySync} HistorySync instance */ - HydratedFourRowTemplate.create = function create(properties) { - return new HydratedFourRowTemplate(properties); + HistorySync.create = function create(properties) { + return new HistorySync(properties); }; /** - * Encodes the specified HydratedFourRowTemplate message. Does not implicitly {@link proto.HydratedFourRowTemplate.verify|verify} messages. + * Encodes the specified HistorySync message. Does not implicitly {@link proto.HistorySync.verify|verify} messages. * @function encode - * @memberof proto.HydratedFourRowTemplate + * @memberof proto.HistorySync * @static - * @param {proto.IHydratedFourRowTemplate} message HydratedFourRowTemplate message or plain object to encode + * @param {proto.IHistorySync} message HistorySync message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - HydratedFourRowTemplate.encode = function encode(message, writer) { + HistorySync.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.documentMessage != null && Object.hasOwnProperty.call(message, "documentMessage")) - $root.proto.DocumentMessage.encode(message.documentMessage, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.hydratedTitleText != null && Object.hasOwnProperty.call(message, "hydratedTitleText")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.hydratedTitleText); - if (message.imageMessage != null && Object.hasOwnProperty.call(message, "imageMessage")) - $root.proto.ImageMessage.encode(message.imageMessage, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.videoMessage != null && Object.hasOwnProperty.call(message, "videoMessage")) - $root.proto.VideoMessage.encode(message.videoMessage, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.locationMessage != null && Object.hasOwnProperty.call(message, "locationMessage")) - $root.proto.LocationMessage.encode(message.locationMessage, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.hydratedContentText != null && Object.hasOwnProperty.call(message, "hydratedContentText")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.hydratedContentText); - if (message.hydratedFooterText != null && Object.hasOwnProperty.call(message, "hydratedFooterText")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.hydratedFooterText); - if (message.hydratedButtons != null && message.hydratedButtons.length) - for (var i = 0; i < message.hydratedButtons.length; ++i) - $root.proto.HydratedTemplateButton.encode(message.hydratedButtons[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.templateId != null && Object.hasOwnProperty.call(message, "templateId")) - writer.uint32(/* id 9, wireType 2 =*/74).string(message.templateId); + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.syncType); + if (message.conversations != null && message.conversations.length) + for (var i = 0; i < message.conversations.length; ++i) + $root.proto.Conversation.encode(message.conversations[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.statusV3Messages != null && message.statusV3Messages.length) + for (var i = 0; i < message.statusV3Messages.length; ++i) + $root.proto.WebMessageInfo.encode(message.statusV3Messages[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.chunkOrder != null && Object.hasOwnProperty.call(message, "chunkOrder")) + writer.uint32(/* id 5, wireType 0 =*/40).uint32(message.chunkOrder); + if (message.progress != null && Object.hasOwnProperty.call(message, "progress")) + writer.uint32(/* id 6, wireType 0 =*/48).uint32(message.progress); + if (message.pushnames != null && message.pushnames.length) + for (var i = 0; i < message.pushnames.length; ++i) + $root.proto.Pushname.encode(message.pushnames[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.globalSettings != null && Object.hasOwnProperty.call(message, "globalSettings")) + $root.proto.GlobalSettings.encode(message.globalSettings, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.threadIdUserSecret != null && Object.hasOwnProperty.call(message, "threadIdUserSecret")) + writer.uint32(/* id 9, wireType 2 =*/74).bytes(message.threadIdUserSecret); + if (message.threadDsTimeframeOffset != null && Object.hasOwnProperty.call(message, "threadDsTimeframeOffset")) + writer.uint32(/* id 10, wireType 0 =*/80).uint32(message.threadDsTimeframeOffset); return writer; }; /** - * Encodes the specified HydratedFourRowTemplate message, length delimited. Does not implicitly {@link proto.HydratedFourRowTemplate.verify|verify} messages. + * Encodes the specified HistorySync message, length delimited. Does not implicitly {@link proto.HistorySync.verify|verify} messages. * @function encodeDelimited - * @memberof proto.HydratedFourRowTemplate + * @memberof proto.HistorySync * @static - * @param {proto.IHydratedFourRowTemplate} message HydratedFourRowTemplate message or plain object to encode + * @param {proto.IHistorySync} message HistorySync message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - HydratedFourRowTemplate.encodeDelimited = function encodeDelimited(message, writer) { + HistorySync.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a HydratedFourRowTemplate message from the specified reader or buffer. + * Decodes a HistorySync message from the specified reader or buffer. * @function decode - * @memberof proto.HydratedFourRowTemplate + * @memberof proto.HistorySync * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {proto.HydratedFourRowTemplate} HydratedFourRowTemplate + * @returns {proto.HistorySync} HistorySync * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - HydratedFourRowTemplate.decode = function decode(reader, length) { + HistorySync.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.HydratedFourRowTemplate(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.HistorySync(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 6: - message.hydratedContentText = reader.string(); + case 1: + message.syncType = reader.int32(); break; - case 7: - message.hydratedFooterText = reader.string(); + case 2: + if (!(message.conversations && message.conversations.length)) + message.conversations = []; + message.conversations.push($root.proto.Conversation.decode(reader, reader.uint32())); break; - case 8: - if (!(message.hydratedButtons && message.hydratedButtons.length)) - message.hydratedButtons = []; - message.hydratedButtons.push($root.proto.HydratedTemplateButton.decode(reader, reader.uint32())); + case 3: + if (!(message.statusV3Messages && message.statusV3Messages.length)) + message.statusV3Messages = []; + message.statusV3Messages.push($root.proto.WebMessageInfo.decode(reader, reader.uint32())); break; - case 9: - message.templateId = reader.string(); + case 5: + message.chunkOrder = reader.uint32(); break; - case 1: - message.documentMessage = $root.proto.DocumentMessage.decode(reader, reader.uint32()); + case 6: + message.progress = reader.uint32(); break; - case 2: - message.hydratedTitleText = reader.string(); + case 7: + if (!(message.pushnames && message.pushnames.length)) + message.pushnames = []; + message.pushnames.push($root.proto.Pushname.decode(reader, reader.uint32())); break; - case 3: - message.imageMessage = $root.proto.ImageMessage.decode(reader, reader.uint32()); + case 8: + message.globalSettings = $root.proto.GlobalSettings.decode(reader, reader.uint32()); break; - case 4: - message.videoMessage = $root.proto.VideoMessage.decode(reader, reader.uint32()); + case 9: + message.threadIdUserSecret = reader.bytes(); break; - case 5: - message.locationMessage = $root.proto.LocationMessage.decode(reader, reader.uint32()); + case 10: + message.threadDsTimeframeOffset = reader.uint32(); break; default: reader.skipType(tag & 7); break; } } + if (!message.hasOwnProperty("syncType")) + throw $util.ProtocolError("missing required 'syncType'", { instance: message }); return message; }; /** - * Decodes a HydratedFourRowTemplate message from the specified reader or buffer, length delimited. + * Decodes a HistorySync message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof proto.HydratedFourRowTemplate + * @memberof proto.HistorySync * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.HydratedFourRowTemplate} HydratedFourRowTemplate + * @returns {proto.HistorySync} HistorySync * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - HydratedFourRowTemplate.decodeDelimited = function decodeDelimited(reader) { + HistorySync.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a HydratedFourRowTemplate message. + * Verifies a HistorySync message. * @function verify - * @memberof proto.HydratedFourRowTemplate + * @memberof proto.HistorySync * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - HydratedFourRowTemplate.verify = function verify(message) { + HistorySync.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - var properties = {}; - if (message.hydratedContentText != null && message.hasOwnProperty("hydratedContentText")) - if (!$util.isString(message.hydratedContentText)) - return "hydratedContentText: string expected"; - if (message.hydratedFooterText != null && message.hasOwnProperty("hydratedFooterText")) - if (!$util.isString(message.hydratedFooterText)) - return "hydratedFooterText: string expected"; - if (message.hydratedButtons != null && message.hasOwnProperty("hydratedButtons")) { - if (!Array.isArray(message.hydratedButtons)) - return "hydratedButtons: array expected"; - for (var i = 0; i < message.hydratedButtons.length; ++i) { - var error = $root.proto.HydratedTemplateButton.verify(message.hydratedButtons[i]); - if (error) - return "hydratedButtons." + error; - } + switch (message.syncType) { + default: + return "syncType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; } - if (message.templateId != null && message.hasOwnProperty("templateId")) - if (!$util.isString(message.templateId)) - return "templateId: string expected"; - if (message.documentMessage != null && message.hasOwnProperty("documentMessage")) { - properties.title = 1; - { - var error = $root.proto.DocumentMessage.verify(message.documentMessage); + if (message.conversations != null && message.hasOwnProperty("conversations")) { + if (!Array.isArray(message.conversations)) + return "conversations: array expected"; + for (var i = 0; i < message.conversations.length; ++i) { + var error = $root.proto.Conversation.verify(message.conversations[i]); if (error) - return "documentMessage." + error; + return "conversations." + error; } } - if (message.hydratedTitleText != null && message.hasOwnProperty("hydratedTitleText")) { - if (properties.title === 1) - return "title: multiple values"; - properties.title = 1; - if (!$util.isString(message.hydratedTitleText)) - return "hydratedTitleText: string expected"; - } - if (message.imageMessage != null && message.hasOwnProperty("imageMessage")) { - if (properties.title === 1) - return "title: multiple values"; - properties.title = 1; - { - var error = $root.proto.ImageMessage.verify(message.imageMessage); + if (message.statusV3Messages != null && message.hasOwnProperty("statusV3Messages")) { + if (!Array.isArray(message.statusV3Messages)) + return "statusV3Messages: array expected"; + for (var i = 0; i < message.statusV3Messages.length; ++i) { + var error = $root.proto.WebMessageInfo.verify(message.statusV3Messages[i]); if (error) - return "imageMessage." + error; + return "statusV3Messages." + error; } } - if (message.videoMessage != null && message.hasOwnProperty("videoMessage")) { - if (properties.title === 1) - return "title: multiple values"; - properties.title = 1; - { - var error = $root.proto.VideoMessage.verify(message.videoMessage); + if (message.chunkOrder != null && message.hasOwnProperty("chunkOrder")) + if (!$util.isInteger(message.chunkOrder)) + return "chunkOrder: integer expected"; + if (message.progress != null && message.hasOwnProperty("progress")) + if (!$util.isInteger(message.progress)) + return "progress: integer expected"; + if (message.pushnames != null && message.hasOwnProperty("pushnames")) { + if (!Array.isArray(message.pushnames)) + return "pushnames: array expected"; + for (var i = 0; i < message.pushnames.length; ++i) { + var error = $root.proto.Pushname.verify(message.pushnames[i]); if (error) - return "videoMessage." + error; + return "pushnames." + error; } } - if (message.locationMessage != null && message.hasOwnProperty("locationMessage")) { - if (properties.title === 1) - return "title: multiple values"; - properties.title = 1; - { - var error = $root.proto.LocationMessage.verify(message.locationMessage); - if (error) - return "locationMessage." + error; - } + if (message.globalSettings != null && message.hasOwnProperty("globalSettings")) { + var error = $root.proto.GlobalSettings.verify(message.globalSettings); + if (error) + return "globalSettings." + error; } + if (message.threadIdUserSecret != null && message.hasOwnProperty("threadIdUserSecret")) + if (!(message.threadIdUserSecret && typeof message.threadIdUserSecret.length === "number" || $util.isString(message.threadIdUserSecret))) + return "threadIdUserSecret: buffer expected"; + if (message.threadDsTimeframeOffset != null && message.hasOwnProperty("threadDsTimeframeOffset")) + if (!$util.isInteger(message.threadDsTimeframeOffset)) + return "threadDsTimeframeOffset: integer expected"; return null; }; /** - * Creates a HydratedFourRowTemplate message from a plain object. Also converts values to their respective internal types. + * Creates a HistorySync message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof proto.HydratedFourRowTemplate + * @memberof proto.HistorySync * @static * @param {Object.} object Plain object - * @returns {proto.HydratedFourRowTemplate} HydratedFourRowTemplate + * @returns {proto.HistorySync} HistorySync */ - HydratedFourRowTemplate.fromObject = function fromObject(object) { - if (object instanceof $root.proto.HydratedFourRowTemplate) + HistorySync.fromObject = function fromObject(object) { + if (object instanceof $root.proto.HistorySync) return object; - var message = new $root.proto.HydratedFourRowTemplate(); - if (object.hydratedContentText != null) - message.hydratedContentText = String(object.hydratedContentText); - if (object.hydratedFooterText != null) - message.hydratedFooterText = String(object.hydratedFooterText); - if (object.hydratedButtons) { - if (!Array.isArray(object.hydratedButtons)) - throw TypeError(".proto.HydratedFourRowTemplate.hydratedButtons: array expected"); - message.hydratedButtons = []; - for (var i = 0; i < object.hydratedButtons.length; ++i) { - if (typeof object.hydratedButtons[i] !== "object") - throw TypeError(".proto.HydratedFourRowTemplate.hydratedButtons: object expected"); - message.hydratedButtons[i] = $root.proto.HydratedTemplateButton.fromObject(object.hydratedButtons[i]); - } + var message = new $root.proto.HistorySync(); + switch (object.syncType) { + case "INITIAL_BOOTSTRAP": + case 0: + message.syncType = 0; + break; + case "INITIAL_STATUS_V3": + case 1: + message.syncType = 1; + break; + case "FULL": + case 2: + message.syncType = 2; + break; + case "RECENT": + case 3: + message.syncType = 3; + break; + case "PUSH_NAME": + case 4: + message.syncType = 4; + break; } - if (object.templateId != null) - message.templateId = String(object.templateId); - if (object.documentMessage != null) { - if (typeof object.documentMessage !== "object") - throw TypeError(".proto.HydratedFourRowTemplate.documentMessage: object expected"); - message.documentMessage = $root.proto.DocumentMessage.fromObject(object.documentMessage); + if (object.conversations) { + if (!Array.isArray(object.conversations)) + throw TypeError(".proto.HistorySync.conversations: array expected"); + message.conversations = []; + for (var i = 0; i < object.conversations.length; ++i) { + if (typeof object.conversations[i] !== "object") + throw TypeError(".proto.HistorySync.conversations: object expected"); + message.conversations[i] = $root.proto.Conversation.fromObject(object.conversations[i]); + } } - if (object.hydratedTitleText != null) - message.hydratedTitleText = String(object.hydratedTitleText); - if (object.imageMessage != null) { - if (typeof object.imageMessage !== "object") - throw TypeError(".proto.HydratedFourRowTemplate.imageMessage: object expected"); - message.imageMessage = $root.proto.ImageMessage.fromObject(object.imageMessage); + if (object.statusV3Messages) { + if (!Array.isArray(object.statusV3Messages)) + throw TypeError(".proto.HistorySync.statusV3Messages: array expected"); + message.statusV3Messages = []; + for (var i = 0; i < object.statusV3Messages.length; ++i) { + if (typeof object.statusV3Messages[i] !== "object") + throw TypeError(".proto.HistorySync.statusV3Messages: object expected"); + message.statusV3Messages[i] = $root.proto.WebMessageInfo.fromObject(object.statusV3Messages[i]); + } } - if (object.videoMessage != null) { - if (typeof object.videoMessage !== "object") - throw TypeError(".proto.HydratedFourRowTemplate.videoMessage: object expected"); - message.videoMessage = $root.proto.VideoMessage.fromObject(object.videoMessage); + if (object.chunkOrder != null) + message.chunkOrder = object.chunkOrder >>> 0; + if (object.progress != null) + message.progress = object.progress >>> 0; + if (object.pushnames) { + if (!Array.isArray(object.pushnames)) + throw TypeError(".proto.HistorySync.pushnames: array expected"); + message.pushnames = []; + for (var i = 0; i < object.pushnames.length; ++i) { + if (typeof object.pushnames[i] !== "object") + throw TypeError(".proto.HistorySync.pushnames: object expected"); + message.pushnames[i] = $root.proto.Pushname.fromObject(object.pushnames[i]); + } } - if (object.locationMessage != null) { - if (typeof object.locationMessage !== "object") - throw TypeError(".proto.HydratedFourRowTemplate.locationMessage: object expected"); - message.locationMessage = $root.proto.LocationMessage.fromObject(object.locationMessage); + if (object.globalSettings != null) { + if (typeof object.globalSettings !== "object") + throw TypeError(".proto.HistorySync.globalSettings: object expected"); + message.globalSettings = $root.proto.GlobalSettings.fromObject(object.globalSettings); } + if (object.threadIdUserSecret != null) + if (typeof object.threadIdUserSecret === "string") + $util.base64.decode(object.threadIdUserSecret, message.threadIdUserSecret = $util.newBuffer($util.base64.length(object.threadIdUserSecret)), 0); + else if (object.threadIdUserSecret.length) + message.threadIdUserSecret = object.threadIdUserSecret; + if (object.threadDsTimeframeOffset != null) + message.threadDsTimeframeOffset = object.threadDsTimeframeOffset >>> 0; return message; }; /** - * Creates a plain object from a HydratedFourRowTemplate message. Also converts values to other types if specified. + * Creates a plain object from a HistorySync message. Also converts values to other types if specified. * @function toObject - * @memberof proto.HydratedFourRowTemplate + * @memberof proto.HistorySync * @static - * @param {proto.HydratedFourRowTemplate} message HydratedFourRowTemplate + * @param {proto.HistorySync} message HistorySync * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - HydratedFourRowTemplate.toObject = function toObject(message, options) { + HistorySync.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.hydratedButtons = []; - if (options.defaults) { - object.hydratedContentText = ""; - object.hydratedFooterText = ""; - object.templateId = ""; - } - if (message.documentMessage != null && message.hasOwnProperty("documentMessage")) { - object.documentMessage = $root.proto.DocumentMessage.toObject(message.documentMessage, options); - if (options.oneofs) - object.title = "documentMessage"; - } - if (message.hydratedTitleText != null && message.hasOwnProperty("hydratedTitleText")) { - object.hydratedTitleText = message.hydratedTitleText; - if (options.oneofs) - object.title = "hydratedTitleText"; + if (options.arrays || options.defaults) { + object.conversations = []; + object.statusV3Messages = []; + object.pushnames = []; } - if (message.imageMessage != null && message.hasOwnProperty("imageMessage")) { - object.imageMessage = $root.proto.ImageMessage.toObject(message.imageMessage, options); - if (options.oneofs) - object.title = "imageMessage"; + if (options.defaults) { + object.syncType = options.enums === String ? "INITIAL_BOOTSTRAP" : 0; + object.chunkOrder = 0; + object.progress = 0; + object.globalSettings = null; + if (options.bytes === String) + object.threadIdUserSecret = ""; + else { + object.threadIdUserSecret = []; + if (options.bytes !== Array) + object.threadIdUserSecret = $util.newBuffer(object.threadIdUserSecret); + } + object.threadDsTimeframeOffset = 0; } - if (message.videoMessage != null && message.hasOwnProperty("videoMessage")) { - object.videoMessage = $root.proto.VideoMessage.toObject(message.videoMessage, options); - if (options.oneofs) - object.title = "videoMessage"; + if (message.syncType != null && message.hasOwnProperty("syncType")) + object.syncType = options.enums === String ? $root.proto.HistorySync.HistorySyncHistorySyncType[message.syncType] : message.syncType; + if (message.conversations && message.conversations.length) { + object.conversations = []; + for (var j = 0; j < message.conversations.length; ++j) + object.conversations[j] = $root.proto.Conversation.toObject(message.conversations[j], options); } - if (message.locationMessage != null && message.hasOwnProperty("locationMessage")) { - object.locationMessage = $root.proto.LocationMessage.toObject(message.locationMessage, options); - if (options.oneofs) - object.title = "locationMessage"; + if (message.statusV3Messages && message.statusV3Messages.length) { + object.statusV3Messages = []; + for (var j = 0; j < message.statusV3Messages.length; ++j) + object.statusV3Messages[j] = $root.proto.WebMessageInfo.toObject(message.statusV3Messages[j], options); } - if (message.hydratedContentText != null && message.hasOwnProperty("hydratedContentText")) - object.hydratedContentText = message.hydratedContentText; - if (message.hydratedFooterText != null && message.hasOwnProperty("hydratedFooterText")) - object.hydratedFooterText = message.hydratedFooterText; - if (message.hydratedButtons && message.hydratedButtons.length) { - object.hydratedButtons = []; - for (var j = 0; j < message.hydratedButtons.length; ++j) - object.hydratedButtons[j] = $root.proto.HydratedTemplateButton.toObject(message.hydratedButtons[j], options); + if (message.chunkOrder != null && message.hasOwnProperty("chunkOrder")) + object.chunkOrder = message.chunkOrder; + if (message.progress != null && message.hasOwnProperty("progress")) + object.progress = message.progress; + if (message.pushnames && message.pushnames.length) { + object.pushnames = []; + for (var j = 0; j < message.pushnames.length; ++j) + object.pushnames[j] = $root.proto.Pushname.toObject(message.pushnames[j], options); } - if (message.templateId != null && message.hasOwnProperty("templateId")) - object.templateId = message.templateId; + if (message.globalSettings != null && message.hasOwnProperty("globalSettings")) + object.globalSettings = $root.proto.GlobalSettings.toObject(message.globalSettings, options); + if (message.threadIdUserSecret != null && message.hasOwnProperty("threadIdUserSecret")) + object.threadIdUserSecret = options.bytes === String ? $util.base64.encode(message.threadIdUserSecret, 0, message.threadIdUserSecret.length) : options.bytes === Array ? Array.prototype.slice.call(message.threadIdUserSecret) : message.threadIdUserSecret; + if (message.threadDsTimeframeOffset != null && message.hasOwnProperty("threadDsTimeframeOffset")) + object.threadDsTimeframeOffset = message.threadDsTimeframeOffset; return object; }; /** - * Converts this HydratedFourRowTemplate to JSON. + * Converts this HistorySync to JSON. * @function toJSON - * @memberof proto.HydratedFourRowTemplate + * @memberof proto.HistorySync * @instance * @returns {Object.} JSON object */ - HydratedFourRowTemplate.prototype.toJSON = function toJSON() { + HistorySync.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return HydratedFourRowTemplate; + /** + * HistorySyncHistorySyncType enum. + * @name proto.HistorySync.HistorySyncHistorySyncType + * @enum {number} + * @property {number} INITIAL_BOOTSTRAP=0 INITIAL_BOOTSTRAP value + * @property {number} INITIAL_STATUS_V3=1 INITIAL_STATUS_V3 value + * @property {number} FULL=2 FULL value + * @property {number} RECENT=3 RECENT value + * @property {number} PUSH_NAME=4 PUSH_NAME value + */ + HistorySync.HistorySyncHistorySyncType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "INITIAL_BOOTSTRAP"] = 0; + values[valuesById[1] = "INITIAL_STATUS_V3"] = 1; + values[valuesById[2] = "FULL"] = 2; + values[valuesById[3] = "RECENT"] = 3; + values[valuesById[4] = "PUSH_NAME"] = 4; + return values; + })(); + + return HistorySync; })(); - proto.TemplateMessage = (function() { + proto.HistorySyncMsg = (function() { /** - * Properties of a TemplateMessage. + * Properties of a HistorySyncMsg. * @memberof proto - * @interface ITemplateMessage - * @property {proto.IContextInfo|null} [contextInfo] TemplateMessage contextInfo - * @property {proto.IHydratedFourRowTemplate|null} [hydratedTemplate] TemplateMessage hydratedTemplate - * @property {proto.IFourRowTemplate|null} [fourRowTemplate] TemplateMessage fourRowTemplate - * @property {proto.IHydratedFourRowTemplate|null} [hydratedFourRowTemplate] TemplateMessage hydratedFourRowTemplate + * @interface IHistorySyncMsg + * @property {proto.IWebMessageInfo|null} [message] HistorySyncMsg message + * @property {number|Long|null} [msgOrderId] HistorySyncMsg msgOrderId */ /** - * Constructs a new TemplateMessage. + * Constructs a new HistorySyncMsg. * @memberof proto - * @classdesc Represents a TemplateMessage. - * @implements ITemplateMessage + * @classdesc Represents a HistorySyncMsg. + * @implements IHistorySyncMsg * @constructor - * @param {proto.ITemplateMessage=} [properties] Properties to set + * @param {proto.IHistorySyncMsg=} [properties] Properties to set */ - function TemplateMessage(properties) { + function HistorySyncMsg(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -36357,128 +36673,88 @@ $root.proto = (function() { } /** - * TemplateMessage contextInfo. - * @member {proto.IContextInfo|null|undefined} contextInfo - * @memberof proto.TemplateMessage - * @instance - */ - TemplateMessage.prototype.contextInfo = null; - - /** - * TemplateMessage hydratedTemplate. - * @member {proto.IHydratedFourRowTemplate|null|undefined} hydratedTemplate - * @memberof proto.TemplateMessage - * @instance - */ - TemplateMessage.prototype.hydratedTemplate = null; - - /** - * TemplateMessage fourRowTemplate. - * @member {proto.IFourRowTemplate|null|undefined} fourRowTemplate - * @memberof proto.TemplateMessage - * @instance - */ - TemplateMessage.prototype.fourRowTemplate = null; - - /** - * TemplateMessage hydratedFourRowTemplate. - * @member {proto.IHydratedFourRowTemplate|null|undefined} hydratedFourRowTemplate - * @memberof proto.TemplateMessage + * HistorySyncMsg message. + * @member {proto.IWebMessageInfo|null|undefined} message + * @memberof proto.HistorySyncMsg * @instance */ - TemplateMessage.prototype.hydratedFourRowTemplate = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + HistorySyncMsg.prototype.message = null; /** - * TemplateMessage format. - * @member {"fourRowTemplate"|"hydratedFourRowTemplate"|undefined} format - * @memberof proto.TemplateMessage + * HistorySyncMsg msgOrderId. + * @member {number|Long} msgOrderId + * @memberof proto.HistorySyncMsg * @instance */ - Object.defineProperty(TemplateMessage.prototype, "format", { - get: $util.oneOfGetter($oneOfFields = ["fourRowTemplate", "hydratedFourRowTemplate"]), - set: $util.oneOfSetter($oneOfFields) - }); + HistorySyncMsg.prototype.msgOrderId = $util.Long ? $util.Long.fromBits(0,0,true) : 0; /** - * Creates a new TemplateMessage instance using the specified properties. + * Creates a new HistorySyncMsg instance using the specified properties. * @function create - * @memberof proto.TemplateMessage + * @memberof proto.HistorySyncMsg * @static - * @param {proto.ITemplateMessage=} [properties] Properties to set - * @returns {proto.TemplateMessage} TemplateMessage instance + * @param {proto.IHistorySyncMsg=} [properties] Properties to set + * @returns {proto.HistorySyncMsg} HistorySyncMsg instance */ - TemplateMessage.create = function create(properties) { - return new TemplateMessage(properties); + HistorySyncMsg.create = function create(properties) { + return new HistorySyncMsg(properties); }; /** - * Encodes the specified TemplateMessage message. Does not implicitly {@link proto.TemplateMessage.verify|verify} messages. + * Encodes the specified HistorySyncMsg message. Does not implicitly {@link proto.HistorySyncMsg.verify|verify} messages. * @function encode - * @memberof proto.TemplateMessage + * @memberof proto.HistorySyncMsg * @static - * @param {proto.ITemplateMessage} message TemplateMessage message or plain object to encode + * @param {proto.IHistorySyncMsg} message HistorySyncMsg message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - TemplateMessage.encode = function encode(message, writer) { + HistorySyncMsg.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.fourRowTemplate != null && Object.hasOwnProperty.call(message, "fourRowTemplate")) - $root.proto.FourRowTemplate.encode(message.fourRowTemplate, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.hydratedFourRowTemplate != null && Object.hasOwnProperty.call(message, "hydratedFourRowTemplate")) - $root.proto.HydratedFourRowTemplate.encode(message.hydratedFourRowTemplate, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.contextInfo != null && Object.hasOwnProperty.call(message, "contextInfo")) - $root.proto.ContextInfo.encode(message.contextInfo, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.hydratedTemplate != null && Object.hasOwnProperty.call(message, "hydratedTemplate")) - $root.proto.HydratedFourRowTemplate.encode(message.hydratedTemplate, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.message != null && Object.hasOwnProperty.call(message, "message")) + $root.proto.WebMessageInfo.encode(message.message, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.msgOrderId != null && Object.hasOwnProperty.call(message, "msgOrderId")) + writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.msgOrderId); return writer; }; /** - * Encodes the specified TemplateMessage message, length delimited. Does not implicitly {@link proto.TemplateMessage.verify|verify} messages. + * Encodes the specified HistorySyncMsg message, length delimited. Does not implicitly {@link proto.HistorySyncMsg.verify|verify} messages. * @function encodeDelimited - * @memberof proto.TemplateMessage + * @memberof proto.HistorySyncMsg * @static - * @param {proto.ITemplateMessage} message TemplateMessage message or plain object to encode + * @param {proto.IHistorySyncMsg} message HistorySyncMsg message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - TemplateMessage.encodeDelimited = function encodeDelimited(message, writer) { + HistorySyncMsg.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a TemplateMessage message from the specified reader or buffer. + * Decodes a HistorySyncMsg message from the specified reader or buffer. * @function decode - * @memberof proto.TemplateMessage + * @memberof proto.HistorySyncMsg * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {proto.TemplateMessage} TemplateMessage + * @returns {proto.HistorySyncMsg} HistorySyncMsg * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - TemplateMessage.decode = function decode(reader, length) { + HistorySyncMsg.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.TemplateMessage(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.HistorySyncMsg(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 3: - message.contextInfo = $root.proto.ContextInfo.decode(reader, reader.uint32()); - break; - case 4: - message.hydratedTemplate = $root.proto.HydratedFourRowTemplate.decode(reader, reader.uint32()); - break; case 1: - message.fourRowTemplate = $root.proto.FourRowTemplate.decode(reader, reader.uint32()); + message.message = $root.proto.WebMessageInfo.decode(reader, reader.uint32()); break; case 2: - message.hydratedFourRowTemplate = $root.proto.HydratedFourRowTemplate.decode(reader, reader.uint32()); + message.msgOrderId = reader.uint64(); break; default: reader.skipType(tag & 7); @@ -36489,168 +36765,152 @@ $root.proto = (function() { }; /** - * Decodes a TemplateMessage message from the specified reader or buffer, length delimited. + * Decodes a HistorySyncMsg message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof proto.TemplateMessage + * @memberof proto.HistorySyncMsg * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.TemplateMessage} TemplateMessage + * @returns {proto.HistorySyncMsg} HistorySyncMsg * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - TemplateMessage.decodeDelimited = function decodeDelimited(reader) { + HistorySyncMsg.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a TemplateMessage message. + * Verifies a HistorySyncMsg message. * @function verify - * @memberof proto.TemplateMessage + * @memberof proto.HistorySyncMsg * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - TemplateMessage.verify = function verify(message) { + HistorySyncMsg.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - var properties = {}; - if (message.contextInfo != null && message.hasOwnProperty("contextInfo")) { - var error = $root.proto.ContextInfo.verify(message.contextInfo); - if (error) - return "contextInfo." + error; - } - if (message.hydratedTemplate != null && message.hasOwnProperty("hydratedTemplate")) { - var error = $root.proto.HydratedFourRowTemplate.verify(message.hydratedTemplate); + if (message.message != null && message.hasOwnProperty("message")) { + var error = $root.proto.WebMessageInfo.verify(message.message); if (error) - return "hydratedTemplate." + error; - } - if (message.fourRowTemplate != null && message.hasOwnProperty("fourRowTemplate")) { - properties.format = 1; - { - var error = $root.proto.FourRowTemplate.verify(message.fourRowTemplate); - if (error) - return "fourRowTemplate." + error; - } - } - if (message.hydratedFourRowTemplate != null && message.hasOwnProperty("hydratedFourRowTemplate")) { - if (properties.format === 1) - return "format: multiple values"; - properties.format = 1; - { - var error = $root.proto.HydratedFourRowTemplate.verify(message.hydratedFourRowTemplate); - if (error) - return "hydratedFourRowTemplate." + error; - } + return "message." + error; } + if (message.msgOrderId != null && message.hasOwnProperty("msgOrderId")) + if (!$util.isInteger(message.msgOrderId) && !(message.msgOrderId && $util.isInteger(message.msgOrderId.low) && $util.isInteger(message.msgOrderId.high))) + return "msgOrderId: integer|Long expected"; return null; }; /** - * Creates a TemplateMessage message from a plain object. Also converts values to their respective internal types. + * Creates a HistorySyncMsg message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof proto.TemplateMessage + * @memberof proto.HistorySyncMsg * @static * @param {Object.} object Plain object - * @returns {proto.TemplateMessage} TemplateMessage + * @returns {proto.HistorySyncMsg} HistorySyncMsg */ - TemplateMessage.fromObject = function fromObject(object) { - if (object instanceof $root.proto.TemplateMessage) + HistorySyncMsg.fromObject = function fromObject(object) { + if (object instanceof $root.proto.HistorySyncMsg) return object; - var message = new $root.proto.TemplateMessage(); - if (object.contextInfo != null) { - if (typeof object.contextInfo !== "object") - throw TypeError(".proto.TemplateMessage.contextInfo: object expected"); - message.contextInfo = $root.proto.ContextInfo.fromObject(object.contextInfo); - } - if (object.hydratedTemplate != null) { - if (typeof object.hydratedTemplate !== "object") - throw TypeError(".proto.TemplateMessage.hydratedTemplate: object expected"); - message.hydratedTemplate = $root.proto.HydratedFourRowTemplate.fromObject(object.hydratedTemplate); - } - if (object.fourRowTemplate != null) { - if (typeof object.fourRowTemplate !== "object") - throw TypeError(".proto.TemplateMessage.fourRowTemplate: object expected"); - message.fourRowTemplate = $root.proto.FourRowTemplate.fromObject(object.fourRowTemplate); - } - if (object.hydratedFourRowTemplate != null) { - if (typeof object.hydratedFourRowTemplate !== "object") - throw TypeError(".proto.TemplateMessage.hydratedFourRowTemplate: object expected"); - message.hydratedFourRowTemplate = $root.proto.HydratedFourRowTemplate.fromObject(object.hydratedFourRowTemplate); + var message = new $root.proto.HistorySyncMsg(); + if (object.message != null) { + if (typeof object.message !== "object") + throw TypeError(".proto.HistorySyncMsg.message: object expected"); + message.message = $root.proto.WebMessageInfo.fromObject(object.message); } + if (object.msgOrderId != null) + if ($util.Long) + (message.msgOrderId = $util.Long.fromValue(object.msgOrderId)).unsigned = true; + else if (typeof object.msgOrderId === "string") + message.msgOrderId = parseInt(object.msgOrderId, 10); + else if (typeof object.msgOrderId === "number") + message.msgOrderId = object.msgOrderId; + else if (typeof object.msgOrderId === "object") + message.msgOrderId = new $util.LongBits(object.msgOrderId.low >>> 0, object.msgOrderId.high >>> 0).toNumber(true); return message; }; /** - * Creates a plain object from a TemplateMessage message. Also converts values to other types if specified. + * Creates a plain object from a HistorySyncMsg message. Also converts values to other types if specified. * @function toObject - * @memberof proto.TemplateMessage + * @memberof proto.HistorySyncMsg * @static - * @param {proto.TemplateMessage} message TemplateMessage + * @param {proto.HistorySyncMsg} message HistorySyncMsg * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - TemplateMessage.toObject = function toObject(message, options) { + HistorySyncMsg.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.contextInfo = null; - object.hydratedTemplate = null; - } - if (message.fourRowTemplate != null && message.hasOwnProperty("fourRowTemplate")) { - object.fourRowTemplate = $root.proto.FourRowTemplate.toObject(message.fourRowTemplate, options); - if (options.oneofs) - object.format = "fourRowTemplate"; - } - if (message.hydratedFourRowTemplate != null && message.hasOwnProperty("hydratedFourRowTemplate")) { - object.hydratedFourRowTemplate = $root.proto.HydratedFourRowTemplate.toObject(message.hydratedFourRowTemplate, options); - if (options.oneofs) - object.format = "hydratedFourRowTemplate"; + object.message = null; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.msgOrderId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.msgOrderId = options.longs === String ? "0" : 0; } - if (message.contextInfo != null && message.hasOwnProperty("contextInfo")) - object.contextInfo = $root.proto.ContextInfo.toObject(message.contextInfo, options); - if (message.hydratedTemplate != null && message.hasOwnProperty("hydratedTemplate")) - object.hydratedTemplate = $root.proto.HydratedFourRowTemplate.toObject(message.hydratedTemplate, options); + if (message.message != null && message.hasOwnProperty("message")) + object.message = $root.proto.WebMessageInfo.toObject(message.message, options); + if (message.msgOrderId != null && message.hasOwnProperty("msgOrderId")) + if (typeof message.msgOrderId === "number") + object.msgOrderId = options.longs === String ? String(message.msgOrderId) : message.msgOrderId; + else + object.msgOrderId = options.longs === String ? $util.Long.prototype.toString.call(message.msgOrderId) : options.longs === Number ? new $util.LongBits(message.msgOrderId.low >>> 0, message.msgOrderId.high >>> 0).toNumber(true) : message.msgOrderId; return object; }; /** - * Converts this TemplateMessage to JSON. + * Converts this HistorySyncMsg to JSON. * @function toJSON - * @memberof proto.TemplateMessage + * @memberof proto.HistorySyncMsg * @instance * @returns {Object.} JSON object */ - TemplateMessage.prototype.toJSON = function toJSON() { + HistorySyncMsg.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return TemplateMessage; + return HistorySyncMsg; })(); - proto.TemplateButtonReplyMessage = (function() { + /** + * MediaVisibility enum. + * @name proto.MediaVisibility + * @enum {number} + * @property {number} DEFAULT=0 DEFAULT value + * @property {number} OFF=1 OFF value + * @property {number} ON=2 ON value + */ + proto.MediaVisibility = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DEFAULT"] = 0; + values[valuesById[1] = "OFF"] = 1; + values[valuesById[2] = "ON"] = 2; + return values; + })(); + + proto.Pushname = (function() { /** - * Properties of a TemplateButtonReplyMessage. + * Properties of a Pushname. * @memberof proto - * @interface ITemplateButtonReplyMessage - * @property {string|null} [selectedId] TemplateButtonReplyMessage selectedId - * @property {string|null} [selectedDisplayText] TemplateButtonReplyMessage selectedDisplayText - * @property {proto.IContextInfo|null} [contextInfo] TemplateButtonReplyMessage contextInfo - * @property {number|null} [selectedIndex] TemplateButtonReplyMessage selectedIndex + * @interface IPushname + * @property {string|null} [id] Pushname id + * @property {string|null} [pushname] Pushname pushname */ /** - * Constructs a new TemplateButtonReplyMessage. + * Constructs a new Pushname. * @memberof proto - * @classdesc Represents a TemplateButtonReplyMessage. - * @implements ITemplateButtonReplyMessage + * @classdesc Represents a Pushname. + * @implements IPushname * @constructor - * @param {proto.ITemplateButtonReplyMessage=} [properties] Properties to set + * @param {proto.IPushname=} [properties] Properties to set */ - function TemplateButtonReplyMessage(properties) { + function Pushname(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -36658,114 +36918,88 @@ $root.proto = (function() { } /** - * TemplateButtonReplyMessage selectedId. - * @member {string} selectedId - * @memberof proto.TemplateButtonReplyMessage + * Pushname id. + * @member {string} id + * @memberof proto.Pushname * @instance */ - TemplateButtonReplyMessage.prototype.selectedId = ""; + Pushname.prototype.id = ""; /** - * TemplateButtonReplyMessage selectedDisplayText. - * @member {string} selectedDisplayText - * @memberof proto.TemplateButtonReplyMessage + * Pushname pushname. + * @member {string} pushname + * @memberof proto.Pushname * @instance */ - TemplateButtonReplyMessage.prototype.selectedDisplayText = ""; + Pushname.prototype.pushname = ""; /** - * TemplateButtonReplyMessage contextInfo. - * @member {proto.IContextInfo|null|undefined} contextInfo - * @memberof proto.TemplateButtonReplyMessage - * @instance + * Creates a new Pushname instance using the specified properties. + * @function create + * @memberof proto.Pushname + * @static + * @param {proto.IPushname=} [properties] Properties to set + * @returns {proto.Pushname} Pushname instance */ - TemplateButtonReplyMessage.prototype.contextInfo = null; + Pushname.create = function create(properties) { + return new Pushname(properties); + }; /** - * TemplateButtonReplyMessage selectedIndex. - * @member {number} selectedIndex - * @memberof proto.TemplateButtonReplyMessage - * @instance - */ - TemplateButtonReplyMessage.prototype.selectedIndex = 0; - - /** - * Creates a new TemplateButtonReplyMessage instance using the specified properties. - * @function create - * @memberof proto.TemplateButtonReplyMessage - * @static - * @param {proto.ITemplateButtonReplyMessage=} [properties] Properties to set - * @returns {proto.TemplateButtonReplyMessage} TemplateButtonReplyMessage instance - */ - TemplateButtonReplyMessage.create = function create(properties) { - return new TemplateButtonReplyMessage(properties); - }; - - /** - * Encodes the specified TemplateButtonReplyMessage message. Does not implicitly {@link proto.TemplateButtonReplyMessage.verify|verify} messages. + * Encodes the specified Pushname message. Does not implicitly {@link proto.Pushname.verify|verify} messages. * @function encode - * @memberof proto.TemplateButtonReplyMessage + * @memberof proto.Pushname * @static - * @param {proto.ITemplateButtonReplyMessage} message TemplateButtonReplyMessage message or plain object to encode + * @param {proto.IPushname} message Pushname message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - TemplateButtonReplyMessage.encode = function encode(message, writer) { + Pushname.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.selectedId != null && Object.hasOwnProperty.call(message, "selectedId")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.selectedId); - if (message.selectedDisplayText != null && Object.hasOwnProperty.call(message, "selectedDisplayText")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.selectedDisplayText); - if (message.contextInfo != null && Object.hasOwnProperty.call(message, "contextInfo")) - $root.proto.ContextInfo.encode(message.contextInfo, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.selectedIndex != null && Object.hasOwnProperty.call(message, "selectedIndex")) - writer.uint32(/* id 4, wireType 0 =*/32).uint32(message.selectedIndex); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.id); + if (message.pushname != null && Object.hasOwnProperty.call(message, "pushname")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.pushname); return writer; }; /** - * Encodes the specified TemplateButtonReplyMessage message, length delimited. Does not implicitly {@link proto.TemplateButtonReplyMessage.verify|verify} messages. + * Encodes the specified Pushname message, length delimited. Does not implicitly {@link proto.Pushname.verify|verify} messages. * @function encodeDelimited - * @memberof proto.TemplateButtonReplyMessage + * @memberof proto.Pushname * @static - * @param {proto.ITemplateButtonReplyMessage} message TemplateButtonReplyMessage message or plain object to encode + * @param {proto.IPushname} message Pushname message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - TemplateButtonReplyMessage.encodeDelimited = function encodeDelimited(message, writer) { + Pushname.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a TemplateButtonReplyMessage message from the specified reader or buffer. + * Decodes a Pushname message from the specified reader or buffer. * @function decode - * @memberof proto.TemplateButtonReplyMessage + * @memberof proto.Pushname * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {proto.TemplateButtonReplyMessage} TemplateButtonReplyMessage + * @returns {proto.Pushname} Pushname * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - TemplateButtonReplyMessage.decode = function decode(reader, length) { + Pushname.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.TemplateButtonReplyMessage(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.Pushname(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.selectedId = reader.string(); + message.id = reader.string(); break; case 2: - message.selectedDisplayText = reader.string(); - break; - case 3: - message.contextInfo = $root.proto.ContextInfo.decode(reader, reader.uint32()); - break; - case 4: - message.selectedIndex = reader.uint32(); + message.pushname = reader.string(); break; default: reader.skipType(tag & 7); @@ -36776,139 +37010,117 @@ $root.proto = (function() { }; /** - * Decodes a TemplateButtonReplyMessage message from the specified reader or buffer, length delimited. + * Decodes a Pushname message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof proto.TemplateButtonReplyMessage + * @memberof proto.Pushname * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.TemplateButtonReplyMessage} TemplateButtonReplyMessage + * @returns {proto.Pushname} Pushname * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - TemplateButtonReplyMessage.decodeDelimited = function decodeDelimited(reader) { + Pushname.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a TemplateButtonReplyMessage message. + * Verifies a Pushname message. * @function verify - * @memberof proto.TemplateButtonReplyMessage + * @memberof proto.Pushname * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - TemplateButtonReplyMessage.verify = function verify(message) { + Pushname.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.selectedId != null && message.hasOwnProperty("selectedId")) - if (!$util.isString(message.selectedId)) - return "selectedId: string expected"; - if (message.selectedDisplayText != null && message.hasOwnProperty("selectedDisplayText")) - if (!$util.isString(message.selectedDisplayText)) - return "selectedDisplayText: string expected"; - if (message.contextInfo != null && message.hasOwnProperty("contextInfo")) { - var error = $root.proto.ContextInfo.verify(message.contextInfo); - if (error) - return "contextInfo." + error; - } - if (message.selectedIndex != null && message.hasOwnProperty("selectedIndex")) - if (!$util.isInteger(message.selectedIndex)) - return "selectedIndex: integer expected"; + if (message.id != null && message.hasOwnProperty("id")) + if (!$util.isString(message.id)) + return "id: string expected"; + if (message.pushname != null && message.hasOwnProperty("pushname")) + if (!$util.isString(message.pushname)) + return "pushname: string expected"; return null; }; /** - * Creates a TemplateButtonReplyMessage message from a plain object. Also converts values to their respective internal types. + * Creates a Pushname message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof proto.TemplateButtonReplyMessage + * @memberof proto.Pushname * @static * @param {Object.} object Plain object - * @returns {proto.TemplateButtonReplyMessage} TemplateButtonReplyMessage + * @returns {proto.Pushname} Pushname */ - TemplateButtonReplyMessage.fromObject = function fromObject(object) { - if (object instanceof $root.proto.TemplateButtonReplyMessage) + Pushname.fromObject = function fromObject(object) { + if (object instanceof $root.proto.Pushname) return object; - var message = new $root.proto.TemplateButtonReplyMessage(); - if (object.selectedId != null) - message.selectedId = String(object.selectedId); - if (object.selectedDisplayText != null) - message.selectedDisplayText = String(object.selectedDisplayText); - if (object.contextInfo != null) { - if (typeof object.contextInfo !== "object") - throw TypeError(".proto.TemplateButtonReplyMessage.contextInfo: object expected"); - message.contextInfo = $root.proto.ContextInfo.fromObject(object.contextInfo); - } - if (object.selectedIndex != null) - message.selectedIndex = object.selectedIndex >>> 0; + var message = new $root.proto.Pushname(); + if (object.id != null) + message.id = String(object.id); + if (object.pushname != null) + message.pushname = String(object.pushname); return message; }; /** - * Creates a plain object from a TemplateButtonReplyMessage message. Also converts values to other types if specified. + * Creates a plain object from a Pushname message. Also converts values to other types if specified. * @function toObject - * @memberof proto.TemplateButtonReplyMessage + * @memberof proto.Pushname * @static - * @param {proto.TemplateButtonReplyMessage} message TemplateButtonReplyMessage + * @param {proto.Pushname} message Pushname * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - TemplateButtonReplyMessage.toObject = function toObject(message, options) { + Pushname.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.selectedId = ""; - object.selectedDisplayText = ""; - object.contextInfo = null; - object.selectedIndex = 0; + object.id = ""; + object.pushname = ""; } - if (message.selectedId != null && message.hasOwnProperty("selectedId")) - object.selectedId = message.selectedId; - if (message.selectedDisplayText != null && message.hasOwnProperty("selectedDisplayText")) - object.selectedDisplayText = message.selectedDisplayText; - if (message.contextInfo != null && message.hasOwnProperty("contextInfo")) - object.contextInfo = $root.proto.ContextInfo.toObject(message.contextInfo, options); - if (message.selectedIndex != null && message.hasOwnProperty("selectedIndex")) - object.selectedIndex = message.selectedIndex; + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; + if (message.pushname != null && message.hasOwnProperty("pushname")) + object.pushname = message.pushname; return object; }; /** - * Converts this TemplateButtonReplyMessage to JSON. + * Converts this Pushname to JSON. * @function toJSON - * @memberof proto.TemplateButtonReplyMessage + * @memberof proto.Pushname * @instance * @returns {Object.} JSON object */ - TemplateButtonReplyMessage.prototype.toJSON = function toJSON() { + Pushname.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return TemplateButtonReplyMessage; + return Pushname; })(); - proto.CatalogSnapshot = (function() { + proto.WallpaperSettings = (function() { /** - * Properties of a CatalogSnapshot. + * Properties of a WallpaperSettings. * @memberof proto - * @interface ICatalogSnapshot - * @property {proto.IImageMessage|null} [catalogImage] CatalogSnapshot catalogImage - * @property {string|null} [title] CatalogSnapshot title - * @property {string|null} [description] CatalogSnapshot description + * @interface IWallpaperSettings + * @property {string|null} [filename] WallpaperSettings filename + * @property {number|null} [opacity] WallpaperSettings opacity */ /** - * Constructs a new CatalogSnapshot. + * Constructs a new WallpaperSettings. * @memberof proto - * @classdesc Represents a CatalogSnapshot. - * @implements ICatalogSnapshot + * @classdesc Represents a WallpaperSettings. + * @implements IWallpaperSettings * @constructor - * @param {proto.ICatalogSnapshot=} [properties] Properties to set + * @param {proto.IWallpaperSettings=} [properties] Properties to set */ - function CatalogSnapshot(properties) { + function WallpaperSettings(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -36916,101 +37128,88 @@ $root.proto = (function() { } /** - * CatalogSnapshot catalogImage. - * @member {proto.IImageMessage|null|undefined} catalogImage - * @memberof proto.CatalogSnapshot - * @instance - */ - CatalogSnapshot.prototype.catalogImage = null; - - /** - * CatalogSnapshot title. - * @member {string} title - * @memberof proto.CatalogSnapshot + * WallpaperSettings filename. + * @member {string} filename + * @memberof proto.WallpaperSettings * @instance */ - CatalogSnapshot.prototype.title = ""; + WallpaperSettings.prototype.filename = ""; /** - * CatalogSnapshot description. - * @member {string} description - * @memberof proto.CatalogSnapshot + * WallpaperSettings opacity. + * @member {number} opacity + * @memberof proto.WallpaperSettings * @instance */ - CatalogSnapshot.prototype.description = ""; + WallpaperSettings.prototype.opacity = 0; /** - * Creates a new CatalogSnapshot instance using the specified properties. + * Creates a new WallpaperSettings instance using the specified properties. * @function create - * @memberof proto.CatalogSnapshot + * @memberof proto.WallpaperSettings * @static - * @param {proto.ICatalogSnapshot=} [properties] Properties to set - * @returns {proto.CatalogSnapshot} CatalogSnapshot instance + * @param {proto.IWallpaperSettings=} [properties] Properties to set + * @returns {proto.WallpaperSettings} WallpaperSettings instance */ - CatalogSnapshot.create = function create(properties) { - return new CatalogSnapshot(properties); + WallpaperSettings.create = function create(properties) { + return new WallpaperSettings(properties); }; /** - * Encodes the specified CatalogSnapshot message. Does not implicitly {@link proto.CatalogSnapshot.verify|verify} messages. + * Encodes the specified WallpaperSettings message. Does not implicitly {@link proto.WallpaperSettings.verify|verify} messages. * @function encode - * @memberof proto.CatalogSnapshot + * @memberof proto.WallpaperSettings * @static - * @param {proto.ICatalogSnapshot} message CatalogSnapshot message or plain object to encode + * @param {proto.IWallpaperSettings} message WallpaperSettings message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CatalogSnapshot.encode = function encode(message, writer) { + WallpaperSettings.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.catalogImage != null && Object.hasOwnProperty.call(message, "catalogImage")) - $root.proto.ImageMessage.encode(message.catalogImage, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.title != null && Object.hasOwnProperty.call(message, "title")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.title); - if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + if (message.filename != null && Object.hasOwnProperty.call(message, "filename")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.filename); + if (message.opacity != null && Object.hasOwnProperty.call(message, "opacity")) + writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.opacity); return writer; }; /** - * Encodes the specified CatalogSnapshot message, length delimited. Does not implicitly {@link proto.CatalogSnapshot.verify|verify} messages. + * Encodes the specified WallpaperSettings message, length delimited. Does not implicitly {@link proto.WallpaperSettings.verify|verify} messages. * @function encodeDelimited - * @memberof proto.CatalogSnapshot + * @memberof proto.WallpaperSettings * @static - * @param {proto.ICatalogSnapshot} message CatalogSnapshot message or plain object to encode + * @param {proto.IWallpaperSettings} message WallpaperSettings message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CatalogSnapshot.encodeDelimited = function encodeDelimited(message, writer) { + WallpaperSettings.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a CatalogSnapshot message from the specified reader or buffer. + * Decodes a WallpaperSettings message from the specified reader or buffer. * @function decode - * @memberof proto.CatalogSnapshot + * @memberof proto.WallpaperSettings * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {proto.CatalogSnapshot} CatalogSnapshot + * @returns {proto.WallpaperSettings} WallpaperSettings * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CatalogSnapshot.decode = function decode(reader, length) { + WallpaperSettings.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.CatalogSnapshot(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.WallpaperSettings(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.catalogImage = $root.proto.ImageMessage.decode(reader, reader.uint32()); + message.filename = reader.string(); break; case 2: - message.title = reader.string(); - break; - case 3: - message.description = reader.string(); + message.opacity = reader.uint32(); break; default: reader.skipType(tag & 7); @@ -37021,139 +37220,129 @@ $root.proto = (function() { }; /** - * Decodes a CatalogSnapshot message from the specified reader or buffer, length delimited. + * Decodes a WallpaperSettings message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof proto.CatalogSnapshot + * @memberof proto.WallpaperSettings * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.CatalogSnapshot} CatalogSnapshot + * @returns {proto.WallpaperSettings} WallpaperSettings * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CatalogSnapshot.decodeDelimited = function decodeDelimited(reader) { + WallpaperSettings.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a CatalogSnapshot message. + * Verifies a WallpaperSettings message. * @function verify - * @memberof proto.CatalogSnapshot + * @memberof proto.WallpaperSettings * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - CatalogSnapshot.verify = function verify(message) { + WallpaperSettings.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.catalogImage != null && message.hasOwnProperty("catalogImage")) { - var error = $root.proto.ImageMessage.verify(message.catalogImage); - if (error) - return "catalogImage." + error; - } - if (message.title != null && message.hasOwnProperty("title")) - if (!$util.isString(message.title)) - return "title: string expected"; - if (message.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: string expected"; + if (message.filename != null && message.hasOwnProperty("filename")) + if (!$util.isString(message.filename)) + return "filename: string expected"; + if (message.opacity != null && message.hasOwnProperty("opacity")) + if (!$util.isInteger(message.opacity)) + return "opacity: integer expected"; return null; }; /** - * Creates a CatalogSnapshot message from a plain object. Also converts values to their respective internal types. + * Creates a WallpaperSettings message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof proto.CatalogSnapshot + * @memberof proto.WallpaperSettings * @static * @param {Object.} object Plain object - * @returns {proto.CatalogSnapshot} CatalogSnapshot + * @returns {proto.WallpaperSettings} WallpaperSettings */ - CatalogSnapshot.fromObject = function fromObject(object) { - if (object instanceof $root.proto.CatalogSnapshot) + WallpaperSettings.fromObject = function fromObject(object) { + if (object instanceof $root.proto.WallpaperSettings) return object; - var message = new $root.proto.CatalogSnapshot(); - if (object.catalogImage != null) { - if (typeof object.catalogImage !== "object") - throw TypeError(".proto.CatalogSnapshot.catalogImage: object expected"); - message.catalogImage = $root.proto.ImageMessage.fromObject(object.catalogImage); - } - if (object.title != null) - message.title = String(object.title); - if (object.description != null) - message.description = String(object.description); + var message = new $root.proto.WallpaperSettings(); + if (object.filename != null) + message.filename = String(object.filename); + if (object.opacity != null) + message.opacity = object.opacity >>> 0; return message; }; /** - * Creates a plain object from a CatalogSnapshot message. Also converts values to other types if specified. + * Creates a plain object from a WallpaperSettings message. Also converts values to other types if specified. * @function toObject - * @memberof proto.CatalogSnapshot + * @memberof proto.WallpaperSettings * @static - * @param {proto.CatalogSnapshot} message CatalogSnapshot + * @param {proto.WallpaperSettings} message WallpaperSettings * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CatalogSnapshot.toObject = function toObject(message, options) { + WallpaperSettings.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.catalogImage = null; - object.title = ""; - object.description = ""; + object.filename = ""; + object.opacity = 0; } - if (message.catalogImage != null && message.hasOwnProperty("catalogImage")) - object.catalogImage = $root.proto.ImageMessage.toObject(message.catalogImage, options); - if (message.title != null && message.hasOwnProperty("title")) - object.title = message.title; - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; + if (message.filename != null && message.hasOwnProperty("filename")) + object.filename = message.filename; + if (message.opacity != null && message.hasOwnProperty("opacity")) + object.opacity = message.opacity; return object; }; /** - * Converts this CatalogSnapshot to JSON. + * Converts this WallpaperSettings to JSON. * @function toJSON - * @memberof proto.CatalogSnapshot + * @memberof proto.WallpaperSettings * @instance * @returns {Object.} JSON object */ - CatalogSnapshot.prototype.toJSON = function toJSON() { + WallpaperSettings.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return CatalogSnapshot; + return WallpaperSettings; })(); - proto.ProductSnapshot = (function() { + proto.MsgOpaqueData = (function() { /** - * Properties of a ProductSnapshot. + * Properties of a MsgOpaqueData. * @memberof proto - * @interface IProductSnapshot - * @property {proto.IImageMessage|null} [productImage] ProductSnapshot productImage - * @property {string|null} [productId] ProductSnapshot productId - * @property {string|null} [title] ProductSnapshot title - * @property {string|null} [description] ProductSnapshot description - * @property {string|null} [currencyCode] ProductSnapshot currencyCode - * @property {number|Long|null} [priceAmount1000] ProductSnapshot priceAmount1000 - * @property {string|null} [retailerId] ProductSnapshot retailerId - * @property {string|null} [url] ProductSnapshot url - * @property {number|null} [productImageCount] ProductSnapshot productImageCount - * @property {string|null} [firstImageId] ProductSnapshot firstImageId - * @property {number|Long|null} [salePriceAmount1000] ProductSnapshot salePriceAmount1000 + * @interface IMsgOpaqueData + * @property {string|null} [body] MsgOpaqueData body + * @property {string|null} [caption] MsgOpaqueData caption + * @property {number|null} [lng] MsgOpaqueData lng + * @property {boolean|null} [isLive] MsgOpaqueData isLive + * @property {number|null} [lat] MsgOpaqueData lat + * @property {number|null} [paymentAmount1000] MsgOpaqueData paymentAmount1000 + * @property {string|null} [paymentNoteMsgBody] MsgOpaqueData paymentNoteMsgBody + * @property {string|null} [canonicalUrl] MsgOpaqueData canonicalUrl + * @property {string|null} [matchedText] MsgOpaqueData matchedText + * @property {string|null} [title] MsgOpaqueData title + * @property {string|null} [description] MsgOpaqueData description + * @property {Uint8Array|null} [futureproofBuffer] MsgOpaqueData futureproofBuffer + * @property {string|null} [clientUrl] MsgOpaqueData clientUrl + * @property {string|null} [loc] MsgOpaqueData loc */ /** - * Constructs a new ProductSnapshot. + * Constructs a new MsgOpaqueData. * @memberof proto - * @classdesc Represents a ProductSnapshot. - * @implements IProductSnapshot + * @classdesc Represents a MsgOpaqueData. + * @implements IMsgOpaqueData * @constructor - * @param {proto.IProductSnapshot=} [properties] Properties to set + * @param {proto.IMsgOpaqueData=} [properties] Properties to set */ - function ProductSnapshot(properties) { + function MsgOpaqueData(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -37161,205 +37350,244 @@ $root.proto = (function() { } /** - * ProductSnapshot productImage. - * @member {proto.IImageMessage|null|undefined} productImage - * @memberof proto.ProductSnapshot + * MsgOpaqueData body. + * @member {string} body + * @memberof proto.MsgOpaqueData * @instance */ - ProductSnapshot.prototype.productImage = null; + MsgOpaqueData.prototype.body = ""; /** - * ProductSnapshot productId. - * @member {string} productId - * @memberof proto.ProductSnapshot + * MsgOpaqueData caption. + * @member {string} caption + * @memberof proto.MsgOpaqueData * @instance */ - ProductSnapshot.prototype.productId = ""; + MsgOpaqueData.prototype.caption = ""; /** - * ProductSnapshot title. - * @member {string} title - * @memberof proto.ProductSnapshot + * MsgOpaqueData lng. + * @member {number} lng + * @memberof proto.MsgOpaqueData * @instance */ - ProductSnapshot.prototype.title = ""; + MsgOpaqueData.prototype.lng = 0; /** - * ProductSnapshot description. - * @member {string} description - * @memberof proto.ProductSnapshot + * MsgOpaqueData isLive. + * @member {boolean} isLive + * @memberof proto.MsgOpaqueData * @instance */ - ProductSnapshot.prototype.description = ""; + MsgOpaqueData.prototype.isLive = false; /** - * ProductSnapshot currencyCode. - * @member {string} currencyCode - * @memberof proto.ProductSnapshot + * MsgOpaqueData lat. + * @member {number} lat + * @memberof proto.MsgOpaqueData * @instance */ - ProductSnapshot.prototype.currencyCode = ""; + MsgOpaqueData.prototype.lat = 0; /** - * ProductSnapshot priceAmount1000. - * @member {number|Long} priceAmount1000 - * @memberof proto.ProductSnapshot + * MsgOpaqueData paymentAmount1000. + * @member {number} paymentAmount1000 + * @memberof proto.MsgOpaqueData * @instance */ - ProductSnapshot.prototype.priceAmount1000 = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + MsgOpaqueData.prototype.paymentAmount1000 = 0; /** - * ProductSnapshot retailerId. - * @member {string} retailerId - * @memberof proto.ProductSnapshot + * MsgOpaqueData paymentNoteMsgBody. + * @member {string} paymentNoteMsgBody + * @memberof proto.MsgOpaqueData * @instance */ - ProductSnapshot.prototype.retailerId = ""; + MsgOpaqueData.prototype.paymentNoteMsgBody = ""; /** - * ProductSnapshot url. - * @member {string} url - * @memberof proto.ProductSnapshot + * MsgOpaqueData canonicalUrl. + * @member {string} canonicalUrl + * @memberof proto.MsgOpaqueData * @instance */ - ProductSnapshot.prototype.url = ""; + MsgOpaqueData.prototype.canonicalUrl = ""; /** - * ProductSnapshot productImageCount. - * @member {number} productImageCount - * @memberof proto.ProductSnapshot + * MsgOpaqueData matchedText. + * @member {string} matchedText + * @memberof proto.MsgOpaqueData * @instance */ - ProductSnapshot.prototype.productImageCount = 0; + MsgOpaqueData.prototype.matchedText = ""; /** - * ProductSnapshot firstImageId. - * @member {string} firstImageId - * @memberof proto.ProductSnapshot + * MsgOpaqueData title. + * @member {string} title + * @memberof proto.MsgOpaqueData * @instance */ - ProductSnapshot.prototype.firstImageId = ""; + MsgOpaqueData.prototype.title = ""; /** - * ProductSnapshot salePriceAmount1000. - * @member {number|Long} salePriceAmount1000 - * @memberof proto.ProductSnapshot + * MsgOpaqueData description. + * @member {string} description + * @memberof proto.MsgOpaqueData * @instance */ - ProductSnapshot.prototype.salePriceAmount1000 = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + MsgOpaqueData.prototype.description = ""; /** - * Creates a new ProductSnapshot instance using the specified properties. + * MsgOpaqueData futureproofBuffer. + * @member {Uint8Array} futureproofBuffer + * @memberof proto.MsgOpaqueData + * @instance + */ + MsgOpaqueData.prototype.futureproofBuffer = $util.newBuffer([]); + + /** + * MsgOpaqueData clientUrl. + * @member {string} clientUrl + * @memberof proto.MsgOpaqueData + * @instance + */ + MsgOpaqueData.prototype.clientUrl = ""; + + /** + * MsgOpaqueData loc. + * @member {string} loc + * @memberof proto.MsgOpaqueData + * @instance + */ + MsgOpaqueData.prototype.loc = ""; + + /** + * Creates a new MsgOpaqueData instance using the specified properties. * @function create - * @memberof proto.ProductSnapshot + * @memberof proto.MsgOpaqueData * @static - * @param {proto.IProductSnapshot=} [properties] Properties to set - * @returns {proto.ProductSnapshot} ProductSnapshot instance + * @param {proto.IMsgOpaqueData=} [properties] Properties to set + * @returns {proto.MsgOpaqueData} MsgOpaqueData instance */ - ProductSnapshot.create = function create(properties) { - return new ProductSnapshot(properties); + MsgOpaqueData.create = function create(properties) { + return new MsgOpaqueData(properties); }; /** - * Encodes the specified ProductSnapshot message. Does not implicitly {@link proto.ProductSnapshot.verify|verify} messages. + * Encodes the specified MsgOpaqueData message. Does not implicitly {@link proto.MsgOpaqueData.verify|verify} messages. * @function encode - * @memberof proto.ProductSnapshot + * @memberof proto.MsgOpaqueData * @static - * @param {proto.IProductSnapshot} message ProductSnapshot message or plain object to encode + * @param {proto.IMsgOpaqueData} message MsgOpaqueData message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ProductSnapshot.encode = function encode(message, writer) { + MsgOpaqueData.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.productImage != null && Object.hasOwnProperty.call(message, "productImage")) - $root.proto.ImageMessage.encode(message.productImage, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.productId != null && Object.hasOwnProperty.call(message, "productId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.productId); + if (message.body != null && Object.hasOwnProperty.call(message, "body")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.body); + if (message.caption != null && Object.hasOwnProperty.call(message, "caption")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.caption); + if (message.lng != null && Object.hasOwnProperty.call(message, "lng")) + writer.uint32(/* id 5, wireType 1 =*/41).double(message.lng); + if (message.isLive != null && Object.hasOwnProperty.call(message, "isLive")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.isLive); + if (message.lat != null && Object.hasOwnProperty.call(message, "lat")) + writer.uint32(/* id 7, wireType 1 =*/57).double(message.lat); + if (message.paymentAmount1000 != null && Object.hasOwnProperty.call(message, "paymentAmount1000")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.paymentAmount1000); + if (message.paymentNoteMsgBody != null && Object.hasOwnProperty.call(message, "paymentNoteMsgBody")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.paymentNoteMsgBody); + if (message.canonicalUrl != null && Object.hasOwnProperty.call(message, "canonicalUrl")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.canonicalUrl); + if (message.matchedText != null && Object.hasOwnProperty.call(message, "matchedText")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.matchedText); if (message.title != null && Object.hasOwnProperty.call(message, "title")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.title); + writer.uint32(/* id 12, wireType 2 =*/98).string(message.title); if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.description); - if (message.currencyCode != null && Object.hasOwnProperty.call(message, "currencyCode")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.currencyCode); - if (message.priceAmount1000 != null && Object.hasOwnProperty.call(message, "priceAmount1000")) - writer.uint32(/* id 6, wireType 0 =*/48).int64(message.priceAmount1000); - if (message.retailerId != null && Object.hasOwnProperty.call(message, "retailerId")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.retailerId); - if (message.url != null && Object.hasOwnProperty.call(message, "url")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.url); - if (message.productImageCount != null && Object.hasOwnProperty.call(message, "productImageCount")) - writer.uint32(/* id 9, wireType 0 =*/72).uint32(message.productImageCount); - if (message.firstImageId != null && Object.hasOwnProperty.call(message, "firstImageId")) - writer.uint32(/* id 11, wireType 2 =*/90).string(message.firstImageId); - if (message.salePriceAmount1000 != null && Object.hasOwnProperty.call(message, "salePriceAmount1000")) - writer.uint32(/* id 12, wireType 0 =*/96).int64(message.salePriceAmount1000); + writer.uint32(/* id 13, wireType 2 =*/106).string(message.description); + if (message.futureproofBuffer != null && Object.hasOwnProperty.call(message, "futureproofBuffer")) + writer.uint32(/* id 14, wireType 2 =*/114).bytes(message.futureproofBuffer); + if (message.clientUrl != null && Object.hasOwnProperty.call(message, "clientUrl")) + writer.uint32(/* id 15, wireType 2 =*/122).string(message.clientUrl); + if (message.loc != null && Object.hasOwnProperty.call(message, "loc")) + writer.uint32(/* id 16, wireType 2 =*/130).string(message.loc); return writer; }; /** - * Encodes the specified ProductSnapshot message, length delimited. Does not implicitly {@link proto.ProductSnapshot.verify|verify} messages. + * Encodes the specified MsgOpaqueData message, length delimited. Does not implicitly {@link proto.MsgOpaqueData.verify|verify} messages. * @function encodeDelimited - * @memberof proto.ProductSnapshot + * @memberof proto.MsgOpaqueData * @static - * @param {proto.IProductSnapshot} message ProductSnapshot message or plain object to encode + * @param {proto.IMsgOpaqueData} message MsgOpaqueData message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ProductSnapshot.encodeDelimited = function encodeDelimited(message, writer) { + MsgOpaqueData.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ProductSnapshot message from the specified reader or buffer. + * Decodes a MsgOpaqueData message from the specified reader or buffer. * @function decode - * @memberof proto.ProductSnapshot + * @memberof proto.MsgOpaqueData * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {proto.ProductSnapshot} ProductSnapshot + * @returns {proto.MsgOpaqueData} MsgOpaqueData * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ProductSnapshot.decode = function decode(reader, length) { + MsgOpaqueData.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.ProductSnapshot(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.MsgOpaqueData(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.productImage = $root.proto.ImageMessage.decode(reader, reader.uint32()); - break; - case 2: - message.productId = reader.string(); + message.body = reader.string(); break; case 3: - message.title = reader.string(); - break; - case 4: - message.description = reader.string(); + message.caption = reader.string(); break; case 5: - message.currencyCode = reader.string(); + message.lng = reader.double(); break; case 6: - message.priceAmount1000 = reader.int64(); + message.isLive = reader.bool(); break; case 7: - message.retailerId = reader.string(); + message.lat = reader.double(); break; case 8: - message.url = reader.string(); + message.paymentAmount1000 = reader.int32(); break; case 9: - message.productImageCount = reader.uint32(); + message.paymentNoteMsgBody = reader.string(); + break; + case 10: + message.canonicalUrl = reader.string(); break; case 11: - message.firstImageId = reader.string(); + message.matchedText = reader.string(); break; case 12: - message.salePriceAmount1000 = reader.int64(); + message.title = reader.string(); + break; + case 13: + message.description = reader.string(); + break; + case 14: + message.futureproofBuffer = reader.bytes(); + break; + case 15: + message.clientUrl = reader.string(); + break; + case 16: + message.loc = reader.string(); break; default: reader.skipType(tag & 7); @@ -37370,226 +37598,222 @@ $root.proto = (function() { }; /** - * Decodes a ProductSnapshot message from the specified reader or buffer, length delimited. + * Decodes a MsgOpaqueData message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof proto.ProductSnapshot + * @memberof proto.MsgOpaqueData * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.ProductSnapshot} ProductSnapshot + * @returns {proto.MsgOpaqueData} MsgOpaqueData * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ProductSnapshot.decodeDelimited = function decodeDelimited(reader) { + MsgOpaqueData.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ProductSnapshot message. + * Verifies a MsgOpaqueData message. * @function verify - * @memberof proto.ProductSnapshot + * @memberof proto.MsgOpaqueData * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ProductSnapshot.verify = function verify(message) { + MsgOpaqueData.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.productImage != null && message.hasOwnProperty("productImage")) { - var error = $root.proto.ImageMessage.verify(message.productImage); - if (error) - return "productImage." + error; - } - if (message.productId != null && message.hasOwnProperty("productId")) - if (!$util.isString(message.productId)) - return "productId: string expected"; + if (message.body != null && message.hasOwnProperty("body")) + if (!$util.isString(message.body)) + return "body: string expected"; + if (message.caption != null && message.hasOwnProperty("caption")) + if (!$util.isString(message.caption)) + return "caption: string expected"; + if (message.lng != null && message.hasOwnProperty("lng")) + if (typeof message.lng !== "number") + return "lng: number expected"; + if (message.isLive != null && message.hasOwnProperty("isLive")) + if (typeof message.isLive !== "boolean") + return "isLive: boolean expected"; + if (message.lat != null && message.hasOwnProperty("lat")) + if (typeof message.lat !== "number") + return "lat: number expected"; + if (message.paymentAmount1000 != null && message.hasOwnProperty("paymentAmount1000")) + if (!$util.isInteger(message.paymentAmount1000)) + return "paymentAmount1000: integer expected"; + if (message.paymentNoteMsgBody != null && message.hasOwnProperty("paymentNoteMsgBody")) + if (!$util.isString(message.paymentNoteMsgBody)) + return "paymentNoteMsgBody: string expected"; + if (message.canonicalUrl != null && message.hasOwnProperty("canonicalUrl")) + if (!$util.isString(message.canonicalUrl)) + return "canonicalUrl: string expected"; + if (message.matchedText != null && message.hasOwnProperty("matchedText")) + if (!$util.isString(message.matchedText)) + return "matchedText: string expected"; if (message.title != null && message.hasOwnProperty("title")) if (!$util.isString(message.title)) return "title: string expected"; if (message.description != null && message.hasOwnProperty("description")) if (!$util.isString(message.description)) return "description: string expected"; - if (message.currencyCode != null && message.hasOwnProperty("currencyCode")) - if (!$util.isString(message.currencyCode)) - return "currencyCode: string expected"; - if (message.priceAmount1000 != null && message.hasOwnProperty("priceAmount1000")) - if (!$util.isInteger(message.priceAmount1000) && !(message.priceAmount1000 && $util.isInteger(message.priceAmount1000.low) && $util.isInteger(message.priceAmount1000.high))) - return "priceAmount1000: integer|Long expected"; - if (message.retailerId != null && message.hasOwnProperty("retailerId")) - if (!$util.isString(message.retailerId)) - return "retailerId: string expected"; - if (message.url != null && message.hasOwnProperty("url")) - if (!$util.isString(message.url)) - return "url: string expected"; - if (message.productImageCount != null && message.hasOwnProperty("productImageCount")) - if (!$util.isInteger(message.productImageCount)) - return "productImageCount: integer expected"; - if (message.firstImageId != null && message.hasOwnProperty("firstImageId")) - if (!$util.isString(message.firstImageId)) - return "firstImageId: string expected"; - if (message.salePriceAmount1000 != null && message.hasOwnProperty("salePriceAmount1000")) - if (!$util.isInteger(message.salePriceAmount1000) && !(message.salePriceAmount1000 && $util.isInteger(message.salePriceAmount1000.low) && $util.isInteger(message.salePriceAmount1000.high))) - return "salePriceAmount1000: integer|Long expected"; + if (message.futureproofBuffer != null && message.hasOwnProperty("futureproofBuffer")) + if (!(message.futureproofBuffer && typeof message.futureproofBuffer.length === "number" || $util.isString(message.futureproofBuffer))) + return "futureproofBuffer: buffer expected"; + if (message.clientUrl != null && message.hasOwnProperty("clientUrl")) + if (!$util.isString(message.clientUrl)) + return "clientUrl: string expected"; + if (message.loc != null && message.hasOwnProperty("loc")) + if (!$util.isString(message.loc)) + return "loc: string expected"; return null; }; /** - * Creates a ProductSnapshot message from a plain object. Also converts values to their respective internal types. + * Creates a MsgOpaqueData message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof proto.ProductSnapshot + * @memberof proto.MsgOpaqueData * @static * @param {Object.} object Plain object - * @returns {proto.ProductSnapshot} ProductSnapshot + * @returns {proto.MsgOpaqueData} MsgOpaqueData */ - ProductSnapshot.fromObject = function fromObject(object) { - if (object instanceof $root.proto.ProductSnapshot) + MsgOpaqueData.fromObject = function fromObject(object) { + if (object instanceof $root.proto.MsgOpaqueData) return object; - var message = new $root.proto.ProductSnapshot(); - if (object.productImage != null) { - if (typeof object.productImage !== "object") - throw TypeError(".proto.ProductSnapshot.productImage: object expected"); - message.productImage = $root.proto.ImageMessage.fromObject(object.productImage); - } - if (object.productId != null) - message.productId = String(object.productId); + var message = new $root.proto.MsgOpaqueData(); + if (object.body != null) + message.body = String(object.body); + if (object.caption != null) + message.caption = String(object.caption); + if (object.lng != null) + message.lng = Number(object.lng); + if (object.isLive != null) + message.isLive = Boolean(object.isLive); + if (object.lat != null) + message.lat = Number(object.lat); + if (object.paymentAmount1000 != null) + message.paymentAmount1000 = object.paymentAmount1000 | 0; + if (object.paymentNoteMsgBody != null) + message.paymentNoteMsgBody = String(object.paymentNoteMsgBody); + if (object.canonicalUrl != null) + message.canonicalUrl = String(object.canonicalUrl); + if (object.matchedText != null) + message.matchedText = String(object.matchedText); if (object.title != null) message.title = String(object.title); if (object.description != null) message.description = String(object.description); - if (object.currencyCode != null) - message.currencyCode = String(object.currencyCode); - if (object.priceAmount1000 != null) - if ($util.Long) - (message.priceAmount1000 = $util.Long.fromValue(object.priceAmount1000)).unsigned = false; - else if (typeof object.priceAmount1000 === "string") - message.priceAmount1000 = parseInt(object.priceAmount1000, 10); - else if (typeof object.priceAmount1000 === "number") - message.priceAmount1000 = object.priceAmount1000; - else if (typeof object.priceAmount1000 === "object") - message.priceAmount1000 = new $util.LongBits(object.priceAmount1000.low >>> 0, object.priceAmount1000.high >>> 0).toNumber(); - if (object.retailerId != null) - message.retailerId = String(object.retailerId); - if (object.url != null) - message.url = String(object.url); - if (object.productImageCount != null) - message.productImageCount = object.productImageCount >>> 0; - if (object.firstImageId != null) - message.firstImageId = String(object.firstImageId); - if (object.salePriceAmount1000 != null) - if ($util.Long) - (message.salePriceAmount1000 = $util.Long.fromValue(object.salePriceAmount1000)).unsigned = false; - else if (typeof object.salePriceAmount1000 === "string") - message.salePriceAmount1000 = parseInt(object.salePriceAmount1000, 10); - else if (typeof object.salePriceAmount1000 === "number") - message.salePriceAmount1000 = object.salePriceAmount1000; - else if (typeof object.salePriceAmount1000 === "object") - message.salePriceAmount1000 = new $util.LongBits(object.salePriceAmount1000.low >>> 0, object.salePriceAmount1000.high >>> 0).toNumber(); + if (object.futureproofBuffer != null) + if (typeof object.futureproofBuffer === "string") + $util.base64.decode(object.futureproofBuffer, message.futureproofBuffer = $util.newBuffer($util.base64.length(object.futureproofBuffer)), 0); + else if (object.futureproofBuffer.length) + message.futureproofBuffer = object.futureproofBuffer; + if (object.clientUrl != null) + message.clientUrl = String(object.clientUrl); + if (object.loc != null) + message.loc = String(object.loc); return message; }; /** - * Creates a plain object from a ProductSnapshot message. Also converts values to other types if specified. + * Creates a plain object from a MsgOpaqueData message. Also converts values to other types if specified. * @function toObject - * @memberof proto.ProductSnapshot + * @memberof proto.MsgOpaqueData * @static - * @param {proto.ProductSnapshot} message ProductSnapshot + * @param {proto.MsgOpaqueData} message MsgOpaqueData * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ProductSnapshot.toObject = function toObject(message, options) { + MsgOpaqueData.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.productImage = null; - object.productId = ""; + object.body = ""; + object.caption = ""; + object.lng = 0; + object.isLive = false; + object.lat = 0; + object.paymentAmount1000 = 0; + object.paymentNoteMsgBody = ""; + object.canonicalUrl = ""; + object.matchedText = ""; object.title = ""; object.description = ""; - object.currencyCode = ""; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.priceAmount1000 = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.priceAmount1000 = options.longs === String ? "0" : 0; - object.retailerId = ""; - object.url = ""; - object.productImageCount = 0; - object.firstImageId = ""; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.salePriceAmount1000 = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.salePriceAmount1000 = options.longs === String ? "0" : 0; + if (options.bytes === String) + object.futureproofBuffer = ""; + else { + object.futureproofBuffer = []; + if (options.bytes !== Array) + object.futureproofBuffer = $util.newBuffer(object.futureproofBuffer); + } + object.clientUrl = ""; + object.loc = ""; } - if (message.productImage != null && message.hasOwnProperty("productImage")) - object.productImage = $root.proto.ImageMessage.toObject(message.productImage, options); - if (message.productId != null && message.hasOwnProperty("productId")) - object.productId = message.productId; + if (message.body != null && message.hasOwnProperty("body")) + object.body = message.body; + if (message.caption != null && message.hasOwnProperty("caption")) + object.caption = message.caption; + if (message.lng != null && message.hasOwnProperty("lng")) + object.lng = options.json && !isFinite(message.lng) ? String(message.lng) : message.lng; + if (message.isLive != null && message.hasOwnProperty("isLive")) + object.isLive = message.isLive; + if (message.lat != null && message.hasOwnProperty("lat")) + object.lat = options.json && !isFinite(message.lat) ? String(message.lat) : message.lat; + if (message.paymentAmount1000 != null && message.hasOwnProperty("paymentAmount1000")) + object.paymentAmount1000 = message.paymentAmount1000; + if (message.paymentNoteMsgBody != null && message.hasOwnProperty("paymentNoteMsgBody")) + object.paymentNoteMsgBody = message.paymentNoteMsgBody; + if (message.canonicalUrl != null && message.hasOwnProperty("canonicalUrl")) + object.canonicalUrl = message.canonicalUrl; + if (message.matchedText != null && message.hasOwnProperty("matchedText")) + object.matchedText = message.matchedText; if (message.title != null && message.hasOwnProperty("title")) object.title = message.title; if (message.description != null && message.hasOwnProperty("description")) object.description = message.description; - if (message.currencyCode != null && message.hasOwnProperty("currencyCode")) - object.currencyCode = message.currencyCode; - if (message.priceAmount1000 != null && message.hasOwnProperty("priceAmount1000")) - if (typeof message.priceAmount1000 === "number") - object.priceAmount1000 = options.longs === String ? String(message.priceAmount1000) : message.priceAmount1000; - else - object.priceAmount1000 = options.longs === String ? $util.Long.prototype.toString.call(message.priceAmount1000) : options.longs === Number ? new $util.LongBits(message.priceAmount1000.low >>> 0, message.priceAmount1000.high >>> 0).toNumber() : message.priceAmount1000; - if (message.retailerId != null && message.hasOwnProperty("retailerId")) - object.retailerId = message.retailerId; - if (message.url != null && message.hasOwnProperty("url")) - object.url = message.url; - if (message.productImageCount != null && message.hasOwnProperty("productImageCount")) - object.productImageCount = message.productImageCount; - if (message.firstImageId != null && message.hasOwnProperty("firstImageId")) - object.firstImageId = message.firstImageId; - if (message.salePriceAmount1000 != null && message.hasOwnProperty("salePriceAmount1000")) - if (typeof message.salePriceAmount1000 === "number") - object.salePriceAmount1000 = options.longs === String ? String(message.salePriceAmount1000) : message.salePriceAmount1000; - else - object.salePriceAmount1000 = options.longs === String ? $util.Long.prototype.toString.call(message.salePriceAmount1000) : options.longs === Number ? new $util.LongBits(message.salePriceAmount1000.low >>> 0, message.salePriceAmount1000.high >>> 0).toNumber() : message.salePriceAmount1000; + if (message.futureproofBuffer != null && message.hasOwnProperty("futureproofBuffer")) + object.futureproofBuffer = options.bytes === String ? $util.base64.encode(message.futureproofBuffer, 0, message.futureproofBuffer.length) : options.bytes === Array ? Array.prototype.slice.call(message.futureproofBuffer) : message.futureproofBuffer; + if (message.clientUrl != null && message.hasOwnProperty("clientUrl")) + object.clientUrl = message.clientUrl; + if (message.loc != null && message.hasOwnProperty("loc")) + object.loc = message.loc; return object; }; /** - * Converts this ProductSnapshot to JSON. + * Converts this MsgOpaqueData to JSON. * @function toJSON - * @memberof proto.ProductSnapshot + * @memberof proto.MsgOpaqueData * @instance * @returns {Object.} JSON object */ - ProductSnapshot.prototype.toJSON = function toJSON() { + MsgOpaqueData.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ProductSnapshot; + return MsgOpaqueData; })(); - proto.ProductMessage = (function() { + proto.MsgRowOpaqueData = (function() { /** - * Properties of a ProductMessage. + * Properties of a MsgRowOpaqueData. * @memberof proto - * @interface IProductMessage - * @property {proto.IProductSnapshot|null} [product] ProductMessage product - * @property {string|null} [businessOwnerJid] ProductMessage businessOwnerJid - * @property {proto.ICatalogSnapshot|null} [catalog] ProductMessage catalog - * @property {string|null} [body] ProductMessage body - * @property {string|null} [footer] ProductMessage footer - * @property {proto.IContextInfo|null} [contextInfo] ProductMessage contextInfo + * @interface IMsgRowOpaqueData + * @property {proto.IMsgOpaqueData|null} [currentMsg] MsgRowOpaqueData currentMsg + * @property {proto.IMsgOpaqueData|null} [quotedMsg] MsgRowOpaqueData quotedMsg */ /** - * Constructs a new ProductMessage. + * Constructs a new MsgRowOpaqueData. * @memberof proto - * @classdesc Represents a ProductMessage. - * @implements IProductMessage + * @classdesc Represents a MsgRowOpaqueData. + * @implements IMsgRowOpaqueData * @constructor - * @param {proto.IProductMessage=} [properties] Properties to set + * @param {proto.IMsgRowOpaqueData=} [properties] Properties to set */ - function ProductMessage(properties) { + function MsgRowOpaqueData(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -37597,140 +37821,88 @@ $root.proto = (function() { } /** - * ProductMessage product. - * @member {proto.IProductSnapshot|null|undefined} product - * @memberof proto.ProductMessage - * @instance - */ - ProductMessage.prototype.product = null; - - /** - * ProductMessage businessOwnerJid. - * @member {string} businessOwnerJid - * @memberof proto.ProductMessage - * @instance - */ - ProductMessage.prototype.businessOwnerJid = ""; - - /** - * ProductMessage catalog. - * @member {proto.ICatalogSnapshot|null|undefined} catalog - * @memberof proto.ProductMessage - * @instance - */ - ProductMessage.prototype.catalog = null; - - /** - * ProductMessage body. - * @member {string} body - * @memberof proto.ProductMessage - * @instance - */ - ProductMessage.prototype.body = ""; - - /** - * ProductMessage footer. - * @member {string} footer - * @memberof proto.ProductMessage + * MsgRowOpaqueData currentMsg. + * @member {proto.IMsgOpaqueData|null|undefined} currentMsg + * @memberof proto.MsgRowOpaqueData * @instance */ - ProductMessage.prototype.footer = ""; + MsgRowOpaqueData.prototype.currentMsg = null; /** - * ProductMessage contextInfo. - * @member {proto.IContextInfo|null|undefined} contextInfo - * @memberof proto.ProductMessage + * MsgRowOpaqueData quotedMsg. + * @member {proto.IMsgOpaqueData|null|undefined} quotedMsg + * @memberof proto.MsgRowOpaqueData * @instance */ - ProductMessage.prototype.contextInfo = null; + MsgRowOpaqueData.prototype.quotedMsg = null; /** - * Creates a new ProductMessage instance using the specified properties. + * Creates a new MsgRowOpaqueData instance using the specified properties. * @function create - * @memberof proto.ProductMessage + * @memberof proto.MsgRowOpaqueData * @static - * @param {proto.IProductMessage=} [properties] Properties to set - * @returns {proto.ProductMessage} ProductMessage instance + * @param {proto.IMsgRowOpaqueData=} [properties] Properties to set + * @returns {proto.MsgRowOpaqueData} MsgRowOpaqueData instance */ - ProductMessage.create = function create(properties) { - return new ProductMessage(properties); + MsgRowOpaqueData.create = function create(properties) { + return new MsgRowOpaqueData(properties); }; /** - * Encodes the specified ProductMessage message. Does not implicitly {@link proto.ProductMessage.verify|verify} messages. + * Encodes the specified MsgRowOpaqueData message. Does not implicitly {@link proto.MsgRowOpaqueData.verify|verify} messages. * @function encode - * @memberof proto.ProductMessage + * @memberof proto.MsgRowOpaqueData * @static - * @param {proto.IProductMessage} message ProductMessage message or plain object to encode + * @param {proto.IMsgRowOpaqueData} message MsgRowOpaqueData message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ProductMessage.encode = function encode(message, writer) { + MsgRowOpaqueData.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.product != null && Object.hasOwnProperty.call(message, "product")) - $root.proto.ProductSnapshot.encode(message.product, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.businessOwnerJid != null && Object.hasOwnProperty.call(message, "businessOwnerJid")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.businessOwnerJid); - if (message.catalog != null && Object.hasOwnProperty.call(message, "catalog")) - $root.proto.CatalogSnapshot.encode(message.catalog, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.body != null && Object.hasOwnProperty.call(message, "body")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.body); - if (message.footer != null && Object.hasOwnProperty.call(message, "footer")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.footer); - if (message.contextInfo != null && Object.hasOwnProperty.call(message, "contextInfo")) - $root.proto.ContextInfo.encode(message.contextInfo, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); + if (message.currentMsg != null && Object.hasOwnProperty.call(message, "currentMsg")) + $root.proto.MsgOpaqueData.encode(message.currentMsg, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.quotedMsg != null && Object.hasOwnProperty.call(message, "quotedMsg")) + $root.proto.MsgOpaqueData.encode(message.quotedMsg, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** - * Encodes the specified ProductMessage message, length delimited. Does not implicitly {@link proto.ProductMessage.verify|verify} messages. + * Encodes the specified MsgRowOpaqueData message, length delimited. Does not implicitly {@link proto.MsgRowOpaqueData.verify|verify} messages. * @function encodeDelimited - * @memberof proto.ProductMessage + * @memberof proto.MsgRowOpaqueData * @static - * @param {proto.IProductMessage} message ProductMessage message or plain object to encode + * @param {proto.IMsgRowOpaqueData} message MsgRowOpaqueData message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ProductMessage.encodeDelimited = function encodeDelimited(message, writer) { + MsgRowOpaqueData.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ProductMessage message from the specified reader or buffer. + * Decodes a MsgRowOpaqueData message from the specified reader or buffer. * @function decode - * @memberof proto.ProductMessage + * @memberof proto.MsgRowOpaqueData * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {proto.ProductMessage} ProductMessage + * @returns {proto.MsgRowOpaqueData} MsgRowOpaqueData * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ProductMessage.decode = function decode(reader, length) { + MsgRowOpaqueData.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.ProductMessage(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.MsgRowOpaqueData(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.product = $root.proto.ProductSnapshot.decode(reader, reader.uint32()); + message.currentMsg = $root.proto.MsgOpaqueData.decode(reader, reader.uint32()); break; case 2: - message.businessOwnerJid = reader.string(); - break; - case 4: - message.catalog = $root.proto.CatalogSnapshot.decode(reader, reader.uint32()); - break; - case 5: - message.body = reader.string(); - break; - case 6: - message.footer = reader.string(); - break; - case 17: - message.contextInfo = $root.proto.ContextInfo.decode(reader, reader.uint32()); + message.quotedMsg = $root.proto.MsgOpaqueData.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -37741,174 +37913,128 @@ $root.proto = (function() { }; /** - * Decodes a ProductMessage message from the specified reader or buffer, length delimited. + * Decodes a MsgRowOpaqueData message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof proto.ProductMessage + * @memberof proto.MsgRowOpaqueData * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.ProductMessage} ProductMessage + * @returns {proto.MsgRowOpaqueData} MsgRowOpaqueData * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ProductMessage.decodeDelimited = function decodeDelimited(reader) { + MsgRowOpaqueData.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ProductMessage message. + * Verifies a MsgRowOpaqueData message. * @function verify - * @memberof proto.ProductMessage + * @memberof proto.MsgRowOpaqueData * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ProductMessage.verify = function verify(message) { + MsgRowOpaqueData.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.product != null && message.hasOwnProperty("product")) { - var error = $root.proto.ProductSnapshot.verify(message.product); - if (error) - return "product." + error; - } - if (message.businessOwnerJid != null && message.hasOwnProperty("businessOwnerJid")) - if (!$util.isString(message.businessOwnerJid)) - return "businessOwnerJid: string expected"; - if (message.catalog != null && message.hasOwnProperty("catalog")) { - var error = $root.proto.CatalogSnapshot.verify(message.catalog); + if (message.currentMsg != null && message.hasOwnProperty("currentMsg")) { + var error = $root.proto.MsgOpaqueData.verify(message.currentMsg); if (error) - return "catalog." + error; + return "currentMsg." + error; } - if (message.body != null && message.hasOwnProperty("body")) - if (!$util.isString(message.body)) - return "body: string expected"; - if (message.footer != null && message.hasOwnProperty("footer")) - if (!$util.isString(message.footer)) - return "footer: string expected"; - if (message.contextInfo != null && message.hasOwnProperty("contextInfo")) { - var error = $root.proto.ContextInfo.verify(message.contextInfo); + if (message.quotedMsg != null && message.hasOwnProperty("quotedMsg")) { + var error = $root.proto.MsgOpaqueData.verify(message.quotedMsg); if (error) - return "contextInfo." + error; + return "quotedMsg." + error; } return null; }; /** - * Creates a ProductMessage message from a plain object. Also converts values to their respective internal types. + * Creates a MsgRowOpaqueData message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof proto.ProductMessage + * @memberof proto.MsgRowOpaqueData * @static * @param {Object.} object Plain object - * @returns {proto.ProductMessage} ProductMessage + * @returns {proto.MsgRowOpaqueData} MsgRowOpaqueData */ - ProductMessage.fromObject = function fromObject(object) { - if (object instanceof $root.proto.ProductMessage) + MsgRowOpaqueData.fromObject = function fromObject(object) { + if (object instanceof $root.proto.MsgRowOpaqueData) return object; - var message = new $root.proto.ProductMessage(); - if (object.product != null) { - if (typeof object.product !== "object") - throw TypeError(".proto.ProductMessage.product: object expected"); - message.product = $root.proto.ProductSnapshot.fromObject(object.product); - } - if (object.businessOwnerJid != null) - message.businessOwnerJid = String(object.businessOwnerJid); - if (object.catalog != null) { - if (typeof object.catalog !== "object") - throw TypeError(".proto.ProductMessage.catalog: object expected"); - message.catalog = $root.proto.CatalogSnapshot.fromObject(object.catalog); + var message = new $root.proto.MsgRowOpaqueData(); + if (object.currentMsg != null) { + if (typeof object.currentMsg !== "object") + throw TypeError(".proto.MsgRowOpaqueData.currentMsg: object expected"); + message.currentMsg = $root.proto.MsgOpaqueData.fromObject(object.currentMsg); } - if (object.body != null) - message.body = String(object.body); - if (object.footer != null) - message.footer = String(object.footer); - if (object.contextInfo != null) { - if (typeof object.contextInfo !== "object") - throw TypeError(".proto.ProductMessage.contextInfo: object expected"); - message.contextInfo = $root.proto.ContextInfo.fromObject(object.contextInfo); + if (object.quotedMsg != null) { + if (typeof object.quotedMsg !== "object") + throw TypeError(".proto.MsgRowOpaqueData.quotedMsg: object expected"); + message.quotedMsg = $root.proto.MsgOpaqueData.fromObject(object.quotedMsg); } return message; }; /** - * Creates a plain object from a ProductMessage message. Also converts values to other types if specified. + * Creates a plain object from a MsgRowOpaqueData message. Also converts values to other types if specified. * @function toObject - * @memberof proto.ProductMessage + * @memberof proto.MsgRowOpaqueData * @static - * @param {proto.ProductMessage} message ProductMessage + * @param {proto.MsgRowOpaqueData} message MsgRowOpaqueData * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ProductMessage.toObject = function toObject(message, options) { + MsgRowOpaqueData.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.product = null; - object.businessOwnerJid = ""; - object.catalog = null; - object.body = ""; - object.footer = ""; - object.contextInfo = null; + object.currentMsg = null; + object.quotedMsg = null; } - if (message.product != null && message.hasOwnProperty("product")) - object.product = $root.proto.ProductSnapshot.toObject(message.product, options); - if (message.businessOwnerJid != null && message.hasOwnProperty("businessOwnerJid")) - object.businessOwnerJid = message.businessOwnerJid; - if (message.catalog != null && message.hasOwnProperty("catalog")) - object.catalog = $root.proto.CatalogSnapshot.toObject(message.catalog, options); - if (message.body != null && message.hasOwnProperty("body")) - object.body = message.body; - if (message.footer != null && message.hasOwnProperty("footer")) - object.footer = message.footer; - if (message.contextInfo != null && message.hasOwnProperty("contextInfo")) - object.contextInfo = $root.proto.ContextInfo.toObject(message.contextInfo, options); + if (message.currentMsg != null && message.hasOwnProperty("currentMsg")) + object.currentMsg = $root.proto.MsgOpaqueData.toObject(message.currentMsg, options); + if (message.quotedMsg != null && message.hasOwnProperty("quotedMsg")) + object.quotedMsg = $root.proto.MsgOpaqueData.toObject(message.quotedMsg, options); return object; }; /** - * Converts this ProductMessage to JSON. + * Converts this MsgRowOpaqueData to JSON. * @function toJSON - * @memberof proto.ProductMessage + * @memberof proto.MsgRowOpaqueData * @instance * @returns {Object.} JSON object */ - ProductMessage.prototype.toJSON = function toJSON() { + MsgRowOpaqueData.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ProductMessage; + return MsgRowOpaqueData; })(); - proto.OrderMessage = (function() { + proto.MediaRetryNotification = (function() { /** - * Properties of an OrderMessage. + * Properties of a MediaRetryNotification. * @memberof proto - * @interface IOrderMessage - * @property {string|null} [orderId] OrderMessage orderId - * @property {Uint8Array|null} [thumbnail] OrderMessage thumbnail - * @property {number|null} [itemCount] OrderMessage itemCount - * @property {proto.OrderMessage.OrderMessageOrderStatus|null} [status] OrderMessage status - * @property {proto.OrderMessage.OrderMessageOrderSurface|null} [surface] OrderMessage surface - * @property {string|null} [message] OrderMessage message - * @property {string|null} [orderTitle] OrderMessage orderTitle - * @property {string|null} [sellerJid] OrderMessage sellerJid - * @property {string|null} [token] OrderMessage token - * @property {number|Long|null} [totalAmount1000] OrderMessage totalAmount1000 - * @property {string|null} [totalCurrencyCode] OrderMessage totalCurrencyCode - * @property {proto.IContextInfo|null} [contextInfo] OrderMessage contextInfo + * @interface IMediaRetryNotification + * @property {string|null} [stanzaId] MediaRetryNotification stanzaId + * @property {string|null} [directPath] MediaRetryNotification directPath + * @property {proto.MediaRetryNotification.MediaRetryNotificationResultType|null} [result] MediaRetryNotification result */ /** - * Constructs a new OrderMessage. + * Constructs a new MediaRetryNotification. * @memberof proto - * @classdesc Represents an OrderMessage. - * @implements IOrderMessage + * @classdesc Represents a MediaRetryNotification. + * @implements IMediaRetryNotification * @constructor - * @param {proto.IOrderMessage=} [properties] Properties to set + * @param {proto.IMediaRetryNotification=} [properties] Properties to set */ - function OrderMessage(properties) { + function MediaRetryNotification(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -37916,218 +38042,101 @@ $root.proto = (function() { } /** - * OrderMessage orderId. - * @member {string} orderId - * @memberof proto.OrderMessage - * @instance - */ - OrderMessage.prototype.orderId = ""; - - /** - * OrderMessage thumbnail. - * @member {Uint8Array} thumbnail - * @memberof proto.OrderMessage - * @instance - */ - OrderMessage.prototype.thumbnail = $util.newBuffer([]); - - /** - * OrderMessage itemCount. - * @member {number} itemCount - * @memberof proto.OrderMessage - * @instance - */ - OrderMessage.prototype.itemCount = 0; - - /** - * OrderMessage status. - * @member {proto.OrderMessage.OrderMessageOrderStatus} status - * @memberof proto.OrderMessage - * @instance - */ - OrderMessage.prototype.status = 1; - - /** - * OrderMessage surface. - * @member {proto.OrderMessage.OrderMessageOrderSurface} surface - * @memberof proto.OrderMessage - * @instance - */ - OrderMessage.prototype.surface = 1; - - /** - * OrderMessage message. - * @member {string} message - * @memberof proto.OrderMessage - * @instance - */ - OrderMessage.prototype.message = ""; - - /** - * OrderMessage orderTitle. - * @member {string} orderTitle - * @memberof proto.OrderMessage - * @instance - */ - OrderMessage.prototype.orderTitle = ""; - - /** - * OrderMessage sellerJid. - * @member {string} sellerJid - * @memberof proto.OrderMessage - * @instance - */ - OrderMessage.prototype.sellerJid = ""; - - /** - * OrderMessage token. - * @member {string} token - * @memberof proto.OrderMessage - * @instance - */ - OrderMessage.prototype.token = ""; - - /** - * OrderMessage totalAmount1000. - * @member {number|Long} totalAmount1000 - * @memberof proto.OrderMessage + * MediaRetryNotification stanzaId. + * @member {string} stanzaId + * @memberof proto.MediaRetryNotification * @instance */ - OrderMessage.prototype.totalAmount1000 = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + MediaRetryNotification.prototype.stanzaId = ""; /** - * OrderMessage totalCurrencyCode. - * @member {string} totalCurrencyCode - * @memberof proto.OrderMessage + * MediaRetryNotification directPath. + * @member {string} directPath + * @memberof proto.MediaRetryNotification * @instance */ - OrderMessage.prototype.totalCurrencyCode = ""; + MediaRetryNotification.prototype.directPath = ""; /** - * OrderMessage contextInfo. - * @member {proto.IContextInfo|null|undefined} contextInfo - * @memberof proto.OrderMessage + * MediaRetryNotification result. + * @member {proto.MediaRetryNotification.MediaRetryNotificationResultType} result + * @memberof proto.MediaRetryNotification * @instance */ - OrderMessage.prototype.contextInfo = null; + MediaRetryNotification.prototype.result = 0; /** - * Creates a new OrderMessage instance using the specified properties. + * Creates a new MediaRetryNotification instance using the specified properties. * @function create - * @memberof proto.OrderMessage + * @memberof proto.MediaRetryNotification * @static - * @param {proto.IOrderMessage=} [properties] Properties to set - * @returns {proto.OrderMessage} OrderMessage instance + * @param {proto.IMediaRetryNotification=} [properties] Properties to set + * @returns {proto.MediaRetryNotification} MediaRetryNotification instance */ - OrderMessage.create = function create(properties) { - return new OrderMessage(properties); + MediaRetryNotification.create = function create(properties) { + return new MediaRetryNotification(properties); }; /** - * Encodes the specified OrderMessage message. Does not implicitly {@link proto.OrderMessage.verify|verify} messages. + * Encodes the specified MediaRetryNotification message. Does not implicitly {@link proto.MediaRetryNotification.verify|verify} messages. * @function encode - * @memberof proto.OrderMessage + * @memberof proto.MediaRetryNotification * @static - * @param {proto.IOrderMessage} message OrderMessage message or plain object to encode + * @param {proto.IMediaRetryNotification} message MediaRetryNotification message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - OrderMessage.encode = function encode(message, writer) { + MediaRetryNotification.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.orderId != null && Object.hasOwnProperty.call(message, "orderId")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.orderId); - if (message.thumbnail != null && Object.hasOwnProperty.call(message, "thumbnail")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.thumbnail); - if (message.itemCount != null && Object.hasOwnProperty.call(message, "itemCount")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.itemCount); - if (message.status != null && Object.hasOwnProperty.call(message, "status")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.status); - if (message.surface != null && Object.hasOwnProperty.call(message, "surface")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.surface); - if (message.message != null && Object.hasOwnProperty.call(message, "message")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.message); - if (message.orderTitle != null && Object.hasOwnProperty.call(message, "orderTitle")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.orderTitle); - if (message.sellerJid != null && Object.hasOwnProperty.call(message, "sellerJid")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.sellerJid); - if (message.token != null && Object.hasOwnProperty.call(message, "token")) - writer.uint32(/* id 9, wireType 2 =*/74).string(message.token); - if (message.totalAmount1000 != null && Object.hasOwnProperty.call(message, "totalAmount1000")) - writer.uint32(/* id 10, wireType 0 =*/80).int64(message.totalAmount1000); - if (message.totalCurrencyCode != null && Object.hasOwnProperty.call(message, "totalCurrencyCode")) - writer.uint32(/* id 11, wireType 2 =*/90).string(message.totalCurrencyCode); - if (message.contextInfo != null && Object.hasOwnProperty.call(message, "contextInfo")) - $root.proto.ContextInfo.encode(message.contextInfo, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); + if (message.stanzaId != null && Object.hasOwnProperty.call(message, "stanzaId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.stanzaId); + if (message.directPath != null && Object.hasOwnProperty.call(message, "directPath")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.directPath); + if (message.result != null && Object.hasOwnProperty.call(message, "result")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.result); return writer; }; /** - * Encodes the specified OrderMessage message, length delimited. Does not implicitly {@link proto.OrderMessage.verify|verify} messages. + * Encodes the specified MediaRetryNotification message, length delimited. Does not implicitly {@link proto.MediaRetryNotification.verify|verify} messages. * @function encodeDelimited - * @memberof proto.OrderMessage + * @memberof proto.MediaRetryNotification * @static - * @param {proto.IOrderMessage} message OrderMessage message or plain object to encode + * @param {proto.IMediaRetryNotification} message MediaRetryNotification message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - OrderMessage.encodeDelimited = function encodeDelimited(message, writer) { + MediaRetryNotification.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an OrderMessage message from the specified reader or buffer. + * Decodes a MediaRetryNotification message from the specified reader or buffer. * @function decode - * @memberof proto.OrderMessage + * @memberof proto.MediaRetryNotification * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {proto.OrderMessage} OrderMessage + * @returns {proto.MediaRetryNotification} MediaRetryNotification * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - OrderMessage.decode = function decode(reader, length) { + MediaRetryNotification.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.OrderMessage(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.MediaRetryNotification(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.orderId = reader.string(); + message.stanzaId = reader.string(); break; case 2: - message.thumbnail = reader.bytes(); + message.directPath = reader.string(); break; case 3: - message.itemCount = reader.int32(); - break; - case 4: - message.status = reader.int32(); - break; - case 5: - message.surface = reader.int32(); - break; - case 6: - message.message = reader.string(); - break; - case 7: - message.orderTitle = reader.string(); - break; - case 8: - message.sellerJid = reader.string(); - break; - case 9: - message.token = reader.string(); - break; - case 10: - message.totalAmount1000 = reader.int64(); - break; - case 11: - message.totalCurrencyCode = reader.string(); - break; - case 17: - message.contextInfo = $root.proto.ContextInfo.decode(reader, reader.uint32()); + message.result = reader.int32(); break; default: reader.skipType(tag & 7); @@ -38138,266 +38147,165 @@ $root.proto = (function() { }; /** - * Decodes an OrderMessage message from the specified reader or buffer, length delimited. + * Decodes a MediaRetryNotification message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof proto.OrderMessage + * @memberof proto.MediaRetryNotification * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.OrderMessage} OrderMessage + * @returns {proto.MediaRetryNotification} MediaRetryNotification * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - OrderMessage.decodeDelimited = function decodeDelimited(reader) { + MediaRetryNotification.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an OrderMessage message. + * Verifies a MediaRetryNotification message. * @function verify - * @memberof proto.OrderMessage + * @memberof proto.MediaRetryNotification * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - OrderMessage.verify = function verify(message) { + MediaRetryNotification.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.orderId != null && message.hasOwnProperty("orderId")) - if (!$util.isString(message.orderId)) - return "orderId: string expected"; - if (message.thumbnail != null && message.hasOwnProperty("thumbnail")) - if (!(message.thumbnail && typeof message.thumbnail.length === "number" || $util.isString(message.thumbnail))) - return "thumbnail: buffer expected"; - if (message.itemCount != null && message.hasOwnProperty("itemCount")) - if (!$util.isInteger(message.itemCount)) - return "itemCount: integer expected"; - if (message.status != null && message.hasOwnProperty("status")) - switch (message.status) { - default: - return "status: enum value expected"; - case 1: - break; - } - if (message.surface != null && message.hasOwnProperty("surface")) - switch (message.surface) { + if (message.stanzaId != null && message.hasOwnProperty("stanzaId")) + if (!$util.isString(message.stanzaId)) + return "stanzaId: string expected"; + if (message.directPath != null && message.hasOwnProperty("directPath")) + if (!$util.isString(message.directPath)) + return "directPath: string expected"; + if (message.result != null && message.hasOwnProperty("result")) + switch (message.result) { default: - return "surface: enum value expected"; + return "result: enum value expected"; + case 0: case 1: + case 2: + case 3: break; } - if (message.message != null && message.hasOwnProperty("message")) - if (!$util.isString(message.message)) - return "message: string expected"; - if (message.orderTitle != null && message.hasOwnProperty("orderTitle")) - if (!$util.isString(message.orderTitle)) - return "orderTitle: string expected"; - if (message.sellerJid != null && message.hasOwnProperty("sellerJid")) - if (!$util.isString(message.sellerJid)) - return "sellerJid: string expected"; - if (message.token != null && message.hasOwnProperty("token")) - if (!$util.isString(message.token)) - return "token: string expected"; - if (message.totalAmount1000 != null && message.hasOwnProperty("totalAmount1000")) - if (!$util.isInteger(message.totalAmount1000) && !(message.totalAmount1000 && $util.isInteger(message.totalAmount1000.low) && $util.isInteger(message.totalAmount1000.high))) - return "totalAmount1000: integer|Long expected"; - if (message.totalCurrencyCode != null && message.hasOwnProperty("totalCurrencyCode")) - if (!$util.isString(message.totalCurrencyCode)) - return "totalCurrencyCode: string expected"; - if (message.contextInfo != null && message.hasOwnProperty("contextInfo")) { - var error = $root.proto.ContextInfo.verify(message.contextInfo); - if (error) - return "contextInfo." + error; - } return null; }; /** - * Creates an OrderMessage message from a plain object. Also converts values to their respective internal types. + * Creates a MediaRetryNotification message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof proto.OrderMessage + * @memberof proto.MediaRetryNotification * @static * @param {Object.} object Plain object - * @returns {proto.OrderMessage} OrderMessage + * @returns {proto.MediaRetryNotification} MediaRetryNotification */ - OrderMessage.fromObject = function fromObject(object) { - if (object instanceof $root.proto.OrderMessage) + MediaRetryNotification.fromObject = function fromObject(object) { + if (object instanceof $root.proto.MediaRetryNotification) return object; - var message = new $root.proto.OrderMessage(); - if (object.orderId != null) - message.orderId = String(object.orderId); - if (object.thumbnail != null) - if (typeof object.thumbnail === "string") - $util.base64.decode(object.thumbnail, message.thumbnail = $util.newBuffer($util.base64.length(object.thumbnail)), 0); - else if (object.thumbnail.length) - message.thumbnail = object.thumbnail; - if (object.itemCount != null) - message.itemCount = object.itemCount | 0; - switch (object.status) { - case "INQUIRY": - case 1: - message.status = 1; + var message = new $root.proto.MediaRetryNotification(); + if (object.stanzaId != null) + message.stanzaId = String(object.stanzaId); + if (object.directPath != null) + message.directPath = String(object.directPath); + switch (object.result) { + case "GENERAL_ERROR": + case 0: + message.result = 0; break; - } - switch (object.surface) { - case "CATALOG": + case "SUCCESS": case 1: - message.surface = 1; + message.result = 1; + break; + case "NOT_FOUND": + case 2: + message.result = 2; + break; + case "DECRYPTION_ERROR": + case 3: + message.result = 3; break; - } - if (object.message != null) - message.message = String(object.message); - if (object.orderTitle != null) - message.orderTitle = String(object.orderTitle); - if (object.sellerJid != null) - message.sellerJid = String(object.sellerJid); - if (object.token != null) - message.token = String(object.token); - if (object.totalAmount1000 != null) - if ($util.Long) - (message.totalAmount1000 = $util.Long.fromValue(object.totalAmount1000)).unsigned = false; - else if (typeof object.totalAmount1000 === "string") - message.totalAmount1000 = parseInt(object.totalAmount1000, 10); - else if (typeof object.totalAmount1000 === "number") - message.totalAmount1000 = object.totalAmount1000; - else if (typeof object.totalAmount1000 === "object") - message.totalAmount1000 = new $util.LongBits(object.totalAmount1000.low >>> 0, object.totalAmount1000.high >>> 0).toNumber(); - if (object.totalCurrencyCode != null) - message.totalCurrencyCode = String(object.totalCurrencyCode); - if (object.contextInfo != null) { - if (typeof object.contextInfo !== "object") - throw TypeError(".proto.OrderMessage.contextInfo: object expected"); - message.contextInfo = $root.proto.ContextInfo.fromObject(object.contextInfo); } return message; }; /** - * Creates a plain object from an OrderMessage message. Also converts values to other types if specified. + * Creates a plain object from a MediaRetryNotification message. Also converts values to other types if specified. * @function toObject - * @memberof proto.OrderMessage + * @memberof proto.MediaRetryNotification * @static - * @param {proto.OrderMessage} message OrderMessage + * @param {proto.MediaRetryNotification} message MediaRetryNotification * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - OrderMessage.toObject = function toObject(message, options) { + MediaRetryNotification.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.orderId = ""; - if (options.bytes === String) - object.thumbnail = ""; - else { - object.thumbnail = []; - if (options.bytes !== Array) - object.thumbnail = $util.newBuffer(object.thumbnail); - } - object.itemCount = 0; - object.status = options.enums === String ? "INQUIRY" : 1; - object.surface = options.enums === String ? "CATALOG" : 1; - object.message = ""; - object.orderTitle = ""; - object.sellerJid = ""; - object.token = ""; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.totalAmount1000 = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.totalAmount1000 = options.longs === String ? "0" : 0; - object.totalCurrencyCode = ""; - object.contextInfo = null; + object.stanzaId = ""; + object.directPath = ""; + object.result = options.enums === String ? "GENERAL_ERROR" : 0; } - if (message.orderId != null && message.hasOwnProperty("orderId")) - object.orderId = message.orderId; - if (message.thumbnail != null && message.hasOwnProperty("thumbnail")) - object.thumbnail = options.bytes === String ? $util.base64.encode(message.thumbnail, 0, message.thumbnail.length) : options.bytes === Array ? Array.prototype.slice.call(message.thumbnail) : message.thumbnail; - if (message.itemCount != null && message.hasOwnProperty("itemCount")) - object.itemCount = message.itemCount; - if (message.status != null && message.hasOwnProperty("status")) - object.status = options.enums === String ? $root.proto.OrderMessage.OrderMessageOrderStatus[message.status] : message.status; - if (message.surface != null && message.hasOwnProperty("surface")) - object.surface = options.enums === String ? $root.proto.OrderMessage.OrderMessageOrderSurface[message.surface] : message.surface; - if (message.message != null && message.hasOwnProperty("message")) - object.message = message.message; - if (message.orderTitle != null && message.hasOwnProperty("orderTitle")) - object.orderTitle = message.orderTitle; - if (message.sellerJid != null && message.hasOwnProperty("sellerJid")) - object.sellerJid = message.sellerJid; - if (message.token != null && message.hasOwnProperty("token")) - object.token = message.token; - if (message.totalAmount1000 != null && message.hasOwnProperty("totalAmount1000")) - if (typeof message.totalAmount1000 === "number") - object.totalAmount1000 = options.longs === String ? String(message.totalAmount1000) : message.totalAmount1000; - else - object.totalAmount1000 = options.longs === String ? $util.Long.prototype.toString.call(message.totalAmount1000) : options.longs === Number ? new $util.LongBits(message.totalAmount1000.low >>> 0, message.totalAmount1000.high >>> 0).toNumber() : message.totalAmount1000; - if (message.totalCurrencyCode != null && message.hasOwnProperty("totalCurrencyCode")) - object.totalCurrencyCode = message.totalCurrencyCode; - if (message.contextInfo != null && message.hasOwnProperty("contextInfo")) - object.contextInfo = $root.proto.ContextInfo.toObject(message.contextInfo, options); + if (message.stanzaId != null && message.hasOwnProperty("stanzaId")) + object.stanzaId = message.stanzaId; + if (message.directPath != null && message.hasOwnProperty("directPath")) + object.directPath = message.directPath; + if (message.result != null && message.hasOwnProperty("result")) + object.result = options.enums === String ? $root.proto.MediaRetryNotification.MediaRetryNotificationResultType[message.result] : message.result; return object; }; /** - * Converts this OrderMessage to JSON. + * Converts this MediaRetryNotification to JSON. * @function toJSON - * @memberof proto.OrderMessage + * @memberof proto.MediaRetryNotification * @instance * @returns {Object.} JSON object */ - OrderMessage.prototype.toJSON = function toJSON() { + MediaRetryNotification.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * OrderMessageOrderStatus enum. - * @name proto.OrderMessage.OrderMessageOrderStatus - * @enum {number} - * @property {number} INQUIRY=1 INQUIRY value - */ - OrderMessage.OrderMessageOrderStatus = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[1] = "INQUIRY"] = 1; - return values; - })(); - - /** - * OrderMessageOrderSurface enum. - * @name proto.OrderMessage.OrderMessageOrderSurface + * MediaRetryNotificationResultType enum. + * @name proto.MediaRetryNotification.MediaRetryNotificationResultType * @enum {number} - * @property {number} CATALOG=1 CATALOG value + * @property {number} GENERAL_ERROR=0 GENERAL_ERROR value + * @property {number} SUCCESS=1 SUCCESS value + * @property {number} NOT_FOUND=2 NOT_FOUND value + * @property {number} DECRYPTION_ERROR=3 DECRYPTION_ERROR value */ - OrderMessage.OrderMessageOrderSurface = (function() { + MediaRetryNotification.MediaRetryNotificationResultType = (function() { var valuesById = {}, values = Object.create(valuesById); - values[valuesById[1] = "CATALOG"] = 1; + values[valuesById[0] = "GENERAL_ERROR"] = 0; + values[valuesById[1] = "SUCCESS"] = 1; + values[valuesById[2] = "NOT_FOUND"] = 2; + values[valuesById[3] = "DECRYPTION_ERROR"] = 3; return values; })(); - return OrderMessage; + return MediaRetryNotification; })(); - proto.Row = (function() { + proto.ServerErrorReceipt = (function() { /** - * Properties of a Row. + * Properties of a ServerErrorReceipt. * @memberof proto - * @interface IRow - * @property {string|null} [title] Row title - * @property {string|null} [description] Row description - * @property {string|null} [rowId] Row rowId + * @interface IServerErrorReceipt + * @property {string|null} [stanzaId] ServerErrorReceipt stanzaId */ /** - * Constructs a new Row. + * Constructs a new ServerErrorReceipt. * @memberof proto - * @classdesc Represents a Row. - * @implements IRow + * @classdesc Represents a ServerErrorReceipt. + * @implements IServerErrorReceipt * @constructor - * @param {proto.IRow=} [properties] Properties to set + * @param {proto.IServerErrorReceipt=} [properties] Properties to set */ - function Row(properties) { + function ServerErrorReceipt(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -38405,101 +38313,75 @@ $root.proto = (function() { } /** - * Row title. - * @member {string} title - * @memberof proto.Row - * @instance - */ - Row.prototype.title = ""; - - /** - * Row description. - * @member {string} description - * @memberof proto.Row - * @instance - */ - Row.prototype.description = ""; - - /** - * Row rowId. - * @member {string} rowId - * @memberof proto.Row + * ServerErrorReceipt stanzaId. + * @member {string} stanzaId + * @memberof proto.ServerErrorReceipt * @instance */ - Row.prototype.rowId = ""; + ServerErrorReceipt.prototype.stanzaId = ""; /** - * Creates a new Row instance using the specified properties. + * Creates a new ServerErrorReceipt instance using the specified properties. * @function create - * @memberof proto.Row + * @memberof proto.ServerErrorReceipt * @static - * @param {proto.IRow=} [properties] Properties to set - * @returns {proto.Row} Row instance + * @param {proto.IServerErrorReceipt=} [properties] Properties to set + * @returns {proto.ServerErrorReceipt} ServerErrorReceipt instance */ - Row.create = function create(properties) { - return new Row(properties); + ServerErrorReceipt.create = function create(properties) { + return new ServerErrorReceipt(properties); }; /** - * Encodes the specified Row message. Does not implicitly {@link proto.Row.verify|verify} messages. + * Encodes the specified ServerErrorReceipt message. Does not implicitly {@link proto.ServerErrorReceipt.verify|verify} messages. * @function encode - * @memberof proto.Row + * @memberof proto.ServerErrorReceipt * @static - * @param {proto.IRow} message Row message or plain object to encode + * @param {proto.IServerErrorReceipt} message ServerErrorReceipt message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Row.encode = function encode(message, writer) { + ServerErrorReceipt.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.title != null && Object.hasOwnProperty.call(message, "title")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.title); - if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); - if (message.rowId != null && Object.hasOwnProperty.call(message, "rowId")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.rowId); + if (message.stanzaId != null && Object.hasOwnProperty.call(message, "stanzaId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.stanzaId); return writer; }; /** - * Encodes the specified Row message, length delimited. Does not implicitly {@link proto.Row.verify|verify} messages. + * Encodes the specified ServerErrorReceipt message, length delimited. Does not implicitly {@link proto.ServerErrorReceipt.verify|verify} messages. * @function encodeDelimited - * @memberof proto.Row + * @memberof proto.ServerErrorReceipt * @static - * @param {proto.IRow} message Row message or plain object to encode + * @param {proto.IServerErrorReceipt} message ServerErrorReceipt message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Row.encodeDelimited = function encodeDelimited(message, writer) { + ServerErrorReceipt.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Row message from the specified reader or buffer. + * Decodes a ServerErrorReceipt message from the specified reader or buffer. * @function decode - * @memberof proto.Row + * @memberof proto.ServerErrorReceipt * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {proto.Row} Row + * @returns {proto.ServerErrorReceipt} ServerErrorReceipt * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Row.decode = function decode(reader, length) { + ServerErrorReceipt.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.Row(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.ServerErrorReceipt(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.title = reader.string(); - break; - case 2: - message.description = reader.string(); - break; - case 3: - message.rowId = reader.string(); + message.stanzaId = reader.string(); break; default: reader.skipType(tag & 7); @@ -38510,126 +38392,110 @@ $root.proto = (function() { }; /** - * Decodes a Row message from the specified reader or buffer, length delimited. + * Decodes a ServerErrorReceipt message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof proto.Row + * @memberof proto.ServerErrorReceipt * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.Row} Row + * @returns {proto.ServerErrorReceipt} ServerErrorReceipt * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Row.decodeDelimited = function decodeDelimited(reader) { + ServerErrorReceipt.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Row message. + * Verifies a ServerErrorReceipt message. * @function verify - * @memberof proto.Row + * @memberof proto.ServerErrorReceipt * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Row.verify = function verify(message) { + ServerErrorReceipt.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.title != null && message.hasOwnProperty("title")) - if (!$util.isString(message.title)) - return "title: string expected"; - if (message.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: string expected"; - if (message.rowId != null && message.hasOwnProperty("rowId")) - if (!$util.isString(message.rowId)) - return "rowId: string expected"; + if (message.stanzaId != null && message.hasOwnProperty("stanzaId")) + if (!$util.isString(message.stanzaId)) + return "stanzaId: string expected"; return null; }; /** - * Creates a Row message from a plain object. Also converts values to their respective internal types. + * Creates a ServerErrorReceipt message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof proto.Row + * @memberof proto.ServerErrorReceipt * @static * @param {Object.} object Plain object - * @returns {proto.Row} Row + * @returns {proto.ServerErrorReceipt} ServerErrorReceipt */ - Row.fromObject = function fromObject(object) { - if (object instanceof $root.proto.Row) + ServerErrorReceipt.fromObject = function fromObject(object) { + if (object instanceof $root.proto.ServerErrorReceipt) return object; - var message = new $root.proto.Row(); - if (object.title != null) - message.title = String(object.title); - if (object.description != null) - message.description = String(object.description); - if (object.rowId != null) - message.rowId = String(object.rowId); + var message = new $root.proto.ServerErrorReceipt(); + if (object.stanzaId != null) + message.stanzaId = String(object.stanzaId); return message; }; /** - * Creates a plain object from a Row message. Also converts values to other types if specified. + * Creates a plain object from a ServerErrorReceipt message. Also converts values to other types if specified. * @function toObject - * @memberof proto.Row + * @memberof proto.ServerErrorReceipt * @static - * @param {proto.Row} message Row + * @param {proto.ServerErrorReceipt} message ServerErrorReceipt * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Row.toObject = function toObject(message, options) { + ServerErrorReceipt.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.title = ""; - object.description = ""; - object.rowId = ""; - } - if (message.title != null && message.hasOwnProperty("title")) - object.title = message.title; - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; - if (message.rowId != null && message.hasOwnProperty("rowId")) - object.rowId = message.rowId; + if (options.defaults) + object.stanzaId = ""; + if (message.stanzaId != null && message.hasOwnProperty("stanzaId")) + object.stanzaId = message.stanzaId; return object; }; /** - * Converts this Row to JSON. + * Converts this ServerErrorReceipt to JSON. * @function toJSON - * @memberof proto.Row + * @memberof proto.ServerErrorReceipt * @instance * @returns {Object.} JSON object */ - Row.prototype.toJSON = function toJSON() { + ServerErrorReceipt.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return Row; + return ServerErrorReceipt; })(); - proto.Section = (function() { + proto.MessageKey = (function() { /** - * Properties of a Section. + * Properties of a MessageKey. * @memberof proto - * @interface ISection - * @property {string|null} [title] Section title - * @property {Array.|null} [rows] Section rows + * @interface IMessageKey + * @property {string|null} [remoteJid] MessageKey remoteJid + * @property {boolean|null} [fromMe] MessageKey fromMe + * @property {string|null} [id] MessageKey id + * @property {string|null} [participant] MessageKey participant */ /** - * Constructs a new Section. + * Constructs a new MessageKey. * @memberof proto - * @classdesc Represents a Section. - * @implements ISection + * @classdesc Represents a MessageKey. + * @implements IMessageKey * @constructor - * @param {proto.ISection=} [properties] Properties to set + * @param {proto.IMessageKey=} [properties] Properties to set */ - function Section(properties) { - this.rows = []; + function MessageKey(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -38637,91 +38503,114 @@ $root.proto = (function() { } /** - * Section title. - * @member {string} title - * @memberof proto.Section + * MessageKey remoteJid. + * @member {string} remoteJid + * @memberof proto.MessageKey * @instance */ - Section.prototype.title = ""; + MessageKey.prototype.remoteJid = ""; /** - * Section rows. - * @member {Array.} rows - * @memberof proto.Section + * MessageKey fromMe. + * @member {boolean} fromMe + * @memberof proto.MessageKey * @instance */ - Section.prototype.rows = $util.emptyArray; + MessageKey.prototype.fromMe = false; /** - * Creates a new Section instance using the specified properties. + * MessageKey id. + * @member {string} id + * @memberof proto.MessageKey + * @instance + */ + MessageKey.prototype.id = ""; + + /** + * MessageKey participant. + * @member {string} participant + * @memberof proto.MessageKey + * @instance + */ + MessageKey.prototype.participant = ""; + + /** + * Creates a new MessageKey instance using the specified properties. * @function create - * @memberof proto.Section + * @memberof proto.MessageKey * @static - * @param {proto.ISection=} [properties] Properties to set - * @returns {proto.Section} Section instance + * @param {proto.IMessageKey=} [properties] Properties to set + * @returns {proto.MessageKey} MessageKey instance */ - Section.create = function create(properties) { - return new Section(properties); + MessageKey.create = function create(properties) { + return new MessageKey(properties); }; /** - * Encodes the specified Section message. Does not implicitly {@link proto.Section.verify|verify} messages. + * Encodes the specified MessageKey message. Does not implicitly {@link proto.MessageKey.verify|verify} messages. * @function encode - * @memberof proto.Section + * @memberof proto.MessageKey * @static - * @param {proto.ISection} message Section message or plain object to encode + * @param {proto.IMessageKey} message MessageKey message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Section.encode = function encode(message, writer) { + MessageKey.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.title != null && Object.hasOwnProperty.call(message, "title")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.title); - if (message.rows != null && message.rows.length) - for (var i = 0; i < message.rows.length; ++i) - $root.proto.Row.encode(message.rows[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.remoteJid != null && Object.hasOwnProperty.call(message, "remoteJid")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.remoteJid); + if (message.fromMe != null && Object.hasOwnProperty.call(message, "fromMe")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.fromMe); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.id); + if (message.participant != null && Object.hasOwnProperty.call(message, "participant")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.participant); return writer; }; /** - * Encodes the specified Section message, length delimited. Does not implicitly {@link proto.Section.verify|verify} messages. + * Encodes the specified MessageKey message, length delimited. Does not implicitly {@link proto.MessageKey.verify|verify} messages. * @function encodeDelimited - * @memberof proto.Section + * @memberof proto.MessageKey * @static - * @param {proto.ISection} message Section message or plain object to encode + * @param {proto.IMessageKey} message MessageKey message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Section.encodeDelimited = function encodeDelimited(message, writer) { + MessageKey.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Section message from the specified reader or buffer. + * Decodes a MessageKey message from the specified reader or buffer. * @function decode - * @memberof proto.Section + * @memberof proto.MessageKey * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {proto.Section} Section + * @returns {proto.MessageKey} MessageKey * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Section.decode = function decode(reader, length) { + MessageKey.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.Section(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.MessageKey(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.title = reader.string(); + message.remoteJid = reader.string(); break; case 2: - if (!(message.rows && message.rows.length)) - message.rows = []; - message.rows.push($root.proto.Row.decode(reader, reader.uint32())); + message.fromMe = reader.bool(); + break; + case 3: + message.id = reader.string(); + break; + case 4: + message.participant = reader.string(); break; default: reader.skipType(tag & 7); @@ -38732,133 +38621,133 @@ $root.proto = (function() { }; /** - * Decodes a Section message from the specified reader or buffer, length delimited. + * Decodes a MessageKey message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof proto.Section + * @memberof proto.MessageKey * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.Section} Section + * @returns {proto.MessageKey} MessageKey * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Section.decodeDelimited = function decodeDelimited(reader) { + MessageKey.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Section message. + * Verifies a MessageKey message. * @function verify - * @memberof proto.Section + * @memberof proto.MessageKey * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Section.verify = function verify(message) { + MessageKey.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.title != null && message.hasOwnProperty("title")) - if (!$util.isString(message.title)) - return "title: string expected"; - if (message.rows != null && message.hasOwnProperty("rows")) { - if (!Array.isArray(message.rows)) - return "rows: array expected"; - for (var i = 0; i < message.rows.length; ++i) { - var error = $root.proto.Row.verify(message.rows[i]); - if (error) - return "rows." + error; - } - } + if (message.remoteJid != null && message.hasOwnProperty("remoteJid")) + if (!$util.isString(message.remoteJid)) + return "remoteJid: string expected"; + if (message.fromMe != null && message.hasOwnProperty("fromMe")) + if (typeof message.fromMe !== "boolean") + return "fromMe: boolean expected"; + if (message.id != null && message.hasOwnProperty("id")) + if (!$util.isString(message.id)) + return "id: string expected"; + if (message.participant != null && message.hasOwnProperty("participant")) + if (!$util.isString(message.participant)) + return "participant: string expected"; return null; }; /** - * Creates a Section message from a plain object. Also converts values to their respective internal types. + * Creates a MessageKey message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof proto.Section + * @memberof proto.MessageKey * @static * @param {Object.} object Plain object - * @returns {proto.Section} Section + * @returns {proto.MessageKey} MessageKey */ - Section.fromObject = function fromObject(object) { - if (object instanceof $root.proto.Section) + MessageKey.fromObject = function fromObject(object) { + if (object instanceof $root.proto.MessageKey) return object; - var message = new $root.proto.Section(); - if (object.title != null) - message.title = String(object.title); - if (object.rows) { - if (!Array.isArray(object.rows)) - throw TypeError(".proto.Section.rows: array expected"); - message.rows = []; - for (var i = 0; i < object.rows.length; ++i) { - if (typeof object.rows[i] !== "object") - throw TypeError(".proto.Section.rows: object expected"); - message.rows[i] = $root.proto.Row.fromObject(object.rows[i]); - } - } + var message = new $root.proto.MessageKey(); + if (object.remoteJid != null) + message.remoteJid = String(object.remoteJid); + if (object.fromMe != null) + message.fromMe = Boolean(object.fromMe); + if (object.id != null) + message.id = String(object.id); + if (object.participant != null) + message.participant = String(object.participant); return message; }; /** - * Creates a plain object from a Section message. Also converts values to other types if specified. + * Creates a plain object from a MessageKey message. Also converts values to other types if specified. * @function toObject - * @memberof proto.Section + * @memberof proto.MessageKey * @static - * @param {proto.Section} message Section + * @param {proto.MessageKey} message MessageKey * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Section.toObject = function toObject(message, options) { + MessageKey.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.rows = []; - if (options.defaults) - object.title = ""; - if (message.title != null && message.hasOwnProperty("title")) - object.title = message.title; - if (message.rows && message.rows.length) { - object.rows = []; - for (var j = 0; j < message.rows.length; ++j) - object.rows[j] = $root.proto.Row.toObject(message.rows[j], options); + if (options.defaults) { + object.remoteJid = ""; + object.fromMe = false; + object.id = ""; + object.participant = ""; } + if (message.remoteJid != null && message.hasOwnProperty("remoteJid")) + object.remoteJid = message.remoteJid; + if (message.fromMe != null && message.hasOwnProperty("fromMe")) + object.fromMe = message.fromMe; + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; + if (message.participant != null && message.hasOwnProperty("participant")) + object.participant = message.participant; return object; }; /** - * Converts this Section to JSON. + * Converts this MessageKey to JSON. * @function toJSON - * @memberof proto.Section + * @memberof proto.MessageKey * @instance * @returns {Object.} JSON object */ - Section.prototype.toJSON = function toJSON() { + MessageKey.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return Section; + return MessageKey; })(); - proto.Product = (function() { + proto.ExitCode = (function() { /** - * Properties of a Product. + * Properties of an ExitCode. * @memberof proto - * @interface IProduct - * @property {string|null} [productId] Product productId + * @interface IExitCode + * @property {number|Long|null} [code] ExitCode code + * @property {string|null} [text] ExitCode text */ /** - * Constructs a new Product. + * Constructs a new ExitCode. * @memberof proto - * @classdesc Represents a Product. - * @implements IProduct + * @classdesc Represents an ExitCode. + * @implements IExitCode * @constructor - * @param {proto.IProduct=} [properties] Properties to set + * @param {proto.IExitCode=} [properties] Properties to set */ - function Product(properties) { + function ExitCode(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -38866,75 +38755,88 @@ $root.proto = (function() { } /** - * Product productId. - * @member {string} productId - * @memberof proto.Product + * ExitCode code. + * @member {number|Long} code + * @memberof proto.ExitCode * @instance */ - Product.prototype.productId = ""; + ExitCode.prototype.code = $util.Long ? $util.Long.fromBits(0,0,true) : 0; /** - * Creates a new Product instance using the specified properties. - * @function create - * @memberof proto.Product - * @static - * @param {proto.IProduct=} [properties] Properties to set - * @returns {proto.Product} Product instance + * ExitCode text. + * @member {string} text + * @memberof proto.ExitCode + * @instance */ - Product.create = function create(properties) { - return new Product(properties); - }; + ExitCode.prototype.text = ""; /** - * Encodes the specified Product message. Does not implicitly {@link proto.Product.verify|verify} messages. - * @function encode - * @memberof proto.Product - * @static - * @param {proto.IProduct} message Product message or plain object to encode + * Creates a new ExitCode instance using the specified properties. + * @function create + * @memberof proto.ExitCode + * @static + * @param {proto.IExitCode=} [properties] Properties to set + * @returns {proto.ExitCode} ExitCode instance + */ + ExitCode.create = function create(properties) { + return new ExitCode(properties); + }; + + /** + * Encodes the specified ExitCode message. Does not implicitly {@link proto.ExitCode.verify|verify} messages. + * @function encode + * @memberof proto.ExitCode + * @static + * @param {proto.IExitCode} message ExitCode message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Product.encode = function encode(message, writer) { + ExitCode.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.productId != null && Object.hasOwnProperty.call(message, "productId")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.productId); + if (message.code != null && Object.hasOwnProperty.call(message, "code")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.code); + if (message.text != null && Object.hasOwnProperty.call(message, "text")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.text); return writer; }; /** - * Encodes the specified Product message, length delimited. Does not implicitly {@link proto.Product.verify|verify} messages. + * Encodes the specified ExitCode message, length delimited. Does not implicitly {@link proto.ExitCode.verify|verify} messages. * @function encodeDelimited - * @memberof proto.Product + * @memberof proto.ExitCode * @static - * @param {proto.IProduct} message Product message or plain object to encode + * @param {proto.IExitCode} message ExitCode message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Product.encodeDelimited = function encodeDelimited(message, writer) { + ExitCode.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Product message from the specified reader or buffer. + * Decodes an ExitCode message from the specified reader or buffer. * @function decode - * @memberof proto.Product + * @memberof proto.ExitCode * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {proto.Product} Product + * @returns {proto.ExitCode} ExitCode * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Product.decode = function decode(reader, length) { + ExitCode.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.Product(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.ExitCode(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.productId = reader.string(); + message.code = reader.uint64(); + break; + case 2: + message.text = reader.string(); break; default: reader.skipType(tag & 7); @@ -38945,109 +38847,135 @@ $root.proto = (function() { }; /** - * Decodes a Product message from the specified reader or buffer, length delimited. + * Decodes an ExitCode message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof proto.Product + * @memberof proto.ExitCode * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.Product} Product + * @returns {proto.ExitCode} ExitCode * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Product.decodeDelimited = function decodeDelimited(reader) { + ExitCode.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Product message. + * Verifies an ExitCode message. * @function verify - * @memberof proto.Product + * @memberof proto.ExitCode * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Product.verify = function verify(message) { + ExitCode.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.productId != null && message.hasOwnProperty("productId")) - if (!$util.isString(message.productId)) - return "productId: string expected"; + if (message.code != null && message.hasOwnProperty("code")) + if (!$util.isInteger(message.code) && !(message.code && $util.isInteger(message.code.low) && $util.isInteger(message.code.high))) + return "code: integer|Long expected"; + if (message.text != null && message.hasOwnProperty("text")) + if (!$util.isString(message.text)) + return "text: string expected"; return null; }; /** - * Creates a Product message from a plain object. Also converts values to their respective internal types. + * Creates an ExitCode message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof proto.Product + * @memberof proto.ExitCode * @static * @param {Object.} object Plain object - * @returns {proto.Product} Product + * @returns {proto.ExitCode} ExitCode */ - Product.fromObject = function fromObject(object) { - if (object instanceof $root.proto.Product) + ExitCode.fromObject = function fromObject(object) { + if (object instanceof $root.proto.ExitCode) return object; - var message = new $root.proto.Product(); - if (object.productId != null) - message.productId = String(object.productId); + var message = new $root.proto.ExitCode(); + if (object.code != null) + if ($util.Long) + (message.code = $util.Long.fromValue(object.code)).unsigned = true; + else if (typeof object.code === "string") + message.code = parseInt(object.code, 10); + else if (typeof object.code === "number") + message.code = object.code; + else if (typeof object.code === "object") + message.code = new $util.LongBits(object.code.low >>> 0, object.code.high >>> 0).toNumber(true); + if (object.text != null) + message.text = String(object.text); return message; }; /** - * Creates a plain object from a Product message. Also converts values to other types if specified. + * Creates a plain object from an ExitCode message. Also converts values to other types if specified. * @function toObject - * @memberof proto.Product + * @memberof proto.ExitCode * @static - * @param {proto.Product} message Product + * @param {proto.ExitCode} message ExitCode * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Product.toObject = function toObject(message, options) { + ExitCode.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) - object.productId = ""; - if (message.productId != null && message.hasOwnProperty("productId")) - object.productId = message.productId; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.code = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.code = options.longs === String ? "0" : 0; + object.text = ""; + } + if (message.code != null && message.hasOwnProperty("code")) + if (typeof message.code === "number") + object.code = options.longs === String ? String(message.code) : message.code; + else + object.code = options.longs === String ? $util.Long.prototype.toString.call(message.code) : options.longs === Number ? new $util.LongBits(message.code.low >>> 0, message.code.high >>> 0).toNumber(true) : message.code; + if (message.text != null && message.hasOwnProperty("text")) + object.text = message.text; return object; }; /** - * Converts this Product to JSON. + * Converts this ExitCode to JSON. * @function toJSON - * @memberof proto.Product + * @memberof proto.ExitCode * @instance * @returns {Object.} JSON object */ - Product.prototype.toJSON = function toJSON() { + ExitCode.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return Product; + return ExitCode; })(); - proto.ProductSection = (function() { + proto.ExternalBlobReference = (function() { /** - * Properties of a ProductSection. + * Properties of an ExternalBlobReference. * @memberof proto - * @interface IProductSection - * @property {string|null} [title] ProductSection title - * @property {Array.|null} [products] ProductSection products + * @interface IExternalBlobReference + * @property {Uint8Array|null} [mediaKey] ExternalBlobReference mediaKey + * @property {string|null} [directPath] ExternalBlobReference directPath + * @property {string|null} [handle] ExternalBlobReference handle + * @property {number|Long|null} [fileSizeBytes] ExternalBlobReference fileSizeBytes + * @property {Uint8Array|null} [fileSha256] ExternalBlobReference fileSha256 + * @property {Uint8Array|null} [fileEncSha256] ExternalBlobReference fileEncSha256 */ /** - * Constructs a new ProductSection. + * Constructs a new ExternalBlobReference. * @memberof proto - * @classdesc Represents a ProductSection. - * @implements IProductSection + * @classdesc Represents an ExternalBlobReference. + * @implements IExternalBlobReference * @constructor - * @param {proto.IProductSection=} [properties] Properties to set + * @param {proto.IExternalBlobReference=} [properties] Properties to set */ - function ProductSection(properties) { - this.products = []; + function ExternalBlobReference(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -39055,91 +38983,140 @@ $root.proto = (function() { } /** - * ProductSection title. - * @member {string} title - * @memberof proto.ProductSection + * ExternalBlobReference mediaKey. + * @member {Uint8Array} mediaKey + * @memberof proto.ExternalBlobReference * @instance */ - ProductSection.prototype.title = ""; + ExternalBlobReference.prototype.mediaKey = $util.newBuffer([]); /** - * ProductSection products. - * @member {Array.} products - * @memberof proto.ProductSection + * ExternalBlobReference directPath. + * @member {string} directPath + * @memberof proto.ExternalBlobReference * @instance */ - ProductSection.prototype.products = $util.emptyArray; + ExternalBlobReference.prototype.directPath = ""; /** - * Creates a new ProductSection instance using the specified properties. + * ExternalBlobReference handle. + * @member {string} handle + * @memberof proto.ExternalBlobReference + * @instance + */ + ExternalBlobReference.prototype.handle = ""; + + /** + * ExternalBlobReference fileSizeBytes. + * @member {number|Long} fileSizeBytes + * @memberof proto.ExternalBlobReference + * @instance + */ + ExternalBlobReference.prototype.fileSizeBytes = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * ExternalBlobReference fileSha256. + * @member {Uint8Array} fileSha256 + * @memberof proto.ExternalBlobReference + * @instance + */ + ExternalBlobReference.prototype.fileSha256 = $util.newBuffer([]); + + /** + * ExternalBlobReference fileEncSha256. + * @member {Uint8Array} fileEncSha256 + * @memberof proto.ExternalBlobReference + * @instance + */ + ExternalBlobReference.prototype.fileEncSha256 = $util.newBuffer([]); + + /** + * Creates a new ExternalBlobReference instance using the specified properties. * @function create - * @memberof proto.ProductSection + * @memberof proto.ExternalBlobReference * @static - * @param {proto.IProductSection=} [properties] Properties to set - * @returns {proto.ProductSection} ProductSection instance + * @param {proto.IExternalBlobReference=} [properties] Properties to set + * @returns {proto.ExternalBlobReference} ExternalBlobReference instance */ - ProductSection.create = function create(properties) { - return new ProductSection(properties); + ExternalBlobReference.create = function create(properties) { + return new ExternalBlobReference(properties); }; /** - * Encodes the specified ProductSection message. Does not implicitly {@link proto.ProductSection.verify|verify} messages. + * Encodes the specified ExternalBlobReference message. Does not implicitly {@link proto.ExternalBlobReference.verify|verify} messages. * @function encode - * @memberof proto.ProductSection + * @memberof proto.ExternalBlobReference * @static - * @param {proto.IProductSection} message ProductSection message or plain object to encode + * @param {proto.IExternalBlobReference} message ExternalBlobReference message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ProductSection.encode = function encode(message, writer) { + ExternalBlobReference.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.title != null && Object.hasOwnProperty.call(message, "title")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.title); - if (message.products != null && message.products.length) - for (var i = 0; i < message.products.length; ++i) - $root.proto.Product.encode(message.products[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.mediaKey != null && Object.hasOwnProperty.call(message, "mediaKey")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.mediaKey); + if (message.directPath != null && Object.hasOwnProperty.call(message, "directPath")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.directPath); + if (message.handle != null && Object.hasOwnProperty.call(message, "handle")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.handle); + if (message.fileSizeBytes != null && Object.hasOwnProperty.call(message, "fileSizeBytes")) + writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.fileSizeBytes); + if (message.fileSha256 != null && Object.hasOwnProperty.call(message, "fileSha256")) + writer.uint32(/* id 5, wireType 2 =*/42).bytes(message.fileSha256); + if (message.fileEncSha256 != null && Object.hasOwnProperty.call(message, "fileEncSha256")) + writer.uint32(/* id 6, wireType 2 =*/50).bytes(message.fileEncSha256); return writer; }; /** - * Encodes the specified ProductSection message, length delimited. Does not implicitly {@link proto.ProductSection.verify|verify} messages. + * Encodes the specified ExternalBlobReference message, length delimited. Does not implicitly {@link proto.ExternalBlobReference.verify|verify} messages. * @function encodeDelimited - * @memberof proto.ProductSection + * @memberof proto.ExternalBlobReference * @static - * @param {proto.IProductSection} message ProductSection message or plain object to encode + * @param {proto.IExternalBlobReference} message ExternalBlobReference message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ProductSection.encodeDelimited = function encodeDelimited(message, writer) { + ExternalBlobReference.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ProductSection message from the specified reader or buffer. + * Decodes an ExternalBlobReference message from the specified reader or buffer. * @function decode - * @memberof proto.ProductSection + * @memberof proto.ExternalBlobReference * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {proto.ProductSection} ProductSection + * @returns {proto.ExternalBlobReference} ExternalBlobReference * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ProductSection.decode = function decode(reader, length) { + ExternalBlobReference.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.ProductSection(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.ExternalBlobReference(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.title = reader.string(); + message.mediaKey = reader.bytes(); break; case 2: - if (!(message.products && message.products.length)) - message.products = []; - message.products.push($root.proto.Product.decode(reader, reader.uint32())); + message.directPath = reader.string(); + break; + case 3: + message.handle = reader.string(); + break; + case 4: + message.fileSizeBytes = reader.uint64(); + break; + case 5: + message.fileSha256 = reader.bytes(); + break; + case 6: + message.fileEncSha256 = reader.bytes(); break; default: reader.skipType(tag & 7); @@ -39150,134 +39127,189 @@ $root.proto = (function() { }; /** - * Decodes a ProductSection message from the specified reader or buffer, length delimited. + * Decodes an ExternalBlobReference message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof proto.ProductSection + * @memberof proto.ExternalBlobReference * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.ProductSection} ProductSection + * @returns {proto.ExternalBlobReference} ExternalBlobReference * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ProductSection.decodeDelimited = function decodeDelimited(reader) { + ExternalBlobReference.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ProductSection message. + * Verifies an ExternalBlobReference message. * @function verify - * @memberof proto.ProductSection + * @memberof proto.ExternalBlobReference * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ProductSection.verify = function verify(message) { + ExternalBlobReference.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.title != null && message.hasOwnProperty("title")) - if (!$util.isString(message.title)) - return "title: string expected"; - if (message.products != null && message.hasOwnProperty("products")) { - if (!Array.isArray(message.products)) - return "products: array expected"; - for (var i = 0; i < message.products.length; ++i) { - var error = $root.proto.Product.verify(message.products[i]); - if (error) - return "products." + error; - } - } + if (message.mediaKey != null && message.hasOwnProperty("mediaKey")) + if (!(message.mediaKey && typeof message.mediaKey.length === "number" || $util.isString(message.mediaKey))) + return "mediaKey: buffer expected"; + if (message.directPath != null && message.hasOwnProperty("directPath")) + if (!$util.isString(message.directPath)) + return "directPath: string expected"; + if (message.handle != null && message.hasOwnProperty("handle")) + if (!$util.isString(message.handle)) + return "handle: string expected"; + if (message.fileSizeBytes != null && message.hasOwnProperty("fileSizeBytes")) + if (!$util.isInteger(message.fileSizeBytes) && !(message.fileSizeBytes && $util.isInteger(message.fileSizeBytes.low) && $util.isInteger(message.fileSizeBytes.high))) + return "fileSizeBytes: integer|Long expected"; + if (message.fileSha256 != null && message.hasOwnProperty("fileSha256")) + if (!(message.fileSha256 && typeof message.fileSha256.length === "number" || $util.isString(message.fileSha256))) + return "fileSha256: buffer expected"; + if (message.fileEncSha256 != null && message.hasOwnProperty("fileEncSha256")) + if (!(message.fileEncSha256 && typeof message.fileEncSha256.length === "number" || $util.isString(message.fileEncSha256))) + return "fileEncSha256: buffer expected"; return null; }; /** - * Creates a ProductSection message from a plain object. Also converts values to their respective internal types. + * Creates an ExternalBlobReference message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof proto.ProductSection + * @memberof proto.ExternalBlobReference * @static * @param {Object.} object Plain object - * @returns {proto.ProductSection} ProductSection + * @returns {proto.ExternalBlobReference} ExternalBlobReference */ - ProductSection.fromObject = function fromObject(object) { - if (object instanceof $root.proto.ProductSection) + ExternalBlobReference.fromObject = function fromObject(object) { + if (object instanceof $root.proto.ExternalBlobReference) return object; - var message = new $root.proto.ProductSection(); - if (object.title != null) - message.title = String(object.title); - if (object.products) { - if (!Array.isArray(object.products)) - throw TypeError(".proto.ProductSection.products: array expected"); - message.products = []; - for (var i = 0; i < object.products.length; ++i) { - if (typeof object.products[i] !== "object") - throw TypeError(".proto.ProductSection.products: object expected"); - message.products[i] = $root.proto.Product.fromObject(object.products[i]); - } - } + var message = new $root.proto.ExternalBlobReference(); + if (object.mediaKey != null) + if (typeof object.mediaKey === "string") + $util.base64.decode(object.mediaKey, message.mediaKey = $util.newBuffer($util.base64.length(object.mediaKey)), 0); + else if (object.mediaKey.length) + message.mediaKey = object.mediaKey; + if (object.directPath != null) + message.directPath = String(object.directPath); + if (object.handle != null) + message.handle = String(object.handle); + if (object.fileSizeBytes != null) + if ($util.Long) + (message.fileSizeBytes = $util.Long.fromValue(object.fileSizeBytes)).unsigned = true; + else if (typeof object.fileSizeBytes === "string") + message.fileSizeBytes = parseInt(object.fileSizeBytes, 10); + else if (typeof object.fileSizeBytes === "number") + message.fileSizeBytes = object.fileSizeBytes; + else if (typeof object.fileSizeBytes === "object") + message.fileSizeBytes = new $util.LongBits(object.fileSizeBytes.low >>> 0, object.fileSizeBytes.high >>> 0).toNumber(true); + if (object.fileSha256 != null) + if (typeof object.fileSha256 === "string") + $util.base64.decode(object.fileSha256, message.fileSha256 = $util.newBuffer($util.base64.length(object.fileSha256)), 0); + else if (object.fileSha256.length) + message.fileSha256 = object.fileSha256; + if (object.fileEncSha256 != null) + if (typeof object.fileEncSha256 === "string") + $util.base64.decode(object.fileEncSha256, message.fileEncSha256 = $util.newBuffer($util.base64.length(object.fileEncSha256)), 0); + else if (object.fileEncSha256.length) + message.fileEncSha256 = object.fileEncSha256; return message; }; /** - * Creates a plain object from a ProductSection message. Also converts values to other types if specified. + * Creates a plain object from an ExternalBlobReference message. Also converts values to other types if specified. * @function toObject - * @memberof proto.ProductSection + * @memberof proto.ExternalBlobReference * @static - * @param {proto.ProductSection} message ProductSection + * @param {proto.ExternalBlobReference} message ExternalBlobReference * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ProductSection.toObject = function toObject(message, options) { + ExternalBlobReference.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.products = []; - if (options.defaults) - object.title = ""; - if (message.title != null && message.hasOwnProperty("title")) - object.title = message.title; - if (message.products && message.products.length) { - object.products = []; - for (var j = 0; j < message.products.length; ++j) - object.products[j] = $root.proto.Product.toObject(message.products[j], options); + if (options.defaults) { + if (options.bytes === String) + object.mediaKey = ""; + else { + object.mediaKey = []; + if (options.bytes !== Array) + object.mediaKey = $util.newBuffer(object.mediaKey); + } + object.directPath = ""; + object.handle = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.fileSizeBytes = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.fileSizeBytes = options.longs === String ? "0" : 0; + if (options.bytes === String) + object.fileSha256 = ""; + else { + object.fileSha256 = []; + if (options.bytes !== Array) + object.fileSha256 = $util.newBuffer(object.fileSha256); + } + if (options.bytes === String) + object.fileEncSha256 = ""; + else { + object.fileEncSha256 = []; + if (options.bytes !== Array) + object.fileEncSha256 = $util.newBuffer(object.fileEncSha256); + } } + if (message.mediaKey != null && message.hasOwnProperty("mediaKey")) + object.mediaKey = options.bytes === String ? $util.base64.encode(message.mediaKey, 0, message.mediaKey.length) : options.bytes === Array ? Array.prototype.slice.call(message.mediaKey) : message.mediaKey; + if (message.directPath != null && message.hasOwnProperty("directPath")) + object.directPath = message.directPath; + if (message.handle != null && message.hasOwnProperty("handle")) + object.handle = message.handle; + if (message.fileSizeBytes != null && message.hasOwnProperty("fileSizeBytes")) + if (typeof message.fileSizeBytes === "number") + object.fileSizeBytes = options.longs === String ? String(message.fileSizeBytes) : message.fileSizeBytes; + else + object.fileSizeBytes = options.longs === String ? $util.Long.prototype.toString.call(message.fileSizeBytes) : options.longs === Number ? new $util.LongBits(message.fileSizeBytes.low >>> 0, message.fileSizeBytes.high >>> 0).toNumber(true) : message.fileSizeBytes; + if (message.fileSha256 != null && message.hasOwnProperty("fileSha256")) + object.fileSha256 = options.bytes === String ? $util.base64.encode(message.fileSha256, 0, message.fileSha256.length) : options.bytes === Array ? Array.prototype.slice.call(message.fileSha256) : message.fileSha256; + if (message.fileEncSha256 != null && message.hasOwnProperty("fileEncSha256")) + object.fileEncSha256 = options.bytes === String ? $util.base64.encode(message.fileEncSha256, 0, message.fileEncSha256.length) : options.bytes === Array ? Array.prototype.slice.call(message.fileEncSha256) : message.fileEncSha256; return object; }; /** - * Converts this ProductSection to JSON. + * Converts this ExternalBlobReference to JSON. * @function toJSON - * @memberof proto.ProductSection + * @memberof proto.ExternalBlobReference * @instance * @returns {Object.} JSON object */ - ProductSection.prototype.toJSON = function toJSON() { + ExternalBlobReference.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ProductSection; + return ExternalBlobReference; })(); - proto.ProductListHeaderImage = (function() { + proto.KeyId = (function() { /** - * Properties of a ProductListHeaderImage. + * Properties of a KeyId. * @memberof proto - * @interface IProductListHeaderImage - * @property {string|null} [productId] ProductListHeaderImage productId - * @property {Uint8Array|null} [jpegThumbnail] ProductListHeaderImage jpegThumbnail + * @interface IKeyId + * @property {Uint8Array|null} [id] KeyId id */ /** - * Constructs a new ProductListHeaderImage. + * Constructs a new KeyId. * @memberof proto - * @classdesc Represents a ProductListHeaderImage. - * @implements IProductListHeaderImage + * @classdesc Represents a KeyId. + * @implements IKeyId * @constructor - * @param {proto.IProductListHeaderImage=} [properties] Properties to set + * @param {proto.IKeyId=} [properties] Properties to set */ - function ProductListHeaderImage(properties) { + function KeyId(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -39285,88 +39317,75 @@ $root.proto = (function() { } /** - * ProductListHeaderImage productId. - * @member {string} productId - * @memberof proto.ProductListHeaderImage - * @instance - */ - ProductListHeaderImage.prototype.productId = ""; - - /** - * ProductListHeaderImage jpegThumbnail. - * @member {Uint8Array} jpegThumbnail - * @memberof proto.ProductListHeaderImage + * KeyId id. + * @member {Uint8Array} id + * @memberof proto.KeyId * @instance */ - ProductListHeaderImage.prototype.jpegThumbnail = $util.newBuffer([]); + KeyId.prototype.id = $util.newBuffer([]); /** - * Creates a new ProductListHeaderImage instance using the specified properties. + * Creates a new KeyId instance using the specified properties. * @function create - * @memberof proto.ProductListHeaderImage + * @memberof proto.KeyId * @static - * @param {proto.IProductListHeaderImage=} [properties] Properties to set - * @returns {proto.ProductListHeaderImage} ProductListHeaderImage instance + * @param {proto.IKeyId=} [properties] Properties to set + * @returns {proto.KeyId} KeyId instance */ - ProductListHeaderImage.create = function create(properties) { - return new ProductListHeaderImage(properties); + KeyId.create = function create(properties) { + return new KeyId(properties); }; /** - * Encodes the specified ProductListHeaderImage message. Does not implicitly {@link proto.ProductListHeaderImage.verify|verify} messages. + * Encodes the specified KeyId message. Does not implicitly {@link proto.KeyId.verify|verify} messages. * @function encode - * @memberof proto.ProductListHeaderImage + * @memberof proto.KeyId * @static - * @param {proto.IProductListHeaderImage} message ProductListHeaderImage message or plain object to encode + * @param {proto.IKeyId} message KeyId message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ProductListHeaderImage.encode = function encode(message, writer) { + KeyId.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.productId != null && Object.hasOwnProperty.call(message, "productId")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.productId); - if (message.jpegThumbnail != null && Object.hasOwnProperty.call(message, "jpegThumbnail")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.jpegThumbnail); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.id); return writer; }; /** - * Encodes the specified ProductListHeaderImage message, length delimited. Does not implicitly {@link proto.ProductListHeaderImage.verify|verify} messages. + * Encodes the specified KeyId message, length delimited. Does not implicitly {@link proto.KeyId.verify|verify} messages. * @function encodeDelimited - * @memberof proto.ProductListHeaderImage + * @memberof proto.KeyId * @static - * @param {proto.IProductListHeaderImage} message ProductListHeaderImage message or plain object to encode + * @param {proto.IKeyId} message KeyId message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ProductListHeaderImage.encodeDelimited = function encodeDelimited(message, writer) { + KeyId.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ProductListHeaderImage message from the specified reader or buffer. + * Decodes a KeyId message from the specified reader or buffer. * @function decode - * @memberof proto.ProductListHeaderImage + * @memberof proto.KeyId * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {proto.ProductListHeaderImage} ProductListHeaderImage + * @returns {proto.KeyId} KeyId * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ProductListHeaderImage.decode = function decode(reader, length) { + KeyId.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.ProductListHeaderImage(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.KeyId(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.productId = reader.string(); - break; - case 2: - message.jpegThumbnail = reader.bytes(); + message.id = reader.bytes(); break; default: reader.skipType(tag & 7); @@ -39377,128 +39396,116 @@ $root.proto = (function() { }; /** - * Decodes a ProductListHeaderImage message from the specified reader or buffer, length delimited. + * Decodes a KeyId message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof proto.ProductListHeaderImage + * @memberof proto.KeyId * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.ProductListHeaderImage} ProductListHeaderImage + * @returns {proto.KeyId} KeyId * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ProductListHeaderImage.decodeDelimited = function decodeDelimited(reader) { + KeyId.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ProductListHeaderImage message. + * Verifies a KeyId message. * @function verify - * @memberof proto.ProductListHeaderImage + * @memberof proto.KeyId * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ProductListHeaderImage.verify = function verify(message) { + KeyId.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.productId != null && message.hasOwnProperty("productId")) - if (!$util.isString(message.productId)) - return "productId: string expected"; - if (message.jpegThumbnail != null && message.hasOwnProperty("jpegThumbnail")) - if (!(message.jpegThumbnail && typeof message.jpegThumbnail.length === "number" || $util.isString(message.jpegThumbnail))) - return "jpegThumbnail: buffer expected"; + if (message.id != null && message.hasOwnProperty("id")) + if (!(message.id && typeof message.id.length === "number" || $util.isString(message.id))) + return "id: buffer expected"; return null; }; /** - * Creates a ProductListHeaderImage message from a plain object. Also converts values to their respective internal types. + * Creates a KeyId message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof proto.ProductListHeaderImage + * @memberof proto.KeyId * @static * @param {Object.} object Plain object - * @returns {proto.ProductListHeaderImage} ProductListHeaderImage + * @returns {proto.KeyId} KeyId */ - ProductListHeaderImage.fromObject = function fromObject(object) { - if (object instanceof $root.proto.ProductListHeaderImage) + KeyId.fromObject = function fromObject(object) { + if (object instanceof $root.proto.KeyId) return object; - var message = new $root.proto.ProductListHeaderImage(); - if (object.productId != null) - message.productId = String(object.productId); - if (object.jpegThumbnail != null) - if (typeof object.jpegThumbnail === "string") - $util.base64.decode(object.jpegThumbnail, message.jpegThumbnail = $util.newBuffer($util.base64.length(object.jpegThumbnail)), 0); - else if (object.jpegThumbnail.length) - message.jpegThumbnail = object.jpegThumbnail; + var message = new $root.proto.KeyId(); + if (object.id != null) + if (typeof object.id === "string") + $util.base64.decode(object.id, message.id = $util.newBuffer($util.base64.length(object.id)), 0); + else if (object.id.length) + message.id = object.id; return message; }; /** - * Creates a plain object from a ProductListHeaderImage message. Also converts values to other types if specified. + * Creates a plain object from a KeyId message. Also converts values to other types if specified. * @function toObject - * @memberof proto.ProductListHeaderImage + * @memberof proto.KeyId * @static - * @param {proto.ProductListHeaderImage} message ProductListHeaderImage + * @param {proto.KeyId} message KeyId * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ProductListHeaderImage.toObject = function toObject(message, options) { + KeyId.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.productId = ""; + if (options.defaults) if (options.bytes === String) - object.jpegThumbnail = ""; + object.id = ""; else { - object.jpegThumbnail = []; + object.id = []; if (options.bytes !== Array) - object.jpegThumbnail = $util.newBuffer(object.jpegThumbnail); + object.id = $util.newBuffer(object.id); } - } - if (message.productId != null && message.hasOwnProperty("productId")) - object.productId = message.productId; - if (message.jpegThumbnail != null && message.hasOwnProperty("jpegThumbnail")) - object.jpegThumbnail = options.bytes === String ? $util.base64.encode(message.jpegThumbnail, 0, message.jpegThumbnail.length) : options.bytes === Array ? Array.prototype.slice.call(message.jpegThumbnail) : message.jpegThumbnail; + if (message.id != null && message.hasOwnProperty("id")) + object.id = options.bytes === String ? $util.base64.encode(message.id, 0, message.id.length) : options.bytes === Array ? Array.prototype.slice.call(message.id) : message.id; return object; }; /** - * Converts this ProductListHeaderImage to JSON. + * Converts this KeyId to JSON. * @function toJSON - * @memberof proto.ProductListHeaderImage + * @memberof proto.KeyId * @instance * @returns {Object.} JSON object */ - ProductListHeaderImage.prototype.toJSON = function toJSON() { + KeyId.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ProductListHeaderImage; + return KeyId; })(); - proto.ProductListInfo = (function() { + proto.SyncdIndex = (function() { /** - * Properties of a ProductListInfo. + * Properties of a SyncdIndex. * @memberof proto - * @interface IProductListInfo - * @property {Array.|null} [productSections] ProductListInfo productSections - * @property {proto.IProductListHeaderImage|null} [headerImage] ProductListInfo headerImage - * @property {string|null} [businessOwnerJid] ProductListInfo businessOwnerJid + * @interface ISyncdIndex + * @property {Uint8Array|null} [blob] SyncdIndex blob */ /** - * Constructs a new ProductListInfo. + * Constructs a new SyncdIndex. * @memberof proto - * @classdesc Represents a ProductListInfo. - * @implements IProductListInfo + * @classdesc Represents a SyncdIndex. + * @implements ISyncdIndex * @constructor - * @param {proto.IProductListInfo=} [properties] Properties to set + * @param {proto.ISyncdIndex=} [properties] Properties to set */ - function ProductListInfo(properties) { - this.productSections = []; + function SyncdIndex(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -39506,104 +39513,75 @@ $root.proto = (function() { } /** - * ProductListInfo productSections. - * @member {Array.} productSections - * @memberof proto.ProductListInfo - * @instance - */ - ProductListInfo.prototype.productSections = $util.emptyArray; - - /** - * ProductListInfo headerImage. - * @member {proto.IProductListHeaderImage|null|undefined} headerImage - * @memberof proto.ProductListInfo - * @instance - */ - ProductListInfo.prototype.headerImage = null; - - /** - * ProductListInfo businessOwnerJid. - * @member {string} businessOwnerJid - * @memberof proto.ProductListInfo + * SyncdIndex blob. + * @member {Uint8Array} blob + * @memberof proto.SyncdIndex * @instance */ - ProductListInfo.prototype.businessOwnerJid = ""; + SyncdIndex.prototype.blob = $util.newBuffer([]); /** - * Creates a new ProductListInfo instance using the specified properties. + * Creates a new SyncdIndex instance using the specified properties. * @function create - * @memberof proto.ProductListInfo + * @memberof proto.SyncdIndex * @static - * @param {proto.IProductListInfo=} [properties] Properties to set - * @returns {proto.ProductListInfo} ProductListInfo instance + * @param {proto.ISyncdIndex=} [properties] Properties to set + * @returns {proto.SyncdIndex} SyncdIndex instance */ - ProductListInfo.create = function create(properties) { - return new ProductListInfo(properties); + SyncdIndex.create = function create(properties) { + return new SyncdIndex(properties); }; /** - * Encodes the specified ProductListInfo message. Does not implicitly {@link proto.ProductListInfo.verify|verify} messages. + * Encodes the specified SyncdIndex message. Does not implicitly {@link proto.SyncdIndex.verify|verify} messages. * @function encode - * @memberof proto.ProductListInfo + * @memberof proto.SyncdIndex * @static - * @param {proto.IProductListInfo} message ProductListInfo message or plain object to encode + * @param {proto.ISyncdIndex} message SyncdIndex message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ProductListInfo.encode = function encode(message, writer) { + SyncdIndex.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.productSections != null && message.productSections.length) - for (var i = 0; i < message.productSections.length; ++i) - $root.proto.ProductSection.encode(message.productSections[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.headerImage != null && Object.hasOwnProperty.call(message, "headerImage")) - $root.proto.ProductListHeaderImage.encode(message.headerImage, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.businessOwnerJid != null && Object.hasOwnProperty.call(message, "businessOwnerJid")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.businessOwnerJid); + if (message.blob != null && Object.hasOwnProperty.call(message, "blob")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.blob); return writer; }; /** - * Encodes the specified ProductListInfo message, length delimited. Does not implicitly {@link proto.ProductListInfo.verify|verify} messages. + * Encodes the specified SyncdIndex message, length delimited. Does not implicitly {@link proto.SyncdIndex.verify|verify} messages. * @function encodeDelimited - * @memberof proto.ProductListInfo + * @memberof proto.SyncdIndex * @static - * @param {proto.IProductListInfo} message ProductListInfo message or plain object to encode + * @param {proto.ISyncdIndex} message SyncdIndex message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ProductListInfo.encodeDelimited = function encodeDelimited(message, writer) { + SyncdIndex.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ProductListInfo message from the specified reader or buffer. + * Decodes a SyncdIndex message from the specified reader or buffer. * @function decode - * @memberof proto.ProductListInfo + * @memberof proto.SyncdIndex * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {proto.ProductListInfo} ProductListInfo + * @returns {proto.SyncdIndex} SyncdIndex * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ProductListInfo.decode = function decode(reader, length) { + SyncdIndex.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.ProductListInfo(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.SyncdIndex(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - if (!(message.productSections && message.productSections.length)) - message.productSections = []; - message.productSections.push($root.proto.ProductSection.decode(reader, reader.uint32())); - break; - case 2: - message.headerImage = $root.proto.ProductListHeaderImage.decode(reader, reader.uint32()); - break; - case 3: - message.businessOwnerJid = reader.string(); + message.blob = reader.bytes(); break; default: reader.skipType(tag & 7); @@ -39614,155 +39592,117 @@ $root.proto = (function() { }; /** - * Decodes a ProductListInfo message from the specified reader or buffer, length delimited. + * Decodes a SyncdIndex message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof proto.ProductListInfo + * @memberof proto.SyncdIndex * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.ProductListInfo} ProductListInfo + * @returns {proto.SyncdIndex} SyncdIndex * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ProductListInfo.decodeDelimited = function decodeDelimited(reader) { + SyncdIndex.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ProductListInfo message. + * Verifies a SyncdIndex message. * @function verify - * @memberof proto.ProductListInfo + * @memberof proto.SyncdIndex * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ProductListInfo.verify = function verify(message) { + SyncdIndex.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.productSections != null && message.hasOwnProperty("productSections")) { - if (!Array.isArray(message.productSections)) - return "productSections: array expected"; - for (var i = 0; i < message.productSections.length; ++i) { - var error = $root.proto.ProductSection.verify(message.productSections[i]); - if (error) - return "productSections." + error; - } - } - if (message.headerImage != null && message.hasOwnProperty("headerImage")) { - var error = $root.proto.ProductListHeaderImage.verify(message.headerImage); - if (error) - return "headerImage." + error; - } - if (message.businessOwnerJid != null && message.hasOwnProperty("businessOwnerJid")) - if (!$util.isString(message.businessOwnerJid)) - return "businessOwnerJid: string expected"; + if (message.blob != null && message.hasOwnProperty("blob")) + if (!(message.blob && typeof message.blob.length === "number" || $util.isString(message.blob))) + return "blob: buffer expected"; return null; }; /** - * Creates a ProductListInfo message from a plain object. Also converts values to their respective internal types. + * Creates a SyncdIndex message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof proto.ProductListInfo + * @memberof proto.SyncdIndex * @static * @param {Object.} object Plain object - * @returns {proto.ProductListInfo} ProductListInfo + * @returns {proto.SyncdIndex} SyncdIndex */ - ProductListInfo.fromObject = function fromObject(object) { - if (object instanceof $root.proto.ProductListInfo) + SyncdIndex.fromObject = function fromObject(object) { + if (object instanceof $root.proto.SyncdIndex) return object; - var message = new $root.proto.ProductListInfo(); - if (object.productSections) { - if (!Array.isArray(object.productSections)) - throw TypeError(".proto.ProductListInfo.productSections: array expected"); - message.productSections = []; - for (var i = 0; i < object.productSections.length; ++i) { - if (typeof object.productSections[i] !== "object") - throw TypeError(".proto.ProductListInfo.productSections: object expected"); - message.productSections[i] = $root.proto.ProductSection.fromObject(object.productSections[i]); - } - } - if (object.headerImage != null) { - if (typeof object.headerImage !== "object") - throw TypeError(".proto.ProductListInfo.headerImage: object expected"); - message.headerImage = $root.proto.ProductListHeaderImage.fromObject(object.headerImage); - } - if (object.businessOwnerJid != null) - message.businessOwnerJid = String(object.businessOwnerJid); + var message = new $root.proto.SyncdIndex(); + if (object.blob != null) + if (typeof object.blob === "string") + $util.base64.decode(object.blob, message.blob = $util.newBuffer($util.base64.length(object.blob)), 0); + else if (object.blob.length) + message.blob = object.blob; return message; }; /** - * Creates a plain object from a ProductListInfo message. Also converts values to other types if specified. + * Creates a plain object from a SyncdIndex message. Also converts values to other types if specified. * @function toObject - * @memberof proto.ProductListInfo + * @memberof proto.SyncdIndex * @static - * @param {proto.ProductListInfo} message ProductListInfo + * @param {proto.SyncdIndex} message SyncdIndex * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ProductListInfo.toObject = function toObject(message, options) { + SyncdIndex.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.productSections = []; - if (options.defaults) { - object.headerImage = null; - object.businessOwnerJid = ""; - } - if (message.productSections && message.productSections.length) { - object.productSections = []; - for (var j = 0; j < message.productSections.length; ++j) - object.productSections[j] = $root.proto.ProductSection.toObject(message.productSections[j], options); - } - if (message.headerImage != null && message.hasOwnProperty("headerImage")) - object.headerImage = $root.proto.ProductListHeaderImage.toObject(message.headerImage, options); - if (message.businessOwnerJid != null && message.hasOwnProperty("businessOwnerJid")) - object.businessOwnerJid = message.businessOwnerJid; + if (options.defaults) + if (options.bytes === String) + object.blob = ""; + else { + object.blob = []; + if (options.bytes !== Array) + object.blob = $util.newBuffer(object.blob); + } + if (message.blob != null && message.hasOwnProperty("blob")) + object.blob = options.bytes === String ? $util.base64.encode(message.blob, 0, message.blob.length) : options.bytes === Array ? Array.prototype.slice.call(message.blob) : message.blob; return object; }; /** - * Converts this ProductListInfo to JSON. + * Converts this SyncdIndex to JSON. * @function toJSON - * @memberof proto.ProductListInfo + * @memberof proto.SyncdIndex * @instance * @returns {Object.} JSON object */ - ProductListInfo.prototype.toJSON = function toJSON() { + SyncdIndex.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ProductListInfo; + return SyncdIndex; })(); - proto.ListMessage = (function() { + proto.SyncdMutation = (function() { /** - * Properties of a ListMessage. + * Properties of a SyncdMutation. * @memberof proto - * @interface IListMessage - * @property {string|null} [title] ListMessage title - * @property {string|null} [description] ListMessage description - * @property {string|null} [buttonText] ListMessage buttonText - * @property {proto.ListMessage.ListMessageListType|null} [listType] ListMessage listType - * @property {Array.|null} [sections] ListMessage sections - * @property {proto.IProductListInfo|null} [productListInfo] ListMessage productListInfo - * @property {string|null} [footerText] ListMessage footerText - * @property {proto.IContextInfo|null} [contextInfo] ListMessage contextInfo + * @interface ISyncdMutation + * @property {proto.SyncdMutation.SyncdMutationSyncdOperation|null} [operation] SyncdMutation operation + * @property {proto.ISyncdRecord|null} [record] SyncdMutation record */ /** - * Constructs a new ListMessage. + * Constructs a new SyncdMutation. * @memberof proto - * @classdesc Represents a ListMessage. - * @implements IListMessage + * @classdesc Represents a SyncdMutation. + * @implements ISyncdMutation * @constructor - * @param {proto.IListMessage=} [properties] Properties to set + * @param {proto.ISyncdMutation=} [properties] Properties to set */ - function ListMessage(properties) { - this.sections = []; + function SyncdMutation(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -39770,169 +39710,88 @@ $root.proto = (function() { } /** - * ListMessage title. - * @member {string} title - * @memberof proto.ListMessage - * @instance - */ - ListMessage.prototype.title = ""; - - /** - * ListMessage description. - * @member {string} description - * @memberof proto.ListMessage - * @instance - */ - ListMessage.prototype.description = ""; - - /** - * ListMessage buttonText. - * @member {string} buttonText - * @memberof proto.ListMessage - * @instance - */ - ListMessage.prototype.buttonText = ""; - - /** - * ListMessage listType. - * @member {proto.ListMessage.ListMessageListType} listType - * @memberof proto.ListMessage - * @instance - */ - ListMessage.prototype.listType = 0; - - /** - * ListMessage sections. - * @member {Array.} sections - * @memberof proto.ListMessage - * @instance - */ - ListMessage.prototype.sections = $util.emptyArray; - - /** - * ListMessage productListInfo. - * @member {proto.IProductListInfo|null|undefined} productListInfo - * @memberof proto.ListMessage - * @instance - */ - ListMessage.prototype.productListInfo = null; - - /** - * ListMessage footerText. - * @member {string} footerText - * @memberof proto.ListMessage + * SyncdMutation operation. + * @member {proto.SyncdMutation.SyncdMutationSyncdOperation} operation + * @memberof proto.SyncdMutation * @instance */ - ListMessage.prototype.footerText = ""; + SyncdMutation.prototype.operation = 0; /** - * ListMessage contextInfo. - * @member {proto.IContextInfo|null|undefined} contextInfo - * @memberof proto.ListMessage + * SyncdMutation record. + * @member {proto.ISyncdRecord|null|undefined} record + * @memberof proto.SyncdMutation * @instance */ - ListMessage.prototype.contextInfo = null; + SyncdMutation.prototype.record = null; /** - * Creates a new ListMessage instance using the specified properties. + * Creates a new SyncdMutation instance using the specified properties. * @function create - * @memberof proto.ListMessage + * @memberof proto.SyncdMutation * @static - * @param {proto.IListMessage=} [properties] Properties to set - * @returns {proto.ListMessage} ListMessage instance + * @param {proto.ISyncdMutation=} [properties] Properties to set + * @returns {proto.SyncdMutation} SyncdMutation instance */ - ListMessage.create = function create(properties) { - return new ListMessage(properties); + SyncdMutation.create = function create(properties) { + return new SyncdMutation(properties); }; /** - * Encodes the specified ListMessage message. Does not implicitly {@link proto.ListMessage.verify|verify} messages. + * Encodes the specified SyncdMutation message. Does not implicitly {@link proto.SyncdMutation.verify|verify} messages. * @function encode - * @memberof proto.ListMessage + * @memberof proto.SyncdMutation * @static - * @param {proto.IListMessage} message ListMessage message or plain object to encode + * @param {proto.ISyncdMutation} message SyncdMutation message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListMessage.encode = function encode(message, writer) { + SyncdMutation.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.title != null && Object.hasOwnProperty.call(message, "title")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.title); - if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); - if (message.buttonText != null && Object.hasOwnProperty.call(message, "buttonText")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.buttonText); - if (message.listType != null && Object.hasOwnProperty.call(message, "listType")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.listType); - if (message.sections != null && message.sections.length) - for (var i = 0; i < message.sections.length; ++i) - $root.proto.Section.encode(message.sections[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.productListInfo != null && Object.hasOwnProperty.call(message, "productListInfo")) - $root.proto.ProductListInfo.encode(message.productListInfo, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.footerText != null && Object.hasOwnProperty.call(message, "footerText")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.footerText); - if (message.contextInfo != null && Object.hasOwnProperty.call(message, "contextInfo")) - $root.proto.ContextInfo.encode(message.contextInfo, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.operation != null && Object.hasOwnProperty.call(message, "operation")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.operation); + if (message.record != null && Object.hasOwnProperty.call(message, "record")) + $root.proto.SyncdRecord.encode(message.record, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** - * Encodes the specified ListMessage message, length delimited. Does not implicitly {@link proto.ListMessage.verify|verify} messages. + * Encodes the specified SyncdMutation message, length delimited. Does not implicitly {@link proto.SyncdMutation.verify|verify} messages. * @function encodeDelimited - * @memberof proto.ListMessage + * @memberof proto.SyncdMutation * @static - * @param {proto.IListMessage} message ListMessage message or plain object to encode + * @param {proto.ISyncdMutation} message SyncdMutation message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListMessage.encodeDelimited = function encodeDelimited(message, writer) { + SyncdMutation.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListMessage message from the specified reader or buffer. + * Decodes a SyncdMutation message from the specified reader or buffer. * @function decode - * @memberof proto.ListMessage + * @memberof proto.SyncdMutation * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {proto.ListMessage} ListMessage + * @returns {proto.SyncdMutation} SyncdMutation * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListMessage.decode = function decode(reader, length) { + SyncdMutation.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.ListMessage(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.SyncdMutation(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.title = reader.string(); + message.operation = reader.int32(); break; case 2: - message.description = reader.string(); - break; - case 3: - message.buttonText = reader.string(); - break; - case 4: - message.listType = reader.int32(); - break; - case 5: - if (!(message.sections && message.sections.length)) - message.sections = []; - message.sections.push($root.proto.Section.decode(reader, reader.uint32())); - break; - case 6: - message.productListInfo = $root.proto.ProductListInfo.decode(reader, reader.uint32()); - break; - case 7: - message.footerText = reader.string(); - break; - case 8: - message.contextInfo = $root.proto.ContextInfo.decode(reader, reader.uint32()); + message.record = $root.proto.SyncdRecord.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -39943,226 +39802,149 @@ $root.proto = (function() { }; /** - * Decodes a ListMessage message from the specified reader or buffer, length delimited. + * Decodes a SyncdMutation message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof proto.ListMessage + * @memberof proto.SyncdMutation * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.ListMessage} ListMessage + * @returns {proto.SyncdMutation} SyncdMutation * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListMessage.decodeDelimited = function decodeDelimited(reader) { + SyncdMutation.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListMessage message. + * Verifies a SyncdMutation message. * @function verify - * @memberof proto.ListMessage + * @memberof proto.SyncdMutation * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListMessage.verify = function verify(message) { + SyncdMutation.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.title != null && message.hasOwnProperty("title")) - if (!$util.isString(message.title)) - return "title: string expected"; - if (message.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: string expected"; - if (message.buttonText != null && message.hasOwnProperty("buttonText")) - if (!$util.isString(message.buttonText)) - return "buttonText: string expected"; - if (message.listType != null && message.hasOwnProperty("listType")) - switch (message.listType) { + if (message.operation != null && message.hasOwnProperty("operation")) + switch (message.operation) { default: - return "listType: enum value expected"; + return "operation: enum value expected"; case 0: case 1: - case 2: break; } - if (message.sections != null && message.hasOwnProperty("sections")) { - if (!Array.isArray(message.sections)) - return "sections: array expected"; - for (var i = 0; i < message.sections.length; ++i) { - var error = $root.proto.Section.verify(message.sections[i]); - if (error) - return "sections." + error; - } - } - if (message.productListInfo != null && message.hasOwnProperty("productListInfo")) { - var error = $root.proto.ProductListInfo.verify(message.productListInfo); - if (error) - return "productListInfo." + error; - } - if (message.footerText != null && message.hasOwnProperty("footerText")) - if (!$util.isString(message.footerText)) - return "footerText: string expected"; - if (message.contextInfo != null && message.hasOwnProperty("contextInfo")) { - var error = $root.proto.ContextInfo.verify(message.contextInfo); + if (message.record != null && message.hasOwnProperty("record")) { + var error = $root.proto.SyncdRecord.verify(message.record); if (error) - return "contextInfo." + error; + return "record." + error; } return null; }; /** - * Creates a ListMessage message from a plain object. Also converts values to their respective internal types. + * Creates a SyncdMutation message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof proto.ListMessage + * @memberof proto.SyncdMutation * @static * @param {Object.} object Plain object - * @returns {proto.ListMessage} ListMessage + * @returns {proto.SyncdMutation} SyncdMutation */ - ListMessage.fromObject = function fromObject(object) { - if (object instanceof $root.proto.ListMessage) + SyncdMutation.fromObject = function fromObject(object) { + if (object instanceof $root.proto.SyncdMutation) return object; - var message = new $root.proto.ListMessage(); - if (object.title != null) - message.title = String(object.title); - if (object.description != null) - message.description = String(object.description); - if (object.buttonText != null) - message.buttonText = String(object.buttonText); - switch (object.listType) { - case "UNKNOWN": + var message = new $root.proto.SyncdMutation(); + switch (object.operation) { + case "SET": case 0: - message.listType = 0; + message.operation = 0; break; - case "SINGLE_SELECT": + case "REMOVE": case 1: - message.listType = 1; - break; - case "PRODUCT_LIST": - case 2: - message.listType = 2; + message.operation = 1; break; } - if (object.sections) { - if (!Array.isArray(object.sections)) - throw TypeError(".proto.ListMessage.sections: array expected"); - message.sections = []; - for (var i = 0; i < object.sections.length; ++i) { - if (typeof object.sections[i] !== "object") - throw TypeError(".proto.ListMessage.sections: object expected"); - message.sections[i] = $root.proto.Section.fromObject(object.sections[i]); - } - } - if (object.productListInfo != null) { - if (typeof object.productListInfo !== "object") - throw TypeError(".proto.ListMessage.productListInfo: object expected"); - message.productListInfo = $root.proto.ProductListInfo.fromObject(object.productListInfo); - } - if (object.footerText != null) - message.footerText = String(object.footerText); - if (object.contextInfo != null) { - if (typeof object.contextInfo !== "object") - throw TypeError(".proto.ListMessage.contextInfo: object expected"); - message.contextInfo = $root.proto.ContextInfo.fromObject(object.contextInfo); + if (object.record != null) { + if (typeof object.record !== "object") + throw TypeError(".proto.SyncdMutation.record: object expected"); + message.record = $root.proto.SyncdRecord.fromObject(object.record); } return message; }; /** - * Creates a plain object from a ListMessage message. Also converts values to other types if specified. + * Creates a plain object from a SyncdMutation message. Also converts values to other types if specified. * @function toObject - * @memberof proto.ListMessage + * @memberof proto.SyncdMutation * @static - * @param {proto.ListMessage} message ListMessage + * @param {proto.SyncdMutation} message SyncdMutation * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListMessage.toObject = function toObject(message, options) { + SyncdMutation.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.sections = []; if (options.defaults) { - object.title = ""; - object.description = ""; - object.buttonText = ""; - object.listType = options.enums === String ? "UNKNOWN" : 0; - object.productListInfo = null; - object.footerText = ""; - object.contextInfo = null; - } - if (message.title != null && message.hasOwnProperty("title")) - object.title = message.title; - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; - if (message.buttonText != null && message.hasOwnProperty("buttonText")) - object.buttonText = message.buttonText; - if (message.listType != null && message.hasOwnProperty("listType")) - object.listType = options.enums === String ? $root.proto.ListMessage.ListMessageListType[message.listType] : message.listType; - if (message.sections && message.sections.length) { - object.sections = []; - for (var j = 0; j < message.sections.length; ++j) - object.sections[j] = $root.proto.Section.toObject(message.sections[j], options); + object.operation = options.enums === String ? "SET" : 0; + object.record = null; } - if (message.productListInfo != null && message.hasOwnProperty("productListInfo")) - object.productListInfo = $root.proto.ProductListInfo.toObject(message.productListInfo, options); - if (message.footerText != null && message.hasOwnProperty("footerText")) - object.footerText = message.footerText; - if (message.contextInfo != null && message.hasOwnProperty("contextInfo")) - object.contextInfo = $root.proto.ContextInfo.toObject(message.contextInfo, options); + if (message.operation != null && message.hasOwnProperty("operation")) + object.operation = options.enums === String ? $root.proto.SyncdMutation.SyncdMutationSyncdOperation[message.operation] : message.operation; + if (message.record != null && message.hasOwnProperty("record")) + object.record = $root.proto.SyncdRecord.toObject(message.record, options); return object; }; /** - * Converts this ListMessage to JSON. + * Converts this SyncdMutation to JSON. * @function toJSON - * @memberof proto.ListMessage + * @memberof proto.SyncdMutation * @instance * @returns {Object.} JSON object */ - ListMessage.prototype.toJSON = function toJSON() { + SyncdMutation.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * ListMessageListType enum. - * @name proto.ListMessage.ListMessageListType + * SyncdMutationSyncdOperation enum. + * @name proto.SyncdMutation.SyncdMutationSyncdOperation * @enum {number} - * @property {number} UNKNOWN=0 UNKNOWN value - * @property {number} SINGLE_SELECT=1 SINGLE_SELECT value - * @property {number} PRODUCT_LIST=2 PRODUCT_LIST value + * @property {number} SET=0 SET value + * @property {number} REMOVE=1 REMOVE value */ - ListMessage.ListMessageListType = (function() { + SyncdMutation.SyncdMutationSyncdOperation = (function() { var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "UNKNOWN"] = 0; - values[valuesById[1] = "SINGLE_SELECT"] = 1; - values[valuesById[2] = "PRODUCT_LIST"] = 2; + values[valuesById[0] = "SET"] = 0; + values[valuesById[1] = "REMOVE"] = 1; return values; })(); - return ListMessage; + return SyncdMutation; })(); - proto.SingleSelectReply = (function() { + proto.SyncdMutations = (function() { /** - * Properties of a SingleSelectReply. + * Properties of a SyncdMutations. * @memberof proto - * @interface ISingleSelectReply - * @property {string|null} [selectedRowId] SingleSelectReply selectedRowId + * @interface ISyncdMutations + * @property {Array.|null} [mutations] SyncdMutations mutations */ /** - * Constructs a new SingleSelectReply. + * Constructs a new SyncdMutations. * @memberof proto - * @classdesc Represents a SingleSelectReply. - * @implements ISingleSelectReply + * @classdesc Represents a SyncdMutations. + * @implements ISyncdMutations * @constructor - * @param {proto.ISingleSelectReply=} [properties] Properties to set + * @param {proto.ISyncdMutations=} [properties] Properties to set */ - function SingleSelectReply(properties) { + function SyncdMutations(properties) { + this.mutations = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -40170,75 +39952,78 @@ $root.proto = (function() { } /** - * SingleSelectReply selectedRowId. - * @member {string} selectedRowId - * @memberof proto.SingleSelectReply + * SyncdMutations mutations. + * @member {Array.} mutations + * @memberof proto.SyncdMutations * @instance */ - SingleSelectReply.prototype.selectedRowId = ""; + SyncdMutations.prototype.mutations = $util.emptyArray; /** - * Creates a new SingleSelectReply instance using the specified properties. + * Creates a new SyncdMutations instance using the specified properties. * @function create - * @memberof proto.SingleSelectReply + * @memberof proto.SyncdMutations * @static - * @param {proto.ISingleSelectReply=} [properties] Properties to set - * @returns {proto.SingleSelectReply} SingleSelectReply instance + * @param {proto.ISyncdMutations=} [properties] Properties to set + * @returns {proto.SyncdMutations} SyncdMutations instance */ - SingleSelectReply.create = function create(properties) { - return new SingleSelectReply(properties); + SyncdMutations.create = function create(properties) { + return new SyncdMutations(properties); }; /** - * Encodes the specified SingleSelectReply message. Does not implicitly {@link proto.SingleSelectReply.verify|verify} messages. + * Encodes the specified SyncdMutations message. Does not implicitly {@link proto.SyncdMutations.verify|verify} messages. * @function encode - * @memberof proto.SingleSelectReply + * @memberof proto.SyncdMutations * @static - * @param {proto.ISingleSelectReply} message SingleSelectReply message or plain object to encode + * @param {proto.ISyncdMutations} message SyncdMutations message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SingleSelectReply.encode = function encode(message, writer) { + SyncdMutations.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.selectedRowId != null && Object.hasOwnProperty.call(message, "selectedRowId")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.selectedRowId); + if (message.mutations != null && message.mutations.length) + for (var i = 0; i < message.mutations.length; ++i) + $root.proto.SyncdMutation.encode(message.mutations[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; /** - * Encodes the specified SingleSelectReply message, length delimited. Does not implicitly {@link proto.SingleSelectReply.verify|verify} messages. + * Encodes the specified SyncdMutations message, length delimited. Does not implicitly {@link proto.SyncdMutations.verify|verify} messages. * @function encodeDelimited - * @memberof proto.SingleSelectReply + * @memberof proto.SyncdMutations * @static - * @param {proto.ISingleSelectReply} message SingleSelectReply message or plain object to encode + * @param {proto.ISyncdMutations} message SyncdMutations message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SingleSelectReply.encodeDelimited = function encodeDelimited(message, writer) { + SyncdMutations.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a SingleSelectReply message from the specified reader or buffer. + * Decodes a SyncdMutations message from the specified reader or buffer. * @function decode - * @memberof proto.SingleSelectReply + * @memberof proto.SyncdMutations * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {proto.SingleSelectReply} SingleSelectReply + * @returns {proto.SyncdMutations} SyncdMutations * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SingleSelectReply.decode = function decode(reader, length) { + SyncdMutations.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.SingleSelectReply(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.SyncdMutations(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.selectedRowId = reader.string(); + if (!(message.mutations && message.mutations.length)) + message.mutations = []; + message.mutations.push($root.proto.SyncdMutation.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -40249,111 +40034,132 @@ $root.proto = (function() { }; /** - * Decodes a SingleSelectReply message from the specified reader or buffer, length delimited. + * Decodes a SyncdMutations message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof proto.SingleSelectReply + * @memberof proto.SyncdMutations * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.SingleSelectReply} SingleSelectReply + * @returns {proto.SyncdMutations} SyncdMutations * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SingleSelectReply.decodeDelimited = function decodeDelimited(reader) { + SyncdMutations.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a SingleSelectReply message. + * Verifies a SyncdMutations message. * @function verify - * @memberof proto.SingleSelectReply + * @memberof proto.SyncdMutations * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - SingleSelectReply.verify = function verify(message) { + SyncdMutations.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.selectedRowId != null && message.hasOwnProperty("selectedRowId")) - if (!$util.isString(message.selectedRowId)) - return "selectedRowId: string expected"; + if (message.mutations != null && message.hasOwnProperty("mutations")) { + if (!Array.isArray(message.mutations)) + return "mutations: array expected"; + for (var i = 0; i < message.mutations.length; ++i) { + var error = $root.proto.SyncdMutation.verify(message.mutations[i]); + if (error) + return "mutations." + error; + } + } return null; }; /** - * Creates a SingleSelectReply message from a plain object. Also converts values to their respective internal types. + * Creates a SyncdMutations message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof proto.SingleSelectReply + * @memberof proto.SyncdMutations * @static * @param {Object.} object Plain object - * @returns {proto.SingleSelectReply} SingleSelectReply + * @returns {proto.SyncdMutations} SyncdMutations */ - SingleSelectReply.fromObject = function fromObject(object) { - if (object instanceof $root.proto.SingleSelectReply) + SyncdMutations.fromObject = function fromObject(object) { + if (object instanceof $root.proto.SyncdMutations) return object; - var message = new $root.proto.SingleSelectReply(); - if (object.selectedRowId != null) - message.selectedRowId = String(object.selectedRowId); + var message = new $root.proto.SyncdMutations(); + if (object.mutations) { + if (!Array.isArray(object.mutations)) + throw TypeError(".proto.SyncdMutations.mutations: array expected"); + message.mutations = []; + for (var i = 0; i < object.mutations.length; ++i) { + if (typeof object.mutations[i] !== "object") + throw TypeError(".proto.SyncdMutations.mutations: object expected"); + message.mutations[i] = $root.proto.SyncdMutation.fromObject(object.mutations[i]); + } + } return message; }; /** - * Creates a plain object from a SingleSelectReply message. Also converts values to other types if specified. + * Creates a plain object from a SyncdMutations message. Also converts values to other types if specified. * @function toObject - * @memberof proto.SingleSelectReply + * @memberof proto.SyncdMutations * @static - * @param {proto.SingleSelectReply} message SingleSelectReply + * @param {proto.SyncdMutations} message SyncdMutations * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SingleSelectReply.toObject = function toObject(message, options) { + SyncdMutations.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) - object.selectedRowId = ""; - if (message.selectedRowId != null && message.hasOwnProperty("selectedRowId")) - object.selectedRowId = message.selectedRowId; + if (options.arrays || options.defaults) + object.mutations = []; + if (message.mutations && message.mutations.length) { + object.mutations = []; + for (var j = 0; j < message.mutations.length; ++j) + object.mutations[j] = $root.proto.SyncdMutation.toObject(message.mutations[j], options); + } return object; }; /** - * Converts this SingleSelectReply to JSON. + * Converts this SyncdMutations to JSON. * @function toJSON - * @memberof proto.SingleSelectReply + * @memberof proto.SyncdMutations * @instance * @returns {Object.} JSON object */ - SingleSelectReply.prototype.toJSON = function toJSON() { + SyncdMutations.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return SingleSelectReply; + return SyncdMutations; })(); - proto.ListResponseMessage = (function() { + proto.SyncdPatch = (function() { /** - * Properties of a ListResponseMessage. + * Properties of a SyncdPatch. * @memberof proto - * @interface IListResponseMessage - * @property {string|null} [title] ListResponseMessage title - * @property {proto.ListResponseMessage.ListResponseMessageListType|null} [listType] ListResponseMessage listType - * @property {proto.ISingleSelectReply|null} [singleSelectReply] ListResponseMessage singleSelectReply - * @property {proto.IContextInfo|null} [contextInfo] ListResponseMessage contextInfo - * @property {string|null} [description] ListResponseMessage description + * @interface ISyncdPatch + * @property {proto.ISyncdVersion|null} [version] SyncdPatch version + * @property {Array.|null} [mutations] SyncdPatch mutations + * @property {proto.IExternalBlobReference|null} [externalMutations] SyncdPatch externalMutations + * @property {Uint8Array|null} [snapshotMac] SyncdPatch snapshotMac + * @property {Uint8Array|null} [patchMac] SyncdPatch patchMac + * @property {proto.IKeyId|null} [keyId] SyncdPatch keyId + * @property {proto.IExitCode|null} [exitCode] SyncdPatch exitCode + * @property {number|null} [deviceIndex] SyncdPatch deviceIndex */ /** - * Constructs a new ListResponseMessage. + * Constructs a new SyncdPatch. * @memberof proto - * @classdesc Represents a ListResponseMessage. - * @implements IListResponseMessage + * @classdesc Represents a SyncdPatch. + * @implements ISyncdPatch * @constructor - * @param {proto.IListResponseMessage=} [properties] Properties to set + * @param {proto.ISyncdPatch=} [properties] Properties to set */ - function ListResponseMessage(properties) { + function SyncdPatch(properties) { + this.mutations = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -40361,127 +40167,169 @@ $root.proto = (function() { } /** - * ListResponseMessage title. - * @member {string} title - * @memberof proto.ListResponseMessage + * SyncdPatch version. + * @member {proto.ISyncdVersion|null|undefined} version + * @memberof proto.SyncdPatch * @instance */ - ListResponseMessage.prototype.title = ""; + SyncdPatch.prototype.version = null; /** - * ListResponseMessage listType. - * @member {proto.ListResponseMessage.ListResponseMessageListType} listType - * @memberof proto.ListResponseMessage + * SyncdPatch mutations. + * @member {Array.} mutations + * @memberof proto.SyncdPatch * @instance */ - ListResponseMessage.prototype.listType = 0; + SyncdPatch.prototype.mutations = $util.emptyArray; /** - * ListResponseMessage singleSelectReply. - * @member {proto.ISingleSelectReply|null|undefined} singleSelectReply - * @memberof proto.ListResponseMessage + * SyncdPatch externalMutations. + * @member {proto.IExternalBlobReference|null|undefined} externalMutations + * @memberof proto.SyncdPatch * @instance */ - ListResponseMessage.prototype.singleSelectReply = null; + SyncdPatch.prototype.externalMutations = null; /** - * ListResponseMessage contextInfo. - * @member {proto.IContextInfo|null|undefined} contextInfo - * @memberof proto.ListResponseMessage + * SyncdPatch snapshotMac. + * @member {Uint8Array} snapshotMac + * @memberof proto.SyncdPatch * @instance */ - ListResponseMessage.prototype.contextInfo = null; + SyncdPatch.prototype.snapshotMac = $util.newBuffer([]); /** - * ListResponseMessage description. - * @member {string} description - * @memberof proto.ListResponseMessage + * SyncdPatch patchMac. + * @member {Uint8Array} patchMac + * @memberof proto.SyncdPatch * @instance */ - ListResponseMessage.prototype.description = ""; + SyncdPatch.prototype.patchMac = $util.newBuffer([]); /** - * Creates a new ListResponseMessage instance using the specified properties. + * SyncdPatch keyId. + * @member {proto.IKeyId|null|undefined} keyId + * @memberof proto.SyncdPatch + * @instance + */ + SyncdPatch.prototype.keyId = null; + + /** + * SyncdPatch exitCode. + * @member {proto.IExitCode|null|undefined} exitCode + * @memberof proto.SyncdPatch + * @instance + */ + SyncdPatch.prototype.exitCode = null; + + /** + * SyncdPatch deviceIndex. + * @member {number} deviceIndex + * @memberof proto.SyncdPatch + * @instance + */ + SyncdPatch.prototype.deviceIndex = 0; + + /** + * Creates a new SyncdPatch instance using the specified properties. * @function create - * @memberof proto.ListResponseMessage + * @memberof proto.SyncdPatch * @static - * @param {proto.IListResponseMessage=} [properties] Properties to set - * @returns {proto.ListResponseMessage} ListResponseMessage instance + * @param {proto.ISyncdPatch=} [properties] Properties to set + * @returns {proto.SyncdPatch} SyncdPatch instance */ - ListResponseMessage.create = function create(properties) { - return new ListResponseMessage(properties); + SyncdPatch.create = function create(properties) { + return new SyncdPatch(properties); }; /** - * Encodes the specified ListResponseMessage message. Does not implicitly {@link proto.ListResponseMessage.verify|verify} messages. + * Encodes the specified SyncdPatch message. Does not implicitly {@link proto.SyncdPatch.verify|verify} messages. * @function encode - * @memberof proto.ListResponseMessage + * @memberof proto.SyncdPatch * @static - * @param {proto.IListResponseMessage} message ListResponseMessage message or plain object to encode + * @param {proto.ISyncdPatch} message SyncdPatch message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListResponseMessage.encode = function encode(message, writer) { + SyncdPatch.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.title != null && Object.hasOwnProperty.call(message, "title")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.title); - if (message.listType != null && Object.hasOwnProperty.call(message, "listType")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.listType); - if (message.singleSelectReply != null && Object.hasOwnProperty.call(message, "singleSelectReply")) - $root.proto.SingleSelectReply.encode(message.singleSelectReply, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.contextInfo != null && Object.hasOwnProperty.call(message, "contextInfo")) - $root.proto.ContextInfo.encode(message.contextInfo, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.description); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + $root.proto.SyncdVersion.encode(message.version, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.mutations != null && message.mutations.length) + for (var i = 0; i < message.mutations.length; ++i) + $root.proto.SyncdMutation.encode(message.mutations[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.externalMutations != null && Object.hasOwnProperty.call(message, "externalMutations")) + $root.proto.ExternalBlobReference.encode(message.externalMutations, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.snapshotMac != null && Object.hasOwnProperty.call(message, "snapshotMac")) + writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.snapshotMac); + if (message.patchMac != null && Object.hasOwnProperty.call(message, "patchMac")) + writer.uint32(/* id 5, wireType 2 =*/42).bytes(message.patchMac); + if (message.keyId != null && Object.hasOwnProperty.call(message, "keyId")) + $root.proto.KeyId.encode(message.keyId, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.exitCode != null && Object.hasOwnProperty.call(message, "exitCode")) + $root.proto.ExitCode.encode(message.exitCode, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.deviceIndex != null && Object.hasOwnProperty.call(message, "deviceIndex")) + writer.uint32(/* id 8, wireType 0 =*/64).uint32(message.deviceIndex); return writer; }; /** - * Encodes the specified ListResponseMessage message, length delimited. Does not implicitly {@link proto.ListResponseMessage.verify|verify} messages. + * Encodes the specified SyncdPatch message, length delimited. Does not implicitly {@link proto.SyncdPatch.verify|verify} messages. * @function encodeDelimited - * @memberof proto.ListResponseMessage + * @memberof proto.SyncdPatch * @static - * @param {proto.IListResponseMessage} message ListResponseMessage message or plain object to encode + * @param {proto.ISyncdPatch} message SyncdPatch message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListResponseMessage.encodeDelimited = function encodeDelimited(message, writer) { + SyncdPatch.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListResponseMessage message from the specified reader or buffer. + * Decodes a SyncdPatch message from the specified reader or buffer. * @function decode - * @memberof proto.ListResponseMessage + * @memberof proto.SyncdPatch * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {proto.ListResponseMessage} ListResponseMessage + * @returns {proto.SyncdPatch} SyncdPatch * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListResponseMessage.decode = function decode(reader, length) { + SyncdPatch.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.ListResponseMessage(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.SyncdPatch(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.title = reader.string(); + message.version = $root.proto.SyncdVersion.decode(reader, reader.uint32()); break; case 2: - message.listType = reader.int32(); + if (!(message.mutations && message.mutations.length)) + message.mutations = []; + message.mutations.push($root.proto.SyncdMutation.decode(reader, reader.uint32())); break; case 3: - message.singleSelectReply = $root.proto.SingleSelectReply.decode(reader, reader.uint32()); + message.externalMutations = $root.proto.ExternalBlobReference.decode(reader, reader.uint32()); break; case 4: - message.contextInfo = $root.proto.ContextInfo.decode(reader, reader.uint32()); + message.snapshotMac = reader.bytes(); break; case 5: - message.description = reader.string(); + message.patchMac = reader.bytes(); + break; + case 6: + message.keyId = $root.proto.KeyId.decode(reader, reader.uint32()); + break; + case 7: + message.exitCode = $root.proto.ExitCode.decode(reader, reader.uint32()); + break; + case 8: + message.deviceIndex = reader.uint32(); break; default: reader.skipType(tag & 7); @@ -40492,183 +40340,222 @@ $root.proto = (function() { }; /** - * Decodes a ListResponseMessage message from the specified reader or buffer, length delimited. + * Decodes a SyncdPatch message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof proto.ListResponseMessage + * @memberof proto.SyncdPatch * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.ListResponseMessage} ListResponseMessage + * @returns {proto.SyncdPatch} SyncdPatch * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListResponseMessage.decodeDelimited = function decodeDelimited(reader) { + SyncdPatch.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListResponseMessage message. + * Verifies a SyncdPatch message. * @function verify - * @memberof proto.ListResponseMessage + * @memberof proto.SyncdPatch * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListResponseMessage.verify = function verify(message) { + SyncdPatch.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.title != null && message.hasOwnProperty("title")) - if (!$util.isString(message.title)) - return "title: string expected"; - if (message.listType != null && message.hasOwnProperty("listType")) - switch (message.listType) { - default: - return "listType: enum value expected"; - case 0: - case 1: - break; - } - if (message.singleSelectReply != null && message.hasOwnProperty("singleSelectReply")) { - var error = $root.proto.SingleSelectReply.verify(message.singleSelectReply); - if (error) - return "singleSelectReply." + error; - } - if (message.contextInfo != null && message.hasOwnProperty("contextInfo")) { - var error = $root.proto.ContextInfo.verify(message.contextInfo); + if (message.version != null && message.hasOwnProperty("version")) { + var error = $root.proto.SyncdVersion.verify(message.version); if (error) - return "contextInfo." + error; + return "version." + error; } - if (message.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: string expected"; + if (message.mutations != null && message.hasOwnProperty("mutations")) { + if (!Array.isArray(message.mutations)) + return "mutations: array expected"; + for (var i = 0; i < message.mutations.length; ++i) { + var error = $root.proto.SyncdMutation.verify(message.mutations[i]); + if (error) + return "mutations." + error; + } + } + if (message.externalMutations != null && message.hasOwnProperty("externalMutations")) { + var error = $root.proto.ExternalBlobReference.verify(message.externalMutations); + if (error) + return "externalMutations." + error; + } + if (message.snapshotMac != null && message.hasOwnProperty("snapshotMac")) + if (!(message.snapshotMac && typeof message.snapshotMac.length === "number" || $util.isString(message.snapshotMac))) + return "snapshotMac: buffer expected"; + if (message.patchMac != null && message.hasOwnProperty("patchMac")) + if (!(message.patchMac && typeof message.patchMac.length === "number" || $util.isString(message.patchMac))) + return "patchMac: buffer expected"; + if (message.keyId != null && message.hasOwnProperty("keyId")) { + var error = $root.proto.KeyId.verify(message.keyId); + if (error) + return "keyId." + error; + } + if (message.exitCode != null && message.hasOwnProperty("exitCode")) { + var error = $root.proto.ExitCode.verify(message.exitCode); + if (error) + return "exitCode." + error; + } + if (message.deviceIndex != null && message.hasOwnProperty("deviceIndex")) + if (!$util.isInteger(message.deviceIndex)) + return "deviceIndex: integer expected"; return null; }; /** - * Creates a ListResponseMessage message from a plain object. Also converts values to their respective internal types. + * Creates a SyncdPatch message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof proto.ListResponseMessage + * @memberof proto.SyncdPatch * @static * @param {Object.} object Plain object - * @returns {proto.ListResponseMessage} ListResponseMessage + * @returns {proto.SyncdPatch} SyncdPatch */ - ListResponseMessage.fromObject = function fromObject(object) { - if (object instanceof $root.proto.ListResponseMessage) + SyncdPatch.fromObject = function fromObject(object) { + if (object instanceof $root.proto.SyncdPatch) return object; - var message = new $root.proto.ListResponseMessage(); - if (object.title != null) - message.title = String(object.title); - switch (object.listType) { - case "UNKNOWN": - case 0: - message.listType = 0; - break; - case "SINGLE_SELECT": - case 1: - message.listType = 1; - break; + var message = new $root.proto.SyncdPatch(); + if (object.version != null) { + if (typeof object.version !== "object") + throw TypeError(".proto.SyncdPatch.version: object expected"); + message.version = $root.proto.SyncdVersion.fromObject(object.version); } - if (object.singleSelectReply != null) { - if (typeof object.singleSelectReply !== "object") - throw TypeError(".proto.ListResponseMessage.singleSelectReply: object expected"); - message.singleSelectReply = $root.proto.SingleSelectReply.fromObject(object.singleSelectReply); + if (object.mutations) { + if (!Array.isArray(object.mutations)) + throw TypeError(".proto.SyncdPatch.mutations: array expected"); + message.mutations = []; + for (var i = 0; i < object.mutations.length; ++i) { + if (typeof object.mutations[i] !== "object") + throw TypeError(".proto.SyncdPatch.mutations: object expected"); + message.mutations[i] = $root.proto.SyncdMutation.fromObject(object.mutations[i]); + } } - if (object.contextInfo != null) { - if (typeof object.contextInfo !== "object") - throw TypeError(".proto.ListResponseMessage.contextInfo: object expected"); - message.contextInfo = $root.proto.ContextInfo.fromObject(object.contextInfo); + if (object.externalMutations != null) { + if (typeof object.externalMutations !== "object") + throw TypeError(".proto.SyncdPatch.externalMutations: object expected"); + message.externalMutations = $root.proto.ExternalBlobReference.fromObject(object.externalMutations); } - if (object.description != null) - message.description = String(object.description); + if (object.snapshotMac != null) + if (typeof object.snapshotMac === "string") + $util.base64.decode(object.snapshotMac, message.snapshotMac = $util.newBuffer($util.base64.length(object.snapshotMac)), 0); + else if (object.snapshotMac.length) + message.snapshotMac = object.snapshotMac; + if (object.patchMac != null) + if (typeof object.patchMac === "string") + $util.base64.decode(object.patchMac, message.patchMac = $util.newBuffer($util.base64.length(object.patchMac)), 0); + else if (object.patchMac.length) + message.patchMac = object.patchMac; + if (object.keyId != null) { + if (typeof object.keyId !== "object") + throw TypeError(".proto.SyncdPatch.keyId: object expected"); + message.keyId = $root.proto.KeyId.fromObject(object.keyId); + } + if (object.exitCode != null) { + if (typeof object.exitCode !== "object") + throw TypeError(".proto.SyncdPatch.exitCode: object expected"); + message.exitCode = $root.proto.ExitCode.fromObject(object.exitCode); + } + if (object.deviceIndex != null) + message.deviceIndex = object.deviceIndex >>> 0; return message; }; /** - * Creates a plain object from a ListResponseMessage message. Also converts values to other types if specified. + * Creates a plain object from a SyncdPatch message. Also converts values to other types if specified. * @function toObject - * @memberof proto.ListResponseMessage + * @memberof proto.SyncdPatch * @static - * @param {proto.ListResponseMessage} message ListResponseMessage + * @param {proto.SyncdPatch} message SyncdPatch * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListResponseMessage.toObject = function toObject(message, options) { + SyncdPatch.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.mutations = []; if (options.defaults) { - object.title = ""; - object.listType = options.enums === String ? "UNKNOWN" : 0; - object.singleSelectReply = null; - object.contextInfo = null; - object.description = ""; + object.version = null; + object.externalMutations = null; + if (options.bytes === String) + object.snapshotMac = ""; + else { + object.snapshotMac = []; + if (options.bytes !== Array) + object.snapshotMac = $util.newBuffer(object.snapshotMac); + } + if (options.bytes === String) + object.patchMac = ""; + else { + object.patchMac = []; + if (options.bytes !== Array) + object.patchMac = $util.newBuffer(object.patchMac); + } + object.keyId = null; + object.exitCode = null; + object.deviceIndex = 0; } - if (message.title != null && message.hasOwnProperty("title")) - object.title = message.title; - if (message.listType != null && message.hasOwnProperty("listType")) - object.listType = options.enums === String ? $root.proto.ListResponseMessage.ListResponseMessageListType[message.listType] : message.listType; - if (message.singleSelectReply != null && message.hasOwnProperty("singleSelectReply")) - object.singleSelectReply = $root.proto.SingleSelectReply.toObject(message.singleSelectReply, options); - if (message.contextInfo != null && message.hasOwnProperty("contextInfo")) - object.contextInfo = $root.proto.ContextInfo.toObject(message.contextInfo, options); - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; + if (message.version != null && message.hasOwnProperty("version")) + object.version = $root.proto.SyncdVersion.toObject(message.version, options); + if (message.mutations && message.mutations.length) { + object.mutations = []; + for (var j = 0; j < message.mutations.length; ++j) + object.mutations[j] = $root.proto.SyncdMutation.toObject(message.mutations[j], options); + } + if (message.externalMutations != null && message.hasOwnProperty("externalMutations")) + object.externalMutations = $root.proto.ExternalBlobReference.toObject(message.externalMutations, options); + if (message.snapshotMac != null && message.hasOwnProperty("snapshotMac")) + object.snapshotMac = options.bytes === String ? $util.base64.encode(message.snapshotMac, 0, message.snapshotMac.length) : options.bytes === Array ? Array.prototype.slice.call(message.snapshotMac) : message.snapshotMac; + if (message.patchMac != null && message.hasOwnProperty("patchMac")) + object.patchMac = options.bytes === String ? $util.base64.encode(message.patchMac, 0, message.patchMac.length) : options.bytes === Array ? Array.prototype.slice.call(message.patchMac) : message.patchMac; + if (message.keyId != null && message.hasOwnProperty("keyId")) + object.keyId = $root.proto.KeyId.toObject(message.keyId, options); + if (message.exitCode != null && message.hasOwnProperty("exitCode")) + object.exitCode = $root.proto.ExitCode.toObject(message.exitCode, options); + if (message.deviceIndex != null && message.hasOwnProperty("deviceIndex")) + object.deviceIndex = message.deviceIndex; return object; }; /** - * Converts this ListResponseMessage to JSON. + * Converts this SyncdPatch to JSON. * @function toJSON - * @memberof proto.ListResponseMessage + * @memberof proto.SyncdPatch * @instance * @returns {Object.} JSON object */ - ListResponseMessage.prototype.toJSON = function toJSON() { + SyncdPatch.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - /** - * ListResponseMessageListType enum. - * @name proto.ListResponseMessage.ListResponseMessageListType - * @enum {number} - * @property {number} UNKNOWN=0 UNKNOWN value - * @property {number} SINGLE_SELECT=1 SINGLE_SELECT value - */ - ListResponseMessage.ListResponseMessageListType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "UNKNOWN"] = 0; - values[valuesById[1] = "SINGLE_SELECT"] = 1; - return values; - })(); - - return ListResponseMessage; + return SyncdPatch; })(); - proto.Header = (function() { + proto.SyncdRecord = (function() { /** - * Properties of a Header. + * Properties of a SyncdRecord. * @memberof proto - * @interface IHeader - * @property {string|null} [title] Header title - * @property {string|null} [subtitle] Header subtitle - * @property {boolean|null} [hasMediaAttachment] Header hasMediaAttachment - * @property {proto.IDocumentMessage|null} [documentMessage] Header documentMessage - * @property {proto.IImageMessage|null} [imageMessage] Header imageMessage - * @property {Uint8Array|null} [jpegThumbnail] Header jpegThumbnail - * @property {proto.IVideoMessage|null} [videoMessage] Header videoMessage + * @interface ISyncdRecord + * @property {proto.ISyncdIndex|null} [index] SyncdRecord index + * @property {proto.ISyncdValue|null} [value] SyncdRecord value + * @property {proto.IKeyId|null} [keyId] SyncdRecord keyId */ /** - * Constructs a new Header. + * Constructs a new SyncdRecord. * @memberof proto - * @classdesc Represents a Header. - * @implements IHeader + * @classdesc Represents a SyncdRecord. + * @implements ISyncdRecord * @constructor - * @param {proto.IHeader=} [properties] Properties to set + * @param {proto.ISyncdRecord=} [properties] Properties to set */ - function Header(properties) { + function SyncdRecord(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -40676,167 +40563,101 @@ $root.proto = (function() { } /** - * Header title. - * @member {string} title - * @memberof proto.Header - * @instance - */ - Header.prototype.title = ""; - - /** - * Header subtitle. - * @member {string} subtitle - * @memberof proto.Header - * @instance - */ - Header.prototype.subtitle = ""; - - /** - * Header hasMediaAttachment. - * @member {boolean} hasMediaAttachment - * @memberof proto.Header - * @instance - */ - Header.prototype.hasMediaAttachment = false; - - /** - * Header documentMessage. - * @member {proto.IDocumentMessage|null|undefined} documentMessage - * @memberof proto.Header - * @instance - */ - Header.prototype.documentMessage = null; - - /** - * Header imageMessage. - * @member {proto.IImageMessage|null|undefined} imageMessage - * @memberof proto.Header - * @instance - */ - Header.prototype.imageMessage = null; - - /** - * Header jpegThumbnail. - * @member {Uint8Array|null|undefined} jpegThumbnail - * @memberof proto.Header + * SyncdRecord index. + * @member {proto.ISyncdIndex|null|undefined} index + * @memberof proto.SyncdRecord * @instance */ - Header.prototype.jpegThumbnail = null; + SyncdRecord.prototype.index = null; /** - * Header videoMessage. - * @member {proto.IVideoMessage|null|undefined} videoMessage - * @memberof proto.Header + * SyncdRecord value. + * @member {proto.ISyncdValue|null|undefined} value + * @memberof proto.SyncdRecord * @instance */ - Header.prototype.videoMessage = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + SyncdRecord.prototype.value = null; /** - * Header media. - * @member {"documentMessage"|"imageMessage"|"jpegThumbnail"|"videoMessage"|undefined} media - * @memberof proto.Header + * SyncdRecord keyId. + * @member {proto.IKeyId|null|undefined} keyId + * @memberof proto.SyncdRecord * @instance */ - Object.defineProperty(Header.prototype, "media", { - get: $util.oneOfGetter($oneOfFields = ["documentMessage", "imageMessage", "jpegThumbnail", "videoMessage"]), - set: $util.oneOfSetter($oneOfFields) - }); + SyncdRecord.prototype.keyId = null; /** - * Creates a new Header instance using the specified properties. + * Creates a new SyncdRecord instance using the specified properties. * @function create - * @memberof proto.Header + * @memberof proto.SyncdRecord * @static - * @param {proto.IHeader=} [properties] Properties to set - * @returns {proto.Header} Header instance + * @param {proto.ISyncdRecord=} [properties] Properties to set + * @returns {proto.SyncdRecord} SyncdRecord instance */ - Header.create = function create(properties) { - return new Header(properties); + SyncdRecord.create = function create(properties) { + return new SyncdRecord(properties); }; /** - * Encodes the specified Header message. Does not implicitly {@link proto.Header.verify|verify} messages. + * Encodes the specified SyncdRecord message. Does not implicitly {@link proto.SyncdRecord.verify|verify} messages. * @function encode - * @memberof proto.Header + * @memberof proto.SyncdRecord * @static - * @param {proto.IHeader} message Header message or plain object to encode + * @param {proto.ISyncdRecord} message SyncdRecord message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Header.encode = function encode(message, writer) { + SyncdRecord.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.title != null && Object.hasOwnProperty.call(message, "title")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.title); - if (message.subtitle != null && Object.hasOwnProperty.call(message, "subtitle")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.subtitle); - if (message.documentMessage != null && Object.hasOwnProperty.call(message, "documentMessage")) - $root.proto.DocumentMessage.encode(message.documentMessage, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.imageMessage != null && Object.hasOwnProperty.call(message, "imageMessage")) - $root.proto.ImageMessage.encode(message.imageMessage, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.hasMediaAttachment != null && Object.hasOwnProperty.call(message, "hasMediaAttachment")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.hasMediaAttachment); - if (message.jpegThumbnail != null && Object.hasOwnProperty.call(message, "jpegThumbnail")) - writer.uint32(/* id 6, wireType 2 =*/50).bytes(message.jpegThumbnail); - if (message.videoMessage != null && Object.hasOwnProperty.call(message, "videoMessage")) - $root.proto.VideoMessage.encode(message.videoMessage, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.index != null && Object.hasOwnProperty.call(message, "index")) + $root.proto.SyncdIndex.encode(message.index, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + $root.proto.SyncdValue.encode(message.value, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.keyId != null && Object.hasOwnProperty.call(message, "keyId")) + $root.proto.KeyId.encode(message.keyId, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; /** - * Encodes the specified Header message, length delimited. Does not implicitly {@link proto.Header.verify|verify} messages. + * Encodes the specified SyncdRecord message, length delimited. Does not implicitly {@link proto.SyncdRecord.verify|verify} messages. * @function encodeDelimited - * @memberof proto.Header + * @memberof proto.SyncdRecord * @static - * @param {proto.IHeader} message Header message or plain object to encode + * @param {proto.ISyncdRecord} message SyncdRecord message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Header.encodeDelimited = function encodeDelimited(message, writer) { + SyncdRecord.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Header message from the specified reader or buffer. + * Decodes a SyncdRecord message from the specified reader or buffer. * @function decode - * @memberof proto.Header + * @memberof proto.SyncdRecord * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {proto.Header} Header + * @returns {proto.SyncdRecord} SyncdRecord * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Header.decode = function decode(reader, length) { + SyncdRecord.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.Header(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.SyncdRecord(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.title = reader.string(); + message.index = $root.proto.SyncdIndex.decode(reader, reader.uint32()); break; case 2: - message.subtitle = reader.string(); - break; - case 5: - message.hasMediaAttachment = reader.bool(); + message.value = $root.proto.SyncdValue.decode(reader, reader.uint32()); break; case 3: - message.documentMessage = $root.proto.DocumentMessage.decode(reader, reader.uint32()); - break; - case 4: - message.imageMessage = $root.proto.ImageMessage.decode(reader, reader.uint32()); - break; - case 6: - message.jpegThumbnail = reader.bytes(); - break; - case 7: - message.videoMessage = $root.proto.VideoMessage.decode(reader, reader.uint32()); + message.keyId = $root.proto.KeyId.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -40847,200 +40668,143 @@ $root.proto = (function() { }; /** - * Decodes a Header message from the specified reader or buffer, length delimited. + * Decodes a SyncdRecord message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof proto.Header + * @memberof proto.SyncdRecord * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.Header} Header + * @returns {proto.SyncdRecord} SyncdRecord * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Header.decodeDelimited = function decodeDelimited(reader) { + SyncdRecord.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Header message. + * Verifies a SyncdRecord message. * @function verify - * @memberof proto.Header + * @memberof proto.SyncdRecord * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Header.verify = function verify(message) { + SyncdRecord.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - var properties = {}; - if (message.title != null && message.hasOwnProperty("title")) - if (!$util.isString(message.title)) - return "title: string expected"; - if (message.subtitle != null && message.hasOwnProperty("subtitle")) - if (!$util.isString(message.subtitle)) - return "subtitle: string expected"; - if (message.hasMediaAttachment != null && message.hasOwnProperty("hasMediaAttachment")) - if (typeof message.hasMediaAttachment !== "boolean") - return "hasMediaAttachment: boolean expected"; - if (message.documentMessage != null && message.hasOwnProperty("documentMessage")) { - properties.media = 1; - { - var error = $root.proto.DocumentMessage.verify(message.documentMessage); - if (error) - return "documentMessage." + error; - } - } - if (message.imageMessage != null && message.hasOwnProperty("imageMessage")) { - if (properties.media === 1) - return "media: multiple values"; - properties.media = 1; - { - var error = $root.proto.ImageMessage.verify(message.imageMessage); - if (error) - return "imageMessage." + error; - } + if (message.index != null && message.hasOwnProperty("index")) { + var error = $root.proto.SyncdIndex.verify(message.index); + if (error) + return "index." + error; } - if (message.jpegThumbnail != null && message.hasOwnProperty("jpegThumbnail")) { - if (properties.media === 1) - return "media: multiple values"; - properties.media = 1; - if (!(message.jpegThumbnail && typeof message.jpegThumbnail.length === "number" || $util.isString(message.jpegThumbnail))) - return "jpegThumbnail: buffer expected"; + if (message.value != null && message.hasOwnProperty("value")) { + var error = $root.proto.SyncdValue.verify(message.value); + if (error) + return "value." + error; } - if (message.videoMessage != null && message.hasOwnProperty("videoMessage")) { - if (properties.media === 1) - return "media: multiple values"; - properties.media = 1; - { - var error = $root.proto.VideoMessage.verify(message.videoMessage); - if (error) - return "videoMessage." + error; - } + if (message.keyId != null && message.hasOwnProperty("keyId")) { + var error = $root.proto.KeyId.verify(message.keyId); + if (error) + return "keyId." + error; } return null; }; /** - * Creates a Header message from a plain object. Also converts values to their respective internal types. + * Creates a SyncdRecord message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof proto.Header + * @memberof proto.SyncdRecord * @static * @param {Object.} object Plain object - * @returns {proto.Header} Header + * @returns {proto.SyncdRecord} SyncdRecord */ - Header.fromObject = function fromObject(object) { - if (object instanceof $root.proto.Header) + SyncdRecord.fromObject = function fromObject(object) { + if (object instanceof $root.proto.SyncdRecord) return object; - var message = new $root.proto.Header(); - if (object.title != null) - message.title = String(object.title); - if (object.subtitle != null) - message.subtitle = String(object.subtitle); - if (object.hasMediaAttachment != null) - message.hasMediaAttachment = Boolean(object.hasMediaAttachment); - if (object.documentMessage != null) { - if (typeof object.documentMessage !== "object") - throw TypeError(".proto.Header.documentMessage: object expected"); - message.documentMessage = $root.proto.DocumentMessage.fromObject(object.documentMessage); + var message = new $root.proto.SyncdRecord(); + if (object.index != null) { + if (typeof object.index !== "object") + throw TypeError(".proto.SyncdRecord.index: object expected"); + message.index = $root.proto.SyncdIndex.fromObject(object.index); } - if (object.imageMessage != null) { - if (typeof object.imageMessage !== "object") - throw TypeError(".proto.Header.imageMessage: object expected"); - message.imageMessage = $root.proto.ImageMessage.fromObject(object.imageMessage); + if (object.value != null) { + if (typeof object.value !== "object") + throw TypeError(".proto.SyncdRecord.value: object expected"); + message.value = $root.proto.SyncdValue.fromObject(object.value); } - if (object.jpegThumbnail != null) - if (typeof object.jpegThumbnail === "string") - $util.base64.decode(object.jpegThumbnail, message.jpegThumbnail = $util.newBuffer($util.base64.length(object.jpegThumbnail)), 0); - else if (object.jpegThumbnail.length) - message.jpegThumbnail = object.jpegThumbnail; - if (object.videoMessage != null) { - if (typeof object.videoMessage !== "object") - throw TypeError(".proto.Header.videoMessage: object expected"); - message.videoMessage = $root.proto.VideoMessage.fromObject(object.videoMessage); + if (object.keyId != null) { + if (typeof object.keyId !== "object") + throw TypeError(".proto.SyncdRecord.keyId: object expected"); + message.keyId = $root.proto.KeyId.fromObject(object.keyId); } return message; }; /** - * Creates a plain object from a Header message. Also converts values to other types if specified. + * Creates a plain object from a SyncdRecord message. Also converts values to other types if specified. * @function toObject - * @memberof proto.Header + * @memberof proto.SyncdRecord * @static - * @param {proto.Header} message Header + * @param {proto.SyncdRecord} message SyncdRecord * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Header.toObject = function toObject(message, options) { + SyncdRecord.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.title = ""; - object.subtitle = ""; - object.hasMediaAttachment = false; - } - if (message.title != null && message.hasOwnProperty("title")) - object.title = message.title; - if (message.subtitle != null && message.hasOwnProperty("subtitle")) - object.subtitle = message.subtitle; - if (message.documentMessage != null && message.hasOwnProperty("documentMessage")) { - object.documentMessage = $root.proto.DocumentMessage.toObject(message.documentMessage, options); - if (options.oneofs) - object.media = "documentMessage"; - } - if (message.imageMessage != null && message.hasOwnProperty("imageMessage")) { - object.imageMessage = $root.proto.ImageMessage.toObject(message.imageMessage, options); - if (options.oneofs) - object.media = "imageMessage"; - } - if (message.hasMediaAttachment != null && message.hasOwnProperty("hasMediaAttachment")) - object.hasMediaAttachment = message.hasMediaAttachment; - if (message.jpegThumbnail != null && message.hasOwnProperty("jpegThumbnail")) { - object.jpegThumbnail = options.bytes === String ? $util.base64.encode(message.jpegThumbnail, 0, message.jpegThumbnail.length) : options.bytes === Array ? Array.prototype.slice.call(message.jpegThumbnail) : message.jpegThumbnail; - if (options.oneofs) - object.media = "jpegThumbnail"; - } - if (message.videoMessage != null && message.hasOwnProperty("videoMessage")) { - object.videoMessage = $root.proto.VideoMessage.toObject(message.videoMessage, options); - if (options.oneofs) - object.media = "videoMessage"; + object.index = null; + object.value = null; + object.keyId = null; } + if (message.index != null && message.hasOwnProperty("index")) + object.index = $root.proto.SyncdIndex.toObject(message.index, options); + if (message.value != null && message.hasOwnProperty("value")) + object.value = $root.proto.SyncdValue.toObject(message.value, options); + if (message.keyId != null && message.hasOwnProperty("keyId")) + object.keyId = $root.proto.KeyId.toObject(message.keyId, options); return object; }; /** - * Converts this Header to JSON. + * Converts this SyncdRecord to JSON. * @function toJSON - * @memberof proto.Header + * @memberof proto.SyncdRecord * @instance * @returns {Object.} JSON object */ - Header.prototype.toJSON = function toJSON() { + SyncdRecord.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return Header; + return SyncdRecord; })(); - proto.Body = (function() { + proto.SyncdSnapshot = (function() { /** - * Properties of a Body. + * Properties of a SyncdSnapshot. * @memberof proto - * @interface IBody - * @property {string|null} [text] Body text + * @interface ISyncdSnapshot + * @property {proto.ISyncdVersion|null} [version] SyncdSnapshot version + * @property {Array.|null} [records] SyncdSnapshot records + * @property {Uint8Array|null} [mac] SyncdSnapshot mac + * @property {proto.IKeyId|null} [keyId] SyncdSnapshot keyId */ /** - * Constructs a new Body. + * Constructs a new SyncdSnapshot. * @memberof proto - * @classdesc Represents a Body. - * @implements IBody + * @classdesc Represents a SyncdSnapshot. + * @implements ISyncdSnapshot * @constructor - * @param {proto.IBody=} [properties] Properties to set + * @param {proto.ISyncdSnapshot=} [properties] Properties to set */ - function Body(properties) { + function SyncdSnapshot(properties) { + this.records = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -41048,75 +40812,117 @@ $root.proto = (function() { } /** - * Body text. - * @member {string} text - * @memberof proto.Body + * SyncdSnapshot version. + * @member {proto.ISyncdVersion|null|undefined} version + * @memberof proto.SyncdSnapshot + * @instance + */ + SyncdSnapshot.prototype.version = null; + + /** + * SyncdSnapshot records. + * @member {Array.} records + * @memberof proto.SyncdSnapshot + * @instance + */ + SyncdSnapshot.prototype.records = $util.emptyArray; + + /** + * SyncdSnapshot mac. + * @member {Uint8Array} mac + * @memberof proto.SyncdSnapshot + * @instance + */ + SyncdSnapshot.prototype.mac = $util.newBuffer([]); + + /** + * SyncdSnapshot keyId. + * @member {proto.IKeyId|null|undefined} keyId + * @memberof proto.SyncdSnapshot * @instance */ - Body.prototype.text = ""; + SyncdSnapshot.prototype.keyId = null; /** - * Creates a new Body instance using the specified properties. + * Creates a new SyncdSnapshot instance using the specified properties. * @function create - * @memberof proto.Body + * @memberof proto.SyncdSnapshot * @static - * @param {proto.IBody=} [properties] Properties to set - * @returns {proto.Body} Body instance + * @param {proto.ISyncdSnapshot=} [properties] Properties to set + * @returns {proto.SyncdSnapshot} SyncdSnapshot instance */ - Body.create = function create(properties) { - return new Body(properties); + SyncdSnapshot.create = function create(properties) { + return new SyncdSnapshot(properties); }; /** - * Encodes the specified Body message. Does not implicitly {@link proto.Body.verify|verify} messages. + * Encodes the specified SyncdSnapshot message. Does not implicitly {@link proto.SyncdSnapshot.verify|verify} messages. * @function encode - * @memberof proto.Body + * @memberof proto.SyncdSnapshot * @static - * @param {proto.IBody} message Body message or plain object to encode + * @param {proto.ISyncdSnapshot} message SyncdSnapshot message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Body.encode = function encode(message, writer) { + SyncdSnapshot.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.text != null && Object.hasOwnProperty.call(message, "text")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.text); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + $root.proto.SyncdVersion.encode(message.version, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.records != null && message.records.length) + for (var i = 0; i < message.records.length; ++i) + $root.proto.SyncdRecord.encode(message.records[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.mac != null && Object.hasOwnProperty.call(message, "mac")) + writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.mac); + if (message.keyId != null && Object.hasOwnProperty.call(message, "keyId")) + $root.proto.KeyId.encode(message.keyId, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); return writer; }; /** - * Encodes the specified Body message, length delimited. Does not implicitly {@link proto.Body.verify|verify} messages. + * Encodes the specified SyncdSnapshot message, length delimited. Does not implicitly {@link proto.SyncdSnapshot.verify|verify} messages. * @function encodeDelimited - * @memberof proto.Body + * @memberof proto.SyncdSnapshot * @static - * @param {proto.IBody} message Body message or plain object to encode + * @param {proto.ISyncdSnapshot} message SyncdSnapshot message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Body.encodeDelimited = function encodeDelimited(message, writer) { + SyncdSnapshot.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Body message from the specified reader or buffer. + * Decodes a SyncdSnapshot message from the specified reader or buffer. * @function decode - * @memberof proto.Body + * @memberof proto.SyncdSnapshot * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {proto.Body} Body + * @returns {proto.SyncdSnapshot} SyncdSnapshot * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Body.decode = function decode(reader, length) { + SyncdSnapshot.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.Body(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.SyncdSnapshot(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.text = reader.string(); + message.version = $root.proto.SyncdVersion.decode(reader, reader.uint32()); + break; + case 2: + if (!(message.records && message.records.length)) + message.records = []; + message.records.push($root.proto.SyncdRecord.decode(reader, reader.uint32())); + break; + case 3: + message.mac = reader.bytes(); + break; + case 4: + message.keyId = $root.proto.KeyId.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -41127,107 +40933,169 @@ $root.proto = (function() { }; /** - * Decodes a Body message from the specified reader or buffer, length delimited. + * Decodes a SyncdSnapshot message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof proto.Body + * @memberof proto.SyncdSnapshot * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.Body} Body + * @returns {proto.SyncdSnapshot} SyncdSnapshot * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Body.decodeDelimited = function decodeDelimited(reader) { + SyncdSnapshot.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Body message. + * Verifies a SyncdSnapshot message. * @function verify - * @memberof proto.Body + * @memberof proto.SyncdSnapshot * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Body.verify = function verify(message) { + SyncdSnapshot.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.text != null && message.hasOwnProperty("text")) - if (!$util.isString(message.text)) - return "text: string expected"; + if (message.version != null && message.hasOwnProperty("version")) { + var error = $root.proto.SyncdVersion.verify(message.version); + if (error) + return "version." + error; + } + if (message.records != null && message.hasOwnProperty("records")) { + if (!Array.isArray(message.records)) + return "records: array expected"; + for (var i = 0; i < message.records.length; ++i) { + var error = $root.proto.SyncdRecord.verify(message.records[i]); + if (error) + return "records." + error; + } + } + if (message.mac != null && message.hasOwnProperty("mac")) + if (!(message.mac && typeof message.mac.length === "number" || $util.isString(message.mac))) + return "mac: buffer expected"; + if (message.keyId != null && message.hasOwnProperty("keyId")) { + var error = $root.proto.KeyId.verify(message.keyId); + if (error) + return "keyId." + error; + } return null; }; /** - * Creates a Body message from a plain object. Also converts values to their respective internal types. + * Creates a SyncdSnapshot message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof proto.Body + * @memberof proto.SyncdSnapshot * @static * @param {Object.} object Plain object - * @returns {proto.Body} Body + * @returns {proto.SyncdSnapshot} SyncdSnapshot */ - Body.fromObject = function fromObject(object) { - if (object instanceof $root.proto.Body) + SyncdSnapshot.fromObject = function fromObject(object) { + if (object instanceof $root.proto.SyncdSnapshot) return object; - var message = new $root.proto.Body(); - if (object.text != null) - message.text = String(object.text); + var message = new $root.proto.SyncdSnapshot(); + if (object.version != null) { + if (typeof object.version !== "object") + throw TypeError(".proto.SyncdSnapshot.version: object expected"); + message.version = $root.proto.SyncdVersion.fromObject(object.version); + } + if (object.records) { + if (!Array.isArray(object.records)) + throw TypeError(".proto.SyncdSnapshot.records: array expected"); + message.records = []; + for (var i = 0; i < object.records.length; ++i) { + if (typeof object.records[i] !== "object") + throw TypeError(".proto.SyncdSnapshot.records: object expected"); + message.records[i] = $root.proto.SyncdRecord.fromObject(object.records[i]); + } + } + if (object.mac != null) + if (typeof object.mac === "string") + $util.base64.decode(object.mac, message.mac = $util.newBuffer($util.base64.length(object.mac)), 0); + else if (object.mac.length) + message.mac = object.mac; + if (object.keyId != null) { + if (typeof object.keyId !== "object") + throw TypeError(".proto.SyncdSnapshot.keyId: object expected"); + message.keyId = $root.proto.KeyId.fromObject(object.keyId); + } return message; }; /** - * Creates a plain object from a Body message. Also converts values to other types if specified. + * Creates a plain object from a SyncdSnapshot message. Also converts values to other types if specified. * @function toObject - * @memberof proto.Body + * @memberof proto.SyncdSnapshot * @static - * @param {proto.Body} message Body + * @param {proto.SyncdSnapshot} message SyncdSnapshot * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Body.toObject = function toObject(message, options) { + SyncdSnapshot.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) - object.text = ""; - if (message.text != null && message.hasOwnProperty("text")) - object.text = message.text; + if (options.arrays || options.defaults) + object.records = []; + if (options.defaults) { + object.version = null; + if (options.bytes === String) + object.mac = ""; + else { + object.mac = []; + if (options.bytes !== Array) + object.mac = $util.newBuffer(object.mac); + } + object.keyId = null; + } + if (message.version != null && message.hasOwnProperty("version")) + object.version = $root.proto.SyncdVersion.toObject(message.version, options); + if (message.records && message.records.length) { + object.records = []; + for (var j = 0; j < message.records.length; ++j) + object.records[j] = $root.proto.SyncdRecord.toObject(message.records[j], options); + } + if (message.mac != null && message.hasOwnProperty("mac")) + object.mac = options.bytes === String ? $util.base64.encode(message.mac, 0, message.mac.length) : options.bytes === Array ? Array.prototype.slice.call(message.mac) : message.mac; + if (message.keyId != null && message.hasOwnProperty("keyId")) + object.keyId = $root.proto.KeyId.toObject(message.keyId, options); return object; }; /** - * Converts this Body to JSON. + * Converts this SyncdSnapshot to JSON. * @function toJSON - * @memberof proto.Body + * @memberof proto.SyncdSnapshot * @instance * @returns {Object.} JSON object */ - Body.prototype.toJSON = function toJSON() { + SyncdSnapshot.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return Body; + return SyncdSnapshot; })(); - proto.Footer = (function() { + proto.SyncdValue = (function() { /** - * Properties of a Footer. + * Properties of a SyncdValue. * @memberof proto - * @interface IFooter - * @property {string|null} [text] Footer text + * @interface ISyncdValue + * @property {Uint8Array|null} [blob] SyncdValue blob */ /** - * Constructs a new Footer. + * Constructs a new SyncdValue. * @memberof proto - * @classdesc Represents a Footer. - * @implements IFooter + * @classdesc Represents a SyncdValue. + * @implements ISyncdValue * @constructor - * @param {proto.IFooter=} [properties] Properties to set + * @param {proto.ISyncdValue=} [properties] Properties to set */ - function Footer(properties) { + function SyncdValue(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -41235,75 +41103,75 @@ $root.proto = (function() { } /** - * Footer text. - * @member {string} text - * @memberof proto.Footer + * SyncdValue blob. + * @member {Uint8Array} blob + * @memberof proto.SyncdValue * @instance */ - Footer.prototype.text = ""; + SyncdValue.prototype.blob = $util.newBuffer([]); /** - * Creates a new Footer instance using the specified properties. + * Creates a new SyncdValue instance using the specified properties. * @function create - * @memberof proto.Footer + * @memberof proto.SyncdValue * @static - * @param {proto.IFooter=} [properties] Properties to set - * @returns {proto.Footer} Footer instance + * @param {proto.ISyncdValue=} [properties] Properties to set + * @returns {proto.SyncdValue} SyncdValue instance */ - Footer.create = function create(properties) { - return new Footer(properties); + SyncdValue.create = function create(properties) { + return new SyncdValue(properties); }; /** - * Encodes the specified Footer message. Does not implicitly {@link proto.Footer.verify|verify} messages. + * Encodes the specified SyncdValue message. Does not implicitly {@link proto.SyncdValue.verify|verify} messages. * @function encode - * @memberof proto.Footer + * @memberof proto.SyncdValue * @static - * @param {proto.IFooter} message Footer message or plain object to encode + * @param {proto.ISyncdValue} message SyncdValue message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Footer.encode = function encode(message, writer) { + SyncdValue.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.text != null && Object.hasOwnProperty.call(message, "text")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.text); + if (message.blob != null && Object.hasOwnProperty.call(message, "blob")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.blob); return writer; }; /** - * Encodes the specified Footer message, length delimited. Does not implicitly {@link proto.Footer.verify|verify} messages. + * Encodes the specified SyncdValue message, length delimited. Does not implicitly {@link proto.SyncdValue.verify|verify} messages. * @function encodeDelimited - * @memberof proto.Footer + * @memberof proto.SyncdValue * @static - * @param {proto.IFooter} message Footer message or plain object to encode + * @param {proto.ISyncdValue} message SyncdValue message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Footer.encodeDelimited = function encodeDelimited(message, writer) { + SyncdValue.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Footer message from the specified reader or buffer. + * Decodes a SyncdValue message from the specified reader or buffer. * @function decode - * @memberof proto.Footer + * @memberof proto.SyncdValue * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {proto.Footer} Footer + * @returns {proto.SyncdValue} SyncdValue * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Footer.decode = function decode(reader, length) { + SyncdValue.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.Footer(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.SyncdValue(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.text = reader.string(); + message.blob = reader.bytes(); break; default: reader.skipType(tag & 7); @@ -41314,109 +41182,116 @@ $root.proto = (function() { }; /** - * Decodes a Footer message from the specified reader or buffer, length delimited. + * Decodes a SyncdValue message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof proto.Footer + * @memberof proto.SyncdValue * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.Footer} Footer + * @returns {proto.SyncdValue} SyncdValue * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Footer.decodeDelimited = function decodeDelimited(reader) { + SyncdValue.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Footer message. + * Verifies a SyncdValue message. * @function verify - * @memberof proto.Footer + * @memberof proto.SyncdValue * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Footer.verify = function verify(message) { + SyncdValue.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.text != null && message.hasOwnProperty("text")) - if (!$util.isString(message.text)) - return "text: string expected"; + if (message.blob != null && message.hasOwnProperty("blob")) + if (!(message.blob && typeof message.blob.length === "number" || $util.isString(message.blob))) + return "blob: buffer expected"; return null; }; /** - * Creates a Footer message from a plain object. Also converts values to their respective internal types. + * Creates a SyncdValue message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof proto.Footer + * @memberof proto.SyncdValue * @static * @param {Object.} object Plain object - * @returns {proto.Footer} Footer + * @returns {proto.SyncdValue} SyncdValue */ - Footer.fromObject = function fromObject(object) { - if (object instanceof $root.proto.Footer) + SyncdValue.fromObject = function fromObject(object) { + if (object instanceof $root.proto.SyncdValue) return object; - var message = new $root.proto.Footer(); - if (object.text != null) - message.text = String(object.text); + var message = new $root.proto.SyncdValue(); + if (object.blob != null) + if (typeof object.blob === "string") + $util.base64.decode(object.blob, message.blob = $util.newBuffer($util.base64.length(object.blob)), 0); + else if (object.blob.length) + message.blob = object.blob; return message; }; /** - * Creates a plain object from a Footer message. Also converts values to other types if specified. + * Creates a plain object from a SyncdValue message. Also converts values to other types if specified. * @function toObject - * @memberof proto.Footer + * @memberof proto.SyncdValue * @static - * @param {proto.Footer} message Footer + * @param {proto.SyncdValue} message SyncdValue * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Footer.toObject = function toObject(message, options) { + SyncdValue.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) - object.text = ""; - if (message.text != null && message.hasOwnProperty("text")) - object.text = message.text; + if (options.bytes === String) + object.blob = ""; + else { + object.blob = []; + if (options.bytes !== Array) + object.blob = $util.newBuffer(object.blob); + } + if (message.blob != null && message.hasOwnProperty("blob")) + object.blob = options.bytes === String ? $util.base64.encode(message.blob, 0, message.blob.length) : options.bytes === Array ? Array.prototype.slice.call(message.blob) : message.blob; return object; }; /** - * Converts this Footer to JSON. + * Converts this SyncdValue to JSON. * @function toJSON - * @memberof proto.Footer + * @memberof proto.SyncdValue * @instance * @returns {Object.} JSON object */ - Footer.prototype.toJSON = function toJSON() { + SyncdValue.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return Footer; + return SyncdValue; })(); - proto.ShopMessage = (function() { + proto.SyncdVersion = (function() { /** - * Properties of a ShopMessage. + * Properties of a SyncdVersion. * @memberof proto - * @interface IShopMessage - * @property {string|null} [id] ShopMessage id - * @property {proto.ShopMessage.ShopMessageSurface|null} [surface] ShopMessage surface - * @property {number|null} [messageVersion] ShopMessage messageVersion + * @interface ISyncdVersion + * @property {number|Long|null} [version] SyncdVersion version */ /** - * Constructs a new ShopMessage. + * Constructs a new SyncdVersion. * @memberof proto - * @classdesc Represents a ShopMessage. - * @implements IShopMessage + * @classdesc Represents a SyncdVersion. + * @implements ISyncdVersion * @constructor - * @param {proto.IShopMessage=} [properties] Properties to set + * @param {proto.ISyncdVersion=} [properties] Properties to set */ - function ShopMessage(properties) { + function SyncdVersion(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -41424,101 +41299,75 @@ $root.proto = (function() { } /** - * ShopMessage id. - * @member {string} id - * @memberof proto.ShopMessage - * @instance - */ - ShopMessage.prototype.id = ""; - - /** - * ShopMessage surface. - * @member {proto.ShopMessage.ShopMessageSurface} surface - * @memberof proto.ShopMessage - * @instance - */ - ShopMessage.prototype.surface = 0; - - /** - * ShopMessage messageVersion. - * @member {number} messageVersion - * @memberof proto.ShopMessage + * SyncdVersion version. + * @member {number|Long} version + * @memberof proto.SyncdVersion * @instance */ - ShopMessage.prototype.messageVersion = 0; + SyncdVersion.prototype.version = $util.Long ? $util.Long.fromBits(0,0,true) : 0; /** - * Creates a new ShopMessage instance using the specified properties. + * Creates a new SyncdVersion instance using the specified properties. * @function create - * @memberof proto.ShopMessage + * @memberof proto.SyncdVersion * @static - * @param {proto.IShopMessage=} [properties] Properties to set - * @returns {proto.ShopMessage} ShopMessage instance + * @param {proto.ISyncdVersion=} [properties] Properties to set + * @returns {proto.SyncdVersion} SyncdVersion instance */ - ShopMessage.create = function create(properties) { - return new ShopMessage(properties); + SyncdVersion.create = function create(properties) { + return new SyncdVersion(properties); }; /** - * Encodes the specified ShopMessage message. Does not implicitly {@link proto.ShopMessage.verify|verify} messages. + * Encodes the specified SyncdVersion message. Does not implicitly {@link proto.SyncdVersion.verify|verify} messages. * @function encode - * @memberof proto.ShopMessage + * @memberof proto.SyncdVersion * @static - * @param {proto.IShopMessage} message ShopMessage message or plain object to encode + * @param {proto.ISyncdVersion} message SyncdVersion message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ShopMessage.encode = function encode(message, writer) { + SyncdVersion.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.id != null && Object.hasOwnProperty.call(message, "id")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.id); - if (message.surface != null && Object.hasOwnProperty.call(message, "surface")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.surface); - if (message.messageVersion != null && Object.hasOwnProperty.call(message, "messageVersion")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.messageVersion); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.version); return writer; }; /** - * Encodes the specified ShopMessage message, length delimited. Does not implicitly {@link proto.ShopMessage.verify|verify} messages. + * Encodes the specified SyncdVersion message, length delimited. Does not implicitly {@link proto.SyncdVersion.verify|verify} messages. * @function encodeDelimited - * @memberof proto.ShopMessage + * @memberof proto.SyncdVersion * @static - * @param {proto.IShopMessage} message ShopMessage message or plain object to encode + * @param {proto.ISyncdVersion} message SyncdVersion message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ShopMessage.encodeDelimited = function encodeDelimited(message, writer) { + SyncdVersion.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ShopMessage message from the specified reader or buffer. + * Decodes a SyncdVersion message from the specified reader or buffer. * @function decode - * @memberof proto.ShopMessage + * @memberof proto.SyncdVersion * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {proto.ShopMessage} ShopMessage + * @returns {proto.SyncdVersion} SyncdVersion * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ShopMessage.decode = function decode(reader, length) { + SyncdVersion.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.ShopMessage(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.SyncdVersion(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.id = reader.string(); - break; - case 2: - message.surface = reader.int32(); - break; - case 3: - message.messageVersion = reader.int32(); + message.version = reader.uint64(); break; default: reader.skipType(tag & 7); @@ -41529,167 +41378,121 @@ $root.proto = (function() { }; /** - * Decodes a ShopMessage message from the specified reader or buffer, length delimited. + * Decodes a SyncdVersion message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof proto.ShopMessage + * @memberof proto.SyncdVersion * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.ShopMessage} ShopMessage + * @returns {proto.SyncdVersion} SyncdVersion * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ShopMessage.decodeDelimited = function decodeDelimited(reader) { + SyncdVersion.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ShopMessage message. + * Verifies a SyncdVersion message. * @function verify - * @memberof proto.ShopMessage + * @memberof proto.SyncdVersion * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ShopMessage.verify = function verify(message) { + SyncdVersion.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.id != null && message.hasOwnProperty("id")) - if (!$util.isString(message.id)) - return "id: string expected"; - if (message.surface != null && message.hasOwnProperty("surface")) - switch (message.surface) { - default: - return "surface: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.messageVersion != null && message.hasOwnProperty("messageVersion")) - if (!$util.isInteger(message.messageVersion)) - return "messageVersion: integer expected"; + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isInteger(message.version) && !(message.version && $util.isInteger(message.version.low) && $util.isInteger(message.version.high))) + return "version: integer|Long expected"; return null; }; /** - * Creates a ShopMessage message from a plain object. Also converts values to their respective internal types. + * Creates a SyncdVersion message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof proto.ShopMessage + * @memberof proto.SyncdVersion * @static * @param {Object.} object Plain object - * @returns {proto.ShopMessage} ShopMessage + * @returns {proto.SyncdVersion} SyncdVersion */ - ShopMessage.fromObject = function fromObject(object) { - if (object instanceof $root.proto.ShopMessage) + SyncdVersion.fromObject = function fromObject(object) { + if (object instanceof $root.proto.SyncdVersion) return object; - var message = new $root.proto.ShopMessage(); - if (object.id != null) - message.id = String(object.id); - switch (object.surface) { - case "UNKNOWN_SURFACE": - case 0: - message.surface = 0; - break; - case "FB": - case 1: - message.surface = 1; - break; - case "IG": - case 2: - message.surface = 2; - break; - case "WA": - case 3: - message.surface = 3; - break; - } - if (object.messageVersion != null) - message.messageVersion = object.messageVersion | 0; - return message; - }; - - /** - * Creates a plain object from a ShopMessage message. Also converts values to other types if specified. + var message = new $root.proto.SyncdVersion(); + if (object.version != null) + if ($util.Long) + (message.version = $util.Long.fromValue(object.version)).unsigned = true; + else if (typeof object.version === "string") + message.version = parseInt(object.version, 10); + else if (typeof object.version === "number") + message.version = object.version; + else if (typeof object.version === "object") + message.version = new $util.LongBits(object.version.low >>> 0, object.version.high >>> 0).toNumber(true); + return message; + }; + + /** + * Creates a plain object from a SyncdVersion message. Also converts values to other types if specified. * @function toObject - * @memberof proto.ShopMessage + * @memberof proto.SyncdVersion * @static - * @param {proto.ShopMessage} message ShopMessage + * @param {proto.SyncdVersion} message SyncdVersion * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ShopMessage.toObject = function toObject(message, options) { + SyncdVersion.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.id = ""; - object.surface = options.enums === String ? "UNKNOWN_SURFACE" : 0; - object.messageVersion = 0; - } - if (message.id != null && message.hasOwnProperty("id")) - object.id = message.id; - if (message.surface != null && message.hasOwnProperty("surface")) - object.surface = options.enums === String ? $root.proto.ShopMessage.ShopMessageSurface[message.surface] : message.surface; - if (message.messageVersion != null && message.hasOwnProperty("messageVersion")) - object.messageVersion = message.messageVersion; + if (options.defaults) + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.version = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.version = options.longs === String ? "0" : 0; + if (message.version != null && message.hasOwnProperty("version")) + if (typeof message.version === "number") + object.version = options.longs === String ? String(message.version) : message.version; + else + object.version = options.longs === String ? $util.Long.prototype.toString.call(message.version) : options.longs === Number ? new $util.LongBits(message.version.low >>> 0, message.version.high >>> 0).toNumber(true) : message.version; return object; }; /** - * Converts this ShopMessage to JSON. + * Converts this SyncdVersion to JSON. * @function toJSON - * @memberof proto.ShopMessage + * @memberof proto.SyncdVersion * @instance * @returns {Object.} JSON object */ - ShopMessage.prototype.toJSON = function toJSON() { + SyncdVersion.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - /** - * ShopMessageSurface enum. - * @name proto.ShopMessage.ShopMessageSurface - * @enum {number} - * @property {number} UNKNOWN_SURFACE=0 UNKNOWN_SURFACE value - * @property {number} FB=1 FB value - * @property {number} IG=2 IG value - * @property {number} WA=3 WA value - */ - ShopMessage.ShopMessageSurface = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "UNKNOWN_SURFACE"] = 0; - values[valuesById[1] = "FB"] = 1; - values[valuesById[2] = "IG"] = 2; - values[valuesById[3] = "WA"] = 3; - return values; - })(); - - return ShopMessage; + return SyncdVersion; })(); - proto.CollectionMessage = (function() { + proto.AndroidUnsupportedActions = (function() { /** - * Properties of a CollectionMessage. + * Properties of an AndroidUnsupportedActions. * @memberof proto - * @interface ICollectionMessage - * @property {string|null} [bizJid] CollectionMessage bizJid - * @property {string|null} [id] CollectionMessage id - * @property {number|null} [messageVersion] CollectionMessage messageVersion + * @interface IAndroidUnsupportedActions + * @property {boolean|null} [allowed] AndroidUnsupportedActions allowed */ /** - * Constructs a new CollectionMessage. + * Constructs a new AndroidUnsupportedActions. * @memberof proto - * @classdesc Represents a CollectionMessage. - * @implements ICollectionMessage + * @classdesc Represents an AndroidUnsupportedActions. + * @implements IAndroidUnsupportedActions * @constructor - * @param {proto.ICollectionMessage=} [properties] Properties to set + * @param {proto.IAndroidUnsupportedActions=} [properties] Properties to set */ - function CollectionMessage(properties) { + function AndroidUnsupportedActions(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -41697,101 +41500,75 @@ $root.proto = (function() { } /** - * CollectionMessage bizJid. - * @member {string} bizJid - * @memberof proto.CollectionMessage - * @instance - */ - CollectionMessage.prototype.bizJid = ""; - - /** - * CollectionMessage id. - * @member {string} id - * @memberof proto.CollectionMessage - * @instance - */ - CollectionMessage.prototype.id = ""; - - /** - * CollectionMessage messageVersion. - * @member {number} messageVersion - * @memberof proto.CollectionMessage + * AndroidUnsupportedActions allowed. + * @member {boolean} allowed + * @memberof proto.AndroidUnsupportedActions * @instance */ - CollectionMessage.prototype.messageVersion = 0; + AndroidUnsupportedActions.prototype.allowed = false; /** - * Creates a new CollectionMessage instance using the specified properties. + * Creates a new AndroidUnsupportedActions instance using the specified properties. * @function create - * @memberof proto.CollectionMessage + * @memberof proto.AndroidUnsupportedActions * @static - * @param {proto.ICollectionMessage=} [properties] Properties to set - * @returns {proto.CollectionMessage} CollectionMessage instance + * @param {proto.IAndroidUnsupportedActions=} [properties] Properties to set + * @returns {proto.AndroidUnsupportedActions} AndroidUnsupportedActions instance */ - CollectionMessage.create = function create(properties) { - return new CollectionMessage(properties); + AndroidUnsupportedActions.create = function create(properties) { + return new AndroidUnsupportedActions(properties); }; /** - * Encodes the specified CollectionMessage message. Does not implicitly {@link proto.CollectionMessage.verify|verify} messages. + * Encodes the specified AndroidUnsupportedActions message. Does not implicitly {@link proto.AndroidUnsupportedActions.verify|verify} messages. * @function encode - * @memberof proto.CollectionMessage + * @memberof proto.AndroidUnsupportedActions * @static - * @param {proto.ICollectionMessage} message CollectionMessage message or plain object to encode + * @param {proto.IAndroidUnsupportedActions} message AndroidUnsupportedActions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CollectionMessage.encode = function encode(message, writer) { + AndroidUnsupportedActions.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.bizJid != null && Object.hasOwnProperty.call(message, "bizJid")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.bizJid); - if (message.id != null && Object.hasOwnProperty.call(message, "id")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.id); - if (message.messageVersion != null && Object.hasOwnProperty.call(message, "messageVersion")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.messageVersion); + if (message.allowed != null && Object.hasOwnProperty.call(message, "allowed")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.allowed); return writer; }; /** - * Encodes the specified CollectionMessage message, length delimited. Does not implicitly {@link proto.CollectionMessage.verify|verify} messages. + * Encodes the specified AndroidUnsupportedActions message, length delimited. Does not implicitly {@link proto.AndroidUnsupportedActions.verify|verify} messages. * @function encodeDelimited - * @memberof proto.CollectionMessage + * @memberof proto.AndroidUnsupportedActions * @static - * @param {proto.ICollectionMessage} message CollectionMessage message or plain object to encode + * @param {proto.IAndroidUnsupportedActions} message AndroidUnsupportedActions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CollectionMessage.encodeDelimited = function encodeDelimited(message, writer) { + AndroidUnsupportedActions.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a CollectionMessage message from the specified reader or buffer. + * Decodes an AndroidUnsupportedActions message from the specified reader or buffer. * @function decode - * @memberof proto.CollectionMessage + * @memberof proto.AndroidUnsupportedActions * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {proto.CollectionMessage} CollectionMessage + * @returns {proto.AndroidUnsupportedActions} AndroidUnsupportedActions * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CollectionMessage.decode = function decode(reader, length) { + AndroidUnsupportedActions.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.CollectionMessage(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.AndroidUnsupportedActions(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.bizJid = reader.string(); - break; - case 2: - message.id = reader.string(); - break; - case 3: - message.messageVersion = reader.int32(); + message.allowed = reader.bool(); break; default: reader.skipType(tag & 7); @@ -41802,125 +41579,108 @@ $root.proto = (function() { }; /** - * Decodes a CollectionMessage message from the specified reader or buffer, length delimited. + * Decodes an AndroidUnsupportedActions message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof proto.CollectionMessage + * @memberof proto.AndroidUnsupportedActions * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.CollectionMessage} CollectionMessage + * @returns {proto.AndroidUnsupportedActions} AndroidUnsupportedActions * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CollectionMessage.decodeDelimited = function decodeDelimited(reader) { + AndroidUnsupportedActions.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a CollectionMessage message. + * Verifies an AndroidUnsupportedActions message. * @function verify - * @memberof proto.CollectionMessage + * @memberof proto.AndroidUnsupportedActions * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - CollectionMessage.verify = function verify(message) { + AndroidUnsupportedActions.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.bizJid != null && message.hasOwnProperty("bizJid")) - if (!$util.isString(message.bizJid)) - return "bizJid: string expected"; - if (message.id != null && message.hasOwnProperty("id")) - if (!$util.isString(message.id)) - return "id: string expected"; - if (message.messageVersion != null && message.hasOwnProperty("messageVersion")) - if (!$util.isInteger(message.messageVersion)) - return "messageVersion: integer expected"; + if (message.allowed != null && message.hasOwnProperty("allowed")) + if (typeof message.allowed !== "boolean") + return "allowed: boolean expected"; return null; }; /** - * Creates a CollectionMessage message from a plain object. Also converts values to their respective internal types. + * Creates an AndroidUnsupportedActions message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof proto.CollectionMessage + * @memberof proto.AndroidUnsupportedActions * @static * @param {Object.} object Plain object - * @returns {proto.CollectionMessage} CollectionMessage + * @returns {proto.AndroidUnsupportedActions} AndroidUnsupportedActions */ - CollectionMessage.fromObject = function fromObject(object) { - if (object instanceof $root.proto.CollectionMessage) + AndroidUnsupportedActions.fromObject = function fromObject(object) { + if (object instanceof $root.proto.AndroidUnsupportedActions) return object; - var message = new $root.proto.CollectionMessage(); - if (object.bizJid != null) - message.bizJid = String(object.bizJid); - if (object.id != null) - message.id = String(object.id); - if (object.messageVersion != null) - message.messageVersion = object.messageVersion | 0; + var message = new $root.proto.AndroidUnsupportedActions(); + if (object.allowed != null) + message.allowed = Boolean(object.allowed); return message; }; /** - * Creates a plain object from a CollectionMessage message. Also converts values to other types if specified. + * Creates a plain object from an AndroidUnsupportedActions message. Also converts values to other types if specified. * @function toObject - * @memberof proto.CollectionMessage + * @memberof proto.AndroidUnsupportedActions * @static - * @param {proto.CollectionMessage} message CollectionMessage + * @param {proto.AndroidUnsupportedActions} message AndroidUnsupportedActions * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CollectionMessage.toObject = function toObject(message, options) { + AndroidUnsupportedActions.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.bizJid = ""; - object.id = ""; - object.messageVersion = 0; - } - if (message.bizJid != null && message.hasOwnProperty("bizJid")) - object.bizJid = message.bizJid; - if (message.id != null && message.hasOwnProperty("id")) - object.id = message.id; - if (message.messageVersion != null && message.hasOwnProperty("messageVersion")) - object.messageVersion = message.messageVersion; + if (options.defaults) + object.allowed = false; + if (message.allowed != null && message.hasOwnProperty("allowed")) + object.allowed = message.allowed; return object; }; /** - * Converts this CollectionMessage to JSON. + * Converts this AndroidUnsupportedActions to JSON. * @function toJSON - * @memberof proto.CollectionMessage + * @memberof proto.AndroidUnsupportedActions * @instance * @returns {Object.} JSON object */ - CollectionMessage.prototype.toJSON = function toJSON() { + AndroidUnsupportedActions.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return CollectionMessage; + return AndroidUnsupportedActions; })(); - proto.NativeFlowButton = (function() { + proto.ArchiveChatAction = (function() { /** - * Properties of a NativeFlowButton. + * Properties of an ArchiveChatAction. * @memberof proto - * @interface INativeFlowButton - * @property {string|null} [name] NativeFlowButton name - * @property {string|null} [buttonParamsJson] NativeFlowButton buttonParamsJson + * @interface IArchiveChatAction + * @property {boolean|null} [archived] ArchiveChatAction archived + * @property {proto.ISyncActionMessageRange|null} [messageRange] ArchiveChatAction messageRange */ /** - * Constructs a new NativeFlowButton. + * Constructs a new ArchiveChatAction. * @memberof proto - * @classdesc Represents a NativeFlowButton. - * @implements INativeFlowButton + * @classdesc Represents an ArchiveChatAction. + * @implements IArchiveChatAction * @constructor - * @param {proto.INativeFlowButton=} [properties] Properties to set + * @param {proto.IArchiveChatAction=} [properties] Properties to set */ - function NativeFlowButton(properties) { + function ArchiveChatAction(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -41928,88 +41688,88 @@ $root.proto = (function() { } /** - * NativeFlowButton name. - * @member {string} name - * @memberof proto.NativeFlowButton + * ArchiveChatAction archived. + * @member {boolean} archived + * @memberof proto.ArchiveChatAction * @instance */ - NativeFlowButton.prototype.name = ""; + ArchiveChatAction.prototype.archived = false; /** - * NativeFlowButton buttonParamsJson. - * @member {string} buttonParamsJson - * @memberof proto.NativeFlowButton + * ArchiveChatAction messageRange. + * @member {proto.ISyncActionMessageRange|null|undefined} messageRange + * @memberof proto.ArchiveChatAction * @instance */ - NativeFlowButton.prototype.buttonParamsJson = ""; + ArchiveChatAction.prototype.messageRange = null; /** - * Creates a new NativeFlowButton instance using the specified properties. + * Creates a new ArchiveChatAction instance using the specified properties. * @function create - * @memberof proto.NativeFlowButton + * @memberof proto.ArchiveChatAction * @static - * @param {proto.INativeFlowButton=} [properties] Properties to set - * @returns {proto.NativeFlowButton} NativeFlowButton instance + * @param {proto.IArchiveChatAction=} [properties] Properties to set + * @returns {proto.ArchiveChatAction} ArchiveChatAction instance */ - NativeFlowButton.create = function create(properties) { - return new NativeFlowButton(properties); + ArchiveChatAction.create = function create(properties) { + return new ArchiveChatAction(properties); }; /** - * Encodes the specified NativeFlowButton message. Does not implicitly {@link proto.NativeFlowButton.verify|verify} messages. + * Encodes the specified ArchiveChatAction message. Does not implicitly {@link proto.ArchiveChatAction.verify|verify} messages. * @function encode - * @memberof proto.NativeFlowButton + * @memberof proto.ArchiveChatAction * @static - * @param {proto.INativeFlowButton} message NativeFlowButton message or plain object to encode + * @param {proto.IArchiveChatAction} message ArchiveChatAction message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - NativeFlowButton.encode = function encode(message, writer) { + ArchiveChatAction.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.buttonParamsJson != null && Object.hasOwnProperty.call(message, "buttonParamsJson")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.buttonParamsJson); + if (message.archived != null && Object.hasOwnProperty.call(message, "archived")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.archived); + if (message.messageRange != null && Object.hasOwnProperty.call(message, "messageRange")) + $root.proto.SyncActionMessageRange.encode(message.messageRange, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** - * Encodes the specified NativeFlowButton message, length delimited. Does not implicitly {@link proto.NativeFlowButton.verify|verify} messages. + * Encodes the specified ArchiveChatAction message, length delimited. Does not implicitly {@link proto.ArchiveChatAction.verify|verify} messages. * @function encodeDelimited - * @memberof proto.NativeFlowButton + * @memberof proto.ArchiveChatAction * @static - * @param {proto.INativeFlowButton} message NativeFlowButton message or plain object to encode + * @param {proto.IArchiveChatAction} message ArchiveChatAction message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - NativeFlowButton.encodeDelimited = function encodeDelimited(message, writer) { + ArchiveChatAction.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a NativeFlowButton message from the specified reader or buffer. + * Decodes an ArchiveChatAction message from the specified reader or buffer. * @function decode - * @memberof proto.NativeFlowButton + * @memberof proto.ArchiveChatAction * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {proto.NativeFlowButton} NativeFlowButton + * @returns {proto.ArchiveChatAction} ArchiveChatAction * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - NativeFlowButton.decode = function decode(reader, length) { + ArchiveChatAction.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.NativeFlowButton(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.ArchiveChatAction(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.name = reader.string(); + message.archived = reader.bool(); break; case 2: - message.buttonParamsJson = reader.string(); + message.messageRange = $root.proto.SyncActionMessageRange.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -42020,119 +41780,121 @@ $root.proto = (function() { }; /** - * Decodes a NativeFlowButton message from the specified reader or buffer, length delimited. + * Decodes an ArchiveChatAction message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof proto.NativeFlowButton + * @memberof proto.ArchiveChatAction * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.NativeFlowButton} NativeFlowButton + * @returns {proto.ArchiveChatAction} ArchiveChatAction * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - NativeFlowButton.decodeDelimited = function decodeDelimited(reader) { + ArchiveChatAction.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a NativeFlowButton message. + * Verifies an ArchiveChatAction message. * @function verify - * @memberof proto.NativeFlowButton + * @memberof proto.ArchiveChatAction * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - NativeFlowButton.verify = function verify(message) { + ArchiveChatAction.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.buttonParamsJson != null && message.hasOwnProperty("buttonParamsJson")) - if (!$util.isString(message.buttonParamsJson)) - return "buttonParamsJson: string expected"; + if (message.archived != null && message.hasOwnProperty("archived")) + if (typeof message.archived !== "boolean") + return "archived: boolean expected"; + if (message.messageRange != null && message.hasOwnProperty("messageRange")) { + var error = $root.proto.SyncActionMessageRange.verify(message.messageRange); + if (error) + return "messageRange." + error; + } return null; }; /** - * Creates a NativeFlowButton message from a plain object. Also converts values to their respective internal types. + * Creates an ArchiveChatAction message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof proto.NativeFlowButton + * @memberof proto.ArchiveChatAction * @static * @param {Object.} object Plain object - * @returns {proto.NativeFlowButton} NativeFlowButton + * @returns {proto.ArchiveChatAction} ArchiveChatAction */ - NativeFlowButton.fromObject = function fromObject(object) { - if (object instanceof $root.proto.NativeFlowButton) + ArchiveChatAction.fromObject = function fromObject(object) { + if (object instanceof $root.proto.ArchiveChatAction) return object; - var message = new $root.proto.NativeFlowButton(); - if (object.name != null) - message.name = String(object.name); - if (object.buttonParamsJson != null) - message.buttonParamsJson = String(object.buttonParamsJson); + var message = new $root.proto.ArchiveChatAction(); + if (object.archived != null) + message.archived = Boolean(object.archived); + if (object.messageRange != null) { + if (typeof object.messageRange !== "object") + throw TypeError(".proto.ArchiveChatAction.messageRange: object expected"); + message.messageRange = $root.proto.SyncActionMessageRange.fromObject(object.messageRange); + } return message; }; /** - * Creates a plain object from a NativeFlowButton message. Also converts values to other types if specified. + * Creates a plain object from an ArchiveChatAction message. Also converts values to other types if specified. * @function toObject - * @memberof proto.NativeFlowButton + * @memberof proto.ArchiveChatAction * @static - * @param {proto.NativeFlowButton} message NativeFlowButton + * @param {proto.ArchiveChatAction} message ArchiveChatAction * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - NativeFlowButton.toObject = function toObject(message, options) { + ArchiveChatAction.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.name = ""; - object.buttonParamsJson = ""; + object.archived = false; + object.messageRange = null; } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.buttonParamsJson != null && message.hasOwnProperty("buttonParamsJson")) - object.buttonParamsJson = message.buttonParamsJson; + if (message.archived != null && message.hasOwnProperty("archived")) + object.archived = message.archived; + if (message.messageRange != null && message.hasOwnProperty("messageRange")) + object.messageRange = $root.proto.SyncActionMessageRange.toObject(message.messageRange, options); return object; }; /** - * Converts this NativeFlowButton to JSON. + * Converts this ArchiveChatAction to JSON. * @function toJSON - * @memberof proto.NativeFlowButton + * @memberof proto.ArchiveChatAction * @instance * @returns {Object.} JSON object */ - NativeFlowButton.prototype.toJSON = function toJSON() { + ArchiveChatAction.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return NativeFlowButton; + return ArchiveChatAction; })(); - proto.NativeFlowMessage = (function() { + proto.ClearChatAction = (function() { /** - * Properties of a NativeFlowMessage. + * Properties of a ClearChatAction. * @memberof proto - * @interface INativeFlowMessage - * @property {Array.|null} [buttons] NativeFlowMessage buttons - * @property {string|null} [messageParamsJson] NativeFlowMessage messageParamsJson - * @property {number|null} [messageVersion] NativeFlowMessage messageVersion + * @interface IClearChatAction + * @property {proto.ISyncActionMessageRange|null} [messageRange] ClearChatAction messageRange */ /** - * Constructs a new NativeFlowMessage. + * Constructs a new ClearChatAction. * @memberof proto - * @classdesc Represents a NativeFlowMessage. - * @implements INativeFlowMessage + * @classdesc Represents a ClearChatAction. + * @implements IClearChatAction * @constructor - * @param {proto.INativeFlowMessage=} [properties] Properties to set + * @param {proto.IClearChatAction=} [properties] Properties to set */ - function NativeFlowMessage(properties) { - this.buttons = []; + function ClearChatAction(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -42140,104 +41902,75 @@ $root.proto = (function() { } /** - * NativeFlowMessage buttons. - * @member {Array.} buttons - * @memberof proto.NativeFlowMessage - * @instance - */ - NativeFlowMessage.prototype.buttons = $util.emptyArray; - - /** - * NativeFlowMessage messageParamsJson. - * @member {string} messageParamsJson - * @memberof proto.NativeFlowMessage - * @instance - */ - NativeFlowMessage.prototype.messageParamsJson = ""; - - /** - * NativeFlowMessage messageVersion. - * @member {number} messageVersion - * @memberof proto.NativeFlowMessage + * ClearChatAction messageRange. + * @member {proto.ISyncActionMessageRange|null|undefined} messageRange + * @memberof proto.ClearChatAction * @instance */ - NativeFlowMessage.prototype.messageVersion = 0; + ClearChatAction.prototype.messageRange = null; /** - * Creates a new NativeFlowMessage instance using the specified properties. + * Creates a new ClearChatAction instance using the specified properties. * @function create - * @memberof proto.NativeFlowMessage + * @memberof proto.ClearChatAction * @static - * @param {proto.INativeFlowMessage=} [properties] Properties to set - * @returns {proto.NativeFlowMessage} NativeFlowMessage instance + * @param {proto.IClearChatAction=} [properties] Properties to set + * @returns {proto.ClearChatAction} ClearChatAction instance */ - NativeFlowMessage.create = function create(properties) { - return new NativeFlowMessage(properties); + ClearChatAction.create = function create(properties) { + return new ClearChatAction(properties); }; /** - * Encodes the specified NativeFlowMessage message. Does not implicitly {@link proto.NativeFlowMessage.verify|verify} messages. + * Encodes the specified ClearChatAction message. Does not implicitly {@link proto.ClearChatAction.verify|verify} messages. * @function encode - * @memberof proto.NativeFlowMessage + * @memberof proto.ClearChatAction * @static - * @param {proto.INativeFlowMessage} message NativeFlowMessage message or plain object to encode + * @param {proto.IClearChatAction} message ClearChatAction message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - NativeFlowMessage.encode = function encode(message, writer) { + ClearChatAction.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.buttons != null && message.buttons.length) - for (var i = 0; i < message.buttons.length; ++i) - $root.proto.NativeFlowButton.encode(message.buttons[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.messageParamsJson != null && Object.hasOwnProperty.call(message, "messageParamsJson")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.messageParamsJson); - if (message.messageVersion != null && Object.hasOwnProperty.call(message, "messageVersion")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.messageVersion); + if (message.messageRange != null && Object.hasOwnProperty.call(message, "messageRange")) + $root.proto.SyncActionMessageRange.encode(message.messageRange, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; /** - * Encodes the specified NativeFlowMessage message, length delimited. Does not implicitly {@link proto.NativeFlowMessage.verify|verify} messages. + * Encodes the specified ClearChatAction message, length delimited. Does not implicitly {@link proto.ClearChatAction.verify|verify} messages. * @function encodeDelimited - * @memberof proto.NativeFlowMessage + * @memberof proto.ClearChatAction * @static - * @param {proto.INativeFlowMessage} message NativeFlowMessage message or plain object to encode + * @param {proto.IClearChatAction} message ClearChatAction message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - NativeFlowMessage.encodeDelimited = function encodeDelimited(message, writer) { + ClearChatAction.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a NativeFlowMessage message from the specified reader or buffer. + * Decodes a ClearChatAction message from the specified reader or buffer. * @function decode - * @memberof proto.NativeFlowMessage + * @memberof proto.ClearChatAction * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {proto.NativeFlowMessage} NativeFlowMessage + * @returns {proto.ClearChatAction} ClearChatAction * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - NativeFlowMessage.decode = function decode(reader, length) { + ClearChatAction.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.NativeFlowMessage(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.ClearChatAction(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - if (!(message.buttons && message.buttons.length)) - message.buttons = []; - message.buttons.push($root.proto.NativeFlowButton.decode(reader, reader.uint32())); - break; - case 2: - message.messageParamsJson = reader.string(); - break; - case 3: - message.messageVersion = reader.int32(); + message.messageRange = $root.proto.SyncActionMessageRange.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -42248,148 +41981,113 @@ $root.proto = (function() { }; /** - * Decodes a NativeFlowMessage message from the specified reader or buffer, length delimited. + * Decodes a ClearChatAction message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof proto.NativeFlowMessage + * @memberof proto.ClearChatAction * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.NativeFlowMessage} NativeFlowMessage + * @returns {proto.ClearChatAction} ClearChatAction * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - NativeFlowMessage.decodeDelimited = function decodeDelimited(reader) { + ClearChatAction.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a NativeFlowMessage message. + * Verifies a ClearChatAction message. * @function verify - * @memberof proto.NativeFlowMessage + * @memberof proto.ClearChatAction * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - NativeFlowMessage.verify = function verify(message) { + ClearChatAction.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.buttons != null && message.hasOwnProperty("buttons")) { - if (!Array.isArray(message.buttons)) - return "buttons: array expected"; - for (var i = 0; i < message.buttons.length; ++i) { - var error = $root.proto.NativeFlowButton.verify(message.buttons[i]); - if (error) - return "buttons." + error; - } + if (message.messageRange != null && message.hasOwnProperty("messageRange")) { + var error = $root.proto.SyncActionMessageRange.verify(message.messageRange); + if (error) + return "messageRange." + error; } - if (message.messageParamsJson != null && message.hasOwnProperty("messageParamsJson")) - if (!$util.isString(message.messageParamsJson)) - return "messageParamsJson: string expected"; - if (message.messageVersion != null && message.hasOwnProperty("messageVersion")) - if (!$util.isInteger(message.messageVersion)) - return "messageVersion: integer expected"; return null; }; /** - * Creates a NativeFlowMessage message from a plain object. Also converts values to their respective internal types. + * Creates a ClearChatAction message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof proto.NativeFlowMessage + * @memberof proto.ClearChatAction * @static * @param {Object.} object Plain object - * @returns {proto.NativeFlowMessage} NativeFlowMessage + * @returns {proto.ClearChatAction} ClearChatAction */ - NativeFlowMessage.fromObject = function fromObject(object) { - if (object instanceof $root.proto.NativeFlowMessage) + ClearChatAction.fromObject = function fromObject(object) { + if (object instanceof $root.proto.ClearChatAction) return object; - var message = new $root.proto.NativeFlowMessage(); - if (object.buttons) { - if (!Array.isArray(object.buttons)) - throw TypeError(".proto.NativeFlowMessage.buttons: array expected"); - message.buttons = []; - for (var i = 0; i < object.buttons.length; ++i) { - if (typeof object.buttons[i] !== "object") - throw TypeError(".proto.NativeFlowMessage.buttons: object expected"); - message.buttons[i] = $root.proto.NativeFlowButton.fromObject(object.buttons[i]); - } + var message = new $root.proto.ClearChatAction(); + if (object.messageRange != null) { + if (typeof object.messageRange !== "object") + throw TypeError(".proto.ClearChatAction.messageRange: object expected"); + message.messageRange = $root.proto.SyncActionMessageRange.fromObject(object.messageRange); } - if (object.messageParamsJson != null) - message.messageParamsJson = String(object.messageParamsJson); - if (object.messageVersion != null) - message.messageVersion = object.messageVersion | 0; return message; }; /** - * Creates a plain object from a NativeFlowMessage message. Also converts values to other types if specified. + * Creates a plain object from a ClearChatAction message. Also converts values to other types if specified. * @function toObject - * @memberof proto.NativeFlowMessage + * @memberof proto.ClearChatAction * @static - * @param {proto.NativeFlowMessage} message NativeFlowMessage + * @param {proto.ClearChatAction} message ClearChatAction * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - NativeFlowMessage.toObject = function toObject(message, options) { + ClearChatAction.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.buttons = []; - if (options.defaults) { - object.messageParamsJson = ""; - object.messageVersion = 0; - } - if (message.buttons && message.buttons.length) { - object.buttons = []; - for (var j = 0; j < message.buttons.length; ++j) - object.buttons[j] = $root.proto.NativeFlowButton.toObject(message.buttons[j], options); - } - if (message.messageParamsJson != null && message.hasOwnProperty("messageParamsJson")) - object.messageParamsJson = message.messageParamsJson; - if (message.messageVersion != null && message.hasOwnProperty("messageVersion")) - object.messageVersion = message.messageVersion; + if (options.defaults) + object.messageRange = null; + if (message.messageRange != null && message.hasOwnProperty("messageRange")) + object.messageRange = $root.proto.SyncActionMessageRange.toObject(message.messageRange, options); return object; }; /** - * Converts this NativeFlowMessage to JSON. + * Converts this ClearChatAction to JSON. * @function toJSON - * @memberof proto.NativeFlowMessage + * @memberof proto.ClearChatAction * @instance * @returns {Object.} JSON object */ - NativeFlowMessage.prototype.toJSON = function toJSON() { + ClearChatAction.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return NativeFlowMessage; + return ClearChatAction; })(); - proto.InteractiveMessage = (function() { + proto.ContactAction = (function() { /** - * Properties of an InteractiveMessage. + * Properties of a ContactAction. * @memberof proto - * @interface IInteractiveMessage - * @property {proto.IHeader|null} [header] InteractiveMessage header - * @property {proto.IBody|null} [body] InteractiveMessage body - * @property {proto.IFooter|null} [footer] InteractiveMessage footer - * @property {proto.IContextInfo|null} [contextInfo] InteractiveMessage contextInfo - * @property {proto.IShopMessage|null} [shopStorefrontMessage] InteractiveMessage shopStorefrontMessage - * @property {proto.ICollectionMessage|null} [collectionMessage] InteractiveMessage collectionMessage - * @property {proto.INativeFlowMessage|null} [nativeFlowMessage] InteractiveMessage nativeFlowMessage + * @interface IContactAction + * @property {string|null} [fullName] ContactAction fullName + * @property {string|null} [firstName] ContactAction firstName */ /** - * Constructs a new InteractiveMessage. + * Constructs a new ContactAction. * @memberof proto - * @classdesc Represents an InteractiveMessage. - * @implements IInteractiveMessage + * @classdesc Represents a ContactAction. + * @implements IContactAction * @constructor - * @param {proto.IInteractiveMessage=} [properties] Properties to set + * @param {proto.IContactAction=} [properties] Properties to set */ - function InteractiveMessage(properties) { + function ContactAction(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -42397,167 +42095,88 @@ $root.proto = (function() { } /** - * InteractiveMessage header. - * @member {proto.IHeader|null|undefined} header - * @memberof proto.InteractiveMessage - * @instance - */ - InteractiveMessage.prototype.header = null; - - /** - * InteractiveMessage body. - * @member {proto.IBody|null|undefined} body - * @memberof proto.InteractiveMessage - * @instance - */ - InteractiveMessage.prototype.body = null; - - /** - * InteractiveMessage footer. - * @member {proto.IFooter|null|undefined} footer - * @memberof proto.InteractiveMessage - * @instance - */ - InteractiveMessage.prototype.footer = null; - - /** - * InteractiveMessage contextInfo. - * @member {proto.IContextInfo|null|undefined} contextInfo - * @memberof proto.InteractiveMessage - * @instance - */ - InteractiveMessage.prototype.contextInfo = null; - - /** - * InteractiveMessage shopStorefrontMessage. - * @member {proto.IShopMessage|null|undefined} shopStorefrontMessage - * @memberof proto.InteractiveMessage - * @instance - */ - InteractiveMessage.prototype.shopStorefrontMessage = null; - - /** - * InteractiveMessage collectionMessage. - * @member {proto.ICollectionMessage|null|undefined} collectionMessage - * @memberof proto.InteractiveMessage - * @instance - */ - InteractiveMessage.prototype.collectionMessage = null; - - /** - * InteractiveMessage nativeFlowMessage. - * @member {proto.INativeFlowMessage|null|undefined} nativeFlowMessage - * @memberof proto.InteractiveMessage + * ContactAction fullName. + * @member {string} fullName + * @memberof proto.ContactAction * @instance */ - InteractiveMessage.prototype.nativeFlowMessage = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + ContactAction.prototype.fullName = ""; /** - * InteractiveMessage interactiveMessage. - * @member {"shopStorefrontMessage"|"collectionMessage"|"nativeFlowMessage"|undefined} interactiveMessage - * @memberof proto.InteractiveMessage + * ContactAction firstName. + * @member {string} firstName + * @memberof proto.ContactAction * @instance */ - Object.defineProperty(InteractiveMessage.prototype, "interactiveMessage", { - get: $util.oneOfGetter($oneOfFields = ["shopStorefrontMessage", "collectionMessage", "nativeFlowMessage"]), - set: $util.oneOfSetter($oneOfFields) - }); + ContactAction.prototype.firstName = ""; /** - * Creates a new InteractiveMessage instance using the specified properties. + * Creates a new ContactAction instance using the specified properties. * @function create - * @memberof proto.InteractiveMessage + * @memberof proto.ContactAction * @static - * @param {proto.IInteractiveMessage=} [properties] Properties to set - * @returns {proto.InteractiveMessage} InteractiveMessage instance + * @param {proto.IContactAction=} [properties] Properties to set + * @returns {proto.ContactAction} ContactAction instance */ - InteractiveMessage.create = function create(properties) { - return new InteractiveMessage(properties); + ContactAction.create = function create(properties) { + return new ContactAction(properties); }; /** - * Encodes the specified InteractiveMessage message. Does not implicitly {@link proto.InteractiveMessage.verify|verify} messages. + * Encodes the specified ContactAction message. Does not implicitly {@link proto.ContactAction.verify|verify} messages. * @function encode - * @memberof proto.InteractiveMessage + * @memberof proto.ContactAction * @static - * @param {proto.IInteractiveMessage} message InteractiveMessage message or plain object to encode + * @param {proto.IContactAction} message ContactAction message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - InteractiveMessage.encode = function encode(message, writer) { + ContactAction.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.header != null && Object.hasOwnProperty.call(message, "header")) - $root.proto.Header.encode(message.header, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.body != null && Object.hasOwnProperty.call(message, "body")) - $root.proto.Body.encode(message.body, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.footer != null && Object.hasOwnProperty.call(message, "footer")) - $root.proto.Footer.encode(message.footer, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.shopStorefrontMessage != null && Object.hasOwnProperty.call(message, "shopStorefrontMessage")) - $root.proto.ShopMessage.encode(message.shopStorefrontMessage, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.collectionMessage != null && Object.hasOwnProperty.call(message, "collectionMessage")) - $root.proto.CollectionMessage.encode(message.collectionMessage, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.nativeFlowMessage != null && Object.hasOwnProperty.call(message, "nativeFlowMessage")) - $root.proto.NativeFlowMessage.encode(message.nativeFlowMessage, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.contextInfo != null && Object.hasOwnProperty.call(message, "contextInfo")) - $root.proto.ContextInfo.encode(message.contextInfo, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); + if (message.fullName != null && Object.hasOwnProperty.call(message, "fullName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.fullName); + if (message.firstName != null && Object.hasOwnProperty.call(message, "firstName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.firstName); return writer; }; /** - * Encodes the specified InteractiveMessage message, length delimited. Does not implicitly {@link proto.InteractiveMessage.verify|verify} messages. + * Encodes the specified ContactAction message, length delimited. Does not implicitly {@link proto.ContactAction.verify|verify} messages. * @function encodeDelimited - * @memberof proto.InteractiveMessage + * @memberof proto.ContactAction * @static - * @param {proto.IInteractiveMessage} message InteractiveMessage message or plain object to encode + * @param {proto.IContactAction} message ContactAction message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - InteractiveMessage.encodeDelimited = function encodeDelimited(message, writer) { + ContactAction.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an InteractiveMessage message from the specified reader or buffer. + * Decodes a ContactAction message from the specified reader or buffer. * @function decode - * @memberof proto.InteractiveMessage + * @memberof proto.ContactAction * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {proto.InteractiveMessage} InteractiveMessage + * @returns {proto.ContactAction} ContactAction * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - InteractiveMessage.decode = function decode(reader, length) { + ContactAction.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.InteractiveMessage(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.ContactAction(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.header = $root.proto.Header.decode(reader, reader.uint32()); + message.fullName = reader.string(); break; case 2: - message.body = $root.proto.Body.decode(reader, reader.uint32()); - break; - case 3: - message.footer = $root.proto.Footer.decode(reader, reader.uint32()); - break; - case 15: - message.contextInfo = $root.proto.ContextInfo.decode(reader, reader.uint32()); - break; - case 4: - message.shopStorefrontMessage = $root.proto.ShopMessage.decode(reader, reader.uint32()); - break; - case 5: - message.collectionMessage = $root.proto.CollectionMessage.decode(reader, reader.uint32()); - break; - case 6: - message.nativeFlowMessage = $root.proto.NativeFlowMessage.decode(reader, reader.uint32()); + message.firstName = reader.string(); break; default: reader.skipType(tag & 7); @@ -42568,218 +42187,116 @@ $root.proto = (function() { }; /** - * Decodes an InteractiveMessage message from the specified reader or buffer, length delimited. + * Decodes a ContactAction message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof proto.InteractiveMessage + * @memberof proto.ContactAction * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.InteractiveMessage} InteractiveMessage + * @returns {proto.ContactAction} ContactAction * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - InteractiveMessage.decodeDelimited = function decodeDelimited(reader) { + ContactAction.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an InteractiveMessage message. + * Verifies a ContactAction message. * @function verify - * @memberof proto.InteractiveMessage + * @memberof proto.ContactAction * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - InteractiveMessage.verify = function verify(message) { + ContactAction.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - var properties = {}; - if (message.header != null && message.hasOwnProperty("header")) { - var error = $root.proto.Header.verify(message.header); - if (error) - return "header." + error; - } - if (message.body != null && message.hasOwnProperty("body")) { - var error = $root.proto.Body.verify(message.body); - if (error) - return "body." + error; - } - if (message.footer != null && message.hasOwnProperty("footer")) { - var error = $root.proto.Footer.verify(message.footer); - if (error) - return "footer." + error; - } - if (message.contextInfo != null && message.hasOwnProperty("contextInfo")) { - var error = $root.proto.ContextInfo.verify(message.contextInfo); - if (error) - return "contextInfo." + error; - } - if (message.shopStorefrontMessage != null && message.hasOwnProperty("shopStorefrontMessage")) { - properties.interactiveMessage = 1; - { - var error = $root.proto.ShopMessage.verify(message.shopStorefrontMessage); - if (error) - return "shopStorefrontMessage." + error; - } - } - if (message.collectionMessage != null && message.hasOwnProperty("collectionMessage")) { - if (properties.interactiveMessage === 1) - return "interactiveMessage: multiple values"; - properties.interactiveMessage = 1; - { - var error = $root.proto.CollectionMessage.verify(message.collectionMessage); - if (error) - return "collectionMessage." + error; - } - } - if (message.nativeFlowMessage != null && message.hasOwnProperty("nativeFlowMessage")) { - if (properties.interactiveMessage === 1) - return "interactiveMessage: multiple values"; - properties.interactiveMessage = 1; - { - var error = $root.proto.NativeFlowMessage.verify(message.nativeFlowMessage); - if (error) - return "nativeFlowMessage." + error; - } - } + if (message.fullName != null && message.hasOwnProperty("fullName")) + if (!$util.isString(message.fullName)) + return "fullName: string expected"; + if (message.firstName != null && message.hasOwnProperty("firstName")) + if (!$util.isString(message.firstName)) + return "firstName: string expected"; return null; }; /** - * Creates an InteractiveMessage message from a plain object. Also converts values to their respective internal types. + * Creates a ContactAction message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof proto.InteractiveMessage + * @memberof proto.ContactAction * @static * @param {Object.} object Plain object - * @returns {proto.InteractiveMessage} InteractiveMessage + * @returns {proto.ContactAction} ContactAction */ - InteractiveMessage.fromObject = function fromObject(object) { - if (object instanceof $root.proto.InteractiveMessage) + ContactAction.fromObject = function fromObject(object) { + if (object instanceof $root.proto.ContactAction) return object; - var message = new $root.proto.InteractiveMessage(); - if (object.header != null) { - if (typeof object.header !== "object") - throw TypeError(".proto.InteractiveMessage.header: object expected"); - message.header = $root.proto.Header.fromObject(object.header); - } - if (object.body != null) { - if (typeof object.body !== "object") - throw TypeError(".proto.InteractiveMessage.body: object expected"); - message.body = $root.proto.Body.fromObject(object.body); - } - if (object.footer != null) { - if (typeof object.footer !== "object") - throw TypeError(".proto.InteractiveMessage.footer: object expected"); - message.footer = $root.proto.Footer.fromObject(object.footer); - } - if (object.contextInfo != null) { - if (typeof object.contextInfo !== "object") - throw TypeError(".proto.InteractiveMessage.contextInfo: object expected"); - message.contextInfo = $root.proto.ContextInfo.fromObject(object.contextInfo); - } - if (object.shopStorefrontMessage != null) { - if (typeof object.shopStorefrontMessage !== "object") - throw TypeError(".proto.InteractiveMessage.shopStorefrontMessage: object expected"); - message.shopStorefrontMessage = $root.proto.ShopMessage.fromObject(object.shopStorefrontMessage); - } - if (object.collectionMessage != null) { - if (typeof object.collectionMessage !== "object") - throw TypeError(".proto.InteractiveMessage.collectionMessage: object expected"); - message.collectionMessage = $root.proto.CollectionMessage.fromObject(object.collectionMessage); - } - if (object.nativeFlowMessage != null) { - if (typeof object.nativeFlowMessage !== "object") - throw TypeError(".proto.InteractiveMessage.nativeFlowMessage: object expected"); - message.nativeFlowMessage = $root.proto.NativeFlowMessage.fromObject(object.nativeFlowMessage); - } + var message = new $root.proto.ContactAction(); + if (object.fullName != null) + message.fullName = String(object.fullName); + if (object.firstName != null) + message.firstName = String(object.firstName); return message; }; /** - * Creates a plain object from an InteractiveMessage message. Also converts values to other types if specified. + * Creates a plain object from a ContactAction message. Also converts values to other types if specified. * @function toObject - * @memberof proto.InteractiveMessage + * @memberof proto.ContactAction * @static - * @param {proto.InteractiveMessage} message InteractiveMessage + * @param {proto.ContactAction} message ContactAction * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - InteractiveMessage.toObject = function toObject(message, options) { + ContactAction.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.header = null; - object.body = null; - object.footer = null; - object.contextInfo = null; - } - if (message.header != null && message.hasOwnProperty("header")) - object.header = $root.proto.Header.toObject(message.header, options); - if (message.body != null && message.hasOwnProperty("body")) - object.body = $root.proto.Body.toObject(message.body, options); - if (message.footer != null && message.hasOwnProperty("footer")) - object.footer = $root.proto.Footer.toObject(message.footer, options); - if (message.shopStorefrontMessage != null && message.hasOwnProperty("shopStorefrontMessage")) { - object.shopStorefrontMessage = $root.proto.ShopMessage.toObject(message.shopStorefrontMessage, options); - if (options.oneofs) - object.interactiveMessage = "shopStorefrontMessage"; - } - if (message.collectionMessage != null && message.hasOwnProperty("collectionMessage")) { - object.collectionMessage = $root.proto.CollectionMessage.toObject(message.collectionMessage, options); - if (options.oneofs) - object.interactiveMessage = "collectionMessage"; - } - if (message.nativeFlowMessage != null && message.hasOwnProperty("nativeFlowMessage")) { - object.nativeFlowMessage = $root.proto.NativeFlowMessage.toObject(message.nativeFlowMessage, options); - if (options.oneofs) - object.interactiveMessage = "nativeFlowMessage"; + object.fullName = ""; + object.firstName = ""; } - if (message.contextInfo != null && message.hasOwnProperty("contextInfo")) - object.contextInfo = $root.proto.ContextInfo.toObject(message.contextInfo, options); + if (message.fullName != null && message.hasOwnProperty("fullName")) + object.fullName = message.fullName; + if (message.firstName != null && message.hasOwnProperty("firstName")) + object.firstName = message.firstName; return object; }; /** - * Converts this InteractiveMessage to JSON. + * Converts this ContactAction to JSON. * @function toJSON - * @memberof proto.InteractiveMessage + * @memberof proto.ContactAction * @instance * @returns {Object.} JSON object */ - InteractiveMessage.prototype.toJSON = function toJSON() { + ContactAction.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return InteractiveMessage; + return ContactAction; })(); - proto.GroupInviteMessage = (function() { + proto.DeleteChatAction = (function() { /** - * Properties of a GroupInviteMessage. + * Properties of a DeleteChatAction. * @memberof proto - * @interface IGroupInviteMessage - * @property {string|null} [groupJid] GroupInviteMessage groupJid - * @property {string|null} [inviteCode] GroupInviteMessage inviteCode - * @property {number|Long|null} [inviteExpiration] GroupInviteMessage inviteExpiration - * @property {string|null} [groupName] GroupInviteMessage groupName - * @property {Uint8Array|null} [jpegThumbnail] GroupInviteMessage jpegThumbnail - * @property {string|null} [caption] GroupInviteMessage caption - * @property {proto.IContextInfo|null} [contextInfo] GroupInviteMessage contextInfo - * @property {proto.GroupInviteMessage.GroupInviteMessageGroupType|null} [groupType] GroupInviteMessage groupType + * @interface IDeleteChatAction + * @property {proto.ISyncActionMessageRange|null} [messageRange] DeleteChatAction messageRange */ /** - * Constructs a new GroupInviteMessage. + * Constructs a new DeleteChatAction. * @memberof proto - * @classdesc Represents a GroupInviteMessage. - * @implements IGroupInviteMessage + * @classdesc Represents a DeleteChatAction. + * @implements IDeleteChatAction * @constructor - * @param {proto.IGroupInviteMessage=} [properties] Properties to set + * @param {proto.IDeleteChatAction=} [properties] Properties to set */ - function GroupInviteMessage(properties) { + function DeleteChatAction(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -42787,166 +42304,75 @@ $root.proto = (function() { } /** - * GroupInviteMessage groupJid. - * @member {string} groupJid - * @memberof proto.GroupInviteMessage + * DeleteChatAction messageRange. + * @member {proto.ISyncActionMessageRange|null|undefined} messageRange + * @memberof proto.DeleteChatAction * @instance */ - GroupInviteMessage.prototype.groupJid = ""; + DeleteChatAction.prototype.messageRange = null; /** - * GroupInviteMessage inviteCode. - * @member {string} inviteCode - * @memberof proto.GroupInviteMessage - * @instance + * Creates a new DeleteChatAction instance using the specified properties. + * @function create + * @memberof proto.DeleteChatAction + * @static + * @param {proto.IDeleteChatAction=} [properties] Properties to set + * @returns {proto.DeleteChatAction} DeleteChatAction instance */ - GroupInviteMessage.prototype.inviteCode = ""; + DeleteChatAction.create = function create(properties) { + return new DeleteChatAction(properties); + }; /** - * GroupInviteMessage inviteExpiration. - * @member {number|Long} inviteExpiration - * @memberof proto.GroupInviteMessage - * @instance + * Encodes the specified DeleteChatAction message. Does not implicitly {@link proto.DeleteChatAction.verify|verify} messages. + * @function encode + * @memberof proto.DeleteChatAction + * @static + * @param {proto.IDeleteChatAction} message DeleteChatAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - GroupInviteMessage.prototype.inviteExpiration = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + DeleteChatAction.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.messageRange != null && Object.hasOwnProperty.call(message, "messageRange")) + $root.proto.SyncActionMessageRange.encode(message.messageRange, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; /** - * GroupInviteMessage groupName. - * @member {string} groupName - * @memberof proto.GroupInviteMessage - * @instance + * Encodes the specified DeleteChatAction message, length delimited. Does not implicitly {@link proto.DeleteChatAction.verify|verify} messages. + * @function encodeDelimited + * @memberof proto.DeleteChatAction + * @static + * @param {proto.IDeleteChatAction} message DeleteChatAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - GroupInviteMessage.prototype.groupName = ""; + DeleteChatAction.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; /** - * GroupInviteMessage jpegThumbnail. - * @member {Uint8Array} jpegThumbnail - * @memberof proto.GroupInviteMessage - * @instance - */ - GroupInviteMessage.prototype.jpegThumbnail = $util.newBuffer([]); - - /** - * GroupInviteMessage caption. - * @member {string} caption - * @memberof proto.GroupInviteMessage - * @instance - */ - GroupInviteMessage.prototype.caption = ""; - - /** - * GroupInviteMessage contextInfo. - * @member {proto.IContextInfo|null|undefined} contextInfo - * @memberof proto.GroupInviteMessage - * @instance - */ - GroupInviteMessage.prototype.contextInfo = null; - - /** - * GroupInviteMessage groupType. - * @member {proto.GroupInviteMessage.GroupInviteMessageGroupType} groupType - * @memberof proto.GroupInviteMessage - * @instance - */ - GroupInviteMessage.prototype.groupType = 0; - - /** - * Creates a new GroupInviteMessage instance using the specified properties. - * @function create - * @memberof proto.GroupInviteMessage - * @static - * @param {proto.IGroupInviteMessage=} [properties] Properties to set - * @returns {proto.GroupInviteMessage} GroupInviteMessage instance - */ - GroupInviteMessage.create = function create(properties) { - return new GroupInviteMessage(properties); - }; - - /** - * Encodes the specified GroupInviteMessage message. Does not implicitly {@link proto.GroupInviteMessage.verify|verify} messages. - * @function encode - * @memberof proto.GroupInviteMessage - * @static - * @param {proto.IGroupInviteMessage} message GroupInviteMessage message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GroupInviteMessage.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.groupJid != null && Object.hasOwnProperty.call(message, "groupJid")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.groupJid); - if (message.inviteCode != null && Object.hasOwnProperty.call(message, "inviteCode")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.inviteCode); - if (message.inviteExpiration != null && Object.hasOwnProperty.call(message, "inviteExpiration")) - writer.uint32(/* id 3, wireType 0 =*/24).int64(message.inviteExpiration); - if (message.groupName != null && Object.hasOwnProperty.call(message, "groupName")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.groupName); - if (message.jpegThumbnail != null && Object.hasOwnProperty.call(message, "jpegThumbnail")) - writer.uint32(/* id 5, wireType 2 =*/42).bytes(message.jpegThumbnail); - if (message.caption != null && Object.hasOwnProperty.call(message, "caption")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.caption); - if (message.contextInfo != null && Object.hasOwnProperty.call(message, "contextInfo")) - $root.proto.ContextInfo.encode(message.contextInfo, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.groupType != null && Object.hasOwnProperty.call(message, "groupType")) - writer.uint32(/* id 8, wireType 0 =*/64).int32(message.groupType); - return writer; - }; - - /** - * Encodes the specified GroupInviteMessage message, length delimited. Does not implicitly {@link proto.GroupInviteMessage.verify|verify} messages. - * @function encodeDelimited - * @memberof proto.GroupInviteMessage - * @static - * @param {proto.IGroupInviteMessage} message GroupInviteMessage message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GroupInviteMessage.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GroupInviteMessage message from the specified reader or buffer. + * Decodes a DeleteChatAction message from the specified reader or buffer. * @function decode - * @memberof proto.GroupInviteMessage + * @memberof proto.DeleteChatAction * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {proto.GroupInviteMessage} GroupInviteMessage + * @returns {proto.DeleteChatAction} DeleteChatAction * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GroupInviteMessage.decode = function decode(reader, length) { + DeleteChatAction.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.GroupInviteMessage(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.DeleteChatAction(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.groupJid = reader.string(); - break; - case 2: - message.inviteCode = reader.string(); - break; - case 3: - message.inviteExpiration = reader.int64(); - break; - case 4: - message.groupName = reader.string(); - break; - case 5: - message.jpegThumbnail = reader.bytes(); - break; - case 6: - message.caption = reader.string(); - break; - case 7: - message.contextInfo = $root.proto.ContextInfo.decode(reader, reader.uint32()); - break; - case 8: - message.groupType = reader.int32(); + message.messageRange = $root.proto.SyncActionMessageRange.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -42957,221 +42383,113 @@ $root.proto = (function() { }; /** - * Decodes a GroupInviteMessage message from the specified reader or buffer, length delimited. + * Decodes a DeleteChatAction message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof proto.GroupInviteMessage + * @memberof proto.DeleteChatAction * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.GroupInviteMessage} GroupInviteMessage + * @returns {proto.DeleteChatAction} DeleteChatAction * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GroupInviteMessage.decodeDelimited = function decodeDelimited(reader) { + DeleteChatAction.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GroupInviteMessage message. + * Verifies a DeleteChatAction message. * @function verify - * @memberof proto.GroupInviteMessage + * @memberof proto.DeleteChatAction * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GroupInviteMessage.verify = function verify(message) { + DeleteChatAction.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.groupJid != null && message.hasOwnProperty("groupJid")) - if (!$util.isString(message.groupJid)) - return "groupJid: string expected"; - if (message.inviteCode != null && message.hasOwnProperty("inviteCode")) - if (!$util.isString(message.inviteCode)) - return "inviteCode: string expected"; - if (message.inviteExpiration != null && message.hasOwnProperty("inviteExpiration")) - if (!$util.isInteger(message.inviteExpiration) && !(message.inviteExpiration && $util.isInteger(message.inviteExpiration.low) && $util.isInteger(message.inviteExpiration.high))) - return "inviteExpiration: integer|Long expected"; - if (message.groupName != null && message.hasOwnProperty("groupName")) - if (!$util.isString(message.groupName)) - return "groupName: string expected"; - if (message.jpegThumbnail != null && message.hasOwnProperty("jpegThumbnail")) - if (!(message.jpegThumbnail && typeof message.jpegThumbnail.length === "number" || $util.isString(message.jpegThumbnail))) - return "jpegThumbnail: buffer expected"; - if (message.caption != null && message.hasOwnProperty("caption")) - if (!$util.isString(message.caption)) - return "caption: string expected"; - if (message.contextInfo != null && message.hasOwnProperty("contextInfo")) { - var error = $root.proto.ContextInfo.verify(message.contextInfo); + if (message.messageRange != null && message.hasOwnProperty("messageRange")) { + var error = $root.proto.SyncActionMessageRange.verify(message.messageRange); if (error) - return "contextInfo." + error; + return "messageRange." + error; } - if (message.groupType != null && message.hasOwnProperty("groupType")) - switch (message.groupType) { - default: - return "groupType: enum value expected"; - case 0: - case 1: - break; - } return null; }; /** - * Creates a GroupInviteMessage message from a plain object. Also converts values to their respective internal types. + * Creates a DeleteChatAction message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof proto.GroupInviteMessage + * @memberof proto.DeleteChatAction * @static * @param {Object.} object Plain object - * @returns {proto.GroupInviteMessage} GroupInviteMessage + * @returns {proto.DeleteChatAction} DeleteChatAction */ - GroupInviteMessage.fromObject = function fromObject(object) { - if (object instanceof $root.proto.GroupInviteMessage) + DeleteChatAction.fromObject = function fromObject(object) { + if (object instanceof $root.proto.DeleteChatAction) return object; - var message = new $root.proto.GroupInviteMessage(); - if (object.groupJid != null) - message.groupJid = String(object.groupJid); - if (object.inviteCode != null) - message.inviteCode = String(object.inviteCode); - if (object.inviteExpiration != null) - if ($util.Long) - (message.inviteExpiration = $util.Long.fromValue(object.inviteExpiration)).unsigned = false; - else if (typeof object.inviteExpiration === "string") - message.inviteExpiration = parseInt(object.inviteExpiration, 10); - else if (typeof object.inviteExpiration === "number") - message.inviteExpiration = object.inviteExpiration; - else if (typeof object.inviteExpiration === "object") - message.inviteExpiration = new $util.LongBits(object.inviteExpiration.low >>> 0, object.inviteExpiration.high >>> 0).toNumber(); - if (object.groupName != null) - message.groupName = String(object.groupName); - if (object.jpegThumbnail != null) - if (typeof object.jpegThumbnail === "string") - $util.base64.decode(object.jpegThumbnail, message.jpegThumbnail = $util.newBuffer($util.base64.length(object.jpegThumbnail)), 0); - else if (object.jpegThumbnail.length) - message.jpegThumbnail = object.jpegThumbnail; - if (object.caption != null) - message.caption = String(object.caption); - if (object.contextInfo != null) { - if (typeof object.contextInfo !== "object") - throw TypeError(".proto.GroupInviteMessage.contextInfo: object expected"); - message.contextInfo = $root.proto.ContextInfo.fromObject(object.contextInfo); - } - switch (object.groupType) { - case "DEFAULT": - case 0: - message.groupType = 0; - break; - case "PARENT": - case 1: - message.groupType = 1; - break; + var message = new $root.proto.DeleteChatAction(); + if (object.messageRange != null) { + if (typeof object.messageRange !== "object") + throw TypeError(".proto.DeleteChatAction.messageRange: object expected"); + message.messageRange = $root.proto.SyncActionMessageRange.fromObject(object.messageRange); } return message; }; /** - * Creates a plain object from a GroupInviteMessage message. Also converts values to other types if specified. + * Creates a plain object from a DeleteChatAction message. Also converts values to other types if specified. * @function toObject - * @memberof proto.GroupInviteMessage + * @memberof proto.DeleteChatAction * @static - * @param {proto.GroupInviteMessage} message GroupInviteMessage + * @param {proto.DeleteChatAction} message DeleteChatAction * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GroupInviteMessage.toObject = function toObject(message, options) { + DeleteChatAction.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.groupJid = ""; - object.inviteCode = ""; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.inviteExpiration = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.inviteExpiration = options.longs === String ? "0" : 0; - object.groupName = ""; - if (options.bytes === String) - object.jpegThumbnail = ""; - else { - object.jpegThumbnail = []; - if (options.bytes !== Array) - object.jpegThumbnail = $util.newBuffer(object.jpegThumbnail); - } - object.caption = ""; - object.contextInfo = null; - object.groupType = options.enums === String ? "DEFAULT" : 0; - } - if (message.groupJid != null && message.hasOwnProperty("groupJid")) - object.groupJid = message.groupJid; - if (message.inviteCode != null && message.hasOwnProperty("inviteCode")) - object.inviteCode = message.inviteCode; - if (message.inviteExpiration != null && message.hasOwnProperty("inviteExpiration")) - if (typeof message.inviteExpiration === "number") - object.inviteExpiration = options.longs === String ? String(message.inviteExpiration) : message.inviteExpiration; - else - object.inviteExpiration = options.longs === String ? $util.Long.prototype.toString.call(message.inviteExpiration) : options.longs === Number ? new $util.LongBits(message.inviteExpiration.low >>> 0, message.inviteExpiration.high >>> 0).toNumber() : message.inviteExpiration; - if (message.groupName != null && message.hasOwnProperty("groupName")) - object.groupName = message.groupName; - if (message.jpegThumbnail != null && message.hasOwnProperty("jpegThumbnail")) - object.jpegThumbnail = options.bytes === String ? $util.base64.encode(message.jpegThumbnail, 0, message.jpegThumbnail.length) : options.bytes === Array ? Array.prototype.slice.call(message.jpegThumbnail) : message.jpegThumbnail; - if (message.caption != null && message.hasOwnProperty("caption")) - object.caption = message.caption; - if (message.contextInfo != null && message.hasOwnProperty("contextInfo")) - object.contextInfo = $root.proto.ContextInfo.toObject(message.contextInfo, options); - if (message.groupType != null && message.hasOwnProperty("groupType")) - object.groupType = options.enums === String ? $root.proto.GroupInviteMessage.GroupInviteMessageGroupType[message.groupType] : message.groupType; + if (options.defaults) + object.messageRange = null; + if (message.messageRange != null && message.hasOwnProperty("messageRange")) + object.messageRange = $root.proto.SyncActionMessageRange.toObject(message.messageRange, options); return object; }; /** - * Converts this GroupInviteMessage to JSON. + * Converts this DeleteChatAction to JSON. * @function toJSON - * @memberof proto.GroupInviteMessage + * @memberof proto.DeleteChatAction * @instance * @returns {Object.} JSON object */ - GroupInviteMessage.prototype.toJSON = function toJSON() { + DeleteChatAction.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - /** - * GroupInviteMessageGroupType enum. - * @name proto.GroupInviteMessage.GroupInviteMessageGroupType - * @enum {number} - * @property {number} DEFAULT=0 DEFAULT value - * @property {number} PARENT=1 PARENT value - */ - GroupInviteMessage.GroupInviteMessageGroupType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "DEFAULT"] = 0; - values[valuesById[1] = "PARENT"] = 1; - return values; - })(); - - return GroupInviteMessage; + return DeleteChatAction; })(); - proto.DeviceSentMessage = (function() { + proto.DeleteMessageForMeAction = (function() { /** - * Properties of a DeviceSentMessage. + * Properties of a DeleteMessageForMeAction. * @memberof proto - * @interface IDeviceSentMessage - * @property {string|null} [destinationJid] DeviceSentMessage destinationJid - * @property {proto.IMessage|null} [message] DeviceSentMessage message - * @property {string|null} [phash] DeviceSentMessage phash + * @interface IDeleteMessageForMeAction + * @property {boolean|null} [deleteMedia] DeleteMessageForMeAction deleteMedia + * @property {number|Long|null} [messageTimestamp] DeleteMessageForMeAction messageTimestamp */ /** - * Constructs a new DeviceSentMessage. + * Constructs a new DeleteMessageForMeAction. * @memberof proto - * @classdesc Represents a DeviceSentMessage. - * @implements IDeviceSentMessage + * @classdesc Represents a DeleteMessageForMeAction. + * @implements IDeleteMessageForMeAction * @constructor - * @param {proto.IDeviceSentMessage=} [properties] Properties to set + * @param {proto.IDeleteMessageForMeAction=} [properties] Properties to set */ - function DeviceSentMessage(properties) { + function DeleteMessageForMeAction(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -43179,101 +42497,88 @@ $root.proto = (function() { } /** - * DeviceSentMessage destinationJid. - * @member {string} destinationJid - * @memberof proto.DeviceSentMessage - * @instance - */ - DeviceSentMessage.prototype.destinationJid = ""; - - /** - * DeviceSentMessage message. - * @member {proto.IMessage|null|undefined} message - * @memberof proto.DeviceSentMessage + * DeleteMessageForMeAction deleteMedia. + * @member {boolean} deleteMedia + * @memberof proto.DeleteMessageForMeAction * @instance */ - DeviceSentMessage.prototype.message = null; + DeleteMessageForMeAction.prototype.deleteMedia = false; /** - * DeviceSentMessage phash. - * @member {string} phash - * @memberof proto.DeviceSentMessage + * DeleteMessageForMeAction messageTimestamp. + * @member {number|Long} messageTimestamp + * @memberof proto.DeleteMessageForMeAction * @instance */ - DeviceSentMessage.prototype.phash = ""; + DeleteMessageForMeAction.prototype.messageTimestamp = $util.Long ? $util.Long.fromBits(0,0,false) : 0; /** - * Creates a new DeviceSentMessage instance using the specified properties. + * Creates a new DeleteMessageForMeAction instance using the specified properties. * @function create - * @memberof proto.DeviceSentMessage + * @memberof proto.DeleteMessageForMeAction * @static - * @param {proto.IDeviceSentMessage=} [properties] Properties to set - * @returns {proto.DeviceSentMessage} DeviceSentMessage instance + * @param {proto.IDeleteMessageForMeAction=} [properties] Properties to set + * @returns {proto.DeleteMessageForMeAction} DeleteMessageForMeAction instance */ - DeviceSentMessage.create = function create(properties) { - return new DeviceSentMessage(properties); + DeleteMessageForMeAction.create = function create(properties) { + return new DeleteMessageForMeAction(properties); }; /** - * Encodes the specified DeviceSentMessage message. Does not implicitly {@link proto.DeviceSentMessage.verify|verify} messages. + * Encodes the specified DeleteMessageForMeAction message. Does not implicitly {@link proto.DeleteMessageForMeAction.verify|verify} messages. * @function encode - * @memberof proto.DeviceSentMessage + * @memberof proto.DeleteMessageForMeAction * @static - * @param {proto.IDeviceSentMessage} message DeviceSentMessage message or plain object to encode + * @param {proto.IDeleteMessageForMeAction} message DeleteMessageForMeAction message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeviceSentMessage.encode = function encode(message, writer) { + DeleteMessageForMeAction.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.destinationJid != null && Object.hasOwnProperty.call(message, "destinationJid")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.destinationJid); - if (message.message != null && Object.hasOwnProperty.call(message, "message")) - $root.proto.Message.encode(message.message, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.phash != null && Object.hasOwnProperty.call(message, "phash")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.phash); + if (message.deleteMedia != null && Object.hasOwnProperty.call(message, "deleteMedia")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.deleteMedia); + if (message.messageTimestamp != null && Object.hasOwnProperty.call(message, "messageTimestamp")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.messageTimestamp); return writer; }; /** - * Encodes the specified DeviceSentMessage message, length delimited. Does not implicitly {@link proto.DeviceSentMessage.verify|verify} messages. + * Encodes the specified DeleteMessageForMeAction message, length delimited. Does not implicitly {@link proto.DeleteMessageForMeAction.verify|verify} messages. * @function encodeDelimited - * @memberof proto.DeviceSentMessage + * @memberof proto.DeleteMessageForMeAction * @static - * @param {proto.IDeviceSentMessage} message DeviceSentMessage message or plain object to encode + * @param {proto.IDeleteMessageForMeAction} message DeleteMessageForMeAction message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeviceSentMessage.encodeDelimited = function encodeDelimited(message, writer) { + DeleteMessageForMeAction.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a DeviceSentMessage message from the specified reader or buffer. + * Decodes a DeleteMessageForMeAction message from the specified reader or buffer. * @function decode - * @memberof proto.DeviceSentMessage + * @memberof proto.DeleteMessageForMeAction * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {proto.DeviceSentMessage} DeviceSentMessage + * @returns {proto.DeleteMessageForMeAction} DeleteMessageForMeAction * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DeviceSentMessage.decode = function decode(reader, length) { + DeleteMessageForMeAction.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.DeviceSentMessage(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.DeleteMessageForMeAction(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.destinationJid = reader.string(); + message.deleteMedia = reader.bool(); break; case 2: - message.message = $root.proto.Message.decode(reader, reader.uint32()); - break; - case 3: - message.phash = reader.string(); + message.messageTimestamp = reader.int64(); break; default: reader.skipType(tag & 7); @@ -43284,129 +42589,137 @@ $root.proto = (function() { }; /** - * Decodes a DeviceSentMessage message from the specified reader or buffer, length delimited. + * Decodes a DeleteMessageForMeAction message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof proto.DeviceSentMessage + * @memberof proto.DeleteMessageForMeAction * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.DeviceSentMessage} DeviceSentMessage + * @returns {proto.DeleteMessageForMeAction} DeleteMessageForMeAction * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DeviceSentMessage.decodeDelimited = function decodeDelimited(reader) { + DeleteMessageForMeAction.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a DeviceSentMessage message. + * Verifies a DeleteMessageForMeAction message. * @function verify - * @memberof proto.DeviceSentMessage + * @memberof proto.DeleteMessageForMeAction * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - DeviceSentMessage.verify = function verify(message) { + DeleteMessageForMeAction.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.destinationJid != null && message.hasOwnProperty("destinationJid")) - if (!$util.isString(message.destinationJid)) - return "destinationJid: string expected"; - if (message.message != null && message.hasOwnProperty("message")) { - var error = $root.proto.Message.verify(message.message); - if (error) - return "message." + error; - } - if (message.phash != null && message.hasOwnProperty("phash")) - if (!$util.isString(message.phash)) - return "phash: string expected"; + if (message.deleteMedia != null && message.hasOwnProperty("deleteMedia")) + if (typeof message.deleteMedia !== "boolean") + return "deleteMedia: boolean expected"; + if (message.messageTimestamp != null && message.hasOwnProperty("messageTimestamp")) + if (!$util.isInteger(message.messageTimestamp) && !(message.messageTimestamp && $util.isInteger(message.messageTimestamp.low) && $util.isInteger(message.messageTimestamp.high))) + return "messageTimestamp: integer|Long expected"; return null; }; /** - * Creates a DeviceSentMessage message from a plain object. Also converts values to their respective internal types. + * Creates a DeleteMessageForMeAction message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof proto.DeviceSentMessage + * @memberof proto.DeleteMessageForMeAction * @static * @param {Object.} object Plain object - * @returns {proto.DeviceSentMessage} DeviceSentMessage + * @returns {proto.DeleteMessageForMeAction} DeleteMessageForMeAction */ - DeviceSentMessage.fromObject = function fromObject(object) { - if (object instanceof $root.proto.DeviceSentMessage) + DeleteMessageForMeAction.fromObject = function fromObject(object) { + if (object instanceof $root.proto.DeleteMessageForMeAction) return object; - var message = new $root.proto.DeviceSentMessage(); - if (object.destinationJid != null) - message.destinationJid = String(object.destinationJid); - if (object.message != null) { - if (typeof object.message !== "object") - throw TypeError(".proto.DeviceSentMessage.message: object expected"); - message.message = $root.proto.Message.fromObject(object.message); - } - if (object.phash != null) - message.phash = String(object.phash); + var message = new $root.proto.DeleteMessageForMeAction(); + if (object.deleteMedia != null) + message.deleteMedia = Boolean(object.deleteMedia); + if (object.messageTimestamp != null) + if ($util.Long) + (message.messageTimestamp = $util.Long.fromValue(object.messageTimestamp)).unsigned = false; + else if (typeof object.messageTimestamp === "string") + message.messageTimestamp = parseInt(object.messageTimestamp, 10); + else if (typeof object.messageTimestamp === "number") + message.messageTimestamp = object.messageTimestamp; + else if (typeof object.messageTimestamp === "object") + message.messageTimestamp = new $util.LongBits(object.messageTimestamp.low >>> 0, object.messageTimestamp.high >>> 0).toNumber(); return message; }; /** - * Creates a plain object from a DeviceSentMessage message. Also converts values to other types if specified. + * Creates a plain object from a DeleteMessageForMeAction message. Also converts values to other types if specified. * @function toObject - * @memberof proto.DeviceSentMessage + * @memberof proto.DeleteMessageForMeAction * @static - * @param {proto.DeviceSentMessage} message DeviceSentMessage + * @param {proto.DeleteMessageForMeAction} message DeleteMessageForMeAction * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DeviceSentMessage.toObject = function toObject(message, options) { + DeleteMessageForMeAction.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.destinationJid = ""; - object.message = null; - object.phash = ""; + object.deleteMedia = false; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.messageTimestamp = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.messageTimestamp = options.longs === String ? "0" : 0; } - if (message.destinationJid != null && message.hasOwnProperty("destinationJid")) - object.destinationJid = message.destinationJid; - if (message.message != null && message.hasOwnProperty("message")) - object.message = $root.proto.Message.toObject(message.message, options); - if (message.phash != null && message.hasOwnProperty("phash")) - object.phash = message.phash; + if (message.deleteMedia != null && message.hasOwnProperty("deleteMedia")) + object.deleteMedia = message.deleteMedia; + if (message.messageTimestamp != null && message.hasOwnProperty("messageTimestamp")) + if (typeof message.messageTimestamp === "number") + object.messageTimestamp = options.longs === String ? String(message.messageTimestamp) : message.messageTimestamp; + else + object.messageTimestamp = options.longs === String ? $util.Long.prototype.toString.call(message.messageTimestamp) : options.longs === Number ? new $util.LongBits(message.messageTimestamp.low >>> 0, message.messageTimestamp.high >>> 0).toNumber() : message.messageTimestamp; return object; }; /** - * Converts this DeviceSentMessage to JSON. + * Converts this DeleteMessageForMeAction to JSON. * @function toJSON - * @memberof proto.DeviceSentMessage + * @memberof proto.DeleteMessageForMeAction * @instance * @returns {Object.} JSON object */ - DeviceSentMessage.prototype.toJSON = function toJSON() { + DeleteMessageForMeAction.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return DeviceSentMessage; + return DeleteMessageForMeAction; })(); - proto.FutureProofMessage = (function() { + proto.FavoriteStickerAction = (function() { /** - * Properties of a FutureProofMessage. + * Properties of a FavoriteStickerAction. * @memberof proto - * @interface IFutureProofMessage - * @property {proto.IMessage|null} [message] FutureProofMessage message + * @interface IFavoriteStickerAction + * @property {string|null} [directPath] FavoriteStickerAction directPath + * @property {string|null} [lastUploadTimestamp] FavoriteStickerAction lastUploadTimestamp + * @property {string|null} [handle] FavoriteStickerAction handle + * @property {string|null} [encFilehash] FavoriteStickerAction encFilehash + * @property {string|null} [stickerHashWithoutMeta] FavoriteStickerAction stickerHashWithoutMeta + * @property {string|null} [mediaKey] FavoriteStickerAction mediaKey + * @property {number|Long|null} [mediaKeyTimestamp] FavoriteStickerAction mediaKeyTimestamp + * @property {boolean|null} [isFavorite] FavoriteStickerAction isFavorite */ /** - * Constructs a new FutureProofMessage. + * Constructs a new FavoriteStickerAction. * @memberof proto - * @classdesc Represents a FutureProofMessage. - * @implements IFutureProofMessage + * @classdesc Represents a FavoriteStickerAction. + * @implements IFavoriteStickerAction * @constructor - * @param {proto.IFutureProofMessage=} [properties] Properties to set + * @param {proto.IFavoriteStickerAction=} [properties] Properties to set */ - function FutureProofMessage(properties) { + function FavoriteStickerAction(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -43414,75 +42727,166 @@ $root.proto = (function() { } /** - * FutureProofMessage message. - * @member {proto.IMessage|null|undefined} message - * @memberof proto.FutureProofMessage + * FavoriteStickerAction directPath. + * @member {string} directPath + * @memberof proto.FavoriteStickerAction * @instance */ - FutureProofMessage.prototype.message = null; + FavoriteStickerAction.prototype.directPath = ""; /** - * Creates a new FutureProofMessage instance using the specified properties. + * FavoriteStickerAction lastUploadTimestamp. + * @member {string} lastUploadTimestamp + * @memberof proto.FavoriteStickerAction + * @instance + */ + FavoriteStickerAction.prototype.lastUploadTimestamp = ""; + + /** + * FavoriteStickerAction handle. + * @member {string} handle + * @memberof proto.FavoriteStickerAction + * @instance + */ + FavoriteStickerAction.prototype.handle = ""; + + /** + * FavoriteStickerAction encFilehash. + * @member {string} encFilehash + * @memberof proto.FavoriteStickerAction + * @instance + */ + FavoriteStickerAction.prototype.encFilehash = ""; + + /** + * FavoriteStickerAction stickerHashWithoutMeta. + * @member {string} stickerHashWithoutMeta + * @memberof proto.FavoriteStickerAction + * @instance + */ + FavoriteStickerAction.prototype.stickerHashWithoutMeta = ""; + + /** + * FavoriteStickerAction mediaKey. + * @member {string} mediaKey + * @memberof proto.FavoriteStickerAction + * @instance + */ + FavoriteStickerAction.prototype.mediaKey = ""; + + /** + * FavoriteStickerAction mediaKeyTimestamp. + * @member {number|Long} mediaKeyTimestamp + * @memberof proto.FavoriteStickerAction + * @instance + */ + FavoriteStickerAction.prototype.mediaKeyTimestamp = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * FavoriteStickerAction isFavorite. + * @member {boolean} isFavorite + * @memberof proto.FavoriteStickerAction + * @instance + */ + FavoriteStickerAction.prototype.isFavorite = false; + + /** + * Creates a new FavoriteStickerAction instance using the specified properties. * @function create - * @memberof proto.FutureProofMessage + * @memberof proto.FavoriteStickerAction * @static - * @param {proto.IFutureProofMessage=} [properties] Properties to set - * @returns {proto.FutureProofMessage} FutureProofMessage instance + * @param {proto.IFavoriteStickerAction=} [properties] Properties to set + * @returns {proto.FavoriteStickerAction} FavoriteStickerAction instance */ - FutureProofMessage.create = function create(properties) { - return new FutureProofMessage(properties); + FavoriteStickerAction.create = function create(properties) { + return new FavoriteStickerAction(properties); }; /** - * Encodes the specified FutureProofMessage message. Does not implicitly {@link proto.FutureProofMessage.verify|verify} messages. + * Encodes the specified FavoriteStickerAction message. Does not implicitly {@link proto.FavoriteStickerAction.verify|verify} messages. * @function encode - * @memberof proto.FutureProofMessage + * @memberof proto.FavoriteStickerAction * @static - * @param {proto.IFutureProofMessage} message FutureProofMessage message or plain object to encode + * @param {proto.IFavoriteStickerAction} message FavoriteStickerAction message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - FutureProofMessage.encode = function encode(message, writer) { + FavoriteStickerAction.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.message != null && Object.hasOwnProperty.call(message, "message")) - $root.proto.Message.encode(message.message, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.directPath != null && Object.hasOwnProperty.call(message, "directPath")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.directPath); + if (message.lastUploadTimestamp != null && Object.hasOwnProperty.call(message, "lastUploadTimestamp")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.lastUploadTimestamp); + if (message.handle != null && Object.hasOwnProperty.call(message, "handle")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.handle); + if (message.encFilehash != null && Object.hasOwnProperty.call(message, "encFilehash")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.encFilehash); + if (message.stickerHashWithoutMeta != null && Object.hasOwnProperty.call(message, "stickerHashWithoutMeta")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.stickerHashWithoutMeta); + if (message.mediaKey != null && Object.hasOwnProperty.call(message, "mediaKey")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.mediaKey); + if (message.mediaKeyTimestamp != null && Object.hasOwnProperty.call(message, "mediaKeyTimestamp")) + writer.uint32(/* id 7, wireType 0 =*/56).int64(message.mediaKeyTimestamp); + if (message.isFavorite != null && Object.hasOwnProperty.call(message, "isFavorite")) + writer.uint32(/* id 8, wireType 0 =*/64).bool(message.isFavorite); return writer; }; /** - * Encodes the specified FutureProofMessage message, length delimited. Does not implicitly {@link proto.FutureProofMessage.verify|verify} messages. + * Encodes the specified FavoriteStickerAction message, length delimited. Does not implicitly {@link proto.FavoriteStickerAction.verify|verify} messages. * @function encodeDelimited - * @memberof proto.FutureProofMessage + * @memberof proto.FavoriteStickerAction * @static - * @param {proto.IFutureProofMessage} message FutureProofMessage message or plain object to encode + * @param {proto.IFavoriteStickerAction} message FavoriteStickerAction message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - FutureProofMessage.encodeDelimited = function encodeDelimited(message, writer) { + FavoriteStickerAction.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a FutureProofMessage message from the specified reader or buffer. + * Decodes a FavoriteStickerAction message from the specified reader or buffer. * @function decode - * @memberof proto.FutureProofMessage + * @memberof proto.FavoriteStickerAction * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {proto.FutureProofMessage} FutureProofMessage + * @returns {proto.FavoriteStickerAction} FavoriteStickerAction * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - FutureProofMessage.decode = function decode(reader, length) { + FavoriteStickerAction.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.FutureProofMessage(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.FavoriteStickerAction(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.message = $root.proto.Message.decode(reader, reader.uint32()); + message.directPath = reader.string(); + break; + case 2: + message.lastUploadTimestamp = reader.string(); + break; + case 3: + message.handle = reader.string(); + break; + case 4: + message.encFilehash = reader.string(); + break; + case 5: + message.stickerHashWithoutMeta = reader.string(); + break; + case 6: + message.mediaKey = reader.string(); + break; + case 7: + message.mediaKeyTimestamp = reader.int64(); + break; + case 8: + message.isFavorite = reader.bool(); break; default: reader.skipType(tag & 7); @@ -43493,112 +42897,178 @@ $root.proto = (function() { }; /** - * Decodes a FutureProofMessage message from the specified reader or buffer, length delimited. + * Decodes a FavoriteStickerAction message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof proto.FutureProofMessage + * @memberof proto.FavoriteStickerAction * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.FutureProofMessage} FutureProofMessage + * @returns {proto.FavoriteStickerAction} FavoriteStickerAction * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - FutureProofMessage.decodeDelimited = function decodeDelimited(reader) { + FavoriteStickerAction.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a FutureProofMessage message. + * Verifies a FavoriteStickerAction message. * @function verify - * @memberof proto.FutureProofMessage + * @memberof proto.FavoriteStickerAction * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - FutureProofMessage.verify = function verify(message) { + FavoriteStickerAction.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.message != null && message.hasOwnProperty("message")) { - var error = $root.proto.Message.verify(message.message); - if (error) - return "message." + error; - } + if (message.directPath != null && message.hasOwnProperty("directPath")) + if (!$util.isString(message.directPath)) + return "directPath: string expected"; + if (message.lastUploadTimestamp != null && message.hasOwnProperty("lastUploadTimestamp")) + if (!$util.isString(message.lastUploadTimestamp)) + return "lastUploadTimestamp: string expected"; + if (message.handle != null && message.hasOwnProperty("handle")) + if (!$util.isString(message.handle)) + return "handle: string expected"; + if (message.encFilehash != null && message.hasOwnProperty("encFilehash")) + if (!$util.isString(message.encFilehash)) + return "encFilehash: string expected"; + if (message.stickerHashWithoutMeta != null && message.hasOwnProperty("stickerHashWithoutMeta")) + if (!$util.isString(message.stickerHashWithoutMeta)) + return "stickerHashWithoutMeta: string expected"; + if (message.mediaKey != null && message.hasOwnProperty("mediaKey")) + if (!$util.isString(message.mediaKey)) + return "mediaKey: string expected"; + if (message.mediaKeyTimestamp != null && message.hasOwnProperty("mediaKeyTimestamp")) + if (!$util.isInteger(message.mediaKeyTimestamp) && !(message.mediaKeyTimestamp && $util.isInteger(message.mediaKeyTimestamp.low) && $util.isInteger(message.mediaKeyTimestamp.high))) + return "mediaKeyTimestamp: integer|Long expected"; + if (message.isFavorite != null && message.hasOwnProperty("isFavorite")) + if (typeof message.isFavorite !== "boolean") + return "isFavorite: boolean expected"; return null; }; /** - * Creates a FutureProofMessage message from a plain object. Also converts values to their respective internal types. + * Creates a FavoriteStickerAction message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof proto.FutureProofMessage + * @memberof proto.FavoriteStickerAction * @static * @param {Object.} object Plain object - * @returns {proto.FutureProofMessage} FutureProofMessage + * @returns {proto.FavoriteStickerAction} FavoriteStickerAction */ - FutureProofMessage.fromObject = function fromObject(object) { - if (object instanceof $root.proto.FutureProofMessage) + FavoriteStickerAction.fromObject = function fromObject(object) { + if (object instanceof $root.proto.FavoriteStickerAction) return object; - var message = new $root.proto.FutureProofMessage(); - if (object.message != null) { - if (typeof object.message !== "object") - throw TypeError(".proto.FutureProofMessage.message: object expected"); - message.message = $root.proto.Message.fromObject(object.message); - } + var message = new $root.proto.FavoriteStickerAction(); + if (object.directPath != null) + message.directPath = String(object.directPath); + if (object.lastUploadTimestamp != null) + message.lastUploadTimestamp = String(object.lastUploadTimestamp); + if (object.handle != null) + message.handle = String(object.handle); + if (object.encFilehash != null) + message.encFilehash = String(object.encFilehash); + if (object.stickerHashWithoutMeta != null) + message.stickerHashWithoutMeta = String(object.stickerHashWithoutMeta); + if (object.mediaKey != null) + message.mediaKey = String(object.mediaKey); + if (object.mediaKeyTimestamp != null) + if ($util.Long) + (message.mediaKeyTimestamp = $util.Long.fromValue(object.mediaKeyTimestamp)).unsigned = false; + else if (typeof object.mediaKeyTimestamp === "string") + message.mediaKeyTimestamp = parseInt(object.mediaKeyTimestamp, 10); + else if (typeof object.mediaKeyTimestamp === "number") + message.mediaKeyTimestamp = object.mediaKeyTimestamp; + else if (typeof object.mediaKeyTimestamp === "object") + message.mediaKeyTimestamp = new $util.LongBits(object.mediaKeyTimestamp.low >>> 0, object.mediaKeyTimestamp.high >>> 0).toNumber(); + if (object.isFavorite != null) + message.isFavorite = Boolean(object.isFavorite); return message; }; /** - * Creates a plain object from a FutureProofMessage message. Also converts values to other types if specified. + * Creates a plain object from a FavoriteStickerAction message. Also converts values to other types if specified. * @function toObject - * @memberof proto.FutureProofMessage + * @memberof proto.FavoriteStickerAction * @static - * @param {proto.FutureProofMessage} message FutureProofMessage + * @param {proto.FavoriteStickerAction} message FavoriteStickerAction * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - FutureProofMessage.toObject = function toObject(message, options) { + FavoriteStickerAction.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) - object.message = null; - if (message.message != null && message.hasOwnProperty("message")) - object.message = $root.proto.Message.toObject(message.message, options); + if (options.defaults) { + object.directPath = ""; + object.lastUploadTimestamp = ""; + object.handle = ""; + object.encFilehash = ""; + object.stickerHashWithoutMeta = ""; + object.mediaKey = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.mediaKeyTimestamp = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.mediaKeyTimestamp = options.longs === String ? "0" : 0; + object.isFavorite = false; + } + if (message.directPath != null && message.hasOwnProperty("directPath")) + object.directPath = message.directPath; + if (message.lastUploadTimestamp != null && message.hasOwnProperty("lastUploadTimestamp")) + object.lastUploadTimestamp = message.lastUploadTimestamp; + if (message.handle != null && message.hasOwnProperty("handle")) + object.handle = message.handle; + if (message.encFilehash != null && message.hasOwnProperty("encFilehash")) + object.encFilehash = message.encFilehash; + if (message.stickerHashWithoutMeta != null && message.hasOwnProperty("stickerHashWithoutMeta")) + object.stickerHashWithoutMeta = message.stickerHashWithoutMeta; + if (message.mediaKey != null && message.hasOwnProperty("mediaKey")) + object.mediaKey = message.mediaKey; + if (message.mediaKeyTimestamp != null && message.hasOwnProperty("mediaKeyTimestamp")) + if (typeof message.mediaKeyTimestamp === "number") + object.mediaKeyTimestamp = options.longs === String ? String(message.mediaKeyTimestamp) : message.mediaKeyTimestamp; + else + object.mediaKeyTimestamp = options.longs === String ? $util.Long.prototype.toString.call(message.mediaKeyTimestamp) : options.longs === Number ? new $util.LongBits(message.mediaKeyTimestamp.low >>> 0, message.mediaKeyTimestamp.high >>> 0).toNumber() : message.mediaKeyTimestamp; + if (message.isFavorite != null && message.hasOwnProperty("isFavorite")) + object.isFavorite = message.isFavorite; return object; }; /** - * Converts this FutureProofMessage to JSON. + * Converts this FavoriteStickerAction to JSON. * @function toJSON - * @memberof proto.FutureProofMessage + * @memberof proto.FavoriteStickerAction * @instance * @returns {Object.} JSON object */ - FutureProofMessage.prototype.toJSON = function toJSON() { + FavoriteStickerAction.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return FutureProofMessage; + return FavoriteStickerAction; })(); - proto.ButtonText = (function() { + proto.KeyExpiration = (function() { /** - * Properties of a ButtonText. + * Properties of a KeyExpiration. * @memberof proto - * @interface IButtonText - * @property {string|null} [displayText] ButtonText displayText + * @interface IKeyExpiration + * @property {number|null} [expiredKeyEpoch] KeyExpiration expiredKeyEpoch */ /** - * Constructs a new ButtonText. + * Constructs a new KeyExpiration. * @memberof proto - * @classdesc Represents a ButtonText. - * @implements IButtonText + * @classdesc Represents a KeyExpiration. + * @implements IKeyExpiration * @constructor - * @param {proto.IButtonText=} [properties] Properties to set + * @param {proto.IKeyExpiration=} [properties] Properties to set */ - function ButtonText(properties) { + function KeyExpiration(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -43606,75 +43076,75 @@ $root.proto = (function() { } /** - * ButtonText displayText. - * @member {string} displayText - * @memberof proto.ButtonText + * KeyExpiration expiredKeyEpoch. + * @member {number} expiredKeyEpoch + * @memberof proto.KeyExpiration * @instance */ - ButtonText.prototype.displayText = ""; + KeyExpiration.prototype.expiredKeyEpoch = 0; /** - * Creates a new ButtonText instance using the specified properties. + * Creates a new KeyExpiration instance using the specified properties. * @function create - * @memberof proto.ButtonText + * @memberof proto.KeyExpiration * @static - * @param {proto.IButtonText=} [properties] Properties to set - * @returns {proto.ButtonText} ButtonText instance + * @param {proto.IKeyExpiration=} [properties] Properties to set + * @returns {proto.KeyExpiration} KeyExpiration instance */ - ButtonText.create = function create(properties) { - return new ButtonText(properties); + KeyExpiration.create = function create(properties) { + return new KeyExpiration(properties); }; /** - * Encodes the specified ButtonText message. Does not implicitly {@link proto.ButtonText.verify|verify} messages. + * Encodes the specified KeyExpiration message. Does not implicitly {@link proto.KeyExpiration.verify|verify} messages. * @function encode - * @memberof proto.ButtonText + * @memberof proto.KeyExpiration * @static - * @param {proto.IButtonText} message ButtonText message or plain object to encode + * @param {proto.IKeyExpiration} message KeyExpiration message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ButtonText.encode = function encode(message, writer) { + KeyExpiration.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.displayText != null && Object.hasOwnProperty.call(message, "displayText")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.displayText); + if (message.expiredKeyEpoch != null && Object.hasOwnProperty.call(message, "expiredKeyEpoch")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.expiredKeyEpoch); return writer; }; /** - * Encodes the specified ButtonText message, length delimited. Does not implicitly {@link proto.ButtonText.verify|verify} messages. + * Encodes the specified KeyExpiration message, length delimited. Does not implicitly {@link proto.KeyExpiration.verify|verify} messages. * @function encodeDelimited - * @memberof proto.ButtonText + * @memberof proto.KeyExpiration * @static - * @param {proto.IButtonText} message ButtonText message or plain object to encode + * @param {proto.IKeyExpiration} message KeyExpiration message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ButtonText.encodeDelimited = function encodeDelimited(message, writer) { + KeyExpiration.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ButtonText message from the specified reader or buffer. + * Decodes a KeyExpiration message from the specified reader or buffer. * @function decode - * @memberof proto.ButtonText + * @memberof proto.KeyExpiration * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {proto.ButtonText} ButtonText + * @returns {proto.KeyExpiration} KeyExpiration * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ButtonText.decode = function decode(reader, length) { + KeyExpiration.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.ButtonText(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.KeyExpiration(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.displayText = reader.string(); + message.expiredKeyEpoch = reader.int32(); break; default: reader.skipType(tag & 7); @@ -43685,108 +43155,107 @@ $root.proto = (function() { }; /** - * Decodes a ButtonText message from the specified reader or buffer, length delimited. + * Decodes a KeyExpiration message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof proto.ButtonText + * @memberof proto.KeyExpiration * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.ButtonText} ButtonText + * @returns {proto.KeyExpiration} KeyExpiration * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ButtonText.decodeDelimited = function decodeDelimited(reader) { + KeyExpiration.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ButtonText message. + * Verifies a KeyExpiration message. * @function verify - * @memberof proto.ButtonText + * @memberof proto.KeyExpiration * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ButtonText.verify = function verify(message) { + KeyExpiration.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.displayText != null && message.hasOwnProperty("displayText")) - if (!$util.isString(message.displayText)) - return "displayText: string expected"; + if (message.expiredKeyEpoch != null && message.hasOwnProperty("expiredKeyEpoch")) + if (!$util.isInteger(message.expiredKeyEpoch)) + return "expiredKeyEpoch: integer expected"; return null; }; /** - * Creates a ButtonText message from a plain object. Also converts values to their respective internal types. + * Creates a KeyExpiration message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof proto.ButtonText + * @memberof proto.KeyExpiration * @static * @param {Object.} object Plain object - * @returns {proto.ButtonText} ButtonText + * @returns {proto.KeyExpiration} KeyExpiration */ - ButtonText.fromObject = function fromObject(object) { - if (object instanceof $root.proto.ButtonText) + KeyExpiration.fromObject = function fromObject(object) { + if (object instanceof $root.proto.KeyExpiration) return object; - var message = new $root.proto.ButtonText(); - if (object.displayText != null) - message.displayText = String(object.displayText); + var message = new $root.proto.KeyExpiration(); + if (object.expiredKeyEpoch != null) + message.expiredKeyEpoch = object.expiredKeyEpoch | 0; return message; }; /** - * Creates a plain object from a ButtonText message. Also converts values to other types if specified. + * Creates a plain object from a KeyExpiration message. Also converts values to other types if specified. * @function toObject - * @memberof proto.ButtonText + * @memberof proto.KeyExpiration * @static - * @param {proto.ButtonText} message ButtonText + * @param {proto.KeyExpiration} message KeyExpiration * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ButtonText.toObject = function toObject(message, options) { + KeyExpiration.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) - object.displayText = ""; - if (message.displayText != null && message.hasOwnProperty("displayText")) - object.displayText = message.displayText; + object.expiredKeyEpoch = 0; + if (message.expiredKeyEpoch != null && message.hasOwnProperty("expiredKeyEpoch")) + object.expiredKeyEpoch = message.expiredKeyEpoch; return object; }; /** - * Converts this ButtonText to JSON. + * Converts this KeyExpiration to JSON. * @function toJSON - * @memberof proto.ButtonText + * @memberof proto.KeyExpiration * @instance * @returns {Object.} JSON object */ - ButtonText.prototype.toJSON = function toJSON() { + KeyExpiration.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ButtonText; + return KeyExpiration; })(); - proto.NativeFlowInfo = (function() { + proto.LabelAssociationAction = (function() { /** - * Properties of a NativeFlowInfo. + * Properties of a LabelAssociationAction. * @memberof proto - * @interface INativeFlowInfo - * @property {string|null} [name] NativeFlowInfo name - * @property {string|null} [paramsJson] NativeFlowInfo paramsJson + * @interface ILabelAssociationAction + * @property {boolean|null} [labeled] LabelAssociationAction labeled */ /** - * Constructs a new NativeFlowInfo. + * Constructs a new LabelAssociationAction. * @memberof proto - * @classdesc Represents a NativeFlowInfo. - * @implements INativeFlowInfo + * @classdesc Represents a LabelAssociationAction. + * @implements ILabelAssociationAction * @constructor - * @param {proto.INativeFlowInfo=} [properties] Properties to set + * @param {proto.ILabelAssociationAction=} [properties] Properties to set */ - function NativeFlowInfo(properties) { + function LabelAssociationAction(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -43794,88 +43263,75 @@ $root.proto = (function() { } /** - * NativeFlowInfo name. - * @member {string} name - * @memberof proto.NativeFlowInfo - * @instance - */ - NativeFlowInfo.prototype.name = ""; - - /** - * NativeFlowInfo paramsJson. - * @member {string} paramsJson - * @memberof proto.NativeFlowInfo + * LabelAssociationAction labeled. + * @member {boolean} labeled + * @memberof proto.LabelAssociationAction * @instance */ - NativeFlowInfo.prototype.paramsJson = ""; + LabelAssociationAction.prototype.labeled = false; /** - * Creates a new NativeFlowInfo instance using the specified properties. + * Creates a new LabelAssociationAction instance using the specified properties. * @function create - * @memberof proto.NativeFlowInfo + * @memberof proto.LabelAssociationAction * @static - * @param {proto.INativeFlowInfo=} [properties] Properties to set - * @returns {proto.NativeFlowInfo} NativeFlowInfo instance + * @param {proto.ILabelAssociationAction=} [properties] Properties to set + * @returns {proto.LabelAssociationAction} LabelAssociationAction instance */ - NativeFlowInfo.create = function create(properties) { - return new NativeFlowInfo(properties); + LabelAssociationAction.create = function create(properties) { + return new LabelAssociationAction(properties); }; /** - * Encodes the specified NativeFlowInfo message. Does not implicitly {@link proto.NativeFlowInfo.verify|verify} messages. + * Encodes the specified LabelAssociationAction message. Does not implicitly {@link proto.LabelAssociationAction.verify|verify} messages. * @function encode - * @memberof proto.NativeFlowInfo + * @memberof proto.LabelAssociationAction * @static - * @param {proto.INativeFlowInfo} message NativeFlowInfo message or plain object to encode + * @param {proto.ILabelAssociationAction} message LabelAssociationAction message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - NativeFlowInfo.encode = function encode(message, writer) { + LabelAssociationAction.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.paramsJson != null && Object.hasOwnProperty.call(message, "paramsJson")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.paramsJson); + if (message.labeled != null && Object.hasOwnProperty.call(message, "labeled")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.labeled); return writer; }; /** - * Encodes the specified NativeFlowInfo message, length delimited. Does not implicitly {@link proto.NativeFlowInfo.verify|verify} messages. + * Encodes the specified LabelAssociationAction message, length delimited. Does not implicitly {@link proto.LabelAssociationAction.verify|verify} messages. * @function encodeDelimited - * @memberof proto.NativeFlowInfo + * @memberof proto.LabelAssociationAction * @static - * @param {proto.INativeFlowInfo} message NativeFlowInfo message or plain object to encode + * @param {proto.ILabelAssociationAction} message LabelAssociationAction message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - NativeFlowInfo.encodeDelimited = function encodeDelimited(message, writer) { + LabelAssociationAction.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a NativeFlowInfo message from the specified reader or buffer. + * Decodes a LabelAssociationAction message from the specified reader or buffer. * @function decode - * @memberof proto.NativeFlowInfo + * @memberof proto.LabelAssociationAction * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {proto.NativeFlowInfo} NativeFlowInfo + * @returns {proto.LabelAssociationAction} LabelAssociationAction * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - NativeFlowInfo.decode = function decode(reader, length) { + LabelAssociationAction.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.NativeFlowInfo(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.LabelAssociationAction(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.name = reader.string(); - break; - case 2: - message.paramsJson = reader.string(); + message.labeled = reader.bool(); break; default: reader.skipType(tag & 7); @@ -43886,119 +43342,110 @@ $root.proto = (function() { }; /** - * Decodes a NativeFlowInfo message from the specified reader or buffer, length delimited. + * Decodes a LabelAssociationAction message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof proto.NativeFlowInfo + * @memberof proto.LabelAssociationAction * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.NativeFlowInfo} NativeFlowInfo + * @returns {proto.LabelAssociationAction} LabelAssociationAction * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - NativeFlowInfo.decodeDelimited = function decodeDelimited(reader) { + LabelAssociationAction.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a NativeFlowInfo message. + * Verifies a LabelAssociationAction message. * @function verify - * @memberof proto.NativeFlowInfo + * @memberof proto.LabelAssociationAction * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - NativeFlowInfo.verify = function verify(message) { + LabelAssociationAction.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.paramsJson != null && message.hasOwnProperty("paramsJson")) - if (!$util.isString(message.paramsJson)) - return "paramsJson: string expected"; + if (message.labeled != null && message.hasOwnProperty("labeled")) + if (typeof message.labeled !== "boolean") + return "labeled: boolean expected"; return null; }; /** - * Creates a NativeFlowInfo message from a plain object. Also converts values to their respective internal types. + * Creates a LabelAssociationAction message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof proto.NativeFlowInfo + * @memberof proto.LabelAssociationAction * @static * @param {Object.} object Plain object - * @returns {proto.NativeFlowInfo} NativeFlowInfo + * @returns {proto.LabelAssociationAction} LabelAssociationAction */ - NativeFlowInfo.fromObject = function fromObject(object) { - if (object instanceof $root.proto.NativeFlowInfo) + LabelAssociationAction.fromObject = function fromObject(object) { + if (object instanceof $root.proto.LabelAssociationAction) return object; - var message = new $root.proto.NativeFlowInfo(); - if (object.name != null) - message.name = String(object.name); - if (object.paramsJson != null) - message.paramsJson = String(object.paramsJson); + var message = new $root.proto.LabelAssociationAction(); + if (object.labeled != null) + message.labeled = Boolean(object.labeled); return message; }; /** - * Creates a plain object from a NativeFlowInfo message. Also converts values to other types if specified. + * Creates a plain object from a LabelAssociationAction message. Also converts values to other types if specified. * @function toObject - * @memberof proto.NativeFlowInfo + * @memberof proto.LabelAssociationAction * @static - * @param {proto.NativeFlowInfo} message NativeFlowInfo + * @param {proto.LabelAssociationAction} message LabelAssociationAction * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - NativeFlowInfo.toObject = function toObject(message, options) { + LabelAssociationAction.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.name = ""; - object.paramsJson = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.paramsJson != null && message.hasOwnProperty("paramsJson")) - object.paramsJson = message.paramsJson; + if (options.defaults) + object.labeled = false; + if (message.labeled != null && message.hasOwnProperty("labeled")) + object.labeled = message.labeled; return object; }; /** - * Converts this NativeFlowInfo to JSON. + * Converts this LabelAssociationAction to JSON. * @function toJSON - * @memberof proto.NativeFlowInfo + * @memberof proto.LabelAssociationAction * @instance * @returns {Object.} JSON object */ - NativeFlowInfo.prototype.toJSON = function toJSON() { + LabelAssociationAction.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return NativeFlowInfo; + return LabelAssociationAction; })(); - proto.Button = (function() { + proto.LabelEditAction = (function() { /** - * Properties of a Button. + * Properties of a LabelEditAction. * @memberof proto - * @interface IButton - * @property {string|null} [buttonId] Button buttonId - * @property {proto.IButtonText|null} [buttonText] Button buttonText - * @property {proto.Button.ButtonType|null} [type] Button type - * @property {proto.INativeFlowInfo|null} [nativeFlowInfo] Button nativeFlowInfo + * @interface ILabelEditAction + * @property {string|null} [name] LabelEditAction name + * @property {number|null} [color] LabelEditAction color + * @property {number|null} [predefinedId] LabelEditAction predefinedId + * @property {boolean|null} [deleted] LabelEditAction deleted */ /** - * Constructs a new Button. + * Constructs a new LabelEditAction. * @memberof proto - * @classdesc Represents a Button. - * @implements IButton + * @classdesc Represents a LabelEditAction. + * @implements ILabelEditAction * @constructor - * @param {proto.IButton=} [properties] Properties to set + * @param {proto.ILabelEditAction=} [properties] Properties to set */ - function Button(properties) { + function LabelEditAction(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -44006,114 +43453,114 @@ $root.proto = (function() { } /** - * Button buttonId. - * @member {string} buttonId - * @memberof proto.Button + * LabelEditAction name. + * @member {string} name + * @memberof proto.LabelEditAction * @instance */ - Button.prototype.buttonId = ""; + LabelEditAction.prototype.name = ""; /** - * Button buttonText. - * @member {proto.IButtonText|null|undefined} buttonText - * @memberof proto.Button + * LabelEditAction color. + * @member {number} color + * @memberof proto.LabelEditAction * @instance */ - Button.prototype.buttonText = null; + LabelEditAction.prototype.color = 0; /** - * Button type. - * @member {proto.Button.ButtonType} type - * @memberof proto.Button + * LabelEditAction predefinedId. + * @member {number} predefinedId + * @memberof proto.LabelEditAction * @instance */ - Button.prototype.type = 0; + LabelEditAction.prototype.predefinedId = 0; /** - * Button nativeFlowInfo. - * @member {proto.INativeFlowInfo|null|undefined} nativeFlowInfo - * @memberof proto.Button + * LabelEditAction deleted. + * @member {boolean} deleted + * @memberof proto.LabelEditAction * @instance */ - Button.prototype.nativeFlowInfo = null; + LabelEditAction.prototype.deleted = false; /** - * Creates a new Button instance using the specified properties. + * Creates a new LabelEditAction instance using the specified properties. * @function create - * @memberof proto.Button + * @memberof proto.LabelEditAction * @static - * @param {proto.IButton=} [properties] Properties to set - * @returns {proto.Button} Button instance + * @param {proto.ILabelEditAction=} [properties] Properties to set + * @returns {proto.LabelEditAction} LabelEditAction instance */ - Button.create = function create(properties) { - return new Button(properties); + LabelEditAction.create = function create(properties) { + return new LabelEditAction(properties); }; /** - * Encodes the specified Button message. Does not implicitly {@link proto.Button.verify|verify} messages. + * Encodes the specified LabelEditAction message. Does not implicitly {@link proto.LabelEditAction.verify|verify} messages. * @function encode - * @memberof proto.Button + * @memberof proto.LabelEditAction * @static - * @param {proto.IButton} message Button message or plain object to encode + * @param {proto.ILabelEditAction} message LabelEditAction message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Button.encode = function encode(message, writer) { + LabelEditAction.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.buttonId != null && Object.hasOwnProperty.call(message, "buttonId")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.buttonId); - if (message.buttonText != null && Object.hasOwnProperty.call(message, "buttonText")) - $root.proto.ButtonText.encode(message.buttonText, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.type); - if (message.nativeFlowInfo != null && Object.hasOwnProperty.call(message, "nativeFlowInfo")) - $root.proto.NativeFlowInfo.encode(message.nativeFlowInfo, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.color != null && Object.hasOwnProperty.call(message, "color")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.color); + if (message.predefinedId != null && Object.hasOwnProperty.call(message, "predefinedId")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.predefinedId); + if (message.deleted != null && Object.hasOwnProperty.call(message, "deleted")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.deleted); return writer; }; /** - * Encodes the specified Button message, length delimited. Does not implicitly {@link proto.Button.verify|verify} messages. + * Encodes the specified LabelEditAction message, length delimited. Does not implicitly {@link proto.LabelEditAction.verify|verify} messages. * @function encodeDelimited - * @memberof proto.Button + * @memberof proto.LabelEditAction * @static - * @param {proto.IButton} message Button message or plain object to encode + * @param {proto.ILabelEditAction} message LabelEditAction message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Button.encodeDelimited = function encodeDelimited(message, writer) { + LabelEditAction.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Button message from the specified reader or buffer. + * Decodes a LabelEditAction message from the specified reader or buffer. * @function decode - * @memberof proto.Button + * @memberof proto.LabelEditAction * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {proto.Button} Button + * @returns {proto.LabelEditAction} LabelEditAction * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Button.decode = function decode(reader, length) { + LabelEditAction.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.Button(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.LabelEditAction(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.buttonId = reader.string(); + message.name = reader.string(); break; case 2: - message.buttonText = $root.proto.ButtonText.decode(reader, reader.uint32()); + message.color = reader.int32(); break; case 3: - message.type = reader.int32(); + message.predefinedId = reader.int32(); break; case 4: - message.nativeFlowInfo = $root.proto.NativeFlowInfo.decode(reader, reader.uint32()); + message.deleted = reader.bool(); break; default: reader.skipType(tag & 7); @@ -44124,186 +43571,132 @@ $root.proto = (function() { }; /** - * Decodes a Button message from the specified reader or buffer, length delimited. + * Decodes a LabelEditAction message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof proto.Button + * @memberof proto.LabelEditAction * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.Button} Button + * @returns {proto.LabelEditAction} LabelEditAction * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Button.decodeDelimited = function decodeDelimited(reader) { + LabelEditAction.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Button message. + * Verifies a LabelEditAction message. * @function verify - * @memberof proto.Button + * @memberof proto.LabelEditAction * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Button.verify = function verify(message) { + LabelEditAction.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.buttonId != null && message.hasOwnProperty("buttonId")) - if (!$util.isString(message.buttonId)) - return "buttonId: string expected"; - if (message.buttonText != null && message.hasOwnProperty("buttonText")) { - var error = $root.proto.ButtonText.verify(message.buttonText); - if (error) - return "buttonText." + error; - } - if (message.type != null && message.hasOwnProperty("type")) - switch (message.type) { - default: - return "type: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.nativeFlowInfo != null && message.hasOwnProperty("nativeFlowInfo")) { - var error = $root.proto.NativeFlowInfo.verify(message.nativeFlowInfo); - if (error) - return "nativeFlowInfo." + error; - } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.color != null && message.hasOwnProperty("color")) + if (!$util.isInteger(message.color)) + return "color: integer expected"; + if (message.predefinedId != null && message.hasOwnProperty("predefinedId")) + if (!$util.isInteger(message.predefinedId)) + return "predefinedId: integer expected"; + if (message.deleted != null && message.hasOwnProperty("deleted")) + if (typeof message.deleted !== "boolean") + return "deleted: boolean expected"; return null; }; /** - * Creates a Button message from a plain object. Also converts values to their respective internal types. + * Creates a LabelEditAction message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof proto.Button + * @memberof proto.LabelEditAction * @static * @param {Object.} object Plain object - * @returns {proto.Button} Button + * @returns {proto.LabelEditAction} LabelEditAction */ - Button.fromObject = function fromObject(object) { - if (object instanceof $root.proto.Button) + LabelEditAction.fromObject = function fromObject(object) { + if (object instanceof $root.proto.LabelEditAction) return object; - var message = new $root.proto.Button(); - if (object.buttonId != null) - message.buttonId = String(object.buttonId); - if (object.buttonText != null) { - if (typeof object.buttonText !== "object") - throw TypeError(".proto.Button.buttonText: object expected"); - message.buttonText = $root.proto.ButtonText.fromObject(object.buttonText); - } - switch (object.type) { - case "UNKNOWN": - case 0: - message.type = 0; - break; - case "RESPONSE": - case 1: - message.type = 1; - break; - case "NATIVE_FLOW": - case 2: - message.type = 2; - break; - } - if (object.nativeFlowInfo != null) { - if (typeof object.nativeFlowInfo !== "object") - throw TypeError(".proto.Button.nativeFlowInfo: object expected"); - message.nativeFlowInfo = $root.proto.NativeFlowInfo.fromObject(object.nativeFlowInfo); - } + var message = new $root.proto.LabelEditAction(); + if (object.name != null) + message.name = String(object.name); + if (object.color != null) + message.color = object.color | 0; + if (object.predefinedId != null) + message.predefinedId = object.predefinedId | 0; + if (object.deleted != null) + message.deleted = Boolean(object.deleted); return message; }; /** - * Creates a plain object from a Button message. Also converts values to other types if specified. + * Creates a plain object from a LabelEditAction message. Also converts values to other types if specified. * @function toObject - * @memberof proto.Button + * @memberof proto.LabelEditAction * @static - * @param {proto.Button} message Button + * @param {proto.LabelEditAction} message LabelEditAction * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Button.toObject = function toObject(message, options) { + LabelEditAction.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.buttonId = ""; - object.buttonText = null; - object.type = options.enums === String ? "UNKNOWN" : 0; - object.nativeFlowInfo = null; + object.name = ""; + object.color = 0; + object.predefinedId = 0; + object.deleted = false; } - if (message.buttonId != null && message.hasOwnProperty("buttonId")) - object.buttonId = message.buttonId; - if (message.buttonText != null && message.hasOwnProperty("buttonText")) - object.buttonText = $root.proto.ButtonText.toObject(message.buttonText, options); - if (message.type != null && message.hasOwnProperty("type")) - object.type = options.enums === String ? $root.proto.Button.ButtonType[message.type] : message.type; - if (message.nativeFlowInfo != null && message.hasOwnProperty("nativeFlowInfo")) - object.nativeFlowInfo = $root.proto.NativeFlowInfo.toObject(message.nativeFlowInfo, options); + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.color != null && message.hasOwnProperty("color")) + object.color = message.color; + if (message.predefinedId != null && message.hasOwnProperty("predefinedId")) + object.predefinedId = message.predefinedId; + if (message.deleted != null && message.hasOwnProperty("deleted")) + object.deleted = message.deleted; return object; }; /** - * Converts this Button to JSON. + * Converts this LabelEditAction to JSON. * @function toJSON - * @memberof proto.Button + * @memberof proto.LabelEditAction * @instance * @returns {Object.} JSON object */ - Button.prototype.toJSON = function toJSON() { + LabelEditAction.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - /** - * ButtonType enum. - * @name proto.Button.ButtonType - * @enum {number} - * @property {number} UNKNOWN=0 UNKNOWN value - * @property {number} RESPONSE=1 RESPONSE value - * @property {number} NATIVE_FLOW=2 NATIVE_FLOW value - */ - Button.ButtonType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "UNKNOWN"] = 0; - values[valuesById[1] = "RESPONSE"] = 1; - values[valuesById[2] = "NATIVE_FLOW"] = 2; - return values; - })(); - - return Button; + return LabelEditAction; })(); - proto.ButtonsMessage = (function() { + proto.LocaleSetting = (function() { /** - * Properties of a ButtonsMessage. + * Properties of a LocaleSetting. * @memberof proto - * @interface IButtonsMessage - * @property {string|null} [contentText] ButtonsMessage contentText - * @property {string|null} [footerText] ButtonsMessage footerText - * @property {proto.IContextInfo|null} [contextInfo] ButtonsMessage contextInfo - * @property {Array.|null} [buttons] ButtonsMessage buttons - * @property {proto.ButtonsMessage.ButtonsMessageHeaderType|null} [headerType] ButtonsMessage headerType - * @property {string|null} [text] ButtonsMessage text - * @property {proto.IDocumentMessage|null} [documentMessage] ButtonsMessage documentMessage - * @property {proto.IImageMessage|null} [imageMessage] ButtonsMessage imageMessage - * @property {proto.IVideoMessage|null} [videoMessage] ButtonsMessage videoMessage - * @property {proto.ILocationMessage|null} [locationMessage] ButtonsMessage locationMessage + * @interface ILocaleSetting + * @property {string|null} [locale] LocaleSetting locale */ /** - * Constructs a new ButtonsMessage. + * Constructs a new LocaleSetting. * @memberof proto - * @classdesc Represents a ButtonsMessage. - * @implements IButtonsMessage + * @classdesc Represents a LocaleSetting. + * @implements ILocaleSetting * @constructor - * @param {proto.IButtonsMessage=} [properties] Properties to set + * @param {proto.ILocaleSetting=} [properties] Properties to set */ - function ButtonsMessage(properties) { - this.buttons = []; + function LocaleSetting(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -44311,212 +43704,78 @@ $root.proto = (function() { } /** - * ButtonsMessage contentText. - * @member {string} contentText - * @memberof proto.ButtonsMessage - * @instance - */ - ButtonsMessage.prototype.contentText = ""; - - /** - * ButtonsMessage footerText. - * @member {string} footerText - * @memberof proto.ButtonsMessage - * @instance - */ - ButtonsMessage.prototype.footerText = ""; - - /** - * ButtonsMessage contextInfo. - * @member {proto.IContextInfo|null|undefined} contextInfo - * @memberof proto.ButtonsMessage - * @instance - */ - ButtonsMessage.prototype.contextInfo = null; - - /** - * ButtonsMessage buttons. - * @member {Array.} buttons - * @memberof proto.ButtonsMessage - * @instance - */ - ButtonsMessage.prototype.buttons = $util.emptyArray; - - /** - * ButtonsMessage headerType. - * @member {proto.ButtonsMessage.ButtonsMessageHeaderType} headerType - * @memberof proto.ButtonsMessage - * @instance - */ - ButtonsMessage.prototype.headerType = 0; - - /** - * ButtonsMessage text. - * @member {string|null|undefined} text - * @memberof proto.ButtonsMessage - * @instance - */ - ButtonsMessage.prototype.text = null; - - /** - * ButtonsMessage documentMessage. - * @member {proto.IDocumentMessage|null|undefined} documentMessage - * @memberof proto.ButtonsMessage - * @instance - */ - ButtonsMessage.prototype.documentMessage = null; - - /** - * ButtonsMessage imageMessage. - * @member {proto.IImageMessage|null|undefined} imageMessage - * @memberof proto.ButtonsMessage - * @instance - */ - ButtonsMessage.prototype.imageMessage = null; - - /** - * ButtonsMessage videoMessage. - * @member {proto.IVideoMessage|null|undefined} videoMessage - * @memberof proto.ButtonsMessage - * @instance - */ - ButtonsMessage.prototype.videoMessage = null; - - /** - * ButtonsMessage locationMessage. - * @member {proto.ILocationMessage|null|undefined} locationMessage - * @memberof proto.ButtonsMessage - * @instance - */ - ButtonsMessage.prototype.locationMessage = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * ButtonsMessage header. - * @member {"text"|"documentMessage"|"imageMessage"|"videoMessage"|"locationMessage"|undefined} header - * @memberof proto.ButtonsMessage + * LocaleSetting locale. + * @member {string} locale + * @memberof proto.LocaleSetting * @instance */ - Object.defineProperty(ButtonsMessage.prototype, "header", { - get: $util.oneOfGetter($oneOfFields = ["text", "documentMessage", "imageMessage", "videoMessage", "locationMessage"]), - set: $util.oneOfSetter($oneOfFields) - }); + LocaleSetting.prototype.locale = ""; /** - * Creates a new ButtonsMessage instance using the specified properties. + * Creates a new LocaleSetting instance using the specified properties. * @function create - * @memberof proto.ButtonsMessage + * @memberof proto.LocaleSetting * @static - * @param {proto.IButtonsMessage=} [properties] Properties to set - * @returns {proto.ButtonsMessage} ButtonsMessage instance + * @param {proto.ILocaleSetting=} [properties] Properties to set + * @returns {proto.LocaleSetting} LocaleSetting instance */ - ButtonsMessage.create = function create(properties) { - return new ButtonsMessage(properties); + LocaleSetting.create = function create(properties) { + return new LocaleSetting(properties); }; /** - * Encodes the specified ButtonsMessage message. Does not implicitly {@link proto.ButtonsMessage.verify|verify} messages. + * Encodes the specified LocaleSetting message. Does not implicitly {@link proto.LocaleSetting.verify|verify} messages. * @function encode - * @memberof proto.ButtonsMessage + * @memberof proto.LocaleSetting * @static - * @param {proto.IButtonsMessage} message ButtonsMessage message or plain object to encode + * @param {proto.ILocaleSetting} message LocaleSetting message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ButtonsMessage.encode = function encode(message, writer) { + LocaleSetting.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.text != null && Object.hasOwnProperty.call(message, "text")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.text); - if (message.documentMessage != null && Object.hasOwnProperty.call(message, "documentMessage")) - $root.proto.DocumentMessage.encode(message.documentMessage, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.imageMessage != null && Object.hasOwnProperty.call(message, "imageMessage")) - $root.proto.ImageMessage.encode(message.imageMessage, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.videoMessage != null && Object.hasOwnProperty.call(message, "videoMessage")) - $root.proto.VideoMessage.encode(message.videoMessage, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.locationMessage != null && Object.hasOwnProperty.call(message, "locationMessage")) - $root.proto.LocationMessage.encode(message.locationMessage, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.contentText != null && Object.hasOwnProperty.call(message, "contentText")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.contentText); - if (message.footerText != null && Object.hasOwnProperty.call(message, "footerText")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.footerText); - if (message.contextInfo != null && Object.hasOwnProperty.call(message, "contextInfo")) - $root.proto.ContextInfo.encode(message.contextInfo, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.buttons != null && message.buttons.length) - for (var i = 0; i < message.buttons.length; ++i) - $root.proto.Button.encode(message.buttons[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.headerType != null && Object.hasOwnProperty.call(message, "headerType")) - writer.uint32(/* id 10, wireType 0 =*/80).int32(message.headerType); + if (message.locale != null && Object.hasOwnProperty.call(message, "locale")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.locale); return writer; }; /** - * Encodes the specified ButtonsMessage message, length delimited. Does not implicitly {@link proto.ButtonsMessage.verify|verify} messages. + * Encodes the specified LocaleSetting message, length delimited. Does not implicitly {@link proto.LocaleSetting.verify|verify} messages. * @function encodeDelimited - * @memberof proto.ButtonsMessage + * @memberof proto.LocaleSetting * @static - * @param {proto.IButtonsMessage} message ButtonsMessage message or plain object to encode + * @param {proto.ILocaleSetting} message LocaleSetting message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ButtonsMessage.encodeDelimited = function encodeDelimited(message, writer) { + LocaleSetting.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ButtonsMessage message from the specified reader or buffer. + * Decodes a LocaleSetting message from the specified reader or buffer. * @function decode - * @memberof proto.ButtonsMessage + * @memberof proto.LocaleSetting * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {proto.ButtonsMessage} ButtonsMessage + * @returns {proto.LocaleSetting} LocaleSetting * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ButtonsMessage.decode = function decode(reader, length) { + LocaleSetting.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.ButtonsMessage(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.LocaleSetting(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 6: - message.contentText = reader.string(); - break; - case 7: - message.footerText = reader.string(); + case 1: + message.locale = reader.string(); break; - case 8: - message.contextInfo = $root.proto.ContextInfo.decode(reader, reader.uint32()); - break; - case 9: - if (!(message.buttons && message.buttons.length)) - message.buttons = []; - message.buttons.push($root.proto.Button.decode(reader, reader.uint32())); - break; - case 10: - message.headerType = reader.int32(); - break; - case 1: - message.text = reader.string(); - break; - case 2: - message.documentMessage = $root.proto.DocumentMessage.decode(reader, reader.uint32()); - break; - case 3: - message.imageMessage = $root.proto.ImageMessage.decode(reader, reader.uint32()); - break; - case 4: - message.videoMessage = $root.proto.VideoMessage.decode(reader, reader.uint32()); - break; - case 5: - message.locationMessage = $root.proto.LocationMessage.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); + default: + reader.skipType(tag & 7); break; } } @@ -44524,321 +43783,108 @@ $root.proto = (function() { }; /** - * Decodes a ButtonsMessage message from the specified reader or buffer, length delimited. + * Decodes a LocaleSetting message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof proto.ButtonsMessage + * @memberof proto.LocaleSetting * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.ButtonsMessage} ButtonsMessage + * @returns {proto.LocaleSetting} LocaleSetting * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ButtonsMessage.decodeDelimited = function decodeDelimited(reader) { + LocaleSetting.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ButtonsMessage message. + * Verifies a LocaleSetting message. * @function verify - * @memberof proto.ButtonsMessage + * @memberof proto.LocaleSetting * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ButtonsMessage.verify = function verify(message) { + LocaleSetting.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - var properties = {}; - if (message.contentText != null && message.hasOwnProperty("contentText")) - if (!$util.isString(message.contentText)) - return "contentText: string expected"; - if (message.footerText != null && message.hasOwnProperty("footerText")) - if (!$util.isString(message.footerText)) - return "footerText: string expected"; - if (message.contextInfo != null && message.hasOwnProperty("contextInfo")) { - var error = $root.proto.ContextInfo.verify(message.contextInfo); - if (error) - return "contextInfo." + error; - } - if (message.buttons != null && message.hasOwnProperty("buttons")) { - if (!Array.isArray(message.buttons)) - return "buttons: array expected"; - for (var i = 0; i < message.buttons.length; ++i) { - var error = $root.proto.Button.verify(message.buttons[i]); - if (error) - return "buttons." + error; - } - } - if (message.headerType != null && message.hasOwnProperty("headerType")) - switch (message.headerType) { - default: - return "headerType: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - break; - } - if (message.text != null && message.hasOwnProperty("text")) { - properties.header = 1; - if (!$util.isString(message.text)) - return "text: string expected"; - } - if (message.documentMessage != null && message.hasOwnProperty("documentMessage")) { - if (properties.header === 1) - return "header: multiple values"; - properties.header = 1; - { - var error = $root.proto.DocumentMessage.verify(message.documentMessage); - if (error) - return "documentMessage." + error; - } - } - if (message.imageMessage != null && message.hasOwnProperty("imageMessage")) { - if (properties.header === 1) - return "header: multiple values"; - properties.header = 1; - { - var error = $root.proto.ImageMessage.verify(message.imageMessage); - if (error) - return "imageMessage." + error; - } - } - if (message.videoMessage != null && message.hasOwnProperty("videoMessage")) { - if (properties.header === 1) - return "header: multiple values"; - properties.header = 1; - { - var error = $root.proto.VideoMessage.verify(message.videoMessage); - if (error) - return "videoMessage." + error; - } - } - if (message.locationMessage != null && message.hasOwnProperty("locationMessage")) { - if (properties.header === 1) - return "header: multiple values"; - properties.header = 1; - { - var error = $root.proto.LocationMessage.verify(message.locationMessage); - if (error) - return "locationMessage." + error; - } - } + if (message.locale != null && message.hasOwnProperty("locale")) + if (!$util.isString(message.locale)) + return "locale: string expected"; return null; }; /** - * Creates a ButtonsMessage message from a plain object. Also converts values to their respective internal types. + * Creates a LocaleSetting message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof proto.ButtonsMessage + * @memberof proto.LocaleSetting * @static * @param {Object.} object Plain object - * @returns {proto.ButtonsMessage} ButtonsMessage + * @returns {proto.LocaleSetting} LocaleSetting */ - ButtonsMessage.fromObject = function fromObject(object) { - if (object instanceof $root.proto.ButtonsMessage) + LocaleSetting.fromObject = function fromObject(object) { + if (object instanceof $root.proto.LocaleSetting) return object; - var message = new $root.proto.ButtonsMessage(); - if (object.contentText != null) - message.contentText = String(object.contentText); - if (object.footerText != null) - message.footerText = String(object.footerText); - if (object.contextInfo != null) { - if (typeof object.contextInfo !== "object") - throw TypeError(".proto.ButtonsMessage.contextInfo: object expected"); - message.contextInfo = $root.proto.ContextInfo.fromObject(object.contextInfo); - } - if (object.buttons) { - if (!Array.isArray(object.buttons)) - throw TypeError(".proto.ButtonsMessage.buttons: array expected"); - message.buttons = []; - for (var i = 0; i < object.buttons.length; ++i) { - if (typeof object.buttons[i] !== "object") - throw TypeError(".proto.ButtonsMessage.buttons: object expected"); - message.buttons[i] = $root.proto.Button.fromObject(object.buttons[i]); - } - } - switch (object.headerType) { - case "UNKNOWN": - case 0: - message.headerType = 0; - break; - case "EMPTY": - case 1: - message.headerType = 1; - break; - case "TEXT": - case 2: - message.headerType = 2; - break; - case "DOCUMENT": - case 3: - message.headerType = 3; - break; - case "IMAGE": - case 4: - message.headerType = 4; - break; - case "VIDEO": - case 5: - message.headerType = 5; - break; - case "LOCATION": - case 6: - message.headerType = 6; - break; - } - if (object.text != null) - message.text = String(object.text); - if (object.documentMessage != null) { - if (typeof object.documentMessage !== "object") - throw TypeError(".proto.ButtonsMessage.documentMessage: object expected"); - message.documentMessage = $root.proto.DocumentMessage.fromObject(object.documentMessage); - } - if (object.imageMessage != null) { - if (typeof object.imageMessage !== "object") - throw TypeError(".proto.ButtonsMessage.imageMessage: object expected"); - message.imageMessage = $root.proto.ImageMessage.fromObject(object.imageMessage); - } - if (object.videoMessage != null) { - if (typeof object.videoMessage !== "object") - throw TypeError(".proto.ButtonsMessage.videoMessage: object expected"); - message.videoMessage = $root.proto.VideoMessage.fromObject(object.videoMessage); - } - if (object.locationMessage != null) { - if (typeof object.locationMessage !== "object") - throw TypeError(".proto.ButtonsMessage.locationMessage: object expected"); - message.locationMessage = $root.proto.LocationMessage.fromObject(object.locationMessage); - } + var message = new $root.proto.LocaleSetting(); + if (object.locale != null) + message.locale = String(object.locale); return message; }; /** - * Creates a plain object from a ButtonsMessage message. Also converts values to other types if specified. + * Creates a plain object from a LocaleSetting message. Also converts values to other types if specified. * @function toObject - * @memberof proto.ButtonsMessage + * @memberof proto.LocaleSetting * @static - * @param {proto.ButtonsMessage} message ButtonsMessage + * @param {proto.LocaleSetting} message LocaleSetting * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ButtonsMessage.toObject = function toObject(message, options) { + LocaleSetting.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.buttons = []; - if (options.defaults) { - object.contentText = ""; - object.footerText = ""; - object.contextInfo = null; - object.headerType = options.enums === String ? "UNKNOWN" : 0; - } - if (message.text != null && message.hasOwnProperty("text")) { - object.text = message.text; - if (options.oneofs) - object.header = "text"; - } - if (message.documentMessage != null && message.hasOwnProperty("documentMessage")) { - object.documentMessage = $root.proto.DocumentMessage.toObject(message.documentMessage, options); - if (options.oneofs) - object.header = "documentMessage"; - } - if (message.imageMessage != null && message.hasOwnProperty("imageMessage")) { - object.imageMessage = $root.proto.ImageMessage.toObject(message.imageMessage, options); - if (options.oneofs) - object.header = "imageMessage"; - } - if (message.videoMessage != null && message.hasOwnProperty("videoMessage")) { - object.videoMessage = $root.proto.VideoMessage.toObject(message.videoMessage, options); - if (options.oneofs) - object.header = "videoMessage"; - } - if (message.locationMessage != null && message.hasOwnProperty("locationMessage")) { - object.locationMessage = $root.proto.LocationMessage.toObject(message.locationMessage, options); - if (options.oneofs) - object.header = "locationMessage"; - } - if (message.contentText != null && message.hasOwnProperty("contentText")) - object.contentText = message.contentText; - if (message.footerText != null && message.hasOwnProperty("footerText")) - object.footerText = message.footerText; - if (message.contextInfo != null && message.hasOwnProperty("contextInfo")) - object.contextInfo = $root.proto.ContextInfo.toObject(message.contextInfo, options); - if (message.buttons && message.buttons.length) { - object.buttons = []; - for (var j = 0; j < message.buttons.length; ++j) - object.buttons[j] = $root.proto.Button.toObject(message.buttons[j], options); - } - if (message.headerType != null && message.hasOwnProperty("headerType")) - object.headerType = options.enums === String ? $root.proto.ButtonsMessage.ButtonsMessageHeaderType[message.headerType] : message.headerType; + if (options.defaults) + object.locale = ""; + if (message.locale != null && message.hasOwnProperty("locale")) + object.locale = message.locale; return object; }; /** - * Converts this ButtonsMessage to JSON. + * Converts this LocaleSetting to JSON. * @function toJSON - * @memberof proto.ButtonsMessage + * @memberof proto.LocaleSetting * @instance * @returns {Object.} JSON object */ - ButtonsMessage.prototype.toJSON = function toJSON() { + LocaleSetting.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - /** - * ButtonsMessageHeaderType enum. - * @name proto.ButtonsMessage.ButtonsMessageHeaderType - * @enum {number} - * @property {number} UNKNOWN=0 UNKNOWN value - * @property {number} EMPTY=1 EMPTY value - * @property {number} TEXT=2 TEXT value - * @property {number} DOCUMENT=3 DOCUMENT value - * @property {number} IMAGE=4 IMAGE value - * @property {number} VIDEO=5 VIDEO value - * @property {number} LOCATION=6 LOCATION value - */ - ButtonsMessage.ButtonsMessageHeaderType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "UNKNOWN"] = 0; - values[valuesById[1] = "EMPTY"] = 1; - values[valuesById[2] = "TEXT"] = 2; - values[valuesById[3] = "DOCUMENT"] = 3; - values[valuesById[4] = "IMAGE"] = 4; - values[valuesById[5] = "VIDEO"] = 5; - values[valuesById[6] = "LOCATION"] = 6; - return values; - })(); - - return ButtonsMessage; + return LocaleSetting; })(); - proto.ButtonsResponseMessage = (function() { + proto.MarkChatAsReadAction = (function() { /** - * Properties of a ButtonsResponseMessage. + * Properties of a MarkChatAsReadAction. * @memberof proto - * @interface IButtonsResponseMessage - * @property {string|null} [selectedButtonId] ButtonsResponseMessage selectedButtonId - * @property {proto.IContextInfo|null} [contextInfo] ButtonsResponseMessage contextInfo - * @property {proto.ButtonsResponseMessage.ButtonsResponseMessageType|null} [type] ButtonsResponseMessage type - * @property {string|null} [selectedDisplayText] ButtonsResponseMessage selectedDisplayText + * @interface IMarkChatAsReadAction + * @property {boolean|null} [read] MarkChatAsReadAction read + * @property {proto.ISyncActionMessageRange|null} [messageRange] MarkChatAsReadAction messageRange */ /** - * Constructs a new ButtonsResponseMessage. + * Constructs a new MarkChatAsReadAction. * @memberof proto - * @classdesc Represents a ButtonsResponseMessage. - * @implements IButtonsResponseMessage + * @classdesc Represents a MarkChatAsReadAction. + * @implements IMarkChatAsReadAction * @constructor - * @param {proto.IButtonsResponseMessage=} [properties] Properties to set + * @param {proto.IMarkChatAsReadAction=} [properties] Properties to set */ - function ButtonsResponseMessage(properties) { + function MarkChatAsReadAction(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -44846,128 +43892,88 @@ $root.proto = (function() { } /** - * ButtonsResponseMessage selectedButtonId. - * @member {string} selectedButtonId - * @memberof proto.ButtonsResponseMessage - * @instance - */ - ButtonsResponseMessage.prototype.selectedButtonId = ""; - - /** - * ButtonsResponseMessage contextInfo. - * @member {proto.IContextInfo|null|undefined} contextInfo - * @memberof proto.ButtonsResponseMessage - * @instance - */ - ButtonsResponseMessage.prototype.contextInfo = null; - - /** - * ButtonsResponseMessage type. - * @member {proto.ButtonsResponseMessage.ButtonsResponseMessageType} type - * @memberof proto.ButtonsResponseMessage - * @instance - */ - ButtonsResponseMessage.prototype.type = 0; - - /** - * ButtonsResponseMessage selectedDisplayText. - * @member {string|null|undefined} selectedDisplayText - * @memberof proto.ButtonsResponseMessage + * MarkChatAsReadAction read. + * @member {boolean} read + * @memberof proto.MarkChatAsReadAction * @instance */ - ButtonsResponseMessage.prototype.selectedDisplayText = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + MarkChatAsReadAction.prototype.read = false; /** - * ButtonsResponseMessage response. - * @member {"selectedDisplayText"|undefined} response - * @memberof proto.ButtonsResponseMessage + * MarkChatAsReadAction messageRange. + * @member {proto.ISyncActionMessageRange|null|undefined} messageRange + * @memberof proto.MarkChatAsReadAction * @instance */ - Object.defineProperty(ButtonsResponseMessage.prototype, "response", { - get: $util.oneOfGetter($oneOfFields = ["selectedDisplayText"]), - set: $util.oneOfSetter($oneOfFields) - }); + MarkChatAsReadAction.prototype.messageRange = null; /** - * Creates a new ButtonsResponseMessage instance using the specified properties. + * Creates a new MarkChatAsReadAction instance using the specified properties. * @function create - * @memberof proto.ButtonsResponseMessage + * @memberof proto.MarkChatAsReadAction * @static - * @param {proto.IButtonsResponseMessage=} [properties] Properties to set - * @returns {proto.ButtonsResponseMessage} ButtonsResponseMessage instance + * @param {proto.IMarkChatAsReadAction=} [properties] Properties to set + * @returns {proto.MarkChatAsReadAction} MarkChatAsReadAction instance */ - ButtonsResponseMessage.create = function create(properties) { - return new ButtonsResponseMessage(properties); + MarkChatAsReadAction.create = function create(properties) { + return new MarkChatAsReadAction(properties); }; /** - * Encodes the specified ButtonsResponseMessage message. Does not implicitly {@link proto.ButtonsResponseMessage.verify|verify} messages. + * Encodes the specified MarkChatAsReadAction message. Does not implicitly {@link proto.MarkChatAsReadAction.verify|verify} messages. * @function encode - * @memberof proto.ButtonsResponseMessage + * @memberof proto.MarkChatAsReadAction * @static - * @param {proto.IButtonsResponseMessage} message ButtonsResponseMessage message or plain object to encode + * @param {proto.IMarkChatAsReadAction} message MarkChatAsReadAction message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ButtonsResponseMessage.encode = function encode(message, writer) { + MarkChatAsReadAction.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.selectedButtonId != null && Object.hasOwnProperty.call(message, "selectedButtonId")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.selectedButtonId); - if (message.selectedDisplayText != null && Object.hasOwnProperty.call(message, "selectedDisplayText")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.selectedDisplayText); - if (message.contextInfo != null && Object.hasOwnProperty.call(message, "contextInfo")) - $root.proto.ContextInfo.encode(message.contextInfo, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.type); + if (message.read != null && Object.hasOwnProperty.call(message, "read")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.read); + if (message.messageRange != null && Object.hasOwnProperty.call(message, "messageRange")) + $root.proto.SyncActionMessageRange.encode(message.messageRange, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** - * Encodes the specified ButtonsResponseMessage message, length delimited. Does not implicitly {@link proto.ButtonsResponseMessage.verify|verify} messages. + * Encodes the specified MarkChatAsReadAction message, length delimited. Does not implicitly {@link proto.MarkChatAsReadAction.verify|verify} messages. * @function encodeDelimited - * @memberof proto.ButtonsResponseMessage + * @memberof proto.MarkChatAsReadAction * @static - * @param {proto.IButtonsResponseMessage} message ButtonsResponseMessage message or plain object to encode + * @param {proto.IMarkChatAsReadAction} message MarkChatAsReadAction message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ButtonsResponseMessage.encodeDelimited = function encodeDelimited(message, writer) { + MarkChatAsReadAction.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ButtonsResponseMessage message from the specified reader or buffer. + * Decodes a MarkChatAsReadAction message from the specified reader or buffer. * @function decode - * @memberof proto.ButtonsResponseMessage + * @memberof proto.MarkChatAsReadAction * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {proto.ButtonsResponseMessage} ButtonsResponseMessage + * @returns {proto.MarkChatAsReadAction} MarkChatAsReadAction * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ButtonsResponseMessage.decode = function decode(reader, length) { + MarkChatAsReadAction.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.ButtonsResponseMessage(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.MarkChatAsReadAction(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.selectedButtonId = reader.string(); - break; - case 3: - message.contextInfo = $root.proto.ContextInfo.decode(reader, reader.uint32()); - break; - case 4: - message.type = reader.int32(); + message.read = reader.bool(); break; case 2: - message.selectedDisplayText = reader.string(); + message.messageRange = $root.proto.SyncActionMessageRange.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -44978,172 +43984,122 @@ $root.proto = (function() { }; /** - * Decodes a ButtonsResponseMessage message from the specified reader or buffer, length delimited. + * Decodes a MarkChatAsReadAction message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof proto.ButtonsResponseMessage + * @memberof proto.MarkChatAsReadAction * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.ButtonsResponseMessage} ButtonsResponseMessage + * @returns {proto.MarkChatAsReadAction} MarkChatAsReadAction * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ButtonsResponseMessage.decodeDelimited = function decodeDelimited(reader) { + MarkChatAsReadAction.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ButtonsResponseMessage message. + * Verifies a MarkChatAsReadAction message. * @function verify - * @memberof proto.ButtonsResponseMessage + * @memberof proto.MarkChatAsReadAction * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ButtonsResponseMessage.verify = function verify(message) { + MarkChatAsReadAction.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - var properties = {}; - if (message.selectedButtonId != null && message.hasOwnProperty("selectedButtonId")) - if (!$util.isString(message.selectedButtonId)) - return "selectedButtonId: string expected"; - if (message.contextInfo != null && message.hasOwnProperty("contextInfo")) { - var error = $root.proto.ContextInfo.verify(message.contextInfo); + if (message.read != null && message.hasOwnProperty("read")) + if (typeof message.read !== "boolean") + return "read: boolean expected"; + if (message.messageRange != null && message.hasOwnProperty("messageRange")) { + var error = $root.proto.SyncActionMessageRange.verify(message.messageRange); if (error) - return "contextInfo." + error; - } - if (message.type != null && message.hasOwnProperty("type")) - switch (message.type) { - default: - return "type: enum value expected"; - case 0: - case 1: - break; - } - if (message.selectedDisplayText != null && message.hasOwnProperty("selectedDisplayText")) { - properties.response = 1; - if (!$util.isString(message.selectedDisplayText)) - return "selectedDisplayText: string expected"; + return "messageRange." + error; } return null; }; /** - * Creates a ButtonsResponseMessage message from a plain object. Also converts values to their respective internal types. + * Creates a MarkChatAsReadAction message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof proto.ButtonsResponseMessage + * @memberof proto.MarkChatAsReadAction * @static * @param {Object.} object Plain object - * @returns {proto.ButtonsResponseMessage} ButtonsResponseMessage + * @returns {proto.MarkChatAsReadAction} MarkChatAsReadAction */ - ButtonsResponseMessage.fromObject = function fromObject(object) { - if (object instanceof $root.proto.ButtonsResponseMessage) + MarkChatAsReadAction.fromObject = function fromObject(object) { + if (object instanceof $root.proto.MarkChatAsReadAction) return object; - var message = new $root.proto.ButtonsResponseMessage(); - if (object.selectedButtonId != null) - message.selectedButtonId = String(object.selectedButtonId); - if (object.contextInfo != null) { - if (typeof object.contextInfo !== "object") - throw TypeError(".proto.ButtonsResponseMessage.contextInfo: object expected"); - message.contextInfo = $root.proto.ContextInfo.fromObject(object.contextInfo); - } - switch (object.type) { - case "UNKNOWN": - case 0: - message.type = 0; - break; - case "DISPLAY_TEXT": - case 1: - message.type = 1; - break; + var message = new $root.proto.MarkChatAsReadAction(); + if (object.read != null) + message.read = Boolean(object.read); + if (object.messageRange != null) { + if (typeof object.messageRange !== "object") + throw TypeError(".proto.MarkChatAsReadAction.messageRange: object expected"); + message.messageRange = $root.proto.SyncActionMessageRange.fromObject(object.messageRange); } - if (object.selectedDisplayText != null) - message.selectedDisplayText = String(object.selectedDisplayText); return message; }; /** - * Creates a plain object from a ButtonsResponseMessage message. Also converts values to other types if specified. + * Creates a plain object from a MarkChatAsReadAction message. Also converts values to other types if specified. * @function toObject - * @memberof proto.ButtonsResponseMessage + * @memberof proto.MarkChatAsReadAction * @static - * @param {proto.ButtonsResponseMessage} message ButtonsResponseMessage + * @param {proto.MarkChatAsReadAction} message MarkChatAsReadAction * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ButtonsResponseMessage.toObject = function toObject(message, options) { + MarkChatAsReadAction.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.selectedButtonId = ""; - object.contextInfo = null; - object.type = options.enums === String ? "UNKNOWN" : 0; - } - if (message.selectedButtonId != null && message.hasOwnProperty("selectedButtonId")) - object.selectedButtonId = message.selectedButtonId; - if (message.selectedDisplayText != null && message.hasOwnProperty("selectedDisplayText")) { - object.selectedDisplayText = message.selectedDisplayText; - if (options.oneofs) - object.response = "selectedDisplayText"; + object.read = false; + object.messageRange = null; } - if (message.contextInfo != null && message.hasOwnProperty("contextInfo")) - object.contextInfo = $root.proto.ContextInfo.toObject(message.contextInfo, options); - if (message.type != null && message.hasOwnProperty("type")) - object.type = options.enums === String ? $root.proto.ButtonsResponseMessage.ButtonsResponseMessageType[message.type] : message.type; + if (message.read != null && message.hasOwnProperty("read")) + object.read = message.read; + if (message.messageRange != null && message.hasOwnProperty("messageRange")) + object.messageRange = $root.proto.SyncActionMessageRange.toObject(message.messageRange, options); return object; }; /** - * Converts this ButtonsResponseMessage to JSON. + * Converts this MarkChatAsReadAction to JSON. * @function toJSON - * @memberof proto.ButtonsResponseMessage + * @memberof proto.MarkChatAsReadAction * @instance * @returns {Object.} JSON object */ - ButtonsResponseMessage.prototype.toJSON = function toJSON() { + MarkChatAsReadAction.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - /** - * ButtonsResponseMessageType enum. - * @name proto.ButtonsResponseMessage.ButtonsResponseMessageType - * @enum {number} - * @property {number} UNKNOWN=0 UNKNOWN value - * @property {number} DISPLAY_TEXT=1 DISPLAY_TEXT value - */ - ButtonsResponseMessage.ButtonsResponseMessageType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "UNKNOWN"] = 0; - values[valuesById[1] = "DISPLAY_TEXT"] = 1; - return values; - })(); - - return ButtonsResponseMessage; + return MarkChatAsReadAction; })(); - proto.ReactionMessage = (function() { + proto.MuteAction = (function() { /** - * Properties of a ReactionMessage. + * Properties of a MuteAction. * @memberof proto - * @interface IReactionMessage - * @property {proto.IMessageKey|null} [key] ReactionMessage key - * @property {string|null} [text] ReactionMessage text - * @property {string|null} [groupingKey] ReactionMessage groupingKey - * @property {number|Long|null} [senderTimestampMs] ReactionMessage senderTimestampMs + * @interface IMuteAction + * @property {boolean|null} [muted] MuteAction muted + * @property {number|Long|null} [muteEndTimestamp] MuteAction muteEndTimestamp */ /** - * Constructs a new ReactionMessage. + * Constructs a new MuteAction. * @memberof proto - * @classdesc Represents a ReactionMessage. - * @implements IReactionMessage + * @classdesc Represents a MuteAction. + * @implements IMuteAction * @constructor - * @param {proto.IReactionMessage=} [properties] Properties to set + * @param {proto.IMuteAction=} [properties] Properties to set */ - function ReactionMessage(properties) { + function MuteAction(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -45151,114 +44107,88 @@ $root.proto = (function() { } /** - * ReactionMessage key. - * @member {proto.IMessageKey|null|undefined} key - * @memberof proto.ReactionMessage - * @instance - */ - ReactionMessage.prototype.key = null; - - /** - * ReactionMessage text. - * @member {string} text - * @memberof proto.ReactionMessage - * @instance - */ - ReactionMessage.prototype.text = ""; - - /** - * ReactionMessage groupingKey. - * @member {string} groupingKey - * @memberof proto.ReactionMessage + * MuteAction muted. + * @member {boolean} muted + * @memberof proto.MuteAction * @instance */ - ReactionMessage.prototype.groupingKey = ""; + MuteAction.prototype.muted = false; /** - * ReactionMessage senderTimestampMs. - * @member {number|Long} senderTimestampMs - * @memberof proto.ReactionMessage + * MuteAction muteEndTimestamp. + * @member {number|Long} muteEndTimestamp + * @memberof proto.MuteAction * @instance */ - ReactionMessage.prototype.senderTimestampMs = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + MuteAction.prototype.muteEndTimestamp = $util.Long ? $util.Long.fromBits(0,0,false) : 0; /** - * Creates a new ReactionMessage instance using the specified properties. + * Creates a new MuteAction instance using the specified properties. * @function create - * @memberof proto.ReactionMessage + * @memberof proto.MuteAction * @static - * @param {proto.IReactionMessage=} [properties] Properties to set - * @returns {proto.ReactionMessage} ReactionMessage instance + * @param {proto.IMuteAction=} [properties] Properties to set + * @returns {proto.MuteAction} MuteAction instance */ - ReactionMessage.create = function create(properties) { - return new ReactionMessage(properties); + MuteAction.create = function create(properties) { + return new MuteAction(properties); }; /** - * Encodes the specified ReactionMessage message. Does not implicitly {@link proto.ReactionMessage.verify|verify} messages. + * Encodes the specified MuteAction message. Does not implicitly {@link proto.MuteAction.verify|verify} messages. * @function encode - * @memberof proto.ReactionMessage + * @memberof proto.MuteAction * @static - * @param {proto.IReactionMessage} message ReactionMessage message or plain object to encode + * @param {proto.IMuteAction} message MuteAction message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ReactionMessage.encode = function encode(message, writer) { + MuteAction.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.key != null && Object.hasOwnProperty.call(message, "key")) - $root.proto.MessageKey.encode(message.key, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.text != null && Object.hasOwnProperty.call(message, "text")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.text); - if (message.groupingKey != null && Object.hasOwnProperty.call(message, "groupingKey")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.groupingKey); - if (message.senderTimestampMs != null && Object.hasOwnProperty.call(message, "senderTimestampMs")) - writer.uint32(/* id 4, wireType 0 =*/32).int64(message.senderTimestampMs); + if (message.muted != null && Object.hasOwnProperty.call(message, "muted")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.muted); + if (message.muteEndTimestamp != null && Object.hasOwnProperty.call(message, "muteEndTimestamp")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.muteEndTimestamp); return writer; }; /** - * Encodes the specified ReactionMessage message, length delimited. Does not implicitly {@link proto.ReactionMessage.verify|verify} messages. + * Encodes the specified MuteAction message, length delimited. Does not implicitly {@link proto.MuteAction.verify|verify} messages. * @function encodeDelimited - * @memberof proto.ReactionMessage + * @memberof proto.MuteAction * @static - * @param {proto.IReactionMessage} message ReactionMessage message or plain object to encode + * @param {proto.IMuteAction} message MuteAction message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ReactionMessage.encodeDelimited = function encodeDelimited(message, writer) { + MuteAction.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ReactionMessage message from the specified reader or buffer. + * Decodes a MuteAction message from the specified reader or buffer. * @function decode - * @memberof proto.ReactionMessage + * @memberof proto.MuteAction * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {proto.ReactionMessage} ReactionMessage + * @returns {proto.MuteAction} MuteAction * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ReactionMessage.decode = function decode(reader, length) { + MuteAction.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.ReactionMessage(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.MuteAction(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.key = $root.proto.MessageKey.decode(reader, reader.uint32()); + message.muted = reader.bool(); break; case 2: - message.text = reader.string(); - break; - case 3: - message.groupingKey = reader.string(); - break; - case 4: - message.senderTimestampMs = reader.int64(); + message.muteEndTimestamp = reader.int64(); break; default: reader.skipType(tag & 7); @@ -45269,154 +44199,130 @@ $root.proto = (function() { }; /** - * Decodes a ReactionMessage message from the specified reader or buffer, length delimited. + * Decodes a MuteAction message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof proto.ReactionMessage + * @memberof proto.MuteAction * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.ReactionMessage} ReactionMessage + * @returns {proto.MuteAction} MuteAction * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ReactionMessage.decodeDelimited = function decodeDelimited(reader) { + MuteAction.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ReactionMessage message. + * Verifies a MuteAction message. * @function verify - * @memberof proto.ReactionMessage + * @memberof proto.MuteAction * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ReactionMessage.verify = function verify(message) { + MuteAction.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.key != null && message.hasOwnProperty("key")) { - var error = $root.proto.MessageKey.verify(message.key); - if (error) - return "key." + error; - } - if (message.text != null && message.hasOwnProperty("text")) - if (!$util.isString(message.text)) - return "text: string expected"; - if (message.groupingKey != null && message.hasOwnProperty("groupingKey")) - if (!$util.isString(message.groupingKey)) - return "groupingKey: string expected"; - if (message.senderTimestampMs != null && message.hasOwnProperty("senderTimestampMs")) - if (!$util.isInteger(message.senderTimestampMs) && !(message.senderTimestampMs && $util.isInteger(message.senderTimestampMs.low) && $util.isInteger(message.senderTimestampMs.high))) - return "senderTimestampMs: integer|Long expected"; + if (message.muted != null && message.hasOwnProperty("muted")) + if (typeof message.muted !== "boolean") + return "muted: boolean expected"; + if (message.muteEndTimestamp != null && message.hasOwnProperty("muteEndTimestamp")) + if (!$util.isInteger(message.muteEndTimestamp) && !(message.muteEndTimestamp && $util.isInteger(message.muteEndTimestamp.low) && $util.isInteger(message.muteEndTimestamp.high))) + return "muteEndTimestamp: integer|Long expected"; return null; }; /** - * Creates a ReactionMessage message from a plain object. Also converts values to their respective internal types. + * Creates a MuteAction message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof proto.ReactionMessage + * @memberof proto.MuteAction * @static * @param {Object.} object Plain object - * @returns {proto.ReactionMessage} ReactionMessage + * @returns {proto.MuteAction} MuteAction */ - ReactionMessage.fromObject = function fromObject(object) { - if (object instanceof $root.proto.ReactionMessage) + MuteAction.fromObject = function fromObject(object) { + if (object instanceof $root.proto.MuteAction) return object; - var message = new $root.proto.ReactionMessage(); - if (object.key != null) { - if (typeof object.key !== "object") - throw TypeError(".proto.ReactionMessage.key: object expected"); - message.key = $root.proto.MessageKey.fromObject(object.key); - } - if (object.text != null) - message.text = String(object.text); - if (object.groupingKey != null) - message.groupingKey = String(object.groupingKey); - if (object.senderTimestampMs != null) + var message = new $root.proto.MuteAction(); + if (object.muted != null) + message.muted = Boolean(object.muted); + if (object.muteEndTimestamp != null) if ($util.Long) - (message.senderTimestampMs = $util.Long.fromValue(object.senderTimestampMs)).unsigned = false; - else if (typeof object.senderTimestampMs === "string") - message.senderTimestampMs = parseInt(object.senderTimestampMs, 10); - else if (typeof object.senderTimestampMs === "number") - message.senderTimestampMs = object.senderTimestampMs; - else if (typeof object.senderTimestampMs === "object") - message.senderTimestampMs = new $util.LongBits(object.senderTimestampMs.low >>> 0, object.senderTimestampMs.high >>> 0).toNumber(); + (message.muteEndTimestamp = $util.Long.fromValue(object.muteEndTimestamp)).unsigned = false; + else if (typeof object.muteEndTimestamp === "string") + message.muteEndTimestamp = parseInt(object.muteEndTimestamp, 10); + else if (typeof object.muteEndTimestamp === "number") + message.muteEndTimestamp = object.muteEndTimestamp; + else if (typeof object.muteEndTimestamp === "object") + message.muteEndTimestamp = new $util.LongBits(object.muteEndTimestamp.low >>> 0, object.muteEndTimestamp.high >>> 0).toNumber(); return message; }; /** - * Creates a plain object from a ReactionMessage message. Also converts values to other types if specified. + * Creates a plain object from a MuteAction message. Also converts values to other types if specified. * @function toObject - * @memberof proto.ReactionMessage + * @memberof proto.MuteAction * @static - * @param {proto.ReactionMessage} message ReactionMessage + * @param {proto.MuteAction} message MuteAction * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ReactionMessage.toObject = function toObject(message, options) { + MuteAction.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.key = null; - object.text = ""; - object.groupingKey = ""; + object.muted = false; if ($util.Long) { var long = new $util.Long(0, 0, false); - object.senderTimestampMs = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + object.muteEndTimestamp = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; } else - object.senderTimestampMs = options.longs === String ? "0" : 0; + object.muteEndTimestamp = options.longs === String ? "0" : 0; } - if (message.key != null && message.hasOwnProperty("key")) - object.key = $root.proto.MessageKey.toObject(message.key, options); - if (message.text != null && message.hasOwnProperty("text")) - object.text = message.text; - if (message.groupingKey != null && message.hasOwnProperty("groupingKey")) - object.groupingKey = message.groupingKey; - if (message.senderTimestampMs != null && message.hasOwnProperty("senderTimestampMs")) - if (typeof message.senderTimestampMs === "number") - object.senderTimestampMs = options.longs === String ? String(message.senderTimestampMs) : message.senderTimestampMs; + if (message.muted != null && message.hasOwnProperty("muted")) + object.muted = message.muted; + if (message.muteEndTimestamp != null && message.hasOwnProperty("muteEndTimestamp")) + if (typeof message.muteEndTimestamp === "number") + object.muteEndTimestamp = options.longs === String ? String(message.muteEndTimestamp) : message.muteEndTimestamp; else - object.senderTimestampMs = options.longs === String ? $util.Long.prototype.toString.call(message.senderTimestampMs) : options.longs === Number ? new $util.LongBits(message.senderTimestampMs.low >>> 0, message.senderTimestampMs.high >>> 0).toNumber() : message.senderTimestampMs; + object.muteEndTimestamp = options.longs === String ? $util.Long.prototype.toString.call(message.muteEndTimestamp) : options.longs === Number ? new $util.LongBits(message.muteEndTimestamp.low >>> 0, message.muteEndTimestamp.high >>> 0).toNumber() : message.muteEndTimestamp; return object; }; /** - * Converts this ReactionMessage to JSON. + * Converts this MuteAction to JSON. * @function toJSON - * @memberof proto.ReactionMessage + * @memberof proto.MuteAction * @instance * @returns {Object.} JSON object */ - ReactionMessage.prototype.toJSON = function toJSON() { + MuteAction.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ReactionMessage; + return MuteAction; })(); - proto.StickerSyncRMRMessage = (function() { + proto.PinAction = (function() { /** - * Properties of a StickerSyncRMRMessage. + * Properties of a PinAction. * @memberof proto - * @interface IStickerSyncRMRMessage - * @property {Array.|null} [filehash] StickerSyncRMRMessage filehash - * @property {string|null} [rmrSource] StickerSyncRMRMessage rmrSource - * @property {number|Long|null} [requestTimestamp] StickerSyncRMRMessage requestTimestamp + * @interface IPinAction + * @property {boolean|null} [pinned] PinAction pinned */ /** - * Constructs a new StickerSyncRMRMessage. + * Constructs a new PinAction. * @memberof proto - * @classdesc Represents a StickerSyncRMRMessage. - * @implements IStickerSyncRMRMessage + * @classdesc Represents a PinAction. + * @implements IPinAction * @constructor - * @param {proto.IStickerSyncRMRMessage=} [properties] Properties to set + * @param {proto.IPinAction=} [properties] Properties to set */ - function StickerSyncRMRMessage(properties) { - this.filehash = []; + function PinAction(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -45424,104 +44330,75 @@ $root.proto = (function() { } /** - * StickerSyncRMRMessage filehash. - * @member {Array.} filehash - * @memberof proto.StickerSyncRMRMessage - * @instance - */ - StickerSyncRMRMessage.prototype.filehash = $util.emptyArray; - - /** - * StickerSyncRMRMessage rmrSource. - * @member {string} rmrSource - * @memberof proto.StickerSyncRMRMessage - * @instance - */ - StickerSyncRMRMessage.prototype.rmrSource = ""; - - /** - * StickerSyncRMRMessage requestTimestamp. - * @member {number|Long} requestTimestamp - * @memberof proto.StickerSyncRMRMessage + * PinAction pinned. + * @member {boolean} pinned + * @memberof proto.PinAction * @instance */ - StickerSyncRMRMessage.prototype.requestTimestamp = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + PinAction.prototype.pinned = false; /** - * Creates a new StickerSyncRMRMessage instance using the specified properties. + * Creates a new PinAction instance using the specified properties. * @function create - * @memberof proto.StickerSyncRMRMessage + * @memberof proto.PinAction * @static - * @param {proto.IStickerSyncRMRMessage=} [properties] Properties to set - * @returns {proto.StickerSyncRMRMessage} StickerSyncRMRMessage instance + * @param {proto.IPinAction=} [properties] Properties to set + * @returns {proto.PinAction} PinAction instance */ - StickerSyncRMRMessage.create = function create(properties) { - return new StickerSyncRMRMessage(properties); + PinAction.create = function create(properties) { + return new PinAction(properties); }; /** - * Encodes the specified StickerSyncRMRMessage message. Does not implicitly {@link proto.StickerSyncRMRMessage.verify|verify} messages. + * Encodes the specified PinAction message. Does not implicitly {@link proto.PinAction.verify|verify} messages. * @function encode - * @memberof proto.StickerSyncRMRMessage + * @memberof proto.PinAction * @static - * @param {proto.IStickerSyncRMRMessage} message StickerSyncRMRMessage message or plain object to encode + * @param {proto.IPinAction} message PinAction message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - StickerSyncRMRMessage.encode = function encode(message, writer) { + PinAction.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.filehash != null && message.filehash.length) - for (var i = 0; i < message.filehash.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.filehash[i]); - if (message.rmrSource != null && Object.hasOwnProperty.call(message, "rmrSource")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.rmrSource); - if (message.requestTimestamp != null && Object.hasOwnProperty.call(message, "requestTimestamp")) - writer.uint32(/* id 3, wireType 0 =*/24).int64(message.requestTimestamp); + if (message.pinned != null && Object.hasOwnProperty.call(message, "pinned")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.pinned); return writer; }; /** - * Encodes the specified StickerSyncRMRMessage message, length delimited. Does not implicitly {@link proto.StickerSyncRMRMessage.verify|verify} messages. + * Encodes the specified PinAction message, length delimited. Does not implicitly {@link proto.PinAction.verify|verify} messages. * @function encodeDelimited - * @memberof proto.StickerSyncRMRMessage + * @memberof proto.PinAction * @static - * @param {proto.IStickerSyncRMRMessage} message StickerSyncRMRMessage message or plain object to encode + * @param {proto.IPinAction} message PinAction message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - StickerSyncRMRMessage.encodeDelimited = function encodeDelimited(message, writer) { + PinAction.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a StickerSyncRMRMessage message from the specified reader or buffer. + * Decodes a PinAction message from the specified reader or buffer. * @function decode - * @memberof proto.StickerSyncRMRMessage + * @memberof proto.PinAction * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {proto.StickerSyncRMRMessage} StickerSyncRMRMessage + * @returns {proto.PinAction} PinAction * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - StickerSyncRMRMessage.decode = function decode(reader, length) { + PinAction.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.StickerSyncRMRMessage(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.PinAction(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - if (!(message.filehash && message.filehash.length)) - message.filehash = []; - message.filehash.push(reader.string()); - break; - case 2: - message.rmrSource = reader.string(); - break; - case 3: - message.requestTimestamp = reader.int64(); + message.pinned = reader.bool(); break; default: reader.skipType(tag & 7); @@ -45532,189 +44409,108 @@ $root.proto = (function() { }; /** - * Decodes a StickerSyncRMRMessage message from the specified reader or buffer, length delimited. + * Decodes a PinAction message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof proto.StickerSyncRMRMessage + * @memberof proto.PinAction * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.StickerSyncRMRMessage} StickerSyncRMRMessage + * @returns {proto.PinAction} PinAction * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - StickerSyncRMRMessage.decodeDelimited = function decodeDelimited(reader) { + PinAction.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a StickerSyncRMRMessage message. + * Verifies a PinAction message. * @function verify - * @memberof proto.StickerSyncRMRMessage + * @memberof proto.PinAction * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - StickerSyncRMRMessage.verify = function verify(message) { + PinAction.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.filehash != null && message.hasOwnProperty("filehash")) { - if (!Array.isArray(message.filehash)) - return "filehash: array expected"; - for (var i = 0; i < message.filehash.length; ++i) - if (!$util.isString(message.filehash[i])) - return "filehash: string[] expected"; - } - if (message.rmrSource != null && message.hasOwnProperty("rmrSource")) - if (!$util.isString(message.rmrSource)) - return "rmrSource: string expected"; - if (message.requestTimestamp != null && message.hasOwnProperty("requestTimestamp")) - if (!$util.isInteger(message.requestTimestamp) && !(message.requestTimestamp && $util.isInteger(message.requestTimestamp.low) && $util.isInteger(message.requestTimestamp.high))) - return "requestTimestamp: integer|Long expected"; + if (message.pinned != null && message.hasOwnProperty("pinned")) + if (typeof message.pinned !== "boolean") + return "pinned: boolean expected"; return null; }; /** - * Creates a StickerSyncRMRMessage message from a plain object. Also converts values to their respective internal types. + * Creates a PinAction message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof proto.StickerSyncRMRMessage + * @memberof proto.PinAction * @static * @param {Object.} object Plain object - * @returns {proto.StickerSyncRMRMessage} StickerSyncRMRMessage + * @returns {proto.PinAction} PinAction */ - StickerSyncRMRMessage.fromObject = function fromObject(object) { - if (object instanceof $root.proto.StickerSyncRMRMessage) + PinAction.fromObject = function fromObject(object) { + if (object instanceof $root.proto.PinAction) return object; - var message = new $root.proto.StickerSyncRMRMessage(); - if (object.filehash) { - if (!Array.isArray(object.filehash)) - throw TypeError(".proto.StickerSyncRMRMessage.filehash: array expected"); - message.filehash = []; - for (var i = 0; i < object.filehash.length; ++i) - message.filehash[i] = String(object.filehash[i]); - } - if (object.rmrSource != null) - message.rmrSource = String(object.rmrSource); - if (object.requestTimestamp != null) - if ($util.Long) - (message.requestTimestamp = $util.Long.fromValue(object.requestTimestamp)).unsigned = false; - else if (typeof object.requestTimestamp === "string") - message.requestTimestamp = parseInt(object.requestTimestamp, 10); - else if (typeof object.requestTimestamp === "number") - message.requestTimestamp = object.requestTimestamp; - else if (typeof object.requestTimestamp === "object") - message.requestTimestamp = new $util.LongBits(object.requestTimestamp.low >>> 0, object.requestTimestamp.high >>> 0).toNumber(); + var message = new $root.proto.PinAction(); + if (object.pinned != null) + message.pinned = Boolean(object.pinned); return message; }; /** - * Creates a plain object from a StickerSyncRMRMessage message. Also converts values to other types if specified. + * Creates a plain object from a PinAction message. Also converts values to other types if specified. * @function toObject - * @memberof proto.StickerSyncRMRMessage + * @memberof proto.PinAction * @static - * @param {proto.StickerSyncRMRMessage} message StickerSyncRMRMessage + * @param {proto.PinAction} message PinAction * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - StickerSyncRMRMessage.toObject = function toObject(message, options) { + PinAction.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.filehash = []; - if (options.defaults) { - object.rmrSource = ""; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.requestTimestamp = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.requestTimestamp = options.longs === String ? "0" : 0; - } - if (message.filehash && message.filehash.length) { - object.filehash = []; - for (var j = 0; j < message.filehash.length; ++j) - object.filehash[j] = message.filehash[j]; - } - if (message.rmrSource != null && message.hasOwnProperty("rmrSource")) - object.rmrSource = message.rmrSource; - if (message.requestTimestamp != null && message.hasOwnProperty("requestTimestamp")) - if (typeof message.requestTimestamp === "number") - object.requestTimestamp = options.longs === String ? String(message.requestTimestamp) : message.requestTimestamp; - else - object.requestTimestamp = options.longs === String ? $util.Long.prototype.toString.call(message.requestTimestamp) : options.longs === Number ? new $util.LongBits(message.requestTimestamp.low >>> 0, message.requestTimestamp.high >>> 0).toNumber() : message.requestTimestamp; + if (options.defaults) + object.pinned = false; + if (message.pinned != null && message.hasOwnProperty("pinned")) + object.pinned = message.pinned; return object; }; /** - * Converts this StickerSyncRMRMessage to JSON. + * Converts this PinAction to JSON. * @function toJSON - * @memberof proto.StickerSyncRMRMessage + * @memberof proto.PinAction * @instance * @returns {Object.} JSON object */ - StickerSyncRMRMessage.prototype.toJSON = function toJSON() { + PinAction.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return StickerSyncRMRMessage; + return PinAction; })(); - proto.Message = (function() { + proto.PrimaryFeature = (function() { /** - * Properties of a Message. + * Properties of a PrimaryFeature. * @memberof proto - * @interface IMessage - * @property {string|null} [conversation] Message conversation - * @property {proto.ISenderKeyDistributionMessage|null} [senderKeyDistributionMessage] Message senderKeyDistributionMessage - * @property {proto.IImageMessage|null} [imageMessage] Message imageMessage - * @property {proto.IContactMessage|null} [contactMessage] Message contactMessage - * @property {proto.ILocationMessage|null} [locationMessage] Message locationMessage - * @property {proto.IExtendedTextMessage|null} [extendedTextMessage] Message extendedTextMessage - * @property {proto.IDocumentMessage|null} [documentMessage] Message documentMessage - * @property {proto.IAudioMessage|null} [audioMessage] Message audioMessage - * @property {proto.IVideoMessage|null} [videoMessage] Message videoMessage - * @property {proto.ICall|null} [call] Message call - * @property {proto.IChat|null} [chat] Message chat - * @property {proto.IProtocolMessage|null} [protocolMessage] Message protocolMessage - * @property {proto.IContactsArrayMessage|null} [contactsArrayMessage] Message contactsArrayMessage - * @property {proto.IHighlyStructuredMessage|null} [highlyStructuredMessage] Message highlyStructuredMessage - * @property {proto.ISenderKeyDistributionMessage|null} [fastRatchetKeySenderKeyDistributionMessage] Message fastRatchetKeySenderKeyDistributionMessage - * @property {proto.ISendPaymentMessage|null} [sendPaymentMessage] Message sendPaymentMessage - * @property {proto.ILiveLocationMessage|null} [liveLocationMessage] Message liveLocationMessage - * @property {proto.IRequestPaymentMessage|null} [requestPaymentMessage] Message requestPaymentMessage - * @property {proto.IDeclinePaymentRequestMessage|null} [declinePaymentRequestMessage] Message declinePaymentRequestMessage - * @property {proto.ICancelPaymentRequestMessage|null} [cancelPaymentRequestMessage] Message cancelPaymentRequestMessage - * @property {proto.ITemplateMessage|null} [templateMessage] Message templateMessage - * @property {proto.IStickerMessage|null} [stickerMessage] Message stickerMessage - * @property {proto.IGroupInviteMessage|null} [groupInviteMessage] Message groupInviteMessage - * @property {proto.ITemplateButtonReplyMessage|null} [templateButtonReplyMessage] Message templateButtonReplyMessage - * @property {proto.IProductMessage|null} [productMessage] Message productMessage - * @property {proto.IDeviceSentMessage|null} [deviceSentMessage] Message deviceSentMessage - * @property {proto.IMessageContextInfo|null} [messageContextInfo] Message messageContextInfo - * @property {proto.IListMessage|null} [listMessage] Message listMessage - * @property {proto.IFutureProofMessage|null} [viewOnceMessage] Message viewOnceMessage - * @property {proto.IOrderMessage|null} [orderMessage] Message orderMessage - * @property {proto.IListResponseMessage|null} [listResponseMessage] Message listResponseMessage - * @property {proto.IFutureProofMessage|null} [ephemeralMessage] Message ephemeralMessage - * @property {proto.IInvoiceMessage|null} [invoiceMessage] Message invoiceMessage - * @property {proto.IButtonsMessage|null} [buttonsMessage] Message buttonsMessage - * @property {proto.IButtonsResponseMessage|null} [buttonsResponseMessage] Message buttonsResponseMessage - * @property {proto.IPaymentInviteMessage|null} [paymentInviteMessage] Message paymentInviteMessage - * @property {proto.IInteractiveMessage|null} [interactiveMessage] Message interactiveMessage - * @property {proto.IReactionMessage|null} [reactionMessage] Message reactionMessage - * @property {proto.IStickerSyncRMRMessage|null} [stickerSyncRmrMessage] Message stickerSyncRmrMessage + * @interface IPrimaryFeature + * @property {Array.|null} [flags] PrimaryFeature flags */ /** - * Constructs a new Message. + * Constructs a new PrimaryFeature. * @memberof proto - * @classdesc Represents a Message. - * @implements IMessage + * @classdesc Represents a PrimaryFeature. + * @implements IPrimaryFeature * @constructor - * @param {proto.IMessage=} [properties] Properties to set + * @param {proto.IPrimaryFeature=} [properties] Properties to set */ - function Message(properties) { + function PrimaryFeature(properties) { + this.flags = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -45722,569 +44518,771 @@ $root.proto = (function() { } /** - * Message conversation. - * @member {string} conversation - * @memberof proto.Message + * PrimaryFeature flags. + * @member {Array.} flags + * @memberof proto.PrimaryFeature * @instance */ - Message.prototype.conversation = ""; + PrimaryFeature.prototype.flags = $util.emptyArray; /** - * Message senderKeyDistributionMessage. - * @member {proto.ISenderKeyDistributionMessage|null|undefined} senderKeyDistributionMessage - * @memberof proto.Message - * @instance + * Creates a new PrimaryFeature instance using the specified properties. + * @function create + * @memberof proto.PrimaryFeature + * @static + * @param {proto.IPrimaryFeature=} [properties] Properties to set + * @returns {proto.PrimaryFeature} PrimaryFeature instance */ - Message.prototype.senderKeyDistributionMessage = null; + PrimaryFeature.create = function create(properties) { + return new PrimaryFeature(properties); + }; /** - * Message imageMessage. - * @member {proto.IImageMessage|null|undefined} imageMessage - * @memberof proto.Message - * @instance + * Encodes the specified PrimaryFeature message. Does not implicitly {@link proto.PrimaryFeature.verify|verify} messages. + * @function encode + * @memberof proto.PrimaryFeature + * @static + * @param {proto.IPrimaryFeature} message PrimaryFeature message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - Message.prototype.imageMessage = null; + PrimaryFeature.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.flags != null && message.flags.length) + for (var i = 0; i < message.flags.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.flags[i]); + return writer; + }; /** - * Message contactMessage. - * @member {proto.IContactMessage|null|undefined} contactMessage - * @memberof proto.Message - * @instance + * Encodes the specified PrimaryFeature message, length delimited. Does not implicitly {@link proto.PrimaryFeature.verify|verify} messages. + * @function encodeDelimited + * @memberof proto.PrimaryFeature + * @static + * @param {proto.IPrimaryFeature} message PrimaryFeature message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - Message.prototype.contactMessage = null; + PrimaryFeature.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; /** - * Message locationMessage. - * @member {proto.ILocationMessage|null|undefined} locationMessage - * @memberof proto.Message - * @instance + * Decodes a PrimaryFeature message from the specified reader or buffer. + * @function decode + * @memberof proto.PrimaryFeature + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {proto.PrimaryFeature} PrimaryFeature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Message.prototype.locationMessage = null; + PrimaryFeature.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.PrimaryFeature(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.flags && message.flags.length)) + message.flags = []; + message.flags.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; /** - * Message extendedTextMessage. - * @member {proto.IExtendedTextMessage|null|undefined} extendedTextMessage - * @memberof proto.Message - * @instance + * Decodes a PrimaryFeature message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof proto.PrimaryFeature + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {proto.PrimaryFeature} PrimaryFeature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Message.prototype.extendedTextMessage = null; + PrimaryFeature.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; /** - * Message documentMessage. - * @member {proto.IDocumentMessage|null|undefined} documentMessage - * @memberof proto.Message - * @instance + * Verifies a PrimaryFeature message. + * @function verify + * @memberof proto.PrimaryFeature + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Message.prototype.documentMessage = null; + PrimaryFeature.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.flags != null && message.hasOwnProperty("flags")) { + if (!Array.isArray(message.flags)) + return "flags: array expected"; + for (var i = 0; i < message.flags.length; ++i) + if (!$util.isString(message.flags[i])) + return "flags: string[] expected"; + } + return null; + }; /** - * Message audioMessage. - * @member {proto.IAudioMessage|null|undefined} audioMessage - * @memberof proto.Message - * @instance + * Creates a PrimaryFeature message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof proto.PrimaryFeature + * @static + * @param {Object.} object Plain object + * @returns {proto.PrimaryFeature} PrimaryFeature */ - Message.prototype.audioMessage = null; + PrimaryFeature.fromObject = function fromObject(object) { + if (object instanceof $root.proto.PrimaryFeature) + return object; + var message = new $root.proto.PrimaryFeature(); + if (object.flags) { + if (!Array.isArray(object.flags)) + throw TypeError(".proto.PrimaryFeature.flags: array expected"); + message.flags = []; + for (var i = 0; i < object.flags.length; ++i) + message.flags[i] = String(object.flags[i]); + } + return message; + }; /** - * Message videoMessage. - * @member {proto.IVideoMessage|null|undefined} videoMessage - * @memberof proto.Message - * @instance + * Creates a plain object from a PrimaryFeature message. Also converts values to other types if specified. + * @function toObject + * @memberof proto.PrimaryFeature + * @static + * @param {proto.PrimaryFeature} message PrimaryFeature + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object */ - Message.prototype.videoMessage = null; + PrimaryFeature.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.flags = []; + if (message.flags && message.flags.length) { + object.flags = []; + for (var j = 0; j < message.flags.length; ++j) + object.flags[j] = message.flags[j]; + } + return object; + }; /** - * Message call. - * @member {proto.ICall|null|undefined} call - * @memberof proto.Message + * Converts this PrimaryFeature to JSON. + * @function toJSON + * @memberof proto.PrimaryFeature * @instance + * @returns {Object.} JSON object */ - Message.prototype.call = null; + PrimaryFeature.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Message chat. - * @member {proto.IChat|null|undefined} chat - * @memberof proto.Message - * @instance - */ - Message.prototype.chat = null; + return PrimaryFeature; + })(); + + proto.PushNameSetting = (function() { /** - * Message protocolMessage. - * @member {proto.IProtocolMessage|null|undefined} protocolMessage - * @memberof proto.Message - * @instance + * Properties of a PushNameSetting. + * @memberof proto + * @interface IPushNameSetting + * @property {string|null} [name] PushNameSetting name */ - Message.prototype.protocolMessage = null; /** - * Message contactsArrayMessage. - * @member {proto.IContactsArrayMessage|null|undefined} contactsArrayMessage - * @memberof proto.Message - * @instance + * Constructs a new PushNameSetting. + * @memberof proto + * @classdesc Represents a PushNameSetting. + * @implements IPushNameSetting + * @constructor + * @param {proto.IPushNameSetting=} [properties] Properties to set */ - Message.prototype.contactsArrayMessage = null; + function PushNameSetting(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } /** - * Message highlyStructuredMessage. - * @member {proto.IHighlyStructuredMessage|null|undefined} highlyStructuredMessage - * @memberof proto.Message + * PushNameSetting name. + * @member {string} name + * @memberof proto.PushNameSetting * @instance */ - Message.prototype.highlyStructuredMessage = null; + PushNameSetting.prototype.name = ""; /** - * Message fastRatchetKeySenderKeyDistributionMessage. - * @member {proto.ISenderKeyDistributionMessage|null|undefined} fastRatchetKeySenderKeyDistributionMessage - * @memberof proto.Message - * @instance + * Creates a new PushNameSetting instance using the specified properties. + * @function create + * @memberof proto.PushNameSetting + * @static + * @param {proto.IPushNameSetting=} [properties] Properties to set + * @returns {proto.PushNameSetting} PushNameSetting instance */ - Message.prototype.fastRatchetKeySenderKeyDistributionMessage = null; + PushNameSetting.create = function create(properties) { + return new PushNameSetting(properties); + }; /** - * Message sendPaymentMessage. - * @member {proto.ISendPaymentMessage|null|undefined} sendPaymentMessage - * @memberof proto.Message - * @instance + * Encodes the specified PushNameSetting message. Does not implicitly {@link proto.PushNameSetting.verify|verify} messages. + * @function encode + * @memberof proto.PushNameSetting + * @static + * @param {proto.IPushNameSetting} message PushNameSetting message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - Message.prototype.sendPaymentMessage = null; + PushNameSetting.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; /** - * Message liveLocationMessage. - * @member {proto.ILiveLocationMessage|null|undefined} liveLocationMessage - * @memberof proto.Message - * @instance + * Encodes the specified PushNameSetting message, length delimited. Does not implicitly {@link proto.PushNameSetting.verify|verify} messages. + * @function encodeDelimited + * @memberof proto.PushNameSetting + * @static + * @param {proto.IPushNameSetting} message PushNameSetting message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - Message.prototype.liveLocationMessage = null; + PushNameSetting.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; /** - * Message requestPaymentMessage. - * @member {proto.IRequestPaymentMessage|null|undefined} requestPaymentMessage - * @memberof proto.Message - * @instance + * Decodes a PushNameSetting message from the specified reader or buffer. + * @function decode + * @memberof proto.PushNameSetting + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {proto.PushNameSetting} PushNameSetting + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Message.prototype.requestPaymentMessage = null; + PushNameSetting.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.PushNameSetting(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; /** - * Message declinePaymentRequestMessage. - * @member {proto.IDeclinePaymentRequestMessage|null|undefined} declinePaymentRequestMessage - * @memberof proto.Message - * @instance + * Decodes a PushNameSetting message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof proto.PushNameSetting + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {proto.PushNameSetting} PushNameSetting + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Message.prototype.declinePaymentRequestMessage = null; + PushNameSetting.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; /** - * Message cancelPaymentRequestMessage. - * @member {proto.ICancelPaymentRequestMessage|null|undefined} cancelPaymentRequestMessage - * @memberof proto.Message - * @instance + * Verifies a PushNameSetting message. + * @function verify + * @memberof proto.PushNameSetting + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Message.prototype.cancelPaymentRequestMessage = null; + PushNameSetting.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; /** - * Message templateMessage. - * @member {proto.ITemplateMessage|null|undefined} templateMessage - * @memberof proto.Message - * @instance + * Creates a PushNameSetting message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof proto.PushNameSetting + * @static + * @param {Object.} object Plain object + * @returns {proto.PushNameSetting} PushNameSetting */ - Message.prototype.templateMessage = null; + PushNameSetting.fromObject = function fromObject(object) { + if (object instanceof $root.proto.PushNameSetting) + return object; + var message = new $root.proto.PushNameSetting(); + if (object.name != null) + message.name = String(object.name); + return message; + }; /** - * Message stickerMessage. - * @member {proto.IStickerMessage|null|undefined} stickerMessage - * @memberof proto.Message - * @instance + * Creates a plain object from a PushNameSetting message. Also converts values to other types if specified. + * @function toObject + * @memberof proto.PushNameSetting + * @static + * @param {proto.PushNameSetting} message PushNameSetting + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object */ - Message.prototype.stickerMessage = null; + PushNameSetting.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; /** - * Message groupInviteMessage. - * @member {proto.IGroupInviteMessage|null|undefined} groupInviteMessage - * @memberof proto.Message + * Converts this PushNameSetting to JSON. + * @function toJSON + * @memberof proto.PushNameSetting * @instance + * @returns {Object.} JSON object */ - Message.prototype.groupInviteMessage = null; + PushNameSetting.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return PushNameSetting; + })(); + + proto.QuickReplyAction = (function() { /** - * Message templateButtonReplyMessage. - * @member {proto.ITemplateButtonReplyMessage|null|undefined} templateButtonReplyMessage - * @memberof proto.Message - * @instance + * Properties of a QuickReplyAction. + * @memberof proto + * @interface IQuickReplyAction + * @property {string|null} [shortcut] QuickReplyAction shortcut + * @property {string|null} [message] QuickReplyAction message + * @property {Array.|null} [keywords] QuickReplyAction keywords + * @property {number|null} [count] QuickReplyAction count + * @property {boolean|null} [deleted] QuickReplyAction deleted */ - Message.prototype.templateButtonReplyMessage = null; /** - * Message productMessage. - * @member {proto.IProductMessage|null|undefined} productMessage - * @memberof proto.Message - * @instance + * Constructs a new QuickReplyAction. + * @memberof proto + * @classdesc Represents a QuickReplyAction. + * @implements IQuickReplyAction + * @constructor + * @param {proto.IQuickReplyAction=} [properties] Properties to set */ - Message.prototype.productMessage = null; + function QuickReplyAction(properties) { + this.keywords = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } /** - * Message deviceSentMessage. - * @member {proto.IDeviceSentMessage|null|undefined} deviceSentMessage - * @memberof proto.Message + * QuickReplyAction shortcut. + * @member {string} shortcut + * @memberof proto.QuickReplyAction * @instance */ - Message.prototype.deviceSentMessage = null; + QuickReplyAction.prototype.shortcut = ""; /** - * Message messageContextInfo. - * @member {proto.IMessageContextInfo|null|undefined} messageContextInfo - * @memberof proto.Message + * QuickReplyAction message. + * @member {string} message + * @memberof proto.QuickReplyAction * @instance */ - Message.prototype.messageContextInfo = null; + QuickReplyAction.prototype.message = ""; /** - * Message listMessage. - * @member {proto.IListMessage|null|undefined} listMessage - * @memberof proto.Message + * QuickReplyAction keywords. + * @member {Array.} keywords + * @memberof proto.QuickReplyAction * @instance */ - Message.prototype.listMessage = null; + QuickReplyAction.prototype.keywords = $util.emptyArray; /** - * Message viewOnceMessage. - * @member {proto.IFutureProofMessage|null|undefined} viewOnceMessage - * @memberof proto.Message + * QuickReplyAction count. + * @member {number} count + * @memberof proto.QuickReplyAction * @instance */ - Message.prototype.viewOnceMessage = null; + QuickReplyAction.prototype.count = 0; /** - * Message orderMessage. - * @member {proto.IOrderMessage|null|undefined} orderMessage - * @memberof proto.Message + * QuickReplyAction deleted. + * @member {boolean} deleted + * @memberof proto.QuickReplyAction * @instance */ - Message.prototype.orderMessage = null; + QuickReplyAction.prototype.deleted = false; /** - * Message listResponseMessage. - * @member {proto.IListResponseMessage|null|undefined} listResponseMessage - * @memberof proto.Message - * @instance + * Creates a new QuickReplyAction instance using the specified properties. + * @function create + * @memberof proto.QuickReplyAction + * @static + * @param {proto.IQuickReplyAction=} [properties] Properties to set + * @returns {proto.QuickReplyAction} QuickReplyAction instance */ - Message.prototype.listResponseMessage = null; + QuickReplyAction.create = function create(properties) { + return new QuickReplyAction(properties); + }; /** - * Message ephemeralMessage. - * @member {proto.IFutureProofMessage|null|undefined} ephemeralMessage - * @memberof proto.Message - * @instance + * Encodes the specified QuickReplyAction message. Does not implicitly {@link proto.QuickReplyAction.verify|verify} messages. + * @function encode + * @memberof proto.QuickReplyAction + * @static + * @param {proto.IQuickReplyAction} message QuickReplyAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - Message.prototype.ephemeralMessage = null; + QuickReplyAction.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.shortcut != null && Object.hasOwnProperty.call(message, "shortcut")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.shortcut); + if (message.message != null && Object.hasOwnProperty.call(message, "message")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.message); + if (message.keywords != null && message.keywords.length) + for (var i = 0; i < message.keywords.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.keywords[i]); + if (message.count != null && Object.hasOwnProperty.call(message, "count")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.count); + if (message.deleted != null && Object.hasOwnProperty.call(message, "deleted")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.deleted); + return writer; + }; /** - * Message invoiceMessage. - * @member {proto.IInvoiceMessage|null|undefined} invoiceMessage - * @memberof proto.Message - * @instance + * Encodes the specified QuickReplyAction message, length delimited. Does not implicitly {@link proto.QuickReplyAction.verify|verify} messages. + * @function encodeDelimited + * @memberof proto.QuickReplyAction + * @static + * @param {proto.IQuickReplyAction} message QuickReplyAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - Message.prototype.invoiceMessage = null; + QuickReplyAction.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; /** - * Message buttonsMessage. - * @member {proto.IButtonsMessage|null|undefined} buttonsMessage - * @memberof proto.Message - * @instance + * Decodes a QuickReplyAction message from the specified reader or buffer. + * @function decode + * @memberof proto.QuickReplyAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {proto.QuickReplyAction} QuickReplyAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Message.prototype.buttonsMessage = null; + QuickReplyAction.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.QuickReplyAction(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.shortcut = reader.string(); + break; + case 2: + message.message = reader.string(); + break; + case 3: + if (!(message.keywords && message.keywords.length)) + message.keywords = []; + message.keywords.push(reader.string()); + break; + case 4: + message.count = reader.int32(); + break; + case 5: + message.deleted = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; /** - * Message buttonsResponseMessage. - * @member {proto.IButtonsResponseMessage|null|undefined} buttonsResponseMessage - * @memberof proto.Message - * @instance + * Decodes a QuickReplyAction message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof proto.QuickReplyAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {proto.QuickReplyAction} QuickReplyAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Message.prototype.buttonsResponseMessage = null; + QuickReplyAction.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; /** - * Message paymentInviteMessage. - * @member {proto.IPaymentInviteMessage|null|undefined} paymentInviteMessage - * @memberof proto.Message - * @instance + * Verifies a QuickReplyAction message. + * @function verify + * @memberof proto.QuickReplyAction + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Message.prototype.paymentInviteMessage = null; + QuickReplyAction.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.shortcut != null && message.hasOwnProperty("shortcut")) + if (!$util.isString(message.shortcut)) + return "shortcut: string expected"; + if (message.message != null && message.hasOwnProperty("message")) + if (!$util.isString(message.message)) + return "message: string expected"; + if (message.keywords != null && message.hasOwnProperty("keywords")) { + if (!Array.isArray(message.keywords)) + return "keywords: array expected"; + for (var i = 0; i < message.keywords.length; ++i) + if (!$util.isString(message.keywords[i])) + return "keywords: string[] expected"; + } + if (message.count != null && message.hasOwnProperty("count")) + if (!$util.isInteger(message.count)) + return "count: integer expected"; + if (message.deleted != null && message.hasOwnProperty("deleted")) + if (typeof message.deleted !== "boolean") + return "deleted: boolean expected"; + return null; + }; /** - * Message interactiveMessage. - * @member {proto.IInteractiveMessage|null|undefined} interactiveMessage - * @memberof proto.Message + * Creates a QuickReplyAction message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof proto.QuickReplyAction + * @static + * @param {Object.} object Plain object + * @returns {proto.QuickReplyAction} QuickReplyAction + */ + QuickReplyAction.fromObject = function fromObject(object) { + if (object instanceof $root.proto.QuickReplyAction) + return object; + var message = new $root.proto.QuickReplyAction(); + if (object.shortcut != null) + message.shortcut = String(object.shortcut); + if (object.message != null) + message.message = String(object.message); + if (object.keywords) { + if (!Array.isArray(object.keywords)) + throw TypeError(".proto.QuickReplyAction.keywords: array expected"); + message.keywords = []; + for (var i = 0; i < object.keywords.length; ++i) + message.keywords[i] = String(object.keywords[i]); + } + if (object.count != null) + message.count = object.count | 0; + if (object.deleted != null) + message.deleted = Boolean(object.deleted); + return message; + }; + + /** + * Creates a plain object from a QuickReplyAction message. Also converts values to other types if specified. + * @function toObject + * @memberof proto.QuickReplyAction + * @static + * @param {proto.QuickReplyAction} message QuickReplyAction + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QuickReplyAction.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.keywords = []; + if (options.defaults) { + object.shortcut = ""; + object.message = ""; + object.count = 0; + object.deleted = false; + } + if (message.shortcut != null && message.hasOwnProperty("shortcut")) + object.shortcut = message.shortcut; + if (message.message != null && message.hasOwnProperty("message")) + object.message = message.message; + if (message.keywords && message.keywords.length) { + object.keywords = []; + for (var j = 0; j < message.keywords.length; ++j) + object.keywords[j] = message.keywords[j]; + } + if (message.count != null && message.hasOwnProperty("count")) + object.count = message.count; + if (message.deleted != null && message.hasOwnProperty("deleted")) + object.deleted = message.deleted; + return object; + }; + + /** + * Converts this QuickReplyAction to JSON. + * @function toJSON + * @memberof proto.QuickReplyAction * @instance + * @returns {Object.} JSON object */ - Message.prototype.interactiveMessage = null; + QuickReplyAction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QuickReplyAction; + })(); + + proto.RecentEmojiWeight = (function() { /** - * Message reactionMessage. - * @member {proto.IReactionMessage|null|undefined} reactionMessage - * @memberof proto.Message + * Properties of a RecentEmojiWeight. + * @memberof proto + * @interface IRecentEmojiWeight + * @property {string|null} [emoji] RecentEmojiWeight emoji + * @property {number|null} [weight] RecentEmojiWeight weight + */ + + /** + * Constructs a new RecentEmojiWeight. + * @memberof proto + * @classdesc Represents a RecentEmojiWeight. + * @implements IRecentEmojiWeight + * @constructor + * @param {proto.IRecentEmojiWeight=} [properties] Properties to set + */ + function RecentEmojiWeight(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RecentEmojiWeight emoji. + * @member {string} emoji + * @memberof proto.RecentEmojiWeight * @instance */ - Message.prototype.reactionMessage = null; + RecentEmojiWeight.prototype.emoji = ""; /** - * Message stickerSyncRmrMessage. - * @member {proto.IStickerSyncRMRMessage|null|undefined} stickerSyncRmrMessage - * @memberof proto.Message + * RecentEmojiWeight weight. + * @member {number} weight + * @memberof proto.RecentEmojiWeight * @instance */ - Message.prototype.stickerSyncRmrMessage = null; + RecentEmojiWeight.prototype.weight = 0; /** - * Creates a new Message instance using the specified properties. + * Creates a new RecentEmojiWeight instance using the specified properties. * @function create - * @memberof proto.Message + * @memberof proto.RecentEmojiWeight * @static - * @param {proto.IMessage=} [properties] Properties to set - * @returns {proto.Message} Message instance + * @param {proto.IRecentEmojiWeight=} [properties] Properties to set + * @returns {proto.RecentEmojiWeight} RecentEmojiWeight instance */ - Message.create = function create(properties) { - return new Message(properties); + RecentEmojiWeight.create = function create(properties) { + return new RecentEmojiWeight(properties); }; /** - * Encodes the specified Message message. Does not implicitly {@link proto.Message.verify|verify} messages. + * Encodes the specified RecentEmojiWeight message. Does not implicitly {@link proto.RecentEmojiWeight.verify|verify} messages. * @function encode - * @memberof proto.Message + * @memberof proto.RecentEmojiWeight * @static - * @param {proto.IMessage} message Message message or plain object to encode + * @param {proto.IRecentEmojiWeight} message RecentEmojiWeight message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Message.encode = function encode(message, writer) { + RecentEmojiWeight.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.conversation != null && Object.hasOwnProperty.call(message, "conversation")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.conversation); - if (message.senderKeyDistributionMessage != null && Object.hasOwnProperty.call(message, "senderKeyDistributionMessage")) - $root.proto.SenderKeyDistributionMessage.encode(message.senderKeyDistributionMessage, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.imageMessage != null && Object.hasOwnProperty.call(message, "imageMessage")) - $root.proto.ImageMessage.encode(message.imageMessage, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.contactMessage != null && Object.hasOwnProperty.call(message, "contactMessage")) - $root.proto.ContactMessage.encode(message.contactMessage, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.locationMessage != null && Object.hasOwnProperty.call(message, "locationMessage")) - $root.proto.LocationMessage.encode(message.locationMessage, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.extendedTextMessage != null && Object.hasOwnProperty.call(message, "extendedTextMessage")) - $root.proto.ExtendedTextMessage.encode(message.extendedTextMessage, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.documentMessage != null && Object.hasOwnProperty.call(message, "documentMessage")) - $root.proto.DocumentMessage.encode(message.documentMessage, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.audioMessage != null && Object.hasOwnProperty.call(message, "audioMessage")) - $root.proto.AudioMessage.encode(message.audioMessage, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.videoMessage != null && Object.hasOwnProperty.call(message, "videoMessage")) - $root.proto.VideoMessage.encode(message.videoMessage, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.call != null && Object.hasOwnProperty.call(message, "call")) - $root.proto.Call.encode(message.call, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); - if (message.chat != null && Object.hasOwnProperty.call(message, "chat")) - $root.proto.Chat.encode(message.chat, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); - if (message.protocolMessage != null && Object.hasOwnProperty.call(message, "protocolMessage")) - $root.proto.ProtocolMessage.encode(message.protocolMessage, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); - if (message.contactsArrayMessage != null && Object.hasOwnProperty.call(message, "contactsArrayMessage")) - $root.proto.ContactsArrayMessage.encode(message.contactsArrayMessage, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); - if (message.highlyStructuredMessage != null && Object.hasOwnProperty.call(message, "highlyStructuredMessage")) - $root.proto.HighlyStructuredMessage.encode(message.highlyStructuredMessage, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); - if (message.fastRatchetKeySenderKeyDistributionMessage != null && Object.hasOwnProperty.call(message, "fastRatchetKeySenderKeyDistributionMessage")) - $root.proto.SenderKeyDistributionMessage.encode(message.fastRatchetKeySenderKeyDistributionMessage, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); - if (message.sendPaymentMessage != null && Object.hasOwnProperty.call(message, "sendPaymentMessage")) - $root.proto.SendPaymentMessage.encode(message.sendPaymentMessage, writer.uint32(/* id 16, wireType 2 =*/130).fork()).ldelim(); - if (message.liveLocationMessage != null && Object.hasOwnProperty.call(message, "liveLocationMessage")) - $root.proto.LiveLocationMessage.encode(message.liveLocationMessage, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); - if (message.requestPaymentMessage != null && Object.hasOwnProperty.call(message, "requestPaymentMessage")) - $root.proto.RequestPaymentMessage.encode(message.requestPaymentMessage, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); - if (message.declinePaymentRequestMessage != null && Object.hasOwnProperty.call(message, "declinePaymentRequestMessage")) - $root.proto.DeclinePaymentRequestMessage.encode(message.declinePaymentRequestMessage, writer.uint32(/* id 23, wireType 2 =*/186).fork()).ldelim(); - if (message.cancelPaymentRequestMessage != null && Object.hasOwnProperty.call(message, "cancelPaymentRequestMessage")) - $root.proto.CancelPaymentRequestMessage.encode(message.cancelPaymentRequestMessage, writer.uint32(/* id 24, wireType 2 =*/194).fork()).ldelim(); - if (message.templateMessage != null && Object.hasOwnProperty.call(message, "templateMessage")) - $root.proto.TemplateMessage.encode(message.templateMessage, writer.uint32(/* id 25, wireType 2 =*/202).fork()).ldelim(); - if (message.stickerMessage != null && Object.hasOwnProperty.call(message, "stickerMessage")) - $root.proto.StickerMessage.encode(message.stickerMessage, writer.uint32(/* id 26, wireType 2 =*/210).fork()).ldelim(); - if (message.groupInviteMessage != null && Object.hasOwnProperty.call(message, "groupInviteMessage")) - $root.proto.GroupInviteMessage.encode(message.groupInviteMessage, writer.uint32(/* id 28, wireType 2 =*/226).fork()).ldelim(); - if (message.templateButtonReplyMessage != null && Object.hasOwnProperty.call(message, "templateButtonReplyMessage")) - $root.proto.TemplateButtonReplyMessage.encode(message.templateButtonReplyMessage, writer.uint32(/* id 29, wireType 2 =*/234).fork()).ldelim(); - if (message.productMessage != null && Object.hasOwnProperty.call(message, "productMessage")) - $root.proto.ProductMessage.encode(message.productMessage, writer.uint32(/* id 30, wireType 2 =*/242).fork()).ldelim(); - if (message.deviceSentMessage != null && Object.hasOwnProperty.call(message, "deviceSentMessage")) - $root.proto.DeviceSentMessage.encode(message.deviceSentMessage, writer.uint32(/* id 31, wireType 2 =*/250).fork()).ldelim(); - if (message.messageContextInfo != null && Object.hasOwnProperty.call(message, "messageContextInfo")) - $root.proto.MessageContextInfo.encode(message.messageContextInfo, writer.uint32(/* id 35, wireType 2 =*/282).fork()).ldelim(); - if (message.listMessage != null && Object.hasOwnProperty.call(message, "listMessage")) - $root.proto.ListMessage.encode(message.listMessage, writer.uint32(/* id 36, wireType 2 =*/290).fork()).ldelim(); - if (message.viewOnceMessage != null && Object.hasOwnProperty.call(message, "viewOnceMessage")) - $root.proto.FutureProofMessage.encode(message.viewOnceMessage, writer.uint32(/* id 37, wireType 2 =*/298).fork()).ldelim(); - if (message.orderMessage != null && Object.hasOwnProperty.call(message, "orderMessage")) - $root.proto.OrderMessage.encode(message.orderMessage, writer.uint32(/* id 38, wireType 2 =*/306).fork()).ldelim(); - if (message.listResponseMessage != null && Object.hasOwnProperty.call(message, "listResponseMessage")) - $root.proto.ListResponseMessage.encode(message.listResponseMessage, writer.uint32(/* id 39, wireType 2 =*/314).fork()).ldelim(); - if (message.ephemeralMessage != null && Object.hasOwnProperty.call(message, "ephemeralMessage")) - $root.proto.FutureProofMessage.encode(message.ephemeralMessage, writer.uint32(/* id 40, wireType 2 =*/322).fork()).ldelim(); - if (message.invoiceMessage != null && Object.hasOwnProperty.call(message, "invoiceMessage")) - $root.proto.InvoiceMessage.encode(message.invoiceMessage, writer.uint32(/* id 41, wireType 2 =*/330).fork()).ldelim(); - if (message.buttonsMessage != null && Object.hasOwnProperty.call(message, "buttonsMessage")) - $root.proto.ButtonsMessage.encode(message.buttonsMessage, writer.uint32(/* id 42, wireType 2 =*/338).fork()).ldelim(); - if (message.buttonsResponseMessage != null && Object.hasOwnProperty.call(message, "buttonsResponseMessage")) - $root.proto.ButtonsResponseMessage.encode(message.buttonsResponseMessage, writer.uint32(/* id 43, wireType 2 =*/346).fork()).ldelim(); - if (message.paymentInviteMessage != null && Object.hasOwnProperty.call(message, "paymentInviteMessage")) - $root.proto.PaymentInviteMessage.encode(message.paymentInviteMessage, writer.uint32(/* id 44, wireType 2 =*/354).fork()).ldelim(); - if (message.interactiveMessage != null && Object.hasOwnProperty.call(message, "interactiveMessage")) - $root.proto.InteractiveMessage.encode(message.interactiveMessage, writer.uint32(/* id 45, wireType 2 =*/362).fork()).ldelim(); - if (message.reactionMessage != null && Object.hasOwnProperty.call(message, "reactionMessage")) - $root.proto.ReactionMessage.encode(message.reactionMessage, writer.uint32(/* id 46, wireType 2 =*/370).fork()).ldelim(); - if (message.stickerSyncRmrMessage != null && Object.hasOwnProperty.call(message, "stickerSyncRmrMessage")) - $root.proto.StickerSyncRMRMessage.encode(message.stickerSyncRmrMessage, writer.uint32(/* id 47, wireType 2 =*/378).fork()).ldelim(); + if (message.emoji != null && Object.hasOwnProperty.call(message, "emoji")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.emoji); + if (message.weight != null && Object.hasOwnProperty.call(message, "weight")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.weight); return writer; }; /** - * Encodes the specified Message message, length delimited. Does not implicitly {@link proto.Message.verify|verify} messages. + * Encodes the specified RecentEmojiWeight message, length delimited. Does not implicitly {@link proto.RecentEmojiWeight.verify|verify} messages. * @function encodeDelimited - * @memberof proto.Message + * @memberof proto.RecentEmojiWeight * @static - * @param {proto.IMessage} message Message message or plain object to encode + * @param {proto.IRecentEmojiWeight} message RecentEmojiWeight message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Message.encodeDelimited = function encodeDelimited(message, writer) { + RecentEmojiWeight.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Message message from the specified reader or buffer. + * Decodes a RecentEmojiWeight message from the specified reader or buffer. * @function decode - * @memberof proto.Message + * @memberof proto.RecentEmojiWeight * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {proto.Message} Message + * @returns {proto.RecentEmojiWeight} RecentEmojiWeight * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Message.decode = function decode(reader, length) { + RecentEmojiWeight.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.Message(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.RecentEmojiWeight(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.conversation = reader.string(); + message.emoji = reader.string(); break; case 2: - message.senderKeyDistributionMessage = $root.proto.SenderKeyDistributionMessage.decode(reader, reader.uint32()); - break; - case 3: - message.imageMessage = $root.proto.ImageMessage.decode(reader, reader.uint32()); - break; - case 4: - message.contactMessage = $root.proto.ContactMessage.decode(reader, reader.uint32()); - break; - case 5: - message.locationMessage = $root.proto.LocationMessage.decode(reader, reader.uint32()); - break; - case 6: - message.extendedTextMessage = $root.proto.ExtendedTextMessage.decode(reader, reader.uint32()); - break; - case 7: - message.documentMessage = $root.proto.DocumentMessage.decode(reader, reader.uint32()); - break; - case 8: - message.audioMessage = $root.proto.AudioMessage.decode(reader, reader.uint32()); - break; - case 9: - message.videoMessage = $root.proto.VideoMessage.decode(reader, reader.uint32()); - break; - case 10: - message.call = $root.proto.Call.decode(reader, reader.uint32()); - break; - case 11: - message.chat = $root.proto.Chat.decode(reader, reader.uint32()); - break; - case 12: - message.protocolMessage = $root.proto.ProtocolMessage.decode(reader, reader.uint32()); - break; - case 13: - message.contactsArrayMessage = $root.proto.ContactsArrayMessage.decode(reader, reader.uint32()); - break; - case 14: - message.highlyStructuredMessage = $root.proto.HighlyStructuredMessage.decode(reader, reader.uint32()); - break; - case 15: - message.fastRatchetKeySenderKeyDistributionMessage = $root.proto.SenderKeyDistributionMessage.decode(reader, reader.uint32()); - break; - case 16: - message.sendPaymentMessage = $root.proto.SendPaymentMessage.decode(reader, reader.uint32()); - break; - case 18: - message.liveLocationMessage = $root.proto.LiveLocationMessage.decode(reader, reader.uint32()); - break; - case 22: - message.requestPaymentMessage = $root.proto.RequestPaymentMessage.decode(reader, reader.uint32()); - break; - case 23: - message.declinePaymentRequestMessage = $root.proto.DeclinePaymentRequestMessage.decode(reader, reader.uint32()); - break; - case 24: - message.cancelPaymentRequestMessage = $root.proto.CancelPaymentRequestMessage.decode(reader, reader.uint32()); - break; - case 25: - message.templateMessage = $root.proto.TemplateMessage.decode(reader, reader.uint32()); - break; - case 26: - message.stickerMessage = $root.proto.StickerMessage.decode(reader, reader.uint32()); - break; - case 28: - message.groupInviteMessage = $root.proto.GroupInviteMessage.decode(reader, reader.uint32()); - break; - case 29: - message.templateButtonReplyMessage = $root.proto.TemplateButtonReplyMessage.decode(reader, reader.uint32()); - break; - case 30: - message.productMessage = $root.proto.ProductMessage.decode(reader, reader.uint32()); - break; - case 31: - message.deviceSentMessage = $root.proto.DeviceSentMessage.decode(reader, reader.uint32()); - break; - case 35: - message.messageContextInfo = $root.proto.MessageContextInfo.decode(reader, reader.uint32()); - break; - case 36: - message.listMessage = $root.proto.ListMessage.decode(reader, reader.uint32()); - break; - case 37: - message.viewOnceMessage = $root.proto.FutureProofMessage.decode(reader, reader.uint32()); - break; - case 38: - message.orderMessage = $root.proto.OrderMessage.decode(reader, reader.uint32()); - break; - case 39: - message.listResponseMessage = $root.proto.ListResponseMessage.decode(reader, reader.uint32()); - break; - case 40: - message.ephemeralMessage = $root.proto.FutureProofMessage.decode(reader, reader.uint32()); - break; - case 41: - message.invoiceMessage = $root.proto.InvoiceMessage.decode(reader, reader.uint32()); - break; - case 42: - message.buttonsMessage = $root.proto.ButtonsMessage.decode(reader, reader.uint32()); - break; - case 43: - message.buttonsResponseMessage = $root.proto.ButtonsResponseMessage.decode(reader, reader.uint32()); - break; - case 44: - message.paymentInviteMessage = $root.proto.PaymentInviteMessage.decode(reader, reader.uint32()); - break; - case 45: - message.interactiveMessage = $root.proto.InteractiveMessage.decode(reader, reader.uint32()); - break; - case 46: - message.reactionMessage = $root.proto.ReactionMessage.decode(reader, reader.uint32()); - break; - case 47: - message.stickerSyncRmrMessage = $root.proto.StickerSyncRMRMessage.decode(reader, reader.uint32()); + message.weight = reader.float(); break; default: reader.skipType(tag & 7); @@ -46295,603 +45293,117 @@ $root.proto = (function() { }; /** - * Decodes a Message message from the specified reader or buffer, length delimited. + * Decodes a RecentEmojiWeight message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof proto.Message + * @memberof proto.RecentEmojiWeight * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.Message} Message + * @returns {proto.RecentEmojiWeight} RecentEmojiWeight * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Message.decodeDelimited = function decodeDelimited(reader) { + RecentEmojiWeight.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Message message. + * Verifies a RecentEmojiWeight message. * @function verify - * @memberof proto.Message + * @memberof proto.RecentEmojiWeight * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Message.verify = function verify(message) { + RecentEmojiWeight.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.conversation != null && message.hasOwnProperty("conversation")) - if (!$util.isString(message.conversation)) - return "conversation: string expected"; - if (message.senderKeyDistributionMessage != null && message.hasOwnProperty("senderKeyDistributionMessage")) { - var error = $root.proto.SenderKeyDistributionMessage.verify(message.senderKeyDistributionMessage); - if (error) - return "senderKeyDistributionMessage." + error; - } - if (message.imageMessage != null && message.hasOwnProperty("imageMessage")) { - var error = $root.proto.ImageMessage.verify(message.imageMessage); - if (error) - return "imageMessage." + error; - } - if (message.contactMessage != null && message.hasOwnProperty("contactMessage")) { - var error = $root.proto.ContactMessage.verify(message.contactMessage); - if (error) - return "contactMessage." + error; - } - if (message.locationMessage != null && message.hasOwnProperty("locationMessage")) { - var error = $root.proto.LocationMessage.verify(message.locationMessage); - if (error) - return "locationMessage." + error; - } - if (message.extendedTextMessage != null && message.hasOwnProperty("extendedTextMessage")) { - var error = $root.proto.ExtendedTextMessage.verify(message.extendedTextMessage); - if (error) - return "extendedTextMessage." + error; - } - if (message.documentMessage != null && message.hasOwnProperty("documentMessage")) { - var error = $root.proto.DocumentMessage.verify(message.documentMessage); - if (error) - return "documentMessage." + error; - } - if (message.audioMessage != null && message.hasOwnProperty("audioMessage")) { - var error = $root.proto.AudioMessage.verify(message.audioMessage); - if (error) - return "audioMessage." + error; - } - if (message.videoMessage != null && message.hasOwnProperty("videoMessage")) { - var error = $root.proto.VideoMessage.verify(message.videoMessage); - if (error) - return "videoMessage." + error; - } - if (message.call != null && message.hasOwnProperty("call")) { - var error = $root.proto.Call.verify(message.call); - if (error) - return "call." + error; - } - if (message.chat != null && message.hasOwnProperty("chat")) { - var error = $root.proto.Chat.verify(message.chat); - if (error) - return "chat." + error; - } - if (message.protocolMessage != null && message.hasOwnProperty("protocolMessage")) { - var error = $root.proto.ProtocolMessage.verify(message.protocolMessage); - if (error) - return "protocolMessage." + error; - } - if (message.contactsArrayMessage != null && message.hasOwnProperty("contactsArrayMessage")) { - var error = $root.proto.ContactsArrayMessage.verify(message.contactsArrayMessage); - if (error) - return "contactsArrayMessage." + error; - } - if (message.highlyStructuredMessage != null && message.hasOwnProperty("highlyStructuredMessage")) { - var error = $root.proto.HighlyStructuredMessage.verify(message.highlyStructuredMessage); - if (error) - return "highlyStructuredMessage." + error; - } - if (message.fastRatchetKeySenderKeyDistributionMessage != null && message.hasOwnProperty("fastRatchetKeySenderKeyDistributionMessage")) { - var error = $root.proto.SenderKeyDistributionMessage.verify(message.fastRatchetKeySenderKeyDistributionMessage); - if (error) - return "fastRatchetKeySenderKeyDistributionMessage." + error; - } - if (message.sendPaymentMessage != null && message.hasOwnProperty("sendPaymentMessage")) { - var error = $root.proto.SendPaymentMessage.verify(message.sendPaymentMessage); - if (error) - return "sendPaymentMessage." + error; - } - if (message.liveLocationMessage != null && message.hasOwnProperty("liveLocationMessage")) { - var error = $root.proto.LiveLocationMessage.verify(message.liveLocationMessage); - if (error) - return "liveLocationMessage." + error; - } - if (message.requestPaymentMessage != null && message.hasOwnProperty("requestPaymentMessage")) { - var error = $root.proto.RequestPaymentMessage.verify(message.requestPaymentMessage); - if (error) - return "requestPaymentMessage." + error; - } - if (message.declinePaymentRequestMessage != null && message.hasOwnProperty("declinePaymentRequestMessage")) { - var error = $root.proto.DeclinePaymentRequestMessage.verify(message.declinePaymentRequestMessage); - if (error) - return "declinePaymentRequestMessage." + error; - } - if (message.cancelPaymentRequestMessage != null && message.hasOwnProperty("cancelPaymentRequestMessage")) { - var error = $root.proto.CancelPaymentRequestMessage.verify(message.cancelPaymentRequestMessage); - if (error) - return "cancelPaymentRequestMessage." + error; - } - if (message.templateMessage != null && message.hasOwnProperty("templateMessage")) { - var error = $root.proto.TemplateMessage.verify(message.templateMessage); - if (error) - return "templateMessage." + error; - } - if (message.stickerMessage != null && message.hasOwnProperty("stickerMessage")) { - var error = $root.proto.StickerMessage.verify(message.stickerMessage); - if (error) - return "stickerMessage." + error; - } - if (message.groupInviteMessage != null && message.hasOwnProperty("groupInviteMessage")) { - var error = $root.proto.GroupInviteMessage.verify(message.groupInviteMessage); - if (error) - return "groupInviteMessage." + error; - } - if (message.templateButtonReplyMessage != null && message.hasOwnProperty("templateButtonReplyMessage")) { - var error = $root.proto.TemplateButtonReplyMessage.verify(message.templateButtonReplyMessage); - if (error) - return "templateButtonReplyMessage." + error; - } - if (message.productMessage != null && message.hasOwnProperty("productMessage")) { - var error = $root.proto.ProductMessage.verify(message.productMessage); - if (error) - return "productMessage." + error; - } - if (message.deviceSentMessage != null && message.hasOwnProperty("deviceSentMessage")) { - var error = $root.proto.DeviceSentMessage.verify(message.deviceSentMessage); - if (error) - return "deviceSentMessage." + error; - } - if (message.messageContextInfo != null && message.hasOwnProperty("messageContextInfo")) { - var error = $root.proto.MessageContextInfo.verify(message.messageContextInfo); - if (error) - return "messageContextInfo." + error; - } - if (message.listMessage != null && message.hasOwnProperty("listMessage")) { - var error = $root.proto.ListMessage.verify(message.listMessage); - if (error) - return "listMessage." + error; - } - if (message.viewOnceMessage != null && message.hasOwnProperty("viewOnceMessage")) { - var error = $root.proto.FutureProofMessage.verify(message.viewOnceMessage); - if (error) - return "viewOnceMessage." + error; - } - if (message.orderMessage != null && message.hasOwnProperty("orderMessage")) { - var error = $root.proto.OrderMessage.verify(message.orderMessage); - if (error) - return "orderMessage." + error; - } - if (message.listResponseMessage != null && message.hasOwnProperty("listResponseMessage")) { - var error = $root.proto.ListResponseMessage.verify(message.listResponseMessage); - if (error) - return "listResponseMessage." + error; - } - if (message.ephemeralMessage != null && message.hasOwnProperty("ephemeralMessage")) { - var error = $root.proto.FutureProofMessage.verify(message.ephemeralMessage); - if (error) - return "ephemeralMessage." + error; - } - if (message.invoiceMessage != null && message.hasOwnProperty("invoiceMessage")) { - var error = $root.proto.InvoiceMessage.verify(message.invoiceMessage); - if (error) - return "invoiceMessage." + error; - } - if (message.buttonsMessage != null && message.hasOwnProperty("buttonsMessage")) { - var error = $root.proto.ButtonsMessage.verify(message.buttonsMessage); - if (error) - return "buttonsMessage." + error; - } - if (message.buttonsResponseMessage != null && message.hasOwnProperty("buttonsResponseMessage")) { - var error = $root.proto.ButtonsResponseMessage.verify(message.buttonsResponseMessage); - if (error) - return "buttonsResponseMessage." + error; - } - if (message.paymentInviteMessage != null && message.hasOwnProperty("paymentInviteMessage")) { - var error = $root.proto.PaymentInviteMessage.verify(message.paymentInviteMessage); - if (error) - return "paymentInviteMessage." + error; - } - if (message.interactiveMessage != null && message.hasOwnProperty("interactiveMessage")) { - var error = $root.proto.InteractiveMessage.verify(message.interactiveMessage); - if (error) - return "interactiveMessage." + error; - } - if (message.reactionMessage != null && message.hasOwnProperty("reactionMessage")) { - var error = $root.proto.ReactionMessage.verify(message.reactionMessage); - if (error) - return "reactionMessage." + error; - } - if (message.stickerSyncRmrMessage != null && message.hasOwnProperty("stickerSyncRmrMessage")) { - var error = $root.proto.StickerSyncRMRMessage.verify(message.stickerSyncRmrMessage); - if (error) - return "stickerSyncRmrMessage." + error; - } + if (message.emoji != null && message.hasOwnProperty("emoji")) + if (!$util.isString(message.emoji)) + return "emoji: string expected"; + if (message.weight != null && message.hasOwnProperty("weight")) + if (typeof message.weight !== "number") + return "weight: number expected"; return null; }; /** - * Creates a Message message from a plain object. Also converts values to their respective internal types. + * Creates a RecentEmojiWeight message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof proto.Message + * @memberof proto.RecentEmojiWeight * @static * @param {Object.} object Plain object - * @returns {proto.Message} Message + * @returns {proto.RecentEmojiWeight} RecentEmojiWeight */ - Message.fromObject = function fromObject(object) { - if (object instanceof $root.proto.Message) + RecentEmojiWeight.fromObject = function fromObject(object) { + if (object instanceof $root.proto.RecentEmojiWeight) return object; - var message = new $root.proto.Message(); - if (object.conversation != null) - message.conversation = String(object.conversation); - if (object.senderKeyDistributionMessage != null) { - if (typeof object.senderKeyDistributionMessage !== "object") - throw TypeError(".proto.Message.senderKeyDistributionMessage: object expected"); - message.senderKeyDistributionMessage = $root.proto.SenderKeyDistributionMessage.fromObject(object.senderKeyDistributionMessage); - } - if (object.imageMessage != null) { - if (typeof object.imageMessage !== "object") - throw TypeError(".proto.Message.imageMessage: object expected"); - message.imageMessage = $root.proto.ImageMessage.fromObject(object.imageMessage); - } - if (object.contactMessage != null) { - if (typeof object.contactMessage !== "object") - throw TypeError(".proto.Message.contactMessage: object expected"); - message.contactMessage = $root.proto.ContactMessage.fromObject(object.contactMessage); - } - if (object.locationMessage != null) { - if (typeof object.locationMessage !== "object") - throw TypeError(".proto.Message.locationMessage: object expected"); - message.locationMessage = $root.proto.LocationMessage.fromObject(object.locationMessage); - } - if (object.extendedTextMessage != null) { - if (typeof object.extendedTextMessage !== "object") - throw TypeError(".proto.Message.extendedTextMessage: object expected"); - message.extendedTextMessage = $root.proto.ExtendedTextMessage.fromObject(object.extendedTextMessage); - } - if (object.documentMessage != null) { - if (typeof object.documentMessage !== "object") - throw TypeError(".proto.Message.documentMessage: object expected"); - message.documentMessage = $root.proto.DocumentMessage.fromObject(object.documentMessage); - } - if (object.audioMessage != null) { - if (typeof object.audioMessage !== "object") - throw TypeError(".proto.Message.audioMessage: object expected"); - message.audioMessage = $root.proto.AudioMessage.fromObject(object.audioMessage); - } - if (object.videoMessage != null) { - if (typeof object.videoMessage !== "object") - throw TypeError(".proto.Message.videoMessage: object expected"); - message.videoMessage = $root.proto.VideoMessage.fromObject(object.videoMessage); - } - if (object.call != null) { - if (typeof object.call !== "object") - throw TypeError(".proto.Message.call: object expected"); - message.call = $root.proto.Call.fromObject(object.call); - } - if (object.chat != null) { - if (typeof object.chat !== "object") - throw TypeError(".proto.Message.chat: object expected"); - message.chat = $root.proto.Chat.fromObject(object.chat); - } - if (object.protocolMessage != null) { - if (typeof object.protocolMessage !== "object") - throw TypeError(".proto.Message.protocolMessage: object expected"); - message.protocolMessage = $root.proto.ProtocolMessage.fromObject(object.protocolMessage); - } - if (object.contactsArrayMessage != null) { - if (typeof object.contactsArrayMessage !== "object") - throw TypeError(".proto.Message.contactsArrayMessage: object expected"); - message.contactsArrayMessage = $root.proto.ContactsArrayMessage.fromObject(object.contactsArrayMessage); - } - if (object.highlyStructuredMessage != null) { - if (typeof object.highlyStructuredMessage !== "object") - throw TypeError(".proto.Message.highlyStructuredMessage: object expected"); - message.highlyStructuredMessage = $root.proto.HighlyStructuredMessage.fromObject(object.highlyStructuredMessage); - } - if (object.fastRatchetKeySenderKeyDistributionMessage != null) { - if (typeof object.fastRatchetKeySenderKeyDistributionMessage !== "object") - throw TypeError(".proto.Message.fastRatchetKeySenderKeyDistributionMessage: object expected"); - message.fastRatchetKeySenderKeyDistributionMessage = $root.proto.SenderKeyDistributionMessage.fromObject(object.fastRatchetKeySenderKeyDistributionMessage); - } - if (object.sendPaymentMessage != null) { - if (typeof object.sendPaymentMessage !== "object") - throw TypeError(".proto.Message.sendPaymentMessage: object expected"); - message.sendPaymentMessage = $root.proto.SendPaymentMessage.fromObject(object.sendPaymentMessage); - } - if (object.liveLocationMessage != null) { - if (typeof object.liveLocationMessage !== "object") - throw TypeError(".proto.Message.liveLocationMessage: object expected"); - message.liveLocationMessage = $root.proto.LiveLocationMessage.fromObject(object.liveLocationMessage); - } - if (object.requestPaymentMessage != null) { - if (typeof object.requestPaymentMessage !== "object") - throw TypeError(".proto.Message.requestPaymentMessage: object expected"); - message.requestPaymentMessage = $root.proto.RequestPaymentMessage.fromObject(object.requestPaymentMessage); - } - if (object.declinePaymentRequestMessage != null) { - if (typeof object.declinePaymentRequestMessage !== "object") - throw TypeError(".proto.Message.declinePaymentRequestMessage: object expected"); - message.declinePaymentRequestMessage = $root.proto.DeclinePaymentRequestMessage.fromObject(object.declinePaymentRequestMessage); - } - if (object.cancelPaymentRequestMessage != null) { - if (typeof object.cancelPaymentRequestMessage !== "object") - throw TypeError(".proto.Message.cancelPaymentRequestMessage: object expected"); - message.cancelPaymentRequestMessage = $root.proto.CancelPaymentRequestMessage.fromObject(object.cancelPaymentRequestMessage); - } - if (object.templateMessage != null) { - if (typeof object.templateMessage !== "object") - throw TypeError(".proto.Message.templateMessage: object expected"); - message.templateMessage = $root.proto.TemplateMessage.fromObject(object.templateMessage); - } - if (object.stickerMessage != null) { - if (typeof object.stickerMessage !== "object") - throw TypeError(".proto.Message.stickerMessage: object expected"); - message.stickerMessage = $root.proto.StickerMessage.fromObject(object.stickerMessage); - } - if (object.groupInviteMessage != null) { - if (typeof object.groupInviteMessage !== "object") - throw TypeError(".proto.Message.groupInviteMessage: object expected"); - message.groupInviteMessage = $root.proto.GroupInviteMessage.fromObject(object.groupInviteMessage); - } - if (object.templateButtonReplyMessage != null) { - if (typeof object.templateButtonReplyMessage !== "object") - throw TypeError(".proto.Message.templateButtonReplyMessage: object expected"); - message.templateButtonReplyMessage = $root.proto.TemplateButtonReplyMessage.fromObject(object.templateButtonReplyMessage); - } - if (object.productMessage != null) { - if (typeof object.productMessage !== "object") - throw TypeError(".proto.Message.productMessage: object expected"); - message.productMessage = $root.proto.ProductMessage.fromObject(object.productMessage); - } - if (object.deviceSentMessage != null) { - if (typeof object.deviceSentMessage !== "object") - throw TypeError(".proto.Message.deviceSentMessage: object expected"); - message.deviceSentMessage = $root.proto.DeviceSentMessage.fromObject(object.deviceSentMessage); - } - if (object.messageContextInfo != null) { - if (typeof object.messageContextInfo !== "object") - throw TypeError(".proto.Message.messageContextInfo: object expected"); - message.messageContextInfo = $root.proto.MessageContextInfo.fromObject(object.messageContextInfo); - } - if (object.listMessage != null) { - if (typeof object.listMessage !== "object") - throw TypeError(".proto.Message.listMessage: object expected"); - message.listMessage = $root.proto.ListMessage.fromObject(object.listMessage); - } - if (object.viewOnceMessage != null) { - if (typeof object.viewOnceMessage !== "object") - throw TypeError(".proto.Message.viewOnceMessage: object expected"); - message.viewOnceMessage = $root.proto.FutureProofMessage.fromObject(object.viewOnceMessage); - } - if (object.orderMessage != null) { - if (typeof object.orderMessage !== "object") - throw TypeError(".proto.Message.orderMessage: object expected"); - message.orderMessage = $root.proto.OrderMessage.fromObject(object.orderMessage); - } - if (object.listResponseMessage != null) { - if (typeof object.listResponseMessage !== "object") - throw TypeError(".proto.Message.listResponseMessage: object expected"); - message.listResponseMessage = $root.proto.ListResponseMessage.fromObject(object.listResponseMessage); - } - if (object.ephemeralMessage != null) { - if (typeof object.ephemeralMessage !== "object") - throw TypeError(".proto.Message.ephemeralMessage: object expected"); - message.ephemeralMessage = $root.proto.FutureProofMessage.fromObject(object.ephemeralMessage); - } - if (object.invoiceMessage != null) { - if (typeof object.invoiceMessage !== "object") - throw TypeError(".proto.Message.invoiceMessage: object expected"); - message.invoiceMessage = $root.proto.InvoiceMessage.fromObject(object.invoiceMessage); - } - if (object.buttonsMessage != null) { - if (typeof object.buttonsMessage !== "object") - throw TypeError(".proto.Message.buttonsMessage: object expected"); - message.buttonsMessage = $root.proto.ButtonsMessage.fromObject(object.buttonsMessage); - } - if (object.buttonsResponseMessage != null) { - if (typeof object.buttonsResponseMessage !== "object") - throw TypeError(".proto.Message.buttonsResponseMessage: object expected"); - message.buttonsResponseMessage = $root.proto.ButtonsResponseMessage.fromObject(object.buttonsResponseMessage); - } - if (object.paymentInviteMessage != null) { - if (typeof object.paymentInviteMessage !== "object") - throw TypeError(".proto.Message.paymentInviteMessage: object expected"); - message.paymentInviteMessage = $root.proto.PaymentInviteMessage.fromObject(object.paymentInviteMessage); - } - if (object.interactiveMessage != null) { - if (typeof object.interactiveMessage !== "object") - throw TypeError(".proto.Message.interactiveMessage: object expected"); - message.interactiveMessage = $root.proto.InteractiveMessage.fromObject(object.interactiveMessage); - } - if (object.reactionMessage != null) { - if (typeof object.reactionMessage !== "object") - throw TypeError(".proto.Message.reactionMessage: object expected"); - message.reactionMessage = $root.proto.ReactionMessage.fromObject(object.reactionMessage); - } - if (object.stickerSyncRmrMessage != null) { - if (typeof object.stickerSyncRmrMessage !== "object") - throw TypeError(".proto.Message.stickerSyncRmrMessage: object expected"); - message.stickerSyncRmrMessage = $root.proto.StickerSyncRMRMessage.fromObject(object.stickerSyncRmrMessage); - } + var message = new $root.proto.RecentEmojiWeight(); + if (object.emoji != null) + message.emoji = String(object.emoji); + if (object.weight != null) + message.weight = Number(object.weight); return message; }; /** - * Creates a plain object from a Message message. Also converts values to other types if specified. + * Creates a plain object from a RecentEmojiWeight message. Also converts values to other types if specified. * @function toObject - * @memberof proto.Message + * @memberof proto.RecentEmojiWeight * @static - * @param {proto.Message} message Message + * @param {proto.RecentEmojiWeight} message RecentEmojiWeight * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Message.toObject = function toObject(message, options) { + RecentEmojiWeight.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.conversation = ""; - object.senderKeyDistributionMessage = null; - object.imageMessage = null; - object.contactMessage = null; - object.locationMessage = null; - object.extendedTextMessage = null; - object.documentMessage = null; - object.audioMessage = null; - object.videoMessage = null; - object.call = null; - object.chat = null; - object.protocolMessage = null; - object.contactsArrayMessage = null; - object.highlyStructuredMessage = null; - object.fastRatchetKeySenderKeyDistributionMessage = null; - object.sendPaymentMessage = null; - object.liveLocationMessage = null; - object.requestPaymentMessage = null; - object.declinePaymentRequestMessage = null; - object.cancelPaymentRequestMessage = null; - object.templateMessage = null; - object.stickerMessage = null; - object.groupInviteMessage = null; - object.templateButtonReplyMessage = null; - object.productMessage = null; - object.deviceSentMessage = null; - object.messageContextInfo = null; - object.listMessage = null; - object.viewOnceMessage = null; - object.orderMessage = null; - object.listResponseMessage = null; - object.ephemeralMessage = null; - object.invoiceMessage = null; - object.buttonsMessage = null; - object.buttonsResponseMessage = null; - object.paymentInviteMessage = null; - object.interactiveMessage = null; - object.reactionMessage = null; - object.stickerSyncRmrMessage = null; + object.emoji = ""; + object.weight = 0; } - if (message.conversation != null && message.hasOwnProperty("conversation")) - object.conversation = message.conversation; - if (message.senderKeyDistributionMessage != null && message.hasOwnProperty("senderKeyDistributionMessage")) - object.senderKeyDistributionMessage = $root.proto.SenderKeyDistributionMessage.toObject(message.senderKeyDistributionMessage, options); - if (message.imageMessage != null && message.hasOwnProperty("imageMessage")) - object.imageMessage = $root.proto.ImageMessage.toObject(message.imageMessage, options); - if (message.contactMessage != null && message.hasOwnProperty("contactMessage")) - object.contactMessage = $root.proto.ContactMessage.toObject(message.contactMessage, options); - if (message.locationMessage != null && message.hasOwnProperty("locationMessage")) - object.locationMessage = $root.proto.LocationMessage.toObject(message.locationMessage, options); - if (message.extendedTextMessage != null && message.hasOwnProperty("extendedTextMessage")) - object.extendedTextMessage = $root.proto.ExtendedTextMessage.toObject(message.extendedTextMessage, options); - if (message.documentMessage != null && message.hasOwnProperty("documentMessage")) - object.documentMessage = $root.proto.DocumentMessage.toObject(message.documentMessage, options); - if (message.audioMessage != null && message.hasOwnProperty("audioMessage")) - object.audioMessage = $root.proto.AudioMessage.toObject(message.audioMessage, options); - if (message.videoMessage != null && message.hasOwnProperty("videoMessage")) - object.videoMessage = $root.proto.VideoMessage.toObject(message.videoMessage, options); - if (message.call != null && message.hasOwnProperty("call")) - object.call = $root.proto.Call.toObject(message.call, options); - if (message.chat != null && message.hasOwnProperty("chat")) - object.chat = $root.proto.Chat.toObject(message.chat, options); - if (message.protocolMessage != null && message.hasOwnProperty("protocolMessage")) - object.protocolMessage = $root.proto.ProtocolMessage.toObject(message.protocolMessage, options); - if (message.contactsArrayMessage != null && message.hasOwnProperty("contactsArrayMessage")) - object.contactsArrayMessage = $root.proto.ContactsArrayMessage.toObject(message.contactsArrayMessage, options); - if (message.highlyStructuredMessage != null && message.hasOwnProperty("highlyStructuredMessage")) - object.highlyStructuredMessage = $root.proto.HighlyStructuredMessage.toObject(message.highlyStructuredMessage, options); - if (message.fastRatchetKeySenderKeyDistributionMessage != null && message.hasOwnProperty("fastRatchetKeySenderKeyDistributionMessage")) - object.fastRatchetKeySenderKeyDistributionMessage = $root.proto.SenderKeyDistributionMessage.toObject(message.fastRatchetKeySenderKeyDistributionMessage, options); - if (message.sendPaymentMessage != null && message.hasOwnProperty("sendPaymentMessage")) - object.sendPaymentMessage = $root.proto.SendPaymentMessage.toObject(message.sendPaymentMessage, options); - if (message.liveLocationMessage != null && message.hasOwnProperty("liveLocationMessage")) - object.liveLocationMessage = $root.proto.LiveLocationMessage.toObject(message.liveLocationMessage, options); - if (message.requestPaymentMessage != null && message.hasOwnProperty("requestPaymentMessage")) - object.requestPaymentMessage = $root.proto.RequestPaymentMessage.toObject(message.requestPaymentMessage, options); - if (message.declinePaymentRequestMessage != null && message.hasOwnProperty("declinePaymentRequestMessage")) - object.declinePaymentRequestMessage = $root.proto.DeclinePaymentRequestMessage.toObject(message.declinePaymentRequestMessage, options); - if (message.cancelPaymentRequestMessage != null && message.hasOwnProperty("cancelPaymentRequestMessage")) - object.cancelPaymentRequestMessage = $root.proto.CancelPaymentRequestMessage.toObject(message.cancelPaymentRequestMessage, options); - if (message.templateMessage != null && message.hasOwnProperty("templateMessage")) - object.templateMessage = $root.proto.TemplateMessage.toObject(message.templateMessage, options); - if (message.stickerMessage != null && message.hasOwnProperty("stickerMessage")) - object.stickerMessage = $root.proto.StickerMessage.toObject(message.stickerMessage, options); - if (message.groupInviteMessage != null && message.hasOwnProperty("groupInviteMessage")) - object.groupInviteMessage = $root.proto.GroupInviteMessage.toObject(message.groupInviteMessage, options); - if (message.templateButtonReplyMessage != null && message.hasOwnProperty("templateButtonReplyMessage")) - object.templateButtonReplyMessage = $root.proto.TemplateButtonReplyMessage.toObject(message.templateButtonReplyMessage, options); - if (message.productMessage != null && message.hasOwnProperty("productMessage")) - object.productMessage = $root.proto.ProductMessage.toObject(message.productMessage, options); - if (message.deviceSentMessage != null && message.hasOwnProperty("deviceSentMessage")) - object.deviceSentMessage = $root.proto.DeviceSentMessage.toObject(message.deviceSentMessage, options); - if (message.messageContextInfo != null && message.hasOwnProperty("messageContextInfo")) - object.messageContextInfo = $root.proto.MessageContextInfo.toObject(message.messageContextInfo, options); - if (message.listMessage != null && message.hasOwnProperty("listMessage")) - object.listMessage = $root.proto.ListMessage.toObject(message.listMessage, options); - if (message.viewOnceMessage != null && message.hasOwnProperty("viewOnceMessage")) - object.viewOnceMessage = $root.proto.FutureProofMessage.toObject(message.viewOnceMessage, options); - if (message.orderMessage != null && message.hasOwnProperty("orderMessage")) - object.orderMessage = $root.proto.OrderMessage.toObject(message.orderMessage, options); - if (message.listResponseMessage != null && message.hasOwnProperty("listResponseMessage")) - object.listResponseMessage = $root.proto.ListResponseMessage.toObject(message.listResponseMessage, options); - if (message.ephemeralMessage != null && message.hasOwnProperty("ephemeralMessage")) - object.ephemeralMessage = $root.proto.FutureProofMessage.toObject(message.ephemeralMessage, options); - if (message.invoiceMessage != null && message.hasOwnProperty("invoiceMessage")) - object.invoiceMessage = $root.proto.InvoiceMessage.toObject(message.invoiceMessage, options); - if (message.buttonsMessage != null && message.hasOwnProperty("buttonsMessage")) - object.buttonsMessage = $root.proto.ButtonsMessage.toObject(message.buttonsMessage, options); - if (message.buttonsResponseMessage != null && message.hasOwnProperty("buttonsResponseMessage")) - object.buttonsResponseMessage = $root.proto.ButtonsResponseMessage.toObject(message.buttonsResponseMessage, options); - if (message.paymentInviteMessage != null && message.hasOwnProperty("paymentInviteMessage")) - object.paymentInviteMessage = $root.proto.PaymentInviteMessage.toObject(message.paymentInviteMessage, options); - if (message.interactiveMessage != null && message.hasOwnProperty("interactiveMessage")) - object.interactiveMessage = $root.proto.InteractiveMessage.toObject(message.interactiveMessage, options); - if (message.reactionMessage != null && message.hasOwnProperty("reactionMessage")) - object.reactionMessage = $root.proto.ReactionMessage.toObject(message.reactionMessage, options); - if (message.stickerSyncRmrMessage != null && message.hasOwnProperty("stickerSyncRmrMessage")) - object.stickerSyncRmrMessage = $root.proto.StickerSyncRMRMessage.toObject(message.stickerSyncRmrMessage, options); + if (message.emoji != null && message.hasOwnProperty("emoji")) + object.emoji = message.emoji; + if (message.weight != null && message.hasOwnProperty("weight")) + object.weight = options.json && !isFinite(message.weight) ? String(message.weight) : message.weight; return object; }; /** - * Converts this Message to JSON. + * Converts this RecentEmojiWeight to JSON. * @function toJSON - * @memberof proto.Message + * @memberof proto.RecentEmojiWeight * @instance * @returns {Object.} JSON object */ - Message.prototype.toJSON = function toJSON() { + RecentEmojiWeight.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return Message; + return RecentEmojiWeight; })(); - proto.ActionLink = (function() { + proto.RecentEmojiWeightsAction = (function() { /** - * Properties of an ActionLink. + * Properties of a RecentEmojiWeightsAction. * @memberof proto - * @interface IActionLink - * @property {string|null} [url] ActionLink url - * @property {string|null} [buttonTitle] ActionLink buttonTitle + * @interface IRecentEmojiWeightsAction + * @property {Array.|null} [weights] RecentEmojiWeightsAction weights */ /** - * Constructs a new ActionLink. + * Constructs a new RecentEmojiWeightsAction. * @memberof proto - * @classdesc Represents an ActionLink. - * @implements IActionLink + * @classdesc Represents a RecentEmojiWeightsAction. + * @implements IRecentEmojiWeightsAction * @constructor - * @param {proto.IActionLink=} [properties] Properties to set + * @param {proto.IRecentEmojiWeightsAction=} [properties] Properties to set */ - function ActionLink(properties) { + function RecentEmojiWeightsAction(properties) { + this.weights = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -46899,88 +45411,78 @@ $root.proto = (function() { } /** - * ActionLink url. - * @member {string} url - * @memberof proto.ActionLink - * @instance - */ - ActionLink.prototype.url = ""; - - /** - * ActionLink buttonTitle. - * @member {string} buttonTitle - * @memberof proto.ActionLink + * RecentEmojiWeightsAction weights. + * @member {Array.} weights + * @memberof proto.RecentEmojiWeightsAction * @instance */ - ActionLink.prototype.buttonTitle = ""; + RecentEmojiWeightsAction.prototype.weights = $util.emptyArray; /** - * Creates a new ActionLink instance using the specified properties. + * Creates a new RecentEmojiWeightsAction instance using the specified properties. * @function create - * @memberof proto.ActionLink + * @memberof proto.RecentEmojiWeightsAction * @static - * @param {proto.IActionLink=} [properties] Properties to set - * @returns {proto.ActionLink} ActionLink instance + * @param {proto.IRecentEmojiWeightsAction=} [properties] Properties to set + * @returns {proto.RecentEmojiWeightsAction} RecentEmojiWeightsAction instance */ - ActionLink.create = function create(properties) { - return new ActionLink(properties); + RecentEmojiWeightsAction.create = function create(properties) { + return new RecentEmojiWeightsAction(properties); }; /** - * Encodes the specified ActionLink message. Does not implicitly {@link proto.ActionLink.verify|verify} messages. + * Encodes the specified RecentEmojiWeightsAction message. Does not implicitly {@link proto.RecentEmojiWeightsAction.verify|verify} messages. * @function encode - * @memberof proto.ActionLink + * @memberof proto.RecentEmojiWeightsAction * @static - * @param {proto.IActionLink} message ActionLink message or plain object to encode + * @param {proto.IRecentEmojiWeightsAction} message RecentEmojiWeightsAction message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ActionLink.encode = function encode(message, writer) { + RecentEmojiWeightsAction.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.url != null && Object.hasOwnProperty.call(message, "url")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.url); - if (message.buttonTitle != null && Object.hasOwnProperty.call(message, "buttonTitle")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.buttonTitle); + if (message.weights != null && message.weights.length) + for (var i = 0; i < message.weights.length; ++i) + $root.proto.RecentEmojiWeight.encode(message.weights[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; /** - * Encodes the specified ActionLink message, length delimited. Does not implicitly {@link proto.ActionLink.verify|verify} messages. + * Encodes the specified RecentEmojiWeightsAction message, length delimited. Does not implicitly {@link proto.RecentEmojiWeightsAction.verify|verify} messages. * @function encodeDelimited - * @memberof proto.ActionLink + * @memberof proto.RecentEmojiWeightsAction * @static - * @param {proto.IActionLink} message ActionLink message or plain object to encode + * @param {proto.IRecentEmojiWeightsAction} message RecentEmojiWeightsAction message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ActionLink.encodeDelimited = function encodeDelimited(message, writer) { + RecentEmojiWeightsAction.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an ActionLink message from the specified reader or buffer. + * Decodes a RecentEmojiWeightsAction message from the specified reader or buffer. * @function decode - * @memberof proto.ActionLink + * @memberof proto.RecentEmojiWeightsAction * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {proto.ActionLink} ActionLink + * @returns {proto.RecentEmojiWeightsAction} RecentEmojiWeightsAction * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ActionLink.decode = function decode(reader, length) { + RecentEmojiWeightsAction.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.ActionLink(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.RecentEmojiWeightsAction(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.url = reader.string(); - break; - case 2: - message.buttonTitle = reader.string(); + if (!(message.weights && message.weights.length)) + message.weights = []; + message.weights.push($root.proto.RecentEmojiWeight.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -46991,116 +45493,130 @@ $root.proto = (function() { }; /** - * Decodes an ActionLink message from the specified reader or buffer, length delimited. + * Decodes a RecentEmojiWeightsAction message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof proto.ActionLink + * @memberof proto.RecentEmojiWeightsAction * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.ActionLink} ActionLink + * @returns {proto.RecentEmojiWeightsAction} RecentEmojiWeightsAction * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ActionLink.decodeDelimited = function decodeDelimited(reader) { + RecentEmojiWeightsAction.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an ActionLink message. + * Verifies a RecentEmojiWeightsAction message. * @function verify - * @memberof proto.ActionLink + * @memberof proto.RecentEmojiWeightsAction * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ActionLink.verify = function verify(message) { + RecentEmojiWeightsAction.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.url != null && message.hasOwnProperty("url")) - if (!$util.isString(message.url)) - return "url: string expected"; - if (message.buttonTitle != null && message.hasOwnProperty("buttonTitle")) - if (!$util.isString(message.buttonTitle)) - return "buttonTitle: string expected"; + if (message.weights != null && message.hasOwnProperty("weights")) { + if (!Array.isArray(message.weights)) + return "weights: array expected"; + for (var i = 0; i < message.weights.length; ++i) { + var error = $root.proto.RecentEmojiWeight.verify(message.weights[i]); + if (error) + return "weights." + error; + } + } return null; }; /** - * Creates an ActionLink message from a plain object. Also converts values to their respective internal types. + * Creates a RecentEmojiWeightsAction message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof proto.ActionLink + * @memberof proto.RecentEmojiWeightsAction * @static * @param {Object.} object Plain object - * @returns {proto.ActionLink} ActionLink + * @returns {proto.RecentEmojiWeightsAction} RecentEmojiWeightsAction */ - ActionLink.fromObject = function fromObject(object) { - if (object instanceof $root.proto.ActionLink) + RecentEmojiWeightsAction.fromObject = function fromObject(object) { + if (object instanceof $root.proto.RecentEmojiWeightsAction) return object; - var message = new $root.proto.ActionLink(); - if (object.url != null) - message.url = String(object.url); - if (object.buttonTitle != null) - message.buttonTitle = String(object.buttonTitle); + var message = new $root.proto.RecentEmojiWeightsAction(); + if (object.weights) { + if (!Array.isArray(object.weights)) + throw TypeError(".proto.RecentEmojiWeightsAction.weights: array expected"); + message.weights = []; + for (var i = 0; i < object.weights.length; ++i) { + if (typeof object.weights[i] !== "object") + throw TypeError(".proto.RecentEmojiWeightsAction.weights: object expected"); + message.weights[i] = $root.proto.RecentEmojiWeight.fromObject(object.weights[i]); + } + } return message; }; /** - * Creates a plain object from an ActionLink message. Also converts values to other types if specified. + * Creates a plain object from a RecentEmojiWeightsAction message. Also converts values to other types if specified. * @function toObject - * @memberof proto.ActionLink + * @memberof proto.RecentEmojiWeightsAction * @static - * @param {proto.ActionLink} message ActionLink + * @param {proto.RecentEmojiWeightsAction} message RecentEmojiWeightsAction * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ActionLink.toObject = function toObject(message, options) { + RecentEmojiWeightsAction.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.url = ""; - object.buttonTitle = ""; + if (options.arrays || options.defaults) + object.weights = []; + if (message.weights && message.weights.length) { + object.weights = []; + for (var j = 0; j < message.weights.length; ++j) + object.weights[j] = $root.proto.RecentEmojiWeight.toObject(message.weights[j], options); } - if (message.url != null && message.hasOwnProperty("url")) - object.url = message.url; - if (message.buttonTitle != null && message.hasOwnProperty("buttonTitle")) - object.buttonTitle = message.buttonTitle; return object; }; /** - * Converts this ActionLink to JSON. + * Converts this RecentEmojiWeightsAction to JSON. * @function toJSON - * @memberof proto.ActionLink + * @memberof proto.RecentEmojiWeightsAction * @instance * @returns {Object.} JSON object */ - ActionLink.prototype.toJSON = function toJSON() { + RecentEmojiWeightsAction.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ActionLink; + return RecentEmojiWeightsAction; })(); - proto.DisappearingMode = (function() { + proto.RecentStickerMetadata = (function() { /** - * Properties of a DisappearingMode. + * Properties of a RecentStickerMetadata. * @memberof proto - * @interface IDisappearingMode - * @property {proto.DisappearingMode.DisappearingModeInitiator|null} [initiator] DisappearingMode initiator + * @interface IRecentStickerMetadata + * @property {string|null} [directPath] RecentStickerMetadata directPath + * @property {string|null} [encFilehash] RecentStickerMetadata encFilehash + * @property {string|null} [mediaKey] RecentStickerMetadata mediaKey + * @property {string|null} [stanzaId] RecentStickerMetadata stanzaId + * @property {string|null} [chatJid] RecentStickerMetadata chatJid + * @property {string|null} [participant] RecentStickerMetadata participant + * @property {boolean|null} [isSentByMe] RecentStickerMetadata isSentByMe */ /** - * Constructs a new DisappearingMode. + * Constructs a new RecentStickerMetadata. * @memberof proto - * @classdesc Represents a DisappearingMode. - * @implements IDisappearingMode + * @classdesc Represents a RecentStickerMetadata. + * @implements IRecentStickerMetadata * @constructor - * @param {proto.IDisappearingMode=} [properties] Properties to set + * @param {proto.IRecentStickerMetadata=} [properties] Properties to set */ - function DisappearingMode(properties) { + function RecentStickerMetadata(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -47108,75 +45624,153 @@ $root.proto = (function() { } /** - * DisappearingMode initiator. - * @member {proto.DisappearingMode.DisappearingModeInitiator} initiator - * @memberof proto.DisappearingMode + * RecentStickerMetadata directPath. + * @member {string} directPath + * @memberof proto.RecentStickerMetadata * @instance */ - DisappearingMode.prototype.initiator = 0; + RecentStickerMetadata.prototype.directPath = ""; /** - * Creates a new DisappearingMode instance using the specified properties. + * RecentStickerMetadata encFilehash. + * @member {string} encFilehash + * @memberof proto.RecentStickerMetadata + * @instance + */ + RecentStickerMetadata.prototype.encFilehash = ""; + + /** + * RecentStickerMetadata mediaKey. + * @member {string} mediaKey + * @memberof proto.RecentStickerMetadata + * @instance + */ + RecentStickerMetadata.prototype.mediaKey = ""; + + /** + * RecentStickerMetadata stanzaId. + * @member {string} stanzaId + * @memberof proto.RecentStickerMetadata + * @instance + */ + RecentStickerMetadata.prototype.stanzaId = ""; + + /** + * RecentStickerMetadata chatJid. + * @member {string} chatJid + * @memberof proto.RecentStickerMetadata + * @instance + */ + RecentStickerMetadata.prototype.chatJid = ""; + + /** + * RecentStickerMetadata participant. + * @member {string} participant + * @memberof proto.RecentStickerMetadata + * @instance + */ + RecentStickerMetadata.prototype.participant = ""; + + /** + * RecentStickerMetadata isSentByMe. + * @member {boolean} isSentByMe + * @memberof proto.RecentStickerMetadata + * @instance + */ + RecentStickerMetadata.prototype.isSentByMe = false; + + /** + * Creates a new RecentStickerMetadata instance using the specified properties. * @function create - * @memberof proto.DisappearingMode + * @memberof proto.RecentStickerMetadata * @static - * @param {proto.IDisappearingMode=} [properties] Properties to set - * @returns {proto.DisappearingMode} DisappearingMode instance + * @param {proto.IRecentStickerMetadata=} [properties] Properties to set + * @returns {proto.RecentStickerMetadata} RecentStickerMetadata instance */ - DisappearingMode.create = function create(properties) { - return new DisappearingMode(properties); + RecentStickerMetadata.create = function create(properties) { + return new RecentStickerMetadata(properties); }; /** - * Encodes the specified DisappearingMode message. Does not implicitly {@link proto.DisappearingMode.verify|verify} messages. + * Encodes the specified RecentStickerMetadata message. Does not implicitly {@link proto.RecentStickerMetadata.verify|verify} messages. * @function encode - * @memberof proto.DisappearingMode + * @memberof proto.RecentStickerMetadata * @static - * @param {proto.IDisappearingMode} message DisappearingMode message or plain object to encode + * @param {proto.IRecentStickerMetadata} message RecentStickerMetadata message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DisappearingMode.encode = function encode(message, writer) { + RecentStickerMetadata.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.initiator != null && Object.hasOwnProperty.call(message, "initiator")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.initiator); + if (message.directPath != null && Object.hasOwnProperty.call(message, "directPath")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.directPath); + if (message.encFilehash != null && Object.hasOwnProperty.call(message, "encFilehash")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.encFilehash); + if (message.mediaKey != null && Object.hasOwnProperty.call(message, "mediaKey")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.mediaKey); + if (message.stanzaId != null && Object.hasOwnProperty.call(message, "stanzaId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.stanzaId); + if (message.chatJid != null && Object.hasOwnProperty.call(message, "chatJid")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.chatJid); + if (message.participant != null && Object.hasOwnProperty.call(message, "participant")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.participant); + if (message.isSentByMe != null && Object.hasOwnProperty.call(message, "isSentByMe")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.isSentByMe); return writer; }; /** - * Encodes the specified DisappearingMode message, length delimited. Does not implicitly {@link proto.DisappearingMode.verify|verify} messages. + * Encodes the specified RecentStickerMetadata message, length delimited. Does not implicitly {@link proto.RecentStickerMetadata.verify|verify} messages. * @function encodeDelimited - * @memberof proto.DisappearingMode + * @memberof proto.RecentStickerMetadata * @static - * @param {proto.IDisappearingMode} message DisappearingMode message or plain object to encode + * @param {proto.IRecentStickerMetadata} message RecentStickerMetadata message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DisappearingMode.encodeDelimited = function encodeDelimited(message, writer) { + RecentStickerMetadata.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a DisappearingMode message from the specified reader or buffer. + * Decodes a RecentStickerMetadata message from the specified reader or buffer. * @function decode - * @memberof proto.DisappearingMode + * @memberof proto.RecentStickerMetadata * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {proto.DisappearingMode} DisappearingMode + * @returns {proto.RecentStickerMetadata} RecentStickerMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DisappearingMode.decode = function decode(reader, length) { + RecentStickerMetadata.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.DisappearingMode(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.RecentStickerMetadata(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.initiator = reader.int32(); + message.directPath = reader.string(); + break; + case 2: + message.encFilehash = reader.string(); + break; + case 3: + message.mediaKey = reader.string(); + break; + case 4: + message.stanzaId = reader.string(); + break; + case 5: + message.chatJid = reader.string(); + break; + case 6: + message.participant = reader.string(); + break; + case 7: + message.isSentByMe = reader.bool(); break; default: reader.skipType(tag & 7); @@ -47187,145 +45781,157 @@ $root.proto = (function() { }; /** - * Decodes a DisappearingMode message from the specified reader or buffer, length delimited. + * Decodes a RecentStickerMetadata message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof proto.DisappearingMode + * @memberof proto.RecentStickerMetadata * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.DisappearingMode} DisappearingMode + * @returns {proto.RecentStickerMetadata} RecentStickerMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DisappearingMode.decodeDelimited = function decodeDelimited(reader) { + RecentStickerMetadata.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a DisappearingMode message. + * Verifies a RecentStickerMetadata message. * @function verify - * @memberof proto.DisappearingMode + * @memberof proto.RecentStickerMetadata * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - DisappearingMode.verify = function verify(message) { + RecentStickerMetadata.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.initiator != null && message.hasOwnProperty("initiator")) - switch (message.initiator) { - default: - return "initiator: enum value expected"; - case 0: - case 1: - case 2: - break; - } + if (message.directPath != null && message.hasOwnProperty("directPath")) + if (!$util.isString(message.directPath)) + return "directPath: string expected"; + if (message.encFilehash != null && message.hasOwnProperty("encFilehash")) + if (!$util.isString(message.encFilehash)) + return "encFilehash: string expected"; + if (message.mediaKey != null && message.hasOwnProperty("mediaKey")) + if (!$util.isString(message.mediaKey)) + return "mediaKey: string expected"; + if (message.stanzaId != null && message.hasOwnProperty("stanzaId")) + if (!$util.isString(message.stanzaId)) + return "stanzaId: string expected"; + if (message.chatJid != null && message.hasOwnProperty("chatJid")) + if (!$util.isString(message.chatJid)) + return "chatJid: string expected"; + if (message.participant != null && message.hasOwnProperty("participant")) + if (!$util.isString(message.participant)) + return "participant: string expected"; + if (message.isSentByMe != null && message.hasOwnProperty("isSentByMe")) + if (typeof message.isSentByMe !== "boolean") + return "isSentByMe: boolean expected"; return null; }; /** - * Creates a DisappearingMode message from a plain object. Also converts values to their respective internal types. + * Creates a RecentStickerMetadata message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof proto.DisappearingMode + * @memberof proto.RecentStickerMetadata * @static * @param {Object.} object Plain object - * @returns {proto.DisappearingMode} DisappearingMode + * @returns {proto.RecentStickerMetadata} RecentStickerMetadata */ - DisappearingMode.fromObject = function fromObject(object) { - if (object instanceof $root.proto.DisappearingMode) + RecentStickerMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.proto.RecentStickerMetadata) return object; - var message = new $root.proto.DisappearingMode(); - switch (object.initiator) { - case "CHANGED_IN_CHAT": - case 0: - message.initiator = 0; - break; - case "INITIATED_BY_ME": - case 1: - message.initiator = 1; - break; - case "INITIATED_BY_OTHER": - case 2: - message.initiator = 2; - break; - } + var message = new $root.proto.RecentStickerMetadata(); + if (object.directPath != null) + message.directPath = String(object.directPath); + if (object.encFilehash != null) + message.encFilehash = String(object.encFilehash); + if (object.mediaKey != null) + message.mediaKey = String(object.mediaKey); + if (object.stanzaId != null) + message.stanzaId = String(object.stanzaId); + if (object.chatJid != null) + message.chatJid = String(object.chatJid); + if (object.participant != null) + message.participant = String(object.participant); + if (object.isSentByMe != null) + message.isSentByMe = Boolean(object.isSentByMe); return message; }; /** - * Creates a plain object from a DisappearingMode message. Also converts values to other types if specified. + * Creates a plain object from a RecentStickerMetadata message. Also converts values to other types if specified. * @function toObject - * @memberof proto.DisappearingMode + * @memberof proto.RecentStickerMetadata * @static - * @param {proto.DisappearingMode} message DisappearingMode + * @param {proto.RecentStickerMetadata} message RecentStickerMetadata * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DisappearingMode.toObject = function toObject(message, options) { + RecentStickerMetadata.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) - object.initiator = options.enums === String ? "CHANGED_IN_CHAT" : 0; - if (message.initiator != null && message.hasOwnProperty("initiator")) - object.initiator = options.enums === String ? $root.proto.DisappearingMode.DisappearingModeInitiator[message.initiator] : message.initiator; + if (options.defaults) { + object.directPath = ""; + object.encFilehash = ""; + object.mediaKey = ""; + object.stanzaId = ""; + object.chatJid = ""; + object.participant = ""; + object.isSentByMe = false; + } + if (message.directPath != null && message.hasOwnProperty("directPath")) + object.directPath = message.directPath; + if (message.encFilehash != null && message.hasOwnProperty("encFilehash")) + object.encFilehash = message.encFilehash; + if (message.mediaKey != null && message.hasOwnProperty("mediaKey")) + object.mediaKey = message.mediaKey; + if (message.stanzaId != null && message.hasOwnProperty("stanzaId")) + object.stanzaId = message.stanzaId; + if (message.chatJid != null && message.hasOwnProperty("chatJid")) + object.chatJid = message.chatJid; + if (message.participant != null && message.hasOwnProperty("participant")) + object.participant = message.participant; + if (message.isSentByMe != null && message.hasOwnProperty("isSentByMe")) + object.isSentByMe = message.isSentByMe; return object; }; /** - * Converts this DisappearingMode to JSON. + * Converts this RecentStickerMetadata to JSON. * @function toJSON - * @memberof proto.DisappearingMode + * @memberof proto.RecentStickerMetadata * @instance * @returns {Object.} JSON object */ - DisappearingMode.prototype.toJSON = function toJSON() { + RecentStickerMetadata.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - /** - * DisappearingModeInitiator enum. - * @name proto.DisappearingMode.DisappearingModeInitiator - * @enum {number} - * @property {number} CHANGED_IN_CHAT=0 CHANGED_IN_CHAT value - * @property {number} INITIATED_BY_ME=1 INITIATED_BY_ME value - * @property {number} INITIATED_BY_OTHER=2 INITIATED_BY_OTHER value - */ - DisappearingMode.DisappearingModeInitiator = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "CHANGED_IN_CHAT"] = 0; - values[valuesById[1] = "INITIATED_BY_ME"] = 1; - values[valuesById[2] = "INITIATED_BY_OTHER"] = 2; - return values; - })(); - - return DisappearingMode; + return RecentStickerMetadata; })(); - proto.PBMediaData = (function() { + proto.RecentStickerWeight = (function() { /** - * Properties of a PBMediaData. + * Properties of a RecentStickerWeight. * @memberof proto - * @interface IPBMediaData - * @property {Uint8Array|null} [mediaKey] PBMediaData mediaKey - * @property {number|Long|null} [mediaKeyTimestamp] PBMediaData mediaKeyTimestamp - * @property {Uint8Array|null} [fileSha256] PBMediaData fileSha256 - * @property {Uint8Array|null} [fileEncSha256] PBMediaData fileEncSha256 - * @property {string|null} [directPath] PBMediaData directPath + * @interface IRecentStickerWeight + * @property {string|null} [filehash] RecentStickerWeight filehash + * @property {number|null} [weight] RecentStickerWeight weight */ /** - * Constructs a new PBMediaData. + * Constructs a new RecentStickerWeight. * @memberof proto - * @classdesc Represents a PBMediaData. - * @implements IPBMediaData + * @classdesc Represents a RecentStickerWeight. + * @implements IRecentStickerWeight * @constructor - * @param {proto.IPBMediaData=} [properties] Properties to set + * @param {proto.IRecentStickerWeight=} [properties] Properties to set */ - function PBMediaData(properties) { + function RecentStickerWeight(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -47333,127 +45939,88 @@ $root.proto = (function() { } /** - * PBMediaData mediaKey. - * @member {Uint8Array} mediaKey - * @memberof proto.PBMediaData - * @instance - */ - PBMediaData.prototype.mediaKey = $util.newBuffer([]); - - /** - * PBMediaData mediaKeyTimestamp. - * @member {number|Long} mediaKeyTimestamp - * @memberof proto.PBMediaData - * @instance - */ - PBMediaData.prototype.mediaKeyTimestamp = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * PBMediaData fileSha256. - * @member {Uint8Array} fileSha256 - * @memberof proto.PBMediaData - * @instance - */ - PBMediaData.prototype.fileSha256 = $util.newBuffer([]); - - /** - * PBMediaData fileEncSha256. - * @member {Uint8Array} fileEncSha256 - * @memberof proto.PBMediaData + * RecentStickerWeight filehash. + * @member {string} filehash + * @memberof proto.RecentStickerWeight * @instance */ - PBMediaData.prototype.fileEncSha256 = $util.newBuffer([]); + RecentStickerWeight.prototype.filehash = ""; /** - * PBMediaData directPath. - * @member {string} directPath - * @memberof proto.PBMediaData + * RecentStickerWeight weight. + * @member {number} weight + * @memberof proto.RecentStickerWeight * @instance */ - PBMediaData.prototype.directPath = ""; + RecentStickerWeight.prototype.weight = 0; /** - * Creates a new PBMediaData instance using the specified properties. + * Creates a new RecentStickerWeight instance using the specified properties. * @function create - * @memberof proto.PBMediaData + * @memberof proto.RecentStickerWeight * @static - * @param {proto.IPBMediaData=} [properties] Properties to set - * @returns {proto.PBMediaData} PBMediaData instance + * @param {proto.IRecentStickerWeight=} [properties] Properties to set + * @returns {proto.RecentStickerWeight} RecentStickerWeight instance */ - PBMediaData.create = function create(properties) { - return new PBMediaData(properties); + RecentStickerWeight.create = function create(properties) { + return new RecentStickerWeight(properties); }; /** - * Encodes the specified PBMediaData message. Does not implicitly {@link proto.PBMediaData.verify|verify} messages. + * Encodes the specified RecentStickerWeight message. Does not implicitly {@link proto.RecentStickerWeight.verify|verify} messages. * @function encode - * @memberof proto.PBMediaData + * @memberof proto.RecentStickerWeight * @static - * @param {proto.IPBMediaData} message PBMediaData message or plain object to encode + * @param {proto.IRecentStickerWeight} message RecentStickerWeight message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PBMediaData.encode = function encode(message, writer) { + RecentStickerWeight.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.mediaKey != null && Object.hasOwnProperty.call(message, "mediaKey")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.mediaKey); - if (message.mediaKeyTimestamp != null && Object.hasOwnProperty.call(message, "mediaKeyTimestamp")) - writer.uint32(/* id 2, wireType 0 =*/16).int64(message.mediaKeyTimestamp); - if (message.fileSha256 != null && Object.hasOwnProperty.call(message, "fileSha256")) - writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.fileSha256); - if (message.fileEncSha256 != null && Object.hasOwnProperty.call(message, "fileEncSha256")) - writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.fileEncSha256); - if (message.directPath != null && Object.hasOwnProperty.call(message, "directPath")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.directPath); + if (message.filehash != null && Object.hasOwnProperty.call(message, "filehash")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.filehash); + if (message.weight != null && Object.hasOwnProperty.call(message, "weight")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.weight); return writer; }; /** - * Encodes the specified PBMediaData message, length delimited. Does not implicitly {@link proto.PBMediaData.verify|verify} messages. + * Encodes the specified RecentStickerWeight message, length delimited. Does not implicitly {@link proto.RecentStickerWeight.verify|verify} messages. * @function encodeDelimited - * @memberof proto.PBMediaData + * @memberof proto.RecentStickerWeight * @static - * @param {proto.IPBMediaData} message PBMediaData message or plain object to encode + * @param {proto.IRecentStickerWeight} message RecentStickerWeight message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PBMediaData.encodeDelimited = function encodeDelimited(message, writer) { + RecentStickerWeight.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a PBMediaData message from the specified reader or buffer. + * Decodes a RecentStickerWeight message from the specified reader or buffer. * @function decode - * @memberof proto.PBMediaData + * @memberof proto.RecentStickerWeight * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {proto.PBMediaData} PBMediaData + * @returns {proto.RecentStickerWeight} RecentStickerWeight * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - PBMediaData.decode = function decode(reader, length) { + RecentStickerWeight.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.PBMediaData(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.RecentStickerWeight(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.mediaKey = reader.bytes(); + message.filehash = reader.string(); break; case 2: - message.mediaKeyTimestamp = reader.int64(); - break; - case 3: - message.fileSha256 = reader.bytes(); - break; - case 4: - message.fileEncSha256 = reader.bytes(); - break; - case 5: - message.directPath = reader.string(); + message.weight = reader.float(); break; default: reader.skipType(tag & 7); @@ -47464,190 +46031,117 @@ $root.proto = (function() { }; /** - * Decodes a PBMediaData message from the specified reader or buffer, length delimited. + * Decodes a RecentStickerWeight message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof proto.PBMediaData + * @memberof proto.RecentStickerWeight * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.PBMediaData} PBMediaData + * @returns {proto.RecentStickerWeight} RecentStickerWeight * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - PBMediaData.decodeDelimited = function decodeDelimited(reader) { + RecentStickerWeight.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a PBMediaData message. + * Verifies a RecentStickerWeight message. * @function verify - * @memberof proto.PBMediaData + * @memberof proto.RecentStickerWeight * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - PBMediaData.verify = function verify(message) { + RecentStickerWeight.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.mediaKey != null && message.hasOwnProperty("mediaKey")) - if (!(message.mediaKey && typeof message.mediaKey.length === "number" || $util.isString(message.mediaKey))) - return "mediaKey: buffer expected"; - if (message.mediaKeyTimestamp != null && message.hasOwnProperty("mediaKeyTimestamp")) - if (!$util.isInteger(message.mediaKeyTimestamp) && !(message.mediaKeyTimestamp && $util.isInteger(message.mediaKeyTimestamp.low) && $util.isInteger(message.mediaKeyTimestamp.high))) - return "mediaKeyTimestamp: integer|Long expected"; - if (message.fileSha256 != null && message.hasOwnProperty("fileSha256")) - if (!(message.fileSha256 && typeof message.fileSha256.length === "number" || $util.isString(message.fileSha256))) - return "fileSha256: buffer expected"; - if (message.fileEncSha256 != null && message.hasOwnProperty("fileEncSha256")) - if (!(message.fileEncSha256 && typeof message.fileEncSha256.length === "number" || $util.isString(message.fileEncSha256))) - return "fileEncSha256: buffer expected"; - if (message.directPath != null && message.hasOwnProperty("directPath")) - if (!$util.isString(message.directPath)) - return "directPath: string expected"; + if (message.filehash != null && message.hasOwnProperty("filehash")) + if (!$util.isString(message.filehash)) + return "filehash: string expected"; + if (message.weight != null && message.hasOwnProperty("weight")) + if (typeof message.weight !== "number") + return "weight: number expected"; return null; }; /** - * Creates a PBMediaData message from a plain object. Also converts values to their respective internal types. + * Creates a RecentStickerWeight message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof proto.PBMediaData + * @memberof proto.RecentStickerWeight * @static * @param {Object.} object Plain object - * @returns {proto.PBMediaData} PBMediaData + * @returns {proto.RecentStickerWeight} RecentStickerWeight */ - PBMediaData.fromObject = function fromObject(object) { - if (object instanceof $root.proto.PBMediaData) + RecentStickerWeight.fromObject = function fromObject(object) { + if (object instanceof $root.proto.RecentStickerWeight) return object; - var message = new $root.proto.PBMediaData(); - if (object.mediaKey != null) - if (typeof object.mediaKey === "string") - $util.base64.decode(object.mediaKey, message.mediaKey = $util.newBuffer($util.base64.length(object.mediaKey)), 0); - else if (object.mediaKey.length) - message.mediaKey = object.mediaKey; - if (object.mediaKeyTimestamp != null) - if ($util.Long) - (message.mediaKeyTimestamp = $util.Long.fromValue(object.mediaKeyTimestamp)).unsigned = false; - else if (typeof object.mediaKeyTimestamp === "string") - message.mediaKeyTimestamp = parseInt(object.mediaKeyTimestamp, 10); - else if (typeof object.mediaKeyTimestamp === "number") - message.mediaKeyTimestamp = object.mediaKeyTimestamp; - else if (typeof object.mediaKeyTimestamp === "object") - message.mediaKeyTimestamp = new $util.LongBits(object.mediaKeyTimestamp.low >>> 0, object.mediaKeyTimestamp.high >>> 0).toNumber(); - if (object.fileSha256 != null) - if (typeof object.fileSha256 === "string") - $util.base64.decode(object.fileSha256, message.fileSha256 = $util.newBuffer($util.base64.length(object.fileSha256)), 0); - else if (object.fileSha256.length) - message.fileSha256 = object.fileSha256; - if (object.fileEncSha256 != null) - if (typeof object.fileEncSha256 === "string") - $util.base64.decode(object.fileEncSha256, message.fileEncSha256 = $util.newBuffer($util.base64.length(object.fileEncSha256)), 0); - else if (object.fileEncSha256.length) - message.fileEncSha256 = object.fileEncSha256; - if (object.directPath != null) - message.directPath = String(object.directPath); + var message = new $root.proto.RecentStickerWeight(); + if (object.filehash != null) + message.filehash = String(object.filehash); + if (object.weight != null) + message.weight = Number(object.weight); return message; }; /** - * Creates a plain object from a PBMediaData message. Also converts values to other types if specified. + * Creates a plain object from a RecentStickerWeight message. Also converts values to other types if specified. * @function toObject - * @memberof proto.PBMediaData + * @memberof proto.RecentStickerWeight * @static - * @param {proto.PBMediaData} message PBMediaData + * @param {proto.RecentStickerWeight} message RecentStickerWeight * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - PBMediaData.toObject = function toObject(message, options) { + RecentStickerWeight.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - if (options.bytes === String) - object.mediaKey = ""; - else { - object.mediaKey = []; - if (options.bytes !== Array) - object.mediaKey = $util.newBuffer(object.mediaKey); - } - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.mediaKeyTimestamp = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.mediaKeyTimestamp = options.longs === String ? "0" : 0; - if (options.bytes === String) - object.fileSha256 = ""; - else { - object.fileSha256 = []; - if (options.bytes !== Array) - object.fileSha256 = $util.newBuffer(object.fileSha256); - } - if (options.bytes === String) - object.fileEncSha256 = ""; - else { - object.fileEncSha256 = []; - if (options.bytes !== Array) - object.fileEncSha256 = $util.newBuffer(object.fileEncSha256); - } - object.directPath = ""; + object.filehash = ""; + object.weight = 0; } - if (message.mediaKey != null && message.hasOwnProperty("mediaKey")) - object.mediaKey = options.bytes === String ? $util.base64.encode(message.mediaKey, 0, message.mediaKey.length) : options.bytes === Array ? Array.prototype.slice.call(message.mediaKey) : message.mediaKey; - if (message.mediaKeyTimestamp != null && message.hasOwnProperty("mediaKeyTimestamp")) - if (typeof message.mediaKeyTimestamp === "number") - object.mediaKeyTimestamp = options.longs === String ? String(message.mediaKeyTimestamp) : message.mediaKeyTimestamp; - else - object.mediaKeyTimestamp = options.longs === String ? $util.Long.prototype.toString.call(message.mediaKeyTimestamp) : options.longs === Number ? new $util.LongBits(message.mediaKeyTimestamp.low >>> 0, message.mediaKeyTimestamp.high >>> 0).toNumber() : message.mediaKeyTimestamp; - if (message.fileSha256 != null && message.hasOwnProperty("fileSha256")) - object.fileSha256 = options.bytes === String ? $util.base64.encode(message.fileSha256, 0, message.fileSha256.length) : options.bytes === Array ? Array.prototype.slice.call(message.fileSha256) : message.fileSha256; - if (message.fileEncSha256 != null && message.hasOwnProperty("fileEncSha256")) - object.fileEncSha256 = options.bytes === String ? $util.base64.encode(message.fileEncSha256, 0, message.fileEncSha256.length) : options.bytes === Array ? Array.prototype.slice.call(message.fileEncSha256) : message.fileEncSha256; - if (message.directPath != null && message.hasOwnProperty("directPath")) - object.directPath = message.directPath; + if (message.filehash != null && message.hasOwnProperty("filehash")) + object.filehash = message.filehash; + if (message.weight != null && message.hasOwnProperty("weight")) + object.weight = options.json && !isFinite(message.weight) ? String(message.weight) : message.weight; return object; }; /** - * Converts this PBMediaData to JSON. + * Converts this RecentStickerWeight to JSON. * @function toJSON - * @memberof proto.PBMediaData + * @memberof proto.RecentStickerWeight * @instance * @returns {Object.} JSON object */ - PBMediaData.prototype.toJSON = function toJSON() { + RecentStickerWeight.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return PBMediaData; + return RecentStickerWeight; })(); - proto.PaymentBackground = (function() { + proto.RecentStickerWeightsAction = (function() { /** - * Properties of a PaymentBackground. + * Properties of a RecentStickerWeightsAction. * @memberof proto - * @interface IPaymentBackground - * @property {string|null} [id] PaymentBackground id - * @property {number|Long|null} [fileLength] PaymentBackground fileLength - * @property {number|null} [width] PaymentBackground width - * @property {number|null} [height] PaymentBackground height - * @property {string|null} [mimetype] PaymentBackground mimetype - * @property {number|null} [placeholderArgb] PaymentBackground placeholderArgb - * @property {number|null} [textArgb] PaymentBackground textArgb - * @property {number|null} [subtextArgb] PaymentBackground subtextArgb - * @property {proto.IPBMediaData|null} [mediaData] PaymentBackground mediaData - * @property {proto.PaymentBackground.PaymentBackgroundType|null} [type] PaymentBackground type + * @interface IRecentStickerWeightsAction + * @property {Array.|null} [weights] RecentStickerWeightsAction weights */ /** - * Constructs a new PaymentBackground. + * Constructs a new RecentStickerWeightsAction. * @memberof proto - * @classdesc Represents a PaymentBackground. - * @implements IPaymentBackground + * @classdesc Represents a RecentStickerWeightsAction. + * @implements IRecentStickerWeightsAction * @constructor - * @param {proto.IPaymentBackground=} [properties] Properties to set + * @param {proto.IRecentStickerWeightsAction=} [properties] Properties to set */ - function PaymentBackground(properties) { + function RecentStickerWeightsAction(properties) { + this.weights = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -47655,192 +46149,78 @@ $root.proto = (function() { } /** - * PaymentBackground id. - * @member {string} id - * @memberof proto.PaymentBackground - * @instance - */ - PaymentBackground.prototype.id = ""; - - /** - * PaymentBackground fileLength. - * @member {number|Long} fileLength - * @memberof proto.PaymentBackground - * @instance - */ - PaymentBackground.prototype.fileLength = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * PaymentBackground width. - * @member {number} width - * @memberof proto.PaymentBackground - * @instance - */ - PaymentBackground.prototype.width = 0; - - /** - * PaymentBackground height. - * @member {number} height - * @memberof proto.PaymentBackground - * @instance - */ - PaymentBackground.prototype.height = 0; - - /** - * PaymentBackground mimetype. - * @member {string} mimetype - * @memberof proto.PaymentBackground - * @instance - */ - PaymentBackground.prototype.mimetype = ""; - - /** - * PaymentBackground placeholderArgb. - * @member {number} placeholderArgb - * @memberof proto.PaymentBackground - * @instance - */ - PaymentBackground.prototype.placeholderArgb = 0; - - /** - * PaymentBackground textArgb. - * @member {number} textArgb - * @memberof proto.PaymentBackground - * @instance - */ - PaymentBackground.prototype.textArgb = 0; - - /** - * PaymentBackground subtextArgb. - * @member {number} subtextArgb - * @memberof proto.PaymentBackground - * @instance - */ - PaymentBackground.prototype.subtextArgb = 0; - - /** - * PaymentBackground mediaData. - * @member {proto.IPBMediaData|null|undefined} mediaData - * @memberof proto.PaymentBackground - * @instance - */ - PaymentBackground.prototype.mediaData = null; - - /** - * PaymentBackground type. - * @member {proto.PaymentBackground.PaymentBackgroundType} type - * @memberof proto.PaymentBackground + * RecentStickerWeightsAction weights. + * @member {Array.} weights + * @memberof proto.RecentStickerWeightsAction * @instance */ - PaymentBackground.prototype.type = 0; + RecentStickerWeightsAction.prototype.weights = $util.emptyArray; /** - * Creates a new PaymentBackground instance using the specified properties. + * Creates a new RecentStickerWeightsAction instance using the specified properties. * @function create - * @memberof proto.PaymentBackground + * @memberof proto.RecentStickerWeightsAction * @static - * @param {proto.IPaymentBackground=} [properties] Properties to set - * @returns {proto.PaymentBackground} PaymentBackground instance + * @param {proto.IRecentStickerWeightsAction=} [properties] Properties to set + * @returns {proto.RecentStickerWeightsAction} RecentStickerWeightsAction instance */ - PaymentBackground.create = function create(properties) { - return new PaymentBackground(properties); + RecentStickerWeightsAction.create = function create(properties) { + return new RecentStickerWeightsAction(properties); }; /** - * Encodes the specified PaymentBackground message. Does not implicitly {@link proto.PaymentBackground.verify|verify} messages. + * Encodes the specified RecentStickerWeightsAction message. Does not implicitly {@link proto.RecentStickerWeightsAction.verify|verify} messages. * @function encode - * @memberof proto.PaymentBackground + * @memberof proto.RecentStickerWeightsAction * @static - * @param {proto.IPaymentBackground} message PaymentBackground message or plain object to encode + * @param {proto.IRecentStickerWeightsAction} message RecentStickerWeightsAction message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PaymentBackground.encode = function encode(message, writer) { + RecentStickerWeightsAction.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.id != null && Object.hasOwnProperty.call(message, "id")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.id); - if (message.fileLength != null && Object.hasOwnProperty.call(message, "fileLength")) - writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.fileLength); - if (message.width != null && Object.hasOwnProperty.call(message, "width")) - writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.width); - if (message.height != null && Object.hasOwnProperty.call(message, "height")) - writer.uint32(/* id 4, wireType 0 =*/32).uint32(message.height); - if (message.mimetype != null && Object.hasOwnProperty.call(message, "mimetype")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.mimetype); - if (message.placeholderArgb != null && Object.hasOwnProperty.call(message, "placeholderArgb")) - writer.uint32(/* id 6, wireType 5 =*/53).fixed32(message.placeholderArgb); - if (message.textArgb != null && Object.hasOwnProperty.call(message, "textArgb")) - writer.uint32(/* id 7, wireType 5 =*/61).fixed32(message.textArgb); - if (message.subtextArgb != null && Object.hasOwnProperty.call(message, "subtextArgb")) - writer.uint32(/* id 8, wireType 5 =*/69).fixed32(message.subtextArgb); - if (message.mediaData != null && Object.hasOwnProperty.call(message, "mediaData")) - $root.proto.PBMediaData.encode(message.mediaData, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 10, wireType 0 =*/80).int32(message.type); + if (message.weights != null && message.weights.length) + for (var i = 0; i < message.weights.length; ++i) + $root.proto.RecentStickerWeight.encode(message.weights[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; /** - * Encodes the specified PaymentBackground message, length delimited. Does not implicitly {@link proto.PaymentBackground.verify|verify} messages. + * Encodes the specified RecentStickerWeightsAction message, length delimited. Does not implicitly {@link proto.RecentStickerWeightsAction.verify|verify} messages. * @function encodeDelimited - * @memberof proto.PaymentBackground + * @memberof proto.RecentStickerWeightsAction * @static - * @param {proto.IPaymentBackground} message PaymentBackground message or plain object to encode + * @param {proto.IRecentStickerWeightsAction} message RecentStickerWeightsAction message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PaymentBackground.encodeDelimited = function encodeDelimited(message, writer) { + RecentStickerWeightsAction.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a PaymentBackground message from the specified reader or buffer. + * Decodes a RecentStickerWeightsAction message from the specified reader or buffer. * @function decode - * @memberof proto.PaymentBackground + * @memberof proto.RecentStickerWeightsAction * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {proto.PaymentBackground} PaymentBackground + * @returns {proto.RecentStickerWeightsAction} RecentStickerWeightsAction * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - PaymentBackground.decode = function decode(reader, length) { + RecentStickerWeightsAction.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.PaymentBackground(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.RecentStickerWeightsAction(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.id = reader.string(); - break; - case 2: - message.fileLength = reader.uint64(); - break; - case 3: - message.width = reader.uint32(); - break; - case 4: - message.height = reader.uint32(); - break; - case 5: - message.mimetype = reader.string(); - break; - case 6: - message.placeholderArgb = reader.fixed32(); - break; - case 7: - message.textArgb = reader.fixed32(); - break; - case 8: - message.subtextArgb = reader.fixed32(); - break; - case 9: - message.mediaData = $root.proto.PBMediaData.decode(reader, reader.uint32()); - break; - case 10: - message.type = reader.int32(); + if (!(message.weights && message.weights.length)) + message.weights = []; + message.weights.push($root.proto.RecentStickerWeight.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -47851,228 +46231,124 @@ $root.proto = (function() { }; /** - * Decodes a PaymentBackground message from the specified reader or buffer, length delimited. + * Decodes a RecentStickerWeightsAction message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof proto.PaymentBackground + * @memberof proto.RecentStickerWeightsAction * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.PaymentBackground} PaymentBackground + * @returns {proto.RecentStickerWeightsAction} RecentStickerWeightsAction * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - PaymentBackground.decodeDelimited = function decodeDelimited(reader) { + RecentStickerWeightsAction.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a PaymentBackground message. + * Verifies a RecentStickerWeightsAction message. * @function verify - * @memberof proto.PaymentBackground + * @memberof proto.RecentStickerWeightsAction * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - PaymentBackground.verify = function verify(message) { + RecentStickerWeightsAction.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.id != null && message.hasOwnProperty("id")) - if (!$util.isString(message.id)) - return "id: string expected"; - if (message.fileLength != null && message.hasOwnProperty("fileLength")) - if (!$util.isInteger(message.fileLength) && !(message.fileLength && $util.isInteger(message.fileLength.low) && $util.isInteger(message.fileLength.high))) - return "fileLength: integer|Long expected"; - if (message.width != null && message.hasOwnProperty("width")) - if (!$util.isInteger(message.width)) - return "width: integer expected"; - if (message.height != null && message.hasOwnProperty("height")) - if (!$util.isInteger(message.height)) - return "height: integer expected"; - if (message.mimetype != null && message.hasOwnProperty("mimetype")) - if (!$util.isString(message.mimetype)) - return "mimetype: string expected"; - if (message.placeholderArgb != null && message.hasOwnProperty("placeholderArgb")) - if (!$util.isInteger(message.placeholderArgb)) - return "placeholderArgb: integer expected"; - if (message.textArgb != null && message.hasOwnProperty("textArgb")) - if (!$util.isInteger(message.textArgb)) - return "textArgb: integer expected"; - if (message.subtextArgb != null && message.hasOwnProperty("subtextArgb")) - if (!$util.isInteger(message.subtextArgb)) - return "subtextArgb: integer expected"; - if (message.mediaData != null && message.hasOwnProperty("mediaData")) { - var error = $root.proto.PBMediaData.verify(message.mediaData); - if (error) - return "mediaData." + error; + if (message.weights != null && message.hasOwnProperty("weights")) { + if (!Array.isArray(message.weights)) + return "weights: array expected"; + for (var i = 0; i < message.weights.length; ++i) { + var error = $root.proto.RecentStickerWeight.verify(message.weights[i]); + if (error) + return "weights." + error; + } } - if (message.type != null && message.hasOwnProperty("type")) - switch (message.type) { - default: - return "type: enum value expected"; - case 0: - case 1: - break; - } return null; }; /** - * Creates a PaymentBackground message from a plain object. Also converts values to their respective internal types. + * Creates a RecentStickerWeightsAction message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof proto.PaymentBackground + * @memberof proto.RecentStickerWeightsAction * @static * @param {Object.} object Plain object - * @returns {proto.PaymentBackground} PaymentBackground + * @returns {proto.RecentStickerWeightsAction} RecentStickerWeightsAction */ - PaymentBackground.fromObject = function fromObject(object) { - if (object instanceof $root.proto.PaymentBackground) + RecentStickerWeightsAction.fromObject = function fromObject(object) { + if (object instanceof $root.proto.RecentStickerWeightsAction) return object; - var message = new $root.proto.PaymentBackground(); - if (object.id != null) - message.id = String(object.id); - if (object.fileLength != null) - if ($util.Long) - (message.fileLength = $util.Long.fromValue(object.fileLength)).unsigned = true; - else if (typeof object.fileLength === "string") - message.fileLength = parseInt(object.fileLength, 10); - else if (typeof object.fileLength === "number") - message.fileLength = object.fileLength; - else if (typeof object.fileLength === "object") - message.fileLength = new $util.LongBits(object.fileLength.low >>> 0, object.fileLength.high >>> 0).toNumber(true); - if (object.width != null) - message.width = object.width >>> 0; - if (object.height != null) - message.height = object.height >>> 0; - if (object.mimetype != null) - message.mimetype = String(object.mimetype); - if (object.placeholderArgb != null) - message.placeholderArgb = object.placeholderArgb >>> 0; - if (object.textArgb != null) - message.textArgb = object.textArgb >>> 0; - if (object.subtextArgb != null) - message.subtextArgb = object.subtextArgb >>> 0; - if (object.mediaData != null) { - if (typeof object.mediaData !== "object") - throw TypeError(".proto.PaymentBackground.mediaData: object expected"); - message.mediaData = $root.proto.PBMediaData.fromObject(object.mediaData); - } - switch (object.type) { - case "UNKNOWN": - case 0: - message.type = 0; - break; - case "DEFAULT": - case 1: - message.type = 1; - break; + var message = new $root.proto.RecentStickerWeightsAction(); + if (object.weights) { + if (!Array.isArray(object.weights)) + throw TypeError(".proto.RecentStickerWeightsAction.weights: array expected"); + message.weights = []; + for (var i = 0; i < object.weights.length; ++i) { + if (typeof object.weights[i] !== "object") + throw TypeError(".proto.RecentStickerWeightsAction.weights: object expected"); + message.weights[i] = $root.proto.RecentStickerWeight.fromObject(object.weights[i]); + } } return message; }; /** - * Creates a plain object from a PaymentBackground message. Also converts values to other types if specified. + * Creates a plain object from a RecentStickerWeightsAction message. Also converts values to other types if specified. * @function toObject - * @memberof proto.PaymentBackground + * @memberof proto.RecentStickerWeightsAction * @static - * @param {proto.PaymentBackground} message PaymentBackground + * @param {proto.RecentStickerWeightsAction} message RecentStickerWeightsAction * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - PaymentBackground.toObject = function toObject(message, options) { + RecentStickerWeightsAction.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.id = ""; - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.fileLength = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.fileLength = options.longs === String ? "0" : 0; - object.width = 0; - object.height = 0; - object.mimetype = ""; - object.placeholderArgb = 0; - object.textArgb = 0; - object.subtextArgb = 0; - object.mediaData = null; - object.type = options.enums === String ? "UNKNOWN" : 0; + if (options.arrays || options.defaults) + object.weights = []; + if (message.weights && message.weights.length) { + object.weights = []; + for (var j = 0; j < message.weights.length; ++j) + object.weights[j] = $root.proto.RecentStickerWeight.toObject(message.weights[j], options); } - if (message.id != null && message.hasOwnProperty("id")) - object.id = message.id; - if (message.fileLength != null && message.hasOwnProperty("fileLength")) - if (typeof message.fileLength === "number") - object.fileLength = options.longs === String ? String(message.fileLength) : message.fileLength; - else - object.fileLength = options.longs === String ? $util.Long.prototype.toString.call(message.fileLength) : options.longs === Number ? new $util.LongBits(message.fileLength.low >>> 0, message.fileLength.high >>> 0).toNumber(true) : message.fileLength; - if (message.width != null && message.hasOwnProperty("width")) - object.width = message.width; - if (message.height != null && message.hasOwnProperty("height")) - object.height = message.height; - if (message.mimetype != null && message.hasOwnProperty("mimetype")) - object.mimetype = message.mimetype; - if (message.placeholderArgb != null && message.hasOwnProperty("placeholderArgb")) - object.placeholderArgb = message.placeholderArgb; - if (message.textArgb != null && message.hasOwnProperty("textArgb")) - object.textArgb = message.textArgb; - if (message.subtextArgb != null && message.hasOwnProperty("subtextArgb")) - object.subtextArgb = message.subtextArgb; - if (message.mediaData != null && message.hasOwnProperty("mediaData")) - object.mediaData = $root.proto.PBMediaData.toObject(message.mediaData, options); - if (message.type != null && message.hasOwnProperty("type")) - object.type = options.enums === String ? $root.proto.PaymentBackground.PaymentBackgroundType[message.type] : message.type; return object; }; /** - * Converts this PaymentBackground to JSON. + * Converts this RecentStickerWeightsAction to JSON. * @function toJSON - * @memberof proto.PaymentBackground + * @memberof proto.RecentStickerWeightsAction * @instance * @returns {Object.} JSON object */ - PaymentBackground.prototype.toJSON = function toJSON() { + RecentStickerWeightsAction.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - /** - * PaymentBackgroundType enum. - * @name proto.PaymentBackground.PaymentBackgroundType - * @enum {number} - * @property {number} UNKNOWN=0 UNKNOWN value - * @property {number} DEFAULT=1 DEFAULT value - */ - PaymentBackground.PaymentBackgroundType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "UNKNOWN"] = 0; - values[valuesById[1] = "DEFAULT"] = 1; - return values; - })(); - - return PaymentBackground; + return RecentStickerWeightsAction; })(); - proto.Money = (function() { + proto.SecurityNotificationSetting = (function() { /** - * Properties of a Money. + * Properties of a SecurityNotificationSetting. * @memberof proto - * @interface IMoney - * @property {number|Long|null} [value] Money value - * @property {number|null} [offset] Money offset - * @property {string|null} [currencyCode] Money currencyCode + * @interface ISecurityNotificationSetting + * @property {boolean|null} [showNotification] SecurityNotificationSetting showNotification */ /** - * Constructs a new Money. + * Constructs a new SecurityNotificationSetting. * @memberof proto - * @classdesc Represents a Money. - * @implements IMoney + * @classdesc Represents a SecurityNotificationSetting. + * @implements ISecurityNotificationSetting * @constructor - * @param {proto.IMoney=} [properties] Properties to set + * @param {proto.ISecurityNotificationSetting=} [properties] Properties to set */ - function Money(properties) { + function SecurityNotificationSetting(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -48080,101 +46356,75 @@ $root.proto = (function() { } /** - * Money value. - * @member {number|Long} value - * @memberof proto.Money - * @instance - */ - Money.prototype.value = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Money offset. - * @member {number} offset - * @memberof proto.Money - * @instance - */ - Money.prototype.offset = 0; - - /** - * Money currencyCode. - * @member {string} currencyCode - * @memberof proto.Money + * SecurityNotificationSetting showNotification. + * @member {boolean} showNotification + * @memberof proto.SecurityNotificationSetting * @instance */ - Money.prototype.currencyCode = ""; + SecurityNotificationSetting.prototype.showNotification = false; /** - * Creates a new Money instance using the specified properties. + * Creates a new SecurityNotificationSetting instance using the specified properties. * @function create - * @memberof proto.Money + * @memberof proto.SecurityNotificationSetting * @static - * @param {proto.IMoney=} [properties] Properties to set - * @returns {proto.Money} Money instance + * @param {proto.ISecurityNotificationSetting=} [properties] Properties to set + * @returns {proto.SecurityNotificationSetting} SecurityNotificationSetting instance */ - Money.create = function create(properties) { - return new Money(properties); + SecurityNotificationSetting.create = function create(properties) { + return new SecurityNotificationSetting(properties); }; /** - * Encodes the specified Money message. Does not implicitly {@link proto.Money.verify|verify} messages. + * Encodes the specified SecurityNotificationSetting message. Does not implicitly {@link proto.SecurityNotificationSetting.verify|verify} messages. * @function encode - * @memberof proto.Money + * @memberof proto.SecurityNotificationSetting * @static - * @param {proto.IMoney} message Money message or plain object to encode + * @param {proto.ISecurityNotificationSetting} message SecurityNotificationSetting message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Money.encode = function encode(message, writer) { + SecurityNotificationSetting.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 1, wireType 0 =*/8).int64(message.value); - if (message.offset != null && Object.hasOwnProperty.call(message, "offset")) - writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.offset); - if (message.currencyCode != null && Object.hasOwnProperty.call(message, "currencyCode")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.currencyCode); + if (message.showNotification != null && Object.hasOwnProperty.call(message, "showNotification")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.showNotification); return writer; }; /** - * Encodes the specified Money message, length delimited. Does not implicitly {@link proto.Money.verify|verify} messages. + * Encodes the specified SecurityNotificationSetting message, length delimited. Does not implicitly {@link proto.SecurityNotificationSetting.verify|verify} messages. * @function encodeDelimited - * @memberof proto.Money + * @memberof proto.SecurityNotificationSetting * @static - * @param {proto.IMoney} message Money message or plain object to encode + * @param {proto.ISecurityNotificationSetting} message SecurityNotificationSetting message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Money.encodeDelimited = function encodeDelimited(message, writer) { + SecurityNotificationSetting.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Money message from the specified reader or buffer. + * Decodes a SecurityNotificationSetting message from the specified reader or buffer. * @function decode - * @memberof proto.Money + * @memberof proto.SecurityNotificationSetting * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {proto.Money} Money + * @returns {proto.SecurityNotificationSetting} SecurityNotificationSetting * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Money.decode = function decode(reader, length) { + SecurityNotificationSetting.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.Money(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.SecurityNotificationSetting(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.value = reader.int64(); - break; - case 2: - message.offset = reader.uint32(); - break; - case 3: - message.currencyCode = reader.string(); + message.showNotification = reader.bool(); break; default: reader.skipType(tag & 7); @@ -48185,139 +46435,107 @@ $root.proto = (function() { }; /** - * Decodes a Money message from the specified reader or buffer, length delimited. + * Decodes a SecurityNotificationSetting message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof proto.Money + * @memberof proto.SecurityNotificationSetting * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.Money} Money + * @returns {proto.SecurityNotificationSetting} SecurityNotificationSetting * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Money.decodeDelimited = function decodeDelimited(reader) { + SecurityNotificationSetting.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Money message. + * Verifies a SecurityNotificationSetting message. * @function verify - * @memberof proto.Money + * @memberof proto.SecurityNotificationSetting * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Money.verify = function verify(message) { + SecurityNotificationSetting.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.value != null && message.hasOwnProperty("value")) - if (!$util.isInteger(message.value) && !(message.value && $util.isInteger(message.value.low) && $util.isInteger(message.value.high))) - return "value: integer|Long expected"; - if (message.offset != null && message.hasOwnProperty("offset")) - if (!$util.isInteger(message.offset)) - return "offset: integer expected"; - if (message.currencyCode != null && message.hasOwnProperty("currencyCode")) - if (!$util.isString(message.currencyCode)) - return "currencyCode: string expected"; + if (message.showNotification != null && message.hasOwnProperty("showNotification")) + if (typeof message.showNotification !== "boolean") + return "showNotification: boolean expected"; return null; }; /** - * Creates a Money message from a plain object. Also converts values to their respective internal types. + * Creates a SecurityNotificationSetting message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof proto.Money + * @memberof proto.SecurityNotificationSetting * @static * @param {Object.} object Plain object - * @returns {proto.Money} Money + * @returns {proto.SecurityNotificationSetting} SecurityNotificationSetting */ - Money.fromObject = function fromObject(object) { - if (object instanceof $root.proto.Money) + SecurityNotificationSetting.fromObject = function fromObject(object) { + if (object instanceof $root.proto.SecurityNotificationSetting) return object; - var message = new $root.proto.Money(); - if (object.value != null) - if ($util.Long) - (message.value = $util.Long.fromValue(object.value)).unsigned = false; - else if (typeof object.value === "string") - message.value = parseInt(object.value, 10); - else if (typeof object.value === "number") - message.value = object.value; - else if (typeof object.value === "object") - message.value = new $util.LongBits(object.value.low >>> 0, object.value.high >>> 0).toNumber(); - if (object.offset != null) - message.offset = object.offset >>> 0; - if (object.currencyCode != null) - message.currencyCode = String(object.currencyCode); + var message = new $root.proto.SecurityNotificationSetting(); + if (object.showNotification != null) + message.showNotification = Boolean(object.showNotification); return message; }; /** - * Creates a plain object from a Money message. Also converts values to other types if specified. + * Creates a plain object from a SecurityNotificationSetting message. Also converts values to other types if specified. * @function toObject - * @memberof proto.Money + * @memberof proto.SecurityNotificationSetting * @static - * @param {proto.Money} message Money + * @param {proto.SecurityNotificationSetting} message SecurityNotificationSetting * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Money.toObject = function toObject(message, options) { + SecurityNotificationSetting.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.value = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.value = options.longs === String ? "0" : 0; - object.offset = 0; - object.currencyCode = ""; - } - if (message.value != null && message.hasOwnProperty("value")) - if (typeof message.value === "number") - object.value = options.longs === String ? String(message.value) : message.value; - else - object.value = options.longs === String ? $util.Long.prototype.toString.call(message.value) : options.longs === Number ? new $util.LongBits(message.value.low >>> 0, message.value.high >>> 0).toNumber() : message.value; - if (message.offset != null && message.hasOwnProperty("offset")) - object.offset = message.offset; - if (message.currencyCode != null && message.hasOwnProperty("currencyCode")) - object.currencyCode = message.currencyCode; + if (options.defaults) + object.showNotification = false; + if (message.showNotification != null && message.hasOwnProperty("showNotification")) + object.showNotification = message.showNotification; return object; }; /** - * Converts this Money to JSON. + * Converts this SecurityNotificationSetting to JSON. * @function toJSON - * @memberof proto.Money + * @memberof proto.SecurityNotificationSetting * @instance * @returns {Object.} JSON object */ - Money.prototype.toJSON = function toJSON() { + SecurityNotificationSetting.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return Money; + return SecurityNotificationSetting; })(); - proto.HydratedQuickReplyButton = (function() { + proto.StarAction = (function() { /** - * Properties of a HydratedQuickReplyButton. + * Properties of a StarAction. * @memberof proto - * @interface IHydratedQuickReplyButton - * @property {string|null} [displayText] HydratedQuickReplyButton displayText - * @property {string|null} [id] HydratedQuickReplyButton id + * @interface IStarAction + * @property {boolean|null} [starred] StarAction starred */ /** - * Constructs a new HydratedQuickReplyButton. + * Constructs a new StarAction. * @memberof proto - * @classdesc Represents a HydratedQuickReplyButton. - * @implements IHydratedQuickReplyButton + * @classdesc Represents a StarAction. + * @implements IStarAction * @constructor - * @param {proto.IHydratedQuickReplyButton=} [properties] Properties to set + * @param {proto.IStarAction=} [properties] Properties to set */ - function HydratedQuickReplyButton(properties) { + function StarAction(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -48325,88 +46543,75 @@ $root.proto = (function() { } /** - * HydratedQuickReplyButton displayText. - * @member {string} displayText - * @memberof proto.HydratedQuickReplyButton - * @instance - */ - HydratedQuickReplyButton.prototype.displayText = ""; - - /** - * HydratedQuickReplyButton id. - * @member {string} id - * @memberof proto.HydratedQuickReplyButton + * StarAction starred. + * @member {boolean} starred + * @memberof proto.StarAction * @instance */ - HydratedQuickReplyButton.prototype.id = ""; + StarAction.prototype.starred = false; /** - * Creates a new HydratedQuickReplyButton instance using the specified properties. + * Creates a new StarAction instance using the specified properties. * @function create - * @memberof proto.HydratedQuickReplyButton + * @memberof proto.StarAction * @static - * @param {proto.IHydratedQuickReplyButton=} [properties] Properties to set - * @returns {proto.HydratedQuickReplyButton} HydratedQuickReplyButton instance + * @param {proto.IStarAction=} [properties] Properties to set + * @returns {proto.StarAction} StarAction instance */ - HydratedQuickReplyButton.create = function create(properties) { - return new HydratedQuickReplyButton(properties); + StarAction.create = function create(properties) { + return new StarAction(properties); }; /** - * Encodes the specified HydratedQuickReplyButton message. Does not implicitly {@link proto.HydratedQuickReplyButton.verify|verify} messages. + * Encodes the specified StarAction message. Does not implicitly {@link proto.StarAction.verify|verify} messages. * @function encode - * @memberof proto.HydratedQuickReplyButton + * @memberof proto.StarAction * @static - * @param {proto.IHydratedQuickReplyButton} message HydratedQuickReplyButton message or plain object to encode + * @param {proto.IStarAction} message StarAction message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - HydratedQuickReplyButton.encode = function encode(message, writer) { + StarAction.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.displayText != null && Object.hasOwnProperty.call(message, "displayText")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.displayText); - if (message.id != null && Object.hasOwnProperty.call(message, "id")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.id); + if (message.starred != null && Object.hasOwnProperty.call(message, "starred")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.starred); return writer; }; /** - * Encodes the specified HydratedQuickReplyButton message, length delimited. Does not implicitly {@link proto.HydratedQuickReplyButton.verify|verify} messages. + * Encodes the specified StarAction message, length delimited. Does not implicitly {@link proto.StarAction.verify|verify} messages. * @function encodeDelimited - * @memberof proto.HydratedQuickReplyButton + * @memberof proto.StarAction * @static - * @param {proto.IHydratedQuickReplyButton} message HydratedQuickReplyButton message or plain object to encode + * @param {proto.IStarAction} message StarAction message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - HydratedQuickReplyButton.encodeDelimited = function encodeDelimited(message, writer) { + StarAction.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a HydratedQuickReplyButton message from the specified reader or buffer. + * Decodes a StarAction message from the specified reader or buffer. * @function decode - * @memberof proto.HydratedQuickReplyButton + * @memberof proto.StarAction * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {proto.HydratedQuickReplyButton} HydratedQuickReplyButton + * @returns {proto.StarAction} StarAction * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - HydratedQuickReplyButton.decode = function decode(reader, length) { + StarAction.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.HydratedQuickReplyButton(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.StarAction(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.displayText = reader.string(); - break; - case 2: - message.id = reader.string(); + message.starred = reader.bool(); break; default: reader.skipType(tag & 7); @@ -48417,117 +46622,110 @@ $root.proto = (function() { }; /** - * Decodes a HydratedQuickReplyButton message from the specified reader or buffer, length delimited. + * Decodes a StarAction message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof proto.HydratedQuickReplyButton + * @memberof proto.StarAction * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.HydratedQuickReplyButton} HydratedQuickReplyButton + * @returns {proto.StarAction} StarAction * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - HydratedQuickReplyButton.decodeDelimited = function decodeDelimited(reader) { + StarAction.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a HydratedQuickReplyButton message. + * Verifies a StarAction message. * @function verify - * @memberof proto.HydratedQuickReplyButton + * @memberof proto.StarAction * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - HydratedQuickReplyButton.verify = function verify(message) { + StarAction.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.displayText != null && message.hasOwnProperty("displayText")) - if (!$util.isString(message.displayText)) - return "displayText: string expected"; - if (message.id != null && message.hasOwnProperty("id")) - if (!$util.isString(message.id)) - return "id: string expected"; + if (message.starred != null && message.hasOwnProperty("starred")) + if (typeof message.starred !== "boolean") + return "starred: boolean expected"; return null; }; /** - * Creates a HydratedQuickReplyButton message from a plain object. Also converts values to their respective internal types. + * Creates a StarAction message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof proto.HydratedQuickReplyButton + * @memberof proto.StarAction * @static * @param {Object.} object Plain object - * @returns {proto.HydratedQuickReplyButton} HydratedQuickReplyButton + * @returns {proto.StarAction} StarAction */ - HydratedQuickReplyButton.fromObject = function fromObject(object) { - if (object instanceof $root.proto.HydratedQuickReplyButton) + StarAction.fromObject = function fromObject(object) { + if (object instanceof $root.proto.StarAction) return object; - var message = new $root.proto.HydratedQuickReplyButton(); - if (object.displayText != null) - message.displayText = String(object.displayText); - if (object.id != null) - message.id = String(object.id); + var message = new $root.proto.StarAction(); + if (object.starred != null) + message.starred = Boolean(object.starred); return message; }; /** - * Creates a plain object from a HydratedQuickReplyButton message. Also converts values to other types if specified. + * Creates a plain object from a StarAction message. Also converts values to other types if specified. * @function toObject - * @memberof proto.HydratedQuickReplyButton + * @memberof proto.StarAction * @static - * @param {proto.HydratedQuickReplyButton} message HydratedQuickReplyButton + * @param {proto.StarAction} message StarAction * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - HydratedQuickReplyButton.toObject = function toObject(message, options) { + StarAction.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.displayText = ""; - object.id = ""; - } - if (message.displayText != null && message.hasOwnProperty("displayText")) - object.displayText = message.displayText; - if (message.id != null && message.hasOwnProperty("id")) - object.id = message.id; + if (options.defaults) + object.starred = false; + if (message.starred != null && message.hasOwnProperty("starred")) + object.starred = message.starred; return object; }; /** - * Converts this HydratedQuickReplyButton to JSON. + * Converts this StarAction to JSON. * @function toJSON - * @memberof proto.HydratedQuickReplyButton + * @memberof proto.StarAction * @instance * @returns {Object.} JSON object */ - HydratedQuickReplyButton.prototype.toJSON = function toJSON() { + StarAction.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return HydratedQuickReplyButton; + return StarAction; })(); - proto.HydratedURLButton = (function() { + proto.SyncActionData = (function() { /** - * Properties of a HydratedURLButton. + * Properties of a SyncActionData. * @memberof proto - * @interface IHydratedURLButton - * @property {string|null} [displayText] HydratedURLButton displayText - * @property {string|null} [url] HydratedURLButton url + * @interface ISyncActionData + * @property {Uint8Array|null} [index] SyncActionData index + * @property {proto.ISyncActionValue|null} [value] SyncActionData value + * @property {Uint8Array|null} [padding] SyncActionData padding + * @property {number|null} [version] SyncActionData version */ /** - * Constructs a new HydratedURLButton. + * Constructs a new SyncActionData. * @memberof proto - * @classdesc Represents a HydratedURLButton. - * @implements IHydratedURLButton + * @classdesc Represents a SyncActionData. + * @implements ISyncActionData * @constructor - * @param {proto.IHydratedURLButton=} [properties] Properties to set + * @param {proto.ISyncActionData=} [properties] Properties to set */ - function HydratedURLButton(properties) { + function SyncActionData(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -48535,88 +46733,114 @@ $root.proto = (function() { } /** - * HydratedURLButton displayText. - * @member {string} displayText - * @memberof proto.HydratedURLButton + * SyncActionData index. + * @member {Uint8Array} index + * @memberof proto.SyncActionData * @instance */ - HydratedURLButton.prototype.displayText = ""; + SyncActionData.prototype.index = $util.newBuffer([]); /** - * HydratedURLButton url. - * @member {string} url - * @memberof proto.HydratedURLButton - * @instance - */ - HydratedURLButton.prototype.url = ""; + * SyncActionData value. + * @member {proto.ISyncActionValue|null|undefined} value + * @memberof proto.SyncActionData + * @instance + */ + SyncActionData.prototype.value = null; /** - * Creates a new HydratedURLButton instance using the specified properties. + * SyncActionData padding. + * @member {Uint8Array} padding + * @memberof proto.SyncActionData + * @instance + */ + SyncActionData.prototype.padding = $util.newBuffer([]); + + /** + * SyncActionData version. + * @member {number} version + * @memberof proto.SyncActionData + * @instance + */ + SyncActionData.prototype.version = 0; + + /** + * Creates a new SyncActionData instance using the specified properties. * @function create - * @memberof proto.HydratedURLButton + * @memberof proto.SyncActionData * @static - * @param {proto.IHydratedURLButton=} [properties] Properties to set - * @returns {proto.HydratedURLButton} HydratedURLButton instance + * @param {proto.ISyncActionData=} [properties] Properties to set + * @returns {proto.SyncActionData} SyncActionData instance */ - HydratedURLButton.create = function create(properties) { - return new HydratedURLButton(properties); + SyncActionData.create = function create(properties) { + return new SyncActionData(properties); }; /** - * Encodes the specified HydratedURLButton message. Does not implicitly {@link proto.HydratedURLButton.verify|verify} messages. + * Encodes the specified SyncActionData message. Does not implicitly {@link proto.SyncActionData.verify|verify} messages. * @function encode - * @memberof proto.HydratedURLButton + * @memberof proto.SyncActionData * @static - * @param {proto.IHydratedURLButton} message HydratedURLButton message or plain object to encode + * @param {proto.ISyncActionData} message SyncActionData message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - HydratedURLButton.encode = function encode(message, writer) { + SyncActionData.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.displayText != null && Object.hasOwnProperty.call(message, "displayText")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.displayText); - if (message.url != null && Object.hasOwnProperty.call(message, "url")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.url); + if (message.index != null && Object.hasOwnProperty.call(message, "index")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.index); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + $root.proto.SyncActionValue.encode(message.value, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.padding != null && Object.hasOwnProperty.call(message, "padding")) + writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.padding); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.version); return writer; }; /** - * Encodes the specified HydratedURLButton message, length delimited. Does not implicitly {@link proto.HydratedURLButton.verify|verify} messages. + * Encodes the specified SyncActionData message, length delimited. Does not implicitly {@link proto.SyncActionData.verify|verify} messages. * @function encodeDelimited - * @memberof proto.HydratedURLButton + * @memberof proto.SyncActionData * @static - * @param {proto.IHydratedURLButton} message HydratedURLButton message or plain object to encode + * @param {proto.ISyncActionData} message SyncActionData message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - HydratedURLButton.encodeDelimited = function encodeDelimited(message, writer) { + SyncActionData.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a HydratedURLButton message from the specified reader or buffer. + * Decodes a SyncActionData message from the specified reader or buffer. * @function decode - * @memberof proto.HydratedURLButton + * @memberof proto.SyncActionData * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {proto.HydratedURLButton} HydratedURLButton + * @returns {proto.SyncActionData} SyncActionData * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - HydratedURLButton.decode = function decode(reader, length) { + SyncActionData.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.HydratedURLButton(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.SyncActionData(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.displayText = reader.string(); + message.index = reader.bytes(); break; case 2: - message.url = reader.string(); + message.value = $root.proto.SyncActionValue.decode(reader, reader.uint32()); + break; + case 3: + message.padding = reader.bytes(); + break; + case 4: + message.version = reader.int32(); break; default: reader.skipType(tag & 7); @@ -48627,117 +46851,156 @@ $root.proto = (function() { }; /** - * Decodes a HydratedURLButton message from the specified reader or buffer, length delimited. + * Decodes a SyncActionData message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof proto.HydratedURLButton + * @memberof proto.SyncActionData * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.HydratedURLButton} HydratedURLButton + * @returns {proto.SyncActionData} SyncActionData * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - HydratedURLButton.decodeDelimited = function decodeDelimited(reader) { + SyncActionData.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a HydratedURLButton message. + * Verifies a SyncActionData message. * @function verify - * @memberof proto.HydratedURLButton + * @memberof proto.SyncActionData * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - HydratedURLButton.verify = function verify(message) { + SyncActionData.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.displayText != null && message.hasOwnProperty("displayText")) - if (!$util.isString(message.displayText)) - return "displayText: string expected"; - if (message.url != null && message.hasOwnProperty("url")) - if (!$util.isString(message.url)) - return "url: string expected"; + if (message.index != null && message.hasOwnProperty("index")) + if (!(message.index && typeof message.index.length === "number" || $util.isString(message.index))) + return "index: buffer expected"; + if (message.value != null && message.hasOwnProperty("value")) { + var error = $root.proto.SyncActionValue.verify(message.value); + if (error) + return "value." + error; + } + if (message.padding != null && message.hasOwnProperty("padding")) + if (!(message.padding && typeof message.padding.length === "number" || $util.isString(message.padding))) + return "padding: buffer expected"; + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isInteger(message.version)) + return "version: integer expected"; return null; }; /** - * Creates a HydratedURLButton message from a plain object. Also converts values to their respective internal types. + * Creates a SyncActionData message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof proto.HydratedURLButton + * @memberof proto.SyncActionData * @static * @param {Object.} object Plain object - * @returns {proto.HydratedURLButton} HydratedURLButton + * @returns {proto.SyncActionData} SyncActionData */ - HydratedURLButton.fromObject = function fromObject(object) { - if (object instanceof $root.proto.HydratedURLButton) + SyncActionData.fromObject = function fromObject(object) { + if (object instanceof $root.proto.SyncActionData) return object; - var message = new $root.proto.HydratedURLButton(); - if (object.displayText != null) - message.displayText = String(object.displayText); - if (object.url != null) - message.url = String(object.url); + var message = new $root.proto.SyncActionData(); + if (object.index != null) + if (typeof object.index === "string") + $util.base64.decode(object.index, message.index = $util.newBuffer($util.base64.length(object.index)), 0); + else if (object.index.length) + message.index = object.index; + if (object.value != null) { + if (typeof object.value !== "object") + throw TypeError(".proto.SyncActionData.value: object expected"); + message.value = $root.proto.SyncActionValue.fromObject(object.value); + } + if (object.padding != null) + if (typeof object.padding === "string") + $util.base64.decode(object.padding, message.padding = $util.newBuffer($util.base64.length(object.padding)), 0); + else if (object.padding.length) + message.padding = object.padding; + if (object.version != null) + message.version = object.version | 0; return message; }; /** - * Creates a plain object from a HydratedURLButton message. Also converts values to other types if specified. + * Creates a plain object from a SyncActionData message. Also converts values to other types if specified. * @function toObject - * @memberof proto.HydratedURLButton + * @memberof proto.SyncActionData * @static - * @param {proto.HydratedURLButton} message HydratedURLButton + * @param {proto.SyncActionData} message SyncActionData * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - HydratedURLButton.toObject = function toObject(message, options) { + SyncActionData.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.displayText = ""; - object.url = ""; + if (options.bytes === String) + object.index = ""; + else { + object.index = []; + if (options.bytes !== Array) + object.index = $util.newBuffer(object.index); + } + object.value = null; + if (options.bytes === String) + object.padding = ""; + else { + object.padding = []; + if (options.bytes !== Array) + object.padding = $util.newBuffer(object.padding); + } + object.version = 0; } - if (message.displayText != null && message.hasOwnProperty("displayText")) - object.displayText = message.displayText; - if (message.url != null && message.hasOwnProperty("url")) - object.url = message.url; + if (message.index != null && message.hasOwnProperty("index")) + object.index = options.bytes === String ? $util.base64.encode(message.index, 0, message.index.length) : options.bytes === Array ? Array.prototype.slice.call(message.index) : message.index; + if (message.value != null && message.hasOwnProperty("value")) + object.value = $root.proto.SyncActionValue.toObject(message.value, options); + if (message.padding != null && message.hasOwnProperty("padding")) + object.padding = options.bytes === String ? $util.base64.encode(message.padding, 0, message.padding.length) : options.bytes === Array ? Array.prototype.slice.call(message.padding) : message.padding; + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; return object; }; /** - * Converts this HydratedURLButton to JSON. + * Converts this SyncActionData to JSON. * @function toJSON - * @memberof proto.HydratedURLButton + * @memberof proto.SyncActionData * @instance * @returns {Object.} JSON object */ - HydratedURLButton.prototype.toJSON = function toJSON() { + SyncActionData.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return HydratedURLButton; + return SyncActionData; })(); - proto.HydratedCallButton = (function() { + proto.SyncActionMessage = (function() { /** - * Properties of a HydratedCallButton. + * Properties of a SyncActionMessage. * @memberof proto - * @interface IHydratedCallButton - * @property {string|null} [displayText] HydratedCallButton displayText - * @property {string|null} [phoneNumber] HydratedCallButton phoneNumber + * @interface ISyncActionMessage + * @property {proto.IMessageKey|null} [key] SyncActionMessage key + * @property {number|Long|null} [timestamp] SyncActionMessage timestamp */ /** - * Constructs a new HydratedCallButton. + * Constructs a new SyncActionMessage. * @memberof proto - * @classdesc Represents a HydratedCallButton. - * @implements IHydratedCallButton + * @classdesc Represents a SyncActionMessage. + * @implements ISyncActionMessage * @constructor - * @param {proto.IHydratedCallButton=} [properties] Properties to set + * @param {proto.ISyncActionMessage=} [properties] Properties to set */ - function HydratedCallButton(properties) { + function SyncActionMessage(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -48745,88 +47008,88 @@ $root.proto = (function() { } /** - * HydratedCallButton displayText. - * @member {string} displayText - * @memberof proto.HydratedCallButton + * SyncActionMessage key. + * @member {proto.IMessageKey|null|undefined} key + * @memberof proto.SyncActionMessage * @instance */ - HydratedCallButton.prototype.displayText = ""; + SyncActionMessage.prototype.key = null; /** - * HydratedCallButton phoneNumber. - * @member {string} phoneNumber - * @memberof proto.HydratedCallButton + * SyncActionMessage timestamp. + * @member {number|Long} timestamp + * @memberof proto.SyncActionMessage * @instance */ - HydratedCallButton.prototype.phoneNumber = ""; + SyncActionMessage.prototype.timestamp = $util.Long ? $util.Long.fromBits(0,0,false) : 0; /** - * Creates a new HydratedCallButton instance using the specified properties. + * Creates a new SyncActionMessage instance using the specified properties. * @function create - * @memberof proto.HydratedCallButton + * @memberof proto.SyncActionMessage * @static - * @param {proto.IHydratedCallButton=} [properties] Properties to set - * @returns {proto.HydratedCallButton} HydratedCallButton instance + * @param {proto.ISyncActionMessage=} [properties] Properties to set + * @returns {proto.SyncActionMessage} SyncActionMessage instance */ - HydratedCallButton.create = function create(properties) { - return new HydratedCallButton(properties); + SyncActionMessage.create = function create(properties) { + return new SyncActionMessage(properties); }; /** - * Encodes the specified HydratedCallButton message. Does not implicitly {@link proto.HydratedCallButton.verify|verify} messages. + * Encodes the specified SyncActionMessage message. Does not implicitly {@link proto.SyncActionMessage.verify|verify} messages. * @function encode - * @memberof proto.HydratedCallButton + * @memberof proto.SyncActionMessage * @static - * @param {proto.IHydratedCallButton} message HydratedCallButton message or plain object to encode + * @param {proto.ISyncActionMessage} message SyncActionMessage message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - HydratedCallButton.encode = function encode(message, writer) { + SyncActionMessage.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.displayText != null && Object.hasOwnProperty.call(message, "displayText")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.displayText); - if (message.phoneNumber != null && Object.hasOwnProperty.call(message, "phoneNumber")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.phoneNumber); + if (message.key != null && Object.hasOwnProperty.call(message, "key")) + $root.proto.MessageKey.encode(message.key, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.timestamp != null && Object.hasOwnProperty.call(message, "timestamp")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.timestamp); return writer; }; /** - * Encodes the specified HydratedCallButton message, length delimited. Does not implicitly {@link proto.HydratedCallButton.verify|verify} messages. + * Encodes the specified SyncActionMessage message, length delimited. Does not implicitly {@link proto.SyncActionMessage.verify|verify} messages. * @function encodeDelimited - * @memberof proto.HydratedCallButton + * @memberof proto.SyncActionMessage * @static - * @param {proto.IHydratedCallButton} message HydratedCallButton message or plain object to encode + * @param {proto.ISyncActionMessage} message SyncActionMessage message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - HydratedCallButton.encodeDelimited = function encodeDelimited(message, writer) { + SyncActionMessage.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a HydratedCallButton message from the specified reader or buffer. + * Decodes a SyncActionMessage message from the specified reader or buffer. * @function decode - * @memberof proto.HydratedCallButton + * @memberof proto.SyncActionMessage * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {proto.HydratedCallButton} HydratedCallButton + * @returns {proto.SyncActionMessage} SyncActionMessage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - HydratedCallButton.decode = function decode(reader, length) { + SyncActionMessage.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.HydratedCallButton(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.SyncActionMessage(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.displayText = reader.string(); + message.key = $root.proto.MessageKey.decode(reader, reader.uint32()); break; case 2: - message.phoneNumber = reader.string(); + message.timestamp = reader.int64(); break; default: reader.skipType(tag & 7); @@ -48837,119 +47100,138 @@ $root.proto = (function() { }; /** - * Decodes a HydratedCallButton message from the specified reader or buffer, length delimited. + * Decodes a SyncActionMessage message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof proto.HydratedCallButton + * @memberof proto.SyncActionMessage * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.HydratedCallButton} HydratedCallButton + * @returns {proto.SyncActionMessage} SyncActionMessage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - HydratedCallButton.decodeDelimited = function decodeDelimited(reader) { + SyncActionMessage.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a HydratedCallButton message. + * Verifies a SyncActionMessage message. * @function verify - * @memberof proto.HydratedCallButton + * @memberof proto.SyncActionMessage * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - HydratedCallButton.verify = function verify(message) { + SyncActionMessage.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.displayText != null && message.hasOwnProperty("displayText")) - if (!$util.isString(message.displayText)) - return "displayText: string expected"; - if (message.phoneNumber != null && message.hasOwnProperty("phoneNumber")) - if (!$util.isString(message.phoneNumber)) - return "phoneNumber: string expected"; + if (message.key != null && message.hasOwnProperty("key")) { + var error = $root.proto.MessageKey.verify(message.key); + if (error) + return "key." + error; + } + if (message.timestamp != null && message.hasOwnProperty("timestamp")) + if (!$util.isInteger(message.timestamp) && !(message.timestamp && $util.isInteger(message.timestamp.low) && $util.isInteger(message.timestamp.high))) + return "timestamp: integer|Long expected"; return null; }; /** - * Creates a HydratedCallButton message from a plain object. Also converts values to their respective internal types. + * Creates a SyncActionMessage message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof proto.HydratedCallButton + * @memberof proto.SyncActionMessage * @static * @param {Object.} object Plain object - * @returns {proto.HydratedCallButton} HydratedCallButton + * @returns {proto.SyncActionMessage} SyncActionMessage */ - HydratedCallButton.fromObject = function fromObject(object) { - if (object instanceof $root.proto.HydratedCallButton) + SyncActionMessage.fromObject = function fromObject(object) { + if (object instanceof $root.proto.SyncActionMessage) return object; - var message = new $root.proto.HydratedCallButton(); - if (object.displayText != null) - message.displayText = String(object.displayText); - if (object.phoneNumber != null) - message.phoneNumber = String(object.phoneNumber); + var message = new $root.proto.SyncActionMessage(); + if (object.key != null) { + if (typeof object.key !== "object") + throw TypeError(".proto.SyncActionMessage.key: object expected"); + message.key = $root.proto.MessageKey.fromObject(object.key); + } + if (object.timestamp != null) + if ($util.Long) + (message.timestamp = $util.Long.fromValue(object.timestamp)).unsigned = false; + else if (typeof object.timestamp === "string") + message.timestamp = parseInt(object.timestamp, 10); + else if (typeof object.timestamp === "number") + message.timestamp = object.timestamp; + else if (typeof object.timestamp === "object") + message.timestamp = new $util.LongBits(object.timestamp.low >>> 0, object.timestamp.high >>> 0).toNumber(); return message; }; /** - * Creates a plain object from a HydratedCallButton message. Also converts values to other types if specified. + * Creates a plain object from a SyncActionMessage message. Also converts values to other types if specified. * @function toObject - * @memberof proto.HydratedCallButton + * @memberof proto.SyncActionMessage * @static - * @param {proto.HydratedCallButton} message HydratedCallButton + * @param {proto.SyncActionMessage} message SyncActionMessage * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - HydratedCallButton.toObject = function toObject(message, options) { + SyncActionMessage.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.displayText = ""; - object.phoneNumber = ""; + object.key = null; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.timestamp = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.timestamp = options.longs === String ? "0" : 0; } - if (message.displayText != null && message.hasOwnProperty("displayText")) - object.displayText = message.displayText; - if (message.phoneNumber != null && message.hasOwnProperty("phoneNumber")) - object.phoneNumber = message.phoneNumber; + if (message.key != null && message.hasOwnProperty("key")) + object.key = $root.proto.MessageKey.toObject(message.key, options); + if (message.timestamp != null && message.hasOwnProperty("timestamp")) + if (typeof message.timestamp === "number") + object.timestamp = options.longs === String ? String(message.timestamp) : message.timestamp; + else + object.timestamp = options.longs === String ? $util.Long.prototype.toString.call(message.timestamp) : options.longs === Number ? new $util.LongBits(message.timestamp.low >>> 0, message.timestamp.high >>> 0).toNumber() : message.timestamp; return object; }; /** - * Converts this HydratedCallButton to JSON. + * Converts this SyncActionMessage to JSON. * @function toJSON - * @memberof proto.HydratedCallButton + * @memberof proto.SyncActionMessage * @instance * @returns {Object.} JSON object */ - HydratedCallButton.prototype.toJSON = function toJSON() { + SyncActionMessage.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return HydratedCallButton; + return SyncActionMessage; })(); - proto.HydratedTemplateButton = (function() { + proto.SyncActionMessageRange = (function() { /** - * Properties of a HydratedTemplateButton. + * Properties of a SyncActionMessageRange. * @memberof proto - * @interface IHydratedTemplateButton - * @property {number|null} [index] HydratedTemplateButton index - * @property {proto.IHydratedQuickReplyButton|null} [quickReplyButton] HydratedTemplateButton quickReplyButton - * @property {proto.IHydratedURLButton|null} [urlButton] HydratedTemplateButton urlButton - * @property {proto.IHydratedCallButton|null} [callButton] HydratedTemplateButton callButton + * @interface ISyncActionMessageRange + * @property {number|Long|null} [lastMessageTimestamp] SyncActionMessageRange lastMessageTimestamp + * @property {number|Long|null} [lastSystemMessageTimestamp] SyncActionMessageRange lastSystemMessageTimestamp + * @property {Array.|null} [messages] SyncActionMessageRange messages */ /** - * Constructs a new HydratedTemplateButton. + * Constructs a new SyncActionMessageRange. * @memberof proto - * @classdesc Represents a HydratedTemplateButton. - * @implements IHydratedTemplateButton + * @classdesc Represents a SyncActionMessageRange. + * @implements ISyncActionMessageRange * @constructor - * @param {proto.IHydratedTemplateButton=} [properties] Properties to set + * @param {proto.ISyncActionMessageRange=} [properties] Properties to set */ - function HydratedTemplateButton(properties) { + function SyncActionMessageRange(properties) { + this.messages = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -48957,128 +47239,104 @@ $root.proto = (function() { } /** - * HydratedTemplateButton index. - * @member {number} index - * @memberof proto.HydratedTemplateButton - * @instance - */ - HydratedTemplateButton.prototype.index = 0; - - /** - * HydratedTemplateButton quickReplyButton. - * @member {proto.IHydratedQuickReplyButton|null|undefined} quickReplyButton - * @memberof proto.HydratedTemplateButton - * @instance - */ - HydratedTemplateButton.prototype.quickReplyButton = null; - - /** - * HydratedTemplateButton urlButton. - * @member {proto.IHydratedURLButton|null|undefined} urlButton - * @memberof proto.HydratedTemplateButton + * SyncActionMessageRange lastMessageTimestamp. + * @member {number|Long} lastMessageTimestamp + * @memberof proto.SyncActionMessageRange * @instance */ - HydratedTemplateButton.prototype.urlButton = null; + SyncActionMessageRange.prototype.lastMessageTimestamp = $util.Long ? $util.Long.fromBits(0,0,false) : 0; /** - * HydratedTemplateButton callButton. - * @member {proto.IHydratedCallButton|null|undefined} callButton - * @memberof proto.HydratedTemplateButton + * SyncActionMessageRange lastSystemMessageTimestamp. + * @member {number|Long} lastSystemMessageTimestamp + * @memberof proto.SyncActionMessageRange * @instance */ - HydratedTemplateButton.prototype.callButton = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + SyncActionMessageRange.prototype.lastSystemMessageTimestamp = $util.Long ? $util.Long.fromBits(0,0,false) : 0; /** - * HydratedTemplateButton hydratedButton. - * @member {"quickReplyButton"|"urlButton"|"callButton"|undefined} hydratedButton - * @memberof proto.HydratedTemplateButton + * SyncActionMessageRange messages. + * @member {Array.} messages + * @memberof proto.SyncActionMessageRange * @instance */ - Object.defineProperty(HydratedTemplateButton.prototype, "hydratedButton", { - get: $util.oneOfGetter($oneOfFields = ["quickReplyButton", "urlButton", "callButton"]), - set: $util.oneOfSetter($oneOfFields) - }); + SyncActionMessageRange.prototype.messages = $util.emptyArray; /** - * Creates a new HydratedTemplateButton instance using the specified properties. + * Creates a new SyncActionMessageRange instance using the specified properties. * @function create - * @memberof proto.HydratedTemplateButton + * @memberof proto.SyncActionMessageRange * @static - * @param {proto.IHydratedTemplateButton=} [properties] Properties to set - * @returns {proto.HydratedTemplateButton} HydratedTemplateButton instance + * @param {proto.ISyncActionMessageRange=} [properties] Properties to set + * @returns {proto.SyncActionMessageRange} SyncActionMessageRange instance */ - HydratedTemplateButton.create = function create(properties) { - return new HydratedTemplateButton(properties); + SyncActionMessageRange.create = function create(properties) { + return new SyncActionMessageRange(properties); }; /** - * Encodes the specified HydratedTemplateButton message. Does not implicitly {@link proto.HydratedTemplateButton.verify|verify} messages. + * Encodes the specified SyncActionMessageRange message. Does not implicitly {@link proto.SyncActionMessageRange.verify|verify} messages. * @function encode - * @memberof proto.HydratedTemplateButton + * @memberof proto.SyncActionMessageRange * @static - * @param {proto.IHydratedTemplateButton} message HydratedTemplateButton message or plain object to encode + * @param {proto.ISyncActionMessageRange} message SyncActionMessageRange message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - HydratedTemplateButton.encode = function encode(message, writer) { + SyncActionMessageRange.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.quickReplyButton != null && Object.hasOwnProperty.call(message, "quickReplyButton")) - $root.proto.HydratedQuickReplyButton.encode(message.quickReplyButton, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.urlButton != null && Object.hasOwnProperty.call(message, "urlButton")) - $root.proto.HydratedURLButton.encode(message.urlButton, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.callButton != null && Object.hasOwnProperty.call(message, "callButton")) - $root.proto.HydratedCallButton.encode(message.callButton, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.index != null && Object.hasOwnProperty.call(message, "index")) - writer.uint32(/* id 4, wireType 0 =*/32).uint32(message.index); + if (message.lastMessageTimestamp != null && Object.hasOwnProperty.call(message, "lastMessageTimestamp")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.lastMessageTimestamp); + if (message.lastSystemMessageTimestamp != null && Object.hasOwnProperty.call(message, "lastSystemMessageTimestamp")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.lastSystemMessageTimestamp); + if (message.messages != null && message.messages.length) + for (var i = 0; i < message.messages.length; ++i) + $root.proto.SyncActionMessage.encode(message.messages[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; /** - * Encodes the specified HydratedTemplateButton message, length delimited. Does not implicitly {@link proto.HydratedTemplateButton.verify|verify} messages. + * Encodes the specified SyncActionMessageRange message, length delimited. Does not implicitly {@link proto.SyncActionMessageRange.verify|verify} messages. * @function encodeDelimited - * @memberof proto.HydratedTemplateButton + * @memberof proto.SyncActionMessageRange * @static - * @param {proto.IHydratedTemplateButton} message HydratedTemplateButton message or plain object to encode + * @param {proto.ISyncActionMessageRange} message SyncActionMessageRange message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - HydratedTemplateButton.encodeDelimited = function encodeDelimited(message, writer) { + SyncActionMessageRange.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a HydratedTemplateButton message from the specified reader or buffer. + * Decodes a SyncActionMessageRange message from the specified reader or buffer. * @function decode - * @memberof proto.HydratedTemplateButton + * @memberof proto.SyncActionMessageRange * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {proto.HydratedTemplateButton} HydratedTemplateButton + * @returns {proto.SyncActionMessageRange} SyncActionMessageRange * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - HydratedTemplateButton.decode = function decode(reader, length) { + SyncActionMessageRange.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.HydratedTemplateButton(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.SyncActionMessageRange(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 4: - message.index = reader.uint32(); - break; case 1: - message.quickReplyButton = $root.proto.HydratedQuickReplyButton.decode(reader, reader.uint32()); + message.lastMessageTimestamp = reader.int64(); break; case 2: - message.urlButton = $root.proto.HydratedURLButton.decode(reader, reader.uint32()); + message.lastSystemMessageTimestamp = reader.int64(); break; case 3: - message.callButton = $root.proto.HydratedCallButton.decode(reader, reader.uint32()); + if (!(message.messages && message.messages.length)) + message.messages = []; + message.messages.push($root.proto.SyncActionMessage.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -49089,167 +47347,193 @@ $root.proto = (function() { }; /** - * Decodes a HydratedTemplateButton message from the specified reader or buffer, length delimited. + * Decodes a SyncActionMessageRange message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof proto.HydratedTemplateButton + * @memberof proto.SyncActionMessageRange * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.HydratedTemplateButton} HydratedTemplateButton + * @returns {proto.SyncActionMessageRange} SyncActionMessageRange * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - HydratedTemplateButton.decodeDelimited = function decodeDelimited(reader) { + SyncActionMessageRange.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a HydratedTemplateButton message. + * Verifies a SyncActionMessageRange message. * @function verify - * @memberof proto.HydratedTemplateButton + * @memberof proto.SyncActionMessageRange * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - HydratedTemplateButton.verify = function verify(message) { + SyncActionMessageRange.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - var properties = {}; - if (message.index != null && message.hasOwnProperty("index")) - if (!$util.isInteger(message.index)) - return "index: integer expected"; - if (message.quickReplyButton != null && message.hasOwnProperty("quickReplyButton")) { - properties.hydratedButton = 1; - { - var error = $root.proto.HydratedQuickReplyButton.verify(message.quickReplyButton); - if (error) - return "quickReplyButton." + error; - } - } - if (message.urlButton != null && message.hasOwnProperty("urlButton")) { - if (properties.hydratedButton === 1) - return "hydratedButton: multiple values"; - properties.hydratedButton = 1; - { - var error = $root.proto.HydratedURLButton.verify(message.urlButton); - if (error) - return "urlButton." + error; - } - } - if (message.callButton != null && message.hasOwnProperty("callButton")) { - if (properties.hydratedButton === 1) - return "hydratedButton: multiple values"; - properties.hydratedButton = 1; - { - var error = $root.proto.HydratedCallButton.verify(message.callButton); + if (message.lastMessageTimestamp != null && message.hasOwnProperty("lastMessageTimestamp")) + if (!$util.isInteger(message.lastMessageTimestamp) && !(message.lastMessageTimestamp && $util.isInteger(message.lastMessageTimestamp.low) && $util.isInteger(message.lastMessageTimestamp.high))) + return "lastMessageTimestamp: integer|Long expected"; + if (message.lastSystemMessageTimestamp != null && message.hasOwnProperty("lastSystemMessageTimestamp")) + if (!$util.isInteger(message.lastSystemMessageTimestamp) && !(message.lastSystemMessageTimestamp && $util.isInteger(message.lastSystemMessageTimestamp.low) && $util.isInteger(message.lastSystemMessageTimestamp.high))) + return "lastSystemMessageTimestamp: integer|Long expected"; + if (message.messages != null && message.hasOwnProperty("messages")) { + if (!Array.isArray(message.messages)) + return "messages: array expected"; + for (var i = 0; i < message.messages.length; ++i) { + var error = $root.proto.SyncActionMessage.verify(message.messages[i]); if (error) - return "callButton." + error; + return "messages." + error; } } return null; }; /** - * Creates a HydratedTemplateButton message from a plain object. Also converts values to their respective internal types. + * Creates a SyncActionMessageRange message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof proto.HydratedTemplateButton + * @memberof proto.SyncActionMessageRange * @static * @param {Object.} object Plain object - * @returns {proto.HydratedTemplateButton} HydratedTemplateButton + * @returns {proto.SyncActionMessageRange} SyncActionMessageRange */ - HydratedTemplateButton.fromObject = function fromObject(object) { - if (object instanceof $root.proto.HydratedTemplateButton) + SyncActionMessageRange.fromObject = function fromObject(object) { + if (object instanceof $root.proto.SyncActionMessageRange) return object; - var message = new $root.proto.HydratedTemplateButton(); - if (object.index != null) - message.index = object.index >>> 0; - if (object.quickReplyButton != null) { - if (typeof object.quickReplyButton !== "object") - throw TypeError(".proto.HydratedTemplateButton.quickReplyButton: object expected"); - message.quickReplyButton = $root.proto.HydratedQuickReplyButton.fromObject(object.quickReplyButton); - } - if (object.urlButton != null) { - if (typeof object.urlButton !== "object") - throw TypeError(".proto.HydratedTemplateButton.urlButton: object expected"); - message.urlButton = $root.proto.HydratedURLButton.fromObject(object.urlButton); - } - if (object.callButton != null) { - if (typeof object.callButton !== "object") - throw TypeError(".proto.HydratedTemplateButton.callButton: object expected"); - message.callButton = $root.proto.HydratedCallButton.fromObject(object.callButton); + var message = new $root.proto.SyncActionMessageRange(); + if (object.lastMessageTimestamp != null) + if ($util.Long) + (message.lastMessageTimestamp = $util.Long.fromValue(object.lastMessageTimestamp)).unsigned = false; + else if (typeof object.lastMessageTimestamp === "string") + message.lastMessageTimestamp = parseInt(object.lastMessageTimestamp, 10); + else if (typeof object.lastMessageTimestamp === "number") + message.lastMessageTimestamp = object.lastMessageTimestamp; + else if (typeof object.lastMessageTimestamp === "object") + message.lastMessageTimestamp = new $util.LongBits(object.lastMessageTimestamp.low >>> 0, object.lastMessageTimestamp.high >>> 0).toNumber(); + if (object.lastSystemMessageTimestamp != null) + if ($util.Long) + (message.lastSystemMessageTimestamp = $util.Long.fromValue(object.lastSystemMessageTimestamp)).unsigned = false; + else if (typeof object.lastSystemMessageTimestamp === "string") + message.lastSystemMessageTimestamp = parseInt(object.lastSystemMessageTimestamp, 10); + else if (typeof object.lastSystemMessageTimestamp === "number") + message.lastSystemMessageTimestamp = object.lastSystemMessageTimestamp; + else if (typeof object.lastSystemMessageTimestamp === "object") + message.lastSystemMessageTimestamp = new $util.LongBits(object.lastSystemMessageTimestamp.low >>> 0, object.lastSystemMessageTimestamp.high >>> 0).toNumber(); + if (object.messages) { + if (!Array.isArray(object.messages)) + throw TypeError(".proto.SyncActionMessageRange.messages: array expected"); + message.messages = []; + for (var i = 0; i < object.messages.length; ++i) { + if (typeof object.messages[i] !== "object") + throw TypeError(".proto.SyncActionMessageRange.messages: object expected"); + message.messages[i] = $root.proto.SyncActionMessage.fromObject(object.messages[i]); + } } return message; }; /** - * Creates a plain object from a HydratedTemplateButton message. Also converts values to other types if specified. + * Creates a plain object from a SyncActionMessageRange message. Also converts values to other types if specified. * @function toObject - * @memberof proto.HydratedTemplateButton + * @memberof proto.SyncActionMessageRange * @static - * @param {proto.HydratedTemplateButton} message HydratedTemplateButton + * @param {proto.SyncActionMessageRange} message SyncActionMessageRange * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - HydratedTemplateButton.toObject = function toObject(message, options) { + SyncActionMessageRange.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) - object.index = 0; - if (message.quickReplyButton != null && message.hasOwnProperty("quickReplyButton")) { - object.quickReplyButton = $root.proto.HydratedQuickReplyButton.toObject(message.quickReplyButton, options); - if (options.oneofs) - object.hydratedButton = "quickReplyButton"; - } - if (message.urlButton != null && message.hasOwnProperty("urlButton")) { - object.urlButton = $root.proto.HydratedURLButton.toObject(message.urlButton, options); - if (options.oneofs) - object.hydratedButton = "urlButton"; + if (options.arrays || options.defaults) + object.messages = []; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.lastMessageTimestamp = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.lastMessageTimestamp = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.lastSystemMessageTimestamp = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.lastSystemMessageTimestamp = options.longs === String ? "0" : 0; } - if (message.callButton != null && message.hasOwnProperty("callButton")) { - object.callButton = $root.proto.HydratedCallButton.toObject(message.callButton, options); - if (options.oneofs) - object.hydratedButton = "callButton"; + if (message.lastMessageTimestamp != null && message.hasOwnProperty("lastMessageTimestamp")) + if (typeof message.lastMessageTimestamp === "number") + object.lastMessageTimestamp = options.longs === String ? String(message.lastMessageTimestamp) : message.lastMessageTimestamp; + else + object.lastMessageTimestamp = options.longs === String ? $util.Long.prototype.toString.call(message.lastMessageTimestamp) : options.longs === Number ? new $util.LongBits(message.lastMessageTimestamp.low >>> 0, message.lastMessageTimestamp.high >>> 0).toNumber() : message.lastMessageTimestamp; + if (message.lastSystemMessageTimestamp != null && message.hasOwnProperty("lastSystemMessageTimestamp")) + if (typeof message.lastSystemMessageTimestamp === "number") + object.lastSystemMessageTimestamp = options.longs === String ? String(message.lastSystemMessageTimestamp) : message.lastSystemMessageTimestamp; + else + object.lastSystemMessageTimestamp = options.longs === String ? $util.Long.prototype.toString.call(message.lastSystemMessageTimestamp) : options.longs === Number ? new $util.LongBits(message.lastSystemMessageTimestamp.low >>> 0, message.lastSystemMessageTimestamp.high >>> 0).toNumber() : message.lastSystemMessageTimestamp; + if (message.messages && message.messages.length) { + object.messages = []; + for (var j = 0; j < message.messages.length; ++j) + object.messages[j] = $root.proto.SyncActionMessage.toObject(message.messages[j], options); } - if (message.index != null && message.hasOwnProperty("index")) - object.index = message.index; return object; }; /** - * Converts this HydratedTemplateButton to JSON. + * Converts this SyncActionMessageRange to JSON. * @function toJSON - * @memberof proto.HydratedTemplateButton + * @memberof proto.SyncActionMessageRange * @instance * @returns {Object.} JSON object */ - HydratedTemplateButton.prototype.toJSON = function toJSON() { + SyncActionMessageRange.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return HydratedTemplateButton; + return SyncActionMessageRange; })(); - proto.QuickReplyButton = (function() { + proto.SyncActionValue = (function() { /** - * Properties of a QuickReplyButton. + * Properties of a SyncActionValue. * @memberof proto - * @interface IQuickReplyButton - * @property {proto.IHighlyStructuredMessage|null} [displayText] QuickReplyButton displayText - * @property {string|null} [id] QuickReplyButton id + * @interface ISyncActionValue + * @property {number|Long|null} [timestamp] SyncActionValue timestamp + * @property {proto.IStarAction|null} [starAction] SyncActionValue starAction + * @property {proto.IContactAction|null} [contactAction] SyncActionValue contactAction + * @property {proto.IMuteAction|null} [muteAction] SyncActionValue muteAction + * @property {proto.IPinAction|null} [pinAction] SyncActionValue pinAction + * @property {proto.ISecurityNotificationSetting|null} [securityNotificationSetting] SyncActionValue securityNotificationSetting + * @property {proto.IPushNameSetting|null} [pushNameSetting] SyncActionValue pushNameSetting + * @property {proto.IQuickReplyAction|null} [quickReplyAction] SyncActionValue quickReplyAction + * @property {proto.IRecentStickerWeightsAction|null} [recentStickerWeightsAction] SyncActionValue recentStickerWeightsAction + * @property {proto.IRecentStickerMetadata|null} [recentStickerMetadata] SyncActionValue recentStickerMetadata + * @property {proto.IRecentEmojiWeightsAction|null} [recentEmojiWeightsAction] SyncActionValue recentEmojiWeightsAction + * @property {proto.ILabelEditAction|null} [labelEditAction] SyncActionValue labelEditAction + * @property {proto.ILabelAssociationAction|null} [labelAssociationAction] SyncActionValue labelAssociationAction + * @property {proto.ILocaleSetting|null} [localeSetting] SyncActionValue localeSetting + * @property {proto.IArchiveChatAction|null} [archiveChatAction] SyncActionValue archiveChatAction + * @property {proto.IDeleteMessageForMeAction|null} [deleteMessageForMeAction] SyncActionValue deleteMessageForMeAction + * @property {proto.IKeyExpiration|null} [keyExpiration] SyncActionValue keyExpiration + * @property {proto.IMarkChatAsReadAction|null} [markChatAsReadAction] SyncActionValue markChatAsReadAction + * @property {proto.IClearChatAction|null} [clearChatAction] SyncActionValue clearChatAction + * @property {proto.IDeleteChatAction|null} [deleteChatAction] SyncActionValue deleteChatAction + * @property {proto.IUnarchiveChatsSetting|null} [unarchiveChatsSetting] SyncActionValue unarchiveChatsSetting + * @property {proto.IPrimaryFeature|null} [primaryFeature] SyncActionValue primaryFeature + * @property {proto.IFavoriteStickerAction|null} [favoriteStickerAction] SyncActionValue favoriteStickerAction + * @property {proto.IAndroidUnsupportedActions|null} [androidUnsupportedActions] SyncActionValue androidUnsupportedActions */ /** - * Constructs a new QuickReplyButton. + * Constructs a new SyncActionValue. * @memberof proto - * @classdesc Represents a QuickReplyButton. - * @implements IQuickReplyButton + * @classdesc Represents a SyncActionValue. + * @implements ISyncActionValue * @constructor - * @param {proto.IQuickReplyButton=} [properties] Properties to set + * @param {proto.ISyncActionValue=} [properties] Properties to set */ - function QuickReplyButton(properties) { + function SyncActionValue(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -49257,523 +47541,374 @@ $root.proto = (function() { } /** - * QuickReplyButton displayText. - * @member {proto.IHighlyStructuredMessage|null|undefined} displayText - * @memberof proto.QuickReplyButton + * SyncActionValue timestamp. + * @member {number|Long} timestamp + * @memberof proto.SyncActionValue * @instance */ - QuickReplyButton.prototype.displayText = null; + SyncActionValue.prototype.timestamp = $util.Long ? $util.Long.fromBits(0,0,false) : 0; /** - * QuickReplyButton id. - * @member {string} id - * @memberof proto.QuickReplyButton + * SyncActionValue starAction. + * @member {proto.IStarAction|null|undefined} starAction + * @memberof proto.SyncActionValue * @instance */ - QuickReplyButton.prototype.id = ""; + SyncActionValue.prototype.starAction = null; /** - * Creates a new QuickReplyButton instance using the specified properties. - * @function create - * @memberof proto.QuickReplyButton - * @static - * @param {proto.IQuickReplyButton=} [properties] Properties to set - * @returns {proto.QuickReplyButton} QuickReplyButton instance + * SyncActionValue contactAction. + * @member {proto.IContactAction|null|undefined} contactAction + * @memberof proto.SyncActionValue + * @instance */ - QuickReplyButton.create = function create(properties) { - return new QuickReplyButton(properties); - }; + SyncActionValue.prototype.contactAction = null; /** - * Encodes the specified QuickReplyButton message. Does not implicitly {@link proto.QuickReplyButton.verify|verify} messages. - * @function encode - * @memberof proto.QuickReplyButton - * @static - * @param {proto.IQuickReplyButton} message QuickReplyButton message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * SyncActionValue muteAction. + * @member {proto.IMuteAction|null|undefined} muteAction + * @memberof proto.SyncActionValue + * @instance */ - QuickReplyButton.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.displayText != null && Object.hasOwnProperty.call(message, "displayText")) - $root.proto.HighlyStructuredMessage.encode(message.displayText, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.id != null && Object.hasOwnProperty.call(message, "id")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.id); - return writer; - }; + SyncActionValue.prototype.muteAction = null; /** - * Encodes the specified QuickReplyButton message, length delimited. Does not implicitly {@link proto.QuickReplyButton.verify|verify} messages. - * @function encodeDelimited - * @memberof proto.QuickReplyButton - * @static - * @param {proto.IQuickReplyButton} message QuickReplyButton message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * SyncActionValue pinAction. + * @member {proto.IPinAction|null|undefined} pinAction + * @memberof proto.SyncActionValue + * @instance */ - QuickReplyButton.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + SyncActionValue.prototype.pinAction = null; /** - * Decodes a QuickReplyButton message from the specified reader or buffer. - * @function decode - * @memberof proto.QuickReplyButton - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {proto.QuickReplyButton} QuickReplyButton - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * SyncActionValue securityNotificationSetting. + * @member {proto.ISecurityNotificationSetting|null|undefined} securityNotificationSetting + * @memberof proto.SyncActionValue + * @instance */ - QuickReplyButton.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.QuickReplyButton(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.displayText = $root.proto.HighlyStructuredMessage.decode(reader, reader.uint32()); - break; - case 2: - message.id = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + SyncActionValue.prototype.securityNotificationSetting = null; /** - * Decodes a QuickReplyButton message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof proto.QuickReplyButton - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.QuickReplyButton} QuickReplyButton - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * SyncActionValue pushNameSetting. + * @member {proto.IPushNameSetting|null|undefined} pushNameSetting + * @memberof proto.SyncActionValue + * @instance */ - QuickReplyButton.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + SyncActionValue.prototype.pushNameSetting = null; /** - * Verifies a QuickReplyButton message. - * @function verify - * @memberof proto.QuickReplyButton - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not + * SyncActionValue quickReplyAction. + * @member {proto.IQuickReplyAction|null|undefined} quickReplyAction + * @memberof proto.SyncActionValue + * @instance */ - QuickReplyButton.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.displayText != null && message.hasOwnProperty("displayText")) { - var error = $root.proto.HighlyStructuredMessage.verify(message.displayText); - if (error) - return "displayText." + error; - } - if (message.id != null && message.hasOwnProperty("id")) - if (!$util.isString(message.id)) - return "id: string expected"; - return null; - }; + SyncActionValue.prototype.quickReplyAction = null; /** - * Creates a QuickReplyButton message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof proto.QuickReplyButton - * @static - * @param {Object.} object Plain object - * @returns {proto.QuickReplyButton} QuickReplyButton + * SyncActionValue recentStickerWeightsAction. + * @member {proto.IRecentStickerWeightsAction|null|undefined} recentStickerWeightsAction + * @memberof proto.SyncActionValue + * @instance */ - QuickReplyButton.fromObject = function fromObject(object) { - if (object instanceof $root.proto.QuickReplyButton) - return object; - var message = new $root.proto.QuickReplyButton(); - if (object.displayText != null) { - if (typeof object.displayText !== "object") - throw TypeError(".proto.QuickReplyButton.displayText: object expected"); - message.displayText = $root.proto.HighlyStructuredMessage.fromObject(object.displayText); - } - if (object.id != null) - message.id = String(object.id); - return message; - }; + SyncActionValue.prototype.recentStickerWeightsAction = null; /** - * Creates a plain object from a QuickReplyButton message. Also converts values to other types if specified. - * @function toObject - * @memberof proto.QuickReplyButton - * @static - * @param {proto.QuickReplyButton} message QuickReplyButton - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object + * SyncActionValue recentStickerMetadata. + * @member {proto.IRecentStickerMetadata|null|undefined} recentStickerMetadata + * @memberof proto.SyncActionValue + * @instance */ - QuickReplyButton.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.displayText = null; - object.id = ""; - } - if (message.displayText != null && message.hasOwnProperty("displayText")) - object.displayText = $root.proto.HighlyStructuredMessage.toObject(message.displayText, options); - if (message.id != null && message.hasOwnProperty("id")) - object.id = message.id; - return object; - }; + SyncActionValue.prototype.recentStickerMetadata = null; /** - * Converts this QuickReplyButton to JSON. - * @function toJSON - * @memberof proto.QuickReplyButton + * SyncActionValue recentEmojiWeightsAction. + * @member {proto.IRecentEmojiWeightsAction|null|undefined} recentEmojiWeightsAction + * @memberof proto.SyncActionValue * @instance - * @returns {Object.} JSON object */ - QuickReplyButton.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QuickReplyButton; - })(); - - proto.URLButton = (function() { + SyncActionValue.prototype.recentEmojiWeightsAction = null; /** - * Properties of a URLButton. - * @memberof proto - * @interface IURLButton - * @property {proto.IHighlyStructuredMessage|null} [displayText] URLButton displayText - * @property {proto.IHighlyStructuredMessage|null} [url] URLButton url + * SyncActionValue labelEditAction. + * @member {proto.ILabelEditAction|null|undefined} labelEditAction + * @memberof proto.SyncActionValue + * @instance */ + SyncActionValue.prototype.labelEditAction = null; /** - * Constructs a new URLButton. - * @memberof proto - * @classdesc Represents a URLButton. - * @implements IURLButton - * @constructor - * @param {proto.IURLButton=} [properties] Properties to set + * SyncActionValue labelAssociationAction. + * @member {proto.ILabelAssociationAction|null|undefined} labelAssociationAction + * @memberof proto.SyncActionValue + * @instance */ - function URLButton(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + SyncActionValue.prototype.labelAssociationAction = null; /** - * URLButton displayText. - * @member {proto.IHighlyStructuredMessage|null|undefined} displayText - * @memberof proto.URLButton + * SyncActionValue localeSetting. + * @member {proto.ILocaleSetting|null|undefined} localeSetting + * @memberof proto.SyncActionValue * @instance */ - URLButton.prototype.displayText = null; + SyncActionValue.prototype.localeSetting = null; /** - * URLButton url. - * @member {proto.IHighlyStructuredMessage|null|undefined} url - * @memberof proto.URLButton + * SyncActionValue archiveChatAction. + * @member {proto.IArchiveChatAction|null|undefined} archiveChatAction + * @memberof proto.SyncActionValue * @instance */ - URLButton.prototype.url = null; + SyncActionValue.prototype.archiveChatAction = null; /** - * Creates a new URLButton instance using the specified properties. - * @function create - * @memberof proto.URLButton - * @static - * @param {proto.IURLButton=} [properties] Properties to set - * @returns {proto.URLButton} URLButton instance + * SyncActionValue deleteMessageForMeAction. + * @member {proto.IDeleteMessageForMeAction|null|undefined} deleteMessageForMeAction + * @memberof proto.SyncActionValue + * @instance */ - URLButton.create = function create(properties) { - return new URLButton(properties); - }; + SyncActionValue.prototype.deleteMessageForMeAction = null; /** - * Encodes the specified URLButton message. Does not implicitly {@link proto.URLButton.verify|verify} messages. - * @function encode - * @memberof proto.URLButton - * @static - * @param {proto.IURLButton} message URLButton message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * SyncActionValue keyExpiration. + * @member {proto.IKeyExpiration|null|undefined} keyExpiration + * @memberof proto.SyncActionValue + * @instance */ - URLButton.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.displayText != null && Object.hasOwnProperty.call(message, "displayText")) - $root.proto.HighlyStructuredMessage.encode(message.displayText, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.url != null && Object.hasOwnProperty.call(message, "url")) - $root.proto.HighlyStructuredMessage.encode(message.url, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; + SyncActionValue.prototype.keyExpiration = null; /** - * Encodes the specified URLButton message, length delimited. Does not implicitly {@link proto.URLButton.verify|verify} messages. - * @function encodeDelimited - * @memberof proto.URLButton - * @static - * @param {proto.IURLButton} message URLButton message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * SyncActionValue markChatAsReadAction. + * @member {proto.IMarkChatAsReadAction|null|undefined} markChatAsReadAction + * @memberof proto.SyncActionValue + * @instance */ - URLButton.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + SyncActionValue.prototype.markChatAsReadAction = null; /** - * Decodes a URLButton message from the specified reader or buffer. - * @function decode - * @memberof proto.URLButton - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {proto.URLButton} URLButton - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - URLButton.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.URLButton(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.displayText = $root.proto.HighlyStructuredMessage.decode(reader, reader.uint32()); - break; - case 2: - message.url = $root.proto.HighlyStructuredMessage.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a URLButton message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof proto.URLButton - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.URLButton} URLButton - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - URLButton.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a URLButton message. - * @function verify - * @memberof proto.URLButton - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - URLButton.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.displayText != null && message.hasOwnProperty("displayText")) { - var error = $root.proto.HighlyStructuredMessage.verify(message.displayText); - if (error) - return "displayText." + error; - } - if (message.url != null && message.hasOwnProperty("url")) { - var error = $root.proto.HighlyStructuredMessage.verify(message.url); - if (error) - return "url." + error; - } - return null; - }; - - /** - * Creates a URLButton message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof proto.URLButton - * @static - * @param {Object.} object Plain object - * @returns {proto.URLButton} URLButton - */ - URLButton.fromObject = function fromObject(object) { - if (object instanceof $root.proto.URLButton) - return object; - var message = new $root.proto.URLButton(); - if (object.displayText != null) { - if (typeof object.displayText !== "object") - throw TypeError(".proto.URLButton.displayText: object expected"); - message.displayText = $root.proto.HighlyStructuredMessage.fromObject(object.displayText); - } - if (object.url != null) { - if (typeof object.url !== "object") - throw TypeError(".proto.URLButton.url: object expected"); - message.url = $root.proto.HighlyStructuredMessage.fromObject(object.url); - } - return message; - }; - - /** - * Creates a plain object from a URLButton message. Also converts values to other types if specified. - * @function toObject - * @memberof proto.URLButton - * @static - * @param {proto.URLButton} message URLButton - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object + * SyncActionValue clearChatAction. + * @member {proto.IClearChatAction|null|undefined} clearChatAction + * @memberof proto.SyncActionValue + * @instance */ - URLButton.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.displayText = null; - object.url = null; - } - if (message.displayText != null && message.hasOwnProperty("displayText")) - object.displayText = $root.proto.HighlyStructuredMessage.toObject(message.displayText, options); - if (message.url != null && message.hasOwnProperty("url")) - object.url = $root.proto.HighlyStructuredMessage.toObject(message.url, options); - return object; - }; + SyncActionValue.prototype.clearChatAction = null; /** - * Converts this URLButton to JSON. - * @function toJSON - * @memberof proto.URLButton + * SyncActionValue deleteChatAction. + * @member {proto.IDeleteChatAction|null|undefined} deleteChatAction + * @memberof proto.SyncActionValue * @instance - * @returns {Object.} JSON object */ - URLButton.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return URLButton; - })(); - - proto.CallButton = (function() { + SyncActionValue.prototype.deleteChatAction = null; /** - * Properties of a CallButton. - * @memberof proto - * @interface ICallButton - * @property {proto.IHighlyStructuredMessage|null} [displayText] CallButton displayText - * @property {proto.IHighlyStructuredMessage|null} [phoneNumber] CallButton phoneNumber + * SyncActionValue unarchiveChatsSetting. + * @member {proto.IUnarchiveChatsSetting|null|undefined} unarchiveChatsSetting + * @memberof proto.SyncActionValue + * @instance */ + SyncActionValue.prototype.unarchiveChatsSetting = null; /** - * Constructs a new CallButton. - * @memberof proto - * @classdesc Represents a CallButton. - * @implements ICallButton - * @constructor - * @param {proto.ICallButton=} [properties] Properties to set + * SyncActionValue primaryFeature. + * @member {proto.IPrimaryFeature|null|undefined} primaryFeature + * @memberof proto.SyncActionValue + * @instance */ - function CallButton(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + SyncActionValue.prototype.primaryFeature = null; /** - * CallButton displayText. - * @member {proto.IHighlyStructuredMessage|null|undefined} displayText - * @memberof proto.CallButton + * SyncActionValue favoriteStickerAction. + * @member {proto.IFavoriteStickerAction|null|undefined} favoriteStickerAction + * @memberof proto.SyncActionValue * @instance */ - CallButton.prototype.displayText = null; + SyncActionValue.prototype.favoriteStickerAction = null; /** - * CallButton phoneNumber. - * @member {proto.IHighlyStructuredMessage|null|undefined} phoneNumber - * @memberof proto.CallButton + * SyncActionValue androidUnsupportedActions. + * @member {proto.IAndroidUnsupportedActions|null|undefined} androidUnsupportedActions + * @memberof proto.SyncActionValue * @instance */ - CallButton.prototype.phoneNumber = null; + SyncActionValue.prototype.androidUnsupportedActions = null; /** - * Creates a new CallButton instance using the specified properties. + * Creates a new SyncActionValue instance using the specified properties. * @function create - * @memberof proto.CallButton + * @memberof proto.SyncActionValue * @static - * @param {proto.ICallButton=} [properties] Properties to set - * @returns {proto.CallButton} CallButton instance + * @param {proto.ISyncActionValue=} [properties] Properties to set + * @returns {proto.SyncActionValue} SyncActionValue instance */ - CallButton.create = function create(properties) { - return new CallButton(properties); + SyncActionValue.create = function create(properties) { + return new SyncActionValue(properties); }; /** - * Encodes the specified CallButton message. Does not implicitly {@link proto.CallButton.verify|verify} messages. + * Encodes the specified SyncActionValue message. Does not implicitly {@link proto.SyncActionValue.verify|verify} messages. * @function encode - * @memberof proto.CallButton + * @memberof proto.SyncActionValue * @static - * @param {proto.ICallButton} message CallButton message or plain object to encode + * @param {proto.ISyncActionValue} message SyncActionValue message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CallButton.encode = function encode(message, writer) { + SyncActionValue.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.displayText != null && Object.hasOwnProperty.call(message, "displayText")) - $root.proto.HighlyStructuredMessage.encode(message.displayText, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.phoneNumber != null && Object.hasOwnProperty.call(message, "phoneNumber")) - $root.proto.HighlyStructuredMessage.encode(message.phoneNumber, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.timestamp != null && Object.hasOwnProperty.call(message, "timestamp")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.timestamp); + if (message.starAction != null && Object.hasOwnProperty.call(message, "starAction")) + $root.proto.StarAction.encode(message.starAction, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.contactAction != null && Object.hasOwnProperty.call(message, "contactAction")) + $root.proto.ContactAction.encode(message.contactAction, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.muteAction != null && Object.hasOwnProperty.call(message, "muteAction")) + $root.proto.MuteAction.encode(message.muteAction, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.pinAction != null && Object.hasOwnProperty.call(message, "pinAction")) + $root.proto.PinAction.encode(message.pinAction, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.securityNotificationSetting != null && Object.hasOwnProperty.call(message, "securityNotificationSetting")) + $root.proto.SecurityNotificationSetting.encode(message.securityNotificationSetting, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.pushNameSetting != null && Object.hasOwnProperty.call(message, "pushNameSetting")) + $root.proto.PushNameSetting.encode(message.pushNameSetting, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.quickReplyAction != null && Object.hasOwnProperty.call(message, "quickReplyAction")) + $root.proto.QuickReplyAction.encode(message.quickReplyAction, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.recentStickerWeightsAction != null && Object.hasOwnProperty.call(message, "recentStickerWeightsAction")) + $root.proto.RecentStickerWeightsAction.encode(message.recentStickerWeightsAction, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.recentStickerMetadata != null && Object.hasOwnProperty.call(message, "recentStickerMetadata")) + $root.proto.RecentStickerMetadata.encode(message.recentStickerMetadata, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.recentEmojiWeightsAction != null && Object.hasOwnProperty.call(message, "recentEmojiWeightsAction")) + $root.proto.RecentEmojiWeightsAction.encode(message.recentEmojiWeightsAction, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.labelEditAction != null && Object.hasOwnProperty.call(message, "labelEditAction")) + $root.proto.LabelEditAction.encode(message.labelEditAction, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); + if (message.labelAssociationAction != null && Object.hasOwnProperty.call(message, "labelAssociationAction")) + $root.proto.LabelAssociationAction.encode(message.labelAssociationAction, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); + if (message.localeSetting != null && Object.hasOwnProperty.call(message, "localeSetting")) + $root.proto.LocaleSetting.encode(message.localeSetting, writer.uint32(/* id 16, wireType 2 =*/130).fork()).ldelim(); + if (message.archiveChatAction != null && Object.hasOwnProperty.call(message, "archiveChatAction")) + $root.proto.ArchiveChatAction.encode(message.archiveChatAction, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); + if (message.deleteMessageForMeAction != null && Object.hasOwnProperty.call(message, "deleteMessageForMeAction")) + $root.proto.DeleteMessageForMeAction.encode(message.deleteMessageForMeAction, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); + if (message.keyExpiration != null && Object.hasOwnProperty.call(message, "keyExpiration")) + $root.proto.KeyExpiration.encode(message.keyExpiration, writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim(); + if (message.markChatAsReadAction != null && Object.hasOwnProperty.call(message, "markChatAsReadAction")) + $root.proto.MarkChatAsReadAction.encode(message.markChatAsReadAction, writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); + if (message.clearChatAction != null && Object.hasOwnProperty.call(message, "clearChatAction")) + $root.proto.ClearChatAction.encode(message.clearChatAction, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + if (message.deleteChatAction != null && Object.hasOwnProperty.call(message, "deleteChatAction")) + $root.proto.DeleteChatAction.encode(message.deleteChatAction, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); + if (message.unarchiveChatsSetting != null && Object.hasOwnProperty.call(message, "unarchiveChatsSetting")) + $root.proto.UnarchiveChatsSetting.encode(message.unarchiveChatsSetting, writer.uint32(/* id 23, wireType 2 =*/186).fork()).ldelim(); + if (message.primaryFeature != null && Object.hasOwnProperty.call(message, "primaryFeature")) + $root.proto.PrimaryFeature.encode(message.primaryFeature, writer.uint32(/* id 24, wireType 2 =*/194).fork()).ldelim(); + if (message.favoriteStickerAction != null && Object.hasOwnProperty.call(message, "favoriteStickerAction")) + $root.proto.FavoriteStickerAction.encode(message.favoriteStickerAction, writer.uint32(/* id 25, wireType 2 =*/202).fork()).ldelim(); + if (message.androidUnsupportedActions != null && Object.hasOwnProperty.call(message, "androidUnsupportedActions")) + $root.proto.AndroidUnsupportedActions.encode(message.androidUnsupportedActions, writer.uint32(/* id 26, wireType 2 =*/210).fork()).ldelim(); return writer; }; /** - * Encodes the specified CallButton message, length delimited. Does not implicitly {@link proto.CallButton.verify|verify} messages. + * Encodes the specified SyncActionValue message, length delimited. Does not implicitly {@link proto.SyncActionValue.verify|verify} messages. * @function encodeDelimited - * @memberof proto.CallButton + * @memberof proto.SyncActionValue * @static - * @param {proto.ICallButton} message CallButton message or plain object to encode + * @param {proto.ISyncActionValue} message SyncActionValue message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CallButton.encodeDelimited = function encodeDelimited(message, writer) { + SyncActionValue.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a CallButton message from the specified reader or buffer. + * Decodes a SyncActionValue message from the specified reader or buffer. * @function decode - * @memberof proto.CallButton + * @memberof proto.SyncActionValue * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {proto.CallButton} CallButton + * @returns {proto.SyncActionValue} SyncActionValue * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CallButton.decode = function decode(reader, length) { + SyncActionValue.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.CallButton(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.SyncActionValue(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.displayText = $root.proto.HighlyStructuredMessage.decode(reader, reader.uint32()); + message.timestamp = reader.int64(); break; case 2: - message.phoneNumber = $root.proto.HighlyStructuredMessage.decode(reader, reader.uint32()); + message.starAction = $root.proto.StarAction.decode(reader, reader.uint32()); + break; + case 3: + message.contactAction = $root.proto.ContactAction.decode(reader, reader.uint32()); + break; + case 4: + message.muteAction = $root.proto.MuteAction.decode(reader, reader.uint32()); + break; + case 5: + message.pinAction = $root.proto.PinAction.decode(reader, reader.uint32()); + break; + case 6: + message.securityNotificationSetting = $root.proto.SecurityNotificationSetting.decode(reader, reader.uint32()); + break; + case 7: + message.pushNameSetting = $root.proto.PushNameSetting.decode(reader, reader.uint32()); + break; + case 8: + message.quickReplyAction = $root.proto.QuickReplyAction.decode(reader, reader.uint32()); + break; + case 9: + message.recentStickerWeightsAction = $root.proto.RecentStickerWeightsAction.decode(reader, reader.uint32()); + break; + case 10: + message.recentStickerMetadata = $root.proto.RecentStickerMetadata.decode(reader, reader.uint32()); + break; + case 11: + message.recentEmojiWeightsAction = $root.proto.RecentEmojiWeightsAction.decode(reader, reader.uint32()); + break; + case 14: + message.labelEditAction = $root.proto.LabelEditAction.decode(reader, reader.uint32()); + break; + case 15: + message.labelAssociationAction = $root.proto.LabelAssociationAction.decode(reader, reader.uint32()); + break; + case 16: + message.localeSetting = $root.proto.LocaleSetting.decode(reader, reader.uint32()); + break; + case 17: + message.archiveChatAction = $root.proto.ArchiveChatAction.decode(reader, reader.uint32()); + break; + case 18: + message.deleteMessageForMeAction = $root.proto.DeleteMessageForMeAction.decode(reader, reader.uint32()); + break; + case 19: + message.keyExpiration = $root.proto.KeyExpiration.decode(reader, reader.uint32()); + break; + case 20: + message.markChatAsReadAction = $root.proto.MarkChatAsReadAction.decode(reader, reader.uint32()); + break; + case 21: + message.clearChatAction = $root.proto.ClearChatAction.decode(reader, reader.uint32()); + break; + case 22: + message.deleteChatAction = $root.proto.DeleteChatAction.decode(reader, reader.uint32()); + break; + case 23: + message.unarchiveChatsSetting = $root.proto.UnarchiveChatsSetting.decode(reader, reader.uint32()); + break; + case 24: + message.primaryFeature = $root.proto.PrimaryFeature.decode(reader, reader.uint32()); + break; + case 25: + message.favoriteStickerAction = $root.proto.FavoriteStickerAction.decode(reader, reader.uint32()); + break; + case 26: + message.androidUnsupportedActions = $root.proto.AndroidUnsupportedActions.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -49784,129 +47919,421 @@ $root.proto = (function() { }; /** - * Decodes a CallButton message from the specified reader or buffer, length delimited. + * Decodes a SyncActionValue message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof proto.CallButton + * @memberof proto.SyncActionValue * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.CallButton} CallButton + * @returns {proto.SyncActionValue} SyncActionValue * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CallButton.decodeDelimited = function decodeDelimited(reader) { + SyncActionValue.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a CallButton message. + * Verifies a SyncActionValue message. * @function verify - * @memberof proto.CallButton + * @memberof proto.SyncActionValue * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - CallButton.verify = function verify(message) { + SyncActionValue.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.displayText != null && message.hasOwnProperty("displayText")) { - var error = $root.proto.HighlyStructuredMessage.verify(message.displayText); + if (message.timestamp != null && message.hasOwnProperty("timestamp")) + if (!$util.isInteger(message.timestamp) && !(message.timestamp && $util.isInteger(message.timestamp.low) && $util.isInteger(message.timestamp.high))) + return "timestamp: integer|Long expected"; + if (message.starAction != null && message.hasOwnProperty("starAction")) { + var error = $root.proto.StarAction.verify(message.starAction); if (error) - return "displayText." + error; + return "starAction." + error; } - if (message.phoneNumber != null && message.hasOwnProperty("phoneNumber")) { - var error = $root.proto.HighlyStructuredMessage.verify(message.phoneNumber); + if (message.contactAction != null && message.hasOwnProperty("contactAction")) { + var error = $root.proto.ContactAction.verify(message.contactAction); if (error) - return "phoneNumber." + error; + return "contactAction." + error; + } + if (message.muteAction != null && message.hasOwnProperty("muteAction")) { + var error = $root.proto.MuteAction.verify(message.muteAction); + if (error) + return "muteAction." + error; + } + if (message.pinAction != null && message.hasOwnProperty("pinAction")) { + var error = $root.proto.PinAction.verify(message.pinAction); + if (error) + return "pinAction." + error; + } + if (message.securityNotificationSetting != null && message.hasOwnProperty("securityNotificationSetting")) { + var error = $root.proto.SecurityNotificationSetting.verify(message.securityNotificationSetting); + if (error) + return "securityNotificationSetting." + error; + } + if (message.pushNameSetting != null && message.hasOwnProperty("pushNameSetting")) { + var error = $root.proto.PushNameSetting.verify(message.pushNameSetting); + if (error) + return "pushNameSetting." + error; + } + if (message.quickReplyAction != null && message.hasOwnProperty("quickReplyAction")) { + var error = $root.proto.QuickReplyAction.verify(message.quickReplyAction); + if (error) + return "quickReplyAction." + error; + } + if (message.recentStickerWeightsAction != null && message.hasOwnProperty("recentStickerWeightsAction")) { + var error = $root.proto.RecentStickerWeightsAction.verify(message.recentStickerWeightsAction); + if (error) + return "recentStickerWeightsAction." + error; + } + if (message.recentStickerMetadata != null && message.hasOwnProperty("recentStickerMetadata")) { + var error = $root.proto.RecentStickerMetadata.verify(message.recentStickerMetadata); + if (error) + return "recentStickerMetadata." + error; + } + if (message.recentEmojiWeightsAction != null && message.hasOwnProperty("recentEmojiWeightsAction")) { + var error = $root.proto.RecentEmojiWeightsAction.verify(message.recentEmojiWeightsAction); + if (error) + return "recentEmojiWeightsAction." + error; + } + if (message.labelEditAction != null && message.hasOwnProperty("labelEditAction")) { + var error = $root.proto.LabelEditAction.verify(message.labelEditAction); + if (error) + return "labelEditAction." + error; + } + if (message.labelAssociationAction != null && message.hasOwnProperty("labelAssociationAction")) { + var error = $root.proto.LabelAssociationAction.verify(message.labelAssociationAction); + if (error) + return "labelAssociationAction." + error; + } + if (message.localeSetting != null && message.hasOwnProperty("localeSetting")) { + var error = $root.proto.LocaleSetting.verify(message.localeSetting); + if (error) + return "localeSetting." + error; + } + if (message.archiveChatAction != null && message.hasOwnProperty("archiveChatAction")) { + var error = $root.proto.ArchiveChatAction.verify(message.archiveChatAction); + if (error) + return "archiveChatAction." + error; + } + if (message.deleteMessageForMeAction != null && message.hasOwnProperty("deleteMessageForMeAction")) { + var error = $root.proto.DeleteMessageForMeAction.verify(message.deleteMessageForMeAction); + if (error) + return "deleteMessageForMeAction." + error; + } + if (message.keyExpiration != null && message.hasOwnProperty("keyExpiration")) { + var error = $root.proto.KeyExpiration.verify(message.keyExpiration); + if (error) + return "keyExpiration." + error; + } + if (message.markChatAsReadAction != null && message.hasOwnProperty("markChatAsReadAction")) { + var error = $root.proto.MarkChatAsReadAction.verify(message.markChatAsReadAction); + if (error) + return "markChatAsReadAction." + error; + } + if (message.clearChatAction != null && message.hasOwnProperty("clearChatAction")) { + var error = $root.proto.ClearChatAction.verify(message.clearChatAction); + if (error) + return "clearChatAction." + error; + } + if (message.deleteChatAction != null && message.hasOwnProperty("deleteChatAction")) { + var error = $root.proto.DeleteChatAction.verify(message.deleteChatAction); + if (error) + return "deleteChatAction." + error; + } + if (message.unarchiveChatsSetting != null && message.hasOwnProperty("unarchiveChatsSetting")) { + var error = $root.proto.UnarchiveChatsSetting.verify(message.unarchiveChatsSetting); + if (error) + return "unarchiveChatsSetting." + error; + } + if (message.primaryFeature != null && message.hasOwnProperty("primaryFeature")) { + var error = $root.proto.PrimaryFeature.verify(message.primaryFeature); + if (error) + return "primaryFeature." + error; + } + if (message.favoriteStickerAction != null && message.hasOwnProperty("favoriteStickerAction")) { + var error = $root.proto.FavoriteStickerAction.verify(message.favoriteStickerAction); + if (error) + return "favoriteStickerAction." + error; + } + if (message.androidUnsupportedActions != null && message.hasOwnProperty("androidUnsupportedActions")) { + var error = $root.proto.AndroidUnsupportedActions.verify(message.androidUnsupportedActions); + if (error) + return "androidUnsupportedActions." + error; } return null; }; /** - * Creates a CallButton message from a plain object. Also converts values to their respective internal types. + * Creates a SyncActionValue message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof proto.CallButton + * @memberof proto.SyncActionValue * @static * @param {Object.} object Plain object - * @returns {proto.CallButton} CallButton + * @returns {proto.SyncActionValue} SyncActionValue */ - CallButton.fromObject = function fromObject(object) { - if (object instanceof $root.proto.CallButton) + SyncActionValue.fromObject = function fromObject(object) { + if (object instanceof $root.proto.SyncActionValue) return object; - var message = new $root.proto.CallButton(); - if (object.displayText != null) { - if (typeof object.displayText !== "object") - throw TypeError(".proto.CallButton.displayText: object expected"); - message.displayText = $root.proto.HighlyStructuredMessage.fromObject(object.displayText); + var message = new $root.proto.SyncActionValue(); + if (object.timestamp != null) + if ($util.Long) + (message.timestamp = $util.Long.fromValue(object.timestamp)).unsigned = false; + else if (typeof object.timestamp === "string") + message.timestamp = parseInt(object.timestamp, 10); + else if (typeof object.timestamp === "number") + message.timestamp = object.timestamp; + else if (typeof object.timestamp === "object") + message.timestamp = new $util.LongBits(object.timestamp.low >>> 0, object.timestamp.high >>> 0).toNumber(); + if (object.starAction != null) { + if (typeof object.starAction !== "object") + throw TypeError(".proto.SyncActionValue.starAction: object expected"); + message.starAction = $root.proto.StarAction.fromObject(object.starAction); } - if (object.phoneNumber != null) { - if (typeof object.phoneNumber !== "object") - throw TypeError(".proto.CallButton.phoneNumber: object expected"); - message.phoneNumber = $root.proto.HighlyStructuredMessage.fromObject(object.phoneNumber); + if (object.contactAction != null) { + if (typeof object.contactAction !== "object") + throw TypeError(".proto.SyncActionValue.contactAction: object expected"); + message.contactAction = $root.proto.ContactAction.fromObject(object.contactAction); } - return message; + if (object.muteAction != null) { + if (typeof object.muteAction !== "object") + throw TypeError(".proto.SyncActionValue.muteAction: object expected"); + message.muteAction = $root.proto.MuteAction.fromObject(object.muteAction); + } + if (object.pinAction != null) { + if (typeof object.pinAction !== "object") + throw TypeError(".proto.SyncActionValue.pinAction: object expected"); + message.pinAction = $root.proto.PinAction.fromObject(object.pinAction); + } + if (object.securityNotificationSetting != null) { + if (typeof object.securityNotificationSetting !== "object") + throw TypeError(".proto.SyncActionValue.securityNotificationSetting: object expected"); + message.securityNotificationSetting = $root.proto.SecurityNotificationSetting.fromObject(object.securityNotificationSetting); + } + if (object.pushNameSetting != null) { + if (typeof object.pushNameSetting !== "object") + throw TypeError(".proto.SyncActionValue.pushNameSetting: object expected"); + message.pushNameSetting = $root.proto.PushNameSetting.fromObject(object.pushNameSetting); + } + if (object.quickReplyAction != null) { + if (typeof object.quickReplyAction !== "object") + throw TypeError(".proto.SyncActionValue.quickReplyAction: object expected"); + message.quickReplyAction = $root.proto.QuickReplyAction.fromObject(object.quickReplyAction); + } + if (object.recentStickerWeightsAction != null) { + if (typeof object.recentStickerWeightsAction !== "object") + throw TypeError(".proto.SyncActionValue.recentStickerWeightsAction: object expected"); + message.recentStickerWeightsAction = $root.proto.RecentStickerWeightsAction.fromObject(object.recentStickerWeightsAction); + } + if (object.recentStickerMetadata != null) { + if (typeof object.recentStickerMetadata !== "object") + throw TypeError(".proto.SyncActionValue.recentStickerMetadata: object expected"); + message.recentStickerMetadata = $root.proto.RecentStickerMetadata.fromObject(object.recentStickerMetadata); + } + if (object.recentEmojiWeightsAction != null) { + if (typeof object.recentEmojiWeightsAction !== "object") + throw TypeError(".proto.SyncActionValue.recentEmojiWeightsAction: object expected"); + message.recentEmojiWeightsAction = $root.proto.RecentEmojiWeightsAction.fromObject(object.recentEmojiWeightsAction); + } + if (object.labelEditAction != null) { + if (typeof object.labelEditAction !== "object") + throw TypeError(".proto.SyncActionValue.labelEditAction: object expected"); + message.labelEditAction = $root.proto.LabelEditAction.fromObject(object.labelEditAction); + } + if (object.labelAssociationAction != null) { + if (typeof object.labelAssociationAction !== "object") + throw TypeError(".proto.SyncActionValue.labelAssociationAction: object expected"); + message.labelAssociationAction = $root.proto.LabelAssociationAction.fromObject(object.labelAssociationAction); + } + if (object.localeSetting != null) { + if (typeof object.localeSetting !== "object") + throw TypeError(".proto.SyncActionValue.localeSetting: object expected"); + message.localeSetting = $root.proto.LocaleSetting.fromObject(object.localeSetting); + } + if (object.archiveChatAction != null) { + if (typeof object.archiveChatAction !== "object") + throw TypeError(".proto.SyncActionValue.archiveChatAction: object expected"); + message.archiveChatAction = $root.proto.ArchiveChatAction.fromObject(object.archiveChatAction); + } + if (object.deleteMessageForMeAction != null) { + if (typeof object.deleteMessageForMeAction !== "object") + throw TypeError(".proto.SyncActionValue.deleteMessageForMeAction: object expected"); + message.deleteMessageForMeAction = $root.proto.DeleteMessageForMeAction.fromObject(object.deleteMessageForMeAction); + } + if (object.keyExpiration != null) { + if (typeof object.keyExpiration !== "object") + throw TypeError(".proto.SyncActionValue.keyExpiration: object expected"); + message.keyExpiration = $root.proto.KeyExpiration.fromObject(object.keyExpiration); + } + if (object.markChatAsReadAction != null) { + if (typeof object.markChatAsReadAction !== "object") + throw TypeError(".proto.SyncActionValue.markChatAsReadAction: object expected"); + message.markChatAsReadAction = $root.proto.MarkChatAsReadAction.fromObject(object.markChatAsReadAction); + } + if (object.clearChatAction != null) { + if (typeof object.clearChatAction !== "object") + throw TypeError(".proto.SyncActionValue.clearChatAction: object expected"); + message.clearChatAction = $root.proto.ClearChatAction.fromObject(object.clearChatAction); + } + if (object.deleteChatAction != null) { + if (typeof object.deleteChatAction !== "object") + throw TypeError(".proto.SyncActionValue.deleteChatAction: object expected"); + message.deleteChatAction = $root.proto.DeleteChatAction.fromObject(object.deleteChatAction); + } + if (object.unarchiveChatsSetting != null) { + if (typeof object.unarchiveChatsSetting !== "object") + throw TypeError(".proto.SyncActionValue.unarchiveChatsSetting: object expected"); + message.unarchiveChatsSetting = $root.proto.UnarchiveChatsSetting.fromObject(object.unarchiveChatsSetting); + } + if (object.primaryFeature != null) { + if (typeof object.primaryFeature !== "object") + throw TypeError(".proto.SyncActionValue.primaryFeature: object expected"); + message.primaryFeature = $root.proto.PrimaryFeature.fromObject(object.primaryFeature); + } + if (object.favoriteStickerAction != null) { + if (typeof object.favoriteStickerAction !== "object") + throw TypeError(".proto.SyncActionValue.favoriteStickerAction: object expected"); + message.favoriteStickerAction = $root.proto.FavoriteStickerAction.fromObject(object.favoriteStickerAction); + } + if (object.androidUnsupportedActions != null) { + if (typeof object.androidUnsupportedActions !== "object") + throw TypeError(".proto.SyncActionValue.androidUnsupportedActions: object expected"); + message.androidUnsupportedActions = $root.proto.AndroidUnsupportedActions.fromObject(object.androidUnsupportedActions); + } + return message; }; /** - * Creates a plain object from a CallButton message. Also converts values to other types if specified. + * Creates a plain object from a SyncActionValue message. Also converts values to other types if specified. * @function toObject - * @memberof proto.CallButton + * @memberof proto.SyncActionValue * @static - * @param {proto.CallButton} message CallButton + * @param {proto.SyncActionValue} message SyncActionValue * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CallButton.toObject = function toObject(message, options) { + SyncActionValue.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.displayText = null; - object.phoneNumber = null; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.timestamp = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.timestamp = options.longs === String ? "0" : 0; + object.starAction = null; + object.contactAction = null; + object.muteAction = null; + object.pinAction = null; + object.securityNotificationSetting = null; + object.pushNameSetting = null; + object.quickReplyAction = null; + object.recentStickerWeightsAction = null; + object.recentStickerMetadata = null; + object.recentEmojiWeightsAction = null; + object.labelEditAction = null; + object.labelAssociationAction = null; + object.localeSetting = null; + object.archiveChatAction = null; + object.deleteMessageForMeAction = null; + object.keyExpiration = null; + object.markChatAsReadAction = null; + object.clearChatAction = null; + object.deleteChatAction = null; + object.unarchiveChatsSetting = null; + object.primaryFeature = null; + object.favoriteStickerAction = null; + object.androidUnsupportedActions = null; } - if (message.displayText != null && message.hasOwnProperty("displayText")) - object.displayText = $root.proto.HighlyStructuredMessage.toObject(message.displayText, options); - if (message.phoneNumber != null && message.hasOwnProperty("phoneNumber")) - object.phoneNumber = $root.proto.HighlyStructuredMessage.toObject(message.phoneNumber, options); + if (message.timestamp != null && message.hasOwnProperty("timestamp")) + if (typeof message.timestamp === "number") + object.timestamp = options.longs === String ? String(message.timestamp) : message.timestamp; + else + object.timestamp = options.longs === String ? $util.Long.prototype.toString.call(message.timestamp) : options.longs === Number ? new $util.LongBits(message.timestamp.low >>> 0, message.timestamp.high >>> 0).toNumber() : message.timestamp; + if (message.starAction != null && message.hasOwnProperty("starAction")) + object.starAction = $root.proto.StarAction.toObject(message.starAction, options); + if (message.contactAction != null && message.hasOwnProperty("contactAction")) + object.contactAction = $root.proto.ContactAction.toObject(message.contactAction, options); + if (message.muteAction != null && message.hasOwnProperty("muteAction")) + object.muteAction = $root.proto.MuteAction.toObject(message.muteAction, options); + if (message.pinAction != null && message.hasOwnProperty("pinAction")) + object.pinAction = $root.proto.PinAction.toObject(message.pinAction, options); + if (message.securityNotificationSetting != null && message.hasOwnProperty("securityNotificationSetting")) + object.securityNotificationSetting = $root.proto.SecurityNotificationSetting.toObject(message.securityNotificationSetting, options); + if (message.pushNameSetting != null && message.hasOwnProperty("pushNameSetting")) + object.pushNameSetting = $root.proto.PushNameSetting.toObject(message.pushNameSetting, options); + if (message.quickReplyAction != null && message.hasOwnProperty("quickReplyAction")) + object.quickReplyAction = $root.proto.QuickReplyAction.toObject(message.quickReplyAction, options); + if (message.recentStickerWeightsAction != null && message.hasOwnProperty("recentStickerWeightsAction")) + object.recentStickerWeightsAction = $root.proto.RecentStickerWeightsAction.toObject(message.recentStickerWeightsAction, options); + if (message.recentStickerMetadata != null && message.hasOwnProperty("recentStickerMetadata")) + object.recentStickerMetadata = $root.proto.RecentStickerMetadata.toObject(message.recentStickerMetadata, options); + if (message.recentEmojiWeightsAction != null && message.hasOwnProperty("recentEmojiWeightsAction")) + object.recentEmojiWeightsAction = $root.proto.RecentEmojiWeightsAction.toObject(message.recentEmojiWeightsAction, options); + if (message.labelEditAction != null && message.hasOwnProperty("labelEditAction")) + object.labelEditAction = $root.proto.LabelEditAction.toObject(message.labelEditAction, options); + if (message.labelAssociationAction != null && message.hasOwnProperty("labelAssociationAction")) + object.labelAssociationAction = $root.proto.LabelAssociationAction.toObject(message.labelAssociationAction, options); + if (message.localeSetting != null && message.hasOwnProperty("localeSetting")) + object.localeSetting = $root.proto.LocaleSetting.toObject(message.localeSetting, options); + if (message.archiveChatAction != null && message.hasOwnProperty("archiveChatAction")) + object.archiveChatAction = $root.proto.ArchiveChatAction.toObject(message.archiveChatAction, options); + if (message.deleteMessageForMeAction != null && message.hasOwnProperty("deleteMessageForMeAction")) + object.deleteMessageForMeAction = $root.proto.DeleteMessageForMeAction.toObject(message.deleteMessageForMeAction, options); + if (message.keyExpiration != null && message.hasOwnProperty("keyExpiration")) + object.keyExpiration = $root.proto.KeyExpiration.toObject(message.keyExpiration, options); + if (message.markChatAsReadAction != null && message.hasOwnProperty("markChatAsReadAction")) + object.markChatAsReadAction = $root.proto.MarkChatAsReadAction.toObject(message.markChatAsReadAction, options); + if (message.clearChatAction != null && message.hasOwnProperty("clearChatAction")) + object.clearChatAction = $root.proto.ClearChatAction.toObject(message.clearChatAction, options); + if (message.deleteChatAction != null && message.hasOwnProperty("deleteChatAction")) + object.deleteChatAction = $root.proto.DeleteChatAction.toObject(message.deleteChatAction, options); + if (message.unarchiveChatsSetting != null && message.hasOwnProperty("unarchiveChatsSetting")) + object.unarchiveChatsSetting = $root.proto.UnarchiveChatsSetting.toObject(message.unarchiveChatsSetting, options); + if (message.primaryFeature != null && message.hasOwnProperty("primaryFeature")) + object.primaryFeature = $root.proto.PrimaryFeature.toObject(message.primaryFeature, options); + if (message.favoriteStickerAction != null && message.hasOwnProperty("favoriteStickerAction")) + object.favoriteStickerAction = $root.proto.FavoriteStickerAction.toObject(message.favoriteStickerAction, options); + if (message.androidUnsupportedActions != null && message.hasOwnProperty("androidUnsupportedActions")) + object.androidUnsupportedActions = $root.proto.AndroidUnsupportedActions.toObject(message.androidUnsupportedActions, options); return object; }; /** - * Converts this CallButton to JSON. + * Converts this SyncActionValue to JSON. * @function toJSON - * @memberof proto.CallButton + * @memberof proto.SyncActionValue * @instance * @returns {Object.} JSON object */ - CallButton.prototype.toJSON = function toJSON() { + SyncActionValue.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return CallButton; + return SyncActionValue; })(); - proto.TemplateButton = (function() { + proto.UnarchiveChatsSetting = (function() { /** - * Properties of a TemplateButton. + * Properties of an UnarchiveChatsSetting. * @memberof proto - * @interface ITemplateButton - * @property {number|null} [index] TemplateButton index - * @property {proto.IQuickReplyButton|null} [quickReplyButton] TemplateButton quickReplyButton - * @property {proto.IURLButton|null} [urlButton] TemplateButton urlButton - * @property {proto.ICallButton|null} [callButton] TemplateButton callButton + * @interface IUnarchiveChatsSetting + * @property {boolean|null} [unarchiveChats] UnarchiveChatsSetting unarchiveChats */ /** - * Constructs a new TemplateButton. + * Constructs a new UnarchiveChatsSetting. * @memberof proto - * @classdesc Represents a TemplateButton. - * @implements ITemplateButton + * @classdesc Represents an UnarchiveChatsSetting. + * @implements IUnarchiveChatsSetting * @constructor - * @param {proto.ITemplateButton=} [properties] Properties to set + * @param {proto.IUnarchiveChatsSetting=} [properties] Properties to set */ - function TemplateButton(properties) { + function UnarchiveChatsSetting(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -49914,128 +48341,75 @@ $root.proto = (function() { } /** - * TemplateButton index. - * @member {number} index - * @memberof proto.TemplateButton - * @instance - */ - TemplateButton.prototype.index = 0; - - /** - * TemplateButton quickReplyButton. - * @member {proto.IQuickReplyButton|null|undefined} quickReplyButton - * @memberof proto.TemplateButton - * @instance - */ - TemplateButton.prototype.quickReplyButton = null; - - /** - * TemplateButton urlButton. - * @member {proto.IURLButton|null|undefined} urlButton - * @memberof proto.TemplateButton - * @instance - */ - TemplateButton.prototype.urlButton = null; - - /** - * TemplateButton callButton. - * @member {proto.ICallButton|null|undefined} callButton - * @memberof proto.TemplateButton - * @instance - */ - TemplateButton.prototype.callButton = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * TemplateButton button. - * @member {"quickReplyButton"|"urlButton"|"callButton"|undefined} button - * @memberof proto.TemplateButton + * UnarchiveChatsSetting unarchiveChats. + * @member {boolean} unarchiveChats + * @memberof proto.UnarchiveChatsSetting * @instance */ - Object.defineProperty(TemplateButton.prototype, "button", { - get: $util.oneOfGetter($oneOfFields = ["quickReplyButton", "urlButton", "callButton"]), - set: $util.oneOfSetter($oneOfFields) - }); + UnarchiveChatsSetting.prototype.unarchiveChats = false; /** - * Creates a new TemplateButton instance using the specified properties. + * Creates a new UnarchiveChatsSetting instance using the specified properties. * @function create - * @memberof proto.TemplateButton + * @memberof proto.UnarchiveChatsSetting * @static - * @param {proto.ITemplateButton=} [properties] Properties to set - * @returns {proto.TemplateButton} TemplateButton instance + * @param {proto.IUnarchiveChatsSetting=} [properties] Properties to set + * @returns {proto.UnarchiveChatsSetting} UnarchiveChatsSetting instance */ - TemplateButton.create = function create(properties) { - return new TemplateButton(properties); + UnarchiveChatsSetting.create = function create(properties) { + return new UnarchiveChatsSetting(properties); }; /** - * Encodes the specified TemplateButton message. Does not implicitly {@link proto.TemplateButton.verify|verify} messages. + * Encodes the specified UnarchiveChatsSetting message. Does not implicitly {@link proto.UnarchiveChatsSetting.verify|verify} messages. * @function encode - * @memberof proto.TemplateButton + * @memberof proto.UnarchiveChatsSetting * @static - * @param {proto.ITemplateButton} message TemplateButton message or plain object to encode + * @param {proto.IUnarchiveChatsSetting} message UnarchiveChatsSetting message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - TemplateButton.encode = function encode(message, writer) { + UnarchiveChatsSetting.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.quickReplyButton != null && Object.hasOwnProperty.call(message, "quickReplyButton")) - $root.proto.QuickReplyButton.encode(message.quickReplyButton, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.urlButton != null && Object.hasOwnProperty.call(message, "urlButton")) - $root.proto.URLButton.encode(message.urlButton, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.callButton != null && Object.hasOwnProperty.call(message, "callButton")) - $root.proto.CallButton.encode(message.callButton, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.index != null && Object.hasOwnProperty.call(message, "index")) - writer.uint32(/* id 4, wireType 0 =*/32).uint32(message.index); + if (message.unarchiveChats != null && Object.hasOwnProperty.call(message, "unarchiveChats")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.unarchiveChats); return writer; }; /** - * Encodes the specified TemplateButton message, length delimited. Does not implicitly {@link proto.TemplateButton.verify|verify} messages. + * Encodes the specified UnarchiveChatsSetting message, length delimited. Does not implicitly {@link proto.UnarchiveChatsSetting.verify|verify} messages. * @function encodeDelimited - * @memberof proto.TemplateButton + * @memberof proto.UnarchiveChatsSetting * @static - * @param {proto.ITemplateButton} message TemplateButton message or plain object to encode + * @param {proto.IUnarchiveChatsSetting} message UnarchiveChatsSetting message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - TemplateButton.encodeDelimited = function encodeDelimited(message, writer) { + UnarchiveChatsSetting.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a TemplateButton message from the specified reader or buffer. + * Decodes an UnarchiveChatsSetting message from the specified reader or buffer. * @function decode - * @memberof proto.TemplateButton + * @memberof proto.UnarchiveChatsSetting * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {proto.TemplateButton} TemplateButton + * @returns {proto.UnarchiveChatsSetting} UnarchiveChatsSetting * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - TemplateButton.decode = function decode(reader, length) { + UnarchiveChatsSetting.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.TemplateButton(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.UnarchiveChatsSetting(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 4: - message.index = reader.uint32(); - break; case 1: - message.quickReplyButton = $root.proto.QuickReplyButton.decode(reader, reader.uint32()); - break; - case 2: - message.urlButton = $root.proto.URLButton.decode(reader, reader.uint32()); - break; - case 3: - message.callButton = $root.proto.CallButton.decode(reader, reader.uint32()); + message.unarchiveChats = reader.bool(); break; default: reader.skipType(tag & 7); @@ -50046,168 +48420,111 @@ $root.proto = (function() { }; /** - * Decodes a TemplateButton message from the specified reader or buffer, length delimited. + * Decodes an UnarchiveChatsSetting message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof proto.TemplateButton + * @memberof proto.UnarchiveChatsSetting * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.TemplateButton} TemplateButton + * @returns {proto.UnarchiveChatsSetting} UnarchiveChatsSetting * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - TemplateButton.decodeDelimited = function decodeDelimited(reader) { + UnarchiveChatsSetting.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a TemplateButton message. + * Verifies an UnarchiveChatsSetting message. * @function verify - * @memberof proto.TemplateButton + * @memberof proto.UnarchiveChatsSetting * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - TemplateButton.verify = function verify(message) { + UnarchiveChatsSetting.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - var properties = {}; - if (message.index != null && message.hasOwnProperty("index")) - if (!$util.isInteger(message.index)) - return "index: integer expected"; - if (message.quickReplyButton != null && message.hasOwnProperty("quickReplyButton")) { - properties.button = 1; - { - var error = $root.proto.QuickReplyButton.verify(message.quickReplyButton); - if (error) - return "quickReplyButton." + error; - } - } - if (message.urlButton != null && message.hasOwnProperty("urlButton")) { - if (properties.button === 1) - return "button: multiple values"; - properties.button = 1; - { - var error = $root.proto.URLButton.verify(message.urlButton); - if (error) - return "urlButton." + error; - } - } - if (message.callButton != null && message.hasOwnProperty("callButton")) { - if (properties.button === 1) - return "button: multiple values"; - properties.button = 1; - { - var error = $root.proto.CallButton.verify(message.callButton); - if (error) - return "callButton." + error; - } - } + if (message.unarchiveChats != null && message.hasOwnProperty("unarchiveChats")) + if (typeof message.unarchiveChats !== "boolean") + return "unarchiveChats: boolean expected"; return null; }; /** - * Creates a TemplateButton message from a plain object. Also converts values to their respective internal types. + * Creates an UnarchiveChatsSetting message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof proto.TemplateButton + * @memberof proto.UnarchiveChatsSetting * @static * @param {Object.} object Plain object - * @returns {proto.TemplateButton} TemplateButton + * @returns {proto.UnarchiveChatsSetting} UnarchiveChatsSetting */ - TemplateButton.fromObject = function fromObject(object) { - if (object instanceof $root.proto.TemplateButton) + UnarchiveChatsSetting.fromObject = function fromObject(object) { + if (object instanceof $root.proto.UnarchiveChatsSetting) return object; - var message = new $root.proto.TemplateButton(); - if (object.index != null) - message.index = object.index >>> 0; - if (object.quickReplyButton != null) { - if (typeof object.quickReplyButton !== "object") - throw TypeError(".proto.TemplateButton.quickReplyButton: object expected"); - message.quickReplyButton = $root.proto.QuickReplyButton.fromObject(object.quickReplyButton); - } - if (object.urlButton != null) { - if (typeof object.urlButton !== "object") - throw TypeError(".proto.TemplateButton.urlButton: object expected"); - message.urlButton = $root.proto.URLButton.fromObject(object.urlButton); - } - if (object.callButton != null) { - if (typeof object.callButton !== "object") - throw TypeError(".proto.TemplateButton.callButton: object expected"); - message.callButton = $root.proto.CallButton.fromObject(object.callButton); - } + var message = new $root.proto.UnarchiveChatsSetting(); + if (object.unarchiveChats != null) + message.unarchiveChats = Boolean(object.unarchiveChats); return message; }; /** - * Creates a plain object from a TemplateButton message. Also converts values to other types if specified. + * Creates a plain object from an UnarchiveChatsSetting message. Also converts values to other types if specified. * @function toObject - * @memberof proto.TemplateButton + * @memberof proto.UnarchiveChatsSetting * @static - * @param {proto.TemplateButton} message TemplateButton + * @param {proto.UnarchiveChatsSetting} message UnarchiveChatsSetting * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - TemplateButton.toObject = function toObject(message, options) { + UnarchiveChatsSetting.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) - object.index = 0; - if (message.quickReplyButton != null && message.hasOwnProperty("quickReplyButton")) { - object.quickReplyButton = $root.proto.QuickReplyButton.toObject(message.quickReplyButton, options); - if (options.oneofs) - object.button = "quickReplyButton"; - } - if (message.urlButton != null && message.hasOwnProperty("urlButton")) { - object.urlButton = $root.proto.URLButton.toObject(message.urlButton, options); - if (options.oneofs) - object.button = "urlButton"; - } - if (message.callButton != null && message.hasOwnProperty("callButton")) { - object.callButton = $root.proto.CallButton.toObject(message.callButton, options); - if (options.oneofs) - object.button = "callButton"; - } - if (message.index != null && message.hasOwnProperty("index")) - object.index = message.index; + object.unarchiveChats = false; + if (message.unarchiveChats != null && message.hasOwnProperty("unarchiveChats")) + object.unarchiveChats = message.unarchiveChats; return object; }; /** - * Converts this TemplateButton to JSON. + * Converts this UnarchiveChatsSetting to JSON. * @function toJSON - * @memberof proto.TemplateButton + * @memberof proto.UnarchiveChatsSetting * @instance * @returns {Object.} JSON object */ - TemplateButton.prototype.toJSON = function toJSON() { + UnarchiveChatsSetting.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return TemplateButton; + return UnarchiveChatsSetting; })(); - proto.Location = (function() { + proto.BizAccountLinkInfo = (function() { /** - * Properties of a Location. + * Properties of a BizAccountLinkInfo. * @memberof proto - * @interface ILocation - * @property {number|null} [degreesLatitude] Location degreesLatitude - * @property {number|null} [degreesLongitude] Location degreesLongitude - * @property {string|null} [name] Location name + * @interface IBizAccountLinkInfo + * @property {number|Long|null} [whatsappBizAcctFbid] BizAccountLinkInfo whatsappBizAcctFbid + * @property {string|null} [whatsappAcctNumber] BizAccountLinkInfo whatsappAcctNumber + * @property {number|Long|null} [issueTime] BizAccountLinkInfo issueTime + * @property {proto.BizAccountLinkInfo.BizAccountLinkInfoHostStorageType|null} [hostStorage] BizAccountLinkInfo hostStorage + * @property {proto.BizAccountLinkInfo.BizAccountLinkInfoAccountType|null} [accountType] BizAccountLinkInfo accountType */ /** - * Constructs a new Location. + * Constructs a new BizAccountLinkInfo. * @memberof proto - * @classdesc Represents a Location. - * @implements ILocation + * @classdesc Represents a BizAccountLinkInfo. + * @implements IBizAccountLinkInfo * @constructor - * @param {proto.ILocation=} [properties] Properties to set + * @param {proto.IBizAccountLinkInfo=} [properties] Properties to set */ - function Location(properties) { + function BizAccountLinkInfo(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -50215,101 +48532,127 @@ $root.proto = (function() { } /** - * Location degreesLatitude. - * @member {number} degreesLatitude - * @memberof proto.Location + * BizAccountLinkInfo whatsappBizAcctFbid. + * @member {number|Long} whatsappBizAcctFbid + * @memberof proto.BizAccountLinkInfo * @instance */ - Location.prototype.degreesLatitude = 0; + BizAccountLinkInfo.prototype.whatsappBizAcctFbid = $util.Long ? $util.Long.fromBits(0,0,true) : 0; /** - * Location degreesLongitude. - * @member {number} degreesLongitude - * @memberof proto.Location + * BizAccountLinkInfo whatsappAcctNumber. + * @member {string} whatsappAcctNumber + * @memberof proto.BizAccountLinkInfo * @instance */ - Location.prototype.degreesLongitude = 0; + BizAccountLinkInfo.prototype.whatsappAcctNumber = ""; /** - * Location name. - * @member {string} name - * @memberof proto.Location + * BizAccountLinkInfo issueTime. + * @member {number|Long} issueTime + * @memberof proto.BizAccountLinkInfo * @instance */ - Location.prototype.name = ""; + BizAccountLinkInfo.prototype.issueTime = $util.Long ? $util.Long.fromBits(0,0,true) : 0; /** - * Creates a new Location instance using the specified properties. - * @function create - * @memberof proto.Location - * @static - * @param {proto.ILocation=} [properties] Properties to set - * @returns {proto.Location} Location instance + * BizAccountLinkInfo hostStorage. + * @member {proto.BizAccountLinkInfo.BizAccountLinkInfoHostStorageType} hostStorage + * @memberof proto.BizAccountLinkInfo + * @instance */ - Location.create = function create(properties) { - return new Location(properties); - }; + BizAccountLinkInfo.prototype.hostStorage = 0; /** - * Encodes the specified Location message. Does not implicitly {@link proto.Location.verify|verify} messages. + * BizAccountLinkInfo accountType. + * @member {proto.BizAccountLinkInfo.BizAccountLinkInfoAccountType} accountType + * @memberof proto.BizAccountLinkInfo + * @instance + */ + BizAccountLinkInfo.prototype.accountType = 0; + + /** + * Creates a new BizAccountLinkInfo instance using the specified properties. + * @function create + * @memberof proto.BizAccountLinkInfo + * @static + * @param {proto.IBizAccountLinkInfo=} [properties] Properties to set + * @returns {proto.BizAccountLinkInfo} BizAccountLinkInfo instance + */ + BizAccountLinkInfo.create = function create(properties) { + return new BizAccountLinkInfo(properties); + }; + + /** + * Encodes the specified BizAccountLinkInfo message. Does not implicitly {@link proto.BizAccountLinkInfo.verify|verify} messages. * @function encode - * @memberof proto.Location + * @memberof proto.BizAccountLinkInfo * @static - * @param {proto.ILocation} message Location message or plain object to encode + * @param {proto.IBizAccountLinkInfo} message BizAccountLinkInfo message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Location.encode = function encode(message, writer) { + BizAccountLinkInfo.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.degreesLatitude != null && Object.hasOwnProperty.call(message, "degreesLatitude")) - writer.uint32(/* id 1, wireType 1 =*/9).double(message.degreesLatitude); - if (message.degreesLongitude != null && Object.hasOwnProperty.call(message, "degreesLongitude")) - writer.uint32(/* id 2, wireType 1 =*/17).double(message.degreesLongitude); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.name); + if (message.whatsappBizAcctFbid != null && Object.hasOwnProperty.call(message, "whatsappBizAcctFbid")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.whatsappBizAcctFbid); + if (message.whatsappAcctNumber != null && Object.hasOwnProperty.call(message, "whatsappAcctNumber")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.whatsappAcctNumber); + if (message.issueTime != null && Object.hasOwnProperty.call(message, "issueTime")) + writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.issueTime); + if (message.hostStorage != null && Object.hasOwnProperty.call(message, "hostStorage")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.hostStorage); + if (message.accountType != null && Object.hasOwnProperty.call(message, "accountType")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.accountType); return writer; }; /** - * Encodes the specified Location message, length delimited. Does not implicitly {@link proto.Location.verify|verify} messages. + * Encodes the specified BizAccountLinkInfo message, length delimited. Does not implicitly {@link proto.BizAccountLinkInfo.verify|verify} messages. * @function encodeDelimited - * @memberof proto.Location + * @memberof proto.BizAccountLinkInfo * @static - * @param {proto.ILocation} message Location message or plain object to encode + * @param {proto.IBizAccountLinkInfo} message BizAccountLinkInfo message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Location.encodeDelimited = function encodeDelimited(message, writer) { + BizAccountLinkInfo.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Location message from the specified reader or buffer. + * Decodes a BizAccountLinkInfo message from the specified reader or buffer. * @function decode - * @memberof proto.Location + * @memberof proto.BizAccountLinkInfo * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {proto.Location} Location + * @returns {proto.BizAccountLinkInfo} BizAccountLinkInfo * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Location.decode = function decode(reader, length) { + BizAccountLinkInfo.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.Location(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.BizAccountLinkInfo(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.degreesLatitude = reader.double(); + message.whatsappBizAcctFbid = reader.uint64(); break; case 2: - message.degreesLongitude = reader.double(); + message.whatsappAcctNumber = reader.string(); break; case 3: - message.name = reader.string(); + message.issueTime = reader.uint64(); + break; + case 4: + message.hostStorage = reader.int32(); + break; + case 5: + message.accountType = reader.int32(); break; default: reader.skipType(tag & 7); @@ -50320,127 +48663,216 @@ $root.proto = (function() { }; /** - * Decodes a Location message from the specified reader or buffer, length delimited. + * Decodes a BizAccountLinkInfo message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof proto.Location + * @memberof proto.BizAccountLinkInfo * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.Location} Location + * @returns {proto.BizAccountLinkInfo} BizAccountLinkInfo * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Location.decodeDelimited = function decodeDelimited(reader) { + BizAccountLinkInfo.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Location message. + * Verifies a BizAccountLinkInfo message. * @function verify - * @memberof proto.Location + * @memberof proto.BizAccountLinkInfo * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Location.verify = function verify(message) { + BizAccountLinkInfo.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.degreesLatitude != null && message.hasOwnProperty("degreesLatitude")) - if (typeof message.degreesLatitude !== "number") - return "degreesLatitude: number expected"; - if (message.degreesLongitude != null && message.hasOwnProperty("degreesLongitude")) - if (typeof message.degreesLongitude !== "number") - return "degreesLongitude: number expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; + if (message.whatsappBizAcctFbid != null && message.hasOwnProperty("whatsappBizAcctFbid")) + if (!$util.isInteger(message.whatsappBizAcctFbid) && !(message.whatsappBizAcctFbid && $util.isInteger(message.whatsappBizAcctFbid.low) && $util.isInteger(message.whatsappBizAcctFbid.high))) + return "whatsappBizAcctFbid: integer|Long expected"; + if (message.whatsappAcctNumber != null && message.hasOwnProperty("whatsappAcctNumber")) + if (!$util.isString(message.whatsappAcctNumber)) + return "whatsappAcctNumber: string expected"; + if (message.issueTime != null && message.hasOwnProperty("issueTime")) + if (!$util.isInteger(message.issueTime) && !(message.issueTime && $util.isInteger(message.issueTime.low) && $util.isInteger(message.issueTime.high))) + return "issueTime: integer|Long expected"; + if (message.hostStorage != null && message.hasOwnProperty("hostStorage")) + switch (message.hostStorage) { + default: + return "hostStorage: enum value expected"; + case 0: + case 1: + break; + } + if (message.accountType != null && message.hasOwnProperty("accountType")) + switch (message.accountType) { + default: + return "accountType: enum value expected"; + case 0: + break; + } return null; }; /** - * Creates a Location message from a plain object. Also converts values to their respective internal types. + * Creates a BizAccountLinkInfo message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof proto.Location + * @memberof proto.BizAccountLinkInfo * @static * @param {Object.} object Plain object - * @returns {proto.Location} Location + * @returns {proto.BizAccountLinkInfo} BizAccountLinkInfo */ - Location.fromObject = function fromObject(object) { - if (object instanceof $root.proto.Location) + BizAccountLinkInfo.fromObject = function fromObject(object) { + if (object instanceof $root.proto.BizAccountLinkInfo) return object; - var message = new $root.proto.Location(); - if (object.degreesLatitude != null) - message.degreesLatitude = Number(object.degreesLatitude); - if (object.degreesLongitude != null) - message.degreesLongitude = Number(object.degreesLongitude); - if (object.name != null) - message.name = String(object.name); + var message = new $root.proto.BizAccountLinkInfo(); + if (object.whatsappBizAcctFbid != null) + if ($util.Long) + (message.whatsappBizAcctFbid = $util.Long.fromValue(object.whatsappBizAcctFbid)).unsigned = true; + else if (typeof object.whatsappBizAcctFbid === "string") + message.whatsappBizAcctFbid = parseInt(object.whatsappBizAcctFbid, 10); + else if (typeof object.whatsappBizAcctFbid === "number") + message.whatsappBizAcctFbid = object.whatsappBizAcctFbid; + else if (typeof object.whatsappBizAcctFbid === "object") + message.whatsappBizAcctFbid = new $util.LongBits(object.whatsappBizAcctFbid.low >>> 0, object.whatsappBizAcctFbid.high >>> 0).toNumber(true); + if (object.whatsappAcctNumber != null) + message.whatsappAcctNumber = String(object.whatsappAcctNumber); + if (object.issueTime != null) + if ($util.Long) + (message.issueTime = $util.Long.fromValue(object.issueTime)).unsigned = true; + else if (typeof object.issueTime === "string") + message.issueTime = parseInt(object.issueTime, 10); + else if (typeof object.issueTime === "number") + message.issueTime = object.issueTime; + else if (typeof object.issueTime === "object") + message.issueTime = new $util.LongBits(object.issueTime.low >>> 0, object.issueTime.high >>> 0).toNumber(true); + switch (object.hostStorage) { + case "ON_PREMISE": + case 0: + message.hostStorage = 0; + break; + case "FACEBOOK": + case 1: + message.hostStorage = 1; + break; + } + switch (object.accountType) { + case "ENTERPRISE": + case 0: + message.accountType = 0; + break; + } return message; }; /** - * Creates a plain object from a Location message. Also converts values to other types if specified. + * Creates a plain object from a BizAccountLinkInfo message. Also converts values to other types if specified. * @function toObject - * @memberof proto.Location + * @memberof proto.BizAccountLinkInfo * @static - * @param {proto.Location} message Location + * @param {proto.BizAccountLinkInfo} message BizAccountLinkInfo * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Location.toObject = function toObject(message, options) { + BizAccountLinkInfo.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.degreesLatitude = 0; - object.degreesLongitude = 0; - object.name = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.whatsappBizAcctFbid = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.whatsappBizAcctFbid = options.longs === String ? "0" : 0; + object.whatsappAcctNumber = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.issueTime = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.issueTime = options.longs === String ? "0" : 0; + object.hostStorage = options.enums === String ? "ON_PREMISE" : 0; + object.accountType = options.enums === String ? "ENTERPRISE" : 0; } - if (message.degreesLatitude != null && message.hasOwnProperty("degreesLatitude")) - object.degreesLatitude = options.json && !isFinite(message.degreesLatitude) ? String(message.degreesLatitude) : message.degreesLatitude; - if (message.degreesLongitude != null && message.hasOwnProperty("degreesLongitude")) - object.degreesLongitude = options.json && !isFinite(message.degreesLongitude) ? String(message.degreesLongitude) : message.degreesLongitude; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; + if (message.whatsappBizAcctFbid != null && message.hasOwnProperty("whatsappBizAcctFbid")) + if (typeof message.whatsappBizAcctFbid === "number") + object.whatsappBizAcctFbid = options.longs === String ? String(message.whatsappBizAcctFbid) : message.whatsappBizAcctFbid; + else + object.whatsappBizAcctFbid = options.longs === String ? $util.Long.prototype.toString.call(message.whatsappBizAcctFbid) : options.longs === Number ? new $util.LongBits(message.whatsappBizAcctFbid.low >>> 0, message.whatsappBizAcctFbid.high >>> 0).toNumber(true) : message.whatsappBizAcctFbid; + if (message.whatsappAcctNumber != null && message.hasOwnProperty("whatsappAcctNumber")) + object.whatsappAcctNumber = message.whatsappAcctNumber; + if (message.issueTime != null && message.hasOwnProperty("issueTime")) + if (typeof message.issueTime === "number") + object.issueTime = options.longs === String ? String(message.issueTime) : message.issueTime; + else + object.issueTime = options.longs === String ? $util.Long.prototype.toString.call(message.issueTime) : options.longs === Number ? new $util.LongBits(message.issueTime.low >>> 0, message.issueTime.high >>> 0).toNumber(true) : message.issueTime; + if (message.hostStorage != null && message.hasOwnProperty("hostStorage")) + object.hostStorage = options.enums === String ? $root.proto.BizAccountLinkInfo.BizAccountLinkInfoHostStorageType[message.hostStorage] : message.hostStorage; + if (message.accountType != null && message.hasOwnProperty("accountType")) + object.accountType = options.enums === String ? $root.proto.BizAccountLinkInfo.BizAccountLinkInfoAccountType[message.accountType] : message.accountType; return object; }; /** - * Converts this Location to JSON. + * Converts this BizAccountLinkInfo to JSON. * @function toJSON - * @memberof proto.Location + * @memberof proto.BizAccountLinkInfo * @instance * @returns {Object.} JSON object */ - Location.prototype.toJSON = function toJSON() { + BizAccountLinkInfo.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return Location; + /** + * BizAccountLinkInfoHostStorageType enum. + * @name proto.BizAccountLinkInfo.BizAccountLinkInfoHostStorageType + * @enum {number} + * @property {number} ON_PREMISE=0 ON_PREMISE value + * @property {number} FACEBOOK=1 FACEBOOK value + */ + BizAccountLinkInfo.BizAccountLinkInfoHostStorageType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ON_PREMISE"] = 0; + values[valuesById[1] = "FACEBOOK"] = 1; + return values; + })(); + + /** + * BizAccountLinkInfoAccountType enum. + * @name proto.BizAccountLinkInfo.BizAccountLinkInfoAccountType + * @enum {number} + * @property {number} ENTERPRISE=0 ENTERPRISE value + */ + BizAccountLinkInfo.BizAccountLinkInfoAccountType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ENTERPRISE"] = 0; + return values; + })(); + + return BizAccountLinkInfo; })(); - proto.Point = (function() { + proto.BizAccountPayload = (function() { /** - * Properties of a Point. + * Properties of a BizAccountPayload. * @memberof proto - * @interface IPoint - * @property {number|null} [xDeprecated] Point xDeprecated - * @property {number|null} [yDeprecated] Point yDeprecated - * @property {number|null} [x] Point x - * @property {number|null} [y] Point y + * @interface IBizAccountPayload + * @property {proto.IVerifiedNameCertificate|null} [vnameCert] BizAccountPayload vnameCert + * @property {Uint8Array|null} [bizAcctLinkInfo] BizAccountPayload bizAcctLinkInfo */ /** - * Constructs a new Point. + * Constructs a new BizAccountPayload. * @memberof proto - * @classdesc Represents a Point. - * @implements IPoint + * @classdesc Represents a BizAccountPayload. + * @implements IBizAccountPayload * @constructor - * @param {proto.IPoint=} [properties] Properties to set + * @param {proto.IBizAccountPayload=} [properties] Properties to set */ - function Point(properties) { + function BizAccountPayload(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -50448,114 +48880,88 @@ $root.proto = (function() { } /** - * Point xDeprecated. - * @member {number} xDeprecated - * @memberof proto.Point - * @instance - */ - Point.prototype.xDeprecated = 0; - - /** - * Point yDeprecated. - * @member {number} yDeprecated - * @memberof proto.Point - * @instance - */ - Point.prototype.yDeprecated = 0; - - /** - * Point x. - * @member {number} x - * @memberof proto.Point + * BizAccountPayload vnameCert. + * @member {proto.IVerifiedNameCertificate|null|undefined} vnameCert + * @memberof proto.BizAccountPayload * @instance */ - Point.prototype.x = 0; + BizAccountPayload.prototype.vnameCert = null; /** - * Point y. - * @member {number} y - * @memberof proto.Point + * BizAccountPayload bizAcctLinkInfo. + * @member {Uint8Array} bizAcctLinkInfo + * @memberof proto.BizAccountPayload * @instance */ - Point.prototype.y = 0; + BizAccountPayload.prototype.bizAcctLinkInfo = $util.newBuffer([]); /** - * Creates a new Point instance using the specified properties. + * Creates a new BizAccountPayload instance using the specified properties. * @function create - * @memberof proto.Point + * @memberof proto.BizAccountPayload * @static - * @param {proto.IPoint=} [properties] Properties to set - * @returns {proto.Point} Point instance + * @param {proto.IBizAccountPayload=} [properties] Properties to set + * @returns {proto.BizAccountPayload} BizAccountPayload instance */ - Point.create = function create(properties) { - return new Point(properties); + BizAccountPayload.create = function create(properties) { + return new BizAccountPayload(properties); }; /** - * Encodes the specified Point message. Does not implicitly {@link proto.Point.verify|verify} messages. + * Encodes the specified BizAccountPayload message. Does not implicitly {@link proto.BizAccountPayload.verify|verify} messages. * @function encode - * @memberof proto.Point + * @memberof proto.BizAccountPayload * @static - * @param {proto.IPoint} message Point message or plain object to encode + * @param {proto.IBizAccountPayload} message BizAccountPayload message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Point.encode = function encode(message, writer) { + BizAccountPayload.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.xDeprecated != null && Object.hasOwnProperty.call(message, "xDeprecated")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.xDeprecated); - if (message.yDeprecated != null && Object.hasOwnProperty.call(message, "yDeprecated")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.yDeprecated); - if (message.x != null && Object.hasOwnProperty.call(message, "x")) - writer.uint32(/* id 3, wireType 1 =*/25).double(message.x); - if (message.y != null && Object.hasOwnProperty.call(message, "y")) - writer.uint32(/* id 4, wireType 1 =*/33).double(message.y); + if (message.vnameCert != null && Object.hasOwnProperty.call(message, "vnameCert")) + $root.proto.VerifiedNameCertificate.encode(message.vnameCert, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.bizAcctLinkInfo != null && Object.hasOwnProperty.call(message, "bizAcctLinkInfo")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.bizAcctLinkInfo); return writer; }; /** - * Encodes the specified Point message, length delimited. Does not implicitly {@link proto.Point.verify|verify} messages. + * Encodes the specified BizAccountPayload message, length delimited. Does not implicitly {@link proto.BizAccountPayload.verify|verify} messages. * @function encodeDelimited - * @memberof proto.Point + * @memberof proto.BizAccountPayload * @static - * @param {proto.IPoint} message Point message or plain object to encode + * @param {proto.IBizAccountPayload} message BizAccountPayload message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Point.encodeDelimited = function encodeDelimited(message, writer) { + BizAccountPayload.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Point message from the specified reader or buffer. + * Decodes a BizAccountPayload message from the specified reader or buffer. * @function decode - * @memberof proto.Point + * @memberof proto.BizAccountPayload * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {proto.Point} Point + * @returns {proto.BizAccountPayload} BizAccountPayload * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Point.decode = function decode(reader, length) { + BizAccountPayload.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.Point(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.BizAccountPayload(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.xDeprecated = reader.int32(); + message.vnameCert = $root.proto.VerifiedNameCertificate.decode(reader, reader.uint32()); break; case 2: - message.yDeprecated = reader.int32(); - break; - case 3: - message.x = reader.double(); - break; - case 4: - message.y = reader.double(); + message.bizAcctLinkInfo = reader.bytes(); break; default: reader.skipType(tag & 7); @@ -50566,135 +48972,137 @@ $root.proto = (function() { }; /** - * Decodes a Point message from the specified reader or buffer, length delimited. + * Decodes a BizAccountPayload message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof proto.Point + * @memberof proto.BizAccountPayload * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.Point} Point + * @returns {proto.BizAccountPayload} BizAccountPayload * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Point.decodeDelimited = function decodeDelimited(reader) { + BizAccountPayload.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Point message. + * Verifies a BizAccountPayload message. * @function verify - * @memberof proto.Point + * @memberof proto.BizAccountPayload * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Point.verify = function verify(message) { + BizAccountPayload.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.xDeprecated != null && message.hasOwnProperty("xDeprecated")) - if (!$util.isInteger(message.xDeprecated)) - return "xDeprecated: integer expected"; - if (message.yDeprecated != null && message.hasOwnProperty("yDeprecated")) - if (!$util.isInteger(message.yDeprecated)) - return "yDeprecated: integer expected"; - if (message.x != null && message.hasOwnProperty("x")) - if (typeof message.x !== "number") - return "x: number expected"; - if (message.y != null && message.hasOwnProperty("y")) - if (typeof message.y !== "number") - return "y: number expected"; + if (message.vnameCert != null && message.hasOwnProperty("vnameCert")) { + var error = $root.proto.VerifiedNameCertificate.verify(message.vnameCert); + if (error) + return "vnameCert." + error; + } + if (message.bizAcctLinkInfo != null && message.hasOwnProperty("bizAcctLinkInfo")) + if (!(message.bizAcctLinkInfo && typeof message.bizAcctLinkInfo.length === "number" || $util.isString(message.bizAcctLinkInfo))) + return "bizAcctLinkInfo: buffer expected"; return null; }; /** - * Creates a Point message from a plain object. Also converts values to their respective internal types. + * Creates a BizAccountPayload message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof proto.Point + * @memberof proto.BizAccountPayload * @static * @param {Object.} object Plain object - * @returns {proto.Point} Point + * @returns {proto.BizAccountPayload} BizAccountPayload */ - Point.fromObject = function fromObject(object) { - if (object instanceof $root.proto.Point) + BizAccountPayload.fromObject = function fromObject(object) { + if (object instanceof $root.proto.BizAccountPayload) return object; - var message = new $root.proto.Point(); - if (object.xDeprecated != null) - message.xDeprecated = object.xDeprecated | 0; - if (object.yDeprecated != null) - message.yDeprecated = object.yDeprecated | 0; - if (object.x != null) - message.x = Number(object.x); - if (object.y != null) - message.y = Number(object.y); + var message = new $root.proto.BizAccountPayload(); + if (object.vnameCert != null) { + if (typeof object.vnameCert !== "object") + throw TypeError(".proto.BizAccountPayload.vnameCert: object expected"); + message.vnameCert = $root.proto.VerifiedNameCertificate.fromObject(object.vnameCert); + } + if (object.bizAcctLinkInfo != null) + if (typeof object.bizAcctLinkInfo === "string") + $util.base64.decode(object.bizAcctLinkInfo, message.bizAcctLinkInfo = $util.newBuffer($util.base64.length(object.bizAcctLinkInfo)), 0); + else if (object.bizAcctLinkInfo.length) + message.bizAcctLinkInfo = object.bizAcctLinkInfo; return message; }; /** - * Creates a plain object from a Point message. Also converts values to other types if specified. + * Creates a plain object from a BizAccountPayload message. Also converts values to other types if specified. * @function toObject - * @memberof proto.Point + * @memberof proto.BizAccountPayload * @static - * @param {proto.Point} message Point + * @param {proto.BizAccountPayload} message BizAccountPayload * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Point.toObject = function toObject(message, options) { + BizAccountPayload.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.xDeprecated = 0; - object.yDeprecated = 0; - object.x = 0; - object.y = 0; + object.vnameCert = null; + if (options.bytes === String) + object.bizAcctLinkInfo = ""; + else { + object.bizAcctLinkInfo = []; + if (options.bytes !== Array) + object.bizAcctLinkInfo = $util.newBuffer(object.bizAcctLinkInfo); + } } - if (message.xDeprecated != null && message.hasOwnProperty("xDeprecated")) - object.xDeprecated = message.xDeprecated; - if (message.yDeprecated != null && message.hasOwnProperty("yDeprecated")) - object.yDeprecated = message.yDeprecated; - if (message.x != null && message.hasOwnProperty("x")) - object.x = options.json && !isFinite(message.x) ? String(message.x) : message.x; - if (message.y != null && message.hasOwnProperty("y")) - object.y = options.json && !isFinite(message.y) ? String(message.y) : message.y; + if (message.vnameCert != null && message.hasOwnProperty("vnameCert")) + object.vnameCert = $root.proto.VerifiedNameCertificate.toObject(message.vnameCert, options); + if (message.bizAcctLinkInfo != null && message.hasOwnProperty("bizAcctLinkInfo")) + object.bizAcctLinkInfo = options.bytes === String ? $util.base64.encode(message.bizAcctLinkInfo, 0, message.bizAcctLinkInfo.length) : options.bytes === Array ? Array.prototype.slice.call(message.bizAcctLinkInfo) : message.bizAcctLinkInfo; return object; }; /** - * Converts this Point to JSON. + * Converts this BizAccountPayload to JSON. * @function toJSON - * @memberof proto.Point + * @memberof proto.BizAccountPayload * @instance * @returns {Object.} JSON object */ - Point.prototype.toJSON = function toJSON() { + BizAccountPayload.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return Point; + return BizAccountPayload; })(); - proto.CompanionProps = (function() { + proto.BizIdentityInfo = (function() { /** - * Properties of a CompanionProps. + * Properties of a BizIdentityInfo. * @memberof proto - * @interface ICompanionProps - * @property {string|null} [os] CompanionProps os - * @property {proto.IAppVersion|null} [version] CompanionProps version - * @property {proto.CompanionProps.CompanionPropsPlatformType|null} [platformType] CompanionProps platformType - * @property {boolean|null} [requireFullSync] CompanionProps requireFullSync + * @interface IBizIdentityInfo + * @property {proto.BizIdentityInfo.BizIdentityInfoVerifiedLevelValue|null} [vlevel] BizIdentityInfo vlevel + * @property {proto.IVerifiedNameCertificate|null} [vnameCert] BizIdentityInfo vnameCert + * @property {boolean|null} [signed] BizIdentityInfo signed + * @property {boolean|null} [revoked] BizIdentityInfo revoked + * @property {proto.BizIdentityInfo.BizIdentityInfoHostStorageType|null} [hostStorage] BizIdentityInfo hostStorage + * @property {proto.BizIdentityInfo.BizIdentityInfoActualActorsType|null} [actualActors] BizIdentityInfo actualActors + * @property {number|Long|null} [privacyModeTs] BizIdentityInfo privacyModeTs + * @property {number|Long|null} [featureControls] BizIdentityInfo featureControls */ /** - * Constructs a new CompanionProps. + * Constructs a new BizIdentityInfo. * @memberof proto - * @classdesc Represents a CompanionProps. - * @implements ICompanionProps + * @classdesc Represents a BizIdentityInfo. + * @implements IBizIdentityInfo * @constructor - * @param {proto.ICompanionProps=} [properties] Properties to set + * @param {proto.IBizIdentityInfo=} [properties] Properties to set */ - function CompanionProps(properties) { + function BizIdentityInfo(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -50702,114 +49110,166 @@ $root.proto = (function() { } /** - * CompanionProps os. - * @member {string} os - * @memberof proto.CompanionProps + * BizIdentityInfo vlevel. + * @member {proto.BizIdentityInfo.BizIdentityInfoVerifiedLevelValue} vlevel + * @memberof proto.BizIdentityInfo * @instance */ - CompanionProps.prototype.os = ""; + BizIdentityInfo.prototype.vlevel = 0; /** - * CompanionProps version. - * @member {proto.IAppVersion|null|undefined} version - * @memberof proto.CompanionProps + * BizIdentityInfo vnameCert. + * @member {proto.IVerifiedNameCertificate|null|undefined} vnameCert + * @memberof proto.BizIdentityInfo * @instance */ - CompanionProps.prototype.version = null; + BizIdentityInfo.prototype.vnameCert = null; /** - * CompanionProps platformType. - * @member {proto.CompanionProps.CompanionPropsPlatformType} platformType - * @memberof proto.CompanionProps + * BizIdentityInfo signed. + * @member {boolean} signed + * @memberof proto.BizIdentityInfo * @instance */ - CompanionProps.prototype.platformType = 0; + BizIdentityInfo.prototype.signed = false; /** - * CompanionProps requireFullSync. - * @member {boolean} requireFullSync - * @memberof proto.CompanionProps + * BizIdentityInfo revoked. + * @member {boolean} revoked + * @memberof proto.BizIdentityInfo * @instance */ - CompanionProps.prototype.requireFullSync = false; + BizIdentityInfo.prototype.revoked = false; /** - * Creates a new CompanionProps instance using the specified properties. + * BizIdentityInfo hostStorage. + * @member {proto.BizIdentityInfo.BizIdentityInfoHostStorageType} hostStorage + * @memberof proto.BizIdentityInfo + * @instance + */ + BizIdentityInfo.prototype.hostStorage = 0; + + /** + * BizIdentityInfo actualActors. + * @member {proto.BizIdentityInfo.BizIdentityInfoActualActorsType} actualActors + * @memberof proto.BizIdentityInfo + * @instance + */ + BizIdentityInfo.prototype.actualActors = 0; + + /** + * BizIdentityInfo privacyModeTs. + * @member {number|Long} privacyModeTs + * @memberof proto.BizIdentityInfo + * @instance + */ + BizIdentityInfo.prototype.privacyModeTs = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * BizIdentityInfo featureControls. + * @member {number|Long} featureControls + * @memberof proto.BizIdentityInfo + * @instance + */ + BizIdentityInfo.prototype.featureControls = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new BizIdentityInfo instance using the specified properties. * @function create - * @memberof proto.CompanionProps + * @memberof proto.BizIdentityInfo * @static - * @param {proto.ICompanionProps=} [properties] Properties to set - * @returns {proto.CompanionProps} CompanionProps instance + * @param {proto.IBizIdentityInfo=} [properties] Properties to set + * @returns {proto.BizIdentityInfo} BizIdentityInfo instance */ - CompanionProps.create = function create(properties) { - return new CompanionProps(properties); + BizIdentityInfo.create = function create(properties) { + return new BizIdentityInfo(properties); }; /** - * Encodes the specified CompanionProps message. Does not implicitly {@link proto.CompanionProps.verify|verify} messages. + * Encodes the specified BizIdentityInfo message. Does not implicitly {@link proto.BizIdentityInfo.verify|verify} messages. * @function encode - * @memberof proto.CompanionProps + * @memberof proto.BizIdentityInfo * @static - * @param {proto.ICompanionProps} message CompanionProps message or plain object to encode + * @param {proto.IBizIdentityInfo} message BizIdentityInfo message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CompanionProps.encode = function encode(message, writer) { + BizIdentityInfo.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.os != null && Object.hasOwnProperty.call(message, "os")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.os); - if (message.version != null && Object.hasOwnProperty.call(message, "version")) - $root.proto.AppVersion.encode(message.version, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.platformType != null && Object.hasOwnProperty.call(message, "platformType")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.platformType); - if (message.requireFullSync != null && Object.hasOwnProperty.call(message, "requireFullSync")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.requireFullSync); + if (message.vlevel != null && Object.hasOwnProperty.call(message, "vlevel")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.vlevel); + if (message.vnameCert != null && Object.hasOwnProperty.call(message, "vnameCert")) + $root.proto.VerifiedNameCertificate.encode(message.vnameCert, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.signed != null && Object.hasOwnProperty.call(message, "signed")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.signed); + if (message.revoked != null && Object.hasOwnProperty.call(message, "revoked")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.revoked); + if (message.hostStorage != null && Object.hasOwnProperty.call(message, "hostStorage")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.hostStorage); + if (message.actualActors != null && Object.hasOwnProperty.call(message, "actualActors")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.actualActors); + if (message.privacyModeTs != null && Object.hasOwnProperty.call(message, "privacyModeTs")) + writer.uint32(/* id 7, wireType 0 =*/56).uint64(message.privacyModeTs); + if (message.featureControls != null && Object.hasOwnProperty.call(message, "featureControls")) + writer.uint32(/* id 8, wireType 0 =*/64).uint64(message.featureControls); return writer; }; /** - * Encodes the specified CompanionProps message, length delimited. Does not implicitly {@link proto.CompanionProps.verify|verify} messages. + * Encodes the specified BizIdentityInfo message, length delimited. Does not implicitly {@link proto.BizIdentityInfo.verify|verify} messages. * @function encodeDelimited - * @memberof proto.CompanionProps + * @memberof proto.BizIdentityInfo * @static - * @param {proto.ICompanionProps} message CompanionProps message or plain object to encode + * @param {proto.IBizIdentityInfo} message BizIdentityInfo message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CompanionProps.encodeDelimited = function encodeDelimited(message, writer) { + BizIdentityInfo.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a CompanionProps message from the specified reader or buffer. + * Decodes a BizIdentityInfo message from the specified reader or buffer. * @function decode - * @memberof proto.CompanionProps + * @memberof proto.BizIdentityInfo * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {proto.CompanionProps} CompanionProps + * @returns {proto.BizIdentityInfo} BizIdentityInfo * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CompanionProps.decode = function decode(reader, length) { + BizIdentityInfo.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.CompanionProps(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.BizIdentityInfo(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.os = reader.string(); + message.vlevel = reader.int32(); break; case 2: - message.version = $root.proto.AppVersion.decode(reader, reader.uint32()); + message.vnameCert = $root.proto.VerifiedNameCertificate.decode(reader, reader.uint32()); break; case 3: - message.platformType = reader.int32(); + message.signed = reader.bool(); break; case 4: - message.requireFullSync = reader.bool(); + message.revoked = reader.bool(); + break; + case 5: + message.hostStorage = reader.int32(); + break; + case 6: + message.actualActors = reader.int32(); + break; + case 7: + message.privacyModeTs = reader.uint64(); + break; + case 8: + message.featureControls = reader.uint64(); break; default: reader.skipType(tag & 7); @@ -50820,242 +49280,287 @@ $root.proto = (function() { }; /** - * Decodes a CompanionProps message from the specified reader or buffer, length delimited. + * Decodes a BizIdentityInfo message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof proto.CompanionProps + * @memberof proto.BizIdentityInfo * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.CompanionProps} CompanionProps + * @returns {proto.BizIdentityInfo} BizIdentityInfo * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CompanionProps.decodeDelimited = function decodeDelimited(reader) { + BizIdentityInfo.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a CompanionProps message. + * Verifies a BizIdentityInfo message. * @function verify - * @memberof proto.CompanionProps + * @memberof proto.BizIdentityInfo * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - CompanionProps.verify = function verify(message) { + BizIdentityInfo.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.os != null && message.hasOwnProperty("os")) - if (!$util.isString(message.os)) - return "os: string expected"; - if (message.version != null && message.hasOwnProperty("version")) { - var error = $root.proto.AppVersion.verify(message.version); + if (message.vlevel != null && message.hasOwnProperty("vlevel")) + switch (message.vlevel) { + default: + return "vlevel: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.vnameCert != null && message.hasOwnProperty("vnameCert")) { + var error = $root.proto.VerifiedNameCertificate.verify(message.vnameCert); if (error) - return "version." + error; + return "vnameCert." + error; } - if (message.platformType != null && message.hasOwnProperty("platformType")) - switch (message.platformType) { + if (message.signed != null && message.hasOwnProperty("signed")) + if (typeof message.signed !== "boolean") + return "signed: boolean expected"; + if (message.revoked != null && message.hasOwnProperty("revoked")) + if (typeof message.revoked !== "boolean") + return "revoked: boolean expected"; + if (message.hostStorage != null && message.hasOwnProperty("hostStorage")) + switch (message.hostStorage) { default: - return "platformType: enum value expected"; + return "hostStorage: enum value expected"; case 0: case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - case 8: - case 9: - case 10: - case 11: - case 12: break; } - if (message.requireFullSync != null && message.hasOwnProperty("requireFullSync")) - if (typeof message.requireFullSync !== "boolean") - return "requireFullSync: boolean expected"; + if (message.actualActors != null && message.hasOwnProperty("actualActors")) + switch (message.actualActors) { + default: + return "actualActors: enum value expected"; + case 0: + case 1: + break; + } + if (message.privacyModeTs != null && message.hasOwnProperty("privacyModeTs")) + if (!$util.isInteger(message.privacyModeTs) && !(message.privacyModeTs && $util.isInteger(message.privacyModeTs.low) && $util.isInteger(message.privacyModeTs.high))) + return "privacyModeTs: integer|Long expected"; + if (message.featureControls != null && message.hasOwnProperty("featureControls")) + if (!$util.isInteger(message.featureControls) && !(message.featureControls && $util.isInteger(message.featureControls.low) && $util.isInteger(message.featureControls.high))) + return "featureControls: integer|Long expected"; return null; }; /** - * Creates a CompanionProps message from a plain object. Also converts values to their respective internal types. + * Creates a BizIdentityInfo message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof proto.CompanionProps + * @memberof proto.BizIdentityInfo * @static * @param {Object.} object Plain object - * @returns {proto.CompanionProps} CompanionProps + * @returns {proto.BizIdentityInfo} BizIdentityInfo */ - CompanionProps.fromObject = function fromObject(object) { - if (object instanceof $root.proto.CompanionProps) + BizIdentityInfo.fromObject = function fromObject(object) { + if (object instanceof $root.proto.BizIdentityInfo) return object; - var message = new $root.proto.CompanionProps(); - if (object.os != null) - message.os = String(object.os); - if (object.version != null) { - if (typeof object.version !== "object") - throw TypeError(".proto.CompanionProps.version: object expected"); - message.version = $root.proto.AppVersion.fromObject(object.version); - } - switch (object.platformType) { + var message = new $root.proto.BizIdentityInfo(); + switch (object.vlevel) { case "UNKNOWN": case 0: - message.platformType = 0; + message.vlevel = 0; break; - case "CHROME": + case "LOW": case 1: - message.platformType = 1; + message.vlevel = 1; break; - case "FIREFOX": + case "HIGH": case 2: - message.platformType = 2; - break; - case "IE": - case 3: - message.platformType = 3; - break; - case "OPERA": - case 4: - message.platformType = 4; - break; - case "SAFARI": - case 5: - message.platformType = 5; - break; - case "EDGE": - case 6: - message.platformType = 6; - break; - case "DESKTOP": - case 7: - message.platformType = 7; - break; - case "IPAD": - case 8: - message.platformType = 8; + message.vlevel = 2; break; - case "ANDROID_TABLET": - case 9: - message.platformType = 9; + } + if (object.vnameCert != null) { + if (typeof object.vnameCert !== "object") + throw TypeError(".proto.BizIdentityInfo.vnameCert: object expected"); + message.vnameCert = $root.proto.VerifiedNameCertificate.fromObject(object.vnameCert); + } + if (object.signed != null) + message.signed = Boolean(object.signed); + if (object.revoked != null) + message.revoked = Boolean(object.revoked); + switch (object.hostStorage) { + case "ON_PREMISE": + case 0: + message.hostStorage = 0; break; - case "OHANA": - case 10: - message.platformType = 10; + case "FACEBOOK": + case 1: + message.hostStorage = 1; break; - case "ALOHA": - case 11: - message.platformType = 11; + } + switch (object.actualActors) { + case "SELF": + case 0: + message.actualActors = 0; break; - case "CATALINA": - case 12: - message.platformType = 12; + case "BSP": + case 1: + message.actualActors = 1; break; } - if (object.requireFullSync != null) - message.requireFullSync = Boolean(object.requireFullSync); + if (object.privacyModeTs != null) + if ($util.Long) + (message.privacyModeTs = $util.Long.fromValue(object.privacyModeTs)).unsigned = true; + else if (typeof object.privacyModeTs === "string") + message.privacyModeTs = parseInt(object.privacyModeTs, 10); + else if (typeof object.privacyModeTs === "number") + message.privacyModeTs = object.privacyModeTs; + else if (typeof object.privacyModeTs === "object") + message.privacyModeTs = new $util.LongBits(object.privacyModeTs.low >>> 0, object.privacyModeTs.high >>> 0).toNumber(true); + if (object.featureControls != null) + if ($util.Long) + (message.featureControls = $util.Long.fromValue(object.featureControls)).unsigned = true; + else if (typeof object.featureControls === "string") + message.featureControls = parseInt(object.featureControls, 10); + else if (typeof object.featureControls === "number") + message.featureControls = object.featureControls; + else if (typeof object.featureControls === "object") + message.featureControls = new $util.LongBits(object.featureControls.low >>> 0, object.featureControls.high >>> 0).toNumber(true); return message; }; /** - * Creates a plain object from a CompanionProps message. Also converts values to other types if specified. + * Creates a plain object from a BizIdentityInfo message. Also converts values to other types if specified. * @function toObject - * @memberof proto.CompanionProps + * @memberof proto.BizIdentityInfo * @static - * @param {proto.CompanionProps} message CompanionProps + * @param {proto.BizIdentityInfo} message BizIdentityInfo * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CompanionProps.toObject = function toObject(message, options) { + BizIdentityInfo.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.os = ""; - object.version = null; - object.platformType = options.enums === String ? "UNKNOWN" : 0; - object.requireFullSync = false; + object.vlevel = options.enums === String ? "UNKNOWN" : 0; + object.vnameCert = null; + object.signed = false; + object.revoked = false; + object.hostStorage = options.enums === String ? "ON_PREMISE" : 0; + object.actualActors = options.enums === String ? "SELF" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.privacyModeTs = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.privacyModeTs = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.featureControls = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.featureControls = options.longs === String ? "0" : 0; } - if (message.os != null && message.hasOwnProperty("os")) - object.os = message.os; - if (message.version != null && message.hasOwnProperty("version")) - object.version = $root.proto.AppVersion.toObject(message.version, options); - if (message.platformType != null && message.hasOwnProperty("platformType")) - object.platformType = options.enums === String ? $root.proto.CompanionProps.CompanionPropsPlatformType[message.platformType] : message.platformType; - if (message.requireFullSync != null && message.hasOwnProperty("requireFullSync")) - object.requireFullSync = message.requireFullSync; + if (message.vlevel != null && message.hasOwnProperty("vlevel")) + object.vlevel = options.enums === String ? $root.proto.BizIdentityInfo.BizIdentityInfoVerifiedLevelValue[message.vlevel] : message.vlevel; + if (message.vnameCert != null && message.hasOwnProperty("vnameCert")) + object.vnameCert = $root.proto.VerifiedNameCertificate.toObject(message.vnameCert, options); + if (message.signed != null && message.hasOwnProperty("signed")) + object.signed = message.signed; + if (message.revoked != null && message.hasOwnProperty("revoked")) + object.revoked = message.revoked; + if (message.hostStorage != null && message.hasOwnProperty("hostStorage")) + object.hostStorage = options.enums === String ? $root.proto.BizIdentityInfo.BizIdentityInfoHostStorageType[message.hostStorage] : message.hostStorage; + if (message.actualActors != null && message.hasOwnProperty("actualActors")) + object.actualActors = options.enums === String ? $root.proto.BizIdentityInfo.BizIdentityInfoActualActorsType[message.actualActors] : message.actualActors; + if (message.privacyModeTs != null && message.hasOwnProperty("privacyModeTs")) + if (typeof message.privacyModeTs === "number") + object.privacyModeTs = options.longs === String ? String(message.privacyModeTs) : message.privacyModeTs; + else + object.privacyModeTs = options.longs === String ? $util.Long.prototype.toString.call(message.privacyModeTs) : options.longs === Number ? new $util.LongBits(message.privacyModeTs.low >>> 0, message.privacyModeTs.high >>> 0).toNumber(true) : message.privacyModeTs; + if (message.featureControls != null && message.hasOwnProperty("featureControls")) + if (typeof message.featureControls === "number") + object.featureControls = options.longs === String ? String(message.featureControls) : message.featureControls; + else + object.featureControls = options.longs === String ? $util.Long.prototype.toString.call(message.featureControls) : options.longs === Number ? new $util.LongBits(message.featureControls.low >>> 0, message.featureControls.high >>> 0).toNumber(true) : message.featureControls; return object; }; /** - * Converts this CompanionProps to JSON. + * Converts this BizIdentityInfo to JSON. * @function toJSON - * @memberof proto.CompanionProps + * @memberof proto.BizIdentityInfo * @instance * @returns {Object.} JSON object */ - CompanionProps.prototype.toJSON = function toJSON() { + BizIdentityInfo.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * CompanionPropsPlatformType enum. - * @name proto.CompanionProps.CompanionPropsPlatformType + * BizIdentityInfoVerifiedLevelValue enum. + * @name proto.BizIdentityInfo.BizIdentityInfoVerifiedLevelValue * @enum {number} * @property {number} UNKNOWN=0 UNKNOWN value - * @property {number} CHROME=1 CHROME value - * @property {number} FIREFOX=2 FIREFOX value - * @property {number} IE=3 IE value - * @property {number} OPERA=4 OPERA value - * @property {number} SAFARI=5 SAFARI value - * @property {number} EDGE=6 EDGE value - * @property {number} DESKTOP=7 DESKTOP value - * @property {number} IPAD=8 IPAD value - * @property {number} ANDROID_TABLET=9 ANDROID_TABLET value - * @property {number} OHANA=10 OHANA value - * @property {number} ALOHA=11 ALOHA value - * @property {number} CATALINA=12 CATALINA value + * @property {number} LOW=1 LOW value + * @property {number} HIGH=2 HIGH value */ - CompanionProps.CompanionPropsPlatformType = (function() { + BizIdentityInfo.BizIdentityInfoVerifiedLevelValue = (function() { var valuesById = {}, values = Object.create(valuesById); values[valuesById[0] = "UNKNOWN"] = 0; - values[valuesById[1] = "CHROME"] = 1; - values[valuesById[2] = "FIREFOX"] = 2; - values[valuesById[3] = "IE"] = 3; - values[valuesById[4] = "OPERA"] = 4; - values[valuesById[5] = "SAFARI"] = 5; - values[valuesById[6] = "EDGE"] = 6; - values[valuesById[7] = "DESKTOP"] = 7; - values[valuesById[8] = "IPAD"] = 8; - values[valuesById[9] = "ANDROID_TABLET"] = 9; - values[valuesById[10] = "OHANA"] = 10; - values[valuesById[11] = "ALOHA"] = 11; - values[valuesById[12] = "CATALINA"] = 12; + values[valuesById[1] = "LOW"] = 1; + values[valuesById[2] = "HIGH"] = 2; return values; })(); - return CompanionProps; + /** + * BizIdentityInfoHostStorageType enum. + * @name proto.BizIdentityInfo.BizIdentityInfoHostStorageType + * @enum {number} + * @property {number} ON_PREMISE=0 ON_PREMISE value + * @property {number} FACEBOOK=1 FACEBOOK value + */ + BizIdentityInfo.BizIdentityInfoHostStorageType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ON_PREMISE"] = 0; + values[valuesById[1] = "FACEBOOK"] = 1; + return values; + })(); + + /** + * BizIdentityInfoActualActorsType enum. + * @name proto.BizIdentityInfo.BizIdentityInfoActualActorsType + * @enum {number} + * @property {number} SELF=0 SELF value + * @property {number} BSP=1 BSP value + */ + BizIdentityInfo.BizIdentityInfoActualActorsType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SELF"] = 0; + values[valuesById[1] = "BSP"] = 1; + return values; + })(); + + return BizIdentityInfo; })(); - proto.ADVSignedDeviceIdentityHMAC = (function() { + proto.LocalizedName = (function() { /** - * Properties of a ADVSignedDeviceIdentityHMAC. + * Properties of a LocalizedName. * @memberof proto - * @interface IADVSignedDeviceIdentityHMAC - * @property {Uint8Array|null} [details] ADVSignedDeviceIdentityHMAC details - * @property {Uint8Array|null} [hmac] ADVSignedDeviceIdentityHMAC hmac + * @interface ILocalizedName + * @property {string|null} [lg] LocalizedName lg + * @property {string|null} [lc] LocalizedName lc + * @property {string|null} [verifiedName] LocalizedName verifiedName */ /** - * Constructs a new ADVSignedDeviceIdentityHMAC. + * Constructs a new LocalizedName. * @memberof proto - * @classdesc Represents a ADVSignedDeviceIdentityHMAC. - * @implements IADVSignedDeviceIdentityHMAC + * @classdesc Represents a LocalizedName. + * @implements ILocalizedName * @constructor - * @param {proto.IADVSignedDeviceIdentityHMAC=} [properties] Properties to set + * @param {proto.ILocalizedName=} [properties] Properties to set */ - function ADVSignedDeviceIdentityHMAC(properties) { + function LocalizedName(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -51063,88 +49568,101 @@ $root.proto = (function() { } /** - * ADVSignedDeviceIdentityHMAC details. - * @member {Uint8Array} details - * @memberof proto.ADVSignedDeviceIdentityHMAC + * LocalizedName lg. + * @member {string} lg + * @memberof proto.LocalizedName * @instance */ - ADVSignedDeviceIdentityHMAC.prototype.details = $util.newBuffer([]); + LocalizedName.prototype.lg = ""; /** - * ADVSignedDeviceIdentityHMAC hmac. - * @member {Uint8Array} hmac - * @memberof proto.ADVSignedDeviceIdentityHMAC + * LocalizedName lc. + * @member {string} lc + * @memberof proto.LocalizedName * @instance */ - ADVSignedDeviceIdentityHMAC.prototype.hmac = $util.newBuffer([]); + LocalizedName.prototype.lc = ""; /** - * Creates a new ADVSignedDeviceIdentityHMAC instance using the specified properties. + * LocalizedName verifiedName. + * @member {string} verifiedName + * @memberof proto.LocalizedName + * @instance + */ + LocalizedName.prototype.verifiedName = ""; + + /** + * Creates a new LocalizedName instance using the specified properties. * @function create - * @memberof proto.ADVSignedDeviceIdentityHMAC + * @memberof proto.LocalizedName * @static - * @param {proto.IADVSignedDeviceIdentityHMAC=} [properties] Properties to set - * @returns {proto.ADVSignedDeviceIdentityHMAC} ADVSignedDeviceIdentityHMAC instance + * @param {proto.ILocalizedName=} [properties] Properties to set + * @returns {proto.LocalizedName} LocalizedName instance */ - ADVSignedDeviceIdentityHMAC.create = function create(properties) { - return new ADVSignedDeviceIdentityHMAC(properties); + LocalizedName.create = function create(properties) { + return new LocalizedName(properties); }; /** - * Encodes the specified ADVSignedDeviceIdentityHMAC message. Does not implicitly {@link proto.ADVSignedDeviceIdentityHMAC.verify|verify} messages. + * Encodes the specified LocalizedName message. Does not implicitly {@link proto.LocalizedName.verify|verify} messages. * @function encode - * @memberof proto.ADVSignedDeviceIdentityHMAC + * @memberof proto.LocalizedName * @static - * @param {proto.IADVSignedDeviceIdentityHMAC} message ADVSignedDeviceIdentityHMAC message or plain object to encode + * @param {proto.ILocalizedName} message LocalizedName message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ADVSignedDeviceIdentityHMAC.encode = function encode(message, writer) { + LocalizedName.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.details != null && Object.hasOwnProperty.call(message, "details")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.details); - if (message.hmac != null && Object.hasOwnProperty.call(message, "hmac")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.hmac); + if (message.lg != null && Object.hasOwnProperty.call(message, "lg")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.lg); + if (message.lc != null && Object.hasOwnProperty.call(message, "lc")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.lc); + if (message.verifiedName != null && Object.hasOwnProperty.call(message, "verifiedName")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.verifiedName); return writer; }; /** - * Encodes the specified ADVSignedDeviceIdentityHMAC message, length delimited. Does not implicitly {@link proto.ADVSignedDeviceIdentityHMAC.verify|verify} messages. + * Encodes the specified LocalizedName message, length delimited. Does not implicitly {@link proto.LocalizedName.verify|verify} messages. * @function encodeDelimited - * @memberof proto.ADVSignedDeviceIdentityHMAC + * @memberof proto.LocalizedName * @static - * @param {proto.IADVSignedDeviceIdentityHMAC} message ADVSignedDeviceIdentityHMAC message or plain object to encode + * @param {proto.ILocalizedName} message LocalizedName message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ADVSignedDeviceIdentityHMAC.encodeDelimited = function encodeDelimited(message, writer) { + LocalizedName.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ADVSignedDeviceIdentityHMAC message from the specified reader or buffer. + * Decodes a LocalizedName message from the specified reader or buffer. * @function decode - * @memberof proto.ADVSignedDeviceIdentityHMAC + * @memberof proto.LocalizedName * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {proto.ADVSignedDeviceIdentityHMAC} ADVSignedDeviceIdentityHMAC + * @returns {proto.LocalizedName} LocalizedName * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ADVSignedDeviceIdentityHMAC.decode = function decode(reader, length) { + LocalizedName.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.ADVSignedDeviceIdentityHMAC(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.LocalizedName(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.details = reader.bytes(); + message.lg = reader.string(); break; case 2: - message.hmac = reader.bytes(); + message.lc = reader.string(); + break; + case 3: + message.verifiedName = reader.string(); break; default: reader.skipType(tag & 7); @@ -51155,137 +49673,126 @@ $root.proto = (function() { }; /** - * Decodes a ADVSignedDeviceIdentityHMAC message from the specified reader or buffer, length delimited. + * Decodes a LocalizedName message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof proto.ADVSignedDeviceIdentityHMAC + * @memberof proto.LocalizedName * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.ADVSignedDeviceIdentityHMAC} ADVSignedDeviceIdentityHMAC + * @returns {proto.LocalizedName} LocalizedName * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ADVSignedDeviceIdentityHMAC.decodeDelimited = function decodeDelimited(reader) { + LocalizedName.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ADVSignedDeviceIdentityHMAC message. + * Verifies a LocalizedName message. * @function verify - * @memberof proto.ADVSignedDeviceIdentityHMAC + * @memberof proto.LocalizedName * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ADVSignedDeviceIdentityHMAC.verify = function verify(message) { + LocalizedName.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.details != null && message.hasOwnProperty("details")) - if (!(message.details && typeof message.details.length === "number" || $util.isString(message.details))) - return "details: buffer expected"; - if (message.hmac != null && message.hasOwnProperty("hmac")) - if (!(message.hmac && typeof message.hmac.length === "number" || $util.isString(message.hmac))) - return "hmac: buffer expected"; + if (message.lg != null && message.hasOwnProperty("lg")) + if (!$util.isString(message.lg)) + return "lg: string expected"; + if (message.lc != null && message.hasOwnProperty("lc")) + if (!$util.isString(message.lc)) + return "lc: string expected"; + if (message.verifiedName != null && message.hasOwnProperty("verifiedName")) + if (!$util.isString(message.verifiedName)) + return "verifiedName: string expected"; return null; }; /** - * Creates a ADVSignedDeviceIdentityHMAC message from a plain object. Also converts values to their respective internal types. + * Creates a LocalizedName message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof proto.ADVSignedDeviceIdentityHMAC + * @memberof proto.LocalizedName * @static * @param {Object.} object Plain object - * @returns {proto.ADVSignedDeviceIdentityHMAC} ADVSignedDeviceIdentityHMAC + * @returns {proto.LocalizedName} LocalizedName */ - ADVSignedDeviceIdentityHMAC.fromObject = function fromObject(object) { - if (object instanceof $root.proto.ADVSignedDeviceIdentityHMAC) + LocalizedName.fromObject = function fromObject(object) { + if (object instanceof $root.proto.LocalizedName) return object; - var message = new $root.proto.ADVSignedDeviceIdentityHMAC(); - if (object.details != null) - if (typeof object.details === "string") - $util.base64.decode(object.details, message.details = $util.newBuffer($util.base64.length(object.details)), 0); - else if (object.details.length) - message.details = object.details; - if (object.hmac != null) - if (typeof object.hmac === "string") - $util.base64.decode(object.hmac, message.hmac = $util.newBuffer($util.base64.length(object.hmac)), 0); - else if (object.hmac.length) - message.hmac = object.hmac; + var message = new $root.proto.LocalizedName(); + if (object.lg != null) + message.lg = String(object.lg); + if (object.lc != null) + message.lc = String(object.lc); + if (object.verifiedName != null) + message.verifiedName = String(object.verifiedName); return message; }; /** - * Creates a plain object from a ADVSignedDeviceIdentityHMAC message. Also converts values to other types if specified. + * Creates a plain object from a LocalizedName message. Also converts values to other types if specified. * @function toObject - * @memberof proto.ADVSignedDeviceIdentityHMAC + * @memberof proto.LocalizedName * @static - * @param {proto.ADVSignedDeviceIdentityHMAC} message ADVSignedDeviceIdentityHMAC + * @param {proto.LocalizedName} message LocalizedName * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ADVSignedDeviceIdentityHMAC.toObject = function toObject(message, options) { + LocalizedName.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - if (options.bytes === String) - object.details = ""; - else { - object.details = []; - if (options.bytes !== Array) - object.details = $util.newBuffer(object.details); - } - if (options.bytes === String) - object.hmac = ""; - else { - object.hmac = []; - if (options.bytes !== Array) - object.hmac = $util.newBuffer(object.hmac); - } + object.lg = ""; + object.lc = ""; + object.verifiedName = ""; } - if (message.details != null && message.hasOwnProperty("details")) - object.details = options.bytes === String ? $util.base64.encode(message.details, 0, message.details.length) : options.bytes === Array ? Array.prototype.slice.call(message.details) : message.details; - if (message.hmac != null && message.hasOwnProperty("hmac")) - object.hmac = options.bytes === String ? $util.base64.encode(message.hmac, 0, message.hmac.length) : options.bytes === Array ? Array.prototype.slice.call(message.hmac) : message.hmac; + if (message.lg != null && message.hasOwnProperty("lg")) + object.lg = message.lg; + if (message.lc != null && message.hasOwnProperty("lc")) + object.lc = message.lc; + if (message.verifiedName != null && message.hasOwnProperty("verifiedName")) + object.verifiedName = message.verifiedName; return object; }; /** - * Converts this ADVSignedDeviceIdentityHMAC to JSON. + * Converts this LocalizedName to JSON. * @function toJSON - * @memberof proto.ADVSignedDeviceIdentityHMAC + * @memberof proto.LocalizedName * @instance * @returns {Object.} JSON object */ - ADVSignedDeviceIdentityHMAC.prototype.toJSON = function toJSON() { + LocalizedName.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ADVSignedDeviceIdentityHMAC; + return LocalizedName; })(); - proto.ADVSignedDeviceIdentity = (function() { + proto.VerifiedNameCertificate = (function() { /** - * Properties of a ADVSignedDeviceIdentity. + * Properties of a VerifiedNameCertificate. * @memberof proto - * @interface IADVSignedDeviceIdentity - * @property {Uint8Array|null} [details] ADVSignedDeviceIdentity details - * @property {Uint8Array|null} [accountSignatureKey] ADVSignedDeviceIdentity accountSignatureKey - * @property {Uint8Array|null} [accountSignature] ADVSignedDeviceIdentity accountSignature - * @property {Uint8Array|null} [deviceSignature] ADVSignedDeviceIdentity deviceSignature + * @interface IVerifiedNameCertificate + * @property {Uint8Array|null} [details] VerifiedNameCertificate details + * @property {Uint8Array|null} [signature] VerifiedNameCertificate signature + * @property {Uint8Array|null} [serverSignature] VerifiedNameCertificate serverSignature */ /** - * Constructs a new ADVSignedDeviceIdentity. + * Constructs a new VerifiedNameCertificate. * @memberof proto - * @classdesc Represents a ADVSignedDeviceIdentity. - * @implements IADVSignedDeviceIdentity + * @classdesc Represents a VerifiedNameCertificate. + * @implements IVerifiedNameCertificate * @constructor - * @param {proto.IADVSignedDeviceIdentity=} [properties] Properties to set + * @param {proto.IVerifiedNameCertificate=} [properties] Properties to set */ - function ADVSignedDeviceIdentity(properties) { + function VerifiedNameCertificate(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -51293,100 +49800,90 @@ $root.proto = (function() { } /** - * ADVSignedDeviceIdentity details. + * VerifiedNameCertificate details. * @member {Uint8Array} details - * @memberof proto.ADVSignedDeviceIdentity - * @instance - */ - ADVSignedDeviceIdentity.prototype.details = $util.newBuffer([]); - - /** - * ADVSignedDeviceIdentity accountSignatureKey. - * @member {Uint8Array} accountSignatureKey - * @memberof proto.ADVSignedDeviceIdentity + * @memberof proto.VerifiedNameCertificate * @instance */ - ADVSignedDeviceIdentity.prototype.accountSignatureKey = $util.newBuffer([]); + VerifiedNameCertificate.prototype.details = $util.newBuffer([]); /** - * ADVSignedDeviceIdentity accountSignature. - * @member {Uint8Array} accountSignature - * @memberof proto.ADVSignedDeviceIdentity + * VerifiedNameCertificate signature. + * @member {Uint8Array} signature + * @memberof proto.VerifiedNameCertificate * @instance */ - ADVSignedDeviceIdentity.prototype.accountSignature = $util.newBuffer([]); + VerifiedNameCertificate.prototype.signature = $util.newBuffer([]); /** - * ADVSignedDeviceIdentity deviceSignature. - * @member {Uint8Array} deviceSignature - * @memberof proto.ADVSignedDeviceIdentity + * VerifiedNameCertificate serverSignature. + * @member {Uint8Array} serverSignature + * @memberof proto.VerifiedNameCertificate * @instance */ - ADVSignedDeviceIdentity.prototype.deviceSignature = $util.newBuffer([]); + VerifiedNameCertificate.prototype.serverSignature = $util.newBuffer([]); /** - * Creates a new ADVSignedDeviceIdentity instance using the specified properties. + * Creates a new VerifiedNameCertificate instance using the specified properties. * @function create - * @memberof proto.ADVSignedDeviceIdentity + * @memberof proto.VerifiedNameCertificate * @static - * @param {proto.IADVSignedDeviceIdentity=} [properties] Properties to set - * @returns {proto.ADVSignedDeviceIdentity} ADVSignedDeviceIdentity instance + * @param {proto.IVerifiedNameCertificate=} [properties] Properties to set + * @returns {proto.VerifiedNameCertificate} VerifiedNameCertificate instance */ - ADVSignedDeviceIdentity.create = function create(properties) { - return new ADVSignedDeviceIdentity(properties); + VerifiedNameCertificate.create = function create(properties) { + return new VerifiedNameCertificate(properties); }; /** - * Encodes the specified ADVSignedDeviceIdentity message. Does not implicitly {@link proto.ADVSignedDeviceIdentity.verify|verify} messages. + * Encodes the specified VerifiedNameCertificate message. Does not implicitly {@link proto.VerifiedNameCertificate.verify|verify} messages. * @function encode - * @memberof proto.ADVSignedDeviceIdentity + * @memberof proto.VerifiedNameCertificate * @static - * @param {proto.IADVSignedDeviceIdentity} message ADVSignedDeviceIdentity message or plain object to encode + * @param {proto.IVerifiedNameCertificate} message VerifiedNameCertificate message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ADVSignedDeviceIdentity.encode = function encode(message, writer) { + VerifiedNameCertificate.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.details != null && Object.hasOwnProperty.call(message, "details")) writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.details); - if (message.accountSignatureKey != null && Object.hasOwnProperty.call(message, "accountSignatureKey")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.accountSignatureKey); - if (message.accountSignature != null && Object.hasOwnProperty.call(message, "accountSignature")) - writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.accountSignature); - if (message.deviceSignature != null && Object.hasOwnProperty.call(message, "deviceSignature")) - writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.deviceSignature); + if (message.signature != null && Object.hasOwnProperty.call(message, "signature")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.signature); + if (message.serverSignature != null && Object.hasOwnProperty.call(message, "serverSignature")) + writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.serverSignature); return writer; }; /** - * Encodes the specified ADVSignedDeviceIdentity message, length delimited. Does not implicitly {@link proto.ADVSignedDeviceIdentity.verify|verify} messages. + * Encodes the specified VerifiedNameCertificate message, length delimited. Does not implicitly {@link proto.VerifiedNameCertificate.verify|verify} messages. * @function encodeDelimited - * @memberof proto.ADVSignedDeviceIdentity + * @memberof proto.VerifiedNameCertificate * @static - * @param {proto.IADVSignedDeviceIdentity} message ADVSignedDeviceIdentity message or plain object to encode + * @param {proto.IVerifiedNameCertificate} message VerifiedNameCertificate message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ADVSignedDeviceIdentity.encodeDelimited = function encodeDelimited(message, writer) { + VerifiedNameCertificate.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ADVSignedDeviceIdentity message from the specified reader or buffer. + * Decodes a VerifiedNameCertificate message from the specified reader or buffer. * @function decode - * @memberof proto.ADVSignedDeviceIdentity + * @memberof proto.VerifiedNameCertificate * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {proto.ADVSignedDeviceIdentity} ADVSignedDeviceIdentity + * @returns {proto.VerifiedNameCertificate} VerifiedNameCertificate * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ADVSignedDeviceIdentity.decode = function decode(reader, length) { + VerifiedNameCertificate.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.ADVSignedDeviceIdentity(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.VerifiedNameCertificate(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -51394,13 +49891,10 @@ $root.proto = (function() { message.details = reader.bytes(); break; case 2: - message.accountSignatureKey = reader.bytes(); + message.signature = reader.bytes(); break; case 3: - message.accountSignature = reader.bytes(); - break; - case 4: - message.deviceSignature = reader.bytes(); + message.serverSignature = reader.bytes(); break; default: reader.skipType(tag & 7); @@ -51411,92 +49905,84 @@ $root.proto = (function() { }; /** - * Decodes a ADVSignedDeviceIdentity message from the specified reader or buffer, length delimited. + * Decodes a VerifiedNameCertificate message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof proto.ADVSignedDeviceIdentity + * @memberof proto.VerifiedNameCertificate * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.ADVSignedDeviceIdentity} ADVSignedDeviceIdentity + * @returns {proto.VerifiedNameCertificate} VerifiedNameCertificate * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ADVSignedDeviceIdentity.decodeDelimited = function decodeDelimited(reader) { + VerifiedNameCertificate.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ADVSignedDeviceIdentity message. + * Verifies a VerifiedNameCertificate message. * @function verify - * @memberof proto.ADVSignedDeviceIdentity + * @memberof proto.VerifiedNameCertificate * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ADVSignedDeviceIdentity.verify = function verify(message) { + VerifiedNameCertificate.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.details != null && message.hasOwnProperty("details")) if (!(message.details && typeof message.details.length === "number" || $util.isString(message.details))) return "details: buffer expected"; - if (message.accountSignatureKey != null && message.hasOwnProperty("accountSignatureKey")) - if (!(message.accountSignatureKey && typeof message.accountSignatureKey.length === "number" || $util.isString(message.accountSignatureKey))) - return "accountSignatureKey: buffer expected"; - if (message.accountSignature != null && message.hasOwnProperty("accountSignature")) - if (!(message.accountSignature && typeof message.accountSignature.length === "number" || $util.isString(message.accountSignature))) - return "accountSignature: buffer expected"; - if (message.deviceSignature != null && message.hasOwnProperty("deviceSignature")) - if (!(message.deviceSignature && typeof message.deviceSignature.length === "number" || $util.isString(message.deviceSignature))) - return "deviceSignature: buffer expected"; + if (message.signature != null && message.hasOwnProperty("signature")) + if (!(message.signature && typeof message.signature.length === "number" || $util.isString(message.signature))) + return "signature: buffer expected"; + if (message.serverSignature != null && message.hasOwnProperty("serverSignature")) + if (!(message.serverSignature && typeof message.serverSignature.length === "number" || $util.isString(message.serverSignature))) + return "serverSignature: buffer expected"; return null; }; /** - * Creates a ADVSignedDeviceIdentity message from a plain object. Also converts values to their respective internal types. + * Creates a VerifiedNameCertificate message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof proto.ADVSignedDeviceIdentity + * @memberof proto.VerifiedNameCertificate * @static * @param {Object.} object Plain object - * @returns {proto.ADVSignedDeviceIdentity} ADVSignedDeviceIdentity + * @returns {proto.VerifiedNameCertificate} VerifiedNameCertificate */ - ADVSignedDeviceIdentity.fromObject = function fromObject(object) { - if (object instanceof $root.proto.ADVSignedDeviceIdentity) + VerifiedNameCertificate.fromObject = function fromObject(object) { + if (object instanceof $root.proto.VerifiedNameCertificate) return object; - var message = new $root.proto.ADVSignedDeviceIdentity(); + var message = new $root.proto.VerifiedNameCertificate(); if (object.details != null) if (typeof object.details === "string") $util.base64.decode(object.details, message.details = $util.newBuffer($util.base64.length(object.details)), 0); else if (object.details.length) message.details = object.details; - if (object.accountSignatureKey != null) - if (typeof object.accountSignatureKey === "string") - $util.base64.decode(object.accountSignatureKey, message.accountSignatureKey = $util.newBuffer($util.base64.length(object.accountSignatureKey)), 0); - else if (object.accountSignatureKey.length) - message.accountSignatureKey = object.accountSignatureKey; - if (object.accountSignature != null) - if (typeof object.accountSignature === "string") - $util.base64.decode(object.accountSignature, message.accountSignature = $util.newBuffer($util.base64.length(object.accountSignature)), 0); - else if (object.accountSignature.length) - message.accountSignature = object.accountSignature; - if (object.deviceSignature != null) - if (typeof object.deviceSignature === "string") - $util.base64.decode(object.deviceSignature, message.deviceSignature = $util.newBuffer($util.base64.length(object.deviceSignature)), 0); - else if (object.deviceSignature.length) - message.deviceSignature = object.deviceSignature; + if (object.signature != null) + if (typeof object.signature === "string") + $util.base64.decode(object.signature, message.signature = $util.newBuffer($util.base64.length(object.signature)), 0); + else if (object.signature.length) + message.signature = object.signature; + if (object.serverSignature != null) + if (typeof object.serverSignature === "string") + $util.base64.decode(object.serverSignature, message.serverSignature = $util.newBuffer($util.base64.length(object.serverSignature)), 0); + else if (object.serverSignature.length) + message.serverSignature = object.serverSignature; return message; }; /** - * Creates a plain object from a ADVSignedDeviceIdentity message. Also converts values to other types if specified. + * Creates a plain object from a VerifiedNameCertificate message. Also converts values to other types if specified. * @function toObject - * @memberof proto.ADVSignedDeviceIdentity + * @memberof proto.VerifiedNameCertificate * @static - * @param {proto.ADVSignedDeviceIdentity} message ADVSignedDeviceIdentity + * @param {proto.VerifiedNameCertificate} message VerifiedNameCertificate * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ADVSignedDeviceIdentity.toObject = function toObject(message, options) { + VerifiedNameCertificate.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; @@ -51509,72 +49995,66 @@ $root.proto = (function() { object.details = $util.newBuffer(object.details); } if (options.bytes === String) - object.accountSignatureKey = ""; - else { - object.accountSignatureKey = []; - if (options.bytes !== Array) - object.accountSignatureKey = $util.newBuffer(object.accountSignatureKey); - } - if (options.bytes === String) - object.accountSignature = ""; + object.signature = ""; else { - object.accountSignature = []; + object.signature = []; if (options.bytes !== Array) - object.accountSignature = $util.newBuffer(object.accountSignature); + object.signature = $util.newBuffer(object.signature); } if (options.bytes === String) - object.deviceSignature = ""; + object.serverSignature = ""; else { - object.deviceSignature = []; + object.serverSignature = []; if (options.bytes !== Array) - object.deviceSignature = $util.newBuffer(object.deviceSignature); + object.serverSignature = $util.newBuffer(object.serverSignature); } } if (message.details != null && message.hasOwnProperty("details")) object.details = options.bytes === String ? $util.base64.encode(message.details, 0, message.details.length) : options.bytes === Array ? Array.prototype.slice.call(message.details) : message.details; - if (message.accountSignatureKey != null && message.hasOwnProperty("accountSignatureKey")) - object.accountSignatureKey = options.bytes === String ? $util.base64.encode(message.accountSignatureKey, 0, message.accountSignatureKey.length) : options.bytes === Array ? Array.prototype.slice.call(message.accountSignatureKey) : message.accountSignatureKey; - if (message.accountSignature != null && message.hasOwnProperty("accountSignature")) - object.accountSignature = options.bytes === String ? $util.base64.encode(message.accountSignature, 0, message.accountSignature.length) : options.bytes === Array ? Array.prototype.slice.call(message.accountSignature) : message.accountSignature; - if (message.deviceSignature != null && message.hasOwnProperty("deviceSignature")) - object.deviceSignature = options.bytes === String ? $util.base64.encode(message.deviceSignature, 0, message.deviceSignature.length) : options.bytes === Array ? Array.prototype.slice.call(message.deviceSignature) : message.deviceSignature; + if (message.signature != null && message.hasOwnProperty("signature")) + object.signature = options.bytes === String ? $util.base64.encode(message.signature, 0, message.signature.length) : options.bytes === Array ? Array.prototype.slice.call(message.signature) : message.signature; + if (message.serverSignature != null && message.hasOwnProperty("serverSignature")) + object.serverSignature = options.bytes === String ? $util.base64.encode(message.serverSignature, 0, message.serverSignature.length) : options.bytes === Array ? Array.prototype.slice.call(message.serverSignature) : message.serverSignature; return object; }; /** - * Converts this ADVSignedDeviceIdentity to JSON. + * Converts this VerifiedNameCertificate to JSON. * @function toJSON - * @memberof proto.ADVSignedDeviceIdentity + * @memberof proto.VerifiedNameCertificate * @instance * @returns {Object.} JSON object */ - ADVSignedDeviceIdentity.prototype.toJSON = function toJSON() { + VerifiedNameCertificate.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ADVSignedDeviceIdentity; + return VerifiedNameCertificate; })(); - proto.ADVDeviceIdentity = (function() { + proto.VerifiedNameDetails = (function() { /** - * Properties of a ADVDeviceIdentity. + * Properties of a VerifiedNameDetails. * @memberof proto - * @interface IADVDeviceIdentity - * @property {number|null} [rawId] ADVDeviceIdentity rawId - * @property {number|Long|null} [timestamp] ADVDeviceIdentity timestamp - * @property {number|null} [keyIndex] ADVDeviceIdentity keyIndex + * @interface IVerifiedNameDetails + * @property {number|Long|null} [serial] VerifiedNameDetails serial + * @property {string|null} [issuer] VerifiedNameDetails issuer + * @property {string|null} [verifiedName] VerifiedNameDetails verifiedName + * @property {Array.|null} [localizedNames] VerifiedNameDetails localizedNames + * @property {number|Long|null} [issueTime] VerifiedNameDetails issueTime */ /** - * Constructs a new ADVDeviceIdentity. + * Constructs a new VerifiedNameDetails. * @memberof proto - * @classdesc Represents a ADVDeviceIdentity. - * @implements IADVDeviceIdentity + * @classdesc Represents a VerifiedNameDetails. + * @implements IVerifiedNameDetails * @constructor - * @param {proto.IADVDeviceIdentity=} [properties] Properties to set + * @param {proto.IVerifiedNameDetails=} [properties] Properties to set */ - function ADVDeviceIdentity(properties) { + function VerifiedNameDetails(properties) { + this.localizedNames = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -51582,101 +50062,130 @@ $root.proto = (function() { } /** - * ADVDeviceIdentity rawId. - * @member {number} rawId - * @memberof proto.ADVDeviceIdentity + * VerifiedNameDetails serial. + * @member {number|Long} serial + * @memberof proto.VerifiedNameDetails * @instance */ - ADVDeviceIdentity.prototype.rawId = 0; + VerifiedNameDetails.prototype.serial = $util.Long ? $util.Long.fromBits(0,0,true) : 0; /** - * ADVDeviceIdentity timestamp. - * @member {number|Long} timestamp - * @memberof proto.ADVDeviceIdentity + * VerifiedNameDetails issuer. + * @member {string} issuer + * @memberof proto.VerifiedNameDetails * @instance */ - ADVDeviceIdentity.prototype.timestamp = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + VerifiedNameDetails.prototype.issuer = ""; /** - * ADVDeviceIdentity keyIndex. - * @member {number} keyIndex - * @memberof proto.ADVDeviceIdentity + * VerifiedNameDetails verifiedName. + * @member {string} verifiedName + * @memberof proto.VerifiedNameDetails * @instance */ - ADVDeviceIdentity.prototype.keyIndex = 0; + VerifiedNameDetails.prototype.verifiedName = ""; /** - * Creates a new ADVDeviceIdentity instance using the specified properties. + * VerifiedNameDetails localizedNames. + * @member {Array.} localizedNames + * @memberof proto.VerifiedNameDetails + * @instance + */ + VerifiedNameDetails.prototype.localizedNames = $util.emptyArray; + + /** + * VerifiedNameDetails issueTime. + * @member {number|Long} issueTime + * @memberof proto.VerifiedNameDetails + * @instance + */ + VerifiedNameDetails.prototype.issueTime = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new VerifiedNameDetails instance using the specified properties. * @function create - * @memberof proto.ADVDeviceIdentity + * @memberof proto.VerifiedNameDetails * @static - * @param {proto.IADVDeviceIdentity=} [properties] Properties to set - * @returns {proto.ADVDeviceIdentity} ADVDeviceIdentity instance + * @param {proto.IVerifiedNameDetails=} [properties] Properties to set + * @returns {proto.VerifiedNameDetails} VerifiedNameDetails instance */ - ADVDeviceIdentity.create = function create(properties) { - return new ADVDeviceIdentity(properties); + VerifiedNameDetails.create = function create(properties) { + return new VerifiedNameDetails(properties); }; /** - * Encodes the specified ADVDeviceIdentity message. Does not implicitly {@link proto.ADVDeviceIdentity.verify|verify} messages. + * Encodes the specified VerifiedNameDetails message. Does not implicitly {@link proto.VerifiedNameDetails.verify|verify} messages. * @function encode - * @memberof proto.ADVDeviceIdentity + * @memberof proto.VerifiedNameDetails * @static - * @param {proto.IADVDeviceIdentity} message ADVDeviceIdentity message or plain object to encode + * @param {proto.IVerifiedNameDetails} message VerifiedNameDetails message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ADVDeviceIdentity.encode = function encode(message, writer) { + VerifiedNameDetails.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.rawId != null && Object.hasOwnProperty.call(message, "rawId")) - writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.rawId); - if (message.timestamp != null && Object.hasOwnProperty.call(message, "timestamp")) - writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.timestamp); - if (message.keyIndex != null && Object.hasOwnProperty.call(message, "keyIndex")) - writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.keyIndex); + if (message.serial != null && Object.hasOwnProperty.call(message, "serial")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.serial); + if (message.issuer != null && Object.hasOwnProperty.call(message, "issuer")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.issuer); + if (message.verifiedName != null && Object.hasOwnProperty.call(message, "verifiedName")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.verifiedName); + if (message.localizedNames != null && message.localizedNames.length) + for (var i = 0; i < message.localizedNames.length; ++i) + $root.proto.LocalizedName.encode(message.localizedNames[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.issueTime != null && Object.hasOwnProperty.call(message, "issueTime")) + writer.uint32(/* id 10, wireType 0 =*/80).uint64(message.issueTime); return writer; }; /** - * Encodes the specified ADVDeviceIdentity message, length delimited. Does not implicitly {@link proto.ADVDeviceIdentity.verify|verify} messages. + * Encodes the specified VerifiedNameDetails message, length delimited. Does not implicitly {@link proto.VerifiedNameDetails.verify|verify} messages. * @function encodeDelimited - * @memberof proto.ADVDeviceIdentity + * @memberof proto.VerifiedNameDetails * @static - * @param {proto.IADVDeviceIdentity} message ADVDeviceIdentity message or plain object to encode + * @param {proto.IVerifiedNameDetails} message VerifiedNameDetails message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ADVDeviceIdentity.encodeDelimited = function encodeDelimited(message, writer) { + VerifiedNameDetails.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ADVDeviceIdentity message from the specified reader or buffer. + * Decodes a VerifiedNameDetails message from the specified reader or buffer. * @function decode - * @memberof proto.ADVDeviceIdentity + * @memberof proto.VerifiedNameDetails * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {proto.ADVDeviceIdentity} ADVDeviceIdentity + * @returns {proto.VerifiedNameDetails} VerifiedNameDetails * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ADVDeviceIdentity.decode = function decode(reader, length) { + VerifiedNameDetails.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.ADVDeviceIdentity(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.VerifiedNameDetails(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.rawId = reader.uint32(); + message.serial = reader.uint64(); break; case 2: - message.timestamp = reader.uint64(); + message.issuer = reader.string(); break; - case 3: - message.keyIndex = reader.uint32(); + case 4: + message.verifiedName = reader.string(); + break; + case 8: + if (!(message.localizedNames && message.localizedNames.length)) + message.localizedNames = []; + message.localizedNames.push($root.proto.LocalizedName.decode(reader, reader.uint32())); + break; + case 10: + message.issueTime = reader.uint64(); break; default: reader.skipType(tag & 7); @@ -51687,139 +50196,187 @@ $root.proto = (function() { }; /** - * Decodes a ADVDeviceIdentity message from the specified reader or buffer, length delimited. + * Decodes a VerifiedNameDetails message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof proto.ADVDeviceIdentity + * @memberof proto.VerifiedNameDetails * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.ADVDeviceIdentity} ADVDeviceIdentity + * @returns {proto.VerifiedNameDetails} VerifiedNameDetails * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ADVDeviceIdentity.decodeDelimited = function decodeDelimited(reader) { + VerifiedNameDetails.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ADVDeviceIdentity message. + * Verifies a VerifiedNameDetails message. * @function verify - * @memberof proto.ADVDeviceIdentity + * @memberof proto.VerifiedNameDetails * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ADVDeviceIdentity.verify = function verify(message) { + VerifiedNameDetails.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.rawId != null && message.hasOwnProperty("rawId")) - if (!$util.isInteger(message.rawId)) - return "rawId: integer expected"; - if (message.timestamp != null && message.hasOwnProperty("timestamp")) - if (!$util.isInteger(message.timestamp) && !(message.timestamp && $util.isInteger(message.timestamp.low) && $util.isInteger(message.timestamp.high))) - return "timestamp: integer|Long expected"; - if (message.keyIndex != null && message.hasOwnProperty("keyIndex")) - if (!$util.isInteger(message.keyIndex)) - return "keyIndex: integer expected"; + if (message.serial != null && message.hasOwnProperty("serial")) + if (!$util.isInteger(message.serial) && !(message.serial && $util.isInteger(message.serial.low) && $util.isInteger(message.serial.high))) + return "serial: integer|Long expected"; + if (message.issuer != null && message.hasOwnProperty("issuer")) + if (!$util.isString(message.issuer)) + return "issuer: string expected"; + if (message.verifiedName != null && message.hasOwnProperty("verifiedName")) + if (!$util.isString(message.verifiedName)) + return "verifiedName: string expected"; + if (message.localizedNames != null && message.hasOwnProperty("localizedNames")) { + if (!Array.isArray(message.localizedNames)) + return "localizedNames: array expected"; + for (var i = 0; i < message.localizedNames.length; ++i) { + var error = $root.proto.LocalizedName.verify(message.localizedNames[i]); + if (error) + return "localizedNames." + error; + } + } + if (message.issueTime != null && message.hasOwnProperty("issueTime")) + if (!$util.isInteger(message.issueTime) && !(message.issueTime && $util.isInteger(message.issueTime.low) && $util.isInteger(message.issueTime.high))) + return "issueTime: integer|Long expected"; return null; }; /** - * Creates a ADVDeviceIdentity message from a plain object. Also converts values to their respective internal types. + * Creates a VerifiedNameDetails message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof proto.ADVDeviceIdentity + * @memberof proto.VerifiedNameDetails * @static * @param {Object.} object Plain object - * @returns {proto.ADVDeviceIdentity} ADVDeviceIdentity + * @returns {proto.VerifiedNameDetails} VerifiedNameDetails */ - ADVDeviceIdentity.fromObject = function fromObject(object) { - if (object instanceof $root.proto.ADVDeviceIdentity) + VerifiedNameDetails.fromObject = function fromObject(object) { + if (object instanceof $root.proto.VerifiedNameDetails) return object; - var message = new $root.proto.ADVDeviceIdentity(); - if (object.rawId != null) - message.rawId = object.rawId >>> 0; - if (object.timestamp != null) + var message = new $root.proto.VerifiedNameDetails(); + if (object.serial != null) if ($util.Long) - (message.timestamp = $util.Long.fromValue(object.timestamp)).unsigned = true; - else if (typeof object.timestamp === "string") - message.timestamp = parseInt(object.timestamp, 10); - else if (typeof object.timestamp === "number") - message.timestamp = object.timestamp; - else if (typeof object.timestamp === "object") - message.timestamp = new $util.LongBits(object.timestamp.low >>> 0, object.timestamp.high >>> 0).toNumber(true); - if (object.keyIndex != null) - message.keyIndex = object.keyIndex >>> 0; + (message.serial = $util.Long.fromValue(object.serial)).unsigned = true; + else if (typeof object.serial === "string") + message.serial = parseInt(object.serial, 10); + else if (typeof object.serial === "number") + message.serial = object.serial; + else if (typeof object.serial === "object") + message.serial = new $util.LongBits(object.serial.low >>> 0, object.serial.high >>> 0).toNumber(true); + if (object.issuer != null) + message.issuer = String(object.issuer); + if (object.verifiedName != null) + message.verifiedName = String(object.verifiedName); + if (object.localizedNames) { + if (!Array.isArray(object.localizedNames)) + throw TypeError(".proto.VerifiedNameDetails.localizedNames: array expected"); + message.localizedNames = []; + for (var i = 0; i < object.localizedNames.length; ++i) { + if (typeof object.localizedNames[i] !== "object") + throw TypeError(".proto.VerifiedNameDetails.localizedNames: object expected"); + message.localizedNames[i] = $root.proto.LocalizedName.fromObject(object.localizedNames[i]); + } + } + if (object.issueTime != null) + if ($util.Long) + (message.issueTime = $util.Long.fromValue(object.issueTime)).unsigned = true; + else if (typeof object.issueTime === "string") + message.issueTime = parseInt(object.issueTime, 10); + else if (typeof object.issueTime === "number") + message.issueTime = object.issueTime; + else if (typeof object.issueTime === "object") + message.issueTime = new $util.LongBits(object.issueTime.low >>> 0, object.issueTime.high >>> 0).toNumber(true); return message; }; /** - * Creates a plain object from a ADVDeviceIdentity message. Also converts values to other types if specified. + * Creates a plain object from a VerifiedNameDetails message. Also converts values to other types if specified. * @function toObject - * @memberof proto.ADVDeviceIdentity + * @memberof proto.VerifiedNameDetails * @static - * @param {proto.ADVDeviceIdentity} message ADVDeviceIdentity + * @param {proto.VerifiedNameDetails} message VerifiedNameDetails * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ADVDeviceIdentity.toObject = function toObject(message, options) { + VerifiedNameDetails.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.localizedNames = []; if (options.defaults) { - object.rawId = 0; if ($util.Long) { var long = new $util.Long(0, 0, true); - object.timestamp = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + object.serial = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; } else - object.timestamp = options.longs === String ? "0" : 0; - object.keyIndex = 0; + object.serial = options.longs === String ? "0" : 0; + object.issuer = ""; + object.verifiedName = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.issueTime = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.issueTime = options.longs === String ? "0" : 0; } - if (message.rawId != null && message.hasOwnProperty("rawId")) - object.rawId = message.rawId; - if (message.timestamp != null && message.hasOwnProperty("timestamp")) - if (typeof message.timestamp === "number") - object.timestamp = options.longs === String ? String(message.timestamp) : message.timestamp; + if (message.serial != null && message.hasOwnProperty("serial")) + if (typeof message.serial === "number") + object.serial = options.longs === String ? String(message.serial) : message.serial; else - object.timestamp = options.longs === String ? $util.Long.prototype.toString.call(message.timestamp) : options.longs === Number ? new $util.LongBits(message.timestamp.low >>> 0, message.timestamp.high >>> 0).toNumber(true) : message.timestamp; - if (message.keyIndex != null && message.hasOwnProperty("keyIndex")) - object.keyIndex = message.keyIndex; + object.serial = options.longs === String ? $util.Long.prototype.toString.call(message.serial) : options.longs === Number ? new $util.LongBits(message.serial.low >>> 0, message.serial.high >>> 0).toNumber(true) : message.serial; + if (message.issuer != null && message.hasOwnProperty("issuer")) + object.issuer = message.issuer; + if (message.verifiedName != null && message.hasOwnProperty("verifiedName")) + object.verifiedName = message.verifiedName; + if (message.localizedNames && message.localizedNames.length) { + object.localizedNames = []; + for (var j = 0; j < message.localizedNames.length; ++j) + object.localizedNames[j] = $root.proto.LocalizedName.toObject(message.localizedNames[j], options); + } + if (message.issueTime != null && message.hasOwnProperty("issueTime")) + if (typeof message.issueTime === "number") + object.issueTime = options.longs === String ? String(message.issueTime) : message.issueTime; + else + object.issueTime = options.longs === String ? $util.Long.prototype.toString.call(message.issueTime) : options.longs === Number ? new $util.LongBits(message.issueTime.low >>> 0, message.issueTime.high >>> 0).toNumber(true) : message.issueTime; return object; }; /** - * Converts this ADVDeviceIdentity to JSON. + * Converts this VerifiedNameDetails to JSON. * @function toJSON - * @memberof proto.ADVDeviceIdentity + * @memberof proto.VerifiedNameDetails * @instance * @returns {Object.} JSON object */ - ADVDeviceIdentity.prototype.toJSON = function toJSON() { + VerifiedNameDetails.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ADVDeviceIdentity; + return VerifiedNameDetails; })(); - proto.ADVSignedKeyIndexList = (function() { + proto.ClientFinish = (function() { /** - * Properties of a ADVSignedKeyIndexList. + * Properties of a ClientFinish. * @memberof proto - * @interface IADVSignedKeyIndexList - * @property {Uint8Array|null} [details] ADVSignedKeyIndexList details - * @property {Uint8Array|null} [accountSignature] ADVSignedKeyIndexList accountSignature + * @interface IClientFinish + * @property {Uint8Array|null} ["static"] ClientFinish static + * @property {Uint8Array|null} [payload] ClientFinish payload */ /** - * Constructs a new ADVSignedKeyIndexList. + * Constructs a new ClientFinish. * @memberof proto - * @classdesc Represents a ADVSignedKeyIndexList. - * @implements IADVSignedKeyIndexList + * @classdesc Represents a ClientFinish. + * @implements IClientFinish * @constructor - * @param {proto.IADVSignedKeyIndexList=} [properties] Properties to set + * @param {proto.IClientFinish=} [properties] Properties to set */ - function ADVSignedKeyIndexList(properties) { + function ClientFinish(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -51827,88 +50384,88 @@ $root.proto = (function() { } /** - * ADVSignedKeyIndexList details. - * @member {Uint8Array} details - * @memberof proto.ADVSignedKeyIndexList + * ClientFinish static. + * @member {Uint8Array} static + * @memberof proto.ClientFinish * @instance */ - ADVSignedKeyIndexList.prototype.details = $util.newBuffer([]); + ClientFinish.prototype["static"] = $util.newBuffer([]); /** - * ADVSignedKeyIndexList accountSignature. - * @member {Uint8Array} accountSignature - * @memberof proto.ADVSignedKeyIndexList + * ClientFinish payload. + * @member {Uint8Array} payload + * @memberof proto.ClientFinish * @instance */ - ADVSignedKeyIndexList.prototype.accountSignature = $util.newBuffer([]); + ClientFinish.prototype.payload = $util.newBuffer([]); /** - * Creates a new ADVSignedKeyIndexList instance using the specified properties. + * Creates a new ClientFinish instance using the specified properties. * @function create - * @memberof proto.ADVSignedKeyIndexList + * @memberof proto.ClientFinish * @static - * @param {proto.IADVSignedKeyIndexList=} [properties] Properties to set - * @returns {proto.ADVSignedKeyIndexList} ADVSignedKeyIndexList instance + * @param {proto.IClientFinish=} [properties] Properties to set + * @returns {proto.ClientFinish} ClientFinish instance */ - ADVSignedKeyIndexList.create = function create(properties) { - return new ADVSignedKeyIndexList(properties); + ClientFinish.create = function create(properties) { + return new ClientFinish(properties); }; /** - * Encodes the specified ADVSignedKeyIndexList message. Does not implicitly {@link proto.ADVSignedKeyIndexList.verify|verify} messages. + * Encodes the specified ClientFinish message. Does not implicitly {@link proto.ClientFinish.verify|verify} messages. * @function encode - * @memberof proto.ADVSignedKeyIndexList + * @memberof proto.ClientFinish * @static - * @param {proto.IADVSignedKeyIndexList} message ADVSignedKeyIndexList message or plain object to encode + * @param {proto.IClientFinish} message ClientFinish message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ADVSignedKeyIndexList.encode = function encode(message, writer) { + ClientFinish.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.details != null && Object.hasOwnProperty.call(message, "details")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.details); - if (message.accountSignature != null && Object.hasOwnProperty.call(message, "accountSignature")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.accountSignature); + if (message["static"] != null && Object.hasOwnProperty.call(message, "static")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message["static"]); + if (message.payload != null && Object.hasOwnProperty.call(message, "payload")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.payload); return writer; }; /** - * Encodes the specified ADVSignedKeyIndexList message, length delimited. Does not implicitly {@link proto.ADVSignedKeyIndexList.verify|verify} messages. + * Encodes the specified ClientFinish message, length delimited. Does not implicitly {@link proto.ClientFinish.verify|verify} messages. * @function encodeDelimited - * @memberof proto.ADVSignedKeyIndexList + * @memberof proto.ClientFinish * @static - * @param {proto.IADVSignedKeyIndexList} message ADVSignedKeyIndexList message or plain object to encode + * @param {proto.IClientFinish} message ClientFinish message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ADVSignedKeyIndexList.encodeDelimited = function encodeDelimited(message, writer) { + ClientFinish.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ADVSignedKeyIndexList message from the specified reader or buffer. + * Decodes a ClientFinish message from the specified reader or buffer. * @function decode - * @memberof proto.ADVSignedKeyIndexList + * @memberof proto.ClientFinish * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {proto.ADVSignedKeyIndexList} ADVSignedKeyIndexList + * @returns {proto.ClientFinish} ClientFinish * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ADVSignedKeyIndexList.decode = function decode(reader, length) { + ClientFinish.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.ADVSignedKeyIndexList(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.ClientFinish(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.details = reader.bytes(); + message["static"] = reader.bytes(); break; case 2: - message.accountSignature = reader.bytes(); + message.payload = reader.bytes(); break; default: reader.skipType(tag & 7); @@ -51919,138 +50476,136 @@ $root.proto = (function() { }; /** - * Decodes a ADVSignedKeyIndexList message from the specified reader or buffer, length delimited. + * Decodes a ClientFinish message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof proto.ADVSignedKeyIndexList + * @memberof proto.ClientFinish * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.ADVSignedKeyIndexList} ADVSignedKeyIndexList + * @returns {proto.ClientFinish} ClientFinish * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ADVSignedKeyIndexList.decodeDelimited = function decodeDelimited(reader) { + ClientFinish.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ADVSignedKeyIndexList message. + * Verifies a ClientFinish message. * @function verify - * @memberof proto.ADVSignedKeyIndexList + * @memberof proto.ClientFinish * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ADVSignedKeyIndexList.verify = function verify(message) { + ClientFinish.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.details != null && message.hasOwnProperty("details")) - if (!(message.details && typeof message.details.length === "number" || $util.isString(message.details))) - return "details: buffer expected"; - if (message.accountSignature != null && message.hasOwnProperty("accountSignature")) - if (!(message.accountSignature && typeof message.accountSignature.length === "number" || $util.isString(message.accountSignature))) - return "accountSignature: buffer expected"; + if (message["static"] != null && message.hasOwnProperty("static")) + if (!(message["static"] && typeof message["static"].length === "number" || $util.isString(message["static"]))) + return "static: buffer expected"; + if (message.payload != null && message.hasOwnProperty("payload")) + if (!(message.payload && typeof message.payload.length === "number" || $util.isString(message.payload))) + return "payload: buffer expected"; return null; }; /** - * Creates a ADVSignedKeyIndexList message from a plain object. Also converts values to their respective internal types. + * Creates a ClientFinish message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof proto.ADVSignedKeyIndexList + * @memberof proto.ClientFinish * @static * @param {Object.} object Plain object - * @returns {proto.ADVSignedKeyIndexList} ADVSignedKeyIndexList + * @returns {proto.ClientFinish} ClientFinish */ - ADVSignedKeyIndexList.fromObject = function fromObject(object) { - if (object instanceof $root.proto.ADVSignedKeyIndexList) + ClientFinish.fromObject = function fromObject(object) { + if (object instanceof $root.proto.ClientFinish) return object; - var message = new $root.proto.ADVSignedKeyIndexList(); - if (object.details != null) - if (typeof object.details === "string") - $util.base64.decode(object.details, message.details = $util.newBuffer($util.base64.length(object.details)), 0); - else if (object.details.length) - message.details = object.details; - if (object.accountSignature != null) - if (typeof object.accountSignature === "string") - $util.base64.decode(object.accountSignature, message.accountSignature = $util.newBuffer($util.base64.length(object.accountSignature)), 0); - else if (object.accountSignature.length) - message.accountSignature = object.accountSignature; + var message = new $root.proto.ClientFinish(); + if (object["static"] != null) + if (typeof object["static"] === "string") + $util.base64.decode(object["static"], message["static"] = $util.newBuffer($util.base64.length(object["static"])), 0); + else if (object["static"].length) + message["static"] = object["static"]; + if (object.payload != null) + if (typeof object.payload === "string") + $util.base64.decode(object.payload, message.payload = $util.newBuffer($util.base64.length(object.payload)), 0); + else if (object.payload.length) + message.payload = object.payload; return message; }; /** - * Creates a plain object from a ADVSignedKeyIndexList message. Also converts values to other types if specified. + * Creates a plain object from a ClientFinish message. Also converts values to other types if specified. * @function toObject - * @memberof proto.ADVSignedKeyIndexList + * @memberof proto.ClientFinish * @static - * @param {proto.ADVSignedKeyIndexList} message ADVSignedKeyIndexList + * @param {proto.ClientFinish} message ClientFinish * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ADVSignedKeyIndexList.toObject = function toObject(message, options) { + ClientFinish.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { if (options.bytes === String) - object.details = ""; + object["static"] = ""; else { - object.details = []; + object["static"] = []; if (options.bytes !== Array) - object.details = $util.newBuffer(object.details); + object["static"] = $util.newBuffer(object["static"]); } if (options.bytes === String) - object.accountSignature = ""; + object.payload = ""; else { - object.accountSignature = []; + object.payload = []; if (options.bytes !== Array) - object.accountSignature = $util.newBuffer(object.accountSignature); + object.payload = $util.newBuffer(object.payload); } } - if (message.details != null && message.hasOwnProperty("details")) - object.details = options.bytes === String ? $util.base64.encode(message.details, 0, message.details.length) : options.bytes === Array ? Array.prototype.slice.call(message.details) : message.details; - if (message.accountSignature != null && message.hasOwnProperty("accountSignature")) - object.accountSignature = options.bytes === String ? $util.base64.encode(message.accountSignature, 0, message.accountSignature.length) : options.bytes === Array ? Array.prototype.slice.call(message.accountSignature) : message.accountSignature; + if (message["static"] != null && message.hasOwnProperty("static")) + object["static"] = options.bytes === String ? $util.base64.encode(message["static"], 0, message["static"].length) : options.bytes === Array ? Array.prototype.slice.call(message["static"]) : message["static"]; + if (message.payload != null && message.hasOwnProperty("payload")) + object.payload = options.bytes === String ? $util.base64.encode(message.payload, 0, message.payload.length) : options.bytes === Array ? Array.prototype.slice.call(message.payload) : message.payload; return object; }; /** - * Converts this ADVSignedKeyIndexList to JSON. + * Converts this ClientFinish to JSON. * @function toJSON - * @memberof proto.ADVSignedKeyIndexList + * @memberof proto.ClientFinish * @instance * @returns {Object.} JSON object */ - ADVSignedKeyIndexList.prototype.toJSON = function toJSON() { + ClientFinish.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ADVSignedKeyIndexList; + return ClientFinish; })(); - proto.ADVKeyIndexList = (function() { + proto.ClientHello = (function() { /** - * Properties of a ADVKeyIndexList. + * Properties of a ClientHello. * @memberof proto - * @interface IADVKeyIndexList - * @property {number|null} [rawId] ADVKeyIndexList rawId - * @property {number|Long|null} [timestamp] ADVKeyIndexList timestamp - * @property {number|null} [currentIndex] ADVKeyIndexList currentIndex - * @property {Array.|null} [validIndexes] ADVKeyIndexList validIndexes + * @interface IClientHello + * @property {Uint8Array|null} [ephemeral] ClientHello ephemeral + * @property {Uint8Array|null} ["static"] ClientHello static + * @property {Uint8Array|null} [payload] ClientHello payload */ /** - * Constructs a new ADVKeyIndexList. + * Constructs a new ClientHello. * @memberof proto - * @classdesc Represents a ADVKeyIndexList. - * @implements IADVKeyIndexList + * @classdesc Represents a ClientHello. + * @implements IClientHello * @constructor - * @param {proto.IADVKeyIndexList=} [properties] Properties to set + * @param {proto.IClientHello=} [properties] Properties to set */ - function ADVKeyIndexList(properties) { - this.validIndexes = []; + function ClientHello(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -52058,125 +50613,101 @@ $root.proto = (function() { } /** - * ADVKeyIndexList rawId. - * @member {number} rawId - * @memberof proto.ADVKeyIndexList - * @instance - */ - ADVKeyIndexList.prototype.rawId = 0; - - /** - * ADVKeyIndexList timestamp. - * @member {number|Long} timestamp - * @memberof proto.ADVKeyIndexList + * ClientHello ephemeral. + * @member {Uint8Array} ephemeral + * @memberof proto.ClientHello * @instance */ - ADVKeyIndexList.prototype.timestamp = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + ClientHello.prototype.ephemeral = $util.newBuffer([]); /** - * ADVKeyIndexList currentIndex. - * @member {number} currentIndex - * @memberof proto.ADVKeyIndexList + * ClientHello static. + * @member {Uint8Array} static + * @memberof proto.ClientHello * @instance */ - ADVKeyIndexList.prototype.currentIndex = 0; + ClientHello.prototype["static"] = $util.newBuffer([]); /** - * ADVKeyIndexList validIndexes. - * @member {Array.} validIndexes - * @memberof proto.ADVKeyIndexList + * ClientHello payload. + * @member {Uint8Array} payload + * @memberof proto.ClientHello * @instance */ - ADVKeyIndexList.prototype.validIndexes = $util.emptyArray; + ClientHello.prototype.payload = $util.newBuffer([]); /** - * Creates a new ADVKeyIndexList instance using the specified properties. + * Creates a new ClientHello instance using the specified properties. * @function create - * @memberof proto.ADVKeyIndexList + * @memberof proto.ClientHello * @static - * @param {proto.IADVKeyIndexList=} [properties] Properties to set - * @returns {proto.ADVKeyIndexList} ADVKeyIndexList instance + * @param {proto.IClientHello=} [properties] Properties to set + * @returns {proto.ClientHello} ClientHello instance */ - ADVKeyIndexList.create = function create(properties) { - return new ADVKeyIndexList(properties); + ClientHello.create = function create(properties) { + return new ClientHello(properties); }; /** - * Encodes the specified ADVKeyIndexList message. Does not implicitly {@link proto.ADVKeyIndexList.verify|verify} messages. + * Encodes the specified ClientHello message. Does not implicitly {@link proto.ClientHello.verify|verify} messages. * @function encode - * @memberof proto.ADVKeyIndexList + * @memberof proto.ClientHello * @static - * @param {proto.IADVKeyIndexList} message ADVKeyIndexList message or plain object to encode + * @param {proto.IClientHello} message ClientHello message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ADVKeyIndexList.encode = function encode(message, writer) { + ClientHello.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.rawId != null && Object.hasOwnProperty.call(message, "rawId")) - writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.rawId); - if (message.timestamp != null && Object.hasOwnProperty.call(message, "timestamp")) - writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.timestamp); - if (message.currentIndex != null && Object.hasOwnProperty.call(message, "currentIndex")) - writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.currentIndex); - if (message.validIndexes != null && message.validIndexes.length) { - writer.uint32(/* id 4, wireType 2 =*/34).fork(); - for (var i = 0; i < message.validIndexes.length; ++i) - writer.uint32(message.validIndexes[i]); - writer.ldelim(); - } + if (message.ephemeral != null && Object.hasOwnProperty.call(message, "ephemeral")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.ephemeral); + if (message["static"] != null && Object.hasOwnProperty.call(message, "static")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message["static"]); + if (message.payload != null && Object.hasOwnProperty.call(message, "payload")) + writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.payload); return writer; }; /** - * Encodes the specified ADVKeyIndexList message, length delimited. Does not implicitly {@link proto.ADVKeyIndexList.verify|verify} messages. + * Encodes the specified ClientHello message, length delimited. Does not implicitly {@link proto.ClientHello.verify|verify} messages. * @function encodeDelimited - * @memberof proto.ADVKeyIndexList + * @memberof proto.ClientHello * @static - * @param {proto.IADVKeyIndexList} message ADVKeyIndexList message or plain object to encode + * @param {proto.IClientHello} message ClientHello message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ADVKeyIndexList.encodeDelimited = function encodeDelimited(message, writer) { + ClientHello.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ADVKeyIndexList message from the specified reader or buffer. + * Decodes a ClientHello message from the specified reader or buffer. * @function decode - * @memberof proto.ADVKeyIndexList + * @memberof proto.ClientHello * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {proto.ADVKeyIndexList} ADVKeyIndexList + * @returns {proto.ClientHello} ClientHello * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ADVKeyIndexList.decode = function decode(reader, length) { + ClientHello.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.ADVKeyIndexList(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.ClientHello(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.rawId = reader.uint32(); + message.ephemeral = reader.bytes(); break; case 2: - message.timestamp = reader.uint64(); + message["static"] = reader.bytes(); break; case 3: - message.currentIndex = reader.uint32(); - break; - case 4: - if (!(message.validIndexes && message.validIndexes.length)) - message.validIndexes = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.validIndexes.push(reader.uint32()); - } else - message.validIndexes.push(reader.uint32()); + message.payload = reader.bytes(); break; default: reader.skipType(tag & 7); @@ -52187,162 +50718,174 @@ $root.proto = (function() { }; /** - * Decodes a ADVKeyIndexList message from the specified reader or buffer, length delimited. + * Decodes a ClientHello message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof proto.ADVKeyIndexList + * @memberof proto.ClientHello * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.ADVKeyIndexList} ADVKeyIndexList + * @returns {proto.ClientHello} ClientHello * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ADVKeyIndexList.decodeDelimited = function decodeDelimited(reader) { + ClientHello.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ADVKeyIndexList message. + * Verifies a ClientHello message. * @function verify - * @memberof proto.ADVKeyIndexList + * @memberof proto.ClientHello * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ADVKeyIndexList.verify = function verify(message) { + ClientHello.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.rawId != null && message.hasOwnProperty("rawId")) - if (!$util.isInteger(message.rawId)) - return "rawId: integer expected"; - if (message.timestamp != null && message.hasOwnProperty("timestamp")) - if (!$util.isInteger(message.timestamp) && !(message.timestamp && $util.isInteger(message.timestamp.low) && $util.isInteger(message.timestamp.high))) - return "timestamp: integer|Long expected"; - if (message.currentIndex != null && message.hasOwnProperty("currentIndex")) - if (!$util.isInteger(message.currentIndex)) - return "currentIndex: integer expected"; - if (message.validIndexes != null && message.hasOwnProperty("validIndexes")) { - if (!Array.isArray(message.validIndexes)) - return "validIndexes: array expected"; - for (var i = 0; i < message.validIndexes.length; ++i) - if (!$util.isInteger(message.validIndexes[i])) - return "validIndexes: integer[] expected"; - } + if (message.ephemeral != null && message.hasOwnProperty("ephemeral")) + if (!(message.ephemeral && typeof message.ephemeral.length === "number" || $util.isString(message.ephemeral))) + return "ephemeral: buffer expected"; + if (message["static"] != null && message.hasOwnProperty("static")) + if (!(message["static"] && typeof message["static"].length === "number" || $util.isString(message["static"]))) + return "static: buffer expected"; + if (message.payload != null && message.hasOwnProperty("payload")) + if (!(message.payload && typeof message.payload.length === "number" || $util.isString(message.payload))) + return "payload: buffer expected"; return null; }; /** - * Creates a ADVKeyIndexList message from a plain object. Also converts values to their respective internal types. + * Creates a ClientHello message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof proto.ADVKeyIndexList + * @memberof proto.ClientHello * @static * @param {Object.} object Plain object - * @returns {proto.ADVKeyIndexList} ADVKeyIndexList + * @returns {proto.ClientHello} ClientHello */ - ADVKeyIndexList.fromObject = function fromObject(object) { - if (object instanceof $root.proto.ADVKeyIndexList) + ClientHello.fromObject = function fromObject(object) { + if (object instanceof $root.proto.ClientHello) return object; - var message = new $root.proto.ADVKeyIndexList(); - if (object.rawId != null) - message.rawId = object.rawId >>> 0; - if (object.timestamp != null) - if ($util.Long) - (message.timestamp = $util.Long.fromValue(object.timestamp)).unsigned = true; - else if (typeof object.timestamp === "string") - message.timestamp = parseInt(object.timestamp, 10); - else if (typeof object.timestamp === "number") - message.timestamp = object.timestamp; - else if (typeof object.timestamp === "object") - message.timestamp = new $util.LongBits(object.timestamp.low >>> 0, object.timestamp.high >>> 0).toNumber(true); - if (object.currentIndex != null) - message.currentIndex = object.currentIndex >>> 0; - if (object.validIndexes) { - if (!Array.isArray(object.validIndexes)) - throw TypeError(".proto.ADVKeyIndexList.validIndexes: array expected"); - message.validIndexes = []; - for (var i = 0; i < object.validIndexes.length; ++i) - message.validIndexes[i] = object.validIndexes[i] >>> 0; - } + var message = new $root.proto.ClientHello(); + if (object.ephemeral != null) + if (typeof object.ephemeral === "string") + $util.base64.decode(object.ephemeral, message.ephemeral = $util.newBuffer($util.base64.length(object.ephemeral)), 0); + else if (object.ephemeral.length) + message.ephemeral = object.ephemeral; + if (object["static"] != null) + if (typeof object["static"] === "string") + $util.base64.decode(object["static"], message["static"] = $util.newBuffer($util.base64.length(object["static"])), 0); + else if (object["static"].length) + message["static"] = object["static"]; + if (object.payload != null) + if (typeof object.payload === "string") + $util.base64.decode(object.payload, message.payload = $util.newBuffer($util.base64.length(object.payload)), 0); + else if (object.payload.length) + message.payload = object.payload; return message; }; /** - * Creates a plain object from a ADVKeyIndexList message. Also converts values to other types if specified. + * Creates a plain object from a ClientHello message. Also converts values to other types if specified. * @function toObject - * @memberof proto.ADVKeyIndexList + * @memberof proto.ClientHello * @static - * @param {proto.ADVKeyIndexList} message ADVKeyIndexList + * @param {proto.ClientHello} message ClientHello * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ADVKeyIndexList.toObject = function toObject(message, options) { + ClientHello.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.validIndexes = []; if (options.defaults) { - object.rawId = 0; - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.timestamp = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.timestamp = options.longs === String ? "0" : 0; - object.currentIndex = 0; - } - if (message.rawId != null && message.hasOwnProperty("rawId")) - object.rawId = message.rawId; - if (message.timestamp != null && message.hasOwnProperty("timestamp")) - if (typeof message.timestamp === "number") - object.timestamp = options.longs === String ? String(message.timestamp) : message.timestamp; - else - object.timestamp = options.longs === String ? $util.Long.prototype.toString.call(message.timestamp) : options.longs === Number ? new $util.LongBits(message.timestamp.low >>> 0, message.timestamp.high >>> 0).toNumber(true) : message.timestamp; - if (message.currentIndex != null && message.hasOwnProperty("currentIndex")) - object.currentIndex = message.currentIndex; - if (message.validIndexes && message.validIndexes.length) { - object.validIndexes = []; - for (var j = 0; j < message.validIndexes.length; ++j) - object.validIndexes[j] = message.validIndexes[j]; + if (options.bytes === String) + object.ephemeral = ""; + else { + object.ephemeral = []; + if (options.bytes !== Array) + object.ephemeral = $util.newBuffer(object.ephemeral); + } + if (options.bytes === String) + object["static"] = ""; + else { + object["static"] = []; + if (options.bytes !== Array) + object["static"] = $util.newBuffer(object["static"]); + } + if (options.bytes === String) + object.payload = ""; + else { + object.payload = []; + if (options.bytes !== Array) + object.payload = $util.newBuffer(object.payload); + } } + if (message.ephemeral != null && message.hasOwnProperty("ephemeral")) + object.ephemeral = options.bytes === String ? $util.base64.encode(message.ephemeral, 0, message.ephemeral.length) : options.bytes === Array ? Array.prototype.slice.call(message.ephemeral) : message.ephemeral; + if (message["static"] != null && message.hasOwnProperty("static")) + object["static"] = options.bytes === String ? $util.base64.encode(message["static"], 0, message["static"].length) : options.bytes === Array ? Array.prototype.slice.call(message["static"]) : message["static"]; + if (message.payload != null && message.hasOwnProperty("payload")) + object.payload = options.bytes === String ? $util.base64.encode(message.payload, 0, message.payload.length) : options.bytes === Array ? Array.prototype.slice.call(message.payload) : message.payload; return object; }; /** - * Converts this ADVKeyIndexList to JSON. + * Converts this ClientHello to JSON. * @function toJSON - * @memberof proto.ADVKeyIndexList + * @memberof proto.ClientHello * @instance * @returns {Object.} JSON object */ - ADVKeyIndexList.prototype.toJSON = function toJSON() { + ClientHello.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ADVKeyIndexList; + return ClientHello; })(); - proto.MessageKey = (function() { + proto.ClientPayload = (function() { /** - * Properties of a MessageKey. + * Properties of a ClientPayload. * @memberof proto - * @interface IMessageKey - * @property {string|null} [remoteJid] MessageKey remoteJid - * @property {boolean|null} [fromMe] MessageKey fromMe - * @property {string|null} [id] MessageKey id - * @property {string|null} [participant] MessageKey participant + * @interface IClientPayload + * @property {number|Long|null} [username] ClientPayload username + * @property {boolean|null} [passive] ClientPayload passive + * @property {proto.IUserAgent|null} [userAgent] ClientPayload userAgent + * @property {proto.IWebInfo|null} [webInfo] ClientPayload webInfo + * @property {string|null} [pushName] ClientPayload pushName + * @property {number|null} [sessionId] ClientPayload sessionId + * @property {boolean|null} [shortConnect] ClientPayload shortConnect + * @property {proto.ClientPayload.ClientPayloadConnectType|null} [connectType] ClientPayload connectType + * @property {proto.ClientPayload.ClientPayloadConnectReason|null} [connectReason] ClientPayload connectReason + * @property {Array.|null} [shards] ClientPayload shards + * @property {proto.IDNSSource|null} [dnsSource] ClientPayload dnsSource + * @property {number|null} [connectAttemptCount] ClientPayload connectAttemptCount + * @property {number|null} [device] ClientPayload device + * @property {proto.ICompanionRegData|null} [regData] ClientPayload regData + * @property {proto.ClientPayload.ClientPayloadProduct|null} [product] ClientPayload product + * @property {Uint8Array|null} [fbCat] ClientPayload fbCat + * @property {Uint8Array|null} [fbUserAgent] ClientPayload fbUserAgent + * @property {boolean|null} [oc] ClientPayload oc + * @property {number|null} [lc] ClientPayload lc + * @property {proto.ClientPayload.ClientPayloadIOSAppExtension|null} [iosAppExtension] ClientPayload iosAppExtension + * @property {number|Long|null} [fbAppId] ClientPayload fbAppId + * @property {Uint8Array|null} [fbDeviceId] ClientPayload fbDeviceId + * @property {boolean|null} [pull] ClientPayload pull */ /** - * Constructs a new MessageKey. + * Constructs a new ClientPayload. * @memberof proto - * @classdesc Represents a MessageKey. - * @implements IMessageKey + * @classdesc Represents a ClientPayload. + * @implements IClientPayload * @constructor - * @param {proto.IMessageKey=} [properties] Properties to set + * @param {proto.IClientPayload=} [properties] Properties to set */ - function MessageKey(properties) { + function ClientPayload(properties) { + this.shards = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -52350,114 +50893,369 @@ $root.proto = (function() { } /** - * MessageKey remoteJid. - * @member {string} remoteJid - * @memberof proto.MessageKey + * ClientPayload username. + * @member {number|Long} username + * @memberof proto.ClientPayload * @instance */ - MessageKey.prototype.remoteJid = ""; + ClientPayload.prototype.username = $util.Long ? $util.Long.fromBits(0,0,true) : 0; /** - * MessageKey fromMe. - * @member {boolean} fromMe - * @memberof proto.MessageKey + * ClientPayload passive. + * @member {boolean} passive + * @memberof proto.ClientPayload * @instance */ - MessageKey.prototype.fromMe = false; + ClientPayload.prototype.passive = false; /** - * MessageKey id. - * @member {string} id - * @memberof proto.MessageKey + * ClientPayload userAgent. + * @member {proto.IUserAgent|null|undefined} userAgent + * @memberof proto.ClientPayload * @instance */ - MessageKey.prototype.id = ""; + ClientPayload.prototype.userAgent = null; /** - * MessageKey participant. - * @member {string} participant - * @memberof proto.MessageKey + * ClientPayload webInfo. + * @member {proto.IWebInfo|null|undefined} webInfo + * @memberof proto.ClientPayload * @instance */ - MessageKey.prototype.participant = ""; + ClientPayload.prototype.webInfo = null; /** - * Creates a new MessageKey instance using the specified properties. + * ClientPayload pushName. + * @member {string} pushName + * @memberof proto.ClientPayload + * @instance + */ + ClientPayload.prototype.pushName = ""; + + /** + * ClientPayload sessionId. + * @member {number} sessionId + * @memberof proto.ClientPayload + * @instance + */ + ClientPayload.prototype.sessionId = 0; + + /** + * ClientPayload shortConnect. + * @member {boolean} shortConnect + * @memberof proto.ClientPayload + * @instance + */ + ClientPayload.prototype.shortConnect = false; + + /** + * ClientPayload connectType. + * @member {proto.ClientPayload.ClientPayloadConnectType} connectType + * @memberof proto.ClientPayload + * @instance + */ + ClientPayload.prototype.connectType = 0; + + /** + * ClientPayload connectReason. + * @member {proto.ClientPayload.ClientPayloadConnectReason} connectReason + * @memberof proto.ClientPayload + * @instance + */ + ClientPayload.prototype.connectReason = 0; + + /** + * ClientPayload shards. + * @member {Array.} shards + * @memberof proto.ClientPayload + * @instance + */ + ClientPayload.prototype.shards = $util.emptyArray; + + /** + * ClientPayload dnsSource. + * @member {proto.IDNSSource|null|undefined} dnsSource + * @memberof proto.ClientPayload + * @instance + */ + ClientPayload.prototype.dnsSource = null; + + /** + * ClientPayload connectAttemptCount. + * @member {number} connectAttemptCount + * @memberof proto.ClientPayload + * @instance + */ + ClientPayload.prototype.connectAttemptCount = 0; + + /** + * ClientPayload device. + * @member {number} device + * @memberof proto.ClientPayload + * @instance + */ + ClientPayload.prototype.device = 0; + + /** + * ClientPayload regData. + * @member {proto.ICompanionRegData|null|undefined} regData + * @memberof proto.ClientPayload + * @instance + */ + ClientPayload.prototype.regData = null; + + /** + * ClientPayload product. + * @member {proto.ClientPayload.ClientPayloadProduct} product + * @memberof proto.ClientPayload + * @instance + */ + ClientPayload.prototype.product = 0; + + /** + * ClientPayload fbCat. + * @member {Uint8Array} fbCat + * @memberof proto.ClientPayload + * @instance + */ + ClientPayload.prototype.fbCat = $util.newBuffer([]); + + /** + * ClientPayload fbUserAgent. + * @member {Uint8Array} fbUserAgent + * @memberof proto.ClientPayload + * @instance + */ + ClientPayload.prototype.fbUserAgent = $util.newBuffer([]); + + /** + * ClientPayload oc. + * @member {boolean} oc + * @memberof proto.ClientPayload + * @instance + */ + ClientPayload.prototype.oc = false; + + /** + * ClientPayload lc. + * @member {number} lc + * @memberof proto.ClientPayload + * @instance + */ + ClientPayload.prototype.lc = 0; + + /** + * ClientPayload iosAppExtension. + * @member {proto.ClientPayload.ClientPayloadIOSAppExtension} iosAppExtension + * @memberof proto.ClientPayload + * @instance + */ + ClientPayload.prototype.iosAppExtension = 0; + + /** + * ClientPayload fbAppId. + * @member {number|Long} fbAppId + * @memberof proto.ClientPayload + * @instance + */ + ClientPayload.prototype.fbAppId = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * ClientPayload fbDeviceId. + * @member {Uint8Array} fbDeviceId + * @memberof proto.ClientPayload + * @instance + */ + ClientPayload.prototype.fbDeviceId = $util.newBuffer([]); + + /** + * ClientPayload pull. + * @member {boolean} pull + * @memberof proto.ClientPayload + * @instance + */ + ClientPayload.prototype.pull = false; + + /** + * Creates a new ClientPayload instance using the specified properties. * @function create - * @memberof proto.MessageKey + * @memberof proto.ClientPayload * @static - * @param {proto.IMessageKey=} [properties] Properties to set - * @returns {proto.MessageKey} MessageKey instance + * @param {proto.IClientPayload=} [properties] Properties to set + * @returns {proto.ClientPayload} ClientPayload instance */ - MessageKey.create = function create(properties) { - return new MessageKey(properties); + ClientPayload.create = function create(properties) { + return new ClientPayload(properties); }; /** - * Encodes the specified MessageKey message. Does not implicitly {@link proto.MessageKey.verify|verify} messages. + * Encodes the specified ClientPayload message. Does not implicitly {@link proto.ClientPayload.verify|verify} messages. * @function encode - * @memberof proto.MessageKey + * @memberof proto.ClientPayload * @static - * @param {proto.IMessageKey} message MessageKey message or plain object to encode + * @param {proto.IClientPayload} message ClientPayload message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - MessageKey.encode = function encode(message, writer) { + ClientPayload.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.remoteJid != null && Object.hasOwnProperty.call(message, "remoteJid")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.remoteJid); - if (message.fromMe != null && Object.hasOwnProperty.call(message, "fromMe")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.fromMe); - if (message.id != null && Object.hasOwnProperty.call(message, "id")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.id); - if (message.participant != null && Object.hasOwnProperty.call(message, "participant")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.participant); + if (message.username != null && Object.hasOwnProperty.call(message, "username")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.username); + if (message.passive != null && Object.hasOwnProperty.call(message, "passive")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.passive); + if (message.userAgent != null && Object.hasOwnProperty.call(message, "userAgent")) + $root.proto.UserAgent.encode(message.userAgent, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.webInfo != null && Object.hasOwnProperty.call(message, "webInfo")) + $root.proto.WebInfo.encode(message.webInfo, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.pushName != null && Object.hasOwnProperty.call(message, "pushName")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.pushName); + if (message.sessionId != null && Object.hasOwnProperty.call(message, "sessionId")) + writer.uint32(/* id 9, wireType 5 =*/77).sfixed32(message.sessionId); + if (message.shortConnect != null && Object.hasOwnProperty.call(message, "shortConnect")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.shortConnect); + if (message.connectType != null && Object.hasOwnProperty.call(message, "connectType")) + writer.uint32(/* id 12, wireType 0 =*/96).int32(message.connectType); + if (message.connectReason != null && Object.hasOwnProperty.call(message, "connectReason")) + writer.uint32(/* id 13, wireType 0 =*/104).int32(message.connectReason); + if (message.shards != null && message.shards.length) + for (var i = 0; i < message.shards.length; ++i) + writer.uint32(/* id 14, wireType 0 =*/112).int32(message.shards[i]); + if (message.dnsSource != null && Object.hasOwnProperty.call(message, "dnsSource")) + $root.proto.DNSSource.encode(message.dnsSource, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); + if (message.connectAttemptCount != null && Object.hasOwnProperty.call(message, "connectAttemptCount")) + writer.uint32(/* id 16, wireType 0 =*/128).uint32(message.connectAttemptCount); + if (message.device != null && Object.hasOwnProperty.call(message, "device")) + writer.uint32(/* id 18, wireType 0 =*/144).uint32(message.device); + if (message.regData != null && Object.hasOwnProperty.call(message, "regData")) + $root.proto.CompanionRegData.encode(message.regData, writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim(); + if (message.product != null && Object.hasOwnProperty.call(message, "product")) + writer.uint32(/* id 20, wireType 0 =*/160).int32(message.product); + if (message.fbCat != null && Object.hasOwnProperty.call(message, "fbCat")) + writer.uint32(/* id 21, wireType 2 =*/170).bytes(message.fbCat); + if (message.fbUserAgent != null && Object.hasOwnProperty.call(message, "fbUserAgent")) + writer.uint32(/* id 22, wireType 2 =*/178).bytes(message.fbUserAgent); + if (message.oc != null && Object.hasOwnProperty.call(message, "oc")) + writer.uint32(/* id 23, wireType 0 =*/184).bool(message.oc); + if (message.lc != null && Object.hasOwnProperty.call(message, "lc")) + writer.uint32(/* id 24, wireType 0 =*/192).int32(message.lc); + if (message.iosAppExtension != null && Object.hasOwnProperty.call(message, "iosAppExtension")) + writer.uint32(/* id 30, wireType 0 =*/240).int32(message.iosAppExtension); + if (message.fbAppId != null && Object.hasOwnProperty.call(message, "fbAppId")) + writer.uint32(/* id 31, wireType 0 =*/248).uint64(message.fbAppId); + if (message.fbDeviceId != null && Object.hasOwnProperty.call(message, "fbDeviceId")) + writer.uint32(/* id 32, wireType 2 =*/258).bytes(message.fbDeviceId); + if (message.pull != null && Object.hasOwnProperty.call(message, "pull")) + writer.uint32(/* id 33, wireType 0 =*/264).bool(message.pull); return writer; }; /** - * Encodes the specified MessageKey message, length delimited. Does not implicitly {@link proto.MessageKey.verify|verify} messages. + * Encodes the specified ClientPayload message, length delimited. Does not implicitly {@link proto.ClientPayload.verify|verify} messages. * @function encodeDelimited - * @memberof proto.MessageKey + * @memberof proto.ClientPayload * @static - * @param {proto.IMessageKey} message MessageKey message or plain object to encode + * @param {proto.IClientPayload} message ClientPayload message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - MessageKey.encodeDelimited = function encodeDelimited(message, writer) { + ClientPayload.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a MessageKey message from the specified reader or buffer. + * Decodes a ClientPayload message from the specified reader or buffer. * @function decode - * @memberof proto.MessageKey + * @memberof proto.ClientPayload * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {proto.MessageKey} MessageKey + * @returns {proto.ClientPayload} ClientPayload * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - MessageKey.decode = function decode(reader, length) { + ClientPayload.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.MessageKey(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.ClientPayload(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.remoteJid = reader.string(); - break; - case 2: - message.fromMe = reader.bool(); + message.username = reader.uint64(); break; case 3: - message.id = reader.string(); + message.passive = reader.bool(); break; - case 4: - message.participant = reader.string(); + case 5: + message.userAgent = $root.proto.UserAgent.decode(reader, reader.uint32()); + break; + case 6: + message.webInfo = $root.proto.WebInfo.decode(reader, reader.uint32()); + break; + case 7: + message.pushName = reader.string(); + break; + case 9: + message.sessionId = reader.sfixed32(); + break; + case 10: + message.shortConnect = reader.bool(); + break; + case 12: + message.connectType = reader.int32(); + break; + case 13: + message.connectReason = reader.int32(); + break; + case 14: + if (!(message.shards && message.shards.length)) + message.shards = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.shards.push(reader.int32()); + } else + message.shards.push(reader.int32()); + break; + case 15: + message.dnsSource = $root.proto.DNSSource.decode(reader, reader.uint32()); + break; + case 16: + message.connectAttemptCount = reader.uint32(); + break; + case 18: + message.device = reader.uint32(); + break; + case 19: + message.regData = $root.proto.CompanionRegData.decode(reader, reader.uint32()); + break; + case 20: + message.product = reader.int32(); + break; + case 21: + message.fbCat = reader.bytes(); + break; + case 22: + message.fbUserAgent = reader.bytes(); + break; + case 23: + message.oc = reader.bool(); + break; + case 24: + message.lc = reader.int32(); + break; + case 30: + message.iosAppExtension = reader.int32(); + break; + case 31: + message.fbAppId = reader.uint64(); + break; + case 32: + message.fbDeviceId = reader.bytes(); + break; + case 33: + message.pull = reader.bool(); break; default: reader.skipType(tag & 7); @@ -52468,136 +51266,613 @@ $root.proto = (function() { }; /** - * Decodes a MessageKey message from the specified reader or buffer, length delimited. + * Decodes a ClientPayload message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof proto.MessageKey + * @memberof proto.ClientPayload * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.MessageKey} MessageKey + * @returns {proto.ClientPayload} ClientPayload * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - MessageKey.decodeDelimited = function decodeDelimited(reader) { + ClientPayload.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a MessageKey message. + * Verifies a ClientPayload message. * @function verify - * @memberof proto.MessageKey + * @memberof proto.ClientPayload * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - MessageKey.verify = function verify(message) { + ClientPayload.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.remoteJid != null && message.hasOwnProperty("remoteJid")) - if (!$util.isString(message.remoteJid)) - return "remoteJid: string expected"; - if (message.fromMe != null && message.hasOwnProperty("fromMe")) - if (typeof message.fromMe !== "boolean") - return "fromMe: boolean expected"; - if (message.id != null && message.hasOwnProperty("id")) - if (!$util.isString(message.id)) - return "id: string expected"; - if (message.participant != null && message.hasOwnProperty("participant")) - if (!$util.isString(message.participant)) - return "participant: string expected"; - return null; - }; - - /** - * Creates a MessageKey message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof proto.MessageKey - * @static - * @param {Object.} object Plain object - * @returns {proto.MessageKey} MessageKey - */ - MessageKey.fromObject = function fromObject(object) { - if (object instanceof $root.proto.MessageKey) + if (message.username != null && message.hasOwnProperty("username")) + if (!$util.isInteger(message.username) && !(message.username && $util.isInteger(message.username.low) && $util.isInteger(message.username.high))) + return "username: integer|Long expected"; + if (message.passive != null && message.hasOwnProperty("passive")) + if (typeof message.passive !== "boolean") + return "passive: boolean expected"; + if (message.userAgent != null && message.hasOwnProperty("userAgent")) { + var error = $root.proto.UserAgent.verify(message.userAgent); + if (error) + return "userAgent." + error; + } + if (message.webInfo != null && message.hasOwnProperty("webInfo")) { + var error = $root.proto.WebInfo.verify(message.webInfo); + if (error) + return "webInfo." + error; + } + if (message.pushName != null && message.hasOwnProperty("pushName")) + if (!$util.isString(message.pushName)) + return "pushName: string expected"; + if (message.sessionId != null && message.hasOwnProperty("sessionId")) + if (!$util.isInteger(message.sessionId)) + return "sessionId: integer expected"; + if (message.shortConnect != null && message.hasOwnProperty("shortConnect")) + if (typeof message.shortConnect !== "boolean") + return "shortConnect: boolean expected"; + if (message.connectType != null && message.hasOwnProperty("connectType")) + switch (message.connectType) { + default: + return "connectType: enum value expected"; + case 0: + case 1: + case 100: + case 101: + case 102: + case 103: + case 104: + case 105: + case 106: + case 107: + case 108: + case 109: + case 110: + case 111: + case 112: + break; + } + if (message.connectReason != null && message.hasOwnProperty("connectReason")) + switch (message.connectReason) { + default: + return "connectReason: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.shards != null && message.hasOwnProperty("shards")) { + if (!Array.isArray(message.shards)) + return "shards: array expected"; + for (var i = 0; i < message.shards.length; ++i) + if (!$util.isInteger(message.shards[i])) + return "shards: integer[] expected"; + } + if (message.dnsSource != null && message.hasOwnProperty("dnsSource")) { + var error = $root.proto.DNSSource.verify(message.dnsSource); + if (error) + return "dnsSource." + error; + } + if (message.connectAttemptCount != null && message.hasOwnProperty("connectAttemptCount")) + if (!$util.isInteger(message.connectAttemptCount)) + return "connectAttemptCount: integer expected"; + if (message.device != null && message.hasOwnProperty("device")) + if (!$util.isInteger(message.device)) + return "device: integer expected"; + if (message.regData != null && message.hasOwnProperty("regData")) { + var error = $root.proto.CompanionRegData.verify(message.regData); + if (error) + return "regData." + error; + } + if (message.product != null && message.hasOwnProperty("product")) + switch (message.product) { + default: + return "product: enum value expected"; + case 0: + case 1: + break; + } + if (message.fbCat != null && message.hasOwnProperty("fbCat")) + if (!(message.fbCat && typeof message.fbCat.length === "number" || $util.isString(message.fbCat))) + return "fbCat: buffer expected"; + if (message.fbUserAgent != null && message.hasOwnProperty("fbUserAgent")) + if (!(message.fbUserAgent && typeof message.fbUserAgent.length === "number" || $util.isString(message.fbUserAgent))) + return "fbUserAgent: buffer expected"; + if (message.oc != null && message.hasOwnProperty("oc")) + if (typeof message.oc !== "boolean") + return "oc: boolean expected"; + if (message.lc != null && message.hasOwnProperty("lc")) + if (!$util.isInteger(message.lc)) + return "lc: integer expected"; + if (message.iosAppExtension != null && message.hasOwnProperty("iosAppExtension")) + switch (message.iosAppExtension) { + default: + return "iosAppExtension: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.fbAppId != null && message.hasOwnProperty("fbAppId")) + if (!$util.isInteger(message.fbAppId) && !(message.fbAppId && $util.isInteger(message.fbAppId.low) && $util.isInteger(message.fbAppId.high))) + return "fbAppId: integer|Long expected"; + if (message.fbDeviceId != null && message.hasOwnProperty("fbDeviceId")) + if (!(message.fbDeviceId && typeof message.fbDeviceId.length === "number" || $util.isString(message.fbDeviceId))) + return "fbDeviceId: buffer expected"; + if (message.pull != null && message.hasOwnProperty("pull")) + if (typeof message.pull !== "boolean") + return "pull: boolean expected"; + return null; + }; + + /** + * Creates a ClientPayload message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof proto.ClientPayload + * @static + * @param {Object.} object Plain object + * @returns {proto.ClientPayload} ClientPayload + */ + ClientPayload.fromObject = function fromObject(object) { + if (object instanceof $root.proto.ClientPayload) return object; - var message = new $root.proto.MessageKey(); - if (object.remoteJid != null) - message.remoteJid = String(object.remoteJid); - if (object.fromMe != null) - message.fromMe = Boolean(object.fromMe); - if (object.id != null) - message.id = String(object.id); - if (object.participant != null) - message.participant = String(object.participant); + var message = new $root.proto.ClientPayload(); + if (object.username != null) + if ($util.Long) + (message.username = $util.Long.fromValue(object.username)).unsigned = true; + else if (typeof object.username === "string") + message.username = parseInt(object.username, 10); + else if (typeof object.username === "number") + message.username = object.username; + else if (typeof object.username === "object") + message.username = new $util.LongBits(object.username.low >>> 0, object.username.high >>> 0).toNumber(true); + if (object.passive != null) + message.passive = Boolean(object.passive); + if (object.userAgent != null) { + if (typeof object.userAgent !== "object") + throw TypeError(".proto.ClientPayload.userAgent: object expected"); + message.userAgent = $root.proto.UserAgent.fromObject(object.userAgent); + } + if (object.webInfo != null) { + if (typeof object.webInfo !== "object") + throw TypeError(".proto.ClientPayload.webInfo: object expected"); + message.webInfo = $root.proto.WebInfo.fromObject(object.webInfo); + } + if (object.pushName != null) + message.pushName = String(object.pushName); + if (object.sessionId != null) + message.sessionId = object.sessionId | 0; + if (object.shortConnect != null) + message.shortConnect = Boolean(object.shortConnect); + switch (object.connectType) { + case "CELLULAR_UNKNOWN": + case 0: + message.connectType = 0; + break; + case "WIFI_UNKNOWN": + case 1: + message.connectType = 1; + break; + case "CELLULAR_EDGE": + case 100: + message.connectType = 100; + break; + case "CELLULAR_IDEN": + case 101: + message.connectType = 101; + break; + case "CELLULAR_UMTS": + case 102: + message.connectType = 102; + break; + case "CELLULAR_EVDO": + case 103: + message.connectType = 103; + break; + case "CELLULAR_GPRS": + case 104: + message.connectType = 104; + break; + case "CELLULAR_HSDPA": + case 105: + message.connectType = 105; + break; + case "CELLULAR_HSUPA": + case 106: + message.connectType = 106; + break; + case "CELLULAR_HSPA": + case 107: + message.connectType = 107; + break; + case "CELLULAR_CDMA": + case 108: + message.connectType = 108; + break; + case "CELLULAR_1XRTT": + case 109: + message.connectType = 109; + break; + case "CELLULAR_EHRPD": + case 110: + message.connectType = 110; + break; + case "CELLULAR_LTE": + case 111: + message.connectType = 111; + break; + case "CELLULAR_HSPAP": + case 112: + message.connectType = 112; + break; + } + switch (object.connectReason) { + case "PUSH": + case 0: + message.connectReason = 0; + break; + case "USER_ACTIVATED": + case 1: + message.connectReason = 1; + break; + case "SCHEDULED": + case 2: + message.connectReason = 2; + break; + case "ERROR_RECONNECT": + case 3: + message.connectReason = 3; + break; + case "NETWORK_SWITCH": + case 4: + message.connectReason = 4; + break; + case "PING_RECONNECT": + case 5: + message.connectReason = 5; + break; + } + if (object.shards) { + if (!Array.isArray(object.shards)) + throw TypeError(".proto.ClientPayload.shards: array expected"); + message.shards = []; + for (var i = 0; i < object.shards.length; ++i) + message.shards[i] = object.shards[i] | 0; + } + if (object.dnsSource != null) { + if (typeof object.dnsSource !== "object") + throw TypeError(".proto.ClientPayload.dnsSource: object expected"); + message.dnsSource = $root.proto.DNSSource.fromObject(object.dnsSource); + } + if (object.connectAttemptCount != null) + message.connectAttemptCount = object.connectAttemptCount >>> 0; + if (object.device != null) + message.device = object.device >>> 0; + if (object.regData != null) { + if (typeof object.regData !== "object") + throw TypeError(".proto.ClientPayload.regData: object expected"); + message.regData = $root.proto.CompanionRegData.fromObject(object.regData); + } + switch (object.product) { + case "WHATSAPP": + case 0: + message.product = 0; + break; + case "MESSENGER": + case 1: + message.product = 1; + break; + } + if (object.fbCat != null) + if (typeof object.fbCat === "string") + $util.base64.decode(object.fbCat, message.fbCat = $util.newBuffer($util.base64.length(object.fbCat)), 0); + else if (object.fbCat.length) + message.fbCat = object.fbCat; + if (object.fbUserAgent != null) + if (typeof object.fbUserAgent === "string") + $util.base64.decode(object.fbUserAgent, message.fbUserAgent = $util.newBuffer($util.base64.length(object.fbUserAgent)), 0); + else if (object.fbUserAgent.length) + message.fbUserAgent = object.fbUserAgent; + if (object.oc != null) + message.oc = Boolean(object.oc); + if (object.lc != null) + message.lc = object.lc | 0; + switch (object.iosAppExtension) { + case "SHARE_EXTENSION": + case 0: + message.iosAppExtension = 0; + break; + case "SERVICE_EXTENSION": + case 1: + message.iosAppExtension = 1; + break; + case "INTENTS_EXTENSION": + case 2: + message.iosAppExtension = 2; + break; + } + if (object.fbAppId != null) + if ($util.Long) + (message.fbAppId = $util.Long.fromValue(object.fbAppId)).unsigned = true; + else if (typeof object.fbAppId === "string") + message.fbAppId = parseInt(object.fbAppId, 10); + else if (typeof object.fbAppId === "number") + message.fbAppId = object.fbAppId; + else if (typeof object.fbAppId === "object") + message.fbAppId = new $util.LongBits(object.fbAppId.low >>> 0, object.fbAppId.high >>> 0).toNumber(true); + if (object.fbDeviceId != null) + if (typeof object.fbDeviceId === "string") + $util.base64.decode(object.fbDeviceId, message.fbDeviceId = $util.newBuffer($util.base64.length(object.fbDeviceId)), 0); + else if (object.fbDeviceId.length) + message.fbDeviceId = object.fbDeviceId; + if (object.pull != null) + message.pull = Boolean(object.pull); return message; }; /** - * Creates a plain object from a MessageKey message. Also converts values to other types if specified. + * Creates a plain object from a ClientPayload message. Also converts values to other types if specified. * @function toObject - * @memberof proto.MessageKey + * @memberof proto.ClientPayload * @static - * @param {proto.MessageKey} message MessageKey + * @param {proto.ClientPayload} message ClientPayload * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - MessageKey.toObject = function toObject(message, options) { + ClientPayload.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.shards = []; if (options.defaults) { - object.remoteJid = ""; - object.fromMe = false; - object.id = ""; - object.participant = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.username = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.username = options.longs === String ? "0" : 0; + object.passive = false; + object.userAgent = null; + object.webInfo = null; + object.pushName = ""; + object.sessionId = 0; + object.shortConnect = false; + object.connectType = options.enums === String ? "CELLULAR_UNKNOWN" : 0; + object.connectReason = options.enums === String ? "PUSH" : 0; + object.dnsSource = null; + object.connectAttemptCount = 0; + object.device = 0; + object.regData = null; + object.product = options.enums === String ? "WHATSAPP" : 0; + if (options.bytes === String) + object.fbCat = ""; + else { + object.fbCat = []; + if (options.bytes !== Array) + object.fbCat = $util.newBuffer(object.fbCat); + } + if (options.bytes === String) + object.fbUserAgent = ""; + else { + object.fbUserAgent = []; + if (options.bytes !== Array) + object.fbUserAgent = $util.newBuffer(object.fbUserAgent); + } + object.oc = false; + object.lc = 0; + object.iosAppExtension = options.enums === String ? "SHARE_EXTENSION" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.fbAppId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.fbAppId = options.longs === String ? "0" : 0; + if (options.bytes === String) + object.fbDeviceId = ""; + else { + object.fbDeviceId = []; + if (options.bytes !== Array) + object.fbDeviceId = $util.newBuffer(object.fbDeviceId); + } + object.pull = false; } - if (message.remoteJid != null && message.hasOwnProperty("remoteJid")) - object.remoteJid = message.remoteJid; - if (message.fromMe != null && message.hasOwnProperty("fromMe")) - object.fromMe = message.fromMe; - if (message.id != null && message.hasOwnProperty("id")) - object.id = message.id; - if (message.participant != null && message.hasOwnProperty("participant")) - object.participant = message.participant; + if (message.username != null && message.hasOwnProperty("username")) + if (typeof message.username === "number") + object.username = options.longs === String ? String(message.username) : message.username; + else + object.username = options.longs === String ? $util.Long.prototype.toString.call(message.username) : options.longs === Number ? new $util.LongBits(message.username.low >>> 0, message.username.high >>> 0).toNumber(true) : message.username; + if (message.passive != null && message.hasOwnProperty("passive")) + object.passive = message.passive; + if (message.userAgent != null && message.hasOwnProperty("userAgent")) + object.userAgent = $root.proto.UserAgent.toObject(message.userAgent, options); + if (message.webInfo != null && message.hasOwnProperty("webInfo")) + object.webInfo = $root.proto.WebInfo.toObject(message.webInfo, options); + if (message.pushName != null && message.hasOwnProperty("pushName")) + object.pushName = message.pushName; + if (message.sessionId != null && message.hasOwnProperty("sessionId")) + object.sessionId = message.sessionId; + if (message.shortConnect != null && message.hasOwnProperty("shortConnect")) + object.shortConnect = message.shortConnect; + if (message.connectType != null && message.hasOwnProperty("connectType")) + object.connectType = options.enums === String ? $root.proto.ClientPayload.ClientPayloadConnectType[message.connectType] : message.connectType; + if (message.connectReason != null && message.hasOwnProperty("connectReason")) + object.connectReason = options.enums === String ? $root.proto.ClientPayload.ClientPayloadConnectReason[message.connectReason] : message.connectReason; + if (message.shards && message.shards.length) { + object.shards = []; + for (var j = 0; j < message.shards.length; ++j) + object.shards[j] = message.shards[j]; + } + if (message.dnsSource != null && message.hasOwnProperty("dnsSource")) + object.dnsSource = $root.proto.DNSSource.toObject(message.dnsSource, options); + if (message.connectAttemptCount != null && message.hasOwnProperty("connectAttemptCount")) + object.connectAttemptCount = message.connectAttemptCount; + if (message.device != null && message.hasOwnProperty("device")) + object.device = message.device; + if (message.regData != null && message.hasOwnProperty("regData")) + object.regData = $root.proto.CompanionRegData.toObject(message.regData, options); + if (message.product != null && message.hasOwnProperty("product")) + object.product = options.enums === String ? $root.proto.ClientPayload.ClientPayloadProduct[message.product] : message.product; + if (message.fbCat != null && message.hasOwnProperty("fbCat")) + object.fbCat = options.bytes === String ? $util.base64.encode(message.fbCat, 0, message.fbCat.length) : options.bytes === Array ? Array.prototype.slice.call(message.fbCat) : message.fbCat; + if (message.fbUserAgent != null && message.hasOwnProperty("fbUserAgent")) + object.fbUserAgent = options.bytes === String ? $util.base64.encode(message.fbUserAgent, 0, message.fbUserAgent.length) : options.bytes === Array ? Array.prototype.slice.call(message.fbUserAgent) : message.fbUserAgent; + if (message.oc != null && message.hasOwnProperty("oc")) + object.oc = message.oc; + if (message.lc != null && message.hasOwnProperty("lc")) + object.lc = message.lc; + if (message.iosAppExtension != null && message.hasOwnProperty("iosAppExtension")) + object.iosAppExtension = options.enums === String ? $root.proto.ClientPayload.ClientPayloadIOSAppExtension[message.iosAppExtension] : message.iosAppExtension; + if (message.fbAppId != null && message.hasOwnProperty("fbAppId")) + if (typeof message.fbAppId === "number") + object.fbAppId = options.longs === String ? String(message.fbAppId) : message.fbAppId; + else + object.fbAppId = options.longs === String ? $util.Long.prototype.toString.call(message.fbAppId) : options.longs === Number ? new $util.LongBits(message.fbAppId.low >>> 0, message.fbAppId.high >>> 0).toNumber(true) : message.fbAppId; + if (message.fbDeviceId != null && message.hasOwnProperty("fbDeviceId")) + object.fbDeviceId = options.bytes === String ? $util.base64.encode(message.fbDeviceId, 0, message.fbDeviceId.length) : options.bytes === Array ? Array.prototype.slice.call(message.fbDeviceId) : message.fbDeviceId; + if (message.pull != null && message.hasOwnProperty("pull")) + object.pull = message.pull; return object; }; /** - * Converts this MessageKey to JSON. + * Converts this ClientPayload to JSON. * @function toJSON - * @memberof proto.MessageKey + * @memberof proto.ClientPayload * @instance * @returns {Object.} JSON object */ - MessageKey.prototype.toJSON = function toJSON() { + ClientPayload.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return MessageKey; - })(); - - proto.Reaction = (function() { - /** - * Properties of a Reaction. - * @memberof proto - * @interface IReaction - * @property {proto.IMessageKey|null} [key] Reaction key - * @property {string|null} [text] Reaction text - * @property {string|null} [groupingKey] Reaction groupingKey - * @property {number|Long|null} [senderTimestampMs] Reaction senderTimestampMs - * @property {boolean|null} [unread] Reaction unread + * ClientPayloadConnectType enum. + * @name proto.ClientPayload.ClientPayloadConnectType + * @enum {number} + * @property {number} CELLULAR_UNKNOWN=0 CELLULAR_UNKNOWN value + * @property {number} WIFI_UNKNOWN=1 WIFI_UNKNOWN value + * @property {number} CELLULAR_EDGE=100 CELLULAR_EDGE value + * @property {number} CELLULAR_IDEN=101 CELLULAR_IDEN value + * @property {number} CELLULAR_UMTS=102 CELLULAR_UMTS value + * @property {number} CELLULAR_EVDO=103 CELLULAR_EVDO value + * @property {number} CELLULAR_GPRS=104 CELLULAR_GPRS value + * @property {number} CELLULAR_HSDPA=105 CELLULAR_HSDPA value + * @property {number} CELLULAR_HSUPA=106 CELLULAR_HSUPA value + * @property {number} CELLULAR_HSPA=107 CELLULAR_HSPA value + * @property {number} CELLULAR_CDMA=108 CELLULAR_CDMA value + * @property {number} CELLULAR_1XRTT=109 CELLULAR_1XRTT value + * @property {number} CELLULAR_EHRPD=110 CELLULAR_EHRPD value + * @property {number} CELLULAR_LTE=111 CELLULAR_LTE value + * @property {number} CELLULAR_HSPAP=112 CELLULAR_HSPAP value */ + ClientPayload.ClientPayloadConnectType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CELLULAR_UNKNOWN"] = 0; + values[valuesById[1] = "WIFI_UNKNOWN"] = 1; + values[valuesById[100] = "CELLULAR_EDGE"] = 100; + values[valuesById[101] = "CELLULAR_IDEN"] = 101; + values[valuesById[102] = "CELLULAR_UMTS"] = 102; + values[valuesById[103] = "CELLULAR_EVDO"] = 103; + values[valuesById[104] = "CELLULAR_GPRS"] = 104; + values[valuesById[105] = "CELLULAR_HSDPA"] = 105; + values[valuesById[106] = "CELLULAR_HSUPA"] = 106; + values[valuesById[107] = "CELLULAR_HSPA"] = 107; + values[valuesById[108] = "CELLULAR_CDMA"] = 108; + values[valuesById[109] = "CELLULAR_1XRTT"] = 109; + values[valuesById[110] = "CELLULAR_EHRPD"] = 110; + values[valuesById[111] = "CELLULAR_LTE"] = 111; + values[valuesById[112] = "CELLULAR_HSPAP"] = 112; + return values; + })(); /** - * Constructs a new Reaction. - * @memberof proto - * @classdesc Represents a Reaction. - * @implements IReaction - * @constructor - * @param {proto.IReaction=} [properties] Properties to set + * ClientPayloadConnectReason enum. + * @name proto.ClientPayload.ClientPayloadConnectReason + * @enum {number} + * @property {number} PUSH=0 PUSH value + * @property {number} USER_ACTIVATED=1 USER_ACTIVATED value + * @property {number} SCHEDULED=2 SCHEDULED value + * @property {number} ERROR_RECONNECT=3 ERROR_RECONNECT value + * @property {number} NETWORK_SWITCH=4 NETWORK_SWITCH value + * @property {number} PING_RECONNECT=5 PING_RECONNECT value */ - function Reaction(properties) { + ClientPayload.ClientPayloadConnectReason = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "PUSH"] = 0; + values[valuesById[1] = "USER_ACTIVATED"] = 1; + values[valuesById[2] = "SCHEDULED"] = 2; + values[valuesById[3] = "ERROR_RECONNECT"] = 3; + values[valuesById[4] = "NETWORK_SWITCH"] = 4; + values[valuesById[5] = "PING_RECONNECT"] = 5; + return values; + })(); + + /** + * ClientPayloadProduct enum. + * @name proto.ClientPayload.ClientPayloadProduct + * @enum {number} + * @property {number} WHATSAPP=0 WHATSAPP value + * @property {number} MESSENGER=1 MESSENGER value + */ + ClientPayload.ClientPayloadProduct = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "WHATSAPP"] = 0; + values[valuesById[1] = "MESSENGER"] = 1; + return values; + })(); + + /** + * ClientPayloadIOSAppExtension enum. + * @name proto.ClientPayload.ClientPayloadIOSAppExtension + * @enum {number} + * @property {number} SHARE_EXTENSION=0 SHARE_EXTENSION value + * @property {number} SERVICE_EXTENSION=1 SERVICE_EXTENSION value + * @property {number} INTENTS_EXTENSION=2 INTENTS_EXTENSION value + */ + ClientPayload.ClientPayloadIOSAppExtension = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SHARE_EXTENSION"] = 0; + values[valuesById[1] = "SERVICE_EXTENSION"] = 1; + values[valuesById[2] = "INTENTS_EXTENSION"] = 2; + return values; + })(); + + return ClientPayload; + })(); + + proto.CompanionRegData = (function() { + + /** + * Properties of a CompanionRegData. + * @memberof proto + * @interface ICompanionRegData + * @property {Uint8Array|null} [eRegid] CompanionRegData eRegid + * @property {Uint8Array|null} [eKeytype] CompanionRegData eKeytype + * @property {Uint8Array|null} [eIdent] CompanionRegData eIdent + * @property {Uint8Array|null} [eSkeyId] CompanionRegData eSkeyId + * @property {Uint8Array|null} [eSkeyVal] CompanionRegData eSkeyVal + * @property {Uint8Array|null} [eSkeySig] CompanionRegData eSkeySig + * @property {Uint8Array|null} [buildHash] CompanionRegData buildHash + * @property {Uint8Array|null} [companionProps] CompanionRegData companionProps + */ + + /** + * Constructs a new CompanionRegData. + * @memberof proto + * @classdesc Represents a CompanionRegData. + * @implements ICompanionRegData + * @constructor + * @param {proto.ICompanionRegData=} [properties] Properties to set + */ + function CompanionRegData(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -52605,127 +51880,166 @@ $root.proto = (function() { } /** - * Reaction key. - * @member {proto.IMessageKey|null|undefined} key - * @memberof proto.Reaction + * CompanionRegData eRegid. + * @member {Uint8Array} eRegid + * @memberof proto.CompanionRegData * @instance */ - Reaction.prototype.key = null; + CompanionRegData.prototype.eRegid = $util.newBuffer([]); /** - * Reaction text. - * @member {string} text - * @memberof proto.Reaction + * CompanionRegData eKeytype. + * @member {Uint8Array} eKeytype + * @memberof proto.CompanionRegData * @instance */ - Reaction.prototype.text = ""; + CompanionRegData.prototype.eKeytype = $util.newBuffer([]); /** - * Reaction groupingKey. - * @member {string} groupingKey - * @memberof proto.Reaction + * CompanionRegData eIdent. + * @member {Uint8Array} eIdent + * @memberof proto.CompanionRegData * @instance */ - Reaction.prototype.groupingKey = ""; + CompanionRegData.prototype.eIdent = $util.newBuffer([]); /** - * Reaction senderTimestampMs. - * @member {number|Long} senderTimestampMs - * @memberof proto.Reaction + * CompanionRegData eSkeyId. + * @member {Uint8Array} eSkeyId + * @memberof proto.CompanionRegData * @instance */ - Reaction.prototype.senderTimestampMs = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + CompanionRegData.prototype.eSkeyId = $util.newBuffer([]); /** - * Reaction unread. - * @member {boolean} unread - * @memberof proto.Reaction + * CompanionRegData eSkeyVal. + * @member {Uint8Array} eSkeyVal + * @memberof proto.CompanionRegData * @instance */ - Reaction.prototype.unread = false; + CompanionRegData.prototype.eSkeyVal = $util.newBuffer([]); /** - * Creates a new Reaction instance using the specified properties. + * CompanionRegData eSkeySig. + * @member {Uint8Array} eSkeySig + * @memberof proto.CompanionRegData + * @instance + */ + CompanionRegData.prototype.eSkeySig = $util.newBuffer([]); + + /** + * CompanionRegData buildHash. + * @member {Uint8Array} buildHash + * @memberof proto.CompanionRegData + * @instance + */ + CompanionRegData.prototype.buildHash = $util.newBuffer([]); + + /** + * CompanionRegData companionProps. + * @member {Uint8Array} companionProps + * @memberof proto.CompanionRegData + * @instance + */ + CompanionRegData.prototype.companionProps = $util.newBuffer([]); + + /** + * Creates a new CompanionRegData instance using the specified properties. * @function create - * @memberof proto.Reaction + * @memberof proto.CompanionRegData * @static - * @param {proto.IReaction=} [properties] Properties to set - * @returns {proto.Reaction} Reaction instance + * @param {proto.ICompanionRegData=} [properties] Properties to set + * @returns {proto.CompanionRegData} CompanionRegData instance */ - Reaction.create = function create(properties) { - return new Reaction(properties); + CompanionRegData.create = function create(properties) { + return new CompanionRegData(properties); }; /** - * Encodes the specified Reaction message. Does not implicitly {@link proto.Reaction.verify|verify} messages. + * Encodes the specified CompanionRegData message. Does not implicitly {@link proto.CompanionRegData.verify|verify} messages. * @function encode - * @memberof proto.Reaction + * @memberof proto.CompanionRegData * @static - * @param {proto.IReaction} message Reaction message or plain object to encode + * @param {proto.ICompanionRegData} message CompanionRegData message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Reaction.encode = function encode(message, writer) { + CompanionRegData.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.key != null && Object.hasOwnProperty.call(message, "key")) - $root.proto.MessageKey.encode(message.key, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.text != null && Object.hasOwnProperty.call(message, "text")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.text); - if (message.groupingKey != null && Object.hasOwnProperty.call(message, "groupingKey")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.groupingKey); - if (message.senderTimestampMs != null && Object.hasOwnProperty.call(message, "senderTimestampMs")) - writer.uint32(/* id 4, wireType 0 =*/32).int64(message.senderTimestampMs); - if (message.unread != null && Object.hasOwnProperty.call(message, "unread")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.unread); + if (message.eRegid != null && Object.hasOwnProperty.call(message, "eRegid")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.eRegid); + if (message.eKeytype != null && Object.hasOwnProperty.call(message, "eKeytype")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.eKeytype); + if (message.eIdent != null && Object.hasOwnProperty.call(message, "eIdent")) + writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.eIdent); + if (message.eSkeyId != null && Object.hasOwnProperty.call(message, "eSkeyId")) + writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.eSkeyId); + if (message.eSkeyVal != null && Object.hasOwnProperty.call(message, "eSkeyVal")) + writer.uint32(/* id 5, wireType 2 =*/42).bytes(message.eSkeyVal); + if (message.eSkeySig != null && Object.hasOwnProperty.call(message, "eSkeySig")) + writer.uint32(/* id 6, wireType 2 =*/50).bytes(message.eSkeySig); + if (message.buildHash != null && Object.hasOwnProperty.call(message, "buildHash")) + writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.buildHash); + if (message.companionProps != null && Object.hasOwnProperty.call(message, "companionProps")) + writer.uint32(/* id 8, wireType 2 =*/66).bytes(message.companionProps); return writer; }; /** - * Encodes the specified Reaction message, length delimited. Does not implicitly {@link proto.Reaction.verify|verify} messages. + * Encodes the specified CompanionRegData message, length delimited. Does not implicitly {@link proto.CompanionRegData.verify|verify} messages. * @function encodeDelimited - * @memberof proto.Reaction + * @memberof proto.CompanionRegData * @static - * @param {proto.IReaction} message Reaction message or plain object to encode + * @param {proto.ICompanionRegData} message CompanionRegData message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Reaction.encodeDelimited = function encodeDelimited(message, writer) { + CompanionRegData.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Reaction message from the specified reader or buffer. + * Decodes a CompanionRegData message from the specified reader or buffer. * @function decode - * @memberof proto.Reaction + * @memberof proto.CompanionRegData * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {proto.Reaction} Reaction + * @returns {proto.CompanionRegData} CompanionRegData * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Reaction.decode = function decode(reader, length) { + CompanionRegData.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.Reaction(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.CompanionRegData(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.key = $root.proto.MessageKey.decode(reader, reader.uint32()); + message.eRegid = reader.bytes(); break; case 2: - message.text = reader.string(); + message.eKeytype = reader.bytes(); break; case 3: - message.groupingKey = reader.string(); + message.eIdent = reader.bytes(); break; case 4: - message.senderTimestampMs = reader.int64(); + message.eSkeyId = reader.bytes(); break; case 5: - message.unread = reader.bool(); + message.eSkeyVal = reader.bytes(); + break; + case 6: + message.eSkeySig = reader.bytes(); + break; + case 7: + message.buildHash = reader.bytes(); + break; + case 8: + message.companionProps = reader.bytes(); break; default: reader.skipType(tag & 7); @@ -52736,166 +52050,237 @@ $root.proto = (function() { }; /** - * Decodes a Reaction message from the specified reader or buffer, length delimited. + * Decodes a CompanionRegData message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof proto.Reaction + * @memberof proto.CompanionRegData * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.Reaction} Reaction + * @returns {proto.CompanionRegData} CompanionRegData * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Reaction.decodeDelimited = function decodeDelimited(reader) { + CompanionRegData.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Reaction message. + * Verifies a CompanionRegData message. * @function verify - * @memberof proto.Reaction + * @memberof proto.CompanionRegData * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Reaction.verify = function verify(message) { + CompanionRegData.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.key != null && message.hasOwnProperty("key")) { - var error = $root.proto.MessageKey.verify(message.key); - if (error) - return "key." + error; - } - if (message.text != null && message.hasOwnProperty("text")) - if (!$util.isString(message.text)) - return "text: string expected"; - if (message.groupingKey != null && message.hasOwnProperty("groupingKey")) - if (!$util.isString(message.groupingKey)) - return "groupingKey: string expected"; - if (message.senderTimestampMs != null && message.hasOwnProperty("senderTimestampMs")) - if (!$util.isInteger(message.senderTimestampMs) && !(message.senderTimestampMs && $util.isInteger(message.senderTimestampMs.low) && $util.isInteger(message.senderTimestampMs.high))) - return "senderTimestampMs: integer|Long expected"; - if (message.unread != null && message.hasOwnProperty("unread")) - if (typeof message.unread !== "boolean") - return "unread: boolean expected"; + if (message.eRegid != null && message.hasOwnProperty("eRegid")) + if (!(message.eRegid && typeof message.eRegid.length === "number" || $util.isString(message.eRegid))) + return "eRegid: buffer expected"; + if (message.eKeytype != null && message.hasOwnProperty("eKeytype")) + if (!(message.eKeytype && typeof message.eKeytype.length === "number" || $util.isString(message.eKeytype))) + return "eKeytype: buffer expected"; + if (message.eIdent != null && message.hasOwnProperty("eIdent")) + if (!(message.eIdent && typeof message.eIdent.length === "number" || $util.isString(message.eIdent))) + return "eIdent: buffer expected"; + if (message.eSkeyId != null && message.hasOwnProperty("eSkeyId")) + if (!(message.eSkeyId && typeof message.eSkeyId.length === "number" || $util.isString(message.eSkeyId))) + return "eSkeyId: buffer expected"; + if (message.eSkeyVal != null && message.hasOwnProperty("eSkeyVal")) + if (!(message.eSkeyVal && typeof message.eSkeyVal.length === "number" || $util.isString(message.eSkeyVal))) + return "eSkeyVal: buffer expected"; + if (message.eSkeySig != null && message.hasOwnProperty("eSkeySig")) + if (!(message.eSkeySig && typeof message.eSkeySig.length === "number" || $util.isString(message.eSkeySig))) + return "eSkeySig: buffer expected"; + if (message.buildHash != null && message.hasOwnProperty("buildHash")) + if (!(message.buildHash && typeof message.buildHash.length === "number" || $util.isString(message.buildHash))) + return "buildHash: buffer expected"; + if (message.companionProps != null && message.hasOwnProperty("companionProps")) + if (!(message.companionProps && typeof message.companionProps.length === "number" || $util.isString(message.companionProps))) + return "companionProps: buffer expected"; return null; }; /** - * Creates a Reaction message from a plain object. Also converts values to their respective internal types. + * Creates a CompanionRegData message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof proto.Reaction + * @memberof proto.CompanionRegData * @static * @param {Object.} object Plain object - * @returns {proto.Reaction} Reaction + * @returns {proto.CompanionRegData} CompanionRegData */ - Reaction.fromObject = function fromObject(object) { - if (object instanceof $root.proto.Reaction) + CompanionRegData.fromObject = function fromObject(object) { + if (object instanceof $root.proto.CompanionRegData) return object; - var message = new $root.proto.Reaction(); - if (object.key != null) { - if (typeof object.key !== "object") - throw TypeError(".proto.Reaction.key: object expected"); - message.key = $root.proto.MessageKey.fromObject(object.key); - } - if (object.text != null) - message.text = String(object.text); - if (object.groupingKey != null) - message.groupingKey = String(object.groupingKey); - if (object.senderTimestampMs != null) - if ($util.Long) - (message.senderTimestampMs = $util.Long.fromValue(object.senderTimestampMs)).unsigned = false; - else if (typeof object.senderTimestampMs === "string") - message.senderTimestampMs = parseInt(object.senderTimestampMs, 10); - else if (typeof object.senderTimestampMs === "number") - message.senderTimestampMs = object.senderTimestampMs; - else if (typeof object.senderTimestampMs === "object") - message.senderTimestampMs = new $util.LongBits(object.senderTimestampMs.low >>> 0, object.senderTimestampMs.high >>> 0).toNumber(); - if (object.unread != null) - message.unread = Boolean(object.unread); + var message = new $root.proto.CompanionRegData(); + if (object.eRegid != null) + if (typeof object.eRegid === "string") + $util.base64.decode(object.eRegid, message.eRegid = $util.newBuffer($util.base64.length(object.eRegid)), 0); + else if (object.eRegid.length) + message.eRegid = object.eRegid; + if (object.eKeytype != null) + if (typeof object.eKeytype === "string") + $util.base64.decode(object.eKeytype, message.eKeytype = $util.newBuffer($util.base64.length(object.eKeytype)), 0); + else if (object.eKeytype.length) + message.eKeytype = object.eKeytype; + if (object.eIdent != null) + if (typeof object.eIdent === "string") + $util.base64.decode(object.eIdent, message.eIdent = $util.newBuffer($util.base64.length(object.eIdent)), 0); + else if (object.eIdent.length) + message.eIdent = object.eIdent; + if (object.eSkeyId != null) + if (typeof object.eSkeyId === "string") + $util.base64.decode(object.eSkeyId, message.eSkeyId = $util.newBuffer($util.base64.length(object.eSkeyId)), 0); + else if (object.eSkeyId.length) + message.eSkeyId = object.eSkeyId; + if (object.eSkeyVal != null) + if (typeof object.eSkeyVal === "string") + $util.base64.decode(object.eSkeyVal, message.eSkeyVal = $util.newBuffer($util.base64.length(object.eSkeyVal)), 0); + else if (object.eSkeyVal.length) + message.eSkeyVal = object.eSkeyVal; + if (object.eSkeySig != null) + if (typeof object.eSkeySig === "string") + $util.base64.decode(object.eSkeySig, message.eSkeySig = $util.newBuffer($util.base64.length(object.eSkeySig)), 0); + else if (object.eSkeySig.length) + message.eSkeySig = object.eSkeySig; + if (object.buildHash != null) + if (typeof object.buildHash === "string") + $util.base64.decode(object.buildHash, message.buildHash = $util.newBuffer($util.base64.length(object.buildHash)), 0); + else if (object.buildHash.length) + message.buildHash = object.buildHash; + if (object.companionProps != null) + if (typeof object.companionProps === "string") + $util.base64.decode(object.companionProps, message.companionProps = $util.newBuffer($util.base64.length(object.companionProps)), 0); + else if (object.companionProps.length) + message.companionProps = object.companionProps; return message; }; /** - * Creates a plain object from a Reaction message. Also converts values to other types if specified. + * Creates a plain object from a CompanionRegData message. Also converts values to other types if specified. * @function toObject - * @memberof proto.Reaction + * @memberof proto.CompanionRegData * @static - * @param {proto.Reaction} message Reaction + * @param {proto.CompanionRegData} message CompanionRegData * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Reaction.toObject = function toObject(message, options) { + CompanionRegData.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.key = null; - object.text = ""; - object.groupingKey = ""; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.senderTimestampMs = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.senderTimestampMs = options.longs === String ? "0" : 0; - object.unread = false; + if (options.bytes === String) + object.eRegid = ""; + else { + object.eRegid = []; + if (options.bytes !== Array) + object.eRegid = $util.newBuffer(object.eRegid); + } + if (options.bytes === String) + object.eKeytype = ""; + else { + object.eKeytype = []; + if (options.bytes !== Array) + object.eKeytype = $util.newBuffer(object.eKeytype); + } + if (options.bytes === String) + object.eIdent = ""; + else { + object.eIdent = []; + if (options.bytes !== Array) + object.eIdent = $util.newBuffer(object.eIdent); + } + if (options.bytes === String) + object.eSkeyId = ""; + else { + object.eSkeyId = []; + if (options.bytes !== Array) + object.eSkeyId = $util.newBuffer(object.eSkeyId); + } + if (options.bytes === String) + object.eSkeyVal = ""; + else { + object.eSkeyVal = []; + if (options.bytes !== Array) + object.eSkeyVal = $util.newBuffer(object.eSkeyVal); + } + if (options.bytes === String) + object.eSkeySig = ""; + else { + object.eSkeySig = []; + if (options.bytes !== Array) + object.eSkeySig = $util.newBuffer(object.eSkeySig); + } + if (options.bytes === String) + object.buildHash = ""; + else { + object.buildHash = []; + if (options.bytes !== Array) + object.buildHash = $util.newBuffer(object.buildHash); + } + if (options.bytes === String) + object.companionProps = ""; + else { + object.companionProps = []; + if (options.bytes !== Array) + object.companionProps = $util.newBuffer(object.companionProps); + } } - if (message.key != null && message.hasOwnProperty("key")) - object.key = $root.proto.MessageKey.toObject(message.key, options); - if (message.text != null && message.hasOwnProperty("text")) - object.text = message.text; - if (message.groupingKey != null && message.hasOwnProperty("groupingKey")) - object.groupingKey = message.groupingKey; - if (message.senderTimestampMs != null && message.hasOwnProperty("senderTimestampMs")) - if (typeof message.senderTimestampMs === "number") - object.senderTimestampMs = options.longs === String ? String(message.senderTimestampMs) : message.senderTimestampMs; - else - object.senderTimestampMs = options.longs === String ? $util.Long.prototype.toString.call(message.senderTimestampMs) : options.longs === Number ? new $util.LongBits(message.senderTimestampMs.low >>> 0, message.senderTimestampMs.high >>> 0).toNumber() : message.senderTimestampMs; - if (message.unread != null && message.hasOwnProperty("unread")) - object.unread = message.unread; + if (message.eRegid != null && message.hasOwnProperty("eRegid")) + object.eRegid = options.bytes === String ? $util.base64.encode(message.eRegid, 0, message.eRegid.length) : options.bytes === Array ? Array.prototype.slice.call(message.eRegid) : message.eRegid; + if (message.eKeytype != null && message.hasOwnProperty("eKeytype")) + object.eKeytype = options.bytes === String ? $util.base64.encode(message.eKeytype, 0, message.eKeytype.length) : options.bytes === Array ? Array.prototype.slice.call(message.eKeytype) : message.eKeytype; + if (message.eIdent != null && message.hasOwnProperty("eIdent")) + object.eIdent = options.bytes === String ? $util.base64.encode(message.eIdent, 0, message.eIdent.length) : options.bytes === Array ? Array.prototype.slice.call(message.eIdent) : message.eIdent; + if (message.eSkeyId != null && message.hasOwnProperty("eSkeyId")) + object.eSkeyId = options.bytes === String ? $util.base64.encode(message.eSkeyId, 0, message.eSkeyId.length) : options.bytes === Array ? Array.prototype.slice.call(message.eSkeyId) : message.eSkeyId; + if (message.eSkeyVal != null && message.hasOwnProperty("eSkeyVal")) + object.eSkeyVal = options.bytes === String ? $util.base64.encode(message.eSkeyVal, 0, message.eSkeyVal.length) : options.bytes === Array ? Array.prototype.slice.call(message.eSkeyVal) : message.eSkeyVal; + if (message.eSkeySig != null && message.hasOwnProperty("eSkeySig")) + object.eSkeySig = options.bytes === String ? $util.base64.encode(message.eSkeySig, 0, message.eSkeySig.length) : options.bytes === Array ? Array.prototype.slice.call(message.eSkeySig) : message.eSkeySig; + if (message.buildHash != null && message.hasOwnProperty("buildHash")) + object.buildHash = options.bytes === String ? $util.base64.encode(message.buildHash, 0, message.buildHash.length) : options.bytes === Array ? Array.prototype.slice.call(message.buildHash) : message.buildHash; + if (message.companionProps != null && message.hasOwnProperty("companionProps")) + object.companionProps = options.bytes === String ? $util.base64.encode(message.companionProps, 0, message.companionProps.length) : options.bytes === Array ? Array.prototype.slice.call(message.companionProps) : message.companionProps; return object; }; /** - * Converts this Reaction to JSON. + * Converts this CompanionRegData to JSON. * @function toJSON - * @memberof proto.Reaction + * @memberof proto.CompanionRegData * @instance * @returns {Object.} JSON object */ - Reaction.prototype.toJSON = function toJSON() { + CompanionRegData.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return Reaction; + return CompanionRegData; })(); - proto.UserReceipt = (function() { + proto.DNSSource = (function() { /** - * Properties of a UserReceipt. + * Properties of a DNSSource. * @memberof proto - * @interface IUserReceipt - * @property {string} userJid UserReceipt userJid - * @property {number|Long|null} [receiptTimestamp] UserReceipt receiptTimestamp - * @property {number|Long|null} [readTimestamp] UserReceipt readTimestamp - * @property {number|Long|null} [playedTimestamp] UserReceipt playedTimestamp - * @property {Array.|null} [pendingDeviceJid] UserReceipt pendingDeviceJid - * @property {Array.|null} [deliveredDeviceJid] UserReceipt deliveredDeviceJid + * @interface IDNSSource + * @property {proto.DNSSource.DNSSourceDNSResolutionMethod|null} [dnsMethod] DNSSource dnsMethod + * @property {boolean|null} [appCached] DNSSource appCached */ /** - * Constructs a new UserReceipt. + * Constructs a new DNSSource. * @memberof proto - * @classdesc Represents a UserReceipt. - * @implements IUserReceipt + * @classdesc Represents a DNSSource. + * @implements IDNSSource * @constructor - * @param {proto.IUserReceipt=} [properties] Properties to set + * @param {proto.IDNSSource=} [properties] Properties to set */ - function UserReceipt(properties) { - this.pendingDeviceJid = []; - this.deliveredDeviceJid = []; + function DNSSource(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -52903,367 +52288,258 @@ $root.proto = (function() { } /** - * UserReceipt userJid. - * @member {string} userJid - * @memberof proto.UserReceipt + * DNSSource dnsMethod. + * @member {proto.DNSSource.DNSSourceDNSResolutionMethod} dnsMethod + * @memberof proto.DNSSource * @instance */ - UserReceipt.prototype.userJid = ""; + DNSSource.prototype.dnsMethod = 0; /** - * UserReceipt receiptTimestamp. - * @member {number|Long} receiptTimestamp - * @memberof proto.UserReceipt + * DNSSource appCached. + * @member {boolean} appCached + * @memberof proto.DNSSource * @instance */ - UserReceipt.prototype.receiptTimestamp = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + DNSSource.prototype.appCached = false; /** - * UserReceipt readTimestamp. - * @member {number|Long} readTimestamp - * @memberof proto.UserReceipt - * @instance - */ - UserReceipt.prototype.readTimestamp = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * UserReceipt playedTimestamp. - * @member {number|Long} playedTimestamp - * @memberof proto.UserReceipt - * @instance - */ - UserReceipt.prototype.playedTimestamp = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * UserReceipt pendingDeviceJid. - * @member {Array.} pendingDeviceJid - * @memberof proto.UserReceipt - * @instance - */ - UserReceipt.prototype.pendingDeviceJid = $util.emptyArray; - - /** - * UserReceipt deliveredDeviceJid. - * @member {Array.} deliveredDeviceJid - * @memberof proto.UserReceipt - * @instance - */ - UserReceipt.prototype.deliveredDeviceJid = $util.emptyArray; - - /** - * Creates a new UserReceipt instance using the specified properties. + * Creates a new DNSSource instance using the specified properties. * @function create - * @memberof proto.UserReceipt + * @memberof proto.DNSSource * @static - * @param {proto.IUserReceipt=} [properties] Properties to set - * @returns {proto.UserReceipt} UserReceipt instance + * @param {proto.IDNSSource=} [properties] Properties to set + * @returns {proto.DNSSource} DNSSource instance */ - UserReceipt.create = function create(properties) { - return new UserReceipt(properties); + DNSSource.create = function create(properties) { + return new DNSSource(properties); }; /** - * Encodes the specified UserReceipt message. Does not implicitly {@link proto.UserReceipt.verify|verify} messages. + * Encodes the specified DNSSource message. Does not implicitly {@link proto.DNSSource.verify|verify} messages. * @function encode - * @memberof proto.UserReceipt + * @memberof proto.DNSSource * @static - * @param {proto.IUserReceipt} message UserReceipt message or plain object to encode + * @param {proto.IDNSSource} message DNSSource message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UserReceipt.encode = function encode(message, writer) { + DNSSource.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - writer.uint32(/* id 1, wireType 2 =*/10).string(message.userJid); - if (message.receiptTimestamp != null && Object.hasOwnProperty.call(message, "receiptTimestamp")) - writer.uint32(/* id 2, wireType 0 =*/16).int64(message.receiptTimestamp); - if (message.readTimestamp != null && Object.hasOwnProperty.call(message, "readTimestamp")) - writer.uint32(/* id 3, wireType 0 =*/24).int64(message.readTimestamp); - if (message.playedTimestamp != null && Object.hasOwnProperty.call(message, "playedTimestamp")) - writer.uint32(/* id 4, wireType 0 =*/32).int64(message.playedTimestamp); - if (message.pendingDeviceJid != null && message.pendingDeviceJid.length) - for (var i = 0; i < message.pendingDeviceJid.length; ++i) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.pendingDeviceJid[i]); - if (message.deliveredDeviceJid != null && message.deliveredDeviceJid.length) - for (var i = 0; i < message.deliveredDeviceJid.length; ++i) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.deliveredDeviceJid[i]); + if (message.dnsMethod != null && Object.hasOwnProperty.call(message, "dnsMethod")) + writer.uint32(/* id 15, wireType 0 =*/120).int32(message.dnsMethod); + if (message.appCached != null && Object.hasOwnProperty.call(message, "appCached")) + writer.uint32(/* id 16, wireType 0 =*/128).bool(message.appCached); return writer; }; /** - * Encodes the specified UserReceipt message, length delimited. Does not implicitly {@link proto.UserReceipt.verify|verify} messages. + * Encodes the specified DNSSource message, length delimited. Does not implicitly {@link proto.DNSSource.verify|verify} messages. * @function encodeDelimited - * @memberof proto.UserReceipt + * @memberof proto.DNSSource * @static - * @param {proto.IUserReceipt} message UserReceipt message or plain object to encode + * @param {proto.IDNSSource} message DNSSource message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UserReceipt.encodeDelimited = function encodeDelimited(message, writer) { + DNSSource.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a UserReceipt message from the specified reader or buffer. + * Decodes a DNSSource message from the specified reader or buffer. * @function decode - * @memberof proto.UserReceipt + * @memberof proto.DNSSource * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {proto.UserReceipt} UserReceipt + * @returns {proto.DNSSource} DNSSource * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UserReceipt.decode = function decode(reader, length) { + DNSSource.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.UserReceipt(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.DNSSource(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.userJid = reader.string(); - break; - case 2: - message.receiptTimestamp = reader.int64(); - break; - case 3: - message.readTimestamp = reader.int64(); - break; - case 4: - message.playedTimestamp = reader.int64(); - break; - case 5: - if (!(message.pendingDeviceJid && message.pendingDeviceJid.length)) - message.pendingDeviceJid = []; - message.pendingDeviceJid.push(reader.string()); + case 15: + message.dnsMethod = reader.int32(); break; - case 6: - if (!(message.deliveredDeviceJid && message.deliveredDeviceJid.length)) - message.deliveredDeviceJid = []; - message.deliveredDeviceJid.push(reader.string()); + case 16: + message.appCached = reader.bool(); break; default: reader.skipType(tag & 7); break; } } - if (!message.hasOwnProperty("userJid")) - throw $util.ProtocolError("missing required 'userJid'", { instance: message }); return message; }; /** - * Decodes a UserReceipt message from the specified reader or buffer, length delimited. + * Decodes a DNSSource message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof proto.UserReceipt + * @memberof proto.DNSSource * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.UserReceipt} UserReceipt + * @returns {proto.DNSSource} DNSSource * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UserReceipt.decodeDelimited = function decodeDelimited(reader) { + DNSSource.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a UserReceipt message. + * Verifies a DNSSource message. * @function verify - * @memberof proto.UserReceipt + * @memberof proto.DNSSource * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - UserReceipt.verify = function verify(message) { + DNSSource.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (!$util.isString(message.userJid)) - return "userJid: string expected"; - if (message.receiptTimestamp != null && message.hasOwnProperty("receiptTimestamp")) - if (!$util.isInteger(message.receiptTimestamp) && !(message.receiptTimestamp && $util.isInteger(message.receiptTimestamp.low) && $util.isInteger(message.receiptTimestamp.high))) - return "receiptTimestamp: integer|Long expected"; - if (message.readTimestamp != null && message.hasOwnProperty("readTimestamp")) - if (!$util.isInteger(message.readTimestamp) && !(message.readTimestamp && $util.isInteger(message.readTimestamp.low) && $util.isInteger(message.readTimestamp.high))) - return "readTimestamp: integer|Long expected"; - if (message.playedTimestamp != null && message.hasOwnProperty("playedTimestamp")) - if (!$util.isInteger(message.playedTimestamp) && !(message.playedTimestamp && $util.isInteger(message.playedTimestamp.low) && $util.isInteger(message.playedTimestamp.high))) - return "playedTimestamp: integer|Long expected"; - if (message.pendingDeviceJid != null && message.hasOwnProperty("pendingDeviceJid")) { - if (!Array.isArray(message.pendingDeviceJid)) - return "pendingDeviceJid: array expected"; - for (var i = 0; i < message.pendingDeviceJid.length; ++i) - if (!$util.isString(message.pendingDeviceJid[i])) - return "pendingDeviceJid: string[] expected"; - } - if (message.deliveredDeviceJid != null && message.hasOwnProperty("deliveredDeviceJid")) { - if (!Array.isArray(message.deliveredDeviceJid)) - return "deliveredDeviceJid: array expected"; - for (var i = 0; i < message.deliveredDeviceJid.length; ++i) - if (!$util.isString(message.deliveredDeviceJid[i])) - return "deliveredDeviceJid: string[] expected"; - } + if (message.dnsMethod != null && message.hasOwnProperty("dnsMethod")) + switch (message.dnsMethod) { + default: + return "dnsMethod: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.appCached != null && message.hasOwnProperty("appCached")) + if (typeof message.appCached !== "boolean") + return "appCached: boolean expected"; return null; }; /** - * Creates a UserReceipt message from a plain object. Also converts values to their respective internal types. + * Creates a DNSSource message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof proto.UserReceipt + * @memberof proto.DNSSource * @static * @param {Object.} object Plain object - * @returns {proto.UserReceipt} UserReceipt + * @returns {proto.DNSSource} DNSSource */ - UserReceipt.fromObject = function fromObject(object) { - if (object instanceof $root.proto.UserReceipt) + DNSSource.fromObject = function fromObject(object) { + if (object instanceof $root.proto.DNSSource) return object; - var message = new $root.proto.UserReceipt(); - if (object.userJid != null) - message.userJid = String(object.userJid); - if (object.receiptTimestamp != null) - if ($util.Long) - (message.receiptTimestamp = $util.Long.fromValue(object.receiptTimestamp)).unsigned = false; - else if (typeof object.receiptTimestamp === "string") - message.receiptTimestamp = parseInt(object.receiptTimestamp, 10); - else if (typeof object.receiptTimestamp === "number") - message.receiptTimestamp = object.receiptTimestamp; - else if (typeof object.receiptTimestamp === "object") - message.receiptTimestamp = new $util.LongBits(object.receiptTimestamp.low >>> 0, object.receiptTimestamp.high >>> 0).toNumber(); - if (object.readTimestamp != null) - if ($util.Long) - (message.readTimestamp = $util.Long.fromValue(object.readTimestamp)).unsigned = false; - else if (typeof object.readTimestamp === "string") - message.readTimestamp = parseInt(object.readTimestamp, 10); - else if (typeof object.readTimestamp === "number") - message.readTimestamp = object.readTimestamp; - else if (typeof object.readTimestamp === "object") - message.readTimestamp = new $util.LongBits(object.readTimestamp.low >>> 0, object.readTimestamp.high >>> 0).toNumber(); - if (object.playedTimestamp != null) - if ($util.Long) - (message.playedTimestamp = $util.Long.fromValue(object.playedTimestamp)).unsigned = false; - else if (typeof object.playedTimestamp === "string") - message.playedTimestamp = parseInt(object.playedTimestamp, 10); - else if (typeof object.playedTimestamp === "number") - message.playedTimestamp = object.playedTimestamp; - else if (typeof object.playedTimestamp === "object") - message.playedTimestamp = new $util.LongBits(object.playedTimestamp.low >>> 0, object.playedTimestamp.high >>> 0).toNumber(); - if (object.pendingDeviceJid) { - if (!Array.isArray(object.pendingDeviceJid)) - throw TypeError(".proto.UserReceipt.pendingDeviceJid: array expected"); - message.pendingDeviceJid = []; - for (var i = 0; i < object.pendingDeviceJid.length; ++i) - message.pendingDeviceJid[i] = String(object.pendingDeviceJid[i]); - } - if (object.deliveredDeviceJid) { - if (!Array.isArray(object.deliveredDeviceJid)) - throw TypeError(".proto.UserReceipt.deliveredDeviceJid: array expected"); - message.deliveredDeviceJid = []; - for (var i = 0; i < object.deliveredDeviceJid.length; ++i) - message.deliveredDeviceJid[i] = String(object.deliveredDeviceJid[i]); + var message = new $root.proto.DNSSource(); + switch (object.dnsMethod) { + case "SYSTEM": + case 0: + message.dnsMethod = 0; + break; + case "GOOGLE": + case 1: + message.dnsMethod = 1; + break; + case "HARDCODED": + case 2: + message.dnsMethod = 2; + break; + case "OVERRIDE": + case 3: + message.dnsMethod = 3; + break; + case "FALLBACK": + case 4: + message.dnsMethod = 4; + break; } + if (object.appCached != null) + message.appCached = Boolean(object.appCached); return message; }; /** - * Creates a plain object from a UserReceipt message. Also converts values to other types if specified. + * Creates a plain object from a DNSSource message. Also converts values to other types if specified. * @function toObject - * @memberof proto.UserReceipt + * @memberof proto.DNSSource * @static - * @param {proto.UserReceipt} message UserReceipt + * @param {proto.DNSSource} message DNSSource * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - UserReceipt.toObject = function toObject(message, options) { + DNSSource.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) { - object.pendingDeviceJid = []; - object.deliveredDeviceJid = []; - } if (options.defaults) { - object.userJid = ""; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.receiptTimestamp = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.receiptTimestamp = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.readTimestamp = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.readTimestamp = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.playedTimestamp = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.playedTimestamp = options.longs === String ? "0" : 0; - } - if (message.userJid != null && message.hasOwnProperty("userJid")) - object.userJid = message.userJid; - if (message.receiptTimestamp != null && message.hasOwnProperty("receiptTimestamp")) - if (typeof message.receiptTimestamp === "number") - object.receiptTimestamp = options.longs === String ? String(message.receiptTimestamp) : message.receiptTimestamp; - else - object.receiptTimestamp = options.longs === String ? $util.Long.prototype.toString.call(message.receiptTimestamp) : options.longs === Number ? new $util.LongBits(message.receiptTimestamp.low >>> 0, message.receiptTimestamp.high >>> 0).toNumber() : message.receiptTimestamp; - if (message.readTimestamp != null && message.hasOwnProperty("readTimestamp")) - if (typeof message.readTimestamp === "number") - object.readTimestamp = options.longs === String ? String(message.readTimestamp) : message.readTimestamp; - else - object.readTimestamp = options.longs === String ? $util.Long.prototype.toString.call(message.readTimestamp) : options.longs === Number ? new $util.LongBits(message.readTimestamp.low >>> 0, message.readTimestamp.high >>> 0).toNumber() : message.readTimestamp; - if (message.playedTimestamp != null && message.hasOwnProperty("playedTimestamp")) - if (typeof message.playedTimestamp === "number") - object.playedTimestamp = options.longs === String ? String(message.playedTimestamp) : message.playedTimestamp; - else - object.playedTimestamp = options.longs === String ? $util.Long.prototype.toString.call(message.playedTimestamp) : options.longs === Number ? new $util.LongBits(message.playedTimestamp.low >>> 0, message.playedTimestamp.high >>> 0).toNumber() : message.playedTimestamp; - if (message.pendingDeviceJid && message.pendingDeviceJid.length) { - object.pendingDeviceJid = []; - for (var j = 0; j < message.pendingDeviceJid.length; ++j) - object.pendingDeviceJid[j] = message.pendingDeviceJid[j]; - } - if (message.deliveredDeviceJid && message.deliveredDeviceJid.length) { - object.deliveredDeviceJid = []; - for (var j = 0; j < message.deliveredDeviceJid.length; ++j) - object.deliveredDeviceJid[j] = message.deliveredDeviceJid[j]; + object.dnsMethod = options.enums === String ? "SYSTEM" : 0; + object.appCached = false; } + if (message.dnsMethod != null && message.hasOwnProperty("dnsMethod")) + object.dnsMethod = options.enums === String ? $root.proto.DNSSource.DNSSourceDNSResolutionMethod[message.dnsMethod] : message.dnsMethod; + if (message.appCached != null && message.hasOwnProperty("appCached")) + object.appCached = message.appCached; return object; }; /** - * Converts this UserReceipt to JSON. + * Converts this DNSSource to JSON. * @function toJSON - * @memberof proto.UserReceipt + * @memberof proto.DNSSource * @instance * @returns {Object.} JSON object */ - UserReceipt.prototype.toJSON = function toJSON() { + DNSSource.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return UserReceipt; + /** + * DNSSourceDNSResolutionMethod enum. + * @name proto.DNSSource.DNSSourceDNSResolutionMethod + * @enum {number} + * @property {number} SYSTEM=0 SYSTEM value + * @property {number} GOOGLE=1 GOOGLE value + * @property {number} HARDCODED=2 HARDCODED value + * @property {number} OVERRIDE=3 OVERRIDE value + * @property {number} FALLBACK=4 FALLBACK value + */ + DNSSource.DNSSourceDNSResolutionMethod = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SYSTEM"] = 0; + values[valuesById[1] = "GOOGLE"] = 1; + values[valuesById[2] = "HARDCODED"] = 2; + values[valuesById[3] = "OVERRIDE"] = 3; + values[valuesById[4] = "FALLBACK"] = 4; + return values; + })(); + + return DNSSource; })(); - proto.StatusPSA = (function() { + proto.HandshakeMessage = (function() { /** - * Properties of a StatusPSA. + * Properties of a HandshakeMessage. * @memberof proto - * @interface IStatusPSA - * @property {string} campaignId StatusPSA campaignId - * @property {number|Long|null} [campaignExpirationTimestamp] StatusPSA campaignExpirationTimestamp + * @interface IHandshakeMessage + * @property {proto.IClientHello|null} [clientHello] HandshakeMessage clientHello + * @property {proto.IServerHello|null} [serverHello] HandshakeMessage serverHello + * @property {proto.IClientFinish|null} [clientFinish] HandshakeMessage clientFinish */ /** - * Constructs a new StatusPSA. + * Constructs a new HandshakeMessage. * @memberof proto - * @classdesc Represents a StatusPSA. - * @implements IStatusPSA + * @classdesc Represents a HandshakeMessage. + * @implements IHandshakeMessage * @constructor - * @param {proto.IStatusPSA=} [properties] Properties to set + * @param {proto.IHandshakeMessage=} [properties] Properties to set */ - function StatusPSA(properties) { + function HandshakeMessage(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -53271,224 +52547,245 @@ $root.proto = (function() { } /** - * StatusPSA campaignId. - * @member {string} campaignId - * @memberof proto.StatusPSA + * HandshakeMessage clientHello. + * @member {proto.IClientHello|null|undefined} clientHello + * @memberof proto.HandshakeMessage * @instance */ - StatusPSA.prototype.campaignId = ""; + HandshakeMessage.prototype.clientHello = null; /** - * StatusPSA campaignExpirationTimestamp. - * @member {number|Long} campaignExpirationTimestamp - * @memberof proto.StatusPSA + * HandshakeMessage serverHello. + * @member {proto.IServerHello|null|undefined} serverHello + * @memberof proto.HandshakeMessage * @instance */ - StatusPSA.prototype.campaignExpirationTimestamp = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + HandshakeMessage.prototype.serverHello = null; /** - * Creates a new StatusPSA instance using the specified properties. + * HandshakeMessage clientFinish. + * @member {proto.IClientFinish|null|undefined} clientFinish + * @memberof proto.HandshakeMessage + * @instance + */ + HandshakeMessage.prototype.clientFinish = null; + + /** + * Creates a new HandshakeMessage instance using the specified properties. * @function create - * @memberof proto.StatusPSA + * @memberof proto.HandshakeMessage * @static - * @param {proto.IStatusPSA=} [properties] Properties to set - * @returns {proto.StatusPSA} StatusPSA instance + * @param {proto.IHandshakeMessage=} [properties] Properties to set + * @returns {proto.HandshakeMessage} HandshakeMessage instance */ - StatusPSA.create = function create(properties) { - return new StatusPSA(properties); + HandshakeMessage.create = function create(properties) { + return new HandshakeMessage(properties); }; /** - * Encodes the specified StatusPSA message. Does not implicitly {@link proto.StatusPSA.verify|verify} messages. + * Encodes the specified HandshakeMessage message. Does not implicitly {@link proto.HandshakeMessage.verify|verify} messages. * @function encode - * @memberof proto.StatusPSA + * @memberof proto.HandshakeMessage * @static - * @param {proto.IStatusPSA} message StatusPSA message or plain object to encode + * @param {proto.IHandshakeMessage} message HandshakeMessage message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - StatusPSA.encode = function encode(message, writer) { + HandshakeMessage.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - writer.uint32(/* id 44, wireType 2 =*/354).string(message.campaignId); - if (message.campaignExpirationTimestamp != null && Object.hasOwnProperty.call(message, "campaignExpirationTimestamp")) - writer.uint32(/* id 45, wireType 0 =*/360).uint64(message.campaignExpirationTimestamp); + if (message.clientHello != null && Object.hasOwnProperty.call(message, "clientHello")) + $root.proto.ClientHello.encode(message.clientHello, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.serverHello != null && Object.hasOwnProperty.call(message, "serverHello")) + $root.proto.ServerHello.encode(message.serverHello, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.clientFinish != null && Object.hasOwnProperty.call(message, "clientFinish")) + $root.proto.ClientFinish.encode(message.clientFinish, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); return writer; }; /** - * Encodes the specified StatusPSA message, length delimited. Does not implicitly {@link proto.StatusPSA.verify|verify} messages. + * Encodes the specified HandshakeMessage message, length delimited. Does not implicitly {@link proto.HandshakeMessage.verify|verify} messages. * @function encodeDelimited - * @memberof proto.StatusPSA + * @memberof proto.HandshakeMessage * @static - * @param {proto.IStatusPSA} message StatusPSA message or plain object to encode + * @param {proto.IHandshakeMessage} message HandshakeMessage message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - StatusPSA.encodeDelimited = function encodeDelimited(message, writer) { + HandshakeMessage.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a StatusPSA message from the specified reader or buffer. + * Decodes a HandshakeMessage message from the specified reader or buffer. * @function decode - * @memberof proto.StatusPSA + * @memberof proto.HandshakeMessage * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {proto.StatusPSA} StatusPSA + * @returns {proto.HandshakeMessage} HandshakeMessage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - StatusPSA.decode = function decode(reader, length) { + HandshakeMessage.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.StatusPSA(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.HandshakeMessage(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 44: - message.campaignId = reader.string(); + case 2: + message.clientHello = $root.proto.ClientHello.decode(reader, reader.uint32()); break; - case 45: - message.campaignExpirationTimestamp = reader.uint64(); + case 3: + message.serverHello = $root.proto.ServerHello.decode(reader, reader.uint32()); + break; + case 4: + message.clientFinish = $root.proto.ClientFinish.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); break; } } - if (!message.hasOwnProperty("campaignId")) - throw $util.ProtocolError("missing required 'campaignId'", { instance: message }); return message; }; /** - * Decodes a StatusPSA message from the specified reader or buffer, length delimited. + * Decodes a HandshakeMessage message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof proto.StatusPSA + * @memberof proto.HandshakeMessage * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.StatusPSA} StatusPSA + * @returns {proto.HandshakeMessage} HandshakeMessage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - StatusPSA.decodeDelimited = function decodeDelimited(reader) { + HandshakeMessage.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a StatusPSA message. + * Verifies a HandshakeMessage message. * @function verify - * @memberof proto.StatusPSA + * @memberof proto.HandshakeMessage * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - StatusPSA.verify = function verify(message) { + HandshakeMessage.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (!$util.isString(message.campaignId)) - return "campaignId: string expected"; - if (message.campaignExpirationTimestamp != null && message.hasOwnProperty("campaignExpirationTimestamp")) - if (!$util.isInteger(message.campaignExpirationTimestamp) && !(message.campaignExpirationTimestamp && $util.isInteger(message.campaignExpirationTimestamp.low) && $util.isInteger(message.campaignExpirationTimestamp.high))) - return "campaignExpirationTimestamp: integer|Long expected"; + if (message.clientHello != null && message.hasOwnProperty("clientHello")) { + var error = $root.proto.ClientHello.verify(message.clientHello); + if (error) + return "clientHello." + error; + } + if (message.serverHello != null && message.hasOwnProperty("serverHello")) { + var error = $root.proto.ServerHello.verify(message.serverHello); + if (error) + return "serverHello." + error; + } + if (message.clientFinish != null && message.hasOwnProperty("clientFinish")) { + var error = $root.proto.ClientFinish.verify(message.clientFinish); + if (error) + return "clientFinish." + error; + } return null; }; /** - * Creates a StatusPSA message from a plain object. Also converts values to their respective internal types. + * Creates a HandshakeMessage message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof proto.StatusPSA + * @memberof proto.HandshakeMessage * @static * @param {Object.} object Plain object - * @returns {proto.StatusPSA} StatusPSA + * @returns {proto.HandshakeMessage} HandshakeMessage */ - StatusPSA.fromObject = function fromObject(object) { - if (object instanceof $root.proto.StatusPSA) + HandshakeMessage.fromObject = function fromObject(object) { + if (object instanceof $root.proto.HandshakeMessage) return object; - var message = new $root.proto.StatusPSA(); - if (object.campaignId != null) - message.campaignId = String(object.campaignId); - if (object.campaignExpirationTimestamp != null) - if ($util.Long) - (message.campaignExpirationTimestamp = $util.Long.fromValue(object.campaignExpirationTimestamp)).unsigned = true; - else if (typeof object.campaignExpirationTimestamp === "string") - message.campaignExpirationTimestamp = parseInt(object.campaignExpirationTimestamp, 10); - else if (typeof object.campaignExpirationTimestamp === "number") - message.campaignExpirationTimestamp = object.campaignExpirationTimestamp; - else if (typeof object.campaignExpirationTimestamp === "object") - message.campaignExpirationTimestamp = new $util.LongBits(object.campaignExpirationTimestamp.low >>> 0, object.campaignExpirationTimestamp.high >>> 0).toNumber(true); + var message = new $root.proto.HandshakeMessage(); + if (object.clientHello != null) { + if (typeof object.clientHello !== "object") + throw TypeError(".proto.HandshakeMessage.clientHello: object expected"); + message.clientHello = $root.proto.ClientHello.fromObject(object.clientHello); + } + if (object.serverHello != null) { + if (typeof object.serverHello !== "object") + throw TypeError(".proto.HandshakeMessage.serverHello: object expected"); + message.serverHello = $root.proto.ServerHello.fromObject(object.serverHello); + } + if (object.clientFinish != null) { + if (typeof object.clientFinish !== "object") + throw TypeError(".proto.HandshakeMessage.clientFinish: object expected"); + message.clientFinish = $root.proto.ClientFinish.fromObject(object.clientFinish); + } return message; }; /** - * Creates a plain object from a StatusPSA message. Also converts values to other types if specified. + * Creates a plain object from a HandshakeMessage message. Also converts values to other types if specified. * @function toObject - * @memberof proto.StatusPSA + * @memberof proto.HandshakeMessage * @static - * @param {proto.StatusPSA} message StatusPSA + * @param {proto.HandshakeMessage} message HandshakeMessage * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - StatusPSA.toObject = function toObject(message, options) { + HandshakeMessage.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.campaignId = ""; - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.campaignExpirationTimestamp = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.campaignExpirationTimestamp = options.longs === String ? "0" : 0; + object.clientHello = null; + object.serverHello = null; + object.clientFinish = null; } - if (message.campaignId != null && message.hasOwnProperty("campaignId")) - object.campaignId = message.campaignId; - if (message.campaignExpirationTimestamp != null && message.hasOwnProperty("campaignExpirationTimestamp")) - if (typeof message.campaignExpirationTimestamp === "number") - object.campaignExpirationTimestamp = options.longs === String ? String(message.campaignExpirationTimestamp) : message.campaignExpirationTimestamp; - else - object.campaignExpirationTimestamp = options.longs === String ? $util.Long.prototype.toString.call(message.campaignExpirationTimestamp) : options.longs === Number ? new $util.LongBits(message.campaignExpirationTimestamp.low >>> 0, message.campaignExpirationTimestamp.high >>> 0).toNumber(true) : message.campaignExpirationTimestamp; + if (message.clientHello != null && message.hasOwnProperty("clientHello")) + object.clientHello = $root.proto.ClientHello.toObject(message.clientHello, options); + if (message.serverHello != null && message.hasOwnProperty("serverHello")) + object.serverHello = $root.proto.ServerHello.toObject(message.serverHello, options); + if (message.clientFinish != null && message.hasOwnProperty("clientFinish")) + object.clientFinish = $root.proto.ClientFinish.toObject(message.clientFinish, options); return object; }; /** - * Converts this StatusPSA to JSON. + * Converts this HandshakeMessage to JSON. * @function toJSON - * @memberof proto.StatusPSA + * @memberof proto.HandshakeMessage * @instance * @returns {Object.} JSON object */ - StatusPSA.prototype.toJSON = function toJSON() { + HandshakeMessage.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return StatusPSA; + return HandshakeMessage; })(); - proto.PhotoChange = (function() { + proto.NoiseCertificate = (function() { /** - * Properties of a PhotoChange. + * Properties of a NoiseCertificate. * @memberof proto - * @interface IPhotoChange - * @property {Uint8Array|null} [oldPhoto] PhotoChange oldPhoto - * @property {Uint8Array|null} [newPhoto] PhotoChange newPhoto - * @property {number|null} [newPhotoId] PhotoChange newPhotoId + * @interface INoiseCertificate + * @property {Uint8Array|null} [details] NoiseCertificate details + * @property {Uint8Array|null} [signature] NoiseCertificate signature */ /** - * Constructs a new PhotoChange. + * Constructs a new NoiseCertificate. * @memberof proto - * @classdesc Represents a PhotoChange. - * @implements IPhotoChange + * @classdesc Represents a NoiseCertificate. + * @implements INoiseCertificate * @constructor - * @param {proto.IPhotoChange=} [properties] Properties to set + * @param {proto.INoiseCertificate=} [properties] Properties to set */ - function PhotoChange(properties) { + function NoiseCertificate(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -53496,101 +52793,88 @@ $root.proto = (function() { } /** - * PhotoChange oldPhoto. - * @member {Uint8Array} oldPhoto - * @memberof proto.PhotoChange - * @instance - */ - PhotoChange.prototype.oldPhoto = $util.newBuffer([]); - - /** - * PhotoChange newPhoto. - * @member {Uint8Array} newPhoto - * @memberof proto.PhotoChange + * NoiseCertificate details. + * @member {Uint8Array} details + * @memberof proto.NoiseCertificate * @instance */ - PhotoChange.prototype.newPhoto = $util.newBuffer([]); + NoiseCertificate.prototype.details = $util.newBuffer([]); /** - * PhotoChange newPhotoId. - * @member {number} newPhotoId - * @memberof proto.PhotoChange + * NoiseCertificate signature. + * @member {Uint8Array} signature + * @memberof proto.NoiseCertificate * @instance */ - PhotoChange.prototype.newPhotoId = 0; + NoiseCertificate.prototype.signature = $util.newBuffer([]); /** - * Creates a new PhotoChange instance using the specified properties. + * Creates a new NoiseCertificate instance using the specified properties. * @function create - * @memberof proto.PhotoChange + * @memberof proto.NoiseCertificate * @static - * @param {proto.IPhotoChange=} [properties] Properties to set - * @returns {proto.PhotoChange} PhotoChange instance + * @param {proto.INoiseCertificate=} [properties] Properties to set + * @returns {proto.NoiseCertificate} NoiseCertificate instance */ - PhotoChange.create = function create(properties) { - return new PhotoChange(properties); + NoiseCertificate.create = function create(properties) { + return new NoiseCertificate(properties); }; /** - * Encodes the specified PhotoChange message. Does not implicitly {@link proto.PhotoChange.verify|verify} messages. + * Encodes the specified NoiseCertificate message. Does not implicitly {@link proto.NoiseCertificate.verify|verify} messages. * @function encode - * @memberof proto.PhotoChange + * @memberof proto.NoiseCertificate * @static - * @param {proto.IPhotoChange} message PhotoChange message or plain object to encode + * @param {proto.INoiseCertificate} message NoiseCertificate message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PhotoChange.encode = function encode(message, writer) { + NoiseCertificate.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.oldPhoto != null && Object.hasOwnProperty.call(message, "oldPhoto")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.oldPhoto); - if (message.newPhoto != null && Object.hasOwnProperty.call(message, "newPhoto")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.newPhoto); - if (message.newPhotoId != null && Object.hasOwnProperty.call(message, "newPhotoId")) - writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.newPhotoId); + if (message.details != null && Object.hasOwnProperty.call(message, "details")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.details); + if (message.signature != null && Object.hasOwnProperty.call(message, "signature")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.signature); return writer; }; /** - * Encodes the specified PhotoChange message, length delimited. Does not implicitly {@link proto.PhotoChange.verify|verify} messages. + * Encodes the specified NoiseCertificate message, length delimited. Does not implicitly {@link proto.NoiseCertificate.verify|verify} messages. * @function encodeDelimited - * @memberof proto.PhotoChange + * @memberof proto.NoiseCertificate * @static - * @param {proto.IPhotoChange} message PhotoChange message or plain object to encode + * @param {proto.INoiseCertificate} message NoiseCertificate message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PhotoChange.encodeDelimited = function encodeDelimited(message, writer) { + NoiseCertificate.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a PhotoChange message from the specified reader or buffer. + * Decodes a NoiseCertificate message from the specified reader or buffer. * @function decode - * @memberof proto.PhotoChange + * @memberof proto.NoiseCertificate * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {proto.PhotoChange} PhotoChange + * @returns {proto.NoiseCertificate} NoiseCertificate * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - PhotoChange.decode = function decode(reader, length) { + NoiseCertificate.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.PhotoChange(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.NoiseCertificate(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.oldPhoto = reader.bytes(); + message.details = reader.bytes(); break; case 2: - message.newPhoto = reader.bytes(); - break; - case 3: - message.newPhotoId = reader.uint32(); + message.signature = reader.bytes(); break; default: reader.skipType(tag & 7); @@ -53601,142 +52885,138 @@ $root.proto = (function() { }; /** - * Decodes a PhotoChange message from the specified reader or buffer, length delimited. + * Decodes a NoiseCertificate message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof proto.PhotoChange + * @memberof proto.NoiseCertificate * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.PhotoChange} PhotoChange + * @returns {proto.NoiseCertificate} NoiseCertificate * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - PhotoChange.decodeDelimited = function decodeDelimited(reader) { + NoiseCertificate.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a PhotoChange message. + * Verifies a NoiseCertificate message. * @function verify - * @memberof proto.PhotoChange + * @memberof proto.NoiseCertificate * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - PhotoChange.verify = function verify(message) { + NoiseCertificate.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.oldPhoto != null && message.hasOwnProperty("oldPhoto")) - if (!(message.oldPhoto && typeof message.oldPhoto.length === "number" || $util.isString(message.oldPhoto))) - return "oldPhoto: buffer expected"; - if (message.newPhoto != null && message.hasOwnProperty("newPhoto")) - if (!(message.newPhoto && typeof message.newPhoto.length === "number" || $util.isString(message.newPhoto))) - return "newPhoto: buffer expected"; - if (message.newPhotoId != null && message.hasOwnProperty("newPhotoId")) - if (!$util.isInteger(message.newPhotoId)) - return "newPhotoId: integer expected"; + if (message.details != null && message.hasOwnProperty("details")) + if (!(message.details && typeof message.details.length === "number" || $util.isString(message.details))) + return "details: buffer expected"; + if (message.signature != null && message.hasOwnProperty("signature")) + if (!(message.signature && typeof message.signature.length === "number" || $util.isString(message.signature))) + return "signature: buffer expected"; return null; }; /** - * Creates a PhotoChange message from a plain object. Also converts values to their respective internal types. + * Creates a NoiseCertificate message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof proto.PhotoChange + * @memberof proto.NoiseCertificate * @static * @param {Object.} object Plain object - * @returns {proto.PhotoChange} PhotoChange + * @returns {proto.NoiseCertificate} NoiseCertificate */ - PhotoChange.fromObject = function fromObject(object) { - if (object instanceof $root.proto.PhotoChange) + NoiseCertificate.fromObject = function fromObject(object) { + if (object instanceof $root.proto.NoiseCertificate) return object; - var message = new $root.proto.PhotoChange(); - if (object.oldPhoto != null) - if (typeof object.oldPhoto === "string") - $util.base64.decode(object.oldPhoto, message.oldPhoto = $util.newBuffer($util.base64.length(object.oldPhoto)), 0); - else if (object.oldPhoto.length) - message.oldPhoto = object.oldPhoto; - if (object.newPhoto != null) - if (typeof object.newPhoto === "string") - $util.base64.decode(object.newPhoto, message.newPhoto = $util.newBuffer($util.base64.length(object.newPhoto)), 0); - else if (object.newPhoto.length) - message.newPhoto = object.newPhoto; - if (object.newPhotoId != null) - message.newPhotoId = object.newPhotoId >>> 0; + var message = new $root.proto.NoiseCertificate(); + if (object.details != null) + if (typeof object.details === "string") + $util.base64.decode(object.details, message.details = $util.newBuffer($util.base64.length(object.details)), 0); + else if (object.details.length) + message.details = object.details; + if (object.signature != null) + if (typeof object.signature === "string") + $util.base64.decode(object.signature, message.signature = $util.newBuffer($util.base64.length(object.signature)), 0); + else if (object.signature.length) + message.signature = object.signature; return message; }; /** - * Creates a plain object from a PhotoChange message. Also converts values to other types if specified. + * Creates a plain object from a NoiseCertificate message. Also converts values to other types if specified. * @function toObject - * @memberof proto.PhotoChange + * @memberof proto.NoiseCertificate * @static - * @param {proto.PhotoChange} message PhotoChange + * @param {proto.NoiseCertificate} message NoiseCertificate * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - PhotoChange.toObject = function toObject(message, options) { + NoiseCertificate.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { if (options.bytes === String) - object.oldPhoto = ""; + object.details = ""; else { - object.oldPhoto = []; + object.details = []; if (options.bytes !== Array) - object.oldPhoto = $util.newBuffer(object.oldPhoto); + object.details = $util.newBuffer(object.details); } if (options.bytes === String) - object.newPhoto = ""; + object.signature = ""; else { - object.newPhoto = []; + object.signature = []; if (options.bytes !== Array) - object.newPhoto = $util.newBuffer(object.newPhoto); + object.signature = $util.newBuffer(object.signature); } - object.newPhotoId = 0; } - if (message.oldPhoto != null && message.hasOwnProperty("oldPhoto")) - object.oldPhoto = options.bytes === String ? $util.base64.encode(message.oldPhoto, 0, message.oldPhoto.length) : options.bytes === Array ? Array.prototype.slice.call(message.oldPhoto) : message.oldPhoto; - if (message.newPhoto != null && message.hasOwnProperty("newPhoto")) - object.newPhoto = options.bytes === String ? $util.base64.encode(message.newPhoto, 0, message.newPhoto.length) : options.bytes === Array ? Array.prototype.slice.call(message.newPhoto) : message.newPhoto; - if (message.newPhotoId != null && message.hasOwnProperty("newPhotoId")) - object.newPhotoId = message.newPhotoId; + if (message.details != null && message.hasOwnProperty("details")) + object.details = options.bytes === String ? $util.base64.encode(message.details, 0, message.details.length) : options.bytes === Array ? Array.prototype.slice.call(message.details) : message.details; + if (message.signature != null && message.hasOwnProperty("signature")) + object.signature = options.bytes === String ? $util.base64.encode(message.signature, 0, message.signature.length) : options.bytes === Array ? Array.prototype.slice.call(message.signature) : message.signature; return object; }; /** - * Converts this PhotoChange to JSON. + * Converts this NoiseCertificate to JSON. * @function toJSON - * @memberof proto.PhotoChange + * @memberof proto.NoiseCertificate * @instance * @returns {Object.} JSON object */ - PhotoChange.prototype.toJSON = function toJSON() { + NoiseCertificate.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return PhotoChange; + return NoiseCertificate; })(); - proto.MediaData = (function() { + proto.NoiseCertificateDetails = (function() { /** - * Properties of a MediaData. + * Properties of a NoiseCertificateDetails. * @memberof proto - * @interface IMediaData - * @property {string|null} [localPath] MediaData localPath + * @interface INoiseCertificateDetails + * @property {number|null} [serial] NoiseCertificateDetails serial + * @property {string|null} [issuer] NoiseCertificateDetails issuer + * @property {number|Long|null} [expires] NoiseCertificateDetails expires + * @property {string|null} [subject] NoiseCertificateDetails subject + * @property {Uint8Array|null} [key] NoiseCertificateDetails key */ /** - * Constructs a new MediaData. + * Constructs a new NoiseCertificateDetails. * @memberof proto - * @classdesc Represents a MediaData. - * @implements IMediaData + * @classdesc Represents a NoiseCertificateDetails. + * @implements INoiseCertificateDetails * @constructor - * @param {proto.IMediaData=} [properties] Properties to set + * @param {proto.INoiseCertificateDetails=} [properties] Properties to set */ - function MediaData(properties) { + function NoiseCertificateDetails(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -53744,75 +53024,127 @@ $root.proto = (function() { } /** - * MediaData localPath. - * @member {string} localPath - * @memberof proto.MediaData + * NoiseCertificateDetails serial. + * @member {number} serial + * @memberof proto.NoiseCertificateDetails * @instance */ - MediaData.prototype.localPath = ""; + NoiseCertificateDetails.prototype.serial = 0; /** - * Creates a new MediaData instance using the specified properties. + * NoiseCertificateDetails issuer. + * @member {string} issuer + * @memberof proto.NoiseCertificateDetails + * @instance + */ + NoiseCertificateDetails.prototype.issuer = ""; + + /** + * NoiseCertificateDetails expires. + * @member {number|Long} expires + * @memberof proto.NoiseCertificateDetails + * @instance + */ + NoiseCertificateDetails.prototype.expires = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * NoiseCertificateDetails subject. + * @member {string} subject + * @memberof proto.NoiseCertificateDetails + * @instance + */ + NoiseCertificateDetails.prototype.subject = ""; + + /** + * NoiseCertificateDetails key. + * @member {Uint8Array} key + * @memberof proto.NoiseCertificateDetails + * @instance + */ + NoiseCertificateDetails.prototype.key = $util.newBuffer([]); + + /** + * Creates a new NoiseCertificateDetails instance using the specified properties. * @function create - * @memberof proto.MediaData + * @memberof proto.NoiseCertificateDetails * @static - * @param {proto.IMediaData=} [properties] Properties to set - * @returns {proto.MediaData} MediaData instance + * @param {proto.INoiseCertificateDetails=} [properties] Properties to set + * @returns {proto.NoiseCertificateDetails} NoiseCertificateDetails instance */ - MediaData.create = function create(properties) { - return new MediaData(properties); + NoiseCertificateDetails.create = function create(properties) { + return new NoiseCertificateDetails(properties); }; /** - * Encodes the specified MediaData message. Does not implicitly {@link proto.MediaData.verify|verify} messages. + * Encodes the specified NoiseCertificateDetails message. Does not implicitly {@link proto.NoiseCertificateDetails.verify|verify} messages. * @function encode - * @memberof proto.MediaData + * @memberof proto.NoiseCertificateDetails * @static - * @param {proto.IMediaData} message MediaData message or plain object to encode + * @param {proto.INoiseCertificateDetails} message NoiseCertificateDetails message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - MediaData.encode = function encode(message, writer) { + NoiseCertificateDetails.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.localPath != null && Object.hasOwnProperty.call(message, "localPath")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.localPath); + if (message.serial != null && Object.hasOwnProperty.call(message, "serial")) + writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.serial); + if (message.issuer != null && Object.hasOwnProperty.call(message, "issuer")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.issuer); + if (message.expires != null && Object.hasOwnProperty.call(message, "expires")) + writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.expires); + if (message.subject != null && Object.hasOwnProperty.call(message, "subject")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.subject); + if (message.key != null && Object.hasOwnProperty.call(message, "key")) + writer.uint32(/* id 5, wireType 2 =*/42).bytes(message.key); return writer; }; /** - * Encodes the specified MediaData message, length delimited. Does not implicitly {@link proto.MediaData.verify|verify} messages. + * Encodes the specified NoiseCertificateDetails message, length delimited. Does not implicitly {@link proto.NoiseCertificateDetails.verify|verify} messages. * @function encodeDelimited - * @memberof proto.MediaData + * @memberof proto.NoiseCertificateDetails * @static - * @param {proto.IMediaData} message MediaData message or plain object to encode + * @param {proto.INoiseCertificateDetails} message NoiseCertificateDetails message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - MediaData.encodeDelimited = function encodeDelimited(message, writer) { + NoiseCertificateDetails.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a MediaData message from the specified reader or buffer. + * Decodes a NoiseCertificateDetails message from the specified reader or buffer. * @function decode - * @memberof proto.MediaData + * @memberof proto.NoiseCertificateDetails * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {proto.MediaData} MediaData + * @returns {proto.NoiseCertificateDetails} NoiseCertificateDetails * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - MediaData.decode = function decode(reader, length) { + NoiseCertificateDetails.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.MediaData(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.NoiseCertificateDetails(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.localPath = reader.string(); + message.serial = reader.uint32(); + break; + case 2: + message.issuer = reader.string(); + break; + case 3: + message.expires = reader.uint64(); + break; + case 4: + message.subject = reader.string(); + break; + case 5: + message.key = reader.bytes(); break; default: reader.skipType(tag & 7); @@ -53823,151 +53155,165 @@ $root.proto = (function() { }; /** - * Decodes a MediaData message from the specified reader or buffer, length delimited. + * Decodes a NoiseCertificateDetails message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof proto.MediaData + * @memberof proto.NoiseCertificateDetails * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.MediaData} MediaData + * @returns {proto.NoiseCertificateDetails} NoiseCertificateDetails * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - MediaData.decodeDelimited = function decodeDelimited(reader) { + NoiseCertificateDetails.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a MediaData message. + * Verifies a NoiseCertificateDetails message. * @function verify - * @memberof proto.MediaData + * @memberof proto.NoiseCertificateDetails * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - MediaData.verify = function verify(message) { + NoiseCertificateDetails.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.localPath != null && message.hasOwnProperty("localPath")) - if (!$util.isString(message.localPath)) - return "localPath: string expected"; + if (message.serial != null && message.hasOwnProperty("serial")) + if (!$util.isInteger(message.serial)) + return "serial: integer expected"; + if (message.issuer != null && message.hasOwnProperty("issuer")) + if (!$util.isString(message.issuer)) + return "issuer: string expected"; + if (message.expires != null && message.hasOwnProperty("expires")) + if (!$util.isInteger(message.expires) && !(message.expires && $util.isInteger(message.expires.low) && $util.isInteger(message.expires.high))) + return "expires: integer|Long expected"; + if (message.subject != null && message.hasOwnProperty("subject")) + if (!$util.isString(message.subject)) + return "subject: string expected"; + if (message.key != null && message.hasOwnProperty("key")) + if (!(message.key && typeof message.key.length === "number" || $util.isString(message.key))) + return "key: buffer expected"; return null; }; /** - * Creates a MediaData message from a plain object. Also converts values to their respective internal types. + * Creates a NoiseCertificateDetails message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof proto.MediaData + * @memberof proto.NoiseCertificateDetails * @static * @param {Object.} object Plain object - * @returns {proto.MediaData} MediaData + * @returns {proto.NoiseCertificateDetails} NoiseCertificateDetails */ - MediaData.fromObject = function fromObject(object) { - if (object instanceof $root.proto.MediaData) + NoiseCertificateDetails.fromObject = function fromObject(object) { + if (object instanceof $root.proto.NoiseCertificateDetails) return object; - var message = new $root.proto.MediaData(); - if (object.localPath != null) - message.localPath = String(object.localPath); + var message = new $root.proto.NoiseCertificateDetails(); + if (object.serial != null) + message.serial = object.serial >>> 0; + if (object.issuer != null) + message.issuer = String(object.issuer); + if (object.expires != null) + if ($util.Long) + (message.expires = $util.Long.fromValue(object.expires)).unsigned = true; + else if (typeof object.expires === "string") + message.expires = parseInt(object.expires, 10); + else if (typeof object.expires === "number") + message.expires = object.expires; + else if (typeof object.expires === "object") + message.expires = new $util.LongBits(object.expires.low >>> 0, object.expires.high >>> 0).toNumber(true); + if (object.subject != null) + message.subject = String(object.subject); + if (object.key != null) + if (typeof object.key === "string") + $util.base64.decode(object.key, message.key = $util.newBuffer($util.base64.length(object.key)), 0); + else if (object.key.length) + message.key = object.key; return message; }; /** - * Creates a plain object from a MediaData message. Also converts values to other types if specified. + * Creates a plain object from a NoiseCertificateDetails message. Also converts values to other types if specified. * @function toObject - * @memberof proto.MediaData + * @memberof proto.NoiseCertificateDetails * @static - * @param {proto.MediaData} message MediaData + * @param {proto.NoiseCertificateDetails} message NoiseCertificateDetails * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - MediaData.toObject = function toObject(message, options) { + NoiseCertificateDetails.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) - object.localPath = ""; - if (message.localPath != null && message.hasOwnProperty("localPath")) - object.localPath = message.localPath; + if (options.defaults) { + object.serial = 0; + object.issuer = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.expires = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.expires = options.longs === String ? "0" : 0; + object.subject = ""; + if (options.bytes === String) + object.key = ""; + else { + object.key = []; + if (options.bytes !== Array) + object.key = $util.newBuffer(object.key); + } + } + if (message.serial != null && message.hasOwnProperty("serial")) + object.serial = message.serial; + if (message.issuer != null && message.hasOwnProperty("issuer")) + object.issuer = message.issuer; + if (message.expires != null && message.hasOwnProperty("expires")) + if (typeof message.expires === "number") + object.expires = options.longs === String ? String(message.expires) : message.expires; + else + object.expires = options.longs === String ? $util.Long.prototype.toString.call(message.expires) : options.longs === Number ? new $util.LongBits(message.expires.low >>> 0, message.expires.high >>> 0).toNumber(true) : message.expires; + if (message.subject != null && message.hasOwnProperty("subject")) + object.subject = message.subject; + if (message.key != null && message.hasOwnProperty("key")) + object.key = options.bytes === String ? $util.base64.encode(message.key, 0, message.key.length) : options.bytes === Array ? Array.prototype.slice.call(message.key) : message.key; return object; }; /** - * Converts this MediaData to JSON. + * Converts this NoiseCertificateDetails to JSON. * @function toJSON - * @memberof proto.MediaData + * @memberof proto.NoiseCertificateDetails * @instance * @returns {Object.} JSON object */ - MediaData.prototype.toJSON = function toJSON() { + NoiseCertificateDetails.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return MediaData; + return NoiseCertificateDetails; })(); - proto.WebFeatures = (function() { + proto.ServerHello = (function() { /** - * Properties of a WebFeatures. + * Properties of a ServerHello. * @memberof proto - * @interface IWebFeatures - * @property {proto.WebFeatures.WebFeaturesFlag|null} [labelsDisplay] WebFeatures labelsDisplay - * @property {proto.WebFeatures.WebFeaturesFlag|null} [voipIndividualOutgoing] WebFeatures voipIndividualOutgoing - * @property {proto.WebFeatures.WebFeaturesFlag|null} [groupsV3] WebFeatures groupsV3 - * @property {proto.WebFeatures.WebFeaturesFlag|null} [groupsV3Create] WebFeatures groupsV3Create - * @property {proto.WebFeatures.WebFeaturesFlag|null} [changeNumberV2] WebFeatures changeNumberV2 - * @property {proto.WebFeatures.WebFeaturesFlag|null} [queryStatusV3Thumbnail] WebFeatures queryStatusV3Thumbnail - * @property {proto.WebFeatures.WebFeaturesFlag|null} [liveLocations] WebFeatures liveLocations - * @property {proto.WebFeatures.WebFeaturesFlag|null} [queryVname] WebFeatures queryVname - * @property {proto.WebFeatures.WebFeaturesFlag|null} [voipIndividualIncoming] WebFeatures voipIndividualIncoming - * @property {proto.WebFeatures.WebFeaturesFlag|null} [quickRepliesQuery] WebFeatures quickRepliesQuery - * @property {proto.WebFeatures.WebFeaturesFlag|null} [payments] WebFeatures payments - * @property {proto.WebFeatures.WebFeaturesFlag|null} [stickerPackQuery] WebFeatures stickerPackQuery - * @property {proto.WebFeatures.WebFeaturesFlag|null} [liveLocationsFinal] WebFeatures liveLocationsFinal - * @property {proto.WebFeatures.WebFeaturesFlag|null} [labelsEdit] WebFeatures labelsEdit - * @property {proto.WebFeatures.WebFeaturesFlag|null} [mediaUpload] WebFeatures mediaUpload - * @property {proto.WebFeatures.WebFeaturesFlag|null} [mediaUploadRichQuickReplies] WebFeatures mediaUploadRichQuickReplies - * @property {proto.WebFeatures.WebFeaturesFlag|null} [vnameV2] WebFeatures vnameV2 - * @property {proto.WebFeatures.WebFeaturesFlag|null} [videoPlaybackUrl] WebFeatures videoPlaybackUrl - * @property {proto.WebFeatures.WebFeaturesFlag|null} [statusRanking] WebFeatures statusRanking - * @property {proto.WebFeatures.WebFeaturesFlag|null} [voipIndividualVideo] WebFeatures voipIndividualVideo - * @property {proto.WebFeatures.WebFeaturesFlag|null} [thirdPartyStickers] WebFeatures thirdPartyStickers - * @property {proto.WebFeatures.WebFeaturesFlag|null} [frequentlyForwardedSetting] WebFeatures frequentlyForwardedSetting - * @property {proto.WebFeatures.WebFeaturesFlag|null} [groupsV4JoinPermission] WebFeatures groupsV4JoinPermission - * @property {proto.WebFeatures.WebFeaturesFlag|null} [recentStickers] WebFeatures recentStickers - * @property {proto.WebFeatures.WebFeaturesFlag|null} [catalog] WebFeatures catalog - * @property {proto.WebFeatures.WebFeaturesFlag|null} [starredStickers] WebFeatures starredStickers - * @property {proto.WebFeatures.WebFeaturesFlag|null} [voipGroupCall] WebFeatures voipGroupCall - * @property {proto.WebFeatures.WebFeaturesFlag|null} [templateMessage] WebFeatures templateMessage - * @property {proto.WebFeatures.WebFeaturesFlag|null} [templateMessageInteractivity] WebFeatures templateMessageInteractivity - * @property {proto.WebFeatures.WebFeaturesFlag|null} [ephemeralMessages] WebFeatures ephemeralMessages - * @property {proto.WebFeatures.WebFeaturesFlag|null} [e2ENotificationSync] WebFeatures e2ENotificationSync - * @property {proto.WebFeatures.WebFeaturesFlag|null} [recentStickersV2] WebFeatures recentStickersV2 - * @property {proto.WebFeatures.WebFeaturesFlag|null} [recentStickersV3] WebFeatures recentStickersV3 - * @property {proto.WebFeatures.WebFeaturesFlag|null} [userNotice] WebFeatures userNotice - * @property {proto.WebFeatures.WebFeaturesFlag|null} [support] WebFeatures support - * @property {proto.WebFeatures.WebFeaturesFlag|null} [groupUiiCleanup] WebFeatures groupUiiCleanup - * @property {proto.WebFeatures.WebFeaturesFlag|null} [groupDogfoodingInternalOnly] WebFeatures groupDogfoodingInternalOnly - * @property {proto.WebFeatures.WebFeaturesFlag|null} [settingsSync] WebFeatures settingsSync - * @property {proto.WebFeatures.WebFeaturesFlag|null} [archiveV2] WebFeatures archiveV2 - * @property {proto.WebFeatures.WebFeaturesFlag|null} [ephemeralAllowGroupMembers] WebFeatures ephemeralAllowGroupMembers - * @property {proto.WebFeatures.WebFeaturesFlag|null} [ephemeral24HDuration] WebFeatures ephemeral24HDuration - * @property {proto.WebFeatures.WebFeaturesFlag|null} [mdForceUpgrade] WebFeatures mdForceUpgrade - * @property {proto.WebFeatures.WebFeaturesFlag|null} [disappearingMode] WebFeatures disappearingMode - * @property {proto.WebFeatures.WebFeaturesFlag|null} [externalMdOptInAvailable] WebFeatures externalMdOptInAvailable - * @property {proto.WebFeatures.WebFeaturesFlag|null} [noDeleteMessageTimeLimit] WebFeatures noDeleteMessageTimeLimit + * @interface IServerHello + * @property {Uint8Array|null} [ephemeral] ServerHello ephemeral + * @property {Uint8Array|null} ["static"] ServerHello static + * @property {Uint8Array|null} [payload] ServerHello payload */ /** - * Constructs a new WebFeatures. + * Constructs a new ServerHello. * @memberof proto - * @classdesc Represents a WebFeatures. - * @implements IWebFeatures + * @classdesc Represents a ServerHello. + * @implements IServerHello * @constructor - * @param {proto.IWebFeatures=} [properties] Properties to set + * @param {proto.IServerHello=} [properties] Properties to set */ - function WebFeatures(properties) { + function ServerHello(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -53975,647 +53321,500 @@ $root.proto = (function() { } /** - * WebFeatures labelsDisplay. - * @member {proto.WebFeatures.WebFeaturesFlag} labelsDisplay - * @memberof proto.WebFeatures - * @instance - */ - WebFeatures.prototype.labelsDisplay = 0; - - /** - * WebFeatures voipIndividualOutgoing. - * @member {proto.WebFeatures.WebFeaturesFlag} voipIndividualOutgoing - * @memberof proto.WebFeatures + * ServerHello ephemeral. + * @member {Uint8Array} ephemeral + * @memberof proto.ServerHello * @instance */ - WebFeatures.prototype.voipIndividualOutgoing = 0; + ServerHello.prototype.ephemeral = $util.newBuffer([]); /** - * WebFeatures groupsV3. - * @member {proto.WebFeatures.WebFeaturesFlag} groupsV3 - * @memberof proto.WebFeatures + * ServerHello static. + * @member {Uint8Array} static + * @memberof proto.ServerHello * @instance */ - WebFeatures.prototype.groupsV3 = 0; + ServerHello.prototype["static"] = $util.newBuffer([]); /** - * WebFeatures groupsV3Create. - * @member {proto.WebFeatures.WebFeaturesFlag} groupsV3Create - * @memberof proto.WebFeatures + * ServerHello payload. + * @member {Uint8Array} payload + * @memberof proto.ServerHello * @instance */ - WebFeatures.prototype.groupsV3Create = 0; + ServerHello.prototype.payload = $util.newBuffer([]); /** - * WebFeatures changeNumberV2. - * @member {proto.WebFeatures.WebFeaturesFlag} changeNumberV2 - * @memberof proto.WebFeatures - * @instance + * Creates a new ServerHello instance using the specified properties. + * @function create + * @memberof proto.ServerHello + * @static + * @param {proto.IServerHello=} [properties] Properties to set + * @returns {proto.ServerHello} ServerHello instance */ - WebFeatures.prototype.changeNumberV2 = 0; + ServerHello.create = function create(properties) { + return new ServerHello(properties); + }; /** - * WebFeatures queryStatusV3Thumbnail. - * @member {proto.WebFeatures.WebFeaturesFlag} queryStatusV3Thumbnail - * @memberof proto.WebFeatures - * @instance + * Encodes the specified ServerHello message. Does not implicitly {@link proto.ServerHello.verify|verify} messages. + * @function encode + * @memberof proto.ServerHello + * @static + * @param {proto.IServerHello} message ServerHello message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - WebFeatures.prototype.queryStatusV3Thumbnail = 0; + ServerHello.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ephemeral != null && Object.hasOwnProperty.call(message, "ephemeral")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.ephemeral); + if (message["static"] != null && Object.hasOwnProperty.call(message, "static")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message["static"]); + if (message.payload != null && Object.hasOwnProperty.call(message, "payload")) + writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.payload); + return writer; + }; /** - * WebFeatures liveLocations. - * @member {proto.WebFeatures.WebFeaturesFlag} liveLocations - * @memberof proto.WebFeatures - * @instance + * Encodes the specified ServerHello message, length delimited. Does not implicitly {@link proto.ServerHello.verify|verify} messages. + * @function encodeDelimited + * @memberof proto.ServerHello + * @static + * @param {proto.IServerHello} message ServerHello message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - WebFeatures.prototype.liveLocations = 0; + ServerHello.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; /** - * WebFeatures queryVname. - * @member {proto.WebFeatures.WebFeaturesFlag} queryVname - * @memberof proto.WebFeatures - * @instance + * Decodes a ServerHello message from the specified reader or buffer. + * @function decode + * @memberof proto.ServerHello + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {proto.ServerHello} ServerHello + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - WebFeatures.prototype.queryVname = 0; + ServerHello.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.ServerHello(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.ephemeral = reader.bytes(); + break; + case 2: + message["static"] = reader.bytes(); + break; + case 3: + message.payload = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; /** - * WebFeatures voipIndividualIncoming. - * @member {proto.WebFeatures.WebFeaturesFlag} voipIndividualIncoming - * @memberof proto.WebFeatures - * @instance + * Decodes a ServerHello message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof proto.ServerHello + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {proto.ServerHello} ServerHello + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - WebFeatures.prototype.voipIndividualIncoming = 0; + ServerHello.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; /** - * WebFeatures quickRepliesQuery. - * @member {proto.WebFeatures.WebFeaturesFlag} quickRepliesQuery - * @memberof proto.WebFeatures - * @instance + * Verifies a ServerHello message. + * @function verify + * @memberof proto.ServerHello + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - WebFeatures.prototype.quickRepliesQuery = 0; + ServerHello.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.ephemeral != null && message.hasOwnProperty("ephemeral")) + if (!(message.ephemeral && typeof message.ephemeral.length === "number" || $util.isString(message.ephemeral))) + return "ephemeral: buffer expected"; + if (message["static"] != null && message.hasOwnProperty("static")) + if (!(message["static"] && typeof message["static"].length === "number" || $util.isString(message["static"]))) + return "static: buffer expected"; + if (message.payload != null && message.hasOwnProperty("payload")) + if (!(message.payload && typeof message.payload.length === "number" || $util.isString(message.payload))) + return "payload: buffer expected"; + return null; + }; /** - * WebFeatures payments. - * @member {proto.WebFeatures.WebFeaturesFlag} payments - * @memberof proto.WebFeatures - * @instance + * Creates a ServerHello message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof proto.ServerHello + * @static + * @param {Object.} object Plain object + * @returns {proto.ServerHello} ServerHello */ - WebFeatures.prototype.payments = 0; + ServerHello.fromObject = function fromObject(object) { + if (object instanceof $root.proto.ServerHello) + return object; + var message = new $root.proto.ServerHello(); + if (object.ephemeral != null) + if (typeof object.ephemeral === "string") + $util.base64.decode(object.ephemeral, message.ephemeral = $util.newBuffer($util.base64.length(object.ephemeral)), 0); + else if (object.ephemeral.length) + message.ephemeral = object.ephemeral; + if (object["static"] != null) + if (typeof object["static"] === "string") + $util.base64.decode(object["static"], message["static"] = $util.newBuffer($util.base64.length(object["static"])), 0); + else if (object["static"].length) + message["static"] = object["static"]; + if (object.payload != null) + if (typeof object.payload === "string") + $util.base64.decode(object.payload, message.payload = $util.newBuffer($util.base64.length(object.payload)), 0); + else if (object.payload.length) + message.payload = object.payload; + return message; + }; /** - * WebFeatures stickerPackQuery. - * @member {proto.WebFeatures.WebFeaturesFlag} stickerPackQuery - * @memberof proto.WebFeatures - * @instance + * Creates a plain object from a ServerHello message. Also converts values to other types if specified. + * @function toObject + * @memberof proto.ServerHello + * @static + * @param {proto.ServerHello} message ServerHello + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object */ - WebFeatures.prototype.stickerPackQuery = 0; + ServerHello.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.ephemeral = ""; + else { + object.ephemeral = []; + if (options.bytes !== Array) + object.ephemeral = $util.newBuffer(object.ephemeral); + } + if (options.bytes === String) + object["static"] = ""; + else { + object["static"] = []; + if (options.bytes !== Array) + object["static"] = $util.newBuffer(object["static"]); + } + if (options.bytes === String) + object.payload = ""; + else { + object.payload = []; + if (options.bytes !== Array) + object.payload = $util.newBuffer(object.payload); + } + } + if (message.ephemeral != null && message.hasOwnProperty("ephemeral")) + object.ephemeral = options.bytes === String ? $util.base64.encode(message.ephemeral, 0, message.ephemeral.length) : options.bytes === Array ? Array.prototype.slice.call(message.ephemeral) : message.ephemeral; + if (message["static"] != null && message.hasOwnProperty("static")) + object["static"] = options.bytes === String ? $util.base64.encode(message["static"], 0, message["static"].length) : options.bytes === Array ? Array.prototype.slice.call(message["static"]) : message["static"]; + if (message.payload != null && message.hasOwnProperty("payload")) + object.payload = options.bytes === String ? $util.base64.encode(message.payload, 0, message.payload.length) : options.bytes === Array ? Array.prototype.slice.call(message.payload) : message.payload; + return object; + }; /** - * WebFeatures liveLocationsFinal. - * @member {proto.WebFeatures.WebFeaturesFlag} liveLocationsFinal - * @memberof proto.WebFeatures + * Converts this ServerHello to JSON. + * @function toJSON + * @memberof proto.ServerHello * @instance + * @returns {Object.} JSON object */ - WebFeatures.prototype.liveLocationsFinal = 0; + ServerHello.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * WebFeatures labelsEdit. - * @member {proto.WebFeatures.WebFeaturesFlag} labelsEdit - * @memberof proto.WebFeatures - * @instance - */ - WebFeatures.prototype.labelsEdit = 0; + return ServerHello; + })(); - /** - * WebFeatures mediaUpload. - * @member {proto.WebFeatures.WebFeaturesFlag} mediaUpload - * @memberof proto.WebFeatures - * @instance - */ - WebFeatures.prototype.mediaUpload = 0; + proto.UserAgent = (function() { /** - * WebFeatures mediaUploadRichQuickReplies. - * @member {proto.WebFeatures.WebFeaturesFlag} mediaUploadRichQuickReplies - * @memberof proto.WebFeatures - * @instance + * Properties of a UserAgent. + * @memberof proto + * @interface IUserAgent + * @property {proto.UserAgent.UserAgentPlatform|null} [platform] UserAgent platform + * @property {proto.IAppVersion|null} [appVersion] UserAgent appVersion + * @property {string|null} [mcc] UserAgent mcc + * @property {string|null} [mnc] UserAgent mnc + * @property {string|null} [osVersion] UserAgent osVersion + * @property {string|null} [manufacturer] UserAgent manufacturer + * @property {string|null} [device] UserAgent device + * @property {string|null} [osBuildNumber] UserAgent osBuildNumber + * @property {string|null} [phoneId] UserAgent phoneId + * @property {proto.UserAgent.UserAgentReleaseChannel|null} [releaseChannel] UserAgent releaseChannel + * @property {string|null} [localeLanguageIso6391] UserAgent localeLanguageIso6391 + * @property {string|null} [localeCountryIso31661Alpha2] UserAgent localeCountryIso31661Alpha2 + * @property {string|null} [deviceBoard] UserAgent deviceBoard */ - WebFeatures.prototype.mediaUploadRichQuickReplies = 0; /** - * WebFeatures vnameV2. - * @member {proto.WebFeatures.WebFeaturesFlag} vnameV2 - * @memberof proto.WebFeatures - * @instance + * Constructs a new UserAgent. + * @memberof proto + * @classdesc Represents a UserAgent. + * @implements IUserAgent + * @constructor + * @param {proto.IUserAgent=} [properties] Properties to set */ - WebFeatures.prototype.vnameV2 = 0; + function UserAgent(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } /** - * WebFeatures videoPlaybackUrl. - * @member {proto.WebFeatures.WebFeaturesFlag} videoPlaybackUrl - * @memberof proto.WebFeatures + * UserAgent platform. + * @member {proto.UserAgent.UserAgentPlatform} platform + * @memberof proto.UserAgent * @instance */ - WebFeatures.prototype.videoPlaybackUrl = 0; + UserAgent.prototype.platform = 0; /** - * WebFeatures statusRanking. - * @member {proto.WebFeatures.WebFeaturesFlag} statusRanking - * @memberof proto.WebFeatures + * UserAgent appVersion. + * @member {proto.IAppVersion|null|undefined} appVersion + * @memberof proto.UserAgent * @instance */ - WebFeatures.prototype.statusRanking = 0; + UserAgent.prototype.appVersion = null; /** - * WebFeatures voipIndividualVideo. - * @member {proto.WebFeatures.WebFeaturesFlag} voipIndividualVideo - * @memberof proto.WebFeatures + * UserAgent mcc. + * @member {string} mcc + * @memberof proto.UserAgent * @instance */ - WebFeatures.prototype.voipIndividualVideo = 0; + UserAgent.prototype.mcc = ""; /** - * WebFeatures thirdPartyStickers. - * @member {proto.WebFeatures.WebFeaturesFlag} thirdPartyStickers - * @memberof proto.WebFeatures + * UserAgent mnc. + * @member {string} mnc + * @memberof proto.UserAgent * @instance */ - WebFeatures.prototype.thirdPartyStickers = 0; + UserAgent.prototype.mnc = ""; /** - * WebFeatures frequentlyForwardedSetting. - * @member {proto.WebFeatures.WebFeaturesFlag} frequentlyForwardedSetting - * @memberof proto.WebFeatures + * UserAgent osVersion. + * @member {string} osVersion + * @memberof proto.UserAgent * @instance */ - WebFeatures.prototype.frequentlyForwardedSetting = 0; + UserAgent.prototype.osVersion = ""; /** - * WebFeatures groupsV4JoinPermission. - * @member {proto.WebFeatures.WebFeaturesFlag} groupsV4JoinPermission - * @memberof proto.WebFeatures + * UserAgent manufacturer. + * @member {string} manufacturer + * @memberof proto.UserAgent * @instance */ - WebFeatures.prototype.groupsV4JoinPermission = 0; + UserAgent.prototype.manufacturer = ""; /** - * WebFeatures recentStickers. - * @member {proto.WebFeatures.WebFeaturesFlag} recentStickers - * @memberof proto.WebFeatures + * UserAgent device. + * @member {string} device + * @memberof proto.UserAgent * @instance */ - WebFeatures.prototype.recentStickers = 0; + UserAgent.prototype.device = ""; /** - * WebFeatures catalog. - * @member {proto.WebFeatures.WebFeaturesFlag} catalog - * @memberof proto.WebFeatures + * UserAgent osBuildNumber. + * @member {string} osBuildNumber + * @memberof proto.UserAgent * @instance */ - WebFeatures.prototype.catalog = 0; + UserAgent.prototype.osBuildNumber = ""; /** - * WebFeatures starredStickers. - * @member {proto.WebFeatures.WebFeaturesFlag} starredStickers - * @memberof proto.WebFeatures + * UserAgent phoneId. + * @member {string} phoneId + * @memberof proto.UserAgent * @instance */ - WebFeatures.prototype.starredStickers = 0; + UserAgent.prototype.phoneId = ""; /** - * WebFeatures voipGroupCall. - * @member {proto.WebFeatures.WebFeaturesFlag} voipGroupCall - * @memberof proto.WebFeatures + * UserAgent releaseChannel. + * @member {proto.UserAgent.UserAgentReleaseChannel} releaseChannel + * @memberof proto.UserAgent * @instance */ - WebFeatures.prototype.voipGroupCall = 0; + UserAgent.prototype.releaseChannel = 0; /** - * WebFeatures templateMessage. - * @member {proto.WebFeatures.WebFeaturesFlag} templateMessage - * @memberof proto.WebFeatures + * UserAgent localeLanguageIso6391. + * @member {string} localeLanguageIso6391 + * @memberof proto.UserAgent * @instance */ - WebFeatures.prototype.templateMessage = 0; + UserAgent.prototype.localeLanguageIso6391 = ""; /** - * WebFeatures templateMessageInteractivity. - * @member {proto.WebFeatures.WebFeaturesFlag} templateMessageInteractivity - * @memberof proto.WebFeatures + * UserAgent localeCountryIso31661Alpha2. + * @member {string} localeCountryIso31661Alpha2 + * @memberof proto.UserAgent * @instance */ - WebFeatures.prototype.templateMessageInteractivity = 0; + UserAgent.prototype.localeCountryIso31661Alpha2 = ""; /** - * WebFeatures ephemeralMessages. - * @member {proto.WebFeatures.WebFeaturesFlag} ephemeralMessages - * @memberof proto.WebFeatures + * UserAgent deviceBoard. + * @member {string} deviceBoard + * @memberof proto.UserAgent * @instance */ - WebFeatures.prototype.ephemeralMessages = 0; + UserAgent.prototype.deviceBoard = ""; /** - * WebFeatures e2ENotificationSync. - * @member {proto.WebFeatures.WebFeaturesFlag} e2ENotificationSync - * @memberof proto.WebFeatures - * @instance + * Creates a new UserAgent instance using the specified properties. + * @function create + * @memberof proto.UserAgent + * @static + * @param {proto.IUserAgent=} [properties] Properties to set + * @returns {proto.UserAgent} UserAgent instance */ - WebFeatures.prototype.e2ENotificationSync = 0; + UserAgent.create = function create(properties) { + return new UserAgent(properties); + }; /** - * WebFeatures recentStickersV2. - * @member {proto.WebFeatures.WebFeaturesFlag} recentStickersV2 - * @memberof proto.WebFeatures - * @instance + * Encodes the specified UserAgent message. Does not implicitly {@link proto.UserAgent.verify|verify} messages. + * @function encode + * @memberof proto.UserAgent + * @static + * @param {proto.IUserAgent} message UserAgent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - WebFeatures.prototype.recentStickersV2 = 0; + UserAgent.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.platform != null && Object.hasOwnProperty.call(message, "platform")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.platform); + if (message.appVersion != null && Object.hasOwnProperty.call(message, "appVersion")) + $root.proto.AppVersion.encode(message.appVersion, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.mcc != null && Object.hasOwnProperty.call(message, "mcc")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.mcc); + if (message.mnc != null && Object.hasOwnProperty.call(message, "mnc")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.mnc); + if (message.osVersion != null && Object.hasOwnProperty.call(message, "osVersion")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.osVersion); + if (message.manufacturer != null && Object.hasOwnProperty.call(message, "manufacturer")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.manufacturer); + if (message.device != null && Object.hasOwnProperty.call(message, "device")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.device); + if (message.osBuildNumber != null && Object.hasOwnProperty.call(message, "osBuildNumber")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.osBuildNumber); + if (message.phoneId != null && Object.hasOwnProperty.call(message, "phoneId")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.phoneId); + if (message.releaseChannel != null && Object.hasOwnProperty.call(message, "releaseChannel")) + writer.uint32(/* id 10, wireType 0 =*/80).int32(message.releaseChannel); + if (message.localeLanguageIso6391 != null && Object.hasOwnProperty.call(message, "localeLanguageIso6391")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.localeLanguageIso6391); + if (message.localeCountryIso31661Alpha2 != null && Object.hasOwnProperty.call(message, "localeCountryIso31661Alpha2")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.localeCountryIso31661Alpha2); + if (message.deviceBoard != null && Object.hasOwnProperty.call(message, "deviceBoard")) + writer.uint32(/* id 13, wireType 2 =*/106).string(message.deviceBoard); + return writer; + }; /** - * WebFeatures recentStickersV3. - * @member {proto.WebFeatures.WebFeaturesFlag} recentStickersV3 - * @memberof proto.WebFeatures - * @instance + * Encodes the specified UserAgent message, length delimited. Does not implicitly {@link proto.UserAgent.verify|verify} messages. + * @function encodeDelimited + * @memberof proto.UserAgent + * @static + * @param {proto.IUserAgent} message UserAgent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - WebFeatures.prototype.recentStickersV3 = 0; + UserAgent.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; /** - * WebFeatures userNotice. - * @member {proto.WebFeatures.WebFeaturesFlag} userNotice - * @memberof proto.WebFeatures - * @instance - */ - WebFeatures.prototype.userNotice = 0; - - /** - * WebFeatures support. - * @member {proto.WebFeatures.WebFeaturesFlag} support - * @memberof proto.WebFeatures - * @instance - */ - WebFeatures.prototype.support = 0; - - /** - * WebFeatures groupUiiCleanup. - * @member {proto.WebFeatures.WebFeaturesFlag} groupUiiCleanup - * @memberof proto.WebFeatures - * @instance - */ - WebFeatures.prototype.groupUiiCleanup = 0; - - /** - * WebFeatures groupDogfoodingInternalOnly. - * @member {proto.WebFeatures.WebFeaturesFlag} groupDogfoodingInternalOnly - * @memberof proto.WebFeatures - * @instance - */ - WebFeatures.prototype.groupDogfoodingInternalOnly = 0; - - /** - * WebFeatures settingsSync. - * @member {proto.WebFeatures.WebFeaturesFlag} settingsSync - * @memberof proto.WebFeatures - * @instance - */ - WebFeatures.prototype.settingsSync = 0; - - /** - * WebFeatures archiveV2. - * @member {proto.WebFeatures.WebFeaturesFlag} archiveV2 - * @memberof proto.WebFeatures - * @instance - */ - WebFeatures.prototype.archiveV2 = 0; - - /** - * WebFeatures ephemeralAllowGroupMembers. - * @member {proto.WebFeatures.WebFeaturesFlag} ephemeralAllowGroupMembers - * @memberof proto.WebFeatures - * @instance - */ - WebFeatures.prototype.ephemeralAllowGroupMembers = 0; - - /** - * WebFeatures ephemeral24HDuration. - * @member {proto.WebFeatures.WebFeaturesFlag} ephemeral24HDuration - * @memberof proto.WebFeatures - * @instance - */ - WebFeatures.prototype.ephemeral24HDuration = 0; - - /** - * WebFeatures mdForceUpgrade. - * @member {proto.WebFeatures.WebFeaturesFlag} mdForceUpgrade - * @memberof proto.WebFeatures - * @instance - */ - WebFeatures.prototype.mdForceUpgrade = 0; - - /** - * WebFeatures disappearingMode. - * @member {proto.WebFeatures.WebFeaturesFlag} disappearingMode - * @memberof proto.WebFeatures - * @instance - */ - WebFeatures.prototype.disappearingMode = 0; - - /** - * WebFeatures externalMdOptInAvailable. - * @member {proto.WebFeatures.WebFeaturesFlag} externalMdOptInAvailable - * @memberof proto.WebFeatures - * @instance - */ - WebFeatures.prototype.externalMdOptInAvailable = 0; - - /** - * WebFeatures noDeleteMessageTimeLimit. - * @member {proto.WebFeatures.WebFeaturesFlag} noDeleteMessageTimeLimit - * @memberof proto.WebFeatures - * @instance - */ - WebFeatures.prototype.noDeleteMessageTimeLimit = 0; - - /** - * Creates a new WebFeatures instance using the specified properties. - * @function create - * @memberof proto.WebFeatures - * @static - * @param {proto.IWebFeatures=} [properties] Properties to set - * @returns {proto.WebFeatures} WebFeatures instance - */ - WebFeatures.create = function create(properties) { - return new WebFeatures(properties); - }; - - /** - * Encodes the specified WebFeatures message. Does not implicitly {@link proto.WebFeatures.verify|verify} messages. - * @function encode - * @memberof proto.WebFeatures - * @static - * @param {proto.IWebFeatures} message WebFeatures message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - WebFeatures.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.labelsDisplay != null && Object.hasOwnProperty.call(message, "labelsDisplay")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.labelsDisplay); - if (message.voipIndividualOutgoing != null && Object.hasOwnProperty.call(message, "voipIndividualOutgoing")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.voipIndividualOutgoing); - if (message.groupsV3 != null && Object.hasOwnProperty.call(message, "groupsV3")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.groupsV3); - if (message.groupsV3Create != null && Object.hasOwnProperty.call(message, "groupsV3Create")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.groupsV3Create); - if (message.changeNumberV2 != null && Object.hasOwnProperty.call(message, "changeNumberV2")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.changeNumberV2); - if (message.queryStatusV3Thumbnail != null && Object.hasOwnProperty.call(message, "queryStatusV3Thumbnail")) - writer.uint32(/* id 6, wireType 0 =*/48).int32(message.queryStatusV3Thumbnail); - if (message.liveLocations != null && Object.hasOwnProperty.call(message, "liveLocations")) - writer.uint32(/* id 7, wireType 0 =*/56).int32(message.liveLocations); - if (message.queryVname != null && Object.hasOwnProperty.call(message, "queryVname")) - writer.uint32(/* id 8, wireType 0 =*/64).int32(message.queryVname); - if (message.voipIndividualIncoming != null && Object.hasOwnProperty.call(message, "voipIndividualIncoming")) - writer.uint32(/* id 9, wireType 0 =*/72).int32(message.voipIndividualIncoming); - if (message.quickRepliesQuery != null && Object.hasOwnProperty.call(message, "quickRepliesQuery")) - writer.uint32(/* id 10, wireType 0 =*/80).int32(message.quickRepliesQuery); - if (message.payments != null && Object.hasOwnProperty.call(message, "payments")) - writer.uint32(/* id 11, wireType 0 =*/88).int32(message.payments); - if (message.stickerPackQuery != null && Object.hasOwnProperty.call(message, "stickerPackQuery")) - writer.uint32(/* id 12, wireType 0 =*/96).int32(message.stickerPackQuery); - if (message.liveLocationsFinal != null && Object.hasOwnProperty.call(message, "liveLocationsFinal")) - writer.uint32(/* id 13, wireType 0 =*/104).int32(message.liveLocationsFinal); - if (message.labelsEdit != null && Object.hasOwnProperty.call(message, "labelsEdit")) - writer.uint32(/* id 14, wireType 0 =*/112).int32(message.labelsEdit); - if (message.mediaUpload != null && Object.hasOwnProperty.call(message, "mediaUpload")) - writer.uint32(/* id 15, wireType 0 =*/120).int32(message.mediaUpload); - if (message.mediaUploadRichQuickReplies != null && Object.hasOwnProperty.call(message, "mediaUploadRichQuickReplies")) - writer.uint32(/* id 18, wireType 0 =*/144).int32(message.mediaUploadRichQuickReplies); - if (message.vnameV2 != null && Object.hasOwnProperty.call(message, "vnameV2")) - writer.uint32(/* id 19, wireType 0 =*/152).int32(message.vnameV2); - if (message.videoPlaybackUrl != null && Object.hasOwnProperty.call(message, "videoPlaybackUrl")) - writer.uint32(/* id 20, wireType 0 =*/160).int32(message.videoPlaybackUrl); - if (message.statusRanking != null && Object.hasOwnProperty.call(message, "statusRanking")) - writer.uint32(/* id 21, wireType 0 =*/168).int32(message.statusRanking); - if (message.voipIndividualVideo != null && Object.hasOwnProperty.call(message, "voipIndividualVideo")) - writer.uint32(/* id 22, wireType 0 =*/176).int32(message.voipIndividualVideo); - if (message.thirdPartyStickers != null && Object.hasOwnProperty.call(message, "thirdPartyStickers")) - writer.uint32(/* id 23, wireType 0 =*/184).int32(message.thirdPartyStickers); - if (message.frequentlyForwardedSetting != null && Object.hasOwnProperty.call(message, "frequentlyForwardedSetting")) - writer.uint32(/* id 24, wireType 0 =*/192).int32(message.frequentlyForwardedSetting); - if (message.groupsV4JoinPermission != null && Object.hasOwnProperty.call(message, "groupsV4JoinPermission")) - writer.uint32(/* id 25, wireType 0 =*/200).int32(message.groupsV4JoinPermission); - if (message.recentStickers != null && Object.hasOwnProperty.call(message, "recentStickers")) - writer.uint32(/* id 26, wireType 0 =*/208).int32(message.recentStickers); - if (message.catalog != null && Object.hasOwnProperty.call(message, "catalog")) - writer.uint32(/* id 27, wireType 0 =*/216).int32(message.catalog); - if (message.starredStickers != null && Object.hasOwnProperty.call(message, "starredStickers")) - writer.uint32(/* id 28, wireType 0 =*/224).int32(message.starredStickers); - if (message.voipGroupCall != null && Object.hasOwnProperty.call(message, "voipGroupCall")) - writer.uint32(/* id 29, wireType 0 =*/232).int32(message.voipGroupCall); - if (message.templateMessage != null && Object.hasOwnProperty.call(message, "templateMessage")) - writer.uint32(/* id 30, wireType 0 =*/240).int32(message.templateMessage); - if (message.templateMessageInteractivity != null && Object.hasOwnProperty.call(message, "templateMessageInteractivity")) - writer.uint32(/* id 31, wireType 0 =*/248).int32(message.templateMessageInteractivity); - if (message.ephemeralMessages != null && Object.hasOwnProperty.call(message, "ephemeralMessages")) - writer.uint32(/* id 32, wireType 0 =*/256).int32(message.ephemeralMessages); - if (message.e2ENotificationSync != null && Object.hasOwnProperty.call(message, "e2ENotificationSync")) - writer.uint32(/* id 33, wireType 0 =*/264).int32(message.e2ENotificationSync); - if (message.recentStickersV2 != null && Object.hasOwnProperty.call(message, "recentStickersV2")) - writer.uint32(/* id 34, wireType 0 =*/272).int32(message.recentStickersV2); - if (message.recentStickersV3 != null && Object.hasOwnProperty.call(message, "recentStickersV3")) - writer.uint32(/* id 36, wireType 0 =*/288).int32(message.recentStickersV3); - if (message.userNotice != null && Object.hasOwnProperty.call(message, "userNotice")) - writer.uint32(/* id 37, wireType 0 =*/296).int32(message.userNotice); - if (message.support != null && Object.hasOwnProperty.call(message, "support")) - writer.uint32(/* id 39, wireType 0 =*/312).int32(message.support); - if (message.groupUiiCleanup != null && Object.hasOwnProperty.call(message, "groupUiiCleanup")) - writer.uint32(/* id 40, wireType 0 =*/320).int32(message.groupUiiCleanup); - if (message.groupDogfoodingInternalOnly != null && Object.hasOwnProperty.call(message, "groupDogfoodingInternalOnly")) - writer.uint32(/* id 41, wireType 0 =*/328).int32(message.groupDogfoodingInternalOnly); - if (message.settingsSync != null && Object.hasOwnProperty.call(message, "settingsSync")) - writer.uint32(/* id 42, wireType 0 =*/336).int32(message.settingsSync); - if (message.archiveV2 != null && Object.hasOwnProperty.call(message, "archiveV2")) - writer.uint32(/* id 43, wireType 0 =*/344).int32(message.archiveV2); - if (message.ephemeralAllowGroupMembers != null && Object.hasOwnProperty.call(message, "ephemeralAllowGroupMembers")) - writer.uint32(/* id 44, wireType 0 =*/352).int32(message.ephemeralAllowGroupMembers); - if (message.ephemeral24HDuration != null && Object.hasOwnProperty.call(message, "ephemeral24HDuration")) - writer.uint32(/* id 45, wireType 0 =*/360).int32(message.ephemeral24HDuration); - if (message.mdForceUpgrade != null && Object.hasOwnProperty.call(message, "mdForceUpgrade")) - writer.uint32(/* id 46, wireType 0 =*/368).int32(message.mdForceUpgrade); - if (message.disappearingMode != null && Object.hasOwnProperty.call(message, "disappearingMode")) - writer.uint32(/* id 47, wireType 0 =*/376).int32(message.disappearingMode); - if (message.externalMdOptInAvailable != null && Object.hasOwnProperty.call(message, "externalMdOptInAvailable")) - writer.uint32(/* id 48, wireType 0 =*/384).int32(message.externalMdOptInAvailable); - if (message.noDeleteMessageTimeLimit != null && Object.hasOwnProperty.call(message, "noDeleteMessageTimeLimit")) - writer.uint32(/* id 49, wireType 0 =*/392).int32(message.noDeleteMessageTimeLimit); - return writer; - }; - - /** - * Encodes the specified WebFeatures message, length delimited. Does not implicitly {@link proto.WebFeatures.verify|verify} messages. - * @function encodeDelimited - * @memberof proto.WebFeatures - * @static - * @param {proto.IWebFeatures} message WebFeatures message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - WebFeatures.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a WebFeatures message from the specified reader or buffer. + * Decodes a UserAgent message from the specified reader or buffer. * @function decode - * @memberof proto.WebFeatures + * @memberof proto.UserAgent * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {proto.WebFeatures} WebFeatures + * @returns {proto.UserAgent} UserAgent * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - WebFeatures.decode = function decode(reader, length) { + UserAgent.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.WebFeatures(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.UserAgent(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.labelsDisplay = reader.int32(); + message.platform = reader.int32(); break; case 2: - message.voipIndividualOutgoing = reader.int32(); + message.appVersion = $root.proto.AppVersion.decode(reader, reader.uint32()); break; case 3: - message.groupsV3 = reader.int32(); + message.mcc = reader.string(); break; case 4: - message.groupsV3Create = reader.int32(); + message.mnc = reader.string(); break; case 5: - message.changeNumberV2 = reader.int32(); + message.osVersion = reader.string(); break; case 6: - message.queryStatusV3Thumbnail = reader.int32(); + message.manufacturer = reader.string(); break; case 7: - message.liveLocations = reader.int32(); + message.device = reader.string(); break; case 8: - message.queryVname = reader.int32(); + message.osBuildNumber = reader.string(); break; case 9: - message.voipIndividualIncoming = reader.int32(); + message.phoneId = reader.string(); break; case 10: - message.quickRepliesQuery = reader.int32(); + message.releaseChannel = reader.int32(); break; case 11: - message.payments = reader.int32(); + message.localeLanguageIso6391 = reader.string(); break; case 12: - message.stickerPackQuery = reader.int32(); + message.localeCountryIso31661Alpha2 = reader.string(); break; case 13: - message.liveLocationsFinal = reader.int32(); - break; - case 14: - message.labelsEdit = reader.int32(); - break; - case 15: - message.mediaUpload = reader.int32(); - break; - case 18: - message.mediaUploadRichQuickReplies = reader.int32(); - break; - case 19: - message.vnameV2 = reader.int32(); - break; - case 20: - message.videoPlaybackUrl = reader.int32(); - break; - case 21: - message.statusRanking = reader.int32(); - break; - case 22: - message.voipIndividualVideo = reader.int32(); - break; - case 23: - message.thirdPartyStickers = reader.int32(); - break; - case 24: - message.frequentlyForwardedSetting = reader.int32(); - break; - case 25: - message.groupsV4JoinPermission = reader.int32(); - break; - case 26: - message.recentStickers = reader.int32(); - break; - case 27: - message.catalog = reader.int32(); - break; - case 28: - message.starredStickers = reader.int32(); - break; - case 29: - message.voipGroupCall = reader.int32(); - break; - case 30: - message.templateMessage = reader.int32(); - break; - case 31: - message.templateMessageInteractivity = reader.int32(); - break; - case 32: - message.ephemeralMessages = reader.int32(); - break; - case 33: - message.e2ENotificationSync = reader.int32(); - break; - case 34: - message.recentStickersV2 = reader.int32(); - break; - case 36: - message.recentStickersV3 = reader.int32(); - break; - case 37: - message.userNotice = reader.int32(); - break; - case 39: - message.support = reader.int32(); - break; - case 40: - message.groupUiiCleanup = reader.int32(); - break; - case 41: - message.groupDogfoodingInternalOnly = reader.int32(); - break; - case 42: - message.settingsSync = reader.int32(); - break; - case 43: - message.archiveV2 = reader.int32(); - break; - case 44: - message.ephemeralAllowGroupMembers = reader.int32(); - break; - case 45: - message.ephemeral24HDuration = reader.int32(); - break; - case 46: - message.mdForceUpgrade = reader.int32(); - break; - case 47: - message.disappearingMode = reader.int32(); - break; - case 48: - message.externalMdOptInAvailable = reader.int32(); - break; - case 49: - message.noDeleteMessageTimeLimit = reader.int32(); + message.deviceBoard = reader.string(); break; default: reader.skipType(tag & 7); @@ -54626,1516 +53825,476 @@ $root.proto = (function() { }; /** - * Decodes a WebFeatures message from the specified reader or buffer, length delimited. + * Decodes a UserAgent message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof proto.WebFeatures + * @memberof proto.UserAgent * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.WebFeatures} WebFeatures + * @returns {proto.UserAgent} UserAgent * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - WebFeatures.decodeDelimited = function decodeDelimited(reader) { + UserAgent.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a WebFeatures message. + * Verifies a UserAgent message. * @function verify - * @memberof proto.WebFeatures + * @memberof proto.UserAgent * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - WebFeatures.verify = function verify(message) { + UserAgent.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.labelsDisplay != null && message.hasOwnProperty("labelsDisplay")) - switch (message.labelsDisplay) { - default: - return "labelsDisplay: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.voipIndividualOutgoing != null && message.hasOwnProperty("voipIndividualOutgoing")) - switch (message.voipIndividualOutgoing) { - default: - return "voipIndividualOutgoing: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.groupsV3 != null && message.hasOwnProperty("groupsV3")) - switch (message.groupsV3) { - default: - return "groupsV3: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.groupsV3Create != null && message.hasOwnProperty("groupsV3Create")) - switch (message.groupsV3Create) { - default: - return "groupsV3Create: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.changeNumberV2 != null && message.hasOwnProperty("changeNumberV2")) - switch (message.changeNumberV2) { - default: - return "changeNumberV2: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.queryStatusV3Thumbnail != null && message.hasOwnProperty("queryStatusV3Thumbnail")) - switch (message.queryStatusV3Thumbnail) { - default: - return "queryStatusV3Thumbnail: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.liveLocations != null && message.hasOwnProperty("liveLocations")) - switch (message.liveLocations) { - default: - return "liveLocations: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.queryVname != null && message.hasOwnProperty("queryVname")) - switch (message.queryVname) { - default: - return "queryVname: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.voipIndividualIncoming != null && message.hasOwnProperty("voipIndividualIncoming")) - switch (message.voipIndividualIncoming) { + if (message.platform != null && message.hasOwnProperty("platform")) + switch (message.platform) { default: - return "voipIndividualIncoming: enum value expected"; + return "platform: enum value expected"; case 0: case 1: case 2: case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + case 14: + case 15: + case 16: + case 17: + case 18: + case 19: + case 20: + case 21: + case 22: + case 23: + case 24: + case 25: + case 26: + case 27: + case 28: break; } - if (message.quickRepliesQuery != null && message.hasOwnProperty("quickRepliesQuery")) - switch (message.quickRepliesQuery) { + if (message.appVersion != null && message.hasOwnProperty("appVersion")) { + var error = $root.proto.AppVersion.verify(message.appVersion); + if (error) + return "appVersion." + error; + } + if (message.mcc != null && message.hasOwnProperty("mcc")) + if (!$util.isString(message.mcc)) + return "mcc: string expected"; + if (message.mnc != null && message.hasOwnProperty("mnc")) + if (!$util.isString(message.mnc)) + return "mnc: string expected"; + if (message.osVersion != null && message.hasOwnProperty("osVersion")) + if (!$util.isString(message.osVersion)) + return "osVersion: string expected"; + if (message.manufacturer != null && message.hasOwnProperty("manufacturer")) + if (!$util.isString(message.manufacturer)) + return "manufacturer: string expected"; + if (message.device != null && message.hasOwnProperty("device")) + if (!$util.isString(message.device)) + return "device: string expected"; + if (message.osBuildNumber != null && message.hasOwnProperty("osBuildNumber")) + if (!$util.isString(message.osBuildNumber)) + return "osBuildNumber: string expected"; + if (message.phoneId != null && message.hasOwnProperty("phoneId")) + if (!$util.isString(message.phoneId)) + return "phoneId: string expected"; + if (message.releaseChannel != null && message.hasOwnProperty("releaseChannel")) + switch (message.releaseChannel) { default: - return "quickRepliesQuery: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.payments != null && message.hasOwnProperty("payments")) - switch (message.payments) { - default: - return "payments: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.stickerPackQuery != null && message.hasOwnProperty("stickerPackQuery")) - switch (message.stickerPackQuery) { - default: - return "stickerPackQuery: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.liveLocationsFinal != null && message.hasOwnProperty("liveLocationsFinal")) - switch (message.liveLocationsFinal) { - default: - return "liveLocationsFinal: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.labelsEdit != null && message.hasOwnProperty("labelsEdit")) - switch (message.labelsEdit) { - default: - return "labelsEdit: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.mediaUpload != null && message.hasOwnProperty("mediaUpload")) - switch (message.mediaUpload) { - default: - return "mediaUpload: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.mediaUploadRichQuickReplies != null && message.hasOwnProperty("mediaUploadRichQuickReplies")) - switch (message.mediaUploadRichQuickReplies) { - default: - return "mediaUploadRichQuickReplies: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.vnameV2 != null && message.hasOwnProperty("vnameV2")) - switch (message.vnameV2) { - default: - return "vnameV2: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.videoPlaybackUrl != null && message.hasOwnProperty("videoPlaybackUrl")) - switch (message.videoPlaybackUrl) { - default: - return "videoPlaybackUrl: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.statusRanking != null && message.hasOwnProperty("statusRanking")) - switch (message.statusRanking) { - default: - return "statusRanking: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.voipIndividualVideo != null && message.hasOwnProperty("voipIndividualVideo")) - switch (message.voipIndividualVideo) { - default: - return "voipIndividualVideo: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.thirdPartyStickers != null && message.hasOwnProperty("thirdPartyStickers")) - switch (message.thirdPartyStickers) { - default: - return "thirdPartyStickers: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.frequentlyForwardedSetting != null && message.hasOwnProperty("frequentlyForwardedSetting")) - switch (message.frequentlyForwardedSetting) { - default: - return "frequentlyForwardedSetting: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.groupsV4JoinPermission != null && message.hasOwnProperty("groupsV4JoinPermission")) - switch (message.groupsV4JoinPermission) { - default: - return "groupsV4JoinPermission: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.recentStickers != null && message.hasOwnProperty("recentStickers")) - switch (message.recentStickers) { - default: - return "recentStickers: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.catalog != null && message.hasOwnProperty("catalog")) - switch (message.catalog) { - default: - return "catalog: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.starredStickers != null && message.hasOwnProperty("starredStickers")) - switch (message.starredStickers) { - default: - return "starredStickers: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.voipGroupCall != null && message.hasOwnProperty("voipGroupCall")) - switch (message.voipGroupCall) { - default: - return "voipGroupCall: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.templateMessage != null && message.hasOwnProperty("templateMessage")) - switch (message.templateMessage) { - default: - return "templateMessage: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.templateMessageInteractivity != null && message.hasOwnProperty("templateMessageInteractivity")) - switch (message.templateMessageInteractivity) { - default: - return "templateMessageInteractivity: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.ephemeralMessages != null && message.hasOwnProperty("ephemeralMessages")) - switch (message.ephemeralMessages) { - default: - return "ephemeralMessages: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.e2ENotificationSync != null && message.hasOwnProperty("e2ENotificationSync")) - switch (message.e2ENotificationSync) { - default: - return "e2ENotificationSync: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.recentStickersV2 != null && message.hasOwnProperty("recentStickersV2")) - switch (message.recentStickersV2) { - default: - return "recentStickersV2: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.recentStickersV3 != null && message.hasOwnProperty("recentStickersV3")) - switch (message.recentStickersV3) { - default: - return "recentStickersV3: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.userNotice != null && message.hasOwnProperty("userNotice")) - switch (message.userNotice) { - default: - return "userNotice: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.support != null && message.hasOwnProperty("support")) - switch (message.support) { - default: - return "support: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.groupUiiCleanup != null && message.hasOwnProperty("groupUiiCleanup")) - switch (message.groupUiiCleanup) { - default: - return "groupUiiCleanup: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.groupDogfoodingInternalOnly != null && message.hasOwnProperty("groupDogfoodingInternalOnly")) - switch (message.groupDogfoodingInternalOnly) { - default: - return "groupDogfoodingInternalOnly: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.settingsSync != null && message.hasOwnProperty("settingsSync")) - switch (message.settingsSync) { - default: - return "settingsSync: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.archiveV2 != null && message.hasOwnProperty("archiveV2")) - switch (message.archiveV2) { - default: - return "archiveV2: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.ephemeralAllowGroupMembers != null && message.hasOwnProperty("ephemeralAllowGroupMembers")) - switch (message.ephemeralAllowGroupMembers) { - default: - return "ephemeralAllowGroupMembers: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.ephemeral24HDuration != null && message.hasOwnProperty("ephemeral24HDuration")) - switch (message.ephemeral24HDuration) { - default: - return "ephemeral24HDuration: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.mdForceUpgrade != null && message.hasOwnProperty("mdForceUpgrade")) - switch (message.mdForceUpgrade) { - default: - return "mdForceUpgrade: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.disappearingMode != null && message.hasOwnProperty("disappearingMode")) - switch (message.disappearingMode) { - default: - return "disappearingMode: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.externalMdOptInAvailable != null && message.hasOwnProperty("externalMdOptInAvailable")) - switch (message.externalMdOptInAvailable) { - default: - return "externalMdOptInAvailable: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.noDeleteMessageTimeLimit != null && message.hasOwnProperty("noDeleteMessageTimeLimit")) - switch (message.noDeleteMessageTimeLimit) { - default: - return "noDeleteMessageTimeLimit: enum value expected"; + return "releaseChannel: enum value expected"; case 0: case 1: case 2: case 3: break; } + if (message.localeLanguageIso6391 != null && message.hasOwnProperty("localeLanguageIso6391")) + if (!$util.isString(message.localeLanguageIso6391)) + return "localeLanguageIso6391: string expected"; + if (message.localeCountryIso31661Alpha2 != null && message.hasOwnProperty("localeCountryIso31661Alpha2")) + if (!$util.isString(message.localeCountryIso31661Alpha2)) + return "localeCountryIso31661Alpha2: string expected"; + if (message.deviceBoard != null && message.hasOwnProperty("deviceBoard")) + if (!$util.isString(message.deviceBoard)) + return "deviceBoard: string expected"; return null; }; /** - * Creates a WebFeatures message from a plain object. Also converts values to their respective internal types. + * Creates a UserAgent message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof proto.WebFeatures + * @memberof proto.UserAgent * @static * @param {Object.} object Plain object - * @returns {proto.WebFeatures} WebFeatures + * @returns {proto.UserAgent} UserAgent */ - WebFeatures.fromObject = function fromObject(object) { - if (object instanceof $root.proto.WebFeatures) + UserAgent.fromObject = function fromObject(object) { + if (object instanceof $root.proto.UserAgent) return object; - var message = new $root.proto.WebFeatures(); - switch (object.labelsDisplay) { - case "NOT_STARTED": + var message = new $root.proto.UserAgent(); + switch (object.platform) { + case "ANDROID": case 0: - message.labelsDisplay = 0; + message.platform = 0; break; - case "FORCE_UPGRADE": + case "IOS": case 1: - message.labelsDisplay = 1; + message.platform = 1; break; - case "DEVELOPMENT": + case "WINDOWS_PHONE": case 2: - message.labelsDisplay = 2; + message.platform = 2; break; - case "PRODUCTION": + case "BLACKBERRY": case 3: - message.labelsDisplay = 3; - break; - } - switch (object.voipIndividualOutgoing) { - case "NOT_STARTED": - case 0: - message.voipIndividualOutgoing = 0; + message.platform = 3; break; - case "FORCE_UPGRADE": - case 1: - message.voipIndividualOutgoing = 1; + case "BLACKBERRYX": + case 4: + message.platform = 4; break; - case "DEVELOPMENT": - case 2: - message.voipIndividualOutgoing = 2; + case "S40": + case 5: + message.platform = 5; break; - case "PRODUCTION": - case 3: - message.voipIndividualOutgoing = 3; + case "S60": + case 6: + message.platform = 6; break; - } - switch (object.groupsV3) { - case "NOT_STARTED": - case 0: - message.groupsV3 = 0; + case "PYTHON_CLIENT": + case 7: + message.platform = 7; break; - case "FORCE_UPGRADE": - case 1: - message.groupsV3 = 1; + case "TIZEN": + case 8: + message.platform = 8; break; - case "DEVELOPMENT": - case 2: - message.groupsV3 = 2; + case "ENTERPRISE": + case 9: + message.platform = 9; break; - case "PRODUCTION": - case 3: - message.groupsV3 = 3; + case "SMB_ANDROID": + case 10: + message.platform = 10; break; - } - switch (object.groupsV3Create) { - case "NOT_STARTED": - case 0: - message.groupsV3Create = 0; + case "KAIOS": + case 11: + message.platform = 11; break; - case "FORCE_UPGRADE": - case 1: - message.groupsV3Create = 1; + case "SMB_IOS": + case 12: + message.platform = 12; break; - case "DEVELOPMENT": - case 2: - message.groupsV3Create = 2; + case "WINDOWS": + case 13: + message.platform = 13; break; - case "PRODUCTION": - case 3: - message.groupsV3Create = 3; + case "WEB": + case 14: + message.platform = 14; break; - } - switch (object.changeNumberV2) { - case "NOT_STARTED": - case 0: - message.changeNumberV2 = 0; + case "PORTAL": + case 15: + message.platform = 15; break; - case "FORCE_UPGRADE": - case 1: - message.changeNumberV2 = 1; + case "GREEN_ANDROID": + case 16: + message.platform = 16; break; - case "DEVELOPMENT": - case 2: - message.changeNumberV2 = 2; + case "GREEN_IPHONE": + case 17: + message.platform = 17; break; - case "PRODUCTION": - case 3: - message.changeNumberV2 = 3; + case "BLUE_ANDROID": + case 18: + message.platform = 18; break; - } - switch (object.queryStatusV3Thumbnail) { - case "NOT_STARTED": - case 0: - message.queryStatusV3Thumbnail = 0; + case "BLUE_IPHONE": + case 19: + message.platform = 19; break; - case "FORCE_UPGRADE": - case 1: - message.queryStatusV3Thumbnail = 1; + case "FBLITE_ANDROID": + case 20: + message.platform = 20; break; - case "DEVELOPMENT": - case 2: - message.queryStatusV3Thumbnail = 2; + case "MLITE_ANDROID": + case 21: + message.platform = 21; break; - case "PRODUCTION": - case 3: - message.queryStatusV3Thumbnail = 3; - break; - } - switch (object.liveLocations) { - case "NOT_STARTED": - case 0: - message.liveLocations = 0; - break; - case "FORCE_UPGRADE": - case 1: - message.liveLocations = 1; - break; - case "DEVELOPMENT": - case 2: - message.liveLocations = 2; - break; - case "PRODUCTION": - case 3: - message.liveLocations = 3; - break; - } - switch (object.queryVname) { - case "NOT_STARTED": - case 0: - message.queryVname = 0; - break; - case "FORCE_UPGRADE": - case 1: - message.queryVname = 1; - break; - case "DEVELOPMENT": - case 2: - message.queryVname = 2; - break; - case "PRODUCTION": - case 3: - message.queryVname = 3; - break; - } - switch (object.voipIndividualIncoming) { - case "NOT_STARTED": - case 0: - message.voipIndividualIncoming = 0; - break; - case "FORCE_UPGRADE": - case 1: - message.voipIndividualIncoming = 1; - break; - case "DEVELOPMENT": - case 2: - message.voipIndividualIncoming = 2; - break; - case "PRODUCTION": - case 3: - message.voipIndividualIncoming = 3; - break; - } - switch (object.quickRepliesQuery) { - case "NOT_STARTED": - case 0: - message.quickRepliesQuery = 0; - break; - case "FORCE_UPGRADE": - case 1: - message.quickRepliesQuery = 1; - break; - case "DEVELOPMENT": - case 2: - message.quickRepliesQuery = 2; - break; - case "PRODUCTION": - case 3: - message.quickRepliesQuery = 3; - break; - } - switch (object.payments) { - case "NOT_STARTED": - case 0: - message.payments = 0; - break; - case "FORCE_UPGRADE": - case 1: - message.payments = 1; - break; - case "DEVELOPMENT": - case 2: - message.payments = 2; - break; - case "PRODUCTION": - case 3: - message.payments = 3; - break; - } - switch (object.stickerPackQuery) { - case "NOT_STARTED": - case 0: - message.stickerPackQuery = 0; - break; - case "FORCE_UPGRADE": - case 1: - message.stickerPackQuery = 1; - break; - case "DEVELOPMENT": - case 2: - message.stickerPackQuery = 2; - break; - case "PRODUCTION": - case 3: - message.stickerPackQuery = 3; - break; - } - switch (object.liveLocationsFinal) { - case "NOT_STARTED": - case 0: - message.liveLocationsFinal = 0; - break; - case "FORCE_UPGRADE": - case 1: - message.liveLocationsFinal = 1; - break; - case "DEVELOPMENT": - case 2: - message.liveLocationsFinal = 2; - break; - case "PRODUCTION": - case 3: - message.liveLocationsFinal = 3; - break; - } - switch (object.labelsEdit) { - case "NOT_STARTED": - case 0: - message.labelsEdit = 0; - break; - case "FORCE_UPGRADE": - case 1: - message.labelsEdit = 1; - break; - case "DEVELOPMENT": - case 2: - message.labelsEdit = 2; - break; - case "PRODUCTION": - case 3: - message.labelsEdit = 3; - break; - } - switch (object.mediaUpload) { - case "NOT_STARTED": - case 0: - message.mediaUpload = 0; - break; - case "FORCE_UPGRADE": - case 1: - message.mediaUpload = 1; - break; - case "DEVELOPMENT": - case 2: - message.mediaUpload = 2; - break; - case "PRODUCTION": - case 3: - message.mediaUpload = 3; - break; - } - switch (object.mediaUploadRichQuickReplies) { - case "NOT_STARTED": - case 0: - message.mediaUploadRichQuickReplies = 0; - break; - case "FORCE_UPGRADE": - case 1: - message.mediaUploadRichQuickReplies = 1; - break; - case "DEVELOPMENT": - case 2: - message.mediaUploadRichQuickReplies = 2; - break; - case "PRODUCTION": - case 3: - message.mediaUploadRichQuickReplies = 3; - break; - } - switch (object.vnameV2) { - case "NOT_STARTED": - case 0: - message.vnameV2 = 0; - break; - case "FORCE_UPGRADE": - case 1: - message.vnameV2 = 1; - break; - case "DEVELOPMENT": - case 2: - message.vnameV2 = 2; - break; - case "PRODUCTION": - case 3: - message.vnameV2 = 3; - break; - } - switch (object.videoPlaybackUrl) { - case "NOT_STARTED": - case 0: - message.videoPlaybackUrl = 0; - break; - case "FORCE_UPGRADE": - case 1: - message.videoPlaybackUrl = 1; - break; - case "DEVELOPMENT": - case 2: - message.videoPlaybackUrl = 2; - break; - case "PRODUCTION": - case 3: - message.videoPlaybackUrl = 3; - break; - } - switch (object.statusRanking) { - case "NOT_STARTED": - case 0: - message.statusRanking = 0; - break; - case "FORCE_UPGRADE": - case 1: - message.statusRanking = 1; - break; - case "DEVELOPMENT": - case 2: - message.statusRanking = 2; - break; - case "PRODUCTION": - case 3: - message.statusRanking = 3; - break; - } - switch (object.voipIndividualVideo) { - case "NOT_STARTED": - case 0: - message.voipIndividualVideo = 0; - break; - case "FORCE_UPGRADE": - case 1: - message.voipIndividualVideo = 1; - break; - case "DEVELOPMENT": - case 2: - message.voipIndividualVideo = 2; - break; - case "PRODUCTION": - case 3: - message.voipIndividualVideo = 3; - break; - } - switch (object.thirdPartyStickers) { - case "NOT_STARTED": - case 0: - message.thirdPartyStickers = 0; - break; - case "FORCE_UPGRADE": - case 1: - message.thirdPartyStickers = 1; - break; - case "DEVELOPMENT": - case 2: - message.thirdPartyStickers = 2; - break; - case "PRODUCTION": - case 3: - message.thirdPartyStickers = 3; - break; - } - switch (object.frequentlyForwardedSetting) { - case "NOT_STARTED": - case 0: - message.frequentlyForwardedSetting = 0; - break; - case "FORCE_UPGRADE": - case 1: - message.frequentlyForwardedSetting = 1; - break; - case "DEVELOPMENT": - case 2: - message.frequentlyForwardedSetting = 2; - break; - case "PRODUCTION": - case 3: - message.frequentlyForwardedSetting = 3; - break; - } - switch (object.groupsV4JoinPermission) { - case "NOT_STARTED": - case 0: - message.groupsV4JoinPermission = 0; - break; - case "FORCE_UPGRADE": - case 1: - message.groupsV4JoinPermission = 1; - break; - case "DEVELOPMENT": - case 2: - message.groupsV4JoinPermission = 2; - break; - case "PRODUCTION": - case 3: - message.groupsV4JoinPermission = 3; - break; - } - switch (object.recentStickers) { - case "NOT_STARTED": - case 0: - message.recentStickers = 0; - break; - case "FORCE_UPGRADE": - case 1: - message.recentStickers = 1; - break; - case "DEVELOPMENT": - case 2: - message.recentStickers = 2; - break; - case "PRODUCTION": - case 3: - message.recentStickers = 3; - break; - } - switch (object.catalog) { - case "NOT_STARTED": - case 0: - message.catalog = 0; - break; - case "FORCE_UPGRADE": - case 1: - message.catalog = 1; - break; - case "DEVELOPMENT": - case 2: - message.catalog = 2; - break; - case "PRODUCTION": - case 3: - message.catalog = 3; - break; - } - switch (object.starredStickers) { - case "NOT_STARTED": - case 0: - message.starredStickers = 0; - break; - case "FORCE_UPGRADE": - case 1: - message.starredStickers = 1; + case "IGLITE_ANDROID": + case 22: + message.platform = 22; break; - case "DEVELOPMENT": - case 2: - message.starredStickers = 2; + case "PAGE": + case 23: + message.platform = 23; break; - case "PRODUCTION": - case 3: - message.starredStickers = 3; + case "MACOS": + case 24: + message.platform = 24; break; - } - switch (object.voipGroupCall) { - case "NOT_STARTED": - case 0: - message.voipGroupCall = 0; + case "OCULUS_MSG": + case 25: + message.platform = 25; break; - case "FORCE_UPGRADE": - case 1: - message.voipGroupCall = 1; + case "OCULUS_CALL": + case 26: + message.platform = 26; break; - case "DEVELOPMENT": - case 2: - message.voipGroupCall = 2; + case "MILAN": + case 27: + message.platform = 27; break; - case "PRODUCTION": - case 3: - message.voipGroupCall = 3; + case "CAPI": + case 28: + message.platform = 28; break; } - switch (object.templateMessage) { - case "NOT_STARTED": - case 0: - message.templateMessage = 0; - break; - case "FORCE_UPGRADE": - case 1: - message.templateMessage = 1; - break; - case "DEVELOPMENT": - case 2: - message.templateMessage = 2; - break; - case "PRODUCTION": - case 3: - message.templateMessage = 3; - break; + if (object.appVersion != null) { + if (typeof object.appVersion !== "object") + throw TypeError(".proto.UserAgent.appVersion: object expected"); + message.appVersion = $root.proto.AppVersion.fromObject(object.appVersion); } - switch (object.templateMessageInteractivity) { - case "NOT_STARTED": + if (object.mcc != null) + message.mcc = String(object.mcc); + if (object.mnc != null) + message.mnc = String(object.mnc); + if (object.osVersion != null) + message.osVersion = String(object.osVersion); + if (object.manufacturer != null) + message.manufacturer = String(object.manufacturer); + if (object.device != null) + message.device = String(object.device); + if (object.osBuildNumber != null) + message.osBuildNumber = String(object.osBuildNumber); + if (object.phoneId != null) + message.phoneId = String(object.phoneId); + switch (object.releaseChannel) { + case "RELEASE": case 0: - message.templateMessageInteractivity = 0; + message.releaseChannel = 0; break; - case "FORCE_UPGRADE": + case "BETA": case 1: - message.templateMessageInteractivity = 1; + message.releaseChannel = 1; break; - case "DEVELOPMENT": + case "ALPHA": case 2: - message.templateMessageInteractivity = 2; + message.releaseChannel = 2; break; - case "PRODUCTION": + case "DEBUG": case 3: - message.templateMessageInteractivity = 3; + message.releaseChannel = 3; break; } - switch (object.ephemeralMessages) { - case "NOT_STARTED": - case 0: - message.ephemeralMessages = 0; - break; - case "FORCE_UPGRADE": - case 1: - message.ephemeralMessages = 1; - break; - case "DEVELOPMENT": - case 2: - message.ephemeralMessages = 2; - break; - case "PRODUCTION": - case 3: - message.ephemeralMessages = 3; - break; + if (object.localeLanguageIso6391 != null) + message.localeLanguageIso6391 = String(object.localeLanguageIso6391); + if (object.localeCountryIso31661Alpha2 != null) + message.localeCountryIso31661Alpha2 = String(object.localeCountryIso31661Alpha2); + if (object.deviceBoard != null) + message.deviceBoard = String(object.deviceBoard); + return message; + }; + + /** + * Creates a plain object from a UserAgent message. Also converts values to other types if specified. + * @function toObject + * @memberof proto.UserAgent + * @static + * @param {proto.UserAgent} message UserAgent + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UserAgent.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.platform = options.enums === String ? "ANDROID" : 0; + object.appVersion = null; + object.mcc = ""; + object.mnc = ""; + object.osVersion = ""; + object.manufacturer = ""; + object.device = ""; + object.osBuildNumber = ""; + object.phoneId = ""; + object.releaseChannel = options.enums === String ? "RELEASE" : 0; + object.localeLanguageIso6391 = ""; + object.localeCountryIso31661Alpha2 = ""; + object.deviceBoard = ""; } - switch (object.e2ENotificationSync) { - case "NOT_STARTED": - case 0: - message.e2ENotificationSync = 0; - break; - case "FORCE_UPGRADE": - case 1: - message.e2ENotificationSync = 1; - break; - case "DEVELOPMENT": - case 2: - message.e2ENotificationSync = 2; - break; - case "PRODUCTION": - case 3: - message.e2ENotificationSync = 3; - break; - } - switch (object.recentStickersV2) { - case "NOT_STARTED": - case 0: - message.recentStickersV2 = 0; - break; - case "FORCE_UPGRADE": - case 1: - message.recentStickersV2 = 1; - break; - case "DEVELOPMENT": - case 2: - message.recentStickersV2 = 2; - break; - case "PRODUCTION": - case 3: - message.recentStickersV2 = 3; - break; - } - switch (object.recentStickersV3) { - case "NOT_STARTED": - case 0: - message.recentStickersV3 = 0; - break; - case "FORCE_UPGRADE": - case 1: - message.recentStickersV3 = 1; - break; - case "DEVELOPMENT": - case 2: - message.recentStickersV3 = 2; - break; - case "PRODUCTION": - case 3: - message.recentStickersV3 = 3; - break; - } - switch (object.userNotice) { - case "NOT_STARTED": - case 0: - message.userNotice = 0; - break; - case "FORCE_UPGRADE": - case 1: - message.userNotice = 1; - break; - case "DEVELOPMENT": - case 2: - message.userNotice = 2; - break; - case "PRODUCTION": - case 3: - message.userNotice = 3; - break; - } - switch (object.support) { - case "NOT_STARTED": - case 0: - message.support = 0; - break; - case "FORCE_UPGRADE": - case 1: - message.support = 1; - break; - case "DEVELOPMENT": - case 2: - message.support = 2; - break; - case "PRODUCTION": - case 3: - message.support = 3; - break; - } - switch (object.groupUiiCleanup) { - case "NOT_STARTED": - case 0: - message.groupUiiCleanup = 0; - break; - case "FORCE_UPGRADE": - case 1: - message.groupUiiCleanup = 1; - break; - case "DEVELOPMENT": - case 2: - message.groupUiiCleanup = 2; - break; - case "PRODUCTION": - case 3: - message.groupUiiCleanup = 3; - break; - } - switch (object.groupDogfoodingInternalOnly) { - case "NOT_STARTED": - case 0: - message.groupDogfoodingInternalOnly = 0; - break; - case "FORCE_UPGRADE": - case 1: - message.groupDogfoodingInternalOnly = 1; - break; - case "DEVELOPMENT": - case 2: - message.groupDogfoodingInternalOnly = 2; - break; - case "PRODUCTION": - case 3: - message.groupDogfoodingInternalOnly = 3; - break; - } - switch (object.settingsSync) { - case "NOT_STARTED": - case 0: - message.settingsSync = 0; - break; - case "FORCE_UPGRADE": - case 1: - message.settingsSync = 1; - break; - case "DEVELOPMENT": - case 2: - message.settingsSync = 2; - break; - case "PRODUCTION": - case 3: - message.settingsSync = 3; - break; - } - switch (object.archiveV2) { - case "NOT_STARTED": - case 0: - message.archiveV2 = 0; - break; - case "FORCE_UPGRADE": - case 1: - message.archiveV2 = 1; - break; - case "DEVELOPMENT": - case 2: - message.archiveV2 = 2; - break; - case "PRODUCTION": - case 3: - message.archiveV2 = 3; - break; - } - switch (object.ephemeralAllowGroupMembers) { - case "NOT_STARTED": - case 0: - message.ephemeralAllowGroupMembers = 0; - break; - case "FORCE_UPGRADE": - case 1: - message.ephemeralAllowGroupMembers = 1; - break; - case "DEVELOPMENT": - case 2: - message.ephemeralAllowGroupMembers = 2; - break; - case "PRODUCTION": - case 3: - message.ephemeralAllowGroupMembers = 3; - break; - } - switch (object.ephemeral24HDuration) { - case "NOT_STARTED": - case 0: - message.ephemeral24HDuration = 0; - break; - case "FORCE_UPGRADE": - case 1: - message.ephemeral24HDuration = 1; - break; - case "DEVELOPMENT": - case 2: - message.ephemeral24HDuration = 2; - break; - case "PRODUCTION": - case 3: - message.ephemeral24HDuration = 3; - break; - } - switch (object.mdForceUpgrade) { - case "NOT_STARTED": - case 0: - message.mdForceUpgrade = 0; - break; - case "FORCE_UPGRADE": - case 1: - message.mdForceUpgrade = 1; - break; - case "DEVELOPMENT": - case 2: - message.mdForceUpgrade = 2; - break; - case "PRODUCTION": - case 3: - message.mdForceUpgrade = 3; - break; - } - switch (object.disappearingMode) { - case "NOT_STARTED": - case 0: - message.disappearingMode = 0; - break; - case "FORCE_UPGRADE": - case 1: - message.disappearingMode = 1; - break; - case "DEVELOPMENT": - case 2: - message.disappearingMode = 2; - break; - case "PRODUCTION": - case 3: - message.disappearingMode = 3; - break; - } - switch (object.externalMdOptInAvailable) { - case "NOT_STARTED": - case 0: - message.externalMdOptInAvailable = 0; - break; - case "FORCE_UPGRADE": - case 1: - message.externalMdOptInAvailable = 1; - break; - case "DEVELOPMENT": - case 2: - message.externalMdOptInAvailable = 2; - break; - case "PRODUCTION": - case 3: - message.externalMdOptInAvailable = 3; - break; - } - switch (object.noDeleteMessageTimeLimit) { - case "NOT_STARTED": - case 0: - message.noDeleteMessageTimeLimit = 0; - break; - case "FORCE_UPGRADE": - case 1: - message.noDeleteMessageTimeLimit = 1; - break; - case "DEVELOPMENT": - case 2: - message.noDeleteMessageTimeLimit = 2; - break; - case "PRODUCTION": - case 3: - message.noDeleteMessageTimeLimit = 3; - break; - } - return message; - }; - - /** - * Creates a plain object from a WebFeatures message. Also converts values to other types if specified. - * @function toObject - * @memberof proto.WebFeatures - * @static - * @param {proto.WebFeatures} message WebFeatures - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - WebFeatures.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.labelsDisplay = options.enums === String ? "NOT_STARTED" : 0; - object.voipIndividualOutgoing = options.enums === String ? "NOT_STARTED" : 0; - object.groupsV3 = options.enums === String ? "NOT_STARTED" : 0; - object.groupsV3Create = options.enums === String ? "NOT_STARTED" : 0; - object.changeNumberV2 = options.enums === String ? "NOT_STARTED" : 0; - object.queryStatusV3Thumbnail = options.enums === String ? "NOT_STARTED" : 0; - object.liveLocations = options.enums === String ? "NOT_STARTED" : 0; - object.queryVname = options.enums === String ? "NOT_STARTED" : 0; - object.voipIndividualIncoming = options.enums === String ? "NOT_STARTED" : 0; - object.quickRepliesQuery = options.enums === String ? "NOT_STARTED" : 0; - object.payments = options.enums === String ? "NOT_STARTED" : 0; - object.stickerPackQuery = options.enums === String ? "NOT_STARTED" : 0; - object.liveLocationsFinal = options.enums === String ? "NOT_STARTED" : 0; - object.labelsEdit = options.enums === String ? "NOT_STARTED" : 0; - object.mediaUpload = options.enums === String ? "NOT_STARTED" : 0; - object.mediaUploadRichQuickReplies = options.enums === String ? "NOT_STARTED" : 0; - object.vnameV2 = options.enums === String ? "NOT_STARTED" : 0; - object.videoPlaybackUrl = options.enums === String ? "NOT_STARTED" : 0; - object.statusRanking = options.enums === String ? "NOT_STARTED" : 0; - object.voipIndividualVideo = options.enums === String ? "NOT_STARTED" : 0; - object.thirdPartyStickers = options.enums === String ? "NOT_STARTED" : 0; - object.frequentlyForwardedSetting = options.enums === String ? "NOT_STARTED" : 0; - object.groupsV4JoinPermission = options.enums === String ? "NOT_STARTED" : 0; - object.recentStickers = options.enums === String ? "NOT_STARTED" : 0; - object.catalog = options.enums === String ? "NOT_STARTED" : 0; - object.starredStickers = options.enums === String ? "NOT_STARTED" : 0; - object.voipGroupCall = options.enums === String ? "NOT_STARTED" : 0; - object.templateMessage = options.enums === String ? "NOT_STARTED" : 0; - object.templateMessageInteractivity = options.enums === String ? "NOT_STARTED" : 0; - object.ephemeralMessages = options.enums === String ? "NOT_STARTED" : 0; - object.e2ENotificationSync = options.enums === String ? "NOT_STARTED" : 0; - object.recentStickersV2 = options.enums === String ? "NOT_STARTED" : 0; - object.recentStickersV3 = options.enums === String ? "NOT_STARTED" : 0; - object.userNotice = options.enums === String ? "NOT_STARTED" : 0; - object.support = options.enums === String ? "NOT_STARTED" : 0; - object.groupUiiCleanup = options.enums === String ? "NOT_STARTED" : 0; - object.groupDogfoodingInternalOnly = options.enums === String ? "NOT_STARTED" : 0; - object.settingsSync = options.enums === String ? "NOT_STARTED" : 0; - object.archiveV2 = options.enums === String ? "NOT_STARTED" : 0; - object.ephemeralAllowGroupMembers = options.enums === String ? "NOT_STARTED" : 0; - object.ephemeral24HDuration = options.enums === String ? "NOT_STARTED" : 0; - object.mdForceUpgrade = options.enums === String ? "NOT_STARTED" : 0; - object.disappearingMode = options.enums === String ? "NOT_STARTED" : 0; - object.externalMdOptInAvailable = options.enums === String ? "NOT_STARTED" : 0; - object.noDeleteMessageTimeLimit = options.enums === String ? "NOT_STARTED" : 0; - } - if (message.labelsDisplay != null && message.hasOwnProperty("labelsDisplay")) - object.labelsDisplay = options.enums === String ? $root.proto.WebFeatures.WebFeaturesFlag[message.labelsDisplay] : message.labelsDisplay; - if (message.voipIndividualOutgoing != null && message.hasOwnProperty("voipIndividualOutgoing")) - object.voipIndividualOutgoing = options.enums === String ? $root.proto.WebFeatures.WebFeaturesFlag[message.voipIndividualOutgoing] : message.voipIndividualOutgoing; - if (message.groupsV3 != null && message.hasOwnProperty("groupsV3")) - object.groupsV3 = options.enums === String ? $root.proto.WebFeatures.WebFeaturesFlag[message.groupsV3] : message.groupsV3; - if (message.groupsV3Create != null && message.hasOwnProperty("groupsV3Create")) - object.groupsV3Create = options.enums === String ? $root.proto.WebFeatures.WebFeaturesFlag[message.groupsV3Create] : message.groupsV3Create; - if (message.changeNumberV2 != null && message.hasOwnProperty("changeNumberV2")) - object.changeNumberV2 = options.enums === String ? $root.proto.WebFeatures.WebFeaturesFlag[message.changeNumberV2] : message.changeNumberV2; - if (message.queryStatusV3Thumbnail != null && message.hasOwnProperty("queryStatusV3Thumbnail")) - object.queryStatusV3Thumbnail = options.enums === String ? $root.proto.WebFeatures.WebFeaturesFlag[message.queryStatusV3Thumbnail] : message.queryStatusV3Thumbnail; - if (message.liveLocations != null && message.hasOwnProperty("liveLocations")) - object.liveLocations = options.enums === String ? $root.proto.WebFeatures.WebFeaturesFlag[message.liveLocations] : message.liveLocations; - if (message.queryVname != null && message.hasOwnProperty("queryVname")) - object.queryVname = options.enums === String ? $root.proto.WebFeatures.WebFeaturesFlag[message.queryVname] : message.queryVname; - if (message.voipIndividualIncoming != null && message.hasOwnProperty("voipIndividualIncoming")) - object.voipIndividualIncoming = options.enums === String ? $root.proto.WebFeatures.WebFeaturesFlag[message.voipIndividualIncoming] : message.voipIndividualIncoming; - if (message.quickRepliesQuery != null && message.hasOwnProperty("quickRepliesQuery")) - object.quickRepliesQuery = options.enums === String ? $root.proto.WebFeatures.WebFeaturesFlag[message.quickRepliesQuery] : message.quickRepliesQuery; - if (message.payments != null && message.hasOwnProperty("payments")) - object.payments = options.enums === String ? $root.proto.WebFeatures.WebFeaturesFlag[message.payments] : message.payments; - if (message.stickerPackQuery != null && message.hasOwnProperty("stickerPackQuery")) - object.stickerPackQuery = options.enums === String ? $root.proto.WebFeatures.WebFeaturesFlag[message.stickerPackQuery] : message.stickerPackQuery; - if (message.liveLocationsFinal != null && message.hasOwnProperty("liveLocationsFinal")) - object.liveLocationsFinal = options.enums === String ? $root.proto.WebFeatures.WebFeaturesFlag[message.liveLocationsFinal] : message.liveLocationsFinal; - if (message.labelsEdit != null && message.hasOwnProperty("labelsEdit")) - object.labelsEdit = options.enums === String ? $root.proto.WebFeatures.WebFeaturesFlag[message.labelsEdit] : message.labelsEdit; - if (message.mediaUpload != null && message.hasOwnProperty("mediaUpload")) - object.mediaUpload = options.enums === String ? $root.proto.WebFeatures.WebFeaturesFlag[message.mediaUpload] : message.mediaUpload; - if (message.mediaUploadRichQuickReplies != null && message.hasOwnProperty("mediaUploadRichQuickReplies")) - object.mediaUploadRichQuickReplies = options.enums === String ? $root.proto.WebFeatures.WebFeaturesFlag[message.mediaUploadRichQuickReplies] : message.mediaUploadRichQuickReplies; - if (message.vnameV2 != null && message.hasOwnProperty("vnameV2")) - object.vnameV2 = options.enums === String ? $root.proto.WebFeatures.WebFeaturesFlag[message.vnameV2] : message.vnameV2; - if (message.videoPlaybackUrl != null && message.hasOwnProperty("videoPlaybackUrl")) - object.videoPlaybackUrl = options.enums === String ? $root.proto.WebFeatures.WebFeaturesFlag[message.videoPlaybackUrl] : message.videoPlaybackUrl; - if (message.statusRanking != null && message.hasOwnProperty("statusRanking")) - object.statusRanking = options.enums === String ? $root.proto.WebFeatures.WebFeaturesFlag[message.statusRanking] : message.statusRanking; - if (message.voipIndividualVideo != null && message.hasOwnProperty("voipIndividualVideo")) - object.voipIndividualVideo = options.enums === String ? $root.proto.WebFeatures.WebFeaturesFlag[message.voipIndividualVideo] : message.voipIndividualVideo; - if (message.thirdPartyStickers != null && message.hasOwnProperty("thirdPartyStickers")) - object.thirdPartyStickers = options.enums === String ? $root.proto.WebFeatures.WebFeaturesFlag[message.thirdPartyStickers] : message.thirdPartyStickers; - if (message.frequentlyForwardedSetting != null && message.hasOwnProperty("frequentlyForwardedSetting")) - object.frequentlyForwardedSetting = options.enums === String ? $root.proto.WebFeatures.WebFeaturesFlag[message.frequentlyForwardedSetting] : message.frequentlyForwardedSetting; - if (message.groupsV4JoinPermission != null && message.hasOwnProperty("groupsV4JoinPermission")) - object.groupsV4JoinPermission = options.enums === String ? $root.proto.WebFeatures.WebFeaturesFlag[message.groupsV4JoinPermission] : message.groupsV4JoinPermission; - if (message.recentStickers != null && message.hasOwnProperty("recentStickers")) - object.recentStickers = options.enums === String ? $root.proto.WebFeatures.WebFeaturesFlag[message.recentStickers] : message.recentStickers; - if (message.catalog != null && message.hasOwnProperty("catalog")) - object.catalog = options.enums === String ? $root.proto.WebFeatures.WebFeaturesFlag[message.catalog] : message.catalog; - if (message.starredStickers != null && message.hasOwnProperty("starredStickers")) - object.starredStickers = options.enums === String ? $root.proto.WebFeatures.WebFeaturesFlag[message.starredStickers] : message.starredStickers; - if (message.voipGroupCall != null && message.hasOwnProperty("voipGroupCall")) - object.voipGroupCall = options.enums === String ? $root.proto.WebFeatures.WebFeaturesFlag[message.voipGroupCall] : message.voipGroupCall; - if (message.templateMessage != null && message.hasOwnProperty("templateMessage")) - object.templateMessage = options.enums === String ? $root.proto.WebFeatures.WebFeaturesFlag[message.templateMessage] : message.templateMessage; - if (message.templateMessageInteractivity != null && message.hasOwnProperty("templateMessageInteractivity")) - object.templateMessageInteractivity = options.enums === String ? $root.proto.WebFeatures.WebFeaturesFlag[message.templateMessageInteractivity] : message.templateMessageInteractivity; - if (message.ephemeralMessages != null && message.hasOwnProperty("ephemeralMessages")) - object.ephemeralMessages = options.enums === String ? $root.proto.WebFeatures.WebFeaturesFlag[message.ephemeralMessages] : message.ephemeralMessages; - if (message.e2ENotificationSync != null && message.hasOwnProperty("e2ENotificationSync")) - object.e2ENotificationSync = options.enums === String ? $root.proto.WebFeatures.WebFeaturesFlag[message.e2ENotificationSync] : message.e2ENotificationSync; - if (message.recentStickersV2 != null && message.hasOwnProperty("recentStickersV2")) - object.recentStickersV2 = options.enums === String ? $root.proto.WebFeatures.WebFeaturesFlag[message.recentStickersV2] : message.recentStickersV2; - if (message.recentStickersV3 != null && message.hasOwnProperty("recentStickersV3")) - object.recentStickersV3 = options.enums === String ? $root.proto.WebFeatures.WebFeaturesFlag[message.recentStickersV3] : message.recentStickersV3; - if (message.userNotice != null && message.hasOwnProperty("userNotice")) - object.userNotice = options.enums === String ? $root.proto.WebFeatures.WebFeaturesFlag[message.userNotice] : message.userNotice; - if (message.support != null && message.hasOwnProperty("support")) - object.support = options.enums === String ? $root.proto.WebFeatures.WebFeaturesFlag[message.support] : message.support; - if (message.groupUiiCleanup != null && message.hasOwnProperty("groupUiiCleanup")) - object.groupUiiCleanup = options.enums === String ? $root.proto.WebFeatures.WebFeaturesFlag[message.groupUiiCleanup] : message.groupUiiCleanup; - if (message.groupDogfoodingInternalOnly != null && message.hasOwnProperty("groupDogfoodingInternalOnly")) - object.groupDogfoodingInternalOnly = options.enums === String ? $root.proto.WebFeatures.WebFeaturesFlag[message.groupDogfoodingInternalOnly] : message.groupDogfoodingInternalOnly; - if (message.settingsSync != null && message.hasOwnProperty("settingsSync")) - object.settingsSync = options.enums === String ? $root.proto.WebFeatures.WebFeaturesFlag[message.settingsSync] : message.settingsSync; - if (message.archiveV2 != null && message.hasOwnProperty("archiveV2")) - object.archiveV2 = options.enums === String ? $root.proto.WebFeatures.WebFeaturesFlag[message.archiveV2] : message.archiveV2; - if (message.ephemeralAllowGroupMembers != null && message.hasOwnProperty("ephemeralAllowGroupMembers")) - object.ephemeralAllowGroupMembers = options.enums === String ? $root.proto.WebFeatures.WebFeaturesFlag[message.ephemeralAllowGroupMembers] : message.ephemeralAllowGroupMembers; - if (message.ephemeral24HDuration != null && message.hasOwnProperty("ephemeral24HDuration")) - object.ephemeral24HDuration = options.enums === String ? $root.proto.WebFeatures.WebFeaturesFlag[message.ephemeral24HDuration] : message.ephemeral24HDuration; - if (message.mdForceUpgrade != null && message.hasOwnProperty("mdForceUpgrade")) - object.mdForceUpgrade = options.enums === String ? $root.proto.WebFeatures.WebFeaturesFlag[message.mdForceUpgrade] : message.mdForceUpgrade; - if (message.disappearingMode != null && message.hasOwnProperty("disappearingMode")) - object.disappearingMode = options.enums === String ? $root.proto.WebFeatures.WebFeaturesFlag[message.disappearingMode] : message.disappearingMode; - if (message.externalMdOptInAvailable != null && message.hasOwnProperty("externalMdOptInAvailable")) - object.externalMdOptInAvailable = options.enums === String ? $root.proto.WebFeatures.WebFeaturesFlag[message.externalMdOptInAvailable] : message.externalMdOptInAvailable; - if (message.noDeleteMessageTimeLimit != null && message.hasOwnProperty("noDeleteMessageTimeLimit")) - object.noDeleteMessageTimeLimit = options.enums === String ? $root.proto.WebFeatures.WebFeaturesFlag[message.noDeleteMessageTimeLimit] : message.noDeleteMessageTimeLimit; + if (message.platform != null && message.hasOwnProperty("platform")) + object.platform = options.enums === String ? $root.proto.UserAgent.UserAgentPlatform[message.platform] : message.platform; + if (message.appVersion != null && message.hasOwnProperty("appVersion")) + object.appVersion = $root.proto.AppVersion.toObject(message.appVersion, options); + if (message.mcc != null && message.hasOwnProperty("mcc")) + object.mcc = message.mcc; + if (message.mnc != null && message.hasOwnProperty("mnc")) + object.mnc = message.mnc; + if (message.osVersion != null && message.hasOwnProperty("osVersion")) + object.osVersion = message.osVersion; + if (message.manufacturer != null && message.hasOwnProperty("manufacturer")) + object.manufacturer = message.manufacturer; + if (message.device != null && message.hasOwnProperty("device")) + object.device = message.device; + if (message.osBuildNumber != null && message.hasOwnProperty("osBuildNumber")) + object.osBuildNumber = message.osBuildNumber; + if (message.phoneId != null && message.hasOwnProperty("phoneId")) + object.phoneId = message.phoneId; + if (message.releaseChannel != null && message.hasOwnProperty("releaseChannel")) + object.releaseChannel = options.enums === String ? $root.proto.UserAgent.UserAgentReleaseChannel[message.releaseChannel] : message.releaseChannel; + if (message.localeLanguageIso6391 != null && message.hasOwnProperty("localeLanguageIso6391")) + object.localeLanguageIso6391 = message.localeLanguageIso6391; + if (message.localeCountryIso31661Alpha2 != null && message.hasOwnProperty("localeCountryIso31661Alpha2")) + object.localeCountryIso31661Alpha2 = message.localeCountryIso31661Alpha2; + if (message.deviceBoard != null && message.hasOwnProperty("deviceBoard")) + object.deviceBoard = message.deviceBoard; return object; }; /** - * Converts this WebFeatures to JSON. + * Converts this UserAgent to JSON. * @function toJSON - * @memberof proto.WebFeatures + * @memberof proto.UserAgent * @instance * @returns {Object.} JSON object */ - WebFeatures.prototype.toJSON = function toJSON() { + UserAgent.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * WebFeaturesFlag enum. - * @name proto.WebFeatures.WebFeaturesFlag + * UserAgentPlatform enum. + * @name proto.UserAgent.UserAgentPlatform * @enum {number} - * @property {number} NOT_STARTED=0 NOT_STARTED value - * @property {number} FORCE_UPGRADE=1 FORCE_UPGRADE value - * @property {number} DEVELOPMENT=2 DEVELOPMENT value - * @property {number} PRODUCTION=3 PRODUCTION value + * @property {number} ANDROID=0 ANDROID value + * @property {number} IOS=1 IOS value + * @property {number} WINDOWS_PHONE=2 WINDOWS_PHONE value + * @property {number} BLACKBERRY=3 BLACKBERRY value + * @property {number} BLACKBERRYX=4 BLACKBERRYX value + * @property {number} S40=5 S40 value + * @property {number} S60=6 S60 value + * @property {number} PYTHON_CLIENT=7 PYTHON_CLIENT value + * @property {number} TIZEN=8 TIZEN value + * @property {number} ENTERPRISE=9 ENTERPRISE value + * @property {number} SMB_ANDROID=10 SMB_ANDROID value + * @property {number} KAIOS=11 KAIOS value + * @property {number} SMB_IOS=12 SMB_IOS value + * @property {number} WINDOWS=13 WINDOWS value + * @property {number} WEB=14 WEB value + * @property {number} PORTAL=15 PORTAL value + * @property {number} GREEN_ANDROID=16 GREEN_ANDROID value + * @property {number} GREEN_IPHONE=17 GREEN_IPHONE value + * @property {number} BLUE_ANDROID=18 BLUE_ANDROID value + * @property {number} BLUE_IPHONE=19 BLUE_IPHONE value + * @property {number} FBLITE_ANDROID=20 FBLITE_ANDROID value + * @property {number} MLITE_ANDROID=21 MLITE_ANDROID value + * @property {number} IGLITE_ANDROID=22 IGLITE_ANDROID value + * @property {number} PAGE=23 PAGE value + * @property {number} MACOS=24 MACOS value + * @property {number} OCULUS_MSG=25 OCULUS_MSG value + * @property {number} OCULUS_CALL=26 OCULUS_CALL value + * @property {number} MILAN=27 MILAN value + * @property {number} CAPI=28 CAPI value */ - WebFeatures.WebFeaturesFlag = (function() { + UserAgent.UserAgentPlatform = (function() { var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "NOT_STARTED"] = 0; - values[valuesById[1] = "FORCE_UPGRADE"] = 1; - values[valuesById[2] = "DEVELOPMENT"] = 2; - values[valuesById[3] = "PRODUCTION"] = 3; - return values; - })(); - - return WebFeatures; - })(); - - proto.NotificationMessageInfo = (function() { - - /** - * Properties of a NotificationMessageInfo. - * @memberof proto - * @interface INotificationMessageInfo - * @property {proto.IMessageKey|null} [key] NotificationMessageInfo key - * @property {proto.IMessage|null} [message] NotificationMessageInfo message - * @property {number|Long|null} [messageTimestamp] NotificationMessageInfo messageTimestamp - * @property {string|null} [participant] NotificationMessageInfo participant - */ - - /** - * Constructs a new NotificationMessageInfo. - * @memberof proto - * @classdesc Represents a NotificationMessageInfo. - * @implements INotificationMessageInfo - * @constructor - * @param {proto.INotificationMessageInfo=} [properties] Properties to set + values[valuesById[0] = "ANDROID"] = 0; + values[valuesById[1] = "IOS"] = 1; + values[valuesById[2] = "WINDOWS_PHONE"] = 2; + values[valuesById[3] = "BLACKBERRY"] = 3; + values[valuesById[4] = "BLACKBERRYX"] = 4; + values[valuesById[5] = "S40"] = 5; + values[valuesById[6] = "S60"] = 6; + values[valuesById[7] = "PYTHON_CLIENT"] = 7; + values[valuesById[8] = "TIZEN"] = 8; + values[valuesById[9] = "ENTERPRISE"] = 9; + values[valuesById[10] = "SMB_ANDROID"] = 10; + values[valuesById[11] = "KAIOS"] = 11; + values[valuesById[12] = "SMB_IOS"] = 12; + values[valuesById[13] = "WINDOWS"] = 13; + values[valuesById[14] = "WEB"] = 14; + values[valuesById[15] = "PORTAL"] = 15; + values[valuesById[16] = "GREEN_ANDROID"] = 16; + values[valuesById[17] = "GREEN_IPHONE"] = 17; + values[valuesById[18] = "BLUE_ANDROID"] = 18; + values[valuesById[19] = "BLUE_IPHONE"] = 19; + values[valuesById[20] = "FBLITE_ANDROID"] = 20; + values[valuesById[21] = "MLITE_ANDROID"] = 21; + values[valuesById[22] = "IGLITE_ANDROID"] = 22; + values[valuesById[23] = "PAGE"] = 23; + values[valuesById[24] = "MACOS"] = 24; + values[valuesById[25] = "OCULUS_MSG"] = 25; + values[valuesById[26] = "OCULUS_CALL"] = 26; + values[valuesById[27] = "MILAN"] = 27; + values[valuesById[28] = "CAPI"] = 28; + return values; + })(); + + /** + * UserAgentReleaseChannel enum. + * @name proto.UserAgent.UserAgentReleaseChannel + * @enum {number} + * @property {number} RELEASE=0 RELEASE value + * @property {number} BETA=1 BETA value + * @property {number} ALPHA=2 ALPHA value + * @property {number} DEBUG=3 DEBUG value */ - function NotificationMessageInfo(properties) { + UserAgent.UserAgentReleaseChannel = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "RELEASE"] = 0; + values[valuesById[1] = "BETA"] = 1; + values[valuesById[2] = "ALPHA"] = 2; + values[valuesById[3] = "DEBUG"] = 3; + return values; + })(); + + return UserAgent; + })(); + + proto.WebdPayload = (function() { + + /** + * Properties of a WebdPayload. + * @memberof proto + * @interface IWebdPayload + * @property {boolean|null} [usesParticipantInKey] WebdPayload usesParticipantInKey + * @property {boolean|null} [supportsStarredMessages] WebdPayload supportsStarredMessages + * @property {boolean|null} [supportsDocumentMessages] WebdPayload supportsDocumentMessages + * @property {boolean|null} [supportsUrlMessages] WebdPayload supportsUrlMessages + * @property {boolean|null} [supportsMediaRetry] WebdPayload supportsMediaRetry + * @property {boolean|null} [supportsE2EImage] WebdPayload supportsE2EImage + * @property {boolean|null} [supportsE2EVideo] WebdPayload supportsE2EVideo + * @property {boolean|null} [supportsE2EAudio] WebdPayload supportsE2EAudio + * @property {boolean|null} [supportsE2EDocument] WebdPayload supportsE2EDocument + * @property {string|null} [documentTypes] WebdPayload documentTypes + * @property {Uint8Array|null} [features] WebdPayload features + */ + + /** + * Constructs a new WebdPayload. + * @memberof proto + * @classdesc Represents a WebdPayload. + * @implements IWebdPayload + * @constructor + * @param {proto.IWebdPayload=} [properties] Properties to set + */ + function WebdPayload(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -56143,114 +54302,205 @@ $root.proto = (function() { } /** - * NotificationMessageInfo key. - * @member {proto.IMessageKey|null|undefined} key - * @memberof proto.NotificationMessageInfo + * WebdPayload usesParticipantInKey. + * @member {boolean} usesParticipantInKey + * @memberof proto.WebdPayload * @instance */ - NotificationMessageInfo.prototype.key = null; + WebdPayload.prototype.usesParticipantInKey = false; /** - * NotificationMessageInfo message. - * @member {proto.IMessage|null|undefined} message - * @memberof proto.NotificationMessageInfo + * WebdPayload supportsStarredMessages. + * @member {boolean} supportsStarredMessages + * @memberof proto.WebdPayload * @instance */ - NotificationMessageInfo.prototype.message = null; + WebdPayload.prototype.supportsStarredMessages = false; /** - * NotificationMessageInfo messageTimestamp. - * @member {number|Long} messageTimestamp - * @memberof proto.NotificationMessageInfo + * WebdPayload supportsDocumentMessages. + * @member {boolean} supportsDocumentMessages + * @memberof proto.WebdPayload * @instance */ - NotificationMessageInfo.prototype.messageTimestamp = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + WebdPayload.prototype.supportsDocumentMessages = false; /** - * NotificationMessageInfo participant. - * @member {string} participant - * @memberof proto.NotificationMessageInfo + * WebdPayload supportsUrlMessages. + * @member {boolean} supportsUrlMessages + * @memberof proto.WebdPayload * @instance */ - NotificationMessageInfo.prototype.participant = ""; + WebdPayload.prototype.supportsUrlMessages = false; /** - * Creates a new NotificationMessageInfo instance using the specified properties. + * WebdPayload supportsMediaRetry. + * @member {boolean} supportsMediaRetry + * @memberof proto.WebdPayload + * @instance + */ + WebdPayload.prototype.supportsMediaRetry = false; + + /** + * WebdPayload supportsE2EImage. + * @member {boolean} supportsE2EImage + * @memberof proto.WebdPayload + * @instance + */ + WebdPayload.prototype.supportsE2EImage = false; + + /** + * WebdPayload supportsE2EVideo. + * @member {boolean} supportsE2EVideo + * @memberof proto.WebdPayload + * @instance + */ + WebdPayload.prototype.supportsE2EVideo = false; + + /** + * WebdPayload supportsE2EAudio. + * @member {boolean} supportsE2EAudio + * @memberof proto.WebdPayload + * @instance + */ + WebdPayload.prototype.supportsE2EAudio = false; + + /** + * WebdPayload supportsE2EDocument. + * @member {boolean} supportsE2EDocument + * @memberof proto.WebdPayload + * @instance + */ + WebdPayload.prototype.supportsE2EDocument = false; + + /** + * WebdPayload documentTypes. + * @member {string} documentTypes + * @memberof proto.WebdPayload + * @instance + */ + WebdPayload.prototype.documentTypes = ""; + + /** + * WebdPayload features. + * @member {Uint8Array} features + * @memberof proto.WebdPayload + * @instance + */ + WebdPayload.prototype.features = $util.newBuffer([]); + + /** + * Creates a new WebdPayload instance using the specified properties. * @function create - * @memberof proto.NotificationMessageInfo + * @memberof proto.WebdPayload * @static - * @param {proto.INotificationMessageInfo=} [properties] Properties to set - * @returns {proto.NotificationMessageInfo} NotificationMessageInfo instance + * @param {proto.IWebdPayload=} [properties] Properties to set + * @returns {proto.WebdPayload} WebdPayload instance */ - NotificationMessageInfo.create = function create(properties) { - return new NotificationMessageInfo(properties); + WebdPayload.create = function create(properties) { + return new WebdPayload(properties); }; /** - * Encodes the specified NotificationMessageInfo message. Does not implicitly {@link proto.NotificationMessageInfo.verify|verify} messages. + * Encodes the specified WebdPayload message. Does not implicitly {@link proto.WebdPayload.verify|verify} messages. * @function encode - * @memberof proto.NotificationMessageInfo + * @memberof proto.WebdPayload * @static - * @param {proto.INotificationMessageInfo} message NotificationMessageInfo message or plain object to encode + * @param {proto.IWebdPayload} message WebdPayload message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - NotificationMessageInfo.encode = function encode(message, writer) { + WebdPayload.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.key != null && Object.hasOwnProperty.call(message, "key")) - $root.proto.MessageKey.encode(message.key, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.message != null && Object.hasOwnProperty.call(message, "message")) - $root.proto.Message.encode(message.message, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.messageTimestamp != null && Object.hasOwnProperty.call(message, "messageTimestamp")) - writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.messageTimestamp); - if (message.participant != null && Object.hasOwnProperty.call(message, "participant")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.participant); + if (message.usesParticipantInKey != null && Object.hasOwnProperty.call(message, "usesParticipantInKey")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.usesParticipantInKey); + if (message.supportsStarredMessages != null && Object.hasOwnProperty.call(message, "supportsStarredMessages")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.supportsStarredMessages); + if (message.supportsDocumentMessages != null && Object.hasOwnProperty.call(message, "supportsDocumentMessages")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.supportsDocumentMessages); + if (message.supportsUrlMessages != null && Object.hasOwnProperty.call(message, "supportsUrlMessages")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.supportsUrlMessages); + if (message.supportsMediaRetry != null && Object.hasOwnProperty.call(message, "supportsMediaRetry")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.supportsMediaRetry); + if (message.supportsE2EImage != null && Object.hasOwnProperty.call(message, "supportsE2EImage")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.supportsE2EImage); + if (message.supportsE2EVideo != null && Object.hasOwnProperty.call(message, "supportsE2EVideo")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.supportsE2EVideo); + if (message.supportsE2EAudio != null && Object.hasOwnProperty.call(message, "supportsE2EAudio")) + writer.uint32(/* id 8, wireType 0 =*/64).bool(message.supportsE2EAudio); + if (message.supportsE2EDocument != null && Object.hasOwnProperty.call(message, "supportsE2EDocument")) + writer.uint32(/* id 9, wireType 0 =*/72).bool(message.supportsE2EDocument); + if (message.documentTypes != null && Object.hasOwnProperty.call(message, "documentTypes")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.documentTypes); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + writer.uint32(/* id 11, wireType 2 =*/90).bytes(message.features); return writer; }; /** - * Encodes the specified NotificationMessageInfo message, length delimited. Does not implicitly {@link proto.NotificationMessageInfo.verify|verify} messages. + * Encodes the specified WebdPayload message, length delimited. Does not implicitly {@link proto.WebdPayload.verify|verify} messages. * @function encodeDelimited - * @memberof proto.NotificationMessageInfo + * @memberof proto.WebdPayload * @static - * @param {proto.INotificationMessageInfo} message NotificationMessageInfo message or plain object to encode + * @param {proto.IWebdPayload} message WebdPayload message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - NotificationMessageInfo.encodeDelimited = function encodeDelimited(message, writer) { + WebdPayload.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a NotificationMessageInfo message from the specified reader or buffer. + * Decodes a WebdPayload message from the specified reader or buffer. * @function decode - * @memberof proto.NotificationMessageInfo + * @memberof proto.WebdPayload * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {proto.NotificationMessageInfo} NotificationMessageInfo + * @returns {proto.WebdPayload} WebdPayload * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - NotificationMessageInfo.decode = function decode(reader, length) { + WebdPayload.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.NotificationMessageInfo(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.WebdPayload(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.key = $root.proto.MessageKey.decode(reader, reader.uint32()); + message.usesParticipantInKey = reader.bool(); break; case 2: - message.message = $root.proto.Message.decode(reader, reader.uint32()); + message.supportsStarredMessages = reader.bool(); break; case 3: - message.messageTimestamp = reader.uint64(); + message.supportsDocumentMessages = reader.bool(); break; case 4: - message.participant = reader.string(); + message.supportsUrlMessages = reader.bool(); + break; + case 5: + message.supportsMediaRetry = reader.bool(); + break; + case 6: + message.supportsE2EImage = reader.bool(); + break; + case 7: + message.supportsE2EVideo = reader.bool(); + break; + case 8: + message.supportsE2EAudio = reader.bool(); + break; + case 9: + message.supportsE2EDocument = reader.bool(); + break; + case 10: + message.documentTypes = reader.string(); + break; + case 11: + message.features = reader.bytes(); break; default: reader.skipType(tag & 7); @@ -56261,160 +54511,200 @@ $root.proto = (function() { }; /** - * Decodes a NotificationMessageInfo message from the specified reader or buffer, length delimited. + * Decodes a WebdPayload message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof proto.NotificationMessageInfo + * @memberof proto.WebdPayload * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.NotificationMessageInfo} NotificationMessageInfo + * @returns {proto.WebdPayload} WebdPayload * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - NotificationMessageInfo.decodeDelimited = function decodeDelimited(reader) { + WebdPayload.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a NotificationMessageInfo message. + * Verifies a WebdPayload message. * @function verify - * @memberof proto.NotificationMessageInfo + * @memberof proto.WebdPayload * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - NotificationMessageInfo.verify = function verify(message) { + WebdPayload.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.key != null && message.hasOwnProperty("key")) { - var error = $root.proto.MessageKey.verify(message.key); - if (error) - return "key." + error; - } - if (message.message != null && message.hasOwnProperty("message")) { - var error = $root.proto.Message.verify(message.message); - if (error) - return "message." + error; - } - if (message.messageTimestamp != null && message.hasOwnProperty("messageTimestamp")) - if (!$util.isInteger(message.messageTimestamp) && !(message.messageTimestamp && $util.isInteger(message.messageTimestamp.low) && $util.isInteger(message.messageTimestamp.high))) - return "messageTimestamp: integer|Long expected"; - if (message.participant != null && message.hasOwnProperty("participant")) - if (!$util.isString(message.participant)) - return "participant: string expected"; + if (message.usesParticipantInKey != null && message.hasOwnProperty("usesParticipantInKey")) + if (typeof message.usesParticipantInKey !== "boolean") + return "usesParticipantInKey: boolean expected"; + if (message.supportsStarredMessages != null && message.hasOwnProperty("supportsStarredMessages")) + if (typeof message.supportsStarredMessages !== "boolean") + return "supportsStarredMessages: boolean expected"; + if (message.supportsDocumentMessages != null && message.hasOwnProperty("supportsDocumentMessages")) + if (typeof message.supportsDocumentMessages !== "boolean") + return "supportsDocumentMessages: boolean expected"; + if (message.supportsUrlMessages != null && message.hasOwnProperty("supportsUrlMessages")) + if (typeof message.supportsUrlMessages !== "boolean") + return "supportsUrlMessages: boolean expected"; + if (message.supportsMediaRetry != null && message.hasOwnProperty("supportsMediaRetry")) + if (typeof message.supportsMediaRetry !== "boolean") + return "supportsMediaRetry: boolean expected"; + if (message.supportsE2EImage != null && message.hasOwnProperty("supportsE2EImage")) + if (typeof message.supportsE2EImage !== "boolean") + return "supportsE2EImage: boolean expected"; + if (message.supportsE2EVideo != null && message.hasOwnProperty("supportsE2EVideo")) + if (typeof message.supportsE2EVideo !== "boolean") + return "supportsE2EVideo: boolean expected"; + if (message.supportsE2EAudio != null && message.hasOwnProperty("supportsE2EAudio")) + if (typeof message.supportsE2EAudio !== "boolean") + return "supportsE2EAudio: boolean expected"; + if (message.supportsE2EDocument != null && message.hasOwnProperty("supportsE2EDocument")) + if (typeof message.supportsE2EDocument !== "boolean") + return "supportsE2EDocument: boolean expected"; + if (message.documentTypes != null && message.hasOwnProperty("documentTypes")) + if (!$util.isString(message.documentTypes)) + return "documentTypes: string expected"; + if (message.features != null && message.hasOwnProperty("features")) + if (!(message.features && typeof message.features.length === "number" || $util.isString(message.features))) + return "features: buffer expected"; return null; }; /** - * Creates a NotificationMessageInfo message from a plain object. Also converts values to their respective internal types. + * Creates a WebdPayload message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof proto.NotificationMessageInfo + * @memberof proto.WebdPayload * @static * @param {Object.} object Plain object - * @returns {proto.NotificationMessageInfo} NotificationMessageInfo + * @returns {proto.WebdPayload} WebdPayload */ - NotificationMessageInfo.fromObject = function fromObject(object) { - if (object instanceof $root.proto.NotificationMessageInfo) + WebdPayload.fromObject = function fromObject(object) { + if (object instanceof $root.proto.WebdPayload) return object; - var message = new $root.proto.NotificationMessageInfo(); - if (object.key != null) { - if (typeof object.key !== "object") - throw TypeError(".proto.NotificationMessageInfo.key: object expected"); - message.key = $root.proto.MessageKey.fromObject(object.key); - } - if (object.message != null) { - if (typeof object.message !== "object") - throw TypeError(".proto.NotificationMessageInfo.message: object expected"); - message.message = $root.proto.Message.fromObject(object.message); - } - if (object.messageTimestamp != null) - if ($util.Long) - (message.messageTimestamp = $util.Long.fromValue(object.messageTimestamp)).unsigned = true; - else if (typeof object.messageTimestamp === "string") - message.messageTimestamp = parseInt(object.messageTimestamp, 10); - else if (typeof object.messageTimestamp === "number") - message.messageTimestamp = object.messageTimestamp; - else if (typeof object.messageTimestamp === "object") - message.messageTimestamp = new $util.LongBits(object.messageTimestamp.low >>> 0, object.messageTimestamp.high >>> 0).toNumber(true); - if (object.participant != null) - message.participant = String(object.participant); + var message = new $root.proto.WebdPayload(); + if (object.usesParticipantInKey != null) + message.usesParticipantInKey = Boolean(object.usesParticipantInKey); + if (object.supportsStarredMessages != null) + message.supportsStarredMessages = Boolean(object.supportsStarredMessages); + if (object.supportsDocumentMessages != null) + message.supportsDocumentMessages = Boolean(object.supportsDocumentMessages); + if (object.supportsUrlMessages != null) + message.supportsUrlMessages = Boolean(object.supportsUrlMessages); + if (object.supportsMediaRetry != null) + message.supportsMediaRetry = Boolean(object.supportsMediaRetry); + if (object.supportsE2EImage != null) + message.supportsE2EImage = Boolean(object.supportsE2EImage); + if (object.supportsE2EVideo != null) + message.supportsE2EVideo = Boolean(object.supportsE2EVideo); + if (object.supportsE2EAudio != null) + message.supportsE2EAudio = Boolean(object.supportsE2EAudio); + if (object.supportsE2EDocument != null) + message.supportsE2EDocument = Boolean(object.supportsE2EDocument); + if (object.documentTypes != null) + message.documentTypes = String(object.documentTypes); + if (object.features != null) + if (typeof object.features === "string") + $util.base64.decode(object.features, message.features = $util.newBuffer($util.base64.length(object.features)), 0); + else if (object.features.length) + message.features = object.features; return message; }; /** - * Creates a plain object from a NotificationMessageInfo message. Also converts values to other types if specified. + * Creates a plain object from a WebdPayload message. Also converts values to other types if specified. * @function toObject - * @memberof proto.NotificationMessageInfo + * @memberof proto.WebdPayload * @static - * @param {proto.NotificationMessageInfo} message NotificationMessageInfo + * @param {proto.WebdPayload} message WebdPayload * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - NotificationMessageInfo.toObject = function toObject(message, options) { + WebdPayload.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.key = null; - object.message = null; - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.messageTimestamp = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.messageTimestamp = options.longs === String ? "0" : 0; - object.participant = ""; + object.usesParticipantInKey = false; + object.supportsStarredMessages = false; + object.supportsDocumentMessages = false; + object.supportsUrlMessages = false; + object.supportsMediaRetry = false; + object.supportsE2EImage = false; + object.supportsE2EVideo = false; + object.supportsE2EAudio = false; + object.supportsE2EDocument = false; + object.documentTypes = ""; + if (options.bytes === String) + object.features = ""; + else { + object.features = []; + if (options.bytes !== Array) + object.features = $util.newBuffer(object.features); + } } - if (message.key != null && message.hasOwnProperty("key")) - object.key = $root.proto.MessageKey.toObject(message.key, options); - if (message.message != null && message.hasOwnProperty("message")) - object.message = $root.proto.Message.toObject(message.message, options); - if (message.messageTimestamp != null && message.hasOwnProperty("messageTimestamp")) - if (typeof message.messageTimestamp === "number") - object.messageTimestamp = options.longs === String ? String(message.messageTimestamp) : message.messageTimestamp; - else - object.messageTimestamp = options.longs === String ? $util.Long.prototype.toString.call(message.messageTimestamp) : options.longs === Number ? new $util.LongBits(message.messageTimestamp.low >>> 0, message.messageTimestamp.high >>> 0).toNumber(true) : message.messageTimestamp; - if (message.participant != null && message.hasOwnProperty("participant")) - object.participant = message.participant; + if (message.usesParticipantInKey != null && message.hasOwnProperty("usesParticipantInKey")) + object.usesParticipantInKey = message.usesParticipantInKey; + if (message.supportsStarredMessages != null && message.hasOwnProperty("supportsStarredMessages")) + object.supportsStarredMessages = message.supportsStarredMessages; + if (message.supportsDocumentMessages != null && message.hasOwnProperty("supportsDocumentMessages")) + object.supportsDocumentMessages = message.supportsDocumentMessages; + if (message.supportsUrlMessages != null && message.hasOwnProperty("supportsUrlMessages")) + object.supportsUrlMessages = message.supportsUrlMessages; + if (message.supportsMediaRetry != null && message.hasOwnProperty("supportsMediaRetry")) + object.supportsMediaRetry = message.supportsMediaRetry; + if (message.supportsE2EImage != null && message.hasOwnProperty("supportsE2EImage")) + object.supportsE2EImage = message.supportsE2EImage; + if (message.supportsE2EVideo != null && message.hasOwnProperty("supportsE2EVideo")) + object.supportsE2EVideo = message.supportsE2EVideo; + if (message.supportsE2EAudio != null && message.hasOwnProperty("supportsE2EAudio")) + object.supportsE2EAudio = message.supportsE2EAudio; + if (message.supportsE2EDocument != null && message.hasOwnProperty("supportsE2EDocument")) + object.supportsE2EDocument = message.supportsE2EDocument; + if (message.documentTypes != null && message.hasOwnProperty("documentTypes")) + object.documentTypes = message.documentTypes; + if (message.features != null && message.hasOwnProperty("features")) + object.features = options.bytes === String ? $util.base64.encode(message.features, 0, message.features.length) : options.bytes === Array ? Array.prototype.slice.call(message.features) : message.features; return object; }; /** - * Converts this NotificationMessageInfo to JSON. + * Converts this WebdPayload to JSON. * @function toJSON - * @memberof proto.NotificationMessageInfo + * @memberof proto.WebdPayload * @instance * @returns {Object.} JSON object */ - NotificationMessageInfo.prototype.toJSON = function toJSON() { + WebdPayload.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return NotificationMessageInfo; + return WebdPayload; })(); - proto.WebNotificationsInfo = (function() { + proto.WebInfo = (function() { /** - * Properties of a WebNotificationsInfo. + * Properties of a WebInfo. * @memberof proto - * @interface IWebNotificationsInfo - * @property {number|Long|null} [timestamp] WebNotificationsInfo timestamp - * @property {number|null} [unreadChats] WebNotificationsInfo unreadChats - * @property {number|null} [notifyMessageCount] WebNotificationsInfo notifyMessageCount - * @property {Array.|null} [notifyMessages] WebNotificationsInfo notifyMessages + * @interface IWebInfo + * @property {string|null} [refToken] WebInfo refToken + * @property {string|null} [version] WebInfo version + * @property {proto.IWebdPayload|null} [webdPayload] WebInfo webdPayload + * @property {proto.WebInfo.WebInfoWebSubPlatform|null} [webSubPlatform] WebInfo webSubPlatform */ /** - * Constructs a new WebNotificationsInfo. + * Constructs a new WebInfo. * @memberof proto - * @classdesc Represents a WebNotificationsInfo. - * @implements IWebNotificationsInfo + * @classdesc Represents a WebInfo. + * @implements IWebInfo * @constructor - * @param {proto.IWebNotificationsInfo=} [properties] Properties to set + * @param {proto.IWebInfo=} [properties] Properties to set */ - function WebNotificationsInfo(properties) { - this.notifyMessages = []; + function WebInfo(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -56422,117 +54712,114 @@ $root.proto = (function() { } /** - * WebNotificationsInfo timestamp. - * @member {number|Long} timestamp - * @memberof proto.WebNotificationsInfo + * WebInfo refToken. + * @member {string} refToken + * @memberof proto.WebInfo * @instance */ - WebNotificationsInfo.prototype.timestamp = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + WebInfo.prototype.refToken = ""; /** - * WebNotificationsInfo unreadChats. - * @member {number} unreadChats - * @memberof proto.WebNotificationsInfo + * WebInfo version. + * @member {string} version + * @memberof proto.WebInfo * @instance */ - WebNotificationsInfo.prototype.unreadChats = 0; + WebInfo.prototype.version = ""; /** - * WebNotificationsInfo notifyMessageCount. - * @member {number} notifyMessageCount - * @memberof proto.WebNotificationsInfo + * WebInfo webdPayload. + * @member {proto.IWebdPayload|null|undefined} webdPayload + * @memberof proto.WebInfo * @instance */ - WebNotificationsInfo.prototype.notifyMessageCount = 0; + WebInfo.prototype.webdPayload = null; /** - * WebNotificationsInfo notifyMessages. - * @member {Array.} notifyMessages - * @memberof proto.WebNotificationsInfo + * WebInfo webSubPlatform. + * @member {proto.WebInfo.WebInfoWebSubPlatform} webSubPlatform + * @memberof proto.WebInfo * @instance */ - WebNotificationsInfo.prototype.notifyMessages = $util.emptyArray; + WebInfo.prototype.webSubPlatform = 0; /** - * Creates a new WebNotificationsInfo instance using the specified properties. + * Creates a new WebInfo instance using the specified properties. * @function create - * @memberof proto.WebNotificationsInfo + * @memberof proto.WebInfo * @static - * @param {proto.IWebNotificationsInfo=} [properties] Properties to set - * @returns {proto.WebNotificationsInfo} WebNotificationsInfo instance + * @param {proto.IWebInfo=} [properties] Properties to set + * @returns {proto.WebInfo} WebInfo instance */ - WebNotificationsInfo.create = function create(properties) { - return new WebNotificationsInfo(properties); + WebInfo.create = function create(properties) { + return new WebInfo(properties); }; /** - * Encodes the specified WebNotificationsInfo message. Does not implicitly {@link proto.WebNotificationsInfo.verify|verify} messages. + * Encodes the specified WebInfo message. Does not implicitly {@link proto.WebInfo.verify|verify} messages. * @function encode - * @memberof proto.WebNotificationsInfo + * @memberof proto.WebInfo * @static - * @param {proto.IWebNotificationsInfo} message WebNotificationsInfo message or plain object to encode + * @param {proto.IWebInfo} message WebInfo message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - WebNotificationsInfo.encode = function encode(message, writer) { + WebInfo.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.timestamp != null && Object.hasOwnProperty.call(message, "timestamp")) - writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.timestamp); - if (message.unreadChats != null && Object.hasOwnProperty.call(message, "unreadChats")) - writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.unreadChats); - if (message.notifyMessageCount != null && Object.hasOwnProperty.call(message, "notifyMessageCount")) - writer.uint32(/* id 4, wireType 0 =*/32).uint32(message.notifyMessageCount); - if (message.notifyMessages != null && message.notifyMessages.length) - for (var i = 0; i < message.notifyMessages.length; ++i) - $root.proto.WebMessageInfo.encode(message.notifyMessages[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.refToken != null && Object.hasOwnProperty.call(message, "refToken")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.refToken); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.version); + if (message.webdPayload != null && Object.hasOwnProperty.call(message, "webdPayload")) + $root.proto.WebdPayload.encode(message.webdPayload, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.webSubPlatform != null && Object.hasOwnProperty.call(message, "webSubPlatform")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.webSubPlatform); return writer; }; /** - * Encodes the specified WebNotificationsInfo message, length delimited. Does not implicitly {@link proto.WebNotificationsInfo.verify|verify} messages. + * Encodes the specified WebInfo message, length delimited. Does not implicitly {@link proto.WebInfo.verify|verify} messages. * @function encodeDelimited - * @memberof proto.WebNotificationsInfo + * @memberof proto.WebInfo * @static - * @param {proto.IWebNotificationsInfo} message WebNotificationsInfo message or plain object to encode + * @param {proto.IWebInfo} message WebInfo message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - WebNotificationsInfo.encodeDelimited = function encodeDelimited(message, writer) { + WebInfo.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a WebNotificationsInfo message from the specified reader or buffer. + * Decodes a WebInfo message from the specified reader or buffer. * @function decode - * @memberof proto.WebNotificationsInfo + * @memberof proto.WebInfo * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {proto.WebNotificationsInfo} WebNotificationsInfo + * @returns {proto.WebInfo} WebInfo * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - WebNotificationsInfo.decode = function decode(reader, length) { + WebInfo.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.WebNotificationsInfo(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.WebInfo(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { + case 1: + message.refToken = reader.string(); + break; case 2: - message.timestamp = reader.uint64(); + message.version = reader.string(); break; case 3: - message.unreadChats = reader.uint32(); + message.webdPayload = $root.proto.WebdPayload.decode(reader, reader.uint32()); break; case 4: - message.notifyMessageCount = reader.uint32(); - break; - case 5: - if (!(message.notifyMessages && message.notifyMessages.length)) - message.notifyMessages = []; - message.notifyMessages.push($root.proto.WebMessageInfo.decode(reader, reader.uint32())); + message.webSubPlatform = reader.int32(); break; default: reader.skipType(tag & 7); @@ -56543,176 +54830,185 @@ $root.proto = (function() { }; /** - * Decodes a WebNotificationsInfo message from the specified reader or buffer, length delimited. + * Decodes a WebInfo message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof proto.WebNotificationsInfo + * @memberof proto.WebInfo * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.WebNotificationsInfo} WebNotificationsInfo + * @returns {proto.WebInfo} WebInfo * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - WebNotificationsInfo.decodeDelimited = function decodeDelimited(reader) { + WebInfo.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a WebNotificationsInfo message. + * Verifies a WebInfo message. * @function verify - * @memberof proto.WebNotificationsInfo + * @memberof proto.WebInfo * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - WebNotificationsInfo.verify = function verify(message) { + WebInfo.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.timestamp != null && message.hasOwnProperty("timestamp")) - if (!$util.isInteger(message.timestamp) && !(message.timestamp && $util.isInteger(message.timestamp.low) && $util.isInteger(message.timestamp.high))) - return "timestamp: integer|Long expected"; - if (message.unreadChats != null && message.hasOwnProperty("unreadChats")) - if (!$util.isInteger(message.unreadChats)) - return "unreadChats: integer expected"; - if (message.notifyMessageCount != null && message.hasOwnProperty("notifyMessageCount")) - if (!$util.isInteger(message.notifyMessageCount)) - return "notifyMessageCount: integer expected"; - if (message.notifyMessages != null && message.hasOwnProperty("notifyMessages")) { - if (!Array.isArray(message.notifyMessages)) - return "notifyMessages: array expected"; - for (var i = 0; i < message.notifyMessages.length; ++i) { - var error = $root.proto.WebMessageInfo.verify(message.notifyMessages[i]); - if (error) - return "notifyMessages." + error; - } + if (message.refToken != null && message.hasOwnProperty("refToken")) + if (!$util.isString(message.refToken)) + return "refToken: string expected"; + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isString(message.version)) + return "version: string expected"; + if (message.webdPayload != null && message.hasOwnProperty("webdPayload")) { + var error = $root.proto.WebdPayload.verify(message.webdPayload); + if (error) + return "webdPayload." + error; } + if (message.webSubPlatform != null && message.hasOwnProperty("webSubPlatform")) + switch (message.webSubPlatform) { + default: + return "webSubPlatform: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } return null; }; /** - * Creates a WebNotificationsInfo message from a plain object. Also converts values to their respective internal types. + * Creates a WebInfo message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof proto.WebNotificationsInfo + * @memberof proto.WebInfo * @static * @param {Object.} object Plain object - * @returns {proto.WebNotificationsInfo} WebNotificationsInfo + * @returns {proto.WebInfo} WebInfo */ - WebNotificationsInfo.fromObject = function fromObject(object) { - if (object instanceof $root.proto.WebNotificationsInfo) + WebInfo.fromObject = function fromObject(object) { + if (object instanceof $root.proto.WebInfo) return object; - var message = new $root.proto.WebNotificationsInfo(); - if (object.timestamp != null) - if ($util.Long) - (message.timestamp = $util.Long.fromValue(object.timestamp)).unsigned = true; - else if (typeof object.timestamp === "string") - message.timestamp = parseInt(object.timestamp, 10); - else if (typeof object.timestamp === "number") - message.timestamp = object.timestamp; - else if (typeof object.timestamp === "object") - message.timestamp = new $util.LongBits(object.timestamp.low >>> 0, object.timestamp.high >>> 0).toNumber(true); - if (object.unreadChats != null) - message.unreadChats = object.unreadChats >>> 0; - if (object.notifyMessageCount != null) - message.notifyMessageCount = object.notifyMessageCount >>> 0; - if (object.notifyMessages) { - if (!Array.isArray(object.notifyMessages)) - throw TypeError(".proto.WebNotificationsInfo.notifyMessages: array expected"); - message.notifyMessages = []; - for (var i = 0; i < object.notifyMessages.length; ++i) { - if (typeof object.notifyMessages[i] !== "object") - throw TypeError(".proto.WebNotificationsInfo.notifyMessages: object expected"); - message.notifyMessages[i] = $root.proto.WebMessageInfo.fromObject(object.notifyMessages[i]); - } + var message = new $root.proto.WebInfo(); + if (object.refToken != null) + message.refToken = String(object.refToken); + if (object.version != null) + message.version = String(object.version); + if (object.webdPayload != null) { + if (typeof object.webdPayload !== "object") + throw TypeError(".proto.WebInfo.webdPayload: object expected"); + message.webdPayload = $root.proto.WebdPayload.fromObject(object.webdPayload); + } + switch (object.webSubPlatform) { + case "WEB_BROWSER": + case 0: + message.webSubPlatform = 0; + break; + case "APP_STORE": + case 1: + message.webSubPlatform = 1; + break; + case "WIN_STORE": + case 2: + message.webSubPlatform = 2; + break; + case "DARWIN": + case 3: + message.webSubPlatform = 3; + break; + case "WIN32": + case 4: + message.webSubPlatform = 4; + break; } return message; }; /** - * Creates a plain object from a WebNotificationsInfo message. Also converts values to other types if specified. + * Creates a plain object from a WebInfo message. Also converts values to other types if specified. * @function toObject - * @memberof proto.WebNotificationsInfo + * @memberof proto.WebInfo * @static - * @param {proto.WebNotificationsInfo} message WebNotificationsInfo + * @param {proto.WebInfo} message WebInfo * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - WebNotificationsInfo.toObject = function toObject(message, options) { + WebInfo.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.notifyMessages = []; if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.timestamp = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.timestamp = options.longs === String ? "0" : 0; - object.unreadChats = 0; - object.notifyMessageCount = 0; - } - if (message.timestamp != null && message.hasOwnProperty("timestamp")) - if (typeof message.timestamp === "number") - object.timestamp = options.longs === String ? String(message.timestamp) : message.timestamp; - else - object.timestamp = options.longs === String ? $util.Long.prototype.toString.call(message.timestamp) : options.longs === Number ? new $util.LongBits(message.timestamp.low >>> 0, message.timestamp.high >>> 0).toNumber(true) : message.timestamp; - if (message.unreadChats != null && message.hasOwnProperty("unreadChats")) - object.unreadChats = message.unreadChats; - if (message.notifyMessageCount != null && message.hasOwnProperty("notifyMessageCount")) - object.notifyMessageCount = message.notifyMessageCount; - if (message.notifyMessages && message.notifyMessages.length) { - object.notifyMessages = []; - for (var j = 0; j < message.notifyMessages.length; ++j) - object.notifyMessages[j] = $root.proto.WebMessageInfo.toObject(message.notifyMessages[j], options); + object.refToken = ""; + object.version = ""; + object.webdPayload = null; + object.webSubPlatform = options.enums === String ? "WEB_BROWSER" : 0; } + if (message.refToken != null && message.hasOwnProperty("refToken")) + object.refToken = message.refToken; + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + if (message.webdPayload != null && message.hasOwnProperty("webdPayload")) + object.webdPayload = $root.proto.WebdPayload.toObject(message.webdPayload, options); + if (message.webSubPlatform != null && message.hasOwnProperty("webSubPlatform")) + object.webSubPlatform = options.enums === String ? $root.proto.WebInfo.WebInfoWebSubPlatform[message.webSubPlatform] : message.webSubPlatform; return object; }; /** - * Converts this WebNotificationsInfo to JSON. + * Converts this WebInfo to JSON. * @function toJSON - * @memberof proto.WebNotificationsInfo + * @memberof proto.WebInfo * @instance * @returns {Object.} JSON object */ - WebNotificationsInfo.prototype.toJSON = function toJSON() { + WebInfo.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return WebNotificationsInfo; + /** + * WebInfoWebSubPlatform enum. + * @name proto.WebInfo.WebInfoWebSubPlatform + * @enum {number} + * @property {number} WEB_BROWSER=0 WEB_BROWSER value + * @property {number} APP_STORE=1 APP_STORE value + * @property {number} WIN_STORE=2 WIN_STORE value + * @property {number} DARWIN=3 DARWIN value + * @property {number} WIN32=4 WIN32 value + */ + WebInfo.WebInfoWebSubPlatform = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "WEB_BROWSER"] = 0; + values[valuesById[1] = "APP_STORE"] = 1; + values[valuesById[2] = "WIN_STORE"] = 2; + values[valuesById[3] = "DARWIN"] = 3; + values[valuesById[4] = "WIN32"] = 4; + return values; + })(); + + return WebInfo; })(); - proto.PaymentInfo = (function() { + proto.MediaData = (function() { /** - * Properties of a PaymentInfo. + * Properties of a MediaData. * @memberof proto - * @interface IPaymentInfo - * @property {proto.PaymentInfo.PaymentInfoCurrency|null} [currencyDeprecated] PaymentInfo currencyDeprecated - * @property {number|Long|null} [amount1000] PaymentInfo amount1000 - * @property {string|null} [receiverJid] PaymentInfo receiverJid - * @property {proto.PaymentInfo.PaymentInfoStatus|null} [status] PaymentInfo status - * @property {number|Long|null} [transactionTimestamp] PaymentInfo transactionTimestamp - * @property {proto.IMessageKey|null} [requestMessageKey] PaymentInfo requestMessageKey - * @property {number|Long|null} [expiryTimestamp] PaymentInfo expiryTimestamp - * @property {boolean|null} [futureproofed] PaymentInfo futureproofed - * @property {string|null} [currency] PaymentInfo currency - * @property {proto.PaymentInfo.PaymentInfoTxnStatus|null} [txnStatus] PaymentInfo txnStatus - * @property {boolean|null} [useNoviFiatFormat] PaymentInfo useNoviFiatFormat - * @property {proto.IMoney|null} [primaryAmount] PaymentInfo primaryAmount - * @property {proto.IMoney|null} [exchangeAmount] PaymentInfo exchangeAmount + * @interface IMediaData + * @property {string|null} [localPath] MediaData localPath */ /** - * Constructs a new PaymentInfo. + * Constructs a new MediaData. * @memberof proto - * @classdesc Represents a PaymentInfo. - * @implements IPaymentInfo + * @classdesc Represents a MediaData. + * @implements IMediaData * @constructor - * @param {proto.IPaymentInfo=} [properties] Properties to set + * @param {proto.IMediaData=} [properties] Properties to set */ - function PaymentInfo(properties) { + function MediaData(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -56720,816 +55016,5052 @@ $root.proto = (function() { } /** - * PaymentInfo currencyDeprecated. - * @member {proto.PaymentInfo.PaymentInfoCurrency} currencyDeprecated - * @memberof proto.PaymentInfo - * @instance - */ - PaymentInfo.prototype.currencyDeprecated = 0; - - /** - * PaymentInfo amount1000. - * @member {number|Long} amount1000 - * @memberof proto.PaymentInfo - * @instance - */ - PaymentInfo.prototype.amount1000 = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * PaymentInfo receiverJid. - * @member {string} receiverJid - * @memberof proto.PaymentInfo - * @instance - */ - PaymentInfo.prototype.receiverJid = ""; - - /** - * PaymentInfo status. - * @member {proto.PaymentInfo.PaymentInfoStatus} status - * @memberof proto.PaymentInfo - * @instance - */ - PaymentInfo.prototype.status = 0; - - /** - * PaymentInfo transactionTimestamp. - * @member {number|Long} transactionTimestamp - * @memberof proto.PaymentInfo - * @instance - */ - PaymentInfo.prototype.transactionTimestamp = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * PaymentInfo requestMessageKey. - * @member {proto.IMessageKey|null|undefined} requestMessageKey - * @memberof proto.PaymentInfo - * @instance - */ - PaymentInfo.prototype.requestMessageKey = null; - - /** - * PaymentInfo expiryTimestamp. - * @member {number|Long} expiryTimestamp - * @memberof proto.PaymentInfo - * @instance - */ - PaymentInfo.prototype.expiryTimestamp = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * PaymentInfo futureproofed. - * @member {boolean} futureproofed - * @memberof proto.PaymentInfo - * @instance - */ - PaymentInfo.prototype.futureproofed = false; - - /** - * PaymentInfo currency. - * @member {string} currency - * @memberof proto.PaymentInfo - * @instance - */ - PaymentInfo.prototype.currency = ""; - - /** - * PaymentInfo txnStatus. - * @member {proto.PaymentInfo.PaymentInfoTxnStatus} txnStatus - * @memberof proto.PaymentInfo - * @instance - */ - PaymentInfo.prototype.txnStatus = 0; - - /** - * PaymentInfo useNoviFiatFormat. - * @member {boolean} useNoviFiatFormat - * @memberof proto.PaymentInfo - * @instance - */ - PaymentInfo.prototype.useNoviFiatFormat = false; - - /** - * PaymentInfo primaryAmount. - * @member {proto.IMoney|null|undefined} primaryAmount - * @memberof proto.PaymentInfo - * @instance - */ - PaymentInfo.prototype.primaryAmount = null; - - /** - * PaymentInfo exchangeAmount. - * @member {proto.IMoney|null|undefined} exchangeAmount - * @memberof proto.PaymentInfo + * MediaData localPath. + * @member {string} localPath + * @memberof proto.MediaData * @instance */ - PaymentInfo.prototype.exchangeAmount = null; + MediaData.prototype.localPath = ""; /** - * Creates a new PaymentInfo instance using the specified properties. + * Creates a new MediaData instance using the specified properties. * @function create - * @memberof proto.PaymentInfo + * @memberof proto.MediaData * @static - * @param {proto.IPaymentInfo=} [properties] Properties to set - * @returns {proto.PaymentInfo} PaymentInfo instance + * @param {proto.IMediaData=} [properties] Properties to set + * @returns {proto.MediaData} MediaData instance */ - PaymentInfo.create = function create(properties) { - return new PaymentInfo(properties); + MediaData.create = function create(properties) { + return new MediaData(properties); }; /** - * Encodes the specified PaymentInfo message. Does not implicitly {@link proto.PaymentInfo.verify|verify} messages. + * Encodes the specified MediaData message. Does not implicitly {@link proto.MediaData.verify|verify} messages. * @function encode - * @memberof proto.PaymentInfo + * @memberof proto.MediaData * @static - * @param {proto.IPaymentInfo} message PaymentInfo message or plain object to encode + * @param {proto.IMediaData} message MediaData message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PaymentInfo.encode = function encode(message, writer) { + MediaData.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.currencyDeprecated != null && Object.hasOwnProperty.call(message, "currencyDeprecated")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.currencyDeprecated); - if (message.amount1000 != null && Object.hasOwnProperty.call(message, "amount1000")) - writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.amount1000); - if (message.receiverJid != null && Object.hasOwnProperty.call(message, "receiverJid")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.receiverJid); - if (message.status != null && Object.hasOwnProperty.call(message, "status")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.status); - if (message.transactionTimestamp != null && Object.hasOwnProperty.call(message, "transactionTimestamp")) - writer.uint32(/* id 5, wireType 0 =*/40).uint64(message.transactionTimestamp); - if (message.requestMessageKey != null && Object.hasOwnProperty.call(message, "requestMessageKey")) - $root.proto.MessageKey.encode(message.requestMessageKey, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.expiryTimestamp != null && Object.hasOwnProperty.call(message, "expiryTimestamp")) - writer.uint32(/* id 7, wireType 0 =*/56).uint64(message.expiryTimestamp); - if (message.futureproofed != null && Object.hasOwnProperty.call(message, "futureproofed")) - writer.uint32(/* id 8, wireType 0 =*/64).bool(message.futureproofed); - if (message.currency != null && Object.hasOwnProperty.call(message, "currency")) - writer.uint32(/* id 9, wireType 2 =*/74).string(message.currency); - if (message.txnStatus != null && Object.hasOwnProperty.call(message, "txnStatus")) - writer.uint32(/* id 10, wireType 0 =*/80).int32(message.txnStatus); - if (message.useNoviFiatFormat != null && Object.hasOwnProperty.call(message, "useNoviFiatFormat")) - writer.uint32(/* id 11, wireType 0 =*/88).bool(message.useNoviFiatFormat); - if (message.primaryAmount != null && Object.hasOwnProperty.call(message, "primaryAmount")) - $root.proto.Money.encode(message.primaryAmount, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); - if (message.exchangeAmount != null && Object.hasOwnProperty.call(message, "exchangeAmount")) - $root.proto.Money.encode(message.exchangeAmount, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + if (message.localPath != null && Object.hasOwnProperty.call(message, "localPath")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.localPath); return writer; }; /** - * Encodes the specified PaymentInfo message, length delimited. Does not implicitly {@link proto.PaymentInfo.verify|verify} messages. + * Encodes the specified MediaData message, length delimited. Does not implicitly {@link proto.MediaData.verify|verify} messages. * @function encodeDelimited - * @memberof proto.PaymentInfo + * @memberof proto.MediaData * @static - * @param {proto.IPaymentInfo} message PaymentInfo message or plain object to encode + * @param {proto.IMediaData} message MediaData message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PaymentInfo.encodeDelimited = function encodeDelimited(message, writer) { + MediaData.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a PaymentInfo message from the specified reader or buffer. + * Decodes a MediaData message from the specified reader or buffer. * @function decode - * @memberof proto.PaymentInfo + * @memberof proto.MediaData * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {proto.PaymentInfo} PaymentInfo + * @returns {proto.MediaData} MediaData * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - PaymentInfo.decode = function decode(reader, length) { + MediaData.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.PaymentInfo(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.MediaData(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.currencyDeprecated = reader.int32(); - break; + message.localPath = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MediaData message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof proto.MediaData + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {proto.MediaData} MediaData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MediaData.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MediaData message. + * @function verify + * @memberof proto.MediaData + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MediaData.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.localPath != null && message.hasOwnProperty("localPath")) + if (!$util.isString(message.localPath)) + return "localPath: string expected"; + return null; + }; + + /** + * Creates a MediaData message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof proto.MediaData + * @static + * @param {Object.} object Plain object + * @returns {proto.MediaData} MediaData + */ + MediaData.fromObject = function fromObject(object) { + if (object instanceof $root.proto.MediaData) + return object; + var message = new $root.proto.MediaData(); + if (object.localPath != null) + message.localPath = String(object.localPath); + return message; + }; + + /** + * Creates a plain object from a MediaData message. Also converts values to other types if specified. + * @function toObject + * @memberof proto.MediaData + * @static + * @param {proto.MediaData} message MediaData + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MediaData.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.localPath = ""; + if (message.localPath != null && message.hasOwnProperty("localPath")) + object.localPath = message.localPath; + return object; + }; + + /** + * Converts this MediaData to JSON. + * @function toJSON + * @memberof proto.MediaData + * @instance + * @returns {Object.} JSON object + */ + MediaData.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MediaData; + })(); + + proto.NotificationMessageInfo = (function() { + + /** + * Properties of a NotificationMessageInfo. + * @memberof proto + * @interface INotificationMessageInfo + * @property {proto.IMessageKey|null} [key] NotificationMessageInfo key + * @property {proto.IMessage|null} [message] NotificationMessageInfo message + * @property {number|Long|null} [messageTimestamp] NotificationMessageInfo messageTimestamp + * @property {string|null} [participant] NotificationMessageInfo participant + */ + + /** + * Constructs a new NotificationMessageInfo. + * @memberof proto + * @classdesc Represents a NotificationMessageInfo. + * @implements INotificationMessageInfo + * @constructor + * @param {proto.INotificationMessageInfo=} [properties] Properties to set + */ + function NotificationMessageInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NotificationMessageInfo key. + * @member {proto.IMessageKey|null|undefined} key + * @memberof proto.NotificationMessageInfo + * @instance + */ + NotificationMessageInfo.prototype.key = null; + + /** + * NotificationMessageInfo message. + * @member {proto.IMessage|null|undefined} message + * @memberof proto.NotificationMessageInfo + * @instance + */ + NotificationMessageInfo.prototype.message = null; + + /** + * NotificationMessageInfo messageTimestamp. + * @member {number|Long} messageTimestamp + * @memberof proto.NotificationMessageInfo + * @instance + */ + NotificationMessageInfo.prototype.messageTimestamp = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * NotificationMessageInfo participant. + * @member {string} participant + * @memberof proto.NotificationMessageInfo + * @instance + */ + NotificationMessageInfo.prototype.participant = ""; + + /** + * Creates a new NotificationMessageInfo instance using the specified properties. + * @function create + * @memberof proto.NotificationMessageInfo + * @static + * @param {proto.INotificationMessageInfo=} [properties] Properties to set + * @returns {proto.NotificationMessageInfo} NotificationMessageInfo instance + */ + NotificationMessageInfo.create = function create(properties) { + return new NotificationMessageInfo(properties); + }; + + /** + * Encodes the specified NotificationMessageInfo message. Does not implicitly {@link proto.NotificationMessageInfo.verify|verify} messages. + * @function encode + * @memberof proto.NotificationMessageInfo + * @static + * @param {proto.INotificationMessageInfo} message NotificationMessageInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NotificationMessageInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.key != null && Object.hasOwnProperty.call(message, "key")) + $root.proto.MessageKey.encode(message.key, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.message != null && Object.hasOwnProperty.call(message, "message")) + $root.proto.Message.encode(message.message, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.messageTimestamp != null && Object.hasOwnProperty.call(message, "messageTimestamp")) + writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.messageTimestamp); + if (message.participant != null && Object.hasOwnProperty.call(message, "participant")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.participant); + return writer; + }; + + /** + * Encodes the specified NotificationMessageInfo message, length delimited. Does not implicitly {@link proto.NotificationMessageInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof proto.NotificationMessageInfo + * @static + * @param {proto.INotificationMessageInfo} message NotificationMessageInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NotificationMessageInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NotificationMessageInfo message from the specified reader or buffer. + * @function decode + * @memberof proto.NotificationMessageInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {proto.NotificationMessageInfo} NotificationMessageInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NotificationMessageInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.NotificationMessageInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = $root.proto.MessageKey.decode(reader, reader.uint32()); + break; + case 2: + message.message = $root.proto.Message.decode(reader, reader.uint32()); + break; + case 3: + message.messageTimestamp = reader.uint64(); + break; + case 4: + message.participant = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NotificationMessageInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof proto.NotificationMessageInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {proto.NotificationMessageInfo} NotificationMessageInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NotificationMessageInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NotificationMessageInfo message. + * @function verify + * @memberof proto.NotificationMessageInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NotificationMessageInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.key != null && message.hasOwnProperty("key")) { + var error = $root.proto.MessageKey.verify(message.key); + if (error) + return "key." + error; + } + if (message.message != null && message.hasOwnProperty("message")) { + var error = $root.proto.Message.verify(message.message); + if (error) + return "message." + error; + } + if (message.messageTimestamp != null && message.hasOwnProperty("messageTimestamp")) + if (!$util.isInteger(message.messageTimestamp) && !(message.messageTimestamp && $util.isInteger(message.messageTimestamp.low) && $util.isInteger(message.messageTimestamp.high))) + return "messageTimestamp: integer|Long expected"; + if (message.participant != null && message.hasOwnProperty("participant")) + if (!$util.isString(message.participant)) + return "participant: string expected"; + return null; + }; + + /** + * Creates a NotificationMessageInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof proto.NotificationMessageInfo + * @static + * @param {Object.} object Plain object + * @returns {proto.NotificationMessageInfo} NotificationMessageInfo + */ + NotificationMessageInfo.fromObject = function fromObject(object) { + if (object instanceof $root.proto.NotificationMessageInfo) + return object; + var message = new $root.proto.NotificationMessageInfo(); + if (object.key != null) { + if (typeof object.key !== "object") + throw TypeError(".proto.NotificationMessageInfo.key: object expected"); + message.key = $root.proto.MessageKey.fromObject(object.key); + } + if (object.message != null) { + if (typeof object.message !== "object") + throw TypeError(".proto.NotificationMessageInfo.message: object expected"); + message.message = $root.proto.Message.fromObject(object.message); + } + if (object.messageTimestamp != null) + if ($util.Long) + (message.messageTimestamp = $util.Long.fromValue(object.messageTimestamp)).unsigned = true; + else if (typeof object.messageTimestamp === "string") + message.messageTimestamp = parseInt(object.messageTimestamp, 10); + else if (typeof object.messageTimestamp === "number") + message.messageTimestamp = object.messageTimestamp; + else if (typeof object.messageTimestamp === "object") + message.messageTimestamp = new $util.LongBits(object.messageTimestamp.low >>> 0, object.messageTimestamp.high >>> 0).toNumber(true); + if (object.participant != null) + message.participant = String(object.participant); + return message; + }; + + /** + * Creates a plain object from a NotificationMessageInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof proto.NotificationMessageInfo + * @static + * @param {proto.NotificationMessageInfo} message NotificationMessageInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NotificationMessageInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.key = null; + object.message = null; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.messageTimestamp = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.messageTimestamp = options.longs === String ? "0" : 0; + object.participant = ""; + } + if (message.key != null && message.hasOwnProperty("key")) + object.key = $root.proto.MessageKey.toObject(message.key, options); + if (message.message != null && message.hasOwnProperty("message")) + object.message = $root.proto.Message.toObject(message.message, options); + if (message.messageTimestamp != null && message.hasOwnProperty("messageTimestamp")) + if (typeof message.messageTimestamp === "number") + object.messageTimestamp = options.longs === String ? String(message.messageTimestamp) : message.messageTimestamp; + else + object.messageTimestamp = options.longs === String ? $util.Long.prototype.toString.call(message.messageTimestamp) : options.longs === Number ? new $util.LongBits(message.messageTimestamp.low >>> 0, message.messageTimestamp.high >>> 0).toNumber(true) : message.messageTimestamp; + if (message.participant != null && message.hasOwnProperty("participant")) + object.participant = message.participant; + return object; + }; + + /** + * Converts this NotificationMessageInfo to JSON. + * @function toJSON + * @memberof proto.NotificationMessageInfo + * @instance + * @returns {Object.} JSON object + */ + NotificationMessageInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return NotificationMessageInfo; + })(); + + proto.PaymentInfo = (function() { + + /** + * Properties of a PaymentInfo. + * @memberof proto + * @interface IPaymentInfo + * @property {proto.PaymentInfo.PaymentInfoCurrency|null} [currencyDeprecated] PaymentInfo currencyDeprecated + * @property {number|Long|null} [amount1000] PaymentInfo amount1000 + * @property {string|null} [receiverJid] PaymentInfo receiverJid + * @property {proto.PaymentInfo.PaymentInfoStatus|null} [status] PaymentInfo status + * @property {number|Long|null} [transactionTimestamp] PaymentInfo transactionTimestamp + * @property {proto.IMessageKey|null} [requestMessageKey] PaymentInfo requestMessageKey + * @property {number|Long|null} [expiryTimestamp] PaymentInfo expiryTimestamp + * @property {boolean|null} [futureproofed] PaymentInfo futureproofed + * @property {string|null} [currency] PaymentInfo currency + * @property {proto.PaymentInfo.PaymentInfoTxnStatus|null} [txnStatus] PaymentInfo txnStatus + * @property {boolean|null} [useNoviFiatFormat] PaymentInfo useNoviFiatFormat + * @property {proto.IMoney|null} [primaryAmount] PaymentInfo primaryAmount + * @property {proto.IMoney|null} [exchangeAmount] PaymentInfo exchangeAmount + */ + + /** + * Constructs a new PaymentInfo. + * @memberof proto + * @classdesc Represents a PaymentInfo. + * @implements IPaymentInfo + * @constructor + * @param {proto.IPaymentInfo=} [properties] Properties to set + */ + function PaymentInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PaymentInfo currencyDeprecated. + * @member {proto.PaymentInfo.PaymentInfoCurrency} currencyDeprecated + * @memberof proto.PaymentInfo + * @instance + */ + PaymentInfo.prototype.currencyDeprecated = 0; + + /** + * PaymentInfo amount1000. + * @member {number|Long} amount1000 + * @memberof proto.PaymentInfo + * @instance + */ + PaymentInfo.prototype.amount1000 = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * PaymentInfo receiverJid. + * @member {string} receiverJid + * @memberof proto.PaymentInfo + * @instance + */ + PaymentInfo.prototype.receiverJid = ""; + + /** + * PaymentInfo status. + * @member {proto.PaymentInfo.PaymentInfoStatus} status + * @memberof proto.PaymentInfo + * @instance + */ + PaymentInfo.prototype.status = 0; + + /** + * PaymentInfo transactionTimestamp. + * @member {number|Long} transactionTimestamp + * @memberof proto.PaymentInfo + * @instance + */ + PaymentInfo.prototype.transactionTimestamp = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * PaymentInfo requestMessageKey. + * @member {proto.IMessageKey|null|undefined} requestMessageKey + * @memberof proto.PaymentInfo + * @instance + */ + PaymentInfo.prototype.requestMessageKey = null; + + /** + * PaymentInfo expiryTimestamp. + * @member {number|Long} expiryTimestamp + * @memberof proto.PaymentInfo + * @instance + */ + PaymentInfo.prototype.expiryTimestamp = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * PaymentInfo futureproofed. + * @member {boolean} futureproofed + * @memberof proto.PaymentInfo + * @instance + */ + PaymentInfo.prototype.futureproofed = false; + + /** + * PaymentInfo currency. + * @member {string} currency + * @memberof proto.PaymentInfo + * @instance + */ + PaymentInfo.prototype.currency = ""; + + /** + * PaymentInfo txnStatus. + * @member {proto.PaymentInfo.PaymentInfoTxnStatus} txnStatus + * @memberof proto.PaymentInfo + * @instance + */ + PaymentInfo.prototype.txnStatus = 0; + + /** + * PaymentInfo useNoviFiatFormat. + * @member {boolean} useNoviFiatFormat + * @memberof proto.PaymentInfo + * @instance + */ + PaymentInfo.prototype.useNoviFiatFormat = false; + + /** + * PaymentInfo primaryAmount. + * @member {proto.IMoney|null|undefined} primaryAmount + * @memberof proto.PaymentInfo + * @instance + */ + PaymentInfo.prototype.primaryAmount = null; + + /** + * PaymentInfo exchangeAmount. + * @member {proto.IMoney|null|undefined} exchangeAmount + * @memberof proto.PaymentInfo + * @instance + */ + PaymentInfo.prototype.exchangeAmount = null; + + /** + * Creates a new PaymentInfo instance using the specified properties. + * @function create + * @memberof proto.PaymentInfo + * @static + * @param {proto.IPaymentInfo=} [properties] Properties to set + * @returns {proto.PaymentInfo} PaymentInfo instance + */ + PaymentInfo.create = function create(properties) { + return new PaymentInfo(properties); + }; + + /** + * Encodes the specified PaymentInfo message. Does not implicitly {@link proto.PaymentInfo.verify|verify} messages. + * @function encode + * @memberof proto.PaymentInfo + * @static + * @param {proto.IPaymentInfo} message PaymentInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PaymentInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.currencyDeprecated != null && Object.hasOwnProperty.call(message, "currencyDeprecated")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.currencyDeprecated); + if (message.amount1000 != null && Object.hasOwnProperty.call(message, "amount1000")) + writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.amount1000); + if (message.receiverJid != null && Object.hasOwnProperty.call(message, "receiverJid")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.receiverJid); + if (message.status != null && Object.hasOwnProperty.call(message, "status")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.status); + if (message.transactionTimestamp != null && Object.hasOwnProperty.call(message, "transactionTimestamp")) + writer.uint32(/* id 5, wireType 0 =*/40).uint64(message.transactionTimestamp); + if (message.requestMessageKey != null && Object.hasOwnProperty.call(message, "requestMessageKey")) + $root.proto.MessageKey.encode(message.requestMessageKey, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.expiryTimestamp != null && Object.hasOwnProperty.call(message, "expiryTimestamp")) + writer.uint32(/* id 7, wireType 0 =*/56).uint64(message.expiryTimestamp); + if (message.futureproofed != null && Object.hasOwnProperty.call(message, "futureproofed")) + writer.uint32(/* id 8, wireType 0 =*/64).bool(message.futureproofed); + if (message.currency != null && Object.hasOwnProperty.call(message, "currency")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.currency); + if (message.txnStatus != null && Object.hasOwnProperty.call(message, "txnStatus")) + writer.uint32(/* id 10, wireType 0 =*/80).int32(message.txnStatus); + if (message.useNoviFiatFormat != null && Object.hasOwnProperty.call(message, "useNoviFiatFormat")) + writer.uint32(/* id 11, wireType 0 =*/88).bool(message.useNoviFiatFormat); + if (message.primaryAmount != null && Object.hasOwnProperty.call(message, "primaryAmount")) + $root.proto.Money.encode(message.primaryAmount, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.exchangeAmount != null && Object.hasOwnProperty.call(message, "exchangeAmount")) + $root.proto.Money.encode(message.exchangeAmount, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PaymentInfo message, length delimited. Does not implicitly {@link proto.PaymentInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof proto.PaymentInfo + * @static + * @param {proto.IPaymentInfo} message PaymentInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PaymentInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PaymentInfo message from the specified reader or buffer. + * @function decode + * @memberof proto.PaymentInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {proto.PaymentInfo} PaymentInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PaymentInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.PaymentInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.currencyDeprecated = reader.int32(); + break; + case 2: + message.amount1000 = reader.uint64(); + break; + case 3: + message.receiverJid = reader.string(); + break; + case 4: + message.status = reader.int32(); + break; + case 5: + message.transactionTimestamp = reader.uint64(); + break; + case 6: + message.requestMessageKey = $root.proto.MessageKey.decode(reader, reader.uint32()); + break; + case 7: + message.expiryTimestamp = reader.uint64(); + break; + case 8: + message.futureproofed = reader.bool(); + break; + case 9: + message.currency = reader.string(); + break; + case 10: + message.txnStatus = reader.int32(); + break; + case 11: + message.useNoviFiatFormat = reader.bool(); + break; + case 12: + message.primaryAmount = $root.proto.Money.decode(reader, reader.uint32()); + break; + case 13: + message.exchangeAmount = $root.proto.Money.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PaymentInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof proto.PaymentInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {proto.PaymentInfo} PaymentInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PaymentInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PaymentInfo message. + * @function verify + * @memberof proto.PaymentInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PaymentInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.currencyDeprecated != null && message.hasOwnProperty("currencyDeprecated")) + switch (message.currencyDeprecated) { + default: + return "currencyDeprecated: enum value expected"; + case 0: + case 1: + break; + } + if (message.amount1000 != null && message.hasOwnProperty("amount1000")) + if (!$util.isInteger(message.amount1000) && !(message.amount1000 && $util.isInteger(message.amount1000.low) && $util.isInteger(message.amount1000.high))) + return "amount1000: integer|Long expected"; + if (message.receiverJid != null && message.hasOwnProperty("receiverJid")) + if (!$util.isString(message.receiverJid)) + return "receiverJid: string expected"; + if (message.status != null && message.hasOwnProperty("status")) + switch (message.status) { + default: + return "status: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + break; + } + if (message.transactionTimestamp != null && message.hasOwnProperty("transactionTimestamp")) + if (!$util.isInteger(message.transactionTimestamp) && !(message.transactionTimestamp && $util.isInteger(message.transactionTimestamp.low) && $util.isInteger(message.transactionTimestamp.high))) + return "transactionTimestamp: integer|Long expected"; + if (message.requestMessageKey != null && message.hasOwnProperty("requestMessageKey")) { + var error = $root.proto.MessageKey.verify(message.requestMessageKey); + if (error) + return "requestMessageKey." + error; + } + if (message.expiryTimestamp != null && message.hasOwnProperty("expiryTimestamp")) + if (!$util.isInteger(message.expiryTimestamp) && !(message.expiryTimestamp && $util.isInteger(message.expiryTimestamp.low) && $util.isInteger(message.expiryTimestamp.high))) + return "expiryTimestamp: integer|Long expected"; + if (message.futureproofed != null && message.hasOwnProperty("futureproofed")) + if (typeof message.futureproofed !== "boolean") + return "futureproofed: boolean expected"; + if (message.currency != null && message.hasOwnProperty("currency")) + if (!$util.isString(message.currency)) + return "currency: string expected"; + if (message.txnStatus != null && message.hasOwnProperty("txnStatus")) + switch (message.txnStatus) { + default: + return "txnStatus: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + case 14: + case 15: + case 16: + case 17: + case 18: + case 19: + case 20: + case 21: + case 22: + case 23: + case 24: + case 25: + case 26: + case 27: + case 28: + break; + } + if (message.useNoviFiatFormat != null && message.hasOwnProperty("useNoviFiatFormat")) + if (typeof message.useNoviFiatFormat !== "boolean") + return "useNoviFiatFormat: boolean expected"; + if (message.primaryAmount != null && message.hasOwnProperty("primaryAmount")) { + var error = $root.proto.Money.verify(message.primaryAmount); + if (error) + return "primaryAmount." + error; + } + if (message.exchangeAmount != null && message.hasOwnProperty("exchangeAmount")) { + var error = $root.proto.Money.verify(message.exchangeAmount); + if (error) + return "exchangeAmount." + error; + } + return null; + }; + + /** + * Creates a PaymentInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof proto.PaymentInfo + * @static + * @param {Object.} object Plain object + * @returns {proto.PaymentInfo} PaymentInfo + */ + PaymentInfo.fromObject = function fromObject(object) { + if (object instanceof $root.proto.PaymentInfo) + return object; + var message = new $root.proto.PaymentInfo(); + switch (object.currencyDeprecated) { + case "UNKNOWN_CURRENCY": + case 0: + message.currencyDeprecated = 0; + break; + case "INR": + case 1: + message.currencyDeprecated = 1; + break; + } + if (object.amount1000 != null) + if ($util.Long) + (message.amount1000 = $util.Long.fromValue(object.amount1000)).unsigned = true; + else if (typeof object.amount1000 === "string") + message.amount1000 = parseInt(object.amount1000, 10); + else if (typeof object.amount1000 === "number") + message.amount1000 = object.amount1000; + else if (typeof object.amount1000 === "object") + message.amount1000 = new $util.LongBits(object.amount1000.low >>> 0, object.amount1000.high >>> 0).toNumber(true); + if (object.receiverJid != null) + message.receiverJid = String(object.receiverJid); + switch (object.status) { + case "UNKNOWN_STATUS": + case 0: + message.status = 0; + break; + case "PROCESSING": + case 1: + message.status = 1; + break; + case "SENT": + case 2: + message.status = 2; + break; + case "NEED_TO_ACCEPT": + case 3: + message.status = 3; + break; + case "COMPLETE": + case 4: + message.status = 4; + break; + case "COULD_NOT_COMPLETE": + case 5: + message.status = 5; + break; + case "REFUNDED": + case 6: + message.status = 6; + break; + case "EXPIRED": + case 7: + message.status = 7; + break; + case "REJECTED": + case 8: + message.status = 8; + break; + case "CANCELLED": + case 9: + message.status = 9; + break; + case "WAITING_FOR_PAYER": + case 10: + message.status = 10; + break; + case "WAITING": + case 11: + message.status = 11; + break; + } + if (object.transactionTimestamp != null) + if ($util.Long) + (message.transactionTimestamp = $util.Long.fromValue(object.transactionTimestamp)).unsigned = true; + else if (typeof object.transactionTimestamp === "string") + message.transactionTimestamp = parseInt(object.transactionTimestamp, 10); + else if (typeof object.transactionTimestamp === "number") + message.transactionTimestamp = object.transactionTimestamp; + else if (typeof object.transactionTimestamp === "object") + message.transactionTimestamp = new $util.LongBits(object.transactionTimestamp.low >>> 0, object.transactionTimestamp.high >>> 0).toNumber(true); + if (object.requestMessageKey != null) { + if (typeof object.requestMessageKey !== "object") + throw TypeError(".proto.PaymentInfo.requestMessageKey: object expected"); + message.requestMessageKey = $root.proto.MessageKey.fromObject(object.requestMessageKey); + } + if (object.expiryTimestamp != null) + if ($util.Long) + (message.expiryTimestamp = $util.Long.fromValue(object.expiryTimestamp)).unsigned = true; + else if (typeof object.expiryTimestamp === "string") + message.expiryTimestamp = parseInt(object.expiryTimestamp, 10); + else if (typeof object.expiryTimestamp === "number") + message.expiryTimestamp = object.expiryTimestamp; + else if (typeof object.expiryTimestamp === "object") + message.expiryTimestamp = new $util.LongBits(object.expiryTimestamp.low >>> 0, object.expiryTimestamp.high >>> 0).toNumber(true); + if (object.futureproofed != null) + message.futureproofed = Boolean(object.futureproofed); + if (object.currency != null) + message.currency = String(object.currency); + switch (object.txnStatus) { + case "UNKNOWN": + case 0: + message.txnStatus = 0; + break; + case "PENDING_SETUP": + case 1: + message.txnStatus = 1; + break; + case "PENDING_RECEIVER_SETUP": + case 2: + message.txnStatus = 2; + break; + case "INIT": + case 3: + message.txnStatus = 3; + break; + case "SUCCESS": + case 4: + message.txnStatus = 4; + break; + case "COMPLETED": + case 5: + message.txnStatus = 5; + break; + case "FAILED": + case 6: + message.txnStatus = 6; + break; + case "FAILED_RISK": + case 7: + message.txnStatus = 7; + break; + case "FAILED_PROCESSING": + case 8: + message.txnStatus = 8; + break; + case "FAILED_RECEIVER_PROCESSING": + case 9: + message.txnStatus = 9; + break; + case "FAILED_DA": + case 10: + message.txnStatus = 10; + break; + case "FAILED_DA_FINAL": + case 11: + message.txnStatus = 11; + break; + case "REFUNDED_TXN": + case 12: + message.txnStatus = 12; + break; + case "REFUND_FAILED": + case 13: + message.txnStatus = 13; + break; + case "REFUND_FAILED_PROCESSING": + case 14: + message.txnStatus = 14; + break; + case "REFUND_FAILED_DA": + case 15: + message.txnStatus = 15; + break; + case "EXPIRED_TXN": + case 16: + message.txnStatus = 16; + break; + case "AUTH_CANCELED": + case 17: + message.txnStatus = 17; + break; + case "AUTH_CANCEL_FAILED_PROCESSING": + case 18: + message.txnStatus = 18; + break; + case "AUTH_CANCEL_FAILED": + case 19: + message.txnStatus = 19; + break; + case "COLLECT_INIT": + case 20: + message.txnStatus = 20; + break; + case "COLLECT_SUCCESS": + case 21: + message.txnStatus = 21; + break; + case "COLLECT_FAILED": + case 22: + message.txnStatus = 22; + break; + case "COLLECT_FAILED_RISK": + case 23: + message.txnStatus = 23; + break; + case "COLLECT_REJECTED": + case 24: + message.txnStatus = 24; + break; + case "COLLECT_EXPIRED": + case 25: + message.txnStatus = 25; + break; + case "COLLECT_CANCELED": + case 26: + message.txnStatus = 26; + break; + case "COLLECT_CANCELLING": + case 27: + message.txnStatus = 27; + break; + case "IN_REVIEW": + case 28: + message.txnStatus = 28; + break; + } + if (object.useNoviFiatFormat != null) + message.useNoviFiatFormat = Boolean(object.useNoviFiatFormat); + if (object.primaryAmount != null) { + if (typeof object.primaryAmount !== "object") + throw TypeError(".proto.PaymentInfo.primaryAmount: object expected"); + message.primaryAmount = $root.proto.Money.fromObject(object.primaryAmount); + } + if (object.exchangeAmount != null) { + if (typeof object.exchangeAmount !== "object") + throw TypeError(".proto.PaymentInfo.exchangeAmount: object expected"); + message.exchangeAmount = $root.proto.Money.fromObject(object.exchangeAmount); + } + return message; + }; + + /** + * Creates a plain object from a PaymentInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof proto.PaymentInfo + * @static + * @param {proto.PaymentInfo} message PaymentInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PaymentInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.currencyDeprecated = options.enums === String ? "UNKNOWN_CURRENCY" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.amount1000 = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.amount1000 = options.longs === String ? "0" : 0; + object.receiverJid = ""; + object.status = options.enums === String ? "UNKNOWN_STATUS" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.transactionTimestamp = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.transactionTimestamp = options.longs === String ? "0" : 0; + object.requestMessageKey = null; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.expiryTimestamp = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.expiryTimestamp = options.longs === String ? "0" : 0; + object.futureproofed = false; + object.currency = ""; + object.txnStatus = options.enums === String ? "UNKNOWN" : 0; + object.useNoviFiatFormat = false; + object.primaryAmount = null; + object.exchangeAmount = null; + } + if (message.currencyDeprecated != null && message.hasOwnProperty("currencyDeprecated")) + object.currencyDeprecated = options.enums === String ? $root.proto.PaymentInfo.PaymentInfoCurrency[message.currencyDeprecated] : message.currencyDeprecated; + if (message.amount1000 != null && message.hasOwnProperty("amount1000")) + if (typeof message.amount1000 === "number") + object.amount1000 = options.longs === String ? String(message.amount1000) : message.amount1000; + else + object.amount1000 = options.longs === String ? $util.Long.prototype.toString.call(message.amount1000) : options.longs === Number ? new $util.LongBits(message.amount1000.low >>> 0, message.amount1000.high >>> 0).toNumber(true) : message.amount1000; + if (message.receiverJid != null && message.hasOwnProperty("receiverJid")) + object.receiverJid = message.receiverJid; + if (message.status != null && message.hasOwnProperty("status")) + object.status = options.enums === String ? $root.proto.PaymentInfo.PaymentInfoStatus[message.status] : message.status; + if (message.transactionTimestamp != null && message.hasOwnProperty("transactionTimestamp")) + if (typeof message.transactionTimestamp === "number") + object.transactionTimestamp = options.longs === String ? String(message.transactionTimestamp) : message.transactionTimestamp; + else + object.transactionTimestamp = options.longs === String ? $util.Long.prototype.toString.call(message.transactionTimestamp) : options.longs === Number ? new $util.LongBits(message.transactionTimestamp.low >>> 0, message.transactionTimestamp.high >>> 0).toNumber(true) : message.transactionTimestamp; + if (message.requestMessageKey != null && message.hasOwnProperty("requestMessageKey")) + object.requestMessageKey = $root.proto.MessageKey.toObject(message.requestMessageKey, options); + if (message.expiryTimestamp != null && message.hasOwnProperty("expiryTimestamp")) + if (typeof message.expiryTimestamp === "number") + object.expiryTimestamp = options.longs === String ? String(message.expiryTimestamp) : message.expiryTimestamp; + else + object.expiryTimestamp = options.longs === String ? $util.Long.prototype.toString.call(message.expiryTimestamp) : options.longs === Number ? new $util.LongBits(message.expiryTimestamp.low >>> 0, message.expiryTimestamp.high >>> 0).toNumber(true) : message.expiryTimestamp; + if (message.futureproofed != null && message.hasOwnProperty("futureproofed")) + object.futureproofed = message.futureproofed; + if (message.currency != null && message.hasOwnProperty("currency")) + object.currency = message.currency; + if (message.txnStatus != null && message.hasOwnProperty("txnStatus")) + object.txnStatus = options.enums === String ? $root.proto.PaymentInfo.PaymentInfoTxnStatus[message.txnStatus] : message.txnStatus; + if (message.useNoviFiatFormat != null && message.hasOwnProperty("useNoviFiatFormat")) + object.useNoviFiatFormat = message.useNoviFiatFormat; + if (message.primaryAmount != null && message.hasOwnProperty("primaryAmount")) + object.primaryAmount = $root.proto.Money.toObject(message.primaryAmount, options); + if (message.exchangeAmount != null && message.hasOwnProperty("exchangeAmount")) + object.exchangeAmount = $root.proto.Money.toObject(message.exchangeAmount, options); + return object; + }; + + /** + * Converts this PaymentInfo to JSON. + * @function toJSON + * @memberof proto.PaymentInfo + * @instance + * @returns {Object.} JSON object + */ + PaymentInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * PaymentInfoCurrency enum. + * @name proto.PaymentInfo.PaymentInfoCurrency + * @enum {number} + * @property {number} UNKNOWN_CURRENCY=0 UNKNOWN_CURRENCY value + * @property {number} INR=1 INR value + */ + PaymentInfo.PaymentInfoCurrency = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNKNOWN_CURRENCY"] = 0; + values[valuesById[1] = "INR"] = 1; + return values; + })(); + + /** + * PaymentInfoStatus enum. + * @name proto.PaymentInfo.PaymentInfoStatus + * @enum {number} + * @property {number} UNKNOWN_STATUS=0 UNKNOWN_STATUS value + * @property {number} PROCESSING=1 PROCESSING value + * @property {number} SENT=2 SENT value + * @property {number} NEED_TO_ACCEPT=3 NEED_TO_ACCEPT value + * @property {number} COMPLETE=4 COMPLETE value + * @property {number} COULD_NOT_COMPLETE=5 COULD_NOT_COMPLETE value + * @property {number} REFUNDED=6 REFUNDED value + * @property {number} EXPIRED=7 EXPIRED value + * @property {number} REJECTED=8 REJECTED value + * @property {number} CANCELLED=9 CANCELLED value + * @property {number} WAITING_FOR_PAYER=10 WAITING_FOR_PAYER value + * @property {number} WAITING=11 WAITING value + */ + PaymentInfo.PaymentInfoStatus = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNKNOWN_STATUS"] = 0; + values[valuesById[1] = "PROCESSING"] = 1; + values[valuesById[2] = "SENT"] = 2; + values[valuesById[3] = "NEED_TO_ACCEPT"] = 3; + values[valuesById[4] = "COMPLETE"] = 4; + values[valuesById[5] = "COULD_NOT_COMPLETE"] = 5; + values[valuesById[6] = "REFUNDED"] = 6; + values[valuesById[7] = "EXPIRED"] = 7; + values[valuesById[8] = "REJECTED"] = 8; + values[valuesById[9] = "CANCELLED"] = 9; + values[valuesById[10] = "WAITING_FOR_PAYER"] = 10; + values[valuesById[11] = "WAITING"] = 11; + return values; + })(); + + /** + * PaymentInfoTxnStatus enum. + * @name proto.PaymentInfo.PaymentInfoTxnStatus + * @enum {number} + * @property {number} UNKNOWN=0 UNKNOWN value + * @property {number} PENDING_SETUP=1 PENDING_SETUP value + * @property {number} PENDING_RECEIVER_SETUP=2 PENDING_RECEIVER_SETUP value + * @property {number} INIT=3 INIT value + * @property {number} SUCCESS=4 SUCCESS value + * @property {number} COMPLETED=5 COMPLETED value + * @property {number} FAILED=6 FAILED value + * @property {number} FAILED_RISK=7 FAILED_RISK value + * @property {number} FAILED_PROCESSING=8 FAILED_PROCESSING value + * @property {number} FAILED_RECEIVER_PROCESSING=9 FAILED_RECEIVER_PROCESSING value + * @property {number} FAILED_DA=10 FAILED_DA value + * @property {number} FAILED_DA_FINAL=11 FAILED_DA_FINAL value + * @property {number} REFUNDED_TXN=12 REFUNDED_TXN value + * @property {number} REFUND_FAILED=13 REFUND_FAILED value + * @property {number} REFUND_FAILED_PROCESSING=14 REFUND_FAILED_PROCESSING value + * @property {number} REFUND_FAILED_DA=15 REFUND_FAILED_DA value + * @property {number} EXPIRED_TXN=16 EXPIRED_TXN value + * @property {number} AUTH_CANCELED=17 AUTH_CANCELED value + * @property {number} AUTH_CANCEL_FAILED_PROCESSING=18 AUTH_CANCEL_FAILED_PROCESSING value + * @property {number} AUTH_CANCEL_FAILED=19 AUTH_CANCEL_FAILED value + * @property {number} COLLECT_INIT=20 COLLECT_INIT value + * @property {number} COLLECT_SUCCESS=21 COLLECT_SUCCESS value + * @property {number} COLLECT_FAILED=22 COLLECT_FAILED value + * @property {number} COLLECT_FAILED_RISK=23 COLLECT_FAILED_RISK value + * @property {number} COLLECT_REJECTED=24 COLLECT_REJECTED value + * @property {number} COLLECT_EXPIRED=25 COLLECT_EXPIRED value + * @property {number} COLLECT_CANCELED=26 COLLECT_CANCELED value + * @property {number} COLLECT_CANCELLING=27 COLLECT_CANCELLING value + * @property {number} IN_REVIEW=28 IN_REVIEW value + */ + PaymentInfo.PaymentInfoTxnStatus = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNKNOWN"] = 0; + values[valuesById[1] = "PENDING_SETUP"] = 1; + values[valuesById[2] = "PENDING_RECEIVER_SETUP"] = 2; + values[valuesById[3] = "INIT"] = 3; + values[valuesById[4] = "SUCCESS"] = 4; + values[valuesById[5] = "COMPLETED"] = 5; + values[valuesById[6] = "FAILED"] = 6; + values[valuesById[7] = "FAILED_RISK"] = 7; + values[valuesById[8] = "FAILED_PROCESSING"] = 8; + values[valuesById[9] = "FAILED_RECEIVER_PROCESSING"] = 9; + values[valuesById[10] = "FAILED_DA"] = 10; + values[valuesById[11] = "FAILED_DA_FINAL"] = 11; + values[valuesById[12] = "REFUNDED_TXN"] = 12; + values[valuesById[13] = "REFUND_FAILED"] = 13; + values[valuesById[14] = "REFUND_FAILED_PROCESSING"] = 14; + values[valuesById[15] = "REFUND_FAILED_DA"] = 15; + values[valuesById[16] = "EXPIRED_TXN"] = 16; + values[valuesById[17] = "AUTH_CANCELED"] = 17; + values[valuesById[18] = "AUTH_CANCEL_FAILED_PROCESSING"] = 18; + values[valuesById[19] = "AUTH_CANCEL_FAILED"] = 19; + values[valuesById[20] = "COLLECT_INIT"] = 20; + values[valuesById[21] = "COLLECT_SUCCESS"] = 21; + values[valuesById[22] = "COLLECT_FAILED"] = 22; + values[valuesById[23] = "COLLECT_FAILED_RISK"] = 23; + values[valuesById[24] = "COLLECT_REJECTED"] = 24; + values[valuesById[25] = "COLLECT_EXPIRED"] = 25; + values[valuesById[26] = "COLLECT_CANCELED"] = 26; + values[valuesById[27] = "COLLECT_CANCELLING"] = 27; + values[valuesById[28] = "IN_REVIEW"] = 28; + return values; + })(); + + return PaymentInfo; + })(); + + proto.PhotoChange = (function() { + + /** + * Properties of a PhotoChange. + * @memberof proto + * @interface IPhotoChange + * @property {Uint8Array|null} [oldPhoto] PhotoChange oldPhoto + * @property {Uint8Array|null} [newPhoto] PhotoChange newPhoto + * @property {number|null} [newPhotoId] PhotoChange newPhotoId + */ + + /** + * Constructs a new PhotoChange. + * @memberof proto + * @classdesc Represents a PhotoChange. + * @implements IPhotoChange + * @constructor + * @param {proto.IPhotoChange=} [properties] Properties to set + */ + function PhotoChange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PhotoChange oldPhoto. + * @member {Uint8Array} oldPhoto + * @memberof proto.PhotoChange + * @instance + */ + PhotoChange.prototype.oldPhoto = $util.newBuffer([]); + + /** + * PhotoChange newPhoto. + * @member {Uint8Array} newPhoto + * @memberof proto.PhotoChange + * @instance + */ + PhotoChange.prototype.newPhoto = $util.newBuffer([]); + + /** + * PhotoChange newPhotoId. + * @member {number} newPhotoId + * @memberof proto.PhotoChange + * @instance + */ + PhotoChange.prototype.newPhotoId = 0; + + /** + * Creates a new PhotoChange instance using the specified properties. + * @function create + * @memberof proto.PhotoChange + * @static + * @param {proto.IPhotoChange=} [properties] Properties to set + * @returns {proto.PhotoChange} PhotoChange instance + */ + PhotoChange.create = function create(properties) { + return new PhotoChange(properties); + }; + + /** + * Encodes the specified PhotoChange message. Does not implicitly {@link proto.PhotoChange.verify|verify} messages. + * @function encode + * @memberof proto.PhotoChange + * @static + * @param {proto.IPhotoChange} message PhotoChange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PhotoChange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.oldPhoto != null && Object.hasOwnProperty.call(message, "oldPhoto")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.oldPhoto); + if (message.newPhoto != null && Object.hasOwnProperty.call(message, "newPhoto")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.newPhoto); + if (message.newPhotoId != null && Object.hasOwnProperty.call(message, "newPhotoId")) + writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.newPhotoId); + return writer; + }; + + /** + * Encodes the specified PhotoChange message, length delimited. Does not implicitly {@link proto.PhotoChange.verify|verify} messages. + * @function encodeDelimited + * @memberof proto.PhotoChange + * @static + * @param {proto.IPhotoChange} message PhotoChange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PhotoChange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PhotoChange message from the specified reader or buffer. + * @function decode + * @memberof proto.PhotoChange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {proto.PhotoChange} PhotoChange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PhotoChange.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.PhotoChange(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.oldPhoto = reader.bytes(); + break; + case 2: + message.newPhoto = reader.bytes(); + break; + case 3: + message.newPhotoId = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PhotoChange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof proto.PhotoChange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {proto.PhotoChange} PhotoChange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PhotoChange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PhotoChange message. + * @function verify + * @memberof proto.PhotoChange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PhotoChange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.oldPhoto != null && message.hasOwnProperty("oldPhoto")) + if (!(message.oldPhoto && typeof message.oldPhoto.length === "number" || $util.isString(message.oldPhoto))) + return "oldPhoto: buffer expected"; + if (message.newPhoto != null && message.hasOwnProperty("newPhoto")) + if (!(message.newPhoto && typeof message.newPhoto.length === "number" || $util.isString(message.newPhoto))) + return "newPhoto: buffer expected"; + if (message.newPhotoId != null && message.hasOwnProperty("newPhotoId")) + if (!$util.isInteger(message.newPhotoId)) + return "newPhotoId: integer expected"; + return null; + }; + + /** + * Creates a PhotoChange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof proto.PhotoChange + * @static + * @param {Object.} object Plain object + * @returns {proto.PhotoChange} PhotoChange + */ + PhotoChange.fromObject = function fromObject(object) { + if (object instanceof $root.proto.PhotoChange) + return object; + var message = new $root.proto.PhotoChange(); + if (object.oldPhoto != null) + if (typeof object.oldPhoto === "string") + $util.base64.decode(object.oldPhoto, message.oldPhoto = $util.newBuffer($util.base64.length(object.oldPhoto)), 0); + else if (object.oldPhoto.length) + message.oldPhoto = object.oldPhoto; + if (object.newPhoto != null) + if (typeof object.newPhoto === "string") + $util.base64.decode(object.newPhoto, message.newPhoto = $util.newBuffer($util.base64.length(object.newPhoto)), 0); + else if (object.newPhoto.length) + message.newPhoto = object.newPhoto; + if (object.newPhotoId != null) + message.newPhotoId = object.newPhotoId >>> 0; + return message; + }; + + /** + * Creates a plain object from a PhotoChange message. Also converts values to other types if specified. + * @function toObject + * @memberof proto.PhotoChange + * @static + * @param {proto.PhotoChange} message PhotoChange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PhotoChange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.oldPhoto = ""; + else { + object.oldPhoto = []; + if (options.bytes !== Array) + object.oldPhoto = $util.newBuffer(object.oldPhoto); + } + if (options.bytes === String) + object.newPhoto = ""; + else { + object.newPhoto = []; + if (options.bytes !== Array) + object.newPhoto = $util.newBuffer(object.newPhoto); + } + object.newPhotoId = 0; + } + if (message.oldPhoto != null && message.hasOwnProperty("oldPhoto")) + object.oldPhoto = options.bytes === String ? $util.base64.encode(message.oldPhoto, 0, message.oldPhoto.length) : options.bytes === Array ? Array.prototype.slice.call(message.oldPhoto) : message.oldPhoto; + if (message.newPhoto != null && message.hasOwnProperty("newPhoto")) + object.newPhoto = options.bytes === String ? $util.base64.encode(message.newPhoto, 0, message.newPhoto.length) : options.bytes === Array ? Array.prototype.slice.call(message.newPhoto) : message.newPhoto; + if (message.newPhotoId != null && message.hasOwnProperty("newPhotoId")) + object.newPhotoId = message.newPhotoId; + return object; + }; + + /** + * Converts this PhotoChange to JSON. + * @function toJSON + * @memberof proto.PhotoChange + * @instance + * @returns {Object.} JSON object + */ + PhotoChange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return PhotoChange; + })(); + + proto.PollAdditionalMetadata = (function() { + + /** + * Properties of a PollAdditionalMetadata. + * @memberof proto + * @interface IPollAdditionalMetadata + * @property {boolean|null} [pollInvalidated] PollAdditionalMetadata pollInvalidated + */ + + /** + * Constructs a new PollAdditionalMetadata. + * @memberof proto + * @classdesc Represents a PollAdditionalMetadata. + * @implements IPollAdditionalMetadata + * @constructor + * @param {proto.IPollAdditionalMetadata=} [properties] Properties to set + */ + function PollAdditionalMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PollAdditionalMetadata pollInvalidated. + * @member {boolean} pollInvalidated + * @memberof proto.PollAdditionalMetadata + * @instance + */ + PollAdditionalMetadata.prototype.pollInvalidated = false; + + /** + * Creates a new PollAdditionalMetadata instance using the specified properties. + * @function create + * @memberof proto.PollAdditionalMetadata + * @static + * @param {proto.IPollAdditionalMetadata=} [properties] Properties to set + * @returns {proto.PollAdditionalMetadata} PollAdditionalMetadata instance + */ + PollAdditionalMetadata.create = function create(properties) { + return new PollAdditionalMetadata(properties); + }; + + /** + * Encodes the specified PollAdditionalMetadata message. Does not implicitly {@link proto.PollAdditionalMetadata.verify|verify} messages. + * @function encode + * @memberof proto.PollAdditionalMetadata + * @static + * @param {proto.IPollAdditionalMetadata} message PollAdditionalMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PollAdditionalMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pollInvalidated != null && Object.hasOwnProperty.call(message, "pollInvalidated")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.pollInvalidated); + return writer; + }; + + /** + * Encodes the specified PollAdditionalMetadata message, length delimited. Does not implicitly {@link proto.PollAdditionalMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof proto.PollAdditionalMetadata + * @static + * @param {proto.IPollAdditionalMetadata} message PollAdditionalMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PollAdditionalMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PollAdditionalMetadata message from the specified reader or buffer. + * @function decode + * @memberof proto.PollAdditionalMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {proto.PollAdditionalMetadata} PollAdditionalMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PollAdditionalMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.PollAdditionalMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.pollInvalidated = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PollAdditionalMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof proto.PollAdditionalMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {proto.PollAdditionalMetadata} PollAdditionalMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PollAdditionalMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PollAdditionalMetadata message. + * @function verify + * @memberof proto.PollAdditionalMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PollAdditionalMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.pollInvalidated != null && message.hasOwnProperty("pollInvalidated")) + if (typeof message.pollInvalidated !== "boolean") + return "pollInvalidated: boolean expected"; + return null; + }; + + /** + * Creates a PollAdditionalMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof proto.PollAdditionalMetadata + * @static + * @param {Object.} object Plain object + * @returns {proto.PollAdditionalMetadata} PollAdditionalMetadata + */ + PollAdditionalMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.proto.PollAdditionalMetadata) + return object; + var message = new $root.proto.PollAdditionalMetadata(); + if (object.pollInvalidated != null) + message.pollInvalidated = Boolean(object.pollInvalidated); + return message; + }; + + /** + * Creates a plain object from a PollAdditionalMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof proto.PollAdditionalMetadata + * @static + * @param {proto.PollAdditionalMetadata} message PollAdditionalMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PollAdditionalMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.pollInvalidated = false; + if (message.pollInvalidated != null && message.hasOwnProperty("pollInvalidated")) + object.pollInvalidated = message.pollInvalidated; + return object; + }; + + /** + * Converts this PollAdditionalMetadata to JSON. + * @function toJSON + * @memberof proto.PollAdditionalMetadata + * @instance + * @returns {Object.} JSON object + */ + PollAdditionalMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return PollAdditionalMetadata; + })(); + + proto.PollUpdate = (function() { + + /** + * Properties of a PollUpdate. + * @memberof proto + * @interface IPollUpdate + * @property {proto.IMessageKey|null} [pollUpdateMessageKey] PollUpdate pollUpdateMessageKey + * @property {proto.IPollUpdateMessageContent|null} [pollUpdateMessage] PollUpdate pollUpdateMessage + */ + + /** + * Constructs a new PollUpdate. + * @memberof proto + * @classdesc Represents a PollUpdate. + * @implements IPollUpdate + * @constructor + * @param {proto.IPollUpdate=} [properties] Properties to set + */ + function PollUpdate(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PollUpdate pollUpdateMessageKey. + * @member {proto.IMessageKey|null|undefined} pollUpdateMessageKey + * @memberof proto.PollUpdate + * @instance + */ + PollUpdate.prototype.pollUpdateMessageKey = null; + + /** + * PollUpdate pollUpdateMessage. + * @member {proto.IPollUpdateMessageContent|null|undefined} pollUpdateMessage + * @memberof proto.PollUpdate + * @instance + */ + PollUpdate.prototype.pollUpdateMessage = null; + + /** + * Creates a new PollUpdate instance using the specified properties. + * @function create + * @memberof proto.PollUpdate + * @static + * @param {proto.IPollUpdate=} [properties] Properties to set + * @returns {proto.PollUpdate} PollUpdate instance + */ + PollUpdate.create = function create(properties) { + return new PollUpdate(properties); + }; + + /** + * Encodes the specified PollUpdate message. Does not implicitly {@link proto.PollUpdate.verify|verify} messages. + * @function encode + * @memberof proto.PollUpdate + * @static + * @param {proto.IPollUpdate} message PollUpdate message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PollUpdate.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pollUpdateMessageKey != null && Object.hasOwnProperty.call(message, "pollUpdateMessageKey")) + $root.proto.MessageKey.encode(message.pollUpdateMessageKey, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.pollUpdateMessage != null && Object.hasOwnProperty.call(message, "pollUpdateMessage")) + $root.proto.PollUpdateMessageContent.encode(message.pollUpdateMessage, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PollUpdate message, length delimited. Does not implicitly {@link proto.PollUpdate.verify|verify} messages. + * @function encodeDelimited + * @memberof proto.PollUpdate + * @static + * @param {proto.IPollUpdate} message PollUpdate message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PollUpdate.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PollUpdate message from the specified reader or buffer. + * @function decode + * @memberof proto.PollUpdate + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {proto.PollUpdate} PollUpdate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PollUpdate.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.PollUpdate(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.pollUpdateMessageKey = $root.proto.MessageKey.decode(reader, reader.uint32()); + break; + case 2: + message.pollUpdateMessage = $root.proto.PollUpdateMessageContent.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PollUpdate message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof proto.PollUpdate + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {proto.PollUpdate} PollUpdate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PollUpdate.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PollUpdate message. + * @function verify + * @memberof proto.PollUpdate + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PollUpdate.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.pollUpdateMessageKey != null && message.hasOwnProperty("pollUpdateMessageKey")) { + var error = $root.proto.MessageKey.verify(message.pollUpdateMessageKey); + if (error) + return "pollUpdateMessageKey." + error; + } + if (message.pollUpdateMessage != null && message.hasOwnProperty("pollUpdateMessage")) { + var error = $root.proto.PollUpdateMessageContent.verify(message.pollUpdateMessage); + if (error) + return "pollUpdateMessage." + error; + } + return null; + }; + + /** + * Creates a PollUpdate message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof proto.PollUpdate + * @static + * @param {Object.} object Plain object + * @returns {proto.PollUpdate} PollUpdate + */ + PollUpdate.fromObject = function fromObject(object) { + if (object instanceof $root.proto.PollUpdate) + return object; + var message = new $root.proto.PollUpdate(); + if (object.pollUpdateMessageKey != null) { + if (typeof object.pollUpdateMessageKey !== "object") + throw TypeError(".proto.PollUpdate.pollUpdateMessageKey: object expected"); + message.pollUpdateMessageKey = $root.proto.MessageKey.fromObject(object.pollUpdateMessageKey); + } + if (object.pollUpdateMessage != null) { + if (typeof object.pollUpdateMessage !== "object") + throw TypeError(".proto.PollUpdate.pollUpdateMessage: object expected"); + message.pollUpdateMessage = $root.proto.PollUpdateMessageContent.fromObject(object.pollUpdateMessage); + } + return message; + }; + + /** + * Creates a plain object from a PollUpdate message. Also converts values to other types if specified. + * @function toObject + * @memberof proto.PollUpdate + * @static + * @param {proto.PollUpdate} message PollUpdate + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PollUpdate.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.pollUpdateMessageKey = null; + object.pollUpdateMessage = null; + } + if (message.pollUpdateMessageKey != null && message.hasOwnProperty("pollUpdateMessageKey")) + object.pollUpdateMessageKey = $root.proto.MessageKey.toObject(message.pollUpdateMessageKey, options); + if (message.pollUpdateMessage != null && message.hasOwnProperty("pollUpdateMessage")) + object.pollUpdateMessage = $root.proto.PollUpdateMessageContent.toObject(message.pollUpdateMessage, options); + return object; + }; + + /** + * Converts this PollUpdate to JSON. + * @function toJSON + * @memberof proto.PollUpdate + * @instance + * @returns {Object.} JSON object + */ + PollUpdate.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return PollUpdate; + })(); + + proto.Reaction = (function() { + + /** + * Properties of a Reaction. + * @memberof proto + * @interface IReaction + * @property {proto.IMessageKey|null} [key] Reaction key + * @property {string|null} [text] Reaction text + * @property {string|null} [groupingKey] Reaction groupingKey + * @property {number|Long|null} [senderTimestampMs] Reaction senderTimestampMs + * @property {boolean|null} [unread] Reaction unread + */ + + /** + * Constructs a new Reaction. + * @memberof proto + * @classdesc Represents a Reaction. + * @implements IReaction + * @constructor + * @param {proto.IReaction=} [properties] Properties to set + */ + function Reaction(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Reaction key. + * @member {proto.IMessageKey|null|undefined} key + * @memberof proto.Reaction + * @instance + */ + Reaction.prototype.key = null; + + /** + * Reaction text. + * @member {string} text + * @memberof proto.Reaction + * @instance + */ + Reaction.prototype.text = ""; + + /** + * Reaction groupingKey. + * @member {string} groupingKey + * @memberof proto.Reaction + * @instance + */ + Reaction.prototype.groupingKey = ""; + + /** + * Reaction senderTimestampMs. + * @member {number|Long} senderTimestampMs + * @memberof proto.Reaction + * @instance + */ + Reaction.prototype.senderTimestampMs = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Reaction unread. + * @member {boolean} unread + * @memberof proto.Reaction + * @instance + */ + Reaction.prototype.unread = false; + + /** + * Creates a new Reaction instance using the specified properties. + * @function create + * @memberof proto.Reaction + * @static + * @param {proto.IReaction=} [properties] Properties to set + * @returns {proto.Reaction} Reaction instance + */ + Reaction.create = function create(properties) { + return new Reaction(properties); + }; + + /** + * Encodes the specified Reaction message. Does not implicitly {@link proto.Reaction.verify|verify} messages. + * @function encode + * @memberof proto.Reaction + * @static + * @param {proto.IReaction} message Reaction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Reaction.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.key != null && Object.hasOwnProperty.call(message, "key")) + $root.proto.MessageKey.encode(message.key, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.text != null && Object.hasOwnProperty.call(message, "text")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.text); + if (message.groupingKey != null && Object.hasOwnProperty.call(message, "groupingKey")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.groupingKey); + if (message.senderTimestampMs != null && Object.hasOwnProperty.call(message, "senderTimestampMs")) + writer.uint32(/* id 4, wireType 0 =*/32).int64(message.senderTimestampMs); + if (message.unread != null && Object.hasOwnProperty.call(message, "unread")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.unread); + return writer; + }; + + /** + * Encodes the specified Reaction message, length delimited. Does not implicitly {@link proto.Reaction.verify|verify} messages. + * @function encodeDelimited + * @memberof proto.Reaction + * @static + * @param {proto.IReaction} message Reaction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Reaction.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Reaction message from the specified reader or buffer. + * @function decode + * @memberof proto.Reaction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {proto.Reaction} Reaction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Reaction.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.Reaction(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = $root.proto.MessageKey.decode(reader, reader.uint32()); + break; + case 2: + message.text = reader.string(); + break; + case 3: + message.groupingKey = reader.string(); + break; + case 4: + message.senderTimestampMs = reader.int64(); + break; + case 5: + message.unread = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Reaction message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof proto.Reaction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {proto.Reaction} Reaction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Reaction.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Reaction message. + * @function verify + * @memberof proto.Reaction + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Reaction.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.key != null && message.hasOwnProperty("key")) { + var error = $root.proto.MessageKey.verify(message.key); + if (error) + return "key." + error; + } + if (message.text != null && message.hasOwnProperty("text")) + if (!$util.isString(message.text)) + return "text: string expected"; + if (message.groupingKey != null && message.hasOwnProperty("groupingKey")) + if (!$util.isString(message.groupingKey)) + return "groupingKey: string expected"; + if (message.senderTimestampMs != null && message.hasOwnProperty("senderTimestampMs")) + if (!$util.isInteger(message.senderTimestampMs) && !(message.senderTimestampMs && $util.isInteger(message.senderTimestampMs.low) && $util.isInteger(message.senderTimestampMs.high))) + return "senderTimestampMs: integer|Long expected"; + if (message.unread != null && message.hasOwnProperty("unread")) + if (typeof message.unread !== "boolean") + return "unread: boolean expected"; + return null; + }; + + /** + * Creates a Reaction message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof proto.Reaction + * @static + * @param {Object.} object Plain object + * @returns {proto.Reaction} Reaction + */ + Reaction.fromObject = function fromObject(object) { + if (object instanceof $root.proto.Reaction) + return object; + var message = new $root.proto.Reaction(); + if (object.key != null) { + if (typeof object.key !== "object") + throw TypeError(".proto.Reaction.key: object expected"); + message.key = $root.proto.MessageKey.fromObject(object.key); + } + if (object.text != null) + message.text = String(object.text); + if (object.groupingKey != null) + message.groupingKey = String(object.groupingKey); + if (object.senderTimestampMs != null) + if ($util.Long) + (message.senderTimestampMs = $util.Long.fromValue(object.senderTimestampMs)).unsigned = false; + else if (typeof object.senderTimestampMs === "string") + message.senderTimestampMs = parseInt(object.senderTimestampMs, 10); + else if (typeof object.senderTimestampMs === "number") + message.senderTimestampMs = object.senderTimestampMs; + else if (typeof object.senderTimestampMs === "object") + message.senderTimestampMs = new $util.LongBits(object.senderTimestampMs.low >>> 0, object.senderTimestampMs.high >>> 0).toNumber(); + if (object.unread != null) + message.unread = Boolean(object.unread); + return message; + }; + + /** + * Creates a plain object from a Reaction message. Also converts values to other types if specified. + * @function toObject + * @memberof proto.Reaction + * @static + * @param {proto.Reaction} message Reaction + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Reaction.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.key = null; + object.text = ""; + object.groupingKey = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.senderTimestampMs = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.senderTimestampMs = options.longs === String ? "0" : 0; + object.unread = false; + } + if (message.key != null && message.hasOwnProperty("key")) + object.key = $root.proto.MessageKey.toObject(message.key, options); + if (message.text != null && message.hasOwnProperty("text")) + object.text = message.text; + if (message.groupingKey != null && message.hasOwnProperty("groupingKey")) + object.groupingKey = message.groupingKey; + if (message.senderTimestampMs != null && message.hasOwnProperty("senderTimestampMs")) + if (typeof message.senderTimestampMs === "number") + object.senderTimestampMs = options.longs === String ? String(message.senderTimestampMs) : message.senderTimestampMs; + else + object.senderTimestampMs = options.longs === String ? $util.Long.prototype.toString.call(message.senderTimestampMs) : options.longs === Number ? new $util.LongBits(message.senderTimestampMs.low >>> 0, message.senderTimestampMs.high >>> 0).toNumber() : message.senderTimestampMs; + if (message.unread != null && message.hasOwnProperty("unread")) + object.unread = message.unread; + return object; + }; + + /** + * Converts this Reaction to JSON. + * @function toJSON + * @memberof proto.Reaction + * @instance + * @returns {Object.} JSON object + */ + Reaction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Reaction; + })(); + + proto.StatusPSA = (function() { + + /** + * Properties of a StatusPSA. + * @memberof proto + * @interface IStatusPSA + * @property {string} campaignId StatusPSA campaignId + * @property {number|Long|null} [campaignExpirationTimestamp] StatusPSA campaignExpirationTimestamp + */ + + /** + * Constructs a new StatusPSA. + * @memberof proto + * @classdesc Represents a StatusPSA. + * @implements IStatusPSA + * @constructor + * @param {proto.IStatusPSA=} [properties] Properties to set + */ + function StatusPSA(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StatusPSA campaignId. + * @member {string} campaignId + * @memberof proto.StatusPSA + * @instance + */ + StatusPSA.prototype.campaignId = ""; + + /** + * StatusPSA campaignExpirationTimestamp. + * @member {number|Long} campaignExpirationTimestamp + * @memberof proto.StatusPSA + * @instance + */ + StatusPSA.prototype.campaignExpirationTimestamp = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new StatusPSA instance using the specified properties. + * @function create + * @memberof proto.StatusPSA + * @static + * @param {proto.IStatusPSA=} [properties] Properties to set + * @returns {proto.StatusPSA} StatusPSA instance + */ + StatusPSA.create = function create(properties) { + return new StatusPSA(properties); + }; + + /** + * Encodes the specified StatusPSA message. Does not implicitly {@link proto.StatusPSA.verify|verify} messages. + * @function encode + * @memberof proto.StatusPSA + * @static + * @param {proto.IStatusPSA} message StatusPSA message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StatusPSA.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + writer.uint32(/* id 44, wireType 2 =*/354).string(message.campaignId); + if (message.campaignExpirationTimestamp != null && Object.hasOwnProperty.call(message, "campaignExpirationTimestamp")) + writer.uint32(/* id 45, wireType 0 =*/360).uint64(message.campaignExpirationTimestamp); + return writer; + }; + + /** + * Encodes the specified StatusPSA message, length delimited. Does not implicitly {@link proto.StatusPSA.verify|verify} messages. + * @function encodeDelimited + * @memberof proto.StatusPSA + * @static + * @param {proto.IStatusPSA} message StatusPSA message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StatusPSA.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StatusPSA message from the specified reader or buffer. + * @function decode + * @memberof proto.StatusPSA + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {proto.StatusPSA} StatusPSA + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StatusPSA.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.StatusPSA(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 44: + message.campaignId = reader.string(); + break; + case 45: + message.campaignExpirationTimestamp = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + if (!message.hasOwnProperty("campaignId")) + throw $util.ProtocolError("missing required 'campaignId'", { instance: message }); + return message; + }; + + /** + * Decodes a StatusPSA message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof proto.StatusPSA + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {proto.StatusPSA} StatusPSA + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StatusPSA.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StatusPSA message. + * @function verify + * @memberof proto.StatusPSA + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StatusPSA.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (!$util.isString(message.campaignId)) + return "campaignId: string expected"; + if (message.campaignExpirationTimestamp != null && message.hasOwnProperty("campaignExpirationTimestamp")) + if (!$util.isInteger(message.campaignExpirationTimestamp) && !(message.campaignExpirationTimestamp && $util.isInteger(message.campaignExpirationTimestamp.low) && $util.isInteger(message.campaignExpirationTimestamp.high))) + return "campaignExpirationTimestamp: integer|Long expected"; + return null; + }; + + /** + * Creates a StatusPSA message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof proto.StatusPSA + * @static + * @param {Object.} object Plain object + * @returns {proto.StatusPSA} StatusPSA + */ + StatusPSA.fromObject = function fromObject(object) { + if (object instanceof $root.proto.StatusPSA) + return object; + var message = new $root.proto.StatusPSA(); + if (object.campaignId != null) + message.campaignId = String(object.campaignId); + if (object.campaignExpirationTimestamp != null) + if ($util.Long) + (message.campaignExpirationTimestamp = $util.Long.fromValue(object.campaignExpirationTimestamp)).unsigned = true; + else if (typeof object.campaignExpirationTimestamp === "string") + message.campaignExpirationTimestamp = parseInt(object.campaignExpirationTimestamp, 10); + else if (typeof object.campaignExpirationTimestamp === "number") + message.campaignExpirationTimestamp = object.campaignExpirationTimestamp; + else if (typeof object.campaignExpirationTimestamp === "object") + message.campaignExpirationTimestamp = new $util.LongBits(object.campaignExpirationTimestamp.low >>> 0, object.campaignExpirationTimestamp.high >>> 0).toNumber(true); + return message; + }; + + /** + * Creates a plain object from a StatusPSA message. Also converts values to other types if specified. + * @function toObject + * @memberof proto.StatusPSA + * @static + * @param {proto.StatusPSA} message StatusPSA + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StatusPSA.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.campaignId = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.campaignExpirationTimestamp = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.campaignExpirationTimestamp = options.longs === String ? "0" : 0; + } + if (message.campaignId != null && message.hasOwnProperty("campaignId")) + object.campaignId = message.campaignId; + if (message.campaignExpirationTimestamp != null && message.hasOwnProperty("campaignExpirationTimestamp")) + if (typeof message.campaignExpirationTimestamp === "number") + object.campaignExpirationTimestamp = options.longs === String ? String(message.campaignExpirationTimestamp) : message.campaignExpirationTimestamp; + else + object.campaignExpirationTimestamp = options.longs === String ? $util.Long.prototype.toString.call(message.campaignExpirationTimestamp) : options.longs === Number ? new $util.LongBits(message.campaignExpirationTimestamp.low >>> 0, message.campaignExpirationTimestamp.high >>> 0).toNumber(true) : message.campaignExpirationTimestamp; + return object; + }; + + /** + * Converts this StatusPSA to JSON. + * @function toJSON + * @memberof proto.StatusPSA + * @instance + * @returns {Object.} JSON object + */ + StatusPSA.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return StatusPSA; + })(); + + proto.UserReceipt = (function() { + + /** + * Properties of a UserReceipt. + * @memberof proto + * @interface IUserReceipt + * @property {string} userJid UserReceipt userJid + * @property {number|Long|null} [receiptTimestamp] UserReceipt receiptTimestamp + * @property {number|Long|null} [readTimestamp] UserReceipt readTimestamp + * @property {number|Long|null} [playedTimestamp] UserReceipt playedTimestamp + * @property {Array.|null} [pendingDeviceJid] UserReceipt pendingDeviceJid + * @property {Array.|null} [deliveredDeviceJid] UserReceipt deliveredDeviceJid + */ + + /** + * Constructs a new UserReceipt. + * @memberof proto + * @classdesc Represents a UserReceipt. + * @implements IUserReceipt + * @constructor + * @param {proto.IUserReceipt=} [properties] Properties to set + */ + function UserReceipt(properties) { + this.pendingDeviceJid = []; + this.deliveredDeviceJid = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UserReceipt userJid. + * @member {string} userJid + * @memberof proto.UserReceipt + * @instance + */ + UserReceipt.prototype.userJid = ""; + + /** + * UserReceipt receiptTimestamp. + * @member {number|Long} receiptTimestamp + * @memberof proto.UserReceipt + * @instance + */ + UserReceipt.prototype.receiptTimestamp = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * UserReceipt readTimestamp. + * @member {number|Long} readTimestamp + * @memberof proto.UserReceipt + * @instance + */ + UserReceipt.prototype.readTimestamp = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * UserReceipt playedTimestamp. + * @member {number|Long} playedTimestamp + * @memberof proto.UserReceipt + * @instance + */ + UserReceipt.prototype.playedTimestamp = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * UserReceipt pendingDeviceJid. + * @member {Array.} pendingDeviceJid + * @memberof proto.UserReceipt + * @instance + */ + UserReceipt.prototype.pendingDeviceJid = $util.emptyArray; + + /** + * UserReceipt deliveredDeviceJid. + * @member {Array.} deliveredDeviceJid + * @memberof proto.UserReceipt + * @instance + */ + UserReceipt.prototype.deliveredDeviceJid = $util.emptyArray; + + /** + * Creates a new UserReceipt instance using the specified properties. + * @function create + * @memberof proto.UserReceipt + * @static + * @param {proto.IUserReceipt=} [properties] Properties to set + * @returns {proto.UserReceipt} UserReceipt instance + */ + UserReceipt.create = function create(properties) { + return new UserReceipt(properties); + }; + + /** + * Encodes the specified UserReceipt message. Does not implicitly {@link proto.UserReceipt.verify|verify} messages. + * @function encode + * @memberof proto.UserReceipt + * @static + * @param {proto.IUserReceipt} message UserReceipt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UserReceipt.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + writer.uint32(/* id 1, wireType 2 =*/10).string(message.userJid); + if (message.receiptTimestamp != null && Object.hasOwnProperty.call(message, "receiptTimestamp")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.receiptTimestamp); + if (message.readTimestamp != null && Object.hasOwnProperty.call(message, "readTimestamp")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.readTimestamp); + if (message.playedTimestamp != null && Object.hasOwnProperty.call(message, "playedTimestamp")) + writer.uint32(/* id 4, wireType 0 =*/32).int64(message.playedTimestamp); + if (message.pendingDeviceJid != null && message.pendingDeviceJid.length) + for (var i = 0; i < message.pendingDeviceJid.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.pendingDeviceJid[i]); + if (message.deliveredDeviceJid != null && message.deliveredDeviceJid.length) + for (var i = 0; i < message.deliveredDeviceJid.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.deliveredDeviceJid[i]); + return writer; + }; + + /** + * Encodes the specified UserReceipt message, length delimited. Does not implicitly {@link proto.UserReceipt.verify|verify} messages. + * @function encodeDelimited + * @memberof proto.UserReceipt + * @static + * @param {proto.IUserReceipt} message UserReceipt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UserReceipt.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a UserReceipt message from the specified reader or buffer. + * @function decode + * @memberof proto.UserReceipt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {proto.UserReceipt} UserReceipt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UserReceipt.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.UserReceipt(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.userJid = reader.string(); + break; + case 2: + message.receiptTimestamp = reader.int64(); + break; + case 3: + message.readTimestamp = reader.int64(); + break; + case 4: + message.playedTimestamp = reader.int64(); + break; + case 5: + if (!(message.pendingDeviceJid && message.pendingDeviceJid.length)) + message.pendingDeviceJid = []; + message.pendingDeviceJid.push(reader.string()); + break; + case 6: + if (!(message.deliveredDeviceJid && message.deliveredDeviceJid.length)) + message.deliveredDeviceJid = []; + message.deliveredDeviceJid.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + if (!message.hasOwnProperty("userJid")) + throw $util.ProtocolError("missing required 'userJid'", { instance: message }); + return message; + }; + + /** + * Decodes a UserReceipt message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof proto.UserReceipt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {proto.UserReceipt} UserReceipt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UserReceipt.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a UserReceipt message. + * @function verify + * @memberof proto.UserReceipt + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UserReceipt.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (!$util.isString(message.userJid)) + return "userJid: string expected"; + if (message.receiptTimestamp != null && message.hasOwnProperty("receiptTimestamp")) + if (!$util.isInteger(message.receiptTimestamp) && !(message.receiptTimestamp && $util.isInteger(message.receiptTimestamp.low) && $util.isInteger(message.receiptTimestamp.high))) + return "receiptTimestamp: integer|Long expected"; + if (message.readTimestamp != null && message.hasOwnProperty("readTimestamp")) + if (!$util.isInteger(message.readTimestamp) && !(message.readTimestamp && $util.isInteger(message.readTimestamp.low) && $util.isInteger(message.readTimestamp.high))) + return "readTimestamp: integer|Long expected"; + if (message.playedTimestamp != null && message.hasOwnProperty("playedTimestamp")) + if (!$util.isInteger(message.playedTimestamp) && !(message.playedTimestamp && $util.isInteger(message.playedTimestamp.low) && $util.isInteger(message.playedTimestamp.high))) + return "playedTimestamp: integer|Long expected"; + if (message.pendingDeviceJid != null && message.hasOwnProperty("pendingDeviceJid")) { + if (!Array.isArray(message.pendingDeviceJid)) + return "pendingDeviceJid: array expected"; + for (var i = 0; i < message.pendingDeviceJid.length; ++i) + if (!$util.isString(message.pendingDeviceJid[i])) + return "pendingDeviceJid: string[] expected"; + } + if (message.deliveredDeviceJid != null && message.hasOwnProperty("deliveredDeviceJid")) { + if (!Array.isArray(message.deliveredDeviceJid)) + return "deliveredDeviceJid: array expected"; + for (var i = 0; i < message.deliveredDeviceJid.length; ++i) + if (!$util.isString(message.deliveredDeviceJid[i])) + return "deliveredDeviceJid: string[] expected"; + } + return null; + }; + + /** + * Creates a UserReceipt message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof proto.UserReceipt + * @static + * @param {Object.} object Plain object + * @returns {proto.UserReceipt} UserReceipt + */ + UserReceipt.fromObject = function fromObject(object) { + if (object instanceof $root.proto.UserReceipt) + return object; + var message = new $root.proto.UserReceipt(); + if (object.userJid != null) + message.userJid = String(object.userJid); + if (object.receiptTimestamp != null) + if ($util.Long) + (message.receiptTimestamp = $util.Long.fromValue(object.receiptTimestamp)).unsigned = false; + else if (typeof object.receiptTimestamp === "string") + message.receiptTimestamp = parseInt(object.receiptTimestamp, 10); + else if (typeof object.receiptTimestamp === "number") + message.receiptTimestamp = object.receiptTimestamp; + else if (typeof object.receiptTimestamp === "object") + message.receiptTimestamp = new $util.LongBits(object.receiptTimestamp.low >>> 0, object.receiptTimestamp.high >>> 0).toNumber(); + if (object.readTimestamp != null) + if ($util.Long) + (message.readTimestamp = $util.Long.fromValue(object.readTimestamp)).unsigned = false; + else if (typeof object.readTimestamp === "string") + message.readTimestamp = parseInt(object.readTimestamp, 10); + else if (typeof object.readTimestamp === "number") + message.readTimestamp = object.readTimestamp; + else if (typeof object.readTimestamp === "object") + message.readTimestamp = new $util.LongBits(object.readTimestamp.low >>> 0, object.readTimestamp.high >>> 0).toNumber(); + if (object.playedTimestamp != null) + if ($util.Long) + (message.playedTimestamp = $util.Long.fromValue(object.playedTimestamp)).unsigned = false; + else if (typeof object.playedTimestamp === "string") + message.playedTimestamp = parseInt(object.playedTimestamp, 10); + else if (typeof object.playedTimestamp === "number") + message.playedTimestamp = object.playedTimestamp; + else if (typeof object.playedTimestamp === "object") + message.playedTimestamp = new $util.LongBits(object.playedTimestamp.low >>> 0, object.playedTimestamp.high >>> 0).toNumber(); + if (object.pendingDeviceJid) { + if (!Array.isArray(object.pendingDeviceJid)) + throw TypeError(".proto.UserReceipt.pendingDeviceJid: array expected"); + message.pendingDeviceJid = []; + for (var i = 0; i < object.pendingDeviceJid.length; ++i) + message.pendingDeviceJid[i] = String(object.pendingDeviceJid[i]); + } + if (object.deliveredDeviceJid) { + if (!Array.isArray(object.deliveredDeviceJid)) + throw TypeError(".proto.UserReceipt.deliveredDeviceJid: array expected"); + message.deliveredDeviceJid = []; + for (var i = 0; i < object.deliveredDeviceJid.length; ++i) + message.deliveredDeviceJid[i] = String(object.deliveredDeviceJid[i]); + } + return message; + }; + + /** + * Creates a plain object from a UserReceipt message. Also converts values to other types if specified. + * @function toObject + * @memberof proto.UserReceipt + * @static + * @param {proto.UserReceipt} message UserReceipt + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UserReceipt.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.pendingDeviceJid = []; + object.deliveredDeviceJid = []; + } + if (options.defaults) { + object.userJid = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.receiptTimestamp = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.receiptTimestamp = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.readTimestamp = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.readTimestamp = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.playedTimestamp = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.playedTimestamp = options.longs === String ? "0" : 0; + } + if (message.userJid != null && message.hasOwnProperty("userJid")) + object.userJid = message.userJid; + if (message.receiptTimestamp != null && message.hasOwnProperty("receiptTimestamp")) + if (typeof message.receiptTimestamp === "number") + object.receiptTimestamp = options.longs === String ? String(message.receiptTimestamp) : message.receiptTimestamp; + else + object.receiptTimestamp = options.longs === String ? $util.Long.prototype.toString.call(message.receiptTimestamp) : options.longs === Number ? new $util.LongBits(message.receiptTimestamp.low >>> 0, message.receiptTimestamp.high >>> 0).toNumber() : message.receiptTimestamp; + if (message.readTimestamp != null && message.hasOwnProperty("readTimestamp")) + if (typeof message.readTimestamp === "number") + object.readTimestamp = options.longs === String ? String(message.readTimestamp) : message.readTimestamp; + else + object.readTimestamp = options.longs === String ? $util.Long.prototype.toString.call(message.readTimestamp) : options.longs === Number ? new $util.LongBits(message.readTimestamp.low >>> 0, message.readTimestamp.high >>> 0).toNumber() : message.readTimestamp; + if (message.playedTimestamp != null && message.hasOwnProperty("playedTimestamp")) + if (typeof message.playedTimestamp === "number") + object.playedTimestamp = options.longs === String ? String(message.playedTimestamp) : message.playedTimestamp; + else + object.playedTimestamp = options.longs === String ? $util.Long.prototype.toString.call(message.playedTimestamp) : options.longs === Number ? new $util.LongBits(message.playedTimestamp.low >>> 0, message.playedTimestamp.high >>> 0).toNumber() : message.playedTimestamp; + if (message.pendingDeviceJid && message.pendingDeviceJid.length) { + object.pendingDeviceJid = []; + for (var j = 0; j < message.pendingDeviceJid.length; ++j) + object.pendingDeviceJid[j] = message.pendingDeviceJid[j]; + } + if (message.deliveredDeviceJid && message.deliveredDeviceJid.length) { + object.deliveredDeviceJid = []; + for (var j = 0; j < message.deliveredDeviceJid.length; ++j) + object.deliveredDeviceJid[j] = message.deliveredDeviceJid[j]; + } + return object; + }; + + /** + * Converts this UserReceipt to JSON. + * @function toJSON + * @memberof proto.UserReceipt + * @instance + * @returns {Object.} JSON object + */ + UserReceipt.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return UserReceipt; + })(); + + proto.WebFeatures = (function() { + + /** + * Properties of a WebFeatures. + * @memberof proto + * @interface IWebFeatures + * @property {proto.WebFeatures.WebFeaturesFlag|null} [labelsDisplay] WebFeatures labelsDisplay + * @property {proto.WebFeatures.WebFeaturesFlag|null} [voipIndividualOutgoing] WebFeatures voipIndividualOutgoing + * @property {proto.WebFeatures.WebFeaturesFlag|null} [groupsV3] WebFeatures groupsV3 + * @property {proto.WebFeatures.WebFeaturesFlag|null} [groupsV3Create] WebFeatures groupsV3Create + * @property {proto.WebFeatures.WebFeaturesFlag|null} [changeNumberV2] WebFeatures changeNumberV2 + * @property {proto.WebFeatures.WebFeaturesFlag|null} [queryStatusV3Thumbnail] WebFeatures queryStatusV3Thumbnail + * @property {proto.WebFeatures.WebFeaturesFlag|null} [liveLocations] WebFeatures liveLocations + * @property {proto.WebFeatures.WebFeaturesFlag|null} [queryVname] WebFeatures queryVname + * @property {proto.WebFeatures.WebFeaturesFlag|null} [voipIndividualIncoming] WebFeatures voipIndividualIncoming + * @property {proto.WebFeatures.WebFeaturesFlag|null} [quickRepliesQuery] WebFeatures quickRepliesQuery + * @property {proto.WebFeatures.WebFeaturesFlag|null} [payments] WebFeatures payments + * @property {proto.WebFeatures.WebFeaturesFlag|null} [stickerPackQuery] WebFeatures stickerPackQuery + * @property {proto.WebFeatures.WebFeaturesFlag|null} [liveLocationsFinal] WebFeatures liveLocationsFinal + * @property {proto.WebFeatures.WebFeaturesFlag|null} [labelsEdit] WebFeatures labelsEdit + * @property {proto.WebFeatures.WebFeaturesFlag|null} [mediaUpload] WebFeatures mediaUpload + * @property {proto.WebFeatures.WebFeaturesFlag|null} [mediaUploadRichQuickReplies] WebFeatures mediaUploadRichQuickReplies + * @property {proto.WebFeatures.WebFeaturesFlag|null} [vnameV2] WebFeatures vnameV2 + * @property {proto.WebFeatures.WebFeaturesFlag|null} [videoPlaybackUrl] WebFeatures videoPlaybackUrl + * @property {proto.WebFeatures.WebFeaturesFlag|null} [statusRanking] WebFeatures statusRanking + * @property {proto.WebFeatures.WebFeaturesFlag|null} [voipIndividualVideo] WebFeatures voipIndividualVideo + * @property {proto.WebFeatures.WebFeaturesFlag|null} [thirdPartyStickers] WebFeatures thirdPartyStickers + * @property {proto.WebFeatures.WebFeaturesFlag|null} [frequentlyForwardedSetting] WebFeatures frequentlyForwardedSetting + * @property {proto.WebFeatures.WebFeaturesFlag|null} [groupsV4JoinPermission] WebFeatures groupsV4JoinPermission + * @property {proto.WebFeatures.WebFeaturesFlag|null} [recentStickers] WebFeatures recentStickers + * @property {proto.WebFeatures.WebFeaturesFlag|null} [catalog] WebFeatures catalog + * @property {proto.WebFeatures.WebFeaturesFlag|null} [starredStickers] WebFeatures starredStickers + * @property {proto.WebFeatures.WebFeaturesFlag|null} [voipGroupCall] WebFeatures voipGroupCall + * @property {proto.WebFeatures.WebFeaturesFlag|null} [templateMessage] WebFeatures templateMessage + * @property {proto.WebFeatures.WebFeaturesFlag|null} [templateMessageInteractivity] WebFeatures templateMessageInteractivity + * @property {proto.WebFeatures.WebFeaturesFlag|null} [ephemeralMessages] WebFeatures ephemeralMessages + * @property {proto.WebFeatures.WebFeaturesFlag|null} [e2ENotificationSync] WebFeatures e2ENotificationSync + * @property {proto.WebFeatures.WebFeaturesFlag|null} [recentStickersV2] WebFeatures recentStickersV2 + * @property {proto.WebFeatures.WebFeaturesFlag|null} [recentStickersV3] WebFeatures recentStickersV3 + * @property {proto.WebFeatures.WebFeaturesFlag|null} [userNotice] WebFeatures userNotice + * @property {proto.WebFeatures.WebFeaturesFlag|null} [support] WebFeatures support + * @property {proto.WebFeatures.WebFeaturesFlag|null} [groupUiiCleanup] WebFeatures groupUiiCleanup + * @property {proto.WebFeatures.WebFeaturesFlag|null} [groupDogfoodingInternalOnly] WebFeatures groupDogfoodingInternalOnly + * @property {proto.WebFeatures.WebFeaturesFlag|null} [settingsSync] WebFeatures settingsSync + * @property {proto.WebFeatures.WebFeaturesFlag|null} [archiveV2] WebFeatures archiveV2 + * @property {proto.WebFeatures.WebFeaturesFlag|null} [ephemeralAllowGroupMembers] WebFeatures ephemeralAllowGroupMembers + * @property {proto.WebFeatures.WebFeaturesFlag|null} [ephemeral24HDuration] WebFeatures ephemeral24HDuration + * @property {proto.WebFeatures.WebFeaturesFlag|null} [mdForceUpgrade] WebFeatures mdForceUpgrade + * @property {proto.WebFeatures.WebFeaturesFlag|null} [disappearingMode] WebFeatures disappearingMode + * @property {proto.WebFeatures.WebFeaturesFlag|null} [externalMdOptInAvailable] WebFeatures externalMdOptInAvailable + * @property {proto.WebFeatures.WebFeaturesFlag|null} [noDeleteMessageTimeLimit] WebFeatures noDeleteMessageTimeLimit + */ + + /** + * Constructs a new WebFeatures. + * @memberof proto + * @classdesc Represents a WebFeatures. + * @implements IWebFeatures + * @constructor + * @param {proto.IWebFeatures=} [properties] Properties to set + */ + function WebFeatures(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * WebFeatures labelsDisplay. + * @member {proto.WebFeatures.WebFeaturesFlag} labelsDisplay + * @memberof proto.WebFeatures + * @instance + */ + WebFeatures.prototype.labelsDisplay = 0; + + /** + * WebFeatures voipIndividualOutgoing. + * @member {proto.WebFeatures.WebFeaturesFlag} voipIndividualOutgoing + * @memberof proto.WebFeatures + * @instance + */ + WebFeatures.prototype.voipIndividualOutgoing = 0; + + /** + * WebFeatures groupsV3. + * @member {proto.WebFeatures.WebFeaturesFlag} groupsV3 + * @memberof proto.WebFeatures + * @instance + */ + WebFeatures.prototype.groupsV3 = 0; + + /** + * WebFeatures groupsV3Create. + * @member {proto.WebFeatures.WebFeaturesFlag} groupsV3Create + * @memberof proto.WebFeatures + * @instance + */ + WebFeatures.prototype.groupsV3Create = 0; + + /** + * WebFeatures changeNumberV2. + * @member {proto.WebFeatures.WebFeaturesFlag} changeNumberV2 + * @memberof proto.WebFeatures + * @instance + */ + WebFeatures.prototype.changeNumberV2 = 0; + + /** + * WebFeatures queryStatusV3Thumbnail. + * @member {proto.WebFeatures.WebFeaturesFlag} queryStatusV3Thumbnail + * @memberof proto.WebFeatures + * @instance + */ + WebFeatures.prototype.queryStatusV3Thumbnail = 0; + + /** + * WebFeatures liveLocations. + * @member {proto.WebFeatures.WebFeaturesFlag} liveLocations + * @memberof proto.WebFeatures + * @instance + */ + WebFeatures.prototype.liveLocations = 0; + + /** + * WebFeatures queryVname. + * @member {proto.WebFeatures.WebFeaturesFlag} queryVname + * @memberof proto.WebFeatures + * @instance + */ + WebFeatures.prototype.queryVname = 0; + + /** + * WebFeatures voipIndividualIncoming. + * @member {proto.WebFeatures.WebFeaturesFlag} voipIndividualIncoming + * @memberof proto.WebFeatures + * @instance + */ + WebFeatures.prototype.voipIndividualIncoming = 0; + + /** + * WebFeatures quickRepliesQuery. + * @member {proto.WebFeatures.WebFeaturesFlag} quickRepliesQuery + * @memberof proto.WebFeatures + * @instance + */ + WebFeatures.prototype.quickRepliesQuery = 0; + + /** + * WebFeatures payments. + * @member {proto.WebFeatures.WebFeaturesFlag} payments + * @memberof proto.WebFeatures + * @instance + */ + WebFeatures.prototype.payments = 0; + + /** + * WebFeatures stickerPackQuery. + * @member {proto.WebFeatures.WebFeaturesFlag} stickerPackQuery + * @memberof proto.WebFeatures + * @instance + */ + WebFeatures.prototype.stickerPackQuery = 0; + + /** + * WebFeatures liveLocationsFinal. + * @member {proto.WebFeatures.WebFeaturesFlag} liveLocationsFinal + * @memberof proto.WebFeatures + * @instance + */ + WebFeatures.prototype.liveLocationsFinal = 0; + + /** + * WebFeatures labelsEdit. + * @member {proto.WebFeatures.WebFeaturesFlag} labelsEdit + * @memberof proto.WebFeatures + * @instance + */ + WebFeatures.prototype.labelsEdit = 0; + + /** + * WebFeatures mediaUpload. + * @member {proto.WebFeatures.WebFeaturesFlag} mediaUpload + * @memberof proto.WebFeatures + * @instance + */ + WebFeatures.prototype.mediaUpload = 0; + + /** + * WebFeatures mediaUploadRichQuickReplies. + * @member {proto.WebFeatures.WebFeaturesFlag} mediaUploadRichQuickReplies + * @memberof proto.WebFeatures + * @instance + */ + WebFeatures.prototype.mediaUploadRichQuickReplies = 0; + + /** + * WebFeatures vnameV2. + * @member {proto.WebFeatures.WebFeaturesFlag} vnameV2 + * @memberof proto.WebFeatures + * @instance + */ + WebFeatures.prototype.vnameV2 = 0; + + /** + * WebFeatures videoPlaybackUrl. + * @member {proto.WebFeatures.WebFeaturesFlag} videoPlaybackUrl + * @memberof proto.WebFeatures + * @instance + */ + WebFeatures.prototype.videoPlaybackUrl = 0; + + /** + * WebFeatures statusRanking. + * @member {proto.WebFeatures.WebFeaturesFlag} statusRanking + * @memberof proto.WebFeatures + * @instance + */ + WebFeatures.prototype.statusRanking = 0; + + /** + * WebFeatures voipIndividualVideo. + * @member {proto.WebFeatures.WebFeaturesFlag} voipIndividualVideo + * @memberof proto.WebFeatures + * @instance + */ + WebFeatures.prototype.voipIndividualVideo = 0; + + /** + * WebFeatures thirdPartyStickers. + * @member {proto.WebFeatures.WebFeaturesFlag} thirdPartyStickers + * @memberof proto.WebFeatures + * @instance + */ + WebFeatures.prototype.thirdPartyStickers = 0; + + /** + * WebFeatures frequentlyForwardedSetting. + * @member {proto.WebFeatures.WebFeaturesFlag} frequentlyForwardedSetting + * @memberof proto.WebFeatures + * @instance + */ + WebFeatures.prototype.frequentlyForwardedSetting = 0; + + /** + * WebFeatures groupsV4JoinPermission. + * @member {proto.WebFeatures.WebFeaturesFlag} groupsV4JoinPermission + * @memberof proto.WebFeatures + * @instance + */ + WebFeatures.prototype.groupsV4JoinPermission = 0; + + /** + * WebFeatures recentStickers. + * @member {proto.WebFeatures.WebFeaturesFlag} recentStickers + * @memberof proto.WebFeatures + * @instance + */ + WebFeatures.prototype.recentStickers = 0; + + /** + * WebFeatures catalog. + * @member {proto.WebFeatures.WebFeaturesFlag} catalog + * @memberof proto.WebFeatures + * @instance + */ + WebFeatures.prototype.catalog = 0; + + /** + * WebFeatures starredStickers. + * @member {proto.WebFeatures.WebFeaturesFlag} starredStickers + * @memberof proto.WebFeatures + * @instance + */ + WebFeatures.prototype.starredStickers = 0; + + /** + * WebFeatures voipGroupCall. + * @member {proto.WebFeatures.WebFeaturesFlag} voipGroupCall + * @memberof proto.WebFeatures + * @instance + */ + WebFeatures.prototype.voipGroupCall = 0; + + /** + * WebFeatures templateMessage. + * @member {proto.WebFeatures.WebFeaturesFlag} templateMessage + * @memberof proto.WebFeatures + * @instance + */ + WebFeatures.prototype.templateMessage = 0; + + /** + * WebFeatures templateMessageInteractivity. + * @member {proto.WebFeatures.WebFeaturesFlag} templateMessageInteractivity + * @memberof proto.WebFeatures + * @instance + */ + WebFeatures.prototype.templateMessageInteractivity = 0; + + /** + * WebFeatures ephemeralMessages. + * @member {proto.WebFeatures.WebFeaturesFlag} ephemeralMessages + * @memberof proto.WebFeatures + * @instance + */ + WebFeatures.prototype.ephemeralMessages = 0; + + /** + * WebFeatures e2ENotificationSync. + * @member {proto.WebFeatures.WebFeaturesFlag} e2ENotificationSync + * @memberof proto.WebFeatures + * @instance + */ + WebFeatures.prototype.e2ENotificationSync = 0; + + /** + * WebFeatures recentStickersV2. + * @member {proto.WebFeatures.WebFeaturesFlag} recentStickersV2 + * @memberof proto.WebFeatures + * @instance + */ + WebFeatures.prototype.recentStickersV2 = 0; + + /** + * WebFeatures recentStickersV3. + * @member {proto.WebFeatures.WebFeaturesFlag} recentStickersV3 + * @memberof proto.WebFeatures + * @instance + */ + WebFeatures.prototype.recentStickersV3 = 0; + + /** + * WebFeatures userNotice. + * @member {proto.WebFeatures.WebFeaturesFlag} userNotice + * @memberof proto.WebFeatures + * @instance + */ + WebFeatures.prototype.userNotice = 0; + + /** + * WebFeatures support. + * @member {proto.WebFeatures.WebFeaturesFlag} support + * @memberof proto.WebFeatures + * @instance + */ + WebFeatures.prototype.support = 0; + + /** + * WebFeatures groupUiiCleanup. + * @member {proto.WebFeatures.WebFeaturesFlag} groupUiiCleanup + * @memberof proto.WebFeatures + * @instance + */ + WebFeatures.prototype.groupUiiCleanup = 0; + + /** + * WebFeatures groupDogfoodingInternalOnly. + * @member {proto.WebFeatures.WebFeaturesFlag} groupDogfoodingInternalOnly + * @memberof proto.WebFeatures + * @instance + */ + WebFeatures.prototype.groupDogfoodingInternalOnly = 0; + + /** + * WebFeatures settingsSync. + * @member {proto.WebFeatures.WebFeaturesFlag} settingsSync + * @memberof proto.WebFeatures + * @instance + */ + WebFeatures.prototype.settingsSync = 0; + + /** + * WebFeatures archiveV2. + * @member {proto.WebFeatures.WebFeaturesFlag} archiveV2 + * @memberof proto.WebFeatures + * @instance + */ + WebFeatures.prototype.archiveV2 = 0; + + /** + * WebFeatures ephemeralAllowGroupMembers. + * @member {proto.WebFeatures.WebFeaturesFlag} ephemeralAllowGroupMembers + * @memberof proto.WebFeatures + * @instance + */ + WebFeatures.prototype.ephemeralAllowGroupMembers = 0; + + /** + * WebFeatures ephemeral24HDuration. + * @member {proto.WebFeatures.WebFeaturesFlag} ephemeral24HDuration + * @memberof proto.WebFeatures + * @instance + */ + WebFeatures.prototype.ephemeral24HDuration = 0; + + /** + * WebFeatures mdForceUpgrade. + * @member {proto.WebFeatures.WebFeaturesFlag} mdForceUpgrade + * @memberof proto.WebFeatures + * @instance + */ + WebFeatures.prototype.mdForceUpgrade = 0; + + /** + * WebFeatures disappearingMode. + * @member {proto.WebFeatures.WebFeaturesFlag} disappearingMode + * @memberof proto.WebFeatures + * @instance + */ + WebFeatures.prototype.disappearingMode = 0; + + /** + * WebFeatures externalMdOptInAvailable. + * @member {proto.WebFeatures.WebFeaturesFlag} externalMdOptInAvailable + * @memberof proto.WebFeatures + * @instance + */ + WebFeatures.prototype.externalMdOptInAvailable = 0; + + /** + * WebFeatures noDeleteMessageTimeLimit. + * @member {proto.WebFeatures.WebFeaturesFlag} noDeleteMessageTimeLimit + * @memberof proto.WebFeatures + * @instance + */ + WebFeatures.prototype.noDeleteMessageTimeLimit = 0; + + /** + * Creates a new WebFeatures instance using the specified properties. + * @function create + * @memberof proto.WebFeatures + * @static + * @param {proto.IWebFeatures=} [properties] Properties to set + * @returns {proto.WebFeatures} WebFeatures instance + */ + WebFeatures.create = function create(properties) { + return new WebFeatures(properties); + }; + + /** + * Encodes the specified WebFeatures message. Does not implicitly {@link proto.WebFeatures.verify|verify} messages. + * @function encode + * @memberof proto.WebFeatures + * @static + * @param {proto.IWebFeatures} message WebFeatures message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WebFeatures.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.labelsDisplay != null && Object.hasOwnProperty.call(message, "labelsDisplay")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.labelsDisplay); + if (message.voipIndividualOutgoing != null && Object.hasOwnProperty.call(message, "voipIndividualOutgoing")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.voipIndividualOutgoing); + if (message.groupsV3 != null && Object.hasOwnProperty.call(message, "groupsV3")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.groupsV3); + if (message.groupsV3Create != null && Object.hasOwnProperty.call(message, "groupsV3Create")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.groupsV3Create); + if (message.changeNumberV2 != null && Object.hasOwnProperty.call(message, "changeNumberV2")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.changeNumberV2); + if (message.queryStatusV3Thumbnail != null && Object.hasOwnProperty.call(message, "queryStatusV3Thumbnail")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.queryStatusV3Thumbnail); + if (message.liveLocations != null && Object.hasOwnProperty.call(message, "liveLocations")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.liveLocations); + if (message.queryVname != null && Object.hasOwnProperty.call(message, "queryVname")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.queryVname); + if (message.voipIndividualIncoming != null && Object.hasOwnProperty.call(message, "voipIndividualIncoming")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.voipIndividualIncoming); + if (message.quickRepliesQuery != null && Object.hasOwnProperty.call(message, "quickRepliesQuery")) + writer.uint32(/* id 10, wireType 0 =*/80).int32(message.quickRepliesQuery); + if (message.payments != null && Object.hasOwnProperty.call(message, "payments")) + writer.uint32(/* id 11, wireType 0 =*/88).int32(message.payments); + if (message.stickerPackQuery != null && Object.hasOwnProperty.call(message, "stickerPackQuery")) + writer.uint32(/* id 12, wireType 0 =*/96).int32(message.stickerPackQuery); + if (message.liveLocationsFinal != null && Object.hasOwnProperty.call(message, "liveLocationsFinal")) + writer.uint32(/* id 13, wireType 0 =*/104).int32(message.liveLocationsFinal); + if (message.labelsEdit != null && Object.hasOwnProperty.call(message, "labelsEdit")) + writer.uint32(/* id 14, wireType 0 =*/112).int32(message.labelsEdit); + if (message.mediaUpload != null && Object.hasOwnProperty.call(message, "mediaUpload")) + writer.uint32(/* id 15, wireType 0 =*/120).int32(message.mediaUpload); + if (message.mediaUploadRichQuickReplies != null && Object.hasOwnProperty.call(message, "mediaUploadRichQuickReplies")) + writer.uint32(/* id 18, wireType 0 =*/144).int32(message.mediaUploadRichQuickReplies); + if (message.vnameV2 != null && Object.hasOwnProperty.call(message, "vnameV2")) + writer.uint32(/* id 19, wireType 0 =*/152).int32(message.vnameV2); + if (message.videoPlaybackUrl != null && Object.hasOwnProperty.call(message, "videoPlaybackUrl")) + writer.uint32(/* id 20, wireType 0 =*/160).int32(message.videoPlaybackUrl); + if (message.statusRanking != null && Object.hasOwnProperty.call(message, "statusRanking")) + writer.uint32(/* id 21, wireType 0 =*/168).int32(message.statusRanking); + if (message.voipIndividualVideo != null && Object.hasOwnProperty.call(message, "voipIndividualVideo")) + writer.uint32(/* id 22, wireType 0 =*/176).int32(message.voipIndividualVideo); + if (message.thirdPartyStickers != null && Object.hasOwnProperty.call(message, "thirdPartyStickers")) + writer.uint32(/* id 23, wireType 0 =*/184).int32(message.thirdPartyStickers); + if (message.frequentlyForwardedSetting != null && Object.hasOwnProperty.call(message, "frequentlyForwardedSetting")) + writer.uint32(/* id 24, wireType 0 =*/192).int32(message.frequentlyForwardedSetting); + if (message.groupsV4JoinPermission != null && Object.hasOwnProperty.call(message, "groupsV4JoinPermission")) + writer.uint32(/* id 25, wireType 0 =*/200).int32(message.groupsV4JoinPermission); + if (message.recentStickers != null && Object.hasOwnProperty.call(message, "recentStickers")) + writer.uint32(/* id 26, wireType 0 =*/208).int32(message.recentStickers); + if (message.catalog != null && Object.hasOwnProperty.call(message, "catalog")) + writer.uint32(/* id 27, wireType 0 =*/216).int32(message.catalog); + if (message.starredStickers != null && Object.hasOwnProperty.call(message, "starredStickers")) + writer.uint32(/* id 28, wireType 0 =*/224).int32(message.starredStickers); + if (message.voipGroupCall != null && Object.hasOwnProperty.call(message, "voipGroupCall")) + writer.uint32(/* id 29, wireType 0 =*/232).int32(message.voipGroupCall); + if (message.templateMessage != null && Object.hasOwnProperty.call(message, "templateMessage")) + writer.uint32(/* id 30, wireType 0 =*/240).int32(message.templateMessage); + if (message.templateMessageInteractivity != null && Object.hasOwnProperty.call(message, "templateMessageInteractivity")) + writer.uint32(/* id 31, wireType 0 =*/248).int32(message.templateMessageInteractivity); + if (message.ephemeralMessages != null && Object.hasOwnProperty.call(message, "ephemeralMessages")) + writer.uint32(/* id 32, wireType 0 =*/256).int32(message.ephemeralMessages); + if (message.e2ENotificationSync != null && Object.hasOwnProperty.call(message, "e2ENotificationSync")) + writer.uint32(/* id 33, wireType 0 =*/264).int32(message.e2ENotificationSync); + if (message.recentStickersV2 != null && Object.hasOwnProperty.call(message, "recentStickersV2")) + writer.uint32(/* id 34, wireType 0 =*/272).int32(message.recentStickersV2); + if (message.recentStickersV3 != null && Object.hasOwnProperty.call(message, "recentStickersV3")) + writer.uint32(/* id 36, wireType 0 =*/288).int32(message.recentStickersV3); + if (message.userNotice != null && Object.hasOwnProperty.call(message, "userNotice")) + writer.uint32(/* id 37, wireType 0 =*/296).int32(message.userNotice); + if (message.support != null && Object.hasOwnProperty.call(message, "support")) + writer.uint32(/* id 39, wireType 0 =*/312).int32(message.support); + if (message.groupUiiCleanup != null && Object.hasOwnProperty.call(message, "groupUiiCleanup")) + writer.uint32(/* id 40, wireType 0 =*/320).int32(message.groupUiiCleanup); + if (message.groupDogfoodingInternalOnly != null && Object.hasOwnProperty.call(message, "groupDogfoodingInternalOnly")) + writer.uint32(/* id 41, wireType 0 =*/328).int32(message.groupDogfoodingInternalOnly); + if (message.settingsSync != null && Object.hasOwnProperty.call(message, "settingsSync")) + writer.uint32(/* id 42, wireType 0 =*/336).int32(message.settingsSync); + if (message.archiveV2 != null && Object.hasOwnProperty.call(message, "archiveV2")) + writer.uint32(/* id 43, wireType 0 =*/344).int32(message.archiveV2); + if (message.ephemeralAllowGroupMembers != null && Object.hasOwnProperty.call(message, "ephemeralAllowGroupMembers")) + writer.uint32(/* id 44, wireType 0 =*/352).int32(message.ephemeralAllowGroupMembers); + if (message.ephemeral24HDuration != null && Object.hasOwnProperty.call(message, "ephemeral24HDuration")) + writer.uint32(/* id 45, wireType 0 =*/360).int32(message.ephemeral24HDuration); + if (message.mdForceUpgrade != null && Object.hasOwnProperty.call(message, "mdForceUpgrade")) + writer.uint32(/* id 46, wireType 0 =*/368).int32(message.mdForceUpgrade); + if (message.disappearingMode != null && Object.hasOwnProperty.call(message, "disappearingMode")) + writer.uint32(/* id 47, wireType 0 =*/376).int32(message.disappearingMode); + if (message.externalMdOptInAvailable != null && Object.hasOwnProperty.call(message, "externalMdOptInAvailable")) + writer.uint32(/* id 48, wireType 0 =*/384).int32(message.externalMdOptInAvailable); + if (message.noDeleteMessageTimeLimit != null && Object.hasOwnProperty.call(message, "noDeleteMessageTimeLimit")) + writer.uint32(/* id 49, wireType 0 =*/392).int32(message.noDeleteMessageTimeLimit); + return writer; + }; + + /** + * Encodes the specified WebFeatures message, length delimited. Does not implicitly {@link proto.WebFeatures.verify|verify} messages. + * @function encodeDelimited + * @memberof proto.WebFeatures + * @static + * @param {proto.IWebFeatures} message WebFeatures message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WebFeatures.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WebFeatures message from the specified reader or buffer. + * @function decode + * @memberof proto.WebFeatures + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {proto.WebFeatures} WebFeatures + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WebFeatures.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.WebFeatures(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.labelsDisplay = reader.int32(); + break; + case 2: + message.voipIndividualOutgoing = reader.int32(); + break; + case 3: + message.groupsV3 = reader.int32(); + break; + case 4: + message.groupsV3Create = reader.int32(); + break; + case 5: + message.changeNumberV2 = reader.int32(); + break; + case 6: + message.queryStatusV3Thumbnail = reader.int32(); + break; + case 7: + message.liveLocations = reader.int32(); + break; + case 8: + message.queryVname = reader.int32(); + break; + case 9: + message.voipIndividualIncoming = reader.int32(); + break; + case 10: + message.quickRepliesQuery = reader.int32(); + break; + case 11: + message.payments = reader.int32(); + break; + case 12: + message.stickerPackQuery = reader.int32(); + break; + case 13: + message.liveLocationsFinal = reader.int32(); + break; + case 14: + message.labelsEdit = reader.int32(); + break; + case 15: + message.mediaUpload = reader.int32(); + break; + case 18: + message.mediaUploadRichQuickReplies = reader.int32(); + break; + case 19: + message.vnameV2 = reader.int32(); + break; + case 20: + message.videoPlaybackUrl = reader.int32(); + break; + case 21: + message.statusRanking = reader.int32(); + break; + case 22: + message.voipIndividualVideo = reader.int32(); + break; + case 23: + message.thirdPartyStickers = reader.int32(); + break; + case 24: + message.frequentlyForwardedSetting = reader.int32(); + break; + case 25: + message.groupsV4JoinPermission = reader.int32(); + break; + case 26: + message.recentStickers = reader.int32(); + break; + case 27: + message.catalog = reader.int32(); + break; + case 28: + message.starredStickers = reader.int32(); + break; + case 29: + message.voipGroupCall = reader.int32(); + break; + case 30: + message.templateMessage = reader.int32(); + break; + case 31: + message.templateMessageInteractivity = reader.int32(); + break; + case 32: + message.ephemeralMessages = reader.int32(); + break; + case 33: + message.e2ENotificationSync = reader.int32(); + break; + case 34: + message.recentStickersV2 = reader.int32(); + break; + case 36: + message.recentStickersV3 = reader.int32(); + break; + case 37: + message.userNotice = reader.int32(); + break; + case 39: + message.support = reader.int32(); + break; + case 40: + message.groupUiiCleanup = reader.int32(); + break; + case 41: + message.groupDogfoodingInternalOnly = reader.int32(); + break; + case 42: + message.settingsSync = reader.int32(); + break; + case 43: + message.archiveV2 = reader.int32(); + break; + case 44: + message.ephemeralAllowGroupMembers = reader.int32(); + break; + case 45: + message.ephemeral24HDuration = reader.int32(); + break; + case 46: + message.mdForceUpgrade = reader.int32(); + break; + case 47: + message.disappearingMode = reader.int32(); + break; + case 48: + message.externalMdOptInAvailable = reader.int32(); + break; + case 49: + message.noDeleteMessageTimeLimit = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WebFeatures message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof proto.WebFeatures + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {proto.WebFeatures} WebFeatures + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WebFeatures.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WebFeatures message. + * @function verify + * @memberof proto.WebFeatures + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WebFeatures.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.labelsDisplay != null && message.hasOwnProperty("labelsDisplay")) + switch (message.labelsDisplay) { + default: + return "labelsDisplay: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.voipIndividualOutgoing != null && message.hasOwnProperty("voipIndividualOutgoing")) + switch (message.voipIndividualOutgoing) { + default: + return "voipIndividualOutgoing: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.groupsV3 != null && message.hasOwnProperty("groupsV3")) + switch (message.groupsV3) { + default: + return "groupsV3: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.groupsV3Create != null && message.hasOwnProperty("groupsV3Create")) + switch (message.groupsV3Create) { + default: + return "groupsV3Create: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.changeNumberV2 != null && message.hasOwnProperty("changeNumberV2")) + switch (message.changeNumberV2) { + default: + return "changeNumberV2: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.queryStatusV3Thumbnail != null && message.hasOwnProperty("queryStatusV3Thumbnail")) + switch (message.queryStatusV3Thumbnail) { + default: + return "queryStatusV3Thumbnail: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.liveLocations != null && message.hasOwnProperty("liveLocations")) + switch (message.liveLocations) { + default: + return "liveLocations: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.queryVname != null && message.hasOwnProperty("queryVname")) + switch (message.queryVname) { + default: + return "queryVname: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.voipIndividualIncoming != null && message.hasOwnProperty("voipIndividualIncoming")) + switch (message.voipIndividualIncoming) { + default: + return "voipIndividualIncoming: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.quickRepliesQuery != null && message.hasOwnProperty("quickRepliesQuery")) + switch (message.quickRepliesQuery) { + default: + return "quickRepliesQuery: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.payments != null && message.hasOwnProperty("payments")) + switch (message.payments) { + default: + return "payments: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.stickerPackQuery != null && message.hasOwnProperty("stickerPackQuery")) + switch (message.stickerPackQuery) { + default: + return "stickerPackQuery: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.liveLocationsFinal != null && message.hasOwnProperty("liveLocationsFinal")) + switch (message.liveLocationsFinal) { + default: + return "liveLocationsFinal: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.labelsEdit != null && message.hasOwnProperty("labelsEdit")) + switch (message.labelsEdit) { + default: + return "labelsEdit: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.mediaUpload != null && message.hasOwnProperty("mediaUpload")) + switch (message.mediaUpload) { + default: + return "mediaUpload: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.mediaUploadRichQuickReplies != null && message.hasOwnProperty("mediaUploadRichQuickReplies")) + switch (message.mediaUploadRichQuickReplies) { + default: + return "mediaUploadRichQuickReplies: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.vnameV2 != null && message.hasOwnProperty("vnameV2")) + switch (message.vnameV2) { + default: + return "vnameV2: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.videoPlaybackUrl != null && message.hasOwnProperty("videoPlaybackUrl")) + switch (message.videoPlaybackUrl) { + default: + return "videoPlaybackUrl: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.statusRanking != null && message.hasOwnProperty("statusRanking")) + switch (message.statusRanking) { + default: + return "statusRanking: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.voipIndividualVideo != null && message.hasOwnProperty("voipIndividualVideo")) + switch (message.voipIndividualVideo) { + default: + return "voipIndividualVideo: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.thirdPartyStickers != null && message.hasOwnProperty("thirdPartyStickers")) + switch (message.thirdPartyStickers) { + default: + return "thirdPartyStickers: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.frequentlyForwardedSetting != null && message.hasOwnProperty("frequentlyForwardedSetting")) + switch (message.frequentlyForwardedSetting) { + default: + return "frequentlyForwardedSetting: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.groupsV4JoinPermission != null && message.hasOwnProperty("groupsV4JoinPermission")) + switch (message.groupsV4JoinPermission) { + default: + return "groupsV4JoinPermission: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.recentStickers != null && message.hasOwnProperty("recentStickers")) + switch (message.recentStickers) { + default: + return "recentStickers: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.catalog != null && message.hasOwnProperty("catalog")) + switch (message.catalog) { + default: + return "catalog: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.starredStickers != null && message.hasOwnProperty("starredStickers")) + switch (message.starredStickers) { + default: + return "starredStickers: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.voipGroupCall != null && message.hasOwnProperty("voipGroupCall")) + switch (message.voipGroupCall) { + default: + return "voipGroupCall: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.templateMessage != null && message.hasOwnProperty("templateMessage")) + switch (message.templateMessage) { + default: + return "templateMessage: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.templateMessageInteractivity != null && message.hasOwnProperty("templateMessageInteractivity")) + switch (message.templateMessageInteractivity) { + default: + return "templateMessageInteractivity: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.ephemeralMessages != null && message.hasOwnProperty("ephemeralMessages")) + switch (message.ephemeralMessages) { + default: + return "ephemeralMessages: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.e2ENotificationSync != null && message.hasOwnProperty("e2ENotificationSync")) + switch (message.e2ENotificationSync) { + default: + return "e2ENotificationSync: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.recentStickersV2 != null && message.hasOwnProperty("recentStickersV2")) + switch (message.recentStickersV2) { + default: + return "recentStickersV2: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.recentStickersV3 != null && message.hasOwnProperty("recentStickersV3")) + switch (message.recentStickersV3) { + default: + return "recentStickersV3: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.userNotice != null && message.hasOwnProperty("userNotice")) + switch (message.userNotice) { + default: + return "userNotice: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.support != null && message.hasOwnProperty("support")) + switch (message.support) { + default: + return "support: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.groupUiiCleanup != null && message.hasOwnProperty("groupUiiCleanup")) + switch (message.groupUiiCleanup) { + default: + return "groupUiiCleanup: enum value expected"; + case 0: + case 1: case 2: - message.amount1000 = reader.uint64(); - break; case 3: - message.receiverJid = reader.string(); - break; - case 4: - message.status = reader.int32(); - break; - case 5: - message.transactionTimestamp = reader.uint64(); break; - case 6: - message.requestMessageKey = $root.proto.MessageKey.decode(reader, reader.uint32()); + } + if (message.groupDogfoodingInternalOnly != null && message.hasOwnProperty("groupDogfoodingInternalOnly")) + switch (message.groupDogfoodingInternalOnly) { + default: + return "groupDogfoodingInternalOnly: enum value expected"; + case 0: + case 1: + case 2: + case 3: break; - case 7: - message.expiryTimestamp = reader.uint64(); + } + if (message.settingsSync != null && message.hasOwnProperty("settingsSync")) + switch (message.settingsSync) { + default: + return "settingsSync: enum value expected"; + case 0: + case 1: + case 2: + case 3: break; - case 8: - message.futureproofed = reader.bool(); + } + if (message.archiveV2 != null && message.hasOwnProperty("archiveV2")) + switch (message.archiveV2) { + default: + return "archiveV2: enum value expected"; + case 0: + case 1: + case 2: + case 3: break; - case 9: - message.currency = reader.string(); + } + if (message.ephemeralAllowGroupMembers != null && message.hasOwnProperty("ephemeralAllowGroupMembers")) + switch (message.ephemeralAllowGroupMembers) { + default: + return "ephemeralAllowGroupMembers: enum value expected"; + case 0: + case 1: + case 2: + case 3: break; - case 10: - message.txnStatus = reader.int32(); + } + if (message.ephemeral24HDuration != null && message.hasOwnProperty("ephemeral24HDuration")) + switch (message.ephemeral24HDuration) { + default: + return "ephemeral24HDuration: enum value expected"; + case 0: + case 1: + case 2: + case 3: break; - case 11: - message.useNoviFiatFormat = reader.bool(); + } + if (message.mdForceUpgrade != null && message.hasOwnProperty("mdForceUpgrade")) + switch (message.mdForceUpgrade) { + default: + return "mdForceUpgrade: enum value expected"; + case 0: + case 1: + case 2: + case 3: break; - case 12: - message.primaryAmount = $root.proto.Money.decode(reader, reader.uint32()); + } + if (message.disappearingMode != null && message.hasOwnProperty("disappearingMode")) + switch (message.disappearingMode) { + default: + return "disappearingMode: enum value expected"; + case 0: + case 1: + case 2: + case 3: break; - case 13: - message.exchangeAmount = $root.proto.Money.decode(reader, reader.uint32()); + } + if (message.externalMdOptInAvailable != null && message.hasOwnProperty("externalMdOptInAvailable")) + switch (message.externalMdOptInAvailable) { + default: + return "externalMdOptInAvailable: enum value expected"; + case 0: + case 1: + case 2: + case 3: break; + } + if (message.noDeleteMessageTimeLimit != null && message.hasOwnProperty("noDeleteMessageTimeLimit")) + switch (message.noDeleteMessageTimeLimit) { default: - reader.skipType(tag & 7); + return "noDeleteMessageTimeLimit: enum value expected"; + case 0: + case 1: + case 2: + case 3: break; } + return null; + }; + + /** + * Creates a WebFeatures message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof proto.WebFeatures + * @static + * @param {Object.} object Plain object + * @returns {proto.WebFeatures} WebFeatures + */ + WebFeatures.fromObject = function fromObject(object) { + if (object instanceof $root.proto.WebFeatures) + return object; + var message = new $root.proto.WebFeatures(); + switch (object.labelsDisplay) { + case "NOT_STARTED": + case 0: + message.labelsDisplay = 0; + break; + case "FORCE_UPGRADE": + case 1: + message.labelsDisplay = 1; + break; + case "DEVELOPMENT": + case 2: + message.labelsDisplay = 2; + break; + case "PRODUCTION": + case 3: + message.labelsDisplay = 3; + break; + } + switch (object.voipIndividualOutgoing) { + case "NOT_STARTED": + case 0: + message.voipIndividualOutgoing = 0; + break; + case "FORCE_UPGRADE": + case 1: + message.voipIndividualOutgoing = 1; + break; + case "DEVELOPMENT": + case 2: + message.voipIndividualOutgoing = 2; + break; + case "PRODUCTION": + case 3: + message.voipIndividualOutgoing = 3; + break; + } + switch (object.groupsV3) { + case "NOT_STARTED": + case 0: + message.groupsV3 = 0; + break; + case "FORCE_UPGRADE": + case 1: + message.groupsV3 = 1; + break; + case "DEVELOPMENT": + case 2: + message.groupsV3 = 2; + break; + case "PRODUCTION": + case 3: + message.groupsV3 = 3; + break; + } + switch (object.groupsV3Create) { + case "NOT_STARTED": + case 0: + message.groupsV3Create = 0; + break; + case "FORCE_UPGRADE": + case 1: + message.groupsV3Create = 1; + break; + case "DEVELOPMENT": + case 2: + message.groupsV3Create = 2; + break; + case "PRODUCTION": + case 3: + message.groupsV3Create = 3; + break; + } + switch (object.changeNumberV2) { + case "NOT_STARTED": + case 0: + message.changeNumberV2 = 0; + break; + case "FORCE_UPGRADE": + case 1: + message.changeNumberV2 = 1; + break; + case "DEVELOPMENT": + case 2: + message.changeNumberV2 = 2; + break; + case "PRODUCTION": + case 3: + message.changeNumberV2 = 3; + break; + } + switch (object.queryStatusV3Thumbnail) { + case "NOT_STARTED": + case 0: + message.queryStatusV3Thumbnail = 0; + break; + case "FORCE_UPGRADE": + case 1: + message.queryStatusV3Thumbnail = 1; + break; + case "DEVELOPMENT": + case 2: + message.queryStatusV3Thumbnail = 2; + break; + case "PRODUCTION": + case 3: + message.queryStatusV3Thumbnail = 3; + break; + } + switch (object.liveLocations) { + case "NOT_STARTED": + case 0: + message.liveLocations = 0; + break; + case "FORCE_UPGRADE": + case 1: + message.liveLocations = 1; + break; + case "DEVELOPMENT": + case 2: + message.liveLocations = 2; + break; + case "PRODUCTION": + case 3: + message.liveLocations = 3; + break; + } + switch (object.queryVname) { + case "NOT_STARTED": + case 0: + message.queryVname = 0; + break; + case "FORCE_UPGRADE": + case 1: + message.queryVname = 1; + break; + case "DEVELOPMENT": + case 2: + message.queryVname = 2; + break; + case "PRODUCTION": + case 3: + message.queryVname = 3; + break; + } + switch (object.voipIndividualIncoming) { + case "NOT_STARTED": + case 0: + message.voipIndividualIncoming = 0; + break; + case "FORCE_UPGRADE": + case 1: + message.voipIndividualIncoming = 1; + break; + case "DEVELOPMENT": + case 2: + message.voipIndividualIncoming = 2; + break; + case "PRODUCTION": + case 3: + message.voipIndividualIncoming = 3; + break; + } + switch (object.quickRepliesQuery) { + case "NOT_STARTED": + case 0: + message.quickRepliesQuery = 0; + break; + case "FORCE_UPGRADE": + case 1: + message.quickRepliesQuery = 1; + break; + case "DEVELOPMENT": + case 2: + message.quickRepliesQuery = 2; + break; + case "PRODUCTION": + case 3: + message.quickRepliesQuery = 3; + break; + } + switch (object.payments) { + case "NOT_STARTED": + case 0: + message.payments = 0; + break; + case "FORCE_UPGRADE": + case 1: + message.payments = 1; + break; + case "DEVELOPMENT": + case 2: + message.payments = 2; + break; + case "PRODUCTION": + case 3: + message.payments = 3; + break; + } + switch (object.stickerPackQuery) { + case "NOT_STARTED": + case 0: + message.stickerPackQuery = 0; + break; + case "FORCE_UPGRADE": + case 1: + message.stickerPackQuery = 1; + break; + case "DEVELOPMENT": + case 2: + message.stickerPackQuery = 2; + break; + case "PRODUCTION": + case 3: + message.stickerPackQuery = 3; + break; + } + switch (object.liveLocationsFinal) { + case "NOT_STARTED": + case 0: + message.liveLocationsFinal = 0; + break; + case "FORCE_UPGRADE": + case 1: + message.liveLocationsFinal = 1; + break; + case "DEVELOPMENT": + case 2: + message.liveLocationsFinal = 2; + break; + case "PRODUCTION": + case 3: + message.liveLocationsFinal = 3; + break; + } + switch (object.labelsEdit) { + case "NOT_STARTED": + case 0: + message.labelsEdit = 0; + break; + case "FORCE_UPGRADE": + case 1: + message.labelsEdit = 1; + break; + case "DEVELOPMENT": + case 2: + message.labelsEdit = 2; + break; + case "PRODUCTION": + case 3: + message.labelsEdit = 3; + break; + } + switch (object.mediaUpload) { + case "NOT_STARTED": + case 0: + message.mediaUpload = 0; + break; + case "FORCE_UPGRADE": + case 1: + message.mediaUpload = 1; + break; + case "DEVELOPMENT": + case 2: + message.mediaUpload = 2; + break; + case "PRODUCTION": + case 3: + message.mediaUpload = 3; + break; + } + switch (object.mediaUploadRichQuickReplies) { + case "NOT_STARTED": + case 0: + message.mediaUploadRichQuickReplies = 0; + break; + case "FORCE_UPGRADE": + case 1: + message.mediaUploadRichQuickReplies = 1; + break; + case "DEVELOPMENT": + case 2: + message.mediaUploadRichQuickReplies = 2; + break; + case "PRODUCTION": + case 3: + message.mediaUploadRichQuickReplies = 3; + break; + } + switch (object.vnameV2) { + case "NOT_STARTED": + case 0: + message.vnameV2 = 0; + break; + case "FORCE_UPGRADE": + case 1: + message.vnameV2 = 1; + break; + case "DEVELOPMENT": + case 2: + message.vnameV2 = 2; + break; + case "PRODUCTION": + case 3: + message.vnameV2 = 3; + break; + } + switch (object.videoPlaybackUrl) { + case "NOT_STARTED": + case 0: + message.videoPlaybackUrl = 0; + break; + case "FORCE_UPGRADE": + case 1: + message.videoPlaybackUrl = 1; + break; + case "DEVELOPMENT": + case 2: + message.videoPlaybackUrl = 2; + break; + case "PRODUCTION": + case 3: + message.videoPlaybackUrl = 3; + break; + } + switch (object.statusRanking) { + case "NOT_STARTED": + case 0: + message.statusRanking = 0; + break; + case "FORCE_UPGRADE": + case 1: + message.statusRanking = 1; + break; + case "DEVELOPMENT": + case 2: + message.statusRanking = 2; + break; + case "PRODUCTION": + case 3: + message.statusRanking = 3; + break; + } + switch (object.voipIndividualVideo) { + case "NOT_STARTED": + case 0: + message.voipIndividualVideo = 0; + break; + case "FORCE_UPGRADE": + case 1: + message.voipIndividualVideo = 1; + break; + case "DEVELOPMENT": + case 2: + message.voipIndividualVideo = 2; + break; + case "PRODUCTION": + case 3: + message.voipIndividualVideo = 3; + break; + } + switch (object.thirdPartyStickers) { + case "NOT_STARTED": + case 0: + message.thirdPartyStickers = 0; + break; + case "FORCE_UPGRADE": + case 1: + message.thirdPartyStickers = 1; + break; + case "DEVELOPMENT": + case 2: + message.thirdPartyStickers = 2; + break; + case "PRODUCTION": + case 3: + message.thirdPartyStickers = 3; + break; + } + switch (object.frequentlyForwardedSetting) { + case "NOT_STARTED": + case 0: + message.frequentlyForwardedSetting = 0; + break; + case "FORCE_UPGRADE": + case 1: + message.frequentlyForwardedSetting = 1; + break; + case "DEVELOPMENT": + case 2: + message.frequentlyForwardedSetting = 2; + break; + case "PRODUCTION": + case 3: + message.frequentlyForwardedSetting = 3; + break; } - return message; - }; - - /** - * Decodes a PaymentInfo message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof proto.PaymentInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {proto.PaymentInfo} PaymentInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PaymentInfo.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PaymentInfo message. - * @function verify - * @memberof proto.PaymentInfo - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PaymentInfo.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.currencyDeprecated != null && message.hasOwnProperty("currencyDeprecated")) - switch (message.currencyDeprecated) { - default: - return "currencyDeprecated: enum value expected"; - case 0: - case 1: - break; - } - if (message.amount1000 != null && message.hasOwnProperty("amount1000")) - if (!$util.isInteger(message.amount1000) && !(message.amount1000 && $util.isInteger(message.amount1000.low) && $util.isInteger(message.amount1000.high))) - return "amount1000: integer|Long expected"; - if (message.receiverJid != null && message.hasOwnProperty("receiverJid")) - if (!$util.isString(message.receiverJid)) - return "receiverJid: string expected"; - if (message.status != null && message.hasOwnProperty("status")) - switch (message.status) { - default: - return "status: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - case 8: - case 9: - case 10: - case 11: - break; - } - if (message.transactionTimestamp != null && message.hasOwnProperty("transactionTimestamp")) - if (!$util.isInteger(message.transactionTimestamp) && !(message.transactionTimestamp && $util.isInteger(message.transactionTimestamp.low) && $util.isInteger(message.transactionTimestamp.high))) - return "transactionTimestamp: integer|Long expected"; - if (message.requestMessageKey != null && message.hasOwnProperty("requestMessageKey")) { - var error = $root.proto.MessageKey.verify(message.requestMessageKey); - if (error) - return "requestMessageKey." + error; + switch (object.groupsV4JoinPermission) { + case "NOT_STARTED": + case 0: + message.groupsV4JoinPermission = 0; + break; + case "FORCE_UPGRADE": + case 1: + message.groupsV4JoinPermission = 1; + break; + case "DEVELOPMENT": + case 2: + message.groupsV4JoinPermission = 2; + break; + case "PRODUCTION": + case 3: + message.groupsV4JoinPermission = 3; + break; } - if (message.expiryTimestamp != null && message.hasOwnProperty("expiryTimestamp")) - if (!$util.isInteger(message.expiryTimestamp) && !(message.expiryTimestamp && $util.isInteger(message.expiryTimestamp.low) && $util.isInteger(message.expiryTimestamp.high))) - return "expiryTimestamp: integer|Long expected"; - if (message.futureproofed != null && message.hasOwnProperty("futureproofed")) - if (typeof message.futureproofed !== "boolean") - return "futureproofed: boolean expected"; - if (message.currency != null && message.hasOwnProperty("currency")) - if (!$util.isString(message.currency)) - return "currency: string expected"; - if (message.txnStatus != null && message.hasOwnProperty("txnStatus")) - switch (message.txnStatus) { - default: - return "txnStatus: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - case 8: - case 9: - case 10: - case 11: - case 12: - case 13: - case 14: - case 15: - case 16: - case 17: - case 18: - case 19: - case 20: - case 21: - case 22: - case 23: - case 24: - case 25: - case 26: - case 27: - case 28: - break; - } - if (message.useNoviFiatFormat != null && message.hasOwnProperty("useNoviFiatFormat")) - if (typeof message.useNoviFiatFormat !== "boolean") - return "useNoviFiatFormat: boolean expected"; - if (message.primaryAmount != null && message.hasOwnProperty("primaryAmount")) { - var error = $root.proto.Money.verify(message.primaryAmount); - if (error) - return "primaryAmount." + error; + switch (object.recentStickers) { + case "NOT_STARTED": + case 0: + message.recentStickers = 0; + break; + case "FORCE_UPGRADE": + case 1: + message.recentStickers = 1; + break; + case "DEVELOPMENT": + case 2: + message.recentStickers = 2; + break; + case "PRODUCTION": + case 3: + message.recentStickers = 3; + break; } - if (message.exchangeAmount != null && message.hasOwnProperty("exchangeAmount")) { - var error = $root.proto.Money.verify(message.exchangeAmount); - if (error) - return "exchangeAmount." + error; + switch (object.catalog) { + case "NOT_STARTED": + case 0: + message.catalog = 0; + break; + case "FORCE_UPGRADE": + case 1: + message.catalog = 1; + break; + case "DEVELOPMENT": + case 2: + message.catalog = 2; + break; + case "PRODUCTION": + case 3: + message.catalog = 3; + break; } - return null; - }; - - /** - * Creates a PaymentInfo message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof proto.PaymentInfo - * @static - * @param {Object.} object Plain object - * @returns {proto.PaymentInfo} PaymentInfo - */ - PaymentInfo.fromObject = function fromObject(object) { - if (object instanceof $root.proto.PaymentInfo) - return object; - var message = new $root.proto.PaymentInfo(); - switch (object.currencyDeprecated) { - case "UNKNOWN_CURRENCY": + switch (object.starredStickers) { + case "NOT_STARTED": case 0: - message.currencyDeprecated = 0; + message.starredStickers = 0; break; - case "INR": + case "FORCE_UPGRADE": case 1: - message.currencyDeprecated = 1; + message.starredStickers = 1; + break; + case "DEVELOPMENT": + case 2: + message.starredStickers = 2; + break; + case "PRODUCTION": + case 3: + message.starredStickers = 3; break; } - if (object.amount1000 != null) - if ($util.Long) - (message.amount1000 = $util.Long.fromValue(object.amount1000)).unsigned = true; - else if (typeof object.amount1000 === "string") - message.amount1000 = parseInt(object.amount1000, 10); - else if (typeof object.amount1000 === "number") - message.amount1000 = object.amount1000; - else if (typeof object.amount1000 === "object") - message.amount1000 = new $util.LongBits(object.amount1000.low >>> 0, object.amount1000.high >>> 0).toNumber(true); - if (object.receiverJid != null) - message.receiverJid = String(object.receiverJid); - switch (object.status) { - case "UNKNOWN_STATUS": + switch (object.voipGroupCall) { + case "NOT_STARTED": case 0: - message.status = 0; + message.voipGroupCall = 0; break; - case "PROCESSING": + case "FORCE_UPGRADE": case 1: - message.status = 1; + message.voipGroupCall = 1; break; - case "SENT": + case "DEVELOPMENT": case 2: - message.status = 2; + message.voipGroupCall = 2; break; - case "NEED_TO_ACCEPT": + case "PRODUCTION": case 3: - message.status = 3; + message.voipGroupCall = 3; break; - case "COMPLETE": - case 4: - message.status = 4; + } + switch (object.templateMessage) { + case "NOT_STARTED": + case 0: + message.templateMessage = 0; break; - case "COULD_NOT_COMPLETE": - case 5: - message.status = 5; + case "FORCE_UPGRADE": + case 1: + message.templateMessage = 1; break; - case "REFUNDED": - case 6: - message.status = 6; + case "DEVELOPMENT": + case 2: + message.templateMessage = 2; break; - case "EXPIRED": - case 7: - message.status = 7; + case "PRODUCTION": + case 3: + message.templateMessage = 3; break; - case "REJECTED": - case 8: - message.status = 8; + } + switch (object.templateMessageInteractivity) { + case "NOT_STARTED": + case 0: + message.templateMessageInteractivity = 0; break; - case "CANCELLED": - case 9: - message.status = 9; + case "FORCE_UPGRADE": + case 1: + message.templateMessageInteractivity = 1; break; - case "WAITING_FOR_PAYER": - case 10: - message.status = 10; + case "DEVELOPMENT": + case 2: + message.templateMessageInteractivity = 2; break; - case "WAITING": - case 11: - message.status = 11; + case "PRODUCTION": + case 3: + message.templateMessageInteractivity = 3; break; } - if (object.transactionTimestamp != null) - if ($util.Long) - (message.transactionTimestamp = $util.Long.fromValue(object.transactionTimestamp)).unsigned = true; - else if (typeof object.transactionTimestamp === "string") - message.transactionTimestamp = parseInt(object.transactionTimestamp, 10); - else if (typeof object.transactionTimestamp === "number") - message.transactionTimestamp = object.transactionTimestamp; - else if (typeof object.transactionTimestamp === "object") - message.transactionTimestamp = new $util.LongBits(object.transactionTimestamp.low >>> 0, object.transactionTimestamp.high >>> 0).toNumber(true); - if (object.requestMessageKey != null) { - if (typeof object.requestMessageKey !== "object") - throw TypeError(".proto.PaymentInfo.requestMessageKey: object expected"); - message.requestMessageKey = $root.proto.MessageKey.fromObject(object.requestMessageKey); + switch (object.ephemeralMessages) { + case "NOT_STARTED": + case 0: + message.ephemeralMessages = 0; + break; + case "FORCE_UPGRADE": + case 1: + message.ephemeralMessages = 1; + break; + case "DEVELOPMENT": + case 2: + message.ephemeralMessages = 2; + break; + case "PRODUCTION": + case 3: + message.ephemeralMessages = 3; + break; } - if (object.expiryTimestamp != null) - if ($util.Long) - (message.expiryTimestamp = $util.Long.fromValue(object.expiryTimestamp)).unsigned = true; - else if (typeof object.expiryTimestamp === "string") - message.expiryTimestamp = parseInt(object.expiryTimestamp, 10); - else if (typeof object.expiryTimestamp === "number") - message.expiryTimestamp = object.expiryTimestamp; - else if (typeof object.expiryTimestamp === "object") - message.expiryTimestamp = new $util.LongBits(object.expiryTimestamp.low >>> 0, object.expiryTimestamp.high >>> 0).toNumber(true); - if (object.futureproofed != null) - message.futureproofed = Boolean(object.futureproofed); - if (object.currency != null) - message.currency = String(object.currency); - switch (object.txnStatus) { - case "UNKNOWN": + switch (object.e2ENotificationSync) { + case "NOT_STARTED": case 0: - message.txnStatus = 0; + message.e2ENotificationSync = 0; break; - case "PENDING_SETUP": + case "FORCE_UPGRADE": case 1: - message.txnStatus = 1; + message.e2ENotificationSync = 1; break; - case "PENDING_RECEIVER_SETUP": + case "DEVELOPMENT": case 2: - message.txnStatus = 2; + message.e2ENotificationSync = 2; break; - case "INIT": + case "PRODUCTION": case 3: - message.txnStatus = 3; + message.e2ENotificationSync = 3; break; - case "SUCCESS": - case 4: - message.txnStatus = 4; + } + switch (object.recentStickersV2) { + case "NOT_STARTED": + case 0: + message.recentStickersV2 = 0; break; - case "COMPLETED": - case 5: - message.txnStatus = 5; + case "FORCE_UPGRADE": + case 1: + message.recentStickersV2 = 1; break; - case "FAILED": - case 6: - message.txnStatus = 6; + case "DEVELOPMENT": + case 2: + message.recentStickersV2 = 2; + break; + case "PRODUCTION": + case 3: + message.recentStickersV2 = 3; + break; + } + switch (object.recentStickersV3) { + case "NOT_STARTED": + case 0: + message.recentStickersV3 = 0; + break; + case "FORCE_UPGRADE": + case 1: + message.recentStickersV3 = 1; + break; + case "DEVELOPMENT": + case 2: + message.recentStickersV3 = 2; + break; + case "PRODUCTION": + case 3: + message.recentStickersV3 = 3; + break; + } + switch (object.userNotice) { + case "NOT_STARTED": + case 0: + message.userNotice = 0; + break; + case "FORCE_UPGRADE": + case 1: + message.userNotice = 1; + break; + case "DEVELOPMENT": + case 2: + message.userNotice = 2; + break; + case "PRODUCTION": + case 3: + message.userNotice = 3; + break; + } + switch (object.support) { + case "NOT_STARTED": + case 0: + message.support = 0; + break; + case "FORCE_UPGRADE": + case 1: + message.support = 1; + break; + case "DEVELOPMENT": + case 2: + message.support = 2; + break; + case "PRODUCTION": + case 3: + message.support = 3; + break; + } + switch (object.groupUiiCleanup) { + case "NOT_STARTED": + case 0: + message.groupUiiCleanup = 0; + break; + case "FORCE_UPGRADE": + case 1: + message.groupUiiCleanup = 1; + break; + case "DEVELOPMENT": + case 2: + message.groupUiiCleanup = 2; + break; + case "PRODUCTION": + case 3: + message.groupUiiCleanup = 3; + break; + } + switch (object.groupDogfoodingInternalOnly) { + case "NOT_STARTED": + case 0: + message.groupDogfoodingInternalOnly = 0; + break; + case "FORCE_UPGRADE": + case 1: + message.groupDogfoodingInternalOnly = 1; + break; + case "DEVELOPMENT": + case 2: + message.groupDogfoodingInternalOnly = 2; + break; + case "PRODUCTION": + case 3: + message.groupDogfoodingInternalOnly = 3; + break; + } + switch (object.settingsSync) { + case "NOT_STARTED": + case 0: + message.settingsSync = 0; + break; + case "FORCE_UPGRADE": + case 1: + message.settingsSync = 1; + break; + case "DEVELOPMENT": + case 2: + message.settingsSync = 2; + break; + case "PRODUCTION": + case 3: + message.settingsSync = 3; + break; + } + switch (object.archiveV2) { + case "NOT_STARTED": + case 0: + message.archiveV2 = 0; + break; + case "FORCE_UPGRADE": + case 1: + message.archiveV2 = 1; + break; + case "DEVELOPMENT": + case 2: + message.archiveV2 = 2; + break; + case "PRODUCTION": + case 3: + message.archiveV2 = 3; + break; + } + switch (object.ephemeralAllowGroupMembers) { + case "NOT_STARTED": + case 0: + message.ephemeralAllowGroupMembers = 0; break; - case "FAILED_RISK": - case 7: - message.txnStatus = 7; + case "FORCE_UPGRADE": + case 1: + message.ephemeralAllowGroupMembers = 1; break; - case "FAILED_PROCESSING": - case 8: - message.txnStatus = 8; + case "DEVELOPMENT": + case 2: + message.ephemeralAllowGroupMembers = 2; break; - case "FAILED_RECEIVER_PROCESSING": - case 9: - message.txnStatus = 9; + case "PRODUCTION": + case 3: + message.ephemeralAllowGroupMembers = 3; break; - case "FAILED_DA": - case 10: - message.txnStatus = 10; + } + switch (object.ephemeral24HDuration) { + case "NOT_STARTED": + case 0: + message.ephemeral24HDuration = 0; break; - case "FAILED_DA_FINAL": - case 11: - message.txnStatus = 11; + case "FORCE_UPGRADE": + case 1: + message.ephemeral24HDuration = 1; break; - case "REFUNDED_TXN": - case 12: - message.txnStatus = 12; + case "DEVELOPMENT": + case 2: + message.ephemeral24HDuration = 2; break; - case "REFUND_FAILED": - case 13: - message.txnStatus = 13; + case "PRODUCTION": + case 3: + message.ephemeral24HDuration = 3; break; - case "REFUND_FAILED_PROCESSING": - case 14: - message.txnStatus = 14; + } + switch (object.mdForceUpgrade) { + case "NOT_STARTED": + case 0: + message.mdForceUpgrade = 0; break; - case "REFUND_FAILED_DA": - case 15: - message.txnStatus = 15; + case "FORCE_UPGRADE": + case 1: + message.mdForceUpgrade = 1; break; - case "EXPIRED_TXN": - case 16: - message.txnStatus = 16; + case "DEVELOPMENT": + case 2: + message.mdForceUpgrade = 2; break; - case "AUTH_CANCELED": - case 17: - message.txnStatus = 17; + case "PRODUCTION": + case 3: + message.mdForceUpgrade = 3; break; - case "AUTH_CANCEL_FAILED_PROCESSING": - case 18: - message.txnStatus = 18; + } + switch (object.disappearingMode) { + case "NOT_STARTED": + case 0: + message.disappearingMode = 0; break; - case "AUTH_CANCEL_FAILED": - case 19: - message.txnStatus = 19; + case "FORCE_UPGRADE": + case 1: + message.disappearingMode = 1; break; - case "COLLECT_INIT": - case 20: - message.txnStatus = 20; + case "DEVELOPMENT": + case 2: + message.disappearingMode = 2; break; - case "COLLECT_SUCCESS": - case 21: - message.txnStatus = 21; + case "PRODUCTION": + case 3: + message.disappearingMode = 3; break; - case "COLLECT_FAILED": - case 22: - message.txnStatus = 22; + } + switch (object.externalMdOptInAvailable) { + case "NOT_STARTED": + case 0: + message.externalMdOptInAvailable = 0; break; - case "COLLECT_FAILED_RISK": - case 23: - message.txnStatus = 23; + case "FORCE_UPGRADE": + case 1: + message.externalMdOptInAvailable = 1; break; - case "COLLECT_REJECTED": - case 24: - message.txnStatus = 24; + case "DEVELOPMENT": + case 2: + message.externalMdOptInAvailable = 2; break; - case "COLLECT_EXPIRED": - case 25: - message.txnStatus = 25; + case "PRODUCTION": + case 3: + message.externalMdOptInAvailable = 3; break; - case "COLLECT_CANCELED": - case 26: - message.txnStatus = 26; + } + switch (object.noDeleteMessageTimeLimit) { + case "NOT_STARTED": + case 0: + message.noDeleteMessageTimeLimit = 0; break; - case "COLLECT_CANCELLING": - case 27: - message.txnStatus = 27; + case "FORCE_UPGRADE": + case 1: + message.noDeleteMessageTimeLimit = 1; break; - case "IN_REVIEW": - case 28: - message.txnStatus = 28; + case "DEVELOPMENT": + case 2: + message.noDeleteMessageTimeLimit = 2; + break; + case "PRODUCTION": + case 3: + message.noDeleteMessageTimeLimit = 3; break; - } - if (object.useNoviFiatFormat != null) - message.useNoviFiatFormat = Boolean(object.useNoviFiatFormat); - if (object.primaryAmount != null) { - if (typeof object.primaryAmount !== "object") - throw TypeError(".proto.PaymentInfo.primaryAmount: object expected"); - message.primaryAmount = $root.proto.Money.fromObject(object.primaryAmount); - } - if (object.exchangeAmount != null) { - if (typeof object.exchangeAmount !== "object") - throw TypeError(".proto.PaymentInfo.exchangeAmount: object expected"); - message.exchangeAmount = $root.proto.Money.fromObject(object.exchangeAmount); } return message; }; /** - * Creates a plain object from a PaymentInfo message. Also converts values to other types if specified. + * Creates a plain object from a WebFeatures message. Also converts values to other types if specified. * @function toObject - * @memberof proto.PaymentInfo + * @memberof proto.WebFeatures * @static - * @param {proto.PaymentInfo} message PaymentInfo + * @param {proto.WebFeatures} message WebFeatures * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - PaymentInfo.toObject = function toObject(message, options) { + WebFeatures.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.currencyDeprecated = options.enums === String ? "UNKNOWN_CURRENCY" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.amount1000 = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.amount1000 = options.longs === String ? "0" : 0; - object.receiverJid = ""; - object.status = options.enums === String ? "UNKNOWN_STATUS" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.transactionTimestamp = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.transactionTimestamp = options.longs === String ? "0" : 0; - object.requestMessageKey = null; - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.expiryTimestamp = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.expiryTimestamp = options.longs === String ? "0" : 0; - object.futureproofed = false; - object.currency = ""; - object.txnStatus = options.enums === String ? "UNKNOWN" : 0; - object.useNoviFiatFormat = false; - object.primaryAmount = null; - object.exchangeAmount = null; + object.labelsDisplay = options.enums === String ? "NOT_STARTED" : 0; + object.voipIndividualOutgoing = options.enums === String ? "NOT_STARTED" : 0; + object.groupsV3 = options.enums === String ? "NOT_STARTED" : 0; + object.groupsV3Create = options.enums === String ? "NOT_STARTED" : 0; + object.changeNumberV2 = options.enums === String ? "NOT_STARTED" : 0; + object.queryStatusV3Thumbnail = options.enums === String ? "NOT_STARTED" : 0; + object.liveLocations = options.enums === String ? "NOT_STARTED" : 0; + object.queryVname = options.enums === String ? "NOT_STARTED" : 0; + object.voipIndividualIncoming = options.enums === String ? "NOT_STARTED" : 0; + object.quickRepliesQuery = options.enums === String ? "NOT_STARTED" : 0; + object.payments = options.enums === String ? "NOT_STARTED" : 0; + object.stickerPackQuery = options.enums === String ? "NOT_STARTED" : 0; + object.liveLocationsFinal = options.enums === String ? "NOT_STARTED" : 0; + object.labelsEdit = options.enums === String ? "NOT_STARTED" : 0; + object.mediaUpload = options.enums === String ? "NOT_STARTED" : 0; + object.mediaUploadRichQuickReplies = options.enums === String ? "NOT_STARTED" : 0; + object.vnameV2 = options.enums === String ? "NOT_STARTED" : 0; + object.videoPlaybackUrl = options.enums === String ? "NOT_STARTED" : 0; + object.statusRanking = options.enums === String ? "NOT_STARTED" : 0; + object.voipIndividualVideo = options.enums === String ? "NOT_STARTED" : 0; + object.thirdPartyStickers = options.enums === String ? "NOT_STARTED" : 0; + object.frequentlyForwardedSetting = options.enums === String ? "NOT_STARTED" : 0; + object.groupsV4JoinPermission = options.enums === String ? "NOT_STARTED" : 0; + object.recentStickers = options.enums === String ? "NOT_STARTED" : 0; + object.catalog = options.enums === String ? "NOT_STARTED" : 0; + object.starredStickers = options.enums === String ? "NOT_STARTED" : 0; + object.voipGroupCall = options.enums === String ? "NOT_STARTED" : 0; + object.templateMessage = options.enums === String ? "NOT_STARTED" : 0; + object.templateMessageInteractivity = options.enums === String ? "NOT_STARTED" : 0; + object.ephemeralMessages = options.enums === String ? "NOT_STARTED" : 0; + object.e2ENotificationSync = options.enums === String ? "NOT_STARTED" : 0; + object.recentStickersV2 = options.enums === String ? "NOT_STARTED" : 0; + object.recentStickersV3 = options.enums === String ? "NOT_STARTED" : 0; + object.userNotice = options.enums === String ? "NOT_STARTED" : 0; + object.support = options.enums === String ? "NOT_STARTED" : 0; + object.groupUiiCleanup = options.enums === String ? "NOT_STARTED" : 0; + object.groupDogfoodingInternalOnly = options.enums === String ? "NOT_STARTED" : 0; + object.settingsSync = options.enums === String ? "NOT_STARTED" : 0; + object.archiveV2 = options.enums === String ? "NOT_STARTED" : 0; + object.ephemeralAllowGroupMembers = options.enums === String ? "NOT_STARTED" : 0; + object.ephemeral24HDuration = options.enums === String ? "NOT_STARTED" : 0; + object.mdForceUpgrade = options.enums === String ? "NOT_STARTED" : 0; + object.disappearingMode = options.enums === String ? "NOT_STARTED" : 0; + object.externalMdOptInAvailable = options.enums === String ? "NOT_STARTED" : 0; + object.noDeleteMessageTimeLimit = options.enums === String ? "NOT_STARTED" : 0; } - if (message.currencyDeprecated != null && message.hasOwnProperty("currencyDeprecated")) - object.currencyDeprecated = options.enums === String ? $root.proto.PaymentInfo.PaymentInfoCurrency[message.currencyDeprecated] : message.currencyDeprecated; - if (message.amount1000 != null && message.hasOwnProperty("amount1000")) - if (typeof message.amount1000 === "number") - object.amount1000 = options.longs === String ? String(message.amount1000) : message.amount1000; - else - object.amount1000 = options.longs === String ? $util.Long.prototype.toString.call(message.amount1000) : options.longs === Number ? new $util.LongBits(message.amount1000.low >>> 0, message.amount1000.high >>> 0).toNumber(true) : message.amount1000; - if (message.receiverJid != null && message.hasOwnProperty("receiverJid")) - object.receiverJid = message.receiverJid; - if (message.status != null && message.hasOwnProperty("status")) - object.status = options.enums === String ? $root.proto.PaymentInfo.PaymentInfoStatus[message.status] : message.status; - if (message.transactionTimestamp != null && message.hasOwnProperty("transactionTimestamp")) - if (typeof message.transactionTimestamp === "number") - object.transactionTimestamp = options.longs === String ? String(message.transactionTimestamp) : message.transactionTimestamp; - else - object.transactionTimestamp = options.longs === String ? $util.Long.prototype.toString.call(message.transactionTimestamp) : options.longs === Number ? new $util.LongBits(message.transactionTimestamp.low >>> 0, message.transactionTimestamp.high >>> 0).toNumber(true) : message.transactionTimestamp; - if (message.requestMessageKey != null && message.hasOwnProperty("requestMessageKey")) - object.requestMessageKey = $root.proto.MessageKey.toObject(message.requestMessageKey, options); - if (message.expiryTimestamp != null && message.hasOwnProperty("expiryTimestamp")) - if (typeof message.expiryTimestamp === "number") - object.expiryTimestamp = options.longs === String ? String(message.expiryTimestamp) : message.expiryTimestamp; - else - object.expiryTimestamp = options.longs === String ? $util.Long.prototype.toString.call(message.expiryTimestamp) : options.longs === Number ? new $util.LongBits(message.expiryTimestamp.low >>> 0, message.expiryTimestamp.high >>> 0).toNumber(true) : message.expiryTimestamp; - if (message.futureproofed != null && message.hasOwnProperty("futureproofed")) - object.futureproofed = message.futureproofed; - if (message.currency != null && message.hasOwnProperty("currency")) - object.currency = message.currency; - if (message.txnStatus != null && message.hasOwnProperty("txnStatus")) - object.txnStatus = options.enums === String ? $root.proto.PaymentInfo.PaymentInfoTxnStatus[message.txnStatus] : message.txnStatus; - if (message.useNoviFiatFormat != null && message.hasOwnProperty("useNoviFiatFormat")) - object.useNoviFiatFormat = message.useNoviFiatFormat; - if (message.primaryAmount != null && message.hasOwnProperty("primaryAmount")) - object.primaryAmount = $root.proto.Money.toObject(message.primaryAmount, options); - if (message.exchangeAmount != null && message.hasOwnProperty("exchangeAmount")) - object.exchangeAmount = $root.proto.Money.toObject(message.exchangeAmount, options); + if (message.labelsDisplay != null && message.hasOwnProperty("labelsDisplay")) + object.labelsDisplay = options.enums === String ? $root.proto.WebFeatures.WebFeaturesFlag[message.labelsDisplay] : message.labelsDisplay; + if (message.voipIndividualOutgoing != null && message.hasOwnProperty("voipIndividualOutgoing")) + object.voipIndividualOutgoing = options.enums === String ? $root.proto.WebFeatures.WebFeaturesFlag[message.voipIndividualOutgoing] : message.voipIndividualOutgoing; + if (message.groupsV3 != null && message.hasOwnProperty("groupsV3")) + object.groupsV3 = options.enums === String ? $root.proto.WebFeatures.WebFeaturesFlag[message.groupsV3] : message.groupsV3; + if (message.groupsV3Create != null && message.hasOwnProperty("groupsV3Create")) + object.groupsV3Create = options.enums === String ? $root.proto.WebFeatures.WebFeaturesFlag[message.groupsV3Create] : message.groupsV3Create; + if (message.changeNumberV2 != null && message.hasOwnProperty("changeNumberV2")) + object.changeNumberV2 = options.enums === String ? $root.proto.WebFeatures.WebFeaturesFlag[message.changeNumberV2] : message.changeNumberV2; + if (message.queryStatusV3Thumbnail != null && message.hasOwnProperty("queryStatusV3Thumbnail")) + object.queryStatusV3Thumbnail = options.enums === String ? $root.proto.WebFeatures.WebFeaturesFlag[message.queryStatusV3Thumbnail] : message.queryStatusV3Thumbnail; + if (message.liveLocations != null && message.hasOwnProperty("liveLocations")) + object.liveLocations = options.enums === String ? $root.proto.WebFeatures.WebFeaturesFlag[message.liveLocations] : message.liveLocations; + if (message.queryVname != null && message.hasOwnProperty("queryVname")) + object.queryVname = options.enums === String ? $root.proto.WebFeatures.WebFeaturesFlag[message.queryVname] : message.queryVname; + if (message.voipIndividualIncoming != null && message.hasOwnProperty("voipIndividualIncoming")) + object.voipIndividualIncoming = options.enums === String ? $root.proto.WebFeatures.WebFeaturesFlag[message.voipIndividualIncoming] : message.voipIndividualIncoming; + if (message.quickRepliesQuery != null && message.hasOwnProperty("quickRepliesQuery")) + object.quickRepliesQuery = options.enums === String ? $root.proto.WebFeatures.WebFeaturesFlag[message.quickRepliesQuery] : message.quickRepliesQuery; + if (message.payments != null && message.hasOwnProperty("payments")) + object.payments = options.enums === String ? $root.proto.WebFeatures.WebFeaturesFlag[message.payments] : message.payments; + if (message.stickerPackQuery != null && message.hasOwnProperty("stickerPackQuery")) + object.stickerPackQuery = options.enums === String ? $root.proto.WebFeatures.WebFeaturesFlag[message.stickerPackQuery] : message.stickerPackQuery; + if (message.liveLocationsFinal != null && message.hasOwnProperty("liveLocationsFinal")) + object.liveLocationsFinal = options.enums === String ? $root.proto.WebFeatures.WebFeaturesFlag[message.liveLocationsFinal] : message.liveLocationsFinal; + if (message.labelsEdit != null && message.hasOwnProperty("labelsEdit")) + object.labelsEdit = options.enums === String ? $root.proto.WebFeatures.WebFeaturesFlag[message.labelsEdit] : message.labelsEdit; + if (message.mediaUpload != null && message.hasOwnProperty("mediaUpload")) + object.mediaUpload = options.enums === String ? $root.proto.WebFeatures.WebFeaturesFlag[message.mediaUpload] : message.mediaUpload; + if (message.mediaUploadRichQuickReplies != null && message.hasOwnProperty("mediaUploadRichQuickReplies")) + object.mediaUploadRichQuickReplies = options.enums === String ? $root.proto.WebFeatures.WebFeaturesFlag[message.mediaUploadRichQuickReplies] : message.mediaUploadRichQuickReplies; + if (message.vnameV2 != null && message.hasOwnProperty("vnameV2")) + object.vnameV2 = options.enums === String ? $root.proto.WebFeatures.WebFeaturesFlag[message.vnameV2] : message.vnameV2; + if (message.videoPlaybackUrl != null && message.hasOwnProperty("videoPlaybackUrl")) + object.videoPlaybackUrl = options.enums === String ? $root.proto.WebFeatures.WebFeaturesFlag[message.videoPlaybackUrl] : message.videoPlaybackUrl; + if (message.statusRanking != null && message.hasOwnProperty("statusRanking")) + object.statusRanking = options.enums === String ? $root.proto.WebFeatures.WebFeaturesFlag[message.statusRanking] : message.statusRanking; + if (message.voipIndividualVideo != null && message.hasOwnProperty("voipIndividualVideo")) + object.voipIndividualVideo = options.enums === String ? $root.proto.WebFeatures.WebFeaturesFlag[message.voipIndividualVideo] : message.voipIndividualVideo; + if (message.thirdPartyStickers != null && message.hasOwnProperty("thirdPartyStickers")) + object.thirdPartyStickers = options.enums === String ? $root.proto.WebFeatures.WebFeaturesFlag[message.thirdPartyStickers] : message.thirdPartyStickers; + if (message.frequentlyForwardedSetting != null && message.hasOwnProperty("frequentlyForwardedSetting")) + object.frequentlyForwardedSetting = options.enums === String ? $root.proto.WebFeatures.WebFeaturesFlag[message.frequentlyForwardedSetting] : message.frequentlyForwardedSetting; + if (message.groupsV4JoinPermission != null && message.hasOwnProperty("groupsV4JoinPermission")) + object.groupsV4JoinPermission = options.enums === String ? $root.proto.WebFeatures.WebFeaturesFlag[message.groupsV4JoinPermission] : message.groupsV4JoinPermission; + if (message.recentStickers != null && message.hasOwnProperty("recentStickers")) + object.recentStickers = options.enums === String ? $root.proto.WebFeatures.WebFeaturesFlag[message.recentStickers] : message.recentStickers; + if (message.catalog != null && message.hasOwnProperty("catalog")) + object.catalog = options.enums === String ? $root.proto.WebFeatures.WebFeaturesFlag[message.catalog] : message.catalog; + if (message.starredStickers != null && message.hasOwnProperty("starredStickers")) + object.starredStickers = options.enums === String ? $root.proto.WebFeatures.WebFeaturesFlag[message.starredStickers] : message.starredStickers; + if (message.voipGroupCall != null && message.hasOwnProperty("voipGroupCall")) + object.voipGroupCall = options.enums === String ? $root.proto.WebFeatures.WebFeaturesFlag[message.voipGroupCall] : message.voipGroupCall; + if (message.templateMessage != null && message.hasOwnProperty("templateMessage")) + object.templateMessage = options.enums === String ? $root.proto.WebFeatures.WebFeaturesFlag[message.templateMessage] : message.templateMessage; + if (message.templateMessageInteractivity != null && message.hasOwnProperty("templateMessageInteractivity")) + object.templateMessageInteractivity = options.enums === String ? $root.proto.WebFeatures.WebFeaturesFlag[message.templateMessageInteractivity] : message.templateMessageInteractivity; + if (message.ephemeralMessages != null && message.hasOwnProperty("ephemeralMessages")) + object.ephemeralMessages = options.enums === String ? $root.proto.WebFeatures.WebFeaturesFlag[message.ephemeralMessages] : message.ephemeralMessages; + if (message.e2ENotificationSync != null && message.hasOwnProperty("e2ENotificationSync")) + object.e2ENotificationSync = options.enums === String ? $root.proto.WebFeatures.WebFeaturesFlag[message.e2ENotificationSync] : message.e2ENotificationSync; + if (message.recentStickersV2 != null && message.hasOwnProperty("recentStickersV2")) + object.recentStickersV2 = options.enums === String ? $root.proto.WebFeatures.WebFeaturesFlag[message.recentStickersV2] : message.recentStickersV2; + if (message.recentStickersV3 != null && message.hasOwnProperty("recentStickersV3")) + object.recentStickersV3 = options.enums === String ? $root.proto.WebFeatures.WebFeaturesFlag[message.recentStickersV3] : message.recentStickersV3; + if (message.userNotice != null && message.hasOwnProperty("userNotice")) + object.userNotice = options.enums === String ? $root.proto.WebFeatures.WebFeaturesFlag[message.userNotice] : message.userNotice; + if (message.support != null && message.hasOwnProperty("support")) + object.support = options.enums === String ? $root.proto.WebFeatures.WebFeaturesFlag[message.support] : message.support; + if (message.groupUiiCleanup != null && message.hasOwnProperty("groupUiiCleanup")) + object.groupUiiCleanup = options.enums === String ? $root.proto.WebFeatures.WebFeaturesFlag[message.groupUiiCleanup] : message.groupUiiCleanup; + if (message.groupDogfoodingInternalOnly != null && message.hasOwnProperty("groupDogfoodingInternalOnly")) + object.groupDogfoodingInternalOnly = options.enums === String ? $root.proto.WebFeatures.WebFeaturesFlag[message.groupDogfoodingInternalOnly] : message.groupDogfoodingInternalOnly; + if (message.settingsSync != null && message.hasOwnProperty("settingsSync")) + object.settingsSync = options.enums === String ? $root.proto.WebFeatures.WebFeaturesFlag[message.settingsSync] : message.settingsSync; + if (message.archiveV2 != null && message.hasOwnProperty("archiveV2")) + object.archiveV2 = options.enums === String ? $root.proto.WebFeatures.WebFeaturesFlag[message.archiveV2] : message.archiveV2; + if (message.ephemeralAllowGroupMembers != null && message.hasOwnProperty("ephemeralAllowGroupMembers")) + object.ephemeralAllowGroupMembers = options.enums === String ? $root.proto.WebFeatures.WebFeaturesFlag[message.ephemeralAllowGroupMembers] : message.ephemeralAllowGroupMembers; + if (message.ephemeral24HDuration != null && message.hasOwnProperty("ephemeral24HDuration")) + object.ephemeral24HDuration = options.enums === String ? $root.proto.WebFeatures.WebFeaturesFlag[message.ephemeral24HDuration] : message.ephemeral24HDuration; + if (message.mdForceUpgrade != null && message.hasOwnProperty("mdForceUpgrade")) + object.mdForceUpgrade = options.enums === String ? $root.proto.WebFeatures.WebFeaturesFlag[message.mdForceUpgrade] : message.mdForceUpgrade; + if (message.disappearingMode != null && message.hasOwnProperty("disappearingMode")) + object.disappearingMode = options.enums === String ? $root.proto.WebFeatures.WebFeaturesFlag[message.disappearingMode] : message.disappearingMode; + if (message.externalMdOptInAvailable != null && message.hasOwnProperty("externalMdOptInAvailable")) + object.externalMdOptInAvailable = options.enums === String ? $root.proto.WebFeatures.WebFeaturesFlag[message.externalMdOptInAvailable] : message.externalMdOptInAvailable; + if (message.noDeleteMessageTimeLimit != null && message.hasOwnProperty("noDeleteMessageTimeLimit")) + object.noDeleteMessageTimeLimit = options.enums === String ? $root.proto.WebFeatures.WebFeaturesFlag[message.noDeleteMessageTimeLimit] : message.noDeleteMessageTimeLimit; return object; }; /** - * Converts this PaymentInfo to JSON. + * Converts this WebFeatures to JSON. * @function toJSON - * @memberof proto.PaymentInfo + * @memberof proto.WebFeatures * @instance * @returns {Object.} JSON object */ - PaymentInfo.prototype.toJSON = function toJSON() { + WebFeatures.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * PaymentInfoCurrency enum. - * @name proto.PaymentInfo.PaymentInfoCurrency - * @enum {number} - * @property {number} UNKNOWN_CURRENCY=0 UNKNOWN_CURRENCY value - * @property {number} INR=1 INR value - */ - PaymentInfo.PaymentInfoCurrency = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "UNKNOWN_CURRENCY"] = 0; - values[valuesById[1] = "INR"] = 1; - return values; - })(); - - /** - * PaymentInfoStatus enum. - * @name proto.PaymentInfo.PaymentInfoStatus - * @enum {number} - * @property {number} UNKNOWN_STATUS=0 UNKNOWN_STATUS value - * @property {number} PROCESSING=1 PROCESSING value - * @property {number} SENT=2 SENT value - * @property {number} NEED_TO_ACCEPT=3 NEED_TO_ACCEPT value - * @property {number} COMPLETE=4 COMPLETE value - * @property {number} COULD_NOT_COMPLETE=5 COULD_NOT_COMPLETE value - * @property {number} REFUNDED=6 REFUNDED value - * @property {number} EXPIRED=7 EXPIRED value - * @property {number} REJECTED=8 REJECTED value - * @property {number} CANCELLED=9 CANCELLED value - * @property {number} WAITING_FOR_PAYER=10 WAITING_FOR_PAYER value - * @property {number} WAITING=11 WAITING value - */ - PaymentInfo.PaymentInfoStatus = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "UNKNOWN_STATUS"] = 0; - values[valuesById[1] = "PROCESSING"] = 1; - values[valuesById[2] = "SENT"] = 2; - values[valuesById[3] = "NEED_TO_ACCEPT"] = 3; - values[valuesById[4] = "COMPLETE"] = 4; - values[valuesById[5] = "COULD_NOT_COMPLETE"] = 5; - values[valuesById[6] = "REFUNDED"] = 6; - values[valuesById[7] = "EXPIRED"] = 7; - values[valuesById[8] = "REJECTED"] = 8; - values[valuesById[9] = "CANCELLED"] = 9; - values[valuesById[10] = "WAITING_FOR_PAYER"] = 10; - values[valuesById[11] = "WAITING"] = 11; - return values; - })(); - - /** - * PaymentInfoTxnStatus enum. - * @name proto.PaymentInfo.PaymentInfoTxnStatus + * WebFeaturesFlag enum. + * @name proto.WebFeatures.WebFeaturesFlag * @enum {number} - * @property {number} UNKNOWN=0 UNKNOWN value - * @property {number} PENDING_SETUP=1 PENDING_SETUP value - * @property {number} PENDING_RECEIVER_SETUP=2 PENDING_RECEIVER_SETUP value - * @property {number} INIT=3 INIT value - * @property {number} SUCCESS=4 SUCCESS value - * @property {number} COMPLETED=5 COMPLETED value - * @property {number} FAILED=6 FAILED value - * @property {number} FAILED_RISK=7 FAILED_RISK value - * @property {number} FAILED_PROCESSING=8 FAILED_PROCESSING value - * @property {number} FAILED_RECEIVER_PROCESSING=9 FAILED_RECEIVER_PROCESSING value - * @property {number} FAILED_DA=10 FAILED_DA value - * @property {number} FAILED_DA_FINAL=11 FAILED_DA_FINAL value - * @property {number} REFUNDED_TXN=12 REFUNDED_TXN value - * @property {number} REFUND_FAILED=13 REFUND_FAILED value - * @property {number} REFUND_FAILED_PROCESSING=14 REFUND_FAILED_PROCESSING value - * @property {number} REFUND_FAILED_DA=15 REFUND_FAILED_DA value - * @property {number} EXPIRED_TXN=16 EXPIRED_TXN value - * @property {number} AUTH_CANCELED=17 AUTH_CANCELED value - * @property {number} AUTH_CANCEL_FAILED_PROCESSING=18 AUTH_CANCEL_FAILED_PROCESSING value - * @property {number} AUTH_CANCEL_FAILED=19 AUTH_CANCEL_FAILED value - * @property {number} COLLECT_INIT=20 COLLECT_INIT value - * @property {number} COLLECT_SUCCESS=21 COLLECT_SUCCESS value - * @property {number} COLLECT_FAILED=22 COLLECT_FAILED value - * @property {number} COLLECT_FAILED_RISK=23 COLLECT_FAILED_RISK value - * @property {number} COLLECT_REJECTED=24 COLLECT_REJECTED value - * @property {number} COLLECT_EXPIRED=25 COLLECT_EXPIRED value - * @property {number} COLLECT_CANCELED=26 COLLECT_CANCELED value - * @property {number} COLLECT_CANCELLING=27 COLLECT_CANCELLING value - * @property {number} IN_REVIEW=28 IN_REVIEW value + * @property {number} NOT_STARTED=0 NOT_STARTED value + * @property {number} FORCE_UPGRADE=1 FORCE_UPGRADE value + * @property {number} DEVELOPMENT=2 DEVELOPMENT value + * @property {number} PRODUCTION=3 PRODUCTION value */ - PaymentInfo.PaymentInfoTxnStatus = (function() { + WebFeatures.WebFeaturesFlag = (function() { var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "UNKNOWN"] = 0; - values[valuesById[1] = "PENDING_SETUP"] = 1; - values[valuesById[2] = "PENDING_RECEIVER_SETUP"] = 2; - values[valuesById[3] = "INIT"] = 3; - values[valuesById[4] = "SUCCESS"] = 4; - values[valuesById[5] = "COMPLETED"] = 5; - values[valuesById[6] = "FAILED"] = 6; - values[valuesById[7] = "FAILED_RISK"] = 7; - values[valuesById[8] = "FAILED_PROCESSING"] = 8; - values[valuesById[9] = "FAILED_RECEIVER_PROCESSING"] = 9; - values[valuesById[10] = "FAILED_DA"] = 10; - values[valuesById[11] = "FAILED_DA_FINAL"] = 11; - values[valuesById[12] = "REFUNDED_TXN"] = 12; - values[valuesById[13] = "REFUND_FAILED"] = 13; - values[valuesById[14] = "REFUND_FAILED_PROCESSING"] = 14; - values[valuesById[15] = "REFUND_FAILED_DA"] = 15; - values[valuesById[16] = "EXPIRED_TXN"] = 16; - values[valuesById[17] = "AUTH_CANCELED"] = 17; - values[valuesById[18] = "AUTH_CANCEL_FAILED_PROCESSING"] = 18; - values[valuesById[19] = "AUTH_CANCEL_FAILED"] = 19; - values[valuesById[20] = "COLLECT_INIT"] = 20; - values[valuesById[21] = "COLLECT_SUCCESS"] = 21; - values[valuesById[22] = "COLLECT_FAILED"] = 22; - values[valuesById[23] = "COLLECT_FAILED_RISK"] = 23; - values[valuesById[24] = "COLLECT_REJECTED"] = 24; - values[valuesById[25] = "COLLECT_EXPIRED"] = 25; - values[valuesById[26] = "COLLECT_CANCELED"] = 26; - values[valuesById[27] = "COLLECT_CANCELLING"] = 27; - values[valuesById[28] = "IN_REVIEW"] = 28; + values[valuesById[0] = "NOT_STARTED"] = 0; + values[valuesById[1] = "FORCE_UPGRADE"] = 1; + values[valuesById[2] = "DEVELOPMENT"] = 2; + values[valuesById[3] = "PRODUCTION"] = 3; return values; })(); - return PaymentInfo; + return WebFeatures; })(); proto.WebMessageInfo = (function() { @@ -57573,6 +60105,8 @@ $root.proto = (function() { * @property {proto.IMediaData|null} [quotedStickerData] WebMessageInfo quotedStickerData * @property {Uint8Array|null} [futureproofData] WebMessageInfo futureproofData * @property {proto.IStatusPSA|null} [statusPsa] WebMessageInfo statusPsa + * @property {Array.|null} [pollUpdates] WebMessageInfo pollUpdates + * @property {proto.IPollAdditionalMetadata|null} [pollAdditionalMetadata] WebMessageInfo pollAdditionalMetadata */ /** @@ -57588,6 +60122,7 @@ $root.proto = (function() { this.labels = []; this.userReceipt = []; this.reactions = []; + this.pollUpdates = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -57874,6 +60409,22 @@ $root.proto = (function() { */ WebMessageInfo.prototype.statusPsa = null; + /** + * WebMessageInfo pollUpdates. + * @member {Array.} pollUpdates + * @memberof proto.WebMessageInfo + * @instance + */ + WebMessageInfo.prototype.pollUpdates = $util.emptyArray; + + /** + * WebMessageInfo pollAdditionalMetadata. + * @member {proto.IPollAdditionalMetadata|null|undefined} pollAdditionalMetadata + * @memberof proto.WebMessageInfo + * @instance + */ + WebMessageInfo.prototype.pollAdditionalMetadata = null; + /** * Creates a new WebMessageInfo instance using the specified properties. * @function create @@ -57971,6 +60522,11 @@ $root.proto = (function() { writer.uint32(/* id 43, wireType 2 =*/346).bytes(message.futureproofData); if (message.statusPsa != null && Object.hasOwnProperty.call(message, "statusPsa")) $root.proto.StatusPSA.encode(message.statusPsa, writer.uint32(/* id 44, wireType 2 =*/354).fork()).ldelim(); + if (message.pollUpdates != null && message.pollUpdates.length) + for (var i = 0; i < message.pollUpdates.length; ++i) + $root.proto.PollUpdate.encode(message.pollUpdates[i], writer.uint32(/* id 45, wireType 2 =*/362).fork()).ldelim(); + if (message.pollAdditionalMetadata != null && Object.hasOwnProperty.call(message, "pollAdditionalMetadata")) + $root.proto.PollAdditionalMetadata.encode(message.pollAdditionalMetadata, writer.uint32(/* id 46, wireType 2 =*/370).fork()).ldelim(); return writer; }; @@ -58118,6 +60674,14 @@ $root.proto = (function() { case 44: message.statusPsa = $root.proto.StatusPSA.decode(reader, reader.uint32()); break; + case 45: + if (!(message.pollUpdates && message.pollUpdates.length)) + message.pollUpdates = []; + message.pollUpdates.push($root.proto.PollUpdate.decode(reader, reader.uint32())); + break; + case 46: + message.pollAdditionalMetadata = $root.proto.PollAdditionalMetadata.decode(reader, reader.uint32()); + break; default: reader.skipType(tag & 7); break; @@ -58348,6 +60912,9 @@ $root.proto = (function() { case 131: case 132: case 133: + case 134: + case 135: + case 136: break; } if (message.clearMedia != null && message.hasOwnProperty("clearMedia")) @@ -58451,6 +61018,20 @@ $root.proto = (function() { if (error) return "statusPsa." + error; } + if (message.pollUpdates != null && message.hasOwnProperty("pollUpdates")) { + if (!Array.isArray(message.pollUpdates)) + return "pollUpdates: array expected"; + for (var i = 0; i < message.pollUpdates.length; ++i) { + var error = $root.proto.PollUpdate.verify(message.pollUpdates[i]); + if (error) + return "pollUpdates." + error; + } + } + if (message.pollAdditionalMetadata != null && message.hasOwnProperty("pollAdditionalMetadata")) { + var error = $root.proto.PollAdditionalMetadata.verify(message.pollAdditionalMetadata); + if (error) + return "pollAdditionalMetadata." + error; + } return null; }; @@ -59078,6 +61659,18 @@ $root.proto = (function() { case 133: message.messageStubType = 133; break; + case "COMMUNITY_LINK_PARENT_GROUP": + case 134: + message.messageStubType = 134; + break; + case "COMMUNITY_LINK_SIBLING_GROUP": + case 135: + message.messageStubType = 135; + break; + case "COMMUNITY_LINK_SUB_GROUP": + case 136: + message.messageStubType = 136; + break; } if (object.clearMedia != null) message.clearMedia = Boolean(object.clearMedia); @@ -59192,6 +61785,21 @@ $root.proto = (function() { throw TypeError(".proto.WebMessageInfo.statusPsa: object expected"); message.statusPsa = $root.proto.StatusPSA.fromObject(object.statusPsa); } + if (object.pollUpdates) { + if (!Array.isArray(object.pollUpdates)) + throw TypeError(".proto.WebMessageInfo.pollUpdates: array expected"); + message.pollUpdates = []; + for (var i = 0; i < object.pollUpdates.length; ++i) { + if (typeof object.pollUpdates[i] !== "object") + throw TypeError(".proto.WebMessageInfo.pollUpdates: object expected"); + message.pollUpdates[i] = $root.proto.PollUpdate.fromObject(object.pollUpdates[i]); + } + } + if (object.pollAdditionalMetadata != null) { + if (typeof object.pollAdditionalMetadata !== "object") + throw TypeError(".proto.WebMessageInfo.pollAdditionalMetadata: object expected"); + message.pollAdditionalMetadata = $root.proto.PollAdditionalMetadata.fromObject(object.pollAdditionalMetadata); + } return message; }; @@ -59213,6 +61821,7 @@ $root.proto = (function() { object.labels = []; object.userReceipt = []; object.reactions = []; + object.pollUpdates = []; } if (options.defaults) { object.key = null; @@ -59270,6 +61879,7 @@ $root.proto = (function() { object.futureproofData = $util.newBuffer(object.futureproofData); } object.statusPsa = null; + object.pollAdditionalMetadata = null; } if (message.key != null && message.hasOwnProperty("key")) object.key = $root.proto.MessageKey.toObject(message.key, options); @@ -59362,6 +61972,13 @@ $root.proto = (function() { object.futureproofData = options.bytes === String ? $util.base64.encode(message.futureproofData, 0, message.futureproofData.length) : options.bytes === Array ? Array.prototype.slice.call(message.futureproofData) : message.futureproofData; if (message.statusPsa != null && message.hasOwnProperty("statusPsa")) object.statusPsa = $root.proto.StatusPSA.toObject(message.statusPsa, options); + if (message.pollUpdates && message.pollUpdates.length) { + object.pollUpdates = []; + for (var j = 0; j < message.pollUpdates.length; ++j) + object.pollUpdates[j] = $root.proto.PollUpdate.toObject(message.pollUpdates[j], options); + } + if (message.pollAdditionalMetadata != null && message.hasOwnProperty("pollAdditionalMetadata")) + object.pollAdditionalMetadata = $root.proto.PollAdditionalMetadata.toObject(message.pollAdditionalMetadata, options); return object; }; @@ -59536,6 +62153,9 @@ $root.proto = (function() { * @property {number} E2E_DEVICE_FETCH_FAILED=131 E2E_DEVICE_FETCH_FAILED value * @property {number} ADMIN_REVOKE=132 ADMIN_REVOKE value * @property {number} GROUP_INVITE_LINK_GROWTH_LOCKED=133 GROUP_INVITE_LINK_GROWTH_LOCKED value + * @property {number} COMMUNITY_LINK_PARENT_GROUP=134 COMMUNITY_LINK_PARENT_GROUP value + * @property {number} COMMUNITY_LINK_SIBLING_GROUP=135 COMMUNITY_LINK_SIBLING_GROUP value + * @property {number} COMMUNITY_LINK_SUB_GROUP=136 COMMUNITY_LINK_SUB_GROUP value */ WebMessageInfo.WebMessageInfoStubType = (function() { var valuesById = {}, values = Object.create(valuesById); @@ -59673,6 +62293,9 @@ $root.proto = (function() { values[valuesById[131] = "E2E_DEVICE_FETCH_FAILED"] = 131; values[valuesById[132] = "ADMIN_REVOKE"] = 132; values[valuesById[133] = "GROUP_INVITE_LINK_GROWTH_LOCKED"] = 133; + values[valuesById[134] = "COMMUNITY_LINK_PARENT_GROUP"] = 134; + values[valuesById[135] = "COMMUNITY_LINK_SIBLING_GROUP"] = 135; + values[valuesById[136] = "COMMUNITY_LINK_SUB_GROUP"] = 136; return values; })(); @@ -59697,6 +62320,296 @@ $root.proto = (function() { return WebMessageInfo; })(); + proto.WebNotificationsInfo = (function() { + + /** + * Properties of a WebNotificationsInfo. + * @memberof proto + * @interface IWebNotificationsInfo + * @property {number|Long|null} [timestamp] WebNotificationsInfo timestamp + * @property {number|null} [unreadChats] WebNotificationsInfo unreadChats + * @property {number|null} [notifyMessageCount] WebNotificationsInfo notifyMessageCount + * @property {Array.|null} [notifyMessages] WebNotificationsInfo notifyMessages + */ + + /** + * Constructs a new WebNotificationsInfo. + * @memberof proto + * @classdesc Represents a WebNotificationsInfo. + * @implements IWebNotificationsInfo + * @constructor + * @param {proto.IWebNotificationsInfo=} [properties] Properties to set + */ + function WebNotificationsInfo(properties) { + this.notifyMessages = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * WebNotificationsInfo timestamp. + * @member {number|Long} timestamp + * @memberof proto.WebNotificationsInfo + * @instance + */ + WebNotificationsInfo.prototype.timestamp = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * WebNotificationsInfo unreadChats. + * @member {number} unreadChats + * @memberof proto.WebNotificationsInfo + * @instance + */ + WebNotificationsInfo.prototype.unreadChats = 0; + + /** + * WebNotificationsInfo notifyMessageCount. + * @member {number} notifyMessageCount + * @memberof proto.WebNotificationsInfo + * @instance + */ + WebNotificationsInfo.prototype.notifyMessageCount = 0; + + /** + * WebNotificationsInfo notifyMessages. + * @member {Array.} notifyMessages + * @memberof proto.WebNotificationsInfo + * @instance + */ + WebNotificationsInfo.prototype.notifyMessages = $util.emptyArray; + + /** + * Creates a new WebNotificationsInfo instance using the specified properties. + * @function create + * @memberof proto.WebNotificationsInfo + * @static + * @param {proto.IWebNotificationsInfo=} [properties] Properties to set + * @returns {proto.WebNotificationsInfo} WebNotificationsInfo instance + */ + WebNotificationsInfo.create = function create(properties) { + return new WebNotificationsInfo(properties); + }; + + /** + * Encodes the specified WebNotificationsInfo message. Does not implicitly {@link proto.WebNotificationsInfo.verify|verify} messages. + * @function encode + * @memberof proto.WebNotificationsInfo + * @static + * @param {proto.IWebNotificationsInfo} message WebNotificationsInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WebNotificationsInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.timestamp != null && Object.hasOwnProperty.call(message, "timestamp")) + writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.timestamp); + if (message.unreadChats != null && Object.hasOwnProperty.call(message, "unreadChats")) + writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.unreadChats); + if (message.notifyMessageCount != null && Object.hasOwnProperty.call(message, "notifyMessageCount")) + writer.uint32(/* id 4, wireType 0 =*/32).uint32(message.notifyMessageCount); + if (message.notifyMessages != null && message.notifyMessages.length) + for (var i = 0; i < message.notifyMessages.length; ++i) + $root.proto.WebMessageInfo.encode(message.notifyMessages[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified WebNotificationsInfo message, length delimited. Does not implicitly {@link proto.WebNotificationsInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof proto.WebNotificationsInfo + * @static + * @param {proto.IWebNotificationsInfo} message WebNotificationsInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WebNotificationsInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WebNotificationsInfo message from the specified reader or buffer. + * @function decode + * @memberof proto.WebNotificationsInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {proto.WebNotificationsInfo} WebNotificationsInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WebNotificationsInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.WebNotificationsInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: + message.timestamp = reader.uint64(); + break; + case 3: + message.unreadChats = reader.uint32(); + break; + case 4: + message.notifyMessageCount = reader.uint32(); + break; + case 5: + if (!(message.notifyMessages && message.notifyMessages.length)) + message.notifyMessages = []; + message.notifyMessages.push($root.proto.WebMessageInfo.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WebNotificationsInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof proto.WebNotificationsInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {proto.WebNotificationsInfo} WebNotificationsInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WebNotificationsInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WebNotificationsInfo message. + * @function verify + * @memberof proto.WebNotificationsInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WebNotificationsInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.timestamp != null && message.hasOwnProperty("timestamp")) + if (!$util.isInteger(message.timestamp) && !(message.timestamp && $util.isInteger(message.timestamp.low) && $util.isInteger(message.timestamp.high))) + return "timestamp: integer|Long expected"; + if (message.unreadChats != null && message.hasOwnProperty("unreadChats")) + if (!$util.isInteger(message.unreadChats)) + return "unreadChats: integer expected"; + if (message.notifyMessageCount != null && message.hasOwnProperty("notifyMessageCount")) + if (!$util.isInteger(message.notifyMessageCount)) + return "notifyMessageCount: integer expected"; + if (message.notifyMessages != null && message.hasOwnProperty("notifyMessages")) { + if (!Array.isArray(message.notifyMessages)) + return "notifyMessages: array expected"; + for (var i = 0; i < message.notifyMessages.length; ++i) { + var error = $root.proto.WebMessageInfo.verify(message.notifyMessages[i]); + if (error) + return "notifyMessages." + error; + } + } + return null; + }; + + /** + * Creates a WebNotificationsInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof proto.WebNotificationsInfo + * @static + * @param {Object.} object Plain object + * @returns {proto.WebNotificationsInfo} WebNotificationsInfo + */ + WebNotificationsInfo.fromObject = function fromObject(object) { + if (object instanceof $root.proto.WebNotificationsInfo) + return object; + var message = new $root.proto.WebNotificationsInfo(); + if (object.timestamp != null) + if ($util.Long) + (message.timestamp = $util.Long.fromValue(object.timestamp)).unsigned = true; + else if (typeof object.timestamp === "string") + message.timestamp = parseInt(object.timestamp, 10); + else if (typeof object.timestamp === "number") + message.timestamp = object.timestamp; + else if (typeof object.timestamp === "object") + message.timestamp = new $util.LongBits(object.timestamp.low >>> 0, object.timestamp.high >>> 0).toNumber(true); + if (object.unreadChats != null) + message.unreadChats = object.unreadChats >>> 0; + if (object.notifyMessageCount != null) + message.notifyMessageCount = object.notifyMessageCount >>> 0; + if (object.notifyMessages) { + if (!Array.isArray(object.notifyMessages)) + throw TypeError(".proto.WebNotificationsInfo.notifyMessages: array expected"); + message.notifyMessages = []; + for (var i = 0; i < object.notifyMessages.length; ++i) { + if (typeof object.notifyMessages[i] !== "object") + throw TypeError(".proto.WebNotificationsInfo.notifyMessages: object expected"); + message.notifyMessages[i] = $root.proto.WebMessageInfo.fromObject(object.notifyMessages[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a WebNotificationsInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof proto.WebNotificationsInfo + * @static + * @param {proto.WebNotificationsInfo} message WebNotificationsInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WebNotificationsInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.notifyMessages = []; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.timestamp = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.timestamp = options.longs === String ? "0" : 0; + object.unreadChats = 0; + object.notifyMessageCount = 0; + } + if (message.timestamp != null && message.hasOwnProperty("timestamp")) + if (typeof message.timestamp === "number") + object.timestamp = options.longs === String ? String(message.timestamp) : message.timestamp; + else + object.timestamp = options.longs === String ? $util.Long.prototype.toString.call(message.timestamp) : options.longs === Number ? new $util.LongBits(message.timestamp.low >>> 0, message.timestamp.high >>> 0).toNumber(true) : message.timestamp; + if (message.unreadChats != null && message.hasOwnProperty("unreadChats")) + object.unreadChats = message.unreadChats; + if (message.notifyMessageCount != null && message.hasOwnProperty("notifyMessageCount")) + object.notifyMessageCount = message.notifyMessageCount; + if (message.notifyMessages && message.notifyMessages.length) { + object.notifyMessages = []; + for (var j = 0; j < message.notifyMessages.length; ++j) + object.notifyMessages[j] = $root.proto.WebMessageInfo.toObject(message.notifyMessages[j], options); + } + return object; + }; + + /** + * Converts this WebNotificationsInfo to JSON. + * @function toJSON + * @memberof proto.WebNotificationsInfo + * @instance + * @returns {Object.} JSON object + */ + WebNotificationsInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return WebNotificationsInfo; + })(); + return proto; })(); diff --git a/node_modules/@adiwajshing/baileys/lib/Defaults/.trashed-1649374382-index.d.ts b/node_modules/@adiwajshing/baileys/lib/Defaults/.trashed-1649374382-index.d.ts deleted file mode 100644 index f1414911e..000000000 --- a/node_modules/@adiwajshing/baileys/lib/Defaults/.trashed-1649374382-index.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -import type { LegacySocketConfig, MediaType, SocketConfig } from '../Types'; -export declare const UNAUTHORIZED_CODES: number[]; -export declare const DEFAULT_ORIGIN = "https://web.whatsapp.com"; -export declare const DEF_CALLBACK_PREFIX = "CB:"; -export declare const DEF_TAG_PREFIX = "TAG:"; -export declare const PHONE_CONNECTION_CB = "CB:Pong"; -export declare const WA_DEFAULT_EPHEMERAL: number; -export declare const NOISE_MODE = "Noise_XX_25519_AESGCM_SHA256\0\0\0\0"; -export declare const NOISE_WA_HEADER: Uint8Array; -/** from: https://stackoverflow.com/questions/3809401/what-is-a-good-regular-expression-to-match-a-url */ -export declare const URL_REGEX: RegExp; -export declare const DEFAULT_CONNECTION_CONFIG: SocketConfig; -export declare const DEFAULT_LEGACY_CONNECTION_CONFIG: LegacySocketConfig; -export declare const MEDIA_PATH_MAP: { - [T in MediaType]: string; -}; -export declare const MEDIA_KEYS: MediaType[]; -export declare const KEY_BUNDLE_TYPE = "\u0005"; diff --git a/node_modules/@adiwajshing/baileys/lib/Defaults/baileys-version.json b/node_modules/@adiwajshing/baileys/lib/Defaults/baileys-version.json index 9b29950d7..fac04f789 100644 --- a/node_modules/@adiwajshing/baileys/lib/Defaults/baileys-version.json +++ b/node_modules/@adiwajshing/baileys/lib/Defaults/baileys-version.json @@ -1,3 +1,3 @@ { - "version": [2, 2204, 13] + "version": [2, 2210, 9] } diff --git a/node_modules/@adiwajshing/baileys/lib/Defaults/index.d.ts b/node_modules/@adiwajshing/baileys/lib/Defaults/index.d.ts new file mode 100644 index 000000000..0688a9f66 --- /dev/null +++ b/node_modules/@adiwajshing/baileys/lib/Defaults/index.d.ts @@ -0,0 +1,19 @@ +/// +import type { LegacySocketConfig, MediaType, SocketConfig } from '../Types'; +export declare const UNAUTHORIZED_CODES: number[]; +export declare const DEFAULT_ORIGIN = "https://web.whatsapp.com"; +export declare const DEF_CALLBACK_PREFIX = "CB:"; +export declare const DEF_TAG_PREFIX = "TAG:"; +export declare const PHONE_CONNECTION_CB = "CB:Pong"; +export declare const WA_DEFAULT_EPHEMERAL: number; +export declare const NOISE_MODE = "Noise_XX_25519_AESGCM_SHA256\0\0\0\0"; +export declare const NOISE_WA_HEADER: Uint8Array; +/** from: https://stackoverflow.com/questions/3809401/what-is-a-good-regular-expression-to-match-a-url */ +export declare const URL_REGEX: RegExp; +export declare const DEFAULT_CONNECTION_CONFIG: SocketConfig; +export declare const DEFAULT_LEGACY_CONNECTION_CONFIG: LegacySocketConfig; +export declare const MEDIA_PATH_MAP: { + [T in MediaType]: string; +}; +export declare const MEDIA_KEYS: MediaType[]; +export declare const KEY_BUNDLE_TYPE: Buffer; diff --git a/node_modules/@adiwajshing/baileys/lib/Defaults/index.d_1.ts b/node_modules/@adiwajshing/baileys/lib/Defaults/index.d_1.ts deleted file mode 100644 index f1414911e..000000000 --- a/node_modules/@adiwajshing/baileys/lib/Defaults/index.d_1.ts +++ /dev/null @@ -1,18 +0,0 @@ -import type { LegacySocketConfig, MediaType, SocketConfig } from '../Types'; -export declare const UNAUTHORIZED_CODES: number[]; -export declare const DEFAULT_ORIGIN = "https://web.whatsapp.com"; -export declare const DEF_CALLBACK_PREFIX = "CB:"; -export declare const DEF_TAG_PREFIX = "TAG:"; -export declare const PHONE_CONNECTION_CB = "CB:Pong"; -export declare const WA_DEFAULT_EPHEMERAL: number; -export declare const NOISE_MODE = "Noise_XX_25519_AESGCM_SHA256\0\0\0\0"; -export declare const NOISE_WA_HEADER: Uint8Array; -/** from: https://stackoverflow.com/questions/3809401/what-is-a-good-regular-expression-to-match-a-url */ -export declare const URL_REGEX: RegExp; -export declare const DEFAULT_CONNECTION_CONFIG: SocketConfig; -export declare const DEFAULT_LEGACY_CONNECTION_CONFIG: LegacySocketConfig; -export declare const MEDIA_PATH_MAP: { - [T in MediaType]: string; -}; -export declare const MEDIA_KEYS: MediaType[]; -export declare const KEY_BUNDLE_TYPE = "\u0005"; diff --git a/node_modules/@adiwajshing/baileys/lib/Defaults/index.js b/node_modules/@adiwajshing/baileys/lib/Defaults/index.js index af4240638..d8d2a20bd 100644 --- a/node_modules/@adiwajshing/baileys/lib/Defaults/index.js +++ b/node_modules/@adiwajshing/baileys/lib/Defaults/index.js @@ -4,8 +4,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) { }; Object.defineProperty(exports, "__esModule", { value: true }); exports.KEY_BUNDLE_TYPE = exports.MEDIA_KEYS = exports.MEDIA_PATH_MAP = exports.DEFAULT_LEGACY_CONNECTION_CONFIG = exports.DEFAULT_CONNECTION_CONFIG = exports.URL_REGEX = exports.NOISE_WA_HEADER = exports.NOISE_MODE = exports.WA_DEFAULT_EPHEMERAL = exports.PHONE_CONNECTION_CB = exports.DEF_TAG_PREFIX = exports.DEF_CALLBACK_PREFIX = exports.DEFAULT_ORIGIN = exports.UNAUTHORIZED_CODES = void 0; -const pino_1 = __importDefault(require("pino")); const Utils_1 = require("../Utils"); +const logger_1 = __importDefault(require("../Utils/logger")); const baileys_version_json_1 = require("./baileys-version.json"); exports.UNAUTHORIZED_CODES = [401, 403, 419]; exports.DEFAULT_ORIGIN = 'https://web.whatsapp.com'; @@ -23,11 +23,13 @@ const BASE_CONNECTION_CONFIG = { waWebSocketUrl: 'wss://web.whatsapp.com/ws/chat', connectTimeoutMs: 20000, keepAliveIntervalMs: 25000, - logger: pino_1.default().child({ class: 'baileys' }), + logger: logger_1.default.child({ class: 'baileys' }), printQRInTerminal: false, emitOwnEvents: true, defaultQueryTimeoutMs: 60000, customUploadHosts: [], + treatCiphertextMessagesAsReal: false, + retryRequestDelayMs: 250 }; exports.DEFAULT_CONNECTION_CONFIG = { ...BASE_CONNECTION_CONFIG, @@ -50,4 +52,4 @@ exports.MEDIA_PATH_MAP = { 'md-app-state': '' }; exports.MEDIA_KEYS = Object.keys(exports.MEDIA_PATH_MAP); -exports.KEY_BUNDLE_TYPE = ''; +exports.KEY_BUNDLE_TYPE = Buffer.from([5]); diff --git a/node_modules/@adiwajshing/baileys/lib/LegacySocket/.trashed-1649374382-chats.d.ts b/node_modules/@adiwajshing/baileys/lib/LegacySocket/.trashed-1649374382-chats.d.ts deleted file mode 100644 index db407a1bf..000000000 --- a/node_modules/@adiwajshing/baileys/lib/LegacySocket/.trashed-1649374382-chats.d.ts +++ /dev/null @@ -1,98 +0,0 @@ -/// -/// -import { Chat, ChatModification, LegacySocketConfig, WABusinessProfile, WAMessageKey, WAPresence } from '../Types'; -import { BinaryNode } from '../WABinary'; -declare const makeChatsSocket: (config: LegacySocketConfig) => { - sendChatsQuery: (epoch: number) => Promise; - profilePictureUrl: (jid: string, timeoutMs?: number) => Promise; - chatRead: (fromMessage: WAMessageKey, count: number) => Promise; - /** - * Modify a given chat (archive, pin etc.) - * @param jid the ID of the person/group you are modifiying - */ - chatModify: (modification: ChatModification, jid: string, chatInfo: Pick, timestampNow?: number) => Promise; - /** - * Query whether a given number is registered on WhatsApp - * @param str phone number/jid you want to check for - * @returns undefined if the number doesn't exists, otherwise the correctly formatted jid - */ - onWhatsApp: (str: string) => Promise<{ - exists: boolean; - jid: string; - isBusiness: boolean; - }>; - /** - * Tell someone about your presence -- online, typing, offline etc. - * @param jid the ID of the person/group who you are updating - * @param type your presence - */ - sendPresenceUpdate: (type: WAPresence, jid: string | undefined) => Promise; - /** - * Request updates on the presence of a user - * this returns nothing, you'll receive updates in chats.update event - * */ - presenceSubscribe: (jid: string) => Promise; - /** Query the status of the person (see groupMetadata() for groups) */ - getStatus: (jid: string) => Promise<{ - status: string; - }>; - setStatus: (status: string) => Promise<{ - status: number; - }>; - /** Updates business profile. */ - updateBusinessProfile: (profile: WABusinessProfile) => Promise; - updateProfileName: (name: string) => Promise<{ - status: number; - pushname: string; - }>; - /** - * Update the profile picture - * @param jid - * @param img - */ - updateProfilePicture(jid: string, img: Buffer): Promise; - /** - * Add or remove user from blocklist - * @param jid the ID of the person who you are blocking/unblocking - * @param type type of operation - */ - blockUser: (jid: string, type?: 'add' | 'remove') => Promise; - /** - * Query Business Profile (Useful for VCards) - * @param jid Business Jid - * @returns profile object or undefined if not business account - */ - getBusinessProfile: (jid: string) => Promise; - state: import("../Types").ConnectionState; - authInfo: import("../Types").LegacyAuthenticationCreds; - ev: import("../Types").LegacyBaileysEventEmitter; - canLogin: () => boolean; - logout: () => Promise; - waitForConnectionUpdate: (check: (u: Partial) => boolean, timeoutMs?: number) => Promise; - type: "legacy"; - ws: import("ws"); - sendAdminTest: () => Promise; - updateKeys: (info: { - encKey: Buffer; - macKey: Buffer; - }) => { - encKey: Buffer; - macKey: Buffer; - }; - waitForSocketOpen: () => Promise; - sendNode: ({ json, binaryTag, tag, longTag }: import("../Types").SocketSendMessageOptions) => Promise; - generateMessageTag: (longTag?: boolean) => string; - waitForMessage: (tag: string, requiresPhoneConnection: boolean, timeoutMs?: number) => { - promise: Promise; - cancelToken: () => void; - }; - query: ({ json, timeoutMs, expect200, tag, longTag, binaryTag, requiresPhoneConnection }: import("../Types").SocketQueryOptions) => Promise; - setQuery: (nodes: BinaryNode[], binaryTag?: import("../Types").WATag, tag?: string) => Promise<{ - status: number; - }>; - currentEpoch: () => number; - end: (error: Error) => void; -}; -export default makeChatsSocket; diff --git a/node_modules/@adiwajshing/baileys/lib/LegacySocket/.trashed-1649374382-groups.d.ts b/node_modules/@adiwajshing/baileys/lib/LegacySocket/.trashed-1649374382-groups.d.ts deleted file mode 100644 index f042c0906..000000000 --- a/node_modules/@adiwajshing/baileys/lib/LegacySocket/.trashed-1649374382-groups.d.ts +++ /dev/null @@ -1,114 +0,0 @@ -/// -/// -import { GroupMetadata, LegacySocketConfig, ParticipantAction } from '../Types'; -import { BinaryNode } from '../WABinary'; -declare const makeGroupsSocket: (config: LegacySocketConfig) => { - groupMetadata: (jid: string, minimal: boolean) => Promise; - /** - * Create a group - * @param title like, the title of the group - * @param participants people to include in the group - */ - groupCreate: (title: string, participants: string[]) => Promise; - /** - * Leave a group - * @param jid the ID of the group - */ - groupLeave: (id: string) => Promise; - /** - * Update the subject of the group - * @param {string} jid the ID of the group - * @param {string} title the new title of the group - */ - groupUpdateSubject: (id: string, title: string) => Promise; - /** - * Update the group description - * @param {string} jid the ID of the group - * @param {string} title the new title of the group - */ - groupUpdateDescription: (jid: string, description: string) => Promise<{ - status: number; - }>; - /** - * Update participants in the group - * @param jid the ID of the group - * @param participants the people to add - */ - groupParticipantsUpdate: (id: string, participants: string[], action: ParticipantAction) => Promise; - /** Query broadcast list info */ - getBroadcastListInfo: (jid: string) => Promise; - groupInviteCode: (jid: string) => Promise; - relayMessage: (message: import("../Types").WAProto.IWebMessageInfo, { waitForAck }?: { - waitForAck: boolean; - }) => Promise; - generateUrlInfo: (text: string) => Promise; - messageInfo: (jid: string, messageID: string) => Promise; - downloadMediaMessage: (message: import("../Types").WAProto.IWebMessageInfo, type?: "stream" | "buffer") => Promise; - updateMediaMessage: (message: import("../Types").WAProto.IWebMessageInfo) => Promise; - fetchMessagesFromWA: (jid: string, count: number, cursor?: import("../Types").WAMessageCursor) => Promise; - loadMessageFromWA: (jid: string, id: string) => Promise; - searchMessages: (txt: string, inJid: string, count: number, page: number) => Promise<{ - last: boolean; - messages: import("../Types").WAProto.WebMessageInfo[]; - }>; - sendMessage: (jid: string, content: import("../Types").AnyMessageContent, options?: import("../Types").MiscMessageGenerationOptions & { - waitForAck?: boolean; - }) => Promise; - sendChatsQuery: (epoch: number) => Promise; - profilePictureUrl: (jid: string, timeoutMs?: number) => Promise; - chatRead: (fromMessage: import("../Types").WAProto.IMessageKey, count: number) => Promise; - chatModify: (modification: import("../Types").ChatModification, jid: string, chatInfo: Pick, timestampNow?: number) => Promise; - onWhatsApp: (str: string) => Promise<{ - exists: boolean; - jid: string; - isBusiness: boolean; - }>; - sendPresenceUpdate: (type: import("../Types").WAPresence, jid: string) => Promise; - presenceSubscribe: (jid: string) => Promise; - getStatus: (jid: string) => Promise<{ - status: string; - }>; - setStatus: (status: string) => Promise<{ - status: number; - }>; - updateBusinessProfile: (profile: import("../Types").WABusinessProfile) => Promise; - updateProfileName: (name: string) => Promise<{ - status: number; - pushname: string; - }>; - updateProfilePicture(jid: string, img: Buffer): Promise; - blockUser: (jid: string, type?: "add" | "remove") => Promise; - getBusinessProfile: (jid: string) => Promise; - state: import("../Types").ConnectionState; - authInfo: import("../Types").LegacyAuthenticationCreds; - ev: import("../Types").LegacyBaileysEventEmitter; - canLogin: () => boolean; - logout: () => Promise; - waitForConnectionUpdate: (check: (u: Partial) => boolean, timeoutMs?: number) => Promise; - type: "legacy"; - ws: import("ws"); - sendAdminTest: () => Promise; - updateKeys: (info: { - encKey: Buffer; - macKey: Buffer; - }) => { - encKey: Buffer; - macKey: Buffer; - }; - waitForSocketOpen: () => Promise; - sendNode: ({ json, binaryTag, tag, longTag }: import("../Types").SocketSendMessageOptions) => Promise; - generateMessageTag: (longTag?: boolean) => string; - waitForMessage: (tag: string, requiresPhoneConnection: boolean, timeoutMs?: number) => { - promise: Promise; - cancelToken: () => void; - }; - query: ({ json, timeoutMs, expect200, tag, longTag, binaryTag, requiresPhoneConnection }: import("../Types").SocketQueryOptions) => Promise; - setQuery: (nodes: BinaryNode[], binaryTag?: import("../Types").WATag, tag?: string) => Promise<{ - status: number; - }>; - currentEpoch: () => number; - end: (error: Error) => void; -}; -export default makeGroupsSocket; diff --git a/node_modules/@adiwajshing/baileys/lib/LegacySocket/.trashed-1649374382-index.d.ts b/node_modules/@adiwajshing/baileys/lib/LegacySocket/.trashed-1649374382-index.d.ts deleted file mode 100644 index 87fd26ddd..000000000 --- a/node_modules/@adiwajshing/baileys/lib/LegacySocket/.trashed-1649374382-index.d.ts +++ /dev/null @@ -1,88 +0,0 @@ -/// -/// -import { LegacySocketConfig } from '../Types'; -declare const makeLegacySocket: (config: Partial) => { - groupMetadata: (jid: string, minimal: boolean) => Promise; - groupCreate: (title: string, participants: string[]) => Promise; - groupLeave: (id: string) => Promise; - groupUpdateSubject: (id: string, title: string) => Promise; - groupUpdateDescription: (jid: string, description: string) => Promise<{ - status: number; - }>; - groupParticipantsUpdate: (id: string, participants: string[], action: import("../Types").ParticipantAction) => Promise; - getBroadcastListInfo: (jid: string) => Promise; - groupInviteCode: (jid: string) => Promise; - relayMessage: (message: import("../Types").WAProto.IWebMessageInfo, { waitForAck }?: { - waitForAck: boolean; - }) => Promise; - generateUrlInfo: (text: string) => Promise; - messageInfo: (jid: string, messageID: string) => Promise; - downloadMediaMessage: (message: import("../Types").WAProto.IWebMessageInfo, type?: "stream" | "buffer") => Promise; - updateMediaMessage: (message: import("../Types").WAProto.IWebMessageInfo) => Promise; - fetchMessagesFromWA: (jid: string, count: number, cursor?: import("../Types").WAMessageCursor) => Promise; - loadMessageFromWA: (jid: string, id: string) => Promise; - searchMessages: (txt: string, inJid: string, count: number, page: number) => Promise<{ - last: boolean; - messages: import("../Types").WAProto.WebMessageInfo[]; - }>; - sendMessage: (jid: string, content: import("../Types").AnyMessageContent, options?: import("../Types").MiscMessageGenerationOptions & { - waitForAck?: boolean; - }) => Promise; - sendChatsQuery: (epoch: number) => Promise; - profilePictureUrl: (jid: string, timeoutMs?: number) => Promise; - chatRead: (fromMessage: import("../Types").WAProto.IMessageKey, count: number) => Promise; - chatModify: (modification: import("../Types").ChatModification, jid: string, chatInfo: Pick, timestampNow?: number) => Promise; - onWhatsApp: (str: string) => Promise<{ - exists: boolean; - jid: string; - isBusiness: boolean; - }>; - sendPresenceUpdate: (type: import("../Types").WAPresence, jid: string) => Promise; - presenceSubscribe: (jid: string) => Promise; - getStatus: (jid: string) => Promise<{ - status: string; - }>; - setStatus: (status: string) => Promise<{ - status: number; - }>; - updateBusinessProfile: (profile: import("../Types").WABusinessProfile) => Promise; - updateProfileName: (name: string) => Promise<{ - status: number; - pushname: string; - }>; - updateProfilePicture(jid: string, img: Buffer): Promise; - blockUser: (jid: string, type?: "add" | "remove") => Promise; - getBusinessProfile: (jid: string) => Promise; - state: import("../Types").ConnectionState; - authInfo: import("../Types").LegacyAuthenticationCreds; - ev: import("../Types").LegacyBaileysEventEmitter; - canLogin: () => boolean; - logout: () => Promise; - waitForConnectionUpdate: (check: (u: Partial) => boolean, timeoutMs?: number) => Promise; - type: "legacy"; - ws: import("ws"); - sendAdminTest: () => Promise; - updateKeys: (info: { - encKey: Buffer; - macKey: Buffer; - }) => { - encKey: Buffer; - macKey: Buffer; - }; - waitForSocketOpen: () => Promise; - sendNode: ({ json, binaryTag, tag, longTag }: import("../Types").SocketSendMessageOptions) => Promise; - generateMessageTag: (longTag?: boolean) => string; - waitForMessage: (tag: string, requiresPhoneConnection: boolean, timeoutMs?: number) => { - promise: Promise; - cancelToken: () => void; - }; - query: ({ json, timeoutMs, expect200, tag, longTag, binaryTag, requiresPhoneConnection }: import("../Types").SocketQueryOptions) => Promise; - setQuery: (nodes: import("..").BinaryNode[], binaryTag?: import("../Types").WATag, tag?: string) => Promise<{ - status: number; - }>; - currentEpoch: () => number; - end: (error: Error) => void; -}; -export default makeLegacySocket; diff --git a/node_modules/@adiwajshing/baileys/lib/LegacySocket/.trashed-1649374382-messages.d.ts b/node_modules/@adiwajshing/baileys/lib/LegacySocket/.trashed-1649374382-messages.d.ts deleted file mode 100644 index 50e954743..000000000 --- a/node_modules/@adiwajshing/baileys/lib/LegacySocket/.trashed-1649374382-messages.d.ts +++ /dev/null @@ -1,81 +0,0 @@ -/// -/// -import { proto } from '../../WAProto'; -import { AnyMessageContent, Chat, LegacySocketConfig, MiscMessageGenerationOptions, WAMessage, WAMessageCursor, WAUrlInfo } from '../Types'; -import { BinaryNode } from '../WABinary'; -declare const makeMessagesSocket: (config: LegacySocketConfig) => { - relayMessage: (message: WAMessage, { waitForAck }?: { - waitForAck: boolean; - }) => Promise; - generateUrlInfo: (text: string) => Promise; - messageInfo: (jid: string, messageID: string) => Promise; - downloadMediaMessage: (message: WAMessage, type?: 'buffer' | 'stream') => Promise; - updateMediaMessage: (message: WAMessage) => Promise; - fetchMessagesFromWA: (jid: string, count: number, cursor?: WAMessageCursor) => Promise; - /** Load a single message specified by the ID */ - loadMessageFromWA: (jid: string, id: string) => Promise; - searchMessages: (txt: string, inJid: string | null, count: number, page: number) => Promise<{ - last: boolean; - messages: proto.WebMessageInfo[]; - }>; - sendMessage: (jid: string, content: AnyMessageContent, options?: MiscMessageGenerationOptions & { - waitForAck?: boolean; - }) => Promise; - sendChatsQuery: (epoch: number) => Promise; - profilePictureUrl: (jid: string, timeoutMs?: number) => Promise; - chatRead: (fromMessage: proto.IMessageKey, count: number) => Promise; - chatModify: (modification: import("../Types").ChatModification, jid: string, chatInfo: Pick, timestampNow?: number) => Promise; - onWhatsApp: (str: string) => Promise<{ - exists: boolean; - jid: string; - isBusiness: boolean; - }>; - sendPresenceUpdate: (type: import("../Types").WAPresence, jid: string) => Promise; - presenceSubscribe: (jid: string) => Promise; - getStatus: (jid: string) => Promise<{ - status: string; - }>; - setStatus: (status: string) => Promise<{ - status: number; - }>; - updateBusinessProfile: (profile: import("../Types").WABusinessProfile) => Promise; - updateProfileName: (name: string) => Promise<{ - status: number; - pushname: string; - }>; - updateProfilePicture(jid: string, img: Buffer): Promise; - blockUser: (jid: string, type?: "add" | "remove") => Promise; - getBusinessProfile: (jid: string) => Promise; - state: import("../Types").ConnectionState; - authInfo: import("../Types").LegacyAuthenticationCreds; - ev: import("../Types").LegacyBaileysEventEmitter; - canLogin: () => boolean; - logout: () => Promise; - waitForConnectionUpdate: (check: (u: Partial) => boolean, timeoutMs?: number) => Promise; - type: "legacy"; - ws: import("ws"); - sendAdminTest: () => Promise; - updateKeys: (info: { - encKey: Buffer; - macKey: Buffer; - }) => { - encKey: Buffer; - macKey: Buffer; - }; - waitForSocketOpen: () => Promise; - sendNode: ({ json, binaryTag, tag, longTag }: import("../Types").SocketSendMessageOptions) => Promise; - generateMessageTag: (longTag?: boolean) => string; - waitForMessage: (tag: string, requiresPhoneConnection: boolean, timeoutMs?: number) => { - promise: Promise; - cancelToken: () => void; - }; - query: ({ json, timeoutMs, expect200, tag, longTag, binaryTag, requiresPhoneConnection }: import("../Types").SocketQueryOptions) => Promise; - setQuery: (nodes: BinaryNode[], binaryTag?: import("../Types").WATag, tag?: string) => Promise<{ - status: number; - }>; - currentEpoch: () => number; - end: (error: Error) => void; -}; -export default makeMessagesSocket; diff --git a/node_modules/@adiwajshing/baileys/lib/LegacySocket/.trashed-1649374382-auth.d.ts b/node_modules/@adiwajshing/baileys/lib/LegacySocket/auth.d.ts similarity index 100% rename from node_modules/@adiwajshing/baileys/lib/LegacySocket/.trashed-1649374382-auth.d.ts rename to node_modules/@adiwajshing/baileys/lib/LegacySocket/auth.d.ts diff --git a/node_modules/@adiwajshing/baileys/lib/LegacySocket/auth.d_1.ts b/node_modules/@adiwajshing/baileys/lib/LegacySocket/auth.d_1.ts deleted file mode 100644 index 5ce2e33f7..000000000 --- a/node_modules/@adiwajshing/baileys/lib/LegacySocket/auth.d_1.ts +++ /dev/null @@ -1,36 +0,0 @@ -/// -/// -import { ConnectionState, LegacyBaileysEventEmitter, LegacySocketConfig } from '../Types'; -declare const makeAuthSocket: (config: LegacySocketConfig) => { - state: ConnectionState; - authInfo: import("../Types").LegacyAuthenticationCreds; - ev: LegacyBaileysEventEmitter; - canLogin: () => boolean; - logout: () => Promise; - /** Waits for the connection to WA to reach a state */ - waitForConnectionUpdate: (check: (u: Partial) => boolean, timeoutMs?: number) => Promise; - type: "legacy"; - ws: import("ws"); - sendAdminTest: () => Promise; - updateKeys: (info: { - encKey: Buffer; - macKey: Buffer; - }) => { - encKey: Buffer; - macKey: Buffer; - }; - waitForSocketOpen: () => Promise; - sendNode: ({ json, binaryTag, tag, longTag }: import("../Types").SocketSendMessageOptions) => Promise; - generateMessageTag: (longTag?: boolean) => string; - waitForMessage: (tag: string, requiresPhoneConnection: boolean, timeoutMs?: number) => { - promise: Promise; - cancelToken: () => void; - }; - query: ({ json, timeoutMs, expect200, tag, longTag, binaryTag, requiresPhoneConnection }: import("../Types").SocketQueryOptions) => Promise; - setQuery: (nodes: import("..").BinaryNode[], binaryTag?: import("../Types").WATag, tag?: string) => Promise<{ - status: number; - }>; - currentEpoch: () => number; - end: (error: Error) => void; -}; -export default makeAuthSocket; diff --git a/node_modules/@adiwajshing/baileys/lib/LegacySocket/business.d.ts b/node_modules/@adiwajshing/baileys/lib/LegacySocket/business.d.ts new file mode 100644 index 000000000..501fc14cf --- /dev/null +++ b/node_modules/@adiwajshing/baileys/lib/LegacySocket/business.d.ts @@ -0,0 +1,100 @@ +/// +/// +import { LegacySocketConfig, OrderDetails } from '../Types'; +import { Product, ProductCreate, ProductUpdate } from '../Types'; +declare const makeBusinessSocket: (config: LegacySocketConfig) => { + getOrderDetails: (orderId: string, tokenBase64: string) => Promise; + getCatalog: (jid?: string, limit?: number) => Promise<{ + beforeCursor: string; + products: Product[]; + }>; + productCreate: (product: ProductCreate) => Promise; + productDelete: (productIds: string[]) => Promise<{ + deleted: any; + }>; + productUpdate: (productId: string, update: ProductUpdate) => Promise; + groupMetadata: (jid: string, minimal: boolean) => Promise; + groupCreate: (title: string, participants: string[]) => Promise; + groupLeave: (id: string) => Promise; + groupUpdateSubject: (id: string, title: string) => Promise; + groupUpdateDescription: (jid: string, description: string) => Promise<{ + status: number; + }>; + groupParticipantsUpdate: (id: string, participants: string[], action: import("../Types").ParticipantAction) => Promise; + getBroadcastListInfo: (jid: string) => Promise; + groupInviteCode: (jid: string) => Promise; + relayMessage: (message: import("../Types").WAProto.IWebMessageInfo, { waitForAck }?: { + waitForAck: boolean; + }) => Promise; + waUploadToServer: import("../Types").WAMediaUploadFunction; + generateUrlInfo: (text: string) => Promise; + messageInfo: (jid: string, messageID: string) => Promise; + downloadMediaMessage: (message: import("../Types").WAProto.IWebMessageInfo, type?: "stream" | "buffer", options?: import("..").MediaDownloadOptions) => Promise; + updateMediaMessage: (message: import("../Types").WAProto.IWebMessageInfo) => Promise; + fetchMessagesFromWA: (jid: string, count: number, cursor?: import("../Types").WAMessageCursor) => Promise; + loadMessageFromWA: (jid: string, id: string) => Promise; + searchMessages: (txt: string, inJid: string, count: number, page: number) => Promise<{ + last: boolean; + messages: import("../Types").WAProto.WebMessageInfo[]; + }>; + sendMessage: (jid: string, content: import("../Types").AnyMessageContent, options?: import("../Types").MiscMessageGenerationOptions & { + waitForAck?: boolean; + }) => Promise; + sendChatsQuery: (epoch: number) => Promise; + profilePictureUrl: (jid: string, timeoutMs?: number) => Promise; + chatRead: (fromMessage: import("../Types").WAProto.IMessageKey, count: number) => Promise; + chatModify: (modification: import("../Types").ChatModification, jid: string, chatInfo: Pick, timestampNow?: number) => Promise; + onWhatsApp: (str: string) => Promise<{ + exists: boolean; + jid: string; + isBusiness: boolean; + }>; + sendPresenceUpdate: (type: import("../Types").WAPresence, toJid?: string) => Promise; + presenceSubscribe: (jid: string) => Promise; + getStatus: (jid: string) => Promise<{ + status: string; + }>; + setStatus: (status: string) => Promise<{ + status: number; + }>; + updateBusinessProfile: (profile: import("../Types").WABusinessProfile) => Promise; + updateProfileName: (name: string) => Promise<{ + status: number; + pushname: string; + }>; + updateProfilePicture(jid: string, img: Buffer): Promise; + blockUser: (jid: string, type?: "add" | "remove") => Promise; + getBusinessProfile: (jid: string) => Promise; + state: import("../Types").ConnectionState; + authInfo: import("../Types").LegacyAuthenticationCreds; + ev: import("../Types").LegacyBaileysEventEmitter; + canLogin: () => boolean; + logout: () => Promise; + waitForConnectionUpdate: (check: (u: Partial) => boolean, timeoutMs?: number) => Promise; + type: "legacy"; + ws: import("ws"); + sendAdminTest: () => Promise; + updateKeys: (info: { + encKey: Buffer; + macKey: Buffer; + }) => { + encKey: Buffer; + macKey: Buffer; + }; + waitForSocketOpen: () => Promise; + sendNode: ({ json, binaryTag, tag, longTag }: import("../Types").SocketSendMessageOptions) => Promise; + generateMessageTag: (longTag?: boolean) => string; + waitForMessage: (tag: string, requiresPhoneConnection: boolean, timeoutMs?: number) => { + promise: Promise; + cancelToken: () => void; + }; + query: ({ json, timeoutMs, expect200, tag, longTag, binaryTag, requiresPhoneConnection }: import("../Types").SocketQueryOptions) => Promise; + setQuery: (nodes: import("..").BinaryNode[], binaryTag?: import("../Types").WATag, tag?: string) => Promise<{ + status: number; + }>; + currentEpoch: () => number; + end: (error: Error) => void; +}; +export default makeBusinessSocket; diff --git a/node_modules/@adiwajshing/baileys/lib/LegacySocket/business.js b/node_modules/@adiwajshing/baileys/lib/LegacySocket/business.js new file mode 100644 index 000000000..a1992c541 --- /dev/null +++ b/node_modules/@adiwajshing/baileys/lib/LegacySocket/business.js @@ -0,0 +1,168 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const business_1 = require("../Utils/business"); +const groups_1 = __importDefault(require("./groups")); +const makeBusinessSocket = (config) => { + const sock = groups_1.default(config); + const { query, generateMessageTag, waUploadToServer, state } = sock; + const getCatalog = async (jid, limit = 10) => { + var _a, _b; + jid = jid || ((_b = (_a = state.legacy) === null || _a === void 0 ? void 0 : _a.user) === null || _b === void 0 ? void 0 : _b.id); + const result = await query({ + expect200: true, + json: [ + 'query', + 'bizCatalog', + { + allowShopSource: false, + catalogWid: jid, + height: 100, + width: 100, + limit, + stanza_id: generateMessageTag(true), + type: 'get_product_catalog_reh', + } + ] + }); + const products = result.data.data.map(mapProduct); + return { + beforeCursor: result.data.paging.cursors.before, + products + }; + }; + const productCreate = async (product) => { + const result = await query({ + expect200: true, + json: [ + 'action', + 'addProduct_reh', + await mapProductCreate(product) + ] + }); + return mapProduct(result.data.product); + }; + const productDelete = async (productIds) => { + const result = await query({ + expect200: true, + json: [ + 'action', + 'deleteProduct_reh', + { + product_ids: productIds, + stanza_id: generateMessageTag(true), + } + ] + }); + return { + deleted: result.data.deleted_count + }; + }; + const productUpdate = async (productId, update) => { + const productCreate = await mapProductCreate({ ...update, originCountryCode: undefined }, false); + const result = await query({ + expect200: true, + json: [ + 'action', + 'editProduct_reh', + { + product_id: productId, + ...productCreate + } + ] + }); + return mapProduct(result.data.product); + }; + const getOrderDetails = async (orderId, tokenBase64) => { + const result = await query({ + expect200: true, + json: [ + 'query', + 'order', + { + id: generateMessageTag(true), + orderId, + imageWidth: '80', + imageHeight: '80', + token: tokenBase64 + } + ] + }); + const data = result.data; + const order = { + price: { + currency: data.price.currency, + total: data.price.total, + }, + products: data.products.map(p => { + var _a; + return ({ + id: p.id, + imageUrl: (_a = p.image) === null || _a === void 0 ? void 0 : _a.url, + name: p.name, + quantity: +p.quantity, + currency: p.currency, + price: +p.price + }); + }) + }; + return order; + }; + // maps product create to send to WA + const mapProductCreate = async (product, mapCompliance = true) => { + const imgs = (await business_1.uploadingNecessaryImages(product.images, waUploadToServer)).map(img => img.url); + const result = { + name: product.name, + description: product.description, + image_url: imgs[0], + url: product.url || '', + additional_image_urls: imgs.slice(1), + retailer_id: product.retailerId || '', + width: '100', + height: '100', + stanza_id: generateMessageTag(true), + price: product.price.toString(), + currency: product.currency + }; + if (mapCompliance) { + Object.assign(result, { + compliance_category: product.originCountryCode + ? undefined : + 'COUNTRY_ORIGIN_EXEMPT', + compliance_info: product.originCountryCode + ? { country_code_origin: product.originCountryCode } + : undefined + }); + } + return result; + }; + return { + ...sock, + getOrderDetails, + getCatalog, + productCreate, + productDelete, + productUpdate + }; +}; +const mapProduct = (item) => ({ + id: item.id, + name: item.name, + retailerId: item.retailer_id, + price: +item.price, + description: item.description, + currency: item.currency, + imageUrls: item.image_cdn_urls.reduce((dict, { key, value }) => { + dict[key] = value; + return dict; + }, {}), + reviewStatus: item.capability_to_review_status.reduce((dict, { key, value }) => { + dict[key] = value; + return dict; + }, {}), + isHidden: item.is_hidden, + availability: item.availability +}); +exports.default = makeBusinessSocket; diff --git a/node_modules/@adiwajshing/baileys/lib/LegacySocket/chats.d.ts b/node_modules/@adiwajshing/baileys/lib/LegacySocket/chats.d.ts new file mode 100644 index 000000000..1cd2966bf --- /dev/null +++ b/node_modules/@adiwajshing/baileys/lib/LegacySocket/chats.d.ts @@ -0,0 +1,102 @@ +/// +/// +import { Chat, ChatModification, LegacySocketConfig, WABusinessProfile, WAMessageKey, WAPresence } from '../Types'; +import { BinaryNode } from '../WABinary'; +declare const makeChatsSocket: (config: LegacySocketConfig) => { + sendChatsQuery: (epoch: number) => Promise; + profilePictureUrl: (jid: string, timeoutMs?: number) => Promise; + chatRead: (fromMessage: WAMessageKey, count: number) => Promise; + /** + * Modify a given chat (archive, pin etc.) + * @param jid the ID of the person/group you are modifiying + */ + chatModify: (modification: ChatModification, jid: string, chatInfo: Pick, timestampNow?: number) => Promise; + /** + * Query whether a given number is registered on WhatsApp + * @param str phone number/jid you want to check for + * @returns undefined if the number doesn't exists, otherwise the correctly formatted jid + */ + onWhatsApp: (str: string) => Promise<{ + exists: boolean; + jid: string; + isBusiness: boolean; + }>; + /** + * Tell someone about your presence -- online, typing, offline etc. + * @param jid the ID of the person/group who you are updating + * @param type your presence + */ + sendPresenceUpdate: (type: WAPresence, toJid?: string) => Promise; + /** + * Request updates on the presence of a user + * this returns nothing, you'll receive updates in chats.update event + * */ + presenceSubscribe: (jid: string) => Promise; + /** Query the status of the person (see groupMetadata() for groups) */ + getStatus: (jid: string) => Promise<{ + status: string; + }>; + setStatus: (status: string) => Promise<{ + status: number; + }>; + /** Updates business profile. */ + updateBusinessProfile: (profile: WABusinessProfile) => Promise; + updateProfileName: (name: string) => Promise<{ + status: number; + pushname: string; + }>; + /** + * Update the profile picture + * @param jid + * @param img + */ + updateProfilePicture(jid: string, img: Buffer): Promise; + /** + * Add or remove user from blocklist + * @param jid the ID of the person who you are blocking/unblocking + * @param type type of operation + */ + blockUser: (jid: string, type?: 'add' | 'remove') => Promise; + /** + * Query Business Profile (Useful for VCards) + * @param jid Business Jid + * @returns profile object or undefined if not business account + */ + getBusinessProfile: (jid: string) => Promise; + state: import("../Types").ConnectionState; + authInfo: import("../Types").LegacyAuthenticationCreds; + ev: import("../Types").LegacyBaileysEventEmitter; + canLogin: () => boolean; + logout: () => Promise; + waitForConnectionUpdate: (check: (u: Partial) => boolean, timeoutMs?: number) => Promise; + type: "legacy"; + ws: import("ws"); + sendAdminTest: () => Promise; + updateKeys: (info: { + encKey: Buffer; + macKey: Buffer; + }) => { + encKey: Buffer; + macKey: Buffer; + }; + waitForSocketOpen: () => Promise; + sendNode: ({ json, binaryTag, tag, longTag }: import("../Types").SocketSendMessageOptions) => Promise; + generateMessageTag: (longTag?: boolean) => string; + waitForMessage: (tag: string, requiresPhoneConnection: boolean, timeoutMs?: number) => { + promise: Promise; + cancelToken: () => void; + }; + query: ({ json, timeoutMs, expect200, tag, longTag, binaryTag, requiresPhoneConnection }: import("../Types").SocketQueryOptions) => Promise; + setQuery: (nodes: BinaryNode[], binaryTag?: import("../Types").WATag, tag?: string) => Promise<{ + status: number; + }>; + currentEpoch: () => number; /** + * Update the profile picture + * @param jid + * @param img + */ + end: (error: Error) => void; +}; +export default makeChatsSocket; diff --git a/node_modules/@adiwajshing/baileys/lib/LegacySocket/chats.d_1.ts b/node_modules/@adiwajshing/baileys/lib/LegacySocket/chats.d_1.ts deleted file mode 100644 index db407a1bf..000000000 --- a/node_modules/@adiwajshing/baileys/lib/LegacySocket/chats.d_1.ts +++ /dev/null @@ -1,98 +0,0 @@ -/// -/// -import { Chat, ChatModification, LegacySocketConfig, WABusinessProfile, WAMessageKey, WAPresence } from '../Types'; -import { BinaryNode } from '../WABinary'; -declare const makeChatsSocket: (config: LegacySocketConfig) => { - sendChatsQuery: (epoch: number) => Promise; - profilePictureUrl: (jid: string, timeoutMs?: number) => Promise; - chatRead: (fromMessage: WAMessageKey, count: number) => Promise; - /** - * Modify a given chat (archive, pin etc.) - * @param jid the ID of the person/group you are modifiying - */ - chatModify: (modification: ChatModification, jid: string, chatInfo: Pick, timestampNow?: number) => Promise; - /** - * Query whether a given number is registered on WhatsApp - * @param str phone number/jid you want to check for - * @returns undefined if the number doesn't exists, otherwise the correctly formatted jid - */ - onWhatsApp: (str: string) => Promise<{ - exists: boolean; - jid: string; - isBusiness: boolean; - }>; - /** - * Tell someone about your presence -- online, typing, offline etc. - * @param jid the ID of the person/group who you are updating - * @param type your presence - */ - sendPresenceUpdate: (type: WAPresence, jid: string | undefined) => Promise; - /** - * Request updates on the presence of a user - * this returns nothing, you'll receive updates in chats.update event - * */ - presenceSubscribe: (jid: string) => Promise; - /** Query the status of the person (see groupMetadata() for groups) */ - getStatus: (jid: string) => Promise<{ - status: string; - }>; - setStatus: (status: string) => Promise<{ - status: number; - }>; - /** Updates business profile. */ - updateBusinessProfile: (profile: WABusinessProfile) => Promise; - updateProfileName: (name: string) => Promise<{ - status: number; - pushname: string; - }>; - /** - * Update the profile picture - * @param jid - * @param img - */ - updateProfilePicture(jid: string, img: Buffer): Promise; - /** - * Add or remove user from blocklist - * @param jid the ID of the person who you are blocking/unblocking - * @param type type of operation - */ - blockUser: (jid: string, type?: 'add' | 'remove') => Promise; - /** - * Query Business Profile (Useful for VCards) - * @param jid Business Jid - * @returns profile object or undefined if not business account - */ - getBusinessProfile: (jid: string) => Promise; - state: import("../Types").ConnectionState; - authInfo: import("../Types").LegacyAuthenticationCreds; - ev: import("../Types").LegacyBaileysEventEmitter; - canLogin: () => boolean; - logout: () => Promise; - waitForConnectionUpdate: (check: (u: Partial) => boolean, timeoutMs?: number) => Promise; - type: "legacy"; - ws: import("ws"); - sendAdminTest: () => Promise; - updateKeys: (info: { - encKey: Buffer; - macKey: Buffer; - }) => { - encKey: Buffer; - macKey: Buffer; - }; - waitForSocketOpen: () => Promise; - sendNode: ({ json, binaryTag, tag, longTag }: import("../Types").SocketSendMessageOptions) => Promise; - generateMessageTag: (longTag?: boolean) => string; - waitForMessage: (tag: string, requiresPhoneConnection: boolean, timeoutMs?: number) => { - promise: Promise; - cancelToken: () => void; - }; - query: ({ json, timeoutMs, expect200, tag, longTag, binaryTag, requiresPhoneConnection }: import("../Types").SocketQueryOptions) => Promise; - setQuery: (nodes: BinaryNode[], binaryTag?: import("../Types").WATag, tag?: string) => Promise<{ - status: number; - }>; - currentEpoch: () => number; - end: (error: Error) => void; -}; -export default makeChatsSocket; diff --git a/node_modules/@adiwajshing/baileys/lib/LegacySocket/chats.js b/node_modules/@adiwajshing/baileys/lib/LegacySocket/chats.js index 26130d6e4..bc41e4c3e 100644 --- a/node_modules/@adiwajshing/baileys/lib/LegacySocket/chats.js +++ b/node_modules/@adiwajshing/baileys/lib/LegacySocket/chats.js @@ -355,7 +355,7 @@ const makeChatsSocket = (config) => { * @param jid the ID of the person/group who you are updating * @param type your presence */ - sendPresenceUpdate: (type, jid) => (sendNode({ + sendPresenceUpdate: (type, toJid) => (sendNode({ binaryTag: [Types_1.WAMetric.presence, Types_1.WAFlag[type]], json: { tag: 'action', @@ -363,7 +363,7 @@ const makeChatsSocket = (config) => { content: [ { tag: 'presence', - attrs: { type: type, to: jid } + attrs: { type: type, to: toJid } } ] } diff --git a/node_modules/@adiwajshing/baileys/lib/LegacySocket/groups.d.ts b/node_modules/@adiwajshing/baileys/lib/LegacySocket/groups.d.ts new file mode 100644 index 000000000..1b74f175b --- /dev/null +++ b/node_modules/@adiwajshing/baileys/lib/LegacySocket/groups.d.ts @@ -0,0 +1,115 @@ +/// +/// +import { GroupMetadata, LegacySocketConfig, ParticipantAction } from '../Types'; +import { BinaryNode } from '../WABinary'; +declare const makeGroupsSocket: (config: LegacySocketConfig) => { + groupMetadata: (jid: string, minimal: boolean) => Promise; + /** + * Create a group + * @param title like, the title of the group + * @param participants people to include in the group + */ + groupCreate: (title: string, participants: string[]) => Promise; + /** + * Leave a group + * @param jid the ID of the group + */ + groupLeave: (id: string) => Promise; + /** + * Update the subject of the group + * @param {string} jid the ID of the group + * @param {string} title the new title of the group + */ + groupUpdateSubject: (id: string, title: string) => Promise; + /** + * Update the group description + * @param {string} jid the ID of the group + * @param {string} title the new title of the group + */ + groupUpdateDescription: (jid: string, description: string) => Promise<{ + status: number; + }>; + /** + * Update participants in the group + * @param jid the ID of the group + * @param participants the people to add + */ + groupParticipantsUpdate: (id: string, participants: string[], action: ParticipantAction) => Promise; + /** Query broadcast list info */ + getBroadcastListInfo: (jid: string) => Promise; + groupInviteCode: (jid: string) => Promise; + relayMessage: (message: import("../Types").WAProto.IWebMessageInfo, { waitForAck }?: { + waitForAck: boolean; + }) => Promise; + waUploadToServer: import("../Types").WAMediaUploadFunction; + generateUrlInfo: (text: string) => Promise; + messageInfo: (jid: string, messageID: string) => Promise; + downloadMediaMessage: (message: import("../Types").WAProto.IWebMessageInfo, type?: "stream" | "buffer", options?: import("..").MediaDownloadOptions) => Promise; + updateMediaMessage: (message: import("../Types").WAProto.IWebMessageInfo) => Promise; + fetchMessagesFromWA: (jid: string, count: number, cursor?: import("../Types").WAMessageCursor) => Promise; + loadMessageFromWA: (jid: string, id: string) => Promise; + searchMessages: (txt: string, inJid: string, count: number, page: number) => Promise<{ + last: boolean; + messages: import("../Types").WAProto.WebMessageInfo[]; + }>; + sendMessage: (jid: string, content: import("../Types").AnyMessageContent, options?: import("../Types").MiscMessageGenerationOptions & { + waitForAck?: boolean; + }) => Promise; + sendChatsQuery: (epoch: number) => Promise; + profilePictureUrl: (jid: string, timeoutMs?: number) => Promise; + chatRead: (fromMessage: import("../Types").WAProto.IMessageKey, count: number) => Promise; + chatModify: (modification: import("../Types").ChatModification, jid: string, chatInfo: Pick, timestampNow?: number) => Promise; + onWhatsApp: (str: string) => Promise<{ + exists: boolean; + jid: string; + isBusiness: boolean; + }>; + sendPresenceUpdate: (type: import("../Types").WAPresence, toJid?: string) => Promise; + presenceSubscribe: (jid: string) => Promise; + getStatus: (jid: string) => Promise<{ + status: string; + }>; + setStatus: (status: string) => Promise<{ + status: number; + }>; + updateBusinessProfile: (profile: import("../Types").WABusinessProfile) => Promise; + updateProfileName: (name: string) => Promise<{ + status: number; + pushname: string; + }>; + updateProfilePicture(jid: string, img: Buffer): Promise; + blockUser: (jid: string, type?: "add" | "remove") => Promise; + getBusinessProfile: (jid: string) => Promise; + state: import("../Types").ConnectionState; + authInfo: import("../Types").LegacyAuthenticationCreds; + ev: import("../Types").LegacyBaileysEventEmitter; + canLogin: () => boolean; + logout: () => Promise; + waitForConnectionUpdate: (check: (u: Partial) => boolean, timeoutMs?: number) => Promise; + type: "legacy"; + ws: import("ws"); + sendAdminTest: () => Promise; + updateKeys: (info: { + encKey: Buffer; + macKey: Buffer; + }) => { + encKey: Buffer; + macKey: Buffer; + }; + waitForSocketOpen: () => Promise; + sendNode: ({ json, binaryTag, tag, longTag }: import("../Types").SocketSendMessageOptions) => Promise; + generateMessageTag: (longTag?: boolean) => string; + waitForMessage: (tag: string, requiresPhoneConnection: boolean, timeoutMs?: number) => { + promise: Promise; + cancelToken: () => void; + }; + query: ({ json, timeoutMs, expect200, tag, longTag, binaryTag, requiresPhoneConnection }: import("../Types").SocketQueryOptions) => Promise; + setQuery: (nodes: BinaryNode[], binaryTag?: import("../Types").WATag, tag?: string) => Promise<{ + status: number; + }>; + currentEpoch: () => number; + end: (error: Error) => void; +}; +export default makeGroupsSocket; diff --git a/node_modules/@adiwajshing/baileys/lib/LegacySocket/groups.d_1.ts b/node_modules/@adiwajshing/baileys/lib/LegacySocket/groups.d_1.ts deleted file mode 100644 index f042c0906..000000000 --- a/node_modules/@adiwajshing/baileys/lib/LegacySocket/groups.d_1.ts +++ /dev/null @@ -1,114 +0,0 @@ -/// -/// -import { GroupMetadata, LegacySocketConfig, ParticipantAction } from '../Types'; -import { BinaryNode } from '../WABinary'; -declare const makeGroupsSocket: (config: LegacySocketConfig) => { - groupMetadata: (jid: string, minimal: boolean) => Promise; - /** - * Create a group - * @param title like, the title of the group - * @param participants people to include in the group - */ - groupCreate: (title: string, participants: string[]) => Promise; - /** - * Leave a group - * @param jid the ID of the group - */ - groupLeave: (id: string) => Promise; - /** - * Update the subject of the group - * @param {string} jid the ID of the group - * @param {string} title the new title of the group - */ - groupUpdateSubject: (id: string, title: string) => Promise; - /** - * Update the group description - * @param {string} jid the ID of the group - * @param {string} title the new title of the group - */ - groupUpdateDescription: (jid: string, description: string) => Promise<{ - status: number; - }>; - /** - * Update participants in the group - * @param jid the ID of the group - * @param participants the people to add - */ - groupParticipantsUpdate: (id: string, participants: string[], action: ParticipantAction) => Promise; - /** Query broadcast list info */ - getBroadcastListInfo: (jid: string) => Promise; - groupInviteCode: (jid: string) => Promise; - relayMessage: (message: import("../Types").WAProto.IWebMessageInfo, { waitForAck }?: { - waitForAck: boolean; - }) => Promise; - generateUrlInfo: (text: string) => Promise; - messageInfo: (jid: string, messageID: string) => Promise; - downloadMediaMessage: (message: import("../Types").WAProto.IWebMessageInfo, type?: "stream" | "buffer") => Promise; - updateMediaMessage: (message: import("../Types").WAProto.IWebMessageInfo) => Promise; - fetchMessagesFromWA: (jid: string, count: number, cursor?: import("../Types").WAMessageCursor) => Promise; - loadMessageFromWA: (jid: string, id: string) => Promise; - searchMessages: (txt: string, inJid: string, count: number, page: number) => Promise<{ - last: boolean; - messages: import("../Types").WAProto.WebMessageInfo[]; - }>; - sendMessage: (jid: string, content: import("../Types").AnyMessageContent, options?: import("../Types").MiscMessageGenerationOptions & { - waitForAck?: boolean; - }) => Promise; - sendChatsQuery: (epoch: number) => Promise; - profilePictureUrl: (jid: string, timeoutMs?: number) => Promise; - chatRead: (fromMessage: import("../Types").WAProto.IMessageKey, count: number) => Promise; - chatModify: (modification: import("../Types").ChatModification, jid: string, chatInfo: Pick, timestampNow?: number) => Promise; - onWhatsApp: (str: string) => Promise<{ - exists: boolean; - jid: string; - isBusiness: boolean; - }>; - sendPresenceUpdate: (type: import("../Types").WAPresence, jid: string) => Promise; - presenceSubscribe: (jid: string) => Promise; - getStatus: (jid: string) => Promise<{ - status: string; - }>; - setStatus: (status: string) => Promise<{ - status: number; - }>; - updateBusinessProfile: (profile: import("../Types").WABusinessProfile) => Promise; - updateProfileName: (name: string) => Promise<{ - status: number; - pushname: string; - }>; - updateProfilePicture(jid: string, img: Buffer): Promise; - blockUser: (jid: string, type?: "add" | "remove") => Promise; - getBusinessProfile: (jid: string) => Promise; - state: import("../Types").ConnectionState; - authInfo: import("../Types").LegacyAuthenticationCreds; - ev: import("../Types").LegacyBaileysEventEmitter; - canLogin: () => boolean; - logout: () => Promise; - waitForConnectionUpdate: (check: (u: Partial) => boolean, timeoutMs?: number) => Promise; - type: "legacy"; - ws: import("ws"); - sendAdminTest: () => Promise; - updateKeys: (info: { - encKey: Buffer; - macKey: Buffer; - }) => { - encKey: Buffer; - macKey: Buffer; - }; - waitForSocketOpen: () => Promise; - sendNode: ({ json, binaryTag, tag, longTag }: import("../Types").SocketSendMessageOptions) => Promise; - generateMessageTag: (longTag?: boolean) => string; - waitForMessage: (tag: string, requiresPhoneConnection: boolean, timeoutMs?: number) => { - promise: Promise; - cancelToken: () => void; - }; - query: ({ json, timeoutMs, expect200, tag, longTag, binaryTag, requiresPhoneConnection }: import("../Types").SocketQueryOptions) => Promise; - setQuery: (nodes: BinaryNode[], binaryTag?: import("../Types").WATag, tag?: string) => Promise<{ - status: number; - }>; - currentEpoch: () => number; - end: (error: Error) => void; -}; -export default makeGroupsSocket; diff --git a/node_modules/@adiwajshing/baileys/lib/LegacySocket/groups.js b/node_modules/@adiwajshing/baileys/lib/LegacySocket/groups.js index 71dcacded..701c8b7c0 100644 --- a/node_modules/@adiwajshing/baileys/lib/LegacySocket/groups.js +++ b/node_modules/@adiwajshing/baileys/lib/LegacySocket/groups.js @@ -48,7 +48,8 @@ const makeGroupsSocket = (config) => { participants: metadata.participants.map(p => ({ id: WABinary_1.jidNormalizedUser(p.id), admin: p.isSuperAdmin ? 'super-admin' : p.isAdmin ? 'admin' : undefined - })) + })), + ephemeralDuration: metadata.ephemeralDuration }; return meta; }; diff --git a/node_modules/@adiwajshing/baileys/lib/LegacySocket/index.d.ts b/node_modules/@adiwajshing/baileys/lib/LegacySocket/index.d.ts new file mode 100644 index 000000000..43e2f94c7 --- /dev/null +++ b/node_modules/@adiwajshing/baileys/lib/LegacySocket/index.d.ts @@ -0,0 +1,99 @@ +/// +/// +import { LegacySocketConfig } from '../Types'; +declare const makeLegacySocket: (config: Partial) => { + getOrderDetails: (orderId: string, tokenBase64: string) => Promise; + getCatalog: (jid?: string, limit?: number) => Promise<{ + beforeCursor: string; + products: import("../Types").Product[]; + }>; + productCreate: (product: import("../Types").ProductCreate) => Promise; + productDelete: (productIds: string[]) => Promise<{ + deleted: any; + }>; + productUpdate: (productId: string, update: import("../Types").ProductUpdate) => Promise; + groupMetadata: (jid: string, minimal: boolean) => Promise; + groupCreate: (title: string, participants: string[]) => Promise; + groupLeave: (id: string) => Promise; + groupUpdateSubject: (id: string, title: string) => Promise; + groupUpdateDescription: (jid: string, description: string) => Promise<{ + status: number; + }>; + groupParticipantsUpdate: (id: string, participants: string[], action: import("../Types").ParticipantAction) => Promise; + getBroadcastListInfo: (jid: string) => Promise; + groupInviteCode: (jid: string) => Promise; + relayMessage: (message: import("../Types").WAProto.IWebMessageInfo, { waitForAck }?: { + waitForAck: boolean; + }) => Promise; + waUploadToServer: import("../Types").WAMediaUploadFunction; + generateUrlInfo: (text: string) => Promise; + messageInfo: (jid: string, messageID: string) => Promise; + downloadMediaMessage: (message: import("../Types").WAProto.IWebMessageInfo, type?: "stream" | "buffer", options?: import("..").MediaDownloadOptions) => Promise; + updateMediaMessage: (message: import("../Types").WAProto.IWebMessageInfo) => Promise; + fetchMessagesFromWA: (jid: string, count: number, cursor?: import("../Types").WAMessageCursor) => Promise; + loadMessageFromWA: (jid: string, id: string) => Promise; + searchMessages: (txt: string, inJid: string, count: number, page: number) => Promise<{ + last: boolean; + messages: import("../Types").WAProto.WebMessageInfo[]; + }>; + sendMessage: (jid: string, content: import("../Types").AnyMessageContent, options?: import("../Types").MiscMessageGenerationOptions & { + waitForAck?: boolean; + }) => Promise; + sendChatsQuery: (epoch: number) => Promise; + profilePictureUrl: (jid: string, timeoutMs?: number) => Promise; + chatRead: (fromMessage: import("../Types").WAProto.IMessageKey, count: number) => Promise; + chatModify: (modification: import("../Types").ChatModification, jid: string, chatInfo: Pick, timestampNow?: number) => Promise; + onWhatsApp: (str: string) => Promise<{ + exists: boolean; + jid: string; + isBusiness: boolean; + }>; + sendPresenceUpdate: (type: import("../Types").WAPresence, toJid?: string) => Promise; + presenceSubscribe: (jid: string) => Promise; + getStatus: (jid: string) => Promise<{ + status: string; + }>; + setStatus: (status: string) => Promise<{ + status: number; + }>; + updateBusinessProfile: (profile: import("../Types").WABusinessProfile) => Promise; + updateProfileName: (name: string) => Promise<{ + status: number; + pushname: string; + }>; + updateProfilePicture(jid: string, img: Buffer): Promise; + blockUser: (jid: string, type?: "add" | "remove") => Promise; + getBusinessProfile: (jid: string) => Promise; + state: import("../Types").ConnectionState; + authInfo: import("../Types").LegacyAuthenticationCreds; + ev: import("../Types").LegacyBaileysEventEmitter; + canLogin: () => boolean; + logout: () => Promise; + waitForConnectionUpdate: (check: (u: Partial) => boolean, timeoutMs?: number) => Promise; + type: "legacy"; + ws: import("ws"); + sendAdminTest: () => Promise; + updateKeys: (info: { + encKey: Buffer; + macKey: Buffer; + }) => { + encKey: Buffer; + macKey: Buffer; + }; + waitForSocketOpen: () => Promise; + sendNode: ({ json, binaryTag, tag, longTag }: import("../Types").SocketSendMessageOptions) => Promise; + generateMessageTag: (longTag?: boolean) => string; + waitForMessage: (tag: string, requiresPhoneConnection: boolean, timeoutMs?: number) => { + promise: Promise; + cancelToken: () => void; + }; + query: ({ json, timeoutMs, expect200, tag, longTag, binaryTag, requiresPhoneConnection }: import("../Types").SocketQueryOptions) => Promise; + setQuery: (nodes: import("..").BinaryNode[], binaryTag?: import("../Types").WATag, tag?: string) => Promise<{ + status: number; + }>; + currentEpoch: () => number; + end: (error: Error) => void; +}; +export default makeLegacySocket; diff --git a/node_modules/@adiwajshing/baileys/lib/LegacySocket/index.d_1.ts b/node_modules/@adiwajshing/baileys/lib/LegacySocket/index.d_1.ts deleted file mode 100644 index 87fd26ddd..000000000 --- a/node_modules/@adiwajshing/baileys/lib/LegacySocket/index.d_1.ts +++ /dev/null @@ -1,88 +0,0 @@ -/// -/// -import { LegacySocketConfig } from '../Types'; -declare const makeLegacySocket: (config: Partial) => { - groupMetadata: (jid: string, minimal: boolean) => Promise; - groupCreate: (title: string, participants: string[]) => Promise; - groupLeave: (id: string) => Promise; - groupUpdateSubject: (id: string, title: string) => Promise; - groupUpdateDescription: (jid: string, description: string) => Promise<{ - status: number; - }>; - groupParticipantsUpdate: (id: string, participants: string[], action: import("../Types").ParticipantAction) => Promise; - getBroadcastListInfo: (jid: string) => Promise; - groupInviteCode: (jid: string) => Promise; - relayMessage: (message: import("../Types").WAProto.IWebMessageInfo, { waitForAck }?: { - waitForAck: boolean; - }) => Promise; - generateUrlInfo: (text: string) => Promise; - messageInfo: (jid: string, messageID: string) => Promise; - downloadMediaMessage: (message: import("../Types").WAProto.IWebMessageInfo, type?: "stream" | "buffer") => Promise; - updateMediaMessage: (message: import("../Types").WAProto.IWebMessageInfo) => Promise; - fetchMessagesFromWA: (jid: string, count: number, cursor?: import("../Types").WAMessageCursor) => Promise; - loadMessageFromWA: (jid: string, id: string) => Promise; - searchMessages: (txt: string, inJid: string, count: number, page: number) => Promise<{ - last: boolean; - messages: import("../Types").WAProto.WebMessageInfo[]; - }>; - sendMessage: (jid: string, content: import("../Types").AnyMessageContent, options?: import("../Types").MiscMessageGenerationOptions & { - waitForAck?: boolean; - }) => Promise; - sendChatsQuery: (epoch: number) => Promise; - profilePictureUrl: (jid: string, timeoutMs?: number) => Promise; - chatRead: (fromMessage: import("../Types").WAProto.IMessageKey, count: number) => Promise; - chatModify: (modification: import("../Types").ChatModification, jid: string, chatInfo: Pick, timestampNow?: number) => Promise; - onWhatsApp: (str: string) => Promise<{ - exists: boolean; - jid: string; - isBusiness: boolean; - }>; - sendPresenceUpdate: (type: import("../Types").WAPresence, jid: string) => Promise; - presenceSubscribe: (jid: string) => Promise; - getStatus: (jid: string) => Promise<{ - status: string; - }>; - setStatus: (status: string) => Promise<{ - status: number; - }>; - updateBusinessProfile: (profile: import("../Types").WABusinessProfile) => Promise; - updateProfileName: (name: string) => Promise<{ - status: number; - pushname: string; - }>; - updateProfilePicture(jid: string, img: Buffer): Promise; - blockUser: (jid: string, type?: "add" | "remove") => Promise; - getBusinessProfile: (jid: string) => Promise; - state: import("../Types").ConnectionState; - authInfo: import("../Types").LegacyAuthenticationCreds; - ev: import("../Types").LegacyBaileysEventEmitter; - canLogin: () => boolean; - logout: () => Promise; - waitForConnectionUpdate: (check: (u: Partial) => boolean, timeoutMs?: number) => Promise; - type: "legacy"; - ws: import("ws"); - sendAdminTest: () => Promise; - updateKeys: (info: { - encKey: Buffer; - macKey: Buffer; - }) => { - encKey: Buffer; - macKey: Buffer; - }; - waitForSocketOpen: () => Promise; - sendNode: ({ json, binaryTag, tag, longTag }: import("../Types").SocketSendMessageOptions) => Promise; - generateMessageTag: (longTag?: boolean) => string; - waitForMessage: (tag: string, requiresPhoneConnection: boolean, timeoutMs?: number) => { - promise: Promise; - cancelToken: () => void; - }; - query: ({ json, timeoutMs, expect200, tag, longTag, binaryTag, requiresPhoneConnection }: import("../Types").SocketQueryOptions) => Promise; - setQuery: (nodes: import("..").BinaryNode[], binaryTag?: import("../Types").WATag, tag?: string) => Promise<{ - status: number; - }>; - currentEpoch: () => number; - end: (error: Error) => void; -}; -export default makeLegacySocket; diff --git a/node_modules/@adiwajshing/baileys/lib/LegacySocket/index.js b/node_modules/@adiwajshing/baileys/lib/LegacySocket/index.js index 013931178..ee1bcff07 100644 --- a/node_modules/@adiwajshing/baileys/lib/LegacySocket/index.js +++ b/node_modules/@adiwajshing/baileys/lib/LegacySocket/index.js @@ -4,9 +4,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) { }; Object.defineProperty(exports, "__esModule", { value: true }); const Defaults_1 = require("../Defaults"); -const groups_1 = __importDefault(require("./groups")); +const business_1 = __importDefault(require("./business")); // export the last socket layer -const makeLegacySocket = (config) => (groups_1.default({ +const makeLegacySocket = (config) => (business_1.default({ ...Defaults_1.DEFAULT_LEGACY_CONNECTION_CONFIG, ...config })); diff --git a/node_modules/@adiwajshing/baileys/lib/LegacySocket/messages.d.ts b/node_modules/@adiwajshing/baileys/lib/LegacySocket/messages.d.ts new file mode 100644 index 000000000..559e8460c --- /dev/null +++ b/node_modules/@adiwajshing/baileys/lib/LegacySocket/messages.d.ts @@ -0,0 +1,83 @@ +/// +/// +import { proto } from '../../WAProto'; +import { AnyMessageContent, Chat, LegacySocketConfig, MiscMessageGenerationOptions, WAMessage, WAMessageCursor, WAUrlInfo } from '../Types'; +import { MediaDownloadOptions } from '../Utils'; +import { BinaryNode } from '../WABinary'; +declare const makeMessagesSocket: (config: LegacySocketConfig) => { + relayMessage: (message: WAMessage, { waitForAck }?: { + waitForAck: boolean; + }) => Promise; + waUploadToServer: import("../Types").WAMediaUploadFunction; + generateUrlInfo: (text: string) => Promise; + messageInfo: (jid: string, messageID: string) => Promise; + downloadMediaMessage: (message: WAMessage, type?: 'buffer' | 'stream', options?: MediaDownloadOptions) => Promise; + updateMediaMessage: (message: WAMessage) => Promise; + fetchMessagesFromWA: (jid: string, count: number, cursor?: WAMessageCursor) => Promise; + /** Load a single message specified by the ID */ + loadMessageFromWA: (jid: string, id: string) => Promise; + searchMessages: (txt: string, inJid: string | null, count: number, page: number) => Promise<{ + last: boolean; + messages: proto.WebMessageInfo[]; + }>; + sendMessage: (jid: string, content: AnyMessageContent, options?: MiscMessageGenerationOptions & { + waitForAck?: boolean; + }) => Promise; + sendChatsQuery: (epoch: number) => Promise; + profilePictureUrl: (jid: string, timeoutMs?: number) => Promise; + chatRead: (fromMessage: proto.IMessageKey, count: number) => Promise; + chatModify: (modification: import("../Types").ChatModification, jid: string, chatInfo: Pick, timestampNow?: number) => Promise; + onWhatsApp: (str: string) => Promise<{ + exists: boolean; + jid: string; + isBusiness: boolean; + }>; + sendPresenceUpdate: (type: import("../Types").WAPresence, toJid?: string) => Promise; + presenceSubscribe: (jid: string) => Promise; + getStatus: (jid: string) => Promise<{ + status: string; + }>; + setStatus: (status: string) => Promise<{ + status: number; + }>; + updateBusinessProfile: (profile: import("../Types").WABusinessProfile) => Promise; + updateProfileName: (name: string) => Promise<{ + status: number; + pushname: string; + }>; + updateProfilePicture(jid: string, img: Buffer): Promise; + blockUser: (jid: string, type?: "add" | "remove") => Promise; + getBusinessProfile: (jid: string) => Promise; + state: import("../Types").ConnectionState; + authInfo: import("../Types").LegacyAuthenticationCreds; + ev: import("../Types").LegacyBaileysEventEmitter; + canLogin: () => boolean; + logout: () => Promise; + waitForConnectionUpdate: (check: (u: Partial) => boolean, timeoutMs?: number) => Promise; + type: "legacy"; + ws: import("ws"); + sendAdminTest: () => Promise; + updateKeys: (info: { + encKey: Buffer; + macKey: Buffer; + }) => { + encKey: Buffer; + macKey: Buffer; + }; + waitForSocketOpen: () => Promise; + sendNode: ({ json, binaryTag, tag, longTag }: import("../Types").SocketSendMessageOptions) => Promise; + generateMessageTag: (longTag?: boolean) => string; + waitForMessage: (tag: string, requiresPhoneConnection: boolean, timeoutMs?: number) => { + promise: Promise; + cancelToken: () => void; + }; + query: ({ json, timeoutMs, expect200, tag, longTag, binaryTag, requiresPhoneConnection }: import("../Types").SocketQueryOptions) => Promise; + setQuery: (nodes: BinaryNode[], binaryTag?: import("../Types").WATag, tag?: string) => Promise<{ + status: number; + }>; + currentEpoch: () => number; + end: (error: Error) => void; +}; +export default makeMessagesSocket; diff --git a/node_modules/@adiwajshing/baileys/lib/LegacySocket/messages.d_1.ts b/node_modules/@adiwajshing/baileys/lib/LegacySocket/messages.d_1.ts deleted file mode 100644 index 50e954743..000000000 --- a/node_modules/@adiwajshing/baileys/lib/LegacySocket/messages.d_1.ts +++ /dev/null @@ -1,81 +0,0 @@ -/// -/// -import { proto } from '../../WAProto'; -import { AnyMessageContent, Chat, LegacySocketConfig, MiscMessageGenerationOptions, WAMessage, WAMessageCursor, WAUrlInfo } from '../Types'; -import { BinaryNode } from '../WABinary'; -declare const makeMessagesSocket: (config: LegacySocketConfig) => { - relayMessage: (message: WAMessage, { waitForAck }?: { - waitForAck: boolean; - }) => Promise; - generateUrlInfo: (text: string) => Promise; - messageInfo: (jid: string, messageID: string) => Promise; - downloadMediaMessage: (message: WAMessage, type?: 'buffer' | 'stream') => Promise; - updateMediaMessage: (message: WAMessage) => Promise; - fetchMessagesFromWA: (jid: string, count: number, cursor?: WAMessageCursor) => Promise; - /** Load a single message specified by the ID */ - loadMessageFromWA: (jid: string, id: string) => Promise; - searchMessages: (txt: string, inJid: string | null, count: number, page: number) => Promise<{ - last: boolean; - messages: proto.WebMessageInfo[]; - }>; - sendMessage: (jid: string, content: AnyMessageContent, options?: MiscMessageGenerationOptions & { - waitForAck?: boolean; - }) => Promise; - sendChatsQuery: (epoch: number) => Promise; - profilePictureUrl: (jid: string, timeoutMs?: number) => Promise; - chatRead: (fromMessage: proto.IMessageKey, count: number) => Promise; - chatModify: (modification: import("../Types").ChatModification, jid: string, chatInfo: Pick, timestampNow?: number) => Promise; - onWhatsApp: (str: string) => Promise<{ - exists: boolean; - jid: string; - isBusiness: boolean; - }>; - sendPresenceUpdate: (type: import("../Types").WAPresence, jid: string) => Promise; - presenceSubscribe: (jid: string) => Promise; - getStatus: (jid: string) => Promise<{ - status: string; - }>; - setStatus: (status: string) => Promise<{ - status: number; - }>; - updateBusinessProfile: (profile: import("../Types").WABusinessProfile) => Promise; - updateProfileName: (name: string) => Promise<{ - status: number; - pushname: string; - }>; - updateProfilePicture(jid: string, img: Buffer): Promise; - blockUser: (jid: string, type?: "add" | "remove") => Promise; - getBusinessProfile: (jid: string) => Promise; - state: import("../Types").ConnectionState; - authInfo: import("../Types").LegacyAuthenticationCreds; - ev: import("../Types").LegacyBaileysEventEmitter; - canLogin: () => boolean; - logout: () => Promise; - waitForConnectionUpdate: (check: (u: Partial) => boolean, timeoutMs?: number) => Promise; - type: "legacy"; - ws: import("ws"); - sendAdminTest: () => Promise; - updateKeys: (info: { - encKey: Buffer; - macKey: Buffer; - }) => { - encKey: Buffer; - macKey: Buffer; - }; - waitForSocketOpen: () => Promise; - sendNode: ({ json, binaryTag, tag, longTag }: import("../Types").SocketSendMessageOptions) => Promise; - generateMessageTag: (longTag?: boolean) => string; - waitForMessage: (tag: string, requiresPhoneConnection: boolean, timeoutMs?: number) => { - promise: Promise; - cancelToken: () => void; - }; - query: ({ json, timeoutMs, expect200, tag, longTag, binaryTag, requiresPhoneConnection }: import("../Types").SocketQueryOptions) => Promise; - setQuery: (nodes: BinaryNode[], binaryTag?: import("../Types").WATag, tag?: string) => Promise<{ - status: number; - }>; - currentEpoch: () => number; - end: (error: Error) => void; -}; -export default makeMessagesSocket; diff --git a/node_modules/@adiwajshing/baileys/lib/LegacySocket/messages.js b/node_modules/@adiwajshing/baileys/lib/LegacySocket/messages.js index 1b8449447..9843dbfc2 100644 --- a/node_modules/@adiwajshing/baileys/lib/LegacySocket/messages.js +++ b/node_modules/@adiwajshing/baileys/lib/LegacySocket/messages.js @@ -16,7 +16,7 @@ const STATUS_MAP = { error: Types_1.WAMessageStatus.ERROR }; const makeMessagesSocket = (config) => { - const { logger } = config; + const { logger, treatCiphertextMessagesAsReal } = config; const sock = chats_1.default(config); const { ev, ws: socketEvents, query, generateMessageTag, currentEpoch, setQuery, state } = sock; let mediaConn; @@ -89,7 +89,7 @@ const makeMessagesSocket = (config) => { return response; }; const onMessage = (message, type) => { - var _a, _b, _c, _d; + var _a; const jid = message.key.remoteJid; // store chat updates in this const chatUpdate = { @@ -98,7 +98,12 @@ const makeMessagesSocket = (config) => { const emitGroupUpdate = (update) => { ev.emit('groups.update', [{ id: jid, ...update }]); }; - if (message.message) { + const normalizedContent = Utils_1.normalizeMessageContent(message.message); + const protocolMessage = normalizedContent === null || normalizedContent === void 0 ? void 0 : normalizedContent.protocolMessage; + if ((!!normalizedContent || + (message.messageStubType === Types_1.WAMessageStubType.CIPHERTEXT && treatCiphertextMessagesAsReal)) + && !(normalizedContent === null || normalizedContent === void 0 ? void 0 : normalizedContent.protocolMessage) + && !(normalizedContent === null || normalizedContent === void 0 ? void 0 : normalizedContent.reactionMessage)) { chatUpdate.conversationTimestamp = +Utils_1.toNumber(message.messageTimestamp); // add to count if the message isn't from me & there exists a message if (!message.key.fromMe) { @@ -110,7 +115,14 @@ const makeMessagesSocket = (config) => { }); } } - const protocolMessage = ((_a = message.message) === null || _a === void 0 ? void 0 : _a.protocolMessage) || ((_d = (_c = (_b = message.message) === null || _b === void 0 ? void 0 : _b.ephemeralMessage) === null || _c === void 0 ? void 0 : _c.message) === null || _d === void 0 ? void 0 : _d.protocolMessage); + if (normalizedContent === null || normalizedContent === void 0 ? void 0 : normalizedContent.reactionMessage) { + const reaction = { + ...normalizedContent.reactionMessage, + key: message.key, + }; + const operation = ((_a = normalizedContent.reactionMessage) === null || _a === void 0 ? void 0 : _a.text) ? 'add' : 'remove'; + ev.emit('messages.reaction', { reaction, key: normalizedContent.reactionMessage.key, operation }); + } // if it's a message to delete another message if (protocolMessage) { switch (protocolMessage.type) { @@ -136,7 +148,7 @@ const makeMessagesSocket = (config) => { break; } } - // check if the message is an action + // check if the message is an action if (message.messageStubType) { const { user } = state.legacy; //let actor = jidNormalizedUser (message.participant) @@ -269,7 +281,7 @@ const makeMessagesSocket = (config) => { onMessage(msg, 'notify'); } }); - // If a message has been updated + // If a message has been updated // usually called when a video message gets its upload url, or live locations or ciphertext message gets fixed socketEvents.on('CB:action,add:update,message', (node) => { const msgs = WABinary_1.getBinaryNodeMessages(node); @@ -350,6 +362,7 @@ const makeMessagesSocket = (config) => { return { ...sock, relayMessage, + waUploadToServer, generateUrlInfo, messageInfo: async (jid, messageID) => { const { content } = await query({ @@ -386,31 +399,16 @@ const makeMessagesSocket = (config) => { } return Object.values(info); }, - downloadMediaMessage: async (message, type = 'buffer') => { - const downloadMediaMessage = async () => { - const mContent = Utils_1.extractMessageContent(message.message); - if (!mContent) { - throw new boom_1.Boom('No message present', { statusCode: 400, data: message }); - } - const stream = await Utils_1.decryptMediaMessageBuffer(mContent); - if (type === 'buffer') { - let buffer = Buffer.from([]); - for await (const chunk of stream) { - buffer = Buffer.concat([buffer, chunk]); - } - return buffer; - } - return stream; - }; + downloadMediaMessage: async (message, type = 'buffer', options = {}) => { try { - const result = await downloadMediaMessage(); + const result = await Utils_1.downloadMediaMessage(message, type, options); return result; } catch (error) { if (error.message.includes('404')) { // media needs to be updated logger.info(`updating media of message: ${message.key.id}`); await updateMediaMessage(message); - const result = await downloadMediaMessage(); + const result = await Utils_1.downloadMediaMessage(message, type, options); return result; } throw error; diff --git a/node_modules/@adiwajshing/baileys/lib/LegacySocket/.trashed-1649374382-socket.d.ts b/node_modules/@adiwajshing/baileys/lib/LegacySocket/socket.d.ts similarity index 100% rename from node_modules/@adiwajshing/baileys/lib/LegacySocket/.trashed-1649374382-socket.d.ts rename to node_modules/@adiwajshing/baileys/lib/LegacySocket/socket.d.ts diff --git a/node_modules/@adiwajshing/baileys/lib/LegacySocket/socket.d_1.ts b/node_modules/@adiwajshing/baileys/lib/LegacySocket/socket.d_1.ts deleted file mode 100644 index 971a433e2..000000000 --- a/node_modules/@adiwajshing/baileys/lib/LegacySocket/socket.d_1.ts +++ /dev/null @@ -1,36 +0,0 @@ -/// -import WebSocket from 'ws'; -import { LegacySocketConfig, SocketQueryOptions, SocketSendMessageOptions, WATag } from '../Types'; -import { BinaryNode } from '../WABinary'; -/** - * Connects to WA servers and performs: - * - simple queries (no retry mechanism, wait for connection establishment) - * - listen to messages and emit events - * - query phone connection - */ -export declare const makeSocket: ({ waWebSocketUrl, connectTimeoutMs, phoneResponseTimeMs, logger, agent, keepAliveIntervalMs, expectResponseTimeout, }: LegacySocketConfig) => { - type: "legacy"; - ws: WebSocket; - sendAdminTest: () => Promise; - updateKeys: (info: { - encKey: Buffer; - macKey: Buffer; - }) => { - encKey: Buffer; - macKey: Buffer; - }; - waitForSocketOpen: () => Promise; - sendNode: ({ json, binaryTag, tag, longTag }: SocketSendMessageOptions) => Promise; - generateMessageTag: (longTag?: boolean) => string; - waitForMessage: (tag: string, requiresPhoneConnection: boolean, timeoutMs?: number) => { - promise: Promise; - cancelToken: () => void; - }; - query: ({ json, timeoutMs, expect200, tag, longTag, binaryTag, requiresPhoneConnection }: SocketQueryOptions) => Promise; - /** Generic function for action, set queries */ - setQuery: (nodes: BinaryNode[], binaryTag?: WATag, tag?: string) => Promise<{ - status: number; - }>; - currentEpoch: () => number; - end: (error: Error | undefined) => void; -}; diff --git a/node_modules/@adiwajshing/baileys/lib/Socket/.trashed-1649374382-chats.d.ts b/node_modules/@adiwajshing/baileys/lib/Socket/.trashed-1649374382-chats.d.ts deleted file mode 100644 index 2f0e4c300..000000000 --- a/node_modules/@adiwajshing/baileys/lib/Socket/.trashed-1649374382-chats.d.ts +++ /dev/null @@ -1,70 +0,0 @@ -/// -/// -import { proto } from '../../WAProto'; -import { AppStateChunk, ChatModification, Contact, SocketConfig, WABusinessProfile, WAMediaUpload, WAPatchCreate, WAPatchName, WAPresence } from '../Types'; -import { BinaryNode } from '../WABinary'; -export declare const makeChatsSocket: (config: SocketConfig) => { - appPatch: (patchCreate: WAPatchCreate) => Promise; - sendPresenceUpdate: (type: WAPresence, toJid?: string) => Promise; - presenceSubscribe: (toJid: string) => Promise; - profilePictureUrl: (jid: string, type?: 'preview' | 'image', timeoutMs?: number) => Promise; - onWhatsApp: (...jids: string[]) => Promise<{ - exists: boolean; - jid: string; - }[]>; - fetchBlocklist: () => Promise; - fetchStatus: (jid: string) => Promise<{ - status: string; - setAt: Date; - }>; - updateProfilePicture: (jid: string, content: WAMediaUpload) => Promise; - updateBlockStatus: (jid: string, action: 'block' | 'unblock') => Promise; - getBusinessProfile: (jid: string) => Promise; - resyncAppState: (collections: WAPatchName[]) => Promise; - chatModify: (mod: ChatModification, jid: string) => Promise; - resyncMainAppState: () => Promise; - assertSessions: (jids: string[], force: boolean) => Promise; - relayMessage: (jid: string, message: proto.IMessage, { messageId: msgId, participant, additionalAttributes, cachedGroupMetadata }: import("../Types").MessageRelayOptions) => Promise; - sendReceipt: (jid: string, participant: string, messageIds: string[], type: "read" | "read-self") => Promise; - sendReadReceipt: (jid: string, participant: string, messageIds: string[]) => Promise; - refreshMediaConn: (forceGet?: boolean) => Promise; - waUploadToServer: import("../Types").WAMediaUploadFunction; - fetchPrivacySettings: (force?: boolean) => Promise<{ - [_: string]: string; - }>; - sendMessage: (jid: string, content: import("../Types").AnyMessageContent, options?: import("../Types").MiscMessageGenerationOptions) => Promise; - groupMetadata: (jid: string) => Promise; - groupCreate: (subject: string, participants: string[]) => Promise; - groupLeave: (id: string) => Promise; - groupUpdateSubject: (jid: string, subject: string) => Promise; - groupParticipantsUpdate: (jid: string, participants: string[], action: import("../Types").ParticipantAction) => Promise; - groupUpdateDescription: (jid: string, description?: string) => Promise; - groupInviteCode: (jid: string) => Promise; - groupRevokeInvite: (jid: string) => Promise; - groupAcceptInvite: (code: string) => Promise; - groupToggleEphemeral: (jid: string, ephemeralExpiration: number) => Promise; - groupSettingUpdate: (jid: string, setting: "announcement" | "locked" | "not_announcement" | "unlocked") => Promise; - groupFetchAllParticipating: () => Promise<{ - [_: string]: import("../Types").GroupMetadata; - }>; - type: "md"; - ws: import("ws"); - ev: import("../Types").BaileysEventEmitter; - authState: { - creds: import("../Types").AuthenticationCreds; - keys: import("../Types").SignalKeyStoreWithTransaction; - }; - user: Contact; - assertingPreKeys: (range: number, execute: (keys: { - [_: number]: any; - }) => Promise) => Promise; - generateMessageTag: () => string; - query: (node: BinaryNode, timeoutMs?: number) => Promise; - waitForMessage: (msgId: string, timeoutMs?: number) => Promise; - waitForSocketOpen: () => Promise; - sendRawMessage: (data: Uint8Array | Buffer) => Promise; - sendNode: (node: BinaryNode) => Promise; - logout: () => Promise; - end: (error: Error) => void; - waitForConnectionUpdate: (check: (u: Partial) => boolean, timeoutMs?: number) => Promise; -}; diff --git a/node_modules/@adiwajshing/baileys/lib/Socket/.trashed-1649374382-groups.d.ts b/node_modules/@adiwajshing/baileys/lib/Socket/.trashed-1649374382-groups.d.ts deleted file mode 100644 index 5a723b6b3..000000000 --- a/node_modules/@adiwajshing/baileys/lib/Socket/.trashed-1649374382-groups.d.ts +++ /dev/null @@ -1,41 +0,0 @@ -/// -/// -import { GroupMetadata, ParticipantAction, SocketConfig } from '../Types'; -import { BinaryNode } from '../WABinary'; -export declare const makeGroupsSocket: (config: SocketConfig) => { - groupMetadata: (jid: string) => Promise; - groupCreate: (subject: string, participants: string[]) => Promise; - groupLeave: (id: string) => Promise; - groupUpdateSubject: (jid: string, subject: string) => Promise; - groupParticipantsUpdate: (jid: string, participants: string[], action: ParticipantAction) => Promise; - groupUpdateDescription: (jid: string, description?: string) => Promise; - groupInviteCode: (jid: string) => Promise; - groupRevokeInvite: (jid: string) => Promise; - groupAcceptInvite: (code: string) => Promise; - groupToggleEphemeral: (jid: string, ephemeralExpiration: number) => Promise; - groupSettingUpdate: (jid: string, setting: 'announcement' | 'not_announcement' | 'locked' | 'unlocked') => Promise; - groupFetchAllParticipating: () => Promise<{ - [_: string]: GroupMetadata; - }>; - type: "md"; - ws: import("ws"); - ev: import("../Types").BaileysEventEmitter; - authState: { - creds: import("../Types").AuthenticationCreds; - keys: import("../Types").SignalKeyStoreWithTransaction; - }; - user: import("../Types").Contact; - assertingPreKeys: (range: number, execute: (keys: { - [_: number]: any; - }) => Promise) => Promise; - generateMessageTag: () => string; - query: (node: BinaryNode, timeoutMs?: number) => Promise; - waitForMessage: (msgId: string, timeoutMs?: number) => Promise; - waitForSocketOpen: () => Promise; - sendRawMessage: (data: Uint8Array | Buffer) => Promise; - sendNode: (node: BinaryNode) => Promise; - logout: () => Promise; - end: (error: Error) => void; - waitForConnectionUpdate: (check: (u: Partial) => boolean, timeoutMs?: number) => Promise; -}; -export declare const extractGroupMetadata: (result: BinaryNode) => GroupMetadata; diff --git a/node_modules/@adiwajshing/baileys/lib/Socket/.trashed-1649374382-index.d.ts b/node_modules/@adiwajshing/baileys/lib/Socket/.trashed-1649374382-index.d.ts deleted file mode 100644 index 288946d16..000000000 --- a/node_modules/@adiwajshing/baileys/lib/Socket/.trashed-1649374382-index.d.ts +++ /dev/null @@ -1,74 +0,0 @@ -/// -/// -import { SocketConfig } from '../Types'; -declare const makeWASocket: (config: Partial) => { - processMessage: (message: import("../Types").WAProto.IWebMessageInfo, chatUpdate: Partial) => Promise; - sendMessageAck: ({ tag, attrs }: import("..").BinaryNode, extraAttrs: { - [key: string]: string; - }) => Promise; - sendRetryRequest: (node: import("..").BinaryNode) => Promise; - appPatch: (patchCreate: import("../Types").WAPatchCreate) => Promise; - sendPresenceUpdate: (type: import("../Types").WAPresence, toJid?: string) => Promise; - presenceSubscribe: (toJid: string) => Promise; - profilePictureUrl: (jid: string, type?: "image" | "preview", timeoutMs?: number) => Promise; - onWhatsApp: (...jids: string[]) => Promise<{ - exists: boolean; - jid: string; - }[]>; - fetchBlocklist: () => Promise; - fetchStatus: (jid: string) => Promise<{ - status: string; - setAt: Date; - }>; - updateProfilePicture: (jid: string, content: import("../Types").WAMediaUpload) => Promise; - updateBlockStatus: (jid: string, action: "block" | "unblock") => Promise; - getBusinessProfile: (jid: string) => Promise; - resyncAppState: (collections: import("../Types").WAPatchName[]) => Promise; - chatModify: (mod: import("../Types").ChatModification, jid: string) => Promise; - resyncMainAppState: () => Promise; - assertSessions: (jids: string[], force: boolean) => Promise; - relayMessage: (jid: string, message: import("../Types").WAProto.IMessage, { messageId: msgId, participant, additionalAttributes, cachedGroupMetadata }: import("../Types").MessageRelayOptions) => Promise; - sendReceipt: (jid: string, participant: string, messageIds: string[], type: "read" | "read-self") => Promise; - sendReadReceipt: (jid: string, participant: string, messageIds: string[]) => Promise; - refreshMediaConn: (forceGet?: boolean) => Promise; - waUploadToServer: import("../Types").WAMediaUploadFunction; - fetchPrivacySettings: (force?: boolean) => Promise<{ - [_: string]: string; - }>; - sendMessage: (jid: string, content: import("../Types").AnyMessageContent, options?: import("../Types").MiscMessageGenerationOptions) => Promise; - groupMetadata: (jid: string) => Promise; - groupCreate: (subject: string, participants: string[]) => Promise; - groupLeave: (id: string) => Promise; - groupUpdateSubject: (jid: string, subject: string) => Promise; - groupParticipantsUpdate: (jid: string, participants: string[], action: import("../Types").ParticipantAction) => Promise; - groupUpdateDescription: (jid: string, description?: string) => Promise; - groupInviteCode: (jid: string) => Promise; - groupRevokeInvite: (jid: string) => Promise; - groupAcceptInvite: (code: string) => Promise; - groupToggleEphemeral: (jid: string, ephemeralExpiration: number) => Promise; - groupSettingUpdate: (jid: string, setting: "announcement" | "locked" | "not_announcement" | "unlocked") => Promise; - groupFetchAllParticipating: () => Promise<{ - [_: string]: import("../Types").GroupMetadata; - }>; - type: "md"; - ws: import("ws"); - ev: import("../Types").BaileysEventEmitter; - authState: { - creds: import("../Types").AuthenticationCreds; - keys: import("../Types").SignalKeyStoreWithTransaction; - }; - user: import("../Types").Contact; - assertingPreKeys: (range: number, execute: (keys: { - [_: number]: any; - }) => Promise) => Promise; - generateMessageTag: () => string; - query: (node: import("..").BinaryNode, timeoutMs?: number) => Promise; - waitForMessage: (msgId: string, timeoutMs?: number) => Promise; - waitForSocketOpen: () => Promise; - sendRawMessage: (data: Uint8Array | Buffer) => Promise; - sendNode: (node: import("..").BinaryNode) => Promise; - logout: () => Promise; - end: (error: Error) => void; - waitForConnectionUpdate: (check: (u: Partial) => boolean, timeoutMs?: number) => Promise; -}; -export default makeWASocket; diff --git a/node_modules/@adiwajshing/baileys/lib/Socket/.trashed-1649374382-messages-recv.d.ts b/node_modules/@adiwajshing/baileys/lib/Socket/.trashed-1649374382-messages-recv.d.ts deleted file mode 100644 index a44ed0b1e..000000000 --- a/node_modules/@adiwajshing/baileys/lib/Socket/.trashed-1649374382-messages-recv.d.ts +++ /dev/null @@ -1,73 +0,0 @@ -/// -/// -import { proto } from '../../WAProto'; -import { Chat, GroupMetadata, ParticipantAction, SocketConfig } from '../Types'; -import { BinaryNode, BinaryNodeAttributes } from '../WABinary'; -export declare const makeMessagesRecvSocket: (config: SocketConfig) => { - processMessage: (message: proto.IWebMessageInfo, chatUpdate: Partial) => Promise; - sendMessageAck: ({ tag, attrs }: BinaryNode, extraAttrs: BinaryNodeAttributes) => Promise; - sendRetryRequest: (node: BinaryNode) => Promise; - appPatch: (patchCreate: import("../Types").WAPatchCreate) => Promise; - sendPresenceUpdate: (type: import("../Types").WAPresence, toJid?: string) => Promise; - presenceSubscribe: (toJid: string) => Promise; - profilePictureUrl: (jid: string, type?: "image" | "preview", timeoutMs?: number) => Promise; - onWhatsApp: (...jids: string[]) => Promise<{ - exists: boolean; - jid: string; - }[]>; - fetchBlocklist: () => Promise; - fetchStatus: (jid: string) => Promise<{ - status: string; - setAt: Date; - }>; - updateProfilePicture: (jid: string, content: import("../Types").WAMediaUpload) => Promise; - updateBlockStatus: (jid: string, action: "block" | "unblock") => Promise; - getBusinessProfile: (jid: string) => Promise; - resyncAppState: (collections: import("../Types").WAPatchName[]) => Promise; - chatModify: (mod: import("../Types").ChatModification, jid: string) => Promise; - resyncMainAppState: () => Promise; - assertSessions: (jids: string[], force: boolean) => Promise; - relayMessage: (jid: string, message: proto.IMessage, { messageId: msgId, participant, additionalAttributes, cachedGroupMetadata }: import("../Types").MessageRelayOptions) => Promise; - sendReceipt: (jid: string, participant: string, messageIds: string[], type: "read" | "read-self") => Promise; - sendReadReceipt: (jid: string, participant: string, messageIds: string[]) => Promise; - refreshMediaConn: (forceGet?: boolean) => Promise; - waUploadToServer: import("../Types").WAMediaUploadFunction; - fetchPrivacySettings: (force?: boolean) => Promise<{ - [_: string]: string; - }>; - sendMessage: (jid: string, content: import("../Types").AnyMessageContent, options?: import("../Types").MiscMessageGenerationOptions) => Promise; - groupMetadata: (jid: string) => Promise; - groupCreate: (subject: string, participants: string[]) => Promise; - groupLeave: (id: string) => Promise; - groupUpdateSubject: (jid: string, subject: string) => Promise; - groupParticipantsUpdate: (jid: string, participants: string[], action: ParticipantAction) => Promise; - groupUpdateDescription: (jid: string, description?: string) => Promise; - groupInviteCode: (jid: string) => Promise; - groupRevokeInvite: (jid: string) => Promise; - groupAcceptInvite: (code: string) => Promise; - groupToggleEphemeral: (jid: string, ephemeralExpiration: number) => Promise; - groupSettingUpdate: (jid: string, setting: "announcement" | "locked" | "not_announcement" | "unlocked") => Promise; - groupFetchAllParticipating: () => Promise<{ - [_: string]: GroupMetadata; - }>; - type: "md"; - ws: import("ws"); - ev: import("../Types").BaileysEventEmitter; - authState: { - creds: import("../Types").AuthenticationCreds; - keys: import("../Types").SignalKeyStoreWithTransaction; - }; - user: import("../Types").Contact; - assertingPreKeys: (range: number, execute: (keys: { - [_: number]: any; - }) => Promise) => Promise; - generateMessageTag: () => string; - query: (node: BinaryNode, timeoutMs?: number) => Promise; - waitForMessage: (msgId: string, timeoutMs?: number) => Promise; - waitForSocketOpen: () => Promise; - sendRawMessage: (data: Uint8Array | Buffer) => Promise; - sendNode: (node: BinaryNode) => Promise; - logout: () => Promise; - end: (error: Error) => void; - waitForConnectionUpdate: (check: (u: Partial) => boolean, timeoutMs?: number) => Promise; -}; diff --git a/node_modules/@adiwajshing/baileys/lib/Socket/.trashed-1649374382-messages-send.d.ts b/node_modules/@adiwajshing/baileys/lib/Socket/.trashed-1649374382-messages-send.d.ts deleted file mode 100644 index 44c4815f6..000000000 --- a/node_modules/@adiwajshing/baileys/lib/Socket/.trashed-1649374382-messages-send.d.ts +++ /dev/null @@ -1,51 +0,0 @@ -/// -/// -import { proto } from '../../WAProto'; -import { AnyMessageContent, MediaConnInfo, MessageRelayOptions, MiscMessageGenerationOptions, SocketConfig } from '../Types'; -import { BinaryNode } from '../WABinary'; -export declare const makeMessagesSocket: (config: SocketConfig) => { - assertSessions: (jids: string[], force: boolean) => Promise; - relayMessage: (jid: string, message: proto.IMessage, { messageId: msgId, participant, additionalAttributes, cachedGroupMetadata }: MessageRelayOptions) => Promise; - sendReceipt: (jid: string, participant: string | undefined, messageIds: string[], type: 'read' | 'read-self' | undefined) => Promise; - sendReadReceipt: (jid: string, participant: string | undefined, messageIds: string[]) => Promise; - refreshMediaConn: (forceGet?: boolean) => Promise; - waUploadToServer: import("../Types").WAMediaUploadFunction; - fetchPrivacySettings: (force?: boolean) => Promise<{ - [_: string]: string; - }>; - sendMessage: (jid: string, content: AnyMessageContent, options?: MiscMessageGenerationOptions) => Promise; - groupMetadata: (jid: string) => Promise; - groupCreate: (subject: string, participants: string[]) => Promise; - groupLeave: (id: string) => Promise; - groupUpdateSubject: (jid: string, subject: string) => Promise; - groupParticipantsUpdate: (jid: string, participants: string[], action: import("../Types").ParticipantAction) => Promise; - groupUpdateDescription: (jid: string, description?: string) => Promise; - groupInviteCode: (jid: string) => Promise; - groupRevokeInvite: (jid: string) => Promise; - groupAcceptInvite: (code: string) => Promise; - groupToggleEphemeral: (jid: string, ephemeralExpiration: number) => Promise; - groupSettingUpdate: (jid: string, setting: "announcement" | "locked" | "not_announcement" | "unlocked") => Promise; - groupFetchAllParticipating: () => Promise<{ - [_: string]: import("../Types").GroupMetadata; - }>; - type: "md"; - ws: import("ws"); - ev: import("../Types").BaileysEventEmitter; - authState: { - creds: import("../Types").AuthenticationCreds; - keys: import("../Types").SignalKeyStoreWithTransaction; - }; - user: import("../Types").Contact; - assertingPreKeys: (range: number, execute: (keys: { - [_: number]: any; - }) => Promise) => Promise; - generateMessageTag: () => string; - query: (node: BinaryNode, timeoutMs?: number) => Promise; - waitForMessage: (msgId: string, timeoutMs?: number) => Promise; - waitForSocketOpen: () => Promise; - sendRawMessage: (data: Uint8Array | Buffer) => Promise; - sendNode: (node: BinaryNode) => Promise; - logout: () => Promise; - end: (error: Error) => void; - waitForConnectionUpdate: (check: (u: Partial) => boolean, timeoutMs?: number) => Promise; -}; diff --git a/node_modules/@adiwajshing/baileys/lib/Socket/.trashed-1649374382-socket.d.ts b/node_modules/@adiwajshing/baileys/lib/Socket/.trashed-1649374382-socket.d.ts deleted file mode 100644 index 5ddb83681..000000000 --- a/node_modules/@adiwajshing/baileys/lib/Socket/.trashed-1649374382-socket.d.ts +++ /dev/null @@ -1,34 +0,0 @@ -/// -import WebSocket from 'ws'; -import { AuthenticationCreds, BaileysEventEmitter, SocketConfig } from '../Types'; -import { BinaryNode } from '../WABinary'; -/** - * Connects to WA servers and performs: - * - simple queries (no retry mechanism, wait for connection establishment) - * - listen to messages and emit events - * - query phone connection - */ -export declare const makeSocket: ({ waWebSocketUrl, connectTimeoutMs, logger, agent, keepAliveIntervalMs, version, browser, auth: initialAuthState, printQRInTerminal, defaultQueryTimeoutMs }: SocketConfig) => { - type: "md"; - ws: WebSocket; - ev: BaileysEventEmitter; - authState: { - creds: AuthenticationCreds; - keys: import("../Types").SignalKeyStoreWithTransaction; - }; - readonly user: import("../Types").Contact; - assertingPreKeys: (range: number, execute: (keys: { - [_: number]: any; - }) => Promise) => Promise; - generateMessageTag: () => string; - query: (node: BinaryNode, timeoutMs?: number) => Promise; - waitForMessage: (msgId: string, timeoutMs?: number) => Promise; - waitForSocketOpen: () => Promise; - sendRawMessage: (data: Buffer | Uint8Array) => Promise; - sendNode: (node: BinaryNode) => Promise; - logout: () => Promise; - end: (error: Error | undefined) => void; - /** Waits for the connection to WA to reach a state */ - waitForConnectionUpdate: (check: (u: Partial) => boolean, timeoutMs?: number) => Promise; -}; -export declare type Socket = ReturnType; diff --git a/node_modules/@adiwajshing/baileys/lib/Socket/business.d.ts b/node_modules/@adiwajshing/baileys/lib/Socket/business.d.ts new file mode 100644 index 000000000..002f57cad --- /dev/null +++ b/node_modules/@adiwajshing/baileys/lib/Socket/business.d.ts @@ -0,0 +1,90 @@ +/// +/// +import { ProductCreate, ProductUpdate, SocketConfig } from '../Types'; +export declare const makeBusinessSocket: (config: SocketConfig) => { + getOrderDetails: (orderId: string, tokenBase64: string) => Promise; + getCatalog: (jid?: string, limit?: number) => Promise<{ + products: import("../Types").Product[]; + }>; + getCollections: (jid?: string, limit?: number) => Promise<{ + collections: import("../Types").CatalogCollection[]; + }>; + productCreate: (create: ProductCreate) => Promise; + productDelete: (productIds: string[]) => Promise<{ + deleted: number; + }>; + productUpdate: (productId: string, update: ProductUpdate) => Promise; + processMessage: (msg: import("../Types").WAProto.IWebMessageInfo) => Promise>>; + sendMessageAck: ({ tag, attrs }: import("../WABinary").BinaryNode, extraAttrs: { + [key: string]: string; + }) => Promise; + sendRetryRequest: (node: import("../WABinary").BinaryNode) => Promise; + appPatch: (patchCreate: import("../Types").WAPatchCreate) => Promise; + sendPresenceUpdate: (type: import("../Types").WAPresence, toJid?: string) => Promise; + presenceSubscribe: (toJid: string) => Promise; + profilePictureUrl: (jid: string, type?: "image" | "preview", timeoutMs?: number) => Promise; + onWhatsApp: (...jids: string[]) => Promise<{ + exists: boolean; + jid: string; + }[]>; + fetchBlocklist: () => Promise; + fetchStatus: (jid: string) => Promise<{ + status: string; + setAt: Date; + }>; + updateProfilePicture: (jid: string, content: import("../Types").WAMediaUpload) => Promise; + updateBlockStatus: (jid: string, action: "block" | "unblock") => Promise; + getBusinessProfile: (jid: string) => Promise; + resyncAppState: (collections: import("../Types").WAPatchName[]) => Promise; + chatModify: (mod: import("../Types").ChatModification, jid: string) => Promise; + resyncMainAppState: () => Promise; + assertSessions: (jids: string[], force: boolean) => Promise; + relayMessage: (jid: string, message: import("../Types").WAProto.IMessage, { messageId: msgId, participant, additionalAttributes, cachedGroupMetadata }: import("../Types").MessageRelayOptions) => Promise; + sendReceipt: (jid: string, participant: string, messageIds: string[], type: import("../Types").MessageReceiptType) => Promise; + sendReadReceipt: (jid: string, participant: string, messageIds: string[]) => Promise; + readMessages: (keys: import("../Types").WAProto.IMessageKey[]) => Promise; + refreshMediaConn: (forceGet?: boolean) => Promise; + waUploadToServer: import("../Types").WAMediaUploadFunction; + fetchPrivacySettings: (force?: boolean) => Promise<{ + [_: string]: string; + }>; + sendMessage: (jid: string, content: import("../Types").AnyMessageContent, options?: import("../Types").MiscMessageGenerationOptions) => Promise; + groupMetadata: (jid: string) => Promise; + groupCreate: (subject: string, participants: string[]) => Promise; + groupLeave: (id: string) => Promise; + groupUpdateSubject: (jid: string, subject: string) => Promise; + groupParticipantsUpdate: (jid: string, participants: string[], action: import("../Types").ParticipantAction) => Promise; + groupUpdateDescription: (jid: string, description?: string) => Promise; + groupInviteCode: (jid: string) => Promise; + groupRevokeInvite: (jid: string) => Promise; + groupAcceptInvite: (code: string) => Promise; + groupAcceptInviteV4: (jid: string, inviteMessage: import("../Types").WAProto.IGroupInviteMessage) => Promise; + groupToggleEphemeral: (jid: string, ephemeralExpiration: number) => Promise; + groupSettingUpdate: (jid: string, setting: "announcement" | "locked" | "not_announcement" | "unlocked") => Promise; + groupFetchAllParticipating: () => Promise<{ + [_: string]: import("../Types").GroupMetadata; + }>; + type: "md"; + ws: import("ws"); + ev: import("../Types").BaileysEventEmitter; + authState: { + creds: import("../Types").AuthenticationCreds; + keys: import("../Types").SignalKeyStoreWithTransaction; + }; + user: import("../Types").Contact; + emitEventsFromMap: (map: Partial>) => void; + assertingPreKeys: (range: number, execute: (keys: { + [_: number]: any; + }) => Promise) => Promise; + generateMessageTag: () => string; + query: (node: import("../WABinary").BinaryNode, timeoutMs?: number) => Promise; + waitForMessage: (msgId: string, timeoutMs?: number) => Promise; + waitForSocketOpen: () => Promise; + sendRawMessage: (data: Uint8Array | Buffer) => Promise; + sendNode: (node: import("../WABinary").BinaryNode) => Promise; + logout: () => Promise; + end: (error: Error) => void; + onUnexpectedError: (error: Error, msg: string) => void; + uploadPreKeys: (count?: number) => Promise; + waitForConnectionUpdate: (check: (u: Partial) => boolean, timeoutMs?: number) => Promise; +}; diff --git a/node_modules/@adiwajshing/baileys/lib/Socket/business.js b/node_modules/@adiwajshing/baileys/lib/Socket/business.js new file mode 100644 index 000000000..47d076b47 --- /dev/null +++ b/node_modules/@adiwajshing/baileys/lib/Socket/business.js @@ -0,0 +1,223 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.makeBusinessSocket = void 0; +const business_1 = require("../Utils/business"); +const WABinary_1 = require("../WABinary"); +const generic_utils_1 = require("../WABinary/generic-utils"); +const messages_recv_1 = require("./messages-recv"); +const makeBusinessSocket = (config) => { + const sock = messages_recv_1.makeMessagesRecvSocket(config); + const { authState, query, waUploadToServer } = sock; + const getCatalog = async (jid, limit = 10) => { + var _a; + jid = WABinary_1.jidNormalizedUser(jid || ((_a = authState.creds.me) === null || _a === void 0 ? void 0 : _a.id)); + const result = await query({ + tag: 'iq', + attrs: { + to: WABinary_1.S_WHATSAPP_NET, + type: 'get', + xmlns: 'w:biz:catalog' + }, + content: [ + { + tag: 'product_catalog', + attrs: { + jid, + allow_shop_source: 'true' + }, + content: [ + { + tag: 'limit', + attrs: {}, + content: Buffer.from(limit.toString()) + }, + { + tag: 'width', + attrs: {}, + content: Buffer.from('100') + }, + { + tag: 'height', + attrs: {}, + content: Buffer.from('100') + } + ] + } + ] + }); + return business_1.parseCatalogNode(result); + }; + const getCollections = async (jid, limit = 51) => { + var _a; + jid = WABinary_1.jidNormalizedUser(jid || ((_a = authState.creds.me) === null || _a === void 0 ? void 0 : _a.id)); + const result = await query({ + tag: 'iq', + attrs: { + to: WABinary_1.S_WHATSAPP_NET, + type: 'get', + xmlns: 'w:biz:catalog', + smax_id: '35' + }, + content: [ + { + tag: 'collections', + attrs: { + biz_jid: jid, + }, + content: [ + { + tag: 'collection_limit', + attrs: {}, + content: Buffer.from(limit.toString()) + }, + { + tag: 'item_limit', + attrs: {}, + content: Buffer.from(limit.toString()) + }, + { + tag: 'width', + attrs: {}, + content: Buffer.from('100') + }, + { + tag: 'height', + attrs: {}, + content: Buffer.from('100') + } + ] + } + ] + }); + return business_1.parseCollectionsNode(result); + }; + const getOrderDetails = async (orderId, tokenBase64) => { + const result = await query({ + tag: 'iq', + attrs: { + to: WABinary_1.S_WHATSAPP_NET, + type: 'get', + xmlns: 'fb:thrift_iq', + smax_id: '5' + }, + content: [ + { + tag: 'order', + attrs: { + op: 'get', + id: orderId + }, + content: [ + { + tag: 'image_dimensions', + attrs: {}, + content: [ + { + tag: 'width', + attrs: {}, + content: Buffer.from('100') + }, + { + tag: 'height', + attrs: {}, + content: Buffer.from('100') + } + ] + }, + { + tag: 'token', + attrs: {}, + content: Buffer.from(tokenBase64) + } + ] + } + ] + }); + return business_1.parseOrderDetailsNode(result); + }; + const productUpdate = async (productId, update) => { + update = await business_1.uploadingNecessaryImagesOfProduct(update, waUploadToServer); + const editNode = business_1.toProductNode(productId, update); + const result = await query({ + tag: 'iq', + attrs: { + to: WABinary_1.S_WHATSAPP_NET, + type: 'set', + xmlns: 'w:biz:catalog' + }, + content: [ + { + tag: 'product_catalog_edit', + attrs: { v: '1' }, + content: [editNode] + } + ] + }); + const productCatalogEditNode = generic_utils_1.getBinaryNodeChild(result, 'product_catalog_edit'); + const productNode = generic_utils_1.getBinaryNodeChild(productCatalogEditNode, 'product'); + return business_1.parseProductNode(productNode); + }; + const productCreate = async (create) => { + create = await business_1.uploadingNecessaryImagesOfProduct(create, waUploadToServer); + const createNode = business_1.toProductNode(undefined, create); + const result = await query({ + tag: 'iq', + attrs: { + to: WABinary_1.S_WHATSAPP_NET, + type: 'set', + xmlns: 'w:biz:catalog' + }, + content: [ + { + tag: 'product_catalog_add', + attrs: { v: '1' }, + content: [createNode] + } + ] + }); + const productCatalogAddNode = generic_utils_1.getBinaryNodeChild(result, 'product_catalog_add'); + const productNode = generic_utils_1.getBinaryNodeChild(productCatalogAddNode, 'product'); + return business_1.parseProductNode(productNode); + }; + const productDelete = async (productIds) => { + const result = await query({ + tag: 'iq', + attrs: { + to: WABinary_1.S_WHATSAPP_NET, + type: 'set', + xmlns: 'w:biz:catalog' + }, + content: [ + { + tag: 'product_catalog_delete', + attrs: { v: '1' }, + content: productIds.map(id => ({ + tag: 'product', + attrs: {}, + content: [ + { + tag: 'id', + attrs: {}, + content: Buffer.from(id) + } + ] + })) + } + ] + }); + const productCatalogDelNode = generic_utils_1.getBinaryNodeChild(result, 'product_catalog_delete'); + return { + deleted: +productCatalogDelNode.attrs.deleted_count + }; + }; + return { + ...sock, + getOrderDetails, + getCatalog, + getCollections, + productCreate, + productDelete, + productUpdate + }; +}; +exports.makeBusinessSocket = makeBusinessSocket; diff --git a/node_modules/@adiwajshing/baileys/lib/Socket/chats.d.ts b/node_modules/@adiwajshing/baileys/lib/Socket/chats.d.ts new file mode 100644 index 000000000..a9a08d4bb --- /dev/null +++ b/node_modules/@adiwajshing/baileys/lib/Socket/chats.d.ts @@ -0,0 +1,75 @@ +/// +/// +import { proto } from '../../WAProto'; +import { AppStateChunk, ChatModification, SocketConfig, WABusinessProfile, WAMediaUpload, WAPatchCreate, WAPatchName, WAPresence } from '../Types'; +import { BinaryNode } from '../WABinary'; +export declare const makeChatsSocket: (config: SocketConfig) => { + appPatch: (patchCreate: WAPatchCreate) => Promise; + sendPresenceUpdate: (type: WAPresence, toJid?: string) => Promise; + presenceSubscribe: (toJid: string) => Promise; + profilePictureUrl: (jid: string, type?: 'preview' | 'image', timeoutMs?: number) => Promise; + onWhatsApp: (...jids: string[]) => Promise<{ + exists: boolean; + jid: string; + }[]>; + fetchBlocklist: () => Promise; + fetchStatus: (jid: string) => Promise<{ + status: string; + setAt: Date; + }>; + updateProfilePicture: (jid: string, content: WAMediaUpload) => Promise; + updateBlockStatus: (jid: string, action: 'block' | 'unblock') => Promise; + getBusinessProfile: (jid: string) => Promise; + resyncAppState: (collections: WAPatchName[]) => Promise; + chatModify: (mod: ChatModification, jid: string) => Promise; + resyncMainAppState: () => Promise; + assertSessions: (jids: string[], force: boolean) => Promise; + relayMessage: (jid: string, message: proto.IMessage, { messageId: msgId, participant, additionalAttributes, cachedGroupMetadata }: import("../Types").MessageRelayOptions) => Promise; + sendReceipt: (jid: string, participant: string, messageIds: string[], type: import("../Types").MessageReceiptType) => Promise; + sendReadReceipt: (jid: string, participant: string, messageIds: string[]) => Promise; + readMessages: (keys: proto.IMessageKey[]) => Promise; + refreshMediaConn: (forceGet?: boolean) => Promise; + waUploadToServer: import("../Types").WAMediaUploadFunction; + fetchPrivacySettings: (force?: boolean) => Promise<{ + [_: string]: string; + }>; + sendMessage: (jid: string, content: import("../Types").AnyMessageContent, options?: import("../Types").MiscMessageGenerationOptions) => Promise; + groupMetadata: (jid: string) => Promise; + groupCreate: (subject: string, participants: string[]) => Promise; + groupLeave: (id: string) => Promise; + groupUpdateSubject: (jid: string, subject: string) => Promise; + groupParticipantsUpdate: (jid: string, participants: string[], action: import("../Types").ParticipantAction) => Promise; + groupUpdateDescription: (jid: string, description?: string) => Promise; + groupInviteCode: (jid: string) => Promise; + groupRevokeInvite: (jid: string) => Promise; + groupAcceptInvite: (code: string) => Promise; + groupAcceptInviteV4: (jid: string, inviteMessage: proto.IGroupInviteMessage) => Promise; + groupToggleEphemeral: (jid: string, ephemeralExpiration: number) => Promise; + groupSettingUpdate: (jid: string, setting: "announcement" | "locked" | "not_announcement" | "unlocked") => Promise; + groupFetchAllParticipating: () => Promise<{ + [_: string]: import("../Types").GroupMetadata; + }>; + type: "md"; + ws: import("ws"); + ev: import("../Types").BaileysEventEmitter; + authState: { + creds: import("../Types").AuthenticationCreds; + keys: import("../Types").SignalKeyStoreWithTransaction; + }; + user: import("../Types").Contact; + emitEventsFromMap: (map: Partial>) => void; + assertingPreKeys: (range: number, execute: (keys: { + [_: number]: any; + }) => Promise) => Promise; + generateMessageTag: () => string; + query: (node: BinaryNode, timeoutMs?: number) => Promise; + waitForMessage: (msgId: string, timeoutMs?: number) => Promise; + waitForSocketOpen: () => Promise; + sendRawMessage: (data: Uint8Array | Buffer) => Promise; + sendNode: (node: BinaryNode) => Promise; + logout: () => Promise; + end: (error: Error) => void; + onUnexpectedError: (error: Error, msg: string) => void; + uploadPreKeys: (count?: number) => Promise; + waitForConnectionUpdate: (check: (u: Partial) => boolean, timeoutMs?: number) => Promise; +}; diff --git a/node_modules/@adiwajshing/baileys/lib/Socket/chats.d_1.ts b/node_modules/@adiwajshing/baileys/lib/Socket/chats.d_1.ts deleted file mode 100644 index 2f0e4c300..000000000 --- a/node_modules/@adiwajshing/baileys/lib/Socket/chats.d_1.ts +++ /dev/null @@ -1,70 +0,0 @@ -/// -/// -import { proto } from '../../WAProto'; -import { AppStateChunk, ChatModification, Contact, SocketConfig, WABusinessProfile, WAMediaUpload, WAPatchCreate, WAPatchName, WAPresence } from '../Types'; -import { BinaryNode } from '../WABinary'; -export declare const makeChatsSocket: (config: SocketConfig) => { - appPatch: (patchCreate: WAPatchCreate) => Promise; - sendPresenceUpdate: (type: WAPresence, toJid?: string) => Promise; - presenceSubscribe: (toJid: string) => Promise; - profilePictureUrl: (jid: string, type?: 'preview' | 'image', timeoutMs?: number) => Promise; - onWhatsApp: (...jids: string[]) => Promise<{ - exists: boolean; - jid: string; - }[]>; - fetchBlocklist: () => Promise; - fetchStatus: (jid: string) => Promise<{ - status: string; - setAt: Date; - }>; - updateProfilePicture: (jid: string, content: WAMediaUpload) => Promise; - updateBlockStatus: (jid: string, action: 'block' | 'unblock') => Promise; - getBusinessProfile: (jid: string) => Promise; - resyncAppState: (collections: WAPatchName[]) => Promise; - chatModify: (mod: ChatModification, jid: string) => Promise; - resyncMainAppState: () => Promise; - assertSessions: (jids: string[], force: boolean) => Promise; - relayMessage: (jid: string, message: proto.IMessage, { messageId: msgId, participant, additionalAttributes, cachedGroupMetadata }: import("../Types").MessageRelayOptions) => Promise; - sendReceipt: (jid: string, participant: string, messageIds: string[], type: "read" | "read-self") => Promise; - sendReadReceipt: (jid: string, participant: string, messageIds: string[]) => Promise; - refreshMediaConn: (forceGet?: boolean) => Promise; - waUploadToServer: import("../Types").WAMediaUploadFunction; - fetchPrivacySettings: (force?: boolean) => Promise<{ - [_: string]: string; - }>; - sendMessage: (jid: string, content: import("../Types").AnyMessageContent, options?: import("../Types").MiscMessageGenerationOptions) => Promise; - groupMetadata: (jid: string) => Promise; - groupCreate: (subject: string, participants: string[]) => Promise; - groupLeave: (id: string) => Promise; - groupUpdateSubject: (jid: string, subject: string) => Promise; - groupParticipantsUpdate: (jid: string, participants: string[], action: import("../Types").ParticipantAction) => Promise; - groupUpdateDescription: (jid: string, description?: string) => Promise; - groupInviteCode: (jid: string) => Promise; - groupRevokeInvite: (jid: string) => Promise; - groupAcceptInvite: (code: string) => Promise; - groupToggleEphemeral: (jid: string, ephemeralExpiration: number) => Promise; - groupSettingUpdate: (jid: string, setting: "announcement" | "locked" | "not_announcement" | "unlocked") => Promise; - groupFetchAllParticipating: () => Promise<{ - [_: string]: import("../Types").GroupMetadata; - }>; - type: "md"; - ws: import("ws"); - ev: import("../Types").BaileysEventEmitter; - authState: { - creds: import("../Types").AuthenticationCreds; - keys: import("../Types").SignalKeyStoreWithTransaction; - }; - user: Contact; - assertingPreKeys: (range: number, execute: (keys: { - [_: number]: any; - }) => Promise) => Promise; - generateMessageTag: () => string; - query: (node: BinaryNode, timeoutMs?: number) => Promise; - waitForMessage: (msgId: string, timeoutMs?: number) => Promise; - waitForSocketOpen: () => Promise; - sendRawMessage: (data: Uint8Array | Buffer) => Promise; - sendNode: (node: BinaryNode) => Promise; - logout: () => Promise; - end: (error: Error) => void; - waitForConnectionUpdate: (check: (u: Partial) => boolean, timeoutMs?: number) => Promise; -}; diff --git a/node_modules/@adiwajshing/baileys/lib/Socket/chats.js b/node_modules/@adiwajshing/baileys/lib/Socket/chats.js index ae563cb41..a1e622f4e 100644 --- a/node_modules/@adiwajshing/baileys/lib/Socket/chats.js +++ b/node_modules/@adiwajshing/baileys/lib/Socket/chats.js @@ -11,8 +11,9 @@ const MAX_SYNC_ATTEMPTS = 5; const makeChatsSocket = (config) => { const { logger } = config; const sock = messages_send_1.makeMessagesSocket(config); - const { ev, ws, authState, generateMessageTag, sendNode, query, fetchPrivacySettings, } = sock; + const { ev, ws, authState, generateMessageTag, sendNode, query, fetchPrivacySettings, onUnexpectedError, emitEventsFromMap, } = sock; const mutationMutex = make_mutex_1.makeMutex(); + /// helper function to fetch an app state sync key const getAppStateSyncKey = async (keyId) => { const { [keyId]: key } = await authState.keys.get('app-state-sync-key', [keyId]); return key; @@ -150,33 +151,29 @@ const makeChatsSocket = (config) => { }] }] }); - const profiles = WABinary_1.getBinaryNodeChild(WABinary_1.getBinaryNodeChild(results, 'business_profile'), 'profile'); - if (!profiles) { - // if not bussines - if (logger.level === 'trace') { - logger.trace({ jid }, 'Not bussines'); - } - return; + const profileNode = WABinary_1.getBinaryNodeChild(results, 'business_profile'); + const profiles = WABinary_1.getBinaryNodeChild(profileNode, 'profile'); + if (profiles) { + const address = WABinary_1.getBinaryNodeChild(profiles, 'address'); + const description = WABinary_1.getBinaryNodeChild(profiles, 'description'); + const website = WABinary_1.getBinaryNodeChild(profiles, 'website'); + const email = WABinary_1.getBinaryNodeChild(profiles, 'email'); + const category = WABinary_1.getBinaryNodeChild(WABinary_1.getBinaryNodeChild(profiles, 'categories'), 'category'); + const business_hours = WABinary_1.getBinaryNodeChild(profiles, 'business_hours'); + const business_hours_config = business_hours && WABinary_1.getBinaryNodeChildren(business_hours, 'business_hours_config'); + return { + wid: (_a = profiles.attrs) === null || _a === void 0 ? void 0 : _a.jid, + address: address === null || address === void 0 ? void 0 : address.content.toString(), + description: description === null || description === void 0 ? void 0 : description.content.toString(), + website: [website === null || website === void 0 ? void 0 : website.content.toString()], + email: email === null || email === void 0 ? void 0 : email.content.toString(), + category: category === null || category === void 0 ? void 0 : category.content.toString(), + business_hours: { + timezone: (_b = business_hours === null || business_hours === void 0 ? void 0 : business_hours.attrs) === null || _b === void 0 ? void 0 : _b.timezone, + business_config: business_hours_config === null || business_hours_config === void 0 ? void 0 : business_hours_config.map(({ attrs }) => attrs) + } + }; } - const address = WABinary_1.getBinaryNodeChild(profiles, 'address'); - const description = WABinary_1.getBinaryNodeChild(profiles, 'description'); - const website = WABinary_1.getBinaryNodeChild(profiles, 'website'); - const email = WABinary_1.getBinaryNodeChild(profiles, 'email'); - const category = WABinary_1.getBinaryNodeChild(WABinary_1.getBinaryNodeChild(profiles, 'categories'), 'category'); - const business_hours = WABinary_1.getBinaryNodeChild(profiles, 'business_hours'); - const business_hours_config = business_hours && WABinary_1.getBinaryNodeChildren(business_hours, 'business_hours_config'); - return { - wid: (_a = profiles.attrs) === null || _a === void 0 ? void 0 : _a.jid, - address: address === null || address === void 0 ? void 0 : address.content.toString(), - description: description === null || description === void 0 ? void 0 : description.content.toString(), - website: [website === null || website === void 0 ? void 0 : website.content.toString()], - email: email === null || email === void 0 ? void 0 : email.content.toString(), - category: category === null || category === void 0 ? void 0 : category.content.toString(), - business_hours: { - timezone: (_b = business_hours === null || business_hours === void 0 ? void 0 : business_hours.attrs) === null || _b === void 0 ? void 0 : _b.timezone, - business_config: business_hours_config === null || business_hours_config === void 0 ? void 0 : business_hours_config.map(({ attrs }) => attrs) - } - }; }; const updateAccountSyncTimestamp = async (fromTimestamp) => { logger.info({ fromTimestamp }, 'requesting account sync'); @@ -207,7 +204,7 @@ const makeChatsSocket = (config) => { await authState.keys.transaction(async () => { var _a; const collectionsToHandle = new Set(collections); - // in case something goes wrong -- ensure we don't enter a loop that cannot be exited from + // in case something goes wrong -- ensure we don't enter a loop that cannot be exited from const attemptsMap = {}; // keep executing till all collections are done // sometimes a single patch request will not return all the patches (God knows why) @@ -297,7 +294,7 @@ const makeChatsSocket = (config) => { } } }); - processSyncActions(appStateChunk.totalMutations); + processSyncActionsLocal(appStateChunk.totalMutations); return appStateChunk; }; /** @@ -325,6 +322,10 @@ const makeChatsSocket = (config) => { const sendPresenceUpdate = async (type, toJid) => { const me = authState.creds.me; if (type === 'available' || type === 'unavailable') { + if (!me.name) { + logger.warn('no name present, ignoring presence update request...'); + return; + } await sendNode({ tag: 'presence', attrs: { @@ -341,7 +342,10 @@ const makeChatsSocket = (config) => { to: toJid, }, content: [ - { tag: type, attrs: {} } + { + tag: type === 'recording' ? 'composing' : type, + attrs: type === 'recording' ? { media: 'audio' } : {} + } ] }); } @@ -355,13 +359,14 @@ const makeChatsSocket = (config) => { } })); const handlePresenceUpdate = ({ tag, attrs, content }) => { + var _a; let presence; const jid = attrs.from; const participant = attrs.participant || attrs.from; if (tag === 'presence') { presence = { lastKnownPresence: attrs.type === 'unavailable' ? 'unavailable' : 'available', - lastSeen: attrs.t ? +attrs.t : undefined + lastSeen: attrs.last ? +attrs.last : undefined }; } else if (Array.isArray(content)) { @@ -370,6 +375,9 @@ const makeChatsSocket = (config) => { if (type === 'paused') { type = 'available'; } + if (((_a = firstChild.attrs) === null || _a === void 0 ? void 0 : _a.media) === 'audio') { + type = 'recording'; + } presence = { lastKnownPresence: type }; } else { @@ -388,69 +396,11 @@ const makeChatsSocket = (config) => { 'regular_low', 'regular' ])) - .catch(err => (logger.warn({ trace: err.stack }, 'failed to sync app state')))); + .catch(err => (onUnexpectedError(err, 'main app sync')))); }; - const processSyncActions = (actions) => { - var _a, _b, _c, _d, _e; - const updates = {}; - const contactUpdates = {}; - const msgDeletes = []; - for (const { syncAction: { value: action }, index: [_, id, msgId, fromMe] } of actions) { - const update = { id }; - if (action === null || action === void 0 ? void 0 : action.muteAction) { - update.mute = ((_a = action.muteAction) === null || _a === void 0 ? void 0 : _a.muted) ? - Utils_1.toNumber(action.muteAction.muteEndTimestamp) : - undefined; - } - else if (action === null || action === void 0 ? void 0 : action.archiveChatAction) { - update.archive = !!((_b = action.archiveChatAction) === null || _b === void 0 ? void 0 : _b.archived); - } - else if (action === null || action === void 0 ? void 0 : action.markChatAsReadAction) { - update.unreadCount = !!((_c = action.markChatAsReadAction) === null || _c === void 0 ? void 0 : _c.read) ? 0 : -1; - } - else if (action === null || action === void 0 ? void 0 : action.clearChatAction) { - msgDeletes.push({ - remoteJid: id, - id: msgId, - fromMe: fromMe === '1' - }); - } - else if (action === null || action === void 0 ? void 0 : action.contactAction) { - contactUpdates[id] = { - ...(contactUpdates[id] || {}), - id, - name: action.contactAction.fullName - }; - } - else if (action === null || action === void 0 ? void 0 : action.pushNameSetting) { - const me = { - ...authState.creds.me, - name: (_d = action === null || action === void 0 ? void 0 : action.pushNameSetting) === null || _d === void 0 ? void 0 : _d.name - }; - ev.emit('creds.update', { me }); - } - else if (action === null || action === void 0 ? void 0 : action.pinAction) { - update.pin = ((_e = action.pinAction) === null || _e === void 0 ? void 0 : _e.pinned) ? Utils_1.toNumber(action.timestamp) : undefined; - } - else { - logger.warn({ action, id }, 'unprocessable update'); - } - if (Object.keys(update).length > 1) { - updates[update.id] = { - ...(updates[update.id] || {}), - ...update - }; - } - } - if (Object.values(updates).length) { - ev.emit('chats.update', Object.values(updates)); - } - if (Object.values(contactUpdates).length) { - ev.emit('contacts.upsert', Object.values(contactUpdates)); - } - if (msgDeletes.length) { - ev.emit('messages.delete', { keys: msgDeletes }); - } + const processSyncActionsLocal = (actions) => { + const events = Utils_1.processSyncActions(actions, authState.creds.me, logger); + emitEventsFromMap(events); }; const appPatch = async (patchCreate) => { const name = patchCreate.type; @@ -461,7 +411,8 @@ const makeChatsSocket = (config) => { await mutationMutex.mutex(async () => { logger.debug({ patch: patchCreate }, 'applying app patch'); await resyncAppState([name]); - const { [name]: initial } = await authState.keys.get('app-state-sync-version', [name]); + let { [name]: initial } = await authState.keys.get('app-state-sync-version', [name]); + initial = initial || Utils_1.newLTHashState(); const { patch, state } = await Utils_1.encodeSyncdPatch(patchCreate, myAppStateKeyId, initial, getAppStateSyncKey); const node = { tag: 'iq', @@ -498,7 +449,7 @@ const makeChatsSocket = (config) => { await authState.keys.set({ 'app-state-sync-version': { [name]: state } }); if (config.emitOwnEvents) { const result = await Utils_1.decodePatches(name, [{ ...patch, version: { version: state.version }, }], initial, getAppStateSyncKey); - processSyncActions(result.newMutations); + processSyncActionsLocal(result.newMutations); } }); }; @@ -555,6 +506,19 @@ const makeChatsSocket = (config) => { const patch = Utils_1.chatModificationToAppPatch(mod, jid); return appPatch(patch); }; + /** + * queries need to be fired on connection open + * help ensure parity with WA Web + * */ + const fireInitQueries = async () => { + await Promise.all([ + fetchAbt(), + fetchProps(), + fetchBlocklist(), + fetchPrivacySettings(), + sendPresenceUpdate('available') + ]); + }; ws.on('CB:presence', handlePresenceUpdate); ws.on('CB:chatstate', handlePresenceUpdate); ws.on('CB:ib,,dirty', async (node) => { @@ -562,12 +526,14 @@ const makeChatsSocket = (config) => { const type = attrs.type; switch (type) { case 'account_sync': - let { lastAccountSyncTimestamp } = authState.creds; - if (lastAccountSyncTimestamp) { - await updateAccountSyncTimestamp(lastAccountSyncTimestamp); + if (attrs.timestamp) { + let { lastAccountSyncTimestamp } = authState.creds; + if (lastAccountSyncTimestamp) { + await updateAccountSyncTimestamp(lastAccountSyncTimestamp); + } + lastAccountSyncTimestamp = +attrs.timestamp; + ev.emit('creds.update', { lastAccountSyncTimestamp }); } - lastAccountSyncTimestamp = +attrs.timestamp; - ev.emit('creds.update', { lastAccountSyncTimestamp }); break; default: logger.info({ node }, 'received unknown sync'); @@ -586,11 +552,8 @@ const makeChatsSocket = (config) => { }); ev.on('connection.update', ({ connection }) => { if (connection === 'open') { - sendPresenceUpdate('available'); - fetchBlocklist(); - fetchPrivacySettings(); - fetchAbt(); - fetchProps(); + fireInitQueries() + .catch(error => onUnexpectedError(error, 'connection open requests')); } }); return { diff --git a/node_modules/@adiwajshing/baileys/lib/Socket/groups.d.ts b/node_modules/@adiwajshing/baileys/lib/Socket/groups.d.ts new file mode 100644 index 000000000..d3619e516 --- /dev/null +++ b/node_modules/@adiwajshing/baileys/lib/Socket/groups.d.ts @@ -0,0 +1,46 @@ +/// +/// +import { GroupMetadata, ParticipantAction, SocketConfig } from '../Types'; +import { BinaryNode } from '../WABinary'; +import { proto } from '../../WAProto'; +export declare const makeGroupsSocket: (config: SocketConfig) => { + groupMetadata: (jid: string) => Promise; + groupCreate: (subject: string, participants: string[]) => Promise; + groupLeave: (id: string) => Promise; + groupUpdateSubject: (jid: string, subject: string) => Promise; + groupParticipantsUpdate: (jid: string, participants: string[], action: ParticipantAction) => Promise; + groupUpdateDescription: (jid: string, description?: string) => Promise; + groupInviteCode: (jid: string) => Promise; + groupRevokeInvite: (jid: string) => Promise; + groupAcceptInvite: (code: string) => Promise; + groupAcceptInviteV4: (jid: string, inviteMessage: proto.IGroupInviteMessage) => Promise; + groupToggleEphemeral: (jid: string, ephemeralExpiration: number) => Promise; + groupSettingUpdate: (jid: string, setting: 'announcement' | 'not_announcement' | 'locked' | 'unlocked') => Promise; + groupFetchAllParticipating: () => Promise<{ + [_: string]: GroupMetadata; + }>; + type: "md"; + ws: import("ws"); + ev: import("../Types").BaileysEventEmitter; + authState: { + creds: import("../Types").AuthenticationCreds; + keys: import("../Types").SignalKeyStoreWithTransaction; + }; + user: import("../Types").Contact; + emitEventsFromMap: (map: Partial>) => void; + assertingPreKeys: (range: number, execute: (keys: { + [_: number]: any; + }) => Promise) => Promise; + generateMessageTag: () => string; + query: (node: BinaryNode, timeoutMs?: number) => Promise; + waitForMessage: (msgId: string, timeoutMs?: number) => Promise; + waitForSocketOpen: () => Promise; + sendRawMessage: (data: Uint8Array | Buffer) => Promise; + sendNode: (node: BinaryNode) => Promise; + logout: () => Promise; + end: (error: Error) => void; + onUnexpectedError: (error: Error, msg: string) => void; + uploadPreKeys: (count?: number) => Promise; + waitForConnectionUpdate: (check: (u: Partial) => boolean, timeoutMs?: number) => Promise; +}; +export declare const extractGroupMetadata: (result: BinaryNode) => GroupMetadata; diff --git a/node_modules/@adiwajshing/baileys/lib/Socket/groups.d_1.ts b/node_modules/@adiwajshing/baileys/lib/Socket/groups.d_1.ts deleted file mode 100644 index 5a723b6b3..000000000 --- a/node_modules/@adiwajshing/baileys/lib/Socket/groups.d_1.ts +++ /dev/null @@ -1,41 +0,0 @@ -/// -/// -import { GroupMetadata, ParticipantAction, SocketConfig } from '../Types'; -import { BinaryNode } from '../WABinary'; -export declare const makeGroupsSocket: (config: SocketConfig) => { - groupMetadata: (jid: string) => Promise; - groupCreate: (subject: string, participants: string[]) => Promise; - groupLeave: (id: string) => Promise; - groupUpdateSubject: (jid: string, subject: string) => Promise; - groupParticipantsUpdate: (jid: string, participants: string[], action: ParticipantAction) => Promise; - groupUpdateDescription: (jid: string, description?: string) => Promise; - groupInviteCode: (jid: string) => Promise; - groupRevokeInvite: (jid: string) => Promise; - groupAcceptInvite: (code: string) => Promise; - groupToggleEphemeral: (jid: string, ephemeralExpiration: number) => Promise; - groupSettingUpdate: (jid: string, setting: 'announcement' | 'not_announcement' | 'locked' | 'unlocked') => Promise; - groupFetchAllParticipating: () => Promise<{ - [_: string]: GroupMetadata; - }>; - type: "md"; - ws: import("ws"); - ev: import("../Types").BaileysEventEmitter; - authState: { - creds: import("../Types").AuthenticationCreds; - keys: import("../Types").SignalKeyStoreWithTransaction; - }; - user: import("../Types").Contact; - assertingPreKeys: (range: number, execute: (keys: { - [_: number]: any; - }) => Promise) => Promise; - generateMessageTag: () => string; - query: (node: BinaryNode, timeoutMs?: number) => Promise; - waitForMessage: (msgId: string, timeoutMs?: number) => Promise; - waitForSocketOpen: () => Promise; - sendRawMessage: (data: Uint8Array | Buffer) => Promise; - sendNode: (node: BinaryNode) => Promise; - logout: () => Promise; - end: (error: Error) => void; - waitForConnectionUpdate: (check: (u: Partial) => boolean, timeoutMs?: number) => Promise; -}; -export declare const extractGroupMetadata: (result: BinaryNode) => GroupMetadata; diff --git a/node_modules/@adiwajshing/baileys/lib/Socket/groups.js b/node_modules/@adiwajshing/baileys/lib/Socket/groups.js index 2de475a86..c780c0476 100644 --- a/node_modules/@adiwajshing/baileys/lib/Socket/groups.js +++ b/node_modules/@adiwajshing/baileys/lib/Socket/groups.js @@ -100,9 +100,17 @@ const makeGroupsSocket = (config) => { const result = WABinary_1.getBinaryNodeChild(results, 'group'); return result.attrs.jid; }, + groupAcceptInviteV4: async (jid, inviteMessage) => { + const results = await groupQuery(inviteMessage.groupJid, 'set', [{ tag: 'accept', attrs: { + code: inviteMessage.inviteCode, + expiration: inviteMessage.inviteExpiration.toString(), + admin: jid + } }]); + return results.attrs.from; + }, groupToggleEphemeral: async (jid, ephemeralExpiration) => { const content = ephemeralExpiration ? - { tag: 'ephemeral', attrs: { ephemeral: ephemeralExpiration.toString() } } : + { tag: 'ephemeral', attrs: { expiration: ephemeralExpiration.toString() } } : { tag: 'not_ephemeral', attrs: {} }; await groupQuery(jid, 'set', [content]); }, diff --git a/node_modules/@adiwajshing/baileys/lib/Socket/index.d.ts b/node_modules/@adiwajshing/baileys/lib/Socket/index.d.ts new file mode 100644 index 000000000..36d995360 --- /dev/null +++ b/node_modules/@adiwajshing/baileys/lib/Socket/index.d.ts @@ -0,0 +1,91 @@ +/// +/// +import { SocketConfig } from '../Types'; +declare const makeWASocket: (config: Partial) => { + getOrderDetails: (orderId: string, tokenBase64: string) => Promise; + getCatalog: (jid?: string, limit?: number) => Promise<{ + products: import("../Types").Product[]; + }>; + getCollections: (jid?: string, limit?: number) => Promise<{ + collections: import("../Types").CatalogCollection[]; + }>; + productCreate: (create: import("../Types").ProductCreate) => Promise; + productDelete: (productIds: string[]) => Promise<{ + deleted: number; + }>; + productUpdate: (productId: string, update: import("../Types").ProductUpdate) => Promise; + processMessage: (msg: import("../Types").WAProto.IWebMessageInfo) => Promise>>; + sendMessageAck: ({ tag, attrs }: import("..").BinaryNode, extraAttrs: { + [key: string]: string; + }) => Promise; + sendRetryRequest: (node: import("..").BinaryNode) => Promise; + appPatch: (patchCreate: import("../Types").WAPatchCreate) => Promise; + sendPresenceUpdate: (type: import("../Types").WAPresence, toJid?: string) => Promise; + presenceSubscribe: (toJid: string) => Promise; + profilePictureUrl: (jid: string, type?: "image" | "preview", timeoutMs?: number) => Promise; + onWhatsApp: (...jids: string[]) => Promise<{ + exists: boolean; + jid: string; + }[]>; + fetchBlocklist: () => Promise; + fetchStatus: (jid: string) => Promise<{ + status: string; + setAt: Date; + }>; + updateProfilePicture: (jid: string, content: import("../Types").WAMediaUpload) => Promise; + updateBlockStatus: (jid: string, action: "block" | "unblock") => Promise; + getBusinessProfile: (jid: string) => Promise; + resyncAppState: (collections: import("../Types").WAPatchName[]) => Promise; + chatModify: (mod: import("../Types").ChatModification, jid: string) => Promise; + resyncMainAppState: () => Promise; + assertSessions: (jids: string[], force: boolean) => Promise; + relayMessage: (jid: string, message: import("../Types").WAProto.IMessage, { messageId: msgId, participant, additionalAttributes, cachedGroupMetadata }: import("../Types").MessageRelayOptions) => Promise; + sendReceipt: (jid: string, participant: string, messageIds: string[], type: import("../Types").MessageReceiptType) => Promise; + sendReadReceipt: (jid: string, participant: string, messageIds: string[]) => Promise; + readMessages: (keys: import("../Types").WAProto.IMessageKey[]) => Promise; + refreshMediaConn: (forceGet?: boolean) => Promise; + waUploadToServer: import("../Types").WAMediaUploadFunction; + fetchPrivacySettings: (force?: boolean) => Promise<{ + [_: string]: string; + }>; + sendMessage: (jid: string, content: import("../Types").AnyMessageContent, options?: import("../Types").MiscMessageGenerationOptions) => Promise; + groupMetadata: (jid: string) => Promise; + groupCreate: (subject: string, participants: string[]) => Promise; + groupLeave: (id: string) => Promise; + groupUpdateSubject: (jid: string, subject: string) => Promise; + groupParticipantsUpdate: (jid: string, participants: string[], action: import("../Types").ParticipantAction) => Promise; + groupUpdateDescription: (jid: string, description?: string) => Promise; + groupInviteCode: (jid: string) => Promise; + groupRevokeInvite: (jid: string) => Promise; + groupAcceptInvite: (code: string) => Promise; + groupAcceptInviteV4: (jid: string, inviteMessage: import("../Types").WAProto.IGroupInviteMessage) => Promise; + groupToggleEphemeral: (jid: string, ephemeralExpiration: number) => Promise; + groupSettingUpdate: (jid: string, setting: "announcement" | "locked" | "not_announcement" | "unlocked") => Promise; + groupFetchAllParticipating: () => Promise<{ + [_: string]: import("../Types").GroupMetadata; + }>; + type: "md"; + ws: import("ws"); + ev: import("../Types").BaileysEventEmitter; + authState: { + creds: import("../Types").AuthenticationCreds; + keys: import("../Types").SignalKeyStoreWithTransaction; + }; + user: import("../Types").Contact; + emitEventsFromMap: (map: Partial>) => void; + assertingPreKeys: (range: number, execute: (keys: { + [_: number]: any; + }) => Promise) => Promise; + generateMessageTag: () => string; + query: (node: import("..").BinaryNode, timeoutMs?: number) => Promise; + waitForMessage: (msgId: string, timeoutMs?: number) => Promise; + waitForSocketOpen: () => Promise; + sendRawMessage: (data: Uint8Array | Buffer) => Promise; + sendNode: (node: import("..").BinaryNode) => Promise; + logout: () => Promise; + end: (error: Error) => void; + onUnexpectedError: (error: Error, msg: string) => void; + uploadPreKeys: (count?: number) => Promise; + waitForConnectionUpdate: (check: (u: Partial) => boolean, timeoutMs?: number) => Promise; +}; +export default makeWASocket; diff --git a/node_modules/@adiwajshing/baileys/lib/Socket/index.d_1.ts b/node_modules/@adiwajshing/baileys/lib/Socket/index.d_1.ts deleted file mode 100644 index 288946d16..000000000 --- a/node_modules/@adiwajshing/baileys/lib/Socket/index.d_1.ts +++ /dev/null @@ -1,74 +0,0 @@ -/// -/// -import { SocketConfig } from '../Types'; -declare const makeWASocket: (config: Partial) => { - processMessage: (message: import("../Types").WAProto.IWebMessageInfo, chatUpdate: Partial) => Promise; - sendMessageAck: ({ tag, attrs }: import("..").BinaryNode, extraAttrs: { - [key: string]: string; - }) => Promise; - sendRetryRequest: (node: import("..").BinaryNode) => Promise; - appPatch: (patchCreate: import("../Types").WAPatchCreate) => Promise; - sendPresenceUpdate: (type: import("../Types").WAPresence, toJid?: string) => Promise; - presenceSubscribe: (toJid: string) => Promise; - profilePictureUrl: (jid: string, type?: "image" | "preview", timeoutMs?: number) => Promise; - onWhatsApp: (...jids: string[]) => Promise<{ - exists: boolean; - jid: string; - }[]>; - fetchBlocklist: () => Promise; - fetchStatus: (jid: string) => Promise<{ - status: string; - setAt: Date; - }>; - updateProfilePicture: (jid: string, content: import("../Types").WAMediaUpload) => Promise; - updateBlockStatus: (jid: string, action: "block" | "unblock") => Promise; - getBusinessProfile: (jid: string) => Promise; - resyncAppState: (collections: import("../Types").WAPatchName[]) => Promise; - chatModify: (mod: import("../Types").ChatModification, jid: string) => Promise; - resyncMainAppState: () => Promise; - assertSessions: (jids: string[], force: boolean) => Promise; - relayMessage: (jid: string, message: import("../Types").WAProto.IMessage, { messageId: msgId, participant, additionalAttributes, cachedGroupMetadata }: import("../Types").MessageRelayOptions) => Promise; - sendReceipt: (jid: string, participant: string, messageIds: string[], type: "read" | "read-self") => Promise; - sendReadReceipt: (jid: string, participant: string, messageIds: string[]) => Promise; - refreshMediaConn: (forceGet?: boolean) => Promise; - waUploadToServer: import("../Types").WAMediaUploadFunction; - fetchPrivacySettings: (force?: boolean) => Promise<{ - [_: string]: string; - }>; - sendMessage: (jid: string, content: import("../Types").AnyMessageContent, options?: import("../Types").MiscMessageGenerationOptions) => Promise; - groupMetadata: (jid: string) => Promise; - groupCreate: (subject: string, participants: string[]) => Promise; - groupLeave: (id: string) => Promise; - groupUpdateSubject: (jid: string, subject: string) => Promise; - groupParticipantsUpdate: (jid: string, participants: string[], action: import("../Types").ParticipantAction) => Promise; - groupUpdateDescription: (jid: string, description?: string) => Promise; - groupInviteCode: (jid: string) => Promise; - groupRevokeInvite: (jid: string) => Promise; - groupAcceptInvite: (code: string) => Promise; - groupToggleEphemeral: (jid: string, ephemeralExpiration: number) => Promise; - groupSettingUpdate: (jid: string, setting: "announcement" | "locked" | "not_announcement" | "unlocked") => Promise; - groupFetchAllParticipating: () => Promise<{ - [_: string]: import("../Types").GroupMetadata; - }>; - type: "md"; - ws: import("ws"); - ev: import("../Types").BaileysEventEmitter; - authState: { - creds: import("../Types").AuthenticationCreds; - keys: import("../Types").SignalKeyStoreWithTransaction; - }; - user: import("../Types").Contact; - assertingPreKeys: (range: number, execute: (keys: { - [_: number]: any; - }) => Promise) => Promise; - generateMessageTag: () => string; - query: (node: import("..").BinaryNode, timeoutMs?: number) => Promise; - waitForMessage: (msgId: string, timeoutMs?: number) => Promise; - waitForSocketOpen: () => Promise; - sendRawMessage: (data: Uint8Array | Buffer) => Promise; - sendNode: (node: import("..").BinaryNode) => Promise; - logout: () => Promise; - end: (error: Error) => void; - waitForConnectionUpdate: (check: (u: Partial) => boolean, timeoutMs?: number) => Promise; -}; -export default makeWASocket; diff --git a/node_modules/@adiwajshing/baileys/lib/Socket/index.js b/node_modules/@adiwajshing/baileys/lib/Socket/index.js index 9a4ac0f51..d1f3b80c7 100644 --- a/node_modules/@adiwajshing/baileys/lib/Socket/index.js +++ b/node_modules/@adiwajshing/baileys/lib/Socket/index.js @@ -1,9 +1,9 @@ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const Defaults_1 = require("../Defaults"); -const messages_recv_1 = require("./messages-recv"); +const business_1 = require("./business"); // export the last socket layer -const makeWASocket = (config) => (messages_recv_1.makeMessagesRecvSocket({ +const makeWASocket = (config) => (business_1.makeBusinessSocket({ ...Defaults_1.DEFAULT_CONNECTION_CONFIG, ...config })); diff --git a/node_modules/@adiwajshing/baileys/lib/Socket/messages-recv.d.ts b/node_modules/@adiwajshing/baileys/lib/Socket/messages-recv.d.ts new file mode 100644 index 000000000..53ffcc140 --- /dev/null +++ b/node_modules/@adiwajshing/baileys/lib/Socket/messages-recv.d.ts @@ -0,0 +1,78 @@ +/// +/// +import { proto } from '../../WAProto'; +import { BaileysEventMap, MessageReceiptType, SocketConfig } from '../Types'; +import { BinaryNode, BinaryNodeAttributes } from '../WABinary'; +export declare const makeMessagesRecvSocket: (config: SocketConfig) => { + processMessage: (msg: proto.IWebMessageInfo) => Promise>>; + sendMessageAck: ({ tag, attrs }: BinaryNode, extraAttrs: BinaryNodeAttributes) => Promise; + sendRetryRequest: (node: BinaryNode) => Promise; + appPatch: (patchCreate: import("../Types").WAPatchCreate) => Promise; + sendPresenceUpdate: (type: import("../Types").WAPresence, toJid?: string) => Promise; + presenceSubscribe: (toJid: string) => Promise; + profilePictureUrl: (jid: string, type?: "image" | "preview", timeoutMs?: number) => Promise; + onWhatsApp: (...jids: string[]) => Promise<{ + exists: boolean; + jid: string; + }[]>; + fetchBlocklist: () => Promise; + fetchStatus: (jid: string) => Promise<{ + status: string; + setAt: Date; + }>; + updateProfilePicture: (jid: string, content: import("../Types").WAMediaUpload) => Promise; + updateBlockStatus: (jid: string, action: "block" | "unblock") => Promise; + getBusinessProfile: (jid: string) => Promise; + resyncAppState: (collections: import("../Types").WAPatchName[]) => Promise; + chatModify: (mod: import("../Types").ChatModification, jid: string) => Promise; + resyncMainAppState: () => Promise; + assertSessions: (jids: string[], force: boolean) => Promise; + relayMessage: (jid: string, message: proto.IMessage, { messageId: msgId, participant, additionalAttributes, cachedGroupMetadata }: import("../Types").MessageRelayOptions) => Promise; + sendReceipt: (jid: string, participant: string, messageIds: string[], type: MessageReceiptType) => Promise; + sendReadReceipt: (jid: string, participant: string, messageIds: string[]) => Promise; + readMessages: (keys: proto.IMessageKey[]) => Promise; + refreshMediaConn: (forceGet?: boolean) => Promise; + waUploadToServer: import("../Types").WAMediaUploadFunction; + fetchPrivacySettings: (force?: boolean) => Promise<{ + [_: string]: string; + }>; + sendMessage: (jid: string, content: import("../Types").AnyMessageContent, options?: import("../Types").MiscMessageGenerationOptions) => Promise; + groupMetadata: (jid: string) => Promise; + groupCreate: (subject: string, participants: string[]) => Promise; + groupLeave: (id: string) => Promise; + groupUpdateSubject: (jid: string, subject: string) => Promise; + groupParticipantsUpdate: (jid: string, participants: string[], action: import("../Types").ParticipantAction) => Promise; + groupUpdateDescription: (jid: string, description?: string) => Promise; + groupInviteCode: (jid: string) => Promise; + groupRevokeInvite: (jid: string) => Promise; + groupAcceptInvite: (code: string) => Promise; + groupAcceptInviteV4: (jid: string, inviteMessage: proto.IGroupInviteMessage) => Promise; + groupToggleEphemeral: (jid: string, ephemeralExpiration: number) => Promise; + groupSettingUpdate: (jid: string, setting: "announcement" | "locked" | "not_announcement" | "unlocked") => Promise; + groupFetchAllParticipating: () => Promise<{ + [_: string]: import("../Types").GroupMetadata; + }>; + type: "md"; + ws: import("ws"); + ev: import("../Types").BaileysEventEmitter; + authState: { + creds: import("../Types").AuthenticationCreds; + keys: import("../Types").SignalKeyStoreWithTransaction; + }; + user: import("../Types").Contact; + emitEventsFromMap: (map: Partial>) => void; + assertingPreKeys: (range: number, execute: (keys: { + [_: number]: any; + }) => Promise) => Promise; + generateMessageTag: () => string; + query: (node: BinaryNode, timeoutMs?: number) => Promise; + waitForMessage: (msgId: string, timeoutMs?: number) => Promise; + waitForSocketOpen: () => Promise; + sendRawMessage: (data: Uint8Array | Buffer) => Promise; + sendNode: (node: BinaryNode) => Promise; + logout: () => Promise; + end: (error: Error) => void; + onUnexpectedError: (error: Error, msg: string) => void; + uploadPreKeys: (count?: number) => Promise; + waitForConnectionUpdate: (check: (u: Partial) => boolean, timeoutMs?: number) => Promise; +}; diff --git a/node_modules/@adiwajshing/baileys/lib/Socket/messages-recv.d_1.ts b/node_modules/@adiwajshing/baileys/lib/Socket/messages-recv.d_1.ts deleted file mode 100644 index a44ed0b1e..000000000 --- a/node_modules/@adiwajshing/baileys/lib/Socket/messages-recv.d_1.ts +++ /dev/null @@ -1,73 +0,0 @@ -/// -/// -import { proto } from '../../WAProto'; -import { Chat, GroupMetadata, ParticipantAction, SocketConfig } from '../Types'; -import { BinaryNode, BinaryNodeAttributes } from '../WABinary'; -export declare const makeMessagesRecvSocket: (config: SocketConfig) => { - processMessage: (message: proto.IWebMessageInfo, chatUpdate: Partial) => Promise; - sendMessageAck: ({ tag, attrs }: BinaryNode, extraAttrs: BinaryNodeAttributes) => Promise; - sendRetryRequest: (node: BinaryNode) => Promise; - appPatch: (patchCreate: import("../Types").WAPatchCreate) => Promise; - sendPresenceUpdate: (type: import("../Types").WAPresence, toJid?: string) => Promise; - presenceSubscribe: (toJid: string) => Promise; - profilePictureUrl: (jid: string, type?: "image" | "preview", timeoutMs?: number) => Promise; - onWhatsApp: (...jids: string[]) => Promise<{ - exists: boolean; - jid: string; - }[]>; - fetchBlocklist: () => Promise; - fetchStatus: (jid: string) => Promise<{ - status: string; - setAt: Date; - }>; - updateProfilePicture: (jid: string, content: import("../Types").WAMediaUpload) => Promise; - updateBlockStatus: (jid: string, action: "block" | "unblock") => Promise; - getBusinessProfile: (jid: string) => Promise; - resyncAppState: (collections: import("../Types").WAPatchName[]) => Promise; - chatModify: (mod: import("../Types").ChatModification, jid: string) => Promise; - resyncMainAppState: () => Promise; - assertSessions: (jids: string[], force: boolean) => Promise; - relayMessage: (jid: string, message: proto.IMessage, { messageId: msgId, participant, additionalAttributes, cachedGroupMetadata }: import("../Types").MessageRelayOptions) => Promise; - sendReceipt: (jid: string, participant: string, messageIds: string[], type: "read" | "read-self") => Promise; - sendReadReceipt: (jid: string, participant: string, messageIds: string[]) => Promise; - refreshMediaConn: (forceGet?: boolean) => Promise; - waUploadToServer: import("../Types").WAMediaUploadFunction; - fetchPrivacySettings: (force?: boolean) => Promise<{ - [_: string]: string; - }>; - sendMessage: (jid: string, content: import("../Types").AnyMessageContent, options?: import("../Types").MiscMessageGenerationOptions) => Promise; - groupMetadata: (jid: string) => Promise; - groupCreate: (subject: string, participants: string[]) => Promise; - groupLeave: (id: string) => Promise; - groupUpdateSubject: (jid: string, subject: string) => Promise; - groupParticipantsUpdate: (jid: string, participants: string[], action: ParticipantAction) => Promise; - groupUpdateDescription: (jid: string, description?: string) => Promise; - groupInviteCode: (jid: string) => Promise; - groupRevokeInvite: (jid: string) => Promise; - groupAcceptInvite: (code: string) => Promise; - groupToggleEphemeral: (jid: string, ephemeralExpiration: number) => Promise; - groupSettingUpdate: (jid: string, setting: "announcement" | "locked" | "not_announcement" | "unlocked") => Promise; - groupFetchAllParticipating: () => Promise<{ - [_: string]: GroupMetadata; - }>; - type: "md"; - ws: import("ws"); - ev: import("../Types").BaileysEventEmitter; - authState: { - creds: import("../Types").AuthenticationCreds; - keys: import("../Types").SignalKeyStoreWithTransaction; - }; - user: import("../Types").Contact; - assertingPreKeys: (range: number, execute: (keys: { - [_: number]: any; - }) => Promise) => Promise; - generateMessageTag: () => string; - query: (node: BinaryNode, timeoutMs?: number) => Promise; - waitForMessage: (msgId: string, timeoutMs?: number) => Promise; - waitForSocketOpen: () => Promise; - sendRawMessage: (data: Uint8Array | Buffer) => Promise; - sendNode: (node: BinaryNode) => Promise; - logout: () => Promise; - end: (error: Error) => void; - waitForConnectionUpdate: (check: (u: Partial) => boolean, timeoutMs?: number) => Promise; -}; diff --git a/node_modules/@adiwajshing/baileys/lib/Socket/messages-recv.js b/node_modules/@adiwajshing/baileys/lib/Socket/messages-recv.js index 155957a9d..5887115b1 100644 --- a/node_modules/@adiwajshing/baileys/lib/Socket/messages-recv.js +++ b/node_modules/@adiwajshing/baileys/lib/Socket/messages-recv.js @@ -1,4 +1,7 @@ "use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; Object.defineProperty(exports, "__esModule", { value: true }); exports.makeMessagesRecvSocket = void 0; const WAProto_1 = require("../../WAProto"); @@ -6,29 +9,20 @@ const Defaults_1 = require("../Defaults"); const Types_1 = require("../Types"); const Utils_1 = require("../Utils"); const make_mutex_1 = require("../Utils/make-mutex"); +const process_message_1 = __importDefault(require("../Utils/process-message")); const WABinary_1 = require("../WABinary"); const chats_1 = require("./chats"); const groups_1 = require("./groups"); -const STATUS_MAP = { - 'played': WAProto_1.proto.WebMessageInfo.WebMessageInfoStatus.PLAYED, - 'read': WAProto_1.proto.WebMessageInfo.WebMessageInfoStatus.READ, - 'read-self': WAProto_1.proto.WebMessageInfo.WebMessageInfoStatus.READ -}; -const getStatusFromReceiptType = (type) => { - const status = STATUS_MAP[type]; - if (typeof type === 'undefined') { - return WAProto_1.proto.WebMessageInfo.WebMessageInfoStatus.DELIVERY_ACK; - } - return status; -}; +const MIN_PREKEY_COUNT = 5; const makeMessagesRecvSocket = (config) => { - const { logger } = config; + const { logger, treatCiphertextMessagesAsReal, retryRequestDelayMs } = config; const sock = chats_1.makeChatsSocket(config); - const { ev, authState, ws, assertSessions, assertingPreKeys, sendNode, relayMessage, sendReceipt, resyncMainAppState, } = sock; + const { ev, authState, ws, onUnexpectedError, assertSessions, assertingPreKeys, sendNode, relayMessage, sendReceipt, resyncMainAppState, emitEventsFromMap, uploadPreKeys, } = sock; /** this mutex ensures that the notifications (receipts, messages etc.) are processed in order */ const processingMutex = make_mutex_1.makeKeyedMutex(); /** this mutex ensures that each retryRequest will wait for the previous one to finish */ const retryMutex = make_mutex_1.makeMutex(); + const appStateSyncTimeout = Utils_1.debouncedTimeout(6000, () => ws.readyState === ws.OPEN && resyncMainAppState()); const msgRetryMap = config.msgRetryCounterMap || {}; const historyCache = new Set(); const sendMessageAck = async ({ tag, attrs }, extraAttrs) => { @@ -94,7 +88,8 @@ const makeMessagesRecvSocket = (config) => { } if (retryCount > 1) { const exec = Utils_1.generateSignalPubKey(Buffer.from(Defaults_1.KEY_BUNDLE_TYPE)).slice(0, 1); - receipt.content.push({ + const content = receipt.content; + content.push({ tag: 'keys', attrs: {}, content: [ @@ -110,114 +105,48 @@ const makeMessagesRecvSocket = (config) => { logger.info({ msgAttrs: node.attrs, retryCount }, 'sent retry receipt'); }); }; - const processMessage = async (message, chatUpdate) => { + const processMessageLocal = async (msg) => { var _a; - const protocolMsg = (_a = message.message) === null || _a === void 0 ? void 0 : _a.protocolMessage; - if (protocolMsg) { - switch (protocolMsg.type) { - case WAProto_1.proto.ProtocolMessage.ProtocolMessageType.HISTORY_SYNC_NOTIFICATION: - const histNotification = protocolMsg.historySyncNotification; - logger.info({ histNotification, id: message.key.id }, 'got history notification'); - const { chats, contacts, messages, isLatest } = await Utils_1.downloadAndProcessHistorySyncNotification(histNotification, historyCache); - const meJid = authState.creds.me.id; - await sendNode({ - tag: 'receipt', - attrs: { - id: message.key.id, - type: 'hist_sync', - to: WABinary_1.jidEncode(WABinary_1.jidDecode(meJid).user, 'c.us') - } - }); - if (chats.length) { - ev.emit('chats.set', { chats, isLatest }); - } - if (messages.length) { - ev.emit('messages.set', { messages, isLatest }); - } - if (contacts.length) { - ev.emit('contacts.set', { contacts }); - } - break; - case WAProto_1.proto.ProtocolMessage.ProtocolMessageType.APP_STATE_SYNC_KEY_SHARE: - const keys = protocolMsg.appStateSyncKeyShare.keys; - if (keys === null || keys === void 0 ? void 0 : keys.length) { - let newAppStateSyncKeyId = ''; - for (const { keyData, keyId } of keys) { - const strKeyId = Buffer.from(keyId.keyId).toString('base64'); - logger.info({ strKeyId }, 'injecting new app state sync key'); - await authState.keys.set({ 'app-state-sync-key': { [strKeyId]: keyData } }); - newAppStateSyncKeyId = strKeyId; - } - ev.emit('creds.update', { myAppStateKeyId: newAppStateSyncKeyId }); - resyncMainAppState(); - } - else { - [ - logger.info({ protocolMsg }, 'recv app state sync with 0 keys') - ]; - } - break; - case WAProto_1.proto.ProtocolMessage.ProtocolMessageType.REVOKE: - ev.emit('messages.update', [ - { - key: { - ...message.key, - id: protocolMsg.key.id - }, - update: { message: null, messageStubType: Types_1.WAMessageStubType.REVOKE, key: message.key } - } - ]); - break; - case WAProto_1.proto.ProtocolMessage.ProtocolMessageType.EPHEMERAL_SETTING: - chatUpdate.ephemeralSettingTimestamp = Utils_1.toNumber(message.messageTimestamp); - chatUpdate.ephemeralExpiration = protocolMsg.ephemeralExpiration || null; - break; + const meId = authState.creds.me.id; + // process message and emit events + const newEvents = await process_message_1.default(msg, { historyCache, meId, keyStore: authState.keys, logger, treatCiphertextMessagesAsReal }); + // send ack for history message + const normalizedContent = !!msg.message ? Utils_1.normalizeMessageContent(msg.message) : undefined; + const isAnyHistoryMsg = !!((_a = normalizedContent === null || normalizedContent === void 0 ? void 0 : normalizedContent.protocolMessage) === null || _a === void 0 ? void 0 : _a.historySyncNotification); + if (isAnyHistoryMsg) { + const jid = WABinary_1.jidEncode(WABinary_1.jidDecode(msg.key.remoteJid).user, 'c.us'); + await sendReceipt(jid, undefined, [msg.key.id], 'hist_sync'); + // we only want to sync app state once we've all the history + // restart the app state sync timeout + logger.debug('restarting app sync timeout'); + appStateSyncTimeout.start(); + } + return newEvents; + }; + const handleEncryptNotification = async (node) => { + const from = node.attrs.from; + if (from === WABinary_1.S_WHATSAPP_NET) { + const countChild = WABinary_1.getBinaryNodeChild(node, 'count'); + const count = +countChild.attrs.value; + const shouldUploadMorePreKeys = count < MIN_PREKEY_COUNT; + logger.debug({ count, shouldUploadMorePreKeys }, 'recv pre-key count'); + if (shouldUploadMorePreKeys) { + await uploadPreKeys(); } } - else if (message.messageStubType) { - const meJid = authState.creds.me.id; - const jid = message.key.remoteJid; - //let actor = whatsappID (message.participant) - let participants; - const emitParticipantsUpdate = (action) => (ev.emit('group-participants.update', { id: jid, participants, action })); - const emitGroupUpdate = (update) => { - ev.emit('groups.update', [{ id: jid, ...update }]); - }; - switch (message.messageStubType) { - case Types_1.WAMessageStubType.GROUP_PARTICIPANT_LEAVE: - case Types_1.WAMessageStubType.GROUP_PARTICIPANT_REMOVE: - participants = message.messageStubParameters; - emitParticipantsUpdate('remove'); - // mark the chat read only if you left the group - if (participants.includes(meJid)) { - chatUpdate.readOnly = true; - } - break; - case Types_1.WAMessageStubType.GROUP_PARTICIPANT_ADD: - case Types_1.WAMessageStubType.GROUP_PARTICIPANT_INVITE: - case Types_1.WAMessageStubType.GROUP_PARTICIPANT_ADD_REQUEST_JOIN: - participants = message.messageStubParameters; - if (participants.includes(meJid)) { - chatUpdate.readOnly = false; - } - emitParticipantsUpdate('add'); - break; - case Types_1.WAMessageStubType.GROUP_CHANGE_ANNOUNCE: - const announceValue = message.messageStubParameters[0]; - emitGroupUpdate({ announce: announceValue === 'true' || announceValue === 'on' }); - break; - case Types_1.WAMessageStubType.GROUP_CHANGE_RESTRICT: - const restrictValue = message.messageStubParameters[0]; - emitGroupUpdate({ restrict: restrictValue === 'true' || restrictValue === 'on' }); - break; - case Types_1.WAMessageStubType.GROUP_CHANGE_SUBJECT: - chatUpdate.name = message.messageStubParameters[0]; - emitGroupUpdate({ subject: chatUpdate.name }); - break; + else { + const identityNode = WABinary_1.getBinaryNodeChild(node, 'identity'); + if (identityNode) { + logger.info({ jid: from }, 'identity changed'); + // not handling right now + // signal will override new identity anyway + } + else { + logger.info({ node }, 'unknown encrypt notification'); } } }; - const processNotification = (node) => { + const processNotification = async (node) => { const result = {}; const [child] = WABinary_1.getAllBinaryNodeChildren(node); if (node.attrs.type === 'w:gp2') { @@ -285,50 +214,15 @@ const makeMessagesRecvSocket = (config) => { logger.info({ deviceJids }, 'got my own devices'); } break; + case 'encrypt': + handleEncryptNotification(node); + break; } } if (Object.keys(result).length) { return result; } }; - // recv a message - ws.on('CB:message', (stanza) => { - const { fullMessage: msg, decryptionTask } = Utils_1.decodeMessageStanza(stanza, authState); - processingMutex.mutex(msg.key.remoteJid, async () => { - await decryptionTask; - // message failed to decrypt - if (msg.messageStubType === WAProto_1.proto.WebMessageInfo.WebMessageInfoStubType.CIPHERTEXT) { - logger.error({ msgId: msg.key.id, params: msg.messageStubParameters }, 'failure in decrypting message'); - retryMutex.mutex(async () => await sendRetryRequest(stanza)); - } - else { - await sendMessageAck(stanza, { class: 'receipt' }); - // no type in the receipt => message delivered - await sendReceipt(msg.key.remoteJid, msg.key.participant, [msg.key.id], undefined); - logger.debug({ msg: msg.key }, 'sent delivery receipt'); - } - msg.key.remoteJid = WABinary_1.jidNormalizedUser(msg.key.remoteJid); - ev.emit('messages.upsert', { messages: [msg], type: stanza.attrs.offline ? 'append' : 'notify' }); - }); - }); - ws.on('CB:ack,class:message', async (node) => { - await sendNode({ - tag: 'ack', - attrs: { - class: 'receipt', - id: node.attrs.id, - from: node.attrs.from - } - }); - logger.debug({ attrs: node.attrs }, 'sending receipt for ack'); - }); - ws.on('CB:call', async (node) => { - logger.info({ node }, 'recv call'); - const [child] = WABinary_1.getAllBinaryNodeChildren(node); - if (!!(child === null || child === void 0 ? void 0 : child.tag)) { - await sendMessageAck(node, { class: 'call', type: child.tag }); - } - }); const sendMessagesAgain = async (key, ids) => { const msgs = await Promise.all(ids.map(id => (config.getMessage({ ...key, id })))); const participant = key.participant || key.remoteJid; @@ -355,7 +249,7 @@ const makeMessagesRecvSocket = (config) => { const { attrs, content } = node; const isNodeFromMe = WABinary_1.areJidsSameUser(attrs.participant || attrs.from, (_a = authState.creds.me) === null || _a === void 0 ? void 0 : _a.id); const remoteJid = !isNodeFromMe || WABinary_1.isJidGroup(attrs.from) ? attrs.from : attrs.recipient; - const fromMe = !attrs.recipient; + const fromMe = !attrs.recipient || (attrs.type === 'retry' && isNodeFromMe); const ids = [attrs.id]; if (Array.isArray(content)) { const items = WABinary_1.getBinaryNodeChildren(content[0], 'item'); @@ -368,7 +262,7 @@ const makeMessagesRecvSocket = (config) => { participant: attrs.participant }; await processingMutex.mutex(remoteJid, async () => { - const status = getStatusFromReceiptType(attrs.type); + const status = Utils_1.getStatusFromReceiptType(attrs.type); if (typeof status !== 'undefined' && ( // basically, we only want to know when a message from us has been delivered to/read by the other person @@ -397,7 +291,7 @@ const makeMessagesRecvSocket = (config) => { key.participant = key.participant || attrs.from; if (key.fromMe) { try { - logger.debug({ attrs }, 'recv retry request'); + logger.debug({ attrs, key }, 'recv retry request'); await sendMessagesAgain(key, ids); } catch (error) { @@ -414,11 +308,11 @@ const makeMessagesRecvSocket = (config) => { } }); }; - ws.on('CB:receipt', handleReceipt); - ws.on('CB:notification', async (node) => { + const handleNotification = async (node) => { const remoteJid = node.attrs.from; - processingMutex.mutex(remoteJid, () => { - const msg = processNotification(node); + await sendMessageAck(node, { class: 'notification', type: node.attrs.type }); + await processingMutex.mutex(remoteJid, async () => { + const msg = await processNotification(node); if (msg) { const fromMe = WABinary_1.areJidsSameUser(node.attrs.participant || node.attrs.from, authState.creds.me.id); msg.key = { @@ -428,43 +322,117 @@ const makeMessagesRecvSocket = (config) => { id: node.attrs.id, ...(msg.key || {}) }; + msg.participant = node.attrs.participant; msg.messageTimestamp = +node.attrs.t; const fullMsg = WAProto_1.proto.WebMessageInfo.fromObject(msg); ev.emit('messages.upsert', { messages: [fullMsg], type: 'append' }); } }); - await sendMessageAck(node, { class: 'notification', type: node.attrs.type }); - }); - ev.on('messages.upsert', async ({ messages, type }) => { + }; + const handleUpsertedMessages = async ({ messages, type }) => { var _a; if (type === 'notify' || type === 'append') { - const chat = { id: messages[0].key.remoteJid }; const contactNameUpdates = {}; for (const msg of messages) { + const normalizedChatId = WABinary_1.jidNormalizedUser(msg.key.remoteJid); if (!!msg.pushName) { - const jid = msg.key.fromMe ? WABinary_1.jidNormalizedUser(authState.creds.me.id) : (msg.key.participant || msg.key.remoteJid); + let jid = msg.key.fromMe ? authState.creds.me.id : (msg.key.participant || msg.key.remoteJid); + jid = WABinary_1.jidNormalizedUser(jid); contactNameUpdates[jid] = msg.pushName; // update our pushname too if (msg.key.fromMe && ((_a = authState.creds.me) === null || _a === void 0 ? void 0 : _a.name) !== msg.pushName) { ev.emit('creds.update', { me: { ...authState.creds.me, name: msg.pushName } }); } } - await processingMutex.mutex('p-' + chat.id, () => processMessage(msg, chat)); - if (!!msg.message && !msg.message.protocolMessage) { - chat.conversationTimestamp = Utils_1.toNumber(msg.messageTimestamp); - if (!msg.key.fromMe) { - chat.unreadCount = (chat.unreadCount || 0) + 1; - } - } - } - if (Object.keys(chat).length > 1) { - ev.emit('chats.update', [chat]); + const events = await processingMutex.mutex('p-' + normalizedChatId, () => processMessageLocal(msg)); + emitEventsFromMap(events); } if (Object.keys(contactNameUpdates).length) { ev.emit('contacts.update', Object.keys(contactNameUpdates).map(id => ({ id, notify: contactNameUpdates[id] }))); } } + }; + // recv a message + ws.on('CB:message', (stanza) => { + const { fullMessage: msg, category, author, decryptionTask } = Utils_1.decodeMessageStanza(stanza, authState); + processingMutex.mutex(msg.key.remoteJid, async () => { + await decryptionTask; + // message failed to decrypt + if (msg.messageStubType === WAProto_1.proto.WebMessageInfo.WebMessageInfoStubType.CIPHERTEXT) { + logger.error({ msgId: msg.key.id, params: msg.messageStubParameters }, 'failure in decrypting message'); + retryMutex.mutex(async () => { + if (ws.readyState === ws.OPEN) { + await sendRetryRequest(stanza); + if (retryRequestDelayMs) { + await Utils_1.delay(retryRequestDelayMs); + } + } + else { + logger.debug({ stanza }, 'connection closed, ignoring retry req'); + } + }); + } + else { + await sendMessageAck(stanza, { class: 'receipt' }); + // no type in the receipt => message delivered + let type = undefined; + let participant = msg.key.participant; + if (category === 'peer') { // special peer message + type = 'peer_msg'; + } + else if (msg.key.fromMe) { // message was sent by us from a different device + type = 'sender'; + // need to specially handle this case + if (WABinary_1.isJidUser(msg.key.remoteJid)) { + participant = author; + } + } + await sendReceipt(msg.key.remoteJid, participant, [msg.key.id], type); + } + msg.key.remoteJid = WABinary_1.jidNormalizedUser(msg.key.remoteJid); + ev.emit('messages.upsert', { messages: [msg], type: stanza.attrs.offline ? 'append' : 'notify' }); + }) + .catch(error => onUnexpectedError(error, 'processing message')); + }); + ws.on('CB:ack,class:message', async (node) => { + sendNode({ + tag: 'ack', + attrs: { + class: 'receipt', + id: node.attrs.id, + from: node.attrs.from + } + }) + .catch(err => onUnexpectedError(err, 'ack message receipt')); + logger.debug({ attrs: node.attrs }, 'sending receipt for ack'); + }); + ws.on('CB:call', async (node) => { + logger.info({ node }, 'recv call'); + const [child] = WABinary_1.getAllBinaryNodeChildren(node); + if (!!(child === null || child === void 0 ? void 0 : child.tag)) { + sendMessageAck(node, { class: 'call', type: child.tag }) + .catch(error => onUnexpectedError(error, 'ack call')); + } + }); + ws.on('CB:receipt', node => { + handleReceipt(node) + .catch(error => onUnexpectedError(error, 'handling receipt')); }); - return { ...sock, processMessage, sendMessageAck, sendRetryRequest }; + ws.on('CB:notification', async (node) => { + handleNotification(node) + .catch(error => { + onUnexpectedError(error, 'handling notification'); + }); + }); + ev.on('messages.upsert', data => { + handleUpsertedMessages(data) + .catch(error => onUnexpectedError(error, 'handling upserted messages')); + }); + return { + ...sock, + processMessage: processMessageLocal, + sendMessageAck, + sendRetryRequest + }; }; exports.makeMessagesRecvSocket = makeMessagesRecvSocket; diff --git a/node_modules/@adiwajshing/baileys/lib/Socket/messages-send.d.ts b/node_modules/@adiwajshing/baileys/lib/Socket/messages-send.d.ts new file mode 100644 index 000000000..93d4f5c4b --- /dev/null +++ b/node_modules/@adiwajshing/baileys/lib/Socket/messages-send.d.ts @@ -0,0 +1,56 @@ +/// +/// +import { proto } from '../../WAProto'; +import { AnyMessageContent, MediaConnInfo, MessageReceiptType, MessageRelayOptions, MiscMessageGenerationOptions, SocketConfig, WAMessageKey } from '../Types'; +import { BinaryNode } from '../WABinary'; +export declare const makeMessagesSocket: (config: SocketConfig) => { + assertSessions: (jids: string[], force: boolean) => Promise; + relayMessage: (jid: string, message: proto.IMessage, { messageId: msgId, participant, additionalAttributes, cachedGroupMetadata }: MessageRelayOptions) => Promise; + sendReceipt: (jid: string, participant: string | undefined, messageIds: string[], type: MessageReceiptType) => Promise; + sendReadReceipt: (jid: string, participant: string | undefined, messageIds: string[]) => Promise; + readMessages: (keys: WAMessageKey[]) => Promise; + refreshMediaConn: (forceGet?: boolean) => Promise; + waUploadToServer: import("../Types").WAMediaUploadFunction; + fetchPrivacySettings: (force?: boolean) => Promise<{ + [_: string]: string; + }>; + sendMessage: (jid: string, content: AnyMessageContent, options?: MiscMessageGenerationOptions) => Promise; + groupMetadata: (jid: string) => Promise; + groupCreate: (subject: string, participants: string[]) => Promise; + groupLeave: (id: string) => Promise; + groupUpdateSubject: (jid: string, subject: string) => Promise; + groupParticipantsUpdate: (jid: string, participants: string[], action: import("../Types").ParticipantAction) => Promise; + groupUpdateDescription: (jid: string, description?: string) => Promise; + groupInviteCode: (jid: string) => Promise; + groupRevokeInvite: (jid: string) => Promise; + groupAcceptInvite: (code: string) => Promise; + groupAcceptInviteV4: (jid: string, inviteMessage: proto.IGroupInviteMessage) => Promise; + groupToggleEphemeral: (jid: string, ephemeralExpiration: number) => Promise; + groupSettingUpdate: (jid: string, setting: "announcement" | "locked" | "not_announcement" | "unlocked") => Promise; + groupFetchAllParticipating: () => Promise<{ + [_: string]: import("../Types").GroupMetadata; + }>; + type: "md"; + ws: import("ws"); + ev: import("../Types").BaileysEventEmitter; + authState: { + creds: import("../Types").AuthenticationCreds; + keys: import("../Types").SignalKeyStoreWithTransaction; + }; + user: import("../Types").Contact; + emitEventsFromMap: (map: Partial>) => void; + assertingPreKeys: (range: number, execute: (keys: { + [_: number]: any; + }) => Promise) => Promise; + generateMessageTag: () => string; + query: (node: BinaryNode, timeoutMs?: number) => Promise; + waitForMessage: (msgId: string, timeoutMs?: number) => Promise; + waitForSocketOpen: () => Promise; + sendRawMessage: (data: Uint8Array | Buffer) => Promise; + sendNode: (node: BinaryNode) => Promise; + logout: () => Promise; + end: (error: Error) => void; + onUnexpectedError: (error: Error, msg: string) => void; + uploadPreKeys: (count?: number) => Promise; + waitForConnectionUpdate: (check: (u: Partial) => boolean, timeoutMs?: number) => Promise; +}; diff --git a/node_modules/@adiwajshing/baileys/lib/Socket/messages-send.d_1.ts b/node_modules/@adiwajshing/baileys/lib/Socket/messages-send.d_1.ts deleted file mode 100644 index 44c4815f6..000000000 --- a/node_modules/@adiwajshing/baileys/lib/Socket/messages-send.d_1.ts +++ /dev/null @@ -1,51 +0,0 @@ -/// -/// -import { proto } from '../../WAProto'; -import { AnyMessageContent, MediaConnInfo, MessageRelayOptions, MiscMessageGenerationOptions, SocketConfig } from '../Types'; -import { BinaryNode } from '../WABinary'; -export declare const makeMessagesSocket: (config: SocketConfig) => { - assertSessions: (jids: string[], force: boolean) => Promise; - relayMessage: (jid: string, message: proto.IMessage, { messageId: msgId, participant, additionalAttributes, cachedGroupMetadata }: MessageRelayOptions) => Promise; - sendReceipt: (jid: string, participant: string | undefined, messageIds: string[], type: 'read' | 'read-self' | undefined) => Promise; - sendReadReceipt: (jid: string, participant: string | undefined, messageIds: string[]) => Promise; - refreshMediaConn: (forceGet?: boolean) => Promise; - waUploadToServer: import("../Types").WAMediaUploadFunction; - fetchPrivacySettings: (force?: boolean) => Promise<{ - [_: string]: string; - }>; - sendMessage: (jid: string, content: AnyMessageContent, options?: MiscMessageGenerationOptions) => Promise; - groupMetadata: (jid: string) => Promise; - groupCreate: (subject: string, participants: string[]) => Promise; - groupLeave: (id: string) => Promise; - groupUpdateSubject: (jid: string, subject: string) => Promise; - groupParticipantsUpdate: (jid: string, participants: string[], action: import("../Types").ParticipantAction) => Promise; - groupUpdateDescription: (jid: string, description?: string) => Promise; - groupInviteCode: (jid: string) => Promise; - groupRevokeInvite: (jid: string) => Promise; - groupAcceptInvite: (code: string) => Promise; - groupToggleEphemeral: (jid: string, ephemeralExpiration: number) => Promise; - groupSettingUpdate: (jid: string, setting: "announcement" | "locked" | "not_announcement" | "unlocked") => Promise; - groupFetchAllParticipating: () => Promise<{ - [_: string]: import("../Types").GroupMetadata; - }>; - type: "md"; - ws: import("ws"); - ev: import("../Types").BaileysEventEmitter; - authState: { - creds: import("../Types").AuthenticationCreds; - keys: import("../Types").SignalKeyStoreWithTransaction; - }; - user: import("../Types").Contact; - assertingPreKeys: (range: number, execute: (keys: { - [_: number]: any; - }) => Promise) => Promise; - generateMessageTag: () => string; - query: (node: BinaryNode, timeoutMs?: number) => Promise; - waitForMessage: (msgId: string, timeoutMs?: number) => Promise; - waitForSocketOpen: () => Promise; - sendRawMessage: (data: Uint8Array | Buffer) => Promise; - sendNode: (node: BinaryNode) => Promise; - logout: () => Promise; - end: (error: Error) => void; - waitForConnectionUpdate: (check: (u: Partial) => boolean, timeoutMs?: number) => Promise; -}; diff --git a/node_modules/@adiwajshing/baileys/lib/Socket/messages-send.js b/node_modules/@adiwajshing/baileys/lib/Socket/messages-send.js index d2ecc74f1..4cd9a198a 100644 --- a/node_modules/@adiwajshing/baileys/lib/Socket/messages-send.js +++ b/node_modules/@adiwajshing/baileys/lib/Socket/messages-send.js @@ -72,16 +72,25 @@ const makeMessagesSocket = (config) => { tag: 'receipt', attrs: { id: messageIds[0], - t: Date.now().toString(), - to: jid, }, }; + const isReadReceipt = type === 'read' || type === 'read-self'; + if (isReadReceipt) { + node.attrs.t = Utils_1.unixTimestampSeconds().toString(); + } + if (type === 'sender' && WABinary_1.isJidUser(jid)) { + node.attrs.recipient = jid; + node.attrs.to = participant; + } + else { + node.attrs.to = jid; + if (participant) { + node.attrs.participant = participant; + } + } if (type) { node.attrs.type = type; } - if (participant) { - node.attrs.participant = participant; - } const remainingMessageIds = messageIds.slice(1); if (remainingMessageIds.length) { node.content = [ @@ -95,7 +104,7 @@ const makeMessagesSocket = (config) => { } ]; } - logger.debug({ jid, messageIds, type }, 'sending receipt for messages'); + logger.debug({ attrs: node.attrs, messageIds }, 'sending receipt for messages'); await sendNode(node); }; const sendReadReceipt = async (jid, participant, messageIds) => { @@ -104,6 +113,13 @@ const makeMessagesSocket = (config) => { const readType = privacySettings.readreceipts === 'all' ? 'read' : 'read-self'; return sendReceipt(jid, participant, messageIds, readType); }; + /** Bulk read messages. Keys can be from different chats & participants */ + const readMessages = async (keys) => { + const recps = Utils_1.aggregateMessageKeysNotFromMe(keys); + for (const { jid, participant, messageIds } of recps) { + await sendReadReceipt(jid, participant, messageIds); + } + }; const getUSyncDevices = async (jids, ignoreZeroDevices) => { const deviceResults = []; const users = []; @@ -361,6 +377,7 @@ const makeMessagesSocket = (config) => { relayMessage, sendReceipt, sendReadReceipt, + readMessages, refreshMediaConn, waUploadToServer, fetchPrivacySettings, diff --git a/node_modules/@adiwajshing/baileys/lib/Socket/socket.d.ts b/node_modules/@adiwajshing/baileys/lib/Socket/socket.d.ts new file mode 100644 index 000000000..6377936d2 --- /dev/null +++ b/node_modules/@adiwajshing/baileys/lib/Socket/socket.d.ts @@ -0,0 +1,37 @@ +/// +import WebSocket from 'ws'; +import { AuthenticationCreds, BaileysEventEmitter, BaileysEventMap, SocketConfig } from '../Types'; +import { BinaryNode } from '../WABinary'; +/** + * Connects to WA servers and performs: + * - simple queries (no retry mechanism, wait for connection establishment) + * - listen to messages and emit events + * - query phone connection + */ +export declare const makeSocket: ({ waWebSocketUrl, connectTimeoutMs, logger, agent, keepAliveIntervalMs, version, browser, auth: initialAuthState, printQRInTerminal, defaultQueryTimeoutMs }: SocketConfig) => { + type: "md"; + ws: WebSocket; + ev: BaileysEventEmitter; + authState: { + creds: AuthenticationCreds; + keys: import("../Types").SignalKeyStoreWithTransaction; + }; + readonly user: import("../Types").Contact; + emitEventsFromMap: (map: Partial>) => void; + assertingPreKeys: (range: number, execute: (keys: { + [_: number]: any; + }) => Promise) => Promise; + generateMessageTag: () => string; + query: (node: BinaryNode, timeoutMs?: number) => Promise; + waitForMessage: (msgId: string, timeoutMs?: number) => Promise; + waitForSocketOpen: () => Promise; + sendRawMessage: (data: Buffer | Uint8Array) => Promise; + sendNode: (node: BinaryNode) => Promise; + logout: () => Promise; + end: (error: Error | undefined) => void; + onUnexpectedError: (error: Error, msg: string) => void; + uploadPreKeys: (count?: number) => Promise; + /** Waits for the connection to WA to reach a state */ + waitForConnectionUpdate: (check: (u: Partial) => boolean, timeoutMs?: number) => Promise; +}; +export declare type Socket = ReturnType; diff --git a/node_modules/@adiwajshing/baileys/lib/Socket/socket.d_1.ts b/node_modules/@adiwajshing/baileys/lib/Socket/socket.d_1.ts deleted file mode 100644 index 5ddb83681..000000000 --- a/node_modules/@adiwajshing/baileys/lib/Socket/socket.d_1.ts +++ /dev/null @@ -1,34 +0,0 @@ -/// -import WebSocket from 'ws'; -import { AuthenticationCreds, BaileysEventEmitter, SocketConfig } from '../Types'; -import { BinaryNode } from '../WABinary'; -/** - * Connects to WA servers and performs: - * - simple queries (no retry mechanism, wait for connection establishment) - * - listen to messages and emit events - * - query phone connection - */ -export declare const makeSocket: ({ waWebSocketUrl, connectTimeoutMs, logger, agent, keepAliveIntervalMs, version, browser, auth: initialAuthState, printQRInTerminal, defaultQueryTimeoutMs }: SocketConfig) => { - type: "md"; - ws: WebSocket; - ev: BaileysEventEmitter; - authState: { - creds: AuthenticationCreds; - keys: import("../Types").SignalKeyStoreWithTransaction; - }; - readonly user: import("../Types").Contact; - assertingPreKeys: (range: number, execute: (keys: { - [_: number]: any; - }) => Promise) => Promise; - generateMessageTag: () => string; - query: (node: BinaryNode, timeoutMs?: number) => Promise; - waitForMessage: (msgId: string, timeoutMs?: number) => Promise; - waitForSocketOpen: () => Promise; - sendRawMessage: (data: Buffer | Uint8Array) => Promise; - sendNode: (node: BinaryNode) => Promise; - logout: () => Promise; - end: (error: Error | undefined) => void; - /** Waits for the connection to WA to reach a state */ - waitForConnectionUpdate: (check: (u: Partial) => boolean, timeoutMs?: number) => Promise; -}; -export declare type Socket = ReturnType; diff --git a/node_modules/@adiwajshing/baileys/lib/Socket/socket.js b/node_modules/@adiwajshing/baileys/lib/Socket/socket.js index 868404799..943b1c326 100644 --- a/node_modules/@adiwajshing/baileys/lib/Socket/socket.js +++ b/node_modules/@adiwajshing/baileys/lib/Socket/socket.js @@ -14,6 +14,7 @@ const Defaults_1 = require("../Defaults"); const Types_1 = require("../Types"); const Utils_1 = require("../Utils"); const WABinary_1 = require("../WABinary"); +const INITIAL_PREKEY_COUNT = 30; /** * Connects to WA servers and performs: * - simple queries (no retry mechanism, wait for connection establishment) @@ -50,6 +51,8 @@ const makeSocket = ({ waWebSocketUrl, connectTimeoutMs, logger, agent, keepAlive `); } const { creds } = authState; + // add transaction capability + const keys = Utils_1.addTransactionCapability(authState.keys, logger); let lastDateRecv; let epoch = 0; let keepAliveReq; @@ -70,6 +73,10 @@ const makeSocket = ({ waWebSocketUrl, connectTimeoutMs, logger, agent, keepAlive const buff = WABinary_1.encodeBinaryNode(node); return sendRawMessage(buff); }; + /** log & process any unexpected errors */ + const onUnexpectedError = (error, msg) => { + logger.error({ trace: error.stack, output: error.output }, `unexpected error in '${msg}'`); + }; /** await the next incoming message */ const awaitNextMessage = async (sendMsg) => { if (ws.readyState !== ws.OPEN) { @@ -137,25 +144,27 @@ const makeSocket = ({ waWebSocketUrl, connectTimeoutMs, logger, agent, keepAlive }; /** connection handshake */ const validateConnection = async () => { - logger.info('connected to WA Web'); - const init = WAProto_1.proto.HandshakeMessage.encode({ + let helloMsg = { clientHello: { ephemeral: ephemeralKeyPair.public } - }).finish(); + }; + helloMsg = WAProto_1.proto.HandshakeMessage.fromObject(helloMsg); + logger.info({ browser, helloMsg }, 'connected to WA Web'); + const init = WAProto_1.proto.HandshakeMessage.encode(helloMsg).finish(); const result = await awaitNextMessage(init); const handshake = WAProto_1.proto.HandshakeMessage.decode(result); - logger.debug('handshake recv from WA Web'); + logger.trace({ handshake }, 'handshake recv from WA Web'); const keyEnc = noise.processHandshake(handshake, creds.noiseKey); logger.info('handshake complete'); let node; if (!creds.me) { - logger.info('not logged in, attempting registration...'); node = Utils_1.generateRegistrationNode(creds, { version, browser }); + logger.info({ node }, 'not logged in, attempting registration...'); } else { - logger.info('logging in...'); node = Utils_1.generateLoginNode(creds.me.id, { version, browser }); + logger.info({ node }, 'logging in...'); } - const payloadEnc = noise.encrypt(node); + const payloadEnc = noise.encrypt(WAProto_1.proto.ClientPayload.encode(node).finish()); await sendRawMessage(WAProto_1.proto.HandshakeMessage.encode({ clientFinish: { static: new Uint8Array(keyEnc), @@ -165,7 +174,11 @@ const makeSocket = ({ waWebSocketUrl, connectTimeoutMs, logger, agent, keepAlive noise.finishInit(); startKeepAliveRequest(); }; - /** get some pre-keys and do something with them */ + /** + * get some pre-keys and do something with them + * @param range how many pre-keys to get + * @param execute what to do with them + */ const assertingPreKeys = async (range, execute) => { const { newPreKeys, lastPreKeyId, preKeysRange } = Utils_1.generateOrGetPreKeys(authState.creds, range); const update = { @@ -175,14 +188,16 @@ const makeSocket = ({ waWebSocketUrl, connectTimeoutMs, logger, agent, keepAlive if (!creds.serverHasPreKeys) { update.serverHasPreKeys = true; } - await authState.keys.set({ 'pre-key': newPreKeys }); - const preKeys = await Utils_1.getPreKeys(authState.keys, preKeysRange[0], preKeysRange[0] + preKeysRange[1]); - await execute(preKeys); + await keys.transaction(async () => { + await keys.set({ 'pre-key': newPreKeys }); + const preKeys = await Utils_1.getPreKeys(keys, preKeysRange[0], preKeysRange[0] + preKeysRange[1]); + await execute(preKeys); + }); ev.emit('creds.update', update); }; - /** generates and uploads a set of pre-keys */ - const uploadPreKeys = async () => { - await assertingPreKeys(30, async (preKeys) => { + /** generates and uploads a set of pre-keys to the server */ + const uploadPreKeys = async (count = INITIAL_PREKEY_COUNT) => { + await assertingPreKeys(count, async (preKeys) => { const node = { tag: 'iq', attrs: { @@ -206,6 +221,8 @@ const makeSocket = ({ waWebSocketUrl, connectTimeoutMs, logger, agent, keepAlive const onMessageRecieved = (data) => { noise.decodeFrame(data, frame => { var _a; + // reset ping timeout + lastDateRecv = new Date(); ws.emit('frame', frame); // if it's a binary node if (!(frame instanceof Uint8Array)) { @@ -237,7 +254,7 @@ const makeSocket = ({ waWebSocketUrl, connectTimeoutMs, logger, agent, keepAlive const end = (error) => { logger.info({ error }, 'connection closed'); clearInterval(keepAliveReq); - clearInterval(qrTimer); + clearTimeout(qrTimer); ws.removeAllListeners('close'); ws.removeAllListeners('error'); ws.removeAllListeners('open'); @@ -293,7 +310,7 @@ const makeSocket = ({ waWebSocketUrl, connectTimeoutMs, logger, agent, keepAlive } else if (ws.readyState === ws.OPEN) { // if its all good, send a keep alive request - query({ + sendNode({ tag: 'iq', attrs: { id: generateMessageTag(), @@ -302,30 +319,32 @@ const makeSocket = ({ waWebSocketUrl, connectTimeoutMs, logger, agent, keepAlive xmlns: 'w:p', }, content: [{ tag: 'ping', attrs: {} }] - }, keepAliveIntervalMs) - .then(() => { - lastDateRecv = new Date(); - logger.trace('recv keep alive'); }) - .catch(err => end(err)); + .catch(err => { + logger.error({ trace: err.stack }, 'error in sending keep alive'); + }); } else { logger.warn('keep alive called when WS not open'); } }, keepAliveIntervalMs)); /** i have no idea why this exists. pls enlighten me */ - const sendPassiveIq = (tag) => (sendNode({ + const sendPassiveIq = (tag) => (query({ tag: 'iq', attrs: { to: WABinary_1.S_WHATSAPP_NET, xmlns: 'passive', type: 'set', - id: generateMessageTag(), }, content: [ { tag, attrs: {} } ] })); + const emitEventsFromMap = (map) => { + for (const key in map) { + ev.emit(key, map[key]); + } + }; /** logout & invalidate connection */ const logout = async () => { var _a; @@ -343,7 +362,7 @@ const makeSocket = ({ waWebSocketUrl, connectTimeoutMs, logger, agent, keepAlive { tag: 'remove-companion-device', attrs: { - jid: jid, + jid, reason: 'user_initiated' } } @@ -377,6 +396,9 @@ const makeSocket = ({ waWebSocketUrl, connectTimeoutMs, logger, agent, keepAlive const advB64 = creds.advSecretKey; let qrMs = 60000; // time to let a QR live const genPairQR = () => { + if (ws.readyState !== ws.OPEN) { + return; + } const ref = refs.shift(); if (!ref) { end(new boom_1.Boom('QR refs attempts ended', { statusCode: Types_1.DisconnectReason.timedOut })); @@ -409,6 +431,8 @@ const makeSocket = ({ waWebSocketUrl, connectTimeoutMs, logger, agent, keepAlive ev.emit('creds.update', updatedCreds); ev.emit('connection.update', { isNewLogin: true, qr: undefined }); end(new boom_1.Boom('Restart Required', { statusCode: Types_1.DisconnectReason.restartRequired })); + logger.warn('If your process stalls here, make sure to implement the reconnect logic as shown in ' + + 'https://github.com/adiwajshing/Baileys/blob/master/Example/example.ts#:~:text=reconnect'); } catch (error) { logger.info({ trace: error.stack }, 'error in pairing'); @@ -448,7 +472,19 @@ const makeSocket = ({ waWebSocketUrl, connectTimeoutMs, logger, agent, keepAlive ev.emit('connection.update', { connection: 'connecting', receivedPendingNotifications: false, qr: undefined }); }); // update credentials when required - ev.on('creds.update', update => Object.assign(creds, update)); + ev.on('creds.update', update => { + var _a, _b; + const name = (_a = update.me) === null || _a === void 0 ? void 0 : _a.name; + // if name has just been received + if (!((_b = creds.me) === null || _b === void 0 ? void 0 : _b.name) && name) { + logger.info({ name }, 'received pushName'); + sendNode({ + tag: 'presence', + attrs: { name } + }); + } + Object.assign(creds, update); + }); if (printQRInTerminal) { Utils_1.printQRIfNecessaryListener(ev, logger); } @@ -456,14 +492,11 @@ const makeSocket = ({ waWebSocketUrl, connectTimeoutMs, logger, agent, keepAlive type: 'md', ws, ev, - authState: { - creds, - // add capability - keys: Utils_1.addTransactionCapability(authState.keys, logger) - }, + authState: { creds, keys }, get user() { return authState.creds.me; }, + emitEventsFromMap, assertingPreKeys, generateMessageTag, query, @@ -473,6 +506,8 @@ const makeSocket = ({ waWebSocketUrl, connectTimeoutMs, logger, agent, keepAlive sendNode, logout, end, + onUnexpectedError, + uploadPreKeys, /** Waits for the connection to WA to reach a state */ waitForConnectionUpdate: Utils_1.bindWaitForConnectionUpdate(ev) }; diff --git a/node_modules/@adiwajshing/baileys/lib/Store/.trashed-1649374382-index.d.ts b/node_modules/@adiwajshing/baileys/lib/Store/index.d.ts similarity index 100% rename from node_modules/@adiwajshing/baileys/lib/Store/.trashed-1649374382-index.d.ts rename to node_modules/@adiwajshing/baileys/lib/Store/index.d.ts diff --git a/node_modules/@adiwajshing/baileys/lib/Store/index.d_1.ts b/node_modules/@adiwajshing/baileys/lib/Store/index.d_1.ts deleted file mode 100644 index 2eeab8f3f..000000000 --- a/node_modules/@adiwajshing/baileys/lib/Store/index.d_1.ts +++ /dev/null @@ -1,2 +0,0 @@ -import makeInMemoryStore from './make-in-memory-store'; -export { makeInMemoryStore }; diff --git a/node_modules/@adiwajshing/baileys/lib/Store/.trashed-1649374382-make-in-memory-store.d.ts b/node_modules/@adiwajshing/baileys/lib/Store/make-in-memory-store.d.ts similarity index 100% rename from node_modules/@adiwajshing/baileys/lib/Store/.trashed-1649374382-make-in-memory-store.d.ts rename to node_modules/@adiwajshing/baileys/lib/Store/make-in-memory-store.d.ts diff --git a/node_modules/@adiwajshing/baileys/lib/Store/make-in-memory-store.d_1.ts b/node_modules/@adiwajshing/baileys/lib/Store/make-in-memory-store.d_1.ts deleted file mode 100644 index 9b5be8732..000000000 --- a/node_modules/@adiwajshing/baileys/lib/Store/make-in-memory-store.d_1.ts +++ /dev/null @@ -1,88 +0,0 @@ -import type KeyedDB from '@adiwajshing/keyed-db'; -import type { Comparable } from '@adiwajshing/keyed-db/lib/Types'; -import type { Logger } from 'pino'; -import { proto } from '../../WAProto'; -import type makeLegacySocket from '../LegacySocket'; -import type makeMDSocket from '../Socket'; -import type { BaileysEventEmitter, Chat, ConnectionState, Contact, GroupMetadata, PresenceData, WAMessage, WAMessageCursor, WAMessageKey } from '../Types'; -declare type LegacyWASocket = ReturnType; -declare type AnyWASocket = ReturnType; -export declare const waChatKey: (pin: boolean) => { - key: (c: Chat) => string; - compare: (k1: string, k2: string) => number; -}; -export declare const waMessageID: (m: WAMessage) => string; -export declare type BaileysInMemoryStoreConfig = { - chatKey?: Comparable; - logger?: Logger; -}; -declare const _default: ({ logger, chatKey }: BaileysInMemoryStoreConfig) => { - chats: KeyedDB; - contacts: { - [_: string]: Contact; - }; - messages: { - [_: string]: { - array: proto.IWebMessageInfo[]; - get: (id: string) => proto.IWebMessageInfo; - upsert: (item: proto.IWebMessageInfo, mode: "append" | "prepend") => void; - update: (item: proto.IWebMessageInfo) => boolean; - remove: (item: proto.IWebMessageInfo) => boolean; - updateAssign: (id: string, update: Partial) => boolean; - clear: () => void; - filter: (contain: (item: proto.IWebMessageInfo) => boolean) => void; - toJSON: () => proto.IWebMessageInfo[]; - fromJSON: (newItems: proto.IWebMessageInfo[]) => void; - }; - }; - groupMetadata: { - [_: string]: GroupMetadata; - }; - state: ConnectionState; - presences: { - [id: string]: { - [participant: string]: PresenceData; - }; - }; - bind: (ev: BaileysEventEmitter) => void; - /** loads messages from the store, if not found -- uses the legacy connection */ - loadMessages: (jid: string, count: number, cursor: WAMessageCursor, sock: LegacyWASocket | undefined) => Promise; - loadMessage: (jid: string, id: string, sock: LegacyWASocket | undefined) => Promise; - mostRecentMessage: (jid: string, sock: LegacyWASocket | undefined) => Promise; - fetchImageUrl: (jid: string, sock: AnyWASocket | undefined) => Promise; - fetchGroupMetadata: (jid: string, sock: AnyWASocket | undefined) => Promise; - fetchBroadcastListInfo: (jid: string, sock: LegacyWASocket | undefined) => Promise; - fetchMessageReceipts: ({ remoteJid, id }: WAMessageKey, sock: LegacyWASocket | undefined) => Promise; - toJSON: () => { - chats: KeyedDB; - contacts: { - [_: string]: Contact; - }; - messages: { - [_: string]: { - array: proto.IWebMessageInfo[]; - get: (id: string) => proto.IWebMessageInfo; - upsert: (item: proto.IWebMessageInfo, mode: "append" | "prepend") => void; - update: (item: proto.IWebMessageInfo) => boolean; - remove: (item: proto.IWebMessageInfo) => boolean; - updateAssign: (id: string, update: Partial) => boolean; - clear: () => void; - filter: (contain: (item: proto.IWebMessageInfo) => boolean) => void; - toJSON: () => proto.IWebMessageInfo[]; - fromJSON: (newItems: proto.IWebMessageInfo[]) => void; - }; - }; - }; - fromJSON: (json: { - chats: Chat[]; - contacts: { - [id: string]: Contact; - }; - messages: { - [id: string]: proto.IWebMessageInfo[]; - }; - }) => void; - writeToFile: (path: string) => void; - readFromFile: (path: string) => void; -}; -export default _default; diff --git a/node_modules/@adiwajshing/baileys/lib/Store/make-in-memory-store.js b/node_modules/@adiwajshing/baileys/lib/Store/make-in-memory-store.js index e56dbb44c..bd14e46ed 100644 --- a/node_modules/@adiwajshing/baileys/lib/Store/make-in-memory-store.js +++ b/node_modules/@adiwajshing/baileys/lib/Store/make-in-memory-store.js @@ -208,7 +208,7 @@ exports.default = ({ logger, chatKey }) => { }); const fromJSON = (json) => { chats.upsert(...json.chats); - contactsUpsert(Object.values(contacts)); + contactsUpsert(Object.values(json.contacts)); for (const jid in json.messages) { const list = assertMessageList(jid); for (const msg of json.messages[jid]) { diff --git a/node_modules/@adiwajshing/baileys/lib/Store/.trashed-1649374382-make-ordered-dictionary.d.ts b/node_modules/@adiwajshing/baileys/lib/Store/make-ordered-dictionary.d.ts similarity index 100% rename from node_modules/@adiwajshing/baileys/lib/Store/.trashed-1649374382-make-ordered-dictionary.d.ts rename to node_modules/@adiwajshing/baileys/lib/Store/make-ordered-dictionary.d.ts diff --git a/node_modules/@adiwajshing/baileys/lib/Store/make-ordered-dictionary.d_1.ts b/node_modules/@adiwajshing/baileys/lib/Store/make-ordered-dictionary.d_1.ts deleted file mode 100644 index cff6e2753..000000000 --- a/node_modules/@adiwajshing/baileys/lib/Store/make-ordered-dictionary.d_1.ts +++ /dev/null @@ -1,13 +0,0 @@ -declare function makeOrderedDictionary(idGetter: (item: T) => string): { - array: T[]; - get: (id: string) => T; - upsert: (item: T, mode: 'append' | 'prepend') => void; - update: (item: T) => boolean; - remove: (item: T) => boolean; - updateAssign: (id: string, update: Partial) => boolean; - clear: () => void; - filter: (contain: (item: T) => boolean) => void; - toJSON: () => T[]; - fromJSON: (newItems: T[]) => void; -}; -export default makeOrderedDictionary; diff --git a/node_modules/@adiwajshing/baileys/lib/Types/.trashed-1649374382-Events.d.ts b/node_modules/@adiwajshing/baileys/lib/Types/.trashed-1649374382-Events.d.ts deleted file mode 100644 index e1f70cd4d..000000000 --- a/node_modules/@adiwajshing/baileys/lib/Types/.trashed-1649374382-Events.d.ts +++ /dev/null @@ -1,81 +0,0 @@ -/// -import type EventEmitter from 'events'; -import { AuthenticationCreds } from './Auth'; -import { Chat, PresenceData } from './Chat'; -import { Contact } from './Contact'; -import { GroupMetadata, ParticipantAction } from './GroupMetadata'; -import { MessageUpdateType, MessageUserReceiptUpdate, WAMessage, WAMessageKey, WAMessageUpdate } from './Message'; -import { ConnectionState } from './State'; -export declare type BaileysEventMap = { - /** connection state has been updated -- WS closed, opened, connecting etc. */ - 'connection.update': Partial; - /** credentials updated -- some metadata, keys or something */ - 'creds.update': Partial; - /** set chats (history sync), chats are reverse chronologically sorted */ - 'chats.set': { - chats: Chat[]; - isLatest: boolean; - }; - /** set messages (history sync), messages are reverse chronologically sorted */ - 'messages.set': { - messages: WAMessage[]; - isLatest: boolean; - }; - /** set contacts (history sync) */ - 'contacts.set': { - contacts: Contact[]; - }; - /** upsert chats */ - 'chats.upsert': Chat[]; - /** update the given chats */ - 'chats.update': Partial[]; - /** delete chats with given ID */ - 'chats.delete': string[]; - /** presence of contact in a chat updated */ - 'presence.update': { - id: string; - presences: { - [participant: string]: PresenceData; - }; - }; - 'contacts.upsert': Contact[]; - 'contacts.update': Partial[]; - 'messages.delete': { - keys: WAMessageKey[]; - } | { - jid: string; - all: true; - }; - 'messages.update': WAMessageUpdate[]; - /** - * add/update the given messages. If they were received while the connection was online, - * the update will have type: "notify" - * */ - 'messages.upsert': { - messages: WAMessage[]; - type: MessageUpdateType; - }; - 'message-receipt.update': MessageUserReceiptUpdate[]; - 'groups.upsert': GroupMetadata[]; - 'groups.update': Partial[]; - /** apply an action to participants in a group */ - 'group-participants.update': { - id: string; - participants: string[]; - action: ParticipantAction; - }; - 'blocklist.set': { - blocklist: string[]; - }; - 'blocklist.update': { - blocklist: string[]; - type: 'add' | 'remove'; - }; -}; -export interface CommonBaileysEventEmitter extends EventEmitter { - on>(event: T, listener: (arg: BaileysEventMap[T]) => void): this; - off>(event: T, listener: (arg: BaileysEventMap[T]) => void): this; - removeAllListeners>(event: T): this; - emit>(event: T, arg: BaileysEventMap[T]): boolean; -} -export declare type BaileysEventEmitter = CommonBaileysEventEmitter; diff --git a/node_modules/@adiwajshing/baileys/lib/Types/.trashed-1649374382-Message.d.ts b/node_modules/@adiwajshing/baileys/lib/Types/.trashed-1649374382-Message.d.ts deleted file mode 100644 index adca91aef..000000000 --- a/node_modules/@adiwajshing/baileys/lib/Types/.trashed-1649374382-Message.d.ts +++ /dev/null @@ -1,175 +0,0 @@ -/// -import type NodeCache from 'node-cache'; -import type { Logger } from 'pino'; -import type { Readable } from 'stream'; -import type { URL } from 'url'; -import { proto } from '../../WAProto'; -import type { GroupMetadata } from './GroupMetadata'; -export { proto as WAProto }; -export declare type WAMessage = proto.IWebMessageInfo; -export declare type WAMessageContent = proto.IMessage; -export declare type WAContactMessage = proto.IContactMessage; -export declare type WAContactsArrayMessage = proto.IContactsArrayMessage; -export declare type WAMessageKey = proto.IMessageKey; -export declare type WATextMessage = proto.IExtendedTextMessage; -export declare type WAContextInfo = proto.IContextInfo; -export declare type WALocationMessage = proto.ILocationMessage; -export declare type WAGenericMediaMessage = proto.IVideoMessage | proto.IImageMessage | proto.IAudioMessage | proto.IDocumentMessage | proto.IStickerMessage; -export import WAMessageStubType = proto.WebMessageInfo.WebMessageInfoStubType; -export import WAMessageStatus = proto.WebMessageInfo.WebMessageInfoStatus; -export declare type WAMediaUpload = Buffer | { - url: URL | string; -} | { - stream: Readable; -}; -/** Set of message types that are supported by the library */ -export declare type MessageType = keyof proto.Message; -export declare type DownloadableMessage = { - mediaKey?: Uint8Array; - directPath?: string; - url?: string; -}; -export declare type MediaConnInfo = { - auth: string; - ttl: number; - hosts: { - hostname: string; - maxContentLengthBytes: number; - }[]; - fetchDate: Date; -}; -export interface WAUrlInfo { - 'canonical-url': string; - 'matched-text': string; - title: string; - description: string; - jpegThumbnail?: Buffer; -} -declare type Mentionable = { - /** list of jids that are mentioned in the accompanying text */ - mentions?: string[]; -}; -declare type ViewOnce = { - viewOnce?: boolean; -}; -declare type Buttonable = { - /** add buttons to the message */ - buttons?: proto.IButton[]; -}; -declare type Templatable = { - /** add buttons to the message (conflicts with normal buttons)*/ - templateButtons?: proto.IHydratedTemplateButton[]; - footer?: string; -}; -declare type Listable = { - /** Sections of the List */ - sections?: proto.ISection[]; - /** Title of a List Message only */ - title?: string; - /** Text of the bnutton on the list (required) */ - buttonText?: string; -}; -declare type WithDimensions = { - width?: number; - height?: number; -}; -export declare type MediaType = 'image' | 'video' | 'sticker' | 'audio' | 'document' | 'history' | 'md-app-state'; -export declare type AnyMediaMessageContent = (({ - image: WAMediaUpload; - caption?: string; - jpegThumbnail?: string; -} & Mentionable & Buttonable & Templatable & WithDimensions) | ({ - video: WAMediaUpload; - caption?: string; - gifPlayback?: boolean; - jpegThumbnail?: string; -} & Mentionable & Buttonable & Templatable & WithDimensions) | { - audio: WAMediaUpload; - /** if set to true, will send as a `voice note` */ - ptt?: boolean; - /** optionally tell the duration of the audio */ - seconds?: number; -} | ({ - sticker: WAMediaUpload; -} & WithDimensions) | ({ - document: WAMediaUpload; - mimetype: string; - fileName?: string; -} & Buttonable & Templatable)) & { - mimetype?: string; -}; -export declare type AnyRegularMessageContent = (({ - text: string; -} & Mentionable & Buttonable & Templatable & Listable) | AnyMediaMessageContent | { - contacts: { - displayName?: string; - contacts: proto.IContactMessage[]; - }; -} | { - location: WALocationMessage; -}) & ViewOnce; -export declare type AnyMessageContent = AnyRegularMessageContent | { - forward: WAMessage; - force?: boolean; -} | { - delete: WAMessageKey; -} | { - disappearingMessagesInChat: boolean | number; -}; -export declare type MessageRelayOptions = { - messageId?: string; - /** only send to a specific participant */ - participant?: string; - additionalAttributes?: { - [_: string]: string; - }; - cachedGroupMetadata?: (jid: string) => Promise; -}; -export declare type MiscMessageGenerationOptions = { - /** Force message id */ - messageId?: string; - /** optional, if you want to manually set the timestamp of the message */ - timestamp?: Date; - /** the message you want to quote */ - quoted?: WAMessage; - /** disappearing messages settings */ - ephemeralExpiration?: number | string; - mediaUploadTimeoutMs?: number; -}; -export declare type MessageGenerationOptionsFromContent = MiscMessageGenerationOptions & { - userJid: string; -}; -export declare type WAMediaUploadFunction = (readStream: Readable, opts: { - fileEncSha256B64: string; - mediaType: MediaType; - timeoutMs?: number; -}) => Promise<{ - mediaUrl: string; - directPath: string; -}>; -export declare type MediaGenerationOptions = { - logger?: Logger; - upload: WAMediaUploadFunction; - /** cache media so it does not have to be uploaded again */ - mediaCache?: NodeCache; - mediaUploadTimeoutMs?: number; -}; -export declare type MessageContentGenerationOptions = MediaGenerationOptions & { - getUrlInfo?: (text: string) => Promise; -}; -export declare type MessageGenerationOptions = MessageContentGenerationOptions & MessageGenerationOptionsFromContent; -export declare type MessageUpdateType = 'append' | 'notify' | 'replace'; -export declare type MessageUserReceipt = proto.IUserReceipt; -export declare type WAMessageUpdate = { - update: Partial; - key: proto.IMessageKey; -}; -export declare type WAMessageCursor = { - before: WAMessageKey | undefined; -} | { - after: WAMessageKey | undefined; -}; -export declare type MessageUserReceiptUpdate = { - key: proto.IMessageKey; - receipt: MessageUserReceipt; -}; diff --git a/node_modules/@adiwajshing/baileys/lib/Types/.trashed-1649374382-Socket.d.ts b/node_modules/@adiwajshing/baileys/lib/Types/.trashed-1649374382-Socket.d.ts deleted file mode 100644 index f20691a81..000000000 --- a/node_modules/@adiwajshing/baileys/lib/Types/.trashed-1649374382-Socket.d.ts +++ /dev/null @@ -1,37 +0,0 @@ -/// -import type { Agent } from 'https'; -import type NodeCache from 'node-cache'; -import type { Logger } from 'pino'; -import type { URL } from 'url'; -import { MediaConnInfo } from './Message'; -export declare type WAVersion = [number, number, number]; -export declare type WABrowserDescription = [string, string, string]; -export declare type CommonSocketConfig = { - /** provide an auth state object to maintain the auth state */ - auth?: T; - /** the WS url to connect to WA */ - waWebSocketUrl: string | URL; - /** Fails the connection if the socket times out in this interval */ - connectTimeoutMs: number; - /** Default timeout for queries, undefined for no timeout */ - defaultQueryTimeoutMs: number | undefined; - /** ping-pong interval for WS connection */ - keepAliveIntervalMs: number; - /** proxy agent */ - agent?: Agent; - /** pino logger */ - logger: Logger; - /** version to connect with */ - version: WAVersion; - /** override browser config */ - browser: WABrowserDescription; - /** agent used for fetch requests -- uploading/downloading media */ - fetchAgent?: Agent; - /** should the QR be printed in the terminal */ - printQRInTerminal: boolean; - /** should events be emitted for actions done by this socket connection */ - emitOwnEvents: boolean; - /** provide a cache to store media, so does not have to be re-uploaded */ - mediaCache?: NodeCache; - customUploadHosts: MediaConnInfo['hosts']; -}; diff --git a/node_modules/@adiwajshing/baileys/lib/Types/.trashed-1649374382-index.d.ts b/node_modules/@adiwajshing/baileys/lib/Types/.trashed-1649374382-index.d.ts deleted file mode 100644 index 03b77a300..000000000 --- a/node_modules/@adiwajshing/baileys/lib/Types/.trashed-1649374382-index.d.ts +++ /dev/null @@ -1,66 +0,0 @@ -export * from './Auth'; -export * from './GroupMetadata'; -export * from './Chat'; -export * from './Contact'; -export * from './State'; -export * from './Message'; -export * from './Legacy'; -export * from './Socket'; -export * from './Events'; -import type NodeCache from 'node-cache'; -import { proto } from '../../WAProto'; -import { AuthenticationState } from './Auth'; -import { CommonSocketConfig } from './Socket'; -export declare type SocketConfig = CommonSocketConfig & { - /** provide a cache to store a user's device list */ - userDevicesCache?: NodeCache; - /** map to store the retry counts for failed messages */ - msgRetryCounterMap?: { - [msgId: string]: number; - }; - /** - * fetch a message from your store - * implement this so that messages failed to send (solves the "this message can take a while" issue) can be retried - * */ - getMessage: (key: proto.IMessageKey) => Promise; -}; -export declare enum DisconnectReason { - connectionClosed = 428, - connectionLost = 408, - connectionReplaced = 440, - timedOut = 408, - loggedOut = 401, - badSession = 500, - restartRequired = 410, - multideviceMismatch = 411 -} -export declare type WAInitResponse = { - ref: string; - ttl: number; - status: 200; -}; -export declare type WABusinessHoursConfig = { - day_of_week: string; - mode: string; - open_time?: number; - close_time?: number; -}; -export declare type WABusinessProfile = { - description: string; - email: string; - business_hours: { - timezone?: string; - config?: WABusinessHoursConfig[]; - business_config?: WABusinessHoursConfig[]; - }; - website: string[]; - categories: { - id: string; - localized_display_name: string; - }[]; - wid?: string; -}; -export declare type CurveKeyPair = { - private: Uint8Array; - public: Uint8Array; -}; diff --git a/node_modules/@adiwajshing/baileys/lib/Types/.trashed-1649374382-Auth.d.ts b/node_modules/@adiwajshing/baileys/lib/Types/Auth.d.ts similarity index 100% rename from node_modules/@adiwajshing/baileys/lib/Types/.trashed-1649374382-Auth.d.ts rename to node_modules/@adiwajshing/baileys/lib/Types/Auth.d.ts diff --git a/node_modules/@adiwajshing/baileys/lib/Types/Auth.d_1.ts b/node_modules/@adiwajshing/baileys/lib/Types/Auth.d_1.ts deleted file mode 100644 index e0d58b6b5..000000000 --- a/node_modules/@adiwajshing/baileys/lib/Types/Auth.d_1.ts +++ /dev/null @@ -1,82 +0,0 @@ -/// -import type { proto } from '../../WAProto'; -import type { Contact } from './Contact'; -export declare type KeyPair = { - public: Uint8Array; - private: Uint8Array; -}; -export declare type SignedKeyPair = { - keyPair: KeyPair; - signature: Uint8Array; - keyId: number; -}; -export declare type ProtocolAddress = { - name: string; - deviceId: number; -}; -export declare type SignalIdentity = { - identifier: ProtocolAddress; - identifierKey: Uint8Array; -}; -export declare type LTHashState = { - version: number; - hash: Buffer; - indexValueMap: { - [indexMacBase64: string]: { - valueMac: Uint8Array | Buffer; - }; - }; -}; -export declare type SignalCreds = { - readonly signedIdentityKey: KeyPair; - readonly signedPreKey: SignedKeyPair; - readonly registrationId: number; -}; -export declare type AuthenticationCreds = SignalCreds & { - readonly noiseKey: KeyPair; - readonly advSecretKey: string; - me?: Contact; - account?: proto.IADVSignedDeviceIdentity; - signalIdentities?: SignalIdentity[]; - myAppStateKeyId?: string; - firstUnuploadedPreKeyId: number; - serverHasPreKeys: boolean; - nextPreKeyId: number; - lastAccountSyncTimestamp?: number; -}; -export declare type SignalDataTypeMap = { - 'pre-key': KeyPair; - 'session': any; - 'sender-key': any; - 'sender-key-memory': { - [jid: string]: boolean; - }; - 'app-state-sync-key': proto.IAppStateSyncKeyData; - 'app-state-sync-version': LTHashState; -}; -export declare type SignalDataSet = { - [T in keyof SignalDataTypeMap]?: { - [id: string]: SignalDataTypeMap[T] | null; - }; -}; -declare type Awaitable = T | Promise; -export declare type SignalKeyStore = { - get(type: T, ids: string[]): Awaitable<{ - [id: string]: SignalDataTypeMap[T]; - }>; - set(data: SignalDataSet): Awaitable; -}; -export declare type SignalKeyStoreWithTransaction = SignalKeyStore & { - isInTransaction: () => boolean; - transaction(exec: () => Promise): Promise; - prefetch(type: T, ids: string[]): Promise; -}; -export declare type SignalAuthState = { - creds: SignalCreds; - keys: SignalKeyStore; -}; -export declare type AuthenticationState = { - creds: AuthenticationCreds; - keys: SignalKeyStore; -}; -export {}; diff --git a/node_modules/@adiwajshing/baileys/lib/Types/.trashed-1649374382-Chat.d.ts b/node_modules/@adiwajshing/baileys/lib/Types/Chat.d.ts similarity index 100% rename from node_modules/@adiwajshing/baileys/lib/Types/.trashed-1649374382-Chat.d.ts rename to node_modules/@adiwajshing/baileys/lib/Types/Chat.d.ts diff --git a/node_modules/@adiwajshing/baileys/lib/Types/Chat.d_1.ts b/node_modules/@adiwajshing/baileys/lib/Types/Chat.d_1.ts deleted file mode 100644 index 1e19b9a77..000000000 --- a/node_modules/@adiwajshing/baileys/lib/Types/Chat.d_1.ts +++ /dev/null @@ -1,65 +0,0 @@ -import type { proto } from '../../WAProto'; -/** set of statuses visible to other people; see updatePresence() in WhatsAppWeb.Send */ -export declare type WAPresence = 'unavailable' | 'available' | 'composing' | 'recording' | 'paused'; -export declare type WAPatchName = 'critical_block' | 'critical_unblock_low' | 'regular_low' | 'regular_high' | 'regular'; -export interface PresenceData { - lastKnownPresence: WAPresence; - lastSeen?: number; -} -export declare type ChatMutation = { - syncAction: proto.ISyncActionData; - index: string[]; -}; -export declare type AppStateChunk = { - totalMutations: ChatMutation[]; - collectionsToHandle: WAPatchName[]; -}; -export declare type WAPatchCreate = { - syncAction: proto.ISyncActionValue; - index: string[]; - type: WAPatchName; - apiVersion: number; - operation: proto.SyncdMutation.SyncdMutationSyncdOperation; -}; -export declare type Chat = Omit & { - /** unix timestamp of date when mute ends, if applicable */ - mute?: number | null; - /** timestamp of when pinned */ - pin?: number | null; - archive?: boolean; -}; -/** - * the last messages in a chat, sorted reverse-chronologically - * for MD modifications, the last message in the array must be the last message recv in the chat - * */ -export declare type LastMessageList = Pick[]; -export declare type ChatModification = { - archive: boolean; - lastMessages: LastMessageList; -} | { - pin: boolean; -} | { - /** mute for duration, or provide timestamp of mute to remove*/ - mute: number | null; -} | { - clear: 'all' | { - messages: { - id: string; - fromMe?: boolean; - }[]; - }; -} | { - star: { - messages: { - id: string; - fromMe?: boolean; - }[]; - star: boolean; - }; -} | { - markRead: boolean; - lastMessages: LastMessageList; -} | { - delete: true; - lastMessages: LastMessageList; -}; diff --git a/node_modules/@adiwajshing/baileys/lib/Types/.trashed-1649374382-Contact.d.ts b/node_modules/@adiwajshing/baileys/lib/Types/Contact.d.ts similarity index 100% rename from node_modules/@adiwajshing/baileys/lib/Types/.trashed-1649374382-Contact.d.ts rename to node_modules/@adiwajshing/baileys/lib/Types/Contact.d.ts diff --git a/node_modules/@adiwajshing/baileys/lib/Types/Contact.d_1.ts b/node_modules/@adiwajshing/baileys/lib/Types/Contact.d_1.ts deleted file mode 100644 index 3b6ae2eba..000000000 --- a/node_modules/@adiwajshing/baileys/lib/Types/Contact.d_1.ts +++ /dev/null @@ -1,11 +0,0 @@ -export interface Contact { - id: string; - /** name of the contact, you have saved on your WA */ - name?: string; - /** name of the contact, the contact has set on their own on WA */ - notify?: string; - /** I have no idea */ - verifiedName?: string; - imgUrl?: string; - status?: string; -} diff --git a/node_modules/@adiwajshing/baileys/lib/Types/Events.d.ts b/node_modules/@adiwajshing/baileys/lib/Types/Events.d.ts new file mode 100644 index 000000000..324be16f0 --- /dev/null +++ b/node_modules/@adiwajshing/baileys/lib/Types/Events.d.ts @@ -0,0 +1,87 @@ +/// +import type EventEmitter from 'events'; +import { proto } from '../../WAProto'; +import { AuthenticationCreds } from './Auth'; +import { Chat, PresenceData } from './Chat'; +import { Contact } from './Contact'; +import { GroupMetadata, ParticipantAction } from './GroupMetadata'; +import { MessageUpdateType, MessageUserReceiptUpdate, WAMessage, WAMessageKey, WAMessageUpdate } from './Message'; +import { ConnectionState } from './State'; +export declare type BaileysEventMap = { + /** connection state has been updated -- WS closed, opened, connecting etc. */ + 'connection.update': Partial; + /** credentials updated -- some metadata, keys or something */ + 'creds.update': Partial; + /** set chats (history sync), chats are reverse chronologically sorted */ + 'chats.set': { + chats: Chat[]; + isLatest: boolean; + }; + /** set messages (history sync), messages are reverse chronologically sorted */ + 'messages.set': { + messages: WAMessage[]; + isLatest: boolean; + }; + /** set contacts (history sync) */ + 'contacts.set': { + contacts: Contact[]; + }; + /** upsert chats */ + 'chats.upsert': Chat[]; + /** update the given chats */ + 'chats.update': Partial[]; + /** delete chats with given ID */ + 'chats.delete': string[]; + /** presence of contact in a chat updated */ + 'presence.update': { + id: string; + presences: { + [participant: string]: PresenceData; + }; + }; + 'contacts.upsert': Contact[]; + 'contacts.update': Partial[]; + 'messages.delete': { + keys: WAMessageKey[]; + } | { + jid: string; + all: true; + }; + 'messages.update': WAMessageUpdate[]; + /** + * add/update the given messages. If they were received while the connection was online, + * the update will have type: "notify" + * */ + 'messages.upsert': { + messages: WAMessage[]; + type: MessageUpdateType; + }; + 'messages.reaction': { + key: WAMessageKey; + reaction: proto.IReaction; + operation: 'add' | 'remove'; + }; + 'message-receipt.update': MessageUserReceiptUpdate[]; + 'groups.upsert': GroupMetadata[]; + 'groups.update': Partial[]; + /** apply an action to participants in a group */ + 'group-participants.update': { + id: string; + participants: string[]; + action: ParticipantAction; + }; + 'blocklist.set': { + blocklist: string[]; + }; + 'blocklist.update': { + blocklist: string[]; + type: 'add' | 'remove'; + }; +}; +export interface CommonBaileysEventEmitter extends EventEmitter { + on>(event: T, listener: (arg: BaileysEventMap[T]) => void): this; + off>(event: T, listener: (arg: BaileysEventMap[T]) => void): this; + removeAllListeners>(event: T): this; + emit>(event: T, arg: BaileysEventMap[T]): boolean; +} +export declare type BaileysEventEmitter = CommonBaileysEventEmitter; diff --git a/node_modules/@adiwajshing/baileys/lib/Types/Events.d_1.ts b/node_modules/@adiwajshing/baileys/lib/Types/Events.d_1.ts deleted file mode 100644 index e1f70cd4d..000000000 --- a/node_modules/@adiwajshing/baileys/lib/Types/Events.d_1.ts +++ /dev/null @@ -1,81 +0,0 @@ -/// -import type EventEmitter from 'events'; -import { AuthenticationCreds } from './Auth'; -import { Chat, PresenceData } from './Chat'; -import { Contact } from './Contact'; -import { GroupMetadata, ParticipantAction } from './GroupMetadata'; -import { MessageUpdateType, MessageUserReceiptUpdate, WAMessage, WAMessageKey, WAMessageUpdate } from './Message'; -import { ConnectionState } from './State'; -export declare type BaileysEventMap = { - /** connection state has been updated -- WS closed, opened, connecting etc. */ - 'connection.update': Partial; - /** credentials updated -- some metadata, keys or something */ - 'creds.update': Partial; - /** set chats (history sync), chats are reverse chronologically sorted */ - 'chats.set': { - chats: Chat[]; - isLatest: boolean; - }; - /** set messages (history sync), messages are reverse chronologically sorted */ - 'messages.set': { - messages: WAMessage[]; - isLatest: boolean; - }; - /** set contacts (history sync) */ - 'contacts.set': { - contacts: Contact[]; - }; - /** upsert chats */ - 'chats.upsert': Chat[]; - /** update the given chats */ - 'chats.update': Partial[]; - /** delete chats with given ID */ - 'chats.delete': string[]; - /** presence of contact in a chat updated */ - 'presence.update': { - id: string; - presences: { - [participant: string]: PresenceData; - }; - }; - 'contacts.upsert': Contact[]; - 'contacts.update': Partial[]; - 'messages.delete': { - keys: WAMessageKey[]; - } | { - jid: string; - all: true; - }; - 'messages.update': WAMessageUpdate[]; - /** - * add/update the given messages. If they were received while the connection was online, - * the update will have type: "notify" - * */ - 'messages.upsert': { - messages: WAMessage[]; - type: MessageUpdateType; - }; - 'message-receipt.update': MessageUserReceiptUpdate[]; - 'groups.upsert': GroupMetadata[]; - 'groups.update': Partial[]; - /** apply an action to participants in a group */ - 'group-participants.update': { - id: string; - participants: string[]; - action: ParticipantAction; - }; - 'blocklist.set': { - blocklist: string[]; - }; - 'blocklist.update': { - blocklist: string[]; - type: 'add' | 'remove'; - }; -}; -export interface CommonBaileysEventEmitter extends EventEmitter { - on>(event: T, listener: (arg: BaileysEventMap[T]) => void): this; - off>(event: T, listener: (arg: BaileysEventMap[T]) => void): this; - removeAllListeners>(event: T): this; - emit>(event: T, arg: BaileysEventMap[T]): boolean; -} -export declare type BaileysEventEmitter = CommonBaileysEventEmitter; diff --git a/node_modules/@adiwajshing/baileys/lib/Types/.trashed-1649374382-GroupMetadata.d.ts b/node_modules/@adiwajshing/baileys/lib/Types/GroupMetadata.d.ts similarity index 100% rename from node_modules/@adiwajshing/baileys/lib/Types/.trashed-1649374382-GroupMetadata.d.ts rename to node_modules/@adiwajshing/baileys/lib/Types/GroupMetadata.d.ts diff --git a/node_modules/@adiwajshing/baileys/lib/Types/GroupMetadata.d_1.ts b/node_modules/@adiwajshing/baileys/lib/Types/GroupMetadata.d_1.ts deleted file mode 100644 index 306bb6730..000000000 --- a/node_modules/@adiwajshing/baileys/lib/Types/GroupMetadata.d_1.ts +++ /dev/null @@ -1,35 +0,0 @@ -import { Contact } from './Contact'; -export declare type GroupParticipant = (Contact & { - isAdmin?: boolean; - isSuperAdmin?: boolean; - admin?: 'admin' | 'superadmin' | null; -}); -export declare type ParticipantAction = 'add' | 'remove' | 'promote' | 'demote'; -export interface GroupMetadata { - id: string; - owner: string | undefined; - subject: string; - creation: number; - desc?: string; - descOwner?: string; - descId?: string; - /** is set when the group only allows admins to change group settings */ - restrict?: boolean; - /** is set when the group only allows admins to write messages */ - announce?: boolean; - participants: GroupParticipant[]; - ephemeralDuration?: number; -} -export interface WAGroupCreateResponse { - status: number; - gid?: string; - participants?: [{ - [key: string]: any; - }]; -} -export interface GroupModificationResponse { - status: number; - participants?: { - [key: string]: any; - }; -} diff --git a/node_modules/@adiwajshing/baileys/lib/Types/.trashed-1649374382-Legacy.d.ts b/node_modules/@adiwajshing/baileys/lib/Types/Legacy.d.ts similarity index 100% rename from node_modules/@adiwajshing/baileys/lib/Types/.trashed-1649374382-Legacy.d.ts rename to node_modules/@adiwajshing/baileys/lib/Types/Legacy.d.ts diff --git a/node_modules/@adiwajshing/baileys/lib/Types/Legacy.d_1.ts b/node_modules/@adiwajshing/baileys/lib/Types/Legacy.d_1.ts deleted file mode 100644 index 047c6399e..000000000 --- a/node_modules/@adiwajshing/baileys/lib/Types/Legacy.d_1.ts +++ /dev/null @@ -1,74 +0,0 @@ -/// -import { BinaryNode } from '../WABinary'; -import { CommonBaileysEventEmitter } from './Events'; -import { CommonSocketConfig } from './Socket'; -export interface LegacyAuthenticationCreds { - clientID: string; - serverToken: string; - clientToken: string; - encKey: Buffer; - macKey: Buffer; -} -/** used for binary messages */ -export declare enum WAMetric { - debugLog = 1, - queryResume = 2, - liveLocation = 3, - queryMedia = 4, - queryChat = 5, - queryContact = 6, - queryMessages = 7, - presence = 8, - presenceSubscribe = 9, - group = 10, - read = 11, - chat = 12, - received = 13, - picture = 14, - status = 15, - message = 16, - queryActions = 17, - block = 18, - queryGroup = 19, - queryPreview = 20, - queryEmoji = 21, - queryRead = 22, - queryVCard = 29, - queryStatus = 30, - queryStatusUpdate = 31, - queryLiveLocation = 33, - queryLabel = 36, - queryQuickReply = 39 -} -/** used for binary messages */ -export declare enum WAFlag { - available = 160, - other = 136, - ignore = 128, - acknowledge = 64, - unavailable = 16, - expires = 8, - composing = 4, - recording = 4, - paused = 4 -} -/** Tag used with binary queries */ -export declare type WATag = [WAMetric, WAFlag]; -export declare type SocketSendMessageOptions = { - json: BinaryNode | any[]; - binaryTag?: WATag; - tag?: string; - longTag?: boolean; -}; -export declare type SocketQueryOptions = SocketSendMessageOptions & { - timeoutMs?: number; - expect200?: boolean; - requiresPhoneConnection?: boolean; -}; -export declare type LegacySocketConfig = CommonSocketConfig & { - /** max time for the phone to respond to a connectivity test */ - phoneResponseTimeMs: number; - /** max time for WA server to respond before error with 422 */ - expectResponseTimeout: number; -}; -export declare type LegacyBaileysEventEmitter = CommonBaileysEventEmitter; diff --git a/node_modules/@adiwajshing/baileys/lib/Types/Message.d.ts b/node_modules/@adiwajshing/baileys/lib/Types/Message.d.ts new file mode 100644 index 000000000..29d756432 --- /dev/null +++ b/node_modules/@adiwajshing/baileys/lib/Types/Message.d.ts @@ -0,0 +1,178 @@ +/// +import type NodeCache from 'node-cache'; +import type { Logger } from 'pino'; +import type { Readable } from 'stream'; +import type { URL } from 'url'; +import { proto } from '../../WAProto'; +import type { GroupMetadata } from './GroupMetadata'; +export { proto as WAProto }; +export declare type WAMessage = proto.IWebMessageInfo; +export declare type WAMessageContent = proto.IMessage; +export declare type WAContactMessage = proto.IContactMessage; +export declare type WAContactsArrayMessage = proto.IContactsArrayMessage; +export declare type WAMessageKey = proto.IMessageKey; +export declare type WATextMessage = proto.IExtendedTextMessage; +export declare type WAContextInfo = proto.IContextInfo; +export declare type WALocationMessage = proto.ILocationMessage; +export declare type WAGenericMediaMessage = proto.IVideoMessage | proto.IImageMessage | proto.IAudioMessage | proto.IDocumentMessage | proto.IStickerMessage; +export import WAMessageStubType = proto.WebMessageInfo.WebMessageInfoStubType; +export import WAMessageStatus = proto.WebMessageInfo.WebMessageInfoStatus; +export declare type WAMediaUpload = Buffer | { + url: URL | string; +} | { + stream: Readable; +}; +/** Set of message types that are supported by the library */ +export declare type MessageType = keyof proto.Message; +export declare type DownloadableMessage = { + mediaKey?: Uint8Array; + directPath?: string; + url?: string; +}; +export declare type MessageReceiptType = 'read' | 'read-self' | 'hist_sync' | 'peer_msg' | 'sender' | undefined; +export declare type MediaConnInfo = { + auth: string; + ttl: number; + hosts: { + hostname: string; + maxContentLengthBytes: number; + }[]; + fetchDate: Date; +}; +export interface WAUrlInfo { + 'canonical-url': string; + 'matched-text': string; + title: string; + description: string; + jpegThumbnail?: Buffer; +} +declare type Mentionable = { + /** list of jids that are mentioned in the accompanying text */ + mentions?: string[]; +}; +declare type ViewOnce = { + viewOnce?: boolean; +}; +declare type Buttonable = { + /** add buttons to the message */ + buttons?: proto.IButton[]; +}; +declare type Templatable = { + /** add buttons to the message (conflicts with normal buttons)*/ + templateButtons?: proto.IHydratedTemplateButton[]; + footer?: string; +}; +declare type Listable = { + /** Sections of the List */ + sections?: proto.ISection[]; + /** Title of a List Message only */ + title?: string; + /** Text of the bnutton on the list (required) */ + buttonText?: string; +}; +declare type WithDimensions = { + width?: number; + height?: number; +}; +export declare type MediaType = 'image' | 'video' | 'sticker' | 'audio' | 'document' | 'history' | 'md-app-state'; +export declare type AnyMediaMessageContent = (({ + image: WAMediaUpload; + caption?: string; + jpegThumbnail?: string; +} & Mentionable & Buttonable & Templatable & WithDimensions) | ({ + video: WAMediaUpload; + caption?: string; + gifPlayback?: boolean; + jpegThumbnail?: string; +} & Mentionable & Buttonable & Templatable & WithDimensions) | { + audio: WAMediaUpload; + /** if set to true, will send as a `voice note` */ + ptt?: boolean; + /** optionally tell the duration of the audio */ + seconds?: number; +} | ({ + sticker: WAMediaUpload; +} & WithDimensions) | ({ + document: WAMediaUpload; + mimetype: string; + fileName?: string; +} & Buttonable & Templatable)) & { + mimetype?: string; +}; +export declare type AnyRegularMessageContent = (({ + text: string; +} & Mentionable & Buttonable & Templatable & Listable) | AnyMediaMessageContent | { + contacts: { + displayName?: string; + contacts: proto.IContactMessage[]; + }; +} | { + location: WALocationMessage; +} | { + react: proto.IReactionMessage; +}) & ViewOnce; +export declare type AnyMessageContent = AnyRegularMessageContent | { + forward: WAMessage; + force?: boolean; +} | { + delete: WAMessageKey; +} | { + disappearingMessagesInChat: boolean | number; +}; +export declare type MessageRelayOptions = { + messageId?: string; + /** only send to a specific participant */ + participant?: string; + additionalAttributes?: { + [_: string]: string; + }; + cachedGroupMetadata?: (jid: string) => Promise; +}; +export declare type MiscMessageGenerationOptions = { + /** Force message id */ + messageId?: string; + /** optional, if you want to manually set the timestamp of the message */ + timestamp?: Date; + /** the message you want to quote */ + quoted?: WAMessage; + /** disappearing messages settings */ + ephemeralExpiration?: number | string; + mediaUploadTimeoutMs?: number; +}; +export declare type MessageGenerationOptionsFromContent = MiscMessageGenerationOptions & { + userJid: string; +}; +export declare type WAMediaUploadFunction = (readStream: Readable, opts: { + fileEncSha256B64: string; + mediaType: MediaType; + timeoutMs?: number; +}) => Promise<{ + mediaUrl: string; + directPath: string; +}>; +export declare type MediaGenerationOptions = { + logger?: Logger; + upload: WAMediaUploadFunction; + /** cache media so it does not have to be uploaded again */ + mediaCache?: NodeCache; + mediaUploadTimeoutMs?: number; +}; +export declare type MessageContentGenerationOptions = MediaGenerationOptions & { + getUrlInfo?: (text: string) => Promise; +}; +export declare type MessageGenerationOptions = MessageContentGenerationOptions & MessageGenerationOptionsFromContent; +export declare type MessageUpdateType = 'append' | 'notify' | 'replace'; +export declare type MessageUserReceipt = proto.IUserReceipt; +export declare type WAMessageUpdate = { + update: Partial; + key: proto.IMessageKey; +}; +export declare type WAMessageCursor = { + before: WAMessageKey | undefined; +} | { + after: WAMessageKey | undefined; +}; +export declare type MessageUserReceiptUpdate = { + key: proto.IMessageKey; + receipt: MessageUserReceipt; +}; diff --git a/node_modules/@adiwajshing/baileys/lib/Types/Message.d_1.ts b/node_modules/@adiwajshing/baileys/lib/Types/Message.d_1.ts deleted file mode 100644 index adca91aef..000000000 --- a/node_modules/@adiwajshing/baileys/lib/Types/Message.d_1.ts +++ /dev/null @@ -1,175 +0,0 @@ -/// -import type NodeCache from 'node-cache'; -import type { Logger } from 'pino'; -import type { Readable } from 'stream'; -import type { URL } from 'url'; -import { proto } from '../../WAProto'; -import type { GroupMetadata } from './GroupMetadata'; -export { proto as WAProto }; -export declare type WAMessage = proto.IWebMessageInfo; -export declare type WAMessageContent = proto.IMessage; -export declare type WAContactMessage = proto.IContactMessage; -export declare type WAContactsArrayMessage = proto.IContactsArrayMessage; -export declare type WAMessageKey = proto.IMessageKey; -export declare type WATextMessage = proto.IExtendedTextMessage; -export declare type WAContextInfo = proto.IContextInfo; -export declare type WALocationMessage = proto.ILocationMessage; -export declare type WAGenericMediaMessage = proto.IVideoMessage | proto.IImageMessage | proto.IAudioMessage | proto.IDocumentMessage | proto.IStickerMessage; -export import WAMessageStubType = proto.WebMessageInfo.WebMessageInfoStubType; -export import WAMessageStatus = proto.WebMessageInfo.WebMessageInfoStatus; -export declare type WAMediaUpload = Buffer | { - url: URL | string; -} | { - stream: Readable; -}; -/** Set of message types that are supported by the library */ -export declare type MessageType = keyof proto.Message; -export declare type DownloadableMessage = { - mediaKey?: Uint8Array; - directPath?: string; - url?: string; -}; -export declare type MediaConnInfo = { - auth: string; - ttl: number; - hosts: { - hostname: string; - maxContentLengthBytes: number; - }[]; - fetchDate: Date; -}; -export interface WAUrlInfo { - 'canonical-url': string; - 'matched-text': string; - title: string; - description: string; - jpegThumbnail?: Buffer; -} -declare type Mentionable = { - /** list of jids that are mentioned in the accompanying text */ - mentions?: string[]; -}; -declare type ViewOnce = { - viewOnce?: boolean; -}; -declare type Buttonable = { - /** add buttons to the message */ - buttons?: proto.IButton[]; -}; -declare type Templatable = { - /** add buttons to the message (conflicts with normal buttons)*/ - templateButtons?: proto.IHydratedTemplateButton[]; - footer?: string; -}; -declare type Listable = { - /** Sections of the List */ - sections?: proto.ISection[]; - /** Title of a List Message only */ - title?: string; - /** Text of the bnutton on the list (required) */ - buttonText?: string; -}; -declare type WithDimensions = { - width?: number; - height?: number; -}; -export declare type MediaType = 'image' | 'video' | 'sticker' | 'audio' | 'document' | 'history' | 'md-app-state'; -export declare type AnyMediaMessageContent = (({ - image: WAMediaUpload; - caption?: string; - jpegThumbnail?: string; -} & Mentionable & Buttonable & Templatable & WithDimensions) | ({ - video: WAMediaUpload; - caption?: string; - gifPlayback?: boolean; - jpegThumbnail?: string; -} & Mentionable & Buttonable & Templatable & WithDimensions) | { - audio: WAMediaUpload; - /** if set to true, will send as a `voice note` */ - ptt?: boolean; - /** optionally tell the duration of the audio */ - seconds?: number; -} | ({ - sticker: WAMediaUpload; -} & WithDimensions) | ({ - document: WAMediaUpload; - mimetype: string; - fileName?: string; -} & Buttonable & Templatable)) & { - mimetype?: string; -}; -export declare type AnyRegularMessageContent = (({ - text: string; -} & Mentionable & Buttonable & Templatable & Listable) | AnyMediaMessageContent | { - contacts: { - displayName?: string; - contacts: proto.IContactMessage[]; - }; -} | { - location: WALocationMessage; -}) & ViewOnce; -export declare type AnyMessageContent = AnyRegularMessageContent | { - forward: WAMessage; - force?: boolean; -} | { - delete: WAMessageKey; -} | { - disappearingMessagesInChat: boolean | number; -}; -export declare type MessageRelayOptions = { - messageId?: string; - /** only send to a specific participant */ - participant?: string; - additionalAttributes?: { - [_: string]: string; - }; - cachedGroupMetadata?: (jid: string) => Promise; -}; -export declare type MiscMessageGenerationOptions = { - /** Force message id */ - messageId?: string; - /** optional, if you want to manually set the timestamp of the message */ - timestamp?: Date; - /** the message you want to quote */ - quoted?: WAMessage; - /** disappearing messages settings */ - ephemeralExpiration?: number | string; - mediaUploadTimeoutMs?: number; -}; -export declare type MessageGenerationOptionsFromContent = MiscMessageGenerationOptions & { - userJid: string; -}; -export declare type WAMediaUploadFunction = (readStream: Readable, opts: { - fileEncSha256B64: string; - mediaType: MediaType; - timeoutMs?: number; -}) => Promise<{ - mediaUrl: string; - directPath: string; -}>; -export declare type MediaGenerationOptions = { - logger?: Logger; - upload: WAMediaUploadFunction; - /** cache media so it does not have to be uploaded again */ - mediaCache?: NodeCache; - mediaUploadTimeoutMs?: number; -}; -export declare type MessageContentGenerationOptions = MediaGenerationOptions & { - getUrlInfo?: (text: string) => Promise; -}; -export declare type MessageGenerationOptions = MessageContentGenerationOptions & MessageGenerationOptionsFromContent; -export declare type MessageUpdateType = 'append' | 'notify' | 'replace'; -export declare type MessageUserReceipt = proto.IUserReceipt; -export declare type WAMessageUpdate = { - update: Partial; - key: proto.IMessageKey; -}; -export declare type WAMessageCursor = { - before: WAMessageKey | undefined; -} | { - after: WAMessageKey | undefined; -}; -export declare type MessageUserReceiptUpdate = { - key: proto.IMessageKey; - receipt: MessageUserReceipt; -}; diff --git a/node_modules/@adiwajshing/baileys/lib/Types/Product.d.ts b/node_modules/@adiwajshing/baileys/lib/Types/Product.d.ts new file mode 100644 index 000000000..e135fc900 --- /dev/null +++ b/node_modules/@adiwajshing/baileys/lib/Types/Product.d.ts @@ -0,0 +1,70 @@ +import { WAMediaUpload } from './Message'; +export declare type CatalogResult = { + data: { + paging: { + cursors: { + before: string; + after: string; + }; + }; + data: any[]; + }; +}; +export declare type ProductCreateResult = { + data: { + product: any; + }; +}; +export declare type CatalogStatus = { + status: string; + canAppeal: boolean; +}; +export declare type CatalogCollection = { + id: string; + name: string; + products: Product[]; + status: CatalogStatus; +}; +export declare type ProductAvailability = 'in stock'; +export declare type ProductBase = { + name: string; + retailerId?: string; + url?: string; + description: string; + price: number; + currency: string; + isHidden?: boolean; +}; +export declare type ProductCreate = ProductBase & { + /** ISO country code for product origin. Set to undefined for no country */ + originCountryCode: string | undefined; + /** images of the product */ + images: WAMediaUpload[]; +}; +export declare type ProductUpdate = Omit; +export declare type Product = ProductBase & { + id: string; + imageUrls: { + [_: string]: string; + }; + reviewStatus: { + [_: string]: string; + }; + availability: ProductAvailability; +}; +export declare type OrderPrice = { + currency: string; + total: number; +}; +export declare type OrderProduct = { + id: string; + imageUrl: string; + name: string; + quantity: number; + currency: string; + price: number; +}; +export declare type OrderDetails = { + price: OrderPrice; + products: OrderProduct[]; +}; diff --git a/node_modules/@adiwajshing/baileys/lib/Types/Product.js b/node_modules/@adiwajshing/baileys/lib/Types/Product.js new file mode 100644 index 000000000..c8ad2e549 --- /dev/null +++ b/node_modules/@adiwajshing/baileys/lib/Types/Product.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/node_modules/@adiwajshing/baileys/lib/Types/Socket.d.ts b/node_modules/@adiwajshing/baileys/lib/Types/Socket.d.ts new file mode 100644 index 000000000..5849fc44e --- /dev/null +++ b/node_modules/@adiwajshing/baileys/lib/Types/Socket.d.ts @@ -0,0 +1,42 @@ +/// +import type { Agent } from 'https'; +import type NodeCache from 'node-cache'; +import type { Logger } from 'pino'; +import type { URL } from 'url'; +import { MediaConnInfo } from './Message'; +export declare type WAVersion = [number, number, number]; +export declare type WABrowserDescription = [string, string, string]; +export declare type CommonSocketConfig = { + /** provide an auth state object to maintain the auth state */ + auth?: T; + /** the WS url to connect to WA */ + waWebSocketUrl: string | URL; + /** Fails the connection if the socket times out in this interval */ + connectTimeoutMs: number; + /** Default timeout for queries, undefined for no timeout */ + defaultQueryTimeoutMs: number | undefined; + /** ping-pong interval for WS connection */ + keepAliveIntervalMs: number; + /** proxy agent */ + agent?: Agent; + /** pino logger */ + logger: Logger; + /** version to connect with */ + version: WAVersion; + /** override browser config */ + browser: WABrowserDescription; + /** agent used for fetch requests -- uploading/downloading media */ + fetchAgent?: Agent; + /** should the QR be printed in the terminal */ + printQRInTerminal: boolean; + /** should events be emitted for actions done by this socket connection */ + emitOwnEvents: boolean; + /** provide a cache to store media, so does not have to be re-uploaded */ + mediaCache?: NodeCache; + /** custom upload hosts to upload media to */ + customUploadHosts: MediaConnInfo['hosts']; + /** fires a conversationTimestamp & read count update on CIPHERTEXT messages */ + treatCiphertextMessagesAsReal: boolean; + /** time to wait between sending new retry requests */ + retryRequestDelayMs: number; +}; diff --git a/node_modules/@adiwajshing/baileys/lib/Types/Socket.d_1.ts b/node_modules/@adiwajshing/baileys/lib/Types/Socket.d_1.ts deleted file mode 100644 index f20691a81..000000000 --- a/node_modules/@adiwajshing/baileys/lib/Types/Socket.d_1.ts +++ /dev/null @@ -1,37 +0,0 @@ -/// -import type { Agent } from 'https'; -import type NodeCache from 'node-cache'; -import type { Logger } from 'pino'; -import type { URL } from 'url'; -import { MediaConnInfo } from './Message'; -export declare type WAVersion = [number, number, number]; -export declare type WABrowserDescription = [string, string, string]; -export declare type CommonSocketConfig = { - /** provide an auth state object to maintain the auth state */ - auth?: T; - /** the WS url to connect to WA */ - waWebSocketUrl: string | URL; - /** Fails the connection if the socket times out in this interval */ - connectTimeoutMs: number; - /** Default timeout for queries, undefined for no timeout */ - defaultQueryTimeoutMs: number | undefined; - /** ping-pong interval for WS connection */ - keepAliveIntervalMs: number; - /** proxy agent */ - agent?: Agent; - /** pino logger */ - logger: Logger; - /** version to connect with */ - version: WAVersion; - /** override browser config */ - browser: WABrowserDescription; - /** agent used for fetch requests -- uploading/downloading media */ - fetchAgent?: Agent; - /** should the QR be printed in the terminal */ - printQRInTerminal: boolean; - /** should events be emitted for actions done by this socket connection */ - emitOwnEvents: boolean; - /** provide a cache to store media, so does not have to be re-uploaded */ - mediaCache?: NodeCache; - customUploadHosts: MediaConnInfo['hosts']; -}; diff --git a/node_modules/@adiwajshing/baileys/lib/Types/.trashed-1649374382-State.d.ts b/node_modules/@adiwajshing/baileys/lib/Types/State.d.ts similarity index 100% rename from node_modules/@adiwajshing/baileys/lib/Types/.trashed-1649374382-State.d.ts rename to node_modules/@adiwajshing/baileys/lib/Types/State.d.ts diff --git a/node_modules/@adiwajshing/baileys/lib/Types/State.d_1.ts b/node_modules/@adiwajshing/baileys/lib/Types/State.d_1.ts deleted file mode 100644 index 7c59ca724..000000000 --- a/node_modules/@adiwajshing/baileys/lib/Types/State.d_1.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { Contact } from './Contact'; -export declare type WAConnectionState = 'open' | 'connecting' | 'close'; -export declare type ConnectionState = { - /** connection is now open, connecting or closed */ - connection: WAConnectionState; - /** the error that caused the connection to close */ - lastDisconnect?: { - error: Error; - date: Date; - }; - /** is this a new login */ - isNewLogin?: boolean; - /** the current QR code */ - qr?: string; - /** has the device received all pending notifications while it was offline */ - receivedPendingNotifications?: boolean; - /** legacy connection options */ - legacy?: { - phoneConnected: boolean; - user?: Contact; - }; -}; diff --git a/node_modules/@adiwajshing/baileys/lib/Types/index.d.ts b/node_modules/@adiwajshing/baileys/lib/Types/index.d.ts new file mode 100644 index 000000000..72b187e75 --- /dev/null +++ b/node_modules/@adiwajshing/baileys/lib/Types/index.d.ts @@ -0,0 +1,67 @@ +export * from './Auth'; +export * from './GroupMetadata'; +export * from './Chat'; +export * from './Contact'; +export * from './State'; +export * from './Message'; +export * from './Legacy'; +export * from './Socket'; +export * from './Events'; +export * from './Product'; +import type NodeCache from 'node-cache'; +import { proto } from '../../WAProto'; +import { AuthenticationState } from './Auth'; +import { CommonSocketConfig } from './Socket'; +export declare type SocketConfig = CommonSocketConfig & { + /** provide a cache to store a user's device list */ + userDevicesCache?: NodeCache; + /** map to store the retry counts for failed messages */ + msgRetryCounterMap?: { + [msgId: string]: number; + }; + /** + * fetch a message from your store + * implement this so that messages failed to send (solves the "this message can take a while" issue) can be retried + * */ + getMessage: (key: proto.IMessageKey) => Promise; +}; +export declare enum DisconnectReason { + connectionClosed = 428, + connectionLost = 408, + connectionReplaced = 440, + timedOut = 408, + loggedOut = 401, + badSession = 500, + restartRequired = 410, + multideviceMismatch = 411 +} +export declare type WAInitResponse = { + ref: string; + ttl: number; + status: 200; +}; +export declare type WABusinessHoursConfig = { + day_of_week: string; + mode: string; + open_time?: number; + close_time?: number; +}; +export declare type WABusinessProfile = { + description: string; + email: string; + business_hours: { + timezone?: string; + config?: WABusinessHoursConfig[]; + business_config?: WABusinessHoursConfig[]; + }; + website: string[]; + categories: { + id: string; + localized_display_name: string; + }[]; + wid?: string; +}; +export declare type CurveKeyPair = { + private: Uint8Array; + public: Uint8Array; +}; diff --git a/node_modules/@adiwajshing/baileys/lib/Types/index.d_1.ts b/node_modules/@adiwajshing/baileys/lib/Types/index.d_1.ts deleted file mode 100644 index 03b77a300..000000000 --- a/node_modules/@adiwajshing/baileys/lib/Types/index.d_1.ts +++ /dev/null @@ -1,66 +0,0 @@ -export * from './Auth'; -export * from './GroupMetadata'; -export * from './Chat'; -export * from './Contact'; -export * from './State'; -export * from './Message'; -export * from './Legacy'; -export * from './Socket'; -export * from './Events'; -import type NodeCache from 'node-cache'; -import { proto } from '../../WAProto'; -import { AuthenticationState } from './Auth'; -import { CommonSocketConfig } from './Socket'; -export declare type SocketConfig = CommonSocketConfig & { - /** provide a cache to store a user's device list */ - userDevicesCache?: NodeCache; - /** map to store the retry counts for failed messages */ - msgRetryCounterMap?: { - [msgId: string]: number; - }; - /** - * fetch a message from your store - * implement this so that messages failed to send (solves the "this message can take a while" issue) can be retried - * */ - getMessage: (key: proto.IMessageKey) => Promise; -}; -export declare enum DisconnectReason { - connectionClosed = 428, - connectionLost = 408, - connectionReplaced = 440, - timedOut = 408, - loggedOut = 401, - badSession = 500, - restartRequired = 410, - multideviceMismatch = 411 -} -export declare type WAInitResponse = { - ref: string; - ttl: number; - status: 200; -}; -export declare type WABusinessHoursConfig = { - day_of_week: string; - mode: string; - open_time?: number; - close_time?: number; -}; -export declare type WABusinessProfile = { - description: string; - email: string; - business_hours: { - timezone?: string; - config?: WABusinessHoursConfig[]; - business_config?: WABusinessHoursConfig[]; - }; - website: string[]; - categories: { - id: string; - localized_display_name: string; - }[]; - wid?: string; -}; -export declare type CurveKeyPair = { - private: Uint8Array; - public: Uint8Array; -}; diff --git a/node_modules/@adiwajshing/baileys/lib/Types/index.js b/node_modules/@adiwajshing/baileys/lib/Types/index.js index ce6a69095..770a49f3d 100644 --- a/node_modules/@adiwajshing/baileys/lib/Types/index.js +++ b/node_modules/@adiwajshing/baileys/lib/Types/index.js @@ -20,6 +20,7 @@ __exportStar(require("./Message"), exports); __exportStar(require("./Legacy"), exports); __exportStar(require("./Socket"), exports); __exportStar(require("./Events"), exports); +__exportStar(require("./Product"), exports); var DisconnectReason; (function (DisconnectReason) { DisconnectReason[DisconnectReason["connectionClosed"] = 428] = "connectionClosed"; diff --git a/node_modules/@adiwajshing/baileys/lib/Utils/.trashed-1649374382-chat-utils.d.ts b/node_modules/@adiwajshing/baileys/lib/Utils/.trashed-1649374382-chat-utils.d.ts deleted file mode 100644 index ddbf88898..000000000 --- a/node_modules/@adiwajshing/baileys/lib/Utils/.trashed-1649374382-chat-utils.d.ts +++ /dev/null @@ -1,67 +0,0 @@ -/// -import { proto } from '../../WAProto'; -import { ChatModification, ChatMutation, LTHashState, WAPatchCreate, WAPatchName } from '../Types'; -import { BinaryNode } from '../WABinary'; -declare type FetchAppStateSyncKey = (keyId: string) => Promise | proto.IAppStateSyncKeyData; -export declare const newLTHashState: () => LTHashState; -export declare const encodeSyncdPatch: ({ type, index, syncAction, apiVersion, operation }: WAPatchCreate, myAppStateKeyId: string, state: LTHashState, getAppStateSyncKey: FetchAppStateSyncKey) => Promise<{ - patch: proto.ISyncdPatch; - state: LTHashState; -}>; -export declare const decodeSyncdMutations: (msgMutations: (proto.ISyncdMutation | proto.ISyncdRecord)[], initialState: LTHashState, getAppStateSyncKey: FetchAppStateSyncKey, validateMacs: boolean) => Promise<{ - hash: Buffer; - indexValueMap: { - [indexMacBase64: string]: { - valueMac: Uint8Array | Buffer; - }; - }; - mutations: ChatMutation[]; -}>; -export declare const decodeSyncdPatch: (msg: proto.ISyncdPatch, name: WAPatchName, initialState: LTHashState, getAppStateSyncKey: FetchAppStateSyncKey, validateMacs: boolean) => Promise<{ - hash: Buffer; - indexValueMap: { - [indexMacBase64: string]: { - valueMac: Uint8Array | Buffer; - }; - }; - mutations: ChatMutation[]; -}>; -export declare const extractSyncdPatches: (result: BinaryNode) => Promise<{ - critical_block: { - patches: proto.ISyncdPatch[]; - hasMorePatches: boolean; - snapshot?: proto.ISyncdSnapshot; - }; - critical_unblock_low: { - patches: proto.ISyncdPatch[]; - hasMorePatches: boolean; - snapshot?: proto.ISyncdSnapshot; - }; - regular_low: { - patches: proto.ISyncdPatch[]; - hasMorePatches: boolean; - snapshot?: proto.ISyncdSnapshot; - }; - regular_high: { - patches: proto.ISyncdPatch[]; - hasMorePatches: boolean; - snapshot?: proto.ISyncdSnapshot; - }; - regular: { - patches: proto.ISyncdPatch[]; - hasMorePatches: boolean; - snapshot?: proto.ISyncdSnapshot; - }; -}>; -export declare const downloadExternalBlob: (blob: proto.IExternalBlobReference) => Promise; -export declare const downloadExternalPatch: (blob: proto.IExternalBlobReference) => Promise; -export declare const decodeSyncdSnapshot: (name: WAPatchName, snapshot: proto.ISyncdSnapshot, getAppStateSyncKey: FetchAppStateSyncKey, minimumVersionNumber: number | undefined, validateMacs?: boolean) => Promise<{ - state: LTHashState; - mutations: ChatMutation[]; -}>; -export declare const decodePatches: (name: WAPatchName, syncds: proto.ISyncdPatch[], initial: LTHashState, getAppStateSyncKey: FetchAppStateSyncKey, minimumVersionNumber?: number, validateMacs?: boolean) => Promise<{ - newMutations: ChatMutation[]; - state: LTHashState; -}>; -export declare const chatModificationToAppPatch: (mod: ChatModification, jid: string) => WAPatchCreate; -export {}; diff --git a/node_modules/@adiwajshing/baileys/lib/Utils/.trashed-1649374382-decode-wa-message.d.ts b/node_modules/@adiwajshing/baileys/lib/Utils/.trashed-1649374382-decode-wa-message.d.ts deleted file mode 100644 index e0a62f720..000000000 --- a/node_modules/@adiwajshing/baileys/lib/Utils/.trashed-1649374382-decode-wa-message.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { proto } from '../../WAProto'; -import { AuthenticationState } from '../Types'; -import { BinaryNode } from '../WABinary'; -export declare const decodeMessageStanza: (stanza: BinaryNode, auth: AuthenticationState) => { - fullMessage: proto.IWebMessageInfo; - decryptionTask: Promise; -}; diff --git a/node_modules/@adiwajshing/baileys/lib/Utils/.trashed-1649374382-generics.d.ts b/node_modules/@adiwajshing/baileys/lib/Utils/.trashed-1649374382-generics.d.ts deleted file mode 100644 index 98dec7fe1..000000000 --- a/node_modules/@adiwajshing/baileys/lib/Utils/.trashed-1649374382-generics.d.ts +++ /dev/null @@ -1,56 +0,0 @@ -/// -import { Logger } from 'pino'; -import { proto } from '../../WAProto'; -import { CommonBaileysEventEmitter, ConnectionState, WAVersion } from '../Types'; -export declare const Browsers: { - ubuntu: (browser: any) => [string, string, string]; - macOS: (browser: any) => [string, string, string]; - baileys: (browser: any) => [string, string, string]; - /** The appropriate browser based on your OS & release */ - appropriate: (browser: any) => [string, string, string]; -}; -export declare const BufferJSON: { - replacer: (k: any, value: any) => any; - reviver: (_: any, value: any) => any; -}; -export declare const writeRandomPadMax16: (e: any) => any; -export declare const unpadRandomMax16: (e: Uint8Array | Buffer) => Uint8Array; -export declare const encodeWAMessage: (message: proto.IMessage) => Buffer; -export declare const generateRegistrationId: () => number; -export declare const encodeInt: (e: number, t: number) => Uint8Array; -export declare const encodeBigEndian: (e: number, t?: number) => Uint8Array; -export declare const toNumber: (t: Long | number) => number; -export declare function shallowChanges(old: T, current: T, { lookForDeletedKeys }: { - lookForDeletedKeys: boolean; -}): Partial; -/** unix timestamp of a date in seconds */ -export declare const unixTimestampSeconds: (date?: Date) => number; -export declare type DebouncedTimeout = ReturnType; -export declare const debouncedTimeout: (intervalMs?: number, task?: () => void) => { - start: (newIntervalMs?: number, newTask?: () => void) => void; - cancel: () => void; - setTask: (newTask: () => void) => () => void; - setInterval: (newInterval: number) => number; -}; -export declare const delay: (ms: number) => Promise; -export declare const delayCancellable: (ms: number) => { - delay: Promise; - cancel: () => void; -}; -export declare function promiseTimeout(ms: number, promise: (resolve: (v?: T) => void, reject: (error: any) => void) => void): Promise; -export declare const generateMessageID: () => string; -export declare const bindWaitForConnectionUpdate: (ev: CommonBaileysEventEmitter) => (check: (u: Partial) => boolean, timeoutMs?: number) => Promise; -export declare const printQRIfNecessaryListener: (ev: CommonBaileysEventEmitter, logger: Logger) => void; -/** - * utility that fetches latest baileys version from the master branch. - * Use to ensure your WA connection is always on the latest version - */ -export declare const fetchLatestBaileysVersion: () => Promise<{ - version: WAVersion; - isLatest: boolean; - error?: undefined; -} | { - version: WAVersion; - isLatest: boolean; - error: any; -}>; diff --git a/node_modules/@adiwajshing/baileys/lib/Utils/.trashed-1649374382-index.d.ts b/node_modules/@adiwajshing/baileys/lib/Utils/.trashed-1649374382-index.d.ts deleted file mode 100644 index 38d5b911f..000000000 --- a/node_modules/@adiwajshing/baileys/lib/Utils/.trashed-1649374382-index.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -export * from './decode-wa-message'; -export * from './generics'; -export * from './messages'; -export * from './messages-media'; -export * from './validate-connection'; -export * from './crypto'; -export * from './signal'; -export * from './noise-handler'; -export * from './history'; -export * from './chat-utils'; -export * from './lt-hash'; -export * from './auth-utils'; -export * from './legacy-msgs'; diff --git a/node_modules/@adiwajshing/baileys/lib/Utils/.trashed-1649374382-messages-media.d.ts b/node_modules/@adiwajshing/baileys/lib/Utils/.trashed-1649374382-messages-media.d.ts deleted file mode 100644 index 872f12919..000000000 --- a/node_modules/@adiwajshing/baileys/lib/Utils/.trashed-1649374382-messages-media.d.ts +++ /dev/null @@ -1,56 +0,0 @@ -/// -import { AxiosRequestConfig } from 'axios'; -import type { Logger } from 'pino'; -import { Readable, Transform } from 'stream'; -import { URL } from 'url'; -import { CommonSocketConfig, DownloadableMessage, MediaConnInfo, MediaType, WAMediaUpload, WAMediaUploadFunction, WAMessageContent } from '../Types'; -export declare const hkdfInfoKey: (type: MediaType) => string; -/** generates all the keys required to encrypt/decrypt & sign a media message */ -export declare function getMediaKeys(buffer: any, mediaType: MediaType): { - iv: Buffer; - cipherKey: Buffer; - macKey: Buffer; -}; -export declare const extractImageThumb: (bufferOrFilePath: Readable | Buffer | string) => Promise; -export declare const generateProfilePicture: (mediaUpload: WAMediaUpload) => Promise<{ - img: Buffer; -}>; -/** gets the SHA256 of the given media message */ -export declare const mediaMessageSHA256B64: (message: WAMessageContent) => string; -export declare function getAudioDuration(buffer: Buffer | string | Readable): Promise; -export declare const toReadable: (buffer: Buffer) => Readable; -export declare const toBuffer: (stream: Readable) => Promise; -export declare const getStream: (item: WAMediaUpload) => Promise<{ - stream: Readable; - type: string; -}>; -/** generates a thumbnail for a given media, if required */ -export declare function generateThumbnail(file: string, mediaType: 'video' | 'image', options: { - logger?: Logger; -}): Promise; -export declare const getHttpStream: (url: string | URL, options?: AxiosRequestConfig & { - isStream?: true; -}) => Promise; -export declare const encryptedStream: (media: WAMediaUpload, mediaType: MediaType, saveOriginalFileIfRequired?: boolean, logger?: Logger) => Promise<{ - mediaKey: Buffer; - encWriteStream: Readable; - bodyPath: string; - mac: Buffer; - fileEncSha256: Buffer; - fileSha256: Buffer; - fileLength: number; - didSaveToTmpPath: boolean; -}>; -declare type MediaDownloadOptions = { - startByte?: number; - endByte?: number; -}; -export declare const downloadContentFromMessage: ({ mediaKey, directPath, url }: DownloadableMessage, type: MediaType, { startByte, endByte }?: MediaDownloadOptions) => Promise; -/** - * Decode a media message (video, image, document, audio) & return decrypted buffer - * @param message the media message you want to decode - */ -export declare function decryptMediaMessageBuffer(message: WAMessageContent): Promise; -export declare function extensionForMediaMessage(message: WAMessageContent): string; -export declare const getWAUploadToServer: ({ customUploadHosts, fetchAgent, logger }: CommonSocketConfig, refreshMediaConn: (force: boolean) => Promise) => WAMediaUploadFunction; -export {}; diff --git a/node_modules/@adiwajshing/baileys/lib/Utils/.trashed-1649374382-messages.d.ts b/node_modules/@adiwajshing/baileys/lib/Utils/.trashed-1649374382-messages.d.ts deleted file mode 100644 index 339b464e2..000000000 --- a/node_modules/@adiwajshing/baileys/lib/Utils/.trashed-1649374382-messages.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { proto } from '../../WAProto'; -import { AnyMediaMessageContent, AnyMessageContent, MediaGenerationOptions, MessageContentGenerationOptions, MessageGenerationOptions, MessageGenerationOptionsFromContent, MessageUserReceipt, WAMessage, WAMessageContent, WAProto } from '../Types'; -export declare const prepareWAMessageMedia: (message: AnyMediaMessageContent, options: MediaGenerationOptions) => Promise; -export declare const prepareDisappearingMessageSettingContent: (ephemeralExpiration?: number) => proto.Message; -/** - * Generate forwarded message content like WA does - * @param message the message to forward - * @param options.forceForward will show the message as forwarded even if it is from you - */ -export declare const generateForwardMessageContent: (message: WAMessage, forceForward?: boolean) => proto.IMessage; -export declare const generateWAMessageContent: (message: AnyMessageContent, options: MessageContentGenerationOptions) => Promise; -export declare const generateWAMessageFromContent: (jid: string, message: WAMessageContent, options: MessageGenerationOptionsFromContent) => proto.WebMessageInfo; -export declare const generateWAMessage: (jid: string, content: AnyMessageContent, options: MessageGenerationOptions) => Promise; -/** Get the key to access the true type of content */ -export declare const getContentType: (content: WAProto.IMessage | undefined) => keyof proto.IMessage; -/** - * Extract the true message content from a message - * Eg. extracts the inner message from a disappearing message/view once message - */ -export declare const extractMessageContent: (content: WAMessageContent | undefined | null) => WAMessageContent | undefined; -/** - * Returns the device predicted by message ID - */ -export declare const getDevice: (id: string) => "android" | "web" | "ios"; -export declare const updateMessageWithReceipt: (msg: WAMessage, receipt: MessageUserReceipt) => void; diff --git a/node_modules/@adiwajshing/baileys/lib/Utils/.trashed-1649374384-validate-connection.d.ts b/node_modules/@adiwajshing/baileys/lib/Utils/.trashed-1649374384-validate-connection.d.ts deleted file mode 100644 index 07e3ecf22..000000000 --- a/node_modules/@adiwajshing/baileys/lib/Utils/.trashed-1649374384-validate-connection.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { AuthenticationCreds, SignalCreds, SocketConfig } from '../Types'; -import { BinaryNode } from '../WABinary'; -export declare const generateLoginNode: (userJid: string, config: Pick) => Uint8Array; -export declare const generateRegistrationNode: ({ registrationId, signedPreKey, signedIdentityKey }: SignalCreds, config: Pick) => Uint8Array; -export declare const configureSuccessfulPairing: (stanza: BinaryNode, { advSecretKey, signedIdentityKey, signalIdentities }: Pick) => { - creds: Partial; - reply: BinaryNode; -}; diff --git a/node_modules/@adiwajshing/baileys/lib/Utils/.trashed-1649374382-auth-utils.d.ts b/node_modules/@adiwajshing/baileys/lib/Utils/auth-utils.d.ts similarity index 100% rename from node_modules/@adiwajshing/baileys/lib/Utils/.trashed-1649374382-auth-utils.d.ts rename to node_modules/@adiwajshing/baileys/lib/Utils/auth-utils.d.ts diff --git a/node_modules/@adiwajshing/baileys/lib/Utils/auth-utils.d_1.ts b/node_modules/@adiwajshing/baileys/lib/Utils/auth-utils.d_1.ts deleted file mode 100644 index b5d029e3a..000000000 --- a/node_modules/@adiwajshing/baileys/lib/Utils/auth-utils.d_1.ts +++ /dev/null @@ -1,9 +0,0 @@ -import type { Logger } from 'pino'; -import type { AuthenticationCreds, AuthenticationState, SignalKeyStore, SignalKeyStoreWithTransaction } from '../Types'; -export declare const addTransactionCapability: (state: SignalKeyStore, logger: Logger) => SignalKeyStoreWithTransaction; -export declare const initAuthCreds: () => AuthenticationCreds; -/** stores the full authentication state in a single JSON file */ -export declare const useSingleFileAuthState: (filename: string, logger?: Logger) => { - state: AuthenticationState; - saveState: () => void; -}; diff --git a/node_modules/@adiwajshing/baileys/lib/Utils/baileys-event-stream.d.ts b/node_modules/@adiwajshing/baileys/lib/Utils/baileys-event-stream.d.ts new file mode 100644 index 000000000..bfddac40b --- /dev/null +++ b/node_modules/@adiwajshing/baileys/lib/Utils/baileys-event-stream.d.ts @@ -0,0 +1,16 @@ +import type { CommonBaileysEventEmitter } from '../Types'; +/** + * Captures events from a baileys event emitter & stores them in a file + * @param ev The event emitter to read events from + * @param filename File to save to + */ +export declare const captureEventStream: (ev: CommonBaileysEventEmitter, filename: string) => void; +/** + * Read event file and emit events from there + * @param filename filename containing event data + * @param delayIntervalMs delay between each event emit + */ +export declare const readAndEmitEventStream: (filename: string, delayIntervalMs?: number) => { + ev: CommonBaileysEventEmitter; + task: Promise; +}; diff --git a/node_modules/@adiwajshing/baileys/lib/Utils/baileys-event-stream.js b/node_modules/@adiwajshing/baileys/lib/Utils/baileys-event-stream.js new file mode 100644 index 000000000..590c87d8d --- /dev/null +++ b/node_modules/@adiwajshing/baileys/lib/Utils/baileys-event-stream.js @@ -0,0 +1,63 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.readAndEmitEventStream = exports.captureEventStream = void 0; +const events_1 = __importDefault(require("events")); +const fs_1 = require("fs"); +const promises_1 = require("fs/promises"); +const readline_1 = require("readline"); +const generics_1 = require("./generics"); +const make_mutex_1 = require("./make-mutex"); +/** + * Captures events from a baileys event emitter & stores them in a file + * @param ev The event emitter to read events from + * @param filename File to save to + */ +const captureEventStream = (ev, filename) => { + const oldEmit = ev.emit; + // write mutex so data is appended in order + const writeMutex = make_mutex_1.makeMutex(); + // monkey patch eventemitter to capture all events + ev.emit = function (...args) { + const content = JSON.stringify({ timestamp: Date.now(), event: args[0], data: args[1] }) + '\n'; + const result = oldEmit.apply(ev, args); + writeMutex.mutex(async () => { + await promises_1.writeFile(filename, content, { flag: 'a' }); + }); + return result; + }; +}; +exports.captureEventStream = captureEventStream; +/** + * Read event file and emit events from there + * @param filename filename containing event data + * @param delayIntervalMs delay between each event emit + */ +const readAndEmitEventStream = (filename, delayIntervalMs = 0) => { + const ev = new events_1.default(); + const fireEvents = async () => { + // from: https://stackoverflow.com/questions/6156501/read-a-file-one-line-at-a-time-in-node-js + const fileStream = fs_1.createReadStream(filename); + const rl = readline_1.createInterface({ + input: fileStream, + crlfDelay: Infinity + }); + // Note: we use the crlfDelay option to recognize all instances of CR LF + // ('\r\n') in input.txt as a single line break. + for await (const line of rl) { + if (line) { + const { event, data } = JSON.parse(line); + ev.emit(event, data); + delayIntervalMs && await generics_1.delay(delayIntervalMs); + } + } + fileStream.close(); + }; + return { + ev, + task: fireEvents() + }; +}; +exports.readAndEmitEventStream = readAndEmitEventStream; diff --git a/node_modules/@adiwajshing/baileys/lib/Utils/business.d.ts b/node_modules/@adiwajshing/baileys/lib/Utils/business.d.ts new file mode 100644 index 000000000..d9d81b1c2 --- /dev/null +++ b/node_modules/@adiwajshing/baileys/lib/Utils/business.d.ts @@ -0,0 +1,21 @@ +import { CatalogCollection, OrderDetails, Product, ProductCreate, ProductUpdate, WAMediaUpload, WAMediaUploadFunction } from '../Types'; +import { BinaryNode } from '../WABinary'; +export declare const parseCatalogNode: (node: BinaryNode) => { + products: Product[]; +}; +export declare const parseCollectionsNode: (node: BinaryNode) => { + collections: CatalogCollection[]; +}; +export declare const parseOrderDetailsNode: (node: BinaryNode) => OrderDetails; +export declare const toProductNode: (productId: string | undefined, product: ProductCreate | ProductUpdate) => BinaryNode; +export declare const parseProductNode: (productNode: BinaryNode) => Product; +/** + * Uploads images not already uploaded to WA's servers + */ +export declare function uploadingNecessaryImagesOfProduct(product: T, waUploadToServer: WAMediaUploadFunction, timeoutMs?: number): Promise; +/** + * Uploads images not already uploaded to WA's servers + */ +export declare const uploadingNecessaryImages: (images: WAMediaUpload[], waUploadToServer: WAMediaUploadFunction, timeoutMs?: number) => Promise<{ + url: string; +}[]>; diff --git a/node_modules/@adiwajshing/baileys/lib/Utils/business.js b/node_modules/@adiwajshing/baileys/lib/Utils/business.js new file mode 100644 index 000000000..775e9d540 --- /dev/null +++ b/node_modules/@adiwajshing/baileys/lib/Utils/business.js @@ -0,0 +1,224 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.uploadingNecessaryImages = exports.uploadingNecessaryImagesOfProduct = exports.parseProductNode = exports.toProductNode = exports.parseOrderDetailsNode = exports.parseCollectionsNode = exports.parseCatalogNode = void 0; +const boom_1 = require("@hapi/boom"); +const crypto_1 = require("crypto"); +const WABinary_1 = require("../WABinary"); +const messages_media_1 = require("./messages-media"); +const parseCatalogNode = (node) => { + const catalogNode = WABinary_1.getBinaryNodeChild(node, 'product_catalog'); + const products = WABinary_1.getBinaryNodeChildren(catalogNode, 'product').map(exports.parseProductNode); + return { products }; +}; +exports.parseCatalogNode = parseCatalogNode; +const parseCollectionsNode = (node) => { + const collectionsNode = WABinary_1.getBinaryNodeChild(node, 'collections'); + const collections = WABinary_1.getBinaryNodeChildren(collectionsNode, 'collection').map(collectionNode => { + const id = WABinary_1.getBinaryNodeChildString(collectionNode, 'id'); + const name = WABinary_1.getBinaryNodeChildString(collectionNode, 'name'); + const products = WABinary_1.getBinaryNodeChildren(collectionNode, 'product').map(exports.parseProductNode); + return { + id, + name, + products, + status: parseStatusInfo(collectionNode) + }; + }); + return { + collections + }; +}; +exports.parseCollectionsNode = parseCollectionsNode; +const parseOrderDetailsNode = (node) => { + const orderNode = WABinary_1.getBinaryNodeChild(node, 'order'); + const products = WABinary_1.getBinaryNodeChildren(orderNode, 'product').map(productNode => { + const imageNode = WABinary_1.getBinaryNodeChild(productNode, 'image'); + return { + id: WABinary_1.getBinaryNodeChildString(productNode, 'id'), + name: WABinary_1.getBinaryNodeChildString(productNode, 'name'), + imageUrl: WABinary_1.getBinaryNodeChildString(imageNode, 'url'), + price: +WABinary_1.getBinaryNodeChildString(productNode, 'price'), + currency: WABinary_1.getBinaryNodeChildString(productNode, 'currency'), + quantity: +WABinary_1.getBinaryNodeChildString(productNode, 'quantity') + }; + }); + const priceNode = WABinary_1.getBinaryNodeChild(orderNode, 'price'); + const orderDetails = { + price: { + total: +WABinary_1.getBinaryNodeChildString(priceNode, 'total'), + currency: WABinary_1.getBinaryNodeChildString(priceNode, 'currency'), + }, + products + }; + return orderDetails; +}; +exports.parseOrderDetailsNode = parseOrderDetailsNode; +const toProductNode = (productId, product) => { + const attrs = {}; + const content = []; + if (typeof productId !== 'undefined') { + content.push({ + tag: 'id', + attrs: {}, + content: Buffer.from(productId) + }); + } + if (typeof product.name !== 'undefined') { + content.push({ + tag: 'name', + attrs: {}, + content: Buffer.from(product.name) + }); + } + if (typeof product.description !== 'undefined') { + content.push({ + tag: 'description', + attrs: {}, + content: Buffer.from(product.description) + }); + } + if (typeof product.retailerId !== 'undefined') { + content.push({ + tag: 'retailer_id', + attrs: {}, + content: Buffer.from(product.retailerId) + }); + } + if (product.images.length) { + content.push({ + tag: 'media', + attrs: {}, + content: product.images.map(img => { + if (!('url' in img)) { + throw new boom_1.Boom('Expected img for product to already be uploaded', { statusCode: 400 }); + } + return { + tag: 'image', + attrs: {}, + content: [ + { + tag: 'url', + attrs: {}, + content: Buffer.from(img.url.toString()) + } + ] + }; + }) + }); + } + if (typeof product.price !== 'undefined') { + content.push({ + tag: 'price', + attrs: {}, + content: Buffer.from(product.price.toString()) + }); + } + if (typeof product.currency !== 'undefined') { + content.push({ + tag: 'currency', + attrs: {}, + content: Buffer.from(product.currency) + }); + } + if ('originCountryCode' in product) { + if (typeof product.originCountryCode === 'undefined') { + attrs.compliance_category = 'COUNTRY_ORIGIN_EXEMPT'; + } + else { + content.push({ + tag: 'compliance_info', + attrs: {}, + content: [ + { + tag: 'country_code_origin', + attrs: {}, + content: Buffer.from(product.originCountryCode) + } + ] + }); + } + } + if (typeof product.isHidden !== 'undefined') { + attrs.is_hidden = product.isHidden.toString(); + } + const node = { + tag: 'product', + attrs, + content + }; + return node; +}; +exports.toProductNode = toProductNode; +const parseProductNode = (productNode) => { + const isHidden = productNode.attrs.is_hidden === 'true'; + const id = WABinary_1.getBinaryNodeChildString(productNode, 'id'); + const mediaNode = WABinary_1.getBinaryNodeChild(productNode, 'media'); + const statusInfoNode = WABinary_1.getBinaryNodeChild(productNode, 'status_info'); + const product = { + id, + imageUrls: parseImageUrls(mediaNode), + reviewStatus: { + whatsapp: WABinary_1.getBinaryNodeChildString(statusInfoNode, 'status'), + }, + availability: 'in stock', + name: WABinary_1.getBinaryNodeChildString(productNode, 'name'), + retailerId: WABinary_1.getBinaryNodeChildString(productNode, 'retailer_id'), + url: WABinary_1.getBinaryNodeChildString(productNode, 'url'), + description: WABinary_1.getBinaryNodeChildString(productNode, 'description'), + price: +WABinary_1.getBinaryNodeChildString(productNode, 'price'), + currency: WABinary_1.getBinaryNodeChildString(productNode, 'currency'), + isHidden, + }; + return product; +}; +exports.parseProductNode = parseProductNode; +/** + * Uploads images not already uploaded to WA's servers + */ +async function uploadingNecessaryImagesOfProduct(product, waUploadToServer, timeoutMs = 30000) { + product = { + ...product, + images: product.images ? await exports.uploadingNecessaryImages(product.images, waUploadToServer, timeoutMs) : product.images + }; + return product; +} +exports.uploadingNecessaryImagesOfProduct = uploadingNecessaryImagesOfProduct; +/** + * Uploads images not already uploaded to WA's servers + */ +const uploadingNecessaryImages = async (images, waUploadToServer, timeoutMs = 30000) => { + const results = await Promise.all(images.map(async (img) => { + if ('url' in img) { + const url = img.url.toString(); + if (url.includes('.whatsapp.net')) { + return { url }; + } + } + const { stream } = await messages_media_1.getStream(img); + const hasher = crypto_1.createHash('sha256'); + const contentBlocks = []; + for await (const block of stream) { + hasher.update(block); + contentBlocks.push(block); + } + const sha = hasher.digest('base64'); + const { mediaUrl } = await waUploadToServer(messages_media_1.toReadable(Buffer.concat(contentBlocks)), { mediaType: 'image', fileEncSha256B64: sha, timeoutMs }); + return { url: mediaUrl }; + })); + return results; +}; +exports.uploadingNecessaryImages = uploadingNecessaryImages; +const parseImageUrls = (mediaNode) => { + const imgNode = WABinary_1.getBinaryNodeChild(mediaNode, 'image'); + return { + requested: WABinary_1.getBinaryNodeChildString(imgNode, 'request_image_url'), + original: WABinary_1.getBinaryNodeChildString(imgNode, 'original_image_url') + }; +}; +const parseStatusInfo = (mediaNode) => { + const node = WABinary_1.getBinaryNodeChild(mediaNode, 'status_info'); + return { + status: WABinary_1.getBinaryNodeChildString(node, 'status'), + canAppeal: WABinary_1.getBinaryNodeChildString(node, 'can_appeal') === 'true', + }; +}; diff --git a/node_modules/@adiwajshing/baileys/lib/Utils/chat-utils.d.ts b/node_modules/@adiwajshing/baileys/lib/Utils/chat-utils.d.ts new file mode 100644 index 000000000..4d930c11f --- /dev/null +++ b/node_modules/@adiwajshing/baileys/lib/Utils/chat-utils.d.ts @@ -0,0 +1,69 @@ +/// +import type { Logger } from 'pino'; +import { proto } from '../../WAProto'; +import { AuthenticationCreds, BaileysEventMap, ChatModification, ChatMutation, Contact, LTHashState, WAPatchCreate, WAPatchName } from '../Types'; +import { BinaryNode } from '../WABinary'; +declare type FetchAppStateSyncKey = (keyId: string) => Promise | proto.IAppStateSyncKeyData; +export declare const newLTHashState: () => LTHashState; +export declare const encodeSyncdPatch: ({ type, index, syncAction, apiVersion, operation }: WAPatchCreate, myAppStateKeyId: string, state: LTHashState, getAppStateSyncKey: FetchAppStateSyncKey) => Promise<{ + patch: proto.ISyncdPatch; + state: LTHashState; +}>; +export declare const decodeSyncdMutations: (msgMutations: (proto.ISyncdMutation | proto.ISyncdRecord)[], initialState: LTHashState, getAppStateSyncKey: FetchAppStateSyncKey, validateMacs: boolean) => Promise<{ + hash: Buffer; + indexValueMap: { + [indexMacBase64: string]: { + valueMac: Uint8Array | Buffer; + }; + }; + mutations: ChatMutation[]; +}>; +export declare const decodeSyncdPatch: (msg: proto.ISyncdPatch, name: WAPatchName, initialState: LTHashState, getAppStateSyncKey: FetchAppStateSyncKey, validateMacs: boolean) => Promise<{ + hash: Buffer; + indexValueMap: { + [indexMacBase64: string]: { + valueMac: Uint8Array | Buffer; + }; + }; + mutations: ChatMutation[]; +}>; +export declare const extractSyncdPatches: (result: BinaryNode) => Promise<{ + critical_block: { + patches: proto.ISyncdPatch[]; + hasMorePatches: boolean; + snapshot?: proto.ISyncdSnapshot; + }; + critical_unblock_low: { + patches: proto.ISyncdPatch[]; + hasMorePatches: boolean; + snapshot?: proto.ISyncdSnapshot; + }; + regular_low: { + patches: proto.ISyncdPatch[]; + hasMorePatches: boolean; + snapshot?: proto.ISyncdSnapshot; + }; + regular_high: { + patches: proto.ISyncdPatch[]; + hasMorePatches: boolean; + snapshot?: proto.ISyncdSnapshot; + }; + regular: { + patches: proto.ISyncdPatch[]; + hasMorePatches: boolean; + snapshot?: proto.ISyncdSnapshot; + }; +}>; +export declare const downloadExternalBlob: (blob: proto.IExternalBlobReference) => Promise; +export declare const downloadExternalPatch: (blob: proto.IExternalBlobReference) => Promise; +export declare const decodeSyncdSnapshot: (name: WAPatchName, snapshot: proto.ISyncdSnapshot, getAppStateSyncKey: FetchAppStateSyncKey, minimumVersionNumber: number | undefined, validateMacs?: boolean) => Promise<{ + state: LTHashState; + mutations: ChatMutation[]; +}>; +export declare const decodePatches: (name: WAPatchName, syncds: proto.ISyncdPatch[], initial: LTHashState, getAppStateSyncKey: FetchAppStateSyncKey, minimumVersionNumber?: number, validateMacs?: boolean) => Promise<{ + newMutations: ChatMutation[]; + state: LTHashState; +}>; +export declare const chatModificationToAppPatch: (mod: ChatModification, jid: string) => WAPatchCreate; +export declare const processSyncActions: (actions: ChatMutation[], me: Contact, logger?: Logger) => Partial>; +export {}; diff --git a/node_modules/@adiwajshing/baileys/lib/Utils/chat-utils.d_1.ts b/node_modules/@adiwajshing/baileys/lib/Utils/chat-utils.d_1.ts deleted file mode 100644 index ddbf88898..000000000 --- a/node_modules/@adiwajshing/baileys/lib/Utils/chat-utils.d_1.ts +++ /dev/null @@ -1,67 +0,0 @@ -/// -import { proto } from '../../WAProto'; -import { ChatModification, ChatMutation, LTHashState, WAPatchCreate, WAPatchName } from '../Types'; -import { BinaryNode } from '../WABinary'; -declare type FetchAppStateSyncKey = (keyId: string) => Promise | proto.IAppStateSyncKeyData; -export declare const newLTHashState: () => LTHashState; -export declare const encodeSyncdPatch: ({ type, index, syncAction, apiVersion, operation }: WAPatchCreate, myAppStateKeyId: string, state: LTHashState, getAppStateSyncKey: FetchAppStateSyncKey) => Promise<{ - patch: proto.ISyncdPatch; - state: LTHashState; -}>; -export declare const decodeSyncdMutations: (msgMutations: (proto.ISyncdMutation | proto.ISyncdRecord)[], initialState: LTHashState, getAppStateSyncKey: FetchAppStateSyncKey, validateMacs: boolean) => Promise<{ - hash: Buffer; - indexValueMap: { - [indexMacBase64: string]: { - valueMac: Uint8Array | Buffer; - }; - }; - mutations: ChatMutation[]; -}>; -export declare const decodeSyncdPatch: (msg: proto.ISyncdPatch, name: WAPatchName, initialState: LTHashState, getAppStateSyncKey: FetchAppStateSyncKey, validateMacs: boolean) => Promise<{ - hash: Buffer; - indexValueMap: { - [indexMacBase64: string]: { - valueMac: Uint8Array | Buffer; - }; - }; - mutations: ChatMutation[]; -}>; -export declare const extractSyncdPatches: (result: BinaryNode) => Promise<{ - critical_block: { - patches: proto.ISyncdPatch[]; - hasMorePatches: boolean; - snapshot?: proto.ISyncdSnapshot; - }; - critical_unblock_low: { - patches: proto.ISyncdPatch[]; - hasMorePatches: boolean; - snapshot?: proto.ISyncdSnapshot; - }; - regular_low: { - patches: proto.ISyncdPatch[]; - hasMorePatches: boolean; - snapshot?: proto.ISyncdSnapshot; - }; - regular_high: { - patches: proto.ISyncdPatch[]; - hasMorePatches: boolean; - snapshot?: proto.ISyncdSnapshot; - }; - regular: { - patches: proto.ISyncdPatch[]; - hasMorePatches: boolean; - snapshot?: proto.ISyncdSnapshot; - }; -}>; -export declare const downloadExternalBlob: (blob: proto.IExternalBlobReference) => Promise; -export declare const downloadExternalPatch: (blob: proto.IExternalBlobReference) => Promise; -export declare const decodeSyncdSnapshot: (name: WAPatchName, snapshot: proto.ISyncdSnapshot, getAppStateSyncKey: FetchAppStateSyncKey, minimumVersionNumber: number | undefined, validateMacs?: boolean) => Promise<{ - state: LTHashState; - mutations: ChatMutation[]; -}>; -export declare const decodePatches: (name: WAPatchName, syncds: proto.ISyncdPatch[], initial: LTHashState, getAppStateSyncKey: FetchAppStateSyncKey, minimumVersionNumber?: number, validateMacs?: boolean) => Promise<{ - newMutations: ChatMutation[]; - state: LTHashState; -}>; -export declare const chatModificationToAppPatch: (mod: ChatModification, jid: string) => WAPatchCreate; -export {}; diff --git a/node_modules/@adiwajshing/baileys/lib/Utils/chat-utils.js b/node_modules/@adiwajshing/baileys/lib/Utils/chat-utils.js index bab63bcd5..0cfc97fea 100644 --- a/node_modules/@adiwajshing/baileys/lib/Utils/chat-utils.js +++ b/node_modules/@adiwajshing/baileys/lib/Utils/chat-utils.js @@ -1,6 +1,6 @@ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -exports.chatModificationToAppPatch = exports.decodePatches = exports.decodeSyncdSnapshot = exports.downloadExternalPatch = exports.downloadExternalBlob = exports.extractSyncdPatches = exports.decodeSyncdPatch = exports.decodeSyncdMutations = exports.encodeSyncdPatch = exports.newLTHashState = void 0; +exports.processSyncActions = exports.chatModificationToAppPatch = exports.decodePatches = exports.decodeSyncdSnapshot = exports.downloadExternalPatch = exports.downloadExternalBlob = exports.extractSyncdPatches = exports.decodeSyncdPatch = exports.decodeSyncdMutations = exports.encodeSyncdPatch = exports.newLTHashState = void 0; const boom_1 = require("@hapi/boom"); const WAProto_1 = require("../../WAProto"); const WABinary_1 = require("../WABinary"); @@ -437,3 +437,66 @@ const chatModificationToAppPatch = (mod, jid) => { return patch; }; exports.chatModificationToAppPatch = chatModificationToAppPatch; +const processSyncActions = (actions, me, logger) => { + var _a, _b, _c, _d, _e; + const map = {}; + const updates = {}; + const contactUpdates = {}; + const msgDeletes = []; + for (const { syncAction: { value: action }, index: [_, id, msgId, fromMe] } of actions) { + const update = { id }; + if (action === null || action === void 0 ? void 0 : action.muteAction) { + update.mute = ((_a = action.muteAction) === null || _a === void 0 ? void 0 : _a.muted) ? + generics_1.toNumber(action.muteAction.muteEndTimestamp) : + undefined; + } + else if (action === null || action === void 0 ? void 0 : action.archiveChatAction) { + update.archive = !!((_b = action.archiveChatAction) === null || _b === void 0 ? void 0 : _b.archived); + } + else if (action === null || action === void 0 ? void 0 : action.markChatAsReadAction) { + update.unreadCount = !!((_c = action.markChatAsReadAction) === null || _c === void 0 ? void 0 : _c.read) ? 0 : -1; + } + else if (action === null || action === void 0 ? void 0 : action.clearChatAction) { + msgDeletes.push({ + remoteJid: id, + id: msgId, + fromMe: fromMe === '1' + }); + } + else if (action === null || action === void 0 ? void 0 : action.contactAction) { + contactUpdates[id] = { + ...(contactUpdates[id] || {}), + id, + name: action.contactAction.fullName + }; + } + else if (action === null || action === void 0 ? void 0 : action.pushNameSetting) { + map['creds.update'] = { + me: { ...me, name: (_d = action === null || action === void 0 ? void 0 : action.pushNameSetting) === null || _d === void 0 ? void 0 : _d.name } + }; + } + else if (action === null || action === void 0 ? void 0 : action.pinAction) { + update.pin = ((_e = action.pinAction) === null || _e === void 0 ? void 0 : _e.pinned) ? generics_1.toNumber(action.timestamp) : undefined; + } + else { + logger.warn({ action, id }, 'unprocessable update'); + } + if (Object.keys(update).length > 1) { + updates[update.id] = { + ...(updates[update.id] || {}), + ...update + }; + } + } + if (Object.values(updates).length) { + map['chats.update'] = Object.values(updates); + } + if (Object.values(contactUpdates).length) { + map['contacts.upsert'] = Object.values(contactUpdates); + } + if (msgDeletes.length) { + map['messages.delete'] = { keys: msgDeletes }; + } + return map; +}; +exports.processSyncActions = processSyncActions; diff --git a/node_modules/@adiwajshing/baileys/lib/Utils/.trashed-1649374382-crypto.d.ts b/node_modules/@adiwajshing/baileys/lib/Utils/crypto.d.ts similarity index 100% rename from node_modules/@adiwajshing/baileys/lib/Utils/.trashed-1649374382-crypto.d.ts rename to node_modules/@adiwajshing/baileys/lib/Utils/crypto.d.ts diff --git a/node_modules/@adiwajshing/baileys/lib/Utils/crypto.d_1.ts b/node_modules/@adiwajshing/baileys/lib/Utils/crypto.d_1.ts deleted file mode 100644 index 75241a4d1..000000000 --- a/node_modules/@adiwajshing/baileys/lib/Utils/crypto.d_1.ts +++ /dev/null @@ -1,25 +0,0 @@ -/// -import { KeyPair } from '../Types'; -export declare const Curve: { - generateKeyPair: () => KeyPair; - sharedKey: (privateKey: Uint8Array, publicKey: Uint8Array) => Buffer; - sign: (privateKey: Uint8Array, buf: Uint8Array) => Buffer; - verify: (pubKey: Uint8Array, message: Uint8Array, signature: Uint8Array) => boolean; -}; -export declare const signedKeyPair: (keyPair: KeyPair, keyId: number) => { - keyPair: KeyPair; - signature: Buffer; - keyId: number; -}; -/** decrypt AES 256 CBC; where the IV is prefixed to the buffer */ -export declare function aesDecrypt(buffer: Buffer, key: Buffer): Buffer; -/** decrypt AES 256 CBC */ -export declare function aesDecryptWithIV(buffer: Buffer, key: Buffer, IV: Buffer): Buffer; -export declare function aesEncrypt(buffer: Buffer | Uint8Array, key: Buffer): Buffer; -export declare function aesEncrypWithIV(buffer: Buffer, key: Buffer, IV: Buffer): Buffer; -export declare function hmacSign(buffer: Buffer | Uint8Array, key: Buffer | Uint8Array, variant?: 'sha256' | 'sha512'): Buffer; -export declare function sha256(buffer: Buffer): Buffer; -export declare function hkdf(buffer: Uint8Array, expandedLength: number, { info, salt }: { - salt?: Buffer; - info?: string; -}): Buffer; diff --git a/node_modules/@adiwajshing/baileys/lib/Utils/decode-wa-message.d.ts b/node_modules/@adiwajshing/baileys/lib/Utils/decode-wa-message.d.ts new file mode 100644 index 000000000..b3e12cb8d --- /dev/null +++ b/node_modules/@adiwajshing/baileys/lib/Utils/decode-wa-message.d.ts @@ -0,0 +1,9 @@ +import { proto } from '../../WAProto'; +import { AuthenticationState } from '../Types'; +import { BinaryNode } from '../WABinary'; +export declare const decodeMessageStanza: (stanza: BinaryNode, auth: AuthenticationState) => { + fullMessage: proto.IWebMessageInfo; + category: string; + author: string; + decryptionTask: Promise; +}; diff --git a/node_modules/@adiwajshing/baileys/lib/Utils/decode-wa-message.d_1.ts b/node_modules/@adiwajshing/baileys/lib/Utils/decode-wa-message.d_1.ts deleted file mode 100644 index e0a62f720..000000000 --- a/node_modules/@adiwajshing/baileys/lib/Utils/decode-wa-message.d_1.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { proto } from '../../WAProto'; -import { AuthenticationState } from '../Types'; -import { BinaryNode } from '../WABinary'; -export declare const decodeMessageStanza: (stanza: BinaryNode, auth: AuthenticationState) => { - fullMessage: proto.IWebMessageInfo; - decryptionTask: Promise; -}; diff --git a/node_modules/@adiwajshing/baileys/lib/Utils/decode-wa-message.js b/node_modules/@adiwajshing/baileys/lib/Utils/decode-wa-message.js index 36f0aadc8..4737b9c58 100644 --- a/node_modules/@adiwajshing/baileys/lib/Utils/decode-wa-message.js +++ b/node_modules/@adiwajshing/baileys/lib/Utils/decode-wa-message.js @@ -70,6 +70,8 @@ const decodeMessageStanza = (stanza, auth) => { } return { fullMessage, + category: stanza.attrs.category, + author, decryptionTask: (async () => { var _a; let decryptables = 0; diff --git a/node_modules/@adiwajshing/baileys/lib/Utils/generics.d.ts b/node_modules/@adiwajshing/baileys/lib/Utils/generics.d.ts new file mode 100644 index 000000000..a4d22d64c --- /dev/null +++ b/node_modules/@adiwajshing/baileys/lib/Utils/generics.d.ts @@ -0,0 +1,57 @@ +/// +import { Logger } from 'pino'; +import { proto } from '../../WAProto'; +import { CommonBaileysEventEmitter, ConnectionState, WAVersion } from '../Types'; +export declare const Browsers: { + ubuntu: (browser: any) => [string, string, string]; + macOS: (browser: any) => [string, string, string]; + baileys: (browser: any) => [string, string, string]; + /** The appropriate browser based on your OS & release */ + appropriate: (browser: any) => [string, string, string]; +}; +export declare const BufferJSON: { + replacer: (k: any, value: any) => any; + reviver: (_: any, value: any) => any; +}; +export declare const writeRandomPadMax16: (e: any) => any; +export declare const unpadRandomMax16: (e: Uint8Array | Buffer) => Uint8Array; +export declare const encodeWAMessage: (message: proto.IMessage) => Buffer; +export declare const generateRegistrationId: () => number; +export declare const encodeInt: (e: number, t: number) => Uint8Array; +export declare const encodeBigEndian: (e: number, t?: number) => Uint8Array; +export declare const toNumber: (t: Long | number) => any; +export declare function shallowChanges(old: T, current: T, { lookForDeletedKeys }: { + lookForDeletedKeys: boolean; +}): Partial; +/** unix timestamp of a date in seconds */ +export declare const unixTimestampSeconds: (date?: Date) => number; +export declare type DebouncedTimeout = ReturnType; +export declare const debouncedTimeout: (intervalMs?: number, task?: () => void) => { + start: (newIntervalMs?: number, newTask?: () => void) => void; + cancel: () => void; + setTask: (newTask: () => void) => () => void; + setInterval: (newInterval: number) => number; +}; +export declare const delay: (ms: number) => Promise; +export declare const delayCancellable: (ms: number) => { + delay: Promise; + cancel: () => void; +}; +export declare function promiseTimeout(ms: number, promise: (resolve: (v?: T) => void, reject: (error: any) => void) => void): Promise; +export declare const generateMessageID: () => string; +export declare const bindWaitForConnectionUpdate: (ev: CommonBaileysEventEmitter) => (check: (u: Partial) => boolean, timeoutMs?: number) => Promise; +export declare const printQRIfNecessaryListener: (ev: CommonBaileysEventEmitter, logger: Logger) => void; +/** + * utility that fetches latest baileys version from the master branch. + * Use to ensure your WA connection is always on the latest version + */ +export declare const fetchLatestBaileysVersion: () => Promise<{ + version: WAVersion; + isLatest: boolean; + error?: undefined; +} | { + version: WAVersion; + isLatest: boolean; + error: any; +}>; +export declare const getStatusFromReceiptType: (type: string | undefined) => proto.WebMessageInfo.WebMessageInfoStatus; diff --git a/node_modules/@adiwajshing/baileys/lib/Utils/generics.d_1.ts b/node_modules/@adiwajshing/baileys/lib/Utils/generics.d_1.ts deleted file mode 100644 index 98dec7fe1..000000000 --- a/node_modules/@adiwajshing/baileys/lib/Utils/generics.d_1.ts +++ /dev/null @@ -1,56 +0,0 @@ -/// -import { Logger } from 'pino'; -import { proto } from '../../WAProto'; -import { CommonBaileysEventEmitter, ConnectionState, WAVersion } from '../Types'; -export declare const Browsers: { - ubuntu: (browser: any) => [string, string, string]; - macOS: (browser: any) => [string, string, string]; - baileys: (browser: any) => [string, string, string]; - /** The appropriate browser based on your OS & release */ - appropriate: (browser: any) => [string, string, string]; -}; -export declare const BufferJSON: { - replacer: (k: any, value: any) => any; - reviver: (_: any, value: any) => any; -}; -export declare const writeRandomPadMax16: (e: any) => any; -export declare const unpadRandomMax16: (e: Uint8Array | Buffer) => Uint8Array; -export declare const encodeWAMessage: (message: proto.IMessage) => Buffer; -export declare const generateRegistrationId: () => number; -export declare const encodeInt: (e: number, t: number) => Uint8Array; -export declare const encodeBigEndian: (e: number, t?: number) => Uint8Array; -export declare const toNumber: (t: Long | number) => number; -export declare function shallowChanges(old: T, current: T, { lookForDeletedKeys }: { - lookForDeletedKeys: boolean; -}): Partial; -/** unix timestamp of a date in seconds */ -export declare const unixTimestampSeconds: (date?: Date) => number; -export declare type DebouncedTimeout = ReturnType; -export declare const debouncedTimeout: (intervalMs?: number, task?: () => void) => { - start: (newIntervalMs?: number, newTask?: () => void) => void; - cancel: () => void; - setTask: (newTask: () => void) => () => void; - setInterval: (newInterval: number) => number; -}; -export declare const delay: (ms: number) => Promise; -export declare const delayCancellable: (ms: number) => { - delay: Promise; - cancel: () => void; -}; -export declare function promiseTimeout(ms: number, promise: (resolve: (v?: T) => void, reject: (error: any) => void) => void): Promise; -export declare const generateMessageID: () => string; -export declare const bindWaitForConnectionUpdate: (ev: CommonBaileysEventEmitter) => (check: (u: Partial) => boolean, timeoutMs?: number) => Promise; -export declare const printQRIfNecessaryListener: (ev: CommonBaileysEventEmitter, logger: Logger) => void; -/** - * utility that fetches latest baileys version from the master branch. - * Use to ensure your WA connection is always on the latest version - */ -export declare const fetchLatestBaileysVersion: () => Promise<{ - version: WAVersion; - isLatest: boolean; - error?: undefined; -} | { - version: WAVersion; - isLatest: boolean; - error: any; -}>; diff --git a/node_modules/@adiwajshing/baileys/lib/Utils/generics.js b/node_modules/@adiwajshing/baileys/lib/Utils/generics.js index b24b46ffa..f54e0b2c1 100644 --- a/node_modules/@adiwajshing/baileys/lib/Utils/generics.js +++ b/node_modules/@adiwajshing/baileys/lib/Utils/generics.js @@ -22,7 +22,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); -exports.fetchLatestBaileysVersion = exports.printQRIfNecessaryListener = exports.bindWaitForConnectionUpdate = exports.generateMessageID = exports.promiseTimeout = exports.delayCancellable = exports.delay = exports.debouncedTimeout = exports.unixTimestampSeconds = exports.shallowChanges = exports.toNumber = exports.encodeBigEndian = exports.encodeInt = exports.generateRegistrationId = exports.encodeWAMessage = exports.unpadRandomMax16 = exports.writeRandomPadMax16 = exports.BufferJSON = exports.Browsers = void 0; +exports.getStatusFromReceiptType = exports.fetchLatestBaileysVersion = exports.printQRIfNecessaryListener = exports.bindWaitForConnectionUpdate = exports.generateMessageID = exports.promiseTimeout = exports.delayCancellable = exports.delay = exports.debouncedTimeout = exports.unixTimestampSeconds = exports.shallowChanges = exports.toNumber = exports.encodeBigEndian = exports.encodeInt = exports.generateRegistrationId = exports.encodeWAMessage = exports.unpadRandomMax16 = exports.writeRandomPadMax16 = exports.BufferJSON = exports.Browsers = void 0; const boom_1 = require("@hapi/boom"); const axios_1 = __importDefault(require("axios")); const crypto_1 = require("crypto"); @@ -38,8 +38,8 @@ const PLATFORM_MAP = { 'android': 'Android' }; exports.Browsers = { - ubuntu: browser => ['Ubuntu', browser, '18.04'], - macOS: browser => ['Mac OS', browser, '10.15.3'], + ubuntu: browser => ['Ubuntu', browser, '20.0.04'], + macOS: browser => ['Mac OS', browser, '10.15.7'], baileys: browser => ['Baileys', browser, '4.0.0'], /** The appropriate browser based on your OS & release */ appropriate: browser => [PLATFORM_MAP[os_1.platform()] || 'Ubuntu', browser, os_1.release()] @@ -54,7 +54,7 @@ exports.BufferJSON = { reviver: (_, value) => { if (typeof value === 'object' && !!value && (value.buffer === true || value.type === 'Buffer')) { const val = value.data || value.value; - return typeof val === 'string' ? Buffer.from(val, 'base64') : Buffer.from(val); + return typeof val === 'string' ? Buffer.from(val, 'base64') : Buffer.from(val || []); } return value; } @@ -104,7 +104,7 @@ const encodeBigEndian = (e, t = 4) => { return a; }; exports.encodeBigEndian = encodeBigEndian; -const toNumber = (t) => ((typeof t === 'object' && 'toNumber' in t) ? t.toNumber() : t); +const toNumber = (t) => ((typeof t === 'object' && t) ? ('toNumber' in t ? t.toNumber() : t.low) : t); exports.toNumber = toNumber; function shallowChanges(old, current, { lookForDeletedKeys }) { const changes = {}; @@ -241,3 +241,16 @@ const fetchLatestBaileysVersion = async () => { } }; exports.fetchLatestBaileysVersion = fetchLatestBaileysVersion; +const STATUS_MAP = { + 'played': WAProto_1.proto.WebMessageInfo.WebMessageInfoStatus.PLAYED, + 'read': WAProto_1.proto.WebMessageInfo.WebMessageInfoStatus.READ, + 'read-self': WAProto_1.proto.WebMessageInfo.WebMessageInfoStatus.READ +}; +const getStatusFromReceiptType = (type) => { + const status = STATUS_MAP[type]; + if (typeof type === 'undefined') { + return WAProto_1.proto.WebMessageInfo.WebMessageInfoStatus.DELIVERY_ACK; + } + return status; +}; +exports.getStatusFromReceiptType = getStatusFromReceiptType; diff --git a/node_modules/@adiwajshing/baileys/lib/Utils/.trashed-1649374382-history.d.ts b/node_modules/@adiwajshing/baileys/lib/Utils/history.d.ts similarity index 100% rename from node_modules/@adiwajshing/baileys/lib/Utils/.trashed-1649374382-history.d.ts rename to node_modules/@adiwajshing/baileys/lib/Utils/history.d.ts diff --git a/node_modules/@adiwajshing/baileys/lib/Utils/history.d_1.ts b/node_modules/@adiwajshing/baileys/lib/Utils/history.d_1.ts deleted file mode 100644 index 778420a87..000000000 --- a/node_modules/@adiwajshing/baileys/lib/Utils/history.d_1.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { proto } from '../../WAProto'; -import { Chat, Contact } from '../Types'; -export declare const downloadHistory: (msg: proto.IHistorySyncNotification) => Promise; -export declare const processHistoryMessage: (item: proto.IHistorySync, historyCache: Set) => { - chats: Chat[]; - contacts: Contact[]; - messages: proto.IWebMessageInfo[]; - isLatest: boolean; -}; -export declare const downloadAndProcessHistorySyncNotification: (msg: proto.IHistorySyncNotification, historyCache: Set) => Promise<{ - chats: Chat[]; - contacts: Contact[]; - messages: proto.IWebMessageInfo[]; - isLatest: boolean; -}>; diff --git a/node_modules/@adiwajshing/baileys/lib/Utils/history.js b/node_modules/@adiwajshing/baileys/lib/Utils/history.js index 7c82634cb..4be661f73 100644 --- a/node_modules/@adiwajshing/baileys/lib/Utils/history.js +++ b/node_modules/@adiwajshing/baileys/lib/Utils/history.js @@ -29,15 +29,12 @@ const processHistoryMessage = (item, historyCache) => { for (const chat of item.conversations) { const contactId = `c:${chat.id}`; if (chat.name && !historyCache.has(contactId)) { - contacts.push({ - id: chat.id, - name: chat.name - }); + contacts.push({ id: chat.id, name: chat.name }); historyCache.add(contactId); } for (const { message } of chat.messages || []) { - const uqId = `${message === null || message === void 0 ? void 0 : message.key.remoteJid}:${message.key.id}`; - if (message && !historyCache.has(uqId)) { + const uqId = `${message.key.remoteJid}:${message.key.id}`; + if (!historyCache.has(uqId)) { messages.push(message); historyCache.add(uqId); } @@ -52,7 +49,7 @@ const processHistoryMessage = (item, historyCache) => { case WAProto_1.proto.HistorySync.HistorySyncHistorySyncType.PUSH_NAME: for (const c of item.pushnames) { const contactId = `c:${c.id}`; - if (historyCache.has(contactId)) { + if (!historyCache.has(contactId)) { contacts.push({ notify: c.pushname, id: c.id }); historyCache.add(contactId); } diff --git a/node_modules/@adiwajshing/baileys/lib/Utils/index.d.ts b/node_modules/@adiwajshing/baileys/lib/Utils/index.d.ts new file mode 100644 index 000000000..2a7638387 --- /dev/null +++ b/node_modules/@adiwajshing/baileys/lib/Utils/index.d.ts @@ -0,0 +1,14 @@ +export * from './decode-wa-message'; +export * from './generics'; +export * from './messages'; +export * from './messages-media'; +export * from './validate-connection'; +export * from './crypto'; +export * from './signal'; +export * from './noise-handler'; +export * from './history'; +export * from './chat-utils'; +export * from './lt-hash'; +export * from './auth-utils'; +export * from './legacy-msgs'; +export * from './baileys-event-stream'; diff --git a/node_modules/@adiwajshing/baileys/lib/Utils/index.d_1.ts b/node_modules/@adiwajshing/baileys/lib/Utils/index.d_1.ts deleted file mode 100644 index 38d5b911f..000000000 --- a/node_modules/@adiwajshing/baileys/lib/Utils/index.d_1.ts +++ /dev/null @@ -1,13 +0,0 @@ -export * from './decode-wa-message'; -export * from './generics'; -export * from './messages'; -export * from './messages-media'; -export * from './validate-connection'; -export * from './crypto'; -export * from './signal'; -export * from './noise-handler'; -export * from './history'; -export * from './chat-utils'; -export * from './lt-hash'; -export * from './auth-utils'; -export * from './legacy-msgs'; diff --git a/node_modules/@adiwajshing/baileys/lib/Utils/index.js b/node_modules/@adiwajshing/baileys/lib/Utils/index.js index 38c9e7055..98a0ea276 100644 --- a/node_modules/@adiwajshing/baileys/lib/Utils/index.js +++ b/node_modules/@adiwajshing/baileys/lib/Utils/index.js @@ -23,3 +23,4 @@ __exportStar(require("./chat-utils"), exports); __exportStar(require("./lt-hash"), exports); __exportStar(require("./auth-utils"), exports); __exportStar(require("./legacy-msgs"), exports); +__exportStar(require("./baileys-event-stream"), exports); diff --git a/node_modules/@adiwajshing/baileys/lib/Utils/.trashed-1649374382-legacy-msgs.d.ts b/node_modules/@adiwajshing/baileys/lib/Utils/legacy-msgs.d.ts similarity index 100% rename from node_modules/@adiwajshing/baileys/lib/Utils/.trashed-1649374382-legacy-msgs.d.ts rename to node_modules/@adiwajshing/baileys/lib/Utils/legacy-msgs.d.ts diff --git a/node_modules/@adiwajshing/baileys/lib/Utils/legacy-msgs.d_1.ts b/node_modules/@adiwajshing/baileys/lib/Utils/legacy-msgs.d_1.ts deleted file mode 100644 index ea54566a3..000000000 --- a/node_modules/@adiwajshing/baileys/lib/Utils/legacy-msgs.d_1.ts +++ /dev/null @@ -1,25 +0,0 @@ -/// -import { AuthenticationCreds, Contact, CurveKeyPair, LegacyAuthenticationCreds, WATag } from '../Types'; -export declare const newLegacyAuthCreds: () => LegacyAuthenticationCreds; -export declare const decodeWAMessage: (message: Buffer | string, auth: { - macKey: Buffer; - encKey: Buffer; -}, fromMe?: boolean) => readonly [string, any, WATag]; -/** -* Once the QR code is scanned and we can validate our connection, or we resolved the challenge when logging back in -* @private -* @param json -*/ -export declare const validateNewConnection: (json: { - [_: string]: any; -}, auth: LegacyAuthenticationCreds, curveKeys: CurveKeyPair) => { - user: Contact; - auth: LegacyAuthenticationCreds; - phone: any; -}; -export declare const computeChallengeResponse: (challenge: string, auth: LegacyAuthenticationCreds) => string[]; -export declare const useSingleFileLegacyAuthState: (file: string) => { - state: LegacyAuthenticationCreds; - saveState: () => void; -}; -export declare const getAuthenticationCredsType: (creds: LegacyAuthenticationCreds | AuthenticationCreds) => "legacy" | "md"; diff --git a/node_modules/@adiwajshing/baileys/lib/Utils/logger.d.ts b/node_modules/@adiwajshing/baileys/lib/Utils/logger.d.ts new file mode 100644 index 000000000..1c5544483 --- /dev/null +++ b/node_modules/@adiwajshing/baileys/lib/Utils/logger.d.ts @@ -0,0 +1,4 @@ +declare const _default: import("pino").Logger<{ + timestamp: () => string; +}>; +export default _default; diff --git a/node_modules/@adiwajshing/baileys/lib/Utils/logger.js b/node_modules/@adiwajshing/baileys/lib/Utils/logger.js new file mode 100644 index 000000000..b1d95f3ca --- /dev/null +++ b/node_modules/@adiwajshing/baileys/lib/Utils/logger.js @@ -0,0 +1,7 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const pino_1 = __importDefault(require("pino")); +exports.default = pino_1.default({ timestamp: () => `,"time":"${new Date().toJSON()}"` }); diff --git a/node_modules/@adiwajshing/baileys/lib/Utils/.trashed-1649374382-lt-hash.d.ts b/node_modules/@adiwajshing/baileys/lib/Utils/lt-hash.d.ts similarity index 100% rename from node_modules/@adiwajshing/baileys/lib/Utils/.trashed-1649374382-lt-hash.d.ts rename to node_modules/@adiwajshing/baileys/lib/Utils/lt-hash.d.ts diff --git a/node_modules/@adiwajshing/baileys/lib/Utils/lt-hash.d_1.ts b/node_modules/@adiwajshing/baileys/lib/Utils/lt-hash.d_1.ts deleted file mode 100644 index 76f343c9d..000000000 --- a/node_modules/@adiwajshing/baileys/lib/Utils/lt-hash.d_1.ts +++ /dev/null @@ -1,12 +0,0 @@ -declare class d { - salt: string; - constructor(e: string); - add(e: any, t: any): any; - subtract(e: any, t: any): any; - subtractThenAdd(e: any, t: any, r: any): any; - _addSingle(e: any, t: any): ArrayBuffer; - _subtractSingle(e: any, t: any): ArrayBuffer; - performPointwiseWithOverflow(e: any, t: any, r: any): ArrayBuffer; -} -export declare const LT_HASH_ANTI_TAMPERING: d; -export {}; diff --git a/node_modules/@adiwajshing/baileys/lib/Utils/.trashed-1649374382-make-mutex.d.ts b/node_modules/@adiwajshing/baileys/lib/Utils/make-mutex.d.ts similarity index 100% rename from node_modules/@adiwajshing/baileys/lib/Utils/.trashed-1649374382-make-mutex.d.ts rename to node_modules/@adiwajshing/baileys/lib/Utils/make-mutex.d.ts diff --git a/node_modules/@adiwajshing/baileys/lib/Utils/make-mutex.d_1.ts b/node_modules/@adiwajshing/baileys/lib/Utils/make-mutex.d_1.ts deleted file mode 100644 index 087a10190..000000000 --- a/node_modules/@adiwajshing/baileys/lib/Utils/make-mutex.d_1.ts +++ /dev/null @@ -1,7 +0,0 @@ -export declare const makeMutex: () => { - mutex(code: () => T | Promise): Promise; -}; -export declare type Mutex = ReturnType; -export declare const makeKeyedMutex: () => { - mutex(key: string, task: () => T | Promise): Promise; -}; diff --git a/node_modules/@adiwajshing/baileys/lib/Utils/messages-media.d.ts b/node_modules/@adiwajshing/baileys/lib/Utils/messages-media.d.ts new file mode 100644 index 000000000..8373b9173 --- /dev/null +++ b/node_modules/@adiwajshing/baileys/lib/Utils/messages-media.d.ts @@ -0,0 +1,50 @@ +/// +import { AxiosRequestConfig } from 'axios'; +import type { Logger } from 'pino'; +import { Readable, Transform } from 'stream'; +import { URL } from 'url'; +import { CommonSocketConfig, DownloadableMessage, MediaConnInfo, MediaType, WAMediaUpload, WAMediaUploadFunction, WAMessageContent } from '../Types'; +export declare const hkdfInfoKey: (type: MediaType) => string; +/** generates all the keys required to encrypt/decrypt & sign a media message */ +export declare function getMediaKeys(buffer: any, mediaType: MediaType): { + iv: Buffer; + cipherKey: Buffer; + macKey: Buffer; +}; +export declare const extractImageThumb: (bufferOrFilePath: Readable | Buffer | string) => Promise; +export declare const generateProfilePicture: (mediaUpload: WAMediaUpload) => Promise<{ + img: Buffer; +}>; +/** gets the SHA256 of the given media message */ +export declare const mediaMessageSHA256B64: (message: WAMessageContent) => string; +export declare function getAudioDuration(buffer: Buffer | string | Readable): Promise; +export declare const toReadable: (buffer: Buffer) => Readable; +export declare const toBuffer: (stream: Readable) => Promise; +export declare const getStream: (item: WAMediaUpload) => Promise<{ + stream: Readable; + type: string; +}>; +/** generates a thumbnail for a given media, if required */ +export declare function generateThumbnail(file: string, mediaType: 'video' | 'image', options: { + logger?: Logger; +}): Promise; +export declare const getHttpStream: (url: string | URL, options?: AxiosRequestConfig & { + isStream?: true; +}) => Promise; +export declare const encryptedStream: (media: WAMediaUpload, mediaType: MediaType, saveOriginalFileIfRequired?: boolean, logger?: Logger) => Promise<{ + mediaKey: Buffer; + encWriteStream: Readable; + bodyPath: string; + mac: Buffer; + fileEncSha256: Buffer; + fileSha256: Buffer; + fileLength: number; + didSaveToTmpPath: boolean; +}>; +export declare type MediaDownloadOptions = { + startByte?: number; + endByte?: number; +}; +export declare const downloadContentFromMessage: ({ mediaKey, directPath, url }: DownloadableMessage, type: MediaType, { startByte, endByte }?: MediaDownloadOptions) => Promise; +export declare function extensionForMediaMessage(message: WAMessageContent): string; +export declare const getWAUploadToServer: ({ customUploadHosts, fetchAgent, logger }: CommonSocketConfig, refreshMediaConn: (force: boolean) => Promise) => WAMediaUploadFunction; diff --git a/node_modules/@adiwajshing/baileys/lib/Utils/messages-media.d_1.ts b/node_modules/@adiwajshing/baileys/lib/Utils/messages-media.d_1.ts deleted file mode 100644 index 872f12919..000000000 --- a/node_modules/@adiwajshing/baileys/lib/Utils/messages-media.d_1.ts +++ /dev/null @@ -1,56 +0,0 @@ -/// -import { AxiosRequestConfig } from 'axios'; -import type { Logger } from 'pino'; -import { Readable, Transform } from 'stream'; -import { URL } from 'url'; -import { CommonSocketConfig, DownloadableMessage, MediaConnInfo, MediaType, WAMediaUpload, WAMediaUploadFunction, WAMessageContent } from '../Types'; -export declare const hkdfInfoKey: (type: MediaType) => string; -/** generates all the keys required to encrypt/decrypt & sign a media message */ -export declare function getMediaKeys(buffer: any, mediaType: MediaType): { - iv: Buffer; - cipherKey: Buffer; - macKey: Buffer; -}; -export declare const extractImageThumb: (bufferOrFilePath: Readable | Buffer | string) => Promise; -export declare const generateProfilePicture: (mediaUpload: WAMediaUpload) => Promise<{ - img: Buffer; -}>; -/** gets the SHA256 of the given media message */ -export declare const mediaMessageSHA256B64: (message: WAMessageContent) => string; -export declare function getAudioDuration(buffer: Buffer | string | Readable): Promise; -export declare const toReadable: (buffer: Buffer) => Readable; -export declare const toBuffer: (stream: Readable) => Promise; -export declare const getStream: (item: WAMediaUpload) => Promise<{ - stream: Readable; - type: string; -}>; -/** generates a thumbnail for a given media, if required */ -export declare function generateThumbnail(file: string, mediaType: 'video' | 'image', options: { - logger?: Logger; -}): Promise; -export declare const getHttpStream: (url: string | URL, options?: AxiosRequestConfig & { - isStream?: true; -}) => Promise; -export declare const encryptedStream: (media: WAMediaUpload, mediaType: MediaType, saveOriginalFileIfRequired?: boolean, logger?: Logger) => Promise<{ - mediaKey: Buffer; - encWriteStream: Readable; - bodyPath: string; - mac: Buffer; - fileEncSha256: Buffer; - fileSha256: Buffer; - fileLength: number; - didSaveToTmpPath: boolean; -}>; -declare type MediaDownloadOptions = { - startByte?: number; - endByte?: number; -}; -export declare const downloadContentFromMessage: ({ mediaKey, directPath, url }: DownloadableMessage, type: MediaType, { startByte, endByte }?: MediaDownloadOptions) => Promise; -/** - * Decode a media message (video, image, document, audio) & return decrypted buffer - * @param message the media message you want to decode - */ -export declare function decryptMediaMessageBuffer(message: WAMessageContent): Promise; -export declare function extensionForMediaMessage(message: WAMessageContent): string; -export declare const getWAUploadToServer: ({ customUploadHosts, fetchAgent, logger }: CommonSocketConfig, refreshMediaConn: (force: boolean) => Promise) => WAMediaUploadFunction; -export {}; diff --git a/node_modules/@adiwajshing/baileys/lib/Utils/messages-media.js b/node_modules/@adiwajshing/baileys/lib/Utils/messages-media.js index aad378524..6c98e5ce1 100644 --- a/node_modules/@adiwajshing/baileys/lib/Utils/messages-media.js +++ b/node_modules/@adiwajshing/baileys/lib/Utils/messages-media.js @@ -19,7 +19,7 @@ var __importStar = (this && this.__importStar) || function (mod) { return result; }; Object.defineProperty(exports, "__esModule", { value: true }); -exports.getWAUploadToServer = exports.extensionForMediaMessage = exports.decryptMediaMessageBuffer = exports.downloadContentFromMessage = exports.encryptedStream = exports.getHttpStream = exports.generateThumbnail = exports.getStream = exports.toBuffer = exports.toReadable = exports.getAudioDuration = exports.mediaMessageSHA256B64 = exports.generateProfilePicture = exports.extractImageThumb = exports.getMediaKeys = exports.hkdfInfoKey = void 0; +exports.getWAUploadToServer = exports.extensionForMediaMessage = exports.downloadContentFromMessage = exports.encryptedStream = exports.getHttpStream = exports.generateThumbnail = exports.getStream = exports.toBuffer = exports.toReadable = exports.getAudioDuration = exports.mediaMessageSHA256B64 = exports.generateProfilePicture = exports.extractImageThumb = exports.getMediaKeys = exports.hkdfInfoKey = void 0; const boom_1 = require("@hapi/boom"); const child_process_1 = require("child_process"); const Crypto = __importStar(require("crypto")); @@ -79,7 +79,7 @@ function getMediaKeys(buffer, mediaType) { exports.getMediaKeys = getMediaKeys; /** Extracts video thumb using FFMPEG */ const extractVideoThumb = async (path, destPath, time, size) => new Promise((resolve, reject) => { - const cmd = `ffmpeg -ss ${time} -i ${path} -y -s ${size.width}x${size.height} -vframes 1 -f image2 ${destPath}`; + const cmd = `ffmpeg -ss ${time} -i ${path} -y -vf scale=${size.width}:-1 -vframes 1 -f image2 ${destPath}`; child_process_1.exec(cmd, (err) => { if (err) { reject(err); @@ -96,17 +96,17 @@ const extractImageThumb = async (bufferOrFilePath) => { const lib = await getImageProcessingLibrary(); if ('sharp' in lib) { const result = await lib.sharp.default(bufferOrFilePath) - .resize(32, 32) + .resize(32) .jpeg({ quality: 50 }) .toBuffer(); return result; } else { - const { read, MIME_JPEG, RESIZE_BILINEAR } = lib.jimp; + const { read, MIME_JPEG, RESIZE_BILINEAR, AUTO } = lib.jimp; const jimp = await read(bufferOrFilePath); const result = await jimp .quality(50) - .resize(32, 32, RESIZE_BILINEAR) + .resize(32, AUTO, RESIZE_BILINEAR) .getBufferAsync(MIME_JPEG); return result; } @@ -391,43 +391,6 @@ const downloadContentFromMessage = async ({ mediaKey, directPath, url }, type, { return fetched.pipe(output, { end: true }); }; exports.downloadContentFromMessage = downloadContentFromMessage; -/** - * Decode a media message (video, image, document, audio) & return decrypted buffer - * @param message the media message you want to decode - */ -async function decryptMediaMessageBuffer(message) { - var _a; - /* - One can infer media type from the key in the message - it is usually written as [mediaType]Message. Eg. imageMessage, audioMessage etc. - */ - const type = Object.keys(message)[0]; - if (!type || - type === 'conversation' || - type === 'extendedTextMessage') { - throw new boom_1.Boom(`no media message for "${type}"`, { statusCode: 400 }); - } - if (type === 'locationMessage' || type === 'liveLocationMessage') { - const buffer = Buffer.from(message[type].jpegThumbnail); - const readable = new stream_1.Readable({ read: () => { } }); - readable.push(buffer); - readable.push(null); - return readable; - } - let messageContent; - if (message.productMessage) { - const product = (_a = message.productMessage.product) === null || _a === void 0 ? void 0 : _a.productImage; - if (!product) { - throw new boom_1.Boom('product has no image', { statusCode: 400 }); - } - messageContent = product; - } - else { - messageContent = message[type]; - } - return exports.downloadContentFromMessage(messageContent, type.replace('Message', '')); -} -exports.decryptMediaMessageBuffer = decryptMediaMessageBuffer; function extensionForMediaMessage(message) { const getExtension = (mimetype) => mimetype.split(';')[0].split('/')[1]; const type = Object.keys(message)[0]; diff --git a/node_modules/@adiwajshing/baileys/lib/Utils/messages.d.ts b/node_modules/@adiwajshing/baileys/lib/Utils/messages.d.ts new file mode 100644 index 000000000..20185b4fa --- /dev/null +++ b/node_modules/@adiwajshing/baileys/lib/Utils/messages.d.ts @@ -0,0 +1,45 @@ +/// +import { proto } from '../../WAProto'; +import { AnyMediaMessageContent, AnyMessageContent, MediaGenerationOptions, MessageContentGenerationOptions, MessageGenerationOptions, MessageGenerationOptionsFromContent, MessageUserReceipt, WAMessage, WAMessageContent, WAProto } from '../Types'; +import { MediaDownloadOptions } from './messages-media'; +export declare const prepareWAMessageMedia: (message: AnyMediaMessageContent, options: MediaGenerationOptions) => Promise; +export declare const prepareDisappearingMessageSettingContent: (ephemeralExpiration?: number) => proto.Message; +/** + * Generate forwarded message content like WA does + * @param message the message to forward + * @param options.forceForward will show the message as forwarded even if it is from you + */ +export declare const generateForwardMessageContent: (message: WAMessage, forceForward?: boolean) => proto.IMessage; +export declare const generateWAMessageContent: (message: AnyMessageContent, options: MessageContentGenerationOptions) => Promise; +export declare const generateWAMessageFromContent: (jid: string, message: WAMessageContent, options: MessageGenerationOptionsFromContent) => proto.WebMessageInfo; +export declare const generateWAMessage: (jid: string, content: AnyMessageContent, options: MessageGenerationOptions) => Promise; +/** Get the key to access the true type of content */ +export declare const getContentType: (content: WAProto.IMessage | undefined) => keyof proto.IMessage; +/** + * Normalizes ephemeral, view once messages to regular message content + * Eg. image messages in ephemeral messages, in view once messages etc. + * @param content + * @returns + */ +export declare const normalizeMessageContent: (content: WAMessageContent) => WAMessageContent; +/** + * Extract the true message content from a message + * Eg. extracts the inner message from a disappearing message/view once message + */ +export declare const extractMessageContent: (content: WAMessageContent | undefined | null) => WAMessageContent | undefined; +/** + * Returns the device predicted by message ID + */ +export declare const getDevice: (id: string) => "android" | "web" | "ios"; +/** Upserts a receipt in the message */ +export declare const updateMessageWithReceipt: (msg: WAMessage, receipt: MessageUserReceipt) => void; +/** Given a list of message keys, aggregates them by chat & sender. Useful for sending read receipts in bulk */ +export declare const aggregateMessageKeysNotFromMe: (keys: proto.IMessageKey[]) => { + jid: string; + participant: string | undefined; + messageIds: string[]; +}[]; +/** + * Downloads the given message. Throws an error if it's not a media message + */ +export declare const downloadMediaMessage: (message: WAMessage, type: 'buffer' | 'stream', options: MediaDownloadOptions) => Promise; diff --git a/node_modules/@adiwajshing/baileys/lib/Utils/messages.d_1.ts b/node_modules/@adiwajshing/baileys/lib/Utils/messages.d_1.ts deleted file mode 100644 index 339b464e2..000000000 --- a/node_modules/@adiwajshing/baileys/lib/Utils/messages.d_1.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { proto } from '../../WAProto'; -import { AnyMediaMessageContent, AnyMessageContent, MediaGenerationOptions, MessageContentGenerationOptions, MessageGenerationOptions, MessageGenerationOptionsFromContent, MessageUserReceipt, WAMessage, WAMessageContent, WAProto } from '../Types'; -export declare const prepareWAMessageMedia: (message: AnyMediaMessageContent, options: MediaGenerationOptions) => Promise; -export declare const prepareDisappearingMessageSettingContent: (ephemeralExpiration?: number) => proto.Message; -/** - * Generate forwarded message content like WA does - * @param message the message to forward - * @param options.forceForward will show the message as forwarded even if it is from you - */ -export declare const generateForwardMessageContent: (message: WAMessage, forceForward?: boolean) => proto.IMessage; -export declare const generateWAMessageContent: (message: AnyMessageContent, options: MessageContentGenerationOptions) => Promise; -export declare const generateWAMessageFromContent: (jid: string, message: WAMessageContent, options: MessageGenerationOptionsFromContent) => proto.WebMessageInfo; -export declare const generateWAMessage: (jid: string, content: AnyMessageContent, options: MessageGenerationOptions) => Promise; -/** Get the key to access the true type of content */ -export declare const getContentType: (content: WAProto.IMessage | undefined) => keyof proto.IMessage; -/** - * Extract the true message content from a message - * Eg. extracts the inner message from a disappearing message/view once message - */ -export declare const extractMessageContent: (content: WAMessageContent | undefined | null) => WAMessageContent | undefined; -/** - * Returns the device predicted by message ID - */ -export declare const getDevice: (id: string) => "android" | "web" | "ios"; -export declare const updateMessageWithReceipt: (msg: WAMessage, receipt: MessageUserReceipt) => void; diff --git a/node_modules/@adiwajshing/baileys/lib/Utils/messages.js b/node_modules/@adiwajshing/baileys/lib/Utils/messages.js index fc276acb3..162d3da8f 100644 --- a/node_modules/@adiwajshing/baileys/lib/Utils/messages.js +++ b/node_modules/@adiwajshing/baileys/lib/Utils/messages.js @@ -1,6 +1,6 @@ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -exports.updateMessageWithReceipt = exports.getDevice = exports.extractMessageContent = exports.getContentType = exports.generateWAMessage = exports.generateWAMessageFromContent = exports.generateWAMessageContent = exports.generateForwardMessageContent = exports.prepareDisappearingMessageSettingContent = exports.prepareWAMessageMedia = void 0; +exports.downloadMediaMessage = exports.aggregateMessageKeysNotFromMe = exports.updateMessageWithReceipt = exports.getDevice = exports.extractMessageContent = exports.normalizeMessageContent = exports.getContentType = exports.generateWAMessage = exports.generateWAMessageFromContent = exports.generateWAMessageContent = exports.generateForwardMessageContent = exports.prepareDisappearingMessageSettingContent = exports.prepareWAMessageMedia = void 0; const boom_1 = require("@hapi/boom"); const fs_1 = require("fs"); const WAProto_1 = require("../../WAProto"); @@ -150,7 +150,8 @@ const generateForwardMessageContent = (message, forceForward) => { throw new boom_1.Boom('no content in message', { statusCode: 400 }); } // hacky copy - content = WAProto_1.proto.Message.decode(WAProto_1.proto.Message.encode(message.message).finish()); + content = exports.normalizeMessageContent(message.message); + content = WAProto_1.proto.Message.decode(WAProto_1.proto.Message.encode(content).finish()); let key = Object.keys(content)[0]; let score = ((_a = content[key].contextInfo) === null || _a === void 0 ? void 0 : _a.forwardingScore) || 0; score += message.key.fromMe && !forceForward ? 0 : 1; @@ -204,6 +205,12 @@ const generateWAMessageContent = async (message, options) => { else if ('location' in message) { m.locationMessage = Types_1.WAProto.LocationMessage.fromObject(message.location); } + else if ('react' in message) { + if(!message.react.senderTimestampMs) { + message.react.senderTimestampMs = Date.now() + } + m.reactionMessage = Types_1.WAProto.ReactionMessage.fromObject(message.react); + } else if ('delete' in message) { m.protocolMessage = { key: message.delete, @@ -354,12 +361,28 @@ const getContentType = (content) => { } }; exports.getContentType = getContentType; +/** + * Normalizes ephemeral, view once messages to regular message content + * Eg. image messages in ephemeral messages, in view once messages etc. + * @param content + * @returns + */ +const normalizeMessageContent = (content) => { + var _a, _b, _c, _d, _e; + content = ((_c = (_b = (_a = content === null || content === void 0 ? void 0 : content.ephemeralMessage) === null || _a === void 0 ? void 0 : _a.message) === null || _b === void 0 ? void 0 : _b.viewOnceMessage) === null || _c === void 0 ? void 0 : _c.message) || + ((_d = content === null || content === void 0 ? void 0 : content.ephemeralMessage) === null || _d === void 0 ? void 0 : _d.message) || + ((_e = content === null || content === void 0 ? void 0 : content.viewOnceMessage) === null || _e === void 0 ? void 0 : _e.message) || + content || + undefined; + return content; +}; +exports.normalizeMessageContent = normalizeMessageContent; /** * Extract the true message content from a message * Eg. extracts the inner message from a disappearing message/view once message */ const extractMessageContent = (content) => { - var _a, _b, _c, _d, _e, _f, _g, _h; + var _a, _b, _c, _d, _e, _f; const extractFromTemplateMessage = (msg) => { if (msg.imageMessage) { return { imageMessage: msg.imageMessage }; @@ -377,21 +400,18 @@ const extractMessageContent = (content) => { return { conversation: 'contentText' in msg ? msg.contentText : ('hydratedContentText' in msg ? msg.hydratedContentText : '') }; } }; - content = ((_a = content === null || content === void 0 ? void 0 : content.ephemeralMessage) === null || _a === void 0 ? void 0 : _a.message) || - ((_b = content === null || content === void 0 ? void 0 : content.viewOnceMessage) === null || _b === void 0 ? void 0 : _b.message) || - content || - undefined; + content = exports.normalizeMessageContent(content); if (content === null || content === void 0 ? void 0 : content.buttonsMessage) { return extractFromTemplateMessage(content.buttonsMessage); } - if ((_c = content === null || content === void 0 ? void 0 : content.templateMessage) === null || _c === void 0 ? void 0 : _c.hydratedFourRowTemplate) { - return extractFromTemplateMessage((_d = content === null || content === void 0 ? void 0 : content.templateMessage) === null || _d === void 0 ? void 0 : _d.hydratedFourRowTemplate); + if ((_a = content === null || content === void 0 ? void 0 : content.templateMessage) === null || _a === void 0 ? void 0 : _a.hydratedFourRowTemplate) { + return extractFromTemplateMessage((_b = content === null || content === void 0 ? void 0 : content.templateMessage) === null || _b === void 0 ? void 0 : _b.hydratedFourRowTemplate); } - if ((_e = content === null || content === void 0 ? void 0 : content.templateMessage) === null || _e === void 0 ? void 0 : _e.hydratedTemplate) { - return extractFromTemplateMessage((_f = content === null || content === void 0 ? void 0 : content.templateMessage) === null || _f === void 0 ? void 0 : _f.hydratedTemplate); + if ((_c = content === null || content === void 0 ? void 0 : content.templateMessage) === null || _c === void 0 ? void 0 : _c.hydratedTemplate) { + return extractFromTemplateMessage((_d = content === null || content === void 0 ? void 0 : content.templateMessage) === null || _d === void 0 ? void 0 : _d.hydratedTemplate); } - if ((_g = content === null || content === void 0 ? void 0 : content.templateMessage) === null || _g === void 0 ? void 0 : _g.fourRowTemplate) { - return extractFromTemplateMessage((_h = content === null || content === void 0 ? void 0 : content.templateMessage) === null || _h === void 0 ? void 0 : _h.fourRowTemplate); + if ((_e = content === null || content === void 0 ? void 0 : content.templateMessage) === null || _e === void 0 ? void 0 : _e.fourRowTemplate) { + return extractFromTemplateMessage((_f = content === null || content === void 0 ? void 0 : content.templateMessage) === null || _f === void 0 ? void 0 : _f.fourRowTemplate); } return content; }; @@ -404,6 +424,7 @@ const getDevice = (id) => { return deviceType; }; exports.getDevice = getDevice; +/** Upserts a receipt in the message */ const updateMessageWithReceipt = (msg, receipt) => { msg.userReceipt = msg.userReceipt || []; const recp = msg.userReceipt.find(m => m.userJid === receipt.userJid); @@ -415,3 +436,47 @@ const updateMessageWithReceipt = (msg, receipt) => { } }; exports.updateMessageWithReceipt = updateMessageWithReceipt; +/** Given a list of message keys, aggregates them by chat & sender. Useful for sending read receipts in bulk */ +const aggregateMessageKeysNotFromMe = (keys) => { + const keyMap = {}; + for (const { remoteJid, id, participant, fromMe } of keys) { + if (!fromMe) { + const uqKey = `${remoteJid}:${participant || ''}`; + if (!keyMap[uqKey]) { + keyMap[uqKey] = { + jid: remoteJid, + participant, + messageIds: [] + }; + } + keyMap[uqKey].messageIds.push(id); + } + } + return Object.values(keyMap); +}; +exports.aggregateMessageKeysNotFromMe = aggregateMessageKeysNotFromMe; +/** + * Downloads the given message. Throws an error if it's not a media message + */ +const downloadMediaMessage = async (message, type, options) => { + const mContent = exports.extractMessageContent(message.message); + if (!mContent) { + throw new boom_1.Boom('No message present', { statusCode: 400, data: message }); + } + const contentType = exports.getContentType(mContent); + const mediaType = contentType.replace('Message', ''); + const media = mContent[contentType]; + if (typeof media !== 'object' || !('url' in media)) { + throw new boom_1.Boom(`"${contentType}" message is not a media message`); + } + const stream = await messages_media_1.downloadContentFromMessage(media, mediaType, options); + if (type === 'buffer') { + let buffer = Buffer.from([]); + for await (const chunk of stream) { + buffer = Buffer.concat([buffer, chunk]); + } + return buffer; + } + return stream; +}; +exports.downloadMediaMessage = downloadMediaMessage; diff --git a/node_modules/@adiwajshing/baileys/lib/Utils/messages.js.bak b/node_modules/@adiwajshing/baileys/lib/Utils/messages.js.bak new file mode 100644 index 000000000..6a5ffd34f --- /dev/null +++ b/node_modules/@adiwajshing/baileys/lib/Utils/messages.js.bak @@ -0,0 +1,479 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.downloadMediaMessage = exports.aggregateMessageKeysNotFromMe = exports.updateMessageWithReceipt = exports.getDevice = exports.extractMessageContent = exports.normalizeMessageContent = exports.getContentType = exports.generateWAMessage = exports.generateWAMessageFromContent = exports.generateWAMessageContent = exports.generateForwardMessageContent = exports.prepareDisappearingMessageSettingContent = exports.prepareWAMessageMedia = void 0; +const boom_1 = require("@hapi/boom"); +const fs_1 = require("fs"); +const WAProto_1 = require("../../WAProto"); +const Defaults_1 = require("../Defaults"); +const Types_1 = require("../Types"); +const generics_1 = require("./generics"); +const messages_media_1 = require("./messages-media"); +const MIMETYPE_MAP = { + image: 'image/jpeg', + video: 'video/mp4', + document: 'application/pdf', + audio: 'audio/ogg; codecs=opus', + sticker: 'image/webp', + history: 'application/x-protobuf', + 'md-app-state': 'application/x-protobuf', +}; +const MessageTypeProto = { + 'image': Types_1.WAProto.ImageMessage, + 'video': Types_1.WAProto.VideoMessage, + 'audio': Types_1.WAProto.AudioMessage, + 'sticker': Types_1.WAProto.StickerMessage, + 'document': Types_1.WAProto.DocumentMessage, +}; +const ButtonType = WAProto_1.proto.ButtonsMessage.ButtonsMessageHeaderType; +const prepareWAMessageMedia = async (message, options) => { + const logger = options.logger; + let mediaType; + for (const key of Defaults_1.MEDIA_KEYS) { + if (key in message) { + mediaType = key; + } + } + const uploadData = { + ...message, + media: message[mediaType] + }; + delete uploadData[mediaType]; + // check if cacheable + generate cache key + const cacheableKey = typeof uploadData.media === 'object' && + ('url' in uploadData.media) && + !!uploadData.media.url && + !!options.mediaCache && ( + // generate the key + mediaType + ':' + uploadData.media.url.toString()); + if (mediaType === 'document' && !uploadData.fileName) { + uploadData.fileName = 'file'; + } + if (!uploadData.mimetype) { + uploadData.mimetype = MIMETYPE_MAP[mediaType]; + } + // check for cache hit + if (cacheableKey) { + const mediaBuff = options.mediaCache.get(cacheableKey); + if (mediaBuff) { + logger === null || logger === void 0 ? void 0 : logger.debug({ cacheableKey }, 'got media cache hit'); + const obj = Types_1.WAProto.Message.decode(mediaBuff); + const key = `${mediaType}Message`; + delete uploadData.media; + Object.assign(obj[key], { ...uploadData }); + return obj; + } + } + const requiresDurationComputation = mediaType === 'audio' && typeof uploadData.seconds === 'undefined'; + const requiresThumbnailComputation = (mediaType === 'image' || mediaType === 'video') && + (typeof uploadData['jpegThumbnail'] === 'undefined'); + const requiresOriginalForSomeProcessing = requiresDurationComputation || requiresThumbnailComputation; + const { mediaKey, encWriteStream, bodyPath, fileEncSha256, fileSha256, fileLength, didSaveToTmpPath } = await messages_media_1.encryptedStream(uploadData.media, mediaType, requiresOriginalForSomeProcessing); + // url safe Base64 encode the SHA256 hash of the body + const fileEncSha256B64 = encodeURIComponent(fileEncSha256.toString('base64') + .replace(/\+/g, '-') + .replace(/\//g, '_') + .replace(/\=+$/, '')); + const [{ mediaUrl, directPath }] = await Promise.all([ + (async () => { + const result = await options.upload(encWriteStream, { fileEncSha256B64, mediaType, timeoutMs: options.mediaUploadTimeoutMs }); + logger === null || logger === void 0 ? void 0 : logger.debug('uploaded media'); + return result; + })(), + (async () => { + try { + if (requiresThumbnailComputation) { + uploadData.jpegThumbnail = await messages_media_1.generateThumbnail(bodyPath, mediaType, options); + logger === null || logger === void 0 ? void 0 : logger.debug('generated thumbnail'); + } + if (requiresDurationComputation) { + uploadData.seconds = await messages_media_1.getAudioDuration(bodyPath); + logger === null || logger === void 0 ? void 0 : logger.debug('computed audio duration'); + } + } + catch (error) { + logger === null || logger === void 0 ? void 0 : logger.warn({ trace: error.stack }, 'failed to obtain extra info'); + } + })(), + ]) + .finally(async () => { + encWriteStream.destroy(); + // remove tmp files + if (didSaveToTmpPath && bodyPath) { + await fs_1.promises.unlink(bodyPath); + logger === null || logger === void 0 ? void 0 : logger.debug('removed tmp files'); + } + }); + delete uploadData.media; + const obj = Types_1.WAProto.Message.fromObject({ + [`${mediaType}Message`]: MessageTypeProto[mediaType].fromObject({ + url: mediaUrl, + directPath, + mediaKey, + fileEncSha256, + fileSha256, + fileLength, + mediaKeyTimestamp: generics_1.unixTimestampSeconds(), + ...uploadData + }) + }); + if (cacheableKey) { + logger.debug({ cacheableKey }, 'set cache'); + options.mediaCache.set(cacheableKey, Types_1.WAProto.Message.encode(obj).finish()); + } + return obj; +}; +exports.prepareWAMessageMedia = prepareWAMessageMedia; +const prepareDisappearingMessageSettingContent = (ephemeralExpiration) => { + ephemeralExpiration = ephemeralExpiration || 0; + const content = { + ephemeralMessage: { + message: { + protocolMessage: { + type: Types_1.WAProto.ProtocolMessage.ProtocolMessageType.EPHEMERAL_SETTING, + ephemeralExpiration + } + } + } + }; + return Types_1.WAProto.Message.fromObject(content); +}; +exports.prepareDisappearingMessageSettingContent = prepareDisappearingMessageSettingContent; +/** + * Generate forwarded message content like WA does + * @param message the message to forward + * @param options.forceForward will show the message as forwarded even if it is from you + */ +const generateForwardMessageContent = (message, forceForward) => { + var _a; + let content = message.message; + if (!content) { + throw new boom_1.Boom('no content in message', { statusCode: 400 }); + } + // hacky copy + content = exports.normalizeMessageContent(message.message); + content = WAProto_1.proto.Message.decode(WAProto_1.proto.Message.encode(content).finish()); + let key = Object.keys(content)[0]; + let score = ((_a = content[key].contextInfo) === null || _a === void 0 ? void 0 : _a.forwardingScore) || 0; + score += message.key.fromMe && !forceForward ? 0 : 1; + if (key === 'conversation') { + content.extendedTextMessage = { text: content[key] }; + delete content.conversation; + key = 'extendedTextMessage'; + } + if (score > 0) { + content[key].contextInfo = { forwardingScore: score, isForwarded: true }; + } + else { + content[key].contextInfo = {}; + } + return content; +}; +exports.generateForwardMessageContent = generateForwardMessageContent; +const generateWAMessageContent = async (message, options) => { + var _a, _b; + let m = {}; + if ('text' in message) { + const extContent = { ...message }; + if (!!options.getUrlInfo && message.text.match(Defaults_1.URL_REGEX)) { + try { + const data = await options.getUrlInfo(message.text); + extContent.canonicalUrl = data['canonical-url']; + extContent.matchedText = data['matched-text']; + extContent.jpegThumbnail = data.jpegThumbnail; + extContent.description = data.description; + extContent.title = data.title; + extContent.previewType = 0; + } + catch (error) { // ignore if fails + (_a = options.logger) === null || _a === void 0 ? void 0 : _a.warn({ trace: error.stack }, 'url generation failed'); + } + } + m.extendedTextMessage = extContent; + } + else if ('contacts' in message) { + const contactLen = message.contacts.contacts.length; + if (!contactLen) { + throw new boom_1.Boom('require atleast 1 contact', { statusCode: 400 }); + } + if (contactLen === 1) { + m.contactMessage = Types_1.WAProto.ContactMessage.fromObject(message.contacts.contacts[0]); + } + else { + m.contactsArrayMessage = Types_1.WAProto.ContactsArrayMessage.fromObject(message.contacts); + } + } + else if ('location' in message) { + m.locationMessage = Types_1.WAProto.LocationMessage.fromObject(message.location); + } + else if ('react' in message) { + m.reactionMessage = Types_1.WAProto.ReactionMessage.fromObject(message.react); + } + else if ('delete' in message) { + m.protocolMessage = { + key: message.delete, + type: Types_1.WAProto.ProtocolMessage.ProtocolMessageType.REVOKE + }; + } + else if ('forward' in message) { + m = exports.generateForwardMessageContent(message.forward, message.force); + } + else if ('disappearingMessagesInChat' in message) { + const exp = typeof message.disappearingMessagesInChat === 'boolean' ? + (message.disappearingMessagesInChat ? Defaults_1.WA_DEFAULT_EPHEMERAL : 0) : + message.disappearingMessagesInChat; + m = exports.prepareDisappearingMessageSettingContent(exp); + } + else { + m = await exports.prepareWAMessageMedia(message, options); + } + if ('buttons' in message && !!message.buttons) { + const buttonsMessage = { + buttons: message.buttons.map(b => ({ ...b, type: WAProto_1.proto.Button.ButtonType.RESPONSE })) + }; + if ('text' in message) { + buttonsMessage.contentText = message.text; + buttonsMessage.headerType = ButtonType.EMPTY; + } + else { + if ('caption' in message) { + buttonsMessage.contentText = message.caption; + } + const type = Object.keys(m)[0].replace('Message', '').toUpperCase(); + buttonsMessage.headerType = ButtonType[type]; + Object.assign(buttonsMessage, m); + } + if ('footer' in message && !!message.footer) { + buttonsMessage.footerText = message.footer; + } + m = { buttonsMessage }; + } + else if ('templateButtons' in message && !!message.templateButtons) { + const templateMessage = { + hydratedTemplate: { + hydratedButtons: message.templateButtons + } + }; + if ('text' in message) { + templateMessage.hydratedTemplate.hydratedContentText = message.text; + } + else { + if ('caption' in message) { + templateMessage.hydratedTemplate.hydratedContentText = message.caption; + } + Object.assign(templateMessage.hydratedTemplate, m); + } + if ('footer' in message && !!message.footer) { + templateMessage.hydratedTemplate.hydratedFooterText = message.footer; + } + m = { templateMessage }; + } + if ('sections' in message && !!message.sections) { + const listMessage = { + sections: message.sections, + buttonText: message.buttonText, + title: message.title, + footerText: message.footer, + description: message.text, + listType: WAProto_1.proto.ListMessage.ListMessageListType['SINGLE_SELECT'] + }; + m = { listMessage }; + } + if ('viewOnce' in message && !!message.viewOnce) { + m = { viewOnceMessage: { message: m } }; + } + if ('mentions' in message && ((_b = message.mentions) === null || _b === void 0 ? void 0 : _b.length)) { + const [messageType] = Object.keys(m); + m[messageType].contextInfo = m[messageType] || {}; + m[messageType].contextInfo.mentionedJid = message.mentions; + } + return Types_1.WAProto.Message.fromObject(m); +}; +exports.generateWAMessageContent = generateWAMessageContent; +const generateWAMessageFromContent = (jid, message, options) => { + if (!options.timestamp) { + options.timestamp = new Date(); + } // set timestamp to now + const key = Object.keys(message)[0]; + const timestamp = generics_1.unixTimestampSeconds(options.timestamp); + const { quoted, userJid } = options; + if (quoted) { + const participant = quoted.key.fromMe ? userJid : (quoted.participant || quoted.key.participant || quoted.key.remoteJid); + message[key].contextInfo = message[key].contextInfo || {}; + message[key].contextInfo.participant = participant; + message[key].contextInfo.stanzaId = quoted.key.id; + message[key].contextInfo.quotedMessage = quoted.message; + // if a participant is quoted, then it must be a group + // hence, remoteJid of group must also be entered + if (quoted.key.participant || quoted.participant) { + message[key].contextInfo.remoteJid = quoted.key.remoteJid; + } + } + if ( + // if we want to send a disappearing message + !!(options === null || options === void 0 ? void 0 : options.ephemeralExpiration) && + // and it's not a protocol message -- delete, toggle disappear message + key !== 'protocolMessage' && + // already not converted to disappearing message + key !== 'ephemeralMessage') { + message[key].contextInfo = { + ...(message[key].contextInfo || {}), + expiration: options.ephemeralExpiration || Defaults_1.WA_DEFAULT_EPHEMERAL, + //ephemeralSettingTimestamp: options.ephemeralOptions.eph_setting_ts?.toString() + }; + message = { + ephemeralMessage: { + message + } + }; + } + message = Types_1.WAProto.Message.fromObject(message); + const messageJSON = { + key: { + remoteJid: jid, + fromMe: true, + id: (options === null || options === void 0 ? void 0 : options.messageId) || generics_1.generateMessageID(), + }, + message: message, + messageTimestamp: timestamp, + messageStubParameters: [], + participant: jid.includes('@g.us') ? userJid : undefined, + status: Types_1.WAMessageStatus.PENDING + }; + return Types_1.WAProto.WebMessageInfo.fromObject(messageJSON); +}; +exports.generateWAMessageFromContent = generateWAMessageFromContent; +const generateWAMessage = async (jid, content, options) => { + var _a; + // ensure msg ID is with every log + options.logger = (_a = options === null || options === void 0 ? void 0 : options.logger) === null || _a === void 0 ? void 0 : _a.child({ msgId: options.messageId }); + return exports.generateWAMessageFromContent(jid, await exports.generateWAMessageContent(content, options), options); +}; +exports.generateWAMessage = generateWAMessage; +/** Get the key to access the true type of content */ +const getContentType = (content) => { + if (content) { + const keys = Object.keys(content); + const key = keys.find(k => (k === 'conversation' || k.endsWith('Message')) && k !== 'senderKeyDistributionMessage'); + return key; + } +}; +exports.getContentType = getContentType; +/** + * Normalizes ephemeral, view once messages to regular message content + * Eg. image messages in ephemeral messages, in view once messages etc. + * @param content + * @returns + */ +const normalizeMessageContent = (content) => { + var _a, _b, _c, _d, _e; + content = ((_c = (_b = (_a = content === null || content === void 0 ? void 0 : content.ephemeralMessage) === null || _a === void 0 ? void 0 : _a.message) === null || _b === void 0 ? void 0 : _b.viewOnceMessage) === null || _c === void 0 ? void 0 : _c.message) || + ((_d = content === null || content === void 0 ? void 0 : content.ephemeralMessage) === null || _d === void 0 ? void 0 : _d.message) || + ((_e = content === null || content === void 0 ? void 0 : content.viewOnceMessage) === null || _e === void 0 ? void 0 : _e.message) || + content || + undefined; + return content; +}; +exports.normalizeMessageContent = normalizeMessageContent; +/** + * Extract the true message content from a message + * Eg. extracts the inner message from a disappearing message/view once message + */ +const extractMessageContent = (content) => { + var _a, _b, _c, _d, _e, _f; + const extractFromTemplateMessage = (msg) => { + if (msg.imageMessage) { + return { imageMessage: msg.imageMessage }; + } + else if (msg.documentMessage) { + return { documentMessage: msg.documentMessage }; + } + else if (msg.videoMessage) { + return { videoMessage: msg.videoMessage }; + } + else if (msg.locationMessage) { + return { locationMessage: msg.locationMessage }; + } + else { + return { conversation: 'contentText' in msg ? msg.contentText : ('hydratedContentText' in msg ? msg.hydratedContentText : '') }; + } + }; + content = exports.normalizeMessageContent(content); + if (content === null || content === void 0 ? void 0 : content.buttonsMessage) { + return extractFromTemplateMessage(content.buttonsMessage); + } + if ((_a = content === null || content === void 0 ? void 0 : content.templateMessage) === null || _a === void 0 ? void 0 : _a.hydratedFourRowTemplate) { + return extractFromTemplateMessage((_b = content === null || content === void 0 ? void 0 : content.templateMessage) === null || _b === void 0 ? void 0 : _b.hydratedFourRowTemplate); + } + if ((_c = content === null || content === void 0 ? void 0 : content.templateMessage) === null || _c === void 0 ? void 0 : _c.hydratedTemplate) { + return extractFromTemplateMessage((_d = content === null || content === void 0 ? void 0 : content.templateMessage) === null || _d === void 0 ? void 0 : _d.hydratedTemplate); + } + if ((_e = content === null || content === void 0 ? void 0 : content.templateMessage) === null || _e === void 0 ? void 0 : _e.fourRowTemplate) { + return extractFromTemplateMessage((_f = content === null || content === void 0 ? void 0 : content.templateMessage) === null || _f === void 0 ? void 0 : _f.fourRowTemplate); + } + return content; +}; +exports.extractMessageContent = extractMessageContent; +/** + * Returns the device predicted by message ID + */ +const getDevice = (id) => { + const deviceType = id.length > 21 ? 'android' : id.substring(0, 2) === '3A' ? 'ios' : 'web'; + return deviceType; +}; +exports.getDevice = getDevice; +/** Upserts a receipt in the message */ +const updateMessageWithReceipt = (msg, receipt) => { + msg.userReceipt = msg.userReceipt || []; + const recp = msg.userReceipt.find(m => m.userJid === receipt.userJid); + if (recp) { + Object.assign(recp, receipt); + } + else { + msg.userReceipt.push(receipt); + } +}; +exports.updateMessageWithReceipt = updateMessageWithReceipt; +/** Given a list of message keys, aggregates them by chat & sender. Useful for sending read receipts in bulk */ +const aggregateMessageKeysNotFromMe = (keys) => { + const keyMap = {}; + for (const { remoteJid, id, participant, fromMe } of keys) { + if (!fromMe) { + const uqKey = `${remoteJid}:${participant || ''}`; + if (!keyMap[uqKey]) { + keyMap[uqKey] = { + jid: remoteJid, + participant, + messageIds: [] + }; + } + keyMap[uqKey].messageIds.push(id); + } + } + return Object.values(keyMap); +}; +exports.aggregateMessageKeysNotFromMe = aggregateMessageKeysNotFromMe; +/** + * Downloads the given message. Throws an error if it's not a media message + */ +const downloadMediaMessage = async (message, type, options) => { + const mContent = exports.extractMessageContent(message.message); + if (!mContent) { + throw new boom_1.Boom('No message present', { statusCode: 400, data: message }); + } + const contentType = exports.getContentType(mContent); + const mediaType = contentType.replace('Message', ''); + const media = mContent[contentType]; + if (typeof media !== 'object' || !('url' in media)) { + throw new boom_1.Boom(`"${contentType}" message is not a media message`); + } + const stream = await messages_media_1.downloadContentFromMessage(media, mediaType, options); + if (type === 'buffer') { + let buffer = Buffer.from([]); + for await (const chunk of stream) { + buffer = Buffer.concat([buffer, chunk]); + } + return buffer; + } + return stream; +}; +exports.downloadMediaMessage = downloadMediaMessage; diff --git a/node_modules/@adiwajshing/baileys/lib/Utils/.trashed-1649374382-noise-handler.d.ts b/node_modules/@adiwajshing/baileys/lib/Utils/noise-handler.d.ts similarity index 100% rename from node_modules/@adiwajshing/baileys/lib/Utils/.trashed-1649374382-noise-handler.d.ts rename to node_modules/@adiwajshing/baileys/lib/Utils/noise-handler.d.ts diff --git a/node_modules/@adiwajshing/baileys/lib/Utils/noise-handler.d_1.ts b/node_modules/@adiwajshing/baileys/lib/Utils/noise-handler.d_1.ts deleted file mode 100644 index 7ded87485..000000000 --- a/node_modules/@adiwajshing/baileys/lib/Utils/noise-handler.d_1.ts +++ /dev/null @@ -1,14 +0,0 @@ -/// -import { proto } from '../../WAProto'; -import { KeyPair } from '../Types'; -import { BinaryNode } from '../WABinary'; -export declare const makeNoiseHandler: ({ public: publicKey, private: privateKey }: KeyPair) => { - encrypt: (plaintext: Uint8Array) => Buffer; - decrypt: (ciphertext: Uint8Array) => Buffer; - authenticate: (data: Uint8Array) => void; - mixIntoKey: (data: Uint8Array) => void; - finishInit: () => void; - processHandshake: ({ serverHello }: proto.HandshakeMessage, noiseKey: KeyPair) => Buffer; - encodeFrame: (data: Buffer | Uint8Array) => Uint8Array; - decodeFrame: (newData: Buffer | Uint8Array, onFrame: (buff: Uint8Array | BinaryNode) => void) => void; -}; diff --git a/node_modules/@adiwajshing/baileys/lib/Utils/process-message.d.ts b/node_modules/@adiwajshing/baileys/lib/Utils/process-message.d.ts new file mode 100644 index 000000000..4ffba89d0 --- /dev/null +++ b/node_modules/@adiwajshing/baileys/lib/Utils/process-message.d.ts @@ -0,0 +1,12 @@ +import type { Logger } from 'pino'; +import { proto } from '../../WAProto'; +import { BaileysEventMap, SignalKeyStoreWithTransaction } from '../Types'; +declare type ProcessMessageContext = { + historyCache: Set; + meId: string; + keyStore: SignalKeyStoreWithTransaction; + logger?: Logger; + treatCiphertextMessagesAsReal?: boolean; +}; +declare const processMessage: (message: proto.IWebMessageInfo, { historyCache, meId, keyStore, logger, treatCiphertextMessagesAsReal }: ProcessMessageContext) => Promise>>; +export default processMessage; diff --git a/node_modules/@adiwajshing/baileys/lib/Utils/process-message.js b/node_modules/@adiwajshing/baileys/lib/Utils/process-message.js new file mode 100644 index 000000000..2b9e224d6 --- /dev/null +++ b/node_modules/@adiwajshing/baileys/lib/Utils/process-message.js @@ -0,0 +1,132 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const WAProto_1 = require("../../WAProto"); +const Types_1 = require("../Types"); +const Utils_1 = require("../Utils"); +const WABinary_1 = require("../WABinary"); +const processMessage = async (message, { historyCache, meId, keyStore, logger, treatCiphertextMessagesAsReal }) => { + var _a; + const map = {}; + const chat = { id: WABinary_1.jidNormalizedUser(message.key.remoteJid) }; + const normalizedContent = !!message.message && Utils_1.normalizeMessageContent(message.message); + if ((!!normalizedContent || + (message.messageStubType === Types_1.WAMessageStubType.CIPHERTEXT && treatCiphertextMessagesAsReal)) + && !(normalizedContent === null || normalizedContent === void 0 ? void 0 : normalizedContent.protocolMessage) + && !(normalizedContent === null || normalizedContent === void 0 ? void 0 : normalizedContent.reactionMessage)) { + chat.conversationTimestamp = Utils_1.toNumber(message.messageTimestamp); + if (!message.key.fromMe) { + chat.unreadCount = (chat.unreadCount || 0) + 1; + } + } + const content = Utils_1.normalizeMessageContent(message.message); + const protocolMsg = content === null || content === void 0 ? void 0 : content.protocolMessage; + if (protocolMsg) { + switch (protocolMsg.type) { + case WAProto_1.proto.ProtocolMessage.ProtocolMessageType.HISTORY_SYNC_NOTIFICATION: + const histNotification = protocolMsg.historySyncNotification; + logger === null || logger === void 0 ? void 0 : logger.info({ histNotification, id: message.key.id }, 'got history notification'); + const { chats, contacts, messages, isLatest } = await Utils_1.downloadAndProcessHistorySyncNotification(histNotification, historyCache); + if (chats.length) { + map['chats.set'] = { chats, isLatest }; + } + if (messages.length) { + map['messages.set'] = { messages, isLatest }; + } + if (contacts.length) { + map['contacts.set'] = { contacts }; + } + break; + case WAProto_1.proto.ProtocolMessage.ProtocolMessageType.APP_STATE_SYNC_KEY_SHARE: + const keys = protocolMsg.appStateSyncKeyShare.keys; + if (keys === null || keys === void 0 ? void 0 : keys.length) { + let newAppStateSyncKeyId = ''; + await keyStore.transaction(async () => { + for (const { keyData, keyId } of keys) { + const strKeyId = Buffer.from(keyId.keyId).toString('base64'); + logger === null || logger === void 0 ? void 0 : logger.info({ strKeyId }, 'injecting new app state sync key'); + await keyStore.set({ 'app-state-sync-key': { [strKeyId]: keyData } }); + newAppStateSyncKeyId = strKeyId; + } + }); + map['creds.update'] = { myAppStateKeyId: newAppStateSyncKeyId }; + } + else { + logger === null || logger === void 0 ? void 0 : logger.info({ protocolMsg }, 'recv app state sync with 0 keys'); + } + break; + case WAProto_1.proto.ProtocolMessage.ProtocolMessageType.REVOKE: + map['messages.update'] = [ + { + key: { + ...message.key, + id: protocolMsg.key.id + }, + update: { message: null, messageStubType: Types_1.WAMessageStubType.REVOKE, key: message.key } + } + ]; + break; + case WAProto_1.proto.ProtocolMessage.ProtocolMessageType.EPHEMERAL_SETTING: + Object.assign(chat, { + ephemeralSettingTimestamp: Utils_1.toNumber(message.messageTimestamp), + ephemeralExpiration: protocolMsg.ephemeralExpiration || null + }); + break; + } + } + else if (content === null || content === void 0 ? void 0 : content.reactionMessage) { + const reaction = { + ...content.reactionMessage, + key: message.key, + }; + const operation = ((_a = content.reactionMessage) === null || _a === void 0 ? void 0 : _a.text) ? 'add' : 'remove'; + map['messages.reaction'] = { reaction, key: content.reactionMessage.key, operation }; + } + else if (message.messageStubType) { + const jid = message.key.remoteJid; + //let actor = whatsappID (message.participant) + let participants; + const emitParticipantsUpdate = (action) => (map['group-participants.update'] = { id: jid, participants, action }); + const emitGroupUpdate = (update) => { + map['groups.update'] = [{ id: jid, ...update }]; + }; + const participantsIncludesMe = () => participants.find(jid => WABinary_1.areJidsSameUser(meId, jid)); + switch (message.messageStubType) { + case Types_1.WAMessageStubType.GROUP_PARTICIPANT_LEAVE: + case Types_1.WAMessageStubType.GROUP_PARTICIPANT_REMOVE: + participants = message.messageStubParameters; + emitParticipantsUpdate('remove'); + // mark the chat read only if you left the group + if (participantsIncludesMe()) { + chat.readOnly = true; + } + break; + case Types_1.WAMessageStubType.GROUP_PARTICIPANT_ADD: + case Types_1.WAMessageStubType.GROUP_PARTICIPANT_INVITE: + case Types_1.WAMessageStubType.GROUP_PARTICIPANT_ADD_REQUEST_JOIN: + participants = message.messageStubParameters; + if (participantsIncludesMe()) { + chat.readOnly = false; + } + emitParticipantsUpdate('add'); + break; + case Types_1.WAMessageStubType.GROUP_CHANGE_ANNOUNCE: + const announceValue = message.messageStubParameters[0]; + emitGroupUpdate({ announce: announceValue === 'true' || announceValue === 'on' }); + break; + case Types_1.WAMessageStubType.GROUP_CHANGE_RESTRICT: + const restrictValue = message.messageStubParameters[0]; + emitGroupUpdate({ restrict: restrictValue === 'true' || restrictValue === 'on' }); + break; + case Types_1.WAMessageStubType.GROUP_CHANGE_SUBJECT: + const name = message.messageStubParameters[0]; + chat.name = name; + emitGroupUpdate({ subject: name }); + break; + } + } + if (Object.keys(chat).length > 1) { + map['chats.update'] = [chat]; + } + return map; +}; +exports.default = processMessage; diff --git a/node_modules/@adiwajshing/baileys/lib/Utils/.trashed-1649374382-signal.d.ts b/node_modules/@adiwajshing/baileys/lib/Utils/signal.d.ts similarity index 100% rename from node_modules/@adiwajshing/baileys/lib/Utils/.trashed-1649374382-signal.d.ts rename to node_modules/@adiwajshing/baileys/lib/Utils/signal.d.ts diff --git a/node_modules/@adiwajshing/baileys/lib/Utils/signal.d_1.ts b/node_modules/@adiwajshing/baileys/lib/Utils/signal.d_1.ts deleted file mode 100644 index 9b85f77c8..000000000 --- a/node_modules/@adiwajshing/baileys/lib/Utils/signal.d_1.ts +++ /dev/null @@ -1,54 +0,0 @@ -/// -import { proto } from '../../WAProto'; -import { AuthenticationCreds, KeyPair, SignalAuthState, SignalIdentity, SignalKeyStore, SignedKeyPair } from '../Types/Auth'; -import { BinaryNode, JidWithDevice } from '../WABinary'; -export declare const generateSignalPubKey: (pubKey: Uint8Array | Buffer) => Buffer; -export declare const jidToSignalProtocolAddress: (jid: string) => any; -export declare const jidToSignalSenderKeyName: (group: string, user: string) => string; -export declare const createSignalIdentity: (wid: string, accountSignatureKey: Uint8Array) => SignalIdentity; -export declare const getPreKeys: ({ get }: SignalKeyStore, min: number, limit: number) => Promise<{ - [id: string]: KeyPair; -}>; -export declare const generateOrGetPreKeys: (creds: AuthenticationCreds, range: number) => { - newPreKeys: { - [id: number]: KeyPair; - }; - lastPreKeyId: number; - preKeysRange: readonly [number, number]; -}; -export declare const xmppSignedPreKey: (key: SignedKeyPair) => BinaryNode; -export declare const xmppPreKey: (pair: KeyPair, id: number) => BinaryNode; -export declare const signalStorage: ({ creds, keys }: SignalAuthState) => { - loadSession: (id: string) => Promise; - storeSession: (id: any, session: any) => Promise; - isTrustedIdentity: () => boolean; - loadPreKey: (id: number | string) => Promise<{ - privKey: Buffer; - pubKey: Buffer; - }>; - removePreKey: (id: number) => void | Promise; - loadSignedPreKey: (keyId: number) => { - privKey: Buffer; - pubKey: Buffer; - }; - loadSenderKey: (keyId: string) => Promise; - storeSenderKey: (keyId: any, key: any) => Promise; - getOurRegistrationId: () => number; - getOurIdentity: () => { - privKey: Buffer; - pubKey: Buffer; - }; -}; -export declare const decryptGroupSignalProto: (group: string, user: string, msg: Buffer | Uint8Array, auth: SignalAuthState) => any; -export declare const processSenderKeyMessage: (authorJid: string, item: proto.ISenderKeyDistributionMessage, auth: SignalAuthState) => Promise; -export declare const decryptSignalProto: (user: string, type: 'pkmsg' | 'msg', msg: Buffer | Uint8Array, auth: SignalAuthState) => Promise; -export declare const encryptSignalProto: (user: string, buffer: Buffer, auth: SignalAuthState) => Promise<{ - type: string; - ciphertext: Buffer; -}>; -export declare const encryptSenderKeyMsgSignalProto: (group: string, data: Uint8Array | Buffer, meId: string, auth: SignalAuthState) => Promise<{ - ciphertext: Uint8Array; - senderKeyDistributionMessageKey: Buffer; -}>; -export declare const parseAndInjectE2ESessions: (node: BinaryNode, auth: SignalAuthState) => Promise; -export declare const extractDeviceJids: (result: BinaryNode, myJid: string, excludeZeroDevices: boolean) => JidWithDevice[]; diff --git a/node_modules/@adiwajshing/baileys/lib/Utils/validate-connection.d.ts b/node_modules/@adiwajshing/baileys/lib/Utils/validate-connection.d.ts new file mode 100644 index 000000000..495ee08fc --- /dev/null +++ b/node_modules/@adiwajshing/baileys/lib/Utils/validate-connection.d.ts @@ -0,0 +1,11 @@ +import { proto } from '../../WAProto'; +import type { AuthenticationCreds, SignalCreds, SocketConfig } from '../Types'; +import { BinaryNode } from '../WABinary'; +declare type ClientPayloadConfig = Pick; +export declare const generateLoginNode: (userJid: string, config: ClientPayloadConfig) => proto.IClientPayload; +export declare const generateRegistrationNode: ({ registrationId, signedPreKey, signedIdentityKey }: SignalCreds, config: ClientPayloadConfig) => proto.ClientPayload; +export declare const configureSuccessfulPairing: (stanza: BinaryNode, { advSecretKey, signedIdentityKey, signalIdentities }: Pick) => { + creds: Partial; + reply: BinaryNode; +}; +export {}; diff --git a/node_modules/@adiwajshing/baileys/lib/Utils/validate-connection.d_1.ts b/node_modules/@adiwajshing/baileys/lib/Utils/validate-connection.d_1.ts deleted file mode 100644 index 07e3ecf22..000000000 --- a/node_modules/@adiwajshing/baileys/lib/Utils/validate-connection.d_1.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { AuthenticationCreds, SignalCreds, SocketConfig } from '../Types'; -import { BinaryNode } from '../WABinary'; -export declare const generateLoginNode: (userJid: string, config: Pick) => Uint8Array; -export declare const generateRegistrationNode: ({ registrationId, signedPreKey, signedIdentityKey }: SignalCreds, config: Pick) => Uint8Array; -export declare const configureSuccessfulPairing: (stanza: BinaryNode, { advSecretKey, signedIdentityKey, signalIdentities }: Pick) => { - creds: Partial; - reply: BinaryNode; -}; diff --git a/node_modules/@adiwajshing/baileys/lib/Utils/validate-connection.js b/node_modules/@adiwajshing/baileys/lib/Utils/validate-connection.js index 552581d01..a8f542c76 100644 --- a/node_modules/@adiwajshing/baileys/lib/Utils/validate-connection.js +++ b/node_modules/@adiwajshing/baileys/lib/Utils/validate-connection.js @@ -2,60 +2,71 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.configureSuccessfulPairing = exports.generateRegistrationNode = exports.generateLoginNode = void 0; const boom_1 = require("@hapi/boom"); +const crypto_1 = require("crypto"); const WAProto_1 = require("../../WAProto"); const WABinary_1 = require("../WABinary"); -const crypto_1 = require("./crypto"); +const crypto_2 = require("./crypto"); const generics_1 = require("./generics"); const signal_1 = require("./signal"); -const ENCODED_VERSION = 'S9Kdc4pc4EJryo21snc5cg=='; -const getUserAgent = ({ version, browser }) => ({ +const getUserAgent = ({ version }) => ({ appVersion: { primary: version[0], secondary: version[1], tertiary: version[2], }, - platform: 14, - releaseChannel: 0, + platform: WAProto_1.proto.UserAgent.UserAgentPlatform.WEB, + releaseChannel: WAProto_1.proto.UserAgent.UserAgentReleaseChannel.RELEASE, mcc: '000', mnc: '000', - osVersion: browser[2], + osVersion: '0.1', manufacturer: '', - device: browser[1], + device: 'Desktop', osBuildNumber: '0.1', localeLanguageIso6391: 'en', - localeCountryIso31661Alpha2: 'en', + localeCountryIso31661Alpha2: 'US', }); +const getWebInfo = () => ({ + webSubPlatform: WAProto_1.proto.WebInfo.WebInfoWebSubPlatform.WEB_BROWSER +}); +const getClientPayload = (config) => { + return { + passive: true, + connectType: WAProto_1.proto.ClientPayload.ClientPayloadConnectType.WIFI_UNKNOWN, + connectReason: WAProto_1.proto.ClientPayload.ClientPayloadConnectReason.USER_ACTIVATED, + userAgent: getUserAgent(config), + webInfo: getWebInfo(), + }; +}; const generateLoginNode = (userJid, config) => { const { user, device } = WABinary_1.jidDecode(userJid); const payload = { - passive: true, - connectType: 1, - connectReason: 1, - userAgent: getUserAgent(config), - webInfo: { webSubPlatform: 0 }, - username: parseInt(user, 10), + ...getClientPayload(config), + username: +user, device: device, }; - return WAProto_1.proto.ClientPayload.encode(payload).finish(); + return WAProto_1.proto.ClientPayload.fromObject(payload); }; exports.generateLoginNode = generateLoginNode; const generateRegistrationNode = ({ registrationId, signedPreKey, signedIdentityKey }, config) => { - const appVersionBuf = new Uint8Array(Buffer.from(ENCODED_VERSION, 'base64')); + // the app version needs to be md5 hashed + // and passed in + const appVersionBuf = crypto_1.createHash('md5') + .update(config.version.join('.')) // join as string + .digest(); + const browserVersion = config.browser[2].split('.'); const companion = { os: config.browser[0], version: { - primary: 10, - secondary: undefined, - tertiary: undefined, + primary: +(browserVersion[0] || 10), + secondary: +(browserVersion[1] || 0), + tertiary: +(browserVersion[2] || 0), }, - platformType: 1, + platformType: WAProto_1.proto.CompanionProps.CompanionPropsPlatformType.CHROME, requireFullSync: false, }; const companionProto = WAProto_1.proto.CompanionProps.encode(companion).finish(); const registerPayload = { - connectReason: 1, - connectType: 1, - passive: false, + ...getClientPayload(config), regData: { buildHash: appVersionBuf, companionProps: companionProto, @@ -66,12 +77,8 @@ const generateRegistrationNode = ({ registrationId, signedPreKey, signedIdentity eSkeyVal: signedPreKey.keyPair.public, eSkeySig: signedPreKey.signature, }, - userAgent: getUserAgent(config), - webInfo: { - webSubPlatform: 0, - }, }; - return WAProto_1.proto.ClientPayload.encode(registerPayload).finish(); + return WAProto_1.proto.ClientPayload.fromObject(registerPayload); }; exports.generateRegistrationNode = generateRegistrationNode; const configureSuccessfulPairing = (stanza, { advSecretKey, signedIdentityKey, signalIdentities }) => { @@ -84,18 +91,18 @@ const configureSuccessfulPairing = (stanza, { advSecretKey, signedIdentityKey, s const verifiedName = businessName || ''; const jid = (_e = (_d = pairContent.find(m => m.tag === 'device')) === null || _d === void 0 ? void 0 : _d.attrs) === null || _e === void 0 ? void 0 : _e.jid; const { details, hmac } = WAProto_1.proto.ADVSignedDeviceIdentityHMAC.decode(deviceIdentity); - const advSign = crypto_1.hmacSign(details, Buffer.from(advSecretKey, 'base64')); + const advSign = crypto_2.hmacSign(details, Buffer.from(advSecretKey, 'base64')); if (Buffer.compare(hmac, advSign) !== 0) { throw new boom_1.Boom('Invalid pairing'); } const account = WAProto_1.proto.ADVSignedDeviceIdentity.decode(details); const { accountSignatureKey, accountSignature } = account; const accountMsg = WABinary_1.Binary.build(new Uint8Array([6, 0]), account.details, signedIdentityKey.public).readByteArray(); - if (!crypto_1.Curve.verify(accountSignatureKey, accountMsg, accountSignature)) { + if (!crypto_2.Curve.verify(accountSignatureKey, accountMsg, accountSignature)) { throw new boom_1.Boom('Failed to verify account signature'); } const deviceMsg = WABinary_1.Binary.build(new Uint8Array([6, 1]), account.details, signedIdentityKey.public, account.accountSignatureKey).readByteArray(); - account.deviceSignature = crypto_1.Curve.sign(signedIdentityKey.private, deviceMsg); + account.deviceSignature = crypto_2.Curve.sign(signedIdentityKey.private, deviceMsg); const identity = signal_1.createSignalIdentity(jid, accountSignatureKey); const keyIndex = WAProto_1.proto.ADVDeviceIdentity.decode(account.details).keyIndex; const accountEnc = WAProto_1.proto.ADVSignedDeviceIdentity.encode({ @@ -114,7 +121,11 @@ const configureSuccessfulPairing = (stanza, { advSecretKey, signedIdentityKey, s tag: 'pair-device-sign', attrs: {}, content: [ - { tag: 'device-identity', attrs: { 'key-index': `${keyIndex}` }, content: accountEnc } + { + tag: 'device-identity', + attrs: { 'key-index': `${keyIndex}` }, + content: accountEnc + } ] } ] diff --git a/node_modules/@adiwajshing/baileys/lib/WABinary/.trashed-1649374382-generic-utils.d.ts b/node_modules/@adiwajshing/baileys/lib/WABinary/.trashed-1649374382-generic-utils.d.ts deleted file mode 100644 index 4cfa51921..000000000 --- a/node_modules/@adiwajshing/baileys/lib/WABinary/.trashed-1649374382-generic-utils.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -/// -import { proto } from '../../WAProto'; -import { BinaryNode } from './types'; -export declare const getBinaryNodeChildren: ({ content }: BinaryNode, childTag: string) => BinaryNode[]; -export declare const getAllBinaryNodeChildren: ({ content }: BinaryNode) => BinaryNode[]; -export declare const getBinaryNodeChild: ({ content }: BinaryNode, childTag: string) => BinaryNode; -export declare const getBinaryNodeChildBuffer: (node: BinaryNode, childTag: string) => Uint8Array | Buffer; -export declare const getBinaryNodeChildUInt: (node: BinaryNode, childTag: string, length: number) => number; -export declare const assertNodeErrorFree: (node: BinaryNode) => void; -export declare const reduceBinaryNodeToDictionary: (node: BinaryNode, tag: string) => { - [_: string]: string; -}; -export declare const getBinaryNodeMessages: ({ content }: BinaryNode) => proto.WebMessageInfo[]; diff --git a/node_modules/@adiwajshing/baileys/lib/WABinary/Legacy/.trashed-1649374389-constants.d.ts b/node_modules/@adiwajshing/baileys/lib/WABinary/Legacy/constants.d.ts similarity index 100% rename from node_modules/@adiwajshing/baileys/lib/WABinary/Legacy/.trashed-1649374389-constants.d.ts rename to node_modules/@adiwajshing/baileys/lib/WABinary/Legacy/constants.d.ts diff --git a/node_modules/@adiwajshing/baileys/lib/WABinary/Legacy/constants.d_1.ts b/node_modules/@adiwajshing/baileys/lib/WABinary/Legacy/constants.d_1.ts deleted file mode 100644 index b8ffac41b..000000000 --- a/node_modules/@adiwajshing/baileys/lib/WABinary/Legacy/constants.d_1.ts +++ /dev/null @@ -1,20 +0,0 @@ -export declare const Tags: { - LIST_EMPTY: number; - STREAM_END: number; - DICTIONARY_0: number; - DICTIONARY_1: number; - DICTIONARY_2: number; - DICTIONARY_3: number; - LIST_8: number; - LIST_16: number; - JID_PAIR: number; - HEX_8: number; - BINARY_8: number; - BINARY_20: number; - BINARY_32: number; - NIBBLE_8: number; - SINGLE_BYTE_MAX: number; - PACKED_MAX: number; -}; -export declare const DoubleByteTokens: any[]; -export declare const SingleByteTokens: string[]; diff --git a/node_modules/@adiwajshing/baileys/lib/WABinary/Legacy/.trashed-1649374389-index.d.ts b/node_modules/@adiwajshing/baileys/lib/WABinary/Legacy/index.d.ts similarity index 100% rename from node_modules/@adiwajshing/baileys/lib/WABinary/Legacy/.trashed-1649374389-index.d.ts rename to node_modules/@adiwajshing/baileys/lib/WABinary/Legacy/index.d.ts diff --git a/node_modules/@adiwajshing/baileys/lib/WABinary/Legacy/index.d_1.ts b/node_modules/@adiwajshing/baileys/lib/WABinary/Legacy/index.d_1.ts deleted file mode 100644 index 5554908d8..000000000 --- a/node_modules/@adiwajshing/baileys/lib/WABinary/Legacy/index.d_1.ts +++ /dev/null @@ -1,9 +0,0 @@ -/// -import { BinaryNode } from '../types'; -export declare const isLegacyBinaryNode: (buffer: Buffer) => boolean; -declare function decode(buffer: Buffer, indexRef: { - index: number; -}): BinaryNode; -export declare const encodeBinaryNodeLegacy: ({ tag, attrs, content }: BinaryNode, buffer?: number[]) => Buffer; -export declare const decodeBinaryNodeLegacy: typeof decode; -export {}; diff --git a/node_modules/@adiwajshing/baileys/lib/WABinary/generic-utils.d.ts b/node_modules/@adiwajshing/baileys/lib/WABinary/generic-utils.d.ts new file mode 100644 index 000000000..a7708cd09 --- /dev/null +++ b/node_modules/@adiwajshing/baileys/lib/WABinary/generic-utils.d.ts @@ -0,0 +1,14 @@ +/// +import { proto } from '../../WAProto'; +import { BinaryNode } from './types'; +export declare const getBinaryNodeChildren: ({ content }: BinaryNode, childTag: string) => BinaryNode[]; +export declare const getAllBinaryNodeChildren: ({ content }: BinaryNode) => BinaryNode[]; +export declare const getBinaryNodeChild: ({ content }: BinaryNode, childTag: string) => BinaryNode; +export declare const getBinaryNodeChildBuffer: (node: BinaryNode, childTag: string) => Uint8Array | Buffer; +export declare const getBinaryNodeChildString: (node: BinaryNode, childTag: string) => string; +export declare const getBinaryNodeChildUInt: (node: BinaryNode, childTag: string, length: number) => number; +export declare const assertNodeErrorFree: (node: BinaryNode) => void; +export declare const reduceBinaryNodeToDictionary: (node: BinaryNode, tag: string) => { + [_: string]: string; +}; +export declare const getBinaryNodeMessages: ({ content }: BinaryNode) => proto.WebMessageInfo[]; diff --git a/node_modules/@adiwajshing/baileys/lib/WABinary/generic-utils.d_1.ts b/node_modules/@adiwajshing/baileys/lib/WABinary/generic-utils.d_1.ts deleted file mode 100644 index 4cfa51921..000000000 --- a/node_modules/@adiwajshing/baileys/lib/WABinary/generic-utils.d_1.ts +++ /dev/null @@ -1,13 +0,0 @@ -/// -import { proto } from '../../WAProto'; -import { BinaryNode } from './types'; -export declare const getBinaryNodeChildren: ({ content }: BinaryNode, childTag: string) => BinaryNode[]; -export declare const getAllBinaryNodeChildren: ({ content }: BinaryNode) => BinaryNode[]; -export declare const getBinaryNodeChild: ({ content }: BinaryNode, childTag: string) => BinaryNode; -export declare const getBinaryNodeChildBuffer: (node: BinaryNode, childTag: string) => Uint8Array | Buffer; -export declare const getBinaryNodeChildUInt: (node: BinaryNode, childTag: string, length: number) => number; -export declare const assertNodeErrorFree: (node: BinaryNode) => void; -export declare const reduceBinaryNodeToDictionary: (node: BinaryNode, tag: string) => { - [_: string]: string; -}; -export declare const getBinaryNodeMessages: ({ content }: BinaryNode) => proto.WebMessageInfo[]; diff --git a/node_modules/@adiwajshing/baileys/lib/WABinary/generic-utils.js b/node_modules/@adiwajshing/baileys/lib/WABinary/generic-utils.js index 8ae94f8a3..25fa2db0b 100644 --- a/node_modules/@adiwajshing/baileys/lib/WABinary/generic-utils.js +++ b/node_modules/@adiwajshing/baileys/lib/WABinary/generic-utils.js @@ -1,6 +1,6 @@ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -exports.getBinaryNodeMessages = exports.reduceBinaryNodeToDictionary = exports.assertNodeErrorFree = exports.getBinaryNodeChildUInt = exports.getBinaryNodeChildBuffer = exports.getBinaryNodeChild = exports.getAllBinaryNodeChildren = exports.getBinaryNodeChildren = void 0; +exports.getBinaryNodeMessages = exports.reduceBinaryNodeToDictionary = exports.assertNodeErrorFree = exports.getBinaryNodeChildUInt = exports.getBinaryNodeChildString = exports.getBinaryNodeChildBuffer = exports.getBinaryNodeChild = exports.getAllBinaryNodeChildren = exports.getBinaryNodeChildren = void 0; const boom_1 = require("@hapi/boom"); const WAProto_1 = require("../../WAProto"); // some extra useful utilities @@ -32,6 +32,17 @@ const getBinaryNodeChildBuffer = (node, childTag) => { } }; exports.getBinaryNodeChildBuffer = getBinaryNodeChildBuffer; +const getBinaryNodeChildString = (node, childTag) => { + var _a; + const child = (_a = exports.getBinaryNodeChild(node, childTag)) === null || _a === void 0 ? void 0 : _a.content; + if (Buffer.isBuffer(child) || child instanceof Uint8Array) { + return Buffer.from(child).toString('utf-8'); + } + else if (typeof child === 'string') { + return child; + } +}; +exports.getBinaryNodeChildString = getBinaryNodeChildString; const getBinaryNodeChildUInt = (node, childTag, length) => { const buff = exports.getBinaryNodeChildBuffer(node, childTag); if (buff) { diff --git a/node_modules/@adiwajshing/baileys/lib/WABinary/.trashed-1649374382-index.d.ts b/node_modules/@adiwajshing/baileys/lib/WABinary/index.d.ts similarity index 100% rename from node_modules/@adiwajshing/baileys/lib/WABinary/.trashed-1649374382-index.d.ts rename to node_modules/@adiwajshing/baileys/lib/WABinary/index.d.ts diff --git a/node_modules/@adiwajshing/baileys/lib/WABinary/index.d_1.ts b/node_modules/@adiwajshing/baileys/lib/WABinary/index.d_1.ts deleted file mode 100644 index 0bc7677b7..000000000 --- a/node_modules/@adiwajshing/baileys/lib/WABinary/index.d_1.ts +++ /dev/null @@ -1,20 +0,0 @@ -/// -import { proto } from '../../WAProto'; -import { BinaryNode } from './types'; -export declare const decodeBinaryNode: (data: any) => BinaryNode; -export declare const encodeBinaryNode: (node: BinaryNode) => Uint8Array; -export declare const getBinaryNodeChildren: ({ content }: BinaryNode, childTag: string) => BinaryNode[]; -export declare const getAllBinaryNodeChildren: ({ content }: BinaryNode) => BinaryNode[]; -export declare const getBinaryNodeChild: ({ content }: BinaryNode, childTag: string) => BinaryNode; -export declare const getBinaryNodeChildBuffer: (node: BinaryNode, childTag: string) => Uint8Array | Buffer; -export declare const getBinaryNodeChildUInt: (node: BinaryNode, childTag: string, length: number) => number; -export declare const assertNodeErrorFree: (node: BinaryNode) => void; -export declare const reduceBinaryNodeToDictionary: (node: BinaryNode, tag: string) => { - [_: string]: string; -}; -export declare const getBinaryNodeMessages: ({ content }: BinaryNode) => proto.WebMessageInfo[]; -export * from './generic-utils'; -export * from './jid-utils'; -export { Binary } from '../../WABinary/Binary'; -export * from './types'; -export * from './Legacy'; diff --git a/node_modules/@adiwajshing/baileys/lib/WABinary/.trashed-1649374382-jid-utils.d.ts b/node_modules/@adiwajshing/baileys/lib/WABinary/jid-utils.d.ts similarity index 100% rename from node_modules/@adiwajshing/baileys/lib/WABinary/.trashed-1649374382-jid-utils.d.ts rename to node_modules/@adiwajshing/baileys/lib/WABinary/jid-utils.d.ts diff --git a/node_modules/@adiwajshing/baileys/lib/WABinary/jid-utils.d_1.ts b/node_modules/@adiwajshing/baileys/lib/WABinary/jid-utils.d_1.ts deleted file mode 100644 index baacf2dc3..000000000 --- a/node_modules/@adiwajshing/baileys/lib/WABinary/jid-utils.d_1.ts +++ /dev/null @@ -1,28 +0,0 @@ -export declare const S_WHATSAPP_NET = "@s.whatsapp.net"; -export declare const OFFICIAL_BIZ_JID = "16505361212@c.us"; -export declare const SERVER_JID = "server@c.us"; -export declare const PSA_WID = "0@c.us"; -export declare const STORIES_JID = "status@broadcast"; -export declare type JidServer = 'c.us' | 'g.us' | 'broadcast' | 's.whatsapp.net' | 'call'; -export declare type JidWithDevice = { - user: string; - device?: number; -}; -export declare const jidEncode: (user: string | number | null, server: JidServer, device?: number, agent?: number) => string; -export declare const jidDecode: (jid: string) => { - server: string; - user: string; - agent: number; - device: number; -}; -/** is the jid a user */ -export declare const areJidsSameUser: (jid1: string, jid2: string) => boolean; -/** is the jid a user */ -export declare const isJidUser: (jid: string) => boolean; -/** is the jid a broadcast */ -export declare const isJidBroadcast: (jid: string) => boolean; -/** is the jid a broadcast */ -export declare const isJidGroup: (jid: string) => boolean; -/** is the jid the status broadcast */ -export declare const isJidStatusBroadcast: (jid: string) => boolean; -export declare const jidNormalizedUser: (jid: string) => string; diff --git a/node_modules/@adiwajshing/baileys/lib/WABinary/.trashed-1649374382-types.d.ts b/node_modules/@adiwajshing/baileys/lib/WABinary/types.d.ts similarity index 100% rename from node_modules/@adiwajshing/baileys/lib/WABinary/.trashed-1649374382-types.d.ts rename to node_modules/@adiwajshing/baileys/lib/WABinary/types.d.ts diff --git a/node_modules/@adiwajshing/baileys/lib/WABinary/types.d_1.ts b/node_modules/@adiwajshing/baileys/lib/WABinary/types.d_1.ts deleted file mode 100644 index e279ae994..000000000 --- a/node_modules/@adiwajshing/baileys/lib/WABinary/types.d_1.ts +++ /dev/null @@ -1,16 +0,0 @@ -/** - * the binary node WA uses internally for communication - * - * this is manipulated soley as an object and it does not have any functions. - * This is done for easy serialization, to prevent running into issues with prototypes & - * to maintain functional code structure - * */ -export declare type BinaryNode = { - tag: string; - attrs: { - [key: string]: string; - }; - content?: BinaryNode[] | string | Uint8Array; -}; -export declare type BinaryNodeAttributes = BinaryNode['attrs']; -export declare type BinaryNodeData = BinaryNode['content']; diff --git a/node_modules/@adiwajshing/baileys/node_modules/ws/README.md b/node_modules/@adiwajshing/baileys/node_modules/ws/README.md index cab335b7b..97ab9fabe 100644 --- a/node_modules/@adiwajshing/baileys/node_modules/ws/README.md +++ b/node_modules/@adiwajshing/baileys/node_modules/ws/README.md @@ -252,8 +252,8 @@ server.listen(8080); ### Client authentication ```js -import WebSocket from 'ws'; import { createServer } from 'http'; +import { WebSocketServer } from 'ws'; const server = createServer(); const wss = new WebSocketServer({ noServer: true }); diff --git a/node_modules/@adiwajshing/baileys/node_modules/ws/lib/websocket.js b/node_modules/@adiwajshing/baileys/node_modules/ws/lib/websocket.js index 6fff935cb..ca44bc344 100644 --- a/node_modules/@adiwajshing/baileys/node_modules/ws/lib/websocket.js +++ b/node_modules/@adiwajshing/baileys/node_modules/ws/lib/websocket.js @@ -30,10 +30,11 @@ const { const { format, parse } = require('./extension'); const { toBuffer } = require('./buffer-util'); +const closeTimeout = 30 * 1000; +const kAborted = Symbol('kAborted'); +const protocolVersions = [8, 13]; const readyStates = ['CONNECTING', 'OPEN', 'CLOSING', 'CLOSED']; const subprotocolRegex = /^[!#$%&'*+\-.0-9A-Z^_`|a-z~]+$/; -const protocolVersions = [8, 13]; -const closeTimeout = 30 * 1000; /** * Class representing a WebSocket. @@ -647,7 +648,7 @@ function initAsClient(websocket, address, protocols, options) { hostname: undefined, protocol: undefined, timeout: undefined, - method: undefined, + method: 'GET', host: undefined, path: undefined, port: undefined @@ -701,7 +702,7 @@ function initAsClient(websocket, address, protocols, options) { const defaultPort = isSecure ? 443 : 80; const key = randomBytes(16).toString('base64'); - const get = isSecure ? https.get : http.get; + const request = isSecure ? https.request : http.request; const protocolSet = new Set(); let perMessageDeflate; @@ -766,6 +767,8 @@ function initAsClient(websocket, address, protocols, options) { opts.path = parts[1]; } + let req; + if (opts.followRedirects) { if (websocket._redirects === 0) { websocket._originalHost = parsedUrl.host; @@ -783,7 +786,10 @@ function initAsClient(websocket, address, protocols, options) { options.headers[key.toLowerCase()] = value; } } - } else if (parsedUrl.host !== websocket._originalHost) { + } else if ( + websocket.listenerCount('redirect') === 0 && + parsedUrl.host !== websocket._originalHost + ) { // // Match curl 7.77.0 behavior and drop the following headers. These // headers are also dropped when following a redirect to a subdomain. @@ -803,9 +809,24 @@ function initAsClient(websocket, address, protocols, options) { options.headers.authorization = 'Basic ' + Buffer.from(opts.auth).toString('base64'); } - } - let req = (websocket._req = get(opts)); + req = websocket._req = request(opts); + + if (websocket._redirects) { + // + // Unlike what is done for the `'upgrade'` event, no early exit is + // triggered here if the user calls `websocket.close()` or + // `websocket.terminate()` from a listener of the `'redirect'` event. This + // is because the user can also call `request.destroy()` with an error + // before calling `websocket.close()` or `websocket.terminate()` and this + // would result in an error being emitted on the `request` object with no + // `'error'` event listeners attached. + // + websocket.emit('redirect', websocket.url, req); + } + } else { + req = websocket._req = request(opts); + } if (opts.timeout) { req.on('timeout', () => { @@ -814,7 +835,7 @@ function initAsClient(websocket, address, protocols, options) { } req.on('error', (err) => { - if (req === null || req.aborted) return; + if (req === null || req[kAborted]) return; req = websocket._req = null; emitErrorAndClose(websocket, err); @@ -861,8 +882,8 @@ function initAsClient(websocket, address, protocols, options) { websocket.emit('upgrade', res); // - // The user may have closed the connection from a listener of the `upgrade` - // event. + // The user may have closed the connection from a listener of the + // `'upgrade'` event. // if (websocket.readyState !== WebSocket.CONNECTING) return; @@ -947,10 +968,12 @@ function initAsClient(websocket, address, protocols, options) { skipUTF8Validation: opts.skipUTF8Validation }); }); + + req.end(); } /** - * Emit the `'error'` and `'close'` event. + * Emit the `'error'` and `'close'` events. * * @param {WebSocket} websocket The WebSocket instance * @param {Error} The error to emit @@ -1007,6 +1030,7 @@ function abortHandshake(websocket, stream, message) { Error.captureStackTrace(err, abortHandshake); if (stream.setHeader) { + stream[kAborted] = true; stream.abort(); if (stream.socket && !stream.socket.destroyed) { @@ -1018,8 +1042,7 @@ function abortHandshake(websocket, stream, message) { stream.socket.destroy(); } - stream.once('abort', websocket.emitClose.bind(websocket)); - websocket.emit('error', err); + process.nextTick(emitErrorAndClose, websocket, err); } else { stream.destroy(err); stream.once('error', websocket.emit.bind(websocket, 'error')); diff --git a/node_modules/@adiwajshing/baileys/node_modules/ws/package.json b/node_modules/@adiwajshing/baileys/node_modules/ws/package.json index 57ddc7e95..df81cc170 100644 --- a/node_modules/@adiwajshing/baileys/node_modules/ws/package.json +++ b/node_modules/@adiwajshing/baileys/node_modules/ws/package.json @@ -1,6 +1,6 @@ { "name": "ws", - "version": "8.5.0", + "version": "8.6.0", "description": "Simple to use, blazing fast and thoroughly tested websocket client and server for Node.js", "keywords": [ "HyBi", diff --git a/node_modules/@adiwajshing/baileys/package.json b/node_modules/@adiwajshing/baileys/package.json index cd81c56c4..e41b04dce 100644 --- a/node_modules/@adiwajshing/baileys/package.json +++ b/node_modules/@adiwajshing/baileys/package.json @@ -1,6 +1,6 @@ { "name": "@adiwajshing/baileys", - "version": "4.0.1", + "version": "4.1.0", "description": "WhatsApp API", "homepage": "https://github.com/adiwajshing/Baileys", "main": "lib/index.js", @@ -51,6 +51,20 @@ "qrcode-terminal": "^0.12.0", "sharp": "^0.29.3" }, + "peerDependenciesMeta": { + "@adiwajshing/keyed-db": { + "optional": true + }, + "jimp": { + "optional": true + }, + "qrcode-terminal": { + "optional": true + }, + "sharp": { + "optional": true + } + }, "files": [ "lib/*", "WAProto/*", @@ -72,7 +86,7 @@ "qrcode-terminal": "^0.12.0", "sharp": "^0.29.3", "ts-jest": "^27.0.3", - "ts-node": "^10.0.0", + "ts-node": "^10.7.0", "typedoc": "^0.22.0", "typescript": "^4.0.0" } diff --git a/node_modules/@bochilteam/scraper/LICENSE b/node_modules/@bochilteam/scraper/LICENSE new file mode 100644 index 000000000..f288702d2 --- /dev/null +++ b/node_modules/@bochilteam/scraper/LICENSE @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. diff --git a/node_modules/@bochilteam/scraper/README.md b/node_modules/@bochilteam/scraper/README.md new file mode 100644 index 000000000..fe393e500 --- /dev/null +++ b/node_modules/@bochilteam/scraper/README.md @@ -0,0 +1,281 @@ +# scraper + +Install package +```sh +npm i @bochilteam/scraper +``` + +## Example use +```js +// ESM +import scraper from '@bochilteam/scraper' +// CJS +const scraper = require('@bochilteam/scraper') +``` +### Instagram Downloader +```js +// Instagram Downloader +import { + instagramdl, + instagramdlv2, + instagramStory, + instagramStoryv2 +} from '@bochilteam/scraper' +const url = 'https://www.instagram.com/reel/CXK49yFLtJ_/?utm_source=ig_web_copy_link' +instagramdl(url).then(console.log).catch(console.error) +instagramdlv2(url).then(console.log).catch(console.error) +// use both to handle error +instagramdl(url).catch(_ => instagramdlv2(url)).then(console.log) +// Use async/await or top level await +console.log(await instagramdl(url).catch(console.error)) +console.log(await instagramdlv2(url).catch(console.error)) +// Instagram Story downloader +const username = 'freefirebgid' +const story = await instagramStory(username).catch(async _ => await instagramStoryv2(username)) +console.log(story) +``` +- `instagramdl` use website https://snapinsta.app, +- `instagramdlv2` use website https://downloadgram.org +- `instagramdlv3` use website https://instasave.website +- `instagramdlv4` use website https://instadownloader.co +- `instagramStory` use website https://storydownloader.app +- `instagramStoryv2` use website https://www.instagramsave.com + + +### Youtube Downloader +```js +// Youtube downloader +import { + youtubedl, + youtubedlv2 +} from '@bochilteam/scraper' +const url = 'https://youtu.be/iik25wqIuFo' +youtubedl(url).catch(_ => youtubedlv2(url)).then(({ video }) => { + video['240p'].download().then(console.log).catch(console.error) +}) +// Use async/await +const yt = await youtubedl(url).catch(async () => await youtubedlv2(url)) +const dl_url = await yt.video['240p'].download() +console.log(dl_url) +``` +- `youtubedl` use website https://www.y2mate.com +- `youtubedlv2` use website https://yt5s.com +- `youtubedlv3` use website https://onlinevideoconverter.pro +- `youtubeSearch` use website https://www.youtube.com + + +### Tiktok downloader +```js +// Tiktok downloader +import { + tiktokdl, + tiktokdlv2 +} from '@bochilteam/scraper' +// Tiktok downloader v1 +const url = 'https://www.tiktok.com/@tiktok/video/6844446901010982300' +tiktokdl(url).then(console.log).catch(console.error) +// tiktokdl v2 +tiktokdlv2(url).then(console.log).catch(console.error) +// async / await +console.log(await tiktokdl(url).catch(console.error)) +console.log(await tiktokdlv2(url).catch(console.error)) +``` +- `tiktokdl` use website https://snaptik.app +- `tiktokdlv2` use website https://api.tikmate.app +- `tiktokdlv3` use website 'https://ssstik.io +- `tiktokfyp` use website https://t.tiktok.com [**Not Working**] + +### All in One Downloader +```js +import { + aiovideodl, + savefrom +} from '@bochilteam/scraper' +// Facebook video downloader +console.log(await aiovideodl('https://fb.watch/9WktuN9j-z/')) +// Twitter video downloader +console.log(await aiovideodl('https://twitter.com/jen_degen/status/1458167531869458440?s=20')) +// Tiktok downloader +console.log(await savefrom('https://www.tiktok.com/@omagadsus/video/7025456384175017243?is_from_webapp=1&sender_device=pc&web_id6982004129280116226')) +// Instagram downloader +console.log(await savefrom('https://www.instagram.com/reel/CXK49yFLtJ_/?utm_source=ig_web_copy_link')) +``` +- `aiovideodl` use website https://aiovideodl.ml +- `savefrom` use website https://id.savefrom.net + +### Aksara Jawa +```js +// Aksara jawa +import { + latinToAksara, + aksaraToLatin +} from '@bochilteam/scraper' +// Latin to aksara jawa +console.log(latinToAksara('hallo rek')) +// Aksara jawa to latin +console.log(aksaraToLatin('ꦲꦭ꧀ꦭꦺꦴ​ꦫꦺꦏ꧀', { HVokal: false })) // Hvokal: false mean ꦲ will return 'ha' not vokal +``` +Source: https://bennylin.github.io/transliterasijawa/ + + +### Primbons +```js +// Primbons +import { + getZodiac, + nomorhoki +} from '@bochilteam/scraper' +// Get zodiac +console.log(getZodiac(1, 1)) +// Get nomor hoki +console.log(await nomorhoki(6213353)) +``` +- `artimimpi` use website https://www.primbon.com +- `artiname` use website https://www.primbon.com +- `nomorhoki` use website https://www.primbon.com +- `getZodiac` source: https://github.com/Nurutomo/wabot-aq/blob/master/plugins/zodiac.js + + +### Images +```js +// Images +import { + googleImage, + pinterest, + wallpaper, + stickerTelegram, +} from '@bochilteam/scraper' +const keyword = 'minecraft' +// Google image +console.log(await googleImage(keyword)) +// Pinterest image +console.log(await pinterest(keyword)) +// Wallpaper +console.log(await wallpaper(keyword)) +// Sticker telegram +console.log(await stickerTelegram(keyword)) +``` +- `googleImage` use website https://www.google.com +- `pinterest` use website https://www.pinterest.com +- `stickerTelegram` use website https://combot.org +- `stickerLine` use website https://store.line.me +- `wallpaper` use website https://www.shutterstock.com +- `wallpaperv2` use website https://wall.alphacoders.com +- `wallpaperv3` use website https://www.hdwallpapers.in + + +### Religions +```js +// Religions +import { + asmaulhusna, asmaulhusnajson, + alquran, + jadwalsholat, listJadwalSholat +} from '@bochilteam/scraper' +// Asmaul Husna +console.log(await asmaulhusna()) +// Asmaul Husna Json +console.log(asmaulhusnajson) // the json will empty if you never use `asmaulhusna()` +// alquran +console.log(await alquran()) +// Jadwal Sholat +console.log(await jadwalsholat('semarang')) +``` +- `alquran` source: https://raw.githubusercontent.com/rzkytmgr/quran-api/master/data/quran.json +- `asmaulhusna` source: https://raw.githubusercontent.com/BochilTeam/database/master/religi/asmaulhusna.json +- `jadwalsholat` use website https://www.jadwalsholat.org + + +### Games +```js +// Games +import { + tebakgambar, tebakgambarjson, + asahotak, asahotakjson +} from '@bochilteam/scraper' +// Tebak gambar +console.log(await tebakgambar()) +// Tebak gambar json +console.log(tebakgambarjson) // the json will empty if you never use `tebakgambar()` +// Asahotak +console.log(await asahotak()) +// Asahotak json +console.log(asahotakjson) // the json will empty if you never use `asahotak()` +``` +- `asahotak` source: https://raw.githubusercontent.com/BochilTeam/database/master/games/asahotak.json +- `caklontong` source: https://raw.githubusercontent.com/BochilTeam/database/master/games/caklontong.json +- `family100` source: https://raw.githubusercontent.com/BochilTeam/database/master/games/family100.json +- `siapakahaku` source: https://raw.githubusercontent.com/BochilTeam/database/master/games/siapakahaku.json +- `susunkata` source: https://raw.githubusercontent.com/BochilTeam/database/master/games/susunkata.json +- `tebakbendera` source: https://raw.githubusercontent.com/BochilTeam/database/master/games/tebakbendera.json +- `tebakgambar` source: https://raw.githubusercontent.com/BochilTeam/database/master/games/tebakgambar.json +- `tebakkabupaten` source: https://raw.githubusercontent.com/BochilTeam/database/master/games/tebakkabupaten.json +- `tebakkata` source: https://raw.githubusercontent.com/BochilTeam/database/master/games/tebakkata.json +- `tebakkimia` source: https://raw.githubusercontent.com/BochilTeam/database/master/games/tebakkimia.json +- `tebaklirik` source: https://raw.githubusercontent.com/BochilTeam/database/master/games/tebaklirik.json +- `tebaktebakan` source: https://raw.githubusercontent.com/BochilTeam/database/master/games/tebaktebakan.json +- `tekateki` source: https://raw.githubusercontent.com/BochilTeam/database/master/games/tekateki.json + + +### News +```js +// News +import { + cnbindonesia, + antaranews, + kompas +} from '@bochilteam/scraper' +// Cnbindonesia +console.log(await cnbindonesia()) +// Antaranews +console.log(await antaranews()) +// Kompas +console.log(await kompas()) +``` +- `antaranews` use website https://www.antaranews.com +- `cnbindonesia` use website https://www.cnbcindonesia.com +- `kompas` use website https://www.kompas.com +- `liputan6` use website https://www.liputan6.com +- `merdeka` use website https://www.merdeka.com +- `suaracom` use website https://www.suara.com + +### Encryption +```js +// Encryption +import { + toBase64, + fromBase64ToString, + randomUUID, + randomBytes, + createHash +} from '@bochilteam/scraper' +// To base64 +const base64 = toBase64('Hello World!!') +console.log(base64) +// From base64 to string +console.log(fromBase64ToString(base64)) // 'Hello World!!' +// Random UUID +console.log(randomUUID()) +// Random Bytes +console.log(randomBytes(16)) +// Hash +console.log(createHash('sha256', 'Hello World!!')) +``` +- `randomUUID` source: https://github.com/uuidjs/uuid/blob/main/src/v4.js and https://github.com/nodejs/node/blob/master/lib/internal/crypto/random.js +- `randomBytes` use `crypto` module +- `createHash` use `crypto` module + +### Bioskop +```js +// Bioskop +import { + bioskopNow, + bioskop +} from '@bochilteam/scraper' +// Bioskop +console.log(await bioskop()) +// Bioskop Now +console.log(await bioskopNow()) +``` +- `bioskop` use website https://jadwalnonton.com +- `bioskopNow` use website https://jadwalnonton.com \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/@types/encryptions/base64.d.ts b/node_modules/@bochilteam/scraper/lib/@types/encryptions/base64.d.ts new file mode 100644 index 000000000..ecdc3f2bd --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/@types/encryptions/base64.d.ts @@ -0,0 +1,3 @@ +export declare function toBase64(data: any): string; +export declare function fromBase64ToString(data: string): string; +//# sourceMappingURL=base64.d.ts.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/@types/encryptions/base64.d.ts.map b/node_modules/@bochilteam/scraper/lib/@types/encryptions/base64.d.ts.map new file mode 100644 index 000000000..85579f3c1 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/@types/encryptions/base64.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"base64.d.ts","sourceRoot":"","sources":["../../../src/encryptions/base64.ts"],"names":[],"mappings":"AAAA,wBAAgB,QAAQ,CAAE,IAAI,EAAE,GAAG,GAAG,MAAM,CAG3C;AAED,wBAAgB,kBAAkB,CAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAGxD"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/@types/encryptions/crypto.d.ts b/node_modules/@bochilteam/scraper/lib/@types/encryptions/crypto.d.ts new file mode 100644 index 000000000..0a659833b --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/@types/encryptions/crypto.d.ts @@ -0,0 +1,8 @@ +/// +import crypto from 'crypto'; +export declare function randomUUID(opts?: { + disableEntropyCache: boolean; +}): string; +export declare function randomBytes(size: number): string; +export declare function createHash(algorithm: string, data: crypto.BinaryLike): string; +//# sourceMappingURL=crypto.d.ts.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/@types/encryptions/crypto.d.ts.map b/node_modules/@bochilteam/scraper/lib/@types/encryptions/crypto.d.ts.map new file mode 100644 index 000000000..b7b5f4fd3 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/@types/encryptions/crypto.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"crypto.d.ts","sourceRoot":"","sources":["../../../src/encryptions/crypto.ts"],"names":[],"mappings":";AAAA,OAAO,MAAM,MAAM,QAAQ,CAAA;AAE3B,wBAAgB,UAAU,CAAE,IAAI,CAAC,EAAE;IAAE,mBAAmB,EAAE,OAAO,CAAA;CAAE,GAAG,MAAM,CAa3E;AAED,wBAAgB,WAAW,CAAE,IAAI,EAAE,MAAM,UAExC;AAED,wBAAgB,UAAU,CACxB,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,MAAM,CAAC,UAAU,UAGxB"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/@types/encryptions/index.d.ts b/node_modules/@bochilteam/scraper/lib/@types/encryptions/index.d.ts new file mode 100644 index 000000000..8612131df --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/@types/encryptions/index.d.ts @@ -0,0 +1,3 @@ +export * from './base64.js'; +export * from './crypto.js'; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/@types/encryptions/index.d.ts.map b/node_modules/@bochilteam/scraper/lib/@types/encryptions/index.d.ts.map new file mode 100644 index 000000000..b3a2756ff --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/@types/encryptions/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/encryptions/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;AAC3B,cAAc,aAAa,CAAA"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/@types/encryptions/test.d.ts b/node_modules/@bochilteam/scraper/lib/@types/encryptions/test.d.ts new file mode 100644 index 000000000..9bcc4712a --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/@types/encryptions/test.d.ts @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=test.d.ts.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/@types/encryptions/test.d.ts.map b/node_modules/@bochilteam/scraper/lib/@types/encryptions/test.d.ts.map new file mode 100644 index 000000000..7ba3b3f20 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/@types/encryptions/test.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"test.d.ts","sourceRoot":"","sources":["../../../src/encryptions/test.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/@types/games/asahotak.d.ts b/node_modules/@bochilteam/scraper/lib/@types/games/asahotak.d.ts new file mode 100644 index 000000000..6bfd836bb --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/@types/games/asahotak.d.ts @@ -0,0 +1,4 @@ +import { AsahOtak } from './types'; +export declare let asahotakjson: AsahOtak[]; +export default function asahotak(): Promise; +//# sourceMappingURL=asahotak.d.ts.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/@types/games/asahotak.d.ts.map b/node_modules/@bochilteam/scraper/lib/@types/games/asahotak.d.ts.map new file mode 100644 index 000000000..6abe7795d --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/@types/games/asahotak.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"asahotak.d.ts","sourceRoot":"","sources":["../../../src/games/asahotak.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAA;AAElC,eAAO,IAAI,YAAY,EAAE,QAAQ,EAAE,CAAA;AACnC,wBAA8B,QAAQ,IAAK,OAAO,CAAC,QAAQ,CAAC,CAS3D"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/@types/games/caklontong.d.ts b/node_modules/@bochilteam/scraper/lib/@types/games/caklontong.d.ts new file mode 100644 index 000000000..0f98178ff --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/@types/games/caklontong.d.ts @@ -0,0 +1,4 @@ +import { CakLontong } from './types'; +export declare let caklontongjson: CakLontong[]; +export default function caklontong(): Promise; +//# sourceMappingURL=caklontong.d.ts.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/@types/games/caklontong.d.ts.map b/node_modules/@bochilteam/scraper/lib/@types/games/caklontong.d.ts.map new file mode 100644 index 000000000..7cf17e6fa --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/@types/games/caklontong.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"caklontong.d.ts","sourceRoot":"","sources":["../../../src/games/caklontong.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AAEpC,eAAO,IAAI,cAAc,EAAE,UAAU,EAAE,CAAA;AACvC,wBAA8B,UAAU,IAAK,OAAO,CAAC,UAAU,CAAC,CAS/D"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/@types/games/family100.d.ts b/node_modules/@bochilteam/scraper/lib/@types/games/family100.d.ts new file mode 100644 index 000000000..563201ff9 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/@types/games/family100.d.ts @@ -0,0 +1,4 @@ +import { Family100 } from './types'; +export declare let family100json: Family100[]; +export default function family100(): Promise; +//# sourceMappingURL=family100.d.ts.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/@types/games/family100.d.ts.map b/node_modules/@bochilteam/scraper/lib/@types/games/family100.d.ts.map new file mode 100644 index 000000000..6a5c93a37 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/@types/games/family100.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"family100.d.ts","sourceRoot":"","sources":["../../../src/games/family100.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAA;AAEnC,eAAO,IAAI,aAAa,EAAE,SAAS,EAAE,CAAA;AACrC,wBAA8B,SAAS,IAAK,OAAO,CAAC,SAAS,CAAC,CAS7D"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/@types/games/index.d.ts b/node_modules/@bochilteam/scraper/lib/@types/games/index.d.ts new file mode 100644 index 000000000..5f981f8ce --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/@types/games/index.d.ts @@ -0,0 +1,15 @@ +import asahotak, { asahotakjson } from './asahotak.js'; +import caklontong, { caklontongjson } from './caklontong.js'; +import family100, { family100json } from './family100.js'; +import siapakahaku, { siapakahakujson } from './siapakahaku.js'; +import susunkata, { susunkatajson } from './susunkata.js'; +import tebakbendera, { tebakbenderajson } from './tebakbendera.js'; +import tebakgambar, { tebakgambarjson } from './tebakgambar.js'; +import tebakkabupaten, { tebakkabupatenjson } from './tebakkabupaten.js'; +import tebakkata, { tebakkatajson } from './tebakkata.js'; +import tebakkimia, { tebakkimiajson } from './tebakkimia.js'; +import tebaklirik, { tebaklirikjson } from './tebaklirik.js'; +import tebaktebakan, { tebaktebakanjson } from './tebaktebakan.js'; +import tekateki, { tekatekijson } from './tekateki.js'; +export { tebakgambar, tebakgambarjson, caklontong, caklontongjson, family100, family100json, asahotak, asahotakjson, tebakkata, tebakkatajson, tekateki, tekatekijson, tebakkimia, tebakkimiajson, tebakkabupaten, tebakkabupatenjson, siapakahaku, siapakahakujson, susunkata, susunkatajson, tebakbendera, tebakbenderajson, tebaklirik, tebaklirikjson, tebaktebakan, tebaktebakanjson }; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/@types/games/index.d.ts.map b/node_modules/@bochilteam/scraper/lib/@types/games/index.d.ts.map new file mode 100644 index 000000000..94709888a --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/@types/games/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/games/index.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,EAAE,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AACtD,OAAO,UAAU,EAAE,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAC5D,OAAO,SAAS,EAAE,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAA;AACzD,OAAO,WAAW,EAAE,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAA;AAC/D,OAAO,SAAS,EAAE,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAA;AACzD,OAAO,YAAY,EAAE,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAA;AAClE,OAAO,WAAW,EAAE,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAA;AAC/D,OAAO,cAAc,EAAE,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAA;AACxE,OAAO,SAAS,EAAE,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAA;AACzD,OAAO,UAAU,EAAE,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAC5D,OAAO,UAAU,EAAE,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAC5D,OAAO,YAAY,EAAE,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAA;AAClE,OAAO,QAAQ,EAAE,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AAEtD,OAAO,EACL,WAAW,EACX,eAAe,EACf,UAAU,EACV,cAAc,EACd,SAAS,EACT,aAAa,EACb,QAAQ,EACR,YAAY,EACZ,SAAS,EACT,aAAa,EACb,QAAQ,EACR,YAAY,EACZ,UAAU,EACV,cAAc,EACd,cAAc,EACd,kBAAkB,EAClB,WAAW,EACX,eAAe,EACf,SAAS,EACT,aAAa,EACb,YAAY,EACZ,gBAAgB,EAChB,UAAU,EACV,cAAc,EACd,YAAY,EACZ,gBAAgB,EACjB,CAAA"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/@types/games/siapakahaku.d.ts b/node_modules/@bochilteam/scraper/lib/@types/games/siapakahaku.d.ts new file mode 100644 index 000000000..149d157f0 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/@types/games/siapakahaku.d.ts @@ -0,0 +1,4 @@ +import { SiapakahAku } from './types'; +export declare let siapakahakujson: SiapakahAku[]; +export default function siapakahaku(): Promise; +//# sourceMappingURL=siapakahaku.d.ts.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/@types/games/siapakahaku.d.ts.map b/node_modules/@bochilteam/scraper/lib/@types/games/siapakahaku.d.ts.map new file mode 100644 index 000000000..1a1205493 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/@types/games/siapakahaku.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"siapakahaku.d.ts","sourceRoot":"","sources":["../../../src/games/siapakahaku.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAErC,eAAO,IAAI,eAAe,EAAE,WAAW,EAAE,CAAA;AACzC,wBAA8B,WAAW,IAAK,OAAO,CAAC,WAAW,CAAC,CASjE"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/@types/games/susunkata.d.ts b/node_modules/@bochilteam/scraper/lib/@types/games/susunkata.d.ts new file mode 100644 index 000000000..df5e29ffe --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/@types/games/susunkata.d.ts @@ -0,0 +1,4 @@ +import { SusunKata } from './types'; +export declare let susunkatajson: SusunKata[]; +export default function susunkata(): Promise; +//# sourceMappingURL=susunkata.d.ts.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/@types/games/susunkata.d.ts.map b/node_modules/@bochilteam/scraper/lib/@types/games/susunkata.d.ts.map new file mode 100644 index 000000000..8d0b7d6c2 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/@types/games/susunkata.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"susunkata.d.ts","sourceRoot":"","sources":["../../../src/games/susunkata.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAA;AAEnC,eAAO,IAAI,aAAa,EAAE,SAAS,EAAE,CAAA;AACrC,wBAA8B,SAAS,IAAK,OAAO,CAAC,SAAS,CAAC,CAS7D"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/@types/games/tebakbendera.d.ts b/node_modules/@bochilteam/scraper/lib/@types/games/tebakbendera.d.ts new file mode 100644 index 000000000..a5e9b7b27 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/@types/games/tebakbendera.d.ts @@ -0,0 +1,4 @@ +import { TebakBendera } from './types'; +export declare let tebakbenderajson: TebakBendera[]; +export default function tebakbendera(): Promise; +//# sourceMappingURL=tebakbendera.d.ts.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/@types/games/tebakbendera.d.ts.map b/node_modules/@bochilteam/scraper/lib/@types/games/tebakbendera.d.ts.map new file mode 100644 index 000000000..4d197d6a0 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/@types/games/tebakbendera.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"tebakbendera.d.ts","sourceRoot":"","sources":["../../../src/games/tebakbendera.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAEtC,eAAO,IAAI,gBAAgB,EAAE,YAAY,EAAE,CAAA;AAC3C,wBAA8B,YAAY,IAAK,OAAO,CAAC,YAAY,CAAC,CASnE"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/@types/games/tebakgambar.d.ts b/node_modules/@bochilteam/scraper/lib/@types/games/tebakgambar.d.ts new file mode 100644 index 000000000..7a5c65160 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/@types/games/tebakgambar.d.ts @@ -0,0 +1,4 @@ +import { TebakGambar } from './types'; +export declare let tebakgambarjson: TebakGambar[]; +export default function tebakgambar(): Promise; +//# sourceMappingURL=tebakgambar.d.ts.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/@types/games/tebakgambar.d.ts.map b/node_modules/@bochilteam/scraper/lib/@types/games/tebakgambar.d.ts.map new file mode 100644 index 000000000..6b9f0d5b2 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/@types/games/tebakgambar.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"tebakgambar.d.ts","sourceRoot":"","sources":["../../../src/games/tebakgambar.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAErC,eAAO,IAAI,eAAe,EAAE,WAAW,EAAE,CAAA;AACzC,wBAA8B,WAAW,IAAK,OAAO,CAAC,WAAW,CAAC,CASjE"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/@types/games/tebakkabupaten.d.ts b/node_modules/@bochilteam/scraper/lib/@types/games/tebakkabupaten.d.ts new file mode 100644 index 000000000..e38cd84a6 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/@types/games/tebakkabupaten.d.ts @@ -0,0 +1,4 @@ +import { TebakKabupaten } from './types'; +export declare let tebakkabupatenjson: TebakKabupaten[]; +export default function tebakkabupaten(): Promise; +//# sourceMappingURL=tebakkabupaten.d.ts.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/@types/games/tebakkabupaten.d.ts.map b/node_modules/@bochilteam/scraper/lib/@types/games/tebakkabupaten.d.ts.map new file mode 100644 index 000000000..e7d07d198 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/@types/games/tebakkabupaten.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"tebakkabupaten.d.ts","sourceRoot":"","sources":["../../../src/games/tebakkabupaten.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAExC,eAAO,IAAI,kBAAkB,EAAE,cAAc,EAAE,CAAA;AAC/C,wBAA8B,cAAc,IAAK,OAAO,CAAC,cAAc,CAAC,CASvE"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/@types/games/tebakkata.d.ts b/node_modules/@bochilteam/scraper/lib/@types/games/tebakkata.d.ts new file mode 100644 index 000000000..f8c3de7bf --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/@types/games/tebakkata.d.ts @@ -0,0 +1,4 @@ +import { TebakKata } from './types'; +export declare let tebakkatajson: TebakKata[]; +export default function tebakkata(): Promise; +//# sourceMappingURL=tebakkata.d.ts.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/@types/games/tebakkata.d.ts.map b/node_modules/@bochilteam/scraper/lib/@types/games/tebakkata.d.ts.map new file mode 100644 index 000000000..177c0a982 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/@types/games/tebakkata.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"tebakkata.d.ts","sourceRoot":"","sources":["../../../src/games/tebakkata.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAA;AAEnC,eAAO,IAAI,aAAa,EAAE,SAAS,EAAE,CAAA;AACrC,wBAA8B,SAAS,IAAK,OAAO,CAAC,SAAS,CAAC,CAS7D"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/@types/games/tebakkimia.d.ts b/node_modules/@bochilteam/scraper/lib/@types/games/tebakkimia.d.ts new file mode 100644 index 000000000..e6ec5ac0a --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/@types/games/tebakkimia.d.ts @@ -0,0 +1,4 @@ +import { TebakKimia } from './types'; +export declare let tebakkimiajson: TebakKimia[]; +export default function tebakkimia(): Promise; +//# sourceMappingURL=tebakkimia.d.ts.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/@types/games/tebakkimia.d.ts.map b/node_modules/@bochilteam/scraper/lib/@types/games/tebakkimia.d.ts.map new file mode 100644 index 000000000..3703863f0 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/@types/games/tebakkimia.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"tebakkimia.d.ts","sourceRoot":"","sources":["../../../src/games/tebakkimia.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AAEpC,eAAO,IAAI,cAAc,EAAE,UAAU,EAAE,CAAA;AACvC,wBAA8B,UAAU,IAAK,OAAO,CAAC,UAAU,CAAC,CAS/D"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/@types/games/tebaklirik.d.ts b/node_modules/@bochilteam/scraper/lib/@types/games/tebaklirik.d.ts new file mode 100644 index 000000000..82bbeec1f --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/@types/games/tebaklirik.d.ts @@ -0,0 +1,4 @@ +import { TebakLirik } from './types'; +export declare let tebaklirikjson: TebakLirik[]; +export default function tebaklirik(): Promise; +//# sourceMappingURL=tebaklirik.d.ts.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/@types/games/tebaklirik.d.ts.map b/node_modules/@bochilteam/scraper/lib/@types/games/tebaklirik.d.ts.map new file mode 100644 index 000000000..dfb867eb5 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/@types/games/tebaklirik.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"tebaklirik.d.ts","sourceRoot":"","sources":["../../../src/games/tebaklirik.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AAEpC,eAAO,IAAI,cAAc,EAAE,UAAU,EAAE,CAAA;AACvC,wBAA8B,UAAU,IAAK,OAAO,CAAC,UAAU,CAAC,CAS/D"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/@types/games/tebaktebakan.d.ts b/node_modules/@bochilteam/scraper/lib/@types/games/tebaktebakan.d.ts new file mode 100644 index 000000000..3fd1291d4 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/@types/games/tebaktebakan.d.ts @@ -0,0 +1,4 @@ +import { TebakTebakan } from './types'; +export declare let tebaktebakanjson: TebakTebakan[]; +export default function tebaktebakan(): Promise; +//# sourceMappingURL=tebaktebakan.d.ts.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/@types/games/tebaktebakan.d.ts.map b/node_modules/@bochilteam/scraper/lib/@types/games/tebaktebakan.d.ts.map new file mode 100644 index 000000000..4d42d2eca --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/@types/games/tebaktebakan.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"tebaktebakan.d.ts","sourceRoot":"","sources":["../../../src/games/tebaktebakan.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAEtC,eAAO,IAAI,gBAAgB,EAAE,YAAY,EAAE,CAAA;AAC3C,wBAA8B,YAAY,IAAK,OAAO,CAAC,YAAY,CAAC,CASnE"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/@types/games/tekateki.d.ts b/node_modules/@bochilteam/scraper/lib/@types/games/tekateki.d.ts new file mode 100644 index 000000000..d72248ccc --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/@types/games/tekateki.d.ts @@ -0,0 +1,4 @@ +import { TekaTeki } from './types'; +export declare let tekatekijson: TekaTeki[]; +export default function tekateki(): Promise; +//# sourceMappingURL=tekateki.d.ts.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/@types/games/tekateki.d.ts.map b/node_modules/@bochilteam/scraper/lib/@types/games/tekateki.d.ts.map new file mode 100644 index 000000000..7cf23562c --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/@types/games/tekateki.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"tekateki.d.ts","sourceRoot":"","sources":["../../../src/games/tekateki.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAA;AAElC,eAAO,IAAI,YAAY,EAAE,QAAQ,EAAE,CAAA;AACnC,wBAA8B,QAAQ,IAAK,OAAO,CAAC,QAAQ,CAAC,CAS3D"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/@types/games/test.d.ts b/node_modules/@bochilteam/scraper/lib/@types/games/test.d.ts new file mode 100644 index 000000000..9bcc4712a --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/@types/games/test.d.ts @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=test.d.ts.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/@types/games/test.d.ts.map b/node_modules/@bochilteam/scraper/lib/@types/games/test.d.ts.map new file mode 100644 index 000000000..e05a27006 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/@types/games/test.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"test.d.ts","sourceRoot":"","sources":["../../../src/games/test.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/@types/games/types.d.ts b/node_modules/@bochilteam/scraper/lib/@types/games/types.d.ts new file mode 100644 index 000000000..2af5a02bb --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/@types/games/types.d.ts @@ -0,0 +1,64 @@ +export interface AsahOtak { + index: number; + soal: string; + jawaban: string; +} +export interface CakLontong { + index: number; + soal: string; + jawaban: string; + deskripsi: string; +} +export interface Family100 { + soal: string; + jawaban: string[]; +} +export interface SiapakahAku { + index: number; + soal: string; + jawaban: string; +} +export interface SusunKata { + index: number; + soal: string; + tipe: string; + jawaban: string; +} +export interface TebakBendera { + flag: string; + img: string; + name: string; +} +export interface TebakGambar { + index: number; + img: string; + jawaban: string; + deskripsi: string; +} +export interface TebakKabupaten { + index: number; + title: string; + url: string; +} +export interface TebakKata { + index: number; + soal: string; + jawaban: string; +} +export interface TebakKimia { + unsur: string; + lambang: string; +} +export interface TebakLirik { + soal: string; + jawaban: string; +} +export interface TebakTebakan { + soal: string; + jawaban: string; +} +export interface TekaTeki { + soal: string; + jawaban: string; +} +//# sourceMappingURL=types.d.ts.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/@types/games/types.d.ts.map b/node_modules/@bochilteam/scraper/lib/@types/games/types.d.ts.map new file mode 100644 index 000000000..515efbc5b --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/@types/games/types.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/games/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,QAAQ;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,UAAU;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,SAAS;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,EAAE,CAAC;CAClB;AAED,MAAM,WAAW,WAAW;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CAChB;AACD,MAAM,WAAW,SAAS;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CAChB;AACD,MAAM,WAAW,YAAY;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;CACb;AACD,MAAM,WAAW,WAAW;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,cAAc;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;CACZ;AACD,MAAM,WAAW,SAAS;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CAChB;AACD,MAAM,WAAW,UAAU;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;CAChB;AACD,MAAM,WAAW,UAAU;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CAChB;AACD,MAAM,WAAW,YAAY;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CAChB;AACD,MAAM,WAAW,QAAQ;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CAChB"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/@types/images/google-image.d.ts b/node_modules/@bochilteam/scraper/lib/@types/images/google-image.d.ts new file mode 100644 index 000000000..972e3fb3a --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/@types/images/google-image.d.ts @@ -0,0 +1,2 @@ +export default function googleImage(query: string): Promise; +//# sourceMappingURL=google-image.d.ts.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/@types/images/google-image.d.ts.map b/node_modules/@bochilteam/scraper/lib/@types/images/google-image.d.ts.map new file mode 100644 index 000000000..f9726110f --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/@types/images/google-image.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"google-image.d.ts","sourceRoot":"","sources":["../../../src/images/google-image.ts"],"names":[],"mappings":"AAGA,wBAA8B,WAAW,CAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAoB3E"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/@types/images/index.d.ts b/node_modules/@bochilteam/scraper/lib/@types/images/index.d.ts new file mode 100644 index 000000000..c348bae47 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/@types/images/index.d.ts @@ -0,0 +1,6 @@ +import googleImage from './google-image.js'; +import pinterest from './pinterest.js'; +export * from './sticker.js'; +export * from './wallpaper.js'; +export { pinterest, googleImage }; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/@types/images/index.d.ts.map b/node_modules/@bochilteam/scraper/lib/@types/images/index.d.ts.map new file mode 100644 index 000000000..ef00a44b4 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/@types/images/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/images/index.ts"],"names":[],"mappings":"AAAA,OAAO,WAAW,MAAM,mBAAmB,CAAA;AAC3C,OAAO,SAAS,MAAM,gBAAgB,CAAA;AACtC,cAAc,cAAc,CAAA;AAC5B,cAAc,gBAAgB,CAAA;AAC9B,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,CAAA"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/@types/images/pinterest.d.ts b/node_modules/@bochilteam/scraper/lib/@types/images/pinterest.d.ts new file mode 100644 index 000000000..0f8691af8 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/@types/images/pinterest.d.ts @@ -0,0 +1,2 @@ +export default function pinterest(query: string): Promise; +//# sourceMappingURL=pinterest.d.ts.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/@types/images/pinterest.d.ts.map b/node_modules/@bochilteam/scraper/lib/@types/images/pinterest.d.ts.map new file mode 100644 index 000000000..70621a953 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/@types/images/pinterest.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"pinterest.d.ts","sourceRoot":"","sources":["../../../src/images/pinterest.ts"],"names":[],"mappings":"AAGA,wBAA8B,SAAS,CAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAoBzE"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/@types/images/sticker.d.ts b/node_modules/@bochilteam/scraper/lib/@types/images/sticker.d.ts new file mode 100644 index 000000000..1bf71e957 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/@types/images/sticker.d.ts @@ -0,0 +1,4 @@ +import { StickerLine, StickerTelegram } from './types'; +export declare function stickerTelegram(query: string, page?: number): Promise; +export declare function stickerLine(query: string): Promise; +//# sourceMappingURL=sticker.d.ts.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/@types/images/sticker.d.ts.map b/node_modules/@bochilteam/scraper/lib/@types/images/sticker.d.ts.map new file mode 100644 index 000000000..24beef4d7 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/@types/images/sticker.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"sticker.d.ts","sourceRoot":"","sources":["../../../src/images/sticker.ts"],"names":[],"mappings":"AAEA,OAAO,EAAuB,WAAW,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAE3E,wBAAsB,eAAe,CACnC,KAAK,EAAE,MAAM,EACb,IAAI,CAAC,EAAE,MAAM,GACZ,OAAO,CAAC,eAAe,EAAE,CAAC,CAoC5B;AAED,wBAAsB,WAAW,CAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC,CA2BxE"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/@types/images/test.d.ts b/node_modules/@bochilteam/scraper/lib/@types/images/test.d.ts new file mode 100644 index 000000000..9bcc4712a --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/@types/images/test.d.ts @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=test.d.ts.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/@types/images/test.d.ts.map b/node_modules/@bochilteam/scraper/lib/@types/images/test.d.ts.map new file mode 100644 index 000000000..16a657f63 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/@types/images/test.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"test.d.ts","sourceRoot":"","sources":["../../../src/images/test.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/@types/images/types.d.ts b/node_modules/@bochilteam/scraper/lib/@types/images/types.d.ts new file mode 100644 index 000000000..8f41c1510 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/@types/images/types.d.ts @@ -0,0 +1,31 @@ +export interface StickerTelegram { + title: string; + icon: string; + link: string; + stickers: string[]; +} +export interface ResponseStickerLine { + title: string; + productUrl: string; + id: string; + description?: string; + payloadForProduct: { + staticUrl: string; + animationUrl?: string; + soundUrl?: string; + }; + authorId: string; + authorName: string; +} +export interface StickerLine { + id: string; + title: string; + description?: string; + url: string; + sticker: string; + stickerAnimated?: string; + stickerSound?: string; + authorId: string; + authorName: string; +} +//# sourceMappingURL=types.d.ts.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/@types/images/types.d.ts.map b/node_modules/@bochilteam/scraper/lib/@types/images/types.d.ts.map new file mode 100644 index 000000000..dfb2ceaec --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/@types/images/types.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/images/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,eAAe;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,EAAE,CAAC;CACnB;AAED,MAAM,WAAW,mBAAmB;IACnC,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,iBAAiB,EAAE;QAClB,SAAS,EAAE,MAAM,CAAC;QAClB,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;KAClB,CAAC;IACF,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,WAAW;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,MAAM,CAAC;IAChB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;CACnB"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/@types/images/wallpaper.d.ts b/node_modules/@bochilteam/scraper/lib/@types/images/wallpaper.d.ts new file mode 100644 index 000000000..dd7f759a7 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/@types/images/wallpaper.d.ts @@ -0,0 +1,9 @@ +export declare function wallpaper(query: string): Promise; +declare type Ioptionsv2 = { + page: number; + is4K?: boolean; +}; +export declare function wallpaperv2(query: string, { page, is4K }?: Ioptionsv2): Promise; +export declare function wallpaperv3(query: string, page?: number): Promise; +export {}; +//# sourceMappingURL=wallpaper.d.ts.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/@types/images/wallpaper.d.ts.map b/node_modules/@bochilteam/scraper/lib/@types/images/wallpaper.d.ts.map new file mode 100644 index 000000000..530d31f87 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/@types/images/wallpaper.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"wallpaper.d.ts","sourceRoot":"","sources":["../../../src/images/wallpaper.ts"],"names":[],"mappings":"AAGA,wBAAsB,SAAS,CAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAyBjE;AAED,aAAK,UAAU,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC;AACnD,wBAAsB,WAAW,CAC/B,KAAK,EAAE,MAAM,EACb,EAAE,IAAI,EAAE,IAAI,EAAE,GAAE,UAAwB,GACvC,OAAO,CAAC,MAAM,EAAE,CAAC,CAenB;AAED,wBAAsB,WAAW,CAAE,KAAK,EAAE,MAAM,EAAE,IAAI,GAAE,MAAU,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CASrF"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/@types/index.d.ts b/node_modules/@bochilteam/scraper/lib/@types/index.d.ts new file mode 100644 index 000000000..e84659005 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/@types/index.d.ts @@ -0,0 +1,10 @@ +export * from './images/index.js'; +export * from './social-media/index.js'; +export * from './games/index.js'; +export * from './primbons/index.js'; +export * from './texts/index.js'; +export * from './others/index.js'; +export * from './encryptions/index.js'; +export * from './religions/index.js'; +export * from './news/index.js'; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/@types/index.d.ts.map b/node_modules/@bochilteam/scraper/lib/@types/index.d.ts.map new file mode 100644 index 000000000..9f2e21591 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/@types/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAA;AACjC,cAAc,yBAAyB,CAAA;AACvC,cAAc,kBAAkB,CAAA;AAChC,cAAc,qBAAqB,CAAA;AACnC,cAAc,kBAAkB,CAAA;AAChC,cAAc,mBAAmB,CAAA;AACjC,cAAc,wBAAwB,CAAA;AACtC,cAAc,sBAAsB,CAAA;AACpC,cAAc,iBAAiB,CAAA"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/@types/news/antaranews.d.ts b/node_modules/@bochilteam/scraper/lib/@types/news/antaranews.d.ts new file mode 100644 index 000000000..72f9dfd91 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/@types/news/antaranews.d.ts @@ -0,0 +1,3 @@ +import type { Antaranews } from './types'; +export default function antaranews(): Promise; +//# sourceMappingURL=antaranews.d.ts.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/@types/news/antaranews.d.ts.map b/node_modules/@bochilteam/scraper/lib/@types/news/antaranews.d.ts.map new file mode 100644 index 000000000..d9b1f98ed --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/@types/news/antaranews.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"antaranews.d.ts","sourceRoot":"","sources":["../../../src/news/antaranews.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AAEzC,wBAA8B,UAAU,IAAK,OAAO,CAAC,UAAU,EAAE,CAAC,CA0BjE"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/@types/news/cnbcindonesia.d.ts b/node_modules/@bochilteam/scraper/lib/@types/news/cnbcindonesia.d.ts new file mode 100644 index 000000000..5858826d2 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/@types/news/cnbcindonesia.d.ts @@ -0,0 +1,3 @@ +import type { CNBCIndonesia } from './types'; +export default function cnbindonesia(): Promise; +//# sourceMappingURL=cnbcindonesia.d.ts.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/@types/news/cnbcindonesia.d.ts.map b/node_modules/@bochilteam/scraper/lib/@types/news/cnbcindonesia.d.ts.map new file mode 100644 index 000000000..03a167943 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/@types/news/cnbcindonesia.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"cnbcindonesia.d.ts","sourceRoot":"","sources":["../../../src/news/cnbcindonesia.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAE5C,wBAA8B,YAAY,IAAK,OAAO,CAAC,aAAa,EAAE,CAAC,CAwBtE"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/@types/news/index.d.ts b/node_modules/@bochilteam/scraper/lib/@types/news/index.d.ts new file mode 100644 index 000000000..e05ba9c88 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/@types/news/index.d.ts @@ -0,0 +1,8 @@ +import cnbindonesia from './cnbcindonesia.js'; +import antaranews from './antaranews.js'; +import kompas from './kompas.js'; +import suaracom from './suaracom.js'; +import liputan6 from './liputan6.js'; +import merdeka from './merdeka.js'; +export { cnbindonesia, antaranews, kompas, suaracom, liputan6, merdeka }; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/@types/news/index.d.ts.map b/node_modules/@bochilteam/scraper/lib/@types/news/index.d.ts.map new file mode 100644 index 000000000..f82748020 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/@types/news/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/news/index.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,MAAM,oBAAoB,CAAA;AAC7C,OAAO,UAAU,MAAM,iBAAiB,CAAA;AACxC,OAAO,MAAM,MAAM,aAAa,CAAA;AAChC,OAAO,QAAQ,MAAM,eAAe,CAAA;AACpC,OAAO,QAAQ,MAAM,eAAe,CAAA;AACpC,OAAO,OAAO,MAAM,cAAc,CAAA;AAElC,OAAO,EACL,YAAY,EACZ,UAAU,EACV,MAAM,EACN,QAAQ,EACR,QAAQ,EACR,OAAO,EACR,CAAA"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/@types/news/kompas.d.ts b/node_modules/@bochilteam/scraper/lib/@types/news/kompas.d.ts new file mode 100644 index 000000000..187420290 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/@types/news/kompas.d.ts @@ -0,0 +1,3 @@ +import type { Kompas } from './types'; +export default function kompas(): Promise; +//# sourceMappingURL=kompas.d.ts.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/@types/news/kompas.d.ts.map b/node_modules/@bochilteam/scraper/lib/@types/news/kompas.d.ts.map new file mode 100644 index 000000000..19586e642 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/@types/news/kompas.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"kompas.d.ts","sourceRoot":"","sources":["../../../src/news/kompas.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAErC,wBAA8B,MAAM,IAAK,OAAO,CAAC,MAAM,EAAE,CAAC,CAyBzD"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/@types/news/liputan6.d.ts b/node_modules/@bochilteam/scraper/lib/@types/news/liputan6.d.ts new file mode 100644 index 000000000..2683ee2c2 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/@types/news/liputan6.d.ts @@ -0,0 +1,3 @@ +import type { Liputan6 } from './types'; +export default function liputan6(): Promise; +//# sourceMappingURL=liputan6.d.ts.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/@types/news/liputan6.d.ts.map b/node_modules/@bochilteam/scraper/lib/@types/news/liputan6.d.ts.map new file mode 100644 index 000000000..261f03b83 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/@types/news/liputan6.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"liputan6.d.ts","sourceRoot":"","sources":["../../../src/news/liputan6.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAA;AAEvC,wBAA8B,QAAQ,IAAK,OAAO,CAAC,QAAQ,EAAE,CAAC,CA4B7D"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/@types/news/merdeka.d.ts b/node_modules/@bochilteam/scraper/lib/@types/news/merdeka.d.ts new file mode 100644 index 000000000..470fb0d2c --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/@types/news/merdeka.d.ts @@ -0,0 +1,3 @@ +import type { Merdeka } from './types'; +export default function merdeka(): Promise; +//# sourceMappingURL=merdeka.d.ts.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/@types/news/merdeka.d.ts.map b/node_modules/@bochilteam/scraper/lib/@types/news/merdeka.d.ts.map new file mode 100644 index 000000000..170dd283c --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/@types/news/merdeka.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"merdeka.d.ts","sourceRoot":"","sources":["../../../src/news/merdeka.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AAEtC,wBAA8B,OAAO,IAAK,OAAO,CAAC,OAAO,EAAE,CAAC,CAsB3D"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/@types/news/suaracom.d.ts b/node_modules/@bochilteam/scraper/lib/@types/news/suaracom.d.ts new file mode 100644 index 000000000..a3ce01b9a --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/@types/news/suaracom.d.ts @@ -0,0 +1,3 @@ +import type { Suaracom } from './types'; +export default function suaracom(): Promise; +//# sourceMappingURL=suaracom.d.ts.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/@types/news/suaracom.d.ts.map b/node_modules/@bochilteam/scraper/lib/@types/news/suaracom.d.ts.map new file mode 100644 index 000000000..2b2e2f74d --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/@types/news/suaracom.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"suaracom.d.ts","sourceRoot":"","sources":["../../../src/news/suaracom.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAA;AAEvC,wBAA8B,QAAQ,IAAK,OAAO,CAAC,QAAQ,EAAE,CAAC,CAsB7D"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/@types/news/test.d.ts b/node_modules/@bochilteam/scraper/lib/@types/news/test.d.ts new file mode 100644 index 000000000..9bcc4712a --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/@types/news/test.d.ts @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=test.d.ts.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/@types/news/test.d.ts.map b/node_modules/@bochilteam/scraper/lib/@types/news/test.d.ts.map new file mode 100644 index 000000000..f3df5c619 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/@types/news/test.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"test.d.ts","sourceRoot":"","sources":["../../../src/news/test.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/@types/news/types.d.ts b/node_modules/@bochilteam/scraper/lib/@types/news/types.d.ts new file mode 100644 index 000000000..c9301ee2b --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/@types/news/types.d.ts @@ -0,0 +1,45 @@ +export interface CNBCIndonesia { + title: string; + subtitle?: string; + link: string; + image: string; + label: string; + date: string; +} +export interface Antaranews { + title: string; + link: string; + image: string; + label: string; + date: string; +} +export interface Kompas { + title: string; + link: string; + image: string; + label: string; + date: string; +} +export interface Suaracom { + title: string; + link: string; + image: string; + description: string; + date: string; +} +export interface Liputan6 { + title: string; + link: string; + image: string; + description: string; + label: string; + date: string; +} +export interface Merdeka { + title: string; + link: string; + image: string; + label: string; + date: string; +} +//# sourceMappingURL=types.d.ts.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/@types/news/types.d.ts.map b/node_modules/@bochilteam/scraper/lib/@types/news/types.d.ts.map new file mode 100644 index 000000000..b685e4656 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/@types/news/types.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/news/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,aAAa;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,UAAU;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,MAAM;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,QAAQ;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,QAAQ;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,OAAO;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;CAChB"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/@types/others/BMKG.d.ts b/node_modules/@bochilteam/scraper/lib/@types/others/BMKG.d.ts new file mode 100644 index 000000000..2f5813f68 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/@types/others/BMKG.d.ts @@ -0,0 +1,5 @@ +import type { Gempa, GempaNow, Tsunami } from './types'; +export declare function gempa(): Promise; +export declare function gempaNow(): Promise; +export declare function tsunami(): Promise; +//# sourceMappingURL=BMKG.d.ts.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/@types/others/BMKG.d.ts.map b/node_modules/@bochilteam/scraper/lib/@types/others/BMKG.d.ts.map new file mode 100644 index 000000000..417348dd0 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/@types/others/BMKG.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"BMKG.d.ts","sourceRoot":"","sources":["../../../src/others/BMKG.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,KAAK,EACL,QAAQ,EACR,OAAO,EACR,MAAM,SAAS,CAAA;AAEhB,wBAAsB,KAAK,IAAK,OAAO,CAAC,KAAK,EAAE,CAAC,CAwB/C;AAED,wBAAsB,QAAQ,IAAK,OAAO,CAAC,QAAQ,EAAE,CAAC,CAsBrD;AAED,wBAAsB,OAAO,IAAK,OAAO,CAAC,OAAO,EAAE,CAAC,CAoBnD"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/@types/others/KBBI.d.ts b/node_modules/@bochilteam/scraper/lib/@types/others/KBBI.d.ts new file mode 100644 index 000000000..439002598 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/@types/others/KBBI.d.ts @@ -0,0 +1,8 @@ +import type { Kbbi } from './types'; +/** + * p = Partikel: kelas kata yang meliputi kata depan, kata sambung, kata seru, kata sandang, ucapan salam + * + * n = Nomina: kata benda + */ +export default function kbbi(words: string): Promise; +//# sourceMappingURL=KBBI.d.ts.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/@types/others/KBBI.d.ts.map b/node_modules/@bochilteam/scraper/lib/@types/others/KBBI.d.ts.map new file mode 100644 index 000000000..8a6b95155 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/@types/others/KBBI.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"KBBI.d.ts","sourceRoot":"","sources":["../../../src/others/KBBI.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAEnC;;;;GAIG;AACH,wBAA8B,IAAI,CAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC,CAoClE"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/@types/others/bioskop.d.ts b/node_modules/@bochilteam/scraper/lib/@types/others/bioskop.d.ts new file mode 100644 index 000000000..b882d4b96 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/@types/others/bioskop.d.ts @@ -0,0 +1,4 @@ +import type { Bioskop, BioskopNow } from './types'; +export declare function bioskopNow(): Promise; +export declare function bioskop(page?: number | string): Promise; +//# sourceMappingURL=bioskop.d.ts.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/@types/others/bioskop.d.ts.map b/node_modules/@bochilteam/scraper/lib/@types/others/bioskop.d.ts.map new file mode 100644 index 000000000..61b9ec03b --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/@types/others/bioskop.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"bioskop.d.ts","sourceRoot":"","sources":["../../../src/others/bioskop.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AAElD,wBAAsB,UAAU,IAAK,OAAO,CAAC,UAAU,EAAE,CAAC,CAiCzD;AAED,wBAAsB,OAAO,CAAE,IAAI,GAAE,MAAM,GAAG,MAAU,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC,CAsC5E"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/@types/others/cek-resi.d.ts b/node_modules/@bochilteam/scraper/lib/@types/others/cek-resi.d.ts new file mode 100644 index 000000000..6b2859c0c --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/@types/others/cek-resi.d.ts @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=cek-resi.d.ts.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/@types/others/cek-resi.d.ts.map b/node_modules/@bochilteam/scraper/lib/@types/others/cek-resi.d.ts.map new file mode 100644 index 000000000..d7eaf84eb --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/@types/others/cek-resi.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"cek-resi.d.ts","sourceRoot":"","sources":["../../../src/others/cek-resi.ts"],"names":[],"mappings":"AAAA,OAAO,EAAG,CAAA"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/@types/others/idff.d.ts b/node_modules/@bochilteam/scraper/lib/@types/others/idff.d.ts new file mode 100644 index 000000000..a7643cacb --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/@types/others/idff.d.ts @@ -0,0 +1,3 @@ +import type { NameFreeFire } from './types'; +export default function nameFreeFire(id: string | number): Promise; +//# sourceMappingURL=idff.d.ts.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/@types/others/idff.d.ts.map b/node_modules/@bochilteam/scraper/lib/@types/others/idff.d.ts.map new file mode 100644 index 000000000..7e92f5a6b --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/@types/others/idff.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"idff.d.ts","sourceRoot":"","sources":["../../../src/others/idff.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAE3C,wBAA8B,YAAY,CAAE,EAAE,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC,CA0BtF"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/@types/others/index.d.ts b/node_modules/@bochilteam/scraper/lib/@types/others/index.d.ts new file mode 100644 index 000000000..24c971f73 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/@types/others/index.d.ts @@ -0,0 +1,12 @@ +import wikipedia from './wikipedia.js'; +import jadwalTV, { jadwalTVNow, listJadwalTV } from './jadwal-tv.js'; +import kbbi from './KBBI.js'; +import nameFreeFire from './idff.js'; +export * from './minecraft.js'; +export * from './mediafire.js'; +export * from './BMKG.js'; +export * from './lyrics.js'; +export * from './minecraft.js'; +export * from './bioskop.js'; +export { wikipedia, jadwalTV, jadwalTVNow, listJadwalTV, kbbi, nameFreeFire }; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/@types/others/index.d.ts.map b/node_modules/@bochilteam/scraper/lib/@types/others/index.d.ts.map new file mode 100644 index 000000000..7b8ced900 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/@types/others/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/others/index.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,gBAAgB,CAAA;AACtC,OAAO,QAAQ,EAAE,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AACpE,OAAO,IAAI,MAAM,WAAW,CAAA;AAC5B,OAAO,YAAY,MAAM,WAAW,CAAA;AAEpC,cAAc,gBAAgB,CAAA;AAC9B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,WAAW,CAAA;AACzB,cAAc,aAAa,CAAA;AAC3B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,cAAc,CAAA;AAG5B,OAAO,EACL,SAAS,EACT,QAAQ,EAAE,WAAW,EAAE,YAAY,EACnC,IAAI,EACJ,YAAY,EACb,CAAA"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/@types/others/jadwal-tv.d.ts b/node_modules/@bochilteam/scraper/lib/@types/others/jadwal-tv.d.ts new file mode 100644 index 000000000..921e94298 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/@types/others/jadwal-tv.d.ts @@ -0,0 +1,11 @@ +import { JadwalTV, JadwalTVNOW } from './types'; +declare type ListJadwalTV = { + value: string; + channel: string; + isPay: boolean; +}[]; +export declare const listJadwalTV: Promise; +export default function jadwalTV(channel: string): Promise; +export declare function jadwalTVNow(): Promise; +export {}; +//# sourceMappingURL=jadwal-tv.d.ts.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/@types/others/jadwal-tv.d.ts.map b/node_modules/@bochilteam/scraper/lib/@types/others/jadwal-tv.d.ts.map new file mode 100644 index 000000000..4d279a2fc --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/@types/others/jadwal-tv.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"jadwal-tv.d.ts","sourceRoot":"","sources":["../../../src/others/jadwal-tv.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAG/C,aAAK,YAAY,GAAG;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,OAAO,CAAC;CAChB,EAAE,CAAA;AAEH,eAAO,MAAM,YAAY,EAAE,OAAO,CAAC,YAAY,CAAqI,CAAA;AAEpL,wBAA8B,QAAQ,CAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC,CA4B1E;AAED,wBAAsB,WAAW,IAAK,OAAO,CAAC,WAAW,CAAC,CAyBzD"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/@types/others/lyrics.d.ts b/node_modules/@bochilteam/scraper/lib/@types/others/lyrics.d.ts new file mode 100644 index 000000000..277545bd0 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/@types/others/lyrics.d.ts @@ -0,0 +1,4 @@ +import type { Lyrics } from './types'; +export declare function lyrics(query: string): Promise; +export declare function lyricsv2(query: string): Promise; +//# sourceMappingURL=lyrics.d.ts.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/@types/others/lyrics.d.ts.map b/node_modules/@bochilteam/scraper/lib/@types/others/lyrics.d.ts.map new file mode 100644 index 000000000..20fb04a6c --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/@types/others/lyrics.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"lyrics.d.ts","sourceRoot":"","sources":["../../../src/others/lyrics.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,MAAM,EACP,MAAM,SAAS,CAAA;AAGhB,wBAAsB,MAAM,CAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CA+B5D;AAED,wBAAsB,QAAQ,CAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAyD9D"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/@types/others/mediafire.d.ts b/node_modules/@bochilteam/scraper/lib/@types/others/mediafire.d.ts new file mode 100644 index 000000000..0e9d19bd4 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/@types/others/mediafire.d.ts @@ -0,0 +1,3 @@ +import { Mediafire } from './types.js'; +export declare function mediafiredl(url: string): Promise; +//# sourceMappingURL=mediafire.d.ts.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/@types/others/mediafire.d.ts.map b/node_modules/@bochilteam/scraper/lib/@types/others/mediafire.d.ts.map new file mode 100644 index 000000000..a72a5cae1 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/@types/others/mediafire.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"mediafire.d.ts","sourceRoot":"","sources":["../../../src/others/mediafire.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AAEtC,wBAAsB,WAAW,CAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,CAAC,CAkClE"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/@types/others/minecraft.d.ts b/node_modules/@bochilteam/scraper/lib/@types/others/minecraft.d.ts new file mode 100644 index 000000000..3cdedd512 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/@types/others/minecraft.d.ts @@ -0,0 +1,8 @@ +import type { MinecraftJava } from './types'; +interface Options { + timeout: number; +} +export declare function statusBedrock(ip: string, port: number, opts?: Options): Promise; +export declare function statusJava(ip: string, port?: number, opts?: Options): Promise; +export {}; +//# sourceMappingURL=minecraft.d.ts.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/@types/others/minecraft.d.ts.map b/node_modules/@bochilteam/scraper/lib/@types/others/minecraft.d.ts.map new file mode 100644 index 000000000..0bfa21e35 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/@types/others/minecraft.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"minecraft.d.ts","sourceRoot":"","sources":["../../../src/others/minecraft.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAC5C,UAAU,OAAO;IAChB,OAAO,EAAE,MAAM,CAAC;CAChB;AAGD,wBAAsB,aAAa,CACjC,EAAE,EAAE,MAAM,EACV,IAAI,EAAE,MAAM,EACZ,IAAI,GAAE,OAA+B,iBAClC;AAGL,wBAAgB,UAAU,CACxB,EAAE,EAAE,MAAM,EACV,IAAI,GAAE,MAAc,EACpB,IAAI,GAAE,OAA+B,GACpC,OAAO,CAAC,aAAa,CAAC,CAwDxB"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/@types/others/test.d.ts b/node_modules/@bochilteam/scraper/lib/@types/others/test.d.ts new file mode 100644 index 000000000..9bcc4712a --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/@types/others/test.d.ts @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=test.d.ts.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/@types/others/test.d.ts.map b/node_modules/@bochilteam/scraper/lib/@types/others/test.d.ts.map new file mode 100644 index 000000000..e69eddbea --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/@types/others/test.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"test.d.ts","sourceRoot":"","sources":["../../../src/others/test.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/@types/others/types.d.ts b/node_modules/@bochilteam/scraper/lib/@types/others/types.d.ts new file mode 100644 index 000000000..6551ca3d8 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/@types/others/types.d.ts @@ -0,0 +1,125 @@ +export interface Wikipedia { + title: string; + img: string; + articles: string; +} +interface ResultsJadwalTV { + date: string; + event: string; +} +export interface JadwalTV { + channel: string; + result: ResultsJadwalTV[]; +} +export interface JadwalTVNOW { + [Key: string]: ResultsJadwalTV[]; +} +export interface Mediafire { + url: string; + url2: string; + filename: string; + filetype: string; + ext: string; + aploud: string; + filesizeH: string; + filesize: number; +} +export interface Gempa { + date: string; + locate: string; + magnitude: string; + depth: string; + location: string; + warning: string[]; +} +export interface GempaNow { + date: string; + latitude: string; + longitude: string; + magnitude: string; + depth: string; + location: string; +} +export interface Tsunami { + date: string; + locate: string; + magnitude: string; + depth: string; + location: string; +} +export interface Lyrics { + title: string; + author: string; + lyrics: string; + link: string; +} +export interface Kbbi { + index: number; + title: string; + means: string[]; +} +interface Iresponse { + description: { + extra: { + color: string; + text: string; + bold?: boolean; + }[]; + text: string; + }; + players: { + max: number; + online: number; + sample: { + id: string; + name: string; + }[]; + }; + version: { + name: string; + protocol: number; + }; + favicon: string; +} +export interface MinecraftJava { + ip: string; + port: number; + description: string; + descriptionText: string; + players: { + max: number; + online: number; + sample: string[]; + }; + version: { + name: string; + protocol: number; + }; + favicon?: string; + ping: number; + originalResponse: Iresponse; +} +export interface NameFreeFire { + id: string; + username: string; +} +export interface BioskopNow { + title: string; + img: string; + url: string; + genre: string; + duration: string; + playingAt: string; +} +export interface Bioskop { + title: string; + img: string; + url: string; + genre: string; + duration: string; + release: string; + director: string; + cast: string; +} +export {}; +//# sourceMappingURL=types.d.ts.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/@types/others/types.d.ts.map b/node_modules/@bochilteam/scraper/lib/@types/others/types.d.ts.map new file mode 100644 index 000000000..ecdc175a6 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/@types/others/types.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/others/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,SAAS;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,MAAM,CAAC;CACjB;AAED,UAAU,eAAe;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAA;CACb;AACD,MAAM,WAAW,QAAQ;IACxB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,eAAe,EAAE,CAAC;CAC1B;AACD,MAAM,WAAW,WAAW;IAC3B,CAAC,GAAG,EAAE,MAAM,GAAG,eAAe,EAAE,CAAA;CAChC;AAED,MAAM,WAAW,SAAS;IACzB,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;CACjB;AAED,MA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team/scraper/lib/@types/others/wikipedia.d.ts new file mode 100644 index 000000000..3ad4a3875 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/@types/others/wikipedia.d.ts @@ -0,0 +1,3 @@ +import { Wikipedia } from './types'; +export default function wikipedia(query: string, lang?: 'en' | 'id'): Promise; +//# sourceMappingURL=wikipedia.d.ts.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/@types/others/wikipedia.d.ts.map b/node_modules/@bochilteam/scraper/lib/@types/others/wikipedia.d.ts.map new file mode 100644 index 000000000..a9b65b452 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/@types/others/wikipedia.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"wikipedia.d.ts","sourceRoot":"","sources":["../../../src/others/wikipedia.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAA;AAEnC,wBAA8B,SAAS,CACrC,KAAK,EAAE,MAAM,EACb,IAAI,GAAE,IAAI,GAAG,IAAW,GACvB,OAAO,CAAC,SAAS,CAAC,CAyDpB"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/@types/primbons/artimimpi.d.ts b/node_modules/@bochilteam/scraper/lib/@types/primbons/artimimpi.d.ts new file mode 100644 index 000000000..9779a138a --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/@types/primbons/artimimpi.d.ts @@ -0,0 +1,2 @@ +export default function artimimpi(mimpi: string): Promise; +//# sourceMappingURL=artimimpi.d.ts.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/@types/primbons/artimimpi.d.ts.map b/node_modules/@bochilteam/scraper/lib/@types/primbons/artimimpi.d.ts.map new file mode 100644 index 000000000..8a6b3c117 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/@types/primbons/artimimpi.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"artimimpi.d.ts","sourceRoot":"","sources":["../../../src/primbons/artimimpi.ts"],"names":[],"mappings":"AACA,wBAA8B,SAAS,CAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAYzE"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/@types/primbons/artinama.d.ts b/node_modules/@bochilteam/scraper/lib/@types/primbons/artinama.d.ts new file mode 100644 index 000000000..39019a27c --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/@types/primbons/artinama.d.ts @@ -0,0 +1,2 @@ +export default function artinama(nama: string): Promise; +//# sourceMappingURL=artinama.d.ts.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/@types/primbons/artinama.d.ts.map b/node_modules/@bochilteam/scraper/lib/@types/primbons/artinama.d.ts.map new file mode 100644 index 000000000..fde6da9cf --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/@types/primbons/artinama.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"artinama.d.ts","sourceRoot":"","sources":["../../../src/primbons/artinama.ts"],"names":[],"mappings":"AACA,wBAA8B,QAAQ,CAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAUrE"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/@types/primbons/index.d.ts b/node_modules/@bochilteam/scraper/lib/@types/primbons/index.d.ts new file mode 100644 index 000000000..e97d6fef9 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/@types/primbons/index.d.ts @@ -0,0 +1,6 @@ +import artimimpi from './artimimpi.js'; +import artinama from './artinama.js'; +import nomorhoki from './nomorhoki.js'; +import getZodiac from './zodiac.js'; +export { artinama, artimimpi, nomorhoki, getZodiac }; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/@types/primbons/index.d.ts.map b/node_modules/@bochilteam/scraper/lib/@types/primbons/index.d.ts.map new file mode 100644 index 000000000..69ddb5f61 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/@types/primbons/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/primbons/index.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,gBAAgB,CAAA;AACtC,OAAO,QAAQ,MAAM,eAAe,CAAA;AACpC,OAAO,SAAS,MAAM,gBAAgB,CAAA;AACtC,OAAO,SAAS,MAAM,aAAa,CAAA;AAEnC,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,CAAA"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/@types/primbons/nomorhoki.d.ts b/node_modules/@bochilteam/scraper/lib/@types/primbons/nomorhoki.d.ts new file mode 100644 index 000000000..06505f882 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/@types/primbons/nomorhoki.d.ts @@ -0,0 +1,3 @@ +import { NomerHoki } from './types'; +export default function nomorhoki(nomer: number | string): Promise; +//# sourceMappingURL=nomorhoki.d.ts.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/@types/primbons/nomorhoki.d.ts.map b/node_modules/@bochilteam/scraper/lib/@types/primbons/nomorhoki.d.ts.map new file mode 100644 index 000000000..bb01613e0 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/@types/primbons/nomorhoki.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"nomorhoki.d.ts","sourceRoot":"","sources":["../../../src/primbons/nomorhoki.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAA;AAEnC,wBAA8B,SAAS,CACrC,KAAK,EAAE,MAAM,GAAG,MAAM,GACrB,OAAO,CAAC,SAAS,CAAC,CA0EpB"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/@types/primbons/test.d.ts b/node_modules/@bochilteam/scraper/lib/@types/primbons/test.d.ts new file mode 100644 index 000000000..9bcc4712a --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/@types/primbons/test.d.ts @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=test.d.ts.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/@types/primbons/test.d.ts.map b/node_modules/@bochilteam/scraper/lib/@types/primbons/test.d.ts.map new file mode 100644 index 000000000..9fea1c6b8 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/@types/primbons/test.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"test.d.ts","sourceRoot":"","sources":["../../../src/primbons/test.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/@types/primbons/types.d.ts b/node_modules/@bochilteam/scraper/lib/@types/primbons/types.d.ts new file mode 100644 index 000000000..e44a35312 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/@types/primbons/types.d.ts @@ -0,0 +1,20 @@ +export interface NomerHoki { + nomer: number | string; + angka_bagua_shuzi: number; + positif: { + kekayaan: number; + kesehatan: number; + cinta: number; + kestabilan: number; + positif: number; + }; + negatif: { + perselisihan: number; + kehilangan: number; + malapetaka: number; + Kehancuran: number; + negatif: number; + }; +} +export declare type Zodiac = 'capricorn' | 'aquarius' | 'pisces' | 'aries' | 'taurus' | 'gemini' | 'cancer' | 'leo' | 'virgo' | 'libra' | 'scorpio' | 'sagitarius'; +//# sourceMappingURL=types.d.ts.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/@types/primbons/types.d.ts.map b/node_modules/@bochilteam/scraper/lib/@types/primbons/types.d.ts.map new file mode 100644 index 000000000..e1b7e36a5 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/@types/primbons/types.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/primbons/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,SAAS;IACzB,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;IACvB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,OAAO,EAAE;QACR,QAAQ,EAAE,MAAM,CAAC;QACjB,SAAS,EAAE,MAAM,CAAC;QAClB,KAAK,EAAE,MAAM,CAAC;QACd,UAAU,EAAE,MAAM,CAAC;QACnB,OAAO,EAAE,MAAM,CAAC;KAChB,CAAC;IACF,OAAO,EAAE;QACR,YAAY,EAAE,MAAM,CAAC;QACrB,UAAU,EAAE,MAAM,CAAC;QACnB,UAAU,EAAE,MAAM,CAAC;QACnB,UAAU,EAAE,MAAM,CAAC;QACnB,OAAO,EAAE,MAAM,CAAC;KAChB,CAAC;CACF;AAED,oBAAY,MAAM,GACf,WAAW,GACX,UAAU,GACV,QAAQ,GACR,OAAO,GACP,QAAQ,GACR,QAAQ,GACR,QAAQ,GACR,KAAK,GACL,OAAO,GACP,OAAO,GACP,SAAS,GACT,YAAY,CAAC"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/@types/primbons/zodiac.d.ts b/node_modules/@bochilteam/scraper/lib/@types/primbons/zodiac.d.ts new file mode 100644 index 000000000..0cb522d51 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/@types/primbons/zodiac.d.ts @@ -0,0 +1,3 @@ +import { Zodiac } from './types'; +export default function getZodiac(months: number, dates: number): Zodiac; +//# sourceMappingURL=zodiac.d.ts.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/@types/primbons/zodiac.d.ts.map b/node_modules/@bochilteam/scraper/lib/@types/primbons/zodiac.d.ts.map new file mode 100644 index 000000000..c231f3074 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/@types/primbons/zodiac.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"zodiac.d.ts","sourceRoot":"","sources":["../../../src/primbons/zodiac.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAEhC,MAAM,CAAC,OAAO,UAAU,SAAS,CAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAmBxE"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/@types/religions/alquran.d.ts b/node_modules/@bochilteam/scraper/lib/@types/religions/alquran.d.ts new file mode 100644 index 000000000..9bf4c099c --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/@types/religions/alquran.d.ts @@ -0,0 +1,3 @@ +import { AlQuran } from './types'; +export declare function alquran(): Promise; +//# sourceMappingURL=alquran.d.ts.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/@types/religions/alquran.d.ts.map b/node_modules/@bochilteam/scraper/lib/@types/religions/alquran.d.ts.map new file mode 100644 index 000000000..3050220ee --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/@types/religions/alquran.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"alquran.d.ts","sourceRoot":"","sources":["../../../src/religions/alquran.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AAEjC,wBAAsB,OAAO,IAAK,OAAO,CAAC,OAAO,EAAE,CAAC,CAKnD"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/@types/religions/asmaulhusna.d.ts b/node_modules/@bochilteam/scraper/lib/@types/religions/asmaulhusna.d.ts new file mode 100644 index 000000000..adcc11700 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/@types/religions/asmaulhusna.d.ts @@ -0,0 +1,4 @@ +import { AsmaulHusna } from './types'; +export declare let asmaulhusnajson: AsmaulHusna[]; +export default function asmaulhusna(): Promise; +//# sourceMappingURL=asmaulhusna.d.ts.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/@types/religions/asmaulhusna.d.ts.map b/node_modules/@bochilteam/scraper/lib/@types/religions/asmaulhusna.d.ts.map new file mode 100644 index 000000000..794cbb1e6 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/@types/religions/asmaulhusna.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"asmaulhusna.d.ts","sourceRoot":"","sources":["../../../src/religions/asmaulhusna.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AACrC,eAAO,IAAI,eAAe,EAAE,WAAW,EAAE,CAAA;AAEzC,wBAA8B,WAAW,IAAK,OAAO,CAAC,WAAW,CAAC,CASjE"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/@types/religions/index.d.ts b/node_modules/@bochilteam/scraper/lib/@types/religions/index.d.ts new file mode 100644 index 000000000..c55c8aa1f --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/@types/religions/index.d.ts @@ -0,0 +1,5 @@ +import asmaulhusna, { asmaulhusnajson } from './asmaulhusna.js'; +import jadwalsholat, { listJadwalSholat } from './jadwalsholat.js'; +export * from './alquran.js'; +export { asmaulhusna, asmaulhusnajson, jadwalsholat, listJadwalSholat }; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/@types/religions/index.d.ts.map b/node_modules/@bochilteam/scraper/lib/@types/religions/index.d.ts.map new file mode 100644 index 000000000..0d7bb46cc --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/@types/religions/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/religions/index.ts"],"names":[],"mappings":"AAAA,OAAO,WAAW,EAAE,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAA;AAC/D,OAAO,YAAY,EAAE,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAA;AAElE,cAAc,cAAc,CAAA;AAC5B,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,YAAY,EAAE,gBAAgB,EAAE,CAAA"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/@types/religions/jadwalsholat.d.ts b/node_modules/@bochilteam/scraper/lib/@types/religions/jadwalsholat.d.ts new file mode 100644 index 000000000..1f424d303 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/@types/religions/jadwalsholat.d.ts @@ -0,0 +1,4 @@ +import { JadwalSholat, JadwalSholatItem } from './types'; +export declare const listJadwalSholat: Promise; +export default function jadwalsholat(kota: string): Promise; +//# sourceMappingURL=jadwalsholat.d.ts.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/@types/religions/jadwalsholat.d.ts.map b/node_modules/@bochilteam/scraper/lib/@types/religions/jadwalsholat.d.ts.map new file mode 100644 index 000000000..02348837e --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/@types/religions/jadwalsholat.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"jadwalsholat.d.ts","sourceRoot":"","sources":["../../../src/religions/jadwalsholat.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAA;AAExD,eAAO,MAAM,gBAAgB,EAAE,OAAO,CAAC,gBAAgB,EAAE,CAAyI,CAAA;AAClM,wBAA8B,YAAY,CACxC,IAAI,EAAE,MAAM,GACX,OAAO,CAAC,YAAY,CAAC,CA4DvB"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/@types/religions/test.d.ts b/node_modules/@bochilteam/scraper/lib/@types/religions/test.d.ts new file mode 100644 index 000000000..9bcc4712a --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/@types/religions/test.d.ts @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=test.d.ts.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/@types/religions/test.d.ts.map b/node_modules/@bochilteam/scraper/lib/@types/religions/test.d.ts.map new file mode 100644 index 000000000..e12fe43f9 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/@types/religions/test.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"test.d.ts","sourceRoot":"","sources":["../../../src/religions/test.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/@types/religions/types.d.ts b/node_modules/@bochilteam/scraper/lib/@types/religions/types.d.ts new file mode 100644 index 000000000..a2bd99275 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/@types/religions/types.d.ts @@ -0,0 +1,95 @@ +export interface AlQuran { + number: number; + ayatCount: number; + sequence: number; + asma: { + ar: { + short: string; + long: string; + }; + en: { + short: string; + long: string; + }; + id: { + short: string; + long: string; + }; + translation: { + en: string; + id: string; + }; + }; + preBismillah?: boolean; + type: { + ar: string; + id: string; + en: string; + }; + tafsir: { + id: string; + en?: string; + }; + recitation: { + full: string; + }; + ayahs: { + number: { + inquran: number; + insurah: number; + }; + juz: number; + manzil: number; + page: number; + ruku: number; + hizbQuarter: number; + sajda: { + recommended: boolean; + obligatory: boolean; + }; + text: { + ar: string; + read: string; + }; + translation: { + en: string; + id: string; + }; + tafsir: { + id: string; + en?: string; + }; + audio: { + url: string; + }; + }[]; +} +export interface AsmaulHusna { + index: number; + latin: string; + arabic: string; + translation_id: string; + translation_en: string; +} +export interface JadwalSholatItem { + value: string; + kota: string; +} +export interface JadwalSholat { + date: string; + today: { + [Key: string]: string; + }; + list: { + date: string; + imsyak: string; + shubuh: string; + terbit: string; + dhuha: string; + dzuhur: string; + ashr: string; + magrib: string; + isyak: string; + }[]; +} +//# sourceMappingURL=types.d.ts.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/@types/religions/types.d.ts.map b/node_modules/@bochilteam/scraper/lib/@types/religions/types.d.ts.map new file mode 100644 index 000000000..4c381795f --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/@types/religions/types.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/religions/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,OAAO;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE;QACL,EAAE,EAAE;YAAE,KAAK,EAAE,MAAM,CAAC;YAAC,IAAI,EAAE,MAAM,CAAA;SAAE,CAAC;QACpC,EAAE,EAAE;YAAE,KAAK,EAAE,MAAM,CAAC;YAAC,IAAI,EAA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,WAAW;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,cAAc,EAAE,MAAM,CAAC;IACvB,cAAc,EAAE,MAAM,CAAC;CACvB;AACD,MAAM,WAAW,gBAAgB;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;CACb;AAED,MAAM,WAAW,YAAY;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE;QACN,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;KACtB,CAAC;IACF,IAAI,EAAE;QACL,IAAI,EAAE,MAAM,CAAC;QACb,MAAM,EAAE,MAAM,CAAC;QACf,MAAM,EAAE,MAAM,CAAC;QACf,MAAM,EAAE,MAAM,CAAC;QACf,KAAK,EAAE,MAAM,CAAC;QACd,MAAM,EAAE,MAAM,CAAC;QACf,IAAI,EAAE,MAAM,CAAC;QACb,MAAM,EAAE,MAAM,CAAC;QACf,KAAK,EAAE,MAAM,CAAC;KACd,EAAE,CAAC;CACJ"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/@types/social-media/aiovideodl.d.ts b/node_modules/@bochilteam/scraper/lib/@types/social-media/aiovideodl.d.ts new file mode 100644 index 000000000..a9731aeef --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/@types/social-media/aiovideodl.d.ts @@ -0,0 +1,3 @@ +import { Aiovideodl } from './types'; +export default function aiovideodl(url: string): Promise; +//# sourceMappingURL=aiovideodl.d.ts.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/@types/social-media/aiovideodl.d.ts.map b/node_modules/@bochilteam/scraper/lib/@types/social-media/aiovideodl.d.ts.map new file mode 100644 index 000000000..b815e5d87 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/@types/social-media/aiovideodl.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"aiovideodl.d.ts","sourceRoot":"","sources":["../../../src/social-media/aiovideodl.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AAEpC,wBAA8B,UAAU,CAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,CAmB1E"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/@types/social-media/facebook.d.ts b/node_modules/@bochilteam/scraper/lib/@types/social-media/facebook.d.ts new file mode 100644 index 000000000..a1a2d684d --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/@types/social-media/facebook.d.ts @@ -0,0 +1,5 @@ +import { FacebookDownloader, FacebookDownloaderV2, FacebookDownloaderV3 } from './types'; +export declare function facebookdl(url: string): Promise; +export declare function facebookdlv2(url: string): Promise; +export declare function facebookdlv3(url: string): Promise; +//# sourceMappingURL=facebook.d.ts.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/@types/social-media/facebook.d.ts.map b/node_modules/@bochilteam/scraper/lib/@types/social-media/facebook.d.ts.map new file mode 100644 index 000000000..492712e97 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/@types/social-media/facebook.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"facebook.d.ts","sourceRoot":"","sources":["../../../src/social-media/facebook.ts"],"names":[],"mappings":"AAOA,OAAO,EACL,kBAAkB,EAClB,oBAAoB,EACpB,oBAAoB,EAErB,MAAM,SAAS,CAAA;AAYhB,wBAAsB,UAAU,CAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAgD1E;AAED,wBAAsB,YAAY,CAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAqD9E;AAED,wBAAsB,YAAY,CAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,oBAAoB,CAAC,CA8C9E"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/@types/social-media/google-it.d.ts b/node_modules/@bochilteam/scraper/lib/@types/social-media/google-it.d.ts new file mode 100644 index 000000000..7423bbb3b --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/@types/social-media/google-it.d.ts @@ -0,0 +1,3 @@ +import { GoogleIt } from './types'; +export declare function googleIt(query: string): Promise; +//# sourceMappingURL=google-it.d.ts.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/@types/social-media/google-it.d.ts.map b/node_modules/@bochilteam/scraper/lib/@types/social-media/google-it.d.ts.map new file mode 100644 index 000000000..e693c6fae --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/@types/social-media/google-it.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"google-it.d.ts","sourceRoot":"","sources":["../../../src/social-media/google-it.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAA;AAElC,wBAAsB,QAAQ,CAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC,CAyDhE"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/@types/social-media/groupWA.d.ts b/node_modules/@bochilteam/scraper/lib/@types/social-media/groupWA.d.ts new file mode 100644 index 000000000..ceb5e6d82 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/@types/social-media/groupWA.d.ts @@ -0,0 +1,3 @@ +import type { GroupWA } from './types'; +export declare function groupWA(query: string): Promise; +//# sourceMappingURL=groupWA.d.ts.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/@types/social-media/groupWA.d.ts.map b/node_modules/@bochilteam/scraper/lib/@types/social-media/groupWA.d.ts.map new file mode 100644 index 000000000..6ed91ba4b --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/@types/social-media/groupWA.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"groupWA.d.ts","sourceRoot":"","sources":["../../../src/social-media/groupWA.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AAEtC,wBAAsB,OAAO,CAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC,CAoBhE"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/@types/social-media/index.d.ts b/node_modules/@bochilteam/scraper/lib/@types/social-media/index.d.ts new file mode 100644 index 000000000..66beb9136 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/@types/social-media/index.d.ts @@ -0,0 +1,12 @@ +import youtubeSearch from './youtube-search.js'; +import { groupWA } from './groupWA.js'; +import aiovideodl from './aiovideodl.js'; +import savefrom from './savefrom.js'; +export * from './facebook.js'; +export * from './google-it.js'; +export * from './instagram.js'; +export * from './tiktok.js'; +export * from './twitter.js'; +export * from './youtube.js'; +export { youtubeSearch, groupWA, aiovideodl, savefrom }; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/@types/social-media/index.d.ts.map b/node_modules/@bochilteam/scraper/lib/@types/social-media/index.d.ts.map new file mode 100644 index 000000000..d5eba2ebb --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/@types/social-media/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/social-media/index.ts"],"names":[],"mappings":"AAAA,OAAO,aAAa,MAAM,qBAAqB,CAAA;AAC/C,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AACtC,OAAO,UAAU,MAAM,iBAAiB,CAAA;AACxC,OAAO,QAAQ,MAAM,eAAe,CAAA;AAEpC,cAAc,eAAe,CAAA;AAC7B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,aAAa,CAAA;AAC3B,cAAc,cAAc,CAAA;AAC5B,cAAc,cAAc,CAAA;AAE5B,OAAO,EACL,aAAa,EACb,OAAO,EACP,UAAU,EACV,QAAQ,EACT,CAAA"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/@types/social-media/instagram.d.ts b/node_modules/@bochilteam/scraper/lib/@types/social-media/instagram.d.ts new file mode 100644 index 000000000..37d3d9d86 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/@types/social-media/instagram.d.ts @@ -0,0 +1,9 @@ +import type { InstagramDownloader, InstagramDownloaderV2, InstagramDownloaderV4, InstagramStory, InstagramStoryv2, InstagramStalk } from './types'; +export declare function instagramdl(url: string): Promise; +export declare function instagramdlv2(url: string): Promise; +export declare function instagramdlv3(url: string): Promise; +export declare function instagramdlv4(url: string): Promise; +export declare function instagramStory(name: string): Promise; +export declare function instagramStoryv2(name: string): Promise; +export declare function instagramStalk(username: string): Promise; +//# sourceMappingURL=instagram.d.ts.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/@types/social-media/instagram.d.ts.map b/node_modules/@bochilteam/scraper/lib/@types/social-media/instagram.d.ts.map new file mode 100644 index 000000000..d1a5cae3e --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/@types/social-media/instagram.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"instagram.d.ts","sourceRoot":"","sources":["../../../src/social-media/instagram.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,mBAAmB,EACnB,qBAAqB,EACrB,qBAAqB,EACrB,cAAc,EACd,gBAAgB,EAChB,cAAc,EACf,MAAM,SAAS,CAAA;AAIhB,wBAAsB,WAAW,CAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,mBAAmB,EAAE,CAAC,CA2C9E;AAED,wBAAsB,aAAa,CACjC,GAAG,EAAE,MAAM,GACV,OAAO,CAAC,qBAAqB,EAAE,CAAC,CAkElC;AAED,wBAAsB,aAAa,CAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,qBAAqB,EAAE,CAAC,CAmElF;AAED,wBAAsB,aAAa,CAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,qBAAqB,EAAE,CAAC,CAqBlF;AAkCD,wBAAsB,cAAc,CAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC,CAuD3E;AAED,wBAAsB,gBAAgB,CAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,CAAC,CA6D/E;AAED,wBAAsB,cAAc,CAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC,CAoD/E"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/@types/social-media/savefrom.d.ts b/node_modules/@bochilteam/scraper/lib/@types/social-media/savefrom.d.ts new file mode 100644 index 000000000..901541264 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/@types/social-media/savefrom.d.ts @@ -0,0 +1,3 @@ +import { Savefrom } from './types'; +export default function savefrom(url: string): Promise; +//# sourceMappingURL=savefrom.d.ts.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/@types/social-media/savefrom.d.ts.map b/node_modules/@bochilteam/scraper/lib/@types/social-media/savefrom.d.ts.map new file mode 100644 index 000000000..7e6da9393 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/@types/social-media/savefrom.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"savefrom.d.ts","sourceRoot":"","sources":["../../../src/social-media/savefrom.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAA;AAElC,wBAA8B,QAAQ,CAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC,CAyCtE"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/@types/social-media/test.d.ts b/node_modules/@bochilteam/scraper/lib/@types/social-media/test.d.ts new file mode 100644 index 000000000..9bcc4712a --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/@types/social-media/test.d.ts @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=test.d.ts.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/@types/social-media/test.d.ts.map b/node_modules/@bochilteam/scraper/lib/@types/social-media/test.d.ts.map new file mode 100644 index 000000000..f7fc6e40a --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/@types/social-media/test.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"test.d.ts","sourceRoot":"","sources":["../../../src/social-media/test.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/@types/social-media/tiktok.d.ts b/node_modules/@bochilteam/scraper/lib/@types/social-media/tiktok.d.ts new file mode 100644 index 000000000..d8e243025 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/@types/social-media/tiktok.d.ts @@ -0,0 +1,6 @@ +import type { TiktokDownloader, TiktokDownloaderv2, TiktokDownloaderv3, TiktokFyp } from './types'; +export declare function tiktokdl(url: string): Promise; +export declare function tiktokdlv2(url: string): Promise; +export declare function tiktokdlv3(url: string): Promise; +export declare function tiktokfyp(): Promise; +//# sourceMappingURL=tiktok.d.ts.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/@types/social-media/tiktok.d.ts.map b/node_modules/@bochilteam/scraper/lib/@types/social-media/tiktok.d.ts.map new file mode 100644 index 000000000..e3581ce51 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/@types/social-media/tiktok.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"tiktok.d.ts","sourceRoot":"","sources":["../../../src/social-media/tiktok.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,gBAAgB,EAChB,kBAAkB,EAClB,kBAAkB,EAClB,SAAS,EACV,MAAM,SAAS,CAAA;AAEhB,wBAAsB,QAAQ,CAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAwCtE;AAED,wBAAsB,UAAU,CAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAqC1E;AAED,wBAAsB,UAAU,CAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,CAAC,CA2C1E;AAED,wBAAsB,SAAS,IAAK,OAAO,CAAC,SAAS,EAAE,GAAG,EAAE,CAAC,CAK5D"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/@types/social-media/twitter.d.ts b/node_modules/@bochilteam/scraper/lib/@types/social-media/twitter.d.ts new file mode 100644 index 000000000..e0e42a4cc --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/@types/social-media/twitter.d.ts @@ -0,0 +1,4 @@ +import { TwitterDownloader, TwitterDownloaderv2 } from './types'; +export declare function twitterdl(url: string): Promise; +export declare function twitterdlv2(url: string): Promise; +//# sourceMappingURL=twitter.d.ts.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/@types/social-media/twitter.d.ts.map b/node_modules/@bochilteam/scraper/lib/@types/social-media/twitter.d.ts.map new file mode 100644 index 000000000..126a45f9d --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/@types/social-media/twitter.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"twitter.d.ts","sourceRoot":"","sources":["../../../src/social-media/twitter.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,iBAAiB,EACjB,mBAAmB,EAEpB,MAAM,SAAS,CAAA;AAGhB,wBAAsB,SAAS,CAC7B,GAAG,EAAE,MAAM,GACV,OAAO,CAAC,iBAAiB,EAAE,GAAG,EAAE,CAAC,CAoCnC;AAED,wBAAsB,WAAW,CAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,mBAAmB,EAAE,CAAC,CA6C9E"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/@types/social-media/types.d.ts b/node_modules/@bochilteam/scraper/lib/@types/social-media/types.d.ts new file mode 100644 index 000000000..8fa44f953 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/@types/social-media/types.d.ts @@ -0,0 +1,390 @@ +export interface FacebookDownloader { + id: string; + thumbnail: string; + duration: number; + result: { + size?: string; + ext: string; + url: string; + quality?: string; + vcodec?: string; + fid: string; + isVideo: boolean; + isAudio: boolean; + }[]; +} +export interface FacebookDownloaderV2 { + id?: string; + title: string; + description: string; + thumbnail: string; + result: { + quality: string; + url: string; + }[]; +} +export interface FacebookDownloaderV3 { + title: string; + thumbnail?: string; + result: { + quality?: string; + url: string; + isAudio: boolean; + isVideo: boolean; + }[]; +} +export interface GoogleIt { + info: { + title?: string; + type?: string; + description?: string; + image?: string[]; + }; + articles: { + header: string; + title: string; + url: string; + description: string; + }[]; +} +interface IinstagramDownloader { + url: string; +} +export declare type InstagramDownloader = IinstagramDownloader & { + thumbnail: string; +}; +export declare type InstagramDownloaderV2 = IinstagramDownloader & { + thumbnail: string; + sourceUrl?: string; +}; +export declare type InstagramDownloaderV4 = IinstagramDownloader & { + thumbnail: string; +}; +export declare type InstagramDownloaderV5 = IinstagramDownloader & { + thumbnail: string; + ext: string; +}; +interface IinstagramStory { + user: { + username: string; + profilePicUrl: string; + }; + results: { + thumbnail: string; + url: string; + type: string; + isVideo: boolean; + }[]; +} +export declare type InstagramStory = IinstagramStory; +export declare type InstagramStoryv2 = IinstagramStory & { + user: { + id: string; + fullName: string; + biography: string; + followers: number; + following: number; + }; + results: { + sourceUrl: string; + fileType: string; + }[]; +}; +export declare type InstagramStalk = { + name: string; + username: string; + avatar: string; + description: string; + postsH: string; + posts: number; + followersH: string; + followers: number; + followingH: string; + following: number; +}; +interface ItiktokDownloader { + author: { + nickname: string; + }; + video: { + [Key: string]: string; + }; +} +export declare type TiktokDownloader = ItiktokDownloader & { + description: string; + video: { + no_watermark: string; + no_watermark2: string; + no_watermark_raw: string; + }; +}; +export declare type TiktokDownloaderv2 = ItiktokDownloader & { + author: { + unique_id: string; + avatar: string; + }; + video: { + no_watermark: string; + no_watermark_hd: string; + }; +}; +export declare type TiktokDownloaderv3 = ItiktokDownloader & { + author: { + avatar: string; + }; + description: string; + video: { + no_watermark: string; + no_watermark2: string; + }; + music: string; +}; +export interface TiktokFyp { + id: string; + desc: string; + createdTime: Date; + video: { + id: string; + height: number; + width: number; + duration: number; + ratio: string; + cover: string; + originCover: string; + dynamicCover: string; + playAddr: string; + downloadAddr: string; + shareCover: string[]; + reflowCover: string; + bitrate: number; + encodedType: string; + format: string; + videoQuality: string; + encodeUserTag: string; + codecType: string; + definition: string; + }; + author: { + id: string; + uniqueId: string; + nickname: string; + avatarThumb: string; + avatarMedium: string; + avatarLarger: string; + signature: string; + verified: boolean; + secUid: string; + secret: boolean; + ftc: boolean; + relation: number; + openFavorite: boolean; + commentSetting: number; + duetSetting: number; + stitchSetting: number; + privateAccount: boolean; + isADVirtual: boolean; + }; + music: { + id: string; + title: string; + playUrl: string; + coverThumb: string; + coverMedium: string; + coverLarge: string; + authorName: string; + original: boolean; + duration: number; + album: string; + }; + challenges?: { + id: string; + title: string; + desc: string; + profileThumb: string; + profileMedium: string; + profileLarger: string; + coverThumb: string; + coverMedium: string; + coverLarger: string; + isCommerce: boolean; + }[]; + stats: { + diggCount: number; + shareCount: number; + commentCount: number; + playCount: number; + }; + duetInfo: { + duetFromId: string; + }; + originalItem: boolean; + officalItem: boolean; + textExtra?: { + awemeId: string; + start: number; + end: number; + hashtagName: string; + hashtagId: string; + type: 1; + userId: string; + isCommerce: boolean; + userUniqueId: string; + secUid: string; + subType: number; + }[]; + secret: boolean; + forFriend: boolean; + digged: boolean; + itemCommentStatus: number; + showNotPass: boolean; + vl1: boolean; + itemMute: boolean; + authorStats: { + followingCount: number; + followerCount: number; + heartCount: number; + videoCount: number; + diggCount: number; + heart: number; + }; + privateItem: boolean; + duetEnabled: boolean; + stitchEnabled: boolean; + shareEnabled: boolean; + isAd: boolean; + duetDisplay: number; + stitchDisplay: number; +} +interface ItwitterDownloader { + quality: string; + type: string; + url: string; +} +export declare type TwitterDownloader = ItwitterDownloader & { + isVideo: boolean; +}; +export declare type TwitterDownloaderv2 = ItwitterDownloader; +export interface YoutubeSearch { + video: { + authorName: string; + authorAvatar?: string; + videoId: string; + url: string; + thumbnail: string; + title: string; + description?: string; + publishedTime: string; + durationH: string; + durationS: number; + duration: string; + viewH: string; + view: string; + type: 'video'; + }[]; + channel: { + channelId: string; + url: string; + channelName: string; + avatar: string; + isVerified: boolean; + subscriberH: string; + subscriber: string; + videoCount: number; + description: string; + type: 'channel'; + }[]; + playlist: { + playlistId: string; + title: string; + thumbnail: string; + video: { + videoId: string; + title: string; + durationH: string; + duration: string; + }[]; + type: 'mix'; + }[]; +} +export declare type YoutubeVideoOrAudio = { + [key: string]: { + quality: string; + fileSizeH: string; + fileSize: number; + download(): Promise; + }; +}; +export interface YoutubeDownloader { + id: string; + v_id?: string; + thumbnail: string; + title: string; + video: YoutubeVideoOrAudio; + audio: YoutubeVideoOrAudio; +} +export declare type YoutubeVideoOrAudioV3 = { + [key: string]: { + quality: string; + fileSizeH?: string; + fileSize?: number; + download(): Promise; + }; +}; +export declare type YoutubeDownloaderV3 = { + id: string; + thumbnail: string; + title: string; + video: YoutubeVideoOrAudioV3; + audio: YoutubeVideoOrAudioV3; +}; +export interface GroupWA { + url: string; + subject: string; +} +export interface Aiovideodl { + url: string; + title: string; + thumbnail: string; + duration?: null; + source: string; + medias?: { + url: string; + quality: string; + extension: string; + size: number; + formattedSize: string; + videoAvailable: boolean; + audioAvailable: boolean; + chunked: boolean; + cached: boolean; + }[] | null; +} +export interface Savefrom { + id?: string; + url: { + url: string; + name: string; + ext: string; + type: string; + quality?: number; + subname: string; + }[]; + meta: { + title: string; + source: string; + duration?: string; + }; + thumb: string; + video_quality?: string[]; + sd?: { + url: string; + format?: string; + }; + hosting: string; + hd?: { + url: string; + format?: string; + }; +} +export {}; +//# sourceMappingURL=types.d.ts.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/@types/social-media/types.d.ts.map b/node_modules/@bochilteam/scraper/lib/@types/social-media/types.d.ts.map new file mode 100644 index 000000000..2c6b02ee1 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/@types/social-media/types.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/social-media/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,kBAAkB;IAClC,EAAE,EAAE,M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CAAC;IACJ,IAAI,EAAE;QACL,KAAK,EAAE,MAAM,CAAC;QACR,MAAM,EAAE,MAAM,CAAC;QACf,QAAQ,CAAC,EAAE,MAAM,CAAC;KACxB,CAAC;IACF,KAAK,EAAE,MAAM,CAAC;IACd,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;IACzB,EAAE,CAAC,EAAE;QACJ,GAAG,EAAE,MAAM,CAAC;QACZ,MAAM,CAAC,EAAE,MAAM,CAAC;KAChB,CAAC;IACF,OAAO,EAAE,MAAM,CAAC;IAChB,EAAE,CAAC,EAAE;QACJ,GAAG,EAAE,MAAM,CAAC;QACZ,MAAM,CAAC,EAAE,MAAM,CAAC;KAChB,CAAC;CACF"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/@types/social-media/youtube-search.d.ts b/node_modules/@bochilteam/scraper/lib/@types/social-media/youtube-search.d.ts new file mode 100644 index 000000000..26ae2aa2d --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/@types/social-media/youtube-search.d.ts @@ -0,0 +1,3 @@ +import { YoutubeSearch } from './types'; +export default function youtubeSearch(query: string): Promise; +//# sourceMappingURL=youtube-search.d.ts.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/@types/social-media/youtube-search.d.ts.map b/node_modules/@bochilteam/scraper/lib/@types/social-media/youtube-search.d.ts.map new file mode 100644 index 000000000..e25b7b5a9 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/@types/social-media/youtube-search.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"youtube-search.d.ts","sourceRoot":"","sources":["../../../src/social-media/youtube-search.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAGvC,wBAA8B,aAAa,CACzC,KAAK,EAAE,MAAM,GACZ,OAAO,CAAC,aAAa,CAAC,CA+IxB"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/@types/social-media/youtube.d.ts b/node_modules/@bochilteam/scraper/lib/@types/social-media/youtube.d.ts new file mode 100644 index 000000000..cc715ab05 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/@types/social-media/youtube.d.ts @@ -0,0 +1,5 @@ +import { YoutubeDownloader, YoutubeDownloaderV3 } from './types'; +export declare function youtubedl(url: string, server?: string): Promise; +export declare function youtubedlv2(url: string): Promise; +export declare function youtubedlv3(url: string): Promise; +//# sourceMappingURL=youtube.d.ts.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/@types/social-media/youtube.d.ts.map b/node_modules/@bochilteam/scraper/lib/@types/social-media/youtube.d.ts.map new file mode 100644 index 000000000..04c804f5c --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/@types/social-media/youtube.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"youtube.d.ts","sourceRoot":"","sources":["../../../src/social-media/youtube.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,iBAAiB,EAEjB,mBAAmB,EAGpB,MAAM,SAAS,CAAA;AAiBhB,wBAAsB,SAAS,CAC7B,GAAG,EAAE,MAAM,EACX,MAAM,GAAE,MAAgB,GACvB,OAAO,CAAC,iBAAiB,CAAC,CA2E5B;AAWD,wBAAsB,WAAW,CAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,CAAC,CA6E1E;AAED,wBAAsB,WAAW,CAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,mBAAmB,CAAC,CA4E5E"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/@types/texts/aksarajawa.d.ts b/node_modules/@bochilteam/scraper/lib/@types/texts/aksarajawa.d.ts new file mode 100644 index 000000000..782a4ccf4 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/@types/texts/aksarajawa.d.ts @@ -0,0 +1,13 @@ +interface Options { + diftong?: boolean; + murda?: boolean; + space?: boolean; + number?: boolean; + cecak?: boolean; + mode?: 'ketik' | 'kopas'; + HVokal?: boolean; +} +export declare function latinToAksara(str: string, options?: Options): string; +export declare function aksaraToLatin(str: string, options?: Partial): string; +export {}; +//# sourceMappingURL=aksarajawa.d.ts.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/@types/texts/aksarajawa.d.ts.map b/node_modules/@bochilteam/scraper/lib/@types/texts/aksarajawa.d.ts.map new file mode 100644 index 000000000..0d4623ac8 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/@types/texts/aksarajawa.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"aksarajawa.d.ts","sourceRoot":"","sources":["../../../src/texts/aksarajawa.ts"],"names":[],"mappings":"AAIA,UAAU,OAAO;IAChB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,IAAI,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC;IACzB,MAAM,CAAC,EAAE,OAAO,CAAC;CACjB;AAED,wBAAgB,aAAa,CAC3B,GAAG,EAAE,MAAM,EACX,OAAO,GAAE,OAAwC,GAChD,MAAM,CAGR;AAED,wBAAgB,aAAa,CAC3B,GAAG,EAAE,MAAM,EACX,OAAO,GAAE,OAAO,CAAC,OAAO,CAAqB,GAC5C,MAAM,CAGR"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/@types/texts/bucin.d.ts b/node_modules/@bochilteam/scraper/lib/@types/texts/bucin.d.ts new file mode 100644 index 000000000..dadad4e4d --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/@types/texts/bucin.d.ts @@ -0,0 +1,3 @@ +export declare let bucinjson: string[]; +export default function bucin(): Promise; +//# sourceMappingURL=bucin.d.ts.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/@types/texts/bucin.d.ts.map b/node_modules/@bochilteam/scraper/lib/@types/texts/bucin.d.ts.map new file mode 100644 index 000000000..79c9a1616 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/@types/texts/bucin.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"bucin.d.ts","sourceRoot":"","sources":["../../../src/texts/bucin.ts"],"names":[],"mappings":"AACA,eAAO,IAAI,SAAS,EAAE,MAAM,EAAO,CAAA;AACnC,wBAA8B,KAAK,IAAK,OAAO,CAAC,MAAM,CAAC,CAOtD"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/@types/texts/dare.d.ts b/node_modules/@bochilteam/scraper/lib/@types/texts/dare.d.ts new file mode 100644 index 000000000..4ad6cf076 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/@types/texts/dare.d.ts @@ -0,0 +1,3 @@ +export declare let darejson: string[]; +export default function dare(): Promise; +//# sourceMappingURL=dare.d.ts.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/@types/texts/dare.d.ts.map b/node_modules/@bochilteam/scraper/lib/@types/texts/dare.d.ts.map new file mode 100644 index 000000000..cc95b6751 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/@types/texts/dare.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"dare.d.ts","sourceRoot":"","sources":["../../../src/texts/dare.ts"],"names":[],"mappings":"AACA,eAAO,IAAI,QAAQ,EAAE,MAAM,EAAO,CAAA;AAClC,wBAA8B,IAAI,IAAK,OAAO,CAAC,MAAM,CAAC,CAOrD"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/@types/texts/index.d.ts b/node_modules/@bochilteam/scraper/lib/@types/texts/index.d.ts new file mode 100644 index 000000000..44d7012e5 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/@types/texts/index.d.ts @@ -0,0 +1,7 @@ +import bucin, { bucinjson } from './bucin.js'; +import dare, { darejson } from './dare.js'; +import truth, { truthjson } from './truth.js'; +import textpro, { textproList } from './textpro.js'; +export * from './aksarajawa.js'; +export { bucin, bucinjson, dare, darejson, truth, truthjson, textpro, textproList }; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/@types/texts/index.d.ts.map b/node_modules/@bochilteam/scraper/lib/@types/texts/index.d.ts.map new file mode 100644 index 000000000..5a94e1c26 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/@types/texts/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/texts/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AAC7C,OAAO,IAAI,EAAE,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAA;AAC1C,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AAC7C,OAAO,OAAO,EAAE,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAEnD,cAAc,iBAAiB,CAAA;AAC/B,OAAO,EACL,KAAK,EAAE,SAAS,EAChB,IAAI,EAAE,QAAQ,EACd,KAAK,EAAE,SAAS,EAChB,OAAO,EAAE,WAAW,EACrB,CAAA"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/@types/texts/test.d.ts b/node_modules/@bochilteam/scraper/lib/@types/texts/test.d.ts new file mode 100644 index 000000000..9bcc4712a --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/@types/texts/test.d.ts @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=test.d.ts.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/@types/texts/test.d.ts.map b/node_modules/@bochilteam/scraper/lib/@types/texts/test.d.ts.map new file mode 100644 index 000000000..02b64dda8 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/@types/texts/test.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"test.d.ts","sourceRoot":"","sources":["../../../src/texts/test.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/@types/texts/textpro.d.ts b/node_modules/@bochilteam/scraper/lib/@types/texts/textpro.d.ts new file mode 100644 index 000000000..7f3dff507 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/@types/texts/textpro.d.ts @@ -0,0 +1,4 @@ +import type { TextProList } from './types'; +export declare const textproList: Promise; +export default function textpro(effect: string, params: string[] | string): Promise; +//# sourceMappingURL=textpro.d.ts.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/@types/texts/textpro.d.ts.map b/node_modules/@bochilteam/scraper/lib/@types/texts/textpro.d.ts.map new file mode 100644 index 000000000..ae0774fd9 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/@types/texts/textpro.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"textpro.d.ts","sourceRoot":"","sources":["../../../src/texts/textpro.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAe1C,eAAO,MAAM,WAAW,EAAE,OAAO,CAAC,WAAW,EAAE,CAA8H,CAAA;AAC7K,wBAA8B,OAAO,CAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,mBAyC/E"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/@types/texts/truth.d.ts b/node_modules/@bochilteam/scraper/lib/@types/texts/truth.d.ts new file mode 100644 index 000000000..a7a6096cb --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/@types/texts/truth.d.ts @@ -0,0 +1,3 @@ +export declare let truthjson: string[]; +export default function truth(): Promise; +//# sourceMappingURL=truth.d.ts.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/@types/texts/truth.d.ts.map b/node_modules/@bochilteam/scraper/lib/@types/texts/truth.d.ts.map new file mode 100644 index 000000000..eee7774d9 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/@types/texts/truth.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"truth.d.ts","sourceRoot":"","sources":["../../../src/texts/truth.ts"],"names":[],"mappings":"AAEA,eAAO,IAAI,SAAS,EAAE,MAAM,EAAO,CAAA;AACnC,wBAA8B,KAAK,IAAK,OAAO,CAAC,MAAM,CAAC,CAOtD"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/@types/texts/types.d.ts b/node_modules/@bochilteam/scraper/lib/@types/texts/types.d.ts new file mode 100644 index 000000000..358213a9d --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/@types/texts/types.d.ts @@ -0,0 +1,6 @@ +export interface TextProList { + link: string; + title: string; + parameters: boolean[]; +} +//# sourceMappingURL=types.d.ts.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/@types/texts/types.d.ts.map b/node_modules/@bochilteam/scraper/lib/@types/texts/types.d.ts.map new file mode 100644 index 000000000..df65f841b --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/@types/texts/types.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/texts/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,WAAW;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,OAAO,EAAE,CAAC;CACzB"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/@types/utils.d.ts b/node_modules/@bochilteam/scraper/lib/@types/utils.d.ts new file mode 100644 index 000000000..b2c10b71f --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/@types/utils.d.ts @@ -0,0 +1,7 @@ +export declare class ScraperError extends Error { + readonly date: Date; + constructor(message: any, options?: {}); + static createError(message: any, options: {}): ScraperError; +} +export declare function decodeSnapApp(...args: string[] | number[]): string; +//# sourceMappingURL=utils.d.ts.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/@types/utils.d.ts.map b/node_modules/@bochilteam/scraper/lib/@types/utils.d.ts.map new file mode 100644 index 000000000..f8e80eaf6 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/@types/utils.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":"AAAA,qBAAa,YAAa,SAAQ,KAAK;IACrC,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC;gBACP,OAAO,EAAE,GAAG,EAAE,OAAO,CAAC,EAAE,EAAE;IASvC,MAAM,CAAC,WAAW,CAAE,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,EAAE,GAAG,YAAY;CAG7D;AAED,wBAAgB,aAAa,CAAE,GAAG,IAAI,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,GAAG,MAAM,CAiDnE"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/cjs/encryptions/base64.js b/node_modules/@bochilteam/scraper/lib/cjs/encryptions/base64.js new file mode 100644 index 000000000..34634ee3b --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/cjs/encryptions/base64.js @@ -0,0 +1,16 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.fromBase64ToString = exports.toBase64 = void 0; +function toBase64(data) { + if (!Buffer.isBuffer(data)) + data = Buffer.from(data); + return data.toString('base64'); +} +exports.toBase64 = toBase64; +function fromBase64ToString(data) { + if (/data:.*;base64,/i.test(data)) + data = data.replace(/data:.*;base64,/i, ''); + return Buffer.from(data, 'base64').toString(); +} +exports.fromBase64ToString = fromBase64ToString; +//# sourceMappingURL=base64.js.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/cjs/encryptions/base64.js.map b/node_modules/@bochilteam/scraper/lib/cjs/encryptions/base64.js.map new file mode 100644 index 000000000..23327e46c --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/cjs/encryptions/base64.js.map @@ -0,0 +1 @@ +{"version":3,"file":"base64.js","sourceRoot":"","sources":["../../../src/encryptions/base64.ts"],"names":[],"mappings":";;;AAAA,SAAgB,QAAQ,CAAE,IAAS;IACjC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC;QAAE,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IACpD,OAAO,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAA;AAChC,CAAC;AAHD,4BAGC;AAED,SAAgB,kBAAkB,CAAE,IAAY;IAC9C,IAAI,kBAAkB,CAAC,IAAI,CAAC,IAAI,CAAC;QAAE,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,kBAAkB,EAAE,EAAE,CAAC,CAAA;IAC9E,OAAO,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC,QAAQ,EAAE,CAAA;AAC/C,CAAC;AAHD,gDAGC"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/cjs/encryptions/crypto.js b/node_modules/@bochilteam/scraper/lib/cjs/encryptions/crypto.js new file mode 100644 index 000000000..5d9dc802f --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/cjs/encryptions/crypto.js @@ -0,0 +1,59 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.createHash = exports.randomBytes = exports.randomUUID = void 0; +const crypto_1 = __importDefault(require("crypto")); +function randomUUID(opts) { + if (typeof crypto_1.default.randomUUID === 'function') { + return crypto_1.default.randomUUID(opts); + } + const rnds8Pool = new Uint8Array(256); // # of random values to pre-allocate + let poolPtr = rnds8Pool.length; + if (poolPtr > rnds8Pool.length - 16) { + crypto_1.default.randomFillSync(rnds8Pool); + poolPtr = 0; + } + // eslint-disable-next-line prefer-const + let rnds = rnds8Pool.slice(poolPtr, (poolPtr += 16)); + rnds[6] = (rnds[6] & 0x0f) | 0x40; + rnds[8] = (rnds[8] & 0x3f) | 0x80; + return serializeUUID(rnds); +} +exports.randomUUID = randomUUID; +function randomBytes(size) { + return crypto_1.default.randomBytes(size).toString('hex'); +} +exports.randomBytes = randomBytes; +function createHash(algorithm /* 'md4' | 'md5' | 'sha1' | 'sha256' | 'sha512 */, data) { + return crypto_1.default.createHash(algorithm).update(data).digest('hex'); +} +exports.createHash = createHash; +const kHexBytes = []; +for (let i = 0; i < 256; ++i) { + kHexBytes.push((i + 0x100).toString(16).substr(1)); +} +function serializeUUID(buf, offset = 0) { + return (kHexBytes[buf[offset]] + + kHexBytes[buf[offset + 1]] + + kHexBytes[buf[offset + 2]] + + kHexBytes[buf[offset + 3]] + + '-' + + kHexBytes[buf[offset + 4]] + + kHexBytes[buf[offset + 5]] + + '-' + + kHexBytes[(buf[offset + 6] & 0x0f) | 0x40] + + kHexBytes[buf[offset + 7]] + + '-' + + kHexBytes[(buf[offset + 8] & 0x3f) | 0x80] + + kHexBytes[buf[offset + 9]] + + '-' + + kHexBytes[buf[offset + 10]] + + kHexBytes[buf[offset + 11]] + + kHexBytes[buf[offset + 12]] + + kHexBytes[buf[offset + 13]] + + kHexBytes[buf[offset + 14]] + + kHexBytes[buf[offset + 15]]).toLowerCase(); +} +//# sourceMappingURL=crypto.js.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/cjs/encryptions/crypto.js.map b/node_modules/@bochilteam/scraper/lib/cjs/encryptions/crypto.js.map new file mode 100644 index 000000000..8feba0da3 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/cjs/encryptions/crypto.js.map @@ -0,0 +1 @@ +{"version":3,"file":"crypto.js","sourceRoot":"","sources":["../../../src/encryptions/crypto.ts"],"names":[],"mappings":";;;;;;AAAA,oDAA2B;AAE3B,SAAgB,UAAU,CAAE,IAAuC;IACjE,IAAI,OAAO,gBAAM,CAAC,UAAU,KAAK,UAAU,EAAE;QAAE,OAAO,gBAAM,CAAC,UAAU,CAAC,IAAI,CAAW,CAAA;KAAE;IACzF,MAAM,SAAS,GAAG,IAAI,UAAU,CAAC,GAAG,CAAC,CAAA,CAAC,qCAAqC;IAC3E,IAAI,OAAO,GAAW,SAAS,CAAC,MAA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C,MAAM,CAAC,CAAC;QACtB,SAAS,CAAC,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;QAC1B,SAAS,CAAC,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;QAC1B,SAAS,CAAC,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;QAC1B,GAAG;QACH,SAAS,CAAC,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;QAC1B,SAAS,CAAC,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;QAC1B,GAAG;QACH,SAAS,CAAC,CAAC,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,IAAI,CAAC;QAC1C,SAAS,CAAC,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;QAC1B,GAAG;QACH,SAAS,CAAC,CAAC,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,IAAI,CAAC;QAC1C,SAAS,CAAC,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;QAC1B,GAAG;QACH,SAAS,CAAC,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;QAC3B,SAAS,CAAC,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;QAC3B,SAAS,CAAC,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;QAC3B,SAAS,CAAC,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;QAC3B,SAAS,CAAC,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;QAC3B,SAAS,CAAC,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC,CAC5B,CAAC,WAAW,EAAE,CAAA;AACjB,CAAC"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/cjs/encryptions/index.js b/node_modules/@bochilteam/scraper/lib/cjs/encryptions/index.js new file mode 100644 index 000000000..15c122019 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/cjs/encryptions/index.js @@ -0,0 +1,19 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +__exportStar(require("./base64.js"), exports); +__exportStar(require("./crypto.js"), exports); +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/cjs/encryptions/index.js.map b/node_modules/@bochilteam/scraper/lib/cjs/encryptions/index.js.map new file mode 100644 index 000000000..c39766864 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/cjs/encryptions/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/encryptions/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8CAA2B;AAC3B,8CAA2B"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/cjs/encryptions/test.js b/node_modules/@bochilteam/scraper/lib/cjs/encryptions/test.js new file mode 100644 index 000000000..4d61292cc --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/cjs/encryptions/test.js @@ -0,0 +1,64 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const chai_1 = require("chai"); +const index_js_1 = require("./index.js"); +describe('Encryptions', () => { + describe('Base64', () => { + it('From string to base64', done => { + try { + const res = (0, index_js_1.toBase64)('Hello World!!'); + (0, chai_1.expect)(res).to.be.a('string'); + (0, chai_1.expect)(res).to.be.equal('SGVsbG8gV29ybGQhIQ=='); + return done(); + } + catch (e) { + return done(e); + } + }); + it('from base64 to string', done => { + try { + const res = (0, index_js_1.fromBase64ToString)('SGVsbG8gV29ybGQhIQ=='); + (0, chai_1.expect)(res).to.be.a('string'); + (0, chai_1.expect)(res).to.be.equal('Hello World!!'); + return done(); + } + catch (e) { + return done(e); + } + }); + }); + describe('Crypto', () => { + it('randomUUID', done => { + try { + const res = (0, index_js_1.randomUUID)(); + (0, chai_1.expect)(res).to.be.a('string'); + return done(); + } + catch (e) { + return done(e); + } + }); + it('randomBytes', done => { + try { + const res = (0, index_js_1.randomBytes)(16); + (0, chai_1.expect)(res).to.be.a('string'); + return done(); + } + catch (e) { + return done(e); + } + }); + it('createHash', done => { + try { + const res = (0, index_js_1.createHash)('sha256', 'Hello world!!'); + (0, chai_1.expect)(res).to.be.a('string'); + (0, chai_1.expect)(res).to.have.length(64); + return done(); + } + catch (e) { + return done(e); + } + }); + }); +}); +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/cjs/encryptions/test.js.map b/node_modules/@bochilteam/scraper/lib/cjs/encryptions/test.js.map new file mode 100644 index 000000000..3702a6eea --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/cjs/encryptions/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["../../../src/encryptions/test.ts"],"names":[],"mappings":";;AAAA,+BAA6B;AAC7B,yCAMmB;AAEnB,QAAQ,CAAC,aAAa,EAAE,GAAG,EAAE;IAC3B,QAAQ,CAAC,QAAQ,EAAE,GAAG,EAAE;QACtB,EAAE,CAAC,uBAAuB,EAAE,IAAI,CAAC,EAAE;YACjC,IAAI;gBACF,MAAM,GAAG,GAAG,IAAA,mBAAQ,EAAC,eAAe,CAAC,CAAA;gBACrC,IAAA,aAAM,EAAC,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAA;gBAC7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AAC,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAA;gBAE7B,OAAO,IAAI,EAAE,CAAA;aACd;YAAC,OAAO,CAAC,EAAE;gBACV,OAAO,IAAI,CAAC,CAAC,CAAC,CAAA;aACf;QACH,CAAC,CAAC,CAAA;QAEF,EAAE,CAAC,YAAY,EAAE,IAAI,CAAC,EAAE;YACtB,IAAI;gBACF,MAAM,GAAG,GAAG,IAAA,qBAAU,EAAC,QAAQ,EAAE,eAAe,CAAC,CAAA;gBACjD,IAAA,aAAM,EAAC,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAA;gBAC7B,IAAA,aAAM,EAAC,GAAG,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,CAAA;gBAE9B,OAAO,IAAI,EAAE,CAAA;aACd;YAAC,OAAO,CAAC,EAAE;gBACV,OAAO,IAAI,CAAC,CAAC,CAAC,CAAA;aACf;QACH,CAAC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/cjs/games/asahotak.js b/node_modules/@bochilteam/scraper/lib/cjs/games/asahotak.js new file mode 100644 index 000000000..581c16044 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/cjs/games/asahotak.js @@ -0,0 +1,15 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.asahotakjson = void 0; +const got_1 = __importDefault(require("got")); +async function asahotak() { + if (!exports.asahotakjson) { + exports.asahotakjson = await (0, got_1.default)('https://raw.githubusercontent.com/BochilTeam/database/master/games/asahotak.json').json(); + } + return exports.asahotakjson[Math.floor(Math.random() * exports.asahotakjson.length)]; +} +exports.default = asahotak; +//# sourceMappingURL=asahotak.js.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/cjs/games/asahotak.js.map b/node_modules/@bochilteam/scraper/lib/cjs/games/asahotak.js.map new file mode 100644 index 000000000..5fcb2dc30 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/cjs/games/asahotak.js.map @@ -0,0 +1 @@ +{"version":3,"file":"asahotak.js","sourceRoot":"","sources":["../../../src/games/asahotak.ts"],"names":[],"mappings":";;;;;;AAAA,8CAAqB;AAIN,KAAK,UAAU,QAAQ;IACpC,IAAI,CAAC,oBAAY,EAAE;QACjB,oBAAY,GAAG,MAAM,IAAA,aAAG,EACtB,kFAAkF,CACnF,CAAC,IAAI,EAAE,CAAA;KACT;IACD,OAAO,oBAAY,CACjB,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,oBAAY,CAAC,MAAM,CAAC,CACpC,CAAA;AACf,CAAC;AATD,2BASC"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/cjs/games/caklontong.js b/node_modules/@bochilteam/scraper/lib/cjs/games/caklontong.js new file mode 100644 index 000000000..2e3228e44 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/cjs/games/caklontong.js @@ -0,0 +1,15 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.caklontongjson = void 0; +const got_1 = __importDefault(require("got")); +async function caklontong() { + if (!exports.caklontongjson) { + exports.caklontongjson = await (0, got_1.default)('https://raw.githubusercontent.com/BochilTeam/database/master/games/caklontong.json').json(); + } + return exports.caklontongjson[Math.floor(Math.random() * exports.caklontongjson.length)]; +} +exports.default = caklontong; +//# sourceMappingURL=caklontong.js.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/cjs/games/caklontong.js.map b/node_modules/@bochilteam/scraper/lib/cjs/games/caklontong.js.map new file mode 100644 index 000000000..dcff0a1d2 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/cjs/games/caklontong.js.map @@ -0,0 +1 @@ +{"version":3,"file":"caklontong.js","sourceRoot":"","sources":["../../../src/games/caklontong.ts"],"names":[],"mappings":";;;;;;AAAA,8CAAqB;AAIN,KAAK,UAAU,UAAU;IACtC,IAAI,CAAC,sBAAc,EAAE;QACnB,sBAAc,GAAG,MAAM,IAAA,aAAG,EACxB,oFAAoF,CACrF,CAAC,IAAI,EAAE,CAAA;KACT;IACD,OAAO,sBAAc,CACnB,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,sBAAc,CAAC,MAAM,CAAC,CACpC,CAAA;AACjB,CAAC;AATD,6BASC"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/cjs/games/family100.js b/node_modules/@bochilteam/scraper/lib/cjs/games/family100.js new file mode 100644 index 000000000..7afebfd03 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/cjs/games/family100.js @@ -0,0 +1,15 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.family100json = void 0; +const got_1 = __importDefault(require("got")); +async function family100() { + if (!exports.family100json) { + exports.family100json = await (0, got_1.default)('https://raw.githubusercontent.com/BochilTeam/database/master/games/family100.json').json(); + } + return exports.family100json[Math.floor(Math.random() * exports.family100json.length)]; +} +exports.default = family100; +//# sourceMappingURL=family100.js.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/cjs/games/family100.js.map b/node_modules/@bochilteam/scraper/lib/cjs/games/family100.js.map new file mode 100644 index 000000000..ed148ecce --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/cjs/games/family100.js.map @@ -0,0 +1 @@ +{"version":3,"file":"family100.js","sourceRoot":"","sources":["../../../src/games/family100.ts"],"names":[],"mappings":";;;;;;AAAA,8CAAqB;AAIN,KAAK,UAAU,SAAS;IACrC,IAAI,CAAC,qBAAa,EAAE;QAClB,qBAAa,GAAG,MAAM,IAAA,aAAG,EACvB,mFAAmF,CACpF,CAAC,IAAI,EAAE,CAAA;KACT;IACD,OAAO,qBAAa,CAClB,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,qBAAa,CAAC,MAAM,CAAC,CACpC,CAAA;AAChB,CAAC;AATD,4BASC"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/cjs/games/index.js b/node_modules/@bochilteam/scraper/lib/cjs/games/index.js new file mode 100644 index 000000000..7d5e19441 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/cjs/games/index.js @@ -0,0 +1,66 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.tebaktebakanjson = exports.tebaktebakan = exports.tebaklirikjson = exports.tebaklirik = exports.tebakbenderajson = exports.tebakbendera = exports.susunkatajson = exports.susunkata = exports.siapakahakujson = exports.siapakahaku = exports.tebakkabupatenjson = exports.tebakkabupaten = exports.tebakkimiajson = exports.tebakkimia = exports.tekatekijson = exports.tekateki = exports.tebakkatajson = exports.tebakkata = exports.asahotakjson = exports.asahotak = exports.family100json = exports.family100 = exports.caklontongjson = exports.caklontong = exports.tebakgambarjson = exports.tebakgambar = void 0; +const asahotak_js_1 = __importStar(require("./asahotak.js")); +exports.asahotak = asahotak_js_1.default; +Object.defineProperty(exports, "asahotakjson", { enumerable: true, get: function () { return asahotak_js_1.asahotakjson; } }); +const caklontong_js_1 = __importStar(require("./caklontong.js")); +exports.caklontong = caklontong_js_1.default; +Object.defineProperty(exports, "caklontongjson", { enumerable: true, get: function () { return caklontong_js_1.caklontongjson; } }); +const family100_js_1 = __importStar(require("./family100.js")); +exports.family100 = family100_js_1.default; +Object.defineProperty(exports, "family100json", { enumerable: true, get: function () { return family100_js_1.family100json; } }); +const siapakahaku_js_1 = __importStar(require("./siapakahaku.js")); +exports.siapakahaku = siapakahaku_js_1.default; +Object.defineProperty(exports, "siapakahakujson", { enumerable: true, get: function () { return siapakahaku_js_1.siapakahakujson; } }); +const susunkata_js_1 = __importStar(require("./susunkata.js")); +exports.susunkata = susunkata_js_1.default; +Object.defineProperty(exports, "susunkatajson", { enumerable: true, get: function () { return susunkata_js_1.susunkatajson; } }); +const tebakbendera_js_1 = __importStar(require("./tebakbendera.js")); +exports.tebakbendera = tebakbendera_js_1.default; +Object.defineProperty(exports, "tebakbenderajson", { enumerable: true, get: function () { return tebakbendera_js_1.tebakbenderajson; } }); +const tebakgambar_js_1 = __importStar(require("./tebakgambar.js")); +exports.tebakgambar = tebakgambar_js_1.default; +Object.defineProperty(exports, "tebakgambarjson", { enumerable: true, get: function () { return tebakgambar_js_1.tebakgambarjson; } }); +const tebakkabupaten_js_1 = __importStar(require("./tebakkabupaten.js")); +exports.tebakkabupaten = tebakkabupaten_js_1.default; +Object.defineProperty(exports, "tebakkabupatenjson", { enumerable: true, get: function () { return tebakkabupaten_js_1.tebakkabupatenjson; } }); +const tebakkata_js_1 = __importStar(require("./tebakkata.js")); +exports.tebakkata = tebakkata_js_1.default; +Object.defineProperty(exports, "tebakkatajson", { enumerable: true, get: function () { return tebakkata_js_1.tebakkatajson; } }); +const tebakkimia_js_1 = __importStar(require("./tebakkimia.js")); +exports.tebakkimia = tebakkimia_js_1.default; +Object.defineProperty(exports, "tebakkimiajson", { enumerable: true, get: function () { return tebakkimia_js_1.tebakkimiajson; } }); +const tebaklirik_js_1 = __importStar(require("./tebaklirik.js")); +exports.tebaklirik = tebaklirik_js_1.default; +Object.defineProperty(exports, "tebaklirikjson", { enumerable: true, get: function () { return tebaklirik_js_1.tebaklirikjson; } }); +const tebaktebakan_js_1 = __importStar(require("./tebaktebakan.js")); +exports.tebaktebakan = tebaktebakan_js_1.default; +Object.defineProperty(exports, "tebaktebakanjson", { enumerable: true, get: function () { return tebaktebakan_js_1.tebaktebakanjson; } }); +const tekateki_js_1 = __importStar(require("./tekateki.js")); +exports.tekateki = tekateki_js_1.default; +Object.defineProperty(exports, "tekatekijson", { enumerable: true, get: function () { return tekateki_js_1.tekatekijson; } }); +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/cjs/games/index.js.map b/node_modules/@bochilteam/scraper/lib/cjs/games/index.js.map new file mode 100644 index 000000000..19d9e1ce6 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/cjs/games/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/games/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6DAAsD;AAqBpD,mBArBK,qBAAQ,CAqBL;AACR,6FAtBiB,0BAAY,OAsBjB;AArBd,iEAA4D;AAgB1D,qBAhBK,uBAAU,CAgBL;AACV,+FAjBmB,8BAAc,OAiBnB;AAhBhB,+DAAyD;AAiBvD,oBAjBK,sBAAS,CAiBL;AACT,8FAlBkB,4BAAa,OAkBlB;AAjBf,mEAA+D;AA4B7D,sBA5BK,wBAAW,CA4BL;AACX,gGA7BoB,gCAAe,OA6BpB;AA5BjB,+DAAyD;AA6BvD,oBA7BK,sBAAS,CA6BL;AACT,8FA9BkB,4BAAa,OA8BlB;AA7Bf,qEAAkE;AA8BhE,uBA9BK,yBAAY,CA8BL;AACZ,iGA/BqB,kCAAgB,OA+BrB;AA9BlB,mEAA+D;AAS7D,sBATK,wBAAW,CASL;AACX,gGAVoB,gCAAe,OAUpB;AATjB,yEAAwE;AAsBtE,yBAtBK,2BAAc,CAsBL;AACd,mGAvBuB,sCAAkB,OAuBvB;AAtBpB,+DAAyD;AAevD,oBAfK,sBAAS,CAeL;AACT,8FAhBkB,4BAAa,OAgBlB;AAff,iEAA4D;AAkB1D,qBAlBK,uBAAU,CAkBL;AACV,+FAnBmB,8BAAc,OAmBnB;AAlBhB,iEAA4D;AA2B1D,qBA3BK,uBAAU,CA2BL;AACV,+FA5BmB,8BAAc,OA4BnB;AA3BhB,qEAAkE;AA4BhE,uBA5BK,yBAAY,CA4BL;AACZ,iGA7BqB,kCAAgB,OA6BrB;AA5BlB,6DAAsD;AAapD,mBAbK,qBAAQ,CAaL;AACR,6FAdiB,0BAAY,OAcjB"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/cjs/games/siapakahaku.js b/node_modules/@bochilteam/scraper/lib/cjs/games/siapakahaku.js new file mode 100644 index 000000000..ef4d6595d --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/cjs/games/siapakahaku.js @@ -0,0 +1,15 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.siapakahakujson = void 0; +const got_1 = __importDefault(require("got")); +async function siapakahaku() { + if (!exports.siapakahakujson) { + exports.siapakahakujson = await (0, got_1.default)('https://raw.githubusercontent.com/BochilTeam/database/master/games/siapakahaku.json').json(); + } + return exports.siapakahakujson[Math.floor(Math.random() * exports.siapakahakujson.length)]; +} +exports.default = siapakahaku; +//# sourceMappingURL=siapakahaku.js.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/cjs/games/siapakahaku.js.map b/node_modules/@bochilteam/scraper/lib/cjs/games/siapakahaku.js.map new file mode 100644 index 000000000..2d6976bc8 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/cjs/games/siapakahaku.js.map @@ -0,0 +1 @@ +{"version":3,"file":"siapakahaku.js","sourceRoot":"","sources":["../../../src/games/siapakahaku.ts"],"names":[],"mappings":";;;;;;AAAA,8CAAqB;AAIN,KAAK,UAAU,WAAW;IACvC,IAAI,CAAC,uBAAe,EAAE;QACpB,uBAAe,GAAG,MAAM,IAAA,aAAG,EACzB,qFAAqF,CACtF,CAAC,IAAI,EAAE,CAAA;KACT;IACD,OAAO,uBAAe,CACpB,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,uBAAe,CAAC,MAAM,CAAC,CACpC,CAAA;AAClB,CAAC;AATD,8BASC"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/cjs/games/susunkata.js b/node_modules/@bochilteam/scraper/lib/cjs/games/susunkata.js new file mode 100644 index 000000000..41fdbf6fd --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/cjs/games/susunkata.js @@ -0,0 +1,15 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.susunkatajson = void 0; +const got_1 = __importDefault(require("got")); +async function susunkata() { + if (!exports.susunkatajson) { + exports.susunkatajson = await (0, got_1.default)('https://raw.githubusercontent.com/BochilTeam/database/master/games/susunkata.json').json(); + } + return exports.susunkatajson[Math.floor(Math.random() * exports.susunkatajson.length)]; +} +exports.default = susunkata; +//# sourceMappingURL=susunkata.js.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/cjs/games/susunkata.js.map b/node_modules/@bochilteam/scraper/lib/cjs/games/susunkata.js.map new file mode 100644 index 000000000..f44eb0a31 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/cjs/games/susunkata.js.map @@ -0,0 +1 @@ +{"version":3,"file":"susunkata.js","sourceRoot":"","sources":["../../../src/games/susunkata.ts"],"names":[],"mappings":";;;;;;AAAA,8CAAqB;AAIN,KAAK,UAAU,SAAS;IACrC,IAAI,CAAC,qBAAa,EAAE;QAClB,qBAAa,GAAG,MAAM,IAAA,aAAG,EACvB,mFAAmF,CACpF,CAAC,IAAI,EAAE,CAAA;KACT;IACD,OAAO,qBAAa,CAClB,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,qBAAa,CAAC,MAAM,CAAC,CACpC,CAAA;AAChB,CAAC;AATD,4BASC"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/cjs/games/tebakbendera.js b/node_modules/@bochilteam/scraper/lib/cjs/games/tebakbendera.js new file mode 100644 index 000000000..67c1d7d0f --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/cjs/games/tebakbendera.js @@ -0,0 +1,15 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.tebakbenderajson = void 0; +const got_1 = __importDefault(require("got")); +async function tebakbendera() { + if (!exports.tebakbenderajson) { + exports.tebakbenderajson = await (0, got_1.default)('https://raw.githubusercontent.com/BochilTeam/database/master/games/tebakbendera.json').json(); + } + return exports.tebakbenderajson[Math.floor(Math.random() * exports.tebakbenderajson.length)]; +} +exports.default = tebakbendera; +//# sourceMappingURL=tebakbendera.js.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/cjs/games/tebakbendera.js.map b/node_modules/@bochilteam/scraper/lib/cjs/games/tebakbendera.js.map new file mode 100644 index 000000000..a8130d593 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/cjs/games/tebakbendera.js.map @@ -0,0 +1 @@ +{"version":3,"file":"tebakbendera.js","sourceRoot":"","sources":["../../../src/games/tebakbendera.ts"],"names":[],"mappings":";;;;;;AAAA,8CAAqB;AAIN,KAAK,UAAU,YAAY;IACxC,IAAI,CAAC,wBAAgB,EAAE;QACrB,wBAAgB,GAAG,MAAM,IAAA,aAAG,EAC1B,sFAAsF,CACvF,CAAC,IAAI,EAAE,CAAA;KACT;IACD,OAAO,wBAAgB,CACrB,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,wBAAgB,CAAC,MAAM,CAAC,CACpC,CAAA;AACnB,CAAC;AATD,+BASC"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/cjs/games/tebakgambar.js b/node_modules/@bochilteam/scraper/lib/cjs/games/tebakgambar.js new file mode 100644 index 000000000..db5be0df1 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/cjs/games/tebakgambar.js @@ -0,0 +1,15 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.tebakgambarjson = void 0; +const got_1 = __importDefault(require("got")); +async function tebakgambar() { + if (!exports.tebakgambarjson) { + exports.tebakgambarjson = await (0, got_1.default)('https://raw.githubusercontent.com/BochilTeam/database/master/games/tebakgambar.json').json(); + } + return exports.tebakgambarjson[Math.floor(Math.random() * exports.tebakgambarjson.length)]; +} +exports.default = tebakgambar; +//# sourceMappingURL=tebakgambar.js.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/cjs/games/tebakgambar.js.map b/node_modules/@bochilteam/scraper/lib/cjs/games/tebakgambar.js.map new file mode 100644 index 000000000..209276ca1 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/cjs/games/tebakgambar.js.map @@ -0,0 +1 @@ +{"version":3,"file":"tebakgambar.js","sourceRoot":"","sources":["../../../src/games/tebakgambar.ts"],"names":[],"mappings":";;;;;;AAAA,8CAAqB;AAIN,KAAK,UAAU,WAAW;IACvC,IAAI,CAAC,uBAAe,EAAE;QACpB,uBAAe,GAAG,MAAM,IAAA,aAAG,EACzB,qFAAqF,CACtF,CAAC,IAAI,EAAE,CAAA;KACT;IACD,OAAO,uBAAe,CACpB,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,uBAAe,CAAC,MAAM,CAAC,CACpC,CAAA;AAClB,CAAC;AATD,8BASC"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/cjs/games/tebakkabupaten.js b/node_modules/@bochilteam/scraper/lib/cjs/games/tebakkabupaten.js new file mode 100644 index 000000000..defbfde36 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/cjs/games/tebakkabupaten.js @@ -0,0 +1,15 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.tebakkabupatenjson = void 0; +const got_1 = __importDefault(require("got")); +async function tebakkabupaten() { + if (!exports.tebakkabupatenjson) { + exports.tebakkabupatenjson = await (0, got_1.default)('https://raw.githubusercontent.com/BochilTeam/database/master/games/tebakkabupaten.json').json(); + } + return exports.tebakkabupatenjson[Math.floor(Math.random() * exports.tebakkabupatenjson.length)]; +} +exports.default = tebakkabupaten; +//# sourceMappingURL=tebakkabupaten.js.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/cjs/games/tebakkabupaten.js.map b/node_modules/@bochilteam/scraper/lib/cjs/games/tebakkabupaten.js.map new file mode 100644 index 000000000..58d422b73 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/cjs/games/tebakkabupaten.js.map @@ -0,0 +1 @@ +{"version":3,"file":"tebakkabupaten.js","sourceRoot":"","sources":["../../../src/games/tebakkabupaten.ts"],"names":[],"mappings":";;;;;;AAAA,8CAAqB;AAIN,KAAK,UAAU,cAAc;IAC1C,IAAI,CAAC,0BAAkB,EAAE;QACvB,0BAAkB,GAAG,MAAM,IAAA,aAAG,EAC5B,wFAAwF,CACzF,CAAC,IAAI,EAAE,CAAA;KACT;IACD,OAAO,0BAAkB,CACvB,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,0BAAkB,CAAC,MAAM,CAAC,CACpC,CAAA;AACrB,CAAC;AATD,iCASC"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/cjs/games/tebakkata.js b/node_modules/@bochilteam/scraper/lib/cjs/games/tebakkata.js new file mode 100644 index 000000000..16d170ae4 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/cjs/games/tebakkata.js @@ -0,0 +1,15 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.tebakkatajson = void 0; +const got_1 = __importDefault(require("got")); +async function tebakkata() { + if (!exports.tebakkatajson) { + exports.tebakkatajson = await (0, got_1.default)('https://raw.githubusercontent.com/BochilTeam/database/master/games/tebakkata.json').json(); + } + return exports.tebakkatajson[Math.floor(Math.random() * exports.tebakkatajson.length)]; +} +exports.default = tebakkata; +//# sourceMappingURL=tebakkata.js.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/cjs/games/tebakkata.js.map b/node_modules/@bochilteam/scraper/lib/cjs/games/tebakkata.js.map new file mode 100644 index 000000000..0bae5f143 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/cjs/games/tebakkata.js.map @@ -0,0 +1 @@ +{"version":3,"file":"tebakkata.js","sourceRoot":"","sources":["../../../src/games/tebakkata.ts"],"names":[],"mappings":";;;;;;AAAA,8CAAqB;AAIN,KAAK,UAAU,SAAS;IACrC,IAAI,CAAC,qBAAa,EAAE;QAClB,qBAAa,GAAG,MAAM,IAAA,aAAG,EACvB,mFAAmF,CACpF,CAAC,IAAI,EAAE,CAAA;KACT;IACD,OAAO,qBAAa,CAClB,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,qBAAa,CAAC,MAAM,CAAC,CACpC,CAAA;AAChB,CAAC;AATD,4BASC"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/cjs/games/tebakkimia.js b/node_modules/@bochilteam/scraper/lib/cjs/games/tebakkimia.js new file mode 100644 index 000000000..4b3de81e8 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/cjs/games/tebakkimia.js @@ -0,0 +1,15 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.tebakkimiajson = void 0; +const got_1 = __importDefault(require("got")); +async function tebakkimia() { + if (!exports.tebakkimiajson) { + exports.tebakkimiajson = await (0, got_1.default)('https://raw.githubusercontent.com/BochilTeam/database/master/games/tebakkimia.json').json(); + } + return exports.tebakkimiajson[Math.floor(Math.random() * exports.tebakkimiajson.length)]; +} +exports.default = tebakkimia; +//# sourceMappingURL=tebakkimia.js.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/cjs/games/tebakkimia.js.map b/node_modules/@bochilteam/scraper/lib/cjs/games/tebakkimia.js.map new file mode 100644 index 000000000..9d7c2a150 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/cjs/games/tebakkimia.js.map @@ -0,0 +1 @@ +{"version":3,"file":"tebakkimia.js","sourceRoot":"","sources":["../../../src/games/tebakkimia.ts"],"names":[],"mappings":";;;;;;AAAA,8CAAqB;AAIN,KAAK,UAAU,UAAU;IACtC,IAAI,CAAC,sBAAc,EAAE;QACnB,sBAAc,GAAG,MAAM,IAAA,aAAG,EACxB,oFAAoF,CACrF,CAAC,IAAI,EAAE,CAAA;KACT;IACD,OAAO,sBAAc,CACnB,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,sBAAc,CAAC,MAAM,CAAC,CACpC,CAAA;AACjB,CAAC;AATD,6BASC"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/cjs/games/tebaklirik.js b/node_modules/@bochilteam/scraper/lib/cjs/games/tebaklirik.js new file mode 100644 index 000000000..0924b84b2 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/cjs/games/tebaklirik.js @@ -0,0 +1,15 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.tebaklirikjson = void 0; +const got_1 = __importDefault(require("got")); +async function tebaklirik() { + if (!exports.tebaklirikjson) { + exports.tebaklirikjson = await (0, got_1.default)('https://raw.githubusercontent.com/BochilTeam/database/master/games/tebaklirik.json').json(); + } + return exports.tebaklirikjson[Math.floor(Math.random() * exports.tebaklirikjson.length)]; +} +exports.default = tebaklirik; +//# sourceMappingURL=tebaklirik.js.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/cjs/games/tebaklirik.js.map b/node_modules/@bochilteam/scraper/lib/cjs/games/tebaklirik.js.map new file mode 100644 index 000000000..eefaef4b6 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/cjs/games/tebaklirik.js.map @@ -0,0 +1 @@ +{"version":3,"file":"tebaklirik.js","sourceRoot":"","sources":["../../../src/games/tebaklirik.ts"],"names":[],"mappings":";;;;;;AAAA,8CAAqB;AAIN,KAAK,UAAU,UAAU;IACtC,IAAI,CAAC,sBAAc,EAAE;QACnB,sBAAc,GAAG,MAAM,IAAA,aAAG,EACxB,oFAAoF,CACrF,CAAC,IAAI,EAAE,CAAA;KACT;IACD,OAAO,sBAAc,CACnB,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,sBAAc,CAAC,MAAM,CAAC,CACpC,CAAA;AACjB,CAAC;AATD,6BASC"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/cjs/games/tebaktebakan.js b/node_modules/@bochilteam/scraper/lib/cjs/games/tebaktebakan.js new file mode 100644 index 000000000..e79ba71dc --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/cjs/games/tebaktebakan.js @@ -0,0 +1,15 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.tebaktebakanjson = void 0; +const got_1 = __importDefault(require("got")); +async function tebaktebakan() { + if (!exports.tebaktebakanjson) { + exports.tebaktebakanjson = await (0, got_1.default)('https://raw.githubusercontent.com/BochilTeam/database/master/games/tebaktebakan.json').json(); + } + return exports.tebaktebakanjson[Math.floor(Math.random() * exports.tebaktebakanjson.length)]; +} +exports.default = tebaktebakan; +//# sourceMappingURL=tebaktebakan.js.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/cjs/games/tebaktebakan.js.map b/node_modules/@bochilteam/scraper/lib/cjs/games/tebaktebakan.js.map new file mode 100644 index 000000000..1a197777a --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/cjs/games/tebaktebakan.js.map @@ -0,0 +1 @@ +{"version":3,"file":"tebaktebakan.js","sourceRoot":"","sources":["../../../src/games/tebaktebakan.ts"],"names":[],"mappings":";;;;;;AAAA,8CAAqB;AAIN,KAAK,UAAU,YAAY;IACxC,IAAI,CAAC,wBAAgB,EAAE;QACrB,wBAAgB,GAAG,MAAM,IAAA,aAAG,EAC1B,sFAAsF,CACvF,CAAC,IAAI,EAAE,CAAA;KACT;IACD,OAAO,wBAAgB,CACrB,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,wBAAgB,CAAC,MAAM,CAAC,CACpC,CAAA;AACnB,CAAC;AATD,+BASC"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/cjs/games/tekateki.js b/node_modules/@bochilteam/scraper/lib/cjs/games/tekateki.js new file mode 100644 index 000000000..de759e4d2 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/cjs/games/tekateki.js @@ -0,0 +1,15 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.tekatekijson = void 0; +const got_1 = __importDefault(require("got")); +async function tekateki() { + if (!exports.tekatekijson) { + exports.tekatekijson = await (0, got_1.default)('https://raw.githubusercontent.com/BochilTeam/database/master/games/tekateki.json').json(); + } + return exports.tekatekijson[Math.floor(Math.random() * exports.tekatekijson.length)]; +} +exports.default = tekateki; +//# sourceMappingURL=tekateki.js.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/cjs/games/tekateki.js.map b/node_modules/@bochilteam/scraper/lib/cjs/games/tekateki.js.map new file mode 100644 index 000000000..6fd2fe3c7 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/cjs/games/tekateki.js.map @@ -0,0 +1 @@ +{"version":3,"file":"tekateki.js","sourceRoot":"","sources":["../../../src/games/tekateki.ts"],"names":[],"mappings":";;;;;;AAAA,8CAAqB;AAIN,KAAK,UAAU,QAAQ;IACpC,IAAI,CAAC,oBAAY,EAAE;QACjB,oBAAY,GAAG,MAAM,IAAA,aAAG,EACtB,kFAAkF,CACnF,CAAC,IAAI,EAAE,CAAA;KACT;IACD,OAAO,oBAAY,CACjB,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,oBAAY,CAAC,MAAM,CAAC,CACpC,CAAA;AACf,CAAC;AATD,2BASC"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/cjs/games/test.js b/node_modules/@bochilteam/scraper/lib/cjs/games/test.js new file mode 100644 index 000000000..2470ddb21 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/cjs/games/test.js @@ -0,0 +1,226 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const chai_1 = require("chai"); +const index_js_1 = require("./index.js"); +describe('Games', () => { + describe('Tebakgambar', () => { + it('tebakgambar', done => { + (0, index_js_1.tebakgambar)().then(result => { + (0, chai_1.expect)(result).to.an('object'); + (0, chai_1.expect)(result.index).to.a('number'); + (0, chai_1.expect)(result.img).to.a('string'); + (0, chai_1.expect)(result.jawaban).to.a('string'); + (0, chai_1.expect)(result.deskripsi).to.a('string'); + return done(); + }).catch(done); + }); + it('tebakgambar JSON', done => { + const res = index_js_1.tebakgambarjson; + (0, chai_1.expect)(res).to.an('array'); + (0, chai_1.expect)(res).to.have.lengthOf.at.least(1000); + return done(); + }); + }); + describe('Asahotak', () => { + it('asahotak', done => { + (0, index_js_1.asahotak)().then(result => { + (0, chai_1.expect)(result).to.an('object'); + (0, chai_1.expect)(result.index).to.a('number'); + (0, chai_1.expect)(result.soal).to.a('string'); + (0, chai_1.expect)(result.jawaban).to.a('string'); + return done(); + }).catch(done); + }); + it('asahotak JSON', done => { + const res = index_js_1.asahotakjson; + (0, chai_1.expect)(res).to.an('array'); + (0, chai_1.expect)(res).to.have.lengthOf.at.least(228); + return done(); + }); + }); + describe('Caklontong', () => { + it('caklontong', done => { + (0, index_js_1.caklontong)().then(result => { + (0, chai_1.expect)(result).to.an('object'); + (0, chai_1.expect)(result.index).to.a('number'); + (0, chai_1.expect)(result.soal).to.a('string'); + (0, chai_1.expect)(result.jawaban).to.a('string'); + (0, chai_1.expect)(result.deskripsi).to.a('string'); + return done(); + }).catch(done); + }); + it('caklontong JSON', done => { + const res = index_js_1.caklontongjson; + (0, chai_1.expect)(res).to.an('array'); + (0, chai_1.expect)(res).to.have.lengthOf.at.least(414); + return done(); + }); + }); + describe('Family 100', () => { + it('family100', done => { + (0, index_js_1.family100)().then(result => { + (0, chai_1.expect)(result).to.an('object'); + (0, chai_1.expect)(result.soal).to.a('string'); + (0, chai_1.expect)(result.jawaban).to.a('array'); + return done(); + }).catch(done); + }); + it('family100 JSON', done => { + const res = index_js_1.family100json; + (0, chai_1.expect)(res).to.an('array'); + (0, chai_1.expect)(res).to.have.lengthOf.at.least(7152); + return done(); + }); + }); + describe('TebakKata', () => { + it('tebakkata', done => { + (0, index_js_1.tebakkata)().then(result => { + (0, chai_1.expect)(result).to.an('object'); + (0, chai_1.expect)(result.index).to.a('number'); + (0, chai_1.expect)(result.soal).to.a('string'); + (0, chai_1.expect)(result.jawaban).to.a('string'); + return done(); + }).catch(done); + }); + it('tebakkata JSON', done => { + const res = index_js_1.tebakkatajson; + (0, chai_1.expect)(res).to.an('array'); + (0, chai_1.expect)(res).to.have.lengthOf.at.least(302); + return done(); + }); + }); + describe('TebakKimia', () => { + it('tebakkimia', done => { + (0, index_js_1.tebakkimia)().then(result => { + (0, chai_1.expect)(result).to.an('object'); + (0, chai_1.expect)(result.unsur).to.a('string'); + (0, chai_1.expect)(result.lambang).to.a('string'); + return done(); + }).catch(done); + }); + it('tebakkimia JSON', done => { + const res = index_js_1.tebakkimiajson; + (0, chai_1.expect)(res).to.an('array'); + (0, chai_1.expect)(res).to.have.lengthOf.at.least(125); + return done(); + }); + }); + describe('Tekateki', () => { + it('tekateki', done => { + (0, index_js_1.tekateki)().then(result => { + (0, chai_1.expect)(result).to.an('object'); + (0, chai_1.expect)(result.soal).to.a('string'); + (0, chai_1.expect)(result.jawaban).to.a('string'); + return done(); + }).catch(done); + }); + it('tekateki JSON', done => { + const res = index_js_1.tekatekijson; + (0, chai_1.expect)(res).to.an('array'); + (0, chai_1.expect)(res).to.have.lengthOf.at.least(200); + return done(); + }); + }); + describe('Siapakahaku', () => { + it('siapakahaku', done => { + (0, index_js_1.siapakahaku)().then(result => { + (0, chai_1.expect)(result).to.an('object'); + (0, chai_1.expect)(result.index).to.a('number'); + (0, chai_1.expect)(result.soal).to.a('string'); + (0, chai_1.expect)(result.jawaban).to.a('string'); + return done(); + }).catch(done); + }); + it('siapakahaku JSON', done => { + const res = index_js_1.siapakahakujson; + (0, chai_1.expect)(res).to.an('array'); + (0, chai_1.expect)(res).to.have.lengthOf.at.least(268); + return done(); + }); + }); + describe('Susunkata', () => { + it('susunkata', done => { + (0, index_js_1.susunkata)().then(result => { + (0, chai_1.expect)(result).to.an('object'); + (0, chai_1.expect)(result.index).to.a('number'); + (0, chai_1.expect)(result.soal).to.a('string'); + (0, chai_1.expect)(result.tipe).to.a('string'); + (0, chai_1.expect)(result.jawaban).to.a('string'); + return done(); + }).catch(done); + }); + it('susunkata JSON', done => { + const res = index_js_1.susunkatajson; + (0, chai_1.expect)(res).to.an('array'); + (0, chai_1.expect)(res).to.have.lengthOf.at.least(353); + return done(); + }); + }); + describe('Tebakbendera', () => { + it('tebakbendera', done => { + (0, index_js_1.tebakbendera)().then(result => { + (0, chai_1.expect)(result).to.an('object'); + (0, chai_1.expect)(result.flag).to.a('string'); + (0, chai_1.expect)(result.img).to.a('string'); + (0, chai_1.expect)(result.name).to.a('string'); + return done(); + }).catch(done); + }); + it('tebakbendera JSON', done => { + const res = index_js_1.tebakbenderajson; + (0, chai_1.expect)(res).to.an('array'); + (0, chai_1.expect)(res).to.have.lengthOf.at.least(246); + return done(); + }); + }); + describe('Tebak Kabupaten', () => { + it('tebakkabupaten', done => { + (0, index_js_1.tebakkabupaten)().then(result => { + (0, chai_1.expect)(result).to.an('object'); + (0, chai_1.expect)(result.index).to.a('number'); + (0, chai_1.expect)(result.title).to.a('string'); + (0, chai_1.expect)(result.url).to.a('string'); + return done(); + }).catch(done); + }); + it('tebakkabupaten JSON', done => { + const res = index_js_1.tebakkabupatenjson; + (0, chai_1.expect)(res).to.an('array'); + (0, chai_1.expect)(res).to.have.lengthOf.at.least(514); + return done(); + }); + }); + describe('Tebak Lirik', () => { + it('tebaklirik', done => { + (0, index_js_1.tebaklirik)().then(result => { + (0, chai_1.expect)(result).to.an('object'); + (0, chai_1.expect)(result.soal).to.a('string'); + (0, chai_1.expect)(result.jawaban).to.a('string'); + return done(); + }).catch(done); + }); + it('tebaklirik JSON', done => { + const res = index_js_1.tebaklirikjson; + (0, chai_1.expect)(res).to.an('array'); + (0, chai_1.expect)(res).to.have.lengthOf.at.least(38); + return done(); + }); + }); + describe('Tebak Tebakan', () => { + it('tebaktebakan', done => { + (0, index_js_1.tebaktebakan)().then(result => { + (0, chai_1.expect)(result).to.an('object'); + (0, chai_1.expect)(result.soal).to.a('string'); + (0, chai_1.expect)(result.jawaban).to.a('string'); + return done(); + }).catch(done); + }); + it('tebaktebakan JSON', done => { + const res = index_js_1.tebaktebakanjson; + (0, chai_1.expect)(res).to.an('array'); + (0, chai_1.expect)(res).to.have.lengthOf.at.least(199); + return done(); + }); + }); +}); +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/cjs/games/test.js.map b/node_modules/@bochilteam/scraper/lib/cjs/games/test.js.map new file mode 100644 index 000000000..0b56d67f3 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/cjs/games/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["../../../src/games/test.ts"],"names":[],"mappings":";;AAAA,+BAA6B;AAC7B,yCAcmB;AACnB,QAAQ,CAAC,OAAO,EAAE,GAAG,EAAE;IACrB,QAAQ,CAAC,aAAa,EAAE,GAAG,EAAE;QAC3B,EAAE,CAAC,aAAa,EAAE,IAAI,CAAC,EAAE;YACvB,IAAA,sBAAW,GAAE,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE;gBAC1B,IAAA,aAAM,EAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAA;gBAC9B,IAAA,aAAM,EAAC,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAA;gBACnC,IAAA,aAAM,EAAC,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAA;gBACjC,IAAA,aAAM,EAAC,MAAM,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAA;gBACrC,IAAA,aAAM,EAAC,MAAM,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAA;gBAEvC,O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AE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;YAE1C,OAAO,IAAI,EAAE,CAAA;QACf,CAAC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/cjs/games/types.js b/node_modules/@bochilteam/scraper/lib/cjs/games/types.js new file mode 100644 index 000000000..11e638d1e --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/cjs/games/types.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=types.js.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/cjs/games/types.js.map b/node_modules/@bochilteam/scraper/lib/cjs/games/types.js.map new file mode 100644 index 000000000..ef17d8f82 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/cjs/games/types.js.map @@ -0,0 +1 @@ +{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/games/types.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/cjs/images/google-image.js b/node_modules/@bochilteam/scraper/lib/cjs/images/google-image.js new file mode 100644 index 000000000..30f928e94 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/cjs/images/google-image.js @@ -0,0 +1,26 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const cheerio_1 = __importDefault(require("cheerio")); +const got_1 = __importDefault(require("got")); +async function googleImage(query) { + const data = await (0, got_1.default)(`https://www.google.com/search?q=${query}&tbm=isch`, { + headers: { + accept: 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9', + 'accept-encoding': 'gzip, deflate, br', + 'accept-language': 'en-US,en;q=0.9,id;q=0.8', + 'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.93 Safari/537.36' + } + }).text(); + const $ = cheerio_1.default.load(data); + const pattern = /\[1,\[0,"(?[\d\w\-_]+)",\["https?:\/\/(?:[^"]+)",\d+,\d+\]\s?,\["(?https?:\/\/(?:[^"]+))",\d+,\d+\]/gm; + const matches = $.html().matchAll(pattern); + const decodeUrl = (url) => decodeURIComponent(JSON.parse(`"${url}"`)); + return [...matches] + .map(({ groups }) => decodeUrl(groups === null || groups === void 0 ? void 0 : groups.url)) + .filter((v) => /.*\.jpe?g|png$/gi.test(v)); +} +exports.default = googleImage; +//# sourceMappingURL=google-image.js.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/cjs/images/google-image.js.map b/node_modules/@bochilteam/scraper/lib/cjs/images/google-image.js.map new file mode 100644 index 000000000..8fcdede7a --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/cjs/images/google-image.js.map @@ -0,0 +1 @@ +{"version":3,"file":"google-image.js","sourceRoot":"","sources":["../../../src/images/google-image.ts"],"names":[],"mappings":";;;;;AAAA,sDAA6B;AAC7B,8CAAqB;AAEN,KAAK,UAAU,WAAW,CAAE,KAAa;IACtD,MAAM,IAAI,GAAG,MAAM,IAAA,aAAG,EAAC,mCAAmC,KAAK,WAAW,EAAE;QAC1E,OAAO,EAAE;YACP,MAAM,EACR,yIAAyI;YACvI,iBAAiB,EAAE,mBAAmB;YACtC,iBAAiB,EAAE,yBAAyB;YAC5C,YAAY,EACd,oHAAoH;SACnH;KACF,CAAC,CAAC,IAAI,EAAE,CAAA;IAET,MAAM,CAAC,GAAG,iBAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IAC5B,MAAM,OAAO,GACb,gHAAgH,CAAA;IAChH,MAAM,OAAO,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAA;IAC1C,MAAM,SAAS,GAAG,CAAC,GAAW,EAAE,EAAE,CAAC,kBAAkB,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,GAAG,GAAG,CAAC,CAAC,CAAA;IAC7E,OAAO,CAAC,GAAG,OAAO,CAAC;SAChB,GAAG,CAAC,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,SAAS,CAAC,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,GAAa,CAAC,CAAC;SACrD,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAA;AAC9C,CAAC;AApBD,8BAoBC"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/cjs/images/index.js b/node_modules/@bochilteam/scraper/lib/cjs/images/index.js new file mode 100644 index 000000000..da59dd962 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/cjs/images/index.js @@ -0,0 +1,27 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.googleImage = exports.pinterest = void 0; +const google_image_js_1 = __importDefault(require("./google-image.js")); +exports.googleImage = google_image_js_1.default; +const pinterest_js_1 = __importDefault(require("./pinterest.js")); +exports.pinterest = pinterest_js_1.default; +__exportStar(require("./sticker.js"), exports); +__exportStar(require("./wallpaper.js"), exports); +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/cjs/images/index.js.map b/node_modules/@bochilteam/scraper/lib/cjs/images/index.js.map new file mode 100644 index 000000000..d635ff072 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/cjs/images/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/images/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA,wEAA2C;AAIvB,sBAJb,yBAAW,CAIa;AAH/B,kEAAsC;AAG7B,oBAHF,sBAAS,CAGE;AAFlB,+CAA4B;AAC5B,iDAA8B"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/cjs/images/pinterest.js b/node_modules/@bochilteam/scraper/lib/cjs/images/pinterest.js new file mode 100644 index 000000000..8078cde3e --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/cjs/images/pinterest.js @@ -0,0 +1,24 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const cheerio_1 = __importDefault(require("cheerio")); +const got_1 = __importDefault(require("got")); +async function pinterest(query) { + const data = await (0, got_1.default)(`https://id.pinterest.com/search/pins/?autologin=true&q=${query}`, { + headers: { + 'sec-ch-ua': '"Google Chrome";v="95", "Chromium";v="95", ";Not A Brand";v="99"', + cookie: '_auth=1; _b="AVna7S1p7l1C5I9u0+nR3YzijpvXOPc6d09SyCzO+DcwpersQH36SmGiYfymBKhZcGg="; _pinterest_sess=TWc9PSZHamJOZ0JobUFiSEpSN3Z4a2NsMk9wZ3gxL1NSc2k2NkFLaUw5bVY5cXR5alZHR0gxY2h2MVZDZlNQalNpUUJFRVR5L3NlYy9JZkthekp3bHo5bXFuaFZzVHJFMnkrR3lTbm56U3YvQXBBTW96VUgzVUhuK1Z4VURGKzczUi9hNHdDeTJ5Y2pBTmxhc2owZ2hkSGlDemtUSnYvVXh5dDNkaDN3TjZCTk8ycTdHRHVsOFg2b2NQWCtpOWxqeDNjNkk3cS85MkhhSklSb0hwTnZvZVFyZmJEUllwbG9UVnpCYVNTRzZxOXNJcmduOVc4aURtM3NtRFo3STlmWjJvSjlWTU5ITzg0VUg1NGhOTEZzME9SNFNhVWJRWjRJK3pGMFA4Q3UvcHBnWHdaYXZpa2FUNkx6Z3RNQjEzTFJEOHZoaHRvazc1c1UrYlRuUmdKcDg3ZEY4cjNtZlBLRTRBZjNYK0lPTXZJTzQ5dU8ybDdVS015bWJKT0tjTWYyRlBzclpiamdsNmtpeUZnRjlwVGJXUmdOMXdTUkFHRWloVjBMR0JlTE5YcmhxVHdoNzFHbDZ0YmFHZ1VLQXU1QnpkM1FqUTNMTnhYb3VKeDVGbnhNSkdkNXFSMXQybjRGL3pyZXRLR0ZTc0xHZ0JvbTJCNnAzQzE0cW1WTndIK0trY05HV1gxS09NRktadnFCSDR2YzBoWmRiUGZiWXFQNjcwWmZhaDZQRm1UbzNxc21pV1p5WDlabm1UWGQzanc1SGlrZXB1bDVDWXQvUis3elN2SVFDbm1DSVE5Z0d4YW1sa2hsSkZJb1h0MTFpck5BdDR0d0lZOW1Pa2RDVzNySWpXWmUwOUFhQmFSVUpaOFQ3WlhOQldNMkExeDIvMjZHeXdnNjdMYWdiQUhUSEFBUlhUVTdBMThRRmh1ekJMYWZ2YTJkNlg0cmFCdnU2WEpwcXlPOVZYcGNhNkZDd051S3lGZmo0eHV0ZE42NW8xRm5aRWpoQnNKNnNlSGFad1MzOHNkdWtER0xQTFN5Z3lmRERsZnZWWE5CZEJneVRlMDd2VmNPMjloK0g5eCswZUVJTS9CRkFweHc5RUh6K1JocGN6clc1JmZtL3JhRE1sc0NMTFlpMVErRGtPcllvTGdldz0=; _ir=0', + 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' + } + }).text(); + const results = []; + const $ = cheerio_1.default.load(data); + $('img').each(function () { + results.push($(this).attr('src')); + }); + return results; +} +exports.default = pinterest; +//# sourceMappingURL=pinterest.js.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/cjs/images/pinterest.js.map b/node_modules/@bochilteam/scraper/lib/cjs/images/pinterest.js.map new file mode 100644 index 000000000..91a4352b4 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/cjs/images/pinterest.js.map @@ -0,0 +1 @@ +{"version":3,"file":"pinterest.js","sourceRoot":"","sources":["../../../src/images/pinterest.ts"],"names":[],"mappings":";;;;;AAAA,sDAA6B;AAC7B,8CAAqB;AAEN,KAAK,UAAU,SAAS,CAAE,KAAa;IACpD,MAAM,IAAI,GAAG,MAAM,IAAA,aAAG,EACtB,0DAA0D,KAAK,EAAE,EACjE;QACE,OAAO,EAAE;YACP,WAAW,EACZ,kEAAkE;YACjE,MAAM,EACP,ivCAAivC;YAChvC,YAAY,EACb,oHAAoH;SACpH;KACF,CACA,CAAC,IAAI,EAAE,CAAA;IACR,MAAM,OAAO,GAAa,EAAE,CAAA;IAC5B,MAAM,CAAC,GAAG,iBAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IAC5B,CAAC,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC;QACZ,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,KAAK,CAAW,CAAC,CAAA;IAC7C,CAAC,CAAC,CAAA;IACF,OAAO,OAAO,CAAA;AAChB,CAAC;AApBD,4BAoBC"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/cjs/images/sticker.js b/node_modules/@bochilteam/scraper/lib/cjs/images/sticker.js new file mode 100644 index 000000000..dcbb1ae89 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/cjs/images/sticker.js @@ -0,0 +1,59 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.stickerLine = exports.stickerTelegram = void 0; +const cheerio_1 = __importDefault(require("cheerio")); +const got_1 = __importDefault(require("got")); +async function stickerTelegram(query, page) { + const data = await (0, got_1.default)(`https://combot.org/telegram/stickers?q=${encodeURI(query)}&page=${page || 1}`).text(); + const $ = cheerio_1.default.load(data); + const results = []; + $('body > div > main > div.page > div > div.stickers-catalogue > div.tab-content > div > div').each(function () { + var _a; + const title = (_a = $(this).find('.sticker-pack__title').text()) === null || _a === void 0 ? void 0 : _a.trim(); + const icon = $(this) + .find('.sticker-pack__sticker > div.sticker-pack__sticker-inner > div.sticker-pack__sticker-img') + .attr('data-src'); + const link = $(this) + .find('.sticker-pack__header > a.sticker-pack__btn') + .attr('href'); + const stickers = []; + $(this) + .find('.sticker-pack__list > div.sticker-pack__sticker') + .each(function () { + const sticker = $(this) + .find('.sticker-pack__sticker-inner > div.sticker-pack__sticker-img') + .attr('data-src'); + if (sticker) + stickers.push(sticker); + }); + results.push({ + title, + icon, + link, + stickers + }); + }); + return results; +} +exports.stickerTelegram = stickerTelegram; +async function stickerLine(query) { + const data = await (0, got_1.default)(`https://store.line.me/api/search/sticker?query=${query}&offset=0&limit=36&type=ALL&includeFacets=true`).json(); + return data.items.map(({ title, productUrl, id, description, payloadForProduct: { staticUrl, animationUrl, soundUrl }, authorId, authorName }) => { + return { + id, + title, + description, + url: encodeURI('https://store.line.me' + productUrl), + sticker: staticUrl, + stickerAnimated: animationUrl, + stickerSound: soundUrl, + authorId, + authorName + }; + }); +} +exports.stickerLine = stickerLine; +//# sourceMappingURL=sticker.js.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/cjs/images/sticker.js.map b/node_modules/@bochilteam/scraper/lib/cjs/images/sticker.js.map new file mode 100644 index 000000000..c63ee607f --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/cjs/images/sticker.js.map @@ -0,0 +1 @@ +{"version":3,"file":"sticker.js","sourceRoot":"","sources":["../../../src/images/sticker.ts"],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,CAAC;AAvCD,0CAuCC;AAEM,KAAK,UAAU,WAAW,CAAE,KAAa;IAC9C,MAAM,IAAI,GAAqC,MAAM,IAAA,aAAG,EACtD,kDAAkD,KAAK,gDAAgD,CACxG,CAAC,IAAI,EAAE,CAAA;IACR,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CACnB,CAAC,EACC,KAAK,EACL,UAAU,EACV,EAAE,EACF,WAAW,EACX,iBAAiB,EAAE,EAAE,SAAS,EAAE,YAAY,EAAE,QAAQ,EAAE,EACxD,QAAQ,EACR,UAAU,EACU,EAAE,EAAE;QACxB,OAAO;YACL,EAAE;YACF,KAAK;YACL,WAAW;YACX,GAAG,EAAE,SAAS,CAAC,uBAAuB,GAAG,UAAU,CAAC;YACpD,OAAO,EAAE,SAAS;YAClB,eAAe,EAAE,YAAY;YAC7B,YAAY,EAAE,QAAQ;YACtB,QAAQ;YACR,UAAU;SACX,CAAA;IACH,CAAC,CACF,CAAA;AACH,CAAC;AA3BD,kCA2BC"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/cjs/images/test.js b/node_modules/@bochilteam/scraper/lib/cjs/images/test.js new file mode 100644 index 000000000..001a07b49 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/cjs/images/test.js @@ -0,0 +1,58 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const chai_1 = require("chai"); +const index_js_1 = require("./index.js"); +describe('Images', () => { + it('google-image', done => { + (0, index_js_1.googleImage)('Minecraft').then(res => { + (0, chai_1.expect)(res).to.be.an('array'); + res.forEach(v => (0, chai_1.expect)(v).to.be.a('string')); + return done(); + }).catch(done); + }); + it('pinterest', done => { + (0, index_js_1.pinterest)('Minecraft').then(res => { + (0, chai_1.expect)(res).to.be.an('array'); + res.forEach(v => (0, chai_1.expect)(v).to.be.a('string')); + return done(); + }).catch(done); + }); + describe('Wallpaper', () => { + it('wallpaper', done => { + (0, index_js_1.wallpaper)('Minecraft').then(res => { + (0, chai_1.expect)(res).to.be.an('array'); + res.forEach(v => (0, chai_1.expect)(v).to.be.a('string')); + return done(); + }).catch(done); + }); + it('wallpaper V2', done => { + (0, index_js_1.wallpaperv2)('Wallpaper Anime').then(res => { + (0, chai_1.expect)(res).to.be.an('array'); + res.forEach(v => (0, chai_1.expect)(v).to.be.a('string')); + return done(); + }).catch(done); + }); + // it ('Wallpaper V3', done => { + // wallpaperv3('Wallpaper HD').then(res => { + // expect(res).to.be.an('array') + // res.forEach(v => expect(v).to.be.a('string')) + // return done() + // }).catch(done) + // }) + }); + it('Sticker Telegram', done => { + (0, index_js_1.stickerTelegram)('Minecraft').then(res => { + (0, chai_1.expect)(res).to.be.an('array'); + res.forEach(v => (0, chai_1.expect)(v).to.be.an('object')); + return done(); + }).catch(done); + }); + it('Sticker Line', done => { + (0, index_js_1.stickerLine)('Anime').then(res => { + (0, chai_1.expect)(res).to.be.an('array'); + res.forEach(v => (0, chai_1.expect)(v).to.be.an('object')); + return done(); + }).catch(done); + }); +}); +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/cjs/images/test.js.map b/node_modules/@bochilteam/scraper/lib/cjs/images/test.js.map new file mode 100644 index 000000000..98746adf1 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/cjs/images/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["../../../src/images/test.ts"],"names":[],"mappings":";;AAAA,+BAA6B;AAC7B,yCAQmB;AAEnB,QAAQ,CAAC,QAAQ,EAAE,GAAG,EAAE;IACtB,EAAE,CAAC,cAAc,EAAE,IAAI,CAAC,EAAE;QACxB,IAAA,sBAAW,EAAC,WAAW,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE;YAClC,IAAA,aAAM,EAAC,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,OAAO,CAAC,CAAA;YAC7B,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,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EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,OAAO,CAAC,CAAA;YAC7B,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,IAAA,aAAM,EAAC,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAA;YAC9C,OAAO,IAAI,EAAE,CAAA;QACf,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;IAChB,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/cjs/images/types.js b/node_modules/@bochilteam/scraper/lib/cjs/images/types.js new file mode 100644 index 000000000..11e638d1e --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/cjs/images/types.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=types.js.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/cjs/images/types.js.map b/node_modules/@bochilteam/scraper/lib/cjs/images/types.js.map new file mode 100644 index 000000000..8e58f11a1 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/cjs/images/types.js.map @@ -0,0 +1 @@ +{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/images/types.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/cjs/images/wallpaper.js b/node_modules/@bochilteam/scraper/lib/cjs/images/wallpaper.js new file mode 100644 index 000000000..1cda8a555 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/cjs/images/wallpaper.js @@ -0,0 +1,55 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.wallpaperv3 = exports.wallpaperv2 = exports.wallpaper = void 0; +const cheerio_1 = __importDefault(require("cheerio")); +const got_1 = __importDefault(require("got")); +async function wallpaper(query) { + const data = await (0, got_1.default)(`https://www.shutterstock.com/search/${query}`, { + headers: { + accept: 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9', + 'accept-encoding': 'gzip, deflate, br', + 'accept-language': 'en-US,en;q=0.9,id;q=0.8', + // cookie: '_csrf=DLixL776iH1Yv7Ck9wHekk24; _ga=GA1.2.1481444664.1639216586; _gid=GA1.2.348540858.1639216586; _gat=1; _hjFirstSeen=1; _hjSession_2571802=eyJpZCI6ImVkZDUzMWJhLWNjYTgtNDgyMy1hZmUyLWVjNmFhNWMxZjg3ZCIsImNyZWF0ZWQiOjE2MzkyMTY1ODY0Nzl9; _hjAbsoluteSessionInProgress=0; _hjSessionUser_2571802=eyJpZCI6IjIxZGNhYTc5LWRlMTgtNWE5Ni05ZWE2LTdkYjg4NGZhNjIxMSIsImNyZWF0ZWQiOjE2MzkyMTY1ODYyNDMsImV4aXN0aW5nIjp0cnVlfQ==', + 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' + } + }).text(); + const $ = cheerio_1.default.load(data); + const results = [ + ...new Set([ + ...$.html().matchAll(/https?:\/\/(image|www)\.shutterstock\.com\/([^"]+)/gim) + ] + .map((v) => v[0]) + .filter((v) => /.*\.jpe?g|png$/gi.test(v))) + ]; + return results; +} +exports.wallpaper = wallpaper; +async function wallpaperv2(query, { page, is4K } = { page: 1 }) { + page = page < 2 ? 2 : page; + const data = await (0, got_1.default)(`https://wall.alphacoders.com/by_category.php?id=3&name=${encodeURIComponent(query).replace(/%20/g, '+')}&quickload=50&page=${page}${is4K ? '&filter=4K+Ultra+HD' : ''}`).text(); + const $ = cheerio_1.default.load(data); + const results = []; + $('div.thumb-container-big').each(function () { + const img = $(this).find('picture > img').attr('src'); + if (img) + results.push(img); + }); + return results; +} +exports.wallpaperv2 = wallpaperv2; +async function wallpaperv3(query, page = 1) { + const html = await (0, got_1.default)(`https://www.hdwallpapers.in/search/page/${page}?q=${encodeURIComponent(query)}`).text(); + const results = []; + const $ = cheerio_1.default.load(html); + $('#content > div.page-content.wallpaper > ul > li.wall').each(function () { + const img = $(this).find('a > img[src]').attr('src'); + if (img) + results.push('https://www.hdwallpapers.in' + img); + }); + return results; +} +exports.wallpaperv3 = wallpaperv3; +//# sourceMappingURL=wallpaper.js.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/cjs/images/wallpaper.js.map b/node_modules/@bochilteam/scraper/lib/cjs/images/wallpaper.js.map new file mode 100644 index 000000000..294cce0b0 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/cjs/images/wallpaper.js.map @@ -0,0 +1 @@ +{"version":3,"file":"wallpaper.js","sourceRoot":"","sources":["../../../src/images/wallpaper.ts"],"names":[],"mappings":";;;;;;AAAA,sDAA6B;AAC7B,8CAAqB;AAEd,KAAK,UAAU,SAAS,CAAE,KAAa;IAC5C,MAAM,IAAI,GAAG,MAAM,IAAA,aAAG,EAAC,uCAAuC,KAAK,EAAE,EAAE;QACrE,OAAO,EAAE;YACP,MAAM,EACR,yIAAyI;YACvI,iBAAiB,EAAE,mBAAmB;YACtC,iBAAiB,EAAE,yBAAyB;YAC5C,oaAAoa;YACpa,YAAY,EACd,oHAAoH;SACnH;KACF,CAAC,CAAC,IAAI,EAAE,CAAA;IACT,MAAM,CAAC,GAAG,iBAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IAC5B,MAAM,OAAO,GAAa;QACxB,GAAG,IAAI,GAAG,CACR;YACE,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,QAAQ,CAClB,uDAAuD,CACxD;SACF;aACE,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;aAChB,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAC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AC,sDAAsD,CAAC,CAAC,IAAI,CAAC;QAC7D,MAAM,GAAG,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;QACpD,IAAI,GAAG;YAAE,OAAO,CAAC,IAAI,CAAC,6BAA6B,GAAG,GAAG,CAAC,CAAA;IAC5D,CAAC,CAAC,CAAA;IACF,OAAO,OAAO,CAAA;AAChB,CAAC;AATD,kCASC"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/cjs/index.js b/node_modules/@bochilteam/scraper/lib/cjs/index.js new file mode 100644 index 000000000..94c187e28 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/cjs/index.js @@ -0,0 +1,26 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +__exportStar(require("./images/index.js"), exports); +__exportStar(require("./social-media/index.js"), exports); +__exportStar(require("./games/index.js"), exports); +__exportStar(require("./primbons/index.js"), exports); +__exportStar(require("./texts/index.js"), exports); +__exportStar(require("./others/index.js"), exports); +__exportStar(require("./encryptions/index.js"), exports); +__exportStar(require("./religions/index.js"), exports); +__exportStar(require("./news/index.js"), exports); +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/cjs/index.js.map b/node_modules/@bochilteam/scraper/lib/cjs/index.js.map new file mode 100644 index 000000000..705e13c35 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/cjs/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,oDAAiC;AACjC,0DAAuC;AACvC,mDAAgC;AAChC,sDAAmC;AACnC,mDAAgC;AAChC,oDAAiC;AACjC,yDAAsC;AACtC,uDAAoC;AACpC,kDAA+B"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/cjs/news/antaranews.js b/node_modules/@bochilteam/scraper/lib/cjs/news/antaranews.js new file mode 100644 index 000000000..ad6b950fe --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/cjs/news/antaranews.js @@ -0,0 +1,36 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const got_1 = __importDefault(require("got")); +const cheerio_1 = __importDefault(require("cheerio")); +async function antaranews() { + const html = await (0, got_1.default)('https://www.antaranews.com/').text(); + const $ = cheerio_1.default.load(html); + const results = []; + $('div.terkini > article.simple-post').each((_, el) => { + const $el = $(el); + const title = $el.find('.latest-news > a').text(); + const link = $el.find('.latest-news > a').attr('href'); + const $image = $el.find('picture'); + const image = $image.find('img').attr('src') || + $image.find('img').attr('data-src') || + $image.find('source').attr('srcset') || + $image.find('source').attr('data-srcset'); + const label = $el.find('.simple-share').text(); + const date = $el.find('.simple-share > span').text(); + if (title && image) { + results.push({ + title, + link, + image, + label: label.replace(date, '').replace('/', '').trim(), + date: date.trim() + }); + } + }); + return results; +} +exports.default = antaranews; +//# sourceMappingURL=antaranews.js.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/cjs/news/antaranews.js.map b/node_modules/@bochilteam/scraper/lib/cjs/news/antaranews.js.map new file mode 100644 index 000000000..95872ad17 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/cjs/news/antaranews.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AAI,KAAK,IAAI,KAAK,EAAE;YAClB,OAAO,CAAC,IAAI,CAAC;gBACX,KAAK;gBACL,IAAI;gBACJ,KAAK;gBACL,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE;gBACtD,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE;aAClB,CAAC,CAAA;SACH;IACH,CAAC,CAAC,CAAA;IACF,OAAO,OAAO,CAAA;AAChB,CAAC;AA1BD,6BA0BC"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/cjs/news/cnbcindonesia.js b/node_modules/@bochilteam/scraper/lib/cjs/news/cnbcindonesia.js new file mode 100644 index 000000000..6ca73abfe --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/cjs/news/cnbcindonesia.js @@ -0,0 +1,34 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const got_1 = __importDefault(require("got")); +const cheerio_1 = __importDefault(require("cheerio")); +async function cnbindonesia() { + const html = await (0, got_1.default)('https://www.cnbcindonesia.com/news').text(); + const $ = cheerio_1.default.load(html); + const results = []; + $('body > div.container > div > ul.list > li').each((_, el) => { + const $el = $(el); + const title = $el.find('.box_text > h2').text(); + const subtitle = $el.find('.box_text > .subjudul').text() || undefined; + const link = $el.find('a').attr('href'); + const image = $el.find('span > img').attr('src'); + const label = $el.find('.date > .label').text(); + const date = $el.find('.date').text().replace(label, '').replace('-', '').trim(); + if (title && link) { + results.push({ + title, + subtitle, + link, + image, + label, + date + }); + } + }); + return results; +} +exports.default = cnbindonesia; +//# sourceMappingURL=cnbcindonesia.js.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/cjs/news/cnbcindonesia.js.map b/node_modules/@bochilteam/scraper/lib/cjs/news/cnbcindonesia.js.map new file mode 100644 index 000000000..128ce4297 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/cjs/news/cnbcindonesia.js.map @@ -0,0 +1 @@ +{"version":3,"file":"cnbcindonesia.js","sourceRoot":"","sources":["../../../src/news/cnbcindonesia.ts"],"names":[],"mappings":";;;;;AAAA,8CAAqB;AACrB,sDAA6B;AAGd,KAAK,UAAU,YAAY;IACxC,MAAM,IAAI,GAAG,MAAM,IAAA,aAAG,EAAC,oCAAoC,CAAC,CAAC,IAAI,EAAE,CAAA;IACnE,MAAM,CAAC,GAAG,iBAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IAC5B,MAAM,OAAO,GAAoB,EAAE,CAAA;IACnC,CAAC,CAAC,2CAA2C,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE;QAC5D,MAAM,GAAG,GAAG,CAAC,CAAC,EAAE,CAAC,CAAA;QACjB,MAAM,KAAK,GAAG,GAAG,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC,IAAI,EAAE,CAAA;QAC/C,MAAM,QAAQ,GAAG,GAAG,CAAC,IAAI,CAAC,uBAAuB,CAAC,CAAC,IAAI,EAAE,IAAI,SAAS,CAAA;QACtE,MAAM,IAAI,GAAG,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;QACvC,MAAM,KAAK,GAAG,GAAG,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,IAAI,CAAC,KAAK,CAAW,CAAA;QAC1D,MAAM,KAAK,GAAG,GAAG,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC,IAAI,EAAE,CAAA;QAC/C,MAAM,IAAI,GAAG,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,CAAA;QAChF,IAAI,KAAK,IAAI,IAAI,EAAE;YACjB,OAAO,CAAC,IAAI,CAAC;gBACX,KAAK;gBACL,QAAQ;gBACR,IAAI;gBACJ,KAAK;gBACL,KAAK;gBACL,IAAI;aACL,CAAC,CAAA;SACH;IACH,CAAC,CAAC,CAAA;IACF,OAAO,OAAO,CAAA;AAChB,CAAC;AAxBD,+BAwBC"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/cjs/news/index.js b/node_modules/@bochilteam/scraper/lib/cjs/news/index.js new file mode 100644 index 000000000..33e76f225 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/cjs/news/index.js @@ -0,0 +1,19 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.merdeka = exports.liputan6 = exports.suaracom = exports.kompas = exports.antaranews = exports.cnbindonesia = void 0; +const cnbcindonesia_js_1 = __importDefault(require("./cnbcindonesia.js")); +exports.cnbindonesia = cnbcindonesia_js_1.default; +const antaranews_js_1 = __importDefault(require("./antaranews.js")); +exports.antaranews = antaranews_js_1.default; +const kompas_js_1 = __importDefault(require("./kompas.js")); +exports.kompas = kompas_js_1.default; +const suaracom_js_1 = __importDefault(require("./suaracom.js")); +exports.suaracom = suaracom_js_1.default; +const liputan6_js_1 = __importDefault(require("./liputan6.js")); +exports.liputan6 = liputan6_js_1.default; +const merdeka_js_1 = __importDefault(require("./merdeka.js")); +exports.merdeka = merdeka_js_1.default; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/cjs/news/index.js.map b/node_modules/@bochilteam/scraper/lib/cjs/news/index.js.map new file mode 100644 index 000000000..7551bbc40 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/cjs/news/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/news/index.ts"],"names":[],"mappings":";;;;;;AAAA,0EAA6C;AAQ3C,uBARK,0BAAY,CAQL;AAPd,oEAAwC;AAQtC,qBARK,uBAAU,CAQL;AAPZ,4DAAgC;AAQ9B,iBARK,mBAAM,CAQL;AAPR,gEAAoC;AAQlC,mBARK,qBAAQ,CAQL;AAPV,gEAAoC;AAQlC,mBARK,qBAAQ,CAQL;AAPV,8DAAkC;AAQhC,kBARK,oBAAO,CAQL"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/cjs/news/kompas.js b/node_modules/@bochilteam/scraper/lib/cjs/news/kompas.js new file mode 100644 index 000000000..ad209778d --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/cjs/news/kompas.js @@ -0,0 +1,35 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const got_1 = __importDefault(require("got")); +const cheerio_1 = __importDefault(require("cheerio")); +async function kompas() { + const html = await (0, got_1.default)('https://www.kompas.com/').text(); + const $ = cheerio_1.default.load(html); + const result = []; + $('div.latest.ga--latest').each((_, el) => { + $(el).find('div.article__list').each((_, el) => { + const $el = $(el); + const title = $el.find('h3 > a.article__link').text(); + const link = $el.find('h3 > a.article__link').attr('href'); + const $image = $el.find('.article__asset > a > img'); + const image = ($image.attr('src') || $image.attr('data-src')); + const label = $el.find('.article__list__info > .article__subtitle').text(); + const date = $el.find('.article__list__info > .article__date').text(); + if (title && link) { + result.push({ + title, + link, + image, + label, + date + }); + } + }); + }); + return result; +} +exports.default = kompas; +//# sourceMappingURL=kompas.js.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/cjs/news/kompas.js.map b/node_modules/@bochilteam/scraper/lib/cjs/news/kompas.js.map new file mode 100644 index 000000000..b0f36aff0 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/cjs/news/kompas.js.map @@ -0,0 +1 @@ +{"version":3,"file":"kompas.js","sourceRoot":"","sources":["../../../src/news/kompas.ts"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AC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;IACF,OAAO,MAAM,CAAA;AACf,CAAC;AAzBD,yBAyBC"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/cjs/news/liputan6.js b/node_modules/@bochilteam/scraper/lib/cjs/news/liputan6.js new file mode 100644 index 000000000..26b7ea79e --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/cjs/news/liputan6.js @@ -0,0 +1,38 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const got_1 = __importDefault(require("got")); +const cheerio_1 = __importDefault(require("cheerio")); +async function liputan6() { + const html = await (0, got_1.default)('https://www.liputan6.com/').text(); + const $ = cheerio_1.default.load(html); + const results = []; + $('div.articles > div.articles--iridescent-list').each((i, el) => { + $(el).find('article.articles--iridescent-list--item').each((i, el) => { + const $el = $(el); + const title = $el.find('span.articles--iridescent-list--text-item__title-link-text').text(); + const link = $el.find('a.ui--a[data-template-var="url"]').attr('href'); + const description = $el.find('div.articles--iridescent-list--text-item__summary').text(); + const $image = $el.find('picture.articles--iridescent-list--text-item__figure-image > img'); + const image = ($image.attr('src') || $image.attr('data-src') || $image.attr('data-high-dpi')); + const label = $el.find('a.articles--iridescent-list--text-item__category').text(); + const $date = $el.find('time.articles--iridescent-list--text-item__time'); + const date = $date.attr('datetime') || $date.attr('title') || $date.text(); + if (title && link) { + results.push({ + title, + link, + image, + description, + label, + date + }); + } + }); + }); + return results; +} +exports.default = liputan6; +//# sourceMappingURL=liputan6.js.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/cjs/news/liputan6.js.map b/node_modules/@bochilteam/scraper/lib/cjs/news/liputan6.js.map new file mode 100644 index 000000000..c72d6d074 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/cjs/news/liputan6.js.map @@ -0,0 +1 @@ +{"version":3,"file":"liputan6.js","sourceRoot":"","s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KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,KAAK,CAAC,IAAI,EAAE,CAAA;YAC1E,IAAI,KAAK,IAAI,IAAI,EAAE;gBACjB,OAAO,CAAC,IAAI,CAAC;oBACX,KAAK;oBACL,IAAI;oBACJ,KAAK;oBACL,WAAW;oBACX,KAAK;oBACL,IAAI;iBACL,CAAC,CAAA;aACH;QACH,CAAC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;IACF,OAAO,OAAO,CAAA;AAChB,CAAC;AA5BD,2BA4BC"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/cjs/news/merdeka.js b/node_modules/@bochilteam/scraper/lib/cjs/news/merdeka.js new file mode 100644 index 000000000..e6c21d9ac --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/cjs/news/merdeka.js @@ -0,0 +1,32 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const got_1 = __importDefault(require("got")); +const cheerio_1 = __importDefault(require("cheerio")); +async function merdeka() { + const html = await (0, got_1.default)('https://www.merdeka.com/berita-hari-ini/').text(); + const $ = cheerio_1.default.load(html); + const results = []; + $('div.main_photo_center > div.mdk-tag-contg').each((_, el) => { + const $el = $(el); + const title = $el.find('div.mdk-tag-contln-l > a[title]').attr('title'); + const link = $el.find('div.mdk-tag-contln-l > a[title]').attr('href'); + const image = $el.find('div.mdk-tag-contln-l > a[title] > img').attr('src'); + const label = $el.find('div.mdk-tag-contln-date > span').text(); + const date = $el.find('div.mdk-tag-contln-date').text(); + if (title) { + results.push({ + title, + link: 'https://www.merdeka.com' + link, + image, + label, + date: date.replace(label, '').replace('Sekitar', '').trim() + }); + } + }); + return results; +} +exports.default = merdeka; +//# sourceMappingURL=merdeka.js.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/cjs/news/merdeka.js.map b/node_modules/@bochilteam/scraper/lib/cjs/news/merdeka.js.map new file mode 100644 index 000000000..0ea843ee0 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/cjs/news/merdeka.js.map @@ -0,0 +1 @@ +{"version":3,"file":"merdeka.js","sourceRoot":"","sources":["../../../src/news/merdeka.ts"],"names":[],"mappings":";;;;;AAAA,8CAAqB;AACrB,sDAA6B;AAGd,KAAK,UAAU,OAAO;IACnC,MAAM,IAAI,GAAG,MAAM,IAAA,aAAG,EAAC,0CAA0C,CAAC,CAAC,IAAI,EAAE,CAAA;IACzE,MAAM,CAAC,GAAG,iBAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IAC5B,MAAM,OAAO,GAAc,EAAE,CAAA;IAC7B,CAAC,CAAC,2CAA2C,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE;QAC5D,MAAM,GAAG,GAAG,CAAC,CAAC,EAAE,CAAC,CAAA;QACjB,MAAM,KAAK,GAAG,GAAG,CAAC,IAAI,CAAC,iCAAiC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;QACvE,MAAM,IAAI,GAAG,GAAG,CAAC,IAAI,CAAC,iCAAiC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;QACrE,MAAM,KAAK,GAAG,GAAG,CAAC,IAAI,CAAC,uCAAuC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAW,CAAA;QACrF,MAAM,KAAK,GAAG,GAAG,CAAC,IAAI,CAAC,gCAAgC,CAAC,CAAC,IAAI,EAAE,CAAA;QAC/D,MAAM,IAAI,GAAG,GAAG,CAAC,IAAI,CAAC,yBAAyB,CAAC,CAAC,IAAI,EAAE,CAAA;QACvD,IAAI,KAAK,EAAE;YACT,OAAO,CAAC,IAAI,CAAC;gBACX,KAAK;gBACL,IAAI,EAAE,yBAAyB,GAAG,IAAI;gBACtC,KAAK;gBACL,KAAK;gBACL,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE;aAC5D,CAAC,CAAA;SACH;IACH,CAAC,CAAC,CAAA;IACF,OAAO,OAAO,CAAA;AAChB,CAAC;AAtBD,0BAsBC"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/cjs/news/suaracom.js b/node_modules/@bochilteam/scraper/lib/cjs/news/suaracom.js new file mode 100644 index 000000000..7d8776ba2 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/cjs/news/suaracom.js @@ -0,0 +1,32 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const got_1 = __importDefault(require("got")); +const cheerio_1 = __importDefault(require("cheerio")); +async function suaracom() { + const html = await (0, got_1.default)('https://www.suara.com/news').text(); + const $ = cheerio_1.default.load(html); + const results = []; + $('div.widget-content > ul.list-unstyled > li.item-outer').each((_, el) => { + const $el = $(el); + const title = $el.find('h4.post-title > a.ellipsis2').text(); + const link = $el.find('h4.post-title > a.ellipsis2').attr('href'); + const description = $el.find('div.item-content > p.ellipsis2').text(); + const image = $el.find('div.post-thumb > a > img').attr('src'); + const date = $el.find('.suara-date-box > span').map((i, el) => $(el).text()).get().join(' '); + if (title && link) { + results.push({ + title, + link, + image, + description, + date + }); + } + }); + return results; +} +exports.default = suaracom; +//# sourceMappingURL=suaracom.js.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/cjs/news/suaracom.js.map b/node_modules/@bochilteam/scraper/lib/cjs/news/suaracom.js.map new file mode 100644 index 000000000..462d564dd --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/cjs/news/suaracom.js.map @@ -0,0 +1 @@ +{"version":3,"file":"suaracom.js","sourceRoot":"","sources":["../../../src/news/suaracom.ts"],"names":[],"mappings":";;;;;AAAA,8CA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/scraper/lib/cjs/news/test.js b/node_modules/@bochilteam/scraper/lib/cjs/news/test.js new file mode 100644 index 000000000..57a769307 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/cjs/news/test.js @@ -0,0 +1,88 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const chai_1 = require("chai"); +const index_js_1 = require("./index.js"); +describe('News', () => { + it('CNB indonesia', (done) => { + (0, index_js_1.cnbindonesia)().then(data => { + (0, chai_1.expect)(data).to.be.an('array'); + (0, chai_1.expect)(data).to.have.length.at.least(1); + data.forEach(({ title, link, image, label, date }) => { + (0, chai_1.expect)(title).to.be.a('string'); + (0, chai_1.expect)(link).to.be.a('string'); + (0, chai_1.expect)(image).to.be.a('string'); + (0, chai_1.expect)(label).to.be.a('string'); + (0, chai_1.expect)(date).to.be.a('string'); + }); + return done(); + }).catch(done); + }); + it('antaranews', (done) => { + (0, index_js_1.antaranews)().then(data => { + (0, chai_1.expect)(data).to.be.an('array'); + (0, chai_1.expect)(data).to.have.length.at.least(1); + data.forEach(({ title, link, image, label, date }) => { + (0, chai_1.expect)(title).to.be.a('string'); + (0, chai_1.expect)(link).to.be.a('string'); + (0, chai_1.expect)(image).to.be.a('string'); + (0, chai_1.expect)(label).to.be.a('string'); + (0, chai_1.expect)(date).to.be.a('string'); + }); + return done(); + }).catch(done); + }); + it('kompas', (done) => { + (0, index_js_1.kompas)().then(data => { + (0, chai_1.expect)(data).to.be.an('array'); + data.forEach(({ title, link, image, label, date }) => { + (0, chai_1.expect)(title).to.be.a('string'); + (0, chai_1.expect)(link).to.be.a('string'); + (0, chai_1.expect)(image).to.be.a('string'); + (0, chai_1.expect)(label).to.be.a('string'); + (0, chai_1.expect)(date).to.be.a('string'); + }); + return done(); + }).catch(done); + }); + it('Suara.com', (done) => { + (0, index_js_1.suaracom)().then(data => { + (0, chai_1.expect)(data).to.be.an('array'); + data.forEach(({ title, link, image, description, date }) => { + (0, chai_1.expect)(title).to.be.a('string'); + (0, chai_1.expect)(link).to.be.a('string'); + (0, chai_1.expect)(image).to.be.a('string'); + (0, chai_1.expect)(description).to.be.a('string'); + (0, chai_1.expect)(date).to.be.a('string'); + }); + return done(); + }).catch(done); + }); + it('Liputan6', (done) => { + (0, index_js_1.liputan6)().then(data => { + (0, chai_1.expect)(data).to.be.an('array'); + data.forEach(({ title, link, image, description, label, date }) => { + (0, chai_1.expect)(title).to.be.a('string'); + (0, chai_1.expect)(link).to.be.a('string'); + (0, chai_1.expect)(image).to.be.a('string'); + (0, chai_1.expect)(description).to.be.a('string'); + (0, chai_1.expect)(label).to.be.a('string'); + (0, chai_1.expect)(date).to.be.a('string'); + }); + return done(); + }).catch(done); + }); + it('Merdeka', (done) => { + (0, index_js_1.merdeka)().then(data => { + (0, chai_1.expect)(data).to.be.an('array'); + data.forEach(({ title, link, image, label, date }) => { + (0, chai_1.expect)(title).to.be.a('string'); + (0, chai_1.expect)(link).to.be.a('string'); + (0, chai_1.expect)(image).to.be.a('string'); + (0, chai_1.expect)(label).to.be.a('string'); + (0, chai_1.expect)(date).to.be.a('string'); + }); + return done(); + }).catch(done); + }); +}); +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/cjs/news/test.js.map b/node_modules/@bochilteam/scraper/lib/cjs/news/test.js.map new file mode 100644 index 000000000..a87d3674c --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/cjs/news/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["../../../src/news/test.ts"],"names":[],"mappings":";;AAAA,+BAA6B;AAC7B,yCAOmB;AAEnB,QAAQ,CAAC,MAAM,EAAE,GAAG,EAAE;IACpB,EAAE,CAAC,eAAe,EAAE,CAAC,IAAI,EAAE,EAAE;QAC3B,IAAA,uBAAY,GAAE,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;YACzB,IAAA,aAAM,EAAC,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,OAA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AS,EAAE,CAAC,IAAI,EAAE,EAAE;QACrB,IAAA,kBAAO,GAAE,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;YACpB,IAAA,aAAM,EAAC,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,OAAO,CAAC,CAAA;YAC9B,IAAI,CAAC,OAAO,CAAC,CAAC,EACZ,KAAK,EACL,IAAI,EACJ,KAAK,EACL,KAAK,EACL,IAAI,EACL,EAAE,EAAE;gBACH,IAAA,aAAM,EAAC,KAAK,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAA;gBAC/B,IAAA,aAAM,EAAC,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAA;gBAC9B,IAAA,aAAM,EAAC,KAAK,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAA;gBAC/B,IAAA,aAAM,EAAC,KAAK,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAA;gBAC/B,IAAA,aAAM,EAAC,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAA;YAChC,CAAC,CAAC,CAAA;YAEF,OAAO,IAAI,EAAE,CAAA;QACf,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;IAChB,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/cjs/news/types.js b/node_modules/@bochilteam/scraper/lib/cjs/news/types.js new file mode 100644 index 000000000..11e638d1e --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/cjs/news/types.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=types.js.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/cjs/news/types.js.map b/node_modules/@bochilteam/scraper/lib/cjs/news/types.js.map new file mode 100644 index 000000000..50d734496 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/cjs/news/types.js.map @@ -0,0 +1 @@ +{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/news/types.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/cjs/others/BMKG.js b/node_modules/@bochilteam/scraper/lib/cjs/others/BMKG.js new file mode 100644 index 000000000..f942ea0dc --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/cjs/others/BMKG.js @@ -0,0 +1,81 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.tsunami = exports.gempaNow = exports.gempa = void 0; +const got_1 = __importDefault(require("got")); +const cheerio_1 = __importDefault(require("cheerio")); +async function gempa() { + const html = await (0, got_1.default)('https://www.bmkg.go.id/gempabumi/gempabumi-dirasakan.bmkg').text(); + const $ = cheerio_1.default.load(html); + const results = []; + $('div.table-responsive > table.table > tbody > tr').each(function () { + const el = $(this).find('td'); + const date = el.eq(1).text().trim(); + const locate = el.eq(2).text().trim(); + const magnitude = el.eq(3).text().trim(); + const depth = el.eq(4).text().trim(); + const location = el.eq(5).find('a').text().trim(); + const warning = el.eq(5).find('span.label').map(function () { + return $(this).text().trim(); + }).toArray(); + results.push({ + date, + locate, + magnitude, + depth, + location, + warning + }); + }); + return results; +} +exports.gempa = gempa; +async function gempaNow() { + const html = await (0, got_1.default)('https://www.bmkg.go.id/gempabumi/gempabumi-terkini.bmkg').text(); + const $ = cheerio_1.default.load(html); + const results = []; + $('div.table-responsive > table.table > tbody > tr').each(function () { + const el = $(this).find('td'); + const date = el.eq(1).text().trim(); + const latitude = el.eq(2).text().trim(); + const longitude = el.eq(3).text().trim(); + const magnitude = el.eq(4).text().trim(); + const depth = el.eq(5).text().trim(); + const location = el.eq(6).text().trim(); + results.push({ + date, + latitude, + longitude, + magnitude, + depth, + location + }); + }); + return results; +} +exports.gempaNow = gempaNow; +async function tsunami() { + const html = await (0, got_1.default)('https://www.bmkg.go.id/tsunami/').text(); + const $ = cheerio_1.default.load(html); + const results = []; + $('div.row > div > table.table > tbody > tr').each(function () { + const el = $(this).find('td'); + const date = el.eq(0).text().trim(); + const locate = el.eq(1).text().trim(); + const magnitude = el.eq(2).text().trim(); + const depth = el.eq(3).text().trim(); + const location = el.eq(4).text().trim(); + results.push({ + date, + locate, + magnitude, + depth, + location + }); + }); + return results; +} +exports.tsunami = tsunami; +//# sourceMappingURL=BMKG.js.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/cjs/others/BMKG.js.map b/node_modules/@bochilteam/scraper/lib/cjs/others/BMKG.js.map new file mode 100644 index 000000000..e4de1626b --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/cjs/others/BMKG.js.map @@ -0,0 +1 @@ +{"version":3,"file":"BMKG.js","sourceRoot":"","sources":["../../../src/others/BMKG.ts"],"names":[],"mappings":";;;;;;AAAA,8CAAqB;AACrB,sDAA6B;AAOtB,KAAK,UAAU,KAAK;IACzB,MAAM,IAAI,GAAG,MAAM,IAAA,aAAG,EAAC,2DAA2D,CAAC,CAAC,IAAI,EAAE,CAAA;IAC1F,MAAM,CAAC,GAAG,iBAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IAC5B,MAAM,OAAO,GAAY,EAAE,CAAA;IAC3B,CAAC,CAAC,iDAAiD,CAAC,CAAC,IAAI,CAAC;QACxD,MAAM,EAAE,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;QAC7B,MAAM,IAAI,GAAG,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,IAAI,EAAE,CAAA;QACnC,MAAM,MAAM,GAAG,EAAE,CAAC,EAAE,CAAC,CAAC,CAA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AC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,IAAI,EAAE,CAAA;QACrC,MAAM,SAAS,GAAG,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,IAAI,EAAE,CAAA;QACxC,MAAM,KAAK,GAAG,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,IAAI,EAAE,CAAA;QACpC,MAAM,QAAQ,GAAG,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,IAAI,EAAE,CAAA;QACvC,OAAO,CAAC,IAAI,CAAC;YACX,IAAI;YACJ,MAAM;YACN,SAAS;YACT,KAAK;YACL,QAAQ;SACT,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;IACF,OAAO,OAAO,CAAA;AAChB,CAAC;AApBD,0BAoBC"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/cjs/others/KBBI.js b/node_modules/@bochilteam/scraper/lib/cjs/others/KBBI.js new file mode 100644 index 000000000..62f4dd930 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/cjs/others/KBBI.js @@ -0,0 +1,53 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const got_1 = __importDefault(require("got")); +const cheerio_1 = __importDefault(require("cheerio")); +const utils_js_1 = require("../utils.js"); +/** + * p = Partikel: kelas kata yang meliputi kata depan, kata sambung, kata seru, kata sandang, ucapan salam + * + * n = Nomina: kata benda + */ +async function kbbi(words) { + const html = await (0, got_1.default)(`https://kbbi.kemdikbud.go.id/entri/${encodeURIComponent(words)}`).text(); + const $ = cheerio_1.default.load(html); + const isExist = !/tidak ditemukan/i.test($('body > div.container.body-content > h4[style="color:red"]').text()); + if (!isExist) + throw new utils_js_1.ScraperError(`${words} does not exist!`); + const results = []; + let isContent = false; + let lastTitle; + $('body > div.container.body-content').children().each((_, el) => { + const tag = el.tagName; + const elem = $(el); + if (tag === 'hr') + isContent = !isContent && !Object.keys(results).length; + if (tag === 'h2' && isContent) { + const index = elem.find('sup').text().trim(); + const title = elem.text().trim(); + results.push({ + index: parseInt(index), + title, + means: [] + }); + lastTitle = title; + } + if ((tag === 'ol' || tag === 'ul') && isContent && lastTitle) { + elem.find('li').each((_, el) => { + const li = $(el).text().trim(); + const index = results.findIndex(({ title }) => title === lastTitle); + if (index !== -1) + results[index].means.push(li); + else + console.log(li, lastTitle); + }); + lastTitle = ''; + } + }); + return results; +} +exports.default = kbbi; +//# sourceMappingURL=KBBI.js.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/cjs/others/KBBI.js.map b/node_modules/@bochilteam/scraper/lib/cjs/others/KBBI.js.map new file mode 100644 index 000000000..50a10fae9 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/cjs/others/KBBI.js.map @@ -0,0 +1 @@ +{"version":3,"file":"KBBI.js","sourceRoot":"","sources":["../../../src/others/KBBI.ts"],"names":[],"mappings":";;;;;AAAA,8CAAqB;AACrB,sDAA6B;AAE7B,0CAA0C;AAC1C;;;;GAIG;AACY,KAAK,UAAU,IAAI,CAAE,KAAa;IAC/C,MAAM,IAAI,GAAG,MAAM,IAAA,aAAG,EAAC,sCAAsC,kBAAkB,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,IAAI,EAAE,CAAA;IAChG,MAAM,CAAC,GAAG,iBAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IAC5B,MAAM,OAAO,GAAG,CAAC,kBAAkB,CAAC,IAAI,CACtC,CAAC,CAAC,2DAA2D,CAAC,CAAC,IAAI,EAAE,CACtE,CAAA;IACD,IAAI,CAAC,OAAO;QAAE,MAAM,IAAI,uBAAY,CAAC,GAAG,KAAK,kBAAkB,CAAC,CAAA;IAChE,MAAM,OAAO,GAAW,EAAE,CAAA;IAC1B,IAAI,SAAS,GAAG,KAAK,CAAC;IAA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K,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;;oBAC1C,OAAO,CAAC,GAAG,CAAC,EAAE,EAAE,SAAS,CAAC,CAAA;YACjC,CAAC,CAAC,CAAA;YACF,SAAS,GAAG,EAAE,CAAA;SACf;IACH,CAAC,CAAC,CAAA;IACF,OAAO,OAAO,CAAA;AAChB,CAAC;AApCD,uBAoCC"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/cjs/others/bioskop.js b/node_modules/@bochilteam/scraper/lib/cjs/others/bioskop.js new file mode 100644 index 000000000..7bf3d0d1d --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/cjs/others/bioskop.js @@ -0,0 +1,83 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.bioskop = exports.bioskopNow = void 0; +const got_1 = __importDefault(require("got")); +const cheerio_1 = __importDefault(require("cheerio")); +async function bioskopNow() { + const url = 'https://jadwalnonton.com/now-playing/'; + const response = await (0, got_1.default)(url, { + headers: { + Accept: 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9', + Host: 'jadwalnonton.com', + Referer: 'https://jadwalnonton.com/now-playing/', + 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.102 Safari/537.36' + } + }).text(); + const results = []; + const $ = cheerio_1.default.load(response); + $('div.row > div.item.movie').each((_, el) => { + const $el = $(el); + const title = $el.find('h2 > a').text(); + const img = $el.find('img.poster').attr('src'); + const url = $el.find('a.mojadwal').attr('href'); + const $span = $el.find('div > span.moket'); + const genre = $span.eq(0).text(); + const duration = $span.eq(1).text(); + const playingAt = ($el.find('div > i.icon').attr('class') || '').replace(/icon/, '').trim(); + if (title && url) { + results.push({ + title, + img, + url, + genre, + duration, + playingAt + }); + } + }); + return results; +} +exports.bioskopNow = bioskopNow; +async function bioskop(page = 1) { + page = Math.min(4, Math.max(1, parseInt(page))); + const response = await (0, got_1.default)(`https://jadwalnonton.com/comingsoon/?page=${page}`, { + headers: { + Accept: 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9', + Host: 'jadwalnonton.com', + Referer: 'https://jadwalnonton.com/comingsoon/', + 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.102 Safari/537.36' + } + }).text(); + const results = []; + const $ = cheerio_1.default.load(response); + $('div.row > div.item.movie').each((_, el) => { + const $el = $(el); + const title = $el.find('h2 > a').text(); + const img = $el.find('img.poster').attr('src'); + const url = $el.find('a.mojadwal').attr('href'); + const $span = $el.find('div.rowl > div > span'); + const genre = $span.eq(0).text(); + const duration = $span.eq(1).text(); + const release = $span.eq(2).text(); + const director = $span.eq(4).text(); + const cast = $span.eq(6).text(); + if (title && url) { + results.push({ + title, + img, + url, + genre, + duration, + release, + director, + cast + }); + } + }); + return results; +} +exports.bioskop = bioskop; +//# sourceMappingURL=bioskop.js.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/cjs/others/bioskop.js.map b/node_modules/@bochilteam/scraper/lib/cjs/others/bioskop.js.map new file mode 100644 index 000000000..5fd688e9a --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/cjs/others/bioskop.js.map @@ -0,0 +1 @@ +{"version":3,"file":"bioskop.js","sourceRoot":"","sources":["../../../src/others/bioskop.ts"],"names":[],"mappings":";;;;;;AAAA,8CAAqB;AACrB,sDAA6B;AAGtB,KAAK,UAAU,UAAU;IAC9B,MAAM,GAAG,GAAG,uCAAuC,CAAA;IACnD,MAAM,QAAQ,GAAG,MAAM,IAAA,aAAG,EAAC,GAAG,EAAE;QAC9B,OAAO,EAAE;YACP,MAAM,EAAE,yIAAyI;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AC,IAAI,EAAE,CAAA;QACnC,MAAM,OAAO,GAAG,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAA;QAClC,MAAM,QAAQ,GAAG,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAA;QACnC,MAAM,IAAI,GAAG,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAA;QAC/B,IAAI,KAAK,IAAI,GAAG,EAAE;YAChB,OAAO,CAAC,IAAI,CAAC;gBACX,KAAK;gBACL,GAAG;gBACH,GAAG;gBACH,KAAK;gBACL,QAAQ;gBACR,OAAO;gBACP,QAAQ;gBACR,IAAI;aACL,CAAC,CAAA;SACH;IACH,CAAC,CAAC,CAAA;IACF,OAAO,OAAO,CAAA;AAChB,CAAC;AAtCD,0BAsCC"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/cjs/others/cek-resi.js b/node_modules/@bochilteam/scraper/lib/cjs/others/cek-resi.js new file mode 100644 index 000000000..66a2ce702 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/cjs/others/cek-resi.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=cek-resi.js.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/cjs/others/cek-resi.js.map b/node_modules/@bochilteam/scraper/lib/cjs/others/cek-resi.js.map new file mode 100644 index 000000000..1227a41dd --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/cjs/others/cek-resi.js.map @@ -0,0 +1 @@ +{"version":3,"file":"cek-resi.js","sourceRoot":"","sources":["../../../src/others/cek-resi.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/cjs/others/idff.js b/node_modules/@bochilteam/scraper/lib/cjs/others/idff.js new file mode 100644 index 000000000..8dd7b23a4 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/cjs/others/idff.js @@ -0,0 +1,37 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const got_1 = __importDefault(require("got")); +const utils_js_1 = require("../utils.js"); +async function nameFreeFire(id) { + id = id.toString(); + const json = await (0, got_1.default)('https://api.duniagames.co.id/api/transaction/v1/top-up/inquiry/store', { + headers: { + accept: 'application/json, text/plain, */*', + 'content-type': 'application/json', + origin: 'https://duniagames.co.id', + referer: 'https://duniagames.co.id/', + 'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.102 Safari/537.36' + }, + body: JSON.stringify({ + catalogId: 66, + gameId: id, + itemId: 11, + paymentId: 750, + productId: 3, + product_ref: 'AE', + product_ref_denom: 'AE' + }), + method: 'POST' + }).json(); + if (json.status.message !== 'success') + throw new utils_js_1.ScraperError(`Can't get nameFreeFire for id ${id}\n${JSON.stringify(json, null, 2)}`); + return { + id: json.data.gameId, + username: json.data.userNameGame + }; +} +exports.default = nameFreeFire; +//# sourceMappingURL=idff.js.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/cjs/others/idff.js.map b/node_modules/@bochilteam/scraper/lib/cjs/others/idff.js.map new file mode 100644 index 000000000..b3f3da589 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/cjs/others/idff.js.map @@ -0,0 +1 @@ +{"version":3,"file":"idff.js","sourceRoot":"","sources":["../../../src/others/idff.ts"],"names":[],"mappings":";;;;;AAAA,8CAAqB;AACrB,0CAA0C;AAG3B,KAAK,UAAU,YAAY,CAAE,EAAmB;IAC7D,EAAE,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAA;IAClB,MAAM,IAAI,GAAQ,MAAM,IAAA,aAAG,EAAC,sEAAsE,EAAE;QAClG,OAAO,EAAE;YACP,MAAM,EAAE,mCAAmC;YAC3C,cAAc,EAAE,kBAAkB;YAClC,MAAM,EAAE,0BAA0B;YAClC,OAAO,EAAE,2BAA2B;YACpC,YAAY,EAAE,qHAAqH;SACpI;QACD,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC;YACnB,SAAS,EAAE,EAAE;YACb,MAAM,EAAE,EAAE;YACV,MAAM,EAAE,EAAE;YACV,SAAS,EAAE,GAAG;YACd,SAAS,EAAE,CAAC;YACZ,WAAW,EAAE,IAAI;YACjB,iBAAiB,EAAE,IAAI;SACxB,CAAC;QACF,MAAM,EAAE,MAAM;KACf,CAAC,CAAC,IAAI,EAAE,CAAA;IACT,IAAI,IAAI,CAAC,MAAM,CAAC,OAAO,KAAK,SAAS;QAAE,MAAM,IAAI,uBAAY,CAAC,iCAAiC,EAAE,KAAK,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,CAAA;IACtI,OAAO;QACL,EAAE,EAAE,IAAI,CAAC,IAAI,CAAC,MAAM;QACpB,QAAQ,EAAE,IAAI,CAAC,IAAI,CAAC,YAAY;KACjC,CAAA;AACH,CAAC;AA1BD,+BA0BC"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/cjs/others/index.js b/node_modules/@bochilteam/scraper/lib/cjs/others/index.js new file mode 100644 index 000000000..993a6f9ae --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/cjs/others/index.js @@ -0,0 +1,49 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.nameFreeFire = exports.kbbi = exports.listJadwalTV = exports.jadwalTVNow = exports.jadwalTV = exports.wikipedia = void 0; +const wikipedia_js_1 = __importDefault(require("./wikipedia.js")); +exports.wikipedia = wikipedia_js_1.default; +const jadwal_tv_js_1 = __importStar(require("./jadwal-tv.js")); +exports.jadwalTV = jadwal_tv_js_1.default; +Object.defineProperty(exports, "jadwalTVNow", { enumerable: true, get: function () { return jadwal_tv_js_1.jadwalTVNow; } }); +Object.defineProperty(exports, "listJadwalTV", { enumerable: true, get: function () { return jadwal_tv_js_1.listJadwalTV; } }); +const KBBI_js_1 = __importDefault(require("./KBBI.js")); +exports.kbbi = KBBI_js_1.default; +const idff_js_1 = __importDefault(require("./idff.js")); +exports.nameFreeFire = idff_js_1.default; +__exportStar(require("./minecraft.js"), exports); +__exportStar(require("./mediafire.js"), exports); +__exportStar(require("./BMKG.js"), exports); +__exportStar(require("./lyrics.js"), exports); +__exportStar(require("./minecraft.js"), exports); +__exportStar(require("./bioskop.js"), exports); +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/cjs/others/index.js.map b/node_modules/@bochilteam/scraper/lib/cjs/others/index.js.map new file mode 100644 index 000000000..a81df087a --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/cjs/others/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/others/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kEAAsC;AAcpC,oBAdK,sBAAS,CAcL;AAbX,+DAAoE;AAclE,mBAdK,sBAAQ,CAcL;AAAE,4FAdO,0BAAW,OAcP;AAAE,6FAdO,2BAAY,OAcP;AAbrC,wDAA4B;AAc1B,eAdK,iBAAI,CAcL;AAbN,wDAAoC;AAclC,uBAdK,iBAAY,CAcL;AAZd,iDAA8B;AAC9B,iDAA8B;AAC9B,4CAAyB;AACzB,8CAA2B;AAC3B,iDAA8B;AAC9B,+CAA4B"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/cjs/others/jadwal-tv.js b/node_modules/@bochilteam/scraper/lib/cjs/others/jadwal-tv.js new file mode 100644 index 000000000..35e0ea9c5 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/cjs/others/jadwal-tv.js @@ -0,0 +1,66 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.jadwalTVNow = exports.listJadwalTV = void 0; +const got_1 = __importDefault(require("got")); +const cheerio_1 = __importDefault(require("cheerio")); +const utils_js_1 = require("../utils.js"); +exports.listJadwalTV = (async () => await (0, got_1.default)('https://raw.githubusercontent.com/BochilTeam/scraper/master/data/jadwal-tv.json').json())(); +async function jadwalTV(channel) { + const list = await exports.listJadwalTV; + const data = list.find(({ channel: name }) => (new RegExp(channel, 'ig')).test(name)); + if (!data) + throw new utils_js_1.ScraperError(`List not found!!\n${JSON.stringify(exports.listJadwalTV, null, 2)}`); + const text = await (0, got_1.default)(`https://www.jadwaltv.net/${data.isPay ? 'jadwal-pay-tv/' : ''}${data.value}`).text(); + const result = []; + const $ = cheerio_1.default.load(text); + $('div > table.table').each(function () { + $(this).find('tbody > tr') + .slice(1).each(function () { + const el = $(this).find('td'); + const date = el.eq(0).text(); + const event = el.eq(1).text(); + if (!/Jadwal TV selengkapnya di/ig.test(event)) { + result.push({ + date, event + }); + } + }); + }); + return { + channel: data.channel, + result + }; +} +exports.default = jadwalTV; +async function jadwalTVNow() { + const text = await (0, got_1.default)('https://www.jadwaltv.net/channel/acara-tv-nasional-saat-ini').text(); + const result = {}; + const $ = cheerio_1.default.load(text); + $('div > table.table').each(function () { + let prevChannel; + $(this).find('tbody > tr') + .slice(1).each(function () { + const el = $(this).find('td'); + const channel = el.eq(0).find('strong > a[href]') + .text().trim().toLowerCase(); + if (channel) { + prevChannel = channel; + result[channel] = []; + } + else if (prevChannel) { + const date = el.eq(0).text(); + const event = el.eq(1).text(); + result[prevChannel].push({ + date, + event + }); + } + }); + }); + return result; +} +exports.jadwalTVNow = jadwalTVNow; +//# sourceMappingURL=jadwal-tv.js.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/cjs/others/jadwal-tv.js.map b/node_modules/@bochilteam/scraper/lib/cjs/others/jadwal-tv.js.map new file mode 100644 index 000000000..9bc04cd89 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/cjs/others/jadwal-tv.js.map @@ -0,0 +1 @@ +{"version":3,"file":"jadwal-tv.js","sourceRoot":"","sources":["../../../src/others/jadwal-tv.ts"],"names":[],"mappings":";;;;;;AAAA,8CAAqB;AACrB,sDAA6B;AAG7B,0CAA0C;AAQ7B,QAAA,YAAY,GAA0B,CAAC,KAAK,IAAI,EAAE,CAAC,MAAM,IAAA,aAAG,EAAC,iFAAiF,CAAC,CAAC,IAAI,EAAgB,CAAC,EAAE,CAAA;AAErK,KAAK,UAAU,QAAQ,CAAE,OAAe;IACrD,MAAM,IAAI,GAAG,MAAM,oBAAY,CAAA;IAC/B,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CACpB,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,CAAC,IAAI,MAAM,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC,CAAC,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aAAG,EAAC,6DAA6D,CAAC,CAAC,IAAI,EAAE,CAAA;IAC5F,MAAM,MAAM,GAAgB,EAAE,CAAA;IAC9B,MAAM,CAAC,GAAG,iBAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IAC5B,CAAC,CAAC,mBAAmB,CAAC,CAAC,IAAI,CAAC;QAC1B,IAAI,WAAmB,CAAA;QACvB,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC;aACvB,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;YACb,MAAM,EAAE,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;YAC7B,MAAM,OAAO,GAAG,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,kBAAkB,CAAC;iBAC9C,IAAI,EAAE,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAA;YAC9B,IAAI,OAAO,EAAE;gBACX,WAAW,GAAG,OAAO,CAAA;gBACrB,MAAM,CAAC,OAAO,CAAC,GAAG,EAAE,CAAA;aACrB;iBAAM,IAAI,WAAW,EAAE;gBACtB,MAAM,IAAI,GAAG,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAA;gBAC5B,MAAM,KAAK,GAAG,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAA;gBAC7B,MAAM,CAAC,WAAW,CAAC,CAAC,IAAI,CAAC;oBACvB,IAAI;oBACJ,KAAK;iBACN,CAAC,CAAA;aACH;QACH,CAAC,CAAC,CAAA;IACN,CAAC,CAAC,CAAA;IACF,OAAO,MAAM,CAAA;AACf,CAAC;AAzBD,kCAyBC"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/cjs/others/lyrics.js b/node_modules/@bochilteam/scraper/lib/cjs/others/lyrics.js new file mode 100644 index 000000000..24b69db67 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/cjs/others/lyrics.js @@ -0,0 +1,73 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.lyricsv2 = exports.lyrics = void 0; +const got_1 = __importDefault(require("got")); +const cheerio_1 = __importDefault(require("cheerio")); +const utils_js_1 = require("../utils.js"); +async function lyrics(query) { + const data = await (0, got_1.default)(`https://www.musixmatch.com/search/${encodeURIComponent(query)}`).text(); + const $ = cheerio_1.default.load(data); + const results = []; + $('#search-all-results > div.main-panel > div:nth-child(2) > div.box-content > div > ul.tracks.list > li.showArtist.showCoverart').each(function () { + var _a; + const el = (_a = $(this).find('meta[itemprop="url"]').attr('content')) === null || _a === void 0 ? void 0 : _a.trim(); + if (el) { + results.push({ + link: 'https://www.musixmatch.com' + el, + title: $(this).find('.media-card-title > a > span').text().trim(), + author: $(this).find('.artist-field > span > a.artist').text().trim() + }); + } + }); + if (!results.length) + throw new utils_js_1.ScraperError(`Can't get lyrics!\n${$.html()}`); + const { link, title, author } = results[0]; + const html = await (0, got_1.default)(link).text(); + const $$ = cheerio_1.default.load(html); + return { + title, + author, + lyrics: $$('p.mxm-lyrics__content > span.lyrics__content__ok').map((_, el) => $$(el).text().trim()).toArray().filter(v => v).join('\n'), + link + }; +} +exports.lyrics = lyrics; +async function lyricsv2(query) { + var _a, _b; + const data = await (0, got_1.default)(`https://genius.com/api/search/multi?per_page=5&q=${encodeURIComponent(query)}`, { + headers: { + accept: 'application/json, text/plain, */*', + 'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36' + } + }).json(); + // @ts-ignore + const result = (_b = (_a = data.response.sections.find((section) => { + var _a; + return ['song', 'lyric'].includes(section.type) && + ((_a = section.hits) === null || _a === void 0 ? void 0 : _a.find((hit) => ['song', 'lyric'].includes(hit.type))); + }).hits) === null || _a === void 0 ? void 0 : _a.find((hit) => ['song', 'lyric'].includes(hit.type))) === null || _b === void 0 ? void 0 : _b.result; + if (!result) + throw new utils_js_1.ScraperError(`Can't get json!\n${JSON.stringify(data)}`); + const { artist_names, title, url } = result; + if (!url) + throw new utils_js_1.ScraperError(`Can't get lyrics!\n${JSON.stringify(data, null, 2)}`); + const html = await (0, got_1.default)(url).text(); + const $ = cheerio_1.default.load(html); + let results = ''; + $('#lyrics-root > div[data-lyrics-container="true"]').each((_, el) => { + const element = $(($(el).html() || '').replace(/
/g, '\n')).text().trim(); + if (element) + results += element; + }); + return { + title, + author: artist_names, + lyrics: results.trim(), + link: url + }; +} +exports.lyricsv2 = lyricsv2; +//# sourceMappingURL=lyrics.js.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/cjs/others/lyrics.js.map b/node_modules/@bochilteam/scraper/lib/cjs/others/lyrics.js.map new file mode 100644 index 000000000..ad3aee10f --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/cjs/others/lyrics.js.map @@ -0,0 +1 @@ +{"version":3,"file":"lyrics.js","sourceRoot":"","sources":["../../../src/others/lyrics.ts"],"names":[],"mappings":";;;;;;AAAA,8CAAqB;AACrB,sDAA6B;AAI7B,0CAA0C;AAEnC,KAAK,UAAU,MAAM,CAAE,KAAa;IACzC,MAAM,IAAI,GAAG,MAAM,IAAA,aAAG,EAAC,qCAAqC,kBAAkB,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,IAAI,EAAE,CAAA;IAC/F,MAAM,CAAC,GAAG,iBAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IAC5B,MAAM,OAAO,GAKP,EAAE,CAAA;IACR,CAAC,CAAC,+HAA+H,CAAC,CAAC,IAAI,CAAC;;QACtI,MAAM,EAAE,GAAG,MAAA,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,0CAAE,IAAI,EAAE,CAAA;QACv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E,EAAE,EAAE;QACnE,MAAM,OAAO,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,IAAI,EAAE,CAAA;QAC5E,IAAI,OAAO;YAAE,OAAO,IAAI,OAAO,CAAA;IACjC,CAAC,CAAC,CAAA;IACF,OAAO;QACL,KAAK;QACL,MAAM,EAAE,YAAY;QACpB,MAAM,EAAE,OAAO,CAAC,IAAI,EAAE;QACtB,IAAI,EAAE,GAAG;KACV,CAAA;AACH,CAAC;AAzDD,4BAyDC"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/cjs/others/mediafire.js b/node_modules/@bochilteam/scraper/lib/cjs/others/mediafire.js new file mode 100644 index 000000000..2adb73738 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/cjs/others/mediafire.js @@ -0,0 +1,45 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.mediafiredl = void 0; +const got_1 = __importDefault(require("got")); +const cheerio_1 = __importDefault(require("cheerio")); +async function mediafiredl(url) { + var _a, _b; + if (!/https?:\/\/(www\.)?mediafire\.com/.test(url)) + throw new Error('Invalid URL: ' + url); + const data = await (0, got_1.default)(url).text(); + const $ = cheerio_1.default.load(data); + const Url = ($('#downloadButton').attr('href') || '').trim(); + const url2 = ($('#download_link > a.retry').attr('href') || '').trim(); + const $intro = $('div.dl-info > div.intro'); + const filename = $intro.find('div.filename').text().trim(); + const filetype = $intro.find('div.filetype > span').eq(0).text().trim(); + const ext = ((_b = (_a = /\(\.(.*?)\)/.exec($intro.find('div.filetype > span').eq(1).text())) === null || _a === void 0 ? void 0 : _a[1]) === null || _b === void 0 ? void 0 : _b.trim()) || 'bin'; + const $li = $('div.dl-info > ul.details > li'); + const aploud = $li.eq(1).find('span').text().trim(); + const filesizeH = $li.eq(0).find('span').text().trim(); + const filesize = parseFloat(filesizeH) * (/GB/i.test(filesizeH) + ? 1000000 + : /MB/i.test(filesizeH) + ? 1000 + : /KB/i.test(filesizeH) + ? 1 + : /B/i.test(filesizeH) + ? 0.1 + : 0); + return { + url: Url, + url2, + filename, + filetype, + ext, + aploud, + filesizeH, + filesize + }; +} +exports.mediafiredl = mediafiredl; +//# sourceMappingURL=mediafire.js.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/cjs/others/mediafire.js.map b/node_modules/@bochilteam/scraper/lib/cjs/others/mediafire.js.map new file mode 100644 index 000000000..5ba8d50bd --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/cjs/others/mediafire.js.map @@ -0,0 +1 @@ +{"version":3,"file":"mediafire.js","sourceRoot":"","sources":["../../../src/others/mediafire.ts"],"names":[],"mappings":";;;;;;AAAA,8CAAqB;AACrB,sDAA6B;AAGtB,KAAK,UAAU,WAAW,CAAE,GAAW;;IAC5C,IAAI,CAAC,mCAAmC,CAAC,IAAI,CAAC,GAAG,CAAC;QAAE,MAAM,IAAI,KAAK,CAAC,eAAe,GAAG,GAAG,CAAC,CAAA;IAC1F,MAAM,IAAI,GAAG,MAAM,IAAA,aAAG,EAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAA;IAClC,MAAM,CAAC,GAAG,iBAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IAC5B,MAAM,GAAG,GAAG,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAA;IAC5D,MAAM,IAAI,GAAG,CAAC,CAAC,CAAC,0BAA0B,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAA;IACtE,MAAM,MAAM,GAAG,CAAC,CAAC,yBAAyB,CAAC,CA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;QACR,QAAQ;QACR,GAAG;QACH,MAAM;QACN,SAAS;QACT,QAAQ;KACT,CAAA;AACH,CAAC;AAlCD,kCAkCC"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/cjs/others/minecraft.js b/node_modules/@bochilteam/scraper/lib/cjs/others/minecraft.js new file mode 100644 index 000000000..1ff7a5194 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/cjs/others/minecraft.js @@ -0,0 +1,229 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.statusJava = exports.statusBedrock = void 0; +// import dgram, { Socket } from 'dgram' +const events_1 = __importDefault(require("events")); +const net_1 = __importDefault(require("net")); +const utils_js_1 = require("../utils.js"); +// TODO +async function statusBedrock(ip, port, opts = { timeout: 5 * 1000 }) { } +exports.statusBedrock = statusBedrock; +// TODO: fix connection timeout +function statusJava(ip, port = 25565, opts = { timeout: 5 * 1000 }) { + // eslint-disable-next-line no-async-promise-executor + return new Promise(async (resolve, reject) => { + var _a; + setTimeout(() => reject(new utils_js_1.ScraperError('timeout')), opts.timeout); + // reference https://github.com/PassTheMayo/minecraft-server-util/blob/master/src/status.ts + const socket = new TCPsocket(ip, port, opts, reject); + // https://wiki.vg/Server_List_Ping#Handshake + socket.writeVarInt(0x00); + socket.writeVarInt(47); + socket.writeStringVarInt(ip); + socket.writeUnsignedShort(port); + socket.writeVarInt(1); + await socket.send(); + // https://wiki.vg/Server_List_Ping#Request + socket.writeVarInt(0x00); + socket.send(); + await socket.waitForResponse(); + socket.readVarInt(); + const responseId = socket.readVarInt(); + // eslint-disable-next-line eqeqeq + if (responseId == -1) + reject(new Error('Premature end of stream')); + // eslint-disable-next-line eqeqeq + if (responseId != 0x00) + reject(new Error('Invalid responseId')); + // https://wiki.vg/Protocol#Response + const response = JSON.parse(socket.readStringVarInt()); + // https://wiki.vg/Server_List_Ping#Ping + socket.writeVarInt(0x01); + const ping = Date.now(); + socket.writeVarLong(ping); + socket.send(); + await socket.waitForResponse(); + const pong = Date.now() - ping; + socket.close(); + resolve({ + ip, + port, + description: response.description.extra.map(({ text }) => text.trim()).join(' ').trim(), + descriptionText: response.description.text.trim(), + players: { + max: response.players.max, + online: response.players.online, + sample: response.players.sample.map(({ name }) => name.trim()) + }, + version: { + name: response.version.name, + protocol: response.version.protocol + }, + favicon: (_a = response.favicon) !== null && _a !== void 0 ? _a : null, + ping: pong, + originalResponse: response + }); + }); +} +exports.statusJava = statusJava; +// class UDPsocket extends EventEmitter { +// public socket: Socket; +// constructor (public ip: string, public port: number, public opts: object) { +// super() +// this.socket = dgram.createSocket('udp4') +// } +// connect () { +// if (!this.socket) return +// this.socket.bind(this.port, this.ip) +// } +// } +class TCPsocket extends events_1.default { + constructor(ip, port, opts, reject) { + super(); + this.ip = ip; + this.port = port; + this.opts = opts; + this.reject = reject; + this.data = Buffer.alloc(0); + this.response = Buffer.alloc(0); + } + connect(opts) { + this.socket = net_1.default.createConnection({ + host: this.ip, + port: this.port, + timeout: this.opts.timeout, + ...opts + }); + this.socket.on('data', (data) => { + this.response = Buffer.concat([this.response, data]); + this.emit('data', data, this.response); + }); + this.socket.on('connect', () => { + this.emit('connect'); + }); + this.socket.on('close', () => { + // this.reject(new ScraperError('Connection closed')); + this.emit('close'); + }); + this.socket.on('error', () => { + this.reject(new utils_js_1.ScraperError('Connection error')); + this.emit('error'); + }); + this.socket.on('timeout', () => { + this.reject(new utils_js_1.ScraperError('Connection timeout')); + this.emit('timeout'); + }); + } + write(data) { + return (this.data = Buffer.concat([this.data, data])); + } + writeVarInt(value, save = true) { + const buffer = Buffer.alloc(5); + let i = 0; + do { + buffer[i++] = value & 0x7f | 0x80; + value >>= 7; + } while (value > 0); + buffer[i - 1] &= 0x7f; + const result = buffer.slice(0, i); + if (save) + this.write(result); + return result; + } + writeVarLong(value) { + const buffer = Buffer.alloc(9); + let i = 0; + do { + buffer[i++] = value & 0x7f | 0x80; + value >>= 7; + } while (value > 0); + buffer[i - 1] &= 0x7f; + const result = buffer.slice(0, i); + this.write(result); + return result; + } + writeStringVarInt(value) { + this.writeVarInt(value.length); + this.write(Buffer.from(value, 'utf8')); + } + writeUnsignedShort(value) { + this.write(Buffer.from([value >> 8, value & 0xff])); + } + readVarInt() { + let result = 0; + let i = 0; + let b; + do { + b = this.response[i++]; + result |= (b & 0x7f) << (7 * i); + } while (b & 0x80); + this.response = this.response.slice(i); + return result; + } + readVarLong() { + let result = 0; + let i = 0; + let b; + do { + b = this.response[i++]; + result |= (b & 0x7f) << (7 * i); + } while (b & 0x80); + this.response = this.response.slice(i); + return result; + } + readStringVarInt() { + let length = 0; + let i = 0; + let b; + do { + b = this.response[i++]; + length |= (b & 0x7f) << (7 * i); + } while (b & 0x80); + // @ts-ignore + const result = this.response.slice(i, i + length).toString('utf8'); + this.response = this.response.slice(i + length); + return result; + } + readInt64BE() { + // @ts-ignore + const result = this.response.slice(0, 8).readBigInt64BE(0); + this.response = this.response.slice(8); + return result; + } + send() { + if (!this.socket) + this.connect(); + return new Promise((resolve, reject) => { + var _a, _b; + this.response = Buffer.alloc(0); + // https://gist.github.com/zh32/7190955#file-serverlistping17-java-L92 + // https://github.com/PassTheMayo/minecraft-server-util/blob/68a7a16beb48226cdd5b63c45604fd3bea6c12ca/src/structure/TCPClient.ts#L464 + const data = Buffer.concat([this.writeVarInt(this.data.byteLength, false), this.data]); + (_b = (_a = this.socket) === null || _a === void 0 ? void 0 : _a.write) === null || _b === void 0 ? void 0 : _b.call(_a, data, (err) => { + if (err) + return reject(err); + resolve(); + }); + this.data = Buffer.alloc(0); + }); + } + close() { + var _a, _b, _c, _d, _e, _f; + (_b = (_a = this.socket) === null || _a === void 0 ? void 0 : _a.end) === null || _b === void 0 ? void 0 : _b.call(_a); + (_d = (_c = this.socket) === null || _c === void 0 ? void 0 : _c.destroy) === null || _d === void 0 ? void 0 : _d.call(_c); + (_f = (_e = this.socket) === null || _e === void 0 ? void 0 : _e.removeAllListeners) === null || _f === void 0 ? void 0 : _f.call(_e); + } + waitForResponse() { + return new Promise((resolve) => { + const timeout = setTimeout(resolve, 250); + this.on('data', () => { + // @ts-ignore + timeout.refresh(); + }); + }); + } +} +//# sourceMappingURL=minecraft.js.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/cjs/others/minecraft.js.map b/node_modules/@bochilteam/scraper/lib/cjs/others/minecraft.js.map new file mode 100644 index 000000000..c766b31aa --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/cjs/others/minecraft.js.map @@ -0,0 +1 @@ +{"version":3,"file":"minecraft.js","sourceRoot":"","sources":["../../../src/others/minecraft.ts"],"names":[],"mappings":";;;;;;AACA,wCAAwC;AACxC,oDAAiC;AACjC,8CAA8D;AAC9D,0CAA0C;AAM1C,OAAO;AACA,KAAK,UAAU,aAAa,CACjC,EAAU,EACV,IAAY,EACZ,OAAgB,EAAE,OAAO,EAAE,CAAC,GAAG,IAAI,EAAE,IACnC,CAAC;AAJL,sCAIK;AAEL,+BAA+B;AAC/B,SAAgB,UAAU,CACxB,EAAU,EACV,OAAe,KAAK,EACpB,OAAgB,EAAE,OAAO,EAAE,CAAC,GAAG,IAAI,EAAE;IAErC,qDAAqD;IACrD,OAAO,IAAI,OAAO,CAAC,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE;;QAC3C,UAAU,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,IAAI,uBAAY,CAAC,SAAS,CAAC,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,CAAA;QACnE,2FAA2F;QAC3F,MAAM,MAAM,GAAG,IAAI,SAAS,CAAC,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,CAAC,CAAA;QAEpD,6CAA6C;QAC7C,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,CAAA;QACxB,MAAM,CAAC,WAAW,CAAC,EAAE,CAAC,CAAA;QACtB,MAAM,CAAC,iBAAiB,CAA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,CAAC,IAAI,CAAC,CAAC,CAAA;YAEtF,MAAA,MAAA,IAAI,CAAC,MAAM,0CAAE,KAAK,mDAAG,IAAI,EAAE,CAAC,GAAG,EAAE,EAAE;gBACjC,IAAI,GAAG;oBAAE,OAAO,MAAM,CAAC,GAAG,CAAC,CAAA;gBAC3B,OAAO,EAAE,CAAA;YACX,CAAC,CAAC,CAAA;YACF,IAAI,CAAC,IAAI,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;QAC7B,CAAC,CAAC,CAAA;IACJ,CAAC;IAED,KAAK;;QACH,MAAA,MAAA,IAAI,CAAC,MAAM,0CAAE,GAAG,kDAAI,CAAA;QACpB,MAAA,MAAA,IAAI,CAAC,MAAM,0CAAE,OAAO,kDAAI,CAAA;QACxB,MAAA,MAAA,IAAI,CAAC,MAAM,0CAAE,kBAAkB,kDAAI,CAAA;IACrC,CAAC;IAED,eAAe;QACb,OAAO,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,EAAE;YACnC,MAAM,OAAO,GAAG,UAAU,CAAC,OAAO,EAAE,GAAG,CAAC,CAAA;YACxC,IAAI,CAAC,EAAE,CAAC,MAAM,EAAE,GAAG,EAAE;gBACnB,aAAa;gBACb,OAAO,CAAC,OAAO,EAAE,CAAA;YACnB,CAAC,CAAC,CAAA;QACJ,CAAC,CAAC,CAAA;IACJ,CAAC;CACD"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/cjs/others/test.js b/node_modules/@bochilteam/scraper/lib/cjs/others/test.js new file mode 100644 index 000000000..4617d6c09 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/cjs/others/test.js @@ -0,0 +1,194 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const chai_1 = require("chai"); +const index_js_1 = require("./index.js"); +describe('Others', () => { + // TODO + describe('Minecraft', () => { + // it('Minecraft java', done => { + // statusJava('moelsmp2.mcalias.com', 25566).then(res => { + // expect(res).to.be.an('object') + // expect(res.ip).to.be.a('string') + // expect(res.port).to.be.a('number') + // expect(res.description).to.be.a('string') + // expect(res.descriptionText).to.be.a('string') + // expect(res.players).to.be.an('object') + // expect(res.players.max).to.be.a('number') + // expect(res.players.online).to.be.a('number') + // expect(res.players.sample).to.be.an('array') + // expect(res.version).to.be.an('object') + // expect(res.version.name).to.be.a('string') + // expect(res.version.protocol).to.be.a('number') + // expect(res.favicon).to.be.a('string') + // return done() + // }).catch(done) + // }) + }); + it('Wikipedia', (done) => { + (0, index_js_1.wikipedia)('Minecraft', 'en').then(res => { + (0, chai_1.expect)(res).to.be.an('object'); + (0, chai_1.expect)(res.title).to.be.a('string'); + (0, chai_1.expect)(res.img).to.be.a('string'); + (0, chai_1.expect)(res.articles).to.be.a('string'); + return done(); + }).catch(done); + }); + describe('Jadwal TV', () => { + it('Jadwal TV', done => { + (0, index_js_1.jadwalTV)('RCTI').then(res => { + (0, chai_1.expect)(res).to.be.an('object'); + (0, chai_1.expect)(res.channel).to.be.a('string'); + (0, chai_1.expect)(res.result).to.be.an('array'); + (0, chai_1.expect)(res.result).to.have.lengthOf.at.least(1); + return done(); + }).catch(done); + }); + it('Jadwal TV NOW', done => { + (0, index_js_1.jadwalTVNow)().then(res => { + (0, chai_1.expect)(res).to.be.an('object'); + Object.keys(res).forEach(key => { + (0, chai_1.expect)(key).to.be.a('string'); + (0, chai_1.expect)(res[key]).to.be.an('array'); + (0, chai_1.expect)(res[key]).to.have.lengthOf.at.least(2); + }); + return done(); + }).catch(done); + }); + }); + describe('Mediafire', () => { + it('Mediafire Download', done => { + (0, index_js_1.mediafiredl)('https://www.mediafire.com/file/gpeiucmm1xo6ln0/hello_world.mp4/file').then(res => { + (0, chai_1.expect)(res).to.be.an('object'); + (0, chai_1.expect)(res.url).to.be.a('string'); + (0, chai_1.expect)(res.url2).to.be.a('string'); + (0, chai_1.expect)(res.filename).to.be.a('string'); + (0, chai_1.expect)(res.filetype).to.be.a('string'); + (0, chai_1.expect)(res.ext).to.be.a('string'); + (0, chai_1.expect)(res.aploud).to.be.a('string'); + (0, chai_1.expect)(res.filesizeH).to.be.a('string'); + (0, chai_1.expect)(res.filesize).to.be.a('number'); + return done(); + }).catch(done); + }); + }); + describe('Gempa', () => { + it('Gempa', done => { + (0, index_js_1.gempa)().then(res => { + (0, chai_1.expect)(res).to.be.an('array'); + res.forEach(({ date, locate, magnitude, depth, location, warning }) => { + (0, chai_1.expect)(date).to.be.a('string'); + (0, chai_1.expect)(locate).to.be.a('string'); + (0, chai_1.expect)(magnitude).to.be.a('string'); + (0, chai_1.expect)(depth).to.be.a('string'); + (0, chai_1.expect)(location).to.be.a('string'); + (0, chai_1.expect)(warning).to.be.an('array'); + warning.forEach(s => (0, chai_1.expect)(s).to.be.a('string')); + }); + return done(); + }).catch(done); + }); + it('Gempa Now', done => { + (0, index_js_1.gempaNow)().then(res => { + (0, chai_1.expect)(res).to.be.an('array'); + res.forEach(({ date, latitude, longitude, magnitude, depth, location }) => { + (0, chai_1.expect)(date).to.be.a('string'); + (0, chai_1.expect)(latitude).to.be.a('string'); + (0, chai_1.expect)(longitude).to.be.a('string'); + (0, chai_1.expect)(magnitude).to.be.a('string'); + (0, chai_1.expect)(depth).to.be.a('string'); + (0, chai_1.expect)(location).to.be.a('string'); + }); + return done(); + }).catch(done); + }); + }); + it('Tsunami', (done) => { + (0, index_js_1.tsunami)().then(res => { + (0, chai_1.expect)(res).to.be.an('array'); + res.forEach(({ date, locate, magnitude, depth, location }) => { + (0, chai_1.expect)(date).to.be.a('string'); + (0, chai_1.expect)(locate).to.be.a('string'); + (0, chai_1.expect)(magnitude).to.be.a('string'); + (0, chai_1.expect)(depth).to.be.a('string'); + (0, chai_1.expect)(location).to.be.a('string'); + }); + return done(); + }).catch(done); + }); + describe('Lyrics', () => { + it('Lyrics', done => { + (0, index_js_1.lyrics)('rick astley never gonna give you up').then(res => { + (0, chai_1.expect)(res).to.be.an('object'); + (0, chai_1.expect)(res.title).to.be.a('string'); + (0, chai_1.expect)(res.author).to.be.a('string'); + (0, chai_1.expect)(res.lyrics).to.be.a('string'); + (0, chai_1.expect)(res.link).to.be.a('string'); + return done(); + }).catch(done); + }); + // it('Lyrics V2', done => { + // lyricsv2('never gonna give you up').then(res => { + // expect(res.title).to.be.a('string') + // expect(res.author).to.be.a('string') + // expect(res.lyrics).to.be.a('string') + // expect(res.link).to.be.a('string') + // return done() + // }).catch(done) + // }) + }); + it('KBBI', done => { + (0, index_js_1.kbbi)('halo').then(res => { + (0, chai_1.expect)(res).to.be.an('array'); + res.forEach(({ index, title, means }) => { + (0, chai_1.expect)(index).to.be.a('number'); + (0, chai_1.expect)(title).to.be.a('string'); + (0, chai_1.expect)(means).to.be.an('array'); + means.forEach((mean) => (0, chai_1.expect)(mean).to.be.a('string')); + }); + return done(); + }).catch(done); + }); + it('ID Free Fire', done => { + (0, index_js_1.nameFreeFire)('821587717').then(res => { + (0, chai_1.expect)(res).to.be.an('object'); + (0, chai_1.expect)(res.username).to.be.a('string'); + (0, chai_1.expect)(res.id).to.be.a('string'); + return done(); + }).catch(done); + }); + describe('Bioskop', () => { + it('Bioskop now', done => { + (0, index_js_1.bioskopNow)().then(res => { + (0, chai_1.expect)(res).to.be.an('array'); + (0, chai_1.expect)(res).to.have.lengthOf.at.least(1); + res.forEach(({ title, img, url, genre, duration, playingAt }) => { + (0, chai_1.expect)(title).to.be.a('string'); + (0, chai_1.expect)(img).to.be.a('string'); + (0, chai_1.expect)(url).to.be.a('string'); + (0, chai_1.expect)(genre).to.be.a('string'); + (0, chai_1.expect)(duration).to.be.a('string'); + (0, chai_1.expect)(playingAt).to.be.a('string'); + }); + return done(); + }).catch(done); + }); + it('Bioskop', done => { + (0, index_js_1.bioskop)().then(res => { + (0, chai_1.expect)(res).to.be.an('array'); + (0, chai_1.expect)(res).to.have.lengthOf.at.least(1); + res.forEach(({ title, img, url, genre, duration, release, director, cast }) => { + (0, chai_1.expect)(title).to.be.a('string'); + (0, chai_1.expect)(img).to.be.a('string'); + (0, chai_1.expect)(url).to.be.a('string'); + (0, chai_1.expect)(genre).to.be.a('string'); + (0, chai_1.expect)(duration).to.be.a('string'); + (0, chai_1.expect)(release).to.be.a('string'); + (0, chai_1.expect)(director).to.be.a('string'); + (0, chai_1.expect)(cast).to.be.an('string'); + }); + return done(); + }).catch(done); + }); + }); +}); +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/cjs/others/test.js.map b/node_modules/@bochilteam/scraper/lib/cjs/others/test.js.map new file mode 100644 index 000000000..4d411fa59 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/cjs/others/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["../../../src/others/test.ts"],"names":[],"mappings":";;AAAA,+BAA6B;AAC7B,yCAgBmB;AAEnB,QAAQ,CAAC,QAAQ,EAAE,GAAG,EAAE;IACtB,OAAO;IACP,QAAQ,CAAC,WAAW,EAAE,GAAG,EAAE;QACzB,iCAAiC;QACjC,8DAA8D;QAC9D,yCAAyC;QACzC,2CAA2C;QAC3C,6CAA6C;QAC7C,oDAAoD;QACpD,wDAAwD;QACxD,iDAAiD;QACjD,oDAAoD;QACpD,uDAAuD;QACvD,uDAAuD;QACvD,iDAAiD;QACjD,qDAAqD;QACrD,yDAAyD;QACzD,gDAAgD;QAEhD,wBAAwB;QACxB,qBAAqB;QACrB,KAAK;IACP,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,WAAW,EAAE,CAAC,IAAI,EAAE,EAAE;QACvB,IAAA,oBAAS,EAAC,WAAW,EAAE,IAAI,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE;YACtC,IAAA,aAAM,EAAC,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAA;YAC9B,IAAA,aAAM,EAAC,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAA;YACnC,IA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CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAA;oBACjC,IAAA,aAAM,EAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAA;oBAClC,IAAA,aAAM,EAAC,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAA;gBACjC,CAAC,CAAC,CAAA;gBAEF,OAAO,IAAI,EAAE,CAAA;YACf,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;QAChB,CAAC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/cjs/others/types.js b/node_modules/@bochilteam/scraper/lib/cjs/others/types.js new file mode 100644 index 000000000..11e638d1e --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/cjs/others/types.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=types.js.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/cjs/others/types.js.map b/node_modules/@bochilteam/scraper/lib/cjs/others/types.js.map new file mode 100644 index 000000000..7cd07dffb --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/cjs/others/types.js.map @@ -0,0 +1 @@ +{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/others/types.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/cjs/others/wikipedia.js b/node_modules/@bochilteam/scraper/lib/cjs/others/wikipedia.js new file mode 100644 index 000000000..7daa2e0be --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/cjs/others/wikipedia.js @@ -0,0 +1,96 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const cheerio_1 = __importDefault(require("cheerio")); +const got_1 = __importDefault(require("got")); +const utils_js_1 = require("../utils.js"); +async function wikipedia(query, lang = 'id') { + const html = await getHtml(lang, query); + const $ = cheerio_1.default.load(html); + const title = $('#firstHeading > i').text().trim(); + const img = getImgLink($('td.infobox-image > a.image > img[src]').attr('src')); + const articles = []; + let end = false; + let start = false; + $('#mw-content-text > div.mw-parser-output') + .children() + .map(function () { + if (/p|h[2-4]|div/.test(this.name) && !end) { + let text = ''; + const h = /h[2-4]/.test(this.name); + const div = /div/.test(this.name); + const el = $(this); + if (h && + /referen|Примечания|Notes_et_références/i.test(el.find('span.mw-headline').attr('id'))) { + return (end = true); + } + const math = $(this).find('span.mwe-math-element'); + if (math.length) { + math.replaceWith($(`${math + .text() + .trim() + .replace(/(.*displaystyle.*|\\n)/, '')}`)); + } + if (div && + el.hasClass('thumb') && + el.find('div.thumbinner > a > img[src]').length) { + text = getImgLink(el.find('div.thumbinner > a > img[src]').attr('src')); + } + else if (div && el.find('div > ol > li[id]').length) { + el.find('div > ol > li[id]').each(function () { + text += $(this).text().trim() + '\n'; + }); + } + else + text = el.text().trim(); + if (!start && this.name === 'p' && !end && text) + start = true; + if (text && start && !el.find('div > ul > li').length) { + articles.push((h ? '\n' : '') + text); + } + } + return true; + }); + return { + title, + img, + articles: articles.join('\n\n') + }; +} +exports.default = wikipedia; +function isSupportLang(lang) { + return ['en', 'id'].includes(lang); +} +async function getHtml(lang, query) { + query = encodeURIComponent(query.trim()); + const defaultLink = `https://${isSupportLang(lang) ? lang : 'id'}.wikipedia.org`; + let res = await (0, got_1.default)(defaultLink + '/wiki/' + query); + if (!(res.statusCode === 404)) + return res.body; + const link = `${defaultLink}/w/index.php?${lang === 'id' + ? `title=Istimewa:Pencarian&search=${query}&fulltext=1&ns0=1` + : `search=${query}&title=Special:Search&profile=advanced&fulltext=1&ns0=1`}`; + res = await (0, got_1.default)(link); + const html = res.body; + const $ = cheerio_1.default.load(html); + const results = []; + $('ul.mw-search-results > li.mw-search-result').each(function () { + var _a; + const link = (_a = $(this) + .find('div.mw-search-result-heading > a[href]') + .attr('href')) === null || _a === void 0 ? void 0 : _a.trim(); + if (link) + results.push(encodeURI(link)); + }); + if (results[0]) + return (await (0, got_1.default)(defaultLink + results[0])).body; + throw new utils_js_1.ScraperError('404 Not Found!!'); +} +function getImgLink(link = '') { + if (!/https:/i.test(link)) + link = encodeURI('https:' + link); + return link; +} +//# sourceMappingURL=wikipedia.js.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/cjs/others/wikipedia.js.map b/node_modules/@bochilteam/scraper/lib/cjs/others/wikipedia.js.map new file mode 100644 index 000000000..89fbb1e16 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/cjs/others/wikipedia.js.map @@ -0,0 +1 @@ +{"version":3,"file":"wikipedia.js","sourceRoot":"","sources":["../../../src/others/wikipedia.ts"],"names":[],"mappings":";;;;;AAAA,sDAA6B;AAC7B,8CAAqB;AACrB,0CAA0C;AAG3B,KAAK,UAAU,SAAS,CACrC,KAAa,EACb,OAAoB,IAAI;IAExB,MAAM,IAAI,GAAG,MAAM,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC,CAAA;IACvC,MAAM,CAAC,GAAG,iBAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IAC5B,MAAM,KAAK,GAAG,CAAC,CAAC,mBAAmB,CAAC,CAAC,IAAI,EAAE,CAAC,IAAI,EAAE,CAAA;IAClD,MAAM,GAAG,GAAG,UAAU,CAAC,CAAC,CAAC,uCAAuC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAA;IAC9E,MAAM,QAAQ,GAAa,EAAE,CAAA;IAC7B,IAAI,GAAG,GAAG,KAAK,CAAA;IACf,IAAI,KAAK,GAAG,KAAK,CAAA;IACjB,CAAC,CAAC,yCAAyC,CAAC;SACzC,QAAQ,EAAE;SACV,GAAG,CAAC;QACH,IAAI,cAAc,CAAC,IAAI,CAAC,IAAI,CA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,IAAI;QACpD,CAAC,CAAC,mCAAmC,KAAK,mBAAmB;QAC7D,CAAC,CAAC,UAAU,KAAK,yDACnB,EAAE,CAAA;IACJ,GAAG,GAAG,MAAM,IAAA,aAAG,EAAC,IAAI,CAAC,CAAA;IACrB,MAAM,IAAI,GAAG,GAAG,CAAC,IAAI,CAAA;IACrB,MAAM,CAAC,GAAG,iBAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IAC5B,MAAM,OAAO,GAAa,EAAE,CAAA;IAC5B,CAAC,CAAC,4CAA4C,CAAC,CAAC,IAAI,CAAC;;QACnD,MAAM,IAAI,GAAG,MAAA,CAAC,CAAC,IAAI,CAAC;aACjB,IAAI,CAAC,wCAAwC,CAAC;aAC9C,IAAI,CAAC,MAAM,CAAC,0CACX,IAAI,EAAE,CAAA;QACV,IAAI,IAAI;YAAE,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAA;IACzC,CAAC,CAAC,CAAA;IACF,IAAI,OAAO,CAAC,CAAC,CAAC;QAAE,OAAO,CAAC,MAAM,IAAA,aAAG,EAAC,WAAW,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAA;IACjE,MAAM,IAAI,uBAAY,CAAC,iBAAiB,CAAC,CAAA;AAC3C,CAAC;AAED,SAAS,UAAU,CAAE,OAAe,EAAE;IACpC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC;QAAE,IAAI,GAAG,SAAS,CAAC,QAAQ,GAAG,IAAI,CAAC,CAAA;IAC5D,OAAO,IAAI,CAAA;AACb,CAAC"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/cjs/package.json b/node_modules/@bochilteam/scraper/lib/cjs/package.json new file mode 100644 index 000000000..c9a442261 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/cjs/package.json @@ -0,0 +1,3 @@ +{ + "type": "commonjs" +} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/cjs/primbons/artimimpi.js b/node_modules/@bochilteam/scraper/lib/cjs/primbons/artimimpi.js new file mode 100644 index 000000000..a8326ffdd --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/cjs/primbons/artimimpi.js @@ -0,0 +1,15 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const got_1 = __importDefault(require("got")); +async function artimimpi(mimpi) { + var _a, _b, _c, _d, _e; + const data = await (0, got_1.default)(`https://www.primbon.com/tafsir_mimpi.php?mimpi=${mimpi}&submit=+Submit+`).text(); + const results = (_e = (_d = (_c = (_b = (_a = data + .split('


')[1]) === null || _a === void 0 ? void 0 : _a.split('')[0]) === null || _b === void 0 ? void 0 : _b.replace(/<(\/)?font( color=#ff0000)?>/gi, '')) === null || _c === void 0 ? void 0 : _c.trim()) === null || _d === void 0 ? void 0 : _d.split('

')) === null || _e === void 0 ? void 0 : _e.filter((v) => v); + return results || []; +} +exports.default = artimimpi; +//# sourceMappingURL=artimimpi.js.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/cjs/primbons/artimimpi.js.map b/node_modules/@bochilteam/scraper/lib/cjs/primbons/artimimpi.js.map new file mode 100644 index 000000000..bd819b158 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/cjs/primbons/artimimpi.js.map @@ -0,0 +1 @@ +{"version":3,"file":"artimimpi.js","sourceRoot":"","sources":["../../../src/primbons/artimimpi.ts"],"names":[],"mappings":";;;;;AAAA,8CAAqB;AACN,KAAK,UAAU,SAAS,CAAE,KAAa;;IACpD,MAAM,IAAI,GAAG,MAAM,IAAA,aAAG,EACtB,kDAAkD,KAAK,kBAAkB,CACxE,CAAC,IAAI,EAAE,CAAA;IACR,MAAM,OAAO,GAAoB,MAAA,MAAA,MAAA,MAAA,MAAA,IAAI;SAClC,KAAK,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC,0CAC3B,KAAK,CAAC,8BAA8B,EAAE,CAAC,CAAC,0CACxC,OAAO,CAAC,gCAAgC,EAAE,EAAE,CAAC,0CAC7C,IAAI,EAAE,0CACN,KAAK,CAAC,UAAU,CAAC,0CACjB,MAAM,CAAC,CAAC,CAAS,EAAE,EAAE,CAAC,CAAC,CAAC,CAAA;IAC5B,OAAO,OAAO,IAAI,EAAE,CAAA;AACtB,CAAC;AAZD,4BAYC"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/cjs/primbons/artinama.js b/node_modules/@bochilteam/scraper/lib/cjs/primbons/artinama.js new file mode 100644 index 000000000..ec33f9dad --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/cjs/primbons/artinama.js @@ -0,0 +1,15 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const got_1 = __importDefault(require("got")); +async function artinama(nama) { + var _a, _b, _c; + const data = await (0, got_1.default)(`https://www.primbon.com/arti_nama.php?nama1=${nama}&proses=+Submit%21+`).text(); + const results = (_c = (_b = (_a = data + .split('

ARTI NAMA


')[1]) === null || _a === void 0 ? void 0 : _a.split('')[0]) === null || _b === void 0 ? void 0 : _b.replace(/<(\/)?(h1|br|i|b)>/gim, '')) === null || _c === void 0 ? void 0 : _c.trim(); + return results || ''; +} +exports.default = artinama; +//# sourceMappingURL=artinama.js.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/cjs/primbons/artinama.js.map b/node_modules/@bochilteam/scraper/lib/cjs/primbons/artinama.js.map new file mode 100644 index 000000000..54a7953e8 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/cjs/primbons/artinama.js.map @@ -0,0 +1 @@ +{"version":3,"file":"artinama.js","sourceRoot":"","sources":["../../../src/primbons/artinama.ts"],"names":[],"mappings":";;;;;AAAA,8CAAqB;AACN,KAAK,UAAU,QAAQ,CAAE,IAAY;;IAClD,MAAM,IAAI,GAAG,MAAM,IAAA,aAAG,EACtB,+CAA+C,IAAI,qBAAqB,CACvE,CAAC,IAAI,EAAE,CAAA;IACR,MAAM,OAAO,GAAkB,MAAA,MAAA,MAAA,IAAI;SAChC,KAAK,CAAC,wBAAwB,CAAC,CAAC,CAAC,CAAC,0CACjC,KAAK,CAAC,SAAS,EAAE,CAAC,CAAC,0CACnB,OAAO,CAAC,uBAAuB,EAAE,EAAE,CAAC,0CACpC,IAAI,EAAE,CAAA;IACV,OAAO,OAAO,IAAI,EAAE,CAAA;AACtB,CAAC;AAVD,2BAUC"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/cjs/primbons/index.js b/node_modules/@bochilteam/scraper/lib/cjs/primbons/index.js new file mode 100644 index 000000000..4ca03fa94 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/cjs/primbons/index.js @@ -0,0 +1,15 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getZodiac = exports.nomorhoki = exports.artimimpi = exports.artinama = void 0; +const artimimpi_js_1 = __importDefault(require("./artimimpi.js")); +exports.artimimpi = artimimpi_js_1.default; +const artinama_js_1 = __importDefault(require("./artinama.js")); +exports.artinama = artinama_js_1.default; +const nomorhoki_js_1 = __importDefault(require("./nomorhoki.js")); +exports.nomorhoki = nomorhoki_js_1.default; +const zodiac_js_1 = __importDefault(require("./zodiac.js")); +exports.getZodiac = zodiac_js_1.default; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/cjs/primbons/index.js.map b/node_modules/@bochilteam/scraper/lib/cjs/primbons/index.js.map new file mode 100644 index 000000000..7e17e6c05 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/cjs/primbons/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/primbons/index.ts"],"names":[],"mappings":";;;;;;AAAA,kEAAsC;AAKnB,oBALZ,sBAAS,CAKY;AAJ5B,gEAAoC;AAI3B,mBAJF,qBAAQ,CAIE;AAHjB,kEAAsC;AAGR,oBAHvB,sBAAS,CAGuB;AAFvC,4DAAmC;AAEM,oBAFlC,mBAAS,CAEkC"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/cjs/primbons/nomorhoki.js b/node_modules/@bochilteam/scraper/lib/cjs/primbons/nomorhoki.js new file mode 100644 index 000000000..5bfab890c --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/cjs/primbons/nomorhoki.js @@ -0,0 +1,60 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const got_1 = __importDefault(require("got")); +const utils_js_1 = require("../utils.js"); +async function nomorhoki(nomer) { + var _a, _b, _c, _d; + const config = { + nomer: encodeURIComponent(nomer), + submit: '+Submit!+' + }; + const data = await got_1.default + .post('https://www.primbon.com/no_hoki_bagua_shuzi.php', { + headers: { + 'content-type': 'application/x-www-form-urlencoded' + }, + form: config + }) + .text(); + const results = data + .split('
No. HP : ${nomer}
`)[1]; + const angka_bagua_shuzi = parseInt((_b = (_a = results === null || results === void 0 ? void 0 : results.split('Angka Bagua Shuzi :')[1]) === null || _a === void 0 ? void 0 : _a.split('

')[0]) === null || _b === void 0 ? void 0 : _b.replace(/%/gi, '')); + if (!angka_bagua_shuzi) + throw new utils_js_1.ScraperError(`Can't get data, maybe your number(${nomer}) invalid!`); + const kekayaan = parseInt(results.split('Kekayaan =')[1].split('
')[0]); + const kesehatan = parseInt(results.split('Kesehatan =')[1].split('
')[0]); + const cinta = parseInt(results.split('Cinta/Relasi =')[1].split('
')[0]); + const kestabilan = parseInt(results.split('Kestabilan =')[1].split('
')[0]); + const positif = parseInt((_c = results + .split('
')[0] + .split('b>% = ')[1]) === null || _c === void 0 ? void 0 : _c.replace(/%/gi, '')); + const perselisihan = parseInt(results.split('Perselisihan =')[1].split('
')[0]); + const kehilangan = parseInt(results.split('Kehilangan =')[1].split('
')[0]); + const malapetaka = parseInt(results.split('Malapetaka =')[1].split('
')[0]); + const Kehancuran = parseInt(results.split('Kehancuran =')[1].split('
')[0]); + const negatif = parseInt((_d = results.split('Kehancuran =')[1].split('% =')[1]) === null || _d === void 0 ? void 0 : _d.replace(/%/gi, '')); + return { + nomer: nomer, + angka_bagua_shuzi, + positif: { + kekayaan, + kesehatan, + cinta, + kestabilan, + positif + }, + negatif: { + perselisihan, + kehilangan, + malapetaka, + Kehancuran, + negatif + } + }; +} +exports.default = nomorhoki; +//# sourceMappingURL=nomorhoki.js.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/cjs/primbons/nomorhoki.js.map b/node_modules/@bochilteam/scraper/lib/cjs/primbons/nomorhoki.js.map new file mode 100644 index 000000000..ed8fbc823 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/cjs/primbons/nomorhoki.js.map @@ -0,0 +1 @@ +{"version":3,"file":"nomorhoki.js","sourceRoot":"","sources":["../../../src/primbons/nomorhoki.ts"],"names":[],"mappings":";;;;;AAAA,8CAAqB;AACrB,0CAA0C;AAI3B,KAAK,UAAU,SAAS,CACrC,KAAsB;;IAEtB,MAAM,MAAM,GAAG;QACb,KAAK,EAAE,kBAAkB,CAAC,KAAK,CAAC;QAChC,MAAM,EAAE,WAAW;KACpB,CAAA;IACD,MAAM,IAAI,GAAG,MAAM,aAAG;SACnB,IAAI,CAAC,iDAAiD,EAAE;QACvD,OAAO,EAAE;YACP,cAAc,EAAE,mCAAmC;SACpD;QACD,IAAI,EAAE,MAAM;KACb,CAAC;SACD,IAAI,EAAE,CAAA;IACT,MAAM,OAAO,GAAW,IAAI;SACzB,KAAK,CAAC,2BAA2B,CAAC,CAAC,CAAC,CAAC;SACrC,KAAK,CAAC,mBAAmB,KAAK,UAAU,CAAC,CAAC,CAAC,CAAC,CAAA;IA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KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CACpD,CAAA;IACD,MAAM,UAAU,GAAW,QAAQ,CACjC,OAAO,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAClD,CAAA;IACD,MAAM,UAAU,GAAW,QAAQ,CACjC,OAAO,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAClD,CAAA;IACD,MAAM,UAAU,GAAW,QAAQ,CACjC,OAAO,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAClD,CAAA;IACD,MAAM,OAAO,GAAW,QAAQ,CAC9B,MAAA,OAAO,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,0CAAE,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC,CAC3E,CAAA;IACD,OAAO;QACL,KAAK,EAAE,KAAK;QACZ,iBAAiB;QACjB,OAAO,EAAE;YACP,QAAQ;YACR,SAAS;YACT,KAAK;YACL,UAAU;YACV,OAAO;SACR;QACD,OAAO,EAAE;YACP,YAAY;YACZ,UAAU;YACV,UAAU;YACV,UAAU;YACV,OAAO;SACR;KACF,CAAA;AACH,CAAC;AA5ED,4BA4EC"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/cjs/primbons/test.js b/node_modules/@bochilteam/scraper/lib/cjs/primbons/test.js new file mode 100644 index 000000000..96a8f0e8b --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/cjs/primbons/test.js @@ -0,0 +1,48 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const chai_1 = require("chai"); +const index_js_1 = require("./index.js"); +describe('Primbon', () => { + it('ArtiMimpi', done => { + (0, index_js_1.artimimpi)('Jalan').then(res => { + (0, chai_1.expect)(res).to.be.an('array'); + res.forEach(v => (0, chai_1.expect)(v).to.be.a('string')); + return done(); + }).catch(done); + }); + it('ArtiNama', done => { + (0, index_js_1.artinama)('Windah basudara').then(res => { + (0, chai_1.expect)(res).to.be.a('string'); + return done(); + }).catch(done); + }); + it('NomorHoki', done => { + (0, index_js_1.nomorhoki)(6213353).then(res => { + (0, chai_1.expect)(res).to.be.an('Object'); + (0, chai_1.expect)(res).to.haveOwnProperty('nomer'); + (0, chai_1.expect)(res.angka_bagua_shuzi).to.be.a('number'); + (0, chai_1.expect)(res.positif.kekayaan).to.be.a('number'); + (0, chai_1.expect)(res.positif.kesehatan).to.be.a('number'); + (0, chai_1.expect)(res.positif.cinta).to.be.a('number'); + (0, chai_1.expect)(res.positif.kestabilan).to.be.a('number'); + (0, chai_1.expect)(res.positif.positif).to.be.a('number'); + (0, chai_1.expect)(res.negatif.perselisihan).to.be.a('number'); + (0, chai_1.expect)(res.negatif.kehilangan).to.be.a('number'); + (0, chai_1.expect)(res.negatif.malapetaka).to.be.a('number'); + (0, chai_1.expect)(res.negatif.Kehancuran).to.be.a('number'); + (0, chai_1.expect)(res.negatif.negatif).to.be.a('number'); + return done(); + }).catch(done); + }); + it('Zodiac', done => { + try { + const res = (0, index_js_1.getZodiac)(1, 1); + (0, chai_1.expect)(res).equal('capricorn'); + return done(); + } + catch (e) { + return done(); + } + }); +}); +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/cjs/primbons/test.js.map b/node_modules/@bochilteam/scraper/lib/cjs/primbons/test.js.map new file mode 100644 index 000000000..f697221a7 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/cjs/primbons/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["../../../src/primbons/test.ts"],"names":[],"mappings":";;AAAA,+BAA6B;AAC7B,yCAKmB;AAEnB,Q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AC,QAAQ,CAAC,CAAA;YAE7C,OAAO,IAAI,EAAE,CAAA;QACf,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;IAChB,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,QAAQ,EAAE,IAAI,CAAC,EAAE;QAClB,IAAI;YACF,MAAM,GAAG,GAAG,IAAA,oBAAS,EAAC,CAAC,EAAE,CAAC,CAAC,CAAA;YAC3B,IAAA,aAAM,EAAC,GAAG,CAAC,CAAC,KAAK,CAAC,WAAW,CAAC,CAAA;YAE9B,OAAO,IAAI,EAAE,CAAA;SACd;QAAC,OAAO,CAAC,EAAE;YACV,OAAO,IAAI,EAAE,CAAA;SACd;IACH,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/cjs/primbons/types.js b/node_modules/@bochilteam/scraper/lib/cjs/primbons/types.js new file mode 100644 index 000000000..11e638d1e --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/cjs/primbons/types.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=types.js.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/cjs/primbons/types.js.map b/node_modules/@bochilteam/scraper/lib/cjs/primbons/types.js.map new file mode 100644 index 000000000..89d01c590 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/cjs/primbons/types.js.map @@ -0,0 +1 @@ +{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/primbons/types.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/cjs/primbons/zodiac.js b/node_modules/@bochilteam/scraper/lib/cjs/primbons/zodiac.js new file mode 100644 index 000000000..0d2f75bf2 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/cjs/primbons/zodiac.js @@ -0,0 +1,25 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +function getZodiac(months, dates) { + var _a; + // https://github.com/Nurutomo/wabot-aq/blob/master/plugins/zodiac.js + const d = new Date(1970, months - 1, dates + 1); + // https://www.primbon.com/zodiak.htm + const zodiac = [ + ['capricorn', new Date(1970, 0, 21)], + ['aquarius', new Date(1970, 1, 20)], + ['pisces', new Date(1970, 2, 21)], + ['aries', new Date(1970, 3, 20)], + ['taurus', new Date(1970, 4, 21)], + ['gemini', new Date(1970, 5, 22)], + ['cancer', new Date(1970, 6, 23)], + ['leo', new Date(1970, 7, 24)], + ['virgo', new Date(1970, 8, 23)], + ['libra', new Date(1970, 9, 24)], + ['scorpio', new Date(1970, 10, 23)], + ['sagitarius', new Date(1970, 11, 22)] // SAGITARIUS (23 November - 21 Desember) + ]; + return (_a = zodiac.find(([_, _d]) => _d >= d)) === null || _a === void 0 ? void 0 : _a[0]; +} +exports.default = getZodiac; +//# sourceMappingURL=zodiac.js.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/cjs/primbons/zodiac.js.map b/node_modules/@bochilteam/scraper/lib/cjs/primbons/zodiac.js.map new file mode 100644 index 000000000..742a05d0c --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/cjs/primbons/zodiac.js.map @@ -0,0 +1 @@ +{"version":3,"file":"zodiac.js","sourceRoot":"","sources":["../../../src/primbons/zodiac.ts"],"names":[],"mappings":";;AAEA,SAAwB,SAAS,CAAE,MAAc,EAAE,KAAa;;IAC9D,qEAAqE;IACrE,MAAM,CAAC,GAAG,IAAI,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,CAAC,EAAE,KAAK,GAAG,CAAC,CAAC,CAAA;IAC/C,qCAAqC;IACrC,MAAM,MAAM,GAAqB;QAC/B,CAAC,WAAW,EAAE,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;QACpC,CAAC,UAAU,EAAE,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;QACnC,CAAC,QAAQ,EAAE,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;QACjC,CAAC,OAAO,EAAE,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;QAChC,CAAC,QAAQ,EAAE,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;QACjC,CAAC,QAAQ,EAAE,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;QACjC,CAAC,QAAQ,EAAE,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;QACjC,CAAC,KAAK,EAAE,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;QAC9B,CAAC,OAAO,EAAE,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;QAChC,CAAC,OAAO,EAAE,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;QAChC,CAAC,SAAS,EAAE,IAAI,IAAI,CAAC,IAAI,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC;QACnC,CAAC,YAAY,EAAE,IAAI,IAAI,CAAC,IAAI,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC,yCAAyC;KACjF,CAAA;IACD,OAAO,MAAA,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,CAAiB,EAAE,EAAE,CAAC,EAAE,IAAI,CAAC,CAAC,0CAAG,CAAC,CAAW,CAAA;AACzE,CAAC;AAnBD,4BAmBC"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/cjs/religions/alquran.js b/node_modules/@bochilteam/scraper/lib/cjs/religions/alquran.js new file mode 100644 index 000000000..5fb92d9e4 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/cjs/religions/alquran.js @@ -0,0 +1,13 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.alquran = void 0; +const got_1 = __importDefault(require("got")); +async function alquran() { + const data = await (0, got_1.default)('https://raw.githubusercontent.com/rzkytmgr/quran-api/master/data/quran.json').json(); + return data; +} +exports.alquran = alquran; +//# sourceMappingURL=alquran.js.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/cjs/religions/alquran.js.map b/node_modules/@bochilteam/scraper/lib/cjs/religions/alquran.js.map new file mode 100644 index 000000000..53149a961 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/cjs/religions/alquran.js.map @@ -0,0 +1 @@ +{"version":3,"file":"alquran.js","sourceRoot":"","sources":["../../../src/religions/alquran.ts"],"names":[],"mappings":";;;;;;AAAA,8CAAqB;AAGd,KAAK,UAAU,OAAO;IAC3B,MAAM,IAAI,GAAc,MAAM,IAAA,aAAG,EAC/B,6EAA6E,CAC9E,CAAC,IAAI,EAAE,CAAA;IACR,OAAO,IAAI,CAAA;AACb,CAAC;AALD,0BAKC"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/cjs/religions/asmaulhusna.js b/node_modules/@bochilteam/scraper/lib/cjs/religions/asmaulhusna.js new file mode 100644 index 000000000..bd4d01c91 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/cjs/religions/asmaulhusna.js @@ -0,0 +1,15 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.asmaulhusnajson = void 0; +const got_1 = __importDefault(require("got")); +async function asmaulhusna() { + if (!exports.asmaulhusnajson) { + exports.asmaulhusnajson = await (0, got_1.default)('https://raw.githubusercontent.com/BochilTeam/database/master/religi/asmaulhusna.json').json(); + } + return exports.asmaulhusnajson[Math.floor(Math.random() * exports.asmaulhusnajson.length)]; +} +exports.default = asmaulhusna; +//# sourceMappingURL=asmaulhusna.js.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/cjs/religions/asmaulhusna.js.map b/node_modules/@bochilteam/scraper/lib/cjs/religions/asmaulhusna.js.map new file mode 100644 index 000000000..3ff953cd3 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/cjs/religions/asmaulhusna.js.map @@ -0,0 +1 @@ +{"version":3,"file":"asmaulhusna.js","sourceRoot":"","sources":["../../../src/religions/asmaulhusna.ts"],"names":[],"mappings":";;;;;;AAAA,8CAAqB;AAIN,KAAK,UAAU,WAAW;IACvC,IAAI,CAAC,uBAAe,EAAE;QACpB,uBAAe,GAAG,MAAM,IAAA,aAAG,EACzB,sFAAsF,CACvF,CAAC,IAAI,EAAE,CAAA;KACT;IACD,OAAO,uBAAe,CACpB,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,uBAAe,CAAC,MAAM,CAAC,CACpC,CAAA;AAClB,CAAC;AATD,8BASC"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/cjs/religions/index.js b/node_modules/@bochilteam/scraper/lib/cjs/religions/index.js new file mode 100644 index 000000000..d88c0e717 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/cjs/religions/index.js @@ -0,0 +1,37 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.listJadwalSholat = exports.jadwalsholat = exports.asmaulhusnajson = exports.asmaulhusna = void 0; +const asmaulhusna_js_1 = __importStar(require("./asmaulhusna.js")); +exports.asmaulhusna = asmaulhusna_js_1.default; +Object.defineProperty(exports, "asmaulhusnajson", { enumerable: true, get: function () { return asmaulhusna_js_1.asmaulhusnajson; } }); +const jadwalsholat_js_1 = __importStar(require("./jadwalsholat.js")); +exports.jadwalsholat = jadwalsholat_js_1.default; +Object.defineProperty(exports, "listJadwalSholat", { enumerable: true, get: function () { return jadwalsholat_js_1.listJadwalSholat; } }); +__exportStar(require("./alquran.js"), exports); +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/cjs/religions/index.js.map b/node_modules/@bochilteam/scraper/lib/cjs/religions/index.js.map new file mode 100644 index 000000000..ab65d9948 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/cjs/religions/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/religions/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,mEAA+D;AAItD,sBAJF,wBAAW,CAIE;AAAE,gGAJA,gCAAe,OAIA;AAHrC,qEAAkE;AAG3B,uBAHhC,yBAAY,CAGgC;AAAE,iGAH9B,kCAAgB,OAG8B;AADrE,+CAA4B"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/cjs/religions/jadwalsholat.js b/node_modules/@bochilteam/scraper/lib/cjs/religions/jadwalsholat.js new file mode 100644 index 000000000..eeae2c551 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/cjs/religions/jadwalsholat.js @@ -0,0 +1,63 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.listJadwalSholat = void 0; +const cheerio_1 = __importDefault(require("cheerio")); +const got_1 = __importDefault(require("got")); +const utils_js_1 = require("../utils.js"); +exports.listJadwalSholat = (async () => (0, got_1.default)('https://raw.githubusercontent.com/BochilTeam/scraper/master/data/jadwal-sholat.json').json())(); +async function jadwalsholat(kota) { + const listJadwal = await exports.listJadwalSholat; + let jadwal; + if (!(jadwal = listJadwal.find(({ kota: Kota }) => new RegExp(Kota, 'ig').test(kota)))) { + throw new utils_js_1.ScraperError('List kota ' + listJadwal.map(({ kota }) => kota)); + } + const today = await (0, got_1.default)(`https://www.jadwalsholat.org/adzan/ajax/ajax.daily1.php?id=${jadwal.value}`).text(); + const sholatToday = {}; + const $ = cheerio_1.default.load(today); + $('table > tbody > tr') + .filter('.table_light, .table_dark') + .each(function () { + const el = $(this).find('td'); + const sholat = el.eq(0).text(); + const time = el.eq(1).text(); + sholatToday[sholat] = time; + }); + const data = await (0, got_1.default)(`https://jadwalsholat.org/jadwal-sholat/monthly.php?id=${jadwal.value}`).text(); + const list = []; + const $$ = cheerio_1.default.load(data); + $$('table.table_adzan > tbody > tr') + .filter('.table_light, .table_dark') + .each(function () { + const el = $$(this).find('td'); + const date = el.eq(0).text().trim(); + const imsyak = el.eq(1).text().trim(); + const shubuh = el.eq(2).text().trim(); + const terbit = el.eq(3).text().trim(); + const dhuha = el.eq(4).text().trim(); + const dzuhur = el.eq(5).text().trim(); + const ashr = el.eq(6).text().trim(); + const magrib = el.eq(7).text().trim(); + const isyak = el.eq(8).text().trim(); + list.push({ + date, + imsyak, + shubuh, + terbit, + dhuha, + dzuhur, + ashr, + magrib, + isyak + }); + }); + return { + date: $$('tr.table_title > td > h2.h2_edit').text().trim(), + today: sholatToday, + list + }; +} +exports.default = jadwalsholat; +//# sourceMappingURL=jadwalsholat.js.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/cjs/religions/jadwalsholat.js.map b/node_modules/@bochilteam/scraper/lib/cjs/religions/jadwalsholat.js.map new file mode 100644 index 000000000..b7b4669f2 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/cjs/religions/jadwalsholat.js.map @@ -0,0 +1 @@ +{"version":3,"file":"jadwalsholat.js","sourceRoot":"","sources":["../../../src/religions/jadwalsholat.ts"],"names":[],"mappings":";;;;;;AAAA,sDAA6B;AAC7B,8CAAqB;AACrB,0CAA0C;AAI7B,QAAA,gBAAgB,GAAgC,CAAC,KAAK,IAAI,EAAE,CAAC,IAAA,aAAG,EAAC,qFAAqF,CAAC,CAAC,IAAI,EAAsB,CAAC,EAAE,CAAA;AACnL,KAAK,UAAU,YAAY,CACxC,IAAY;IAEZ,MAAM,UAAU,GAAuB,MAAM,wBAAgB,CAAA;IAC7D,IAAI,MAAoC,CAAA;IACxC,IACE,CAAC,CAAC,MAAM,GAAG,UAAU,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,EAAE,CAC5C,IAAI,MAAM,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAClC,CAAC,EACF;QACA,MAAM,IAAI,uBAAY,CACpB,YAAY,GAAG,UAAU,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,IAAI,CAAC,CAClD,CAAA;KACF;IACD,MAAM,KAAK,GAAG,MAAM,IAAA,aAAG,EACvB,8DAA8D,MAAM,CAAC,KAAK,EAAE,CAC3E,CAAC,IAAI,EAAE,CAAA;IACR,MAAM,WAAW,GAA0B,EAAE,CAAA;IAC7C,MAAM,CAAC,GAAG,iBAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;IAC7B,CAAC,CAAC,oBAAoB,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,CAAC,CAAC,IAAI,EAAE,CAAC,IAAI,EAAE,CAAA;QACpC,MAAM,MAAM,GAAG,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,IAAI,EAAE,CAAA;QACrC,MAAM,IAAI,GAAG,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,IAAI,EAAE,CAAA;QACnC,MAAM,MAAM,GAAG,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,IAAI,EAAE,CAAA;QACrC,MAAM,KAAK,GAAG,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,IAAI,EAAE,CAAA;QACpC,IAAI,CAAC,IAAI,CAAC;YACR,IAAI;YACJ,MAAM;YACN,MAAM;YACN,MAAM;YACN,KAAK;YACL,MAAM;YACN,IAAI;YACJ,MAAM;YACN,KAAK;SACN,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;IACJ,OAAO;QACL,IAAI,EAAE,EAAE,CAAC,kCAAkC,CAAC,CAAC,IAAI,EAAE,CAAC,IAAI,EAAE;QAC1D,KAAK,EAAE,WAAW;QAClB,IAAI;KACL,CAAA;AACH,CAAC;AA9DD,+BA8DC"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/cjs/religions/test.js b/node_modules/@bochilteam/scraper/lib/cjs/religions/test.js new file mode 100644 index 000000000..9a004b39a --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/cjs/religions/test.js @@ -0,0 +1,52 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const chai_1 = require("chai"); +const index_js_1 = require("./index.js"); +describe('Religions', () => { + describe('Asmaul Husna', () => { + it('AsmaulHusna', done => { + (0, index_js_1.asmaulhusna)().then(res => { + (0, chai_1.expect)(res).to.be.an('object'); + (0, chai_1.expect)(res.index).to.be.a('number'); + (0, chai_1.expect)(res.latin).to.be.a('string'); + (0, chai_1.expect)(res.arabic).to.be.a('string'); + (0, chai_1.expect)(res.translation_id).to.be.a('string'); + (0, chai_1.expect)(res.translation_en).to.be.a('string'); + return done(); + }).catch(done); + }); + it('AsmaulHusna JSON', done => { + const res = index_js_1.asmaulhusnajson; + (0, chai_1.expect)(res).to.be.an('array'); + (0, chai_1.expect)(res).to.have.length(99); + return done(); + }); + }); + describe('Al quran', () => { + it('Alquran', done => { + (0, index_js_1.alquran)().then(res => { + (0, chai_1.expect)(res).to.have.length(114); + return done(); + }).catch(done); + }); + }); + describe('Jadwal Sholat', () => { + it('jadwalSholat', done => { + (0, index_js_1.jadwalsholat)('Semarang').then(res => { + (0, chai_1.expect)(res).to.be.an('object'); + (0, chai_1.expect)(res.today).to.be.an('object'); + (0, chai_1.expect)(res.list).to.be.an('array'); + (0, chai_1.expect)(res.list).to.have.lengthOf.at.least(27); + return done(); + }).catch(done); + }); + it('List jadwal sholat', done => { + Promise.resolve(index_js_1.listJadwalSholat).then(res => { + (0, chai_1.expect)(res).to.be.an('array'); + (0, chai_1.expect)(res).to.have.lengthOf.at.least(316); + return done(); + }).catch(done); + }); + }); +}); +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/cjs/religions/test.js.map b/node_modules/@bochilteam/scraper/lib/cjs/religions/test.js.map new file mode 100644 index 000000000..ea74b9b5f --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/cjs/religions/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["../../../src/religions/test.ts"],"names":[],"mappings":";;AAAA,+BAA6B;AAC7B,yCAImB;AAEnB,QAAQ,CAAC,WAAW,EAAE,GAAG,EAAE;IACzB,QAAQ,CAAC,cAAc,EAAE,GAAG,EAAE;QAC5B,EAAE,CAAC,aAAa,EAAE,IAAI,CAAC,EAAE;YACvB,IAAA,sBAAW,GAAE,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE;gBACvB,IAAA,aAAM,EAAC,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M,EAAC,GAAG,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;gBAC1C,OAAO,IAAI,EAAE,CAAA;YACf,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;QAChB,CAAC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/cjs/religions/types.js b/node_modules/@bochilteam/scraper/lib/cjs/religions/types.js new file mode 100644 index 000000000..11e638d1e --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/cjs/religions/types.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=types.js.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/cjs/religions/types.js.map b/node_modules/@bochilteam/scraper/lib/cjs/religions/types.js.map new file mode 100644 index 000000000..685a8071f --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/cjs/religions/types.js.map @@ -0,0 +1 @@ +{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/religions/types.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/cjs/social-media/aiovideodl.js b/node_modules/@bochilteam/scraper/lib/cjs/social-media/aiovideodl.js new file mode 100644 index 000000000..a3eb99361 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/cjs/social-media/aiovideodl.js @@ -0,0 +1,30 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const got_1 = __importDefault(require("got")); +const cheerio_1 = require("cheerio"); +async function aiovideodl(url) { + var _a; + const resToken = await (0, got_1.default)('https://aiovideodl.ml/'); + const cookie = (_a = resToken.headers['set-cookie']) === null || _a === void 0 ? void 0 : _a.map(v => v.split(';')[0]).join('; ').trim(); + const $$ = (0, cheerio_1.load)(resToken.body); + const token = $$('#token').val(); + const body = new URLSearchParams(); + body.append('url', url); + body.append('token', token); + return await (0, got_1.default)('https://aiovideodl.ml/wp-json/aio-dl/video-data/', { + method: 'post', + headers: { + 'content-type': 'application/x-www-form-urlencoded', + cookie: cookie || 'pll_language=en; _ga=GA1.2.946338805.1646539824; PHPSESSID=f5ec5a6eb553bf3a55508ad4ce2ed200; _gid=GA1.2.425279475.1647856193; _gat_gtag_UA_46116261_21=1', + origin: 'https://aiovideodl.ml', + referer: 'https://aiovideodl.ml/', + 'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.74 Safari/537.36' + }, + body: body.toString() + }).json(); +} +exports.default = aiovideodl; +//# sourceMappingURL=aiovideodl.js.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/cjs/social-media/aiovideodl.js.map b/node_modules/@bochilteam/scraper/lib/cjs/social-media/aiovideodl.js.map new file mode 100644 index 000000000..e3f805306 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/cjs/social-media/aiovideodl.js.map @@ -0,0 +1 @@ +{"version":3,"file":"aiovideodl.js","sourceRoot":"","sources":["../../../src/social-media/aiovideodl.ts"],"names":[],"mappings":";;;;;AAAA,8CAAqB;AACrB,qCAA8B;AAIf,KAAK,UAAU,UAAU,CAAE,GAAW;;IACnD,MAAM,QAAQ,GAAG,MAAM,IAAA,aAAG,EAAC,wBAAwB,CAAC,CAAA;IACpD,MAAM,MAAM,GAAG,MAAA,QAAQ,CAAC,OAAO,CAAC,YAAY,CAAC,0CAAE,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,IAAI,EAAE,IAAI,EAAE,CAAA;IAC1F,MAAM,EAAE,GAAG,IAAA,cAAI,EAAC,QAAQ,CAAC,IAAI,CAAC,CAAA;IAC9B,MAAM,KAAK,GAAG,EAAE,CAAC,QAAQ,CAAC,CAAC,GAAG,EAAY,CAAA;IAC1C,MAAM,IAAI,GAAG,IAAI,eAAe,EAAE,CAAA;IAClC,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,GAAG,CAAC,CAAA;IACvB,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,KAAK,CAAC,CAAA;IAC3B,OAAO,MAAM,IAAA,aAAG,EAAC,kDAAkD,EAAE;QACnE,MAAM,EAAE,MAAM;QACd,OAAO,EAAE;YACP,cAAc,EAAE,mCAAmC;YACnD,MAAM,EAAE,MAAM,IAAI,0JAA0J;YAC5K,MAAM,EAAE,uBAAuB;YAC/B,OAAO,EAAE,wBAAwB;YACjC,YAAY,EAAE,oHAAoH;SACnI;QACD,IAAI,EAAE,IAAI,CAAC,QAAQ,EAAE;KACtB,CAAC,CAAC,IAAI,EAAc,CAAA;AACvB,CAAC;AAnBD,6BAmBC"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/cjs/social-media/facebook.js b/node_modules/@bochilteam/scraper/lib/cjs/social-media/facebook.js new file mode 100644 index 000000000..dbe658f2e --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/cjs/social-media/facebook.js @@ -0,0 +1,155 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.facebookdlv3 = exports.facebookdlv2 = exports.facebookdl = void 0; +const cheerio_1 = __importDefault(require("cheerio")); +const got_1 = __importDefault(require("got")); +const crypto_js_1 = require("../encryptions/crypto.js"); +const utils_js_1 = require("../utils.js"); +// only support download video yet +async function facebookdl(url) { + /* eslint no-mixed-spaces-and-tabs: ["error", "smart-tabs"] */ + const { data: { id, thumbnail, duration, a, av, v } } = await (0, got_1.default)('https://youtube4kdownloader.com/ajax/getLinks.php', { + headers: { + 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.110 Safari/537.36' + }, + searchParams: { + video: url, + rand: (0, crypto_js_1.randomBytes)(13) + } + }).json(); + const result = (a || []) + .concat(av) + .concat(v) + .map(({ size, ext, url, quality, vcodec, fid }) => { + const isVideo = ext === 'mp4'; + const isWebm = ext === 'webm'; + return { + size, + ext, + url, + quality, + vcodec, + fid, + isVideo: isVideo || isWebm, + isAudio: /audio/i.test(quality || '') || (isVideo && !isWebm) + }; + // ext webm video without audio + }); + if (!result.length) + throw new utils_js_1.ScraperError(`Can't download!\n${JSON.stringify({ id, thumbnail, duration, a, av, v }, null, 2)}`); + return { + id, + thumbnail, + duration, + result + }; +} +exports.facebookdl = facebookdl; +async function facebookdlv2(url) { + var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l; + const params = { + url: encodeURI(url) + }; + const res = await got_1.default + .post('https://snapsave.app/action.php', { + headers: { + accept: 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9', + 'accept-encoding': 'gzip, deflate, br', + 'accept-language': 'en-US,en;q=0.9', + 'content-type': 'application/x-www-form-urlencoded', + origin: 'https://snapsave.app', + referer: 'https://snapsave.app/', + 'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML,like Gecko) Chrome/96.0.4664.110 Safari/537.36' + }, + form: params + }).text(); + const decodeParams = (_b = (_a = res.split('))')[0] + .split('decodeURIComponent(escape(r))}(')[1]) === null || _a === void 0 ? void 0 : _a.split(',')) === null || _b === void 0 ? void 0 : _b.map(v => v.replace(/^"/, '') + .replace(/"$/, '').trim()); + let html; + if (!Array.isArray(decodeParams) || decodeParams.length !== 6) + html = (_c = (typeof res === 'string' ? JSON.parse(res) : res)) === null || _c === void 0 ? void 0 : _c.data; + else { + const decode = (0, utils_js_1.decodeSnapApp)(...decodeParams); + html = (_j = (_h = (_g = (_f = (_e = (_d = decode === null || decode === void 0 ? void 0 : decode.split('("download-section").innerHTML = "')[1]) === null || _d === void 0 ? void 0 : _d.split('; parent.document.getElementById("inputData").remove();')[0]) === null || _e === void 0 ? void 0 : _e.split('
')) === null || _f === void 0 ? void 0 : _f.slice(1)) === null || _g === void 0 ? void 0 : _g.map(v => (v + '">').trim()).join()) === null || _h === void 0 ? void 0 : _h.split('
tbody > tr').each(function () { + var _a, _b; + const el = $(this).find('td'); + if (/tidak|no/i.test(el.eq(1).text())) { + const quality = (_b = (_a = el.eq(0).text().split('(')) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.trim(); + const url = el.eq(2).find('a[href]').attr('href'); + if (url) + result.push({ quality, url }); + } + }); + if (!result.length) + throw new utils_js_1.ScraperError(`Can't download!\n${$.html()}`); + return { + id: ((_l = (_k = $('div.media-content > div.content > p > strong') + .text() + .split('#')) === null || _k === void 0 ? void 0 : _k[1]) === null || _l === void 0 ? void 0 : _l.trim()) || '', + title: $('div.media-content > div.content > p > strong').text(), + description: $('div.media-content > div.content > p > span.video-des').text(), + thumbnail: $('figure > p.image > img[src]').attr('src'), + result + }; +} +exports.facebookdlv2 = facebookdlv2; +async function facebookdlv3(url) { + var _a; + const payload = { + url + }; + const text = await (0, got_1.default)('https://www.getfvid.com/downloader', { + method: 'POST', + headers: { + accept: 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9', + 'accept-encoding': 'gzip, deflate, br', + 'accept-language': 'en-US,en;q=0.9', + 'content-type': 'application/x-www-form-urlencoded', + cookie: '_ga=GA1.2.887753826.1642391325; _gid=GA1.2.2022692773.1642391325; __gads=ID=4ea88e3817c8d71b-22332defffcf0045:T=1642391326:RT=1642391326:S=ALNI_MY3oJyiEG_b8KXZBJ7RqvN2Mn8wbw; XSRF-TOKEN=eyJpdiI6ImdNUElWWU83S01jOTdZeitCUWdkWXc9PSIsInZhbHVlIjoiTGxnaE9oRVJTKzA5NDBncUtBa0xEdCtqNHBJXC9ZMVFPR1U2RnBSYUFzZHltWElZS2VtVUltUTJ2TjB5V3pEeTYzRUNMcENjMURGSkhBXC9OUitpcjMrZz09IiwibWFjIjoiMTViZTNjZDI3ZTZmOTk2ZWRjOWM1NTA5MTU2NDFhYWFlMjIxNTQxZTJlYjliMjJiMzE3YzlkNGMxODc2NjhmMCJ9; laravel_session=eyJpdiI6IjhZbElIRmpLSkVqZGZpQXJoK2MzVHc9PSIsInZhbHVlIjoianBSSFhPb2t0RFY4Q1wvYkk1S3pxMUNxXC82b0U1NHZROTVpS1Z4dGhES3ZTYTNsenJUSXpwcWNMVDkwWFk4OUY1TitGNmlDK1RXbTVyREVzcHVoRnRidz09IiwibWFjIjoiY2U1YzI2ODZlYWI2NzFkZDU1NTQ5Zjk0M2NmMDc2MTZhY2M3ODQxYjljZGUzMDQwMTYxZGQwZGYxMDM3NDMyZSJ9; __cf_bm=ephRNXRqwgrTB4SmHlsudy886EfsR2Ns2KtXVBnph4I-1642392732-0-AXtTUW5HRNQUeUcTJPhJTOPlMcjBFmMyoLKYOnxrDZ6Fa06XaJ4pMNW9arLg4zco/ef+ji00IV8NZb0nGOAKgfg=; _gat=1; __atuvc=6%7C3; __atuvs=61e4e71d2b803588005; __atssc=google%3B3', + origin: 'https://www.getfvid.com', + referer: 'https://www.getfvid.com/', + 'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36' + }, + form: payload + }).text(); + const $ = cheerio_1.default.load(text); + const row = $('div.card > div.row > div'); + const thumbnail = (_a = /background-image: url\((.*?)\);/i.exec(row.eq(0).find('a[href]').attr('style'))) === null || _a === void 0 ? void 0 : _a[1]; + const result = []; + row.find('.btns-download > p > a[href]').each(function () { + var _a; + const el = $(this); + const url = el.attr('href'); + const info = el.text().trim(); + const isAudio = /audio/i.test(info); + const quality = isAudio ? 'audio' : (_a = /Download in (\w+) Quality/i.exec(info)) === null || _a === void 0 ? void 0 : _a[1]; + const isVideo = quality !== 'audio'; + if (url) { + result.push({ + url, + quality, + isAudio, + isVideo + }); + } + }); + if (!result.length) + throw new utils_js_1.ScraperError(`Can't download!\n${$.html()}`); + return { + title: $('#title_video').val(), + thumbnail, + result + }; +} +exports.facebookdlv3 = facebookdlv3; +//# sourceMappingURL=facebook.js.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/cjs/social-media/facebook.js.map b/node_modules/@bochilteam/scraper/lib/cjs/social-media/facebook.js.map new file mode 100644 index 000000000..b4906a988 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/cjs/social-media/facebook.js.map @@ -0,0 +1 @@ +{"version":3,"file":"facebook.js","sourceRoot":"","sources":["../../../src/social-media/facebook.ts"],"names":[],"mappings":";;;;;;AAAA,sDAA6B;AAC7B,8CAAqB;AACrB,wDAAsD;AACtD,0CAGoB;AAiBpB,kCAAkC;AAC3B,KAAK,UAAU,UAAU,CAAE,GAAW;IAC3C,8DAA8D;IAC9D,MAAM,EACJ,IAAI,EAAE,EAAE,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAC5C,GASG,MAAM,IAAA,aAAG,EAAC,mDAAmD,EAAE;QACjE,OAAO,EAAE;YACP,YAAY,EACV,qHAAqH;SACxH;QACD,YAAY,EAAE;YACZ,KAAK,EAAE,GAAG;YACV,IAAI,EAAE,IAAA,uBAAW,EAAC,EAAE,CAAC;SACtB;KACF,CAAC,CAAC,IAAI,EAAE,CAAA;IACT,MAAM,MAAM,GAAiC,CAAC,CAAC,IAAI,EAAE,CAAC;SACnD,MAAM,CAAC,EAAE,CAAC;SACV,MAAM,CAAC,CAAC,CAAC;SACT,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,EAAE,GAA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O,CAAC,CAAC,CAAC,MAAA,4BAA4B,CAAC,IAAI,CAAC,IAAI,CAAC,0CAAG,CAAC,CAAC,CAAA;QAChF,MAAM,OAAO,GAAG,OAAO,KAAK,OAAO,CAAA;QACnC,IAAI,GAAG,EAAE;YACP,MAAM,CAAC,IAAI,CAAC;gBACV,GAAG;gBACH,OAAO;gBACP,OAAO;gBACP,OAAO;aACR,CAAC,CAAA;SACH;IACH,CAAC,CAAC,CAAA;IACF,IAAI,CAAC,MAAM,CAAC,MAAM;QAAE,MAAM,IAAI,uBAAY,CAAC,oBAAoB,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAA;IAC1E,OAAO;QACL,KAAK,EAAE,CAAC,CAAC,cAAc,CAAC,CAAC,GAAG,EAAY;QACxC,SAAS;QACT,MAAM;KACP,CAAA;AACH,CAAC;AA9CD,oCA8CC"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/cjs/social-media/google-it.js b/node_modules/@bochilteam/scraper/lib/cjs/social-media/google-it.js new file mode 100644 index 000000000..f506b9321 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/cjs/social-media/google-it.js @@ -0,0 +1,66 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.googleIt = void 0; +const cheerio_1 = __importDefault(require("cheerio")); +const got_1 = __importDefault(require("got")); +async function googleIt(query) { + const body = await (0, got_1.default)('https://www.google.com/search', { + searchParams: { + q: query + }, + headers: { + 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.110 Safari/537.36' + } + }).text(); + const $ = cheerio_1.default.load(body); + const infoEl = $('div.I6TXqe > div.osrp-blk'); + const info = { + title: infoEl.find('h2.qrShPb > span').text().trim(), + type: infoEl.find('div.SPZz6b > div.wwUB2c > span').text().trim(), + description: '', + image: [] + }; + infoEl + .find('div.LuVEUc > div.UDZeY > div.wDYxhc[data-attrid]:not(.NFQFxe)') + .each(function () { + const desc = $(this).text().trim(); + if (desc) + info.description += desc + '\n'; + }); + infoEl + .find('div[jscontroller=M0hWhd] > div[jscontroller=ABJeBb] > div.eA0Zlc[jsname=dTDiAc]') + .each(function () { + var _a, _b; + const img = (_a = $(this) + .find('a > g-img.BA0A6c > img.rISBZc') + .attr('src')) === null || _a === void 0 ? void 0 : _a.trim(); // you can make buffer using function fromBase64ToString + if (img) + (_b = info.image) === null || _b === void 0 ? void 0 : _b.push(img); + }); + info.image = [...new Set(info.image)]; + const articles = []; + $('div.tF2Cxc').each(function () { + const el = $(this); + const header = el.find('cite.iUh30').text(); + const title = el.find('div.yuRUbf > a > h3').text(); + const url = el.find('div.yuRUbf > a[href]').attr('href'); + const description = el.find('div.VwiC3b > span').text() || el.find('div.VwiC3b').text(); + if (el.length && url) { + articles.push({ + header: header, + title: title, + url, + description: description + }); + } + }); + return { + info, + articles + }; +} +exports.googleIt = googleIt; +//# sourceMappingURL=google-it.js.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/cjs/social-media/google-it.js.map b/node_modules/@bochilteam/scraper/lib/cjs/social-media/google-it.js.map new file mode 100644 index 000000000..5a8b60058 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/cjs/social-media/google-it.js.map @@ -0,0 +1 @@ +{"version":3,"file":"google-it.js","sourceRoot":"","sources":["../../../src/social-media/google-it.ts"],"names":[],"mappings":";;;;;;AAAA,sDAA6B;AAC7B,8CAAqB;AAGd,KAAK,UAAU,QAAQ,CAAE,KAAa;IAC3C,MAAM,IAAI,GAAG,MAAM,IAAA,aAAG,EAAC,+BAA+B,EAAE;QACtD,YAAY,EAAE;YACZ,CAAC,EAAE,KAAK;SACT;QACD,OAAO,EAAE;YACP,YAAY,EACd,qHAAqH;SACpH;KACF,CAAC,CAAC,IAAI,EAAE,CAAA;IACT,MAAM,CAAC,GAAG,iBAAO,CAA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AAC,IAAI,EAAE,CAAA;QAC3C,MAAM,KAAK,GAAG,EAAE,CAAC,IAAI,CAAC,qBAAqB,CAAC,CAAC,IAAI,EAAE,CAAA;QACnD,MAAM,GAAG,GAAG,EAAE,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;QACxD,MAAM,WAAW,GAClB,EAAE,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,IAAI,EAAE,CAAA;QAClE,IAAI,EAAE,CAAC,MAAM,IAAI,GAAG,EAAE;YACpB,QAAQ,CAAC,IAAI,CAAC;gBACZ,MAAM,EAAE,MAAM;gBACd,KAAK,EAAE,KAAK;gBACZ,GAAG;gBACH,WAAW,EAAE,WAAW;aACzB,CAAC,CAAA;SACH;IACH,CAAC,CAAC,CAAA;IACF,OAAO;QACL,IAAI;QACJ,QAAQ;KACT,CAAA;AACH,CAAC;AAzDD,4BAyDC"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/cjs/social-media/groupWA.js b/node_modules/@bochilteam/scraper/lib/cjs/social-media/groupWA.js new file mode 100644 index 000000000..10b67e15e --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/cjs/social-media/groupWA.js @@ -0,0 +1,29 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.groupWA = void 0; +const got_1 = __importDefault(require("got")); +const cheerio_1 = __importDefault(require("cheerio")); +async function groupWA(query) { + const html = await (0, got_1.default)(`http://ngarang.com/link-grup-wa/daftar-link-grup-wa.php?search=${encodeURIComponent(query).replace(/%20/g, '+')}&searchby=name`).text(); + const $ = cheerio_1.default.load(html); + const results = []; + $('div.entry > div.wa-chat').each((_, el) => { + const $el = $(el); + const $a = $el.find('a'); + const url = $a.find('div.wa-chat-title-container > a').attr('href') || + $el.find('div.wa-chat-message > a.URLMessage').attr('href'); + const subject = $el.find('div.wa-chat-title-text').text().trim(); + if (url) { + results.push({ + url, + subject + }); + } + }); + return results; +} +exports.groupWA = groupWA; +//# sourceMappingURL=groupWA.js.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/cjs/social-media/groupWA.js.map b/node_modules/@bochilteam/scraper/lib/cjs/social-media/groupWA.js.map new file mode 100644 index 000000000..e046d370e --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/cjs/social-media/groupWA.js.map @@ -0,0 +1 @@ +{"version":3,"file":"groupWA.js","sourceRoot":"","sources":["../../../src/social-media/groupWA.ts"],"names":[],"mappings":";;;;;;AAAA,8CAAqB;AACrB,sDAA6B;AAGtB,KAAK,UAAU,OAAO,CAAE,KAAa;IAC1C,MAAM,IAAI,GAAG,MAAM,IAAA,aAAG,EACpB,kEAAkE,kBAAkB,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,gBAAgB,CACjI,CAAC,IAAI,EAAE,CAAA;IACR,MAAM,CAAC,GAAG,iBAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IAC5B,MAAM,OAAO,GAAc,EAAE,CAAA;IAC7B,CAAC,CAAC,yBAAyB,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE;QAC1C,MAAM,GAAG,GAAG,CAAC,CAAC,EAAE,CAAC,CAAA;QACjB,MAAM,EAAE,GAAG,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;QACxB,MAAM,GAAG,GAAG,EAAE,CAAC,IAAI,CAAC,iCAAiC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC;YACjE,GAAG,CAAC,IAAI,CAAC,oCAAoC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;QAC7D,MAAM,OAAO,GAAG,GAAG,CAAC,IAAI,CAAC,wBAAwB,CAAC,CAAC,IAAI,EAAE,CAAC,IAAI,EAAE,CAAA;QAChE,IAAI,GAAG,EAAE;YACP,OAAO,CAAC,IAAI,CAAC;gBACX,GAAG;gBACH,OAAO;aACR,CAAC,CAAA;SACH;IACH,CAAC,CAAC,CAAA;IACF,OAAO,OAAO,CAAA;AAChB,CAAC;AApBD,0BAoBC"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/cjs/social-media/index.js b/node_modules/@bochilteam/scraper/lib/cjs/social-media/index.js new file mode 100644 index 000000000..93ee0a969 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/cjs/social-media/index.js @@ -0,0 +1,35 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.savefrom = exports.aiovideodl = exports.groupWA = exports.youtubeSearch = void 0; +const youtube_search_js_1 = __importDefault(require("./youtube-search.js")); +exports.youtubeSearch = youtube_search_js_1.default; +const groupWA_js_1 = require("./groupWA.js"); +Object.defineProperty(exports, "groupWA", { enumerable: true, get: function () { return groupWA_js_1.groupWA; } }); +const aiovideodl_js_1 = __importDefault(require("./aiovideodl.js")); +exports.aiovideodl = aiovideodl_js_1.default; +const savefrom_js_1 = __importDefault(require("./savefrom.js")); +exports.savefrom = savefrom_js_1.default; +__exportStar(require("./facebook.js"), exports); +__exportStar(require("./google-it.js"), exports); +__exportStar(require("./instagram.js"), exports); +__exportStar(require("./tiktok.js"), exports); +__exportStar(require("./twitter.js"), exports); +__exportStar(require("./youtube.js"), exports); +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/cjs/social-media/index.js.map b/node_modules/@bochilteam/scraper/lib/cjs/social-media/index.js.map new file mode 100644 index 000000000..f0a4fd15c --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/cjs/social-media/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/social-media/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA,4EAA+C;AAa7C,wBAbK,2BAAa,CAaL;AAZf,6CAAsC;AAapC,wFAbO,oBAAO,OAaP;AAZT,oEAAwC;AAatC,qBAbK,uBAAU,CAaL;AAZZ,gEAAoC;AAalC,mBAbK,qBAAQ,CAaL;AAXV,gDAA6B;AAC7B,iDAA8B;AAC9B,iDAA8B;AAC9B,8CAA2B;AAC3B,+CAA4B;AAC5B,+CAA4B"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/cjs/social-media/instagram.js b/node_modules/@bochilteam/scraper/lib/cjs/social-media/instagram.js new file mode 100644 index 000000000..d55b6f1b5 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/cjs/social-media/instagram.js @@ -0,0 +1,391 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.instagramStalk = exports.instagramStoryv2 = exports.instagramStory = exports.instagramdlv4 = exports.instagramdlv3 = exports.instagramdlv2 = exports.instagramdl = void 0; +/* eslint-disable no-mixed-spaces-and-tabs */ +const cheerio_1 = __importDefault(require("cheerio")); +const got_1 = __importDefault(require("got")); +const utils_js_1 = require("../utils.js"); +const form_data_1 = __importDefault(require("form-data")); +async function instagramdl(url) { + var _a, _b, _c; + if (!/https?:\/\/www\.instagram\.com\/(reel|tv|p)\//i.test(url)) { + throw new utils_js_1.ScraperError('Invalid url!!'); + } + const data = await got_1.default + .post('https://snapinsta.app/action.php', { + form: { + url: encodeURI(url), + action: 'post' + }, + headers: { + 'content-type': 'application/x-www-form-urlencoded', + origin: 'https://snapinsta.app', + referer: 'https://snapinsta.app/', + 'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.93 Safari/537.36' + } + }) + .text(); + const params = (_a = data.split('))')[0] + .split('decodeURIComponent(escape(r))}(')[1]) === null || _a === void 0 ? void 0 : _a.split(',').map(v => v.replace(/^"/, '') + .replace(/"$/, '').trim()); + if (!Array.isArray(params) || params.length !== 6) + throw new utils_js_1.ScraperError(`Can't parse decode parameters!\n${data}`); + const decode = (0, utils_js_1.decodeSnapApp)(...params); + const html = (_c = (_b = decode === null || decode === void 0 ? void 0 : decode.split('("div_download").innerHTML = "')) === null || _b === void 0 ? void 0 : _b[1].split('"; parent.document.getElementById("hero-section").remove();')[0].split('
')[1]) === null || _c === void 0 ? void 0 : _c.split('
')[0].replace(/\\(\\)?/g, ''); + const $ = cheerio_1.default.load(html); + const results = []; + $('.row.download-box > div.col-md-4').each(function () { + let thumbnail = $(this) + .find('.download-items__thumb > img[src]') + .attr('src'); + if (!/https?:\/\//i.test(thumbnail)) + thumbnail = 'https://snapinsta.app' + thumbnail; + let url = $(this).find('.download-items__btn > a[href]').attr('href'); + if (!/https?:\/\//i.test(url || '')) { + url = encodeURI('https://snapinsta.app' + url); + } + if (url) + results.push({ thumbnail, url }); + }); + if (!results.length) + throw new utils_js_1.ScraperError(`Can't download!\n${decode}`); + return results; +} +exports.instagramdl = instagramdl; +async function instagramdlv2(url) { + if (!/https?:\/\/www\.instagram\.com\/(reel|tv|p)\//i.test(url)) { + throw new utils_js_1.ScraperError('Invalid url!!'); + } + const payload = { + url: url, + submit: ' ' + }; + const data = await got_1.default + .post('https://downloadgram.org/', { + form: payload, + headers: { + 'content-type': 'application/x-www-form-urlencoded', + cookie: '_ga=GA1.2.654346005.1642149344; _gid=GA1.2.1562255413.1642149344; _gat_gtag_UA_142480840_1=1; __atuvc=1%7C2; __atuvs=61e135df10258fab000; __gads=ID=b4c9d2019034e5ed-227b64f3e5cf003a:T=1642149344:RT=1642149344:S=ALNI_MbtRULwcpAb_-lCLCSUPN5m5rd54A', + origin: 'https://downloadgram.org', + referer: 'https://downloadgram.org/', + 'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.110 Safari/537.36' + } + }) + .text(); + const $ = cheerio_1.default.load(data); + let results = []; + if ($('#downloadBox > a').length) { + const temp = []; + $('#downloadBox > video').each(function (i) { + const thumbnail = $(this).attr('poster'); + const sourceUrl = $(this).find('source[src]').attr('src'); + if (thumbnail) { + temp.push({ + thumbnail, + sourceUrl, + index: i + }); + } + }); + $('#downloadBox > img').each(function (i) { + const j = temp.findIndex(({ index }) => index === i); + const thumbnail = $(this).attr('src'); + if (thumbnail) { + if (j !== -1) + temp[j].thumbnail = thumbnail; + else + temp.push({ thumbnail, index: i }); + } + }); + $('#downloadBox > a').each(function (i) { + const j = temp.findIndex(({ index }) => index === i); + const url = $(this).attr('href'); + if (j !== -1) + temp[j].url = url; + else + temp.push({ url, index: i }); + }); + results = temp.map((tmp) => ({ + thumbnail: tmp.thumbnail, + sourceUrl: tmp.sourceUrl, + url: tmp.url + })); + } + if (!results.length) + throw new utils_js_1.ScraperError(`Can't download!\n${$.html()}`); + return results; +} +exports.instagramdlv2 = instagramdlv2; +async function instagramdlv3(url) { + const payload = { + link: url, + submit: '' + }; + const headers = { + 'content-type': 'application/x-www-form-urlencoded', + origin: 'https://instasave.website', + referer: 'https://instasave.website/', + 'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36' + }; + const body = await (0, got_1.default)('https://instasave.website/', { + form: payload, + method: 'POST', + headers: headers + }).catch(async (_) => await (0, got_1.default)('https://server.instasave.website/', { + form: payload, + method: 'POST', + headers: { + ...headers, + origin: 'https://server.instasave.website', + referer: 'https://server.instasave.website' + } + })); + const $ = cheerio_1.default.load(body.body); + let results = []; + if ($('#downloadBox > a').length) { + const temp = []; + $('#downloadBox > video').each(function (i) { + const thumbnail = $(this).attr('poster'); + const sourceUrl = $(this).find('source[src]').attr('src'); + if (thumbnail) { + temp.push({ + thumbnail, + sourceUrl, + index: i + }); + } + }); + $('#downloadBox > img').each(function (i) { + const j = temp.findIndex(({ index }) => index === i); + const thumbnail = $(this).attr('src'); + if (thumbnail) { + if (j !== -1) + temp[j].thumbnail = thumbnail; + else + temp.push({ thumbnail, index: i }); + } + }); + $('#downloadBox > a').each(function (i) { + const j = temp.findIndex(({ index }) => index === i); + const url = $(this).attr('href'); + if (j !== -1) + temp[j].url = url; + else + temp.push({ url, index: i }); + }); + results = temp.map((tmp) => ({ + thumbnail: tmp.thumbnail, + sourceUrl: tmp.sourceUrl, + url: tmp.url + })); + } + if (!results.length) + throw new utils_js_1.ScraperError(`Can't download!\n${$.html()}`); + return results; +} +exports.instagramdlv3 = instagramdlv3; +async function instagramdlv4(url) { + var _a, _b; + const payload = { + url: encodeURIComponent(url) + }; + const data = await (0, got_1.default)('https://instadownloader.co/insta_downloader.php', { + headers: { + cookie: '_ga=GA1.2.1733350350.1642305936; __gads=ID=b4bd840227b997e8-22bf10a0f9cf00c8:T=1642305940:RT=1642305940:S=ALNI_MYAmf2IjxwGlzs5qXm4WFoP5pgocg; PHPSESSID=336eed35f823c84f35a580ae2f326934; _gid=GA1.2.1286454531.1646479747; _gat=1', + referer: 'https://instadownloader.co/id/', + 'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36' + }, + searchParams: payload + }).json(); + const json = JSON.parse(data); + if (!(((_a = json.images_links) === null || _a === void 0 ? void 0 : _a.length) || ((_b = json.videos_links) === null || _b === void 0 ? void 0 : _b.length))) + throw new utils_js_1.ScraperError(`Can't download!\n${JSON.stringify(json, null, 2)}`); + return [ + ...json.images_links, + ...json.videos_links + ]; +} +exports.instagramdlv4 = instagramdlv4; +// export async function instagramdlv5 (url: string): Promise { +// const json: { +// url: { +// url: string; +// name: string; +// type: string; +// ext: string; +// }[]; +// meta: { +// title: string; +// source: string; +// } +// thumb: string; +// [Key: string]: any +// } = await got('https://api.savefrom.biz/api/convert', { +// method: 'POST', +// headers: { +// 'content-type': 'application/json', +// origin: 'https://savefrom.biz', +// referer: 'https://savefrom.biz/', +// 'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.102 Safari/537.36' +// }, +// json: { +// url +// } +// }).json() +// return json.url.map(({ url, ext }) => ({ +// url: `https://savefrom.biz${encodeURIComponent(url)}`, +// ext +// })) as InstagramDownloaderV5[] +// } +async function instagramStory(name) { + var _a; + const resKey = await (0, got_1.default)('https://storydownloader.app/en'); + const $$ = cheerio_1.default.load(resKey.body); + const _token = $$('input[name="_token"]').attr('value'); + const cookie = (_a = resKey.headers['set-cookie']) === null || _a === void 0 ? void 0 : _a.map(v => v.split('; ')[0]).join('; ').trim(); + const headers = { + accept: 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9', + cookie: cookie || 'locale=eyJpdiI6IjE5VUJqZm1DdXl3ODhoQnV2SHJaMFE9PSIsInZhbHVlIjoiUnBqZTMvbDFUTWZLWVkvQy9rVjVhOUdrbjRWTVRCYmp2aTVaUlVsUnZZY0RWN2ZoVkdjMVNhemM1MFl6eWt2dCIsIm1hYyI6IjdlMTc4ZDZkMTYyMDVmMTcwZTc5Nzg3YTBjM2ZkOWEyNjRlODZmZDIwOGY5OTgyYzQzZjE3YTY3MjQ2NGNlYzQiLCJ0YWciOiIifQ%3D%3D; _ga_ZXS0LB5VTY=GS1.1.1647856609.1.0.1647856609.0; _ga=GA1.1.1392191220.1647856609; XSRF-TOKEN=eyJpdiI6IkhjVVdRMmRSZ0tOaklvUHlncWxqeVE9PSIsInZhbHVlIjoiTkZLTnFmUnpjM0Y0KzF3NmpxNnMyMTJQWmNPRXFPVjlKQW9la3poN3kySEN4UUw0TUd3TGIzZ0plT2RUWXJGTEp1bzF1NkN2R3FrQkdLbmJpa0o4cUZUM2EzS2N4QTY2aGVKdFM0ZWNhclZBQVBhMDV1cm4vcEZFMVB5NXRLL1UiLCJtYWMiOiI4MjQ1ZDJhYWE2NjQ1MGUyMmY5ZmQ0OTlkMDFhNjZjOWE2MGVjMTRlNmFjN2VjMmNkYzA0OGY5OTRkMDY3MjI3IiwidGFnIjoiIn0%3D; laravel_session=eyJpdiI6IjQ2RHJ3TUtRU1gxblhpbGtsNXRqamc9PSIsInZhbHVlIjoiTFl2bTg5QVhxcHBkZUN2THRPYkxhbnBmWEkyaWdBc0RFbDM0eUhhbGY0RCs2NFFmRXQ2NXBaNktUMkVpYk9wcDF2SE11SUQ0bW9zazJYaUdLQVZFbjJTaXZ3MmREUEJURnczb1c4ZE5uNDJzTVprNytjNzVCT3loS1ovKysyR1oiLCJtYWMiOiIzOTAyMDc5MDg1N2UxZjgwYmExODcwMjQ2ZWQzNGJjODM3YzkxOTI2MTkwMTEzMTFjNjExN2IzZjdkMmY0ODI4IiwidGFnIjoiIn0%3D', + origin: 'https://storydownloader.app', + referer: 'https://storydownloader.app/en', + 'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.102 Safari/537.36', + 'X-CSRF-TOKEN': _token + }; + const formData = new form_data_1.default(); + formData.append('username', name); + formData.append('_token', _token); + const res = await (0, got_1.default)('https://storydownloader.app/request', { + method: 'POST', + headers: { + ...headers, + ...formData.getHeaders() + }, + body: formData.getBuffer() + }); + const { html } = JSON.parse(res.body); + if (!html) + throw new utils_js_1.ScraperError(`Can't download!\n${res.body}`); + const $ = cheerio_1.default.load(html); + const username = $('h3.card-title').text(); + const profilePicUrl = $('img.card-avatar').attr('src'); + const results = []; + $('div.row > div').each(function () { + const $el = $(this); + const thumbnail = $el.find('img').attr('src'); + const url = $el.find('a').attr('href'); + const type = /video_dashinit\.mp4/i.test(url) ? 'video' : 'image'; + const isVideo = type === 'video'; + if (thumbnail && url) { + results.push({ + thumbnail, + url, + type, + isVideo + }); + } + }); + return { + user: { + username, + profilePicUrl + }, + results + }; +} +exports.instagramStory = instagramStory; +async function instagramStoryv2(name) { + const headers = { + accept: '*/*', + cookie: '_ga=GA1.2.1814586753.1642307018; _gid=GA1.2.136857157.1642307018; __gads=ID=6f5ca6608dd8b1e9-22e4ea18ffcf0077:T=1642307019:RT=1642307019:S=ALNI_MZA7NeGtOEcSPXyFhf4LY8w7Myg9g; PHPSESSID=1i9dscs75l6v2h17cvdtd587b4; _gat=1; FCNEC=[["AKsRol9R3FQaOjrrETFMIMIvWtuoY3xRHpQEPHMujRWOd_nxuLgWCSyYK9lLC3ev0L5V8fuaSIjhupCtaReRepP4qNvch536pzvrcU13Gh8CRHSEIh8O3zM42ASwGUQfjoKbxkTV1L15EA6O7FLZ-Qh3Fy1rvh_h8w=="],null,[]]', + 'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36' + }; + const data = await (0, got_1.default)('https://www.instagramsave.com/instagram-story-downloader.php', { + headers: { + ...headers, + accept: 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9', + referer: 'https://www.google.com/' + } + }).text(); + const $ = cheerio_1.default.load(data); + const payload = { + url: 'https://www.instagram.com/' + name, + action: 'story', + token: $('#token').val(), + json: '' + }; + const { user, medias: results, error } = await (0, got_1.default)('https://www.instagramsave.com/system/action.php', { + form: payload, + method: 'POST', + headers: { + ...headers, + 'content-type': 'application/x-www-form-urlencoded; charset=UTF-8', + origin: 'https://www.instagramsave.com', + referer: 'https://www.instagramsave.com/instagram-story-downloader.php' + } + }).json(); + if (error || !results) + throw new utils_js_1.ScraperError(`Maybe user ${name} not have story!!\n${JSON.stringify({ user, results, payload }, null, 2)}`); + return { + user, + results: results.map(({ preview, url, downloadUrl, type, fileType }) => ({ + thumbnail: preview, + url: downloadUrl, + sourceUrl: url, + type, + fileType, + isVideo: type === 'video' + })) + }; +} +exports.instagramStoryv2 = instagramStoryv2; +async function instagramStalk(username) { + var _a, _b, _c, _d, _e, _f, _g, _h, _j; + const data = await (0, got_1.default)(`https://dumpor.com/search?query=${encodeURIComponent(username).replace(/%20/g, '+')}`).text(); + const $ = cheerio_1.default.load(data); + const accounts = []; + $('#nav-profiles > div > div.search-item').each(function () { + var _a, _b; + const el = $(this); + const url = (_a = el.find('.content__img-wrap > a') + .attr('href')) === null || _a === void 0 ? void 0 : _a.trim(); + if (url) { + accounts.push({ + url, + avatar: (_b = el.find('.content__img-wrap > a > img') + .attr('src')) === null || _b === void 0 ? void 0 : _b.trim(), + username: el.find('.content__text > a') + .text().trim() + }); + } + }); + const html = await (0, got_1.default)(`https://dumpor.com/${accounts[0].url}`).text(); + const $$ = cheerio_1.default.load(html); + const name = $$('div.user__title > a > h1').text().trim(); + const Uname = $$('div.user__title > h4').text().trim(); + const description = $$('div.user__info-desc').text().trim(); + const row = $$('#user-page > div.container > div > div > div:nth-child(1) > div > a'); + const postsH = (_a = row.eq(0).text().replace(/Posts/i, '')) === null || _a === void 0 ? void 0 : _a.trim(); + const followersH = (_b = row.eq(2).text().replace(/Followers/i, '')) === null || _b === void 0 ? void 0 : _b.trim(); + const followingH = (_c = row.eq(3).text().replace(/Following/i, '')) === null || _c === void 0 ? void 0 : _c.trim(); + const list = $$('ul.list > li.list__item'); + const posts = parseInt((_e = (_d = list.eq(0).text().replace(/Posts/i, '')) === null || _d === void 0 ? void 0 : _d.trim()) === null || _e === void 0 ? void 0 : _e.replace(/\s/g, '')); + const followers = parseInt((_g = (_f = list.eq(1).text().replace(/Followers/i, '')) === null || _f === void 0 ? void 0 : _f.trim()) === null || _g === void 0 ? void 0 : _g.replace(/\s/g, '')); + const following = parseInt((_j = (_h = list.eq(2).text().replace(/Following/i, '')) === null || _h === void 0 ? void 0 : _h.trim()) === null || _j === void 0 ? void 0 : _j.replace(/\s/g, '')); + return { + name, + username: Uname, + avatar: accounts[0].avatar, + description, + postsH, + posts, + followersH, + followers, + followingH, + following + }; +} +exports.instagramStalk = instagramStalk; +//# sourceMappingURL=instagram.js.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/cjs/social-media/instagram.js.map b/node_modules/@bochilteam/scraper/lib/cjs/social-media/instagram.js.map new file mode 100644 index 000000000..b2fb2778c --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/cjs/social-media/instagram.js.map @@ -0,0 +1 @@ +{"version":3,"file":"instagram.js","sourceRoot":"","sources":["../../../src/social-media/instagram.ts"],"names":[],"mappings":";;;;;;AAAA,6CAA6C;AAC7C,sDAA6B;AAC7B,8CAA4C;AAS5C,0CAAyD;AACzD,0DAA4B;AAErB,KAAK,UAAU,WAAW,CAAE,GAAW;;IAC5C,IAAI,CAAC,gDAAgD,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE;QAC/D,MAAM,IAAI,uBAAY,CAAC,eAAe,CAAC,CAAA;KACxC;IAED,MAAM,IAAI,GAAG,MAAM,aAAG;SACnB,IAAI,CAAC,kCAAkC,EAAE;QACxC,IAAI,EAAE;YACJ,GAAG,EAAE,SAAS,CAAC,GAAG,CAAC;YACnB,MAAM,EAAE,MAAM;SACf;QACD,OAAO,EAAE;YACP,cAAc,EAAE,mCAAmC;YACnD,MAAM,EAAE,uBAAuB;YAC/B,OAAO,EAAE,wBAAwB;YACjC,YAAY,EACV,oHAAoH;SAC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,MAAM,UAAU,GAAG,MAAA,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC,YAAY,EAAE,EAAE,CAAC,0CAAE,IAAI,EAAE,CAAA;IACrE,MAAM,IAAI,GAAG,EAAE,CAAC,yBAAyB,CAAC,CAAA;IAC1C,MAAM,KAAK,GAAG,QAAQ,CACpB,MAAA,MAAA,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC,0CACnC,IAAI,EAAE,0CAAE,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAC/B,CAAA;IACD,MAAM,SAAS,GAAG,QAAQ,CACxB,MAAA,MAAA,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC,YAAY,EAAE,EAAE,CAAC,0CACvC,IAAI,EAAE,0CAAE,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAC/B,CAAA;IACD,MAAM,SAAS,GAAG,QAAQ,CACxB,MAAA,MAAA,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC,YAAY,EAAE,EAAE,CAAC,0CACvC,IAAI,EAAE,0CAAE,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAC/B,CAAA;IACD,OAAO;QACL,IAAI;QACJ,QAAQ,EAAE,KAAK;QACf,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,MAAM;QAC1B,WAAW;QACX,MAAM;QACN,KAAK;QACL,UAAU;QACV,SAAS;QACT,UAAU;QACV,SAAS;KACV,CAAA;AACH,CAAC;AApDD,wCAoDC"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/cjs/social-media/savefrom.js b/node_modules/@bochilteam/scraper/lib/cjs/social-media/savefrom.js new file mode 100644 index 000000000..969045fd8 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/cjs/social-media/savefrom.js @@ -0,0 +1,54 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const got_1 = __importDefault(require("got")); +const vm_1 = __importDefault(require("vm")); +const utils_js_1 = require("../utils.js"); +async function savefrom(url) { + var _a, _b; + let scriptJS = await (0, got_1.default)('https://worker.sf-tools.com/savefrom.php', { + method: 'POST', + headers: { + 'content-type': 'application/x-www-form-urlencoded', + origin: 'https://id.savefrom.net', + referer: 'https://id.savefrom.net/', + 'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.74 Safari/537.36' + }, + form: { + sf_url: encodeURI(url), + sf_submit: '', + new: 2, + lang: 'id', + app: '', + country: 'id', + os: 'Windows', + browser: 'Chrome', + channel: ' main', + 'sf-nomad': 1 + } + }).text(); + const executeCode = '[]["filter"]["constructor"](b).call(a);'; + if (scriptJS.indexOf(executeCode) === -1) + throw new utils_js_1.ScraperError(`Cannot find execute code\n${scriptJS}`); + scriptJS = scriptJS.replace(executeCode, ` +try { + i++; + if (i === 2) scriptResult = ${executeCode.split('.call')[0]}.toString(); + else ( + ${executeCode.replace(/;/, '')} + ); +} catch {} +`); + const context = { + scriptResult: '', + i: 0 + }; + vm_1.default.createContext(context); + new vm_1.default.Script(scriptJS).runInContext(context); + const json = JSON.parse((_b = (_a = context.scriptResult.split('window.parent.sf.videoResult.show(')) === null || _a === void 0 ? void 0 : _a[1].split(');')) === null || _b === void 0 ? void 0 : _b[0]); + return json; +} +exports.default = savefrom; +//# sourceMappingURL=savefrom.js.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/cjs/social-media/savefrom.js.map b/node_modules/@bochilteam/scraper/lib/cjs/social-media/savefrom.js.map new file mode 100644 index 000000000..578482836 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/cjs/social-media/savefrom.js.map @@ -0,0 +1 @@ +{"version":3,"file":"savefrom.js","sourceRoot":"","sources":["../../../src/social-media/savefrom.ts"],"names":[],"mappings":";;;;;AAAA,8CAAqB;AACrB,4CAAmB;AACnB,0CAA0C;AAI3B,KAAK,UAAU,QAAQ,CAAE,GAAW;;IACjD,IAAI,QAAQ,GAAG,MAAM,IAAA,aAAG,EAAC,0CAA0C,EAAE;QACnE,MAAM,EAAE,MAAM;QACd,OAAO,EAAE;YACP,cAAc,EAAE,mCAAmC;YACnD,MAAM,EAAE,yBAAyB;YACjC,OAAO,EAAE,0BAA0B;YACnC,YAAY,EAAE,oHAAoH;SACnI;QACD,IAAI,EAAE;YACJ,MAAM,EAAE,SAAS,CAAC,GAAG,CAAC;YACtB,SAAS,EAAE,EAAE;YACb,GAAG,EAAE,CAAC;YACN,IAAI,EAAE,IAAI;YACV,GAAG,EAAE,EAAE;YACP,OAAO,EAAE,IAAI;YACb,EAAE,EAAE,SAAS;YACb,OAAO,EAAE,QAAQ;YACjB,OAAO,EAAE,OAAO;YAChB,UAAU,EAAE,CAAC;SACd;KACF,CAAC,CAAC,IAAI,EAAE,CAAA;IACT,MAAM,WAAW,GAAG,yCAAyC,CAAA;IAC7D,IAAI,QAAQ,CAAC,OAAO,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;QAAE,MAAM,IAAI,uBAAY,CAAC,6BAA6B,QAAQ,EAAE,CAAC,CAAA;IACzG,QAAQ,GAAG,QAAQ,CAAC,OAAO,CAAC,WAAW,EAAE;;;gCAGX,WAAW,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;;MAEvD,WAAW,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC;;;CAGjC,CAAC,CAAA;IACA,MAAM,OAAO,GAAG;QACd,YAAY,EAAE,EAAE;QAChB,CAAC,EAAE,CAAC;KACL,CAAA;IACD,YAAE,CAAC,aAAa,CAAC,OAAO,CAAC,CAAA;IACzB,IAAI,YAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,YAAY,CAAC,OAAO,CAAC,CAAA;IAC7C,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,MAAA,MAAA,OAAO,CAAC,YAAY,CAAC,KAAK,CAAC,oCAAoC,CAAC,0CAAG,CAAC,EAAE,KAAK,CAAC,IAAI,CAAC,0CAAG,CAAC,CAAC,CAAC,CAAA;IAC/G,OAAO,IAAI,CAAA;AACb,CAAC;AAzCD,2BAyCC"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/cjs/social-media/test.js b/node_modules/@bochilteam/scraper/lib/cjs/social-media/test.js new file mode 100644 index 000000000..191df08f3 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/cjs/social-media/test.js @@ -0,0 +1,369 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const chai_1 = require("chai"); +const index_js_1 = require("./index.js"); +describe('Social media', () => { + describe('Tiktok scraper', function () { + it('tiktokdl', function (done) { + (0, index_js_1.tiktokdl)('https://www.tiktok.com/@omagadsus/video/7025456384175017243?is_from_webapp=1&sender_device=pc&web_id6982004129280116226').then(function (res) { + (0, chai_1.expect)(res).to.be.an('object'); + (0, chai_1.expect)(res.author).to.be.an('object'); + (0, chai_1.expect)(res.author.nickname).to.be.a('string'); + (0, chai_1.expect)(res.description).to.be.a('string'); + (0, chai_1.expect)(res.video).to.be.an('object'); + (0, chai_1.expect)(res.video.no_watermark).to.be.a('string'); + (0, chai_1.expect)(res.video.no_watermark2).to.be.a('string'); + (0, chai_1.expect)(res.video.no_watermark_raw).to.be.a('string'); + return done(); + }).catch(done); + }); + it('tiktokdl v2', function (done) { + (0, index_js_1.tiktokdlv2)('https://www.tiktok.com/@omagadsus/video/7025456384175017243?is_from_webapp=1&sender_device=pc&web_id6982004129280116226').then(function (res) { + (0, chai_1.expect)(res).to.be.an('object'); + (0, chai_1.expect)(res.author).to.be.an('object'); + (0, chai_1.expect)(res.author.unique_id).to.be.a('string'); + (0, chai_1.expect)(res.author.nickname).to.be.a('string'); + (0, chai_1.expect)(res.author.avatar).to.be.a('string'); + (0, chai_1.expect)(res.video).to.be.an('object'); + (0, chai_1.expect)(res.video.no_watermark).to.be.a('string'); + (0, chai_1.expect)(res.video.no_watermark_hd).to.be.a('string'); + return done(); + }).catch(done); + }); + it('tiktokdl v3', function (done) { + (0, index_js_1.tiktokdlv3)('https://www.tiktok.com/@omagadsus/video/7025456384175017243?is_from_webapp=1&sender_device=pc&web_id6982004129280116226').then(function (res) { + (0, chai_1.expect)(res).to.be.an('object'); + (0, chai_1.expect)(res.author).to.be.an('object'); + (0, chai_1.expect)(res.author.nickname).to.be.a('string'); + (0, chai_1.expect)(res.author.avatar).to.be.a('string'); + (0, chai_1.expect)(res.description).to.be.a('string'); + (0, chai_1.expect)(res.video).to.be.an('object'); + (0, chai_1.expect)(res.video.no_watermark).to.be.a('string'); + (0, chai_1.expect)(res.video.no_watermark2).to.be.a('string'); + (0, chai_1.expect)(res.music).to.be.a('string'); + return done(); + }).catch(done); + }); + // it('tiktokfyp', function (done) { + // tiktokfyp().then(function (res) { + // expect(res).to.be.an('array') + // expect(res.length).to.be.above(0) + // return done() + // }).catch(done) + // }) + // it('tiktokstalk', function (done) { + // tiktokstalk('Tiktok').then(function (res) { + // expect(res).to.be.an('object') + // // expect(res.username).to.be.a('string') + // // expect(res.profile).to.be.a('string') + // // expect(res.avatar).to.be.a('string') + // // expect(res.verified).to.be.a('boolean') Github action error! + // // expect(res.following).to.be.a('string') + // // expect(res.followers).to.be.a('string') + // // expect(res.likes).to.be.a('string') + // // expect(res.description).to.be.a('string') + // return done() + // }).catch(done) + // }) + }); + describe('Instagram', () => { + it('Instagram Downloader', done => { + // https://www.instagram.com/p/CaHpoweBjmx/?utm_source=ig_web_copy_link + (0, index_js_1.instagramdl)('https://www.instagram.com/reel/CXK49yFLtJ_/?utm_source=ig_web_copy_link').then(res => { + (0, chai_1.expect)(res).to.be.an('array'); + (0, chai_1.expect)(res).to.have.lengthOf.at.least(1); + res.forEach(({ thumbnail, url }) => { + (0, chai_1.expect)(thumbnail).to.be.a('string'); + (0, chai_1.expect)(url).to.be.a('string'); + }); + return done(); + }).catch(done); + }); + it('Instagram Downloader V2', done => { + (0, index_js_1.instagramdlv2)('https://www.instagram.com/reel/CXK49yFLtJ_/?utm_source=ig_web_copy_link').then(res => { + (0, chai_1.expect)(res).to.be.an('array'); + (0, chai_1.expect)(res).to.have.lengthOf.at.least(1); + res.forEach(({ thumbnail, url }) => { + (0, chai_1.expect)(thumbnail).to.be.a('string'); + (0, chai_1.expect)(url).to.be.a('string'); + }); + return done(); + }).catch(done); + }); + it('Instagram Downloader V3', done => { + (0, index_js_1.instagramdlv3)('https://www.instagram.com/reel/CXK49yFLtJ_/?utm_source=ig_web_copy_link').then(res => { + (0, chai_1.expect)(res).to.be.an('array'); + (0, chai_1.expect)(res).to.have.lengthOf.at.least(1); + res.forEach(({ thumbnail, url }) => { + (0, chai_1.expect)(thumbnail).to.be.a('string'); + (0, chai_1.expect)(url).to.be.a('string'); + }); + return done(); + }).catch(done); + }); + it('Instagram Downloader V4', done => { + (0, index_js_1.instagramdlv4)('https://www.instagram.com/reel/CXK49yFLtJ_/?utm_source=ig_web_copy_link').then(res => { + (0, chai_1.expect)(res).to.be.an('array'); + (0, chai_1.expect)(res).to.have.lengthOf.at.least(1); + res.forEach(({ thumbnail, url }) => { + (0, chai_1.expect)(thumbnail).to.be.a('string'); + (0, chai_1.expect)(url).to.be.a('string'); + }); + return done(); + }).catch(done); + }); + it('Instagram Story', function (done) { + (0, index_js_1.instagramStory)('raffinagita1717').then(res => { + (0, chai_1.expect)(res).to.be.an('object'); + (0, chai_1.expect)(res.user).to.be.an('object'); + (0, chai_1.expect)(res.results).to.be.an('array'); + (0, chai_1.expect)(res.results).to.have.lengthOf.at.least(1); + res.results.forEach(({ thumbnail, url, type, isVideo }) => { + (0, chai_1.expect)(thumbnail).to.be.a('string'); + (0, chai_1.expect)(url).to.be.a('string'); + (0, chai_1.expect)(type).to.be.a('string'); + (0, chai_1.expect)(isVideo).to.be.a('boolean'); + }); + return done(); + }).catch(done); + }); + it('Instagram Story V2', function (done) { + (0, index_js_1.instagramStoryv2)('raffinagita1717').then(res => { + (0, chai_1.expect)(res).to.be.an('object'); + (0, chai_1.expect)(res.user).to.be.an('object'); + (0, chai_1.expect)(res.results).to.be.an('array'); + (0, chai_1.expect)(res.results).to.have.lengthOf.at.least(1); + res.results.forEach(({ thumbnail, isVideo, url }) => { + (0, chai_1.expect)(thumbnail).to.be.a('string'); + (0, chai_1.expect)(isVideo).to.be.a('boolean'); + (0, chai_1.expect)(url).to.be.a('string'); + }); + return done(); + }).catch(done); + }); + it('Instagram Stalk', done => { + (0, index_js_1.instagramStalk)('freefirebgid').then(res => { + (0, chai_1.expect)(res).to.be.an('object'); + (0, chai_1.expect)(res.name).to.be.a('string'); + (0, chai_1.expect)(res.username).to.be.a('string'); + (0, chai_1.expect)(res.description).to.be.a('string'); + (0, chai_1.expect)(res.postsH).to.be.a('string'); + (0, chai_1.expect)(res.posts).to.be.a('number'); + (0, chai_1.expect)(res.followersH).to.be.a('string'); + (0, chai_1.expect)(res.followers).to.be.a('number'); + (0, chai_1.expect)(res.followingH).to.be.a('string'); + (0, chai_1.expect)(res.following).to.be.a('number'); + return done(); + }).catch(done); + }); + }); + describe('Facebook (Metaverse :V)', function () { + it('Facebook Downloader', done => { + (0, index_js_1.facebookdl)('https://fb.watch/9WktuN9j-z/').then(res => { + (0, chai_1.expect)(res).to.be.an('object'); + (0, chai_1.expect)(res.id).to.be.a('string'); + (0, chai_1.expect)(res.thumbnail).to.be.a('string'); + (0, chai_1.expect)(res.duration).to.be.a('number'); + (0, chai_1.expect)(res.result).to.be.an('array'); + (0, chai_1.expect)(res.result).to.have.lengthOf.at.least(1); + res.result.forEach(({ ext, url, isVideo, isAudio }) => { + (0, chai_1.expect)(ext).to.be.a('string'); + (0, chai_1.expect)(url).to.be.a('string'); + (0, chai_1.expect)(isVideo).to.be.a('boolean'); + (0, chai_1.expect)(isAudio).to.be.a('boolean'); + }); + return done(); + }).catch(done); + }); + it('Facebook Downloader V2', done => { + (0, index_js_1.facebookdlv2)('https://fb.watch/9WktuN9j-z/').then(res => { + (0, chai_1.expect)(res).to.be.an('object'); + (0, chai_1.expect)(res.id).to.be.a('string'); + (0, chai_1.expect)(res.title).to.be.a('string'); + (0, chai_1.expect)(res.description).to.be.a('string'); + (0, chai_1.expect)(res.thumbnail).to.be.a('string'); + (0, chai_1.expect)(res.result).to.be.an('array'); + (0, chai_1.expect)(res.result).to.have.lengthOf.at.least(1); + res.result.forEach(({ quality, url }) => { + (0, chai_1.expect)(quality).to.be.a('string'); + (0, chai_1.expect)(url).to.be.a('string'); + }); + return done(); + }).catch(done); + }); + it('Facebook Downloader V3', done => { + (0, index_js_1.facebookdlv3)('https://fb.watch/9WktuN9j-z/').then(res => { + (0, chai_1.expect)(res).to.be.an('object'); + (0, chai_1.expect)(res.title).to.be.a('string'); + (0, chai_1.expect)(res.thumbnail).to.be.a('string'); + (0, chai_1.expect)(res.result).to.be.an('array'); + (0, chai_1.expect)(res.result).to.have.lengthOf.at.least(1); + res.result.forEach(({ url, quality, isAudio, isVideo }) => { + (0, chai_1.expect)(url).to.be.a('string'); + (0, chai_1.expect)(quality).to.be.a('string'); + (0, chai_1.expect)(isAudio).to.be.a('boolean'); + (0, chai_1.expect)(isVideo).to.be.a('boolean'); + }); + return done(); + }).catch(done); + }); + }); + describe('Twitter', () => { + it('Twitter Downloader', done => { + (0, index_js_1.twitterdl)('https://twitter.com/jen_degen/status/1458167531869458440?s=20').then(res => { + (0, chai_1.expect)(res).to.be.an('array'); + res.forEach(({ quality, type, url, isVideo }) => { + (0, chai_1.expect)(quality).to.be.a('string'); + (0, chai_1.expect)(type).to.be.a('string'); + (0, chai_1.expect)(url).to.be.a('string'); + (0, chai_1.expect)(isVideo).to.be.a('boolean'); + }); + return done(); + }).catch(done); + }); + it('Twitter Downloader V2', done => { + (0, index_js_1.twitterdlv2)('https://twitter.com/jen_degen/status/1458167531869458440?s=20').then(res => { + (0, chai_1.expect)(res).to.be.an('array'); + res.forEach(({ quality, type, url }) => { + (0, chai_1.expect)(quality).to.be.a('string'); + (0, chai_1.expect)(type).to.be.a('string'); + (0, chai_1.expect)(url).to.be.a('string'); + }); + return done(); + }).catch(done); + }); + }); + describe('Youtube', function () { + it('Youtube Downloader', done => { + (0, index_js_1.youtubedl)('https://youtu.be/iik25wqIuFo').then(res => { + res.video['360p'].download().catch(done); + (0, chai_1.expect)(res).to.be.an('object'); + (0, chai_1.expect)(res.thumbnail).to.be.a('string'); + (0, chai_1.expect)(res.title).to.be.a('string'); + (0, chai_1.expect)(res.video).to.be.an('object'); + (0, chai_1.expect)(res.audio).to.be.an('object'); + return done(); + }).catch(done); + }); + it('Youtube Downloader v2', done => { + (0, index_js_1.youtubedlv2)('https://youtu.be/iik25wqIuFo').then(res => { + res.video['240p'].download().catch(done); + (0, chai_1.expect)(res).to.be.an('object'); + (0, chai_1.expect)(res.thumbnail).to.be.a('string'); + (0, chai_1.expect)(res.title).to.be.a('string'); + (0, chai_1.expect)(res.video).to.be.an('object'); + (0, chai_1.expect)(res.audio).to.be.an('object'); + return done(); + }).catch(done); + }); + it('Youtube Downloader v3', done => { + (0, index_js_1.youtubedlv3)('https://youtu.be/iik25wqIuFo').then(res => { + res.video['360'].download().catch(done); + (0, chai_1.expect)(res).to.be.an('object'); + (0, chai_1.expect)(res.thumbnail).to.be.a('string'); + (0, chai_1.expect)(res.title).to.be.a('string'); + (0, chai_1.expect)(res.video).to.be.an('object'); + (0, chai_1.expect)(res.audio).to.be.an('object'); + return done(); + }).catch(done); + }); + it('Youtube Search', done => { + (0, index_js_1.youtubeSearch)('Minecraft').then(res => { + (0, chai_1.expect)(res).to.be.an('object'); + (0, chai_1.expect)(res.video).to.be.an('array'); + (0, chai_1.expect)(res.video).to.have.lengthOf.at.least(1); + (0, chai_1.expect)(res.channel).to.be.an('array'); + (0, chai_1.expect)(res.playlist).to.be.an('array'); + return done(); + }).catch(done); + }); + }); + it('Google It', done => { + (0, index_js_1.googleIt)('Minecraft').then(res => { + (0, chai_1.expect)(res).to.be.an('object'); + (0, chai_1.expect)(res.info).to.be.an('object'); + (0, chai_1.expect)(res.articles).to.be.an('array'); + (0, chai_1.expect)(res.articles).to.have.lengthOf.at.least(1); + return done(); + }).catch(done); + }); + it('Group Whatsapp', done => { + (0, index_js_1.groupWA)('A').then(res => { + (0, chai_1.expect)(res).to.be.an('array'); + (0, chai_1.expect)(res).to.have.lengthOf.at.least(1); + res.forEach(({ url, subject }) => { + (0, chai_1.expect)(url).to.be.a('string'); + (0, chai_1.expect)(subject).to.be.a('string'); + }); + return done(); + }).catch(done); + }); + describe('aiovideodl', () => { + it('Tiktok download', done => { + (0, index_js_1.aiovideodl)('https://www.tiktok.com/@omagadsus/video/7025456384175017243?is_from_webapp=1&sender_device=pc&web_id6982004129280116226').then(res => { + (0, chai_1.expect)(res).to.be.an('object'); + (0, chai_1.expect)(res.medias).to.be.an('array'); + (0, chai_1.expect)(res.medias).to.have.lengthOf.at.least(1); + (0, chai_1.expect)(res.source).to.be.eq('tiktok'); + return done(); + }).catch(done); + }); + it('Facebook download', done => { + (0, index_js_1.aiovideodl)('https://fb.watch/9WktuN9j-z/').then(res => { + (0, chai_1.expect)(res).to.be.an('object'); + (0, chai_1.expect)(res.medias).to.be.an('array'); + (0, chai_1.expect)(res.medias).to.have.lengthOf.at.least(1); + (0, chai_1.expect)(res.source).to.be.eq('facebook'); + return done(); + }).catch(done); + }); + it('Twitter download', done => { + (0, index_js_1.aiovideodl)('https://twitter.com/jen_degen/status/1458167531869458440?s=20').then(res => { + (0, chai_1.expect)(res).to.be.an('object'); + (0, chai_1.expect)(res.medias).to.be.an('array'); + (0, chai_1.expect)(res.medias).to.have.lengthOf.at.least(1); + (0, chai_1.expect)(res.source).to.be.eq('twitter'); + return done(); + }).catch(done); + }); + }); + describe('Savefrom', () => { + it('Tiktok download', done => { + (0, index_js_1.savefrom)('https://www.tiktok.com/@omagadsus/video/7025456384175017243?is_from_webapp=1&sender_device=pc&web_id6982004129280116226').then(res => { + (0, chai_1.expect)(res).to.be.an('object'); + (0, chai_1.expect)(res.url).to.be.an('array'); + (0, chai_1.expect)(res.url).to.have.lengthOf.at.least(1); + (0, chai_1.expect)(res.hosting).to.be.eq('tiktok.com'); + return done(); + }).catch(done); + }); + it('Facebook download', done => { + (0, index_js_1.savefrom)('https://fb.watch/9WktuN9j-z/').then(res => { + (0, chai_1.expect)(res).to.be.an('object'); + (0, chai_1.expect)(res.url).to.be.an('array'); + (0, chai_1.expect)(res.url).to.have.lengthOf.at.least(1); + (0, chai_1.expect)(res.hosting).to.be.eq('facebook.com'); + return done(); + }).catch(done); + }); + it('Twitter download', done => { + (0, index_js_1.savefrom)('https://twitter.com/jen_degen/status/1458167531869458440?s=20').then(res => { + (0, chai_1.expect)(res).to.be.an('object'); + (0, chai_1.expect)(res.url).to.be.an('array'); + (0, chai_1.expect)(res.url).to.have.lengthOf.at.least(1); + (0, chai_1.expect)(res.hosting).to.be.eq('twitter.com'); + return done(); + }).catch(done); + }); + it('Instagram download', done => { + (0, index_js_1.savefrom)('https://www.instagram.com/reel/CXK49yFLtJ_/?utm_source=ig_web_copy_link').then(res => { + (0, chai_1.expect)(res).to.be.an('object'); + (0, chai_1.expect)(res.url).to.be.an('array'); + (0, chai_1.expect)(res.url).to.have.lengthOf.at.least(1); + (0, chai_1.expect)(res.hosting).to.be.eq('instagram.com'); + return done(); + }).catch(done); + }); + }); +}); +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/cjs/social-media/test.js.map b/node_modules/@bochilteam/scraper/lib/cjs/social-media/test.js.map new file mode 100644 index 000000000..704ac95dd --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/cjs/social-media/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["../../../src/social-media/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BAAQ,EAAC,yEAAyE,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE;gBAC7F,IAAA,aAAM,EAAC,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAA;gBAC9B,IAAA,aAAM,EAAC,GAAG,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,OAAO,CAAC,CAAA;gBACjC,IAAA,aAAM,EAAC,GAAG,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;gBAC5C,IAAA,aAAM,EAAC,GAAG,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,eAAe,CAAC,CAAA;gBAC7C,OAAO,IAAI,EAAE,CAAA;YACf,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;QAChB,CAAC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/cjs/social-media/tiktok.js b/node_modules/@bochilteam/scraper/lib/cjs/social-media/tiktok.js new file mode 100644 index 000000000..df92ed7d4 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/cjs/social-media/tiktok.js @@ -0,0 +1,177 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.tiktokfyp = exports.tiktokdlv3 = exports.tiktokdlv2 = exports.tiktokdl = void 0; +const got_1 = __importDefault(require("got")); +const cheerio_1 = __importDefault(require("cheerio")); +const utils_js_1 = require("../utils.js"); +async function tiktokdl(url) { + var _a, _b, _c, _d, _e, _f; + const resToken = await (0, got_1.default)('https://snaptik.app/ID'); + const cookie = (_a = resToken.headers['set-cookie']) === null || _a === void 0 ? void 0 : _a.map(v => v.split(';')[0]).join('; '); + const $$ = cheerio_1.default.load(resToken.body); + const html = await (0, got_1.default)('https://snaptik.app/abc.php', { + headers: { + cookie: cookie || 'PHPSESSID=gphtms9fofqm2fikr9ofqrld25; current_language=ID; ref=google; __cflb=04dToWzoGizosSfR1ww5Ce8foMmhJkC5absiUehuAK; _ga=GA1.2.500024560.1646295641; _gid=GA1.2.786638280.1646295641; __gads=ID=2d9fb59650bbba88-22611414cbd0004a:T=1646295642:RT=1646295642:S=ALNI_MbDUnOcA1ZoJcH9yeqYgALtEC3W2w; ads_new=1; __cfruid=e4d99b4f4c1cabd9c94cc558b0c7eee4d7508448-1646295654; _gat=1', + referer: 'https://snaptik.app/ID', + 'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.102 Safari/537.36' + }, + searchParams: { + url: encodeURI(url), + lang: 'ID', + token: $$('input[name="token"]').val() + } + }).text(); + const decodeParams = (_c = (_b = html.split('))')[0] + .split('decodeURIComponent(escape(r))}(')[1]) === null || _b === void 0 ? void 0 : _b.split(',')) === null || _c === void 0 ? void 0 : _c.map(v => v.replace(/^"/, '') + .replace(/"$/, '').trim()); + if (!Array.isArray(decodeParams) || decodeParams.length !== 6) + throw new utils_js_1.ScraperError(`failed to parse decode params!\n${html}`); + const decode = (0, utils_js_1.decodeSnapApp)(...decodeParams); + const result = (_f = (_e = (_d = decode.split('; elem.innerHTML = \\\'')) === null || _d === void 0 ? void 0 : _d[1].split('\\\'; parent.ga(')) === null || _e === void 0 ? void 0 : _e[0]) === null || _f === void 0 ? void 0 : _f.replace(/\\(\\)?/g, ''); + if (!result) + throw new utils_js_1.ScraperError(`failed to parse html from decode!\n${decode}`); + const $ = cheerio_1.default.load(result); + const $snaptik_middle = $('.snaptikvid > div.snaptik-middle'); + const $a = $('#download-block > .abuttons').find('a'); + let no_watermark2 = $a.eq(1).attr('href'); + if (!/https?:\/\//.test(no_watermark2)) + no_watermark2 = `https://snaptik.app${no_watermark2}`; + return { + author: { + nickname: $snaptik_middle.find('h3').text() + }, + description: $snaptik_middle.find('span').text(), + video: { + no_watermark: $a.eq(0).attr('href'), + no_watermark2, + no_watermark_raw: $a.eq(2).attr('href') + } + }; +} +exports.tiktokdl = tiktokdl; +async function tiktokdlv2(url) { + const data = await got_1.default + .post('https://api.tikmate.app/api/lookup', { + headers: { + accept: '*/*', + 'accept-language': 'en-US,en;q=0.9', + 'content-type': 'application/x-www-form-urlencoded; charset=UTF-8', + origin: 'https://tikmate.app', + referer: 'https://tikmate.app/', + 'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.110 Safari/537.36' + }, + form: { url } + }) + .json(); + return { + author: { + unique_id: data.author_id, + nickname: data.author_name, + avatar: data.author_avatar + }, + video: { + no_watermark: `https://tikmate.app/download/${data.token}/${data.id}.mp4`, + no_watermark_hd: `https://tikmate.app/download/${data.token}/${data.id}.mp4?hd=1` + } + }; +} +exports.tiktokdlv2 = tiktokdlv2; +async function tiktokdlv3(url) { + var _a; + const resToken = await (0, got_1.default)('https://ssstik.io/id'); + const cookie = (_a = resToken.headers['set-cookie']) === null || _a === void 0 ? void 0 : _a.map(v => v.split(';')[0]).join('; '); + const $$ = cheerio_1.default.load(resToken.body); + const postUrl = $$('#_gcaptcha_pt').attr('hx-post'); + const html = await (0, got_1.default)('https://ssstik.io' + postUrl, { + method: 'POST', + headers: { + 'content-type': 'application/x-www-form-urlencoded; charset=UTF-8', + cookie: cookie || 'PHPSESSID=gb6hgnvvpkfg28ulo80l1u2qrl; __cflb=02DiuEcwseaiqqyPC5pE7Qjdp2jcR2J5YEMX3jgTCHMYX; _ga=GA1.2.1294804934.1647840559; _gid=GA1.2.1211588131.1647840559; __gads=ID=3ba3f6d3a5959cb0-224bbeea15d100da:T=1647840559:RT=1647840559:S=ALNI_MYtTuJ9ICRAeHGfemUzb2rwyaT6lw; ga_show=2; _gat_UA-3524196-6=1', + 'hx-current-url': 'https://ssstik.io/id', + 'hx-request': 'true', + 'hx-target': 'target', + 'hx-trigger': ' _gcaptcha_pt', + origin: 'https://ssstik.io', + referer: 'https://ssstik.io/id', + 'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.74 Safari/537' + }, + form: { + id: encodeURI(url), + locale: 'id', + gc: 0, + tt: 0, + ts: 0 + } + }).text(); + const $ = cheerio_1.default.load(html); + const $img = $('img.u-round'); + const $a = $('a.pure-button'); + let no_watermark = $a.eq(0).attr('href'); + if (!/https?:\/\//.test(no_watermark)) + no_watermark = `https://ssstik.io${no_watermark}`; + return { + author: { + nickname: $img.attr('alt'), + avatar: $img.attr('src') + }, + description: $('p.maintext').text(), + video: { + no_watermark, + no_watermark2: $a.eq(1).attr('href') + }, + music: $a.eq(2).attr('href') + }; +} +exports.tiktokdlv3 = tiktokdlv3; +async function tiktokfyp() { + const data = await (0, got_1.default)('https://t.tiktok.com/api/recommend/item_list/?aid=1988&app_name=tiktok_web&device_platform=web_pc&device_id=6982004129280116226®ion=ID&priority_region=&os=windows&referer=&cookie_enabled=true&screen_width=1920&screen_height=1080&browser_language=en-US&browser_platform=Win32&browser_name=Mozilla&browser_version=5.0+(Windows+NT+10.0%3B+Win64%3B+x64)+AppleWebKit%2F537.36+(KHTML,+like+Gecko)+Chrome%2F96.0.4664.93+Safari%2F537.36&browser_online=true&verifyFp=verify_kx30laei_YkR2lQiI_UBWz_4MZK_ACKV_loiPDs4PyDtw&app_language=en&timezone_name=Asia%2FJakarta&is_page_visible=true&focus_state=true&is_fullscreen=false&history_len=2&battery_info=%7B%7D&count=30&itemID=1&language=en&from_page=fyp&insertedItemID=&versions=70232694,70338434,70001178,70138197,70156809&msToken=Wi63JD_P7xxD_7pFmaF_UcHM6oJwSKjR9wnfsMUaDdz51KLZ3J8tazDrcY2gh_t3PyG_5926qyw8g7DhrgFa3mbDmxLhzmLs_3l_sOk4zf6TdMqfAT51s_n8ZPG8vovv76h1kCkR&X-Bogus=DFSzswVOAxxANJf/SEhC1eM/W7oh&_signature=').json(); + return data.itemList || []; +} +exports.tiktokfyp = tiktokfyp; +// export async function tiktokstalk(name: string): Promise<{ +// username: string; +// profile: string; +// avatar: string; +// verified: boolean; +// following: string; +// followers: string; +// likes: string; +// description: string; +// }> { +// const { data } = await axios.get(`https://www.tiktok.com/@${name}?lang=en`, { +// headers: { +// accept: 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9', +// cookie: 'tt_csrf_token=hlVsM4KILUl4mGcUkB6w6FJR; s_v_web_id=verify_kx30laei_YkR2lQiI_UBWz_4MZK_ACKV_loiPDs4PyDtw; ttwid=1%7CY1AOcjfoIgvlYizkFtt8slCK0i4qZqApyt2VHzQW2jY%7C1639301134%7C43c115b2541a4ae28ba3b0f194641f223a4a3b18a3fcf83212c133eaf4518b04; msToken=9Ac544Pz7Cc_nUXjNNhx8MBVx96CEeL0mgtWiPUQ5Ef3XxRI81YIpRNDkWa3TM5mqAFr-rhaNE1HWEXop_kpLp4BTCqhLQdu3ppGSbLHhUnqEKmzpF86bWvmur5xyKDCVmE63Q==', +// 'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.93 Safari/537.36' +// } +// }) +// const $ = cheerio.load(data) +// let container = $('div.share-title-container > h2') +// let username = container.text()?.trim() +// let avatar = $('span.tiktok-avatar.tiktok-avatar-circle.avatar > img').attr('src') +// let verified = /verified$/.test(container.attr('class')) +// let profile = $('h1.share-sub-title > span.profile').text()?.trim() +// let stats = $('h2.count-infos > div.number') +// let following = stats.eq(0).find('strong').text()?.trim() +// let followers = stats.eq(1).find('strong').text()?.trim() +// let likes = stats.eq(2).find('strong').text()?.trim() +// let description = $('h2.share-desc').text()?.trim() +// return { +// username, +// profile, +// avatar, +// verified, +// following, +// followers, +// likes, +// description +// } +// } +// export async function tiktoksearch(query: string) { +// const { data } = await axios.get(`https://www.tiktok.com/search?q=${query}&t=${+new Date()}`) +// const $ = cheerio.load(data) +// } +//# sourceMappingURL=tiktok.js.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/cjs/social-media/tiktok.js.map b/node_modules/@bochilteam/scraper/lib/cjs/social-media/tiktok.js.map new file mode 100644 index 000000000..ab0a6b3f2 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/cjs/social-media/tiktok.js.map @@ -0,0 +1 @@ +{"version":3,"file":"tiktok.js","sourceRoot":"","sources":["../../../src/social-media/tiktok.ts"],"names":[],"mappings":";;;;;;AAAA,8CAAqB;AACrB,sDAA6B;AAC7B,0CAAyD;AAQlD,KAAK,UAAU,QAAQ,CAAE,GAAW;;IACzC,MAAM,QAAQ,GAAG,MAAM,IAAA,aAAG,EAAC,wBAAwB,CAAC,CAAA;IACpD,MAAM,MAAM,GAAG,MAAA,QAAQ,CAAC,OAAO,CAAC,YAAY,CAAC,0CAAE,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,CAAA;IACnF,MAAM,EAAE,GAAG,iBAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAA;IACtC,MAAM,IAAI,GAAG,MAAM,IAAA,aAAG,EAAC,6BAA6B,EAAE;QACpD,OAAO,EAAE;YACP,MAAM,EAAE,MAAM,IAAI,yXAAyX;YAC3Y,OAAO,EAAE,wBAAwB;YACjC,YAAY,EAAE,qHAAqH;SACpI;QACD,YAAY,EAAE;YACZ,GAAG,EAAE,SAAS,CAAC,GAAG,CAAC;YACnB,IAAI,EAAE,IAAI;YACV,KAAK,EAAE,EAAE,CAAC,qBAAqB,CAAC,CAAC,GAAG,EAAY;SACjD;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B;AAClB,oBAAoB;AACpB,qBAAqB;AACrB,qBAAqB;AACrB,iBAAiB;AACjB,sBAAsB;AACtB,QAAQ;AACR,IAAI;AAEJ,sDAAsD;AACtD,oGAAoG;AACpG,mCAAmC;AACnC,IAAI"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/cjs/social-media/twitter.js b/node_modules/@bochilteam/scraper/lib/cjs/social-media/twitter.js new file mode 100644 index 000000000..bfdda6b5e --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/cjs/social-media/twitter.js @@ -0,0 +1,86 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.twitterdlv2 = exports.twitterdl = void 0; +const cheerio_1 = __importDefault(require("cheerio")); +const got_1 = __importDefault(require("got")); +const utils_js_1 = require("../utils.js"); +async function twitterdl(url) { + if (!/https:\/\/twitter\.com\//i.test(url)) + throw new utils_js_1.ScraperError('URL invalid!'); + const payload = { url }; + const res = await (0, got_1.default)('https://www.expertsphp.com/instagram-reels-downloader.php', { + method: 'POST', + searchParams: new URLSearchParams(Object.entries(payload)), + headers: { + 'content-type': 'application/x-www-form-urlencoded', + cookie: '_ga=GA1.2.783835709.1637038175; __gads=ID=5b4991618655cd86-22e2c7aeadce00ae:T=1637038176:RT=1637038176:S=ALNI_MaCe3McPrVVswzBEqcQlgnVZXtZ1g; _gid=GA1.2.1817576486.1639614645; _gat_gtag_UA_120752274_1=1', + origin: 'https://www.expertsphp.com', + referer: 'https://www.expertsphp.com/twitter-video-downloader.html', + 'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.110 Safari/537.36' + } + }).text(); + const $ = cheerio_1.default.load(res); + const results = []; + $('table.table > tbody > tr').each(function () { + const quality = $(this).find('td').eq(2).find('strong').text(); + const type = $(this).find('td').eq(1).find('strong').text(); + const url = $(this).find('td').eq(0).find('a[href]').attr('href'); + const isVideo = /video/i.test(type); + if (url) { + results.push({ + quality, + type, + url, + isVideo + }); + } + }); + return results; +} +exports.twitterdl = twitterdl; +async function twitterdlv2(url) { + const resToken = await (0, got_1.default)('https://twittervideodownloader.com/', { + headers: { + accept: 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9', + 'accept-encoding': 'gzip, deflate, br', + cookie: 'csrftoken=au5r4nZ6uN48szGKtaEYp4sh4hBWSbL72M7LggD0nPUh8JGajAI403UIpWhrc5dU; _ga=GA1.2.1240680676.1641628632; _gid=GA1.2.414203301.1641628632; __qca=P0-603222438-1641628633090; _pbjs_userid_consent_data=6683316680106290; _pubcid=529c1986-42d2-4dec-a0e8-3a7d7c453add; __gads=ID=c7fcfc8de61626ad:T=1641628636:S=ALNI_MaE6t3k60TjxfxOEU_7fiYOKTdg8Q; session_id=6831c9ed-aeaf-47cd-a4ea-fdf1667efea2; _gat=1; cto_bundle=3Tj6Hl93WmQzcHglMkJDRmdjWnFTYWg1ZHpLeWE5allVRUU2dlFOU1huayUyRjFTM0xYJTJCSzhsajNRRkF1Q2N2OU9JS1NlSjlxWmYzRTFqSzRuaSUyQjlacHNtYXFSRTV1UHZ1UE42djg4TUJuN05FaVdwTTR4c1hkSUlCRlY4WkJaSmd2WXhLc1NDdHRrRm44c25yeTIwMkRRRSUyQkhJalMlMkJBZ3YxZzZwck5VdTIwclNoMkRvbzglM0Q; cto_bundle=3YOlHV93WmQzcHglMkJDRmdjWnFTYWg1ZHpLeVhBUGgzakxaV0xpZTJpJTJCQ3ZDVDd6SyUyQmJsdmxXcW8lMkZtZkZoMVlNNlJ4SU0xaUVxZXg0eGptZU1oZU4xOHIlMkZaamxlY3gwYnJ1ZSUyQkpVVTUyV2p0cm9PNkFRNEl3ZVBoaUtNSmpnNWRjeWtrWktoYTIzV1ZUdEJ6bFZDTWtCSDV4UWdWV2JPbGZJMzBzM2lxaVVRanNWSkElM0Q; cto_bidid=19sjyV9TQVBXTlA4SGwxYUt5Z0JqVFlHUSUyRk1QZ3Vwa1BaUGZubk1meUVmYSUyQmRSSzBUTkdGQiUyQll0bThNbWVGbjVxV293a2RDUVEzNTFvdVZxR09vaWxSWlE4a2lKTVQwYnp3JTJGV05GV0g2UUxWMnc5N2RJWG1NZGtKVWdiRm1WYXNqU0Ey', + 'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.110 Safari/537.36' + } + }).text(); + const $ = cheerio_1.default.load(resToken); + const payload = { + csrfmiddlewaretoken: $('input[name="csrfmiddlewaretoken"]').val(), + tweet: url + }; + const res = await got_1.default + .post('https://twittervideodownloader.com/download', { + form: payload, + headers: { + accept: 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9', + 'accept-encoding': 'gzip, deflate, br', + 'content-type': 'application/x-www-form-urlencoded', + cookie: 'csrftoken=au5r4nZ6uN48szGKtaEYp4sh4hBWSbL72M7LggD0nPUh8JGajAI403UIpWhrc5dU; _ga=GA1.2.1240680676.1641628632; _gid=GA1.2.414203301.1641628632; __qca=P0-603222438-1641628633090; _pbjs_userid_consent_data=6683316680106290; _pubcid=529c1986-42d2-4dec-a0e8-3a7d7c453add; __gads=ID=c7fcfc8de61626ad:T=1641628636:S=ALNI_MaE6t3k60TjxfxOEU_7fiYOKTdg8Q; session_id=6831c9ed-aeaf-47cd-a4ea-fdf1667efea2; cto_bundle=3Tj6Hl93WmQzcHglMkJDRmdjWnFTYWg1ZHpLeWE5allVRUU2dlFOU1huayUyRjFTM0xYJTJCSzhsajNRRkF1Q2N2OU9JS1NlSjlxWmYzRTFqSzRuaSUyQjlacHNtYXFSRTV1UHZ1UE42djg4TUJuN05FaVdwTTR4c1hkSUlCRlY4WkJaSmd2WXhLc1NDdHRrRm44c25yeTIwMkRRRSUyQkhJalMlMkJBZ3YxZzZwck5VdTIwclNoMkRvbzglM0Q; cto_bundle=ZKGKs193WmQzcHglMkJDRmdjWnFTYWg1ZHpLeWF0Z3V5SVY2JTJGTDNCd3A1MHVWVmJMWCUyQjdLTHh2MGZjRzh3ZU5CdWs4TEJyWTNmN2IlMkZuUCUyQiUyRlBDazBORUZIM2d3d0NUR2E3VWh6bmhxNzNDMm9mQUtnTVNPMjBiOUxpSXNXZGoydGxlZjB0YTZIbkNCeU91NnZ2Y0xUJTJGV0ppYkJ0JTJCZlIxYW8yNXBGRXdLaG1Za3RWZzJrJTNE; cto_bidid=U6ndml9TQVBXTlA4SGwxYUt5Z0JqVFlHUSUyRk1QZ3Vwa1BaUGZubk1meUVmYSUyQmRSSzBUTkdGQiUyQll0bThNbWVGbjVxV293a2RDUVEzNTFvdVZxR09vaWxSWlE4a2lKTVQwYnp3JTJGV05GV0g2UUxWMnc5VkJXSFlsN2x6cExKb3pPQTAzWEZZ', + origin: 'https://twittervideodownloader.com', + referer: 'https://twittervideodownloader.com/', + 'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.110 Safari/537.36' + } + }) + .text(); + const results = []; + const $$ = cheerio_1.default.load(res); + $$('div.row.body-container > div > center > div.row').each(function () { + var _a, _b; + const el = $(this).find('div'); + const _quality = el.eq(1).find('p').text().split(':'); + const quality = (_a = _quality === null || _quality === void 0 ? void 0 : _quality[0]) === null || _a === void 0 ? void 0 : _a.trim(); + const type = (_b = _quality === null || _quality === void 0 ? void 0 : _quality[1]) === null || _b === void 0 ? void 0 : _b.trim(); + const url = el.eq(0).find('a[download]').attr('href'); + results.push({ quality, type, url }); + }); + return results; +} +exports.twitterdlv2 = twitterdlv2; +//# sourceMappingURL=twitter.js.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/cjs/social-media/twitter.js.map b/node_modules/@bochilteam/scraper/lib/cjs/social-media/twitter.js.map new file mode 100644 index 000000000..df2bc3e9a --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/cjs/social-media/twitter.js.map @@ -0,0 +1 @@ +{"version":3,"file":"twitter.js","sourceRoot":"","sources":["../../../src/social-media/twitter.ts"],"names":[],"mappings":";;;;;;AAAA,sDAA6B;AAC7B,8CAAqB;AAMrB,0CAA0C;AAEnC,KAAK,UAAU,SAAS,CAC7B,GAAW;IAEX,IAAI,CAAC,2BAA2B,CAAC,IAAI,CAAC,GAAG,CAAC;QAAE,MAAM,IAAI,uBAAY,CAAC,cAAc,CAAC,CAAA;IAClF,MAAM,OAAO,GAAoB,EAAE,GAAG,EAAE,CAAA;IACxC,MAAM,GAAG,GAAG,MAAM,IAAA,aAAG,EACnB,2DAA2D,EAC3D;QACE,MAAM,EAAE,MAAM;QACd,YAAY,EAAE,IAAI,eAAe,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;QAC1D,OAAO,EAAE;YACP,cAAc,EAAE,mCAAmC;YACnD,MAAM,EACT,2MAA2M;YACxM,MAAM,EAAE,4BAA4B;YACpC,OAAO,EAAE,0DAA0D;YACnE,YAAY,EACf,qHAAqH;SACnH;KACF,CACF,CAAC,IAAI,EAAE,CAAA;IACR,MAAM,CAAC,GAAG,iBAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;IAC3B,MAAM,OAAO,GAAwB,EAAE,CAAA;IACvC,CAAC,CAAC,0BAA0B,CAAC,CAAC,IAAI,CAAC;QACjC,MAAM,OAAO,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,IAAI,EAAE,CAAA;QAC9D,MAAM,IAAI,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CA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;KACF,CAAC;SACD,IAAI,EAAE,CAAA;IACT,MAAM,OAAO,GAA0B,EAAE,CAAA;IACzC,MAAM,EAAE,GAAG,iBAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;IAC5B,EAAE,CAAC,iDAAiD,CAAC,CAAC,IAAI,CAAC;;QACzD,MAAM,EAAE,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;QAC9B,MAAM,QAAQ,GAAG,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;QACrD,MAAM,OAAO,GAAG,MAAA,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAG,CAAC,CAAC,0CAAE,IAAI,EAAE,CAAA;QACrC,MAAM,IAAI,GAAG,MAAA,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAG,CAAC,CAAC,0CAAE,IAAI,EAAE,CAAA;QAClC,MAAM,GAAG,GAAG,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;QACrD,OAAO,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,EAAyB,CAAC,CAAA;IAC7D,CAAC,CAAC,CAAA;IACF,OAAO,OAAO,CAAA;AAChB,CAAC;AA7CD,kCA6CC"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/cjs/social-media/types.js b/node_modules/@bochilteam/scraper/lib/cjs/social-media/types.js new file mode 100644 index 000000000..11e638d1e --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/cjs/social-media/types.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=types.js.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/cjs/social-media/types.js.map b/node_modules/@bochilteam/scraper/lib/cjs/social-media/types.js.map new file mode 100644 index 000000000..d4daf0977 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/cjs/social-media/types.js.map @@ -0,0 +1 @@ +{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/social-media/types.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/cjs/social-media/youtube-search.js b/node_modules/@bochilteam/scraper/lib/cjs/social-media/youtube-search.js new file mode 100644 index 000000000..43eedac00 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/cjs/social-media/youtube-search.js @@ -0,0 +1,130 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const cheerio_1 = __importDefault(require("cheerio")); +const got_1 = __importDefault(require("got")); +async function youtubeSearch(query) { + const body = await (0, got_1.default)('https://www.youtube.com/results', { + headers: { + 'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.110 Safari/537.36' + }, + searchParams: { + search_query: query + } + }).text(); + const $ = cheerio_1.default.load(body); + let sc; + $('script').map(function () { + const el = $(this).html(); + let regex; + if ((regex = /var ytInitialData = /gi.exec(el || ''))) { + sc = JSON.parse(regex.input.replace(/^var ytInitialData = /i, '').replace(/;$/, '')); + } + return regex && sc; + }); + const results = { video: [], channel: [], playlist: [] }; + sc.contents.twoColumnSearchResultsRenderer.primaryContents + .sectionListRenderer.contents[0].itemSectionRenderer.contents.forEach((v) => { + var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13; + const typeName = Object.keys(v)[0]; + const result = v[typeName]; + if (['horizontalCardListRenderer', 'shelfRenderer'].includes(typeName)) { + return; + } // Todo: add this result as results + const isChannel = typeName === 'channelRenderer'; + const isVideo = typeName === 'videoRenderer'; + const isMix = typeName === 'radioRenderer'; + if (isVideo) { + const view = ((_a = result.viewCountText) === null || _a === void 0 ? void 0 : _a.simpleText) || + ((_b = result.shortViewCountText) === null || _b === void 0 ? void 0 : _b.simpleText) || + ((_d = (_c = result.shortViewCountText) === null || _c === void 0 ? void 0 : _c.accessibility) === null || _d === void 0 ? void 0 : _d.accessibilityData.label); + const _duration = (_f = (_e = result.thumbnailOverlays) === null || _e === void 0 ? void 0 : _e.find((v) => Object.keys(v)[0] === 'thumbnailOverlayTimeStatusRenderer')) === null || _f === void 0 ? void 0 : _f.thumbnailOverlayTimeStatusRenderer.text; + const videoId = result.videoId; + const duration = ((_g = result.lengthText) === null || _g === void 0 ? void 0 : _g.simpleText) || (_duration === null || _duration === void 0 ? void 0 : _duration.simpleText); + let durationS = 0; + (_h = ((duration === null || duration === void 0 ? void 0 : duration.split('.').length) && duration.indexOf(':') === -1 + ? duration.split('.') + : duration === null || duration === void 0 ? void 0 : duration.split(':'))) === null || _h === void 0 ? void 0 : _h.forEach((v, i, arr) => (durationS += + durationMultipliers[arr.length]['' + i] * parseInt(v))); + results.video.push({ + authorName: (_l = (((_j = result.ownerText) === null || _j === void 0 ? void 0 : _j.runs) || + ((_k = result.longBylineText) === null || _k === void 0 ? void 0 : _k.runs) || + [])[0]) === null || _l === void 0 ? void 0 : _l.text, + authorAvatar: (_p = (_o = (_m = result.channelThumbnailSupportedRenderers) === null || _m === void 0 ? void 0 : _m.channelThumbnailWithLinkRenderer.thumbnail.thumbnails) === null || _o === void 0 ? void 0 : _o.filter(({ url }) => url)) === null || _p === void 0 ? void 0 : _p.pop().url, + videoId, + url: encodeURI('https://www.youtube.com/watch?v=' + videoId), + thumbnail: result.thumbnail.thumbnails.pop().url, + title: (_t = (((_r = (_q = result.title) === null || _q === void 0 ? void 0 : _q.runs.find((v) => v.text)) === null || _r === void 0 ? void 0 : _r.text) || + ((_s = result.title) === null || _s === void 0 ? void 0 : _s.accessibility.accessibilityData.label))) === null || _t === void 0 ? void 0 : _t.trim(), + description: (_y = (_x = (_w = (_v = (_u = result.detailedMetadataSnippets) === null || _u === void 0 ? void 0 : _u[0]) === null || _v === void 0 ? void 0 : _v.snippetText.runs) === null || _w === void 0 ? void 0 : _w.filter(({ text }) => text)) === null || _x === void 0 ? void 0 : _x.map(({ text }) => text)) === null || _y === void 0 ? void 0 : _y.join(''), + publishedTime: (_z = result.publishedTimeText) === null || _z === void 0 ? void 0 : _z.simpleText, + durationH: ((_0 = result.lengthText) === null || _0 === void 0 ? void 0 : _0.accessibility.accessibilityData.label) || + (_duration === null || _duration === void 0 ? void 0 : _duration.accessibility.accessibilityData.label), + durationS, + duration, + viewH: view, + view: (_1 = (((view === null || view === void 0 ? void 0 : view.indexOf('x')) === -1 + ? view === null || view === void 0 ? void 0 : view.split(' ')[0] + : view === null || view === void 0 ? void 0 : view.split('x')[0]) || view)) === null || _1 === void 0 ? void 0 : _1.trim(), + type: typeName.replace(/Renderer/i, '') + }); + } + if (isChannel) { + const channelId = result.channelId; + const _subscriber = ((_2 = result.subscriberCountText) === null || _2 === void 0 ? void 0 : _2.accessibility.accessibilityData.label) || + ((_3 = result.subscriberCountText) === null || _3 === void 0 ? void 0 : _3.simpleText); + results.channel.push({ + channelId, + url: encodeURI('https://www.youtube.com/channel/' + channelId), + channelName: result.title.simpleText || + ((_5 = (_4 = result.shortBylineText) === null || _4 === void 0 ? void 0 : _4.runs.find((v) => v.text)) === null || _5 === void 0 ? void 0 : _5.text), + avatar: 'https:' + + ((_6 = result.thumbnail.thumbnails + .filter(({ url }) => url)) === null || _6 === void 0 ? void 0 : _6.pop().url), + isVerified: ((_7 = result.ownerBadges) === null || _7 === void 0 ? void 0 : _7.pop().metadataBadgeRenderer.style) === + 'BADGE_STYLE_TYPE_VERIFIED', + subscriberH: _subscriber === null || _subscriber === void 0 ? void 0 : _subscriber.trim(), + subscriber: _subscriber === null || _subscriber === void 0 ? void 0 : _subscriber.split(' ')[0], + videoCount: parseInt((_9 = (_8 = result.videoCountText) === null || _8 === void 0 ? void 0 : _8.runs[0]) === null || _9 === void 0 ? void 0 : _9.text), + description: (_13 = (_12 = (_11 = (_10 = result.descriptionSnippet) === null || _10 === void 0 ? void 0 : _10.runs) === null || _11 === void 0 ? void 0 : _11.filter(({ text }) => text)) === null || _12 === void 0 ? void 0 : _12.map(({ text }) => text)) === null || _13 === void 0 ? void 0 : _13.join(''), + type: typeName.replace(/Renderer/i, '') + }); + } + if (isMix) { + results.playlist.push({ + playlistId: result.playlistId, + title: result.title.simpleText, + thumbnail: result.thumbnail.thumbnails.pop().url, + video: result.videos.map(({ childVideoRenderer }) => { + return { + videoId: childVideoRenderer.videoId, + title: childVideoRenderer.title.simpleText, + durationH: childVideoRenderer.lengthText.accessibility + .accessibilityData.label, + duration: childVideoRenderer.lengthText.simpleText + }; + }), + type: 'mix' + }); + } + }); + return results; +} +exports.default = youtubeSearch; +const durationMultipliers = { + 1: { + 0: 1 + }, + 2: { + 0: 60, + 1: 1 + }, + 3: { + 0: 3600, + 1: 60, + 2: 1 + } +}; +//# sourceMappingURL=youtube-search.js.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/cjs/social-media/youtube-search.js.map b/node_modules/@bochilteam/scraper/lib/cjs/social-media/youtube-search.js.map new file mode 100644 index 000000000..15aa6db3e --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/cjs/social-media/youtube-search.js.map @@ -0,0 +1 @@ +{"version":3,"file":"youtube-search.js","sourceRoot":"","sources":["../../../src/social-media/youtube-search.ts"],"names":[],"mappings":";;;;;AAAA,sDAA6B;AAC7B,8CAAqB;AAIN,KAAK,UAAU,aAAa,CACzC,KAAa;IAEb,MAAM,IAAI,GAAG,MAAM,IAAA,aAAG,EAAC,iCAAiC,EAAE;QACxD,OAAO,EAAE;YACP,YAAY,EACV,qHAAqH;SACxH;QACD,YAAY,EAAE;YACZ,YAAY,E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,kBAAkB,CAAC,KAAK,CAAC,UAAU;wBAC1C,SAAS,EACP,kBAAkB,CAAC,UAAU,CAAC,aAAa;6BACxC,iBAAiB,CAAC,KAAK;wBAC5B,QAAQ,EAAE,kBAAkB,CAAC,UAAU,CAAC,UAAU;qBACnD,CAAA;gBACH,CAAC,CAAC;gBACF,IAAI,EAAE,KAAK;aACZ,CAAC,CAAA;SACH;IACH,CAAC,CAAC,CAAA;IACF,OAAO,OAAO,CAAA;AAChB,CAAC;AAjJD,gCAiJC;AAED,MAAM,mBAAmB,GAAiD;IACxE,CAAC,EAAE;QACD,CAAC,EAAE,CAAC;KACL;IACD,CAAC,EAAE;QACD,CAAC,EAAE,EAAE;QACL,CAAC,EAAE,CAAC;KACL;IACD,CAAC,EAAE;QACD,CAAC,EAAE,IAAI;QACP,CAAC,EAAE,EAAE;QACL,CAAC,EAAE,CAAC;KACL;CACF,CAAA"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/cjs/social-media/youtube.js b/node_modules/@bochilteam/scraper/lib/cjs/social-media/youtube.js new file mode 100644 index 000000000..02e6fe5c8 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/cjs/social-media/youtube.js @@ -0,0 +1,301 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.youtubedlv3 = exports.youtubedlv2 = exports.youtubedl = void 0; +const cheerio_1 = __importDefault(require("cheerio")); +const got_1 = __importDefault(require("got")); +const utils_js_1 = require("../utils.js"); +const human_readable_1 = require("human-readable"); +const toFormat = (0, human_readable_1.sizeFormatter)({ + std: 'JEDEC', + decimalPlaces: 2, + keepTrailingZeroes: false, + render: (literal, symbol) => `${literal} ${symbol}B` +}); +// https://github.com/BochilGaming/games-wabot/blob/main/lib/y2mate.js +const servers = ['en163', 'id90', 'en172']; +async function youtubedl(url, server = 'en163') { + if (!servers.includes(server)) + server = servers[0]; + const params = { + url: url, + q_auto: 0, + ajax: 1 + }; + const json = await got_1.default + .post(`https://www.y2mate.com/mates/${server}/analyze/ajax`, { + headers: { + 'content-type': 'application/x-www-form-urlencoded; charset=UTF-8', + cookie: '_ga=GA1.2.1405332118.1641699259; _gid=GA1.2.70284915.1642387108; _gat_gtag_UA_84863187_23=1', + origin: 'https://www.y2mate.com' + }, + form: params + }) + .json(); + const $ = cheerio_1.default.load(json.result); + const id = (/var k__id = "(.*?)"/.exec($.html()) || ['', ''])[1]; + const v_id = (/var k_data_vid = "(.*?)"/.exec($.html()) || ['', ''])[1]; + const thumbnail = $('.video-thumbnail > img').attr('src'); + const title = $('div.caption > b').text().trim(); + const video = {}; + const audio = {}; + $('#mp4 > table > tbody > tr').each(function () { + var _a, _b, _c; + const el = $(this).find('td'); + const _quality = el.eq(0).find('a').text(); + const quality = (_c = (_b = (_a = _quality.split('(')) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.trim()) === null || _c === void 0 ? void 0 : _c.toLowerCase(); + const fileSizeH = el.eq(1).text(); + if (!/\.3gp/i.test(_quality)) { + video[quality] = { + quality, + fileSizeH, + fileSize: parseFloat(fileSizeH) * (/MB$/.test(fileSizeH) ? 1000 : 1), + download: convert.bind(null, id, v_id, 'mp4', quality.replace(/p/i, '')) + }; + } + }); + $('#mp3 > table > tbody > tr').each(function () { + var _a, _b, _c, _d; + const el = $(this).find('td'); + const _quality = el.eq(0).find('a').text(); + const quality = (_d = (_c = (_b = (_a = _quality + .split('(')) === null || _a === void 0 ? void 0 : _a[1]) === null || _b === void 0 ? void 0 : _b.replace(')', '')) === null || _c === void 0 ? void 0 : _c.trim()) === null || _d === void 0 ? void 0 : _d.toLowerCase(); + const fileSizeH = el.eq(1).text(); + audio[quality] = { + quality, + fileSizeH, + fileSize: parseFloat(fileSizeH) * (/MB$/.test(fileSizeH) ? 1000 : 1), + download: convert.bind(null, id, v_id, 'mp3', quality.replace(/kbps/i, '')) + }; + }); + return { + id, + v_id, + thumbnail, + title, + video, + audio + }; +} +exports.youtubedl = youtubedl; +async function youtubedlv2(url) { + const html = await (0, got_1.default)('https://yt5s.com/en32').text(); + const urlAjax = (/k_url_search="(.*?)"/.exec(html) || ['', ''])[1]; + const urlConvert = (/k_url_convert="(.*?)"/.exec(html) || ['', ''])[1]; + const params = { + q: url, + vt: 'home' + }; + const json = await (0, got_1.default)(urlAjax, { + method: 'POST', + headers: { + 'content-type': 'application/x-www-form-urlencoded; charset=UTF-8', + cookie: '__cflb=04dToSoFRg9oqH9pYF2En9gKJK4fe8D9TcYtUD6tYu; _ga=GA1.2.1350132744.1641709803; _gid=GA1.2.1492233267.1641709803; _gat_gtag_UA_122831834_4=1', + origin: 'https://yt5s.com', + 'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.110 Safari/537.36' + }, + searchParams: new URLSearchParams(Object.entries(params)) + }).json(); + const video = {}; + Object.values(json.links.mp4).forEach(({ k, size }) => { + video[k] = { + quality: k, + fileSizeH: size, + fileSize: parseFloat(size) * (/MB$/.test(size) ? 1000 : 1), + // @ts-ignore + download: convertv2.bind(null, urlConvert, json.vid, 'mp4', k, json.token, parseInt(json.timeExpires), json.fn) + }; + }); + const audio = {}; + Object.values(json.links.mp3).forEach(({ key, size }) => { + audio[key] = { + quality: key, + fileSizeH: size, + fileSize: parseFloat(size) * (/MB$/.test(size) ? 1000 : 1), + // @ts-ignore + download: convertv2.bind(null, urlConvert, json.vid, 'mp3', key.replace(/kbps/i, ''), json.token, parseInt(json.timeExpires), json.fn) + }; + }); + return { + id: json.vid, + title: json.title, + thumbnail: `https://i.ytimg.com/vi/${json.vid}/0.jpg`, + video, + audio + }; +} +exports.youtubedlv2 = youtubedlv2; +async function youtubedlv3(url) { + const payload = { + url + }; + const { id, meta: { title }, thumb, url: results } = await got_1.default.post('https://api.onlinevideoconverter.pro/api/convert', { + headers: { + accept: 'application/json, text/plain, */*', + 'accept-encoding': 'gzip, deflate, br', + 'accept-language': 'en-US,en;q=0.9', + 'content-type': 'application/json', + origin: 'https://onlinevideoconverter.pro', + referer: 'https://onlinevideoconverter.pro/', + 'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36' + }, + body: JSON.stringify(payload) + }).json(); + const video = {}; + const audioArray = {}; + results.forEach(({ url, info_url, attr, quality, audio, no_audio, filesize, ext }) => { + if (!no_audio && ext === 'mp4') { + video[quality] = { + quality, + fileSizeH: (filesize && toFormat(filesize)) || undefined, + fileSize: filesize, + download: async () => (url || info_url) + }; + } + if (audio && !no_audio) { + audioArray[quality] = { + quality, + fileSizeH: (filesize && toFormat(filesize)) || undefined, + fileSize: filesize, + download: async () => (url || info_url) + }; + } + }); + return { + id, + title, + thumbnail: thumb, + video, + audio: audioArray + }; +} +exports.youtubedlv3 = youtubedlv3; +async function convert(_id, v_id, ftype, fquality) { + const params = { + type: 'youtube', + _id, + v_id, + ajax: '1', + token: '', + ftype, + fquality + }; + const json = await (0, got_1.default)('https://www.y2mate.com/mates/convert', { + method: 'POST', + headers: { + 'content-type': 'application/x-www-form-urlencoded; charset=UTF-8', + cookie: '_ga=GA1.2.1405332118.1641699259; _gid=GA1.2.1117783105.1641699259; MarketGidStorage=%7B%220%22%3A%7B%7D%2C%22C702514%22%3A%7B%22page%22%3A2%2C%22time%22%3A1641701743540%7D%7D; _PN_SBSCRBR_FALLBACK_DENIED=1641701744162', + 'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.110 Safari/537.36' + }, + form: params + }).json(); + const $ = cheerio_1.default.load(json.result); + const link = $('a[href]').attr('href'); + if (link === 'https://app.y2mate.com/download') + throw new utils_js_1.ScraperError(JSON.stringify({ link, json: json }, null, 2)); + return link; +} +function convertv2(url, v_id, ftype, fquality, token, timeExpire, fname) { + return new Promise(async (resolve, reject) => { + const params = { + v_id, + ftype, + fquality, + token, + timeExpire, + client: 'yt5s.com' + }; + const resServer = await (0, got_1.default)(url, { + method: 'POST', + headers: { + 'content-type': 'application/x-www-form-urlencoded; charset=UTF-8', + origin: 'https://yt5s.com', + referer: 'https://yt5s.com/', + 'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.110 Safari/537.36', + 'X-Requested-Key': 'de0cfuirtgf67a' + }, + form: params + }).json(); + const server = resServer.c_server; + if (!server && ftype === 'mp3') + return resolve(server || resServer.d_url || ''); + const payload = { + v_id, + ftype, + fquality, + fname, + token, + timeExpire + }; + const results = await (0, got_1.default)(`${server}/api/json/convert`, { + method: 'POST', + form: payload + }).json(); + if (results.statusCode === 200) + return resolve(results.result); + else if (results.statusCode === 300) { + try { + // @ts-ignore + const WebSocket = (await Promise.resolve().then(() => __importStar(require('ws')))).default; + const Url = new URL(server); + const WSUrl = `${/https/i.test(Url.protocol) ? 'wss:' : 'ws:'}//${Url.host}/sub/${results.jobId}?fname=yt5s.com`; + const ws = new WebSocket(WSUrl, undefined, { + headers: { + 'Accept-Encoding': 'gzip, deflate, br', + Host: Url.host, + Origin: 'https://yt5s.com', + 'Sec-WebSocket-Extensions': 'permessage-deflate; client_max_window_bits', + 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.110 Safari/537.36' + } + }); + ws.on('message', function incoming(message) { + const msg = JSON.parse(message.toString()); + if (msg.action === 'success') { + try { + ws.close(); + } + catch (e) { + console.error(e); + } + ws.removeAllListeners('message'); + return resolve(msg.url); + } + else if (msg.action === 'error') + return reject(msg); + }); + } + catch (e) { + console.error(e); + return reject(e); + } + } + else + return reject(results); + }); +} +//# sourceMappingURL=youtube.js.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/cjs/social-media/youtube.js.map b/node_modules/@bochilteam/scraper/lib/cjs/social-media/youtube.js.map new file mode 100644 index 000000000..78628ad7a --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/cjs/social-media/youtube.js.map @@ -0,0 +1 @@ +{"version":3,"file":"youtube.js","sourceRoot":"","sources":["../../../src/social-media/youtube.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,sDAA6B;AAC7B,8CAAqB;AACrB,0CAA0C;AAQ1C,mDAA8C;AAE9C,MAAM,QAAQ,GAAG,IAAA,8BAAa,EAAC;IAC7B,GAAG,EAAE,OAAO;IACZ,aAAa,EAAE,CAAC;IAChB,kBAAkB,EAAE,KAAK;IACzB,MAAM,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,CAAC,GAAG,OAAO,IAAI,MAAM,GAAG;CACrD,CAAC,CAAA;AAOF,sEAAsE;AACtE,MAAM,OAAO,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,CAAA;AACnC,KAAK,UAAU,SAAS,CAC7B,GAAW,EACX,SAAiB,OAAO;IAExB,IAAI,CAAC,OAAO,C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CAAC,SAAS,CAAC,CAAA;wBAChC,OAAO,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;qBACxB;yBAAM,IAAI,GAAG,CAAC,MAAM,KAAK,OAAO;wBAAE,OAAO,MAAM,CAAC,GAAG,CAAC,CAAA;gBACvD,CAAC,CAAC,CAAA;aACH;YAAC,OAAO,CAAC,EAAE;gBACV,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;gBAChB,OAAO,MAAM,CAAC,CAAC,CAAC,CAAA;aACjB;SACF;;YAAM,OAAO,MAAM,CAAC,OAAO,CAAC,CAAA;IAC/B,CAAC,CAAC,CAAA;AACJ,CAAC"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/cjs/texts/aksarajawa.js b/node_modules/@bochilteam/scraper/lib/cjs/texts/aksarajawa.js new file mode 100644 index 000000000..21afdcf4c --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/cjs/texts/aksarajawa.js @@ -0,0 +1,2041 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.aksaraToLatin = exports.latinToAksara = void 0; +function latinToAksara(str, options = { mode: 'ketik', space: true }) { + const aksara = new Aksara(str, options); + return aksara.toAksara(); +} +exports.latinToAksara = latinToAksara; +function aksaraToLatin(str, options = { HVokal: false }) { + const aksara = new Aksara(str, options); + return aksara.toLatin(); +} +exports.aksaraToLatin = aksaraToLatin; +// https://bennylin.github.io/transliterasijawa/ +// https://jv.wikipedia.org/w/index.php?title=Panganggo:Bennylin/trans.js&action=raw&ctype=text/javascript +const SuperTrim = (str) => str.replace(/^\s*|\s*$/g, '').replace(/\s+/g, ' '); // trim string, menemukan karakter di dalam string +const findstr = (str, find) => { + for (let i = 0; i < str.length; i++) + if (str[i] == find) + return true; + return false; +}; +const isDigit = (a) => findstr('0123456789', a); +const isPunct = (a) => findstr(',.> findstr('AaĂăEeÈèÉéIiOoUuÊêĚěĔĕṚṛXxôâāīūōåɔə', a); +const isConsonant = (a) => findstr('BCDfGHJKLMNPQRSTVWYZbcdfghjklmnpqrstvwyzḌḍṆṇṢṣṬṭŊŋÑñɲś', a); // Xx are vowels (pepet) +const isSpecial = (a) => findstr('GgHhRrYyñn', a); // untuk bikonsonan th, dh, ng (nga dan cecak), ny, -r- (cakra), -y- (pengkal), jñ/jnya (ꦘ) +const isHR = (a) => findstr('HhRrŊŋ', a); // untuk layar dan wignyan dan cecak ([[:en:w:Engma]]) +const isLW = (a) => findstr('LlWw', a); // untuk panjingan ("ng" dapat diikuti "g", "r"/cakra, "y"/pengkal, dan "w" atau "l"/panjingan) +const isCJ = (a) => findstr('CcJj', a); // untuk anuswara -nj- dan -nc- +const GetSpecialSound = (str) => { + const specialsoundMap = { + f: 'ꦥ꦳꧀', + v: 'ꦮ꦳꧀', + z: 'ꦗ꦳꧀', + ś: 'ꦯ꧀', + Q: '꧀', + q: '꧀' /* pangkon */ + }; + if (specialsoundMap[str] !== undefined) + return specialsoundMap[str]; + return null; +}; +class Aksara { + constructor(str, opts = { mode: 'ketik', space: true, HVokal: true }) { + this.opts = opts; + this.str = ''; + this.str2 = ''; + this.spasi = ''; + this.str = str.toString(); + this.angkaFlag = opts.number; + this.cecakFlag = opts.cecak; + this.diftong = opts.diftong; + this.modeSpasi = opts.space; + this.murda = opts.murda; + this.mode = opts.mode; + this.isHVokal = opts.HVokal; + } + toAksara() { + let i = 0; + let ret = ''; + let pi = 0; // ?offset + const angka = { + 0: '꧐', + 1: '꧑', + 2: '꧒', + 3: '꧓', + 4: '꧔', + 5: '꧕', + 6: '꧖', + 7: '꧗', + 8: '꧘', + 9: '꧙' + }; + this.str = SuperTrim(this.str); + while (i < this.str.length) { + if (i > 0 && isVowel(this.str[i]) && isVowel(this.str[i - 1])) { + // deal with words that start with multiple vocals + if ((this.str[i - 1] == 'a' && this.str[i] == 'a') || + (this.str[i - 1] == 'i' && this.str[i] == 'i') || + (this.str[i - 1] == 'u' && this.str[i] == 'u') || + (this.str[i - 1] == 'a' && this.str[i] == 'i') || + (this.str[i - 1] == 'a' && this.str[i] == 'u')) { + // specials + if (i == 1 || (i > 1 && !isConsonant(this.str[i - 2]))) { + // for example if starts with 'ai-' + this.str = + this.str.substring(0, i) + + 'h' + + this.str.substring(i, this.str.length); + } + else { + // var modeDiftong = document.getElementsByName("diftong"); + // for (var rad in modeDiftong) { + // if (modeDiftong[rad].checked) + // diftong = modeDiftong[rad].value; + // } + if (this.diftong) { + // do nothing, look in matramap table if(diftong == "tidak") + } + else { + this.str = + this.str.substring(0, i) + + 'h' + + this.str.substring(i, this.str.length); + } + } + } + else if ((this.str[i - 1] == 'e' || + this.str[i - 1] == 'è' || + this.str[i - 1] == 'é') && + (this.str[i] == 'a' || this.str[i] == 'o')) { + // -y- + this.str = + this.str.substring(0, i) + + 'y' + + this.str.substring(i, this.str.length); + } + else if (this.str[i - 1] == 'i' && + (this.str[i] == 'a' || + this.str[i] == 'e' || + this.str[i] == 'è' || + this.str[i] == 'é' || + this.str[i] == 'o' || + this.str[i] == 'u')) { + // -y- + this.str = + this.str.substring(0, i) + + 'y' + + this.str.substring(i, this.str.length); + } + else if (this.str[i - 1] == 'o' && + (this.str[i] == 'a' || + this.str[i] == 'e' || + this.str[i] == 'è' || + this.str[i] == 'é')) { + // -w- + this.str = + this.str.substring(0, i) + + 'w' + + this.str.substring(i, this.str.length); + } + else if (this.str[i - 1] == 'u' && + (this.str[i] == 'a' || + this.str[i] == 'e' || + this.str[i] == 'è' || + this.str[i] == 'é' || + this.str[i] == 'i' || + this.str[i] == 'o')) { + // -y- + this.str = + this.str.substring(0, i) + + 'w' + + this.str.substring(i, this.str.length); + } + else { + this.str = + this.str.substring(0, i) + + 'h' + + this.str.substring(i, this.str.length); + } + } + if ((isSpecial(this.str[i]) || isLW(this.str[i]) || isCJ(this.str[i])) && + !this.vowelFlag) { + // i++; + } + else if ((this.str[i] == 'h' && this.vowelFlag) || + (!isVowel(this.str[i]) && i > 0) || + this.str[i] == ' ' || + isPunct(this.str[i]) || + isDigit(this.str[i]) || + i - pi > 5) { + if (!isDigit(this.str[i]) && this.angkaFlag) { + // turn off the flag + ret += '꧇​'; // with zws + this.angkaFlag = false; + } + if (pi < i) { + if (this.cecakFlag && + this.GetSound(this.str.substring(pi, i)) == 'ꦁ') { + this.cecakFlag = false; + ret += 'ꦔ꧀ꦔ'; + } + else if (!this.cecakFlag && + this.GetSound(this.str.substring(pi, i)) == 'ꦁ') { + this.cecakFlag = true; + ret += 'ꦁ​'; + } + else { + this.cecakFlag = false; + ret += this.GetSound(this.str.substring(pi, i)); + } + } + if (this.str[i] == ' ') { + // var spasi, modeSpasi; + // var pakaiSpasi = document.getElementsByName("spasi"); + // for (var rad in pakaiSpasi) { + // if (pakaiSpasi[rad].checked) + // modeSpasi = pakaiSpasi[rad].value; + // } + if (this.modeSpasi) { + // if space preceeded by open vowel, or layar/wignyan (therefore, no pangkon/virama) + if (i > 0 && + ['a', 'e', 'i', 'o', 'u', 'r', 'h', 'ě'].indexOf(this.str[i - 1]) >= 0) { + this.spasi = '​'; // zero-width space + } + else { + this.spasi = ''; + } + } + else { + // if(mode == "with") + this.spasi = '​'; // zero-width space + // spasi = ' '; }//hair space http://en.wikipedia.org/wiki/Space_(punctuation)#Spaces_in_Unicode + } + ret += this.spasi; + } + if (isPunct(this.str[i])) { + if (this.str[i] == '.') { + ret += '꧉​'; // titik+zero-width space + pi = i + 1; + } + else if (this.str[i] == ',') { + ret += '꧈​'; // koma+zero-width space + pi = i + 1; + } + else if (this.str[i] == ':') { + ret += '꧇​'; // titik dua+zero-width space + pi = i + 1; + } + else if (this.str[i] == '|') { + ret += '꧋'; + pi = i + 1; + /* comment out, not really a good way to do brackets + } else if (str[i] == '(') { + ret += "꧌"; pi = i + 1; + } else if (str[i] == ')') { + ret += "꧍​"; pi = i + 1;// with zws + */ + } + else if (this.str[i] == '-') { + // tanda hubung + ret += '​'; + pi = i + 1; + } + else if (this.str[i] == '?' || + this.str[i] == '!' || + this.str[i] == '"' || + this.str[i] == "'") { + // tanda tanya/seru/petik + ret += '​'; // zero-width space + pi = i + 1; + } + else { + ret += this.str[i]; + pi = i + 1; + } + } + else if (isDigit(this.str[i])) { + if (!this.angkaFlag) + ret += '꧇'; + ret += angka[this.str[i]]; + this.angkaFlag = true; + pi = i + 1; + } + else { + pi = i; + } + this.vowelFlag = false; + } + else if (isVowel(this.str[i]) && this.str[i] != 'h') { + if (!isDigit(this.str[i]) && this.angkaFlag) { + // turn off the flag + ret += '꧇​'; // with zws + this.angkaFlag = false; + } + this.vowelFlag = true; + } + if (pi > 0 && isVowel(this.str[pi - 1])) { + // ngg + this.vowelPrev = true; + } + else + this.vowelPrev = false; + /* not working + if (pi > 0 && findstr(" ",str[pi-1])) {//ngg + spacePrev = true; + } + else spacePrev = false; */ + i++; + } // endwhile + if (pi < i) { + ret += this.GetSound(this.str.substring(pi, i)); + } + return SuperTrim(ret).toString(); + } + GetMatra(str) { + let i = 0; + if (str.length < 1) { + return '꧀'; + } + while (str[i] == 'h') { + i++; + if (i >= str.length) { + break; + } + } + if (i < str.length) { + str = str.substring(i); + } + const matramap1 = { e: 'ꦺ', E: 'ꦌ' }; // mode ketik + const matramap2 = { e: 'ꦼ', E: 'ꦄꦼ' }; // mode kopas + const matramap3 = { + // both mode ketik and kopas + ā: 'ꦴ', + â: 'ꦴ', + aa: 'ꦴ', + è: 'ꦺ', + é: 'ꦺ', + i: 'ꦶ', + ī: 'ꦷ', + ii: 'ꦷ', + o: 'ꦺꦴ', + ō: 'ꦼꦴ', + u: 'ꦸ', + ū: 'ꦹ', + uu: 'ꦹ', + x: 'ꦼ', + ě: 'ꦼ', + ĕ: 'ꦼ', + ê: 'ꦼ', + ə: 'ꦼ', + ô: '', + ă: '', + å: '', + ɔ: '', + A: 'ꦄ', + Ă: 'ꦄ', + È: 'ꦌ', + É: 'ꦌ', + I: 'ꦆ', + O: 'ꦎ', + U: 'ꦈ', + X: 'ꦄꦼ', + Ě: 'ꦄꦼ', + Ĕ: 'ꦄꦼ', + Ê: 'ꦄꦼ', + ṛ: 'ꦽ', + Ṛ: 'ꦽ', + ai: 'ꦻ', + au: 'ꦻꦴ' + }; + // var matramap, mode; + // var modeTranslit = document.getElementsByName("mode"); + // for (var rad in modeTranslit) { + // if (modeTranslit[rad].checked) + // mode = modeTranslit[rad].value; + // } + if (this.mode == 'kopas') + var matramap = { ...matramap2, ...matramap3 }; + // if(mode == "ketik") + else + var matramap = { ...matramap1, ...matramap3 }; + if (matramap[str] !== undefined) { + return matramap[str]; + } + return ''; + } + GetShift(str1) { + const str = str1.toLowerCase(); // case insensitive + // var modeMurda = document.getElementsByName("murda"); + // for (var rad in modeMurda) { + // if (modeMurda[rad].checked) + // murda = modeMurda[rad].value; + // } + if (this.murda) + this.str2 = str1; + // case sensitive (particularly the 8 characters of ꦛ ꦜ ꦝ ꦞ ꦠ ꦡ ꦢ ꦣ), + // for combination of murda and cakra/pengkal/panjingan + // if(murda == "tidak") + else + this.str2 = str1.toLowerCase(); // case insensitive + // V.1. 2nd letter of the consonant cluster is 'h' + if (this.str2.indexOf('th') == 0) { + // suku kata diawali 'th' + if (this.str2.indexOf('thl') == 0) { + // thl- + return { CoreSound: 'ꦛ꧀ꦭ', len: 3 }; + } + else if (this.str2.indexOf('thr') == 0) { + // thr- + return { CoreSound: 'ꦛꦿ', len: 3 }; + } + else if (this.str2.indexOf('thw') == 0) { + // thw- + return { CoreSound: 'ꦛ꧀ꦮ', len: 3 }; + } + else if (this.str2.indexOf('thy') == 0) { + // thy- + return { CoreSound: 'ꦛꦾ', len: 3 }; + } + else { + return { CoreSound: 'ꦛ', len: 2 }; // tha + } + } + else if (this.str2.indexOf('dh') == 0) { + // suku kata diawali 'dh' + if (this.str2.indexOf('dhl') == 0) { + // dhl- + return { CoreSound: 'ꦝ꧀ꦭ', len: 3 }; + } + else if (this.str2.indexOf('dhr') == 0) { + // dhr- + return { CoreSound: 'ꦝꦿ', len: 3 }; + } + else if (this.str2.indexOf('dhw') == 0) { + // dhw-: dhwani + return { CoreSound: 'ꦝ꧀ꦮ', len: 3 }; + } + else if (this.str2.indexOf('dhy') == 0) { + // dhy-: dhyaksa + return { CoreSound: 'ꦝꦾ', len: 3 }; + } + else { + return { CoreSound: 'ꦝ', len: 2 }; // dha + } + } + else if (this.str2.indexOf('Th') == 0) { + // suku kata diawali 'Th' + if (this.str2.indexOf('Thl') == 0) { + // Thl- + return { CoreSound: 'ꦜ꧀ꦭ', len: 3 }; + } + else if (this.str2.indexOf('Thr') == 0) { + // Thr- + return { CoreSound: 'ꦜꦿ', len: 3 }; + } + else if (this.str2.indexOf('Thw') == 0) { + // Thw- + return { CoreSound: 'ꦜ꧀ꦮ', len: 3 }; + } + else if (this.str2.indexOf('Thy') == 0) { + // Thy- + return { CoreSound: 'ꦜꦾ', len: 3 }; + } + else { + return { CoreSound: 'ꦜ', len: 2 }; // Tha Mahaprana + } + } + else if (this.str2.indexOf('Dh') == 0) { + // suku kata diawali 'Dh' + if (this.str2.indexOf('Dhl') == 0) { + // Dhl- + return { CoreSound: 'ꦞ꧀ꦭ', len: 3 }; + } + else if (this.str2.indexOf('Dhr') == 0) { + // Dhr- + return { CoreSound: 'ꦞꦿ', len: 3 }; + } + else if (this.str2.indexOf('Dhw') == 0) { + // Dhw-: Dhwani + return { CoreSound: 'ꦞ꧀ꦮ', len: 3 }; + } + else if (this.str2.indexOf('Dhy') == 0) { + // Dhy-: Dhyaksa + return { CoreSound: 'ꦞꦾ', len: 3 }; + } + else { + return { CoreSound: 'ꦞ', len: 2 }; // Dha Mahaprana + } + /* murda block start */ + } + else if (str.indexOf('ṭh') == 0) { + // ṭh (aksara murda: tha mahaprana) + if (str.indexOf('ṭhy') == 0) { + return { CoreSound: 'ꦜꦾ', len: 2 }; + } + else if (str.indexOf('ṭhr') == 0) { + return { CoreSound: 'ꦜꦿ', len: 2 }; + } + else + return { CoreSound: 'ꦜ', len: 2 }; + } + else if (str.indexOf('ḍh') == 0) { + // ḍh (aksara murda: dha mahaprana) + if (str.indexOf('ḍhy') == 0) { + return { CoreSound: 'ꦞꦾ', len: 2 }; + } + else if (str.indexOf('ḍhr') == 0) { + return { CoreSound: 'ꦞꦿ', len: 2 }; + } + else + return { CoreSound: 'ꦞ', len: 2 }; + } + else if (str.indexOf('kh') == 0) { + // kh (aksara murda: ka murda) + if (str.indexOf('khl') == 0) { + // ka murda + panjingan la + return { CoreSound: 'ꦑ꧀ꦭ', len: 3 }; + } + else if (str.indexOf('khr') == 0) { + // ka murda + cakra + return { CoreSound: 'ꦑꦿ', len: 3 }; + } + else if (str.indexOf('khw') == 0) { + // ka murda + panjingan wa + return { CoreSound: 'ꦑ꧀ꦮ', len: 3 }; + } + else if (str.indexOf('khy') == 0) { + // ka murda + wignyan + return { CoreSound: 'ꦑꦾ', len: 3 }; + } + else { + return { CoreSound: 'ꦑ', len: 2 }; + } + } + else if (str.indexOf('gh') == 0) { + // gh (aksara murda: ga murda) + if (str.indexOf('ghl') == 0) { + // ga murda + panjingan la + return { CoreSound: 'ꦓ꧀ꦭ', len: 3 }; + } + else if (str.indexOf('ghw') == 0) { + // ga murda + panjingan wa + return { CoreSound: 'ꦓ꧀ꦮ', len: 3 }; + } + else if (str.indexOf('ghr') == 0) { + // ga murda + cakra + return { CoreSound: 'ꦓꦿ', len: 3 }; + } + else if (str.indexOf('ghy') == 0) { + // ga murda + wignyan + return { CoreSound: 'ꦓꦾ', len: 3 }; + } + else { + return { CoreSound: 'ꦓ', len: 2 }; + } + } + else if (str.indexOf('ch') == 0) { + // ch (aksara murda: ca murda) + if (str.indexOf('chl') == 0) { + // ca murda + panjingan la + return { CoreSound: 'ꦖ꧀ꦭ', len: 3 }; + } + else if (str.indexOf('chr') == 0) { + // ca murda + cakra + return { CoreSound: 'ꦖꦿ', len: 3 }; + } + else if (str.indexOf('chw') == 0) { + // ca murda + panjingan wa + return { CoreSound: 'ꦖ꧀ꦮ', len: 3 }; + } + else if (str.indexOf('chy') == 0) { + // ca murda + wignyan + return { CoreSound: 'ꦖꦾ', len: 3 }; + } + else { + return { CoreSound: 'ꦖ', len: 2 }; + } + } + else if (str.indexOf('jh') == 0) { + // jh (aksara murda: ja mahaprana) + if (str.indexOf('jhl') == 0) { + // ja mahaprana + panjingan la + return { CoreSound: 'ꦙ꧀​ꦭ', len: 3 }; // with zws, otherwise the panjingan is overlapped + } + else if (str.indexOf('jhr') == 0) { + // ja mahaprana + cakra + return { CoreSound: 'ꦙꦿ', len: 3 }; + } + else if (str.indexOf('jhw') == 0) { + // ja mahaprana + panjingan wa + return { CoreSound: 'ꦙ꧀ꦮ', len: 3 }; + } + else if (str.indexOf('jhy') == 0) { + // ja mahaprana + wignyan + return { CoreSound: 'ꦙꦾ', len: 3 }; + } + else { + return { CoreSound: 'ꦙ', len: 2 }; + } + } + else if (str.indexOf('ph') == 0) { + // ph (aksara murda: pa murda) + if (str.indexOf('phl') == 0) { + // pa murda + panjingan la + return { CoreSound: 'ꦦ꧀ꦭ', len: 3 }; + } + else if (str.indexOf('phr') == 0) { + // pa murda + cakra + return { CoreSound: 'ꦦꦿ', len: 3 }; + } + else if (str.indexOf('phw') == 0) { + // pa murda + panjingan wa + return { CoreSound: 'ꦦ꧀ꦮ', len: 3 }; + } + else if (str.indexOf('phy') == 0) { + // pa murda + wignyan + return { CoreSound: 'ꦦꦾ', len: 3 }; + } + else { + return { CoreSound: 'ꦦ', len: 2 }; + } + } + else if (str.indexOf('bh') == 0) { + // bh (aksara murda: ba murda) + if (str.indexOf('bhl') == 0) { + // ba murda + panjingan la + return { CoreSound: 'ꦨ꧀ꦭ', len: 3 }; + } + else if (str.indexOf('bhr') == 0) { + // ba murda + cakra + return { CoreSound: 'ꦨꦿ', len: 3 }; + } + else if (str.indexOf('bhw') == 0) { + // ba murda + panjingan wa + return { CoreSound: 'ꦨ꧀ꦮ', len: 3 }; + } + else if (str.indexOf('bhy') == 0) { + // ba murda + wignyan + return { CoreSound: 'ꦨꦾ', len: 3 }; + } + else { + return { CoreSound: 'ꦨ', len: 2 }; + } + } + else if (str.indexOf('sh') == 0) { + // sh (aksara murda: sa murda) + if (str.indexOf('shl') == 0) { + // sa murda + panjingan la + return { CoreSound: 'ꦯ꧀ꦭ', len: 3 }; + } + else if (str.indexOf('shr') == 0) { + // sa murda + cakra + return { CoreSound: 'ꦯꦿ', len: 3 }; + } + else if (str.indexOf('shw') == 0) { + // sa murda + panjingan wa + return { CoreSound: 'ꦯ꧀ꦮ', len: 3 }; + } + else if (str.indexOf('shy') == 0) { + // sa murda + wignyan + return { CoreSound: 'ꦯꦾ', len: 3 }; + } + else { + return { CoreSound: 'ꦯ', len: 2 }; + } + /* murda block end */ + // Uncatched exception: -h followed by hy, hr, hl, hw + } + else if (str.indexOf('hh') == 0) { + // wignyan + ha, e.g. root word ends with 'h' with suffix -i + return { CoreSound: 'ꦃꦲ', len: 2 }; + // Uncatched exception: -r followed by hy, hr, hl, hw + } + else if (str.indexOf('rh') == 0) { + // layar + ha + return { CoreSound: 'ꦂꦲ', len: 2 }; + } + else if (str.indexOf('h') == 1) { + // h (h di posisi karakter kedua) + return { + CoreSound: '' + this.GetCoreSound(this.str2[0]).CoreSound + '꧀ꦲ', + len: 2 + }; + } + // V.2. 2nd letter is 'g' + if (str.indexOf('ng') == 0) { + // suku kata diawali 'ng' + // Uncatched exception: -ng followed by ry, rw, rl + if (str.indexOf('ngr') == 0) { + // cakra (for cecak + ra, separate by a space) + return { CoreSound: '' + 'ꦔꦿ', len: 3 }; + } + else if (str.indexOf('ngy') == 0) { + // pengkal (for cecak + ya, separate by a space) + return { CoreSound: '' + 'ꦔꦾ', len: 3 }; + // Uncatched exception: -ng followed by hy, hr, hl + } + else if (str.indexOf('nghw') == 0) { + // tyonghwa + return { CoreSound: '' + 'ꦁꦲ꧀ꦮ​', len: 4 }; + } + else if (str.indexOf('ngg') == 0) { + // cecak + ga + if (str.indexOf('nggr') == 0) { + // nggronjal + return { CoreSound: 'ꦔ꧀ꦒꦿ', len: 4 }; + } + else if (str.indexOf('nggl') == 0) { + // nggl- + return { CoreSound: 'ꦔ꧀ꦒ꧀ꦭ', len: 4 }; + } + else if (str.indexOf('nggw') == 0) { + // nggw-, munggwing + return { CoreSound: 'ꦔ꧀ꦒ꧀ꦮ', len: 4 }; + } + else if (str.indexOf('nggy') == 0) { + // nggy-, anggyat + return { CoreSound: 'ꦔ꧀ꦒꦾ', len: 4 }; + } + else { + return { CoreSound: 'ꦔ꧀ꦒ', len: 3 }; + } + } + else if (str.indexOf('ngn') == 0) { + // cecak + na + // Uncatched exception: -ng followed by ngy, ngr, ngl, ngw + if (str.indexOf('ngng') == 0) { + // ngng + return { CoreSound: 'ꦁ​ꦔ', len: 4 }; + } + else { + return { CoreSound: 'ꦁ​ꦤ', len: 3 }; + } + } + else if (str.indexOf('ngh') == 0) { + // cecak + ha + return { CoreSound: 'ꦁ​ꦲ', len: 3 }; + } + else if (str.indexOf('ngc') == 0) { + // cecak + ca + return { CoreSound: 'ꦁ​ꦕ', len: 3 }; + } + else if (str.indexOf('ngj') == 0) { + // cecak + ja + return { CoreSound: 'ꦁ​ꦗ', len: 3 }; + } + else if (str.indexOf('ngl') == 0) { + // ngl, e.g. ngluwari + return { CoreSound: 'ꦔ꧀ꦭ', len: 3 }; + } + else if (str.indexOf('ngw') == 0) { + // ngw, e.g. ngwiru + return { CoreSound: 'ꦔ꧀ꦮ', len: 3 }; + } + else { + return { CoreSound: 'ꦁ​', len: 2 }; // cecak, with zws + } + } + else if (str.indexOf('gg') == 0) { + // 'gg', e.g. root word ends with 'g' with suffix -i + return { CoreSound: 'ꦒ꧀ꦒ', len: 2 }; + } + else if (str.indexOf('hg') == 0) { + // wignyan + ga, e.g. dahgene + return { CoreSound: 'ꦃꦒ', len: 2 }; + } + else if (str.indexOf('rg') == 0) { + // layar + ga, e.g. amarga + return { CoreSound: 'ꦂꦒ', len: 2 }; + } + else if (str.indexOf('g') == 1) { + // g (g di posisi karakter kedua) + return { + CoreSound: '' + this.GetCoreSound(this.str2[0]).CoreSound + '꧀ꦒ', + len: 2 + }; + } + // V.3. 2nd letter is 'y' + if (str.indexOf('ny') == 0) { + // suku kata diawali 'ny' + if (str.indexOf('nyr') == 0) { + // cakra + return { CoreSound: 'ꦚꦿ', len: 3 }; /* + } else if (str.indexOf("nyy") == 0) { //nyy, I don't think it's possible + return { "CoreSound": "ꦚꦾ", "len": 3 }; */ + } + else if (str.indexOf('nyl') == 0) { + // nyl, e.g. nylonong + return { CoreSound: 'ꦚ꧀ꦭ', len: 3 }; + } + else if (str.indexOf('nyw') == 0) { + // nyw + return { CoreSound: 'ꦚ꧀ꦮ', len: 3 }; /* + } else if (str2.indexOf("Ny") == 0) { //Na murda + pengkal, unlikely combination? + return { "CoreSound": "ꦟꦾ", "len": 2 }; */ + } + else { + return { CoreSound: 'ꦚ', len: 2 }; + } + } + else if (str.indexOf('hy') == 0) { + // wignyan + ya / ha + pengkal -- hyang + return { CoreSound: 'ꦲꦾ', len: 2 }; + } + else if (this.str2.indexOf('ry') == 0) { + // layar + ya, e.g. Suryati, Wiryadi + if (str.indexOf('ryy') == 0) { + return { CoreSound: 'ꦂꦪꦾ', len: 3 }; // 'ryy', e.g. Duryyodhana (Jawa Kuno) + } + else { + return { CoreSound: 'ꦂꦪ', len: 2 }; + } /* + } else if (str.indexOf("yy") == 0) { //'yy', I don't think it's possible + return { "CoreSound": "ꦪꦾ", "len": 2 }; */ + } + else if (this.str2.indexOf('qy') == 0) { + // qy -- only pengkal + return { CoreSound: 'ꦾ', len: 1 }; + } + else if (str.indexOf('y') == 1) { + // pengkal (y di posisi karakter kedua) + return { + CoreSound: '' + this.GetCoreSound(this.str2[0]).CoreSound + 'ꦾ', + len: 2 + }; + } + // V.4. 2nd letter is 'r' + // Uncatched exception: -h followed by ry, rw, rl + if (str.indexOf('hr') == 0) { + // wignyan + ra / ha + cakra + return { CoreSound: 'ꦲꦿ', len: 2 }; + } + else if (str.indexOf('wr') == 0) { + // wr -- panjingan + cakra + return { CoreSound: '' + 'ꦮꦿ', len: 2 }; + // Uncatched exception: -r followed by ry, rw, rl + } + else if (str.indexOf('rr') == 0) { + // layar + ra (no cakra) + return { CoreSound: 'ꦂꦫ', len: 2 }; + } + else if (this.str2.indexOf('qr') == 0) { + // qr -- only pasangan ra + return { CoreSound: '꧀ꦫ', len: 1 }; + } + else if (this.str2.indexOf('qR') == 0) { + // qR -- only cakra + return { CoreSound: 'ꦿ', len: 1 }; + } + else if (str.indexOf('r') == 1) { + // cakra (r di posisi karakter kedua) + return { + CoreSound: '' + this.GetCoreSound(this.str2[0]).CoreSound + 'ꦿ', + len: 2 + }; + } + // V.5. 2nd letter is 'l' or 'w' + // panjingan -l + if (str.indexOf('hl') == 0) { + // wignyan + la + return { CoreSound: 'ꦃꦭ', len: 2 }; + } + else if (str.indexOf('rl') == 0) { + // layar + la + return { CoreSound: 'ꦂꦭ', len: 2 }; + } + else if (str.indexOf('ll') == 0) { + // ll + return { CoreSound: 'ꦭ꧀ꦭ', len: 2 }; + } + else if (str.indexOf('ql') == 0) { + // only panjingan + return { CoreSound: '꧀ꦭ', len: 2 }; + } + else if (str.indexOf('l') == 1) { + // (l di posisi karakter kedua) + return { + CoreSound: '' + this.GetCoreSound(this.str2[0]).CoreSound + '꧀ꦭ', + len: 2 + }; + } + // panjingan -w + if (str.indexOf('hw') == 0) { + // wignyan + ha + return { CoreSound: 'ꦃꦮ', len: 2 }; // ꦲ꧀ꦮ + } + else if (str.indexOf('rw') == 0) { + // layar + ha + return { CoreSound: 'ꦂꦮ', len: 2 }; // error untuk 'rwi', 'rwab' + } + else if (str.indexOf('ww') == 0) { + // ww (wwang, pûrwwa) - terima kasih Mas Revo + return { CoreSound: 'ꦮ꧀ꦮ', len: 2 }; + } + else if (str.indexOf('qw') == 0) { + // only panjingan + return { CoreSound: '꧀ꦮ', len: 2 }; + } + else if (str.indexOf('w') == 1) { + // (w di posisi karakter kedua) + return { + CoreSound: '' + this.GetCoreSound(this.str2[0]).CoreSound + '꧀ꦮ', + len: 2 + }; + } + // V.6. 2nd letter is 'c' or 'j' + if (str.indexOf('nc') == 0) { + // nc + if (str.indexOf('ncr') == 0) { + // ncr -- kencrung + return { CoreSound: 'ꦚ꧀ꦕꦿ', len: 3 }; + } + else if (str.indexOf('ncl') == 0) { + // ncl -- kinclong + return { CoreSound: 'ꦚ꧀ꦕ꧀ꦭ', len: 3 }; + } + else { + return { CoreSound: 'ꦚ꧀ꦕ', len: 2 }; + } + } + else if (str.indexOf('hc') == 0) { + // wignyan + ca + return { CoreSound: 'ꦃꦕ', len: 2 }; + } + else if (str.indexOf('rc') == 0) { + // layar + ca -- arca + return { CoreSound: 'ꦂꦕ', len: 2 }; + } + else if (str.indexOf('cc') == 0) { + // cc -- impossible combination in real text + return { CoreSound: 'ꦕ꧀ꦕ', len: 2 }; + } + else if (this.str2.indexOf('qc') == 0) { + // only pasangan ca + return { CoreSound: '꧀ꦕ', len: 2 }; + } + else if (str.indexOf('c') == 1) { + // c + return { + CoreSound: '' + this.GetCoreSound(this.str2[0]).CoreSound + '꧀ꦕ', + len: 2 + }; + } + if (str.indexOf('nj') == 0) { + // nj + if (str.indexOf('njr') == 0) { + // njr -- anjrit + return { CoreSound: 'ꦚ꧀ꦗꦿ', len: 3 }; + } + else if (str.indexOf('njl') == 0) { + // njl -- anjlog + return { CoreSound: 'ꦚ꧀ꦗ꧀ꦭ', len: 3 }; + } + else { + return { CoreSound: 'ꦚ꧀ꦗ', len: 2 }; + } + } + else if (str.indexOf('hj') == 0) { + // wignyan + ja + return { CoreSound: 'ꦃꦗ', len: 2 }; + } + else if (str.indexOf('rj') == 0) { + // layar + ja + return { CoreSound: 'ꦂꦗ', len: 2 }; + } + else if (str.indexOf('jj') == 0) { + // jj -- impossible combination in real text + return { CoreSound: 'ꦗ꧀ꦗ', len: 2 }; + } + else if (this.str2.indexOf('qj') == 0) { + // only pasangan ja + return { CoreSound: '꧀ꦗ', len: 2 }; + } + else if (str.indexOf('j') == 1) { + // j + return { + CoreSound: '' + this.GetCoreSound(this.str2[0]).CoreSound + '꧀ꦗ', + len: 2 + }; + } + // V.7. 2nd letter is 'ñ' or 'n' + if (str.indexOf('jñ') == 0) { + // suku kata diawali 'jñ' + if (str.indexOf('jñl') == 0) { + // suku kata diawali 'jñ' - nya murda + return { CoreSound: 'ꦘ꧀ꦭ', len: 3 }; + } + else if (str.indexOf('jñr') == 0) { + // nya murda + cakra + return { CoreSound: 'ꦘꦿ', len: 3 }; + } + else if (str.indexOf('jñw') == 0) { + // nya murda + panjingan wa + return { CoreSound: 'ꦘ꧀ꦮ', len: 3 }; + } + else if (str.indexOf('jñy') == 0) { + // nya murda + wignyan + return { CoreSound: 'ꦘꦾ', len: 3 }; + } + else { + return { CoreSound: 'ꦘ', len: 2 }; + } + } + else if (str.indexOf('jn') == 0) { + // suku kata diawali 'jn' + if (str.indexOf('jny') == 0) { + // suku kata diawali 'jny' - nya murda + if (str.indexOf('jnyl') == 0) { + // suku kata diawali 'jny' - nya murda + return { CoreSound: 'ꦘ꧀ꦭ', len: 4 }; + } + else if (str.indexOf('jnyr') == 0) { + // nya murda + cakra + return { CoreSound: 'ꦘꦿ', len: 4 }; + } + else if (str.indexOf('jnyw') == 0) { + // nya murda + panjingan wa + return { CoreSound: 'ꦘ꧀ꦮ', len: 4 }; + } + else if (str.indexOf('jnyy') == 0) { + // nya murda + wignyan + return { CoreSound: 'ꦘꦾ', len: 4 }; + } + else { + return { CoreSound: 'ꦘ', len: 3 }; + } + } + else { + return { CoreSound: 'ꦗ꧀ꦤ', len: 2 }; + } + // Uncatched exception: -h followed by ngy, ngr, ngl, ngw + } + else if (str.indexOf('hn') == 0) { + // wignyan + na + return { CoreSound: 'ꦃꦤ', len: 2 }; + // Uncatched exception: -r followed by ngy, ngr, ngl, ngw + } + else if (str.indexOf('rn') == 0) { + // layar + na + return { CoreSound: 'ꦂꦤ', len: 2 }; + } + else if (str.indexOf('nn') == 0) { + // nn, e.g. root word ends with 'n' with suffix -i + if (str.indexOf('nng') == 0) { + // + return { CoreSound: 'ꦤ꧀ꦁ​', len: 3 }; + } + else if (str.indexOf('nng') == 0) { + // + return { CoreSound: 'ꦤ꧀ꦚ꧀', len: 3 }; + } + else { + return { CoreSound: 'ꦤ꧀ꦤ', len: 2 }; + } + } + else if (this.str2.indexOf('qn') == 0) { + // only pasangan na + return { CoreSound: '꧀ꦤ', len: 2 }; + } + else if (str.indexOf('ñ') == 1) { + // huruf asing sih sebenarnya, kemungkinan kecil muncul + return { + CoreSound: '' + this.GetCoreSound(this.str2[0]).CoreSound + '꧀ꦚ', + len: 2 + }; + } + else if (str.indexOf('n') == 1) { + // + return { + CoreSound: '' + this.GetCoreSound(this.str2[0]).CoreSound + '꧀ꦤ', + len: 2 + }; + } + // suku kata memiliki konsonan tersebut yang tidak di posisi kedua + if (str.indexOf('h') > 1 || + str.indexOf('g') > 1 || + str.indexOf('y') > 1 || + str.indexOf('r') > 1 || + str.indexOf('l') > 1 || + str.indexOf('w') > 1 || + str.indexOf('c') > 1 || + str.indexOf('j') > 1 || + str.indexOf('n') > 1 || + str.indexOf('ñ') > 1) { + let sound = ''; + let len = 0; + let index = 0; + for (index = 0; index < str.length; index++) { + const c = str[index]; + if (!isVowel(c)) { + sound += this.ResolveCharacterSound(c); + len++; + } + else { + break; + } + } + return { CoreSound: sound, len: len }; + } + return { CoreSound: null, len: 1 }; + } + GetCoreSound(str) { + const soundMap1 = { + // 26 uppercase for non-Murda, largely mirror lowercase, except AEIOU, and HR + A: 'ꦄ', + B: 'ꦧ', + C: 'ꦕ', + D: 'ꦢ', + E: 'ꦌ', + F: 'ꦥ꦳', + G: 'ꦒ', + H: 'ꦲ', + I: 'ꦆ', + J: 'ꦗ', + K: 'ꦏ', + L: 'ꦭ', + M: 'ꦩ', + N: 'ꦤ', + O: 'ꦎ', + P: 'ꦥ', + Q: '꧀', + R: 'ꦫ', + S: 'ꦱ', + T: 'ꦠ', + U: 'ꦈ', + V: 'ꦮ꦳', + W: 'ꦮ', + X: 'ꦼ', + Y: 'ꦪ', + Z: 'ꦰ' // Sa Mahaprana + // test: ABaCaDaEFaGaHaJaKaLaMaNaOPaRaSaTaUVaWaXYaZa + }; + const soundMap2 = { + // 26 uppercase for Murda (notice for J, Q, R, and Z) + A: 'ꦄ', + B: 'ꦨ', + C: 'ꦖ', + D: 'ꦣ', + E: 'ꦌ', + F: 'ꦦ꦳', + G: 'ꦓ', + H: 'ꦲ꦳', + I: 'ꦆ', + J: 'ꦙ', + K: 'ꦑ', + L: 'ꦭ', + M: 'ꦩ', + N: 'ꦟ', + O: 'ꦎ', + P: 'ꦦ', + Q: 'ꦐ', + R: 'ꦬ', + S: 'ꦯ', + T: 'ꦡ', + U: 'ꦈ', + V: 'ꦮ꦳', + W: 'ꦮ', + X: 'ꦼ', + Y: 'ꦪ', + Z: 'ꦰ' // Sa mahaprana + // test: ABaCaDaEFaGaHaJaKaLaMaNaOPaQaRaSaTaUVaWaXaYaZa + }; + const soundMap3 = { + // 26 lowercase + 35 special, same for both Murda or non-Murda + a: 'ꦲ', + b: 'ꦧ', + c: 'ꦕ', + d: 'ꦢ', + e: 'ꦲꦺ', + f: 'ꦥ꦳', + g: 'ꦒ', + h: 'ꦃ', + i: 'ꦲꦶ', + j: 'ꦗ', + k: 'ꦏ', + l: 'ꦭ', + m: 'ꦩ', + n: 'ꦤ', + o: 'ꦲꦺꦴ', + p: 'ꦥ', + q: '꧀', + r: 'ꦂ', + s: 'ꦱ', + t: 'ꦠ', + u: 'ꦲꦸ', + v: 'ꦮ꦳', + w: 'ꦮ', + x: 'ꦲꦼ', + y: 'ꦪ', + z: 'ꦗ꦳', + È: 'ꦌ', + É: 'ꦌ', + Ê: 'ꦄꦼ', + Ě: 'ꦄꦼ', + Ĕ: 'ꦄꦼ', + è: 'ꦲꦺ', + é: 'ꦲꦺ', + ê: 'ꦲꦼ', + ě: 'ꦲꦼ', + ĕ: 'ꦲꦼ', + ə: 'ꦲꦼ', + ɔ: 'ꦲ', + å: 'ꦲ', + ô: 'ꦲ', + â: 'ꦲꦴ', + ā: 'ꦲꦴ', + ī: 'ꦲꦷ', + ū: 'ꦲꦹ', + ō: 'ꦲꦼꦴ', + Ñ: 'ꦚ', + ñ: 'ꦚ', + ɲ: 'ꦚ', + Ŋ: 'ꦔ', + ŋ: 'ꦔ', + Ṇ: 'ꦟ', + ṇ: 'ꦟ', + Ḍ: 'ꦝ', + ḍ: 'ꦝ', + Ṭ: 'ꦛ', + ṭ: 'ꦛ', + ś: 'ꦯ', + Ṣ: 'ꦰ', + ṣ: 'ꦰ', + Ṛ: 'ꦽ', + ṛ: 'ꦽ' // idem + // test: Èè.Éé.Êê.Ěě.Ĕĕ.Ṛṛ.ôâāīūōåɔə + // test: ḌaḍaṆaṇaṢaṣaṬaṭaŊaŋaÑañaɲaśa + }; + let soundMap; + // var modeMurda = document.getElementsByName("murda"); + // for (var rad in modeMurda) { + // if (modeMurda[rad].checked) + // murda = modeMurda[rad].value; + // } + if (this.murda) + soundMap = { ...soundMap2, ...soundMap3 }; + // if(murda == "tidak") + else + soundMap = { ...soundMap1, ...soundMap3 }; + const h_shift = this.GetShift(str); + let core = str; + if (h_shift.CoreSound == null) { + if (soundMap[str.charAt(0)]) + core = soundMap[str.charAt(0)]; + return { + CoreSound: core, + len: 1 + }; + } + else { + return h_shift; + } + } + ResolveCharacterSound(c) { + const str = c.toString(); + if (isDigit(c)) { + return '' + ('꧇' + (parseInt(c) - 0)); + } + else if (isHR(str[0])) { + return '' + this.GetCoreSound(str).CoreSound; // layar dan wignyan + } + else if (isCJ(str[1])) { + return '' + this.GetCoreSound(str).CoreSound + '꧀'; // anuswara + } + else if (isConsonant(str[0])) { + return '' + this.GetCoreSound(str).CoreSound + '꧀'; + } + else { + // if (isVowel(str[0])) { + return '' + this.GetCoreSound(str).CoreSound; + } + } + GetSound(str) { + str = SuperTrim(str); + this.str2 = str.toLowerCase(); + if (str == null || str == '') + return ''; + const SpecialSound = GetSpecialSound(str); + if (SpecialSound != null && str.length == 1) + return SpecialSound; + if (str.length == 1) + return this.ResolveCharacterSound(str[0]); + else { + const core_sound = this.GetCoreSound(str); + // return "1"+core_sound.CoreSound+"2"; + let matra = ''; + let konsonan = ''; + if (core_sound.len >= 1) { + matra = this.GetMatra(str.substring(core_sound.len)); // xeiou (pepet, taling, suku, taling tarung, wulu, dll.) + /* if () { + + } else { + + } */ + } + else { + matra = ''; + } // a/å/ɔ + /* rules for some cluster like ngg- that have different behaviour depending if it's the start of a word or not. + TODO: find more elegant solution */ + if (this.str2.indexOf('nggr') == 0) { + // nggr- + if (this.vowelPrev) + konsonan = 'ꦁ​ꦒꦿ'; + // nggr-, e.g. panggrahita + // else if (matra = "") + else + konsonan = 'ꦔ꧀ꦒꦿ'; // nggr-, i.e. nggronjal + } + else if (this.str2.indexOf('nggl') == 0) { + // nggl-, e.g. ngglantung + konsonan = 'ꦔ꧀ꦒ꧀ꦭ'; + } + else if (this.str2.indexOf('nggw') == 0) { + // nggw-, e.g. munggwing + konsonan = 'ꦔ꧀ꦒ꧀ꦮ'; + } + else if (this.str2.indexOf('nggy') == 0) { + // nggy-, e.g. anggyat + konsonan = 'ꦔ꧀ꦒꦾ'; + } + else if (this.str2.indexOf('ngg') == 0) { + // ngg- + if (this.vowelPrev) + konsonan = 'ꦁ​ꦒ'; + // ngg-, e.g. tunggal + // else if (spacePrev) konsonan = "​ꦔ꧀";//ngg-, e.g. ditinggal nggambar (it has a zws) + else + konsonan = 'ꦔ꧀ꦒ'; // ngg-, i.e. nggambar + // for cluster longer than 4 consonants, such as "ditinggalnggambar", + // need to separate it by a space, "ditinggal nggambar" to be correct + } + else if (this.str2.indexOf('rlx') == 0) { + // r lx, e.g. pasarlxgi + konsonan = 'ꦂꦊ'; + matra = ''; + } + else if (this.str2.indexOf('rrx') == 0) { + // r rx + konsonan = 'ꦂꦉ'; + matra = ''; + } + else if (this.str2.indexOf('hlx') == 0) { + // h lx + if (this.vowelPrev) { + konsonan = 'ꦃꦊ'; + matra = ''; + } + else + konsonan = 'ꦲ꧀ꦭꦼ'; + matra = ''; + } + else if (this.str2.indexOf('hrx') == 0) { + // h rx + if (this.vowelPrev) { + konsonan = 'ꦃꦉ'; + matra = ''; + } + else + konsonan = 'ꦲꦽ'; + matra = ''; + } + else if (this.str2.indexOf('qlx') == 0) { + // just pasangan la + pepet + konsonan = '꧀ꦭꦼ'; + matra = ''; + } + else if (this.str2.indexOf('qrx') == 0) { + // just cakra keret + konsonan = 'ꦽ'; + matra = ''; + } + else if (core_sound.CoreSound == 'ꦂꦂꦮ') { + // -rw- + if (this.vowelPrev) + konsonan = 'ꦂꦮ'; + // -rw- -- arwana + else + konsonan = 'ꦫ꧀ꦮ'; // rw- -- rwa/rwi/rwab + } + else if (core_sound.CoreSound == 'ꦃꦃꦭ') { + // -hl- + if (this.vowelPrev) + konsonan = 'ꦃꦭ'; + // -hl- + else + konsonan = 'ꦲ꧀ꦭ'; // hlam + } + else if (core_sound.CoreSound == 'ꦃꦃꦮ') { + // -hw- + if (this.vowelPrev) + konsonan = 'ꦃꦮ'; + // -hw- + else + konsonan = 'ꦲ꧀ꦮ'; // hwab,hwan + } + else if (core_sound.CoreSound == 'ꦃꦲꦾ') { + // -hy- + if (this.vowelPrev) + konsonan = 'ꦃꦪ'; + // sembahyang + else + konsonan = 'ꦲꦾ'; // hyang + /* rules for some characters that change depends on the matra/vowel (e.g. lx and rx, and -rx) */ + } + else if (findstr(core_sound.CoreSound, 'ꦾ') && matra == '꧀') { + // pengkal + konsonan = core_sound.CoreSound; + matra = ''; // -y- + } + else if (findstr(core_sound.CoreSound, 'ꦿ') && matra == '꧀') { + // cakra + konsonan = core_sound.CoreSound; + matra = ''; // -r- + } + else if (findstr(core_sound.CoreSound, 'ꦿ') && matra == 'ꦼ') { + // cakra keret + if ((str[0] == 'n' && str[1] == 'y') || + ((str[0] == 't' || str[0] == 'd') && str[1] == 'h')) { + konsonan = this.GetCoreSound(str[0] + str[1]).CoreSound + 'ꦽ'; + matra = ''; // nyrê-, thrê-, dhrê- + } + else if (str[0] == 'n' && str[1] == 'g') { + if (str[2] == 'g') + konsonan = 'ꦔ꧀ꦒꦽ'; + else + konsonan = 'ꦔꦽ'; + matra = ''; // nggrê-/ngrê- + } + else { + konsonan = this.GetCoreSound(str[0]).CoreSound + 'ꦽ'; + matra = ''; // -rê- + } + } + else if (findstr(core_sound.CoreSound, 'ꦭ') && matra == 'ꦼ') { + // nga lelet + if ((str[0] == 'n' && str[1] == 'y') || + ((str[0] == 't' || str[0] == 'd') && str[1] == 'h')) { + konsonan = this.GetCoreSound(str[0] + str[1]).CoreSound + '꧀ꦭꦼ'; + matra = ''; // nylê-, thlê-, dhlê- + } + else if (str[0] == 'n' && str[1] == 'g') { + if (str[2] == 'g') + konsonan = 'ꦔ꧀ꦒ꧀ꦭꦼ'; + else + konsonan = 'ꦔ꧀ꦭꦼ'; + matra = ''; // ngglê-/nglê- + } + else if (str[0] == 'l') { + konsonan = 'ꦊ'; + matra = ''; // -lê- + } + else { + konsonan = this.GetCoreSound(str[0]).CoreSound + '꧀ꦭꦼ'; + matra = ''; // -lê- + } + } + else if (core_sound.CoreSound == 'ꦃ' && matra == '꧀') { + // wignyan - 12 April + konsonan = 'ꦲ'; // ha + } + else if (core_sound.CoreSound == 'ꦃ' && matra != '꧀') { + // wignyan + konsonan = 'ꦲ'; // ha + } + else if (core_sound.CoreSound == 'ꦂ' && matra == 'ꦼ') { + // pa cerek + konsonan = 'ꦉ'; + matra = ''; // rê + } + else if (core_sound.CoreSound == 'ꦂ' && matra == '꧀') { + // layar + konsonan = 'ꦫ'; // ra + } + else if (core_sound.CoreSound == 'ꦂ' && matra != '꧀') { + // layar + konsonan = 'ꦫ'; // ra + } + else if (core_sound.CoreSound == 'ꦁ​' && matra == '꧀') { + // cecak + konsonan = 'ꦁ​'; + matra = ''; // cecak + } + else if (core_sound.CoreSound == 'ꦁ​' && matra != '꧀') { + // cecak + konsonan = 'ꦔ'; // nga + } + else { + konsonan = core_sound.CoreSound; + } + return '' + konsonan + matra; + } + } + toLatin() { + // var agt = navigator.userAgent.toLowerCase(); + // if (agt.indexOf("msie")!=-1) { //IE + // var range = document.selection.createRange() + // txt = range.text; + // if (txt == '') { + // var str = window.document.formText.editSrc.value; + // }else{ + // var str = range.text; + // } + // } + // else { + // str = window.document.formText.editSrc.value; + // } + const ganti = (index, character, str) => str.substr(0, index) + character; + const ganti2 = (index, character, str) => str.substr(0, index - 1) + character; + const ganti3 = (index, character, str) => str.substr(0, index - 2) + character; + // const capitalize = (index: number, character: string, str: string) => + // str.charAt(0).toUpperCase() + str.slice(1) + let trans = this.str; + const regexp_file = this.aksara2Latin(); + for (let i = 0, j = 0; i < this.str.length; i++) { + if (!regexp_file[this.str[i]]) { + // not Aksara Jawa + trans = ganti(j, this.str[i], trans); + j++; + } + else { + if (this.str[i] == 'ꦴ' || + this.str[i] == 'ꦶ' || + this.str[i] == 'ꦸ' || + this.str[i] == 'ꦺ' || + this.str[i] == 'ꦼ') { + if (i > 2 && this.str[i - 1] == 'ꦲ' && this.str[i - 2] == 'ꦲ') { + // -hah- + if (this.str[i] == 'ꦴ') + trans = ganti3(j, 'ā', trans); + else if (this.str[i] == 'ꦶ') + trans = ganti3(j, 'ai', trans); + else if (this.str[i] == 'ꦸ') + trans = ganti3(j, 'au', trans); + else if (this.str[i] == 'ꦺ') + trans = ganti3(j, 'ae', trans); + else if (this.str[i] == 'ꦼ') + trans = ganti3(j, 'aě', trans); + // str[i] == "ꦶ" || str[i] == "ꦸ" || str[i] == "ꦺ" || str[i] == "ꦼ" + } + else if (i > 2 && this.str[i - 1] == 'ꦲ') { + // -h- + if (this.str[i] == 'ꦴ') + trans = ganti2(j, 'ā', trans); + else if (this.str[i] == 'ꦶ') + trans = ganti2(j, 'i', trans); + else if (this.str[i] == 'ꦸ') + trans = ganti2(j, 'u', trans); + else if (this.str[i] == 'ꦺ') + trans = ganti2(j, 'e', trans); + else if (this.str[i] == 'ꦼ') + trans = ganti2(j, 'ě', trans); + } /**/ + else if (i > 0 && + this.str[i] == 'ꦴ' && + this.str[i - 1] == 'ꦺ') { + trans = ganti2(j, 'o', trans); // -o //2 aksara -> 1 huruf + } + else if (i > 0 && this.str[i] == 'ꦴ' && this.str[i - 1] == 'ꦻ') { + trans = ganti3(j, 'au', trans); // -au //2 aksara -> 2 huruf + } + else if (this.str[i] == 'ꦴ') { + trans = ganti(j, 'aa', trans); // -aa + j++; + } + else if (i > 0 && + (this.str[i] == 'ꦶ' || + this.str[i] == 'ꦸ' || + this.str[i] == 'ꦺ' || + this.str[i] == 'ꦼ') && + (this.str[i - 1] == 'ꦄ' || + this.str[i - 1] == 'ꦌ' || + this.str[i - 1] == 'ꦆ' || + this.str[i - 1] == 'ꦎ' || + this.str[i - 1] == 'ꦈ')) { + trans = ganti(j, regexp_file[this.str[i]], trans); + j++; + } + else { + trans = ganti2(j, regexp_file[this.str[i]], trans); + } + } + else if (this.str[i] == 'ꦽ' || + this.str[i] == 'ꦾ' || + this.str[i] == 'ꦿ' || + this.str[i] == 'ꦷ' || + this.str[i] == 'ꦹ' || + this.str[i] == 'ꦻ' || + this.str[i] == 'ꦇ' || + this.str[i] == 'ꦍ') { + // 1 aksara -> 2 huruf + trans = ganti2(j, regexp_file[this.str[i]], trans); + j++; + } + else if (this.str[i] == '꦳') { + // 2 aksara -> 2 huruf + if (i > 0 && this.str[i - 1] == 'ꦗ') { + if (i > 1 && this.str[i - 2] == '꧊') { + trans = ganti3(j, 'Za', trans); + } + else { + trans = ganti3(j, 'za', trans); + } + } + else if (i > 0 && this.str[i - 1] == 'ꦥ') { + if (i > 1 && this.str[i - 2] == '꧊') { + trans = ganti3(j, 'Fa', trans); + } + else { + trans = ganti3(j, 'fa', trans); + } + } + else if (i > 0 && this.str[i - 1] == 'ꦮ') { + if (i > 1 && this.str[i - 2] == '꧊') { + trans = ganti3(j, 'Va', trans); + } + else { + trans = ganti3(j, 'va', trans); + } // catatan, "va" biasanya ditulis sama dengan "fa" (dengan pa+cecak telu), variannya adalah wa+cecak telu. + } + else if (i > 0 && this.str[i - 1] == 'ꦲ') { + if (i > 1 && this.str[i - 2] == '꧊') { + trans = ganti3(j, 'Ḥa', trans); + } + else { + trans = ganti3(j, 'ḥa', trans); + } + } + else if (i > 0 && this.str[i - 1] == 'ꦏ') { + if (i > 1 && this.str[i - 2] == '꧊') { + trans = ganti3(j, 'Kha', trans); + j++; + } + else { + trans = ganti3(j, 'kha', trans); + j++; + } + } + else if (i > 0 && this.str[i - 1] == 'ꦢ') { + if (i > 1 && this.str[i - 2] == '꧊') { + trans = ganti3(j, 'Dza', trans); + j++; + } + else { + trans = ganti3(j, 'dza', trans); + j++; + } + } + else if (i > 0 && this.str[i - 1] == 'ꦱ') { + if (i > 1 && this.str[i - 2] == '꧊') { + trans = ganti3(j, 'Sya', trans); + j++; + } + else { + trans = ganti3(j, 'sya', trans); + j++; + } + } + else if (i > 0 && this.str[i - 1] == 'ꦒ') { + if (i > 1 && this.str[i - 2] == '꧊') { + trans = ganti3(j, 'Gha', trans); + j++; + } + else { + trans = ganti3(j, 'gha', trans); + j++; + } + } + else if (i > 0 && this.str[i - 1] == 'ꦔ') { + trans = ganti3(j, "'a", trans); + } + else { + trans = ganti2(j, regexp_file[this.str[i]], trans); + } + } + else if (this.str[i] == '꧀') { + trans = ganti2(j, regexp_file[this.str[i]], trans); + } + else if (this.str[i] == 'ꦏ' || + this.str[i] == 'ꦐ' || + this.str[i] == 'ꦒ' || + this.str[i] == 'ꦕ' || + this.str[i] == 'ꦗ' || + this.str[i] == 'ꦟ' || + this.str[i] == 'ꦠ' || + this.str[i] == 'ꦡ' || + this.str[i] == 'ꦢ' || + this.str[i] == 'ꦣ' || + this.str[i] == 'ꦤ' || + this.str[i] == 'ꦥ' || + this.str[i] == 'ꦧ' || + this.str[i] == 'ꦩ' || + this.str[i] == 'ꦪ' || + this.str[i] == 'ꦫ' || + this.str[i] == 'ꦬ' || + this.str[i] == 'ꦭ' || + this.str[i] == 'ꦮ' || + this.str[i] == 'ꦯ' || + this.str[i] == 'ꦰ' || + this.str[i] == 'ꦱ' || + this.str[i] == 'ꦉ' || + this.str[i] == 'ꦊ' || + this.str[i] == 'ꦁ' || + this.str[i] == 'ꦲ' || + this.str[i] == 'ꦑ' || + this.str[i] == 'ꦓ' || + this.str[i] == 'ꦖ' || + this.str[i] == 'ꦙ' || + this.str[i] == 'ꦡ' || + this.str[i] == 'ꦣ' || + this.str[i] == 'ꦦ' || + this.str[i] == 'ꦨ') { + if (i > 0 && this.str[i - 1] == '꧊') { + if (this.str[i] == 'ꦐ') { + trans = ganti(j, 'Qa', trans); + j += 2; + } + else if (this.str[i] == 'ꦧ' || this.str[i] == 'ꦨ') { + trans = ganti(j, 'Ba', trans); + j += 2; + } + else if (this.str[i] == 'ꦕ' || this.str[i] == 'ꦖ') { + trans = ganti(j, 'Ca', trans); + j += 2; + } + else if (this.str[i] == 'ꦢ' || this.str[i] == 'ꦣ') { + trans = ganti(j, 'Da', trans); + j += 2; + } + else if (this.str[i] == 'ꦒ' || this.str[i] == 'ꦓ') { + trans = ganti(j, 'Ga', trans); + j += 2; + } + else if (this.str[i] == 'ꦲ') { + if (i > 0 && + (this.str[i - 1] == 'ꦼ' || + this.str[i - 1] == 'ꦺ' || + this.str[i - 1] == 'ꦶ' || + this.str[i - 1] == 'ꦴ' || + this.str[i - 1] == 'ꦸ' || + this.str[i - 1] == 'ꦄ' || + this.str[i - 1] == 'ꦌ' || + this.str[i - 1] == 'ꦆ' || + this.str[i - 1] == 'ꦎ' || + this.str[i - 1] == 'ꦈ' || + this.str[i - 1] == 'ꦿ' || + this.str[i - 1] == 'ꦾ' || + this.str[i - 1] == 'ꦽ')) { + trans = ganti(j, 'h' + regexp_file[this.str[i]], trans); + j += 2; + } + if (i > 0 && this.str[i - 1] == '꧊') { + trans = ganti(j, 'H' + regexp_file[this.str[i]], trans); + j += 2; + } + else { + trans = ganti(j, '@' + regexp_file[this.str[i]], trans); + j += 2; + } + // trans = ganti(j, "Ha", trans);j+=2; + } + else if (this.str[i] == 'ꦗ' || this.str[i] == 'ꦙ') { + trans = ganti(j, 'Ja', trans); + j += 2; + } + else if (this.str[i] == 'ꦏ' || this.str[i] == 'ꦑ') { + trans = ganti(j, 'Ka', trans); + j += 2; + } + else if (this.str[i] == 'ꦭ') { + trans = ganti(j, 'La', trans); + j += 2; + } + else if (this.str[i] == 'ꦩ') { + trans = ganti(j, 'Ma', trans); + j += 2; + } + else if (this.str[i] == 'ꦤ' || this.str[i] == 'ꦟ') { + trans = ganti(j, 'Na', trans); + j += 2; + } + else if (this.str[i] == 'ꦥ' || this.str[i] == 'ꦦ') { + trans = ganti(j, 'Pa', trans); + j += 2; + } + else if (this.str[i] == 'ꦫ' || this.str[i] == 'ꦬ') { + trans = ganti(j, 'Ra', trans); + j += 2; + } + else if (this.str[i] == 'ꦱ' || this.str[i] == 'ꦯ') { + trans = ganti(j, 'Sa', trans); + j += 2; + } + else if (this.str[i] == 'ꦠ' || this.str[i] == 'ꦡ') { + trans = ganti(j, 'Ta', trans); + j += 2; + } + else if (this.str[i] == 'ꦮ') { + trans = ganti(j, 'Wa', trans); + j += 2; + } + else if (this.str[i] == 'ꦪ') { + trans = ganti(j, 'Ya', trans); + j += 2; + } + else { + ganti(j, regexp_file[this.str[i]], trans); + j += 3; + } + } + else if (i > 0 && this.str[i] == 'ꦲ' && this.str[i - 1] == 'ꦃ') { + // double hh + trans = ganti(j, 'a', trans); + j++; + } + else if (i > 0 && this.str[i] == 'ꦫ' && this.str[i - 1] == 'ꦂ') { + // double rr + trans = ganti(j, 'a', trans); + j++; + } + else if (i > 0 && this.str[i] == 'ꦔ' && this.str[i - 1] == 'ꦁ') { + // double ngng + trans = ganti(j, 'a', trans); + j++; + } + else if (i > 1 && + this.str[i] == 'ꦕ' && + this.str[i - 1] == '꧀' && + this.str[i - 2] == 'ꦚ') { + // nyj & nyc + trans = ganti(j - 3, 'nca', trans); + } + else if (i > 1 && + this.str[i] == 'ꦗ' && + this.str[i - 1] == '꧀' && + this.str[i - 2] == 'ꦚ') { + // nyj & nyc + trans = ganti(j - 3, 'nja', trans); + } + else if (this.str[i] == 'ꦲ' && + (i == 0 || + [ + ' ', + '​', + '꧀', + '꦳', + 'ꦴ', + 'ꦶ', + 'ꦷ', + 'ꦸ', + 'ꦹ', + 'ꦺ', + 'ꦻ', + 'ꦼ', + 'ꦽ', + 'ꦾ', + 'ꦿ' + ].indexOf(this.str[i - 1]) >= 0)) { + // ha, preceeded by space or zws or open vowel + trans = ganti(j, '_a', trans); + j += 2; + } + else if (this.str[i] == 'ꦑ' || + this.str[i] == 'ꦓ' || + this.str[i] == 'ꦖ' || + this.str[i] == 'ꦙ' || + this.str[i] == 'ꦡ' || + this.str[i] == 'ꦣ' || + this.str[i] == 'ꦦ' || + this.str[i] == 'ꦨ') { + // bha, cha, dha, dll. + trans = ganti(j, regexp_file[this.str[i]], trans); + j += 3; + } + else { + // ba, ca, da, dll. + trans = ganti(j, regexp_file[this.str[i]], trans); + j += 2; + } + } + else if (this.str[i] == 'ꦔ' || + this.str[i] == 'ꦘ' || + this.str[i] == 'ꦚ' || + this.str[i] == 'ꦛ' || + this.str[i] == 'ꦜ' || + this.str[i] == 'ꦝ' || + this.str[i] == 'ꦞ' || + this.str[i] == 'ꦋ') { + // nga, nya, tha, dha + if (i > 0 && this.str[i - 1] == '꧊') { + if (this.str[i] == 'ꦔ') { + trans = ganti(j, 'Nga', trans); + j += 3; + } + else if (this.str[i] == 'ꦚ' || this.str[i] == 'ꦘ') { + trans = ganti(j, 'Nya', trans); + j += 3; + } + else if (this.str[i] == 'ꦛ' || this.str[i] == 'ꦜ') { + trans = ganti(j, 'Tha', trans); + j += 3; + } + else if (this.str[i] == 'ꦝ' || this.str[i] == 'ꦞ') { + trans = ganti(j, 'Dha', trans); + j += 3; + } + else { + ganti(j, regexp_file[this.str[i]], trans); + j += 3; + } + } + else if (i > 0 && this.str[i] == 'ꦘ') { + trans = ganti(j, regexp_file[this.str[i]], trans); + j += 4; + } + else { + trans = ganti(j, regexp_file[this.str[i]], trans); + j += 3; + } + } + else if (this.str[i] == '꧊') { + // penanda nama diri -- made up for Latin back-compat + trans = ganti(j, '', trans); + } + else if ((this.str[i] == ' ', trans)) { + if (i > 0 && this.str[i - 1] == '꧀') { + // pangkon diikuti regular space = koma + trans = ganti(j, ', ', trans); + j += 2; + } + else { + trans = ganti(j, ' ', trans); + j++; + } + } + else if ((this.str[i] == '꧈', trans)) { + if (i > 0 && this.str[i - 1] == '꧀') { + // pangkon diikuti pada lingsa = titik + trans = ganti(j, '.', trans); + j++; + } + else { + // pada lingsa saja = koma + trans = ganti(j, ',', trans); + j++; + } + } + else { + trans = ganti(j, regexp_file[this.str[i]], trans); + j++; + } + } + } + trans = trans + .split(' ') + .map((v) => v.startsWith('_') ? v.replace('_', this.isHVokal ? '' : 'h') : v) + .join(' '); + return trans.toString(); + } + aksara2Latin() { + return { + ꦏ: 'ka', + ꦐ: 'qa', + ꦑ: 'kʰa', + ꦒ: 'ga', + ꦓ: 'gʰa', + ꦔ: 'nga', + ꦕ: 'ca', + ꦖ: 'cʰa', + ꦗ: 'ja', + ꦘ: 'jnya', + ꦙ: 'jʰa', + ꦚ: 'nya', + ꦛ: 'tha', + ꦜ: 'ṭʰa', + ꦝ: 'dha', + ꦞ: 'ḍʰa', + ꦟ: 'ṇa', + ꦠ: 'ta', + ꦡ: 'ṭa', + ꦢ: 'da', + ꦣ: 'ḍa', + ꦤ: 'na', + ꦥ: 'pa', + ꦦ: 'pʰa', + ꦧ: 'ba', + ꦨ: 'bʰa', + ꦩ: 'ma', + ꦪ: 'ya', + ꦫ: 'ra', + ꦬ: 'ṛa', + ꦭ: 'la', + ꦮ: 'wa', + ꦯ: 'śa', + ꦰ: 'ṣa', + ꦱ: 'sa', + ꦲ: 'ha', + 'ꦁ': 'ng', + 'ꦂ': 'r', + 'ꦃ': 'h', + ꦄ: 'A', + ꦅ: 'I', + ꦆ: 'I', + ꦇ: 'Ii', + ꦈ: 'U', + ꦉ: 'rê', + ꦊ: 'lê', + ꦋ: 'lêu', + ꦌ: 'E', + ꦍ: 'Ai', + ꦎ: 'O', + 'ꦺꦴ': 'o', + 'ꦴ': 'a', + 'ꦶ': 'i', + 'ꦷ': 'ii', + 'ꦸ': 'u', + 'ꦹ': 'uu', + 'ꦺ': 'e', + 'ꦻ': 'ai', + 'ꦼ': 'ê', + 'ꦽ': 'rê', + 'ꦾ': 'ya', + 'ꦿ': 'ra', + 'ꦀ': '', + '꦳': '​', + '꧀': '​', + '꧇': '​', + '꧁': '—', + '꧂': '—', + '꧃': '–', + '꧄': '–', + '꧅': '–', + '꧆': '', + '꧈': ',', + '꧉': '.', + '꧊': 'qqq', + '꧋': '–', + '꧌': '–', + '꧍': '–', + ꧏ: '²', + '꧐': '0', + '꧑': '1', + '꧒': '2', + '꧓': '3', + '꧔': '4', + '꧕': '5', + '꧖': '6', + '꧗': '7', + '꧘': '8', + '꧙': '9', + '꧞': '—', + '꧟': '—', + // "​": '#',//zero-width joiner + '​': ' ', + ' ': ' ' // regular space + }; + } +} +//# sourceMappingURL=aksarajawa.js.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/cjs/texts/aksarajawa.js.map b/node_modules/@bochilteam/scraper/lib/cjs/texts/aksarajawa.js.map new file mode 100644 index 000000000..d39d90f24 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/cjs/texts/aksarajawa.js.map @@ -0,0 +1 @@ +{"version":3,"file":"aksarajawa.js","sourceRoot":"","sources":["../../../src/texts/aksarajawa.ts"],"names":[],"mappings":";;;AAcA,SAAgB,aAAa,CAC3B,GAAW,EACX,UAAmB,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE;IAEjD,MAAM,MAAM,GAAG,IAAI,MAAM,CAAC,GAAG,EAAE,OAAO,CAAC,CAAA;IACvC,OAAO,MAAM,CAAC,QAAQ,EAAE,CAAA;AAC1B,CAAC;AAND,sCAMC;AAED,SAAgB,aAAa,CAC3B,GAAW,EACX,UAA4B,EAAE,MAAM,EAAE,KAAK,EAAE;IAE7C,MAAM,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E,GAAG,CAAC,gBAAgB;SAC1B,CAAA;IACH,CAAC;CACD"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/cjs/texts/bucin.js b/node_modules/@bochilteam/scraper/lib/cjs/texts/bucin.js new file mode 100644 index 000000000..62105c5f1 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/cjs/texts/bucin.js @@ -0,0 +1,16 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.bucinjson = void 0; +const got_1 = __importDefault(require("got")); +exports.bucinjson = []; +async function bucin() { + if (!exports.bucinjson.length) { + exports.bucinjson = await (0, got_1.default)('https://raw.githubusercontent.com/BochilTeam/database/master/kata-kata/bucin.json').json(); + } + return exports.bucinjson[Math.floor(exports.bucinjson.length * Math.random())]; +} +exports.default = bucin; +//# sourceMappingURL=bucin.js.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/cjs/texts/bucin.js.map b/node_modules/@bochilteam/scraper/lib/cjs/texts/bucin.js.map new file mode 100644 index 000000000..660827f54 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/cjs/texts/bucin.js.map @@ -0,0 +1 @@ +{"version":3,"file":"bucin.js","sourceRoot":"","sources":["../../../src/texts/bucin.ts"],"names":[],"mappings":";;;;;;AAAA,8CAAqB;AACV,QAAA,SAAS,GAAa,EAAE,CAAA;AACpB,KAAK,UAAU,KAAK;IACjC,IAAI,CAAC,iBAAS,CAAC,MAAM,EAAE;QACrB,iBAAS,GAAG,MAAM,IAAA,aAAG,EACnB,mFAAmF,CACpF,CAAC,IAAI,EAAE,CAAA;KACT;IACD,OAAO,iBAAS,CAAC,IAAI,CAAC,KAAK,CAAC,iBAAS,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC,CAAA;AAChE,CAAC;AAPD,wBAOC"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/cjs/texts/dare.js b/node_modules/@bochilteam/scraper/lib/cjs/texts/dare.js new file mode 100644 index 000000000..424d5b243 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/cjs/texts/dare.js @@ -0,0 +1,16 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.darejson = void 0; +const got_1 = __importDefault(require("got")); +exports.darejson = []; +async function dare() { + if (!exports.darejson.length) { + exports.darejson = await (0, got_1.default)('https://raw.githubusercontent.com/BochilTeam/database/master/kata-kata/dare.json').json(); + } + return exports.darejson[Math.round(exports.darejson.length * Math.random())]; +} +exports.default = dare; +//# sourceMappingURL=dare.js.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/cjs/texts/dare.js.map b/node_modules/@bochilteam/scraper/lib/cjs/texts/dare.js.map new file mode 100644 index 000000000..3db5a7559 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/cjs/texts/dare.js.map @@ -0,0 +1 @@ +{"version":3,"file":"dare.js","sourceRoot":"","sources":["../../../src/texts/dare.ts"],"names":[],"mappings":";;;;;;AAAA,8CAAqB;AACV,QAAA,QAAQ,GAAa,EAAE,CAAA;AACnB,KAAK,UAAU,IAAI;IAChC,IAAI,CAAC,gBAAQ,CAAC,MAAM,EAAE;QACpB,gBAAQ,GAAG,MAAM,IAAA,aAAG,EAClB,kFAAkF,CACnF,CAAC,IAAI,EAAE,CAAA;KACT;IACD,OAAO,gBAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,gBAAQ,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC,CAAA;AAC9D,CAAC;AAPD,uBAOC"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/cjs/texts/index.js b/node_modules/@bochilteam/scraper/lib/cjs/texts/index.js new file mode 100644 index 000000000..7d858af51 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/cjs/texts/index.js @@ -0,0 +1,43 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.textproList = exports.textpro = exports.truthjson = exports.truth = exports.darejson = exports.dare = exports.bucinjson = exports.bucin = void 0; +const bucin_js_1 = __importStar(require("./bucin.js")); +exports.bucin = bucin_js_1.default; +Object.defineProperty(exports, "bucinjson", { enumerable: true, get: function () { return bucin_js_1.bucinjson; } }); +const dare_js_1 = __importStar(require("./dare.js")); +exports.dare = dare_js_1.default; +Object.defineProperty(exports, "darejson", { enumerable: true, get: function () { return dare_js_1.darejson; } }); +const truth_js_1 = __importStar(require("./truth.js")); +exports.truth = truth_js_1.default; +Object.defineProperty(exports, "truthjson", { enumerable: true, get: function () { return truth_js_1.truthjson; } }); +const textpro_js_1 = __importStar(require("./textpro.js")); +exports.textpro = textpro_js_1.default; +Object.defineProperty(exports, "textproList", { enumerable: true, get: function () { return textpro_js_1.textproList; } }); +__exportStar(require("./aksarajawa.js"), exports); +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/cjs/texts/index.js.map b/node_modules/@bochilteam/scraper/lib/cjs/texts/index.js.map new file mode 100644 index 000000000..c463fb867 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/cjs/texts/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/texts/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uDAA6C;AAO3C,gBAPK,kBAAK,CAOL;AAAE,0FAPO,oBAAS,OAOP;AANlB,qDAA0C;AAOxC,eAPK,iBAAI,CAOL;AAAE,yFAPO,kBAAQ,OAOP;AANhB,uDAA6C;AAO3C,gBAPK,kBAAK,CAOL;AAAE,0FAPO,oBAAS,OAOP;AANlB,2DAAmD;AAOjD,kBAPK,oBAAO,CAOL;AAAE,4FAPO,wBAAW,OAOP;AALtB,kDAA+B"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/cjs/texts/test.js b/node_modules/@bochilteam/scraper/lib/cjs/texts/test.js new file mode 100644 index 000000000..f8c96fedd --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/cjs/texts/test.js @@ -0,0 +1,86 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const chai_1 = require("chai"); +const index_js_1 = require("./index.js"); +describe('Texts', () => { + describe('Aksara Jawa', () => { + it('Latin to Aksara', done => { + try { + const res = (0, index_js_1.latinToAksara)('hallo rek'); + (0, chai_1.expect)(res).equal('ꦲꦭ꧀ꦭꦺꦴ​ꦫꦺꦏ꧀'); + return done(); + } + catch (e) { + return done(e); + } + }); + it('Aksara to Latin', done => { + try { + const res = (0, index_js_1.aksaraToLatin)('ꦲꦭ꧀ꦭꦺꦴ​ꦫꦺꦏ꧀', { HVokal: false }); + (0, chai_1.expect)(res).equal('hal​lo rek​'); + return done(); + } + catch (e) { + return done(e); + } + }); + }); + describe('Bucin', () => { + it('Bucin', done => { + (0, index_js_1.bucin)().then(res => { + (0, chai_1.expect)(res).to.be.a('string'); + return done(); + }).catch(done); + }); + it('Bucin JSON', done => { + const res = index_js_1.bucinjson; + (0, chai_1.expect)(res).to.be.an('array'); + (0, chai_1.expect)(res).to.have.lengthOf.at.least(365); + return done(); + }); + }); + describe('Dare', () => { + it('Dare', done => { + (0, index_js_1.dare)().then(res => { + (0, chai_1.expect)(res).to.be.a('string'); + return done(); + }).catch(done); + }); + it('Dare JSON', done => { + const res = index_js_1.darejson; + (0, chai_1.expect)(res).to.be.an('array'); + (0, chai_1.expect)(res).to.have.lengthOf.at.least(63); + return done(); + }); + }); + describe('Truth', () => { + it('Truth', done => { + (0, index_js_1.truth)().then(res => { + (0, chai_1.expect)(res).to.be.a('string'); + return done(); + }).catch(done); + }); + it('Truth JSON', done => { + const res = index_js_1.truthjson; + (0, chai_1.expect)(res).to.be.an('array'); + (0, chai_1.expect)(res).to.have.lengthOf.at.least(61); + return done(); + }); + }); + describe('TextPro', () => { + it('TextPro', done => { + (0, index_js_1.textpro)('neon', ['Hallo']).then(res => { + (0, chai_1.expect)(res).to.be.a('string'); + return done(); + }).catch(done); + }); + it('TextPro List', done => { + Promise.resolve(index_js_1.textproList).then(res => { + (0, chai_1.expect)(res).to.be.an('array'); + (0, chai_1.expect)(res).to.have.lengthOf.at.least(1); + return done(); + }).catch(done); + }); + }); +}); +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/cjs/texts/test.js.map b/node_modules/@bochilteam/scraper/lib/cjs/texts/test.js.map new file mode 100644 index 000000000..e4e4f6cee --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/cjs/texts/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["../../../src/texts/test.ts"],"names":[],"mappings":";;AAAA,+BAA6B;AAC7B,yCAOmB;AACnB,QAAQ,CAAC,OAAO,EAAE,GAAG,E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AC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;gBAExC,OAAO,IAAI,EAAE,CAAA;YACf,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;QAChB,CAAC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/cjs/texts/textpro.js b/node_modules/@bochilteam/scraper/lib/cjs/texts/textpro.js new file mode 100644 index 000000000..504f267b2 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/cjs/texts/textpro.js @@ -0,0 +1,60 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.textproList = void 0; +const got_1 = __importDefault(require("got")); +const cheerio_1 = require("cheerio"); +const form_data_1 = __importDefault(require("form-data")); +const utils_js_1 = require("../utils.js"); +const BASE_URL = 'https://textpro.me'; +exports.textproList = (async () => (0, got_1.default)('https://raw.githubusercontent.com/BochilTeam/scraper/master/data/textpro.json').json())(); +async function textpro(effect, params) { + var _a; + const list = await exports.textproList; + const textpro = list.find(({ title }) => title.toLowerCase() === effect.toLowerCase()); + if (!textpro) + throw new Error(`TextPro "${effect}" not found`); + if (!Array.isArray(params)) + params = [params]; + const { link, parameters } = textpro; + if (parameters.length > params.length) + throw new Error(`TextPro "${effect}" requires ${parameters.length} parameters, but ${params.length} given`); + const resToken = await (0, got_1.default)(`${BASE_URL}${link}`); + const cookie = (_a = resToken.headers['set-cookie']) === null || _a === void 0 ? void 0 : _a.map(c => c.split(';')[0]).join('; ').trim(); + const HEADERS = { + cookie: cookie || '__gads=ID=63da40a14f3eb127-22dccf741fd10073:T=1648080134:RT=1648080134:S=ALNI_MZfEIreNTkduqqV5CgZnuei_X1xLQ; _ga=GA1.2.342524260.1648080135; _gid=GA1.2.2036288127.1648080139; PHPSESSID=7fmr2ig9k8r7n9g9uk7fcj2ru1; _gat_gtag_UA_114571019_5=1', + 'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.82 Safari/537.36' + }; + const $ = (0, cheerio_1.load)(resToken.body); + const token = $('#token').val(); + const build_server = $('#build_server').val(); + const build_server_id = $('#build_server_id').val(); + const form = new form_data_1.default(); + for (const param of params) + form.append('text[]', param); + form.append('submit', 'Go'); + form.append('token', token); + form.append('build_server', build_server); + form.append('build_server_id', build_server_id); + const html = await (0, got_1.default)(`${BASE_URL}${link}`, { + method: 'POST', + headers: { + ...HEADERS, + ...form.getHeaders() + }, + body: form.getBuffer() + }).text(); + const $$ = (0, cheerio_1.load)(html); + const form2 = $$('#form_value').eq(0).text(); + if (!form2) + throw new utils_js_1.ScraperError(`TextPro "${effect}" failed`, html); + const json = await got_1.default.post(`${BASE_URL}/effect/create-image`, { + headers: HEADERS, + form: JSON.parse(form2) + }).json(); + return `${BASE_URL}${json.image || json.fullsize_image}`; +} +exports.default = textpro; +//# sourceMappingURL=textpro.js.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/cjs/texts/textpro.js.map b/node_modules/@bochilteam/scraper/lib/cjs/texts/textpro.js.map new file mode 100644 index 000000000..112dd3bf9 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/cjs/texts/textpro.js.map @@ -0,0 +1 @@ +{"version":3,"file":"textpro.js","sourceRoot":"","sources":["../../../src/texts/textpro.ts"],"names":[],"mappings":";;;;;;AAAA,8CAAqB;AACrB,qCAA8B;AAC9B,0DAAgC;AAEhC,0CAA0C;AAY1C,MAAM,QAAQ,GAAG,oBAAoB,CAAA;AAExB,QAAA,WAAW,GAA2B,CAAC,KAAK,IAAI,EAAE,CAAC,IAAA,aAAG,EAAC,+EAA+E,CAAC,CAAC,IAAI,EAAiB,CAAC,EAAE,CAAA;AAC9J,KAAK,UAAU,OAAO,CAAE,MAAc,EAAE,MAAyB;;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AG,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,cAAc,EAAE,CAAA;AAC1D,CAAC;AAzCD,0BAyCC"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/cjs/texts/truth.js b/node_modules/@bochilteam/scraper/lib/cjs/texts/truth.js new file mode 100644 index 000000000..df55cfd33 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/cjs/texts/truth.js @@ -0,0 +1,16 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.truthjson = void 0; +const got_1 = __importDefault(require("got")); +exports.truthjson = []; +async function truth() { + if (!exports.truthjson.length) { + exports.truthjson = await (0, got_1.default)('https://raw.githubusercontent.com/BochilTeam/database/master/kata-kata/truth.json').json(); + } + return exports.truthjson[Math.floor(exports.truthjson.length * Math.random())]; +} +exports.default = truth; +//# sourceMappingURL=truth.js.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/cjs/texts/truth.js.map b/node_modules/@bochilteam/scraper/lib/cjs/texts/truth.js.map new file mode 100644 index 000000000..80d96c4c9 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/cjs/texts/truth.js.map @@ -0,0 +1 @@ +{"version":3,"file":"truth.js","sourceRoot":"","sources":["../../../src/texts/truth.ts"],"names":[],"mappings":";;;;;;AAAA,8CAAqB;AAEV,QAAA,SAAS,GAAa,EAAE,CAAA;AACpB,KAAK,UAAU,KAAK;IACjC,IAAI,CAAC,iBAAS,CAAC,MAAM,EAAE;QACrB,iBAAS,GAAG,MAAM,IAAA,aAAG,EACnB,mFAAmF,CACpF,CAAC,IAAI,EAAE,CAAA;KACT;IACD,OAAO,iBAAS,CAAC,IAAI,CAAC,KAAK,CAAC,iBAAS,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC,CAAA;AAChE,CAAC;AAPD,wBAOC"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/cjs/texts/types.js b/node_modules/@bochilteam/scraper/lib/cjs/texts/types.js new file mode 100644 index 000000000..11e638d1e --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/cjs/texts/types.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=types.js.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/cjs/texts/types.js.map b/node_modules/@bochilteam/scraper/lib/cjs/texts/types.js.map new file mode 100644 index 000000000..4ff7d1ff2 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/cjs/texts/types.js.map @@ -0,0 +1 @@ +{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/texts/types.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/cjs/utils.js b/node_modules/@bochilteam/scraper/lib/cjs/utils.js new file mode 100644 index 000000000..7d569271c --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/cjs/utils.js @@ -0,0 +1,58 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.decodeSnapApp = exports.ScraperError = void 0; +class ScraperError extends Error { + constructor(message, options) { + super(message); + this.name = 'ScraperError'; + this.date = new Date(); + this.message = + message + + '\n\nIf this is bug pls report to https://github.com/BochilTeam/scraper'; + } + static createError(message, options) { + return new ScraperError(message, options); + } +} +exports.ScraperError = ScraperError; +function decodeSnapApp(...args) { + // From reponse snap app + function _0xe78c(d, e, f) { + const g = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ+/'.split(''); + const h = g.slice(0, e); + const i = g.slice(0, f); + // @ts-ignore + // eslint-disable-next-line array-callback-return + let j = d.split('').reverse().reduce(function (a, b, c) { + // eslint-disable-next-line no-return-assign + if (h.indexOf(b) !== -1) + return a += h.indexOf(b) * (Math.pow(e, c)); + }, 0); + let k = ''; + while (j > 0) { + k = i[j % f] + k; + j = (j - (j % f)) / f; + } + return k || '0'; + } + function _0xc60e(h, u, n, t, e, r) { + r = ''; + for (let i = 0, len = h.length; i < len; i++) { + let s = ''; + while (h[i] !== n[e]) { + s += h[i]; + i++; + } + for (let j = 0; j < n.length; j++) { + s = s.replace(new RegExp(n[j], 'g'), j.toString()); + } + // @ts-ignore + r += String.fromCharCode((_0xe78c(s, e, 10) - t)); + } + return decodeURIComponent(encodeURIComponent(r)); + } + // @ts-ignore + return _0xc60e(...args); +} +exports.decodeSnapApp = decodeSnapApp; +//# sourceMappingURL=utils.js.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/cjs/utils.js.map b/node_modules/@bochilteam/scraper/lib/cjs/utils.js.map new file mode 100644 index 000000000..9d7df4a6d --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/cjs/utils.js.map @@ -0,0 +1 @@ +{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":";;;AAAA,MAAa,YAAa,SAAQ,KAAK;IAErC,YAAa,OAAY,EAAE,OAAY;QACrC,KAAK,CAAC,OAAO,CAAC,CAAA;QACd,IAAI,CAAC,IAAI,GAAG,cAAc,CAAA;QAC1B,IAAI,CAAC,IAAI,GAAG,IAAI,IAAI,EAAE,CAAA;QACtB,IAAI,CAAC,OAAO;YACV,OAAO;gBACP,wEAAwE,CAAA;IAC5E,CAAC;IAED,MAAM,CAAC,WAAW,CAAE,OAAY,EAAE,OAAW;QAC3C,OAAO,IAAI,YAAY,CAAC,OAAO,EAAE,OAAO,CAAC,CAAA;IAC3C,CAAC;CACF;AAdD,oCAcC;AAED,SAAgB,aAAa,CAAE,GAAG,IAAyB;IACzD,wBAAwB;IACxB,SAAS,OAAO,CACd,CAAS,EACT,CAAS,EACT,CAAS;QAET,MAAM,CAAC,GAAG,kEAAkE,CAAC,KAAK,CAAC,EAAE,CAAC,CAAA;QACtF,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC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AG,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;gBACjC,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAA;aACnD;YACD,aAAa;YACb,CAAC,IAAI,MAAM,CAAC,YAAY,CAAC,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,CAAa,CAAC,CAAA;SAC9D;QACD,OAAO,kBAAkB,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC,CAAA;IAClD,CAAC;IACD,aAAa;IACb,OAAO,OAAO,CAAC,GAAG,IAAI,CAAC,CAAA;AACzB,CAAC;AAjDD,sCAiDC"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/esm/encryptions/base64.js b/node_modules/@bochilteam/scraper/lib/esm/encryptions/base64.js new file mode 100644 index 000000000..655378530 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/esm/encryptions/base64.js @@ -0,0 +1,11 @@ +export function toBase64(data) { + if (!Buffer.isBuffer(data)) + data = Buffer.from(data); + return data.toString('base64'); +} +export function fromBase64ToString(data) { + if (/data:.*;base64,/i.test(data)) + data = data.replace(/data:.*;base64,/i, ''); + return Buffer.from(data, 'base64').toString(); +} +//# sourceMappingURL=base64.js.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/esm/encryptions/base64.js.map b/node_modules/@bochilteam/scraper/lib/esm/encryptions/base64.js.map new file mode 100644 index 000000000..31b580451 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/esm/encryptions/base64.js.map @@ -0,0 +1 @@ +{"version":3,"file":"base64.js","sourceRoot":"","sources":["../../../src/encryptions/base64.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,QAAQ,CAAE,IAAS;IACjC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC;QAAE,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IACpD,OAAO,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAA;AAChC,CAAC;AAED,MAAM,UAAU,kBAAkB,CAAE,IAAY;IAC9C,IAAI,kBAAkB,CAAC,IAAI,CAAC,IAAI,CAAC;QAAE,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,kBAAkB,EAAE,EAAE,CAAC,CAAA;IAC9E,OAAO,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC,QAAQ,EAAE,CAAA;AAC/C,CAAC"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/esm/encryptions/crypto.js b/node_modules/@bochilteam/scraper/lib/esm/encryptions/crypto.js new file mode 100644 index 000000000..76e566eba --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/esm/encryptions/crypto.js @@ -0,0 +1,50 @@ +import crypto from 'crypto'; +export function randomUUID(opts) { + if (typeof crypto.randomUUID === 'function') { + return crypto.randomUUID(opts); + } + const rnds8Pool = new Uint8Array(256); // # of random values to pre-allocate + let poolPtr = rnds8Pool.length; + if (poolPtr > rnds8Pool.length - 16) { + crypto.randomFillSync(rnds8Pool); + poolPtr = 0; + } + // eslint-disable-next-line prefer-const + let rnds = rnds8Pool.slice(poolPtr, (poolPtr += 16)); + rnds[6] = (rnds[6] & 0x0f) | 0x40; + rnds[8] = (rnds[8] & 0x3f) | 0x80; + return serializeUUID(rnds); +} +export function randomBytes(size) { + return crypto.randomBytes(size).toString('hex'); +} +export function createHash(algorithm /* 'md4' | 'md5' | 'sha1' | 'sha256' | 'sha512 */, data) { + return crypto.createHash(algorithm).update(data).digest('hex'); +} +const kHexBytes = []; +for (let i = 0; i < 256; ++i) { + kHexBytes.push((i + 0x100).toString(16).substr(1)); +} +function serializeUUID(buf, offset = 0) { + return (kHexBytes[buf[offset]] + + kHexBytes[buf[offset + 1]] + + kHexBytes[buf[offset + 2]] + + kHexBytes[buf[offset + 3]] + + '-' + + kHexBytes[buf[offset + 4]] + + kHexBytes[buf[offset + 5]] + + '-' + + kHexBytes[(buf[offset + 6] & 0x0f) | 0x40] + + kHexBytes[buf[offset + 7]] + + '-' + + kHexBytes[(buf[offset + 8] & 0x3f) | 0x80] + + kHexBytes[buf[offset + 9]] + + '-' + + kHexBytes[buf[offset + 10]] + + kHexBytes[buf[offset + 11]] + + kHexBytes[buf[offset + 12]] + + kHexBytes[buf[offset + 13]] + + kHexBytes[buf[offset + 14]] + + kHexBytes[buf[offset + 15]]).toLowerCase(); +} +//# sourceMappingURL=crypto.js.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/esm/encryptions/crypto.js.map b/node_modules/@bochilteam/scraper/lib/esm/encryptions/crypto.js.map new file mode 100644 index 000000000..26aac3dae --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/esm/encryptions/crypto.js.map @@ -0,0 +1 @@ +{"version":3,"file":"crypto.js","sourceRoot":"","sources":["../../../src/encryptions/crypto.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,QAAQ,CAAA;AAE3B,MAAM,UAAU,UAAU,CAAE,IAAuC;IACjE,IAAI,OAAO,MAAM,CAAC,UAAU,KAAK,UAAU,EAAE;QAAE,OAAO,MAAM,CAAC,UAAU,CAAC,IAAI,CAAW,CAAA;KAAE;IACzF,MAAM,SAAS,GAAG,IAAI,UAAU,CAAC,GAAG,CAAC,CAAA,CAAC,qCAAqC;IAC3E,IAAI,OAAO,GAAW,SAAS,CAAC,MAAM,CAAA;IACtC,IAAI,OAAO,GAAG,SAAS,CAAC,MAAM,GAAG,EAAE,EAAE;QACnC,MAAM,CAAC,cAAc,CAAC,SAAS,CAAC,CAAA;QAChC,OAAO,GAAG,CAAC,CAAA;KACZ;IACD,wCAAwC;IACxC,IAAI,IAAI,GAAe,SAAS,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC,OAAO,IAAI,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AC1B,SAAS,CAAC,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;QAC1B,GAAG;QACH,SAAS,CAAC,CAAC,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,IAAI,CAAC;QAC1C,SAAS,CAAC,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;QAC1B,GAAG;QACH,SAAS,CAAC,CAAC,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,IAAI,CAAC;QAC1C,SAAS,CAAC,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;QAC1B,GAAG;QACH,SAAS,CAAC,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;QAC3B,SAAS,CAAC,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;QAC3B,SAAS,CAAC,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;QAC3B,SAAS,CAAC,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;QAC3B,SAAS,CAAC,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;QAC3B,SAAS,CAAC,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC,CAC5B,CAAC,WAAW,EAAE,CAAA;AACjB,CAAC"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/esm/encryptions/index.js b/node_modules/@bochilteam/scraper/lib/esm/encryptions/index.js new file mode 100644 index 000000000..43ee82166 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/esm/encryptions/index.js @@ -0,0 +1,3 @@ +export * from './base64.js'; +export * from './crypto.js'; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/esm/encryptions/index.js.map b/node_modules/@bochilteam/scraper/lib/esm/encryptions/index.js.map new file mode 100644 index 000000000..adff29889 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/esm/encryptions/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/encryptions/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;AAC3B,cAAc,aAAa,CAAA"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/esm/encryptions/test.js b/node_modules/@bochilteam/scraper/lib/esm/encryptions/test.js new file mode 100644 index 000000000..e04ba55d5 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/esm/encryptions/test.js @@ -0,0 +1,62 @@ +import { expect } from 'chai'; +import { toBase64, fromBase64ToString, randomUUID, randomBytes, createHash } from './index.js'; +describe('Encryptions', () => { + describe('Base64', () => { + it('From string to base64', done => { + try { + const res = toBase64('Hello World!!'); + expect(res).to.be.a('string'); + expect(res).to.be.equal('SGVsbG8gV29ybGQhIQ=='); + return done(); + } + catch (e) { + return done(e); + } + }); + it('from base64 to string', done => { + try { + const res = fromBase64ToString('SGVsbG8gV29ybGQhIQ=='); + expect(res).to.be.a('string'); + expect(res).to.be.equal('Hello World!!'); + return done(); + } + catch (e) { + return done(e); + } + }); + }); + describe('Crypto', () => { + it('randomUUID', done => { + try { + const res = randomUUID(); + expect(res).to.be.a('string'); + return done(); + } + catch (e) { + return done(e); + } + }); + it('randomBytes', done => { + try { + const res = randomBytes(16); + expect(res).to.be.a('string'); + return done(); + } + catch (e) { + return done(e); + } + }); + it('createHash', done => { + try { + const res = createHash('sha256', 'Hello world!!'); + expect(res).to.be.a('string'); + expect(res).to.have.length(64); + return done(); + } + catch (e) { + return done(e); + } + }); + }); +}); +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/esm/encryptions/test.js.map b/node_modules/@bochilteam/scraper/lib/esm/encryptions/test.js.map new file mode 100644 index 000000000..53afef9bd --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/esm/encryptions/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["../../../src/encryptions/test.ts"],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AAE;YACtB,IAAI;gBACF,MAAM,GAAG,GAAG,UAAU,EAAE,CAAA;gBACxB,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAA;gBAE7B,OAAO,IAAI,EAAE,CAAA;aACd;YAAC,OAAO,CAAC,EAAE;gBACV,OAAO,IAAI,CAAC,CAAC,CAAC,CAAA;aACf;QACH,CAAC,CAAC,CAAA;QAEF,EAAE,CAAC,aAAa,EAAE,IAAI,CAAC,EAAE;YACvB,IAAI;gBACF,MAAM,GAAG,GAAG,WAAW,CAAC,EAAE,CAAC,CAAA;gBAC3B,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAA;gBAE7B,OAAO,IAAI,EAAE,CAAA;aACd;YAAC,OAAO,CAAC,EAAE;gBACV,OAAO,IAAI,CAAC,CAAC,CAAC,CAAA;aACf;QACH,CAAC,CAAC,CAAA;QAEF,EAAE,CAAC,YAAY,EAAE,IAAI,CAAC,EAAE;YACtB,IAAI;gBACF,MAAM,GAAG,GAAG,UAAU,CAAC,QAAQ,EAAE,eAAe,CAAC,CAAA;gBACjD,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAA;gBAC7B,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,CAAA;gBAE9B,OAAO,IAAI,EAAE,CAAA;aACd;YAAC,OAAO,CAAC,EAAE;gBACV,OAAO,IAAI,CAAC,CAAC,CAAC,CAAA;aACf;QACH,CAAC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/esm/games/asahotak.js b/node_modules/@bochilteam/scraper/lib/esm/games/asahotak.js new file mode 100644 index 000000000..da24e9b4f --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/esm/games/asahotak.js @@ -0,0 +1,9 @@ +import got from 'got'; +export let asahotakjson; +export default async function asahotak() { + if (!asahotakjson) { + asahotakjson = await got('https://raw.githubusercontent.com/BochilTeam/database/master/games/asahotak.json').json(); + } + return asahotakjson[Math.floor(Math.random() * asahotakjson.length)]; +} +//# sourceMappingURL=asahotak.js.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/esm/games/asahotak.js.map b/node_modules/@bochilteam/scraper/lib/esm/games/asahotak.js.map new file mode 100644 index 000000000..88b70de84 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/esm/games/asahotak.js.map @@ -0,0 +1 @@ +{"version":3,"file":"asahotak.js","sourceRoot":"","sources":["../../../src/games/asahotak.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,KAAK,CAAA;AAGrB,MAAM,CAAC,IAAI,YAAwB,CAAA;AACnC,MAAM,CAAC,OAAO,CAAC,KAAK,UAAU,QAAQ;IACpC,IAAI,CAAC,YAAY,EAAE;QACjB,YAAY,GAAG,MAAM,GAAG,CACtB,kFAAkF,CACnF,CAAC,IAAI,EAAE,CAAA;KACT;IACD,OAAO,YAAY,CACjB,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,YAAY,CAAC,MAAM,CAAC,CACpC,CAAA;AACf,CAAC"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/esm/games/caklontong.js b/node_modules/@bochilteam/scraper/lib/esm/games/caklontong.js new file mode 100644 index 000000000..09de0f844 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/esm/games/caklontong.js @@ -0,0 +1,9 @@ +import got from 'got'; +export let caklontongjson; +export default async function caklontong() { + if (!caklontongjson) { + caklontongjson = await got('https://raw.githubusercontent.com/BochilTeam/database/master/games/caklontong.json').json(); + } + return caklontongjson[Math.floor(Math.random() * caklontongjson.length)]; +} +//# sourceMappingURL=caklontong.js.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/esm/games/caklontong.js.map b/node_modules/@bochilteam/scraper/lib/esm/games/caklontong.js.map new file mode 100644 index 000000000..4127c069d --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/esm/games/caklontong.js.map @@ -0,0 +1 @@ +{"version":3,"file":"caklontong.js","sourceRoot":"","sources":["../../../src/games/caklontong.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,KAAK,CAAA;AAGrB,MAAM,CAAC,IAAI,cAA4B,CAAA;AACvC,MAAM,CAAC,OAAO,CAAC,KAAK,UAAU,UAAU;IACtC,IAAI,CAAC,cAAc,EAAE;QACnB,cAAc,GAAG,MAAM,GAAG,CACxB,oFAAoF,CACrF,CAAC,IAAI,EAAE,CAAA;KACT;IACD,OAAO,cAAc,CACnB,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,cAAc,CAAC,MAAM,CAAC,CACpC,CAAA;AACjB,CAAC"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/esm/games/family100.js b/node_modules/@bochilteam/scraper/lib/esm/games/family100.js new file mode 100644 index 000000000..54d246cf7 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/esm/games/family100.js @@ -0,0 +1,9 @@ +import got from 'got'; +export let family100json; +export default async function family100() { + if (!family100json) { + family100json = await got('https://raw.githubusercontent.com/BochilTeam/database/master/games/family100.json').json(); + } + return family100json[Math.floor(Math.random() * family100json.length)]; +} +//# sourceMappingURL=family100.js.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/esm/games/family100.js.map b/node_modules/@bochilteam/scraper/lib/esm/games/family100.js.map new file mode 100644 index 000000000..72ba0bdfe --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/esm/games/family100.js.map @@ -0,0 +1 @@ +{"version":3,"file":"family100.js","sourceRoot":"","sources":["../../../src/games/family100.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,KAAK,CAAA;AAGrB,MAAM,CAAC,IAAI,aAA0B,CAAA;AACrC,MAAM,CAAC,OAAO,CAAC,KAAK,UAAU,SAAS;IACrC,IAAI,CAAC,aAAa,EAAE;QAClB,aAAa,GAAG,MAAM,GAAG,CACvB,mFAAmF,CACpF,CAAC,IAAI,EAAE,CAAA;KACT;IACD,OAAO,aAAa,CAClB,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,aAAa,CAAC,MAAM,CAAC,CACpC,CAAA;AAChB,CAAC"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/esm/games/index.js b/node_modules/@bochilteam/scraper/lib/esm/games/index.js new file mode 100644 index 000000000..0a7e4a202 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/esm/games/index.js @@ -0,0 +1,15 @@ +import asahotak, { asahotakjson } from './asahotak.js'; +import caklontong, { caklontongjson } from './caklontong.js'; +import family100, { family100json } from './family100.js'; +import siapakahaku, { siapakahakujson } from './siapakahaku.js'; +import susunkata, { susunkatajson } from './susunkata.js'; +import tebakbendera, { tebakbenderajson } from './tebakbendera.js'; +import tebakgambar, { tebakgambarjson } from './tebakgambar.js'; +import tebakkabupaten, { tebakkabupatenjson } from './tebakkabupaten.js'; +import tebakkata, { tebakkatajson } from './tebakkata.js'; +import tebakkimia, { tebakkimiajson } from './tebakkimia.js'; +import tebaklirik, { tebaklirikjson } from './tebaklirik.js'; +import tebaktebakan, { tebaktebakanjson } from './tebaktebakan.js'; +import tekateki, { tekatekijson } from './tekateki.js'; +export { tebakgambar, tebakgambarjson, caklontong, caklontongjson, family100, family100json, asahotak, asahotakjson, tebakkata, tebakkatajson, tekateki, tekatekijson, tebakkimia, tebakkimiajson, tebakkabupaten, tebakkabupatenjson, siapakahaku, siapakahakujson, susunkata, susunkatajson, tebakbendera, tebakbenderajson, tebaklirik, tebaklirikjson, tebaktebakan, tebaktebakanjson }; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/esm/games/index.js.map b/node_modules/@bochilteam/scraper/lib/esm/games/index.js.map new file mode 100644 index 000000000..ca5b7197f --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/esm/games/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/games/index.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,EAAE,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AACtD,OAAO,UAAU,EAAE,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAC5D,OAAO,SAAS,EAAE,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAA;AACzD,OAAO,WAAW,EAAE,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAA;AAC/D,OAAO,SAAS,EAAE,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAA;AACzD,OAAO,YAAY,EAAE,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAA;AAClE,OAAO,WAAW,EAAE,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAA;AAC/D,OAAO,cAAc,EAAE,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAA;AACxE,OAAO,SAAS,EAAE,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAA;AACzD,OAAO,UAAU,EAAE,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAC5D,OAAO,UAAU,EAAE,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAC5D,OAAO,YAAY,EAAE,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAA;AAClE,OAAO,QAAQ,EAAE,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AAEtD,OAAO,EACL,WAAW,EACX,eAAe,EACf,UAAU,EACV,cAAc,EACd,SAAS,EACT,aAAa,EACb,QAAQ,EACR,YAAY,EACZ,SAAS,EACT,aAAa,EACb,QAAQ,EACR,YAAY,EACZ,UAAU,EACV,cAAc,EACd,cAAc,EACd,kBAAkB,EAClB,WAAW,EACX,eAAe,EACf,SAAS,EACT,aAAa,EACb,YAAY,EACZ,gBAAgB,EAChB,UAAU,EACV,cAAc,EACd,YAAY,EACZ,gBAAgB,EACjB,CAAA"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/esm/games/siapakahaku.js b/node_modules/@bochilteam/scraper/lib/esm/games/siapakahaku.js new file mode 100644 index 000000000..2b9c6e9c2 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/esm/games/siapakahaku.js @@ -0,0 +1,9 @@ +import got from 'got'; +export let siapakahakujson; +export default async function siapakahaku() { + if (!siapakahakujson) { + siapakahakujson = await got('https://raw.githubusercontent.com/BochilTeam/database/master/games/siapakahaku.json').json(); + } + return siapakahakujson[Math.floor(Math.random() * siapakahakujson.length)]; +} +//# sourceMappingURL=siapakahaku.js.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/esm/games/siapakahaku.js.map b/node_modules/@bochilteam/scraper/lib/esm/games/siapakahaku.js.map new file mode 100644 index 000000000..3a93cbb5a --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/esm/games/siapakahaku.js.map @@ -0,0 +1 @@ +{"version":3,"file":"siapakahaku.js","sourceRoot":"","sources":["../../../src/games/siapakahaku.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,KAAK,CAAA;AAGrB,MAAM,CAAC,IAAI,eAA8B,CAAA;AACzC,MAAM,CAAC,OAAO,CAAC,KAAK,UAAU,WAAW;IACvC,IAAI,CAAC,eAAe,EAAE;QACpB,eAAe,GAAG,MAAM,GAAG,CACzB,qFAAqF,CACtF,CAAC,IAAI,EAAE,CAAA;KACT;IACD,OAAO,eAAe,CACpB,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,eAAe,CAAC,MAAM,CAAC,CACpC,CAAA;AAClB,CAAC"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/esm/games/susunkata.js b/node_modules/@bochilteam/scraper/lib/esm/games/susunkata.js new file mode 100644 index 000000000..fe75281a2 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/esm/games/susunkata.js @@ -0,0 +1,9 @@ +import got from 'got'; +export let susunkatajson; +export default async function susunkata() { + if (!susunkatajson) { + susunkatajson = await got('https://raw.githubusercontent.com/BochilTeam/database/master/games/susunkata.json').json(); + } + return susunkatajson[Math.floor(Math.random() * susunkatajson.length)]; +} +//# sourceMappingURL=susunkata.js.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/esm/games/susunkata.js.map b/node_modules/@bochilteam/scraper/lib/esm/games/susunkata.js.map new file mode 100644 index 000000000..9046ecd60 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/esm/games/susunkata.js.map @@ -0,0 +1 @@ +{"version":3,"file":"susunkata.js","sourceRoot":"","sources":["../../../src/games/susunkata.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,KAAK,CAAA;AAGrB,MAAM,CAAC,IAAI,aAA0B,CAAA;AACrC,MAAM,CAAC,OAAO,CAAC,KAAK,UAAU,SAAS;IACrC,IAAI,CAAC,aAAa,EAAE;QAClB,aAAa,GAAG,MAAM,GAAG,CACvB,mFAAmF,CACpF,CAAC,IAAI,EAAE,CAAA;KACT;IACD,OAAO,aAAa,CAClB,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,aAAa,CAAC,MAAM,CAAC,CACpC,CAAA;AAChB,CAAC"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/esm/games/tebakbendera.js b/node_modules/@bochilteam/scraper/lib/esm/games/tebakbendera.js new file mode 100644 index 000000000..5cf3e824b --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/esm/games/tebakbendera.js @@ -0,0 +1,9 @@ +import got from 'got'; +export let tebakbenderajson; +export default async function tebakbendera() { + if (!tebakbenderajson) { + tebakbenderajson = await got('https://raw.githubusercontent.com/BochilTeam/database/master/games/tebakbendera.json').json(); + } + return tebakbenderajson[Math.floor(Math.random() * tebakbenderajson.length)]; +} +//# sourceMappingURL=tebakbendera.js.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/esm/games/tebakbendera.js.map b/node_modules/@bochilteam/scraper/lib/esm/games/tebakbendera.js.map new file mode 100644 index 000000000..ffd343a94 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/esm/games/tebakbendera.js.map @@ -0,0 +1 @@ +{"version":3,"file":"tebakbendera.js","sourceRoot":"","sources":["../../../src/games/tebakbendera.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,KAAK,CAAA;AAGrB,MAAM,CAAC,IAAI,gBAAgC,CAAA;AAC3C,MAAM,CAAC,OAAO,CAAC,KAAK,UAAU,YAAY;IACxC,IAAI,CAAC,gBAAgB,EAAE;QACrB,gBAAgB,GAAG,MAAM,GAAG,CAC1B,sFAAsF,CACvF,CAAC,IAAI,EAAE,CAAA;KACT;IACD,OAAO,gBAAgB,CACrB,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,gBAAgB,CAAC,MAAM,CAAC,CACpC,CAAA;AACnB,CAAC"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/esm/games/tebakgambar.js b/node_modules/@bochilteam/scraper/lib/esm/games/tebakgambar.js new file mode 100644 index 000000000..b3522ad93 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/esm/games/tebakgambar.js @@ -0,0 +1,9 @@ +import got from 'got'; +export let tebakgambarjson; +export default async function tebakgambar() { + if (!tebakgambarjson) { + tebakgambarjson = await got('https://raw.githubusercontent.com/BochilTeam/database/master/games/tebakgambar.json').json(); + } + return tebakgambarjson[Math.floor(Math.random() * tebakgambarjson.length)]; +} +//# sourceMappingURL=tebakgambar.js.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/esm/games/tebakgambar.js.map b/node_modules/@bochilteam/scraper/lib/esm/games/tebakgambar.js.map new file mode 100644 index 000000000..9edb74295 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/esm/games/tebakgambar.js.map @@ -0,0 +1 @@ +{"version":3,"file":"tebakgambar.js","sourceRoot":"","sources":["../../../src/games/tebakgambar.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,KAAK,CAAA;AAGrB,MAAM,CAAC,IAAI,eAA8B,CAAA;AACzC,MAAM,CAAC,OAAO,CAAC,KAAK,UAAU,WAAW;IACvC,IAAI,CAAC,eAAe,EAAE;QACpB,eAAe,GAAG,MAAM,GAAG,CACzB,qFAAqF,CACtF,CAAC,IAAI,EAAE,CAAA;KACT;IACD,OAAO,eAAe,CACpB,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,eAAe,CAAC,MAAM,CAAC,CACpC,CAAA;AAClB,CAAC"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/esm/games/tebakkabupaten.js b/node_modules/@bochilteam/scraper/lib/esm/games/tebakkabupaten.js new file mode 100644 index 000000000..29e1c16ab --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/esm/games/tebakkabupaten.js @@ -0,0 +1,9 @@ +import got from 'got'; +export let tebakkabupatenjson; +export default async function tebakkabupaten() { + if (!tebakkabupatenjson) { + tebakkabupatenjson = await got('https://raw.githubusercontent.com/BochilTeam/database/master/games/tebakkabupaten.json').json(); + } + return tebakkabupatenjson[Math.floor(Math.random() * tebakkabupatenjson.length)]; +} +//# sourceMappingURL=tebakkabupaten.js.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/esm/games/tebakkabupaten.js.map b/node_modules/@bochilteam/scraper/lib/esm/games/tebakkabupaten.js.map new file mode 100644 index 000000000..f4b5c9174 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/esm/games/tebakkabupaten.js.map @@ -0,0 +1 @@ +{"version":3,"file":"tebakkabupaten.js","sourceRoot":"","sources":["../../../src/games/tebakkabupaten.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,KAAK,CAAA;AAGrB,MAAM,CAAC,IAAI,kBAAoC,CAAA;AAC/C,MAAM,CAAC,OAAO,CAAC,KAAK,UAAU,cAAc;IAC1C,IAAI,CAAC,kBAAkB,EAAE;QACvB,kBAAkB,GAAG,MAAM,GAAG,CAC5B,wFAAwF,CACzF,CAAC,IAAI,EAAE,CAAA;KACT;IACD,OAAO,kBAAkB,CACvB,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,kBAAkB,CAAC,MAAM,CAAC,CACpC,CAAA;AACrB,CAAC"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/esm/games/tebakkata.js b/node_modules/@bochilteam/scraper/lib/esm/games/tebakkata.js new file mode 100644 index 000000000..f6e66e58d --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/esm/games/tebakkata.js @@ -0,0 +1,9 @@ +import got from 'got'; +export let tebakkatajson; +export default async function tebakkata() { + if (!tebakkatajson) { + tebakkatajson = await got('https://raw.githubusercontent.com/BochilTeam/database/master/games/tebakkata.json').json(); + } + return tebakkatajson[Math.floor(Math.random() * tebakkatajson.length)]; +} +//# sourceMappingURL=tebakkata.js.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/esm/games/tebakkata.js.map b/node_modules/@bochilteam/scraper/lib/esm/games/tebakkata.js.map new file mode 100644 index 000000000..8772a3cc0 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/esm/games/tebakkata.js.map @@ -0,0 +1 @@ +{"version":3,"file":"tebakkata.js","sourceRoot":"","sources":["../../../src/games/tebakkata.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,KAAK,CAAA;AAGrB,MAAM,CAAC,IAAI,aAA0B,CAAA;AACrC,MAAM,CAAC,OAAO,CAAC,KAAK,UAAU,SAAS;IACrC,IAAI,CAAC,aAAa,EAAE;QAClB,aAAa,GAAG,MAAM,GAAG,CACvB,mFAAmF,CACpF,CAAC,IAAI,EAAE,CAAA;KACT;IACD,OAAO,aAAa,CAClB,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,aAAa,CAAC,MAAM,CAAC,CACpC,CAAA;AAChB,CAAC"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/esm/games/tebakkimia.js b/node_modules/@bochilteam/scraper/lib/esm/games/tebakkimia.js new file mode 100644 index 000000000..7c16b7106 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/esm/games/tebakkimia.js @@ -0,0 +1,9 @@ +import got from 'got'; +export let tebakkimiajson; +export default async function tebakkimia() { + if (!tebakkimiajson) { + tebakkimiajson = await got('https://raw.githubusercontent.com/BochilTeam/database/master/games/tebakkimia.json').json(); + } + return tebakkimiajson[Math.floor(Math.random() * tebakkimiajson.length)]; +} +//# sourceMappingURL=tebakkimia.js.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/esm/games/tebakkimia.js.map b/node_modules/@bochilteam/scraper/lib/esm/games/tebakkimia.js.map new file mode 100644 index 000000000..66b15f412 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/esm/games/tebakkimia.js.map @@ -0,0 +1 @@ +{"version":3,"file":"tebakkimia.js","sourceRoot":"","sources":["../../../src/games/tebakkimia.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,KAAK,CAAA;AAGrB,MAAM,CAAC,IAAI,cAA4B,CAAA;AACvC,MAAM,CAAC,OAAO,CAAC,KAAK,UAAU,UAAU;IACtC,IAAI,CAAC,cAAc,EAAE;QACnB,cAAc,GAAG,MAAM,GAAG,CACxB,oFAAoF,CACrF,CAAC,IAAI,EAAE,CAAA;KACT;IACD,OAAO,cAAc,CACnB,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,cAAc,CAAC,MAAM,CAAC,CACpC,CAAA;AACjB,CAAC"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/esm/games/tebaklirik.js b/node_modules/@bochilteam/scraper/lib/esm/games/tebaklirik.js new file mode 100644 index 000000000..39b0e0f42 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/esm/games/tebaklirik.js @@ -0,0 +1,9 @@ +import got from 'got'; +export let tebaklirikjson; +export default async function tebaklirik() { + if (!tebaklirikjson) { + tebaklirikjson = await got('https://raw.githubusercontent.com/BochilTeam/database/master/games/tebaklirik.json').json(); + } + return tebaklirikjson[Math.floor(Math.random() * tebaklirikjson.length)]; +} +//# sourceMappingURL=tebaklirik.js.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/esm/games/tebaklirik.js.map b/node_modules/@bochilteam/scraper/lib/esm/games/tebaklirik.js.map new file mode 100644 index 000000000..53c0bf3d4 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/esm/games/tebaklirik.js.map @@ -0,0 +1 @@ +{"version":3,"file":"tebaklirik.js","sourceRoot":"","sources":["../../../src/games/tebaklirik.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,KAAK,CAAA;AAGrB,MAAM,CAAC,IAAI,cAA4B,CAAA;AACvC,MAAM,CAAC,OAAO,CAAC,KAAK,UAAU,UAAU;IACtC,IAAI,CAAC,cAAc,EAAE;QACnB,cAAc,GAAG,MAAM,GAAG,CACxB,oFAAoF,CACrF,CAAC,IAAI,EAAE,CAAA;KACT;IACD,OAAO,cAAc,CACnB,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,cAAc,CAAC,MAAM,CAAC,CACpC,CAAA;AACjB,CAAC"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/esm/games/tebaktebakan.js b/node_modules/@bochilteam/scraper/lib/esm/games/tebaktebakan.js new file mode 100644 index 000000000..1bd30eda9 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/esm/games/tebaktebakan.js @@ -0,0 +1,9 @@ +import got from 'got'; +export let tebaktebakanjson; +export default async function tebaktebakan() { + if (!tebaktebakanjson) { + tebaktebakanjson = await got('https://raw.githubusercontent.com/BochilTeam/database/master/games/tebaktebakan.json').json(); + } + return tebaktebakanjson[Math.floor(Math.random() * tebaktebakanjson.length)]; +} +//# sourceMappingURL=tebaktebakan.js.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/esm/games/tebaktebakan.js.map b/node_modules/@bochilteam/scraper/lib/esm/games/tebaktebakan.js.map new file mode 100644 index 000000000..aaf7d7768 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/esm/games/tebaktebakan.js.map @@ -0,0 +1 @@ +{"version":3,"file":"tebaktebakan.js","sourceRoot":"","sources":["../../../src/games/tebaktebakan.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,KAAK,CAAA;AAGrB,MAAM,CAAC,IAAI,gBAAgC,CAAA;AAC3C,MAAM,CAAC,OAAO,CAAC,KAAK,UAAU,YAAY;IACxC,IAAI,CAAC,gBAAgB,EAAE;QACrB,gBAAgB,GAAG,MAAM,GAAG,CAC1B,sFAAsF,CACvF,CAAC,IAAI,EAAE,CAAA;KACT;IACD,OAAO,gBAAgB,CACrB,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,gBAAgB,CAAC,MAAM,CAAC,CACpC,CAAA;AACnB,CAAC"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/esm/games/tekateki.js b/node_modules/@bochilteam/scraper/lib/esm/games/tekateki.js new file mode 100644 index 000000000..3b0fa8bf8 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/esm/games/tekateki.js @@ -0,0 +1,9 @@ +import got from 'got'; +export let tekatekijson; +export default async function tekateki() { + if (!tekatekijson) { + tekatekijson = await got('https://raw.githubusercontent.com/BochilTeam/database/master/games/tekateki.json').json(); + } + return tekatekijson[Math.floor(Math.random() * tekatekijson.length)]; +} +//# sourceMappingURL=tekateki.js.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/esm/games/tekateki.js.map b/node_modules/@bochilteam/scraper/lib/esm/games/tekateki.js.map new file mode 100644 index 000000000..44ef95b7f --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/esm/games/tekateki.js.map @@ -0,0 +1 @@ +{"version":3,"file":"tekateki.js","sourceRoot":"","sources":["../../../src/games/tekateki.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,KAAK,CAAA;AAGrB,MAAM,CAAC,IAAI,YAAwB,CAAA;AACnC,MAAM,CAAC,OAAO,CAAC,KAAK,UAAU,QAAQ;IACpC,IAAI,CAAC,YAAY,EAAE;QACjB,YAAY,GAAG,MAAM,GAAG,CACtB,kFAAkF,CACnF,CAAC,IAAI,EAAE,CAAA;KACT;IACD,OAAO,YAAY,CACjB,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,YAAY,CAAC,MAAM,CAAC,CACpC,CAAA;AACf,CAAC"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/esm/games/test.js b/node_modules/@bochilteam/scraper/lib/esm/games/test.js new file mode 100644 index 000000000..b96126168 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/esm/games/test.js @@ -0,0 +1,224 @@ +import { expect } from 'chai'; +import { tebakgambar, tebakgambarjson, asahotak, asahotakjson, caklontong, caklontongjson, family100, family100json, tebakkata, tebakkatajson, tebakkimia, tebakkimiajson, tekateki, tekatekijson, siapakahaku, siapakahakujson, susunkata, susunkatajson, tebakbendera, tebakbenderajson, tebaklirik, tebaklirikjson, tebakkabupaten, tebakkabupatenjson, tebaktebakan, tebaktebakanjson } from './index.js'; +describe('Games', () => { + describe('Tebakgambar', () => { + it('tebakgambar', done => { + tebakgambar().then(result => { + expect(result).to.an('object'); + expect(result.index).to.a('number'); + expect(result.img).to.a('string'); + expect(result.jawaban).to.a('string'); + expect(result.deskripsi).to.a('string'); + return done(); + }).catch(done); + }); + it('tebakgambar JSON', done => { + const res = tebakgambarjson; + expect(res).to.an('array'); + expect(res).to.have.lengthOf.at.least(1000); + return done(); + }); + }); + describe('Asahotak', () => { + it('asahotak', done => { + asahotak().then(result => { + expect(result).to.an('object'); + expect(result.index).to.a('number'); + expect(result.soal).to.a('string'); + expect(result.jawaban).to.a('string'); + return done(); + }).catch(done); + }); + it('asahotak JSON', done => { + const res = asahotakjson; + expect(res).to.an('array'); + expect(res).to.have.lengthOf.at.least(228); + return done(); + }); + }); + describe('Caklontong', () => { + it('caklontong', done => { + caklontong().then(result => { + expect(result).to.an('object'); + expect(result.index).to.a('number'); + expect(result.soal).to.a('string'); + expect(result.jawaban).to.a('string'); + expect(result.deskripsi).to.a('string'); + return done(); + }).catch(done); + }); + it('caklontong JSON', done => { + const res = caklontongjson; + expect(res).to.an('array'); + expect(res).to.have.lengthOf.at.least(414); + return done(); + }); + }); + describe('Family 100', () => { + it('family100', done => { + family100().then(result => { + expect(result).to.an('object'); + expect(result.soal).to.a('string'); + expect(result.jawaban).to.a('array'); + return done(); + }).catch(done); + }); + it('family100 JSON', done => { + const res = family100json; + expect(res).to.an('array'); + expect(res).to.have.lengthOf.at.least(7152); + return done(); + }); + }); + describe('TebakKata', () => { + it('tebakkata', done => { + tebakkata().then(result => { + expect(result).to.an('object'); + expect(result.index).to.a('number'); + expect(result.soal).to.a('string'); + expect(result.jawaban).to.a('string'); + return done(); + }).catch(done); + }); + it('tebakkata JSON', done => { + const res = tebakkatajson; + expect(res).to.an('array'); + expect(res).to.have.lengthOf.at.least(302); + return done(); + }); + }); + describe('TebakKimia', () => { + it('tebakkimia', done => { + tebakkimia().then(result => { + expect(result).to.an('object'); + expect(result.unsur).to.a('string'); + expect(result.lambang).to.a('string'); + return done(); + }).catch(done); + }); + it('tebakkimia JSON', done => { + const res = tebakkimiajson; + expect(res).to.an('array'); + expect(res).to.have.lengthOf.at.least(125); + return done(); + }); + }); + describe('Tekateki', () => { + it('tekateki', done => { + tekateki().then(result => { + expect(result).to.an('object'); + expect(result.soal).to.a('string'); + expect(result.jawaban).to.a('string'); + return done(); + }).catch(done); + }); + it('tekateki JSON', done => { + const res = tekatekijson; + expect(res).to.an('array'); + expect(res).to.have.lengthOf.at.least(200); + return done(); + }); + }); + describe('Siapakahaku', () => { + it('siapakahaku', done => { + siapakahaku().then(result => { + expect(result).to.an('object'); + expect(result.index).to.a('number'); + expect(result.soal).to.a('string'); + expect(result.jawaban).to.a('string'); + return done(); + }).catch(done); + }); + it('siapakahaku JSON', done => { + const res = siapakahakujson; + expect(res).to.an('array'); + expect(res).to.have.lengthOf.at.least(268); + return done(); + }); + }); + describe('Susunkata', () => { + it('susunkata', done => { + susunkata().then(result => { + expect(result).to.an('object'); + expect(result.index).to.a('number'); + expect(result.soal).to.a('string'); + expect(result.tipe).to.a('string'); + expect(result.jawaban).to.a('string'); + return done(); + }).catch(done); + }); + it('susunkata JSON', done => { + const res = susunkatajson; + expect(res).to.an('array'); + expect(res).to.have.lengthOf.at.least(353); + return done(); + }); + }); + describe('Tebakbendera', () => { + it('tebakbendera', done => { + tebakbendera().then(result => { + expect(result).to.an('object'); + expect(result.flag).to.a('string'); + expect(result.img).to.a('string'); + expect(result.name).to.a('string'); + return done(); + }).catch(done); + }); + it('tebakbendera JSON', done => { + const res = tebakbenderajson; + expect(res).to.an('array'); + expect(res).to.have.lengthOf.at.least(246); + return done(); + }); + }); + describe('Tebak Kabupaten', () => { + it('tebakkabupaten', done => { + tebakkabupaten().then(result => { + expect(result).to.an('object'); + expect(result.index).to.a('number'); + expect(result.title).to.a('string'); + expect(result.url).to.a('string'); + return done(); + }).catch(done); + }); + it('tebakkabupaten JSON', done => { + const res = tebakkabupatenjson; + expect(res).to.an('array'); + expect(res).to.have.lengthOf.at.least(514); + return done(); + }); + }); + describe('Tebak Lirik', () => { + it('tebaklirik', done => { + tebaklirik().then(result => { + expect(result).to.an('object'); + expect(result.soal).to.a('string'); + expect(result.jawaban).to.a('string'); + return done(); + }).catch(done); + }); + it('tebaklirik JSON', done => { + const res = tebaklirikjson; + expect(res).to.an('array'); + expect(res).to.have.lengthOf.at.least(38); + return done(); + }); + }); + describe('Tebak Tebakan', () => { + it('tebaktebakan', done => { + tebaktebakan().then(result => { + expect(result).to.an('object'); + expect(result.soal).to.a('string'); + expect(result.jawaban).to.a('string'); + return done(); + }).catch(done); + }); + it('tebaktebakan JSON', done => { + const res = tebaktebakanjson; + expect(res).to.an('array'); + expect(res).to.have.lengthOf.at.least(199); + return done(); + }); + }); +}); +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/esm/games/test.js.map b/node_modules/@bochilteam/scraper/lib/esm/games/test.js.map new file mode 100644 index 000000000..5a799b2f2 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/esm/games/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["../../../src/games/test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAA;AAC7B,OAAO,EACL,WAAW,EAAE,eAAe,EAC5B,QAAQ,EAAE,YAAY,EACtB,UAAU,EAAE,cAAc,EAC1B,SAAS,EAAE,aAAa,EACxB,SAAS,EAAE,aAAa,EACxB,UAAU,EAAE,cAAc,EAC1B,QAAQ,EAAE,YAAY,EACtB,WAAW,EAAE,eAAe,EAC5B,SAAS,EAAE,aAAa,EACxB,YAAY,EAAE,gBAAgB,EAC9B,UAAU,EAAE,cAAc,EAC1B,cAAc,EAAE,kBAAkB,EAClC,YAAY,EAAE,gBAAgB,EAC/B,MAAM,YAAY,CAAA;AACnB,QAAQ,CAAC,OAAO,EAAE,GAAG,EAAE;IACrB,QAAQ,CAAC,aAAa,EAAE,GAAG,EAAE;QAC3B,EAAE,CAAC,aAAa,EAAE,IAAI,CAAC,EAAE;YACvB,WAAW,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE;gBAC1B,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAA;gBAC9B,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,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.js new file mode 100644 index 000000000..718fd38ae --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/esm/games/types.js @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=types.js.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/esm/games/types.js.map b/node_modules/@bochilteam/scraper/lib/esm/games/types.js.map new file mode 100644 index 000000000..ef17d8f82 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/esm/games/types.js.map @@ -0,0 +1 @@ +{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/games/types.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/esm/images/google-image.js b/node_modules/@bochilteam/scraper/lib/esm/images/google-image.js new file mode 100644 index 000000000..6f9d4df34 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/esm/images/google-image.js @@ -0,0 +1,20 @@ +import cheerio from 'cheerio'; +import got from 'got'; +export default async function googleImage(query) { + const data = await got(`https://www.google.com/search?q=${query}&tbm=isch`, { + headers: { + accept: 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9', + 'accept-encoding': 'gzip, deflate, br', + 'accept-language': 'en-US,en;q=0.9,id;q=0.8', + 'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.93 Safari/537.36' + } + }).text(); + const $ = cheerio.load(data); + const pattern = /\[1,\[0,"(?[\d\w\-_]+)",\["https?:\/\/(?:[^"]+)",\d+,\d+\]\s?,\["(?https?:\/\/(?:[^"]+))",\d+,\d+\]/gm; + const matches = $.html().matchAll(pattern); + const decodeUrl = (url) => decodeURIComponent(JSON.parse(`"${url}"`)); + return [...matches] + .map(({ groups }) => decodeUrl(groups === null || groups === void 0 ? void 0 : groups.url)) + .filter((v) => /.*\.jpe?g|png$/gi.test(v)); +} +//# sourceMappingURL=google-image.js.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/esm/images/google-image.js.map b/node_modules/@bochilteam/scraper/lib/esm/images/google-image.js.map new file mode 100644 index 000000000..7147eb4fa --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/esm/images/google-image.js.map @@ -0,0 +1 @@ +{"version":3,"file":"google-image.js","sourceRoot":"","sources":["../../../src/images/google-image.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,SAAS,CAAA;AAC7B,OAAO,GAAG,MAAM,KAAK,CAAA;AAErB,MAAM,CAAC,OAAO,CAAC,KAAK,UAAU,WAAW,CAAE,KAAa;IACtD,MAAM,IAAI,GAAG,MAAM,GAAG,CAAC,mCAAmC,KAAK,WAAW,EAAE;QAC1E,OAAO,EAAE;YACP,MAAM,EACR,yIAAyI;YACvI,iBAAiB,EAAE,mBAAmB;YACtC,iBAAiB,EAAE,yBAAyB;YAC5C,YAAY,EACd,oHAAoH;SACnH;KACF,CAAC,CAAC,IAAI,EAAE,CAAA;IAET,MAAM,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IAC5B,MAAM,OAAO,GACb,gHAAgH,CAAA;IAChH,MAAM,OAAO,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAA;IAC1C,MAAM,SAAS,GAAG,CAAC,GAAW,EAAE,EAAE,CAAC,kBAAkB,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,GAAG,GAAG,CAAC,CAAC,CAAA;IAC7E,OAAO,CAAC,GAAG,OAAO,CAAC;SAChB,GAAG,CAAC,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,SAAS,CAAC,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,GAAa,CAAC,CAAC;SACrD,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAA;AAC9C,CAAC"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/esm/images/index.js b/node_modules/@bochilteam/scraper/lib/esm/images/index.js new file mode 100644 index 000000000..fe3456b7e --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/esm/images/index.js @@ -0,0 +1,6 @@ +import googleImage from './google-image.js'; +import pinterest from './pinterest.js'; +export * from './sticker.js'; +export * from './wallpaper.js'; +export { pinterest, googleImage }; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/esm/images/index.js.map b/node_modules/@bochilteam/scraper/lib/esm/images/index.js.map new file mode 100644 index 000000000..d95b9dbc7 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/esm/images/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/images/index.ts"],"names":[],"mappings":"AAAA,OAAO,WAAW,MAAM,mBAAmB,CAAA;AAC3C,OAAO,SAAS,MAAM,gBAAgB,CAAA;AACtC,cAAc,cAAc,CAAA;AAC5B,cAAc,gBAAgB,CAAA;AAC9B,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,CAAA"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/esm/images/pinterest.js b/node_modules/@bochilteam/scraper/lib/esm/images/pinterest.js new file mode 100644 index 000000000..b2fde5902 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/esm/images/pinterest.js @@ -0,0 +1,18 @@ +import cheerio from 'cheerio'; +import got from 'got'; +export default async function pinterest(query) { + const data = await got(`https://id.pinterest.com/search/pins/?autologin=true&q=${query}`, { + headers: { + 'sec-ch-ua': '"Google Chrome";v="95", "Chromium";v="95", ";Not A Brand";v="99"', + cookie: '_auth=1; _b="AVna7S1p7l1C5I9u0+nR3YzijpvXOPc6d09SyCzO+DcwpersQH36SmGiYfymBKhZcGg="; _pinterest_sess=TWc9PSZHamJOZ0JobUFiSEpSN3Z4a2NsMk9wZ3gxL1NSc2k2NkFLaUw5bVY5cXR5alZHR0gxY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NMTFlpMVErRGtPcllvTGdldz0=; _ir=0', + 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' + } + }).text(); + const results = []; + const $ = cheerio.load(data); + $('img').each(function () { + results.push($(this).attr('src')); + }); + return results; +} +//# sourceMappingURL=pinterest.js.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/esm/images/pinterest.js.map b/node_modules/@bochilteam/scraper/lib/esm/images/pinterest.js.map new file mode 100644 index 000000000..78e6cb3aa --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/esm/images/pinterest.js.map @@ -0,0 +1 @@ +{"version":3,"file":"pinterest.js","sourceRoot":"","sources":["../../../src/images/pinterest.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,SAAS,CAAA;AAC7B,OAAO,GAAG,MAAM,KAAK,CAAA;AAErB,MAAM,CAAC,OAAO,CAAC,KAAK,UAAU,SAAS,CAAE,KAAa;IACpD,MAAM,IAAI,GAAG,MAAM,GAAG,CACtB,0DAA0D,KAAK,EAAE,EACjE;QACE,OAAO,EAAE;YACP,WAAW,EACZ,kEAAkE;YACjE,MAAM,EACP,ivCAAivC;YAChvC,YAAY,EACb,oHAAoH;SACpH;KACF,CACA,CAAC,IAAI,EAAE,CAAA;IACR,MAAM,OAAO,GAAa,EAAE,CAAA;IAC5B,MAAM,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IAC5B,CAAC,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC;QACZ,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,KAAK,CAAW,CAAC,CAAA;IAC7C,CAAC,CAAC,CAAA;IACF,OAAO,OAAO,CAAA;AAChB,CAAC"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/esm/images/sticker.js b/node_modules/@bochilteam/scraper/lib/esm/images/sticker.js new file mode 100644 index 000000000..603186a19 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/esm/images/sticker.js @@ -0,0 +1,51 @@ +import cheerio from 'cheerio'; +import got from 'got'; +export async function stickerTelegram(query, page) { + const data = await got(`https://combot.org/telegram/stickers?q=${encodeURI(query)}&page=${page || 1}`).text(); + const $ = cheerio.load(data); + const results = []; + $('body > div > main > div.page > div > div.stickers-catalogue > div.tab-content > div > div').each(function () { + var _a; + const title = (_a = $(this).find('.sticker-pack__title').text()) === null || _a === void 0 ? void 0 : _a.trim(); + const icon = $(this) + .find('.sticker-pack__sticker > div.sticker-pack__sticker-inner > div.sticker-pack__sticker-img') + .attr('data-src'); + const link = $(this) + .find('.sticker-pack__header > a.sticker-pack__btn') + .attr('href'); + const stickers = []; + $(this) + .find('.sticker-pack__list > div.sticker-pack__sticker') + .each(function () { + const sticker = $(this) + .find('.sticker-pack__sticker-inner > div.sticker-pack__sticker-img') + .attr('data-src'); + if (sticker) + stickers.push(sticker); + }); + results.push({ + title, + icon, + link, + stickers + }); + }); + return results; +} +export async function stickerLine(query) { + const data = await got(`https://store.line.me/api/search/sticker?query=${query}&offset=0&limit=36&type=ALL&includeFacets=true`).json(); + return data.items.map(({ title, productUrl, id, description, payloadForProduct: { staticUrl, animationUrl, soundUrl }, authorId, authorName }) => { + return { + id, + title, + description, + url: encodeURI('https://store.line.me' + productUrl), + sticker: staticUrl, + stickerAnimated: animationUrl, + stickerSound: soundUrl, + authorId, + authorName + }; + }); +} +//# sourceMappingURL=sticker.js.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/esm/images/sticker.js.map b/node_modules/@bochilteam/scraper/lib/esm/images/sticker.js.map new file mode 100644 index 000000000..90244fcf9 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/esm/images/sticker.js.map @@ -0,0 +1 @@ +{"version":3,"file":"sticker.js","sourceRoot":"","sources":["../../../src/images/sticker.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,S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AAChB,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,WAAW,CAAE,KAAa;IAC9C,MAAM,IAAI,GAAqC,MAAM,GAAG,CACtD,kDAAkD,KAAK,gDAAgD,CACxG,CAAC,IAAI,EAAE,CAAA;IACR,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CACnB,CAAC,EACC,KAAK,EACL,UAAU,EACV,EAAE,EACF,WAAW,EACX,iBAAiB,EAAE,EAAE,SAAS,EAAE,YAAY,EAAE,QAAQ,EAAE,EACxD,QAAQ,EACR,UAAU,EACU,EAAE,EAAE;QACxB,OAAO;YACL,EAAE;YACF,KAAK;YACL,WAAW;YACX,GAAG,EAAE,SAAS,CAAC,uBAAuB,GAAG,UAAU,CAAC;YACpD,OAAO,EAAE,SAAS;YAClB,eAAe,EAAE,YAAY;YAC7B,YAAY,EAAE,QAAQ;YACtB,QAAQ;YACR,UAAU;SACX,CAAA;IACH,CAAC,CACF,CAAA;AACH,CAAC"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/esm/images/test.js b/node_modules/@bochilteam/scraper/lib/esm/images/test.js new file mode 100644 index 000000000..57b9bfb25 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/esm/images/test.js @@ -0,0 +1,56 @@ +import { expect } from 'chai'; +import { googleImage, pinterest, wallpaper, wallpaperv2, stickerLine, stickerTelegram } from './index.js'; +describe('Images', () => { + it('google-image', done => { + googleImage('Minecraft').then(res => { + expect(res).to.be.an('array'); + res.forEach(v => expect(v).to.be.a('string')); + return done(); + }).catch(done); + }); + it('pinterest', done => { + pinterest('Minecraft').then(res => { + expect(res).to.be.an('array'); + res.forEach(v => expect(v).to.be.a('string')); + return done(); + }).catch(done); + }); + describe('Wallpaper', () => { + it('wallpaper', done => { + wallpaper('Minecraft').then(res => { + expect(res).to.be.an('array'); + res.forEach(v => expect(v).to.be.a('string')); + return done(); + }).catch(done); + }); + it('wallpaper V2', done => { + wallpaperv2('Wallpaper Anime').then(res => { + expect(res).to.be.an('array'); + res.forEach(v => expect(v).to.be.a('string')); + return done(); + }).catch(done); + }); + // it ('Wallpaper V3', done => { + // wallpaperv3('Wallpaper HD').then(res => { + // expect(res).to.be.an('array') + // res.forEach(v => expect(v).to.be.a('string')) + // return done() + // }).catch(done) + // }) + }); + it('Sticker Telegram', done => { + stickerTelegram('Minecraft').then(res => { + expect(res).to.be.an('array'); + res.forEach(v => expect(v).to.be.an('object')); + return done(); + }).catch(done); + }); + it('Sticker Line', done => { + stickerLine('Anime').then(res => { + expect(res).to.be.an('array'); + res.forEach(v => expect(v).to.be.an('object')); + return done(); + }).catch(done); + }); +}); +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/esm/images/test.js.map b/node_modules/@bochilteam/scraper/lib/esm/images/test.js.map new file mode 100644 index 000000000..9077e2826 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/esm/images/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["../../../src/images/test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAA;AAC7B,OAAO,EACL,WAAW,EACX,SAAS,EACT,SAAS,EACT,WAAW,EAEX,WAAW,EACX,eAAe,EAChB,MAAM,YAAY,CAAA;AAEnB,QAAQ,CAAC,QAAQ,EAAE,GAAG,EAAE;IACtB,EAAE,CAAC,cAAc,EAAE,IAAI,CAAC,EAAE;QACxB,WAAW,CAAC,WAAW,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE;YAClC,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,OAAO,CAAC,CAAA;YAC7B,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAA;YAE7C,OAAO,IAAI,EAAE,CAAA;Q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EAAE,CAAA;QACf,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;IAChB,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/esm/images/types.js b/node_modules/@bochilteam/scraper/lib/esm/images/types.js new file mode 100644 index 000000000..718fd38ae --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/esm/images/types.js @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=types.js.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/esm/images/types.js.map b/node_modules/@bochilteam/scraper/lib/esm/images/types.js.map new file mode 100644 index 000000000..8e58f11a1 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/esm/images/types.js.map @@ -0,0 +1 @@ +{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/images/types.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/esm/images/wallpaper.js b/node_modules/@bochilteam/scraper/lib/esm/images/wallpaper.js new file mode 100644 index 000000000..c9a107116 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/esm/images/wallpaper.js @@ -0,0 +1,46 @@ +import cheerio from 'cheerio'; +import got from 'got'; +export async function wallpaper(query) { + const data = await got(`https://www.shutterstock.com/search/${query}`, { + headers: { + accept: 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9', + 'accept-encoding': 'gzip, deflate, br', + 'accept-language': 'en-US,en;q=0.9,id;q=0.8', + // cookie: '_csrf=DLixL776iH1Yv7Ck9wHekk24; _ga=GA1.2.1481444664.1639216586; _gid=GA1.2.348540858.1639216586; _gat=1; _hjFirstSeen=1; _hjSession_2571802=eyJpZCI6ImVkZDUzMWJhLWNjYTgtNDgyMy1hZmUyLWVjNmFhNWMxZjg3ZCIsImNyZWF0ZWQiOjE2MzkyMTY1ODY0Nzl9; _hjAbsoluteSessionInProgress=0; _hjSessionUser_2571802=eyJpZCI6IjIxZGNhYTc5LWRlMTgtNWE5Ni05ZWE2LTdkYjg4NGZhNjIxMSIsImNyZWF0ZWQiOjE2MzkyMTY1ODYyNDMsImV4aXN0aW5nIjp0cnVlfQ==', + 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' + } + }).text(); + const $ = cheerio.load(data); + const results = [ + ...new Set([ + ...$.html().matchAll(/https?:\/\/(image|www)\.shutterstock\.com\/([^"]+)/gim) + ] + .map((v) => v[0]) + .filter((v) => /.*\.jpe?g|png$/gi.test(v))) + ]; + return results; +} +export async function wallpaperv2(query, { page, is4K } = { page: 1 }) { + page = page < 2 ? 2 : page; + const data = await got(`https://wall.alphacoders.com/by_category.php?id=3&name=${encodeURIComponent(query).replace(/%20/g, '+')}&quickload=50&page=${page}${is4K ? '&filter=4K+Ultra+HD' : ''}`).text(); + const $ = cheerio.load(data); + const results = []; + $('div.thumb-container-big').each(function () { + const img = $(this).find('picture > img').attr('src'); + if (img) + results.push(img); + }); + return results; +} +export async function wallpaperv3(query, page = 1) { + const html = await got(`https://www.hdwallpapers.in/search/page/${page}?q=${encodeURIComponent(query)}`).text(); + const results = []; + const $ = cheerio.load(html); + $('#content > div.page-content.wallpaper > ul > li.wall').each(function () { + const img = $(this).find('a > img[src]').attr('src'); + if (img) + results.push('https://www.hdwallpapers.in' + img); + }); + return results; +} +//# sourceMappingURL=wallpaper.js.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/esm/images/wallpaper.js.map b/node_modules/@bochilteam/scraper/lib/esm/images/wallpaper.js.map new file mode 100644 index 000000000..40d6c6c98 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/esm/images/wallpaper.js.map @@ -0,0 +1 @@ +{"version":3,"file":"wallpaper.js","sourceRoot":"","sources":["../../../src/images/wallpaper.ts"],"names":[],"mappings":"AAA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,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IAC5B,MAAM,OAAO,GAAa,EAAE,CAAA;IAC5B,CAAC,CAAC,yBAAyB,CAAC,CAAC,IAAI,CAAC;QAChC,MAAM,GAAG,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;QACrD,IAAI,GAAG;YAAE,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;IAC5B,CAAC,CAAC,CAAA;IACF,OAAO,OAAO,CAAA;AAChB,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,WAAW,CAAE,KAAa,EAAE,OAAe,CAAC;IAChE,MAAM,IAAI,GAAG,MAAM,GAAG,CAAC,2CAA2C,IAAI,MAAM,kBAAkB,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,IAAI,EAAE,CAAA;IAC/G,MAAM,OAAO,GAAa,EAAE,CAAA;IAC5B,MAAM,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IAC5B,CAAC,CAAC,sDAAsD,CAAC,CAAC,IAAI,CAAC;QAC7D,MAAM,GAAG,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;QACpD,IAAI,GAAG;YAAE,OAAO,CAAC,IAAI,CAAC,6BAA6B,GAAG,GAAG,CAAC,CAAA;IAC5D,CAAC,CAAC,CAAA;IACF,OAAO,OAAO,CAAA;AAChB,CAAC"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/esm/index.js b/node_modules/@bochilteam/scraper/lib/esm/index.js new file mode 100644 index 000000000..10b0214c9 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/esm/index.js @@ -0,0 +1,10 @@ +export * from './images/index.js'; +export * from './social-media/index.js'; +export * from './games/index.js'; +export * from './primbons/index.js'; +export * from './texts/index.js'; +export * from './others/index.js'; +export * from './encryptions/index.js'; +export * from './religions/index.js'; +export * from './news/index.js'; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/esm/index.js.map b/node_modules/@bochilteam/scraper/lib/esm/index.js.map new file mode 100644 index 000000000..f5099dc9e --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/esm/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAA;AACjC,cAAc,yBAAyB,CAAA;AACvC,cAAc,kBAAkB,CAAA;AAChC,cAAc,qBAAqB,CAAA;AACnC,cAAc,kBAAkB,CAAA;AAChC,cAAc,mBAAmB,CAAA;AACjC,cAAc,wBAAwB,CAAA;AACtC,cAAc,sBAAsB,CAAA;AACpC,cAAc,iBAAiB,CAAA"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/esm/news/antaranews.js b/node_modules/@bochilteam/scraper/lib/esm/news/antaranews.js new file mode 100644 index 000000000..a09c569a9 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/esm/news/antaranews.js @@ -0,0 +1,30 @@ +import got from 'got'; +import cheerio from 'cheerio'; +export default async function antaranews() { + const html = await got('https://www.antaranews.com/').text(); + const $ = cheerio.load(html); + const results = []; + $('div.terkini > article.simple-post').each((_, el) => { + const $el = $(el); + const title = $el.find('.latest-news > a').text(); + const link = $el.find('.latest-news > a').attr('href'); + const $image = $el.find('picture'); + const image = $image.find('img').attr('src') || + $image.find('img').attr('data-src') || + $image.find('source').attr('srcset') || + $image.find('source').attr('data-srcset'); + const label = $el.find('.simple-share').text(); + const date = $el.find('.simple-share > span').text(); + if (title && image) { + results.push({ + title, + link, + image, + label: label.replace(date, '').replace('/', '').trim(), + date: date.trim() + }); + } + }); + return results; +} +//# sourceMappingURL=antaranews.js.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/esm/news/antaranews.js.map b/node_modules/@bochilteam/scraper/lib/esm/news/antaranews.js.map new file mode 100644 index 000000000..b8de2b1e3 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/esm/news/antaranews.js.map @@ -0,0 +1 @@ +{"version":3,"file":"antaranews.js","sourceRoot":"","sources":["../../../src/news/antaranews.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,KAAK,CAAA;AACrB,OAAO,OAAO,MAAM,SAAS,CAAA;AAG7B,MAAM,CAAC,OAAO,CAAC,KAAK,UAAU,UAAU;IACtC,MAAM,IAAI,GAAG,MAAM,GAAG,CAAC,6BAA6B,CAAC,CAAC,IAAI,EAAE,CAAA;IAC5D,MAAM,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IAC5B,MAAM,OAAO,GAAiB,EAAE,CAAA;IAChC,CAAC,CAAC,mCAAmC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE;QACpD,MAAM,GAAG,GAAG,CAAC,CAAC,EAAE,CAAC,CAAA;QACjB,MAAM,KAAK,GAAG,GAAG,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC,IAAI,EAAE,CAAA;QACjD,MAAM,IAAI,GAAG,GAAG,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC,IAAI,CAAC,MAAM,CAAW,CAAA;QAChE,MAAM,MAAM,GAAG,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,CAAA;QAClC,MAAM,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC;YAC1C,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC;YACnC,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC;YACpC,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,CAAA;QAC3C,MAAM,KAAK,GAAG,GAAG,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,IAAI,EAAE,CAAA;QAC9C,MAAM,IAAI,GAAG,GAAG,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAC,IAAI,EAAE,CAAA;QACpD,IAAI,KAAK,IAAI,KAAK,EAAE;YAClB,OAAO,CAAC,IAAI,CAAC;gBACX,KAAK;gBACL,IAAI;gBACJ,KAAK;gBACL,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE;gBACtD,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE;aAClB,CAAC,CAAA;SACH;IACH,CAAC,CAAC,CAAA;IACF,OAAO,OAAO,CAAA;AAChB,CAAC"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/esm/news/cnbcindonesia.js b/node_modules/@bochilteam/scraper/lib/esm/news/cnbcindonesia.js new file mode 100644 index 000000000..002c1277f --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/esm/news/cnbcindonesia.js @@ -0,0 +1,28 @@ +import got from 'got'; +import cheerio from 'cheerio'; +export default async function cnbindonesia() { + const html = await got('https://www.cnbcindonesia.com/news').text(); + const $ = cheerio.load(html); + const results = []; + $('body > div.container > div > ul.list > li').each((_, el) => { + const $el = $(el); + const title = $el.find('.box_text > h2').text(); + const subtitle = $el.find('.box_text > .subjudul').text() || undefined; + const link = $el.find('a').attr('href'); + const image = $el.find('span > img').attr('src'); + const label = $el.find('.date > .label').text(); + const date = $el.find('.date').text().replace(label, '').replace('-', '').trim(); + if (title && link) { + results.push({ + title, + subtitle, + link, + image, + label, + date + }); + } + }); + return results; +} +//# sourceMappingURL=cnbcindonesia.js.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/esm/news/cnbcindonesia.js.map b/node_modules/@bochilteam/scraper/lib/esm/news/cnbcindonesia.js.map new file mode 100644 index 000000000..a4b96376b --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/esm/news/cnbcindonesia.js.map @@ -0,0 +1 @@ +{"version":3,"file":"cnbcindonesia.js","sourceRoot":"","sources":["../../../src/news/cnbcindonesia.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,KAAK,CAAA;AACrB,OAAO,OAAO,MAAM,SAAS,CAAA;AAG7B,MAAM,CAAC,OAAO,CAAC,KAAK,UAAU,YAAY;IACxC,MAAM,IAAI,GAAG,MAAM,GAAG,CAAC,oCAAoC,CAAC,CAAC,IAAI,EAAE,CAAA;IACnE,MAAM,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IAC5B,MAAM,OAAO,GAAoB,EAAE,CAAA;IACnC,CAAC,CAAC,2CAA2C,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE;QAC5D,MAAM,GAAG,GAAG,CAAC,CAAC,EAAE,CAAC,CAAA;QACjB,MAAM,KAAK,GAAG,GAAG,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC,IAAI,EAAE,CAAA;QAC/C,MAAM,QAAQ,GAAG,GAAG,CAAC,IAAI,CAAC,uBAAuB,CAAC,CAAC,IAAI,EAAE,IAAI,SAAS,CAAA;QACtE,MAAM,IAAI,GAAG,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;QACvC,MAAM,KAAK,GAAG,GAAG,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,IAAI,CAAC,KAAK,CAAW,CAAA;QAC1D,MAAM,KAAK,GAAG,GAAG,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC,IAAI,EAAE,CAAA;QAC/C,MAAM,IAAI,GAAG,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,CAAA;QAChF,IAAI,KAAK,IAAI,IAAI,EAAE;YACjB,OAAO,CAAC,IAAI,CAAC;gBACX,KAAK;gBACL,QAAQ;gBACR,IAAI;gBACJ,KAAK;gBACL,KAAK;gBACL,IAAI;aACL,CAAC,CAAA;SACH;IACH,CAAC,CAAC,CAAA;IACF,OAAO,OAAO,CAAA;AAChB,CAAC"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/esm/news/index.js b/node_modules/@bochilteam/scraper/lib/esm/news/index.js new file mode 100644 index 000000000..c10cc3e6b --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/esm/news/index.js @@ -0,0 +1,8 @@ +import cnbindonesia from './cnbcindonesia.js'; +import antaranews from './antaranews.js'; +import kompas from './kompas.js'; +import suaracom from './suaracom.js'; +import liputan6 from './liputan6.js'; +import merdeka from './merdeka.js'; +export { cnbindonesia, antaranews, kompas, suaracom, liputan6, merdeka }; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/esm/news/index.js.map b/node_modules/@bochilteam/scraper/lib/esm/news/index.js.map new file mode 100644 index 000000000..4699a8206 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/esm/news/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/news/index.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,MAAM,oBAAoB,CAAA;AAC7C,OAAO,UAAU,MAAM,iBAAiB,CAAA;AACxC,OAAO,MAAM,MAAM,aAAa,CAAA;AAChC,OAAO,QAAQ,MAAM,eAAe,CAAA;AACpC,OAAO,QAAQ,MAAM,eAAe,CAAA;AACpC,OAAO,OAAO,MAAM,cAAc,CAAA;AAElC,OAAO,EACL,YAAY,EACZ,UAAU,EACV,MAAM,EACN,QAAQ,EACR,QAAQ,EACR,OAAO,EACR,CAAA"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/esm/news/kompas.js b/node_modules/@bochilteam/scraper/lib/esm/news/kompas.js new file mode 100644 index 000000000..b280dd97c --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/esm/news/kompas.js @@ -0,0 +1,29 @@ +import got from 'got'; +import cheerio from 'cheerio'; +export default async function kompas() { + const html = await got('https://www.kompas.com/').text(); + const $ = cheerio.load(html); + const result = []; + $('div.latest.ga--latest').each((_, el) => { + $(el).find('div.article__list').each((_, el) => { + const $el = $(el); + const title = $el.find('h3 > a.article__link').text(); + const link = $el.find('h3 > a.article__link').attr('href'); + const $image = $el.find('.article__asset > a > img'); + const image = ($image.attr('src') || $image.attr('data-src')); + const label = $el.find('.article__list__info > .article__subtitle').text(); + const date = $el.find('.article__list__info > .article__date').text(); + if (title && link) { + result.push({ + title, + link, + image, + label, + date + }); + } + }); + }); + return result; +} +//# sourceMappingURL=kompas.js.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/esm/news/kompas.js.map b/node_modules/@bochilteam/scraper/lib/esm/news/kompas.js.map new file mode 100644 index 000000000..b199c7834 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/esm/news/kompas.js.map @@ -0,0 +1 @@ +{"version":3,"file":"kompas.js","sourceRoot":"","sources":["../../../src/news/kompas.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,KAAK,CAAA;AACrB,OAAO,OAAO,MAAM,SAAS,CAAA;AAG7B,MAAM,CAAC,OAAO,CAAC,KAAK,UAAU,MAAM;IAClC,MAAM,IAAI,GAAG,MAAM,GAAG,CAAC,yBAAyB,CAAC,CAAC,IAAI,EAAE,CAAA;IACxD,MAAM,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IAC5B,MAAM,MAAM,GAAa,EAAE,CAAA;IAC3B,CAAC,CAAC,uBAAuB,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE;QACxC,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE;YAC7C,MAAM,GAAG,GAAG,CAAC,CAAC,EAAE,CAAC,CAAA;YACjB,MAAM,KAAK,GAAG,GAAG,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAC,IAAI,EAAE,CAAA;YACrD,MAAM,IAAI,GAAG,GAAG,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;YAC1D,MAAM,MAAM,GAAG,GAAG,CAAC,IAAI,CAAC,2BAA2B,CAAC,CAAA;YACpD,MAAM,KAAK,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,CAAW,CAAA;YACvE,MAAM,KAAK,GAAG,GAAG,CAAC,IAAI,CAAC,2CAA2C,CAAC,CAAC,IAAI,EAAE,CAAA;YAC1E,MAAM,IAAI,GAAG,GAAG,CAAC,IAAI,CAAC,uCAAuC,CAAC,CAAC,IAAI,EAAE,CAAA;YACrE,IAAI,KAAK,IAAI,IAAI,EAAE;gBACjB,MAAM,CAAC,IAAI,CAAC;oBACV,KAAK;oBACL,IAAI;oBACJ,KAAK;oBACL,KAAK;oBACL,IAAI;iBACL,CAAC,CAAA;aACH;QACH,CAAC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;IACF,OAAO,MAAM,CAAA;AACf,CAAC"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/esm/news/liputan6.js b/node_modules/@bochilteam/scraper/lib/esm/news/liputan6.js new file mode 100644 index 000000000..49314c2f6 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/esm/news/liputan6.js @@ -0,0 +1,32 @@ +import got from 'got'; +import cheerio from 'cheerio'; +export default async function liputan6() { + const html = await got('https://www.liputan6.com/').text(); + const $ = cheerio.load(html); + const results = []; + $('div.articles > div.articles--iridescent-list').each((i, el) => { + $(el).find('article.articles--iridescent-list--item').each((i, el) => { + const $el = $(el); + const title = $el.find('span.articles--iridescent-list--text-item__title-link-text').text(); + const link = $el.find('a.ui--a[data-template-var="url"]').attr('href'); + const description = $el.find('div.articles--iridescent-list--text-item__summary').text(); + const $image = $el.find('picture.articles--iridescent-list--text-item__figure-image > img'); + const image = ($image.attr('src') || $image.attr('data-src') || $image.attr('data-high-dpi')); + const label = $el.find('a.articles--iridescent-list--text-item__category').text(); + const $date = $el.find('time.articles--iridescent-list--text-item__time'); + const date = $date.attr('datetime') || $date.attr('title') || $date.text(); + if (title && link) { + results.push({ + title, + link, + image, + description, + label, + date + }); + } + }); + }); + return results; +} +//# sourceMappingURL=liputan6.js.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/esm/news/liputan6.js.map b/node_modules/@bochilteam/scraper/lib/esm/news/liputan6.js.map new file mode 100644 index 000000000..12994cc85 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/esm/news/liputan6.js.map @@ -0,0 +1 @@ +{"version":3,"file":"liputan6.js","sourceRoot":"","sources":["../../../src/news/liputan6.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,KAAK,CAAA;AACrB,OAAO,OAAO,MAAM,SAAS,CAAA;AAG7B,MAAM,CAAC,OAAO,CAAC,KAAK,UAAU,QAAQ;IACpC,MAAM,IAAI,GAAG,MAAM,GAAG,CAAC,2BAA2B,CAAC,CAAC,IAAI,EAAE,CAAA;IAC1D,MAAM,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IAC5B,MAAM,OAAO,GAAe,EAAE,CAAA;IAC9B,CAAC,CAAC,8CAA8C,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE;QAC/D,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,yCAAyC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE;YACnE,MAAM,GAAG,GAAG,CAAC,CAAC,EAAE,CAAC,CAAA;YACjB,MAAM,KAAK,GAAG,GAAG,CAAC,IAAI,CAAC,4DAA4D,CAAC,CAAC,IAAI,EAAE,CAAA;YAC3F,MAAM,IAAI,GAAG,GAAG,CAAC,IAAI,CAAC,kCAAkC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;YACtE,MAAM,WAAW,GAAG,GAAG,CAAC,IAAI,CAAC,mDAAmD,CAAC,CAAC,IAAI,EAAE,CAAA;YACxF,MAAM,MAAM,GAAG,GAAG,CAAC,IAAI,CAAC,kEAAkE,CAAC,CAAA;YAC3F,MAAM,KAAK,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,IAAI,MAAM,CAAC,IAAI,CAAC,eAAe,CAAC,CAAW,CAAA;YACvG,MAAM,KAAK,GAAG,GAAG,CAAC,IAAI,CAAC,kDAAkD,CAAC,CAAC,IAAI,EAAE,CAAA;YACjF,MAAM,KAAK,GAAG,GAAG,CAAC,IAAI,CAAC,iDAAiD,CAAC,CAAA;YACzE,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,KAAK,CAAC,IAAI,EAAE,CAAA;YAC1E,IAAI,KAAK,IAAI,IAAI,EAAE;gBACjB,OAAO,CAAC,IAAI,CAAC;oBACX,KAAK;oBACL,IAAI;oBACJ,KAAK;oBACL,WAAW;oBACX,KAAK;oBACL,IAAI;iBACL,CAAC,CAAA;aACH;QACH,CAAC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;IACF,OAAO,OAAO,CAAA;AAChB,CAAC"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/esm/news/merdeka.js b/node_modules/@bochilteam/scraper/lib/esm/news/merdeka.js new file mode 100644 index 000000000..0753446e8 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/esm/news/merdeka.js @@ -0,0 +1,26 @@ +import got from 'got'; +import cheerio from 'cheerio'; +export default async function merdeka() { + const html = await got('https://www.merdeka.com/berita-hari-ini/').text(); + const $ = cheerio.load(html); + const results = []; + $('div.main_photo_center > div.mdk-tag-contg').each((_, el) => { + const $el = $(el); + const title = $el.find('div.mdk-tag-contln-l > a[title]').attr('title'); + const link = $el.find('div.mdk-tag-contln-l > a[title]').attr('href'); + const image = $el.find('div.mdk-tag-contln-l > a[title] > img').attr('src'); + const label = $el.find('div.mdk-tag-contln-date > span').text(); + const date = $el.find('div.mdk-tag-contln-date').text(); + if (title) { + results.push({ + title, + link: 'https://www.merdeka.com' + link, + image, + label, + date: date.replace(label, '').replace('Sekitar', '').trim() + }); + } + }); + return results; +} +//# sourceMappingURL=merdeka.js.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/esm/news/merdeka.js.map b/node_modules/@bochilteam/scraper/lib/esm/news/merdeka.js.map new file mode 100644 index 000000000..983183e31 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/esm/news/merdeka.js.map @@ -0,0 +1 @@ +{"version":3,"file":"merdeka.js","sourceRoot":"","sources":["../../../src/news/merdeka.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,KAAK,CAAA;AACrB,OAAO,OAAO,MAAM,SAAS,CAAA;AAG7B,MAAM,CAAC,OAAO,CAAC,KAAK,UAAU,OAAO;IACnC,MAAM,IAAI,GAAG,MAAM,GAAG,CAAC,0CAA0C,CAAC,CAAC,IAAI,EAAE,CAAA;IACzE,MAAM,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IAC5B,MAAM,OAAO,GAAc,EAAE,CAAA;IAC7B,CAAC,CAAC,2CAA2C,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE;QAC5D,MAAM,GAAG,GAAG,CAAC,CAAC,EAAE,CAAC,CAAA;QACjB,MAAM,KAAK,GAAG,GAAG,CAAC,IAAI,CAAC,iCAAiC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;QACvE,MAAM,IAAI,GAAG,GAAG,CAAC,IAAI,CAAC,iCAAiC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;QACrE,MAAM,KAAK,GAAG,GAAG,CAAC,IAAI,CAAC,uCAAuC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAW,CAAA;QACrF,MAAM,KAAK,GAAG,GAAG,CAAC,IAAI,CAAC,gCAAgC,CAAC,CAAC,IAAI,EAAE,CAAA;QAC/D,MAAM,IAAI,GAAG,GAAG,CAAC,IAAI,CAAC,yBAAyB,CAAC,CAAC,IAAI,EAAE,CAAA;QACvD,IAAI,KAAK,EAAE;YACT,OAAO,CAAC,IAAI,CAAC;gBACX,KAAK;gBACL,IAAI,EAAE,yBAAyB,GAAG,IAAI;gBACtC,KAAK;gBACL,KAAK;gBACL,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE;aAC5D,CAAC,CAAA;SACH;IACH,CAAC,CAAC,CAAA;IACF,OAAO,OAAO,CAAA;AAChB,CAAC"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/esm/news/suaracom.js b/node_modules/@bochilteam/scraper/lib/esm/news/suaracom.js new file mode 100644 index 000000000..95e0e2ff2 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/esm/news/suaracom.js @@ -0,0 +1,26 @@ +import got from 'got'; +import cheerio from 'cheerio'; +export default async function suaracom() { + const html = await got('https://www.suara.com/news').text(); + const $ = cheerio.load(html); + const results = []; + $('div.widget-content > ul.list-unstyled > li.item-outer').each((_, el) => { + const $el = $(el); + const title = $el.find('h4.post-title > a.ellipsis2').text(); + const link = $el.find('h4.post-title > a.ellipsis2').attr('href'); + const description = $el.find('div.item-content > p.ellipsis2').text(); + const image = $el.find('div.post-thumb > a > img').attr('src'); + const date = $el.find('.suara-date-box > span').map((i, el) => $(el).text()).get().join(' '); + if (title && link) { + results.push({ + title, + link, + image, + description, + date + }); + } + }); + return results; +} +//# sourceMappingURL=suaracom.js.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/esm/news/suaracom.js.map b/node_modules/@bochilteam/scraper/lib/esm/news/suaracom.js.map new file mode 100644 index 000000000..ace9e5098 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/esm/news/suaracom.js.map @@ -0,0 +1 @@ +{"version":3,"file":"suaracom.js","sourceRoot":"","sources":["../../../src/news/suaracom.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,KAAK,CAAA;AACrB,OAAO,OAAO,MAAM,SAAS,CAAA;AAG7B,MAAM,CAAC,OAAO,CAAC,KAAK,UAAU,QAAQ;IACpC,MAAM,IAAI,GAAG,MAAM,GAAG,CAAC,4BAA4B,CAAC,CAAC,IAAI,EAAE,CAAA;IAC3D,MAAM,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IAC5B,MAAM,OAAO,GAAe,EAAE,CAAA;IAC9B,CAAC,CAAC,uDAAuD,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE;QACxE,MAAM,GAAG,GAAG,CAAC,CAAC,EAAE,CAAC,CAAA;QACjB,MAAM,KAAK,GAAG,GAAG,CAAC,IAAI,CAAC,6BAA6B,CAAC,CAAC,IAAI,EAAE,CAAA;QAC5D,MAAM,IAAI,GAAG,GAAG,CAAC,IAAI,CAAC,6BAA6B,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;QACjE,MAAM,WAAW,GAAG,GAAG,CAAC,IAAI,CAAC,gCAAgC,CAAC,CAAC,IAAI,EAAE,CAAA;QACrE,MAAM,KAAK,GAAG,GAAG,CAAC,IAAI,CAAC,0BAA0B,CAAC,CAAC,IAAI,CAAC,KAAK,CAAW,CAAA;QACxE,MAAM,IAAI,GAAG,GAAG,CAAC,IAAI,CAAC,wBAAwB,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;QAC5F,IAAI,KAAK,IAAI,IAAI,EAAE;YACjB,OAAO,CAAC,IAAI,CAAC;gBACX,KAAK;gBACL,IAAI;gBACJ,KAAK;gBACL,WAAW;gBACX,IAAI;aACL,CAAC,CAAA;SACH;IACH,CAAC,CAAC,CAAA;IACF,OAAO,OAAO,CAAA;AAChB,CAAC"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/esm/news/test.js b/node_modules/@bochilteam/scraper/lib/esm/news/test.js new file mode 100644 index 000000000..e936b536b --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/esm/news/test.js @@ -0,0 +1,86 @@ +import { expect } from 'chai'; +import { cnbindonesia, antaranews, kompas, suaracom, liputan6, merdeka } from './index.js'; +describe('News', () => { + it('CNB indonesia', (done) => { + cnbindonesia().then(data => { + expect(data).to.be.an('array'); + expect(data).to.have.length.at.least(1); + data.forEach(({ title, link, image, label, date }) => { + expect(title).to.be.a('string'); + expect(link).to.be.a('string'); + expect(image).to.be.a('string'); + expect(label).to.be.a('string'); + expect(date).to.be.a('string'); + }); + return done(); + }).catch(done); + }); + it('antaranews', (done) => { + antaranews().then(data => { + expect(data).to.be.an('array'); + expect(data).to.have.length.at.least(1); + data.forEach(({ title, link, image, label, date }) => { + expect(title).to.be.a('string'); + expect(link).to.be.a('string'); + expect(image).to.be.a('string'); + expect(label).to.be.a('string'); + expect(date).to.be.a('string'); + }); + return done(); + }).catch(done); + }); + it('kompas', (done) => { + kompas().then(data => { + expect(data).to.be.an('array'); + data.forEach(({ title, link, image, label, date }) => { + expect(title).to.be.a('string'); + expect(link).to.be.a('string'); + expect(image).to.be.a('string'); + expect(label).to.be.a('string'); + expect(date).to.be.a('string'); + }); + return done(); + }).catch(done); + }); + it('Suara.com', (done) => { + suaracom().then(data => { + expect(data).to.be.an('array'); + data.forEach(({ title, link, image, description, date }) => { + expect(title).to.be.a('string'); + expect(link).to.be.a('string'); + expect(image).to.be.a('string'); + expect(description).to.be.a('string'); + expect(date).to.be.a('string'); + }); + return done(); + }).catch(done); + }); + it('Liputan6', (done) => { + liputan6().then(data => { + expect(data).to.be.an('array'); + data.forEach(({ title, link, image, description, label, date }) => { + expect(title).to.be.a('string'); + expect(link).to.be.a('string'); + expect(image).to.be.a('string'); + expect(description).to.be.a('string'); + expect(label).to.be.a('string'); + expect(date).to.be.a('string'); + }); + return done(); + }).catch(done); + }); + it('Merdeka', (done) => { + merdeka().then(data => { + expect(data).to.be.an('array'); + data.forEach(({ title, link, image, label, date }) => { + expect(title).to.be.a('string'); + expect(link).to.be.a('string'); + expect(image).to.be.a('string'); + expect(label).to.be.a('string'); + expect(date).to.be.a('string'); + }); + return done(); + }).catch(done); + }); +}); +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/esm/news/test.js.map b/node_modules/@bochilteam/scraper/lib/esm/news/test.js.map new file mode 100644 index 000000000..6c632f37e --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/esm/news/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["../../../src/news/test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAA;AAC7B,OAAO,EACL,YAAY,EACZ,UAAU,EACV,MAAM,EACN,QAAQ,EACR,QAAQ,EACR,OAAO,EACR,MAAM,YAAY,CAAA;AAEnB,QAAQ,CAAC,MAAM,EAAE,GAAG,EAAE;IACpB,EAAE,CAAC,eAAe,EAAE,CAAC,IAAI,EAAE,EAAE;QAC3B,YAAY,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;YACzB,MAA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AAC,OAAO,CAAC,CAAA;YAC9B,IAAI,CAAC,OAAO,CAAC,CAAC,EACZ,KAAK,EACL,IAAI,EACJ,KAAK,EACL,KAAK,EACL,IAAI,EACL,EAAE,EAAE;gBACH,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAA;gBAC/B,MAAM,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAA;gBAC9B,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAA;gBAC/B,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAA;gBAC/B,MAAM,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAA;YAChC,CAAC,CAAC,CAAA;YAEF,OAAO,IAAI,EAAE,CAAA;QACf,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;IAChB,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/esm/news/types.js b/node_modules/@bochilteam/scraper/lib/esm/news/types.js new file mode 100644 index 000000000..718fd38ae --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/esm/news/types.js @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=types.js.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/esm/news/types.js.map b/node_modules/@bochilteam/scraper/lib/esm/news/types.js.map new file mode 100644 index 000000000..50d734496 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/esm/news/types.js.map @@ -0,0 +1 @@ +{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/news/types.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/esm/others/BMKG.js b/node_modules/@bochilteam/scraper/lib/esm/others/BMKG.js new file mode 100644 index 000000000..80f832b41 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/esm/others/BMKG.js @@ -0,0 +1,72 @@ +import got from 'got'; +import cheerio from 'cheerio'; +export async function gempa() { + const html = await got('https://www.bmkg.go.id/gempabumi/gempabumi-dirasakan.bmkg').text(); + const $ = cheerio.load(html); + const results = []; + $('div.table-responsive > table.table > tbody > tr').each(function () { + const el = $(this).find('td'); + const date = el.eq(1).text().trim(); + const locate = el.eq(2).text().trim(); + const magnitude = el.eq(3).text().trim(); + const depth = el.eq(4).text().trim(); + const location = el.eq(5).find('a').text().trim(); + const warning = el.eq(5).find('span.label').map(function () { + return $(this).text().trim(); + }).toArray(); + results.push({ + date, + locate, + magnitude, + depth, + location, + warning + }); + }); + return results; +} +export async function gempaNow() { + const html = await got('https://www.bmkg.go.id/gempabumi/gempabumi-terkini.bmkg').text(); + const $ = cheerio.load(html); + const results = []; + $('div.table-responsive > table.table > tbody > tr').each(function () { + const el = $(this).find('td'); + const date = el.eq(1).text().trim(); + const latitude = el.eq(2).text().trim(); + const longitude = el.eq(3).text().trim(); + const magnitude = el.eq(4).text().trim(); + const depth = el.eq(5).text().trim(); + const location = el.eq(6).text().trim(); + results.push({ + date, + latitude, + longitude, + magnitude, + depth, + location + }); + }); + return results; +} +export async function tsunami() { + const html = await got('https://www.bmkg.go.id/tsunami/').text(); + const $ = cheerio.load(html); + const results = []; + $('div.row > div > table.table > tbody > tr').each(function () { + const el = $(this).find('td'); + const date = el.eq(0).text().trim(); + const locate = el.eq(1).text().trim(); + const magnitude = el.eq(2).text().trim(); + const depth = el.eq(3).text().trim(); + const location = el.eq(4).text().trim(); + results.push({ + date, + locate, + magnitude, + depth, + location + }); + }); + return results; +} +//# sourceMappingURL=BMKG.js.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/esm/others/BMKG.js.map b/node_modules/@bochilteam/scraper/lib/esm/others/BMKG.js.map new file mode 100644 index 000000000..2f87cfa47 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/esm/others/BMKG.js.map @@ -0,0 +1 @@ +{"version":3,"file":"BMKG.js","sourceRoot":"","sources":["../../../src/others/BMKG.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,KAAK,CAAA;AACrB,OAAO,OAAO,MAAM,SAAS,CAAA;AAO7B,MAAM,CAAC,KAAK,UAAU,KAAK;IACzB,MAAM,IAAI,GAAG,MAAM,GAAG,CAAC,2DAA2D,CAAC,CAAC,IAAI,EAAE,CAAA;IAC1F,MAAM,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IAC5B,MAAM,OAAO,GAAY,EAAE,CAAA;IAC3B,CAAC,CAAC,iDAAiD,CAAC,CAAC,IAAI,CAAC;QACxD,MAAM,EAAE,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;QAC7B,MAAM,IAAI,GAAG,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,IAAI,EAAE,CAAA;QACnC,MAAM,MAAM,GAAG,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,IAAI,EAAE,CAAA;QACrC,MAAM,SAAS,GAAG,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,IAAI,EAAE,CAAA;QACxC,MAAM,KAAK,GAAG,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,IAAI,EAAE,CAAA;QACpC,MAAM,QAAQ,GAAG,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,IAAI,EAAE,CAAA;QACjD,MAAM,OAAO,GAAG,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,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C,CAAC,CAAA;IACF,OAAO,OAAO,CAAA;AAChB,CAAC"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/esm/others/KBBI.js b/node_modules/@bochilteam/scraper/lib/esm/others/KBBI.js new file mode 100644 index 000000000..adb52f463 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/esm/others/KBBI.js @@ -0,0 +1,47 @@ +import got from 'got'; +import cheerio from 'cheerio'; +import { ScraperError } from '../utils.js'; +/** + * p = Partikel: kelas kata yang meliputi kata depan, kata sambung, kata seru, kata sandang, ucapan salam + * + * n = Nomina: kata benda + */ +export default async function kbbi(words) { + const html = await got(`https://kbbi.kemdikbud.go.id/entri/${encodeURIComponent(words)}`).text(); + const $ = cheerio.load(html); + const isExist = !/tidak ditemukan/i.test($('body > div.container.body-content > h4[style="color:red"]').text()); + if (!isExist) + throw new ScraperError(`${words} does not exist!`); + const results = []; + let isContent = false; + let lastTitle; + $('body > div.container.body-content').children().each((_, el) => { + const tag = el.tagName; + const elem = $(el); + if (tag === 'hr') + isContent = !isContent && !Object.keys(results).length; + if (tag === 'h2' && isContent) { + const index = elem.find('sup').text().trim(); + const title = elem.text().trim(); + results.push({ + index: parseInt(index), + title, + means: [] + }); + lastTitle = title; + } + if ((tag === 'ol' || tag === 'ul') && isContent && lastTitle) { + elem.find('li').each((_, el) => { + const li = $(el).text().trim(); + const index = results.findIndex(({ title }) => title === lastTitle); + if (index !== -1) + results[index].means.push(li); + else + console.log(li, lastTitle); + }); + lastTitle = ''; + } + }); + return results; +} +//# sourceMappingURL=KBBI.js.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/esm/others/KBBI.js.map b/node_modules/@bochilteam/scraper/lib/esm/others/KBBI.js.map new file mode 100644 index 000000000..62276aea9 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/esm/others/KBBI.js.map @@ -0,0 +1 @@ +{"version":3,"file":"KBBI.js","sourceRoot":"","sources":["../../../src/others/KBBI.ts"],"names":[],"mappings":"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CAAA;YAChC,OAAO,CAAC,IAAI,CAAC;gBACX,KAAK,EAAE,QAAQ,CAAC,KAAK,CAAC;gBACtB,KAAK;gBACL,KAAK,EAAE,EAAE;aACV,CAAC,CAAA;YACF,SAAS,GAAG,KAAK,CAAA;SAClB;QACD,IAAI,CAAC,GAAG,KAAK,IAAI,IAAI,GAAG,KAAK,IAAI,CAAC,IAAI,SAAS,IAAI,SAAS,EAAE;YAC5D,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE;gBAC7B,MAAM,EAAE,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,IAAI,EAAE,CAAA;gBAC9B,MAAM,KAAK,GAAG,OAAO,CAAC,SAAS,CAC7B,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,KAAK,KAAK,SAAS,CACnC,CAAA;gBACD,IAAI,KAAK,KAAK,CAAC,CAAC;oBAAE,OAAO,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;;oBAC1C,OAAO,CAAC,GAAG,CAAC,EAAE,EAAE,SAAS,CAAC,CAAA;YACjC,CAAC,CAAC,CAAA;YACF,SAAS,GAAG,EAAE,CAAA;SACf;IACH,CAAC,CAAC,CAAA;IACF,OAAO,OAAO,CAAA;AAChB,CAAC"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/esm/others/bioskop.js b/node_modules/@bochilteam/scraper/lib/esm/others/bioskop.js new file mode 100644 index 000000000..f96fc2dfc --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/esm/others/bioskop.js @@ -0,0 +1,75 @@ +import got from 'got'; +import cheerio from 'cheerio'; +export async function bioskopNow() { + const url = 'https://jadwalnonton.com/now-playing/'; + const response = await got(url, { + headers: { + Accept: 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9', + Host: 'jadwalnonton.com', + Referer: 'https://jadwalnonton.com/now-playing/', + 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.102 Safari/537.36' + } + }).text(); + const results = []; + const $ = cheerio.load(response); + $('div.row > div.item.movie').each((_, el) => { + const $el = $(el); + const title = $el.find('h2 > a').text(); + const img = $el.find('img.poster').attr('src'); + const url = $el.find('a.mojadwal').attr('href'); + const $span = $el.find('div > span.moket'); + const genre = $span.eq(0).text(); + const duration = $span.eq(1).text(); + const playingAt = ($el.find('div > i.icon').attr('class') || '').replace(/icon/, '').trim(); + if (title && url) { + results.push({ + title, + img, + url, + genre, + duration, + playingAt + }); + } + }); + return results; +} +export async function bioskop(page = 1) { + page = Math.min(4, Math.max(1, parseInt(page))); + const response = await got(`https://jadwalnonton.com/comingsoon/?page=${page}`, { + headers: { + Accept: 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9', + Host: 'jadwalnonton.com', + Referer: 'https://jadwalnonton.com/comingsoon/', + 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.102 Safari/537.36' + } + }).text(); + const results = []; + const $ = cheerio.load(response); + $('div.row > div.item.movie').each((_, el) => { + const $el = $(el); + const title = $el.find('h2 > a').text(); + const img = $el.find('img.poster').attr('src'); + const url = $el.find('a.mojadwal').attr('href'); + const $span = $el.find('div.rowl > div > span'); + const genre = $span.eq(0).text(); + const duration = $span.eq(1).text(); + const release = $span.eq(2).text(); + const director = $span.eq(4).text(); + const cast = $span.eq(6).text(); + if (title && url) { + results.push({ + title, + img, + url, + genre, + duration, + release, + director, + cast + }); + } + }); + return results; +} +//# sourceMappingURL=bioskop.js.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/esm/others/bioskop.js.map b/node_modules/@bochilteam/scraper/lib/esm/others/bioskop.js.map new file mode 100644 index 000000000..347985391 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/esm/others/bioskop.js.map @@ -0,0 +1 @@ +{"version":3,"file":"bioskop.js","sourceRoot":"","sources":["../../../src/others/bioskop.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,KAAK,CAAA;AACrB,OAAO,OAAO,MAAM,SAAS,CAAA;AAG7B,MAAM,CAAC,KAAK,UAAU,UAAU;IAC9B,MAAM,GAAG,GAAG,uCAAuC,CAAA;IACnD,MAAM,QAAQ,GAAG,MAAM,GAAG,CAAC,GAAG,EAAE;QAC9B,OAAO,EAAE;YACP,MAAM,EAAE,yIAAyI;YACjJ,IAAI,EAAE,kBAAkB;YACxB,OAAO,EAAE,uCAAuC;YAChD,YAAY,EAAE,qHAAqH;SACpI;KACF,CAAC,CAAC,IAAI,EAAE,CAAA;IACT,MAAM,OAAO,GAAiB,EAAE,CAAA;IAChC,MAAM,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;IAChC,CAAC,CAAC,0BAA0B,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE;QAC3C,MAAM,GAAG,GAAG,CAAC,CAAC,EAAE,CAAC,CAAA;QACjB,MAAM,KAAK,GAAG,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,IAAI,EAAE,CAAA;QACvC,MAAM,GAAG,GAAG,GAAG,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,IAAI,CAAC,KAAK,CAAW,CAAA;QACxD,MAAM,GAAG,GAAG,GAAG,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;QAC/C,MAAM,KAAK,GAAG,GAAG,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAA;QAC1C,MAAM,KAAK,GAAG,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC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C,CAAC,IAAI,EAAE,CAAA;QACvC,MAAM,GAAG,GAAG,GAAG,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,IAAI,CAAC,KAAK,CAAW,CAAA;QACxD,MAAM,GAAG,GAAG,GAAG,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;QAC/C,MAAM,KAAK,GAAG,GAAG,CAAC,IAAI,CAAC,uBAAuB,CAAC,CAAA;QAC/C,MAAM,KAAK,GAAG,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAA;QAChC,MAAM,QAAQ,GAAG,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAA;QACnC,MAAM,OAAO,GAAG,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAA;QAClC,MAAM,QAAQ,GAAG,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAA;QACnC,MAAM,IAAI,GAAG,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAA;QAC/B,IAAI,KAAK,IAAI,GAAG,EAAE;YAChB,OAAO,CAAC,IAAI,CAAC;gBACX,KAAK;gBACL,GAAG;gBACH,GAAG;gBACH,KAAK;gBACL,QAAQ;gBACR,OAAO;gBACP,QAAQ;gBACR,IAAI;aACL,CAAC,CAAA;SACH;IACH,CAAC,CAAC,CAAA;IACF,OAAO,OAAO,CAAA;AAChB,CAAC"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/esm/others/cek-resi.js b/node_modules/@bochilteam/scraper/lib/esm/others/cek-resi.js new file mode 100644 index 000000000..1ea18ccad --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/esm/others/cek-resi.js @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=cek-resi.js.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/esm/others/cek-resi.js.map b/node_modules/@bochilteam/scraper/lib/esm/others/cek-resi.js.map new file mode 100644 index 000000000..1227a41dd --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/esm/others/cek-resi.js.map @@ -0,0 +1 @@ +{"version":3,"file":"cek-resi.js","sourceRoot":"","sources":["../../../src/others/cek-resi.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/esm/others/idff.js b/node_modules/@bochilteam/scraper/lib/esm/others/idff.js new file mode 100644 index 000000000..2276658e8 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/esm/others/idff.js @@ -0,0 +1,31 @@ +import got from 'got'; +import { ScraperError } from '../utils.js'; +export default async function nameFreeFire(id) { + id = id.toString(); + const json = await got('https://api.duniagames.co.id/api/transaction/v1/top-up/inquiry/store', { + headers: { + accept: 'application/json, text/plain, */*', + 'content-type': 'application/json', + origin: 'https://duniagames.co.id', + referer: 'https://duniagames.co.id/', + 'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.102 Safari/537.36' + }, + body: JSON.stringify({ + catalogId: 66, + gameId: id, + itemId: 11, + paymentId: 750, + productId: 3, + product_ref: 'AE', + product_ref_denom: 'AE' + }), + method: 'POST' + }).json(); + if (json.status.message !== 'success') + throw new ScraperError(`Can't get nameFreeFire for id ${id}\n${JSON.stringify(json, null, 2)}`); + return { + id: json.data.gameId, + username: json.data.userNameGame + }; +} +//# sourceMappingURL=idff.js.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/esm/others/idff.js.map b/node_modules/@bochilteam/scraper/lib/esm/others/idff.js.map new file mode 100644 index 000000000..ece76a5eb --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/esm/others/idff.js.map @@ -0,0 +1 @@ +{"version":3,"file":"idff.js","sourceRoot":"","sources":["../../../src/others/idff.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,KAAK,CAAA;AACrB,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAG1C,MAAM,CAAC,OAAO,CAAC,KAAK,UAAU,YAAY,CAAE,EAAmB;IAC7D,EAAE,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAA;IAClB,MAAM,IAAI,GAAQ,MAAM,GAAG,CAAC,sEAAsE,EAAE;QAClG,OAAO,EAAE;YACP,MAAM,EAAE,mCAAmC;YAC3C,cAAc,EAAE,kBAAkB;YAClC,MAAM,EAAE,0BAA0B;YAClC,OAAO,EAAE,2BAA2B;YACpC,YAAY,EAAE,qHAAqH;SACpI;QACD,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC;YACnB,SAAS,EAAE,EAAE;YACb,MAAM,EAAE,EAAE;YACV,MAAM,EAAE,EAAE;YACV,SAAS,EAAE,GAAG;YACd,SAAS,EAAE,CAAC;YACZ,WAAW,EAAE,IAAI;YACjB,iBAAiB,EAAE,IAAI;SACxB,CAAC;QACF,MAAM,EAAE,MAAM;KACf,CAAC,CAAC,IAAI,EAAE,CAAA;IACT,IAAI,IAAI,CAAC,MAAM,CAAC,OAAO,KAAK,SAAS;QAAE,MAAM,IAAI,YAAY,CAAC,iCAAiC,EAAE,KAAK,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,CAAA;IACtI,OAAO;QACL,EAAE,EAAE,IAAI,CAAC,IAAI,CAAC,MAAM;QACpB,QAAQ,EAAE,IAAI,CAAC,IAAI,CAAC,YAAY;KACjC,CAAA;AACH,CAAC"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/esm/others/index.js b/node_modules/@bochilteam/scraper/lib/esm/others/index.js new file mode 100644 index 000000000..081a3e6a6 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/esm/others/index.js @@ -0,0 +1,14 @@ +import wikipedia from './wikipedia.js'; +import jadwalTV, { jadwalTVNow, listJadwalTV } from './jadwal-tv.js'; +import kbbi from './KBBI.js'; +import nameFreeFire from './idff.js'; +export * from './minecraft.js'; +export * from './mediafire.js'; +export * from './BMKG.js'; +export * from './lyrics.js'; +export * from './minecraft.js'; +export * from './bioskop.js'; +// TODO: add cekResi +// export * from "./cek-resi" +export { wikipedia, jadwalTV, jadwalTVNow, listJadwalTV, kbbi, nameFreeFire }; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/esm/others/index.js.map b/node_modules/@bochilteam/scraper/lib/esm/others/index.js.map new file mode 100644 index 000000000..716252a31 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/esm/others/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/others/index.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,gBAAgB,CAAA;AACtC,OAAO,QAAQ,EAAE,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AACpE,OAAO,IAAI,MAAM,WAAW,CAAA;AAC5B,OAAO,YAAY,MAAM,WAAW,CAAA;AAEpC,cAAc,gBAAgB,CAAA;AAC9B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,WAAW,CAAA;AACzB,cAAc,aAAa,CAAA;AAC3B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,cAAc,CAAA;AAC5B,oBAAoB;AACpB,6BAA6B;AAC7B,OAAO,EACL,SAAS,EACT,QAAQ,EAAE,WAAW,EAAE,YAAY,EACnC,IAAI,EACJ,YAAY,EACb,CAAA"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/esm/others/jadwal-tv.js b/node_modules/@bochilteam/scraper/lib/esm/others/jadwal-tv.js new file mode 100644 index 000000000..43c65b6e8 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/esm/others/jadwal-tv.js @@ -0,0 +1,58 @@ +import got from 'got'; +import cheerio from 'cheerio'; +import { ScraperError } from '../utils.js'; +export const listJadwalTV = (async () => await got('https://raw.githubusercontent.com/BochilTeam/scraper/master/data/jadwal-tv.json').json())(); +export default async function jadwalTV(channel) { + const list = await listJadwalTV; + const data = list.find(({ channel: name }) => (new RegExp(channel, 'ig')).test(name)); + if (!data) + throw new ScraperError(`List not found!!\n${JSON.stringify(listJadwalTV, null, 2)}`); + const text = await got(`https://www.jadwaltv.net/${data.isPay ? 'jadwal-pay-tv/' : ''}${data.value}`).text(); + const result = []; + const $ = cheerio.load(text); + $('div > table.table').each(function () { + $(this).find('tbody > tr') + .slice(1).each(function () { + const el = $(this).find('td'); + const date = el.eq(0).text(); + const event = el.eq(1).text(); + if (!/Jadwal TV selengkapnya di/ig.test(event)) { + result.push({ + date, event + }); + } + }); + }); + return { + channel: data.channel, + result + }; +} +export async function jadwalTVNow() { + const text = await got('https://www.jadwaltv.net/channel/acara-tv-nasional-saat-ini').text(); + const result = {}; + const $ = cheerio.load(text); + $('div > table.table').each(function () { + let prevChannel; + $(this).find('tbody > tr') + .slice(1).each(function () { + const el = $(this).find('td'); + const channel = el.eq(0).find('strong > a[href]') + .text().trim().toLowerCase(); + if (channel) { + prevChannel = channel; + result[channel] = []; + } + else if (prevChannel) { + const date = el.eq(0).text(); + const event = el.eq(1).text(); + result[prevChannel].push({ + date, + event + }); + } + }); + }); + return result; +} +//# sourceMappingURL=jadwal-tv.js.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/esm/others/jadwal-tv.js.map b/node_modules/@bochilteam/scraper/lib/esm/others/jadwal-tv.js.map new file mode 100644 index 000000000..10ca9a892 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/esm/others/jadwal-tv.js.map @@ -0,0 +1 @@ +{"version":3,"file":"jadwal-tv.js","sourceRoot":"","sources":["../../../src/others/jadwal-tv.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,KAAK,CAAA;AACrB,OAAO,OAAO,MAAM,SAAS,CAAA;AAG7B,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAQ1C,MAAM,CAAC,MAAM,YA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AAI,EAAE,CAAA;gBAC7B,MAAM,CAAC,WAAW,CAAC,CAAC,IAAI,CAAC;oBACvB,IAAI;oBACJ,KAAK;iBACN,CAAC,CAAA;aACH;QACH,CAAC,CAAC,CAAA;IACN,CAAC,CAAC,CAAA;IACF,OAAO,MAAM,CAAA;AACf,CAAC"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/esm/others/lyrics.js b/node_modules/@bochilteam/scraper/lib/esm/others/lyrics.js new file mode 100644 index 000000000..5d0e31a37 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/esm/others/lyrics.js @@ -0,0 +1,65 @@ +import got from 'got'; +import cheerio from 'cheerio'; +import { ScraperError } from '../utils.js'; +export async function lyrics(query) { + const data = await got(`https://www.musixmatch.com/search/${encodeURIComponent(query)}`).text(); + const $ = cheerio.load(data); + const results = []; + $('#search-all-results > div.main-panel > div:nth-child(2) > div.box-content > div > ul.tracks.list > li.showArtist.showCoverart').each(function () { + var _a; + const el = (_a = $(this).find('meta[itemprop="url"]').attr('content')) === null || _a === void 0 ? void 0 : _a.trim(); + if (el) { + results.push({ + link: 'https://www.musixmatch.com' + el, + title: $(this).find('.media-card-title > a > span').text().trim(), + author: $(this).find('.artist-field > span > a.artist').text().trim() + }); + } + }); + if (!results.length) + throw new ScraperError(`Can't get lyrics!\n${$.html()}`); + const { link, title, author } = results[0]; + const html = await got(link).text(); + const $$ = cheerio.load(html); + return { + title, + author, + lyrics: $$('p.mxm-lyrics__content > span.lyrics__content__ok').map((_, el) => $$(el).text().trim()).toArray().filter(v => v).join('\n'), + link + }; +} +export async function lyricsv2(query) { + var _a, _b; + const data = await got(`https://genius.com/api/search/multi?per_page=5&q=${encodeURIComponent(query)}`, { + headers: { + accept: 'application/json, text/plain, */*', + 'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36' + } + }).json(); + // @ts-ignore + const result = (_b = (_a = data.response.sections.find((section) => { + var _a; + return ['song', 'lyric'].includes(section.type) && + ((_a = section.hits) === null || _a === void 0 ? void 0 : _a.find((hit) => ['song', 'lyric'].includes(hit.type))); + }).hits) === null || _a === void 0 ? void 0 : _a.find((hit) => ['song', 'lyric'].includes(hit.type))) === null || _b === void 0 ? void 0 : _b.result; + if (!result) + throw new ScraperError(`Can't get json!\n${JSON.stringify(data)}`); + const { artist_names, title, url } = result; + if (!url) + throw new ScraperError(`Can't get lyrics!\n${JSON.stringify(data, null, 2)}`); + const html = await got(url).text(); + const $ = cheerio.load(html); + let results = ''; + $('#lyrics-root > div[data-lyrics-container="true"]').each((_, el) => { + const element = $(($(el).html() || '').replace(/
/g, '\n')).text().trim(); + if (element) + results += element; + }); + return { + title, + author: artist_names, + lyrics: results.trim(), + link: url + }; +} +//# sourceMappingURL=lyrics.js.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/esm/others/lyrics.js.map b/node_modules/@bochilteam/scraper/lib/esm/others/lyrics.js.map new file mode 100644 index 000000000..13c459968 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/esm/others/lyrics.js.map @@ -0,0 +1 @@ +{"version":3,"file":"lyrics.js","sourceRoot":"","sources":["../../../src/others/lyrics.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,KAAK,CAAA;AACrB,OAAO,OAAO,MAAM,SAAS,CAAA;AAI7B,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAE1C,MAAM,CAAC,KAAK,UAAU,MAAM,CAAE,KAAa;IACzC,MAAM,IAAI,GAAG,MAAM,GAAG,CAAC,qCAAqC,kBAAkB,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,IAAI,EAAE,CAAA;IAC/F,MAAM,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IAC5B,MAAM,OAAO,GAKP,EAAE,CAAA;IACR,CAAC,CAAC,+HAA+H,CAAC,CAAC,IAAI,CAAC;;QACtI,MA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AC5B,IAAI,OAAO,GAAW,EAAE,CAAA;IACxB,CAAC,CAAC,kDAAkD,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE;QACnE,MAAM,OAAO,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,IAAI,EAAE,CAAA;QAC5E,IAAI,OAAO;YAAE,OAAO,IAAI,OAAO,CAAA;IACjC,CAAC,CAAC,CAAA;IACF,OAAO;QACL,KAAK;QACL,MAAM,EAAE,YAAY;QACpB,MAAM,EAAE,OAAO,CAAC,IAAI,EAAE;QACtB,IAAI,EAAE,GAAG;KACV,CAAA;AACH,CAAC"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/esm/others/mediafire.js b/node_modules/@bochilteam/scraper/lib/esm/others/mediafire.js new file mode 100644 index 000000000..6e89d366b --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/esm/others/mediafire.js @@ -0,0 +1,38 @@ +import got from 'got'; +import cheerio from 'cheerio'; +export async function mediafiredl(url) { + var _a, _b; + if (!/https?:\/\/(www\.)?mediafire\.com/.test(url)) + throw new Error('Invalid URL: ' + url); + const data = await got(url).text(); + const $ = cheerio.load(data); + const Url = ($('#downloadButton').attr('href') || '').trim(); + const url2 = ($('#download_link > a.retry').attr('href') || '').trim(); + const $intro = $('div.dl-info > div.intro'); + const filename = $intro.find('div.filename').text().trim(); + const filetype = $intro.find('div.filetype > span').eq(0).text().trim(); + const ext = ((_b = (_a = /\(\.(.*?)\)/.exec($intro.find('div.filetype > span').eq(1).text())) === null || _a === void 0 ? void 0 : _a[1]) === null || _b === void 0 ? void 0 : _b.trim()) || 'bin'; + const $li = $('div.dl-info > ul.details > li'); + const aploud = $li.eq(1).find('span').text().trim(); + const filesizeH = $li.eq(0).find('span').text().trim(); + const filesize = parseFloat(filesizeH) * (/GB/i.test(filesizeH) + ? 1000000 + : /MB/i.test(filesizeH) + ? 1000 + : /KB/i.test(filesizeH) + ? 1 + : /B/i.test(filesizeH) + ? 0.1 + : 0); + return { + url: Url, + url2, + filename, + filetype, + ext, + aploud, + filesizeH, + filesize + }; +} +//# sourceMappingURL=mediafire.js.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/esm/others/mediafire.js.map b/node_modules/@bochilteam/scraper/lib/esm/others/mediafire.js.map new file mode 100644 index 000000000..7202d913c --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/esm/others/mediafire.js.map @@ -0,0 +1 @@ +{"version":3,"file":"mediafire.js","sourceRoot":"","sources":["../../../src/others/mediafire.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,KAAK,CAAA;AACrB,OAAO,OAAO,MAAM,SAAS,CAAA;AAG7B,MAAM,CAAC,KAAK,UAAU,WAAW,CAAE,GAAW;;IAC5C,IAAI,CAAC,mCAAmC,CAAC,IAAI,CAAC,GAAG,CAAC;QAAE,MAAM,IAAI,KAAK,CAAC,eAAe,GAAG,GAAG,CAAC,CAAA;IAC1F,MAAM,IAAI,GAAG,MAAM,GAAG,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAA;IAClC,MAAM,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IAC5B,MAAM,GAAG,GAAG,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAA;IAC5D,MAAM,IAAI,GAAG,CAAC,CAAC,CAAC,0BAA0B,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAA;IACtE,MAAM,MAAM,GAAG,CAAC,CAAC,yBAAyB,CAAC,CAAA;IAC3C,MAAM,QAAQ,GAAG,MAAM,CAAC,IAAI,CAAC,cA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;KACT,CAAA;AACH,CAAC"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/esm/others/minecraft.js b/node_modules/@bochilteam/scraper/lib/esm/others/minecraft.js new file mode 100644 index 000000000..b099da088 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/esm/others/minecraft.js @@ -0,0 +1,221 @@ +// import dgram, { Socket } from 'dgram' +import EventEmitter from 'events'; +import net from 'net'; +import { ScraperError } from '../utils.js'; +// TODO +export async function statusBedrock(ip, port, opts = { timeout: 5 * 1000 }) { } +// TODO: fix connection timeout +export function statusJava(ip, port = 25565, opts = { timeout: 5 * 1000 }) { + // eslint-disable-next-line no-async-promise-executor + return new Promise(async (resolve, reject) => { + var _a; + setTimeout(() => reject(new ScraperError('timeout')), opts.timeout); + // reference https://github.com/PassTheMayo/minecraft-server-util/blob/master/src/status.ts + const socket = new TCPsocket(ip, port, opts, reject); + // https://wiki.vg/Server_List_Ping#Handshake + socket.writeVarInt(0x00); + socket.writeVarInt(47); + socket.writeStringVarInt(ip); + socket.writeUnsignedShort(port); + socket.writeVarInt(1); + await socket.send(); + // https://wiki.vg/Server_List_Ping#Request + socket.writeVarInt(0x00); + socket.send(); + await socket.waitForResponse(); + socket.readVarInt(); + const responseId = socket.readVarInt(); + // eslint-disable-next-line eqeqeq + if (responseId == -1) + reject(new Error('Premature end of stream')); + // eslint-disable-next-line eqeqeq + if (responseId != 0x00) + reject(new Error('Invalid responseId')); + // https://wiki.vg/Protocol#Response + const response = JSON.parse(socket.readStringVarInt()); + // https://wiki.vg/Server_List_Ping#Ping + socket.writeVarInt(0x01); + const ping = Date.now(); + socket.writeVarLong(ping); + socket.send(); + await socket.waitForResponse(); + const pong = Date.now() - ping; + socket.close(); + resolve({ + ip, + port, + description: response.description.extra.map(({ text }) => text.trim()).join(' ').trim(), + descriptionText: response.description.text.trim(), + players: { + max: response.players.max, + online: response.players.online, + sample: response.players.sample.map(({ name }) => name.trim()) + }, + version: { + name: response.version.name, + protocol: response.version.protocol + }, + favicon: (_a = response.favicon) !== null && _a !== void 0 ? _a : null, + ping: pong, + originalResponse: response + }); + }); +} +// class UDPsocket extends EventEmitter { +// public socket: Socket; +// constructor (public ip: string, public port: number, public opts: object) { +// super() +// this.socket = dgram.createSocket('udp4') +// } +// connect () { +// if (!this.socket) return +// this.socket.bind(this.port, this.ip) +// } +// } +class TCPsocket extends EventEmitter { + constructor(ip, port, opts, reject) { + super(); + this.ip = ip; + this.port = port; + this.opts = opts; + this.reject = reject; + this.data = Buffer.alloc(0); + this.response = Buffer.alloc(0); + } + connect(opts) { + this.socket = net.createConnection({ + host: this.ip, + port: this.port, + timeout: this.opts.timeout, + ...opts + }); + this.socket.on('data', (data) => { + this.response = Buffer.concat([this.response, data]); + this.emit('data', data, this.response); + }); + this.socket.on('connect', () => { + this.emit('connect'); + }); + this.socket.on('close', () => { + // this.reject(new ScraperError('Connection closed')); + this.emit('close'); + }); + this.socket.on('error', () => { + this.reject(new ScraperError('Connection error')); + this.emit('error'); + }); + this.socket.on('timeout', () => { + this.reject(new ScraperError('Connection timeout')); + this.emit('timeout'); + }); + } + write(data) { + return (this.data = Buffer.concat([this.data, data])); + } + writeVarInt(value, save = true) { + const buffer = Buffer.alloc(5); + let i = 0; + do { + buffer[i++] = value & 0x7f | 0x80; + value >>= 7; + } while (value > 0); + buffer[i - 1] &= 0x7f; + const result = buffer.slice(0, i); + if (save) + this.write(result); + return result; + } + writeVarLong(value) { + const buffer = Buffer.alloc(9); + let i = 0; + do { + buffer[i++] = value & 0x7f | 0x80; + value >>= 7; + } while (value > 0); + buffer[i - 1] &= 0x7f; + const result = buffer.slice(0, i); + this.write(result); + return result; + } + writeStringVarInt(value) { + this.writeVarInt(value.length); + this.write(Buffer.from(value, 'utf8')); + } + writeUnsignedShort(value) { + this.write(Buffer.from([value >> 8, value & 0xff])); + } + readVarInt() { + let result = 0; + let i = 0; + let b; + do { + b = this.response[i++]; + result |= (b & 0x7f) << (7 * i); + } while (b & 0x80); + this.response = this.response.slice(i); + return result; + } + readVarLong() { + let result = 0; + let i = 0; + let b; + do { + b = this.response[i++]; + result |= (b & 0x7f) << (7 * i); + } while (b & 0x80); + this.response = this.response.slice(i); + return result; + } + readStringVarInt() { + let length = 0; + let i = 0; + let b; + do { + b = this.response[i++]; + length |= (b & 0x7f) << (7 * i); + } while (b & 0x80); + // @ts-ignore + const result = this.response.slice(i, i + length).toString('utf8'); + this.response = this.response.slice(i + length); + return result; + } + readInt64BE() { + // @ts-ignore + const result = this.response.slice(0, 8).readBigInt64BE(0); + this.response = this.response.slice(8); + return result; + } + send() { + if (!this.socket) + this.connect(); + return new Promise((resolve, reject) => { + var _a, _b; + this.response = Buffer.alloc(0); + // https://gist.github.com/zh32/7190955#file-serverlistping17-java-L92 + // https://github.com/PassTheMayo/minecraft-server-util/blob/68a7a16beb48226cdd5b63c45604fd3bea6c12ca/src/structure/TCPClient.ts#L464 + const data = Buffer.concat([this.writeVarInt(this.data.byteLength, false), this.data]); + (_b = (_a = this.socket) === null || _a === void 0 ? void 0 : _a.write) === null || _b === void 0 ? void 0 : _b.call(_a, data, (err) => { + if (err) + return reject(err); + resolve(); + }); + this.data = Buffer.alloc(0); + }); + } + close() { + var _a, _b, _c, _d, _e, _f; + (_b = (_a = this.socket) === null || _a === void 0 ? void 0 : _a.end) === null || _b === void 0 ? void 0 : _b.call(_a); + (_d = (_c = this.socket) === null || _c === void 0 ? void 0 : _c.destroy) === null || _d === void 0 ? void 0 : _d.call(_c); + (_f = (_e = this.socket) === null || _e === void 0 ? void 0 : _e.removeAllListeners) === null || _f === void 0 ? void 0 : _f.call(_e); + } + waitForResponse() { + return new Promise((resolve) => { + const timeout = setTimeout(resolve, 250); + this.on('data', () => { + // @ts-ignore + timeout.refresh(); + }); + }); + } +} +//# sourceMappingURL=minecraft.js.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/esm/others/minecraft.js.map b/node_modules/@bochilteam/scraper/lib/esm/others/minecraft.js.map new file mode 100644 index 000000000..1342e7a18 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/esm/others/minecraft.js.map @@ -0,0 +1 @@ +{"version":3,"file":"minecraft.js","sourceRoot":"","sources":["../../../src/others/minecraft.ts"],"names":[],"mappings":"AACA,wCAAwC;AACxC,OAAO,YAAY,MAAM,QAAQ,CAAA;AACjC,OAAO,GAA4C,MAAM,KAAK,CAAA;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAM1C,OAAO;AACP,MAAM,CAAC,KAAK,UAAU,aAAa,CACjC,EAAU,EACV,IAAY,EACZ,OAAgB,EAAE,OAAO,EAAE,CAAC,GAAG,IAAI,EAAE,IACnC,CAAC;AAEL,+BAA+B;AAC/B,MAAM,UAAU,UAAU,CACxB,EAAU,EACV,OAAe,KAAK,EACpB,OAAgB,EAAE,OAAO,EAAE,CAAC,GAAG,IAAI,EAAE;IAErC,qDAAqD;IACrD,OAAO,IAAI,OAAO,CAAC,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE;;QAC3C,UAAU,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,IAAI,YAAY,CAAC,SAAS,CAAC,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,CAAA;QACnE,2FAA2F;QAC3F,MAAM,MAAM,GAAG,IAAI,SAAS,CAAC,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,CAAC,CAAA;QAEpD,6CAA6C;QAC7C,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,CAAA;QACxB,MAAM,CAAC,WAAW,CAAC,EAAE,CAAC,CAAA;QACtB,MAAM,CAAC,iBAAiB,CAAC,EAAE,CAAC,CAAA;QAC5B,MAAM,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAA;QAC/B,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC,CAAA;QACrB,MAAM,MAAM,CAAC,IAAI,EAAE,CAAA;QAEnB,2CAA2C;QAC3C,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC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,IAAI,CAAC,IAAI,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;QAC7B,CAAC,CAAC,CAAA;IACJ,CAAC;IAED,KAAK;;QACH,MAAA,MAAA,IAAI,CAAC,MAAM,0CAAE,GAAG,kDAAI,CAAA;QACpB,MAAA,MAAA,IAAI,CAAC,MAAM,0CAAE,OAAO,kDAAI,CAAA;QACxB,MAAA,MAAA,IAAI,CAAC,MAAM,0CAAE,kBAAkB,kDAAI,CAAA;IACrC,CAAC;IAED,eAAe;QACb,OAAO,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,EAAE;YACnC,MAAM,OAAO,GAAG,UAAU,CAAC,OAAO,EAAE,GAAG,CAAC,CAAA;YACxC,IAAI,CAAC,EAAE,CAAC,MAAM,EAAE,GAAG,EAAE;gBACnB,aAAa;gBACb,OAAO,CAAC,OAAO,EAAE,CAAA;YACnB,CAAC,CAAC,CAAA;QACJ,CAAC,CAAC,CAAA;IACJ,CAAC;CACD"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/esm/others/test.js b/node_modules/@bochilteam/scraper/lib/esm/others/test.js new file mode 100644 index 000000000..595367e92 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/esm/others/test.js @@ -0,0 +1,192 @@ +import { expect } from 'chai'; +import { wikipedia, jadwalTV, jadwalTVNow, mediafiredl, gempa, gempaNow, tsunami, lyrics, kbbi, nameFreeFire, bioskopNow, bioskop } from './index.js'; +describe('Others', () => { + // TODO + describe('Minecraft', () => { + // it('Minecraft java', done => { + // statusJava('moelsmp2.mcalias.com', 25566).then(res => { + // expect(res).to.be.an('object') + // expect(res.ip).to.be.a('string') + // expect(res.port).to.be.a('number') + // expect(res.description).to.be.a('string') + // expect(res.descriptionText).to.be.a('string') + // expect(res.players).to.be.an('object') + // expect(res.players.max).to.be.a('number') + // expect(res.players.online).to.be.a('number') + // expect(res.players.sample).to.be.an('array') + // expect(res.version).to.be.an('object') + // expect(res.version.name).to.be.a('string') + // expect(res.version.protocol).to.be.a('number') + // expect(res.favicon).to.be.a('string') + // return done() + // }).catch(done) + // }) + }); + it('Wikipedia', (done) => { + wikipedia('Minecraft', 'en').then(res => { + expect(res).to.be.an('object'); + expect(res.title).to.be.a('string'); + expect(res.img).to.be.a('string'); + expect(res.articles).to.be.a('string'); + return done(); + }).catch(done); + }); + describe('Jadwal TV', () => { + it('Jadwal TV', done => { + jadwalTV('RCTI').then(res => { + expect(res).to.be.an('object'); + expect(res.channel).to.be.a('string'); + expect(res.result).to.be.an('array'); + expect(res.result).to.have.lengthOf.at.least(1); + return done(); + }).catch(done); + }); + it('Jadwal TV NOW', done => { + jadwalTVNow().then(res => { + expect(res).to.be.an('object'); + Object.keys(res).forEach(key => { + expect(key).to.be.a('string'); + expect(res[key]).to.be.an('array'); + expect(res[key]).to.have.lengthOf.at.least(2); + }); + return done(); + }).catch(done); + }); + }); + describe('Mediafire', () => { + it('Mediafire Download', done => { + mediafiredl('https://www.mediafire.com/file/gpeiucmm1xo6ln0/hello_world.mp4/file').then(res => { + expect(res).to.be.an('object'); + expect(res.url).to.be.a('string'); + expect(res.url2).to.be.a('string'); + expect(res.filename).to.be.a('string'); + expect(res.filetype).to.be.a('string'); + expect(res.ext).to.be.a('string'); + expect(res.aploud).to.be.a('string'); + expect(res.filesizeH).to.be.a('string'); + expect(res.filesize).to.be.a('number'); + return done(); + }).catch(done); + }); + }); + describe('Gempa', () => { + it('Gempa', done => { + gempa().then(res => { + expect(res).to.be.an('array'); + res.forEach(({ date, locate, magnitude, depth, location, warning }) => { + expect(date).to.be.a('string'); + expect(locate).to.be.a('string'); + expect(magnitude).to.be.a('string'); + expect(depth).to.be.a('string'); + expect(location).to.be.a('string'); + expect(warning).to.be.an('array'); + warning.forEach(s => expect(s).to.be.a('string')); + }); + return done(); + }).catch(done); + }); + it('Gempa Now', done => { + gempaNow().then(res => { + expect(res).to.be.an('array'); + res.forEach(({ date, latitude, longitude, magnitude, depth, location }) => { + expect(date).to.be.a('string'); + expect(latitude).to.be.a('string'); + expect(longitude).to.be.a('string'); + expect(magnitude).to.be.a('string'); + expect(depth).to.be.a('string'); + expect(location).to.be.a('string'); + }); + return done(); + }).catch(done); + }); + }); + it('Tsunami', (done) => { + tsunami().then(res => { + expect(res).to.be.an('array'); + res.forEach(({ date, locate, magnitude, depth, location }) => { + expect(date).to.be.a('string'); + expect(locate).to.be.a('string'); + expect(magnitude).to.be.a('string'); + expect(depth).to.be.a('string'); + expect(location).to.be.a('string'); + }); + return done(); + }).catch(done); + }); + describe('Lyrics', () => { + it('Lyrics', done => { + lyrics('rick astley never gonna give you up').then(res => { + expect(res).to.be.an('object'); + expect(res.title).to.be.a('string'); + expect(res.author).to.be.a('string'); + expect(res.lyrics).to.be.a('string'); + expect(res.link).to.be.a('string'); + return done(); + }).catch(done); + }); + // it('Lyrics V2', done => { + // lyricsv2('never gonna give you up').then(res => { + // expect(res.title).to.be.a('string') + // expect(res.author).to.be.a('string') + // expect(res.lyrics).to.be.a('string') + // expect(res.link).to.be.a('string') + // return done() + // }).catch(done) + // }) + }); + it('KBBI', done => { + kbbi('halo').then(res => { + expect(res).to.be.an('array'); + res.forEach(({ index, title, means }) => { + expect(index).to.be.a('number'); + expect(title).to.be.a('string'); + expect(means).to.be.an('array'); + means.forEach((mean) => expect(mean).to.be.a('string')); + }); + return done(); + }).catch(done); + }); + it('ID Free Fire', done => { + nameFreeFire('821587717').then(res => { + expect(res).to.be.an('object'); + expect(res.username).to.be.a('string'); + expect(res.id).to.be.a('string'); + return done(); + }).catch(done); + }); + describe('Bioskop', () => { + it('Bioskop now', done => { + bioskopNow().then(res => { + expect(res).to.be.an('array'); + expect(res).to.have.lengthOf.at.least(1); + res.forEach(({ title, img, url, genre, duration, playingAt }) => { + expect(title).to.be.a('string'); + expect(img).to.be.a('string'); + expect(url).to.be.a('string'); + expect(genre).to.be.a('string'); + expect(duration).to.be.a('string'); + expect(playingAt).to.be.a('string'); + }); + return done(); + }).catch(done); + }); + it('Bioskop', done => { + bioskop().then(res => { + expect(res).to.be.an('array'); + expect(res).to.have.lengthOf.at.least(1); + res.forEach(({ title, img, url, genre, duration, release, director, cast }) => { + expect(title).to.be.a('string'); + expect(img).to.be.a('string'); + expect(url).to.be.a('string'); + expect(genre).to.be.a('string'); + expect(duration).to.be.a('string'); + expect(release).to.be.a('string'); + expect(director).to.be.a('string'); + expect(cast).to.be.an('string'); + }); + return done(); + }).catch(done); + }); + }); +}); +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/esm/others/test.js.map b/node_modules/@bochilteam/scraper/lib/esm/others/test.js.map new file mode 100644 index 000000000..99784afb9 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/esm/others/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["../../../src/others/test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAA;AAC7B,OAAO,EACL,SAAS,EACT,QAAQ,EACR,WAAW,EAEX,WAAW,EACX,KAAK,EACL,QAAQ,EACR,OAAO,EACP,MAAM,EAEN,IAAI,EAEJ,YAAY,EACZ,UAAU,EACV,OAAO,EACR,MAAM,YAAY,CAAA;AAEnB,QAAQ,CAAC,QAAQ,EAAE,GAAG,EAAE;IACtB,OAAO;IACP,QAAQ,CAAC,WAAW,EAAE,GAAG,EAAE;QACzB,iCAAiC;QACjC,8DAA8D;QAC9D,yCAAyC;QACzC,2CAA2C;QAC3C,6CAA6C;QAC7C,oDAAoD;QACpD,wDAAwD;QACxD,iDAAiD;QACjD,oDAAoD;QACpD,uDAAuD;QACvD,uDAAuD;QACvD,iDAAiD;QACjD,qDAAqD;QACrD,yDAAyD;QACzD,gDAAgD;QAEhD,wBAAwB;QACxB,qBAAqB;QACrB,KAAK;IACP,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,WAAW,EAAE,CAAC,IAAI,EAAE,EAAE;QACvB,SAAS,CAAC,WAAW,E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CAAC,CAAA;gBACjC,CAAC,CAAC,CAAA;gBAEF,OAAO,IAAI,EAAE,CAAA;YACf,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;QAChB,CAAC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/esm/others/types.js b/node_modules/@bochilteam/scraper/lib/esm/others/types.js new file mode 100644 index 000000000..718fd38ae --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/esm/others/types.js @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=types.js.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/esm/others/types.js.map b/node_modules/@bochilteam/scraper/lib/esm/others/types.js.map new file mode 100644 index 000000000..7cd07dffb --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/esm/others/types.js.map @@ -0,0 +1 @@ +{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/others/types.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/esm/others/wikipedia.js b/node_modules/@bochilteam/scraper/lib/esm/others/wikipedia.js new file mode 100644 index 000000000..bdf9bfd1b --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/esm/others/wikipedia.js @@ -0,0 +1,90 @@ +import cheerio from 'cheerio'; +import got from 'got'; +import { ScraperError } from '../utils.js'; +export default async function wikipedia(query, lang = 'id') { + const html = await getHtml(lang, query); + const $ = cheerio.load(html); + const title = $('#firstHeading > i').text().trim(); + const img = getImgLink($('td.infobox-image > a.image > img[src]').attr('src')); + const articles = []; + let end = false; + let start = false; + $('#mw-content-text > div.mw-parser-output') + .children() + .map(function () { + if (/p|h[2-4]|div/.test(this.name) && !end) { + let text = ''; + const h = /h[2-4]/.test(this.name); + const div = /div/.test(this.name); + const el = $(this); + if (h && + /referen|Примечания|Notes_et_références/i.test(el.find('span.mw-headline').attr('id'))) { + return (end = true); + } + const math = $(this).find('span.mwe-math-element'); + if (math.length) { + math.replaceWith($(`${math + .text() + .trim() + .replace(/(.*displaystyle.*|\\n)/, '')}`)); + } + if (div && + el.hasClass('thumb') && + el.find('div.thumbinner > a > img[src]').length) { + text = getImgLink(el.find('div.thumbinner > a > img[src]').attr('src')); + } + else if (div && el.find('div > ol > li[id]').length) { + el.find('div > ol > li[id]').each(function () { + text += $(this).text().trim() + '\n'; + }); + } + else + text = el.text().trim(); + if (!start && this.name === 'p' && !end && text) + start = true; + if (text && start && !el.find('div > ul > li').length) { + articles.push((h ? '\n' : '') + text); + } + } + return true; + }); + return { + title, + img, + articles: articles.join('\n\n') + }; +} +function isSupportLang(lang) { + return ['en', 'id'].includes(lang); +} +async function getHtml(lang, query) { + query = encodeURIComponent(query.trim()); + const defaultLink = `https://${isSupportLang(lang) ? lang : 'id'}.wikipedia.org`; + let res = await got(defaultLink + '/wiki/' + query); + if (!(res.statusCode === 404)) + return res.body; + const link = `${defaultLink}/w/index.php?${lang === 'id' + ? `title=Istimewa:Pencarian&search=${query}&fulltext=1&ns0=1` + : `search=${query}&title=Special:Search&profile=advanced&fulltext=1&ns0=1`}`; + res = await got(link); + const html = res.body; + const $ = cheerio.load(html); + const results = []; + $('ul.mw-search-results > li.mw-search-result').each(function () { + var _a; + const link = (_a = $(this) + .find('div.mw-search-result-heading > a[href]') + .attr('href')) === null || _a === void 0 ? void 0 : _a.trim(); + if (link) + results.push(encodeURI(link)); + }); + if (results[0]) + return (await got(defaultLink + results[0])).body; + throw new ScraperError('404 Not Found!!'); +} +function getImgLink(link = '') { + if (!/https:/i.test(link)) + link = encodeURI('https:' + link); + return link; +} +//# sourceMappingURL=wikipedia.js.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/esm/others/wikipedia.js.map b/node_modules/@bochilteam/scraper/lib/esm/others/wikipedia.js.map new file mode 100644 index 000000000..29739d8ad --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/esm/others/wikipedia.js.map @@ -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C;aACjB,IAAI,CAAC,wCAAwC,CAAC;aAC9C,IAAI,CAAC,MAAM,CAAC,0CACX,IAAI,EAAE,CAAA;QACV,IAAI,IAAI;YAAE,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAA;IACzC,CAAC,CAAC,CAAA;IACF,IAAI,OAAO,CAAC,CAAC,CAAC;QAAE,OAAO,CAAC,MAAM,GAAG,CAAC,WAAW,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAA;IACjE,MAAM,IAAI,YAAY,CAAC,iBAAiB,CAAC,CAAA;AAC3C,CAAC;AAED,SAAS,UAAU,CAAE,OAAe,EAAE;IACpC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC;QAAE,IAAI,GAAG,SAAS,CAAC,QAAQ,GAAG,IAAI,CAAC,CAAA;IAC5D,OAAO,IAAI,CAAA;AACb,CAAC"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/esm/package.json b/node_modules/@bochilteam/scraper/lib/esm/package.json new file mode 100644 index 000000000..aead43de3 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/esm/package.json @@ -0,0 +1,3 @@ +{ + "type": "module" +} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/esm/primbons/artimimpi.js b/node_modules/@bochilteam/scraper/lib/esm/primbons/artimimpi.js new file mode 100644 index 000000000..3cde99036 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/esm/primbons/artimimpi.js @@ -0,0 +1,9 @@ +import got from 'got'; +export default async function artimimpi(mimpi) { + var _a, _b, _c, _d, _e; + const data = await got(`https://www.primbon.com/tafsir_mimpi.php?mimpi=${mimpi}&submit=+Submit+`).text(); + const results = (_e = (_d = (_c = (_b = (_a = data + .split('


')[1]) === null || _a === void 0 ? void 0 : _a.split('')[0]) === null || _b === void 0 ? void 0 : _b.replace(/<(\/)?font( color=#ff0000)?>/gi, '')) === null || _c === void 0 ? void 0 : _c.trim()) === null || _d === void 0 ? void 0 : _d.split('

')) === null || _e === void 0 ? void 0 : _e.filter((v) => v); + return results || []; +} +//# sourceMappingURL=artimimpi.js.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/esm/primbons/artimimpi.js.map b/node_modules/@bochilteam/scraper/lib/esm/primbons/artimimpi.js.map new file mode 100644 index 000000000..60a0b4364 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/esm/primbons/artimimpi.js.map @@ -0,0 +1 @@ +{"version":3,"file":"artimimpi.js","sourceRoot":"","sources":["../../../src/primbons/artimimpi.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,KAAK,CAAA;AACrB,MAAM,CAAC,OAAO,CAAC,KAAK,UAAU,SAAS,CAAE,KAAa;;IACpD,MAAM,IAAI,GAAG,MAAM,GAAG,CACtB,kDAAkD,KAAK,kBAAkB,CACxE,CAAC,IAAI,EAAE,CAAA;IACR,MAAM,OAAO,GAAoB,MAAA,MAAA,MAAA,MAAA,MAAA,IAAI;SAClC,KAAK,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC,0CAC3B,KAAK,CAAC,8BAA8B,EAAE,CAAC,CAAC,0CACxC,OAAO,CAAC,gCAAgC,EAAE,EAAE,CAAC,0CAC7C,IAAI,EAAE,0CACN,KAAK,CAAC,UAAU,CAAC,0CACjB,MAAM,CAAC,CAAC,CAAS,EAAE,EAAE,CAAC,CAAC,CAAC,CAAA;IAC5B,OAAO,OAAO,IAAI,EAAE,CAAA;AACtB,CAAC"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/esm/primbons/artinama.js b/node_modules/@bochilteam/scraper/lib/esm/primbons/artinama.js new file mode 100644 index 000000000..c69183793 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/esm/primbons/artinama.js @@ -0,0 +1,9 @@ +import got from 'got'; +export default async function artinama(nama) { + var _a, _b, _c; + const data = await got(`https://www.primbon.com/arti_nama.php?nama1=${nama}&proses=+Submit%21+`).text(); + const results = (_c = (_b = (_a = data + .split('

ARTI NAMA


')[1]) === null || _a === void 0 ? void 0 : _a.split('')[0]) === null || _b === void 0 ? void 0 : _b.replace(/<(\/)?(h1|br|i|b)>/gim, '')) === null || _c === void 0 ? void 0 : _c.trim(); + return results || ''; +} +//# sourceMappingURL=artinama.js.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/esm/primbons/artinama.js.map b/node_modules/@bochilteam/scraper/lib/esm/primbons/artinama.js.map new file mode 100644 index 000000000..779749a02 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/esm/primbons/artinama.js.map @@ -0,0 +1 @@ +{"version":3,"file":"artinama.js","sourceRoot":"","sources":["../../../src/primbons/artinama.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,KAAK,CAAA;AACrB,MAAM,CAAC,OAAO,CAAC,KAAK,UAAU,QAAQ,CAAE,IAAY;;IAClD,MAAM,IAAI,GAAG,MAAM,GAAG,CACtB,+CAA+C,IAAI,qBAAqB,CACvE,CAAC,IAAI,EAAE,CAAA;IACR,MAAM,OAAO,GAAkB,MAAA,MAAA,MAAA,IAAI;SAChC,KAAK,CAAC,wBAAwB,CAAC,CAAC,CAAC,CAAC,0CACjC,KAAK,CAAC,SAAS,EAAE,CAAC,CAAC,0CACnB,OAAO,CAAC,uBAAuB,EAAE,EAAE,CAAC,0CACpC,IAAI,EAAE,CAAA;IACV,OAAO,OAAO,IAAI,EAAE,CAAA;AACtB,CAAC"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/esm/primbons/index.js b/node_modules/@bochilteam/scraper/lib/esm/primbons/index.js new file mode 100644 index 000000000..cda34fb87 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/esm/primbons/index.js @@ -0,0 +1,6 @@ +import artimimpi from './artimimpi.js'; +import artinama from './artinama.js'; +import nomorhoki from './nomorhoki.js'; +import getZodiac from './zodiac.js'; +export { artinama, artimimpi, nomorhoki, getZodiac }; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/esm/primbons/index.js.map b/node_modules/@bochilteam/scraper/lib/esm/primbons/index.js.map new file mode 100644 index 000000000..3fe81c79a --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/esm/primbons/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/primbons/index.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,gBAAgB,CAAA;AACtC,OAAO,QAAQ,MAAM,eAAe,CAAA;AACpC,OAAO,SAAS,MAAM,gBAAgB,CAAA;AACtC,OAAO,SAAS,MAAM,aAAa,CAAA;AAEnC,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,CAAA"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/esm/primbons/nomorhoki.js b/node_modules/@bochilteam/scraper/lib/esm/primbons/nomorhoki.js new file mode 100644 index 000000000..99aaf03ff --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/esm/primbons/nomorhoki.js @@ -0,0 +1,54 @@ +import got from 'got'; +import { ScraperError } from '../utils.js'; +export default async function nomorhoki(nomer) { + var _a, _b, _c, _d; + const config = { + nomer: encodeURIComponent(nomer), + submit: '+Submit!+' + }; + const data = await got + .post('https://www.primbon.com/no_hoki_bagua_shuzi.php', { + headers: { + 'content-type': 'application/x-www-form-urlencoded' + }, + form: config + }) + .text(); + const results = data + .split('
No. HP : ${nomer}
`)[1]; + const angka_bagua_shuzi = parseInt((_b = (_a = results === null || results === void 0 ? void 0 : results.split('Angka Bagua Shuzi :')[1]) === null || _a === void 0 ? void 0 : _a.split('

')[0]) === null || _b === void 0 ? void 0 : _b.replace(/%/gi, '')); + if (!angka_bagua_shuzi) + throw new ScraperError(`Can't get data, maybe your number(${nomer}) invalid!`); + const kekayaan = parseInt(results.split('Kekayaan =')[1].split('
')[0]); + const kesehatan = parseInt(results.split('Kesehatan =')[1].split('
')[0]); + const cinta = parseInt(results.split('Cinta/Relasi =')[1].split('
')[0]); + const kestabilan = parseInt(results.split('Kestabilan =')[1].split('
')[0]); + const positif = parseInt((_c = results + .split('
')[0] + .split('b>% = ')[1]) === null || _c === void 0 ? void 0 : _c.replace(/%/gi, '')); + const perselisihan = parseInt(results.split('Perselisihan =')[1].split('
')[0]); + const kehilangan = parseInt(results.split('Kehilangan =')[1].split('
')[0]); + const malapetaka = parseInt(results.split('Malapetaka =')[1].split('
')[0]); + const Kehancuran = parseInt(results.split('Kehancuran =')[1].split('
')[0]); + const negatif = parseInt((_d = results.split('Kehancuran =')[1].split('% =')[1]) === null || _d === void 0 ? void 0 : _d.replace(/%/gi, '')); + return { + nomer: nomer, + angka_bagua_shuzi, + positif: { + kekayaan, + kesehatan, + cinta, + kestabilan, + positif + }, + negatif: { + perselisihan, + kehilangan, + malapetaka, + Kehancuran, + negatif + } + }; +} +//# sourceMappingURL=nomorhoki.js.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/esm/primbons/nomorhoki.js.map b/node_modules/@bochilteam/scraper/lib/esm/primbons/nomorhoki.js.map new file mode 100644 index 000000000..605fda497 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/esm/primbons/nomorhoki.js.map @@ -0,0 +1 @@ +{"version":3,"file":"nomorhoki.js","sourceRoot":"","sources":["../../../src/primbons/nomorhoki.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,KAAK,CAAA;AACrB,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAI1C,MAAM,CAAC,OAAO,CAAC,KAAK,UAAU,SAAS,CACrC,KAAsB;;IAEtB,MAAM,MAAM,GAAG;QACb,KAAK,EAAE,kBAAkB,CAAC,KAAK,CAAC;QAChC,MAAM,EAAE,WAAW;KACpB,CAAA;IACD,MAAM,IAAI,GAAG,MAAM,GAAG;SACnB,IAAI,CAAC,iDAAiD,EAAE;QACvD,OAAO,EAAE;YACP,cAAc,EAAE,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ib/esm/primbons/test.js new file mode 100644 index 000000000..68be59ebd --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/esm/primbons/test.js @@ -0,0 +1,46 @@ +import { expect } from 'chai'; +import { artimimpi, artinama, nomorhoki, getZodiac } from './index.js'; +describe('Primbon', () => { + it('ArtiMimpi', done => { + artimimpi('Jalan').then(res => { + expect(res).to.be.an('array'); + res.forEach(v => expect(v).to.be.a('string')); + return done(); + }).catch(done); + }); + it('ArtiNama', done => { + artinama('Windah basudara').then(res => { + expect(res).to.be.a('string'); + return done(); + }).catch(done); + }); + it('NomorHoki', done => { + nomorhoki(6213353).then(res => { + expect(res).to.be.an('Object'); + expect(res).to.haveOwnProperty('nomer'); + expect(res.angka_bagua_shuzi).to.be.a('number'); + expect(res.positif.kekayaan).to.be.a('number'); + expect(res.positif.kesehatan).to.be.a('number'); + expect(res.positif.cinta).to.be.a('number'); + expect(res.positif.kestabilan).to.be.a('number'); + expect(res.positif.positif).to.be.a('number'); + expect(res.negatif.perselisihan).to.be.a('number'); + expect(res.negatif.kehilangan).to.be.a('number'); + expect(res.negatif.malapetaka).to.be.a('number'); + expect(res.negatif.Kehancuran).to.be.a('number'); + expect(res.negatif.negatif).to.be.a('number'); + return done(); + }).catch(done); + }); + it('Zodiac', done => { + try { + const res = getZodiac(1, 1); + expect(res).equal('capricorn'); + return done(); + } + catch (e) { + return done(); + } + }); +}); +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/esm/primbons/test.js.map b/node_modules/@bochilteam/scraper/lib/esm/primbons/test.js.map new file mode 100644 index 000000000..5ec16a03a --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/esm/primbons/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["../../../src/primbons/test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAA;AAC7B,OAAO,EACL,SAAS,EACT,QAAQ,EACR,SAAS,E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KAAK,CAAC,IAAI,CAAC,CAAA;IAChB,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,QAAQ,EAAE,IAAI,CAAC,EAAE;QAClB,IAAI;YACF,MAAM,GAAG,GAAG,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;YAC3B,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,WAAW,CAAC,CAAA;YAE9B,OAAO,IAAI,EAAE,CAAA;SACd;QAAC,OAAO,CAAC,EAAE;YACV,OAAO,IAAI,EAAE,CAAA;SACd;IACH,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/esm/primbons/types.js b/node_modules/@bochilteam/scraper/lib/esm/primbons/types.js new file mode 100644 index 000000000..718fd38ae --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/esm/primbons/types.js @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=types.js.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/esm/primbons/types.js.map b/node_modules/@bochilteam/scraper/lib/esm/primbons/types.js.map new file mode 100644 index 000000000..89d01c590 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/esm/primbons/types.js.map @@ -0,0 +1 @@ +{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/primbons/types.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/esm/primbons/zodiac.js b/node_modules/@bochilteam/scraper/lib/esm/primbons/zodiac.js new file mode 100644 index 000000000..caa979041 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/esm/primbons/zodiac.js @@ -0,0 +1,22 @@ +export default function getZodiac(months, dates) { + var _a; + // https://github.com/Nurutomo/wabot-aq/blob/master/plugins/zodiac.js + const d = new Date(1970, months - 1, dates + 1); + // https://www.primbon.com/zodiak.htm + const zodiac = [ + ['capricorn', new Date(1970, 0, 21)], + ['aquarius', new Date(1970, 1, 20)], + ['pisces', new Date(1970, 2, 21)], + ['aries', new Date(1970, 3, 20)], + ['taurus', new Date(1970, 4, 21)], + ['gemini', new Date(1970, 5, 22)], + ['cancer', new Date(1970, 6, 23)], + ['leo', new Date(1970, 7, 24)], + ['virgo', new Date(1970, 8, 23)], + ['libra', new Date(1970, 9, 24)], + ['scorpio', new Date(1970, 10, 23)], + ['sagitarius', new Date(1970, 11, 22)] // SAGITARIUS (23 November - 21 Desember) + ]; + return (_a = zodiac.find(([_, _d]) => _d >= d)) === null || _a === void 0 ? void 0 : _a[0]; +} +//# sourceMappingURL=zodiac.js.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/esm/primbons/zodiac.js.map b/node_modules/@bochilteam/scraper/lib/esm/primbons/zodiac.js.map new file mode 100644 index 000000000..c3aa482b6 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/esm/primbons/zodiac.js.map @@ -0,0 +1 @@ +{"version":3,"file":"zodiac.js","sourceRoot":"","sources":["../../../src/primbons/zodiac.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,OAAO,UAAU,SAAS,CAAE,MAAc,EAAE,KAAa;;IAC9D,qEAAqE;IACrE,MAAM,CAAC,GAAG,IAAI,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,CAAC,EAAE,KAAK,GAAG,CAAC,CAAC,CAAA;IAC/C,qCAAqC;IACrC,MAAM,MAAM,GAAqB;QAC/B,CAAC,WAAW,EAAE,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;QACpC,CAAC,UAAU,EAAE,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;QACnC,CAAC,QAAQ,EAAE,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;QACjC,CAAC,OAAO,EAAE,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;QAChC,CAAC,QAAQ,EAAE,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;QACjC,CAAC,QAAQ,EAAE,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;QACjC,CAAC,QAAQ,EAAE,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;QACjC,CAAC,KAAK,EAAE,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;QAC9B,CAAC,OAAO,EAAE,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;QAChC,CAAC,OAAO,EAAE,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;QAChC,CAAC,SAAS,EAAE,IAAI,IAAI,CAAC,IAAI,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC;QACnC,CAAC,YAAY,EAAE,IAAI,IAAI,CAAC,IAAI,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC,yCAAyC;KACjF,CAAA;IACD,OAAO,MAAA,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,CAAiB,EAAE,EAAE,CAAC,EAAE,IAAI,CAAC,CAAC,0CAAG,CAAC,CAAW,CAAA;AACzE,CAAC"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/esm/religions/alquran.js b/node_modules/@bochilteam/scraper/lib/esm/religions/alquran.js new file mode 100644 index 000000000..84750142b --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/esm/religions/alquran.js @@ -0,0 +1,6 @@ +import got from 'got'; +export async function alquran() { + const data = await got('https://raw.githubusercontent.com/rzkytmgr/quran-api/master/data/quran.json').json(); + return data; +} +//# sourceMappingURL=alquran.js.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/esm/religions/alquran.js.map b/node_modules/@bochilteam/scraper/lib/esm/religions/alquran.js.map new file mode 100644 index 000000000..7c5e97fbf --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/esm/religions/alquran.js.map @@ -0,0 +1 @@ +{"version":3,"file":"alquran.js","sourceRoot":"","sources":["../../../src/religions/alquran.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,KAAK,CAAA;AAGrB,MAAM,CAAC,KAAK,UAAU,OAAO;IAC3B,MAAM,IAAI,GAAc,MAAM,GAAG,CAC/B,6EAA6E,CAC9E,CAAC,IAAI,EAAE,CAAA;IACR,OAAO,IAAI,CAAA;AACb,CAAC"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/esm/religions/asmaulhusna.js b/node_modules/@bochilteam/scraper/lib/esm/religions/asmaulhusna.js new file mode 100644 index 000000000..64f1fae14 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/esm/religions/asmaulhusna.js @@ -0,0 +1,9 @@ +import got from 'got'; +export let asmaulhusnajson; +export default async function asmaulhusna() { + if (!asmaulhusnajson) { + asmaulhusnajson = await got('https://raw.githubusercontent.com/BochilTeam/database/master/religi/asmaulhusna.json').json(); + } + return asmaulhusnajson[Math.floor(Math.random() * asmaulhusnajson.length)]; +} +//# sourceMappingURL=asmaulhusna.js.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/esm/religions/asmaulhusna.js.map b/node_modules/@bochilteam/scraper/lib/esm/religions/asmaulhusna.js.map new file mode 100644 index 000000000..02a9e7480 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/esm/religions/asmaulhusna.js.map @@ -0,0 +1 @@ +{"version":3,"file":"asmaulhusna.js","sourceRoot":"","sources":["../../../src/religions/asmaulhusna.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,KAAK,CAAA;AAErB,MAAM,CAAC,IAAI,eAA8B,CAAA;AAEzC,MAAM,CAAC,OAAO,CAAC,KAAK,UAAU,WAAW;IACvC,IAAI,CAAC,eAAe,EAAE;QACpB,eAAe,GAAG,MAAM,GAAG,CACzB,sFAAsF,CACvF,CAAC,IAAI,EAAE,CAAA;KACT;IACD,OAAO,eAAe,CACpB,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,eAAe,CAAC,MAAM,CAAC,CACpC,CAAA;AAClB,CAAC"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/esm/religions/index.js b/node_modules/@bochilteam/scraper/lib/esm/religions/index.js new file mode 100644 index 000000000..bafe1b00c --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/esm/religions/index.js @@ -0,0 +1,5 @@ +import asmaulhusna, { asmaulhusnajson } from './asmaulhusna.js'; +import jadwalsholat, { listJadwalSholat } from './jadwalsholat.js'; +export * from './alquran.js'; +export { asmaulhusna, asmaulhusnajson, jadwalsholat, listJadwalSholat }; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/esm/religions/index.js.map b/node_modules/@bochilteam/scraper/lib/esm/religions/index.js.map new file mode 100644 index 000000000..d9c25b6db --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/esm/religions/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/religions/index.ts"],"names":[],"mappings":"AAAA,OAAO,WAAW,EAAE,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAA;AAC/D,OAAO,YAAY,EAAE,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAA;AAElE,cAAc,cAAc,CAAA;AAC5B,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,YAAY,EAAE,gBAAgB,EAAE,CAAA"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/esm/religions/jadwalsholat.js b/node_modules/@bochilteam/scraper/lib/esm/religions/jadwalsholat.js new file mode 100644 index 000000000..11671582f --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/esm/religions/jadwalsholat.js @@ -0,0 +1,56 @@ +import cheerio from 'cheerio'; +import got from 'got'; +import { ScraperError } from '../utils.js'; +export const listJadwalSholat = (async () => got('https://raw.githubusercontent.com/BochilTeam/scraper/master/data/jadwal-sholat.json').json())(); +export default async function jadwalsholat(kota) { + const listJadwal = await listJadwalSholat; + let jadwal; + if (!(jadwal = listJadwal.find(({ kota: Kota }) => new RegExp(Kota, 'ig').test(kota)))) { + throw new ScraperError('List kota ' + listJadwal.map(({ kota }) => kota)); + } + const today = await got(`https://www.jadwalsholat.org/adzan/ajax/ajax.daily1.php?id=${jadwal.value}`).text(); + const sholatToday = {}; + const $ = cheerio.load(today); + $('table > tbody > tr') + .filter('.table_light, .table_dark') + .each(function () { + const el = $(this).find('td'); + const sholat = el.eq(0).text(); + const time = el.eq(1).text(); + sholatToday[sholat] = time; + }); + const data = await got(`https://jadwalsholat.org/jadwal-sholat/monthly.php?id=${jadwal.value}`).text(); + const list = []; + const $$ = cheerio.load(data); + $$('table.table_adzan > tbody > tr') + .filter('.table_light, .table_dark') + .each(function () { + const el = $$(this).find('td'); + const date = el.eq(0).text().trim(); + const imsyak = el.eq(1).text().trim(); + const shubuh = el.eq(2).text().trim(); + const terbit = el.eq(3).text().trim(); + const dhuha = el.eq(4).text().trim(); + const dzuhur = el.eq(5).text().trim(); + const ashr = el.eq(6).text().trim(); + const magrib = el.eq(7).text().trim(); + const isyak = el.eq(8).text().trim(); + list.push({ + date, + imsyak, + shubuh, + terbit, + dhuha, + dzuhur, + ashr, + magrib, + isyak + }); + }); + return { + date: $$('tr.table_title > td > h2.h2_edit').text().trim(), + today: sholatToday, + list + }; +} +//# sourceMappingURL=jadwalsholat.js.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/esm/religions/jadwalsholat.js.map b/node_modules/@bochilteam/scraper/lib/esm/religions/jadwalsholat.js.map new file mode 100644 index 000000000..78c5c4082 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/esm/religions/jadwalsholat.js.map @@ -0,0 +1 @@ +{"version":3,"file":"jadwalsholat.js","sourceRoot":"","sources":["../../../src/religions/jad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AAA;QACnC,MAAM,MAAM,GAAG,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,IAAI,EAAE,CAAA;QACrC,MAAM,KAAK,GAAG,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,IAAI,EAAE,CAAA;QACpC,IAAI,CAAC,IAAI,CAAC;YACR,IAAI;YACJ,MAAM;YACN,MAAM;YACN,MAAM;YACN,KAAK;YACL,MAAM;YACN,IAAI;YACJ,MAAM;YACN,KAAK;SACN,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;IACJ,OAAO;QACL,IAAI,EAAE,EAAE,CAAC,kCAAkC,CAAC,CAAC,IAAI,EAAE,CAAC,IAAI,EAAE;QAC1D,KAAK,EAAE,WAAW;QAClB,IAAI;KACL,CAAA;AACH,CAAC"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/esm/religions/test.js b/node_modules/@bochilteam/scraper/lib/esm/religions/test.js new file mode 100644 index 000000000..d4e78f4b7 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/esm/religions/test.js @@ -0,0 +1,50 @@ +import { expect } from 'chai'; +import { asmaulhusna, asmaulhusnajson, alquran, jadwalsholat, listJadwalSholat } from './index.js'; +describe('Religions', () => { + describe('Asmaul Husna', () => { + it('AsmaulHusna', done => { + asmaulhusna().then(res => { + expect(res).to.be.an('object'); + expect(res.index).to.be.a('number'); + expect(res.latin).to.be.a('string'); + expect(res.arabic).to.be.a('string'); + expect(res.translation_id).to.be.a('string'); + expect(res.translation_en).to.be.a('string'); + return done(); + }).catch(done); + }); + it('AsmaulHusna JSON', done => { + const res = asmaulhusnajson; + expect(res).to.be.an('array'); + expect(res).to.have.length(99); + return done(); + }); + }); + describe('Al quran', () => { + it('Alquran', done => { + alquran().then(res => { + expect(res).to.have.length(114); + return done(); + }).catch(done); + }); + }); + describe('Jadwal Sholat', () => { + it('jadwalSholat', done => { + jadwalsholat('Semarang').then(res => { + expect(res).to.be.an('object'); + expect(res.today).to.be.an('object'); + expect(res.list).to.be.an('array'); + expect(res.list).to.have.lengthOf.at.least(27); + return done(); + }).catch(done); + }); + it('List jadwal sholat', done => { + Promise.resolve(listJadwalSholat).then(res => { + expect(res).to.be.an('array'); + expect(res).to.have.lengthOf.at.least(316); + return done(); + }).catch(done); + }); + }); +}); +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/esm/religions/test.js.map b/node_modules/@bochilteam/scraper/lib/esm/religions/test.js.map new file mode 100644 index 000000000..1a85d5f61 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/esm/religions/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["../../../src/religions/test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAA;AAC7B,OAAO,EACL,WAAW,EAAE,eAAe,EAC5B,OAAO,EACP,YAAY,EAAE,gBAAgB,EAC/B,MAAM,YAAY,CAAA;AAEnB,QAAQ,CAAC,WAAW,EAAE,GAAG,EAAE;IACzB,QAAQ,CAAC,cAAc,EAAE,GAAG,EAAE;QAC5B,EAAE,CAAC,aAAa,EAAE,IAAI,CAAC,EAAE;YACvB,WAAW,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE;gBACvB,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAA;gBAC9B,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAA;gBACnC,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAA;gBACnC,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,C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G,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAA;gBAC9B,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAA;gBACpC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,OAAO,CAAC,CAAA;gBAClC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC,CAAA;gBAE9C,OAAO,IAAI,EAAE,CAAA;YACf,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;QAChB,CAAC,CAAC,CAAA;QAEF,EAAE,CAAC,oBAAoB,EAAE,IAAI,CAAC,EAAE;YAC9B,OAAO,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE;gBAC3C,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,OAAO,CAAC,CAAA;gBAC7B,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;gBAC1C,OAAO,IAAI,EAAE,CAAA;YACf,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;QAChB,CAAC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/esm/religions/types.js b/node_modules/@bochilteam/scraper/lib/esm/religions/types.js new file mode 100644 index 000000000..718fd38ae --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/esm/religions/types.js @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=types.js.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/esm/religions/types.js.map b/node_modules/@bochilteam/scraper/lib/esm/religions/types.js.map new file mode 100644 index 000000000..685a8071f --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/esm/religions/types.js.map @@ -0,0 +1 @@ +{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/religions/types.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/esm/social-media/aiovideodl.js b/node_modules/@bochilteam/scraper/lib/esm/social-media/aiovideodl.js new file mode 100644 index 000000000..ab078a0a3 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/esm/social-media/aiovideodl.js @@ -0,0 +1,24 @@ +import got from 'got'; +import { load } from 'cheerio'; +export default async function aiovideodl(url) { + var _a; + const resToken = await got('https://aiovideodl.ml/'); + const cookie = (_a = resToken.headers['set-cookie']) === null || _a === void 0 ? void 0 : _a.map(v => v.split(';')[0]).join('; ').trim(); + const $$ = load(resToken.body); + const token = $$('#token').val(); + const body = new URLSearchParams(); + body.append('url', url); + body.append('token', token); + return await got('https://aiovideodl.ml/wp-json/aio-dl/video-data/', { + method: 'post', + headers: { + 'content-type': 'application/x-www-form-urlencoded', + cookie: cookie || 'pll_language=en; _ga=GA1.2.946338805.1646539824; PHPSESSID=f5ec5a6eb553bf3a55508ad4ce2ed200; _gid=GA1.2.425279475.1647856193; _gat_gtag_UA_46116261_21=1', + origin: 'https://aiovideodl.ml', + referer: 'https://aiovideodl.ml/', + 'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.74 Safari/537.36' + }, + body: body.toString() + }).json(); +} +//# sourceMappingURL=aiovideodl.js.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/esm/social-media/aiovideodl.js.map b/node_modules/@bochilteam/scraper/lib/esm/social-media/aiovideodl.js.map new file mode 100644 index 000000000..0123f9bd5 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/esm/social-media/aiovideodl.js.map @@ -0,0 +1 @@ +{"version":3,"file":"aiovideodl.js","sourceRoot":"","sources":["../../../src/social-media/aiovideodl.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,KAAK,CAAA;AACrB,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAI9B,MAAM,CAAC,OAAO,CAAC,KAAK,UAAU,UAAU,CAAE,GAAW;;IACnD,MAAM,QAAQ,GAAG,MAAM,GAAG,CAAC,wBAAwB,CAAC,CAAA;IACpD,MAAM,MAAM,GAAG,MAAA,QAAQ,CAAC,OAAO,CAAC,YAAY,CAAC,0CAAE,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,IAAI,EAAE,IAAI,EAAE,CAAA;IAC1F,MAAM,EAAE,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAA;IAC9B,MAAM,KAAK,GAAG,EAAE,CAAC,QAAQ,CAAC,CAAC,GAAG,EAAY,CAAA;IAC1C,MAAM,IAAI,GAAG,IAAI,eAAe,EAAE,CAAA;IAClC,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,GAAG,CAAC,CAAA;IACvB,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,KAAK,CAAC,CAAA;IAC3B,OAAO,MAAM,GAAG,CAAC,kDAAkD,EAAE;QACnE,MAAM,EAAE,MAAM;QACd,OAAO,EAAE;YACP,cAAc,EAAE,mCAAmC;YACnD,MAAM,EAAE,MAAM,IAAI,0JAA0J;YAC5K,MAAM,EAAE,uBAAuB;YAC/B,OAAO,EAAE,wBAAwB;YACjC,YAAY,EAAE,oHAAoH;SACnI;QACD,IAAI,EAAE,IAAI,CAAC,QAAQ,EAAE;KACtB,CAAC,CAAC,IAAI,EAAc,CAAA;AACvB,CAAC"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/esm/social-media/facebook.js b/node_modules/@bochilteam/scraper/lib/esm/social-media/facebook.js new file mode 100644 index 000000000..9963ee745 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/esm/social-media/facebook.js @@ -0,0 +1,146 @@ +import cheerio from 'cheerio'; +import got from 'got'; +import { randomBytes } from '../encryptions/crypto.js'; +import { ScraperError, decodeSnapApp } from '../utils.js'; +// only support download video yet +export async function facebookdl(url) { + /* eslint no-mixed-spaces-and-tabs: ["error", "smart-tabs"] */ + const { data: { id, thumbnail, duration, a, av, v } } = await got('https://youtube4kdownloader.com/ajax/getLinks.php', { + headers: { + 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.110 Safari/537.36' + }, + searchParams: { + video: url, + rand: randomBytes(13) + } + }).json(); + const result = (a || []) + .concat(av) + .concat(v) + .map(({ size, ext, url, quality, vcodec, fid }) => { + const isVideo = ext === 'mp4'; + const isWebm = ext === 'webm'; + return { + size, + ext, + url, + quality, + vcodec, + fid, + isVideo: isVideo || isWebm, + isAudio: /audio/i.test(quality || '') || (isVideo && !isWebm) + }; + // ext webm video without audio + }); + if (!result.length) + throw new ScraperError(`Can't download!\n${JSON.stringify({ id, thumbnail, duration, a, av, v }, null, 2)}`); + return { + id, + thumbnail, + duration, + result + }; +} +export async function facebookdlv2(url) { + var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l; + const params = { + url: encodeURI(url) + }; + const res = await got + .post('https://snapsave.app/action.php', { + headers: { + accept: 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9', + 'accept-encoding': 'gzip, deflate, br', + 'accept-language': 'en-US,en;q=0.9', + 'content-type': 'application/x-www-form-urlencoded', + origin: 'https://snapsave.app', + referer: 'https://snapsave.app/', + 'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML,like Gecko) Chrome/96.0.4664.110 Safari/537.36' + }, + form: params + }).text(); + const decodeParams = (_b = (_a = res.split('))')[0] + .split('decodeURIComponent(escape(r))}(')[1]) === null || _a === void 0 ? void 0 : _a.split(',')) === null || _b === void 0 ? void 0 : _b.map(v => v.replace(/^"/, '') + .replace(/"$/, '').trim()); + let html; + if (!Array.isArray(decodeParams) || decodeParams.length !== 6) + html = (_c = (typeof res === 'string' ? JSON.parse(res) : res)) === null || _c === void 0 ? void 0 : _c.data; + else { + const decode = decodeSnapApp(...decodeParams); + html = (_j = (_h = (_g = (_f = (_e = (_d = decode === null || decode === void 0 ? void 0 : decode.split('("download-section").innerHTML = "')[1]) === null || _d === void 0 ? void 0 : _d.split('; parent.document.getElementById("inputData").remove();')[0]) === null || _e === void 0 ? void 0 : _e.split('
')) === null || _f === void 0 ? void 0 : _f.slice(1)) === null || _g === void 0 ? void 0 : _g.map(v => (v + '">').trim()).join()) === null || _h === void 0 ? void 0 : _h.split('
tbody > tr').each(function () { + var _a, _b; + const el = $(this).find('td'); + if (/tidak|no/i.test(el.eq(1).text())) { + const quality = (_b = (_a = el.eq(0).text().split('(')) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.trim(); + const url = el.eq(2).find('a[href]').attr('href'); + if (url) + result.push({ quality, url }); + } + }); + if (!result.length) + throw new ScraperError(`Can't download!\n${$.html()}`); + return { + id: ((_l = (_k = $('div.media-content > div.content > p > strong') + .text() + .split('#')) === null || _k === void 0 ? void 0 : _k[1]) === null || _l === void 0 ? void 0 : _l.trim()) || '', + title: $('div.media-content > div.content > p > strong').text(), + description: $('div.media-content > div.content > p > span.video-des').text(), + thumbnail: $('figure > p.image > img[src]').attr('src'), + result + }; +} +export async function facebookdlv3(url) { + var _a; + const payload = { + url + }; + const text = await got('https://www.getfvid.com/downloader', { + method: 'POST', + headers: { + accept: 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9', + 'accept-encoding': 'gzip, deflate, br', + 'accept-language': 'en-US,en;q=0.9', + 'content-type': 'application/x-www-form-urlencoded', + cookie: '_ga=GA1.2.887753826.1642391325; _gid=GA1.2.2022692773.1642391325; __gads=ID=4ea88e3817c8d71b-22332defffcf0045:T=1642391326:RT=1642391326:S=ALNI_MY3oJyiEG_b8KXZBJ7RqvN2Mn8wbw; XSRF-TOKEN=eyJpdiI6ImdNUElWWU83S01jOTdZeitCUWdkWXc9PSIsInZhbHVlIjoiTGxnaE9oRVJTKzA5NDBncUtBa0xEdCtqNHBJXC9ZMVFPR1U2RnBSYUFzZHltWElZS2VtVUltUTJ2TjB5V3pEeTYzRUNMcENjMURGSkhBXC9OUitpcjMrZz09IiwibWFjIjoiMTViZTNjZDI3ZTZmOTk2ZWRjOWM1NTA5MTU2NDFhYWFlMjIxNTQxZTJlYjliMjJiMzE3YzlkNGMxODc2NjhmMCJ9; laravel_session=eyJpdiI6IjhZbElIRmpLSkVqZGZpQXJoK2MzVHc9PSIsInZhbHVlIjoianBSSFhPb2t0RFY4Q1wvYkk1S3pxMUNxXC82b0U1NHZROTVpS1Z4dGhES3ZTYTNsenJUSXpwcWNMVDkwWFk4OUY1TitGNmlDK1RXbTVyREVzcHVoRnRidz09IiwibWFjIjoiY2U1YzI2ODZlYWI2NzFkZDU1NTQ5Zjk0M2NmMDc2MTZhY2M3ODQxYjljZGUzMDQwMTYxZGQwZGYxMDM3NDMyZSJ9; __cf_bm=ephRNXRqwgrTB4SmHlsudy886EfsR2Ns2KtXVBnph4I-1642392732-0-AXtTUW5HRNQUeUcTJPhJTOPlMcjBFmMyoLKYOnxrDZ6Fa06XaJ4pMNW9arLg4zco/ef+ji00IV8NZb0nGOAKgfg=; _gat=1; __atuvc=6%7C3; __atuvs=61e4e71d2b803588005; __atssc=google%3B3', + origin: 'https://www.getfvid.com', + referer: 'https://www.getfvid.com/', + 'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36' + }, + form: payload + }).text(); + const $ = cheerio.load(text); + const row = $('div.card > div.row > div'); + const thumbnail = (_a = /background-image: url\((.*?)\);/i.exec(row.eq(0).find('a[href]').attr('style'))) === null || _a === void 0 ? void 0 : _a[1]; + const result = []; + row.find('.btns-download > p > a[href]').each(function () { + var _a; + const el = $(this); + const url = el.attr('href'); + const info = el.text().trim(); + const isAudio = /audio/i.test(info); + const quality = isAudio ? 'audio' : (_a = /Download in (\w+) Quality/i.exec(info)) === null || _a === void 0 ? void 0 : _a[1]; + const isVideo = quality !== 'audio'; + if (url) { + result.push({ + url, + quality, + isAudio, + isVideo + }); + } + }); + if (!result.length) + throw new ScraperError(`Can't download!\n${$.html()}`); + return { + title: $('#title_video').val(), + thumbnail, + result + }; +} +//# sourceMappingURL=facebook.js.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/esm/social-media/facebook.js.map b/node_modules/@bochilteam/scraper/lib/esm/social-media/facebook.js.map new file mode 100644 index 000000000..aec7335bf --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/esm/social-media/facebook.js.map @@ -0,0 +1 @@ +{"version":3,"file":"facebook.js","sourceRoot":"","sources":["../../../src/social-media/facebook.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,SAAS,CAAA;AAC7B,OAAO,GAAG,MAAM,KAAK,CAAA;AACrB,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAA;AACtD,OAAO,EACL,YAAY,EACZ,aAAa,EACd,MAAM,aAAa,CAAA;AAiBpB,kCAAkC;AAClC,MAAM,CAAC,KAAK,UAAU,UAAU,CAAE,GAAW;IAC3C,8DAA8D;IAC9D,MAAM,EACJ,IAAI,EAAE,EAAE,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAC5C,GASG,MAAM,GAAG,CAAC,mDAAmD,EAAE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,8BAA8B,CAAC,CAAC,IAAI,CAAC;;QAC5C,MAAM,EAAE,GAAG,CAAC,CAAC,IAAI,CAAC,CAAA;QAClB,MAAM,GAAG,GAAG,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;QAC3B,MAAM,IAAI,GAAG,EAAE,CAAC,IAAI,EAAE,CAAC,IAAI,EAAE,CAAA;QAC7B,MAAM,OAAO,GAAG,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;QACnC,MAAM,OAAO,GAAG,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAA,4BAA4B,CAAC,IAAI,CAAC,IAAI,CAAC,0CAAG,CAAC,CAAC,CAAA;QAChF,MAAM,OAAO,GAAG,OAAO,KAAK,OAAO,CAAA;QACnC,IAAI,GAAG,EAAE;YACP,MAAM,CAAC,IAAI,CAAC;gBACV,GAAG;gBACH,OAAO;gBACP,OAAO;gBACP,OAAO;aACR,CAAC,CAAA;SACH;IACH,CAAC,CAAC,CAAA;IACF,IAAI,CAAC,MAAM,CAAC,MAAM;QAAE,MAAM,IAAI,YAAY,CAAC,oBAAoB,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAA;IAC1E,OAAO;QACL,KAAK,EAAE,CAAC,CAAC,cAAc,CAAC,CAAC,GAAG,EAAY;QACxC,SAAS;QACT,MAAM;KACP,CAAA;AACH,CAAC"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/esm/social-media/google-it.js b/node_modules/@bochilteam/scraper/lib/esm/social-media/google-it.js new file mode 100644 index 000000000..24f2bd40a --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/esm/social-media/google-it.js @@ -0,0 +1,59 @@ +import cheerio from 'cheerio'; +import got from 'got'; +export async function googleIt(query) { + const body = await got('https://www.google.com/search', { + searchParams: { + q: query + }, + headers: { + 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.110 Safari/537.36' + } + }).text(); + const $ = cheerio.load(body); + const infoEl = $('div.I6TXqe > div.osrp-blk'); + const info = { + title: infoEl.find('h2.qrShPb > span').text().trim(), + type: infoEl.find('div.SPZz6b > div.wwUB2c > span').text().trim(), + description: '', + image: [] + }; + infoEl + .find('div.LuVEUc > div.UDZeY > div.wDYxhc[data-attrid]:not(.NFQFxe)') + .each(function () { + const desc = $(this).text().trim(); + if (desc) + info.description += desc + '\n'; + }); + infoEl + .find('div[jscontroller=M0hWhd] > div[jscontroller=ABJeBb] > div.eA0Zlc[jsname=dTDiAc]') + .each(function () { + var _a, _b; + const img = (_a = $(this) + .find('a > g-img.BA0A6c > img.rISBZc') + .attr('src')) === null || _a === void 0 ? void 0 : _a.trim(); // you can make buffer using function fromBase64ToString + if (img) + (_b = info.image) === null || _b === void 0 ? void 0 : _b.push(img); + }); + info.image = [...new Set(info.image)]; + const articles = []; + $('div.tF2Cxc').each(function () { + const el = $(this); + const header = el.find('cite.iUh30').text(); + const title = el.find('div.yuRUbf > a > h3').text(); + const url = el.find('div.yuRUbf > a[href]').attr('href'); + const description = el.find('div.VwiC3b > span').text() || el.find('div.VwiC3b').text(); + if (el.length && url) { + articles.push({ + header: header, + title: title, + url, + description: description + }); + } + }); + return { + info, + articles + }; +} +//# sourceMappingURL=google-it.js.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/esm/social-media/google-it.js.map b/node_modules/@bochilteam/scraper/lib/esm/social-media/google-it.js.map new file mode 100644 index 000000000..36c08d8ce --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/esm/social-media/google-it.js.map @@ -0,0 +1 @@ +{"version":3,"file":"google-it.js","sourceRoot":"","sources":["../../../src/social-media/google-it.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,SAAS,CAAA;AAC7B,OAAO,GAAG,MAAM,KAAK,CAAA;AAGrB,MAAM,CAAC,KAAK,UAAU,QAAQ,CAAE,KAAa;IAC3C,MAAM,IAAI,GA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,MAAM,QAAQ,GAAyB,EAAE,CAAA;IACzC,CAAC,CAAC,YAAY,CAAC,CAAC,IAAI,CAAC;QACnB,MAAM,EAAE,GAAG,CAAC,CAAC,IAAI,CAAC,CAAA;QAClB,MAAM,MAAM,GAAG,EAAE,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,IAAI,EAAE,CAAA;QAC3C,MAAM,KAAK,GAAG,EAAE,CAAC,IAAI,CAAC,qBAAqB,CAAC,CAAC,IAAI,EAAE,CAAA;QACnD,MAAM,GAAG,GAAG,EAAE,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;QACxD,MAAM,WAAW,GAClB,EAAE,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,IAAI,EAAE,CAAA;QAClE,IAAI,EAAE,CAAC,MAAM,IAAI,GAAG,EAAE;YACpB,QAAQ,CAAC,IAAI,CAAC;gBACZ,MAAM,EAAE,MAAM;gBACd,KAAK,EAAE,KAAK;gBACZ,GAAG;gBACH,WAAW,EAAE,WAAW;aACzB,CAAC,CAAA;SACH;IACH,CAAC,CAAC,CAAA;IACF,OAAO;QACL,IAAI;QACJ,QAAQ;KACT,CAAA;AACH,CAAC"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/esm/social-media/groupWA.js b/node_modules/@bochilteam/scraper/lib/esm/social-media/groupWA.js new file mode 100644 index 000000000..d4a84d9a0 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/esm/social-media/groupWA.js @@ -0,0 +1,22 @@ +import got from 'got'; +import cheerio from 'cheerio'; +export async function groupWA(query) { + const html = await got(`http://ngarang.com/link-grup-wa/daftar-link-grup-wa.php?search=${encodeURIComponent(query).replace(/%20/g, '+')}&searchby=name`).text(); + const $ = cheerio.load(html); + const results = []; + $('div.entry > div.wa-chat').each((_, el) => { + const $el = $(el); + const $a = $el.find('a'); + const url = $a.find('div.wa-chat-title-container > a').attr('href') || + $el.find('div.wa-chat-message > a.URLMessage').attr('href'); + const subject = $el.find('div.wa-chat-title-text').text().trim(); + if (url) { + results.push({ + url, + subject + }); + } + }); + return results; +} +//# sourceMappingURL=groupWA.js.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/esm/social-media/groupWA.js.map b/node_modules/@bochilteam/scraper/lib/esm/social-media/groupWA.js.map new file mode 100644 index 000000000..2fbac4d77 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/esm/social-media/groupWA.js.map @@ -0,0 +1 @@ +{"version":3,"file":"groupWA.js","sourceRoot":"","sources":["../../../src/social-media/groupWA.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,KAAK,CAAA;AACrB,OAAO,OAAO,MAAM,SAAS,CAAA;AAG7B,MAAM,CAAC,KAAK,UAAU,OAAO,CAAE,KAAa;IAC1C,MAAM,IAAI,GAAG,MAAM,GAAG,CACpB,kEAAkE,kBAAkB,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,gBAAgB,CACjI,CAAC,IAAI,EAAE,CAAA;IACR,MAAM,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IAC5B,MAAM,OAAO,GAAc,EAAE,CAAA;IAC7B,CAAC,CAAC,yBAAyB,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE;QAC1C,MAAM,GAAG,GAAG,CAAC,CAAC,EAAE,CAAC,CAAA;QACjB,MAAM,EAAE,GAAG,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;QACxB,MAAM,GAAG,GAAG,EAAE,CAAC,IAAI,CAAC,iCAAiC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC;YACjE,GAAG,CAAC,IAAI,CAAC,oCAAoC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;QAC7D,MAAM,OAAO,GAAG,GAAG,CAAC,IAAI,CAAC,wBAAwB,CAAC,CAAC,IAAI,EAAE,CAAC,IAAI,EAAE,CAAA;QAChE,IAAI,GAAG,EAAE;YACP,OAAO,CAAC,IAAI,CAAC;gBACX,GAAG;gBACH,OAAO;aACR,CAAC,CAAA;SACH;IACH,CAAC,CAAC,CAAA;IACF,OAAO,OAAO,CAAA;AAChB,CAAC"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/esm/social-media/index.js b/node_modules/@bochilteam/scraper/lib/esm/social-media/index.js new file mode 100644 index 000000000..148dcca7a --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/esm/social-media/index.js @@ -0,0 +1,12 @@ +import youtubeSearch from './youtube-search.js'; +import { groupWA } from './groupWA.js'; +import aiovideodl from './aiovideodl.js'; +import savefrom from './savefrom.js'; +export * from './facebook.js'; +export * from './google-it.js'; +export * from './instagram.js'; +export * from './tiktok.js'; +export * from './twitter.js'; +export * from './youtube.js'; +export { youtubeSearch, groupWA, aiovideodl, savefrom }; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/esm/social-media/index.js.map b/node_modules/@bochilteam/scraper/lib/esm/social-media/index.js.map new file mode 100644 index 000000000..d783dcc7a --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/esm/social-media/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/social-media/index.ts"],"names":[],"mappings":"AAAA,OAAO,aAAa,MAAM,qBAAqB,CAAA;AAC/C,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AACtC,OAAO,UAAU,MAAM,iBAAiB,CAAA;AACxC,OAAO,QAAQ,MAAM,eAAe,CAAA;AAEpC,cAAc,eAAe,CAAA;AAC7B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,aAAa,CAAA;AAC3B,cAAc,cAAc,CAAA;AAC5B,cAAc,cAAc,CAAA;AAE5B,OAAO,EACL,aAAa,EACb,OAAO,EACP,UAAU,EACV,QAAQ,EACT,CAAA"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/esm/social-media/instagram.js b/node_modules/@bochilteam/scraper/lib/esm/social-media/instagram.js new file mode 100644 index 000000000..fbd9c490b --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/esm/social-media/instagram.js @@ -0,0 +1,378 @@ +/* eslint-disable no-mixed-spaces-and-tabs */ +import cheerio from 'cheerio'; +import got from 'got'; +import { ScraperError, decodeSnapApp } from '../utils.js'; +import Form from 'form-data'; +export async function instagramdl(url) { + var _a, _b, _c; + if (!/https?:\/\/www\.instagram\.com\/(reel|tv|p)\//i.test(url)) { + throw new ScraperError('Invalid url!!'); + } + const data = await got + .post('https://snapinsta.app/action.php', { + form: { + url: encodeURI(url), + action: 'post' + }, + headers: { + 'content-type': 'application/x-www-form-urlencoded', + origin: 'https://snapinsta.app', + referer: 'https://snapinsta.app/', + 'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.93 Safari/537.36' + } + }) + .text(); + const params = (_a = data.split('))')[0] + .split('decodeURIComponent(escape(r))}(')[1]) === null || _a === void 0 ? void 0 : _a.split(',').map(v => v.replace(/^"/, '') + .replace(/"$/, '').trim()); + if (!Array.isArray(params) || params.length !== 6) + throw new ScraperError(`Can't parse decode parameters!\n${data}`); + const decode = decodeSnapApp(...params); + const html = (_c = (_b = decode === null || decode === void 0 ? void 0 : decode.split('("div_download").innerHTML = "')) === null || _b === void 0 ? void 0 : _b[1].split('"; parent.document.getElementById("hero-section").remove();')[0].split('
')[1]) === null || _c === void 0 ? void 0 : _c.split('
')[0].replace(/\\(\\)?/g, ''); + const $ = cheerio.load(html); + const results = []; + $('.row.download-box > div.col-md-4').each(function () { + let thumbnail = $(this) + .find('.download-items__thumb > img[src]') + .attr('src'); + if (!/https?:\/\//i.test(thumbnail)) + thumbnail = 'https://snapinsta.app' + thumbnail; + let url = $(this).find('.download-items__btn > a[href]').attr('href'); + if (!/https?:\/\//i.test(url || '')) { + url = encodeURI('https://snapinsta.app' + url); + } + if (url) + results.push({ thumbnail, url }); + }); + if (!results.length) + throw new ScraperError(`Can't download!\n${decode}`); + return results; +} +export async function instagramdlv2(url) { + if (!/https?:\/\/www\.instagram\.com\/(reel|tv|p)\//i.test(url)) { + throw new ScraperError('Invalid url!!'); + } + const payload = { + url: url, + submit: ' ' + }; + const data = await got + .post('https://downloadgram.org/', { + form: payload, + headers: { + 'content-type': 'application/x-www-form-urlencoded', + cookie: '_ga=GA1.2.654346005.1642149344; _gid=GA1.2.1562255413.1642149344; _gat_gtag_UA_142480840_1=1; __atuvc=1%7C2; __atuvs=61e135df10258fab000; __gads=ID=b4c9d2019034e5ed-227b64f3e5cf003a:T=1642149344:RT=1642149344:S=ALNI_MbtRULwcpAb_-lCLCSUPN5m5rd54A', + origin: 'https://downloadgram.org', + referer: 'https://downloadgram.org/', + 'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.110 Safari/537.36' + } + }) + .text(); + const $ = cheerio.load(data); + let results = []; + if ($('#downloadBox > a').length) { + const temp = []; + $('#downloadBox > video').each(function (i) { + const thumbnail = $(this).attr('poster'); + const sourceUrl = $(this).find('source[src]').attr('src'); + if (thumbnail) { + temp.push({ + thumbnail, + sourceUrl, + index: i + }); + } + }); + $('#downloadBox > img').each(function (i) { + const j = temp.findIndex(({ index }) => index === i); + const thumbnail = $(this).attr('src'); + if (thumbnail) { + if (j !== -1) + temp[j].thumbnail = thumbnail; + else + temp.push({ thumbnail, index: i }); + } + }); + $('#downloadBox > a').each(function (i) { + const j = temp.findIndex(({ index }) => index === i); + const url = $(this).attr('href'); + if (j !== -1) + temp[j].url = url; + else + temp.push({ url, index: i }); + }); + results = temp.map((tmp) => ({ + thumbnail: tmp.thumbnail, + sourceUrl: tmp.sourceUrl, + url: tmp.url + })); + } + if (!results.length) + throw new ScraperError(`Can't download!\n${$.html()}`); + return results; +} +export async function instagramdlv3(url) { + const payload = { + link: url, + submit: '' + }; + const headers = { + 'content-type': 'application/x-www-form-urlencoded', + origin: 'https://instasave.website', + referer: 'https://instasave.website/', + 'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36' + }; + const body = await got('https://instasave.website/', { + form: payload, + method: 'POST', + headers: headers + }).catch(async (_) => await got('https://server.instasave.website/', { + form: payload, + method: 'POST', + headers: { + ...headers, + origin: 'https://server.instasave.website', + referer: 'https://server.instasave.website' + } + })); + const $ = cheerio.load(body.body); + let results = []; + if ($('#downloadBox > a').length) { + const temp = []; + $('#downloadBox > video').each(function (i) { + const thumbnail = $(this).attr('poster'); + const sourceUrl = $(this).find('source[src]').attr('src'); + if (thumbnail) { + temp.push({ + thumbnail, + sourceUrl, + index: i + }); + } + }); + $('#downloadBox > img').each(function (i) { + const j = temp.findIndex(({ index }) => index === i); + const thumbnail = $(this).attr('src'); + if (thumbnail) { + if (j !== -1) + temp[j].thumbnail = thumbnail; + else + temp.push({ thumbnail, index: i }); + } + }); + $('#downloadBox > a').each(function (i) { + const j = temp.findIndex(({ index }) => index === i); + const url = $(this).attr('href'); + if (j !== -1) + temp[j].url = url; + else + temp.push({ url, index: i }); + }); + results = temp.map((tmp) => ({ + thumbnail: tmp.thumbnail, + sourceUrl: tmp.sourceUrl, + url: tmp.url + })); + } + if (!results.length) + throw new ScraperError(`Can't download!\n${$.html()}`); + return results; +} +export async function instagramdlv4(url) { + var _a, _b; + const payload = { + url: encodeURIComponent(url) + }; + const data = await got('https://instadownloader.co/insta_downloader.php', { + headers: { + cookie: '_ga=GA1.2.1733350350.1642305936; __gads=ID=b4bd840227b997e8-22bf10a0f9cf00c8:T=1642305940:RT=1642305940:S=ALNI_MYAmf2IjxwGlzs5qXm4WFoP5pgocg; PHPSESSID=336eed35f823c84f35a580ae2f326934; _gid=GA1.2.1286454531.1646479747; _gat=1', + referer: 'https://instadownloader.co/id/', + 'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36' + }, + searchParams: payload + }).json(); + const json = JSON.parse(data); + if (!(((_a = json.images_links) === null || _a === void 0 ? void 0 : _a.length) || ((_b = json.videos_links) === null || _b === void 0 ? void 0 : _b.length))) + throw new ScraperError(`Can't download!\n${JSON.stringify(json, null, 2)}`); + return [ + ...json.images_links, + ...json.videos_links + ]; +} +// export async function instagramdlv5 (url: string): Promise { +// const json: { +// url: { +// url: string; +// name: string; +// type: string; +// ext: string; +// }[]; +// meta: { +// title: string; +// source: string; +// } +// thumb: string; +// [Key: string]: any +// } = await got('https://api.savefrom.biz/api/convert', { +// method: 'POST', +// headers: { +// 'content-type': 'application/json', +// origin: 'https://savefrom.biz', +// referer: 'https://savefrom.biz/', +// 'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.102 Safari/537.36' +// }, +// json: { +// url +// } +// }).json() +// return json.url.map(({ url, ext }) => ({ +// url: `https://savefrom.biz${encodeURIComponent(url)}`, +// ext +// })) as InstagramDownloaderV5[] +// } +export async function instagramStory(name) { + var _a; + const resKey = await got('https://storydownloader.app/en'); + const $$ = cheerio.load(resKey.body); + const _token = $$('input[name="_token"]').attr('value'); + const cookie = (_a = resKey.headers['set-cookie']) === null || _a === void 0 ? void 0 : _a.map(v => v.split('; ')[0]).join('; ').trim(); + const headers = { + accept: 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9', + cookie: cookie || 'locale=eyJpdiI6IjE5VUJqZm1DdXl3ODhoQnV2SHJaMFE9PSIsInZhbHVlIjoiUnBqZTMvbDFUTWZLWVkvQy9rVjVhOUdrbjRWTVRCYmp2aTVaUlVsUnZZY0RWN2ZoVkdjMVNhemM1MFl6eWt2dCIsIm1hYyI6IjdlMTc4ZDZkMTYyMDVmMTcwZTc5Nzg3YTBjM2ZkOWEyNjRlODZmZDIwOGY5OTgyYzQzZjE3YTY3MjQ2NGNlYzQiLCJ0YWciOiIifQ%3D%3D; _ga_ZXS0LB5VTY=GS1.1.1647856609.1.0.1647856609.0; _ga=GA1.1.1392191220.1647856609; XSRF-TOKEN=eyJpdiI6IkhjVVdRMmRSZ0tOaklvUHlncWxqeVE9PSIsInZhbHVlIjoiTkZLTnFmUnpjM0Y0KzF3NmpxNnMyMTJQWmNPRXFPVjlKQW9la3poN3kySEN4UUw0TUd3TGIzZ0plT2RUWXJGTEp1bzF1NkN2R3FrQkdLbmJpa0o4cUZUM2EzS2N4QTY2aGVKdFM0ZWNhclZBQVBhMDV1cm4vcEZFMVB5NXRLL1UiLCJtYWMiOiI4MjQ1ZDJhYWE2NjQ1MGUyMmY5ZmQ0OTlkMDFhNjZjOWE2MGVjMTRlNmFjN2VjMmNkYzA0OGY5OTRkMDY3MjI3IiwidGFnIjoiIn0%3D; laravel_session=eyJpdiI6IjQ2RHJ3TUtRU1gxblhpbGtsNXRqamc9PSIsInZhbHVlIjoiTFl2bTg5QVhxcHBkZUN2THRPYkxhbnBmWEkyaWdBc0RFbDM0eUhhbGY0RCs2NFFmRXQ2NXBaNktUMkVpYk9wcDF2SE11SUQ0bW9zazJYaUdLQVZFbjJTaXZ3MmREUEJURnczb1c4ZE5uNDJzTVprNytjNzVCT3loS1ovKysyR1oiLCJtYWMiOiIzOTAyMDc5MDg1N2UxZjgwYmExODcwMjQ2ZWQzNGJjODM3YzkxOTI2MTkwMTEzMTFjNjExN2IzZjdkMmY0ODI4IiwidGFnIjoiIn0%3D', + origin: 'https://storydownloader.app', + referer: 'https://storydownloader.app/en', + 'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.102 Safari/537.36', + 'X-CSRF-TOKEN': _token + }; + const formData = new Form(); + formData.append('username', name); + formData.append('_token', _token); + const res = await got('https://storydownloader.app/request', { + method: 'POST', + headers: { + ...headers, + ...formData.getHeaders() + }, + body: formData.getBuffer() + }); + const { html } = JSON.parse(res.body); + if (!html) + throw new ScraperError(`Can't download!\n${res.body}`); + const $ = cheerio.load(html); + const username = $('h3.card-title').text(); + const profilePicUrl = $('img.card-avatar').attr('src'); + const results = []; + $('div.row > div').each(function () { + const $el = $(this); + const thumbnail = $el.find('img').attr('src'); + const url = $el.find('a').attr('href'); + const type = /video_dashinit\.mp4/i.test(url) ? 'video' : 'image'; + const isVideo = type === 'video'; + if (thumbnail && url) { + results.push({ + thumbnail, + url, + type, + isVideo + }); + } + }); + return { + user: { + username, + profilePicUrl + }, + results + }; +} +export async function instagramStoryv2(name) { + const headers = { + accept: '*/*', + cookie: '_ga=GA1.2.1814586753.1642307018; _gid=GA1.2.136857157.1642307018; __gads=ID=6f5ca6608dd8b1e9-22e4ea18ffcf0077:T=1642307019:RT=1642307019:S=ALNI_MZA7NeGtOEcSPXyFhf4LY8w7Myg9g; PHPSESSID=1i9dscs75l6v2h17cvdtd587b4; _gat=1; FCNEC=[["AKsRol9R3FQaOjrrETFMIMIvWtuoY3xRHpQEPHMujRWOd_nxuLgWCSyYK9lLC3ev0L5V8fuaSIjhupCtaReRepP4qNvch536pzvrcU13Gh8CRHSEIh8O3zM42ASwGUQfjoKbxkTV1L15EA6O7FLZ-Qh3Fy1rvh_h8w=="],null,[]]', + 'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36' + }; + const data = await got('https://www.instagramsave.com/instagram-story-downloader.php', { + headers: { + ...headers, + accept: 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9', + referer: 'https://www.google.com/' + } + }).text(); + const $ = cheerio.load(data); + const payload = { + url: 'https://www.instagram.com/' + name, + action: 'story', + token: $('#token').val(), + json: '' + }; + const { user, medias: results, error } = await got('https://www.instagramsave.com/system/action.php', { + form: payload, + method: 'POST', + headers: { + ...headers, + 'content-type': 'application/x-www-form-urlencoded; charset=UTF-8', + origin: 'https://www.instagramsave.com', + referer: 'https://www.instagramsave.com/instagram-story-downloader.php' + } + }).json(); + if (error || !results) + throw new ScraperError(`Maybe user ${name} not have story!!\n${JSON.stringify({ user, results, payload }, null, 2)}`); + return { + user, + results: results.map(({ preview, url, downloadUrl, type, fileType }) => ({ + thumbnail: preview, + url: downloadUrl, + sourceUrl: url, + type, + fileType, + isVideo: type === 'video' + })) + }; +} +export async function instagramStalk(username) { + var _a, _b, _c, _d, _e, _f, _g, _h, _j; + const data = await got(`https://dumpor.com/search?query=${encodeURIComponent(username).replace(/%20/g, '+')}`).text(); + const $ = cheerio.load(data); + const accounts = []; + $('#nav-profiles > div > div.search-item').each(function () { + var _a, _b; + const el = $(this); + const url = (_a = el.find('.content__img-wrap > a') + .attr('href')) === null || _a === void 0 ? void 0 : _a.trim(); + if (url) { + accounts.push({ + url, + avatar: (_b = el.find('.content__img-wrap > a > img') + .attr('src')) === null || _b === void 0 ? void 0 : _b.trim(), + username: el.find('.content__text > a') + .text().trim() + }); + } + }); + const html = await got(`https://dumpor.com/${accounts[0].url}`).text(); + const $$ = cheerio.load(html); + const name = $$('div.user__title > a > h1').text().trim(); + const Uname = $$('div.user__title > h4').text().trim(); + const description = $$('div.user__info-desc').text().trim(); + const row = $$('#user-page > div.container > div > div > div:nth-child(1) > div > a'); + const postsH = (_a = row.eq(0).text().replace(/Posts/i, '')) === null || _a === void 0 ? void 0 : _a.trim(); + const followersH = (_b = row.eq(2).text().replace(/Followers/i, '')) === null || _b === void 0 ? void 0 : _b.trim(); + const followingH = (_c = row.eq(3).text().replace(/Following/i, '')) === null || _c === void 0 ? void 0 : _c.trim(); + const list = $$('ul.list > li.list__item'); + const posts = parseInt((_e = (_d = list.eq(0).text().replace(/Posts/i, '')) === null || _d === void 0 ? void 0 : _d.trim()) === null || _e === void 0 ? void 0 : _e.replace(/\s/g, '')); + const followers = parseInt((_g = (_f = list.eq(1).text().replace(/Followers/i, '')) === null || _f === void 0 ? void 0 : _f.trim()) === null || _g === void 0 ? void 0 : _g.replace(/\s/g, '')); + const following = parseInt((_j = (_h = list.eq(2).text().replace(/Following/i, '')) === null || _h === void 0 ? void 0 : _h.trim()) === null || _j === void 0 ? void 0 : _j.replace(/\s/g, '')); + return { + name, + username: Uname, + avatar: accounts[0].avatar, + description, + postsH, + posts, + followersH, + followers, + followingH, + following + }; +} +//# sourceMappingURL=instagram.js.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/esm/social-media/instagram.js.map b/node_modules/@bochilteam/scraper/lib/esm/social-media/instagram.js.map new file mode 100644 index 000000000..da049e5c5 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/esm/social-media/instagram.js.map @@ -0,0 +1 @@ +{"version":3,"file":"instagram.js","sourceRoot":"","sources":["../../../src/social-media/instagram.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,OAAO,OAAO,MAAM,SAAS,CAAA;AAC7B,OAAO,GAA0B,MAAM,KAAK,CAAA;AAS5C,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AACzD,OAAO,IAAI,MAAM,WAAW,CAAA;AAE5B,MAAM,CAAC,KAAK,UAAU,WAAW,CAAE,GAAW;;IAC5C,IAAI,CAAC,gDAAgD,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE;QAC/D,MAAM,IAAI,YAAY,CAAC,eAAe,CAAC,CAAA;KACxC;IAED,MAAM,IAAI,GAAG,MAAM,GAAG;SACnB,IAAI,CAAC,kCAAkC,EAAE;QACxC,IAAI,EAAE;YACJ,GAAG,EAAE,SAAS,CAAC,GAAG,CAAC;YACnB,MAAM,EAAE,MAAM;SACf;Q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I,EAAE,CAAA;IACrE,MAAM,UAAU,GAAG,MAAA,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC,YAAY,EAAE,EAAE,CAAC,0CAAE,IAAI,EAAE,CAAA;IACrE,MAAM,IAAI,GAAG,EAAE,CAAC,yBAAyB,CAAC,CAAA;IAC1C,MAAM,KAAK,GAAG,QAAQ,CACpB,MAAA,MAAA,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC,0CACnC,IAAI,EAAE,0CAAE,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAC/B,CAAA;IACD,MAAM,SAAS,GAAG,QAAQ,CACxB,MAAA,MAAA,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC,YAAY,EAAE,EAAE,CAAC,0CACvC,IAAI,EAAE,0CAAE,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAC/B,CAAA;IACD,MAAM,SAAS,GAAG,QAAQ,CACxB,MAAA,MAAA,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC,YAAY,EAAE,EAAE,CAAC,0CACvC,IAAI,EAAE,0CAAE,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAC/B,CAAA;IACD,OAAO;QACL,IAAI;QACJ,QAAQ,EAAE,KAAK;QACf,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,MAAM;QAC1B,WAAW;QACX,MAAM;QACN,KAAK;QACL,UAAU;QACV,SAAS;QACT,UAAU;QACV,SAAS;KACV,CAAA;AACH,CAAC"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/esm/social-media/savefrom.js b/node_modules/@bochilteam/scraper/lib/esm/social-media/savefrom.js new file mode 100644 index 000000000..66a559a1e --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/esm/social-media/savefrom.js @@ -0,0 +1,48 @@ +import got from 'got'; +import vm from 'vm'; +import { ScraperError } from '../utils.js'; +export default async function savefrom(url) { + var _a, _b; + let scriptJS = await got('https://worker.sf-tools.com/savefrom.php', { + method: 'POST', + headers: { + 'content-type': 'application/x-www-form-urlencoded', + origin: 'https://id.savefrom.net', + referer: 'https://id.savefrom.net/', + 'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.74 Safari/537.36' + }, + form: { + sf_url: encodeURI(url), + sf_submit: '', + new: 2, + lang: 'id', + app: '', + country: 'id', + os: 'Windows', + browser: 'Chrome', + channel: ' main', + 'sf-nomad': 1 + } + }).text(); + const executeCode = '[]["filter"]["constructor"](b).call(a);'; + if (scriptJS.indexOf(executeCode) === -1) + throw new ScraperError(`Cannot find execute code\n${scriptJS}`); + scriptJS = scriptJS.replace(executeCode, ` +try { + i++; + if (i === 2) scriptResult = ${executeCode.split('.call')[0]}.toString(); + else ( + ${executeCode.replace(/;/, '')} + ); +} catch {} +`); + const context = { + scriptResult: '', + i: 0 + }; + vm.createContext(context); + new vm.Script(scriptJS).runInContext(context); + const json = JSON.parse((_b = (_a = context.scriptResult.split('window.parent.sf.videoResult.show(')) === null || _a === void 0 ? void 0 : _a[1].split(');')) === null || _b === void 0 ? void 0 : _b[0]); + return json; +} +//# sourceMappingURL=savefrom.js.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/esm/social-media/savefrom.js.map b/node_modules/@bochilteam/scraper/lib/esm/social-media/savefrom.js.map new file mode 100644 index 000000000..a8988759d --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/esm/social-media/savefrom.js.map @@ -0,0 +1 @@ +{"version":3,"file":"savefrom.js","sourceRoot":"","sources":["../../../src/social-media/savefrom.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,KAAK,CAAA;AACrB,OAAO,EAAE,MAAM,I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AM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,MAAA,MAAA,OAAO,CAAC,YAAY,CAAC,KAAK,CAAC,oCAAoC,CAAC,0CAAG,CAAC,EAAE,KAAK,CAAC,IAAI,CAAC,0CAAG,CAAC,CAAC,CAAC,CAAA;IAC/G,OAAO,IAAI,CAAA;AACb,CAAC"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/esm/social-media/test.js b/node_modules/@bochilteam/scraper/lib/esm/social-media/test.js new file mode 100644 index 000000000..cfb0156df --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/esm/social-media/test.js @@ -0,0 +1,369 @@ +import { expect } from 'chai'; +import { googleIt, tiktokdl, tiktokdlv2, tiktokdlv3, +// tiktokfyp, +instagramdl, instagramdlv2, instagramdlv3, instagramdlv4, instagramStory, instagramStoryv2, instagramStalk, facebookdl, facebookdlv2, facebookdlv3, twitterdl, twitterdlv2, youtubedl, youtubedlv2, youtubedlv3, youtubeSearch, groupWA, aiovideodl, savefrom } from './index.js'; +describe('Social media', () => { + describe('Tiktok scraper', function () { + it('tiktokdl', function (done) { + tiktokdl('https://www.tiktok.com/@omagadsus/video/7025456384175017243?is_from_webapp=1&sender_device=pc&web_id6982004129280116226').then(function (res) { + expect(res).to.be.an('object'); + expect(res.author).to.be.an('object'); + expect(res.author.nickname).to.be.a('string'); + expect(res.description).to.be.a('string'); + expect(res.video).to.be.an('object'); + expect(res.video.no_watermark).to.be.a('string'); + expect(res.video.no_watermark2).to.be.a('string'); + expect(res.video.no_watermark_raw).to.be.a('string'); + return done(); + }).catch(done); + }); + it('tiktokdl v2', function (done) { + tiktokdlv2('https://www.tiktok.com/@omagadsus/video/7025456384175017243?is_from_webapp=1&sender_device=pc&web_id6982004129280116226').then(function (res) { + expect(res).to.be.an('object'); + expect(res.author).to.be.an('object'); + expect(res.author.unique_id).to.be.a('string'); + expect(res.author.nickname).to.be.a('string'); + expect(res.author.avatar).to.be.a('string'); + expect(res.video).to.be.an('object'); + expect(res.video.no_watermark).to.be.a('string'); + expect(res.video.no_watermark_hd).to.be.a('string'); + return done(); + }).catch(done); + }); + it('tiktokdl v3', function (done) { + tiktokdlv3('https://www.tiktok.com/@omagadsus/video/7025456384175017243?is_from_webapp=1&sender_device=pc&web_id6982004129280116226').then(function (res) { + expect(res).to.be.an('object'); + expect(res.author).to.be.an('object'); + expect(res.author.nickname).to.be.a('string'); + expect(res.author.avatar).to.be.a('string'); + expect(res.description).to.be.a('string'); + expect(res.video).to.be.an('object'); + expect(res.video.no_watermark).to.be.a('string'); + expect(res.video.no_watermark2).to.be.a('string'); + expect(res.music).to.be.a('string'); + return done(); + }).catch(done); + }); + // it('tiktokfyp', function (done) { + // tiktokfyp().then(function (res) { + // expect(res).to.be.an('array') + // expect(res.length).to.be.above(0) + // return done() + // }).catch(done) + // }) + // it('tiktokstalk', function (done) { + // tiktokstalk('Tiktok').then(function (res) { + // expect(res).to.be.an('object') + // // expect(res.username).to.be.a('string') + // // expect(res.profile).to.be.a('string') + // // expect(res.avatar).to.be.a('string') + // // expect(res.verified).to.be.a('boolean') Github action error! + // // expect(res.following).to.be.a('string') + // // expect(res.followers).to.be.a('string') + // // expect(res.likes).to.be.a('string') + // // expect(res.description).to.be.a('string') + // return done() + // }).catch(done) + // }) + }); + describe('Instagram', () => { + it('Instagram Downloader', done => { + // https://www.instagram.com/p/CaHpoweBjmx/?utm_source=ig_web_copy_link + instagramdl('https://www.instagram.com/reel/CXK49yFLtJ_/?utm_source=ig_web_copy_link').then(res => { + expect(res).to.be.an('array'); + expect(res).to.have.lengthOf.at.least(1); + res.forEach(({ thumbnail, url }) => { + expect(thumbnail).to.be.a('string'); + expect(url).to.be.a('string'); + }); + return done(); + }).catch(done); + }); + it('Instagram Downloader V2', done => { + instagramdlv2('https://www.instagram.com/reel/CXK49yFLtJ_/?utm_source=ig_web_copy_link').then(res => { + expect(res).to.be.an('array'); + expect(res).to.have.lengthOf.at.least(1); + res.forEach(({ thumbnail, url }) => { + expect(thumbnail).to.be.a('string'); + expect(url).to.be.a('string'); + }); + return done(); + }).catch(done); + }); + it('Instagram Downloader V3', done => { + instagramdlv3('https://www.instagram.com/reel/CXK49yFLtJ_/?utm_source=ig_web_copy_link').then(res => { + expect(res).to.be.an('array'); + expect(res).to.have.lengthOf.at.least(1); + res.forEach(({ thumbnail, url }) => { + expect(thumbnail).to.be.a('string'); + expect(url).to.be.a('string'); + }); + return done(); + }).catch(done); + }); + it('Instagram Downloader V4', done => { + instagramdlv4('https://www.instagram.com/reel/CXK49yFLtJ_/?utm_source=ig_web_copy_link').then(res => { + expect(res).to.be.an('array'); + expect(res).to.have.lengthOf.at.least(1); + res.forEach(({ thumbnail, url }) => { + expect(thumbnail).to.be.a('string'); + expect(url).to.be.a('string'); + }); + return done(); + }).catch(done); + }); + it('Instagram Story', function (done) { + instagramStory('raffinagita1717').then(res => { + expect(res).to.be.an('object'); + expect(res.user).to.be.an('object'); + expect(res.results).to.be.an('array'); + expect(res.results).to.have.lengthOf.at.least(1); + res.results.forEach(({ thumbnail, url, type, isVideo }) => { + expect(thumbnail).to.be.a('string'); + expect(url).to.be.a('string'); + expect(type).to.be.a('string'); + expect(isVideo).to.be.a('boolean'); + }); + return done(); + }).catch(done); + }); + it('Instagram Story V2', function (done) { + instagramStoryv2('raffinagita1717').then(res => { + expect(res).to.be.an('object'); + expect(res.user).to.be.an('object'); + expect(res.results).to.be.an('array'); + expect(res.results).to.have.lengthOf.at.least(1); + res.results.forEach(({ thumbnail, isVideo, url }) => { + expect(thumbnail).to.be.a('string'); + expect(isVideo).to.be.a('boolean'); + expect(url).to.be.a('string'); + }); + return done(); + }).catch(done); + }); + it('Instagram Stalk', done => { + instagramStalk('freefirebgid').then(res => { + expect(res).to.be.an('object'); + expect(res.name).to.be.a('string'); + expect(res.username).to.be.a('string'); + expect(res.description).to.be.a('string'); + expect(res.postsH).to.be.a('string'); + expect(res.posts).to.be.a('number'); + expect(res.followersH).to.be.a('string'); + expect(res.followers).to.be.a('number'); + expect(res.followingH).to.be.a('string'); + expect(res.following).to.be.a('number'); + return done(); + }).catch(done); + }); + }); + describe('Facebook (Metaverse :V)', function () { + it('Facebook Downloader', done => { + facebookdl('https://fb.watch/9WktuN9j-z/').then(res => { + expect(res).to.be.an('object'); + expect(res.id).to.be.a('string'); + expect(res.thumbnail).to.be.a('string'); + expect(res.duration).to.be.a('number'); + expect(res.result).to.be.an('array'); + expect(res.result).to.have.lengthOf.at.least(1); + res.result.forEach(({ ext, url, isVideo, isAudio }) => { + expect(ext).to.be.a('string'); + expect(url).to.be.a('string'); + expect(isVideo).to.be.a('boolean'); + expect(isAudio).to.be.a('boolean'); + }); + return done(); + }).catch(done); + }); + it('Facebook Downloader V2', done => { + facebookdlv2('https://fb.watch/9WktuN9j-z/').then(res => { + expect(res).to.be.an('object'); + expect(res.id).to.be.a('string'); + expect(res.title).to.be.a('string'); + expect(res.description).to.be.a('string'); + expect(res.thumbnail).to.be.a('string'); + expect(res.result).to.be.an('array'); + expect(res.result).to.have.lengthOf.at.least(1); + res.result.forEach(({ quality, url }) => { + expect(quality).to.be.a('string'); + expect(url).to.be.a('string'); + }); + return done(); + }).catch(done); + }); + it('Facebook Downloader V3', done => { + facebookdlv3('https://fb.watch/9WktuN9j-z/').then(res => { + expect(res).to.be.an('object'); + expect(res.title).to.be.a('string'); + expect(res.thumbnail).to.be.a('string'); + expect(res.result).to.be.an('array'); + expect(res.result).to.have.lengthOf.at.least(1); + res.result.forEach(({ url, quality, isAudio, isVideo }) => { + expect(url).to.be.a('string'); + expect(quality).to.be.a('string'); + expect(isAudio).to.be.a('boolean'); + expect(isVideo).to.be.a('boolean'); + }); + return done(); + }).catch(done); + }); + }); + describe('Twitter', () => { + it('Twitter Downloader', done => { + twitterdl('https://twitter.com/jen_degen/status/1458167531869458440?s=20').then(res => { + expect(res).to.be.an('array'); + res.forEach(({ quality, type, url, isVideo }) => { + expect(quality).to.be.a('string'); + expect(type).to.be.a('string'); + expect(url).to.be.a('string'); + expect(isVideo).to.be.a('boolean'); + }); + return done(); + }).catch(done); + }); + it('Twitter Downloader V2', done => { + twitterdlv2('https://twitter.com/jen_degen/status/1458167531869458440?s=20').then(res => { + expect(res).to.be.an('array'); + res.forEach(({ quality, type, url }) => { + expect(quality).to.be.a('string'); + expect(type).to.be.a('string'); + expect(url).to.be.a('string'); + }); + return done(); + }).catch(done); + }); + }); + describe('Youtube', function () { + it('Youtube Downloader', done => { + youtubedl('https://youtu.be/iik25wqIuFo').then(res => { + res.video['360p'].download().catch(done); + expect(res).to.be.an('object'); + expect(res.thumbnail).to.be.a('string'); + expect(res.title).to.be.a('string'); + expect(res.video).to.be.an('object'); + expect(res.audio).to.be.an('object'); + return done(); + }).catch(done); + }); + it('Youtube Downloader v2', done => { + youtubedlv2('https://youtu.be/iik25wqIuFo').then(res => { + res.video['240p'].download().catch(done); + expect(res).to.be.an('object'); + expect(res.thumbnail).to.be.a('string'); + expect(res.title).to.be.a('string'); + expect(res.video).to.be.an('object'); + expect(res.audio).to.be.an('object'); + return done(); + }).catch(done); + }); + it('Youtube Downloader v3', done => { + youtubedlv3('https://youtu.be/iik25wqIuFo').then(res => { + res.video['360'].download().catch(done); + expect(res).to.be.an('object'); + expect(res.thumbnail).to.be.a('string'); + expect(res.title).to.be.a('string'); + expect(res.video).to.be.an('object'); + expect(res.audio).to.be.an('object'); + return done(); + }).catch(done); + }); + it('Youtube Search', done => { + youtubeSearch('Minecraft').then(res => { + expect(res).to.be.an('object'); + expect(res.video).to.be.an('array'); + expect(res.video).to.have.lengthOf.at.least(1); + expect(res.channel).to.be.an('array'); + expect(res.playlist).to.be.an('array'); + return done(); + }).catch(done); + }); + }); + it('Google It', done => { + googleIt('Minecraft').then(res => { + expect(res).to.be.an('object'); + expect(res.info).to.be.an('object'); + expect(res.articles).to.be.an('array'); + expect(res.articles).to.have.lengthOf.at.least(1); + return done(); + }).catch(done); + }); + it('Group Whatsapp', done => { + groupWA('A').then(res => { + expect(res).to.be.an('array'); + expect(res).to.have.lengthOf.at.least(1); + res.forEach(({ url, subject }) => { + expect(url).to.be.a('string'); + expect(subject).to.be.a('string'); + }); + return done(); + }).catch(done); + }); + describe('aiovideodl', () => { + it('Tiktok download', done => { + aiovideodl('https://www.tiktok.com/@omagadsus/video/7025456384175017243?is_from_webapp=1&sender_device=pc&web_id6982004129280116226').then(res => { + expect(res).to.be.an('object'); + expect(res.medias).to.be.an('array'); + expect(res.medias).to.have.lengthOf.at.least(1); + expect(res.source).to.be.eq('tiktok'); + return done(); + }).catch(done); + }); + it('Facebook download', done => { + aiovideodl('https://fb.watch/9WktuN9j-z/').then(res => { + expect(res).to.be.an('object'); + expect(res.medias).to.be.an('array'); + expect(res.medias).to.have.lengthOf.at.least(1); + expect(res.source).to.be.eq('facebook'); + return done(); + }).catch(done); + }); + it('Twitter download', done => { + aiovideodl('https://twitter.com/jen_degen/status/1458167531869458440?s=20').then(res => { + expect(res).to.be.an('object'); + expect(res.medias).to.be.an('array'); + expect(res.medias).to.have.lengthOf.at.least(1); + expect(res.source).to.be.eq('twitter'); + return done(); + }).catch(done); + }); + }); + describe('Savefrom', () => { + it('Tiktok download', done => { + savefrom('https://www.tiktok.com/@omagadsus/video/7025456384175017243?is_from_webapp=1&sender_device=pc&web_id6982004129280116226').then(res => { + expect(res).to.be.an('object'); + expect(res.url).to.be.an('array'); + expect(res.url).to.have.lengthOf.at.least(1); + expect(res.hosting).to.be.eq('tiktok.com'); + return done(); + }).catch(done); + }); + it('Facebook download', done => { + savefrom('https://fb.watch/9WktuN9j-z/').then(res => { + expect(res).to.be.an('object'); + expect(res.url).to.be.an('array'); + expect(res.url).to.have.lengthOf.at.least(1); + expect(res.hosting).to.be.eq('facebook.com'); + return done(); + }).catch(done); + }); + it('Twitter download', done => { + savefrom('https://twitter.com/jen_degen/status/1458167531869458440?s=20').then(res => { + expect(res).to.be.an('object'); + expect(res.url).to.be.an('array'); + expect(res.url).to.have.lengthOf.at.least(1); + expect(res.hosting).to.be.eq('twitter.com'); + return done(); + }).catch(done); + }); + it('Instagram download', done => { + savefrom('https://www.instagram.com/reel/CXK49yFLtJ_/?utm_source=ig_web_copy_link').then(res => { + expect(res).to.be.an('object'); + expect(res.url).to.be.an('array'); + expect(res.url).to.have.lengthOf.at.least(1); + expect(res.hosting).to.be.eq('instagram.com'); + return done(); + }).catch(done); + }); + }); +}); +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/esm/social-media/test.js.map b/node_modules/@bochilteam/scraper/lib/esm/social-media/test.js.map new file mode 100644 index 000000000..bcd7a5ead --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/esm/social-media/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["../../../src/social-media/test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAA;AAC7B,OAAO,EACL,QAAQ,EACR,QAAQ,EACR,UAAU,EACV,UAAU;AACV,aAAa;AACb,WAAW,EACX,aAAa,EACb,aAAa,EACb,aAAa,EACb,cAAc,EACd,gBAAgB,EAChB,cAAc,EACd,UAAU,EACV,YAAY,EACZ,YAAY,EACZ,SAAS,EACT,WAAW,EACX,SAAS,EACT,WAAW,EACX,WAAW,EACX,aAAa,EACb,OAAO,EACP,UAAU,EACV,QAAQ,EACT,MAAM,YAAY,CAAA;AAEnB,QAAQ,CAAC,cAAc,EAAE,GAAG,EAAE;IAC5B,QAAQ,CAAC,gBAAgB,EAAE;QACzB,EAAE,CAAC,UAAU,EAAE,UAAU,IAAI;YAC3B,QAAQ,CAAC,yHAAyH,CAAC,CAAC,IAAI,CAAC,UAAU,GAAG;gBACpJ,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAA;gBAC9B,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAA;gB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CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;gBAC5C,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,eAAe,CAAC,CAAA;gBAC7C,OAAO,IAAI,EAAE,CAAA;YACf,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;QAChB,CAAC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/esm/social-media/tiktok.js b/node_modules/@bochilteam/scraper/lib/esm/social-media/tiktok.js new file mode 100644 index 000000000..1715fc7b1 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/esm/social-media/tiktok.js @@ -0,0 +1,167 @@ +import got from 'got'; +import cheerio from 'cheerio'; +import { ScraperError, decodeSnapApp } from '../utils.js'; +export async function tiktokdl(url) { + var _a, _b, _c, _d, _e, _f; + const resToken = await got('https://snaptik.app/ID'); + const cookie = (_a = resToken.headers['set-cookie']) === null || _a === void 0 ? void 0 : _a.map(v => v.split(';')[0]).join('; '); + const $$ = cheerio.load(resToken.body); + const html = await got('https://snaptik.app/abc.php', { + headers: { + cookie: cookie || 'PHPSESSID=gphtms9fofqm2fikr9ofqrld25; current_language=ID; ref=google; __cflb=04dToWzoGizosSfR1ww5Ce8foMmhJkC5absiUehuAK; _ga=GA1.2.500024560.1646295641; _gid=GA1.2.786638280.1646295641; __gads=ID=2d9fb59650bbba88-22611414cbd0004a:T=1646295642:RT=1646295642:S=ALNI_MbDUnOcA1ZoJcH9yeqYgALtEC3W2w; ads_new=1; __cfruid=e4d99b4f4c1cabd9c94cc558b0c7eee4d7508448-1646295654; _gat=1', + referer: 'https://snaptik.app/ID', + 'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.102 Safari/537.36' + }, + searchParams: { + url: encodeURI(url), + lang: 'ID', + token: $$('input[name="token"]').val() + } + }).text(); + const decodeParams = (_c = (_b = html.split('))')[0] + .split('decodeURIComponent(escape(r))}(')[1]) === null || _b === void 0 ? void 0 : _b.split(',')) === null || _c === void 0 ? void 0 : _c.map(v => v.replace(/^"/, '') + .replace(/"$/, '').trim()); + if (!Array.isArray(decodeParams) || decodeParams.length !== 6) + throw new ScraperError(`failed to parse decode params!\n${html}`); + const decode = decodeSnapApp(...decodeParams); + const result = (_f = (_e = (_d = decode.split('; elem.innerHTML = \\\'')) === null || _d === void 0 ? void 0 : _d[1].split('\\\'; parent.ga(')) === null || _e === void 0 ? void 0 : _e[0]) === null || _f === void 0 ? void 0 : _f.replace(/\\(\\)?/g, ''); + if (!result) + throw new ScraperError(`failed to parse html from decode!\n${decode}`); + const $ = cheerio.load(result); + const $snaptik_middle = $('.snaptikvid > div.snaptik-middle'); + const $a = $('#download-block > .abuttons').find('a'); + let no_watermark2 = $a.eq(1).attr('href'); + if (!/https?:\/\//.test(no_watermark2)) + no_watermark2 = `https://snaptik.app${no_watermark2}`; + return { + author: { + nickname: $snaptik_middle.find('h3').text() + }, + description: $snaptik_middle.find('span').text(), + video: { + no_watermark: $a.eq(0).attr('href'), + no_watermark2, + no_watermark_raw: $a.eq(2).attr('href') + } + }; +} +export async function tiktokdlv2(url) { + const data = await got + .post('https://api.tikmate.app/api/lookup', { + headers: { + accept: '*/*', + 'accept-language': 'en-US,en;q=0.9', + 'content-type': 'application/x-www-form-urlencoded; charset=UTF-8', + origin: 'https://tikmate.app', + referer: 'https://tikmate.app/', + 'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.110 Safari/537.36' + }, + form: { url } + }) + .json(); + return { + author: { + unique_id: data.author_id, + nickname: data.author_name, + avatar: data.author_avatar + }, + video: { + no_watermark: `https://tikmate.app/download/${data.token}/${data.id}.mp4`, + no_watermark_hd: `https://tikmate.app/download/${data.token}/${data.id}.mp4?hd=1` + } + }; +} +export async function tiktokdlv3(url) { + var _a; + const resToken = await got('https://ssstik.io/id'); + const cookie = (_a = resToken.headers['set-cookie']) === null || _a === void 0 ? void 0 : _a.map(v => v.split(';')[0]).join('; '); + const $$ = cheerio.load(resToken.body); + const postUrl = $$('#_gcaptcha_pt').attr('hx-post'); + const html = await got('https://ssstik.io' + postUrl, { + method: 'POST', + headers: { + 'content-type': 'application/x-www-form-urlencoded; charset=UTF-8', + cookie: cookie || 'PHPSESSID=gb6hgnvvpkfg28ulo80l1u2qrl; __cflb=02DiuEcwseaiqqyPC5pE7Qjdp2jcR2J5YEMX3jgTCHMYX; _ga=GA1.2.1294804934.1647840559; _gid=GA1.2.1211588131.1647840559; __gads=ID=3ba3f6d3a5959cb0-224bbeea15d100da:T=1647840559:RT=1647840559:S=ALNI_MYtTuJ9ICRAeHGfemUzb2rwyaT6lw; ga_show=2; _gat_UA-3524196-6=1', + 'hx-current-url': 'https://ssstik.io/id', + 'hx-request': 'true', + 'hx-target': 'target', + 'hx-trigger': ' _gcaptcha_pt', + origin: 'https://ssstik.io', + referer: 'https://ssstik.io/id', + 'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.74 Safari/537' + }, + form: { + id: encodeURI(url), + locale: 'id', + gc: 0, + tt: 0, + ts: 0 + } + }).text(); + const $ = cheerio.load(html); + const $img = $('img.u-round'); + const $a = $('a.pure-button'); + let no_watermark = $a.eq(0).attr('href'); + if (!/https?:\/\//.test(no_watermark)) + no_watermark = `https://ssstik.io${no_watermark}`; + return { + author: { + nickname: $img.attr('alt'), + avatar: $img.attr('src') + }, + description: $('p.maintext').text(), + video: { + no_watermark, + no_watermark2: $a.eq(1).attr('href') + }, + music: $a.eq(2).attr('href') + }; +} +export async function tiktokfyp() { + const data = await got('https://t.tiktok.com/api/recommend/item_list/?aid=1988&app_name=tiktok_web&device_platform=web_pc&device_id=6982004129280116226®ion=ID&priority_region=&os=windows&referer=&cookie_enabled=true&screen_width=1920&screen_height=1080&browser_language=en-US&browser_platform=Win32&browser_name=Mozilla&browser_version=5.0+(Windows+NT+10.0%3B+Win64%3B+x64)+AppleWebKit%2F537.36+(KHTML,+like+Gecko)+Chrome%2F96.0.4664.93+Safari%2F537.36&browser_online=true&verifyFp=verify_kx30laei_YkR2lQiI_UBWz_4MZK_ACKV_loiPDs4PyDtw&app_language=en&timezone_name=Asia%2FJakarta&is_page_visible=true&focus_state=true&is_fullscreen=false&history_len=2&battery_info=%7B%7D&count=30&itemID=1&language=en&from_page=fyp&insertedItemID=&versions=70232694,70338434,70001178,70138197,70156809&msToken=Wi63JD_P7xxD_7pFmaF_UcHM6oJwSKjR9wnfsMUaDdz51KLZ3J8tazDrcY2gh_t3PyG_5926qyw8g7DhrgFa3mbDmxLhzmLs_3l_sOk4zf6TdMqfAT51s_n8ZPG8vovv76h1kCkR&X-Bogus=DFSzswVOAxxANJf/SEhC1eM/W7oh&_signature=').json(); + return data.itemList || []; +} +// export async function tiktokstalk(name: string): Promise<{ +// username: string; +// profile: string; +// avatar: string; +// verified: boolean; +// following: string; +// followers: string; +// likes: string; +// description: string; +// }> { +// const { data } = await axios.get(`https://www.tiktok.com/@${name}?lang=en`, { +// headers: { +// accept: 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9', +// cookie: 'tt_csrf_token=hlVsM4KILUl4mGcUkB6w6FJR; s_v_web_id=verify_kx30laei_YkR2lQiI_UBWz_4MZK_ACKV_loiPDs4PyDtw; ttwid=1%7CY1AOcjfoIgvlYizkFtt8slCK0i4qZqApyt2VHzQW2jY%7C1639301134%7C43c115b2541a4ae28ba3b0f194641f223a4a3b18a3fcf83212c133eaf4518b04; msToken=9Ac544Pz7Cc_nUXjNNhx8MBVx96CEeL0mgtWiPUQ5Ef3XxRI81YIpRNDkWa3TM5mqAFr-rhaNE1HWEXop_kpLp4BTCqhLQdu3ppGSbLHhUnqEKmzpF86bWvmur5xyKDCVmE63Q==', +// 'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.93 Safari/537.36' +// } +// }) +// const $ = cheerio.load(data) +// let container = $('div.share-title-container > h2') +// let username = container.text()?.trim() +// let avatar = $('span.tiktok-avatar.tiktok-avatar-circle.avatar > img').attr('src') +// let verified = /verified$/.test(container.attr('class')) +// let profile = $('h1.share-sub-title > span.profile').text()?.trim() +// let stats = $('h2.count-infos > div.number') +// let following = stats.eq(0).find('strong').text()?.trim() +// let followers = stats.eq(1).find('strong').text()?.trim() +// let likes = stats.eq(2).find('strong').text()?.trim() +// let description = $('h2.share-desc').text()?.trim() +// return { +// username, +// profile, +// avatar, +// verified, +// following, +// followers, +// likes, +// description +// } +// } +// export async function tiktoksearch(query: string) { +// const { data } = await axios.get(`https://www.tiktok.com/search?q=${query}&t=${+new Date()}`) +// const $ = cheerio.load(data) +// } +//# sourceMappingURL=tiktok.js.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/esm/social-media/tiktok.js.map b/node_modules/@bochilteam/scraper/lib/esm/social-media/tiktok.js.map new file mode 100644 index 000000000..90cb43b58 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/esm/social-media/tiktok.js.map @@ -0,0 +1 @@ +{"version":3,"file":"tiktok.js","sourceRoot":"","sources":["../../../src/social-media/tiktok.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,KAAK,CAAA;AACrB,OAAO,OAAO,MAAM,SAAS,CAAA;AAC7B,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAQzD,MAAM,CAAC,KAAK,UAAU,QAAQ,CAAE,GAAW;;IACzC,MAAM,QAAQ,GAAG,MAAM,GAAG,CAAC,wBAAwB,CAAC,CAAA;IACpD,MAAM,MAAM,GAAG,MAAA,QAAQ,CAAC,OAA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QAAwB,IAAI,EAAE,CAAA;AAC7C,CAAC;AAED,6DAA6D;AAC7D,wBAAwB;AACxB,uBAAuB;AACvB,sBAAsB;AACtB,yBAAyB;AACzB,yBAAyB;AACzB,yBAAyB;AACzB,qBAAqB;AACrB,2BAA2B;AAC3B,OAAO;AACP,oFAAoF;AACpF,qBAAqB;AACrB,iKAAiK;AACjK,0ZAA0Z;AAC1Z,iJAAiJ;AACjJ,YAAY;AACZ,SAAS;AACT,mCAAmC;AACnC,0DAA0D;AAC1D,8CAA8C;AAC9C,yFAAyF;AACzF,+DAA+D;AAC/D,0EAA0E;AAC1E,mDAAmD;AACnD,gEAAgE;AAChE,gEAAgE;AAChE,4DAA4D;AAC5D,0DAA0D;AAC1D,eAAe;AACf,oBAAoB;AACpB,mBAAmB;AACnB,kBAAkB;AAClB,oBAAoB;AACpB,qBAAqB;AACrB,qBAAqB;AACrB,iBAAiB;AACjB,sBAAsB;AACtB,QAAQ;AACR,IAAI;AAEJ,sDAAsD;AACtD,oGAAoG;AACpG,mCAAmC;AACnC,IAAI"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/esm/social-media/twitter.js b/node_modules/@bochilteam/scraper/lib/esm/social-media/twitter.js new file mode 100644 index 000000000..d90de3c63 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/esm/social-media/twitter.js @@ -0,0 +1,78 @@ +import cheerio from 'cheerio'; +import got from 'got'; +import { ScraperError } from '../utils.js'; +export async function twitterdl(url) { + if (!/https:\/\/twitter\.com\//i.test(url)) + throw new ScraperError('URL invalid!'); + const payload = { url }; + const res = await got('https://www.expertsphp.com/instagram-reels-downloader.php', { + method: 'POST', + searchParams: new URLSearchParams(Object.entries(payload)), + headers: { + 'content-type': 'application/x-www-form-urlencoded', + cookie: '_ga=GA1.2.783835709.1637038175; __gads=ID=5b4991618655cd86-22e2c7aeadce00ae:T=1637038176:RT=1637038176:S=ALNI_MaCe3McPrVVswzBEqcQlgnVZXtZ1g; _gid=GA1.2.1817576486.1639614645; _gat_gtag_UA_120752274_1=1', + origin: 'https://www.expertsphp.com', + referer: 'https://www.expertsphp.com/twitter-video-downloader.html', + 'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.110 Safari/537.36' + } + }).text(); + const $ = cheerio.load(res); + const results = []; + $('table.table > tbody > tr').each(function () { + const quality = $(this).find('td').eq(2).find('strong').text(); + const type = $(this).find('td').eq(1).find('strong').text(); + const url = $(this).find('td').eq(0).find('a[href]').attr('href'); + const isVideo = /video/i.test(type); + if (url) { + results.push({ + quality, + type, + url, + isVideo + }); + } + }); + return results; +} +export async function twitterdlv2(url) { + const resToken = await got('https://twittervideodownloader.com/', { + headers: { + accept: 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9', + 'accept-encoding': 'gzip, deflate, br', + cookie: 'csrftoken=au5r4nZ6uN48szGKtaEYp4sh4hBWSbL72M7LggD0nPUh8JGajAI403UIpWhrc5dU; _ga=GA1.2.1240680676.1641628632; _gid=GA1.2.414203301.1641628632; __qca=P0-603222438-1641628633090; _pbjs_userid_consent_data=6683316680106290; _pubcid=529c1986-42d2-4dec-a0e8-3a7d7c453add; __gads=ID=c7fcfc8de61626ad:T=1641628636:S=ALNI_MaE6t3k60TjxfxOEU_7fiYOKTdg8Q; session_id=6831c9ed-aeaf-47cd-a4ea-fdf1667efea2; _gat=1; cto_bundle=3Tj6Hl93WmQzcHglMkJDRmdjWnFTYWg1ZHpLeWE5allVRUU2dlFOU1huayUyRjFTM0xYJTJCSzhsajNRRkF1Q2N2OU9JS1NlSjlxWmYzRTFqSzRuaSUyQjlacHNtYXFSRTV1UHZ1UE42djg4TUJuN05FaVdwTTR4c1hkSUlCRlY4WkJaSmd2WXhLc1NDdHRrRm44c25yeTIwMkRRRSUyQkhJalMlMkJBZ3YxZzZwck5VdTIwclNoMkRvbzglM0Q; cto_bundle=3YOlHV93WmQzcHglMkJDRmdjWnFTYWg1ZHpLeVhBUGgzakxaV0xpZTJpJTJCQ3ZDVDd6SyUyQmJsdmxXcW8lMkZtZkZoMVlNNlJ4SU0xaUVxZXg0eGptZU1oZU4xOHIlMkZaamxlY3gwYnJ1ZSUyQkpVVTUyV2p0cm9PNkFRNEl3ZVBoaUtNSmpnNWRjeWtrWktoYTIzV1ZUdEJ6bFZDTWtCSDV4UWdWV2JPbGZJMzBzM2lxaVVRanNWSkElM0Q; cto_bidid=19sjyV9TQVBXTlA4SGwxYUt5Z0JqVFlHUSUyRk1QZ3Vwa1BaUGZubk1meUVmYSUyQmRSSzBUTkdGQiUyQll0bThNbWVGbjVxV293a2RDUVEzNTFvdVZxR09vaWxSWlE4a2lKTVQwYnp3JTJGV05GV0g2UUxWMnc5N2RJWG1NZGtKVWdiRm1WYXNqU0Ey', + 'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.110 Safari/537.36' + } + }).text(); + const $ = cheerio.load(resToken); + const payload = { + csrfmiddlewaretoken: $('input[name="csrfmiddlewaretoken"]').val(), + tweet: url + }; + const res = await got + .post('https://twittervideodownloader.com/download', { + form: payload, + headers: { + accept: 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9', + 'accept-encoding': 'gzip, deflate, br', + 'content-type': 'application/x-www-form-urlencoded', + cookie: 'csrftoken=au5r4nZ6uN48szGKtaEYp4sh4hBWSbL72M7LggD0nPUh8JGajAI403UIpWhrc5dU; _ga=GA1.2.1240680676.1641628632; _gid=GA1.2.414203301.1641628632; __qca=P0-603222438-1641628633090; _pbjs_userid_consent_data=6683316680106290; _pubcid=529c1986-42d2-4dec-a0e8-3a7d7c453add; __gads=ID=c7fcfc8de61626ad:T=1641628636:S=ALNI_MaE6t3k60TjxfxOEU_7fiYOKTdg8Q; session_id=6831c9ed-aeaf-47cd-a4ea-fdf1667efea2; cto_bundle=3Tj6Hl93WmQzcHglMkJDRmdjWnFTYWg1ZHpLeWE5allVRUU2dlFOU1huayUyRjFTM0xYJTJCSzhsajNRRkF1Q2N2OU9JS1NlSjlxWmYzRTFqSzRuaSUyQjlacHNtYXFSRTV1UHZ1UE42djg4TUJuN05FaVdwTTR4c1hkSUlCRlY4WkJaSmd2WXhLc1NDdHRrRm44c25yeTIwMkRRRSUyQkhJalMlMkJBZ3YxZzZwck5VdTIwclNoMkRvbzglM0Q; cto_bundle=ZKGKs193WmQzcHglMkJDRmdjWnFTYWg1ZHpLeWF0Z3V5SVY2JTJGTDNCd3A1MHVWVmJMWCUyQjdLTHh2MGZjRzh3ZU5CdWs4TEJyWTNmN2IlMkZuUCUyQiUyRlBDazBORUZIM2d3d0NUR2E3VWh6bmhxNzNDMm9mQUtnTVNPMjBiOUxpSXNXZGoydGxlZjB0YTZIbkNCeU91NnZ2Y0xUJTJGV0ppYkJ0JTJCZlIxYW8yNXBGRXdLaG1Za3RWZzJrJTNE; cto_bidid=U6ndml9TQVBXTlA4SGwxYUt5Z0JqVFlHUSUyRk1QZ3Vwa1BaUGZubk1meUVmYSUyQmRSSzBUTkdGQiUyQll0bThNbWVGbjVxV293a2RDUVEzNTFvdVZxR09vaWxSWlE4a2lKTVQwYnp3JTJGV05GV0g2UUxWMnc5VkJXSFlsN2x6cExKb3pPQTAzWEZZ', + origin: 'https://twittervideodownloader.com', + referer: 'https://twittervideodownloader.com/', + 'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.110 Safari/537.36' + } + }) + .text(); + const results = []; + const $$ = cheerio.load(res); + $$('div.row.body-container > div > center > div.row').each(function () { + var _a, _b; + const el = $(this).find('div'); + const _quality = el.eq(1).find('p').text().split(':'); + const quality = (_a = _quality === null || _quality === void 0 ? void 0 : _quality[0]) === null || _a === void 0 ? void 0 : _a.trim(); + const type = (_b = _quality === null || _quality === void 0 ? void 0 : _quality[1]) === null || _b === void 0 ? void 0 : _b.trim(); + const url = el.eq(0).find('a[download]').attr('href'); + results.push({ quality, type, url }); + }); + return results; +} +//# sourceMappingURL=twitter.js.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/esm/social-media/twitter.js.map b/node_modules/@bochilteam/scraper/lib/esm/social-media/twitter.js.map new file mode 100644 index 000000000..70701e271 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/esm/social-media/twitter.js.map @@ -0,0 +1 @@ +{"version":3,"file":"twitter.js","sourceRoot":"","sources":["../../../src/social-media/twitter.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,SAAS,CAAA;AAC7B,OAAO,GAAG,MAAM,KAAK,CAAA;AAMrB,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAE1C,MAAM,CAAC,KAAK,UAAU,SAAS,CAC7B,GAAW;IAEX,IAAI,CAAC,2BAA2B,CAAC,IAAI,CAAC,GAAG,CAAC;QAAE,MAAM,IAAI,YAAY,CAAC,cAAc,CAAC,CAAA;IAClF,MAAM,OAAO,GAAoB,EAAE,GAAG,EAAE,CAAA;IACxC,MAAM,GAAG,GAAG,MAAM,GAAG,CACnB,2DAA2D,EAC3D;QACE,MAAM,EAAE,MAAM;QACd,YAAY,EAAE,IAAI,eAAe,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;QAC1D,OAAO,EAAE;YACP,cAAc,EAAE,mCAAmC;YACnD,MAAM,EACT,2MAA2M;YACxM,MAAM,EAAE,4BAA4B;YACpC,OAAO,EAAE,0DAA0D;YACnE,YAAY,EACf,qHAAqH;SACnH;KACF,CACF,CAAC,IAAI,EAAE,CAAA;IACR,MAAM,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;IAC3B,MAAM,OAAO,GAAwB,EAAE,CAAA;IACvC,CAAC,CAAC,0BAA0B,CAAC,CAAC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_modules/@bochilteam/scraper/lib/esm/social-media/types.js b/node_modules/@bochilteam/scraper/lib/esm/social-media/types.js new file mode 100644 index 000000000..718fd38ae --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/esm/social-media/types.js @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=types.js.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/esm/social-media/types.js.map b/node_modules/@bochilteam/scraper/lib/esm/social-media/types.js.map new file mode 100644 index 000000000..d4daf0977 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/esm/social-media/types.js.map @@ -0,0 +1 @@ +{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/social-media/types.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/esm/social-media/youtube-search.js b/node_modules/@bochilteam/scraper/lib/esm/social-media/youtube-search.js new file mode 100644 index 000000000..0eff900b5 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/esm/social-media/youtube-search.js @@ -0,0 +1,124 @@ +import cheerio from 'cheerio'; +import got from 'got'; +export default async function youtubeSearch(query) { + const body = await got('https://www.youtube.com/results', { + headers: { + 'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.110 Safari/537.36' + }, + searchParams: { + search_query: query + } + }).text(); + const $ = cheerio.load(body); + let sc; + $('script').map(function () { + const el = $(this).html(); + let regex; + if ((regex = /var ytInitialData = /gi.exec(el || ''))) { + sc = JSON.parse(regex.input.replace(/^var ytInitialData = /i, '').replace(/;$/, '')); + } + return regex && sc; + }); + const results = { video: [], channel: [], playlist: [] }; + sc.contents.twoColumnSearchResultsRenderer.primaryContents + .sectionListRenderer.contents[0].itemSectionRenderer.contents.forEach((v) => { + var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13; + const typeName = Object.keys(v)[0]; + const result = v[typeName]; + if (['horizontalCardListRenderer', 'shelfRenderer'].includes(typeName)) { + return; + } // Todo: add this result as results + const isChannel = typeName === 'channelRenderer'; + const isVideo = typeName === 'videoRenderer'; + const isMix = typeName === 'radioRenderer'; + if (isVideo) { + const view = ((_a = result.viewCountText) === null || _a === void 0 ? void 0 : _a.simpleText) || + ((_b = result.shortViewCountText) === null || _b === void 0 ? void 0 : _b.simpleText) || + ((_d = (_c = result.shortViewCountText) === null || _c === void 0 ? void 0 : _c.accessibility) === null || _d === void 0 ? void 0 : _d.accessibilityData.label); + const _duration = (_f = (_e = result.thumbnailOverlays) === null || _e === void 0 ? void 0 : _e.find((v) => Object.keys(v)[0] === 'thumbnailOverlayTimeStatusRenderer')) === null || _f === void 0 ? void 0 : _f.thumbnailOverlayTimeStatusRenderer.text; + const videoId = result.videoId; + const duration = ((_g = result.lengthText) === null || _g === void 0 ? void 0 : _g.simpleText) || (_duration === null || _duration === void 0 ? void 0 : _duration.simpleText); + let durationS = 0; + (_h = ((duration === null || duration === void 0 ? void 0 : duration.split('.').length) && duration.indexOf(':') === -1 + ? duration.split('.') + : duration === null || duration === void 0 ? void 0 : duration.split(':'))) === null || _h === void 0 ? void 0 : _h.forEach((v, i, arr) => (durationS += + durationMultipliers[arr.length]['' + i] * parseInt(v))); + results.video.push({ + authorName: (_l = (((_j = result.ownerText) === null || _j === void 0 ? void 0 : _j.runs) || + ((_k = result.longBylineText) === null || _k === void 0 ? void 0 : _k.runs) || + [])[0]) === null || _l === void 0 ? void 0 : _l.text, + authorAvatar: (_p = (_o = (_m = result.channelThumbnailSupportedRenderers) === null || _m === void 0 ? void 0 : _m.channelThumbnailWithLinkRenderer.thumbnail.thumbnails) === null || _o === void 0 ? void 0 : _o.filter(({ url }) => url)) === null || _p === void 0 ? void 0 : _p.pop().url, + videoId, + url: encodeURI('https://www.youtube.com/watch?v=' + videoId), + thumbnail: result.thumbnail.thumbnails.pop().url, + title: (_t = (((_r = (_q = result.title) === null || _q === void 0 ? void 0 : _q.runs.find((v) => v.text)) === null || _r === void 0 ? void 0 : _r.text) || + ((_s = result.title) === null || _s === void 0 ? void 0 : _s.accessibility.accessibilityData.label))) === null || _t === void 0 ? void 0 : _t.trim(), + description: (_y = (_x = (_w = (_v = (_u = result.detailedMetadataSnippets) === null || _u === void 0 ? void 0 : _u[0]) === null || _v === void 0 ? void 0 : _v.snippetText.runs) === null || _w === void 0 ? void 0 : _w.filter(({ text }) => text)) === null || _x === void 0 ? void 0 : _x.map(({ text }) => text)) === null || _y === void 0 ? void 0 : _y.join(''), + publishedTime: (_z = result.publishedTimeText) === null || _z === void 0 ? void 0 : _z.simpleText, + durationH: ((_0 = result.lengthText) === null || _0 === void 0 ? void 0 : _0.accessibility.accessibilityData.label) || + (_duration === null || _duration === void 0 ? void 0 : _duration.accessibility.accessibilityData.label), + durationS, + duration, + viewH: view, + view: (_1 = (((view === null || view === void 0 ? void 0 : view.indexOf('x')) === -1 + ? view === null || view === void 0 ? void 0 : view.split(' ')[0] + : view === null || view === void 0 ? void 0 : view.split('x')[0]) || view)) === null || _1 === void 0 ? void 0 : _1.trim(), + type: typeName.replace(/Renderer/i, '') + }); + } + if (isChannel) { + const channelId = result.channelId; + const _subscriber = ((_2 = result.subscriberCountText) === null || _2 === void 0 ? void 0 : _2.accessibility.accessibilityData.label) || + ((_3 = result.subscriberCountText) === null || _3 === void 0 ? void 0 : _3.simpleText); + results.channel.push({ + channelId, + url: encodeURI('https://www.youtube.com/channel/' + channelId), + channelName: result.title.simpleText || + ((_5 = (_4 = result.shortBylineText) === null || _4 === void 0 ? void 0 : _4.runs.find((v) => v.text)) === null || _5 === void 0 ? void 0 : _5.text), + avatar: 'https:' + + ((_6 = result.thumbnail.thumbnails + .filter(({ url }) => url)) === null || _6 === void 0 ? void 0 : _6.pop().url), + isVerified: ((_7 = result.ownerBadges) === null || _7 === void 0 ? void 0 : _7.pop().metadataBadgeRenderer.style) === + 'BADGE_STYLE_TYPE_VERIFIED', + subscriberH: _subscriber === null || _subscriber === void 0 ? void 0 : _subscriber.trim(), + subscriber: _subscriber === null || _subscriber === void 0 ? void 0 : _subscriber.split(' ')[0], + videoCount: parseInt((_9 = (_8 = result.videoCountText) === null || _8 === void 0 ? void 0 : _8.runs[0]) === null || _9 === void 0 ? void 0 : _9.text), + description: (_13 = (_12 = (_11 = (_10 = result.descriptionSnippet) === null || _10 === void 0 ? void 0 : _10.runs) === null || _11 === void 0 ? void 0 : _11.filter(({ text }) => text)) === null || _12 === void 0 ? void 0 : _12.map(({ text }) => text)) === null || _13 === void 0 ? void 0 : _13.join(''), + type: typeName.replace(/Renderer/i, '') + }); + } + if (isMix) { + results.playlist.push({ + playlistId: result.playlistId, + title: result.title.simpleText, + thumbnail: result.thumbnail.thumbnails.pop().url, + video: result.videos.map(({ childVideoRenderer }) => { + return { + videoId: childVideoRenderer.videoId, + title: childVideoRenderer.title.simpleText, + durationH: childVideoRenderer.lengthText.accessibility + .accessibilityData.label, + duration: childVideoRenderer.lengthText.simpleText + }; + }), + type: 'mix' + }); + } + }); + return results; +} +const durationMultipliers = { + 1: { + 0: 1 + }, + 2: { + 0: 60, + 1: 1 + }, + 3: { + 0: 3600, + 1: 60, + 2: 1 + } +}; +//# sourceMappingURL=youtube-search.js.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/esm/social-media/youtube-search.js.map b/node_modules/@bochilteam/scraper/lib/esm/social-media/youtube-search.js.map new file mode 100644 index 000000000..4eb77da3c --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/esm/social-media/youtube-search.js.map @@ -0,0 +1 @@ +{"version":3,"file":"youtube-search.js","sourceRoot":"","sources":["../../../src/social-media/youtube-search.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,SAAS,CAAA;AAC7B,OAAO,GAAG,MAAM,KAAK,CAAA;AAIrB,MAAM,CAAC,OAAO,CAAC,KAAK,UAAU,aAAa,CACzC,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AAC,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,kBAAkB,EAA0B,EAAE,EAAE;oBAC1E,OAAO;wBACL,OAAO,EAAE,kBAAkB,CAAC,OAAO;wBACnC,KAAK,EAAE,kBAAkB,CAAC,KAAK,CAAC,UAAU;wBAC1C,SAAS,EACP,kBAAkB,CAAC,UAAU,CAAC,aAAa;6BACxC,iBAAiB,CAAC,KAAK;wBAC5B,QAAQ,EAAE,kBAAkB,CAAC,UAAU,CAAC,UAAU;qBACnD,CAAA;gBACH,CAAC,CAAC;gBACF,IAAI,EAAE,KAAK;aACZ,CAAC,CAAA;SACH;IACH,CAAC,CAAC,CAAA;IACF,OAAO,OAAO,CAAA;AAChB,CAAC;AAED,MAAM,mBAAmB,GAAiD;IACxE,CAAC,EAAE;QACD,CAAC,EAAE,CAAC;KACL;IACD,CAAC,EAAE;QACD,CAAC,EAAE,EAAE;QACL,CAAC,EAAE,CAAC;KACL;IACD,CAAC,EAAE;QACD,CAAC,EAAE,IAAI;QACP,CAAC,EAAE,EAAE;QACL,CAAC,EAAE,CAAC;KACL;CACF,CAAA"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/esm/social-media/youtube.js b/node_modules/@bochilteam/scraper/lib/esm/social-media/youtube.js new file mode 100644 index 000000000..85fbbf5ea --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/esm/social-media/youtube.js @@ -0,0 +1,269 @@ +import cheerio from 'cheerio'; +import got from 'got'; +import { ScraperError } from '../utils.js'; +import { sizeFormatter } from 'human-readable'; +const toFormat = sizeFormatter({ + std: 'JEDEC', + decimalPlaces: 2, + keepTrailingZeroes: false, + render: (literal, symbol) => `${literal} ${symbol}B` +}); +// https://github.com/BochilGaming/games-wabot/blob/main/lib/y2mate.js +const servers = ['en163', 'id90', 'en172']; +export async function youtubedl(url, server = 'en163') { + if (!servers.includes(server)) + server = servers[0]; + const params = { + url: url, + q_auto: 0, + ajax: 1 + }; + const json = await got + .post(`https://www.y2mate.com/mates/${server}/analyze/ajax`, { + headers: { + 'content-type': 'application/x-www-form-urlencoded; charset=UTF-8', + cookie: '_ga=GA1.2.1405332118.1641699259; _gid=GA1.2.70284915.1642387108; _gat_gtag_UA_84863187_23=1', + origin: 'https://www.y2mate.com' + }, + form: params + }) + .json(); + const $ = cheerio.load(json.result); + const id = (/var k__id = "(.*?)"/.exec($.html()) || ['', ''])[1]; + const v_id = (/var k_data_vid = "(.*?)"/.exec($.html()) || ['', ''])[1]; + const thumbnail = $('.video-thumbnail > img').attr('src'); + const title = $('div.caption > b').text().trim(); + const video = {}; + const audio = {}; + $('#mp4 > table > tbody > tr').each(function () { + var _a, _b, _c; + const el = $(this).find('td'); + const _quality = el.eq(0).find('a').text(); + const quality = (_c = (_b = (_a = _quality.split('(')) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.trim()) === null || _c === void 0 ? void 0 : _c.toLowerCase(); + const fileSizeH = el.eq(1).text(); + if (!/\.3gp/i.test(_quality)) { + video[quality] = { + quality, + fileSizeH, + fileSize: parseFloat(fileSizeH) * (/MB$/.test(fileSizeH) ? 1000 : 1), + download: convert.bind(null, id, v_id, 'mp4', quality.replace(/p/i, '')) + }; + } + }); + $('#mp3 > table > tbody > tr').each(function () { + var _a, _b, _c, _d; + const el = $(this).find('td'); + const _quality = el.eq(0).find('a').text(); + const quality = (_d = (_c = (_b = (_a = _quality + .split('(')) === null || _a === void 0 ? void 0 : _a[1]) === null || _b === void 0 ? void 0 : _b.replace(')', '')) === null || _c === void 0 ? void 0 : _c.trim()) === null || _d === void 0 ? void 0 : _d.toLowerCase(); + const fileSizeH = el.eq(1).text(); + audio[quality] = { + quality, + fileSizeH, + fileSize: parseFloat(fileSizeH) * (/MB$/.test(fileSizeH) ? 1000 : 1), + download: convert.bind(null, id, v_id, 'mp3', quality.replace(/kbps/i, '')) + }; + }); + return { + id, + v_id, + thumbnail, + title, + video, + audio + }; +} +export async function youtubedlv2(url) { + const html = await got('https://yt5s.com/en32').text(); + const urlAjax = (/k_url_search="(.*?)"/.exec(html) || ['', ''])[1]; + const urlConvert = (/k_url_convert="(.*?)"/.exec(html) || ['', ''])[1]; + const params = { + q: url, + vt: 'home' + }; + const json = await got(urlAjax, { + method: 'POST', + headers: { + 'content-type': 'application/x-www-form-urlencoded; charset=UTF-8', + cookie: '__cflb=04dToSoFRg9oqH9pYF2En9gKJK4fe8D9TcYtUD6tYu; _ga=GA1.2.1350132744.1641709803; _gid=GA1.2.1492233267.1641709803; _gat_gtag_UA_122831834_4=1', + origin: 'https://yt5s.com', + 'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.110 Safari/537.36' + }, + searchParams: new URLSearchParams(Object.entries(params)) + }).json(); + const video = {}; + Object.values(json.links.mp4).forEach(({ k, size }) => { + video[k] = { + quality: k, + fileSizeH: size, + fileSize: parseFloat(size) * (/MB$/.test(size) ? 1000 : 1), + // @ts-ignore + download: convertv2.bind(null, urlConvert, json.vid, 'mp4', k, json.token, parseInt(json.timeExpires), json.fn) + }; + }); + const audio = {}; + Object.values(json.links.mp3).forEach(({ key, size }) => { + audio[key] = { + quality: key, + fileSizeH: size, + fileSize: parseFloat(size) * (/MB$/.test(size) ? 1000 : 1), + // @ts-ignore + download: convertv2.bind(null, urlConvert, json.vid, 'mp3', key.replace(/kbps/i, ''), json.token, parseInt(json.timeExpires), json.fn) + }; + }); + return { + id: json.vid, + title: json.title, + thumbnail: `https://i.ytimg.com/vi/${json.vid}/0.jpg`, + video, + audio + }; +} +export async function youtubedlv3(url) { + const payload = { + url + }; + const { id, meta: { title }, thumb, url: results } = await got.post('https://api.onlinevideoconverter.pro/api/convert', { + headers: { + accept: 'application/json, text/plain, */*', + 'accept-encoding': 'gzip, deflate, br', + 'accept-language': 'en-US,en;q=0.9', + 'content-type': 'application/json', + origin: 'https://onlinevideoconverter.pro', + referer: 'https://onlinevideoconverter.pro/', + 'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36' + }, + body: JSON.stringify(payload) + }).json(); + const video = {}; + const audioArray = {}; + results.forEach(({ url, info_url, attr, quality, audio, no_audio, filesize, ext }) => { + if (!no_audio && ext === 'mp4') { + video[quality] = { + quality, + fileSizeH: (filesize && toFormat(filesize)) || undefined, + fileSize: filesize, + download: async () => (url || info_url) + }; + } + if (audio && !no_audio) { + audioArray[quality] = { + quality, + fileSizeH: (filesize && toFormat(filesize)) || undefined, + fileSize: filesize, + download: async () => (url || info_url) + }; + } + }); + return { + id, + title, + thumbnail: thumb, + video, + audio: audioArray + }; +} +async function convert(_id, v_id, ftype, fquality) { + const params = { + type: 'youtube', + _id, + v_id, + ajax: '1', + token: '', + ftype, + fquality + }; + const json = await got('https://www.y2mate.com/mates/convert', { + method: 'POST', + headers: { + 'content-type': 'application/x-www-form-urlencoded; charset=UTF-8', + cookie: '_ga=GA1.2.1405332118.1641699259; _gid=GA1.2.1117783105.1641699259; MarketGidStorage=%7B%220%22%3A%7B%7D%2C%22C702514%22%3A%7B%22page%22%3A2%2C%22time%22%3A1641701743540%7D%7D; _PN_SBSCRBR_FALLBACK_DENIED=1641701744162', + 'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.110 Safari/537.36' + }, + form: params + }).json(); + const $ = cheerio.load(json.result); + const link = $('a[href]').attr('href'); + if (link === 'https://app.y2mate.com/download') + throw new ScraperError(JSON.stringify({ link, json: json }, null, 2)); + return link; +} +function convertv2(url, v_id, ftype, fquality, token, timeExpire, fname) { + return new Promise(async (resolve, reject) => { + const params = { + v_id, + ftype, + fquality, + token, + timeExpire, + client: 'yt5s.com' + }; + const resServer = await got(url, { + method: 'POST', + headers: { + 'content-type': 'application/x-www-form-urlencoded; charset=UTF-8', + origin: 'https://yt5s.com', + referer: 'https://yt5s.com/', + 'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.110 Safari/537.36', + 'X-Requested-Key': 'de0cfuirtgf67a' + }, + form: params + }).json(); + const server = resServer.c_server; + if (!server && ftype === 'mp3') + return resolve(server || resServer.d_url || ''); + const payload = { + v_id, + ftype, + fquality, + fname, + token, + timeExpire + }; + const results = await got(`${server}/api/json/convert`, { + method: 'POST', + form: payload + }).json(); + if (results.statusCode === 200) + return resolve(results.result); + else if (results.statusCode === 300) { + try { + // @ts-ignore + const WebSocket = (await import('ws')).default; + const Url = new URL(server); + const WSUrl = `${/https/i.test(Url.protocol) ? 'wss:' : 'ws:'}//${Url.host}/sub/${results.jobId}?fname=yt5s.com`; + const ws = new WebSocket(WSUrl, undefined, { + headers: { + 'Accept-Encoding': 'gzip, deflate, br', + Host: Url.host, + Origin: 'https://yt5s.com', + 'Sec-WebSocket-Extensions': 'permessage-deflate; client_max_window_bits', + 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.110 Safari/537.36' + } + }); + ws.on('message', function incoming(message) { + const msg = JSON.parse(message.toString()); + if (msg.action === 'success') { + try { + ws.close(); + } + catch (e) { + console.error(e); + } + ws.removeAllListeners('message'); + return resolve(msg.url); + } + else if (msg.action === 'error') + return reject(msg); + }); + } + catch (e) { + console.error(e); + return reject(e); + } + } + else + return reject(results); + }); +} +//# sourceMappingURL=youtube.js.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/esm/social-media/youtube.js.map b/node_modules/@bochilteam/scraper/lib/esm/social-media/youtube.js.map new file mode 100644 index 000000000..8ddfe5be4 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/esm/social-media/youtube.js.map @@ -0,0 +1 @@ +{"version":3,"file":"youtube.js","sourceRoot":"","sources":["../../../src/social-media/youtube.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAA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I,EAAE,GAAG,CAAC,IAAI;wBACd,MAAM,EAAE,kBAAkB;wBAC1B,0BAA0B,EACxB,4CAA4C;wBAC9C,YAAY,EACV,qHAAqH;qBACxH;iBACF,CAAC,CAAA;gBACF,EAAE,CAAC,EAAE,CAAC,SAAS,EAAE,SAAS,QAAQ,CAAE,OAAe;oBACjD,MAAM,GAAG,GAAoC,IAAI,CAAC,KAAK,CACrD,OAAO,CAAC,QAAQ,EAAE,CACnB,CAAA;oBACD,IAAI,GAAG,CAAC,MAAM,KAAK,SAAS,EAAE;wBAC5B,IAAI;4BAAE,EAAE,CAAC,KAAK,EAAE,CAAA;yBAAE;wBAAC,OAAO,CAAC,EAAE;4BAAE,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;yBAAE;wBACjD,EAAE,CAAC,kBAAkB,CAAC,SAAS,CAAC,CAAA;wBAChC,OAAO,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;qBACxB;yBAAM,IAAI,GAAG,CAAC,MAAM,KAAK,OAAO;wBAAE,OAAO,MAAM,CAAC,GAAG,CAAC,CAAA;gBACvD,CAAC,CAAC,CAAA;aACH;YAAC,OAAO,CAAC,EAAE;gBACV,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;gBAChB,OAAO,MAAM,CAAC,CAAC,CAAC,CAAA;aACjB;SACF;;YAAM,OAAO,MAAM,CAAC,OAAO,CAAC,CAAA;IAC/B,CAAC,CAAC,CAAA;AACJ,CAAC"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/esm/texts/aksarajawa.js b/node_modules/@bochilteam/scraper/lib/esm/texts/aksarajawa.js new file mode 100644 index 000000000..da3821922 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/esm/texts/aksarajawa.js @@ -0,0 +1,2036 @@ +export function latinToAksara(str, options = { mode: 'ketik', space: true }) { + const aksara = new Aksara(str, options); + return aksara.toAksara(); +} +export function aksaraToLatin(str, options = { HVokal: false }) { + const aksara = new Aksara(str, options); + return aksara.toLatin(); +} +// https://bennylin.github.io/transliterasijawa/ +// https://jv.wikipedia.org/w/index.php?title=Panganggo:Bennylin/trans.js&action=raw&ctype=text/javascript +const SuperTrim = (str) => str.replace(/^\s*|\s*$/g, '').replace(/\s+/g, ' '); // trim string, menemukan karakter di dalam string +const findstr = (str, find) => { + for (let i = 0; i < str.length; i++) + if (str[i] == find) + return true; + return false; +}; +const isDigit = (a) => findstr('0123456789', a); +const isPunct = (a) => findstr(',.> findstr('AaĂăEeÈèÉéIiOoUuÊêĚěĔĕṚṛXxôâāīūōåɔə', a); +const isConsonant = (a) => findstr('BCDfGHJKLMNPQRSTVWYZbcdfghjklmnpqrstvwyzḌḍṆṇṢṣṬṭŊŋÑñɲś', a); // Xx are vowels (pepet) +const isSpecial = (a) => findstr('GgHhRrYyñn', a); // untuk bikonsonan th, dh, ng (nga dan cecak), ny, -r- (cakra), -y- (pengkal), jñ/jnya (ꦘ) +const isHR = (a) => findstr('HhRrŊŋ', a); // untuk layar dan wignyan dan cecak ([[:en:w:Engma]]) +const isLW = (a) => findstr('LlWw', a); // untuk panjingan ("ng" dapat diikuti "g", "r"/cakra, "y"/pengkal, dan "w" atau "l"/panjingan) +const isCJ = (a) => findstr('CcJj', a); // untuk anuswara -nj- dan -nc- +const GetSpecialSound = (str) => { + const specialsoundMap = { + f: 'ꦥ꦳꧀', + v: 'ꦮ꦳꧀', + z: 'ꦗ꦳꧀', + ś: 'ꦯ꧀', + Q: '꧀', + q: '꧀' /* pangkon */ + }; + if (specialsoundMap[str] !== undefined) + return specialsoundMap[str]; + return null; +}; +class Aksara { + constructor(str, opts = { mode: 'ketik', space: true, HVokal: true }) { + this.opts = opts; + this.str = ''; + this.str2 = ''; + this.spasi = ''; + this.str = str.toString(); + this.angkaFlag = opts.number; + this.cecakFlag = opts.cecak; + this.diftong = opts.diftong; + this.modeSpasi = opts.space; + this.murda = opts.murda; + this.mode = opts.mode; + this.isHVokal = opts.HVokal; + } + toAksara() { + let i = 0; + let ret = ''; + let pi = 0; // ?offset + const angka = { + 0: '꧐', + 1: '꧑', + 2: '꧒', + 3: '꧓', + 4: '꧔', + 5: '꧕', + 6: '꧖', + 7: '꧗', + 8: '꧘', + 9: '꧙' + }; + this.str = SuperTrim(this.str); + while (i < this.str.length) { + if (i > 0 && isVowel(this.str[i]) && isVowel(this.str[i - 1])) { + // deal with words that start with multiple vocals + if ((this.str[i - 1] == 'a' && this.str[i] == 'a') || + (this.str[i - 1] == 'i' && this.str[i] == 'i') || + (this.str[i - 1] == 'u' && this.str[i] == 'u') || + (this.str[i - 1] == 'a' && this.str[i] == 'i') || + (this.str[i - 1] == 'a' && this.str[i] == 'u')) { + // specials + if (i == 1 || (i > 1 && !isConsonant(this.str[i - 2]))) { + // for example if starts with 'ai-' + this.str = + this.str.substring(0, i) + + 'h' + + this.str.substring(i, this.str.length); + } + else { + // var modeDiftong = document.getElementsByName("diftong"); + // for (var rad in modeDiftong) { + // if (modeDiftong[rad].checked) + // diftong = modeDiftong[rad].value; + // } + if (this.diftong) { + // do nothing, look in matramap table if(diftong == "tidak") + } + else { + this.str = + this.str.substring(0, i) + + 'h' + + this.str.substring(i, this.str.length); + } + } + } + else if ((this.str[i - 1] == 'e' || + this.str[i - 1] == 'è' || + this.str[i - 1] == 'é') && + (this.str[i] == 'a' || this.str[i] == 'o')) { + // -y- + this.str = + this.str.substring(0, i) + + 'y' + + this.str.substring(i, this.str.length); + } + else if (this.str[i - 1] == 'i' && + (this.str[i] == 'a' || + this.str[i] == 'e' || + this.str[i] == 'è' || + this.str[i] == 'é' || + this.str[i] == 'o' || + this.str[i] == 'u')) { + // -y- + this.str = + this.str.substring(0, i) + + 'y' + + this.str.substring(i, this.str.length); + } + else if (this.str[i - 1] == 'o' && + (this.str[i] == 'a' || + this.str[i] == 'e' || + this.str[i] == 'è' || + this.str[i] == 'é')) { + // -w- + this.str = + this.str.substring(0, i) + + 'w' + + this.str.substring(i, this.str.length); + } + else if (this.str[i - 1] == 'u' && + (this.str[i] == 'a' || + this.str[i] == 'e' || + this.str[i] == 'è' || + this.str[i] == 'é' || + this.str[i] == 'i' || + this.str[i] == 'o')) { + // -y- + this.str = + this.str.substring(0, i) + + 'w' + + this.str.substring(i, this.str.length); + } + else { + this.str = + this.str.substring(0, i) + + 'h' + + this.str.substring(i, this.str.length); + } + } + if ((isSpecial(this.str[i]) || isLW(this.str[i]) || isCJ(this.str[i])) && + !this.vowelFlag) { + // i++; + } + else if ((this.str[i] == 'h' && this.vowelFlag) || + (!isVowel(this.str[i]) && i > 0) || + this.str[i] == ' ' || + isPunct(this.str[i]) || + isDigit(this.str[i]) || + i - pi > 5) { + if (!isDigit(this.str[i]) && this.angkaFlag) { + // turn off the flag + ret += '꧇​'; // with zws + this.angkaFlag = false; + } + if (pi < i) { + if (this.cecakFlag && + this.GetSound(this.str.substring(pi, i)) == 'ꦁ') { + this.cecakFlag = false; + ret += 'ꦔ꧀ꦔ'; + } + else if (!this.cecakFlag && + this.GetSound(this.str.substring(pi, i)) == 'ꦁ') { + this.cecakFlag = true; + ret += 'ꦁ​'; + } + else { + this.cecakFlag = false; + ret += this.GetSound(this.str.substring(pi, i)); + } + } + if (this.str[i] == ' ') { + // var spasi, modeSpasi; + // var pakaiSpasi = document.getElementsByName("spasi"); + // for (var rad in pakaiSpasi) { + // if (pakaiSpasi[rad].checked) + // modeSpasi = pakaiSpasi[rad].value; + // } + if (this.modeSpasi) { + // if space preceeded by open vowel, or layar/wignyan (therefore, no pangkon/virama) + if (i > 0 && + ['a', 'e', 'i', 'o', 'u', 'r', 'h', 'ě'].indexOf(this.str[i - 1]) >= 0) { + this.spasi = '​'; // zero-width space + } + else { + this.spasi = ''; + } + } + else { + // if(mode == "with") + this.spasi = '​'; // zero-width space + // spasi = ' '; }//hair space http://en.wikipedia.org/wiki/Space_(punctuation)#Spaces_in_Unicode + } + ret += this.spasi; + } + if (isPunct(this.str[i])) { + if (this.str[i] == '.') { + ret += '꧉​'; // titik+zero-width space + pi = i + 1; + } + else if (this.str[i] == ',') { + ret += '꧈​'; // koma+zero-width space + pi = i + 1; + } + else if (this.str[i] == ':') { + ret += '꧇​'; // titik dua+zero-width space + pi = i + 1; + } + else if (this.str[i] == '|') { + ret += '꧋'; + pi = i + 1; + /* comment out, not really a good way to do brackets + } else if (str[i] == '(') { + ret += "꧌"; pi = i + 1; + } else if (str[i] == ')') { + ret += "꧍​"; pi = i + 1;// with zws + */ + } + else if (this.str[i] == '-') { + // tanda hubung + ret += '​'; + pi = i + 1; + } + else if (this.str[i] == '?' || + this.str[i] == '!' || + this.str[i] == '"' || + this.str[i] == "'") { + // tanda tanya/seru/petik + ret += '​'; // zero-width space + pi = i + 1; + } + else { + ret += this.str[i]; + pi = i + 1; + } + } + else if (isDigit(this.str[i])) { + if (!this.angkaFlag) + ret += '꧇'; + ret += angka[this.str[i]]; + this.angkaFlag = true; + pi = i + 1; + } + else { + pi = i; + } + this.vowelFlag = false; + } + else if (isVowel(this.str[i]) && this.str[i] != 'h') { + if (!isDigit(this.str[i]) && this.angkaFlag) { + // turn off the flag + ret += '꧇​'; // with zws + this.angkaFlag = false; + } + this.vowelFlag = true; + } + if (pi > 0 && isVowel(this.str[pi - 1])) { + // ngg + this.vowelPrev = true; + } + else + this.vowelPrev = false; + /* not working + if (pi > 0 && findstr(" ",str[pi-1])) {//ngg + spacePrev = true; + } + else spacePrev = false; */ + i++; + } // endwhile + if (pi < i) { + ret += this.GetSound(this.str.substring(pi, i)); + } + return SuperTrim(ret).toString(); + } + GetMatra(str) { + let i = 0; + if (str.length < 1) { + return '꧀'; + } + while (str[i] == 'h') { + i++; + if (i >= str.length) { + break; + } + } + if (i < str.length) { + str = str.substring(i); + } + const matramap1 = { e: 'ꦺ', E: 'ꦌ' }; // mode ketik + const matramap2 = { e: 'ꦼ', E: 'ꦄꦼ' }; // mode kopas + const matramap3 = { + // both mode ketik and kopas + ā: 'ꦴ', + â: 'ꦴ', + aa: 'ꦴ', + è: 'ꦺ', + é: 'ꦺ', + i: 'ꦶ', + ī: 'ꦷ', + ii: 'ꦷ', + o: 'ꦺꦴ', + ō: 'ꦼꦴ', + u: 'ꦸ', + ū: 'ꦹ', + uu: 'ꦹ', + x: 'ꦼ', + ě: 'ꦼ', + ĕ: 'ꦼ', + ê: 'ꦼ', + ə: 'ꦼ', + ô: '', + ă: '', + å: '', + ɔ: '', + A: 'ꦄ', + Ă: 'ꦄ', + È: 'ꦌ', + É: 'ꦌ', + I: 'ꦆ', + O: 'ꦎ', + U: 'ꦈ', + X: 'ꦄꦼ', + Ě: 'ꦄꦼ', + Ĕ: 'ꦄꦼ', + Ê: 'ꦄꦼ', + ṛ: 'ꦽ', + Ṛ: 'ꦽ', + ai: 'ꦻ', + au: 'ꦻꦴ' + }; + // var matramap, mode; + // var modeTranslit = document.getElementsByName("mode"); + // for (var rad in modeTranslit) { + // if (modeTranslit[rad].checked) + // mode = modeTranslit[rad].value; + // } + if (this.mode == 'kopas') + var matramap = { ...matramap2, ...matramap3 }; + // if(mode == "ketik") + else + var matramap = { ...matramap1, ...matramap3 }; + if (matramap[str] !== undefined) { + return matramap[str]; + } + return ''; + } + GetShift(str1) { + const str = str1.toLowerCase(); // case insensitive + // var modeMurda = document.getElementsByName("murda"); + // for (var rad in modeMurda) { + // if (modeMurda[rad].checked) + // murda = modeMurda[rad].value; + // } + if (this.murda) + this.str2 = str1; + // case sensitive (particularly the 8 characters of ꦛ ꦜ ꦝ ꦞ ꦠ ꦡ ꦢ ꦣ), + // for combination of murda and cakra/pengkal/panjingan + // if(murda == "tidak") + else + this.str2 = str1.toLowerCase(); // case insensitive + // V.1. 2nd letter of the consonant cluster is 'h' + if (this.str2.indexOf('th') == 0) { + // suku kata diawali 'th' + if (this.str2.indexOf('thl') == 0) { + // thl- + return { CoreSound: 'ꦛ꧀ꦭ', len: 3 }; + } + else if (this.str2.indexOf('thr') == 0) { + // thr- + return { CoreSound: 'ꦛꦿ', len: 3 }; + } + else if (this.str2.indexOf('thw') == 0) { + // thw- + return { CoreSound: 'ꦛ꧀ꦮ', len: 3 }; + } + else if (this.str2.indexOf('thy') == 0) { + // thy- + return { CoreSound: 'ꦛꦾ', len: 3 }; + } + else { + return { CoreSound: 'ꦛ', len: 2 }; // tha + } + } + else if (this.str2.indexOf('dh') == 0) { + // suku kata diawali 'dh' + if (this.str2.indexOf('dhl') == 0) { + // dhl- + return { CoreSound: 'ꦝ꧀ꦭ', len: 3 }; + } + else if (this.str2.indexOf('dhr') == 0) { + // dhr- + return { CoreSound: 'ꦝꦿ', len: 3 }; + } + else if (this.str2.indexOf('dhw') == 0) { + // dhw-: dhwani + return { CoreSound: 'ꦝ꧀ꦮ', len: 3 }; + } + else if (this.str2.indexOf('dhy') == 0) { + // dhy-: dhyaksa + return { CoreSound: 'ꦝꦾ', len: 3 }; + } + else { + return { CoreSound: 'ꦝ', len: 2 }; // dha + } + } + else if (this.str2.indexOf('Th') == 0) { + // suku kata diawali 'Th' + if (this.str2.indexOf('Thl') == 0) { + // Thl- + return { CoreSound: 'ꦜ꧀ꦭ', len: 3 }; + } + else if (this.str2.indexOf('Thr') == 0) { + // Thr- + return { CoreSound: 'ꦜꦿ', len: 3 }; + } + else if (this.str2.indexOf('Thw') == 0) { + // Thw- + return { CoreSound: 'ꦜ꧀ꦮ', len: 3 }; + } + else if (this.str2.indexOf('Thy') == 0) { + // Thy- + return { CoreSound: 'ꦜꦾ', len: 3 }; + } + else { + return { CoreSound: 'ꦜ', len: 2 }; // Tha Mahaprana + } + } + else if (this.str2.indexOf('Dh') == 0) { + // suku kata diawali 'Dh' + if (this.str2.indexOf('Dhl') == 0) { + // Dhl- + return { CoreSound: 'ꦞ꧀ꦭ', len: 3 }; + } + else if (this.str2.indexOf('Dhr') == 0) { + // Dhr- + return { CoreSound: 'ꦞꦿ', len: 3 }; + } + else if (this.str2.indexOf('Dhw') == 0) { + // Dhw-: Dhwani + return { CoreSound: 'ꦞ꧀ꦮ', len: 3 }; + } + else if (this.str2.indexOf('Dhy') == 0) { + // Dhy-: Dhyaksa + return { CoreSound: 'ꦞꦾ', len: 3 }; + } + else { + return { CoreSound: 'ꦞ', len: 2 }; // Dha Mahaprana + } + /* murda block start */ + } + else if (str.indexOf('ṭh') == 0) { + // ṭh (aksara murda: tha mahaprana) + if (str.indexOf('ṭhy') == 0) { + return { CoreSound: 'ꦜꦾ', len: 2 }; + } + else if (str.indexOf('ṭhr') == 0) { + return { CoreSound: 'ꦜꦿ', len: 2 }; + } + else + return { CoreSound: 'ꦜ', len: 2 }; + } + else if (str.indexOf('ḍh') == 0) { + // ḍh (aksara murda: dha mahaprana) + if (str.indexOf('ḍhy') == 0) { + return { CoreSound: 'ꦞꦾ', len: 2 }; + } + else if (str.indexOf('ḍhr') == 0) { + return { CoreSound: 'ꦞꦿ', len: 2 }; + } + else + return { CoreSound: 'ꦞ', len: 2 }; + } + else if (str.indexOf('kh') == 0) { + // kh (aksara murda: ka murda) + if (str.indexOf('khl') == 0) { + // ka murda + panjingan la + return { CoreSound: 'ꦑ꧀ꦭ', len: 3 }; + } + else if (str.indexOf('khr') == 0) { + // ka murda + cakra + return { CoreSound: 'ꦑꦿ', len: 3 }; + } + else if (str.indexOf('khw') == 0) { + // ka murda + panjingan wa + return { CoreSound: 'ꦑ꧀ꦮ', len: 3 }; + } + else if (str.indexOf('khy') == 0) { + // ka murda + wignyan + return { CoreSound: 'ꦑꦾ', len: 3 }; + } + else { + return { CoreSound: 'ꦑ', len: 2 }; + } + } + else if (str.indexOf('gh') == 0) { + // gh (aksara murda: ga murda) + if (str.indexOf('ghl') == 0) { + // ga murda + panjingan la + return { CoreSound: 'ꦓ꧀ꦭ', len: 3 }; + } + else if (str.indexOf('ghw') == 0) { + // ga murda + panjingan wa + return { CoreSound: 'ꦓ꧀ꦮ', len: 3 }; + } + else if (str.indexOf('ghr') == 0) { + // ga murda + cakra + return { CoreSound: 'ꦓꦿ', len: 3 }; + } + else if (str.indexOf('ghy') == 0) { + // ga murda + wignyan + return { CoreSound: 'ꦓꦾ', len: 3 }; + } + else { + return { CoreSound: 'ꦓ', len: 2 }; + } + } + else if (str.indexOf('ch') == 0) { + // ch (aksara murda: ca murda) + if (str.indexOf('chl') == 0) { + // ca murda + panjingan la + return { CoreSound: 'ꦖ꧀ꦭ', len: 3 }; + } + else if (str.indexOf('chr') == 0) { + // ca murda + cakra + return { CoreSound: 'ꦖꦿ', len: 3 }; + } + else if (str.indexOf('chw') == 0) { + // ca murda + panjingan wa + return { CoreSound: 'ꦖ꧀ꦮ', len: 3 }; + } + else if (str.indexOf('chy') == 0) { + // ca murda + wignyan + return { CoreSound: 'ꦖꦾ', len: 3 }; + } + else { + return { CoreSound: 'ꦖ', len: 2 }; + } + } + else if (str.indexOf('jh') == 0) { + // jh (aksara murda: ja mahaprana) + if (str.indexOf('jhl') == 0) { + // ja mahaprana + panjingan la + return { CoreSound: 'ꦙ꧀​ꦭ', len: 3 }; // with zws, otherwise the panjingan is overlapped + } + else if (str.indexOf('jhr') == 0) { + // ja mahaprana + cakra + return { CoreSound: 'ꦙꦿ', len: 3 }; + } + else if (str.indexOf('jhw') == 0) { + // ja mahaprana + panjingan wa + return { CoreSound: 'ꦙ꧀ꦮ', len: 3 }; + } + else if (str.indexOf('jhy') == 0) { + // ja mahaprana + wignyan + return { CoreSound: 'ꦙꦾ', len: 3 }; + } + else { + return { CoreSound: 'ꦙ', len: 2 }; + } + } + else if (str.indexOf('ph') == 0) { + // ph (aksara murda: pa murda) + if (str.indexOf('phl') == 0) { + // pa murda + panjingan la + return { CoreSound: 'ꦦ꧀ꦭ', len: 3 }; + } + else if (str.indexOf('phr') == 0) { + // pa murda + cakra + return { CoreSound: 'ꦦꦿ', len: 3 }; + } + else if (str.indexOf('phw') == 0) { + // pa murda + panjingan wa + return { CoreSound: 'ꦦ꧀ꦮ', len: 3 }; + } + else if (str.indexOf('phy') == 0) { + // pa murda + wignyan + return { CoreSound: 'ꦦꦾ', len: 3 }; + } + else { + return { CoreSound: 'ꦦ', len: 2 }; + } + } + else if (str.indexOf('bh') == 0) { + // bh (aksara murda: ba murda) + if (str.indexOf('bhl') == 0) { + // ba murda + panjingan la + return { CoreSound: 'ꦨ꧀ꦭ', len: 3 }; + } + else if (str.indexOf('bhr') == 0) { + // ba murda + cakra + return { CoreSound: 'ꦨꦿ', len: 3 }; + } + else if (str.indexOf('bhw') == 0) { + // ba murda + panjingan wa + return { CoreSound: 'ꦨ꧀ꦮ', len: 3 }; + } + else if (str.indexOf('bhy') == 0) { + // ba murda + wignyan + return { CoreSound: 'ꦨꦾ', len: 3 }; + } + else { + return { CoreSound: 'ꦨ', len: 2 }; + } + } + else if (str.indexOf('sh') == 0) { + // sh (aksara murda: sa murda) + if (str.indexOf('shl') == 0) { + // sa murda + panjingan la + return { CoreSound: 'ꦯ꧀ꦭ', len: 3 }; + } + else if (str.indexOf('shr') == 0) { + // sa murda + cakra + return { CoreSound: 'ꦯꦿ', len: 3 }; + } + else if (str.indexOf('shw') == 0) { + // sa murda + panjingan wa + return { CoreSound: 'ꦯ꧀ꦮ', len: 3 }; + } + else if (str.indexOf('shy') == 0) { + // sa murda + wignyan + return { CoreSound: 'ꦯꦾ', len: 3 }; + } + else { + return { CoreSound: 'ꦯ', len: 2 }; + } + /* murda block end */ + // Uncatched exception: -h followed by hy, hr, hl, hw + } + else if (str.indexOf('hh') == 0) { + // wignyan + ha, e.g. root word ends with 'h' with suffix -i + return { CoreSound: 'ꦃꦲ', len: 2 }; + // Uncatched exception: -r followed by hy, hr, hl, hw + } + else if (str.indexOf('rh') == 0) { + // layar + ha + return { CoreSound: 'ꦂꦲ', len: 2 }; + } + else if (str.indexOf('h') == 1) { + // h (h di posisi karakter kedua) + return { + CoreSound: '' + this.GetCoreSound(this.str2[0]).CoreSound + '꧀ꦲ', + len: 2 + }; + } + // V.2. 2nd letter is 'g' + if (str.indexOf('ng') == 0) { + // suku kata diawali 'ng' + // Uncatched exception: -ng followed by ry, rw, rl + if (str.indexOf('ngr') == 0) { + // cakra (for cecak + ra, separate by a space) + return { CoreSound: '' + 'ꦔꦿ', len: 3 }; + } + else if (str.indexOf('ngy') == 0) { + // pengkal (for cecak + ya, separate by a space) + return { CoreSound: '' + 'ꦔꦾ', len: 3 }; + // Uncatched exception: -ng followed by hy, hr, hl + } + else if (str.indexOf('nghw') == 0) { + // tyonghwa + return { CoreSound: '' + 'ꦁꦲ꧀ꦮ​', len: 4 }; + } + else if (str.indexOf('ngg') == 0) { + // cecak + ga + if (str.indexOf('nggr') == 0) { + // nggronjal + return { CoreSound: 'ꦔ꧀ꦒꦿ', len: 4 }; + } + else if (str.indexOf('nggl') == 0) { + // nggl- + return { CoreSound: 'ꦔ꧀ꦒ꧀ꦭ', len: 4 }; + } + else if (str.indexOf('nggw') == 0) { + // nggw-, munggwing + return { CoreSound: 'ꦔ꧀ꦒ꧀ꦮ', len: 4 }; + } + else if (str.indexOf('nggy') == 0) { + // nggy-, anggyat + return { CoreSound: 'ꦔ꧀ꦒꦾ', len: 4 }; + } + else { + return { CoreSound: 'ꦔ꧀ꦒ', len: 3 }; + } + } + else if (str.indexOf('ngn') == 0) { + // cecak + na + // Uncatched exception: -ng followed by ngy, ngr, ngl, ngw + if (str.indexOf('ngng') == 0) { + // ngng + return { CoreSound: 'ꦁ​ꦔ', len: 4 }; + } + else { + return { CoreSound: 'ꦁ​ꦤ', len: 3 }; + } + } + else if (str.indexOf('ngh') == 0) { + // cecak + ha + return { CoreSound: 'ꦁ​ꦲ', len: 3 }; + } + else if (str.indexOf('ngc') == 0) { + // cecak + ca + return { CoreSound: 'ꦁ​ꦕ', len: 3 }; + } + else if (str.indexOf('ngj') == 0) { + // cecak + ja + return { CoreSound: 'ꦁ​ꦗ', len: 3 }; + } + else if (str.indexOf('ngl') == 0) { + // ngl, e.g. ngluwari + return { CoreSound: 'ꦔ꧀ꦭ', len: 3 }; + } + else if (str.indexOf('ngw') == 0) { + // ngw, e.g. ngwiru + return { CoreSound: 'ꦔ꧀ꦮ', len: 3 }; + } + else { + return { CoreSound: 'ꦁ​', len: 2 }; // cecak, with zws + } + } + else if (str.indexOf('gg') == 0) { + // 'gg', e.g. root word ends with 'g' with suffix -i + return { CoreSound: 'ꦒ꧀ꦒ', len: 2 }; + } + else if (str.indexOf('hg') == 0) { + // wignyan + ga, e.g. dahgene + return { CoreSound: 'ꦃꦒ', len: 2 }; + } + else if (str.indexOf('rg') == 0) { + // layar + ga, e.g. amarga + return { CoreSound: 'ꦂꦒ', len: 2 }; + } + else if (str.indexOf('g') == 1) { + // g (g di posisi karakter kedua) + return { + CoreSound: '' + this.GetCoreSound(this.str2[0]).CoreSound + '꧀ꦒ', + len: 2 + }; + } + // V.3. 2nd letter is 'y' + if (str.indexOf('ny') == 0) { + // suku kata diawali 'ny' + if (str.indexOf('nyr') == 0) { + // cakra + return { CoreSound: 'ꦚꦿ', len: 3 }; /* + } else if (str.indexOf("nyy") == 0) { //nyy, I don't think it's possible + return { "CoreSound": "ꦚꦾ", "len": 3 }; */ + } + else if (str.indexOf('nyl') == 0) { + // nyl, e.g. nylonong + return { CoreSound: 'ꦚ꧀ꦭ', len: 3 }; + } + else if (str.indexOf('nyw') == 0) { + // nyw + return { CoreSound: 'ꦚ꧀ꦮ', len: 3 }; /* + } else if (str2.indexOf("Ny") == 0) { //Na murda + pengkal, unlikely combination? + return { "CoreSound": "ꦟꦾ", "len": 2 }; */ + } + else { + return { CoreSound: 'ꦚ', len: 2 }; + } + } + else if (str.indexOf('hy') == 0) { + // wignyan + ya / ha + pengkal -- hyang + return { CoreSound: 'ꦲꦾ', len: 2 }; + } + else if (this.str2.indexOf('ry') == 0) { + // layar + ya, e.g. Suryati, Wiryadi + if (str.indexOf('ryy') == 0) { + return { CoreSound: 'ꦂꦪꦾ', len: 3 }; // 'ryy', e.g. Duryyodhana (Jawa Kuno) + } + else { + return { CoreSound: 'ꦂꦪ', len: 2 }; + } /* + } else if (str.indexOf("yy") == 0) { //'yy', I don't think it's possible + return { "CoreSound": "ꦪꦾ", "len": 2 }; */ + } + else if (this.str2.indexOf('qy') == 0) { + // qy -- only pengkal + return { CoreSound: 'ꦾ', len: 1 }; + } + else if (str.indexOf('y') == 1) { + // pengkal (y di posisi karakter kedua) + return { + CoreSound: '' + this.GetCoreSound(this.str2[0]).CoreSound + 'ꦾ', + len: 2 + }; + } + // V.4. 2nd letter is 'r' + // Uncatched exception: -h followed by ry, rw, rl + if (str.indexOf('hr') == 0) { + // wignyan + ra / ha + cakra + return { CoreSound: 'ꦲꦿ', len: 2 }; + } + else if (str.indexOf('wr') == 0) { + // wr -- panjingan + cakra + return { CoreSound: '' + 'ꦮꦿ', len: 2 }; + // Uncatched exception: -r followed by ry, rw, rl + } + else if (str.indexOf('rr') == 0) { + // layar + ra (no cakra) + return { CoreSound: 'ꦂꦫ', len: 2 }; + } + else if (this.str2.indexOf('qr') == 0) { + // qr -- only pasangan ra + return { CoreSound: '꧀ꦫ', len: 1 }; + } + else if (this.str2.indexOf('qR') == 0) { + // qR -- only cakra + return { CoreSound: 'ꦿ', len: 1 }; + } + else if (str.indexOf('r') == 1) { + // cakra (r di posisi karakter kedua) + return { + CoreSound: '' + this.GetCoreSound(this.str2[0]).CoreSound + 'ꦿ', + len: 2 + }; + } + // V.5. 2nd letter is 'l' or 'w' + // panjingan -l + if (str.indexOf('hl') == 0) { + // wignyan + la + return { CoreSound: 'ꦃꦭ', len: 2 }; + } + else if (str.indexOf('rl') == 0) { + // layar + la + return { CoreSound: 'ꦂꦭ', len: 2 }; + } + else if (str.indexOf('ll') == 0) { + // ll + return { CoreSound: 'ꦭ꧀ꦭ', len: 2 }; + } + else if (str.indexOf('ql') == 0) { + // only panjingan + return { CoreSound: '꧀ꦭ', len: 2 }; + } + else if (str.indexOf('l') == 1) { + // (l di posisi karakter kedua) + return { + CoreSound: '' + this.GetCoreSound(this.str2[0]).CoreSound + '꧀ꦭ', + len: 2 + }; + } + // panjingan -w + if (str.indexOf('hw') == 0) { + // wignyan + ha + return { CoreSound: 'ꦃꦮ', len: 2 }; // ꦲ꧀ꦮ + } + else if (str.indexOf('rw') == 0) { + // layar + ha + return { CoreSound: 'ꦂꦮ', len: 2 }; // error untuk 'rwi', 'rwab' + } + else if (str.indexOf('ww') == 0) { + // ww (wwang, pûrwwa) - terima kasih Mas Revo + return { CoreSound: 'ꦮ꧀ꦮ', len: 2 }; + } + else if (str.indexOf('qw') == 0) { + // only panjingan + return { CoreSound: '꧀ꦮ', len: 2 }; + } + else if (str.indexOf('w') == 1) { + // (w di posisi karakter kedua) + return { + CoreSound: '' + this.GetCoreSound(this.str2[0]).CoreSound + '꧀ꦮ', + len: 2 + }; + } + // V.6. 2nd letter is 'c' or 'j' + if (str.indexOf('nc') == 0) { + // nc + if (str.indexOf('ncr') == 0) { + // ncr -- kencrung + return { CoreSound: 'ꦚ꧀ꦕꦿ', len: 3 }; + } + else if (str.indexOf('ncl') == 0) { + // ncl -- kinclong + return { CoreSound: 'ꦚ꧀ꦕ꧀ꦭ', len: 3 }; + } + else { + return { CoreSound: 'ꦚ꧀ꦕ', len: 2 }; + } + } + else if (str.indexOf('hc') == 0) { + // wignyan + ca + return { CoreSound: 'ꦃꦕ', len: 2 }; + } + else if (str.indexOf('rc') == 0) { + // layar + ca -- arca + return { CoreSound: 'ꦂꦕ', len: 2 }; + } + else if (str.indexOf('cc') == 0) { + // cc -- impossible combination in real text + return { CoreSound: 'ꦕ꧀ꦕ', len: 2 }; + } + else if (this.str2.indexOf('qc') == 0) { + // only pasangan ca + return { CoreSound: '꧀ꦕ', len: 2 }; + } + else if (str.indexOf('c') == 1) { + // c + return { + CoreSound: '' + this.GetCoreSound(this.str2[0]).CoreSound + '꧀ꦕ', + len: 2 + }; + } + if (str.indexOf('nj') == 0) { + // nj + if (str.indexOf('njr') == 0) { + // njr -- anjrit + return { CoreSound: 'ꦚ꧀ꦗꦿ', len: 3 }; + } + else if (str.indexOf('njl') == 0) { + // njl -- anjlog + return { CoreSound: 'ꦚ꧀ꦗ꧀ꦭ', len: 3 }; + } + else { + return { CoreSound: 'ꦚ꧀ꦗ', len: 2 }; + } + } + else if (str.indexOf('hj') == 0) { + // wignyan + ja + return { CoreSound: 'ꦃꦗ', len: 2 }; + } + else if (str.indexOf('rj') == 0) { + // layar + ja + return { CoreSound: 'ꦂꦗ', len: 2 }; + } + else if (str.indexOf('jj') == 0) { + // jj -- impossible combination in real text + return { CoreSound: 'ꦗ꧀ꦗ', len: 2 }; + } + else if (this.str2.indexOf('qj') == 0) { + // only pasangan ja + return { CoreSound: '꧀ꦗ', len: 2 }; + } + else if (str.indexOf('j') == 1) { + // j + return { + CoreSound: '' + this.GetCoreSound(this.str2[0]).CoreSound + '꧀ꦗ', + len: 2 + }; + } + // V.7. 2nd letter is 'ñ' or 'n' + if (str.indexOf('jñ') == 0) { + // suku kata diawali 'jñ' + if (str.indexOf('jñl') == 0) { + // suku kata diawali 'jñ' - nya murda + return { CoreSound: 'ꦘ꧀ꦭ', len: 3 }; + } + else if (str.indexOf('jñr') == 0) { + // nya murda + cakra + return { CoreSound: 'ꦘꦿ', len: 3 }; + } + else if (str.indexOf('jñw') == 0) { + // nya murda + panjingan wa + return { CoreSound: 'ꦘ꧀ꦮ', len: 3 }; + } + else if (str.indexOf('jñy') == 0) { + // nya murda + wignyan + return { CoreSound: 'ꦘꦾ', len: 3 }; + } + else { + return { CoreSound: 'ꦘ', len: 2 }; + } + } + else if (str.indexOf('jn') == 0) { + // suku kata diawali 'jn' + if (str.indexOf('jny') == 0) { + // suku kata diawali 'jny' - nya murda + if (str.indexOf('jnyl') == 0) { + // suku kata diawali 'jny' - nya murda + return { CoreSound: 'ꦘ꧀ꦭ', len: 4 }; + } + else if (str.indexOf('jnyr') == 0) { + // nya murda + cakra + return { CoreSound: 'ꦘꦿ', len: 4 }; + } + else if (str.indexOf('jnyw') == 0) { + // nya murda + panjingan wa + return { CoreSound: 'ꦘ꧀ꦮ', len: 4 }; + } + else if (str.indexOf('jnyy') == 0) { + // nya murda + wignyan + return { CoreSound: 'ꦘꦾ', len: 4 }; + } + else { + return { CoreSound: 'ꦘ', len: 3 }; + } + } + else { + return { CoreSound: 'ꦗ꧀ꦤ', len: 2 }; + } + // Uncatched exception: -h followed by ngy, ngr, ngl, ngw + } + else if (str.indexOf('hn') == 0) { + // wignyan + na + return { CoreSound: 'ꦃꦤ', len: 2 }; + // Uncatched exception: -r followed by ngy, ngr, ngl, ngw + } + else if (str.indexOf('rn') == 0) { + // layar + na + return { CoreSound: 'ꦂꦤ', len: 2 }; + } + else if (str.indexOf('nn') == 0) { + // nn, e.g. root word ends with 'n' with suffix -i + if (str.indexOf('nng') == 0) { + // + return { CoreSound: 'ꦤ꧀ꦁ​', len: 3 }; + } + else if (str.indexOf('nng') == 0) { + // + return { CoreSound: 'ꦤ꧀ꦚ꧀', len: 3 }; + } + else { + return { CoreSound: 'ꦤ꧀ꦤ', len: 2 }; + } + } + else if (this.str2.indexOf('qn') == 0) { + // only pasangan na + return { CoreSound: '꧀ꦤ', len: 2 }; + } + else if (str.indexOf('ñ') == 1) { + // huruf asing sih sebenarnya, kemungkinan kecil muncul + return { + CoreSound: '' + this.GetCoreSound(this.str2[0]).CoreSound + '꧀ꦚ', + len: 2 + }; + } + else if (str.indexOf('n') == 1) { + // + return { + CoreSound: '' + this.GetCoreSound(this.str2[0]).CoreSound + '꧀ꦤ', + len: 2 + }; + } + // suku kata memiliki konsonan tersebut yang tidak di posisi kedua + if (str.indexOf('h') > 1 || + str.indexOf('g') > 1 || + str.indexOf('y') > 1 || + str.indexOf('r') > 1 || + str.indexOf('l') > 1 || + str.indexOf('w') > 1 || + str.indexOf('c') > 1 || + str.indexOf('j') > 1 || + str.indexOf('n') > 1 || + str.indexOf('ñ') > 1) { + let sound = ''; + let len = 0; + let index = 0; + for (index = 0; index < str.length; index++) { + const c = str[index]; + if (!isVowel(c)) { + sound += this.ResolveCharacterSound(c); + len++; + } + else { + break; + } + } + return { CoreSound: sound, len: len }; + } + return { CoreSound: null, len: 1 }; + } + GetCoreSound(str) { + const soundMap1 = { + // 26 uppercase for non-Murda, largely mirror lowercase, except AEIOU, and HR + A: 'ꦄ', + B: 'ꦧ', + C: 'ꦕ', + D: 'ꦢ', + E: 'ꦌ', + F: 'ꦥ꦳', + G: 'ꦒ', + H: 'ꦲ', + I: 'ꦆ', + J: 'ꦗ', + K: 'ꦏ', + L: 'ꦭ', + M: 'ꦩ', + N: 'ꦤ', + O: 'ꦎ', + P: 'ꦥ', + Q: '꧀', + R: 'ꦫ', + S: 'ꦱ', + T: 'ꦠ', + U: 'ꦈ', + V: 'ꦮ꦳', + W: 'ꦮ', + X: 'ꦼ', + Y: 'ꦪ', + Z: 'ꦰ' // Sa Mahaprana + // test: ABaCaDaEFaGaHaJaKaLaMaNaOPaRaSaTaUVaWaXYaZa + }; + const soundMap2 = { + // 26 uppercase for Murda (notice for J, Q, R, and Z) + A: 'ꦄ', + B: 'ꦨ', + C: 'ꦖ', + D: 'ꦣ', + E: 'ꦌ', + F: 'ꦦ꦳', + G: 'ꦓ', + H: 'ꦲ꦳', + I: 'ꦆ', + J: 'ꦙ', + K: 'ꦑ', + L: 'ꦭ', + M: 'ꦩ', + N: 'ꦟ', + O: 'ꦎ', + P: 'ꦦ', + Q: 'ꦐ', + R: 'ꦬ', + S: 'ꦯ', + T: 'ꦡ', + U: 'ꦈ', + V: 'ꦮ꦳', + W: 'ꦮ', + X: 'ꦼ', + Y: 'ꦪ', + Z: 'ꦰ' // Sa mahaprana + // test: ABaCaDaEFaGaHaJaKaLaMaNaOPaQaRaSaTaUVaWaXaYaZa + }; + const soundMap3 = { + // 26 lowercase + 35 special, same for both Murda or non-Murda + a: 'ꦲ', + b: 'ꦧ', + c: 'ꦕ', + d: 'ꦢ', + e: 'ꦲꦺ', + f: 'ꦥ꦳', + g: 'ꦒ', + h: 'ꦃ', + i: 'ꦲꦶ', + j: 'ꦗ', + k: 'ꦏ', + l: 'ꦭ', + m: 'ꦩ', + n: 'ꦤ', + o: 'ꦲꦺꦴ', + p: 'ꦥ', + q: '꧀', + r: 'ꦂ', + s: 'ꦱ', + t: 'ꦠ', + u: 'ꦲꦸ', + v: 'ꦮ꦳', + w: 'ꦮ', + x: 'ꦲꦼ', + y: 'ꦪ', + z: 'ꦗ꦳', + È: 'ꦌ', + É: 'ꦌ', + Ê: 'ꦄꦼ', + Ě: 'ꦄꦼ', + Ĕ: 'ꦄꦼ', + è: 'ꦲꦺ', + é: 'ꦲꦺ', + ê: 'ꦲꦼ', + ě: 'ꦲꦼ', + ĕ: 'ꦲꦼ', + ə: 'ꦲꦼ', + ɔ: 'ꦲ', + å: 'ꦲ', + ô: 'ꦲ', + â: 'ꦲꦴ', + ā: 'ꦲꦴ', + ī: 'ꦲꦷ', + ū: 'ꦲꦹ', + ō: 'ꦲꦼꦴ', + Ñ: 'ꦚ', + ñ: 'ꦚ', + ɲ: 'ꦚ', + Ŋ: 'ꦔ', + ŋ: 'ꦔ', + Ṇ: 'ꦟ', + ṇ: 'ꦟ', + Ḍ: 'ꦝ', + ḍ: 'ꦝ', + Ṭ: 'ꦛ', + ṭ: 'ꦛ', + ś: 'ꦯ', + Ṣ: 'ꦰ', + ṣ: 'ꦰ', + Ṛ: 'ꦽ', + ṛ: 'ꦽ' // idem + // test: Èè.Éé.Êê.Ěě.Ĕĕ.Ṛṛ.ôâāīūōåɔə + // test: ḌaḍaṆaṇaṢaṣaṬaṭaŊaŋaÑañaɲaśa + }; + let soundMap; + // var modeMurda = document.getElementsByName("murda"); + // for (var rad in modeMurda) { + // if (modeMurda[rad].checked) + // murda = modeMurda[rad].value; + // } + if (this.murda) + soundMap = { ...soundMap2, ...soundMap3 }; + // if(murda == "tidak") + else + soundMap = { ...soundMap1, ...soundMap3 }; + const h_shift = this.GetShift(str); + let core = str; + if (h_shift.CoreSound == null) { + if (soundMap[str.charAt(0)]) + core = soundMap[str.charAt(0)]; + return { + CoreSound: core, + len: 1 + }; + } + else { + return h_shift; + } + } + ResolveCharacterSound(c) { + const str = c.toString(); + if (isDigit(c)) { + return '' + ('꧇' + (parseInt(c) - 0)); + } + else if (isHR(str[0])) { + return '' + this.GetCoreSound(str).CoreSound; // layar dan wignyan + } + else if (isCJ(str[1])) { + return '' + this.GetCoreSound(str).CoreSound + '꧀'; // anuswara + } + else if (isConsonant(str[0])) { + return '' + this.GetCoreSound(str).CoreSound + '꧀'; + } + else { + // if (isVowel(str[0])) { + return '' + this.GetCoreSound(str).CoreSound; + } + } + GetSound(str) { + str = SuperTrim(str); + this.str2 = str.toLowerCase(); + if (str == null || str == '') + return ''; + const SpecialSound = GetSpecialSound(str); + if (SpecialSound != null && str.length == 1) + return SpecialSound; + if (str.length == 1) + return this.ResolveCharacterSound(str[0]); + else { + const core_sound = this.GetCoreSound(str); + // return "1"+core_sound.CoreSound+"2"; + let matra = ''; + let konsonan = ''; + if (core_sound.len >= 1) { + matra = this.GetMatra(str.substring(core_sound.len)); // xeiou (pepet, taling, suku, taling tarung, wulu, dll.) + /* if () { + + } else { + + } */ + } + else { + matra = ''; + } // a/å/ɔ + /* rules for some cluster like ngg- that have different behaviour depending if it's the start of a word or not. + TODO: find more elegant solution */ + if (this.str2.indexOf('nggr') == 0) { + // nggr- + if (this.vowelPrev) + konsonan = 'ꦁ​ꦒꦿ'; + // nggr-, e.g. panggrahita + // else if (matra = "") + else + konsonan = 'ꦔ꧀ꦒꦿ'; // nggr-, i.e. nggronjal + } + else if (this.str2.indexOf('nggl') == 0) { + // nggl-, e.g. ngglantung + konsonan = 'ꦔ꧀ꦒ꧀ꦭ'; + } + else if (this.str2.indexOf('nggw') == 0) { + // nggw-, e.g. munggwing + konsonan = 'ꦔ꧀ꦒ꧀ꦮ'; + } + else if (this.str2.indexOf('nggy') == 0) { + // nggy-, e.g. anggyat + konsonan = 'ꦔ꧀ꦒꦾ'; + } + else if (this.str2.indexOf('ngg') == 0) { + // ngg- + if (this.vowelPrev) + konsonan = 'ꦁ​ꦒ'; + // ngg-, e.g. tunggal + // else if (spacePrev) konsonan = "​ꦔ꧀";//ngg-, e.g. ditinggal nggambar (it has a zws) + else + konsonan = 'ꦔ꧀ꦒ'; // ngg-, i.e. nggambar + // for cluster longer than 4 consonants, such as "ditinggalnggambar", + // need to separate it by a space, "ditinggal nggambar" to be correct + } + else if (this.str2.indexOf('rlx') == 0) { + // r lx, e.g. pasarlxgi + konsonan = 'ꦂꦊ'; + matra = ''; + } + else if (this.str2.indexOf('rrx') == 0) { + // r rx + konsonan = 'ꦂꦉ'; + matra = ''; + } + else if (this.str2.indexOf('hlx') == 0) { + // h lx + if (this.vowelPrev) { + konsonan = 'ꦃꦊ'; + matra = ''; + } + else + konsonan = 'ꦲ꧀ꦭꦼ'; + matra = ''; + } + else if (this.str2.indexOf('hrx') == 0) { + // h rx + if (this.vowelPrev) { + konsonan = 'ꦃꦉ'; + matra = ''; + } + else + konsonan = 'ꦲꦽ'; + matra = ''; + } + else if (this.str2.indexOf('qlx') == 0) { + // just pasangan la + pepet + konsonan = '꧀ꦭꦼ'; + matra = ''; + } + else if (this.str2.indexOf('qrx') == 0) { + // just cakra keret + konsonan = 'ꦽ'; + matra = ''; + } + else if (core_sound.CoreSound == 'ꦂꦂꦮ') { + // -rw- + if (this.vowelPrev) + konsonan = 'ꦂꦮ'; + // -rw- -- arwana + else + konsonan = 'ꦫ꧀ꦮ'; // rw- -- rwa/rwi/rwab + } + else if (core_sound.CoreSound == 'ꦃꦃꦭ') { + // -hl- + if (this.vowelPrev) + konsonan = 'ꦃꦭ'; + // -hl- + else + konsonan = 'ꦲ꧀ꦭ'; // hlam + } + else if (core_sound.CoreSound == 'ꦃꦃꦮ') { + // -hw- + if (this.vowelPrev) + konsonan = 'ꦃꦮ'; + // -hw- + else + konsonan = 'ꦲ꧀ꦮ'; // hwab,hwan + } + else if (core_sound.CoreSound == 'ꦃꦲꦾ') { + // -hy- + if (this.vowelPrev) + konsonan = 'ꦃꦪ'; + // sembahyang + else + konsonan = 'ꦲꦾ'; // hyang + /* rules for some characters that change depends on the matra/vowel (e.g. lx and rx, and -rx) */ + } + else if (findstr(core_sound.CoreSound, 'ꦾ') && matra == '꧀') { + // pengkal + konsonan = core_sound.CoreSound; + matra = ''; // -y- + } + else if (findstr(core_sound.CoreSound, 'ꦿ') && matra == '꧀') { + // cakra + konsonan = core_sound.CoreSound; + matra = ''; // -r- + } + else if (findstr(core_sound.CoreSound, 'ꦿ') && matra == 'ꦼ') { + // cakra keret + if ((str[0] == 'n' && str[1] == 'y') || + ((str[0] == 't' || str[0] == 'd') && str[1] == 'h')) { + konsonan = this.GetCoreSound(str[0] + str[1]).CoreSound + 'ꦽ'; + matra = ''; // nyrê-, thrê-, dhrê- + } + else if (str[0] == 'n' && str[1] == 'g') { + if (str[2] == 'g') + konsonan = 'ꦔ꧀ꦒꦽ'; + else + konsonan = 'ꦔꦽ'; + matra = ''; // nggrê-/ngrê- + } + else { + konsonan = this.GetCoreSound(str[0]).CoreSound + 'ꦽ'; + matra = ''; // -rê- + } + } + else if (findstr(core_sound.CoreSound, 'ꦭ') && matra == 'ꦼ') { + // nga lelet + if ((str[0] == 'n' && str[1] == 'y') || + ((str[0] == 't' || str[0] == 'd') && str[1] == 'h')) { + konsonan = this.GetCoreSound(str[0] + str[1]).CoreSound + '꧀ꦭꦼ'; + matra = ''; // nylê-, thlê-, dhlê- + } + else if (str[0] == 'n' && str[1] == 'g') { + if (str[2] == 'g') + konsonan = 'ꦔ꧀ꦒ꧀ꦭꦼ'; + else + konsonan = 'ꦔ꧀ꦭꦼ'; + matra = ''; // ngglê-/nglê- + } + else if (str[0] == 'l') { + konsonan = 'ꦊ'; + matra = ''; // -lê- + } + else { + konsonan = this.GetCoreSound(str[0]).CoreSound + '꧀ꦭꦼ'; + matra = ''; // -lê- + } + } + else if (core_sound.CoreSound == 'ꦃ' && matra == '꧀') { + // wignyan - 12 April + konsonan = 'ꦲ'; // ha + } + else if (core_sound.CoreSound == 'ꦃ' && matra != '꧀') { + // wignyan + konsonan = 'ꦲ'; // ha + } + else if (core_sound.CoreSound == 'ꦂ' && matra == 'ꦼ') { + // pa cerek + konsonan = 'ꦉ'; + matra = ''; // rê + } + else if (core_sound.CoreSound == 'ꦂ' && matra == '꧀') { + // layar + konsonan = 'ꦫ'; // ra + } + else if (core_sound.CoreSound == 'ꦂ' && matra != '꧀') { + // layar + konsonan = 'ꦫ'; // ra + } + else if (core_sound.CoreSound == 'ꦁ​' && matra == '꧀') { + // cecak + konsonan = 'ꦁ​'; + matra = ''; // cecak + } + else if (core_sound.CoreSound == 'ꦁ​' && matra != '꧀') { + // cecak + konsonan = 'ꦔ'; // nga + } + else { + konsonan = core_sound.CoreSound; + } + return '' + konsonan + matra; + } + } + toLatin() { + // var agt = navigator.userAgent.toLowerCase(); + // if (agt.indexOf("msie")!=-1) { //IE + // var range = document.selection.createRange() + // txt = range.text; + // if (txt == '') { + // var str = window.document.formText.editSrc.value; + // }else{ + // var str = range.text; + // } + // } + // else { + // str = window.document.formText.editSrc.value; + // } + const ganti = (index, character, str) => str.substr(0, index) + character; + const ganti2 = (index, character, str) => str.substr(0, index - 1) + character; + const ganti3 = (index, character, str) => str.substr(0, index - 2) + character; + // const capitalize = (index: number, character: string, str: string) => + // str.charAt(0).toUpperCase() + str.slice(1) + let trans = this.str; + const regexp_file = this.aksara2Latin(); + for (let i = 0, j = 0; i < this.str.length; i++) { + if (!regexp_file[this.str[i]]) { + // not Aksara Jawa + trans = ganti(j, this.str[i], trans); + j++; + } + else { + if (this.str[i] == 'ꦴ' || + this.str[i] == 'ꦶ' || + this.str[i] == 'ꦸ' || + this.str[i] == 'ꦺ' || + this.str[i] == 'ꦼ') { + if (i > 2 && this.str[i - 1] == 'ꦲ' && this.str[i - 2] == 'ꦲ') { + // -hah- + if (this.str[i] == 'ꦴ') + trans = ganti3(j, 'ā', trans); + else if (this.str[i] == 'ꦶ') + trans = ganti3(j, 'ai', trans); + else if (this.str[i] == 'ꦸ') + trans = ganti3(j, 'au', trans); + else if (this.str[i] == 'ꦺ') + trans = ganti3(j, 'ae', trans); + else if (this.str[i] == 'ꦼ') + trans = ganti3(j, 'aě', trans); + // str[i] == "ꦶ" || str[i] == "ꦸ" || str[i] == "ꦺ" || str[i] == "ꦼ" + } + else if (i > 2 && this.str[i - 1] == 'ꦲ') { + // -h- + if (this.str[i] == 'ꦴ') + trans = ganti2(j, 'ā', trans); + else if (this.str[i] == 'ꦶ') + trans = ganti2(j, 'i', trans); + else if (this.str[i] == 'ꦸ') + trans = ganti2(j, 'u', trans); + else if (this.str[i] == 'ꦺ') + trans = ganti2(j, 'e', trans); + else if (this.str[i] == 'ꦼ') + trans = ganti2(j, 'ě', trans); + } /**/ + else if (i > 0 && + this.str[i] == 'ꦴ' && + this.str[i - 1] == 'ꦺ') { + trans = ganti2(j, 'o', trans); // -o //2 aksara -> 1 huruf + } + else if (i > 0 && this.str[i] == 'ꦴ' && this.str[i - 1] == 'ꦻ') { + trans = ganti3(j, 'au', trans); // -au //2 aksara -> 2 huruf + } + else if (this.str[i] == 'ꦴ') { + trans = ganti(j, 'aa', trans); // -aa + j++; + } + else if (i > 0 && + (this.str[i] == 'ꦶ' || + this.str[i] == 'ꦸ' || + this.str[i] == 'ꦺ' || + this.str[i] == 'ꦼ') && + (this.str[i - 1] == 'ꦄ' || + this.str[i - 1] == 'ꦌ' || + this.str[i - 1] == 'ꦆ' || + this.str[i - 1] == 'ꦎ' || + this.str[i - 1] == 'ꦈ')) { + trans = ganti(j, regexp_file[this.str[i]], trans); + j++; + } + else { + trans = ganti2(j, regexp_file[this.str[i]], trans); + } + } + else if (this.str[i] == 'ꦽ' || + this.str[i] == 'ꦾ' || + this.str[i] == 'ꦿ' || + this.str[i] == 'ꦷ' || + this.str[i] == 'ꦹ' || + this.str[i] == 'ꦻ' || + this.str[i] == 'ꦇ' || + this.str[i] == 'ꦍ') { + // 1 aksara -> 2 huruf + trans = ganti2(j, regexp_file[this.str[i]], trans); + j++; + } + else if (this.str[i] == '꦳') { + // 2 aksara -> 2 huruf + if (i > 0 && this.str[i - 1] == 'ꦗ') { + if (i > 1 && this.str[i - 2] == '꧊') { + trans = ganti3(j, 'Za', trans); + } + else { + trans = ganti3(j, 'za', trans); + } + } + else if (i > 0 && this.str[i - 1] == 'ꦥ') { + if (i > 1 && this.str[i - 2] == '꧊') { + trans = ganti3(j, 'Fa', trans); + } + else { + trans = ganti3(j, 'fa', trans); + } + } + else if (i > 0 && this.str[i - 1] == 'ꦮ') { + if (i > 1 && this.str[i - 2] == '꧊') { + trans = ganti3(j, 'Va', trans); + } + else { + trans = ganti3(j, 'va', trans); + } // catatan, "va" biasanya ditulis sama dengan "fa" (dengan pa+cecak telu), variannya adalah wa+cecak telu. + } + else if (i > 0 && this.str[i - 1] == 'ꦲ') { + if (i > 1 && this.str[i - 2] == '꧊') { + trans = ganti3(j, 'Ḥa', trans); + } + else { + trans = ganti3(j, 'ḥa', trans); + } + } + else if (i > 0 && this.str[i - 1] == 'ꦏ') { + if (i > 1 && this.str[i - 2] == '꧊') { + trans = ganti3(j, 'Kha', trans); + j++; + } + else { + trans = ganti3(j, 'kha', trans); + j++; + } + } + else if (i > 0 && this.str[i - 1] == 'ꦢ') { + if (i > 1 && this.str[i - 2] == '꧊') { + trans = ganti3(j, 'Dza', trans); + j++; + } + else { + trans = ganti3(j, 'dza', trans); + j++; + } + } + else if (i > 0 && this.str[i - 1] == 'ꦱ') { + if (i > 1 && this.str[i - 2] == '꧊') { + trans = ganti3(j, 'Sya', trans); + j++; + } + else { + trans = ganti3(j, 'sya', trans); + j++; + } + } + else if (i > 0 && this.str[i - 1] == 'ꦒ') { + if (i > 1 && this.str[i - 2] == '꧊') { + trans = ganti3(j, 'Gha', trans); + j++; + } + else { + trans = ganti3(j, 'gha', trans); + j++; + } + } + else if (i > 0 && this.str[i - 1] == 'ꦔ') { + trans = ganti3(j, "'a", trans); + } + else { + trans = ganti2(j, regexp_file[this.str[i]], trans); + } + } + else if (this.str[i] == '꧀') { + trans = ganti2(j, regexp_file[this.str[i]], trans); + } + else if (this.str[i] == 'ꦏ' || + this.str[i] == 'ꦐ' || + this.str[i] == 'ꦒ' || + this.str[i] == 'ꦕ' || + this.str[i] == 'ꦗ' || + this.str[i] == 'ꦟ' || + this.str[i] == 'ꦠ' || + this.str[i] == 'ꦡ' || + this.str[i] == 'ꦢ' || + this.str[i] == 'ꦣ' || + this.str[i] == 'ꦤ' || + this.str[i] == 'ꦥ' || + this.str[i] == 'ꦧ' || + this.str[i] == 'ꦩ' || + this.str[i] == 'ꦪ' || + this.str[i] == 'ꦫ' || + this.str[i] == 'ꦬ' || + this.str[i] == 'ꦭ' || + this.str[i] == 'ꦮ' || + this.str[i] == 'ꦯ' || + this.str[i] == 'ꦰ' || + this.str[i] == 'ꦱ' || + this.str[i] == 'ꦉ' || + this.str[i] == 'ꦊ' || + this.str[i] == 'ꦁ' || + this.str[i] == 'ꦲ' || + this.str[i] == 'ꦑ' || + this.str[i] == 'ꦓ' || + this.str[i] == 'ꦖ' || + this.str[i] == 'ꦙ' || + this.str[i] == 'ꦡ' || + this.str[i] == 'ꦣ' || + this.str[i] == 'ꦦ' || + this.str[i] == 'ꦨ') { + if (i > 0 && this.str[i - 1] == '꧊') { + if (this.str[i] == 'ꦐ') { + trans = ganti(j, 'Qa', trans); + j += 2; + } + else if (this.str[i] == 'ꦧ' || this.str[i] == 'ꦨ') { + trans = ganti(j, 'Ba', trans); + j += 2; + } + else if (this.str[i] == 'ꦕ' || this.str[i] == 'ꦖ') { + trans = ganti(j, 'Ca', trans); + j += 2; + } + else if (this.str[i] == 'ꦢ' || this.str[i] == 'ꦣ') { + trans = ganti(j, 'Da', trans); + j += 2; + } + else if (this.str[i] == 'ꦒ' || this.str[i] == 'ꦓ') { + trans = ganti(j, 'Ga', trans); + j += 2; + } + else if (this.str[i] == 'ꦲ') { + if (i > 0 && + (this.str[i - 1] == 'ꦼ' || + this.str[i - 1] == 'ꦺ' || + this.str[i - 1] == 'ꦶ' || + this.str[i - 1] == 'ꦴ' || + this.str[i - 1] == 'ꦸ' || + this.str[i - 1] == 'ꦄ' || + this.str[i - 1] == 'ꦌ' || + this.str[i - 1] == 'ꦆ' || + this.str[i - 1] == 'ꦎ' || + this.str[i - 1] == 'ꦈ' || + this.str[i - 1] == 'ꦿ' || + this.str[i - 1] == 'ꦾ' || + this.str[i - 1] == 'ꦽ')) { + trans = ganti(j, 'h' + regexp_file[this.str[i]], trans); + j += 2; + } + if (i > 0 && this.str[i - 1] == '꧊') { + trans = ganti(j, 'H' + regexp_file[this.str[i]], trans); + j += 2; + } + else { + trans = ganti(j, '@' + regexp_file[this.str[i]], trans); + j += 2; + } + // trans = ganti(j, "Ha", trans);j+=2; + } + else if (this.str[i] == 'ꦗ' || this.str[i] == 'ꦙ') { + trans = ganti(j, 'Ja', trans); + j += 2; + } + else if (this.str[i] == 'ꦏ' || this.str[i] == 'ꦑ') { + trans = ganti(j, 'Ka', trans); + j += 2; + } + else if (this.str[i] == 'ꦭ') { + trans = ganti(j, 'La', trans); + j += 2; + } + else if (this.str[i] == 'ꦩ') { + trans = ganti(j, 'Ma', trans); + j += 2; + } + else if (this.str[i] == 'ꦤ' || this.str[i] == 'ꦟ') { + trans = ganti(j, 'Na', trans); + j += 2; + } + else if (this.str[i] == 'ꦥ' || this.str[i] == 'ꦦ') { + trans = ganti(j, 'Pa', trans); + j += 2; + } + else if (this.str[i] == 'ꦫ' || this.str[i] == 'ꦬ') { + trans = ganti(j, 'Ra', trans); + j += 2; + } + else if (this.str[i] == 'ꦱ' || this.str[i] == 'ꦯ') { + trans = ganti(j, 'Sa', trans); + j += 2; + } + else if (this.str[i] == 'ꦠ' || this.str[i] == 'ꦡ') { + trans = ganti(j, 'Ta', trans); + j += 2; + } + else if (this.str[i] == 'ꦮ') { + trans = ganti(j, 'Wa', trans); + j += 2; + } + else if (this.str[i] == 'ꦪ') { + trans = ganti(j, 'Ya', trans); + j += 2; + } + else { + ganti(j, regexp_file[this.str[i]], trans); + j += 3; + } + } + else if (i > 0 && this.str[i] == 'ꦲ' && this.str[i - 1] == 'ꦃ') { + // double hh + trans = ganti(j, 'a', trans); + j++; + } + else if (i > 0 && this.str[i] == 'ꦫ' && this.str[i - 1] == 'ꦂ') { + // double rr + trans = ganti(j, 'a', trans); + j++; + } + else if (i > 0 && this.str[i] == 'ꦔ' && this.str[i - 1] == 'ꦁ') { + // double ngng + trans = ganti(j, 'a', trans); + j++; + } + else if (i > 1 && + this.str[i] == 'ꦕ' && + this.str[i - 1] == '꧀' && + this.str[i - 2] == 'ꦚ') { + // nyj & nyc + trans = ganti(j - 3, 'nca', trans); + } + else if (i > 1 && + this.str[i] == 'ꦗ' && + this.str[i - 1] == '꧀' && + this.str[i - 2] == 'ꦚ') { + // nyj & nyc + trans = ganti(j - 3, 'nja', trans); + } + else if (this.str[i] == 'ꦲ' && + (i == 0 || + [ + ' ', + '​', + '꧀', + '꦳', + 'ꦴ', + 'ꦶ', + 'ꦷ', + 'ꦸ', + 'ꦹ', + 'ꦺ', + 'ꦻ', + 'ꦼ', + 'ꦽ', + 'ꦾ', + 'ꦿ' + ].indexOf(this.str[i - 1]) >= 0)) { + // ha, preceeded by space or zws or open vowel + trans = ganti(j, '_a', trans); + j += 2; + } + else if (this.str[i] == 'ꦑ' || + this.str[i] == 'ꦓ' || + this.str[i] == 'ꦖ' || + this.str[i] == 'ꦙ' || + this.str[i] == 'ꦡ' || + this.str[i] == 'ꦣ' || + this.str[i] == 'ꦦ' || + this.str[i] == 'ꦨ') { + // bha, cha, dha, dll. + trans = ganti(j, regexp_file[this.str[i]], trans); + j += 3; + } + else { + // ba, ca, da, dll. + trans = ganti(j, regexp_file[this.str[i]], trans); + j += 2; + } + } + else if (this.str[i] == 'ꦔ' || + this.str[i] == 'ꦘ' || + this.str[i] == 'ꦚ' || + this.str[i] == 'ꦛ' || + this.str[i] == 'ꦜ' || + this.str[i] == 'ꦝ' || + this.str[i] == 'ꦞ' || + this.str[i] == 'ꦋ') { + // nga, nya, tha, dha + if (i > 0 && this.str[i - 1] == '꧊') { + if (this.str[i] == 'ꦔ') { + trans = ganti(j, 'Nga', trans); + j += 3; + } + else if (this.str[i] == 'ꦚ' || this.str[i] == 'ꦘ') { + trans = ganti(j, 'Nya', trans); + j += 3; + } + else if (this.str[i] == 'ꦛ' || this.str[i] == 'ꦜ') { + trans = ganti(j, 'Tha', trans); + j += 3; + } + else if (this.str[i] == 'ꦝ' || this.str[i] == 'ꦞ') { + trans = ganti(j, 'Dha', trans); + j += 3; + } + else { + ganti(j, regexp_file[this.str[i]], trans); + j += 3; + } + } + else if (i > 0 && this.str[i] == 'ꦘ') { + trans = ganti(j, regexp_file[this.str[i]], trans); + j += 4; + } + else { + trans = ganti(j, regexp_file[this.str[i]], trans); + j += 3; + } + } + else if (this.str[i] == '꧊') { + // penanda nama diri -- made up for Latin back-compat + trans = ganti(j, '', trans); + } + else if ((this.str[i] == ' ', trans)) { + if (i > 0 && this.str[i - 1] == '꧀') { + // pangkon diikuti regular space = koma + trans = ganti(j, ', ', trans); + j += 2; + } + else { + trans = ganti(j, ' ', trans); + j++; + } + } + else if ((this.str[i] == '꧈', trans)) { + if (i > 0 && this.str[i - 1] == '꧀') { + // pangkon diikuti pada lingsa = titik + trans = ganti(j, '.', trans); + j++; + } + else { + // pada lingsa saja = koma + trans = ganti(j, ',', trans); + j++; + } + } + else { + trans = ganti(j, regexp_file[this.str[i]], trans); + j++; + } + } + } + trans = trans + .split(' ') + .map((v) => v.startsWith('_') ? v.replace('_', this.isHVokal ? '' : 'h') : v) + .join(' '); + return trans.toString(); + } + aksara2Latin() { + return { + ꦏ: 'ka', + ꦐ: 'qa', + ꦑ: 'kʰa', + ꦒ: 'ga', + ꦓ: 'gʰa', + ꦔ: 'nga', + ꦕ: 'ca', + ꦖ: 'cʰa', + ꦗ: 'ja', + ꦘ: 'jnya', + ꦙ: 'jʰa', + ꦚ: 'nya', + ꦛ: 'tha', + ꦜ: 'ṭʰa', + ꦝ: 'dha', + ꦞ: 'ḍʰa', + ꦟ: 'ṇa', + ꦠ: 'ta', + ꦡ: 'ṭa', + ꦢ: 'da', + ꦣ: 'ḍa', + ꦤ: 'na', + ꦥ: 'pa', + ꦦ: 'pʰa', + ꦧ: 'ba', + ꦨ: 'bʰa', + ꦩ: 'ma', + ꦪ: 'ya', + ꦫ: 'ra', + ꦬ: 'ṛa', + ꦭ: 'la', + ꦮ: 'wa', + ꦯ: 'śa', + ꦰ: 'ṣa', + ꦱ: 'sa', + ꦲ: 'ha', + 'ꦁ': 'ng', + 'ꦂ': 'r', + 'ꦃ': 'h', + ꦄ: 'A', + ꦅ: 'I', + ꦆ: 'I', + ꦇ: 'Ii', + ꦈ: 'U', + ꦉ: 'rê', + ꦊ: 'lê', + ꦋ: 'lêu', + ꦌ: 'E', + ꦍ: 'Ai', + ꦎ: 'O', + 'ꦺꦴ': 'o', + 'ꦴ': 'a', + 'ꦶ': 'i', + 'ꦷ': 'ii', + 'ꦸ': 'u', + 'ꦹ': 'uu', + 'ꦺ': 'e', + 'ꦻ': 'ai', + 'ꦼ': 'ê', + 'ꦽ': 'rê', + 'ꦾ': 'ya', + 'ꦿ': 'ra', + 'ꦀ': '', + '꦳': '​', + '꧀': '​', + '꧇': '​', + '꧁': '—', + '꧂': '—', + '꧃': '–', + '꧄': '–', + '꧅': '–', + '꧆': '', + '꧈': ',', + '꧉': '.', + '꧊': 'qqq', + '꧋': '–', + '꧌': '–', + '꧍': '–', + ꧏ: '²', + '꧐': '0', + '꧑': '1', + '꧒': '2', + '꧓': '3', + '꧔': '4', + '꧕': '5', + '꧖': '6', + '꧗': '7', + '꧘': '8', + '꧙': '9', + '꧞': '—', + '꧟': '—', + // "​": '#',//zero-width joiner + '​': ' ', + ' ': ' ' // regular space + }; + } +} +//# sourceMappingURL=aksarajawa.js.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/esm/texts/aksarajawa.js.map b/node_modules/@bochilteam/scraper/lib/esm/texts/aksarajawa.js.map new file mode 100644 index 000000000..904c1819b --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/esm/texts/aksarajawa.js.map @@ -0,0 +1 @@ +{"version":3,"file":"aksarajawa.js","s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,EAAE,GAAG;YACR,CAAC,EAAE,GAAG;YACN,GAAG,EAAE,GAAG;YACR,GAAG,EAAE,GAAG;YACR,GAAG,EAAE,GAAG;YACR,GAAG,EAAE,GAAG;YACR,GAAG,EAAE,GAAG;YACR,GAAG,EAAE,GAAG;YACR,GAAG,EAAE,GAAG;YACR,GAAG,EAAE,GAAG;YACR,GAAG,EAAE,GAAG;YACR,GAAG,EAAE,GAAG;YACR,GAAG,EAAE,GAAG;YACR,GAAG,EAAE,GAAG;YACR,+BAA+B;YAC/B,GAAG,EAAE,GAAG;YACR,GAAG,EAAE,GAAG,CAAC,gBAAgB;SAC1B,CAAA;IACH,CAAC;CACD"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/esm/texts/bucin.js b/node_modules/@bochilteam/scraper/lib/esm/texts/bucin.js new file mode 100644 index 000000000..29cf5212c --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/esm/texts/bucin.js @@ -0,0 +1,9 @@ +import got from 'got'; +export let bucinjson = []; +export default async function bucin() { + if (!bucinjson.length) { + bucinjson = await got('https://raw.githubusercontent.com/BochilTeam/database/master/kata-kata/bucin.json').json(); + } + return bucinjson[Math.floor(bucinjson.length * Math.random())]; +} +//# sourceMappingURL=bucin.js.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/esm/texts/bucin.js.map b/node_modules/@bochilteam/scraper/lib/esm/texts/bucin.js.map new file mode 100644 index 000000000..b3bb262cd --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/esm/texts/bucin.js.map @@ -0,0 +1 @@ +{"version":3,"file":"bucin.js","sourceRoot":"","sources":["../../../src/texts/bucin.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,KAAK,CAAA;AACrB,MAAM,CAAC,IAAI,SAAS,GAAa,EAAE,CAAA;AACnC,MAAM,CAAC,OAAO,CAAC,KAAK,UAAU,KAAK;IACjC,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE;QACrB,SAAS,GAAG,MAAM,GAAG,CACnB,mFAAmF,CACpF,CAAC,IAAI,EAAE,CAAA;KACT;IACD,OAAO,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC,CAAA;AAChE,CAAC"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/esm/texts/dare.js b/node_modules/@bochilteam/scraper/lib/esm/texts/dare.js new file mode 100644 index 000000000..14ca0f94e --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/esm/texts/dare.js @@ -0,0 +1,9 @@ +import got from 'got'; +export let darejson = []; +export default async function dare() { + if (!darejson.length) { + darejson = await got('https://raw.githubusercontent.com/BochilTeam/database/master/kata-kata/dare.json').json(); + } + return darejson[Math.round(darejson.length * Math.random())]; +} +//# sourceMappingURL=dare.js.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/esm/texts/dare.js.map b/node_modules/@bochilteam/scraper/lib/esm/texts/dare.js.map new file mode 100644 index 000000000..9c65473c8 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/esm/texts/dare.js.map @@ -0,0 +1 @@ +{"version":3,"file":"dare.js","sourceRoot":"","sources":["../../../src/texts/dare.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,KAAK,CAAA;AACrB,MAAM,CAAC,IAAI,QAAQ,GAAa,EAAE,CAAA;AAClC,MAAM,CAAC,OAAO,CAAC,KAAK,UAAU,IAAI;IAChC,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE;QACpB,QAAQ,GAAG,MAAM,GAAG,CAClB,kFAAkF,CACnF,CAAC,IAAI,EAAE,CAAA;KACT;IACD,OAAO,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC,CAAA;AAC9D,CAAC"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/esm/texts/index.js b/node_modules/@bochilteam/scraper/lib/esm/texts/index.js new file mode 100644 index 000000000..c64f20639 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/esm/texts/index.js @@ -0,0 +1,7 @@ +import bucin, { bucinjson } from './bucin.js'; +import dare, { darejson } from './dare.js'; +import truth, { truthjson } from './truth.js'; +import textpro, { textproList } from './textpro.js'; +export * from './aksarajawa.js'; +export { bucin, bucinjson, dare, darejson, truth, truthjson, textpro, textproList }; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/esm/texts/index.js.map b/node_modules/@bochilteam/scraper/lib/esm/texts/index.js.map new file mode 100644 index 000000000..269be2261 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/esm/texts/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/texts/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AAC7C,OAAO,IAAI,EAAE,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAA;AAC1C,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AAC7C,OAAO,OAAO,EAAE,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAEnD,cAAc,iBAAiB,CAAA;AAC/B,OAAO,EACL,KAAK,EAAE,SAAS,EAChB,IAAI,EAAE,QAAQ,EACd,KAAK,EAAE,SAAS,EAChB,OAAO,EAAE,WAAW,EACrB,CAAA"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/esm/texts/test.js b/node_modules/@bochilteam/scraper/lib/esm/texts/test.js new file mode 100644 index 000000000..af559ad09 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/esm/texts/test.js @@ -0,0 +1,84 @@ +import { expect } from 'chai'; +import { latinToAksara, aksaraToLatin, bucin, bucinjson, dare, darejson, truth, truthjson, textpro, textproList } from './index.js'; +describe('Texts', () => { + describe('Aksara Jawa', () => { + it('Latin to Aksara', done => { + try { + const res = latinToAksara('hallo rek'); + expect(res).equal('ꦲꦭ꧀ꦭꦺꦴ​ꦫꦺꦏ꧀'); + return done(); + } + catch (e) { + return done(e); + } + }); + it('Aksara to Latin', done => { + try { + const res = aksaraToLatin('ꦲꦭ꧀ꦭꦺꦴ​ꦫꦺꦏ꧀', { HVokal: false }); + expect(res).equal('hal​lo rek​'); + return done(); + } + catch (e) { + return done(e); + } + }); + }); + describe('Bucin', () => { + it('Bucin', done => { + bucin().then(res => { + expect(res).to.be.a('string'); + return done(); + }).catch(done); + }); + it('Bucin JSON', done => { + const res = bucinjson; + expect(res).to.be.an('array'); + expect(res).to.have.lengthOf.at.least(365); + return done(); + }); + }); + describe('Dare', () => { + it('Dare', done => { + dare().then(res => { + expect(res).to.be.a('string'); + return done(); + }).catch(done); + }); + it('Dare JSON', done => { + const res = darejson; + expect(res).to.be.an('array'); + expect(res).to.have.lengthOf.at.least(63); + return done(); + }); + }); + describe('Truth', () => { + it('Truth', done => { + truth().then(res => { + expect(res).to.be.a('string'); + return done(); + }).catch(done); + }); + it('Truth JSON', done => { + const res = truthjson; + expect(res).to.be.an('array'); + expect(res).to.have.lengthOf.at.least(61); + return done(); + }); + }); + describe('TextPro', () => { + it('TextPro', done => { + textpro('neon', ['Hallo']).then(res => { + expect(res).to.be.a('string'); + return done(); + }).catch(done); + }); + it('TextPro List', done => { + Promise.resolve(textproList).then(res => { + expect(res).to.be.an('array'); + expect(res).to.have.lengthOf.at.least(1); + return done(); + }).catch(done); + }); + }); +}); +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/esm/texts/test.js.map b/node_modules/@bochilteam/scraper/lib/esm/texts/test.js.map new file mode 100644 index 000000000..81fd64cd8 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/esm/texts/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["../../../src/texts/test.ts"],"names":[],"mappings":"A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CAAC,EAAE,CAAC,OAAO,CAAC,CAAA;gBAC7B,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;gBAExC,OAAO,IAAI,EAAE,CAAA;YACf,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;QAChB,CAAC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/esm/texts/textpro.js b/node_modules/@bochilteam/scraper/lib/esm/texts/textpro.js new file mode 100644 index 000000000..9c0e41b2a --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/esm/texts/textpro.js @@ -0,0 +1,53 @@ +import got from 'got'; +import { load } from 'cheerio'; +import FormData from 'form-data'; +import { ScraperError } from '../utils.js'; +const BASE_URL = 'https://textpro.me'; +export const textproList = (async () => got('https://raw.githubusercontent.com/BochilTeam/scraper/master/data/textpro.json').json())(); +export default async function textpro(effect, params) { + var _a; + const list = await textproList; + const textpro = list.find(({ title }) => title.toLowerCase() === effect.toLowerCase()); + if (!textpro) + throw new Error(`TextPro "${effect}" not found`); + if (!Array.isArray(params)) + params = [params]; + const { link, parameters } = textpro; + if (parameters.length > params.length) + throw new Error(`TextPro "${effect}" requires ${parameters.length} parameters, but ${params.length} given`); + const resToken = await got(`${BASE_URL}${link}`); + const cookie = (_a = resToken.headers['set-cookie']) === null || _a === void 0 ? void 0 : _a.map(c => c.split(';')[0]).join('; ').trim(); + const HEADERS = { + cookie: cookie || '__gads=ID=63da40a14f3eb127-22dccf741fd10073:T=1648080134:RT=1648080134:S=ALNI_MZfEIreNTkduqqV5CgZnuei_X1xLQ; _ga=GA1.2.342524260.1648080135; _gid=GA1.2.2036288127.1648080139; PHPSESSID=7fmr2ig9k8r7n9g9uk7fcj2ru1; _gat_gtag_UA_114571019_5=1', + 'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.82 Safari/537.36' + }; + const $ = load(resToken.body); + const token = $('#token').val(); + const build_server = $('#build_server').val(); + const build_server_id = $('#build_server_id').val(); + const form = new FormData(); + for (const param of params) + form.append('text[]', param); + form.append('submit', 'Go'); + form.append('token', token); + form.append('build_server', build_server); + form.append('build_server_id', build_server_id); + const html = await got(`${BASE_URL}${link}`, { + method: 'POST', + headers: { + ...HEADERS, + ...form.getHeaders() + }, + body: form.getBuffer() + }).text(); + const $$ = load(html); + const form2 = $$('#form_value').eq(0).text(); + if (!form2) + throw new ScraperError(`TextPro "${effect}" failed`, html); + const json = await got.post(`${BASE_URL}/effect/create-image`, { + headers: HEADERS, + form: JSON.parse(form2) + }).json(); + return `${BASE_URL}${json.image || json.fullsize_image}`; +} +//# sourceMappingURL=textpro.js.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/esm/texts/textpro.js.map b/node_modules/@bochilteam/scraper/lib/esm/texts/textpro.js.map new file mode 100644 index 000000000..df48603a8 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/esm/texts/textpro.js.map @@ -0,0 +1 @@ +{"version":3,"file":"textpro.js","sourceRoot":"","sources":["../../../src/texts/textpro.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,KAAK,CAAA;AACrB,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAC9B,OAAO,QAAQ,MAAM,WAAW,CAAA;AAEhC,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAY1C,MAAM,QAAQ,GAAG,oBAAoB,CAAA;AAErC,MAAM,CAAC,MAAM,WAAW,GAA2B,CAAC,KAAK,IAAI,EAAE,CAAC,GAAG,CAAC,+EAA+E,CAAC,CAAC,IAAI,EAAiB,CAAC,EAAE,CAAA;AAC7K,MAAM,CAAC,OAAO,CAAC,KAAK,UAAU,OAAO,CAAE,MAAc,EAAE,MAAyB;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,IAAI,CAAC,cAAc,EAAE,CAAA;AAC1D,CAAC"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/esm/texts/truth.js b/node_modules/@bochilteam/scraper/lib/esm/texts/truth.js new file mode 100644 index 000000000..340a3046b --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/esm/texts/truth.js @@ -0,0 +1,9 @@ +import got from 'got'; +export let truthjson = []; +export default async function truth() { + if (!truthjson.length) { + truthjson = await got('https://raw.githubusercontent.com/BochilTeam/database/master/kata-kata/truth.json').json(); + } + return truthjson[Math.floor(truthjson.length * Math.random())]; +} +//# sourceMappingURL=truth.js.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/esm/texts/truth.js.map b/node_modules/@bochilteam/scraper/lib/esm/texts/truth.js.map new file mode 100644 index 000000000..7bd8d2af8 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/esm/texts/truth.js.map @@ -0,0 +1 @@ +{"version":3,"file":"truth.js","sourceRoot":"","sources":["../../../src/texts/truth.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,KAAK,CAAA;AAErB,MAAM,CAAC,IAAI,SAAS,GAAa,EAAE,CAAA;AACnC,MAAM,CAAC,OAAO,CAAC,KAAK,UAAU,KAAK;IACjC,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE;QACrB,SAAS,GAAG,MAAM,GAAG,CACnB,mFAAmF,CACpF,CAAC,IAAI,EAAE,CAAA;KACT;IACD,OAAO,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC,CAAA;AAChE,CAAC"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/esm/texts/types.js b/node_modules/@bochilteam/scraper/lib/esm/texts/types.js new file mode 100644 index 000000000..718fd38ae --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/esm/texts/types.js @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=types.js.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/esm/texts/types.js.map b/node_modules/@bochilteam/scraper/lib/esm/texts/types.js.map new file mode 100644 index 000000000..4ff7d1ff2 --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/esm/texts/types.js.map @@ -0,0 +1 @@ +{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/texts/types.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/esm/utils.js b/node_modules/@bochilteam/scraper/lib/esm/utils.js new file mode 100644 index 000000000..d8acc04ea --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/esm/utils.js @@ -0,0 +1,53 @@ +export class ScraperError extends Error { + constructor(message, options) { + super(message); + this.name = 'ScraperError'; + this.date = new Date(); + this.message = + message + + '\n\nIf this is bug pls report to https://github.com/BochilTeam/scraper'; + } + static createError(message, options) { + return new ScraperError(message, options); + } +} +export function decodeSnapApp(...args) { + // From reponse snap app + function _0xe78c(d, e, f) { + const g = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ+/'.split(''); + const h = g.slice(0, e); + const i = g.slice(0, f); + // @ts-ignore + // eslint-disable-next-line array-callback-return + let j = d.split('').reverse().reduce(function (a, b, c) { + // eslint-disable-next-line no-return-assign + if (h.indexOf(b) !== -1) + return a += h.indexOf(b) * (Math.pow(e, c)); + }, 0); + let k = ''; + while (j > 0) { + k = i[j % f] + k; + j = (j - (j % f)) / f; + } + return k || '0'; + } + function _0xc60e(h, u, n, t, e, r) { + r = ''; + for (let i = 0, len = h.length; i < len; i++) { + let s = ''; + while (h[i] !== n[e]) { + s += h[i]; + i++; + } + for (let j = 0; j < n.length; j++) { + s = s.replace(new RegExp(n[j], 'g'), j.toString()); + } + // @ts-ignore + r += String.fromCharCode((_0xe78c(s, e, 10) - t)); + } + return decodeURIComponent(encodeURIComponent(r)); + } + // @ts-ignore + return _0xc60e(...args); +} +//# sourceMappingURL=utils.js.map \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/lib/esm/utils.js.map b/node_modules/@bochilteam/scraper/lib/esm/utils.js.map new file mode 100644 index 000000000..c86b2a83d --- /dev/null +++ b/node_modules/@bochilteam/scraper/lib/esm/utils.js.map @@ -0,0 +1 @@ +{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,YAAa,SAAQ,KAAK;IAErC,YAAa,OAAY,EAAE,OAAY;QACrC,KAAK,CAAC,OAAO,CAAC,CAAA;QACd,IAAI,CAAC,IAAI,GAAG,cAAc,CAAA;QAC1B,IAAI,CAAC,IAAI,GAAG,IAAI,IAAI,EAAE,CAAA;QACtB,IAAI,CAAC,OAAO;YACV,OAAO;gBACP,wEAAwE,CAAA;IAC5E,CAAC;IAED,MAAM,CAAC,WAAW,CAAE,OAAY,EAAE,OAAW;QAC3C,OAAO,IAAI,YAAY,CAAC,OAAO,EAAE,OAAO,CAAC,CAAA;IAC3C,CAAC;CACF;AAED,MAAM,UAAU,aAAa,CAAE,GAAG,IAAyB;IACzD,wBAAwB;IACxB,SAAS,OAAO,CACd,CAAS,EACT,CAAS,EACT,CAAS;QAET,MAAM,CAAC,GAAG,kEAAkE,CAAC,KAAK,CAAC,EAAE,CAAC,CAAA;QACtF,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;QACvB,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;QACvB,aAAa;QACb,iDAAiD;QACjD,IAAI,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,MAAM,CAAC,UAAU,CAAC,EAAE,CAAC,EAAE,CAAC;YACpD,4CAA4C;YAC5C,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;gBAAE,OAAO,CAAC,IA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CAAA;SAC9D;QACD,OAAO,kBAAkB,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC,CAAA;IAClD,CAAC;IACD,aAAa;IACb,OAAO,OAAO,CAAC,GAAG,IAAI,CAAC,CAAA;AACzB,CAAC"} \ No newline at end of file diff --git a/node_modules/@bochilteam/scraper/package.json b/node_modules/@bochilteam/scraper/package.json new file mode 100644 index 000000000..e2ddfc03c --- /dev/null +++ b/node_modules/@bochilteam/scraper/package.json @@ -0,0 +1,74 @@ +{ + "name": "@bochilteam/scraper", + "version": "2.0.0", + "description": "scraper module", + "exports": { + ".": { + "types": "./lib/@types/index.d.ts", + "import": "./lib/esm/index.js", + "require": "./lib/cjs/index.js" + } + }, + "main": "./lib/cjs/index.js", + "types": "./lib/@types/index.d.ts", + "engines": { + "node": ">= 12.20" + }, + "scripts": { + "test": "npm run build && npm run test:cjs && npm run test:esm", + "test:cjs": "mocha --timeout 20000 ./lib/cjs/**/test.js", + "test:esm": "mocha --timeout 20000 ./lib/esm/**/test.js", + "build": "npm run clean && npm run build:cjs && npm run build:esm && npm run build:types && node scripts/write-package.js", + "build:cjs": "tsc --p src/tsconfig.cjs.json", + "build:esm": "tsc --p src/tsconfig.esm.json", + "build:types": "tsc --p tsconfig.types.json", + "lint:fix": "npx eslint src/** --fix --ignore-pattern src/*.json", + "clean": "rimraf ./lib", + "prepare": "node scripts/compile-typescript.js" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/BochilTeam/scraper.git" + }, + "author": "BochilTeam", + "license": "GPL-3.0-or-later", + "bugs": { + "url": "https://github.com/BochilTeam/scraper/issues" + }, + "homepage": "https://github.com/BochilTeam/scraper#readme", + "devDependencies": { + "@types/chai": "^4.3.0", + "@types/mocha": "^9.1.0", + "@types/node": "^17.0.9", + "@types/ws": "^8.2.2", + "@typescript-eslint/eslint-plugin": "^5.13.0", + "@typescript-eslint/parser": "^5.13.0", + "@zoltu/typescript-transformer-append-js-extension": "^1.0.1", + "chai": "^4.3.6", + "eslint": "^7.32.0", + "eslint-config-standard": "^16.0.3", + "eslint-plugin-import": "^2.25.4", + "eslint-plugin-node": "^11.1.0", + "eslint-plugin-promise": "^5.0.0", + "mocha": "^9.2.0", + "typescript": "^4.5.5" + }, + "dependencies": { + "cheerio": "^1.0.0-rc.10", + "form-data": "^4.0.0", + "got": "^11.8.3", + "human-readable": "^0.2.1" + }, + "directories": { + "lib": "lib", + "src": "src", + "scripts": "scripts" + }, + "files": [ + "lib/*", + "scripts/*" + ], + "optionalDependencies": { + "ws": "^8.4.2" + } +} diff --git a/node_modules/@bochilteam/scraper/scripts/compile-typescript.js b/node_modules/@bochilteam/scraper/scripts/compile-typescript.js new file mode 100644 index 000000000..91632b73e --- /dev/null +++ b/node_modules/@bochilteam/scraper/scripts/compile-typescript.js @@ -0,0 +1,37 @@ +// Source: https://github.com/puppeteer/puppeteer/blob/main/typescript-if-required.js + +const child_process = require('child_process') +const fs = require('fs') +const path = require('path') + +const { promisify } = require('util') +const exec = promisify(child_process.exec) +const fsAccess = promisify(fs.access) + +const fileExists = async (filePath) => + fsAccess(filePath) + .then(() => true) + .catch(() => false) + +const libPath = path.join(__dirname, '../lib') + +async function compileTypeScript () { + const out = await exec('npm run build').catch((error) => { + console.error('@BochilTeam/scraper:', 'Error running TypeScript\n', error) + process.exit(1) + }) + if (out.stdout.trim()) console.log(out.stdout) + if (out.stderr.trim()) console.error(out.stderr) +} + +async function compileTypeScriptIfRequired () { + const typesPath = path.join(libPath, '@types') + const libExists = await fileExists(libPath) + const typesExists = await fileExists(typesPath) + if (libExists && typesExists) return + + console.log('@BochilTeam/scraper:', 'Compiling TypeScript...') + await compileTypeScript() +} + +if (require.main === module) compileTypeScriptIfRequired() diff --git a/node_modules/@bochilteam/scraper/scripts/data/textpro.js b/node_modules/@bochilteam/scraper/scripts/data/textpro.js new file mode 100644 index 000000000..f0a9b0acc --- /dev/null +++ b/node_modules/@bochilteam/scraper/scripts/data/textpro.js @@ -0,0 +1,41 @@ +const got = require('got') +const { load } = require('cheerio') +const { writeFileSync } = require('fs') + +const PAGE = 12 +const MAX_PARAMETERS = 3 +const BASE_URL = 'https://textpro.me'; +(async () => { + const url = `${BASE_URL}/home-p` + const results = [] + for (let i = 1; i <= PAGE; i++) { + const html = await got(`${url}${i}`) + const $ = load(html.body) + const links = $('div.col-md-12 > div.row > div.col-md-4') + links.each(async (i, e) => { + const link = $(e).find('a').attr('href') + const title = $(e).find('.title-effect-home').text() + if (!link || !title) return + const html = await got(`${BASE_URL}${link}`) + const $$ = load(html.body) + const parameters = [] + for (let j = 0; j <= MAX_PARAMETERS; j++) { + const parameter = $$(`#text-${j}`).length + const isParameterExist = !!parameter + parameters.push(isParameterExist) + if (isParameterExist) { + // eslint-disable-next-line eqeqeq + for (let k = 0; k <= parameter.length; k++) if (parameters[k] == false) throw new Error(`${title} is not parameterized`) + } + } + if (link && title) { + results.push({ + link, + title, + parameters + }) + } + }) + } + writeFileSync('data/textpro.json', JSON.stringify(results, null, 2)) +})() diff --git a/node_modules/@bochilteam/scraper/scripts/write-package.js b/node_modules/@bochilteam/scraper/scripts/write-package.js new file mode 100644 index 000000000..fa427ced9 --- /dev/null +++ b/node_modules/@bochilteam/scraper/scripts/write-package.js @@ -0,0 +1,42 @@ +const fs = require('fs') +const path = require('path') + +const { promisify } = require('util') +const fsAccess = promisify(fs.access) + +const fileExists = async (filePath) => + fsAccess(filePath) + .then(() => true) + .catch(() => false) + +const libPath = path.join(__dirname, '../lib') + +async function writePackageJson () { + const libExists = await fileExists(libPath) + if (!libExists) { + console.error('@BochilTeam/scraper:', 'Lib folder not found after compiling TypeScript') + process.exit(1) + } + const libCjs = path.join(libPath, 'cjs') + const libCjsExists = await fileExists(libCjs) + if (libCjsExists) { + const packageJson = JSON.stringify({ type: 'commonjs' }, null, 2) + await fs.promises.writeFile(path.join(libCjs, 'package.json'), packageJson) + } else console.warn('@BochilTeam/scraper:', 'CJS folder not found') + const libEsm = path.join(libPath, 'esm') + const libEsmExists = await fileExists(libEsm) + if (libEsmExists) { + const packageJson = JSON.stringify({ type: 'module' }, null, 2) + await fs.promises.writeFile(path.join(libEsm, 'package.json'), packageJson) + } else console.warn('@BochilTeam/scraper:', 'ESM folder not found') + + const typesPath = path.join(libPath, '@types') + const typesExists = await fileExists(typesPath) + + if (!typesExists && !libEsmExists && !libCjsExists) { + console.error('@BochilTeam/scraper:', 'No compiled TypeScript files found') + process.exit(1) + } +} + +if (require.main === module) writePackageJson() diff --git a/node_modules/@develoka/angka-terbilang-js/README.md b/node_modules/@develoka/angka-terbilang-js/README.md new file mode 100644 index 000000000..7e63480cd --- /dev/null +++ b/node_modules/@develoka/angka-terbilang-js/README.md @@ -0,0 +1,111 @@ +# Angka-terbilang-js [![NPM Version](https://img.shields.io/npm/v/@develoka/angka-terbilang-js.svg)](https://www.npmjs.com/package/@develoka/angka-terbilang-js) [![Minified Size](https://img.shields.io/bundlephobia/min/@develoka/angka-terbilang-js.svg)](https://www.npmjs.com/package/@develoka/angka-terbilang-js) +Mengkonversi angka ke dalam bilangan bahasa Indonesia. Misalnya dari `123`, menjadi `seratus dua puluh tiga`. + +## Demo + +[Link Demo](http://code.bakasyntax.com/gist/e41efb58b4b7fae2bfdfd0a1b0219ed7?default-pans=html,js,output) + +## Instalasi + +``` +npm install @develoka/angka-terbilang-js +``` + +kemudian + +```js +import angkaTerbilang from '@develoka/angka-terbilang-js'; // if using import +const angkaTerbilang = require('@develoka/angka-terbilang-js'); // if using require +``` + +atau langsung dari web browser + +``` + +``` + +Using unpkg CDN: + +```html + +``` + +## Example + +### note: CommonJS usage +In order to gain the TypeScript typings (for intellisense / autocomplete) while using CommonJS imports with `require()` use the following approach: + +```js +const axios = require('axios').default; + +// axios. will now provide autocomplete and parameter typings +``` + +Performing a `GET` request + +```js +const axios = require('axios'); + +// Make a request for a user with a given ID +axios.get('/user?ID=12345') + .then(function (response) { + // handle success + console.log(response); + }) + .catch(function (error) { + // handle error + console.log(error); + }) + .then(function () { + // always executed + }); + +// Optionally the request above could also be done as +axios.get('/user', { + params: { + ID: 12345 + } + }) + .then(function (response) { + console.log(response); + }) + .catch(function (error) { + console.log(error); + }) + .then(function () { + // always executed + }); + +// Want to use async/await? Add the `async` keyword to your outer function/method. +async function getUser() { + try { + const response = await axios.get('/user?ID=12345'); + console.log(response); + } catch (error) { + console.error(error); + } +} +``` + +> **NOTE:** `async/await` is part of ECMAScript 2017 and is not supported in Internet +> Explorer and older browsers, so use with caution. + +Performing a `POST` request + +```js +axios.post('/user', { + firstName: 'Fred', + lastName: 'Flintstone' + }) + .then(function (response) { + console.log(response); + }) + .catch(function (error) { + console.log(error); + }); +``` + +Performing multiple concurrent requests + +```js +function getUserAccount() { + return axios.get('/user/12345'); +} + +function getUserPermissions() { + return axios.get('/user/12345/permissions'); +} + +Promise.all([getUserAccount(), getUserPermissions()]) + .then(function (results) { + const acct = results[0]; + const perm = results[1]; + }); +``` + +## axios API + +Requests can be made by passing the relevant config to `axios`. + +##### axios(config) + +```js +// Send a POST request +axios({ + method: 'post', + url: '/user/12345', + data: { + firstName: 'Fred', + lastName: 'Flintstone' + } +}); +``` + +```js +// GET request for remote image in node.js +axios({ + method: 'get', + url: 'http://bit.ly/2mTM3nY', + responseType: 'stream' +}) + .then(function (response) { + response.data.pipe(fs.createWriteStream('ada_lovelace.jpg')) + }); +``` + +##### axios(url[, config]) + +```js +// Send a GET request (default method) +axios('/user/12345'); +``` + +### Request method aliases + +For convenience aliases have been provided for all supported request methods. + +##### axios.request(config) +##### axios.get(url[, config]) +##### axios.delete(url[, config]) +##### axios.head(url[, config]) +##### axios.options(url[, config]) +##### axios.post(url[, data[, config]]) +##### axios.put(url[, data[, config]]) +##### axios.patch(url[, data[, config]]) + +###### NOTE +When using the alias methods `url`, `method`, and `data` properties don't need to be specified in config. + +### Concurrency (Deprecated) +Please use `Promise.all` to replace the below functions. + +Helper functions for dealing with concurrent requests. + +axios.all(iterable) +axios.spread(callback) + +### Creating an instance + +You can create a new instance of axios with a custom config. + +##### axios.create([config]) + +```js +const instance = axios.create({ + baseURL: 'https://some-domain.com/api/', + timeout: 1000, + headers: {'X-Custom-Header': 'foobar'} +}); +``` + +### Instance methods + +The available instance methods are listed below. The specified config will be merged with the instance config. + +##### axios#request(config) +##### axios#get(url[, config]) +##### axios#delete(url[, config]) +##### axios#head(url[, config]) +##### axios#options(url[, config]) +##### axios#post(url[, data[, config]]) +##### axios#put(url[, data[, config]]) +##### axios#patch(url[, data[, config]]) +##### axios#getUri([config]) + +## Request Config + +These are the available config options for making requests. Only the `url` is required. Requests will default to `GET` if `method` is not specified. + +```js +{ + // `url` is the server URL that will be used for the request + url: '/user', + + // `method` is the request method to be used when making the request + method: 'get', // default + + // `baseURL` will be prepended to `url` unless `url` is absolute. + // It can be convenient to set `baseURL` for an instance of axios to pass relative URLs + // to methods of that instance. + baseURL: 'https://some-domain.com/api/', + + // `transformRequest` allows changes to the request data before it is sent to the server + // This is only applicable for request methods 'PUT', 'POST', 'PATCH' and 'DELETE' + // The last function in the array must return a string or an instance of Buffer, ArrayBuffer, + // FormData or Stream + // You may modify the headers object. + transformRequest: [function (data, headers) { + // Do whatever you want to transform the data + + return data; + }], + + // `transformResponse` allows changes to the response data to be made before + // it is passed to then/catch + transformResponse: [function (data) { + // Do whatever you want to transform the data + + return data; + }], + + // `headers` are custom headers to be sent + headers: {'X-Requested-With': 'XMLHttpRequest'}, + + // `params` are the URL parameters to be sent with the request + // Must be a plain object or a URLSearchParams object + params: { + ID: 12345 + }, + + // `paramsSerializer` is an optional function in charge of serializing `params` + // (e.g. https://www.npmjs.com/package/qs, http://api.jquery.com/jquery.param/) + paramsSerializer: function (params) { + return Qs.stringify(params, {arrayFormat: 'brackets'}) + }, + + // `data` is the data to be sent as the request body + // Only applicable for request methods 'PUT', 'POST', 'DELETE , and 'PATCH' + // When no `transformRequest` is set, must be of one of the following types: + // - string, plain object, ArrayBuffer, ArrayBufferView, URLSearchParams + // - Browser only: FormData, File, Blob + // - Node only: Stream, Buffer + data: { + firstName: 'Fred' + }, + + // syntax alternative to send data into the body + // method post + // only the value is sent, not the key + data: 'Country=Brasil&City=Belo Horizonte', + + // `timeout` specifies the number of milliseconds before the request times out. + // If the request takes longer than `timeout`, the request will be aborted. + timeout: 1000, // default is `0` (no timeout) + + // `withCredentials` indicates whether or not cross-site Access-Control requests + // should be made using credentials + withCredentials: false, // default + + // `adapter` allows custom handling of requests which makes testing easier. + // Return a promise and supply a valid response (see lib/adapters/README.md). + adapter: function (config) { + /* ... */ + }, + + // `auth` indicates that HTTP Basic auth should be used, and supplies credentials. + // This will set an `Authorization` header, overwriting any existing + // `Authorization` custom headers you have set using `headers`. + // Please note that only HTTP Basic auth is configurable through this parameter. + // For Bearer tokens and such, use `Authorization` custom headers instead. + auth: { + username: 'janedoe', + password: 's00pers3cret' + }, + + // `responseType` indicates the type of data that the server will respond with + // options are: 'arraybuffer', 'document', 'json', 'text', 'stream' + // browser only: 'blob' + responseType: 'json', // default + + // `responseEncoding` indicates encoding to use for decoding responses (Node.js only) + // Note: Ignored for `responseType` of 'stream' or client-side requests + responseEncoding: 'utf8', // default + + // `xsrfCookieName` is the name of the cookie to use as a value for xsrf token + xsrfCookieName: 'XSRF-TOKEN', // default + + // `xsrfHeaderName` is the name of the http header that carries the xsrf token value + xsrfHeaderName: 'X-XSRF-TOKEN', // default + + // `onUploadProgress` allows handling of progress events for uploads + // browser only + onUploadProgress: function (progressEvent) { + // Do whatever you want with the native progress event + }, + + // `onDownloadProgress` allows handling of progress events for downloads + // browser only + onDownloadProgress: function (progressEvent) { + // Do whatever you want with the native progress event + }, + + // `maxContentLength` defines the max size of the http response content in bytes allowed in node.js + maxContentLength: 2000, + + // `maxBodyLength` (Node only option) defines the max size of the http request content in bytes allowed + maxBodyLength: 2000, + + // `validateStatus` defines whether to resolve or reject the promise for a given + // HTTP response status code. If `validateStatus` returns `true` (or is set to `null` + // or `undefined`), the promise will be resolved; otherwise, the promise will be + // rejected. + validateStatus: function (status) { + return status >= 200 && status < 300; // default + }, + + // `maxRedirects` defines the maximum number of redirects to follow in node.js. + // If set to 0, no redirects will be followed. + maxRedirects: 5, // default + + // `socketPath` defines a UNIX Socket to be used in node.js. + // e.g. '/var/run/docker.sock' to send requests to the docker daemon. + // Only either `socketPath` or `proxy` can be specified. + // If both are specified, `socketPath` is used. + socketPath: null, // default + + // `httpAgent` and `httpsAgent` define a custom agent to be used when performing http + // and https requests, respectively, in node.js. This allows options to be added like + // `keepAlive` that are not enabled by default. + httpAgent: new http.Agent({ keepAlive: true }), + httpsAgent: new https.Agent({ keepAlive: true }), + + // `proxy` defines the hostname, port, and protocol of the proxy server. + // You can also define your proxy using the conventional `http_proxy` and + // `https_proxy` environment variables. If you are using environment variables + // for your proxy configuration, you can also define a `no_proxy` environment + // variable as a comma-separated list of domains that should not be proxied. + // Use `false` to disable proxies, ignoring environment variables. + // `auth` indicates that HTTP Basic auth should be used to connect to the proxy, and + // supplies credentials. + // This will set an `Proxy-Authorization` header, overwriting any existing + // `Proxy-Authorization` custom headers you have set using `headers`. + // If the proxy server uses HTTPS, then you must set the protocol to `https`. + proxy: { + protocol: 'https', + host: '127.0.0.1', + port: 9000, + auth: { + username: 'mikeymike', + password: 'rapunz3l' + } + }, + + // `cancelToken` specifies a cancel token that can be used to cancel the request + // (see Cancellation section below for details) + cancelToken: new CancelToken(function (cancel) { + }), + + // an alternative way to cancel Axios requests using AbortController + signal: new AbortController().signal, + + // `decompress` indicates whether or not the response body should be decompressed + // automatically. If set to `true` will also remove the 'content-encoding' header + // from the responses objects of all decompressed responses + // - Node only (XHR cannot turn off decompression) + decompress: true // default + + // `insecureHTTPParser` boolean. + // Indicates where to use an insecure HTTP parser that accepts invalid HTTP headers. + // This may allow interoperability with non-conformant HTTP implementations. + // Using the insecure parser should be avoided. + // see options https://nodejs.org/dist/latest-v12.x/docs/api/http.html#http_http_request_url_options_callback + // see also https://nodejs.org/en/blog/vulnerability/february-2020-security-releases/#strict-http-header-parsing-none + insecureHTTPParser: undefined // default + + // transitional options for backward compatibility that may be removed in the newer versions + transitional: { + // silent JSON parsing mode + // `true` - ignore JSON parsing errors and set response.data to null if parsing failed (old behaviour) + // `false` - throw SyntaxError if JSON parsing failed (Note: responseType must be set to 'json') + silentJSONParsing: true, // default value for the current Axios version + + // try to parse the response string as JSON even if `responseType` is not 'json' + forcedJSONParsing: true, + + // throw ETIMEDOUT error instead of generic ECONNABORTED on request timeouts + clarifyTimeoutError: false, + } +} +``` + +## Response Schema + +The response for a request contains the following information. + +```js +{ + // `data` is the response that was provided by the server + data: {}, + + // `status` is the HTTP status code from the server response + status: 200, + + // `statusText` is the HTTP status message from the server response + statusText: 'OK', + + // `headers` the HTTP headers that the server responded with + // All header names are lower cased and can be accessed using the bracket notation. + // Example: `response.headers['content-type']` + headers: {}, + + // `config` is the config that was provided to `axios` for the request + config: {}, + + // `request` is the request that generated this response + // It is the last ClientRequest instance in node.js (in redirects) + // and an XMLHttpRequest instance in the browser + request: {} +} +``` + +When using `then`, you will receive the response as follows: + +```js +axios.get('/user/12345') + .then(function (response) { + console.log(response.data); + console.log(response.status); + console.log(response.statusText); + console.log(response.headers); + console.log(response.config); + }); +``` + +When using `catch`, or passing a [rejection callback](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/then) as second parameter of `then`, the response will be available through the `error` object as explained in the [Handling Errors](#handling-errors) section. + +## Config Defaults + +You can specify config defaults that will be applied to every request. + +### Global axios defaults + +```js +axios.defaults.baseURL = 'https://api.example.com'; + +// Important: If axios is used with multiple domains, the AUTH_TOKEN will be sent to all of them. +// See below for an example using Custom instance defaults instead. +axios.defaults.headers.common['Authorization'] = AUTH_TOKEN; + +axios.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded'; +``` + +### Custom instance defaults + +```js +// Set config defaults when creating the instance +const instance = axios.create({ + baseURL: 'https://api.example.com' +}); + +// Alter defaults after instance has been created +instance.defaults.headers.common['Authorization'] = AUTH_TOKEN; +``` + +### Config order of precedence + +Config will be merged with an order of precedence. The order is library defaults found in [lib/defaults.js](https://github.com/axios/axios/blob/master/lib/defaults.js#L28), then `defaults` property of the instance, and finally `config` argument for the request. The latter will take precedence over the former. Here's an example. + +```js +// Create an instance using the config defaults provided by the library +// At this point the timeout config value is `0` as is the default for the library +const instance = axios.create(); + +// Override timeout default for the library +// Now all requests using this instance will wait 2.5 seconds before timing out +instance.defaults.timeout = 2500; + +// Override timeout for this request as it's known to take a long time +instance.get('/longRequest', { + timeout: 5000 +}); +``` + +## Interceptors + +You can intercept requests or responses before they are handled by `then` or `catch`. + +```js +// Add a request interceptor +axios.interceptors.request.use(function (config) { + // Do something before request is sent + return config; + }, function (error) { + // Do something with request error + return Promise.reject(error); + }); + +// Add a response interceptor +axios.interceptors.response.use(function (response) { + // Any status code that lie within the range of 2xx cause this function to trigger + // Do something with response data + return response; + }, function (error) { + // Any status codes that falls outside the range of 2xx cause this function to trigger + // Do something with response error + return Promise.reject(error); + }); +``` + +If you need to remove an interceptor later you can. + +```js +const myInterceptor = axios.interceptors.request.use(function () {/*...*/}); +axios.interceptors.request.eject(myInterceptor); +``` + +You can add interceptors to a custom instance of axios. + +```js +const instance = axios.create(); +instance.interceptors.request.use(function () {/*...*/}); +``` + +When you add request interceptors, they are presumed to be asynchronous by default. This can cause a delay +in the execution of your axios request when the main thread is blocked (a promise is created under the hood for +the interceptor and your request gets put on the bottom of the call stack). If your request interceptors are synchronous you can add a flag +to the options object that will tell axios to run the code synchronously and avoid any delays in request execution. + +```js +axios.interceptors.request.use(function (config) { + config.headers.test = 'I am only a header!'; + return config; +}, null, { synchronous: true }); +``` + +If you want to execute a particular interceptor based on a runtime check, +you can add a `runWhen` function to the options object. The interceptor will not be executed **if and only if** the return +of `runWhen` is `false`. The function will be called with the config +object (don't forget that you can bind your own arguments to it as well.) This can be handy when you have an +asynchronous request interceptor that only needs to run at certain times. + +```js +function onGetCall(config) { + return config.method === 'get'; +} +axios.interceptors.request.use(function (config) { + config.headers.test = 'special get headers'; + return config; +}, null, { runWhen: onGetCall }); +``` + +### Multiple Interceptors + +Given you add multiple response interceptors +and when the response was fulfilled +- then each interceptor is executed +- then they are executed in the order they were added +- then only the last interceptor's result is returned +- then every interceptor receives the result of it's predecessor +- and when the fulfillment-interceptor throws + - then the following fulfillment-interceptor is not called + - then the following rejection-interceptor is called + - once caught, another following fulfill-interceptor is called again (just like in a promise chain). + +Read [the interceptor tests](./test/specs/interceptors.spec.js) for seeing all this in code. + +## Handling Errors + +```js +axios.get('/user/12345') + .catch(function (error) { + if (error.response) { + // The request was made and the server responded with a status code + // that falls out of the range of 2xx + console.log(error.response.data); + console.log(error.response.status); + console.log(error.response.headers); + } else if (error.request) { + // The request was made but no response was received + // `error.request` is an instance of XMLHttpRequest in the browser and an instance of + // http.ClientRequest in node.js + console.log(error.request); + } else { + // Something happened in setting up the request that triggered an Error + console.log('Error', error.message); + } + console.log(error.config); + }); +``` + +Using the `validateStatus` config option, you can define HTTP code(s) that should throw an error. + +```js +axios.get('/user/12345', { + validateStatus: function (status) { + return status < 500; // Resolve only if the status code is less than 500 + } +}) +``` + +Using `toJSON` you get an object with more information about the HTTP error. + +```js +axios.get('/user/12345') + .catch(function (error) { + console.log(error.toJSON()); + }); +``` + +## Cancellation + +You can cancel a request using a *cancel token*. + +> The axios cancel token API is based on the withdrawn [cancelable promises proposal](https://github.com/tc39/proposal-cancelable-promises). + +You can create a cancel token using the `CancelToken.source` factory as shown below: + +```js +const CancelToken = axios.CancelToken; +const source = CancelToken.source(); + +axios.get('/user/12345', { + cancelToken: source.token +}).catch(function (thrown) { + if (axios.isCancel(thrown)) { + console.log('Request canceled', thrown.message); + } else { + // handle error + } +}); + +axios.post('/user/12345', { + name: 'new name' +}, { + cancelToken: source.token +}) + +// cancel the request (the message parameter is optional) +source.cancel('Operation canceled by the user.'); +``` + +You can also create a cancel token by passing an executor function to the `CancelToken` constructor: + +```js +const CancelToken = axios.CancelToken; +let cancel; + +axios.get('/user/12345', { + cancelToken: new CancelToken(function executor(c) { + // An executor function receives a cancel function as a parameter + cancel = c; + }) +}); + +// cancel the request +cancel(); +``` + +Axios supports AbortController to abort requests in [`fetch API`](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API#aborting_a_fetch) way: +```js +const controller = new AbortController(); + +axios.get('/foo/bar', { + signal: controller.signal +}).then(function(response) { + //... +}); +// cancel the request +controller.abort() +``` + +> Note: you can cancel several requests with the same cancel token/abort controller. +> If a cancellation token is already cancelled at the moment of starting an Axios request, then the request is cancelled immediately, without any attempts to make real request. + +## Using application/x-www-form-urlencoded format + +By default, axios serializes JavaScript objects to `JSON`. To send data in the `application/x-www-form-urlencoded` format instead, you can use one of the following options. + +### Browser + +In a browser, you can use the [`URLSearchParams`](https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams) API as follows: + +```js +const params = new URLSearchParams(); +params.append('param1', 'value1'); +params.append('param2', 'value2'); +axios.post('/foo', params); +``` + +> Note that `URLSearchParams` is not supported by all browsers (see [caniuse.com](http://www.caniuse.com/#feat=urlsearchparams)), but there is a [polyfill](https://github.com/WebReflection/url-search-params) available (make sure to polyfill the global environment). + +Alternatively, you can encode data using the [`qs`](https://github.com/ljharb/qs) library: + +```js +const qs = require('qs'); +axios.post('/foo', qs.stringify({ 'bar': 123 })); +``` + +Or in another way (ES6), + +```js +import qs from 'qs'; +const data = { 'bar': 123 }; +const options = { + method: 'POST', + headers: { 'content-type': 'application/x-www-form-urlencoded' }, + data: qs.stringify(data), + url, +}; +axios(options); +``` + +### Node.js + +#### Query string + +In node.js, you can use the [`querystring`](https://nodejs.org/api/querystring.html) module as follows: + +```js +const querystring = require('querystring'); +axios.post('http://something.com/', querystring.stringify({ foo: 'bar' })); +``` + +or ['URLSearchParams'](https://nodejs.org/api/url.html#url_class_urlsearchparams) from ['url module'](https://nodejs.org/api/url.html) as follows: + +```js +const url = require('url'); +const params = new url.URLSearchParams({ foo: 'bar' }); +axios.post('http://something.com/', params.toString()); +``` + +You can also use the [`qs`](https://github.com/ljharb/qs) library. + +###### NOTE +The `qs` library is preferable if you need to stringify nested objects, as the `querystring` method has known issues with that use case (https://github.com/nodejs/node-v0.x-archive/issues/1665). + +#### Form data + +In node.js, you can use the [`form-data`](https://github.com/form-data/form-data) library as follows: + +```js +const FormData = require('form-data'); + +const form = new FormData(); +form.append('my_field', 'my value'); +form.append('my_buffer', new Buffer(10)); +form.append('my_file', fs.createReadStream('/foo/bar.jpg')); + +axios.post('https://example.com', form, { headers: form.getHeaders() }) +``` + +Alternatively, use an interceptor: + +```js +axios.interceptors.request.use(config => { + if (config.data instanceof FormData) { + Object.assign(config.headers, config.data.getHeaders()); + } + return config; +}); +``` + +## Semver + +Until axios reaches a `1.0` release, breaking changes will be released with a new minor version. For example `0.5.1`, and `0.5.4` will have the same API, but `0.6.0` will have breaking changes. + +## Promises + +axios depends on a native ES6 Promise implementation to be [supported](http://caniuse.com/promises). +If your environment doesn't support ES6 Promises, you can [polyfill](https://github.com/jakearchibald/es6-promise). + +## TypeScript + +axios includes [TypeScript](http://typescriptlang.org) definitions and a type guard for axios errors. + +```typescript +let user: User = null; +try { + const { data } = await axios.get('/user?ID=12345'); + user = data.userDetails; +} catch (error) { + if (axios.isAxiosError(error)) { + handleAxiosError(error); + } else { + handleUnexpectedError(error); + } +} +``` + +## Online one-click setup + +You can use Gitpod an online IDE(which is free for Open Source) for contributing or running the examples online. + +[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/axios/axios/blob/master/examples/server.js) + + +## Resources + +* [Changelog](https://github.com/axios/axios/blob/master/CHANGELOG.md) +* [Upgrade Guide](https://github.com/axios/axios/blob/master/UPGRADE_GUIDE.md) +* [Ecosystem](https://github.com/axios/axios/blob/master/ECOSYSTEM.md) +* [Contributing Guide](https://github.com/axios/axios/blob/master/CONTRIBUTING.md) +* [Code of Conduct](https://github.com/axios/axios/blob/master/CODE_OF_CONDUCT.md) + +## Credits + +axios is heavily inspired by the [$http service](https://docs.angularjs.org/api/ng/service/$http) provided in [AngularJS](https://angularjs.org/). Ultimately axios is an effort to provide a standalone `$http`-like service for use outside of AngularJS. + +## License + +[MIT](LICENSE) diff --git a/node_modules/@shineiichijo/marika/node_modules/axios/SECURITY.md b/node_modules/@shineiichijo/marika/node_modules/axios/SECURITY.md new file mode 100644 index 000000000..353df9a2f --- /dev/null +++ b/node_modules/@shineiichijo/marika/node_modules/axios/SECURITY.md @@ -0,0 +1,5 @@ +# Security Policy + +## Reporting a Vulnerability + +Please report security issues to jasonsaayman@gmail.com diff --git a/node_modules/@shineiichijo/marika/node_modules/axios/UPGRADE_GUIDE.md b/node_modules/@shineiichijo/marika/node_modules/axios/UPGRADE_GUIDE.md new file mode 100644 index 000000000..fdcff1a6b --- /dev/null +++ b/node_modules/@shineiichijo/marika/node_modules/axios/UPGRADE_GUIDE.md @@ -0,0 +1,168 @@ +# Upgrade Guide + +### 0.18.x -> 0.19.0 + +#### HTTPS Proxies + +Routing through an https proxy now requires setting the `protocol` attribute of the proxy configuration to `https` + +### 0.15.x -> 0.16.0 + +#### `Promise` Type Declarations + +The `Promise` type declarations have been removed from the axios typings in favor of the built-in type declarations. If you use axios in a TypeScript project that targets `ES5`, please make sure to include the `es2015.promise` lib. Please see [this post](https://blog.mariusschulz.com/2016/11/25/typescript-2-0-built-in-type-declarations) for details. + +### 0.13.x -> 0.14.0 + +#### TypeScript Definitions + +The axios TypeScript definitions have been updated to match the axios API and use the ES2015 module syntax. + +Please use the following `import` statement to import axios in TypeScript: + +```typescript +import axios from 'axios'; + +axios.get('/foo') + .then(response => console.log(response)) + .catch(error => console.log(error)); +``` + +#### `agent` Config Option + +The `agent` config option has been replaced with two new options: `httpAgent` and `httpsAgent`. Please use them instead. + +```js +{ + // Define a custom agent for HTTP + httpAgent: new http.Agent({ keepAlive: true }), + // Define a custom agent for HTTPS + httpsAgent: new https.Agent({ keepAlive: true }) +} +``` + +#### `progress` Config Option + +The `progress` config option has been replaced with the `onUploadProgress` and `onDownloadProgress` options. + +```js +{ + // Define a handler for upload progress events + onUploadProgress: function (progressEvent) { + // ... + }, + + // Define a handler for download progress events + onDownloadProgress: function (progressEvent) { + // ... + } +} +``` + +### 0.12.x -> 0.13.0 + +The `0.13.0` release contains several changes to custom adapters and error handling. + +#### Error Handling + +Previous to this release an error could either be a server response with bad status code or an actual `Error`. With this release Promise will always reject with an `Error`. In the case that a response was received, the `Error` will also include the response. + +```js +axios.get('/user/12345') + .catch((error) => { + console.log(error.message); + console.log(error.code); // Not always specified + console.log(error.config); // The config that was used to make the request + console.log(error.response); // Only available if response was received from the server + }); +``` + +#### Request Adapters + +This release changes a few things about how request adapters work. Please take note if you are using your own custom adapter. + +1. Response transformer is now called outside of adapter. +2. Request adapter returns a `Promise`. + +This means that you no longer need to invoke `transformData` on response data. You will also no longer receive `resolve` and `reject` as arguments in your adapter. + +Previous code: + +```js +function myAdapter(resolve, reject, config) { + var response = { + data: transformData( + responseData, + responseHeaders, + config.transformResponse + ), + status: request.status, + statusText: request.statusText, + headers: responseHeaders + }; + settle(resolve, reject, response); +} +``` + +New code: + +```js +function myAdapter(config) { + return new Promise(function (resolve, reject) { + var response = { + data: responseData, + status: request.status, + statusText: request.statusText, + headers: responseHeaders + }; + settle(resolve, reject, response); + }); +} +``` + +See the related commits for more details: +- [Response transformers](https://github.com/axios/axios/commit/10eb23865101f9347570552c04e9d6211376e25e) +- [Request adapter Promise](https://github.com/axios/axios/commit/157efd5615890301824e3121cc6c9d2f9b21f94a) + +### 0.5.x -> 0.6.0 + +The `0.6.0` release contains mostly bug fixes, but there are a couple things to be aware of when upgrading. + +#### ES6 Promise Polyfill + +Up until the `0.6.0` release ES6 `Promise` was being polyfilled using [es6-promise](https://github.com/jakearchibald/es6-promise). With this release, the polyfill has been removed, and you will need to supply it yourself if your environment needs it. + +```js +require('es6-promise').polyfill(); +var axios = require('axios'); +``` + +This will polyfill the global environment, and only needs to be done once. + +#### `axios.success`/`axios.error` + +The `success`, and `error` aliases were deprecated in [0.4.0](https://github.com/axios/axios/blob/master/CHANGELOG.md#040-oct-03-2014). As of this release they have been removed entirely. Instead please use `axios.then`, and `axios.catch` respectively. + +```js +axios.get('some/url') + .then(function (res) { + /* ... */ + }) + .catch(function (err) { + /* ... */ + }); +``` + +#### UMD + +Previous versions of axios shipped with an AMD, CommonJS, and Global build. This has all been rolled into a single UMD build. + +```js +// AMD +require(['bower_components/axios/dist/axios'], function (axios) { + /* ... */ +}); + +// CommonJS +var axios = require('axios/dist/axios'); +``` diff --git a/node_modules/@shineiichijo/marika/node_modules/axios/dist/axios.js b/node_modules/@shineiichijo/marika/node_modules/axios/dist/axios.js new file mode 100644 index 000000000..e78f7ca92 --- /dev/null +++ b/node_modules/@shineiichijo/marika/node_modules/axios/dist/axios.js @@ -0,0 +1,2293 @@ +(function webpackUniversalModuleDefinition(root, factory) { + if(typeof exports === 'object' && typeof module === 'object') + module.exports = factory(); + else if(typeof define === 'function' && define.amd) + define([], factory); + else if(typeof exports === 'object') + exports["axios"] = factory(); + else + root["axios"] = factory(); +})(this, function() { +return /******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) { +/******/ return installedModules[moduleId].exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ i: moduleId, +/******/ l: false, +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __webpack_require__.c = installedModules; +/******/ +/******/ // define getter function for harmony exports +/******/ __webpack_require__.d = function(exports, name, getter) { +/******/ if(!__webpack_require__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); +/******/ } +/******/ }; +/******/ +/******/ // define __esModule on exports +/******/ __webpack_require__.r = function(exports) { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ +/******/ // create a fake namespace object +/******/ // mode & 1: value is a module id, require it +/******/ // mode & 2: merge all properties of value into the ns +/******/ // mode & 4: return value when already ns object +/******/ // mode & 8|1: behave like require +/******/ __webpack_require__.t = function(value, mode) { +/******/ if(mode & 1) value = __webpack_require__(value); +/******/ if(mode & 8) return value; +/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; +/******/ var ns = Object.create(null); +/******/ __webpack_require__.r(ns); +/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); +/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); +/******/ return ns; +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __webpack_require__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __webpack_require__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = ""; +/******/ +/******/ +/******/ // Load entry module and return exports +/******/ return __webpack_require__(__webpack_require__.s = "./index.js"); +/******/ }) +/************************************************************************/ +/******/ ({ + +/***/ "./index.js": +/*!******************!*\ + !*** ./index.js ***! + \******************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +module.exports = __webpack_require__(/*! ./lib/axios */ "./lib/axios.js"); + +/***/ }), + +/***/ "./lib/adapters/xhr.js": +/*!*****************************!*\ + !*** ./lib/adapters/xhr.js ***! + \*****************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var utils = __webpack_require__(/*! ./../utils */ "./lib/utils.js"); +var settle = __webpack_require__(/*! ./../core/settle */ "./lib/core/settle.js"); +var cookies = __webpack_require__(/*! ./../helpers/cookies */ "./lib/helpers/cookies.js"); +var buildURL = __webpack_require__(/*! ./../helpers/buildURL */ "./lib/helpers/buildURL.js"); +var buildFullPath = __webpack_require__(/*! ../core/buildFullPath */ "./lib/core/buildFullPath.js"); +var parseHeaders = __webpack_require__(/*! ./../helpers/parseHeaders */ "./lib/helpers/parseHeaders.js"); +var isURLSameOrigin = __webpack_require__(/*! ./../helpers/isURLSameOrigin */ "./lib/helpers/isURLSameOrigin.js"); +var createError = __webpack_require__(/*! ../core/createError */ "./lib/core/createError.js"); +var transitionalDefaults = __webpack_require__(/*! ../defaults/transitional */ "./lib/defaults/transitional.js"); +var Cancel = __webpack_require__(/*! ../cancel/Cancel */ "./lib/cancel/Cancel.js"); + +module.exports = function xhrAdapter(config) { + return new Promise(function dispatchXhrRequest(resolve, reject) { + var requestData = config.data; + var requestHeaders = config.headers; + var responseType = config.responseType; + var onCanceled; + function done() { + if (config.cancelToken) { + config.cancelToken.unsubscribe(onCanceled); + } + + if (config.signal) { + config.signal.removeEventListener('abort', onCanceled); + } + } + + if (utils.isFormData(requestData)) { + delete requestHeaders['Content-Type']; // Let the browser set it + } + + var request = new XMLHttpRequest(); + + // HTTP basic authentication + if (config.auth) { + var username = config.auth.username || ''; + var password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : ''; + requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password); + } + + var fullPath = buildFullPath(config.baseURL, config.url); + request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true); + + // Set the request timeout in MS + request.timeout = config.timeout; + + function onloadend() { + if (!request) { + return; + } + // Prepare the response + var responseHeaders = 'getAllResponseHeaders' in request ? parseHeaders(request.getAllResponseHeaders()) : null; + var responseData = !responseType || responseType === 'text' || responseType === 'json' ? + request.responseText : request.response; + var response = { + data: responseData, + status: request.status, + statusText: request.statusText, + headers: responseHeaders, + config: config, + request: request + }; + + settle(function _resolve(value) { + resolve(value); + done(); + }, function _reject(err) { + reject(err); + done(); + }, response); + + // Clean up request + request = null; + } + + if ('onloadend' in request) { + // Use onloadend if available + request.onloadend = onloadend; + } else { + // Listen for ready state to emulate onloadend + request.onreadystatechange = function handleLoad() { + if (!request || request.readyState !== 4) { + return; + } + + // The request errored out and we didn't get a response, this will be + // handled by onerror instead + // With one exception: request that using file: protocol, most browsers + // will return status as 0 even though it's a successful request + if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) { + return; + } + // readystate handler is calling before onerror or ontimeout handlers, + // so we should call onloadend on the next 'tick' + setTimeout(onloadend); + }; + } + + // Handle browser request cancellation (as opposed to a manual cancellation) + request.onabort = function handleAbort() { + if (!request) { + return; + } + + reject(createError('Request aborted', config, 'ECONNABORTED', request)); + + // Clean up request + request = null; + }; + + // Handle low level network errors + request.onerror = function handleError() { + // Real errors are hidden from us by the browser + // onerror should only fire if it's a network error + reject(createError('Network Error', config, null, request)); + + // Clean up request + request = null; + }; + + // Handle timeout + request.ontimeout = function handleTimeout() { + var timeoutErrorMessage = config.timeout ? 'timeout of ' + config.timeout + 'ms exceeded' : 'timeout exceeded'; + var transitional = config.transitional || transitionalDefaults; + if (config.timeoutErrorMessage) { + timeoutErrorMessage = config.timeoutErrorMessage; + } + reject(createError( + timeoutErrorMessage, + config, + transitional.clarifyTimeoutError ? 'ETIMEDOUT' : 'ECONNABORTED', + request)); + + // Clean up request + request = null; + }; + + // Add xsrf header + // This is only done if running in a standard browser environment. + // Specifically not if we're in a web worker, or react-native. + if (utils.isStandardBrowserEnv()) { + // Add xsrf header + var xsrfValue = (config.withCredentials || isURLSameOrigin(fullPath)) && config.xsrfCookieName ? + cookies.read(config.xsrfCookieName) : + undefined; + + if (xsrfValue) { + requestHeaders[config.xsrfHeaderName] = xsrfValue; + } + } + + // Add headers to the request + if ('setRequestHeader' in request) { + utils.forEach(requestHeaders, function setRequestHeader(val, key) { + if (typeof requestData === 'undefined' && key.toLowerCase() === 'content-type') { + // Remove Content-Type if data is undefined + delete requestHeaders[key]; + } else { + // Otherwise add header to the request + request.setRequestHeader(key, val); + } + }); + } + + // Add withCredentials to request if needed + if (!utils.isUndefined(config.withCredentials)) { + request.withCredentials = !!config.withCredentials; + } + + // Add responseType to request if needed + if (responseType && responseType !== 'json') { + request.responseType = config.responseType; + } + + // Handle progress if needed + if (typeof config.onDownloadProgress === 'function') { + request.addEventListener('progress', config.onDownloadProgress); + } + + // Not all browsers support upload events + if (typeof config.onUploadProgress === 'function' && request.upload) { + request.upload.addEventListener('progress', config.onUploadProgress); + } + + if (config.cancelToken || config.signal) { + // Handle cancellation + // eslint-disable-next-line func-names + onCanceled = function(cancel) { + if (!request) { + return; + } + reject(!cancel || (cancel && cancel.type) ? new Cancel('canceled') : cancel); + request.abort(); + request = null; + }; + + config.cancelToken && config.cancelToken.subscribe(onCanceled); + if (config.signal) { + config.signal.aborted ? onCanceled() : config.signal.addEventListener('abort', onCanceled); + } + } + + if (!requestData) { + requestData = null; + } + + // Send the request + request.send(requestData); + }); +}; + + +/***/ }), + +/***/ "./lib/axios.js": +/*!**********************!*\ + !*** ./lib/axios.js ***! + \**********************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var utils = __webpack_require__(/*! ./utils */ "./lib/utils.js"); +var bind = __webpack_require__(/*! ./helpers/bind */ "./lib/helpers/bind.js"); +var Axios = __webpack_require__(/*! ./core/Axios */ "./lib/core/Axios.js"); +var mergeConfig = __webpack_require__(/*! ./core/mergeConfig */ "./lib/core/mergeConfig.js"); +var defaults = __webpack_require__(/*! ./defaults */ "./lib/defaults/index.js"); + +/** + * Create an instance of Axios + * + * @param {Object} defaultConfig The default config for the instance + * @return {Axios} A new instance of Axios + */ +function createInstance(defaultConfig) { + var context = new Axios(defaultConfig); + var instance = bind(Axios.prototype.request, context); + + // Copy axios.prototype to instance + utils.extend(instance, Axios.prototype, context); + + // Copy context to instance + utils.extend(instance, context); + + // Factory for creating new instances + instance.create = function create(instanceConfig) { + return createInstance(mergeConfig(defaultConfig, instanceConfig)); + }; + + return instance; +} + +// Create the default instance to be exported +var axios = createInstance(defaults); + +// Expose Axios class to allow class inheritance +axios.Axios = Axios; + +// Expose Cancel & CancelToken +axios.Cancel = __webpack_require__(/*! ./cancel/Cancel */ "./lib/cancel/Cancel.js"); +axios.CancelToken = __webpack_require__(/*! ./cancel/CancelToken */ "./lib/cancel/CancelToken.js"); +axios.isCancel = __webpack_require__(/*! ./cancel/isCancel */ "./lib/cancel/isCancel.js"); +axios.VERSION = __webpack_require__(/*! ./env/data */ "./lib/env/data.js").version; + +// Expose all/spread +axios.all = function all(promises) { + return Promise.all(promises); +}; +axios.spread = __webpack_require__(/*! ./helpers/spread */ "./lib/helpers/spread.js"); + +// Expose isAxiosError +axios.isAxiosError = __webpack_require__(/*! ./helpers/isAxiosError */ "./lib/helpers/isAxiosError.js"); + +module.exports = axios; + +// Allow use of default import syntax in TypeScript +module.exports.default = axios; + + +/***/ }), + +/***/ "./lib/cancel/Cancel.js": +/*!******************************!*\ + !*** ./lib/cancel/Cancel.js ***! + \******************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +/** + * A `Cancel` is an object that is thrown when an operation is canceled. + * + * @class + * @param {string=} message The message. + */ +function Cancel(message) { + this.message = message; +} + +Cancel.prototype.toString = function toString() { + return 'Cancel' + (this.message ? ': ' + this.message : ''); +}; + +Cancel.prototype.__CANCEL__ = true; + +module.exports = Cancel; + + +/***/ }), + +/***/ "./lib/cancel/CancelToken.js": +/*!***********************************!*\ + !*** ./lib/cancel/CancelToken.js ***! + \***********************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var Cancel = __webpack_require__(/*! ./Cancel */ "./lib/cancel/Cancel.js"); + +/** + * A `CancelToken` is an object that can be used to request cancellation of an operation. + * + * @class + * @param {Function} executor The executor function. + */ +function CancelToken(executor) { + if (typeof executor !== 'function') { + throw new TypeError('executor must be a function.'); + } + + var resolvePromise; + + this.promise = new Promise(function promiseExecutor(resolve) { + resolvePromise = resolve; + }); + + var token = this; + + // eslint-disable-next-line func-names + this.promise.then(function(cancel) { + if (!token._listeners) return; + + var i; + var l = token._listeners.length; + + for (i = 0; i < l; i++) { + token._listeners[i](cancel); + } + token._listeners = null; + }); + + // eslint-disable-next-line func-names + this.promise.then = function(onfulfilled) { + var _resolve; + // eslint-disable-next-line func-names + var promise = new Promise(function(resolve) { + token.subscribe(resolve); + _resolve = resolve; + }).then(onfulfilled); + + promise.cancel = function reject() { + token.unsubscribe(_resolve); + }; + + return promise; + }; + + executor(function cancel(message) { + if (token.reason) { + // Cancellation has already been requested + return; + } + + token.reason = new Cancel(message); + resolvePromise(token.reason); + }); +} + +/** + * Throws a `Cancel` if cancellation has been requested. + */ +CancelToken.prototype.throwIfRequested = function throwIfRequested() { + if (this.reason) { + throw this.reason; + } +}; + +/** + * Subscribe to the cancel signal + */ + +CancelToken.prototype.subscribe = function subscribe(listener) { + if (this.reason) { + listener(this.reason); + return; + } + + if (this._listeners) { + this._listeners.push(listener); + } else { + this._listeners = [listener]; + } +}; + +/** + * Unsubscribe from the cancel signal + */ + +CancelToken.prototype.unsubscribe = function unsubscribe(listener) { + if (!this._listeners) { + return; + } + var index = this._listeners.indexOf(listener); + if (index !== -1) { + this._listeners.splice(index, 1); + } +}; + +/** + * Returns an object that contains a new `CancelToken` and a function that, when called, + * cancels the `CancelToken`. + */ +CancelToken.source = function source() { + var cancel; + var token = new CancelToken(function executor(c) { + cancel = c; + }); + return { + token: token, + cancel: cancel + }; +}; + +module.exports = CancelToken; + + +/***/ }), + +/***/ "./lib/cancel/isCancel.js": +/*!********************************!*\ + !*** ./lib/cancel/isCancel.js ***! + \********************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +module.exports = function isCancel(value) { + return !!(value && value.__CANCEL__); +}; + + +/***/ }), + +/***/ "./lib/core/Axios.js": +/*!***************************!*\ + !*** ./lib/core/Axios.js ***! + \***************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var utils = __webpack_require__(/*! ./../utils */ "./lib/utils.js"); +var buildURL = __webpack_require__(/*! ../helpers/buildURL */ "./lib/helpers/buildURL.js"); +var InterceptorManager = __webpack_require__(/*! ./InterceptorManager */ "./lib/core/InterceptorManager.js"); +var dispatchRequest = __webpack_require__(/*! ./dispatchRequest */ "./lib/core/dispatchRequest.js"); +var mergeConfig = __webpack_require__(/*! ./mergeConfig */ "./lib/core/mergeConfig.js"); +var validator = __webpack_require__(/*! ../helpers/validator */ "./lib/helpers/validator.js"); + +var validators = validator.validators; +/** + * Create a new instance of Axios + * + * @param {Object} instanceConfig The default config for the instance + */ +function Axios(instanceConfig) { + this.defaults = instanceConfig; + this.interceptors = { + request: new InterceptorManager(), + response: new InterceptorManager() + }; +} + +/** + * Dispatch a request + * + * @param {Object} config The config specific for this request (merged with this.defaults) + */ +Axios.prototype.request = function request(configOrUrl, config) { + /*eslint no-param-reassign:0*/ + // Allow for axios('example/url'[, config]) a la fetch API + if (typeof configOrUrl === 'string') { + config = config || {}; + config.url = configOrUrl; + } else { + config = configOrUrl || {}; + } + + config = mergeConfig(this.defaults, config); + + // Set config.method + if (config.method) { + config.method = config.method.toLowerCase(); + } else if (this.defaults.method) { + config.method = this.defaults.method.toLowerCase(); + } else { + config.method = 'get'; + } + + var transitional = config.transitional; + + if (transitional !== undefined) { + validator.assertOptions(transitional, { + silentJSONParsing: validators.transitional(validators.boolean), + forcedJSONParsing: validators.transitional(validators.boolean), + clarifyTimeoutError: validators.transitional(validators.boolean) + }, false); + } + + // filter out skipped interceptors + var requestInterceptorChain = []; + var synchronousRequestInterceptors = true; + this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) { + if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) { + return; + } + + synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous; + + requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected); + }); + + var responseInterceptorChain = []; + this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) { + responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected); + }); + + var promise; + + if (!synchronousRequestInterceptors) { + var chain = [dispatchRequest, undefined]; + + Array.prototype.unshift.apply(chain, requestInterceptorChain); + chain = chain.concat(responseInterceptorChain); + + promise = Promise.resolve(config); + while (chain.length) { + promise = promise.then(chain.shift(), chain.shift()); + } + + return promise; + } + + + var newConfig = config; + while (requestInterceptorChain.length) { + var onFulfilled = requestInterceptorChain.shift(); + var onRejected = requestInterceptorChain.shift(); + try { + newConfig = onFulfilled(newConfig); + } catch (error) { + onRejected(error); + break; + } + } + + try { + promise = dispatchRequest(newConfig); + } catch (error) { + return Promise.reject(error); + } + + while (responseInterceptorChain.length) { + promise = promise.then(responseInterceptorChain.shift(), responseInterceptorChain.shift()); + } + + return promise; +}; + +Axios.prototype.getUri = function getUri(config) { + config = mergeConfig(this.defaults, config); + return buildURL(config.url, config.params, config.paramsSerializer).replace(/^\?/, ''); +}; + +// Provide aliases for supported request methods +utils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) { + /*eslint func-names:0*/ + Axios.prototype[method] = function(url, config) { + return this.request(mergeConfig(config || {}, { + method: method, + url: url, + data: (config || {}).data + })); + }; +}); + +utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) { + /*eslint func-names:0*/ + Axios.prototype[method] = function(url, data, config) { + return this.request(mergeConfig(config || {}, { + method: method, + url: url, + data: data + })); + }; +}); + +module.exports = Axios; + + +/***/ }), + +/***/ "./lib/core/InterceptorManager.js": +/*!****************************************!*\ + !*** ./lib/core/InterceptorManager.js ***! + \****************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var utils = __webpack_require__(/*! ./../utils */ "./lib/utils.js"); + +function InterceptorManager() { + this.handlers = []; +} + +/** + * Add a new interceptor to the stack + * + * @param {Function} fulfilled The function to handle `then` for a `Promise` + * @param {Function} rejected The function to handle `reject` for a `Promise` + * + * @return {Number} An ID used to remove interceptor later + */ +InterceptorManager.prototype.use = function use(fulfilled, rejected, options) { + this.handlers.push({ + fulfilled: fulfilled, + rejected: rejected, + synchronous: options ? options.synchronous : false, + runWhen: options ? options.runWhen : null + }); + return this.handlers.length - 1; +}; + +/** + * Remove an interceptor from the stack + * + * @param {Number} id The ID that was returned by `use` + */ +InterceptorManager.prototype.eject = function eject(id) { + if (this.handlers[id]) { + this.handlers[id] = null; + } +}; + +/** + * Iterate over all the registered interceptors + * + * This method is particularly useful for skipping over any + * interceptors that may have become `null` calling `eject`. + * + * @param {Function} fn The function to call for each interceptor + */ +InterceptorManager.prototype.forEach = function forEach(fn) { + utils.forEach(this.handlers, function forEachHandler(h) { + if (h !== null) { + fn(h); + } + }); +}; + +module.exports = InterceptorManager; + + +/***/ }), + +/***/ "./lib/core/buildFullPath.js": +/*!***********************************!*\ + !*** ./lib/core/buildFullPath.js ***! + \***********************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var isAbsoluteURL = __webpack_require__(/*! ../helpers/isAbsoluteURL */ "./lib/helpers/isAbsoluteURL.js"); +var combineURLs = __webpack_require__(/*! ../helpers/combineURLs */ "./lib/helpers/combineURLs.js"); + +/** + * Creates a new URL by combining the baseURL with the requestedURL, + * only when the requestedURL is not already an absolute URL. + * If the requestURL is absolute, this function returns the requestedURL untouched. + * + * @param {string} baseURL The base URL + * @param {string} requestedURL Absolute or relative URL to combine + * @returns {string} The combined full path + */ +module.exports = function buildFullPath(baseURL, requestedURL) { + if (baseURL && !isAbsoluteURL(requestedURL)) { + return combineURLs(baseURL, requestedURL); + } + return requestedURL; +}; + + +/***/ }), + +/***/ "./lib/core/createError.js": +/*!*********************************!*\ + !*** ./lib/core/createError.js ***! + \*********************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var enhanceError = __webpack_require__(/*! ./enhanceError */ "./lib/core/enhanceError.js"); + +/** + * Create an Error with the specified message, config, error code, request and response. + * + * @param {string} message The error message. + * @param {Object} config The config. + * @param {string} [code] The error code (for example, 'ECONNABORTED'). + * @param {Object} [request] The request. + * @param {Object} [response] The response. + * @returns {Error} The created error. + */ +module.exports = function createError(message, config, code, request, response) { + var error = new Error(message); + return enhanceError(error, config, code, request, response); +}; + + +/***/ }), + +/***/ "./lib/core/dispatchRequest.js": +/*!*************************************!*\ + !*** ./lib/core/dispatchRequest.js ***! + \*************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var utils = __webpack_require__(/*! ./../utils */ "./lib/utils.js"); +var transformData = __webpack_require__(/*! ./transformData */ "./lib/core/transformData.js"); +var isCancel = __webpack_require__(/*! ../cancel/isCancel */ "./lib/cancel/isCancel.js"); +var defaults = __webpack_require__(/*! ../defaults */ "./lib/defaults/index.js"); +var Cancel = __webpack_require__(/*! ../cancel/Cancel */ "./lib/cancel/Cancel.js"); + +/** + * Throws a `Cancel` if cancellation has been requested. + */ +function throwIfCancellationRequested(config) { + if (config.cancelToken) { + config.cancelToken.throwIfRequested(); + } + + if (config.signal && config.signal.aborted) { + throw new Cancel('canceled'); + } +} + +/** + * Dispatch a request to the server using the configured adapter. + * + * @param {object} config The config that is to be used for the request + * @returns {Promise} The Promise to be fulfilled + */ +module.exports = function dispatchRequest(config) { + throwIfCancellationRequested(config); + + // Ensure headers exist + config.headers = config.headers || {}; + + // Transform request data + config.data = transformData.call( + config, + config.data, + config.headers, + config.transformRequest + ); + + // Flatten headers + config.headers = utils.merge( + config.headers.common || {}, + config.headers[config.method] || {}, + config.headers + ); + + utils.forEach( + ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'], + function cleanHeaderConfig(method) { + delete config.headers[method]; + } + ); + + var adapter = config.adapter || defaults.adapter; + + return adapter(config).then(function onAdapterResolution(response) { + throwIfCancellationRequested(config); + + // Transform response data + response.data = transformData.call( + config, + response.data, + response.headers, + config.transformResponse + ); + + return response; + }, function onAdapterRejection(reason) { + if (!isCancel(reason)) { + throwIfCancellationRequested(config); + + // Transform response data + if (reason && reason.response) { + reason.response.data = transformData.call( + config, + reason.response.data, + reason.response.headers, + config.transformResponse + ); + } + } + + return Promise.reject(reason); + }); +}; + + +/***/ }), + +/***/ "./lib/core/enhanceError.js": +/*!**********************************!*\ + !*** ./lib/core/enhanceError.js ***! + \**********************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +/** + * Update an Error with the specified config, error code, and response. + * + * @param {Error} error The error to update. + * @param {Object} config The config. + * @param {string} [code] The error code (for example, 'ECONNABORTED'). + * @param {Object} [request] The request. + * @param {Object} [response] The response. + * @returns {Error} The error. + */ +module.exports = function enhanceError(error, config, code, request, response) { + error.config = config; + if (code) { + error.code = code; + } + + error.request = request; + error.response = response; + error.isAxiosError = true; + + error.toJSON = function toJSON() { + return { + // Standard + message: this.message, + name: this.name, + // Microsoft + description: this.description, + number: this.number, + // Mozilla + fileName: this.fileName, + lineNumber: this.lineNumber, + columnNumber: this.columnNumber, + stack: this.stack, + // Axios + config: this.config, + code: this.code, + status: this.response && this.response.status ? this.response.status : null + }; + }; + return error; +}; + + +/***/ }), + +/***/ "./lib/core/mergeConfig.js": +/*!*********************************!*\ + !*** ./lib/core/mergeConfig.js ***! + \*********************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var utils = __webpack_require__(/*! ../utils */ "./lib/utils.js"); + +/** + * Config-specific merge-function which creates a new config-object + * by merging two configuration objects together. + * + * @param {Object} config1 + * @param {Object} config2 + * @returns {Object} New object resulting from merging config2 to config1 + */ +module.exports = function mergeConfig(config1, config2) { + // eslint-disable-next-line no-param-reassign + config2 = config2 || {}; + var config = {}; + + function getMergedValue(target, source) { + if (utils.isPlainObject(target) && utils.isPlainObject(source)) { + return utils.merge(target, source); + } else if (utils.isPlainObject(source)) { + return utils.merge({}, source); + } else if (utils.isArray(source)) { + return source.slice(); + } + return source; + } + + // eslint-disable-next-line consistent-return + function mergeDeepProperties(prop) { + if (!utils.isUndefined(config2[prop])) { + return getMergedValue(config1[prop], config2[prop]); + } else if (!utils.isUndefined(config1[prop])) { + return getMergedValue(undefined, config1[prop]); + } + } + + // eslint-disable-next-line consistent-return + function valueFromConfig2(prop) { + if (!utils.isUndefined(config2[prop])) { + return getMergedValue(undefined, config2[prop]); + } + } + + // eslint-disable-next-line consistent-return + function defaultToConfig2(prop) { + if (!utils.isUndefined(config2[prop])) { + return getMergedValue(undefined, config2[prop]); + } else if (!utils.isUndefined(config1[prop])) { + return getMergedValue(undefined, config1[prop]); + } + } + + // eslint-disable-next-line consistent-return + function mergeDirectKeys(prop) { + if (prop in config2) { + return getMergedValue(config1[prop], config2[prop]); + } else if (prop in config1) { + return getMergedValue(undefined, config1[prop]); + } + } + + var mergeMap = { + 'url': valueFromConfig2, + 'method': valueFromConfig2, + 'data': valueFromConfig2, + 'baseURL': defaultToConfig2, + 'transformRequest': defaultToConfig2, + 'transformResponse': defaultToConfig2, + 'paramsSerializer': defaultToConfig2, + 'timeout': defaultToConfig2, + 'timeoutMessage': defaultToConfig2, + 'withCredentials': defaultToConfig2, + 'adapter': defaultToConfig2, + 'responseType': defaultToConfig2, + 'xsrfCookieName': defaultToConfig2, + 'xsrfHeaderName': defaultToConfig2, + 'onUploadProgress': defaultToConfig2, + 'onDownloadProgress': defaultToConfig2, + 'decompress': defaultToConfig2, + 'maxContentLength': defaultToConfig2, + 'maxBodyLength': defaultToConfig2, + 'transport': defaultToConfig2, + 'httpAgent': defaultToConfig2, + 'httpsAgent': defaultToConfig2, + 'cancelToken': defaultToConfig2, + 'socketPath': defaultToConfig2, + 'responseEncoding': defaultToConfig2, + 'validateStatus': mergeDirectKeys + }; + + utils.forEach(Object.keys(config1).concat(Object.keys(config2)), function computeConfigValue(prop) { + var merge = mergeMap[prop] || mergeDeepProperties; + var configValue = merge(prop); + (utils.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue); + }); + + return config; +}; + + +/***/ }), + +/***/ "./lib/core/settle.js": +/*!****************************!*\ + !*** ./lib/core/settle.js ***! + \****************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var createError = __webpack_require__(/*! ./createError */ "./lib/core/createError.js"); + +/** + * Resolve or reject a Promise based on response status. + * + * @param {Function} resolve A function that resolves the promise. + * @param {Function} reject A function that rejects the promise. + * @param {object} response The response. + */ +module.exports = function settle(resolve, reject, response) { + var validateStatus = response.config.validateStatus; + if (!response.status || !validateStatus || validateStatus(response.status)) { + resolve(response); + } else { + reject(createError( + 'Request failed with status code ' + response.status, + response.config, + null, + response.request, + response + )); + } +}; + + +/***/ }), + +/***/ "./lib/core/transformData.js": +/*!***********************************!*\ + !*** ./lib/core/transformData.js ***! + \***********************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var utils = __webpack_require__(/*! ./../utils */ "./lib/utils.js"); +var defaults = __webpack_require__(/*! ../defaults */ "./lib/defaults/index.js"); + +/** + * Transform the data for a request or a response + * + * @param {Object|String} data The data to be transformed + * @param {Array} headers The headers for the request or response + * @param {Array|Function} fns A single function or Array of functions + * @returns {*} The resulting transformed data + */ +module.exports = function transformData(data, headers, fns) { + var context = this || defaults; + /*eslint no-param-reassign:0*/ + utils.forEach(fns, function transform(fn) { + data = fn.call(context, data, headers); + }); + + return data; +}; + + +/***/ }), + +/***/ "./lib/defaults/index.js": +/*!*******************************!*\ + !*** ./lib/defaults/index.js ***! + \*******************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var utils = __webpack_require__(/*! ../utils */ "./lib/utils.js"); +var normalizeHeaderName = __webpack_require__(/*! ../helpers/normalizeHeaderName */ "./lib/helpers/normalizeHeaderName.js"); +var enhanceError = __webpack_require__(/*! ../core/enhanceError */ "./lib/core/enhanceError.js"); +var transitionalDefaults = __webpack_require__(/*! ./transitional */ "./lib/defaults/transitional.js"); + +var DEFAULT_CONTENT_TYPE = { + 'Content-Type': 'application/x-www-form-urlencoded' +}; + +function setContentTypeIfUnset(headers, value) { + if (!utils.isUndefined(headers) && utils.isUndefined(headers['Content-Type'])) { + headers['Content-Type'] = value; + } +} + +function getDefaultAdapter() { + var adapter; + if (typeof XMLHttpRequest !== 'undefined') { + // For browsers use XHR adapter + adapter = __webpack_require__(/*! ../adapters/xhr */ "./lib/adapters/xhr.js"); + } else if (typeof process !== 'undefined' && Object.prototype.toString.call(process) === '[object process]') { + // For node use HTTP adapter + adapter = __webpack_require__(/*! ../adapters/http */ "./lib/adapters/xhr.js"); + } + return adapter; +} + +function stringifySafely(rawValue, parser, encoder) { + if (utils.isString(rawValue)) { + try { + (parser || JSON.parse)(rawValue); + return utils.trim(rawValue); + } catch (e) { + if (e.name !== 'SyntaxError') { + throw e; + } + } + } + + return (encoder || JSON.stringify)(rawValue); +} + +var defaults = { + + transitional: transitionalDefaults, + + adapter: getDefaultAdapter(), + + transformRequest: [function transformRequest(data, headers) { + normalizeHeaderName(headers, 'Accept'); + normalizeHeaderName(headers, 'Content-Type'); + + if (utils.isFormData(data) || + utils.isArrayBuffer(data) || + utils.isBuffer(data) || + utils.isStream(data) || + utils.isFile(data) || + utils.isBlob(data) + ) { + return data; + } + if (utils.isArrayBufferView(data)) { + return data.buffer; + } + if (utils.isURLSearchParams(data)) { + setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8'); + return data.toString(); + } + if (utils.isObject(data) || (headers && headers['Content-Type'] === 'application/json')) { + setContentTypeIfUnset(headers, 'application/json'); + return stringifySafely(data); + } + return data; + }], + + transformResponse: [function transformResponse(data) { + var transitional = this.transitional || defaults.transitional; + var silentJSONParsing = transitional && transitional.silentJSONParsing; + var forcedJSONParsing = transitional && transitional.forcedJSONParsing; + var strictJSONParsing = !silentJSONParsing && this.responseType === 'json'; + + if (strictJSONParsing || (forcedJSONParsing && utils.isString(data) && data.length)) { + try { + return JSON.parse(data); + } catch (e) { + if (strictJSONParsing) { + if (e.name === 'SyntaxError') { + throw enhanceError(e, this, 'E_JSON_PARSE'); + } + throw e; + } + } + } + + return data; + }], + + /** + * A timeout in milliseconds to abort a request. If set to 0 (default) a + * timeout is not created. + */ + timeout: 0, + + xsrfCookieName: 'XSRF-TOKEN', + xsrfHeaderName: 'X-XSRF-TOKEN', + + maxContentLength: -1, + maxBodyLength: -1, + + validateStatus: function validateStatus(status) { + return status >= 200 && status < 300; + }, + + headers: { + common: { + 'Accept': 'application/json, text/plain, */*' + } + } +}; + +utils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) { + defaults.headers[method] = {}; +}); + +utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) { + defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE); +}); + +module.exports = defaults; + + +/***/ }), + +/***/ "./lib/defaults/transitional.js": +/*!**************************************!*\ + !*** ./lib/defaults/transitional.js ***! + \**************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +module.exports = { + silentJSONParsing: true, + forcedJSONParsing: true, + clarifyTimeoutError: false +}; + + +/***/ }), + +/***/ "./lib/env/data.js": +/*!*************************!*\ + !*** ./lib/env/data.js ***! + \*************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = { + "version": "0.26.1" +}; + +/***/ }), + +/***/ "./lib/helpers/bind.js": +/*!*****************************!*\ + !*** ./lib/helpers/bind.js ***! + \*****************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +module.exports = function bind(fn, thisArg) { + return function wrap() { + var args = new Array(arguments.length); + for (var i = 0; i < args.length; i++) { + args[i] = arguments[i]; + } + return fn.apply(thisArg, args); + }; +}; + + +/***/ }), + +/***/ "./lib/helpers/buildURL.js": +/*!*********************************!*\ + !*** ./lib/helpers/buildURL.js ***! + \*********************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var utils = __webpack_require__(/*! ./../utils */ "./lib/utils.js"); + +function encode(val) { + return encodeURIComponent(val). + replace(/%3A/gi, ':'). + replace(/%24/g, '$'). + replace(/%2C/gi, ','). + replace(/%20/g, '+'). + replace(/%5B/gi, '['). + replace(/%5D/gi, ']'); +} + +/** + * Build a URL by appending params to the end + * + * @param {string} url The base of the url (e.g., http://www.google.com) + * @param {object} [params] The params to be appended + * @returns {string} The formatted url + */ +module.exports = function buildURL(url, params, paramsSerializer) { + /*eslint no-param-reassign:0*/ + if (!params) { + return url; + } + + var serializedParams; + if (paramsSerializer) { + serializedParams = paramsSerializer(params); + } else if (utils.isURLSearchParams(params)) { + serializedParams = params.toString(); + } else { + var parts = []; + + utils.forEach(params, function serialize(val, key) { + if (val === null || typeof val === 'undefined') { + return; + } + + if (utils.isArray(val)) { + key = key + '[]'; + } else { + val = [val]; + } + + utils.forEach(val, function parseValue(v) { + if (utils.isDate(v)) { + v = v.toISOString(); + } else if (utils.isObject(v)) { + v = JSON.stringify(v); + } + parts.push(encode(key) + '=' + encode(v)); + }); + }); + + serializedParams = parts.join('&'); + } + + if (serializedParams) { + var hashmarkIndex = url.indexOf('#'); + if (hashmarkIndex !== -1) { + url = url.slice(0, hashmarkIndex); + } + + url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams; + } + + return url; +}; + + +/***/ }), + +/***/ "./lib/helpers/combineURLs.js": +/*!************************************!*\ + !*** ./lib/helpers/combineURLs.js ***! + \************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +/** + * Creates a new URL by combining the specified URLs + * + * @param {string} baseURL The base URL + * @param {string} relativeURL The relative URL + * @returns {string} The combined URL + */ +module.exports = function combineURLs(baseURL, relativeURL) { + return relativeURL + ? baseURL.replace(/\/+$/, '') + '/' + relativeURL.replace(/^\/+/, '') + : baseURL; +}; + + +/***/ }), + +/***/ "./lib/helpers/cookies.js": +/*!********************************!*\ + !*** ./lib/helpers/cookies.js ***! + \********************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var utils = __webpack_require__(/*! ./../utils */ "./lib/utils.js"); + +module.exports = ( + utils.isStandardBrowserEnv() ? + + // Standard browser envs support document.cookie + (function standardBrowserEnv() { + return { + write: function write(name, value, expires, path, domain, secure) { + var cookie = []; + cookie.push(name + '=' + encodeURIComponent(value)); + + if (utils.isNumber(expires)) { + cookie.push('expires=' + new Date(expires).toGMTString()); + } + + if (utils.isString(path)) { + cookie.push('path=' + path); + } + + if (utils.isString(domain)) { + cookie.push('domain=' + domain); + } + + if (secure === true) { + cookie.push('secure'); + } + + document.cookie = cookie.join('; '); + }, + + read: function read(name) { + var match = document.cookie.match(new RegExp('(^|;\\s*)(' + name + ')=([^;]*)')); + return (match ? decodeURIComponent(match[3]) : null); + }, + + remove: function remove(name) { + this.write(name, '', Date.now() - 86400000); + } + }; + })() : + + // Non standard browser env (web workers, react-native) lack needed support. + (function nonStandardBrowserEnv() { + return { + write: function write() {}, + read: function read() { return null; }, + remove: function remove() {} + }; + })() +); + + +/***/ }), + +/***/ "./lib/helpers/isAbsoluteURL.js": +/*!**************************************!*\ + !*** ./lib/helpers/isAbsoluteURL.js ***! + \**************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +/** + * Determines whether the specified URL is absolute + * + * @param {string} url The URL to test + * @returns {boolean} True if the specified URL is absolute, otherwise false + */ +module.exports = function isAbsoluteURL(url) { + // A URL is considered absolute if it begins with "://" or "//" (protocol-relative URL). + // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed + // by any combination of letters, digits, plus, period, or hyphen. + return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url); +}; + + +/***/ }), + +/***/ "./lib/helpers/isAxiosError.js": +/*!*************************************!*\ + !*** ./lib/helpers/isAxiosError.js ***! + \*************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var utils = __webpack_require__(/*! ./../utils */ "./lib/utils.js"); + +/** + * Determines whether the payload is an error thrown by Axios + * + * @param {*} payload The value to test + * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false + */ +module.exports = function isAxiosError(payload) { + return utils.isObject(payload) && (payload.isAxiosError === true); +}; + + +/***/ }), + +/***/ "./lib/helpers/isURLSameOrigin.js": +/*!****************************************!*\ + !*** ./lib/helpers/isURLSameOrigin.js ***! + \****************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var utils = __webpack_require__(/*! ./../utils */ "./lib/utils.js"); + +module.exports = ( + utils.isStandardBrowserEnv() ? + + // Standard browser envs have full support of the APIs needed to test + // whether the request URL is of the same origin as current location. + (function standardBrowserEnv() { + var msie = /(msie|trident)/i.test(navigator.userAgent); + var urlParsingNode = document.createElement('a'); + var originURL; + + /** + * Parse a URL to discover it's components + * + * @param {String} url The URL to be parsed + * @returns {Object} + */ + function resolveURL(url) { + var href = url; + + if (msie) { + // IE needs attribute set twice to normalize properties + urlParsingNode.setAttribute('href', href); + href = urlParsingNode.href; + } + + urlParsingNode.setAttribute('href', href); + + // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils + return { + href: urlParsingNode.href, + protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '', + host: urlParsingNode.host, + search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, '') : '', + hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '', + hostname: urlParsingNode.hostname, + port: urlParsingNode.port, + pathname: (urlParsingNode.pathname.charAt(0) === '/') ? + urlParsingNode.pathname : + '/' + urlParsingNode.pathname + }; + } + + originURL = resolveURL(window.location.href); + + /** + * Determine if a URL shares the same origin as the current location + * + * @param {String} requestURL The URL to test + * @returns {boolean} True if URL shares the same origin, otherwise false + */ + return function isURLSameOrigin(requestURL) { + var parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL; + return (parsed.protocol === originURL.protocol && + parsed.host === originURL.host); + }; + })() : + + // Non standard browser envs (web workers, react-native) lack needed support. + (function nonStandardBrowserEnv() { + return function isURLSameOrigin() { + return true; + }; + })() +); + + +/***/ }), + +/***/ "./lib/helpers/normalizeHeaderName.js": +/*!********************************************!*\ + !*** ./lib/helpers/normalizeHeaderName.js ***! + \********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var utils = __webpack_require__(/*! ../utils */ "./lib/utils.js"); + +module.exports = function normalizeHeaderName(headers, normalizedName) { + utils.forEach(headers, function processHeader(value, name) { + if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) { + headers[normalizedName] = value; + delete headers[name]; + } + }); +}; + + +/***/ }), + +/***/ "./lib/helpers/parseHeaders.js": +/*!*************************************!*\ + !*** ./lib/helpers/parseHeaders.js ***! + \*************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var utils = __webpack_require__(/*! ./../utils */ "./lib/utils.js"); + +// Headers whose duplicates are ignored by node +// c.f. https://nodejs.org/api/http.html#http_message_headers +var ignoreDuplicateOf = [ + 'age', 'authorization', 'content-length', 'content-type', 'etag', + 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since', + 'last-modified', 'location', 'max-forwards', 'proxy-authorization', + 'referer', 'retry-after', 'user-agent' +]; + +/** + * Parse headers into an object + * + * ``` + * Date: Wed, 27 Aug 2014 08:58:49 GMT + * Content-Type: application/json + * Connection: keep-alive + * Transfer-Encoding: chunked + * ``` + * + * @param {String} headers Headers needing to be parsed + * @returns {Object} Headers parsed into an object + */ +module.exports = function parseHeaders(headers) { + var parsed = {}; + var key; + var val; + var i; + + if (!headers) { return parsed; } + + utils.forEach(headers.split('\n'), function parser(line) { + i = line.indexOf(':'); + key = utils.trim(line.substr(0, i)).toLowerCase(); + val = utils.trim(line.substr(i + 1)); + + if (key) { + if (parsed[key] && ignoreDuplicateOf.indexOf(key) >= 0) { + return; + } + if (key === 'set-cookie') { + parsed[key] = (parsed[key] ? parsed[key] : []).concat([val]); + } else { + parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val; + } + } + }); + + return parsed; +}; + + +/***/ }), + +/***/ "./lib/helpers/spread.js": +/*!*******************************!*\ + !*** ./lib/helpers/spread.js ***! + \*******************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +/** + * Syntactic sugar for invoking a function and expanding an array for arguments. + * + * Common use case would be to use `Function.prototype.apply`. + * + * ```js + * function f(x, y, z) {} + * var args = [1, 2, 3]; + * f.apply(null, args); + * ``` + * + * With `spread` this example can be re-written. + * + * ```js + * spread(function(x, y, z) {})([1, 2, 3]); + * ``` + * + * @param {Function} callback + * @returns {Function} + */ +module.exports = function spread(callback) { + return function wrap(arr) { + return callback.apply(null, arr); + }; +}; + + +/***/ }), + +/***/ "./lib/helpers/validator.js": +/*!**********************************!*\ + !*** ./lib/helpers/validator.js ***! + \**********************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var VERSION = __webpack_require__(/*! ../env/data */ "./lib/env/data.js").version; + +var validators = {}; + +// eslint-disable-next-line func-names +['object', 'boolean', 'number', 'function', 'string', 'symbol'].forEach(function(type, i) { + validators[type] = function validator(thing) { + return typeof thing === type || 'a' + (i < 1 ? 'n ' : ' ') + type; + }; +}); + +var deprecatedWarnings = {}; + +/** + * Transitional option validator + * @param {function|boolean?} validator - set to false if the transitional option has been removed + * @param {string?} version - deprecated version / removed since version + * @param {string?} message - some message with additional info + * @returns {function} + */ +validators.transitional = function transitional(validator, version, message) { + function formatMessage(opt, desc) { + return '[Axios v' + VERSION + '] Transitional option \'' + opt + '\'' + desc + (message ? '. ' + message : ''); + } + + // eslint-disable-next-line func-names + return function(value, opt, opts) { + if (validator === false) { + throw new Error(formatMessage(opt, ' has been removed' + (version ? ' in ' + version : ''))); + } + + if (version && !deprecatedWarnings[opt]) { + deprecatedWarnings[opt] = true; + // eslint-disable-next-line no-console + console.warn( + formatMessage( + opt, + ' has been deprecated since v' + version + ' and will be removed in the near future' + ) + ); + } + + return validator ? validator(value, opt, opts) : true; + }; +}; + +/** + * Assert object's properties type + * @param {object} options + * @param {object} schema + * @param {boolean?} allowUnknown + */ + +function assertOptions(options, schema, allowUnknown) { + if (typeof options !== 'object') { + throw new TypeError('options must be an object'); + } + var keys = Object.keys(options); + var i = keys.length; + while (i-- > 0) { + var opt = keys[i]; + var validator = schema[opt]; + if (validator) { + var value = options[opt]; + var result = value === undefined || validator(value, opt, options); + if (result !== true) { + throw new TypeError('option ' + opt + ' must be ' + result); + } + continue; + } + if (allowUnknown !== true) { + throw Error('Unknown option ' + opt); + } + } +} + +module.exports = { + assertOptions: assertOptions, + validators: validators +}; + + +/***/ }), + +/***/ "./lib/utils.js": +/*!**********************!*\ + !*** ./lib/utils.js ***! + \**********************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var bind = __webpack_require__(/*! ./helpers/bind */ "./lib/helpers/bind.js"); + +// utils is a library of generic helper functions non-specific to axios + +var toString = Object.prototype.toString; + +/** + * Determine if a value is an Array + * + * @param {Object} val The value to test + * @returns {boolean} True if value is an Array, otherwise false + */ +function isArray(val) { + return Array.isArray(val); +} + +/** + * Determine if a value is undefined + * + * @param {Object} val The value to test + * @returns {boolean} True if the value is undefined, otherwise false + */ +function isUndefined(val) { + return typeof val === 'undefined'; +} + +/** + * Determine if a value is a Buffer + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a Buffer, otherwise false + */ +function isBuffer(val) { + return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor) + && typeof val.constructor.isBuffer === 'function' && val.constructor.isBuffer(val); +} + +/** + * Determine if a value is an ArrayBuffer + * + * @param {Object} val The value to test + * @returns {boolean} True if value is an ArrayBuffer, otherwise false + */ +function isArrayBuffer(val) { + return toString.call(val) === '[object ArrayBuffer]'; +} + +/** + * Determine if a value is a FormData + * + * @param {Object} val The value to test + * @returns {boolean} True if value is an FormData, otherwise false + */ +function isFormData(val) { + return toString.call(val) === '[object FormData]'; +} + +/** + * Determine if a value is a view on an ArrayBuffer + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false + */ +function isArrayBufferView(val) { + var result; + if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) { + result = ArrayBuffer.isView(val); + } else { + result = (val) && (val.buffer) && (isArrayBuffer(val.buffer)); + } + return result; +} + +/** + * Determine if a value is a String + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a String, otherwise false + */ +function isString(val) { + return typeof val === 'string'; +} + +/** + * Determine if a value is a Number + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a Number, otherwise false + */ +function isNumber(val) { + return typeof val === 'number'; +} + +/** + * Determine if a value is an Object + * + * @param {Object} val The value to test + * @returns {boolean} True if value is an Object, otherwise false + */ +function isObject(val) { + return val !== null && typeof val === 'object'; +} + +/** + * Determine if a value is a plain Object + * + * @param {Object} val The value to test + * @return {boolean} True if value is a plain Object, otherwise false + */ +function isPlainObject(val) { + if (toString.call(val) !== '[object Object]') { + return false; + } + + var prototype = Object.getPrototypeOf(val); + return prototype === null || prototype === Object.prototype; +} + +/** + * Determine if a value is a Date + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a Date, otherwise false + */ +function isDate(val) { + return toString.call(val) === '[object Date]'; +} + +/** + * Determine if a value is a File + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a File, otherwise false + */ +function isFile(val) { + return toString.call(val) === '[object File]'; +} + +/** + * Determine if a value is a Blob + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a Blob, otherwise false + */ +function isBlob(val) { + return toString.call(val) === '[object Blob]'; +} + +/** + * Determine if a value is a Function + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a Function, otherwise false + */ +function isFunction(val) { + return toString.call(val) === '[object Function]'; +} + +/** + * Determine if a value is a Stream + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a Stream, otherwise false + */ +function isStream(val) { + return isObject(val) && isFunction(val.pipe); +} + +/** + * Determine if a value is a URLSearchParams object + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a URLSearchParams object, otherwise false + */ +function isURLSearchParams(val) { + return toString.call(val) === '[object URLSearchParams]'; +} + +/** + * Trim excess whitespace off the beginning and end of a string + * + * @param {String} str The String to trim + * @returns {String} The String freed of excess whitespace + */ +function trim(str) { + return str.trim ? str.trim() : str.replace(/^\s+|\s+$/g, ''); +} + +/** + * Determine if we're running in a standard browser environment + * + * This allows axios to run in a web worker, and react-native. + * Both environments support XMLHttpRequest, but not fully standard globals. + * + * web workers: + * typeof window -> undefined + * typeof document -> undefined + * + * react-native: + * navigator.product -> 'ReactNative' + * nativescript + * navigator.product -> 'NativeScript' or 'NS' + */ +function isStandardBrowserEnv() { + if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' || + navigator.product === 'NativeScript' || + navigator.product === 'NS')) { + return false; + } + return ( + typeof window !== 'undefined' && + typeof document !== 'undefined' + ); +} + +/** + * Iterate over an Array or an Object invoking a function for each item. + * + * If `obj` is an Array callback will be called passing + * the value, index, and complete array for each item. + * + * If 'obj' is an Object callback will be called passing + * the value, key, and complete object for each property. + * + * @param {Object|Array} obj The object to iterate + * @param {Function} fn The callback to invoke for each item + */ +function forEach(obj, fn) { + // Don't bother if no value provided + if (obj === null || typeof obj === 'undefined') { + return; + } + + // Force an array if not already something iterable + if (typeof obj !== 'object') { + /*eslint no-param-reassign:0*/ + obj = [obj]; + } + + if (isArray(obj)) { + // Iterate over array values + for (var i = 0, l = obj.length; i < l; i++) { + fn.call(null, obj[i], i, obj); + } + } else { + // Iterate over object keys + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) { + fn.call(null, obj[key], key, obj); + } + } + } +} + +/** + * Accepts varargs expecting each argument to be an object, then + * immutably merges the properties of each object and returns result. + * + * When multiple objects contain the same key the later object in + * the arguments list will take precedence. + * + * Example: + * + * ```js + * var result = merge({foo: 123}, {foo: 456}); + * console.log(result.foo); // outputs 456 + * ``` + * + * @param {Object} obj1 Object to merge + * @returns {Object} Result of all merge properties + */ +function merge(/* obj1, obj2, obj3, ... */) { + var result = {}; + function assignValue(val, key) { + if (isPlainObject(result[key]) && isPlainObject(val)) { + result[key] = merge(result[key], val); + } else if (isPlainObject(val)) { + result[key] = merge({}, val); + } else if (isArray(val)) { + result[key] = val.slice(); + } else { + result[key] = val; + } + } + + for (var i = 0, l = arguments.length; i < l; i++) { + forEach(arguments[i], assignValue); + } + return result; +} + +/** + * Extends object a by mutably adding to it the properties of object b. + * + * @param {Object} a The object to be extended + * @param {Object} b The object to copy properties from + * @param {Object} thisArg The object to bind function to + * @return {Object} The resulting value of object a + */ +function extend(a, b, thisArg) { + forEach(b, function assignValue(val, key) { + if (thisArg && typeof val === 'function') { + a[key] = bind(val, thisArg); + } else { + a[key] = val; + } + }); + return a; +} + +/** + * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM) + * + * @param {string} content with BOM + * @return {string} content value without BOM + */ +function stripBOM(content) { + if (content.charCodeAt(0) === 0xFEFF) { + content = content.slice(1); + } + return content; +} + +module.exports = { + isArray: isArray, + isArrayBuffer: isArrayBuffer, + isBuffer: isBuffer, + isFormData: isFormData, + isArrayBufferView: isArrayBufferView, + isString: isString, + isNumber: isNumber, + isObject: isObject, + isPlainObject: isPlainObject, + isUndefined: isUndefined, + isDate: isDate, + isFile: isFile, + isBlob: isBlob, + isFunction: isFunction, + isStream: isStream, + isURLSearchParams: isURLSearchParams, + isStandardBrowserEnv: isStandardBrowserEnv, + forEach: forEach, + merge: merge, + extend: extend, + trim: trim, + stripBOM: stripBOM +}; + + +/***/ }) + +/******/ }); +}); +//# sourceMappingURL=axios.map \ No newline at end of file diff --git a/node_modules/@shineiichijo/marika/node_modules/axios/dist/axios.map b/node_modules/@shineiichijo/marika/node_modules/axios/dist/axios.map new file mode 100644 index 000000000..f0beb46d7 --- /dev/null +++ b/node_modules/@shineiichijo/marika/node_modules/axios/dist/axios.map @@ -0,0 +1 @@ +{"version":3,"sources":["webpack://axios/webpack/universalModuleDefinition","webpack://axios/webpack/bootstrap","webpack://axios/./index.js","webpack://axios/./lib/adapters/xhr.js","webpack://axios/./lib/axios.js","webpack://axios/./lib/cancel/Cancel.js","webpack://axios/./lib/cancel/CancelToken.js","webpack://axios/./lib/cancel/isCancel.js","webpack://axios/./lib/core/Axios.js","webpack://axios/./lib/core/InterceptorManager.js","webpack://axios/./lib/core/buildFullPath.js","webpack://axios/./lib/core/createError.js","webpack://axios/./lib/core/dispatchRequest.js","webpack://axios/./lib/core/enhanceError.js","webpack://axios/./lib/core/mergeConfig.js","webpack://axios/./lib/core/settle.js","webpack://axios/./lib/core/transformData.js","webpack://axios/./lib/defaults/index.js","webpack://axios/./lib/defaults/transitional.js","webpack://axios/./lib/env/data.js","webpack://axios/./lib/helpers/bind.js","webpack://axios/./lib/helpers/buildURL.js","webpack://axios/./lib/helpers/combineURLs.js","webpack://axios/./lib/helpers/cookies.js","webpack://axios/./lib/helpers/isAbsoluteURL.js","webpack://axios/./lib/helpers/isAxiosError.js","webpack://axios/./lib/helpers/isURLSameOrigin.js","webpack://axios/./lib/helpers/normalizeHeaderName.js","webpack://axios/./lib/helpers/parseHeaders.js","webpack://axios/./lib/helpers/spread.js","webpack://axios/./lib/helpers/validator.js","webpack://axios/./lib/utils.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,O;QCVA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA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;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;;;;;;;;;;;;;ACnNa;;AAEb,YAAY,mBAAO,CAAC,+BAAS;AAC7B,WAAW,mBAAO,CAAC,6CAAgB;AACnC,YAAY,mBAAO,CAAC,yCAAc;AAClC,kBAAkB,mBAAO,CAAC,qDAAoB;AAC9C,eAAe,mBAAO,CAAC,2CAAY;;AAEnC;AACA;AACA;AACA,WAAW,OAAO;AAClB,YAAY,MAAM;AAClB;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA,eAAe,mBAAO,CAAC,+CAAiB;AACxC,oBAAoB,mBAAO,CAAC,yDAAsB;AAClD,iBAAiB,mBAAO,CAAC,mDAAmB;AAC5C,gBAAgB,mBAAO,CAAC,qCAAY;;AAEpC;AACA;AACA;AACA;AACA,eAAe,mBAAO,CAAC,iDAAkB;;AAEzC;AACA,qBAAqB,mBAAO,CAAC,6DAAwB;;AAErD;;AAEA;AACA;;;;;;;;;;;;;ACxDa;;AAEb;AACA;AACA;AACA;AACA,WAAW,QAAQ;AACnB;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;;;;;;;;;;;;;AClBa;;AAEb,aAAa,mBAAO,CAAC,wCAAU;;AAE/B;AACA;AACA;AACA;AACA,WAAW,SAAS;AACpB;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,GAAG;;AAEH;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA,eAAe,OAAO;AACtB;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;;ACtHa;;AAEb;AACA;AACA;;;;;;;;;;;;;ACJa;;AAEb,YAAY,mBAAO,CAAC,kCAAY;AAChC,eAAe,mBAAO,CAAC,sDAAqB;AAC5C,yBAAyB,mBAAO,CAAC,8DAAsB;AACvD,sBAAsB,mBAAO,CAAC,wDAAmB;AACjD,kBAAkB,mBAAO,CAAC,gDAAe;AACzC,gBAAgB,mBAAO,CAAC,wDAAsB;;AAE9C;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA,GAAG;;AAEH;AACA;AACA;AACA,GAAG;;AAEH;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,gDAAgD;AAChD;AACA;AACA,yBAAyB;AACzB,KAAK;AACL;AACA,CAAC;;AAED;AACA;AACA;AACA,gDAAgD;AAChD;AACA;AACA;AACA,KAAK;AACL;AACA,CAAC;;AAED;;;;;;;;;;;;;ACnJa;;AAEb,YAAY,mBAAO,CAAC,kCAAY;;AAEhC;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,SAAS;AACpB,WAAW,SAAS;AACpB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,SAAS;AACpB;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;AAEA;;;;;;;;;;;;;ACrDa;;AAEb,oBAAoB,mBAAO,CAAC,gEAA0B;AACtD,kBAAkB,mBAAO,CAAC,4DAAwB;;AAElD;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACnBa;;AAEb,mBAAmB,mBAAO,CAAC,kDAAgB;;AAE3C;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,MAAM;AACnB;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACjBa;;AAEb,YAAY,mBAAO,CAAC,kCAAY;AAChC,oBAAoB,mBAAO,CAAC,oDAAiB;AAC7C,eAAe,mBAAO,CAAC,oDAAoB;AAC3C,eAAe,mBAAO,CAAC,4CAAa;AACpC,aAAa,mBAAO,CAAC,gDAAkB;;AAEvC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,+BAA+B;AAC/B,uCAAuC;AACvC;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,GAAG;AACH;;;;;;;;;;;;;ACtFa;;AAEb;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,MAAM;AACnB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;AC1Ca;;AAEb,YAAY,mBAAO,CAAC,gCAAU;;AAE9B;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL,2BAA2B;AAC3B,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;;;;;;;;;;;;;AClGa;;AAEb,kBAAkB,mBAAO,CAAC,gDAAe;;AAEzC;AACA;AACA;AACA,WAAW,SAAS;AACpB,WAAW,SAAS;AACpB,WAAW,OAAO;AAClB;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACxBa;;AAEb,YAAY,mBAAO,CAAC,kCAAY;AAChC,eAAe,mBAAO,CAAC,4CAAa;;AAEpC;AACA;AACA;AACA,WAAW,cAAc;AACzB,WAAW,MAAM;AACjB,WAAW,eAAe;AAC1B,aAAa,EAAE;AACf;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;;;;;;;;;;;;;ACrBa;;AAEb,YAAY,mBAAO,CAAC,gCAAU;AAC9B,0BAA0B,mBAAO,CAAC,4EAAgC;AAClE,mBAAmB,mBAAO,CAAC,wDAAsB;AACjD,2BAA2B,mBAAO,CAAC,sDAAgB;;AAEnD;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc,mBAAO,CAAC,8CAAiB;AACvC,GAAG;AACH;AACA,cAAc,mBAAO,CAAC,+CAAkB;AACxC;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wEAAwE;AACxE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,CAAC;;AAED;AACA;AACA,CAAC;;AAED;;;;;;;;;;;;;AClIa;;AAEb;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACNA;AACA;AACA,E;;;;;;;;;;;;ACFa;;AAEb;AACA;AACA;AACA,mBAAmB,iBAAiB;AACpC;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACVa;;AAEb,YAAY,mBAAO,CAAC,kCAAY;;AAEhC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,OAAO;AACP,KAAK;;AAEL;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;;;;;;;;;;;;ACrEa;;AAEb;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACba;;AAEb,YAAY,mBAAO,CAAC,kCAAY;;AAEhC;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,0CAA0C;AAC1C,SAAS;;AAET;AACA,4DAA4D,wBAAwB;AACpF;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,kCAAkC;AAClC,+BAA+B,aAAa,EAAE;AAC9C;AACA;AACA,KAAK;AACL;;;;;;;;;;;;;ACpDa;;AAEb;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACba;;AAEb,YAAY,mBAAO,CAAC,kCAAY;;AAEhC;AACA;AACA;AACA,WAAW,EAAE;AACb,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;;;;;;;;;;;;ACZa;;AAEb,YAAY,mBAAO,CAAC,kCAAY;;AAEhC;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,cAAc,OAAO;AACrB,gBAAgB;AAChB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,cAAc,OAAO;AACrB,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;;;;;;;;;;;;ACnEa;;AAEb,YAAY,mBAAO,CAAC,gCAAU;;AAE9B;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;;;;;;;;;;;;ACXa;;AAEb,YAAY,mBAAO,CAAC,kCAAY;;AAEhC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;;AAEA,iBAAiB,eAAe;;AAEhC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,GAAG;;AAEH;AACA;;;;;;;;;;;;;ACpDa;;AAEb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B;AAC/B;AACA;AACA,WAAW,SAAS;AACpB,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;AC1Ba;;AAEb,cAAc,mBAAO,CAAC,sCAAa;;AAEnC;;AAEA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;;AAEA;AACA;AACA,WAAW,kBAAkB;AAC7B,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,aAAa;AACb;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,SAAS;AACpB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;;;;;;;;;;;;ACjFa;;AAEb,WAAW,mBAAO,CAAC,6CAAgB;;AAEnC;;AAEA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,YAAY,QAAQ;AACpB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,OAAO;AACpB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,SAAS;AACpB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,mCAAmC,OAAO;AAC1C;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,SAAS,GAAG,SAAS;AAC5C,2BAA2B;AAC3B;AACA;AACA,WAAW,OAAO;AAClB,aAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,4BAA4B;AAC5B,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;;AAEA,uCAAuC,OAAO;AAC9C;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"axios.js","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[\"axios\"] = factory();\n\telse\n\t\troot[\"axios\"] = factory();\n})(this, function() {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = \"./index.js\");\n","module.exports = require('./lib/axios');","'use strict';\n\nvar utils = require('./../utils');\nvar settle = require('./../core/settle');\nvar cookies = require('./../helpers/cookies');\nvar buildURL = require('./../helpers/buildURL');\nvar buildFullPath = require('../core/buildFullPath');\nvar parseHeaders = require('./../helpers/parseHeaders');\nvar isURLSameOrigin = require('./../helpers/isURLSameOrigin');\nvar createError = require('../core/createError');\nvar transitionalDefaults = require('../defaults/transitional');\nvar Cancel = require('../cancel/Cancel');\n\nmodule.exports = function xhrAdapter(config) {\n return new Promise(function dispatchXhrRequest(resolve, reject) {\n var requestData = config.data;\n var requestHeaders = config.headers;\n var responseType = config.responseType;\n var onCanceled;\n function done() {\n if (config.cancelToken) {\n config.cancelToken.unsubscribe(onCanceled);\n }\n\n if (config.signal) {\n config.signal.removeEventListener('abort', onCanceled);\n }\n }\n\n if (utils.isFormData(requestData)) {\n delete requestHeaders['Content-Type']; // Let the browser set it\n }\n\n var request = new XMLHttpRequest();\n\n // HTTP basic authentication\n if (config.auth) {\n var username = config.auth.username || '';\n var password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : '';\n requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password);\n }\n\n var fullPath = buildFullPath(config.baseURL, config.url);\n request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true);\n\n // Set the request timeout in MS\n request.timeout = config.timeout;\n\n function onloadend() {\n if (!request) {\n return;\n }\n // Prepare the response\n var responseHeaders = 'getAllResponseHeaders' in request ? parseHeaders(request.getAllResponseHeaders()) : null;\n var responseData = !responseType || responseType === 'text' || responseType === 'json' ?\n request.responseText : request.response;\n var response = {\n data: responseData,\n status: request.status,\n statusText: request.statusText,\n headers: responseHeaders,\n config: config,\n request: request\n };\n\n settle(function _resolve(value) {\n resolve(value);\n done();\n }, function _reject(err) {\n reject(err);\n done();\n }, response);\n\n // Clean up request\n request = null;\n }\n\n if ('onloadend' in request) {\n // Use onloadend if available\n request.onloadend = onloadend;\n } else {\n // Listen for ready state to emulate onloadend\n request.onreadystatechange = function handleLoad() {\n if (!request || request.readyState !== 4) {\n return;\n }\n\n // The request errored out and we didn't get a response, this will be\n // handled by onerror instead\n // With one exception: request that using file: protocol, most browsers\n // will return status as 0 even though it's a successful request\n if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {\n return;\n }\n // readystate handler is calling before onerror or ontimeout handlers,\n // so we should call onloadend on the next 'tick'\n setTimeout(onloadend);\n };\n }\n\n // Handle browser request cancellation (as opposed to a manual cancellation)\n request.onabort = function handleAbort() {\n if (!request) {\n return;\n }\n\n reject(createError('Request aborted', config, 'ECONNABORTED', request));\n\n // Clean up request\n request = null;\n };\n\n // Handle low level network errors\n request.onerror = function handleError() {\n // Real errors are hidden from us by the browser\n // onerror should only fire if it's a network error\n reject(createError('Network Error', config, null, request));\n\n // Clean up request\n request = null;\n };\n\n // Handle timeout\n request.ontimeout = function handleTimeout() {\n var timeoutErrorMessage = config.timeout ? 'timeout of ' + config.timeout + 'ms exceeded' : 'timeout exceeded';\n var transitional = config.transitional || transitionalDefaults;\n if (config.timeoutErrorMessage) {\n timeoutErrorMessage = config.timeoutErrorMessage;\n }\n reject(createError(\n timeoutErrorMessage,\n config,\n transitional.clarifyTimeoutError ? 'ETIMEDOUT' : 'ECONNABORTED',\n request));\n\n // Clean up request\n request = null;\n };\n\n // Add xsrf header\n // This is only done if running in a standard browser environment.\n // Specifically not if we're in a web worker, or react-native.\n if (utils.isStandardBrowserEnv()) {\n // Add xsrf header\n var xsrfValue = (config.withCredentials || isURLSameOrigin(fullPath)) && config.xsrfCookieName ?\n cookies.read(config.xsrfCookieName) :\n undefined;\n\n if (xsrfValue) {\n requestHeaders[config.xsrfHeaderName] = xsrfValue;\n }\n }\n\n // Add headers to the request\n if ('setRequestHeader' in request) {\n utils.forEach(requestHeaders, function setRequestHeader(val, key) {\n if (typeof requestData === 'undefined' && key.toLowerCase() === 'content-type') {\n // Remove Content-Type if data is undefined\n delete requestHeaders[key];\n } else {\n // Otherwise add header to the request\n request.setRequestHeader(key, val);\n }\n });\n }\n\n // Add withCredentials to request if needed\n if (!utils.isUndefined(config.withCredentials)) {\n request.withCredentials = !!config.withCredentials;\n }\n\n // Add responseType to request if needed\n if (responseType && responseType !== 'json') {\n request.responseType = config.responseType;\n }\n\n // Handle progress if needed\n if (typeof config.onDownloadProgress === 'function') {\n request.addEventListener('progress', config.onDownloadProgress);\n }\n\n // Not all browsers support upload events\n if (typeof config.onUploadProgress === 'function' && request.upload) {\n request.upload.addEventListener('progress', config.onUploadProgress);\n }\n\n if (config.cancelToken || config.signal) {\n // Handle cancellation\n // eslint-disable-next-line func-names\n onCanceled = function(cancel) {\n if (!request) {\n return;\n }\n reject(!cancel || (cancel && cancel.type) ? new Cancel('canceled') : cancel);\n request.abort();\n request = null;\n };\n\n config.cancelToken && config.cancelToken.subscribe(onCanceled);\n if (config.signal) {\n config.signal.aborted ? onCanceled() : config.signal.addEventListener('abort', onCanceled);\n }\n }\n\n if (!requestData) {\n requestData = null;\n }\n\n // Send the request\n request.send(requestData);\n });\n};\n","'use strict';\n\nvar utils = require('./utils');\nvar bind = require('./helpers/bind');\nvar Axios = require('./core/Axios');\nvar mergeConfig = require('./core/mergeConfig');\nvar defaults = require('./defaults');\n\n/**\n * Create an instance of Axios\n *\n * @param {Object} defaultConfig The default config for the instance\n * @return {Axios} A new instance of Axios\n */\nfunction createInstance(defaultConfig) {\n var context = new Axios(defaultConfig);\n var instance = bind(Axios.prototype.request, context);\n\n // Copy axios.prototype to instance\n utils.extend(instance, Axios.prototype, context);\n\n // Copy context to instance\n utils.extend(instance, context);\n\n // Factory for creating new instances\n instance.create = function create(instanceConfig) {\n return createInstance(mergeConfig(defaultConfig, instanceConfig));\n };\n\n return instance;\n}\n\n// Create the default instance to be exported\nvar axios = createInstance(defaults);\n\n// Expose Axios class to allow class inheritance\naxios.Axios = Axios;\n\n// Expose Cancel & CancelToken\naxios.Cancel = require('./cancel/Cancel');\naxios.CancelToken = require('./cancel/CancelToken');\naxios.isCancel = require('./cancel/isCancel');\naxios.VERSION = require('./env/data').version;\n\n// Expose all/spread\naxios.all = function all(promises) {\n return Promise.all(promises);\n};\naxios.spread = require('./helpers/spread');\n\n// Expose isAxiosError\naxios.isAxiosError = require('./helpers/isAxiosError');\n\nmodule.exports = axios;\n\n// Allow use of default import syntax in TypeScript\nmodule.exports.default = axios;\n","'use strict';\n\n/**\n * A `Cancel` is an object that is thrown when an operation is canceled.\n *\n * @class\n * @param {string=} message The message.\n */\nfunction Cancel(message) {\n this.message = message;\n}\n\nCancel.prototype.toString = function toString() {\n return 'Cancel' + (this.message ? ': ' + this.message : '');\n};\n\nCancel.prototype.__CANCEL__ = true;\n\nmodule.exports = Cancel;\n","'use strict';\n\nvar Cancel = require('./Cancel');\n\n/**\n * A `CancelToken` is an object that can be used to request cancellation of an operation.\n *\n * @class\n * @param {Function} executor The executor function.\n */\nfunction CancelToken(executor) {\n if (typeof executor !== 'function') {\n throw new TypeError('executor must be a function.');\n }\n\n var resolvePromise;\n\n this.promise = new Promise(function promiseExecutor(resolve) {\n resolvePromise = resolve;\n });\n\n var token = this;\n\n // eslint-disable-next-line func-names\n this.promise.then(function(cancel) {\n if (!token._listeners) return;\n\n var i;\n var l = token._listeners.length;\n\n for (i = 0; i < l; i++) {\n token._listeners[i](cancel);\n }\n token._listeners = null;\n });\n\n // eslint-disable-next-line func-names\n this.promise.then = function(onfulfilled) {\n var _resolve;\n // eslint-disable-next-line func-names\n var promise = new Promise(function(resolve) {\n token.subscribe(resolve);\n _resolve = resolve;\n }).then(onfulfilled);\n\n promise.cancel = function reject() {\n token.unsubscribe(_resolve);\n };\n\n return promise;\n };\n\n executor(function cancel(message) {\n if (token.reason) {\n // Cancellation has already been requested\n return;\n }\n\n token.reason = new Cancel(message);\n resolvePromise(token.reason);\n });\n}\n\n/**\n * Throws a `Cancel` if cancellation has been requested.\n */\nCancelToken.prototype.throwIfRequested = function throwIfRequested() {\n if (this.reason) {\n throw this.reason;\n }\n};\n\n/**\n * Subscribe to the cancel signal\n */\n\nCancelToken.prototype.subscribe = function subscribe(listener) {\n if (this.reason) {\n listener(this.reason);\n return;\n }\n\n if (this._listeners) {\n this._listeners.push(listener);\n } else {\n this._listeners = [listener];\n }\n};\n\n/**\n * Unsubscribe from the cancel signal\n */\n\nCancelToken.prototype.unsubscribe = function unsubscribe(listener) {\n if (!this._listeners) {\n return;\n }\n var index = this._listeners.indexOf(listener);\n if (index !== -1) {\n this._listeners.splice(index, 1);\n }\n};\n\n/**\n * Returns an object that contains a new `CancelToken` and a function that, when called,\n * cancels the `CancelToken`.\n */\nCancelToken.source = function source() {\n var cancel;\n var token = new CancelToken(function executor(c) {\n cancel = c;\n });\n return {\n token: token,\n cancel: cancel\n };\n};\n\nmodule.exports = CancelToken;\n","'use strict';\n\nmodule.exports = function isCancel(value) {\n return !!(value && value.__CANCEL__);\n};\n","'use strict';\n\nvar utils = require('./../utils');\nvar buildURL = require('../helpers/buildURL');\nvar InterceptorManager = require('./InterceptorManager');\nvar dispatchRequest = require('./dispatchRequest');\nvar mergeConfig = require('./mergeConfig');\nvar validator = require('../helpers/validator');\n\nvar validators = validator.validators;\n/**\n * Create a new instance of Axios\n *\n * @param {Object} instanceConfig The default config for the instance\n */\nfunction Axios(instanceConfig) {\n this.defaults = instanceConfig;\n this.interceptors = {\n request: new InterceptorManager(),\n response: new InterceptorManager()\n };\n}\n\n/**\n * Dispatch a request\n *\n * @param {Object} config The config specific for this request (merged with this.defaults)\n */\nAxios.prototype.request = function request(configOrUrl, config) {\n /*eslint no-param-reassign:0*/\n // Allow for axios('example/url'[, config]) a la fetch API\n if (typeof configOrUrl === 'string') {\n config = config || {};\n config.url = configOrUrl;\n } else {\n config = configOrUrl || {};\n }\n\n config = mergeConfig(this.defaults, config);\n\n // Set config.method\n if (config.method) {\n config.method = config.method.toLowerCase();\n } else if (this.defaults.method) {\n config.method = this.defaults.method.toLowerCase();\n } else {\n config.method = 'get';\n }\n\n var transitional = config.transitional;\n\n if (transitional !== undefined) {\n validator.assertOptions(transitional, {\n silentJSONParsing: validators.transitional(validators.boolean),\n forcedJSONParsing: validators.transitional(validators.boolean),\n clarifyTimeoutError: validators.transitional(validators.boolean)\n }, false);\n }\n\n // filter out skipped interceptors\n var requestInterceptorChain = [];\n var synchronousRequestInterceptors = true;\n this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {\n if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) {\n return;\n }\n\n synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;\n\n requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);\n });\n\n var responseInterceptorChain = [];\n this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {\n responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);\n });\n\n var promise;\n\n if (!synchronousRequestInterceptors) {\n var chain = [dispatchRequest, undefined];\n\n Array.prototype.unshift.apply(chain, requestInterceptorChain);\n chain = chain.concat(responseInterceptorChain);\n\n promise = Promise.resolve(config);\n while (chain.length) {\n promise = promise.then(chain.shift(), chain.shift());\n }\n\n return promise;\n }\n\n\n var newConfig = config;\n while (requestInterceptorChain.length) {\n var onFulfilled = requestInterceptorChain.shift();\n var onRejected = requestInterceptorChain.shift();\n try {\n newConfig = onFulfilled(newConfig);\n } catch (error) {\n onRejected(error);\n break;\n }\n }\n\n try {\n promise = dispatchRequest(newConfig);\n } catch (error) {\n return Promise.reject(error);\n }\n\n while (responseInterceptorChain.length) {\n promise = promise.then(responseInterceptorChain.shift(), responseInterceptorChain.shift());\n }\n\n return promise;\n};\n\nAxios.prototype.getUri = function getUri(config) {\n config = mergeConfig(this.defaults, config);\n return buildURL(config.url, config.params, config.paramsSerializer).replace(/^\\?/, '');\n};\n\n// Provide aliases for supported request methods\nutils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, config) {\n return this.request(mergeConfig(config || {}, {\n method: method,\n url: url,\n data: (config || {}).data\n }));\n };\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, data, config) {\n return this.request(mergeConfig(config || {}, {\n method: method,\n url: url,\n data: data\n }));\n };\n});\n\nmodule.exports = Axios;\n","'use strict';\n\nvar utils = require('./../utils');\n\nfunction InterceptorManager() {\n this.handlers = [];\n}\n\n/**\n * Add a new interceptor to the stack\n *\n * @param {Function} fulfilled The function to handle `then` for a `Promise`\n * @param {Function} rejected The function to handle `reject` for a `Promise`\n *\n * @return {Number} An ID used to remove interceptor later\n */\nInterceptorManager.prototype.use = function use(fulfilled, rejected, options) {\n this.handlers.push({\n fulfilled: fulfilled,\n rejected: rejected,\n synchronous: options ? options.synchronous : false,\n runWhen: options ? options.runWhen : null\n });\n return this.handlers.length - 1;\n};\n\n/**\n * Remove an interceptor from the stack\n *\n * @param {Number} id The ID that was returned by `use`\n */\nInterceptorManager.prototype.eject = function eject(id) {\n if (this.handlers[id]) {\n this.handlers[id] = null;\n }\n};\n\n/**\n * Iterate over all the registered interceptors\n *\n * This method is particularly useful for skipping over any\n * interceptors that may have become `null` calling `eject`.\n *\n * @param {Function} fn The function to call for each interceptor\n */\nInterceptorManager.prototype.forEach = function forEach(fn) {\n utils.forEach(this.handlers, function forEachHandler(h) {\n if (h !== null) {\n fn(h);\n }\n });\n};\n\nmodule.exports = InterceptorManager;\n","'use strict';\n\nvar isAbsoluteURL = require('../helpers/isAbsoluteURL');\nvar combineURLs = require('../helpers/combineURLs');\n\n/**\n * Creates a new URL by combining the baseURL with the requestedURL,\n * only when the requestedURL is not already an absolute URL.\n * If the requestURL is absolute, this function returns the requestedURL untouched.\n *\n * @param {string} baseURL The base URL\n * @param {string} requestedURL Absolute or relative URL to combine\n * @returns {string} The combined full path\n */\nmodule.exports = function buildFullPath(baseURL, requestedURL) {\n if (baseURL && !isAbsoluteURL(requestedURL)) {\n return combineURLs(baseURL, requestedURL);\n }\n return requestedURL;\n};\n","'use strict';\n\nvar enhanceError = require('./enhanceError');\n\n/**\n * Create an Error with the specified message, config, error code, request and response.\n *\n * @param {string} message The error message.\n * @param {Object} config The config.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n * @returns {Error} The created error.\n */\nmodule.exports = function createError(message, config, code, request, response) {\n var error = new Error(message);\n return enhanceError(error, config, code, request, response);\n};\n","'use strict';\n\nvar utils = require('./../utils');\nvar transformData = require('./transformData');\nvar isCancel = require('../cancel/isCancel');\nvar defaults = require('../defaults');\nvar Cancel = require('../cancel/Cancel');\n\n/**\n * Throws a `Cancel` if cancellation has been requested.\n */\nfunction throwIfCancellationRequested(config) {\n if (config.cancelToken) {\n config.cancelToken.throwIfRequested();\n }\n\n if (config.signal && config.signal.aborted) {\n throw new Cancel('canceled');\n }\n}\n\n/**\n * Dispatch a request to the server using the configured adapter.\n *\n * @param {object} config The config that is to be used for the request\n * @returns {Promise} The Promise to be fulfilled\n */\nmodule.exports = function dispatchRequest(config) {\n throwIfCancellationRequested(config);\n\n // Ensure headers exist\n config.headers = config.headers || {};\n\n // Transform request data\n config.data = transformData.call(\n config,\n config.data,\n config.headers,\n config.transformRequest\n );\n\n // Flatten headers\n config.headers = utils.merge(\n config.headers.common || {},\n config.headers[config.method] || {},\n config.headers\n );\n\n utils.forEach(\n ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],\n function cleanHeaderConfig(method) {\n delete config.headers[method];\n }\n );\n\n var adapter = config.adapter || defaults.adapter;\n\n return adapter(config).then(function onAdapterResolution(response) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n response.data = transformData.call(\n config,\n response.data,\n response.headers,\n config.transformResponse\n );\n\n return response;\n }, function onAdapterRejection(reason) {\n if (!isCancel(reason)) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n if (reason && reason.response) {\n reason.response.data = transformData.call(\n config,\n reason.response.data,\n reason.response.headers,\n config.transformResponse\n );\n }\n }\n\n return Promise.reject(reason);\n });\n};\n","'use strict';\n\n/**\n * Update an Error with the specified config, error code, and response.\n *\n * @param {Error} error The error to update.\n * @param {Object} config The config.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n * @returns {Error} The error.\n */\nmodule.exports = function enhanceError(error, config, code, request, response) {\n error.config = config;\n if (code) {\n error.code = code;\n }\n\n error.request = request;\n error.response = response;\n error.isAxiosError = true;\n\n error.toJSON = function toJSON() {\n return {\n // Standard\n message: this.message,\n name: this.name,\n // Microsoft\n description: this.description,\n number: this.number,\n // Mozilla\n fileName: this.fileName,\n lineNumber: this.lineNumber,\n columnNumber: this.columnNumber,\n stack: this.stack,\n // Axios\n config: this.config,\n code: this.code,\n status: this.response && this.response.status ? this.response.status : null\n };\n };\n return error;\n};\n","'use strict';\n\nvar utils = require('../utils');\n\n/**\n * Config-specific merge-function which creates a new config-object\n * by merging two configuration objects together.\n *\n * @param {Object} config1\n * @param {Object} config2\n * @returns {Object} New object resulting from merging config2 to config1\n */\nmodule.exports = function mergeConfig(config1, config2) {\n // eslint-disable-next-line no-param-reassign\n config2 = config2 || {};\n var config = {};\n\n function getMergedValue(target, source) {\n if (utils.isPlainObject(target) && utils.isPlainObject(source)) {\n return utils.merge(target, source);\n } else if (utils.isPlainObject(source)) {\n return utils.merge({}, source);\n } else if (utils.isArray(source)) {\n return source.slice();\n }\n return source;\n }\n\n // eslint-disable-next-line consistent-return\n function mergeDeepProperties(prop) {\n if (!utils.isUndefined(config2[prop])) {\n return getMergedValue(config1[prop], config2[prop]);\n } else if (!utils.isUndefined(config1[prop])) {\n return getMergedValue(undefined, config1[prop]);\n }\n }\n\n // eslint-disable-next-line consistent-return\n function valueFromConfig2(prop) {\n if (!utils.isUndefined(config2[prop])) {\n return getMergedValue(undefined, config2[prop]);\n }\n }\n\n // eslint-disable-next-line consistent-return\n function defaultToConfig2(prop) {\n if (!utils.isUndefined(config2[prop])) {\n return getMergedValue(undefined, config2[prop]);\n } else if (!utils.isUndefined(config1[prop])) {\n return getMergedValue(undefined, config1[prop]);\n }\n }\n\n // eslint-disable-next-line consistent-return\n function mergeDirectKeys(prop) {\n if (prop in config2) {\n return getMergedValue(config1[prop], config2[prop]);\n } else if (prop in config1) {\n return getMergedValue(undefined, config1[prop]);\n }\n }\n\n var mergeMap = {\n 'url': valueFromConfig2,\n 'method': valueFromConfig2,\n 'data': valueFromConfig2,\n 'baseURL': defaultToConfig2,\n 'transformRequest': defaultToConfig2,\n 'transformResponse': defaultToConfig2,\n 'paramsSerializer': defaultToConfig2,\n 'timeout': defaultToConfig2,\n 'timeoutMessage': defaultToConfig2,\n 'withCredentials': defaultToConfig2,\n 'adapter': defaultToConfig2,\n 'responseType': defaultToConfig2,\n 'xsrfCookieName': defaultToConfig2,\n 'xsrfHeaderName': defaultToConfig2,\n 'onUploadProgress': defaultToConfig2,\n 'onDownloadProgress': defaultToConfig2,\n 'decompress': defaultToConfig2,\n 'maxContentLength': defaultToConfig2,\n 'maxBodyLength': defaultToConfig2,\n 'transport': defaultToConfig2,\n 'httpAgent': defaultToConfig2,\n 'httpsAgent': defaultToConfig2,\n 'cancelToken': defaultToConfig2,\n 'socketPath': defaultToConfig2,\n 'responseEncoding': defaultToConfig2,\n 'validateStatus': mergeDirectKeys\n };\n\n utils.forEach(Object.keys(config1).concat(Object.keys(config2)), function computeConfigValue(prop) {\n var merge = mergeMap[prop] || mergeDeepProperties;\n var configValue = merge(prop);\n (utils.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);\n });\n\n return config;\n};\n","'use strict';\n\nvar createError = require('./createError');\n\n/**\n * Resolve or reject a Promise based on response status.\n *\n * @param {Function} resolve A function that resolves the promise.\n * @param {Function} reject A function that rejects the promise.\n * @param {object} response The response.\n */\nmodule.exports = function settle(resolve, reject, response) {\n var validateStatus = response.config.validateStatus;\n if (!response.status || !validateStatus || validateStatus(response.status)) {\n resolve(response);\n } else {\n reject(createError(\n 'Request failed with status code ' + response.status,\n response.config,\n null,\n response.request,\n response\n ));\n }\n};\n","'use strict';\n\nvar utils = require('./../utils');\nvar defaults = require('../defaults');\n\n/**\n * Transform the data for a request or a response\n *\n * @param {Object|String} data The data to be transformed\n * @param {Array} headers The headers for the request or response\n * @param {Array|Function} fns A single function or Array of functions\n * @returns {*} The resulting transformed data\n */\nmodule.exports = function transformData(data, headers, fns) {\n var context = this || defaults;\n /*eslint no-param-reassign:0*/\n utils.forEach(fns, function transform(fn) {\n data = fn.call(context, data, headers);\n });\n\n return data;\n};\n","'use strict';\n\nvar utils = require('../utils');\nvar normalizeHeaderName = require('../helpers/normalizeHeaderName');\nvar enhanceError = require('../core/enhanceError');\nvar transitionalDefaults = require('./transitional');\n\nvar DEFAULT_CONTENT_TYPE = {\n 'Content-Type': 'application/x-www-form-urlencoded'\n};\n\nfunction setContentTypeIfUnset(headers, value) {\n if (!utils.isUndefined(headers) && utils.isUndefined(headers['Content-Type'])) {\n headers['Content-Type'] = value;\n }\n}\n\nfunction getDefaultAdapter() {\n var adapter;\n if (typeof XMLHttpRequest !== 'undefined') {\n // For browsers use XHR adapter\n adapter = require('../adapters/xhr');\n } else if (typeof process !== 'undefined' && Object.prototype.toString.call(process) === '[object process]') {\n // For node use HTTP adapter\n adapter = require('../adapters/http');\n }\n return adapter;\n}\n\nfunction stringifySafely(rawValue, parser, encoder) {\n if (utils.isString(rawValue)) {\n try {\n (parser || JSON.parse)(rawValue);\n return utils.trim(rawValue);\n } catch (e) {\n if (e.name !== 'SyntaxError') {\n throw e;\n }\n }\n }\n\n return (encoder || JSON.stringify)(rawValue);\n}\n\nvar defaults = {\n\n transitional: transitionalDefaults,\n\n adapter: getDefaultAdapter(),\n\n transformRequest: [function transformRequest(data, headers) {\n normalizeHeaderName(headers, 'Accept');\n normalizeHeaderName(headers, 'Content-Type');\n\n if (utils.isFormData(data) ||\n utils.isArrayBuffer(data) ||\n utils.isBuffer(data) ||\n utils.isStream(data) ||\n utils.isFile(data) ||\n utils.isBlob(data)\n ) {\n return data;\n }\n if (utils.isArrayBufferView(data)) {\n return data.buffer;\n }\n if (utils.isURLSearchParams(data)) {\n setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8');\n return data.toString();\n }\n if (utils.isObject(data) || (headers && headers['Content-Type'] === 'application/json')) {\n setContentTypeIfUnset(headers, 'application/json');\n return stringifySafely(data);\n }\n return data;\n }],\n\n transformResponse: [function transformResponse(data) {\n var transitional = this.transitional || defaults.transitional;\n var silentJSONParsing = transitional && transitional.silentJSONParsing;\n var forcedJSONParsing = transitional && transitional.forcedJSONParsing;\n var strictJSONParsing = !silentJSONParsing && this.responseType === 'json';\n\n if (strictJSONParsing || (forcedJSONParsing && utils.isString(data) && data.length)) {\n try {\n return JSON.parse(data);\n } catch (e) {\n if (strictJSONParsing) {\n if (e.name === 'SyntaxError') {\n throw enhanceError(e, this, 'E_JSON_PARSE');\n }\n throw e;\n }\n }\n }\n\n return data;\n }],\n\n /**\n * A timeout in milliseconds to abort a request. If set to 0 (default) a\n * timeout is not created.\n */\n timeout: 0,\n\n xsrfCookieName: 'XSRF-TOKEN',\n xsrfHeaderName: 'X-XSRF-TOKEN',\n\n maxContentLength: -1,\n maxBodyLength: -1,\n\n validateStatus: function validateStatus(status) {\n return status >= 200 && status < 300;\n },\n\n headers: {\n common: {\n 'Accept': 'application/json, text/plain, */*'\n }\n }\n};\n\nutils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) {\n defaults.headers[method] = {};\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE);\n});\n\nmodule.exports = defaults;\n","'use strict';\n\nmodule.exports = {\n silentJSONParsing: true,\n forcedJSONParsing: true,\n clarifyTimeoutError: false\n};\n","module.exports = {\n \"version\": \"0.26.1\"\n};","'use strict';\n\nmodule.exports = function bind(fn, thisArg) {\n return function wrap() {\n var args = new Array(arguments.length);\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i];\n }\n return fn.apply(thisArg, args);\n };\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\nfunction encode(val) {\n return encodeURIComponent(val).\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%20/g, '+').\n replace(/%5B/gi, '[').\n replace(/%5D/gi, ']');\n}\n\n/**\n * Build a URL by appending params to the end\n *\n * @param {string} url The base of the url (e.g., http://www.google.com)\n * @param {object} [params] The params to be appended\n * @returns {string} The formatted url\n */\nmodule.exports = function buildURL(url, params, paramsSerializer) {\n /*eslint no-param-reassign:0*/\n if (!params) {\n return url;\n }\n\n var serializedParams;\n if (paramsSerializer) {\n serializedParams = paramsSerializer(params);\n } else if (utils.isURLSearchParams(params)) {\n serializedParams = params.toString();\n } else {\n var parts = [];\n\n utils.forEach(params, function serialize(val, key) {\n if (val === null || typeof val === 'undefined') {\n return;\n }\n\n if (utils.isArray(val)) {\n key = key + '[]';\n } else {\n val = [val];\n }\n\n utils.forEach(val, function parseValue(v) {\n if (utils.isDate(v)) {\n v = v.toISOString();\n } else if (utils.isObject(v)) {\n v = JSON.stringify(v);\n }\n parts.push(encode(key) + '=' + encode(v));\n });\n });\n\n serializedParams = parts.join('&');\n }\n\n if (serializedParams) {\n var hashmarkIndex = url.indexOf('#');\n if (hashmarkIndex !== -1) {\n url = url.slice(0, hashmarkIndex);\n }\n\n url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;\n }\n\n return url;\n};\n","'use strict';\n\n/**\n * Creates a new URL by combining the specified URLs\n *\n * @param {string} baseURL The base URL\n * @param {string} relativeURL The relative URL\n * @returns {string} The combined URL\n */\nmodule.exports = function combineURLs(baseURL, relativeURL) {\n return relativeURL\n ? baseURL.replace(/\\/+$/, '') + '/' + relativeURL.replace(/^\\/+/, '')\n : baseURL;\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\nmodule.exports = (\n utils.isStandardBrowserEnv() ?\n\n // Standard browser envs support document.cookie\n (function standardBrowserEnv() {\n return {\n write: function write(name, value, expires, path, domain, secure) {\n var cookie = [];\n cookie.push(name + '=' + encodeURIComponent(value));\n\n if (utils.isNumber(expires)) {\n cookie.push('expires=' + new Date(expires).toGMTString());\n }\n\n if (utils.isString(path)) {\n cookie.push('path=' + path);\n }\n\n if (utils.isString(domain)) {\n cookie.push('domain=' + domain);\n }\n\n if (secure === true) {\n cookie.push('secure');\n }\n\n document.cookie = cookie.join('; ');\n },\n\n read: function read(name) {\n var match = document.cookie.match(new RegExp('(^|;\\\\s*)(' + name + ')=([^;]*)'));\n return (match ? decodeURIComponent(match[3]) : null);\n },\n\n remove: function remove(name) {\n this.write(name, '', Date.now() - 86400000);\n }\n };\n })() :\n\n // Non standard browser env (web workers, react-native) lack needed support.\n (function nonStandardBrowserEnv() {\n return {\n write: function write() {},\n read: function read() { return null; },\n remove: function remove() {}\n };\n })()\n);\n","'use strict';\n\n/**\n * Determines whether the specified URL is absolute\n *\n * @param {string} url The URL to test\n * @returns {boolean} True if the specified URL is absolute, otherwise false\n */\nmodule.exports = function isAbsoluteURL(url) {\n // A URL is considered absolute if it begins with \"://\" or \"//\" (protocol-relative URL).\n // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed\n // by any combination of letters, digits, plus, period, or hyphen.\n return /^([a-z][a-z\\d+\\-.]*:)?\\/\\//i.test(url);\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\n/**\n * Determines whether the payload is an error thrown by Axios\n *\n * @param {*} payload The value to test\n * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false\n */\nmodule.exports = function isAxiosError(payload) {\n return utils.isObject(payload) && (payload.isAxiosError === true);\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\nmodule.exports = (\n utils.isStandardBrowserEnv() ?\n\n // Standard browser envs have full support of the APIs needed to test\n // whether the request URL is of the same origin as current location.\n (function standardBrowserEnv() {\n var msie = /(msie|trident)/i.test(navigator.userAgent);\n var urlParsingNode = document.createElement('a');\n var originURL;\n\n /**\n * Parse a URL to discover it's components\n *\n * @param {String} url The URL to be parsed\n * @returns {Object}\n */\n function resolveURL(url) {\n var href = url;\n\n if (msie) {\n // IE needs attribute set twice to normalize properties\n urlParsingNode.setAttribute('href', href);\n href = urlParsingNode.href;\n }\n\n urlParsingNode.setAttribute('href', href);\n\n // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils\n return {\n href: urlParsingNode.href,\n protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',\n host: urlParsingNode.host,\n search: urlParsingNode.search ? urlParsingNode.search.replace(/^\\?/, '') : '',\n hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',\n hostname: urlParsingNode.hostname,\n port: urlParsingNode.port,\n pathname: (urlParsingNode.pathname.charAt(0) === '/') ?\n urlParsingNode.pathname :\n '/' + urlParsingNode.pathname\n };\n }\n\n originURL = resolveURL(window.location.href);\n\n /**\n * Determine if a URL shares the same origin as the current location\n *\n * @param {String} requestURL The URL to test\n * @returns {boolean} True if URL shares the same origin, otherwise false\n */\n return function isURLSameOrigin(requestURL) {\n var parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL;\n return (parsed.protocol === originURL.protocol &&\n parsed.host === originURL.host);\n };\n })() :\n\n // Non standard browser envs (web workers, react-native) lack needed support.\n (function nonStandardBrowserEnv() {\n return function isURLSameOrigin() {\n return true;\n };\n })()\n);\n","'use strict';\n\nvar utils = require('../utils');\n\nmodule.exports = function normalizeHeaderName(headers, normalizedName) {\n utils.forEach(headers, function processHeader(value, name) {\n if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) {\n headers[normalizedName] = value;\n delete headers[name];\n }\n });\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\n// Headers whose duplicates are ignored by node\n// c.f. https://nodejs.org/api/http.html#http_message_headers\nvar ignoreDuplicateOf = [\n 'age', 'authorization', 'content-length', 'content-type', 'etag',\n 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',\n 'last-modified', 'location', 'max-forwards', 'proxy-authorization',\n 'referer', 'retry-after', 'user-agent'\n];\n\n/**\n * Parse headers into an object\n *\n * ```\n * Date: Wed, 27 Aug 2014 08:58:49 GMT\n * Content-Type: application/json\n * Connection: keep-alive\n * Transfer-Encoding: chunked\n * ```\n *\n * @param {String} headers Headers needing to be parsed\n * @returns {Object} Headers parsed into an object\n */\nmodule.exports = function parseHeaders(headers) {\n var parsed = {};\n var key;\n var val;\n var i;\n\n if (!headers) { return parsed; }\n\n utils.forEach(headers.split('\\n'), function parser(line) {\n i = line.indexOf(':');\n key = utils.trim(line.substr(0, i)).toLowerCase();\n val = utils.trim(line.substr(i + 1));\n\n if (key) {\n if (parsed[key] && ignoreDuplicateOf.indexOf(key) >= 0) {\n return;\n }\n if (key === 'set-cookie') {\n parsed[key] = (parsed[key] ? parsed[key] : []).concat([val]);\n } else {\n parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;\n }\n }\n });\n\n return parsed;\n};\n","'use strict';\n\n/**\n * Syntactic sugar for invoking a function and expanding an array for arguments.\n *\n * Common use case would be to use `Function.prototype.apply`.\n *\n * ```js\n * function f(x, y, z) {}\n * var args = [1, 2, 3];\n * f.apply(null, args);\n * ```\n *\n * With `spread` this example can be re-written.\n *\n * ```js\n * spread(function(x, y, z) {})([1, 2, 3]);\n * ```\n *\n * @param {Function} callback\n * @returns {Function}\n */\nmodule.exports = function spread(callback) {\n return function wrap(arr) {\n return callback.apply(null, arr);\n };\n};\n","'use strict';\n\nvar VERSION = require('../env/data').version;\n\nvar validators = {};\n\n// eslint-disable-next-line func-names\n['object', 'boolean', 'number', 'function', 'string', 'symbol'].forEach(function(type, i) {\n validators[type] = function validator(thing) {\n return typeof thing === type || 'a' + (i < 1 ? 'n ' : ' ') + type;\n };\n});\n\nvar deprecatedWarnings = {};\n\n/**\n * Transitional option validator\n * @param {function|boolean?} validator - set to false if the transitional option has been removed\n * @param {string?} version - deprecated version / removed since version\n * @param {string?} message - some message with additional info\n * @returns {function}\n */\nvalidators.transitional = function transitional(validator, version, message) {\n function formatMessage(opt, desc) {\n return '[Axios v' + VERSION + '] Transitional option \\'' + opt + '\\'' + desc + (message ? '. ' + message : '');\n }\n\n // eslint-disable-next-line func-names\n return function(value, opt, opts) {\n if (validator === false) {\n throw new Error(formatMessage(opt, ' has been removed' + (version ? ' in ' + version : '')));\n }\n\n if (version && !deprecatedWarnings[opt]) {\n deprecatedWarnings[opt] = true;\n // eslint-disable-next-line no-console\n console.warn(\n formatMessage(\n opt,\n ' has been deprecated since v' + version + ' and will be removed in the near future'\n )\n );\n }\n\n return validator ? validator(value, opt, opts) : true;\n };\n};\n\n/**\n * Assert object's properties type\n * @param {object} options\n * @param {object} schema\n * @param {boolean?} allowUnknown\n */\n\nfunction assertOptions(options, schema, allowUnknown) {\n if (typeof options !== 'object') {\n throw new TypeError('options must be an object');\n }\n var keys = Object.keys(options);\n var i = keys.length;\n while (i-- > 0) {\n var opt = keys[i];\n var validator = schema[opt];\n if (validator) {\n var value = options[opt];\n var result = value === undefined || validator(value, opt, options);\n if (result !== true) {\n throw new TypeError('option ' + opt + ' must be ' + result);\n }\n continue;\n }\n if (allowUnknown !== true) {\n throw Error('Unknown option ' + opt);\n }\n }\n}\n\nmodule.exports = {\n assertOptions: assertOptions,\n validators: validators\n};\n","'use strict';\n\nvar bind = require('./helpers/bind');\n\n// utils is a library of generic helper functions non-specific to axios\n\nvar toString = Object.prototype.toString;\n\n/**\n * Determine if a value is an Array\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an Array, otherwise false\n */\nfunction isArray(val) {\n return Array.isArray(val);\n}\n\n/**\n * Determine if a value is undefined\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if the value is undefined, otherwise false\n */\nfunction isUndefined(val) {\n return typeof val === 'undefined';\n}\n\n/**\n * Determine if a value is a Buffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Buffer, otherwise false\n */\nfunction isBuffer(val) {\n return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor)\n && typeof val.constructor.isBuffer === 'function' && val.constructor.isBuffer(val);\n}\n\n/**\n * Determine if a value is an ArrayBuffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an ArrayBuffer, otherwise false\n */\nfunction isArrayBuffer(val) {\n return toString.call(val) === '[object ArrayBuffer]';\n}\n\n/**\n * Determine if a value is a FormData\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an FormData, otherwise false\n */\nfunction isFormData(val) {\n return toString.call(val) === '[object FormData]';\n}\n\n/**\n * Determine if a value is a view on an ArrayBuffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false\n */\nfunction isArrayBufferView(val) {\n var result;\n if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {\n result = ArrayBuffer.isView(val);\n } else {\n result = (val) && (val.buffer) && (isArrayBuffer(val.buffer));\n }\n return result;\n}\n\n/**\n * Determine if a value is a String\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a String, otherwise false\n */\nfunction isString(val) {\n return typeof val === 'string';\n}\n\n/**\n * Determine if a value is a Number\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Number, otherwise false\n */\nfunction isNumber(val) {\n return typeof val === 'number';\n}\n\n/**\n * Determine if a value is an Object\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an Object, otherwise false\n */\nfunction isObject(val) {\n return val !== null && typeof val === 'object';\n}\n\n/**\n * Determine if a value is a plain Object\n *\n * @param {Object} val The value to test\n * @return {boolean} True if value is a plain Object, otherwise false\n */\nfunction isPlainObject(val) {\n if (toString.call(val) !== '[object Object]') {\n return false;\n }\n\n var prototype = Object.getPrototypeOf(val);\n return prototype === null || prototype === Object.prototype;\n}\n\n/**\n * Determine if a value is a Date\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Date, otherwise false\n */\nfunction isDate(val) {\n return toString.call(val) === '[object Date]';\n}\n\n/**\n * Determine if a value is a File\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a File, otherwise false\n */\nfunction isFile(val) {\n return toString.call(val) === '[object File]';\n}\n\n/**\n * Determine if a value is a Blob\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Blob, otherwise false\n */\nfunction isBlob(val) {\n return toString.call(val) === '[object Blob]';\n}\n\n/**\n * Determine if a value is a Function\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Function, otherwise false\n */\nfunction isFunction(val) {\n return toString.call(val) === '[object Function]';\n}\n\n/**\n * Determine if a value is a Stream\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Stream, otherwise false\n */\nfunction isStream(val) {\n return isObject(val) && isFunction(val.pipe);\n}\n\n/**\n * Determine if a value is a URLSearchParams object\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a URLSearchParams object, otherwise false\n */\nfunction isURLSearchParams(val) {\n return toString.call(val) === '[object URLSearchParams]';\n}\n\n/**\n * Trim excess whitespace off the beginning and end of a string\n *\n * @param {String} str The String to trim\n * @returns {String} The String freed of excess whitespace\n */\nfunction trim(str) {\n return str.trim ? str.trim() : str.replace(/^\\s+|\\s+$/g, '');\n}\n\n/**\n * Determine if we're running in a standard browser environment\n *\n * This allows axios to run in a web worker, and react-native.\n * Both environments support XMLHttpRequest, but not fully standard globals.\n *\n * web workers:\n * typeof window -> undefined\n * typeof document -> undefined\n *\n * react-native:\n * navigator.product -> 'ReactNative'\n * nativescript\n * navigator.product -> 'NativeScript' or 'NS'\n */\nfunction isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}\n\n/**\n * Iterate over an Array or an Object invoking a function for each item.\n *\n * If `obj` is an Array callback will be called passing\n * the value, index, and complete array for each item.\n *\n * If 'obj' is an Object callback will be called passing\n * the value, key, and complete object for each property.\n *\n * @param {Object|Array} obj The object to iterate\n * @param {Function} fn The callback to invoke for each item\n */\nfunction forEach(obj, fn) {\n // Don't bother if no value provided\n if (obj === null || typeof obj === 'undefined') {\n return;\n }\n\n // Force an array if not already something iterable\n if (typeof obj !== 'object') {\n /*eslint no-param-reassign:0*/\n obj = [obj];\n }\n\n if (isArray(obj)) {\n // Iterate over array values\n for (var i = 0, l = obj.length; i < l; i++) {\n fn.call(null, obj[i], i, obj);\n }\n } else {\n // Iterate over object keys\n for (var key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key)) {\n fn.call(null, obj[key], key, obj);\n }\n }\n }\n}\n\n/**\n * Accepts varargs expecting each argument to be an object, then\n * immutably merges the properties of each object and returns result.\n *\n * When multiple objects contain the same key the later object in\n * the arguments list will take precedence.\n *\n * Example:\n *\n * ```js\n * var result = merge({foo: 123}, {foo: 456});\n * console.log(result.foo); // outputs 456\n * ```\n *\n * @param {Object} obj1 Object to merge\n * @returns {Object} Result of all merge properties\n */\nfunction merge(/* obj1, obj2, obj3, ... */) {\n var result = {};\n function assignValue(val, key) {\n if (isPlainObject(result[key]) && isPlainObject(val)) {\n result[key] = merge(result[key], val);\n } else if (isPlainObject(val)) {\n result[key] = merge({}, val);\n } else if (isArray(val)) {\n result[key] = val.slice();\n } else {\n result[key] = val;\n }\n }\n\n for (var i = 0, l = arguments.length; i < l; i++) {\n forEach(arguments[i], assignValue);\n }\n return result;\n}\n\n/**\n * Extends object a by mutably adding to it the properties of object b.\n *\n * @param {Object} a The object to be extended\n * @param {Object} b The object to copy properties from\n * @param {Object} thisArg The object to bind function to\n * @return {Object} The resulting value of object a\n */\nfunction extend(a, b, thisArg) {\n forEach(b, function assignValue(val, key) {\n if (thisArg && typeof val === 'function') {\n a[key] = bind(val, thisArg);\n } else {\n a[key] = val;\n }\n });\n return a;\n}\n\n/**\n * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM)\n *\n * @param {string} content with BOM\n * @return {string} content value without BOM\n */\nfunction stripBOM(content) {\n if (content.charCodeAt(0) === 0xFEFF) {\n content = content.slice(1);\n }\n return content;\n}\n\nmodule.exports = {\n isArray: isArray,\n isArrayBuffer: isArrayBuffer,\n isBuffer: isBuffer,\n isFormData: isFormData,\n isArrayBufferView: isArrayBufferView,\n isString: isString,\n isNumber: isNumber,\n isObject: isObject,\n isPlainObject: isPlainObject,\n isUndefined: isUndefined,\n isDate: isDate,\n isFile: isFile,\n isBlob: isBlob,\n isFunction: isFunction,\n isStream: isStream,\n isURLSearchParams: isURLSearchParams,\n isStandardBrowserEnv: isStandardBrowserEnv,\n forEach: forEach,\n merge: merge,\n extend: extend,\n trim: trim,\n stripBOM: stripBOM\n};\n"],"sourceRoot":""} \ No newline at end of file diff --git a/node_modules/@shineiichijo/marika/node_modules/axios/dist/axios.min.js b/node_modules/@shineiichijo/marika/node_modules/axios/dist/axios.min.js new file mode 100644 index 000000000..1ed7cf316 --- /dev/null +++ b/node_modules/@shineiichijo/marika/node_modules/axios/dist/axios.min.js @@ -0,0 +1,2 @@ +!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.axios=t():e.axios=t()}(this,(function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=12)}([function(e,t,n){"use strict";var r=n(3),o=Object.prototype.toString;function i(e){return Array.isArray(e)}function s(e){return void 0===e}function a(e){return"[object ArrayBuffer]"===o.call(e)}function u(e){return null!==e&&"object"==typeof e}function c(e){if("[object Object]"!==o.call(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}function f(e){return"[object Function]"===o.call(e)}function l(e,t){if(null!=e)if("object"!=typeof e&&(e=[e]),i(e))for(var n=0,r=e.length;n=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};r.forEach(["delete","get","head"],(function(e){f.headers[e]={}})),r.forEach(["post","put","patch"],(function(e){f.headers[e]=r.merge(a)})),e.exports=f},function(e,t,n){"use strict";e.exports=function(e,t){return function(){for(var n=new Array(arguments.length),r=0;r=0)return;s[t]="set-cookie"===t?(s[t]?s[t]:[]).concat([n]):s[t]?s[t]+", "+n:n}})),s):s}},function(e,t,n){"use strict";var r=n(0);e.exports=r.isStandardBrowserEnv()?function(){var e,t=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");function o(e){var r=e;return t&&(n.setAttribute("href",r),r=n.href),n.setAttribute("href",r),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:"/"===n.pathname.charAt(0)?n.pathname:"/"+n.pathname}}return e=o(window.location.href),function(t){var n=r.isString(t)?o(t):t;return n.protocol===e.protocol&&n.host===e.host}}():function(){return!0}},function(e,t,n){"use strict";var r=n(11).version,o={};["object","boolean","number","function","string","symbol"].forEach((function(e,t){o[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}}));var i={};o.transitional=function(e,t,n){function o(e,t){return"[Axios v"+r+"] Transitional option '"+e+"'"+t+(n?". "+n:"")}return function(n,r,s){if(!1===e)throw new Error(o(r," has been removed"+(t?" in "+t:"")));return t&&!i[r]&&(i[r]=!0,console.warn(o(r," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,r,s)}},e.exports={assertOptions:function(e,t,n){if("object"!=typeof e)throw new TypeError("options must be an object");for(var r=Object.keys(e),o=r.length;o-- >0;){var i=r[o],s=t[i];if(s){var a=e[i],u=void 0===a||s(a,i,e);if(!0!==u)throw new TypeError("option "+i+" must be "+u)}else if(!0!==n)throw Error("Unknown option "+i)}},validators:o}},function(e,t,n){"use strict";var r=n(1);function o(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise((function(e){t=e}));var n=this;this.promise.then((function(e){if(n._listeners){var t,r=n._listeners.length;for(t=0;t undefined\n * typeof document -> undefined\n *\n * react-native:\n * navigator.product -> 'ReactNative'\n * nativescript\n * navigator.product -> 'NativeScript' or 'NS'\n */\nfunction isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}\n\n/**\n * Iterate over an Array or an Object invoking a function for each item.\n *\n * If `obj` is an Array callback will be called passing\n * the value, index, and complete array for each item.\n *\n * If 'obj' is an Object callback will be called passing\n * the value, key, and complete object for each property.\n *\n * @param {Object|Array} obj The object to iterate\n * @param {Function} fn The callback to invoke for each item\n */\nfunction forEach(obj, fn) {\n // Don't bother if no value provided\n if (obj === null || typeof obj === 'undefined') {\n return;\n }\n\n // Force an array if not already something iterable\n if (typeof obj !== 'object') {\n /*eslint no-param-reassign:0*/\n obj = [obj];\n }\n\n if (isArray(obj)) {\n // Iterate over array values\n for (var i = 0, l = obj.length; i < l; i++) {\n fn.call(null, obj[i], i, obj);\n }\n } else {\n // Iterate over object keys\n for (var key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key)) {\n fn.call(null, obj[key], key, obj);\n }\n }\n }\n}\n\n/**\n * Accepts varargs expecting each argument to be an object, then\n * immutably merges the properties of each object and returns result.\n *\n * When multiple objects contain the same key the later object in\n * the arguments list will take precedence.\n *\n * Example:\n *\n * ```js\n * var result = merge({foo: 123}, {foo: 456});\n * console.log(result.foo); // outputs 456\n * ```\n *\n * @param {Object} obj1 Object to merge\n * @returns {Object} Result of all merge properties\n */\nfunction merge(/* obj1, obj2, obj3, ... */) {\n var result = {};\n function assignValue(val, key) {\n if (isPlainObject(result[key]) && isPlainObject(val)) {\n result[key] = merge(result[key], val);\n } else if (isPlainObject(val)) {\n result[key] = merge({}, val);\n } else if (isArray(val)) {\n result[key] = val.slice();\n } else {\n result[key] = val;\n }\n }\n\n for (var i = 0, l = arguments.length; i < l; i++) {\n forEach(arguments[i], assignValue);\n }\n return result;\n}\n\n/**\n * Extends object a by mutably adding to it the properties of object b.\n *\n * @param {Object} a The object to be extended\n * @param {Object} b The object to copy properties from\n * @param {Object} thisArg The object to bind function to\n * @return {Object} The resulting value of object a\n */\nfunction extend(a, b, thisArg) {\n forEach(b, function assignValue(val, key) {\n if (thisArg && typeof val === 'function') {\n a[key] = bind(val, thisArg);\n } else {\n a[key] = val;\n }\n });\n return a;\n}\n\n/**\n * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM)\n *\n * @param {string} content with BOM\n * @return {string} content value without BOM\n */\nfunction stripBOM(content) {\n if (content.charCodeAt(0) === 0xFEFF) {\n content = content.slice(1);\n }\n return content;\n}\n\nmodule.exports = {\n isArray: isArray,\n isArrayBuffer: isArrayBuffer,\n isBuffer: isBuffer,\n isFormData: isFormData,\n isArrayBufferView: isArrayBufferView,\n isString: isString,\n isNumber: isNumber,\n isObject: isObject,\n isPlainObject: isPlainObject,\n isUndefined: isUndefined,\n isDate: isDate,\n isFile: isFile,\n isBlob: isBlob,\n isFunction: isFunction,\n isStream: isStream,\n isURLSearchParams: isURLSearchParams,\n isStandardBrowserEnv: isStandardBrowserEnv,\n forEach: forEach,\n merge: merge,\n extend: extend,\n trim: trim,\n stripBOM: stripBOM\n};\n","'use strict';\n\n/**\n * A `Cancel` is an object that is thrown when an operation is canceled.\n *\n * @class\n * @param {string=} message The message.\n */\nfunction Cancel(message) {\n this.message = message;\n}\n\nCancel.prototype.toString = function toString() {\n return 'Cancel' + (this.message ? ': ' + this.message : '');\n};\n\nCancel.prototype.__CANCEL__ = true;\n\nmodule.exports = Cancel;\n","'use strict';\n\nvar utils = require('../utils');\nvar normalizeHeaderName = require('../helpers/normalizeHeaderName');\nvar enhanceError = require('../core/enhanceError');\nvar transitionalDefaults = require('./transitional');\n\nvar DEFAULT_CONTENT_TYPE = {\n 'Content-Type': 'application/x-www-form-urlencoded'\n};\n\nfunction setContentTypeIfUnset(headers, value) {\n if (!utils.isUndefined(headers) && utils.isUndefined(headers['Content-Type'])) {\n headers['Content-Type'] = value;\n }\n}\n\nfunction getDefaultAdapter() {\n var adapter;\n if (typeof XMLHttpRequest !== 'undefined') {\n // For browsers use XHR adapter\n adapter = require('../adapters/xhr');\n } else if (typeof process !== 'undefined' && Object.prototype.toString.call(process) === '[object process]') {\n // For node use HTTP adapter\n adapter = require('../adapters/http');\n }\n return adapter;\n}\n\nfunction stringifySafely(rawValue, parser, encoder) {\n if (utils.isString(rawValue)) {\n try {\n (parser || JSON.parse)(rawValue);\n return utils.trim(rawValue);\n } catch (e) {\n if (e.name !== 'SyntaxError') {\n throw e;\n }\n }\n }\n\n return (encoder || JSON.stringify)(rawValue);\n}\n\nvar defaults = {\n\n transitional: transitionalDefaults,\n\n adapter: getDefaultAdapter(),\n\n transformRequest: [function transformRequest(data, headers) {\n normalizeHeaderName(headers, 'Accept');\n normalizeHeaderName(headers, 'Content-Type');\n\n if (utils.isFormData(data) ||\n utils.isArrayBuffer(data) ||\n utils.isBuffer(data) ||\n utils.isStream(data) ||\n utils.isFile(data) ||\n utils.isBlob(data)\n ) {\n return data;\n }\n if (utils.isArrayBufferView(data)) {\n return data.buffer;\n }\n if (utils.isURLSearchParams(data)) {\n setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8');\n return data.toString();\n }\n if (utils.isObject(data) || (headers && headers['Content-Type'] === 'application/json')) {\n setContentTypeIfUnset(headers, 'application/json');\n return stringifySafely(data);\n }\n return data;\n }],\n\n transformResponse: [function transformResponse(data) {\n var transitional = this.transitional || defaults.transitional;\n var silentJSONParsing = transitional && transitional.silentJSONParsing;\n var forcedJSONParsing = transitional && transitional.forcedJSONParsing;\n var strictJSONParsing = !silentJSONParsing && this.responseType === 'json';\n\n if (strictJSONParsing || (forcedJSONParsing && utils.isString(data) && data.length)) {\n try {\n return JSON.parse(data);\n } catch (e) {\n if (strictJSONParsing) {\n if (e.name === 'SyntaxError') {\n throw enhanceError(e, this, 'E_JSON_PARSE');\n }\n throw e;\n }\n }\n }\n\n return data;\n }],\n\n /**\n * A timeout in milliseconds to abort a request. If set to 0 (default) a\n * timeout is not created.\n */\n timeout: 0,\n\n xsrfCookieName: 'XSRF-TOKEN',\n xsrfHeaderName: 'X-XSRF-TOKEN',\n\n maxContentLength: -1,\n maxBodyLength: -1,\n\n validateStatus: function validateStatus(status) {\n return status >= 200 && status < 300;\n },\n\n headers: {\n common: {\n 'Accept': 'application/json, text/plain, */*'\n }\n }\n};\n\nutils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) {\n defaults.headers[method] = {};\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE);\n});\n\nmodule.exports = defaults;\n","'use strict';\n\nmodule.exports = function bind(fn, thisArg) {\n return function wrap() {\n var args = new Array(arguments.length);\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i];\n }\n return fn.apply(thisArg, args);\n };\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\nfunction encode(val) {\n return encodeURIComponent(val).\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%20/g, '+').\n replace(/%5B/gi, '[').\n replace(/%5D/gi, ']');\n}\n\n/**\n * Build a URL by appending params to the end\n *\n * @param {string} url The base of the url (e.g., http://www.google.com)\n * @param {object} [params] The params to be appended\n * @returns {string} The formatted url\n */\nmodule.exports = function buildURL(url, params, paramsSerializer) {\n /*eslint no-param-reassign:0*/\n if (!params) {\n return url;\n }\n\n var serializedParams;\n if (paramsSerializer) {\n serializedParams = paramsSerializer(params);\n } else if (utils.isURLSearchParams(params)) {\n serializedParams = params.toString();\n } else {\n var parts = [];\n\n utils.forEach(params, function serialize(val, key) {\n if (val === null || typeof val === 'undefined') {\n return;\n }\n\n if (utils.isArray(val)) {\n key = key + '[]';\n } else {\n val = [val];\n }\n\n utils.forEach(val, function parseValue(v) {\n if (utils.isDate(v)) {\n v = v.toISOString();\n } else if (utils.isObject(v)) {\n v = JSON.stringify(v);\n }\n parts.push(encode(key) + '=' + encode(v));\n });\n });\n\n serializedParams = parts.join('&');\n }\n\n if (serializedParams) {\n var hashmarkIndex = url.indexOf('#');\n if (hashmarkIndex !== -1) {\n url = url.slice(0, hashmarkIndex);\n }\n\n url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;\n }\n\n return url;\n};\n","'use strict';\n\n/**\n * Update an Error with the specified config, error code, and response.\n *\n * @param {Error} error The error to update.\n * @param {Object} config The config.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n * @returns {Error} The error.\n */\nmodule.exports = function enhanceError(error, config, code, request, response) {\n error.config = config;\n if (code) {\n error.code = code;\n }\n\n error.request = request;\n error.response = response;\n error.isAxiosError = true;\n\n error.toJSON = function toJSON() {\n return {\n // Standard\n message: this.message,\n name: this.name,\n // Microsoft\n description: this.description,\n number: this.number,\n // Mozilla\n fileName: this.fileName,\n lineNumber: this.lineNumber,\n columnNumber: this.columnNumber,\n stack: this.stack,\n // Axios\n config: this.config,\n code: this.code,\n status: this.response && this.response.status ? this.response.status : null\n };\n };\n return error;\n};\n","'use strict';\n\nmodule.exports = {\n silentJSONParsing: true,\n forcedJSONParsing: true,\n clarifyTimeoutError: false\n};\n","'use strict';\n\nvar utils = require('./../utils');\nvar settle = require('./../core/settle');\nvar cookies = require('./../helpers/cookies');\nvar buildURL = require('./../helpers/buildURL');\nvar buildFullPath = require('../core/buildFullPath');\nvar parseHeaders = require('./../helpers/parseHeaders');\nvar isURLSameOrigin = require('./../helpers/isURLSameOrigin');\nvar createError = require('../core/createError');\nvar transitionalDefaults = require('../defaults/transitional');\nvar Cancel = require('../cancel/Cancel');\n\nmodule.exports = function xhrAdapter(config) {\n return new Promise(function dispatchXhrRequest(resolve, reject) {\n var requestData = config.data;\n var requestHeaders = config.headers;\n var responseType = config.responseType;\n var onCanceled;\n function done() {\n if (config.cancelToken) {\n config.cancelToken.unsubscribe(onCanceled);\n }\n\n if (config.signal) {\n config.signal.removeEventListener('abort', onCanceled);\n }\n }\n\n if (utils.isFormData(requestData)) {\n delete requestHeaders['Content-Type']; // Let the browser set it\n }\n\n var request = new XMLHttpRequest();\n\n // HTTP basic authentication\n if (config.auth) {\n var username = config.auth.username || '';\n var password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : '';\n requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password);\n }\n\n var fullPath = buildFullPath(config.baseURL, config.url);\n request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true);\n\n // Set the request timeout in MS\n request.timeout = config.timeout;\n\n function onloadend() {\n if (!request) {\n return;\n }\n // Prepare the response\n var responseHeaders = 'getAllResponseHeaders' in request ? parseHeaders(request.getAllResponseHeaders()) : null;\n var responseData = !responseType || responseType === 'text' || responseType === 'json' ?\n request.responseText : request.response;\n var response = {\n data: responseData,\n status: request.status,\n statusText: request.statusText,\n headers: responseHeaders,\n config: config,\n request: request\n };\n\n settle(function _resolve(value) {\n resolve(value);\n done();\n }, function _reject(err) {\n reject(err);\n done();\n }, response);\n\n // Clean up request\n request = null;\n }\n\n if ('onloadend' in request) {\n // Use onloadend if available\n request.onloadend = onloadend;\n } else {\n // Listen for ready state to emulate onloadend\n request.onreadystatechange = function handleLoad() {\n if (!request || request.readyState !== 4) {\n return;\n }\n\n // The request errored out and we didn't get a response, this will be\n // handled by onerror instead\n // With one exception: request that using file: protocol, most browsers\n // will return status as 0 even though it's a successful request\n if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {\n return;\n }\n // readystate handler is calling before onerror or ontimeout handlers,\n // so we should call onloadend on the next 'tick'\n setTimeout(onloadend);\n };\n }\n\n // Handle browser request cancellation (as opposed to a manual cancellation)\n request.onabort = function handleAbort() {\n if (!request) {\n return;\n }\n\n reject(createError('Request aborted', config, 'ECONNABORTED', request));\n\n // Clean up request\n request = null;\n };\n\n // Handle low level network errors\n request.onerror = function handleError() {\n // Real errors are hidden from us by the browser\n // onerror should only fire if it's a network error\n reject(createError('Network Error', config, null, request));\n\n // Clean up request\n request = null;\n };\n\n // Handle timeout\n request.ontimeout = function handleTimeout() {\n var timeoutErrorMessage = config.timeout ? 'timeout of ' + config.timeout + 'ms exceeded' : 'timeout exceeded';\n var transitional = config.transitional || transitionalDefaults;\n if (config.timeoutErrorMessage) {\n timeoutErrorMessage = config.timeoutErrorMessage;\n }\n reject(createError(\n timeoutErrorMessage,\n config,\n transitional.clarifyTimeoutError ? 'ETIMEDOUT' : 'ECONNABORTED',\n request));\n\n // Clean up request\n request = null;\n };\n\n // Add xsrf header\n // This is only done if running in a standard browser environment.\n // Specifically not if we're in a web worker, or react-native.\n if (utils.isStandardBrowserEnv()) {\n // Add xsrf header\n var xsrfValue = (config.withCredentials || isURLSameOrigin(fullPath)) && config.xsrfCookieName ?\n cookies.read(config.xsrfCookieName) :\n undefined;\n\n if (xsrfValue) {\n requestHeaders[config.xsrfHeaderName] = xsrfValue;\n }\n }\n\n // Add headers to the request\n if ('setRequestHeader' in request) {\n utils.forEach(requestHeaders, function setRequestHeader(val, key) {\n if (typeof requestData === 'undefined' && key.toLowerCase() === 'content-type') {\n // Remove Content-Type if data is undefined\n delete requestHeaders[key];\n } else {\n // Otherwise add header to the request\n request.setRequestHeader(key, val);\n }\n });\n }\n\n // Add withCredentials to request if needed\n if (!utils.isUndefined(config.withCredentials)) {\n request.withCredentials = !!config.withCredentials;\n }\n\n // Add responseType to request if needed\n if (responseType && responseType !== 'json') {\n request.responseType = config.responseType;\n }\n\n // Handle progress if needed\n if (typeof config.onDownloadProgress === 'function') {\n request.addEventListener('progress', config.onDownloadProgress);\n }\n\n // Not all browsers support upload events\n if (typeof config.onUploadProgress === 'function' && request.upload) {\n request.upload.addEventListener('progress', config.onUploadProgress);\n }\n\n if (config.cancelToken || config.signal) {\n // Handle cancellation\n // eslint-disable-next-line func-names\n onCanceled = function(cancel) {\n if (!request) {\n return;\n }\n reject(!cancel || (cancel && cancel.type) ? new Cancel('canceled') : cancel);\n request.abort();\n request = null;\n };\n\n config.cancelToken && config.cancelToken.subscribe(onCanceled);\n if (config.signal) {\n config.signal.aborted ? onCanceled() : config.signal.addEventListener('abort', onCanceled);\n }\n }\n\n if (!requestData) {\n requestData = null;\n }\n\n // Send the request\n request.send(requestData);\n });\n};\n","'use strict';\n\nvar enhanceError = require('./enhanceError');\n\n/**\n * Create an Error with the specified message, config, error code, request and response.\n *\n * @param {string} message The error message.\n * @param {Object} config The config.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n * @returns {Error} The created error.\n */\nmodule.exports = function createError(message, config, code, request, response) {\n var error = new Error(message);\n return enhanceError(error, config, code, request, response);\n};\n","'use strict';\n\nmodule.exports = function isCancel(value) {\n return !!(value && value.__CANCEL__);\n};\n","'use strict';\n\nvar utils = require('../utils');\n\n/**\n * Config-specific merge-function which creates a new config-object\n * by merging two configuration objects together.\n *\n * @param {Object} config1\n * @param {Object} config2\n * @returns {Object} New object resulting from merging config2 to config1\n */\nmodule.exports = function mergeConfig(config1, config2) {\n // eslint-disable-next-line no-param-reassign\n config2 = config2 || {};\n var config = {};\n\n function getMergedValue(target, source) {\n if (utils.isPlainObject(target) && utils.isPlainObject(source)) {\n return utils.merge(target, source);\n } else if (utils.isPlainObject(source)) {\n return utils.merge({}, source);\n } else if (utils.isArray(source)) {\n return source.slice();\n }\n return source;\n }\n\n // eslint-disable-next-line consistent-return\n function mergeDeepProperties(prop) {\n if (!utils.isUndefined(config2[prop])) {\n return getMergedValue(config1[prop], config2[prop]);\n } else if (!utils.isUndefined(config1[prop])) {\n return getMergedValue(undefined, config1[prop]);\n }\n }\n\n // eslint-disable-next-line consistent-return\n function valueFromConfig2(prop) {\n if (!utils.isUndefined(config2[prop])) {\n return getMergedValue(undefined, config2[prop]);\n }\n }\n\n // eslint-disable-next-line consistent-return\n function defaultToConfig2(prop) {\n if (!utils.isUndefined(config2[prop])) {\n return getMergedValue(undefined, config2[prop]);\n } else if (!utils.isUndefined(config1[prop])) {\n return getMergedValue(undefined, config1[prop]);\n }\n }\n\n // eslint-disable-next-line consistent-return\n function mergeDirectKeys(prop) {\n if (prop in config2) {\n return getMergedValue(config1[prop], config2[prop]);\n } else if (prop in config1) {\n return getMergedValue(undefined, config1[prop]);\n }\n }\n\n var mergeMap = {\n 'url': valueFromConfig2,\n 'method': valueFromConfig2,\n 'data': valueFromConfig2,\n 'baseURL': defaultToConfig2,\n 'transformRequest': defaultToConfig2,\n 'transformResponse': defaultToConfig2,\n 'paramsSerializer': defaultToConfig2,\n 'timeout': defaultToConfig2,\n 'timeoutMessage': defaultToConfig2,\n 'withCredentials': defaultToConfig2,\n 'adapter': defaultToConfig2,\n 'responseType': defaultToConfig2,\n 'xsrfCookieName': defaultToConfig2,\n 'xsrfHeaderName': defaultToConfig2,\n 'onUploadProgress': defaultToConfig2,\n 'onDownloadProgress': defaultToConfig2,\n 'decompress': defaultToConfig2,\n 'maxContentLength': defaultToConfig2,\n 'maxBodyLength': defaultToConfig2,\n 'transport': defaultToConfig2,\n 'httpAgent': defaultToConfig2,\n 'httpsAgent': defaultToConfig2,\n 'cancelToken': defaultToConfig2,\n 'socketPath': defaultToConfig2,\n 'responseEncoding': defaultToConfig2,\n 'validateStatus': mergeDirectKeys\n };\n\n utils.forEach(Object.keys(config1).concat(Object.keys(config2)), function computeConfigValue(prop) {\n var merge = mergeMap[prop] || mergeDeepProperties;\n var configValue = merge(prop);\n (utils.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);\n });\n\n return config;\n};\n","module.exports = {\n \"version\": \"0.26.1\"\n};","module.exports = require('./lib/axios');","'use strict';\n\nvar utils = require('./utils');\nvar bind = require('./helpers/bind');\nvar Axios = require('./core/Axios');\nvar mergeConfig = require('./core/mergeConfig');\nvar defaults = require('./defaults');\n\n/**\n * Create an instance of Axios\n *\n * @param {Object} defaultConfig The default config for the instance\n * @return {Axios} A new instance of Axios\n */\nfunction createInstance(defaultConfig) {\n var context = new Axios(defaultConfig);\n var instance = bind(Axios.prototype.request, context);\n\n // Copy axios.prototype to instance\n utils.extend(instance, Axios.prototype, context);\n\n // Copy context to instance\n utils.extend(instance, context);\n\n // Factory for creating new instances\n instance.create = function create(instanceConfig) {\n return createInstance(mergeConfig(defaultConfig, instanceConfig));\n };\n\n return instance;\n}\n\n// Create the default instance to be exported\nvar axios = createInstance(defaults);\n\n// Expose Axios class to allow class inheritance\naxios.Axios = Axios;\n\n// Expose Cancel & CancelToken\naxios.Cancel = require('./cancel/Cancel');\naxios.CancelToken = require('./cancel/CancelToken');\naxios.isCancel = require('./cancel/isCancel');\naxios.VERSION = require('./env/data').version;\n\n// Expose all/spread\naxios.all = function all(promises) {\n return Promise.all(promises);\n};\naxios.spread = require('./helpers/spread');\n\n// Expose isAxiosError\naxios.isAxiosError = require('./helpers/isAxiosError');\n\nmodule.exports = axios;\n\n// Allow use of default import syntax in TypeScript\nmodule.exports.default = axios;\n","'use strict';\n\nvar utils = require('./../utils');\nvar buildURL = require('../helpers/buildURL');\nvar InterceptorManager = require('./InterceptorManager');\nvar dispatchRequest = require('./dispatchRequest');\nvar mergeConfig = require('./mergeConfig');\nvar validator = require('../helpers/validator');\n\nvar validators = validator.validators;\n/**\n * Create a new instance of Axios\n *\n * @param {Object} instanceConfig The default config for the instance\n */\nfunction Axios(instanceConfig) {\n this.defaults = instanceConfig;\n this.interceptors = {\n request: new InterceptorManager(),\n response: new InterceptorManager()\n };\n}\n\n/**\n * Dispatch a request\n *\n * @param {Object} config The config specific for this request (merged with this.defaults)\n */\nAxios.prototype.request = function request(configOrUrl, config) {\n /*eslint no-param-reassign:0*/\n // Allow for axios('example/url'[, config]) a la fetch API\n if (typeof configOrUrl === 'string') {\n config = config || {};\n config.url = configOrUrl;\n } else {\n config = configOrUrl || {};\n }\n\n config = mergeConfig(this.defaults, config);\n\n // Set config.method\n if (config.method) {\n config.method = config.method.toLowerCase();\n } else if (this.defaults.method) {\n config.method = this.defaults.method.toLowerCase();\n } else {\n config.method = 'get';\n }\n\n var transitional = config.transitional;\n\n if (transitional !== undefined) {\n validator.assertOptions(transitional, {\n silentJSONParsing: validators.transitional(validators.boolean),\n forcedJSONParsing: validators.transitional(validators.boolean),\n clarifyTimeoutError: validators.transitional(validators.boolean)\n }, false);\n }\n\n // filter out skipped interceptors\n var requestInterceptorChain = [];\n var synchronousRequestInterceptors = true;\n this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {\n if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) {\n return;\n }\n\n synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;\n\n requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);\n });\n\n var responseInterceptorChain = [];\n this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {\n responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);\n });\n\n var promise;\n\n if (!synchronousRequestInterceptors) {\n var chain = [dispatchRequest, undefined];\n\n Array.prototype.unshift.apply(chain, requestInterceptorChain);\n chain = chain.concat(responseInterceptorChain);\n\n promise = Promise.resolve(config);\n while (chain.length) {\n promise = promise.then(chain.shift(), chain.shift());\n }\n\n return promise;\n }\n\n\n var newConfig = config;\n while (requestInterceptorChain.length) {\n var onFulfilled = requestInterceptorChain.shift();\n var onRejected = requestInterceptorChain.shift();\n try {\n newConfig = onFulfilled(newConfig);\n } catch (error) {\n onRejected(error);\n break;\n }\n }\n\n try {\n promise = dispatchRequest(newConfig);\n } catch (error) {\n return Promise.reject(error);\n }\n\n while (responseInterceptorChain.length) {\n promise = promise.then(responseInterceptorChain.shift(), responseInterceptorChain.shift());\n }\n\n return promise;\n};\n\nAxios.prototype.getUri = function getUri(config) {\n config = mergeConfig(this.defaults, config);\n return buildURL(config.url, config.params, config.paramsSerializer).replace(/^\\?/, '');\n};\n\n// Provide aliases for supported request methods\nutils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, config) {\n return this.request(mergeConfig(config || {}, {\n method: method,\n url: url,\n data: (config || {}).data\n }));\n };\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, data, config) {\n return this.request(mergeConfig(config || {}, {\n method: method,\n url: url,\n data: data\n }));\n };\n});\n\nmodule.exports = Axios;\n","'use strict';\n\nvar utils = require('./../utils');\n\nfunction InterceptorManager() {\n this.handlers = [];\n}\n\n/**\n * Add a new interceptor to the stack\n *\n * @param {Function} fulfilled The function to handle `then` for a `Promise`\n * @param {Function} rejected The function to handle `reject` for a `Promise`\n *\n * @return {Number} An ID used to remove interceptor later\n */\nInterceptorManager.prototype.use = function use(fulfilled, rejected, options) {\n this.handlers.push({\n fulfilled: fulfilled,\n rejected: rejected,\n synchronous: options ? options.synchronous : false,\n runWhen: options ? options.runWhen : null\n });\n return this.handlers.length - 1;\n};\n\n/**\n * Remove an interceptor from the stack\n *\n * @param {Number} id The ID that was returned by `use`\n */\nInterceptorManager.prototype.eject = function eject(id) {\n if (this.handlers[id]) {\n this.handlers[id] = null;\n }\n};\n\n/**\n * Iterate over all the registered interceptors\n *\n * This method is particularly useful for skipping over any\n * interceptors that may have become `null` calling `eject`.\n *\n * @param {Function} fn The function to call for each interceptor\n */\nInterceptorManager.prototype.forEach = function forEach(fn) {\n utils.forEach(this.handlers, function forEachHandler(h) {\n if (h !== null) {\n fn(h);\n }\n });\n};\n\nmodule.exports = InterceptorManager;\n","'use strict';\n\nvar utils = require('./../utils');\nvar transformData = require('./transformData');\nvar isCancel = require('../cancel/isCancel');\nvar defaults = require('../defaults');\nvar Cancel = require('../cancel/Cancel');\n\n/**\n * Throws a `Cancel` if cancellation has been requested.\n */\nfunction throwIfCancellationRequested(config) {\n if (config.cancelToken) {\n config.cancelToken.throwIfRequested();\n }\n\n if (config.signal && config.signal.aborted) {\n throw new Cancel('canceled');\n }\n}\n\n/**\n * Dispatch a request to the server using the configured adapter.\n *\n * @param {object} config The config that is to be used for the request\n * @returns {Promise} The Promise to be fulfilled\n */\nmodule.exports = function dispatchRequest(config) {\n throwIfCancellationRequested(config);\n\n // Ensure headers exist\n config.headers = config.headers || {};\n\n // Transform request data\n config.data = transformData.call(\n config,\n config.data,\n config.headers,\n config.transformRequest\n );\n\n // Flatten headers\n config.headers = utils.merge(\n config.headers.common || {},\n config.headers[config.method] || {},\n config.headers\n );\n\n utils.forEach(\n ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],\n function cleanHeaderConfig(method) {\n delete config.headers[method];\n }\n );\n\n var adapter = config.adapter || defaults.adapter;\n\n return adapter(config).then(function onAdapterResolution(response) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n response.data = transformData.call(\n config,\n response.data,\n response.headers,\n config.transformResponse\n );\n\n return response;\n }, function onAdapterRejection(reason) {\n if (!isCancel(reason)) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n if (reason && reason.response) {\n reason.response.data = transformData.call(\n config,\n reason.response.data,\n reason.response.headers,\n config.transformResponse\n );\n }\n }\n\n return Promise.reject(reason);\n });\n};\n","'use strict';\n\nvar utils = require('./../utils');\nvar defaults = require('../defaults');\n\n/**\n * Transform the data for a request or a response\n *\n * @param {Object|String} data The data to be transformed\n * @param {Array} headers The headers for the request or response\n * @param {Array|Function} fns A single function or Array of functions\n * @returns {*} The resulting transformed data\n */\nmodule.exports = function transformData(data, headers, fns) {\n var context = this || defaults;\n /*eslint no-param-reassign:0*/\n utils.forEach(fns, function transform(fn) {\n data = fn.call(context, data, headers);\n });\n\n return data;\n};\n","'use strict';\n\nvar utils = require('../utils');\n\nmodule.exports = function normalizeHeaderName(headers, normalizedName) {\n utils.forEach(headers, function processHeader(value, name) {\n if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) {\n headers[normalizedName] = value;\n delete headers[name];\n }\n });\n};\n","'use strict';\n\nvar createError = require('./createError');\n\n/**\n * Resolve or reject a Promise based on response status.\n *\n * @param {Function} resolve A function that resolves the promise.\n * @param {Function} reject A function that rejects the promise.\n * @param {object} response The response.\n */\nmodule.exports = function settle(resolve, reject, response) {\n var validateStatus = response.config.validateStatus;\n if (!response.status || !validateStatus || validateStatus(response.status)) {\n resolve(response);\n } else {\n reject(createError(\n 'Request failed with status code ' + response.status,\n response.config,\n null,\n response.request,\n response\n ));\n }\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\nmodule.exports = (\n utils.isStandardBrowserEnv() ?\n\n // Standard browser envs support document.cookie\n (function standardBrowserEnv() {\n return {\n write: function write(name, value, expires, path, domain, secure) {\n var cookie = [];\n cookie.push(name + '=' + encodeURIComponent(value));\n\n if (utils.isNumber(expires)) {\n cookie.push('expires=' + new Date(expires).toGMTString());\n }\n\n if (utils.isString(path)) {\n cookie.push('path=' + path);\n }\n\n if (utils.isString(domain)) {\n cookie.push('domain=' + domain);\n }\n\n if (secure === true) {\n cookie.push('secure');\n }\n\n document.cookie = cookie.join('; ');\n },\n\n read: function read(name) {\n var match = document.cookie.match(new RegExp('(^|;\\\\s*)(' + name + ')=([^;]*)'));\n return (match ? decodeURIComponent(match[3]) : null);\n },\n\n remove: function remove(name) {\n this.write(name, '', Date.now() - 86400000);\n }\n };\n })() :\n\n // Non standard browser env (web workers, react-native) lack needed support.\n (function nonStandardBrowserEnv() {\n return {\n write: function write() {},\n read: function read() { return null; },\n remove: function remove() {}\n };\n })()\n);\n","'use strict';\n\nvar isAbsoluteURL = require('../helpers/isAbsoluteURL');\nvar combineURLs = require('../helpers/combineURLs');\n\n/**\n * Creates a new URL by combining the baseURL with the requestedURL,\n * only when the requestedURL is not already an absolute URL.\n * If the requestURL is absolute, this function returns the requestedURL untouched.\n *\n * @param {string} baseURL The base URL\n * @param {string} requestedURL Absolute or relative URL to combine\n * @returns {string} The combined full path\n */\nmodule.exports = function buildFullPath(baseURL, requestedURL) {\n if (baseURL && !isAbsoluteURL(requestedURL)) {\n return combineURLs(baseURL, requestedURL);\n }\n return requestedURL;\n};\n","'use strict';\n\n/**\n * Determines whether the specified URL is absolute\n *\n * @param {string} url The URL to test\n * @returns {boolean} True if the specified URL is absolute, otherwise false\n */\nmodule.exports = function isAbsoluteURL(url) {\n // A URL is considered absolute if it begins with \"://\" or \"//\" (protocol-relative URL).\n // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed\n // by any combination of letters, digits, plus, period, or hyphen.\n return /^([a-z][a-z\\d+\\-.]*:)?\\/\\//i.test(url);\n};\n","'use strict';\n\n/**\n * Creates a new URL by combining the specified URLs\n *\n * @param {string} baseURL The base URL\n * @param {string} relativeURL The relative URL\n * @returns {string} The combined URL\n */\nmodule.exports = function combineURLs(baseURL, relativeURL) {\n return relativeURL\n ? baseURL.replace(/\\/+$/, '') + '/' + relativeURL.replace(/^\\/+/, '')\n : baseURL;\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\n// Headers whose duplicates are ignored by node\n// c.f. https://nodejs.org/api/http.html#http_message_headers\nvar ignoreDuplicateOf = [\n 'age', 'authorization', 'content-length', 'content-type', 'etag',\n 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',\n 'last-modified', 'location', 'max-forwards', 'proxy-authorization',\n 'referer', 'retry-after', 'user-agent'\n];\n\n/**\n * Parse headers into an object\n *\n * ```\n * Date: Wed, 27 Aug 2014 08:58:49 GMT\n * Content-Type: application/json\n * Connection: keep-alive\n * Transfer-Encoding: chunked\n * ```\n *\n * @param {String} headers Headers needing to be parsed\n * @returns {Object} Headers parsed into an object\n */\nmodule.exports = function parseHeaders(headers) {\n var parsed = {};\n var key;\n var val;\n var i;\n\n if (!headers) { return parsed; }\n\n utils.forEach(headers.split('\\n'), function parser(line) {\n i = line.indexOf(':');\n key = utils.trim(line.substr(0, i)).toLowerCase();\n val = utils.trim(line.substr(i + 1));\n\n if (key) {\n if (parsed[key] && ignoreDuplicateOf.indexOf(key) >= 0) {\n return;\n }\n if (key === 'set-cookie') {\n parsed[key] = (parsed[key] ? parsed[key] : []).concat([val]);\n } else {\n parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;\n }\n }\n });\n\n return parsed;\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\nmodule.exports = (\n utils.isStandardBrowserEnv() ?\n\n // Standard browser envs have full support of the APIs needed to test\n // whether the request URL is of the same origin as current location.\n (function standardBrowserEnv() {\n var msie = /(msie|trident)/i.test(navigator.userAgent);\n var urlParsingNode = document.createElement('a');\n var originURL;\n\n /**\n * Parse a URL to discover it's components\n *\n * @param {String} url The URL to be parsed\n * @returns {Object}\n */\n function resolveURL(url) {\n var href = url;\n\n if (msie) {\n // IE needs attribute set twice to normalize properties\n urlParsingNode.setAttribute('href', href);\n href = urlParsingNode.href;\n }\n\n urlParsingNode.setAttribute('href', href);\n\n // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils\n return {\n href: urlParsingNode.href,\n protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',\n host: urlParsingNode.host,\n search: urlParsingNode.search ? urlParsingNode.search.replace(/^\\?/, '') : '',\n hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',\n hostname: urlParsingNode.hostname,\n port: urlParsingNode.port,\n pathname: (urlParsingNode.pathname.charAt(0) === '/') ?\n urlParsingNode.pathname :\n '/' + urlParsingNode.pathname\n };\n }\n\n originURL = resolveURL(window.location.href);\n\n /**\n * Determine if a URL shares the same origin as the current location\n *\n * @param {String} requestURL The URL to test\n * @returns {boolean} True if URL shares the same origin, otherwise false\n */\n return function isURLSameOrigin(requestURL) {\n var parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL;\n return (parsed.protocol === originURL.protocol &&\n parsed.host === originURL.host);\n };\n })() :\n\n // Non standard browser envs (web workers, react-native) lack needed support.\n (function nonStandardBrowserEnv() {\n return function isURLSameOrigin() {\n return true;\n };\n })()\n);\n","'use strict';\n\nvar VERSION = require('../env/data').version;\n\nvar validators = {};\n\n// eslint-disable-next-line func-names\n['object', 'boolean', 'number', 'function', 'string', 'symbol'].forEach(function(type, i) {\n validators[type] = function validator(thing) {\n return typeof thing === type || 'a' + (i < 1 ? 'n ' : ' ') + type;\n };\n});\n\nvar deprecatedWarnings = {};\n\n/**\n * Transitional option validator\n * @param {function|boolean?} validator - set to false if the transitional option has been removed\n * @param {string?} version - deprecated version / removed since version\n * @param {string?} message - some message with additional info\n * @returns {function}\n */\nvalidators.transitional = function transitional(validator, version, message) {\n function formatMessage(opt, desc) {\n return '[Axios v' + VERSION + '] Transitional option \\'' + opt + '\\'' + desc + (message ? '. ' + message : '');\n }\n\n // eslint-disable-next-line func-names\n return function(value, opt, opts) {\n if (validator === false) {\n throw new Error(formatMessage(opt, ' has been removed' + (version ? ' in ' + version : '')));\n }\n\n if (version && !deprecatedWarnings[opt]) {\n deprecatedWarnings[opt] = true;\n // eslint-disable-next-line no-console\n console.warn(\n formatMessage(\n opt,\n ' has been deprecated since v' + version + ' and will be removed in the near future'\n )\n );\n }\n\n return validator ? validator(value, opt, opts) : true;\n };\n};\n\n/**\n * Assert object's properties type\n * @param {object} options\n * @param {object} schema\n * @param {boolean?} allowUnknown\n */\n\nfunction assertOptions(options, schema, allowUnknown) {\n if (typeof options !== 'object') {\n throw new TypeError('options must be an object');\n }\n var keys = Object.keys(options);\n var i = keys.length;\n while (i-- > 0) {\n var opt = keys[i];\n var validator = schema[opt];\n if (validator) {\n var value = options[opt];\n var result = value === undefined || validator(value, opt, options);\n if (result !== true) {\n throw new TypeError('option ' + opt + ' must be ' + result);\n }\n continue;\n }\n if (allowUnknown !== true) {\n throw Error('Unknown option ' + opt);\n }\n }\n}\n\nmodule.exports = {\n assertOptions: assertOptions,\n validators: validators\n};\n","'use strict';\n\nvar Cancel = require('./Cancel');\n\n/**\n * A `CancelToken` is an object that can be used to request cancellation of an operation.\n *\n * @class\n * @param {Function} executor The executor function.\n */\nfunction CancelToken(executor) {\n if (typeof executor !== 'function') {\n throw new TypeError('executor must be a function.');\n }\n\n var resolvePromise;\n\n this.promise = new Promise(function promiseExecutor(resolve) {\n resolvePromise = resolve;\n });\n\n var token = this;\n\n // eslint-disable-next-line func-names\n this.promise.then(function(cancel) {\n if (!token._listeners) return;\n\n var i;\n var l = token._listeners.length;\n\n for (i = 0; i < l; i++) {\n token._listeners[i](cancel);\n }\n token._listeners = null;\n });\n\n // eslint-disable-next-line func-names\n this.promise.then = function(onfulfilled) {\n var _resolve;\n // eslint-disable-next-line func-names\n var promise = new Promise(function(resolve) {\n token.subscribe(resolve);\n _resolve = resolve;\n }).then(onfulfilled);\n\n promise.cancel = function reject() {\n token.unsubscribe(_resolve);\n };\n\n return promise;\n };\n\n executor(function cancel(message) {\n if (token.reason) {\n // Cancellation has already been requested\n return;\n }\n\n token.reason = new Cancel(message);\n resolvePromise(token.reason);\n });\n}\n\n/**\n * Throws a `Cancel` if cancellation has been requested.\n */\nCancelToken.prototype.throwIfRequested = function throwIfRequested() {\n if (this.reason) {\n throw this.reason;\n }\n};\n\n/**\n * Subscribe to the cancel signal\n */\n\nCancelToken.prototype.subscribe = function subscribe(listener) {\n if (this.reason) {\n listener(this.reason);\n return;\n }\n\n if (this._listeners) {\n this._listeners.push(listener);\n } else {\n this._listeners = [listener];\n }\n};\n\n/**\n * Unsubscribe from the cancel signal\n */\n\nCancelToken.prototype.unsubscribe = function unsubscribe(listener) {\n if (!this._listeners) {\n return;\n }\n var index = this._listeners.indexOf(listener);\n if (index !== -1) {\n this._listeners.splice(index, 1);\n }\n};\n\n/**\n * Returns an object that contains a new `CancelToken` and a function that, when called,\n * cancels the `CancelToken`.\n */\nCancelToken.source = function source() {\n var cancel;\n var token = new CancelToken(function executor(c) {\n cancel = c;\n });\n return {\n token: token,\n cancel: cancel\n };\n};\n\nmodule.exports = CancelToken;\n","'use strict';\n\n/**\n * Syntactic sugar for invoking a function and expanding an array for arguments.\n *\n * Common use case would be to use `Function.prototype.apply`.\n *\n * ```js\n * function f(x, y, z) {}\n * var args = [1, 2, 3];\n * f.apply(null, args);\n * ```\n *\n * With `spread` this example can be re-written.\n *\n * ```js\n * spread(function(x, y, z) {})([1, 2, 3]);\n * ```\n *\n * @param {Function} callback\n * @returns {Function}\n */\nmodule.exports = function spread(callback) {\n return function wrap(arr) {\n return callback.apply(null, arr);\n };\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\n/**\n * Determines whether the payload is an error thrown by Axios\n *\n * @param {*} payload The value to test\n * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false\n */\nmodule.exports = function isAxiosError(payload) {\n return utils.isObject(payload) && (payload.isAxiosError === true);\n};\n"],"sourceRoot":""} \ No newline at end of file diff --git a/node_modules/@shineiichijo/marika/node_modules/axios/index.d.ts b/node_modules/@shineiichijo/marika/node_modules/axios/index.d.ts new file mode 100644 index 000000000..b681915e1 --- /dev/null +++ b/node_modules/@shineiichijo/marika/node_modules/axios/index.d.ts @@ -0,0 +1,221 @@ +// TypeScript Version: 3.0 + +export type AxiosRequestHeaders = Record; + +export type AxiosResponseHeaders = Record & { + "set-cookie"?: string[] +}; + +export interface AxiosRequestTransformer { + (data: any, headers?: AxiosRequestHeaders): any; +} + +export interface AxiosResponseTransformer { + (data: any, headers?: AxiosResponseHeaders): any; +} + +export interface AxiosAdapter { + (config: AxiosRequestConfig): AxiosPromise; +} + +export interface AxiosBasicCredentials { + username: string; + password: string; +} + +export interface AxiosProxyConfig { + host: string; + port: number; + auth?: { + username: string; + password: string; + }; + protocol?: string; +} + +export type Method = + | 'get' | 'GET' + | 'delete' | 'DELETE' + | 'head' | 'HEAD' + | 'options' | 'OPTIONS' + | 'post' | 'POST' + | 'put' | 'PUT' + | 'patch' | 'PATCH' + | 'purge' | 'PURGE' + | 'link' | 'LINK' + | 'unlink' | 'UNLINK'; + +export type ResponseType = + | 'arraybuffer' + | 'blob' + | 'document' + | 'json' + | 'text' + | 'stream'; + + export type responseEncoding = + | 'ascii' | 'ASCII' + | 'ansi' | 'ANSI' + | 'binary' | 'BINARY' + | 'base64' | 'BASE64' + | 'base64url' | 'BASE64URL' + | 'hex' | 'HEX' + | 'latin1' | 'LATIN1' + | 'ucs-2' | 'UCS-2' + | 'ucs2' | 'UCS2' + | 'utf-8' | 'UTF-8' + | 'utf8' | 'UTF8' + | 'utf16le' | 'UTF16LE'; + +export interface TransitionalOptions { + silentJSONParsing?: boolean; + forcedJSONParsing?: boolean; + clarifyTimeoutError?: boolean; +} + +export interface AxiosRequestConfig { + url?: string; + method?: Method; + baseURL?: string; + transformRequest?: AxiosRequestTransformer | AxiosRequestTransformer[]; + transformResponse?: AxiosResponseTransformer | AxiosResponseTransformer[]; + headers?: AxiosRequestHeaders; + params?: any; + paramsSerializer?: (params: any) => string; + data?: D; + timeout?: number; + timeoutErrorMessage?: string; + withCredentials?: boolean; + adapter?: AxiosAdapter; + auth?: AxiosBasicCredentials; + responseType?: ResponseType; + responseEncoding?: responseEncoding | string; + xsrfCookieName?: string; + xsrfHeaderName?: string; + onUploadProgress?: (progressEvent: any) => void; + onDownloadProgress?: (progressEvent: any) => void; + maxContentLength?: number; + validateStatus?: ((status: number) => boolean) | null; + maxBodyLength?: number; + maxRedirects?: number; + socketPath?: string | null; + httpAgent?: any; + httpsAgent?: any; + proxy?: AxiosProxyConfig | false; + cancelToken?: CancelToken; + decompress?: boolean; + transitional?: TransitionalOptions; + signal?: AbortSignal; + insecureHTTPParser?: boolean; +} + +export interface HeadersDefaults { + common: AxiosRequestHeaders; + delete: AxiosRequestHeaders; + get: AxiosRequestHeaders; + head: AxiosRequestHeaders; + post: AxiosRequestHeaders; + put: AxiosRequestHeaders; + patch: AxiosRequestHeaders; + options?: AxiosRequestHeaders; + purge?: AxiosRequestHeaders; + link?: AxiosRequestHeaders; + unlink?: AxiosRequestHeaders; +} + +export interface AxiosDefaults extends Omit, 'headers'> { + headers: HeadersDefaults; +} + +export interface AxiosResponse { + data: T; + status: number; + statusText: string; + headers: AxiosResponseHeaders; + config: AxiosRequestConfig; + request?: any; +} + +export interface AxiosError extends Error { + config: AxiosRequestConfig; + code?: string; + request?: any; + response?: AxiosResponse; + isAxiosError: boolean; + toJSON: () => object; +} + +export interface AxiosPromise extends Promise> { +} + +export interface CancelStatic { + new (message?: string): Cancel; +} + +export interface Cancel { + message: string | undefined; +} + +export interface Canceler { + (message?: string): void; +} + +export interface CancelTokenStatic { + new (executor: (cancel: Canceler) => void): CancelToken; + source(): CancelTokenSource; +} + +export interface CancelToken { + promise: Promise; + reason?: Cancel; + throwIfRequested(): void; +} + +export interface CancelTokenSource { + token: CancelToken; + cancel: Canceler; +} + +export interface AxiosInterceptorManager { + use(onFulfilled?: (value: V) => T | Promise, onRejected?: (error: any) => any): number; + eject(id: number): void; +} + +export class Axios { + constructor(config?: AxiosRequestConfig); + defaults: AxiosDefaults; + interceptors: { + request: AxiosInterceptorManager; + response: AxiosInterceptorManager; + }; + getUri(config?: AxiosRequestConfig): string; + request, D = any>(config: AxiosRequestConfig): Promise; + get, D = any>(url: string, config?: AxiosRequestConfig): Promise; + delete, D = any>(url: string, config?: AxiosRequestConfig): Promise; + head, D = any>(url: string, config?: AxiosRequestConfig): Promise; + options, D = any>(url: string, config?: AxiosRequestConfig): Promise; + post, D = any>(url: string, data?: D, config?: AxiosRequestConfig): Promise; + put, D = any>(url: string, data?: D, config?: AxiosRequestConfig): Promise; + patch, D = any>(url: string, data?: D, config?: AxiosRequestConfig): Promise; +} + +export interface AxiosInstance extends Axios { + (config: AxiosRequestConfig): AxiosPromise; + (url: string, config?: AxiosRequestConfig): AxiosPromise; +} + +export interface AxiosStatic extends AxiosInstance { + create(config?: AxiosRequestConfig): AxiosInstance; + Cancel: CancelStatic; + CancelToken: CancelTokenStatic; + Axios: typeof Axios; + readonly VERSION: string; + isCancel(value: any): boolean; + all(values: Array>): Promise; + spread(callback: (...args: T[]) => R): (array: T[]) => R; + isAxiosError(payload: any): payload is AxiosError; +} + +declare const axios: AxiosStatic; + +export default axios; diff --git a/node_modules/@shineiichijo/marika/node_modules/axios/index.js b/node_modules/@shineiichijo/marika/node_modules/axios/index.js new file mode 100644 index 000000000..79dfd09dd --- /dev/null +++ b/node_modules/@shineiichijo/marika/node_modules/axios/index.js @@ -0,0 +1 @@ +module.exports = require('./lib/axios'); \ No newline at end of file diff --git a/node_modules/@shineiichijo/marika/node_modules/axios/lib/adapters/README.md b/node_modules/@shineiichijo/marika/node_modules/axios/lib/adapters/README.md new file mode 100644 index 000000000..68f111895 --- /dev/null +++ b/node_modules/@shineiichijo/marika/node_modules/axios/lib/adapters/README.md @@ -0,0 +1,37 @@ +# axios // adapters + +The modules under `adapters/` are modules that handle dispatching a request and settling a returned `Promise` once a response is received. + +## Example + +```js +var settle = require('./../core/settle'); + +module.exports = function myAdapter(config) { + // At this point: + // - config has been merged with defaults + // - request transformers have already run + // - request interceptors have already run + + // Make the request using config provided + // Upon response settle the Promise + + return new Promise(function(resolve, reject) { + + var response = { + data: responseData, + status: request.status, + statusText: request.statusText, + headers: responseHeaders, + config: config, + request: request + }; + + settle(resolve, reject, response); + + // From here: + // - response transformers will run + // - response interceptors will run + }); +} +``` diff --git a/node_modules/@shineiichijo/marika/node_modules/axios/lib/adapters/http.js b/node_modules/@shineiichijo/marika/node_modules/axios/lib/adapters/http.js new file mode 100644 index 000000000..28317c105 --- /dev/null +++ b/node_modules/@shineiichijo/marika/node_modules/axios/lib/adapters/http.js @@ -0,0 +1,404 @@ +'use strict'; + +var utils = require('./../utils'); +var settle = require('./../core/settle'); +var buildFullPath = require('../core/buildFullPath'); +var buildURL = require('./../helpers/buildURL'); +var http = require('http'); +var https = require('https'); +var httpFollow = require('follow-redirects').http; +var httpsFollow = require('follow-redirects').https; +var url = require('url'); +var zlib = require('zlib'); +var VERSION = require('./../env/data').version; +var createError = require('../core/createError'); +var enhanceError = require('../core/enhanceError'); +var transitionalDefaults = require('../defaults/transitional'); +var Cancel = require('../cancel/Cancel'); + +var isHttps = /https:?/; + +/** + * + * @param {http.ClientRequestArgs} options + * @param {AxiosProxyConfig} proxy + * @param {string} location + */ +function setProxy(options, proxy, location) { + options.hostname = proxy.host; + options.host = proxy.host; + options.port = proxy.port; + options.path = location; + + // Basic proxy authorization + if (proxy.auth) { + var base64 = Buffer.from(proxy.auth.username + ':' + proxy.auth.password, 'utf8').toString('base64'); + options.headers['Proxy-Authorization'] = 'Basic ' + base64; + } + + // If a proxy is used, any redirects must also pass through the proxy + options.beforeRedirect = function beforeRedirect(redirection) { + redirection.headers.host = redirection.host; + setProxy(redirection, proxy, redirection.href); + }; +} + +/*eslint consistent-return:0*/ +module.exports = function httpAdapter(config) { + return new Promise(function dispatchHttpRequest(resolvePromise, rejectPromise) { + var onCanceled; + function done() { + if (config.cancelToken) { + config.cancelToken.unsubscribe(onCanceled); + } + + if (config.signal) { + config.signal.removeEventListener('abort', onCanceled); + } + } + var resolve = function resolve(value) { + done(); + resolvePromise(value); + }; + var rejected = false; + var reject = function reject(value) { + done(); + rejected = true; + rejectPromise(value); + }; + var data = config.data; + var headers = config.headers; + var headerNames = {}; + + Object.keys(headers).forEach(function storeLowerName(name) { + headerNames[name.toLowerCase()] = name; + }); + + // Set User-Agent (required by some servers) + // See https://github.com/axios/axios/issues/69 + if ('user-agent' in headerNames) { + // User-Agent is specified; handle case where no UA header is desired + if (!headers[headerNames['user-agent']]) { + delete headers[headerNames['user-agent']]; + } + // Otherwise, use specified value + } else { + // Only set header if it hasn't been set in config + headers['User-Agent'] = 'axios/' + VERSION; + } + + if (data && !utils.isStream(data)) { + if (Buffer.isBuffer(data)) { + // Nothing to do... + } else if (utils.isArrayBuffer(data)) { + data = Buffer.from(new Uint8Array(data)); + } else if (utils.isString(data)) { + data = Buffer.from(data, 'utf-8'); + } else { + return reject(createError( + 'Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream', + config + )); + } + + if (config.maxBodyLength > -1 && data.length > config.maxBodyLength) { + return reject(createError('Request body larger than maxBodyLength limit', config)); + } + + // Add Content-Length header if data exists + if (!headerNames['content-length']) { + headers['Content-Length'] = data.length; + } + } + + // HTTP basic authentication + var auth = undefined; + if (config.auth) { + var username = config.auth.username || ''; + var password = config.auth.password || ''; + auth = username + ':' + password; + } + + // Parse url + var fullPath = buildFullPath(config.baseURL, config.url); + var parsed = url.parse(fullPath); + var protocol = parsed.protocol || 'http:'; + + if (!auth && parsed.auth) { + var urlAuth = parsed.auth.split(':'); + var urlUsername = urlAuth[0] || ''; + var urlPassword = urlAuth[1] || ''; + auth = urlUsername + ':' + urlPassword; + } + + if (auth && headerNames.authorization) { + delete headers[headerNames.authorization]; + } + + var isHttpsRequest = isHttps.test(protocol); + var agent = isHttpsRequest ? config.httpsAgent : config.httpAgent; + + try { + buildURL(parsed.path, config.params, config.paramsSerializer).replace(/^\?/, ''); + } catch (err) { + var customErr = new Error(err.message); + customErr.config = config; + customErr.url = config.url; + customErr.exists = true; + reject(customErr); + } + + var options = { + path: buildURL(parsed.path, config.params, config.paramsSerializer).replace(/^\?/, ''), + method: config.method.toUpperCase(), + headers: headers, + agent: agent, + agents: { http: config.httpAgent, https: config.httpsAgent }, + auth: auth + }; + + if (config.socketPath) { + options.socketPath = config.socketPath; + } else { + options.hostname = parsed.hostname; + options.port = parsed.port; + } + + var proxy = config.proxy; + if (!proxy && proxy !== false) { + var proxyEnv = protocol.slice(0, -1) + '_proxy'; + var proxyUrl = process.env[proxyEnv] || process.env[proxyEnv.toUpperCase()]; + if (proxyUrl) { + var parsedProxyUrl = url.parse(proxyUrl); + var noProxyEnv = process.env.no_proxy || process.env.NO_PROXY; + var shouldProxy = true; + + if (noProxyEnv) { + var noProxy = noProxyEnv.split(',').map(function trim(s) { + return s.trim(); + }); + + shouldProxy = !noProxy.some(function proxyMatch(proxyElement) { + if (!proxyElement) { + return false; + } + if (proxyElement === '*') { + return true; + } + if (proxyElement[0] === '.' && + parsed.hostname.substr(parsed.hostname.length - proxyElement.length) === proxyElement) { + return true; + } + + return parsed.hostname === proxyElement; + }); + } + + if (shouldProxy) { + proxy = { + host: parsedProxyUrl.hostname, + port: parsedProxyUrl.port, + protocol: parsedProxyUrl.protocol + }; + + if (parsedProxyUrl.auth) { + var proxyUrlAuth = parsedProxyUrl.auth.split(':'); + proxy.auth = { + username: proxyUrlAuth[0], + password: proxyUrlAuth[1] + }; + } + } + } + } + + if (proxy) { + options.headers.host = parsed.hostname + (parsed.port ? ':' + parsed.port : ''); + setProxy(options, proxy, protocol + '//' + parsed.hostname + (parsed.port ? ':' + parsed.port : '') + options.path); + } + + var transport; + var isHttpsProxy = isHttpsRequest && (proxy ? isHttps.test(proxy.protocol) : true); + if (config.transport) { + transport = config.transport; + } else if (config.maxRedirects === 0) { + transport = isHttpsProxy ? https : http; + } else { + if (config.maxRedirects) { + options.maxRedirects = config.maxRedirects; + } + transport = isHttpsProxy ? httpsFollow : httpFollow; + } + + if (config.maxBodyLength > -1) { + options.maxBodyLength = config.maxBodyLength; + } + + if (config.insecureHTTPParser) { + options.insecureHTTPParser = config.insecureHTTPParser; + } + + // Create the request + var req = transport.request(options, function handleResponse(res) { + if (req.aborted) return; + + // uncompress the response body transparently if required + var stream = res; + + // return the last request in case of redirects + var lastRequest = res.req || req; + + + // if no content, is HEAD request or decompress disabled we should not decompress + if (res.statusCode !== 204 && lastRequest.method !== 'HEAD' && config.decompress !== false) { + switch (res.headers['content-encoding']) { + /*eslint default-case:0*/ + case 'gzip': + case 'compress': + case 'deflate': + // add the unzipper to the body stream processing pipeline + stream = stream.pipe(zlib.createUnzip()); + + // remove the content-encoding in order to not confuse downstream operations + delete res.headers['content-encoding']; + break; + } + } + + var response = { + status: res.statusCode, + statusText: res.statusMessage, + headers: res.headers, + config: config, + request: lastRequest + }; + + if (config.responseType === 'stream') { + response.data = stream; + settle(resolve, reject, response); + } else { + var responseBuffer = []; + var totalResponseBytes = 0; + stream.on('data', function handleStreamData(chunk) { + responseBuffer.push(chunk); + totalResponseBytes += chunk.length; + + // make sure the content length is not over the maxContentLength if specified + if (config.maxContentLength > -1 && totalResponseBytes > config.maxContentLength) { + // stream.destoy() emit aborted event before calling reject() on Node.js v16 + rejected = true; + stream.destroy(); + reject(createError('maxContentLength size of ' + config.maxContentLength + ' exceeded', + config, null, lastRequest)); + } + }); + + stream.on('aborted', function handlerStreamAborted() { + if (rejected) { + return; + } + stream.destroy(); + reject(createError('error request aborted', config, 'ERR_REQUEST_ABORTED', lastRequest)); + }); + + stream.on('error', function handleStreamError(err) { + if (req.aborted) return; + reject(enhanceError(err, config, null, lastRequest)); + }); + + stream.on('end', function handleStreamEnd() { + try { + var responseData = responseBuffer.length === 1 ? responseBuffer[0] : Buffer.concat(responseBuffer); + if (config.responseType !== 'arraybuffer') { + responseData = responseData.toString(config.responseEncoding); + if (!config.responseEncoding || config.responseEncoding === 'utf8') { + responseData = utils.stripBOM(responseData); + } + } + response.data = responseData; + } catch (err) { + reject(enhanceError(err, config, err.code, response.request, response)); + } + settle(resolve, reject, response); + }); + } + }); + + // Handle errors + req.on('error', function handleRequestError(err) { + if (req.aborted && err.code !== 'ERR_FR_TOO_MANY_REDIRECTS') return; + reject(enhanceError(err, config, null, req)); + }); + + // set tcp keep alive to prevent drop connection by peer + req.on('socket', function handleRequestSocket(socket) { + // default interval of sending ack packet is 1 minute + socket.setKeepAlive(true, 1000 * 60); + }); + + // Handle request timeout + if (config.timeout) { + // This is forcing a int timeout to avoid problems if the `req` interface doesn't handle other types. + var timeout = parseInt(config.timeout, 10); + + if (isNaN(timeout)) { + reject(createError( + 'error trying to parse `config.timeout` to int', + config, + 'ERR_PARSE_TIMEOUT', + req + )); + + return; + } + + // Sometime, the response will be very slow, and does not respond, the connect event will be block by event loop system. + // And timer callback will be fired, and abort() will be invoked before connection, then get "socket hang up" and code ECONNRESET. + // At this time, if we have a large number of request, nodejs will hang up some socket on background. and the number will up and up. + // And then these socket which be hang up will devoring CPU little by little. + // ClientRequest.setTimeout will be fired on the specify milliseconds, and can make sure that abort() will be fired after connect. + req.setTimeout(timeout, function handleRequestTimeout() { + req.abort(); + var timeoutErrorMessage = ''; + if (config.timeoutErrorMessage) { + timeoutErrorMessage = config.timeoutErrorMessage; + } else { + timeoutErrorMessage = 'timeout of ' + config.timeout + 'ms exceeded'; + } + var transitional = config.transitional || transitionalDefaults; + reject(createError( + timeoutErrorMessage, + config, + transitional.clarifyTimeoutError ? 'ETIMEDOUT' : 'ECONNABORTED', + req + )); + }); + } + + if (config.cancelToken || config.signal) { + // Handle cancellation + // eslint-disable-next-line func-names + onCanceled = function(cancel) { + if (req.aborted) return; + + req.abort(); + reject(!cancel || (cancel && cancel.type) ? new Cancel('canceled') : cancel); + }; + + config.cancelToken && config.cancelToken.subscribe(onCanceled); + if (config.signal) { + config.signal.aborted ? onCanceled() : config.signal.addEventListener('abort', onCanceled); + } + } + + + // Send the request + if (utils.isStream(data)) { + data.on('error', function handleStreamError(err) { + reject(enhanceError(err, config, null, req)); + }).pipe(req); + } else { + req.end(data); + } + }); +}; diff --git a/node_modules/@shineiichijo/marika/node_modules/axios/lib/adapters/xhr.js b/node_modules/@shineiichijo/marika/node_modules/axios/lib/adapters/xhr.js new file mode 100644 index 000000000..e58625aaa --- /dev/null +++ b/node_modules/@shineiichijo/marika/node_modules/axios/lib/adapters/xhr.js @@ -0,0 +1,212 @@ +'use strict'; + +var utils = require('./../utils'); +var settle = require('./../core/settle'); +var cookies = require('./../helpers/cookies'); +var buildURL = require('./../helpers/buildURL'); +var buildFullPath = require('../core/buildFullPath'); +var parseHeaders = require('./../helpers/parseHeaders'); +var isURLSameOrigin = require('./../helpers/isURLSameOrigin'); +var createError = require('../core/createError'); +var transitionalDefaults = require('../defaults/transitional'); +var Cancel = require('../cancel/Cancel'); + +module.exports = function xhrAdapter(config) { + return new Promise(function dispatchXhrRequest(resolve, reject) { + var requestData = config.data; + var requestHeaders = config.headers; + var responseType = config.responseType; + var onCanceled; + function done() { + if (config.cancelToken) { + config.cancelToken.unsubscribe(onCanceled); + } + + if (config.signal) { + config.signal.removeEventListener('abort', onCanceled); + } + } + + if (utils.isFormData(requestData)) { + delete requestHeaders['Content-Type']; // Let the browser set it + } + + var request = new XMLHttpRequest(); + + // HTTP basic authentication + if (config.auth) { + var username = config.auth.username || ''; + var password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : ''; + requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password); + } + + var fullPath = buildFullPath(config.baseURL, config.url); + request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true); + + // Set the request timeout in MS + request.timeout = config.timeout; + + function onloadend() { + if (!request) { + return; + } + // Prepare the response + var responseHeaders = 'getAllResponseHeaders' in request ? parseHeaders(request.getAllResponseHeaders()) : null; + var responseData = !responseType || responseType === 'text' || responseType === 'json' ? + request.responseText : request.response; + var response = { + data: responseData, + status: request.status, + statusText: request.statusText, + headers: responseHeaders, + config: config, + request: request + }; + + settle(function _resolve(value) { + resolve(value); + done(); + }, function _reject(err) { + reject(err); + done(); + }, response); + + // Clean up request + request = null; + } + + if ('onloadend' in request) { + // Use onloadend if available + request.onloadend = onloadend; + } else { + // Listen for ready state to emulate onloadend + request.onreadystatechange = function handleLoad() { + if (!request || request.readyState !== 4) { + return; + } + + // The request errored out and we didn't get a response, this will be + // handled by onerror instead + // With one exception: request that using file: protocol, most browsers + // will return status as 0 even though it's a successful request + if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) { + return; + } + // readystate handler is calling before onerror or ontimeout handlers, + // so we should call onloadend on the next 'tick' + setTimeout(onloadend); + }; + } + + // Handle browser request cancellation (as opposed to a manual cancellation) + request.onabort = function handleAbort() { + if (!request) { + return; + } + + reject(createError('Request aborted', config, 'ECONNABORTED', request)); + + // Clean up request + request = null; + }; + + // Handle low level network errors + request.onerror = function handleError() { + // Real errors are hidden from us by the browser + // onerror should only fire if it's a network error + reject(createError('Network Error', config, null, request)); + + // Clean up request + request = null; + }; + + // Handle timeout + request.ontimeout = function handleTimeout() { + var timeoutErrorMessage = config.timeout ? 'timeout of ' + config.timeout + 'ms exceeded' : 'timeout exceeded'; + var transitional = config.transitional || transitionalDefaults; + if (config.timeoutErrorMessage) { + timeoutErrorMessage = config.timeoutErrorMessage; + } + reject(createError( + timeoutErrorMessage, + config, + transitional.clarifyTimeoutError ? 'ETIMEDOUT' : 'ECONNABORTED', + request)); + + // Clean up request + request = null; + }; + + // Add xsrf header + // This is only done if running in a standard browser environment. + // Specifically not if we're in a web worker, or react-native. + if (utils.isStandardBrowserEnv()) { + // Add xsrf header + var xsrfValue = (config.withCredentials || isURLSameOrigin(fullPath)) && config.xsrfCookieName ? + cookies.read(config.xsrfCookieName) : + undefined; + + if (xsrfValue) { + requestHeaders[config.xsrfHeaderName] = xsrfValue; + } + } + + // Add headers to the request + if ('setRequestHeader' in request) { + utils.forEach(requestHeaders, function setRequestHeader(val, key) { + if (typeof requestData === 'undefined' && key.toLowerCase() === 'content-type') { + // Remove Content-Type if data is undefined + delete requestHeaders[key]; + } else { + // Otherwise add header to the request + request.setRequestHeader(key, val); + } + }); + } + + // Add withCredentials to request if needed + if (!utils.isUndefined(config.withCredentials)) { + request.withCredentials = !!config.withCredentials; + } + + // Add responseType to request if needed + if (responseType && responseType !== 'json') { + request.responseType = config.responseType; + } + + // Handle progress if needed + if (typeof config.onDownloadProgress === 'function') { + request.addEventListener('progress', config.onDownloadProgress); + } + + // Not all browsers support upload events + if (typeof config.onUploadProgress === 'function' && request.upload) { + request.upload.addEventListener('progress', config.onUploadProgress); + } + + if (config.cancelToken || config.signal) { + // Handle cancellation + // eslint-disable-next-line func-names + onCanceled = function(cancel) { + if (!request) { + return; + } + reject(!cancel || (cancel && cancel.type) ? new Cancel('canceled') : cancel); + request.abort(); + request = null; + }; + + config.cancelToken && config.cancelToken.subscribe(onCanceled); + if (config.signal) { + config.signal.aborted ? onCanceled() : config.signal.addEventListener('abort', onCanceled); + } + } + + if (!requestData) { + requestData = null; + } + + // Send the request + request.send(requestData); + }); +}; diff --git a/node_modules/@shineiichijo/marika/node_modules/axios/lib/axios.js b/node_modules/@shineiichijo/marika/node_modules/axios/lib/axios.js new file mode 100644 index 000000000..c03232725 --- /dev/null +++ b/node_modules/@shineiichijo/marika/node_modules/axios/lib/axios.js @@ -0,0 +1,57 @@ +'use strict'; + +var utils = require('./utils'); +var bind = require('./helpers/bind'); +var Axios = require('./core/Axios'); +var mergeConfig = require('./core/mergeConfig'); +var defaults = require('./defaults'); + +/** + * Create an instance of Axios + * + * @param {Object} defaultConfig The default config for the instance + * @return {Axios} A new instance of Axios + */ +function createInstance(defaultConfig) { + var context = new Axios(defaultConfig); + var instance = bind(Axios.prototype.request, context); + + // Copy axios.prototype to instance + utils.extend(instance, Axios.prototype, context); + + // Copy context to instance + utils.extend(instance, context); + + // Factory for creating new instances + instance.create = function create(instanceConfig) { + return createInstance(mergeConfig(defaultConfig, instanceConfig)); + }; + + return instance; +} + +// Create the default instance to be exported +var axios = createInstance(defaults); + +// Expose Axios class to allow class inheritance +axios.Axios = Axios; + +// Expose Cancel & CancelToken +axios.Cancel = require('./cancel/Cancel'); +axios.CancelToken = require('./cancel/CancelToken'); +axios.isCancel = require('./cancel/isCancel'); +axios.VERSION = require('./env/data').version; + +// Expose all/spread +axios.all = function all(promises) { + return Promise.all(promises); +}; +axios.spread = require('./helpers/spread'); + +// Expose isAxiosError +axios.isAxiosError = require('./helpers/isAxiosError'); + +module.exports = axios; + +// Allow use of default import syntax in TypeScript +module.exports.default = axios; diff --git a/node_modules/@shineiichijo/marika/node_modules/axios/lib/cancel/Cancel.js b/node_modules/@shineiichijo/marika/node_modules/axios/lib/cancel/Cancel.js new file mode 100644 index 000000000..e0de4003f --- /dev/null +++ b/node_modules/@shineiichijo/marika/node_modules/axios/lib/cancel/Cancel.js @@ -0,0 +1,19 @@ +'use strict'; + +/** + * A `Cancel` is an object that is thrown when an operation is canceled. + * + * @class + * @param {string=} message The message. + */ +function Cancel(message) { + this.message = message; +} + +Cancel.prototype.toString = function toString() { + return 'Cancel' + (this.message ? ': ' + this.message : ''); +}; + +Cancel.prototype.__CANCEL__ = true; + +module.exports = Cancel; diff --git a/node_modules/@shineiichijo/marika/node_modules/axios/lib/cancel/CancelToken.js b/node_modules/@shineiichijo/marika/node_modules/axios/lib/cancel/CancelToken.js new file mode 100644 index 000000000..089d6b903 --- /dev/null +++ b/node_modules/@shineiichijo/marika/node_modules/axios/lib/cancel/CancelToken.js @@ -0,0 +1,119 @@ +'use strict'; + +var Cancel = require('./Cancel'); + +/** + * A `CancelToken` is an object that can be used to request cancellation of an operation. + * + * @class + * @param {Function} executor The executor function. + */ +function CancelToken(executor) { + if (typeof executor !== 'function') { + throw new TypeError('executor must be a function.'); + } + + var resolvePromise; + + this.promise = new Promise(function promiseExecutor(resolve) { + resolvePromise = resolve; + }); + + var token = this; + + // eslint-disable-next-line func-names + this.promise.then(function(cancel) { + if (!token._listeners) return; + + var i; + var l = token._listeners.length; + + for (i = 0; i < l; i++) { + token._listeners[i](cancel); + } + token._listeners = null; + }); + + // eslint-disable-next-line func-names + this.promise.then = function(onfulfilled) { + var _resolve; + // eslint-disable-next-line func-names + var promise = new Promise(function(resolve) { + token.subscribe(resolve); + _resolve = resolve; + }).then(onfulfilled); + + promise.cancel = function reject() { + token.unsubscribe(_resolve); + }; + + return promise; + }; + + executor(function cancel(message) { + if (token.reason) { + // Cancellation has already been requested + return; + } + + token.reason = new Cancel(message); + resolvePromise(token.reason); + }); +} + +/** + * Throws a `Cancel` if cancellation has been requested. + */ +CancelToken.prototype.throwIfRequested = function throwIfRequested() { + if (this.reason) { + throw this.reason; + } +}; + +/** + * Subscribe to the cancel signal + */ + +CancelToken.prototype.subscribe = function subscribe(listener) { + if (this.reason) { + listener(this.reason); + return; + } + + if (this._listeners) { + this._listeners.push(listener); + } else { + this._listeners = [listener]; + } +}; + +/** + * Unsubscribe from the cancel signal + */ + +CancelToken.prototype.unsubscribe = function unsubscribe(listener) { + if (!this._listeners) { + return; + } + var index = this._listeners.indexOf(listener); + if (index !== -1) { + this._listeners.splice(index, 1); + } +}; + +/** + * Returns an object that contains a new `CancelToken` and a function that, when called, + * cancels the `CancelToken`. + */ +CancelToken.source = function source() { + var cancel; + var token = new CancelToken(function executor(c) { + cancel = c; + }); + return { + token: token, + cancel: cancel + }; +}; + +module.exports = CancelToken; diff --git a/node_modules/@shineiichijo/marika/node_modules/axios/lib/cancel/isCancel.js b/node_modules/@shineiichijo/marika/node_modules/axios/lib/cancel/isCancel.js new file mode 100644 index 000000000..051f3ae4c --- /dev/null +++ b/node_modules/@shineiichijo/marika/node_modules/axios/lib/cancel/isCancel.js @@ -0,0 +1,5 @@ +'use strict'; + +module.exports = function isCancel(value) { + return !!(value && value.__CANCEL__); +}; diff --git a/node_modules/@shineiichijo/marika/node_modules/axios/lib/core/Axios.js b/node_modules/@shineiichijo/marika/node_modules/axios/lib/core/Axios.js new file mode 100644 index 000000000..a1be08ada --- /dev/null +++ b/node_modules/@shineiichijo/marika/node_modules/axios/lib/core/Axios.js @@ -0,0 +1,148 @@ +'use strict'; + +var utils = require('./../utils'); +var buildURL = require('../helpers/buildURL'); +var InterceptorManager = require('./InterceptorManager'); +var dispatchRequest = require('./dispatchRequest'); +var mergeConfig = require('./mergeConfig'); +var validator = require('../helpers/validator'); + +var validators = validator.validators; +/** + * Create a new instance of Axios + * + * @param {Object} instanceConfig The default config for the instance + */ +function Axios(instanceConfig) { + this.defaults = instanceConfig; + this.interceptors = { + request: new InterceptorManager(), + response: new InterceptorManager() + }; +} + +/** + * Dispatch a request + * + * @param {Object} config The config specific for this request (merged with this.defaults) + */ +Axios.prototype.request = function request(configOrUrl, config) { + /*eslint no-param-reassign:0*/ + // Allow for axios('example/url'[, config]) a la fetch API + if (typeof configOrUrl === 'string') { + config = config || {}; + config.url = configOrUrl; + } else { + config = configOrUrl || {}; + } + + config = mergeConfig(this.defaults, config); + + // Set config.method + if (config.method) { + config.method = config.method.toLowerCase(); + } else if (this.defaults.method) { + config.method = this.defaults.method.toLowerCase(); + } else { + config.method = 'get'; + } + + var transitional = config.transitional; + + if (transitional !== undefined) { + validator.assertOptions(transitional, { + silentJSONParsing: validators.transitional(validators.boolean), + forcedJSONParsing: validators.transitional(validators.boolean), + clarifyTimeoutError: validators.transitional(validators.boolean) + }, false); + } + + // filter out skipped interceptors + var requestInterceptorChain = []; + var synchronousRequestInterceptors = true; + this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) { + if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) { + return; + } + + synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous; + + requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected); + }); + + var responseInterceptorChain = []; + this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) { + responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected); + }); + + var promise; + + if (!synchronousRequestInterceptors) { + var chain = [dispatchRequest, undefined]; + + Array.prototype.unshift.apply(chain, requestInterceptorChain); + chain = chain.concat(responseInterceptorChain); + + promise = Promise.resolve(config); + while (chain.length) { + promise = promise.then(chain.shift(), chain.shift()); + } + + return promise; + } + + + var newConfig = config; + while (requestInterceptorChain.length) { + var onFulfilled = requestInterceptorChain.shift(); + var onRejected = requestInterceptorChain.shift(); + try { + newConfig = onFulfilled(newConfig); + } catch (error) { + onRejected(error); + break; + } + } + + try { + promise = dispatchRequest(newConfig); + } catch (error) { + return Promise.reject(error); + } + + while (responseInterceptorChain.length) { + promise = promise.then(responseInterceptorChain.shift(), responseInterceptorChain.shift()); + } + + return promise; +}; + +Axios.prototype.getUri = function getUri(config) { + config = mergeConfig(this.defaults, config); + return buildURL(config.url, config.params, config.paramsSerializer).replace(/^\?/, ''); +}; + +// Provide aliases for supported request methods +utils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) { + /*eslint func-names:0*/ + Axios.prototype[method] = function(url, config) { + return this.request(mergeConfig(config || {}, { + method: method, + url: url, + data: (config || {}).data + })); + }; +}); + +utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) { + /*eslint func-names:0*/ + Axios.prototype[method] = function(url, data, config) { + return this.request(mergeConfig(config || {}, { + method: method, + url: url, + data: data + })); + }; +}); + +module.exports = Axios; diff --git a/node_modules/@shineiichijo/marika/node_modules/axios/lib/core/InterceptorManager.js b/node_modules/@shineiichijo/marika/node_modules/axios/lib/core/InterceptorManager.js new file mode 100644 index 000000000..900f44880 --- /dev/null +++ b/node_modules/@shineiichijo/marika/node_modules/axios/lib/core/InterceptorManager.js @@ -0,0 +1,54 @@ +'use strict'; + +var utils = require('./../utils'); + +function InterceptorManager() { + this.handlers = []; +} + +/** + * Add a new interceptor to the stack + * + * @param {Function} fulfilled The function to handle `then` for a `Promise` + * @param {Function} rejected The function to handle `reject` for a `Promise` + * + * @return {Number} An ID used to remove interceptor later + */ +InterceptorManager.prototype.use = function use(fulfilled, rejected, options) { + this.handlers.push({ + fulfilled: fulfilled, + rejected: rejected, + synchronous: options ? options.synchronous : false, + runWhen: options ? options.runWhen : null + }); + return this.handlers.length - 1; +}; + +/** + * Remove an interceptor from the stack + * + * @param {Number} id The ID that was returned by `use` + */ +InterceptorManager.prototype.eject = function eject(id) { + if (this.handlers[id]) { + this.handlers[id] = null; + } +}; + +/** + * Iterate over all the registered interceptors + * + * This method is particularly useful for skipping over any + * interceptors that may have become `null` calling `eject`. + * + * @param {Function} fn The function to call for each interceptor + */ +InterceptorManager.prototype.forEach = function forEach(fn) { + utils.forEach(this.handlers, function forEachHandler(h) { + if (h !== null) { + fn(h); + } + }); +}; + +module.exports = InterceptorManager; diff --git a/node_modules/@shineiichijo/marika/node_modules/axios/lib/core/README.md b/node_modules/@shineiichijo/marika/node_modules/axios/lib/core/README.md new file mode 100644 index 000000000..84559ce7c --- /dev/null +++ b/node_modules/@shineiichijo/marika/node_modules/axios/lib/core/README.md @@ -0,0 +1,8 @@ +# axios // core + +The modules found in `core/` should be modules that are specific to the domain logic of axios. These modules would most likely not make sense to be consumed outside of the axios module, as their logic is too specific. Some examples of core modules are: + +- Dispatching requests + - Requests sent via `adapters/` (see lib/adapters/README.md) +- Managing interceptors +- Handling config diff --git a/node_modules/@shineiichijo/marika/node_modules/axios/lib/core/buildFullPath.js b/node_modules/@shineiichijo/marika/node_modules/axios/lib/core/buildFullPath.js new file mode 100644 index 000000000..00b2b050a --- /dev/null +++ b/node_modules/@shineiichijo/marika/node_modules/axios/lib/core/buildFullPath.js @@ -0,0 +1,20 @@ +'use strict'; + +var isAbsoluteURL = require('../helpers/isAbsoluteURL'); +var combineURLs = require('../helpers/combineURLs'); + +/** + * Creates a new URL by combining the baseURL with the requestedURL, + * only when the requestedURL is not already an absolute URL. + * If the requestURL is absolute, this function returns the requestedURL untouched. + * + * @param {string} baseURL The base URL + * @param {string} requestedURL Absolute or relative URL to combine + * @returns {string} The combined full path + */ +module.exports = function buildFullPath(baseURL, requestedURL) { + if (baseURL && !isAbsoluteURL(requestedURL)) { + return combineURLs(baseURL, requestedURL); + } + return requestedURL; +}; diff --git a/node_modules/@shineiichijo/marika/node_modules/axios/lib/core/createError.js b/node_modules/@shineiichijo/marika/node_modules/axios/lib/core/createError.js new file mode 100644 index 000000000..933680f69 --- /dev/null +++ b/node_modules/@shineiichijo/marika/node_modules/axios/lib/core/createError.js @@ -0,0 +1,18 @@ +'use strict'; + +var enhanceError = require('./enhanceError'); + +/** + * Create an Error with the specified message, config, error code, request and response. + * + * @param {string} message The error message. + * @param {Object} config The config. + * @param {string} [code] The error code (for example, 'ECONNABORTED'). + * @param {Object} [request] The request. + * @param {Object} [response] The response. + * @returns {Error} The created error. + */ +module.exports = function createError(message, config, code, request, response) { + var error = new Error(message); + return enhanceError(error, config, code, request, response); +}; diff --git a/node_modules/@shineiichijo/marika/node_modules/axios/lib/core/dispatchRequest.js b/node_modules/@shineiichijo/marika/node_modules/axios/lib/core/dispatchRequest.js new file mode 100644 index 000000000..36da48bec --- /dev/null +++ b/node_modules/@shineiichijo/marika/node_modules/axios/lib/core/dispatchRequest.js @@ -0,0 +1,87 @@ +'use strict'; + +var utils = require('./../utils'); +var transformData = require('./transformData'); +var isCancel = require('../cancel/isCancel'); +var defaults = require('../defaults'); +var Cancel = require('../cancel/Cancel'); + +/** + * Throws a `Cancel` if cancellation has been requested. + */ +function throwIfCancellationRequested(config) { + if (config.cancelToken) { + config.cancelToken.throwIfRequested(); + } + + if (config.signal && config.signal.aborted) { + throw new Cancel('canceled'); + } +} + +/** + * Dispatch a request to the server using the configured adapter. + * + * @param {object} config The config that is to be used for the request + * @returns {Promise} The Promise to be fulfilled + */ +module.exports = function dispatchRequest(config) { + throwIfCancellationRequested(config); + + // Ensure headers exist + config.headers = config.headers || {}; + + // Transform request data + config.data = transformData.call( + config, + config.data, + config.headers, + config.transformRequest + ); + + // Flatten headers + config.headers = utils.merge( + config.headers.common || {}, + config.headers[config.method] || {}, + config.headers + ); + + utils.forEach( + ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'], + function cleanHeaderConfig(method) { + delete config.headers[method]; + } + ); + + var adapter = config.adapter || defaults.adapter; + + return adapter(config).then(function onAdapterResolution(response) { + throwIfCancellationRequested(config); + + // Transform response data + response.data = transformData.call( + config, + response.data, + response.headers, + config.transformResponse + ); + + return response; + }, function onAdapterRejection(reason) { + if (!isCancel(reason)) { + throwIfCancellationRequested(config); + + // Transform response data + if (reason && reason.response) { + reason.response.data = transformData.call( + config, + reason.response.data, + reason.response.headers, + config.transformResponse + ); + } + } + + return Promise.reject(reason); + }); +}; diff --git a/node_modules/@shineiichijo/marika/node_modules/axios/lib/core/enhanceError.js b/node_modules/@shineiichijo/marika/node_modules/axios/lib/core/enhanceError.js new file mode 100644 index 000000000..db04ec8ea --- /dev/null +++ b/node_modules/@shineiichijo/marika/node_modules/axios/lib/core/enhanceError.js @@ -0,0 +1,43 @@ +'use strict'; + +/** + * Update an Error with the specified config, error code, and response. + * + * @param {Error} error The error to update. + * @param {Object} config The config. + * @param {string} [code] The error code (for example, 'ECONNABORTED'). + * @param {Object} [request] The request. + * @param {Object} [response] The response. + * @returns {Error} The error. + */ +module.exports = function enhanceError(error, config, code, request, response) { + error.config = config; + if (code) { + error.code = code; + } + + error.request = request; + error.response = response; + error.isAxiosError = true; + + error.toJSON = function toJSON() { + return { + // Standard + message: this.message, + name: this.name, + // Microsoft + description: this.description, + number: this.number, + // Mozilla + fileName: this.fileName, + lineNumber: this.lineNumber, + columnNumber: this.columnNumber, + stack: this.stack, + // Axios + config: this.config, + code: this.code, + status: this.response && this.response.status ? this.response.status : null + }; + }; + return error; +}; diff --git a/node_modules/@shineiichijo/marika/node_modules/axios/lib/core/mergeConfig.js b/node_modules/@shineiichijo/marika/node_modules/axios/lib/core/mergeConfig.js new file mode 100644 index 000000000..05d143880 --- /dev/null +++ b/node_modules/@shineiichijo/marika/node_modules/axios/lib/core/mergeConfig.js @@ -0,0 +1,99 @@ +'use strict'; + +var utils = require('../utils'); + +/** + * Config-specific merge-function which creates a new config-object + * by merging two configuration objects together. + * + * @param {Object} config1 + * @param {Object} config2 + * @returns {Object} New object resulting from merging config2 to config1 + */ +module.exports = function mergeConfig(config1, config2) { + // eslint-disable-next-line no-param-reassign + config2 = config2 || {}; + var config = {}; + + function getMergedValue(target, source) { + if (utils.isPlainObject(target) && utils.isPlainObject(source)) { + return utils.merge(target, source); + } else if (utils.isPlainObject(source)) { + return utils.merge({}, source); + } else if (utils.isArray(source)) { + return source.slice(); + } + return source; + } + + // eslint-disable-next-line consistent-return + function mergeDeepProperties(prop) { + if (!utils.isUndefined(config2[prop])) { + return getMergedValue(config1[prop], config2[prop]); + } else if (!utils.isUndefined(config1[prop])) { + return getMergedValue(undefined, config1[prop]); + } + } + + // eslint-disable-next-line consistent-return + function valueFromConfig2(prop) { + if (!utils.isUndefined(config2[prop])) { + return getMergedValue(undefined, config2[prop]); + } + } + + // eslint-disable-next-line consistent-return + function defaultToConfig2(prop) { + if (!utils.isUndefined(config2[prop])) { + return getMergedValue(undefined, config2[prop]); + } else if (!utils.isUndefined(config1[prop])) { + return getMergedValue(undefined, config1[prop]); + } + } + + // eslint-disable-next-line consistent-return + function mergeDirectKeys(prop) { + if (prop in config2) { + return getMergedValue(config1[prop], config2[prop]); + } else if (prop in config1) { + return getMergedValue(undefined, config1[prop]); + } + } + + var mergeMap = { + 'url': valueFromConfig2, + 'method': valueFromConfig2, + 'data': valueFromConfig2, + 'baseURL': defaultToConfig2, + 'transformRequest': defaultToConfig2, + 'transformResponse': defaultToConfig2, + 'paramsSerializer': defaultToConfig2, + 'timeout': defaultToConfig2, + 'timeoutMessage': defaultToConfig2, + 'withCredentials': defaultToConfig2, + 'adapter': defaultToConfig2, + 'responseType': defaultToConfig2, + 'xsrfCookieName': defaultToConfig2, + 'xsrfHeaderName': defaultToConfig2, + 'onUploadProgress': defaultToConfig2, + 'onDownloadProgress': defaultToConfig2, + 'decompress': defaultToConfig2, + 'maxContentLength': defaultToConfig2, + 'maxBodyLength': defaultToConfig2, + 'transport': defaultToConfig2, + 'httpAgent': defaultToConfig2, + 'httpsAgent': defaultToConfig2, + 'cancelToken': defaultToConfig2, + 'socketPath': defaultToConfig2, + 'responseEncoding': defaultToConfig2, + 'validateStatus': mergeDirectKeys + }; + + utils.forEach(Object.keys(config1).concat(Object.keys(config2)), function computeConfigValue(prop) { + var merge = mergeMap[prop] || mergeDeepProperties; + var configValue = merge(prop); + (utils.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue); + }); + + return config; +}; diff --git a/node_modules/@shineiichijo/marika/node_modules/axios/lib/core/settle.js b/node_modules/@shineiichijo/marika/node_modules/axios/lib/core/settle.js new file mode 100644 index 000000000..886adb0c1 --- /dev/null +++ b/node_modules/@shineiichijo/marika/node_modules/axios/lib/core/settle.js @@ -0,0 +1,25 @@ +'use strict'; + +var createError = require('./createError'); + +/** + * Resolve or reject a Promise based on response status. + * + * @param {Function} resolve A function that resolves the promise. + * @param {Function} reject A function that rejects the promise. + * @param {object} response The response. + */ +module.exports = function settle(resolve, reject, response) { + var validateStatus = response.config.validateStatus; + if (!response.status || !validateStatus || validateStatus(response.status)) { + resolve(response); + } else { + reject(createError( + 'Request failed with status code ' + response.status, + response.config, + null, + response.request, + response + )); + } +}; diff --git a/node_modules/@shineiichijo/marika/node_modules/axios/lib/core/transformData.js b/node_modules/@shineiichijo/marika/node_modules/axios/lib/core/transformData.js new file mode 100644 index 000000000..82ee7dd7a --- /dev/null +++ b/node_modules/@shineiichijo/marika/node_modules/axios/lib/core/transformData.js @@ -0,0 +1,22 @@ +'use strict'; + +var utils = require('./../utils'); +var defaults = require('../defaults'); + +/** + * Transform the data for a request or a response + * + * @param {Object|String} data The data to be transformed + * @param {Array} headers The headers for the request or response + * @param {Array|Function} fns A single function or Array of functions + * @returns {*} The resulting transformed data + */ +module.exports = function transformData(data, headers, fns) { + var context = this || defaults; + /*eslint no-param-reassign:0*/ + utils.forEach(fns, function transform(fn) { + data = fn.call(context, data, headers); + }); + + return data; +}; diff --git a/node_modules/@shineiichijo/marika/node_modules/axios/lib/defaults/index.js b/node_modules/@shineiichijo/marika/node_modules/axios/lib/defaults/index.js new file mode 100644 index 000000000..8b57b8824 --- /dev/null +++ b/node_modules/@shineiichijo/marika/node_modules/axios/lib/defaults/index.js @@ -0,0 +1,131 @@ +'use strict'; + +var utils = require('../utils'); +var normalizeHeaderName = require('../helpers/normalizeHeaderName'); +var enhanceError = require('../core/enhanceError'); +var transitionalDefaults = require('./transitional'); + +var DEFAULT_CONTENT_TYPE = { + 'Content-Type': 'application/x-www-form-urlencoded' +}; + +function setContentTypeIfUnset(headers, value) { + if (!utils.isUndefined(headers) && utils.isUndefined(headers['Content-Type'])) { + headers['Content-Type'] = value; + } +} + +function getDefaultAdapter() { + var adapter; + if (typeof XMLHttpRequest !== 'undefined') { + // For browsers use XHR adapter + adapter = require('../adapters/xhr'); + } else if (typeof process !== 'undefined' && Object.prototype.toString.call(process) === '[object process]') { + // For node use HTTP adapter + adapter = require('../adapters/http'); + } + return adapter; +} + +function stringifySafely(rawValue, parser, encoder) { + if (utils.isString(rawValue)) { + try { + (parser || JSON.parse)(rawValue); + return utils.trim(rawValue); + } catch (e) { + if (e.name !== 'SyntaxError') { + throw e; + } + } + } + + return (encoder || JSON.stringify)(rawValue); +} + +var defaults = { + + transitional: transitionalDefaults, + + adapter: getDefaultAdapter(), + + transformRequest: [function transformRequest(data, headers) { + normalizeHeaderName(headers, 'Accept'); + normalizeHeaderName(headers, 'Content-Type'); + + if (utils.isFormData(data) || + utils.isArrayBuffer(data) || + utils.isBuffer(data) || + utils.isStream(data) || + utils.isFile(data) || + utils.isBlob(data) + ) { + return data; + } + if (utils.isArrayBufferView(data)) { + return data.buffer; + } + if (utils.isURLSearchParams(data)) { + setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8'); + return data.toString(); + } + if (utils.isObject(data) || (headers && headers['Content-Type'] === 'application/json')) { + setContentTypeIfUnset(headers, 'application/json'); + return stringifySafely(data); + } + return data; + }], + + transformResponse: [function transformResponse(data) { + var transitional = this.transitional || defaults.transitional; + var silentJSONParsing = transitional && transitional.silentJSONParsing; + var forcedJSONParsing = transitional && transitional.forcedJSONParsing; + var strictJSONParsing = !silentJSONParsing && this.responseType === 'json'; + + if (strictJSONParsing || (forcedJSONParsing && utils.isString(data) && data.length)) { + try { + return JSON.parse(data); + } catch (e) { + if (strictJSONParsing) { + if (e.name === 'SyntaxError') { + throw enhanceError(e, this, 'E_JSON_PARSE'); + } + throw e; + } + } + } + + return data; + }], + + /** + * A timeout in milliseconds to abort a request. If set to 0 (default) a + * timeout is not created. + */ + timeout: 0, + + xsrfCookieName: 'XSRF-TOKEN', + xsrfHeaderName: 'X-XSRF-TOKEN', + + maxContentLength: -1, + maxBodyLength: -1, + + validateStatus: function validateStatus(status) { + return status >= 200 && status < 300; + }, + + headers: { + common: { + 'Accept': 'application/json, text/plain, */*' + } + } +}; + +utils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) { + defaults.headers[method] = {}; +}); + +utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) { + defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE); +}); + +module.exports = defaults; diff --git a/node_modules/@shineiichijo/marika/node_modules/axios/lib/defaults/transitional.js b/node_modules/@shineiichijo/marika/node_modules/axios/lib/defaults/transitional.js new file mode 100644 index 000000000..601dd7ef6 --- /dev/null +++ b/node_modules/@shineiichijo/marika/node_modules/axios/lib/defaults/transitional.js @@ -0,0 +1,7 @@ +'use strict'; + +module.exports = { + silentJSONParsing: true, + forcedJSONParsing: true, + clarifyTimeoutError: false +}; diff --git a/node_modules/@shineiichijo/marika/node_modules/axios/lib/env/README.md b/node_modules/@shineiichijo/marika/node_modules/axios/lib/env/README.md new file mode 100644 index 000000000..b41baff3c --- /dev/null +++ b/node_modules/@shineiichijo/marika/node_modules/axios/lib/env/README.md @@ -0,0 +1,3 @@ +# axios // env + +The `data.js` file is updated automatically when the package version is upgrading. Please do not edit it manually. diff --git a/node_modules/@shineiichijo/marika/node_modules/axios/lib/env/data.js b/node_modules/@shineiichijo/marika/node_modules/axios/lib/env/data.js new file mode 100644 index 000000000..9fd310666 --- /dev/null +++ b/node_modules/@shineiichijo/marika/node_modules/axios/lib/env/data.js @@ -0,0 +1,3 @@ +module.exports = { + "version": "0.26.1" +}; \ No newline at end of file diff --git a/node_modules/@shineiichijo/marika/node_modules/axios/lib/helpers/README.md b/node_modules/@shineiichijo/marika/node_modules/axios/lib/helpers/README.md new file mode 100644 index 000000000..4ae34193a --- /dev/null +++ b/node_modules/@shineiichijo/marika/node_modules/axios/lib/helpers/README.md @@ -0,0 +1,7 @@ +# axios // helpers + +The modules found in `helpers/` should be generic modules that are _not_ specific to the domain logic of axios. These modules could theoretically be published to npm on their own and consumed by other modules or apps. Some examples of generic modules are things like: + +- Browser polyfills +- Managing cookies +- Parsing HTTP headers diff --git a/node_modules/@shineiichijo/marika/node_modules/axios/lib/helpers/bind.js b/node_modules/@shineiichijo/marika/node_modules/axios/lib/helpers/bind.js new file mode 100644 index 000000000..6147c608e --- /dev/null +++ b/node_modules/@shineiichijo/marika/node_modules/axios/lib/helpers/bind.js @@ -0,0 +1,11 @@ +'use strict'; + +module.exports = function bind(fn, thisArg) { + return function wrap() { + var args = new Array(arguments.length); + for (var i = 0; i < args.length; i++) { + args[i] = arguments[i]; + } + return fn.apply(thisArg, args); + }; +}; diff --git a/node_modules/@shineiichijo/marika/node_modules/axios/lib/helpers/buildURL.js b/node_modules/@shineiichijo/marika/node_modules/axios/lib/helpers/buildURL.js new file mode 100644 index 000000000..31595c33a --- /dev/null +++ b/node_modules/@shineiichijo/marika/node_modules/axios/lib/helpers/buildURL.js @@ -0,0 +1,70 @@ +'use strict'; + +var utils = require('./../utils'); + +function encode(val) { + return encodeURIComponent(val). + replace(/%3A/gi, ':'). + replace(/%24/g, '$'). + replace(/%2C/gi, ','). + replace(/%20/g, '+'). + replace(/%5B/gi, '['). + replace(/%5D/gi, ']'); +} + +/** + * Build a URL by appending params to the end + * + * @param {string} url The base of the url (e.g., http://www.google.com) + * @param {object} [params] The params to be appended + * @returns {string} The formatted url + */ +module.exports = function buildURL(url, params, paramsSerializer) { + /*eslint no-param-reassign:0*/ + if (!params) { + return url; + } + + var serializedParams; + if (paramsSerializer) { + serializedParams = paramsSerializer(params); + } else if (utils.isURLSearchParams(params)) { + serializedParams = params.toString(); + } else { + var parts = []; + + utils.forEach(params, function serialize(val, key) { + if (val === null || typeof val === 'undefined') { + return; + } + + if (utils.isArray(val)) { + key = key + '[]'; + } else { + val = [val]; + } + + utils.forEach(val, function parseValue(v) { + if (utils.isDate(v)) { + v = v.toISOString(); + } else if (utils.isObject(v)) { + v = JSON.stringify(v); + } + parts.push(encode(key) + '=' + encode(v)); + }); + }); + + serializedParams = parts.join('&'); + } + + if (serializedParams) { + var hashmarkIndex = url.indexOf('#'); + if (hashmarkIndex !== -1) { + url = url.slice(0, hashmarkIndex); + } + + url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams; + } + + return url; +}; diff --git a/node_modules/@shineiichijo/marika/node_modules/axios/lib/helpers/combineURLs.js b/node_modules/@shineiichijo/marika/node_modules/axios/lib/helpers/combineURLs.js new file mode 100644 index 000000000..f1b58a586 --- /dev/null +++ b/node_modules/@shineiichijo/marika/node_modules/axios/lib/helpers/combineURLs.js @@ -0,0 +1,14 @@ +'use strict'; + +/** + * Creates a new URL by combining the specified URLs + * + * @param {string} baseURL The base URL + * @param {string} relativeURL The relative URL + * @returns {string} The combined URL + */ +module.exports = function combineURLs(baseURL, relativeURL) { + return relativeURL + ? baseURL.replace(/\/+$/, '') + '/' + relativeURL.replace(/^\/+/, '') + : baseURL; +}; diff --git a/node_modules/@shineiichijo/marika/node_modules/axios/lib/helpers/cookies.js b/node_modules/@shineiichijo/marika/node_modules/axios/lib/helpers/cookies.js new file mode 100644 index 000000000..5a8a66661 --- /dev/null +++ b/node_modules/@shineiichijo/marika/node_modules/axios/lib/helpers/cookies.js @@ -0,0 +1,53 @@ +'use strict'; + +var utils = require('./../utils'); + +module.exports = ( + utils.isStandardBrowserEnv() ? + + // Standard browser envs support document.cookie + (function standardBrowserEnv() { + return { + write: function write(name, value, expires, path, domain, secure) { + var cookie = []; + cookie.push(name + '=' + encodeURIComponent(value)); + + if (utils.isNumber(expires)) { + cookie.push('expires=' + new Date(expires).toGMTString()); + } + + if (utils.isString(path)) { + cookie.push('path=' + path); + } + + if (utils.isString(domain)) { + cookie.push('domain=' + domain); + } + + if (secure === true) { + cookie.push('secure'); + } + + document.cookie = cookie.join('; '); + }, + + read: function read(name) { + var match = document.cookie.match(new RegExp('(^|;\\s*)(' + name + ')=([^;]*)')); + return (match ? decodeURIComponent(match[3]) : null); + }, + + remove: function remove(name) { + this.write(name, '', Date.now() - 86400000); + } + }; + })() : + + // Non standard browser env (web workers, react-native) lack needed support. + (function nonStandardBrowserEnv() { + return { + write: function write() {}, + read: function read() { return null; }, + remove: function remove() {} + }; + })() +); diff --git a/node_modules/@shineiichijo/marika/node_modules/axios/lib/helpers/deprecatedMethod.js b/node_modules/@shineiichijo/marika/node_modules/axios/lib/helpers/deprecatedMethod.js new file mode 100644 index 000000000..ed40965ba --- /dev/null +++ b/node_modules/@shineiichijo/marika/node_modules/axios/lib/helpers/deprecatedMethod.js @@ -0,0 +1,24 @@ +'use strict'; + +/*eslint no-console:0*/ + +/** + * Supply a warning to the developer that a method they are using + * has been deprecated. + * + * @param {string} method The name of the deprecated method + * @param {string} [instead] The alternate method to use if applicable + * @param {string} [docs] The documentation URL to get further details + */ +module.exports = function deprecatedMethod(method, instead, docs) { + try { + console.warn( + 'DEPRECATED method `' + method + '`.' + + (instead ? ' Use `' + instead + '` instead.' : '') + + ' This method will be removed in a future release.'); + + if (docs) { + console.warn('For more information about usage see ' + docs); + } + } catch (e) { /* Ignore */ } +}; diff --git a/node_modules/@shineiichijo/marika/node_modules/axios/lib/helpers/isAbsoluteURL.js b/node_modules/@shineiichijo/marika/node_modules/axios/lib/helpers/isAbsoluteURL.js new file mode 100644 index 000000000..43fea788a --- /dev/null +++ b/node_modules/@shineiichijo/marika/node_modules/axios/lib/helpers/isAbsoluteURL.js @@ -0,0 +1,14 @@ +'use strict'; + +/** + * Determines whether the specified URL is absolute + * + * @param {string} url The URL to test + * @returns {boolean} True if the specified URL is absolute, otherwise false + */ +module.exports = function isAbsoluteURL(url) { + // A URL is considered absolute if it begins with "://" or "//" (protocol-relative URL). + // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed + // by any combination of letters, digits, plus, period, or hyphen. + return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url); +}; diff --git a/node_modules/@shineiichijo/marika/node_modules/axios/lib/helpers/isAxiosError.js b/node_modules/@shineiichijo/marika/node_modules/axios/lib/helpers/isAxiosError.js new file mode 100644 index 000000000..a037bec5a --- /dev/null +++ b/node_modules/@shineiichijo/marika/node_modules/axios/lib/helpers/isAxiosError.js @@ -0,0 +1,13 @@ +'use strict'; + +var utils = require('./../utils'); + +/** + * Determines whether the payload is an error thrown by Axios + * + * @param {*} payload The value to test + * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false + */ +module.exports = function isAxiosError(payload) { + return utils.isObject(payload) && (payload.isAxiosError === true); +}; diff --git a/node_modules/@shineiichijo/marika/node_modules/axios/lib/helpers/isURLSameOrigin.js b/node_modules/@shineiichijo/marika/node_modules/axios/lib/helpers/isURLSameOrigin.js new file mode 100644 index 000000000..f1d89ad19 --- /dev/null +++ b/node_modules/@shineiichijo/marika/node_modules/axios/lib/helpers/isURLSameOrigin.js @@ -0,0 +1,68 @@ +'use strict'; + +var utils = require('./../utils'); + +module.exports = ( + utils.isStandardBrowserEnv() ? + + // Standard browser envs have full support of the APIs needed to test + // whether the request URL is of the same origin as current location. + (function standardBrowserEnv() { + var msie = /(msie|trident)/i.test(navigator.userAgent); + var urlParsingNode = document.createElement('a'); + var originURL; + + /** + * Parse a URL to discover it's components + * + * @param {String} url The URL to be parsed + * @returns {Object} + */ + function resolveURL(url) { + var href = url; + + if (msie) { + // IE needs attribute set twice to normalize properties + urlParsingNode.setAttribute('href', href); + href = urlParsingNode.href; + } + + urlParsingNode.setAttribute('href', href); + + // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils + return { + href: urlParsingNode.href, + protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '', + host: urlParsingNode.host, + search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, '') : '', + hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '', + hostname: urlParsingNode.hostname, + port: urlParsingNode.port, + pathname: (urlParsingNode.pathname.charAt(0) === '/') ? + urlParsingNode.pathname : + '/' + urlParsingNode.pathname + }; + } + + originURL = resolveURL(window.location.href); + + /** + * Determine if a URL shares the same origin as the current location + * + * @param {String} requestURL The URL to test + * @returns {boolean} True if URL shares the same origin, otherwise false + */ + return function isURLSameOrigin(requestURL) { + var parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL; + return (parsed.protocol === originURL.protocol && + parsed.host === originURL.host); + }; + })() : + + // Non standard browser envs (web workers, react-native) lack needed support. + (function nonStandardBrowserEnv() { + return function isURLSameOrigin() { + return true; + }; + })() +); diff --git a/node_modules/@shineiichijo/marika/node_modules/axios/lib/helpers/normalizeHeaderName.js b/node_modules/@shineiichijo/marika/node_modules/axios/lib/helpers/normalizeHeaderName.js new file mode 100644 index 000000000..738c9fe40 --- /dev/null +++ b/node_modules/@shineiichijo/marika/node_modules/axios/lib/helpers/normalizeHeaderName.js @@ -0,0 +1,12 @@ +'use strict'; + +var utils = require('../utils'); + +module.exports = function normalizeHeaderName(headers, normalizedName) { + utils.forEach(headers, function processHeader(value, name) { + if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) { + headers[normalizedName] = value; + delete headers[name]; + } + }); +}; diff --git a/node_modules/@shineiichijo/marika/node_modules/axios/lib/helpers/parseHeaders.js b/node_modules/@shineiichijo/marika/node_modules/axios/lib/helpers/parseHeaders.js new file mode 100644 index 000000000..8af2cc7f1 --- /dev/null +++ b/node_modules/@shineiichijo/marika/node_modules/axios/lib/helpers/parseHeaders.js @@ -0,0 +1,53 @@ +'use strict'; + +var utils = require('./../utils'); + +// Headers whose duplicates are ignored by node +// c.f. https://nodejs.org/api/http.html#http_message_headers +var ignoreDuplicateOf = [ + 'age', 'authorization', 'content-length', 'content-type', 'etag', + 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since', + 'last-modified', 'location', 'max-forwards', 'proxy-authorization', + 'referer', 'retry-after', 'user-agent' +]; + +/** + * Parse headers into an object + * + * ``` + * Date: Wed, 27 Aug 2014 08:58:49 GMT + * Content-Type: application/json + * Connection: keep-alive + * Transfer-Encoding: chunked + * ``` + * + * @param {String} headers Headers needing to be parsed + * @returns {Object} Headers parsed into an object + */ +module.exports = function parseHeaders(headers) { + var parsed = {}; + var key; + var val; + var i; + + if (!headers) { return parsed; } + + utils.forEach(headers.split('\n'), function parser(line) { + i = line.indexOf(':'); + key = utils.trim(line.substr(0, i)).toLowerCase(); + val = utils.trim(line.substr(i + 1)); + + if (key) { + if (parsed[key] && ignoreDuplicateOf.indexOf(key) >= 0) { + return; + } + if (key === 'set-cookie') { + parsed[key] = (parsed[key] ? parsed[key] : []).concat([val]); + } else { + parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val; + } + } + }); + + return parsed; +}; diff --git a/node_modules/@shineiichijo/marika/node_modules/axios/lib/helpers/spread.js b/node_modules/@shineiichijo/marika/node_modules/axios/lib/helpers/spread.js new file mode 100644 index 000000000..25e3cdd39 --- /dev/null +++ b/node_modules/@shineiichijo/marika/node_modules/axios/lib/helpers/spread.js @@ -0,0 +1,27 @@ +'use strict'; + +/** + * Syntactic sugar for invoking a function and expanding an array for arguments. + * + * Common use case would be to use `Function.prototype.apply`. + * + * ```js + * function f(x, y, z) {} + * var args = [1, 2, 3]; + * f.apply(null, args); + * ``` + * + * With `spread` this example can be re-written. + * + * ```js + * spread(function(x, y, z) {})([1, 2, 3]); + * ``` + * + * @param {Function} callback + * @returns {Function} + */ +module.exports = function spread(callback) { + return function wrap(arr) { + return callback.apply(null, arr); + }; +}; diff --git a/node_modules/@shineiichijo/marika/node_modules/axios/lib/helpers/toFormData.js b/node_modules/@shineiichijo/marika/node_modules/axios/lib/helpers/toFormData.js new file mode 100644 index 000000000..e21d0a7fa --- /dev/null +++ b/node_modules/@shineiichijo/marika/node_modules/axios/lib/helpers/toFormData.js @@ -0,0 +1,55 @@ +'use strict'; + +function combinedKey(parentKey, elKey) { + return parentKey + '.' + elKey; +} + +function buildFormData(formData, data, parentKey) { + if (Array.isArray(data)) { + data.forEach(function buildArray(el, i) { + buildFormData(formData, el, combinedKey(parentKey, i)); + }); + } else if ( + typeof data === 'object' && + !(data instanceof File || data === null) + ) { + Object.keys(data).forEach(function buildObject(key) { + buildFormData( + formData, + data[key], + parentKey ? combinedKey(parentKey, key) : key + ); + }); + } else { + if (data === undefined) { + return; + } + + var value = + typeof data === 'boolean' || typeof data === 'number' + ? data.toString() + : data; + formData.append(parentKey, value); + } +} + +/** + * convert a data object to FormData + * + * type FormDataPrimitive = string | Blob | number | boolean + * interface FormDataNest { + * [x: string]: FormVal + * } + * + * type FormVal = FormDataNest | FormDataPrimitive + * + * @param {FormVal} data + */ + +module.exports = function getFormData(data) { + var formData = new FormData(); + + buildFormData(formData, data); + + return formData; +}; diff --git a/node_modules/@shineiichijo/marika/node_modules/axios/lib/helpers/validator.js b/node_modules/@shineiichijo/marika/node_modules/axios/lib/helpers/validator.js new file mode 100644 index 000000000..a4ec4133e --- /dev/null +++ b/node_modules/@shineiichijo/marika/node_modules/axios/lib/helpers/validator.js @@ -0,0 +1,82 @@ +'use strict'; + +var VERSION = require('../env/data').version; + +var validators = {}; + +// eslint-disable-next-line func-names +['object', 'boolean', 'number', 'function', 'string', 'symbol'].forEach(function(type, i) { + validators[type] = function validator(thing) { + return typeof thing === type || 'a' + (i < 1 ? 'n ' : ' ') + type; + }; +}); + +var deprecatedWarnings = {}; + +/** + * Transitional option validator + * @param {function|boolean?} validator - set to false if the transitional option has been removed + * @param {string?} version - deprecated version / removed since version + * @param {string?} message - some message with additional info + * @returns {function} + */ +validators.transitional = function transitional(validator, version, message) { + function formatMessage(opt, desc) { + return '[Axios v' + VERSION + '] Transitional option \'' + opt + '\'' + desc + (message ? '. ' + message : ''); + } + + // eslint-disable-next-line func-names + return function(value, opt, opts) { + if (validator === false) { + throw new Error(formatMessage(opt, ' has been removed' + (version ? ' in ' + version : ''))); + } + + if (version && !deprecatedWarnings[opt]) { + deprecatedWarnings[opt] = true; + // eslint-disable-next-line no-console + console.warn( + formatMessage( + opt, + ' has been deprecated since v' + version + ' and will be removed in the near future' + ) + ); + } + + return validator ? validator(value, opt, opts) : true; + }; +}; + +/** + * Assert object's properties type + * @param {object} options + * @param {object} schema + * @param {boolean?} allowUnknown + */ + +function assertOptions(options, schema, allowUnknown) { + if (typeof options !== 'object') { + throw new TypeError('options must be an object'); + } + var keys = Object.keys(options); + var i = keys.length; + while (i-- > 0) { + var opt = keys[i]; + var validator = schema[opt]; + if (validator) { + var value = options[opt]; + var result = value === undefined || validator(value, opt, options); + if (result !== true) { + throw new TypeError('option ' + opt + ' must be ' + result); + } + continue; + } + if (allowUnknown !== true) { + throw Error('Unknown option ' + opt); + } + } +} + +module.exports = { + assertOptions: assertOptions, + validators: validators +}; diff --git a/node_modules/@shineiichijo/marika/node_modules/axios/lib/utils.js b/node_modules/@shineiichijo/marika/node_modules/axios/lib/utils.js new file mode 100644 index 000000000..f0f90432c --- /dev/null +++ b/node_modules/@shineiichijo/marika/node_modules/axios/lib/utils.js @@ -0,0 +1,349 @@ +'use strict'; + +var bind = require('./helpers/bind'); + +// utils is a library of generic helper functions non-specific to axios + +var toString = Object.prototype.toString; + +/** + * Determine if a value is an Array + * + * @param {Object} val The value to test + * @returns {boolean} True if value is an Array, otherwise false + */ +function isArray(val) { + return Array.isArray(val); +} + +/** + * Determine if a value is undefined + * + * @param {Object} val The value to test + * @returns {boolean} True if the value is undefined, otherwise false + */ +function isUndefined(val) { + return typeof val === 'undefined'; +} + +/** + * Determine if a value is a Buffer + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a Buffer, otherwise false + */ +function isBuffer(val) { + return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor) + && typeof val.constructor.isBuffer === 'function' && val.constructor.isBuffer(val); +} + +/** + * Determine if a value is an ArrayBuffer + * + * @param {Object} val The value to test + * @returns {boolean} True if value is an ArrayBuffer, otherwise false + */ +function isArrayBuffer(val) { + return toString.call(val) === '[object ArrayBuffer]'; +} + +/** + * Determine if a value is a FormData + * + * @param {Object} val The value to test + * @returns {boolean} True if value is an FormData, otherwise false + */ +function isFormData(val) { + return toString.call(val) === '[object FormData]'; +} + +/** + * Determine if a value is a view on an ArrayBuffer + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false + */ +function isArrayBufferView(val) { + var result; + if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) { + result = ArrayBuffer.isView(val); + } else { + result = (val) && (val.buffer) && (isArrayBuffer(val.buffer)); + } + return result; +} + +/** + * Determine if a value is a String + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a String, otherwise false + */ +function isString(val) { + return typeof val === 'string'; +} + +/** + * Determine if a value is a Number + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a Number, otherwise false + */ +function isNumber(val) { + return typeof val === 'number'; +} + +/** + * Determine if a value is an Object + * + * @param {Object} val The value to test + * @returns {boolean} True if value is an Object, otherwise false + */ +function isObject(val) { + return val !== null && typeof val === 'object'; +} + +/** + * Determine if a value is a plain Object + * + * @param {Object} val The value to test + * @return {boolean} True if value is a plain Object, otherwise false + */ +function isPlainObject(val) { + if (toString.call(val) !== '[object Object]') { + return false; + } + + var prototype = Object.getPrototypeOf(val); + return prototype === null || prototype === Object.prototype; +} + +/** + * Determine if a value is a Date + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a Date, otherwise false + */ +function isDate(val) { + return toString.call(val) === '[object Date]'; +} + +/** + * Determine if a value is a File + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a File, otherwise false + */ +function isFile(val) { + return toString.call(val) === '[object File]'; +} + +/** + * Determine if a value is a Blob + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a Blob, otherwise false + */ +function isBlob(val) { + return toString.call(val) === '[object Blob]'; +} + +/** + * Determine if a value is a Function + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a Function, otherwise false + */ +function isFunction(val) { + return toString.call(val) === '[object Function]'; +} + +/** + * Determine if a value is a Stream + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a Stream, otherwise false + */ +function isStream(val) { + return isObject(val) && isFunction(val.pipe); +} + +/** + * Determine if a value is a URLSearchParams object + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a URLSearchParams object, otherwise false + */ +function isURLSearchParams(val) { + return toString.call(val) === '[object URLSearchParams]'; +} + +/** + * Trim excess whitespace off the beginning and end of a string + * + * @param {String} str The String to trim + * @returns {String} The String freed of excess whitespace + */ +function trim(str) { + return str.trim ? str.trim() : str.replace(/^\s+|\s+$/g, ''); +} + +/** + * Determine if we're running in a standard browser environment + * + * This allows axios to run in a web worker, and react-native. + * Both environments support XMLHttpRequest, but not fully standard globals. + * + * web workers: + * typeof window -> undefined + * typeof document -> undefined + * + * react-native: + * navigator.product -> 'ReactNative' + * nativescript + * navigator.product -> 'NativeScript' or 'NS' + */ +function isStandardBrowserEnv() { + if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' || + navigator.product === 'NativeScript' || + navigator.product === 'NS')) { + return false; + } + return ( + typeof window !== 'undefined' && + typeof document !== 'undefined' + ); +} + +/** + * Iterate over an Array or an Object invoking a function for each item. + * + * If `obj` is an Array callback will be called passing + * the value, index, and complete array for each item. + * + * If 'obj' is an Object callback will be called passing + * the value, key, and complete object for each property. + * + * @param {Object|Array} obj The object to iterate + * @param {Function} fn The callback to invoke for each item + */ +function forEach(obj, fn) { + // Don't bother if no value provided + if (obj === null || typeof obj === 'undefined') { + return; + } + + // Force an array if not already something iterable + if (typeof obj !== 'object') { + /*eslint no-param-reassign:0*/ + obj = [obj]; + } + + if (isArray(obj)) { + // Iterate over array values + for (var i = 0, l = obj.length; i < l; i++) { + fn.call(null, obj[i], i, obj); + } + } else { + // Iterate over object keys + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) { + fn.call(null, obj[key], key, obj); + } + } + } +} + +/** + * Accepts varargs expecting each argument to be an object, then + * immutably merges the properties of each object and returns result. + * + * When multiple objects contain the same key the later object in + * the arguments list will take precedence. + * + * Example: + * + * ```js + * var result = merge({foo: 123}, {foo: 456}); + * console.log(result.foo); // outputs 456 + * ``` + * + * @param {Object} obj1 Object to merge + * @returns {Object} Result of all merge properties + */ +function merge(/* obj1, obj2, obj3, ... */) { + var result = {}; + function assignValue(val, key) { + if (isPlainObject(result[key]) && isPlainObject(val)) { + result[key] = merge(result[key], val); + } else if (isPlainObject(val)) { + result[key] = merge({}, val); + } else if (isArray(val)) { + result[key] = val.slice(); + } else { + result[key] = val; + } + } + + for (var i = 0, l = arguments.length; i < l; i++) { + forEach(arguments[i], assignValue); + } + return result; +} + +/** + * Extends object a by mutably adding to it the properties of object b. + * + * @param {Object} a The object to be extended + * @param {Object} b The object to copy properties from + * @param {Object} thisArg The object to bind function to + * @return {Object} The resulting value of object a + */ +function extend(a, b, thisArg) { + forEach(b, function assignValue(val, key) { + if (thisArg && typeof val === 'function') { + a[key] = bind(val, thisArg); + } else { + a[key] = val; + } + }); + return a; +} + +/** + * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM) + * + * @param {string} content with BOM + * @return {string} content value without BOM + */ +function stripBOM(content) { + if (content.charCodeAt(0) === 0xFEFF) { + content = content.slice(1); + } + return content; +} + +module.exports = { + isArray: isArray, + isArrayBuffer: isArrayBuffer, + isBuffer: isBuffer, + isFormData: isFormData, + isArrayBufferView: isArrayBufferView, + isString: isString, + isNumber: isNumber, + isObject: isObject, + isPlainObject: isPlainObject, + isUndefined: isUndefined, + isDate: isDate, + isFile: isFile, + isBlob: isBlob, + isFunction: isFunction, + isStream: isStream, + isURLSearchParams: isURLSearchParams, + isStandardBrowserEnv: isStandardBrowserEnv, + forEach: forEach, + merge: merge, + extend: extend, + trim: trim, + stripBOM: stripBOM +}; diff --git a/node_modules/@shineiichijo/marika/node_modules/axios/package.json b/node_modules/@shineiichijo/marika/node_modules/axios/package.json new file mode 100644 index 000000000..32c275c3e --- /dev/null +++ b/node_modules/@shineiichijo/marika/node_modules/axios/package.json @@ -0,0 +1,86 @@ +{ + "name": "axios", + "version": "0.26.1", + "description": "Promise based HTTP client for the browser and node.js", + "main": "index.js", + "types": "index.d.ts", + "scripts": { + "test": "grunt test && dtslint", + "start": "node ./sandbox/server.js", + "build": "NODE_ENV=production grunt build", + "preversion": "grunt version && npm test", + "version": "npm run build && git add -A dist && git add CHANGELOG.md bower.json package.json", + "postversion": "git push && git push --tags", + "examples": "node ./examples/server.js", + "coveralls": "cat coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js", + "fix": "eslint --fix lib/**/*.js" + }, + "repository": { + "type": "git", + "url": "https://github.com/axios/axios.git" + }, + "keywords": [ + "xhr", + "http", + "ajax", + "promise", + "node" + ], + "author": "Matt Zabriskie", + "license": "MIT", + "bugs": { + "url": "https://github.com/axios/axios/issues" + }, + "homepage": "https://axios-http.com", + "devDependencies": { + "abortcontroller-polyfill": "^1.5.0", + "coveralls": "^3.0.0", + "dtslint": "^4.1.6", + "es6-promise": "^4.2.4", + "grunt": "^1.3.0", + "grunt-banner": "^0.6.0", + "grunt-cli": "^1.2.0", + "grunt-contrib-clean": "^1.1.0", + "grunt-contrib-watch": "^1.0.0", + "grunt-eslint": "^23.0.0", + "grunt-karma": "^4.0.0", + "grunt-mocha-test": "^0.13.3", + "grunt-webpack": "^4.0.2", + "istanbul-instrumenter-loader": "^1.0.0", + "jasmine-core": "^2.4.1", + "karma": "^6.3.2", + "karma-chrome-launcher": "^3.1.0", + "karma-firefox-launcher": "^2.1.0", + "karma-jasmine": "^1.1.1", + "karma-jasmine-ajax": "^0.1.13", + "karma-safari-launcher": "^1.0.0", + "karma-sauce-launcher": "^4.3.6", + "karma-sinon": "^1.0.5", + "karma-sourcemap-loader": "^0.3.8", + "karma-webpack": "^4.0.2", + "load-grunt-tasks": "^3.5.2", + "minimist": "^1.2.0", + "mocha": "^8.2.1", + "sinon": "^4.5.0", + "terser-webpack-plugin": "^4.2.3", + "typescript": "^4.0.5", + "url-search-params": "^0.10.0", + "webpack": "^4.44.2", + "webpack-dev-server": "^3.11.0" + }, + "browser": { + "./lib/adapters/http.js": "./lib/adapters/xhr.js" + }, + "jsdelivr": "dist/axios.min.js", + "unpkg": "dist/axios.min.js", + "typings": "./index.d.ts", + "dependencies": { + "follow-redirects": "^1.14.8" + }, + "bundlesize": [ + { + "path": "./dist/axios.min.js", + "threshold": "5kB" + } + ] +} diff --git a/node_modules/@shineiichijo/marika/node_modules/axios/tsconfig.json b/node_modules/@shineiichijo/marika/node_modules/axios/tsconfig.json new file mode 100644 index 000000000..666518825 --- /dev/null +++ b/node_modules/@shineiichijo/marika/node_modules/axios/tsconfig.json @@ -0,0 +1,14 @@ +{ + "compilerOptions": { + "module": "es2015", + "lib": ["dom", "es2015"], + "types": [], + "moduleResolution": "node", + "strict": true, + "noEmit": true, + "baseUrl": ".", + "paths": { + "axios": ["."] + } + } +} diff --git a/node_modules/@shineiichijo/marika/node_modules/axios/tslint.json b/node_modules/@shineiichijo/marika/node_modules/axios/tslint.json new file mode 100644 index 000000000..3ec44a760 --- /dev/null +++ b/node_modules/@shineiichijo/marika/node_modules/axios/tslint.json @@ -0,0 +1,6 @@ +{ + "extends": "dtslint/dtslint.json", + "rules": { + "no-unnecessary-generics": false + } +} diff --git a/node_modules/@shineiichijo/marika/package.json b/node_modules/@shineiichijo/marika/package.json new file mode 100644 index 000000000..f691b6df7 --- /dev/null +++ b/node_modules/@shineiichijo/marika/package.json @@ -0,0 +1,46 @@ +{ + "name": "@shineiichijo/marika", + "version": "2.0.3", + "description": "An API wrapper for the unofficial MyAnimeList API jikan.moe v4", + "main": "dist/index.js", + "types": "dist/index.d.ts", + "dependencies": { + "axios": "^0.26.0" + }, + "scripts": { + "build": "yarn rimraf dist/ && yarn tsc", + "lint": "eslint . --ignore-path .gitignore --ext .ts", + "lint:fix": "eslint . --ignore-path .gitignore --ext .ts --fix", + "format": "prettier --write --config .prettierrc.json \"src/**/*.ts\"" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/ShineiIchijo/Marika.git" + }, + "keywords": [ + "anime", + "manga", + "anime-character", + "jikan", + "jikan-moe", + "myanimelist", + "MAL" + ], + "author": "Shinei Ichijo", + "license": "MIT", + "bugs": { + "url": "https://github.com/ShineiIchijo/Marika/issues" + }, + "homepage": "https://github.com/ShineiIchijo/Marika", + "devDependencies": { + "@types/axios": "^0.14.0", + "@types/mocha": "^9.1.0", + "@types/node": "^17.0.17", + "@typescript-eslint/eslint-plugin": "^5.10.2", + "@typescript-eslint/parser": "^5.10.2", + "eslint": "^8.8.0", + "mocha": "^9.2.0", + "ts-node": "^10.4.0", + "typescript": "^4.5.5" + } +} diff --git a/node_modules/@shineiichijo/nhentai-pdf/LICENSE b/node_modules/@shineiichijo/nhentai-pdf/LICENSE new file mode 100644 index 000000000..0ad25db4b --- /dev/null +++ b/node_modules/@shineiichijo/nhentai-pdf/LICENSE @@ -0,0 +1,661 @@ + GNU AFFERO GENERAL PUBLIC LICENSE + Version 3, 19 November 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU Affero General Public License is a free, copyleft license for +software and other kinds of works, specifically designed to ensure +cooperation with the community in the case of network server software. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +our General Public Licenses are intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + Developers that use our General Public Licenses protect your rights +with two steps: (1) assert copyright on the software, and (2) offer +you this License which gives you legal permission to copy, distribute +and/or modify the software. + + A secondary benefit of defending all users' freedom is that +improvements made in alternate versions of the program, if they +receive widespread use, become available for other developers to +incorporate. Many developers of free software are heartened and +encouraged by the resulting cooperation. However, in the case of +software used on network servers, this result may fail to come about. +The GNU General Public License permits making a modified version and +letting the public access it on a server without ever releasing its +source code to the public. + + The GNU Affero General Public License is designed specifically to +ensure that, in such cases, the modified source code becomes available +to the community. It requires the operator of a network server to +provide the source code of the modified version running there to the +users of that server. Therefore, public use of a modified version, on +a publicly accessible server, gives the public access to the source +code of the modified version. + + An older license, called the Affero General Public License and +published by Affero, was designed to accomplish similar goals. This is +a different license, not a version of the Affero GPL, but Affero has +released a new version of the Affero GPL which permits relicensing under +this license. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU Affero General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Remote Network Interaction; Use with the GNU General Public License. + + Notwithstanding any other provision of this License, if you modify the +Program, your modified version must prominently offer all users +interacting with it remotely through a computer network (if your version +supports such interaction) an opportunity to receive the Corresponding +Source of your version by providing access to the Corresponding Source +from a network server at no charge, through some standard or customary +means of facilitating copying of software. This Corresponding Source +shall include the Corresponding Source for any work covered by version 3 +of the GNU General Public License that is incorporated pursuant to the +following paragraph. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the work with which it is combined will remain governed by version +3 of the GNU General Public License. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU Affero General Public License from time to time. Such new versions +will be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU Affero General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU Affero General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU Affero General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published + by the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If your software can interact with users remotely through a computer +network, you should also make sure that it provides a way for users to +get its source. For example, if your program is a web application, its +interface could display a "Source" link that leads users to an archive +of the code. There are many ways you could offer source, and different +solutions will be better for different programs; see section 13 for the +specific requirements. + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU AGPL, see +. diff --git a/node_modules/@shineiichijo/nhentai-pdf/README.md b/node_modules/@shineiichijo/nhentai-pdf/README.md new file mode 100644 index 000000000..22a53405a --- /dev/null +++ b/node_modules/@shineiichijo/nhentai-pdf/README.md @@ -0,0 +1,32 @@ +# nhentai-pdf + +## I don't own this project. This is just a fork of [nhentai-pdf](https://www.npmjs.com/package/nhentai-pdf) + +### NPM package to be used for getting the holy numbers in pdf 🌚 Welcome to the Darkness + +## Methods Availables: + +### validate: + + it checks if the doujin exists. + returns boolean + +### fetch: + + it fetches the doujin information. + returns a promise + +### save: + + it sends the buffer as a pdf. + returns a promise + +Usage: + +```javascript +const { Doujin } = require('@shineiichijo/nhentai-pdf') +const doujin = new Doujin('https://nhentai.net/g/366327/') +doujin.validate().then(console.log) +doujin.fetch().then(console.log) +doujin.save().then(console.log) +``` diff --git a/node_modules/@shineiichijo/nhentai-pdf/dist/index.d.ts b/node_modules/@shineiichijo/nhentai-pdf/dist/index.d.ts new file mode 100644 index 000000000..8d778fe49 --- /dev/null +++ b/node_modules/@shineiichijo/nhentai-pdf/dist/index.d.ts @@ -0,0 +1,3 @@ +export { default } from './lib/Doujin'; +export { default as Doujin } from './lib/Doujin'; +export * from './lib/PDF'; diff --git a/node_modules/@shineiichijo/nhentai-pdf/dist/index.js b/node_modules/@shineiichijo/nhentai-pdf/dist/index.js new file mode 100644 index 000000000..20db76cf6 --- /dev/null +++ b/node_modules/@shineiichijo/nhentai-pdf/dist/index.js @@ -0,0 +1,21 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Doujin = exports.default = void 0; +var Doujin_1 = require("./lib/Doujin"); +Object.defineProperty(exports, "default", { enumerable: true, get: function () { return __importDefault(Doujin_1).default; } }); +var Doujin_2 = require("./lib/Doujin"); +Object.defineProperty(exports, "Doujin", { enumerable: true, get: function () { return __importDefault(Doujin_2).default; } }); +__exportStar(require("./lib/PDF"), exports); diff --git a/node_modules/@shineiichijo/nhentai-pdf/dist/lib/Decorators/ValidateID.d.ts b/node_modules/@shineiichijo/nhentai-pdf/dist/lib/Decorators/ValidateID.d.ts new file mode 100644 index 000000000..dfb241a79 --- /dev/null +++ b/node_modules/@shineiichijo/nhentai-pdf/dist/lib/Decorators/ValidateID.d.ts @@ -0,0 +1,3 @@ +import Doujin from '../Doujin'; +declare const ValidateID: () => (target: Doujin, key: keyof Doujin) => void; +export default ValidateID; diff --git a/node_modules/@shineiichijo/nhentai-pdf/dist/lib/Decorators/ValidateID.js b/node_modules/@shineiichijo/nhentai-pdf/dist/lib/Decorators/ValidateID.js new file mode 100644 index 000000000..7b0f974da --- /dev/null +++ b/node_modules/@shineiichijo/nhentai-pdf/dist/lib/Decorators/ValidateID.js @@ -0,0 +1,18 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const ValidateID = () => { + return (target, key) => { + let value = target[key]; + const get = () => value; + const set = (id) => { + value = id.trim().replace(/(https?:\/\/nhentai\.net\/g\/)(\d+)\/?/, '$2'); + }; + Object.defineProperty(target, key, { + get, + set, + enumerable: true, + configurable: true + }); + }; +}; +exports.default = ValidateID; diff --git a/node_modules/@shineiichijo/nhentai-pdf/dist/lib/Doujin.d.ts b/node_modules/@shineiichijo/nhentai-pdf/dist/lib/Doujin.d.ts new file mode 100644 index 000000000..38afcaf4f --- /dev/null +++ b/node_modules/@shineiichijo/nhentai-pdf/dist/lib/Doujin.d.ts @@ -0,0 +1,28 @@ +/// +import { EventEmitter } from 'events'; +export default class Doujin extends EventEmitter { + id: string; + private _info; + constructor(id: string); + get info(): IDoujinInfo; + private get _url(); + validate: () => Promise; + fetch: () => Promise; + pdf: (filename?: string | undefined) => Promise; + save: (filename?: string | undefined) => Promise; +} +export interface IDoujinInfo { + title: string; + details: { + parodies: string[]; + characters: string[]; + tags: string[]; + artists: string[]; + groups: string[]; + languages: string[]; + categories: string[]; + pages: number; + }; + pages: string[]; + link: string; +} diff --git a/node_modules/@shineiichijo/nhentai-pdf/dist/lib/Doujin.js b/node_modules/@shineiichijo/nhentai-pdf/dist/lib/Doujin.js new file mode 100644 index 000000000..45d2bb109 --- /dev/null +++ b/node_modules/@shineiichijo/nhentai-pdf/dist/lib/Doujin.js @@ -0,0 +1,71 @@ +"use strict"; +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const axios_1 = __importDefault(require("axios")); +const events_1 = require("events"); +const parse_1 = __importDefault(require("./parse")); +const ValidateID_1 = __importDefault(require("./Decorators/ValidateID")); +const fetcher_1 = __importDefault(require("./Utils/fetcher")); +const PDF_1 = require("./PDF"); +const promises_1 = require("fs/promises"); +class Doujin extends events_1.EventEmitter { + constructor(id) { + super(); + this._info = null; + this.validate = () => axios_1.default + .get(this._url) + .then(() => true) + .catch(() => false); + this.fetch = () => __awaiter(this, void 0, void 0, function* () { + const result = yield (0, fetcher_1.default)('get')(this._url, 'json'); + this._info = (0, parse_1.default)(result, this._url); + return this.info; + }); + this.pdf = (filename) => __awaiter(this, void 0, void 0, function* () { + if (!this._info) + yield this.fetch(); + const PDF = new PDF_1.Document(yield (yield this.fetch()).pages, 'A4'); + const buffer = yield PDF.build(); + if (filename) + yield (0, promises_1.writeFile)(filename, buffer); + return buffer; + }); + this.save = (filename) => __awaiter(this, void 0, void 0, function* () { + if (!this._info) + yield this.fetch(); + filename = filename || `${this.info.title}.pdf`; + yield this.pdf(filename); + return filename; + }); + this.id = id; + } + get info() { + if (!this._info) + throw new Error('Invalid'); + return this._info; + } + get _url() { + return `https://nhentai.net/g/${this.id}`; + } +} +__decorate([ + (0, ValidateID_1.default)() +], Doujin.prototype, "id", void 0); +exports.default = Doujin; diff --git a/node_modules/@shineiichijo/nhentai-pdf/dist/lib/PDF/Document.d.ts b/node_modules/@shineiichijo/nhentai-pdf/dist/lib/PDF/Document.d.ts new file mode 100644 index 000000000..574748b59 --- /dev/null +++ b/node_modules/@shineiichijo/nhentai-pdf/dist/lib/PDF/Document.d.ts @@ -0,0 +1,8 @@ +/// +import sizes from './sizes.json'; +export declare class Document { + pages: string[]; + size: keyof typeof sizes; + constructor(pages: string[], size?: keyof typeof sizes); + build: () => Promise; +} diff --git a/node_modules/@shineiichijo/nhentai-pdf/dist/lib/PDF/Document.js b/node_modules/@shineiichijo/nhentai-pdf/dist/lib/PDF/Document.js new file mode 100644 index 000000000..4bc7904c6 --- /dev/null +++ b/node_modules/@shineiichijo/nhentai-pdf/dist/lib/PDF/Document.js @@ -0,0 +1,52 @@ +"use strict"; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Document = void 0; +const pdfkit_1 = __importDefault(require("pdfkit")); +const sizes_json_1 = __importDefault(require("./sizes.json")); +const fs_1 = require("fs"); +const download_1 = __importDefault(require("../Utils/download")); +const os_1 = require("os"); +class Document { + constructor(pages, size = 'A4') { + this.pages = pages; + this.size = size; + this.build = () => __awaiter(this, void 0, void 0, function* () { + const document = new pdfkit_1.default({ margin: 0, size: sizes_json_1.default[this.size] }); + for (const image of this.pages) { + const file = (0, fs_1.existsSync)(image) ? image : yield (0, download_1.default)(image); + document.image(file, 0, 0, { + fit: sizes_json_1.default[this.size], + align: 'center', + valign: 'center' + }); + if (this.pages.indexOf(image) === this.pages.length - 1) + break; + else + document.addPage(); + } + document.end(); + const filename = `${(0, os_1.tmpdir)()}/${this.size}_${Math.random().toString()}.pdf`; + const stream = (0, fs_1.createWriteStream)(filename); + document.pipe(stream); + yield new Promise((resolve, reject) => { + stream.on('finish', () => resolve(filename)); + stream.on('error', reject); + }); + const buffer = yield fs_1.promises.readFile(filename); + return buffer; + }); + } +} +exports.Document = Document; diff --git a/node_modules/@shineiichijo/nhentai-pdf/dist/lib/PDF/index.d.ts b/node_modules/@shineiichijo/nhentai-pdf/dist/lib/PDF/index.d.ts new file mode 100644 index 000000000..b8bb013b8 --- /dev/null +++ b/node_modules/@shineiichijo/nhentai-pdf/dist/lib/PDF/index.d.ts @@ -0,0 +1,2 @@ +export { default as sizes } from './sizes.json'; +export * from './Document'; diff --git a/node_modules/@shineiichijo/nhentai-pdf/dist/lib/PDF/index.js b/node_modules/@shineiichijo/nhentai-pdf/dist/lib/PDF/index.js new file mode 100644 index 000000000..9f41bed77 --- /dev/null +++ b/node_modules/@shineiichijo/nhentai-pdf/dist/lib/PDF/index.js @@ -0,0 +1,19 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.sizes = void 0; +var sizes_json_1 = require("./sizes.json"); +Object.defineProperty(exports, "sizes", { enumerable: true, get: function () { return __importDefault(sizes_json_1).default; } }); +__exportStar(require("./Document"), exports); diff --git a/node_modules/@shineiichijo/nhentai-pdf/dist/lib/PDF/sizes.json b/node_modules/@shineiichijo/nhentai-pdf/dist/lib/PDF/sizes.json new file mode 100644 index 000000000..73db586e6 --- /dev/null +++ b/node_modules/@shineiichijo/nhentai-pdf/dist/lib/PDF/sizes.json @@ -0,0 +1,52 @@ +{ + "4A0": [4767.87, 6740.79], + "2A0": [3370.39, 4767.87], + "A0": [2383.94, 3370.39], + "A1": [1683.78, 2383.94], + "A2": [1190.55, 1683.78], + "A3": [841.89, 1190.55], + "A4": [595.28, 841.89], + "A5": [419.53, 595.28], + "A6": [297.64, 419.53], + "A7": [209.76, 297.64], + "A8": [147.40, 209.76], + "A9": [104.88, 147.40], + "A10": [73.70, 104.88], + "B0": [2834.65, 4008.19], + "B1": [2004.09, 2834.65], + "B2": [1417.32, 2004.09], + "B3": [1000.63, 1417.32], + "B4": [708.66, 1000.63], + "B5": [498.90, 708.66], + "B6": [354.33, 498.90], + "B7": [249.45, 354.33], + "B8": [175.75, 249.45], + "B9": [124.72, 175.75], + "B10": [87.87, 124.72], + "C0": [2599.37, 3676.54], + "C1": [1836.85, 2599.37], + "C2": [1298.27, 1836.85], + "C3": [918.43, 1298.27], + "C4": [649.13, 918.43], + "C5": [459.21, 649.13], + "C6": [323.15, 459.21], + "C7": [229.61, 323.15], + "C8": [161.57, 229.61], + "C9": [113.39, 161.57], + "C10": [79.37, 113.39], + "RA0": [2437.80, 3458.27], + "RA1": [1729.13, 2437.80], + "RA2": [1218.90, 1729.13], + "RA3": [864.57, 1218.90], + "RA4": [609.45, 864.57], + "SRA0": [2551.18, 3628.35], + "SRA1": [1814.17, 2551.18], + "SRA2": [1275.59, 1814.17], + "SRA3": [907.09, 1275.59], + "SRA4": [637.80, 907.09], + "EXECUTIVE": [521.86, 756.00], + "FOLIO": [612.00, 936.00], + "LEGAL": [612.00, 1008.00], + "LETTER": [612.00, 792.00], + "TABLOID": [792.00, 1224.00] +} diff --git a/node_modules/@shineiichijo/nhentai-pdf/dist/lib/Utils/download.d.ts b/node_modules/@shineiichijo/nhentai-pdf/dist/lib/Utils/download.d.ts new file mode 100644 index 000000000..d5b551ea6 --- /dev/null +++ b/node_modules/@shineiichijo/nhentai-pdf/dist/lib/Utils/download.d.ts @@ -0,0 +1,2 @@ +declare const download: (url: string, filename?: string) => Promise; +export default download; diff --git a/node_modules/@shineiichijo/nhentai-pdf/dist/lib/Utils/download.js b/node_modules/@shineiichijo/nhentai-pdf/dist/lib/Utils/download.js new file mode 100644 index 000000000..c98de6d2a --- /dev/null +++ b/node_modules/@shineiichijo/nhentai-pdf/dist/lib/Utils/download.js @@ -0,0 +1,27 @@ +"use strict"; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const fetcher_1 = __importDefault(require("./fetcher")); +const promises_1 = require("fs/promises"); +const os_1 = require("os"); +const fileformat = (url) => { + const array = url.split('/'); + return array[array.length - 1].split('.')[1]; +}; +const download = (url, filename = `${(0, os_1.tmpdir)()}/${Math.random().toString()}.${fileformat(url)}`) => __awaiter(void 0, void 0, void 0, function* () { + const image = yield (0, fetcher_1.default)('get')(url, 'arraybuffer'); + yield (0, promises_1.writeFile)(filename, image); + return filename; +}); +exports.default = download; diff --git a/node_modules/@shineiichijo/nhentai-pdf/dist/lib/Utils/fetcher.d.ts b/node_modules/@shineiichijo/nhentai-pdf/dist/lib/Utils/fetcher.d.ts new file mode 100644 index 000000000..77524f3bc --- /dev/null +++ b/node_modules/@shineiichijo/nhentai-pdf/dist/lib/Utils/fetcher.d.ts @@ -0,0 +1,10 @@ +/// +declare type Headers = { + [Header: string]: string; +}; +declare const get: (url: string, type: T, headers?: Headers | undefined) => Promise; +declare const post: (url: string, data: string, headers?: Headers | undefined) => Promise; +declare const fetcher: (method: M) => Method; +export default fetcher; +declare type Methods = 'get' | 'post'; +declare type Method = M extends 'post' ? typeof post : typeof get; diff --git a/node_modules/@shineiichijo/nhentai-pdf/dist/lib/Utils/fetcher.js b/node_modules/@shineiichijo/nhentai-pdf/dist/lib/Utils/fetcher.js new file mode 100644 index 000000000..6fad358c8 --- /dev/null +++ b/node_modules/@shineiichijo/nhentai-pdf/dist/lib/Utils/fetcher.js @@ -0,0 +1,24 @@ +"use strict"; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const axios_1 = __importDefault(require("axios")); +const get = (url, type, headers) => __awaiter(void 0, void 0, void 0, function* () { + return (yield axios_1.default.get(url, { + headers, + responseType: type + })).data; +}); +const post = (url, data, headers) => __awaiter(void 0, void 0, void 0, function* () { return (yield axios_1.default.post(url, data, { headers })).data; }); +const fetcher = (method) => (method === 'post' ? post : get); +exports.default = fetcher; diff --git a/node_modules/@shineiichijo/nhentai-pdf/dist/lib/parse.d.ts b/node_modules/@shineiichijo/nhentai-pdf/dist/lib/parse.d.ts new file mode 100644 index 000000000..863aa21ce --- /dev/null +++ b/node_modules/@shineiichijo/nhentai-pdf/dist/lib/parse.d.ts @@ -0,0 +1,3 @@ +import { IDoujinInfo } from './Doujin'; +declare const parse: (text: string, link: string) => IDoujinInfo; +export default parse; diff --git a/node_modules/@shineiichijo/nhentai-pdf/dist/lib/parse.js b/node_modules/@shineiichijo/nhentai-pdf/dist/lib/parse.js new file mode 100644 index 000000000..2de57782a --- /dev/null +++ b/node_modules/@shineiichijo/nhentai-pdf/dist/lib/parse.js @@ -0,0 +1,44 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const cheerio_1 = __importDefault(require("cheerio")); +const parse = (text, link) => { + const parseText = (text) => text + .split(/[0-9]K/g) + .join('10') + .split(/\d/g) + .filter((tag) => tag); + const $ = cheerio_1.default.load(text); + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const details = {}; + $('.tag-container.field-name') + .text() + .split('\n') + .map((string) => string.trim()) + .filter((u) => u) + .map((tag, i, tags) => { + if (tag.endsWith(':') && !tags[i + 1].endsWith(':')) + details[tag.substring(0, tag.length - 1).toLowerCase()] = tags[i + 1] + .replace(/(\([0-9]+\))([a-zA-Z])/g, '$1 $2') + .split(/(?<=\))\s(?=[a-zA-Z])/); + }); + for (const key of ['parodies', 'tags', 'languages', 'characters', 'categories', 'groups', 'artists']) + details[key] = parseText((details[key] || [''])[0]); + details.pages = Number(details.pages[0] || 0); + details.uploaded = details.uploaded[0]; + return { + title: $('#info').find('h1').text(), + details: details, + pages: Object.entries($('.gallerythumb').find('img')) + .map((image) => { + return image[1].attribs + ? image[1].attribs['data-src'].replace(/t(\.(jpg|png))/, '$1').replace('t.nhentai', 'i.nhentai') + : null; + }) + .filter((link) => link), + link + }; +}; +exports.default = parse; diff --git a/node_modules/@shineiichijo/nhentai-pdf/node_modules/axios/CHANGELOG.md b/node_modules/@shineiichijo/nhentai-pdf/node_modules/axios/CHANGELOG.md new file mode 100644 index 000000000..5e2b3d079 --- /dev/null +++ b/node_modules/@shineiichijo/nhentai-pdf/node_modules/axios/CHANGELOG.md @@ -0,0 +1,775 @@ +# Changelog + +### 0.21.4 (September 6, 2021) + +Fixes and Functionality: +- Fixing JSON transform when data is stringified. Providing backward compatibility and complying to the JSON RFC standard ([#4020](https://github.com/axios/axios/pull/4020)) + +Huge thanks to everyone who contributed to this release via code (authors listed below) or via reviews and triaging on GitHub: + +- [Jay](mailto:jasonsaayman@gmail.com) +- [Guillaume Fortaine](https://github.com/gfortaine) +- [Yusuke Kawasaki](https://github.com/kawanet) +- [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS) + +### 0.21.3 (September 4, 2021) + +Fixes and Functionality: +- Fixing response interceptor not being called when request interceptor is attached ([#4013](https://github.com/axios/axios/pull/4013)) + +Huge thanks to everyone who contributed to this release via code (authors listed below) or via reviews and triaging on GitHub: + +- [Jay](mailto:jasonsaayman@gmail.com) +- [Julian Hollmann](https://github.com/nerdbeere) + +### 0.21.2 (September 4, 2021) + +Fixes and Functionality: + +- Updating axios requests to be delayed by pre-emptive promise creation ([#2702](https://github.com/axios/axios/pull/2702)) +- Adding "synchronous" and "runWhen" options to interceptors api ([#2702](https://github.com/axios/axios/pull/2702)) +- Updating of transformResponse ([#3377](https://github.com/axios/axios/pull/3377)) +- Adding ability to omit User-Agent header ([#3703](https://github.com/axios/axios/pull/3703)) +- Adding multiple JSON improvements ([#3688](https://github.com/axios/axios/pull/3688), [#3763](https://github.com/axios/axios/pull/3763)) +- Fixing quadratic runtime and extra memory usage when setting a maxContentLength ([#3738](https://github.com/axios/axios/pull/3738)) +- Adding parseInt to config.timeout ([#3781](https://github.com/axios/axios/pull/3781)) +- Adding custom return type support to interceptor ([#3783](https://github.com/axios/axios/pull/3783)) +- Adding security fix for ReDoS vulnerability ([#3980](https://github.com/axios/axios/pull/3980)) + +Internal and Tests: + +- Updating build dev dependancies ([#3401](https://github.com/axios/axios/pull/3401)) +- Fixing builds running on Travis CI ([#3538](https://github.com/axios/axios/pull/3538)) +- Updating follow rediect version ([#3694](https://github.com/axios/axios/pull/3694), [#3771](https://github.com/axios/axios/pull/3771)) +- Updating karma sauce launcher to fix failing sauce tests ([#3712](https://github.com/axios/axios/pull/3712), [#3717](https://github.com/axios/axios/pull/3717)) +- Updating content-type header for application/json to not contain charset field, according do RFC 8259 ([#2154](https://github.com/axios/axios/pull/2154)) +- Fixing tests by bumping karma-sauce-launcher version ([#3813](https://github.com/axios/axios/pull/3813)) +- Changing testing process from Travis CI to GitHub Actions ([#3938](https://github.com/axios/axios/pull/3938)) + +Documentation: + +- Updating documentation around the use of `AUTH_TOKEN` with multiple domain endpoints ([#3539](https://github.com/axios/axios/pull/3539)) +- Remove duplication of item in changelog ([#3523](https://github.com/axios/axios/pull/3523)) +- Fixing gramatical errors ([#2642](https://github.com/axios/axios/pull/2642)) +- Fixing spelling error ([#3567](https://github.com/axios/axios/pull/3567)) +- Moving gitpod metion ([#2637](https://github.com/axios/axios/pull/2637)) +- Adding new axios documentation website link ([#3681](https://github.com/axios/axios/pull/3681), [#3707](https://github.com/axios/axios/pull/3707)) +- Updating documentation around dispatching requests ([#3772](https://github.com/axios/axios/pull/3772)) +- Adding documentation for the type guard isAxiosError ([#3767](https://github.com/axios/axios/pull/3767)) +- Adding explanation of cancel token ([#3803](https://github.com/axios/axios/pull/3803)) +- Updating CI status badge ([#3953](https://github.com/axios/axios/pull/3953)) +- Fixing errors with JSON documentation ([#3936](https://github.com/axios/axios/pull/3936)) +- Fixing README typo under Request Config ([#3825](https://github.com/axios/axios/pull/3825)) +- Adding axios-multi-api to the ecosystem file ([#3817](https://github.com/axios/axios/pull/3817)) +- Adding SECURITY.md to properly disclose security vulnerabilities ([#3981](https://github.com/axios/axios/pull/3981)) + +Huge thanks to everyone who contributed to this release via code (authors listed below) or via reviews and triaging on GitHub: + +- [Jay](mailto:jasonsaayman@gmail.com) +- [Sasha Korotkov](https://github.com/SashaKoro) +- [Daniel Lopretto](https://github.com/timemachine3030) +- [Mike Bishop](https://github.com/MikeBishop) +- [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS) +- [Mark](https://github.com/bimbiltu) +- [Philipe Gouveia Paixão](https://github.com/piiih) +- [hippo](https://github.com/hippo2cat) +- [ready-research](https://github.com/ready-research) +- [Xianming Zhong](https://github.com/chinesedfan) +- [Christopher Chrapka](https://github.com/OJezu) +- [Brian Anglin](https://github.com/anglinb) +- [Kohta Ito](https://github.com/koh110) +- [Ali Clark](https://github.com/aliclark) +- [caikan](https://github.com/caikan) +- [Elina Gorshkova](https://github.com/elinagorshkova) +- [Ryota Ikezawa](https://github.com/paveg) +- [Nisar Hassan Naqvi](https://github.com/nisarhassan12) +- [Jake](https://github.com/codemaster138) +- [TagawaHirotaka](https://github.com/wafuwafu13) +- [Johannes Jarbratt](https://github.com/johachi) +- [Mo Sattler](https://github.com/MoSattler) +- [Sam Carlton](https://github.com/ThatGuySam) +- [Matt Czapliński](https://github.com/MattCCC) +- [Ziding Zhang](https://github.com/zidingz) + +### 0.21.1 (December 21, 2020) + +Fixes and Functionality: + +- Hotfix: Prevent SSRF ([#3410](https://github.com/axios/axios/pull/3410)) +- Protocol not parsed when setting proxy config from env vars ([#3070](https://github.com/axios/axios/pull/3070)) +- Updating axios in types to be lower case ([#2797](https://github.com/axios/axios/pull/2797)) +- Adding a type guard for `AxiosError` ([#2949](https://github.com/axios/axios/pull/2949)) + +Internal and Tests: + +- Remove the skipping of the `socket` http test ([#3364](https://github.com/axios/axios/pull/3364)) +- Use different socket for Win32 test ([#3375](https://github.com/axios/axios/pull/3375)) + +Huge thanks to everyone who contributed to this release via code (authors listed below) or via reviews and triaging on GitHub: + +- Daniel Lopretto +- Jason Kwok +- Jay +- Jonathan Foster +- Remco Haszing +- Xianming Zhong + +### 0.21.0 (October 23, 2020) + +Fixes and Functionality: + +- Fixing requestHeaders.Authorization ([#3287](https://github.com/axios/axios/pull/3287)) +- Fixing node types ([#3237](https://github.com/axios/axios/pull/3237)) +- Fixing axios.delete ignores config.data ([#3282](https://github.com/axios/axios/pull/3282)) +- Revert "Fixing overwrite Blob/File type as Content-Type in browser. (#1773)" ([#3289](https://github.com/axios/axios/pull/3289)) +- Fixing an issue that type 'null' and 'undefined' is not assignable to validateStatus when typescript strict option is enabled ([#3200](https://github.com/axios/axios/pull/3200)) + +Internal and Tests: + +- Lock travis to not use node v15 ([#3361](https://github.com/axios/axios/pull/3361)) + +Documentation: + +- Fixing simple typo, existant -> existent ([#3252](https://github.com/axios/axios/pull/3252)) +- Fixing typos ([#3309](https://github.com/axios/axios/pull/3309)) + +Huge thanks to everyone who contributed to this release via code (authors listed below) or via reviews and triaging on GitHub: + +- Allan Cruz <57270969+Allanbcruz@users.noreply.github.com> +- George Cheng +- Jay +- Kevin Kirsche +- Remco Haszing +- Taemin Shin +- Tim Gates +- Xianming Zhong + +### 0.20.0 (August 20, 2020) + +Release of 0.20.0-pre as a full release with no other changes. + +### 0.20.0-pre (July 15, 2020) + +Fixes and Functionality: + +- Fixing response with utf-8 BOM can not parse to json ([#2419](https://github.com/axios/axios/pull/2419)) + - fix: remove byte order marker (UTF-8 BOM) when transform response + - fix: remove BOM only utf-8 + - test: utf-8 BOM + - fix: incorrect param name +- Refactor mergeConfig without utils.deepMerge ([#2844](https://github.com/axios/axios/pull/2844)) + - Adding failing test + - Fixing #2587 default custom config persisting + - Adding Concat keys and filter duplicates + - Fixed value from CPE + - update for review feedbacks + - no deepMerge + - only merge between plain objects + - fix rename + - always merge config by mergeConfig + - extract function mergeDeepProperties + - refactor mergeConfig with all keys, and add special logic for validateStatus + - add test for resetting headers + - add lots of tests and fix a bug + - should not inherit `data` + - use simple toString +- Fixing overwrite Blob/File type as Content-Type in browser. ([#1773](https://github.com/axios/axios/pull/1773)) +- Fixing an issue that type 'null' is not assignable to validateStatus ([#2773](https://github.com/axios/axios/pull/2773)) +- Fixing special char encoding ([#1671](https://github.com/axios/axios/pull/1671)) + - removing @ character from replacement list since it is a reserved character + - Updating buildURL test to not include the @ character + - Removing console logs +- Fixing password encoding with special characters in basic authentication ([#1492](https://github.com/axios/axios/pull/1492)) + - Fixing password encoding with special characters in basic authentication + - Adding test to check if password with non-Latin1 characters pass +- Fixing 'Network Error' in react native android ([#1487](https://github.com/axios/axios/pull/1487)) + There is a bug in react native Android platform when using get method. It will trigger a 'Network Error' when passing the requestData which is an empty string to request.send function. So if the requestData is an empty string we can set it to null as well to fix the bug. +- Fixing Cookie Helper with Async Components ([#1105](https://github.com/axios/axios/pull/1105)) ([#1107](https://github.com/axios/axios/pull/1107)) +- Fixing 'progressEvent' type ([#2851](https://github.com/axios/axios/pull/2851)) + - Fix 'progressEvent' type + - Update axios.ts +- Fixing getting local files (file://) failed ([#2470](https://github.com/axios/axios/pull/2470)) + - fix issue #2416, #2396 + - fix Eslint warn + - Modify judgment conditions + - add unit test + - update unit test + - update unit test +- Allow PURGE method in typings ([#2191](https://github.com/axios/axios/pull/2191)) +- Adding option to disable automatic decompression ([#2661](https://github.com/axios/axios/pull/2661)) + - Adding ability to disable auto decompression + - Updating decompress documentation in README + - Fixing test\unit\adapters\http.js lint errors + - Adding test for disabling auto decompression + - Removing changes that fixed lint errors in tests + - Removing formatting change to unit test +- Add independent `maxBodyLength` option ([#2781](https://github.com/axios/axios/pull/2781)) + - Add independent option to set the maximum size of the request body + - Remove maxBodyLength check + - Update README + - Assert for error code and message +- Adding responseEncoding to mergeConfig ([#1745](https://github.com/axios/axios/pull/1745)) +- Compatible with follow-redirect aborts the request ([#2689](https://github.com/axios/axios/pull/2689)) + - Compatible with follow-redirect aborts the request + - Use the error code +- Fix merging of params ([#2656](https://github.com/axios/axios/pull/2656)) + - Name function to avoid ESLint func-names warning + - Switch params config to merge list and update tests + - Restore testing of both false and null + - Restore test cases for keys without defaults + - Include test for non-object values that aren't false-y. +- Revert `finally` as `then` ([#2683](https://github.com/axios/axios/pull/2683)) + +Internal and Tests: + +- Fix stale bot config ([#3049](https://github.com/axios/axios/pull/3049)) + - fix stale bot config + - fix multiple lines +- Add days and change name to work ([#3035](https://github.com/axios/axios/pull/3035)) +- Update close-issues.yml ([#3031](https://github.com/axios/axios/pull/3031)) + - Update close-issues.yml + Update close message to read better 😄 + - Fix use of quotations + Use single quotes as per other .yml files + - Remove user name form message +- Add GitHub actions to close stale issues/prs ([#3029](https://github.com/axios/axios/pull/3029)) + - prepare stale actions + - update messages + - Add exempt labels and lighten up comments +- Add GitHub actions to close invalid issues ([#3022](https://github.com/axios/axios/pull/3022)) + - add close actions + - fix with checkout + - update issue templates + - add reminder + - update close message +- Add test with Node.js 12 ([#2860](https://github.com/axios/axios/pull/2860)) + - test with Node.js 12 + - test with latest +- Adding console log on sandbox server startup ([#2210](https://github.com/axios/axios/pull/2210)) + - Adding console log on sandbox server startup + - Update server.js + Add server error handling + - Update server.js + Better error message, remove retry. +- Adding tests for method `options` type definitions ([#1996](https://github.com/axios/axios/pull/1996)) + Update tests. +- Add test for redirecting with too large response ([#2695](https://github.com/axios/axios/pull/2695)) +- Fixing unit test failure in Windows OS ([#2601](https://github.com/axios/axios/pull/2601)) +- Fixing issue for HEAD method and gzipped response ([#2666](https://github.com/axios/axios/pull/2666)) +- Fix tests in browsers ([#2748](https://github.com/axios/axios/pull/2748)) +- chore: add `jsdelivr` and `unpkg` support ([#2443](https://github.com/axios/axios/pull/2443)) + +Documentation: + +- Adding support for URLSearchParams in node ([#1900](https://github.com/axios/axios/pull/1900)) + - Adding support for URLSearchParams in node + - Remove un-needed code + - Update utils.js + - Make changes as suggested +- Adding table of content (preview) ([#3050](https://github.com/axios/axios/pull/3050)) + - add toc (preview) + - remove toc in toc + Signed-off-by: Moni + - fix sublinks + - fix indentation + - remove redundant table links + - update caps and indent + - remove axios +- Replace 'blacklist' with 'blocklist' ([#3006](https://github.com/axios/axios/pull/3006)) +- docs(): Detailed config options environment. ([#2088](https://github.com/axios/axios/pull/2088)) + - docs(): Detailed config options environment. + - Update README.md +- Include axios-data-unpacker in ECOSYSTEM.md ([#2080](https://github.com/axios/axios/pull/2080)) +- Allow opening examples in Gitpod ([#1958](https://github.com/axios/axios/pull/1958)) +- Remove axios.all() and axios.spread() from Readme.md ([#2727](https://github.com/axios/axios/pull/2727)) + - remove axios.all(), axios.spread() + - replace example + - axios.all() -> Promise.all() + - axios.spread(function (acct, perms)) -> function (acct, perms) + - add deprecated mark +- Update README.md ([#2887](https://github.com/axios/axios/pull/2887)) + Small change to the data attribute doc of the config. A request body can also be set for DELETE methods but this wasn't mentioned in the documentation (it only mentioned POST, PUT and PATCH). Took my some 10-20 minutes until I realized that I don't need to manipulate the request body with transformRequest in the case of DELETE. +- Include swagger-taxos-codegen in ECOSYSTEM.md ([#2162](https://github.com/axios/axios/pull/2162)) +- Add CDNJS version badge in README.md ([#878](https://github.com/axios/axios/pull/878)) + This badge will show the version on CDNJS! +- Documentation update to clear up ambiguity in code examples ([#2928](https://github.com/axios/axios/pull/2928)) + - Made an adjustment to the documentation to clear up any ambiguity around the use of "fs". This should help clear up that the code examples with "fs" cannot be used on the client side. +- Update README.md about validateStatus ([#2912](https://github.com/axios/axios/pull/2912)) + Rewrote the comment from "Reject only if the status code is greater than or equal to 500" to "Resolve only if the status code is less than 500" +- Updating documentation for usage form-data ([#2805](https://github.com/axios/axios/pull/2805)) + Closes #2049 +- Fixing CHANGELOG.md issue link ([#2784](https://github.com/axios/axios/pull/2784)) +- Include axios-hooks in ECOSYSTEM.md ([#2003](https://github.com/axios/axios/pull/2003)) +- Added Response header access instructions ([#1901](https://github.com/axios/axios/pull/1901)) + - Added Response header access instructions + - Added note about using bracket notation +- Add `onUploadProgress` and `onDownloadProgress` are browser only ([#2763](https://github.com/axios/axios/pull/2763)) + Saw in #928 and #1966 that `onUploadProgress` and `onDownloadProgress` only work in the browser and was missing that from the README. +- Update ' sign to ` in proxy spec ([#2778](https://github.com/axios/axios/pull/2778)) +- Adding jsDelivr link in README ([#1110](https://github.com/axios/axios/pull/1110)) + - Adding jsDelivr link + - Add SRI + - Remove SRI + +Huge thanks to everyone who contributed to this release via code (authors listed +below) or via reviews and triaging on GitHub: + +- Alan Wang +- Alexandru Ungureanu +- Anubhav Srivastava +- Benny Neugebauer +- Cr <631807682@qq.com> +- David +- David Ko +- David Tanner +- Emily Morehouse +- Felipe Martins +- Fonger <5862369+Fonger@users.noreply.github.com> +- Frostack +- George Cheng +- grumblerchester +- Gustavo López +- hexaez <45806662+hexaez@users.noreply.github.com> +- huangzuizui +- Ian Wijma +- Jay +- jeffjing +- jennynju <46782518+jennynju@users.noreply.github.com> +- Jimmy Liao <52391190+jimmy-liao-gogoro@users.noreply.github.com> +- Jonathan Sharpe +- JounQin +- Justin Beckwith +- Kamil Posiadała <3dcreator.pl@gmail.com> +- Lukas Drgon +- marcinx +- Martti Laine +- Michał Zarach +- Moni +- Motonori Iwata <121048+iwata@users.noreply.github.com> +- Nikita Galkin +- Petr Mares +- Philippe Recto +- Remco Haszing +- rockcs1992 +- Ryan Bown +- Samina Fu +- Simone Busoli +- Spencer von der Ohe +- Sven Efftinge +- Taegyeoung Oh +- Taemin Shin +- Thibault Ehrhart <1208424+ehrhart@users.noreply.github.com> +- Xianming Zhong +- Yasu Flores +- Zac Delventhal + +### 0.19.2 (Jan 20, 2020) + +- Remove unnecessary XSS check ([#2679](https://github.com/axios/axios/pull/2679)) (see ([#2646](https://github.com/axios/axios/issues/2646)) for discussion) + +### 0.19.1 (Jan 7, 2020) + +Fixes and Functionality: + +- Fixing invalid agent issue ([#1904](https://github.com/axios/axios/pull/1904)) +- Fix ignore set withCredentials false ([#2582](https://github.com/axios/axios/pull/2582)) +- Delete useless default to hash ([#2458](https://github.com/axios/axios/pull/2458)) +- Fix HTTP/HTTPs agents passing to follow-redirect ([#1904](https://github.com/axios/axios/pull/1904)) +- Fix ignore set withCredentials false ([#2582](https://github.com/axios/axios/pull/2582)) +- Fix CI build failure ([#2570](https://github.com/axios/axios/pull/2570)) +- Remove dependency on is-buffer from package.json ([#1816](https://github.com/axios/axios/pull/1816)) +- Adding options typings ([#2341](https://github.com/axios/axios/pull/2341)) +- Adding Typescript HTTP method definition for LINK and UNLINK. ([#2444](https://github.com/axios/axios/pull/2444)) +- Update dist with newest changes, fixes Custom Attributes issue +- Change syntax to see if build passes ([#2488](https://github.com/axios/axios/pull/2488)) +- Update Webpack + deps, remove now unnecessary polyfills ([#2410](https://github.com/axios/axios/pull/2410)) +- Fix to prevent XSS, throw an error when the URL contains a JS script ([#2464](https://github.com/axios/axios/pull/2464)) +- Add custom timeout error copy in config ([#2275](https://github.com/axios/axios/pull/2275)) +- Add error toJSON example ([#2466](https://github.com/axios/axios/pull/2466)) +- Fixing Vulnerability A Fortify Scan finds a critical Cross-Site Scrip… ([#2451](https://github.com/axios/axios/pull/2451)) +- Fixing subdomain handling on no_proxy ([#2442](https://github.com/axios/axios/pull/2442)) +- Make redirection from HTTP to HTTPS work ([#2426](https://github.com/axios/axios/pull/2426)) and ([#2547](https://github.com/axios/axios/pull/2547)) +- Add toJSON property to AxiosError type ([#2427](https://github.com/axios/axios/pull/2427)) +- Fixing socket hang up error on node side for slow response. ([#1752](https://github.com/axios/axios/pull/1752)) +- Alternative syntax to send data into the body ([#2317](https://github.com/axios/axios/pull/2317)) +- Fixing custom config options ([#2207](https://github.com/axios/axios/pull/2207)) +- Fixing set `config.method` after mergeConfig for Axios.prototype.request ([#2383](https://github.com/axios/axios/pull/2383)) +- Axios create url bug ([#2290](https://github.com/axios/axios/pull/2290)) +- Do not modify config.url when using a relative baseURL (resolves [#1628](https://github.com/axios/axios/issues/1098)) ([#2391](https://github.com/axios/axios/pull/2391)) + +Internal: + +- Revert "Update Webpack + deps, remove now unnecessary polyfills" ([#2479](https://github.com/axios/axios/pull/2479)) +- Order of if/else blocks is causing unit tests mocking XHR. ([#2201](https://github.com/axios/axios/pull/2201)) +- Add license badge ([#2446](https://github.com/axios/axios/pull/2446)) +- Fix travis CI build [#2386](https://github.com/axios/axios/pull/2386) +- Fix cancellation error on build master. #2290 #2207 ([#2407](https://github.com/axios/axios/pull/2407)) + +Documentation: + +- Fixing typo in CHANGELOG.md: s/Functionallity/Functionality ([#2639](https://github.com/axios/axios/pull/2639)) +- Fix badge, use master branch ([#2538](https://github.com/axios/axios/pull/2538)) +- Fix typo in changelog [#2193](https://github.com/axios/axios/pull/2193) +- Document fix ([#2514](https://github.com/axios/axios/pull/2514)) +- Update docs with no_proxy change, issue #2484 ([#2513](https://github.com/axios/axios/pull/2513)) +- Fixing missing words in docs template ([#2259](https://github.com/axios/axios/pull/2259)) +- 🐛Fix request finally documentation in README ([#2189](https://github.com/axios/axios/pull/2189)) +- updating spelling and adding link to docs ([#2212](https://github.com/axios/axios/pull/2212)) +- docs: minor tweak ([#2404](https://github.com/axios/axios/pull/2404)) +- Update response interceptor docs ([#2399](https://github.com/axios/axios/pull/2399)) +- Update README.md ([#2504](https://github.com/axios/axios/pull/2504)) +- Fix word 'sintaxe' to 'syntax' in README.md ([#2432](https://github.com/axios/axios/pull/2432)) +- updating README: notes on CommonJS autocomplete ([#2256](https://github.com/axios/axios/pull/2256)) +- Fix grammar in README.md ([#2271](https://github.com/axios/axios/pull/2271)) +- Doc fixes, minor examples cleanup ([#2198](https://github.com/axios/axios/pull/2198)) + +### 0.19.0 (May 30, 2019) + +Fixes and Functionality: + +- Added support for no_proxy env variable ([#1693](https://github.com/axios/axios/pull/1693/files)) - Chance Dickson +- Unzip response body only for statuses != 204 ([#1129](https://github.com/axios/axios/pull/1129)) - drawski +- Destroy stream on exceeding maxContentLength (fixes [#1098](https://github.com/axios/axios/issues/1098)) ([#1485](https://github.com/axios/axios/pull/1485)) - Gadzhi Gadzhiev +- Makes Axios error generic to use AxiosResponse ([#1738](https://github.com/axios/axios/pull/1738)) - Suman Lama +- Fixing Mocha tests by locking follow-redirects version to 1.5.10 ([#1993](https://github.com/axios/axios/pull/1993)) - grumblerchester +- Allow uppercase methods in typings. ([#1781](https://github.com/axios/axios/pull/1781)) - Ken Powers +- Fixing building url with hash mark ([#1771](https://github.com/axios/axios/pull/1771)) - Anatoly Ryabov +- This commit fix building url with hash map (fragment identifier) when parameters are present: they must not be added after `#`, because client cut everything after `#` +- Preserve HTTP method when following redirect ([#1758](https://github.com/axios/axios/pull/1758)) - Rikki Gibson +- Add `getUri` signature to TypeScript definition. ([#1736](https://github.com/axios/axios/pull/1736)) - Alexander Trauzzi +- Adding isAxiosError flag to errors thrown by axios ([#1419](https://github.com/axios/axios/pull/1419)) - Ayush Gupta + +Internal: + +- Fixing .eslintrc without extension ([#1789](https://github.com/axios/axios/pull/1789)) - Manoel +- Fix failing SauceLabs tests by updating configuration - Emily Morehouse +- Add issue templates - Emily Morehouse + +Documentation: + +- Consistent coding style in README ([#1787](https://github.com/axios/axios/pull/1787)) - Ali Servet Donmez +- Add information about auth parameter to README ([#2166](https://github.com/axios/axios/pull/2166)) - xlaguna +- Add DELETE to list of methods that allow data as a config option ([#2169](https://github.com/axios/axios/pull/2169)) - Daniela Borges Matos de Carvalho +- Update ECOSYSTEM.md - Add Axios Endpoints ([#2176](https://github.com/axios/axios/pull/2176)) - Renan +- Add r2curl in ECOSYSTEM ([#2141](https://github.com/axios/axios/pull/2141)) - 유용우 / CX +- Update README.md - Add instructions for installing with yarn ([#2036](https://github.com/axios/axios/pull/2036)) - Victor Hermes +- Fixing spacing for README.md ([#2066](https://github.com/axios/axios/pull/2066)) - Josh McCarty +- Update README.md. - Change `.then` to `.finally` in example code ([#2090](https://github.com/axios/axios/pull/2090)) - Omar Cai +- Clarify what values responseType can have in Node ([#2121](https://github.com/axios/axios/pull/2121)) - Tyler Breisacher +- docs(ECOSYSTEM): add axios-api-versioning ([#2020](https://github.com/axios/axios/pull/2020)) - Weffe +- It seems that `responseType: 'blob'` doesn't actually work in Node (when I tried using it, response.data was a string, not a Blob, since Node doesn't have Blobs), so this clarifies that this option should only be used in the browser +- Update README.md. - Add Querystring library note ([#1896](https://github.com/axios/axios/pull/1896)) - Dmitriy Eroshenko +- Add react-hooks-axios to Libraries section of ECOSYSTEM.md ([#1925](https://github.com/axios/axios/pull/1925)) - Cody Chan +- Clarify in README that default timeout is 0 (no timeout) ([#1750](https://github.com/axios/axios/pull/1750)) - Ben Standefer + +### 0.19.0-beta.1 (Aug 9, 2018) + +**NOTE:** This is a beta version of this release. There may be functionality that is broken in +certain browsers, though we suspect that builds are hanging and not erroring. See +https://saucelabs.com/u/axios for the most up-to-date information. + +New Functionality: + +- Add getUri method ([#1712](https://github.com/axios/axios/issues/1712)) +- Add support for no_proxy env variable ([#1693](https://github.com/axios/axios/issues/1693)) +- Add toJSON to decorated Axios errors to facilitate serialization ([#1625](https://github.com/axios/axios/issues/1625)) +- Add second then on axios call ([#1623](https://github.com/axios/axios/issues/1623)) +- Typings: allow custom return types +- Add option to specify character set in responses (with http adapter) + +Fixes: + +- Fix Keep defaults local to instance ([#385](https://github.com/axios/axios/issues/385)) +- Correctly catch exception in http test ([#1475](https://github.com/axios/axios/issues/1475)) +- Fix accept header normalization ([#1698](https://github.com/axios/axios/issues/1698)) +- Fix http adapter to allow HTTPS connections via HTTP ([#959](https://github.com/axios/axios/issues/959)) +- Fix Removes usage of deprecated Buffer constructor. ([#1555](https://github.com/axios/axios/issues/1555), [#1622](https://github.com/axios/axios/issues/1622)) +- Fix defaults to use httpAdapter if available ([#1285](https://github.com/axios/axios/issues/1285)) + - Fixing defaults to use httpAdapter if available + - Use a safer, cross-platform method to detect the Node environment +- Fix Reject promise if request is cancelled by the browser ([#537](https://github.com/axios/axios/issues/537)) +- [Typescript] Fix missing type parameters on delete/head methods +- [NS]: Send `false` flag isStandardBrowserEnv for Nativescript +- Fix missing type parameters on delete/head +- Fix Default method for an instance always overwritten by get +- Fix type error when socketPath option in AxiosRequestConfig +- Capture errors on request data streams +- Decorate resolve and reject to clear timeout in all cases + +Huge thanks to everyone who contributed to this release via code (authors listed +below) or via reviews and triaging on GitHub: + +- Andrew Scott +- Anthony Gauthier +- arpit +- ascott18 +- Benedikt Rötsch +- Chance Dickson +- Dave Stewart +- Deric Cain +- Guillaume Briday +- Jacob Wejendorp +- Jim Lynch +- johntron +- Justin Beckwith +- Justin Beckwith +- Khaled Garbaya +- Lim Jing Rong +- Mark van den Broek +- Martti Laine +- mattridley +- mattridley +- Nicolas Del Valle +- Nilegfx +- pbarbiero +- Rikki Gibson +- Sako Hartounian +- Shane Fitzpatrick +- Stephan Schneider +- Steven +- Tim Garthwaite +- Tim Johns +- Yutaro Miyazaki + +### 0.18.0 (Feb 19, 2018) + +- Adding support for UNIX Sockets when running with Node.js ([#1070](https://github.com/axios/axios/pull/1070)) +- Fixing typings ([#1177](https://github.com/axios/axios/pull/1177)): + - AxiosRequestConfig.proxy: allows type false + - AxiosProxyConfig: added auth field +- Adding function signature in AxiosInstance interface so AxiosInstance can be invoked ([#1192](https://github.com/axios/axios/pull/1192), [#1254](https://github.com/axios/axios/pull/1254)) +- Allowing maxContentLength to pass through to redirected calls as maxBodyLength in follow-redirects config ([#1287](https://github.com/axios/axios/pull/1287)) +- Fixing configuration when using an instance - method can now be set ([#1342](https://github.com/axios/axios/pull/1342)) + +### 0.17.1 (Nov 11, 2017) + +- Fixing issue with web workers ([#1160](https://github.com/axios/axios/pull/1160)) +- Allowing overriding transport ([#1080](https://github.com/axios/axios/pull/1080)) +- Updating TypeScript typings ([#1165](https://github.com/axios/axios/pull/1165), [#1125](https://github.com/axios/axios/pull/1125), [#1131](https://github.com/axios/axios/pull/1131)) + +### 0.17.0 (Oct 21, 2017) + +- **BREAKING** Fixing issue with `baseURL` and interceptors ([#950](https://github.com/axios/axios/pull/950)) +- **BREAKING** Improving handing of duplicate headers ([#874](https://github.com/axios/axios/pull/874)) +- Adding support for disabling proxies ([#691](https://github.com/axios/axios/pull/691)) +- Updating TypeScript typings with generic type parameters ([#1061](https://github.com/axios/axios/pull/1061)) + +### 0.16.2 (Jun 3, 2017) + +- Fixing issue with including `buffer` in bundle ([#887](https://github.com/axios/axios/pull/887)) +- Including underlying request in errors ([#830](https://github.com/axios/axios/pull/830)) +- Convert `method` to lowercase ([#930](https://github.com/axios/axios/pull/930)) + +### 0.16.1 (Apr 8, 2017) + +- Improving HTTP adapter to return last request in case of redirects ([#828](https://github.com/axios/axios/pull/828)) +- Updating `follow-redirects` dependency ([#829](https://github.com/axios/axios/pull/829)) +- Adding support for passing `Buffer` in node ([#773](https://github.com/axios/axios/pull/773)) + +### 0.16.0 (Mar 31, 2017) + +- **BREAKING** Removing `Promise` from axios typings in favor of built-in type declarations ([#480](https://github.com/axios/axios/issues/480)) +- Adding `options` shortcut method ([#461](https://github.com/axios/axios/pull/461)) +- Fixing issue with using `responseType: 'json'` in browsers incompatible with XHR Level 2 ([#654](https://github.com/axios/axios/pull/654)) +- Improving React Native detection ([#731](https://github.com/axios/axios/pull/731)) +- Fixing `combineURLs` to support empty `relativeURL` ([#581](https://github.com/axios/axios/pull/581)) +- Removing `PROTECTION_PREFIX` support ([#561](https://github.com/axios/axios/pull/561)) + +### 0.15.3 (Nov 27, 2016) + +- Fixing issue with custom instances and global defaults ([#443](https://github.com/axios/axios/issues/443)) +- Renaming `axios.d.ts` to `index.d.ts` ([#519](https://github.com/axios/axios/issues/519)) +- Adding `get`, `head`, and `delete` to `defaults.headers` ([#509](https://github.com/axios/axios/issues/509)) +- Fixing issue with `btoa` and IE ([#507](https://github.com/axios/axios/issues/507)) +- Adding support for proxy authentication ([#483](https://github.com/axios/axios/pull/483)) +- Improving HTTP adapter to use `http` protocol by default ([#493](https://github.com/axios/axios/pull/493)) +- Fixing proxy issues ([#491](https://github.com/axios/axios/pull/491)) + +### 0.15.2 (Oct 17, 2016) + +- Fixing issue with calling `cancel` after response has been received ([#482](https://github.com/axios/axios/issues/482)) + +### 0.15.1 (Oct 14, 2016) + +- Fixing issue with UMD ([#485](https://github.com/axios/axios/issues/485)) + +### 0.15.0 (Oct 10, 2016) + +- Adding cancellation support ([#452](https://github.com/axios/axios/pull/452)) +- Moving default adapter to global defaults ([#437](https://github.com/axios/axios/pull/437)) +- Fixing issue with `file` URI scheme ([#440](https://github.com/axios/axios/pull/440)) +- Fixing issue with `params` objects that have no prototype ([#445](https://github.com/axios/axios/pull/445)) + +### 0.14.0 (Aug 27, 2016) + +- **BREAKING** Updating TypeScript definitions ([#419](https://github.com/axios/axios/pull/419)) +- **BREAKING** Replacing `agent` option with `httpAgent` and `httpsAgent` ([#387](https://github.com/axios/axios/pull/387)) +- **BREAKING** Splitting `progress` event handlers into `onUploadProgress` and `onDownloadProgress` ([#423](https://github.com/axios/axios/pull/423)) +- Adding support for `http_proxy` and `https_proxy` environment variables ([#366](https://github.com/axios/axios/pull/366)) +- Fixing issue with `auth` config option and `Authorization` header ([#397](https://github.com/axios/axios/pull/397)) +- Don't set XSRF header if `xsrfCookieName` is `null` ([#406](https://github.com/axios/axios/pull/406)) + +### 0.13.1 (Jul 16, 2016) + +- Fixing issue with response data not being transformed on error ([#378](https://github.com/axios/axios/issues/378)) + +### 0.13.0 (Jul 13, 2016) + +- **BREAKING** Improved error handling ([#345](https://github.com/axios/axios/pull/345)) +- **BREAKING** Response transformer now invoked in dispatcher not adapter ([10eb238](https://github.com/axios/axios/commit/10eb23865101f9347570552c04e9d6211376e25e)) +- **BREAKING** Request adapters now return a `Promise` ([157efd5](https://github.com/axios/axios/commit/157efd5615890301824e3121cc6c9d2f9b21f94a)) +- Fixing issue with `withCredentials` not being overwritten ([#343](https://github.com/axios/axios/issues/343)) +- Fixing regression with request transformer being called before request interceptor ([#352](https://github.com/axios/axios/issues/352)) +- Fixing custom instance defaults ([#341](https://github.com/axios/axios/issues/341)) +- Fixing instances created from `axios.create` to have same API as default axios ([#217](https://github.com/axios/axios/issues/217)) + +### 0.12.0 (May 31, 2016) + +- Adding support for `URLSearchParams` ([#317](https://github.com/axios/axios/pull/317)) +- Adding `maxRedirects` option ([#307](https://github.com/axios/axios/pull/307)) + +### 0.11.1 (May 17, 2016) + +- Fixing IE CORS support ([#313](https://github.com/axios/axios/pull/313)) +- Fixing detection of `FormData` ([#325](https://github.com/axios/axios/pull/325)) +- Adding `Axios` class to exports ([#321](https://github.com/axios/axios/pull/321)) + +### 0.11.0 (Apr 26, 2016) + +- Adding support for Stream with HTTP adapter ([#296](https://github.com/axios/axios/pull/296)) +- Adding support for custom HTTP status code error ranges ([#308](https://github.com/axios/axios/pull/308)) +- Fixing issue with ArrayBuffer ([#299](https://github.com/axios/axios/pull/299)) + +### 0.10.0 (Apr 20, 2016) + +- Fixing issue with some requests sending `undefined` instead of `null` ([#250](https://github.com/axios/axios/pull/250)) +- Fixing basic auth for HTTP adapter ([#252](https://github.com/axios/axios/pull/252)) +- Fixing request timeout for XHR adapter ([#227](https://github.com/axios/axios/pull/227)) +- Fixing IE8 support by using `onreadystatechange` instead of `onload` ([#249](https://github.com/axios/axios/pull/249)) +- Fixing IE9 cross domain requests ([#251](https://github.com/axios/axios/pull/251)) +- Adding `maxContentLength` option ([#275](https://github.com/axios/axios/pull/275)) +- Fixing XHR support for WebWorker environment ([#279](https://github.com/axios/axios/pull/279)) +- Adding request instance to response ([#200](https://github.com/axios/axios/pull/200)) + +### 0.9.1 (Jan 24, 2016) + +- Improving handling of request timeout in node ([#124](https://github.com/axios/axios/issues/124)) +- Fixing network errors not rejecting ([#205](https://github.com/axios/axios/pull/205)) +- Fixing issue with IE rejecting on HTTP 204 ([#201](https://github.com/axios/axios/issues/201)) +- Fixing host/port when following redirects ([#198](https://github.com/axios/axios/pull/198)) + +### 0.9.0 (Jan 18, 2016) + +- Adding support for custom adapters +- Fixing Content-Type header being removed when data is false ([#195](https://github.com/axios/axios/pull/195)) +- Improving XDomainRequest implementation ([#185](https://github.com/axios/axios/pull/185)) +- Improving config merging and order of precedence ([#183](https://github.com/axios/axios/pull/183)) +- Fixing XDomainRequest support for only <= IE9 ([#182](https://github.com/axios/axios/pull/182)) + +### 0.8.1 (Dec 14, 2015) + +- Adding support for passing XSRF token for cross domain requests when using `withCredentials` ([#168](https://github.com/axios/axios/pull/168)) +- Fixing error with format of basic auth header ([#178](https://github.com/axios/axios/pull/173)) +- Fixing error with JSON payloads throwing `InvalidStateError` in some cases ([#174](https://github.com/axios/axios/pull/174)) + +### 0.8.0 (Dec 11, 2015) + +- Adding support for creating instances of axios ([#123](https://github.com/axios/axios/pull/123)) +- Fixing http adapter to use `Buffer` instead of `String` in case of `responseType === 'arraybuffer'` ([#128](https://github.com/axios/axios/pull/128)) +- Adding support for using custom parameter serializer with `paramsSerializer` option ([#121](https://github.com/axios/axios/pull/121)) +- Fixing issue in IE8 caused by `forEach` on `arguments` ([#127](https://github.com/axios/axios/pull/127)) +- Adding support for following redirects in node ([#146](https://github.com/axios/axios/pull/146)) +- Adding support for transparent decompression if `content-encoding` is set ([#149](https://github.com/axios/axios/pull/149)) +- Adding support for transparent XDomainRequest to handle cross domain requests in IE9 ([#140](https://github.com/axios/axios/pull/140)) +- Adding support for HTTP basic auth via Authorization header ([#167](https://github.com/axios/axios/pull/167)) +- Adding support for baseURL option ([#160](https://github.com/axios/axios/pull/160)) + +### 0.7.0 (Sep 29, 2015) + +- Fixing issue with minified bundle in IE8 ([#87](https://github.com/axios/axios/pull/87)) +- Adding support for passing agent in node ([#102](https://github.com/axios/axios/pull/102)) +- Adding support for returning result from `axios.spread` for chaining ([#106](https://github.com/axios/axios/pull/106)) +- Fixing typescript definition ([#105](https://github.com/axios/axios/pull/105)) +- Fixing default timeout config for node ([#112](https://github.com/axios/axios/pull/112)) +- Adding support for use in web workers, and react-native ([#70](https://github.com/axios/axios/issue/70)), ([#98](https://github.com/axios/axios/pull/98)) +- Adding support for fetch like API `axios(url[, config])` ([#116](https://github.com/axios/axios/issues/116)) + +### 0.6.0 (Sep 21, 2015) + +- Removing deprecated success/error aliases +- Fixing issue with array params not being properly encoded ([#49](https://github.com/axios/axios/pull/49)) +- Fixing issue with User-Agent getting overridden ([#69](https://github.com/axios/axios/issues/69)) +- Adding support for timeout config ([#56](https://github.com/axios/axios/issues/56)) +- Removing es6-promise dependency +- Fixing issue preventing `length` to be used as a parameter ([#91](https://github.com/axios/axios/pull/91)) +- Fixing issue with IE8 ([#85](https://github.com/axios/axios/pull/85)) +- Converting build to UMD + +### 0.5.4 (Apr 08, 2015) + +- Fixing issue with FormData not being sent ([#53](https://github.com/axios/axios/issues/53)) + +### 0.5.3 (Apr 07, 2015) + +- Using JSON.parse unconditionally when transforming response string ([#55](https://github.com/axios/axios/issues/55)) + +### 0.5.2 (Mar 13, 2015) + +- Adding support for `statusText` in response ([#46](https://github.com/axios/axios/issues/46)) + +### 0.5.1 (Mar 10, 2015) + +- Fixing issue using strict mode ([#45](https://github.com/axios/axios/issues/45)) +- Fixing issue with standalone build ([#47](https://github.com/axios/axios/issues/47)) + +### 0.5.0 (Jan 23, 2015) + +- Adding support for intercepetors ([#14](https://github.com/axios/axios/issues/14)) +- Updating es6-promise dependency + +### 0.4.2 (Dec 10, 2014) + +- Fixing issue with `Content-Type` when using `FormData` ([#22](https://github.com/axios/axios/issues/22)) +- Adding support for TypeScript ([#25](https://github.com/axios/axios/issues/25)) +- Fixing issue with standalone build ([#29](https://github.com/axios/axios/issues/29)) +- Fixing issue with verbs needing to be capitalized in some browsers ([#30](https://github.com/axios/axios/issues/30)) + +### 0.4.1 (Oct 15, 2014) + +- Adding error handling to request for node.js ([#18](https://github.com/axios/axios/issues/18)) + +### 0.4.0 (Oct 03, 2014) + +- Adding support for `ArrayBuffer` and `ArrayBufferView` ([#10](https://github.com/axios/axios/issues/10)) +- Adding support for utf-8 for node.js ([#13](https://github.com/axios/axios/issues/13)) +- Adding support for SSL for node.js ([#12](https://github.com/axios/axios/issues/12)) +- Fixing incorrect `Content-Type` header ([#9](https://github.com/axios/axios/issues/9)) +- Adding standalone build without bundled es6-promise ([#11](https://github.com/axios/axios/issues/11)) +- Deprecating `success`/`error` in favor of `then`/`catch` + +### 0.3.1 (Sep 16, 2014) + +- Fixing missing post body when using node.js ([#3](https://github.com/axios/axios/issues/3)) + +### 0.3.0 (Sep 16, 2014) + +- Fixing `success` and `error` to properly receive response data as individual arguments ([#8](https://github.com/axios/axios/issues/8)) +- Updating `then` and `catch` to receive response data as a single object ([#6](https://github.com/axios/axios/issues/6)) +- Fixing issue with `all` not working ([#7](https://github.com/axios/axios/issues/7)) + +### 0.2.2 (Sep 14, 2014) + +- Fixing bundling with browserify ([#4](https://github.com/axios/axios/issues/4)) + +### 0.2.1 (Sep 12, 2014) + +- Fixing build problem causing ridiculous file sizes + +### 0.2.0 (Sep 12, 2014) + +- Adding support for `all` and `spread` +- Adding support for node.js ([#1](https://github.com/axios/axios/issues/1)) + +### 0.1.0 (Aug 29, 2014) + +- Initial release diff --git a/node_modules/@shineiichijo/nhentai-pdf/node_modules/axios/LICENSE b/node_modules/@shineiichijo/nhentai-pdf/node_modules/axios/LICENSE new file mode 100644 index 000000000..d36c80ef2 --- /dev/null +++ b/node_modules/@shineiichijo/nhentai-pdf/node_modules/axios/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2014-present Matt Zabriskie + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/@shineiichijo/nhentai-pdf/node_modules/axios/README.md b/node_modules/@shineiichijo/nhentai-pdf/node_modules/axios/README.md new file mode 100644 index 000000000..b8c019a78 --- /dev/null +++ b/node_modules/@shineiichijo/nhentai-pdf/node_modules/axios/README.md @@ -0,0 +1,868 @@ +# axios + +[![npm version](https://img.shields.io/npm/v/axios.svg?style=flat-square)](https://www.npmjs.org/package/axios) +[![CDNJS](https://img.shields.io/cdnjs/v/axios.svg?style=flat-square)](https://cdnjs.com/libraries/axios) +![Build status](https://github.com/axios/axios/actions/workflows/ci.yml/badge.svg) +[![Gitpod Ready-to-Code](https://img.shields.io/badge/Gitpod-Ready--to--Code-blue?logo=gitpod)](https://gitpod.io/#https://github.com/axios/axios) +[![code coverage](https://img.shields.io/coveralls/mzabriskie/axios.svg?style=flat-square)](https://coveralls.io/r/mzabriskie/axios) +[![install size](https://packagephobia.now.sh/badge?p=axios)](https://packagephobia.now.sh/result?p=axios) +[![npm downloads](https://img.shields.io/npm/dm/axios.svg?style=flat-square)](http://npm-stat.com/charts.html?package=axios) +[![gitter chat](https://img.shields.io/gitter/room/mzabriskie/axios.svg?style=flat-square)](https://gitter.im/mzabriskie/axios) +[![code helpers](https://www.codetriage.com/axios/axios/badges/users.svg)](https://www.codetriage.com/axios/axios) + +Promise based HTTP client for the browser and node.js + +> New axios docs website: [click here](https://axios-http.com/) + +## Table of Contents + + - [Features](#features) + - [Browser Support](#browser-support) + - [Installing](#installing) + - [Example](#example) + - [Axios API](#axios-api) + - [Request method aliases](#request-method-aliases) + - [Concurrency (Deprecated)](#concurrency-deprecated) + - [Creating an instance](#creating-an-instance) + - [Instance methods](#instance-methods) + - [Request Config](#request-config) + - [Response Schema](#response-schema) + - [Config Defaults](#config-defaults) + - [Global axios defaults](#global-axios-defaults) + - [Custom instance defaults](#custom-instance-defaults) + - [Config order of precedence](#config-order-of-precedence) + - [Interceptors](#interceptors) + - [Handling Errors](#handling-errors) + - [Cancellation](#cancellation) + - [Using application/x-www-form-urlencoded format](#using-applicationx-www-form-urlencoded-format) + - [Browser](#browser) + - [Node.js](#nodejs) + - [Query string](#query-string) + - [Form data](#form-data) + - [Semver](#semver) + - [Promises](#promises) + - [TypeScript](#typescript) + - [Resources](#resources) + - [Credits](#credits) + - [License](#license) + +## Features + +- Make [XMLHttpRequests](https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest) from the browser +- Make [http](http://nodejs.org/api/http.html) requests from node.js +- Supports the [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) API +- Intercept request and response +- Transform request and response data +- Cancel requests +- Automatic transforms for JSON data +- Client side support for protecting against [XSRF](http://en.wikipedia.org/wiki/Cross-site_request_forgery) + +## Browser Support + +![Chrome](https://raw.github.com/alrra/browser-logos/master/src/chrome/chrome_48x48.png) | ![Firefox](https://raw.github.com/alrra/browser-logos/master/src/firefox/firefox_48x48.png) | ![Safari](https://raw.github.com/alrra/browser-logos/master/src/safari/safari_48x48.png) | ![Opera](https://raw.github.com/alrra/browser-logos/master/src/opera/opera_48x48.png) | ![Edge](https://raw.github.com/alrra/browser-logos/master/src/edge/edge_48x48.png) | ![IE](https://raw.github.com/alrra/browser-logos/master/src/archive/internet-explorer_9-11/internet-explorer_9-11_48x48.png) | +--- | --- | --- | --- | --- | --- | +Latest ✔ | Latest ✔ | Latest ✔ | Latest ✔ | Latest ✔ | 11 ✔ | + +[![Browser Matrix](https://saucelabs.com/open_sauce/build_matrix/axios.svg)](https://saucelabs.com/u/axios) + +## Installing + +Using npm: + +```bash +$ npm install axios +``` + +Using bower: + +```bash +$ bower install axios +``` + +Using yarn: + +```bash +$ yarn add axios +``` + +Using jsDelivr CDN: + +```html + +``` + +Using unpkg CDN: + +```html + +``` + +## Example + +### note: CommonJS usage +In order to gain the TypeScript typings (for intellisense / autocomplete) while using CommonJS imports with `require()` use the following approach: + +```js +const axios = require('axios').default; + +// axios. will now provide autocomplete and parameter typings +``` + +Performing a `GET` request + +```js +const axios = require('axios'); + +// Make a request for a user with a given ID +axios.get('/user?ID=12345') + .then(function (response) { + // handle success + console.log(response); + }) + .catch(function (error) { + // handle error + console.log(error); + }) + .then(function () { + // always executed + }); + +// Optionally the request above could also be done as +axios.get('/user', { + params: { + ID: 12345 + } + }) + .then(function (response) { + console.log(response); + }) + .catch(function (error) { + console.log(error); + }) + .then(function () { + // always executed + }); + +// Want to use async/await? Add the `async` keyword to your outer function/method. +async function getUser() { + try { + const response = await axios.get('/user?ID=12345'); + console.log(response); + } catch (error) { + console.error(error); + } +} +``` + +> **NOTE:** `async/await` is part of ECMAScript 2017 and is not supported in Internet +> Explorer and older browsers, so use with caution. + +Performing a `POST` request + +```js +axios.post('/user', { + firstName: 'Fred', + lastName: 'Flintstone' + }) + .then(function (response) { + console.log(response); + }) + .catch(function (error) { + console.log(error); + }); +``` + +Performing multiple concurrent requests + +```js +function getUserAccount() { + return axios.get('/user/12345'); +} + +function getUserPermissions() { + return axios.get('/user/12345/permissions'); +} + +Promise.all([getUserAccount(), getUserPermissions()]) + .then(function (results) { + const acct = results[0]; + const perm = results[1]; + }); +``` + +## axios API + +Requests can be made by passing the relevant config to `axios`. + +##### axios(config) + +```js +// Send a POST request +axios({ + method: 'post', + url: '/user/12345', + data: { + firstName: 'Fred', + lastName: 'Flintstone' + } +}); +``` + +```js +// GET request for remote image in node.js +axios({ + method: 'get', + url: 'http://bit.ly/2mTM3nY', + responseType: 'stream' +}) + .then(function (response) { + response.data.pipe(fs.createWriteStream('ada_lovelace.jpg')) + }); +``` + +##### axios(url[, config]) + +```js +// Send a GET request (default method) +axios('/user/12345'); +``` + +### Request method aliases + +For convenience aliases have been provided for all supported request methods. + +##### axios.request(config) +##### axios.get(url[, config]) +##### axios.delete(url[, config]) +##### axios.head(url[, config]) +##### axios.options(url[, config]) +##### axios.post(url[, data[, config]]) +##### axios.put(url[, data[, config]]) +##### axios.patch(url[, data[, config]]) + +###### NOTE +When using the alias methods `url`, `method`, and `data` properties don't need to be specified in config. + +### Concurrency (Deprecated) +Please use `Promise.all` to replace the below functions. + +Helper functions for dealing with concurrent requests. + +axios.all(iterable) +axios.spread(callback) + +### Creating an instance + +You can create a new instance of axios with a custom config. + +##### axios.create([config]) + +```js +const instance = axios.create({ + baseURL: 'https://some-domain.com/api/', + timeout: 1000, + headers: {'X-Custom-Header': 'foobar'} +}); +``` + +### Instance methods + +The available instance methods are listed below. The specified config will be merged with the instance config. + +##### axios#request(config) +##### axios#get(url[, config]) +##### axios#delete(url[, config]) +##### axios#head(url[, config]) +##### axios#options(url[, config]) +##### axios#post(url[, data[, config]]) +##### axios#put(url[, data[, config]]) +##### axios#patch(url[, data[, config]]) +##### axios#getUri([config]) + +## Request Config + +These are the available config options for making requests. Only the `url` is required. Requests will default to `GET` if `method` is not specified. + +```js +{ + // `url` is the server URL that will be used for the request + url: '/user', + + // `method` is the request method to be used when making the request + method: 'get', // default + + // `baseURL` will be prepended to `url` unless `url` is absolute. + // It can be convenient to set `baseURL` for an instance of axios to pass relative URLs + // to methods of that instance. + baseURL: 'https://some-domain.com/api/', + + // `transformRequest` allows changes to the request data before it is sent to the server + // This is only applicable for request methods 'PUT', 'POST', 'PATCH' and 'DELETE' + // The last function in the array must return a string or an instance of Buffer, ArrayBuffer, + // FormData or Stream + // You may modify the headers object. + transformRequest: [function (data, headers) { + // Do whatever you want to transform the data + + return data; + }], + + // `transformResponse` allows changes to the response data to be made before + // it is passed to then/catch + transformResponse: [function (data) { + // Do whatever you want to transform the data + + return data; + }], + + // `headers` are custom headers to be sent + headers: {'X-Requested-With': 'XMLHttpRequest'}, + + // `params` are the URL parameters to be sent with the request + // Must be a plain object or a URLSearchParams object + params: { + ID: 12345 + }, + + // `paramsSerializer` is an optional function in charge of serializing `params` + // (e.g. https://www.npmjs.com/package/qs, http://api.jquery.com/jquery.param/) + paramsSerializer: function (params) { + return Qs.stringify(params, {arrayFormat: 'brackets'}) + }, + + // `data` is the data to be sent as the request body + // Only applicable for request methods 'PUT', 'POST', 'DELETE , and 'PATCH' + // When no `transformRequest` is set, must be of one of the following types: + // - string, plain object, ArrayBuffer, ArrayBufferView, URLSearchParams + // - Browser only: FormData, File, Blob + // - Node only: Stream, Buffer + data: { + firstName: 'Fred' + }, + + // syntax alternative to send data into the body + // method post + // only the value is sent, not the key + data: 'Country=Brasil&City=Belo Horizonte', + + // `timeout` specifies the number of milliseconds before the request times out. + // If the request takes longer than `timeout`, the request will be aborted. + timeout: 1000, // default is `0` (no timeout) + + // `withCredentials` indicates whether or not cross-site Access-Control requests + // should be made using credentials + withCredentials: false, // default + + // `adapter` allows custom handling of requests which makes testing easier. + // Return a promise and supply a valid response (see lib/adapters/README.md). + adapter: function (config) { + /* ... */ + }, + + // `auth` indicates that HTTP Basic auth should be used, and supplies credentials. + // This will set an `Authorization` header, overwriting any existing + // `Authorization` custom headers you have set using `headers`. + // Please note that only HTTP Basic auth is configurable through this parameter. + // For Bearer tokens and such, use `Authorization` custom headers instead. + auth: { + username: 'janedoe', + password: 's00pers3cret' + }, + + // `responseType` indicates the type of data that the server will respond with + // options are: 'arraybuffer', 'document', 'json', 'text', 'stream' + // browser only: 'blob' + responseType: 'json', // default + + // `responseEncoding` indicates encoding to use for decoding responses (Node.js only) + // Note: Ignored for `responseType` of 'stream' or client-side requests + responseEncoding: 'utf8', // default + + // `xsrfCookieName` is the name of the cookie to use as a value for xsrf token + xsrfCookieName: 'XSRF-TOKEN', // default + + // `xsrfHeaderName` is the name of the http header that carries the xsrf token value + xsrfHeaderName: 'X-XSRF-TOKEN', // default + + // `onUploadProgress` allows handling of progress events for uploads + // browser only + onUploadProgress: function (progressEvent) { + // Do whatever you want with the native progress event + }, + + // `onDownloadProgress` allows handling of progress events for downloads + // browser only + onDownloadProgress: function (progressEvent) { + // Do whatever you want with the native progress event + }, + + // `maxContentLength` defines the max size of the http response content in bytes allowed in node.js + maxContentLength: 2000, + + // `maxBodyLength` (Node only option) defines the max size of the http request content in bytes allowed + maxBodyLength: 2000, + + // `validateStatus` defines whether to resolve or reject the promise for a given + // HTTP response status code. If `validateStatus` returns `true` (or is set to `null` + // or `undefined`), the promise will be resolved; otherwise, the promise will be + // rejected. + validateStatus: function (status) { + return status >= 200 && status < 300; // default + }, + + // `maxRedirects` defines the maximum number of redirects to follow in node.js. + // If set to 0, no redirects will be followed. + maxRedirects: 5, // default + + // `socketPath` defines a UNIX Socket to be used in node.js. + // e.g. '/var/run/docker.sock' to send requests to the docker daemon. + // Only either `socketPath` or `proxy` can be specified. + // If both are specified, `socketPath` is used. + socketPath: null, // default + + // `httpAgent` and `httpsAgent` define a custom agent to be used when performing http + // and https requests, respectively, in node.js. This allows options to be added like + // `keepAlive` that are not enabled by default. + httpAgent: new http.Agent({ keepAlive: true }), + httpsAgent: new https.Agent({ keepAlive: true }), + + // `proxy` defines the hostname, port, and protocol of the proxy server. + // You can also define your proxy using the conventional `http_proxy` and + // `https_proxy` environment variables. If you are using environment variables + // for your proxy configuration, you can also define a `no_proxy` environment + // variable as a comma-separated list of domains that should not be proxied. + // Use `false` to disable proxies, ignoring environment variables. + // `auth` indicates that HTTP Basic auth should be used to connect to the proxy, and + // supplies credentials. + // This will set an `Proxy-Authorization` header, overwriting any existing + // `Proxy-Authorization` custom headers you have set using `headers`. + // If the proxy server uses HTTPS, then you must set the protocol to `https`. + proxy: { + protocol: 'https', + host: '127.0.0.1', + port: 9000, + auth: { + username: 'mikeymike', + password: 'rapunz3l' + } + }, + + // `cancelToken` specifies a cancel token that can be used to cancel the request + // (see Cancellation section below for details) + cancelToken: new CancelToken(function (cancel) { + }), + + // `decompress` indicates whether or not the response body should be decompressed + // automatically. If set to `true` will also remove the 'content-encoding' header + // from the responses objects of all decompressed responses + // - Node only (XHR cannot turn off decompression) + decompress: true, // default + + // transitional options for backward compatibility that may be removed in the newer versions + transitional: { + // silent JSON parsing mode + // `true` - ignore JSON parsing errors and set response.data to null if parsing failed (old behaviour) + // `false` - throw SyntaxError if JSON parsing failed (Note: responseType must be set to 'json') + silentJSONParsing: true, // default value for the current Axios version + + // try to parse the response string as JSON even if `responseType` is not 'json' + forcedJSONParsing: true, + + // throw ETIMEDOUT error instead of generic ECONNABORTED on request timeouts + clarifyTimeoutError: false, + } +} +``` + +## Response Schema + +The response for a request contains the following information. + +```js +{ + // `data` is the response that was provided by the server + data: {}, + + // `status` is the HTTP status code from the server response + status: 200, + + // `statusText` is the HTTP status message from the server response + statusText: 'OK', + + // `headers` the HTTP headers that the server responded with + // All header names are lower cased and can be accessed using the bracket notation. + // Example: `response.headers['content-type']` + headers: {}, + + // `config` is the config that was provided to `axios` for the request + config: {}, + + // `request` is the request that generated this response + // It is the last ClientRequest instance in node.js (in redirects) + // and an XMLHttpRequest instance in the browser + request: {} +} +``` + +When using `then`, you will receive the response as follows: + +```js +axios.get('/user/12345') + .then(function (response) { + console.log(response.data); + console.log(response.status); + console.log(response.statusText); + console.log(response.headers); + console.log(response.config); + }); +``` + +When using `catch`, or passing a [rejection callback](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/then) as second parameter of `then`, the response will be available through the `error` object as explained in the [Handling Errors](#handling-errors) section. + +## Config Defaults + +You can specify config defaults that will be applied to every request. + +### Global axios defaults + +```js +axios.defaults.baseURL = 'https://api.example.com'; + +// Important: If axios is used with multiple domains, the AUTH_TOKEN will be sent to all of them. +// See below for an example using Custom instance defaults instead. +axios.defaults.headers.common['Authorization'] = AUTH_TOKEN; + +axios.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded'; +``` + +### Custom instance defaults + +```js +// Set config defaults when creating the instance +const instance = axios.create({ + baseURL: 'https://api.example.com' +}); + +// Alter defaults after instance has been created +instance.defaults.headers.common['Authorization'] = AUTH_TOKEN; +``` + +### Config order of precedence + +Config will be merged with an order of precedence. The order is library defaults found in [lib/defaults.js](https://github.com/axios/axios/blob/master/lib/defaults.js#L28), then `defaults` property of the instance, and finally `config` argument for the request. The latter will take precedence over the former. Here's an example. + +```js +// Create an instance using the config defaults provided by the library +// At this point the timeout config value is `0` as is the default for the library +const instance = axios.create(); + +// Override timeout default for the library +// Now all requests using this instance will wait 2.5 seconds before timing out +instance.defaults.timeout = 2500; + +// Override timeout for this request as it's known to take a long time +instance.get('/longRequest', { + timeout: 5000 +}); +``` + +## Interceptors + +You can intercept requests or responses before they are handled by `then` or `catch`. + +```js +// Add a request interceptor +axios.interceptors.request.use(function (config) { + // Do something before request is sent + return config; + }, function (error) { + // Do something with request error + return Promise.reject(error); + }); + +// Add a response interceptor +axios.interceptors.response.use(function (response) { + // Any status code that lie within the range of 2xx cause this function to trigger + // Do something with response data + return response; + }, function (error) { + // Any status codes that falls outside the range of 2xx cause this function to trigger + // Do something with response error + return Promise.reject(error); + }); +``` + +If you need to remove an interceptor later you can. + +```js +const myInterceptor = axios.interceptors.request.use(function () {/*...*/}); +axios.interceptors.request.eject(myInterceptor); +``` + +You can add interceptors to a custom instance of axios. + +```js +const instance = axios.create(); +instance.interceptors.request.use(function () {/*...*/}); +``` + +When you add request interceptors, they are presumed to be asynchronous by default. This can cause a delay +in the execution of your axios request when the main thread is blocked (a promise is created under the hood for +the interceptor and your request gets put on the bottom of the call stack). If your request interceptors are synchronous you can add a flag +to the options object that will tell axios to run the code synchronously and avoid any delays in request execution. + +```js +axios.interceptors.request.use(function (config) { + config.headers.test = 'I am only a header!'; + return config; +}, null, { synchronous: true }); +``` + +If you want to execute a particular interceptor based on a runtime check, +you can add a `runWhen` function to the options object. The interceptor will not be executed **if and only if** the return +of `runWhen` is `false`. The function will be called with the config +object (don't forget that you can bind your own arguments to it as well.) This can be handy when you have an +asynchronous request interceptor that only needs to run at certain times. + +```js +function onGetCall(config) { + return config.method === 'get'; +} +axios.interceptors.request.use(function (config) { + config.headers.test = 'special get headers'; + return config; +}, null, { runWhen: onGetCall }); +``` + +## Handling Errors + +```js +axios.get('/user/12345') + .catch(function (error) { + if (error.response) { + // The request was made and the server responded with a status code + // that falls out of the range of 2xx + console.log(error.response.data); + console.log(error.response.status); + console.log(error.response.headers); + } else if (error.request) { + // The request was made but no response was received + // `error.request` is an instance of XMLHttpRequest in the browser and an instance of + // http.ClientRequest in node.js + console.log(error.request); + } else { + // Something happened in setting up the request that triggered an Error + console.log('Error', error.message); + } + console.log(error.config); + }); +``` + +Using the `validateStatus` config option, you can define HTTP code(s) that should throw an error. + +```js +axios.get('/user/12345', { + validateStatus: function (status) { + return status < 500; // Resolve only if the status code is less than 500 + } +}) +``` + +Using `toJSON` you get an object with more information about the HTTP error. + +```js +axios.get('/user/12345') + .catch(function (error) { + console.log(error.toJSON()); + }); +``` + +## Cancellation + +You can cancel a request using a *cancel token*. + +> The axios cancel token API is based on the withdrawn [cancelable promises proposal](https://github.com/tc39/proposal-cancelable-promises). + +You can create a cancel token using the `CancelToken.source` factory as shown below: + +```js +const CancelToken = axios.CancelToken; +const source = CancelToken.source(); + +axios.get('/user/12345', { + cancelToken: source.token +}).catch(function (thrown) { + if (axios.isCancel(thrown)) { + console.log('Request canceled', thrown.message); + } else { + // handle error + } +}); + +axios.post('/user/12345', { + name: 'new name' +}, { + cancelToken: source.token +}) + +// cancel the request (the message parameter is optional) +source.cancel('Operation canceled by the user.'); +``` + +You can also create a cancel token by passing an executor function to the `CancelToken` constructor: + +```js +const CancelToken = axios.CancelToken; +let cancel; + +axios.get('/user/12345', { + cancelToken: new CancelToken(function executor(c) { + // An executor function receives a cancel function as a parameter + cancel = c; + }) +}); + +// cancel the request +cancel(); +``` + +> Note: you can cancel several requests with the same cancel token. +> If a cancellation token is already cancelled at the moment of starting an Axios request, then the request is cancelled immediately, without any attempts to make real request. + +## Using application/x-www-form-urlencoded format + +By default, axios serializes JavaScript objects to `JSON`. To send data in the `application/x-www-form-urlencoded` format instead, you can use one of the following options. + +### Browser + +In a browser, you can use the [`URLSearchParams`](https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams) API as follows: + +```js +const params = new URLSearchParams(); +params.append('param1', 'value1'); +params.append('param2', 'value2'); +axios.post('/foo', params); +``` + +> Note that `URLSearchParams` is not supported by all browsers (see [caniuse.com](http://www.caniuse.com/#feat=urlsearchparams)), but there is a [polyfill](https://github.com/WebReflection/url-search-params) available (make sure to polyfill the global environment). + +Alternatively, you can encode data using the [`qs`](https://github.com/ljharb/qs) library: + +```js +const qs = require('qs'); +axios.post('/foo', qs.stringify({ 'bar': 123 })); +``` + +Or in another way (ES6), + +```js +import qs from 'qs'; +const data = { 'bar': 123 }; +const options = { + method: 'POST', + headers: { 'content-type': 'application/x-www-form-urlencoded' }, + data: qs.stringify(data), + url, +}; +axios(options); +``` + +### Node.js + +#### Query string + +In node.js, you can use the [`querystring`](https://nodejs.org/api/querystring.html) module as follows: + +```js +const querystring = require('querystring'); +axios.post('http://something.com/', querystring.stringify({ foo: 'bar' })); +``` + +or ['URLSearchParams'](https://nodejs.org/api/url.html#url_class_urlsearchparams) from ['url module'](https://nodejs.org/api/url.html) as follows: + +```js +const url = require('url'); +const params = new url.URLSearchParams({ foo: 'bar' }); +axios.post('http://something.com/', params.toString()); +``` + +You can also use the [`qs`](https://github.com/ljharb/qs) library. + +###### NOTE +The `qs` library is preferable if you need to stringify nested objects, as the `querystring` method has known issues with that use case (https://github.com/nodejs/node-v0.x-archive/issues/1665). + +#### Form data + +In node.js, you can use the [`form-data`](https://github.com/form-data/form-data) library as follows: + +```js +const FormData = require('form-data'); + +const form = new FormData(); +form.append('my_field', 'my value'); +form.append('my_buffer', new Buffer(10)); +form.append('my_file', fs.createReadStream('/foo/bar.jpg')); + +axios.post('https://example.com', form, { headers: form.getHeaders() }) +``` + +Alternatively, use an interceptor: + +```js +axios.interceptors.request.use(config => { + if (config.data instanceof FormData) { + Object.assign(config.headers, config.data.getHeaders()); + } + return config; +}); +``` + +## Semver + +Until axios reaches a `1.0` release, breaking changes will be released with a new minor version. For example `0.5.1`, and `0.5.4` will have the same API, but `0.6.0` will have breaking changes. + +## Promises + +axios depends on a native ES6 Promise implementation to be [supported](http://caniuse.com/promises). +If your environment doesn't support ES6 Promises, you can [polyfill](https://github.com/jakearchibald/es6-promise). + +## TypeScript + +axios includes [TypeScript](http://typescriptlang.org) definitions and a type guard for axios errors. + +```typescript +let user: User = null; +try { + const { data } = await axios.get('/user?ID=12345'); + user = data.userDetails; +} catch (error) { + if (axios.isAxiosError(error)) { + handleAxiosError(error); + } else { + handleUnexpectedError(error); + } +} +``` + +## Online one-click setup + +You can use Gitpod an online IDE(which is free for Open Source) for contributing or running the examples online. + +[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/axios/axios/blob/master/examples/server.js) + + +## Resources + +* [Changelog](https://github.com/axios/axios/blob/master/CHANGELOG.md) +* [Upgrade Guide](https://github.com/axios/axios/blob/master/UPGRADE_GUIDE.md) +* [Ecosystem](https://github.com/axios/axios/blob/master/ECOSYSTEM.md) +* [Contributing Guide](https://github.com/axios/axios/blob/master/CONTRIBUTING.md) +* [Code of Conduct](https://github.com/axios/axios/blob/master/CODE_OF_CONDUCT.md) + +## Credits + +axios is heavily inspired by the [$http service](https://docs.angularjs.org/api/ng/service/$http) provided in [Angular](https://angularjs.org/). Ultimately axios is an effort to provide a standalone `$http`-like service for use outside of Angular. + +## License + +[MIT](LICENSE) diff --git a/node_modules/@shineiichijo/nhentai-pdf/node_modules/axios/SECURITY.md b/node_modules/@shineiichijo/nhentai-pdf/node_modules/axios/SECURITY.md new file mode 100644 index 000000000..353df9a2f --- /dev/null +++ b/node_modules/@shineiichijo/nhentai-pdf/node_modules/axios/SECURITY.md @@ -0,0 +1,5 @@ +# Security Policy + +## Reporting a Vulnerability + +Please report security issues to jasonsaayman@gmail.com diff --git a/node_modules/@shineiichijo/nhentai-pdf/node_modules/axios/UPGRADE_GUIDE.md b/node_modules/@shineiichijo/nhentai-pdf/node_modules/axios/UPGRADE_GUIDE.md new file mode 100644 index 000000000..745e80492 --- /dev/null +++ b/node_modules/@shineiichijo/nhentai-pdf/node_modules/axios/UPGRADE_GUIDE.md @@ -0,0 +1,162 @@ +# Upgrade Guide + +### 0.15.x -> 0.16.0 + +#### `Promise` Type Declarations + +The `Promise` type declarations have been removed from the axios typings in favor of the built-in type declarations. If you use axios in a TypeScript project that targets `ES5`, please make sure to include the `es2015.promise` lib. Please see [this post](https://blog.mariusschulz.com/2016/11/25/typescript-2-0-built-in-type-declarations) for details. + +### 0.13.x -> 0.14.0 + +#### TypeScript Definitions + +The axios TypeScript definitions have been updated to match the axios API and use the ES2015 module syntax. + +Please use the following `import` statement to import axios in TypeScript: + +```typescript +import axios from 'axios'; + +axios.get('/foo') + .then(response => console.log(response)) + .catch(error => console.log(error)); +``` + +#### `agent` Config Option + +The `agent` config option has been replaced with two new options: `httpAgent` and `httpsAgent`. Please use them instead. + +```js +{ + // Define a custom agent for HTTP + httpAgent: new http.Agent({ keepAlive: true }), + // Define a custom agent for HTTPS + httpsAgent: new https.Agent({ keepAlive: true }) +} +``` + +#### `progress` Config Option + +The `progress` config option has been replaced with the `onUploadProgress` and `onDownloadProgress` options. + +```js +{ + // Define a handler for upload progress events + onUploadProgress: function (progressEvent) { + // ... + }, + + // Define a handler for download progress events + onDownloadProgress: function (progressEvent) { + // ... + } +} +``` + +### 0.12.x -> 0.13.0 + +The `0.13.0` release contains several changes to custom adapters and error handling. + +#### Error Handling + +Previous to this release an error could either be a server response with bad status code or an actual `Error`. With this release Promise will always reject with an `Error`. In the case that a response was received, the `Error` will also include the response. + +```js +axios.get('/user/12345') + .catch((error) => { + console.log(error.message); + console.log(error.code); // Not always specified + console.log(error.config); // The config that was used to make the request + console.log(error.response); // Only available if response was received from the server + }); +``` + +#### Request Adapters + +This release changes a few things about how request adapters work. Please take note if you are using your own custom adapter. + +1. Response transformer is now called outside of adapter. +2. Request adapter returns a `Promise`. + +This means that you no longer need to invoke `transformData` on response data. You will also no longer receive `resolve` and `reject` as arguments in your adapter. + +Previous code: + +```js +function myAdapter(resolve, reject, config) { + var response = { + data: transformData( + responseData, + responseHeaders, + config.transformResponse + ), + status: request.status, + statusText: request.statusText, + headers: responseHeaders + }; + settle(resolve, reject, response); +} +``` + +New code: + +```js +function myAdapter(config) { + return new Promise(function (resolve, reject) { + var response = { + data: responseData, + status: request.status, + statusText: request.statusText, + headers: responseHeaders + }; + settle(resolve, reject, response); + }); +} +``` + +See the related commits for more details: +- [Response transformers](https://github.com/axios/axios/commit/10eb23865101f9347570552c04e9d6211376e25e) +- [Request adapter Promise](https://github.com/axios/axios/commit/157efd5615890301824e3121cc6c9d2f9b21f94a) + +### 0.5.x -> 0.6.0 + +The `0.6.0` release contains mostly bug fixes, but there are a couple things to be aware of when upgrading. + +#### ES6 Promise Polyfill + +Up until the `0.6.0` release ES6 `Promise` was being polyfilled using [es6-promise](https://github.com/jakearchibald/es6-promise). With this release, the polyfill has been removed, and you will need to supply it yourself if your environment needs it. + +```js +require('es6-promise').polyfill(); +var axios = require('axios'); +``` + +This will polyfill the global environment, and only needs to be done once. + +#### `axios.success`/`axios.error` + +The `success`, and `error` aliases were deprecated in [0.4.0](https://github.com/axios/axios/blob/master/CHANGELOG.md#040-oct-03-2014). As of this release they have been removed entirely. Instead please use `axios.then`, and `axios.catch` respectively. + +```js +axios.get('some/url') + .then(function (res) { + /* ... */ + }) + .catch(function (err) { + /* ... */ + }); +``` + +#### UMD + +Previous versions of axios shipped with an AMD, CommonJS, and Global build. This has all been rolled into a single UMD build. + +```js +// AMD +require(['bower_components/axios/dist/axios'], function (axios) { + /* ... */ +}); + +// CommonJS +var axios = require('axios/dist/axios'); +``` diff --git a/node_modules/@shineiichijo/nhentai-pdf/node_modules/axios/dist/axios.js b/node_modules/@shineiichijo/nhentai-pdf/node_modules/axios/dist/axios.js new file mode 100644 index 000000000..f25391064 --- /dev/null +++ b/node_modules/@shineiichijo/nhentai-pdf/node_modules/axios/dist/axios.js @@ -0,0 +1,2193 @@ +/* axios v0.21.4 | (c) 2021 by Matt Zabriskie */ +(function webpackUniversalModuleDefinition(root, factory) { + if(typeof exports === 'object' && typeof module === 'object') + module.exports = factory(); + else if(typeof define === 'function' && define.amd) + define([], factory); + else if(typeof exports === 'object') + exports["axios"] = factory(); + else + root["axios"] = factory(); +})(window, function() { +return /******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) { +/******/ return installedModules[moduleId].exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ i: moduleId, +/******/ l: false, +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __webpack_require__.c = installedModules; +/******/ +/******/ // define getter function for harmony exports +/******/ __webpack_require__.d = function(exports, name, getter) { +/******/ if(!__webpack_require__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); +/******/ } +/******/ }; +/******/ +/******/ // define __esModule on exports +/******/ __webpack_require__.r = function(exports) { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ +/******/ // create a fake namespace object +/******/ // mode & 1: value is a module id, require it +/******/ // mode & 2: merge all properties of value into the ns +/******/ // mode & 4: return value when already ns object +/******/ // mode & 8|1: behave like require +/******/ __webpack_require__.t = function(value, mode) { +/******/ if(mode & 1) value = __webpack_require__(value); +/******/ if(mode & 8) return value; +/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; +/******/ var ns = Object.create(null); +/******/ __webpack_require__.r(ns); +/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); +/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); +/******/ return ns; +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __webpack_require__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __webpack_require__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = ""; +/******/ +/******/ +/******/ // Load entry module and return exports +/******/ return __webpack_require__(__webpack_require__.s = "./index.js"); +/******/ }) +/************************************************************************/ +/******/ ({ + +/***/ "./index.js": +/*!******************!*\ + !*** ./index.js ***! + \******************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +module.exports = __webpack_require__(/*! ./lib/axios */ "./lib/axios.js"); + +/***/ }), + +/***/ "./lib/adapters/xhr.js": +/*!*****************************!*\ + !*** ./lib/adapters/xhr.js ***! + \*****************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var utils = __webpack_require__(/*! ./../utils */ "./lib/utils.js"); +var settle = __webpack_require__(/*! ./../core/settle */ "./lib/core/settle.js"); +var cookies = __webpack_require__(/*! ./../helpers/cookies */ "./lib/helpers/cookies.js"); +var buildURL = __webpack_require__(/*! ./../helpers/buildURL */ "./lib/helpers/buildURL.js"); +var buildFullPath = __webpack_require__(/*! ../core/buildFullPath */ "./lib/core/buildFullPath.js"); +var parseHeaders = __webpack_require__(/*! ./../helpers/parseHeaders */ "./lib/helpers/parseHeaders.js"); +var isURLSameOrigin = __webpack_require__(/*! ./../helpers/isURLSameOrigin */ "./lib/helpers/isURLSameOrigin.js"); +var createError = __webpack_require__(/*! ../core/createError */ "./lib/core/createError.js"); + +module.exports = function xhrAdapter(config) { + return new Promise(function dispatchXhrRequest(resolve, reject) { + var requestData = config.data; + var requestHeaders = config.headers; + var responseType = config.responseType; + + if (utils.isFormData(requestData)) { + delete requestHeaders['Content-Type']; // Let the browser set it + } + + var request = new XMLHttpRequest(); + + // HTTP basic authentication + if (config.auth) { + var username = config.auth.username || ''; + var password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : ''; + requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password); + } + + var fullPath = buildFullPath(config.baseURL, config.url); + request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true); + + // Set the request timeout in MS + request.timeout = config.timeout; + + function onloadend() { + if (!request) { + return; + } + // Prepare the response + var responseHeaders = 'getAllResponseHeaders' in request ? parseHeaders(request.getAllResponseHeaders()) : null; + var responseData = !responseType || responseType === 'text' || responseType === 'json' ? + request.responseText : request.response; + var response = { + data: responseData, + status: request.status, + statusText: request.statusText, + headers: responseHeaders, + config: config, + request: request + }; + + settle(resolve, reject, response); + + // Clean up request + request = null; + } + + if ('onloadend' in request) { + // Use onloadend if available + request.onloadend = onloadend; + } else { + // Listen for ready state to emulate onloadend + request.onreadystatechange = function handleLoad() { + if (!request || request.readyState !== 4) { + return; + } + + // The request errored out and we didn't get a response, this will be + // handled by onerror instead + // With one exception: request that using file: protocol, most browsers + // will return status as 0 even though it's a successful request + if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) { + return; + } + // readystate handler is calling before onerror or ontimeout handlers, + // so we should call onloadend on the next 'tick' + setTimeout(onloadend); + }; + } + + // Handle browser request cancellation (as opposed to a manual cancellation) + request.onabort = function handleAbort() { + if (!request) { + return; + } + + reject(createError('Request aborted', config, 'ECONNABORTED', request)); + + // Clean up request + request = null; + }; + + // Handle low level network errors + request.onerror = function handleError() { + // Real errors are hidden from us by the browser + // onerror should only fire if it's a network error + reject(createError('Network Error', config, null, request)); + + // Clean up request + request = null; + }; + + // Handle timeout + request.ontimeout = function handleTimeout() { + var timeoutErrorMessage = 'timeout of ' + config.timeout + 'ms exceeded'; + if (config.timeoutErrorMessage) { + timeoutErrorMessage = config.timeoutErrorMessage; + } + reject(createError( + timeoutErrorMessage, + config, + config.transitional && config.transitional.clarifyTimeoutError ? 'ETIMEDOUT' : 'ECONNABORTED', + request)); + + // Clean up request + request = null; + }; + + // Add xsrf header + // This is only done if running in a standard browser environment. + // Specifically not if we're in a web worker, or react-native. + if (utils.isStandardBrowserEnv()) { + // Add xsrf header + var xsrfValue = (config.withCredentials || isURLSameOrigin(fullPath)) && config.xsrfCookieName ? + cookies.read(config.xsrfCookieName) : + undefined; + + if (xsrfValue) { + requestHeaders[config.xsrfHeaderName] = xsrfValue; + } + } + + // Add headers to the request + if ('setRequestHeader' in request) { + utils.forEach(requestHeaders, function setRequestHeader(val, key) { + if (typeof requestData === 'undefined' && key.toLowerCase() === 'content-type') { + // Remove Content-Type if data is undefined + delete requestHeaders[key]; + } else { + // Otherwise add header to the request + request.setRequestHeader(key, val); + } + }); + } + + // Add withCredentials to request if needed + if (!utils.isUndefined(config.withCredentials)) { + request.withCredentials = !!config.withCredentials; + } + + // Add responseType to request if needed + if (responseType && responseType !== 'json') { + request.responseType = config.responseType; + } + + // Handle progress if needed + if (typeof config.onDownloadProgress === 'function') { + request.addEventListener('progress', config.onDownloadProgress); + } + + // Not all browsers support upload events + if (typeof config.onUploadProgress === 'function' && request.upload) { + request.upload.addEventListener('progress', config.onUploadProgress); + } + + if (config.cancelToken) { + // Handle cancellation + config.cancelToken.promise.then(function onCanceled(cancel) { + if (!request) { + return; + } + + request.abort(); + reject(cancel); + // Clean up request + request = null; + }); + } + + if (!requestData) { + requestData = null; + } + + // Send the request + request.send(requestData); + }); +}; + + +/***/ }), + +/***/ "./lib/axios.js": +/*!**********************!*\ + !*** ./lib/axios.js ***! + \**********************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var utils = __webpack_require__(/*! ./utils */ "./lib/utils.js"); +var bind = __webpack_require__(/*! ./helpers/bind */ "./lib/helpers/bind.js"); +var Axios = __webpack_require__(/*! ./core/Axios */ "./lib/core/Axios.js"); +var mergeConfig = __webpack_require__(/*! ./core/mergeConfig */ "./lib/core/mergeConfig.js"); +var defaults = __webpack_require__(/*! ./defaults */ "./lib/defaults.js"); + +/** + * Create an instance of Axios + * + * @param {Object} defaultConfig The default config for the instance + * @return {Axios} A new instance of Axios + */ +function createInstance(defaultConfig) { + var context = new Axios(defaultConfig); + var instance = bind(Axios.prototype.request, context); + + // Copy axios.prototype to instance + utils.extend(instance, Axios.prototype, context); + + // Copy context to instance + utils.extend(instance, context); + + return instance; +} + +// Create the default instance to be exported +var axios = createInstance(defaults); + +// Expose Axios class to allow class inheritance +axios.Axios = Axios; + +// Factory for creating new instances +axios.create = function create(instanceConfig) { + return createInstance(mergeConfig(axios.defaults, instanceConfig)); +}; + +// Expose Cancel & CancelToken +axios.Cancel = __webpack_require__(/*! ./cancel/Cancel */ "./lib/cancel/Cancel.js"); +axios.CancelToken = __webpack_require__(/*! ./cancel/CancelToken */ "./lib/cancel/CancelToken.js"); +axios.isCancel = __webpack_require__(/*! ./cancel/isCancel */ "./lib/cancel/isCancel.js"); + +// Expose all/spread +axios.all = function all(promises) { + return Promise.all(promises); +}; +axios.spread = __webpack_require__(/*! ./helpers/spread */ "./lib/helpers/spread.js"); + +// Expose isAxiosError +axios.isAxiosError = __webpack_require__(/*! ./helpers/isAxiosError */ "./lib/helpers/isAxiosError.js"); + +module.exports = axios; + +// Allow use of default import syntax in TypeScript +module.exports.default = axios; + + +/***/ }), + +/***/ "./lib/cancel/Cancel.js": +/*!******************************!*\ + !*** ./lib/cancel/Cancel.js ***! + \******************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +/** + * A `Cancel` is an object that is thrown when an operation is canceled. + * + * @class + * @param {string=} message The message. + */ +function Cancel(message) { + this.message = message; +} + +Cancel.prototype.toString = function toString() { + return 'Cancel' + (this.message ? ': ' + this.message : ''); +}; + +Cancel.prototype.__CANCEL__ = true; + +module.exports = Cancel; + + +/***/ }), + +/***/ "./lib/cancel/CancelToken.js": +/*!***********************************!*\ + !*** ./lib/cancel/CancelToken.js ***! + \***********************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var Cancel = __webpack_require__(/*! ./Cancel */ "./lib/cancel/Cancel.js"); + +/** + * A `CancelToken` is an object that can be used to request cancellation of an operation. + * + * @class + * @param {Function} executor The executor function. + */ +function CancelToken(executor) { + if (typeof executor !== 'function') { + throw new TypeError('executor must be a function.'); + } + + var resolvePromise; + this.promise = new Promise(function promiseExecutor(resolve) { + resolvePromise = resolve; + }); + + var token = this; + executor(function cancel(message) { + if (token.reason) { + // Cancellation has already been requested + return; + } + + token.reason = new Cancel(message); + resolvePromise(token.reason); + }); +} + +/** + * Throws a `Cancel` if cancellation has been requested. + */ +CancelToken.prototype.throwIfRequested = function throwIfRequested() { + if (this.reason) { + throw this.reason; + } +}; + +/** + * Returns an object that contains a new `CancelToken` and a function that, when called, + * cancels the `CancelToken`. + */ +CancelToken.source = function source() { + var cancel; + var token = new CancelToken(function executor(c) { + cancel = c; + }); + return { + token: token, + cancel: cancel + }; +}; + +module.exports = CancelToken; + + +/***/ }), + +/***/ "./lib/cancel/isCancel.js": +/*!********************************!*\ + !*** ./lib/cancel/isCancel.js ***! + \********************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +module.exports = function isCancel(value) { + return !!(value && value.__CANCEL__); +}; + + +/***/ }), + +/***/ "./lib/core/Axios.js": +/*!***************************!*\ + !*** ./lib/core/Axios.js ***! + \***************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var utils = __webpack_require__(/*! ./../utils */ "./lib/utils.js"); +var buildURL = __webpack_require__(/*! ../helpers/buildURL */ "./lib/helpers/buildURL.js"); +var InterceptorManager = __webpack_require__(/*! ./InterceptorManager */ "./lib/core/InterceptorManager.js"); +var dispatchRequest = __webpack_require__(/*! ./dispatchRequest */ "./lib/core/dispatchRequest.js"); +var mergeConfig = __webpack_require__(/*! ./mergeConfig */ "./lib/core/mergeConfig.js"); +var validator = __webpack_require__(/*! ../helpers/validator */ "./lib/helpers/validator.js"); + +var validators = validator.validators; +/** + * Create a new instance of Axios + * + * @param {Object} instanceConfig The default config for the instance + */ +function Axios(instanceConfig) { + this.defaults = instanceConfig; + this.interceptors = { + request: new InterceptorManager(), + response: new InterceptorManager() + }; +} + +/** + * Dispatch a request + * + * @param {Object} config The config specific for this request (merged with this.defaults) + */ +Axios.prototype.request = function request(config) { + /*eslint no-param-reassign:0*/ + // Allow for axios('example/url'[, config]) a la fetch API + if (typeof config === 'string') { + config = arguments[1] || {}; + config.url = arguments[0]; + } else { + config = config || {}; + } + + config = mergeConfig(this.defaults, config); + + // Set config.method + if (config.method) { + config.method = config.method.toLowerCase(); + } else if (this.defaults.method) { + config.method = this.defaults.method.toLowerCase(); + } else { + config.method = 'get'; + } + + var transitional = config.transitional; + + if (transitional !== undefined) { + validator.assertOptions(transitional, { + silentJSONParsing: validators.transitional(validators.boolean, '1.0.0'), + forcedJSONParsing: validators.transitional(validators.boolean, '1.0.0'), + clarifyTimeoutError: validators.transitional(validators.boolean, '1.0.0') + }, false); + } + + // filter out skipped interceptors + var requestInterceptorChain = []; + var synchronousRequestInterceptors = true; + this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) { + if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) { + return; + } + + synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous; + + requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected); + }); + + var responseInterceptorChain = []; + this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) { + responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected); + }); + + var promise; + + if (!synchronousRequestInterceptors) { + var chain = [dispatchRequest, undefined]; + + Array.prototype.unshift.apply(chain, requestInterceptorChain); + chain = chain.concat(responseInterceptorChain); + + promise = Promise.resolve(config); + while (chain.length) { + promise = promise.then(chain.shift(), chain.shift()); + } + + return promise; + } + + + var newConfig = config; + while (requestInterceptorChain.length) { + var onFulfilled = requestInterceptorChain.shift(); + var onRejected = requestInterceptorChain.shift(); + try { + newConfig = onFulfilled(newConfig); + } catch (error) { + onRejected(error); + break; + } + } + + try { + promise = dispatchRequest(newConfig); + } catch (error) { + return Promise.reject(error); + } + + while (responseInterceptorChain.length) { + promise = promise.then(responseInterceptorChain.shift(), responseInterceptorChain.shift()); + } + + return promise; +}; + +Axios.prototype.getUri = function getUri(config) { + config = mergeConfig(this.defaults, config); + return buildURL(config.url, config.params, config.paramsSerializer).replace(/^\?/, ''); +}; + +// Provide aliases for supported request methods +utils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) { + /*eslint func-names:0*/ + Axios.prototype[method] = function(url, config) { + return this.request(mergeConfig(config || {}, { + method: method, + url: url, + data: (config || {}).data + })); + }; +}); + +utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) { + /*eslint func-names:0*/ + Axios.prototype[method] = function(url, data, config) { + return this.request(mergeConfig(config || {}, { + method: method, + url: url, + data: data + })); + }; +}); + +module.exports = Axios; + + +/***/ }), + +/***/ "./lib/core/InterceptorManager.js": +/*!****************************************!*\ + !*** ./lib/core/InterceptorManager.js ***! + \****************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var utils = __webpack_require__(/*! ./../utils */ "./lib/utils.js"); + +function InterceptorManager() { + this.handlers = []; +} + +/** + * Add a new interceptor to the stack + * + * @param {Function} fulfilled The function to handle `then` for a `Promise` + * @param {Function} rejected The function to handle `reject` for a `Promise` + * + * @return {Number} An ID used to remove interceptor later + */ +InterceptorManager.prototype.use = function use(fulfilled, rejected, options) { + this.handlers.push({ + fulfilled: fulfilled, + rejected: rejected, + synchronous: options ? options.synchronous : false, + runWhen: options ? options.runWhen : null + }); + return this.handlers.length - 1; +}; + +/** + * Remove an interceptor from the stack + * + * @param {Number} id The ID that was returned by `use` + */ +InterceptorManager.prototype.eject = function eject(id) { + if (this.handlers[id]) { + this.handlers[id] = null; + } +}; + +/** + * Iterate over all the registered interceptors + * + * This method is particularly useful for skipping over any + * interceptors that may have become `null` calling `eject`. + * + * @param {Function} fn The function to call for each interceptor + */ +InterceptorManager.prototype.forEach = function forEach(fn) { + utils.forEach(this.handlers, function forEachHandler(h) { + if (h !== null) { + fn(h); + } + }); +}; + +module.exports = InterceptorManager; + + +/***/ }), + +/***/ "./lib/core/buildFullPath.js": +/*!***********************************!*\ + !*** ./lib/core/buildFullPath.js ***! + \***********************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var isAbsoluteURL = __webpack_require__(/*! ../helpers/isAbsoluteURL */ "./lib/helpers/isAbsoluteURL.js"); +var combineURLs = __webpack_require__(/*! ../helpers/combineURLs */ "./lib/helpers/combineURLs.js"); + +/** + * Creates a new URL by combining the baseURL with the requestedURL, + * only when the requestedURL is not already an absolute URL. + * If the requestURL is absolute, this function returns the requestedURL untouched. + * + * @param {string} baseURL The base URL + * @param {string} requestedURL Absolute or relative URL to combine + * @returns {string} The combined full path + */ +module.exports = function buildFullPath(baseURL, requestedURL) { + if (baseURL && !isAbsoluteURL(requestedURL)) { + return combineURLs(baseURL, requestedURL); + } + return requestedURL; +}; + + +/***/ }), + +/***/ "./lib/core/createError.js": +/*!*********************************!*\ + !*** ./lib/core/createError.js ***! + \*********************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var enhanceError = __webpack_require__(/*! ./enhanceError */ "./lib/core/enhanceError.js"); + +/** + * Create an Error with the specified message, config, error code, request and response. + * + * @param {string} message The error message. + * @param {Object} config The config. + * @param {string} [code] The error code (for example, 'ECONNABORTED'). + * @param {Object} [request] The request. + * @param {Object} [response] The response. + * @returns {Error} The created error. + */ +module.exports = function createError(message, config, code, request, response) { + var error = new Error(message); + return enhanceError(error, config, code, request, response); +}; + + +/***/ }), + +/***/ "./lib/core/dispatchRequest.js": +/*!*************************************!*\ + !*** ./lib/core/dispatchRequest.js ***! + \*************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var utils = __webpack_require__(/*! ./../utils */ "./lib/utils.js"); +var transformData = __webpack_require__(/*! ./transformData */ "./lib/core/transformData.js"); +var isCancel = __webpack_require__(/*! ../cancel/isCancel */ "./lib/cancel/isCancel.js"); +var defaults = __webpack_require__(/*! ../defaults */ "./lib/defaults.js"); + +/** + * Throws a `Cancel` if cancellation has been requested. + */ +function throwIfCancellationRequested(config) { + if (config.cancelToken) { + config.cancelToken.throwIfRequested(); + } +} + +/** + * Dispatch a request to the server using the configured adapter. + * + * @param {object} config The config that is to be used for the request + * @returns {Promise} The Promise to be fulfilled + */ +module.exports = function dispatchRequest(config) { + throwIfCancellationRequested(config); + + // Ensure headers exist + config.headers = config.headers || {}; + + // Transform request data + config.data = transformData.call( + config, + config.data, + config.headers, + config.transformRequest + ); + + // Flatten headers + config.headers = utils.merge( + config.headers.common || {}, + config.headers[config.method] || {}, + config.headers + ); + + utils.forEach( + ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'], + function cleanHeaderConfig(method) { + delete config.headers[method]; + } + ); + + var adapter = config.adapter || defaults.adapter; + + return adapter(config).then(function onAdapterResolution(response) { + throwIfCancellationRequested(config); + + // Transform response data + response.data = transformData.call( + config, + response.data, + response.headers, + config.transformResponse + ); + + return response; + }, function onAdapterRejection(reason) { + if (!isCancel(reason)) { + throwIfCancellationRequested(config); + + // Transform response data + if (reason && reason.response) { + reason.response.data = transformData.call( + config, + reason.response.data, + reason.response.headers, + config.transformResponse + ); + } + } + + return Promise.reject(reason); + }); +}; + + +/***/ }), + +/***/ "./lib/core/enhanceError.js": +/*!**********************************!*\ + !*** ./lib/core/enhanceError.js ***! + \**********************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +/** + * Update an Error with the specified config, error code, and response. + * + * @param {Error} error The error to update. + * @param {Object} config The config. + * @param {string} [code] The error code (for example, 'ECONNABORTED'). + * @param {Object} [request] The request. + * @param {Object} [response] The response. + * @returns {Error} The error. + */ +module.exports = function enhanceError(error, config, code, request, response) { + error.config = config; + if (code) { + error.code = code; + } + + error.request = request; + error.response = response; + error.isAxiosError = true; + + error.toJSON = function toJSON() { + return { + // Standard + message: this.message, + name: this.name, + // Microsoft + description: this.description, + number: this.number, + // Mozilla + fileName: this.fileName, + lineNumber: this.lineNumber, + columnNumber: this.columnNumber, + stack: this.stack, + // Axios + config: this.config, + code: this.code + }; + }; + return error; +}; + + +/***/ }), + +/***/ "./lib/core/mergeConfig.js": +/*!*********************************!*\ + !*** ./lib/core/mergeConfig.js ***! + \*********************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var utils = __webpack_require__(/*! ../utils */ "./lib/utils.js"); + +/** + * Config-specific merge-function which creates a new config-object + * by merging two configuration objects together. + * + * @param {Object} config1 + * @param {Object} config2 + * @returns {Object} New object resulting from merging config2 to config1 + */ +module.exports = function mergeConfig(config1, config2) { + // eslint-disable-next-line no-param-reassign + config2 = config2 || {}; + var config = {}; + + var valueFromConfig2Keys = ['url', 'method', 'data']; + var mergeDeepPropertiesKeys = ['headers', 'auth', 'proxy', 'params']; + var defaultToConfig2Keys = [ + 'baseURL', 'transformRequest', 'transformResponse', 'paramsSerializer', + 'timeout', 'timeoutMessage', 'withCredentials', 'adapter', 'responseType', 'xsrfCookieName', + 'xsrfHeaderName', 'onUploadProgress', 'onDownloadProgress', 'decompress', + 'maxContentLength', 'maxBodyLength', 'maxRedirects', 'transport', 'httpAgent', + 'httpsAgent', 'cancelToken', 'socketPath', 'responseEncoding' + ]; + var directMergeKeys = ['validateStatus']; + + function getMergedValue(target, source) { + if (utils.isPlainObject(target) && utils.isPlainObject(source)) { + return utils.merge(target, source); + } else if (utils.isPlainObject(source)) { + return utils.merge({}, source); + } else if (utils.isArray(source)) { + return source.slice(); + } + return source; + } + + function mergeDeepProperties(prop) { + if (!utils.isUndefined(config2[prop])) { + config[prop] = getMergedValue(config1[prop], config2[prop]); + } else if (!utils.isUndefined(config1[prop])) { + config[prop] = getMergedValue(undefined, config1[prop]); + } + } + + utils.forEach(valueFromConfig2Keys, function valueFromConfig2(prop) { + if (!utils.isUndefined(config2[prop])) { + config[prop] = getMergedValue(undefined, config2[prop]); + } + }); + + utils.forEach(mergeDeepPropertiesKeys, mergeDeepProperties); + + utils.forEach(defaultToConfig2Keys, function defaultToConfig2(prop) { + if (!utils.isUndefined(config2[prop])) { + config[prop] = getMergedValue(undefined, config2[prop]); + } else if (!utils.isUndefined(config1[prop])) { + config[prop] = getMergedValue(undefined, config1[prop]); + } + }); + + utils.forEach(directMergeKeys, function merge(prop) { + if (prop in config2) { + config[prop] = getMergedValue(config1[prop], config2[prop]); + } else if (prop in config1) { + config[prop] = getMergedValue(undefined, config1[prop]); + } + }); + + var axiosKeys = valueFromConfig2Keys + .concat(mergeDeepPropertiesKeys) + .concat(defaultToConfig2Keys) + .concat(directMergeKeys); + + var otherKeys = Object + .keys(config1) + .concat(Object.keys(config2)) + .filter(function filterAxiosKeys(key) { + return axiosKeys.indexOf(key) === -1; + }); + + utils.forEach(otherKeys, mergeDeepProperties); + + return config; +}; + + +/***/ }), + +/***/ "./lib/core/settle.js": +/*!****************************!*\ + !*** ./lib/core/settle.js ***! + \****************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var createError = __webpack_require__(/*! ./createError */ "./lib/core/createError.js"); + +/** + * Resolve or reject a Promise based on response status. + * + * @param {Function} resolve A function that resolves the promise. + * @param {Function} reject A function that rejects the promise. + * @param {object} response The response. + */ +module.exports = function settle(resolve, reject, response) { + var validateStatus = response.config.validateStatus; + if (!response.status || !validateStatus || validateStatus(response.status)) { + resolve(response); + } else { + reject(createError( + 'Request failed with status code ' + response.status, + response.config, + null, + response.request, + response + )); + } +}; + + +/***/ }), + +/***/ "./lib/core/transformData.js": +/*!***********************************!*\ + !*** ./lib/core/transformData.js ***! + \***********************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var utils = __webpack_require__(/*! ./../utils */ "./lib/utils.js"); +var defaults = __webpack_require__(/*! ./../defaults */ "./lib/defaults.js"); + +/** + * Transform the data for a request or a response + * + * @param {Object|String} data The data to be transformed + * @param {Array} headers The headers for the request or response + * @param {Array|Function} fns A single function or Array of functions + * @returns {*} The resulting transformed data + */ +module.exports = function transformData(data, headers, fns) { + var context = this || defaults; + /*eslint no-param-reassign:0*/ + utils.forEach(fns, function transform(fn) { + data = fn.call(context, data, headers); + }); + + return data; +}; + + +/***/ }), + +/***/ "./lib/defaults.js": +/*!*************************!*\ + !*** ./lib/defaults.js ***! + \*************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var utils = __webpack_require__(/*! ./utils */ "./lib/utils.js"); +var normalizeHeaderName = __webpack_require__(/*! ./helpers/normalizeHeaderName */ "./lib/helpers/normalizeHeaderName.js"); +var enhanceError = __webpack_require__(/*! ./core/enhanceError */ "./lib/core/enhanceError.js"); + +var DEFAULT_CONTENT_TYPE = { + 'Content-Type': 'application/x-www-form-urlencoded' +}; + +function setContentTypeIfUnset(headers, value) { + if (!utils.isUndefined(headers) && utils.isUndefined(headers['Content-Type'])) { + headers['Content-Type'] = value; + } +} + +function getDefaultAdapter() { + var adapter; + if (typeof XMLHttpRequest !== 'undefined') { + // For browsers use XHR adapter + adapter = __webpack_require__(/*! ./adapters/xhr */ "./lib/adapters/xhr.js"); + } else if (typeof process !== 'undefined' && Object.prototype.toString.call(process) === '[object process]') { + // For node use HTTP adapter + adapter = __webpack_require__(/*! ./adapters/http */ "./lib/adapters/xhr.js"); + } + return adapter; +} + +function stringifySafely(rawValue, parser, encoder) { + if (utils.isString(rawValue)) { + try { + (parser || JSON.parse)(rawValue); + return utils.trim(rawValue); + } catch (e) { + if (e.name !== 'SyntaxError') { + throw e; + } + } + } + + return (encoder || JSON.stringify)(rawValue); +} + +var defaults = { + + transitional: { + silentJSONParsing: true, + forcedJSONParsing: true, + clarifyTimeoutError: false + }, + + adapter: getDefaultAdapter(), + + transformRequest: [function transformRequest(data, headers) { + normalizeHeaderName(headers, 'Accept'); + normalizeHeaderName(headers, 'Content-Type'); + + if (utils.isFormData(data) || + utils.isArrayBuffer(data) || + utils.isBuffer(data) || + utils.isStream(data) || + utils.isFile(data) || + utils.isBlob(data) + ) { + return data; + } + if (utils.isArrayBufferView(data)) { + return data.buffer; + } + if (utils.isURLSearchParams(data)) { + setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8'); + return data.toString(); + } + if (utils.isObject(data) || (headers && headers['Content-Type'] === 'application/json')) { + setContentTypeIfUnset(headers, 'application/json'); + return stringifySafely(data); + } + return data; + }], + + transformResponse: [function transformResponse(data) { + var transitional = this.transitional; + var silentJSONParsing = transitional && transitional.silentJSONParsing; + var forcedJSONParsing = transitional && transitional.forcedJSONParsing; + var strictJSONParsing = !silentJSONParsing && this.responseType === 'json'; + + if (strictJSONParsing || (forcedJSONParsing && utils.isString(data) && data.length)) { + try { + return JSON.parse(data); + } catch (e) { + if (strictJSONParsing) { + if (e.name === 'SyntaxError') { + throw enhanceError(e, this, 'E_JSON_PARSE'); + } + throw e; + } + } + } + + return data; + }], + + /** + * A timeout in milliseconds to abort a request. If set to 0 (default) a + * timeout is not created. + */ + timeout: 0, + + xsrfCookieName: 'XSRF-TOKEN', + xsrfHeaderName: 'X-XSRF-TOKEN', + + maxContentLength: -1, + maxBodyLength: -1, + + validateStatus: function validateStatus(status) { + return status >= 200 && status < 300; + } +}; + +defaults.headers = { + common: { + 'Accept': 'application/json, text/plain, */*' + } +}; + +utils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) { + defaults.headers[method] = {}; +}); + +utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) { + defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE); +}); + +module.exports = defaults; + + +/***/ }), + +/***/ "./lib/helpers/bind.js": +/*!*****************************!*\ + !*** ./lib/helpers/bind.js ***! + \*****************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +module.exports = function bind(fn, thisArg) { + return function wrap() { + var args = new Array(arguments.length); + for (var i = 0; i < args.length; i++) { + args[i] = arguments[i]; + } + return fn.apply(thisArg, args); + }; +}; + + +/***/ }), + +/***/ "./lib/helpers/buildURL.js": +/*!*********************************!*\ + !*** ./lib/helpers/buildURL.js ***! + \*********************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var utils = __webpack_require__(/*! ./../utils */ "./lib/utils.js"); + +function encode(val) { + return encodeURIComponent(val). + replace(/%3A/gi, ':'). + replace(/%24/g, '$'). + replace(/%2C/gi, ','). + replace(/%20/g, '+'). + replace(/%5B/gi, '['). + replace(/%5D/gi, ']'); +} + +/** + * Build a URL by appending params to the end + * + * @param {string} url The base of the url (e.g., http://www.google.com) + * @param {object} [params] The params to be appended + * @returns {string} The formatted url + */ +module.exports = function buildURL(url, params, paramsSerializer) { + /*eslint no-param-reassign:0*/ + if (!params) { + return url; + } + + var serializedParams; + if (paramsSerializer) { + serializedParams = paramsSerializer(params); + } else if (utils.isURLSearchParams(params)) { + serializedParams = params.toString(); + } else { + var parts = []; + + utils.forEach(params, function serialize(val, key) { + if (val === null || typeof val === 'undefined') { + return; + } + + if (utils.isArray(val)) { + key = key + '[]'; + } else { + val = [val]; + } + + utils.forEach(val, function parseValue(v) { + if (utils.isDate(v)) { + v = v.toISOString(); + } else if (utils.isObject(v)) { + v = JSON.stringify(v); + } + parts.push(encode(key) + '=' + encode(v)); + }); + }); + + serializedParams = parts.join('&'); + } + + if (serializedParams) { + var hashmarkIndex = url.indexOf('#'); + if (hashmarkIndex !== -1) { + url = url.slice(0, hashmarkIndex); + } + + url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams; + } + + return url; +}; + + +/***/ }), + +/***/ "./lib/helpers/combineURLs.js": +/*!************************************!*\ + !*** ./lib/helpers/combineURLs.js ***! + \************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +/** + * Creates a new URL by combining the specified URLs + * + * @param {string} baseURL The base URL + * @param {string} relativeURL The relative URL + * @returns {string} The combined URL + */ +module.exports = function combineURLs(baseURL, relativeURL) { + return relativeURL + ? baseURL.replace(/\/+$/, '') + '/' + relativeURL.replace(/^\/+/, '') + : baseURL; +}; + + +/***/ }), + +/***/ "./lib/helpers/cookies.js": +/*!********************************!*\ + !*** ./lib/helpers/cookies.js ***! + \********************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var utils = __webpack_require__(/*! ./../utils */ "./lib/utils.js"); + +module.exports = ( + utils.isStandardBrowserEnv() ? + + // Standard browser envs support document.cookie + (function standardBrowserEnv() { + return { + write: function write(name, value, expires, path, domain, secure) { + var cookie = []; + cookie.push(name + '=' + encodeURIComponent(value)); + + if (utils.isNumber(expires)) { + cookie.push('expires=' + new Date(expires).toGMTString()); + } + + if (utils.isString(path)) { + cookie.push('path=' + path); + } + + if (utils.isString(domain)) { + cookie.push('domain=' + domain); + } + + if (secure === true) { + cookie.push('secure'); + } + + document.cookie = cookie.join('; '); + }, + + read: function read(name) { + var match = document.cookie.match(new RegExp('(^|;\\s*)(' + name + ')=([^;]*)')); + return (match ? decodeURIComponent(match[3]) : null); + }, + + remove: function remove(name) { + this.write(name, '', Date.now() - 86400000); + } + }; + })() : + + // Non standard browser env (web workers, react-native) lack needed support. + (function nonStandardBrowserEnv() { + return { + write: function write() {}, + read: function read() { return null; }, + remove: function remove() {} + }; + })() +); + + +/***/ }), + +/***/ "./lib/helpers/isAbsoluteURL.js": +/*!**************************************!*\ + !*** ./lib/helpers/isAbsoluteURL.js ***! + \**************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +/** + * Determines whether the specified URL is absolute + * + * @param {string} url The URL to test + * @returns {boolean} True if the specified URL is absolute, otherwise false + */ +module.exports = function isAbsoluteURL(url) { + // A URL is considered absolute if it begins with "://" or "//" (protocol-relative URL). + // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed + // by any combination of letters, digits, plus, period, or hyphen. + return /^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(url); +}; + + +/***/ }), + +/***/ "./lib/helpers/isAxiosError.js": +/*!*************************************!*\ + !*** ./lib/helpers/isAxiosError.js ***! + \*************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +/** + * Determines whether the payload is an error thrown by Axios + * + * @param {*} payload The value to test + * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false + */ +module.exports = function isAxiosError(payload) { + return (typeof payload === 'object') && (payload.isAxiosError === true); +}; + + +/***/ }), + +/***/ "./lib/helpers/isURLSameOrigin.js": +/*!****************************************!*\ + !*** ./lib/helpers/isURLSameOrigin.js ***! + \****************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var utils = __webpack_require__(/*! ./../utils */ "./lib/utils.js"); + +module.exports = ( + utils.isStandardBrowserEnv() ? + + // Standard browser envs have full support of the APIs needed to test + // whether the request URL is of the same origin as current location. + (function standardBrowserEnv() { + var msie = /(msie|trident)/i.test(navigator.userAgent); + var urlParsingNode = document.createElement('a'); + var originURL; + + /** + * Parse a URL to discover it's components + * + * @param {String} url The URL to be parsed + * @returns {Object} + */ + function resolveURL(url) { + var href = url; + + if (msie) { + // IE needs attribute set twice to normalize properties + urlParsingNode.setAttribute('href', href); + href = urlParsingNode.href; + } + + urlParsingNode.setAttribute('href', href); + + // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils + return { + href: urlParsingNode.href, + protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '', + host: urlParsingNode.host, + search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, '') : '', + hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '', + hostname: urlParsingNode.hostname, + port: urlParsingNode.port, + pathname: (urlParsingNode.pathname.charAt(0) === '/') ? + urlParsingNode.pathname : + '/' + urlParsingNode.pathname + }; + } + + originURL = resolveURL(window.location.href); + + /** + * Determine if a URL shares the same origin as the current location + * + * @param {String} requestURL The URL to test + * @returns {boolean} True if URL shares the same origin, otherwise false + */ + return function isURLSameOrigin(requestURL) { + var parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL; + return (parsed.protocol === originURL.protocol && + parsed.host === originURL.host); + }; + })() : + + // Non standard browser envs (web workers, react-native) lack needed support. + (function nonStandardBrowserEnv() { + return function isURLSameOrigin() { + return true; + }; + })() +); + + +/***/ }), + +/***/ "./lib/helpers/normalizeHeaderName.js": +/*!********************************************!*\ + !*** ./lib/helpers/normalizeHeaderName.js ***! + \********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var utils = __webpack_require__(/*! ../utils */ "./lib/utils.js"); + +module.exports = function normalizeHeaderName(headers, normalizedName) { + utils.forEach(headers, function processHeader(value, name) { + if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) { + headers[normalizedName] = value; + delete headers[name]; + } + }); +}; + + +/***/ }), + +/***/ "./lib/helpers/parseHeaders.js": +/*!*************************************!*\ + !*** ./lib/helpers/parseHeaders.js ***! + \*************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var utils = __webpack_require__(/*! ./../utils */ "./lib/utils.js"); + +// Headers whose duplicates are ignored by node +// c.f. https://nodejs.org/api/http.html#http_message_headers +var ignoreDuplicateOf = [ + 'age', 'authorization', 'content-length', 'content-type', 'etag', + 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since', + 'last-modified', 'location', 'max-forwards', 'proxy-authorization', + 'referer', 'retry-after', 'user-agent' +]; + +/** + * Parse headers into an object + * + * ``` + * Date: Wed, 27 Aug 2014 08:58:49 GMT + * Content-Type: application/json + * Connection: keep-alive + * Transfer-Encoding: chunked + * ``` + * + * @param {String} headers Headers needing to be parsed + * @returns {Object} Headers parsed into an object + */ +module.exports = function parseHeaders(headers) { + var parsed = {}; + var key; + var val; + var i; + + if (!headers) { return parsed; } + + utils.forEach(headers.split('\n'), function parser(line) { + i = line.indexOf(':'); + key = utils.trim(line.substr(0, i)).toLowerCase(); + val = utils.trim(line.substr(i + 1)); + + if (key) { + if (parsed[key] && ignoreDuplicateOf.indexOf(key) >= 0) { + return; + } + if (key === 'set-cookie') { + parsed[key] = (parsed[key] ? parsed[key] : []).concat([val]); + } else { + parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val; + } + } + }); + + return parsed; +}; + + +/***/ }), + +/***/ "./lib/helpers/spread.js": +/*!*******************************!*\ + !*** ./lib/helpers/spread.js ***! + \*******************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +/** + * Syntactic sugar for invoking a function and expanding an array for arguments. + * + * Common use case would be to use `Function.prototype.apply`. + * + * ```js + * function f(x, y, z) {} + * var args = [1, 2, 3]; + * f.apply(null, args); + * ``` + * + * With `spread` this example can be re-written. + * + * ```js + * spread(function(x, y, z) {})([1, 2, 3]); + * ``` + * + * @param {Function} callback + * @returns {Function} + */ +module.exports = function spread(callback) { + return function wrap(arr) { + return callback.apply(null, arr); + }; +}; + + +/***/ }), + +/***/ "./lib/helpers/validator.js": +/*!**********************************!*\ + !*** ./lib/helpers/validator.js ***! + \**********************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var pkg = __webpack_require__(/*! ./../../package.json */ "./package.json"); + +var validators = {}; + +// eslint-disable-next-line func-names +['object', 'boolean', 'number', 'function', 'string', 'symbol'].forEach(function(type, i) { + validators[type] = function validator(thing) { + return typeof thing === type || 'a' + (i < 1 ? 'n ' : ' ') + type; + }; +}); + +var deprecatedWarnings = {}; +var currentVerArr = pkg.version.split('.'); + +/** + * Compare package versions + * @param {string} version + * @param {string?} thanVersion + * @returns {boolean} + */ +function isOlderVersion(version, thanVersion) { + var pkgVersionArr = thanVersion ? thanVersion.split('.') : currentVerArr; + var destVer = version.split('.'); + for (var i = 0; i < 3; i++) { + if (pkgVersionArr[i] > destVer[i]) { + return true; + } else if (pkgVersionArr[i] < destVer[i]) { + return false; + } + } + return false; +} + +/** + * Transitional option validator + * @param {function|boolean?} validator + * @param {string?} version + * @param {string} message + * @returns {function} + */ +validators.transitional = function transitional(validator, version, message) { + var isDeprecated = version && isOlderVersion(version); + + function formatMessage(opt, desc) { + return '[Axios v' + pkg.version + '] Transitional option \'' + opt + '\'' + desc + (message ? '. ' + message : ''); + } + + // eslint-disable-next-line func-names + return function(value, opt, opts) { + if (validator === false) { + throw new Error(formatMessage(opt, ' has been removed in ' + version)); + } + + if (isDeprecated && !deprecatedWarnings[opt]) { + deprecatedWarnings[opt] = true; + // eslint-disable-next-line no-console + console.warn( + formatMessage( + opt, + ' has been deprecated since v' + version + ' and will be removed in the near future' + ) + ); + } + + return validator ? validator(value, opt, opts) : true; + }; +}; + +/** + * Assert object's properties type + * @param {object} options + * @param {object} schema + * @param {boolean?} allowUnknown + */ + +function assertOptions(options, schema, allowUnknown) { + if (typeof options !== 'object') { + throw new TypeError('options must be an object'); + } + var keys = Object.keys(options); + var i = keys.length; + while (i-- > 0) { + var opt = keys[i]; + var validator = schema[opt]; + if (validator) { + var value = options[opt]; + var result = value === undefined || validator(value, opt, options); + if (result !== true) { + throw new TypeError('option ' + opt + ' must be ' + result); + } + continue; + } + if (allowUnknown !== true) { + throw Error('Unknown option ' + opt); + } + } +} + +module.exports = { + isOlderVersion: isOlderVersion, + assertOptions: assertOptions, + validators: validators +}; + + +/***/ }), + +/***/ "./lib/utils.js": +/*!**********************!*\ + !*** ./lib/utils.js ***! + \**********************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var bind = __webpack_require__(/*! ./helpers/bind */ "./lib/helpers/bind.js"); + +// utils is a library of generic helper functions non-specific to axios + +var toString = Object.prototype.toString; + +/** + * Determine if a value is an Array + * + * @param {Object} val The value to test + * @returns {boolean} True if value is an Array, otherwise false + */ +function isArray(val) { + return toString.call(val) === '[object Array]'; +} + +/** + * Determine if a value is undefined + * + * @param {Object} val The value to test + * @returns {boolean} True if the value is undefined, otherwise false + */ +function isUndefined(val) { + return typeof val === 'undefined'; +} + +/** + * Determine if a value is a Buffer + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a Buffer, otherwise false + */ +function isBuffer(val) { + return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor) + && typeof val.constructor.isBuffer === 'function' && val.constructor.isBuffer(val); +} + +/** + * Determine if a value is an ArrayBuffer + * + * @param {Object} val The value to test + * @returns {boolean} True if value is an ArrayBuffer, otherwise false + */ +function isArrayBuffer(val) { + return toString.call(val) === '[object ArrayBuffer]'; +} + +/** + * Determine if a value is a FormData + * + * @param {Object} val The value to test + * @returns {boolean} True if value is an FormData, otherwise false + */ +function isFormData(val) { + return (typeof FormData !== 'undefined') && (val instanceof FormData); +} + +/** + * Determine if a value is a view on an ArrayBuffer + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false + */ +function isArrayBufferView(val) { + var result; + if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) { + result = ArrayBuffer.isView(val); + } else { + result = (val) && (val.buffer) && (val.buffer instanceof ArrayBuffer); + } + return result; +} + +/** + * Determine if a value is a String + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a String, otherwise false + */ +function isString(val) { + return typeof val === 'string'; +} + +/** + * Determine if a value is a Number + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a Number, otherwise false + */ +function isNumber(val) { + return typeof val === 'number'; +} + +/** + * Determine if a value is an Object + * + * @param {Object} val The value to test + * @returns {boolean} True if value is an Object, otherwise false + */ +function isObject(val) { + return val !== null && typeof val === 'object'; +} + +/** + * Determine if a value is a plain Object + * + * @param {Object} val The value to test + * @return {boolean} True if value is a plain Object, otherwise false + */ +function isPlainObject(val) { + if (toString.call(val) !== '[object Object]') { + return false; + } + + var prototype = Object.getPrototypeOf(val); + return prototype === null || prototype === Object.prototype; +} + +/** + * Determine if a value is a Date + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a Date, otherwise false + */ +function isDate(val) { + return toString.call(val) === '[object Date]'; +} + +/** + * Determine if a value is a File + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a File, otherwise false + */ +function isFile(val) { + return toString.call(val) === '[object File]'; +} + +/** + * Determine if a value is a Blob + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a Blob, otherwise false + */ +function isBlob(val) { + return toString.call(val) === '[object Blob]'; +} + +/** + * Determine if a value is a Function + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a Function, otherwise false + */ +function isFunction(val) { + return toString.call(val) === '[object Function]'; +} + +/** + * Determine if a value is a Stream + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a Stream, otherwise false + */ +function isStream(val) { + return isObject(val) && isFunction(val.pipe); +} + +/** + * Determine if a value is a URLSearchParams object + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a URLSearchParams object, otherwise false + */ +function isURLSearchParams(val) { + return typeof URLSearchParams !== 'undefined' && val instanceof URLSearchParams; +} + +/** + * Trim excess whitespace off the beginning and end of a string + * + * @param {String} str The String to trim + * @returns {String} The String freed of excess whitespace + */ +function trim(str) { + return str.trim ? str.trim() : str.replace(/^\s+|\s+$/g, ''); +} + +/** + * Determine if we're running in a standard browser environment + * + * This allows axios to run in a web worker, and react-native. + * Both environments support XMLHttpRequest, but not fully standard globals. + * + * web workers: + * typeof window -> undefined + * typeof document -> undefined + * + * react-native: + * navigator.product -> 'ReactNative' + * nativescript + * navigator.product -> 'NativeScript' or 'NS' + */ +function isStandardBrowserEnv() { + if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' || + navigator.product === 'NativeScript' || + navigator.product === 'NS')) { + return false; + } + return ( + typeof window !== 'undefined' && + typeof document !== 'undefined' + ); +} + +/** + * Iterate over an Array or an Object invoking a function for each item. + * + * If `obj` is an Array callback will be called passing + * the value, index, and complete array for each item. + * + * If 'obj' is an Object callback will be called passing + * the value, key, and complete object for each property. + * + * @param {Object|Array} obj The object to iterate + * @param {Function} fn The callback to invoke for each item + */ +function forEach(obj, fn) { + // Don't bother if no value provided + if (obj === null || typeof obj === 'undefined') { + return; + } + + // Force an array if not already something iterable + if (typeof obj !== 'object') { + /*eslint no-param-reassign:0*/ + obj = [obj]; + } + + if (isArray(obj)) { + // Iterate over array values + for (var i = 0, l = obj.length; i < l; i++) { + fn.call(null, obj[i], i, obj); + } + } else { + // Iterate over object keys + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) { + fn.call(null, obj[key], key, obj); + } + } + } +} + +/** + * Accepts varargs expecting each argument to be an object, then + * immutably merges the properties of each object and returns result. + * + * When multiple objects contain the same key the later object in + * the arguments list will take precedence. + * + * Example: + * + * ```js + * var result = merge({foo: 123}, {foo: 456}); + * console.log(result.foo); // outputs 456 + * ``` + * + * @param {Object} obj1 Object to merge + * @returns {Object} Result of all merge properties + */ +function merge(/* obj1, obj2, obj3, ... */) { + var result = {}; + function assignValue(val, key) { + if (isPlainObject(result[key]) && isPlainObject(val)) { + result[key] = merge(result[key], val); + } else if (isPlainObject(val)) { + result[key] = merge({}, val); + } else if (isArray(val)) { + result[key] = val.slice(); + } else { + result[key] = val; + } + } + + for (var i = 0, l = arguments.length; i < l; i++) { + forEach(arguments[i], assignValue); + } + return result; +} + +/** + * Extends object a by mutably adding to it the properties of object b. + * + * @param {Object} a The object to be extended + * @param {Object} b The object to copy properties from + * @param {Object} thisArg The object to bind function to + * @return {Object} The resulting value of object a + */ +function extend(a, b, thisArg) { + forEach(b, function assignValue(val, key) { + if (thisArg && typeof val === 'function') { + a[key] = bind(val, thisArg); + } else { + a[key] = val; + } + }); + return a; +} + +/** + * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM) + * + * @param {string} content with BOM + * @return {string} content value without BOM + */ +function stripBOM(content) { + if (content.charCodeAt(0) === 0xFEFF) { + content = content.slice(1); + } + return content; +} + +module.exports = { + isArray: isArray, + isArrayBuffer: isArrayBuffer, + isBuffer: isBuffer, + isFormData: isFormData, + isArrayBufferView: isArrayBufferView, + isString: isString, + isNumber: isNumber, + isObject: isObject, + isPlainObject: isPlainObject, + isUndefined: isUndefined, + isDate: isDate, + isFile: isFile, + isBlob: isBlob, + isFunction: isFunction, + isStream: isStream, + isURLSearchParams: isURLSearchParams, + isStandardBrowserEnv: isStandardBrowserEnv, + forEach: forEach, + merge: merge, + extend: extend, + trim: trim, + stripBOM: stripBOM +}; + + +/***/ }), + +/***/ "./package.json": +/*!**********************!*\ + !*** ./package.json ***! + \**********************/ +/*! exports provided: name, version, description, main, scripts, repository, keywords, author, license, bugs, homepage, devDependencies, browser, jsdelivr, unpkg, typings, dependencies, bundlesize, default */ +/***/ (function(module) { + +module.exports = JSON.parse("{\"name\":\"axios\",\"version\":\"0.21.4\",\"description\":\"Promise based HTTP client for the browser and node.js\",\"main\":\"index.js\",\"scripts\":{\"test\":\"grunt test\",\"start\":\"node ./sandbox/server.js\",\"build\":\"NODE_ENV=production grunt build\",\"preversion\":\"npm test\",\"version\":\"npm run build && grunt version && git add -A dist && git add CHANGELOG.md bower.json package.json\",\"postversion\":\"git push && git push --tags\",\"examples\":\"node ./examples/server.js\",\"coveralls\":\"cat coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js\",\"fix\":\"eslint --fix lib/**/*.js\"},\"repository\":{\"type\":\"git\",\"url\":\"https://github.com/axios/axios.git\"},\"keywords\":[\"xhr\",\"http\",\"ajax\",\"promise\",\"node\"],\"author\":\"Matt Zabriskie\",\"license\":\"MIT\",\"bugs\":{\"url\":\"https://github.com/axios/axios/issues\"},\"homepage\":\"https://axios-http.com\",\"devDependencies\":{\"coveralls\":\"^3.0.0\",\"es6-promise\":\"^4.2.4\",\"grunt\":\"^1.3.0\",\"grunt-banner\":\"^0.6.0\",\"grunt-cli\":\"^1.2.0\",\"grunt-contrib-clean\":\"^1.1.0\",\"grunt-contrib-watch\":\"^1.0.0\",\"grunt-eslint\":\"^23.0.0\",\"grunt-karma\":\"^4.0.0\",\"grunt-mocha-test\":\"^0.13.3\",\"grunt-ts\":\"^6.0.0-beta.19\",\"grunt-webpack\":\"^4.0.2\",\"istanbul-instrumenter-loader\":\"^1.0.0\",\"jasmine-core\":\"^2.4.1\",\"karma\":\"^6.3.2\",\"karma-chrome-launcher\":\"^3.1.0\",\"karma-firefox-launcher\":\"^2.1.0\",\"karma-jasmine\":\"^1.1.1\",\"karma-jasmine-ajax\":\"^0.1.13\",\"karma-safari-launcher\":\"^1.0.0\",\"karma-sauce-launcher\":\"^4.3.6\",\"karma-sinon\":\"^1.0.5\",\"karma-sourcemap-loader\":\"^0.3.8\",\"karma-webpack\":\"^4.0.2\",\"load-grunt-tasks\":\"^3.5.2\",\"minimist\":\"^1.2.0\",\"mocha\":\"^8.2.1\",\"sinon\":\"^4.5.0\",\"terser-webpack-plugin\":\"^4.2.3\",\"typescript\":\"^4.0.5\",\"url-search-params\":\"^0.10.0\",\"webpack\":\"^4.44.2\",\"webpack-dev-server\":\"^3.11.0\"},\"browser\":{\"./lib/adapters/http.js\":\"./lib/adapters/xhr.js\"},\"jsdelivr\":\"dist/axios.min.js\",\"unpkg\":\"dist/axios.min.js\",\"typings\":\"./index.d.ts\",\"dependencies\":{\"follow-redirects\":\"^1.14.0\"},\"bundlesize\":[{\"path\":\"./dist/axios.min.js\",\"threshold\":\"5kB\"}]}"); + +/***/ }) + +/******/ }); +}); +//# sourceMappingURL=axios.map \ No newline at end of file diff --git a/node_modules/@shineiichijo/nhentai-pdf/node_modules/axios/dist/axios.map b/node_modules/@shineiichijo/nhentai-pdf/node_modules/axios/dist/axios.map new file mode 100644 index 000000000..4aadb219e --- /dev/null +++ b/node_modules/@shineiichijo/nhentai-pdf/node_modules/axios/dist/axios.map @@ -0,0 +1 @@ +{"version":3,"sources":["webpack://axios/webpack/universalModuleDefinition","webpack://axios/webpack/bootstrap","webpack://axios/./index.js","webpack://axios/./lib/adapters/xhr.js","webpack://axios/./lib/axios.js","webpack://axios/./lib/cancel/Cancel.js","webpack://axios/./lib/cancel/CancelToken.js","webpack://axios/./lib/cancel/isCancel.js","webpack://axios/./lib/core/Axios.js","webpack://axios/./lib/core/InterceptorManager.js","webpack://axios/./lib/core/buildFullPath.js","webpack://axios/./lib/core/createError.js","webpack://axios/./lib/core/dispatchRequest.js","webpack://axios/./lib/core/enhanceError.js","webpack://axios/./lib/core/mergeConfig.js","webpack://axios/./lib/core/settle.js","webpack://axios/./lib/core/transformData.js","webpack://axios/./lib/defaults.js","webpack://axios/./lib/helpers/bind.js","webpack://axios/./lib/helpers/buildURL.js","webpack://axios/./lib/helpers/combineURLs.js","webpack://axios/./lib/helpers/cookies.js","webpack://axios/./lib/helpers/isAbsoluteURL.js","webpack://axios/./lib/helpers/isAxiosError.js","webpack://axios/./lib/helpers/isURLSameOrigin.js","webpack://axios/./lib/helpers/normalizeHeaderName.js","webpack://axios/./lib/helpers/parseHeaders.js","webpack://axios/./lib/helpers/spread.js","webpack://axios/./lib/helpers/validator.js","webpack://axios/./lib/utils.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,O;QCVA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA,0CAA0C,gCAAgC;QAC1E;QACA;;QAEA;QACA;QACA;QACA,wDAAwD,kBAAkB;QAC1E;QACA,iDAAiD,cAAc;QAC/D;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA,yCAAyC,iCAAiC;QAC1E,gHAAgH,mBAAmB,EAAE;QACrI;QACA;;QAEA;QACA;QACA;QACA,2BAA2B,0BAA0B,EAAE;QACvD,iCAAiC,eAAe;QAChD;QACA;QACA;;QAEA;QACA,sDAAsD,+DAA+D;;QAErH;QACA;;;QAGA;QACA;;;;;;;;;;;;AClFA,iBAAiB,mBAAO,CAAC,mCAAa,E;;;;;;;;;;;;ACAzB;;AAEb,YAAY,mBAAO,CAAC,kCAAY;AAChC,aAAa,mBAAO,CAAC,8CAAkB;AACvC,cAAc,mBAAO,CAAC,sDAAsB;AAC5C,eAAe,mBAAO,CAAC,wDAAuB;AAC9C,oBAAoB,mBAAO,CAAC,0DAAuB;AACnD,mBAAmB,mBAAO,CAAC,gEAA2B;AACtD,sBAAsB,mBAAO,CAAC,sEAA8B;AAC5D,kBAAkB,mBAAO,CAAC,sDAAqB;;AAE/C;AACA;AACA;AACA;AACA;;AAEA;AACA,4CAA4C;AAC5C;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;;;;;;;;;;;;;AC5La;;AAEb,YAAY,mBAAO,CAAC,+BAAS;AAC7B,WAAW,mBAAO,CAAC,6CAAgB;AACnC,YAAY,mBAAO,CAAC,yCAAc;AAClC,kBAAkB,mBAAO,CAAC,qDAAoB;AAC9C,eAAe,mBAAO,CAAC,qCAAY;;AAEnC;AACA;AACA;AACA,WAAW,OAAO;AAClB,YAAY,MAAM;AAClB;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,eAAe,mBAAO,CAAC,+CAAiB;AACxC,oBAAoB,mBAAO,CAAC,yDAAsB;AAClD,iBAAiB,mBAAO,CAAC,mDAAmB;;AAE5C;AACA;AACA;AACA;AACA,eAAe,mBAAO,CAAC,iDAAkB;;AAEzC;AACA,qBAAqB,mBAAO,CAAC,6DAAwB;;AAErD;;AAEA;AACA;;;;;;;;;;;;;ACvDa;;AAEb;AACA;AACA;AACA;AACA,WAAW,QAAQ;AACnB;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;;;;;;;;;;;;;AClBa;;AAEb,aAAa,mBAAO,CAAC,wCAAU;;AAE/B;AACA;AACA;AACA;AACA,WAAW,SAAS;AACpB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;;ACxDa;;AAEb;AACA;AACA;;;;;;;;;;;;;ACJa;;AAEb,YAAY,mBAAO,CAAC,kCAAY;AAChC,eAAe,mBAAO,CAAC,sDAAqB;AAC5C,yBAAyB,mBAAO,CAAC,8DAAsB;AACvD,sBAAsB,mBAAO,CAAC,wDAAmB;AACjD,kBAAkB,mBAAO,CAAC,gDAAe;AACzC,gBAAgB,mBAAO,CAAC,wDAAsB;;AAE9C;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA,GAAG;;AAEH;AACA;AACA;AACA,GAAG;;AAEH;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,gDAAgD;AAChD;AACA;AACA,yBAAyB;AACzB,KAAK;AACL;AACA,CAAC;;AAED;AACA;AACA;AACA,gDAAgD;AAChD;AACA;AACA;AACA,KAAK;AACL;AACA,CAAC;;AAED;;;;;;;;;;;;;ACnJa;;AAEb,YAAY,mBAAO,CAAC,kCAAY;;AAEhC;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,SAAS;AACpB,WAAW,SAAS;AACpB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,SAAS;AACpB;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;AAEA;;;;;;;;;;;;;ACrDa;;AAEb,oBAAoB,mBAAO,CAAC,gEAA0B;AACtD,kBAAkB,mBAAO,CAAC,4DAAwB;;AAElD;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACnBa;;AAEb,mBAAmB,mBAAO,CAAC,kDAAgB;;AAE3C;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,MAAM;AACnB;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACjBa;;AAEb,YAAY,mBAAO,CAAC,kCAAY;AAChC,oBAAoB,mBAAO,CAAC,oDAAiB;AAC7C,eAAe,mBAAO,CAAC,oDAAoB;AAC3C,eAAe,mBAAO,CAAC,sCAAa;;AAEpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,+BAA+B;AAC/B,uCAAuC;AACvC;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,GAAG;AACH;;;;;;;;;;;;;ACjFa;;AAEb;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,MAAM;AACnB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACzCa;;AAEb,YAAY,mBAAO,CAAC,gCAAU;;AAE9B;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL,2BAA2B;AAC3B,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;;AAEH;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;;AAEA;AACA;;;;;;;;;;;;;ACtFa;;AAEb,kBAAkB,mBAAO,CAAC,gDAAe;;AAEzC;AACA;AACA;AACA,WAAW,SAAS;AACpB,WAAW,SAAS;AACpB,WAAW,OAAO;AAClB;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACxBa;;AAEb,YAAY,mBAAO,CAAC,kCAAY;AAChC,eAAe,mBAAO,CAAC,wCAAe;;AAEtC;AACA;AACA;AACA,WAAW,cAAc;AACzB,WAAW,MAAM;AACjB,WAAW,eAAe;AAC1B,aAAa,EAAE;AACf;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;;;;;;;;;;;;;ACrBa;;AAEb,YAAY,mBAAO,CAAC,+BAAS;AAC7B,0BAA0B,mBAAO,CAAC,2EAA+B;AACjE,mBAAmB,mBAAO,CAAC,uDAAqB;;AAEhD;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc,mBAAO,CAAC,6CAAgB;AACtC,GAAG;AACH;AACA,cAAc,mBAAO,CAAC,8CAAiB;AACvC;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,GAAG;;AAEH;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wEAAwE;AACxE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,CAAC;;AAED;AACA;AACA,CAAC;;AAED;;;;;;;;;;;;;ACrIa;;AAEb;AACA;AACA;AACA,mBAAmB,iBAAiB;AACpC;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACVa;;AAEb,YAAY,mBAAO,CAAC,kCAAY;;AAEhC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,OAAO;AACP,KAAK;;AAEL;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;;;;;;;;;;;;ACrEa;;AAEb;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACba;;AAEb,YAAY,mBAAO,CAAC,kCAAY;;AAEhC;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,0CAA0C;AAC1C,SAAS;;AAET;AACA,4DAA4D,wBAAwB;AACpF;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,kCAAkC;AAClC,+BAA+B,aAAa,EAAE;AAC9C;AACA;AACA,KAAK;AACL;;;;;;;;;;;;;ACpDa;;AAEb;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACba;;AAEb;AACA;AACA;AACA,WAAW,EAAE;AACb,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;;;;;;;;;;;;ACVa;;AAEb,YAAY,mBAAO,CAAC,kCAAY;;AAEhC;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,cAAc,OAAO;AACrB,gBAAgB;AAChB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,cAAc,OAAO;AACrB,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;;;;;;;;;;;;ACnEa;;AAEb,YAAY,mBAAO,CAAC,gCAAU;;AAE9B;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;;;;;;;;;;;;ACXa;;AAEb,YAAY,mBAAO,CAAC,kCAAY;;AAEhC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;;AAEA,iBAAiB,eAAe;;AAEhC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,GAAG;;AAEH;AACA;;;;;;;;;;;;;ACpDa;;AAEb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B;AAC/B;AACA;AACA,WAAW,SAAS;AACpB,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;AC1Ba;;AAEb,UAAU,mBAAO,CAAC,4CAAsB;;AAExC;;AAEA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;;AAEA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,QAAQ;AACnB,aAAa;AACb;AACA;AACA;AACA;AACA,iBAAiB,OAAO;AACxB;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,WAAW,kBAAkB;AAC7B,WAAW,QAAQ;AACnB,WAAW,OAAO;AAClB,aAAa;AACb;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,SAAS;AACpB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACxGa;;AAEb,WAAW,mBAAO,CAAC,6CAAgB;;AAEnC;;AAEA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,YAAY,QAAQ;AACpB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,OAAO;AACpB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,SAAS;AACpB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,mCAAmC,OAAO;AAC1C;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,SAAS,GAAG,SAAS;AAC5C,2BAA2B;AAC3B;AACA;AACA,WAAW,OAAO;AAClB,aAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,4BAA4B;AAC5B,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;;AAEA,uCAAuC,OAAO;AAC9C;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"axios.js","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[\"axios\"] = factory();\n\telse\n\t\troot[\"axios\"] = factory();\n})(window, function() {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = \"./index.js\");\n","module.exports = require('./lib/axios');","'use strict';\n\nvar utils = require('./../utils');\nvar settle = require('./../core/settle');\nvar cookies = require('./../helpers/cookies');\nvar buildURL = require('./../helpers/buildURL');\nvar buildFullPath = require('../core/buildFullPath');\nvar parseHeaders = require('./../helpers/parseHeaders');\nvar isURLSameOrigin = require('./../helpers/isURLSameOrigin');\nvar createError = require('../core/createError');\n\nmodule.exports = function xhrAdapter(config) {\n return new Promise(function dispatchXhrRequest(resolve, reject) {\n var requestData = config.data;\n var requestHeaders = config.headers;\n var responseType = config.responseType;\n\n if (utils.isFormData(requestData)) {\n delete requestHeaders['Content-Type']; // Let the browser set it\n }\n\n var request = new XMLHttpRequest();\n\n // HTTP basic authentication\n if (config.auth) {\n var username = config.auth.username || '';\n var password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : '';\n requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password);\n }\n\n var fullPath = buildFullPath(config.baseURL, config.url);\n request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true);\n\n // Set the request timeout in MS\n request.timeout = config.timeout;\n\n function onloadend() {\n if (!request) {\n return;\n }\n // Prepare the response\n var responseHeaders = 'getAllResponseHeaders' in request ? parseHeaders(request.getAllResponseHeaders()) : null;\n var responseData = !responseType || responseType === 'text' || responseType === 'json' ?\n request.responseText : request.response;\n var response = {\n data: responseData,\n status: request.status,\n statusText: request.statusText,\n headers: responseHeaders,\n config: config,\n request: request\n };\n\n settle(resolve, reject, response);\n\n // Clean up request\n request = null;\n }\n\n if ('onloadend' in request) {\n // Use onloadend if available\n request.onloadend = onloadend;\n } else {\n // Listen for ready state to emulate onloadend\n request.onreadystatechange = function handleLoad() {\n if (!request || request.readyState !== 4) {\n return;\n }\n\n // The request errored out and we didn't get a response, this will be\n // handled by onerror instead\n // With one exception: request that using file: protocol, most browsers\n // will return status as 0 even though it's a successful request\n if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {\n return;\n }\n // readystate handler is calling before onerror or ontimeout handlers,\n // so we should call onloadend on the next 'tick'\n setTimeout(onloadend);\n };\n }\n\n // Handle browser request cancellation (as opposed to a manual cancellation)\n request.onabort = function handleAbort() {\n if (!request) {\n return;\n }\n\n reject(createError('Request aborted', config, 'ECONNABORTED', request));\n\n // Clean up request\n request = null;\n };\n\n // Handle low level network errors\n request.onerror = function handleError() {\n // Real errors are hidden from us by the browser\n // onerror should only fire if it's a network error\n reject(createError('Network Error', config, null, request));\n\n // Clean up request\n request = null;\n };\n\n // Handle timeout\n request.ontimeout = function handleTimeout() {\n var timeoutErrorMessage = 'timeout of ' + config.timeout + 'ms exceeded';\n if (config.timeoutErrorMessage) {\n timeoutErrorMessage = config.timeoutErrorMessage;\n }\n reject(createError(\n timeoutErrorMessage,\n config,\n config.transitional && config.transitional.clarifyTimeoutError ? 'ETIMEDOUT' : 'ECONNABORTED',\n request));\n\n // Clean up request\n request = null;\n };\n\n // Add xsrf header\n // This is only done if running in a standard browser environment.\n // Specifically not if we're in a web worker, or react-native.\n if (utils.isStandardBrowserEnv()) {\n // Add xsrf header\n var xsrfValue = (config.withCredentials || isURLSameOrigin(fullPath)) && config.xsrfCookieName ?\n cookies.read(config.xsrfCookieName) :\n undefined;\n\n if (xsrfValue) {\n requestHeaders[config.xsrfHeaderName] = xsrfValue;\n }\n }\n\n // Add headers to the request\n if ('setRequestHeader' in request) {\n utils.forEach(requestHeaders, function setRequestHeader(val, key) {\n if (typeof requestData === 'undefined' && key.toLowerCase() === 'content-type') {\n // Remove Content-Type if data is undefined\n delete requestHeaders[key];\n } else {\n // Otherwise add header to the request\n request.setRequestHeader(key, val);\n }\n });\n }\n\n // Add withCredentials to request if needed\n if (!utils.isUndefined(config.withCredentials)) {\n request.withCredentials = !!config.withCredentials;\n }\n\n // Add responseType to request if needed\n if (responseType && responseType !== 'json') {\n request.responseType = config.responseType;\n }\n\n // Handle progress if needed\n if (typeof config.onDownloadProgress === 'function') {\n request.addEventListener('progress', config.onDownloadProgress);\n }\n\n // Not all browsers support upload events\n if (typeof config.onUploadProgress === 'function' && request.upload) {\n request.upload.addEventListener('progress', config.onUploadProgress);\n }\n\n if (config.cancelToken) {\n // Handle cancellation\n config.cancelToken.promise.then(function onCanceled(cancel) {\n if (!request) {\n return;\n }\n\n request.abort();\n reject(cancel);\n // Clean up request\n request = null;\n });\n }\n\n if (!requestData) {\n requestData = null;\n }\n\n // Send the request\n request.send(requestData);\n });\n};\n","'use strict';\n\nvar utils = require('./utils');\nvar bind = require('./helpers/bind');\nvar Axios = require('./core/Axios');\nvar mergeConfig = require('./core/mergeConfig');\nvar defaults = require('./defaults');\n\n/**\n * Create an instance of Axios\n *\n * @param {Object} defaultConfig The default config for the instance\n * @return {Axios} A new instance of Axios\n */\nfunction createInstance(defaultConfig) {\n var context = new Axios(defaultConfig);\n var instance = bind(Axios.prototype.request, context);\n\n // Copy axios.prototype to instance\n utils.extend(instance, Axios.prototype, context);\n\n // Copy context to instance\n utils.extend(instance, context);\n\n return instance;\n}\n\n// Create the default instance to be exported\nvar axios = createInstance(defaults);\n\n// Expose Axios class to allow class inheritance\naxios.Axios = Axios;\n\n// Factory for creating new instances\naxios.create = function create(instanceConfig) {\n return createInstance(mergeConfig(axios.defaults, instanceConfig));\n};\n\n// Expose Cancel & CancelToken\naxios.Cancel = require('./cancel/Cancel');\naxios.CancelToken = require('./cancel/CancelToken');\naxios.isCancel = require('./cancel/isCancel');\n\n// Expose all/spread\naxios.all = function all(promises) {\n return Promise.all(promises);\n};\naxios.spread = require('./helpers/spread');\n\n// Expose isAxiosError\naxios.isAxiosError = require('./helpers/isAxiosError');\n\nmodule.exports = axios;\n\n// Allow use of default import syntax in TypeScript\nmodule.exports.default = axios;\n","'use strict';\n\n/**\n * A `Cancel` is an object that is thrown when an operation is canceled.\n *\n * @class\n * @param {string=} message The message.\n */\nfunction Cancel(message) {\n this.message = message;\n}\n\nCancel.prototype.toString = function toString() {\n return 'Cancel' + (this.message ? ': ' + this.message : '');\n};\n\nCancel.prototype.__CANCEL__ = true;\n\nmodule.exports = Cancel;\n","'use strict';\n\nvar Cancel = require('./Cancel');\n\n/**\n * A `CancelToken` is an object that can be used to request cancellation of an operation.\n *\n * @class\n * @param {Function} executor The executor function.\n */\nfunction CancelToken(executor) {\n if (typeof executor !== 'function') {\n throw new TypeError('executor must be a function.');\n }\n\n var resolvePromise;\n this.promise = new Promise(function promiseExecutor(resolve) {\n resolvePromise = resolve;\n });\n\n var token = this;\n executor(function cancel(message) {\n if (token.reason) {\n // Cancellation has already been requested\n return;\n }\n\n token.reason = new Cancel(message);\n resolvePromise(token.reason);\n });\n}\n\n/**\n * Throws a `Cancel` if cancellation has been requested.\n */\nCancelToken.prototype.throwIfRequested = function throwIfRequested() {\n if (this.reason) {\n throw this.reason;\n }\n};\n\n/**\n * Returns an object that contains a new `CancelToken` and a function that, when called,\n * cancels the `CancelToken`.\n */\nCancelToken.source = function source() {\n var cancel;\n var token = new CancelToken(function executor(c) {\n cancel = c;\n });\n return {\n token: token,\n cancel: cancel\n };\n};\n\nmodule.exports = CancelToken;\n","'use strict';\n\nmodule.exports = function isCancel(value) {\n return !!(value && value.__CANCEL__);\n};\n","'use strict';\n\nvar utils = require('./../utils');\nvar buildURL = require('../helpers/buildURL');\nvar InterceptorManager = require('./InterceptorManager');\nvar dispatchRequest = require('./dispatchRequest');\nvar mergeConfig = require('./mergeConfig');\nvar validator = require('../helpers/validator');\n\nvar validators = validator.validators;\n/**\n * Create a new instance of Axios\n *\n * @param {Object} instanceConfig The default config for the instance\n */\nfunction Axios(instanceConfig) {\n this.defaults = instanceConfig;\n this.interceptors = {\n request: new InterceptorManager(),\n response: new InterceptorManager()\n };\n}\n\n/**\n * Dispatch a request\n *\n * @param {Object} config The config specific for this request (merged with this.defaults)\n */\nAxios.prototype.request = function request(config) {\n /*eslint no-param-reassign:0*/\n // Allow for axios('example/url'[, config]) a la fetch API\n if (typeof config === 'string') {\n config = arguments[1] || {};\n config.url = arguments[0];\n } else {\n config = config || {};\n }\n\n config = mergeConfig(this.defaults, config);\n\n // Set config.method\n if (config.method) {\n config.method = config.method.toLowerCase();\n } else if (this.defaults.method) {\n config.method = this.defaults.method.toLowerCase();\n } else {\n config.method = 'get';\n }\n\n var transitional = config.transitional;\n\n if (transitional !== undefined) {\n validator.assertOptions(transitional, {\n silentJSONParsing: validators.transitional(validators.boolean, '1.0.0'),\n forcedJSONParsing: validators.transitional(validators.boolean, '1.0.0'),\n clarifyTimeoutError: validators.transitional(validators.boolean, '1.0.0')\n }, false);\n }\n\n // filter out skipped interceptors\n var requestInterceptorChain = [];\n var synchronousRequestInterceptors = true;\n this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {\n if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) {\n return;\n }\n\n synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;\n\n requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);\n });\n\n var responseInterceptorChain = [];\n this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {\n responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);\n });\n\n var promise;\n\n if (!synchronousRequestInterceptors) {\n var chain = [dispatchRequest, undefined];\n\n Array.prototype.unshift.apply(chain, requestInterceptorChain);\n chain = chain.concat(responseInterceptorChain);\n\n promise = Promise.resolve(config);\n while (chain.length) {\n promise = promise.then(chain.shift(), chain.shift());\n }\n\n return promise;\n }\n\n\n var newConfig = config;\n while (requestInterceptorChain.length) {\n var onFulfilled = requestInterceptorChain.shift();\n var onRejected = requestInterceptorChain.shift();\n try {\n newConfig = onFulfilled(newConfig);\n } catch (error) {\n onRejected(error);\n break;\n }\n }\n\n try {\n promise = dispatchRequest(newConfig);\n } catch (error) {\n return Promise.reject(error);\n }\n\n while (responseInterceptorChain.length) {\n promise = promise.then(responseInterceptorChain.shift(), responseInterceptorChain.shift());\n }\n\n return promise;\n};\n\nAxios.prototype.getUri = function getUri(config) {\n config = mergeConfig(this.defaults, config);\n return buildURL(config.url, config.params, config.paramsSerializer).replace(/^\\?/, '');\n};\n\n// Provide aliases for supported request methods\nutils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, config) {\n return this.request(mergeConfig(config || {}, {\n method: method,\n url: url,\n data: (config || {}).data\n }));\n };\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, data, config) {\n return this.request(mergeConfig(config || {}, {\n method: method,\n url: url,\n data: data\n }));\n };\n});\n\nmodule.exports = Axios;\n","'use strict';\n\nvar utils = require('./../utils');\n\nfunction InterceptorManager() {\n this.handlers = [];\n}\n\n/**\n * Add a new interceptor to the stack\n *\n * @param {Function} fulfilled The function to handle `then` for a `Promise`\n * @param {Function} rejected The function to handle `reject` for a `Promise`\n *\n * @return {Number} An ID used to remove interceptor later\n */\nInterceptorManager.prototype.use = function use(fulfilled, rejected, options) {\n this.handlers.push({\n fulfilled: fulfilled,\n rejected: rejected,\n synchronous: options ? options.synchronous : false,\n runWhen: options ? options.runWhen : null\n });\n return this.handlers.length - 1;\n};\n\n/**\n * Remove an interceptor from the stack\n *\n * @param {Number} id The ID that was returned by `use`\n */\nInterceptorManager.prototype.eject = function eject(id) {\n if (this.handlers[id]) {\n this.handlers[id] = null;\n }\n};\n\n/**\n * Iterate over all the registered interceptors\n *\n * This method is particularly useful for skipping over any\n * interceptors that may have become `null` calling `eject`.\n *\n * @param {Function} fn The function to call for each interceptor\n */\nInterceptorManager.prototype.forEach = function forEach(fn) {\n utils.forEach(this.handlers, function forEachHandler(h) {\n if (h !== null) {\n fn(h);\n }\n });\n};\n\nmodule.exports = InterceptorManager;\n","'use strict';\n\nvar isAbsoluteURL = require('../helpers/isAbsoluteURL');\nvar combineURLs = require('../helpers/combineURLs');\n\n/**\n * Creates a new URL by combining the baseURL with the requestedURL,\n * only when the requestedURL is not already an absolute URL.\n * If the requestURL is absolute, this function returns the requestedURL untouched.\n *\n * @param {string} baseURL The base URL\n * @param {string} requestedURL Absolute or relative URL to combine\n * @returns {string} The combined full path\n */\nmodule.exports = function buildFullPath(baseURL, requestedURL) {\n if (baseURL && !isAbsoluteURL(requestedURL)) {\n return combineURLs(baseURL, requestedURL);\n }\n return requestedURL;\n};\n","'use strict';\n\nvar enhanceError = require('./enhanceError');\n\n/**\n * Create an Error with the specified message, config, error code, request and response.\n *\n * @param {string} message The error message.\n * @param {Object} config The config.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n * @returns {Error} The created error.\n */\nmodule.exports = function createError(message, config, code, request, response) {\n var error = new Error(message);\n return enhanceError(error, config, code, request, response);\n};\n","'use strict';\n\nvar utils = require('./../utils');\nvar transformData = require('./transformData');\nvar isCancel = require('../cancel/isCancel');\nvar defaults = require('../defaults');\n\n/**\n * Throws a `Cancel` if cancellation has been requested.\n */\nfunction throwIfCancellationRequested(config) {\n if (config.cancelToken) {\n config.cancelToken.throwIfRequested();\n }\n}\n\n/**\n * Dispatch a request to the server using the configured adapter.\n *\n * @param {object} config The config that is to be used for the request\n * @returns {Promise} The Promise to be fulfilled\n */\nmodule.exports = function dispatchRequest(config) {\n throwIfCancellationRequested(config);\n\n // Ensure headers exist\n config.headers = config.headers || {};\n\n // Transform request data\n config.data = transformData.call(\n config,\n config.data,\n config.headers,\n config.transformRequest\n );\n\n // Flatten headers\n config.headers = utils.merge(\n config.headers.common || {},\n config.headers[config.method] || {},\n config.headers\n );\n\n utils.forEach(\n ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],\n function cleanHeaderConfig(method) {\n delete config.headers[method];\n }\n );\n\n var adapter = config.adapter || defaults.adapter;\n\n return adapter(config).then(function onAdapterResolution(response) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n response.data = transformData.call(\n config,\n response.data,\n response.headers,\n config.transformResponse\n );\n\n return response;\n }, function onAdapterRejection(reason) {\n if (!isCancel(reason)) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n if (reason && reason.response) {\n reason.response.data = transformData.call(\n config,\n reason.response.data,\n reason.response.headers,\n config.transformResponse\n );\n }\n }\n\n return Promise.reject(reason);\n });\n};\n","'use strict';\n\n/**\n * Update an Error with the specified config, error code, and response.\n *\n * @param {Error} error The error to update.\n * @param {Object} config The config.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n * @returns {Error} The error.\n */\nmodule.exports = function enhanceError(error, config, code, request, response) {\n error.config = config;\n if (code) {\n error.code = code;\n }\n\n error.request = request;\n error.response = response;\n error.isAxiosError = true;\n\n error.toJSON = function toJSON() {\n return {\n // Standard\n message: this.message,\n name: this.name,\n // Microsoft\n description: this.description,\n number: this.number,\n // Mozilla\n fileName: this.fileName,\n lineNumber: this.lineNumber,\n columnNumber: this.columnNumber,\n stack: this.stack,\n // Axios\n config: this.config,\n code: this.code\n };\n };\n return error;\n};\n","'use strict';\n\nvar utils = require('../utils');\n\n/**\n * Config-specific merge-function which creates a new config-object\n * by merging two configuration objects together.\n *\n * @param {Object} config1\n * @param {Object} config2\n * @returns {Object} New object resulting from merging config2 to config1\n */\nmodule.exports = function mergeConfig(config1, config2) {\n // eslint-disable-next-line no-param-reassign\n config2 = config2 || {};\n var config = {};\n\n var valueFromConfig2Keys = ['url', 'method', 'data'];\n var mergeDeepPropertiesKeys = ['headers', 'auth', 'proxy', 'params'];\n var defaultToConfig2Keys = [\n 'baseURL', 'transformRequest', 'transformResponse', 'paramsSerializer',\n 'timeout', 'timeoutMessage', 'withCredentials', 'adapter', 'responseType', 'xsrfCookieName',\n 'xsrfHeaderName', 'onUploadProgress', 'onDownloadProgress', 'decompress',\n 'maxContentLength', 'maxBodyLength', 'maxRedirects', 'transport', 'httpAgent',\n 'httpsAgent', 'cancelToken', 'socketPath', 'responseEncoding'\n ];\n var directMergeKeys = ['validateStatus'];\n\n function getMergedValue(target, source) {\n if (utils.isPlainObject(target) && utils.isPlainObject(source)) {\n return utils.merge(target, source);\n } else if (utils.isPlainObject(source)) {\n return utils.merge({}, source);\n } else if (utils.isArray(source)) {\n return source.slice();\n }\n return source;\n }\n\n function mergeDeepProperties(prop) {\n if (!utils.isUndefined(config2[prop])) {\n config[prop] = getMergedValue(config1[prop], config2[prop]);\n } else if (!utils.isUndefined(config1[prop])) {\n config[prop] = getMergedValue(undefined, config1[prop]);\n }\n }\n\n utils.forEach(valueFromConfig2Keys, function valueFromConfig2(prop) {\n if (!utils.isUndefined(config2[prop])) {\n config[prop] = getMergedValue(undefined, config2[prop]);\n }\n });\n\n utils.forEach(mergeDeepPropertiesKeys, mergeDeepProperties);\n\n utils.forEach(defaultToConfig2Keys, function defaultToConfig2(prop) {\n if (!utils.isUndefined(config2[prop])) {\n config[prop] = getMergedValue(undefined, config2[prop]);\n } else if (!utils.isUndefined(config1[prop])) {\n config[prop] = getMergedValue(undefined, config1[prop]);\n }\n });\n\n utils.forEach(directMergeKeys, function merge(prop) {\n if (prop in config2) {\n config[prop] = getMergedValue(config1[prop], config2[prop]);\n } else if (prop in config1) {\n config[prop] = getMergedValue(undefined, config1[prop]);\n }\n });\n\n var axiosKeys = valueFromConfig2Keys\n .concat(mergeDeepPropertiesKeys)\n .concat(defaultToConfig2Keys)\n .concat(directMergeKeys);\n\n var otherKeys = Object\n .keys(config1)\n .concat(Object.keys(config2))\n .filter(function filterAxiosKeys(key) {\n return axiosKeys.indexOf(key) === -1;\n });\n\n utils.forEach(otherKeys, mergeDeepProperties);\n\n return config;\n};\n","'use strict';\n\nvar createError = require('./createError');\n\n/**\n * Resolve or reject a Promise based on response status.\n *\n * @param {Function} resolve A function that resolves the promise.\n * @param {Function} reject A function that rejects the promise.\n * @param {object} response The response.\n */\nmodule.exports = function settle(resolve, reject, response) {\n var validateStatus = response.config.validateStatus;\n if (!response.status || !validateStatus || validateStatus(response.status)) {\n resolve(response);\n } else {\n reject(createError(\n 'Request failed with status code ' + response.status,\n response.config,\n null,\n response.request,\n response\n ));\n }\n};\n","'use strict';\n\nvar utils = require('./../utils');\nvar defaults = require('./../defaults');\n\n/**\n * Transform the data for a request or a response\n *\n * @param {Object|String} data The data to be transformed\n * @param {Array} headers The headers for the request or response\n * @param {Array|Function} fns A single function or Array of functions\n * @returns {*} The resulting transformed data\n */\nmodule.exports = function transformData(data, headers, fns) {\n var context = this || defaults;\n /*eslint no-param-reassign:0*/\n utils.forEach(fns, function transform(fn) {\n data = fn.call(context, data, headers);\n });\n\n return data;\n};\n","'use strict';\n\nvar utils = require('./utils');\nvar normalizeHeaderName = require('./helpers/normalizeHeaderName');\nvar enhanceError = require('./core/enhanceError');\n\nvar DEFAULT_CONTENT_TYPE = {\n 'Content-Type': 'application/x-www-form-urlencoded'\n};\n\nfunction setContentTypeIfUnset(headers, value) {\n if (!utils.isUndefined(headers) && utils.isUndefined(headers['Content-Type'])) {\n headers['Content-Type'] = value;\n }\n}\n\nfunction getDefaultAdapter() {\n var adapter;\n if (typeof XMLHttpRequest !== 'undefined') {\n // For browsers use XHR adapter\n adapter = require('./adapters/xhr');\n } else if (typeof process !== 'undefined' && Object.prototype.toString.call(process) === '[object process]') {\n // For node use HTTP adapter\n adapter = require('./adapters/http');\n }\n return adapter;\n}\n\nfunction stringifySafely(rawValue, parser, encoder) {\n if (utils.isString(rawValue)) {\n try {\n (parser || JSON.parse)(rawValue);\n return utils.trim(rawValue);\n } catch (e) {\n if (e.name !== 'SyntaxError') {\n throw e;\n }\n }\n }\n\n return (encoder || JSON.stringify)(rawValue);\n}\n\nvar defaults = {\n\n transitional: {\n silentJSONParsing: true,\n forcedJSONParsing: true,\n clarifyTimeoutError: false\n },\n\n adapter: getDefaultAdapter(),\n\n transformRequest: [function transformRequest(data, headers) {\n normalizeHeaderName(headers, 'Accept');\n normalizeHeaderName(headers, 'Content-Type');\n\n if (utils.isFormData(data) ||\n utils.isArrayBuffer(data) ||\n utils.isBuffer(data) ||\n utils.isStream(data) ||\n utils.isFile(data) ||\n utils.isBlob(data)\n ) {\n return data;\n }\n if (utils.isArrayBufferView(data)) {\n return data.buffer;\n }\n if (utils.isURLSearchParams(data)) {\n setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8');\n return data.toString();\n }\n if (utils.isObject(data) || (headers && headers['Content-Type'] === 'application/json')) {\n setContentTypeIfUnset(headers, 'application/json');\n return stringifySafely(data);\n }\n return data;\n }],\n\n transformResponse: [function transformResponse(data) {\n var transitional = this.transitional;\n var silentJSONParsing = transitional && transitional.silentJSONParsing;\n var forcedJSONParsing = transitional && transitional.forcedJSONParsing;\n var strictJSONParsing = !silentJSONParsing && this.responseType === 'json';\n\n if (strictJSONParsing || (forcedJSONParsing && utils.isString(data) && data.length)) {\n try {\n return JSON.parse(data);\n } catch (e) {\n if (strictJSONParsing) {\n if (e.name === 'SyntaxError') {\n throw enhanceError(e, this, 'E_JSON_PARSE');\n }\n throw e;\n }\n }\n }\n\n return data;\n }],\n\n /**\n * A timeout in milliseconds to abort a request. If set to 0 (default) a\n * timeout is not created.\n */\n timeout: 0,\n\n xsrfCookieName: 'XSRF-TOKEN',\n xsrfHeaderName: 'X-XSRF-TOKEN',\n\n maxContentLength: -1,\n maxBodyLength: -1,\n\n validateStatus: function validateStatus(status) {\n return status >= 200 && status < 300;\n }\n};\n\ndefaults.headers = {\n common: {\n 'Accept': 'application/json, text/plain, */*'\n }\n};\n\nutils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) {\n defaults.headers[method] = {};\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE);\n});\n\nmodule.exports = defaults;\n","'use strict';\n\nmodule.exports = function bind(fn, thisArg) {\n return function wrap() {\n var args = new Array(arguments.length);\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i];\n }\n return fn.apply(thisArg, args);\n };\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\nfunction encode(val) {\n return encodeURIComponent(val).\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%20/g, '+').\n replace(/%5B/gi, '[').\n replace(/%5D/gi, ']');\n}\n\n/**\n * Build a URL by appending params to the end\n *\n * @param {string} url The base of the url (e.g., http://www.google.com)\n * @param {object} [params] The params to be appended\n * @returns {string} The formatted url\n */\nmodule.exports = function buildURL(url, params, paramsSerializer) {\n /*eslint no-param-reassign:0*/\n if (!params) {\n return url;\n }\n\n var serializedParams;\n if (paramsSerializer) {\n serializedParams = paramsSerializer(params);\n } else if (utils.isURLSearchParams(params)) {\n serializedParams = params.toString();\n } else {\n var parts = [];\n\n utils.forEach(params, function serialize(val, key) {\n if (val === null || typeof val === 'undefined') {\n return;\n }\n\n if (utils.isArray(val)) {\n key = key + '[]';\n } else {\n val = [val];\n }\n\n utils.forEach(val, function parseValue(v) {\n if (utils.isDate(v)) {\n v = v.toISOString();\n } else if (utils.isObject(v)) {\n v = JSON.stringify(v);\n }\n parts.push(encode(key) + '=' + encode(v));\n });\n });\n\n serializedParams = parts.join('&');\n }\n\n if (serializedParams) {\n var hashmarkIndex = url.indexOf('#');\n if (hashmarkIndex !== -1) {\n url = url.slice(0, hashmarkIndex);\n }\n\n url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;\n }\n\n return url;\n};\n","'use strict';\n\n/**\n * Creates a new URL by combining the specified URLs\n *\n * @param {string} baseURL The base URL\n * @param {string} relativeURL The relative URL\n * @returns {string} The combined URL\n */\nmodule.exports = function combineURLs(baseURL, relativeURL) {\n return relativeURL\n ? baseURL.replace(/\\/+$/, '') + '/' + relativeURL.replace(/^\\/+/, '')\n : baseURL;\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\nmodule.exports = (\n utils.isStandardBrowserEnv() ?\n\n // Standard browser envs support document.cookie\n (function standardBrowserEnv() {\n return {\n write: function write(name, value, expires, path, domain, secure) {\n var cookie = [];\n cookie.push(name + '=' + encodeURIComponent(value));\n\n if (utils.isNumber(expires)) {\n cookie.push('expires=' + new Date(expires).toGMTString());\n }\n\n if (utils.isString(path)) {\n cookie.push('path=' + path);\n }\n\n if (utils.isString(domain)) {\n cookie.push('domain=' + domain);\n }\n\n if (secure === true) {\n cookie.push('secure');\n }\n\n document.cookie = cookie.join('; ');\n },\n\n read: function read(name) {\n var match = document.cookie.match(new RegExp('(^|;\\\\s*)(' + name + ')=([^;]*)'));\n return (match ? decodeURIComponent(match[3]) : null);\n },\n\n remove: function remove(name) {\n this.write(name, '', Date.now() - 86400000);\n }\n };\n })() :\n\n // Non standard browser env (web workers, react-native) lack needed support.\n (function nonStandardBrowserEnv() {\n return {\n write: function write() {},\n read: function read() { return null; },\n remove: function remove() {}\n };\n })()\n);\n","'use strict';\n\n/**\n * Determines whether the specified URL is absolute\n *\n * @param {string} url The URL to test\n * @returns {boolean} True if the specified URL is absolute, otherwise false\n */\nmodule.exports = function isAbsoluteURL(url) {\n // A URL is considered absolute if it begins with \"://\" or \"//\" (protocol-relative URL).\n // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed\n // by any combination of letters, digits, plus, period, or hyphen.\n return /^([a-z][a-z\\d\\+\\-\\.]*:)?\\/\\//i.test(url);\n};\n","'use strict';\n\n/**\n * Determines whether the payload is an error thrown by Axios\n *\n * @param {*} payload The value to test\n * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false\n */\nmodule.exports = function isAxiosError(payload) {\n return (typeof payload === 'object') && (payload.isAxiosError === true);\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\nmodule.exports = (\n utils.isStandardBrowserEnv() ?\n\n // Standard browser envs have full support of the APIs needed to test\n // whether the request URL is of the same origin as current location.\n (function standardBrowserEnv() {\n var msie = /(msie|trident)/i.test(navigator.userAgent);\n var urlParsingNode = document.createElement('a');\n var originURL;\n\n /**\n * Parse a URL to discover it's components\n *\n * @param {String} url The URL to be parsed\n * @returns {Object}\n */\n function resolveURL(url) {\n var href = url;\n\n if (msie) {\n // IE needs attribute set twice to normalize properties\n urlParsingNode.setAttribute('href', href);\n href = urlParsingNode.href;\n }\n\n urlParsingNode.setAttribute('href', href);\n\n // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils\n return {\n href: urlParsingNode.href,\n protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',\n host: urlParsingNode.host,\n search: urlParsingNode.search ? urlParsingNode.search.replace(/^\\?/, '') : '',\n hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',\n hostname: urlParsingNode.hostname,\n port: urlParsingNode.port,\n pathname: (urlParsingNode.pathname.charAt(0) === '/') ?\n urlParsingNode.pathname :\n '/' + urlParsingNode.pathname\n };\n }\n\n originURL = resolveURL(window.location.href);\n\n /**\n * Determine if a URL shares the same origin as the current location\n *\n * @param {String} requestURL The URL to test\n * @returns {boolean} True if URL shares the same origin, otherwise false\n */\n return function isURLSameOrigin(requestURL) {\n var parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL;\n return (parsed.protocol === originURL.protocol &&\n parsed.host === originURL.host);\n };\n })() :\n\n // Non standard browser envs (web workers, react-native) lack needed support.\n (function nonStandardBrowserEnv() {\n return function isURLSameOrigin() {\n return true;\n };\n })()\n);\n","'use strict';\n\nvar utils = require('../utils');\n\nmodule.exports = function normalizeHeaderName(headers, normalizedName) {\n utils.forEach(headers, function processHeader(value, name) {\n if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) {\n headers[normalizedName] = value;\n delete headers[name];\n }\n });\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\n// Headers whose duplicates are ignored by node\n// c.f. https://nodejs.org/api/http.html#http_message_headers\nvar ignoreDuplicateOf = [\n 'age', 'authorization', 'content-length', 'content-type', 'etag',\n 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',\n 'last-modified', 'location', 'max-forwards', 'proxy-authorization',\n 'referer', 'retry-after', 'user-agent'\n];\n\n/**\n * Parse headers into an object\n *\n * ```\n * Date: Wed, 27 Aug 2014 08:58:49 GMT\n * Content-Type: application/json\n * Connection: keep-alive\n * Transfer-Encoding: chunked\n * ```\n *\n * @param {String} headers Headers needing to be parsed\n * @returns {Object} Headers parsed into an object\n */\nmodule.exports = function parseHeaders(headers) {\n var parsed = {};\n var key;\n var val;\n var i;\n\n if (!headers) { return parsed; }\n\n utils.forEach(headers.split('\\n'), function parser(line) {\n i = line.indexOf(':');\n key = utils.trim(line.substr(0, i)).toLowerCase();\n val = utils.trim(line.substr(i + 1));\n\n if (key) {\n if (parsed[key] && ignoreDuplicateOf.indexOf(key) >= 0) {\n return;\n }\n if (key === 'set-cookie') {\n parsed[key] = (parsed[key] ? parsed[key] : []).concat([val]);\n } else {\n parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;\n }\n }\n });\n\n return parsed;\n};\n","'use strict';\n\n/**\n * Syntactic sugar for invoking a function and expanding an array for arguments.\n *\n * Common use case would be to use `Function.prototype.apply`.\n *\n * ```js\n * function f(x, y, z) {}\n * var args = [1, 2, 3];\n * f.apply(null, args);\n * ```\n *\n * With `spread` this example can be re-written.\n *\n * ```js\n * spread(function(x, y, z) {})([1, 2, 3]);\n * ```\n *\n * @param {Function} callback\n * @returns {Function}\n */\nmodule.exports = function spread(callback) {\n return function wrap(arr) {\n return callback.apply(null, arr);\n };\n};\n","'use strict';\n\nvar pkg = require('./../../package.json');\n\nvar validators = {};\n\n// eslint-disable-next-line func-names\n['object', 'boolean', 'number', 'function', 'string', 'symbol'].forEach(function(type, i) {\n validators[type] = function validator(thing) {\n return typeof thing === type || 'a' + (i < 1 ? 'n ' : ' ') + type;\n };\n});\n\nvar deprecatedWarnings = {};\nvar currentVerArr = pkg.version.split('.');\n\n/**\n * Compare package versions\n * @param {string} version\n * @param {string?} thanVersion\n * @returns {boolean}\n */\nfunction isOlderVersion(version, thanVersion) {\n var pkgVersionArr = thanVersion ? thanVersion.split('.') : currentVerArr;\n var destVer = version.split('.');\n for (var i = 0; i < 3; i++) {\n if (pkgVersionArr[i] > destVer[i]) {\n return true;\n } else if (pkgVersionArr[i] < destVer[i]) {\n return false;\n }\n }\n return false;\n}\n\n/**\n * Transitional option validator\n * @param {function|boolean?} validator\n * @param {string?} version\n * @param {string} message\n * @returns {function}\n */\nvalidators.transitional = function transitional(validator, version, message) {\n var isDeprecated = version && isOlderVersion(version);\n\n function formatMessage(opt, desc) {\n return '[Axios v' + pkg.version + '] Transitional option \\'' + opt + '\\'' + desc + (message ? '. ' + message : '');\n }\n\n // eslint-disable-next-line func-names\n return function(value, opt, opts) {\n if (validator === false) {\n throw new Error(formatMessage(opt, ' has been removed in ' + version));\n }\n\n if (isDeprecated && !deprecatedWarnings[opt]) {\n deprecatedWarnings[opt] = true;\n // eslint-disable-next-line no-console\n console.warn(\n formatMessage(\n opt,\n ' has been deprecated since v' + version + ' and will be removed in the near future'\n )\n );\n }\n\n return validator ? validator(value, opt, opts) : true;\n };\n};\n\n/**\n * Assert object's properties type\n * @param {object} options\n * @param {object} schema\n * @param {boolean?} allowUnknown\n */\n\nfunction assertOptions(options, schema, allowUnknown) {\n if (typeof options !== 'object') {\n throw new TypeError('options must be an object');\n }\n var keys = Object.keys(options);\n var i = keys.length;\n while (i-- > 0) {\n var opt = keys[i];\n var validator = schema[opt];\n if (validator) {\n var value = options[opt];\n var result = value === undefined || validator(value, opt, options);\n if (result !== true) {\n throw new TypeError('option ' + opt + ' must be ' + result);\n }\n continue;\n }\n if (allowUnknown !== true) {\n throw Error('Unknown option ' + opt);\n }\n }\n}\n\nmodule.exports = {\n isOlderVersion: isOlderVersion,\n assertOptions: assertOptions,\n validators: validators\n};\n","'use strict';\n\nvar bind = require('./helpers/bind');\n\n// utils is a library of generic helper functions non-specific to axios\n\nvar toString = Object.prototype.toString;\n\n/**\n * Determine if a value is an Array\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an Array, otherwise false\n */\nfunction isArray(val) {\n return toString.call(val) === '[object Array]';\n}\n\n/**\n * Determine if a value is undefined\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if the value is undefined, otherwise false\n */\nfunction isUndefined(val) {\n return typeof val === 'undefined';\n}\n\n/**\n * Determine if a value is a Buffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Buffer, otherwise false\n */\nfunction isBuffer(val) {\n return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor)\n && typeof val.constructor.isBuffer === 'function' && val.constructor.isBuffer(val);\n}\n\n/**\n * Determine if a value is an ArrayBuffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an ArrayBuffer, otherwise false\n */\nfunction isArrayBuffer(val) {\n return toString.call(val) === '[object ArrayBuffer]';\n}\n\n/**\n * Determine if a value is a FormData\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an FormData, otherwise false\n */\nfunction isFormData(val) {\n return (typeof FormData !== 'undefined') && (val instanceof FormData);\n}\n\n/**\n * Determine if a value is a view on an ArrayBuffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false\n */\nfunction isArrayBufferView(val) {\n var result;\n if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {\n result = ArrayBuffer.isView(val);\n } else {\n result = (val) && (val.buffer) && (val.buffer instanceof ArrayBuffer);\n }\n return result;\n}\n\n/**\n * Determine if a value is a String\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a String, otherwise false\n */\nfunction isString(val) {\n return typeof val === 'string';\n}\n\n/**\n * Determine if a value is a Number\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Number, otherwise false\n */\nfunction isNumber(val) {\n return typeof val === 'number';\n}\n\n/**\n * Determine if a value is an Object\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an Object, otherwise false\n */\nfunction isObject(val) {\n return val !== null && typeof val === 'object';\n}\n\n/**\n * Determine if a value is a plain Object\n *\n * @param {Object} val The value to test\n * @return {boolean} True if value is a plain Object, otherwise false\n */\nfunction isPlainObject(val) {\n if (toString.call(val) !== '[object Object]') {\n return false;\n }\n\n var prototype = Object.getPrototypeOf(val);\n return prototype === null || prototype === Object.prototype;\n}\n\n/**\n * Determine if a value is a Date\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Date, otherwise false\n */\nfunction isDate(val) {\n return toString.call(val) === '[object Date]';\n}\n\n/**\n * Determine if a value is a File\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a File, otherwise false\n */\nfunction isFile(val) {\n return toString.call(val) === '[object File]';\n}\n\n/**\n * Determine if a value is a Blob\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Blob, otherwise false\n */\nfunction isBlob(val) {\n return toString.call(val) === '[object Blob]';\n}\n\n/**\n * Determine if a value is a Function\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Function, otherwise false\n */\nfunction isFunction(val) {\n return toString.call(val) === '[object Function]';\n}\n\n/**\n * Determine if a value is a Stream\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Stream, otherwise false\n */\nfunction isStream(val) {\n return isObject(val) && isFunction(val.pipe);\n}\n\n/**\n * Determine if a value is a URLSearchParams object\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a URLSearchParams object, otherwise false\n */\nfunction isURLSearchParams(val) {\n return typeof URLSearchParams !== 'undefined' && val instanceof URLSearchParams;\n}\n\n/**\n * Trim excess whitespace off the beginning and end of a string\n *\n * @param {String} str The String to trim\n * @returns {String} The String freed of excess whitespace\n */\nfunction trim(str) {\n return str.trim ? str.trim() : str.replace(/^\\s+|\\s+$/g, '');\n}\n\n/**\n * Determine if we're running in a standard browser environment\n *\n * This allows axios to run in a web worker, and react-native.\n * Both environments support XMLHttpRequest, but not fully standard globals.\n *\n * web workers:\n * typeof window -> undefined\n * typeof document -> undefined\n *\n * react-native:\n * navigator.product -> 'ReactNative'\n * nativescript\n * navigator.product -> 'NativeScript' or 'NS'\n */\nfunction isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}\n\n/**\n * Iterate over an Array or an Object invoking a function for each item.\n *\n * If `obj` is an Array callback will be called passing\n * the value, index, and complete array for each item.\n *\n * If 'obj' is an Object callback will be called passing\n * the value, key, and complete object for each property.\n *\n * @param {Object|Array} obj The object to iterate\n * @param {Function} fn The callback to invoke for each item\n */\nfunction forEach(obj, fn) {\n // Don't bother if no value provided\n if (obj === null || typeof obj === 'undefined') {\n return;\n }\n\n // Force an array if not already something iterable\n if (typeof obj !== 'object') {\n /*eslint no-param-reassign:0*/\n obj = [obj];\n }\n\n if (isArray(obj)) {\n // Iterate over array values\n for (var i = 0, l = obj.length; i < l; i++) {\n fn.call(null, obj[i], i, obj);\n }\n } else {\n // Iterate over object keys\n for (var key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key)) {\n fn.call(null, obj[key], key, obj);\n }\n }\n }\n}\n\n/**\n * Accepts varargs expecting each argument to be an object, then\n * immutably merges the properties of each object and returns result.\n *\n * When multiple objects contain the same key the later object in\n * the arguments list will take precedence.\n *\n * Example:\n *\n * ```js\n * var result = merge({foo: 123}, {foo: 456});\n * console.log(result.foo); // outputs 456\n * ```\n *\n * @param {Object} obj1 Object to merge\n * @returns {Object} Result of all merge properties\n */\nfunction merge(/* obj1, obj2, obj3, ... */) {\n var result = {};\n function assignValue(val, key) {\n if (isPlainObject(result[key]) && isPlainObject(val)) {\n result[key] = merge(result[key], val);\n } else if (isPlainObject(val)) {\n result[key] = merge({}, val);\n } else if (isArray(val)) {\n result[key] = val.slice();\n } else {\n result[key] = val;\n }\n }\n\n for (var i = 0, l = arguments.length; i < l; i++) {\n forEach(arguments[i], assignValue);\n }\n return result;\n}\n\n/**\n * Extends object a by mutably adding to it the properties of object b.\n *\n * @param {Object} a The object to be extended\n * @param {Object} b The object to copy properties from\n * @param {Object} thisArg The object to bind function to\n * @return {Object} The resulting value of object a\n */\nfunction extend(a, b, thisArg) {\n forEach(b, function assignValue(val, key) {\n if (thisArg && typeof val === 'function') {\n a[key] = bind(val, thisArg);\n } else {\n a[key] = val;\n }\n });\n return a;\n}\n\n/**\n * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM)\n *\n * @param {string} content with BOM\n * @return {string} content value without BOM\n */\nfunction stripBOM(content) {\n if (content.charCodeAt(0) === 0xFEFF) {\n content = content.slice(1);\n }\n return content;\n}\n\nmodule.exports = {\n isArray: isArray,\n isArrayBuffer: isArrayBuffer,\n isBuffer: isBuffer,\n isFormData: isFormData,\n isArrayBufferView: isArrayBufferView,\n isString: isString,\n isNumber: isNumber,\n isObject: isObject,\n isPlainObject: isPlainObject,\n isUndefined: isUndefined,\n isDate: isDate,\n isFile: isFile,\n isBlob: isBlob,\n isFunction: isFunction,\n isStream: isStream,\n isURLSearchParams: isURLSearchParams,\n isStandardBrowserEnv: isStandardBrowserEnv,\n forEach: forEach,\n merge: merge,\n extend: extend,\n trim: trim,\n stripBOM: stripBOM\n};\n"],"sourceRoot":""} \ No newline at end of file diff --git a/node_modules/@shineiichijo/nhentai-pdf/node_modules/axios/dist/axios.min.js b/node_modules/@shineiichijo/nhentai-pdf/node_modules/axios/dist/axios.min.js new file mode 100644 index 000000000..d5b138ad0 --- /dev/null +++ b/node_modules/@shineiichijo/nhentai-pdf/node_modules/axios/dist/axios.min.js @@ -0,0 +1,3 @@ +/* axios v0.21.4 | (c) 2021 by Matt Zabriskie */ +!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.axios=t():e.axios=t()}(window,(function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=10)}([function(e,t,r){"use strict";var n=r(2),o=Object.prototype.toString;function i(e){return"[object Array]"===o.call(e)}function s(e){return void 0===e}function a(e){return null!==e&&"object"==typeof e}function u(e){if("[object Object]"!==o.call(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}function c(e){return"[object Function]"===o.call(e)}function f(e,t){if(null!=e)if("object"!=typeof e&&(e=[e]),i(e))for(var r=0,n=e.length;r=200&&e<300}};c.headers={common:{Accept:"application/json, text/plain, */*"}},n.forEach(["delete","get","head"],(function(e){c.headers[e]={}})),n.forEach(["post","put","patch"],(function(e){c.headers[e]=n.merge(s)})),e.exports=c},function(e,t,r){"use strict";e.exports=function(e,t){return function(){for(var r=new Array(arguments.length),n=0;n=0)return;s[t]="set-cookie"===t?(s[t]?s[t]:[]).concat([r]):s[t]?s[t]+", "+r:r}})),s):s}},function(e,t,r){"use strict";var n=r(0);e.exports=n.isStandardBrowserEnv()?function(){var e,t=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a");function o(e){var n=e;return t&&(r.setAttribute("href",n),n=r.href),r.setAttribute("href",n),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:"/"===r.pathname.charAt(0)?r.pathname:"/"+r.pathname}}return e=o(window.location.href),function(t){var r=n.isString(t)?o(t):t;return r.protocol===e.protocol&&r.host===e.host}}():function(){return!0}},function(e,t,r){"use strict";var n=r(25),o={};["object","boolean","number","function","string","symbol"].forEach((function(e,t){o[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}}));var i={},s=n.version.split(".");function a(e,t){for(var r=t?t.split("."):s,n=e.split("."),o=0;o<3;o++){if(r[o]>n[o])return!0;if(r[o]0;){var i=n[o],s=t[i];if(s){var a=e[i],u=void 0===a||s(a,i,e);if(!0!==u)throw new TypeError("option "+i+" must be "+u)}else if(!0!==r)throw Error("Unknown option "+i)}},validators:o}},function(e){e.exports=JSON.parse('{"name":"axios","version":"0.21.4","description":"Promise based HTTP client for the browser and node.js","main":"index.js","scripts":{"test":"grunt test","start":"node ./sandbox/server.js","build":"NODE_ENV=production grunt build","preversion":"npm test","version":"npm run build && grunt version && git add -A dist && git add CHANGELOG.md bower.json package.json","postversion":"git push && git push --tags","examples":"node ./examples/server.js","coveralls":"cat coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js","fix":"eslint --fix lib/**/*.js"},"repository":{"type":"git","url":"https://github.com/axios/axios.git"},"keywords":["xhr","http","ajax","promise","node"],"author":"Matt Zabriskie","license":"MIT","bugs":{"url":"https://github.com/axios/axios/issues"},"homepage":"https://axios-http.com","devDependencies":{"coveralls":"^3.0.0","es6-promise":"^4.2.4","grunt":"^1.3.0","grunt-banner":"^0.6.0","grunt-cli":"^1.2.0","grunt-contrib-clean":"^1.1.0","grunt-contrib-watch":"^1.0.0","grunt-eslint":"^23.0.0","grunt-karma":"^4.0.0","grunt-mocha-test":"^0.13.3","grunt-ts":"^6.0.0-beta.19","grunt-webpack":"^4.0.2","istanbul-instrumenter-loader":"^1.0.0","jasmine-core":"^2.4.1","karma":"^6.3.2","karma-chrome-launcher":"^3.1.0","karma-firefox-launcher":"^2.1.0","karma-jasmine":"^1.1.1","karma-jasmine-ajax":"^0.1.13","karma-safari-launcher":"^1.0.0","karma-sauce-launcher":"^4.3.6","karma-sinon":"^1.0.5","karma-sourcemap-loader":"^0.3.8","karma-webpack":"^4.0.2","load-grunt-tasks":"^3.5.2","minimist":"^1.2.0","mocha":"^8.2.1","sinon":"^4.5.0","terser-webpack-plugin":"^4.2.3","typescript":"^4.0.5","url-search-params":"^0.10.0","webpack":"^4.44.2","webpack-dev-server":"^3.11.0"},"browser":{"./lib/adapters/http.js":"./lib/adapters/xhr.js"},"jsdelivr":"dist/axios.min.js","unpkg":"dist/axios.min.js","typings":"./index.d.ts","dependencies":{"follow-redirects":"^1.14.0"},"bundlesize":[{"path":"./dist/axios.min.js","threshold":"5kB"}]}')},function(e,t,r){"use strict";var n=r(9);function o(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise((function(e){t=e}));var r=this;e((function(e){r.reason||(r.reason=new n(e),t(r.reason))}))}o.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},o.source=function(){var e;return{token:new o((function(t){e=t})),cancel:e}},e.exports=o},function(e,t,r){"use strict";e.exports=function(e){return function(t){return e.apply(null,t)}}},function(e,t,r){"use strict";e.exports=function(e){return"object"==typeof e&&!0===e.isAxiosError}}])})); +//# sourceMappingURL=axios.min.map \ No newline at end of file diff --git a/node_modules/@shineiichijo/nhentai-pdf/node_modules/axios/dist/axios.min.map b/node_modules/@shineiichijo/nhentai-pdf/node_modules/axios/dist/axios.min.map new file mode 100644 index 000000000..468a5babc --- /dev/null +++ b/node_modules/@shineiichijo/nhentai-pdf/node_modules/axios/dist/axios.min.map @@ -0,0 +1 @@ +{"version":3,"sources":["webpack://axios/webpack/universalModuleDefinition","webpack://axios/webpack/bootstrap","webpack://axios/./lib/utils.js","webpack://axios/./lib/defaults.js","webpack://axios/./lib/helpers/bind.js","webpack://axios/./lib/helpers/buildURL.js","webpack://axios/./lib/core/enhanceError.js","webpack://axios/./lib/adapters/xhr.js","webpack://axios/./lib/core/createError.js","webpack://axios/./lib/cancel/isCancel.js","webpack://axios/./lib/core/mergeConfig.js","webpack://axios/./lib/cancel/Cancel.js","webpack://axios/./index.js","webpack://axios/./lib/axios.js","webpack://axios/./lib/core/Axios.js","webpack://axios/./lib/core/InterceptorManager.js","webpack://axios/./lib/core/dispatchRequest.js","webpack://axios/./lib/core/transformData.js","webpack://axios/./lib/helpers/normalizeHeaderName.js","webpack://axios/./lib/core/settle.js","webpack://axios/./lib/helpers/cookies.js","webpack://axios/./lib/core/buildFullPath.js","webpack://axios/./lib/helpers/isAbsoluteURL.js","webpack://axios/./lib/helpers/combineURLs.js","webpack://axios/./lib/helpers/parseHeaders.js","webpack://axios/./lib/helpers/isURLSameOrigin.js","webpack://axios/./lib/helpers/validator.js","webpack://axios/./lib/cancel/CancelToken.js","webpack://axios/./lib/helpers/spread.js","webpack://axios/./lib/helpers/isAxiosError.js"],"names":["root","factory","exports","module","define","amd","window","installedModules","__webpack_require__","moduleId","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","toString","isArray","val","isUndefined","isObject","isPlainObject","getPrototypeOf","isFunction","forEach","obj","fn","length","isArrayBuffer","isBuffer","constructor","isFormData","FormData","isArrayBufferView","ArrayBuffer","isView","buffer","isString","isNumber","isDate","isFile","isBlob","isStream","pipe","isURLSearchParams","URLSearchParams","isStandardBrowserEnv","navigator","product","document","merge","result","assignValue","slice","arguments","extend","a","b","thisArg","trim","str","replace","stripBOM","content","charCodeAt","utils","normalizeHeaderName","enhanceError","DEFAULT_CONTENT_TYPE","setContentTypeIfUnset","headers","adapter","defaults","transitional","silentJSONParsing","forcedJSONParsing","clarifyTimeoutError","XMLHttpRequest","process","transformRequest","data","rawValue","parser","encoder","JSON","parse","e","stringify","stringifySafely","transformResponse","this","strictJSONParsing","responseType","timeout","xsrfCookieName","xsrfHeaderName","maxContentLength","maxBodyLength","validateStatus","status","common","method","args","Array","apply","encode","encodeURIComponent","url","params","paramsSerializer","serializedParams","parts","v","toISOString","push","join","hashmarkIndex","indexOf","error","config","code","request","response","isAxiosError","toJSON","message","description","number","fileName","lineNumber","columnNumber","stack","settle","cookies","buildURL","buildFullPath","parseHeaders","isURLSameOrigin","createError","Promise","resolve","reject","requestData","requestHeaders","auth","username","password","unescape","Authorization","btoa","fullPath","baseURL","onloadend","responseHeaders","getAllResponseHeaders","responseText","statusText","open","toUpperCase","onreadystatechange","readyState","responseURL","setTimeout","onabort","onerror","ontimeout","timeoutErrorMessage","xsrfValue","withCredentials","read","undefined","toLowerCase","setRequestHeader","onDownloadProgress","addEventListener","onUploadProgress","upload","cancelToken","promise","then","cancel","abort","send","Error","__CANCEL__","config1","config2","valueFromConfig2Keys","mergeDeepPropertiesKeys","defaultToConfig2Keys","directMergeKeys","getMergedValue","target","source","mergeDeepProperties","prop","axiosKeys","concat","otherKeys","keys","filter","Cancel","Axios","mergeConfig","createInstance","defaultConfig","context","instance","axios","instanceConfig","CancelToken","isCancel","all","promises","spread","default","InterceptorManager","dispatchRequest","validator","validators","interceptors","assertOptions","boolean","requestInterceptorChain","synchronousRequestInterceptors","interceptor","runWhen","synchronous","unshift","fulfilled","rejected","responseInterceptorChain","chain","shift","newConfig","onFulfilled","onRejected","getUri","handlers","use","options","eject","id","h","transformData","throwIfCancellationRequested","throwIfRequested","reason","fns","normalizedName","write","expires","path","domain","secure","cookie","Date","toGMTString","match","RegExp","decodeURIComponent","remove","now","isAbsoluteURL","combineURLs","requestedURL","test","relativeURL","ignoreDuplicateOf","parsed","split","line","substr","originURL","msie","userAgent","urlParsingNode","createElement","resolveURL","href","setAttribute","protocol","host","search","hash","hostname","port","pathname","charAt","location","requestURL","pkg","type","thing","deprecatedWarnings","currentVerArr","version","isOlderVersion","thanVersion","pkgVersionArr","destVer","isDeprecated","formatMessage","opt","desc","opts","console","warn","schema","allowUnknown","TypeError","executor","resolvePromise","token","callback","arr","payload"],"mappings":"CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,IACQ,mBAAXG,QAAyBA,OAAOC,IAC9CD,OAAO,GAAIH,GACe,iBAAZC,QACdA,QAAe,MAAID,IAEnBD,EAAY,MAAIC,IARlB,CASGK,QAAQ,WACX,O,YCTE,IAAIC,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUP,QAGnC,IAAIC,EAASI,EAAiBE,GAAY,CACzCC,EAAGD,EACHE,GAAG,EACHT,QAAS,IAUV,OANAU,EAAQH,GAAUI,KAAKV,EAAOD,QAAS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,GACrC,MAA2B,iBAAZA,IAAmD,IAAzBA,EAAQjM","file":"axios.min.js","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[\"axios\"] = factory();\n\telse\n\t\troot[\"axios\"] = factory();\n})(window, function() {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 10);\n","'use strict';\n\nvar bind = require('./helpers/bind');\n\n// utils is a library of generic helper functions non-specific to axios\n\nvar toString = Object.prototype.toString;\n\n/**\n * Determine if a value is an Array\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an Array, otherwise false\n */\nfunction isArray(val) {\n return toString.call(val) === '[object Array]';\n}\n\n/**\n * Determine if a value is undefined\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if the value is undefined, otherwise false\n */\nfunction isUndefined(val) {\n return typeof val === 'undefined';\n}\n\n/**\n * Determine if a value is a Buffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Buffer, otherwise false\n */\nfunction isBuffer(val) {\n return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor)\n && typeof val.constructor.isBuffer === 'function' && val.constructor.isBuffer(val);\n}\n\n/**\n * Determine if a value is an ArrayBuffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an ArrayBuffer, otherwise false\n */\nfunction isArrayBuffer(val) {\n return toString.call(val) === '[object ArrayBuffer]';\n}\n\n/**\n * Determine if a value is a FormData\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an FormData, otherwise false\n */\nfunction isFormData(val) {\n return (typeof FormData !== 'undefined') && (val instanceof FormData);\n}\n\n/**\n * Determine if a value is a view on an ArrayBuffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false\n */\nfunction isArrayBufferView(val) {\n var result;\n if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {\n result = ArrayBuffer.isView(val);\n } else {\n result = (val) && (val.buffer) && (val.buffer instanceof ArrayBuffer);\n }\n return result;\n}\n\n/**\n * Determine if a value is a String\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a String, otherwise false\n */\nfunction isString(val) {\n return typeof val === 'string';\n}\n\n/**\n * Determine if a value is a Number\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Number, otherwise false\n */\nfunction isNumber(val) {\n return typeof val === 'number';\n}\n\n/**\n * Determine if a value is an Object\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an Object, otherwise false\n */\nfunction isObject(val) {\n return val !== null && typeof val === 'object';\n}\n\n/**\n * Determine if a value is a plain Object\n *\n * @param {Object} val The value to test\n * @return {boolean} True if value is a plain Object, otherwise false\n */\nfunction isPlainObject(val) {\n if (toString.call(val) !== '[object Object]') {\n return false;\n }\n\n var prototype = Object.getPrototypeOf(val);\n return prototype === null || prototype === Object.prototype;\n}\n\n/**\n * Determine if a value is a Date\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Date, otherwise false\n */\nfunction isDate(val) {\n return toString.call(val) === '[object Date]';\n}\n\n/**\n * Determine if a value is a File\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a File, otherwise false\n */\nfunction isFile(val) {\n return toString.call(val) === '[object File]';\n}\n\n/**\n * Determine if a value is a Blob\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Blob, otherwise false\n */\nfunction isBlob(val) {\n return toString.call(val) === '[object Blob]';\n}\n\n/**\n * Determine if a value is a Function\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Function, otherwise false\n */\nfunction isFunction(val) {\n return toString.call(val) === '[object Function]';\n}\n\n/**\n * Determine if a value is a Stream\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Stream, otherwise false\n */\nfunction isStream(val) {\n return isObject(val) && isFunction(val.pipe);\n}\n\n/**\n * Determine if a value is a URLSearchParams object\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a URLSearchParams object, otherwise false\n */\nfunction isURLSearchParams(val) {\n return typeof URLSearchParams !== 'undefined' && val instanceof URLSearchParams;\n}\n\n/**\n * Trim excess whitespace off the beginning and end of a string\n *\n * @param {String} str The String to trim\n * @returns {String} The String freed of excess whitespace\n */\nfunction trim(str) {\n return str.trim ? str.trim() : str.replace(/^\\s+|\\s+$/g, '');\n}\n\n/**\n * Determine if we're running in a standard browser environment\n *\n * This allows axios to run in a web worker, and react-native.\n * Both environments support XMLHttpRequest, but not fully standard globals.\n *\n * web workers:\n * typeof window -> undefined\n * typeof document -> undefined\n *\n * react-native:\n * navigator.product -> 'ReactNative'\n * nativescript\n * navigator.product -> 'NativeScript' or 'NS'\n */\nfunction isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}\n\n/**\n * Iterate over an Array or an Object invoking a function for each item.\n *\n * If `obj` is an Array callback will be called passing\n * the value, index, and complete array for each item.\n *\n * If 'obj' is an Object callback will be called passing\n * the value, key, and complete object for each property.\n *\n * @param {Object|Array} obj The object to iterate\n * @param {Function} fn The callback to invoke for each item\n */\nfunction forEach(obj, fn) {\n // Don't bother if no value provided\n if (obj === null || typeof obj === 'undefined') {\n return;\n }\n\n // Force an array if not already something iterable\n if (typeof obj !== 'object') {\n /*eslint no-param-reassign:0*/\n obj = [obj];\n }\n\n if (isArray(obj)) {\n // Iterate over array values\n for (var i = 0, l = obj.length; i < l; i++) {\n fn.call(null, obj[i], i, obj);\n }\n } else {\n // Iterate over object keys\n for (var key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key)) {\n fn.call(null, obj[key], key, obj);\n }\n }\n }\n}\n\n/**\n * Accepts varargs expecting each argument to be an object, then\n * immutably merges the properties of each object and returns result.\n *\n * When multiple objects contain the same key the later object in\n * the arguments list will take precedence.\n *\n * Example:\n *\n * ```js\n * var result = merge({foo: 123}, {foo: 456});\n * console.log(result.foo); // outputs 456\n * ```\n *\n * @param {Object} obj1 Object to merge\n * @returns {Object} Result of all merge properties\n */\nfunction merge(/* obj1, obj2, obj3, ... */) {\n var result = {};\n function assignValue(val, key) {\n if (isPlainObject(result[key]) && isPlainObject(val)) {\n result[key] = merge(result[key], val);\n } else if (isPlainObject(val)) {\n result[key] = merge({}, val);\n } else if (isArray(val)) {\n result[key] = val.slice();\n } else {\n result[key] = val;\n }\n }\n\n for (var i = 0, l = arguments.length; i < l; i++) {\n forEach(arguments[i], assignValue);\n }\n return result;\n}\n\n/**\n * Extends object a by mutably adding to it the properties of object b.\n *\n * @param {Object} a The object to be extended\n * @param {Object} b The object to copy properties from\n * @param {Object} thisArg The object to bind function to\n * @return {Object} The resulting value of object a\n */\nfunction extend(a, b, thisArg) {\n forEach(b, function assignValue(val, key) {\n if (thisArg && typeof val === 'function') {\n a[key] = bind(val, thisArg);\n } else {\n a[key] = val;\n }\n });\n return a;\n}\n\n/**\n * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM)\n *\n * @param {string} content with BOM\n * @return {string} content value without BOM\n */\nfunction stripBOM(content) {\n if (content.charCodeAt(0) === 0xFEFF) {\n content = content.slice(1);\n }\n return content;\n}\n\nmodule.exports = {\n isArray: isArray,\n isArrayBuffer: isArrayBuffer,\n isBuffer: isBuffer,\n isFormData: isFormData,\n isArrayBufferView: isArrayBufferView,\n isString: isString,\n isNumber: isNumber,\n isObject: isObject,\n isPlainObject: isPlainObject,\n isUndefined: isUndefined,\n isDate: isDate,\n isFile: isFile,\n isBlob: isBlob,\n isFunction: isFunction,\n isStream: isStream,\n isURLSearchParams: isURLSearchParams,\n isStandardBrowserEnv: isStandardBrowserEnv,\n forEach: forEach,\n merge: merge,\n extend: extend,\n trim: trim,\n stripBOM: stripBOM\n};\n","'use strict';\n\nvar utils = require('./utils');\nvar normalizeHeaderName = require('./helpers/normalizeHeaderName');\nvar enhanceError = require('./core/enhanceError');\n\nvar DEFAULT_CONTENT_TYPE = {\n 'Content-Type': 'application/x-www-form-urlencoded'\n};\n\nfunction setContentTypeIfUnset(headers, value) {\n if (!utils.isUndefined(headers) && utils.isUndefined(headers['Content-Type'])) {\n headers['Content-Type'] = value;\n }\n}\n\nfunction getDefaultAdapter() {\n var adapter;\n if (typeof XMLHttpRequest !== 'undefined') {\n // For browsers use XHR adapter\n adapter = require('./adapters/xhr');\n } else if (typeof process !== 'undefined' && Object.prototype.toString.call(process) === '[object process]') {\n // For node use HTTP adapter\n adapter = require('./adapters/http');\n }\n return adapter;\n}\n\nfunction stringifySafely(rawValue, parser, encoder) {\n if (utils.isString(rawValue)) {\n try {\n (parser || JSON.parse)(rawValue);\n return utils.trim(rawValue);\n } catch (e) {\n if (e.name !== 'SyntaxError') {\n throw e;\n }\n }\n }\n\n return (encoder || JSON.stringify)(rawValue);\n}\n\nvar defaults = {\n\n transitional: {\n silentJSONParsing: true,\n forcedJSONParsing: true,\n clarifyTimeoutError: false\n },\n\n adapter: getDefaultAdapter(),\n\n transformRequest: [function transformRequest(data, headers) {\n normalizeHeaderName(headers, 'Accept');\n normalizeHeaderName(headers, 'Content-Type');\n\n if (utils.isFormData(data) ||\n utils.isArrayBuffer(data) ||\n utils.isBuffer(data) ||\n utils.isStream(data) ||\n utils.isFile(data) ||\n utils.isBlob(data)\n ) {\n return data;\n }\n if (utils.isArrayBufferView(data)) {\n return data.buffer;\n }\n if (utils.isURLSearchParams(data)) {\n setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8');\n return data.toString();\n }\n if (utils.isObject(data) || (headers && headers['Content-Type'] === 'application/json')) {\n setContentTypeIfUnset(headers, 'application/json');\n return stringifySafely(data);\n }\n return data;\n }],\n\n transformResponse: [function transformResponse(data) {\n var transitional = this.transitional;\n var silentJSONParsing = transitional && transitional.silentJSONParsing;\n var forcedJSONParsing = transitional && transitional.forcedJSONParsing;\n var strictJSONParsing = !silentJSONParsing && this.responseType === 'json';\n\n if (strictJSONParsing || (forcedJSONParsing && utils.isString(data) && data.length)) {\n try {\n return JSON.parse(data);\n } catch (e) {\n if (strictJSONParsing) {\n if (e.name === 'SyntaxError') {\n throw enhanceError(e, this, 'E_JSON_PARSE');\n }\n throw e;\n }\n }\n }\n\n return data;\n }],\n\n /**\n * A timeout in milliseconds to abort a request. If set to 0 (default) a\n * timeout is not created.\n */\n timeout: 0,\n\n xsrfCookieName: 'XSRF-TOKEN',\n xsrfHeaderName: 'X-XSRF-TOKEN',\n\n maxContentLength: -1,\n maxBodyLength: -1,\n\n validateStatus: function validateStatus(status) {\n return status >= 200 && status < 300;\n }\n};\n\ndefaults.headers = {\n common: {\n 'Accept': 'application/json, text/plain, */*'\n }\n};\n\nutils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) {\n defaults.headers[method] = {};\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE);\n});\n\nmodule.exports = defaults;\n","'use strict';\n\nmodule.exports = function bind(fn, thisArg) {\n return function wrap() {\n var args = new Array(arguments.length);\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i];\n }\n return fn.apply(thisArg, args);\n };\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\nfunction encode(val) {\n return encodeURIComponent(val).\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%20/g, '+').\n replace(/%5B/gi, '[').\n replace(/%5D/gi, ']');\n}\n\n/**\n * Build a URL by appending params to the end\n *\n * @param {string} url The base of the url (e.g., http://www.google.com)\n * @param {object} [params] The params to be appended\n * @returns {string} The formatted url\n */\nmodule.exports = function buildURL(url, params, paramsSerializer) {\n /*eslint no-param-reassign:0*/\n if (!params) {\n return url;\n }\n\n var serializedParams;\n if (paramsSerializer) {\n serializedParams = paramsSerializer(params);\n } else if (utils.isURLSearchParams(params)) {\n serializedParams = params.toString();\n } else {\n var parts = [];\n\n utils.forEach(params, function serialize(val, key) {\n if (val === null || typeof val === 'undefined') {\n return;\n }\n\n if (utils.isArray(val)) {\n key = key + '[]';\n } else {\n val = [val];\n }\n\n utils.forEach(val, function parseValue(v) {\n if (utils.isDate(v)) {\n v = v.toISOString();\n } else if (utils.isObject(v)) {\n v = JSON.stringify(v);\n }\n parts.push(encode(key) + '=' + encode(v));\n });\n });\n\n serializedParams = parts.join('&');\n }\n\n if (serializedParams) {\n var hashmarkIndex = url.indexOf('#');\n if (hashmarkIndex !== -1) {\n url = url.slice(0, hashmarkIndex);\n }\n\n url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;\n }\n\n return url;\n};\n","'use strict';\n\n/**\n * Update an Error with the specified config, error code, and response.\n *\n * @param {Error} error The error to update.\n * @param {Object} config The config.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n * @returns {Error} The error.\n */\nmodule.exports = function enhanceError(error, config, code, request, response) {\n error.config = config;\n if (code) {\n error.code = code;\n }\n\n error.request = request;\n error.response = response;\n error.isAxiosError = true;\n\n error.toJSON = function toJSON() {\n return {\n // Standard\n message: this.message,\n name: this.name,\n // Microsoft\n description: this.description,\n number: this.number,\n // Mozilla\n fileName: this.fileName,\n lineNumber: this.lineNumber,\n columnNumber: this.columnNumber,\n stack: this.stack,\n // Axios\n config: this.config,\n code: this.code\n };\n };\n return error;\n};\n","'use strict';\n\nvar utils = require('./../utils');\nvar settle = require('./../core/settle');\nvar cookies = require('./../helpers/cookies');\nvar buildURL = require('./../helpers/buildURL');\nvar buildFullPath = require('../core/buildFullPath');\nvar parseHeaders = require('./../helpers/parseHeaders');\nvar isURLSameOrigin = require('./../helpers/isURLSameOrigin');\nvar createError = require('../core/createError');\n\nmodule.exports = function xhrAdapter(config) {\n return new Promise(function dispatchXhrRequest(resolve, reject) {\n var requestData = config.data;\n var requestHeaders = config.headers;\n var responseType = config.responseType;\n\n if (utils.isFormData(requestData)) {\n delete requestHeaders['Content-Type']; // Let the browser set it\n }\n\n var request = new XMLHttpRequest();\n\n // HTTP basic authentication\n if (config.auth) {\n var username = config.auth.username || '';\n var password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : '';\n requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password);\n }\n\n var fullPath = buildFullPath(config.baseURL, config.url);\n request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true);\n\n // Set the request timeout in MS\n request.timeout = config.timeout;\n\n function onloadend() {\n if (!request) {\n return;\n }\n // Prepare the response\n var responseHeaders = 'getAllResponseHeaders' in request ? parseHeaders(request.getAllResponseHeaders()) : null;\n var responseData = !responseType || responseType === 'text' || responseType === 'json' ?\n request.responseText : request.response;\n var response = {\n data: responseData,\n status: request.status,\n statusText: request.statusText,\n headers: responseHeaders,\n config: config,\n request: request\n };\n\n settle(resolve, reject, response);\n\n // Clean up request\n request = null;\n }\n\n if ('onloadend' in request) {\n // Use onloadend if available\n request.onloadend = onloadend;\n } else {\n // Listen for ready state to emulate onloadend\n request.onreadystatechange = function handleLoad() {\n if (!request || request.readyState !== 4) {\n return;\n }\n\n // The request errored out and we didn't get a response, this will be\n // handled by onerror instead\n // With one exception: request that using file: protocol, most browsers\n // will return status as 0 even though it's a successful request\n if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {\n return;\n }\n // readystate handler is calling before onerror or ontimeout handlers,\n // so we should call onloadend on the next 'tick'\n setTimeout(onloadend);\n };\n }\n\n // Handle browser request cancellation (as opposed to a manual cancellation)\n request.onabort = function handleAbort() {\n if (!request) {\n return;\n }\n\n reject(createError('Request aborted', config, 'ECONNABORTED', request));\n\n // Clean up request\n request = null;\n };\n\n // Handle low level network errors\n request.onerror = function handleError() {\n // Real errors are hidden from us by the browser\n // onerror should only fire if it's a network error\n reject(createError('Network Error', config, null, request));\n\n // Clean up request\n request = null;\n };\n\n // Handle timeout\n request.ontimeout = function handleTimeout() {\n var timeoutErrorMessage = 'timeout of ' + config.timeout + 'ms exceeded';\n if (config.timeoutErrorMessage) {\n timeoutErrorMessage = config.timeoutErrorMessage;\n }\n reject(createError(\n timeoutErrorMessage,\n config,\n config.transitional && config.transitional.clarifyTimeoutError ? 'ETIMEDOUT' : 'ECONNABORTED',\n request));\n\n // Clean up request\n request = null;\n };\n\n // Add xsrf header\n // This is only done if running in a standard browser environment.\n // Specifically not if we're in a web worker, or react-native.\n if (utils.isStandardBrowserEnv()) {\n // Add xsrf header\n var xsrfValue = (config.withCredentials || isURLSameOrigin(fullPath)) && config.xsrfCookieName ?\n cookies.read(config.xsrfCookieName) :\n undefined;\n\n if (xsrfValue) {\n requestHeaders[config.xsrfHeaderName] = xsrfValue;\n }\n }\n\n // Add headers to the request\n if ('setRequestHeader' in request) {\n utils.forEach(requestHeaders, function setRequestHeader(val, key) {\n if (typeof requestData === 'undefined' && key.toLowerCase() === 'content-type') {\n // Remove Content-Type if data is undefined\n delete requestHeaders[key];\n } else {\n // Otherwise add header to the request\n request.setRequestHeader(key, val);\n }\n });\n }\n\n // Add withCredentials to request if needed\n if (!utils.isUndefined(config.withCredentials)) {\n request.withCredentials = !!config.withCredentials;\n }\n\n // Add responseType to request if needed\n if (responseType && responseType !== 'json') {\n request.responseType = config.responseType;\n }\n\n // Handle progress if needed\n if (typeof config.onDownloadProgress === 'function') {\n request.addEventListener('progress', config.onDownloadProgress);\n }\n\n // Not all browsers support upload events\n if (typeof config.onUploadProgress === 'function' && request.upload) {\n request.upload.addEventListener('progress', config.onUploadProgress);\n }\n\n if (config.cancelToken) {\n // Handle cancellation\n config.cancelToken.promise.then(function onCanceled(cancel) {\n if (!request) {\n return;\n }\n\n request.abort();\n reject(cancel);\n // Clean up request\n request = null;\n });\n }\n\n if (!requestData) {\n requestData = null;\n }\n\n // Send the request\n request.send(requestData);\n });\n};\n","'use strict';\n\nvar enhanceError = require('./enhanceError');\n\n/**\n * Create an Error with the specified message, config, error code, request and response.\n *\n * @param {string} message The error message.\n * @param {Object} config The config.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n * @returns {Error} The created error.\n */\nmodule.exports = function createError(message, config, code, request, response) {\n var error = new Error(message);\n return enhanceError(error, config, code, request, response);\n};\n","'use strict';\n\nmodule.exports = function isCancel(value) {\n return !!(value && value.__CANCEL__);\n};\n","'use strict';\n\nvar utils = require('../utils');\n\n/**\n * Config-specific merge-function which creates a new config-object\n * by merging two configuration objects together.\n *\n * @param {Object} config1\n * @param {Object} config2\n * @returns {Object} New object resulting from merging config2 to config1\n */\nmodule.exports = function mergeConfig(config1, config2) {\n // eslint-disable-next-line no-param-reassign\n config2 = config2 || {};\n var config = {};\n\n var valueFromConfig2Keys = ['url', 'method', 'data'];\n var mergeDeepPropertiesKeys = ['headers', 'auth', 'proxy', 'params'];\n var defaultToConfig2Keys = [\n 'baseURL', 'transformRequest', 'transformResponse', 'paramsSerializer',\n 'timeout', 'timeoutMessage', 'withCredentials', 'adapter', 'responseType', 'xsrfCookieName',\n 'xsrfHeaderName', 'onUploadProgress', 'onDownloadProgress', 'decompress',\n 'maxContentLength', 'maxBodyLength', 'maxRedirects', 'transport', 'httpAgent',\n 'httpsAgent', 'cancelToken', 'socketPath', 'responseEncoding'\n ];\n var directMergeKeys = ['validateStatus'];\n\n function getMergedValue(target, source) {\n if (utils.isPlainObject(target) && utils.isPlainObject(source)) {\n return utils.merge(target, source);\n } else if (utils.isPlainObject(source)) {\n return utils.merge({}, source);\n } else if (utils.isArray(source)) {\n return source.slice();\n }\n return source;\n }\n\n function mergeDeepProperties(prop) {\n if (!utils.isUndefined(config2[prop])) {\n config[prop] = getMergedValue(config1[prop], config2[prop]);\n } else if (!utils.isUndefined(config1[prop])) {\n config[prop] = getMergedValue(undefined, config1[prop]);\n }\n }\n\n utils.forEach(valueFromConfig2Keys, function valueFromConfig2(prop) {\n if (!utils.isUndefined(config2[prop])) {\n config[prop] = getMergedValue(undefined, config2[prop]);\n }\n });\n\n utils.forEach(mergeDeepPropertiesKeys, mergeDeepProperties);\n\n utils.forEach(defaultToConfig2Keys, function defaultToConfig2(prop) {\n if (!utils.isUndefined(config2[prop])) {\n config[prop] = getMergedValue(undefined, config2[prop]);\n } else if (!utils.isUndefined(config1[prop])) {\n config[prop] = getMergedValue(undefined, config1[prop]);\n }\n });\n\n utils.forEach(directMergeKeys, function merge(prop) {\n if (prop in config2) {\n config[prop] = getMergedValue(config1[prop], config2[prop]);\n } else if (prop in config1) {\n config[prop] = getMergedValue(undefined, config1[prop]);\n }\n });\n\n var axiosKeys = valueFromConfig2Keys\n .concat(mergeDeepPropertiesKeys)\n .concat(defaultToConfig2Keys)\n .concat(directMergeKeys);\n\n var otherKeys = Object\n .keys(config1)\n .concat(Object.keys(config2))\n .filter(function filterAxiosKeys(key) {\n return axiosKeys.indexOf(key) === -1;\n });\n\n utils.forEach(otherKeys, mergeDeepProperties);\n\n return config;\n};\n","'use strict';\n\n/**\n * A `Cancel` is an object that is thrown when an operation is canceled.\n *\n * @class\n * @param {string=} message The message.\n */\nfunction Cancel(message) {\n this.message = message;\n}\n\nCancel.prototype.toString = function toString() {\n return 'Cancel' + (this.message ? ': ' + this.message : '');\n};\n\nCancel.prototype.__CANCEL__ = true;\n\nmodule.exports = Cancel;\n","module.exports = require('./lib/axios');","'use strict';\n\nvar utils = require('./utils');\nvar bind = require('./helpers/bind');\nvar Axios = require('./core/Axios');\nvar mergeConfig = require('./core/mergeConfig');\nvar defaults = require('./defaults');\n\n/**\n * Create an instance of Axios\n *\n * @param {Object} defaultConfig The default config for the instance\n * @return {Axios} A new instance of Axios\n */\nfunction createInstance(defaultConfig) {\n var context = new Axios(defaultConfig);\n var instance = bind(Axios.prototype.request, context);\n\n // Copy axios.prototype to instance\n utils.extend(instance, Axios.prototype, context);\n\n // Copy context to instance\n utils.extend(instance, context);\n\n return instance;\n}\n\n// Create the default instance to be exported\nvar axios = createInstance(defaults);\n\n// Expose Axios class to allow class inheritance\naxios.Axios = Axios;\n\n// Factory for creating new instances\naxios.create = function create(instanceConfig) {\n return createInstance(mergeConfig(axios.defaults, instanceConfig));\n};\n\n// Expose Cancel & CancelToken\naxios.Cancel = require('./cancel/Cancel');\naxios.CancelToken = require('./cancel/CancelToken');\naxios.isCancel = require('./cancel/isCancel');\n\n// Expose all/spread\naxios.all = function all(promises) {\n return Promise.all(promises);\n};\naxios.spread = require('./helpers/spread');\n\n// Expose isAxiosError\naxios.isAxiosError = require('./helpers/isAxiosError');\n\nmodule.exports = axios;\n\n// Allow use of default import syntax in TypeScript\nmodule.exports.default = axios;\n","'use strict';\n\nvar utils = require('./../utils');\nvar buildURL = require('../helpers/buildURL');\nvar InterceptorManager = require('./InterceptorManager');\nvar dispatchRequest = require('./dispatchRequest');\nvar mergeConfig = require('./mergeConfig');\nvar validator = require('../helpers/validator');\n\nvar validators = validator.validators;\n/**\n * Create a new instance of Axios\n *\n * @param {Object} instanceConfig The default config for the instance\n */\nfunction Axios(instanceConfig) {\n this.defaults = instanceConfig;\n this.interceptors = {\n request: new InterceptorManager(),\n response: new InterceptorManager()\n };\n}\n\n/**\n * Dispatch a request\n *\n * @param {Object} config The config specific for this request (merged with this.defaults)\n */\nAxios.prototype.request = function request(config) {\n /*eslint no-param-reassign:0*/\n // Allow for axios('example/url'[, config]) a la fetch API\n if (typeof config === 'string') {\n config = arguments[1] || {};\n config.url = arguments[0];\n } else {\n config = config || {};\n }\n\n config = mergeConfig(this.defaults, config);\n\n // Set config.method\n if (config.method) {\n config.method = config.method.toLowerCase();\n } else if (this.defaults.method) {\n config.method = this.defaults.method.toLowerCase();\n } else {\n config.method = 'get';\n }\n\n var transitional = config.transitional;\n\n if (transitional !== undefined) {\n validator.assertOptions(transitional, {\n silentJSONParsing: validators.transitional(validators.boolean, '1.0.0'),\n forcedJSONParsing: validators.transitional(validators.boolean, '1.0.0'),\n clarifyTimeoutError: validators.transitional(validators.boolean, '1.0.0')\n }, false);\n }\n\n // filter out skipped interceptors\n var requestInterceptorChain = [];\n var synchronousRequestInterceptors = true;\n this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {\n if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) {\n return;\n }\n\n synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;\n\n requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);\n });\n\n var responseInterceptorChain = [];\n this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {\n responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);\n });\n\n var promise;\n\n if (!synchronousRequestInterceptors) {\n var chain = [dispatchRequest, undefined];\n\n Array.prototype.unshift.apply(chain, requestInterceptorChain);\n chain = chain.concat(responseInterceptorChain);\n\n promise = Promise.resolve(config);\n while (chain.length) {\n promise = promise.then(chain.shift(), chain.shift());\n }\n\n return promise;\n }\n\n\n var newConfig = config;\n while (requestInterceptorChain.length) {\n var onFulfilled = requestInterceptorChain.shift();\n var onRejected = requestInterceptorChain.shift();\n try {\n newConfig = onFulfilled(newConfig);\n } catch (error) {\n onRejected(error);\n break;\n }\n }\n\n try {\n promise = dispatchRequest(newConfig);\n } catch (error) {\n return Promise.reject(error);\n }\n\n while (responseInterceptorChain.length) {\n promise = promise.then(responseInterceptorChain.shift(), responseInterceptorChain.shift());\n }\n\n return promise;\n};\n\nAxios.prototype.getUri = function getUri(config) {\n config = mergeConfig(this.defaults, config);\n return buildURL(config.url, config.params, config.paramsSerializer).replace(/^\\?/, '');\n};\n\n// Provide aliases for supported request methods\nutils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, config) {\n return this.request(mergeConfig(config || {}, {\n method: method,\n url: url,\n data: (config || {}).data\n }));\n };\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, data, config) {\n return this.request(mergeConfig(config || {}, {\n method: method,\n url: url,\n data: data\n }));\n };\n});\n\nmodule.exports = Axios;\n","'use strict';\n\nvar utils = require('./../utils');\n\nfunction InterceptorManager() {\n this.handlers = [];\n}\n\n/**\n * Add a new interceptor to the stack\n *\n * @param {Function} fulfilled The function to handle `then` for a `Promise`\n * @param {Function} rejected The function to handle `reject` for a `Promise`\n *\n * @return {Number} An ID used to remove interceptor later\n */\nInterceptorManager.prototype.use = function use(fulfilled, rejected, options) {\n this.handlers.push({\n fulfilled: fulfilled,\n rejected: rejected,\n synchronous: options ? options.synchronous : false,\n runWhen: options ? options.runWhen : null\n });\n return this.handlers.length - 1;\n};\n\n/**\n * Remove an interceptor from the stack\n *\n * @param {Number} id The ID that was returned by `use`\n */\nInterceptorManager.prototype.eject = function eject(id) {\n if (this.handlers[id]) {\n this.handlers[id] = null;\n }\n};\n\n/**\n * Iterate over all the registered interceptors\n *\n * This method is particularly useful for skipping over any\n * interceptors that may have become `null` calling `eject`.\n *\n * @param {Function} fn The function to call for each interceptor\n */\nInterceptorManager.prototype.forEach = function forEach(fn) {\n utils.forEach(this.handlers, function forEachHandler(h) {\n if (h !== null) {\n fn(h);\n }\n });\n};\n\nmodule.exports = InterceptorManager;\n","'use strict';\n\nvar utils = require('./../utils');\nvar transformData = require('./transformData');\nvar isCancel = require('../cancel/isCancel');\nvar defaults = require('../defaults');\n\n/**\n * Throws a `Cancel` if cancellation has been requested.\n */\nfunction throwIfCancellationRequested(config) {\n if (config.cancelToken) {\n config.cancelToken.throwIfRequested();\n }\n}\n\n/**\n * Dispatch a request to the server using the configured adapter.\n *\n * @param {object} config The config that is to be used for the request\n * @returns {Promise} The Promise to be fulfilled\n */\nmodule.exports = function dispatchRequest(config) {\n throwIfCancellationRequested(config);\n\n // Ensure headers exist\n config.headers = config.headers || {};\n\n // Transform request data\n config.data = transformData.call(\n config,\n config.data,\n config.headers,\n config.transformRequest\n );\n\n // Flatten headers\n config.headers = utils.merge(\n config.headers.common || {},\n config.headers[config.method] || {},\n config.headers\n );\n\n utils.forEach(\n ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],\n function cleanHeaderConfig(method) {\n delete config.headers[method];\n }\n );\n\n var adapter = config.adapter || defaults.adapter;\n\n return adapter(config).then(function onAdapterResolution(response) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n response.data = transformData.call(\n config,\n response.data,\n response.headers,\n config.transformResponse\n );\n\n return response;\n }, function onAdapterRejection(reason) {\n if (!isCancel(reason)) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n if (reason && reason.response) {\n reason.response.data = transformData.call(\n config,\n reason.response.data,\n reason.response.headers,\n config.transformResponse\n );\n }\n }\n\n return Promise.reject(reason);\n });\n};\n","'use strict';\n\nvar utils = require('./../utils');\nvar defaults = require('./../defaults');\n\n/**\n * Transform the data for a request or a response\n *\n * @param {Object|String} data The data to be transformed\n * @param {Array} headers The headers for the request or response\n * @param {Array|Function} fns A single function or Array of functions\n * @returns {*} The resulting transformed data\n */\nmodule.exports = function transformData(data, headers, fns) {\n var context = this || defaults;\n /*eslint no-param-reassign:0*/\n utils.forEach(fns, function transform(fn) {\n data = fn.call(context, data, headers);\n });\n\n return data;\n};\n","'use strict';\n\nvar utils = require('../utils');\n\nmodule.exports = function normalizeHeaderName(headers, normalizedName) {\n utils.forEach(headers, function processHeader(value, name) {\n if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) {\n headers[normalizedName] = value;\n delete headers[name];\n }\n });\n};\n","'use strict';\n\nvar createError = require('./createError');\n\n/**\n * Resolve or reject a Promise based on response status.\n *\n * @param {Function} resolve A function that resolves the promise.\n * @param {Function} reject A function that rejects the promise.\n * @param {object} response The response.\n */\nmodule.exports = function settle(resolve, reject, response) {\n var validateStatus = response.config.validateStatus;\n if (!response.status || !validateStatus || validateStatus(response.status)) {\n resolve(response);\n } else {\n reject(createError(\n 'Request failed with status code ' + response.status,\n response.config,\n null,\n response.request,\n response\n ));\n }\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\nmodule.exports = (\n utils.isStandardBrowserEnv() ?\n\n // Standard browser envs support document.cookie\n (function standardBrowserEnv() {\n return {\n write: function write(name, value, expires, path, domain, secure) {\n var cookie = [];\n cookie.push(name + '=' + encodeURIComponent(value));\n\n if (utils.isNumber(expires)) {\n cookie.push('expires=' + new Date(expires).toGMTString());\n }\n\n if (utils.isString(path)) {\n cookie.push('path=' + path);\n }\n\n if (utils.isString(domain)) {\n cookie.push('domain=' + domain);\n }\n\n if (secure === true) {\n cookie.push('secure');\n }\n\n document.cookie = cookie.join('; ');\n },\n\n read: function read(name) {\n var match = document.cookie.match(new RegExp('(^|;\\\\s*)(' + name + ')=([^;]*)'));\n return (match ? decodeURIComponent(match[3]) : null);\n },\n\n remove: function remove(name) {\n this.write(name, '', Date.now() - 86400000);\n }\n };\n })() :\n\n // Non standard browser env (web workers, react-native) lack needed support.\n (function nonStandardBrowserEnv() {\n return {\n write: function write() {},\n read: function read() { return null; },\n remove: function remove() {}\n };\n })()\n);\n","'use strict';\n\nvar isAbsoluteURL = require('../helpers/isAbsoluteURL');\nvar combineURLs = require('../helpers/combineURLs');\n\n/**\n * Creates a new URL by combining the baseURL with the requestedURL,\n * only when the requestedURL is not already an absolute URL.\n * If the requestURL is absolute, this function returns the requestedURL untouched.\n *\n * @param {string} baseURL The base URL\n * @param {string} requestedURL Absolute or relative URL to combine\n * @returns {string} The combined full path\n */\nmodule.exports = function buildFullPath(baseURL, requestedURL) {\n if (baseURL && !isAbsoluteURL(requestedURL)) {\n return combineURLs(baseURL, requestedURL);\n }\n return requestedURL;\n};\n","'use strict';\n\n/**\n * Determines whether the specified URL is absolute\n *\n * @param {string} url The URL to test\n * @returns {boolean} True if the specified URL is absolute, otherwise false\n */\nmodule.exports = function isAbsoluteURL(url) {\n // A URL is considered absolute if it begins with \"://\" or \"//\" (protocol-relative URL).\n // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed\n // by any combination of letters, digits, plus, period, or hyphen.\n return /^([a-z][a-z\\d\\+\\-\\.]*:)?\\/\\//i.test(url);\n};\n","'use strict';\n\n/**\n * Creates a new URL by combining the specified URLs\n *\n * @param {string} baseURL The base URL\n * @param {string} relativeURL The relative URL\n * @returns {string} The combined URL\n */\nmodule.exports = function combineURLs(baseURL, relativeURL) {\n return relativeURL\n ? baseURL.replace(/\\/+$/, '') + '/' + relativeURL.replace(/^\\/+/, '')\n : baseURL;\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\n// Headers whose duplicates are ignored by node\n// c.f. https://nodejs.org/api/http.html#http_message_headers\nvar ignoreDuplicateOf = [\n 'age', 'authorization', 'content-length', 'content-type', 'etag',\n 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',\n 'last-modified', 'location', 'max-forwards', 'proxy-authorization',\n 'referer', 'retry-after', 'user-agent'\n];\n\n/**\n * Parse headers into an object\n *\n * ```\n * Date: Wed, 27 Aug 2014 08:58:49 GMT\n * Content-Type: application/json\n * Connection: keep-alive\n * Transfer-Encoding: chunked\n * ```\n *\n * @param {String} headers Headers needing to be parsed\n * @returns {Object} Headers parsed into an object\n */\nmodule.exports = function parseHeaders(headers) {\n var parsed = {};\n var key;\n var val;\n var i;\n\n if (!headers) { return parsed; }\n\n utils.forEach(headers.split('\\n'), function parser(line) {\n i = line.indexOf(':');\n key = utils.trim(line.substr(0, i)).toLowerCase();\n val = utils.trim(line.substr(i + 1));\n\n if (key) {\n if (parsed[key] && ignoreDuplicateOf.indexOf(key) >= 0) {\n return;\n }\n if (key === 'set-cookie') {\n parsed[key] = (parsed[key] ? parsed[key] : []).concat([val]);\n } else {\n parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;\n }\n }\n });\n\n return parsed;\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\nmodule.exports = (\n utils.isStandardBrowserEnv() ?\n\n // Standard browser envs have full support of the APIs needed to test\n // whether the request URL is of the same origin as current location.\n (function standardBrowserEnv() {\n var msie = /(msie|trident)/i.test(navigator.userAgent);\n var urlParsingNode = document.createElement('a');\n var originURL;\n\n /**\n * Parse a URL to discover it's components\n *\n * @param {String} url The URL to be parsed\n * @returns {Object}\n */\n function resolveURL(url) {\n var href = url;\n\n if (msie) {\n // IE needs attribute set twice to normalize properties\n urlParsingNode.setAttribute('href', href);\n href = urlParsingNode.href;\n }\n\n urlParsingNode.setAttribute('href', href);\n\n // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils\n return {\n href: urlParsingNode.href,\n protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',\n host: urlParsingNode.host,\n search: urlParsingNode.search ? urlParsingNode.search.replace(/^\\?/, '') : '',\n hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',\n hostname: urlParsingNode.hostname,\n port: urlParsingNode.port,\n pathname: (urlParsingNode.pathname.charAt(0) === '/') ?\n urlParsingNode.pathname :\n '/' + urlParsingNode.pathname\n };\n }\n\n originURL = resolveURL(window.location.href);\n\n /**\n * Determine if a URL shares the same origin as the current location\n *\n * @param {String} requestURL The URL to test\n * @returns {boolean} True if URL shares the same origin, otherwise false\n */\n return function isURLSameOrigin(requestURL) {\n var parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL;\n return (parsed.protocol === originURL.protocol &&\n parsed.host === originURL.host);\n };\n })() :\n\n // Non standard browser envs (web workers, react-native) lack needed support.\n (function nonStandardBrowserEnv() {\n return function isURLSameOrigin() {\n return true;\n };\n })()\n);\n","'use strict';\n\nvar pkg = require('./../../package.json');\n\nvar validators = {};\n\n// eslint-disable-next-line func-names\n['object', 'boolean', 'number', 'function', 'string', 'symbol'].forEach(function(type, i) {\n validators[type] = function validator(thing) {\n return typeof thing === type || 'a' + (i < 1 ? 'n ' : ' ') + type;\n };\n});\n\nvar deprecatedWarnings = {};\nvar currentVerArr = pkg.version.split('.');\n\n/**\n * Compare package versions\n * @param {string} version\n * @param {string?} thanVersion\n * @returns {boolean}\n */\nfunction isOlderVersion(version, thanVersion) {\n var pkgVersionArr = thanVersion ? thanVersion.split('.') : currentVerArr;\n var destVer = version.split('.');\n for (var i = 0; i < 3; i++) {\n if (pkgVersionArr[i] > destVer[i]) {\n return true;\n } else if (pkgVersionArr[i] < destVer[i]) {\n return false;\n }\n }\n return false;\n}\n\n/**\n * Transitional option validator\n * @param {function|boolean?} validator\n * @param {string?} version\n * @param {string} message\n * @returns {function}\n */\nvalidators.transitional = function transitional(validator, version, message) {\n var isDeprecated = version && isOlderVersion(version);\n\n function formatMessage(opt, desc) {\n return '[Axios v' + pkg.version + '] Transitional option \\'' + opt + '\\'' + desc + (message ? '. ' + message : '');\n }\n\n // eslint-disable-next-line func-names\n return function(value, opt, opts) {\n if (validator === false) {\n throw new Error(formatMessage(opt, ' has been removed in ' + version));\n }\n\n if (isDeprecated && !deprecatedWarnings[opt]) {\n deprecatedWarnings[opt] = true;\n // eslint-disable-next-line no-console\n console.warn(\n formatMessage(\n opt,\n ' has been deprecated since v' + version + ' and will be removed in the near future'\n )\n );\n }\n\n return validator ? validator(value, opt, opts) : true;\n };\n};\n\n/**\n * Assert object's properties type\n * @param {object} options\n * @param {object} schema\n * @param {boolean?} allowUnknown\n */\n\nfunction assertOptions(options, schema, allowUnknown) {\n if (typeof options !== 'object') {\n throw new TypeError('options must be an object');\n }\n var keys = Object.keys(options);\n var i = keys.length;\n while (i-- > 0) {\n var opt = keys[i];\n var validator = schema[opt];\n if (validator) {\n var value = options[opt];\n var result = value === undefined || validator(value, opt, options);\n if (result !== true) {\n throw new TypeError('option ' + opt + ' must be ' + result);\n }\n continue;\n }\n if (allowUnknown !== true) {\n throw Error('Unknown option ' + opt);\n }\n }\n}\n\nmodule.exports = {\n isOlderVersion: isOlderVersion,\n assertOptions: assertOptions,\n validators: validators\n};\n","'use strict';\n\nvar Cancel = require('./Cancel');\n\n/**\n * A `CancelToken` is an object that can be used to request cancellation of an operation.\n *\n * @class\n * @param {Function} executor The executor function.\n */\nfunction CancelToken(executor) {\n if (typeof executor !== 'function') {\n throw new TypeError('executor must be a function.');\n }\n\n var resolvePromise;\n this.promise = new Promise(function promiseExecutor(resolve) {\n resolvePromise = resolve;\n });\n\n var token = this;\n executor(function cancel(message) {\n if (token.reason) {\n // Cancellation has already been requested\n return;\n }\n\n token.reason = new Cancel(message);\n resolvePromise(token.reason);\n });\n}\n\n/**\n * Throws a `Cancel` if cancellation has been requested.\n */\nCancelToken.prototype.throwIfRequested = function throwIfRequested() {\n if (this.reason) {\n throw this.reason;\n }\n};\n\n/**\n * Returns an object that contains a new `CancelToken` and a function that, when called,\n * cancels the `CancelToken`.\n */\nCancelToken.source = function source() {\n var cancel;\n var token = new CancelToken(function executor(c) {\n cancel = c;\n });\n return {\n token: token,\n cancel: cancel\n };\n};\n\nmodule.exports = CancelToken;\n","'use strict';\n\n/**\n * Syntactic sugar for invoking a function and expanding an array for arguments.\n *\n * Common use case would be to use `Function.prototype.apply`.\n *\n * ```js\n * function f(x, y, z) {}\n * var args = [1, 2, 3];\n * f.apply(null, args);\n * ```\n *\n * With `spread` this example can be re-written.\n *\n * ```js\n * spread(function(x, y, z) {})([1, 2, 3]);\n * ```\n *\n * @param {Function} callback\n * @returns {Function}\n */\nmodule.exports = function spread(callback) {\n return function wrap(arr) {\n return callback.apply(null, arr);\n };\n};\n","'use strict';\n\n/**\n * Determines whether the payload is an error thrown by Axios\n *\n * @param {*} payload The value to test\n * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false\n */\nmodule.exports = function isAxiosError(payload) {\n return (typeof payload === 'object') && (payload.isAxiosError === true);\n};\n"],"sourceRoot":""} \ No newline at end of file diff --git a/node_modules/@shineiichijo/nhentai-pdf/node_modules/axios/index.d.ts b/node_modules/@shineiichijo/nhentai-pdf/node_modules/axios/index.d.ts new file mode 100644 index 000000000..78f733f89 --- /dev/null +++ b/node_modules/@shineiichijo/nhentai-pdf/node_modules/axios/index.d.ts @@ -0,0 +1,168 @@ +export interface AxiosTransformer { + (data: any, headers?: any): any; +} + +export interface AxiosAdapter { + (config: AxiosRequestConfig): AxiosPromise; +} + +export interface AxiosBasicCredentials { + username: string; + password: string; +} + +export interface AxiosProxyConfig { + host: string; + port: number; + auth?: { + username: string; + password:string; + }; + protocol?: string; +} + +export type Method = + | 'get' | 'GET' + | 'delete' | 'DELETE' + | 'head' | 'HEAD' + | 'options' | 'OPTIONS' + | 'post' | 'POST' + | 'put' | 'PUT' + | 'patch' | 'PATCH' + | 'purge' | 'PURGE' + | 'link' | 'LINK' + | 'unlink' | 'UNLINK' + +export type ResponseType = + | 'arraybuffer' + | 'blob' + | 'document' + | 'json' + | 'text' + | 'stream' + +export interface TransitionalOptions{ + silentJSONParsing: boolean; + forcedJSONParsing: boolean; + clarifyTimeoutError: boolean; +} + +export interface AxiosRequestConfig { + url?: string; + method?: Method; + baseURL?: string; + transformRequest?: AxiosTransformer | AxiosTransformer[]; + transformResponse?: AxiosTransformer | AxiosTransformer[]; + headers?: any; + params?: any; + paramsSerializer?: (params: any) => string; + data?: any; + timeout?: number; + timeoutErrorMessage?: string; + withCredentials?: boolean; + adapter?: AxiosAdapter; + auth?: AxiosBasicCredentials; + responseType?: ResponseType; + xsrfCookieName?: string; + xsrfHeaderName?: string; + onUploadProgress?: (progressEvent: any) => void; + onDownloadProgress?: (progressEvent: any) => void; + maxContentLength?: number; + validateStatus?: ((status: number) => boolean) | null; + maxBodyLength?: number; + maxRedirects?: number; + socketPath?: string | null; + httpAgent?: any; + httpsAgent?: any; + proxy?: AxiosProxyConfig | false; + cancelToken?: CancelToken; + decompress?: boolean; + transitional?: TransitionalOptions +} + +export interface AxiosResponse { + data: T; + status: number; + statusText: string; + headers: any; + config: AxiosRequestConfig; + request?: any; +} + +export interface AxiosError extends Error { + config: AxiosRequestConfig; + code?: string; + request?: any; + response?: AxiosResponse; + isAxiosError: boolean; + toJSON: () => object; +} + +export interface AxiosPromise extends Promise> { +} + +export interface CancelStatic { + new (message?: string): Cancel; +} + +export interface Cancel { + message: string; +} + +export interface Canceler { + (message?: string): void; +} + +export interface CancelTokenStatic { + new (executor: (cancel: Canceler) => void): CancelToken; + source(): CancelTokenSource; +} + +export interface CancelToken { + promise: Promise; + reason?: Cancel; + throwIfRequested(): void; +} + +export interface CancelTokenSource { + token: CancelToken; + cancel: Canceler; +} + +export interface AxiosInterceptorManager { + use(onFulfilled?: (value: V) => T | Promise, onRejected?: (error: any) => any): number; + eject(id: number): void; +} + +export interface AxiosInstance { + (config: AxiosRequestConfig): AxiosPromise; + (url: string, config?: AxiosRequestConfig): AxiosPromise; + defaults: AxiosRequestConfig; + interceptors: { + request: AxiosInterceptorManager; + response: AxiosInterceptorManager; + }; + getUri(config?: AxiosRequestConfig): string; + request> (config: AxiosRequestConfig): Promise; + get>(url: string, config?: AxiosRequestConfig): Promise; + delete>(url: string, config?: AxiosRequestConfig): Promise; + head>(url: string, config?: AxiosRequestConfig): Promise; + options>(url: string, config?: AxiosRequestConfig): Promise; + post>(url: string, data?: any, config?: AxiosRequestConfig): Promise; + put>(url: string, data?: any, config?: AxiosRequestConfig): Promise; + patch>(url: string, data?: any, config?: AxiosRequestConfig): Promise; +} + +export interface AxiosStatic extends AxiosInstance { + create(config?: AxiosRequestConfig): AxiosInstance; + Cancel: CancelStatic; + CancelToken: CancelTokenStatic; + isCancel(value: any): boolean; + all(values: (T | Promise)[]): Promise; + spread(callback: (...args: T[]) => R): (array: T[]) => R; + isAxiosError(payload: any): payload is AxiosError; +} + +declare const axios: AxiosStatic; + +export default axios; diff --git a/node_modules/@shineiichijo/nhentai-pdf/node_modules/axios/index.js b/node_modules/@shineiichijo/nhentai-pdf/node_modules/axios/index.js new file mode 100644 index 000000000..79dfd09dd --- /dev/null +++ b/node_modules/@shineiichijo/nhentai-pdf/node_modules/axios/index.js @@ -0,0 +1 @@ +module.exports = require('./lib/axios'); \ No newline at end of file diff --git a/node_modules/@shineiichijo/nhentai-pdf/node_modules/axios/lib/adapters/README.md b/node_modules/@shineiichijo/nhentai-pdf/node_modules/axios/lib/adapters/README.md new file mode 100644 index 000000000..68f111895 --- /dev/null +++ b/node_modules/@shineiichijo/nhentai-pdf/node_modules/axios/lib/adapters/README.md @@ -0,0 +1,37 @@ +# axios // adapters + +The modules under `adapters/` are modules that handle dispatching a request and settling a returned `Promise` once a response is received. + +## Example + +```js +var settle = require('./../core/settle'); + +module.exports = function myAdapter(config) { + // At this point: + // - config has been merged with defaults + // - request transformers have already run + // - request interceptors have already run + + // Make the request using config provided + // Upon response settle the Promise + + return new Promise(function(resolve, reject) { + + var response = { + data: responseData, + status: request.status, + statusText: request.statusText, + headers: responseHeaders, + config: config, + request: request + }; + + settle(resolve, reject, response); + + // From here: + // - response transformers will run + // - response interceptors will run + }); +} +``` diff --git a/node_modules/@shineiichijo/nhentai-pdf/node_modules/axios/lib/adapters/http.js b/node_modules/@shineiichijo/nhentai-pdf/node_modules/axios/lib/adapters/http.js new file mode 100644 index 000000000..0cca3bdfb --- /dev/null +++ b/node_modules/@shineiichijo/nhentai-pdf/node_modules/axios/lib/adapters/http.js @@ -0,0 +1,331 @@ +'use strict'; + +var utils = require('./../utils'); +var settle = require('./../core/settle'); +var buildFullPath = require('../core/buildFullPath'); +var buildURL = require('./../helpers/buildURL'); +var http = require('http'); +var https = require('https'); +var httpFollow = require('follow-redirects').http; +var httpsFollow = require('follow-redirects').https; +var url = require('url'); +var zlib = require('zlib'); +var pkg = require('./../../package.json'); +var createError = require('../core/createError'); +var enhanceError = require('../core/enhanceError'); + +var isHttps = /https:?/; + +/** + * + * @param {http.ClientRequestArgs} options + * @param {AxiosProxyConfig} proxy + * @param {string} location + */ +function setProxy(options, proxy, location) { + options.hostname = proxy.host; + options.host = proxy.host; + options.port = proxy.port; + options.path = location; + + // Basic proxy authorization + if (proxy.auth) { + var base64 = Buffer.from(proxy.auth.username + ':' + proxy.auth.password, 'utf8').toString('base64'); + options.headers['Proxy-Authorization'] = 'Basic ' + base64; + } + + // If a proxy is used, any redirects must also pass through the proxy + options.beforeRedirect = function beforeRedirect(redirection) { + redirection.headers.host = redirection.host; + setProxy(redirection, proxy, redirection.href); + }; +} + +/*eslint consistent-return:0*/ +module.exports = function httpAdapter(config) { + return new Promise(function dispatchHttpRequest(resolvePromise, rejectPromise) { + var resolve = function resolve(value) { + resolvePromise(value); + }; + var reject = function reject(value) { + rejectPromise(value); + }; + var data = config.data; + var headers = config.headers; + + // Set User-Agent (required by some servers) + // See https://github.com/axios/axios/issues/69 + if ('User-Agent' in headers || 'user-agent' in headers) { + // User-Agent is specified; handle case where no UA header is desired + if (!headers['User-Agent'] && !headers['user-agent']) { + delete headers['User-Agent']; + delete headers['user-agent']; + } + // Otherwise, use specified value + } else { + // Only set header if it hasn't been set in config + headers['User-Agent'] = 'axios/' + pkg.version; + } + + if (data && !utils.isStream(data)) { + if (Buffer.isBuffer(data)) { + // Nothing to do... + } else if (utils.isArrayBuffer(data)) { + data = Buffer.from(new Uint8Array(data)); + } else if (utils.isString(data)) { + data = Buffer.from(data, 'utf-8'); + } else { + return reject(createError( + 'Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream', + config + )); + } + + // Add Content-Length header if data exists + headers['Content-Length'] = data.length; + } + + // HTTP basic authentication + var auth = undefined; + if (config.auth) { + var username = config.auth.username || ''; + var password = config.auth.password || ''; + auth = username + ':' + password; + } + + // Parse url + var fullPath = buildFullPath(config.baseURL, config.url); + var parsed = url.parse(fullPath); + var protocol = parsed.protocol || 'http:'; + + if (!auth && parsed.auth) { + var urlAuth = parsed.auth.split(':'); + var urlUsername = urlAuth[0] || ''; + var urlPassword = urlAuth[1] || ''; + auth = urlUsername + ':' + urlPassword; + } + + if (auth) { + delete headers.Authorization; + } + + var isHttpsRequest = isHttps.test(protocol); + var agent = isHttpsRequest ? config.httpsAgent : config.httpAgent; + + var options = { + path: buildURL(parsed.path, config.params, config.paramsSerializer).replace(/^\?/, ''), + method: config.method.toUpperCase(), + headers: headers, + agent: agent, + agents: { http: config.httpAgent, https: config.httpsAgent }, + auth: auth + }; + + if (config.socketPath) { + options.socketPath = config.socketPath; + } else { + options.hostname = parsed.hostname; + options.port = parsed.port; + } + + var proxy = config.proxy; + if (!proxy && proxy !== false) { + var proxyEnv = protocol.slice(0, -1) + '_proxy'; + var proxyUrl = process.env[proxyEnv] || process.env[proxyEnv.toUpperCase()]; + if (proxyUrl) { + var parsedProxyUrl = url.parse(proxyUrl); + var noProxyEnv = process.env.no_proxy || process.env.NO_PROXY; + var shouldProxy = true; + + if (noProxyEnv) { + var noProxy = noProxyEnv.split(',').map(function trim(s) { + return s.trim(); + }); + + shouldProxy = !noProxy.some(function proxyMatch(proxyElement) { + if (!proxyElement) { + return false; + } + if (proxyElement === '*') { + return true; + } + if (proxyElement[0] === '.' && + parsed.hostname.substr(parsed.hostname.length - proxyElement.length) === proxyElement) { + return true; + } + + return parsed.hostname === proxyElement; + }); + } + + if (shouldProxy) { + proxy = { + host: parsedProxyUrl.hostname, + port: parsedProxyUrl.port, + protocol: parsedProxyUrl.protocol + }; + + if (parsedProxyUrl.auth) { + var proxyUrlAuth = parsedProxyUrl.auth.split(':'); + proxy.auth = { + username: proxyUrlAuth[0], + password: proxyUrlAuth[1] + }; + } + } + } + } + + if (proxy) { + options.headers.host = parsed.hostname + (parsed.port ? ':' + parsed.port : ''); + setProxy(options, proxy, protocol + '//' + parsed.hostname + (parsed.port ? ':' + parsed.port : '') + options.path); + } + + var transport; + var isHttpsProxy = isHttpsRequest && (proxy ? isHttps.test(proxy.protocol) : true); + if (config.transport) { + transport = config.transport; + } else if (config.maxRedirects === 0) { + transport = isHttpsProxy ? https : http; + } else { + if (config.maxRedirects) { + options.maxRedirects = config.maxRedirects; + } + transport = isHttpsProxy ? httpsFollow : httpFollow; + } + + if (config.maxBodyLength > -1) { + options.maxBodyLength = config.maxBodyLength; + } + + // Create the request + var req = transport.request(options, function handleResponse(res) { + if (req.aborted) return; + + // uncompress the response body transparently if required + var stream = res; + + // return the last request in case of redirects + var lastRequest = res.req || req; + + + // if no content, is HEAD request or decompress disabled we should not decompress + if (res.statusCode !== 204 && lastRequest.method !== 'HEAD' && config.decompress !== false) { + switch (res.headers['content-encoding']) { + /*eslint default-case:0*/ + case 'gzip': + case 'compress': + case 'deflate': + // add the unzipper to the body stream processing pipeline + stream = stream.pipe(zlib.createUnzip()); + + // remove the content-encoding in order to not confuse downstream operations + delete res.headers['content-encoding']; + break; + } + } + + var response = { + status: res.statusCode, + statusText: res.statusMessage, + headers: res.headers, + config: config, + request: lastRequest + }; + + if (config.responseType === 'stream') { + response.data = stream; + settle(resolve, reject, response); + } else { + var responseBuffer = []; + var totalResponseBytes = 0; + stream.on('data', function handleStreamData(chunk) { + responseBuffer.push(chunk); + totalResponseBytes += chunk.length; + + // make sure the content length is not over the maxContentLength if specified + if (config.maxContentLength > -1 && totalResponseBytes > config.maxContentLength) { + stream.destroy(); + reject(createError('maxContentLength size of ' + config.maxContentLength + ' exceeded', + config, null, lastRequest)); + } + }); + + stream.on('error', function handleStreamError(err) { + if (req.aborted) return; + reject(enhanceError(err, config, null, lastRequest)); + }); + + stream.on('end', function handleStreamEnd() { + var responseData = Buffer.concat(responseBuffer); + if (config.responseType !== 'arraybuffer') { + responseData = responseData.toString(config.responseEncoding); + if (!config.responseEncoding || config.responseEncoding === 'utf8') { + responseData = utils.stripBOM(responseData); + } + } + + response.data = responseData; + settle(resolve, reject, response); + }); + } + }); + + // Handle errors + req.on('error', function handleRequestError(err) { + if (req.aborted && err.code !== 'ERR_FR_TOO_MANY_REDIRECTS') return; + reject(enhanceError(err, config, null, req)); + }); + + // Handle request timeout + if (config.timeout) { + // This is forcing a int timeout to avoid problems if the `req` interface doesn't handle other types. + var timeout = parseInt(config.timeout, 10); + + if (isNaN(timeout)) { + reject(createError( + 'error trying to parse `config.timeout` to int', + config, + 'ERR_PARSE_TIMEOUT', + req + )); + + return; + } + + // Sometime, the response will be very slow, and does not respond, the connect event will be block by event loop system. + // And timer callback will be fired, and abort() will be invoked before connection, then get "socket hang up" and code ECONNRESET. + // At this time, if we have a large number of request, nodejs will hang up some socket on background. and the number will up and up. + // And then these socket which be hang up will devoring CPU little by little. + // ClientRequest.setTimeout will be fired on the specify milliseconds, and can make sure that abort() will be fired after connect. + req.setTimeout(timeout, function handleRequestTimeout() { + req.abort(); + reject(createError( + 'timeout of ' + timeout + 'ms exceeded', + config, + config.transitional && config.transitional.clarifyTimeoutError ? 'ETIMEDOUT' : 'ECONNABORTED', + req + )); + }); + } + + if (config.cancelToken) { + // Handle cancellation + config.cancelToken.promise.then(function onCanceled(cancel) { + if (req.aborted) return; + + req.abort(); + reject(cancel); + }); + } + + // Send the request + if (utils.isStream(data)) { + data.on('error', function handleStreamError(err) { + reject(enhanceError(err, config, null, req)); + }).pipe(req); + } else { + req.end(data); + } + }); +}; diff --git a/node_modules/@shineiichijo/nhentai-pdf/node_modules/axios/lib/adapters/xhr.js b/node_modules/@shineiichijo/nhentai-pdf/node_modules/axios/lib/adapters/xhr.js new file mode 100644 index 000000000..a386dd24a --- /dev/null +++ b/node_modules/@shineiichijo/nhentai-pdf/node_modules/axios/lib/adapters/xhr.js @@ -0,0 +1,189 @@ +'use strict'; + +var utils = require('./../utils'); +var settle = require('./../core/settle'); +var cookies = require('./../helpers/cookies'); +var buildURL = require('./../helpers/buildURL'); +var buildFullPath = require('../core/buildFullPath'); +var parseHeaders = require('./../helpers/parseHeaders'); +var isURLSameOrigin = require('./../helpers/isURLSameOrigin'); +var createError = require('../core/createError'); + +module.exports = function xhrAdapter(config) { + return new Promise(function dispatchXhrRequest(resolve, reject) { + var requestData = config.data; + var requestHeaders = config.headers; + var responseType = config.responseType; + + if (utils.isFormData(requestData)) { + delete requestHeaders['Content-Type']; // Let the browser set it + } + + var request = new XMLHttpRequest(); + + // HTTP basic authentication + if (config.auth) { + var username = config.auth.username || ''; + var password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : ''; + requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password); + } + + var fullPath = buildFullPath(config.baseURL, config.url); + request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true); + + // Set the request timeout in MS + request.timeout = config.timeout; + + function onloadend() { + if (!request) { + return; + } + // Prepare the response + var responseHeaders = 'getAllResponseHeaders' in request ? parseHeaders(request.getAllResponseHeaders()) : null; + var responseData = !responseType || responseType === 'text' || responseType === 'json' ? + request.responseText : request.response; + var response = { + data: responseData, + status: request.status, + statusText: request.statusText, + headers: responseHeaders, + config: config, + request: request + }; + + settle(resolve, reject, response); + + // Clean up request + request = null; + } + + if ('onloadend' in request) { + // Use onloadend if available + request.onloadend = onloadend; + } else { + // Listen for ready state to emulate onloadend + request.onreadystatechange = function handleLoad() { + if (!request || request.readyState !== 4) { + return; + } + + // The request errored out and we didn't get a response, this will be + // handled by onerror instead + // With one exception: request that using file: protocol, most browsers + // will return status as 0 even though it's a successful request + if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) { + return; + } + // readystate handler is calling before onerror or ontimeout handlers, + // so we should call onloadend on the next 'tick' + setTimeout(onloadend); + }; + } + + // Handle browser request cancellation (as opposed to a manual cancellation) + request.onabort = function handleAbort() { + if (!request) { + return; + } + + reject(createError('Request aborted', config, 'ECONNABORTED', request)); + + // Clean up request + request = null; + }; + + // Handle low level network errors + request.onerror = function handleError() { + // Real errors are hidden from us by the browser + // onerror should only fire if it's a network error + reject(createError('Network Error', config, null, request)); + + // Clean up request + request = null; + }; + + // Handle timeout + request.ontimeout = function handleTimeout() { + var timeoutErrorMessage = 'timeout of ' + config.timeout + 'ms exceeded'; + if (config.timeoutErrorMessage) { + timeoutErrorMessage = config.timeoutErrorMessage; + } + reject(createError( + timeoutErrorMessage, + config, + config.transitional && config.transitional.clarifyTimeoutError ? 'ETIMEDOUT' : 'ECONNABORTED', + request)); + + // Clean up request + request = null; + }; + + // Add xsrf header + // This is only done if running in a standard browser environment. + // Specifically not if we're in a web worker, or react-native. + if (utils.isStandardBrowserEnv()) { + // Add xsrf header + var xsrfValue = (config.withCredentials || isURLSameOrigin(fullPath)) && config.xsrfCookieName ? + cookies.read(config.xsrfCookieName) : + undefined; + + if (xsrfValue) { + requestHeaders[config.xsrfHeaderName] = xsrfValue; + } + } + + // Add headers to the request + if ('setRequestHeader' in request) { + utils.forEach(requestHeaders, function setRequestHeader(val, key) { + if (typeof requestData === 'undefined' && key.toLowerCase() === 'content-type') { + // Remove Content-Type if data is undefined + delete requestHeaders[key]; + } else { + // Otherwise add header to the request + request.setRequestHeader(key, val); + } + }); + } + + // Add withCredentials to request if needed + if (!utils.isUndefined(config.withCredentials)) { + request.withCredentials = !!config.withCredentials; + } + + // Add responseType to request if needed + if (responseType && responseType !== 'json') { + request.responseType = config.responseType; + } + + // Handle progress if needed + if (typeof config.onDownloadProgress === 'function') { + request.addEventListener('progress', config.onDownloadProgress); + } + + // Not all browsers support upload events + if (typeof config.onUploadProgress === 'function' && request.upload) { + request.upload.addEventListener('progress', config.onUploadProgress); + } + + if (config.cancelToken) { + // Handle cancellation + config.cancelToken.promise.then(function onCanceled(cancel) { + if (!request) { + return; + } + + request.abort(); + reject(cancel); + // Clean up request + request = null; + }); + } + + if (!requestData) { + requestData = null; + } + + // Send the request + request.send(requestData); + }); +}; diff --git a/node_modules/@shineiichijo/nhentai-pdf/node_modules/axios/lib/axios.js b/node_modules/@shineiichijo/nhentai-pdf/node_modules/axios/lib/axios.js new file mode 100644 index 000000000..c6357b005 --- /dev/null +++ b/node_modules/@shineiichijo/nhentai-pdf/node_modules/axios/lib/axios.js @@ -0,0 +1,56 @@ +'use strict'; + +var utils = require('./utils'); +var bind = require('./helpers/bind'); +var Axios = require('./core/Axios'); +var mergeConfig = require('./core/mergeConfig'); +var defaults = require('./defaults'); + +/** + * Create an instance of Axios + * + * @param {Object} defaultConfig The default config for the instance + * @return {Axios} A new instance of Axios + */ +function createInstance(defaultConfig) { + var context = new Axios(defaultConfig); + var instance = bind(Axios.prototype.request, context); + + // Copy axios.prototype to instance + utils.extend(instance, Axios.prototype, context); + + // Copy context to instance + utils.extend(instance, context); + + return instance; +} + +// Create the default instance to be exported +var axios = createInstance(defaults); + +// Expose Axios class to allow class inheritance +axios.Axios = Axios; + +// Factory for creating new instances +axios.create = function create(instanceConfig) { + return createInstance(mergeConfig(axios.defaults, instanceConfig)); +}; + +// Expose Cancel & CancelToken +axios.Cancel = require('./cancel/Cancel'); +axios.CancelToken = require('./cancel/CancelToken'); +axios.isCancel = require('./cancel/isCancel'); + +// Expose all/spread +axios.all = function all(promises) { + return Promise.all(promises); +}; +axios.spread = require('./helpers/spread'); + +// Expose isAxiosError +axios.isAxiosError = require('./helpers/isAxiosError'); + +module.exports = axios; + +// Allow use of default import syntax in TypeScript +module.exports.default = axios; diff --git a/node_modules/@shineiichijo/nhentai-pdf/node_modules/axios/lib/cancel/Cancel.js b/node_modules/@shineiichijo/nhentai-pdf/node_modules/axios/lib/cancel/Cancel.js new file mode 100644 index 000000000..e0de4003f --- /dev/null +++ b/node_modules/@shineiichijo/nhentai-pdf/node_modules/axios/lib/cancel/Cancel.js @@ -0,0 +1,19 @@ +'use strict'; + +/** + * A `Cancel` is an object that is thrown when an operation is canceled. + * + * @class + * @param {string=} message The message. + */ +function Cancel(message) { + this.message = message; +} + +Cancel.prototype.toString = function toString() { + return 'Cancel' + (this.message ? ': ' + this.message : ''); +}; + +Cancel.prototype.__CANCEL__ = true; + +module.exports = Cancel; diff --git a/node_modules/@shineiichijo/nhentai-pdf/node_modules/axios/lib/cancel/CancelToken.js b/node_modules/@shineiichijo/nhentai-pdf/node_modules/axios/lib/cancel/CancelToken.js new file mode 100644 index 000000000..6b46e6662 --- /dev/null +++ b/node_modules/@shineiichijo/nhentai-pdf/node_modules/axios/lib/cancel/CancelToken.js @@ -0,0 +1,57 @@ +'use strict'; + +var Cancel = require('./Cancel'); + +/** + * A `CancelToken` is an object that can be used to request cancellation of an operation. + * + * @class + * @param {Function} executor The executor function. + */ +function CancelToken(executor) { + if (typeof executor !== 'function') { + throw new TypeError('executor must be a function.'); + } + + var resolvePromise; + this.promise = new Promise(function promiseExecutor(resolve) { + resolvePromise = resolve; + }); + + var token = this; + executor(function cancel(message) { + if (token.reason) { + // Cancellation has already been requested + return; + } + + token.reason = new Cancel(message); + resolvePromise(token.reason); + }); +} + +/** + * Throws a `Cancel` if cancellation has been requested. + */ +CancelToken.prototype.throwIfRequested = function throwIfRequested() { + if (this.reason) { + throw this.reason; + } +}; + +/** + * Returns an object that contains a new `CancelToken` and a function that, when called, + * cancels the `CancelToken`. + */ +CancelToken.source = function source() { + var cancel; + var token = new CancelToken(function executor(c) { + cancel = c; + }); + return { + token: token, + cancel: cancel + }; +}; + +module.exports = CancelToken; diff --git a/node_modules/@shineiichijo/nhentai-pdf/node_modules/axios/lib/cancel/isCancel.js b/node_modules/@shineiichijo/nhentai-pdf/node_modules/axios/lib/cancel/isCancel.js new file mode 100644 index 000000000..051f3ae4c --- /dev/null +++ b/node_modules/@shineiichijo/nhentai-pdf/node_modules/axios/lib/cancel/isCancel.js @@ -0,0 +1,5 @@ +'use strict'; + +module.exports = function isCancel(value) { + return !!(value && value.__CANCEL__); +}; diff --git a/node_modules/@shineiichijo/nhentai-pdf/node_modules/axios/lib/core/Axios.js b/node_modules/@shineiichijo/nhentai-pdf/node_modules/axios/lib/core/Axios.js new file mode 100644 index 000000000..42ea75e7e --- /dev/null +++ b/node_modules/@shineiichijo/nhentai-pdf/node_modules/axios/lib/core/Axios.js @@ -0,0 +1,148 @@ +'use strict'; + +var utils = require('./../utils'); +var buildURL = require('../helpers/buildURL'); +var InterceptorManager = require('./InterceptorManager'); +var dispatchRequest = require('./dispatchRequest'); +var mergeConfig = require('./mergeConfig'); +var validator = require('../helpers/validator'); + +var validators = validator.validators; +/** + * Create a new instance of Axios + * + * @param {Object} instanceConfig The default config for the instance + */ +function Axios(instanceConfig) { + this.defaults = instanceConfig; + this.interceptors = { + request: new InterceptorManager(), + response: new InterceptorManager() + }; +} + +/** + * Dispatch a request + * + * @param {Object} config The config specific for this request (merged with this.defaults) + */ +Axios.prototype.request = function request(config) { + /*eslint no-param-reassign:0*/ + // Allow for axios('example/url'[, config]) a la fetch API + if (typeof config === 'string') { + config = arguments[1] || {}; + config.url = arguments[0]; + } else { + config = config || {}; + } + + config = mergeConfig(this.defaults, config); + + // Set config.method + if (config.method) { + config.method = config.method.toLowerCase(); + } else if (this.defaults.method) { + config.method = this.defaults.method.toLowerCase(); + } else { + config.method = 'get'; + } + + var transitional = config.transitional; + + if (transitional !== undefined) { + validator.assertOptions(transitional, { + silentJSONParsing: validators.transitional(validators.boolean, '1.0.0'), + forcedJSONParsing: validators.transitional(validators.boolean, '1.0.0'), + clarifyTimeoutError: validators.transitional(validators.boolean, '1.0.0') + }, false); + } + + // filter out skipped interceptors + var requestInterceptorChain = []; + var synchronousRequestInterceptors = true; + this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) { + if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) { + return; + } + + synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous; + + requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected); + }); + + var responseInterceptorChain = []; + this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) { + responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected); + }); + + var promise; + + if (!synchronousRequestInterceptors) { + var chain = [dispatchRequest, undefined]; + + Array.prototype.unshift.apply(chain, requestInterceptorChain); + chain = chain.concat(responseInterceptorChain); + + promise = Promise.resolve(config); + while (chain.length) { + promise = promise.then(chain.shift(), chain.shift()); + } + + return promise; + } + + + var newConfig = config; + while (requestInterceptorChain.length) { + var onFulfilled = requestInterceptorChain.shift(); + var onRejected = requestInterceptorChain.shift(); + try { + newConfig = onFulfilled(newConfig); + } catch (error) { + onRejected(error); + break; + } + } + + try { + promise = dispatchRequest(newConfig); + } catch (error) { + return Promise.reject(error); + } + + while (responseInterceptorChain.length) { + promise = promise.then(responseInterceptorChain.shift(), responseInterceptorChain.shift()); + } + + return promise; +}; + +Axios.prototype.getUri = function getUri(config) { + config = mergeConfig(this.defaults, config); + return buildURL(config.url, config.params, config.paramsSerializer).replace(/^\?/, ''); +}; + +// Provide aliases for supported request methods +utils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) { + /*eslint func-names:0*/ + Axios.prototype[method] = function(url, config) { + return this.request(mergeConfig(config || {}, { + method: method, + url: url, + data: (config || {}).data + })); + }; +}); + +utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) { + /*eslint func-names:0*/ + Axios.prototype[method] = function(url, data, config) { + return this.request(mergeConfig(config || {}, { + method: method, + url: url, + data: data + })); + }; +}); + +module.exports = Axios; diff --git a/node_modules/@shineiichijo/nhentai-pdf/node_modules/axios/lib/core/InterceptorManager.js b/node_modules/@shineiichijo/nhentai-pdf/node_modules/axios/lib/core/InterceptorManager.js new file mode 100644 index 000000000..900f44880 --- /dev/null +++ b/node_modules/@shineiichijo/nhentai-pdf/node_modules/axios/lib/core/InterceptorManager.js @@ -0,0 +1,54 @@ +'use strict'; + +var utils = require('./../utils'); + +function InterceptorManager() { + this.handlers = []; +} + +/** + * Add a new interceptor to the stack + * + * @param {Function} fulfilled The function to handle `then` for a `Promise` + * @param {Function} rejected The function to handle `reject` for a `Promise` + * + * @return {Number} An ID used to remove interceptor later + */ +InterceptorManager.prototype.use = function use(fulfilled, rejected, options) { + this.handlers.push({ + fulfilled: fulfilled, + rejected: rejected, + synchronous: options ? options.synchronous : false, + runWhen: options ? options.runWhen : null + }); + return this.handlers.length - 1; +}; + +/** + * Remove an interceptor from the stack + * + * @param {Number} id The ID that was returned by `use` + */ +InterceptorManager.prototype.eject = function eject(id) { + if (this.handlers[id]) { + this.handlers[id] = null; + } +}; + +/** + * Iterate over all the registered interceptors + * + * This method is particularly useful for skipping over any + * interceptors that may have become `null` calling `eject`. + * + * @param {Function} fn The function to call for each interceptor + */ +InterceptorManager.prototype.forEach = function forEach(fn) { + utils.forEach(this.handlers, function forEachHandler(h) { + if (h !== null) { + fn(h); + } + }); +}; + +module.exports = InterceptorManager; diff --git a/node_modules/@shineiichijo/nhentai-pdf/node_modules/axios/lib/core/README.md b/node_modules/@shineiichijo/nhentai-pdf/node_modules/axios/lib/core/README.md new file mode 100644 index 000000000..84559ce7c --- /dev/null +++ b/node_modules/@shineiichijo/nhentai-pdf/node_modules/axios/lib/core/README.md @@ -0,0 +1,8 @@ +# axios // core + +The modules found in `core/` should be modules that are specific to the domain logic of axios. These modules would most likely not make sense to be consumed outside of the axios module, as their logic is too specific. Some examples of core modules are: + +- Dispatching requests + - Requests sent via `adapters/` (see lib/adapters/README.md) +- Managing interceptors +- Handling config diff --git a/node_modules/@shineiichijo/nhentai-pdf/node_modules/axios/lib/core/buildFullPath.js b/node_modules/@shineiichijo/nhentai-pdf/node_modules/axios/lib/core/buildFullPath.js new file mode 100644 index 000000000..00b2b050a --- /dev/null +++ b/node_modules/@shineiichijo/nhentai-pdf/node_modules/axios/lib/core/buildFullPath.js @@ -0,0 +1,20 @@ +'use strict'; + +var isAbsoluteURL = require('../helpers/isAbsoluteURL'); +var combineURLs = require('../helpers/combineURLs'); + +/** + * Creates a new URL by combining the baseURL with the requestedURL, + * only when the requestedURL is not already an absolute URL. + * If the requestURL is absolute, this function returns the requestedURL untouched. + * + * @param {string} baseURL The base URL + * @param {string} requestedURL Absolute or relative URL to combine + * @returns {string} The combined full path + */ +module.exports = function buildFullPath(baseURL, requestedURL) { + if (baseURL && !isAbsoluteURL(requestedURL)) { + return combineURLs(baseURL, requestedURL); + } + return requestedURL; +}; diff --git a/node_modules/@shineiichijo/nhentai-pdf/node_modules/axios/lib/core/createError.js b/node_modules/@shineiichijo/nhentai-pdf/node_modules/axios/lib/core/createError.js new file mode 100644 index 000000000..933680f69 --- /dev/null +++ b/node_modules/@shineiichijo/nhentai-pdf/node_modules/axios/lib/core/createError.js @@ -0,0 +1,18 @@ +'use strict'; + +var enhanceError = require('./enhanceError'); + +/** + * Create an Error with the specified message, config, error code, request and response. + * + * @param {string} message The error message. + * @param {Object} config The config. + * @param {string} [code] The error code (for example, 'ECONNABORTED'). + * @param {Object} [request] The request. + * @param {Object} [response] The response. + * @returns {Error} The created error. + */ +module.exports = function createError(message, config, code, request, response) { + var error = new Error(message); + return enhanceError(error, config, code, request, response); +}; diff --git a/node_modules/@shineiichijo/nhentai-pdf/node_modules/axios/lib/core/dispatchRequest.js b/node_modules/@shineiichijo/nhentai-pdf/node_modules/axios/lib/core/dispatchRequest.js new file mode 100644 index 000000000..9ce3b96e6 --- /dev/null +++ b/node_modules/@shineiichijo/nhentai-pdf/node_modules/axios/lib/core/dispatchRequest.js @@ -0,0 +1,82 @@ +'use strict'; + +var utils = require('./../utils'); +var transformData = require('./transformData'); +var isCancel = require('../cancel/isCancel'); +var defaults = require('../defaults'); + +/** + * Throws a `Cancel` if cancellation has been requested. + */ +function throwIfCancellationRequested(config) { + if (config.cancelToken) { + config.cancelToken.throwIfRequested(); + } +} + +/** + * Dispatch a request to the server using the configured adapter. + * + * @param {object} config The config that is to be used for the request + * @returns {Promise} The Promise to be fulfilled + */ +module.exports = function dispatchRequest(config) { + throwIfCancellationRequested(config); + + // Ensure headers exist + config.headers = config.headers || {}; + + // Transform request data + config.data = transformData.call( + config, + config.data, + config.headers, + config.transformRequest + ); + + // Flatten headers + config.headers = utils.merge( + config.headers.common || {}, + config.headers[config.method] || {}, + config.headers + ); + + utils.forEach( + ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'], + function cleanHeaderConfig(method) { + delete config.headers[method]; + } + ); + + var adapter = config.adapter || defaults.adapter; + + return adapter(config).then(function onAdapterResolution(response) { + throwIfCancellationRequested(config); + + // Transform response data + response.data = transformData.call( + config, + response.data, + response.headers, + config.transformResponse + ); + + return response; + }, function onAdapterRejection(reason) { + if (!isCancel(reason)) { + throwIfCancellationRequested(config); + + // Transform response data + if (reason && reason.response) { + reason.response.data = transformData.call( + config, + reason.response.data, + reason.response.headers, + config.transformResponse + ); + } + } + + return Promise.reject(reason); + }); +}; diff --git a/node_modules/@shineiichijo/nhentai-pdf/node_modules/axios/lib/core/enhanceError.js b/node_modules/@shineiichijo/nhentai-pdf/node_modules/axios/lib/core/enhanceError.js new file mode 100644 index 000000000..b6bc4444e --- /dev/null +++ b/node_modules/@shineiichijo/nhentai-pdf/node_modules/axios/lib/core/enhanceError.js @@ -0,0 +1,42 @@ +'use strict'; + +/** + * Update an Error with the specified config, error code, and response. + * + * @param {Error} error The error to update. + * @param {Object} config The config. + * @param {string} [code] The error code (for example, 'ECONNABORTED'). + * @param {Object} [request] The request. + * @param {Object} [response] The response. + * @returns {Error} The error. + */ +module.exports = function enhanceError(error, config, code, request, response) { + error.config = config; + if (code) { + error.code = code; + } + + error.request = request; + error.response = response; + error.isAxiosError = true; + + error.toJSON = function toJSON() { + return { + // Standard + message: this.message, + name: this.name, + // Microsoft + description: this.description, + number: this.number, + // Mozilla + fileName: this.fileName, + lineNumber: this.lineNumber, + columnNumber: this.columnNumber, + stack: this.stack, + // Axios + config: this.config, + code: this.code + }; + }; + return error; +}; diff --git a/node_modules/@shineiichijo/nhentai-pdf/node_modules/axios/lib/core/mergeConfig.js b/node_modules/@shineiichijo/nhentai-pdf/node_modules/axios/lib/core/mergeConfig.js new file mode 100644 index 000000000..5a2c10cb0 --- /dev/null +++ b/node_modules/@shineiichijo/nhentai-pdf/node_modules/axios/lib/core/mergeConfig.js @@ -0,0 +1,87 @@ +'use strict'; + +var utils = require('../utils'); + +/** + * Config-specific merge-function which creates a new config-object + * by merging two configuration objects together. + * + * @param {Object} config1 + * @param {Object} config2 + * @returns {Object} New object resulting from merging config2 to config1 + */ +module.exports = function mergeConfig(config1, config2) { + // eslint-disable-next-line no-param-reassign + config2 = config2 || {}; + var config = {}; + + var valueFromConfig2Keys = ['url', 'method', 'data']; + var mergeDeepPropertiesKeys = ['headers', 'auth', 'proxy', 'params']; + var defaultToConfig2Keys = [ + 'baseURL', 'transformRequest', 'transformResponse', 'paramsSerializer', + 'timeout', 'timeoutMessage', 'withCredentials', 'adapter', 'responseType', 'xsrfCookieName', + 'xsrfHeaderName', 'onUploadProgress', 'onDownloadProgress', 'decompress', + 'maxContentLength', 'maxBodyLength', 'maxRedirects', 'transport', 'httpAgent', + 'httpsAgent', 'cancelToken', 'socketPath', 'responseEncoding' + ]; + var directMergeKeys = ['validateStatus']; + + function getMergedValue(target, source) { + if (utils.isPlainObject(target) && utils.isPlainObject(source)) { + return utils.merge(target, source); + } else if (utils.isPlainObject(source)) { + return utils.merge({}, source); + } else if (utils.isArray(source)) { + return source.slice(); + } + return source; + } + + function mergeDeepProperties(prop) { + if (!utils.isUndefined(config2[prop])) { + config[prop] = getMergedValue(config1[prop], config2[prop]); + } else if (!utils.isUndefined(config1[prop])) { + config[prop] = getMergedValue(undefined, config1[prop]); + } + } + + utils.forEach(valueFromConfig2Keys, function valueFromConfig2(prop) { + if (!utils.isUndefined(config2[prop])) { + config[prop] = getMergedValue(undefined, config2[prop]); + } + }); + + utils.forEach(mergeDeepPropertiesKeys, mergeDeepProperties); + + utils.forEach(defaultToConfig2Keys, function defaultToConfig2(prop) { + if (!utils.isUndefined(config2[prop])) { + config[prop] = getMergedValue(undefined, config2[prop]); + } else if (!utils.isUndefined(config1[prop])) { + config[prop] = getMergedValue(undefined, config1[prop]); + } + }); + + utils.forEach(directMergeKeys, function merge(prop) { + if (prop in config2) { + config[prop] = getMergedValue(config1[prop], config2[prop]); + } else if (prop in config1) { + config[prop] = getMergedValue(undefined, config1[prop]); + } + }); + + var axiosKeys = valueFromConfig2Keys + .concat(mergeDeepPropertiesKeys) + .concat(defaultToConfig2Keys) + .concat(directMergeKeys); + + var otherKeys = Object + .keys(config1) + .concat(Object.keys(config2)) + .filter(function filterAxiosKeys(key) { + return axiosKeys.indexOf(key) === -1; + }); + + utils.forEach(otherKeys, mergeDeepProperties); + + return config; +}; diff --git a/node_modules/@shineiichijo/nhentai-pdf/node_modules/axios/lib/core/settle.js b/node_modules/@shineiichijo/nhentai-pdf/node_modules/axios/lib/core/settle.js new file mode 100644 index 000000000..886adb0c1 --- /dev/null +++ b/node_modules/@shineiichijo/nhentai-pdf/node_modules/axios/lib/core/settle.js @@ -0,0 +1,25 @@ +'use strict'; + +var createError = require('./createError'); + +/** + * Resolve or reject a Promise based on response status. + * + * @param {Function} resolve A function that resolves the promise. + * @param {Function} reject A function that rejects the promise. + * @param {object} response The response. + */ +module.exports = function settle(resolve, reject, response) { + var validateStatus = response.config.validateStatus; + if (!response.status || !validateStatus || validateStatus(response.status)) { + resolve(response); + } else { + reject(createError( + 'Request failed with status code ' + response.status, + response.config, + null, + response.request, + response + )); + } +}; diff --git a/node_modules/@shineiichijo/nhentai-pdf/node_modules/axios/lib/core/transformData.js b/node_modules/@shineiichijo/nhentai-pdf/node_modules/axios/lib/core/transformData.js new file mode 100644 index 000000000..c584d12bc --- /dev/null +++ b/node_modules/@shineiichijo/nhentai-pdf/node_modules/axios/lib/core/transformData.js @@ -0,0 +1,22 @@ +'use strict'; + +var utils = require('./../utils'); +var defaults = require('./../defaults'); + +/** + * Transform the data for a request or a response + * + * @param {Object|String} data The data to be transformed + * @param {Array} headers The headers for the request or response + * @param {Array|Function} fns A single function or Array of functions + * @returns {*} The resulting transformed data + */ +module.exports = function transformData(data, headers, fns) { + var context = this || defaults; + /*eslint no-param-reassign:0*/ + utils.forEach(fns, function transform(fn) { + data = fn.call(context, data, headers); + }); + + return data; +}; diff --git a/node_modules/@shineiichijo/nhentai-pdf/node_modules/axios/lib/defaults.js b/node_modules/@shineiichijo/nhentai-pdf/node_modules/axios/lib/defaults.js new file mode 100644 index 000000000..55e69d9ae --- /dev/null +++ b/node_modules/@shineiichijo/nhentai-pdf/node_modules/axios/lib/defaults.js @@ -0,0 +1,134 @@ +'use strict'; + +var utils = require('./utils'); +var normalizeHeaderName = require('./helpers/normalizeHeaderName'); +var enhanceError = require('./core/enhanceError'); + +var DEFAULT_CONTENT_TYPE = { + 'Content-Type': 'application/x-www-form-urlencoded' +}; + +function setContentTypeIfUnset(headers, value) { + if (!utils.isUndefined(headers) && utils.isUndefined(headers['Content-Type'])) { + headers['Content-Type'] = value; + } +} + +function getDefaultAdapter() { + var adapter; + if (typeof XMLHttpRequest !== 'undefined') { + // For browsers use XHR adapter + adapter = require('./adapters/xhr'); + } else if (typeof process !== 'undefined' && Object.prototype.toString.call(process) === '[object process]') { + // For node use HTTP adapter + adapter = require('./adapters/http'); + } + return adapter; +} + +function stringifySafely(rawValue, parser, encoder) { + if (utils.isString(rawValue)) { + try { + (parser || JSON.parse)(rawValue); + return utils.trim(rawValue); + } catch (e) { + if (e.name !== 'SyntaxError') { + throw e; + } + } + } + + return (encoder || JSON.stringify)(rawValue); +} + +var defaults = { + + transitional: { + silentJSONParsing: true, + forcedJSONParsing: true, + clarifyTimeoutError: false + }, + + adapter: getDefaultAdapter(), + + transformRequest: [function transformRequest(data, headers) { + normalizeHeaderName(headers, 'Accept'); + normalizeHeaderName(headers, 'Content-Type'); + + if (utils.isFormData(data) || + utils.isArrayBuffer(data) || + utils.isBuffer(data) || + utils.isStream(data) || + utils.isFile(data) || + utils.isBlob(data) + ) { + return data; + } + if (utils.isArrayBufferView(data)) { + return data.buffer; + } + if (utils.isURLSearchParams(data)) { + setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8'); + return data.toString(); + } + if (utils.isObject(data) || (headers && headers['Content-Type'] === 'application/json')) { + setContentTypeIfUnset(headers, 'application/json'); + return stringifySafely(data); + } + return data; + }], + + transformResponse: [function transformResponse(data) { + var transitional = this.transitional; + var silentJSONParsing = transitional && transitional.silentJSONParsing; + var forcedJSONParsing = transitional && transitional.forcedJSONParsing; + var strictJSONParsing = !silentJSONParsing && this.responseType === 'json'; + + if (strictJSONParsing || (forcedJSONParsing && utils.isString(data) && data.length)) { + try { + return JSON.parse(data); + } catch (e) { + if (strictJSONParsing) { + if (e.name === 'SyntaxError') { + throw enhanceError(e, this, 'E_JSON_PARSE'); + } + throw e; + } + } + } + + return data; + }], + + /** + * A timeout in milliseconds to abort a request. If set to 0 (default) a + * timeout is not created. + */ + timeout: 0, + + xsrfCookieName: 'XSRF-TOKEN', + xsrfHeaderName: 'X-XSRF-TOKEN', + + maxContentLength: -1, + maxBodyLength: -1, + + validateStatus: function validateStatus(status) { + return status >= 200 && status < 300; + } +}; + +defaults.headers = { + common: { + 'Accept': 'application/json, text/plain, */*' + } +}; + +utils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) { + defaults.headers[method] = {}; +}); + +utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) { + defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE); +}); + +module.exports = defaults; diff --git a/node_modules/@shineiichijo/nhentai-pdf/node_modules/axios/lib/helpers/README.md b/node_modules/@shineiichijo/nhentai-pdf/node_modules/axios/lib/helpers/README.md new file mode 100644 index 000000000..4ae34193a --- /dev/null +++ b/node_modules/@shineiichijo/nhentai-pdf/node_modules/axios/lib/helpers/README.md @@ -0,0 +1,7 @@ +# axios // helpers + +The modules found in `helpers/` should be generic modules that are _not_ specific to the domain logic of axios. These modules could theoretically be published to npm on their own and consumed by other modules or apps. Some examples of generic modules are things like: + +- Browser polyfills +- Managing cookies +- Parsing HTTP headers diff --git a/node_modules/@shineiichijo/nhentai-pdf/node_modules/axios/lib/helpers/bind.js b/node_modules/@shineiichijo/nhentai-pdf/node_modules/axios/lib/helpers/bind.js new file mode 100644 index 000000000..6147c608e --- /dev/null +++ b/node_modules/@shineiichijo/nhentai-pdf/node_modules/axios/lib/helpers/bind.js @@ -0,0 +1,11 @@ +'use strict'; + +module.exports = function bind(fn, thisArg) { + return function wrap() { + var args = new Array(arguments.length); + for (var i = 0; i < args.length; i++) { + args[i] = arguments[i]; + } + return fn.apply(thisArg, args); + }; +}; diff --git a/node_modules/@shineiichijo/nhentai-pdf/node_modules/axios/lib/helpers/buildURL.js b/node_modules/@shineiichijo/nhentai-pdf/node_modules/axios/lib/helpers/buildURL.js new file mode 100644 index 000000000..31595c33a --- /dev/null +++ b/node_modules/@shineiichijo/nhentai-pdf/node_modules/axios/lib/helpers/buildURL.js @@ -0,0 +1,70 @@ +'use strict'; + +var utils = require('./../utils'); + +function encode(val) { + return encodeURIComponent(val). + replace(/%3A/gi, ':'). + replace(/%24/g, '$'). + replace(/%2C/gi, ','). + replace(/%20/g, '+'). + replace(/%5B/gi, '['). + replace(/%5D/gi, ']'); +} + +/** + * Build a URL by appending params to the end + * + * @param {string} url The base of the url (e.g., http://www.google.com) + * @param {object} [params] The params to be appended + * @returns {string} The formatted url + */ +module.exports = function buildURL(url, params, paramsSerializer) { + /*eslint no-param-reassign:0*/ + if (!params) { + return url; + } + + var serializedParams; + if (paramsSerializer) { + serializedParams = paramsSerializer(params); + } else if (utils.isURLSearchParams(params)) { + serializedParams = params.toString(); + } else { + var parts = []; + + utils.forEach(params, function serialize(val, key) { + if (val === null || typeof val === 'undefined') { + return; + } + + if (utils.isArray(val)) { + key = key + '[]'; + } else { + val = [val]; + } + + utils.forEach(val, function parseValue(v) { + if (utils.isDate(v)) { + v = v.toISOString(); + } else if (utils.isObject(v)) { + v = JSON.stringify(v); + } + parts.push(encode(key) + '=' + encode(v)); + }); + }); + + serializedParams = parts.join('&'); + } + + if (serializedParams) { + var hashmarkIndex = url.indexOf('#'); + if (hashmarkIndex !== -1) { + url = url.slice(0, hashmarkIndex); + } + + url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams; + } + + return url; +}; diff --git a/node_modules/@shineiichijo/nhentai-pdf/node_modules/axios/lib/helpers/combineURLs.js b/node_modules/@shineiichijo/nhentai-pdf/node_modules/axios/lib/helpers/combineURLs.js new file mode 100644 index 000000000..f1b58a586 --- /dev/null +++ b/node_modules/@shineiichijo/nhentai-pdf/node_modules/axios/lib/helpers/combineURLs.js @@ -0,0 +1,14 @@ +'use strict'; + +/** + * Creates a new URL by combining the specified URLs + * + * @param {string} baseURL The base URL + * @param {string} relativeURL The relative URL + * @returns {string} The combined URL + */ +module.exports = function combineURLs(baseURL, relativeURL) { + return relativeURL + ? baseURL.replace(/\/+$/, '') + '/' + relativeURL.replace(/^\/+/, '') + : baseURL; +}; diff --git a/node_modules/@shineiichijo/nhentai-pdf/node_modules/axios/lib/helpers/cookies.js b/node_modules/@shineiichijo/nhentai-pdf/node_modules/axios/lib/helpers/cookies.js new file mode 100644 index 000000000..5a8a66661 --- /dev/null +++ b/node_modules/@shineiichijo/nhentai-pdf/node_modules/axios/lib/helpers/cookies.js @@ -0,0 +1,53 @@ +'use strict'; + +var utils = require('./../utils'); + +module.exports = ( + utils.isStandardBrowserEnv() ? + + // Standard browser envs support document.cookie + (function standardBrowserEnv() { + return { + write: function write(name, value, expires, path, domain, secure) { + var cookie = []; + cookie.push(name + '=' + encodeURIComponent(value)); + + if (utils.isNumber(expires)) { + cookie.push('expires=' + new Date(expires).toGMTString()); + } + + if (utils.isString(path)) { + cookie.push('path=' + path); + } + + if (utils.isString(domain)) { + cookie.push('domain=' + domain); + } + + if (secure === true) { + cookie.push('secure'); + } + + document.cookie = cookie.join('; '); + }, + + read: function read(name) { + var match = document.cookie.match(new RegExp('(^|;\\s*)(' + name + ')=([^;]*)')); + return (match ? decodeURIComponent(match[3]) : null); + }, + + remove: function remove(name) { + this.write(name, '', Date.now() - 86400000); + } + }; + })() : + + // Non standard browser env (web workers, react-native) lack needed support. + (function nonStandardBrowserEnv() { + return { + write: function write() {}, + read: function read() { return null; }, + remove: function remove() {} + }; + })() +); diff --git a/node_modules/@shineiichijo/nhentai-pdf/node_modules/axios/lib/helpers/deprecatedMethod.js b/node_modules/@shineiichijo/nhentai-pdf/node_modules/axios/lib/helpers/deprecatedMethod.js new file mode 100644 index 000000000..ed40965ba --- /dev/null +++ b/node_modules/@shineiichijo/nhentai-pdf/node_modules/axios/lib/helpers/deprecatedMethod.js @@ -0,0 +1,24 @@ +'use strict'; + +/*eslint no-console:0*/ + +/** + * Supply a warning to the developer that a method they are using + * has been deprecated. + * + * @param {string} method The name of the deprecated method + * @param {string} [instead] The alternate method to use if applicable + * @param {string} [docs] The documentation URL to get further details + */ +module.exports = function deprecatedMethod(method, instead, docs) { + try { + console.warn( + 'DEPRECATED method `' + method + '`.' + + (instead ? ' Use `' + instead + '` instead.' : '') + + ' This method will be removed in a future release.'); + + if (docs) { + console.warn('For more information about usage see ' + docs); + } + } catch (e) { /* Ignore */ } +}; diff --git a/node_modules/@shineiichijo/nhentai-pdf/node_modules/axios/lib/helpers/isAbsoluteURL.js b/node_modules/@shineiichijo/nhentai-pdf/node_modules/axios/lib/helpers/isAbsoluteURL.js new file mode 100644 index 000000000..d33e99275 --- /dev/null +++ b/node_modules/@shineiichijo/nhentai-pdf/node_modules/axios/lib/helpers/isAbsoluteURL.js @@ -0,0 +1,14 @@ +'use strict'; + +/** + * Determines whether the specified URL is absolute + * + * @param {string} url The URL to test + * @returns {boolean} True if the specified URL is absolute, otherwise false + */ +module.exports = function isAbsoluteURL(url) { + // A URL is considered absolute if it begins with "://" or "//" (protocol-relative URL). + // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed + // by any combination of letters, digits, plus, period, or hyphen. + return /^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(url); +}; diff --git a/node_modules/@shineiichijo/nhentai-pdf/node_modules/axios/lib/helpers/isAxiosError.js b/node_modules/@shineiichijo/nhentai-pdf/node_modules/axios/lib/helpers/isAxiosError.js new file mode 100644 index 000000000..29ff41af8 --- /dev/null +++ b/node_modules/@shineiichijo/nhentai-pdf/node_modules/axios/lib/helpers/isAxiosError.js @@ -0,0 +1,11 @@ +'use strict'; + +/** + * Determines whether the payload is an error thrown by Axios + * + * @param {*} payload The value to test + * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false + */ +module.exports = function isAxiosError(payload) { + return (typeof payload === 'object') && (payload.isAxiosError === true); +}; diff --git a/node_modules/@shineiichijo/nhentai-pdf/node_modules/axios/lib/helpers/isURLSameOrigin.js b/node_modules/@shineiichijo/nhentai-pdf/node_modules/axios/lib/helpers/isURLSameOrigin.js new file mode 100644 index 000000000..f1d89ad19 --- /dev/null +++ b/node_modules/@shineiichijo/nhentai-pdf/node_modules/axios/lib/helpers/isURLSameOrigin.js @@ -0,0 +1,68 @@ +'use strict'; + +var utils = require('./../utils'); + +module.exports = ( + utils.isStandardBrowserEnv() ? + + // Standard browser envs have full support of the APIs needed to test + // whether the request URL is of the same origin as current location. + (function standardBrowserEnv() { + var msie = /(msie|trident)/i.test(navigator.userAgent); + var urlParsingNode = document.createElement('a'); + var originURL; + + /** + * Parse a URL to discover it's components + * + * @param {String} url The URL to be parsed + * @returns {Object} + */ + function resolveURL(url) { + var href = url; + + if (msie) { + // IE needs attribute set twice to normalize properties + urlParsingNode.setAttribute('href', href); + href = urlParsingNode.href; + } + + urlParsingNode.setAttribute('href', href); + + // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils + return { + href: urlParsingNode.href, + protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '', + host: urlParsingNode.host, + search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, '') : '', + hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '', + hostname: urlParsingNode.hostname, + port: urlParsingNode.port, + pathname: (urlParsingNode.pathname.charAt(0) === '/') ? + urlParsingNode.pathname : + '/' + urlParsingNode.pathname + }; + } + + originURL = resolveURL(window.location.href); + + /** + * Determine if a URL shares the same origin as the current location + * + * @param {String} requestURL The URL to test + * @returns {boolean} True if URL shares the same origin, otherwise false + */ + return function isURLSameOrigin(requestURL) { + var parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL; + return (parsed.protocol === originURL.protocol && + parsed.host === originURL.host); + }; + })() : + + // Non standard browser envs (web workers, react-native) lack needed support. + (function nonStandardBrowserEnv() { + return function isURLSameOrigin() { + return true; + }; + })() +); diff --git a/node_modules/@shineiichijo/nhentai-pdf/node_modules/axios/lib/helpers/normalizeHeaderName.js b/node_modules/@shineiichijo/nhentai-pdf/node_modules/axios/lib/helpers/normalizeHeaderName.js new file mode 100644 index 000000000..738c9fe40 --- /dev/null +++ b/node_modules/@shineiichijo/nhentai-pdf/node_modules/axios/lib/helpers/normalizeHeaderName.js @@ -0,0 +1,12 @@ +'use strict'; + +var utils = require('../utils'); + +module.exports = function normalizeHeaderName(headers, normalizedName) { + utils.forEach(headers, function processHeader(value, name) { + if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) { + headers[normalizedName] = value; + delete headers[name]; + } + }); +}; diff --git a/node_modules/@shineiichijo/nhentai-pdf/node_modules/axios/lib/helpers/parseHeaders.js b/node_modules/@shineiichijo/nhentai-pdf/node_modules/axios/lib/helpers/parseHeaders.js new file mode 100644 index 000000000..8af2cc7f1 --- /dev/null +++ b/node_modules/@shineiichijo/nhentai-pdf/node_modules/axios/lib/helpers/parseHeaders.js @@ -0,0 +1,53 @@ +'use strict'; + +var utils = require('./../utils'); + +// Headers whose duplicates are ignored by node +// c.f. https://nodejs.org/api/http.html#http_message_headers +var ignoreDuplicateOf = [ + 'age', 'authorization', 'content-length', 'content-type', 'etag', + 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since', + 'last-modified', 'location', 'max-forwards', 'proxy-authorization', + 'referer', 'retry-after', 'user-agent' +]; + +/** + * Parse headers into an object + * + * ``` + * Date: Wed, 27 Aug 2014 08:58:49 GMT + * Content-Type: application/json + * Connection: keep-alive + * Transfer-Encoding: chunked + * ``` + * + * @param {String} headers Headers needing to be parsed + * @returns {Object} Headers parsed into an object + */ +module.exports = function parseHeaders(headers) { + var parsed = {}; + var key; + var val; + var i; + + if (!headers) { return parsed; } + + utils.forEach(headers.split('\n'), function parser(line) { + i = line.indexOf(':'); + key = utils.trim(line.substr(0, i)).toLowerCase(); + val = utils.trim(line.substr(i + 1)); + + if (key) { + if (parsed[key] && ignoreDuplicateOf.indexOf(key) >= 0) { + return; + } + if (key === 'set-cookie') { + parsed[key] = (parsed[key] ? parsed[key] : []).concat([val]); + } else { + parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val; + } + } + }); + + return parsed; +}; diff --git a/node_modules/@shineiichijo/nhentai-pdf/node_modules/axios/lib/helpers/spread.js b/node_modules/@shineiichijo/nhentai-pdf/node_modules/axios/lib/helpers/spread.js new file mode 100644 index 000000000..25e3cdd39 --- /dev/null +++ b/node_modules/@shineiichijo/nhentai-pdf/node_modules/axios/lib/helpers/spread.js @@ -0,0 +1,27 @@ +'use strict'; + +/** + * Syntactic sugar for invoking a function and expanding an array for arguments. + * + * Common use case would be to use `Function.prototype.apply`. + * + * ```js + * function f(x, y, z) {} + * var args = [1, 2, 3]; + * f.apply(null, args); + * ``` + * + * With `spread` this example can be re-written. + * + * ```js + * spread(function(x, y, z) {})([1, 2, 3]); + * ``` + * + * @param {Function} callback + * @returns {Function} + */ +module.exports = function spread(callback) { + return function wrap(arr) { + return callback.apply(null, arr); + }; +}; diff --git a/node_modules/@shineiichijo/nhentai-pdf/node_modules/axios/lib/helpers/validator.js b/node_modules/@shineiichijo/nhentai-pdf/node_modules/axios/lib/helpers/validator.js new file mode 100644 index 000000000..7f1bc7dfa --- /dev/null +++ b/node_modules/@shineiichijo/nhentai-pdf/node_modules/axios/lib/helpers/validator.js @@ -0,0 +1,105 @@ +'use strict'; + +var pkg = require('./../../package.json'); + +var validators = {}; + +// eslint-disable-next-line func-names +['object', 'boolean', 'number', 'function', 'string', 'symbol'].forEach(function(type, i) { + validators[type] = function validator(thing) { + return typeof thing === type || 'a' + (i < 1 ? 'n ' : ' ') + type; + }; +}); + +var deprecatedWarnings = {}; +var currentVerArr = pkg.version.split('.'); + +/** + * Compare package versions + * @param {string} version + * @param {string?} thanVersion + * @returns {boolean} + */ +function isOlderVersion(version, thanVersion) { + var pkgVersionArr = thanVersion ? thanVersion.split('.') : currentVerArr; + var destVer = version.split('.'); + for (var i = 0; i < 3; i++) { + if (pkgVersionArr[i] > destVer[i]) { + return true; + } else if (pkgVersionArr[i] < destVer[i]) { + return false; + } + } + return false; +} + +/** + * Transitional option validator + * @param {function|boolean?} validator + * @param {string?} version + * @param {string} message + * @returns {function} + */ +validators.transitional = function transitional(validator, version, message) { + var isDeprecated = version && isOlderVersion(version); + + function formatMessage(opt, desc) { + return '[Axios v' + pkg.version + '] Transitional option \'' + opt + '\'' + desc + (message ? '. ' + message : ''); + } + + // eslint-disable-next-line func-names + return function(value, opt, opts) { + if (validator === false) { + throw new Error(formatMessage(opt, ' has been removed in ' + version)); + } + + if (isDeprecated && !deprecatedWarnings[opt]) { + deprecatedWarnings[opt] = true; + // eslint-disable-next-line no-console + console.warn( + formatMessage( + opt, + ' has been deprecated since v' + version + ' and will be removed in the near future' + ) + ); + } + + return validator ? validator(value, opt, opts) : true; + }; +}; + +/** + * Assert object's properties type + * @param {object} options + * @param {object} schema + * @param {boolean?} allowUnknown + */ + +function assertOptions(options, schema, allowUnknown) { + if (typeof options !== 'object') { + throw new TypeError('options must be an object'); + } + var keys = Object.keys(options); + var i = keys.length; + while (i-- > 0) { + var opt = keys[i]; + var validator = schema[opt]; + if (validator) { + var value = options[opt]; + var result = value === undefined || validator(value, opt, options); + if (result !== true) { + throw new TypeError('option ' + opt + ' must be ' + result); + } + continue; + } + if (allowUnknown !== true) { + throw Error('Unknown option ' + opt); + } + } +} + +module.exports = { + isOlderVersion: isOlderVersion, + assertOptions: assertOptions, + validators: validators +}; diff --git a/node_modules/@shineiichijo/nhentai-pdf/node_modules/axios/lib/utils.js b/node_modules/@shineiichijo/nhentai-pdf/node_modules/axios/lib/utils.js new file mode 100644 index 000000000..5d966f444 --- /dev/null +++ b/node_modules/@shineiichijo/nhentai-pdf/node_modules/axios/lib/utils.js @@ -0,0 +1,349 @@ +'use strict'; + +var bind = require('./helpers/bind'); + +// utils is a library of generic helper functions non-specific to axios + +var toString = Object.prototype.toString; + +/** + * Determine if a value is an Array + * + * @param {Object} val The value to test + * @returns {boolean} True if value is an Array, otherwise false + */ +function isArray(val) { + return toString.call(val) === '[object Array]'; +} + +/** + * Determine if a value is undefined + * + * @param {Object} val The value to test + * @returns {boolean} True if the value is undefined, otherwise false + */ +function isUndefined(val) { + return typeof val === 'undefined'; +} + +/** + * Determine if a value is a Buffer + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a Buffer, otherwise false + */ +function isBuffer(val) { + return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor) + && typeof val.constructor.isBuffer === 'function' && val.constructor.isBuffer(val); +} + +/** + * Determine if a value is an ArrayBuffer + * + * @param {Object} val The value to test + * @returns {boolean} True if value is an ArrayBuffer, otherwise false + */ +function isArrayBuffer(val) { + return toString.call(val) === '[object ArrayBuffer]'; +} + +/** + * Determine if a value is a FormData + * + * @param {Object} val The value to test + * @returns {boolean} True if value is an FormData, otherwise false + */ +function isFormData(val) { + return (typeof FormData !== 'undefined') && (val instanceof FormData); +} + +/** + * Determine if a value is a view on an ArrayBuffer + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false + */ +function isArrayBufferView(val) { + var result; + if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) { + result = ArrayBuffer.isView(val); + } else { + result = (val) && (val.buffer) && (val.buffer instanceof ArrayBuffer); + } + return result; +} + +/** + * Determine if a value is a String + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a String, otherwise false + */ +function isString(val) { + return typeof val === 'string'; +} + +/** + * Determine if a value is a Number + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a Number, otherwise false + */ +function isNumber(val) { + return typeof val === 'number'; +} + +/** + * Determine if a value is an Object + * + * @param {Object} val The value to test + * @returns {boolean} True if value is an Object, otherwise false + */ +function isObject(val) { + return val !== null && typeof val === 'object'; +} + +/** + * Determine if a value is a plain Object + * + * @param {Object} val The value to test + * @return {boolean} True if value is a plain Object, otherwise false + */ +function isPlainObject(val) { + if (toString.call(val) !== '[object Object]') { + return false; + } + + var prototype = Object.getPrototypeOf(val); + return prototype === null || prototype === Object.prototype; +} + +/** + * Determine if a value is a Date + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a Date, otherwise false + */ +function isDate(val) { + return toString.call(val) === '[object Date]'; +} + +/** + * Determine if a value is a File + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a File, otherwise false + */ +function isFile(val) { + return toString.call(val) === '[object File]'; +} + +/** + * Determine if a value is a Blob + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a Blob, otherwise false + */ +function isBlob(val) { + return toString.call(val) === '[object Blob]'; +} + +/** + * Determine if a value is a Function + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a Function, otherwise false + */ +function isFunction(val) { + return toString.call(val) === '[object Function]'; +} + +/** + * Determine if a value is a Stream + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a Stream, otherwise false + */ +function isStream(val) { + return isObject(val) && isFunction(val.pipe); +} + +/** + * Determine if a value is a URLSearchParams object + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a URLSearchParams object, otherwise false + */ +function isURLSearchParams(val) { + return typeof URLSearchParams !== 'undefined' && val instanceof URLSearchParams; +} + +/** + * Trim excess whitespace off the beginning and end of a string + * + * @param {String} str The String to trim + * @returns {String} The String freed of excess whitespace + */ +function trim(str) { + return str.trim ? str.trim() : str.replace(/^\s+|\s+$/g, ''); +} + +/** + * Determine if we're running in a standard browser environment + * + * This allows axios to run in a web worker, and react-native. + * Both environments support XMLHttpRequest, but not fully standard globals. + * + * web workers: + * typeof window -> undefined + * typeof document -> undefined + * + * react-native: + * navigator.product -> 'ReactNative' + * nativescript + * navigator.product -> 'NativeScript' or 'NS' + */ +function isStandardBrowserEnv() { + if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' || + navigator.product === 'NativeScript' || + navigator.product === 'NS')) { + return false; + } + return ( + typeof window !== 'undefined' && + typeof document !== 'undefined' + ); +} + +/** + * Iterate over an Array or an Object invoking a function for each item. + * + * If `obj` is an Array callback will be called passing + * the value, index, and complete array for each item. + * + * If 'obj' is an Object callback will be called passing + * the value, key, and complete object for each property. + * + * @param {Object|Array} obj The object to iterate + * @param {Function} fn The callback to invoke for each item + */ +function forEach(obj, fn) { + // Don't bother if no value provided + if (obj === null || typeof obj === 'undefined') { + return; + } + + // Force an array if not already something iterable + if (typeof obj !== 'object') { + /*eslint no-param-reassign:0*/ + obj = [obj]; + } + + if (isArray(obj)) { + // Iterate over array values + for (var i = 0, l = obj.length; i < l; i++) { + fn.call(null, obj[i], i, obj); + } + } else { + // Iterate over object keys + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) { + fn.call(null, obj[key], key, obj); + } + } + } +} + +/** + * Accepts varargs expecting each argument to be an object, then + * immutably merges the properties of each object and returns result. + * + * When multiple objects contain the same key the later object in + * the arguments list will take precedence. + * + * Example: + * + * ```js + * var result = merge({foo: 123}, {foo: 456}); + * console.log(result.foo); // outputs 456 + * ``` + * + * @param {Object} obj1 Object to merge + * @returns {Object} Result of all merge properties + */ +function merge(/* obj1, obj2, obj3, ... */) { + var result = {}; + function assignValue(val, key) { + if (isPlainObject(result[key]) && isPlainObject(val)) { + result[key] = merge(result[key], val); + } else if (isPlainObject(val)) { + result[key] = merge({}, val); + } else if (isArray(val)) { + result[key] = val.slice(); + } else { + result[key] = val; + } + } + + for (var i = 0, l = arguments.length; i < l; i++) { + forEach(arguments[i], assignValue); + } + return result; +} + +/** + * Extends object a by mutably adding to it the properties of object b. + * + * @param {Object} a The object to be extended + * @param {Object} b The object to copy properties from + * @param {Object} thisArg The object to bind function to + * @return {Object} The resulting value of object a + */ +function extend(a, b, thisArg) { + forEach(b, function assignValue(val, key) { + if (thisArg && typeof val === 'function') { + a[key] = bind(val, thisArg); + } else { + a[key] = val; + } + }); + return a; +} + +/** + * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM) + * + * @param {string} content with BOM + * @return {string} content value without BOM + */ +function stripBOM(content) { + if (content.charCodeAt(0) === 0xFEFF) { + content = content.slice(1); + } + return content; +} + +module.exports = { + isArray: isArray, + isArrayBuffer: isArrayBuffer, + isBuffer: isBuffer, + isFormData: isFormData, + isArrayBufferView: isArrayBufferView, + isString: isString, + isNumber: isNumber, + isObject: isObject, + isPlainObject: isPlainObject, + isUndefined: isUndefined, + isDate: isDate, + isFile: isFile, + isBlob: isBlob, + isFunction: isFunction, + isStream: isStream, + isURLSearchParams: isURLSearchParams, + isStandardBrowserEnv: isStandardBrowserEnv, + forEach: forEach, + merge: merge, + extend: extend, + trim: trim, + stripBOM: stripBOM +}; diff --git a/node_modules/@shineiichijo/nhentai-pdf/node_modules/axios/package.json b/node_modules/@shineiichijo/nhentai-pdf/node_modules/axios/package.json new file mode 100644 index 000000000..7c895b3a9 --- /dev/null +++ b/node_modules/@shineiichijo/nhentai-pdf/node_modules/axios/package.json @@ -0,0 +1,84 @@ +{ + "name": "axios", + "version": "0.21.4", + "description": "Promise based HTTP client for the browser and node.js", + "main": "index.js", + "scripts": { + "test": "grunt test", + "start": "node ./sandbox/server.js", + "build": "NODE_ENV=production grunt build", + "preversion": "npm test", + "version": "npm run build && grunt version && git add -A dist && git add CHANGELOG.md bower.json package.json", + "postversion": "git push && git push --tags", + "examples": "node ./examples/server.js", + "coveralls": "cat coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js", + "fix": "eslint --fix lib/**/*.js" + }, + "repository": { + "type": "git", + "url": "https://github.com/axios/axios.git" + }, + "keywords": [ + "xhr", + "http", + "ajax", + "promise", + "node" + ], + "author": "Matt Zabriskie", + "license": "MIT", + "bugs": { + "url": "https://github.com/axios/axios/issues" + }, + "homepage": "https://axios-http.com", + "devDependencies": { + "coveralls": "^3.0.0", + "es6-promise": "^4.2.4", + "grunt": "^1.3.0", + "grunt-banner": "^0.6.0", + "grunt-cli": "^1.2.0", + "grunt-contrib-clean": "^1.1.0", + "grunt-contrib-watch": "^1.0.0", + "grunt-eslint": "^23.0.0", + "grunt-karma": "^4.0.0", + "grunt-mocha-test": "^0.13.3", + "grunt-ts": "^6.0.0-beta.19", + "grunt-webpack": "^4.0.2", + "istanbul-instrumenter-loader": "^1.0.0", + "jasmine-core": "^2.4.1", + "karma": "^6.3.2", + "karma-chrome-launcher": "^3.1.0", + "karma-firefox-launcher": "^2.1.0", + "karma-jasmine": "^1.1.1", + "karma-jasmine-ajax": "^0.1.13", + "karma-safari-launcher": "^1.0.0", + "karma-sauce-launcher": "^4.3.6", + "karma-sinon": "^1.0.5", + "karma-sourcemap-loader": "^0.3.8", + "karma-webpack": "^4.0.2", + "load-grunt-tasks": "^3.5.2", + "minimist": "^1.2.0", + "mocha": "^8.2.1", + "sinon": "^4.5.0", + "terser-webpack-plugin": "^4.2.3", + "typescript": "^4.0.5", + "url-search-params": "^0.10.0", + "webpack": "^4.44.2", + "webpack-dev-server": "^3.11.0" + }, + "browser": { + "./lib/adapters/http.js": "./lib/adapters/xhr.js" + }, + "jsdelivr": "dist/axios.min.js", + "unpkg": "dist/axios.min.js", + "typings": "./index.d.ts", + "dependencies": { + "follow-redirects": "^1.14.0" + }, + "bundlesize": [ + { + "path": "./dist/axios.min.js", + "threshold": "5kB" + } + ] +} diff --git a/node_modules/@shineiichijo/nhentai-pdf/package.json b/node_modules/@shineiichijo/nhentai-pdf/package.json new file mode 100644 index 000000000..ca4c7c1e8 --- /dev/null +++ b/node_modules/@shineiichijo/nhentai-pdf/package.json @@ -0,0 +1,49 @@ +{ + "name": "@shineiichijo/nhentai-pdf", + "version": "1.0.5", + "description": "Fork of nhentai-pdf", + "main": "dist/index.js", + "files": [ + "dist" + ], + "types": "dist/index.d.ts", + "scripts": { + "build": "yarn rimraf dist/ && yarn tsc", + "prepublish": "yarn build", + "lint": "eslint . --ignore-path .gitignore --ext .ts", + "lint:fix": "eslint . --ignore-path .gitignore --ext .ts --fix" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/ShineiIchijo/nhentai-pdf.git" + }, + "keywords": [ + "nhentai", + "nhentai", + "pdf", + "doujin", + "downloader", + "nhentai", + "downloader" + ], + "author": "PrajjwalDatir", + "license": "AGPL-3.0", + "bugs": { + "url": "https://github.com/ShineiIchijo/nhentai-pdf/issues" + }, + "homepage": "https://github.com/ShineiIchijo/nhentai-pdf#readme", + "devDependencies": { + "@types/node": "^16.3.3", + "@types/pdfkit": "^0.11.2", + "@typescript-eslint/eslint-plugin": "^4.22.1", + "@typescript-eslint/parser": "^4.22.1", + "eslint": "^7.31.0", + "prettier": "^2.3.2", + "typescript": "^4.3.5" + }, + "dependencies": { + "axios": "^0.21.1", + "cheerio": "^1.0.0-rc.10", + "pdfkit": "^0.13.0" + } +} diff --git a/node_modules/anime-wallpaper/LICENSE b/node_modules/anime-wallpaper/LICENSE new file mode 100644 index 000000000..1cdff52d8 --- /dev/null +++ b/node_modules/anime-wallpaper/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2021 VeguiIzumi + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/anime-wallpaper/README.md b/node_modules/anime-wallpaper/README.md new file mode 100644 index 000000000..ad23a00db --- /dev/null +++ b/node_modules/anime-wallpaper/README.md @@ -0,0 +1,65 @@ +

Anime Wallpaper

+

+ +

+ +Get Anime wallpapers based on scrapping from websites. +* [Alphacoders](https://alphacoders.com) +* [Wallpaper Cave](https://wallpapercave.com) +* [4K Wallpapers](https://free4kwallpapers.com/) +* [Wall Haven](https://wallhaven.cc) + +[![Version](https://nodei.co/npm/anime-wallpaper.png?compact=true)](https://nodei.co/npm/anime-wallpaper) +###### [Documentation](https://iseizuu.github.io/anime-wallpaper/) + +# Example Usage + - Getting Wallpaper from [Alphacoders](https://alphacoders.com) + +```js +const { AnimeWallpaper } = require("anime-wallpaper"); +const wall = new AnimeWallpaper(); + +async function Wallpaper1() { + const wallpaper = await wall.getAnimeWall1({ search: "to love ru", page: 1 }) + return console.log(wallpaper) +} + +Wallpaper1() +``` + +- Getting Wallpaper from [Wallpaper Cave](https://wallpapercave.com) + +```js +async function Wallpaper2() { + const wallpaper = await wall.getAnimeWall2("keqing") + return console.log(wallpaper) +} + +Wallpaper2() +``` + +- Getting Ramdon Wallpaper from [4K Wallpapers](https://free4kwallpapers.com/) + +```js +async function Wallpaper3() { + const wallpaper = await wall.getAnimeWall3() + return console.log(wallpaper) +} + +Wallpaper3() +``` + +- Getting Wallpaper from [WallHaven](https://wallhaven.cc) + +```js +async function Wallpaper4() { + const wallpaper = await wall.getAnimeWall4({ title: "anime romance", type: "sfw", page: 1 }) + return console.log(wallpaper) +} + +Wallpaper4() +``` + +
+ +© [Aizuu](https://github.com/iseizuu) diff --git a/node_modules/anime-wallpaper/dist/config.json b/node_modules/anime-wallpaper/dist/config.json new file mode 100644 index 000000000..2c6386fc3 --- /dev/null +++ b/node_modules/anime-wallpaper/dist/config.json @@ -0,0 +1,11 @@ +{ + "alphaCoders": "https://wall.alphacoders.com/search.php", + "wallpaperCave": "https://wallpapercave.com", + "free4kWallpaper": "https://free4kwallpapers.com", + "wallHaven": "https://wallhaven.cc", + "type": { + "sfw": "100", + "sketchy": "010", + "both": "110" + } +} diff --git a/node_modules/anime-wallpaper/dist/index.d.ts b/node_modules/anime-wallpaper/dist/index.d.ts new file mode 100644 index 000000000..6dcccaed1 --- /dev/null +++ b/node_modules/anime-wallpaper/dist/index.d.ts @@ -0,0 +1,39 @@ +import { AnimeWall1, AnimeWall2, AnimeWall3, searchOpt, searchOpt2 } from "./typings"; +export declare class AnimeWallpaper { + constructor(); + /** + * Scraping images wallpaper from AlphaCoders + * + * @param {Object} + * @param {string} title.search the title of anime you want to search. + * @param {string|number} title.page the page for image you want to search. + * @returns {AnimeWall1} + */ + getAnimeWall1(title: searchOpt): Promise; + /** + * Scraping images wallpaper from WallpaperCave + * + * @param title the title of anime that you want to search. + * @returns {AnimeWall2} + */ + getAnimeWall2(title: string): Promise; + /** + * Scraping images wallpaper from free4kWallpaper + * + * this function will be return random anime wallpaper + * + * @returns {AnimeWall2} + */ + getAnimeWall3(): Promise; + /** + * Scraping images wallpaper from WallHaven + * + * @param search.title the title of the anime you want to search. + * @param search.type the type or purity of image sfw or sketchy image or even both. + * @param search.page the page for image you want to search, default is 1 + * @returns {AnimeWall3} + */ + getAnimeWall4(search: searchOpt2): Promise; + private _request; + private delay; +} diff --git a/node_modules/anime-wallpaper/dist/index.js b/node_modules/anime-wallpaper/dist/index.js new file mode 100644 index 000000000..bf2bba106 --- /dev/null +++ b/node_modules/anime-wallpaper/dist/index.js @@ -0,0 +1,191 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.AnimeWallpaper = void 0; +const node_superfetch_1 = __importDefault(require("node-superfetch")); +const random_useragent_1 = __importDefault(require("random-useragent")); +const cheerio_1 = __importDefault(require("cheerio")); +const config_json_1 = __importStar(require("./config.json")); +const Error_1 = __importDefault(require("./utils/Error")); +class AnimeWallpaper { + constructor() { } + /** + * Scraping images wallpaper from AlphaCoders + * + * @param {Object} + * @param {string} title.search the title of anime you want to search. + * @param {string|number} title.page the page for image you want to search. + * @returns {AnimeWall1} + */ + getAnimeWall1(title) { + if (!title || !title.search) + throw new Error_1.default("title must be specified"); + else if (!title.page) + title.page = 0; + if (typeof title.page === "string") + console.warn("Use number instead of a string on `page` options, this is will not be affected"); + return new Promise((resolve, reject) => { + this._request(config_json_1.default.alphaCoders, { search: encodeURIComponent(title.search) }) + .then(x => { + void this._request(`${x.url}&page=${title.page}`, {}) + .then((data) => { + const $ = cheerio_1.default.load(data.text); + const arr = []; + $("#page_container [class=\"center\"] [class=\"thumb-container\"]").each((i, elm) => { + var _a; + const title = $(elm).find("a").attr("title"); + const thumbnail = $(elm).find("[class=\"boxgrid\"] a source").attr("srcset"); + const image = (_a = $(elm).find("[class=\"boxgrid\"] a img").attr("src")) === null || _a === void 0 ? void 0 : _a.replace(/thumbbig-/g, ""); + void this.delay(4e3); + arr.push({ title, thumbnail, image }); + }); + if (!arr.length) + throw new Error_1.default("No result found"); + resolve(arr); + }) + .catch(er => reject(er)); + }) + .catch(er => reject(er)); + }); + } + /** + * Scraping images wallpaper from WallpaperCave + * + * @param title the title of anime that you want to search. + * @returns {AnimeWall2} + */ + getAnimeWall2(title) { + if (!title) + throw new Error_1.default("title must be specified"); + return new Promise((resolve, reject) => { + this._request(`${config_json_1.default.wallpaperCave}/search`, { q: title.split(" ").join("+") }) + .then(x => { + const $ = cheerio_1.default.load(x.text); + const arr = []; + const results = []; + $("#content #popular a").each((i, elm) => { + const title = $(elm).attr("href"); + results.push(title); + }); + const filteredRes = results.filter(x => !x.startsWith("/w/") && !x.startsWith("/latest-upload")); + if (!filteredRes.length) + throw new Error_1.default("No result found"); + const random = filteredRes[Math.floor(Math.random() * filteredRes.length)]; + console.log(random); + this._request(`${config_json_1.default.wallpaperCave}${random}`, {}) + .then(res => { + const $$ = cheerio_1.default.load(res.text); + $$("#albumwp .wallpaper").each((i, elm) => { + const title = $$(elm).find("a.wpinkw img").attr("alt"); + console.log($$(elm).find("a.wpinkw img").attr("src")); + const image = `${config_json_1.default.wallpaperCave}${$$(elm).find("a.wpinkw img").attr("src")}`; + arr.push({ title, image }); + }); + resolve(arr); + }) + .catch(er => reject(er)); + }) + .catch(er => reject(er)); + }); + } + /** + * Scraping images wallpaper from free4kWallpaper + * + * this function will be return random anime wallpaper + * + * @returns {AnimeWall2} + */ + getAnimeWall3() { + const random = Math.floor(Math.random() * 20) + 1; + return new Promise((resolve, reject) => { + this._request(`${config_json_1.default.free4kWallpaper}/anime-wallpapers`, { page: random }) + .then(x => { + const $ = cheerio_1.default.load(x.text); + const results = []; + $("#contents .container .row .cbody a img").each((i, elm) => { + const title = $(elm).attr("title"); + const image = `${config_json_1.default.free4kWallpaper}/${$(elm).attr("data-src")}`; + results.push({ title, image }); + }); + if (!results.length) + throw new Error_1.default("Images not found"); + resolve(results); + }) + .catch(er => reject(er)); + }); + } + /** + * Scraping images wallpaper from WallHaven + * + * @param search.title the title of the anime you want to search. + * @param search.type the type or purity of image sfw or sketchy image or even both. + * @param search.page the page for image you want to search, default is 1 + * @returns {AnimeWall3} + */ + getAnimeWall4(search) { + if (!search || !search.title) + throw new Error_1.default("title must be specified"); + else if (!search.type) + search.type === "sfw"; + else if (!Object.keys(config_json_1.type).includes(search.type)) + throw new Error_1.default("Please input on of them 'sfw, sketchy, both'"); + return new Promise((resolve, reject) => { + this._request(`${config_json_1.default.wallHaven}/search`, { q: search.title, page: search.page, purity: config_json_1.type[search.type] }) + .then(x => { + const $ = cheerio_1.default.load(x.text); + const results = []; + $(".thumb-listing-page ul li .thumb").each((i, elm) => { + var _a; + let formatImg = ".jpg"; + const isPng = $(elm).find(".thumb-info .png span").text(); + if (isPng) + formatImg = ".png"; + const parseUrl = $(elm).find(".preview").attr("href"); + const image = `https://w.wallhaven.cc/full/${(_a = parseUrl === null || parseUrl === void 0 ? void 0 : parseUrl.split("/").pop()) === null || _a === void 0 ? void 0 : _a.split("").splice(0, 2).join("")}/wallhaven-${parseUrl === null || parseUrl === void 0 ? void 0 : parseUrl.split("/").pop()}${formatImg}`; + results.push({ image }); + }); + if (!results.length) + throw new Error_1.default("Images not found"); + resolve(results); + }) + .catch(er => reject(er)); + }); + } + _request(uri, options) { + return new Promise((resolve, reject) => { + void node_superfetch_1.default.get(uri) + .query(options) + .set({ + "user-agent": random_useragent_1.default.getRandom() + }) + .then(x => resolve(x)) + .catch(er => reject(er)); + }); + } + delay(amount) { + return new Promise(resolve => setTimeout(resolve, amount)); + } +} +exports.AnimeWallpaper = AnimeWallpaper; +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OztBQUFBLHNFQUFrQztBQUNsQyx3RUFBeUM7QUFDekMsc0RBQThCO0FBQzlCLDZEQUE0QztBQUM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0QsSUFBSSxDQUFDLENBQUMsQ0FBQyxFQUFFLENBQUMsT0FBTyxDQUFDLENBQXdCLENBQUMsQ0FBQztpQkFDNUMsS0FBSyxDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsTUFBTSxDQUFDLEVBQUUsQ0FBQyxDQUFDLENBQUM7UUFDakMsQ0FBQyxDQUFDLENBQUM7SUFDUCxDQUFDO0lBRU8sS0FBSyxDQUFDLE1BQWM7UUFDeEIsT0FBTyxJQUFJLE9BQU8sQ0FBQyxPQUFPLENBQUMsRUFBRSxDQUFDLFVBQVUsQ0FBQyxPQUFPLEVBQUUsTUFBTSxDQUFDLENBQUMsQ0FBQztJQUMvRCxDQUFDO0NBQ0o7QUF4SkQsd0NBd0pDIn0= \ No newline at end of file diff --git a/node_modules/anime-wallpaper/dist/typings/index.d.ts b/node_modules/anime-wallpaper/dist/typings/index.d.ts new file mode 100644 index 000000000..3041d1811 --- /dev/null +++ b/node_modules/anime-wallpaper/dist/typings/index.d.ts @@ -0,0 +1,21 @@ +export interface AnimeWall1 { + title: string; + thumbnail: string; + image: string; +} +export interface AnimeWall2 { + title: string; + image: string; +} +export interface AnimeWall3 { + image: string; +} +export interface searchOpt { + search: string; + page: string | number; +} +export interface searchOpt2 { + title: string; + page: string; + type: "sfw" | "sketchy" | "both"; +} diff --git a/node_modules/anime-wallpaper/dist/typings/index.js b/node_modules/anime-wallpaper/dist/typings/index.js new file mode 100644 index 000000000..18c6e5d2b --- /dev/null +++ b/node_modules/anime-wallpaper/dist/typings/index.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvdHlwaW5ncy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiIn0= \ No newline at end of file diff --git a/node_modules/anime-wallpaper/dist/utils/Error.d.ts b/node_modules/anime-wallpaper/dist/utils/Error.d.ts new file mode 100644 index 000000000..72780b9ec --- /dev/null +++ b/node_modules/anime-wallpaper/dist/utils/Error.d.ts @@ -0,0 +1,5 @@ +export default class AnimeWallError extends Error { + msg: string; + name: string; + constructor(msg: string); +} diff --git a/node_modules/anime-wallpaper/dist/utils/Error.js b/node_modules/anime-wallpaper/dist/utils/Error.js new file mode 100644 index 000000000..7844d2562 --- /dev/null +++ b/node_modules/anime-wallpaper/dist/utils/Error.js @@ -0,0 +1,11 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +class AnimeWallError extends Error { + constructor(msg) { + super(msg); + this.msg = msg; + this.name = "AnimeWallError"; + } +} +exports.default = AnimeWallError; +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiRXJyb3IuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvdXRpbHMvRXJyb3IudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7QUFBQSxNQUFxQixjQUFlLFNBQVEsS0FBSztJQUU3QyxZQUEwQixHQUFXO1FBQ2pDLEtBQUssQ0FBQyxHQUFHLENBQUMsQ0FBQztRQURXLFFBQUcsR0FBSCxHQUFHLENBQVE7UUFFakMsSUFBSSxDQUFDLElBQUksR0FBRyxnQkFBZ0IsQ0FBQztJQUNqQyxDQUFDO0NBQ0o7QUFORCxpQ0FNQyJ9 \ No newline at end of file diff --git a/node_modules/anime-wallpaper/package.json b/node_modules/anime-wallpaper/package.json new file mode 100644 index 000000000..5c8fef3a6 --- /dev/null +++ b/node_modules/anime-wallpaper/package.json @@ -0,0 +1,38 @@ +{ + "name": "anime-wallpaper", + "version": "1.0.2", + "description": "Get Anime wallpapers based on scrapping from websites.", + "license": "MIT", + "main": "dist/index.js", + "types": "dist/index.d.ts", + "files": [ + "dist/**/*" + ], + "keywords": [ + "anime", + "anime-wallpapaer", + "wallpaper", + "images", + "scrape" + ], + "devDependencies": { + "@types/node": "^14.14.31", + "@types/random-useragent": "^0.3.0", + "@typescript-eslint/eslint-plugin": "^4.15.1", + "@typescript-eslint/parser": "^4.15.1", + "eslint": "^7.20.0", + "typedoc": "^0.20.27", + "typescript": "^4.1.5" + }, + "dependencies": { + "cheerio": "^1.0.0-rc.5", + "node-superfetch": "^0.1.11", + "random-useragent": "^0.5.0" + }, + "repository": "https://github.com/iseizuu/anime-wallpaper.git", + "author": "Aizuu", + "bugs": { + "url": "https://github.com/iseizuu/anime-wallpaper/issues" + }, + "homepage": "https://github.com/iseizuu/anime-wallpaper#readme" +} diff --git a/node_modules/bson/LICENSE.md b/node_modules/bson/LICENSE.md new file mode 100644 index 000000000..261eeb9e9 --- /dev/null +++ b/node_modules/bson/LICENSE.md @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/node_modules/bson/README.md b/node_modules/bson/README.md new file mode 100644 index 000000000..cd7242fdf --- /dev/null +++ b/node_modules/bson/README.md @@ -0,0 +1,376 @@ +# BSON parser + +BSON is short for "Binary JSON," and is the binary-encoded serialization of JSON-like documents. You can learn more about it in [the specification](http://bsonspec.org). + +This browser version of the BSON parser is compiled using [rollup](https://rollupjs.org/) and the current version is pre-compiled in the `dist` directory. + +This is the default BSON parser, however, there is a C++ Node.js addon version as well that does not support the browser. It can be found at [mongod-js/bson-ext](https://github.com/mongodb-js/bson-ext). + +### Table of Contents +- [Usage](#usage) +- [Bugs/Feature Requests](#bugs--feature-requests) +- [Installation](#installation) +- [Documentation](#documentation) +- [FAQ](#faq) + +## Bugs / Feature Requests + +Think you've found a bug? Want to see a new feature in `bson`? Please open a case in our issue management tool, JIRA: + +1. Create an account and login: [jira.mongodb.org](https://jira.mongodb.org) +2. Navigate to the NODE project: [jira.mongodb.org/browse/NODE](https://jira.mongodb.org/browse/NODE) +3. Click **Create Issue** - Please provide as much information as possible about the issue and how to reproduce it. + +Bug reports in JIRA for all driver projects (i.e. NODE, PYTHON, CSHARP, JAVA) and the Core Server (i.e. SERVER) project are **public**. + +## Usage + +To build a new version perform the following operations: + +``` +npm install +npm run build +``` + +### Node (no bundling) +A simple example of how to use BSON in `Node.js`: + +```js +const BSON = require('bson'); +const Long = BSON.Long; + +// Serialize a document +const doc = { long: Long.fromNumber(100) }; +const data = BSON.serialize(doc); +console.log('data:', data); + +// Deserialize the resulting Buffer +const doc_2 = BSON.deserialize(data); +console.log('doc_2:', doc_2); +``` + +### Browser (no bundling) + +If you are not using a bundler like webpack, you can include `dist/bson.bundle.js` using a script tag. It includes polyfills for built-in node types like `Buffer`. + +```html + + + +``` + +### Using webpack + +If using webpack, you can use your normal import/require syntax of your project to pull in the `bson` library. + +ES6 Example: + +```js +import { Long, serialize, deserialize } from 'bson'; + +// Serialize a document +const doc = { long: Long.fromNumber(100) }; +const data = serialize(doc); +console.log('data:', data); + +// De serialize it again +const doc_2 = deserialize(data); +console.log('doc_2:', doc_2); +``` + +ES5 Example: + +```js +const BSON = require('bson'); +const Long = BSON.Long; + +// Serialize a document +const doc = { long: Long.fromNumber(100) }; +const data = BSON.serialize(doc); +console.log('data:', data); + +// Deserialize the resulting Buffer +const doc_2 = BSON.deserialize(data); +console.log('doc_2:', doc_2); +``` + +Depending on your settings, webpack will under the hood resolve to one of the following: + +- `dist/bson.browser.esm.js` If your project is in the browser and using ES6 modules (Default for `webworker` and `web` targets) +- `dist/bson.browser.umd.js` If your project is in the browser and not using ES6 modules +- `dist/bson.esm.js` If your project is in Node.js and using ES6 modules (Default for `node` targets) +- `lib/bson.js` (the normal include path) If your project is in Node.js and not using ES6 modules + +For more information, see [this page on webpack's `resolve.mainFields`](https://webpack.js.org/configuration/resolve/#resolvemainfields) and [the `package.json` for this project](./package.json#L52) + +### Usage with Angular + +Starting with Angular 6, Angular CLI removed the shim for `global` and other node built-in variables (original comment [here](https://github.com/angular/angular-cli/issues/9827#issuecomment-386154063)). If you are using BSON with Angular, you may need to add the following shim to your `polyfills.ts` file: + +```js +// In polyfills.ts +(window as any).global = window; +``` + +- [Original Comment by Angular CLI](https://github.com/angular/angular-cli/issues/9827#issuecomment-386154063) +- [Original Source for Solution](https://stackoverflow.com/a/50488337/4930088) + +## Installation + +`npm install bson` + +## Documentation + +### Objects + +
+
EJSON : object
+
+
+ +### Functions + +
+
setInternalBufferSize(size)
+

Sets the size of the internal serialization buffer.

+
+
serialize(object)Buffer
+

Serialize a Javascript object.

+
+
serializeWithBufferAndIndex(object, buffer)Number
+

Serialize a Javascript object using a predefined Buffer and index into the buffer, useful when pre-allocating the space for serialization.

+
+
deserialize(buffer)Object
+

Deserialize data as BSON.

+
+
calculateObjectSize(object)Number
+

Calculate the bson size for a passed in Javascript object.

+
+
deserializeStream(data, startIndex, numberOfDocuments, documents, docStartIndex, [options])Number
+

Deserialize stream data as BSON documents.

+
+
+ + + +### EJSON + +* [EJSON](#EJSON) + + * [.parse(text, [options])](#EJSON.parse) + + * [.stringify(value, [replacer], [space], [options])](#EJSON.stringify) + + * [.serialize(bson, [options])](#EJSON.serialize) + + * [.deserialize(ejson, [options])](#EJSON.deserialize) + + + + +#### *EJSON*.parse(text, [options]) + +| Param | Type | Default | Description | +| --- | --- | --- | --- | +| text | string | | | +| [options] | object | | Optional settings | +| [options.relaxed] | boolean | true | Attempt to return native JS types where possible, rather than BSON types (if true) | + +Parse an Extended JSON string, constructing the JavaScript value or object described by that +string. + +**Example** +```js +const { EJSON } = require('bson'); +const text = '{ "int32": { "$numberInt": "10" } }'; + +// prints { int32: { [String: '10'] _bsontype: 'Int32', value: '10' } } +console.log(EJSON.parse(text, { relaxed: false })); + +// prints { int32: 10 } +console.log(EJSON.parse(text)); +``` + + +#### *EJSON*.stringify(value, [replacer], [space], [options]) + +| Param | Type | Default | Description | +| --- | --- | --- | --- | +| value | object | | The value to convert to extended JSON | +| [replacer] | function \| array | | A function that alters the behavior of the stringification process, or an array of String and Number objects that serve as a whitelist for selecting/filtering the properties of the value object to be included in the JSON string. If this value is null or not provided, all properties of the object are included in the resulting JSON string | +| [space] | string \| number | | A String or Number object that's used to insert white space into the output JSON string for readability purposes. | +| [options] | object | | Optional settings | +| [options.relaxed] | boolean | true | Enabled Extended JSON's `relaxed` mode | +| [options.legacy] | boolean | true | Output in Extended JSON v1 | + +Converts a BSON document to an Extended JSON string, optionally replacing values if a replacer +function is specified or optionally including only the specified properties if a replacer array +is specified. + +**Example** +```js +const { EJSON } = require('bson'); +const Int32 = require('mongodb').Int32; +const doc = { int32: new Int32(10) }; + +// prints '{"int32":{"$numberInt":"10"}}' +console.log(EJSON.stringify(doc, { relaxed: false })); + +// prints '{"int32":10}' +console.log(EJSON.stringify(doc)); +``` + + +#### *EJSON*.serialize(bson, [options]) + +| Param | Type | Description | +| --- | --- | --- | +| bson | object | The object to serialize | +| [options] | object | Optional settings passed to the `stringify` function | + +Serializes an object to an Extended JSON string, and reparse it as a JavaScript object. + + + +#### *EJSON*.deserialize(ejson, [options]) + +| Param | Type | Description | +| --- | --- | --- | +| ejson | object | The Extended JSON object to deserialize | +| [options] | object | Optional settings passed to the parse method | + +Deserializes an Extended JSON object into a plain JavaScript object with native/BSON types + + + +### setInternalBufferSize(size) + +| Param | Type | Description | +| --- | --- | --- | +| size | number | The desired size for the internal serialization buffer | + +Sets the size of the internal serialization buffer. + + + +### serialize(object) + +| Param | Type | Default | Description | +| --- | --- | --- | --- | +| object | Object | | the Javascript object to serialize. | +| [options.checkKeys] | Boolean | | the serializer will check if keys are valid. | +| [options.serializeFunctions] | Boolean | false | serialize the javascript functions **(default:false)**. | +| [options.ignoreUndefined] | Boolean | true | ignore undefined fields **(default:true)**. | + +Serialize a Javascript object. + +**Returns**: Buffer - returns the Buffer object containing the serialized object. + + +### serializeWithBufferAndIndex(object, buffer) + +| Param | Type | Default | Description | +| --- | --- | --- | --- | +| object | Object | | the Javascript object to serialize. | +| buffer | Buffer | | the Buffer you pre-allocated to store the serialized BSON object. | +| [options.checkKeys] | Boolean | | the serializer will check if keys are valid. | +| [options.serializeFunctions] | Boolean | false | serialize the javascript functions **(default:false)**. | +| [options.ignoreUndefined] | Boolean | true | ignore undefined fields **(default:true)**. | +| [options.index] | Number | | the index in the buffer where we wish to start serializing into. | + +Serialize a Javascript object using a predefined Buffer and index into the buffer, useful when pre-allocating the space for serialization. + +**Returns**: Number - returns the index pointing to the last written byte in the buffer. + + +### deserialize(buffer) + +| Param | Type | Default | Description | +| --- | --- | --- | --- | +| buffer | Buffer | | the buffer containing the serialized set of BSON documents. | +| [options.evalFunctions] | Object | false | evaluate functions in the BSON document scoped to the object deserialized. | +| [options.cacheFunctions] | Object | false | cache evaluated functions for reuse. | +| [options.promoteLongs] | Object | true | when deserializing a Long will fit it into a Number if it's smaller than 53 bits | +| [options.promoteBuffers] | Object | false | when deserializing a Binary will return it as a node.js Buffer instance. | +| [options.promoteValues] | Object | false | when deserializing will promote BSON values to their Node.js closest equivalent types. | +| [options.fieldsAsRaw] | Object | | allow to specify if there what fields we wish to return as unserialized raw buffer. | +| [options.bsonRegExp] | Object | false | return BSON regular expressions as BSONRegExp instances. | +| [options.allowObjectSmallerThanBufferSize] | boolean | false | allows the buffer to be larger than the parsed BSON object | + +Deserialize data as BSON. + +**Returns**: Object - returns the deserialized Javascript Object. + + +### calculateObjectSize(object) + +| Param | Type | Default | Description | +| --- | --- | --- | --- | +| object | Object | | the Javascript object to calculate the BSON byte size for. | +| [options.serializeFunctions] | Boolean | false | serialize the javascript functions **(default:false)**. | +| [options.ignoreUndefined] | Boolean | true | ignore undefined fields **(default:true)**. | + +Calculate the bson size for a passed in Javascript object. + +**Returns**: Number - returns the number of bytes the BSON object will take up. + + +### deserializeStream(data, startIndex, numberOfDocuments, documents, docStartIndex, [options]) + +| Param | Type | Default | Description | +| --- | --- | --- | --- | +| data | Buffer | | the buffer containing the serialized set of BSON documents. | +| startIndex | Number | | the start index in the data Buffer where the deserialization is to start. | +| numberOfDocuments | Number | | number of documents to deserialize. | +| documents | Array | | an array where to store the deserialized documents. | +| docStartIndex | Number | | the index in the documents array from where to start inserting documents. | +| [options] | Object | | additional options used for the deserialization. | +| [options.evalFunctions] | Object | false | evaluate functions in the BSON document scoped to the object deserialized. | +| [options.cacheFunctions] | Object | false | cache evaluated functions for reuse. | +| [options.promoteLongs] | Object | true | when deserializing a Long will fit it into a Number if it's smaller than 53 bits | +| [options.promoteBuffers] | Object | false | when deserializing a Binary will return it as a node.js Buffer instance. | +| [options.promoteValues] | Object | false | when deserializing will promote BSON values to their Node.js closest equivalent types. | +| [options.fieldsAsRaw] | Object | | allow to specify if there what fields we wish to return as unserialized raw buffer. | +| [options.bsonRegExp] | Object | false | return BSON regular expressions as BSONRegExp instances. | + +Deserialize stream data as BSON documents. + +**Returns**: Number - returns the next index in the buffer after deserialization **x** numbers of documents. + +## FAQ + +#### Why does `undefined` get converted to `null`? + +The `undefined` BSON type has been [deprecated for many years](http://bsonspec.org/spec.html), so this library has dropped support for it. Use the `ignoreUndefined` option (for example, from the [driver](http://mongodb.github.io/node-mongodb-native/2.2/api/MongoClient.html#connect) ) to instead remove `undefined` keys. + +#### How do I add custom serialization logic? + +This library looks for `toBSON()` functions on every path, and calls the `toBSON()` function to get the value to serialize. + +```javascript +const BSON = require('bson'); + +class CustomSerialize { + toBSON() { + return 42; + } +} + +const obj = { answer: new CustomSerialize() }; +// "{ answer: 42 }" +console.log(BSON.deserialize(BSON.serialize(obj))); +``` diff --git a/node_modules/bson/bower.json b/node_modules/bson/bower.json new file mode 100644 index 000000000..3219b8e4e --- /dev/null +++ b/node_modules/bson/bower.json @@ -0,0 +1,26 @@ +{ + "name": "bson", + "description": "A bson parser for node.js and the browser", + "keywords": [ + "mongodb", + "bson", + "parser" + ], + "author": "Christian Amor Kvalheim ", + "main": "./dist/bson.js", + "license": "Apache-2.0", + "moduleType": [ + "globals", + "node" + ], + "ignore": [ + "**/.*", + "alternate_parsers", + "benchmarks", + "bower_components", + "node_modules", + "test", + "tools" + ], + "version": "4.6.4" +} diff --git a/node_modules/bson/bson-ts34.d.ts b/node_modules/bson/bson-ts34.d.ts new file mode 100644 index 000000000..f975c4fa9 --- /dev/null +++ b/node_modules/bson/bson-ts34.d.ts @@ -0,0 +1,1133 @@ +import { Buffer } from 'buffer'; +/** + * A class representation of the BSON Binary type. + * @public + * @category BSONType + */ +export declare class Binary { + _bsontype: 'Binary'; + /* Excluded from this release type: BSON_BINARY_SUBTYPE_DEFAULT */ + /** Initial buffer default size */ + static readonly BUFFER_SIZE = 256; + /** Default BSON type */ + static readonly SUBTYPE_DEFAULT = 0; + /** Function BSON type */ + static readonly SUBTYPE_FUNCTION = 1; + /** Byte Array BSON type */ + static readonly SUBTYPE_BYTE_ARRAY = 2; + /** Deprecated UUID BSON type @deprecated Please use SUBTYPE_UUID */ + static readonly SUBTYPE_UUID_OLD = 3; + /** UUID BSON type */ + static readonly SUBTYPE_UUID = 4; + /** MD5 BSON type */ + static readonly SUBTYPE_MD5 = 5; + /** Encrypted BSON type */ + static readonly SUBTYPE_ENCRYPTED = 6; + /** Column BSON type */ + static readonly SUBTYPE_COLUMN = 7; + /** User BSON type */ + static readonly SUBTYPE_USER_DEFINED = 128; + buffer: Buffer; + sub_type: number; + position: number; + /** + * @param buffer - a buffer object containing the binary data. + * @param subType - the option binary type. + */ + constructor(buffer?: string | BinarySequence, subType?: number); + /** + * Updates this binary with byte_value. + * + * @param byteValue - a single byte we wish to write. + */ + put(byteValue: string | number | Uint8Array | Buffer | number[]): void; + /** + * Writes a buffer or string to the binary. + * + * @param sequence - a string or buffer to be written to the Binary BSON object. + * @param offset - specify the binary of where to write the content. + */ + write(sequence: string | BinarySequence, offset: number): void; + /** + * Reads **length** bytes starting at **position**. + * + * @param position - read from the given position in the Binary. + * @param length - the number of bytes to read. + */ + read(position: number, length: number): BinarySequence; + /** + * Returns the value of this binary as a string. + * @param asRaw - Will skip converting to a string + * @remarks + * This is handy when calling this function conditionally for some key value pairs and not others + */ + value(asRaw?: boolean): string | BinarySequence; + /** the length of the binary sequence */ + length(): number; + toJSON(): string; + toString(format?: string): string; + /* Excluded from this release type: toExtendedJSON */ + toUUID(): UUID; + /* Excluded from this release type: fromExtendedJSON */ + inspect(): string; +} +/** @public */ +export declare interface BinaryExtended { + $binary: { + subType: string; + base64: string; + }; +} +/** @public */ +export declare interface BinaryExtendedLegacy { + $type: string; + $binary: string; +} +/** @public */ +export declare type BinarySequence = Uint8Array | Buffer | number[]; +/** + * BSON default export + * @deprecated Please use named exports + * @privateRemarks + * We want to someday deprecate the default export, + * so none of the new TS types are being exported on the default + * @public + */ +declare const BSON: { + Binary: typeof Binary; + Code: typeof Code; + DBRef: typeof DBRef; + Decimal128: typeof Decimal128; + Double: typeof Double; + Int32: typeof Int32; + Long: typeof Long; + UUID: typeof UUID; + Map: MapConstructor; + MaxKey: typeof MaxKey; + MinKey: typeof MinKey; + ObjectId: typeof ObjectId; + ObjectID: typeof ObjectId; + BSONRegExp: typeof BSONRegExp; + BSONSymbol: typeof BSONSymbol; + Timestamp: typeof Timestamp; + EJSON: typeof EJSON; + setInternalBufferSize: typeof setInternalBufferSize; + serialize: typeof serialize; + serializeWithBufferAndIndex: typeof serializeWithBufferAndIndex; + deserialize: typeof deserialize; + calculateObjectSize: typeof calculateObjectSize; + deserializeStream: typeof deserializeStream; + BSONError: typeof BSONError; + BSONTypeError: typeof BSONTypeError; +}; +export default BSON; +/* Excluded from this release type: BSON_BINARY_SUBTYPE_BYTE_ARRAY */ +/* Excluded from this release type: BSON_BINARY_SUBTYPE_COLUMN */ +/* Excluded from this release type: BSON_BINARY_SUBTYPE_DEFAULT */ +/* Excluded from this release type: BSON_BINARY_SUBTYPE_ENCRYPTED */ +/* Excluded from this release type: BSON_BINARY_SUBTYPE_FUNCTION */ +/* Excluded from this release type: BSON_BINARY_SUBTYPE_MD5 */ +/* Excluded from this release type: BSON_BINARY_SUBTYPE_USER_DEFINED */ +/* Excluded from this release type: BSON_BINARY_SUBTYPE_UUID */ +/* Excluded from this release type: BSON_BINARY_SUBTYPE_UUID_NEW */ +/* Excluded from this release type: BSON_DATA_ARRAY */ +/* Excluded from this release type: BSON_DATA_BINARY */ +/* Excluded from this release type: BSON_DATA_BOOLEAN */ +/* Excluded from this release type: BSON_DATA_CODE */ +/* Excluded from this release type: BSON_DATA_CODE_W_SCOPE */ +/* Excluded from this release type: BSON_DATA_DATE */ +/* Excluded from this release type: BSON_DATA_DBPOINTER */ +/* Excluded from this release type: BSON_DATA_DECIMAL128 */ +/* Excluded from this release type: BSON_DATA_INT */ +/* Excluded from this release type: BSON_DATA_LONG */ +/* Excluded from this release type: BSON_DATA_MAX_KEY */ +/* Excluded from this release type: BSON_DATA_MIN_KEY */ +/* Excluded from this release type: BSON_DATA_NULL */ +/* Excluded from this release type: BSON_DATA_NUMBER */ +/* Excluded from this release type: BSON_DATA_OBJECT */ +/* Excluded from this release type: BSON_DATA_OID */ +/* Excluded from this release type: BSON_DATA_REGEXP */ +/* Excluded from this release type: BSON_DATA_STRING */ +/* Excluded from this release type: BSON_DATA_SYMBOL */ +/* Excluded from this release type: BSON_DATA_TIMESTAMP */ +/* Excluded from this release type: BSON_DATA_UNDEFINED */ +/* Excluded from this release type: BSON_INT32_MAX */ +/* Excluded from this release type: BSON_INT32_MIN */ +/* Excluded from this release type: BSON_INT64_MAX */ +/* Excluded from this release type: BSON_INT64_MIN */ +/** @public */ +export declare class BSONError extends Error { + constructor(message: string); + readonly name: string; +} +/** + * A class representation of the BSON RegExp type. + * @public + * @category BSONType + */ +export declare class BSONRegExp { + _bsontype: 'BSONRegExp'; + pattern: string; + options: string; + /** + * @param pattern - The regular expression pattern to match + * @param options - The regular expression options + */ + constructor(pattern: string, options?: string); + static parseOptions(options?: string): string; +} +/** @public */ +export declare interface BSONRegExpExtended { + $regularExpression: { + pattern: string; + options: string; + }; +} +/** @public */ +export declare interface BSONRegExpExtendedLegacy { + $regex: string | BSONRegExp; + $options: string; +} +/** + * A class representation of the BSON Symbol type. + * @public + * @category BSONType + */ +export declare class BSONSymbol { + _bsontype: 'Symbol'; + value: string; + /** + * @param value - the string representing the symbol. + */ + constructor(value: string); + /** Access the wrapped string value. */ + valueOf(): string; + toString(): string; + /* Excluded from this release type: inspect */ + toJSON(): string; +} +/** @public */ +export declare interface BSONSymbolExtended { + $symbol: string; +} +/** @public */ +export declare class BSONTypeError extends TypeError { + constructor(message: string); + readonly name: string; +} +/** + * Calculate the bson size for a passed in Javascript object. + * + * @param object - the Javascript object to calculate the BSON byte size for + * @returns size of BSON object in bytes + * @public + */ +export declare function calculateObjectSize(object: Document, options?: CalculateObjectSizeOptions): number; +/** @public */ +export declare type CalculateObjectSizeOptions = Pick; +/** + * A class representation of the BSON Code type. + * @public + * @category BSONType + */ +export declare class Code { + _bsontype: 'Code'; + code: string | Function; + scope?: Document; + /** + * @param code - a string or function. + * @param scope - an optional scope for the function. + */ + constructor(code: string | Function, scope?: Document); + toJSON(): { + code: string | Function; + scope?: Document; + }; + /* Excluded from this release type: toExtendedJSON */ + /* Excluded from this release type: fromExtendedJSON */ + inspect(): string; +} +/** @public */ +export declare interface CodeExtended { + $code: string | Function; + $scope?: Document; +} +/** + * A class representation of the BSON DBRef type. + * @public + * @category BSONType + */ +export declare class DBRef { + _bsontype: 'DBRef'; + collection: string; + oid: ObjectId; + db?: string; + fields: Document; + /** + * @param collection - the collection name. + * @param oid - the reference ObjectId. + * @param db - optional db name, if omitted the reference is local to the current db. + */ + constructor(collection: string, oid: ObjectId, db?: string, fields?: Document); + /* Excluded from this release type: namespace */ + /* Excluded from this release type: namespace */ + toJSON(): DBRefLike & Document; + /* Excluded from this release type: toExtendedJSON */ + /* Excluded from this release type: fromExtendedJSON */ + inspect(): string; +} +/** @public */ +export declare interface DBRefLike { + $ref: string; + $id: ObjectId; + $db?: string; +} +/** + * A class representation of the BSON Decimal128 type. + * @public + * @category BSONType + */ +export declare class Decimal128 { + _bsontype: 'Decimal128'; + readonly bytes: Buffer; + /** + * @param bytes - a buffer containing the raw Decimal128 bytes in little endian order, + * or a string representation as returned by .toString() + */ + constructor(bytes: Buffer | string); + /** + * Create a Decimal128 instance from a string representation + * + * @param representation - a numeric string representation. + */ + static fromString(representation: string): Decimal128; + /** Create a string representation of the raw Decimal128 value */ + toString(): string; + toJSON(): Decimal128Extended; + /* Excluded from this release type: toExtendedJSON */ + /* Excluded from this release type: fromExtendedJSON */ + inspect(): string; +} +/** @public */ +export declare interface Decimal128Extended { + $numberDecimal: string; +} +/** + * Deserialize data as BSON. + * + * @param buffer - the buffer containing the serialized set of BSON documents. + * @returns returns the deserialized Javascript Object. + * @public + */ +export declare function deserialize(buffer: Buffer | ArrayBufferView | ArrayBuffer, options?: DeserializeOptions): Document; +/** @public */ +export declare interface DeserializeOptions { + /** evaluate functions in the BSON document scoped to the object deserialized. */ + evalFunctions?: boolean; + /** cache evaluated functions for reuse. */ + cacheFunctions?: boolean; + /** + * use a crc32 code for caching, otherwise use the string of the function. + * @deprecated this option to use the crc32 function never worked as intended + * due to the fact that the crc32 function itself was never implemented. + * */ + cacheFunctionsCrc32?: boolean; + /** when deserializing a Long will fit it into a Number if it's smaller than 53 bits */ + promoteLongs?: boolean; + /** when deserializing a Binary will return it as a node.js Buffer instance. */ + promoteBuffers?: boolean; + /** when deserializing will promote BSON values to their Node.js closest equivalent types. */ + promoteValues?: boolean; + /** allow to specify if there what fields we wish to return as unserialized raw buffer. */ + fieldsAsRaw?: Document; + /** return BSON regular expressions as BSONRegExp instances. */ + bsonRegExp?: boolean; + /** allows the buffer to be larger than the parsed BSON object */ + allowObjectSmallerThanBufferSize?: boolean; + /** Offset into buffer to begin reading document from */ + index?: number; + raw?: boolean; + /** Allows for opt-out utf-8 validation for all keys or + * specified keys. Must be all true or all false. + * + * @example + * ```js + * // disables validation on all keys + * validation: { utf8: false } + * + * // enables validation only on specified keys a, b, and c + * validation: { utf8: { a: true, b: true, c: true } } + * + * // disables validation only on specified keys a, b + * validation: { utf8: { a: false, b: false } } + * ``` + */ + validation?: { + utf8: boolean | Record | Record; + }; +} +/** + * Deserialize stream data as BSON documents. + * + * @param data - the buffer containing the serialized set of BSON documents. + * @param startIndex - the start index in the data Buffer where the deserialization is to start. + * @param numberOfDocuments - number of documents to deserialize. + * @param documents - an array where to store the deserialized documents. + * @param docStartIndex - the index in the documents array from where to start inserting documents. + * @param options - additional options used for the deserialization. + * @returns next index in the buffer after deserialization **x** numbers of documents. + * @public + */ +export declare function deserializeStream(data: Buffer | ArrayBufferView | ArrayBuffer, startIndex: number, numberOfDocuments: number, documents: Document[], docStartIndex: number, options: DeserializeOptions): number; +/** @public */ +export declare interface Document { + [key: string]: any; +} +/** + * A class representation of the BSON Double type. + * @public + * @category BSONType + */ +export declare class Double { + _bsontype: 'Double'; + value: number; + /** + * Create a Double type + * + * @param value - the number we want to represent as a double. + */ + constructor(value: number); + /** + * Access the number value. + * + * @returns returns the wrapped double number. + */ + valueOf(): number; + toJSON(): number; + toString(radix?: number): string; + /* Excluded from this release type: toExtendedJSON */ + /* Excluded from this release type: fromExtendedJSON */ + inspect(): string; +} +/** @public */ +export declare interface DoubleExtended { + $numberDouble: string; +} +/** + * EJSON parse / stringify API + * @public + */ +export declare namespace EJSON { + export interface Options { + /** Output using the Extended JSON v1 spec */ + legacy?: boolean; + /** Enable Extended JSON's `relaxed` mode, which attempts to return native JS types where possible, rather than BSON types */ + relaxed?: boolean; + /** + * Disable Extended JSON's `relaxed` mode, which attempts to return BSON types where possible, rather than native JS types + * @deprecated Please use the relaxed property instead + */ + strict?: boolean; + } + /** + * Parse an Extended JSON string, constructing the JavaScript value or object described by that + * string. + * + * @example + * ```js + * const { EJSON } = require('bson'); + * const text = '{ "int32": { "$numberInt": "10" } }'; + * + * // prints { int32: { [String: '10'] _bsontype: 'Int32', value: '10' } } + * console.log(EJSON.parse(text, { relaxed: false })); + * + * // prints { int32: 10 } + * console.log(EJSON.parse(text)); + * ``` + */ + export function parse(text: string, options?: EJSON.Options): SerializableTypes; + export type JSONPrimitive = string | number | boolean | null; + export type SerializableTypes = Document | Array | JSONPrimitive; + /** + * Converts a BSON document to an Extended JSON string, optionally replacing values if a replacer + * function is specified or optionally including only the specified properties if a replacer array + * is specified. + * + * @param value - The value to convert to extended JSON + * @param replacer - A function that alters the behavior of the stringification process, or an array of String and Number objects that serve as a whitelist for selecting/filtering the properties of the value object to be included in the JSON string. If this value is null or not provided, all properties of the object are included in the resulting JSON string + * @param space - A String or Number object that's used to insert white space into the output JSON string for readability purposes. + * @param options - Optional settings + * + * @example + * ```js + * const { EJSON } = require('bson'); + * const Int32 = require('mongodb').Int32; + * const doc = { int32: new Int32(10) }; + * + * // prints '{"int32":{"$numberInt":"10"}}' + * console.log(EJSON.stringify(doc, { relaxed: false })); + * + * // prints '{"int32":10}' + * console.log(EJSON.stringify(doc)); + * ``` + */ + export function stringify(value: SerializableTypes, replacer?: (number | string)[] | ((this: any, key: string, value: any) => any) | EJSON.Options, space?: string | number, options?: EJSON.Options): string; + /** + * Serializes an object to an Extended JSON string, and reparse it as a JavaScript object. + * + * @param value - The object to serialize + * @param options - Optional settings passed to the `stringify` function + */ + export function serialize(value: SerializableTypes, options?: EJSON.Options): Document; + /** + * Deserializes an Extended JSON object into a plain JavaScript object with native/BSON types + * + * @param ejson - The Extended JSON object to deserialize + * @param options - Optional settings passed to the parse method + */ + export function deserialize(ejson: Document, options?: EJSON.Options): SerializableTypes; +} +/** @public */ +export declare type EJSONOptions = EJSON.Options; +/** + * A class representation of a BSON Int32 type. + * @public + * @category BSONType + */ +export declare class Int32 { + _bsontype: 'Int32'; + value: number; + /** + * Create an Int32 type + * + * @param value - the number we want to represent as an int32. + */ + constructor(value: number | string); + /** + * Access the number value. + * + * @returns returns the wrapped int32 number. + */ + valueOf(): number; + toString(radix?: number): string; + toJSON(): number; + /* Excluded from this release type: toExtendedJSON */ + /* Excluded from this release type: fromExtendedJSON */ + inspect(): string; +} +/** @public */ +export declare interface Int32Extended { + $numberInt: string; +} +declare const kId: unique symbol; +declare const kId_2: unique symbol; +/** + * A class representing a 64-bit integer + * @public + * @category BSONType + * @remarks + * The internal representation of a long is the two given signed, 32-bit values. + * We use 32-bit pieces because these are the size of integers on which + * Javascript performs bit-operations. For operations like addition and + * multiplication, we split each number into 16 bit pieces, which can easily be + * multiplied within Javascript's floating-point representation without overflow + * or change in sign. + * In the algorithms below, we frequently reduce the negative case to the + * positive case by negating the input(s) and then post-processing the result. + * Note that we must ALWAYS check specially whether those values are MIN_VALUE + * (-2^63) because -MIN_VALUE == MIN_VALUE (since 2^63 cannot be represented as + * a positive number, it overflows back into a negative). Not handling this + * case would often result in infinite recursion. + * Common constant values ZERO, ONE, NEG_ONE, etc. are found as static properties on this class. + */ +export declare class Long { + _bsontype: 'Long'; + /** An indicator used to reliably determine if an object is a Long or not. */ + __isLong__: true; + /** + * The high 32 bits as a signed value. + */ + high: number; + /** + * The low 32 bits as a signed value. + */ + low: number; + /** + * Whether unsigned or not. + */ + unsigned: boolean; + /** + * Constructs a 64 bit two's-complement integer, given its low and high 32 bit values as *signed* integers. + * See the from* functions below for more convenient ways of constructing Longs. + * + * Acceptable signatures are: + * - Long(low, high, unsigned?) + * - Long(bigint, unsigned?) + * - Long(string, unsigned?) + * + * @param low - The low (signed) 32 bits of the long + * @param high - The high (signed) 32 bits of the long + * @param unsigned - Whether unsigned or not, defaults to signed + */ + constructor(low?: number | bigint | string, high?: number | boolean, unsigned?: boolean); + static TWO_PWR_24: Long; + /** Maximum unsigned value. */ + static MAX_UNSIGNED_VALUE: Long; + /** Signed zero */ + static ZERO: Long; + /** Unsigned zero. */ + static UZERO: Long; + /** Signed one. */ + static ONE: Long; + /** Unsigned one. */ + static UONE: Long; + /** Signed negative one. */ + static NEG_ONE: Long; + /** Maximum signed value. */ + static MAX_VALUE: Long; + /** Minimum signed value. */ + static MIN_VALUE: Long; + /** + * Returns a Long representing the 64 bit integer that comes by concatenating the given low and high bits. + * Each is assumed to use 32 bits. + * @param lowBits - The low 32 bits + * @param highBits - The high 32 bits + * @param unsigned - Whether unsigned or not, defaults to signed + * @returns The corresponding Long value + */ + static fromBits(lowBits: number, highBits: number, unsigned?: boolean): Long; + /** + * Returns a Long representing the given 32 bit integer value. + * @param value - The 32 bit integer in question + * @param unsigned - Whether unsigned or not, defaults to signed + * @returns The corresponding Long value + */ + static fromInt(value: number, unsigned?: boolean): Long; + /** + * Returns a Long representing the given value, provided that it is a finite number. Otherwise, zero is returned. + * @param value - The number in question + * @param unsigned - Whether unsigned or not, defaults to signed + * @returns The corresponding Long value + */ + static fromNumber(value: number, unsigned?: boolean): Long; + /** + * Returns a Long representing the given value, provided that it is a finite number. Otherwise, zero is returned. + * @param value - The number in question + * @param unsigned - Whether unsigned or not, defaults to signed + * @returns The corresponding Long value + */ + static fromBigInt(value: bigint, unsigned?: boolean): Long; + /** + * Returns a Long representation of the given string, written using the specified radix. + * @param str - The textual representation of the Long + * @param unsigned - Whether unsigned or not, defaults to signed + * @param radix - The radix in which the text is written (2-36), defaults to 10 + * @returns The corresponding Long value + */ + static fromString(str: string, unsigned?: boolean, radix?: number): Long; + /** + * Creates a Long from its byte representation. + * @param bytes - Byte representation + * @param unsigned - Whether unsigned or not, defaults to signed + * @param le - Whether little or big endian, defaults to big endian + * @returns The corresponding Long value + */ + static fromBytes(bytes: number[], unsigned?: boolean, le?: boolean): Long; + /** + * Creates a Long from its little endian byte representation. + * @param bytes - Little endian byte representation + * @param unsigned - Whether unsigned or not, defaults to signed + * @returns The corresponding Long value + */ + static fromBytesLE(bytes: number[], unsigned?: boolean): Long; + /** + * Creates a Long from its big endian byte representation. + * @param bytes - Big endian byte representation + * @param unsigned - Whether unsigned or not, defaults to signed + * @returns The corresponding Long value + */ + static fromBytesBE(bytes: number[], unsigned?: boolean): Long; + /** + * Tests if the specified object is a Long. + */ + static isLong(value: any): value is Long; + /** + * Converts the specified value to a Long. + * @param unsigned - Whether unsigned or not, defaults to signed + */ + static fromValue(val: number | string | { + low: number; + high: number; + unsigned?: boolean; + }, unsigned?: boolean): Long; + /** Returns the sum of this and the specified Long. */ + add(addend: string | number | Long | Timestamp): Long; + /** + * Returns the sum of this and the specified Long. + * @returns Sum + */ + and(other: string | number | Long | Timestamp): Long; + /** + * Compares this Long's value with the specified's. + * @returns 0 if they are the same, 1 if the this is greater and -1 if the given one is greater + */ + compare(other: string | number | Long | Timestamp): 0 | 1 | -1; + /** This is an alias of {@link Long.compare} */ + comp(other: string | number | Long | Timestamp): 0 | 1 | -1; + /** + * Returns this Long divided by the specified. The result is signed if this Long is signed or unsigned if this Long is unsigned. + * @returns Quotient + */ + divide(divisor: string | number | Long | Timestamp): Long; + /**This is an alias of {@link Long.divide} */ + div(divisor: string | number | Long | Timestamp): Long; + /** + * Tests if this Long's value equals the specified's. + * @param other - Other value + */ + equals(other: string | number | Long | Timestamp): boolean; + /** This is an alias of {@link Long.equals} */ + eq(other: string | number | Long | Timestamp): boolean; + /** Gets the high 32 bits as a signed integer. */ + getHighBits(): number; + /** Gets the high 32 bits as an unsigned integer. */ + getHighBitsUnsigned(): number; + /** Gets the low 32 bits as a signed integer. */ + getLowBits(): number; + /** Gets the low 32 bits as an unsigned integer. */ + getLowBitsUnsigned(): number; + /** Gets the number of bits needed to represent the absolute value of this Long. */ + getNumBitsAbs(): number; + /** Tests if this Long's value is greater than the specified's. */ + greaterThan(other: string | number | Long | Timestamp): boolean; + /** This is an alias of {@link Long.greaterThan} */ + gt(other: string | number | Long | Timestamp): boolean; + /** Tests if this Long's value is greater than or equal the specified's. */ + greaterThanOrEqual(other: string | number | Long | Timestamp): boolean; + /** This is an alias of {@link Long.greaterThanOrEqual} */ + gte(other: string | number | Long | Timestamp): boolean; + /** This is an alias of {@link Long.greaterThanOrEqual} */ + ge(other: string | number | Long | Timestamp): boolean; + /** Tests if this Long's value is even. */ + isEven(): boolean; + /** Tests if this Long's value is negative. */ + isNegative(): boolean; + /** Tests if this Long's value is odd. */ + isOdd(): boolean; + /** Tests if this Long's value is positive. */ + isPositive(): boolean; + /** Tests if this Long's value equals zero. */ + isZero(): boolean; + /** Tests if this Long's value is less than the specified's. */ + lessThan(other: string | number | Long | Timestamp): boolean; + /** This is an alias of {@link Long#lessThan}. */ + lt(other: string | number | Long | Timestamp): boolean; + /** Tests if this Long's value is less than or equal the specified's. */ + lessThanOrEqual(other: string | number | Long | Timestamp): boolean; + /** This is an alias of {@link Long.lessThanOrEqual} */ + lte(other: string | number | Long | Timestamp): boolean; + /** Returns this Long modulo the specified. */ + modulo(divisor: string | number | Long | Timestamp): Long; + /** This is an alias of {@link Long.modulo} */ + mod(divisor: string | number | Long | Timestamp): Long; + /** This is an alias of {@link Long.modulo} */ + rem(divisor: string | number | Long | Timestamp): Long; + /** + * Returns the product of this and the specified Long. + * @param multiplier - Multiplier + * @returns Product + */ + multiply(multiplier: string | number | Long | Timestamp): Long; + /** This is an alias of {@link Long.multiply} */ + mul(multiplier: string | number | Long | Timestamp): Long; + /** Returns the Negation of this Long's value. */ + negate(): Long; + /** This is an alias of {@link Long.negate} */ + neg(): Long; + /** Returns the bitwise NOT of this Long. */ + not(): Long; + /** Tests if this Long's value differs from the specified's. */ + notEquals(other: string | number | Long | Timestamp): boolean; + /** This is an alias of {@link Long.notEquals} */ + neq(other: string | number | Long | Timestamp): boolean; + /** This is an alias of {@link Long.notEquals} */ + ne(other: string | number | Long | Timestamp): boolean; + /** + * Returns the bitwise OR of this Long and the specified. + */ + or(other: number | string | Long): Long; + /** + * Returns this Long with bits shifted to the left by the given amount. + * @param numBits - Number of bits + * @returns Shifted Long + */ + shiftLeft(numBits: number | Long): Long; + /** This is an alias of {@link Long.shiftLeft} */ + shl(numBits: number | Long): Long; + /** + * Returns this Long with bits arithmetically shifted to the right by the given amount. + * @param numBits - Number of bits + * @returns Shifted Long + */ + shiftRight(numBits: number | Long): Long; + /** This is an alias of {@link Long.shiftRight} */ + shr(numBits: number | Long): Long; + /** + * Returns this Long with bits logically shifted to the right by the given amount. + * @param numBits - Number of bits + * @returns Shifted Long + */ + shiftRightUnsigned(numBits: Long | number): Long; + /** This is an alias of {@link Long.shiftRightUnsigned} */ + shr_u(numBits: number | Long): Long; + /** This is an alias of {@link Long.shiftRightUnsigned} */ + shru(numBits: number | Long): Long; + /** + * Returns the difference of this and the specified Long. + * @param subtrahend - Subtrahend + * @returns Difference + */ + subtract(subtrahend: string | number | Long | Timestamp): Long; + /** This is an alias of {@link Long.subtract} */ + sub(subtrahend: string | number | Long | Timestamp): Long; + /** Converts the Long to a 32 bit integer, assuming it is a 32 bit integer. */ + toInt(): number; + /** Converts the Long to a the nearest floating-point representation of this value (double, 53 bit mantissa). */ + toNumber(): number; + /** Converts the Long to a BigInt (arbitrary precision). */ + toBigInt(): bigint; + /** + * Converts this Long to its byte representation. + * @param le - Whether little or big endian, defaults to big endian + * @returns Byte representation + */ + toBytes(le?: boolean): number[]; + /** + * Converts this Long to its little endian byte representation. + * @returns Little endian byte representation + */ + toBytesLE(): number[]; + /** + * Converts this Long to its big endian byte representation. + * @returns Big endian byte representation + */ + toBytesBE(): number[]; + /** + * Converts this Long to signed. + */ + toSigned(): Long; + /** + * Converts the Long to a string written in the specified radix. + * @param radix - Radix (2-36), defaults to 10 + * @throws RangeError If `radix` is out of range + */ + toString(radix?: number): string; + /** Converts this Long to unsigned. */ + toUnsigned(): Long; + /** Returns the bitwise XOR of this Long and the given one. */ + xor(other: Long | number | string): Long; + /** This is an alias of {@link Long.isZero} */ + eqz(): boolean; + /** This is an alias of {@link Long.lessThanOrEqual} */ + le(other: string | number | Long | Timestamp): boolean; + toExtendedJSON(options?: EJSONOptions): number | LongExtended; + static fromExtendedJSON(doc: { + $numberLong: string; + }, options?: EJSONOptions): number | Long; + inspect(): string; +} +/** @public */ +export declare interface LongExtended { + $numberLong: string; +} +/** @public */ +export declare type LongWithoutOverrides = new (low: unknown, high?: number, unsigned?: boolean) => { + [P in Exclude]: Long[P]; +}; +/** @public */ +export declare const LongWithoutOverridesClass: LongWithoutOverrides; +/** @public */ +declare let Map_2: MapConstructor; +export { Map_2 as Map }; +/** + * A class representation of the BSON MaxKey type. + * @public + * @category BSONType + */ +export declare class MaxKey { + _bsontype: 'MaxKey'; + constructor(); + /* Excluded from this release type: toExtendedJSON */ + /* Excluded from this release type: fromExtendedJSON */ + inspect(): string; +} +/** @public */ +export declare interface MaxKeyExtended { + $maxKey: 1; +} +/** + * A class representation of the BSON MinKey type. + * @public + * @category BSONType + */ +export declare class MinKey { + _bsontype: 'MinKey'; + constructor(); + /* Excluded from this release type: toExtendedJSON */ + /* Excluded from this release type: fromExtendedJSON */ + inspect(): string; +} +/** @public */ +export declare interface MinKeyExtended { + $minKey: 1; +} +/** + * A class representation of the BSON ObjectId type. + * @public + * @category BSONType + */ +declare class ObjectId { + _bsontype: 'ObjectID'; + /* Excluded from this release type: index */ + static cacheHexString: boolean; + /* Excluded from this release type: [kId] */ + /* Excluded from this release type: __id */ + /** + * Create an ObjectId type + * + * @param inputId - Can be a 24 character hex string, 12 byte binary Buffer, or a number. + */ + constructor(inputId?: string | number | ObjectId | ObjectIdLike | Buffer | Uint8Array); + /* + * The ObjectId bytes + * @readonly + */ + id: Buffer; + /* + * The generation time of this ObjectId instance + * @deprecated Please use getTimestamp / createFromTime which returns an int32 epoch + */ + generationTime: number; + /** Returns the ObjectId id as a 24 character hex string representation */ + toHexString(): string; + /* Excluded from this release type: getInc */ + /** + * Generate a 12 byte id buffer used in ObjectId's + * + * @param time - pass in a second based timestamp. + */ + static generate(time?: number): Buffer; + /** + * Converts the id into a 24 character hex string for printing + * + * @param format - The Buffer toString format parameter. + */ + toString(format?: string): string; + /** Converts to its JSON the 24 character hex string representation. */ + toJSON(): string; + /** + * Compares the equality of this ObjectId with `otherID`. + * + * @param otherId - ObjectId instance to compare against. + */ + equals(otherId: string | ObjectId | ObjectIdLike): boolean; + /** Returns the generation date (accurate up to the second) that this ID was generated. */ + getTimestamp(): Date; + /* Excluded from this release type: createPk */ + /** + * Creates an ObjectId from a second based number, with the rest of the ObjectId zeroed out. Used for comparisons or sorting the ObjectId. + * + * @param time - an integer number representing a number of seconds. + */ + static createFromTime(time: number): ObjectId; + /** + * Creates an ObjectId from a hex string representation of an ObjectId. + * + * @param hexString - create a ObjectId from a passed in 24 character hexstring. + */ + static createFromHexString(hexString: string): ObjectId; + /** + * Checks if a value is a valid bson ObjectId + * + * @param id - ObjectId instance to validate. + */ + static isValid(id: string | number | ObjectId | ObjectIdLike | Buffer | Uint8Array): boolean; + /* Excluded from this release type: toExtendedJSON */ + /* Excluded from this release type: fromExtendedJSON */ + inspect(): string; +} +export { ObjectId as ObjectID }; +export { ObjectId }; +/** @public */ +export declare interface ObjectIdExtended { + $oid: string; +} +/** @public */ +export declare interface ObjectIdLike { + id: string | Buffer; + __id?: string; + toHexString(): string; +} +/** + * Serialize a Javascript object. + * + * @param object - the Javascript object to serialize. + * @returns Buffer object containing the serialized object. + * @public + */ +export declare function serialize(object: Document, options?: SerializeOptions): Buffer; +/** @public */ +export declare interface SerializeOptions { + /** the serializer will check if keys are valid. */ + checkKeys?: boolean; + /** serialize the javascript functions **(default:false)**. */ + serializeFunctions?: boolean; + /** serialize will not emit undefined fields **(default:true)** */ + ignoreUndefined?: boolean; + /* Excluded from this release type: minInternalBufferSize */ + /** the index in the buffer where we wish to start serializing into */ + index?: number; +} +/** + * Serialize a Javascript object using a predefined Buffer and index into the buffer, + * useful when pre-allocating the space for serialization. + * + * @param object - the Javascript object to serialize. + * @param finalBuffer - the Buffer you pre-allocated to store the serialized BSON object. + * @returns the index pointing to the last written byte in the buffer. + * @public + */ +export declare function serializeWithBufferAndIndex(object: Document, finalBuffer: Buffer, options?: SerializeOptions): number; +/** + * Sets the size of the internal serialization buffer. + * + * @param size - The desired size for the internal serialization buffer + * @public + */ +export declare function setInternalBufferSize(size: number): void; +/** + * @public + * @category BSONType + * */ +export declare class Timestamp extends LongWithoutOverridesClass { + _bsontype: 'Timestamp'; + static readonly MAX_VALUE: Long; + /** + * @param low - A 64-bit Long representing the Timestamp. + */ + constructor(long: Long); + /** + * @param value - A pair of two values indicating timestamp and increment. + */ + constructor(value: { + t: number; + i: number; + }); + /** + * @param low - the low (signed) 32 bits of the Timestamp. + * @param high - the high (signed) 32 bits of the Timestamp. + * @deprecated Please use `Timestamp({ t: high, i: low })` or `Timestamp(Long(low, high))` instead. + */ + constructor(low: number, high: number); + toJSON(): { + $timestamp: string; + }; + /** Returns a Timestamp represented by the given (32-bit) integer value. */ + static fromInt(value: number): Timestamp; + /** Returns a Timestamp representing the given number value, provided that it is a finite number. Otherwise, zero is returned. */ + static fromNumber(value: number): Timestamp; + /** + * Returns a Timestamp for the given high and low bits. Each is assumed to use 32 bits. + * + * @param lowBits - the low 32-bits. + * @param highBits - the high 32-bits. + */ + static fromBits(lowBits: number, highBits: number): Timestamp; + /** + * Returns a Timestamp from the given string, optionally using the given radix. + * + * @param str - the textual representation of the Timestamp. + * @param optRadix - the radix in which the text is written. + */ + static fromString(str: string, optRadix: number): Timestamp; + /* Excluded from this release type: toExtendedJSON */ + /* Excluded from this release type: fromExtendedJSON */ + inspect(): string; +} +/** @public */ +export declare interface TimestampExtended { + $timestamp: { + t: number; + i: number; + }; +} +/** @public */ +export declare type TimestampOverrides = '_bsontype' | 'toExtendedJSON' | 'fromExtendedJSON' | 'inspect'; +/** + * A class representation of the BSON UUID type. + * @public + */ +export declare class UUID { + _bsontype: 'UUID'; + static cacheHexString: boolean; + /* Excluded from this release type: [kId] */ + /* Excluded from this release type: __id */ + /** + * Create an UUID type + * + * @param input - Can be a 32 or 36 character hex string (dashes excluded/included) or a 16 byte binary Buffer. + */ + constructor(input?: string | Buffer | UUID); + /* + * The UUID bytes + * @readonly + */ + id: Buffer; + /** + * Generate a 16 byte uuid v4 buffer used in UUIDs + */ + /** + * Returns the UUID id as a 32 or 36 character hex string representation, excluding/including dashes (defaults to 36 character dash separated) + * @param includeDashes - should the string exclude dash-separators. + * */ + toHexString(includeDashes?: boolean): string; + /** + * Converts the id into a 36 character (dashes included) hex string, unless a encoding is specified. + */ + toString(encoding?: string): string; + /** + * Converts the id into its JSON string representation. + * A 36 character (dashes included) hex string in the format: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx + */ + toJSON(): string; + /** + * Compares the equality of this UUID with `otherID`. + * + * @param otherId - UUID instance to compare against. + */ + equals(otherId: string | Buffer | UUID): boolean; + /** + * Creates a Binary instance from the current UUID. + */ + toBinary(): Binary; + /** + * Generates a populated buffer containing a v4 uuid + */ + static generate(): Buffer; + /** + * Checks if a value is a valid bson UUID + * @param input - UUID, string or Buffer to validate. + */ + static isValid(input: string | Buffer | UUID): boolean; + /** + * Creates an UUID from a hex string representation of an UUID. + * @param hexString - 32 or 36 character hex string (dashes excluded/included). + */ + static createFromHexString(hexString: string): UUID; + inspect(): string; +} +/** @public */ +export declare type UUIDExtended = { + $uuid: string; +}; +export {}; diff --git a/node_modules/bson/bson.d.ts b/node_modules/bson/bson.d.ts new file mode 100644 index 000000000..36c65ca5b --- /dev/null +++ b/node_modules/bson/bson.d.ts @@ -0,0 +1,1228 @@ +import { Buffer } from 'buffer'; + +/** + * A class representation of the BSON Binary type. + * @public + * @category BSONType + */ +export declare class Binary { + _bsontype: 'Binary'; + /* Excluded from this release type: BSON_BINARY_SUBTYPE_DEFAULT */ + /** Initial buffer default size */ + static readonly BUFFER_SIZE = 256; + /** Default BSON type */ + static readonly SUBTYPE_DEFAULT = 0; + /** Function BSON type */ + static readonly SUBTYPE_FUNCTION = 1; + /** Byte Array BSON type */ + static readonly SUBTYPE_BYTE_ARRAY = 2; + /** Deprecated UUID BSON type @deprecated Please use SUBTYPE_UUID */ + static readonly SUBTYPE_UUID_OLD = 3; + /** UUID BSON type */ + static readonly SUBTYPE_UUID = 4; + /** MD5 BSON type */ + static readonly SUBTYPE_MD5 = 5; + /** Encrypted BSON type */ + static readonly SUBTYPE_ENCRYPTED = 6; + /** Column BSON type */ + static readonly SUBTYPE_COLUMN = 7; + /** User BSON type */ + static readonly SUBTYPE_USER_DEFINED = 128; + buffer: Buffer; + sub_type: number; + position: number; + /** + * @param buffer - a buffer object containing the binary data. + * @param subType - the option binary type. + */ + constructor(buffer?: string | BinarySequence, subType?: number); + /** + * Updates this binary with byte_value. + * + * @param byteValue - a single byte we wish to write. + */ + put(byteValue: string | number | Uint8Array | Buffer | number[]): void; + /** + * Writes a buffer or string to the binary. + * + * @param sequence - a string or buffer to be written to the Binary BSON object. + * @param offset - specify the binary of where to write the content. + */ + write(sequence: string | BinarySequence, offset: number): void; + /** + * Reads **length** bytes starting at **position**. + * + * @param position - read from the given position in the Binary. + * @param length - the number of bytes to read. + */ + read(position: number, length: number): BinarySequence; + /** + * Returns the value of this binary as a string. + * @param asRaw - Will skip converting to a string + * @remarks + * This is handy when calling this function conditionally for some key value pairs and not others + */ + value(asRaw?: boolean): string | BinarySequence; + /** the length of the binary sequence */ + length(): number; + toJSON(): string; + toString(format?: string): string; + /* Excluded from this release type: toExtendedJSON */ + toUUID(): UUID; + /* Excluded from this release type: fromExtendedJSON */ + inspect(): string; +} + +/** @public */ +export declare interface BinaryExtended { + $binary: { + subType: string; + base64: string; + }; +} + +/** @public */ +export declare interface BinaryExtendedLegacy { + $type: string; + $binary: string; +} + +/** @public */ +export declare type BinarySequence = Uint8Array | Buffer | number[]; + +/** + * BSON default export + * @deprecated Please use named exports + * @privateRemarks + * We want to someday deprecate the default export, + * so none of the new TS types are being exported on the default + * @public + */ +declare const BSON: { + Binary: typeof Binary; + Code: typeof Code; + DBRef: typeof DBRef; + Decimal128: typeof Decimal128; + Double: typeof Double; + Int32: typeof Int32; + Long: typeof Long; + UUID: typeof UUID; + Map: MapConstructor; + MaxKey: typeof MaxKey; + MinKey: typeof MinKey; + ObjectId: typeof ObjectId; + ObjectID: typeof ObjectId; + BSONRegExp: typeof BSONRegExp; + BSONSymbol: typeof BSONSymbol; + Timestamp: typeof Timestamp; + EJSON: typeof EJSON; + setInternalBufferSize: typeof setInternalBufferSize; + serialize: typeof serialize; + serializeWithBufferAndIndex: typeof serializeWithBufferAndIndex; + deserialize: typeof deserialize; + calculateObjectSize: typeof calculateObjectSize; + deserializeStream: typeof deserializeStream; + BSONError: typeof BSONError; + BSONTypeError: typeof BSONTypeError; +}; +export default BSON; + +/* Excluded from this release type: BSON_BINARY_SUBTYPE_BYTE_ARRAY */ + +/* Excluded from this release type: BSON_BINARY_SUBTYPE_COLUMN */ + +/* Excluded from this release type: BSON_BINARY_SUBTYPE_DEFAULT */ + +/* Excluded from this release type: BSON_BINARY_SUBTYPE_ENCRYPTED */ + +/* Excluded from this release type: BSON_BINARY_SUBTYPE_FUNCTION */ + +/* Excluded from this release type: BSON_BINARY_SUBTYPE_MD5 */ + +/* Excluded from this release type: BSON_BINARY_SUBTYPE_USER_DEFINED */ + +/* Excluded from this release type: BSON_BINARY_SUBTYPE_UUID */ + +/* Excluded from this release type: BSON_BINARY_SUBTYPE_UUID_NEW */ + +/* Excluded from this release type: BSON_DATA_ARRAY */ + +/* Excluded from this release type: BSON_DATA_BINARY */ + +/* Excluded from this release type: BSON_DATA_BOOLEAN */ + +/* Excluded from this release type: BSON_DATA_CODE */ + +/* Excluded from this release type: BSON_DATA_CODE_W_SCOPE */ + +/* Excluded from this release type: BSON_DATA_DATE */ + +/* Excluded from this release type: BSON_DATA_DBPOINTER */ + +/* Excluded from this release type: BSON_DATA_DECIMAL128 */ + +/* Excluded from this release type: BSON_DATA_INT */ + +/* Excluded from this release type: BSON_DATA_LONG */ + +/* Excluded from this release type: BSON_DATA_MAX_KEY */ + +/* Excluded from this release type: BSON_DATA_MIN_KEY */ + +/* Excluded from this release type: BSON_DATA_NULL */ + +/* Excluded from this release type: BSON_DATA_NUMBER */ + +/* Excluded from this release type: BSON_DATA_OBJECT */ + +/* Excluded from this release type: BSON_DATA_OID */ + +/* Excluded from this release type: BSON_DATA_REGEXP */ + +/* Excluded from this release type: BSON_DATA_STRING */ + +/* Excluded from this release type: BSON_DATA_SYMBOL */ + +/* Excluded from this release type: BSON_DATA_TIMESTAMP */ + +/* Excluded from this release type: BSON_DATA_UNDEFINED */ + +/* Excluded from this release type: BSON_INT32_MAX */ + +/* Excluded from this release type: BSON_INT32_MIN */ + +/* Excluded from this release type: BSON_INT64_MAX */ + +/* Excluded from this release type: BSON_INT64_MIN */ + +/** @public */ +export declare class BSONError extends Error { + constructor(message: string); + get name(): string; +} + +/** + * A class representation of the BSON RegExp type. + * @public + * @category BSONType + */ +export declare class BSONRegExp { + _bsontype: 'BSONRegExp'; + pattern: string; + options: string; + /** + * @param pattern - The regular expression pattern to match + * @param options - The regular expression options + */ + constructor(pattern: string, options?: string); + static parseOptions(options?: string): string; + /* Excluded from this release type: toExtendedJSON */ + /* Excluded from this release type: fromExtendedJSON */ +} + +/** @public */ +export declare interface BSONRegExpExtended { + $regularExpression: { + pattern: string; + options: string; + }; +} + +/** @public */ +export declare interface BSONRegExpExtendedLegacy { + $regex: string | BSONRegExp; + $options: string; +} + +/** + * A class representation of the BSON Symbol type. + * @public + * @category BSONType + */ +export declare class BSONSymbol { + _bsontype: 'Symbol'; + value: string; + /** + * @param value - the string representing the symbol. + */ + constructor(value: string); + /** Access the wrapped string value. */ + valueOf(): string; + toString(): string; + /* Excluded from this release type: inspect */ + toJSON(): string; + /* Excluded from this release type: toExtendedJSON */ + /* Excluded from this release type: fromExtendedJSON */ +} + +/** @public */ +export declare interface BSONSymbolExtended { + $symbol: string; +} + +/** @public */ +export declare class BSONTypeError extends TypeError { + constructor(message: string); + get name(): string; +} + +/** + * Calculate the bson size for a passed in Javascript object. + * + * @param object - the Javascript object to calculate the BSON byte size for + * @returns size of BSON object in bytes + * @public + */ +export declare function calculateObjectSize(object: Document, options?: CalculateObjectSizeOptions): number; + +/** @public */ +export declare type CalculateObjectSizeOptions = Pick; + +/** + * A class representation of the BSON Code type. + * @public + * @category BSONType + */ +export declare class Code { + _bsontype: 'Code'; + code: string | Function; + scope?: Document; + /** + * @param code - a string or function. + * @param scope - an optional scope for the function. + */ + constructor(code: string | Function, scope?: Document); + toJSON(): { + code: string | Function; + scope?: Document; + }; + /* Excluded from this release type: toExtendedJSON */ + /* Excluded from this release type: fromExtendedJSON */ + inspect(): string; +} + +/** @public */ +export declare interface CodeExtended { + $code: string | Function; + $scope?: Document; +} + +/** + * A class representation of the BSON DBRef type. + * @public + * @category BSONType + */ +export declare class DBRef { + _bsontype: 'DBRef'; + collection: string; + oid: ObjectId; + db?: string; + fields: Document; + /** + * @param collection - the collection name. + * @param oid - the reference ObjectId. + * @param db - optional db name, if omitted the reference is local to the current db. + */ + constructor(collection: string, oid: ObjectId, db?: string, fields?: Document); + /* Excluded from this release type: namespace */ + /* Excluded from this release type: namespace */ + toJSON(): DBRefLike & Document; + /* Excluded from this release type: toExtendedJSON */ + /* Excluded from this release type: fromExtendedJSON */ + inspect(): string; +} + +/** @public */ +export declare interface DBRefLike { + $ref: string; + $id: ObjectId; + $db?: string; +} + +/** + * A class representation of the BSON Decimal128 type. + * @public + * @category BSONType + */ +export declare class Decimal128 { + _bsontype: 'Decimal128'; + readonly bytes: Buffer; + /** + * @param bytes - a buffer containing the raw Decimal128 bytes in little endian order, + * or a string representation as returned by .toString() + */ + constructor(bytes: Buffer | string); + /** + * Create a Decimal128 instance from a string representation + * + * @param representation - a numeric string representation. + */ + static fromString(representation: string): Decimal128; + /** Create a string representation of the raw Decimal128 value */ + toString(): string; + toJSON(): Decimal128Extended; + /* Excluded from this release type: toExtendedJSON */ + /* Excluded from this release type: fromExtendedJSON */ + inspect(): string; +} + +/** @public */ +export declare interface Decimal128Extended { + $numberDecimal: string; +} + +/** + * Deserialize data as BSON. + * + * @param buffer - the buffer containing the serialized set of BSON documents. + * @returns returns the deserialized Javascript Object. + * @public + */ +export declare function deserialize(buffer: Buffer | ArrayBufferView | ArrayBuffer, options?: DeserializeOptions): Document; + +/** @public */ +export declare interface DeserializeOptions { + /** evaluate functions in the BSON document scoped to the object deserialized. */ + evalFunctions?: boolean; + /** cache evaluated functions for reuse. */ + cacheFunctions?: boolean; + /** + * use a crc32 code for caching, otherwise use the string of the function. + * @deprecated this option to use the crc32 function never worked as intended + * due to the fact that the crc32 function itself was never implemented. + * */ + cacheFunctionsCrc32?: boolean; + /** when deserializing a Long will fit it into a Number if it's smaller than 53 bits */ + promoteLongs?: boolean; + /** when deserializing a Binary will return it as a node.js Buffer instance. */ + promoteBuffers?: boolean; + /** when deserializing will promote BSON values to their Node.js closest equivalent types. */ + promoteValues?: boolean; + /** allow to specify if there what fields we wish to return as unserialized raw buffer. */ + fieldsAsRaw?: Document; + /** return BSON regular expressions as BSONRegExp instances. */ + bsonRegExp?: boolean; + /** allows the buffer to be larger than the parsed BSON object */ + allowObjectSmallerThanBufferSize?: boolean; + /** Offset into buffer to begin reading document from */ + index?: number; + raw?: boolean; + /** Allows for opt-out utf-8 validation for all keys or + * specified keys. Must be all true or all false. + * + * @example + * ```js + * // disables validation on all keys + * validation: { utf8: false } + * + * // enables validation only on specified keys a, b, and c + * validation: { utf8: { a: true, b: true, c: true } } + * + * // disables validation only on specified keys a, b + * validation: { utf8: { a: false, b: false } } + * ``` + */ + validation?: { + utf8: boolean | Record | Record; + }; +} + +/** + * Deserialize stream data as BSON documents. + * + * @param data - the buffer containing the serialized set of BSON documents. + * @param startIndex - the start index in the data Buffer where the deserialization is to start. + * @param numberOfDocuments - number of documents to deserialize. + * @param documents - an array where to store the deserialized documents. + * @param docStartIndex - the index in the documents array from where to start inserting documents. + * @param options - additional options used for the deserialization. + * @returns next index in the buffer after deserialization **x** numbers of documents. + * @public + */ +export declare function deserializeStream(data: Buffer | ArrayBufferView | ArrayBuffer, startIndex: number, numberOfDocuments: number, documents: Document[], docStartIndex: number, options: DeserializeOptions): number; + +/** @public */ +export declare interface Document { + [key: string]: any; +} + +/** + * A class representation of the BSON Double type. + * @public + * @category BSONType + */ +export declare class Double { + _bsontype: 'Double'; + value: number; + /** + * Create a Double type + * + * @param value - the number we want to represent as a double. + */ + constructor(value: number); + /** + * Access the number value. + * + * @returns returns the wrapped double number. + */ + valueOf(): number; + toJSON(): number; + toString(radix?: number): string; + /* Excluded from this release type: toExtendedJSON */ + /* Excluded from this release type: fromExtendedJSON */ + inspect(): string; +} + +/** @public */ +export declare interface DoubleExtended { + $numberDouble: string; +} + +/** + * EJSON parse / stringify API + * @public + */ +export declare namespace EJSON { + export interface Options { + /** Output using the Extended JSON v1 spec */ + legacy?: boolean; + /** Enable Extended JSON's `relaxed` mode, which attempts to return native JS types where possible, rather than BSON types */ + relaxed?: boolean; + /** + * Disable Extended JSON's `relaxed` mode, which attempts to return BSON types where possible, rather than native JS types + * @deprecated Please use the relaxed property instead + */ + strict?: boolean; + } + /** + * Parse an Extended JSON string, constructing the JavaScript value or object described by that + * string. + * + * @example + * ```js + * const { EJSON } = require('bson'); + * const text = '{ "int32": { "$numberInt": "10" } }'; + * + * // prints { int32: { [String: '10'] _bsontype: 'Int32', value: '10' } } + * console.log(EJSON.parse(text, { relaxed: false })); + * + * // prints { int32: 10 } + * console.log(EJSON.parse(text)); + * ``` + */ + export function parse(text: string, options?: EJSON.Options): SerializableTypes; + export type JSONPrimitive = string | number | boolean | null; + export type SerializableTypes = Document | Array | JSONPrimitive; + /** + * Converts a BSON document to an Extended JSON string, optionally replacing values if a replacer + * function is specified or optionally including only the specified properties if a replacer array + * is specified. + * + * @param value - The value to convert to extended JSON + * @param replacer - A function that alters the behavior of the stringification process, or an array of String and Number objects that serve as a whitelist for selecting/filtering the properties of the value object to be included in the JSON string. If this value is null or not provided, all properties of the object are included in the resulting JSON string + * @param space - A String or Number object that's used to insert white space into the output JSON string for readability purposes. + * @param options - Optional settings + * + * @example + * ```js + * const { EJSON } = require('bson'); + * const Int32 = require('mongodb').Int32; + * const doc = { int32: new Int32(10) }; + * + * // prints '{"int32":{"$numberInt":"10"}}' + * console.log(EJSON.stringify(doc, { relaxed: false })); + * + * // prints '{"int32":10}' + * console.log(EJSON.stringify(doc)); + * ``` + */ + export function stringify(value: SerializableTypes, replacer?: (number | string)[] | ((this: any, key: string, value: any) => any) | EJSON.Options, space?: string | number, options?: EJSON.Options): string; + /** + * Serializes an object to an Extended JSON string, and reparse it as a JavaScript object. + * + * @param value - The object to serialize + * @param options - Optional settings passed to the `stringify` function + */ + export function serialize(value: SerializableTypes, options?: EJSON.Options): Document; + /** + * Deserializes an Extended JSON object into a plain JavaScript object with native/BSON types + * + * @param ejson - The Extended JSON object to deserialize + * @param options - Optional settings passed to the parse method + */ + export function deserialize(ejson: Document, options?: EJSON.Options): SerializableTypes; +} + +/** @public */ +export declare type EJSONOptions = EJSON.Options; + +/** + * A class representation of a BSON Int32 type. + * @public + * @category BSONType + */ +export declare class Int32 { + _bsontype: 'Int32'; + value: number; + /** + * Create an Int32 type + * + * @param value - the number we want to represent as an int32. + */ + constructor(value: number | string); + /** + * Access the number value. + * + * @returns returns the wrapped int32 number. + */ + valueOf(): number; + toString(radix?: number): string; + toJSON(): number; + /* Excluded from this release type: toExtendedJSON */ + /* Excluded from this release type: fromExtendedJSON */ + inspect(): string; +} + +/** @public */ +export declare interface Int32Extended { + $numberInt: string; +} + +declare const kId: unique symbol; + +declare const kId_2: unique symbol; + +/** + * A class representing a 64-bit integer + * @public + * @category BSONType + * @remarks + * The internal representation of a long is the two given signed, 32-bit values. + * We use 32-bit pieces because these are the size of integers on which + * Javascript performs bit-operations. For operations like addition and + * multiplication, we split each number into 16 bit pieces, which can easily be + * multiplied within Javascript's floating-point representation without overflow + * or change in sign. + * In the algorithms below, we frequently reduce the negative case to the + * positive case by negating the input(s) and then post-processing the result. + * Note that we must ALWAYS check specially whether those values are MIN_VALUE + * (-2^63) because -MIN_VALUE == MIN_VALUE (since 2^63 cannot be represented as + * a positive number, it overflows back into a negative). Not handling this + * case would often result in infinite recursion. + * Common constant values ZERO, ONE, NEG_ONE, etc. are found as static properties on this class. + */ +export declare class Long { + _bsontype: 'Long'; + /** An indicator used to reliably determine if an object is a Long or not. */ + __isLong__: true; + /** + * The high 32 bits as a signed value. + */ + high: number; + /** + * The low 32 bits as a signed value. + */ + low: number; + /** + * Whether unsigned or not. + */ + unsigned: boolean; + /** + * Constructs a 64 bit two's-complement integer, given its low and high 32 bit values as *signed* integers. + * See the from* functions below for more convenient ways of constructing Longs. + * + * Acceptable signatures are: + * - Long(low, high, unsigned?) + * - Long(bigint, unsigned?) + * - Long(string, unsigned?) + * + * @param low - The low (signed) 32 bits of the long + * @param high - The high (signed) 32 bits of the long + * @param unsigned - Whether unsigned or not, defaults to signed + */ + constructor(low?: number | bigint | string, high?: number | boolean, unsigned?: boolean); + static TWO_PWR_24: Long; + /** Maximum unsigned value. */ + static MAX_UNSIGNED_VALUE: Long; + /** Signed zero */ + static ZERO: Long; + /** Unsigned zero. */ + static UZERO: Long; + /** Signed one. */ + static ONE: Long; + /** Unsigned one. */ + static UONE: Long; + /** Signed negative one. */ + static NEG_ONE: Long; + /** Maximum signed value. */ + static MAX_VALUE: Long; + /** Minimum signed value. */ + static MIN_VALUE: Long; + /** + * Returns a Long representing the 64 bit integer that comes by concatenating the given low and high bits. + * Each is assumed to use 32 bits. + * @param lowBits - The low 32 bits + * @param highBits - The high 32 bits + * @param unsigned - Whether unsigned or not, defaults to signed + * @returns The corresponding Long value + */ + static fromBits(lowBits: number, highBits: number, unsigned?: boolean): Long; + /** + * Returns a Long representing the given 32 bit integer value. + * @param value - The 32 bit integer in question + * @param unsigned - Whether unsigned or not, defaults to signed + * @returns The corresponding Long value + */ + static fromInt(value: number, unsigned?: boolean): Long; + /** + * Returns a Long representing the given value, provided that it is a finite number. Otherwise, zero is returned. + * @param value - The number in question + * @param unsigned - Whether unsigned or not, defaults to signed + * @returns The corresponding Long value + */ + static fromNumber(value: number, unsigned?: boolean): Long; + /** + * Returns a Long representing the given value, provided that it is a finite number. Otherwise, zero is returned. + * @param value - The number in question + * @param unsigned - Whether unsigned or not, defaults to signed + * @returns The corresponding Long value + */ + static fromBigInt(value: bigint, unsigned?: boolean): Long; + /** + * Returns a Long representation of the given string, written using the specified radix. + * @param str - The textual representation of the Long + * @param unsigned - Whether unsigned or not, defaults to signed + * @param radix - The radix in which the text is written (2-36), defaults to 10 + * @returns The corresponding Long value + */ + static fromString(str: string, unsigned?: boolean, radix?: number): Long; + /** + * Creates a Long from its byte representation. + * @param bytes - Byte representation + * @param unsigned - Whether unsigned or not, defaults to signed + * @param le - Whether little or big endian, defaults to big endian + * @returns The corresponding Long value + */ + static fromBytes(bytes: number[], unsigned?: boolean, le?: boolean): Long; + /** + * Creates a Long from its little endian byte representation. + * @param bytes - Little endian byte representation + * @param unsigned - Whether unsigned or not, defaults to signed + * @returns The corresponding Long value + */ + static fromBytesLE(bytes: number[], unsigned?: boolean): Long; + /** + * Creates a Long from its big endian byte representation. + * @param bytes - Big endian byte representation + * @param unsigned - Whether unsigned or not, defaults to signed + * @returns The corresponding Long value + */ + static fromBytesBE(bytes: number[], unsigned?: boolean): Long; + /** + * Tests if the specified object is a Long. + */ + static isLong(value: any): value is Long; + /** + * Converts the specified value to a Long. + * @param unsigned - Whether unsigned or not, defaults to signed + */ + static fromValue(val: number | string | { + low: number; + high: number; + unsigned?: boolean; + }, unsigned?: boolean): Long; + /** Returns the sum of this and the specified Long. */ + add(addend: string | number | Long | Timestamp): Long; + /** + * Returns the sum of this and the specified Long. + * @returns Sum + */ + and(other: string | number | Long | Timestamp): Long; + /** + * Compares this Long's value with the specified's. + * @returns 0 if they are the same, 1 if the this is greater and -1 if the given one is greater + */ + compare(other: string | number | Long | Timestamp): 0 | 1 | -1; + /** This is an alias of {@link Long.compare} */ + comp(other: string | number | Long | Timestamp): 0 | 1 | -1; + /** + * Returns this Long divided by the specified. The result is signed if this Long is signed or unsigned if this Long is unsigned. + * @returns Quotient + */ + divide(divisor: string | number | Long | Timestamp): Long; + /**This is an alias of {@link Long.divide} */ + div(divisor: string | number | Long | Timestamp): Long; + /** + * Tests if this Long's value equals the specified's. + * @param other - Other value + */ + equals(other: string | number | Long | Timestamp): boolean; + /** This is an alias of {@link Long.equals} */ + eq(other: string | number | Long | Timestamp): boolean; + /** Gets the high 32 bits as a signed integer. */ + getHighBits(): number; + /** Gets the high 32 bits as an unsigned integer. */ + getHighBitsUnsigned(): number; + /** Gets the low 32 bits as a signed integer. */ + getLowBits(): number; + /** Gets the low 32 bits as an unsigned integer. */ + getLowBitsUnsigned(): number; + /** Gets the number of bits needed to represent the absolute value of this Long. */ + getNumBitsAbs(): number; + /** Tests if this Long's value is greater than the specified's. */ + greaterThan(other: string | number | Long | Timestamp): boolean; + /** This is an alias of {@link Long.greaterThan} */ + gt(other: string | number | Long | Timestamp): boolean; + /** Tests if this Long's value is greater than or equal the specified's. */ + greaterThanOrEqual(other: string | number | Long | Timestamp): boolean; + /** This is an alias of {@link Long.greaterThanOrEqual} */ + gte(other: string | number | Long | Timestamp): boolean; + /** This is an alias of {@link Long.greaterThanOrEqual} */ + ge(other: string | number | Long | Timestamp): boolean; + /** Tests if this Long's value is even. */ + isEven(): boolean; + /** Tests if this Long's value is negative. */ + isNegative(): boolean; + /** Tests if this Long's value is odd. */ + isOdd(): boolean; + /** Tests if this Long's value is positive. */ + isPositive(): boolean; + /** Tests if this Long's value equals zero. */ + isZero(): boolean; + /** Tests if this Long's value is less than the specified's. */ + lessThan(other: string | number | Long | Timestamp): boolean; + /** This is an alias of {@link Long#lessThan}. */ + lt(other: string | number | Long | Timestamp): boolean; + /** Tests if this Long's value is less than or equal the specified's. */ + lessThanOrEqual(other: string | number | Long | Timestamp): boolean; + /** This is an alias of {@link Long.lessThanOrEqual} */ + lte(other: string | number | Long | Timestamp): boolean; + /** Returns this Long modulo the specified. */ + modulo(divisor: string | number | Long | Timestamp): Long; + /** This is an alias of {@link Long.modulo} */ + mod(divisor: string | number | Long | Timestamp): Long; + /** This is an alias of {@link Long.modulo} */ + rem(divisor: string | number | Long | Timestamp): Long; + /** + * Returns the product of this and the specified Long. + * @param multiplier - Multiplier + * @returns Product + */ + multiply(multiplier: string | number | Long | Timestamp): Long; + /** This is an alias of {@link Long.multiply} */ + mul(multiplier: string | number | Long | Timestamp): Long; + /** Returns the Negation of this Long's value. */ + negate(): Long; + /** This is an alias of {@link Long.negate} */ + neg(): Long; + /** Returns the bitwise NOT of this Long. */ + not(): Long; + /** Tests if this Long's value differs from the specified's. */ + notEquals(other: string | number | Long | Timestamp): boolean; + /** This is an alias of {@link Long.notEquals} */ + neq(other: string | number | Long | Timestamp): boolean; + /** This is an alias of {@link Long.notEquals} */ + ne(other: string | number | Long | Timestamp): boolean; + /** + * Returns the bitwise OR of this Long and the specified. + */ + or(other: number | string | Long): Long; + /** + * Returns this Long with bits shifted to the left by the given amount. + * @param numBits - Number of bits + * @returns Shifted Long + */ + shiftLeft(numBits: number | Long): Long; + /** This is an alias of {@link Long.shiftLeft} */ + shl(numBits: number | Long): Long; + /** + * Returns this Long with bits arithmetically shifted to the right by the given amount. + * @param numBits - Number of bits + * @returns Shifted Long + */ + shiftRight(numBits: number | Long): Long; + /** This is an alias of {@link Long.shiftRight} */ + shr(numBits: number | Long): Long; + /** + * Returns this Long with bits logically shifted to the right by the given amount. + * @param numBits - Number of bits + * @returns Shifted Long + */ + shiftRightUnsigned(numBits: Long | number): Long; + /** This is an alias of {@link Long.shiftRightUnsigned} */ + shr_u(numBits: number | Long): Long; + /** This is an alias of {@link Long.shiftRightUnsigned} */ + shru(numBits: number | Long): Long; + /** + * Returns the difference of this and the specified Long. + * @param subtrahend - Subtrahend + * @returns Difference + */ + subtract(subtrahend: string | number | Long | Timestamp): Long; + /** This is an alias of {@link Long.subtract} */ + sub(subtrahend: string | number | Long | Timestamp): Long; + /** Converts the Long to a 32 bit integer, assuming it is a 32 bit integer. */ + toInt(): number; + /** Converts the Long to a the nearest floating-point representation of this value (double, 53 bit mantissa). */ + toNumber(): number; + /** Converts the Long to a BigInt (arbitrary precision). */ + toBigInt(): bigint; + /** + * Converts this Long to its byte representation. + * @param le - Whether little or big endian, defaults to big endian + * @returns Byte representation + */ + toBytes(le?: boolean): number[]; + /** + * Converts this Long to its little endian byte representation. + * @returns Little endian byte representation + */ + toBytesLE(): number[]; + /** + * Converts this Long to its big endian byte representation. + * @returns Big endian byte representation + */ + toBytesBE(): number[]; + /** + * Converts this Long to signed. + */ + toSigned(): Long; + /** + * Converts the Long to a string written in the specified radix. + * @param radix - Radix (2-36), defaults to 10 + * @throws RangeError If `radix` is out of range + */ + toString(radix?: number): string; + /** Converts this Long to unsigned. */ + toUnsigned(): Long; + /** Returns the bitwise XOR of this Long and the given one. */ + xor(other: Long | number | string): Long; + /** This is an alias of {@link Long.isZero} */ + eqz(): boolean; + /** This is an alias of {@link Long.lessThanOrEqual} */ + le(other: string | number | Long | Timestamp): boolean; + toExtendedJSON(options?: EJSONOptions): number | LongExtended; + static fromExtendedJSON(doc: { + $numberLong: string; + }, options?: EJSONOptions): number | Long; + inspect(): string; +} + +/** @public */ +export declare interface LongExtended { + $numberLong: string; +} + +/** @public */ +export declare type LongWithoutOverrides = new (low: unknown, high?: number, unsigned?: boolean) => { + [P in Exclude]: Long[P]; +}; + +/** @public */ +export declare const LongWithoutOverridesClass: LongWithoutOverrides; + +/** @public */ +declare let Map_2: MapConstructor; +export { Map_2 as Map } + +/** + * A class representation of the BSON MaxKey type. + * @public + * @category BSONType + */ +export declare class MaxKey { + _bsontype: 'MaxKey'; + constructor(); + /* Excluded from this release type: toExtendedJSON */ + /* Excluded from this release type: fromExtendedJSON */ + inspect(): string; +} + +/** @public */ +export declare interface MaxKeyExtended { + $maxKey: 1; +} + +/** + * A class representation of the BSON MinKey type. + * @public + * @category BSONType + */ +export declare class MinKey { + _bsontype: 'MinKey'; + constructor(); + /* Excluded from this release type: toExtendedJSON */ + /* Excluded from this release type: fromExtendedJSON */ + inspect(): string; +} + +/** @public */ +export declare interface MinKeyExtended { + $minKey: 1; +} + +/** + * A class representation of the BSON ObjectId type. + * @public + * @category BSONType + */ +declare class ObjectId { + _bsontype: 'ObjectID'; + /* Excluded from this release type: index */ + static cacheHexString: boolean; + /* Excluded from this release type: [kId] */ + /* Excluded from this release type: __id */ + /** + * Create an ObjectId type + * + * @param inputId - Can be a 24 character hex string, 12 byte binary Buffer, or a number. + */ + constructor(inputId?: string | number | ObjectId | ObjectIdLike | Buffer | Uint8Array); + /** + * The ObjectId bytes + * @readonly + */ + get id(): Buffer; + set id(value: Buffer); + /** + * The generation time of this ObjectId instance + * @deprecated Please use getTimestamp / createFromTime which returns an int32 epoch + */ + get generationTime(): number; + set generationTime(value: number); + /** Returns the ObjectId id as a 24 character hex string representation */ + toHexString(): string; + /* Excluded from this release type: getInc */ + /** + * Generate a 12 byte id buffer used in ObjectId's + * + * @param time - pass in a second based timestamp. + */ + static generate(time?: number): Buffer; + /** + * Converts the id into a 24 character hex string for printing + * + * @param format - The Buffer toString format parameter. + */ + toString(format?: string): string; + /** Converts to its JSON the 24 character hex string representation. */ + toJSON(): string; + /** + * Compares the equality of this ObjectId with `otherID`. + * + * @param otherId - ObjectId instance to compare against. + */ + equals(otherId: string | ObjectId | ObjectIdLike): boolean; + /** Returns the generation date (accurate up to the second) that this ID was generated. */ + getTimestamp(): Date; + /* Excluded from this release type: createPk */ + /** + * Creates an ObjectId from a second based number, with the rest of the ObjectId zeroed out. Used for comparisons or sorting the ObjectId. + * + * @param time - an integer number representing a number of seconds. + */ + static createFromTime(time: number): ObjectId; + /** + * Creates an ObjectId from a hex string representation of an ObjectId. + * + * @param hexString - create a ObjectId from a passed in 24 character hexstring. + */ + static createFromHexString(hexString: string): ObjectId; + /** + * Checks if a value is a valid bson ObjectId + * + * @param id - ObjectId instance to validate. + */ + static isValid(id: string | number | ObjectId | ObjectIdLike | Buffer | Uint8Array): boolean; + /* Excluded from this release type: toExtendedJSON */ + /* Excluded from this release type: fromExtendedJSON */ + inspect(): string; +} +export { ObjectId as ObjectID } +export { ObjectId } + +/** @public */ +export declare interface ObjectIdExtended { + $oid: string; +} + +/** @public */ +export declare interface ObjectIdLike { + id: string | Buffer; + __id?: string; + toHexString(): string; +} + +/** + * Serialize a Javascript object. + * + * @param object - the Javascript object to serialize. + * @returns Buffer object containing the serialized object. + * @public + */ +export declare function serialize(object: Document, options?: SerializeOptions): Buffer; + +/** @public */ +export declare interface SerializeOptions { + /** the serializer will check if keys are valid. */ + checkKeys?: boolean; + /** serialize the javascript functions **(default:false)**. */ + serializeFunctions?: boolean; + /** serialize will not emit undefined fields **(default:true)** */ + ignoreUndefined?: boolean; + /* Excluded from this release type: minInternalBufferSize */ + /** the index in the buffer where we wish to start serializing into */ + index?: number; +} + +/** + * Serialize a Javascript object using a predefined Buffer and index into the buffer, + * useful when pre-allocating the space for serialization. + * + * @param object - the Javascript object to serialize. + * @param finalBuffer - the Buffer you pre-allocated to store the serialized BSON object. + * @returns the index pointing to the last written byte in the buffer. + * @public + */ +export declare function serializeWithBufferAndIndex(object: Document, finalBuffer: Buffer, options?: SerializeOptions): number; + +/** + * Sets the size of the internal serialization buffer. + * + * @param size - The desired size for the internal serialization buffer + * @public + */ +export declare function setInternalBufferSize(size: number): void; + +/** + * @public + * @category BSONType + * */ +export declare class Timestamp extends LongWithoutOverridesClass { + _bsontype: 'Timestamp'; + static readonly MAX_VALUE: Long; + /** + * @param low - A 64-bit Long representing the Timestamp. + */ + constructor(long: Long); + /** + * @param value - A pair of two values indicating timestamp and increment. + */ + constructor(value: { + t: number; + i: number; + }); + /** + * @param low - the low (signed) 32 bits of the Timestamp. + * @param high - the high (signed) 32 bits of the Timestamp. + * @deprecated Please use `Timestamp({ t: high, i: low })` or `Timestamp(Long(low, high))` instead. + */ + constructor(low: number, high: number); + toJSON(): { + $timestamp: string; + }; + /** Returns a Timestamp represented by the given (32-bit) integer value. */ + static fromInt(value: number): Timestamp; + /** Returns a Timestamp representing the given number value, provided that it is a finite number. Otherwise, zero is returned. */ + static fromNumber(value: number): Timestamp; + /** + * Returns a Timestamp for the given high and low bits. Each is assumed to use 32 bits. + * + * @param lowBits - the low 32-bits. + * @param highBits - the high 32-bits. + */ + static fromBits(lowBits: number, highBits: number): Timestamp; + /** + * Returns a Timestamp from the given string, optionally using the given radix. + * + * @param str - the textual representation of the Timestamp. + * @param optRadix - the radix in which the text is written. + */ + static fromString(str: string, optRadix: number): Timestamp; + /* Excluded from this release type: toExtendedJSON */ + /* Excluded from this release type: fromExtendedJSON */ + inspect(): string; +} + +/** @public */ +export declare interface TimestampExtended { + $timestamp: { + t: number; + i: number; + }; +} + +/** @public */ +export declare type TimestampOverrides = '_bsontype' | 'toExtendedJSON' | 'fromExtendedJSON' | 'inspect'; + +/** + * A class representation of the BSON UUID type. + * @public + */ +export declare class UUID { + _bsontype: 'UUID'; + static cacheHexString: boolean; + /* Excluded from this release type: [kId] */ + /* Excluded from this release type: __id */ + /** + * Create an UUID type + * + * @param input - Can be a 32 or 36 character hex string (dashes excluded/included) or a 16 byte binary Buffer. + */ + constructor(input?: string | Buffer | UUID); + /** + * The UUID bytes + * @readonly + */ + get id(): Buffer; + set id(value: Buffer); + /** + * Generate a 16 byte uuid v4 buffer used in UUIDs + */ + /** + * Returns the UUID id as a 32 or 36 character hex string representation, excluding/including dashes (defaults to 36 character dash separated) + * @param includeDashes - should the string exclude dash-separators. + * */ + toHexString(includeDashes?: boolean): string; + /** + * Converts the id into a 36 character (dashes included) hex string, unless a encoding is specified. + */ + toString(encoding?: string): string; + /** + * Converts the id into its JSON string representation. + * A 36 character (dashes included) hex string in the format: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx + */ + toJSON(): string; + /** + * Compares the equality of this UUID with `otherID`. + * + * @param otherId - UUID instance to compare against. + */ + equals(otherId: string | Buffer | UUID): boolean; + /** + * Creates a Binary instance from the current UUID. + */ + toBinary(): Binary; + /** + * Generates a populated buffer containing a v4 uuid + */ + static generate(): Buffer; + /** + * Checks if a value is a valid bson UUID + * @param input - UUID, string or Buffer to validate. + */ + static isValid(input: string | Buffer | UUID): boolean; + /** + * Creates an UUID from a hex string representation of an UUID. + * @param hexString - 32 or 36 character hex string (dashes excluded/included). + */ + static createFromHexString(hexString: string): UUID; + inspect(): string; +} + +/** @public */ +export declare type UUIDExtended = { + $uuid: string; +}; + +export { } diff --git a/node_modules/bson/dist/bson.browser.esm.js b/node_modules/bson/dist/bson.browser.esm.js new file mode 100644 index 000000000..df25ae15f --- /dev/null +++ b/node_modules/bson/dist/bson.browser.esm.js @@ -0,0 +1,7519 @@ +function createCommonjsModule(fn, module) { + return module = { exports: {} }, fn(module, module.exports), module.exports; +} + +var byteLength_1 = byteLength; +var toByteArray_1 = toByteArray; +var fromByteArray_1 = fromByteArray; +var lookup = []; +var revLookup = []; +var Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array; +var code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; + +for (var i = 0, len = code.length; i < len; ++i) { + lookup[i] = code[i]; + revLookup[code.charCodeAt(i)] = i; +} // Support decoding URL-safe base64 strings, as Node.js does. +// See: https://en.wikipedia.org/wiki/Base64#URL_applications + + +revLookup['-'.charCodeAt(0)] = 62; +revLookup['_'.charCodeAt(0)] = 63; + +function getLens(b64) { + var len = b64.length; + + if (len % 4 > 0) { + throw new Error('Invalid string. Length must be a multiple of 4'); + } // Trim off extra bytes after placeholder bytes are found + // See: https://github.com/beatgammit/base64-js/issues/42 + + + var validLen = b64.indexOf('='); + if (validLen === -1) validLen = len; + var placeHoldersLen = validLen === len ? 0 : 4 - validLen % 4; + return [validLen, placeHoldersLen]; +} // base64 is 4/3 + up to two characters of the original data + + +function byteLength(b64) { + var lens = getLens(b64); + var validLen = lens[0]; + var placeHoldersLen = lens[1]; + return (validLen + placeHoldersLen) * 3 / 4 - placeHoldersLen; +} + +function _byteLength(b64, validLen, placeHoldersLen) { + return (validLen + placeHoldersLen) * 3 / 4 - placeHoldersLen; +} + +function toByteArray(b64) { + var tmp; + var lens = getLens(b64); + var validLen = lens[0]; + var placeHoldersLen = lens[1]; + var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen)); + var curByte = 0; // if there are placeholders, only get up to the last complete 4 chars + + var len = placeHoldersLen > 0 ? validLen - 4 : validLen; + var i; + + for (i = 0; i < len; i += 4) { + tmp = revLookup[b64.charCodeAt(i)] << 18 | revLookup[b64.charCodeAt(i + 1)] << 12 | revLookup[b64.charCodeAt(i + 2)] << 6 | revLookup[b64.charCodeAt(i + 3)]; + arr[curByte++] = tmp >> 16 & 0xFF; + arr[curByte++] = tmp >> 8 & 0xFF; + arr[curByte++] = tmp & 0xFF; + } + + if (placeHoldersLen === 2) { + tmp = revLookup[b64.charCodeAt(i)] << 2 | revLookup[b64.charCodeAt(i + 1)] >> 4; + arr[curByte++] = tmp & 0xFF; + } + + if (placeHoldersLen === 1) { + tmp = revLookup[b64.charCodeAt(i)] << 10 | revLookup[b64.charCodeAt(i + 1)] << 4 | revLookup[b64.charCodeAt(i + 2)] >> 2; + arr[curByte++] = tmp >> 8 & 0xFF; + arr[curByte++] = tmp & 0xFF; + } + + return arr; +} + +function tripletToBase64(num) { + return lookup[num >> 18 & 0x3F] + lookup[num >> 12 & 0x3F] + lookup[num >> 6 & 0x3F] + lookup[num & 0x3F]; +} + +function encodeChunk(uint8, start, end) { + var tmp; + var output = []; + + for (var i = start; i < end; i += 3) { + tmp = (uint8[i] << 16 & 0xFF0000) + (uint8[i + 1] << 8 & 0xFF00) + (uint8[i + 2] & 0xFF); + output.push(tripletToBase64(tmp)); + } + + return output.join(''); +} + +function fromByteArray(uint8) { + var tmp; + var len = uint8.length; + var extraBytes = len % 3; // if we have 1 byte left, pad 2 bytes + + var parts = []; + var maxChunkLength = 16383; // must be multiple of 3 + // go through the array every three bytes, we'll deal with trailing stuff later + + for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) { + parts.push(encodeChunk(uint8, i, i + maxChunkLength > len2 ? len2 : i + maxChunkLength)); + } // pad the end with zeros, but make sure to not forget the extra bytes + + + if (extraBytes === 1) { + tmp = uint8[len - 1]; + parts.push(lookup[tmp >> 2] + lookup[tmp << 4 & 0x3F] + '=='); + } else if (extraBytes === 2) { + tmp = (uint8[len - 2] << 8) + uint8[len - 1]; + parts.push(lookup[tmp >> 10] + lookup[tmp >> 4 & 0x3F] + lookup[tmp << 2 & 0x3F] + '='); + } + + return parts.join(''); +} + +var base64Js = { + byteLength: byteLength_1, + toByteArray: toByteArray_1, + fromByteArray: fromByteArray_1 +}; + +/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */ +var read = function read(buffer, offset, isLE, mLen, nBytes) { + var e, m; + var eLen = nBytes * 8 - mLen - 1; + var eMax = (1 << eLen) - 1; + var eBias = eMax >> 1; + var nBits = -7; + var i = isLE ? nBytes - 1 : 0; + var d = isLE ? -1 : 1; + var s = buffer[offset + i]; + i += d; + e = s & (1 << -nBits) - 1; + s >>= -nBits; + nBits += eLen; + + for (; nBits > 0; e = e * 256 + buffer[offset + i], i += d, nBits -= 8) {} + + m = e & (1 << -nBits) - 1; + e >>= -nBits; + nBits += mLen; + + for (; nBits > 0; m = m * 256 + buffer[offset + i], i += d, nBits -= 8) {} + + if (e === 0) { + e = 1 - eBias; + } else if (e === eMax) { + return m ? NaN : (s ? -1 : 1) * Infinity; + } else { + m = m + Math.pow(2, mLen); + e = e - eBias; + } + + return (s ? -1 : 1) * m * Math.pow(2, e - mLen); +}; + +var write = function write(buffer, value, offset, isLE, mLen, nBytes) { + var e, m, c; + var eLen = nBytes * 8 - mLen - 1; + var eMax = (1 << eLen) - 1; + var eBias = eMax >> 1; + var rt = mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0; + var i = isLE ? 0 : nBytes - 1; + var d = isLE ? 1 : -1; + var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0; + value = Math.abs(value); + + if (isNaN(value) || value === Infinity) { + m = isNaN(value) ? 1 : 0; + e = eMax; + } else { + e = Math.floor(Math.log(value) / Math.LN2); + + if (value * (c = Math.pow(2, -e)) < 1) { + e--; + c *= 2; + } + + if (e + eBias >= 1) { + value += rt / c; + } else { + value += rt * Math.pow(2, 1 - eBias); + } + + if (value * c >= 2) { + e++; + c /= 2; + } + + if (e + eBias >= eMax) { + m = 0; + e = eMax; + } else if (e + eBias >= 1) { + m = (value * c - 1) * Math.pow(2, mLen); + e = e + eBias; + } else { + m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen); + e = 0; + } + } + + for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {} + + e = e << mLen | m; + eLen += mLen; + + for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {} + + buffer[offset + i - d] |= s * 128; +}; + +var ieee754 = { + read: read, + write: write +}; + +var buffer$1 = createCommonjsModule(function (module, exports) { + + var customInspectSymbol = typeof Symbol === 'function' && typeof Symbol['for'] === 'function' ? // eslint-disable-line dot-notation + Symbol['for']('nodejs.util.inspect.custom') // eslint-disable-line dot-notation + : null; + exports.Buffer = Buffer; + exports.SlowBuffer = SlowBuffer; + exports.INSPECT_MAX_BYTES = 50; + var K_MAX_LENGTH = 0x7fffffff; + exports.kMaxLength = K_MAX_LENGTH; + /** + * If `Buffer.TYPED_ARRAY_SUPPORT`: + * === true Use Uint8Array implementation (fastest) + * === false Print warning and recommend using `buffer` v4.x which has an Object + * implementation (most compatible, even IE6) + * + * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+, + * Opera 11.6+, iOS 4.2+. + * + * We report that the browser does not support typed arrays if the are not subclassable + * using __proto__. Firefox 4-29 lacks support for adding new properties to `Uint8Array` + * (See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438). IE 10 lacks support + * for __proto__ and has a buggy typed array implementation. + */ + + Buffer.TYPED_ARRAY_SUPPORT = typedArraySupport(); + + if (!Buffer.TYPED_ARRAY_SUPPORT && typeof console !== 'undefined' && typeof console.error === 'function') { + console.error('This browser lacks typed array (Uint8Array) support which is required by ' + '`buffer` v5.x. Use `buffer` v4.x if you require old browser support.'); + } + + function typedArraySupport() { + // Can typed array instances can be augmented? + try { + var arr = new Uint8Array(1); + var proto = { + foo: function foo() { + return 42; + } + }; + Object.setPrototypeOf(proto, Uint8Array.prototype); + Object.setPrototypeOf(arr, proto); + return arr.foo() === 42; + } catch (e) { + return false; + } + } + + Object.defineProperty(Buffer.prototype, 'parent', { + enumerable: true, + get: function get() { + if (!Buffer.isBuffer(this)) return undefined; + return this.buffer; + } + }); + Object.defineProperty(Buffer.prototype, 'offset', { + enumerable: true, + get: function get() { + if (!Buffer.isBuffer(this)) return undefined; + return this.byteOffset; + } + }); + + function createBuffer(length) { + if (length > K_MAX_LENGTH) { + throw new RangeError('The value "' + length + '" is invalid for option "size"'); + } // Return an augmented `Uint8Array` instance + + + var buf = new Uint8Array(length); + Object.setPrototypeOf(buf, Buffer.prototype); + return buf; + } + /** + * The Buffer constructor returns instances of `Uint8Array` that have their + * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of + * `Uint8Array`, so the returned instances will have all the node `Buffer` methods + * and the `Uint8Array` methods. Square bracket notation works as expected -- it + * returns a single octet. + * + * The `Uint8Array` prototype remains unmodified. + */ + + + function Buffer(arg, encodingOrOffset, length) { + // Common case. + if (typeof arg === 'number') { + if (typeof encodingOrOffset === 'string') { + throw new TypeError('The "string" argument must be of type string. Received type number'); + } + + return allocUnsafe(arg); + } + + return from(arg, encodingOrOffset, length); + } + + Buffer.poolSize = 8192; // not used by this implementation + + function from(value, encodingOrOffset, length) { + if (typeof value === 'string') { + return fromString(value, encodingOrOffset); + } + + if (ArrayBuffer.isView(value)) { + return fromArrayView(value); + } + + if (value == null) { + throw new TypeError('The first argument must be one of type string, Buffer, ArrayBuffer, Array, ' + 'or Array-like Object. Received type ' + babelHelpers["typeof"](value)); + } + + if (isInstance(value, ArrayBuffer) || value && isInstance(value.buffer, ArrayBuffer)) { + return fromArrayBuffer(value, encodingOrOffset, length); + } + + if (typeof SharedArrayBuffer !== 'undefined' && (isInstance(value, SharedArrayBuffer) || value && isInstance(value.buffer, SharedArrayBuffer))) { + return fromArrayBuffer(value, encodingOrOffset, length); + } + + if (typeof value === 'number') { + throw new TypeError('The "value" argument must not be of type number. Received type number'); + } + + var valueOf = value.valueOf && value.valueOf(); + + if (valueOf != null && valueOf !== value) { + return Buffer.from(valueOf, encodingOrOffset, length); + } + + var b = fromObject(value); + if (b) return b; + + if (typeof Symbol !== 'undefined' && Symbol.toPrimitive != null && typeof value[Symbol.toPrimitive] === 'function') { + return Buffer.from(value[Symbol.toPrimitive]('string'), encodingOrOffset, length); + } + + throw new TypeError('The first argument must be one of type string, Buffer, ArrayBuffer, Array, ' + 'or Array-like Object. Received type ' + babelHelpers["typeof"](value)); + } + /** + * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError + * if value is a number. + * Buffer.from(str[, encoding]) + * Buffer.from(array) + * Buffer.from(buffer) + * Buffer.from(arrayBuffer[, byteOffset[, length]]) + **/ + + + Buffer.from = function (value, encodingOrOffset, length) { + return from(value, encodingOrOffset, length); + }; // Note: Change prototype *after* Buffer.from is defined to workaround Chrome bug: + // https://github.com/feross/buffer/pull/148 + + + Object.setPrototypeOf(Buffer.prototype, Uint8Array.prototype); + Object.setPrototypeOf(Buffer, Uint8Array); + + function assertSize(size) { + if (typeof size !== 'number') { + throw new TypeError('"size" argument must be of type number'); + } else if (size < 0) { + throw new RangeError('The value "' + size + '" is invalid for option "size"'); + } + } + + function alloc(size, fill, encoding) { + assertSize(size); + + if (size <= 0) { + return createBuffer(size); + } + + if (fill !== undefined) { + // Only pay attention to encoding if it's a string. This + // prevents accidentally sending in a number that would + // be interpreted as a start offset. + return typeof encoding === 'string' ? createBuffer(size).fill(fill, encoding) : createBuffer(size).fill(fill); + } + + return createBuffer(size); + } + /** + * Creates a new filled Buffer instance. + * alloc(size[, fill[, encoding]]) + **/ + + + Buffer.alloc = function (size, fill, encoding) { + return alloc(size, fill, encoding); + }; + + function allocUnsafe(size) { + assertSize(size); + return createBuffer(size < 0 ? 0 : checked(size) | 0); + } + /** + * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance. + * */ + + + Buffer.allocUnsafe = function (size) { + return allocUnsafe(size); + }; + /** + * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. + */ + + + Buffer.allocUnsafeSlow = function (size) { + return allocUnsafe(size); + }; + + function fromString(string, encoding) { + if (typeof encoding !== 'string' || encoding === '') { + encoding = 'utf8'; + } + + if (!Buffer.isEncoding(encoding)) { + throw new TypeError('Unknown encoding: ' + encoding); + } + + var length = byteLength(string, encoding) | 0; + var buf = createBuffer(length); + var actual = buf.write(string, encoding); + + if (actual !== length) { + // Writing a hex string, for example, that contains invalid characters will + // cause everything after the first invalid character to be ignored. (e.g. + // 'abxxcd' will be treated as 'ab') + buf = buf.slice(0, actual); + } + + return buf; + } + + function fromArrayLike(array) { + var length = array.length < 0 ? 0 : checked(array.length) | 0; + var buf = createBuffer(length); + + for (var i = 0; i < length; i += 1) { + buf[i] = array[i] & 255; + } + + return buf; + } + + function fromArrayView(arrayView) { + if (isInstance(arrayView, Uint8Array)) { + var copy = new Uint8Array(arrayView); + return fromArrayBuffer(copy.buffer, copy.byteOffset, copy.byteLength); + } + + return fromArrayLike(arrayView); + } + + function fromArrayBuffer(array, byteOffset, length) { + if (byteOffset < 0 || array.byteLength < byteOffset) { + throw new RangeError('"offset" is outside of buffer bounds'); + } + + if (array.byteLength < byteOffset + (length || 0)) { + throw new RangeError('"length" is outside of buffer bounds'); + } + + var buf; + + if (byteOffset === undefined && length === undefined) { + buf = new Uint8Array(array); + } else if (length === undefined) { + buf = new Uint8Array(array, byteOffset); + } else { + buf = new Uint8Array(array, byteOffset, length); + } // Return an augmented `Uint8Array` instance + + + Object.setPrototypeOf(buf, Buffer.prototype); + return buf; + } + + function fromObject(obj) { + if (Buffer.isBuffer(obj)) { + var len = checked(obj.length) | 0; + var buf = createBuffer(len); + + if (buf.length === 0) { + return buf; + } + + obj.copy(buf, 0, 0, len); + return buf; + } + + if (obj.length !== undefined) { + if (typeof obj.length !== 'number' || numberIsNaN(obj.length)) { + return createBuffer(0); + } + + return fromArrayLike(obj); + } + + if (obj.type === 'Buffer' && Array.isArray(obj.data)) { + return fromArrayLike(obj.data); + } + } + + function checked(length) { + // Note: cannot use `length < K_MAX_LENGTH` here because that fails when + // length is NaN (which is otherwise coerced to zero.) + if (length >= K_MAX_LENGTH) { + throw new RangeError('Attempt to allocate Buffer larger than maximum ' + 'size: 0x' + K_MAX_LENGTH.toString(16) + ' bytes'); + } + + return length | 0; + } + + function SlowBuffer(length) { + if (+length != length) { + // eslint-disable-line eqeqeq + length = 0; + } + + return Buffer.alloc(+length); + } + + Buffer.isBuffer = function isBuffer(b) { + return b != null && b._isBuffer === true && b !== Buffer.prototype; // so Buffer.isBuffer(Buffer.prototype) will be false + }; + + Buffer.compare = function compare(a, b) { + if (isInstance(a, Uint8Array)) a = Buffer.from(a, a.offset, a.byteLength); + if (isInstance(b, Uint8Array)) b = Buffer.from(b, b.offset, b.byteLength); + + if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) { + throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array'); + } + + if (a === b) return 0; + var x = a.length; + var y = b.length; + + for (var i = 0, len = Math.min(x, y); i < len; ++i) { + if (a[i] !== b[i]) { + x = a[i]; + y = b[i]; + break; + } + } + + if (x < y) return -1; + if (y < x) return 1; + return 0; + }; + + Buffer.isEncoding = function isEncoding(encoding) { + switch (String(encoding).toLowerCase()) { + case 'hex': + case 'utf8': + case 'utf-8': + case 'ascii': + case 'latin1': + case 'binary': + case 'base64': + case 'ucs2': + case 'ucs-2': + case 'utf16le': + case 'utf-16le': + return true; + + default: + return false; + } + }; + + Buffer.concat = function concat(list, length) { + if (!Array.isArray(list)) { + throw new TypeError('"list" argument must be an Array of Buffers'); + } + + if (list.length === 0) { + return Buffer.alloc(0); + } + + var i; + + if (length === undefined) { + length = 0; + + for (i = 0; i < list.length; ++i) { + length += list[i].length; + } + } + + var buffer = Buffer.allocUnsafe(length); + var pos = 0; + + for (i = 0; i < list.length; ++i) { + var buf = list[i]; + + if (isInstance(buf, Uint8Array)) { + if (pos + buf.length > buffer.length) { + Buffer.from(buf).copy(buffer, pos); + } else { + Uint8Array.prototype.set.call(buffer, buf, pos); + } + } else if (!Buffer.isBuffer(buf)) { + throw new TypeError('"list" argument must be an Array of Buffers'); + } else { + buf.copy(buffer, pos); + } + + pos += buf.length; + } + + return buffer; + }; + + function byteLength(string, encoding) { + if (Buffer.isBuffer(string)) { + return string.length; + } + + if (ArrayBuffer.isView(string) || isInstance(string, ArrayBuffer)) { + return string.byteLength; + } + + if (typeof string !== 'string') { + throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. ' + 'Received type ' + babelHelpers["typeof"](string)); + } + + var len = string.length; + var mustMatch = arguments.length > 2 && arguments[2] === true; + if (!mustMatch && len === 0) return 0; // Use a for loop to avoid recursion + + var loweredCase = false; + + for (;;) { + switch (encoding) { + case 'ascii': + case 'latin1': + case 'binary': + return len; + + case 'utf8': + case 'utf-8': + return utf8ToBytes(string).length; + + case 'ucs2': + case 'ucs-2': + case 'utf16le': + case 'utf-16le': + return len * 2; + + case 'hex': + return len >>> 1; + + case 'base64': + return base64ToBytes(string).length; + + default: + if (loweredCase) { + return mustMatch ? -1 : utf8ToBytes(string).length; // assume utf8 + } + + encoding = ('' + encoding).toLowerCase(); + loweredCase = true; + } + } + } + + Buffer.byteLength = byteLength; + + function slowToString(encoding, start, end) { + var loweredCase = false; // No need to verify that "this.length <= MAX_UINT32" since it's a read-only + // property of a typed array. + // This behaves neither like String nor Uint8Array in that we set start/end + // to their upper/lower bounds if the value passed is out of range. + // undefined is handled specially as per ECMA-262 6th Edition, + // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization. + + if (start === undefined || start < 0) { + start = 0; + } // Return early if start > this.length. Done here to prevent potential uint32 + // coercion fail below. + + + if (start > this.length) { + return ''; + } + + if (end === undefined || end > this.length) { + end = this.length; + } + + if (end <= 0) { + return ''; + } // Force coercion to uint32. This will also coerce falsey/NaN values to 0. + + + end >>>= 0; + start >>>= 0; + + if (end <= start) { + return ''; + } + + if (!encoding) encoding = 'utf8'; + + while (true) { + switch (encoding) { + case 'hex': + return hexSlice(this, start, end); + + case 'utf8': + case 'utf-8': + return utf8Slice(this, start, end); + + case 'ascii': + return asciiSlice(this, start, end); + + case 'latin1': + case 'binary': + return latin1Slice(this, start, end); + + case 'base64': + return base64Slice(this, start, end); + + case 'ucs2': + case 'ucs-2': + case 'utf16le': + case 'utf-16le': + return utf16leSlice(this, start, end); + + default: + if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding); + encoding = (encoding + '').toLowerCase(); + loweredCase = true; + } + } + } // This property is used by `Buffer.isBuffer` (and the `is-buffer` npm package) + // to detect a Buffer instance. It's not possible to use `instanceof Buffer` + // reliably in a browserify context because there could be multiple different + // copies of the 'buffer' package in use. This method works even for Buffer + // instances that were created from another copy of the `buffer` package. + // See: https://github.com/feross/buffer/issues/154 + + + Buffer.prototype._isBuffer = true; + + function swap(b, n, m) { + var i = b[n]; + b[n] = b[m]; + b[m] = i; + } + + Buffer.prototype.swap16 = function swap16() { + var len = this.length; + + if (len % 2 !== 0) { + throw new RangeError('Buffer size must be a multiple of 16-bits'); + } + + for (var i = 0; i < len; i += 2) { + swap(this, i, i + 1); + } + + return this; + }; + + Buffer.prototype.swap32 = function swap32() { + var len = this.length; + + if (len % 4 !== 0) { + throw new RangeError('Buffer size must be a multiple of 32-bits'); + } + + for (var i = 0; i < len; i += 4) { + swap(this, i, i + 3); + swap(this, i + 1, i + 2); + } + + return this; + }; + + Buffer.prototype.swap64 = function swap64() { + var len = this.length; + + if (len % 8 !== 0) { + throw new RangeError('Buffer size must be a multiple of 64-bits'); + } + + for (var i = 0; i < len; i += 8) { + swap(this, i, i + 7); + swap(this, i + 1, i + 6); + swap(this, i + 2, i + 5); + swap(this, i + 3, i + 4); + } + + return this; + }; + + Buffer.prototype.toString = function toString() { + var length = this.length; + if (length === 0) return ''; + if (arguments.length === 0) return utf8Slice(this, 0, length); + return slowToString.apply(this, arguments); + }; + + Buffer.prototype.toLocaleString = Buffer.prototype.toString; + + Buffer.prototype.equals = function equals(b) { + if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer'); + if (this === b) return true; + return Buffer.compare(this, b) === 0; + }; + + Buffer.prototype.inspect = function inspect() { + var str = ''; + var max = exports.INSPECT_MAX_BYTES; + str = this.toString('hex', 0, max).replace(/(.{2})/g, '$1 ').trim(); + if (this.length > max) str += ' ... '; + return ''; + }; + + if (customInspectSymbol) { + Buffer.prototype[customInspectSymbol] = Buffer.prototype.inspect; + } + + Buffer.prototype.compare = function compare(target, start, end, thisStart, thisEnd) { + if (isInstance(target, Uint8Array)) { + target = Buffer.from(target, target.offset, target.byteLength); + } + + if (!Buffer.isBuffer(target)) { + throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. ' + 'Received type ' + babelHelpers["typeof"](target)); + } + + if (start === undefined) { + start = 0; + } + + if (end === undefined) { + end = target ? target.length : 0; + } + + if (thisStart === undefined) { + thisStart = 0; + } + + if (thisEnd === undefined) { + thisEnd = this.length; + } + + if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) { + throw new RangeError('out of range index'); + } + + if (thisStart >= thisEnd && start >= end) { + return 0; + } + + if (thisStart >= thisEnd) { + return -1; + } + + if (start >= end) { + return 1; + } + + start >>>= 0; + end >>>= 0; + thisStart >>>= 0; + thisEnd >>>= 0; + if (this === target) return 0; + var x = thisEnd - thisStart; + var y = end - start; + var len = Math.min(x, y); + var thisCopy = this.slice(thisStart, thisEnd); + var targetCopy = target.slice(start, end); + + for (var i = 0; i < len; ++i) { + if (thisCopy[i] !== targetCopy[i]) { + x = thisCopy[i]; + y = targetCopy[i]; + break; + } + } + + if (x < y) return -1; + if (y < x) return 1; + return 0; + }; // Finds either the first index of `val` in `buffer` at offset >= `byteOffset`, + // OR the last index of `val` in `buffer` at offset <= `byteOffset`. + // + // Arguments: + // - buffer - a Buffer to search + // - val - a string, Buffer, or number + // - byteOffset - an index into `buffer`; will be clamped to an int32 + // - encoding - an optional encoding, relevant is val is a string + // - dir - true for indexOf, false for lastIndexOf + + + function bidirectionalIndexOf(buffer, val, byteOffset, encoding, dir) { + // Empty buffer means no match + if (buffer.length === 0) return -1; // Normalize byteOffset + + if (typeof byteOffset === 'string') { + encoding = byteOffset; + byteOffset = 0; + } else if (byteOffset > 0x7fffffff) { + byteOffset = 0x7fffffff; + } else if (byteOffset < -0x80000000) { + byteOffset = -0x80000000; + } + + byteOffset = +byteOffset; // Coerce to Number. + + if (numberIsNaN(byteOffset)) { + // byteOffset: it it's undefined, null, NaN, "foo", etc, search whole buffer + byteOffset = dir ? 0 : buffer.length - 1; + } // Normalize byteOffset: negative offsets start from the end of the buffer + + + if (byteOffset < 0) byteOffset = buffer.length + byteOffset; + + if (byteOffset >= buffer.length) { + if (dir) return -1;else byteOffset = buffer.length - 1; + } else if (byteOffset < 0) { + if (dir) byteOffset = 0;else return -1; + } // Normalize val + + + if (typeof val === 'string') { + val = Buffer.from(val, encoding); + } // Finally, search either indexOf (if dir is true) or lastIndexOf + + + if (Buffer.isBuffer(val)) { + // Special case: looking for empty string/buffer always fails + if (val.length === 0) { + return -1; + } + + return arrayIndexOf(buffer, val, byteOffset, encoding, dir); + } else if (typeof val === 'number') { + val = val & 0xFF; // Search for a byte value [0-255] + + if (typeof Uint8Array.prototype.indexOf === 'function') { + if (dir) { + return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset); + } else { + return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset); + } + } + + return arrayIndexOf(buffer, [val], byteOffset, encoding, dir); + } + + throw new TypeError('val must be string, number or Buffer'); + } + + function arrayIndexOf(arr, val, byteOffset, encoding, dir) { + var indexSize = 1; + var arrLength = arr.length; + var valLength = val.length; + + if (encoding !== undefined) { + encoding = String(encoding).toLowerCase(); + + if (encoding === 'ucs2' || encoding === 'ucs-2' || encoding === 'utf16le' || encoding === 'utf-16le') { + if (arr.length < 2 || val.length < 2) { + return -1; + } + + indexSize = 2; + arrLength /= 2; + valLength /= 2; + byteOffset /= 2; + } + } + + function read(buf, i) { + if (indexSize === 1) { + return buf[i]; + } else { + return buf.readUInt16BE(i * indexSize); + } + } + + var i; + + if (dir) { + var foundIndex = -1; + + for (i = byteOffset; i < arrLength; i++) { + if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) { + if (foundIndex === -1) foundIndex = i; + if (i - foundIndex + 1 === valLength) return foundIndex * indexSize; + } else { + if (foundIndex !== -1) i -= i - foundIndex; + foundIndex = -1; + } + } + } else { + if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength; + + for (i = byteOffset; i >= 0; i--) { + var found = true; + + for (var j = 0; j < valLength; j++) { + if (read(arr, i + j) !== read(val, j)) { + found = false; + break; + } + } + + if (found) return i; + } + } + + return -1; + } + + Buffer.prototype.includes = function includes(val, byteOffset, encoding) { + return this.indexOf(val, byteOffset, encoding) !== -1; + }; + + Buffer.prototype.indexOf = function indexOf(val, byteOffset, encoding) { + return bidirectionalIndexOf(this, val, byteOffset, encoding, true); + }; + + Buffer.prototype.lastIndexOf = function lastIndexOf(val, byteOffset, encoding) { + return bidirectionalIndexOf(this, val, byteOffset, encoding, false); + }; + + function hexWrite(buf, string, offset, length) { + offset = Number(offset) || 0; + var remaining = buf.length - offset; + + if (!length) { + length = remaining; + } else { + length = Number(length); + + if (length > remaining) { + length = remaining; + } + } + + var strLen = string.length; + + if (length > strLen / 2) { + length = strLen / 2; + } + + for (var i = 0; i < length; ++i) { + var parsed = parseInt(string.substr(i * 2, 2), 16); + if (numberIsNaN(parsed)) return i; + buf[offset + i] = parsed; + } + + return i; + } + + function utf8Write(buf, string, offset, length) { + return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length); + } + + function asciiWrite(buf, string, offset, length) { + return blitBuffer(asciiToBytes(string), buf, offset, length); + } + + function base64Write(buf, string, offset, length) { + return blitBuffer(base64ToBytes(string), buf, offset, length); + } + + function ucs2Write(buf, string, offset, length) { + return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length); + } + + Buffer.prototype.write = function write(string, offset, length, encoding) { + // Buffer#write(string) + if (offset === undefined) { + encoding = 'utf8'; + length = this.length; + offset = 0; // Buffer#write(string, encoding) + } else if (length === undefined && typeof offset === 'string') { + encoding = offset; + length = this.length; + offset = 0; // Buffer#write(string, offset[, length][, encoding]) + } else if (isFinite(offset)) { + offset = offset >>> 0; + + if (isFinite(length)) { + length = length >>> 0; + if (encoding === undefined) encoding = 'utf8'; + } else { + encoding = length; + length = undefined; + } + } else { + throw new Error('Buffer.write(string, encoding, offset[, length]) is no longer supported'); + } + + var remaining = this.length - offset; + if (length === undefined || length > remaining) length = remaining; + + if (string.length > 0 && (length < 0 || offset < 0) || offset > this.length) { + throw new RangeError('Attempt to write outside buffer bounds'); + } + + if (!encoding) encoding = 'utf8'; + var loweredCase = false; + + for (;;) { + switch (encoding) { + case 'hex': + return hexWrite(this, string, offset, length); + + case 'utf8': + case 'utf-8': + return utf8Write(this, string, offset, length); + + case 'ascii': + case 'latin1': + case 'binary': + return asciiWrite(this, string, offset, length); + + case 'base64': + // Warning: maxLength not taken into account in base64Write + return base64Write(this, string, offset, length); + + case 'ucs2': + case 'ucs-2': + case 'utf16le': + case 'utf-16le': + return ucs2Write(this, string, offset, length); + + default: + if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding); + encoding = ('' + encoding).toLowerCase(); + loweredCase = true; + } + } + }; + + Buffer.prototype.toJSON = function toJSON() { + return { + type: 'Buffer', + data: Array.prototype.slice.call(this._arr || this, 0) + }; + }; + + function base64Slice(buf, start, end) { + if (start === 0 && end === buf.length) { + return base64Js.fromByteArray(buf); + } else { + return base64Js.fromByteArray(buf.slice(start, end)); + } + } + + function utf8Slice(buf, start, end) { + end = Math.min(buf.length, end); + var res = []; + var i = start; + + while (i < end) { + var firstByte = buf[i]; + var codePoint = null; + var bytesPerSequence = firstByte > 0xEF ? 4 : firstByte > 0xDF ? 3 : firstByte > 0xBF ? 2 : 1; + + if (i + bytesPerSequence <= end) { + var secondByte, thirdByte, fourthByte, tempCodePoint; + + switch (bytesPerSequence) { + case 1: + if (firstByte < 0x80) { + codePoint = firstByte; + } + + break; + + case 2: + secondByte = buf[i + 1]; + + if ((secondByte & 0xC0) === 0x80) { + tempCodePoint = (firstByte & 0x1F) << 0x6 | secondByte & 0x3F; + + if (tempCodePoint > 0x7F) { + codePoint = tempCodePoint; + } + } + + break; + + case 3: + secondByte = buf[i + 1]; + thirdByte = buf[i + 2]; + + if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) { + tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | thirdByte & 0x3F; + + if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) { + codePoint = tempCodePoint; + } + } + + break; + + case 4: + secondByte = buf[i + 1]; + thirdByte = buf[i + 2]; + fourthByte = buf[i + 3]; + + if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) { + tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | fourthByte & 0x3F; + + if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) { + codePoint = tempCodePoint; + } + } + + } + } + + if (codePoint === null) { + // we did not generate a valid codePoint so insert a + // replacement char (U+FFFD) and advance only 1 byte + codePoint = 0xFFFD; + bytesPerSequence = 1; + } else if (codePoint > 0xFFFF) { + // encode to utf16 (surrogate pair dance) + codePoint -= 0x10000; + res.push(codePoint >>> 10 & 0x3FF | 0xD800); + codePoint = 0xDC00 | codePoint & 0x3FF; + } + + res.push(codePoint); + i += bytesPerSequence; + } + + return decodeCodePointsArray(res); + } // Based on http://stackoverflow.com/a/22747272/680742, the browser with + // the lowest limit is Chrome, with 0x10000 args. + // We go 1 magnitude less, for safety + + + var MAX_ARGUMENTS_LENGTH = 0x1000; + + function decodeCodePointsArray(codePoints) { + var len = codePoints.length; + + if (len <= MAX_ARGUMENTS_LENGTH) { + return String.fromCharCode.apply(String, codePoints); // avoid extra slice() + } // Decode in chunks to avoid "call stack size exceeded". + + + var res = ''; + var i = 0; + + while (i < len) { + res += String.fromCharCode.apply(String, codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)); + } + + return res; + } + + function asciiSlice(buf, start, end) { + var ret = ''; + end = Math.min(buf.length, end); + + for (var i = start; i < end; ++i) { + ret += String.fromCharCode(buf[i] & 0x7F); + } + + return ret; + } + + function latin1Slice(buf, start, end) { + var ret = ''; + end = Math.min(buf.length, end); + + for (var i = start; i < end; ++i) { + ret += String.fromCharCode(buf[i]); + } + + return ret; + } + + function hexSlice(buf, start, end) { + var len = buf.length; + if (!start || start < 0) start = 0; + if (!end || end < 0 || end > len) end = len; + var out = ''; + + for (var i = start; i < end; ++i) { + out += hexSliceLookupTable[buf[i]]; + } + + return out; + } + + function utf16leSlice(buf, start, end) { + var bytes = buf.slice(start, end); + var res = ''; // If bytes.length is odd, the last 8 bits must be ignored (same as node.js) + + for (var i = 0; i < bytes.length - 1; i += 2) { + res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256); + } + + return res; + } + + Buffer.prototype.slice = function slice(start, end) { + var len = this.length; + start = ~~start; + end = end === undefined ? len : ~~end; + + if (start < 0) { + start += len; + if (start < 0) start = 0; + } else if (start > len) { + start = len; + } + + if (end < 0) { + end += len; + if (end < 0) end = 0; + } else if (end > len) { + end = len; + } + + if (end < start) end = start; + var newBuf = this.subarray(start, end); // Return an augmented `Uint8Array` instance + + Object.setPrototypeOf(newBuf, Buffer.prototype); + return newBuf; + }; + /* + * Need to make sure that buffer isn't trying to write out of bounds. + */ + + + function checkOffset(offset, ext, length) { + if (offset % 1 !== 0 || offset < 0) throw new RangeError('offset is not uint'); + if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length'); + } + + Buffer.prototype.readUintLE = Buffer.prototype.readUIntLE = function readUIntLE(offset, byteLength, noAssert) { + offset = offset >>> 0; + byteLength = byteLength >>> 0; + if (!noAssert) checkOffset(offset, byteLength, this.length); + var val = this[offset]; + var mul = 1; + var i = 0; + + while (++i < byteLength && (mul *= 0x100)) { + val += this[offset + i] * mul; + } + + return val; + }; + + Buffer.prototype.readUintBE = Buffer.prototype.readUIntBE = function readUIntBE(offset, byteLength, noAssert) { + offset = offset >>> 0; + byteLength = byteLength >>> 0; + + if (!noAssert) { + checkOffset(offset, byteLength, this.length); + } + + var val = this[offset + --byteLength]; + var mul = 1; + + while (byteLength > 0 && (mul *= 0x100)) { + val += this[offset + --byteLength] * mul; + } + + return val; + }; + + Buffer.prototype.readUint8 = Buffer.prototype.readUInt8 = function readUInt8(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 1, this.length); + return this[offset]; + }; + + Buffer.prototype.readUint16LE = Buffer.prototype.readUInt16LE = function readUInt16LE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 2, this.length); + return this[offset] | this[offset + 1] << 8; + }; + + Buffer.prototype.readUint16BE = Buffer.prototype.readUInt16BE = function readUInt16BE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 2, this.length); + return this[offset] << 8 | this[offset + 1]; + }; + + Buffer.prototype.readUint32LE = Buffer.prototype.readUInt32LE = function readUInt32LE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 4, this.length); + return (this[offset] | this[offset + 1] << 8 | this[offset + 2] << 16) + this[offset + 3] * 0x1000000; + }; + + Buffer.prototype.readUint32BE = Buffer.prototype.readUInt32BE = function readUInt32BE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 4, this.length); + return this[offset] * 0x1000000 + (this[offset + 1] << 16 | this[offset + 2] << 8 | this[offset + 3]); + }; + + Buffer.prototype.readIntLE = function readIntLE(offset, byteLength, noAssert) { + offset = offset >>> 0; + byteLength = byteLength >>> 0; + if (!noAssert) checkOffset(offset, byteLength, this.length); + var val = this[offset]; + var mul = 1; + var i = 0; + + while (++i < byteLength && (mul *= 0x100)) { + val += this[offset + i] * mul; + } + + mul *= 0x80; + if (val >= mul) val -= Math.pow(2, 8 * byteLength); + return val; + }; + + Buffer.prototype.readIntBE = function readIntBE(offset, byteLength, noAssert) { + offset = offset >>> 0; + byteLength = byteLength >>> 0; + if (!noAssert) checkOffset(offset, byteLength, this.length); + var i = byteLength; + var mul = 1; + var val = this[offset + --i]; + + while (i > 0 && (mul *= 0x100)) { + val += this[offset + --i] * mul; + } + + mul *= 0x80; + if (val >= mul) val -= Math.pow(2, 8 * byteLength); + return val; + }; + + Buffer.prototype.readInt8 = function readInt8(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 1, this.length); + if (!(this[offset] & 0x80)) return this[offset]; + return (0xff - this[offset] + 1) * -1; + }; + + Buffer.prototype.readInt16LE = function readInt16LE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 2, this.length); + var val = this[offset] | this[offset + 1] << 8; + return val & 0x8000 ? val | 0xFFFF0000 : val; + }; + + Buffer.prototype.readInt16BE = function readInt16BE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 2, this.length); + var val = this[offset + 1] | this[offset] << 8; + return val & 0x8000 ? val | 0xFFFF0000 : val; + }; + + Buffer.prototype.readInt32LE = function readInt32LE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 4, this.length); + return this[offset] | this[offset + 1] << 8 | this[offset + 2] << 16 | this[offset + 3] << 24; + }; + + Buffer.prototype.readInt32BE = function readInt32BE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 4, this.length); + return this[offset] << 24 | this[offset + 1] << 16 | this[offset + 2] << 8 | this[offset + 3]; + }; + + Buffer.prototype.readFloatLE = function readFloatLE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 4, this.length); + return ieee754.read(this, offset, true, 23, 4); + }; + + Buffer.prototype.readFloatBE = function readFloatBE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 4, this.length); + return ieee754.read(this, offset, false, 23, 4); + }; + + Buffer.prototype.readDoubleLE = function readDoubleLE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 8, this.length); + return ieee754.read(this, offset, true, 52, 8); + }; + + Buffer.prototype.readDoubleBE = function readDoubleBE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 8, this.length); + return ieee754.read(this, offset, false, 52, 8); + }; + + function checkInt(buf, value, offset, ext, max, min) { + if (!Buffer.isBuffer(buf)) throw new TypeError('"buffer" argument must be a Buffer instance'); + if (value > max || value < min) throw new RangeError('"value" argument is out of bounds'); + if (offset + ext > buf.length) throw new RangeError('Index out of range'); + } + + Buffer.prototype.writeUintLE = Buffer.prototype.writeUIntLE = function writeUIntLE(value, offset, byteLength, noAssert) { + value = +value; + offset = offset >>> 0; + byteLength = byteLength >>> 0; + + if (!noAssert) { + var maxBytes = Math.pow(2, 8 * byteLength) - 1; + checkInt(this, value, offset, byteLength, maxBytes, 0); + } + + var mul = 1; + var i = 0; + this[offset] = value & 0xFF; + + while (++i < byteLength && (mul *= 0x100)) { + this[offset + i] = value / mul & 0xFF; + } + + return offset + byteLength; + }; + + Buffer.prototype.writeUintBE = Buffer.prototype.writeUIntBE = function writeUIntBE(value, offset, byteLength, noAssert) { + value = +value; + offset = offset >>> 0; + byteLength = byteLength >>> 0; + + if (!noAssert) { + var maxBytes = Math.pow(2, 8 * byteLength) - 1; + checkInt(this, value, offset, byteLength, maxBytes, 0); + } + + var i = byteLength - 1; + var mul = 1; + this[offset + i] = value & 0xFF; + + while (--i >= 0 && (mul *= 0x100)) { + this[offset + i] = value / mul & 0xFF; + } + + return offset + byteLength; + }; + + Buffer.prototype.writeUint8 = Buffer.prototype.writeUInt8 = function writeUInt8(value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0); + this[offset] = value & 0xff; + return offset + 1; + }; + + Buffer.prototype.writeUint16LE = Buffer.prototype.writeUInt16LE = function writeUInt16LE(value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0); + this[offset] = value & 0xff; + this[offset + 1] = value >>> 8; + return offset + 2; + }; + + Buffer.prototype.writeUint16BE = Buffer.prototype.writeUInt16BE = function writeUInt16BE(value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0); + this[offset] = value >>> 8; + this[offset + 1] = value & 0xff; + return offset + 2; + }; + + Buffer.prototype.writeUint32LE = Buffer.prototype.writeUInt32LE = function writeUInt32LE(value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0); + this[offset + 3] = value >>> 24; + this[offset + 2] = value >>> 16; + this[offset + 1] = value >>> 8; + this[offset] = value & 0xff; + return offset + 4; + }; + + Buffer.prototype.writeUint32BE = Buffer.prototype.writeUInt32BE = function writeUInt32BE(value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0); + this[offset] = value >>> 24; + this[offset + 1] = value >>> 16; + this[offset + 2] = value >>> 8; + this[offset + 3] = value & 0xff; + return offset + 4; + }; + + Buffer.prototype.writeIntLE = function writeIntLE(value, offset, byteLength, noAssert) { + value = +value; + offset = offset >>> 0; + + if (!noAssert) { + var limit = Math.pow(2, 8 * byteLength - 1); + checkInt(this, value, offset, byteLength, limit - 1, -limit); + } + + var i = 0; + var mul = 1; + var sub = 0; + this[offset] = value & 0xFF; + + while (++i < byteLength && (mul *= 0x100)) { + if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) { + sub = 1; + } + + this[offset + i] = (value / mul >> 0) - sub & 0xFF; + } + + return offset + byteLength; + }; + + Buffer.prototype.writeIntBE = function writeIntBE(value, offset, byteLength, noAssert) { + value = +value; + offset = offset >>> 0; + + if (!noAssert) { + var limit = Math.pow(2, 8 * byteLength - 1); + checkInt(this, value, offset, byteLength, limit - 1, -limit); + } + + var i = byteLength - 1; + var mul = 1; + var sub = 0; + this[offset + i] = value & 0xFF; + + while (--i >= 0 && (mul *= 0x100)) { + if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) { + sub = 1; + } + + this[offset + i] = (value / mul >> 0) - sub & 0xFF; + } + + return offset + byteLength; + }; + + Buffer.prototype.writeInt8 = function writeInt8(value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80); + if (value < 0) value = 0xff + value + 1; + this[offset] = value & 0xff; + return offset + 1; + }; + + Buffer.prototype.writeInt16LE = function writeInt16LE(value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000); + this[offset] = value & 0xff; + this[offset + 1] = value >>> 8; + return offset + 2; + }; + + Buffer.prototype.writeInt16BE = function writeInt16BE(value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000); + this[offset] = value >>> 8; + this[offset + 1] = value & 0xff; + return offset + 2; + }; + + Buffer.prototype.writeInt32LE = function writeInt32LE(value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000); + this[offset] = value & 0xff; + this[offset + 1] = value >>> 8; + this[offset + 2] = value >>> 16; + this[offset + 3] = value >>> 24; + return offset + 4; + }; + + Buffer.prototype.writeInt32BE = function writeInt32BE(value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000); + if (value < 0) value = 0xffffffff + value + 1; + this[offset] = value >>> 24; + this[offset + 1] = value >>> 16; + this[offset + 2] = value >>> 8; + this[offset + 3] = value & 0xff; + return offset + 4; + }; + + function checkIEEE754(buf, value, offset, ext, max, min) { + if (offset + ext > buf.length) throw new RangeError('Index out of range'); + if (offset < 0) throw new RangeError('Index out of range'); + } + + function writeFloat(buf, value, offset, littleEndian, noAssert) { + value = +value; + offset = offset >>> 0; + + if (!noAssert) { + checkIEEE754(buf, value, offset, 4); + } + + ieee754.write(buf, value, offset, littleEndian, 23, 4); + return offset + 4; + } + + Buffer.prototype.writeFloatLE = function writeFloatLE(value, offset, noAssert) { + return writeFloat(this, value, offset, true, noAssert); + }; + + Buffer.prototype.writeFloatBE = function writeFloatBE(value, offset, noAssert) { + return writeFloat(this, value, offset, false, noAssert); + }; + + function writeDouble(buf, value, offset, littleEndian, noAssert) { + value = +value; + offset = offset >>> 0; + + if (!noAssert) { + checkIEEE754(buf, value, offset, 8); + } + + ieee754.write(buf, value, offset, littleEndian, 52, 8); + return offset + 8; + } + + Buffer.prototype.writeDoubleLE = function writeDoubleLE(value, offset, noAssert) { + return writeDouble(this, value, offset, true, noAssert); + }; + + Buffer.prototype.writeDoubleBE = function writeDoubleBE(value, offset, noAssert) { + return writeDouble(this, value, offset, false, noAssert); + }; // copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length) + + + Buffer.prototype.copy = function copy(target, targetStart, start, end) { + if (!Buffer.isBuffer(target)) throw new TypeError('argument should be a Buffer'); + if (!start) start = 0; + if (!end && end !== 0) end = this.length; + if (targetStart >= target.length) targetStart = target.length; + if (!targetStart) targetStart = 0; + if (end > 0 && end < start) end = start; // Copy 0 bytes; we're done + + if (end === start) return 0; + if (target.length === 0 || this.length === 0) return 0; // Fatal error conditions + + if (targetStart < 0) { + throw new RangeError('targetStart out of bounds'); + } + + if (start < 0 || start >= this.length) throw new RangeError('Index out of range'); + if (end < 0) throw new RangeError('sourceEnd out of bounds'); // Are we oob? + + if (end > this.length) end = this.length; + + if (target.length - targetStart < end - start) { + end = target.length - targetStart + start; + } + + var len = end - start; + + if (this === target && typeof Uint8Array.prototype.copyWithin === 'function') { + // Use built-in when available, missing from IE11 + this.copyWithin(targetStart, start, end); + } else { + Uint8Array.prototype.set.call(target, this.subarray(start, end), targetStart); + } + + return len; + }; // Usage: + // buffer.fill(number[, offset[, end]]) + // buffer.fill(buffer[, offset[, end]]) + // buffer.fill(string[, offset[, end]][, encoding]) + + + Buffer.prototype.fill = function fill(val, start, end, encoding) { + // Handle string cases: + if (typeof val === 'string') { + if (typeof start === 'string') { + encoding = start; + start = 0; + end = this.length; + } else if (typeof end === 'string') { + encoding = end; + end = this.length; + } + + if (encoding !== undefined && typeof encoding !== 'string') { + throw new TypeError('encoding must be a string'); + } + + if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) { + throw new TypeError('Unknown encoding: ' + encoding); + } + + if (val.length === 1) { + var code = val.charCodeAt(0); + + if (encoding === 'utf8' && code < 128 || encoding === 'latin1') { + // Fast path: If `val` fits into a single byte, use that numeric value. + val = code; + } + } + } else if (typeof val === 'number') { + val = val & 255; + } else if (typeof val === 'boolean') { + val = Number(val); + } // Invalid ranges are not set to a default, so can range check early. + + + if (start < 0 || this.length < start || this.length < end) { + throw new RangeError('Out of range index'); + } + + if (end <= start) { + return this; + } + + start = start >>> 0; + end = end === undefined ? this.length : end >>> 0; + if (!val) val = 0; + var i; + + if (typeof val === 'number') { + for (i = start; i < end; ++i) { + this[i] = val; + } + } else { + var bytes = Buffer.isBuffer(val) ? val : Buffer.from(val, encoding); + var len = bytes.length; + + if (len === 0) { + throw new TypeError('The value "' + val + '" is invalid for argument "value"'); + } + + for (i = 0; i < end - start; ++i) { + this[i + start] = bytes[i % len]; + } + } + + return this; + }; // HELPER FUNCTIONS + // ================ + + + var INVALID_BASE64_RE = /[^+/0-9A-Za-z-_]/g; + + function base64clean(str) { + // Node takes equal signs as end of the Base64 encoding + str = str.split('=')[0]; // Node strips out invalid characters like \n and \t from the string, base64-js does not + + str = str.trim().replace(INVALID_BASE64_RE, ''); // Node converts strings with length < 2 to '' + + if (str.length < 2) return ''; // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not + + while (str.length % 4 !== 0) { + str = str + '='; + } + + return str; + } + + function utf8ToBytes(string, units) { + units = units || Infinity; + var codePoint; + var length = string.length; + var leadSurrogate = null; + var bytes = []; + + for (var i = 0; i < length; ++i) { + codePoint = string.charCodeAt(i); // is surrogate component + + if (codePoint > 0xD7FF && codePoint < 0xE000) { + // last char was a lead + if (!leadSurrogate) { + // no lead yet + if (codePoint > 0xDBFF) { + // unexpected trail + if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD); + continue; + } else if (i + 1 === length) { + // unpaired lead + if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD); + continue; + } // valid lead + + + leadSurrogate = codePoint; + continue; + } // 2 leads in a row + + + if (codePoint < 0xDC00) { + if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD); + leadSurrogate = codePoint; + continue; + } // valid surrogate pair + + + codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000; + } else if (leadSurrogate) { + // valid bmp char, but last char was a lead + if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD); + } + + leadSurrogate = null; // encode utf8 + + if (codePoint < 0x80) { + if ((units -= 1) < 0) break; + bytes.push(codePoint); + } else if (codePoint < 0x800) { + if ((units -= 2) < 0) break; + bytes.push(codePoint >> 0x6 | 0xC0, codePoint & 0x3F | 0x80); + } else if (codePoint < 0x10000) { + if ((units -= 3) < 0) break; + bytes.push(codePoint >> 0xC | 0xE0, codePoint >> 0x6 & 0x3F | 0x80, codePoint & 0x3F | 0x80); + } else if (codePoint < 0x110000) { + if ((units -= 4) < 0) break; + bytes.push(codePoint >> 0x12 | 0xF0, codePoint >> 0xC & 0x3F | 0x80, codePoint >> 0x6 & 0x3F | 0x80, codePoint & 0x3F | 0x80); + } else { + throw new Error('Invalid code point'); + } + } + + return bytes; + } + + function asciiToBytes(str) { + var byteArray = []; + + for (var i = 0; i < str.length; ++i) { + // Node's code seems to be doing this and not & 0x7F.. + byteArray.push(str.charCodeAt(i) & 0xFF); + } + + return byteArray; + } + + function utf16leToBytes(str, units) { + var c, hi, lo; + var byteArray = []; + + for (var i = 0; i < str.length; ++i) { + if ((units -= 2) < 0) break; + c = str.charCodeAt(i); + hi = c >> 8; + lo = c % 256; + byteArray.push(lo); + byteArray.push(hi); + } + + return byteArray; + } + + function base64ToBytes(str) { + return base64Js.toByteArray(base64clean(str)); + } + + function blitBuffer(src, dst, offset, length) { + for (var i = 0; i < length; ++i) { + if (i + offset >= dst.length || i >= src.length) break; + dst[i + offset] = src[i]; + } + + return i; + } // ArrayBuffer or Uint8Array objects from other contexts (i.e. iframes) do not pass + // the `instanceof` check but they should be treated as of that type. + // See: https://github.com/feross/buffer/issues/166 + + + function isInstance(obj, type) { + return obj instanceof type || obj != null && obj.constructor != null && obj.constructor.name != null && obj.constructor.name === type.name; + } + + function numberIsNaN(obj) { + // For IE11 support + return obj !== obj; // eslint-disable-line no-self-compare + } // Create lookup table for `toString('hex')` + // See: https://github.com/feross/buffer/issues/219 + + + var hexSliceLookupTable = function () { + var alphabet = '0123456789abcdef'; + var table = new Array(256); + + for (var i = 0; i < 16; ++i) { + var i16 = i * 16; + + for (var j = 0; j < 16; ++j) { + table[i16 + j] = alphabet[i] + alphabet[j]; + } + } + + return table; + }(); +}); +var buffer_1 = buffer$1.Buffer; +buffer$1.SlowBuffer; +buffer$1.INSPECT_MAX_BYTES; +buffer$1.kMaxLength; + +/*! ***************************************************************************** +Copyright (c) Microsoft Corporation. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. +***************************************************************************** */ + +/* global Reflect, Promise */ +var _extendStatics = function extendStatics(d, b) { + _extendStatics = Object.setPrototypeOf || { + __proto__: [] + } instanceof Array && function (d, b) { + d.__proto__ = b; + } || function (d, b) { + for (var p in b) { + if (b.hasOwnProperty(p)) d[p] = b[p]; + } + }; + + return _extendStatics(d, b); +}; + +function __extends(d, b) { + _extendStatics(d, b); + + function __() { + this.constructor = d; + } + + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +} + +var _assign = function __assign() { + _assign = Object.assign || function __assign(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + + for (var p in s) { + if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; + } + } + + return t; + }; + + return _assign.apply(this, arguments); +}; + +/** @public */ +var BSONError = /** @class */ (function (_super) { + __extends(BSONError, _super); + function BSONError(message) { + var _this = _super.call(this, message) || this; + Object.setPrototypeOf(_this, BSONError.prototype); + return _this; + } + Object.defineProperty(BSONError.prototype, "name", { + get: function () { + return 'BSONError'; + }, + enumerable: false, + configurable: true + }); + return BSONError; +}(Error)); +/** @public */ +var BSONTypeError = /** @class */ (function (_super) { + __extends(BSONTypeError, _super); + function BSONTypeError(message) { + var _this = _super.call(this, message) || this; + Object.setPrototypeOf(_this, BSONTypeError.prototype); + return _this; + } + Object.defineProperty(BSONTypeError.prototype, "name", { + get: function () { + return 'BSONTypeError'; + }, + enumerable: false, + configurable: true + }); + return BSONTypeError; +}(TypeError)); + +function checkForMath(potentialGlobal) { + // eslint-disable-next-line eqeqeq + return potentialGlobal && potentialGlobal.Math == Math && potentialGlobal; +} +// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028 +function getGlobal() { + // eslint-disable-next-line no-undef + return (checkForMath(typeof globalThis === 'object' && globalThis) || + checkForMath(typeof window === 'object' && window) || + checkForMath(typeof self === 'object' && self) || + checkForMath(typeof global === 'object' && global) || + Function('return this')()); +} + +/** + * Normalizes our expected stringified form of a function across versions of node + * @param fn - The function to stringify + */ +function normalizedFunctionString(fn) { + return fn.toString().replace('function(', 'function ('); +} +function isReactNative() { + var g = getGlobal(); + return typeof g.navigator === 'object' && g.navigator.product === 'ReactNative'; +} +var insecureRandomBytes = function insecureRandomBytes(size) { + var insecureWarning = isReactNative() + ? 'BSON: For React Native please polyfill crypto.getRandomValues, e.g. using: https://www.npmjs.com/package/react-native-get-random-values.' + : 'BSON: No cryptographic implementation for random bytes present, falling back to a less secure implementation.'; + console.warn(insecureWarning); + var result = buffer_1.alloc(size); + for (var i = 0; i < size; ++i) + result[i] = Math.floor(Math.random() * 256); + return result; +}; +var detectRandomBytes = function () { + if (typeof window !== 'undefined') { + // browser crypto implementation(s) + var target_1 = window.crypto || window.msCrypto; // allow for IE11 + if (target_1 && target_1.getRandomValues) { + return function (size) { return target_1.getRandomValues(buffer_1.alloc(size)); }; + } + } + if (typeof global !== 'undefined' && global.crypto && global.crypto.getRandomValues) { + // allow for RN packages such as https://www.npmjs.com/package/react-native-get-random-values to populate global + return function (size) { return global.crypto.getRandomValues(buffer_1.alloc(size)); }; + } + var requiredRandomBytes; + try { + // eslint-disable-next-line @typescript-eslint/no-var-requires + requiredRandomBytes = require('crypto').randomBytes; + } + catch (e) { + // keep the fallback + } + // NOTE: in transpiled cases the above require might return null/undefined + return requiredRandomBytes || insecureRandomBytes; +}; +var randomBytes = detectRandomBytes(); +function isAnyArrayBuffer(value) { + return ['[object ArrayBuffer]', '[object SharedArrayBuffer]'].includes(Object.prototype.toString.call(value)); +} +function isUint8Array(value) { + return Object.prototype.toString.call(value) === '[object Uint8Array]'; +} +function isBigInt64Array(value) { + return Object.prototype.toString.call(value) === '[object BigInt64Array]'; +} +function isBigUInt64Array(value) { + return Object.prototype.toString.call(value) === '[object BigUint64Array]'; +} +function isRegExp(d) { + return Object.prototype.toString.call(d) === '[object RegExp]'; +} +function isMap(d) { + return Object.prototype.toString.call(d) === '[object Map]'; +} +// To ensure that 0.4 of node works correctly +function isDate(d) { + return isObjectLike(d) && Object.prototype.toString.call(d) === '[object Date]'; +} +/** + * @internal + * this is to solve the `'someKey' in x` problem where x is unknown. + * https://github.com/typescript-eslint/typescript-eslint/issues/1071#issuecomment-541955753 + */ +function isObjectLike(candidate) { + return typeof candidate === 'object' && candidate !== null; +} +function deprecate(fn, message) { + var warned = false; + function deprecated() { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + if (!warned) { + console.warn(message); + warned = true; + } + return fn.apply(this, args); + } + return deprecated; +} + +/** + * Makes sure that, if a Uint8Array is passed in, it is wrapped in a Buffer. + * + * @param potentialBuffer - The potential buffer + * @returns Buffer the input if potentialBuffer is a buffer, or a buffer that + * wraps a passed in Uint8Array + * @throws BSONTypeError If anything other than a Buffer or Uint8Array is passed in + */ +function ensureBuffer(potentialBuffer) { + if (ArrayBuffer.isView(potentialBuffer)) { + return buffer_1.from(potentialBuffer.buffer, potentialBuffer.byteOffset, potentialBuffer.byteLength); + } + if (isAnyArrayBuffer(potentialBuffer)) { + return buffer_1.from(potentialBuffer); + } + throw new BSONTypeError('Must use either Buffer or TypedArray'); +} + +// Validation regex for v4 uuid (validates with or without dashes) +var VALIDATION_REGEX = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|[0-9a-f]{12}4[0-9a-f]{3}[89ab][0-9a-f]{15})$/i; +var uuidValidateString = function (str) { + return typeof str === 'string' && VALIDATION_REGEX.test(str); +}; +var uuidHexStringToBuffer = function (hexString) { + if (!uuidValidateString(hexString)) { + throw new BSONTypeError('UUID string representations must be a 32 or 36 character hex string (dashes excluded/included). Format: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" or "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx".'); + } + var sanitizedHexString = hexString.replace(/-/g, ''); + return buffer_1.from(sanitizedHexString, 'hex'); +}; +var bufferToUuidHexString = function (buffer, includeDashes) { + if (includeDashes === void 0) { includeDashes = true; } + return includeDashes + ? buffer.toString('hex', 0, 4) + + '-' + + buffer.toString('hex', 4, 6) + + '-' + + buffer.toString('hex', 6, 8) + + '-' + + buffer.toString('hex', 8, 10) + + '-' + + buffer.toString('hex', 10, 16) + : buffer.toString('hex'); +}; + +var BYTE_LENGTH = 16; +var kId$1 = Symbol('id'); +/** + * A class representation of the BSON UUID type. + * @public + */ +var UUID = /** @class */ (function () { + /** + * Create an UUID type + * + * @param input - Can be a 32 or 36 character hex string (dashes excluded/included) or a 16 byte binary Buffer. + */ + function UUID(input) { + if (typeof input === 'undefined') { + // The most common use case (blank id, new UUID() instance) + this.id = UUID.generate(); + } + else if (input instanceof UUID) { + this[kId$1] = buffer_1.from(input.id); + this.__id = input.__id; + } + else if (ArrayBuffer.isView(input) && input.byteLength === BYTE_LENGTH) { + this.id = ensureBuffer(input); + } + else if (typeof input === 'string') { + this.id = uuidHexStringToBuffer(input); + } + else { + throw new BSONTypeError('Argument passed in UUID constructor must be a UUID, a 16 byte Buffer or a 32/36 character hex string (dashes excluded/included, format: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx).'); + } + } + Object.defineProperty(UUID.prototype, "id", { + /** + * The UUID bytes + * @readonly + */ + get: function () { + return this[kId$1]; + }, + set: function (value) { + this[kId$1] = value; + if (UUID.cacheHexString) { + this.__id = bufferToUuidHexString(value); + } + }, + enumerable: false, + configurable: true + }); + /** + * Generate a 16 byte uuid v4 buffer used in UUIDs + */ + /** + * Returns the UUID id as a 32 or 36 character hex string representation, excluding/including dashes (defaults to 36 character dash separated) + * @param includeDashes - should the string exclude dash-separators. + * */ + UUID.prototype.toHexString = function (includeDashes) { + if (includeDashes === void 0) { includeDashes = true; } + if (UUID.cacheHexString && this.__id) { + return this.__id; + } + var uuidHexString = bufferToUuidHexString(this.id, includeDashes); + if (UUID.cacheHexString) { + this.__id = uuidHexString; + } + return uuidHexString; + }; + /** + * Converts the id into a 36 character (dashes included) hex string, unless a encoding is specified. + */ + UUID.prototype.toString = function (encoding) { + return encoding ? this.id.toString(encoding) : this.toHexString(); + }; + /** + * Converts the id into its JSON string representation. + * A 36 character (dashes included) hex string in the format: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx + */ + UUID.prototype.toJSON = function () { + return this.toHexString(); + }; + /** + * Compares the equality of this UUID with `otherID`. + * + * @param otherId - UUID instance to compare against. + */ + UUID.prototype.equals = function (otherId) { + if (!otherId) { + return false; + } + if (otherId instanceof UUID) { + return otherId.id.equals(this.id); + } + try { + return new UUID(otherId).id.equals(this.id); + } + catch (_a) { + return false; + } + }; + /** + * Creates a Binary instance from the current UUID. + */ + UUID.prototype.toBinary = function () { + return new Binary(this.id, Binary.SUBTYPE_UUID); + }; + /** + * Generates a populated buffer containing a v4 uuid + */ + UUID.generate = function () { + var bytes = randomBytes(BYTE_LENGTH); + // Per 4.4, set bits for version and `clock_seq_hi_and_reserved` + // Kindly borrowed from https://github.com/uuidjs/uuid/blob/master/src/v4.js + bytes[6] = (bytes[6] & 0x0f) | 0x40; + bytes[8] = (bytes[8] & 0x3f) | 0x80; + return buffer_1.from(bytes); + }; + /** + * Checks if a value is a valid bson UUID + * @param input - UUID, string or Buffer to validate. + */ + UUID.isValid = function (input) { + if (!input) { + return false; + } + if (input instanceof UUID) { + return true; + } + if (typeof input === 'string') { + return uuidValidateString(input); + } + if (isUint8Array(input)) { + // check for length & uuid version (https://tools.ietf.org/html/rfc4122#section-4.1.3) + if (input.length !== BYTE_LENGTH) { + return false; + } + try { + // get this byte as hex: xxxxxxxx-xxxx-XXxx-xxxx-xxxxxxxxxxxx + // check first part as uuid version: xxxxxxxx-xxxx-Xxxx-xxxx-xxxxxxxxxxxx + return parseInt(input[6].toString(16)[0], 10) === Binary.SUBTYPE_UUID; + } + catch (_a) { + return false; + } + } + return false; + }; + /** + * Creates an UUID from a hex string representation of an UUID. + * @param hexString - 32 or 36 character hex string (dashes excluded/included). + */ + UUID.createFromHexString = function (hexString) { + var buffer = uuidHexStringToBuffer(hexString); + return new UUID(buffer); + }; + /** + * Converts to a string representation of this Id. + * + * @returns return the 36 character hex string representation. + * @internal + */ + UUID.prototype[Symbol.for('nodejs.util.inspect.custom')] = function () { + return this.inspect(); + }; + UUID.prototype.inspect = function () { + return "new UUID(\"" + this.toHexString() + "\")"; + }; + return UUID; +}()); +Object.defineProperty(UUID.prototype, '_bsontype', { value: 'UUID' }); + +/** + * A class representation of the BSON Binary type. + * @public + * @category BSONType + */ +var Binary = /** @class */ (function () { + /** + * @param buffer - a buffer object containing the binary data. + * @param subType - the option binary type. + */ + function Binary(buffer, subType) { + if (!(this instanceof Binary)) + return new Binary(buffer, subType); + if (!(buffer == null) && + !(typeof buffer === 'string') && + !ArrayBuffer.isView(buffer) && + !(buffer instanceof ArrayBuffer) && + !Array.isArray(buffer)) { + throw new BSONTypeError('Binary can only be constructed from string, Buffer, TypedArray, or Array'); + } + this.sub_type = subType !== null && subType !== void 0 ? subType : Binary.BSON_BINARY_SUBTYPE_DEFAULT; + if (buffer == null) { + // create an empty binary buffer + this.buffer = buffer_1.alloc(Binary.BUFFER_SIZE); + this.position = 0; + } + else { + if (typeof buffer === 'string') { + // string + this.buffer = buffer_1.from(buffer, 'binary'); + } + else if (Array.isArray(buffer)) { + // number[] + this.buffer = buffer_1.from(buffer); + } + else { + // Buffer | TypedArray | ArrayBuffer + this.buffer = ensureBuffer(buffer); + } + this.position = this.buffer.byteLength; + } + } + /** + * Updates this binary with byte_value. + * + * @param byteValue - a single byte we wish to write. + */ + Binary.prototype.put = function (byteValue) { + // If it's a string and a has more than one character throw an error + if (typeof byteValue === 'string' && byteValue.length !== 1) { + throw new BSONTypeError('only accepts single character String'); + } + else if (typeof byteValue !== 'number' && byteValue.length !== 1) + throw new BSONTypeError('only accepts single character Uint8Array or Array'); + // Decode the byte value once + var decodedByte; + if (typeof byteValue === 'string') { + decodedByte = byteValue.charCodeAt(0); + } + else if (typeof byteValue === 'number') { + decodedByte = byteValue; + } + else { + decodedByte = byteValue[0]; + } + if (decodedByte < 0 || decodedByte > 255) { + throw new BSONTypeError('only accepts number in a valid unsigned byte range 0-255'); + } + if (this.buffer.length > this.position) { + this.buffer[this.position++] = decodedByte; + } + else { + var buffer = buffer_1.alloc(Binary.BUFFER_SIZE + this.buffer.length); + // Combine the two buffers together + this.buffer.copy(buffer, 0, 0, this.buffer.length); + this.buffer = buffer; + this.buffer[this.position++] = decodedByte; + } + }; + /** + * Writes a buffer or string to the binary. + * + * @param sequence - a string or buffer to be written to the Binary BSON object. + * @param offset - specify the binary of where to write the content. + */ + Binary.prototype.write = function (sequence, offset) { + offset = typeof offset === 'number' ? offset : this.position; + // If the buffer is to small let's extend the buffer + if (this.buffer.length < offset + sequence.length) { + var buffer = buffer_1.alloc(this.buffer.length + sequence.length); + this.buffer.copy(buffer, 0, 0, this.buffer.length); + // Assign the new buffer + this.buffer = buffer; + } + if (ArrayBuffer.isView(sequence)) { + this.buffer.set(ensureBuffer(sequence), offset); + this.position = + offset + sequence.byteLength > this.position ? offset + sequence.length : this.position; + } + else if (typeof sequence === 'string') { + this.buffer.write(sequence, offset, sequence.length, 'binary'); + this.position = + offset + sequence.length > this.position ? offset + sequence.length : this.position; + } + }; + /** + * Reads **length** bytes starting at **position**. + * + * @param position - read from the given position in the Binary. + * @param length - the number of bytes to read. + */ + Binary.prototype.read = function (position, length) { + length = length && length > 0 ? length : this.position; + // Let's return the data based on the type we have + return this.buffer.slice(position, position + length); + }; + /** + * Returns the value of this binary as a string. + * @param asRaw - Will skip converting to a string + * @remarks + * This is handy when calling this function conditionally for some key value pairs and not others + */ + Binary.prototype.value = function (asRaw) { + asRaw = !!asRaw; + // Optimize to serialize for the situation where the data == size of buffer + if (asRaw && this.buffer.length === this.position) { + return this.buffer; + } + // If it's a node.js buffer object + if (asRaw) { + return this.buffer.slice(0, this.position); + } + return this.buffer.toString('binary', 0, this.position); + }; + /** the length of the binary sequence */ + Binary.prototype.length = function () { + return this.position; + }; + Binary.prototype.toJSON = function () { + return this.buffer.toString('base64'); + }; + Binary.prototype.toString = function (format) { + return this.buffer.toString(format); + }; + /** @internal */ + Binary.prototype.toExtendedJSON = function (options) { + options = options || {}; + var base64String = this.buffer.toString('base64'); + var subType = Number(this.sub_type).toString(16); + if (options.legacy) { + return { + $binary: base64String, + $type: subType.length === 1 ? '0' + subType : subType + }; + } + return { + $binary: { + base64: base64String, + subType: subType.length === 1 ? '0' + subType : subType + } + }; + }; + Binary.prototype.toUUID = function () { + if (this.sub_type === Binary.SUBTYPE_UUID) { + return new UUID(this.buffer.slice(0, this.position)); + } + throw new BSONError("Binary sub_type \"" + this.sub_type + "\" is not supported for converting to UUID. Only \"" + Binary.SUBTYPE_UUID + "\" is currently supported."); + }; + /** @internal */ + Binary.fromExtendedJSON = function (doc, options) { + options = options || {}; + var data; + var type; + if ('$binary' in doc) { + if (options.legacy && typeof doc.$binary === 'string' && '$type' in doc) { + type = doc.$type ? parseInt(doc.$type, 16) : 0; + data = buffer_1.from(doc.$binary, 'base64'); + } + else { + if (typeof doc.$binary !== 'string') { + type = doc.$binary.subType ? parseInt(doc.$binary.subType, 16) : 0; + data = buffer_1.from(doc.$binary.base64, 'base64'); + } + } + } + else if ('$uuid' in doc) { + type = 4; + data = uuidHexStringToBuffer(doc.$uuid); + } + if (!data) { + throw new BSONTypeError("Unexpected Binary Extended JSON format " + JSON.stringify(doc)); + } + return new Binary(data, type); + }; + /** @internal */ + Binary.prototype[Symbol.for('nodejs.util.inspect.custom')] = function () { + return this.inspect(); + }; + Binary.prototype.inspect = function () { + var asBuffer = this.value(true); + return "new Binary(Buffer.from(\"" + asBuffer.toString('hex') + "\", \"hex\"), " + this.sub_type + ")"; + }; + /** + * Binary default subtype + * @internal + */ + Binary.BSON_BINARY_SUBTYPE_DEFAULT = 0; + /** Initial buffer default size */ + Binary.BUFFER_SIZE = 256; + /** Default BSON type */ + Binary.SUBTYPE_DEFAULT = 0; + /** Function BSON type */ + Binary.SUBTYPE_FUNCTION = 1; + /** Byte Array BSON type */ + Binary.SUBTYPE_BYTE_ARRAY = 2; + /** Deprecated UUID BSON type @deprecated Please use SUBTYPE_UUID */ + Binary.SUBTYPE_UUID_OLD = 3; + /** UUID BSON type */ + Binary.SUBTYPE_UUID = 4; + /** MD5 BSON type */ + Binary.SUBTYPE_MD5 = 5; + /** Encrypted BSON type */ + Binary.SUBTYPE_ENCRYPTED = 6; + /** Column BSON type */ + Binary.SUBTYPE_COLUMN = 7; + /** User BSON type */ + Binary.SUBTYPE_USER_DEFINED = 128; + return Binary; +}()); +Object.defineProperty(Binary.prototype, '_bsontype', { value: 'Binary' }); + +/** + * A class representation of the BSON Code type. + * @public + * @category BSONType + */ +var Code = /** @class */ (function () { + /** + * @param code - a string or function. + * @param scope - an optional scope for the function. + */ + function Code(code, scope) { + if (!(this instanceof Code)) + return new Code(code, scope); + this.code = code; + this.scope = scope; + } + Code.prototype.toJSON = function () { + return { code: this.code, scope: this.scope }; + }; + /** @internal */ + Code.prototype.toExtendedJSON = function () { + if (this.scope) { + return { $code: this.code, $scope: this.scope }; + } + return { $code: this.code }; + }; + /** @internal */ + Code.fromExtendedJSON = function (doc) { + return new Code(doc.$code, doc.$scope); + }; + /** @internal */ + Code.prototype[Symbol.for('nodejs.util.inspect.custom')] = function () { + return this.inspect(); + }; + Code.prototype.inspect = function () { + var codeJson = this.toJSON(); + return "new Code(\"" + codeJson.code + "\"" + (codeJson.scope ? ", " + JSON.stringify(codeJson.scope) : '') + ")"; + }; + return Code; +}()); +Object.defineProperty(Code.prototype, '_bsontype', { value: 'Code' }); + +/** @internal */ +function isDBRefLike(value) { + return (isObjectLike(value) && + value.$id != null && + typeof value.$ref === 'string' && + (value.$db == null || typeof value.$db === 'string')); +} +/** + * A class representation of the BSON DBRef type. + * @public + * @category BSONType + */ +var DBRef = /** @class */ (function () { + /** + * @param collection - the collection name. + * @param oid - the reference ObjectId. + * @param db - optional db name, if omitted the reference is local to the current db. + */ + function DBRef(collection, oid, db, fields) { + if (!(this instanceof DBRef)) + return new DBRef(collection, oid, db, fields); + // check if namespace has been provided + var parts = collection.split('.'); + if (parts.length === 2) { + db = parts.shift(); + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + collection = parts.shift(); + } + this.collection = collection; + this.oid = oid; + this.db = db; + this.fields = fields || {}; + } + Object.defineProperty(DBRef.prototype, "namespace", { + // Property provided for compatibility with the 1.x parser + // the 1.x parser used a "namespace" property, while 4.x uses "collection" + /** @internal */ + get: function () { + return this.collection; + }, + set: function (value) { + this.collection = value; + }, + enumerable: false, + configurable: true + }); + DBRef.prototype.toJSON = function () { + var o = Object.assign({ + $ref: this.collection, + $id: this.oid + }, this.fields); + if (this.db != null) + o.$db = this.db; + return o; + }; + /** @internal */ + DBRef.prototype.toExtendedJSON = function (options) { + options = options || {}; + var o = { + $ref: this.collection, + $id: this.oid + }; + if (options.legacy) { + return o; + } + if (this.db) + o.$db = this.db; + o = Object.assign(o, this.fields); + return o; + }; + /** @internal */ + DBRef.fromExtendedJSON = function (doc) { + var copy = Object.assign({}, doc); + delete copy.$ref; + delete copy.$id; + delete copy.$db; + return new DBRef(doc.$ref, doc.$id, doc.$db, copy); + }; + /** @internal */ + DBRef.prototype[Symbol.for('nodejs.util.inspect.custom')] = function () { + return this.inspect(); + }; + DBRef.prototype.inspect = function () { + // NOTE: if OID is an ObjectId class it will just print the oid string. + var oid = this.oid === undefined || this.oid.toString === undefined ? this.oid : this.oid.toString(); + return "new DBRef(\"" + this.namespace + "\", new ObjectId(\"" + oid + "\")" + (this.db ? ", \"" + this.db + "\"" : '') + ")"; + }; + return DBRef; +}()); +Object.defineProperty(DBRef.prototype, '_bsontype', { value: 'DBRef' }); + +/** + * wasm optimizations, to do native i64 multiplication and divide + */ +var wasm = undefined; +try { + wasm = new WebAssembly.Instance(new WebAssembly.Module( + // prettier-ignore + new Uint8Array([0, 97, 115, 109, 1, 0, 0, 0, 1, 13, 2, 96, 0, 1, 127, 96, 4, 127, 127, 127, 127, 1, 127, 3, 7, 6, 0, 1, 1, 1, 1, 1, 6, 6, 1, 127, 1, 65, 0, 11, 7, 50, 6, 3, 109, 117, 108, 0, 1, 5, 100, 105, 118, 95, 115, 0, 2, 5, 100, 105, 118, 95, 117, 0, 3, 5, 114, 101, 109, 95, 115, 0, 4, 5, 114, 101, 109, 95, 117, 0, 5, 8, 103, 101, 116, 95, 104, 105, 103, 104, 0, 0, 10, 191, 1, 6, 4, 0, 35, 0, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 126, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 127, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 128, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 129, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 130, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11])), {}).exports; +} +catch (_a) { + // no wasm support +} +var TWO_PWR_16_DBL = 1 << 16; +var TWO_PWR_24_DBL = 1 << 24; +var TWO_PWR_32_DBL = TWO_PWR_16_DBL * TWO_PWR_16_DBL; +var TWO_PWR_64_DBL = TWO_PWR_32_DBL * TWO_PWR_32_DBL; +var TWO_PWR_63_DBL = TWO_PWR_64_DBL / 2; +/** A cache of the Long representations of small integer values. */ +var INT_CACHE = {}; +/** A cache of the Long representations of small unsigned integer values. */ +var UINT_CACHE = {}; +/** + * A class representing a 64-bit integer + * @public + * @category BSONType + * @remarks + * The internal representation of a long is the two given signed, 32-bit values. + * We use 32-bit pieces because these are the size of integers on which + * Javascript performs bit-operations. For operations like addition and + * multiplication, we split each number into 16 bit pieces, which can easily be + * multiplied within Javascript's floating-point representation without overflow + * or change in sign. + * In the algorithms below, we frequently reduce the negative case to the + * positive case by negating the input(s) and then post-processing the result. + * Note that we must ALWAYS check specially whether those values are MIN_VALUE + * (-2^63) because -MIN_VALUE == MIN_VALUE (since 2^63 cannot be represented as + * a positive number, it overflows back into a negative). Not handling this + * case would often result in infinite recursion. + * Common constant values ZERO, ONE, NEG_ONE, etc. are found as static properties on this class. + */ +var Long = /** @class */ (function () { + /** + * Constructs a 64 bit two's-complement integer, given its low and high 32 bit values as *signed* integers. + * See the from* functions below for more convenient ways of constructing Longs. + * + * Acceptable signatures are: + * - Long(low, high, unsigned?) + * - Long(bigint, unsigned?) + * - Long(string, unsigned?) + * + * @param low - The low (signed) 32 bits of the long + * @param high - The high (signed) 32 bits of the long + * @param unsigned - Whether unsigned or not, defaults to signed + */ + function Long(low, high, unsigned) { + if (low === void 0) { low = 0; } + if (!(this instanceof Long)) + return new Long(low, high, unsigned); + if (typeof low === 'bigint') { + Object.assign(this, Long.fromBigInt(low, !!high)); + } + else if (typeof low === 'string') { + Object.assign(this, Long.fromString(low, !!high)); + } + else { + this.low = low | 0; + this.high = high | 0; + this.unsigned = !!unsigned; + } + Object.defineProperty(this, '__isLong__', { + value: true, + configurable: false, + writable: false, + enumerable: false + }); + } + /** + * Returns a Long representing the 64 bit integer that comes by concatenating the given low and high bits. + * Each is assumed to use 32 bits. + * @param lowBits - The low 32 bits + * @param highBits - The high 32 bits + * @param unsigned - Whether unsigned or not, defaults to signed + * @returns The corresponding Long value + */ + Long.fromBits = function (lowBits, highBits, unsigned) { + return new Long(lowBits, highBits, unsigned); + }; + /** + * Returns a Long representing the given 32 bit integer value. + * @param value - The 32 bit integer in question + * @param unsigned - Whether unsigned or not, defaults to signed + * @returns The corresponding Long value + */ + Long.fromInt = function (value, unsigned) { + var obj, cachedObj, cache; + if (unsigned) { + value >>>= 0; + if ((cache = 0 <= value && value < 256)) { + cachedObj = UINT_CACHE[value]; + if (cachedObj) + return cachedObj; + } + obj = Long.fromBits(value, (value | 0) < 0 ? -1 : 0, true); + if (cache) + UINT_CACHE[value] = obj; + return obj; + } + else { + value |= 0; + if ((cache = -128 <= value && value < 128)) { + cachedObj = INT_CACHE[value]; + if (cachedObj) + return cachedObj; + } + obj = Long.fromBits(value, value < 0 ? -1 : 0, false); + if (cache) + INT_CACHE[value] = obj; + return obj; + } + }; + /** + * Returns a Long representing the given value, provided that it is a finite number. Otherwise, zero is returned. + * @param value - The number in question + * @param unsigned - Whether unsigned or not, defaults to signed + * @returns The corresponding Long value + */ + Long.fromNumber = function (value, unsigned) { + if (isNaN(value)) + return unsigned ? Long.UZERO : Long.ZERO; + if (unsigned) { + if (value < 0) + return Long.UZERO; + if (value >= TWO_PWR_64_DBL) + return Long.MAX_UNSIGNED_VALUE; + } + else { + if (value <= -TWO_PWR_63_DBL) + return Long.MIN_VALUE; + if (value + 1 >= TWO_PWR_63_DBL) + return Long.MAX_VALUE; + } + if (value < 0) + return Long.fromNumber(-value, unsigned).neg(); + return Long.fromBits(value % TWO_PWR_32_DBL | 0, (value / TWO_PWR_32_DBL) | 0, unsigned); + }; + /** + * Returns a Long representing the given value, provided that it is a finite number. Otherwise, zero is returned. + * @param value - The number in question + * @param unsigned - Whether unsigned or not, defaults to signed + * @returns The corresponding Long value + */ + Long.fromBigInt = function (value, unsigned) { + return Long.fromString(value.toString(), unsigned); + }; + /** + * Returns a Long representation of the given string, written using the specified radix. + * @param str - The textual representation of the Long + * @param unsigned - Whether unsigned or not, defaults to signed + * @param radix - The radix in which the text is written (2-36), defaults to 10 + * @returns The corresponding Long value + */ + Long.fromString = function (str, unsigned, radix) { + if (str.length === 0) + throw Error('empty string'); + if (str === 'NaN' || str === 'Infinity' || str === '+Infinity' || str === '-Infinity') + return Long.ZERO; + if (typeof unsigned === 'number') { + // For goog.math.long compatibility + (radix = unsigned), (unsigned = false); + } + else { + unsigned = !!unsigned; + } + radix = radix || 10; + if (radix < 2 || 36 < radix) + throw RangeError('radix'); + var p; + if ((p = str.indexOf('-')) > 0) + throw Error('interior hyphen'); + else if (p === 0) { + return Long.fromString(str.substring(1), unsigned, radix).neg(); + } + // Do several (8) digits each time through the loop, so as to + // minimize the calls to the very expensive emulated div. + var radixToPower = Long.fromNumber(Math.pow(radix, 8)); + var result = Long.ZERO; + for (var i = 0; i < str.length; i += 8) { + var size = Math.min(8, str.length - i), value = parseInt(str.substring(i, i + size), radix); + if (size < 8) { + var power = Long.fromNumber(Math.pow(radix, size)); + result = result.mul(power).add(Long.fromNumber(value)); + } + else { + result = result.mul(radixToPower); + result = result.add(Long.fromNumber(value)); + } + } + result.unsigned = unsigned; + return result; + }; + /** + * Creates a Long from its byte representation. + * @param bytes - Byte representation + * @param unsigned - Whether unsigned or not, defaults to signed + * @param le - Whether little or big endian, defaults to big endian + * @returns The corresponding Long value + */ + Long.fromBytes = function (bytes, unsigned, le) { + return le ? Long.fromBytesLE(bytes, unsigned) : Long.fromBytesBE(bytes, unsigned); + }; + /** + * Creates a Long from its little endian byte representation. + * @param bytes - Little endian byte representation + * @param unsigned - Whether unsigned or not, defaults to signed + * @returns The corresponding Long value + */ + Long.fromBytesLE = function (bytes, unsigned) { + return new Long(bytes[0] | (bytes[1] << 8) | (bytes[2] << 16) | (bytes[3] << 24), bytes[4] | (bytes[5] << 8) | (bytes[6] << 16) | (bytes[7] << 24), unsigned); + }; + /** + * Creates a Long from its big endian byte representation. + * @param bytes - Big endian byte representation + * @param unsigned - Whether unsigned or not, defaults to signed + * @returns The corresponding Long value + */ + Long.fromBytesBE = function (bytes, unsigned) { + return new Long((bytes[4] << 24) | (bytes[5] << 16) | (bytes[6] << 8) | bytes[7], (bytes[0] << 24) | (bytes[1] << 16) | (bytes[2] << 8) | bytes[3], unsigned); + }; + /** + * Tests if the specified object is a Long. + */ + // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types + Long.isLong = function (value) { + return isObjectLike(value) && value['__isLong__'] === true; + }; + /** + * Converts the specified value to a Long. + * @param unsigned - Whether unsigned or not, defaults to signed + */ + Long.fromValue = function (val, unsigned) { + if (typeof val === 'number') + return Long.fromNumber(val, unsigned); + if (typeof val === 'string') + return Long.fromString(val, unsigned); + // Throws for non-objects, converts non-instanceof Long: + return Long.fromBits(val.low, val.high, typeof unsigned === 'boolean' ? unsigned : val.unsigned); + }; + /** Returns the sum of this and the specified Long. */ + Long.prototype.add = function (addend) { + if (!Long.isLong(addend)) + addend = Long.fromValue(addend); + // Divide each number into 4 chunks of 16 bits, and then sum the chunks. + var a48 = this.high >>> 16; + var a32 = this.high & 0xffff; + var a16 = this.low >>> 16; + var a00 = this.low & 0xffff; + var b48 = addend.high >>> 16; + var b32 = addend.high & 0xffff; + var b16 = addend.low >>> 16; + var b00 = addend.low & 0xffff; + var c48 = 0, c32 = 0, c16 = 0, c00 = 0; + c00 += a00 + b00; + c16 += c00 >>> 16; + c00 &= 0xffff; + c16 += a16 + b16; + c32 += c16 >>> 16; + c16 &= 0xffff; + c32 += a32 + b32; + c48 += c32 >>> 16; + c32 &= 0xffff; + c48 += a48 + b48; + c48 &= 0xffff; + return Long.fromBits((c16 << 16) | c00, (c48 << 16) | c32, this.unsigned); + }; + /** + * Returns the sum of this and the specified Long. + * @returns Sum + */ + Long.prototype.and = function (other) { + if (!Long.isLong(other)) + other = Long.fromValue(other); + return Long.fromBits(this.low & other.low, this.high & other.high, this.unsigned); + }; + /** + * Compares this Long's value with the specified's. + * @returns 0 if they are the same, 1 if the this is greater and -1 if the given one is greater + */ + Long.prototype.compare = function (other) { + if (!Long.isLong(other)) + other = Long.fromValue(other); + if (this.eq(other)) + return 0; + var thisNeg = this.isNegative(), otherNeg = other.isNegative(); + if (thisNeg && !otherNeg) + return -1; + if (!thisNeg && otherNeg) + return 1; + // At this point the sign bits are the same + if (!this.unsigned) + return this.sub(other).isNegative() ? -1 : 1; + // Both are positive if at least one is unsigned + return other.high >>> 0 > this.high >>> 0 || + (other.high === this.high && other.low >>> 0 > this.low >>> 0) + ? -1 + : 1; + }; + /** This is an alias of {@link Long.compare} */ + Long.prototype.comp = function (other) { + return this.compare(other); + }; + /** + * Returns this Long divided by the specified. The result is signed if this Long is signed or unsigned if this Long is unsigned. + * @returns Quotient + */ + Long.prototype.divide = function (divisor) { + if (!Long.isLong(divisor)) + divisor = Long.fromValue(divisor); + if (divisor.isZero()) + throw Error('division by zero'); + // use wasm support if present + if (wasm) { + // guard against signed division overflow: the largest + // negative number / -1 would be 1 larger than the largest + // positive number, due to two's complement. + if (!this.unsigned && + this.high === -0x80000000 && + divisor.low === -1 && + divisor.high === -1) { + // be consistent with non-wasm code path + return this; + } + var low = (this.unsigned ? wasm.div_u : wasm.div_s)(this.low, this.high, divisor.low, divisor.high); + return Long.fromBits(low, wasm.get_high(), this.unsigned); + } + if (this.isZero()) + return this.unsigned ? Long.UZERO : Long.ZERO; + var approx, rem, res; + if (!this.unsigned) { + // This section is only relevant for signed longs and is derived from the + // closure library as a whole. + if (this.eq(Long.MIN_VALUE)) { + if (divisor.eq(Long.ONE) || divisor.eq(Long.NEG_ONE)) + return Long.MIN_VALUE; + // recall that -MIN_VALUE == MIN_VALUE + else if (divisor.eq(Long.MIN_VALUE)) + return Long.ONE; + else { + // At this point, we have |other| >= 2, so |this/other| < |MIN_VALUE|. + var halfThis = this.shr(1); + approx = halfThis.div(divisor).shl(1); + if (approx.eq(Long.ZERO)) { + return divisor.isNegative() ? Long.ONE : Long.NEG_ONE; + } + else { + rem = this.sub(divisor.mul(approx)); + res = approx.add(rem.div(divisor)); + return res; + } + } + } + else if (divisor.eq(Long.MIN_VALUE)) + return this.unsigned ? Long.UZERO : Long.ZERO; + if (this.isNegative()) { + if (divisor.isNegative()) + return this.neg().div(divisor.neg()); + return this.neg().div(divisor).neg(); + } + else if (divisor.isNegative()) + return this.div(divisor.neg()).neg(); + res = Long.ZERO; + } + else { + // The algorithm below has not been made for unsigned longs. It's therefore + // required to take special care of the MSB prior to running it. + if (!divisor.unsigned) + divisor = divisor.toUnsigned(); + if (divisor.gt(this)) + return Long.UZERO; + if (divisor.gt(this.shru(1))) + // 15 >>> 1 = 7 ; with divisor = 8 ; true + return Long.UONE; + res = Long.UZERO; + } + // Repeat the following until the remainder is less than other: find a + // floating-point that approximates remainder / other *from below*, add this + // into the result, and subtract it from the remainder. It is critical that + // the approximate value is less than or equal to the real value so that the + // remainder never becomes negative. + rem = this; + while (rem.gte(divisor)) { + // Approximate the result of division. This may be a little greater or + // smaller than the actual value. + approx = Math.max(1, Math.floor(rem.toNumber() / divisor.toNumber())); + // We will tweak the approximate result by changing it in the 48-th digit or + // the smallest non-fractional digit, whichever is larger. + var log2 = Math.ceil(Math.log(approx) / Math.LN2); + var delta = log2 <= 48 ? 1 : Math.pow(2, log2 - 48); + // Decrease the approximation until it is smaller than the remainder. Note + // that if it is too large, the product overflows and is negative. + var approxRes = Long.fromNumber(approx); + var approxRem = approxRes.mul(divisor); + while (approxRem.isNegative() || approxRem.gt(rem)) { + approx -= delta; + approxRes = Long.fromNumber(approx, this.unsigned); + approxRem = approxRes.mul(divisor); + } + // We know the answer can't be zero... and actually, zero would cause + // infinite recursion since we would make no progress. + if (approxRes.isZero()) + approxRes = Long.ONE; + res = res.add(approxRes); + rem = rem.sub(approxRem); + } + return res; + }; + /**This is an alias of {@link Long.divide} */ + Long.prototype.div = function (divisor) { + return this.divide(divisor); + }; + /** + * Tests if this Long's value equals the specified's. + * @param other - Other value + */ + Long.prototype.equals = function (other) { + if (!Long.isLong(other)) + other = Long.fromValue(other); + if (this.unsigned !== other.unsigned && this.high >>> 31 === 1 && other.high >>> 31 === 1) + return false; + return this.high === other.high && this.low === other.low; + }; + /** This is an alias of {@link Long.equals} */ + Long.prototype.eq = function (other) { + return this.equals(other); + }; + /** Gets the high 32 bits as a signed integer. */ + Long.prototype.getHighBits = function () { + return this.high; + }; + /** Gets the high 32 bits as an unsigned integer. */ + Long.prototype.getHighBitsUnsigned = function () { + return this.high >>> 0; + }; + /** Gets the low 32 bits as a signed integer. */ + Long.prototype.getLowBits = function () { + return this.low; + }; + /** Gets the low 32 bits as an unsigned integer. */ + Long.prototype.getLowBitsUnsigned = function () { + return this.low >>> 0; + }; + /** Gets the number of bits needed to represent the absolute value of this Long. */ + Long.prototype.getNumBitsAbs = function () { + if (this.isNegative()) { + // Unsigned Longs are never negative + return this.eq(Long.MIN_VALUE) ? 64 : this.neg().getNumBitsAbs(); + } + var val = this.high !== 0 ? this.high : this.low; + var bit; + for (bit = 31; bit > 0; bit--) + if ((val & (1 << bit)) !== 0) + break; + return this.high !== 0 ? bit + 33 : bit + 1; + }; + /** Tests if this Long's value is greater than the specified's. */ + Long.prototype.greaterThan = function (other) { + return this.comp(other) > 0; + }; + /** This is an alias of {@link Long.greaterThan} */ + Long.prototype.gt = function (other) { + return this.greaterThan(other); + }; + /** Tests if this Long's value is greater than or equal the specified's. */ + Long.prototype.greaterThanOrEqual = function (other) { + return this.comp(other) >= 0; + }; + /** This is an alias of {@link Long.greaterThanOrEqual} */ + Long.prototype.gte = function (other) { + return this.greaterThanOrEqual(other); + }; + /** This is an alias of {@link Long.greaterThanOrEqual} */ + Long.prototype.ge = function (other) { + return this.greaterThanOrEqual(other); + }; + /** Tests if this Long's value is even. */ + Long.prototype.isEven = function () { + return (this.low & 1) === 0; + }; + /** Tests if this Long's value is negative. */ + Long.prototype.isNegative = function () { + return !this.unsigned && this.high < 0; + }; + /** Tests if this Long's value is odd. */ + Long.prototype.isOdd = function () { + return (this.low & 1) === 1; + }; + /** Tests if this Long's value is positive. */ + Long.prototype.isPositive = function () { + return this.unsigned || this.high >= 0; + }; + /** Tests if this Long's value equals zero. */ + Long.prototype.isZero = function () { + return this.high === 0 && this.low === 0; + }; + /** Tests if this Long's value is less than the specified's. */ + Long.prototype.lessThan = function (other) { + return this.comp(other) < 0; + }; + /** This is an alias of {@link Long#lessThan}. */ + Long.prototype.lt = function (other) { + return this.lessThan(other); + }; + /** Tests if this Long's value is less than or equal the specified's. */ + Long.prototype.lessThanOrEqual = function (other) { + return this.comp(other) <= 0; + }; + /** This is an alias of {@link Long.lessThanOrEqual} */ + Long.prototype.lte = function (other) { + return this.lessThanOrEqual(other); + }; + /** Returns this Long modulo the specified. */ + Long.prototype.modulo = function (divisor) { + if (!Long.isLong(divisor)) + divisor = Long.fromValue(divisor); + // use wasm support if present + if (wasm) { + var low = (this.unsigned ? wasm.rem_u : wasm.rem_s)(this.low, this.high, divisor.low, divisor.high); + return Long.fromBits(low, wasm.get_high(), this.unsigned); + } + return this.sub(this.div(divisor).mul(divisor)); + }; + /** This is an alias of {@link Long.modulo} */ + Long.prototype.mod = function (divisor) { + return this.modulo(divisor); + }; + /** This is an alias of {@link Long.modulo} */ + Long.prototype.rem = function (divisor) { + return this.modulo(divisor); + }; + /** + * Returns the product of this and the specified Long. + * @param multiplier - Multiplier + * @returns Product + */ + Long.prototype.multiply = function (multiplier) { + if (this.isZero()) + return Long.ZERO; + if (!Long.isLong(multiplier)) + multiplier = Long.fromValue(multiplier); + // use wasm support if present + if (wasm) { + var low = wasm.mul(this.low, this.high, multiplier.low, multiplier.high); + return Long.fromBits(low, wasm.get_high(), this.unsigned); + } + if (multiplier.isZero()) + return Long.ZERO; + if (this.eq(Long.MIN_VALUE)) + return multiplier.isOdd() ? Long.MIN_VALUE : Long.ZERO; + if (multiplier.eq(Long.MIN_VALUE)) + return this.isOdd() ? Long.MIN_VALUE : Long.ZERO; + if (this.isNegative()) { + if (multiplier.isNegative()) + return this.neg().mul(multiplier.neg()); + else + return this.neg().mul(multiplier).neg(); + } + else if (multiplier.isNegative()) + return this.mul(multiplier.neg()).neg(); + // If both longs are small, use float multiplication + if (this.lt(Long.TWO_PWR_24) && multiplier.lt(Long.TWO_PWR_24)) + return Long.fromNumber(this.toNumber() * multiplier.toNumber(), this.unsigned); + // Divide each long into 4 chunks of 16 bits, and then add up 4x4 products. + // We can skip products that would overflow. + var a48 = this.high >>> 16; + var a32 = this.high & 0xffff; + var a16 = this.low >>> 16; + var a00 = this.low & 0xffff; + var b48 = multiplier.high >>> 16; + var b32 = multiplier.high & 0xffff; + var b16 = multiplier.low >>> 16; + var b00 = multiplier.low & 0xffff; + var c48 = 0, c32 = 0, c16 = 0, c00 = 0; + c00 += a00 * b00; + c16 += c00 >>> 16; + c00 &= 0xffff; + c16 += a16 * b00; + c32 += c16 >>> 16; + c16 &= 0xffff; + c16 += a00 * b16; + c32 += c16 >>> 16; + c16 &= 0xffff; + c32 += a32 * b00; + c48 += c32 >>> 16; + c32 &= 0xffff; + c32 += a16 * b16; + c48 += c32 >>> 16; + c32 &= 0xffff; + c32 += a00 * b32; + c48 += c32 >>> 16; + c32 &= 0xffff; + c48 += a48 * b00 + a32 * b16 + a16 * b32 + a00 * b48; + c48 &= 0xffff; + return Long.fromBits((c16 << 16) | c00, (c48 << 16) | c32, this.unsigned); + }; + /** This is an alias of {@link Long.multiply} */ + Long.prototype.mul = function (multiplier) { + return this.multiply(multiplier); + }; + /** Returns the Negation of this Long's value. */ + Long.prototype.negate = function () { + if (!this.unsigned && this.eq(Long.MIN_VALUE)) + return Long.MIN_VALUE; + return this.not().add(Long.ONE); + }; + /** This is an alias of {@link Long.negate} */ + Long.prototype.neg = function () { + return this.negate(); + }; + /** Returns the bitwise NOT of this Long. */ + Long.prototype.not = function () { + return Long.fromBits(~this.low, ~this.high, this.unsigned); + }; + /** Tests if this Long's value differs from the specified's. */ + Long.prototype.notEquals = function (other) { + return !this.equals(other); + }; + /** This is an alias of {@link Long.notEquals} */ + Long.prototype.neq = function (other) { + return this.notEquals(other); + }; + /** This is an alias of {@link Long.notEquals} */ + Long.prototype.ne = function (other) { + return this.notEquals(other); + }; + /** + * Returns the bitwise OR of this Long and the specified. + */ + Long.prototype.or = function (other) { + if (!Long.isLong(other)) + other = Long.fromValue(other); + return Long.fromBits(this.low | other.low, this.high | other.high, this.unsigned); + }; + /** + * Returns this Long with bits shifted to the left by the given amount. + * @param numBits - Number of bits + * @returns Shifted Long + */ + Long.prototype.shiftLeft = function (numBits) { + if (Long.isLong(numBits)) + numBits = numBits.toInt(); + if ((numBits &= 63) === 0) + return this; + else if (numBits < 32) + return Long.fromBits(this.low << numBits, (this.high << numBits) | (this.low >>> (32 - numBits)), this.unsigned); + else + return Long.fromBits(0, this.low << (numBits - 32), this.unsigned); + }; + /** This is an alias of {@link Long.shiftLeft} */ + Long.prototype.shl = function (numBits) { + return this.shiftLeft(numBits); + }; + /** + * Returns this Long with bits arithmetically shifted to the right by the given amount. + * @param numBits - Number of bits + * @returns Shifted Long + */ + Long.prototype.shiftRight = function (numBits) { + if (Long.isLong(numBits)) + numBits = numBits.toInt(); + if ((numBits &= 63) === 0) + return this; + else if (numBits < 32) + return Long.fromBits((this.low >>> numBits) | (this.high << (32 - numBits)), this.high >> numBits, this.unsigned); + else + return Long.fromBits(this.high >> (numBits - 32), this.high >= 0 ? 0 : -1, this.unsigned); + }; + /** This is an alias of {@link Long.shiftRight} */ + Long.prototype.shr = function (numBits) { + return this.shiftRight(numBits); + }; + /** + * Returns this Long with bits logically shifted to the right by the given amount. + * @param numBits - Number of bits + * @returns Shifted Long + */ + Long.prototype.shiftRightUnsigned = function (numBits) { + if (Long.isLong(numBits)) + numBits = numBits.toInt(); + numBits &= 63; + if (numBits === 0) + return this; + else { + var high = this.high; + if (numBits < 32) { + var low = this.low; + return Long.fromBits((low >>> numBits) | (high << (32 - numBits)), high >>> numBits, this.unsigned); + } + else if (numBits === 32) + return Long.fromBits(high, 0, this.unsigned); + else + return Long.fromBits(high >>> (numBits - 32), 0, this.unsigned); + } + }; + /** This is an alias of {@link Long.shiftRightUnsigned} */ + Long.prototype.shr_u = function (numBits) { + return this.shiftRightUnsigned(numBits); + }; + /** This is an alias of {@link Long.shiftRightUnsigned} */ + Long.prototype.shru = function (numBits) { + return this.shiftRightUnsigned(numBits); + }; + /** + * Returns the difference of this and the specified Long. + * @param subtrahend - Subtrahend + * @returns Difference + */ + Long.prototype.subtract = function (subtrahend) { + if (!Long.isLong(subtrahend)) + subtrahend = Long.fromValue(subtrahend); + return this.add(subtrahend.neg()); + }; + /** This is an alias of {@link Long.subtract} */ + Long.prototype.sub = function (subtrahend) { + return this.subtract(subtrahend); + }; + /** Converts the Long to a 32 bit integer, assuming it is a 32 bit integer. */ + Long.prototype.toInt = function () { + return this.unsigned ? this.low >>> 0 : this.low; + }; + /** Converts the Long to a the nearest floating-point representation of this value (double, 53 bit mantissa). */ + Long.prototype.toNumber = function () { + if (this.unsigned) + return (this.high >>> 0) * TWO_PWR_32_DBL + (this.low >>> 0); + return this.high * TWO_PWR_32_DBL + (this.low >>> 0); + }; + /** Converts the Long to a BigInt (arbitrary precision). */ + Long.prototype.toBigInt = function () { + return BigInt(this.toString()); + }; + /** + * Converts this Long to its byte representation. + * @param le - Whether little or big endian, defaults to big endian + * @returns Byte representation + */ + Long.prototype.toBytes = function (le) { + return le ? this.toBytesLE() : this.toBytesBE(); + }; + /** + * Converts this Long to its little endian byte representation. + * @returns Little endian byte representation + */ + Long.prototype.toBytesLE = function () { + var hi = this.high, lo = this.low; + return [ + lo & 0xff, + (lo >>> 8) & 0xff, + (lo >>> 16) & 0xff, + lo >>> 24, + hi & 0xff, + (hi >>> 8) & 0xff, + (hi >>> 16) & 0xff, + hi >>> 24 + ]; + }; + /** + * Converts this Long to its big endian byte representation. + * @returns Big endian byte representation + */ + Long.prototype.toBytesBE = function () { + var hi = this.high, lo = this.low; + return [ + hi >>> 24, + (hi >>> 16) & 0xff, + (hi >>> 8) & 0xff, + hi & 0xff, + lo >>> 24, + (lo >>> 16) & 0xff, + (lo >>> 8) & 0xff, + lo & 0xff + ]; + }; + /** + * Converts this Long to signed. + */ + Long.prototype.toSigned = function () { + if (!this.unsigned) + return this; + return Long.fromBits(this.low, this.high, false); + }; + /** + * Converts the Long to a string written in the specified radix. + * @param radix - Radix (2-36), defaults to 10 + * @throws RangeError If `radix` is out of range + */ + Long.prototype.toString = function (radix) { + radix = radix || 10; + if (radix < 2 || 36 < radix) + throw RangeError('radix'); + if (this.isZero()) + return '0'; + if (this.isNegative()) { + // Unsigned Longs are never negative + if (this.eq(Long.MIN_VALUE)) { + // We need to change the Long value before it can be negated, so we remove + // the bottom-most digit in this base and then recurse to do the rest. + var radixLong = Long.fromNumber(radix), div = this.div(radixLong), rem1 = div.mul(radixLong).sub(this); + return div.toString(radix) + rem1.toInt().toString(radix); + } + else + return '-' + this.neg().toString(radix); + } + // Do several (6) digits each time through the loop, so as to + // minimize the calls to the very expensive emulated div. + var radixToPower = Long.fromNumber(Math.pow(radix, 6), this.unsigned); + // eslint-disable-next-line @typescript-eslint/no-this-alias + var rem = this; + var result = ''; + // eslint-disable-next-line no-constant-condition + while (true) { + var remDiv = rem.div(radixToPower); + var intval = rem.sub(remDiv.mul(radixToPower)).toInt() >>> 0; + var digits = intval.toString(radix); + rem = remDiv; + if (rem.isZero()) { + return digits + result; + } + else { + while (digits.length < 6) + digits = '0' + digits; + result = '' + digits + result; + } + } + }; + /** Converts this Long to unsigned. */ + Long.prototype.toUnsigned = function () { + if (this.unsigned) + return this; + return Long.fromBits(this.low, this.high, true); + }; + /** Returns the bitwise XOR of this Long and the given one. */ + Long.prototype.xor = function (other) { + if (!Long.isLong(other)) + other = Long.fromValue(other); + return Long.fromBits(this.low ^ other.low, this.high ^ other.high, this.unsigned); + }; + /** This is an alias of {@link Long.isZero} */ + Long.prototype.eqz = function () { + return this.isZero(); + }; + /** This is an alias of {@link Long.lessThanOrEqual} */ + Long.prototype.le = function (other) { + return this.lessThanOrEqual(other); + }; + /* + **************************************************************** + * BSON SPECIFIC ADDITIONS * + **************************************************************** + */ + Long.prototype.toExtendedJSON = function (options) { + if (options && options.relaxed) + return this.toNumber(); + return { $numberLong: this.toString() }; + }; + Long.fromExtendedJSON = function (doc, options) { + var result = Long.fromString(doc.$numberLong); + return options && options.relaxed ? result.toNumber() : result; + }; + /** @internal */ + Long.prototype[Symbol.for('nodejs.util.inspect.custom')] = function () { + return this.inspect(); + }; + Long.prototype.inspect = function () { + return "new Long(\"" + this.toString() + "\"" + (this.unsigned ? ', true' : '') + ")"; + }; + Long.TWO_PWR_24 = Long.fromInt(TWO_PWR_24_DBL); + /** Maximum unsigned value. */ + Long.MAX_UNSIGNED_VALUE = Long.fromBits(0xffffffff | 0, 0xffffffff | 0, true); + /** Signed zero */ + Long.ZERO = Long.fromInt(0); + /** Unsigned zero. */ + Long.UZERO = Long.fromInt(0, true); + /** Signed one. */ + Long.ONE = Long.fromInt(1); + /** Unsigned one. */ + Long.UONE = Long.fromInt(1, true); + /** Signed negative one. */ + Long.NEG_ONE = Long.fromInt(-1); + /** Maximum signed value. */ + Long.MAX_VALUE = Long.fromBits(0xffffffff | 0, 0x7fffffff | 0, false); + /** Minimum signed value. */ + Long.MIN_VALUE = Long.fromBits(0, 0x80000000 | 0, false); + return Long; +}()); +Object.defineProperty(Long.prototype, '__isLong__', { value: true }); +Object.defineProperty(Long.prototype, '_bsontype', { value: 'Long' }); + +var PARSE_STRING_REGEXP = /^(\+|-)?(\d+|(\d*\.\d*))?(E|e)?([-+])?(\d+)?$/; +var PARSE_INF_REGEXP = /^(\+|-)?(Infinity|inf)$/i; +var PARSE_NAN_REGEXP = /^(\+|-)?NaN$/i; +var EXPONENT_MAX = 6111; +var EXPONENT_MIN = -6176; +var EXPONENT_BIAS = 6176; +var MAX_DIGITS = 34; +// Nan value bits as 32 bit values (due to lack of longs) +var NAN_BUFFER = [ + 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +].reverse(); +// Infinity value bits 32 bit values (due to lack of longs) +var INF_NEGATIVE_BUFFER = [ + 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +].reverse(); +var INF_POSITIVE_BUFFER = [ + 0x78, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +].reverse(); +var EXPONENT_REGEX = /^([-+])?(\d+)?$/; +// Extract least significant 5 bits +var COMBINATION_MASK = 0x1f; +// Extract least significant 14 bits +var EXPONENT_MASK = 0x3fff; +// Value of combination field for Inf +var COMBINATION_INFINITY = 30; +// Value of combination field for NaN +var COMBINATION_NAN = 31; +// Detect if the value is a digit +function isDigit(value) { + return !isNaN(parseInt(value, 10)); +} +// Divide two uint128 values +function divideu128(value) { + var DIVISOR = Long.fromNumber(1000 * 1000 * 1000); + var _rem = Long.fromNumber(0); + if (!value.parts[0] && !value.parts[1] && !value.parts[2] && !value.parts[3]) { + return { quotient: value, rem: _rem }; + } + for (var i = 0; i <= 3; i++) { + // Adjust remainder to match value of next dividend + _rem = _rem.shiftLeft(32); + // Add the divided to _rem + _rem = _rem.add(new Long(value.parts[i], 0)); + value.parts[i] = _rem.div(DIVISOR).low; + _rem = _rem.modulo(DIVISOR); + } + return { quotient: value, rem: _rem }; +} +// Multiply two Long values and return the 128 bit value +function multiply64x2(left, right) { + if (!left && !right) { + return { high: Long.fromNumber(0), low: Long.fromNumber(0) }; + } + var leftHigh = left.shiftRightUnsigned(32); + var leftLow = new Long(left.getLowBits(), 0); + var rightHigh = right.shiftRightUnsigned(32); + var rightLow = new Long(right.getLowBits(), 0); + var productHigh = leftHigh.multiply(rightHigh); + var productMid = leftHigh.multiply(rightLow); + var productMid2 = leftLow.multiply(rightHigh); + var productLow = leftLow.multiply(rightLow); + productHigh = productHigh.add(productMid.shiftRightUnsigned(32)); + productMid = new Long(productMid.getLowBits(), 0) + .add(productMid2) + .add(productLow.shiftRightUnsigned(32)); + productHigh = productHigh.add(productMid.shiftRightUnsigned(32)); + productLow = productMid.shiftLeft(32).add(new Long(productLow.getLowBits(), 0)); + // Return the 128 bit result + return { high: productHigh, low: productLow }; +} +function lessThan(left, right) { + // Make values unsigned + var uhleft = left.high >>> 0; + var uhright = right.high >>> 0; + // Compare high bits first + if (uhleft < uhright) { + return true; + } + else if (uhleft === uhright) { + var ulleft = left.low >>> 0; + var ulright = right.low >>> 0; + if (ulleft < ulright) + return true; + } + return false; +} +function invalidErr(string, message) { + throw new BSONTypeError("\"" + string + "\" is not a valid Decimal128 string - " + message); +} +/** + * A class representation of the BSON Decimal128 type. + * @public + * @category BSONType + */ +var Decimal128 = /** @class */ (function () { + /** + * @param bytes - a buffer containing the raw Decimal128 bytes in little endian order, + * or a string representation as returned by .toString() + */ + function Decimal128(bytes) { + if (!(this instanceof Decimal128)) + return new Decimal128(bytes); + if (typeof bytes === 'string') { + this.bytes = Decimal128.fromString(bytes).bytes; + } + else if (isUint8Array(bytes)) { + if (bytes.byteLength !== 16) { + throw new BSONTypeError('Decimal128 must take a Buffer of 16 bytes'); + } + this.bytes = bytes; + } + else { + throw new BSONTypeError('Decimal128 must take a Buffer or string'); + } + } + /** + * Create a Decimal128 instance from a string representation + * + * @param representation - a numeric string representation. + */ + Decimal128.fromString = function (representation) { + // Parse state tracking + var isNegative = false; + var sawRadix = false; + var foundNonZero = false; + // Total number of significant digits (no leading or trailing zero) + var significantDigits = 0; + // Total number of significand digits read + var nDigitsRead = 0; + // Total number of digits (no leading zeros) + var nDigits = 0; + // The number of the digits after radix + var radixPosition = 0; + // The index of the first non-zero in *str* + var firstNonZero = 0; + // Digits Array + var digits = [0]; + // The number of digits in digits + var nDigitsStored = 0; + // Insertion pointer for digits + var digitsInsert = 0; + // The index of the first non-zero digit + var firstDigit = 0; + // The index of the last digit + var lastDigit = 0; + // Exponent + var exponent = 0; + // loop index over array + var i = 0; + // The high 17 digits of the significand + var significandHigh = new Long(0, 0); + // The low 17 digits of the significand + var significandLow = new Long(0, 0); + // The biased exponent + var biasedExponent = 0; + // Read index + var index = 0; + // Naively prevent against REDOS attacks. + // TODO: implementing a custom parsing for this, or refactoring the regex would yield + // further gains. + if (representation.length >= 7000) { + throw new BSONTypeError('' + representation + ' not a valid Decimal128 string'); + } + // Results + var stringMatch = representation.match(PARSE_STRING_REGEXP); + var infMatch = representation.match(PARSE_INF_REGEXP); + var nanMatch = representation.match(PARSE_NAN_REGEXP); + // Validate the string + if ((!stringMatch && !infMatch && !nanMatch) || representation.length === 0) { + throw new BSONTypeError('' + representation + ' not a valid Decimal128 string'); + } + if (stringMatch) { + // full_match = stringMatch[0] + // sign = stringMatch[1] + var unsignedNumber = stringMatch[2]; + // stringMatch[3] is undefined if a whole number (ex "1", 12") + // but defined if a number w/ decimal in it (ex "1.0, 12.2") + var e = stringMatch[4]; + var expSign = stringMatch[5]; + var expNumber = stringMatch[6]; + // they provided e, but didn't give an exponent number. for ex "1e" + if (e && expNumber === undefined) + invalidErr(representation, 'missing exponent power'); + // they provided e, but didn't give a number before it. for ex "e1" + if (e && unsignedNumber === undefined) + invalidErr(representation, 'missing exponent base'); + if (e === undefined && (expSign || expNumber)) { + invalidErr(representation, 'missing e before exponent'); + } + } + // Get the negative or positive sign + if (representation[index] === '+' || representation[index] === '-') { + isNegative = representation[index++] === '-'; + } + // Check if user passed Infinity or NaN + if (!isDigit(representation[index]) && representation[index] !== '.') { + if (representation[index] === 'i' || representation[index] === 'I') { + return new Decimal128(buffer_1.from(isNegative ? INF_NEGATIVE_BUFFER : INF_POSITIVE_BUFFER)); + } + else if (representation[index] === 'N') { + return new Decimal128(buffer_1.from(NAN_BUFFER)); + } + } + // Read all the digits + while (isDigit(representation[index]) || representation[index] === '.') { + if (representation[index] === '.') { + if (sawRadix) + invalidErr(representation, 'contains multiple periods'); + sawRadix = true; + index = index + 1; + continue; + } + if (nDigitsStored < 34) { + if (representation[index] !== '0' || foundNonZero) { + if (!foundNonZero) { + firstNonZero = nDigitsRead; + } + foundNonZero = true; + // Only store 34 digits + digits[digitsInsert++] = parseInt(representation[index], 10); + nDigitsStored = nDigitsStored + 1; + } + } + if (foundNonZero) + nDigits = nDigits + 1; + if (sawRadix) + radixPosition = radixPosition + 1; + nDigitsRead = nDigitsRead + 1; + index = index + 1; + } + if (sawRadix && !nDigitsRead) + throw new BSONTypeError('' + representation + ' not a valid Decimal128 string'); + // Read exponent if exists + if (representation[index] === 'e' || representation[index] === 'E') { + // Read exponent digits + var match = representation.substr(++index).match(EXPONENT_REGEX); + // No digits read + if (!match || !match[2]) + return new Decimal128(buffer_1.from(NAN_BUFFER)); + // Get exponent + exponent = parseInt(match[0], 10); + // Adjust the index + index = index + match[0].length; + } + // Return not a number + if (representation[index]) + return new Decimal128(buffer_1.from(NAN_BUFFER)); + // Done reading input + // Find first non-zero digit in digits + firstDigit = 0; + if (!nDigitsStored) { + firstDigit = 0; + lastDigit = 0; + digits[0] = 0; + nDigits = 1; + nDigitsStored = 1; + significantDigits = 0; + } + else { + lastDigit = nDigitsStored - 1; + significantDigits = nDigits; + if (significantDigits !== 1) { + while (digits[firstNonZero + significantDigits - 1] === 0) { + significantDigits = significantDigits - 1; + } + } + } + // Normalization of exponent + // Correct exponent based on radix position, and shift significand as needed + // to represent user input + // Overflow prevention + if (exponent <= radixPosition && radixPosition - exponent > 1 << 14) { + exponent = EXPONENT_MIN; + } + else { + exponent = exponent - radixPosition; + } + // Attempt to normalize the exponent + while (exponent > EXPONENT_MAX) { + // Shift exponent to significand and decrease + lastDigit = lastDigit + 1; + if (lastDigit - firstDigit > MAX_DIGITS) { + // Check if we have a zero then just hard clamp, otherwise fail + var digitsString = digits.join(''); + if (digitsString.match(/^0+$/)) { + exponent = EXPONENT_MAX; + break; + } + invalidErr(representation, 'overflow'); + } + exponent = exponent - 1; + } + while (exponent < EXPONENT_MIN || nDigitsStored < nDigits) { + // Shift last digit. can only do this if < significant digits than # stored. + if (lastDigit === 0 && significantDigits < nDigitsStored) { + exponent = EXPONENT_MIN; + significantDigits = 0; + break; + } + if (nDigitsStored < nDigits) { + // adjust to match digits not stored + nDigits = nDigits - 1; + } + else { + // adjust to round + lastDigit = lastDigit - 1; + } + if (exponent < EXPONENT_MAX) { + exponent = exponent + 1; + } + else { + // Check if we have a zero then just hard clamp, otherwise fail + var digitsString = digits.join(''); + if (digitsString.match(/^0+$/)) { + exponent = EXPONENT_MAX; + break; + } + invalidErr(representation, 'overflow'); + } + } + // Round + // We've normalized the exponent, but might still need to round. + if (lastDigit - firstDigit + 1 < significantDigits) { + var endOfString = nDigitsRead; + // If we have seen a radix point, 'string' is 1 longer than we have + // documented with ndigits_read, so inc the position of the first nonzero + // digit and the position that digits are read to. + if (sawRadix) { + firstNonZero = firstNonZero + 1; + endOfString = endOfString + 1; + } + // if negative, we need to increment again to account for - sign at start. + if (isNegative) { + firstNonZero = firstNonZero + 1; + endOfString = endOfString + 1; + } + var roundDigit = parseInt(representation[firstNonZero + lastDigit + 1], 10); + var roundBit = 0; + if (roundDigit >= 5) { + roundBit = 1; + if (roundDigit === 5) { + roundBit = digits[lastDigit] % 2 === 1 ? 1 : 0; + for (i = firstNonZero + lastDigit + 2; i < endOfString; i++) { + if (parseInt(representation[i], 10)) { + roundBit = 1; + break; + } + } + } + } + if (roundBit) { + var dIdx = lastDigit; + for (; dIdx >= 0; dIdx--) { + if (++digits[dIdx] > 9) { + digits[dIdx] = 0; + // overflowed most significant digit + if (dIdx === 0) { + if (exponent < EXPONENT_MAX) { + exponent = exponent + 1; + digits[dIdx] = 1; + } + else { + return new Decimal128(buffer_1.from(isNegative ? INF_NEGATIVE_BUFFER : INF_POSITIVE_BUFFER)); + } + } + } + } + } + } + // Encode significand + // The high 17 digits of the significand + significandHigh = Long.fromNumber(0); + // The low 17 digits of the significand + significandLow = Long.fromNumber(0); + // read a zero + if (significantDigits === 0) { + significandHigh = Long.fromNumber(0); + significandLow = Long.fromNumber(0); + } + else if (lastDigit - firstDigit < 17) { + var dIdx = firstDigit; + significandLow = Long.fromNumber(digits[dIdx++]); + significandHigh = new Long(0, 0); + for (; dIdx <= lastDigit; dIdx++) { + significandLow = significandLow.multiply(Long.fromNumber(10)); + significandLow = significandLow.add(Long.fromNumber(digits[dIdx])); + } + } + else { + var dIdx = firstDigit; + significandHigh = Long.fromNumber(digits[dIdx++]); + for (; dIdx <= lastDigit - 17; dIdx++) { + significandHigh = significandHigh.multiply(Long.fromNumber(10)); + significandHigh = significandHigh.add(Long.fromNumber(digits[dIdx])); + } + significandLow = Long.fromNumber(digits[dIdx++]); + for (; dIdx <= lastDigit; dIdx++) { + significandLow = significandLow.multiply(Long.fromNumber(10)); + significandLow = significandLow.add(Long.fromNumber(digits[dIdx])); + } + } + var significand = multiply64x2(significandHigh, Long.fromString('100000000000000000')); + significand.low = significand.low.add(significandLow); + if (lessThan(significand.low, significandLow)) { + significand.high = significand.high.add(Long.fromNumber(1)); + } + // Biased exponent + biasedExponent = exponent + EXPONENT_BIAS; + var dec = { low: Long.fromNumber(0), high: Long.fromNumber(0) }; + // Encode combination, exponent, and significand. + if (significand.high.shiftRightUnsigned(49).and(Long.fromNumber(1)).equals(Long.fromNumber(1))) { + // Encode '11' into bits 1 to 3 + dec.high = dec.high.or(Long.fromNumber(0x3).shiftLeft(61)); + dec.high = dec.high.or(Long.fromNumber(biasedExponent).and(Long.fromNumber(0x3fff).shiftLeft(47))); + dec.high = dec.high.or(significand.high.and(Long.fromNumber(0x7fffffffffff))); + } + else { + dec.high = dec.high.or(Long.fromNumber(biasedExponent & 0x3fff).shiftLeft(49)); + dec.high = dec.high.or(significand.high.and(Long.fromNumber(0x1ffffffffffff))); + } + dec.low = significand.low; + // Encode sign + if (isNegative) { + dec.high = dec.high.or(Long.fromString('9223372036854775808')); + } + // Encode into a buffer + var buffer = buffer_1.alloc(16); + index = 0; + // Encode the low 64 bits of the decimal + // Encode low bits + buffer[index++] = dec.low.low & 0xff; + buffer[index++] = (dec.low.low >> 8) & 0xff; + buffer[index++] = (dec.low.low >> 16) & 0xff; + buffer[index++] = (dec.low.low >> 24) & 0xff; + // Encode high bits + buffer[index++] = dec.low.high & 0xff; + buffer[index++] = (dec.low.high >> 8) & 0xff; + buffer[index++] = (dec.low.high >> 16) & 0xff; + buffer[index++] = (dec.low.high >> 24) & 0xff; + // Encode the high 64 bits of the decimal + // Encode low bits + buffer[index++] = dec.high.low & 0xff; + buffer[index++] = (dec.high.low >> 8) & 0xff; + buffer[index++] = (dec.high.low >> 16) & 0xff; + buffer[index++] = (dec.high.low >> 24) & 0xff; + // Encode high bits + buffer[index++] = dec.high.high & 0xff; + buffer[index++] = (dec.high.high >> 8) & 0xff; + buffer[index++] = (dec.high.high >> 16) & 0xff; + buffer[index++] = (dec.high.high >> 24) & 0xff; + // Return the new Decimal128 + return new Decimal128(buffer); + }; + /** Create a string representation of the raw Decimal128 value */ + Decimal128.prototype.toString = function () { + // Note: bits in this routine are referred to starting at 0, + // from the sign bit, towards the coefficient. + // decoded biased exponent (14 bits) + var biased_exponent; + // the number of significand digits + var significand_digits = 0; + // the base-10 digits in the significand + var significand = new Array(36); + for (var i = 0; i < significand.length; i++) + significand[i] = 0; + // read pointer into significand + var index = 0; + // true if the number is zero + var is_zero = false; + // the most significant significand bits (50-46) + var significand_msb; + // temporary storage for significand decoding + var significand128 = { parts: [0, 0, 0, 0] }; + // indexing variables + var j, k; + // Output string + var string = []; + // Unpack index + index = 0; + // Buffer reference + var buffer = this.bytes; + // Unpack the low 64bits into a long + // bits 96 - 127 + var low = buffer[index++] | (buffer[index++] << 8) | (buffer[index++] << 16) | (buffer[index++] << 24); + // bits 64 - 95 + var midl = buffer[index++] | (buffer[index++] << 8) | (buffer[index++] << 16) | (buffer[index++] << 24); + // Unpack the high 64bits into a long + // bits 32 - 63 + var midh = buffer[index++] | (buffer[index++] << 8) | (buffer[index++] << 16) | (buffer[index++] << 24); + // bits 0 - 31 + var high = buffer[index++] | (buffer[index++] << 8) | (buffer[index++] << 16) | (buffer[index++] << 24); + // Unpack index + index = 0; + // Create the state of the decimal + var dec = { + low: new Long(low, midl), + high: new Long(midh, high) + }; + if (dec.high.lessThan(Long.ZERO)) { + string.push('-'); + } + // Decode combination field and exponent + // bits 1 - 5 + var combination = (high >> 26) & COMBINATION_MASK; + if (combination >> 3 === 3) { + // Check for 'special' values + if (combination === COMBINATION_INFINITY) { + return string.join('') + 'Infinity'; + } + else if (combination === COMBINATION_NAN) { + return 'NaN'; + } + else { + biased_exponent = (high >> 15) & EXPONENT_MASK; + significand_msb = 0x08 + ((high >> 14) & 0x01); + } + } + else { + significand_msb = (high >> 14) & 0x07; + biased_exponent = (high >> 17) & EXPONENT_MASK; + } + // unbiased exponent + var exponent = biased_exponent - EXPONENT_BIAS; + // Create string of significand digits + // Convert the 114-bit binary number represented by + // (significand_high, significand_low) to at most 34 decimal + // digits through modulo and division. + significand128.parts[0] = (high & 0x3fff) + ((significand_msb & 0xf) << 14); + significand128.parts[1] = midh; + significand128.parts[2] = midl; + significand128.parts[3] = low; + if (significand128.parts[0] === 0 && + significand128.parts[1] === 0 && + significand128.parts[2] === 0 && + significand128.parts[3] === 0) { + is_zero = true; + } + else { + for (k = 3; k >= 0; k--) { + var least_digits = 0; + // Perform the divide + var result = divideu128(significand128); + significand128 = result.quotient; + least_digits = result.rem.low; + // We now have the 9 least significant digits (in base 2). + // Convert and output to string. + if (!least_digits) + continue; + for (j = 8; j >= 0; j--) { + // significand[k * 9 + j] = Math.round(least_digits % 10); + significand[k * 9 + j] = least_digits % 10; + // least_digits = Math.round(least_digits / 10); + least_digits = Math.floor(least_digits / 10); + } + } + } + // Output format options: + // Scientific - [-]d.dddE(+/-)dd or [-]dE(+/-)dd + // Regular - ddd.ddd + if (is_zero) { + significand_digits = 1; + significand[index] = 0; + } + else { + significand_digits = 36; + while (!significand[index]) { + significand_digits = significand_digits - 1; + index = index + 1; + } + } + // the exponent if scientific notation is used + var scientific_exponent = significand_digits - 1 + exponent; + // The scientific exponent checks are dictated by the string conversion + // specification and are somewhat arbitrary cutoffs. + // + // We must check exponent > 0, because if this is the case, the number + // has trailing zeros. However, we *cannot* output these trailing zeros, + // because doing so would change the precision of the value, and would + // change stored data if the string converted number is round tripped. + if (scientific_exponent >= 34 || scientific_exponent <= -7 || exponent > 0) { + // Scientific format + // if there are too many significant digits, we should just be treating numbers + // as + or - 0 and using the non-scientific exponent (this is for the "invalid + // representation should be treated as 0/-0" spec cases in decimal128-1.json) + if (significand_digits > 34) { + string.push("" + 0); + if (exponent > 0) + string.push('E+' + exponent); + else if (exponent < 0) + string.push('E' + exponent); + return string.join(''); + } + string.push("" + significand[index++]); + significand_digits = significand_digits - 1; + if (significand_digits) { + string.push('.'); + } + for (var i = 0; i < significand_digits; i++) { + string.push("" + significand[index++]); + } + // Exponent + string.push('E'); + if (scientific_exponent > 0) { + string.push('+' + scientific_exponent); + } + else { + string.push("" + scientific_exponent); + } + } + else { + // Regular format with no decimal place + if (exponent >= 0) { + for (var i = 0; i < significand_digits; i++) { + string.push("" + significand[index++]); + } + } + else { + var radix_position = significand_digits + exponent; + // non-zero digits before radix + if (radix_position > 0) { + for (var i = 0; i < radix_position; i++) { + string.push("" + significand[index++]); + } + } + else { + string.push('0'); + } + string.push('.'); + // add leading zeros after radix + while (radix_position++ < 0) { + string.push('0'); + } + for (var i = 0; i < significand_digits - Math.max(radix_position - 1, 0); i++) { + string.push("" + significand[index++]); + } + } + } + return string.join(''); + }; + Decimal128.prototype.toJSON = function () { + return { $numberDecimal: this.toString() }; + }; + /** @internal */ + Decimal128.prototype.toExtendedJSON = function () { + return { $numberDecimal: this.toString() }; + }; + /** @internal */ + Decimal128.fromExtendedJSON = function (doc) { + return Decimal128.fromString(doc.$numberDecimal); + }; + /** @internal */ + Decimal128.prototype[Symbol.for('nodejs.util.inspect.custom')] = function () { + return this.inspect(); + }; + Decimal128.prototype.inspect = function () { + return "new Decimal128(\"" + this.toString() + "\")"; + }; + return Decimal128; +}()); +Object.defineProperty(Decimal128.prototype, '_bsontype', { value: 'Decimal128' }); + +/** + * A class representation of the BSON Double type. + * @public + * @category BSONType + */ +var Double = /** @class */ (function () { + /** + * Create a Double type + * + * @param value - the number we want to represent as a double. + */ + function Double(value) { + if (!(this instanceof Double)) + return new Double(value); + if (value instanceof Number) { + value = value.valueOf(); + } + this.value = +value; + } + /** + * Access the number value. + * + * @returns returns the wrapped double number. + */ + Double.prototype.valueOf = function () { + return this.value; + }; + Double.prototype.toJSON = function () { + return this.value; + }; + Double.prototype.toString = function (radix) { + return this.value.toString(radix); + }; + /** @internal */ + Double.prototype.toExtendedJSON = function (options) { + if (options && (options.legacy || (options.relaxed && isFinite(this.value)))) { + return this.value; + } + // NOTE: JavaScript has +0 and -0, apparently to model limit calculations. If a user + // explicitly provided `-0` then we need to ensure the sign makes it into the output + if (Object.is(Math.sign(this.value), -0)) { + return { $numberDouble: "-" + this.value.toFixed(1) }; + } + var $numberDouble; + if (Number.isInteger(this.value)) { + $numberDouble = this.value.toFixed(1); + if ($numberDouble.length >= 13) { + $numberDouble = this.value.toExponential(13).toUpperCase(); + } + } + else { + $numberDouble = this.value.toString(); + } + return { $numberDouble: $numberDouble }; + }; + /** @internal */ + Double.fromExtendedJSON = function (doc, options) { + var doubleValue = parseFloat(doc.$numberDouble); + return options && options.relaxed ? doubleValue : new Double(doubleValue); + }; + /** @internal */ + Double.prototype[Symbol.for('nodejs.util.inspect.custom')] = function () { + return this.inspect(); + }; + Double.prototype.inspect = function () { + var eJSON = this.toExtendedJSON(); + return "new Double(" + eJSON.$numberDouble + ")"; + }; + return Double; +}()); +Object.defineProperty(Double.prototype, '_bsontype', { value: 'Double' }); + +/** + * A class representation of a BSON Int32 type. + * @public + * @category BSONType + */ +var Int32 = /** @class */ (function () { + /** + * Create an Int32 type + * + * @param value - the number we want to represent as an int32. + */ + function Int32(value) { + if (!(this instanceof Int32)) + return new Int32(value); + if (value instanceof Number) { + value = value.valueOf(); + } + this.value = +value | 0; + } + /** + * Access the number value. + * + * @returns returns the wrapped int32 number. + */ + Int32.prototype.valueOf = function () { + return this.value; + }; + Int32.prototype.toString = function (radix) { + return this.value.toString(radix); + }; + Int32.prototype.toJSON = function () { + return this.value; + }; + /** @internal */ + Int32.prototype.toExtendedJSON = function (options) { + if (options && (options.relaxed || options.legacy)) + return this.value; + return { $numberInt: this.value.toString() }; + }; + /** @internal */ + Int32.fromExtendedJSON = function (doc, options) { + return options && options.relaxed ? parseInt(doc.$numberInt, 10) : new Int32(doc.$numberInt); + }; + /** @internal */ + Int32.prototype[Symbol.for('nodejs.util.inspect.custom')] = function () { + return this.inspect(); + }; + Int32.prototype.inspect = function () { + return "new Int32(" + this.valueOf() + ")"; + }; + return Int32; +}()); +Object.defineProperty(Int32.prototype, '_bsontype', { value: 'Int32' }); + +/** + * A class representation of the BSON MaxKey type. + * @public + * @category BSONType + */ +var MaxKey = /** @class */ (function () { + function MaxKey() { + if (!(this instanceof MaxKey)) + return new MaxKey(); + } + /** @internal */ + MaxKey.prototype.toExtendedJSON = function () { + return { $maxKey: 1 }; + }; + /** @internal */ + MaxKey.fromExtendedJSON = function () { + return new MaxKey(); + }; + /** @internal */ + MaxKey.prototype[Symbol.for('nodejs.util.inspect.custom')] = function () { + return this.inspect(); + }; + MaxKey.prototype.inspect = function () { + return 'new MaxKey()'; + }; + return MaxKey; +}()); +Object.defineProperty(MaxKey.prototype, '_bsontype', { value: 'MaxKey' }); + +/** + * A class representation of the BSON MinKey type. + * @public + * @category BSONType + */ +var MinKey = /** @class */ (function () { + function MinKey() { + if (!(this instanceof MinKey)) + return new MinKey(); + } + /** @internal */ + MinKey.prototype.toExtendedJSON = function () { + return { $minKey: 1 }; + }; + /** @internal */ + MinKey.fromExtendedJSON = function () { + return new MinKey(); + }; + /** @internal */ + MinKey.prototype[Symbol.for('nodejs.util.inspect.custom')] = function () { + return this.inspect(); + }; + MinKey.prototype.inspect = function () { + return 'new MinKey()'; + }; + return MinKey; +}()); +Object.defineProperty(MinKey.prototype, '_bsontype', { value: 'MinKey' }); + +// Regular expression that checks for hex value +var checkForHexRegExp = new RegExp('^[0-9a-fA-F]{24}$'); +// Unique sequence for the current process (initialized on first use) +var PROCESS_UNIQUE = null; +var kId = Symbol('id'); +/** + * A class representation of the BSON ObjectId type. + * @public + * @category BSONType + */ +var ObjectId = /** @class */ (function () { + /** + * Create an ObjectId type + * + * @param inputId - Can be a 24 character hex string, 12 byte binary Buffer, or a number. + */ + function ObjectId(inputId) { + if (!(this instanceof ObjectId)) + return new ObjectId(inputId); + // workingId is set based on type of input and whether valid id exists for the input + var workingId; + if (typeof inputId === 'object' && inputId && 'id' in inputId) { + if (typeof inputId.id !== 'string' && !ArrayBuffer.isView(inputId.id)) { + throw new BSONTypeError('Argument passed in must have an id that is of type string or Buffer'); + } + if ('toHexString' in inputId && typeof inputId.toHexString === 'function') { + workingId = buffer_1.from(inputId.toHexString(), 'hex'); + } + else { + workingId = inputId.id; + } + } + else { + workingId = inputId; + } + // the following cases use workingId to construct an ObjectId + if (workingId == null || typeof workingId === 'number') { + // The most common use case (blank id, new objectId instance) + // Generate a new id + this[kId] = ObjectId.generate(typeof workingId === 'number' ? workingId : undefined); + } + else if (ArrayBuffer.isView(workingId) && workingId.byteLength === 12) { + // If intstanceof matches we can escape calling ensure buffer in Node.js environments + this[kId] = workingId instanceof buffer_1 ? workingId : ensureBuffer(workingId); + } + else if (typeof workingId === 'string') { + if (workingId.length === 12) { + var bytes = buffer_1.from(workingId); + if (bytes.byteLength === 12) { + this[kId] = bytes; + } + else { + throw new BSONTypeError('Argument passed in must be a string of 12 bytes'); + } + } + else if (workingId.length === 24 && checkForHexRegExp.test(workingId)) { + this[kId] = buffer_1.from(workingId, 'hex'); + } + else { + throw new BSONTypeError('Argument passed in must be a string of 12 bytes or a string of 24 hex characters or an integer'); + } + } + else { + throw new BSONTypeError('Argument passed in does not match the accepted types'); + } + // If we are caching the hex string + if (ObjectId.cacheHexString) { + this.__id = this.id.toString('hex'); + } + } + Object.defineProperty(ObjectId.prototype, "id", { + /** + * The ObjectId bytes + * @readonly + */ + get: function () { + return this[kId]; + }, + set: function (value) { + this[kId] = value; + if (ObjectId.cacheHexString) { + this.__id = value.toString('hex'); + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(ObjectId.prototype, "generationTime", { + /** + * The generation time of this ObjectId instance + * @deprecated Please use getTimestamp / createFromTime which returns an int32 epoch + */ + get: function () { + return this.id.readInt32BE(0); + }, + set: function (value) { + // Encode time into first 4 bytes + this.id.writeUInt32BE(value, 0); + }, + enumerable: false, + configurable: true + }); + /** Returns the ObjectId id as a 24 character hex string representation */ + ObjectId.prototype.toHexString = function () { + if (ObjectId.cacheHexString && this.__id) { + return this.__id; + } + var hexString = this.id.toString('hex'); + if (ObjectId.cacheHexString && !this.__id) { + this.__id = hexString; + } + return hexString; + }; + /** + * Update the ObjectId index + * @privateRemarks + * Used in generating new ObjectId's on the driver + * @internal + */ + ObjectId.getInc = function () { + return (ObjectId.index = (ObjectId.index + 1) % 0xffffff); + }; + /** + * Generate a 12 byte id buffer used in ObjectId's + * + * @param time - pass in a second based timestamp. + */ + ObjectId.generate = function (time) { + if ('number' !== typeof time) { + time = Math.floor(Date.now() / 1000); + } + var inc = ObjectId.getInc(); + var buffer = buffer_1.alloc(12); + // 4-byte timestamp + buffer.writeUInt32BE(time, 0); + // set PROCESS_UNIQUE if yet not initialized + if (PROCESS_UNIQUE === null) { + PROCESS_UNIQUE = randomBytes(5); + } + // 5-byte process unique + buffer[4] = PROCESS_UNIQUE[0]; + buffer[5] = PROCESS_UNIQUE[1]; + buffer[6] = PROCESS_UNIQUE[2]; + buffer[7] = PROCESS_UNIQUE[3]; + buffer[8] = PROCESS_UNIQUE[4]; + // 3-byte counter + buffer[11] = inc & 0xff; + buffer[10] = (inc >> 8) & 0xff; + buffer[9] = (inc >> 16) & 0xff; + return buffer; + }; + /** + * Converts the id into a 24 character hex string for printing + * + * @param format - The Buffer toString format parameter. + */ + ObjectId.prototype.toString = function (format) { + // Is the id a buffer then use the buffer toString method to return the format + if (format) + return this.id.toString(format); + return this.toHexString(); + }; + /** Converts to its JSON the 24 character hex string representation. */ + ObjectId.prototype.toJSON = function () { + return this.toHexString(); + }; + /** + * Compares the equality of this ObjectId with `otherID`. + * + * @param otherId - ObjectId instance to compare against. + */ + ObjectId.prototype.equals = function (otherId) { + if (otherId === undefined || otherId === null) { + return false; + } + if (otherId instanceof ObjectId) { + return this[kId][11] === otherId[kId][11] && this[kId].equals(otherId[kId]); + } + if (typeof otherId === 'string' && + ObjectId.isValid(otherId) && + otherId.length === 12 && + isUint8Array(this.id)) { + return otherId === buffer_1.prototype.toString.call(this.id, 'latin1'); + } + if (typeof otherId === 'string' && ObjectId.isValid(otherId) && otherId.length === 24) { + return otherId.toLowerCase() === this.toHexString(); + } + if (typeof otherId === 'string' && ObjectId.isValid(otherId) && otherId.length === 12) { + return buffer_1.from(otherId).equals(this.id); + } + if (typeof otherId === 'object' && + 'toHexString' in otherId && + typeof otherId.toHexString === 'function') { + var otherIdString = otherId.toHexString(); + var thisIdString = this.toHexString().toLowerCase(); + return typeof otherIdString === 'string' && otherIdString.toLowerCase() === thisIdString; + } + return false; + }; + /** Returns the generation date (accurate up to the second) that this ID was generated. */ + ObjectId.prototype.getTimestamp = function () { + var timestamp = new Date(); + var time = this.id.readUInt32BE(0); + timestamp.setTime(Math.floor(time) * 1000); + return timestamp; + }; + /** @internal */ + ObjectId.createPk = function () { + return new ObjectId(); + }; + /** + * Creates an ObjectId from a second based number, with the rest of the ObjectId zeroed out. Used for comparisons or sorting the ObjectId. + * + * @param time - an integer number representing a number of seconds. + */ + ObjectId.createFromTime = function (time) { + var buffer = buffer_1.from([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]); + // Encode time into first 4 bytes + buffer.writeUInt32BE(time, 0); + // Return the new objectId + return new ObjectId(buffer); + }; + /** + * Creates an ObjectId from a hex string representation of an ObjectId. + * + * @param hexString - create a ObjectId from a passed in 24 character hexstring. + */ + ObjectId.createFromHexString = function (hexString) { + // Throw an error if it's not a valid setup + if (typeof hexString === 'undefined' || (hexString != null && hexString.length !== 24)) { + throw new BSONTypeError('Argument passed in must be a single String of 12 bytes or a string of 24 hex characters'); + } + return new ObjectId(buffer_1.from(hexString, 'hex')); + }; + /** + * Checks if a value is a valid bson ObjectId + * + * @param id - ObjectId instance to validate. + */ + ObjectId.isValid = function (id) { + if (id == null) + return false; + try { + new ObjectId(id); + return true; + } + catch (_a) { + return false; + } + }; + /** @internal */ + ObjectId.prototype.toExtendedJSON = function () { + if (this.toHexString) + return { $oid: this.toHexString() }; + return { $oid: this.toString('hex') }; + }; + /** @internal */ + ObjectId.fromExtendedJSON = function (doc) { + return new ObjectId(doc.$oid); + }; + /** + * Converts to a string representation of this Id. + * + * @returns return the 24 character hex string representation. + * @internal + */ + ObjectId.prototype[Symbol.for('nodejs.util.inspect.custom')] = function () { + return this.inspect(); + }; + ObjectId.prototype.inspect = function () { + return "new ObjectId(\"" + this.toHexString() + "\")"; + }; + /** @internal */ + ObjectId.index = Math.floor(Math.random() * 0xffffff); + return ObjectId; +}()); +// Deprecated methods +Object.defineProperty(ObjectId.prototype, 'generate', { + value: deprecate(function (time) { return ObjectId.generate(time); }, 'Please use the static `ObjectId.generate(time)` instead') +}); +Object.defineProperty(ObjectId.prototype, 'getInc', { + value: deprecate(function () { return ObjectId.getInc(); }, 'Please use the static `ObjectId.getInc()` instead') +}); +Object.defineProperty(ObjectId.prototype, 'get_inc', { + value: deprecate(function () { return ObjectId.getInc(); }, 'Please use the static `ObjectId.getInc()` instead') +}); +Object.defineProperty(ObjectId, 'get_inc', { + value: deprecate(function () { return ObjectId.getInc(); }, 'Please use the static `ObjectId.getInc()` instead') +}); +Object.defineProperty(ObjectId.prototype, '_bsontype', { value: 'ObjectID' }); + +function alphabetize(str) { + return str.split('').sort().join(''); +} +/** + * A class representation of the BSON RegExp type. + * @public + * @category BSONType + */ +var BSONRegExp = /** @class */ (function () { + /** + * @param pattern - The regular expression pattern to match + * @param options - The regular expression options + */ + function BSONRegExp(pattern, options) { + if (!(this instanceof BSONRegExp)) + return new BSONRegExp(pattern, options); + this.pattern = pattern; + this.options = alphabetize(options !== null && options !== void 0 ? options : ''); + if (this.pattern.indexOf('\x00') !== -1) { + throw new BSONError("BSON Regex patterns cannot contain null bytes, found: " + JSON.stringify(this.pattern)); + } + if (this.options.indexOf('\x00') !== -1) { + throw new BSONError("BSON Regex options cannot contain null bytes, found: " + JSON.stringify(this.options)); + } + // Validate options + for (var i = 0; i < this.options.length; i++) { + if (!(this.options[i] === 'i' || + this.options[i] === 'm' || + this.options[i] === 'x' || + this.options[i] === 'l' || + this.options[i] === 's' || + this.options[i] === 'u')) { + throw new BSONError("The regular expression option [" + this.options[i] + "] is not supported"); + } + } + } + BSONRegExp.parseOptions = function (options) { + return options ? options.split('').sort().join('') : ''; + }; + /** @internal */ + BSONRegExp.prototype.toExtendedJSON = function (options) { + options = options || {}; + if (options.legacy) { + return { $regex: this.pattern, $options: this.options }; + } + return { $regularExpression: { pattern: this.pattern, options: this.options } }; + }; + /** @internal */ + BSONRegExp.fromExtendedJSON = function (doc) { + if ('$regex' in doc) { + if (typeof doc.$regex !== 'string') { + // This is for $regex query operators that have extended json values. + if (doc.$regex._bsontype === 'BSONRegExp') { + return doc; + } + } + else { + return new BSONRegExp(doc.$regex, BSONRegExp.parseOptions(doc.$options)); + } + } + if ('$regularExpression' in doc) { + return new BSONRegExp(doc.$regularExpression.pattern, BSONRegExp.parseOptions(doc.$regularExpression.options)); + } + throw new BSONTypeError("Unexpected BSONRegExp EJSON object form: " + JSON.stringify(doc)); + }; + return BSONRegExp; +}()); +Object.defineProperty(BSONRegExp.prototype, '_bsontype', { value: 'BSONRegExp' }); + +/** + * A class representation of the BSON Symbol type. + * @public + * @category BSONType + */ +var BSONSymbol = /** @class */ (function () { + /** + * @param value - the string representing the symbol. + */ + function BSONSymbol(value) { + if (!(this instanceof BSONSymbol)) + return new BSONSymbol(value); + this.value = value; + } + /** Access the wrapped string value. */ + BSONSymbol.prototype.valueOf = function () { + return this.value; + }; + BSONSymbol.prototype.toString = function () { + return this.value; + }; + /** @internal */ + BSONSymbol.prototype.inspect = function () { + return "new BSONSymbol(\"" + this.value + "\")"; + }; + BSONSymbol.prototype.toJSON = function () { + return this.value; + }; + /** @internal */ + BSONSymbol.prototype.toExtendedJSON = function () { + return { $symbol: this.value }; + }; + /** @internal */ + BSONSymbol.fromExtendedJSON = function (doc) { + return new BSONSymbol(doc.$symbol); + }; + /** @internal */ + BSONSymbol.prototype[Symbol.for('nodejs.util.inspect.custom')] = function () { + return this.inspect(); + }; + return BSONSymbol; +}()); +Object.defineProperty(BSONSymbol.prototype, '_bsontype', { value: 'Symbol' }); + +/** @public */ +var LongWithoutOverridesClass = Long; +/** + * @public + * @category BSONType + * */ +var Timestamp = /** @class */ (function (_super) { + __extends(Timestamp, _super); + function Timestamp(low, high) { + var _this = this; + // eslint-disable-next-line @typescript-eslint/ban-ts-comment + ///@ts-expect-error + if (!(_this instanceof Timestamp)) + return new Timestamp(low, high); + if (Long.isLong(low)) { + _this = _super.call(this, low.low, low.high, true) || this; + } + else if (isObjectLike(low) && typeof low.t !== 'undefined' && typeof low.i !== 'undefined') { + _this = _super.call(this, low.i, low.t, true) || this; + } + else { + _this = _super.call(this, low, high, true) || this; + } + Object.defineProperty(_this, '_bsontype', { + value: 'Timestamp', + writable: false, + configurable: false, + enumerable: false + }); + return _this; + } + Timestamp.prototype.toJSON = function () { + return { + $timestamp: this.toString() + }; + }; + /** Returns a Timestamp represented by the given (32-bit) integer value. */ + Timestamp.fromInt = function (value) { + return new Timestamp(Long.fromInt(value, true)); + }; + /** Returns a Timestamp representing the given number value, provided that it is a finite number. Otherwise, zero is returned. */ + Timestamp.fromNumber = function (value) { + return new Timestamp(Long.fromNumber(value, true)); + }; + /** + * Returns a Timestamp for the given high and low bits. Each is assumed to use 32 bits. + * + * @param lowBits - the low 32-bits. + * @param highBits - the high 32-bits. + */ + Timestamp.fromBits = function (lowBits, highBits) { + return new Timestamp(lowBits, highBits); + }; + /** + * Returns a Timestamp from the given string, optionally using the given radix. + * + * @param str - the textual representation of the Timestamp. + * @param optRadix - the radix in which the text is written. + */ + Timestamp.fromString = function (str, optRadix) { + return new Timestamp(Long.fromString(str, true, optRadix)); + }; + /** @internal */ + Timestamp.prototype.toExtendedJSON = function () { + return { $timestamp: { t: this.high >>> 0, i: this.low >>> 0 } }; + }; + /** @internal */ + Timestamp.fromExtendedJSON = function (doc) { + return new Timestamp(doc.$timestamp); + }; + /** @internal */ + Timestamp.prototype[Symbol.for('nodejs.util.inspect.custom')] = function () { + return this.inspect(); + }; + Timestamp.prototype.inspect = function () { + return "new Timestamp({ t: " + this.getHighBits() + ", i: " + this.getLowBits() + " })"; + }; + Timestamp.MAX_VALUE = Long.MAX_UNSIGNED_VALUE; + return Timestamp; +}(LongWithoutOverridesClass)); + +function isBSONType(value) { + return (isObjectLike(value) && Reflect.has(value, '_bsontype') && typeof value._bsontype === 'string'); +} +// INT32 boundaries +var BSON_INT32_MAX$1 = 0x7fffffff; +var BSON_INT32_MIN$1 = -0x80000000; +// INT64 boundaries +var BSON_INT64_MAX$1 = 0x7fffffffffffffff; +var BSON_INT64_MIN$1 = -0x8000000000000000; +// all the types where we don't need to do any special processing and can just pass the EJSON +//straight to type.fromExtendedJSON +var keysToCodecs = { + $oid: ObjectId, + $binary: Binary, + $uuid: Binary, + $symbol: BSONSymbol, + $numberInt: Int32, + $numberDecimal: Decimal128, + $numberDouble: Double, + $numberLong: Long, + $minKey: MinKey, + $maxKey: MaxKey, + $regex: BSONRegExp, + $regularExpression: BSONRegExp, + $timestamp: Timestamp +}; +// eslint-disable-next-line @typescript-eslint/no-explicit-any +function deserializeValue(value, options) { + if (options === void 0) { options = {}; } + if (typeof value === 'number') { + if (options.relaxed || options.legacy) { + return value; + } + // if it's an integer, should interpret as smallest BSON integer + // that can represent it exactly. (if out of range, interpret as double.) + if (Math.floor(value) === value) { + if (value >= BSON_INT32_MIN$1 && value <= BSON_INT32_MAX$1) + return new Int32(value); + if (value >= BSON_INT64_MIN$1 && value <= BSON_INT64_MAX$1) + return Long.fromNumber(value); + } + // If the number is a non-integer or out of integer range, should interpret as BSON Double. + return new Double(value); + } + // from here on out we're looking for bson types, so bail if its not an object + if (value == null || typeof value !== 'object') + return value; + // upgrade deprecated undefined to null + if (value.$undefined) + return null; + var keys = Object.keys(value).filter(function (k) { return k.startsWith('$') && value[k] != null; }); + for (var i = 0; i < keys.length; i++) { + var c = keysToCodecs[keys[i]]; + if (c) + return c.fromExtendedJSON(value, options); + } + if (value.$date != null) { + var d = value.$date; + var date = new Date(); + if (options.legacy) { + if (typeof d === 'number') + date.setTime(d); + else if (typeof d === 'string') + date.setTime(Date.parse(d)); + } + else { + if (typeof d === 'string') + date.setTime(Date.parse(d)); + else if (Long.isLong(d)) + date.setTime(d.toNumber()); + else if (typeof d === 'number' && options.relaxed) + date.setTime(d); + } + return date; + } + if (value.$code != null) { + var copy = Object.assign({}, value); + if (value.$scope) { + copy.$scope = deserializeValue(value.$scope); + } + return Code.fromExtendedJSON(value); + } + if (isDBRefLike(value) || value.$dbPointer) { + var v = value.$ref ? value : value.$dbPointer; + // we run into this in a "degenerate EJSON" case (with $id and $ref order flipped) + // because of the order JSON.parse goes through the document + if (v instanceof DBRef) + return v; + var dollarKeys = Object.keys(v).filter(function (k) { return k.startsWith('$'); }); + var valid_1 = true; + dollarKeys.forEach(function (k) { + if (['$ref', '$id', '$db'].indexOf(k) === -1) + valid_1 = false; + }); + // only make DBRef if $ keys are all valid + if (valid_1) + return DBRef.fromExtendedJSON(v); + } + return value; +} +// eslint-disable-next-line @typescript-eslint/no-explicit-any +function serializeArray(array, options) { + return array.map(function (v, index) { + options.seenObjects.push({ propertyName: "index " + index, obj: null }); + try { + return serializeValue(v, options); + } + finally { + options.seenObjects.pop(); + } + }); +} +function getISOString(date) { + var isoStr = date.toISOString(); + // we should only show milliseconds in timestamp if they're non-zero + return date.getUTCMilliseconds() !== 0 ? isoStr : isoStr.slice(0, -5) + 'Z'; +} +// eslint-disable-next-line @typescript-eslint/no-explicit-any +function serializeValue(value, options) { + if ((typeof value === 'object' || typeof value === 'function') && value !== null) { + var index = options.seenObjects.findIndex(function (entry) { return entry.obj === value; }); + if (index !== -1) { + var props = options.seenObjects.map(function (entry) { return entry.propertyName; }); + var leadingPart = props + .slice(0, index) + .map(function (prop) { return prop + " -> "; }) + .join(''); + var alreadySeen = props[index]; + var circularPart = ' -> ' + + props + .slice(index + 1, props.length - 1) + .map(function (prop) { return prop + " -> "; }) + .join(''); + var current = props[props.length - 1]; + var leadingSpace = ' '.repeat(leadingPart.length + alreadySeen.length / 2); + var dashes = '-'.repeat(circularPart.length + (alreadySeen.length + current.length) / 2 - 1); + throw new BSONTypeError('Converting circular structure to EJSON:\n' + + (" " + leadingPart + alreadySeen + circularPart + current + "\n") + + (" " + leadingSpace + "\\" + dashes + "/")); + } + options.seenObjects[options.seenObjects.length - 1].obj = value; + } + if (Array.isArray(value)) + return serializeArray(value, options); + if (value === undefined) + return null; + if (value instanceof Date || isDate(value)) { + var dateNum = value.getTime(), + // is it in year range 1970-9999? + inRange = dateNum > -1 && dateNum < 253402318800000; + if (options.legacy) { + return options.relaxed && inRange + ? { $date: value.getTime() } + : { $date: getISOString(value) }; + } + return options.relaxed && inRange + ? { $date: getISOString(value) } + : { $date: { $numberLong: value.getTime().toString() } }; + } + if (typeof value === 'number' && (!options.relaxed || !isFinite(value))) { + // it's an integer + if (Math.floor(value) === value) { + var int32Range = value >= BSON_INT32_MIN$1 && value <= BSON_INT32_MAX$1, int64Range = value >= BSON_INT64_MIN$1 && value <= BSON_INT64_MAX$1; + // interpret as being of the smallest BSON integer type that can represent the number exactly + if (int32Range) + return { $numberInt: value.toString() }; + if (int64Range) + return { $numberLong: value.toString() }; + } + return { $numberDouble: value.toString() }; + } + if (value instanceof RegExp || isRegExp(value)) { + var flags = value.flags; + if (flags === undefined) { + var match = value.toString().match(/[gimuy]*$/); + if (match) { + flags = match[0]; + } + } + var rx = new BSONRegExp(value.source, flags); + return rx.toExtendedJSON(options); + } + if (value != null && typeof value === 'object') + return serializeDocument(value, options); + return value; +} +var BSON_TYPE_MAPPINGS = { + Binary: function (o) { return new Binary(o.value(), o.sub_type); }, + Code: function (o) { return new Code(o.code, o.scope); }, + DBRef: function (o) { return new DBRef(o.collection || o.namespace, o.oid, o.db, o.fields); }, + Decimal128: function (o) { return new Decimal128(o.bytes); }, + Double: function (o) { return new Double(o.value); }, + Int32: function (o) { return new Int32(o.value); }, + Long: function (o) { + return Long.fromBits( + // underscore variants for 1.x backwards compatibility + o.low != null ? o.low : o.low_, o.low != null ? o.high : o.high_, o.low != null ? o.unsigned : o.unsigned_); + }, + MaxKey: function () { return new MaxKey(); }, + MinKey: function () { return new MinKey(); }, + ObjectID: function (o) { return new ObjectId(o); }, + ObjectId: function (o) { return new ObjectId(o); }, + BSONRegExp: function (o) { return new BSONRegExp(o.pattern, o.options); }, + Symbol: function (o) { return new BSONSymbol(o.value); }, + Timestamp: function (o) { return Timestamp.fromBits(o.low, o.high); } +}; +// eslint-disable-next-line @typescript-eslint/no-explicit-any +function serializeDocument(doc, options) { + if (doc == null || typeof doc !== 'object') + throw new BSONError('not an object instance'); + var bsontype = doc._bsontype; + if (typeof bsontype === 'undefined') { + // It's a regular object. Recursively serialize its property values. + var _doc = {}; + for (var name in doc) { + options.seenObjects.push({ propertyName: name, obj: null }); + try { + _doc[name] = serializeValue(doc[name], options); + } + finally { + options.seenObjects.pop(); + } + } + return _doc; + } + else if (isBSONType(doc)) { + // the "document" is really just a BSON type object + // eslint-disable-next-line @typescript-eslint/no-explicit-any + var outDoc = doc; + if (typeof outDoc.toExtendedJSON !== 'function') { + // There's no EJSON serialization function on the object. It's probably an + // object created by a previous version of this library (or another library) + // that's duck-typing objects to look like they were generated by this library). + // Copy the object into this library's version of that type. + var mapper = BSON_TYPE_MAPPINGS[doc._bsontype]; + if (!mapper) { + throw new BSONTypeError('Unrecognized or invalid _bsontype: ' + doc._bsontype); + } + outDoc = mapper(outDoc); + } + // Two BSON types may have nested objects that may need to be serialized too + if (bsontype === 'Code' && outDoc.scope) { + outDoc = new Code(outDoc.code, serializeValue(outDoc.scope, options)); + } + else if (bsontype === 'DBRef' && outDoc.oid) { + outDoc = new DBRef(serializeValue(outDoc.collection, options), serializeValue(outDoc.oid, options), serializeValue(outDoc.db, options), serializeValue(outDoc.fields, options)); + } + return outDoc.toExtendedJSON(options); + } + else { + throw new BSONError('_bsontype must be a string, but was: ' + typeof bsontype); + } +} +/** + * EJSON parse / stringify API + * @public + */ +// the namespace here is used to emulate `export * as EJSON from '...'` +// which as of now (sept 2020) api-extractor does not support +// eslint-disable-next-line @typescript-eslint/no-namespace +var EJSON; +(function (EJSON) { + /** + * Parse an Extended JSON string, constructing the JavaScript value or object described by that + * string. + * + * @example + * ```js + * const { EJSON } = require('bson'); + * const text = '{ "int32": { "$numberInt": "10" } }'; + * + * // prints { int32: { [String: '10'] _bsontype: 'Int32', value: '10' } } + * console.log(EJSON.parse(text, { relaxed: false })); + * + * // prints { int32: 10 } + * console.log(EJSON.parse(text)); + * ``` + */ + function parse(text, options) { + var finalOptions = Object.assign({}, { relaxed: true, legacy: false }, options); + // relaxed implies not strict + if (typeof finalOptions.relaxed === 'boolean') + finalOptions.strict = !finalOptions.relaxed; + if (typeof finalOptions.strict === 'boolean') + finalOptions.relaxed = !finalOptions.strict; + return JSON.parse(text, function (key, value) { + if (key.indexOf('\x00') !== -1) { + throw new BSONError("BSON Document field names cannot contain null bytes, found: " + JSON.stringify(key)); + } + return deserializeValue(value, finalOptions); + }); + } + EJSON.parse = parse; + /** + * Converts a BSON document to an Extended JSON string, optionally replacing values if a replacer + * function is specified or optionally including only the specified properties if a replacer array + * is specified. + * + * @param value - The value to convert to extended JSON + * @param replacer - A function that alters the behavior of the stringification process, or an array of String and Number objects that serve as a whitelist for selecting/filtering the properties of the value object to be included in the JSON string. If this value is null or not provided, all properties of the object are included in the resulting JSON string + * @param space - A String or Number object that's used to insert white space into the output JSON string for readability purposes. + * @param options - Optional settings + * + * @example + * ```js + * const { EJSON } = require('bson'); + * const Int32 = require('mongodb').Int32; + * const doc = { int32: new Int32(10) }; + * + * // prints '{"int32":{"$numberInt":"10"}}' + * console.log(EJSON.stringify(doc, { relaxed: false })); + * + * // prints '{"int32":10}' + * console.log(EJSON.stringify(doc)); + * ``` + */ + function stringify(value, + // eslint-disable-next-line @typescript-eslint/no-explicit-any + replacer, space, options) { + if (space != null && typeof space === 'object') { + options = space; + space = 0; + } + if (replacer != null && typeof replacer === 'object' && !Array.isArray(replacer)) { + options = replacer; + replacer = undefined; + space = 0; + } + var serializeOptions = Object.assign({ relaxed: true, legacy: false }, options, { + seenObjects: [{ propertyName: '(root)', obj: null }] + }); + var doc = serializeValue(value, serializeOptions); + return JSON.stringify(doc, replacer, space); + } + EJSON.stringify = stringify; + /** + * Serializes an object to an Extended JSON string, and reparse it as a JavaScript object. + * + * @param value - The object to serialize + * @param options - Optional settings passed to the `stringify` function + */ + function serialize(value, options) { + options = options || {}; + return JSON.parse(stringify(value, options)); + } + EJSON.serialize = serialize; + /** + * Deserializes an Extended JSON object into a plain JavaScript object with native/BSON types + * + * @param ejson - The Extended JSON object to deserialize + * @param options - Optional settings passed to the parse method + */ + function deserialize(ejson, options) { + options = options || {}; + return parse(JSON.stringify(ejson), options); + } + EJSON.deserialize = deserialize; +})(EJSON || (EJSON = {})); + +/* eslint-disable @typescript-eslint/no-explicit-any */ +/** @public */ +var bsonMap; +var bsonGlobal = getGlobal(); +if (bsonGlobal.Map) { + bsonMap = bsonGlobal.Map; +} +else { + // We will return a polyfill + bsonMap = /** @class */ (function () { + function Map(array) { + if (array === void 0) { array = []; } + this._keys = []; + this._values = {}; + for (var i = 0; i < array.length; i++) { + if (array[i] == null) + continue; // skip null and undefined + var entry = array[i]; + var key = entry[0]; + var value = entry[1]; + // Add the key to the list of keys in order + this._keys.push(key); + // Add the key and value to the values dictionary with a point + // to the location in the ordered keys list + this._values[key] = { v: value, i: this._keys.length - 1 }; + } + } + Map.prototype.clear = function () { + this._keys = []; + this._values = {}; + }; + Map.prototype.delete = function (key) { + var value = this._values[key]; + if (value == null) + return false; + // Delete entry + delete this._values[key]; + // Remove the key from the ordered keys list + this._keys.splice(value.i, 1); + return true; + }; + Map.prototype.entries = function () { + var _this = this; + var index = 0; + return { + next: function () { + var key = _this._keys[index++]; + return { + value: key !== undefined ? [key, _this._values[key].v] : undefined, + done: key !== undefined ? false : true + }; + } + }; + }; + Map.prototype.forEach = function (callback, self) { + self = self || this; + for (var i = 0; i < this._keys.length; i++) { + var key = this._keys[i]; + // Call the forEach callback + callback.call(self, this._values[key].v, key, self); + } + }; + Map.prototype.get = function (key) { + return this._values[key] ? this._values[key].v : undefined; + }; + Map.prototype.has = function (key) { + return this._values[key] != null; + }; + Map.prototype.keys = function () { + var _this = this; + var index = 0; + return { + next: function () { + var key = _this._keys[index++]; + return { + value: key !== undefined ? key : undefined, + done: key !== undefined ? false : true + }; + } + }; + }; + Map.prototype.set = function (key, value) { + if (this._values[key]) { + this._values[key].v = value; + return this; + } + // Add the key to the list of keys in order + this._keys.push(key); + // Add the key and value to the values dictionary with a point + // to the location in the ordered keys list + this._values[key] = { v: value, i: this._keys.length - 1 }; + return this; + }; + Map.prototype.values = function () { + var _this = this; + var index = 0; + return { + next: function () { + var key = _this._keys[index++]; + return { + value: key !== undefined ? _this._values[key].v : undefined, + done: key !== undefined ? false : true + }; + } + }; + }; + Object.defineProperty(Map.prototype, "size", { + get: function () { + return this._keys.length; + }, + enumerable: false, + configurable: true + }); + return Map; + }()); +} + +/** @internal */ +var BSON_INT32_MAX = 0x7fffffff; +/** @internal */ +var BSON_INT32_MIN = -0x80000000; +/** @internal */ +var BSON_INT64_MAX = Math.pow(2, 63) - 1; +/** @internal */ +var BSON_INT64_MIN = -Math.pow(2, 63); +/** + * Any integer up to 2^53 can be precisely represented by a double. + * @internal + */ +var JS_INT_MAX = Math.pow(2, 53); +/** + * Any integer down to -2^53 can be precisely represented by a double. + * @internal + */ +var JS_INT_MIN = -Math.pow(2, 53); +/** Number BSON Type @internal */ +var BSON_DATA_NUMBER = 1; +/** String BSON Type @internal */ +var BSON_DATA_STRING = 2; +/** Object BSON Type @internal */ +var BSON_DATA_OBJECT = 3; +/** Array BSON Type @internal */ +var BSON_DATA_ARRAY = 4; +/** Binary BSON Type @internal */ +var BSON_DATA_BINARY = 5; +/** Binary BSON Type @internal */ +var BSON_DATA_UNDEFINED = 6; +/** ObjectId BSON Type @internal */ +var BSON_DATA_OID = 7; +/** Boolean BSON Type @internal */ +var BSON_DATA_BOOLEAN = 8; +/** Date BSON Type @internal */ +var BSON_DATA_DATE = 9; +/** null BSON Type @internal */ +var BSON_DATA_NULL = 10; +/** RegExp BSON Type @internal */ +var BSON_DATA_REGEXP = 11; +/** Code BSON Type @internal */ +var BSON_DATA_DBPOINTER = 12; +/** Code BSON Type @internal */ +var BSON_DATA_CODE = 13; +/** Symbol BSON Type @internal */ +var BSON_DATA_SYMBOL = 14; +/** Code with Scope BSON Type @internal */ +var BSON_DATA_CODE_W_SCOPE = 15; +/** 32 bit Integer BSON Type @internal */ +var BSON_DATA_INT = 16; +/** Timestamp BSON Type @internal */ +var BSON_DATA_TIMESTAMP = 17; +/** Long BSON Type @internal */ +var BSON_DATA_LONG = 18; +/** Decimal128 BSON Type @internal */ +var BSON_DATA_DECIMAL128 = 19; +/** MinKey BSON Type @internal */ +var BSON_DATA_MIN_KEY = 0xff; +/** MaxKey BSON Type @internal */ +var BSON_DATA_MAX_KEY = 0x7f; +/** Binary Default Type @internal */ +var BSON_BINARY_SUBTYPE_DEFAULT = 0; +/** Binary Function Type @internal */ +var BSON_BINARY_SUBTYPE_FUNCTION = 1; +/** Binary Byte Array Type @internal */ +var BSON_BINARY_SUBTYPE_BYTE_ARRAY = 2; +/** Binary Deprecated UUID Type @deprecated Please use BSON_BINARY_SUBTYPE_UUID_NEW @internal */ +var BSON_BINARY_SUBTYPE_UUID = 3; +/** Binary UUID Type @internal */ +var BSON_BINARY_SUBTYPE_UUID_NEW = 4; +/** Binary MD5 Type @internal */ +var BSON_BINARY_SUBTYPE_MD5 = 5; +/** Encrypted BSON type @internal */ +var BSON_BINARY_SUBTYPE_ENCRYPTED = 6; +/** Column BSON type @internal */ +var BSON_BINARY_SUBTYPE_COLUMN = 7; +/** Binary User Defined Type @internal */ +var BSON_BINARY_SUBTYPE_USER_DEFINED = 128; + +function calculateObjectSize$1(object, serializeFunctions, ignoreUndefined) { + var totalLength = 4 + 1; + if (Array.isArray(object)) { + for (var i = 0; i < object.length; i++) { + totalLength += calculateElement(i.toString(), object[i], serializeFunctions, true, ignoreUndefined); + } + } + else { + // If we have toBSON defined, override the current object + if (typeof (object === null || object === void 0 ? void 0 : object.toBSON) === 'function') { + object = object.toBSON(); + } + // Calculate size + for (var key in object) { + totalLength += calculateElement(key, object[key], serializeFunctions, false, ignoreUndefined); + } + } + return totalLength; +} +/** @internal */ +function calculateElement(name, +// eslint-disable-next-line @typescript-eslint/no-explicit-any +value, serializeFunctions, isArray, ignoreUndefined) { + if (serializeFunctions === void 0) { serializeFunctions = false; } + if (isArray === void 0) { isArray = false; } + if (ignoreUndefined === void 0) { ignoreUndefined = false; } + // If we have toBSON defined, override the current object + if (typeof (value === null || value === void 0 ? void 0 : value.toBSON) === 'function') { + value = value.toBSON(); + } + switch (typeof value) { + case 'string': + return 1 + buffer_1.byteLength(name, 'utf8') + 1 + 4 + buffer_1.byteLength(value, 'utf8') + 1; + case 'number': + if (Math.floor(value) === value && + value >= JS_INT_MIN && + value <= JS_INT_MAX) { + if (value >= BSON_INT32_MIN && value <= BSON_INT32_MAX) { + // 32 bit + return (name != null ? buffer_1.byteLength(name, 'utf8') + 1 : 0) + (4 + 1); + } + else { + return (name != null ? buffer_1.byteLength(name, 'utf8') + 1 : 0) + (8 + 1); + } + } + else { + // 64 bit + return (name != null ? buffer_1.byteLength(name, 'utf8') + 1 : 0) + (8 + 1); + } + case 'undefined': + if (isArray || !ignoreUndefined) + return (name != null ? buffer_1.byteLength(name, 'utf8') + 1 : 0) + 1; + return 0; + case 'boolean': + return (name != null ? buffer_1.byteLength(name, 'utf8') + 1 : 0) + (1 + 1); + case 'object': + if (value == null || value['_bsontype'] === 'MinKey' || value['_bsontype'] === 'MaxKey') { + return (name != null ? buffer_1.byteLength(name, 'utf8') + 1 : 0) + 1; + } + else if (value['_bsontype'] === 'ObjectId' || value['_bsontype'] === 'ObjectID') { + return (name != null ? buffer_1.byteLength(name, 'utf8') + 1 : 0) + (12 + 1); + } + else if (value instanceof Date || isDate(value)) { + return (name != null ? buffer_1.byteLength(name, 'utf8') + 1 : 0) + (8 + 1); + } + else if (ArrayBuffer.isView(value) || + value instanceof ArrayBuffer || + isAnyArrayBuffer(value)) { + return ((name != null ? buffer_1.byteLength(name, 'utf8') + 1 : 0) + (1 + 4 + 1) + value.byteLength); + } + else if (value['_bsontype'] === 'Long' || + value['_bsontype'] === 'Double' || + value['_bsontype'] === 'Timestamp') { + return (name != null ? buffer_1.byteLength(name, 'utf8') + 1 : 0) + (8 + 1); + } + else if (value['_bsontype'] === 'Decimal128') { + return (name != null ? buffer_1.byteLength(name, 'utf8') + 1 : 0) + (16 + 1); + } + else if (value['_bsontype'] === 'Code') { + // Calculate size depending on the availability of a scope + if (value.scope != null && Object.keys(value.scope).length > 0) { + return ((name != null ? buffer_1.byteLength(name, 'utf8') + 1 : 0) + + 1 + + 4 + + 4 + + buffer_1.byteLength(value.code.toString(), 'utf8') + + 1 + + calculateObjectSize$1(value.scope, serializeFunctions, ignoreUndefined)); + } + else { + return ((name != null ? buffer_1.byteLength(name, 'utf8') + 1 : 0) + + 1 + + 4 + + buffer_1.byteLength(value.code.toString(), 'utf8') + + 1); + } + } + else if (value['_bsontype'] === 'Binary') { + // Check what kind of subtype we have + if (value.sub_type === Binary.SUBTYPE_BYTE_ARRAY) { + return ((name != null ? buffer_1.byteLength(name, 'utf8') + 1 : 0) + + (value.position + 1 + 4 + 1 + 4)); + } + else { + return ((name != null ? buffer_1.byteLength(name, 'utf8') + 1 : 0) + (value.position + 1 + 4 + 1)); + } + } + else if (value['_bsontype'] === 'Symbol') { + return ((name != null ? buffer_1.byteLength(name, 'utf8') + 1 : 0) + + buffer_1.byteLength(value.value, 'utf8') + + 4 + + 1 + + 1); + } + else if (value['_bsontype'] === 'DBRef') { + // Set up correct object for serialization + var ordered_values = Object.assign({ + $ref: value.collection, + $id: value.oid + }, value.fields); + // Add db reference if it exists + if (value.db != null) { + ordered_values['$db'] = value.db; + } + return ((name != null ? buffer_1.byteLength(name, 'utf8') + 1 : 0) + + 1 + + calculateObjectSize$1(ordered_values, serializeFunctions, ignoreUndefined)); + } + else if (value instanceof RegExp || isRegExp(value)) { + return ((name != null ? buffer_1.byteLength(name, 'utf8') + 1 : 0) + + 1 + + buffer_1.byteLength(value.source, 'utf8') + + 1 + + (value.global ? 1 : 0) + + (value.ignoreCase ? 1 : 0) + + (value.multiline ? 1 : 0) + + 1); + } + else if (value['_bsontype'] === 'BSONRegExp') { + return ((name != null ? buffer_1.byteLength(name, 'utf8') + 1 : 0) + + 1 + + buffer_1.byteLength(value.pattern, 'utf8') + + 1 + + buffer_1.byteLength(value.options, 'utf8') + + 1); + } + else { + return ((name != null ? buffer_1.byteLength(name, 'utf8') + 1 : 0) + + calculateObjectSize$1(value, serializeFunctions, ignoreUndefined) + + 1); + } + case 'function': + // WTF for 0.4.X where typeof /someregexp/ === 'function' + if (value instanceof RegExp || isRegExp(value) || String.call(value) === '[object RegExp]') { + return ((name != null ? buffer_1.byteLength(name, 'utf8') + 1 : 0) + + 1 + + buffer_1.byteLength(value.source, 'utf8') + + 1 + + (value.global ? 1 : 0) + + (value.ignoreCase ? 1 : 0) + + (value.multiline ? 1 : 0) + + 1); + } + else { + if (serializeFunctions && value.scope != null && Object.keys(value.scope).length > 0) { + return ((name != null ? buffer_1.byteLength(name, 'utf8') + 1 : 0) + + 1 + + 4 + + 4 + + buffer_1.byteLength(normalizedFunctionString(value), 'utf8') + + 1 + + calculateObjectSize$1(value.scope, serializeFunctions, ignoreUndefined)); + } + else if (serializeFunctions) { + return ((name != null ? buffer_1.byteLength(name, 'utf8') + 1 : 0) + + 1 + + 4 + + buffer_1.byteLength(normalizedFunctionString(value), 'utf8') + + 1); + } + } + } + return 0; +} + +var FIRST_BIT = 0x80; +var FIRST_TWO_BITS = 0xc0; +var FIRST_THREE_BITS = 0xe0; +var FIRST_FOUR_BITS = 0xf0; +var FIRST_FIVE_BITS = 0xf8; +var TWO_BIT_CHAR = 0xc0; +var THREE_BIT_CHAR = 0xe0; +var FOUR_BIT_CHAR = 0xf0; +var CONTINUING_CHAR = 0x80; +/** + * Determines if the passed in bytes are valid utf8 + * @param bytes - An array of 8-bit bytes. Must be indexable and have length property + * @param start - The index to start validating + * @param end - The index to end validating + */ +function validateUtf8(bytes, start, end) { + var continuation = 0; + for (var i = start; i < end; i += 1) { + var byte = bytes[i]; + if (continuation) { + if ((byte & FIRST_TWO_BITS) !== CONTINUING_CHAR) { + return false; + } + continuation -= 1; + } + else if (byte & FIRST_BIT) { + if ((byte & FIRST_THREE_BITS) === TWO_BIT_CHAR) { + continuation = 1; + } + else if ((byte & FIRST_FOUR_BITS) === THREE_BIT_CHAR) { + continuation = 2; + } + else if ((byte & FIRST_FIVE_BITS) === FOUR_BIT_CHAR) { + continuation = 3; + } + else { + return false; + } + } + } + return !continuation; +} + +// Internal long versions +var JS_INT_MAX_LONG = Long.fromNumber(JS_INT_MAX); +var JS_INT_MIN_LONG = Long.fromNumber(JS_INT_MIN); +var functionCache = {}; +function deserialize$1(buffer, options, isArray) { + options = options == null ? {} : options; + var index = options && options.index ? options.index : 0; + // Read the document size + var size = buffer[index] | + (buffer[index + 1] << 8) | + (buffer[index + 2] << 16) | + (buffer[index + 3] << 24); + if (size < 5) { + throw new BSONError("bson size must be >= 5, is " + size); + } + if (options.allowObjectSmallerThanBufferSize && buffer.length < size) { + throw new BSONError("buffer length " + buffer.length + " must be >= bson size " + size); + } + if (!options.allowObjectSmallerThanBufferSize && buffer.length !== size) { + throw new BSONError("buffer length " + buffer.length + " must === bson size " + size); + } + if (size + index > buffer.byteLength) { + throw new BSONError("(bson size " + size + " + options.index " + index + " must be <= buffer length " + buffer.byteLength + ")"); + } + // Illegal end value + if (buffer[index + size - 1] !== 0) { + throw new BSONError("One object, sized correctly, with a spot for an EOO, but the EOO isn't 0x00"); + } + // Start deserializtion + return deserializeObject(buffer, index, options, isArray); +} +var allowedDBRefKeys = /^\$ref$|^\$id$|^\$db$/; +function deserializeObject(buffer, index, options, isArray) { + if (isArray === void 0) { isArray = false; } + var evalFunctions = options['evalFunctions'] == null ? false : options['evalFunctions']; + var cacheFunctions = options['cacheFunctions'] == null ? false : options['cacheFunctions']; + var fieldsAsRaw = options['fieldsAsRaw'] == null ? null : options['fieldsAsRaw']; + // Return raw bson buffer instead of parsing it + var raw = options['raw'] == null ? false : options['raw']; + // Return BSONRegExp objects instead of native regular expressions + var bsonRegExp = typeof options['bsonRegExp'] === 'boolean' ? options['bsonRegExp'] : false; + // Controls the promotion of values vs wrapper classes + var promoteBuffers = options['promoteBuffers'] == null ? false : options['promoteBuffers']; + var promoteLongs = options['promoteLongs'] == null ? true : options['promoteLongs']; + var promoteValues = options['promoteValues'] == null ? true : options['promoteValues']; + // Ensures default validation option if none given + var validation = options.validation == null ? { utf8: true } : options.validation; + // Shows if global utf-8 validation is enabled or disabled + var globalUTFValidation = true; + // Reflects utf-8 validation setting regardless of global or specific key validation + var validationSetting; + // Set of keys either to enable or disable validation on + var utf8KeysSet = new Set(); + // Check for boolean uniformity and empty validation option + var utf8ValidatedKeys = validation.utf8; + if (typeof utf8ValidatedKeys === 'boolean') { + validationSetting = utf8ValidatedKeys; + } + else { + globalUTFValidation = false; + var utf8ValidationValues = Object.keys(utf8ValidatedKeys).map(function (key) { + return utf8ValidatedKeys[key]; + }); + if (utf8ValidationValues.length === 0) { + throw new BSONError('UTF-8 validation setting cannot be empty'); + } + if (typeof utf8ValidationValues[0] !== 'boolean') { + throw new BSONError('Invalid UTF-8 validation option, must specify boolean values'); + } + validationSetting = utf8ValidationValues[0]; + // Ensures boolean uniformity in utf-8 validation (all true or all false) + if (!utf8ValidationValues.every(function (item) { return item === validationSetting; })) { + throw new BSONError('Invalid UTF-8 validation option - keys must be all true or all false'); + } + } + // Add keys to set that will either be validated or not based on validationSetting + if (!globalUTFValidation) { + for (var _i = 0, _a = Object.keys(utf8ValidatedKeys); _i < _a.length; _i++) { + var key = _a[_i]; + utf8KeysSet.add(key); + } + } + // Set the start index + var startIndex = index; + // Validate that we have at least 4 bytes of buffer + if (buffer.length < 5) + throw new BSONError('corrupt bson message < 5 bytes long'); + // Read the document size + var size = buffer[index++] | (buffer[index++] << 8) | (buffer[index++] << 16) | (buffer[index++] << 24); + // Ensure buffer is valid size + if (size < 5 || size > buffer.length) + throw new BSONError('corrupt bson message'); + // Create holding object + var object = isArray ? [] : {}; + // Used for arrays to skip having to perform utf8 decoding + var arrayIndex = 0; + var done = false; + var isPossibleDBRef = isArray ? false : null; + // While we have more left data left keep parsing + while (!done) { + // Read the type + var elementType = buffer[index++]; + // If we get a zero it's the last byte, exit + if (elementType === 0) + break; + // Get the start search index + var i = index; + // Locate the end of the c string + while (buffer[i] !== 0x00 && i < buffer.length) { + i++; + } + // If are at the end of the buffer there is a problem with the document + if (i >= buffer.byteLength) + throw new BSONError('Bad BSON Document: illegal CString'); + // Represents the key + var name = isArray ? arrayIndex++ : buffer.toString('utf8', index, i); + // shouldValidateKey is true if the key should be validated, false otherwise + var shouldValidateKey = true; + if (globalUTFValidation || utf8KeysSet.has(name)) { + shouldValidateKey = validationSetting; + } + else { + shouldValidateKey = !validationSetting; + } + if (isPossibleDBRef !== false && name[0] === '$') { + isPossibleDBRef = allowedDBRefKeys.test(name); + } + var value = void 0; + index = i + 1; + if (elementType === BSON_DATA_STRING) { + var stringSize = buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + if (stringSize <= 0 || + stringSize > buffer.length - index || + buffer[index + stringSize - 1] !== 0) { + throw new BSONError('bad string length in bson'); + } + value = getValidatedString(buffer, index, index + stringSize - 1, shouldValidateKey); + index = index + stringSize; + } + else if (elementType === BSON_DATA_OID) { + var oid = buffer_1.alloc(12); + buffer.copy(oid, 0, index, index + 12); + value = new ObjectId(oid); + index = index + 12; + } + else if (elementType === BSON_DATA_INT && promoteValues === false) { + value = new Int32(buffer[index++] | (buffer[index++] << 8) | (buffer[index++] << 16) | (buffer[index++] << 24)); + } + else if (elementType === BSON_DATA_INT) { + value = + buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + } + else if (elementType === BSON_DATA_NUMBER && promoteValues === false) { + value = new Double(buffer.readDoubleLE(index)); + index = index + 8; + } + else if (elementType === BSON_DATA_NUMBER) { + value = buffer.readDoubleLE(index); + index = index + 8; + } + else if (elementType === BSON_DATA_DATE) { + var lowBits = buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + var highBits = buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + value = new Date(new Long(lowBits, highBits).toNumber()); + } + else if (elementType === BSON_DATA_BOOLEAN) { + if (buffer[index] !== 0 && buffer[index] !== 1) + throw new BSONError('illegal boolean type value'); + value = buffer[index++] === 1; + } + else if (elementType === BSON_DATA_OBJECT) { + var _index = index; + var objectSize = buffer[index] | + (buffer[index + 1] << 8) | + (buffer[index + 2] << 16) | + (buffer[index + 3] << 24); + if (objectSize <= 0 || objectSize > buffer.length - index) + throw new BSONError('bad embedded document length in bson'); + // We have a raw value + if (raw) { + value = buffer.slice(index, index + objectSize); + } + else { + var objectOptions = options; + if (!globalUTFValidation) { + objectOptions = _assign(_assign({}, options), { validation: { utf8: shouldValidateKey } }); + } + value = deserializeObject(buffer, _index, objectOptions, false); + } + index = index + objectSize; + } + else if (elementType === BSON_DATA_ARRAY) { + var _index = index; + var objectSize = buffer[index] | + (buffer[index + 1] << 8) | + (buffer[index + 2] << 16) | + (buffer[index + 3] << 24); + var arrayOptions = options; + // Stop index + var stopIndex = index + objectSize; + // All elements of array to be returned as raw bson + if (fieldsAsRaw && fieldsAsRaw[name]) { + arrayOptions = {}; + for (var n in options) { + arrayOptions[n] = options[n]; + } + arrayOptions['raw'] = true; + } + if (!globalUTFValidation) { + arrayOptions = _assign(_assign({}, arrayOptions), { validation: { utf8: shouldValidateKey } }); + } + value = deserializeObject(buffer, _index, arrayOptions, true); + index = index + objectSize; + if (buffer[index - 1] !== 0) + throw new BSONError('invalid array terminator byte'); + if (index !== stopIndex) + throw new BSONError('corrupted array bson'); + } + else if (elementType === BSON_DATA_UNDEFINED) { + value = undefined; + } + else if (elementType === BSON_DATA_NULL) { + value = null; + } + else if (elementType === BSON_DATA_LONG) { + // Unpack the low and high bits + var lowBits = buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + var highBits = buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + var long = new Long(lowBits, highBits); + // Promote the long if possible + if (promoteLongs && promoteValues === true) { + value = + long.lessThanOrEqual(JS_INT_MAX_LONG) && long.greaterThanOrEqual(JS_INT_MIN_LONG) + ? long.toNumber() + : long; + } + else { + value = long; + } + } + else if (elementType === BSON_DATA_DECIMAL128) { + // Buffer to contain the decimal bytes + var bytes = buffer_1.alloc(16); + // Copy the next 16 bytes into the bytes buffer + buffer.copy(bytes, 0, index, index + 16); + // Update index + index = index + 16; + // Assign the new Decimal128 value + var decimal128 = new Decimal128(bytes); + // If we have an alternative mapper use that + if ('toObject' in decimal128 && typeof decimal128.toObject === 'function') { + value = decimal128.toObject(); + } + else { + value = decimal128; + } + } + else if (elementType === BSON_DATA_BINARY) { + var binarySize = buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + var totalBinarySize = binarySize; + var subType = buffer[index++]; + // Did we have a negative binary size, throw + if (binarySize < 0) + throw new BSONError('Negative binary type element size found'); + // Is the length longer than the document + if (binarySize > buffer.byteLength) + throw new BSONError('Binary type size larger than document size'); + // Decode as raw Buffer object if options specifies it + if (buffer['slice'] != null) { + // If we have subtype 2 skip the 4 bytes for the size + if (subType === Binary.SUBTYPE_BYTE_ARRAY) { + binarySize = + buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + if (binarySize < 0) + throw new BSONError('Negative binary type element size found for subtype 0x02'); + if (binarySize > totalBinarySize - 4) + throw new BSONError('Binary type with subtype 0x02 contains too long binary size'); + if (binarySize < totalBinarySize - 4) + throw new BSONError('Binary type with subtype 0x02 contains too short binary size'); + } + if (promoteBuffers && promoteValues) { + value = buffer.slice(index, index + binarySize); + } + else { + value = new Binary(buffer.slice(index, index + binarySize), subType); + } + } + else { + var _buffer = buffer_1.alloc(binarySize); + // If we have subtype 2 skip the 4 bytes for the size + if (subType === Binary.SUBTYPE_BYTE_ARRAY) { + binarySize = + buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + if (binarySize < 0) + throw new BSONError('Negative binary type element size found for subtype 0x02'); + if (binarySize > totalBinarySize - 4) + throw new BSONError('Binary type with subtype 0x02 contains too long binary size'); + if (binarySize < totalBinarySize - 4) + throw new BSONError('Binary type with subtype 0x02 contains too short binary size'); + } + // Copy the data + for (i = 0; i < binarySize; i++) { + _buffer[i] = buffer[index + i]; + } + if (promoteBuffers && promoteValues) { + value = _buffer; + } + else { + value = new Binary(_buffer, subType); + } + } + // Update the index + index = index + binarySize; + } + else if (elementType === BSON_DATA_REGEXP && bsonRegExp === false) { + // Get the start search index + i = index; + // Locate the end of the c string + while (buffer[i] !== 0x00 && i < buffer.length) { + i++; + } + // If are at the end of the buffer there is a problem with the document + if (i >= buffer.length) + throw new BSONError('Bad BSON Document: illegal CString'); + // Return the C string + var source = buffer.toString('utf8', index, i); + // Create the regexp + index = i + 1; + // Get the start search index + i = index; + // Locate the end of the c string + while (buffer[i] !== 0x00 && i < buffer.length) { + i++; + } + // If are at the end of the buffer there is a problem with the document + if (i >= buffer.length) + throw new BSONError('Bad BSON Document: illegal CString'); + // Return the C string + var regExpOptions = buffer.toString('utf8', index, i); + index = i + 1; + // For each option add the corresponding one for javascript + var optionsArray = new Array(regExpOptions.length); + // Parse options + for (i = 0; i < regExpOptions.length; i++) { + switch (regExpOptions[i]) { + case 'm': + optionsArray[i] = 'm'; + break; + case 's': + optionsArray[i] = 'g'; + break; + case 'i': + optionsArray[i] = 'i'; + break; + } + } + value = new RegExp(source, optionsArray.join('')); + } + else if (elementType === BSON_DATA_REGEXP && bsonRegExp === true) { + // Get the start search index + i = index; + // Locate the end of the c string + while (buffer[i] !== 0x00 && i < buffer.length) { + i++; + } + // If are at the end of the buffer there is a problem with the document + if (i >= buffer.length) + throw new BSONError('Bad BSON Document: illegal CString'); + // Return the C string + var source = buffer.toString('utf8', index, i); + index = i + 1; + // Get the start search index + i = index; + // Locate the end of the c string + while (buffer[i] !== 0x00 && i < buffer.length) { + i++; + } + // If are at the end of the buffer there is a problem with the document + if (i >= buffer.length) + throw new BSONError('Bad BSON Document: illegal CString'); + // Return the C string + var regExpOptions = buffer.toString('utf8', index, i); + index = i + 1; + // Set the object + value = new BSONRegExp(source, regExpOptions); + } + else if (elementType === BSON_DATA_SYMBOL) { + var stringSize = buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + if (stringSize <= 0 || + stringSize > buffer.length - index || + buffer[index + stringSize - 1] !== 0) { + throw new BSONError('bad string length in bson'); + } + var symbol = getValidatedString(buffer, index, index + stringSize - 1, shouldValidateKey); + value = promoteValues ? symbol : new BSONSymbol(symbol); + index = index + stringSize; + } + else if (elementType === BSON_DATA_TIMESTAMP) { + var lowBits = buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + var highBits = buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + value = new Timestamp(lowBits, highBits); + } + else if (elementType === BSON_DATA_MIN_KEY) { + value = new MinKey(); + } + else if (elementType === BSON_DATA_MAX_KEY) { + value = new MaxKey(); + } + else if (elementType === BSON_DATA_CODE) { + var stringSize = buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + if (stringSize <= 0 || + stringSize > buffer.length - index || + buffer[index + stringSize - 1] !== 0) { + throw new BSONError('bad string length in bson'); + } + var functionString = getValidatedString(buffer, index, index + stringSize - 1, shouldValidateKey); + // If we are evaluating the functions + if (evalFunctions) { + // If we have cache enabled let's look for the md5 of the function in the cache + if (cacheFunctions) { + // Got to do this to avoid V8 deoptimizing the call due to finding eval + value = isolateEval(functionString, functionCache, object); + } + else { + value = isolateEval(functionString); + } + } + else { + value = new Code(functionString); + } + // Update parse index position + index = index + stringSize; + } + else if (elementType === BSON_DATA_CODE_W_SCOPE) { + var totalSize = buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + // Element cannot be shorter than totalSize + stringSize + documentSize + terminator + if (totalSize < 4 + 4 + 4 + 1) { + throw new BSONError('code_w_scope total size shorter minimum expected length'); + } + // Get the code string size + var stringSize = buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + // Check if we have a valid string + if (stringSize <= 0 || + stringSize > buffer.length - index || + buffer[index + stringSize - 1] !== 0) { + throw new BSONError('bad string length in bson'); + } + // Javascript function + var functionString = getValidatedString(buffer, index, index + stringSize - 1, shouldValidateKey); + // Update parse index position + index = index + stringSize; + // Parse the element + var _index = index; + // Decode the size of the object document + var objectSize = buffer[index] | + (buffer[index + 1] << 8) | + (buffer[index + 2] << 16) | + (buffer[index + 3] << 24); + // Decode the scope object + var scopeObject = deserializeObject(buffer, _index, options, false); + // Adjust the index + index = index + objectSize; + // Check if field length is too short + if (totalSize < 4 + 4 + objectSize + stringSize) { + throw new BSONError('code_w_scope total size is too short, truncating scope'); + } + // Check if totalSize field is too long + if (totalSize > 4 + 4 + objectSize + stringSize) { + throw new BSONError('code_w_scope total size is too long, clips outer document'); + } + // If we are evaluating the functions + if (evalFunctions) { + // If we have cache enabled let's look for the md5 of the function in the cache + if (cacheFunctions) { + // Got to do this to avoid V8 deoptimizing the call due to finding eval + value = isolateEval(functionString, functionCache, object); + } + else { + value = isolateEval(functionString); + } + value.scope = scopeObject; + } + else { + value = new Code(functionString, scopeObject); + } + } + else if (elementType === BSON_DATA_DBPOINTER) { + // Get the code string size + var stringSize = buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + // Check if we have a valid string + if (stringSize <= 0 || + stringSize > buffer.length - index || + buffer[index + stringSize - 1] !== 0) + throw new BSONError('bad string length in bson'); + // Namespace + if (validation != null && validation.utf8) { + if (!validateUtf8(buffer, index, index + stringSize - 1)) { + throw new BSONError('Invalid UTF-8 string in BSON document'); + } + } + var namespace = buffer.toString('utf8', index, index + stringSize - 1); + // Update parse index position + index = index + stringSize; + // Read the oid + var oidBuffer = buffer_1.alloc(12); + buffer.copy(oidBuffer, 0, index, index + 12); + var oid = new ObjectId(oidBuffer); + // Update the index + index = index + 12; + // Upgrade to DBRef type + value = new DBRef(namespace, oid); + } + else { + throw new BSONError('Detected unknown BSON type ' + elementType.toString(16) + ' for fieldname "' + name + '"'); + } + if (name === '__proto__') { + Object.defineProperty(object, name, { + value: value, + writable: true, + enumerable: true, + configurable: true + }); + } + else { + object[name] = value; + } + } + // Check if the deserialization was against a valid array/object + if (size !== index - startIndex) { + if (isArray) + throw new BSONError('corrupt array bson'); + throw new BSONError('corrupt object bson'); + } + // if we did not find "$ref", "$id", "$db", or found an extraneous $key, don't make a DBRef + if (!isPossibleDBRef) + return object; + if (isDBRefLike(object)) { + var copy = Object.assign({}, object); + delete copy.$ref; + delete copy.$id; + delete copy.$db; + return new DBRef(object.$ref, object.$id, object.$db, copy); + } + return object; +} +/** + * Ensure eval is isolated, store the result in functionCache. + * + * @internal + */ +function isolateEval(functionString, functionCache, object) { + if (!functionCache) + return new Function(functionString); + // Check for cache hit, eval if missing and return cached function + if (functionCache[functionString] == null) { + functionCache[functionString] = new Function(functionString); + } + // Set the object + return functionCache[functionString].bind(object); +} +function getValidatedString(buffer, start, end, shouldValidateUtf8) { + var value = buffer.toString('utf8', start, end); + // if utf8 validation is on, do the check + if (shouldValidateUtf8) { + for (var i = 0; i < value.length; i++) { + if (value.charCodeAt(i) === 0xfffd) { + if (!validateUtf8(buffer, start, end)) { + throw new BSONError('Invalid UTF-8 string in BSON document'); + } + break; + } + } + } + return value; +} + +// Copyright (c) 2008, Fair Oaks Labs, Inc. +function writeIEEE754(buffer, value, offset, endian, mLen, nBytes) { + var e; + var m; + var c; + var bBE = endian === 'big'; + var eLen = nBytes * 8 - mLen - 1; + var eMax = (1 << eLen) - 1; + var eBias = eMax >> 1; + var rt = mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0; + var i = bBE ? nBytes - 1 : 0; + var d = bBE ? -1 : 1; + var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0; + value = Math.abs(value); + if (isNaN(value) || value === Infinity) { + m = isNaN(value) ? 1 : 0; + e = eMax; + } + else { + e = Math.floor(Math.log(value) / Math.LN2); + if (value * (c = Math.pow(2, -e)) < 1) { + e--; + c *= 2; + } + if (e + eBias >= 1) { + value += rt / c; + } + else { + value += rt * Math.pow(2, 1 - eBias); + } + if (value * c >= 2) { + e++; + c /= 2; + } + if (e + eBias >= eMax) { + m = 0; + e = eMax; + } + else if (e + eBias >= 1) { + m = (value * c - 1) * Math.pow(2, mLen); + e = e + eBias; + } + else { + m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen); + e = 0; + } + } + if (isNaN(value)) + m = 0; + while (mLen >= 8) { + buffer[offset + i] = m & 0xff; + i += d; + m /= 256; + mLen -= 8; + } + e = (e << mLen) | m; + if (isNaN(value)) + e += 8; + eLen += mLen; + while (eLen > 0) { + buffer[offset + i] = e & 0xff; + i += d; + e /= 256; + eLen -= 8; + } + buffer[offset + i - d] |= s * 128; +} + +var regexp = /\x00/; // eslint-disable-line no-control-regex +var ignoreKeys = new Set(['$db', '$ref', '$id', '$clusterTime']); +/* + * isArray indicates if we are writing to a BSON array (type 0x04) + * which forces the "key" which really an array index as a string to be written as ascii + * This will catch any errors in index as a string generation + */ +function serializeString(buffer, key, value, index, isArray) { + // Encode String type + buffer[index++] = BSON_DATA_STRING; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes + 1; + buffer[index - 1] = 0; + // Write the string + var size = buffer.write(value, index + 4, undefined, 'utf8'); + // Write the size of the string to buffer + buffer[index + 3] = ((size + 1) >> 24) & 0xff; + buffer[index + 2] = ((size + 1) >> 16) & 0xff; + buffer[index + 1] = ((size + 1) >> 8) & 0xff; + buffer[index] = (size + 1) & 0xff; + // Update index + index = index + 4 + size; + // Write zero + buffer[index++] = 0; + return index; +} +function serializeNumber(buffer, key, value, index, isArray) { + // We have an integer value + // TODO(NODE-2529): Add support for big int + if (Number.isInteger(value) && + value >= BSON_INT32_MIN && + value <= BSON_INT32_MAX) { + // If the value fits in 32 bits encode as int32 + // Set int type 32 bits or less + buffer[index++] = BSON_DATA_INT; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Write the int value + buffer[index++] = value & 0xff; + buffer[index++] = (value >> 8) & 0xff; + buffer[index++] = (value >> 16) & 0xff; + buffer[index++] = (value >> 24) & 0xff; + } + else { + // Encode as double + buffer[index++] = BSON_DATA_NUMBER; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Write float + writeIEEE754(buffer, value, index, 'little', 52, 8); + // Adjust index + index = index + 8; + } + return index; +} +function serializeNull(buffer, key, _, index, isArray) { + // Set long type + buffer[index++] = BSON_DATA_NULL; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + return index; +} +function serializeBoolean(buffer, key, value, index, isArray) { + // Write the type + buffer[index++] = BSON_DATA_BOOLEAN; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Encode the boolean value + buffer[index++] = value ? 1 : 0; + return index; +} +function serializeDate(buffer, key, value, index, isArray) { + // Write the type + buffer[index++] = BSON_DATA_DATE; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Write the date + var dateInMilis = Long.fromNumber(value.getTime()); + var lowBits = dateInMilis.getLowBits(); + var highBits = dateInMilis.getHighBits(); + // Encode low bits + buffer[index++] = lowBits & 0xff; + buffer[index++] = (lowBits >> 8) & 0xff; + buffer[index++] = (lowBits >> 16) & 0xff; + buffer[index++] = (lowBits >> 24) & 0xff; + // Encode high bits + buffer[index++] = highBits & 0xff; + buffer[index++] = (highBits >> 8) & 0xff; + buffer[index++] = (highBits >> 16) & 0xff; + buffer[index++] = (highBits >> 24) & 0xff; + return index; +} +function serializeRegExp(buffer, key, value, index, isArray) { + // Write the type + buffer[index++] = BSON_DATA_REGEXP; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + if (value.source && value.source.match(regexp) != null) { + throw Error('value ' + value.source + ' must not contain null bytes'); + } + // Adjust the index + index = index + buffer.write(value.source, index, undefined, 'utf8'); + // Write zero + buffer[index++] = 0x00; + // Write the parameters + if (value.ignoreCase) + buffer[index++] = 0x69; // i + if (value.global) + buffer[index++] = 0x73; // s + if (value.multiline) + buffer[index++] = 0x6d; // m + // Add ending zero + buffer[index++] = 0x00; + return index; +} +function serializeBSONRegExp(buffer, key, value, index, isArray) { + // Write the type + buffer[index++] = BSON_DATA_REGEXP; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Check the pattern for 0 bytes + if (value.pattern.match(regexp) != null) { + // The BSON spec doesn't allow keys with null bytes because keys are + // null-terminated. + throw Error('pattern ' + value.pattern + ' must not contain null bytes'); + } + // Adjust the index + index = index + buffer.write(value.pattern, index, undefined, 'utf8'); + // Write zero + buffer[index++] = 0x00; + // Write the options + index = index + buffer.write(value.options.split('').sort().join(''), index, undefined, 'utf8'); + // Add ending zero + buffer[index++] = 0x00; + return index; +} +function serializeMinMax(buffer, key, value, index, isArray) { + // Write the type of either min or max key + if (value === null) { + buffer[index++] = BSON_DATA_NULL; + } + else if (value._bsontype === 'MinKey') { + buffer[index++] = BSON_DATA_MIN_KEY; + } + else { + buffer[index++] = BSON_DATA_MAX_KEY; + } + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + return index; +} +function serializeObjectId(buffer, key, value, index, isArray) { + // Write the type + buffer[index++] = BSON_DATA_OID; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Write the objectId into the shared buffer + if (typeof value.id === 'string') { + buffer.write(value.id, index, undefined, 'binary'); + } + else if (isUint8Array(value.id)) { + // Use the standard JS methods here because buffer.copy() is buggy with the + // browser polyfill + buffer.set(value.id.subarray(0, 12), index); + } + else { + throw new BSONTypeError('object [' + JSON.stringify(value) + '] is not a valid ObjectId'); + } + // Adjust index + return index + 12; +} +function serializeBuffer(buffer, key, value, index, isArray) { + // Write the type + buffer[index++] = BSON_DATA_BINARY; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Get size of the buffer (current write point) + var size = value.length; + // Write the size of the string to buffer + buffer[index++] = size & 0xff; + buffer[index++] = (size >> 8) & 0xff; + buffer[index++] = (size >> 16) & 0xff; + buffer[index++] = (size >> 24) & 0xff; + // Write the default subtype + buffer[index++] = BSON_BINARY_SUBTYPE_DEFAULT; + // Copy the content form the binary field to the buffer + buffer.set(ensureBuffer(value), index); + // Adjust the index + index = index + size; + return index; +} +function serializeObject(buffer, key, value, index, checkKeys, depth, serializeFunctions, ignoreUndefined, isArray, path) { + if (checkKeys === void 0) { checkKeys = false; } + if (depth === void 0) { depth = 0; } + if (serializeFunctions === void 0) { serializeFunctions = false; } + if (ignoreUndefined === void 0) { ignoreUndefined = true; } + if (isArray === void 0) { isArray = false; } + if (path === void 0) { path = []; } + for (var i = 0; i < path.length; i++) { + if (path[i] === value) + throw new BSONError('cyclic dependency detected'); + } + // Push value to stack + path.push(value); + // Write the type + buffer[index++] = Array.isArray(value) ? BSON_DATA_ARRAY : BSON_DATA_OBJECT; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + var endIndex = serializeInto(buffer, value, checkKeys, index, depth + 1, serializeFunctions, ignoreUndefined, path); + // Pop stack + path.pop(); + return endIndex; +} +function serializeDecimal128(buffer, key, value, index, isArray) { + buffer[index++] = BSON_DATA_DECIMAL128; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Write the data from the value + // Prefer the standard JS methods because their typechecking is not buggy, + // unlike the `buffer` polyfill's. + buffer.set(value.bytes.subarray(0, 16), index); + return index + 16; +} +function serializeLong(buffer, key, value, index, isArray) { + // Write the type + buffer[index++] = + value._bsontype === 'Long' ? BSON_DATA_LONG : BSON_DATA_TIMESTAMP; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Write the date + var lowBits = value.getLowBits(); + var highBits = value.getHighBits(); + // Encode low bits + buffer[index++] = lowBits & 0xff; + buffer[index++] = (lowBits >> 8) & 0xff; + buffer[index++] = (lowBits >> 16) & 0xff; + buffer[index++] = (lowBits >> 24) & 0xff; + // Encode high bits + buffer[index++] = highBits & 0xff; + buffer[index++] = (highBits >> 8) & 0xff; + buffer[index++] = (highBits >> 16) & 0xff; + buffer[index++] = (highBits >> 24) & 0xff; + return index; +} +function serializeInt32(buffer, key, value, index, isArray) { + value = value.valueOf(); + // Set int type 32 bits or less + buffer[index++] = BSON_DATA_INT; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Write the int value + buffer[index++] = value & 0xff; + buffer[index++] = (value >> 8) & 0xff; + buffer[index++] = (value >> 16) & 0xff; + buffer[index++] = (value >> 24) & 0xff; + return index; +} +function serializeDouble(buffer, key, value, index, isArray) { + // Encode as double + buffer[index++] = BSON_DATA_NUMBER; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Write float + writeIEEE754(buffer, value.value, index, 'little', 52, 8); + // Adjust index + index = index + 8; + return index; +} +function serializeFunction(buffer, key, value, index, _checkKeys, _depth, isArray) { + buffer[index++] = BSON_DATA_CODE; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Function string + var functionString = normalizedFunctionString(value); + // Write the string + var size = buffer.write(functionString, index + 4, undefined, 'utf8') + 1; + // Write the size of the string to buffer + buffer[index] = size & 0xff; + buffer[index + 1] = (size >> 8) & 0xff; + buffer[index + 2] = (size >> 16) & 0xff; + buffer[index + 3] = (size >> 24) & 0xff; + // Update index + index = index + 4 + size - 1; + // Write zero + buffer[index++] = 0; + return index; +} +function serializeCode(buffer, key, value, index, checkKeys, depth, serializeFunctions, ignoreUndefined, isArray) { + if (checkKeys === void 0) { checkKeys = false; } + if (depth === void 0) { depth = 0; } + if (serializeFunctions === void 0) { serializeFunctions = false; } + if (ignoreUndefined === void 0) { ignoreUndefined = true; } + if (isArray === void 0) { isArray = false; } + if (value.scope && typeof value.scope === 'object') { + // Write the type + buffer[index++] = BSON_DATA_CODE_W_SCOPE; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Starting index + var startIndex = index; + // Serialize the function + // Get the function string + var functionString = typeof value.code === 'string' ? value.code : value.code.toString(); + // Index adjustment + index = index + 4; + // Write string into buffer + var codeSize = buffer.write(functionString, index + 4, undefined, 'utf8') + 1; + // Write the size of the string to buffer + buffer[index] = codeSize & 0xff; + buffer[index + 1] = (codeSize >> 8) & 0xff; + buffer[index + 2] = (codeSize >> 16) & 0xff; + buffer[index + 3] = (codeSize >> 24) & 0xff; + // Write end 0 + buffer[index + 4 + codeSize - 1] = 0; + // Write the + index = index + codeSize + 4; + // + // Serialize the scope value + var endIndex = serializeInto(buffer, value.scope, checkKeys, index, depth + 1, serializeFunctions, ignoreUndefined); + index = endIndex - 1; + // Writ the total + var totalSize = endIndex - startIndex; + // Write the total size of the object + buffer[startIndex++] = totalSize & 0xff; + buffer[startIndex++] = (totalSize >> 8) & 0xff; + buffer[startIndex++] = (totalSize >> 16) & 0xff; + buffer[startIndex++] = (totalSize >> 24) & 0xff; + // Write trailing zero + buffer[index++] = 0; + } + else { + buffer[index++] = BSON_DATA_CODE; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Function string + var functionString = value.code.toString(); + // Write the string + var size = buffer.write(functionString, index + 4, undefined, 'utf8') + 1; + // Write the size of the string to buffer + buffer[index] = size & 0xff; + buffer[index + 1] = (size >> 8) & 0xff; + buffer[index + 2] = (size >> 16) & 0xff; + buffer[index + 3] = (size >> 24) & 0xff; + // Update index + index = index + 4 + size - 1; + // Write zero + buffer[index++] = 0; + } + return index; +} +function serializeBinary(buffer, key, value, index, isArray) { + // Write the type + buffer[index++] = BSON_DATA_BINARY; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Extract the buffer + var data = value.value(true); + // Calculate size + var size = value.position; + // Add the deprecated 02 type 4 bytes of size to total + if (value.sub_type === Binary.SUBTYPE_BYTE_ARRAY) + size = size + 4; + // Write the size of the string to buffer + buffer[index++] = size & 0xff; + buffer[index++] = (size >> 8) & 0xff; + buffer[index++] = (size >> 16) & 0xff; + buffer[index++] = (size >> 24) & 0xff; + // Write the subtype to the buffer + buffer[index++] = value.sub_type; + // If we have binary type 2 the 4 first bytes are the size + if (value.sub_type === Binary.SUBTYPE_BYTE_ARRAY) { + size = size - 4; + buffer[index++] = size & 0xff; + buffer[index++] = (size >> 8) & 0xff; + buffer[index++] = (size >> 16) & 0xff; + buffer[index++] = (size >> 24) & 0xff; + } + // Write the data to the object + buffer.set(data, index); + // Adjust the index + index = index + value.position; + return index; +} +function serializeSymbol(buffer, key, value, index, isArray) { + // Write the type + buffer[index++] = BSON_DATA_SYMBOL; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Write the string + var size = buffer.write(value.value, index + 4, undefined, 'utf8') + 1; + // Write the size of the string to buffer + buffer[index] = size & 0xff; + buffer[index + 1] = (size >> 8) & 0xff; + buffer[index + 2] = (size >> 16) & 0xff; + buffer[index + 3] = (size >> 24) & 0xff; + // Update index + index = index + 4 + size - 1; + // Write zero + buffer[index++] = 0x00; + return index; +} +function serializeDBRef(buffer, key, value, index, depth, serializeFunctions, isArray) { + // Write the type + buffer[index++] = BSON_DATA_OBJECT; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + var startIndex = index; + var output = { + $ref: value.collection || value.namespace, + $id: value.oid + }; + if (value.db != null) { + output.$db = value.db; + } + output = Object.assign(output, value.fields); + var endIndex = serializeInto(buffer, output, false, index, depth + 1, serializeFunctions); + // Calculate object size + var size = endIndex - startIndex; + // Write the size + buffer[startIndex++] = size & 0xff; + buffer[startIndex++] = (size >> 8) & 0xff; + buffer[startIndex++] = (size >> 16) & 0xff; + buffer[startIndex++] = (size >> 24) & 0xff; + // Set index + return endIndex; +} +function serializeInto(buffer, object, checkKeys, startingIndex, depth, serializeFunctions, ignoreUndefined, path) { + if (checkKeys === void 0) { checkKeys = false; } + if (startingIndex === void 0) { startingIndex = 0; } + if (depth === void 0) { depth = 0; } + if (serializeFunctions === void 0) { serializeFunctions = false; } + if (ignoreUndefined === void 0) { ignoreUndefined = true; } + if (path === void 0) { path = []; } + startingIndex = startingIndex || 0; + path = path || []; + // Push the object to the path + path.push(object); + // Start place to serialize into + var index = startingIndex + 4; + // Special case isArray + if (Array.isArray(object)) { + // Get object keys + for (var i = 0; i < object.length; i++) { + var key = '' + i; + var value = object[i]; + // Is there an override value + if (typeof (value === null || value === void 0 ? void 0 : value.toBSON) === 'function') { + value = value.toBSON(); + } + if (typeof value === 'string') { + index = serializeString(buffer, key, value, index, true); + } + else if (typeof value === 'number') { + index = serializeNumber(buffer, key, value, index, true); + } + else if (typeof value === 'bigint') { + throw new BSONTypeError('Unsupported type BigInt, please use Decimal128'); + } + else if (typeof value === 'boolean') { + index = serializeBoolean(buffer, key, value, index, true); + } + else if (value instanceof Date || isDate(value)) { + index = serializeDate(buffer, key, value, index, true); + } + else if (value === undefined) { + index = serializeNull(buffer, key, value, index, true); + } + else if (value === null) { + index = serializeNull(buffer, key, value, index, true); + } + else if (value['_bsontype'] === 'ObjectId' || value['_bsontype'] === 'ObjectID') { + index = serializeObjectId(buffer, key, value, index, true); + } + else if (isUint8Array(value)) { + index = serializeBuffer(buffer, key, value, index, true); + } + else if (value instanceof RegExp || isRegExp(value)) { + index = serializeRegExp(buffer, key, value, index, true); + } + else if (typeof value === 'object' && value['_bsontype'] == null) { + index = serializeObject(buffer, key, value, index, checkKeys, depth, serializeFunctions, ignoreUndefined, true, path); + } + else if (typeof value === 'object' && + isBSONType(value) && + value._bsontype === 'Decimal128') { + index = serializeDecimal128(buffer, key, value, index, true); + } + else if (value['_bsontype'] === 'Long' || value['_bsontype'] === 'Timestamp') { + index = serializeLong(buffer, key, value, index, true); + } + else if (value['_bsontype'] === 'Double') { + index = serializeDouble(buffer, key, value, index, true); + } + else if (typeof value === 'function' && serializeFunctions) { + index = serializeFunction(buffer, key, value, index, checkKeys, depth, true); + } + else if (value['_bsontype'] === 'Code') { + index = serializeCode(buffer, key, value, index, checkKeys, depth, serializeFunctions, ignoreUndefined, true); + } + else if (value['_bsontype'] === 'Binary') { + index = serializeBinary(buffer, key, value, index, true); + } + else if (value['_bsontype'] === 'Symbol') { + index = serializeSymbol(buffer, key, value, index, true); + } + else if (value['_bsontype'] === 'DBRef') { + index = serializeDBRef(buffer, key, value, index, depth, serializeFunctions, true); + } + else if (value['_bsontype'] === 'BSONRegExp') { + index = serializeBSONRegExp(buffer, key, value, index, true); + } + else if (value['_bsontype'] === 'Int32') { + index = serializeInt32(buffer, key, value, index, true); + } + else if (value['_bsontype'] === 'MinKey' || value['_bsontype'] === 'MaxKey') { + index = serializeMinMax(buffer, key, value, index, true); + } + else if (typeof value['_bsontype'] !== 'undefined') { + throw new BSONTypeError('Unrecognized or invalid _bsontype: ' + value['_bsontype']); + } + } + } + else if (object instanceof bsonMap || isMap(object)) { + var iterator = object.entries(); + var done = false; + while (!done) { + // Unpack the next entry + var entry = iterator.next(); + done = !!entry.done; + // Are we done, then skip and terminate + if (done) + continue; + // Get the entry values + var key = entry.value[0]; + var value = entry.value[1]; + // Check the type of the value + var type = typeof value; + // Check the key and throw error if it's illegal + if (typeof key === 'string' && !ignoreKeys.has(key)) { + if (key.match(regexp) != null) { + // The BSON spec doesn't allow keys with null bytes because keys are + // null-terminated. + throw Error('key ' + key + ' must not contain null bytes'); + } + if (checkKeys) { + if ('$' === key[0]) { + throw Error('key ' + key + " must not start with '$'"); + } + else if (~key.indexOf('.')) { + throw Error('key ' + key + " must not contain '.'"); + } + } + } + if (type === 'string') { + index = serializeString(buffer, key, value, index); + } + else if (type === 'number') { + index = serializeNumber(buffer, key, value, index); + } + else if (type === 'bigint' || isBigInt64Array(value) || isBigUInt64Array(value)) { + throw new BSONTypeError('Unsupported type BigInt, please use Decimal128'); + } + else if (type === 'boolean') { + index = serializeBoolean(buffer, key, value, index); + } + else if (value instanceof Date || isDate(value)) { + index = serializeDate(buffer, key, value, index); + } + else if (value === null || (value === undefined && ignoreUndefined === false)) { + index = serializeNull(buffer, key, value, index); + } + else if (value['_bsontype'] === 'ObjectId' || value['_bsontype'] === 'ObjectID') { + index = serializeObjectId(buffer, key, value, index); + } + else if (isUint8Array(value)) { + index = serializeBuffer(buffer, key, value, index); + } + else if (value instanceof RegExp || isRegExp(value)) { + index = serializeRegExp(buffer, key, value, index); + } + else if (type === 'object' && value['_bsontype'] == null) { + index = serializeObject(buffer, key, value, index, checkKeys, depth, serializeFunctions, ignoreUndefined, false, path); + } + else if (type === 'object' && value['_bsontype'] === 'Decimal128') { + index = serializeDecimal128(buffer, key, value, index); + } + else if (value['_bsontype'] === 'Long' || value['_bsontype'] === 'Timestamp') { + index = serializeLong(buffer, key, value, index); + } + else if (value['_bsontype'] === 'Double') { + index = serializeDouble(buffer, key, value, index); + } + else if (value['_bsontype'] === 'Code') { + index = serializeCode(buffer, key, value, index, checkKeys, depth, serializeFunctions, ignoreUndefined); + } + else if (typeof value === 'function' && serializeFunctions) { + index = serializeFunction(buffer, key, value, index, checkKeys, depth, serializeFunctions); + } + else if (value['_bsontype'] === 'Binary') { + index = serializeBinary(buffer, key, value, index); + } + else if (value['_bsontype'] === 'Symbol') { + index = serializeSymbol(buffer, key, value, index); + } + else if (value['_bsontype'] === 'DBRef') { + index = serializeDBRef(buffer, key, value, index, depth, serializeFunctions); + } + else if (value['_bsontype'] === 'BSONRegExp') { + index = serializeBSONRegExp(buffer, key, value, index); + } + else if (value['_bsontype'] === 'Int32') { + index = serializeInt32(buffer, key, value, index); + } + else if (value['_bsontype'] === 'MinKey' || value['_bsontype'] === 'MaxKey') { + index = serializeMinMax(buffer, key, value, index); + } + else if (typeof value['_bsontype'] !== 'undefined') { + throw new BSONTypeError('Unrecognized or invalid _bsontype: ' + value['_bsontype']); + } + } + } + else { + if (typeof (object === null || object === void 0 ? void 0 : object.toBSON) === 'function') { + // Provided a custom serialization method + object = object.toBSON(); + if (object != null && typeof object !== 'object') { + throw new BSONTypeError('toBSON function did not return an object'); + } + } + // Iterate over all the keys + for (var key in object) { + var value = object[key]; + // Is there an override value + if (typeof (value === null || value === void 0 ? void 0 : value.toBSON) === 'function') { + value = value.toBSON(); + } + // Check the type of the value + var type = typeof value; + // Check the key and throw error if it's illegal + if (typeof key === 'string' && !ignoreKeys.has(key)) { + if (key.match(regexp) != null) { + // The BSON spec doesn't allow keys with null bytes because keys are + // null-terminated. + throw Error('key ' + key + ' must not contain null bytes'); + } + if (checkKeys) { + if ('$' === key[0]) { + throw Error('key ' + key + " must not start with '$'"); + } + else if (~key.indexOf('.')) { + throw Error('key ' + key + " must not contain '.'"); + } + } + } + if (type === 'string') { + index = serializeString(buffer, key, value, index); + } + else if (type === 'number') { + index = serializeNumber(buffer, key, value, index); + } + else if (type === 'bigint') { + throw new BSONTypeError('Unsupported type BigInt, please use Decimal128'); + } + else if (type === 'boolean') { + index = serializeBoolean(buffer, key, value, index); + } + else if (value instanceof Date || isDate(value)) { + index = serializeDate(buffer, key, value, index); + } + else if (value === undefined) { + if (ignoreUndefined === false) + index = serializeNull(buffer, key, value, index); + } + else if (value === null) { + index = serializeNull(buffer, key, value, index); + } + else if (value['_bsontype'] === 'ObjectId' || value['_bsontype'] === 'ObjectID') { + index = serializeObjectId(buffer, key, value, index); + } + else if (isUint8Array(value)) { + index = serializeBuffer(buffer, key, value, index); + } + else if (value instanceof RegExp || isRegExp(value)) { + index = serializeRegExp(buffer, key, value, index); + } + else if (type === 'object' && value['_bsontype'] == null) { + index = serializeObject(buffer, key, value, index, checkKeys, depth, serializeFunctions, ignoreUndefined, false, path); + } + else if (type === 'object' && value['_bsontype'] === 'Decimal128') { + index = serializeDecimal128(buffer, key, value, index); + } + else if (value['_bsontype'] === 'Long' || value['_bsontype'] === 'Timestamp') { + index = serializeLong(buffer, key, value, index); + } + else if (value['_bsontype'] === 'Double') { + index = serializeDouble(buffer, key, value, index); + } + else if (value['_bsontype'] === 'Code') { + index = serializeCode(buffer, key, value, index, checkKeys, depth, serializeFunctions, ignoreUndefined); + } + else if (typeof value === 'function' && serializeFunctions) { + index = serializeFunction(buffer, key, value, index, checkKeys, depth, serializeFunctions); + } + else if (value['_bsontype'] === 'Binary') { + index = serializeBinary(buffer, key, value, index); + } + else if (value['_bsontype'] === 'Symbol') { + index = serializeSymbol(buffer, key, value, index); + } + else if (value['_bsontype'] === 'DBRef') { + index = serializeDBRef(buffer, key, value, index, depth, serializeFunctions); + } + else if (value['_bsontype'] === 'BSONRegExp') { + index = serializeBSONRegExp(buffer, key, value, index); + } + else if (value['_bsontype'] === 'Int32') { + index = serializeInt32(buffer, key, value, index); + } + else if (value['_bsontype'] === 'MinKey' || value['_bsontype'] === 'MaxKey') { + index = serializeMinMax(buffer, key, value, index); + } + else if (typeof value['_bsontype'] !== 'undefined') { + throw new BSONTypeError('Unrecognized or invalid _bsontype: ' + value['_bsontype']); + } + } + } + // Remove the path + path.pop(); + // Final padding byte for object + buffer[index++] = 0x00; + // Final size + var size = index - startingIndex; + // Write the size of the object + buffer[startingIndex++] = size & 0xff; + buffer[startingIndex++] = (size >> 8) & 0xff; + buffer[startingIndex++] = (size >> 16) & 0xff; + buffer[startingIndex++] = (size >> 24) & 0xff; + return index; +} + +/** @internal */ +// Default Max Size +var MAXSIZE = 1024 * 1024 * 17; +// Current Internal Temporary Serialization Buffer +var buffer = buffer_1.alloc(MAXSIZE); +/** + * Sets the size of the internal serialization buffer. + * + * @param size - The desired size for the internal serialization buffer + * @public + */ +function setInternalBufferSize(size) { + // Resize the internal serialization buffer if needed + if (buffer.length < size) { + buffer = buffer_1.alloc(size); + } +} +/** + * Serialize a Javascript object. + * + * @param object - the Javascript object to serialize. + * @returns Buffer object containing the serialized object. + * @public + */ +function serialize(object, options) { + if (options === void 0) { options = {}; } + // Unpack the options + var checkKeys = typeof options.checkKeys === 'boolean' ? options.checkKeys : false; + var serializeFunctions = typeof options.serializeFunctions === 'boolean' ? options.serializeFunctions : false; + var ignoreUndefined = typeof options.ignoreUndefined === 'boolean' ? options.ignoreUndefined : true; + var minInternalBufferSize = typeof options.minInternalBufferSize === 'number' ? options.minInternalBufferSize : MAXSIZE; + // Resize the internal serialization buffer if needed + if (buffer.length < minInternalBufferSize) { + buffer = buffer_1.alloc(minInternalBufferSize); + } + // Attempt to serialize + var serializationIndex = serializeInto(buffer, object, checkKeys, 0, 0, serializeFunctions, ignoreUndefined, []); + // Create the final buffer + var finishedBuffer = buffer_1.alloc(serializationIndex); + // Copy into the finished buffer + buffer.copy(finishedBuffer, 0, 0, finishedBuffer.length); + // Return the buffer + return finishedBuffer; +} +/** + * Serialize a Javascript object using a predefined Buffer and index into the buffer, + * useful when pre-allocating the space for serialization. + * + * @param object - the Javascript object to serialize. + * @param finalBuffer - the Buffer you pre-allocated to store the serialized BSON object. + * @returns the index pointing to the last written byte in the buffer. + * @public + */ +function serializeWithBufferAndIndex(object, finalBuffer, options) { + if (options === void 0) { options = {}; } + // Unpack the options + var checkKeys = typeof options.checkKeys === 'boolean' ? options.checkKeys : false; + var serializeFunctions = typeof options.serializeFunctions === 'boolean' ? options.serializeFunctions : false; + var ignoreUndefined = typeof options.ignoreUndefined === 'boolean' ? options.ignoreUndefined : true; + var startIndex = typeof options.index === 'number' ? options.index : 0; + // Attempt to serialize + var serializationIndex = serializeInto(buffer, object, checkKeys, 0, 0, serializeFunctions, ignoreUndefined); + buffer.copy(finalBuffer, startIndex, 0, serializationIndex); + // Return the index + return startIndex + serializationIndex - 1; +} +/** + * Deserialize data as BSON. + * + * @param buffer - the buffer containing the serialized set of BSON documents. + * @returns returns the deserialized Javascript Object. + * @public + */ +function deserialize(buffer, options) { + if (options === void 0) { options = {}; } + return deserialize$1(buffer instanceof buffer_1 ? buffer : ensureBuffer(buffer), options); +} +/** + * Calculate the bson size for a passed in Javascript object. + * + * @param object - the Javascript object to calculate the BSON byte size for + * @returns size of BSON object in bytes + * @public + */ +function calculateObjectSize(object, options) { + if (options === void 0) { options = {}; } + options = options || {}; + var serializeFunctions = typeof options.serializeFunctions === 'boolean' ? options.serializeFunctions : false; + var ignoreUndefined = typeof options.ignoreUndefined === 'boolean' ? options.ignoreUndefined : true; + return calculateObjectSize$1(object, serializeFunctions, ignoreUndefined); +} +/** + * Deserialize stream data as BSON documents. + * + * @param data - the buffer containing the serialized set of BSON documents. + * @param startIndex - the start index in the data Buffer where the deserialization is to start. + * @param numberOfDocuments - number of documents to deserialize. + * @param documents - an array where to store the deserialized documents. + * @param docStartIndex - the index in the documents array from where to start inserting documents. + * @param options - additional options used for the deserialization. + * @returns next index in the buffer after deserialization **x** numbers of documents. + * @public + */ +function deserializeStream(data, startIndex, numberOfDocuments, documents, docStartIndex, options) { + var internalOptions = Object.assign({ allowObjectSmallerThanBufferSize: true, index: 0 }, options); + var bufferData = ensureBuffer(data); + var index = startIndex; + // Loop over all documents + for (var i = 0; i < numberOfDocuments; i++) { + // Find size of the document + var size = bufferData[index] | + (bufferData[index + 1] << 8) | + (bufferData[index + 2] << 16) | + (bufferData[index + 3] << 24); + // Update options with index + internalOptions.index = index; + // Parse the document at this point + documents[docStartIndex + i] = deserialize$1(bufferData, internalOptions); + // Adjust index by the document size + index = index + size; + } + // Return object containing end index of parsing and list of documents + return index; +} +/** + * BSON default export + * @deprecated Please use named exports + * @privateRemarks + * We want to someday deprecate the default export, + * so none of the new TS types are being exported on the default + * @public + */ +var BSON = { + Binary: Binary, + Code: Code, + DBRef: DBRef, + Decimal128: Decimal128, + Double: Double, + Int32: Int32, + Long: Long, + UUID: UUID, + Map: bsonMap, + MaxKey: MaxKey, + MinKey: MinKey, + ObjectId: ObjectId, + ObjectID: ObjectId, + BSONRegExp: BSONRegExp, + BSONSymbol: BSONSymbol, + Timestamp: Timestamp, + EJSON: EJSON, + setInternalBufferSize: setInternalBufferSize, + serialize: serialize, + serializeWithBufferAndIndex: serializeWithBufferAndIndex, + deserialize: deserialize, + calculateObjectSize: calculateObjectSize, + deserializeStream: deserializeStream, + BSONError: BSONError, + BSONTypeError: BSONTypeError +}; + +export default BSON; +export { BSONError, BSONRegExp, BSONSymbol, BSONTypeError, BSON_BINARY_SUBTYPE_BYTE_ARRAY, BSON_BINARY_SUBTYPE_COLUMN, BSON_BINARY_SUBTYPE_DEFAULT, BSON_BINARY_SUBTYPE_ENCRYPTED, BSON_BINARY_SUBTYPE_FUNCTION, BSON_BINARY_SUBTYPE_MD5, BSON_BINARY_SUBTYPE_USER_DEFINED, BSON_BINARY_SUBTYPE_UUID, BSON_BINARY_SUBTYPE_UUID_NEW, BSON_DATA_ARRAY, BSON_DATA_BINARY, BSON_DATA_BOOLEAN, BSON_DATA_CODE, BSON_DATA_CODE_W_SCOPE, BSON_DATA_DATE, BSON_DATA_DBPOINTER, BSON_DATA_DECIMAL128, BSON_DATA_INT, BSON_DATA_LONG, BSON_DATA_MAX_KEY, BSON_DATA_MIN_KEY, BSON_DATA_NULL, BSON_DATA_NUMBER, BSON_DATA_OBJECT, BSON_DATA_OID, BSON_DATA_REGEXP, BSON_DATA_STRING, BSON_DATA_SYMBOL, BSON_DATA_TIMESTAMP, BSON_DATA_UNDEFINED, BSON_INT32_MAX, BSON_INT32_MIN, BSON_INT64_MAX, BSON_INT64_MIN, Binary, Code, DBRef, Decimal128, Double, EJSON, Int32, Long, LongWithoutOverridesClass, bsonMap as Map, MaxKey, MinKey, ObjectId as ObjectID, ObjectId, Timestamp, UUID, calculateObjectSize, deserialize, deserializeStream, serialize, serializeWithBufferAndIndex, setInternalBufferSize }; +//# sourceMappingURL=bson.browser.esm.js.map diff --git a/node_modules/bson/dist/bson.browser.esm.js.map b/node_modules/bson/dist/bson.browser.esm.js.map new file mode 100644 index 000000000..b8cc0a938 --- /dev/null +++ b/node_modules/bson/dist/bson.browser.esm.js.map @@ -0,0 +1 @@ +{"version":3,"file":"bson.browser.esm.js","sources":["../node_modules/base64-js/index.js","../node_modules/ieee754/index.js","../node_modules/buffer/index.js","../node_modules/tslib/tslib.es6.js","../src/error.ts","../src/utils/global.ts","../src/parser/utils.ts","../src/ensure_buffer.ts","../src/uuid_utils.ts","../src/uuid.ts","../src/binary.ts","../src/code.ts","../src/db_ref.ts","../src/long.ts","../src/decimal128.ts","../src/double.ts","../src/int_32.ts","../src/max_key.ts","../src/min_key.ts","../src/objectid.ts","../src/regexp.ts","../src/symbol.ts","../src/timestamp.ts","../src/extended_json.ts","../src/map.ts","../src/constants.ts","../src/parser/calculate_size.ts","../src/validate_utf8.ts","../src/parser/deserializer.ts","../src/float_parser.ts","../src/parser/serializer.ts","../src/bson.ts"],"sourcesContent":["'use strict'\n\nexports.byteLength = byteLength\nexports.toByteArray = toByteArray\nexports.fromByteArray = fromByteArray\n\nvar lookup = []\nvar revLookup = []\nvar Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array\n\nvar code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'\nfor (var i = 0, len = code.length; i < len; ++i) {\n lookup[i] = code[i]\n revLookup[code.charCodeAt(i)] = i\n}\n\n// Support decoding URL-safe base64 strings, as Node.js does.\n// See: https://en.wikipedia.org/wiki/Base64#URL_applications\nrevLookup['-'.charCodeAt(0)] = 62\nrevLookup['_'.charCodeAt(0)] = 63\n\nfunction getLens (b64) {\n var len = b64.length\n\n if (len % 4 > 0) {\n throw new Error('Invalid string. Length must be a multiple of 4')\n }\n\n // Trim off extra bytes after placeholder bytes are found\n // See: https://github.com/beatgammit/base64-js/issues/42\n var validLen = b64.indexOf('=')\n if (validLen === -1) validLen = len\n\n var placeHoldersLen = validLen === len\n ? 0\n : 4 - (validLen % 4)\n\n return [validLen, placeHoldersLen]\n}\n\n// base64 is 4/3 + up to two characters of the original data\nfunction byteLength (b64) {\n var lens = getLens(b64)\n var validLen = lens[0]\n var placeHoldersLen = lens[1]\n return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen\n}\n\nfunction _byteLength (b64, validLen, placeHoldersLen) {\n return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen\n}\n\nfunction toByteArray (b64) {\n var tmp\n var lens = getLens(b64)\n var validLen = lens[0]\n var placeHoldersLen = lens[1]\n\n var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen))\n\n var curByte = 0\n\n // if there are placeholders, only get up to the last complete 4 chars\n var len = placeHoldersLen > 0\n ? validLen - 4\n : validLen\n\n var i\n for (i = 0; i < len; i += 4) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 18) |\n (revLookup[b64.charCodeAt(i + 1)] << 12) |\n (revLookup[b64.charCodeAt(i + 2)] << 6) |\n revLookup[b64.charCodeAt(i + 3)]\n arr[curByte++] = (tmp >> 16) & 0xFF\n arr[curByte++] = (tmp >> 8) & 0xFF\n arr[curByte++] = tmp & 0xFF\n }\n\n if (placeHoldersLen === 2) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 2) |\n (revLookup[b64.charCodeAt(i + 1)] >> 4)\n arr[curByte++] = tmp & 0xFF\n }\n\n if (placeHoldersLen === 1) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 10) |\n (revLookup[b64.charCodeAt(i + 1)] << 4) |\n (revLookup[b64.charCodeAt(i + 2)] >> 2)\n arr[curByte++] = (tmp >> 8) & 0xFF\n arr[curByte++] = tmp & 0xFF\n }\n\n return arr\n}\n\nfunction tripletToBase64 (num) {\n return lookup[num >> 18 & 0x3F] +\n lookup[num >> 12 & 0x3F] +\n lookup[num >> 6 & 0x3F] +\n lookup[num & 0x3F]\n}\n\nfunction encodeChunk (uint8, start, end) {\n var tmp\n var output = []\n for (var i = start; i < end; i += 3) {\n tmp =\n ((uint8[i] << 16) & 0xFF0000) +\n ((uint8[i + 1] << 8) & 0xFF00) +\n (uint8[i + 2] & 0xFF)\n output.push(tripletToBase64(tmp))\n }\n return output.join('')\n}\n\nfunction fromByteArray (uint8) {\n var tmp\n var len = uint8.length\n var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes\n var parts = []\n var maxChunkLength = 16383 // must be multiple of 3\n\n // go through the array every three bytes, we'll deal with trailing stuff later\n for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {\n parts.push(encodeChunk(uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)))\n }\n\n // pad the end with zeros, but make sure to not forget the extra bytes\n if (extraBytes === 1) {\n tmp = uint8[len - 1]\n parts.push(\n lookup[tmp >> 2] +\n lookup[(tmp << 4) & 0x3F] +\n '=='\n )\n } else if (extraBytes === 2) {\n tmp = (uint8[len - 2] << 8) + uint8[len - 1]\n parts.push(\n lookup[tmp >> 10] +\n lookup[(tmp >> 4) & 0x3F] +\n lookup[(tmp << 2) & 0x3F] +\n '='\n )\n }\n\n return parts.join('')\n}\n","/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */\nexports.read = function (buffer, offset, isLE, mLen, nBytes) {\n var e, m\n var eLen = (nBytes * 8) - mLen - 1\n var eMax = (1 << eLen) - 1\n var eBias = eMax >> 1\n var nBits = -7\n var i = isLE ? (nBytes - 1) : 0\n var d = isLE ? -1 : 1\n var s = buffer[offset + i]\n\n i += d\n\n e = s & ((1 << (-nBits)) - 1)\n s >>= (-nBits)\n nBits += eLen\n for (; nBits > 0; e = (e * 256) + buffer[offset + i], i += d, nBits -= 8) {}\n\n m = e & ((1 << (-nBits)) - 1)\n e >>= (-nBits)\n nBits += mLen\n for (; nBits > 0; m = (m * 256) + buffer[offset + i], i += d, nBits -= 8) {}\n\n if (e === 0) {\n e = 1 - eBias\n } else if (e === eMax) {\n return m ? NaN : ((s ? -1 : 1) * Infinity)\n } else {\n m = m + Math.pow(2, mLen)\n e = e - eBias\n }\n return (s ? -1 : 1) * m * Math.pow(2, e - mLen)\n}\n\nexports.write = function (buffer, value, offset, isLE, mLen, nBytes) {\n var e, m, c\n var eLen = (nBytes * 8) - mLen - 1\n var eMax = (1 << eLen) - 1\n var eBias = eMax >> 1\n var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0)\n var i = isLE ? 0 : (nBytes - 1)\n var d = isLE ? 1 : -1\n var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0\n\n value = Math.abs(value)\n\n if (isNaN(value) || value === Infinity) {\n m = isNaN(value) ? 1 : 0\n e = eMax\n } else {\n e = Math.floor(Math.log(value) / Math.LN2)\n if (value * (c = Math.pow(2, -e)) < 1) {\n e--\n c *= 2\n }\n if (e + eBias >= 1) {\n value += rt / c\n } else {\n value += rt * Math.pow(2, 1 - eBias)\n }\n if (value * c >= 2) {\n e++\n c /= 2\n }\n\n if (e + eBias >= eMax) {\n m = 0\n e = eMax\n } else if (e + eBias >= 1) {\n m = ((value * c) - 1) * Math.pow(2, mLen)\n e = e + eBias\n } else {\n m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen)\n e = 0\n }\n }\n\n for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {}\n\n e = (e << mLen) | m\n eLen += mLen\n for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {}\n\n buffer[offset + i - d] |= s * 128\n}\n","/*!\n * The buffer module from node.js, for the browser.\n *\n * @author Feross Aboukhadijeh \n * @license MIT\n */\n/* eslint-disable no-proto */\n\n'use strict'\n\nvar base64 = require('base64-js')\nvar ieee754 = require('ieee754')\nvar customInspectSymbol =\n (typeof Symbol === 'function' && typeof Symbol['for'] === 'function') // eslint-disable-line dot-notation\n ? Symbol['for']('nodejs.util.inspect.custom') // eslint-disable-line dot-notation\n : null\n\nexports.Buffer = Buffer\nexports.SlowBuffer = SlowBuffer\nexports.INSPECT_MAX_BYTES = 50\n\nvar K_MAX_LENGTH = 0x7fffffff\nexports.kMaxLength = K_MAX_LENGTH\n\n/**\n * If `Buffer.TYPED_ARRAY_SUPPORT`:\n * === true Use Uint8Array implementation (fastest)\n * === false Print warning and recommend using `buffer` v4.x which has an Object\n * implementation (most compatible, even IE6)\n *\n * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,\n * Opera 11.6+, iOS 4.2+.\n *\n * We report that the browser does not support typed arrays if the are not subclassable\n * using __proto__. Firefox 4-29 lacks support for adding new properties to `Uint8Array`\n * (See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438). IE 10 lacks support\n * for __proto__ and has a buggy typed array implementation.\n */\nBuffer.TYPED_ARRAY_SUPPORT = typedArraySupport()\n\nif (!Buffer.TYPED_ARRAY_SUPPORT && typeof console !== 'undefined' &&\n typeof console.error === 'function') {\n console.error(\n 'This browser lacks typed array (Uint8Array) support which is required by ' +\n '`buffer` v5.x. Use `buffer` v4.x if you require old browser support.'\n )\n}\n\nfunction typedArraySupport () {\n // Can typed array instances can be augmented?\n try {\n var arr = new Uint8Array(1)\n var proto = { foo: function () { return 42 } }\n Object.setPrototypeOf(proto, Uint8Array.prototype)\n Object.setPrototypeOf(arr, proto)\n return arr.foo() === 42\n } catch (e) {\n return false\n }\n}\n\nObject.defineProperty(Buffer.prototype, 'parent', {\n enumerable: true,\n get: function () {\n if (!Buffer.isBuffer(this)) return undefined\n return this.buffer\n }\n})\n\nObject.defineProperty(Buffer.prototype, 'offset', {\n enumerable: true,\n get: function () {\n if (!Buffer.isBuffer(this)) return undefined\n return this.byteOffset\n }\n})\n\nfunction createBuffer (length) {\n if (length > K_MAX_LENGTH) {\n throw new RangeError('The value \"' + length + '\" is invalid for option \"size\"')\n }\n // Return an augmented `Uint8Array` instance\n var buf = new Uint8Array(length)\n Object.setPrototypeOf(buf, Buffer.prototype)\n return buf\n}\n\n/**\n * The Buffer constructor returns instances of `Uint8Array` that have their\n * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of\n * `Uint8Array`, so the returned instances will have all the node `Buffer` methods\n * and the `Uint8Array` methods. Square bracket notation works as expected -- it\n * returns a single octet.\n *\n * The `Uint8Array` prototype remains unmodified.\n */\n\nfunction Buffer (arg, encodingOrOffset, length) {\n // Common case.\n if (typeof arg === 'number') {\n if (typeof encodingOrOffset === 'string') {\n throw new TypeError(\n 'The \"string\" argument must be of type string. Received type number'\n )\n }\n return allocUnsafe(arg)\n }\n return from(arg, encodingOrOffset, length)\n}\n\nBuffer.poolSize = 8192 // not used by this implementation\n\nfunction from (value, encodingOrOffset, length) {\n if (typeof value === 'string') {\n return fromString(value, encodingOrOffset)\n }\n\n if (ArrayBuffer.isView(value)) {\n return fromArrayView(value)\n }\n\n if (value == null) {\n throw new TypeError(\n 'The first argument must be one of type string, Buffer, ArrayBuffer, Array, ' +\n 'or Array-like Object. Received type ' + (typeof value)\n )\n }\n\n if (isInstance(value, ArrayBuffer) ||\n (value && isInstance(value.buffer, ArrayBuffer))) {\n return fromArrayBuffer(value, encodingOrOffset, length)\n }\n\n if (typeof SharedArrayBuffer !== 'undefined' &&\n (isInstance(value, SharedArrayBuffer) ||\n (value && isInstance(value.buffer, SharedArrayBuffer)))) {\n return fromArrayBuffer(value, encodingOrOffset, length)\n }\n\n if (typeof value === 'number') {\n throw new TypeError(\n 'The \"value\" argument must not be of type number. Received type number'\n )\n }\n\n var valueOf = value.valueOf && value.valueOf()\n if (valueOf != null && valueOf !== value) {\n return Buffer.from(valueOf, encodingOrOffset, length)\n }\n\n var b = fromObject(value)\n if (b) return b\n\n if (typeof Symbol !== 'undefined' && Symbol.toPrimitive != null &&\n typeof value[Symbol.toPrimitive] === 'function') {\n return Buffer.from(\n value[Symbol.toPrimitive]('string'), encodingOrOffset, length\n )\n }\n\n throw new TypeError(\n 'The first argument must be one of type string, Buffer, ArrayBuffer, Array, ' +\n 'or Array-like Object. Received type ' + (typeof value)\n )\n}\n\n/**\n * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError\n * if value is a number.\n * Buffer.from(str[, encoding])\n * Buffer.from(array)\n * Buffer.from(buffer)\n * Buffer.from(arrayBuffer[, byteOffset[, length]])\n **/\nBuffer.from = function (value, encodingOrOffset, length) {\n return from(value, encodingOrOffset, length)\n}\n\n// Note: Change prototype *after* Buffer.from is defined to workaround Chrome bug:\n// https://github.com/feross/buffer/pull/148\nObject.setPrototypeOf(Buffer.prototype, Uint8Array.prototype)\nObject.setPrototypeOf(Buffer, Uint8Array)\n\nfunction assertSize (size) {\n if (typeof size !== 'number') {\n throw new TypeError('\"size\" argument must be of type number')\n } else if (size < 0) {\n throw new RangeError('The value \"' + size + '\" is invalid for option \"size\"')\n }\n}\n\nfunction alloc (size, fill, encoding) {\n assertSize(size)\n if (size <= 0) {\n return createBuffer(size)\n }\n if (fill !== undefined) {\n // Only pay attention to encoding if it's a string. This\n // prevents accidentally sending in a number that would\n // be interpreted as a start offset.\n return typeof encoding === 'string'\n ? createBuffer(size).fill(fill, encoding)\n : createBuffer(size).fill(fill)\n }\n return createBuffer(size)\n}\n\n/**\n * Creates a new filled Buffer instance.\n * alloc(size[, fill[, encoding]])\n **/\nBuffer.alloc = function (size, fill, encoding) {\n return alloc(size, fill, encoding)\n}\n\nfunction allocUnsafe (size) {\n assertSize(size)\n return createBuffer(size < 0 ? 0 : checked(size) | 0)\n}\n\n/**\n * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance.\n * */\nBuffer.allocUnsafe = function (size) {\n return allocUnsafe(size)\n}\n/**\n * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.\n */\nBuffer.allocUnsafeSlow = function (size) {\n return allocUnsafe(size)\n}\n\nfunction fromString (string, encoding) {\n if (typeof encoding !== 'string' || encoding === '') {\n encoding = 'utf8'\n }\n\n if (!Buffer.isEncoding(encoding)) {\n throw new TypeError('Unknown encoding: ' + encoding)\n }\n\n var length = byteLength(string, encoding) | 0\n var buf = createBuffer(length)\n\n var actual = buf.write(string, encoding)\n\n if (actual !== length) {\n // Writing a hex string, for example, that contains invalid characters will\n // cause everything after the first invalid character to be ignored. (e.g.\n // 'abxxcd' will be treated as 'ab')\n buf = buf.slice(0, actual)\n }\n\n return buf\n}\n\nfunction fromArrayLike (array) {\n var length = array.length < 0 ? 0 : checked(array.length) | 0\n var buf = createBuffer(length)\n for (var i = 0; i < length; i += 1) {\n buf[i] = array[i] & 255\n }\n return buf\n}\n\nfunction fromArrayView (arrayView) {\n if (isInstance(arrayView, Uint8Array)) {\n var copy = new Uint8Array(arrayView)\n return fromArrayBuffer(copy.buffer, copy.byteOffset, copy.byteLength)\n }\n return fromArrayLike(arrayView)\n}\n\nfunction fromArrayBuffer (array, byteOffset, length) {\n if (byteOffset < 0 || array.byteLength < byteOffset) {\n throw new RangeError('\"offset\" is outside of buffer bounds')\n }\n\n if (array.byteLength < byteOffset + (length || 0)) {\n throw new RangeError('\"length\" is outside of buffer bounds')\n }\n\n var buf\n if (byteOffset === undefined && length === undefined) {\n buf = new Uint8Array(array)\n } else if (length === undefined) {\n buf = new Uint8Array(array, byteOffset)\n } else {\n buf = new Uint8Array(array, byteOffset, length)\n }\n\n // Return an augmented `Uint8Array` instance\n Object.setPrototypeOf(buf, Buffer.prototype)\n\n return buf\n}\n\nfunction fromObject (obj) {\n if (Buffer.isBuffer(obj)) {\n var len = checked(obj.length) | 0\n var buf = createBuffer(len)\n\n if (buf.length === 0) {\n return buf\n }\n\n obj.copy(buf, 0, 0, len)\n return buf\n }\n\n if (obj.length !== undefined) {\n if (typeof obj.length !== 'number' || numberIsNaN(obj.length)) {\n return createBuffer(0)\n }\n return fromArrayLike(obj)\n }\n\n if (obj.type === 'Buffer' && Array.isArray(obj.data)) {\n return fromArrayLike(obj.data)\n }\n}\n\nfunction checked (length) {\n // Note: cannot use `length < K_MAX_LENGTH` here because that fails when\n // length is NaN (which is otherwise coerced to zero.)\n if (length >= K_MAX_LENGTH) {\n throw new RangeError('Attempt to allocate Buffer larger than maximum ' +\n 'size: 0x' + K_MAX_LENGTH.toString(16) + ' bytes')\n }\n return length | 0\n}\n\nfunction SlowBuffer (length) {\n if (+length != length) { // eslint-disable-line eqeqeq\n length = 0\n }\n return Buffer.alloc(+length)\n}\n\nBuffer.isBuffer = function isBuffer (b) {\n return b != null && b._isBuffer === true &&\n b !== Buffer.prototype // so Buffer.isBuffer(Buffer.prototype) will be false\n}\n\nBuffer.compare = function compare (a, b) {\n if (isInstance(a, Uint8Array)) a = Buffer.from(a, a.offset, a.byteLength)\n if (isInstance(b, Uint8Array)) b = Buffer.from(b, b.offset, b.byteLength)\n if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) {\n throw new TypeError(\n 'The \"buf1\", \"buf2\" arguments must be one of type Buffer or Uint8Array'\n )\n }\n\n if (a === b) return 0\n\n var x = a.length\n var y = b.length\n\n for (var i = 0, len = Math.min(x, y); i < len; ++i) {\n if (a[i] !== b[i]) {\n x = a[i]\n y = b[i]\n break\n }\n }\n\n if (x < y) return -1\n if (y < x) return 1\n return 0\n}\n\nBuffer.isEncoding = function isEncoding (encoding) {\n switch (String(encoding).toLowerCase()) {\n case 'hex':\n case 'utf8':\n case 'utf-8':\n case 'ascii':\n case 'latin1':\n case 'binary':\n case 'base64':\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return true\n default:\n return false\n }\n}\n\nBuffer.concat = function concat (list, length) {\n if (!Array.isArray(list)) {\n throw new TypeError('\"list\" argument must be an Array of Buffers')\n }\n\n if (list.length === 0) {\n return Buffer.alloc(0)\n }\n\n var i\n if (length === undefined) {\n length = 0\n for (i = 0; i < list.length; ++i) {\n length += list[i].length\n }\n }\n\n var buffer = Buffer.allocUnsafe(length)\n var pos = 0\n for (i = 0; i < list.length; ++i) {\n var buf = list[i]\n if (isInstance(buf, Uint8Array)) {\n if (pos + buf.length > buffer.length) {\n Buffer.from(buf).copy(buffer, pos)\n } else {\n Uint8Array.prototype.set.call(\n buffer,\n buf,\n pos\n )\n }\n } else if (!Buffer.isBuffer(buf)) {\n throw new TypeError('\"list\" argument must be an Array of Buffers')\n } else {\n buf.copy(buffer, pos)\n }\n pos += buf.length\n }\n return buffer\n}\n\nfunction byteLength (string, encoding) {\n if (Buffer.isBuffer(string)) {\n return string.length\n }\n if (ArrayBuffer.isView(string) || isInstance(string, ArrayBuffer)) {\n return string.byteLength\n }\n if (typeof string !== 'string') {\n throw new TypeError(\n 'The \"string\" argument must be one of type string, Buffer, or ArrayBuffer. ' +\n 'Received type ' + typeof string\n )\n }\n\n var len = string.length\n var mustMatch = (arguments.length > 2 && arguments[2] === true)\n if (!mustMatch && len === 0) return 0\n\n // Use a for loop to avoid recursion\n var loweredCase = false\n for (;;) {\n switch (encoding) {\n case 'ascii':\n case 'latin1':\n case 'binary':\n return len\n case 'utf8':\n case 'utf-8':\n return utf8ToBytes(string).length\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return len * 2\n case 'hex':\n return len >>> 1\n case 'base64':\n return base64ToBytes(string).length\n default:\n if (loweredCase) {\n return mustMatch ? -1 : utf8ToBytes(string).length // assume utf8\n }\n encoding = ('' + encoding).toLowerCase()\n loweredCase = true\n }\n }\n}\nBuffer.byteLength = byteLength\n\nfunction slowToString (encoding, start, end) {\n var loweredCase = false\n\n // No need to verify that \"this.length <= MAX_UINT32\" since it's a read-only\n // property of a typed array.\n\n // This behaves neither like String nor Uint8Array in that we set start/end\n // to their upper/lower bounds if the value passed is out of range.\n // undefined is handled specially as per ECMA-262 6th Edition,\n // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization.\n if (start === undefined || start < 0) {\n start = 0\n }\n // Return early if start > this.length. Done here to prevent potential uint32\n // coercion fail below.\n if (start > this.length) {\n return ''\n }\n\n if (end === undefined || end > this.length) {\n end = this.length\n }\n\n if (end <= 0) {\n return ''\n }\n\n // Force coercion to uint32. This will also coerce falsey/NaN values to 0.\n end >>>= 0\n start >>>= 0\n\n if (end <= start) {\n return ''\n }\n\n if (!encoding) encoding = 'utf8'\n\n while (true) {\n switch (encoding) {\n case 'hex':\n return hexSlice(this, start, end)\n\n case 'utf8':\n case 'utf-8':\n return utf8Slice(this, start, end)\n\n case 'ascii':\n return asciiSlice(this, start, end)\n\n case 'latin1':\n case 'binary':\n return latin1Slice(this, start, end)\n\n case 'base64':\n return base64Slice(this, start, end)\n\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return utf16leSlice(this, start, end)\n\n default:\n if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)\n encoding = (encoding + '').toLowerCase()\n loweredCase = true\n }\n }\n}\n\n// This property is used by `Buffer.isBuffer` (and the `is-buffer` npm package)\n// to detect a Buffer instance. It's not possible to use `instanceof Buffer`\n// reliably in a browserify context because there could be multiple different\n// copies of the 'buffer' package in use. This method works even for Buffer\n// instances that were created from another copy of the `buffer` package.\n// See: https://github.com/feross/buffer/issues/154\nBuffer.prototype._isBuffer = true\n\nfunction swap (b, n, m) {\n var i = b[n]\n b[n] = b[m]\n b[m] = i\n}\n\nBuffer.prototype.swap16 = function swap16 () {\n var len = this.length\n if (len % 2 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 16-bits')\n }\n for (var i = 0; i < len; i += 2) {\n swap(this, i, i + 1)\n }\n return this\n}\n\nBuffer.prototype.swap32 = function swap32 () {\n var len = this.length\n if (len % 4 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 32-bits')\n }\n for (var i = 0; i < len; i += 4) {\n swap(this, i, i + 3)\n swap(this, i + 1, i + 2)\n }\n return this\n}\n\nBuffer.prototype.swap64 = function swap64 () {\n var len = this.length\n if (len % 8 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 64-bits')\n }\n for (var i = 0; i < len; i += 8) {\n swap(this, i, i + 7)\n swap(this, i + 1, i + 6)\n swap(this, i + 2, i + 5)\n swap(this, i + 3, i + 4)\n }\n return this\n}\n\nBuffer.prototype.toString = function toString () {\n var length = this.length\n if (length === 0) return ''\n if (arguments.length === 0) return utf8Slice(this, 0, length)\n return slowToString.apply(this, arguments)\n}\n\nBuffer.prototype.toLocaleString = Buffer.prototype.toString\n\nBuffer.prototype.equals = function equals (b) {\n if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer')\n if (this === b) return true\n return Buffer.compare(this, b) === 0\n}\n\nBuffer.prototype.inspect = function inspect () {\n var str = ''\n var max = exports.INSPECT_MAX_BYTES\n str = this.toString('hex', 0, max).replace(/(.{2})/g, '$1 ').trim()\n if (this.length > max) str += ' ... '\n return ''\n}\nif (customInspectSymbol) {\n Buffer.prototype[customInspectSymbol] = Buffer.prototype.inspect\n}\n\nBuffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) {\n if (isInstance(target, Uint8Array)) {\n target = Buffer.from(target, target.offset, target.byteLength)\n }\n if (!Buffer.isBuffer(target)) {\n throw new TypeError(\n 'The \"target\" argument must be one of type Buffer or Uint8Array. ' +\n 'Received type ' + (typeof target)\n )\n }\n\n if (start === undefined) {\n start = 0\n }\n if (end === undefined) {\n end = target ? target.length : 0\n }\n if (thisStart === undefined) {\n thisStart = 0\n }\n if (thisEnd === undefined) {\n thisEnd = this.length\n }\n\n if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) {\n throw new RangeError('out of range index')\n }\n\n if (thisStart >= thisEnd && start >= end) {\n return 0\n }\n if (thisStart >= thisEnd) {\n return -1\n }\n if (start >= end) {\n return 1\n }\n\n start >>>= 0\n end >>>= 0\n thisStart >>>= 0\n thisEnd >>>= 0\n\n if (this === target) return 0\n\n var x = thisEnd - thisStart\n var y = end - start\n var len = Math.min(x, y)\n\n var thisCopy = this.slice(thisStart, thisEnd)\n var targetCopy = target.slice(start, end)\n\n for (var i = 0; i < len; ++i) {\n if (thisCopy[i] !== targetCopy[i]) {\n x = thisCopy[i]\n y = targetCopy[i]\n break\n }\n }\n\n if (x < y) return -1\n if (y < x) return 1\n return 0\n}\n\n// Finds either the first index of `val` in `buffer` at offset >= `byteOffset`,\n// OR the last index of `val` in `buffer` at offset <= `byteOffset`.\n//\n// Arguments:\n// - buffer - a Buffer to search\n// - val - a string, Buffer, or number\n// - byteOffset - an index into `buffer`; will be clamped to an int32\n// - encoding - an optional encoding, relevant is val is a string\n// - dir - true for indexOf, false for lastIndexOf\nfunction bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {\n // Empty buffer means no match\n if (buffer.length === 0) return -1\n\n // Normalize byteOffset\n if (typeof byteOffset === 'string') {\n encoding = byteOffset\n byteOffset = 0\n } else if (byteOffset > 0x7fffffff) {\n byteOffset = 0x7fffffff\n } else if (byteOffset < -0x80000000) {\n byteOffset = -0x80000000\n }\n byteOffset = +byteOffset // Coerce to Number.\n if (numberIsNaN(byteOffset)) {\n // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n byteOffset = dir ? 0 : (buffer.length - 1)\n }\n\n // Normalize byteOffset: negative offsets start from the end of the buffer\n if (byteOffset < 0) byteOffset = buffer.length + byteOffset\n if (byteOffset >= buffer.length) {\n if (dir) return -1\n else byteOffset = buffer.length - 1\n } else if (byteOffset < 0) {\n if (dir) byteOffset = 0\n else return -1\n }\n\n // Normalize val\n if (typeof val === 'string') {\n val = Buffer.from(val, encoding)\n }\n\n // Finally, search either indexOf (if dir is true) or lastIndexOf\n if (Buffer.isBuffer(val)) {\n // Special case: looking for empty string/buffer always fails\n if (val.length === 0) {\n return -1\n }\n return arrayIndexOf(buffer, val, byteOffset, encoding, dir)\n } else if (typeof val === 'number') {\n val = val & 0xFF // Search for a byte value [0-255]\n if (typeof Uint8Array.prototype.indexOf === 'function') {\n if (dir) {\n return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)\n } else {\n return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)\n }\n }\n return arrayIndexOf(buffer, [val], byteOffset, encoding, dir)\n }\n\n throw new TypeError('val must be string, number or Buffer')\n}\n\nfunction arrayIndexOf (arr, val, byteOffset, encoding, dir) {\n var indexSize = 1\n var arrLength = arr.length\n var valLength = val.length\n\n if (encoding !== undefined) {\n encoding = String(encoding).toLowerCase()\n if (encoding === 'ucs2' || encoding === 'ucs-2' ||\n encoding === 'utf16le' || encoding === 'utf-16le') {\n if (arr.length < 2 || val.length < 2) {\n return -1\n }\n indexSize = 2\n arrLength /= 2\n valLength /= 2\n byteOffset /= 2\n }\n }\n\n function read (buf, i) {\n if (indexSize === 1) {\n return buf[i]\n } else {\n return buf.readUInt16BE(i * indexSize)\n }\n }\n\n var i\n if (dir) {\n var foundIndex = -1\n for (i = byteOffset; i < arrLength; i++) {\n if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {\n if (foundIndex === -1) foundIndex = i\n if (i - foundIndex + 1 === valLength) return foundIndex * indexSize\n } else {\n if (foundIndex !== -1) i -= i - foundIndex\n foundIndex = -1\n }\n }\n } else {\n if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength\n for (i = byteOffset; i >= 0; i--) {\n var found = true\n for (var j = 0; j < valLength; j++) {\n if (read(arr, i + j) !== read(val, j)) {\n found = false\n break\n }\n }\n if (found) return i\n }\n }\n\n return -1\n}\n\nBuffer.prototype.includes = function includes (val, byteOffset, encoding) {\n return this.indexOf(val, byteOffset, encoding) !== -1\n}\n\nBuffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) {\n return bidirectionalIndexOf(this, val, byteOffset, encoding, true)\n}\n\nBuffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) {\n return bidirectionalIndexOf(this, val, byteOffset, encoding, false)\n}\n\nfunction hexWrite (buf, string, offset, length) {\n offset = Number(offset) || 0\n var remaining = buf.length - offset\n if (!length) {\n length = remaining\n } else {\n length = Number(length)\n if (length > remaining) {\n length = remaining\n }\n }\n\n var strLen = string.length\n\n if (length > strLen / 2) {\n length = strLen / 2\n }\n for (var i = 0; i < length; ++i) {\n var parsed = parseInt(string.substr(i * 2, 2), 16)\n if (numberIsNaN(parsed)) return i\n buf[offset + i] = parsed\n }\n return i\n}\n\nfunction utf8Write (buf, string, offset, length) {\n return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length)\n}\n\nfunction asciiWrite (buf, string, offset, length) {\n return blitBuffer(asciiToBytes(string), buf, offset, length)\n}\n\nfunction base64Write (buf, string, offset, length) {\n return blitBuffer(base64ToBytes(string), buf, offset, length)\n}\n\nfunction ucs2Write (buf, string, offset, length) {\n return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length)\n}\n\nBuffer.prototype.write = function write (string, offset, length, encoding) {\n // Buffer#write(string)\n if (offset === undefined) {\n encoding = 'utf8'\n length = this.length\n offset = 0\n // Buffer#write(string, encoding)\n } else if (length === undefined && typeof offset === 'string') {\n encoding = offset\n length = this.length\n offset = 0\n // Buffer#write(string, offset[, length][, encoding])\n } else if (isFinite(offset)) {\n offset = offset >>> 0\n if (isFinite(length)) {\n length = length >>> 0\n if (encoding === undefined) encoding = 'utf8'\n } else {\n encoding = length\n length = undefined\n }\n } else {\n throw new Error(\n 'Buffer.write(string, encoding, offset[, length]) is no longer supported'\n )\n }\n\n var remaining = this.length - offset\n if (length === undefined || length > remaining) length = remaining\n\n if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) {\n throw new RangeError('Attempt to write outside buffer bounds')\n }\n\n if (!encoding) encoding = 'utf8'\n\n var loweredCase = false\n for (;;) {\n switch (encoding) {\n case 'hex':\n return hexWrite(this, string, offset, length)\n\n case 'utf8':\n case 'utf-8':\n return utf8Write(this, string, offset, length)\n\n case 'ascii':\n case 'latin1':\n case 'binary':\n return asciiWrite(this, string, offset, length)\n\n case 'base64':\n // Warning: maxLength not taken into account in base64Write\n return base64Write(this, string, offset, length)\n\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return ucs2Write(this, string, offset, length)\n\n default:\n if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)\n encoding = ('' + encoding).toLowerCase()\n loweredCase = true\n }\n }\n}\n\nBuffer.prototype.toJSON = function toJSON () {\n return {\n type: 'Buffer',\n data: Array.prototype.slice.call(this._arr || this, 0)\n }\n}\n\nfunction base64Slice (buf, start, end) {\n if (start === 0 && end === buf.length) {\n return base64.fromByteArray(buf)\n } else {\n return base64.fromByteArray(buf.slice(start, end))\n }\n}\n\nfunction utf8Slice (buf, start, end) {\n end = Math.min(buf.length, end)\n var res = []\n\n var i = start\n while (i < end) {\n var firstByte = buf[i]\n var codePoint = null\n var bytesPerSequence = (firstByte > 0xEF)\n ? 4\n : (firstByte > 0xDF)\n ? 3\n : (firstByte > 0xBF)\n ? 2\n : 1\n\n if (i + bytesPerSequence <= end) {\n var secondByte, thirdByte, fourthByte, tempCodePoint\n\n switch (bytesPerSequence) {\n case 1:\n if (firstByte < 0x80) {\n codePoint = firstByte\n }\n break\n case 2:\n secondByte = buf[i + 1]\n if ((secondByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F)\n if (tempCodePoint > 0x7F) {\n codePoint = tempCodePoint\n }\n }\n break\n case 3:\n secondByte = buf[i + 1]\n thirdByte = buf[i + 2]\n if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F)\n if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) {\n codePoint = tempCodePoint\n }\n }\n break\n case 4:\n secondByte = buf[i + 1]\n thirdByte = buf[i + 2]\n fourthByte = buf[i + 3]\n if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F)\n if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) {\n codePoint = tempCodePoint\n }\n }\n }\n }\n\n if (codePoint === null) {\n // we did not generate a valid codePoint so insert a\n // replacement char (U+FFFD) and advance only 1 byte\n codePoint = 0xFFFD\n bytesPerSequence = 1\n } else if (codePoint > 0xFFFF) {\n // encode to utf16 (surrogate pair dance)\n codePoint -= 0x10000\n res.push(codePoint >>> 10 & 0x3FF | 0xD800)\n codePoint = 0xDC00 | codePoint & 0x3FF\n }\n\n res.push(codePoint)\n i += bytesPerSequence\n }\n\n return decodeCodePointsArray(res)\n}\n\n// Based on http://stackoverflow.com/a/22747272/680742, the browser with\n// the lowest limit is Chrome, with 0x10000 args.\n// We go 1 magnitude less, for safety\nvar MAX_ARGUMENTS_LENGTH = 0x1000\n\nfunction decodeCodePointsArray (codePoints) {\n var len = codePoints.length\n if (len <= MAX_ARGUMENTS_LENGTH) {\n return String.fromCharCode.apply(String, codePoints) // avoid extra slice()\n }\n\n // Decode in chunks to avoid \"call stack size exceeded\".\n var res = ''\n var i = 0\n while (i < len) {\n res += String.fromCharCode.apply(\n String,\n codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)\n )\n }\n return res\n}\n\nfunction asciiSlice (buf, start, end) {\n var ret = ''\n end = Math.min(buf.length, end)\n\n for (var i = start; i < end; ++i) {\n ret += String.fromCharCode(buf[i] & 0x7F)\n }\n return ret\n}\n\nfunction latin1Slice (buf, start, end) {\n var ret = ''\n end = Math.min(buf.length, end)\n\n for (var i = start; i < end; ++i) {\n ret += String.fromCharCode(buf[i])\n }\n return ret\n}\n\nfunction hexSlice (buf, start, end) {\n var len = buf.length\n\n if (!start || start < 0) start = 0\n if (!end || end < 0 || end > len) end = len\n\n var out = ''\n for (var i = start; i < end; ++i) {\n out += hexSliceLookupTable[buf[i]]\n }\n return out\n}\n\nfunction utf16leSlice (buf, start, end) {\n var bytes = buf.slice(start, end)\n var res = ''\n // If bytes.length is odd, the last 8 bits must be ignored (same as node.js)\n for (var i = 0; i < bytes.length - 1; i += 2) {\n res += String.fromCharCode(bytes[i] + (bytes[i + 1] * 256))\n }\n return res\n}\n\nBuffer.prototype.slice = function slice (start, end) {\n var len = this.length\n start = ~~start\n end = end === undefined ? len : ~~end\n\n if (start < 0) {\n start += len\n if (start < 0) start = 0\n } else if (start > len) {\n start = len\n }\n\n if (end < 0) {\n end += len\n if (end < 0) end = 0\n } else if (end > len) {\n end = len\n }\n\n if (end < start) end = start\n\n var newBuf = this.subarray(start, end)\n // Return an augmented `Uint8Array` instance\n Object.setPrototypeOf(newBuf, Buffer.prototype)\n\n return newBuf\n}\n\n/*\n * Need to make sure that buffer isn't trying to write out of bounds.\n */\nfunction checkOffset (offset, ext, length) {\n if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n}\n\nBuffer.prototype.readUintLE =\nBuffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) {\n offset = offset >>> 0\n byteLength = byteLength >>> 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n var val = this[offset]\n var mul = 1\n var i = 0\n while (++i < byteLength && (mul *= 0x100)) {\n val += this[offset + i] * mul\n }\n\n return val\n}\n\nBuffer.prototype.readUintBE =\nBuffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) {\n offset = offset >>> 0\n byteLength = byteLength >>> 0\n if (!noAssert) {\n checkOffset(offset, byteLength, this.length)\n }\n\n var val = this[offset + --byteLength]\n var mul = 1\n while (byteLength > 0 && (mul *= 0x100)) {\n val += this[offset + --byteLength] * mul\n }\n\n return val\n}\n\nBuffer.prototype.readUint8 =\nBuffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 1, this.length)\n return this[offset]\n}\n\nBuffer.prototype.readUint16LE =\nBuffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 2, this.length)\n return this[offset] | (this[offset + 1] << 8)\n}\n\nBuffer.prototype.readUint16BE =\nBuffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 2, this.length)\n return (this[offset] << 8) | this[offset + 1]\n}\n\nBuffer.prototype.readUint32LE =\nBuffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return ((this[offset]) |\n (this[offset + 1] << 8) |\n (this[offset + 2] << 16)) +\n (this[offset + 3] * 0x1000000)\n}\n\nBuffer.prototype.readUint32BE =\nBuffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset] * 0x1000000) +\n ((this[offset + 1] << 16) |\n (this[offset + 2] << 8) |\n this[offset + 3])\n}\n\nBuffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) {\n offset = offset >>> 0\n byteLength = byteLength >>> 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n var val = this[offset]\n var mul = 1\n var i = 0\n while (++i < byteLength && (mul *= 0x100)) {\n val += this[offset + i] * mul\n }\n mul *= 0x80\n\n if (val >= mul) val -= Math.pow(2, 8 * byteLength)\n\n return val\n}\n\nBuffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) {\n offset = offset >>> 0\n byteLength = byteLength >>> 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n var i = byteLength\n var mul = 1\n var val = this[offset + --i]\n while (i > 0 && (mul *= 0x100)) {\n val += this[offset + --i] * mul\n }\n mul *= 0x80\n\n if (val >= mul) val -= Math.pow(2, 8 * byteLength)\n\n return val\n}\n\nBuffer.prototype.readInt8 = function readInt8 (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 1, this.length)\n if (!(this[offset] & 0x80)) return (this[offset])\n return ((0xff - this[offset] + 1) * -1)\n}\n\nBuffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 2, this.length)\n var val = this[offset] | (this[offset + 1] << 8)\n return (val & 0x8000) ? val | 0xFFFF0000 : val\n}\n\nBuffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 2, this.length)\n var val = this[offset + 1] | (this[offset] << 8)\n return (val & 0x8000) ? val | 0xFFFF0000 : val\n}\n\nBuffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset]) |\n (this[offset + 1] << 8) |\n (this[offset + 2] << 16) |\n (this[offset + 3] << 24)\n}\n\nBuffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset] << 24) |\n (this[offset + 1] << 16) |\n (this[offset + 2] << 8) |\n (this[offset + 3])\n}\n\nBuffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 4, this.length)\n return ieee754.read(this, offset, true, 23, 4)\n}\n\nBuffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 4, this.length)\n return ieee754.read(this, offset, false, 23, 4)\n}\n\nBuffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 8, this.length)\n return ieee754.read(this, offset, true, 52, 8)\n}\n\nBuffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 8, this.length)\n return ieee754.read(this, offset, false, 52, 8)\n}\n\nfunction checkInt (buf, value, offset, ext, max, min) {\n if (!Buffer.isBuffer(buf)) throw new TypeError('\"buffer\" argument must be a Buffer instance')\n if (value > max || value < min) throw new RangeError('\"value\" argument is out of bounds')\n if (offset + ext > buf.length) throw new RangeError('Index out of range')\n}\n\nBuffer.prototype.writeUintLE =\nBuffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset >>> 0\n byteLength = byteLength >>> 0\n if (!noAssert) {\n var maxBytes = Math.pow(2, 8 * byteLength) - 1\n checkInt(this, value, offset, byteLength, maxBytes, 0)\n }\n\n var mul = 1\n var i = 0\n this[offset] = value & 0xFF\n while (++i < byteLength && (mul *= 0x100)) {\n this[offset + i] = (value / mul) & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeUintBE =\nBuffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset >>> 0\n byteLength = byteLength >>> 0\n if (!noAssert) {\n var maxBytes = Math.pow(2, 8 * byteLength) - 1\n checkInt(this, value, offset, byteLength, maxBytes, 0)\n }\n\n var i = byteLength - 1\n var mul = 1\n this[offset + i] = value & 0xFF\n while (--i >= 0 && (mul *= 0x100)) {\n this[offset + i] = (value / mul) & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeUint8 =\nBuffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0)\n this[offset] = (value & 0xff)\n return offset + 1\n}\n\nBuffer.prototype.writeUint16LE =\nBuffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n return offset + 2\n}\n\nBuffer.prototype.writeUint16BE =\nBuffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)\n this[offset] = (value >>> 8)\n this[offset + 1] = (value & 0xff)\n return offset + 2\n}\n\nBuffer.prototype.writeUint32LE =\nBuffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)\n this[offset + 3] = (value >>> 24)\n this[offset + 2] = (value >>> 16)\n this[offset + 1] = (value >>> 8)\n this[offset] = (value & 0xff)\n return offset + 4\n}\n\nBuffer.prototype.writeUint32BE =\nBuffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)\n this[offset] = (value >>> 24)\n this[offset + 1] = (value >>> 16)\n this[offset + 2] = (value >>> 8)\n this[offset + 3] = (value & 0xff)\n return offset + 4\n}\n\nBuffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) {\n var limit = Math.pow(2, (8 * byteLength) - 1)\n\n checkInt(this, value, offset, byteLength, limit - 1, -limit)\n }\n\n var i = 0\n var mul = 1\n var sub = 0\n this[offset] = value & 0xFF\n while (++i < byteLength && (mul *= 0x100)) {\n if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) {\n sub = 1\n }\n this[offset + i] = ((value / mul) >> 0) - sub & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) {\n var limit = Math.pow(2, (8 * byteLength) - 1)\n\n checkInt(this, value, offset, byteLength, limit - 1, -limit)\n }\n\n var i = byteLength - 1\n var mul = 1\n var sub = 0\n this[offset + i] = value & 0xFF\n while (--i >= 0 && (mul *= 0x100)) {\n if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) {\n sub = 1\n }\n this[offset + i] = ((value / mul) >> 0) - sub & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80)\n if (value < 0) value = 0xff + value + 1\n this[offset] = (value & 0xff)\n return offset + 1\n}\n\nBuffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n return offset + 2\n}\n\nBuffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)\n this[offset] = (value >>> 8)\n this[offset + 1] = (value & 0xff)\n return offset + 2\n}\n\nBuffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n this[offset + 2] = (value >>> 16)\n this[offset + 3] = (value >>> 24)\n return offset + 4\n}\n\nBuffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)\n if (value < 0) value = 0xffffffff + value + 1\n this[offset] = (value >>> 24)\n this[offset + 1] = (value >>> 16)\n this[offset + 2] = (value >>> 8)\n this[offset + 3] = (value & 0xff)\n return offset + 4\n}\n\nfunction checkIEEE754 (buf, value, offset, ext, max, min) {\n if (offset + ext > buf.length) throw new RangeError('Index out of range')\n if (offset < 0) throw new RangeError('Index out of range')\n}\n\nfunction writeFloat (buf, value, offset, littleEndian, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) {\n checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38)\n }\n ieee754.write(buf, value, offset, littleEndian, 23, 4)\n return offset + 4\n}\n\nBuffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) {\n return writeFloat(this, value, offset, true, noAssert)\n}\n\nBuffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) {\n return writeFloat(this, value, offset, false, noAssert)\n}\n\nfunction writeDouble (buf, value, offset, littleEndian, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) {\n checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308)\n }\n ieee754.write(buf, value, offset, littleEndian, 52, 8)\n return offset + 8\n}\n\nBuffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) {\n return writeDouble(this, value, offset, true, noAssert)\n}\n\nBuffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) {\n return writeDouble(this, value, offset, false, noAssert)\n}\n\n// copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)\nBuffer.prototype.copy = function copy (target, targetStart, start, end) {\n if (!Buffer.isBuffer(target)) throw new TypeError('argument should be a Buffer')\n if (!start) start = 0\n if (!end && end !== 0) end = this.length\n if (targetStart >= target.length) targetStart = target.length\n if (!targetStart) targetStart = 0\n if (end > 0 && end < start) end = start\n\n // Copy 0 bytes; we're done\n if (end === start) return 0\n if (target.length === 0 || this.length === 0) return 0\n\n // Fatal error conditions\n if (targetStart < 0) {\n throw new RangeError('targetStart out of bounds')\n }\n if (start < 0 || start >= this.length) throw new RangeError('Index out of range')\n if (end < 0) throw new RangeError('sourceEnd out of bounds')\n\n // Are we oob?\n if (end > this.length) end = this.length\n if (target.length - targetStart < end - start) {\n end = target.length - targetStart + start\n }\n\n var len = end - start\n\n if (this === target && typeof Uint8Array.prototype.copyWithin === 'function') {\n // Use built-in when available, missing from IE11\n this.copyWithin(targetStart, start, end)\n } else {\n Uint8Array.prototype.set.call(\n target,\n this.subarray(start, end),\n targetStart\n )\n }\n\n return len\n}\n\n// Usage:\n// buffer.fill(number[, offset[, end]])\n// buffer.fill(buffer[, offset[, end]])\n// buffer.fill(string[, offset[, end]][, encoding])\nBuffer.prototype.fill = function fill (val, start, end, encoding) {\n // Handle string cases:\n if (typeof val === 'string') {\n if (typeof start === 'string') {\n encoding = start\n start = 0\n end = this.length\n } else if (typeof end === 'string') {\n encoding = end\n end = this.length\n }\n if (encoding !== undefined && typeof encoding !== 'string') {\n throw new TypeError('encoding must be a string')\n }\n if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) {\n throw new TypeError('Unknown encoding: ' + encoding)\n }\n if (val.length === 1) {\n var code = val.charCodeAt(0)\n if ((encoding === 'utf8' && code < 128) ||\n encoding === 'latin1') {\n // Fast path: If `val` fits into a single byte, use that numeric value.\n val = code\n }\n }\n } else if (typeof val === 'number') {\n val = val & 255\n } else if (typeof val === 'boolean') {\n val = Number(val)\n }\n\n // Invalid ranges are not set to a default, so can range check early.\n if (start < 0 || this.length < start || this.length < end) {\n throw new RangeError('Out of range index')\n }\n\n if (end <= start) {\n return this\n }\n\n start = start >>> 0\n end = end === undefined ? this.length : end >>> 0\n\n if (!val) val = 0\n\n var i\n if (typeof val === 'number') {\n for (i = start; i < end; ++i) {\n this[i] = val\n }\n } else {\n var bytes = Buffer.isBuffer(val)\n ? val\n : Buffer.from(val, encoding)\n var len = bytes.length\n if (len === 0) {\n throw new TypeError('The value \"' + val +\n '\" is invalid for argument \"value\"')\n }\n for (i = 0; i < end - start; ++i) {\n this[i + start] = bytes[i % len]\n }\n }\n\n return this\n}\n\n// HELPER FUNCTIONS\n// ================\n\nvar INVALID_BASE64_RE = /[^+/0-9A-Za-z-_]/g\n\nfunction base64clean (str) {\n // Node takes equal signs as end of the Base64 encoding\n str = str.split('=')[0]\n // Node strips out invalid characters like \\n and \\t from the string, base64-js does not\n str = str.trim().replace(INVALID_BASE64_RE, '')\n // Node converts strings with length < 2 to ''\n if (str.length < 2) return ''\n // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not\n while (str.length % 4 !== 0) {\n str = str + '='\n }\n return str\n}\n\nfunction utf8ToBytes (string, units) {\n units = units || Infinity\n var codePoint\n var length = string.length\n var leadSurrogate = null\n var bytes = []\n\n for (var i = 0; i < length; ++i) {\n codePoint = string.charCodeAt(i)\n\n // is surrogate component\n if (codePoint > 0xD7FF && codePoint < 0xE000) {\n // last char was a lead\n if (!leadSurrogate) {\n // no lead yet\n if (codePoint > 0xDBFF) {\n // unexpected trail\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n continue\n } else if (i + 1 === length) {\n // unpaired lead\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n continue\n }\n\n // valid lead\n leadSurrogate = codePoint\n\n continue\n }\n\n // 2 leads in a row\n if (codePoint < 0xDC00) {\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n leadSurrogate = codePoint\n continue\n }\n\n // valid surrogate pair\n codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000\n } else if (leadSurrogate) {\n // valid bmp char, but last char was a lead\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n }\n\n leadSurrogate = null\n\n // encode utf8\n if (codePoint < 0x80) {\n if ((units -= 1) < 0) break\n bytes.push(codePoint)\n } else if (codePoint < 0x800) {\n if ((units -= 2) < 0) break\n bytes.push(\n codePoint >> 0x6 | 0xC0,\n codePoint & 0x3F | 0x80\n )\n } else if (codePoint < 0x10000) {\n if ((units -= 3) < 0) break\n bytes.push(\n codePoint >> 0xC | 0xE0,\n codePoint >> 0x6 & 0x3F | 0x80,\n codePoint & 0x3F | 0x80\n )\n } else if (codePoint < 0x110000) {\n if ((units -= 4) < 0) break\n bytes.push(\n codePoint >> 0x12 | 0xF0,\n codePoint >> 0xC & 0x3F | 0x80,\n codePoint >> 0x6 & 0x3F | 0x80,\n codePoint & 0x3F | 0x80\n )\n } else {\n throw new Error('Invalid code point')\n }\n }\n\n return bytes\n}\n\nfunction asciiToBytes (str) {\n var byteArray = []\n for (var i = 0; i < str.length; ++i) {\n // Node's code seems to be doing this and not & 0x7F..\n byteArray.push(str.charCodeAt(i) & 0xFF)\n }\n return byteArray\n}\n\nfunction utf16leToBytes (str, units) {\n var c, hi, lo\n var byteArray = []\n for (var i = 0; i < str.length; ++i) {\n if ((units -= 2) < 0) break\n\n c = str.charCodeAt(i)\n hi = c >> 8\n lo = c % 256\n byteArray.push(lo)\n byteArray.push(hi)\n }\n\n return byteArray\n}\n\nfunction base64ToBytes (str) {\n return base64.toByteArray(base64clean(str))\n}\n\nfunction blitBuffer (src, dst, offset, length) {\n for (var i = 0; i < length; ++i) {\n if ((i + offset >= dst.length) || (i >= src.length)) break\n dst[i + offset] = src[i]\n }\n return i\n}\n\n// ArrayBuffer or Uint8Array objects from other contexts (i.e. iframes) do not pass\n// the `instanceof` check but they should be treated as of that type.\n// See: https://github.com/feross/buffer/issues/166\nfunction isInstance (obj, type) {\n return obj instanceof type ||\n (obj != null && obj.constructor != null && obj.constructor.name != null &&\n obj.constructor.name === type.name)\n}\nfunction numberIsNaN (obj) {\n // For IE11 support\n return obj !== obj // eslint-disable-line no-self-compare\n}\n\n// Create lookup table for `toString('hex')`\n// See: https://github.com/feross/buffer/issues/219\nvar hexSliceLookupTable = (function () {\n var alphabet = '0123456789abcdef'\n var table = new Array(256)\n for (var i = 0; i < 16; ++i) {\n var i16 = i * 16\n for (var j = 0; j < 16; ++j) {\n table[i16 + j] = alphabet[i] + alphabet[j]\n }\n }\n return table\n})()\n","/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport function __createBinding(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n}\r\n\r\nexport function __exportStar(m, exports) {\r\n for (var p in m) if (p !== \"default\" && !exports.hasOwnProperty(p)) exports[p] = m[p];\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n};\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\r\n result.default = mod;\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, privateMap) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to get private field on non-instance\");\r\n }\r\n return privateMap.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, privateMap, value) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to set private field on non-instance\");\r\n }\r\n privateMap.set(receiver, value);\r\n return value;\r\n}\r\n",null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],"names":["byteLength","toByteArray","fromByteArray","lookup","revLookup","Arr","Uint8Array","Array","code","i","len","length","charCodeAt","getLens","b64","Error","validLen","indexOf","placeHoldersLen","lens","_byteLength","tmp","arr","curByte","tripletToBase64","num","encodeChunk","uint8","start","end","output","push","join","extraBytes","parts","maxChunkLength","len2","buffer","offset","isLE","mLen","nBytes","e","m","eLen","eMax","eBias","nBits","d","s","NaN","Infinity","Math","pow","value","c","rt","abs","isNaN","floor","log","LN2","customInspectSymbol","Symbol","exports","Buffer","SlowBuffer","K_MAX_LENGTH","TYPED_ARRAY_SUPPORT","typedArraySupport","console","error","proto","foo","Object","setPrototypeOf","prototype","defineProperty","enumerable","get","isBuffer","undefined","byteOffset","createBuffer","RangeError","buf","arg","encodingOrOffset","TypeError","allocUnsafe","from","poolSize","fromString","ArrayBuffer","isView","fromArrayView","isInstance","fromArrayBuffer","SharedArrayBuffer","valueOf","b","fromObject","toPrimitive","assertSize","size","alloc","fill","encoding","checked","allocUnsafeSlow","string","isEncoding","actual","write","slice","fromArrayLike","array","arrayView","copy","obj","numberIsNaN","type","isArray","data","toString","_isBuffer","compare","a","x","y","min","String","toLowerCase","concat","list","pos","set","call","mustMatch","arguments","loweredCase","utf8ToBytes","base64ToBytes","slowToString","hexSlice","utf8Slice","asciiSlice","latin1Slice","base64Slice","utf16leSlice","swap","n","swap16","swap32","swap64","apply","toLocaleString","equals","inspect","str","max","INSPECT_MAX_BYTES","replace","trim","target","thisStart","thisEnd","thisCopy","targetCopy","bidirectionalIndexOf","val","dir","arrayIndexOf","lastIndexOf","indexSize","arrLength","valLength","read","readUInt16BE","foundIndex","found","j","includes","hexWrite","Number","remaining","strLen","parsed","parseInt","substr","utf8Write","blitBuffer","asciiWrite","asciiToBytes","base64Write","ucs2Write","utf16leToBytes","isFinite","toJSON","_arr","base64","res","firstByte","codePoint","bytesPerSequence","secondByte","thirdByte","fourthByte","tempCodePoint","decodeCodePointsArray","MAX_ARGUMENTS_LENGTH","codePoints","fromCharCode","ret","out","hexSliceLookupTable","bytes","newBuf","subarray","checkOffset","ext","readUintLE","readUIntLE","noAssert","mul","readUintBE","readUIntBE","readUint8","readUInt8","readUint16LE","readUInt16LE","readUint16BE","readUint32LE","readUInt32LE","readUint32BE","readUInt32BE","readIntLE","readIntBE","readInt8","readInt16LE","readInt16BE","readInt32LE","readInt32BE","readFloatLE","ieee754","readFloatBE","readDoubleLE","readDoubleBE","checkInt","writeUintLE","writeUIntLE","maxBytes","writeUintBE","writeUIntBE","writeUint8","writeUInt8","writeUint16LE","writeUInt16LE","writeUint16BE","writeUInt16BE","writeUint32LE","writeUInt32LE","writeUint32BE","writeUInt32BE","writeIntLE","limit","sub","writeIntBE","writeInt8","writeInt16LE","writeInt16BE","writeInt32LE","writeInt32BE","checkIEEE754","writeFloat","littleEndian","writeFloatLE","writeFloatBE","writeDouble","writeDoubleLE","writeDoubleBE","targetStart","copyWithin","INVALID_BASE64_RE","base64clean","split","units","leadSurrogate","byteArray","hi","lo","src","dst","constructor","name","alphabet","table","i16","extendStatics","__proto__","p","hasOwnProperty","__extends","__","create","__assign","assign","t","kId","BSON_INT32_MAX","BSON_INT32_MIN","BSON_INT64_MAX","BSON_INT64_MIN","calculateObjectSize","constants.JS_INT_MIN","constants.JS_INT_MAX","constants.BSON_INT32_MIN","constants.BSON_INT32_MAX","deserialize","constants.BSON_DATA_STRING","constants.BSON_DATA_OID","constants.BSON_DATA_INT","constants.BSON_DATA_NUMBER","constants.BSON_DATA_DATE","constants.BSON_DATA_BOOLEAN","constants.BSON_DATA_OBJECT","constants.BSON_DATA_ARRAY","constants.BSON_DATA_UNDEFINED","constants.BSON_DATA_NULL","constants.BSON_DATA_LONG","constants.BSON_DATA_DECIMAL128","constants.BSON_DATA_BINARY","constants.BSON_DATA_REGEXP","constants.BSON_DATA_SYMBOL","constants.BSON_DATA_TIMESTAMP","constants.BSON_DATA_MIN_KEY","constants.BSON_DATA_MAX_KEY","constants.BSON_DATA_CODE","constants.BSON_DATA_CODE_W_SCOPE","constants.BSON_DATA_DBPOINTER","constants.BSON_BINARY_SUBTYPE_DEFAULT","Map","internalSerialize","internalDeserialize","internalCalculateObjectSize"],"mappings":";;;;AAEA,gBAAkB,GAAGA,UAArB;AACA,iBAAmB,GAAGC,WAAtB;AACA,mBAAqB,G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AK,OAAA;IACL,UAAU,YAAA;IACV,MAAM,QAAA;IACN,KAAK,OAAA;IACL,IAAI,MAAA;IACJ,IAAI,MAAA;IACJ,GAAG,SAAA;IACH,MAAM,QAAA;IACN,MAAM,QAAA;IACN,QAAQ,UAAA;IACR,QAAQ,EAAE,QAAQ;IAClB,UAAU,YAAA;IACV,UAAU,YAAA;IACV,SAAS,WAAA;IACT,KAAK,OAAA;IACL,qBAAqB,uBAAA;IACrB,SAAS,WAAA;IACT,2BAA2B,6BAAA;IAC3B,WAAW,aAAA;IACX,mBAAmB,qBAAA;IACnB,iBAAiB,mBAAA;IACjB,SAAS,WAAA;IACT,aAAa,eAAA;;;;;;"} \ No newline at end of file diff --git a/node_modules/bson/dist/bson.browser.umd.js b/node_modules/bson/dist/bson.browser.umd.js new file mode 100644 index 000000000..ad48bc929 --- /dev/null +++ b/node_modules/bson/dist/bson.browser.umd.js @@ -0,0 +1,7586 @@ +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : + typeof define === 'function' && define.amd ? define(['exports'], factory) : + (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.BSON = {})); +}(this, (function (exports) { 'use strict'; + + function createCommonjsModule(fn, module) { + return module = { exports: {} }, fn(module, module.exports), module.exports; + } + + var byteLength_1 = byteLength; + var toByteArray_1 = toByteArray; + var fromByteArray_1 = fromByteArray; + var lookup = []; + var revLookup = []; + var Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array; + var code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; + + for (var i = 0, len = code.length; i < len; ++i) { + lookup[i] = code[i]; + revLookup[code.charCodeAt(i)] = i; + } // Support decoding URL-safe base64 strings, as Node.js does. + // See: https://en.wikipedia.org/wiki/Base64#URL_applications + + + revLookup['-'.charCodeAt(0)] = 62; + revLookup['_'.charCodeAt(0)] = 63; + + function getLens(b64) { + var len = b64.length; + + if (len % 4 > 0) { + throw new Error('Invalid string. Length must be a multiple of 4'); + } // Trim off extra bytes after placeholder bytes are found + // See: https://github.com/beatgammit/base64-js/issues/42 + + + var validLen = b64.indexOf('='); + if (validLen === -1) validLen = len; + var placeHoldersLen = validLen === len ? 0 : 4 - validLen % 4; + return [validLen, placeHoldersLen]; + } // base64 is 4/3 + up to two characters of the original data + + + function byteLength(b64) { + var lens = getLens(b64); + var validLen = lens[0]; + var placeHoldersLen = lens[1]; + return (validLen + placeHoldersLen) * 3 / 4 - placeHoldersLen; + } + + function _byteLength(b64, validLen, placeHoldersLen) { + return (validLen + placeHoldersLen) * 3 / 4 - placeHoldersLen; + } + + function toByteArray(b64) { + var tmp; + var lens = getLens(b64); + var validLen = lens[0]; + var placeHoldersLen = lens[1]; + var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen)); + var curByte = 0; // if there are placeholders, only get up to the last complete 4 chars + + var len = placeHoldersLen > 0 ? validLen - 4 : validLen; + var i; + + for (i = 0; i < len; i += 4) { + tmp = revLookup[b64.charCodeAt(i)] << 18 | revLookup[b64.charCodeAt(i + 1)] << 12 | revLookup[b64.charCodeAt(i + 2)] << 6 | revLookup[b64.charCodeAt(i + 3)]; + arr[curByte++] = tmp >> 16 & 0xFF; + arr[curByte++] = tmp >> 8 & 0xFF; + arr[curByte++] = tmp & 0xFF; + } + + if (placeHoldersLen === 2) { + tmp = revLookup[b64.charCodeAt(i)] << 2 | revLookup[b64.charCodeAt(i + 1)] >> 4; + arr[curByte++] = tmp & 0xFF; + } + + if (placeHoldersLen === 1) { + tmp = revLookup[b64.charCodeAt(i)] << 10 | revLookup[b64.charCodeAt(i + 1)] << 4 | revLookup[b64.charCodeAt(i + 2)] >> 2; + arr[curByte++] = tmp >> 8 & 0xFF; + arr[curByte++] = tmp & 0xFF; + } + + return arr; + } + + function tripletToBase64(num) { + return lookup[num >> 18 & 0x3F] + lookup[num >> 12 & 0x3F] + lookup[num >> 6 & 0x3F] + lookup[num & 0x3F]; + } + + function encodeChunk(uint8, start, end) { + var tmp; + var output = []; + + for (var i = start; i < end; i += 3) { + tmp = (uint8[i] << 16 & 0xFF0000) + (uint8[i + 1] << 8 & 0xFF00) + (uint8[i + 2] & 0xFF); + output.push(tripletToBase64(tmp)); + } + + return output.join(''); + } + + function fromByteArray(uint8) { + var tmp; + var len = uint8.length; + var extraBytes = len % 3; // if we have 1 byte left, pad 2 bytes + + var parts = []; + var maxChunkLength = 16383; // must be multiple of 3 + // go through the array every three bytes, we'll deal with trailing stuff later + + for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) { + parts.push(encodeChunk(uint8, i, i + maxChunkLength > len2 ? len2 : i + maxChunkLength)); + } // pad the end with zeros, but make sure to not forget the extra bytes + + + if (extraBytes === 1) { + tmp = uint8[len - 1]; + parts.push(lookup[tmp >> 2] + lookup[tmp << 4 & 0x3F] + '=='); + } else if (extraBytes === 2) { + tmp = (uint8[len - 2] << 8) + uint8[len - 1]; + parts.push(lookup[tmp >> 10] + lookup[tmp >> 4 & 0x3F] + lookup[tmp << 2 & 0x3F] + '='); + } + + return parts.join(''); + } + + var base64Js = { + byteLength: byteLength_1, + toByteArray: toByteArray_1, + fromByteArray: fromByteArray_1 + }; + + /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */ + var read = function read(buffer, offset, isLE, mLen, nBytes) { + var e, m; + var eLen = nBytes * 8 - mLen - 1; + var eMax = (1 << eLen) - 1; + var eBias = eMax >> 1; + var nBits = -7; + var i = isLE ? nBytes - 1 : 0; + var d = isLE ? -1 : 1; + var s = buffer[offset + i]; + i += d; + e = s & (1 << -nBits) - 1; + s >>= -nBits; + nBits += eLen; + + for (; nBits > 0; e = e * 256 + buffer[offset + i], i += d, nBits -= 8) {} + + m = e & (1 << -nBits) - 1; + e >>= -nBits; + nBits += mLen; + + for (; nBits > 0; m = m * 256 + buffer[offset + i], i += d, nBits -= 8) {} + + if (e === 0) { + e = 1 - eBias; + } else if (e === eMax) { + return m ? NaN : (s ? -1 : 1) * Infinity; + } else { + m = m + Math.pow(2, mLen); + e = e - eBias; + } + + return (s ? -1 : 1) * m * Math.pow(2, e - mLen); + }; + + var write = function write(buffer, value, offset, isLE, mLen, nBytes) { + var e, m, c; + var eLen = nBytes * 8 - mLen - 1; + var eMax = (1 << eLen) - 1; + var eBias = eMax >> 1; + var rt = mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0; + var i = isLE ? 0 : nBytes - 1; + var d = isLE ? 1 : -1; + var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0; + value = Math.abs(value); + + if (isNaN(value) || value === Infinity) { + m = isNaN(value) ? 1 : 0; + e = eMax; + } else { + e = Math.floor(Math.log(value) / Math.LN2); + + if (value * (c = Math.pow(2, -e)) < 1) { + e--; + c *= 2; + } + + if (e + eBias >= 1) { + value += rt / c; + } else { + value += rt * Math.pow(2, 1 - eBias); + } + + if (value * c >= 2) { + e++; + c /= 2; + } + + if (e + eBias >= eMax) { + m = 0; + e = eMax; + } else if (e + eBias >= 1) { + m = (value * c - 1) * Math.pow(2, mLen); + e = e + eBias; + } else { + m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen); + e = 0; + } + } + + for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {} + + e = e << mLen | m; + eLen += mLen; + + for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {} + + buffer[offset + i - d] |= s * 128; + }; + + var ieee754 = { + read: read, + write: write + }; + + var buffer$1 = createCommonjsModule(function (module, exports) { + + var customInspectSymbol = typeof Symbol === 'function' && typeof Symbol['for'] === 'function' ? // eslint-disable-line dot-notation + Symbol['for']('nodejs.util.inspect.custom') // eslint-disable-line dot-notation + : null; + exports.Buffer = Buffer; + exports.SlowBuffer = SlowBuffer; + exports.INSPECT_MAX_BYTES = 50; + var K_MAX_LENGTH = 0x7fffffff; + exports.kMaxLength = K_MAX_LENGTH; + /** + * If `Buffer.TYPED_ARRAY_SUPPORT`: + * === true Use Uint8Array implementation (fastest) + * === false Print warning and recommend using `buffer` v4.x which has an Object + * implementation (most compatible, even IE6) + * + * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+, + * Opera 11.6+, iOS 4.2+. + * + * We report that the browser does not support typed arrays if the are not subclassable + * using __proto__. Firefox 4-29 lacks support for adding new properties to `Uint8Array` + * (See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438). IE 10 lacks support + * for __proto__ and has a buggy typed array implementation. + */ + + Buffer.TYPED_ARRAY_SUPPORT = typedArraySupport(); + + if (!Buffer.TYPED_ARRAY_SUPPORT && typeof console !== 'undefined' && typeof console.error === 'function') { + console.error('This browser lacks typed array (Uint8Array) support which is required by ' + '`buffer` v5.x. Use `buffer` v4.x if you require old browser support.'); + } + + function typedArraySupport() { + // Can typed array instances can be augmented? + try { + var arr = new Uint8Array(1); + var proto = { + foo: function foo() { + return 42; + } + }; + Object.setPrototypeOf(proto, Uint8Array.prototype); + Object.setPrototypeOf(arr, proto); + return arr.foo() === 42; + } catch (e) { + return false; + } + } + + Object.defineProperty(Buffer.prototype, 'parent', { + enumerable: true, + get: function get() { + if (!Buffer.isBuffer(this)) return undefined; + return this.buffer; + } + }); + Object.defineProperty(Buffer.prototype, 'offset', { + enumerable: true, + get: function get() { + if (!Buffer.isBuffer(this)) return undefined; + return this.byteOffset; + } + }); + + function createBuffer(length) { + if (length > K_MAX_LENGTH) { + throw new RangeError('The value "' + length + '" is invalid for option "size"'); + } // Return an augmented `Uint8Array` instance + + + var buf = new Uint8Array(length); + Object.setPrototypeOf(buf, Buffer.prototype); + return buf; + } + /** + * The Buffer constructor returns instances of `Uint8Array` that have their + * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of + * `Uint8Array`, so the returned instances will have all the node `Buffer` methods + * and the `Uint8Array` methods. Square bracket notation works as expected -- it + * returns a single octet. + * + * The `Uint8Array` prototype remains unmodified. + */ + + + function Buffer(arg, encodingOrOffset, length) { + // Common case. + if (typeof arg === 'number') { + if (typeof encodingOrOffset === 'string') { + throw new TypeError('The "string" argument must be of type string. Received type number'); + } + + return allocUnsafe(arg); + } + + return from(arg, encodingOrOffset, length); + } + + Buffer.poolSize = 8192; // not used by this implementation + + function from(value, encodingOrOffset, length) { + if (typeof value === 'string') { + return fromString(value, encodingOrOffset); + } + + if (ArrayBuffer.isView(value)) { + return fromArrayView(value); + } + + if (value == null) { + throw new TypeError('The first argument must be one of type string, Buffer, ArrayBuffer, Array, ' + 'or Array-like Object. Received type ' + babelHelpers["typeof"](value)); + } + + if (isInstance(value, ArrayBuffer) || value && isInstance(value.buffer, ArrayBuffer)) { + return fromArrayBuffer(value, encodingOrOffset, length); + } + + if (typeof SharedArrayBuffer !== 'undefined' && (isInstance(value, SharedArrayBuffer) || value && isInstance(value.buffer, SharedArrayBuffer))) { + return fromArrayBuffer(value, encodingOrOffset, length); + } + + if (typeof value === 'number') { + throw new TypeError('The "value" argument must not be of type number. Received type number'); + } + + var valueOf = value.valueOf && value.valueOf(); + + if (valueOf != null && valueOf !== value) { + return Buffer.from(valueOf, encodingOrOffset, length); + } + + var b = fromObject(value); + if (b) return b; + + if (typeof Symbol !== 'undefined' && Symbol.toPrimitive != null && typeof value[Symbol.toPrimitive] === 'function') { + return Buffer.from(value[Symbol.toPrimitive]('string'), encodingOrOffset, length); + } + + throw new TypeError('The first argument must be one of type string, Buffer, ArrayBuffer, Array, ' + 'or Array-like Object. Received type ' + babelHelpers["typeof"](value)); + } + /** + * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError + * if value is a number. + * Buffer.from(str[, encoding]) + * Buffer.from(array) + * Buffer.from(buffer) + * Buffer.from(arrayBuffer[, byteOffset[, length]]) + **/ + + + Buffer.from = function (value, encodingOrOffset, length) { + return from(value, encodingOrOffset, length); + }; // Note: Change prototype *after* Buffer.from is defined to workaround Chrome bug: + // https://github.com/feross/buffer/pull/148 + + + Object.setPrototypeOf(Buffer.prototype, Uint8Array.prototype); + Object.setPrototypeOf(Buffer, Uint8Array); + + function assertSize(size) { + if (typeof size !== 'number') { + throw new TypeError('"size" argument must be of type number'); + } else if (size < 0) { + throw new RangeError('The value "' + size + '" is invalid for option "size"'); + } + } + + function alloc(size, fill, encoding) { + assertSize(size); + + if (size <= 0) { + return createBuffer(size); + } + + if (fill !== undefined) { + // Only pay attention to encoding if it's a string. This + // prevents accidentally sending in a number that would + // be interpreted as a start offset. + return typeof encoding === 'string' ? createBuffer(size).fill(fill, encoding) : createBuffer(size).fill(fill); + } + + return createBuffer(size); + } + /** + * Creates a new filled Buffer instance. + * alloc(size[, fill[, encoding]]) + **/ + + + Buffer.alloc = function (size, fill, encoding) { + return alloc(size, fill, encoding); + }; + + function allocUnsafe(size) { + assertSize(size); + return createBuffer(size < 0 ? 0 : checked(size) | 0); + } + /** + * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance. + * */ + + + Buffer.allocUnsafe = function (size) { + return allocUnsafe(size); + }; + /** + * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. + */ + + + Buffer.allocUnsafeSlow = function (size) { + return allocUnsafe(size); + }; + + function fromString(string, encoding) { + if (typeof encoding !== 'string' || encoding === '') { + encoding = 'utf8'; + } + + if (!Buffer.isEncoding(encoding)) { + throw new TypeError('Unknown encoding: ' + encoding); + } + + var length = byteLength(string, encoding) | 0; + var buf = createBuffer(length); + var actual = buf.write(string, encoding); + + if (actual !== length) { + // Writing a hex string, for example, that contains invalid characters will + // cause everything after the first invalid character to be ignored. (e.g. + // 'abxxcd' will be treated as 'ab') + buf = buf.slice(0, actual); + } + + return buf; + } + + function fromArrayLike(array) { + var length = array.length < 0 ? 0 : checked(array.length) | 0; + var buf = createBuffer(length); + + for (var i = 0; i < length; i += 1) { + buf[i] = array[i] & 255; + } + + return buf; + } + + function fromArrayView(arrayView) { + if (isInstance(arrayView, Uint8Array)) { + var copy = new Uint8Array(arrayView); + return fromArrayBuffer(copy.buffer, copy.byteOffset, copy.byteLength); + } + + return fromArrayLike(arrayView); + } + + function fromArrayBuffer(array, byteOffset, length) { + if (byteOffset < 0 || array.byteLength < byteOffset) { + throw new RangeError('"offset" is outside of buffer bounds'); + } + + if (array.byteLength < byteOffset + (length || 0)) { + throw new RangeError('"length" is outside of buffer bounds'); + } + + var buf; + + if (byteOffset === undefined && length === undefined) { + buf = new Uint8Array(array); + } else if (length === undefined) { + buf = new Uint8Array(array, byteOffset); + } else { + buf = new Uint8Array(array, byteOffset, length); + } // Return an augmented `Uint8Array` instance + + + Object.setPrototypeOf(buf, Buffer.prototype); + return buf; + } + + function fromObject(obj) { + if (Buffer.isBuffer(obj)) { + var len = checked(obj.length) | 0; + var buf = createBuffer(len); + + if (buf.length === 0) { + return buf; + } + + obj.copy(buf, 0, 0, len); + return buf; + } + + if (obj.length !== undefined) { + if (typeof obj.length !== 'number' || numberIsNaN(obj.length)) { + return createBuffer(0); + } + + return fromArrayLike(obj); + } + + if (obj.type === 'Buffer' && Array.isArray(obj.data)) { + return fromArrayLike(obj.data); + } + } + + function checked(length) { + // Note: cannot use `length < K_MAX_LENGTH` here because that fails when + // length is NaN (which is otherwise coerced to zero.) + if (length >= K_MAX_LENGTH) { + throw new RangeError('Attempt to allocate Buffer larger than maximum ' + 'size: 0x' + K_MAX_LENGTH.toString(16) + ' bytes'); + } + + return length | 0; + } + + function SlowBuffer(length) { + if (+length != length) { + // eslint-disable-line eqeqeq + length = 0; + } + + return Buffer.alloc(+length); + } + + Buffer.isBuffer = function isBuffer(b) { + return b != null && b._isBuffer === true && b !== Buffer.prototype; // so Buffer.isBuffer(Buffer.prototype) will be false + }; + + Buffer.compare = function compare(a, b) { + if (isInstance(a, Uint8Array)) a = Buffer.from(a, a.offset, a.byteLength); + if (isInstance(b, Uint8Array)) b = Buffer.from(b, b.offset, b.byteLength); + + if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) { + throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array'); + } + + if (a === b) return 0; + var x = a.length; + var y = b.length; + + for (var i = 0, len = Math.min(x, y); i < len; ++i) { + if (a[i] !== b[i]) { + x = a[i]; + y = b[i]; + break; + } + } + + if (x < y) return -1; + if (y < x) return 1; + return 0; + }; + + Buffer.isEncoding = function isEncoding(encoding) { + switch (String(encoding).toLowerCase()) { + case 'hex': + case 'utf8': + case 'utf-8': + case 'ascii': + case 'latin1': + case 'binary': + case 'base64': + case 'ucs2': + case 'ucs-2': + case 'utf16le': + case 'utf-16le': + return true; + + default: + return false; + } + }; + + Buffer.concat = function concat(list, length) { + if (!Array.isArray(list)) { + throw new TypeError('"list" argument must be an Array of Buffers'); + } + + if (list.length === 0) { + return Buffer.alloc(0); + } + + var i; + + if (length === undefined) { + length = 0; + + for (i = 0; i < list.length; ++i) { + length += list[i].length; + } + } + + var buffer = Buffer.allocUnsafe(length); + var pos = 0; + + for (i = 0; i < list.length; ++i) { + var buf = list[i]; + + if (isInstance(buf, Uint8Array)) { + if (pos + buf.length > buffer.length) { + Buffer.from(buf).copy(buffer, pos); + } else { + Uint8Array.prototype.set.call(buffer, buf, pos); + } + } else if (!Buffer.isBuffer(buf)) { + throw new TypeError('"list" argument must be an Array of Buffers'); + } else { + buf.copy(buffer, pos); + } + + pos += buf.length; + } + + return buffer; + }; + + function byteLength(string, encoding) { + if (Buffer.isBuffer(string)) { + return string.length; + } + + if (ArrayBuffer.isView(string) || isInstance(string, ArrayBuffer)) { + return string.byteLength; + } + + if (typeof string !== 'string') { + throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. ' + 'Received type ' + babelHelpers["typeof"](string)); + } + + var len = string.length; + var mustMatch = arguments.length > 2 && arguments[2] === true; + if (!mustMatch && len === 0) return 0; // Use a for loop to avoid recursion + + var loweredCase = false; + + for (;;) { + switch (encoding) { + case 'ascii': + case 'latin1': + case 'binary': + return len; + + case 'utf8': + case 'utf-8': + return utf8ToBytes(string).length; + + case 'ucs2': + case 'ucs-2': + case 'utf16le': + case 'utf-16le': + return len * 2; + + case 'hex': + return len >>> 1; + + case 'base64': + return base64ToBytes(string).length; + + default: + if (loweredCase) { + return mustMatch ? -1 : utf8ToBytes(string).length; // assume utf8 + } + + encoding = ('' + encoding).toLowerCase(); + loweredCase = true; + } + } + } + + Buffer.byteLength = byteLength; + + function slowToString(encoding, start, end) { + var loweredCase = false; // No need to verify that "this.length <= MAX_UINT32" since it's a read-only + // property of a typed array. + // This behaves neither like String nor Uint8Array in that we set start/end + // to their upper/lower bounds if the value passed is out of range. + // undefined is handled specially as per ECMA-262 6th Edition, + // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization. + + if (start === undefined || start < 0) { + start = 0; + } // Return early if start > this.length. Done here to prevent potential uint32 + // coercion fail below. + + + if (start > this.length) { + return ''; + } + + if (end === undefined || end > this.length) { + end = this.length; + } + + if (end <= 0) { + return ''; + } // Force coercion to uint32. This will also coerce falsey/NaN values to 0. + + + end >>>= 0; + start >>>= 0; + + if (end <= start) { + return ''; + } + + if (!encoding) encoding = 'utf8'; + + while (true) { + switch (encoding) { + case 'hex': + return hexSlice(this, start, end); + + case 'utf8': + case 'utf-8': + return utf8Slice(this, start, end); + + case 'ascii': + return asciiSlice(this, start, end); + + case 'latin1': + case 'binary': + return latin1Slice(this, start, end); + + case 'base64': + return base64Slice(this, start, end); + + case 'ucs2': + case 'ucs-2': + case 'utf16le': + case 'utf-16le': + return utf16leSlice(this, start, end); + + default: + if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding); + encoding = (encoding + '').toLowerCase(); + loweredCase = true; + } + } + } // This property is used by `Buffer.isBuffer` (and the `is-buffer` npm package) + // to detect a Buffer instance. It's not possible to use `instanceof Buffer` + // reliably in a browserify context because there could be multiple different + // copies of the 'buffer' package in use. This method works even for Buffer + // instances that were created from another copy of the `buffer` package. + // See: https://github.com/feross/buffer/issues/154 + + + Buffer.prototype._isBuffer = true; + + function swap(b, n, m) { + var i = b[n]; + b[n] = b[m]; + b[m] = i; + } + + Buffer.prototype.swap16 = function swap16() { + var len = this.length; + + if (len % 2 !== 0) { + throw new RangeError('Buffer size must be a multiple of 16-bits'); + } + + for (var i = 0; i < len; i += 2) { + swap(this, i, i + 1); + } + + return this; + }; + + Buffer.prototype.swap32 = function swap32() { + var len = this.length; + + if (len % 4 !== 0) { + throw new RangeError('Buffer size must be a multiple of 32-bits'); + } + + for (var i = 0; i < len; i += 4) { + swap(this, i, i + 3); + swap(this, i + 1, i + 2); + } + + return this; + }; + + Buffer.prototype.swap64 = function swap64() { + var len = this.length; + + if (len % 8 !== 0) { + throw new RangeError('Buffer size must be a multiple of 64-bits'); + } + + for (var i = 0; i < len; i += 8) { + swap(this, i, i + 7); + swap(this, i + 1, i + 6); + swap(this, i + 2, i + 5); + swap(this, i + 3, i + 4); + } + + return this; + }; + + Buffer.prototype.toString = function toString() { + var length = this.length; + if (length === 0) return ''; + if (arguments.length === 0) return utf8Slice(this, 0, length); + return slowToString.apply(this, arguments); + }; + + Buffer.prototype.toLocaleString = Buffer.prototype.toString; + + Buffer.prototype.equals = function equals(b) { + if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer'); + if (this === b) return true; + return Buffer.compare(this, b) === 0; + }; + + Buffer.prototype.inspect = function inspect() { + var str = ''; + var max = exports.INSPECT_MAX_BYTES; + str = this.toString('hex', 0, max).replace(/(.{2})/g, '$1 ').trim(); + if (this.length > max) str += ' ... '; + return ''; + }; + + if (customInspectSymbol) { + Buffer.prototype[customInspectSymbol] = Buffer.prototype.inspect; + } + + Buffer.prototype.compare = function compare(target, start, end, thisStart, thisEnd) { + if (isInstance(target, Uint8Array)) { + target = Buffer.from(target, target.offset, target.byteLength); + } + + if (!Buffer.isBuffer(target)) { + throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. ' + 'Received type ' + babelHelpers["typeof"](target)); + } + + if (start === undefined) { + start = 0; + } + + if (end === undefined) { + end = target ? target.length : 0; + } + + if (thisStart === undefined) { + thisStart = 0; + } + + if (thisEnd === undefined) { + thisEnd = this.length; + } + + if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) { + throw new RangeError('out of range index'); + } + + if (thisStart >= thisEnd && start >= end) { + return 0; + } + + if (thisStart >= thisEnd) { + return -1; + } + + if (start >= end) { + return 1; + } + + start >>>= 0; + end >>>= 0; + thisStart >>>= 0; + thisEnd >>>= 0; + if (this === target) return 0; + var x = thisEnd - thisStart; + var y = end - start; + var len = Math.min(x, y); + var thisCopy = this.slice(thisStart, thisEnd); + var targetCopy = target.slice(start, end); + + for (var i = 0; i < len; ++i) { + if (thisCopy[i] !== targetCopy[i]) { + x = thisCopy[i]; + y = targetCopy[i]; + break; + } + } + + if (x < y) return -1; + if (y < x) return 1; + return 0; + }; // Finds either the first index of `val` in `buffer` at offset >= `byteOffset`, + // OR the last index of `val` in `buffer` at offset <= `byteOffset`. + // + // Arguments: + // - buffer - a Buffer to search + // - val - a string, Buffer, or number + // - byteOffset - an index into `buffer`; will be clamped to an int32 + // - encoding - an optional encoding, relevant is val is a string + // - dir - true for indexOf, false for lastIndexOf + + + function bidirectionalIndexOf(buffer, val, byteOffset, encoding, dir) { + // Empty buffer means no match + if (buffer.length === 0) return -1; // Normalize byteOffset + + if (typeof byteOffset === 'string') { + encoding = byteOffset; + byteOffset = 0; + } else if (byteOffset > 0x7fffffff) { + byteOffset = 0x7fffffff; + } else if (byteOffset < -0x80000000) { + byteOffset = -0x80000000; + } + + byteOffset = +byteOffset; // Coerce to Number. + + if (numberIsNaN(byteOffset)) { + // byteOffset: it it's undefined, null, NaN, "foo", etc, search whole buffer + byteOffset = dir ? 0 : buffer.length - 1; + } // Normalize byteOffset: negative offsets start from the end of the buffer + + + if (byteOffset < 0) byteOffset = buffer.length + byteOffset; + + if (byteOffset >= buffer.length) { + if (dir) return -1;else byteOffset = buffer.length - 1; + } else if (byteOffset < 0) { + if (dir) byteOffset = 0;else return -1; + } // Normalize val + + + if (typeof val === 'string') { + val = Buffer.from(val, encoding); + } // Finally, search either indexOf (if dir is true) or lastIndexOf + + + if (Buffer.isBuffer(val)) { + // Special case: looking for empty string/buffer always fails + if (val.length === 0) { + return -1; + } + + return arrayIndexOf(buffer, val, byteOffset, encoding, dir); + } else if (typeof val === 'number') { + val = val & 0xFF; // Search for a byte value [0-255] + + if (typeof Uint8Array.prototype.indexOf === 'function') { + if (dir) { + return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset); + } else { + return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset); + } + } + + return arrayIndexOf(buffer, [val], byteOffset, encoding, dir); + } + + throw new TypeError('val must be string, number or Buffer'); + } + + function arrayIndexOf(arr, val, byteOffset, encoding, dir) { + var indexSize = 1; + var arrLength = arr.length; + var valLength = val.length; + + if (encoding !== undefined) { + encoding = String(encoding).toLowerCase(); + + if (encoding === 'ucs2' || encoding === 'ucs-2' || encoding === 'utf16le' || encoding === 'utf-16le') { + if (arr.length < 2 || val.length < 2) { + return -1; + } + + indexSize = 2; + arrLength /= 2; + valLength /= 2; + byteOffset /= 2; + } + } + + function read(buf, i) { + if (indexSize === 1) { + return buf[i]; + } else { + return buf.readUInt16BE(i * indexSize); + } + } + + var i; + + if (dir) { + var foundIndex = -1; + + for (i = byteOffset; i < arrLength; i++) { + if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) { + if (foundIndex === -1) foundIndex = i; + if (i - foundIndex + 1 === valLength) return foundIndex * indexSize; + } else { + if (foundIndex !== -1) i -= i - foundIndex; + foundIndex = -1; + } + } + } else { + if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength; + + for (i = byteOffset; i >= 0; i--) { + var found = true; + + for (var j = 0; j < valLength; j++) { + if (read(arr, i + j) !== read(val, j)) { + found = false; + break; + } + } + + if (found) return i; + } + } + + return -1; + } + + Buffer.prototype.includes = function includes(val, byteOffset, encoding) { + return this.indexOf(val, byteOffset, encoding) !== -1; + }; + + Buffer.prototype.indexOf = function indexOf(val, byteOffset, encoding) { + return bidirectionalIndexOf(this, val, byteOffset, encoding, true); + }; + + Buffer.prototype.lastIndexOf = function lastIndexOf(val, byteOffset, encoding) { + return bidirectionalIndexOf(this, val, byteOffset, encoding, false); + }; + + function hexWrite(buf, string, offset, length) { + offset = Number(offset) || 0; + var remaining = buf.length - offset; + + if (!length) { + length = remaining; + } else { + length = Number(length); + + if (length > remaining) { + length = remaining; + } + } + + var strLen = string.length; + + if (length > strLen / 2) { + length = strLen / 2; + } + + for (var i = 0; i < length; ++i) { + var parsed = parseInt(string.substr(i * 2, 2), 16); + if (numberIsNaN(parsed)) return i; + buf[offset + i] = parsed; + } + + return i; + } + + function utf8Write(buf, string, offset, length) { + return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length); + } + + function asciiWrite(buf, string, offset, length) { + return blitBuffer(asciiToBytes(string), buf, offset, length); + } + + function base64Write(buf, string, offset, length) { + return blitBuffer(base64ToBytes(string), buf, offset, length); + } + + function ucs2Write(buf, string, offset, length) { + return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length); + } + + Buffer.prototype.write = function write(string, offset, length, encoding) { + // Buffer#write(string) + if (offset === undefined) { + encoding = 'utf8'; + length = this.length; + offset = 0; // Buffer#write(string, encoding) + } else if (length === undefined && typeof offset === 'string') { + encoding = offset; + length = this.length; + offset = 0; // Buffer#write(string, offset[, length][, encoding]) + } else if (isFinite(offset)) { + offset = offset >>> 0; + + if (isFinite(length)) { + length = length >>> 0; + if (encoding === undefined) encoding = 'utf8'; + } else { + encoding = length; + length = undefined; + } + } else { + throw new Error('Buffer.write(string, encoding, offset[, length]) is no longer supported'); + } + + var remaining = this.length - offset; + if (length === undefined || length > remaining) length = remaining; + + if (string.length > 0 && (length < 0 || offset < 0) || offset > this.length) { + throw new RangeError('Attempt to write outside buffer bounds'); + } + + if (!encoding) encoding = 'utf8'; + var loweredCase = false; + + for (;;) { + switch (encoding) { + case 'hex': + return hexWrite(this, string, offset, length); + + case 'utf8': + case 'utf-8': + return utf8Write(this, string, offset, length); + + case 'ascii': + case 'latin1': + case 'binary': + return asciiWrite(this, string, offset, length); + + case 'base64': + // Warning: maxLength not taken into account in base64Write + return base64Write(this, string, offset, length); + + case 'ucs2': + case 'ucs-2': + case 'utf16le': + case 'utf-16le': + return ucs2Write(this, string, offset, length); + + default: + if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding); + encoding = ('' + encoding).toLowerCase(); + loweredCase = true; + } + } + }; + + Buffer.prototype.toJSON = function toJSON() { + return { + type: 'Buffer', + data: Array.prototype.slice.call(this._arr || this, 0) + }; + }; + + function base64Slice(buf, start, end) { + if (start === 0 && end === buf.length) { + return base64Js.fromByteArray(buf); + } else { + return base64Js.fromByteArray(buf.slice(start, end)); + } + } + + function utf8Slice(buf, start, end) { + end = Math.min(buf.length, end); + var res = []; + var i = start; + + while (i < end) { + var firstByte = buf[i]; + var codePoint = null; + var bytesPerSequence = firstByte > 0xEF ? 4 : firstByte > 0xDF ? 3 : firstByte > 0xBF ? 2 : 1; + + if (i + bytesPerSequence <= end) { + var secondByte, thirdByte, fourthByte, tempCodePoint; + + switch (bytesPerSequence) { + case 1: + if (firstByte < 0x80) { + codePoint = firstByte; + } + + break; + + case 2: + secondByte = buf[i + 1]; + + if ((secondByte & 0xC0) === 0x80) { + tempCodePoint = (firstByte & 0x1F) << 0x6 | secondByte & 0x3F; + + if (tempCodePoint > 0x7F) { + codePoint = tempCodePoint; + } + } + + break; + + case 3: + secondByte = buf[i + 1]; + thirdByte = buf[i + 2]; + + if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) { + tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | thirdByte & 0x3F; + + if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) { + codePoint = tempCodePoint; + } + } + + break; + + case 4: + secondByte = buf[i + 1]; + thirdByte = buf[i + 2]; + fourthByte = buf[i + 3]; + + if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) { + tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | fourthByte & 0x3F; + + if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) { + codePoint = tempCodePoint; + } + } + + } + } + + if (codePoint === null) { + // we did not generate a valid codePoint so insert a + // replacement char (U+FFFD) and advance only 1 byte + codePoint = 0xFFFD; + bytesPerSequence = 1; + } else if (codePoint > 0xFFFF) { + // encode to utf16 (surrogate pair dance) + codePoint -= 0x10000; + res.push(codePoint >>> 10 & 0x3FF | 0xD800); + codePoint = 0xDC00 | codePoint & 0x3FF; + } + + res.push(codePoint); + i += bytesPerSequence; + } + + return decodeCodePointsArray(res); + } // Based on http://stackoverflow.com/a/22747272/680742, the browser with + // the lowest limit is Chrome, with 0x10000 args. + // We go 1 magnitude less, for safety + + + var MAX_ARGUMENTS_LENGTH = 0x1000; + + function decodeCodePointsArray(codePoints) { + var len = codePoints.length; + + if (len <= MAX_ARGUMENTS_LENGTH) { + return String.fromCharCode.apply(String, codePoints); // avoid extra slice() + } // Decode in chunks to avoid "call stack size exceeded". + + + var res = ''; + var i = 0; + + while (i < len) { + res += String.fromCharCode.apply(String, codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)); + } + + return res; + } + + function asciiSlice(buf, start, end) { + var ret = ''; + end = Math.min(buf.length, end); + + for (var i = start; i < end; ++i) { + ret += String.fromCharCode(buf[i] & 0x7F); + } + + return ret; + } + + function latin1Slice(buf, start, end) { + var ret = ''; + end = Math.min(buf.length, end); + + for (var i = start; i < end; ++i) { + ret += String.fromCharCode(buf[i]); + } + + return ret; + } + + function hexSlice(buf, start, end) { + var len = buf.length; + if (!start || start < 0) start = 0; + if (!end || end < 0 || end > len) end = len; + var out = ''; + + for (var i = start; i < end; ++i) { + out += hexSliceLookupTable[buf[i]]; + } + + return out; + } + + function utf16leSlice(buf, start, end) { + var bytes = buf.slice(start, end); + var res = ''; // If bytes.length is odd, the last 8 bits must be ignored (same as node.js) + + for (var i = 0; i < bytes.length - 1; i += 2) { + res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256); + } + + return res; + } + + Buffer.prototype.slice = function slice(start, end) { + var len = this.length; + start = ~~start; + end = end === undefined ? len : ~~end; + + if (start < 0) { + start += len; + if (start < 0) start = 0; + } else if (start > len) { + start = len; + } + + if (end < 0) { + end += len; + if (end < 0) end = 0; + } else if (end > len) { + end = len; + } + + if (end < start) end = start; + var newBuf = this.subarray(start, end); // Return an augmented `Uint8Array` instance + + Object.setPrototypeOf(newBuf, Buffer.prototype); + return newBuf; + }; + /* + * Need to make sure that buffer isn't trying to write out of bounds. + */ + + + function checkOffset(offset, ext, length) { + if (offset % 1 !== 0 || offset < 0) throw new RangeError('offset is not uint'); + if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length'); + } + + Buffer.prototype.readUintLE = Buffer.prototype.readUIntLE = function readUIntLE(offset, byteLength, noAssert) { + offset = offset >>> 0; + byteLength = byteLength >>> 0; + if (!noAssert) checkOffset(offset, byteLength, this.length); + var val = this[offset]; + var mul = 1; + var i = 0; + + while (++i < byteLength && (mul *= 0x100)) { + val += this[offset + i] * mul; + } + + return val; + }; + + Buffer.prototype.readUintBE = Buffer.prototype.readUIntBE = function readUIntBE(offset, byteLength, noAssert) { + offset = offset >>> 0; + byteLength = byteLength >>> 0; + + if (!noAssert) { + checkOffset(offset, byteLength, this.length); + } + + var val = this[offset + --byteLength]; + var mul = 1; + + while (byteLength > 0 && (mul *= 0x100)) { + val += this[offset + --byteLength] * mul; + } + + return val; + }; + + Buffer.prototype.readUint8 = Buffer.prototype.readUInt8 = function readUInt8(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 1, this.length); + return this[offset]; + }; + + Buffer.prototype.readUint16LE = Buffer.prototype.readUInt16LE = function readUInt16LE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 2, this.length); + return this[offset] | this[offset + 1] << 8; + }; + + Buffer.prototype.readUint16BE = Buffer.prototype.readUInt16BE = function readUInt16BE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 2, this.length); + return this[offset] << 8 | this[offset + 1]; + }; + + Buffer.prototype.readUint32LE = Buffer.prototype.readUInt32LE = function readUInt32LE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 4, this.length); + return (this[offset] | this[offset + 1] << 8 | this[offset + 2] << 16) + this[offset + 3] * 0x1000000; + }; + + Buffer.prototype.readUint32BE = Buffer.prototype.readUInt32BE = function readUInt32BE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 4, this.length); + return this[offset] * 0x1000000 + (this[offset + 1] << 16 | this[offset + 2] << 8 | this[offset + 3]); + }; + + Buffer.prototype.readIntLE = function readIntLE(offset, byteLength, noAssert) { + offset = offset >>> 0; + byteLength = byteLength >>> 0; + if (!noAssert) checkOffset(offset, byteLength, this.length); + var val = this[offset]; + var mul = 1; + var i = 0; + + while (++i < byteLength && (mul *= 0x100)) { + val += this[offset + i] * mul; + } + + mul *= 0x80; + if (val >= mul) val -= Math.pow(2, 8 * byteLength); + return val; + }; + + Buffer.prototype.readIntBE = function readIntBE(offset, byteLength, noAssert) { + offset = offset >>> 0; + byteLength = byteLength >>> 0; + if (!noAssert) checkOffset(offset, byteLength, this.length); + var i = byteLength; + var mul = 1; + var val = this[offset + --i]; + + while (i > 0 && (mul *= 0x100)) { + val += this[offset + --i] * mul; + } + + mul *= 0x80; + if (val >= mul) val -= Math.pow(2, 8 * byteLength); + return val; + }; + + Buffer.prototype.readInt8 = function readInt8(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 1, this.length); + if (!(this[offset] & 0x80)) return this[offset]; + return (0xff - this[offset] + 1) * -1; + }; + + Buffer.prototype.readInt16LE = function readInt16LE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 2, this.length); + var val = this[offset] | this[offset + 1] << 8; + return val & 0x8000 ? val | 0xFFFF0000 : val; + }; + + Buffer.prototype.readInt16BE = function readInt16BE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 2, this.length); + var val = this[offset + 1] | this[offset] << 8; + return val & 0x8000 ? val | 0xFFFF0000 : val; + }; + + Buffer.prototype.readInt32LE = function readInt32LE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 4, this.length); + return this[offset] | this[offset + 1] << 8 | this[offset + 2] << 16 | this[offset + 3] << 24; + }; + + Buffer.prototype.readInt32BE = function readInt32BE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 4, this.length); + return this[offset] << 24 | this[offset + 1] << 16 | this[offset + 2] << 8 | this[offset + 3]; + }; + + Buffer.prototype.readFloatLE = function readFloatLE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 4, this.length); + return ieee754.read(this, offset, true, 23, 4); + }; + + Buffer.prototype.readFloatBE = function readFloatBE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 4, this.length); + return ieee754.read(this, offset, false, 23, 4); + }; + + Buffer.prototype.readDoubleLE = function readDoubleLE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 8, this.length); + return ieee754.read(this, offset, true, 52, 8); + }; + + Buffer.prototype.readDoubleBE = function readDoubleBE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 8, this.length); + return ieee754.read(this, offset, false, 52, 8); + }; + + function checkInt(buf, value, offset, ext, max, min) { + if (!Buffer.isBuffer(buf)) throw new TypeError('"buffer" argument must be a Buffer instance'); + if (value > max || value < min) throw new RangeError('"value" argument is out of bounds'); + if (offset + ext > buf.length) throw new RangeError('Index out of range'); + } + + Buffer.prototype.writeUintLE = Buffer.prototype.writeUIntLE = function writeUIntLE(value, offset, byteLength, noAssert) { + value = +value; + offset = offset >>> 0; + byteLength = byteLength >>> 0; + + if (!noAssert) { + var maxBytes = Math.pow(2, 8 * byteLength) - 1; + checkInt(this, value, offset, byteLength, maxBytes, 0); + } + + var mul = 1; + var i = 0; + this[offset] = value & 0xFF; + + while (++i < byteLength && (mul *= 0x100)) { + this[offset + i] = value / mul & 0xFF; + } + + return offset + byteLength; + }; + + Buffer.prototype.writeUintBE = Buffer.prototype.writeUIntBE = function writeUIntBE(value, offset, byteLength, noAssert) { + value = +value; + offset = offset >>> 0; + byteLength = byteLength >>> 0; + + if (!noAssert) { + var maxBytes = Math.pow(2, 8 * byteLength) - 1; + checkInt(this, value, offset, byteLength, maxBytes, 0); + } + + var i = byteLength - 1; + var mul = 1; + this[offset + i] = value & 0xFF; + + while (--i >= 0 && (mul *= 0x100)) { + this[offset + i] = value / mul & 0xFF; + } + + return offset + byteLength; + }; + + Buffer.prototype.writeUint8 = Buffer.prototype.writeUInt8 = function writeUInt8(value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0); + this[offset] = value & 0xff; + return offset + 1; + }; + + Buffer.prototype.writeUint16LE = Buffer.prototype.writeUInt16LE = function writeUInt16LE(value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0); + this[offset] = value & 0xff; + this[offset + 1] = value >>> 8; + return offset + 2; + }; + + Buffer.prototype.writeUint16BE = Buffer.prototype.writeUInt16BE = function writeUInt16BE(value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0); + this[offset] = value >>> 8; + this[offset + 1] = value & 0xff; + return offset + 2; + }; + + Buffer.prototype.writeUint32LE = Buffer.prototype.writeUInt32LE = function writeUInt32LE(value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0); + this[offset + 3] = value >>> 24; + this[offset + 2] = value >>> 16; + this[offset + 1] = value >>> 8; + this[offset] = value & 0xff; + return offset + 4; + }; + + Buffer.prototype.writeUint32BE = Buffer.prototype.writeUInt32BE = function writeUInt32BE(value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0); + this[offset] = value >>> 24; + this[offset + 1] = value >>> 16; + this[offset + 2] = value >>> 8; + this[offset + 3] = value & 0xff; + return offset + 4; + }; + + Buffer.prototype.writeIntLE = function writeIntLE(value, offset, byteLength, noAssert) { + value = +value; + offset = offset >>> 0; + + if (!noAssert) { + var limit = Math.pow(2, 8 * byteLength - 1); + checkInt(this, value, offset, byteLength, limit - 1, -limit); + } + + var i = 0; + var mul = 1; + var sub = 0; + this[offset] = value & 0xFF; + + while (++i < byteLength && (mul *= 0x100)) { + if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) { + sub = 1; + } + + this[offset + i] = (value / mul >> 0) - sub & 0xFF; + } + + return offset + byteLength; + }; + + Buffer.prototype.writeIntBE = function writeIntBE(value, offset, byteLength, noAssert) { + value = +value; + offset = offset >>> 0; + + if (!noAssert) { + var limit = Math.pow(2, 8 * byteLength - 1); + checkInt(this, value, offset, byteLength, limit - 1, -limit); + } + + var i = byteLength - 1; + var mul = 1; + var sub = 0; + this[offset + i] = value & 0xFF; + + while (--i >= 0 && (mul *= 0x100)) { + if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) { + sub = 1; + } + + this[offset + i] = (value / mul >> 0) - sub & 0xFF; + } + + return offset + byteLength; + }; + + Buffer.prototype.writeInt8 = function writeInt8(value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80); + if (value < 0) value = 0xff + value + 1; + this[offset] = value & 0xff; + return offset + 1; + }; + + Buffer.prototype.writeInt16LE = function writeInt16LE(value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000); + this[offset] = value & 0xff; + this[offset + 1] = value >>> 8; + return offset + 2; + }; + + Buffer.prototype.writeInt16BE = function writeInt16BE(value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000); + this[offset] = value >>> 8; + this[offset + 1] = value & 0xff; + return offset + 2; + }; + + Buffer.prototype.writeInt32LE = function writeInt32LE(value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000); + this[offset] = value & 0xff; + this[offset + 1] = value >>> 8; + this[offset + 2] = value >>> 16; + this[offset + 3] = value >>> 24; + return offset + 4; + }; + + Buffer.prototype.writeInt32BE = function writeInt32BE(value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000); + if (value < 0) value = 0xffffffff + value + 1; + this[offset] = value >>> 24; + this[offset + 1] = value >>> 16; + this[offset + 2] = value >>> 8; + this[offset + 3] = value & 0xff; + return offset + 4; + }; + + function checkIEEE754(buf, value, offset, ext, max, min) { + if (offset + ext > buf.length) throw new RangeError('Index out of range'); + if (offset < 0) throw new RangeError('Index out of range'); + } + + function writeFloat(buf, value, offset, littleEndian, noAssert) { + value = +value; + offset = offset >>> 0; + + if (!noAssert) { + checkIEEE754(buf, value, offset, 4); + } + + ieee754.write(buf, value, offset, littleEndian, 23, 4); + return offset + 4; + } + + Buffer.prototype.writeFloatLE = function writeFloatLE(value, offset, noAssert) { + return writeFloat(this, value, offset, true, noAssert); + }; + + Buffer.prototype.writeFloatBE = function writeFloatBE(value, offset, noAssert) { + return writeFloat(this, value, offset, false, noAssert); + }; + + function writeDouble(buf, value, offset, littleEndian, noAssert) { + value = +value; + offset = offset >>> 0; + + if (!noAssert) { + checkIEEE754(buf, value, offset, 8); + } + + ieee754.write(buf, value, offset, littleEndian, 52, 8); + return offset + 8; + } + + Buffer.prototype.writeDoubleLE = function writeDoubleLE(value, offset, noAssert) { + return writeDouble(this, value, offset, true, noAssert); + }; + + Buffer.prototype.writeDoubleBE = function writeDoubleBE(value, offset, noAssert) { + return writeDouble(this, value, offset, false, noAssert); + }; // copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length) + + + Buffer.prototype.copy = function copy(target, targetStart, start, end) { + if (!Buffer.isBuffer(target)) throw new TypeError('argument should be a Buffer'); + if (!start) start = 0; + if (!end && end !== 0) end = this.length; + if (targetStart >= target.length) targetStart = target.length; + if (!targetStart) targetStart = 0; + if (end > 0 && end < start) end = start; // Copy 0 bytes; we're done + + if (end === start) return 0; + if (target.length === 0 || this.length === 0) return 0; // Fatal error conditions + + if (targetStart < 0) { + throw new RangeError('targetStart out of bounds'); + } + + if (start < 0 || start >= this.length) throw new RangeError('Index out of range'); + if (end < 0) throw new RangeError('sourceEnd out of bounds'); // Are we oob? + + if (end > this.length) end = this.length; + + if (target.length - targetStart < end - start) { + end = target.length - targetStart + start; + } + + var len = end - start; + + if (this === target && typeof Uint8Array.prototype.copyWithin === 'function') { + // Use built-in when available, missing from IE11 + this.copyWithin(targetStart, start, end); + } else { + Uint8Array.prototype.set.call(target, this.subarray(start, end), targetStart); + } + + return len; + }; // Usage: + // buffer.fill(number[, offset[, end]]) + // buffer.fill(buffer[, offset[, end]]) + // buffer.fill(string[, offset[, end]][, encoding]) + + + Buffer.prototype.fill = function fill(val, start, end, encoding) { + // Handle string cases: + if (typeof val === 'string') { + if (typeof start === 'string') { + encoding = start; + start = 0; + end = this.length; + } else if (typeof end === 'string') { + encoding = end; + end = this.length; + } + + if (encoding !== undefined && typeof encoding !== 'string') { + throw new TypeError('encoding must be a string'); + } + + if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) { + throw new TypeError('Unknown encoding: ' + encoding); + } + + if (val.length === 1) { + var code = val.charCodeAt(0); + + if (encoding === 'utf8' && code < 128 || encoding === 'latin1') { + // Fast path: If `val` fits into a single byte, use that numeric value. + val = code; + } + } + } else if (typeof val === 'number') { + val = val & 255; + } else if (typeof val === 'boolean') { + val = Number(val); + } // Invalid ranges are not set to a default, so can range check early. + + + if (start < 0 || this.length < start || this.length < end) { + throw new RangeError('Out of range index'); + } + + if (end <= start) { + return this; + } + + start = start >>> 0; + end = end === undefined ? this.length : end >>> 0; + if (!val) val = 0; + var i; + + if (typeof val === 'number') { + for (i = start; i < end; ++i) { + this[i] = val; + } + } else { + var bytes = Buffer.isBuffer(val) ? val : Buffer.from(val, encoding); + var len = bytes.length; + + if (len === 0) { + throw new TypeError('The value "' + val + '" is invalid for argument "value"'); + } + + for (i = 0; i < end - start; ++i) { + this[i + start] = bytes[i % len]; + } + } + + return this; + }; // HELPER FUNCTIONS + // ================ + + + var INVALID_BASE64_RE = /[^+/0-9A-Za-z-_]/g; + + function base64clean(str) { + // Node takes equal signs as end of the Base64 encoding + str = str.split('=')[0]; // Node strips out invalid characters like \n and \t from the string, base64-js does not + + str = str.trim().replace(INVALID_BASE64_RE, ''); // Node converts strings with length < 2 to '' + + if (str.length < 2) return ''; // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not + + while (str.length % 4 !== 0) { + str = str + '='; + } + + return str; + } + + function utf8ToBytes(string, units) { + units = units || Infinity; + var codePoint; + var length = string.length; + var leadSurrogate = null; + var bytes = []; + + for (var i = 0; i < length; ++i) { + codePoint = string.charCodeAt(i); // is surrogate component + + if (codePoint > 0xD7FF && codePoint < 0xE000) { + // last char was a lead + if (!leadSurrogate) { + // no lead yet + if (codePoint > 0xDBFF) { + // unexpected trail + if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD); + continue; + } else if (i + 1 === length) { + // unpaired lead + if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD); + continue; + } // valid lead + + + leadSurrogate = codePoint; + continue; + } // 2 leads in a row + + + if (codePoint < 0xDC00) { + if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD); + leadSurrogate = codePoint; + continue; + } // valid surrogate pair + + + codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000; + } else if (leadSurrogate) { + // valid bmp char, but last char was a lead + if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD); + } + + leadSurrogate = null; // encode utf8 + + if (codePoint < 0x80) { + if ((units -= 1) < 0) break; + bytes.push(codePoint); + } else if (codePoint < 0x800) { + if ((units -= 2) < 0) break; + bytes.push(codePoint >> 0x6 | 0xC0, codePoint & 0x3F | 0x80); + } else if (codePoint < 0x10000) { + if ((units -= 3) < 0) break; + bytes.push(codePoint >> 0xC | 0xE0, codePoint >> 0x6 & 0x3F | 0x80, codePoint & 0x3F | 0x80); + } else if (codePoint < 0x110000) { + if ((units -= 4) < 0) break; + bytes.push(codePoint >> 0x12 | 0xF0, codePoint >> 0xC & 0x3F | 0x80, codePoint >> 0x6 & 0x3F | 0x80, codePoint & 0x3F | 0x80); + } else { + throw new Error('Invalid code point'); + } + } + + return bytes; + } + + function asciiToBytes(str) { + var byteArray = []; + + for (var i = 0; i < str.length; ++i) { + // Node's code seems to be doing this and not & 0x7F.. + byteArray.push(str.charCodeAt(i) & 0xFF); + } + + return byteArray; + } + + function utf16leToBytes(str, units) { + var c, hi, lo; + var byteArray = []; + + for (var i = 0; i < str.length; ++i) { + if ((units -= 2) < 0) break; + c = str.charCodeAt(i); + hi = c >> 8; + lo = c % 256; + byteArray.push(lo); + byteArray.push(hi); + } + + return byteArray; + } + + function base64ToBytes(str) { + return base64Js.toByteArray(base64clean(str)); + } + + function blitBuffer(src, dst, offset, length) { + for (var i = 0; i < length; ++i) { + if (i + offset >= dst.length || i >= src.length) break; + dst[i + offset] = src[i]; + } + + return i; + } // ArrayBuffer or Uint8Array objects from other contexts (i.e. iframes) do not pass + // the `instanceof` check but they should be treated as of that type. + // See: https://github.com/feross/buffer/issues/166 + + + function isInstance(obj, type) { + return obj instanceof type || obj != null && obj.constructor != null && obj.constructor.name != null && obj.constructor.name === type.name; + } + + function numberIsNaN(obj) { + // For IE11 support + return obj !== obj; // eslint-disable-line no-self-compare + } // Create lookup table for `toString('hex')` + // See: https://github.com/feross/buffer/issues/219 + + + var hexSliceLookupTable = function () { + var alphabet = '0123456789abcdef'; + var table = new Array(256); + + for (var i = 0; i < 16; ++i) { + var i16 = i * 16; + + for (var j = 0; j < 16; ++j) { + table[i16 + j] = alphabet[i] + alphabet[j]; + } + } + + return table; + }(); + }); + var buffer_1 = buffer$1.Buffer; + buffer$1.SlowBuffer; + buffer$1.INSPECT_MAX_BYTES; + buffer$1.kMaxLength; + + /*! ***************************************************************************** + Copyright (c) Microsoft Corporation. + + Permission to use, copy, modify, and/or distribute this software for any + purpose with or without fee is hereby granted. + + THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH + REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, + INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM + LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + PERFORMANCE OF THIS SOFTWARE. + ***************************************************************************** */ + + /* global Reflect, Promise */ + var _extendStatics = function extendStatics(d, b) { + _extendStatics = Object.setPrototypeOf || { + __proto__: [] + } instanceof Array && function (d, b) { + d.__proto__ = b; + } || function (d, b) { + for (var p in b) { + if (b.hasOwnProperty(p)) d[p] = b[p]; + } + }; + + return _extendStatics(d, b); + }; + + function __extends(d, b) { + _extendStatics(d, b); + + function __() { + this.constructor = d; + } + + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + } + + var _assign = function __assign() { + _assign = Object.assign || function __assign(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + + for (var p in s) { + if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; + } + } + + return t; + }; + + return _assign.apply(this, arguments); + }; + + /** @public */ + var BSONError = /** @class */ (function (_super) { + __extends(BSONError, _super); + function BSONError(message) { + var _this = _super.call(this, message) || this; + Object.setPrototypeOf(_this, BSONError.prototype); + return _this; + } + Object.defineProperty(BSONError.prototype, "name", { + get: function () { + return 'BSONError'; + }, + enumerable: false, + configurable: true + }); + return BSONError; + }(Error)); + /** @public */ + var BSONTypeError = /** @class */ (function (_super) { + __extends(BSONTypeError, _super); + function BSONTypeError(message) { + var _this = _super.call(this, message) || this; + Object.setPrototypeOf(_this, BSONTypeError.prototype); + return _this; + } + Object.defineProperty(BSONTypeError.prototype, "name", { + get: function () { + return 'BSONTypeError'; + }, + enumerable: false, + configurable: true + }); + return BSONTypeError; + }(TypeError)); + + function checkForMath(potentialGlobal) { + // eslint-disable-next-line eqeqeq + return potentialGlobal && potentialGlobal.Math == Math && potentialGlobal; + } + // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028 + function getGlobal() { + // eslint-disable-next-line no-undef + return (checkForMath(typeof globalThis === 'object' && globalThis) || + checkForMath(typeof window === 'object' && window) || + checkForMath(typeof self === 'object' && self) || + checkForMath(typeof global === 'object' && global) || + Function('return this')()); + } + + /** + * Normalizes our expected stringified form of a function across versions of node + * @param fn - The function to stringify + */ + function normalizedFunctionString(fn) { + return fn.toString().replace('function(', 'function ('); + } + function isReactNative() { + var g = getGlobal(); + return typeof g.navigator === 'object' && g.navigator.product === 'ReactNative'; + } + var insecureRandomBytes = function insecureRandomBytes(size) { + var insecureWarning = isReactNative() + ? 'BSON: For React Native please polyfill crypto.getRandomValues, e.g. using: https://www.npmjs.com/package/react-native-get-random-values.' + : 'BSON: No cryptographic implementation for random bytes present, falling back to a less secure implementation.'; + console.warn(insecureWarning); + var result = buffer_1.alloc(size); + for (var i = 0; i < size; ++i) + result[i] = Math.floor(Math.random() * 256); + return result; + }; + var detectRandomBytes = function () { + if (typeof window !== 'undefined') { + // browser crypto implementation(s) + var target_1 = window.crypto || window.msCrypto; // allow for IE11 + if (target_1 && target_1.getRandomValues) { + return function (size) { return target_1.getRandomValues(buffer_1.alloc(size)); }; + } + } + if (typeof global !== 'undefined' && global.crypto && global.crypto.getRandomValues) { + // allow for RN packages such as https://www.npmjs.com/package/react-native-get-random-values to populate global + return function (size) { return global.crypto.getRandomValues(buffer_1.alloc(size)); }; + } + var requiredRandomBytes; + try { + // eslint-disable-next-line @typescript-eslint/no-var-requires + requiredRandomBytes = require('crypto').randomBytes; + } + catch (e) { + // keep the fallback + } + // NOTE: in transpiled cases the above require might return null/undefined + return requiredRandomBytes || insecureRandomBytes; + }; + var randomBytes = detectRandomBytes(); + function isAnyArrayBuffer(value) { + return ['[object ArrayBuffer]', '[object SharedArrayBuffer]'].includes(Object.prototype.toString.call(value)); + } + function isUint8Array(value) { + return Object.prototype.toString.call(value) === '[object Uint8Array]'; + } + function isBigInt64Array(value) { + return Object.prototype.toString.call(value) === '[object BigInt64Array]'; + } + function isBigUInt64Array(value) { + return Object.prototype.toString.call(value) === '[object BigUint64Array]'; + } + function isRegExp(d) { + return Object.prototype.toString.call(d) === '[object RegExp]'; + } + function isMap(d) { + return Object.prototype.toString.call(d) === '[object Map]'; + } + // To ensure that 0.4 of node works correctly + function isDate(d) { + return isObjectLike(d) && Object.prototype.toString.call(d) === '[object Date]'; + } + /** + * @internal + * this is to solve the `'someKey' in x` problem where x is unknown. + * https://github.com/typescript-eslint/typescript-eslint/issues/1071#issuecomment-541955753 + */ + function isObjectLike(candidate) { + return typeof candidate === 'object' && candidate !== null; + } + function deprecate(fn, message) { + var warned = false; + function deprecated() { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + if (!warned) { + console.warn(message); + warned = true; + } + return fn.apply(this, args); + } + return deprecated; + } + + /** + * Makes sure that, if a Uint8Array is passed in, it is wrapped in a Buffer. + * + * @param potentialBuffer - The potential buffer + * @returns Buffer the input if potentialBuffer is a buffer, or a buffer that + * wraps a passed in Uint8Array + * @throws BSONTypeError If anything other than a Buffer or Uint8Array is passed in + */ + function ensureBuffer(potentialBuffer) { + if (ArrayBuffer.isView(potentialBuffer)) { + return buffer_1.from(potentialBuffer.buffer, potentialBuffer.byteOffset, potentialBuffer.byteLength); + } + if (isAnyArrayBuffer(potentialBuffer)) { + return buffer_1.from(potentialBuffer); + } + throw new BSONTypeError('Must use either Buffer or TypedArray'); + } + + // Validation regex for v4 uuid (validates with or without dashes) + var VALIDATION_REGEX = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|[0-9a-f]{12}4[0-9a-f]{3}[89ab][0-9a-f]{15})$/i; + var uuidValidateString = function (str) { + return typeof str === 'string' && VALIDATION_REGEX.test(str); + }; + var uuidHexStringToBuffer = function (hexString) { + if (!uuidValidateString(hexString)) { + throw new BSONTypeError('UUID string representations must be a 32 or 36 character hex string (dashes excluded/included). Format: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" or "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx".'); + } + var sanitizedHexString = hexString.replace(/-/g, ''); + return buffer_1.from(sanitizedHexString, 'hex'); + }; + var bufferToUuidHexString = function (buffer, includeDashes) { + if (includeDashes === void 0) { includeDashes = true; } + return includeDashes + ? buffer.toString('hex', 0, 4) + + '-' + + buffer.toString('hex', 4, 6) + + '-' + + buffer.toString('hex', 6, 8) + + '-' + + buffer.toString('hex', 8, 10) + + '-' + + buffer.toString('hex', 10, 16) + : buffer.toString('hex'); + }; + + var BYTE_LENGTH = 16; + var kId$1 = Symbol('id'); + /** + * A class representation of the BSON UUID type. + * @public + */ + var UUID = /** @class */ (function () { + /** + * Create an UUID type + * + * @param input - Can be a 32 or 36 character hex string (dashes excluded/included) or a 16 byte binary Buffer. + */ + function UUID(input) { + if (typeof input === 'undefined') { + // The most common use case (blank id, new UUID() instance) + this.id = UUID.generate(); + } + else if (input instanceof UUID) { + this[kId$1] = buffer_1.from(input.id); + this.__id = input.__id; + } + else if (ArrayBuffer.isView(input) && input.byteLength === BYTE_LENGTH) { + this.id = ensureBuffer(input); + } + else if (typeof input === 'string') { + this.id = uuidHexStringToBuffer(input); + } + else { + throw new BSONTypeError('Argument passed in UUID constructor must be a UUID, a 16 byte Buffer or a 32/36 character hex string (dashes excluded/included, format: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx).'); + } + } + Object.defineProperty(UUID.prototype, "id", { + /** + * The UUID bytes + * @readonly + */ + get: function () { + return this[kId$1]; + }, + set: function (value) { + this[kId$1] = value; + if (UUID.cacheHexString) { + this.__id = bufferToUuidHexString(value); + } + }, + enumerable: false, + configurable: true + }); + /** + * Generate a 16 byte uuid v4 buffer used in UUIDs + */ + /** + * Returns the UUID id as a 32 or 36 character hex string representation, excluding/including dashes (defaults to 36 character dash separated) + * @param includeDashes - should the string exclude dash-separators. + * */ + UUID.prototype.toHexString = function (includeDashes) { + if (includeDashes === void 0) { includeDashes = true; } + if (UUID.cacheHexString && this.__id) { + return this.__id; + } + var uuidHexString = bufferToUuidHexString(this.id, includeDashes); + if (UUID.cacheHexString) { + this.__id = uuidHexString; + } + return uuidHexString; + }; + /** + * Converts the id into a 36 character (dashes included) hex string, unless a encoding is specified. + */ + UUID.prototype.toString = function (encoding) { + return encoding ? this.id.toString(encoding) : this.toHexString(); + }; + /** + * Converts the id into its JSON string representation. + * A 36 character (dashes included) hex string in the format: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx + */ + UUID.prototype.toJSON = function () { + return this.toHexString(); + }; + /** + * Compares the equality of this UUID with `otherID`. + * + * @param otherId - UUID instance to compare against. + */ + UUID.prototype.equals = function (otherId) { + if (!otherId) { + return false; + } + if (otherId instanceof UUID) { + return otherId.id.equals(this.id); + } + try { + return new UUID(otherId).id.equals(this.id); + } + catch (_a) { + return false; + } + }; + /** + * Creates a Binary instance from the current UUID. + */ + UUID.prototype.toBinary = function () { + return new Binary(this.id, Binary.SUBTYPE_UUID); + }; + /** + * Generates a populated buffer containing a v4 uuid + */ + UUID.generate = function () { + var bytes = randomBytes(BYTE_LENGTH); + // Per 4.4, set bits for version and `clock_seq_hi_and_reserved` + // Kindly borrowed from https://github.com/uuidjs/uuid/blob/master/src/v4.js + bytes[6] = (bytes[6] & 0x0f) | 0x40; + bytes[8] = (bytes[8] & 0x3f) | 0x80; + return buffer_1.from(bytes); + }; + /** + * Checks if a value is a valid bson UUID + * @param input - UUID, string or Buffer to validate. + */ + UUID.isValid = function (input) { + if (!input) { + return false; + } + if (input instanceof UUID) { + return true; + } + if (typeof input === 'string') { + return uuidValidateString(input); + } + if (isUint8Array(input)) { + // check for length & uuid version (https://tools.ietf.org/html/rfc4122#section-4.1.3) + if (input.length !== BYTE_LENGTH) { + return false; + } + try { + // get this byte as hex: xxxxxxxx-xxxx-XXxx-xxxx-xxxxxxxxxxxx + // check first part as uuid version: xxxxxxxx-xxxx-Xxxx-xxxx-xxxxxxxxxxxx + return parseInt(input[6].toString(16)[0], 10) === Binary.SUBTYPE_UUID; + } + catch (_a) { + return false; + } + } + return false; + }; + /** + * Creates an UUID from a hex string representation of an UUID. + * @param hexString - 32 or 36 character hex string (dashes excluded/included). + */ + UUID.createFromHexString = function (hexString) { + var buffer = uuidHexStringToBuffer(hexString); + return new UUID(buffer); + }; + /** + * Converts to a string representation of this Id. + * + * @returns return the 36 character hex string representation. + * @internal + */ + UUID.prototype[Symbol.for('nodejs.util.inspect.custom')] = function () { + return this.inspect(); + }; + UUID.prototype.inspect = function () { + return "new UUID(\"" + this.toHexString() + "\")"; + }; + return UUID; + }()); + Object.defineProperty(UUID.prototype, '_bsontype', { value: 'UUID' }); + + /** + * A class representation of the BSON Binary type. + * @public + * @category BSONType + */ + var Binary = /** @class */ (function () { + /** + * @param buffer - a buffer object containing the binary data. + * @param subType - the option binary type. + */ + function Binary(buffer, subType) { + if (!(this instanceof Binary)) + return new Binary(buffer, subType); + if (!(buffer == null) && + !(typeof buffer === 'string') && + !ArrayBuffer.isView(buffer) && + !(buffer instanceof ArrayBuffer) && + !Array.isArray(buffer)) { + throw new BSONTypeError('Binary can only be constructed from string, Buffer, TypedArray, or Array'); + } + this.sub_type = subType !== null && subType !== void 0 ? subType : Binary.BSON_BINARY_SUBTYPE_DEFAULT; + if (buffer == null) { + // create an empty binary buffer + this.buffer = buffer_1.alloc(Binary.BUFFER_SIZE); + this.position = 0; + } + else { + if (typeof buffer === 'string') { + // string + this.buffer = buffer_1.from(buffer, 'binary'); + } + else if (Array.isArray(buffer)) { + // number[] + this.buffer = buffer_1.from(buffer); + } + else { + // Buffer | TypedArray | ArrayBuffer + this.buffer = ensureBuffer(buffer); + } + this.position = this.buffer.byteLength; + } + } + /** + * Updates this binary with byte_value. + * + * @param byteValue - a single byte we wish to write. + */ + Binary.prototype.put = function (byteValue) { + // If it's a string and a has more than one character throw an error + if (typeof byteValue === 'string' && byteValue.length !== 1) { + throw new BSONTypeError('only accepts single character String'); + } + else if (typeof byteValue !== 'number' && byteValue.length !== 1) + throw new BSONTypeError('only accepts single character Uint8Array or Array'); + // Decode the byte value once + var decodedByte; + if (typeof byteValue === 'string') { + decodedByte = byteValue.charCodeAt(0); + } + else if (typeof byteValue === 'number') { + decodedByte = byteValue; + } + else { + decodedByte = byteValue[0]; + } + if (decodedByte < 0 || decodedByte > 255) { + throw new BSONTypeError('only accepts number in a valid unsigned byte range 0-255'); + } + if (this.buffer.length > this.position) { + this.buffer[this.position++] = decodedByte; + } + else { + var buffer = buffer_1.alloc(Binary.BUFFER_SIZE + this.buffer.length); + // Combine the two buffers together + this.buffer.copy(buffer, 0, 0, this.buffer.length); + this.buffer = buffer; + this.buffer[this.position++] = decodedByte; + } + }; + /** + * Writes a buffer or string to the binary. + * + * @param sequence - a string or buffer to be written to the Binary BSON object. + * @param offset - specify the binary of where to write the content. + */ + Binary.prototype.write = function (sequence, offset) { + offset = typeof offset === 'number' ? offset : this.position; + // If the buffer is to small let's extend the buffer + if (this.buffer.length < offset + sequence.length) { + var buffer = buffer_1.alloc(this.buffer.length + sequence.length); + this.buffer.copy(buffer, 0, 0, this.buffer.length); + // Assign the new buffer + this.buffer = buffer; + } + if (ArrayBuffer.isView(sequence)) { + this.buffer.set(ensureBuffer(sequence), offset); + this.position = + offset + sequence.byteLength > this.position ? offset + sequence.length : this.position; + } + else if (typeof sequence === 'string') { + this.buffer.write(sequence, offset, sequence.length, 'binary'); + this.position = + offset + sequence.length > this.position ? offset + sequence.length : this.position; + } + }; + /** + * Reads **length** bytes starting at **position**. + * + * @param position - read from the given position in the Binary. + * @param length - the number of bytes to read. + */ + Binary.prototype.read = function (position, length) { + length = length && length > 0 ? length : this.position; + // Let's return the data based on the type we have + return this.buffer.slice(position, position + length); + }; + /** + * Returns the value of this binary as a string. + * @param asRaw - Will skip converting to a string + * @remarks + * This is handy when calling this function conditionally for some key value pairs and not others + */ + Binary.prototype.value = function (asRaw) { + asRaw = !!asRaw; + // Optimize to serialize for the situation where the data == size of buffer + if (asRaw && this.buffer.length === this.position) { + return this.buffer; + } + // If it's a node.js buffer object + if (asRaw) { + return this.buffer.slice(0, this.position); + } + return this.buffer.toString('binary', 0, this.position); + }; + /** the length of the binary sequence */ + Binary.prototype.length = function () { + return this.position; + }; + Binary.prototype.toJSON = function () { + return this.buffer.toString('base64'); + }; + Binary.prototype.toString = function (format) { + return this.buffer.toString(format); + }; + /** @internal */ + Binary.prototype.toExtendedJSON = function (options) { + options = options || {}; + var base64String = this.buffer.toString('base64'); + var subType = Number(this.sub_type).toString(16); + if (options.legacy) { + return { + $binary: base64String, + $type: subType.length === 1 ? '0' + subType : subType + }; + } + return { + $binary: { + base64: base64String, + subType: subType.length === 1 ? '0' + subType : subType + } + }; + }; + Binary.prototype.toUUID = function () { + if (this.sub_type === Binary.SUBTYPE_UUID) { + return new UUID(this.buffer.slice(0, this.position)); + } + throw new BSONError("Binary sub_type \"" + this.sub_type + "\" is not supported for converting to UUID. Only \"" + Binary.SUBTYPE_UUID + "\" is currently supported."); + }; + /** @internal */ + Binary.fromExtendedJSON = function (doc, options) { + options = options || {}; + var data; + var type; + if ('$binary' in doc) { + if (options.legacy && typeof doc.$binary === 'string' && '$type' in doc) { + type = doc.$type ? parseInt(doc.$type, 16) : 0; + data = buffer_1.from(doc.$binary, 'base64'); + } + else { + if (typeof doc.$binary !== 'string') { + type = doc.$binary.subType ? parseInt(doc.$binary.subType, 16) : 0; + data = buffer_1.from(doc.$binary.base64, 'base64'); + } + } + } + else if ('$uuid' in doc) { + type = 4; + data = uuidHexStringToBuffer(doc.$uuid); + } + if (!data) { + throw new BSONTypeError("Unexpected Binary Extended JSON format " + JSON.stringify(doc)); + } + return new Binary(data, type); + }; + /** @internal */ + Binary.prototype[Symbol.for('nodejs.util.inspect.custom')] = function () { + return this.inspect(); + }; + Binary.prototype.inspect = function () { + var asBuffer = this.value(true); + return "new Binary(Buffer.from(\"" + asBuffer.toString('hex') + "\", \"hex\"), " + this.sub_type + ")"; + }; + /** + * Binary default subtype + * @internal + */ + Binary.BSON_BINARY_SUBTYPE_DEFAULT = 0; + /** Initial buffer default size */ + Binary.BUFFER_SIZE = 256; + /** Default BSON type */ + Binary.SUBTYPE_DEFAULT = 0; + /** Function BSON type */ + Binary.SUBTYPE_FUNCTION = 1; + /** Byte Array BSON type */ + Binary.SUBTYPE_BYTE_ARRAY = 2; + /** Deprecated UUID BSON type @deprecated Please use SUBTYPE_UUID */ + Binary.SUBTYPE_UUID_OLD = 3; + /** UUID BSON type */ + Binary.SUBTYPE_UUID = 4; + /** MD5 BSON type */ + Binary.SUBTYPE_MD5 = 5; + /** Encrypted BSON type */ + Binary.SUBTYPE_ENCRYPTED = 6; + /** Column BSON type */ + Binary.SUBTYPE_COLUMN = 7; + /** User BSON type */ + Binary.SUBTYPE_USER_DEFINED = 128; + return Binary; + }()); + Object.defineProperty(Binary.prototype, '_bsontype', { value: 'Binary' }); + + /** + * A class representation of the BSON Code type. + * @public + * @category BSONType + */ + var Code = /** @class */ (function () { + /** + * @param code - a string or function. + * @param scope - an optional scope for the function. + */ + function Code(code, scope) { + if (!(this instanceof Code)) + return new Code(code, scope); + this.code = code; + this.scope = scope; + } + Code.prototype.toJSON = function () { + return { code: this.code, scope: this.scope }; + }; + /** @internal */ + Code.prototype.toExtendedJSON = function () { + if (this.scope) { + return { $code: this.code, $scope: this.scope }; + } + return { $code: this.code }; + }; + /** @internal */ + Code.fromExtendedJSON = function (doc) { + return new Code(doc.$code, doc.$scope); + }; + /** @internal */ + Code.prototype[Symbol.for('nodejs.util.inspect.custom')] = function () { + return this.inspect(); + }; + Code.prototype.inspect = function () { + var codeJson = this.toJSON(); + return "new Code(\"" + codeJson.code + "\"" + (codeJson.scope ? ", " + JSON.stringify(codeJson.scope) : '') + ")"; + }; + return Code; + }()); + Object.defineProperty(Code.prototype, '_bsontype', { value: 'Code' }); + + /** @internal */ + function isDBRefLike(value) { + return (isObjectLike(value) && + value.$id != null && + typeof value.$ref === 'string' && + (value.$db == null || typeof value.$db === 'string')); + } + /** + * A class representation of the BSON DBRef type. + * @public + * @category BSONType + */ + var DBRef = /** @class */ (function () { + /** + * @param collection - the collection name. + * @param oid - the reference ObjectId. + * @param db - optional db name, if omitted the reference is local to the current db. + */ + function DBRef(collection, oid, db, fields) { + if (!(this instanceof DBRef)) + return new DBRef(collection, oid, db, fields); + // check if namespace has been provided + var parts = collection.split('.'); + if (parts.length === 2) { + db = parts.shift(); + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + collection = parts.shift(); + } + this.collection = collection; + this.oid = oid; + this.db = db; + this.fields = fields || {}; + } + Object.defineProperty(DBRef.prototype, "namespace", { + // Property provided for compatibility with the 1.x parser + // the 1.x parser used a "namespace" property, while 4.x uses "collection" + /** @internal */ + get: function () { + return this.collection; + }, + set: function (value) { + this.collection = value; + }, + enumerable: false, + configurable: true + }); + DBRef.prototype.toJSON = function () { + var o = Object.assign({ + $ref: this.collection, + $id: this.oid + }, this.fields); + if (this.db != null) + o.$db = this.db; + return o; + }; + /** @internal */ + DBRef.prototype.toExtendedJSON = function (options) { + options = options || {}; + var o = { + $ref: this.collection, + $id: this.oid + }; + if (options.legacy) { + return o; + } + if (this.db) + o.$db = this.db; + o = Object.assign(o, this.fields); + return o; + }; + /** @internal */ + DBRef.fromExtendedJSON = function (doc) { + var copy = Object.assign({}, doc); + delete copy.$ref; + delete copy.$id; + delete copy.$db; + return new DBRef(doc.$ref, doc.$id, doc.$db, copy); + }; + /** @internal */ + DBRef.prototype[Symbol.for('nodejs.util.inspect.custom')] = function () { + return this.inspect(); + }; + DBRef.prototype.inspect = function () { + // NOTE: if OID is an ObjectId class it will just print the oid string. + var oid = this.oid === undefined || this.oid.toString === undefined ? this.oid : this.oid.toString(); + return "new DBRef(\"" + this.namespace + "\", new ObjectId(\"" + oid + "\")" + (this.db ? ", \"" + this.db + "\"" : '') + ")"; + }; + return DBRef; + }()); + Object.defineProperty(DBRef.prototype, '_bsontype', { value: 'DBRef' }); + + /** + * wasm optimizations, to do native i64 multiplication and divide + */ + var wasm = undefined; + try { + wasm = new WebAssembly.Instance(new WebAssembly.Module( + // prettier-ignore + new Uint8Array([0, 97, 115, 109, 1, 0, 0, 0, 1, 13, 2, 96, 0, 1, 127, 96, 4, 127, 127, 127, 127, 1, 127, 3, 7, 6, 0, 1, 1, 1, 1, 1, 6, 6, 1, 127, 1, 65, 0, 11, 7, 50, 6, 3, 109, 117, 108, 0, 1, 5, 100, 105, 118, 95, 115, 0, 2, 5, 100, 105, 118, 95, 117, 0, 3, 5, 114, 101, 109, 95, 115, 0, 4, 5, 114, 101, 109, 95, 117, 0, 5, 8, 103, 101, 116, 95, 104, 105, 103, 104, 0, 0, 10, 191, 1, 6, 4, 0, 35, 0, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 126, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 127, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 128, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 129, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 130, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11])), {}).exports; + } + catch (_a) { + // no wasm support + } + var TWO_PWR_16_DBL = 1 << 16; + var TWO_PWR_24_DBL = 1 << 24; + var TWO_PWR_32_DBL = TWO_PWR_16_DBL * TWO_PWR_16_DBL; + var TWO_PWR_64_DBL = TWO_PWR_32_DBL * TWO_PWR_32_DBL; + var TWO_PWR_63_DBL = TWO_PWR_64_DBL / 2; + /** A cache of the Long representations of small integer values. */ + var INT_CACHE = {}; + /** A cache of the Long representations of small unsigned integer values. */ + var UINT_CACHE = {}; + /** + * A class representing a 64-bit integer + * @public + * @category BSONType + * @remarks + * The internal representation of a long is the two given signed, 32-bit values. + * We use 32-bit pieces because these are the size of integers on which + * Javascript performs bit-operations. For operations like addition and + * multiplication, we split each number into 16 bit pieces, which can easily be + * multiplied within Javascript's floating-point representation without overflow + * or change in sign. + * In the algorithms below, we frequently reduce the negative case to the + * positive case by negating the input(s) and then post-processing the result. + * Note that we must ALWAYS check specially whether those values are MIN_VALUE + * (-2^63) because -MIN_VALUE == MIN_VALUE (since 2^63 cannot be represented as + * a positive number, it overflows back into a negative). Not handling this + * case would often result in infinite recursion. + * Common constant values ZERO, ONE, NEG_ONE, etc. are found as static properties on this class. + */ + var Long = /** @class */ (function () { + /** + * Constructs a 64 bit two's-complement integer, given its low and high 32 bit values as *signed* integers. + * See the from* functions below for more convenient ways of constructing Longs. + * + * Acceptable signatures are: + * - Long(low, high, unsigned?) + * - Long(bigint, unsigned?) + * - Long(string, unsigned?) + * + * @param low - The low (signed) 32 bits of the long + * @param high - The high (signed) 32 bits of the long + * @param unsigned - Whether unsigned or not, defaults to signed + */ + function Long(low, high, unsigned) { + if (low === void 0) { low = 0; } + if (!(this instanceof Long)) + return new Long(low, high, unsigned); + if (typeof low === 'bigint') { + Object.assign(this, Long.fromBigInt(low, !!high)); + } + else if (typeof low === 'string') { + Object.assign(this, Long.fromString(low, !!high)); + } + else { + this.low = low | 0; + this.high = high | 0; + this.unsigned = !!unsigned; + } + Object.defineProperty(this, '__isLong__', { + value: true, + configurable: false, + writable: false, + enumerable: false + }); + } + /** + * Returns a Long representing the 64 bit integer that comes by concatenating the given low and high bits. + * Each is assumed to use 32 bits. + * @param lowBits - The low 32 bits + * @param highBits - The high 32 bits + * @param unsigned - Whether unsigned or not, defaults to signed + * @returns The corresponding Long value + */ + Long.fromBits = function (lowBits, highBits, unsigned) { + return new Long(lowBits, highBits, unsigned); + }; + /** + * Returns a Long representing the given 32 bit integer value. + * @param value - The 32 bit integer in question + * @param unsigned - Whether unsigned or not, defaults to signed + * @returns The corresponding Long value + */ + Long.fromInt = function (value, unsigned) { + var obj, cachedObj, cache; + if (unsigned) { + value >>>= 0; + if ((cache = 0 <= value && value < 256)) { + cachedObj = UINT_CACHE[value]; + if (cachedObj) + return cachedObj; + } + obj = Long.fromBits(value, (value | 0) < 0 ? -1 : 0, true); + if (cache) + UINT_CACHE[value] = obj; + return obj; + } + else { + value |= 0; + if ((cache = -128 <= value && value < 128)) { + cachedObj = INT_CACHE[value]; + if (cachedObj) + return cachedObj; + } + obj = Long.fromBits(value, value < 0 ? -1 : 0, false); + if (cache) + INT_CACHE[value] = obj; + return obj; + } + }; + /** + * Returns a Long representing the given value, provided that it is a finite number. Otherwise, zero is returned. + * @param value - The number in question + * @param unsigned - Whether unsigned or not, defaults to signed + * @returns The corresponding Long value + */ + Long.fromNumber = function (value, unsigned) { + if (isNaN(value)) + return unsigned ? Long.UZERO : Long.ZERO; + if (unsigned) { + if (value < 0) + return Long.UZERO; + if (value >= TWO_PWR_64_DBL) + return Long.MAX_UNSIGNED_VALUE; + } + else { + if (value <= -TWO_PWR_63_DBL) + return Long.MIN_VALUE; + if (value + 1 >= TWO_PWR_63_DBL) + return Long.MAX_VALUE; + } + if (value < 0) + return Long.fromNumber(-value, unsigned).neg(); + return Long.fromBits(value % TWO_PWR_32_DBL | 0, (value / TWO_PWR_32_DBL) | 0, unsigned); + }; + /** + * Returns a Long representing the given value, provided that it is a finite number. Otherwise, zero is returned. + * @param value - The number in question + * @param unsigned - Whether unsigned or not, defaults to signed + * @returns The corresponding Long value + */ + Long.fromBigInt = function (value, unsigned) { + return Long.fromString(value.toString(), unsigned); + }; + /** + * Returns a Long representation of the given string, written using the specified radix. + * @param str - The textual representation of the Long + * @param unsigned - Whether unsigned or not, defaults to signed + * @param radix - The radix in which the text is written (2-36), defaults to 10 + * @returns The corresponding Long value + */ + Long.fromString = function (str, unsigned, radix) { + if (str.length === 0) + throw Error('empty string'); + if (str === 'NaN' || str === 'Infinity' || str === '+Infinity' || str === '-Infinity') + return Long.ZERO; + if (typeof unsigned === 'number') { + // For goog.math.long compatibility + (radix = unsigned), (unsigned = false); + } + else { + unsigned = !!unsigned; + } + radix = radix || 10; + if (radix < 2 || 36 < radix) + throw RangeError('radix'); + var p; + if ((p = str.indexOf('-')) > 0) + throw Error('interior hyphen'); + else if (p === 0) { + return Long.fromString(str.substring(1), unsigned, radix).neg(); + } + // Do several (8) digits each time through the loop, so as to + // minimize the calls to the very expensive emulated div. + var radixToPower = Long.fromNumber(Math.pow(radix, 8)); + var result = Long.ZERO; + for (var i = 0; i < str.length; i += 8) { + var size = Math.min(8, str.length - i), value = parseInt(str.substring(i, i + size), radix); + if (size < 8) { + var power = Long.fromNumber(Math.pow(radix, size)); + result = result.mul(power).add(Long.fromNumber(value)); + } + else { + result = result.mul(radixToPower); + result = result.add(Long.fromNumber(value)); + } + } + result.unsigned = unsigned; + return result; + }; + /** + * Creates a Long from its byte representation. + * @param bytes - Byte representation + * @param unsigned - Whether unsigned or not, defaults to signed + * @param le - Whether little or big endian, defaults to big endian + * @returns The corresponding Long value + */ + Long.fromBytes = function (bytes, unsigned, le) { + return le ? Long.fromBytesLE(bytes, unsigned) : Long.fromBytesBE(bytes, unsigned); + }; + /** + * Creates a Long from its little endian byte representation. + * @param bytes - Little endian byte representation + * @param unsigned - Whether unsigned or not, defaults to signed + * @returns The corresponding Long value + */ + Long.fromBytesLE = function (bytes, unsigned) { + return new Long(bytes[0] | (bytes[1] << 8) | (bytes[2] << 16) | (bytes[3] << 24), bytes[4] | (bytes[5] << 8) | (bytes[6] << 16) | (bytes[7] << 24), unsigned); + }; + /** + * Creates a Long from its big endian byte representation. + * @param bytes - Big endian byte representation + * @param unsigned - Whether unsigned or not, defaults to signed + * @returns The corresponding Long value + */ + Long.fromBytesBE = function (bytes, unsigned) { + return new Long((bytes[4] << 24) | (bytes[5] << 16) | (bytes[6] << 8) | bytes[7], (bytes[0] << 24) | (bytes[1] << 16) | (bytes[2] << 8) | bytes[3], unsigned); + }; + /** + * Tests if the specified object is a Long. + */ + // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types + Long.isLong = function (value) { + return isObjectLike(value) && value['__isLong__'] === true; + }; + /** + * Converts the specified value to a Long. + * @param unsigned - Whether unsigned or not, defaults to signed + */ + Long.fromValue = function (val, unsigned) { + if (typeof val === 'number') + return Long.fromNumber(val, unsigned); + if (typeof val === 'string') + return Long.fromString(val, unsigned); + // Throws for non-objects, converts non-instanceof Long: + return Long.fromBits(val.low, val.high, typeof unsigned === 'boolean' ? unsigned : val.unsigned); + }; + /** Returns the sum of this and the specified Long. */ + Long.prototype.add = function (addend) { + if (!Long.isLong(addend)) + addend = Long.fromValue(addend); + // Divide each number into 4 chunks of 16 bits, and then sum the chunks. + var a48 = this.high >>> 16; + var a32 = this.high & 0xffff; + var a16 = this.low >>> 16; + var a00 = this.low & 0xffff; + var b48 = addend.high >>> 16; + var b32 = addend.high & 0xffff; + var b16 = addend.low >>> 16; + var b00 = addend.low & 0xffff; + var c48 = 0, c32 = 0, c16 = 0, c00 = 0; + c00 += a00 + b00; + c16 += c00 >>> 16; + c00 &= 0xffff; + c16 += a16 + b16; + c32 += c16 >>> 16; + c16 &= 0xffff; + c32 += a32 + b32; + c48 += c32 >>> 16; + c32 &= 0xffff; + c48 += a48 + b48; + c48 &= 0xffff; + return Long.fromBits((c16 << 16) | c00, (c48 << 16) | c32, this.unsigned); + }; + /** + * Returns the sum of this and the specified Long. + * @returns Sum + */ + Long.prototype.and = function (other) { + if (!Long.isLong(other)) + other = Long.fromValue(other); + return Long.fromBits(this.low & other.low, this.high & other.high, this.unsigned); + }; + /** + * Compares this Long's value with the specified's. + * @returns 0 if they are the same, 1 if the this is greater and -1 if the given one is greater + */ + Long.prototype.compare = function (other) { + if (!Long.isLong(other)) + other = Long.fromValue(other); + if (this.eq(other)) + return 0; + var thisNeg = this.isNegative(), otherNeg = other.isNegative(); + if (thisNeg && !otherNeg) + return -1; + if (!thisNeg && otherNeg) + return 1; + // At this point the sign bits are the same + if (!this.unsigned) + return this.sub(other).isNegative() ? -1 : 1; + // Both are positive if at least one is unsigned + return other.high >>> 0 > this.high >>> 0 || + (other.high === this.high && other.low >>> 0 > this.low >>> 0) + ? -1 + : 1; + }; + /** This is an alias of {@link Long.compare} */ + Long.prototype.comp = function (other) { + return this.compare(other); + }; + /** + * Returns this Long divided by the specified. The result is signed if this Long is signed or unsigned if this Long is unsigned. + * @returns Quotient + */ + Long.prototype.divide = function (divisor) { + if (!Long.isLong(divisor)) + divisor = Long.fromValue(divisor); + if (divisor.isZero()) + throw Error('division by zero'); + // use wasm support if present + if (wasm) { + // guard against signed division overflow: the largest + // negative number / -1 would be 1 larger than the largest + // positive number, due to two's complement. + if (!this.unsigned && + this.high === -0x80000000 && + divisor.low === -1 && + divisor.high === -1) { + // be consistent with non-wasm code path + return this; + } + var low = (this.unsigned ? wasm.div_u : wasm.div_s)(this.low, this.high, divisor.low, divisor.high); + return Long.fromBits(low, wasm.get_high(), this.unsigned); + } + if (this.isZero()) + return this.unsigned ? Long.UZERO : Long.ZERO; + var approx, rem, res; + if (!this.unsigned) { + // This section is only relevant for signed longs and is derived from the + // closure library as a whole. + if (this.eq(Long.MIN_VALUE)) { + if (divisor.eq(Long.ONE) || divisor.eq(Long.NEG_ONE)) + return Long.MIN_VALUE; + // recall that -MIN_VALUE == MIN_VALUE + else if (divisor.eq(Long.MIN_VALUE)) + return Long.ONE; + else { + // At this point, we have |other| >= 2, so |this/other| < |MIN_VALUE|. + var halfThis = this.shr(1); + approx = halfThis.div(divisor).shl(1); + if (approx.eq(Long.ZERO)) { + return divisor.isNegative() ? Long.ONE : Long.NEG_ONE; + } + else { + rem = this.sub(divisor.mul(approx)); + res = approx.add(rem.div(divisor)); + return res; + } + } + } + else if (divisor.eq(Long.MIN_VALUE)) + return this.unsigned ? Long.UZERO : Long.ZERO; + if (this.isNegative()) { + if (divisor.isNegative()) + return this.neg().div(divisor.neg()); + return this.neg().div(divisor).neg(); + } + else if (divisor.isNegative()) + return this.div(divisor.neg()).neg(); + res = Long.ZERO; + } + else { + // The algorithm below has not been made for unsigned longs. It's therefore + // required to take special care of the MSB prior to running it. + if (!divisor.unsigned) + divisor = divisor.toUnsigned(); + if (divisor.gt(this)) + return Long.UZERO; + if (divisor.gt(this.shru(1))) + // 15 >>> 1 = 7 ; with divisor = 8 ; true + return Long.UONE; + res = Long.UZERO; + } + // Repeat the following until the remainder is less than other: find a + // floating-point that approximates remainder / other *from below*, add this + // into the result, and subtract it from the remainder. It is critical that + // the approximate value is less than or equal to the real value so that the + // remainder never becomes negative. + rem = this; + while (rem.gte(divisor)) { + // Approximate the result of division. This may be a little greater or + // smaller than the actual value. + approx = Math.max(1, Math.floor(rem.toNumber() / divisor.toNumber())); + // We will tweak the approximate result by changing it in the 48-th digit or + // the smallest non-fractional digit, whichever is larger. + var log2 = Math.ceil(Math.log(approx) / Math.LN2); + var delta = log2 <= 48 ? 1 : Math.pow(2, log2 - 48); + // Decrease the approximation until it is smaller than the remainder. Note + // that if it is too large, the product overflows and is negative. + var approxRes = Long.fromNumber(approx); + var approxRem = approxRes.mul(divisor); + while (approxRem.isNegative() || approxRem.gt(rem)) { + approx -= delta; + approxRes = Long.fromNumber(approx, this.unsigned); + approxRem = approxRes.mul(divisor); + } + // We know the answer can't be zero... and actually, zero would cause + // infinite recursion since we would make no progress. + if (approxRes.isZero()) + approxRes = Long.ONE; + res = res.add(approxRes); + rem = rem.sub(approxRem); + } + return res; + }; + /**This is an alias of {@link Long.divide} */ + Long.prototype.div = function (divisor) { + return this.divide(divisor); + }; + /** + * Tests if this Long's value equals the specified's. + * @param other - Other value + */ + Long.prototype.equals = function (other) { + if (!Long.isLong(other)) + other = Long.fromValue(other); + if (this.unsigned !== other.unsigned && this.high >>> 31 === 1 && other.high >>> 31 === 1) + return false; + return this.high === other.high && this.low === other.low; + }; + /** This is an alias of {@link Long.equals} */ + Long.prototype.eq = function (other) { + return this.equals(other); + }; + /** Gets the high 32 bits as a signed integer. */ + Long.prototype.getHighBits = function () { + return this.high; + }; + /** Gets the high 32 bits as an unsigned integer. */ + Long.prototype.getHighBitsUnsigned = function () { + return this.high >>> 0; + }; + /** Gets the low 32 bits as a signed integer. */ + Long.prototype.getLowBits = function () { + return this.low; + }; + /** Gets the low 32 bits as an unsigned integer. */ + Long.prototype.getLowBitsUnsigned = function () { + return this.low >>> 0; + }; + /** Gets the number of bits needed to represent the absolute value of this Long. */ + Long.prototype.getNumBitsAbs = function () { + if (this.isNegative()) { + // Unsigned Longs are never negative + return this.eq(Long.MIN_VALUE) ? 64 : this.neg().getNumBitsAbs(); + } + var val = this.high !== 0 ? this.high : this.low; + var bit; + for (bit = 31; bit > 0; bit--) + if ((val & (1 << bit)) !== 0) + break; + return this.high !== 0 ? bit + 33 : bit + 1; + }; + /** Tests if this Long's value is greater than the specified's. */ + Long.prototype.greaterThan = function (other) { + return this.comp(other) > 0; + }; + /** This is an alias of {@link Long.greaterThan} */ + Long.prototype.gt = function (other) { + return this.greaterThan(other); + }; + /** Tests if this Long's value is greater than or equal the specified's. */ + Long.prototype.greaterThanOrEqual = function (other) { + return this.comp(other) >= 0; + }; + /** This is an alias of {@link Long.greaterThanOrEqual} */ + Long.prototype.gte = function (other) { + return this.greaterThanOrEqual(other); + }; + /** This is an alias of {@link Long.greaterThanOrEqual} */ + Long.prototype.ge = function (other) { + return this.greaterThanOrEqual(other); + }; + /** Tests if this Long's value is even. */ + Long.prototype.isEven = function () { + return (this.low & 1) === 0; + }; + /** Tests if this Long's value is negative. */ + Long.prototype.isNegative = function () { + return !this.unsigned && this.high < 0; + }; + /** Tests if this Long's value is odd. */ + Long.prototype.isOdd = function () { + return (this.low & 1) === 1; + }; + /** Tests if this Long's value is positive. */ + Long.prototype.isPositive = function () { + return this.unsigned || this.high >= 0; + }; + /** Tests if this Long's value equals zero. */ + Long.prototype.isZero = function () { + return this.high === 0 && this.low === 0; + }; + /** Tests if this Long's value is less than the specified's. */ + Long.prototype.lessThan = function (other) { + return this.comp(other) < 0; + }; + /** This is an alias of {@link Long#lessThan}. */ + Long.prototype.lt = function (other) { + return this.lessThan(other); + }; + /** Tests if this Long's value is less than or equal the specified's. */ + Long.prototype.lessThanOrEqual = function (other) { + return this.comp(other) <= 0; + }; + /** This is an alias of {@link Long.lessThanOrEqual} */ + Long.prototype.lte = function (other) { + return this.lessThanOrEqual(other); + }; + /** Returns this Long modulo the specified. */ + Long.prototype.modulo = function (divisor) { + if (!Long.isLong(divisor)) + divisor = Long.fromValue(divisor); + // use wasm support if present + if (wasm) { + var low = (this.unsigned ? wasm.rem_u : wasm.rem_s)(this.low, this.high, divisor.low, divisor.high); + return Long.fromBits(low, wasm.get_high(), this.unsigned); + } + return this.sub(this.div(divisor).mul(divisor)); + }; + /** This is an alias of {@link Long.modulo} */ + Long.prototype.mod = function (divisor) { + return this.modulo(divisor); + }; + /** This is an alias of {@link Long.modulo} */ + Long.prototype.rem = function (divisor) { + return this.modulo(divisor); + }; + /** + * Returns the product of this and the specified Long. + * @param multiplier - Multiplier + * @returns Product + */ + Long.prototype.multiply = function (multiplier) { + if (this.isZero()) + return Long.ZERO; + if (!Long.isLong(multiplier)) + multiplier = Long.fromValue(multiplier); + // use wasm support if present + if (wasm) { + var low = wasm.mul(this.low, this.high, multiplier.low, multiplier.high); + return Long.fromBits(low, wasm.get_high(), this.unsigned); + } + if (multiplier.isZero()) + return Long.ZERO; + if (this.eq(Long.MIN_VALUE)) + return multiplier.isOdd() ? Long.MIN_VALUE : Long.ZERO; + if (multiplier.eq(Long.MIN_VALUE)) + return this.isOdd() ? Long.MIN_VALUE : Long.ZERO; + if (this.isNegative()) { + if (multiplier.isNegative()) + return this.neg().mul(multiplier.neg()); + else + return this.neg().mul(multiplier).neg(); + } + else if (multiplier.isNegative()) + return this.mul(multiplier.neg()).neg(); + // If both longs are small, use float multiplication + if (this.lt(Long.TWO_PWR_24) && multiplier.lt(Long.TWO_PWR_24)) + return Long.fromNumber(this.toNumber() * multiplier.toNumber(), this.unsigned); + // Divide each long into 4 chunks of 16 bits, and then add up 4x4 products. + // We can skip products that would overflow. + var a48 = this.high >>> 16; + var a32 = this.high & 0xffff; + var a16 = this.low >>> 16; + var a00 = this.low & 0xffff; + var b48 = multiplier.high >>> 16; + var b32 = multiplier.high & 0xffff; + var b16 = multiplier.low >>> 16; + var b00 = multiplier.low & 0xffff; + var c48 = 0, c32 = 0, c16 = 0, c00 = 0; + c00 += a00 * b00; + c16 += c00 >>> 16; + c00 &= 0xffff; + c16 += a16 * b00; + c32 += c16 >>> 16; + c16 &= 0xffff; + c16 += a00 * b16; + c32 += c16 >>> 16; + c16 &= 0xffff; + c32 += a32 * b00; + c48 += c32 >>> 16; + c32 &= 0xffff; + c32 += a16 * b16; + c48 += c32 >>> 16; + c32 &= 0xffff; + c32 += a00 * b32; + c48 += c32 >>> 16; + c32 &= 0xffff; + c48 += a48 * b00 + a32 * b16 + a16 * b32 + a00 * b48; + c48 &= 0xffff; + return Long.fromBits((c16 << 16) | c00, (c48 << 16) | c32, this.unsigned); + }; + /** This is an alias of {@link Long.multiply} */ + Long.prototype.mul = function (multiplier) { + return this.multiply(multiplier); + }; + /** Returns the Negation of this Long's value. */ + Long.prototype.negate = function () { + if (!this.unsigned && this.eq(Long.MIN_VALUE)) + return Long.MIN_VALUE; + return this.not().add(Long.ONE); + }; + /** This is an alias of {@link Long.negate} */ + Long.prototype.neg = function () { + return this.negate(); + }; + /** Returns the bitwise NOT of this Long. */ + Long.prototype.not = function () { + return Long.fromBits(~this.low, ~this.high, this.unsigned); + }; + /** Tests if this Long's value differs from the specified's. */ + Long.prototype.notEquals = function (other) { + return !this.equals(other); + }; + /** This is an alias of {@link Long.notEquals} */ + Long.prototype.neq = function (other) { + return this.notEquals(other); + }; + /** This is an alias of {@link Long.notEquals} */ + Long.prototype.ne = function (other) { + return this.notEquals(other); + }; + /** + * Returns the bitwise OR of this Long and the specified. + */ + Long.prototype.or = function (other) { + if (!Long.isLong(other)) + other = Long.fromValue(other); + return Long.fromBits(this.low | other.low, this.high | other.high, this.unsigned); + }; + /** + * Returns this Long with bits shifted to the left by the given amount. + * @param numBits - Number of bits + * @returns Shifted Long + */ + Long.prototype.shiftLeft = function (numBits) { + if (Long.isLong(numBits)) + numBits = numBits.toInt(); + if ((numBits &= 63) === 0) + return this; + else if (numBits < 32) + return Long.fromBits(this.low << numBits, (this.high << numBits) | (this.low >>> (32 - numBits)), this.unsigned); + else + return Long.fromBits(0, this.low << (numBits - 32), this.unsigned); + }; + /** This is an alias of {@link Long.shiftLeft} */ + Long.prototype.shl = function (numBits) { + return this.shiftLeft(numBits); + }; + /** + * Returns this Long with bits arithmetically shifted to the right by the given amount. + * @param numBits - Number of bits + * @returns Shifted Long + */ + Long.prototype.shiftRight = function (numBits) { + if (Long.isLong(numBits)) + numBits = numBits.toInt(); + if ((numBits &= 63) === 0) + return this; + else if (numBits < 32) + return Long.fromBits((this.low >>> numBits) | (this.high << (32 - numBits)), this.high >> numBits, this.unsigned); + else + return Long.fromBits(this.high >> (numBits - 32), this.high >= 0 ? 0 : -1, this.unsigned); + }; + /** This is an alias of {@link Long.shiftRight} */ + Long.prototype.shr = function (numBits) { + return this.shiftRight(numBits); + }; + /** + * Returns this Long with bits logically shifted to the right by the given amount. + * @param numBits - Number of bits + * @returns Shifted Long + */ + Long.prototype.shiftRightUnsigned = function (numBits) { + if (Long.isLong(numBits)) + numBits = numBits.toInt(); + numBits &= 63; + if (numBits === 0) + return this; + else { + var high = this.high; + if (numBits < 32) { + var low = this.low; + return Long.fromBits((low >>> numBits) | (high << (32 - numBits)), high >>> numBits, this.unsigned); + } + else if (numBits === 32) + return Long.fromBits(high, 0, this.unsigned); + else + return Long.fromBits(high >>> (numBits - 32), 0, this.unsigned); + } + }; + /** This is an alias of {@link Long.shiftRightUnsigned} */ + Long.prototype.shr_u = function (numBits) { + return this.shiftRightUnsigned(numBits); + }; + /** This is an alias of {@link Long.shiftRightUnsigned} */ + Long.prototype.shru = function (numBits) { + return this.shiftRightUnsigned(numBits); + }; + /** + * Returns the difference of this and the specified Long. + * @param subtrahend - Subtrahend + * @returns Difference + */ + Long.prototype.subtract = function (subtrahend) { + if (!Long.isLong(subtrahend)) + subtrahend = Long.fromValue(subtrahend); + return this.add(subtrahend.neg()); + }; + /** This is an alias of {@link Long.subtract} */ + Long.prototype.sub = function (subtrahend) { + return this.subtract(subtrahend); + }; + /** Converts the Long to a 32 bit integer, assuming it is a 32 bit integer. */ + Long.prototype.toInt = function () { + return this.unsigned ? this.low >>> 0 : this.low; + }; + /** Converts the Long to a the nearest floating-point representation of this value (double, 53 bit mantissa). */ + Long.prototype.toNumber = function () { + if (this.unsigned) + return (this.high >>> 0) * TWO_PWR_32_DBL + (this.low >>> 0); + return this.high * TWO_PWR_32_DBL + (this.low >>> 0); + }; + /** Converts the Long to a BigInt (arbitrary precision). */ + Long.prototype.toBigInt = function () { + return BigInt(this.toString()); + }; + /** + * Converts this Long to its byte representation. + * @param le - Whether little or big endian, defaults to big endian + * @returns Byte representation + */ + Long.prototype.toBytes = function (le) { + return le ? this.toBytesLE() : this.toBytesBE(); + }; + /** + * Converts this Long to its little endian byte representation. + * @returns Little endian byte representation + */ + Long.prototype.toBytesLE = function () { + var hi = this.high, lo = this.low; + return [ + lo & 0xff, + (lo >>> 8) & 0xff, + (lo >>> 16) & 0xff, + lo >>> 24, + hi & 0xff, + (hi >>> 8) & 0xff, + (hi >>> 16) & 0xff, + hi >>> 24 + ]; + }; + /** + * Converts this Long to its big endian byte representation. + * @returns Big endian byte representation + */ + Long.prototype.toBytesBE = function () { + var hi = this.high, lo = this.low; + return [ + hi >>> 24, + (hi >>> 16) & 0xff, + (hi >>> 8) & 0xff, + hi & 0xff, + lo >>> 24, + (lo >>> 16) & 0xff, + (lo >>> 8) & 0xff, + lo & 0xff + ]; + }; + /** + * Converts this Long to signed. + */ + Long.prototype.toSigned = function () { + if (!this.unsigned) + return this; + return Long.fromBits(this.low, this.high, false); + }; + /** + * Converts the Long to a string written in the specified radix. + * @param radix - Radix (2-36), defaults to 10 + * @throws RangeError If `radix` is out of range + */ + Long.prototype.toString = function (radix) { + radix = radix || 10; + if (radix < 2 || 36 < radix) + throw RangeError('radix'); + if (this.isZero()) + return '0'; + if (this.isNegative()) { + // Unsigned Longs are never negative + if (this.eq(Long.MIN_VALUE)) { + // We need to change the Long value before it can be negated, so we remove + // the bottom-most digit in this base and then recurse to do the rest. + var radixLong = Long.fromNumber(radix), div = this.div(radixLong), rem1 = div.mul(radixLong).sub(this); + return div.toString(radix) + rem1.toInt().toString(radix); + } + else + return '-' + this.neg().toString(radix); + } + // Do several (6) digits each time through the loop, so as to + // minimize the calls to the very expensive emulated div. + var radixToPower = Long.fromNumber(Math.pow(radix, 6), this.unsigned); + // eslint-disable-next-line @typescript-eslint/no-this-alias + var rem = this; + var result = ''; + // eslint-disable-next-line no-constant-condition + while (true) { + var remDiv = rem.div(radixToPower); + var intval = rem.sub(remDiv.mul(radixToPower)).toInt() >>> 0; + var digits = intval.toString(radix); + rem = remDiv; + if (rem.isZero()) { + return digits + result; + } + else { + while (digits.length < 6) + digits = '0' + digits; + result = '' + digits + result; + } + } + }; + /** Converts this Long to unsigned. */ + Long.prototype.toUnsigned = function () { + if (this.unsigned) + return this; + return Long.fromBits(this.low, this.high, true); + }; + /** Returns the bitwise XOR of this Long and the given one. */ + Long.prototype.xor = function (other) { + if (!Long.isLong(other)) + other = Long.fromValue(other); + return Long.fromBits(this.low ^ other.low, this.high ^ other.high, this.unsigned); + }; + /** This is an alias of {@link Long.isZero} */ + Long.prototype.eqz = function () { + return this.isZero(); + }; + /** This is an alias of {@link Long.lessThanOrEqual} */ + Long.prototype.le = function (other) { + return this.lessThanOrEqual(other); + }; + /* + **************************************************************** + * BSON SPECIFIC ADDITIONS * + **************************************************************** + */ + Long.prototype.toExtendedJSON = function (options) { + if (options && options.relaxed) + return this.toNumber(); + return { $numberLong: this.toString() }; + }; + Long.fromExtendedJSON = function (doc, options) { + var result = Long.fromString(doc.$numberLong); + return options && options.relaxed ? result.toNumber() : result; + }; + /** @internal */ + Long.prototype[Symbol.for('nodejs.util.inspect.custom')] = function () { + return this.inspect(); + }; + Long.prototype.inspect = function () { + return "new Long(\"" + this.toString() + "\"" + (this.unsigned ? ', true' : '') + ")"; + }; + Long.TWO_PWR_24 = Long.fromInt(TWO_PWR_24_DBL); + /** Maximum unsigned value. */ + Long.MAX_UNSIGNED_VALUE = Long.fromBits(0xffffffff | 0, 0xffffffff | 0, true); + /** Signed zero */ + Long.ZERO = Long.fromInt(0); + /** Unsigned zero. */ + Long.UZERO = Long.fromInt(0, true); + /** Signed one. */ + Long.ONE = Long.fromInt(1); + /** Unsigned one. */ + Long.UONE = Long.fromInt(1, true); + /** Signed negative one. */ + Long.NEG_ONE = Long.fromInt(-1); + /** Maximum signed value. */ + Long.MAX_VALUE = Long.fromBits(0xffffffff | 0, 0x7fffffff | 0, false); + /** Minimum signed value. */ + Long.MIN_VALUE = Long.fromBits(0, 0x80000000 | 0, false); + return Long; + }()); + Object.defineProperty(Long.prototype, '__isLong__', { value: true }); + Object.defineProperty(Long.prototype, '_bsontype', { value: 'Long' }); + + var PARSE_STRING_REGEXP = /^(\+|-)?(\d+|(\d*\.\d*))?(E|e)?([-+])?(\d+)?$/; + var PARSE_INF_REGEXP = /^(\+|-)?(Infinity|inf)$/i; + var PARSE_NAN_REGEXP = /^(\+|-)?NaN$/i; + var EXPONENT_MAX = 6111; + var EXPONENT_MIN = -6176; + var EXPONENT_BIAS = 6176; + var MAX_DIGITS = 34; + // Nan value bits as 32 bit values (due to lack of longs) + var NAN_BUFFER = [ + 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + ].reverse(); + // Infinity value bits 32 bit values (due to lack of longs) + var INF_NEGATIVE_BUFFER = [ + 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + ].reverse(); + var INF_POSITIVE_BUFFER = [ + 0x78, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + ].reverse(); + var EXPONENT_REGEX = /^([-+])?(\d+)?$/; + // Extract least significant 5 bits + var COMBINATION_MASK = 0x1f; + // Extract least significant 14 bits + var EXPONENT_MASK = 0x3fff; + // Value of combination field for Inf + var COMBINATION_INFINITY = 30; + // Value of combination field for NaN + var COMBINATION_NAN = 31; + // Detect if the value is a digit + function isDigit(value) { + return !isNaN(parseInt(value, 10)); + } + // Divide two uint128 values + function divideu128(value) { + var DIVISOR = Long.fromNumber(1000 * 1000 * 1000); + var _rem = Long.fromNumber(0); + if (!value.parts[0] && !value.parts[1] && !value.parts[2] && !value.parts[3]) { + return { quotient: value, rem: _rem }; + } + for (var i = 0; i <= 3; i++) { + // Adjust remainder to match value of next dividend + _rem = _rem.shiftLeft(32); + // Add the divided to _rem + _rem = _rem.add(new Long(value.parts[i], 0)); + value.parts[i] = _rem.div(DIVISOR).low; + _rem = _rem.modulo(DIVISOR); + } + return { quotient: value, rem: _rem }; + } + // Multiply two Long values and return the 128 bit value + function multiply64x2(left, right) { + if (!left && !right) { + return { high: Long.fromNumber(0), low: Long.fromNumber(0) }; + } + var leftHigh = left.shiftRightUnsigned(32); + var leftLow = new Long(left.getLowBits(), 0); + var rightHigh = right.shiftRightUnsigned(32); + var rightLow = new Long(right.getLowBits(), 0); + var productHigh = leftHigh.multiply(rightHigh); + var productMid = leftHigh.multiply(rightLow); + var productMid2 = leftLow.multiply(rightHigh); + var productLow = leftLow.multiply(rightLow); + productHigh = productHigh.add(productMid.shiftRightUnsigned(32)); + productMid = new Long(productMid.getLowBits(), 0) + .add(productMid2) + .add(productLow.shiftRightUnsigned(32)); + productHigh = productHigh.add(productMid.shiftRightUnsigned(32)); + productLow = productMid.shiftLeft(32).add(new Long(productLow.getLowBits(), 0)); + // Return the 128 bit result + return { high: productHigh, low: productLow }; + } + function lessThan(left, right) { + // Make values unsigned + var uhleft = left.high >>> 0; + var uhright = right.high >>> 0; + // Compare high bits first + if (uhleft < uhright) { + return true; + } + else if (uhleft === uhright) { + var ulleft = left.low >>> 0; + var ulright = right.low >>> 0; + if (ulleft < ulright) + return true; + } + return false; + } + function invalidErr(string, message) { + throw new BSONTypeError("\"" + string + "\" is not a valid Decimal128 string - " + message); + } + /** + * A class representation of the BSON Decimal128 type. + * @public + * @category BSONType + */ + var Decimal128 = /** @class */ (function () { + /** + * @param bytes - a buffer containing the raw Decimal128 bytes in little endian order, + * or a string representation as returned by .toString() + */ + function Decimal128(bytes) { + if (!(this instanceof Decimal128)) + return new Decimal128(bytes); + if (typeof bytes === 'string') { + this.bytes = Decimal128.fromString(bytes).bytes; + } + else if (isUint8Array(bytes)) { + if (bytes.byteLength !== 16) { + throw new BSONTypeError('Decimal128 must take a Buffer of 16 bytes'); + } + this.bytes = bytes; + } + else { + throw new BSONTypeError('Decimal128 must take a Buffer or string'); + } + } + /** + * Create a Decimal128 instance from a string representation + * + * @param representation - a numeric string representation. + */ + Decimal128.fromString = function (representation) { + // Parse state tracking + var isNegative = false; + var sawRadix = false; + var foundNonZero = false; + // Total number of significant digits (no leading or trailing zero) + var significantDigits = 0; + // Total number of significand digits read + var nDigitsRead = 0; + // Total number of digits (no leading zeros) + var nDigits = 0; + // The number of the digits after radix + var radixPosition = 0; + // The index of the first non-zero in *str* + var firstNonZero = 0; + // Digits Array + var digits = [0]; + // The number of digits in digits + var nDigitsStored = 0; + // Insertion pointer for digits + var digitsInsert = 0; + // The index of the first non-zero digit + var firstDigit = 0; + // The index of the last digit + var lastDigit = 0; + // Exponent + var exponent = 0; + // loop index over array + var i = 0; + // The high 17 digits of the significand + var significandHigh = new Long(0, 0); + // The low 17 digits of the significand + var significandLow = new Long(0, 0); + // The biased exponent + var biasedExponent = 0; + // Read index + var index = 0; + // Naively prevent against REDOS attacks. + // TODO: implementing a custom parsing for this, or refactoring the regex would yield + // further gains. + if (representation.length >= 7000) { + throw new BSONTypeError('' + representation + ' not a valid Decimal128 string'); + } + // Results + var stringMatch = representation.match(PARSE_STRING_REGEXP); + var infMatch = representation.match(PARSE_INF_REGEXP); + var nanMatch = representation.match(PARSE_NAN_REGEXP); + // Validate the string + if ((!stringMatch && !infMatch && !nanMatch) || representation.length === 0) { + throw new BSONTypeError('' + representation + ' not a valid Decimal128 string'); + } + if (stringMatch) { + // full_match = stringMatch[0] + // sign = stringMatch[1] + var unsignedNumber = stringMatch[2]; + // stringMatch[3] is undefined if a whole number (ex "1", 12") + // but defined if a number w/ decimal in it (ex "1.0, 12.2") + var e = stringMatch[4]; + var expSign = stringMatch[5]; + var expNumber = stringMatch[6]; + // they provided e, but didn't give an exponent number. for ex "1e" + if (e && expNumber === undefined) + invalidErr(representation, 'missing exponent power'); + // they provided e, but didn't give a number before it. for ex "e1" + if (e && unsignedNumber === undefined) + invalidErr(representation, 'missing exponent base'); + if (e === undefined && (expSign || expNumber)) { + invalidErr(representation, 'missing e before exponent'); + } + } + // Get the negative or positive sign + if (representation[index] === '+' || representation[index] === '-') { + isNegative = representation[index++] === '-'; + } + // Check if user passed Infinity or NaN + if (!isDigit(representation[index]) && representation[index] !== '.') { + if (representation[index] === 'i' || representation[index] === 'I') { + return new Decimal128(buffer_1.from(isNegative ? INF_NEGATIVE_BUFFER : INF_POSITIVE_BUFFER)); + } + else if (representation[index] === 'N') { + return new Decimal128(buffer_1.from(NAN_BUFFER)); + } + } + // Read all the digits + while (isDigit(representation[index]) || representation[index] === '.') { + if (representation[index] === '.') { + if (sawRadix) + invalidErr(representation, 'contains multiple periods'); + sawRadix = true; + index = index + 1; + continue; + } + if (nDigitsStored < 34) { + if (representation[index] !== '0' || foundNonZero) { + if (!foundNonZero) { + firstNonZero = nDigitsRead; + } + foundNonZero = true; + // Only store 34 digits + digits[digitsInsert++] = parseInt(representation[index], 10); + nDigitsStored = nDigitsStored + 1; + } + } + if (foundNonZero) + nDigits = nDigits + 1; + if (sawRadix) + radixPosition = radixPosition + 1; + nDigitsRead = nDigitsRead + 1; + index = index + 1; + } + if (sawRadix && !nDigitsRead) + throw new BSONTypeError('' + representation + ' not a valid Decimal128 string'); + // Read exponent if exists + if (representation[index] === 'e' || representation[index] === 'E') { + // Read exponent digits + var match = representation.substr(++index).match(EXPONENT_REGEX); + // No digits read + if (!match || !match[2]) + return new Decimal128(buffer_1.from(NAN_BUFFER)); + // Get exponent + exponent = parseInt(match[0], 10); + // Adjust the index + index = index + match[0].length; + } + // Return not a number + if (representation[index]) + return new Decimal128(buffer_1.from(NAN_BUFFER)); + // Done reading input + // Find first non-zero digit in digits + firstDigit = 0; + if (!nDigitsStored) { + firstDigit = 0; + lastDigit = 0; + digits[0] = 0; + nDigits = 1; + nDigitsStored = 1; + significantDigits = 0; + } + else { + lastDigit = nDigitsStored - 1; + significantDigits = nDigits; + if (significantDigits !== 1) { + while (digits[firstNonZero + significantDigits - 1] === 0) { + significantDigits = significantDigits - 1; + } + } + } + // Normalization of exponent + // Correct exponent based on radix position, and shift significand as needed + // to represent user input + // Overflow prevention + if (exponent <= radixPosition && radixPosition - exponent > 1 << 14) { + exponent = EXPONENT_MIN; + } + else { + exponent = exponent - radixPosition; + } + // Attempt to normalize the exponent + while (exponent > EXPONENT_MAX) { + // Shift exponent to significand and decrease + lastDigit = lastDigit + 1; + if (lastDigit - firstDigit > MAX_DIGITS) { + // Check if we have a zero then just hard clamp, otherwise fail + var digitsString = digits.join(''); + if (digitsString.match(/^0+$/)) { + exponent = EXPONENT_MAX; + break; + } + invalidErr(representation, 'overflow'); + } + exponent = exponent - 1; + } + while (exponent < EXPONENT_MIN || nDigitsStored < nDigits) { + // Shift last digit. can only do this if < significant digits than # stored. + if (lastDigit === 0 && significantDigits < nDigitsStored) { + exponent = EXPONENT_MIN; + significantDigits = 0; + break; + } + if (nDigitsStored < nDigits) { + // adjust to match digits not stored + nDigits = nDigits - 1; + } + else { + // adjust to round + lastDigit = lastDigit - 1; + } + if (exponent < EXPONENT_MAX) { + exponent = exponent + 1; + } + else { + // Check if we have a zero then just hard clamp, otherwise fail + var digitsString = digits.join(''); + if (digitsString.match(/^0+$/)) { + exponent = EXPONENT_MAX; + break; + } + invalidErr(representation, 'overflow'); + } + } + // Round + // We've normalized the exponent, but might still need to round. + if (lastDigit - firstDigit + 1 < significantDigits) { + var endOfString = nDigitsRead; + // If we have seen a radix point, 'string' is 1 longer than we have + // documented with ndigits_read, so inc the position of the first nonzero + // digit and the position that digits are read to. + if (sawRadix) { + firstNonZero = firstNonZero + 1; + endOfString = endOfString + 1; + } + // if negative, we need to increment again to account for - sign at start. + if (isNegative) { + firstNonZero = firstNonZero + 1; + endOfString = endOfString + 1; + } + var roundDigit = parseInt(representation[firstNonZero + lastDigit + 1], 10); + var roundBit = 0; + if (roundDigit >= 5) { + roundBit = 1; + if (roundDigit === 5) { + roundBit = digits[lastDigit] % 2 === 1 ? 1 : 0; + for (i = firstNonZero + lastDigit + 2; i < endOfString; i++) { + if (parseInt(representation[i], 10)) { + roundBit = 1; + break; + } + } + } + } + if (roundBit) { + var dIdx = lastDigit; + for (; dIdx >= 0; dIdx--) { + if (++digits[dIdx] > 9) { + digits[dIdx] = 0; + // overflowed most significant digit + if (dIdx === 0) { + if (exponent < EXPONENT_MAX) { + exponent = exponent + 1; + digits[dIdx] = 1; + } + else { + return new Decimal128(buffer_1.from(isNegative ? INF_NEGATIVE_BUFFER : INF_POSITIVE_BUFFER)); + } + } + } + } + } + } + // Encode significand + // The high 17 digits of the significand + significandHigh = Long.fromNumber(0); + // The low 17 digits of the significand + significandLow = Long.fromNumber(0); + // read a zero + if (significantDigits === 0) { + significandHigh = Long.fromNumber(0); + significandLow = Long.fromNumber(0); + } + else if (lastDigit - firstDigit < 17) { + var dIdx = firstDigit; + significandLow = Long.fromNumber(digits[dIdx++]); + significandHigh = new Long(0, 0); + for (; dIdx <= lastDigit; dIdx++) { + significandLow = significandLow.multiply(Long.fromNumber(10)); + significandLow = significandLow.add(Long.fromNumber(digits[dIdx])); + } + } + else { + var dIdx = firstDigit; + significandHigh = Long.fromNumber(digits[dIdx++]); + for (; dIdx <= lastDigit - 17; dIdx++) { + significandHigh = significandHigh.multiply(Long.fromNumber(10)); + significandHigh = significandHigh.add(Long.fromNumber(digits[dIdx])); + } + significandLow = Long.fromNumber(digits[dIdx++]); + for (; dIdx <= lastDigit; dIdx++) { + significandLow = significandLow.multiply(Long.fromNumber(10)); + significandLow = significandLow.add(Long.fromNumber(digits[dIdx])); + } + } + var significand = multiply64x2(significandHigh, Long.fromString('100000000000000000')); + significand.low = significand.low.add(significandLow); + if (lessThan(significand.low, significandLow)) { + significand.high = significand.high.add(Long.fromNumber(1)); + } + // Biased exponent + biasedExponent = exponent + EXPONENT_BIAS; + var dec = { low: Long.fromNumber(0), high: Long.fromNumber(0) }; + // Encode combination, exponent, and significand. + if (significand.high.shiftRightUnsigned(49).and(Long.fromNumber(1)).equals(Long.fromNumber(1))) { + // Encode '11' into bits 1 to 3 + dec.high = dec.high.or(Long.fromNumber(0x3).shiftLeft(61)); + dec.high = dec.high.or(Long.fromNumber(biasedExponent).and(Long.fromNumber(0x3fff).shiftLeft(47))); + dec.high = dec.high.or(significand.high.and(Long.fromNumber(0x7fffffffffff))); + } + else { + dec.high = dec.high.or(Long.fromNumber(biasedExponent & 0x3fff).shiftLeft(49)); + dec.high = dec.high.or(significand.high.and(Long.fromNumber(0x1ffffffffffff))); + } + dec.low = significand.low; + // Encode sign + if (isNegative) { + dec.high = dec.high.or(Long.fromString('9223372036854775808')); + } + // Encode into a buffer + var buffer = buffer_1.alloc(16); + index = 0; + // Encode the low 64 bits of the decimal + // Encode low bits + buffer[index++] = dec.low.low & 0xff; + buffer[index++] = (dec.low.low >> 8) & 0xff; + buffer[index++] = (dec.low.low >> 16) & 0xff; + buffer[index++] = (dec.low.low >> 24) & 0xff; + // Encode high bits + buffer[index++] = dec.low.high & 0xff; + buffer[index++] = (dec.low.high >> 8) & 0xff; + buffer[index++] = (dec.low.high >> 16) & 0xff; + buffer[index++] = (dec.low.high >> 24) & 0xff; + // Encode the high 64 bits of the decimal + // Encode low bits + buffer[index++] = dec.high.low & 0xff; + buffer[index++] = (dec.high.low >> 8) & 0xff; + buffer[index++] = (dec.high.low >> 16) & 0xff; + buffer[index++] = (dec.high.low >> 24) & 0xff; + // Encode high bits + buffer[index++] = dec.high.high & 0xff; + buffer[index++] = (dec.high.high >> 8) & 0xff; + buffer[index++] = (dec.high.high >> 16) & 0xff; + buffer[index++] = (dec.high.high >> 24) & 0xff; + // Return the new Decimal128 + return new Decimal128(buffer); + }; + /** Create a string representation of the raw Decimal128 value */ + Decimal128.prototype.toString = function () { + // Note: bits in this routine are referred to starting at 0, + // from the sign bit, towards the coefficient. + // decoded biased exponent (14 bits) + var biased_exponent; + // the number of significand digits + var significand_digits = 0; + // the base-10 digits in the significand + var significand = new Array(36); + for (var i = 0; i < significand.length; i++) + significand[i] = 0; + // read pointer into significand + var index = 0; + // true if the number is zero + var is_zero = false; + // the most significant significand bits (50-46) + var significand_msb; + // temporary storage for significand decoding + var significand128 = { parts: [0, 0, 0, 0] }; + // indexing variables + var j, k; + // Output string + var string = []; + // Unpack index + index = 0; + // Buffer reference + var buffer = this.bytes; + // Unpack the low 64bits into a long + // bits 96 - 127 + var low = buffer[index++] | (buffer[index++] << 8) | (buffer[index++] << 16) | (buffer[index++] << 24); + // bits 64 - 95 + var midl = buffer[index++] | (buffer[index++] << 8) | (buffer[index++] << 16) | (buffer[index++] << 24); + // Unpack the high 64bits into a long + // bits 32 - 63 + var midh = buffer[index++] | (buffer[index++] << 8) | (buffer[index++] << 16) | (buffer[index++] << 24); + // bits 0 - 31 + var high = buffer[index++] | (buffer[index++] << 8) | (buffer[index++] << 16) | (buffer[index++] << 24); + // Unpack index + index = 0; + // Create the state of the decimal + var dec = { + low: new Long(low, midl), + high: new Long(midh, high) + }; + if (dec.high.lessThan(Long.ZERO)) { + string.push('-'); + } + // Decode combination field and exponent + // bits 1 - 5 + var combination = (high >> 26) & COMBINATION_MASK; + if (combination >> 3 === 3) { + // Check for 'special' values + if (combination === COMBINATION_INFINITY) { + return string.join('') + 'Infinity'; + } + else if (combination === COMBINATION_NAN) { + return 'NaN'; + } + else { + biased_exponent = (high >> 15) & EXPONENT_MASK; + significand_msb = 0x08 + ((high >> 14) & 0x01); + } + } + else { + significand_msb = (high >> 14) & 0x07; + biased_exponent = (high >> 17) & EXPONENT_MASK; + } + // unbiased exponent + var exponent = biased_exponent - EXPONENT_BIAS; + // Create string of significand digits + // Convert the 114-bit binary number represented by + // (significand_high, significand_low) to at most 34 decimal + // digits through modulo and division. + significand128.parts[0] = (high & 0x3fff) + ((significand_msb & 0xf) << 14); + significand128.parts[1] = midh; + significand128.parts[2] = midl; + significand128.parts[3] = low; + if (significand128.parts[0] === 0 && + significand128.parts[1] === 0 && + significand128.parts[2] === 0 && + significand128.parts[3] === 0) { + is_zero = true; + } + else { + for (k = 3; k >= 0; k--) { + var least_digits = 0; + // Perform the divide + var result = divideu128(significand128); + significand128 = result.quotient; + least_digits = result.rem.low; + // We now have the 9 least significant digits (in base 2). + // Convert and output to string. + if (!least_digits) + continue; + for (j = 8; j >= 0; j--) { + // significand[k * 9 + j] = Math.round(least_digits % 10); + significand[k * 9 + j] = least_digits % 10; + // least_digits = Math.round(least_digits / 10); + least_digits = Math.floor(least_digits / 10); + } + } + } + // Output format options: + // Scientific - [-]d.dddE(+/-)dd or [-]dE(+/-)dd + // Regular - ddd.ddd + if (is_zero) { + significand_digits = 1; + significand[index] = 0; + } + else { + significand_digits = 36; + while (!significand[index]) { + significand_digits = significand_digits - 1; + index = index + 1; + } + } + // the exponent if scientific notation is used + var scientific_exponent = significand_digits - 1 + exponent; + // The scientific exponent checks are dictated by the string conversion + // specification and are somewhat arbitrary cutoffs. + // + // We must check exponent > 0, because if this is the case, the number + // has trailing zeros. However, we *cannot* output these trailing zeros, + // because doing so would change the precision of the value, and would + // change stored data if the string converted number is round tripped. + if (scientific_exponent >= 34 || scientific_exponent <= -7 || exponent > 0) { + // Scientific format + // if there are too many significant digits, we should just be treating numbers + // as + or - 0 and using the non-scientific exponent (this is for the "invalid + // representation should be treated as 0/-0" spec cases in decimal128-1.json) + if (significand_digits > 34) { + string.push("" + 0); + if (exponent > 0) + string.push('E+' + exponent); + else if (exponent < 0) + string.push('E' + exponent); + return string.join(''); + } + string.push("" + significand[index++]); + significand_digits = significand_digits - 1; + if (significand_digits) { + string.push('.'); + } + for (var i = 0; i < significand_digits; i++) { + string.push("" + significand[index++]); + } + // Exponent + string.push('E'); + if (scientific_exponent > 0) { + string.push('+' + scientific_exponent); + } + else { + string.push("" + scientific_exponent); + } + } + else { + // Regular format with no decimal place + if (exponent >= 0) { + for (var i = 0; i < significand_digits; i++) { + string.push("" + significand[index++]); + } + } + else { + var radix_position = significand_digits + exponent; + // non-zero digits before radix + if (radix_position > 0) { + for (var i = 0; i < radix_position; i++) { + string.push("" + significand[index++]); + } + } + else { + string.push('0'); + } + string.push('.'); + // add leading zeros after radix + while (radix_position++ < 0) { + string.push('0'); + } + for (var i = 0; i < significand_digits - Math.max(radix_position - 1, 0); i++) { + string.push("" + significand[index++]); + } + } + } + return string.join(''); + }; + Decimal128.prototype.toJSON = function () { + return { $numberDecimal: this.toString() }; + }; + /** @internal */ + Decimal128.prototype.toExtendedJSON = function () { + return { $numberDecimal: this.toString() }; + }; + /** @internal */ + Decimal128.fromExtendedJSON = function (doc) { + return Decimal128.fromString(doc.$numberDecimal); + }; + /** @internal */ + Decimal128.prototype[Symbol.for('nodejs.util.inspect.custom')] = function () { + return this.inspect(); + }; + Decimal128.prototype.inspect = function () { + return "new Decimal128(\"" + this.toString() + "\")"; + }; + return Decimal128; + }()); + Object.defineProperty(Decimal128.prototype, '_bsontype', { value: 'Decimal128' }); + + /** + * A class representation of the BSON Double type. + * @public + * @category BSONType + */ + var Double = /** @class */ (function () { + /** + * Create a Double type + * + * @param value - the number we want to represent as a double. + */ + function Double(value) { + if (!(this instanceof Double)) + return new Double(value); + if (value instanceof Number) { + value = value.valueOf(); + } + this.value = +value; + } + /** + * Access the number value. + * + * @returns returns the wrapped double number. + */ + Double.prototype.valueOf = function () { + return this.value; + }; + Double.prototype.toJSON = function () { + return this.value; + }; + Double.prototype.toString = function (radix) { + return this.value.toString(radix); + }; + /** @internal */ + Double.prototype.toExtendedJSON = function (options) { + if (options && (options.legacy || (options.relaxed && isFinite(this.value)))) { + return this.value; + } + // NOTE: JavaScript has +0 and -0, apparently to model limit calculations. If a user + // explicitly provided `-0` then we need to ensure the sign makes it into the output + if (Object.is(Math.sign(this.value), -0)) { + return { $numberDouble: "-" + this.value.toFixed(1) }; + } + var $numberDouble; + if (Number.isInteger(this.value)) { + $numberDouble = this.value.toFixed(1); + if ($numberDouble.length >= 13) { + $numberDouble = this.value.toExponential(13).toUpperCase(); + } + } + else { + $numberDouble = this.value.toString(); + } + return { $numberDouble: $numberDouble }; + }; + /** @internal */ + Double.fromExtendedJSON = function (doc, options) { + var doubleValue = parseFloat(doc.$numberDouble); + return options && options.relaxed ? doubleValue : new Double(doubleValue); + }; + /** @internal */ + Double.prototype[Symbol.for('nodejs.util.inspect.custom')] = function () { + return this.inspect(); + }; + Double.prototype.inspect = function () { + var eJSON = this.toExtendedJSON(); + return "new Double(" + eJSON.$numberDouble + ")"; + }; + return Double; + }()); + Object.defineProperty(Double.prototype, '_bsontype', { value: 'Double' }); + + /** + * A class representation of a BSON Int32 type. + * @public + * @category BSONType + */ + var Int32 = /** @class */ (function () { + /** + * Create an Int32 type + * + * @param value - the number we want to represent as an int32. + */ + function Int32(value) { + if (!(this instanceof Int32)) + return new Int32(value); + if (value instanceof Number) { + value = value.valueOf(); + } + this.value = +value | 0; + } + /** + * Access the number value. + * + * @returns returns the wrapped int32 number. + */ + Int32.prototype.valueOf = function () { + return this.value; + }; + Int32.prototype.toString = function (radix) { + return this.value.toString(radix); + }; + Int32.prototype.toJSON = function () { + return this.value; + }; + /** @internal */ + Int32.prototype.toExtendedJSON = function (options) { + if (options && (options.relaxed || options.legacy)) + return this.value; + return { $numberInt: this.value.toString() }; + }; + /** @internal */ + Int32.fromExtendedJSON = function (doc, options) { + return options && options.relaxed ? parseInt(doc.$numberInt, 10) : new Int32(doc.$numberInt); + }; + /** @internal */ + Int32.prototype[Symbol.for('nodejs.util.inspect.custom')] = function () { + return this.inspect(); + }; + Int32.prototype.inspect = function () { + return "new Int32(" + this.valueOf() + ")"; + }; + return Int32; + }()); + Object.defineProperty(Int32.prototype, '_bsontype', { value: 'Int32' }); + + /** + * A class representation of the BSON MaxKey type. + * @public + * @category BSONType + */ + var MaxKey = /** @class */ (function () { + function MaxKey() { + if (!(this instanceof MaxKey)) + return new MaxKey(); + } + /** @internal */ + MaxKey.prototype.toExtendedJSON = function () { + return { $maxKey: 1 }; + }; + /** @internal */ + MaxKey.fromExtendedJSON = function () { + return new MaxKey(); + }; + /** @internal */ + MaxKey.prototype[Symbol.for('nodejs.util.inspect.custom')] = function () { + return this.inspect(); + }; + MaxKey.prototype.inspect = function () { + return 'new MaxKey()'; + }; + return MaxKey; + }()); + Object.defineProperty(MaxKey.prototype, '_bsontype', { value: 'MaxKey' }); + + /** + * A class representation of the BSON MinKey type. + * @public + * @category BSONType + */ + var MinKey = /** @class */ (function () { + function MinKey() { + if (!(this instanceof MinKey)) + return new MinKey(); + } + /** @internal */ + MinKey.prototype.toExtendedJSON = function () { + return { $minKey: 1 }; + }; + /** @internal */ + MinKey.fromExtendedJSON = function () { + return new MinKey(); + }; + /** @internal */ + MinKey.prototype[Symbol.for('nodejs.util.inspect.custom')] = function () { + return this.inspect(); + }; + MinKey.prototype.inspect = function () { + return 'new MinKey()'; + }; + return MinKey; + }()); + Object.defineProperty(MinKey.prototype, '_bsontype', { value: 'MinKey' }); + + // Regular expression that checks for hex value + var checkForHexRegExp = new RegExp('^[0-9a-fA-F]{24}$'); + // Unique sequence for the current process (initialized on first use) + var PROCESS_UNIQUE = null; + var kId = Symbol('id'); + /** + * A class representation of the BSON ObjectId type. + * @public + * @category BSONType + */ + var ObjectId = /** @class */ (function () { + /** + * Create an ObjectId type + * + * @param inputId - Can be a 24 character hex string, 12 byte binary Buffer, or a number. + */ + function ObjectId(inputId) { + if (!(this instanceof ObjectId)) + return new ObjectId(inputId); + // workingId is set based on type of input and whether valid id exists for the input + var workingId; + if (typeof inputId === 'object' && inputId && 'id' in inputId) { + if (typeof inputId.id !== 'string' && !ArrayBuffer.isView(inputId.id)) { + throw new BSONTypeError('Argument passed in must have an id that is of type string or Buffer'); + } + if ('toHexString' in inputId && typeof inputId.toHexString === 'function') { + workingId = buffer_1.from(inputId.toHexString(), 'hex'); + } + else { + workingId = inputId.id; + } + } + else { + workingId = inputId; + } + // the following cases use workingId to construct an ObjectId + if (workingId == null || typeof workingId === 'number') { + // The most common use case (blank id, new objectId instance) + // Generate a new id + this[kId] = ObjectId.generate(typeof workingId === 'number' ? workingId : undefined); + } + else if (ArrayBuffer.isView(workingId) && workingId.byteLength === 12) { + // If intstanceof matches we can escape calling ensure buffer in Node.js environments + this[kId] = workingId instanceof buffer_1 ? workingId : ensureBuffer(workingId); + } + else if (typeof workingId === 'string') { + if (workingId.length === 12) { + var bytes = buffer_1.from(workingId); + if (bytes.byteLength === 12) { + this[kId] = bytes; + } + else { + throw new BSONTypeError('Argument passed in must be a string of 12 bytes'); + } + } + else if (workingId.length === 24 && checkForHexRegExp.test(workingId)) { + this[kId] = buffer_1.from(workingId, 'hex'); + } + else { + throw new BSONTypeError('Argument passed in must be a string of 12 bytes or a string of 24 hex characters or an integer'); + } + } + else { + throw new BSONTypeError('Argument passed in does not match the accepted types'); + } + // If we are caching the hex string + if (ObjectId.cacheHexString) { + this.__id = this.id.toString('hex'); + } + } + Object.defineProperty(ObjectId.prototype, "id", { + /** + * The ObjectId bytes + * @readonly + */ + get: function () { + return this[kId]; + }, + set: function (value) { + this[kId] = value; + if (ObjectId.cacheHexString) { + this.__id = value.toString('hex'); + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(ObjectId.prototype, "generationTime", { + /** + * The generation time of this ObjectId instance + * @deprecated Please use getTimestamp / createFromTime which returns an int32 epoch + */ + get: function () { + return this.id.readInt32BE(0); + }, + set: function (value) { + // Encode time into first 4 bytes + this.id.writeUInt32BE(value, 0); + }, + enumerable: false, + configurable: true + }); + /** Returns the ObjectId id as a 24 character hex string representation */ + ObjectId.prototype.toHexString = function () { + if (ObjectId.cacheHexString && this.__id) { + return this.__id; + } + var hexString = this.id.toString('hex'); + if (ObjectId.cacheHexString && !this.__id) { + this.__id = hexString; + } + return hexString; + }; + /** + * Update the ObjectId index + * @privateRemarks + * Used in generating new ObjectId's on the driver + * @internal + */ + ObjectId.getInc = function () { + return (ObjectId.index = (ObjectId.index + 1) % 0xffffff); + }; + /** + * Generate a 12 byte id buffer used in ObjectId's + * + * @param time - pass in a second based timestamp. + */ + ObjectId.generate = function (time) { + if ('number' !== typeof time) { + time = Math.floor(Date.now() / 1000); + } + var inc = ObjectId.getInc(); + var buffer = buffer_1.alloc(12); + // 4-byte timestamp + buffer.writeUInt32BE(time, 0); + // set PROCESS_UNIQUE if yet not initialized + if (PROCESS_UNIQUE === null) { + PROCESS_UNIQUE = randomBytes(5); + } + // 5-byte process unique + buffer[4] = PROCESS_UNIQUE[0]; + buffer[5] = PROCESS_UNIQUE[1]; + buffer[6] = PROCESS_UNIQUE[2]; + buffer[7] = PROCESS_UNIQUE[3]; + buffer[8] = PROCESS_UNIQUE[4]; + // 3-byte counter + buffer[11] = inc & 0xff; + buffer[10] = (inc >> 8) & 0xff; + buffer[9] = (inc >> 16) & 0xff; + return buffer; + }; + /** + * Converts the id into a 24 character hex string for printing + * + * @param format - The Buffer toString format parameter. + */ + ObjectId.prototype.toString = function (format) { + // Is the id a buffer then use the buffer toString method to return the format + if (format) + return this.id.toString(format); + return this.toHexString(); + }; + /** Converts to its JSON the 24 character hex string representation. */ + ObjectId.prototype.toJSON = function () { + return this.toHexString(); + }; + /** + * Compares the equality of this ObjectId with `otherID`. + * + * @param otherId - ObjectId instance to compare against. + */ + ObjectId.prototype.equals = function (otherId) { + if (otherId === undefined || otherId === null) { + return false; + } + if (otherId instanceof ObjectId) { + return this[kId][11] === otherId[kId][11] && this[kId].equals(otherId[kId]); + } + if (typeof otherId === 'string' && + ObjectId.isValid(otherId) && + otherId.length === 12 && + isUint8Array(this.id)) { + return otherId === buffer_1.prototype.toString.call(this.id, 'latin1'); + } + if (typeof otherId === 'string' && ObjectId.isValid(otherId) && otherId.length === 24) { + return otherId.toLowerCase() === this.toHexString(); + } + if (typeof otherId === 'string' && ObjectId.isValid(otherId) && otherId.length === 12) { + return buffer_1.from(otherId).equals(this.id); + } + if (typeof otherId === 'object' && + 'toHexString' in otherId && + typeof otherId.toHexString === 'function') { + var otherIdString = otherId.toHexString(); + var thisIdString = this.toHexString().toLowerCase(); + return typeof otherIdString === 'string' && otherIdString.toLowerCase() === thisIdString; + } + return false; + }; + /** Returns the generation date (accurate up to the second) that this ID was generated. */ + ObjectId.prototype.getTimestamp = function () { + var timestamp = new Date(); + var time = this.id.readUInt32BE(0); + timestamp.setTime(Math.floor(time) * 1000); + return timestamp; + }; + /** @internal */ + ObjectId.createPk = function () { + return new ObjectId(); + }; + /** + * Creates an ObjectId from a second based number, with the rest of the ObjectId zeroed out. Used for comparisons or sorting the ObjectId. + * + * @param time - an integer number representing a number of seconds. + */ + ObjectId.createFromTime = function (time) { + var buffer = buffer_1.from([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]); + // Encode time into first 4 bytes + buffer.writeUInt32BE(time, 0); + // Return the new objectId + return new ObjectId(buffer); + }; + /** + * Creates an ObjectId from a hex string representation of an ObjectId. + * + * @param hexString - create a ObjectId from a passed in 24 character hexstring. + */ + ObjectId.createFromHexString = function (hexString) { + // Throw an error if it's not a valid setup + if (typeof hexString === 'undefined' || (hexString != null && hexString.length !== 24)) { + throw new BSONTypeError('Argument passed in must be a single String of 12 bytes or a string of 24 hex characters'); + } + return new ObjectId(buffer_1.from(hexString, 'hex')); + }; + /** + * Checks if a value is a valid bson ObjectId + * + * @param id - ObjectId instance to validate. + */ + ObjectId.isValid = function (id) { + if (id == null) + return false; + try { + new ObjectId(id); + return true; + } + catch (_a) { + return false; + } + }; + /** @internal */ + ObjectId.prototype.toExtendedJSON = function () { + if (this.toHexString) + return { $oid: this.toHexString() }; + return { $oid: this.toString('hex') }; + }; + /** @internal */ + ObjectId.fromExtendedJSON = function (doc) { + return new ObjectId(doc.$oid); + }; + /** + * Converts to a string representation of this Id. + * + * @returns return the 24 character hex string representation. + * @internal + */ + ObjectId.prototype[Symbol.for('nodejs.util.inspect.custom')] = function () { + return this.inspect(); + }; + ObjectId.prototype.inspect = function () { + return "new ObjectId(\"" + this.toHexString() + "\")"; + }; + /** @internal */ + ObjectId.index = Math.floor(Math.random() * 0xffffff); + return ObjectId; + }()); + // Deprecated methods + Object.defineProperty(ObjectId.prototype, 'generate', { + value: deprecate(function (time) { return ObjectId.generate(time); }, 'Please use the static `ObjectId.generate(time)` instead') + }); + Object.defineProperty(ObjectId.prototype, 'getInc', { + value: deprecate(function () { return ObjectId.getInc(); }, 'Please use the static `ObjectId.getInc()` instead') + }); + Object.defineProperty(ObjectId.prototype, 'get_inc', { + value: deprecate(function () { return ObjectId.getInc(); }, 'Please use the static `ObjectId.getInc()` instead') + }); + Object.defineProperty(ObjectId, 'get_inc', { + value: deprecate(function () { return ObjectId.getInc(); }, 'Please use the static `ObjectId.getInc()` instead') + }); + Object.defineProperty(ObjectId.prototype, '_bsontype', { value: 'ObjectID' }); + + function alphabetize(str) { + return str.split('').sort().join(''); + } + /** + * A class representation of the BSON RegExp type. + * @public + * @category BSONType + */ + var BSONRegExp = /** @class */ (function () { + /** + * @param pattern - The regular expression pattern to match + * @param options - The regular expression options + */ + function BSONRegExp(pattern, options) { + if (!(this instanceof BSONRegExp)) + return new BSONRegExp(pattern, options); + this.pattern = pattern; + this.options = alphabetize(options !== null && options !== void 0 ? options : ''); + if (this.pattern.indexOf('\x00') !== -1) { + throw new BSONError("BSON Regex patterns cannot contain null bytes, found: " + JSON.stringify(this.pattern)); + } + if (this.options.indexOf('\x00') !== -1) { + throw new BSONError("BSON Regex options cannot contain null bytes, found: " + JSON.stringify(this.options)); + } + // Validate options + for (var i = 0; i < this.options.length; i++) { + if (!(this.options[i] === 'i' || + this.options[i] === 'm' || + this.options[i] === 'x' || + this.options[i] === 'l' || + this.options[i] === 's' || + this.options[i] === 'u')) { + throw new BSONError("The regular expression option [" + this.options[i] + "] is not supported"); + } + } + } + BSONRegExp.parseOptions = function (options) { + return options ? options.split('').sort().join('') : ''; + }; + /** @internal */ + BSONRegExp.prototype.toExtendedJSON = function (options) { + options = options || {}; + if (options.legacy) { + return { $regex: this.pattern, $options: this.options }; + } + return { $regularExpression: { pattern: this.pattern, options: this.options } }; + }; + /** @internal */ + BSONRegExp.fromExtendedJSON = function (doc) { + if ('$regex' in doc) { + if (typeof doc.$regex !== 'string') { + // This is for $regex query operators that have extended json values. + if (doc.$regex._bsontype === 'BSONRegExp') { + return doc; + } + } + else { + return new BSONRegExp(doc.$regex, BSONRegExp.parseOptions(doc.$options)); + } + } + if ('$regularExpression' in doc) { + return new BSONRegExp(doc.$regularExpression.pattern, BSONRegExp.parseOptions(doc.$regularExpression.options)); + } + throw new BSONTypeError("Unexpected BSONRegExp EJSON object form: " + JSON.stringify(doc)); + }; + return BSONRegExp; + }()); + Object.defineProperty(BSONRegExp.prototype, '_bsontype', { value: 'BSONRegExp' }); + + /** + * A class representation of the BSON Symbol type. + * @public + * @category BSONType + */ + var BSONSymbol = /** @class */ (function () { + /** + * @param value - the string representing the symbol. + */ + function BSONSymbol(value) { + if (!(this instanceof BSONSymbol)) + return new BSONSymbol(value); + this.value = value; + } + /** Access the wrapped string value. */ + BSONSymbol.prototype.valueOf = function () { + return this.value; + }; + BSONSymbol.prototype.toString = function () { + return this.value; + }; + /** @internal */ + BSONSymbol.prototype.inspect = function () { + return "new BSONSymbol(\"" + this.value + "\")"; + }; + BSONSymbol.prototype.toJSON = function () { + return this.value; + }; + /** @internal */ + BSONSymbol.prototype.toExtendedJSON = function () { + return { $symbol: this.value }; + }; + /** @internal */ + BSONSymbol.fromExtendedJSON = function (doc) { + return new BSONSymbol(doc.$symbol); + }; + /** @internal */ + BSONSymbol.prototype[Symbol.for('nodejs.util.inspect.custom')] = function () { + return this.inspect(); + }; + return BSONSymbol; + }()); + Object.defineProperty(BSONSymbol.prototype, '_bsontype', { value: 'Symbol' }); + + /** @public */ + var LongWithoutOverridesClass = Long; + /** + * @public + * @category BSONType + * */ + var Timestamp = /** @class */ (function (_super) { + __extends(Timestamp, _super); + function Timestamp(low, high) { + var _this = this; + // eslint-disable-next-line @typescript-eslint/ban-ts-comment + ///@ts-expect-error + if (!(_this instanceof Timestamp)) + return new Timestamp(low, high); + if (Long.isLong(low)) { + _this = _super.call(this, low.low, low.high, true) || this; + } + else if (isObjectLike(low) && typeof low.t !== 'undefined' && typeof low.i !== 'undefined') { + _this = _super.call(this, low.i, low.t, true) || this; + } + else { + _this = _super.call(this, low, high, true) || this; + } + Object.defineProperty(_this, '_bsontype', { + value: 'Timestamp', + writable: false, + configurable: false, + enumerable: false + }); + return _this; + } + Timestamp.prototype.toJSON = function () { + return { + $timestamp: this.toString() + }; + }; + /** Returns a Timestamp represented by the given (32-bit) integer value. */ + Timestamp.fromInt = function (value) { + return new Timestamp(Long.fromInt(value, true)); + }; + /** Returns a Timestamp representing the given number value, provided that it is a finite number. Otherwise, zero is returned. */ + Timestamp.fromNumber = function (value) { + return new Timestamp(Long.fromNumber(value, true)); + }; + /** + * Returns a Timestamp for the given high and low bits. Each is assumed to use 32 bits. + * + * @param lowBits - the low 32-bits. + * @param highBits - the high 32-bits. + */ + Timestamp.fromBits = function (lowBits, highBits) { + return new Timestamp(lowBits, highBits); + }; + /** + * Returns a Timestamp from the given string, optionally using the given radix. + * + * @param str - the textual representation of the Timestamp. + * @param optRadix - the radix in which the text is written. + */ + Timestamp.fromString = function (str, optRadix) { + return new Timestamp(Long.fromString(str, true, optRadix)); + }; + /** @internal */ + Timestamp.prototype.toExtendedJSON = function () { + return { $timestamp: { t: this.high >>> 0, i: this.low >>> 0 } }; + }; + /** @internal */ + Timestamp.fromExtendedJSON = function (doc) { + return new Timestamp(doc.$timestamp); + }; + /** @internal */ + Timestamp.prototype[Symbol.for('nodejs.util.inspect.custom')] = function () { + return this.inspect(); + }; + Timestamp.prototype.inspect = function () { + return "new Timestamp({ t: " + this.getHighBits() + ", i: " + this.getLowBits() + " })"; + }; + Timestamp.MAX_VALUE = Long.MAX_UNSIGNED_VALUE; + return Timestamp; + }(LongWithoutOverridesClass)); + + function isBSONType(value) { + return (isObjectLike(value) && Reflect.has(value, '_bsontype') && typeof value._bsontype === 'string'); + } + // INT32 boundaries + var BSON_INT32_MAX$1 = 0x7fffffff; + var BSON_INT32_MIN$1 = -0x80000000; + // INT64 boundaries + var BSON_INT64_MAX$1 = 0x7fffffffffffffff; + var BSON_INT64_MIN$1 = -0x8000000000000000; + // all the types where we don't need to do any special processing and can just pass the EJSON + //straight to type.fromExtendedJSON + var keysToCodecs = { + $oid: ObjectId, + $binary: Binary, + $uuid: Binary, + $symbol: BSONSymbol, + $numberInt: Int32, + $numberDecimal: Decimal128, + $numberDouble: Double, + $numberLong: Long, + $minKey: MinKey, + $maxKey: MaxKey, + $regex: BSONRegExp, + $regularExpression: BSONRegExp, + $timestamp: Timestamp + }; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + function deserializeValue(value, options) { + if (options === void 0) { options = {}; } + if (typeof value === 'number') { + if (options.relaxed || options.legacy) { + return value; + } + // if it's an integer, should interpret as smallest BSON integer + // that can represent it exactly. (if out of range, interpret as double.) + if (Math.floor(value) === value) { + if (value >= BSON_INT32_MIN$1 && value <= BSON_INT32_MAX$1) + return new Int32(value); + if (value >= BSON_INT64_MIN$1 && value <= BSON_INT64_MAX$1) + return Long.fromNumber(value); + } + // If the number is a non-integer or out of integer range, should interpret as BSON Double. + return new Double(value); + } + // from here on out we're looking for bson types, so bail if its not an object + if (value == null || typeof value !== 'object') + return value; + // upgrade deprecated undefined to null + if (value.$undefined) + return null; + var keys = Object.keys(value).filter(function (k) { return k.startsWith('$') && value[k] != null; }); + for (var i = 0; i < keys.length; i++) { + var c = keysToCodecs[keys[i]]; + if (c) + return c.fromExtendedJSON(value, options); + } + if (value.$date != null) { + var d = value.$date; + var date = new Date(); + if (options.legacy) { + if (typeof d === 'number') + date.setTime(d); + else if (typeof d === 'string') + date.setTime(Date.parse(d)); + } + else { + if (typeof d === 'string') + date.setTime(Date.parse(d)); + else if (Long.isLong(d)) + date.setTime(d.toNumber()); + else if (typeof d === 'number' && options.relaxed) + date.setTime(d); + } + return date; + } + if (value.$code != null) { + var copy = Object.assign({}, value); + if (value.$scope) { + copy.$scope = deserializeValue(value.$scope); + } + return Code.fromExtendedJSON(value); + } + if (isDBRefLike(value) || value.$dbPointer) { + var v = value.$ref ? value : value.$dbPointer; + // we run into this in a "degenerate EJSON" case (with $id and $ref order flipped) + // because of the order JSON.parse goes through the document + if (v instanceof DBRef) + return v; + var dollarKeys = Object.keys(v).filter(function (k) { return k.startsWith('$'); }); + var valid_1 = true; + dollarKeys.forEach(function (k) { + if (['$ref', '$id', '$db'].indexOf(k) === -1) + valid_1 = false; + }); + // only make DBRef if $ keys are all valid + if (valid_1) + return DBRef.fromExtendedJSON(v); + } + return value; + } + // eslint-disable-next-line @typescript-eslint/no-explicit-any + function serializeArray(array, options) { + return array.map(function (v, index) { + options.seenObjects.push({ propertyName: "index " + index, obj: null }); + try { + return serializeValue(v, options); + } + finally { + options.seenObjects.pop(); + } + }); + } + function getISOString(date) { + var isoStr = date.toISOString(); + // we should only show milliseconds in timestamp if they're non-zero + return date.getUTCMilliseconds() !== 0 ? isoStr : isoStr.slice(0, -5) + 'Z'; + } + // eslint-disable-next-line @typescript-eslint/no-explicit-any + function serializeValue(value, options) { + if ((typeof value === 'object' || typeof value === 'function') && value !== null) { + var index = options.seenObjects.findIndex(function (entry) { return entry.obj === value; }); + if (index !== -1) { + var props = options.seenObjects.map(function (entry) { return entry.propertyName; }); + var leadingPart = props + .slice(0, index) + .map(function (prop) { return prop + " -> "; }) + .join(''); + var alreadySeen = props[index]; + var circularPart = ' -> ' + + props + .slice(index + 1, props.length - 1) + .map(function (prop) { return prop + " -> "; }) + .join(''); + var current = props[props.length - 1]; + var leadingSpace = ' '.repeat(leadingPart.length + alreadySeen.length / 2); + var dashes = '-'.repeat(circularPart.length + (alreadySeen.length + current.length) / 2 - 1); + throw new BSONTypeError('Converting circular structure to EJSON:\n' + + (" " + leadingPart + alreadySeen + circularPart + current + "\n") + + (" " + leadingSpace + "\\" + dashes + "/")); + } + options.seenObjects[options.seenObjects.length - 1].obj = value; + } + if (Array.isArray(value)) + return serializeArray(value, options); + if (value === undefined) + return null; + if (value instanceof Date || isDate(value)) { + var dateNum = value.getTime(), + // is it in year range 1970-9999? + inRange = dateNum > -1 && dateNum < 253402318800000; + if (options.legacy) { + return options.relaxed && inRange + ? { $date: value.getTime() } + : { $date: getISOString(value) }; + } + return options.relaxed && inRange + ? { $date: getISOString(value) } + : { $date: { $numberLong: value.getTime().toString() } }; + } + if (typeof value === 'number' && (!options.relaxed || !isFinite(value))) { + // it's an integer + if (Math.floor(value) === value) { + var int32Range = value >= BSON_INT32_MIN$1 && value <= BSON_INT32_MAX$1, int64Range = value >= BSON_INT64_MIN$1 && value <= BSON_INT64_MAX$1; + // interpret as being of the smallest BSON integer type that can represent the number exactly + if (int32Range) + return { $numberInt: value.toString() }; + if (int64Range) + return { $numberLong: value.toString() }; + } + return { $numberDouble: value.toString() }; + } + if (value instanceof RegExp || isRegExp(value)) { + var flags = value.flags; + if (flags === undefined) { + var match = value.toString().match(/[gimuy]*$/); + if (match) { + flags = match[0]; + } + } + var rx = new BSONRegExp(value.source, flags); + return rx.toExtendedJSON(options); + } + if (value != null && typeof value === 'object') + return serializeDocument(value, options); + return value; + } + var BSON_TYPE_MAPPINGS = { + Binary: function (o) { return new Binary(o.value(), o.sub_type); }, + Code: function (o) { return new Code(o.code, o.scope); }, + DBRef: function (o) { return new DBRef(o.collection || o.namespace, o.oid, o.db, o.fields); }, + Decimal128: function (o) { return new Decimal128(o.bytes); }, + Double: function (o) { return new Double(o.value); }, + Int32: function (o) { return new Int32(o.value); }, + Long: function (o) { + return Long.fromBits( + // underscore variants for 1.x backwards compatibility + o.low != null ? o.low : o.low_, o.low != null ? o.high : o.high_, o.low != null ? o.unsigned : o.unsigned_); + }, + MaxKey: function () { return new MaxKey(); }, + MinKey: function () { return new MinKey(); }, + ObjectID: function (o) { return new ObjectId(o); }, + ObjectId: function (o) { return new ObjectId(o); }, + BSONRegExp: function (o) { return new BSONRegExp(o.pattern, o.options); }, + Symbol: function (o) { return new BSONSymbol(o.value); }, + Timestamp: function (o) { return Timestamp.fromBits(o.low, o.high); } + }; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + function serializeDocument(doc, options) { + if (doc == null || typeof doc !== 'object') + throw new BSONError('not an object instance'); + var bsontype = doc._bsontype; + if (typeof bsontype === 'undefined') { + // It's a regular object. Recursively serialize its property values. + var _doc = {}; + for (var name in doc) { + options.seenObjects.push({ propertyName: name, obj: null }); + try { + _doc[name] = serializeValue(doc[name], options); + } + finally { + options.seenObjects.pop(); + } + } + return _doc; + } + else if (isBSONType(doc)) { + // the "document" is really just a BSON type object + // eslint-disable-next-line @typescript-eslint/no-explicit-any + var outDoc = doc; + if (typeof outDoc.toExtendedJSON !== 'function') { + // There's no EJSON serialization function on the object. It's probably an + // object created by a previous version of this library (or another library) + // that's duck-typing objects to look like they were generated by this library). + // Copy the object into this library's version of that type. + var mapper = BSON_TYPE_MAPPINGS[doc._bsontype]; + if (!mapper) { + throw new BSONTypeError('Unrecognized or invalid _bsontype: ' + doc._bsontype); + } + outDoc = mapper(outDoc); + } + // Two BSON types may have nested objects that may need to be serialized too + if (bsontype === 'Code' && outDoc.scope) { + outDoc = new Code(outDoc.code, serializeValue(outDoc.scope, options)); + } + else if (bsontype === 'DBRef' && outDoc.oid) { + outDoc = new DBRef(serializeValue(outDoc.collection, options), serializeValue(outDoc.oid, options), serializeValue(outDoc.db, options), serializeValue(outDoc.fields, options)); + } + return outDoc.toExtendedJSON(options); + } + else { + throw new BSONError('_bsontype must be a string, but was: ' + typeof bsontype); + } + } + /** + * EJSON parse / stringify API + * @public + */ + // the namespace here is used to emulate `export * as EJSON from '...'` + // which as of now (sept 2020) api-extractor does not support + // eslint-disable-next-line @typescript-eslint/no-namespace + exports.EJSON = void 0; + (function (EJSON) { + /** + * Parse an Extended JSON string, constructing the JavaScript value or object described by that + * string. + * + * @example + * ```js + * const { EJSON } = require('bson'); + * const text = '{ "int32": { "$numberInt": "10" } }'; + * + * // prints { int32: { [String: '10'] _bsontype: 'Int32', value: '10' } } + * console.log(EJSON.parse(text, { relaxed: false })); + * + * // prints { int32: 10 } + * console.log(EJSON.parse(text)); + * ``` + */ + function parse(text, options) { + var finalOptions = Object.assign({}, { relaxed: true, legacy: false }, options); + // relaxed implies not strict + if (typeof finalOptions.relaxed === 'boolean') + finalOptions.strict = !finalOptions.relaxed; + if (typeof finalOptions.strict === 'boolean') + finalOptions.relaxed = !finalOptions.strict; + return JSON.parse(text, function (key, value) { + if (key.indexOf('\x00') !== -1) { + throw new BSONError("BSON Document field names cannot contain null bytes, found: " + JSON.stringify(key)); + } + return deserializeValue(value, finalOptions); + }); + } + EJSON.parse = parse; + /** + * Converts a BSON document to an Extended JSON string, optionally replacing values if a replacer + * function is specified or optionally including only the specified properties if a replacer array + * is specified. + * + * @param value - The value to convert to extended JSON + * @param replacer - A function that alters the behavior of the stringification process, or an array of String and Number objects that serve as a whitelist for selecting/filtering the properties of the value object to be included in the JSON string. If this value is null or not provided, all properties of the object are included in the resulting JSON string + * @param space - A String or Number object that's used to insert white space into the output JSON string for readability purposes. + * @param options - Optional settings + * + * @example + * ```js + * const { EJSON } = require('bson'); + * const Int32 = require('mongodb').Int32; + * const doc = { int32: new Int32(10) }; + * + * // prints '{"int32":{"$numberInt":"10"}}' + * console.log(EJSON.stringify(doc, { relaxed: false })); + * + * // prints '{"int32":10}' + * console.log(EJSON.stringify(doc)); + * ``` + */ + function stringify(value, + // eslint-disable-next-line @typescript-eslint/no-explicit-any + replacer, space, options) { + if (space != null && typeof space === 'object') { + options = space; + space = 0; + } + if (replacer != null && typeof replacer === 'object' && !Array.isArray(replacer)) { + options = replacer; + replacer = undefined; + space = 0; + } + var serializeOptions = Object.assign({ relaxed: true, legacy: false }, options, { + seenObjects: [{ propertyName: '(root)', obj: null }] + }); + var doc = serializeValue(value, serializeOptions); + return JSON.stringify(doc, replacer, space); + } + EJSON.stringify = stringify; + /** + * Serializes an object to an Extended JSON string, and reparse it as a JavaScript object. + * + * @param value - The object to serialize + * @param options - Optional settings passed to the `stringify` function + */ + function serialize(value, options) { + options = options || {}; + return JSON.parse(stringify(value, options)); + } + EJSON.serialize = serialize; + /** + * Deserializes an Extended JSON object into a plain JavaScript object with native/BSON types + * + * @param ejson - The Extended JSON object to deserialize + * @param options - Optional settings passed to the parse method + */ + function deserialize(ejson, options) { + options = options || {}; + return parse(JSON.stringify(ejson), options); + } + EJSON.deserialize = deserialize; + })(exports.EJSON || (exports.EJSON = {})); + + /* eslint-disable @typescript-eslint/no-explicit-any */ + /** @public */ + exports.Map = void 0; + var bsonGlobal = getGlobal(); + if (bsonGlobal.Map) { + exports.Map = bsonGlobal.Map; + } + else { + // We will return a polyfill + exports.Map = /** @class */ (function () { + function Map(array) { + if (array === void 0) { array = []; } + this._keys = []; + this._values = {}; + for (var i = 0; i < array.length; i++) { + if (array[i] == null) + continue; // skip null and undefined + var entry = array[i]; + var key = entry[0]; + var value = entry[1]; + // Add the key to the list of keys in order + this._keys.push(key); + // Add the key and value to the values dictionary with a point + // to the location in the ordered keys list + this._values[key] = { v: value, i: this._keys.length - 1 }; + } + } + Map.prototype.clear = function () { + this._keys = []; + this._values = {}; + }; + Map.prototype.delete = function (key) { + var value = this._values[key]; + if (value == null) + return false; + // Delete entry + delete this._values[key]; + // Remove the key from the ordered keys list + this._keys.splice(value.i, 1); + return true; + }; + Map.prototype.entries = function () { + var _this = this; + var index = 0; + return { + next: function () { + var key = _this._keys[index++]; + return { + value: key !== undefined ? [key, _this._values[key].v] : undefined, + done: key !== undefined ? false : true + }; + } + }; + }; + Map.prototype.forEach = function (callback, self) { + self = self || this; + for (var i = 0; i < this._keys.length; i++) { + var key = this._keys[i]; + // Call the forEach callback + callback.call(self, this._values[key].v, key, self); + } + }; + Map.prototype.get = function (key) { + return this._values[key] ? this._values[key].v : undefined; + }; + Map.prototype.has = function (key) { + return this._values[key] != null; + }; + Map.prototype.keys = function () { + var _this = this; + var index = 0; + return { + next: function () { + var key = _this._keys[index++]; + return { + value: key !== undefined ? key : undefined, + done: key !== undefined ? false : true + }; + } + }; + }; + Map.prototype.set = function (key, value) { + if (this._values[key]) { + this._values[key].v = value; + return this; + } + // Add the key to the list of keys in order + this._keys.push(key); + // Add the key and value to the values dictionary with a point + // to the location in the ordered keys list + this._values[key] = { v: value, i: this._keys.length - 1 }; + return this; + }; + Map.prototype.values = function () { + var _this = this; + var index = 0; + return { + next: function () { + var key = _this._keys[index++]; + return { + value: key !== undefined ? _this._values[key].v : undefined, + done: key !== undefined ? false : true + }; + } + }; + }; + Object.defineProperty(Map.prototype, "size", { + get: function () { + return this._keys.length; + }, + enumerable: false, + configurable: true + }); + return Map; + }()); + } + + /** @internal */ + var BSON_INT32_MAX = 0x7fffffff; + /** @internal */ + var BSON_INT32_MIN = -0x80000000; + /** @internal */ + var BSON_INT64_MAX = Math.pow(2, 63) - 1; + /** @internal */ + var BSON_INT64_MIN = -Math.pow(2, 63); + /** + * Any integer up to 2^53 can be precisely represented by a double. + * @internal + */ + var JS_INT_MAX = Math.pow(2, 53); + /** + * Any integer down to -2^53 can be precisely represented by a double. + * @internal + */ + var JS_INT_MIN = -Math.pow(2, 53); + /** Number BSON Type @internal */ + var BSON_DATA_NUMBER = 1; + /** String BSON Type @internal */ + var BSON_DATA_STRING = 2; + /** Object BSON Type @internal */ + var BSON_DATA_OBJECT = 3; + /** Array BSON Type @internal */ + var BSON_DATA_ARRAY = 4; + /** Binary BSON Type @internal */ + var BSON_DATA_BINARY = 5; + /** Binary BSON Type @internal */ + var BSON_DATA_UNDEFINED = 6; + /** ObjectId BSON Type @internal */ + var BSON_DATA_OID = 7; + /** Boolean BSON Type @internal */ + var BSON_DATA_BOOLEAN = 8; + /** Date BSON Type @internal */ + var BSON_DATA_DATE = 9; + /** null BSON Type @internal */ + var BSON_DATA_NULL = 10; + /** RegExp BSON Type @internal */ + var BSON_DATA_REGEXP = 11; + /** Code BSON Type @internal */ + var BSON_DATA_DBPOINTER = 12; + /** Code BSON Type @internal */ + var BSON_DATA_CODE = 13; + /** Symbol BSON Type @internal */ + var BSON_DATA_SYMBOL = 14; + /** Code with Scope BSON Type @internal */ + var BSON_DATA_CODE_W_SCOPE = 15; + /** 32 bit Integer BSON Type @internal */ + var BSON_DATA_INT = 16; + /** Timestamp BSON Type @internal */ + var BSON_DATA_TIMESTAMP = 17; + /** Long BSON Type @internal */ + var BSON_DATA_LONG = 18; + /** Decimal128 BSON Type @internal */ + var BSON_DATA_DECIMAL128 = 19; + /** MinKey BSON Type @internal */ + var BSON_DATA_MIN_KEY = 0xff; + /** MaxKey BSON Type @internal */ + var BSON_DATA_MAX_KEY = 0x7f; + /** Binary Default Type @internal */ + var BSON_BINARY_SUBTYPE_DEFAULT = 0; + /** Binary Function Type @internal */ + var BSON_BINARY_SUBTYPE_FUNCTION = 1; + /** Binary Byte Array Type @internal */ + var BSON_BINARY_SUBTYPE_BYTE_ARRAY = 2; + /** Binary Deprecated UUID Type @deprecated Please use BSON_BINARY_SUBTYPE_UUID_NEW @internal */ + var BSON_BINARY_SUBTYPE_UUID = 3; + /** Binary UUID Type @internal */ + var BSON_BINARY_SUBTYPE_UUID_NEW = 4; + /** Binary MD5 Type @internal */ + var BSON_BINARY_SUBTYPE_MD5 = 5; + /** Encrypted BSON type @internal */ + var BSON_BINARY_SUBTYPE_ENCRYPTED = 6; + /** Column BSON type @internal */ + var BSON_BINARY_SUBTYPE_COLUMN = 7; + /** Binary User Defined Type @internal */ + var BSON_BINARY_SUBTYPE_USER_DEFINED = 128; + + function calculateObjectSize$1(object, serializeFunctions, ignoreUndefined) { + var totalLength = 4 + 1; + if (Array.isArray(object)) { + for (var i = 0; i < object.length; i++) { + totalLength += calculateElement(i.toString(), object[i], serializeFunctions, true, ignoreUndefined); + } + } + else { + // If we have toBSON defined, override the current object + if (typeof (object === null || object === void 0 ? void 0 : object.toBSON) === 'function') { + object = object.toBSON(); + } + // Calculate size + for (var key in object) { + totalLength += calculateElement(key, object[key], serializeFunctions, false, ignoreUndefined); + } + } + return totalLength; + } + /** @internal */ + function calculateElement(name, + // eslint-disable-next-line @typescript-eslint/no-explicit-any + value, serializeFunctions, isArray, ignoreUndefined) { + if (serializeFunctions === void 0) { serializeFunctions = false; } + if (isArray === void 0) { isArray = false; } + if (ignoreUndefined === void 0) { ignoreUndefined = false; } + // If we have toBSON defined, override the current object + if (typeof (value === null || value === void 0 ? void 0 : value.toBSON) === 'function') { + value = value.toBSON(); + } + switch (typeof value) { + case 'string': + return 1 + buffer_1.byteLength(name, 'utf8') + 1 + 4 + buffer_1.byteLength(value, 'utf8') + 1; + case 'number': + if (Math.floor(value) === value && + value >= JS_INT_MIN && + value <= JS_INT_MAX) { + if (value >= BSON_INT32_MIN && value <= BSON_INT32_MAX) { + // 32 bit + return (name != null ? buffer_1.byteLength(name, 'utf8') + 1 : 0) + (4 + 1); + } + else { + return (name != null ? buffer_1.byteLength(name, 'utf8') + 1 : 0) + (8 + 1); + } + } + else { + // 64 bit + return (name != null ? buffer_1.byteLength(name, 'utf8') + 1 : 0) + (8 + 1); + } + case 'undefined': + if (isArray || !ignoreUndefined) + return (name != null ? buffer_1.byteLength(name, 'utf8') + 1 : 0) + 1; + return 0; + case 'boolean': + return (name != null ? buffer_1.byteLength(name, 'utf8') + 1 : 0) + (1 + 1); + case 'object': + if (value == null || value['_bsontype'] === 'MinKey' || value['_bsontype'] === 'MaxKey') { + return (name != null ? buffer_1.byteLength(name, 'utf8') + 1 : 0) + 1; + } + else if (value['_bsontype'] === 'ObjectId' || value['_bsontype'] === 'ObjectID') { + return (name != null ? buffer_1.byteLength(name, 'utf8') + 1 : 0) + (12 + 1); + } + else if (value instanceof Date || isDate(value)) { + return (name != null ? buffer_1.byteLength(name, 'utf8') + 1 : 0) + (8 + 1); + } + else if (ArrayBuffer.isView(value) || + value instanceof ArrayBuffer || + isAnyArrayBuffer(value)) { + return ((name != null ? buffer_1.byteLength(name, 'utf8') + 1 : 0) + (1 + 4 + 1) + value.byteLength); + } + else if (value['_bsontype'] === 'Long' || + value['_bsontype'] === 'Double' || + value['_bsontype'] === 'Timestamp') { + return (name != null ? buffer_1.byteLength(name, 'utf8') + 1 : 0) + (8 + 1); + } + else if (value['_bsontype'] === 'Decimal128') { + return (name != null ? buffer_1.byteLength(name, 'utf8') + 1 : 0) + (16 + 1); + } + else if (value['_bsontype'] === 'Code') { + // Calculate size depending on the availability of a scope + if (value.scope != null && Object.keys(value.scope).length > 0) { + return ((name != null ? buffer_1.byteLength(name, 'utf8') + 1 : 0) + + 1 + + 4 + + 4 + + buffer_1.byteLength(value.code.toString(), 'utf8') + + 1 + + calculateObjectSize$1(value.scope, serializeFunctions, ignoreUndefined)); + } + else { + return ((name != null ? buffer_1.byteLength(name, 'utf8') + 1 : 0) + + 1 + + 4 + + buffer_1.byteLength(value.code.toString(), 'utf8') + + 1); + } + } + else if (value['_bsontype'] === 'Binary') { + // Check what kind of subtype we have + if (value.sub_type === Binary.SUBTYPE_BYTE_ARRAY) { + return ((name != null ? buffer_1.byteLength(name, 'utf8') + 1 : 0) + + (value.position + 1 + 4 + 1 + 4)); + } + else { + return ((name != null ? buffer_1.byteLength(name, 'utf8') + 1 : 0) + (value.position + 1 + 4 + 1)); + } + } + else if (value['_bsontype'] === 'Symbol') { + return ((name != null ? buffer_1.byteLength(name, 'utf8') + 1 : 0) + + buffer_1.byteLength(value.value, 'utf8') + + 4 + + 1 + + 1); + } + else if (value['_bsontype'] === 'DBRef') { + // Set up correct object for serialization + var ordered_values = Object.assign({ + $ref: value.collection, + $id: value.oid + }, value.fields); + // Add db reference if it exists + if (value.db != null) { + ordered_values['$db'] = value.db; + } + return ((name != null ? buffer_1.byteLength(name, 'utf8') + 1 : 0) + + 1 + + calculateObjectSize$1(ordered_values, serializeFunctions, ignoreUndefined)); + } + else if (value instanceof RegExp || isRegExp(value)) { + return ((name != null ? buffer_1.byteLength(name, 'utf8') + 1 : 0) + + 1 + + buffer_1.byteLength(value.source, 'utf8') + + 1 + + (value.global ? 1 : 0) + + (value.ignoreCase ? 1 : 0) + + (value.multiline ? 1 : 0) + + 1); + } + else if (value['_bsontype'] === 'BSONRegExp') { + return ((name != null ? buffer_1.byteLength(name, 'utf8') + 1 : 0) + + 1 + + buffer_1.byteLength(value.pattern, 'utf8') + + 1 + + buffer_1.byteLength(value.options, 'utf8') + + 1); + } + else { + return ((name != null ? buffer_1.byteLength(name, 'utf8') + 1 : 0) + + calculateObjectSize$1(value, serializeFunctions, ignoreUndefined) + + 1); + } + case 'function': + // WTF for 0.4.X where typeof /someregexp/ === 'function' + if (value instanceof RegExp || isRegExp(value) || String.call(value) === '[object RegExp]') { + return ((name != null ? buffer_1.byteLength(name, 'utf8') + 1 : 0) + + 1 + + buffer_1.byteLength(value.source, 'utf8') + + 1 + + (value.global ? 1 : 0) + + (value.ignoreCase ? 1 : 0) + + (value.multiline ? 1 : 0) + + 1); + } + else { + if (serializeFunctions && value.scope != null && Object.keys(value.scope).length > 0) { + return ((name != null ? buffer_1.byteLength(name, 'utf8') + 1 : 0) + + 1 + + 4 + + 4 + + buffer_1.byteLength(normalizedFunctionString(value), 'utf8') + + 1 + + calculateObjectSize$1(value.scope, serializeFunctions, ignoreUndefined)); + } + else if (serializeFunctions) { + return ((name != null ? buffer_1.byteLength(name, 'utf8') + 1 : 0) + + 1 + + 4 + + buffer_1.byteLength(normalizedFunctionString(value), 'utf8') + + 1); + } + } + } + return 0; + } + + var FIRST_BIT = 0x80; + var FIRST_TWO_BITS = 0xc0; + var FIRST_THREE_BITS = 0xe0; + var FIRST_FOUR_BITS = 0xf0; + var FIRST_FIVE_BITS = 0xf8; + var TWO_BIT_CHAR = 0xc0; + var THREE_BIT_CHAR = 0xe0; + var FOUR_BIT_CHAR = 0xf0; + var CONTINUING_CHAR = 0x80; + /** + * Determines if the passed in bytes are valid utf8 + * @param bytes - An array of 8-bit bytes. Must be indexable and have length property + * @param start - The index to start validating + * @param end - The index to end validating + */ + function validateUtf8(bytes, start, end) { + var continuation = 0; + for (var i = start; i < end; i += 1) { + var byte = bytes[i]; + if (continuation) { + if ((byte & FIRST_TWO_BITS) !== CONTINUING_CHAR) { + return false; + } + continuation -= 1; + } + else if (byte & FIRST_BIT) { + if ((byte & FIRST_THREE_BITS) === TWO_BIT_CHAR) { + continuation = 1; + } + else if ((byte & FIRST_FOUR_BITS) === THREE_BIT_CHAR) { + continuation = 2; + } + else if ((byte & FIRST_FIVE_BITS) === FOUR_BIT_CHAR) { + continuation = 3; + } + else { + return false; + } + } + } + return !continuation; + } + + // Internal long versions + var JS_INT_MAX_LONG = Long.fromNumber(JS_INT_MAX); + var JS_INT_MIN_LONG = Long.fromNumber(JS_INT_MIN); + var functionCache = {}; + function deserialize$1(buffer, options, isArray) { + options = options == null ? {} : options; + var index = options && options.index ? options.index : 0; + // Read the document size + var size = buffer[index] | + (buffer[index + 1] << 8) | + (buffer[index + 2] << 16) | + (buffer[index + 3] << 24); + if (size < 5) { + throw new BSONError("bson size must be >= 5, is " + size); + } + if (options.allowObjectSmallerThanBufferSize && buffer.length < size) { + throw new BSONError("buffer length " + buffer.length + " must be >= bson size " + size); + } + if (!options.allowObjectSmallerThanBufferSize && buffer.length !== size) { + throw new BSONError("buffer length " + buffer.length + " must === bson size " + size); + } + if (size + index > buffer.byteLength) { + throw new BSONError("(bson size " + size + " + options.index " + index + " must be <= buffer length " + buffer.byteLength + ")"); + } + // Illegal end value + if (buffer[index + size - 1] !== 0) { + throw new BSONError("One object, sized correctly, with a spot for an EOO, but the EOO isn't 0x00"); + } + // Start deserializtion + return deserializeObject(buffer, index, options, isArray); + } + var allowedDBRefKeys = /^\$ref$|^\$id$|^\$db$/; + function deserializeObject(buffer, index, options, isArray) { + if (isArray === void 0) { isArray = false; } + var evalFunctions = options['evalFunctions'] == null ? false : options['evalFunctions']; + var cacheFunctions = options['cacheFunctions'] == null ? false : options['cacheFunctions']; + var fieldsAsRaw = options['fieldsAsRaw'] == null ? null : options['fieldsAsRaw']; + // Return raw bson buffer instead of parsing it + var raw = options['raw'] == null ? false : options['raw']; + // Return BSONRegExp objects instead of native regular expressions + var bsonRegExp = typeof options['bsonRegExp'] === 'boolean' ? options['bsonRegExp'] : false; + // Controls the promotion of values vs wrapper classes + var promoteBuffers = options['promoteBuffers'] == null ? false : options['promoteBuffers']; + var promoteLongs = options['promoteLongs'] == null ? true : options['promoteLongs']; + var promoteValues = options['promoteValues'] == null ? true : options['promoteValues']; + // Ensures default validation option if none given + var validation = options.validation == null ? { utf8: true } : options.validation; + // Shows if global utf-8 validation is enabled or disabled + var globalUTFValidation = true; + // Reflects utf-8 validation setting regardless of global or specific key validation + var validationSetting; + // Set of keys either to enable or disable validation on + var utf8KeysSet = new Set(); + // Check for boolean uniformity and empty validation option + var utf8ValidatedKeys = validation.utf8; + if (typeof utf8ValidatedKeys === 'boolean') { + validationSetting = utf8ValidatedKeys; + } + else { + globalUTFValidation = false; + var utf8ValidationValues = Object.keys(utf8ValidatedKeys).map(function (key) { + return utf8ValidatedKeys[key]; + }); + if (utf8ValidationValues.length === 0) { + throw new BSONError('UTF-8 validation setting cannot be empty'); + } + if (typeof utf8ValidationValues[0] !== 'boolean') { + throw new BSONError('Invalid UTF-8 validation option, must specify boolean values'); + } + validationSetting = utf8ValidationValues[0]; + // Ensures boolean uniformity in utf-8 validation (all true or all false) + if (!utf8ValidationValues.every(function (item) { return item === validationSetting; })) { + throw new BSONError('Invalid UTF-8 validation option - keys must be all true or all false'); + } + } + // Add keys to set that will either be validated or not based on validationSetting + if (!globalUTFValidation) { + for (var _i = 0, _a = Object.keys(utf8ValidatedKeys); _i < _a.length; _i++) { + var key = _a[_i]; + utf8KeysSet.add(key); + } + } + // Set the start index + var startIndex = index; + // Validate that we have at least 4 bytes of buffer + if (buffer.length < 5) + throw new BSONError('corrupt bson message < 5 bytes long'); + // Read the document size + var size = buffer[index++] | (buffer[index++] << 8) | (buffer[index++] << 16) | (buffer[index++] << 24); + // Ensure buffer is valid size + if (size < 5 || size > buffer.length) + throw new BSONError('corrupt bson message'); + // Create holding object + var object = isArray ? [] : {}; + // Used for arrays to skip having to perform utf8 decoding + var arrayIndex = 0; + var done = false; + var isPossibleDBRef = isArray ? false : null; + // While we have more left data left keep parsing + while (!done) { + // Read the type + var elementType = buffer[index++]; + // If we get a zero it's the last byte, exit + if (elementType === 0) + break; + // Get the start search index + var i = index; + // Locate the end of the c string + while (buffer[i] !== 0x00 && i < buffer.length) { + i++; + } + // If are at the end of the buffer there is a problem with the document + if (i >= buffer.byteLength) + throw new BSONError('Bad BSON Document: illegal CString'); + // Represents the key + var name = isArray ? arrayIndex++ : buffer.toString('utf8', index, i); + // shouldValidateKey is true if the key should be validated, false otherwise + var shouldValidateKey = true; + if (globalUTFValidation || utf8KeysSet.has(name)) { + shouldValidateKey = validationSetting; + } + else { + shouldValidateKey = !validationSetting; + } + if (isPossibleDBRef !== false && name[0] === '$') { + isPossibleDBRef = allowedDBRefKeys.test(name); + } + var value = void 0; + index = i + 1; + if (elementType === BSON_DATA_STRING) { + var stringSize = buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + if (stringSize <= 0 || + stringSize > buffer.length - index || + buffer[index + stringSize - 1] !== 0) { + throw new BSONError('bad string length in bson'); + } + value = getValidatedString(buffer, index, index + stringSize - 1, shouldValidateKey); + index = index + stringSize; + } + else if (elementType === BSON_DATA_OID) { + var oid = buffer_1.alloc(12); + buffer.copy(oid, 0, index, index + 12); + value = new ObjectId(oid); + index = index + 12; + } + else if (elementType === BSON_DATA_INT && promoteValues === false) { + value = new Int32(buffer[index++] | (buffer[index++] << 8) | (buffer[index++] << 16) | (buffer[index++] << 24)); + } + else if (elementType === BSON_DATA_INT) { + value = + buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + } + else if (elementType === BSON_DATA_NUMBER && promoteValues === false) { + value = new Double(buffer.readDoubleLE(index)); + index = index + 8; + } + else if (elementType === BSON_DATA_NUMBER) { + value = buffer.readDoubleLE(index); + index = index + 8; + } + else if (elementType === BSON_DATA_DATE) { + var lowBits = buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + var highBits = buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + value = new Date(new Long(lowBits, highBits).toNumber()); + } + else if (elementType === BSON_DATA_BOOLEAN) { + if (buffer[index] !== 0 && buffer[index] !== 1) + throw new BSONError('illegal boolean type value'); + value = buffer[index++] === 1; + } + else if (elementType === BSON_DATA_OBJECT) { + var _index = index; + var objectSize = buffer[index] | + (buffer[index + 1] << 8) | + (buffer[index + 2] << 16) | + (buffer[index + 3] << 24); + if (objectSize <= 0 || objectSize > buffer.length - index) + throw new BSONError('bad embedded document length in bson'); + // We have a raw value + if (raw) { + value = buffer.slice(index, index + objectSize); + } + else { + var objectOptions = options; + if (!globalUTFValidation) { + objectOptions = _assign(_assign({}, options), { validation: { utf8: shouldValidateKey } }); + } + value = deserializeObject(buffer, _index, objectOptions, false); + } + index = index + objectSize; + } + else if (elementType === BSON_DATA_ARRAY) { + var _index = index; + var objectSize = buffer[index] | + (buffer[index + 1] << 8) | + (buffer[index + 2] << 16) | + (buffer[index + 3] << 24); + var arrayOptions = options; + // Stop index + var stopIndex = index + objectSize; + // All elements of array to be returned as raw bson + if (fieldsAsRaw && fieldsAsRaw[name]) { + arrayOptions = {}; + for (var n in options) { + arrayOptions[n] = options[n]; + } + arrayOptions['raw'] = true; + } + if (!globalUTFValidation) { + arrayOptions = _assign(_assign({}, arrayOptions), { validation: { utf8: shouldValidateKey } }); + } + value = deserializeObject(buffer, _index, arrayOptions, true); + index = index + objectSize; + if (buffer[index - 1] !== 0) + throw new BSONError('invalid array terminator byte'); + if (index !== stopIndex) + throw new BSONError('corrupted array bson'); + } + else if (elementType === BSON_DATA_UNDEFINED) { + value = undefined; + } + else if (elementType === BSON_DATA_NULL) { + value = null; + } + else if (elementType === BSON_DATA_LONG) { + // Unpack the low and high bits + var lowBits = buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + var highBits = buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + var long = new Long(lowBits, highBits); + // Promote the long if possible + if (promoteLongs && promoteValues === true) { + value = + long.lessThanOrEqual(JS_INT_MAX_LONG) && long.greaterThanOrEqual(JS_INT_MIN_LONG) + ? long.toNumber() + : long; + } + else { + value = long; + } + } + else if (elementType === BSON_DATA_DECIMAL128) { + // Buffer to contain the decimal bytes + var bytes = buffer_1.alloc(16); + // Copy the next 16 bytes into the bytes buffer + buffer.copy(bytes, 0, index, index + 16); + // Update index + index = index + 16; + // Assign the new Decimal128 value + var decimal128 = new Decimal128(bytes); + // If we have an alternative mapper use that + if ('toObject' in decimal128 && typeof decimal128.toObject === 'function') { + value = decimal128.toObject(); + } + else { + value = decimal128; + } + } + else if (elementType === BSON_DATA_BINARY) { + var binarySize = buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + var totalBinarySize = binarySize; + var subType = buffer[index++]; + // Did we have a negative binary size, throw + if (binarySize < 0) + throw new BSONError('Negative binary type element size found'); + // Is the length longer than the document + if (binarySize > buffer.byteLength) + throw new BSONError('Binary type size larger than document size'); + // Decode as raw Buffer object if options specifies it + if (buffer['slice'] != null) { + // If we have subtype 2 skip the 4 bytes for the size + if (subType === Binary.SUBTYPE_BYTE_ARRAY) { + binarySize = + buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + if (binarySize < 0) + throw new BSONError('Negative binary type element size found for subtype 0x02'); + if (binarySize > totalBinarySize - 4) + throw new BSONError('Binary type with subtype 0x02 contains too long binary size'); + if (binarySize < totalBinarySize - 4) + throw new BSONError('Binary type with subtype 0x02 contains too short binary size'); + } + if (promoteBuffers && promoteValues) { + value = buffer.slice(index, index + binarySize); + } + else { + value = new Binary(buffer.slice(index, index + binarySize), subType); + } + } + else { + var _buffer = buffer_1.alloc(binarySize); + // If we have subtype 2 skip the 4 bytes for the size + if (subType === Binary.SUBTYPE_BYTE_ARRAY) { + binarySize = + buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + if (binarySize < 0) + throw new BSONError('Negative binary type element size found for subtype 0x02'); + if (binarySize > totalBinarySize - 4) + throw new BSONError('Binary type with subtype 0x02 contains too long binary size'); + if (binarySize < totalBinarySize - 4) + throw new BSONError('Binary type with subtype 0x02 contains too short binary size'); + } + // Copy the data + for (i = 0; i < binarySize; i++) { + _buffer[i] = buffer[index + i]; + } + if (promoteBuffers && promoteValues) { + value = _buffer; + } + else { + value = new Binary(_buffer, subType); + } + } + // Update the index + index = index + binarySize; + } + else if (elementType === BSON_DATA_REGEXP && bsonRegExp === false) { + // Get the start search index + i = index; + // Locate the end of the c string + while (buffer[i] !== 0x00 && i < buffer.length) { + i++; + } + // If are at the end of the buffer there is a problem with the document + if (i >= buffer.length) + throw new BSONError('Bad BSON Document: illegal CString'); + // Return the C string + var source = buffer.toString('utf8', index, i); + // Create the regexp + index = i + 1; + // Get the start search index + i = index; + // Locate the end of the c string + while (buffer[i] !== 0x00 && i < buffer.length) { + i++; + } + // If are at the end of the buffer there is a problem with the document + if (i >= buffer.length) + throw new BSONError('Bad BSON Document: illegal CString'); + // Return the C string + var regExpOptions = buffer.toString('utf8', index, i); + index = i + 1; + // For each option add the corresponding one for javascript + var optionsArray = new Array(regExpOptions.length); + // Parse options + for (i = 0; i < regExpOptions.length; i++) { + switch (regExpOptions[i]) { + case 'm': + optionsArray[i] = 'm'; + break; + case 's': + optionsArray[i] = 'g'; + break; + case 'i': + optionsArray[i] = 'i'; + break; + } + } + value = new RegExp(source, optionsArray.join('')); + } + else if (elementType === BSON_DATA_REGEXP && bsonRegExp === true) { + // Get the start search index + i = index; + // Locate the end of the c string + while (buffer[i] !== 0x00 && i < buffer.length) { + i++; + } + // If are at the end of the buffer there is a problem with the document + if (i >= buffer.length) + throw new BSONError('Bad BSON Document: illegal CString'); + // Return the C string + var source = buffer.toString('utf8', index, i); + index = i + 1; + // Get the start search index + i = index; + // Locate the end of the c string + while (buffer[i] !== 0x00 && i < buffer.length) { + i++; + } + // If are at the end of the buffer there is a problem with the document + if (i >= buffer.length) + throw new BSONError('Bad BSON Document: illegal CString'); + // Return the C string + var regExpOptions = buffer.toString('utf8', index, i); + index = i + 1; + // Set the object + value = new BSONRegExp(source, regExpOptions); + } + else if (elementType === BSON_DATA_SYMBOL) { + var stringSize = buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + if (stringSize <= 0 || + stringSize > buffer.length - index || + buffer[index + stringSize - 1] !== 0) { + throw new BSONError('bad string length in bson'); + } + var symbol = getValidatedString(buffer, index, index + stringSize - 1, shouldValidateKey); + value = promoteValues ? symbol : new BSONSymbol(symbol); + index = index + stringSize; + } + else if (elementType === BSON_DATA_TIMESTAMP) { + var lowBits = buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + var highBits = buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + value = new Timestamp(lowBits, highBits); + } + else if (elementType === BSON_DATA_MIN_KEY) { + value = new MinKey(); + } + else if (elementType === BSON_DATA_MAX_KEY) { + value = new MaxKey(); + } + else if (elementType === BSON_DATA_CODE) { + var stringSize = buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + if (stringSize <= 0 || + stringSize > buffer.length - index || + buffer[index + stringSize - 1] !== 0) { + throw new BSONError('bad string length in bson'); + } + var functionString = getValidatedString(buffer, index, index + stringSize - 1, shouldValidateKey); + // If we are evaluating the functions + if (evalFunctions) { + // If we have cache enabled let's look for the md5 of the function in the cache + if (cacheFunctions) { + // Got to do this to avoid V8 deoptimizing the call due to finding eval + value = isolateEval(functionString, functionCache, object); + } + else { + value = isolateEval(functionString); + } + } + else { + value = new Code(functionString); + } + // Update parse index position + index = index + stringSize; + } + else if (elementType === BSON_DATA_CODE_W_SCOPE) { + var totalSize = buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + // Element cannot be shorter than totalSize + stringSize + documentSize + terminator + if (totalSize < 4 + 4 + 4 + 1) { + throw new BSONError('code_w_scope total size shorter minimum expected length'); + } + // Get the code string size + var stringSize = buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + // Check if we have a valid string + if (stringSize <= 0 || + stringSize > buffer.length - index || + buffer[index + stringSize - 1] !== 0) { + throw new BSONError('bad string length in bson'); + } + // Javascript function + var functionString = getValidatedString(buffer, index, index + stringSize - 1, shouldValidateKey); + // Update parse index position + index = index + stringSize; + // Parse the element + var _index = index; + // Decode the size of the object document + var objectSize = buffer[index] | + (buffer[index + 1] << 8) | + (buffer[index + 2] << 16) | + (buffer[index + 3] << 24); + // Decode the scope object + var scopeObject = deserializeObject(buffer, _index, options, false); + // Adjust the index + index = index + objectSize; + // Check if field length is too short + if (totalSize < 4 + 4 + objectSize + stringSize) { + throw new BSONError('code_w_scope total size is too short, truncating scope'); + } + // Check if totalSize field is too long + if (totalSize > 4 + 4 + objectSize + stringSize) { + throw new BSONError('code_w_scope total size is too long, clips outer document'); + } + // If we are evaluating the functions + if (evalFunctions) { + // If we have cache enabled let's look for the md5 of the function in the cache + if (cacheFunctions) { + // Got to do this to avoid V8 deoptimizing the call due to finding eval + value = isolateEval(functionString, functionCache, object); + } + else { + value = isolateEval(functionString); + } + value.scope = scopeObject; + } + else { + value = new Code(functionString, scopeObject); + } + } + else if (elementType === BSON_DATA_DBPOINTER) { + // Get the code string size + var stringSize = buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + // Check if we have a valid string + if (stringSize <= 0 || + stringSize > buffer.length - index || + buffer[index + stringSize - 1] !== 0) + throw new BSONError('bad string length in bson'); + // Namespace + if (validation != null && validation.utf8) { + if (!validateUtf8(buffer, index, index + stringSize - 1)) { + throw new BSONError('Invalid UTF-8 string in BSON document'); + } + } + var namespace = buffer.toString('utf8', index, index + stringSize - 1); + // Update parse index position + index = index + stringSize; + // Read the oid + var oidBuffer = buffer_1.alloc(12); + buffer.copy(oidBuffer, 0, index, index + 12); + var oid = new ObjectId(oidBuffer); + // Update the index + index = index + 12; + // Upgrade to DBRef type + value = new DBRef(namespace, oid); + } + else { + throw new BSONError('Detected unknown BSON type ' + elementType.toString(16) + ' for fieldname "' + name + '"'); + } + if (name === '__proto__') { + Object.defineProperty(object, name, { + value: value, + writable: true, + enumerable: true, + configurable: true + }); + } + else { + object[name] = value; + } + } + // Check if the deserialization was against a valid array/object + if (size !== index - startIndex) { + if (isArray) + throw new BSONError('corrupt array bson'); + throw new BSONError('corrupt object bson'); + } + // if we did not find "$ref", "$id", "$db", or found an extraneous $key, don't make a DBRef + if (!isPossibleDBRef) + return object; + if (isDBRefLike(object)) { + var copy = Object.assign({}, object); + delete copy.$ref; + delete copy.$id; + delete copy.$db; + return new DBRef(object.$ref, object.$id, object.$db, copy); + } + return object; + } + /** + * Ensure eval is isolated, store the result in functionCache. + * + * @internal + */ + function isolateEval(functionString, functionCache, object) { + if (!functionCache) + return new Function(functionString); + // Check for cache hit, eval if missing and return cached function + if (functionCache[functionString] == null) { + functionCache[functionString] = new Function(functionString); + } + // Set the object + return functionCache[functionString].bind(object); + } + function getValidatedString(buffer, start, end, shouldValidateUtf8) { + var value = buffer.toString('utf8', start, end); + // if utf8 validation is on, do the check + if (shouldValidateUtf8) { + for (var i = 0; i < value.length; i++) { + if (value.charCodeAt(i) === 0xfffd) { + if (!validateUtf8(buffer, start, end)) { + throw new BSONError('Invalid UTF-8 string in BSON document'); + } + break; + } + } + } + return value; + } + + // Copyright (c) 2008, Fair Oaks Labs, Inc. + function writeIEEE754(buffer, value, offset, endian, mLen, nBytes) { + var e; + var m; + var c; + var bBE = endian === 'big'; + var eLen = nBytes * 8 - mLen - 1; + var eMax = (1 << eLen) - 1; + var eBias = eMax >> 1; + var rt = mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0; + var i = bBE ? nBytes - 1 : 0; + var d = bBE ? -1 : 1; + var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0; + value = Math.abs(value); + if (isNaN(value) || value === Infinity) { + m = isNaN(value) ? 1 : 0; + e = eMax; + } + else { + e = Math.floor(Math.log(value) / Math.LN2); + if (value * (c = Math.pow(2, -e)) < 1) { + e--; + c *= 2; + } + if (e + eBias >= 1) { + value += rt / c; + } + else { + value += rt * Math.pow(2, 1 - eBias); + } + if (value * c >= 2) { + e++; + c /= 2; + } + if (e + eBias >= eMax) { + m = 0; + e = eMax; + } + else if (e + eBias >= 1) { + m = (value * c - 1) * Math.pow(2, mLen); + e = e + eBias; + } + else { + m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen); + e = 0; + } + } + if (isNaN(value)) + m = 0; + while (mLen >= 8) { + buffer[offset + i] = m & 0xff; + i += d; + m /= 256; + mLen -= 8; + } + e = (e << mLen) | m; + if (isNaN(value)) + e += 8; + eLen += mLen; + while (eLen > 0) { + buffer[offset + i] = e & 0xff; + i += d; + e /= 256; + eLen -= 8; + } + buffer[offset + i - d] |= s * 128; + } + + var regexp = /\x00/; // eslint-disable-line no-control-regex + var ignoreKeys = new Set(['$db', '$ref', '$id', '$clusterTime']); + /* + * isArray indicates if we are writing to a BSON array (type 0x04) + * which forces the "key" which really an array index as a string to be written as ascii + * This will catch any errors in index as a string generation + */ + function serializeString(buffer, key, value, index, isArray) { + // Encode String type + buffer[index++] = BSON_DATA_STRING; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes + 1; + buffer[index - 1] = 0; + // Write the string + var size = buffer.write(value, index + 4, undefined, 'utf8'); + // Write the size of the string to buffer + buffer[index + 3] = ((size + 1) >> 24) & 0xff; + buffer[index + 2] = ((size + 1) >> 16) & 0xff; + buffer[index + 1] = ((size + 1) >> 8) & 0xff; + buffer[index] = (size + 1) & 0xff; + // Update index + index = index + 4 + size; + // Write zero + buffer[index++] = 0; + return index; + } + function serializeNumber(buffer, key, value, index, isArray) { + // We have an integer value + // TODO(NODE-2529): Add support for big int + if (Number.isInteger(value) && + value >= BSON_INT32_MIN && + value <= BSON_INT32_MAX) { + // If the value fits in 32 bits encode as int32 + // Set int type 32 bits or less + buffer[index++] = BSON_DATA_INT; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Write the int value + buffer[index++] = value & 0xff; + buffer[index++] = (value >> 8) & 0xff; + buffer[index++] = (value >> 16) & 0xff; + buffer[index++] = (value >> 24) & 0xff; + } + else { + // Encode as double + buffer[index++] = BSON_DATA_NUMBER; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Write float + writeIEEE754(buffer, value, index, 'little', 52, 8); + // Adjust index + index = index + 8; + } + return index; + } + function serializeNull(buffer, key, _, index, isArray) { + // Set long type + buffer[index++] = BSON_DATA_NULL; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + return index; + } + function serializeBoolean(buffer, key, value, index, isArray) { + // Write the type + buffer[index++] = BSON_DATA_BOOLEAN; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Encode the boolean value + buffer[index++] = value ? 1 : 0; + return index; + } + function serializeDate(buffer, key, value, index, isArray) { + // Write the type + buffer[index++] = BSON_DATA_DATE; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Write the date + var dateInMilis = Long.fromNumber(value.getTime()); + var lowBits = dateInMilis.getLowBits(); + var highBits = dateInMilis.getHighBits(); + // Encode low bits + buffer[index++] = lowBits & 0xff; + buffer[index++] = (lowBits >> 8) & 0xff; + buffer[index++] = (lowBits >> 16) & 0xff; + buffer[index++] = (lowBits >> 24) & 0xff; + // Encode high bits + buffer[index++] = highBits & 0xff; + buffer[index++] = (highBits >> 8) & 0xff; + buffer[index++] = (highBits >> 16) & 0xff; + buffer[index++] = (highBits >> 24) & 0xff; + return index; + } + function serializeRegExp(buffer, key, value, index, isArray) { + // Write the type + buffer[index++] = BSON_DATA_REGEXP; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + if (value.source && value.source.match(regexp) != null) { + throw Error('value ' + value.source + ' must not contain null bytes'); + } + // Adjust the index + index = index + buffer.write(value.source, index, undefined, 'utf8'); + // Write zero + buffer[index++] = 0x00; + // Write the parameters + if (value.ignoreCase) + buffer[index++] = 0x69; // i + if (value.global) + buffer[index++] = 0x73; // s + if (value.multiline) + buffer[index++] = 0x6d; // m + // Add ending zero + buffer[index++] = 0x00; + return index; + } + function serializeBSONRegExp(buffer, key, value, index, isArray) { + // Write the type + buffer[index++] = BSON_DATA_REGEXP; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Check the pattern for 0 bytes + if (value.pattern.match(regexp) != null) { + // The BSON spec doesn't allow keys with null bytes because keys are + // null-terminated. + throw Error('pattern ' + value.pattern + ' must not contain null bytes'); + } + // Adjust the index + index = index + buffer.write(value.pattern, index, undefined, 'utf8'); + // Write zero + buffer[index++] = 0x00; + // Write the options + index = index + buffer.write(value.options.split('').sort().join(''), index, undefined, 'utf8'); + // Add ending zero + buffer[index++] = 0x00; + return index; + } + function serializeMinMax(buffer, key, value, index, isArray) { + // Write the type of either min or max key + if (value === null) { + buffer[index++] = BSON_DATA_NULL; + } + else if (value._bsontype === 'MinKey') { + buffer[index++] = BSON_DATA_MIN_KEY; + } + else { + buffer[index++] = BSON_DATA_MAX_KEY; + } + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + return index; + } + function serializeObjectId(buffer, key, value, index, isArray) { + // Write the type + buffer[index++] = BSON_DATA_OID; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Write the objectId into the shared buffer + if (typeof value.id === 'string') { + buffer.write(value.id, index, undefined, 'binary'); + } + else if (isUint8Array(value.id)) { + // Use the standard JS methods here because buffer.copy() is buggy with the + // browser polyfill + buffer.set(value.id.subarray(0, 12), index); + } + else { + throw new BSONTypeError('object [' + JSON.stringify(value) + '] is not a valid ObjectId'); + } + // Adjust index + return index + 12; + } + function serializeBuffer(buffer, key, value, index, isArray) { + // Write the type + buffer[index++] = BSON_DATA_BINARY; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Get size of the buffer (current write point) + var size = value.length; + // Write the size of the string to buffer + buffer[index++] = size & 0xff; + buffer[index++] = (size >> 8) & 0xff; + buffer[index++] = (size >> 16) & 0xff; + buffer[index++] = (size >> 24) & 0xff; + // Write the default subtype + buffer[index++] = BSON_BINARY_SUBTYPE_DEFAULT; + // Copy the content form the binary field to the buffer + buffer.set(ensureBuffer(value), index); + // Adjust the index + index = index + size; + return index; + } + function serializeObject(buffer, key, value, index, checkKeys, depth, serializeFunctions, ignoreUndefined, isArray, path) { + if (checkKeys === void 0) { checkKeys = false; } + if (depth === void 0) { depth = 0; } + if (serializeFunctions === void 0) { serializeFunctions = false; } + if (ignoreUndefined === void 0) { ignoreUndefined = true; } + if (isArray === void 0) { isArray = false; } + if (path === void 0) { path = []; } + for (var i = 0; i < path.length; i++) { + if (path[i] === value) + throw new BSONError('cyclic dependency detected'); + } + // Push value to stack + path.push(value); + // Write the type + buffer[index++] = Array.isArray(value) ? BSON_DATA_ARRAY : BSON_DATA_OBJECT; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + var endIndex = serializeInto(buffer, value, checkKeys, index, depth + 1, serializeFunctions, ignoreUndefined, path); + // Pop stack + path.pop(); + return endIndex; + } + function serializeDecimal128(buffer, key, value, index, isArray) { + buffer[index++] = BSON_DATA_DECIMAL128; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Write the data from the value + // Prefer the standard JS methods because their typechecking is not buggy, + // unlike the `buffer` polyfill's. + buffer.set(value.bytes.subarray(0, 16), index); + return index + 16; + } + function serializeLong(buffer, key, value, index, isArray) { + // Write the type + buffer[index++] = + value._bsontype === 'Long' ? BSON_DATA_LONG : BSON_DATA_TIMESTAMP; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Write the date + var lowBits = value.getLowBits(); + var highBits = value.getHighBits(); + // Encode low bits + buffer[index++] = lowBits & 0xff; + buffer[index++] = (lowBits >> 8) & 0xff; + buffer[index++] = (lowBits >> 16) & 0xff; + buffer[index++] = (lowBits >> 24) & 0xff; + // Encode high bits + buffer[index++] = highBits & 0xff; + buffer[index++] = (highBits >> 8) & 0xff; + buffer[index++] = (highBits >> 16) & 0xff; + buffer[index++] = (highBits >> 24) & 0xff; + return index; + } + function serializeInt32(buffer, key, value, index, isArray) { + value = value.valueOf(); + // Set int type 32 bits or less + buffer[index++] = BSON_DATA_INT; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Write the int value + buffer[index++] = value & 0xff; + buffer[index++] = (value >> 8) & 0xff; + buffer[index++] = (value >> 16) & 0xff; + buffer[index++] = (value >> 24) & 0xff; + return index; + } + function serializeDouble(buffer, key, value, index, isArray) { + // Encode as double + buffer[index++] = BSON_DATA_NUMBER; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Write float + writeIEEE754(buffer, value.value, index, 'little', 52, 8); + // Adjust index + index = index + 8; + return index; + } + function serializeFunction(buffer, key, value, index, _checkKeys, _depth, isArray) { + buffer[index++] = BSON_DATA_CODE; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Function string + var functionString = normalizedFunctionString(value); + // Write the string + var size = buffer.write(functionString, index + 4, undefined, 'utf8') + 1; + // Write the size of the string to buffer + buffer[index] = size & 0xff; + buffer[index + 1] = (size >> 8) & 0xff; + buffer[index + 2] = (size >> 16) & 0xff; + buffer[index + 3] = (size >> 24) & 0xff; + // Update index + index = index + 4 + size - 1; + // Write zero + buffer[index++] = 0; + return index; + } + function serializeCode(buffer, key, value, index, checkKeys, depth, serializeFunctions, ignoreUndefined, isArray) { + if (checkKeys === void 0) { checkKeys = false; } + if (depth === void 0) { depth = 0; } + if (serializeFunctions === void 0) { serializeFunctions = false; } + if (ignoreUndefined === void 0) { ignoreUndefined = true; } + if (isArray === void 0) { isArray = false; } + if (value.scope && typeof value.scope === 'object') { + // Write the type + buffer[index++] = BSON_DATA_CODE_W_SCOPE; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Starting index + var startIndex = index; + // Serialize the function + // Get the function string + var functionString = typeof value.code === 'string' ? value.code : value.code.toString(); + // Index adjustment + index = index + 4; + // Write string into buffer + var codeSize = buffer.write(functionString, index + 4, undefined, 'utf8') + 1; + // Write the size of the string to buffer + buffer[index] = codeSize & 0xff; + buffer[index + 1] = (codeSize >> 8) & 0xff; + buffer[index + 2] = (codeSize >> 16) & 0xff; + buffer[index + 3] = (codeSize >> 24) & 0xff; + // Write end 0 + buffer[index + 4 + codeSize - 1] = 0; + // Write the + index = index + codeSize + 4; + // + // Serialize the scope value + var endIndex = serializeInto(buffer, value.scope, checkKeys, index, depth + 1, serializeFunctions, ignoreUndefined); + index = endIndex - 1; + // Writ the total + var totalSize = endIndex - startIndex; + // Write the total size of the object + buffer[startIndex++] = totalSize & 0xff; + buffer[startIndex++] = (totalSize >> 8) & 0xff; + buffer[startIndex++] = (totalSize >> 16) & 0xff; + buffer[startIndex++] = (totalSize >> 24) & 0xff; + // Write trailing zero + buffer[index++] = 0; + } + else { + buffer[index++] = BSON_DATA_CODE; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Function string + var functionString = value.code.toString(); + // Write the string + var size = buffer.write(functionString, index + 4, undefined, 'utf8') + 1; + // Write the size of the string to buffer + buffer[index] = size & 0xff; + buffer[index + 1] = (size >> 8) & 0xff; + buffer[index + 2] = (size >> 16) & 0xff; + buffer[index + 3] = (size >> 24) & 0xff; + // Update index + index = index + 4 + size - 1; + // Write zero + buffer[index++] = 0; + } + return index; + } + function serializeBinary(buffer, key, value, index, isArray) { + // Write the type + buffer[index++] = BSON_DATA_BINARY; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Extract the buffer + var data = value.value(true); + // Calculate size + var size = value.position; + // Add the deprecated 02 type 4 bytes of size to total + if (value.sub_type === Binary.SUBTYPE_BYTE_ARRAY) + size = size + 4; + // Write the size of the string to buffer + buffer[index++] = size & 0xff; + buffer[index++] = (size >> 8) & 0xff; + buffer[index++] = (size >> 16) & 0xff; + buffer[index++] = (size >> 24) & 0xff; + // Write the subtype to the buffer + buffer[index++] = value.sub_type; + // If we have binary type 2 the 4 first bytes are the size + if (value.sub_type === Binary.SUBTYPE_BYTE_ARRAY) { + size = size - 4; + buffer[index++] = size & 0xff; + buffer[index++] = (size >> 8) & 0xff; + buffer[index++] = (size >> 16) & 0xff; + buffer[index++] = (size >> 24) & 0xff; + } + // Write the data to the object + buffer.set(data, index); + // Adjust the index + index = index + value.position; + return index; + } + function serializeSymbol(buffer, key, value, index, isArray) { + // Write the type + buffer[index++] = BSON_DATA_SYMBOL; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Write the string + var size = buffer.write(value.value, index + 4, undefined, 'utf8') + 1; + // Write the size of the string to buffer + buffer[index] = size & 0xff; + buffer[index + 1] = (size >> 8) & 0xff; + buffer[index + 2] = (size >> 16) & 0xff; + buffer[index + 3] = (size >> 24) & 0xff; + // Update index + index = index + 4 + size - 1; + // Write zero + buffer[index++] = 0x00; + return index; + } + function serializeDBRef(buffer, key, value, index, depth, serializeFunctions, isArray) { + // Write the type + buffer[index++] = BSON_DATA_OBJECT; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + var startIndex = index; + var output = { + $ref: value.collection || value.namespace, + $id: value.oid + }; + if (value.db != null) { + output.$db = value.db; + } + output = Object.assign(output, value.fields); + var endIndex = serializeInto(buffer, output, false, index, depth + 1, serializeFunctions); + // Calculate object size + var size = endIndex - startIndex; + // Write the size + buffer[startIndex++] = size & 0xff; + buffer[startIndex++] = (size >> 8) & 0xff; + buffer[startIndex++] = (size >> 16) & 0xff; + buffer[startIndex++] = (size >> 24) & 0xff; + // Set index + return endIndex; + } + function serializeInto(buffer, object, checkKeys, startingIndex, depth, serializeFunctions, ignoreUndefined, path) { + if (checkKeys === void 0) { checkKeys = false; } + if (startingIndex === void 0) { startingIndex = 0; } + if (depth === void 0) { depth = 0; } + if (serializeFunctions === void 0) { serializeFunctions = false; } + if (ignoreUndefined === void 0) { ignoreUndefined = true; } + if (path === void 0) { path = []; } + startingIndex = startingIndex || 0; + path = path || []; + // Push the object to the path + path.push(object); + // Start place to serialize into + var index = startingIndex + 4; + // Special case isArray + if (Array.isArray(object)) { + // Get object keys + for (var i = 0; i < object.length; i++) { + var key = '' + i; + var value = object[i]; + // Is there an override value + if (typeof (value === null || value === void 0 ? void 0 : value.toBSON) === 'function') { + value = value.toBSON(); + } + if (typeof value === 'string') { + index = serializeString(buffer, key, value, index, true); + } + else if (typeof value === 'number') { + index = serializeNumber(buffer, key, value, index, true); + } + else if (typeof value === 'bigint') { + throw new BSONTypeError('Unsupported type BigInt, please use Decimal128'); + } + else if (typeof value === 'boolean') { + index = serializeBoolean(buffer, key, value, index, true); + } + else if (value instanceof Date || isDate(value)) { + index = serializeDate(buffer, key, value, index, true); + } + else if (value === undefined) { + index = serializeNull(buffer, key, value, index, true); + } + else if (value === null) { + index = serializeNull(buffer, key, value, index, true); + } + else if (value['_bsontype'] === 'ObjectId' || value['_bsontype'] === 'ObjectID') { + index = serializeObjectId(buffer, key, value, index, true); + } + else if (isUint8Array(value)) { + index = serializeBuffer(buffer, key, value, index, true); + } + else if (value instanceof RegExp || isRegExp(value)) { + index = serializeRegExp(buffer, key, value, index, true); + } + else if (typeof value === 'object' && value['_bsontype'] == null) { + index = serializeObject(buffer, key, value, index, checkKeys, depth, serializeFunctions, ignoreUndefined, true, path); + } + else if (typeof value === 'object' && + isBSONType(value) && + value._bsontype === 'Decimal128') { + index = serializeDecimal128(buffer, key, value, index, true); + } + else if (value['_bsontype'] === 'Long' || value['_bsontype'] === 'Timestamp') { + index = serializeLong(buffer, key, value, index, true); + } + else if (value['_bsontype'] === 'Double') { + index = serializeDouble(buffer, key, value, index, true); + } + else if (typeof value === 'function' && serializeFunctions) { + index = serializeFunction(buffer, key, value, index, checkKeys, depth, true); + } + else if (value['_bsontype'] === 'Code') { + index = serializeCode(buffer, key, value, index, checkKeys, depth, serializeFunctions, ignoreUndefined, true); + } + else if (value['_bsontype'] === 'Binary') { + index = serializeBinary(buffer, key, value, index, true); + } + else if (value['_bsontype'] === 'Symbol') { + index = serializeSymbol(buffer, key, value, index, true); + } + else if (value['_bsontype'] === 'DBRef') { + index = serializeDBRef(buffer, key, value, index, depth, serializeFunctions, true); + } + else if (value['_bsontype'] === 'BSONRegExp') { + index = serializeBSONRegExp(buffer, key, value, index, true); + } + else if (value['_bsontype'] === 'Int32') { + index = serializeInt32(buffer, key, value, index, true); + } + else if (value['_bsontype'] === 'MinKey' || value['_bsontype'] === 'MaxKey') { + index = serializeMinMax(buffer, key, value, index, true); + } + else if (typeof value['_bsontype'] !== 'undefined') { + throw new BSONTypeError('Unrecognized or invalid _bsontype: ' + value['_bsontype']); + } + } + } + else if (object instanceof exports.Map || isMap(object)) { + var iterator = object.entries(); + var done = false; + while (!done) { + // Unpack the next entry + var entry = iterator.next(); + done = !!entry.done; + // Are we done, then skip and terminate + if (done) + continue; + // Get the entry values + var key = entry.value[0]; + var value = entry.value[1]; + // Check the type of the value + var type = typeof value; + // Check the key and throw error if it's illegal + if (typeof key === 'string' && !ignoreKeys.has(key)) { + if (key.match(regexp) != null) { + // The BSON spec doesn't allow keys with null bytes because keys are + // null-terminated. + throw Error('key ' + key + ' must not contain null bytes'); + } + if (checkKeys) { + if ('$' === key[0]) { + throw Error('key ' + key + " must not start with '$'"); + } + else if (~key.indexOf('.')) { + throw Error('key ' + key + " must not contain '.'"); + } + } + } + if (type === 'string') { + index = serializeString(buffer, key, value, index); + } + else if (type === 'number') { + index = serializeNumber(buffer, key, value, index); + } + else if (type === 'bigint' || isBigInt64Array(value) || isBigUInt64Array(value)) { + throw new BSONTypeError('Unsupported type BigInt, please use Decimal128'); + } + else if (type === 'boolean') { + index = serializeBoolean(buffer, key, value, index); + } + else if (value instanceof Date || isDate(value)) { + index = serializeDate(buffer, key, value, index); + } + else if (value === null || (value === undefined && ignoreUndefined === false)) { + index = serializeNull(buffer, key, value, index); + } + else if (value['_bsontype'] === 'ObjectId' || value['_bsontype'] === 'ObjectID') { + index = serializeObjectId(buffer, key, value, index); + } + else if (isUint8Array(value)) { + index = serializeBuffer(buffer, key, value, index); + } + else if (value instanceof RegExp || isRegExp(value)) { + index = serializeRegExp(buffer, key, value, index); + } + else if (type === 'object' && value['_bsontype'] == null) { + index = serializeObject(buffer, key, value, index, checkKeys, depth, serializeFunctions, ignoreUndefined, false, path); + } + else if (type === 'object' && value['_bsontype'] === 'Decimal128') { + index = serializeDecimal128(buffer, key, value, index); + } + else if (value['_bsontype'] === 'Long' || value['_bsontype'] === 'Timestamp') { + index = serializeLong(buffer, key, value, index); + } + else if (value['_bsontype'] === 'Double') { + index = serializeDouble(buffer, key, value, index); + } + else if (value['_bsontype'] === 'Code') { + index = serializeCode(buffer, key, value, index, checkKeys, depth, serializeFunctions, ignoreUndefined); + } + else if (typeof value === 'function' && serializeFunctions) { + index = serializeFunction(buffer, key, value, index, checkKeys, depth, serializeFunctions); + } + else if (value['_bsontype'] === 'Binary') { + index = serializeBinary(buffer, key, value, index); + } + else if (value['_bsontype'] === 'Symbol') { + index = serializeSymbol(buffer, key, value, index); + } + else if (value['_bsontype'] === 'DBRef') { + index = serializeDBRef(buffer, key, value, index, depth, serializeFunctions); + } + else if (value['_bsontype'] === 'BSONRegExp') { + index = serializeBSONRegExp(buffer, key, value, index); + } + else if (value['_bsontype'] === 'Int32') { + index = serializeInt32(buffer, key, value, index); + } + else if (value['_bsontype'] === 'MinKey' || value['_bsontype'] === 'MaxKey') { + index = serializeMinMax(buffer, key, value, index); + } + else if (typeof value['_bsontype'] !== 'undefined') { + throw new BSONTypeError('Unrecognized or invalid _bsontype: ' + value['_bsontype']); + } + } + } + else { + if (typeof (object === null || object === void 0 ? void 0 : object.toBSON) === 'function') { + // Provided a custom serialization method + object = object.toBSON(); + if (object != null && typeof object !== 'object') { + throw new BSONTypeError('toBSON function did not return an object'); + } + } + // Iterate over all the keys + for (var key in object) { + var value = object[key]; + // Is there an override value + if (typeof (value === null || value === void 0 ? void 0 : value.toBSON) === 'function') { + value = value.toBSON(); + } + // Check the type of the value + var type = typeof value; + // Check the key and throw error if it's illegal + if (typeof key === 'string' && !ignoreKeys.has(key)) { + if (key.match(regexp) != null) { + // The BSON spec doesn't allow keys with null bytes because keys are + // null-terminated. + throw Error('key ' + key + ' must not contain null bytes'); + } + if (checkKeys) { + if ('$' === key[0]) { + throw Error('key ' + key + " must not start with '$'"); + } + else if (~key.indexOf('.')) { + throw Error('key ' + key + " must not contain '.'"); + } + } + } + if (type === 'string') { + index = serializeString(buffer, key, value, index); + } + else if (type === 'number') { + index = serializeNumber(buffer, key, value, index); + } + else if (type === 'bigint') { + throw new BSONTypeError('Unsupported type BigInt, please use Decimal128'); + } + else if (type === 'boolean') { + index = serializeBoolean(buffer, key, value, index); + } + else if (value instanceof Date || isDate(value)) { + index = serializeDate(buffer, key, value, index); + } + else if (value === undefined) { + if (ignoreUndefined === false) + index = serializeNull(buffer, key, value, index); + } + else if (value === null) { + index = serializeNull(buffer, key, value, index); + } + else if (value['_bsontype'] === 'ObjectId' || value['_bsontype'] === 'ObjectID') { + index = serializeObjectId(buffer, key, value, index); + } + else if (isUint8Array(value)) { + index = serializeBuffer(buffer, key, value, index); + } + else if (value instanceof RegExp || isRegExp(value)) { + index = serializeRegExp(buffer, key, value, index); + } + else if (type === 'object' && value['_bsontype'] == null) { + index = serializeObject(buffer, key, value, index, checkKeys, depth, serializeFunctions, ignoreUndefined, false, path); + } + else if (type === 'object' && value['_bsontype'] === 'Decimal128') { + index = serializeDecimal128(buffer, key, value, index); + } + else if (value['_bsontype'] === 'Long' || value['_bsontype'] === 'Timestamp') { + index = serializeLong(buffer, key, value, index); + } + else if (value['_bsontype'] === 'Double') { + index = serializeDouble(buffer, key, value, index); + } + else if (value['_bsontype'] === 'Code') { + index = serializeCode(buffer, key, value, index, checkKeys, depth, serializeFunctions, ignoreUndefined); + } + else if (typeof value === 'function' && serializeFunctions) { + index = serializeFunction(buffer, key, value, index, checkKeys, depth, serializeFunctions); + } + else if (value['_bsontype'] === 'Binary') { + index = serializeBinary(buffer, key, value, index); + } + else if (value['_bsontype'] === 'Symbol') { + index = serializeSymbol(buffer, key, value, index); + } + else if (value['_bsontype'] === 'DBRef') { + index = serializeDBRef(buffer, key, value, index, depth, serializeFunctions); + } + else if (value['_bsontype'] === 'BSONRegExp') { + index = serializeBSONRegExp(buffer, key, value, index); + } + else if (value['_bsontype'] === 'Int32') { + index = serializeInt32(buffer, key, value, index); + } + else if (value['_bsontype'] === 'MinKey' || value['_bsontype'] === 'MaxKey') { + index = serializeMinMax(buffer, key, value, index); + } + else if (typeof value['_bsontype'] !== 'undefined') { + throw new BSONTypeError('Unrecognized or invalid _bsontype: ' + value['_bsontype']); + } + } + } + // Remove the path + path.pop(); + // Final padding byte for object + buffer[index++] = 0x00; + // Final size + var size = index - startingIndex; + // Write the size of the object + buffer[startingIndex++] = size & 0xff; + buffer[startingIndex++] = (size >> 8) & 0xff; + buffer[startingIndex++] = (size >> 16) & 0xff; + buffer[startingIndex++] = (size >> 24) & 0xff; + return index; + } + + /** @internal */ + // Default Max Size + var MAXSIZE = 1024 * 1024 * 17; + // Current Internal Temporary Serialization Buffer + var buffer = buffer_1.alloc(MAXSIZE); + /** + * Sets the size of the internal serialization buffer. + * + * @param size - The desired size for the internal serialization buffer + * @public + */ + function setInternalBufferSize(size) { + // Resize the internal serialization buffer if needed + if (buffer.length < size) { + buffer = buffer_1.alloc(size); + } + } + /** + * Serialize a Javascript object. + * + * @param object - the Javascript object to serialize. + * @returns Buffer object containing the serialized object. + * @public + */ + function serialize(object, options) { + if (options === void 0) { options = {}; } + // Unpack the options + var checkKeys = typeof options.checkKeys === 'boolean' ? options.checkKeys : false; + var serializeFunctions = typeof options.serializeFunctions === 'boolean' ? options.serializeFunctions : false; + var ignoreUndefined = typeof options.ignoreUndefined === 'boolean' ? options.ignoreUndefined : true; + var minInternalBufferSize = typeof options.minInternalBufferSize === 'number' ? options.minInternalBufferSize : MAXSIZE; + // Resize the internal serialization buffer if needed + if (buffer.length < minInternalBufferSize) { + buffer = buffer_1.alloc(minInternalBufferSize); + } + // Attempt to serialize + var serializationIndex = serializeInto(buffer, object, checkKeys, 0, 0, serializeFunctions, ignoreUndefined, []); + // Create the final buffer + var finishedBuffer = buffer_1.alloc(serializationIndex); + // Copy into the finished buffer + buffer.copy(finishedBuffer, 0, 0, finishedBuffer.length); + // Return the buffer + return finishedBuffer; + } + /** + * Serialize a Javascript object using a predefined Buffer and index into the buffer, + * useful when pre-allocating the space for serialization. + * + * @param object - the Javascript object to serialize. + * @param finalBuffer - the Buffer you pre-allocated to store the serialized BSON object. + * @returns the index pointing to the last written byte in the buffer. + * @public + */ + function serializeWithBufferAndIndex(object, finalBuffer, options) { + if (options === void 0) { options = {}; } + // Unpack the options + var checkKeys = typeof options.checkKeys === 'boolean' ? options.checkKeys : false; + var serializeFunctions = typeof options.serializeFunctions === 'boolean' ? options.serializeFunctions : false; + var ignoreUndefined = typeof options.ignoreUndefined === 'boolean' ? options.ignoreUndefined : true; + var startIndex = typeof options.index === 'number' ? options.index : 0; + // Attempt to serialize + var serializationIndex = serializeInto(buffer, object, checkKeys, 0, 0, serializeFunctions, ignoreUndefined); + buffer.copy(finalBuffer, startIndex, 0, serializationIndex); + // Return the index + return startIndex + serializationIndex - 1; + } + /** + * Deserialize data as BSON. + * + * @param buffer - the buffer containing the serialized set of BSON documents. + * @returns returns the deserialized Javascript Object. + * @public + */ + function deserialize(buffer, options) { + if (options === void 0) { options = {}; } + return deserialize$1(buffer instanceof buffer_1 ? buffer : ensureBuffer(buffer), options); + } + /** + * Calculate the bson size for a passed in Javascript object. + * + * @param object - the Javascript object to calculate the BSON byte size for + * @returns size of BSON object in bytes + * @public + */ + function calculateObjectSize(object, options) { + if (options === void 0) { options = {}; } + options = options || {}; + var serializeFunctions = typeof options.serializeFunctions === 'boolean' ? options.serializeFunctions : false; + var ignoreUndefined = typeof options.ignoreUndefined === 'boolean' ? options.ignoreUndefined : true; + return calculateObjectSize$1(object, serializeFunctions, ignoreUndefined); + } + /** + * Deserialize stream data as BSON documents. + * + * @param data - the buffer containing the serialized set of BSON documents. + * @param startIndex - the start index in the data Buffer where the deserialization is to start. + * @param numberOfDocuments - number of documents to deserialize. + * @param documents - an array where to store the deserialized documents. + * @param docStartIndex - the index in the documents array from where to start inserting documents. + * @param options - additional options used for the deserialization. + * @returns next index in the buffer after deserialization **x** numbers of documents. + * @public + */ + function deserializeStream(data, startIndex, numberOfDocuments, documents, docStartIndex, options) { + var internalOptions = Object.assign({ allowObjectSmallerThanBufferSize: true, index: 0 }, options); + var bufferData = ensureBuffer(data); + var index = startIndex; + // Loop over all documents + for (var i = 0; i < numberOfDocuments; i++) { + // Find size of the document + var size = bufferData[index] | + (bufferData[index + 1] << 8) | + (bufferData[index + 2] << 16) | + (bufferData[index + 3] << 24); + // Update options with index + internalOptions.index = index; + // Parse the document at this point + documents[docStartIndex + i] = deserialize$1(bufferData, internalOptions); + // Adjust index by the document size + index = index + size; + } + // Return object containing end index of parsing and list of documents + return index; + } + /** + * BSON default export + * @deprecated Please use named exports + * @privateRemarks + * We want to someday deprecate the default export, + * so none of the new TS types are being exported on the default + * @public + */ + var BSON = { + Binary: Binary, + Code: Code, + DBRef: DBRef, + Decimal128: Decimal128, + Double: Double, + Int32: Int32, + Long: Long, + UUID: UUID, + Map: exports.Map, + MaxKey: MaxKey, + MinKey: MinKey, + ObjectId: ObjectId, + ObjectID: ObjectId, + BSONRegExp: BSONRegExp, + BSONSymbol: BSONSymbol, + Timestamp: Timestamp, + EJSON: exports.EJSON, + setInternalBufferSize: setInternalBufferSize, + serialize: serialize, + serializeWithBufferAndIndex: serializeWithBufferAndIndex, + deserialize: deserialize, + calculateObjectSize: calculateObjectSize, + deserializeStream: deserializeStream, + BSONError: BSONError, + BSONTypeError: BSONTypeError + }; + + exports.BSONError = BSONError; + exports.BSONRegExp = BSONRegExp; + exports.BSONSymbol = BSONSymbol; + exports.BSONTypeError = BSONTypeError; + exports.BSON_BINARY_SUBTYPE_BYTE_ARRAY = BSON_BINARY_SUBTYPE_BYTE_ARRAY; + exports.BSON_BINARY_SUBTYPE_COLUMN = BSON_BINARY_SUBTYPE_COLUMN; + exports.BSON_BINARY_SUBTYPE_DEFAULT = BSON_BINARY_SUBTYPE_DEFAULT; + exports.BSON_BINARY_SUBTYPE_ENCRYPTED = BSON_BINARY_SUBTYPE_ENCRYPTED; + exports.BSON_BINARY_SUBTYPE_FUNCTION = BSON_BINARY_SUBTYPE_FUNCTION; + exports.BSON_BINARY_SUBTYPE_MD5 = BSON_BINARY_SUBTYPE_MD5; + exports.BSON_BINARY_SUBTYPE_USER_DEFINED = BSON_BINARY_SUBTYPE_USER_DEFINED; + exports.BSON_BINARY_SUBTYPE_UUID = BSON_BINARY_SUBTYPE_UUID; + exports.BSON_BINARY_SUBTYPE_UUID_NEW = BSON_BINARY_SUBTYPE_UUID_NEW; + exports.BSON_DATA_ARRAY = BSON_DATA_ARRAY; + exports.BSON_DATA_BINARY = BSON_DATA_BINARY; + exports.BSON_DATA_BOOLEAN = BSON_DATA_BOOLEAN; + exports.BSON_DATA_CODE = BSON_DATA_CODE; + exports.BSON_DATA_CODE_W_SCOPE = BSON_DATA_CODE_W_SCOPE; + exports.BSON_DATA_DATE = BSON_DATA_DATE; + exports.BSON_DATA_DBPOINTER = BSON_DATA_DBPOINTER; + exports.BSON_DATA_DECIMAL128 = BSON_DATA_DECIMAL128; + exports.BSON_DATA_INT = BSON_DATA_INT; + exports.BSON_DATA_LONG = BSON_DATA_LONG; + exports.BSON_DATA_MAX_KEY = BSON_DATA_MAX_KEY; + exports.BSON_DATA_MIN_KEY = BSON_DATA_MIN_KEY; + exports.BSON_DATA_NULL = BSON_DATA_NULL; + exports.BSON_DATA_NUMBER = BSON_DATA_NUMBER; + exports.BSON_DATA_OBJECT = BSON_DATA_OBJECT; + exports.BSON_DATA_OID = BSON_DATA_OID; + exports.BSON_DATA_REGEXP = BSON_DATA_REGEXP; + exports.BSON_DATA_STRING = BSON_DATA_STRING; + exports.BSON_DATA_SYMBOL = BSON_DATA_SYMBOL; + exports.BSON_DATA_TIMESTAMP = BSON_DATA_TIMESTAMP; + exports.BSON_DATA_UNDEFINED = BSON_DATA_UNDEFINED; + exports.BSON_INT32_MAX = BSON_INT32_MAX; + exports.BSON_INT32_MIN = BSON_INT32_MIN; + exports.BSON_INT64_MAX = BSON_INT64_MAX; + exports.BSON_INT64_MIN = BSON_INT64_MIN; + exports.Binary = Binary; + exports.Code = Code; + exports.DBRef = DBRef; + exports.Decimal128 = Decimal128; + exports.Double = Double; + exports.Int32 = Int32; + exports.Long = Long; + exports.LongWithoutOverridesClass = LongWithoutOverridesClass; + exports.MaxKey = MaxKey; + exports.MinKey = MinKey; + exports.ObjectID = ObjectId; + exports.ObjectId = ObjectId; + exports.Timestamp = Timestamp; + exports.UUID = UUID; + exports.calculateObjectSize = calculateObjectSize; + exports.default = BSON; + exports.deserialize = deserialize; + exports.deserializeStream = deserializeStream; + exports.serialize = serialize; + exports.serializeWithBufferAndIndex = serializeWithBufferAndIndex; + exports.setInternalBufferSize = setInternalBufferSize; + + Object.defineProperty(exports, '__esModule', { value: true }); + +}))); +//# sourceMappingURL=bson.browser.umd.js.map diff --git a/node_modules/bson/dist/bson.browser.umd.js.map b/node_modules/bson/dist/bson.browser.umd.js.map new file mode 100644 index 000000000..972ec27c0 --- /dev/null +++ b/node_modules/bson/dist/bson.browser.umd.js.map @@ -0,0 +1 @@ +{"version":3,"file":"bson.browser.umd.js","sources":["../node_modules/base64-js/index.js","../node_modules/ieee754/index.js","../node_modules/buffer/index.js","../node_modules/tslib/tslib.es6.js","../src/error.ts","../src/utils/global.ts","../src/parser/utils.ts","../src/ensure_buffer.ts","../src/uuid_utils.ts","../src/uuid.ts","../src/binary.ts","../src/code.ts","../src/db_ref.ts","../src/long.ts","../src/decimal128.ts","../src/double.ts","../src/int_32.ts","../src/max_key.ts","../src/min_key.ts","../src/objectid.ts","../src/regexp.ts","../src/symbol.ts","../src/timestamp.ts","../src/extended_json.ts","../src/map.ts","../src/constants.ts","../src/parser/calculate_size.ts","../src/validate_utf8.ts","../src/parser/deserializer.ts","../src/float_parser.ts","../src/parser/serializer.ts","../src/bson.ts"],"sourcesContent":["'use strict'\n\nexports.byteLength = byteLength\nexports.toByteArray = toByteArray\nexports.fromByteArray = fromByteArray\n\nvar lookup = []\nvar revLookup = []\nvar Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array\n\nvar code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'\nfor (var i = 0, len = code.length; i < len; ++i) {\n lookup[i] = code[i]\n revLookup[code.charCodeAt(i)] = i\n}\n\n// Support decoding URL-safe base64 strings, as Node.js does.\n// See: https://en.wikipedia.org/wiki/Base64#URL_applications\nrevLookup['-'.charCodeAt(0)] = 62\nrevLookup['_'.charCodeAt(0)] = 63\n\nfunction getLens (b64) {\n var len = b64.length\n\n if (len % 4 > 0) {\n throw new Error('Invalid string. Length must be a multiple of 4')\n }\n\n // Trim off extra bytes after placeholder bytes are found\n // See: https://github.com/beatgammit/base64-js/issues/42\n var validLen = b64.indexOf('=')\n if (validLen === -1) validLen = len\n\n var placeHoldersLen = validLen === len\n ? 0\n : 4 - (validLen % 4)\n\n return [validLen, placeHoldersLen]\n}\n\n// base64 is 4/3 + up to two characters of the original data\nfunction byteLength (b64) {\n var lens = getLens(b64)\n var validLen = lens[0]\n var placeHoldersLen = lens[1]\n return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen\n}\n\nfunction _byteLength (b64, validLen, placeHoldersLen) {\n return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen\n}\n\nfunction toByteArray (b64) {\n var tmp\n var lens = getLens(b64)\n var validLen = lens[0]\n var placeHoldersLen = lens[1]\n\n var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen))\n\n var curByte = 0\n\n // if there are placeholders, only get up to the last complete 4 chars\n var len = placeHoldersLen > 0\n ? validLen - 4\n : validLen\n\n var i\n for (i = 0; i < len; i += 4) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 18) |\n (revLookup[b64.charCodeAt(i + 1)] << 12) |\n (revLookup[b64.charCodeAt(i + 2)] << 6) |\n revLookup[b64.charCodeAt(i + 3)]\n arr[curByte++] = (tmp >> 16) & 0xFF\n arr[curByte++] = (tmp >> 8) & 0xFF\n arr[curByte++] = tmp & 0xFF\n }\n\n if (placeHoldersLen === 2) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 2) |\n (revLookup[b64.charCodeAt(i + 1)] >> 4)\n arr[curByte++] = tmp & 0xFF\n }\n\n if (placeHoldersLen === 1) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 10) |\n (revLookup[b64.charCodeAt(i + 1)] << 4) |\n (revLookup[b64.charCodeAt(i + 2)] >> 2)\n arr[curByte++] = (tmp >> 8) & 0xFF\n arr[curByte++] = tmp & 0xFF\n }\n\n return arr\n}\n\nfunction tripletToBase64 (num) {\n return lookup[num >> 18 & 0x3F] +\n lookup[num >> 12 & 0x3F] +\n lookup[num >> 6 & 0x3F] +\n lookup[num & 0x3F]\n}\n\nfunction encodeChunk (uint8, start, end) {\n var tmp\n var output = []\n for (var i = start; i < end; i += 3) {\n tmp =\n ((uint8[i] << 16) & 0xFF0000) +\n ((uint8[i + 1] << 8) & 0xFF00) +\n (uint8[i + 2] & 0xFF)\n output.push(tripletToBase64(tmp))\n }\n return output.join('')\n}\n\nfunction fromByteArray (uint8) {\n var tmp\n var len = uint8.length\n var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes\n var parts = []\n var maxChunkLength = 16383 // must be multiple of 3\n\n // go through the array every three bytes, we'll deal with trailing stuff later\n for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {\n parts.push(encodeChunk(uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)))\n }\n\n // pad the end with zeros, but make sure to not forget the extra bytes\n if (extraBytes === 1) {\n tmp = uint8[len - 1]\n parts.push(\n lookup[tmp >> 2] +\n lookup[(tmp << 4) & 0x3F] +\n '=='\n )\n } else if (extraBytes === 2) {\n tmp = (uint8[len - 2] << 8) + uint8[len - 1]\n parts.push(\n lookup[tmp >> 10] +\n lookup[(tmp >> 4) & 0x3F] +\n lookup[(tmp << 2) & 0x3F] +\n '='\n )\n }\n\n return parts.join('')\n}\n","/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */\nexports.read = function (buffer, offset, isLE, mLen, nBytes) {\n var e, m\n var eLen = (nBytes * 8) - mLen - 1\n var eMax = (1 << eLen) - 1\n var eBias = eMax >> 1\n var nBits = -7\n var i = isLE ? (nBytes - 1) : 0\n var d = isLE ? -1 : 1\n var s = buffer[offset + i]\n\n i += d\n\n e = s & ((1 << (-nBits)) - 1)\n s >>= (-nBits)\n nBits += eLen\n for (; nBits > 0; e = (e * 256) + buffer[offset + i], i += d, nBits -= 8) {}\n\n m = e & ((1 << (-nBits)) - 1)\n e >>= (-nBits)\n nBits += mLen\n for (; nBits > 0; m = (m * 256) + buffer[offset + i], i += d, nBits -= 8) {}\n\n if (e === 0) {\n e = 1 - eBias\n } else if (e === eMax) {\n return m ? NaN : ((s ? -1 : 1) * Infinity)\n } else {\n m = m + Math.pow(2, mLen)\n e = e - eBias\n }\n return (s ? -1 : 1) * m * Math.pow(2, e - mLen)\n}\n\nexports.write = function (buffer, value, offset, isLE, mLen, nBytes) {\n var e, m, c\n var eLen = (nBytes * 8) - mLen - 1\n var eMax = (1 << eLen) - 1\n var eBias = eMax >> 1\n var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0)\n var i = isLE ? 0 : (nBytes - 1)\n var d = isLE ? 1 : -1\n var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0\n\n value = Math.abs(value)\n\n if (isNaN(value) || value === Infinity) {\n m = isNaN(value) ? 1 : 0\n e = eMax\n } else {\n e = Math.floor(Math.log(value) / Math.LN2)\n if (value * (c = Math.pow(2, -e)) < 1) {\n e--\n c *= 2\n }\n if (e + eBias >= 1) {\n value += rt / c\n } else {\n value += rt * Math.pow(2, 1 - eBias)\n }\n if (value * c >= 2) {\n e++\n c /= 2\n }\n\n if (e + eBias >= eMax) {\n m = 0\n e = eMax\n } else if (e + eBias >= 1) {\n m = ((value * c) - 1) * Math.pow(2, mLen)\n e = e + eBias\n } else {\n m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen)\n e = 0\n }\n }\n\n for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {}\n\n e = (e << mLen) | m\n eLen += mLen\n for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {}\n\n buffer[offset + i - d] |= s * 128\n}\n","/*!\n * The buffer module from node.js, for the browser.\n *\n * @author Feross Aboukhadijeh \n * @license MIT\n */\n/* eslint-disable no-proto */\n\n'use strict'\n\nvar base64 = require('base64-js')\nvar ieee754 = require('ieee754')\nvar customInspectSymbol =\n (typeof Symbol === 'function' && typeof Symbol['for'] === 'function') // eslint-disable-line dot-notation\n ? Symbol['for']('nodejs.util.inspect.custom') // eslint-disable-line dot-notation\n : null\n\nexports.Buffer = Buffer\nexports.SlowBuffer = SlowBuffer\nexports.INSPECT_MAX_BYTES = 50\n\nvar K_MAX_LENGTH = 0x7fffffff\nexports.kMaxLength = K_MAX_LENGTH\n\n/**\n * If `Buffer.TYPED_ARRAY_SUPPORT`:\n * === true Use Uint8Array implementation (fastest)\n * === false Print warning and recommend using `buffer` v4.x which has an Object\n * implementation (most compatible, even IE6)\n *\n * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,\n * Opera 11.6+, iOS 4.2+.\n *\n * We report that the browser does not support typed arrays if the are not subclassable\n * using __proto__. Firefox 4-29 lacks support for adding new properties to `Uint8Array`\n * (See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438). IE 10 lacks support\n * for __proto__ and has a buggy typed array implementation.\n */\nBuffer.TYPED_ARRAY_SUPPORT = typedArraySupport()\n\nif (!Buffer.TYPED_ARRAY_SUPPORT && typeof console !== 'undefined' &&\n typeof console.error === 'function') {\n console.error(\n 'This browser lacks typed array (Uint8Array) support which is required by ' +\n '`buffer` v5.x. Use `buffer` v4.x if you require old browser support.'\n )\n}\n\nfunction typedArraySupport () {\n // Can typed array instances can be augmented?\n try {\n var arr = new Uint8Array(1)\n var proto = { foo: function () { return 42 } }\n Object.setPrototypeOf(proto, Uint8Array.prototype)\n Object.setPrototypeOf(arr, proto)\n return arr.foo() === 42\n } catch (e) {\n return false\n }\n}\n\nObject.defineProperty(Buffer.prototype, 'parent', {\n enumerable: true,\n get: function () {\n if (!Buffer.isBuffer(this)) return undefined\n return this.buffer\n }\n})\n\nObject.defineProperty(Buffer.prototype, 'offset', {\n enumerable: true,\n get: function () {\n if (!Buffer.isBuffer(this)) return undefined\n return this.byteOffset\n }\n})\n\nfunction createBuffer (length) {\n if (length > K_MAX_LENGTH) {\n throw new RangeError('The value \"' + length + '\" is invalid for option \"size\"')\n }\n // Return an augmented `Uint8Array` instance\n var buf = new Uint8Array(length)\n Object.setPrototypeOf(buf, Buffer.prototype)\n return buf\n}\n\n/**\n * The Buffer constructor returns instances of `Uint8Array` that have their\n * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of\n * `Uint8Array`, so the returned instances will have all the node `Buffer` methods\n * and the `Uint8Array` methods. Square bracket notation works as expected -- it\n * returns a single octet.\n *\n * The `Uint8Array` prototype remains unmodified.\n */\n\nfunction Buffer (arg, encodingOrOffset, length) {\n // Common case.\n if (typeof arg === 'number') {\n if (typeof encodingOrOffset === 'string') {\n throw new TypeError(\n 'The \"string\" argument must be of type string. Received type number'\n )\n }\n return allocUnsafe(arg)\n }\n return from(arg, encodingOrOffset, length)\n}\n\nBuffer.poolSize = 8192 // not used by this implementation\n\nfunction from (value, encodingOrOffset, length) {\n if (typeof value === 'string') {\n return fromString(value, encodingOrOffset)\n }\n\n if (ArrayBuffer.isView(value)) {\n return fromArrayView(value)\n }\n\n if (value == null) {\n throw new TypeError(\n 'The first argument must be one of type string, Buffer, ArrayBuffer, Array, ' +\n 'or Array-like Object. Received type ' + (typeof value)\n )\n }\n\n if (isInstance(value, ArrayBuffer) ||\n (value && isInstance(value.buffer, ArrayBuffer))) {\n return fromArrayBuffer(value, encodingOrOffset, length)\n }\n\n if (typeof SharedArrayBuffer !== 'undefined' &&\n (isInstance(value, SharedArrayBuffer) ||\n (value && isInstance(value.buffer, SharedArrayBuffer)))) {\n return fromArrayBuffer(value, encodingOrOffset, length)\n }\n\n if (typeof value === 'number') {\n throw new TypeError(\n 'The \"value\" argument must not be of type number. Received type number'\n )\n }\n\n var valueOf = value.valueOf && value.valueOf()\n if (valueOf != null && valueOf !== value) {\n return Buffer.from(valueOf, encodingOrOffset, length)\n }\n\n var b = fromObject(value)\n if (b) return b\n\n if (typeof Symbol !== 'undefined' && Symbol.toPrimitive != null &&\n typeof value[Symbol.toPrimitive] === 'function') {\n return Buffer.from(\n value[Symbol.toPrimitive]('string'), encodingOrOffset, length\n )\n }\n\n throw new TypeError(\n 'The first argument must be one of type string, Buffer, ArrayBuffer, Array, ' +\n 'or Array-like Object. Received type ' + (typeof value)\n )\n}\n\n/**\n * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError\n * if value is a number.\n * Buffer.from(str[, encoding])\n * Buffer.from(array)\n * Buffer.from(buffer)\n * Buffer.from(arrayBuffer[, byteOffset[, length]])\n **/\nBuffer.from = function (value, encodingOrOffset, length) {\n return from(value, encodingOrOffset, length)\n}\n\n// Note: Change prototype *after* Buffer.from is defined to workaround Chrome bug:\n// https://github.com/feross/buffer/pull/148\nObject.setPrototypeOf(Buffer.prototype, Uint8Array.prototype)\nObject.setPrototypeOf(Buffer, Uint8Array)\n\nfunction assertSize (size) {\n if (typeof size !== 'number') {\n throw new TypeError('\"size\" argument must be of type number')\n } else if (size < 0) {\n throw new RangeError('The value \"' + size + '\" is invalid for option \"size\"')\n }\n}\n\nfunction alloc (size, fill, encoding) {\n assertSize(size)\n if (size <= 0) {\n return createBuffer(size)\n }\n if (fill !== undefined) {\n // Only pay attention to encoding if it's a string. This\n // prevents accidentally sending in a number that would\n // be interpreted as a start offset.\n return typeof encoding === 'string'\n ? createBuffer(size).fill(fill, encoding)\n : createBuffer(size).fill(fill)\n }\n return createBuffer(size)\n}\n\n/**\n * Creates a new filled Buffer instance.\n * alloc(size[, fill[, encoding]])\n **/\nBuffer.alloc = function (size, fill, encoding) {\n return alloc(size, fill, encoding)\n}\n\nfunction allocUnsafe (size) {\n assertSize(size)\n return createBuffer(size < 0 ? 0 : checked(size) | 0)\n}\n\n/**\n * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance.\n * */\nBuffer.allocUnsafe = function (size) {\n return allocUnsafe(size)\n}\n/**\n * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.\n */\nBuffer.allocUnsafeSlow = function (size) {\n return allocUnsafe(size)\n}\n\nfunction fromString (string, encoding) {\n if (typeof encoding !== 'string' || encoding === '') {\n encoding = 'utf8'\n }\n\n if (!Buffer.isEncoding(encoding)) {\n throw new TypeError('Unknown encoding: ' + encoding)\n }\n\n var length = byteLength(string, encoding) | 0\n var buf = createBuffer(length)\n\n var actual = buf.write(string, encoding)\n\n if (actual !== length) {\n // Writing a hex string, for example, that contains invalid characters will\n // cause everything after the first invalid character to be ignored. (e.g.\n // 'abxxcd' will be treated as 'ab')\n buf = buf.slice(0, actual)\n }\n\n return buf\n}\n\nfunction fromArrayLike (array) {\n var length = array.length < 0 ? 0 : checked(array.length) | 0\n var buf = createBuffer(length)\n for (var i = 0; i < length; i += 1) {\n buf[i] = array[i] & 255\n }\n return buf\n}\n\nfunction fromArrayView (arrayView) {\n if (isInstance(arrayView, Uint8Array)) {\n var copy = new Uint8Array(arrayView)\n return fromArrayBuffer(copy.buffer, copy.byteOffset, copy.byteLength)\n }\n return fromArrayLike(arrayView)\n}\n\nfunction fromArrayBuffer (array, byteOffset, length) {\n if (byteOffset < 0 || array.byteLength < byteOffset) {\n throw new RangeError('\"offset\" is outside of buffer bounds')\n }\n\n if (array.byteLength < byteOffset + (length || 0)) {\n throw new RangeError('\"length\" is outside of buffer bounds')\n }\n\n var buf\n if (byteOffset === undefined && length === undefined) {\n buf = new Uint8Array(array)\n } else if (length === undefined) {\n buf = new Uint8Array(array, byteOffset)\n } else {\n buf = new Uint8Array(array, byteOffset, length)\n }\n\n // Return an augmented `Uint8Array` instance\n Object.setPrototypeOf(buf, Buffer.prototype)\n\n return buf\n}\n\nfunction fromObject (obj) {\n if (Buffer.isBuffer(obj)) {\n var len = checked(obj.length) | 0\n var buf = createBuffer(len)\n\n if (buf.length === 0) {\n return buf\n }\n\n obj.copy(buf, 0, 0, len)\n return buf\n }\n\n if (obj.length !== undefined) {\n if (typeof obj.length !== 'number' || numberIsNaN(obj.length)) {\n return createBuffer(0)\n }\n return fromArrayLike(obj)\n }\n\n if (obj.type === 'Buffer' && Array.isArray(obj.data)) {\n return fromArrayLike(obj.data)\n }\n}\n\nfunction checked (length) {\n // Note: cannot use `length < K_MAX_LENGTH` here because that fails when\n // length is NaN (which is otherwise coerced to zero.)\n if (length >= K_MAX_LENGTH) {\n throw new RangeError('Attempt to allocate Buffer larger than maximum ' +\n 'size: 0x' + K_MAX_LENGTH.toString(16) + ' bytes')\n }\n return length | 0\n}\n\nfunction SlowBuffer (length) {\n if (+length != length) { // eslint-disable-line eqeqeq\n length = 0\n }\n return Buffer.alloc(+length)\n}\n\nBuffer.isBuffer = function isBuffer (b) {\n return b != null && b._isBuffer === true &&\n b !== Buffer.prototype // so Buffer.isBuffer(Buffer.prototype) will be false\n}\n\nBuffer.compare = function compare (a, b) {\n if (isInstance(a, Uint8Array)) a = Buffer.from(a, a.offset, a.byteLength)\n if (isInstance(b, Uint8Array)) b = Buffer.from(b, b.offset, b.byteLength)\n if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) {\n throw new TypeError(\n 'The \"buf1\", \"buf2\" arguments must be one of type Buffer or Uint8Array'\n )\n }\n\n if (a === b) return 0\n\n var x = a.length\n var y = b.length\n\n for (var i = 0, len = Math.min(x, y); i < len; ++i) {\n if (a[i] !== b[i]) {\n x = a[i]\n y = b[i]\n break\n }\n }\n\n if (x < y) return -1\n if (y < x) return 1\n return 0\n}\n\nBuffer.isEncoding = function isEncoding (encoding) {\n switch (String(encoding).toLowerCase()) {\n case 'hex':\n case 'utf8':\n case 'utf-8':\n case 'ascii':\n case 'latin1':\n case 'binary':\n case 'base64':\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return true\n default:\n return false\n }\n}\n\nBuffer.concat = function concat (list, length) {\n if (!Array.isArray(list)) {\n throw new TypeError('\"list\" argument must be an Array of Buffers')\n }\n\n if (list.length === 0) {\n return Buffer.alloc(0)\n }\n\n var i\n if (length === undefined) {\n length = 0\n for (i = 0; i < list.length; ++i) {\n length += list[i].length\n }\n }\n\n var buffer = Buffer.allocUnsafe(length)\n var pos = 0\n for (i = 0; i < list.length; ++i) {\n var buf = list[i]\n if (isInstance(buf, Uint8Array)) {\n if (pos + buf.length > buffer.length) {\n Buffer.from(buf).copy(buffer, pos)\n } else {\n Uint8Array.prototype.set.call(\n buffer,\n buf,\n pos\n )\n }\n } else if (!Buffer.isBuffer(buf)) {\n throw new TypeError('\"list\" argument must be an Array of Buffers')\n } else {\n buf.copy(buffer, pos)\n }\n pos += buf.length\n }\n return buffer\n}\n\nfunction byteLength (string, encoding) {\n if (Buffer.isBuffer(string)) {\n return string.length\n }\n if (ArrayBuffer.isView(string) || isInstance(string, ArrayBuffer)) {\n return string.byteLength\n }\n if (typeof string !== 'string') {\n throw new TypeError(\n 'The \"string\" argument must be one of type string, Buffer, or ArrayBuffer. ' +\n 'Received type ' + typeof string\n )\n }\n\n var len = string.length\n var mustMatch = (arguments.length > 2 && arguments[2] === true)\n if (!mustMatch && len === 0) return 0\n\n // Use a for loop to avoid recursion\n var loweredCase = false\n for (;;) {\n switch (encoding) {\n case 'ascii':\n case 'latin1':\n case 'binary':\n return len\n case 'utf8':\n case 'utf-8':\n return utf8ToBytes(string).length\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return len * 2\n case 'hex':\n return len >>> 1\n case 'base64':\n return base64ToBytes(string).length\n default:\n if (loweredCase) {\n return mustMatch ? -1 : utf8ToBytes(string).length // assume utf8\n }\n encoding = ('' + encoding).toLowerCase()\n loweredCase = true\n }\n }\n}\nBuffer.byteLength = byteLength\n\nfunction slowToString (encoding, start, end) {\n var loweredCase = false\n\n // No need to verify that \"this.length <= MAX_UINT32\" since it's a read-only\n // property of a typed array.\n\n // This behaves neither like String nor Uint8Array in that we set start/end\n // to their upper/lower bounds if the value passed is out of range.\n // undefined is handled specially as per ECMA-262 6th Edition,\n // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization.\n if (start === undefined || start < 0) {\n start = 0\n }\n // Return early if start > this.length. Done here to prevent potential uint32\n // coercion fail below.\n if (start > this.length) {\n return ''\n }\n\n if (end === undefined || end > this.length) {\n end = this.length\n }\n\n if (end <= 0) {\n return ''\n }\n\n // Force coercion to uint32. This will also coerce falsey/NaN values to 0.\n end >>>= 0\n start >>>= 0\n\n if (end <= start) {\n return ''\n }\n\n if (!encoding) encoding = 'utf8'\n\n while (true) {\n switch (encoding) {\n case 'hex':\n return hexSlice(this, start, end)\n\n case 'utf8':\n case 'utf-8':\n return utf8Slice(this, start, end)\n\n case 'ascii':\n return asciiSlice(this, start, end)\n\n case 'latin1':\n case 'binary':\n return latin1Slice(this, start, end)\n\n case 'base64':\n return base64Slice(this, start, end)\n\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return utf16leSlice(this, start, end)\n\n default:\n if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)\n encoding = (encoding + '').toLowerCase()\n loweredCase = true\n }\n }\n}\n\n// This property is used by `Buffer.isBuffer` (and the `is-buffer` npm package)\n// to detect a Buffer instance. It's not possible to use `instanceof Buffer`\n// reliably in a browserify context because there could be multiple different\n// copies of the 'buffer' package in use. This method works even for Buffer\n// instances that were created from another copy of the `buffer` package.\n// See: https://github.com/feross/buffer/issues/154\nBuffer.prototype._isBuffer = true\n\nfunction swap (b, n, m) {\n var i = b[n]\n b[n] = b[m]\n b[m] = i\n}\n\nBuffer.prototype.swap16 = function swap16 () {\n var len = this.length\n if (len % 2 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 16-bits')\n }\n for (var i = 0; i < len; i += 2) {\n swap(this, i, i + 1)\n }\n return this\n}\n\nBuffer.prototype.swap32 = function swap32 () {\n var len = this.length\n if (len % 4 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 32-bits')\n }\n for (var i = 0; i < len; i += 4) {\n swap(this, i, i + 3)\n swap(this, i + 1, i + 2)\n }\n return this\n}\n\nBuffer.prototype.swap64 = function swap64 () {\n var len = this.length\n if (len % 8 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 64-bits')\n }\n for (var i = 0; i < len; i += 8) {\n swap(this, i, i + 7)\n swap(this, i + 1, i + 6)\n swap(this, i + 2, i + 5)\n swap(this, i + 3, i + 4)\n }\n return this\n}\n\nBuffer.prototype.toString = function toString () {\n var length = this.length\n if (length === 0) return ''\n if (arguments.length === 0) return utf8Slice(this, 0, length)\n return slowToString.apply(this, arguments)\n}\n\nBuffer.prototype.toLocaleString = Buffer.prototype.toString\n\nBuffer.prototype.equals = function equals (b) {\n if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer')\n if (this === b) return true\n return Buffer.compare(this, b) === 0\n}\n\nBuffer.prototype.inspect = function inspect () {\n var str = ''\n var max = exports.INSPECT_MAX_BYTES\n str = this.toString('hex', 0, max).replace(/(.{2})/g, '$1 ').trim()\n if (this.length > max) str += ' ... '\n return ''\n}\nif (customInspectSymbol) {\n Buffer.prototype[customInspectSymbol] = Buffer.prototype.inspect\n}\n\nBuffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) {\n if (isInstance(target, Uint8Array)) {\n target = Buffer.from(target, target.offset, target.byteLength)\n }\n if (!Buffer.isBuffer(target)) {\n throw new TypeError(\n 'The \"target\" argument must be one of type Buffer or Uint8Array. ' +\n 'Received type ' + (typeof target)\n )\n }\n\n if (start === undefined) {\n start = 0\n }\n if (end === undefined) {\n end = target ? target.length : 0\n }\n if (thisStart === undefined) {\n thisStart = 0\n }\n if (thisEnd === undefined) {\n thisEnd = this.length\n }\n\n if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) {\n throw new RangeError('out of range index')\n }\n\n if (thisStart >= thisEnd && start >= end) {\n return 0\n }\n if (thisStart >= thisEnd) {\n return -1\n }\n if (start >= end) {\n return 1\n }\n\n start >>>= 0\n end >>>= 0\n thisStart >>>= 0\n thisEnd >>>= 0\n\n if (this === target) return 0\n\n var x = thisEnd - thisStart\n var y = end - start\n var len = Math.min(x, y)\n\n var thisCopy = this.slice(thisStart, thisEnd)\n var targetCopy = target.slice(start, end)\n\n for (var i = 0; i < len; ++i) {\n if (thisCopy[i] !== targetCopy[i]) {\n x = thisCopy[i]\n y = targetCopy[i]\n break\n }\n }\n\n if (x < y) return -1\n if (y < x) return 1\n return 0\n}\n\n// Finds either the first index of `val` in `buffer` at offset >= `byteOffset`,\n// OR the last index of `val` in `buffer` at offset <= `byteOffset`.\n//\n// Arguments:\n// - buffer - a Buffer to search\n// - val - a string, Buffer, or number\n// - byteOffset - an index into `buffer`; will be clamped to an int32\n// - encoding - an optional encoding, relevant is val is a string\n// - dir - true for indexOf, false for lastIndexOf\nfunction bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {\n // Empty buffer means no match\n if (buffer.length === 0) return -1\n\n // Normalize byteOffset\n if (typeof byteOffset === 'string') {\n encoding = byteOffset\n byteOffset = 0\n } else if (byteOffset > 0x7fffffff) {\n byteOffset = 0x7fffffff\n } else if (byteOffset < -0x80000000) {\n byteOffset = -0x80000000\n }\n byteOffset = +byteOffset // Coerce to Number.\n if (numberIsNaN(byteOffset)) {\n // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n byteOffset = dir ? 0 : (buffer.length - 1)\n }\n\n // Normalize byteOffset: negative offsets start from the end of the buffer\n if (byteOffset < 0) byteOffset = buffer.length + byteOffset\n if (byteOffset >= buffer.length) {\n if (dir) return -1\n else byteOffset = buffer.length - 1\n } else if (byteOffset < 0) {\n if (dir) byteOffset = 0\n else return -1\n }\n\n // Normalize val\n if (typeof val === 'string') {\n val = Buffer.from(val, encoding)\n }\n\n // Finally, search either indexOf (if dir is true) or lastIndexOf\n if (Buffer.isBuffer(val)) {\n // Special case: looking for empty string/buffer always fails\n if (val.length === 0) {\n return -1\n }\n return arrayIndexOf(buffer, val, byteOffset, encoding, dir)\n } else if (typeof val === 'number') {\n val = val & 0xFF // Search for a byte value [0-255]\n if (typeof Uint8Array.prototype.indexOf === 'function') {\n if (dir) {\n return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)\n } else {\n return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)\n }\n }\n return arrayIndexOf(buffer, [val], byteOffset, encoding, dir)\n }\n\n throw new TypeError('val must be string, number or Buffer')\n}\n\nfunction arrayIndexOf (arr, val, byteOffset, encoding, dir) {\n var indexSize = 1\n var arrLength = arr.length\n var valLength = val.length\n\n if (encoding !== undefined) {\n encoding = String(encoding).toLowerCase()\n if (encoding === 'ucs2' || encoding === 'ucs-2' ||\n encoding === 'utf16le' || encoding === 'utf-16le') {\n if (arr.length < 2 || val.length < 2) {\n return -1\n }\n indexSize = 2\n arrLength /= 2\n valLength /= 2\n byteOffset /= 2\n }\n }\n\n function read (buf, i) {\n if (indexSize === 1) {\n return buf[i]\n } else {\n return buf.readUInt16BE(i * indexSize)\n }\n }\n\n var i\n if (dir) {\n var foundIndex = -1\n for (i = byteOffset; i < arrLength; i++) {\n if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {\n if (foundIndex === -1) foundIndex = i\n if (i - foundIndex + 1 === valLength) return foundIndex * indexSize\n } else {\n if (foundIndex !== -1) i -= i - foundIndex\n foundIndex = -1\n }\n }\n } else {\n if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength\n for (i = byteOffset; i >= 0; i--) {\n var found = true\n for (var j = 0; j < valLength; j++) {\n if (read(arr, i + j) !== read(val, j)) {\n found = false\n break\n }\n }\n if (found) return i\n }\n }\n\n return -1\n}\n\nBuffer.prototype.includes = function includes (val, byteOffset, encoding) {\n return this.indexOf(val, byteOffset, encoding) !== -1\n}\n\nBuffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) {\n return bidirectionalIndexOf(this, val, byteOffset, encoding, true)\n}\n\nBuffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) {\n return bidirectionalIndexOf(this, val, byteOffset, encoding, false)\n}\n\nfunction hexWrite (buf, string, offset, length) {\n offset = Number(offset) || 0\n var remaining = buf.length - offset\n if (!length) {\n length = remaining\n } else {\n length = Number(length)\n if (length > remaining) {\n length = remaining\n }\n }\n\n var strLen = string.length\n\n if (length > strLen / 2) {\n length = strLen / 2\n }\n for (var i = 0; i < length; ++i) {\n var parsed = parseInt(string.substr(i * 2, 2), 16)\n if (numberIsNaN(parsed)) return i\n buf[offset + i] = parsed\n }\n return i\n}\n\nfunction utf8Write (buf, string, offset, length) {\n return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length)\n}\n\nfunction asciiWrite (buf, string, offset, length) {\n return blitBuffer(asciiToBytes(string), buf, offset, length)\n}\n\nfunction base64Write (buf, string, offset, length) {\n return blitBuffer(base64ToBytes(string), buf, offset, length)\n}\n\nfunction ucs2Write (buf, string, offset, length) {\n return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length)\n}\n\nBuffer.prototype.write = function write (string, offset, length, encoding) {\n // Buffer#write(string)\n if (offset === undefined) {\n encoding = 'utf8'\n length = this.length\n offset = 0\n // Buffer#write(string, encoding)\n } else if (length === undefined && typeof offset === 'string') {\n encoding = offset\n length = this.length\n offset = 0\n // Buffer#write(string, offset[, length][, encoding])\n } else if (isFinite(offset)) {\n offset = offset >>> 0\n if (isFinite(length)) {\n length = length >>> 0\n if (encoding === undefined) encoding = 'utf8'\n } else {\n encoding = length\n length = undefined\n }\n } else {\n throw new Error(\n 'Buffer.write(string, encoding, offset[, length]) is no longer supported'\n )\n }\n\n var remaining = this.length - offset\n if (length === undefined || length > remaining) length = remaining\n\n if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) {\n throw new RangeError('Attempt to write outside buffer bounds')\n }\n\n if (!encoding) encoding = 'utf8'\n\n var loweredCase = false\n for (;;) {\n switch (encoding) {\n case 'hex':\n return hexWrite(this, string, offset, length)\n\n case 'utf8':\n case 'utf-8':\n return utf8Write(this, string, offset, length)\n\n case 'ascii':\n case 'latin1':\n case 'binary':\n return asciiWrite(this, string, offset, length)\n\n case 'base64':\n // Warning: maxLength not taken into account in base64Write\n return base64Write(this, string, offset, length)\n\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return ucs2Write(this, string, offset, length)\n\n default:\n if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)\n encoding = ('' + encoding).toLowerCase()\n loweredCase = true\n }\n }\n}\n\nBuffer.prototype.toJSON = function toJSON () {\n return {\n type: 'Buffer',\n data: Array.prototype.slice.call(this._arr || this, 0)\n }\n}\n\nfunction base64Slice (buf, start, end) {\n if (start === 0 && end === buf.length) {\n return base64.fromByteArray(buf)\n } else {\n return base64.fromByteArray(buf.slice(start, end))\n }\n}\n\nfunction utf8Slice (buf, start, end) {\n end = Math.min(buf.length, end)\n var res = []\n\n var i = start\n while (i < end) {\n var firstByte = buf[i]\n var codePoint = null\n var bytesPerSequence = (firstByte > 0xEF)\n ? 4\n : (firstByte > 0xDF)\n ? 3\n : (firstByte > 0xBF)\n ? 2\n : 1\n\n if (i + bytesPerSequence <= end) {\n var secondByte, thirdByte, fourthByte, tempCodePoint\n\n switch (bytesPerSequence) {\n case 1:\n if (firstByte < 0x80) {\n codePoint = firstByte\n }\n break\n case 2:\n secondByte = buf[i + 1]\n if ((secondByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F)\n if (tempCodePoint > 0x7F) {\n codePoint = tempCodePoint\n }\n }\n break\n case 3:\n secondByte = buf[i + 1]\n thirdByte = buf[i + 2]\n if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F)\n if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) {\n codePoint = tempCodePoint\n }\n }\n break\n case 4:\n secondByte = buf[i + 1]\n thirdByte = buf[i + 2]\n fourthByte = buf[i + 3]\n if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F)\n if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) {\n codePoint = tempCodePoint\n }\n }\n }\n }\n\n if (codePoint === null) {\n // we did not generate a valid codePoint so insert a\n // replacement char (U+FFFD) and advance only 1 byte\n codePoint = 0xFFFD\n bytesPerSequence = 1\n } else if (codePoint > 0xFFFF) {\n // encode to utf16 (surrogate pair dance)\n codePoint -= 0x10000\n res.push(codePoint >>> 10 & 0x3FF | 0xD800)\n codePoint = 0xDC00 | codePoint & 0x3FF\n }\n\n res.push(codePoint)\n i += bytesPerSequence\n }\n\n return decodeCodePointsArray(res)\n}\n\n// Based on http://stackoverflow.com/a/22747272/680742, the browser with\n// the lowest limit is Chrome, with 0x10000 args.\n// We go 1 magnitude less, for safety\nvar MAX_ARGUMENTS_LENGTH = 0x1000\n\nfunction decodeCodePointsArray (codePoints) {\n var len = codePoints.length\n if (len <= MAX_ARGUMENTS_LENGTH) {\n return String.fromCharCode.apply(String, codePoints) // avoid extra slice()\n }\n\n // Decode in chunks to avoid \"call stack size exceeded\".\n var res = ''\n var i = 0\n while (i < len) {\n res += String.fromCharCode.apply(\n String,\n codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)\n )\n }\n return res\n}\n\nfunction asciiSlice (buf, start, end) {\n var ret = ''\n end = Math.min(buf.length, end)\n\n for (var i = start; i < end; ++i) {\n ret += String.fromCharCode(buf[i] & 0x7F)\n }\n return ret\n}\n\nfunction latin1Slice (buf, start, end) {\n var ret = ''\n end = Math.min(buf.length, end)\n\n for (var i = start; i < end; ++i) {\n ret += String.fromCharCode(buf[i])\n }\n return ret\n}\n\nfunction hexSlice (buf, start, end) {\n var len = buf.length\n\n if (!start || start < 0) start = 0\n if (!end || end < 0 || end > len) end = len\n\n var out = ''\n for (var i = start; i < end; ++i) {\n out += hexSliceLookupTable[buf[i]]\n }\n return out\n}\n\nfunction utf16leSlice (buf, start, end) {\n var bytes = buf.slice(start, end)\n var res = ''\n // If bytes.length is odd, the last 8 bits must be ignored (same as node.js)\n for (var i = 0; i < bytes.length - 1; i += 2) {\n res += String.fromCharCode(bytes[i] + (bytes[i + 1] * 256))\n }\n return res\n}\n\nBuffer.prototype.slice = function slice (start, end) {\n var len = this.length\n start = ~~start\n end = end === undefined ? len : ~~end\n\n if (start < 0) {\n start += len\n if (start < 0) start = 0\n } else if (start > len) {\n start = len\n }\n\n if (end < 0) {\n end += len\n if (end < 0) end = 0\n } else if (end > len) {\n end = len\n }\n\n if (end < start) end = start\n\n var newBuf = this.subarray(start, end)\n // Return an augmented `Uint8Array` instance\n Object.setPrototypeOf(newBuf, Buffer.prototype)\n\n return newBuf\n}\n\n/*\n * Need to make sure that buffer isn't trying to write out of bounds.\n */\nfunction checkOffset (offset, ext, length) {\n if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n}\n\nBuffer.prototype.readUintLE =\nBuffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) {\n offset = offset >>> 0\n byteLength = byteLength >>> 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n var val = this[offset]\n var mul = 1\n var i = 0\n while (++i < byteLength && (mul *= 0x100)) {\n val += this[offset + i] * mul\n }\n\n return val\n}\n\nBuffer.prototype.readUintBE =\nBuffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) {\n offset = offset >>> 0\n byteLength = byteLength >>> 0\n if (!noAssert) {\n checkOffset(offset, byteLength, this.length)\n }\n\n var val = this[offset + --byteLength]\n var mul = 1\n while (byteLength > 0 && (mul *= 0x100)) {\n val += this[offset + --byteLength] * mul\n }\n\n return val\n}\n\nBuffer.prototype.readUint8 =\nBuffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 1, this.length)\n return this[offset]\n}\n\nBuffer.prototype.readUint16LE =\nBuffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 2, this.length)\n return this[offset] | (this[offset + 1] << 8)\n}\n\nBuffer.prototype.readUint16BE =\nBuffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 2, this.length)\n return (this[offset] << 8) | this[offset + 1]\n}\n\nBuffer.prototype.readUint32LE =\nBuffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return ((this[offset]) |\n (this[offset + 1] << 8) |\n (this[offset + 2] << 16)) +\n (this[offset + 3] * 0x1000000)\n}\n\nBuffer.prototype.readUint32BE =\nBuffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset] * 0x1000000) +\n ((this[offset + 1] << 16) |\n (this[offset + 2] << 8) |\n this[offset + 3])\n}\n\nBuffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) {\n offset = offset >>> 0\n byteLength = byteLength >>> 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n var val = this[offset]\n var mul = 1\n var i = 0\n while (++i < byteLength && (mul *= 0x100)) {\n val += this[offset + i] * mul\n }\n mul *= 0x80\n\n if (val >= mul) val -= Math.pow(2, 8 * byteLength)\n\n return val\n}\n\nBuffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) {\n offset = offset >>> 0\n byteLength = byteLength >>> 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n var i = byteLength\n var mul = 1\n var val = this[offset + --i]\n while (i > 0 && (mul *= 0x100)) {\n val += this[offset + --i] * mul\n }\n mul *= 0x80\n\n if (val >= mul) val -= Math.pow(2, 8 * byteLength)\n\n return val\n}\n\nBuffer.prototype.readInt8 = function readInt8 (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 1, this.length)\n if (!(this[offset] & 0x80)) return (this[offset])\n return ((0xff - this[offset] + 1) * -1)\n}\n\nBuffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 2, this.length)\n var val = this[offset] | (this[offset + 1] << 8)\n return (val & 0x8000) ? val | 0xFFFF0000 : val\n}\n\nBuffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 2, this.length)\n var val = this[offset + 1] | (this[offset] << 8)\n return (val & 0x8000) ? val | 0xFFFF0000 : val\n}\n\nBuffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset]) |\n (this[offset + 1] << 8) |\n (this[offset + 2] << 16) |\n (this[offset + 3] << 24)\n}\n\nBuffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset] << 24) |\n (this[offset + 1] << 16) |\n (this[offset + 2] << 8) |\n (this[offset + 3])\n}\n\nBuffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 4, this.length)\n return ieee754.read(this, offset, true, 23, 4)\n}\n\nBuffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 4, this.length)\n return ieee754.read(this, offset, false, 23, 4)\n}\n\nBuffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 8, this.length)\n return ieee754.read(this, offset, true, 52, 8)\n}\n\nBuffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 8, this.length)\n return ieee754.read(this, offset, false, 52, 8)\n}\n\nfunction checkInt (buf, value, offset, ext, max, min) {\n if (!Buffer.isBuffer(buf)) throw new TypeError('\"buffer\" argument must be a Buffer instance')\n if (value > max || value < min) throw new RangeError('\"value\" argument is out of bounds')\n if (offset + ext > buf.length) throw new RangeError('Index out of range')\n}\n\nBuffer.prototype.writeUintLE =\nBuffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset >>> 0\n byteLength = byteLength >>> 0\n if (!noAssert) {\n var maxBytes = Math.pow(2, 8 * byteLength) - 1\n checkInt(this, value, offset, byteLength, maxBytes, 0)\n }\n\n var mul = 1\n var i = 0\n this[offset] = value & 0xFF\n while (++i < byteLength && (mul *= 0x100)) {\n this[offset + i] = (value / mul) & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeUintBE =\nBuffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset >>> 0\n byteLength = byteLength >>> 0\n if (!noAssert) {\n var maxBytes = Math.pow(2, 8 * byteLength) - 1\n checkInt(this, value, offset, byteLength, maxBytes, 0)\n }\n\n var i = byteLength - 1\n var mul = 1\n this[offset + i] = value & 0xFF\n while (--i >= 0 && (mul *= 0x100)) {\n this[offset + i] = (value / mul) & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeUint8 =\nBuffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0)\n this[offset] = (value & 0xff)\n return offset + 1\n}\n\nBuffer.prototype.writeUint16LE =\nBuffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n return offset + 2\n}\n\nBuffer.prototype.writeUint16BE =\nBuffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)\n this[offset] = (value >>> 8)\n this[offset + 1] = (value & 0xff)\n return offset + 2\n}\n\nBuffer.prototype.writeUint32LE =\nBuffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)\n this[offset + 3] = (value >>> 24)\n this[offset + 2] = (value >>> 16)\n this[offset + 1] = (value >>> 8)\n this[offset] = (value & 0xff)\n return offset + 4\n}\n\nBuffer.prototype.writeUint32BE =\nBuffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)\n this[offset] = (value >>> 24)\n this[offset + 1] = (value >>> 16)\n this[offset + 2] = (value >>> 8)\n this[offset + 3] = (value & 0xff)\n return offset + 4\n}\n\nBuffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) {\n var limit = Math.pow(2, (8 * byteLength) - 1)\n\n checkInt(this, value, offset, byteLength, limit - 1, -limit)\n }\n\n var i = 0\n var mul = 1\n var sub = 0\n this[offset] = value & 0xFF\n while (++i < byteLength && (mul *= 0x100)) {\n if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) {\n sub = 1\n }\n this[offset + i] = ((value / mul) >> 0) - sub & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) {\n var limit = Math.pow(2, (8 * byteLength) - 1)\n\n checkInt(this, value, offset, byteLength, limit - 1, -limit)\n }\n\n var i = byteLength - 1\n var mul = 1\n var sub = 0\n this[offset + i] = value & 0xFF\n while (--i >= 0 && (mul *= 0x100)) {\n if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) {\n sub = 1\n }\n this[offset + i] = ((value / mul) >> 0) - sub & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80)\n if (value < 0) value = 0xff + value + 1\n this[offset] = (value & 0xff)\n return offset + 1\n}\n\nBuffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n return offset + 2\n}\n\nBuffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)\n this[offset] = (value >>> 8)\n this[offset + 1] = (value & 0xff)\n return offset + 2\n}\n\nBuffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n this[offset + 2] = (value >>> 16)\n this[offset + 3] = (value >>> 24)\n return offset + 4\n}\n\nBuffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)\n if (value < 0) value = 0xffffffff + value + 1\n this[offset] = (value >>> 24)\n this[offset + 1] = (value >>> 16)\n this[offset + 2] = (value >>> 8)\n this[offset + 3] = (value & 0xff)\n return offset + 4\n}\n\nfunction checkIEEE754 (buf, value, offset, ext, max, min) {\n if (offset + ext > buf.length) throw new RangeError('Index out of range')\n if (offset < 0) throw new RangeError('Index out of range')\n}\n\nfunction writeFloat (buf, value, offset, littleEndian, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) {\n checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38)\n }\n ieee754.write(buf, value, offset, littleEndian, 23, 4)\n return offset + 4\n}\n\nBuffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) {\n return writeFloat(this, value, offset, true, noAssert)\n}\n\nBuffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) {\n return writeFloat(this, value, offset, false, noAssert)\n}\n\nfunction writeDouble (buf, value, offset, littleEndian, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) {\n checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308)\n }\n ieee754.write(buf, value, offset, littleEndian, 52, 8)\n return offset + 8\n}\n\nBuffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) {\n return writeDouble(this, value, offset, true, noAssert)\n}\n\nBuffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) {\n return writeDouble(this, value, offset, false, noAssert)\n}\n\n// copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)\nBuffer.prototype.copy = function copy (target, targetStart, start, end) {\n if (!Buffer.isBuffer(target)) throw new TypeError('argument should be a Buffer')\n if (!start) start = 0\n if (!end && end !== 0) end = this.length\n if (targetStart >= target.length) targetStart = target.length\n if (!targetStart) targetStart = 0\n if (end > 0 && end < start) end = start\n\n // Copy 0 bytes; we're done\n if (end === start) return 0\n if (target.length === 0 || this.length === 0) return 0\n\n // Fatal error conditions\n if (targetStart < 0) {\n throw new RangeError('targetStart out of bounds')\n }\n if (start < 0 || start >= this.length) throw new RangeError('Index out of range')\n if (end < 0) throw new RangeError('sourceEnd out of bounds')\n\n // Are we oob?\n if (end > this.length) end = this.length\n if (target.length - targetStart < end - start) {\n end = target.length - targetStart + start\n }\n\n var len = end - start\n\n if (this === target && typeof Uint8Array.prototype.copyWithin === 'function') {\n // Use built-in when available, missing from IE11\n this.copyWithin(targetStart, start, end)\n } else {\n Uint8Array.prototype.set.call(\n target,\n this.subarray(start, end),\n targetStart\n )\n }\n\n return len\n}\n\n// Usage:\n// buffer.fill(number[, offset[, end]])\n// buffer.fill(buffer[, offset[, end]])\n// buffer.fill(string[, offset[, end]][, encoding])\nBuffer.prototype.fill = function fill (val, start, end, encoding) {\n // Handle string cases:\n if (typeof val === 'string') {\n if (typeof start === 'string') {\n encoding = start\n start = 0\n end = this.length\n } else if (typeof end === 'string') {\n encoding = end\n end = this.length\n }\n if (encoding !== undefined && typeof encoding !== 'string') {\n throw new TypeError('encoding must be a string')\n }\n if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) {\n throw new TypeError('Unknown encoding: ' + encoding)\n }\n if (val.length === 1) {\n var code = val.charCodeAt(0)\n if ((encoding === 'utf8' && code < 128) ||\n encoding === 'latin1') {\n // Fast path: If `val` fits into a single byte, use that numeric value.\n val = code\n }\n }\n } else if (typeof val === 'number') {\n val = val & 255\n } else if (typeof val === 'boolean') {\n val = Number(val)\n }\n\n // Invalid ranges are not set to a default, so can range check early.\n if (start < 0 || this.length < start || this.length < end) {\n throw new RangeError('Out of range index')\n }\n\n if (end <= start) {\n return this\n }\n\n start = start >>> 0\n end = end === undefined ? this.length : end >>> 0\n\n if (!val) val = 0\n\n var i\n if (typeof val === 'number') {\n for (i = start; i < end; ++i) {\n this[i] = val\n }\n } else {\n var bytes = Buffer.isBuffer(val)\n ? val\n : Buffer.from(val, encoding)\n var len = bytes.length\n if (len === 0) {\n throw new TypeError('The value \"' + val +\n '\" is invalid for argument \"value\"')\n }\n for (i = 0; i < end - start; ++i) {\n this[i + start] = bytes[i % len]\n }\n }\n\n return this\n}\n\n// HELPER FUNCTIONS\n// ================\n\nvar INVALID_BASE64_RE = /[^+/0-9A-Za-z-_]/g\n\nfunction base64clean (str) {\n // Node takes equal signs as end of the Base64 encoding\n str = str.split('=')[0]\n // Node strips out invalid characters like \\n and \\t from the string, base64-js does not\n str = str.trim().replace(INVALID_BASE64_RE, '')\n // Node converts strings with length < 2 to ''\n if (str.length < 2) return ''\n // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not\n while (str.length % 4 !== 0) {\n str = str + '='\n }\n return str\n}\n\nfunction utf8ToBytes (string, units) {\n units = units || Infinity\n var codePoint\n var length = string.length\n var leadSurrogate = null\n var bytes = []\n\n for (var i = 0; i < length; ++i) {\n codePoint = string.charCodeAt(i)\n\n // is surrogate component\n if (codePoint > 0xD7FF && codePoint < 0xE000) {\n // last char was a lead\n if (!leadSurrogate) {\n // no lead yet\n if (codePoint > 0xDBFF) {\n // unexpected trail\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n continue\n } else if (i + 1 === length) {\n // unpaired lead\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n continue\n }\n\n // valid lead\n leadSurrogate = codePoint\n\n continue\n }\n\n // 2 leads in a row\n if (codePoint < 0xDC00) {\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n leadSurrogate = codePoint\n continue\n }\n\n // valid surrogate pair\n codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000\n } else if (leadSurrogate) {\n // valid bmp char, but last char was a lead\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n }\n\n leadSurrogate = null\n\n // encode utf8\n if (codePoint < 0x80) {\n if ((units -= 1) < 0) break\n bytes.push(codePoint)\n } else if (codePoint < 0x800) {\n if ((units -= 2) < 0) break\n bytes.push(\n codePoint >> 0x6 | 0xC0,\n codePoint & 0x3F | 0x80\n )\n } else if (codePoint < 0x10000) {\n if ((units -= 3) < 0) break\n bytes.push(\n codePoint >> 0xC | 0xE0,\n codePoint >> 0x6 & 0x3F | 0x80,\n codePoint & 0x3F | 0x80\n )\n } else if (codePoint < 0x110000) {\n if ((units -= 4) < 0) break\n bytes.push(\n codePoint >> 0x12 | 0xF0,\n codePoint >> 0xC & 0x3F | 0x80,\n codePoint >> 0x6 & 0x3F | 0x80,\n codePoint & 0x3F | 0x80\n )\n } else {\n throw new Error('Invalid code point')\n }\n }\n\n return bytes\n}\n\nfunction asciiToBytes (str) {\n var byteArray = []\n for (var i = 0; i < str.length; ++i) {\n // Node's code seems to be doing this and not & 0x7F..\n byteArray.push(str.charCodeAt(i) & 0xFF)\n }\n return byteArray\n}\n\nfunction utf16leToBytes (str, units) {\n var c, hi, lo\n var byteArray = []\n for (var i = 0; i < str.length; ++i) {\n if ((units -= 2) < 0) break\n\n c = str.charCodeAt(i)\n hi = c >> 8\n lo = c % 256\n byteArray.push(lo)\n byteArray.push(hi)\n }\n\n return byteArray\n}\n\nfunction base64ToBytes (str) {\n return base64.toByteArray(base64clean(str))\n}\n\nfunction blitBuffer (src, dst, offset, length) {\n for (var i = 0; i < length; ++i) {\n if ((i + offset >= dst.length) || (i >= src.length)) break\n dst[i + offset] = src[i]\n }\n return i\n}\n\n// ArrayBuffer or Uint8Array objects from other contexts (i.e. iframes) do not pass\n// the `instanceof` check but they should be treated as of that type.\n// See: https://github.com/feross/buffer/issues/166\nfunction isInstance (obj, type) {\n return obj instanceof type ||\n (obj != null && obj.constructor != null && obj.constructor.name != null &&\n obj.constructor.name === type.name)\n}\nfunction numberIsNaN (obj) {\n // For IE11 support\n return obj !== obj // eslint-disable-line no-self-compare\n}\n\n// Create lookup table for `toString('hex')`\n// See: https://github.com/feross/buffer/issues/219\nvar hexSliceLookupTable = (function () {\n var alphabet = '0123456789abcdef'\n var table = new Array(256)\n for (var i = 0; i < 16; ++i) {\n var i16 = i * 16\n for (var j = 0; j < 16; ++j) {\n table[i16 + j] = alphabet[i] + alphabet[j]\n }\n }\n return table\n})()\n","/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport function __createBinding(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n}\r\n\r\nexport function __exportStar(m, exports) {\r\n for (var p in m) if (p !== \"default\" && !exports.hasOwnProperty(p)) exports[p] = m[p];\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n};\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\r\n result.default = mod;\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, privateMap) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to get private field on non-instance\");\r\n }\r\n return privateMap.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, privateMap, value) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to set private field on non-instance\");\r\n }\r\n privateMap.set(receiver, value);\r\n return value;\r\n}\r\n",null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],"names":["byteLength","toByteArray","fromByteArray","lookup","revLookup","Arr","Uint8Array","Array","code","i","len","length","charCodeAt","getLens","b64","Error","validLen","indexOf","placeHoldersLen","lens","_byteLength","tmp","arr","curByte","tripletToBase64","num","encodeChunk","uint8","start","end","output","push","join","extraBytes","parts","maxChunkLength","len2","buffer","offset","isLE","mLen","nBytes","e","m","eLen","eMax","eBias","nBits","d","s","NaN","Infinity","Math","pow","value","c","rt","abs","isNaN","floor","log","LN2","customInspectSymbol","Symbol","exports","Buffer","SlowBuffer","K_MAX_LENGTH","TYPED_ARRAY_SUPPORT","typedArraySupport","console","error","proto","foo","Object","setPrototypeOf","prototype","defineProperty","enumerable","get","isBuffer","undefined","byteOffset","createBuffer","RangeError","buf","arg","encodingOrOffset","TypeError","allocUnsafe","from","poolSize","fromString","ArrayBuffer","isView","fromArrayView","isInstance","fromArrayBuffer","SharedArrayBuffer","valueOf","b","fromObject","toPrimitive","assertSize","size","alloc","fill","encoding","checked","allocUnsafeSlow","string","isEncoding","actual","write","slice","fromArrayLike","array","arrayView","copy","obj","numberIsNaN","type","isArray","data","toString","_isBuffer","compare","a","x","y","min","String","toLowerCase","concat","list","pos","set","call","mustMatch","arguments","loweredCase","utf8ToBytes","base64ToBytes","slowToString","hexSlice","utf8Slice","asciiSlice","latin1Slice","base64Slice","utf16leSlice","swap","n","swap16","swap32","swap64","apply","toLocaleString","equals","inspect","str","max","INSPECT_MAX_BYTES","replace","trim","target","thisStart","thisEnd","thisCopy","targetCopy","bidirectionalIndexOf","val","dir","arrayIndexOf","lastIndexOf","indexSize","arrLength","valLength","read","readUInt16BE","foundIndex","found","j","includes","hexWrite","Number","remaining","strLen","parsed","parseInt","substr","utf8Write","blitBuffer","asciiWrite","asciiToBytes","base64Write","ucs2Write","utf16leToBytes","isFinite","toJSON","_arr","base64","res","firstByte","codePoint","bytesPerSequence","secondByte","thirdByte","fourthByte","tempCodePoint","decodeCodePointsArray","MAX_ARGUMENTS_LENGTH","codePoints","fromCharCode","ret","out","hexSliceLookupTable","bytes","newBuf","subarray","checkOffset","ext","readUintLE","readUIntLE","noAssert","mul","readUintBE","readUIntBE","readUint8","readUInt8","readUint16LE","readUInt16LE","readUint16BE","readUint32LE","readUInt32LE","readUint32BE","readUInt32BE","readIntLE","readIntBE","readInt8","readInt16LE","readInt16BE","readInt32LE","readInt32BE","readFloatLE","ieee754","readFloatBE","readDoubleLE","readDoubleBE","checkInt","writeUintLE","writeUIntLE","maxBytes","writeUintBE","writeUIntBE","writeUint8","writeUInt8","writeUint16LE","writeUInt16LE","writeUint16BE","writeUInt16BE","writeUint32LE","writeUInt32LE","writeUint32BE","writeUInt32BE","writeIntLE","limit","sub","writeIntBE","writeInt8","writeInt16LE","writeInt16BE","writeInt32LE","writeInt32BE","checkIEEE754","writeFloat","littleEndian","writeFloatLE","writeFloatBE","writeDouble","writeDoubleLE","writeDoubleBE","targetStart","copyWithin","INVALID_BASE64_RE","base64clean","split","units","leadSurrogate","byteArray","hi","lo","src","dst","constructor","name","alphabet","table","i16","extendStatics","__proto__","p","hasOwnProperty","__extends","__","create","__assign","assign","t","kId","BSON_INT32_MAX","BSON_INT32_MIN","BSON_INT64_MAX","BSON_INT64_MIN","EJSON","bsonMap","calculateObjectSize","constants.JS_INT_MIN","constants.JS_INT_MAX","constants.BSON_INT32_MIN","constants.BSON_INT32_MAX","deserialize","constants.BSON_DATA_STRING","constants.BSON_DATA_OID","constants.BSON_DATA_INT","constants.BSON_DATA_NUMBER","constants.BSON_DATA_DATE","constants.BSON_DATA_BOOLEAN","constants.BSON_DATA_OBJECT","constants.BSON_DATA_ARRAY","constants.BSON_DATA_UNDEFINED","constants.BSON_DATA_NULL","constants.BSON_DATA_LONG","constants.BSON_DATA_DECIMAL128","constants.BSON_DATA_BINARY","constants.BSON_DATA_REGEXP","constants.BSON_DATA_SYMBOL","constants.BSON_DATA_TIMESTAMP","constants.BSON_DATA_MIN_KEY","constants.BSON_DATA_MAX_KEY","constants.BSON_DATA_CODE","constants.BSON_DATA_CODE_W_SCOPE","constants.BSON_DATA_DBPOINTER","constants.BSON_BINARY_SUBTYPE_DEFAULT","Map","internalSerialize","internalDeserialize","internalCalculateObjectSize"],"mappings":";;;;;;;;;;CAEA,gBAAkB,GAAGA,UAArB;CACA,iBAAmB,GAAGC,WAAtB;CACA,mBAAqB,GAAGC,aAAxB;CAEA,IAAIC,MAAM,GAAG,EAAb;CACA,IAAIC,SAAS,GAAG,EAAhB;CACA,IAAIC,GAAG,GAAG,OAAOC,UAAP,KAAsB,WAAtB,GAAoCA,UAApC,GAAiDC,KAA3D;CAEA,IAAIC,IAAI,GAAG,kEAAX;;CACA,KAAK,IAAIC,CAAC,GAAG,CAAR,EAAWC,GAAG,GAAGF,IAAI,CAACG,MAA3B,EAAmCF,CAAC,GAAGC,GAAvC,EAA4C,EAAED,CAA9C,EAAiD;CAC/CN,EAAAA,MAAM,CAACM,CAAD,CAAN,GAAYD,IAAI,CAACC,CAAD,CAAhB;CACAL,EAAAA,SAAS,CAACI,IAAI,CAACI,UAAL,CAAgBH,CAAhB,CAAD,CAAT,GAAgCA,CAAhC;CACD;CAGD;;;CACAL,SAAS,CAAC,IAAIQ,UAAJ,CAAe,CAAf,CAAD,CAAT,GAA+B,EAA/B;CACAR,SAAS,CAAC,IAAIQ,UAAJ,CAAe,CAAf,CAAD,CAAT,GAA+B,EAA/B;;CAEA,SAASC,OAAT,CAAkBC,GAAlB,EAAuB;CACrB,MAAIJ,GAAG,GAAGI,GAAG,CAACH,MAAd;;CAEA,MAAID,GAAG,GAAG,CAAN,GAAU,CAAd,EAAiB;CACf,UAAM,IAAIK,KAAJ,CAAU,gDAAV,CAAN;CACD,GALoB;;;;CASrB,MAAIC,QAAQ,GAAGF,GAAG,CAACG,OAAJ,CAAY,GAAZ,CAAf;CACA,MAA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CAAC,IAAI,EAAE,CAAC,CAAC;;SAEhC,eAAe,CAAC,KAAK,GAAG,KAAK,CAAC;;SAE9B,SAAS,CAAC,aAAa,GAAG,CAAC,CAAC,GAAGD,aAAmB,CAAC,UAAU,EAAE,eAAe,CAAC,CAAC;;SAEhF,KAAK,GAAG,KAAK,GAAG,IAAI,CAAC;MACtB;;KAGD,OAAO,KAAK,CAAC;CACf,CAAC;CAED;;;;;;;;KAQM,IAAI,GAAG;KACX,MAAM,QAAA;KACN,IAAI,MAAA;KACJ,KAAK,OAAA;KACL,UAAU,YAAA;KACV,MAAM,QAAA;KACN,KAAK,OAAA;KACL,IAAI,MAAA;KACJ,IAAI,MAAA;KACJ,GAAG,aAAA;KACH,MAAM,QAAA;KACN,MAAM,QAAA;KACN,QAAQ,UAAA;KACR,QAAQ,EAAE,QAAQ;KAClB,UAAU,YAAA;KACV,UAAU,YAAA;KACV,SAAS,WAAA;KACT,KAAK,eAAA;KACL,qBAAqB,uBAAA;KACrB,SAAS,WAAA;KACT,2BAA2B,6BAAA;KAC3B,WAAW,aAAA;KACX,mBAAmB,qBAAA;KACnB,iBAAiB,mBAAA;KACjB,SAAS,WAAA;KACT,aAAa,eAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/node_modules/bson/dist/bson.bundle.js b/node_modules/bson/dist/bson.bundle.js new file mode 100644 index 000000000..7aa163c58 --- /dev/null +++ b/node_modules/bson/dist/bson.bundle.js @@ -0,0 +1,7585 @@ +var BSON = (function (exports) { + 'use strict'; + + function createCommonjsModule(fn, module) { + return module = { exports: {} }, fn(module, module.exports), module.exports; + } + + var byteLength_1 = byteLength; + var toByteArray_1 = toByteArray; + var fromByteArray_1 = fromByteArray; + var lookup = []; + var revLookup = []; + var Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array; + var code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; + + for (var i = 0, len = code.length; i < len; ++i) { + lookup[i] = code[i]; + revLookup[code.charCodeAt(i)] = i; + } // Support decoding URL-safe base64 strings, as Node.js does. + // See: https://en.wikipedia.org/wiki/Base64#URL_applications + + + revLookup['-'.charCodeAt(0)] = 62; + revLookup['_'.charCodeAt(0)] = 63; + + function getLens(b64) { + var len = b64.length; + + if (len % 4 > 0) { + throw new Error('Invalid string. Length must be a multiple of 4'); + } // Trim off extra bytes after placeholder bytes are found + // See: https://github.com/beatgammit/base64-js/issues/42 + + + var validLen = b64.indexOf('='); + if (validLen === -1) validLen = len; + var placeHoldersLen = validLen === len ? 0 : 4 - validLen % 4; + return [validLen, placeHoldersLen]; + } // base64 is 4/3 + up to two characters of the original data + + + function byteLength(b64) { + var lens = getLens(b64); + var validLen = lens[0]; + var placeHoldersLen = lens[1]; + return (validLen + placeHoldersLen) * 3 / 4 - placeHoldersLen; + } + + function _byteLength(b64, validLen, placeHoldersLen) { + return (validLen + placeHoldersLen) * 3 / 4 - placeHoldersLen; + } + + function toByteArray(b64) { + var tmp; + var lens = getLens(b64); + var validLen = lens[0]; + var placeHoldersLen = lens[1]; + var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen)); + var curByte = 0; // if there are placeholders, only get up to the last complete 4 chars + + var len = placeHoldersLen > 0 ? validLen - 4 : validLen; + var i; + + for (i = 0; i < len; i += 4) { + tmp = revLookup[b64.charCodeAt(i)] << 18 | revLookup[b64.charCodeAt(i + 1)] << 12 | revLookup[b64.charCodeAt(i + 2)] << 6 | revLookup[b64.charCodeAt(i + 3)]; + arr[curByte++] = tmp >> 16 & 0xFF; + arr[curByte++] = tmp >> 8 & 0xFF; + arr[curByte++] = tmp & 0xFF; + } + + if (placeHoldersLen === 2) { + tmp = revLookup[b64.charCodeAt(i)] << 2 | revLookup[b64.charCodeAt(i + 1)] >> 4; + arr[curByte++] = tmp & 0xFF; + } + + if (placeHoldersLen === 1) { + tmp = revLookup[b64.charCodeAt(i)] << 10 | revLookup[b64.charCodeAt(i + 1)] << 4 | revLookup[b64.charCodeAt(i + 2)] >> 2; + arr[curByte++] = tmp >> 8 & 0xFF; + arr[curByte++] = tmp & 0xFF; + } + + return arr; + } + + function tripletToBase64(num) { + return lookup[num >> 18 & 0x3F] + lookup[num >> 12 & 0x3F] + lookup[num >> 6 & 0x3F] + lookup[num & 0x3F]; + } + + function encodeChunk(uint8, start, end) { + var tmp; + var output = []; + + for (var i = start; i < end; i += 3) { + tmp = (uint8[i] << 16 & 0xFF0000) + (uint8[i + 1] << 8 & 0xFF00) + (uint8[i + 2] & 0xFF); + output.push(tripletToBase64(tmp)); + } + + return output.join(''); + } + + function fromByteArray(uint8) { + var tmp; + var len = uint8.length; + var extraBytes = len % 3; // if we have 1 byte left, pad 2 bytes + + var parts = []; + var maxChunkLength = 16383; // must be multiple of 3 + // go through the array every three bytes, we'll deal with trailing stuff later + + for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) { + parts.push(encodeChunk(uint8, i, i + maxChunkLength > len2 ? len2 : i + maxChunkLength)); + } // pad the end with zeros, but make sure to not forget the extra bytes + + + if (extraBytes === 1) { + tmp = uint8[len - 1]; + parts.push(lookup[tmp >> 2] + lookup[tmp << 4 & 0x3F] + '=='); + } else if (extraBytes === 2) { + tmp = (uint8[len - 2] << 8) + uint8[len - 1]; + parts.push(lookup[tmp >> 10] + lookup[tmp >> 4 & 0x3F] + lookup[tmp << 2 & 0x3F] + '='); + } + + return parts.join(''); + } + + var base64Js = { + byteLength: byteLength_1, + toByteArray: toByteArray_1, + fromByteArray: fromByteArray_1 + }; + + /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */ + var read = function read(buffer, offset, isLE, mLen, nBytes) { + var e, m; + var eLen = nBytes * 8 - mLen - 1; + var eMax = (1 << eLen) - 1; + var eBias = eMax >> 1; + var nBits = -7; + var i = isLE ? nBytes - 1 : 0; + var d = isLE ? -1 : 1; + var s = buffer[offset + i]; + i += d; + e = s & (1 << -nBits) - 1; + s >>= -nBits; + nBits += eLen; + + for (; nBits > 0; e = e * 256 + buffer[offset + i], i += d, nBits -= 8) {} + + m = e & (1 << -nBits) - 1; + e >>= -nBits; + nBits += mLen; + + for (; nBits > 0; m = m * 256 + buffer[offset + i], i += d, nBits -= 8) {} + + if (e === 0) { + e = 1 - eBias; + } else if (e === eMax) { + return m ? NaN : (s ? -1 : 1) * Infinity; + } else { + m = m + Math.pow(2, mLen); + e = e - eBias; + } + + return (s ? -1 : 1) * m * Math.pow(2, e - mLen); + }; + + var write = function write(buffer, value, offset, isLE, mLen, nBytes) { + var e, m, c; + var eLen = nBytes * 8 - mLen - 1; + var eMax = (1 << eLen) - 1; + var eBias = eMax >> 1; + var rt = mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0; + var i = isLE ? 0 : nBytes - 1; + var d = isLE ? 1 : -1; + var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0; + value = Math.abs(value); + + if (isNaN(value) || value === Infinity) { + m = isNaN(value) ? 1 : 0; + e = eMax; + } else { + e = Math.floor(Math.log(value) / Math.LN2); + + if (value * (c = Math.pow(2, -e)) < 1) { + e--; + c *= 2; + } + + if (e + eBias >= 1) { + value += rt / c; + } else { + value += rt * Math.pow(2, 1 - eBias); + } + + if (value * c >= 2) { + e++; + c /= 2; + } + + if (e + eBias >= eMax) { + m = 0; + e = eMax; + } else if (e + eBias >= 1) { + m = (value * c - 1) * Math.pow(2, mLen); + e = e + eBias; + } else { + m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen); + e = 0; + } + } + + for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {} + + e = e << mLen | m; + eLen += mLen; + + for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {} + + buffer[offset + i - d] |= s * 128; + }; + + var ieee754 = { + read: read, + write: write + }; + + var buffer$1 = createCommonjsModule(function (module, exports) { + + var customInspectSymbol = typeof Symbol === 'function' && typeof Symbol['for'] === 'function' ? // eslint-disable-line dot-notation + Symbol['for']('nodejs.util.inspect.custom') // eslint-disable-line dot-notation + : null; + exports.Buffer = Buffer; + exports.SlowBuffer = SlowBuffer; + exports.INSPECT_MAX_BYTES = 50; + var K_MAX_LENGTH = 0x7fffffff; + exports.kMaxLength = K_MAX_LENGTH; + /** + * If `Buffer.TYPED_ARRAY_SUPPORT`: + * === true Use Uint8Array implementation (fastest) + * === false Print warning and recommend using `buffer` v4.x which has an Object + * implementation (most compatible, even IE6) + * + * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+, + * Opera 11.6+, iOS 4.2+. + * + * We report that the browser does not support typed arrays if the are not subclassable + * using __proto__. Firefox 4-29 lacks support for adding new properties to `Uint8Array` + * (See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438). IE 10 lacks support + * for __proto__ and has a buggy typed array implementation. + */ + + Buffer.TYPED_ARRAY_SUPPORT = typedArraySupport(); + + if (!Buffer.TYPED_ARRAY_SUPPORT && typeof console !== 'undefined' && typeof console.error === 'function') { + console.error('This browser lacks typed array (Uint8Array) support which is required by ' + '`buffer` v5.x. Use `buffer` v4.x if you require old browser support.'); + } + + function typedArraySupport() { + // Can typed array instances can be augmented? + try { + var arr = new Uint8Array(1); + var proto = { + foo: function foo() { + return 42; + } + }; + Object.setPrototypeOf(proto, Uint8Array.prototype); + Object.setPrototypeOf(arr, proto); + return arr.foo() === 42; + } catch (e) { + return false; + } + } + + Object.defineProperty(Buffer.prototype, 'parent', { + enumerable: true, + get: function get() { + if (!Buffer.isBuffer(this)) return undefined; + return this.buffer; + } + }); + Object.defineProperty(Buffer.prototype, 'offset', { + enumerable: true, + get: function get() { + if (!Buffer.isBuffer(this)) return undefined; + return this.byteOffset; + } + }); + + function createBuffer(length) { + if (length > K_MAX_LENGTH) { + throw new RangeError('The value "' + length + '" is invalid for option "size"'); + } // Return an augmented `Uint8Array` instance + + + var buf = new Uint8Array(length); + Object.setPrototypeOf(buf, Buffer.prototype); + return buf; + } + /** + * The Buffer constructor returns instances of `Uint8Array` that have their + * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of + * `Uint8Array`, so the returned instances will have all the node `Buffer` methods + * and the `Uint8Array` methods. Square bracket notation works as expected -- it + * returns a single octet. + * + * The `Uint8Array` prototype remains unmodified. + */ + + + function Buffer(arg, encodingOrOffset, length) { + // Common case. + if (typeof arg === 'number') { + if (typeof encodingOrOffset === 'string') { + throw new TypeError('The "string" argument must be of type string. Received type number'); + } + + return allocUnsafe(arg); + } + + return from(arg, encodingOrOffset, length); + } + + Buffer.poolSize = 8192; // not used by this implementation + + function from(value, encodingOrOffset, length) { + if (typeof value === 'string') { + return fromString(value, encodingOrOffset); + } + + if (ArrayBuffer.isView(value)) { + return fromArrayView(value); + } + + if (value == null) { + throw new TypeError('The first argument must be one of type string, Buffer, ArrayBuffer, Array, ' + 'or Array-like Object. Received type ' + babelHelpers["typeof"](value)); + } + + if (isInstance(value, ArrayBuffer) || value && isInstance(value.buffer, ArrayBuffer)) { + return fromArrayBuffer(value, encodingOrOffset, length); + } + + if (typeof SharedArrayBuffer !== 'undefined' && (isInstance(value, SharedArrayBuffer) || value && isInstance(value.buffer, SharedArrayBuffer))) { + return fromArrayBuffer(value, encodingOrOffset, length); + } + + if (typeof value === 'number') { + throw new TypeError('The "value" argument must not be of type number. Received type number'); + } + + var valueOf = value.valueOf && value.valueOf(); + + if (valueOf != null && valueOf !== value) { + return Buffer.from(valueOf, encodingOrOffset, length); + } + + var b = fromObject(value); + if (b) return b; + + if (typeof Symbol !== 'undefined' && Symbol.toPrimitive != null && typeof value[Symbol.toPrimitive] === 'function') { + return Buffer.from(value[Symbol.toPrimitive]('string'), encodingOrOffset, length); + } + + throw new TypeError('The first argument must be one of type string, Buffer, ArrayBuffer, Array, ' + 'or Array-like Object. Received type ' + babelHelpers["typeof"](value)); + } + /** + * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError + * if value is a number. + * Buffer.from(str[, encoding]) + * Buffer.from(array) + * Buffer.from(buffer) + * Buffer.from(arrayBuffer[, byteOffset[, length]]) + **/ + + + Buffer.from = function (value, encodingOrOffset, length) { + return from(value, encodingOrOffset, length); + }; // Note: Change prototype *after* Buffer.from is defined to workaround Chrome bug: + // https://github.com/feross/buffer/pull/148 + + + Object.setPrototypeOf(Buffer.prototype, Uint8Array.prototype); + Object.setPrototypeOf(Buffer, Uint8Array); + + function assertSize(size) { + if (typeof size !== 'number') { + throw new TypeError('"size" argument must be of type number'); + } else if (size < 0) { + throw new RangeError('The value "' + size + '" is invalid for option "size"'); + } + } + + function alloc(size, fill, encoding) { + assertSize(size); + + if (size <= 0) { + return createBuffer(size); + } + + if (fill !== undefined) { + // Only pay attention to encoding if it's a string. This + // prevents accidentally sending in a number that would + // be interpreted as a start offset. + return typeof encoding === 'string' ? createBuffer(size).fill(fill, encoding) : createBuffer(size).fill(fill); + } + + return createBuffer(size); + } + /** + * Creates a new filled Buffer instance. + * alloc(size[, fill[, encoding]]) + **/ + + + Buffer.alloc = function (size, fill, encoding) { + return alloc(size, fill, encoding); + }; + + function allocUnsafe(size) { + assertSize(size); + return createBuffer(size < 0 ? 0 : checked(size) | 0); + } + /** + * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance. + * */ + + + Buffer.allocUnsafe = function (size) { + return allocUnsafe(size); + }; + /** + * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. + */ + + + Buffer.allocUnsafeSlow = function (size) { + return allocUnsafe(size); + }; + + function fromString(string, encoding) { + if (typeof encoding !== 'string' || encoding === '') { + encoding = 'utf8'; + } + + if (!Buffer.isEncoding(encoding)) { + throw new TypeError('Unknown encoding: ' + encoding); + } + + var length = byteLength(string, encoding) | 0; + var buf = createBuffer(length); + var actual = buf.write(string, encoding); + + if (actual !== length) { + // Writing a hex string, for example, that contains invalid characters will + // cause everything after the first invalid character to be ignored. (e.g. + // 'abxxcd' will be treated as 'ab') + buf = buf.slice(0, actual); + } + + return buf; + } + + function fromArrayLike(array) { + var length = array.length < 0 ? 0 : checked(array.length) | 0; + var buf = createBuffer(length); + + for (var i = 0; i < length; i += 1) { + buf[i] = array[i] & 255; + } + + return buf; + } + + function fromArrayView(arrayView) { + if (isInstance(arrayView, Uint8Array)) { + var copy = new Uint8Array(arrayView); + return fromArrayBuffer(copy.buffer, copy.byteOffset, copy.byteLength); + } + + return fromArrayLike(arrayView); + } + + function fromArrayBuffer(array, byteOffset, length) { + if (byteOffset < 0 || array.byteLength < byteOffset) { + throw new RangeError('"offset" is outside of buffer bounds'); + } + + if (array.byteLength < byteOffset + (length || 0)) { + throw new RangeError('"length" is outside of buffer bounds'); + } + + var buf; + + if (byteOffset === undefined && length === undefined) { + buf = new Uint8Array(array); + } else if (length === undefined) { + buf = new Uint8Array(array, byteOffset); + } else { + buf = new Uint8Array(array, byteOffset, length); + } // Return an augmented `Uint8Array` instance + + + Object.setPrototypeOf(buf, Buffer.prototype); + return buf; + } + + function fromObject(obj) { + if (Buffer.isBuffer(obj)) { + var len = checked(obj.length) | 0; + var buf = createBuffer(len); + + if (buf.length === 0) { + return buf; + } + + obj.copy(buf, 0, 0, len); + return buf; + } + + if (obj.length !== undefined) { + if (typeof obj.length !== 'number' || numberIsNaN(obj.length)) { + return createBuffer(0); + } + + return fromArrayLike(obj); + } + + if (obj.type === 'Buffer' && Array.isArray(obj.data)) { + return fromArrayLike(obj.data); + } + } + + function checked(length) { + // Note: cannot use `length < K_MAX_LENGTH` here because that fails when + // length is NaN (which is otherwise coerced to zero.) + if (length >= K_MAX_LENGTH) { + throw new RangeError('Attempt to allocate Buffer larger than maximum ' + 'size: 0x' + K_MAX_LENGTH.toString(16) + ' bytes'); + } + + return length | 0; + } + + function SlowBuffer(length) { + if (+length != length) { + // eslint-disable-line eqeqeq + length = 0; + } + + return Buffer.alloc(+length); + } + + Buffer.isBuffer = function isBuffer(b) { + return b != null && b._isBuffer === true && b !== Buffer.prototype; // so Buffer.isBuffer(Buffer.prototype) will be false + }; + + Buffer.compare = function compare(a, b) { + if (isInstance(a, Uint8Array)) a = Buffer.from(a, a.offset, a.byteLength); + if (isInstance(b, Uint8Array)) b = Buffer.from(b, b.offset, b.byteLength); + + if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) { + throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array'); + } + + if (a === b) return 0; + var x = a.length; + var y = b.length; + + for (var i = 0, len = Math.min(x, y); i < len; ++i) { + if (a[i] !== b[i]) { + x = a[i]; + y = b[i]; + break; + } + } + + if (x < y) return -1; + if (y < x) return 1; + return 0; + }; + + Buffer.isEncoding = function isEncoding(encoding) { + switch (String(encoding).toLowerCase()) { + case 'hex': + case 'utf8': + case 'utf-8': + case 'ascii': + case 'latin1': + case 'binary': + case 'base64': + case 'ucs2': + case 'ucs-2': + case 'utf16le': + case 'utf-16le': + return true; + + default: + return false; + } + }; + + Buffer.concat = function concat(list, length) { + if (!Array.isArray(list)) { + throw new TypeError('"list" argument must be an Array of Buffers'); + } + + if (list.length === 0) { + return Buffer.alloc(0); + } + + var i; + + if (length === undefined) { + length = 0; + + for (i = 0; i < list.length; ++i) { + length += list[i].length; + } + } + + var buffer = Buffer.allocUnsafe(length); + var pos = 0; + + for (i = 0; i < list.length; ++i) { + var buf = list[i]; + + if (isInstance(buf, Uint8Array)) { + if (pos + buf.length > buffer.length) { + Buffer.from(buf).copy(buffer, pos); + } else { + Uint8Array.prototype.set.call(buffer, buf, pos); + } + } else if (!Buffer.isBuffer(buf)) { + throw new TypeError('"list" argument must be an Array of Buffers'); + } else { + buf.copy(buffer, pos); + } + + pos += buf.length; + } + + return buffer; + }; + + function byteLength(string, encoding) { + if (Buffer.isBuffer(string)) { + return string.length; + } + + if (ArrayBuffer.isView(string) || isInstance(string, ArrayBuffer)) { + return string.byteLength; + } + + if (typeof string !== 'string') { + throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. ' + 'Received type ' + babelHelpers["typeof"](string)); + } + + var len = string.length; + var mustMatch = arguments.length > 2 && arguments[2] === true; + if (!mustMatch && len === 0) return 0; // Use a for loop to avoid recursion + + var loweredCase = false; + + for (;;) { + switch (encoding) { + case 'ascii': + case 'latin1': + case 'binary': + return len; + + case 'utf8': + case 'utf-8': + return utf8ToBytes(string).length; + + case 'ucs2': + case 'ucs-2': + case 'utf16le': + case 'utf-16le': + return len * 2; + + case 'hex': + return len >>> 1; + + case 'base64': + return base64ToBytes(string).length; + + default: + if (loweredCase) { + return mustMatch ? -1 : utf8ToBytes(string).length; // assume utf8 + } + + encoding = ('' + encoding).toLowerCase(); + loweredCase = true; + } + } + } + + Buffer.byteLength = byteLength; + + function slowToString(encoding, start, end) { + var loweredCase = false; // No need to verify that "this.length <= MAX_UINT32" since it's a read-only + // property of a typed array. + // This behaves neither like String nor Uint8Array in that we set start/end + // to their upper/lower bounds if the value passed is out of range. + // undefined is handled specially as per ECMA-262 6th Edition, + // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization. + + if (start === undefined || start < 0) { + start = 0; + } // Return early if start > this.length. Done here to prevent potential uint32 + // coercion fail below. + + + if (start > this.length) { + return ''; + } + + if (end === undefined || end > this.length) { + end = this.length; + } + + if (end <= 0) { + return ''; + } // Force coercion to uint32. This will also coerce falsey/NaN values to 0. + + + end >>>= 0; + start >>>= 0; + + if (end <= start) { + return ''; + } + + if (!encoding) encoding = 'utf8'; + + while (true) { + switch (encoding) { + case 'hex': + return hexSlice(this, start, end); + + case 'utf8': + case 'utf-8': + return utf8Slice(this, start, end); + + case 'ascii': + return asciiSlice(this, start, end); + + case 'latin1': + case 'binary': + return latin1Slice(this, start, end); + + case 'base64': + return base64Slice(this, start, end); + + case 'ucs2': + case 'ucs-2': + case 'utf16le': + case 'utf-16le': + return utf16leSlice(this, start, end); + + default: + if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding); + encoding = (encoding + '').toLowerCase(); + loweredCase = true; + } + } + } // This property is used by `Buffer.isBuffer` (and the `is-buffer` npm package) + // to detect a Buffer instance. It's not possible to use `instanceof Buffer` + // reliably in a browserify context because there could be multiple different + // copies of the 'buffer' package in use. This method works even for Buffer + // instances that were created from another copy of the `buffer` package. + // See: https://github.com/feross/buffer/issues/154 + + + Buffer.prototype._isBuffer = true; + + function swap(b, n, m) { + var i = b[n]; + b[n] = b[m]; + b[m] = i; + } + + Buffer.prototype.swap16 = function swap16() { + var len = this.length; + + if (len % 2 !== 0) { + throw new RangeError('Buffer size must be a multiple of 16-bits'); + } + + for (var i = 0; i < len; i += 2) { + swap(this, i, i + 1); + } + + return this; + }; + + Buffer.prototype.swap32 = function swap32() { + var len = this.length; + + if (len % 4 !== 0) { + throw new RangeError('Buffer size must be a multiple of 32-bits'); + } + + for (var i = 0; i < len; i += 4) { + swap(this, i, i + 3); + swap(this, i + 1, i + 2); + } + + return this; + }; + + Buffer.prototype.swap64 = function swap64() { + var len = this.length; + + if (len % 8 !== 0) { + throw new RangeError('Buffer size must be a multiple of 64-bits'); + } + + for (var i = 0; i < len; i += 8) { + swap(this, i, i + 7); + swap(this, i + 1, i + 6); + swap(this, i + 2, i + 5); + swap(this, i + 3, i + 4); + } + + return this; + }; + + Buffer.prototype.toString = function toString() { + var length = this.length; + if (length === 0) return ''; + if (arguments.length === 0) return utf8Slice(this, 0, length); + return slowToString.apply(this, arguments); + }; + + Buffer.prototype.toLocaleString = Buffer.prototype.toString; + + Buffer.prototype.equals = function equals(b) { + if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer'); + if (this === b) return true; + return Buffer.compare(this, b) === 0; + }; + + Buffer.prototype.inspect = function inspect() { + var str = ''; + var max = exports.INSPECT_MAX_BYTES; + str = this.toString('hex', 0, max).replace(/(.{2})/g, '$1 ').trim(); + if (this.length > max) str += ' ... '; + return ''; + }; + + if (customInspectSymbol) { + Buffer.prototype[customInspectSymbol] = Buffer.prototype.inspect; + } + + Buffer.prototype.compare = function compare(target, start, end, thisStart, thisEnd) { + if (isInstance(target, Uint8Array)) { + target = Buffer.from(target, target.offset, target.byteLength); + } + + if (!Buffer.isBuffer(target)) { + throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. ' + 'Received type ' + babelHelpers["typeof"](target)); + } + + if (start === undefined) { + start = 0; + } + + if (end === undefined) { + end = target ? target.length : 0; + } + + if (thisStart === undefined) { + thisStart = 0; + } + + if (thisEnd === undefined) { + thisEnd = this.length; + } + + if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) { + throw new RangeError('out of range index'); + } + + if (thisStart >= thisEnd && start >= end) { + return 0; + } + + if (thisStart >= thisEnd) { + return -1; + } + + if (start >= end) { + return 1; + } + + start >>>= 0; + end >>>= 0; + thisStart >>>= 0; + thisEnd >>>= 0; + if (this === target) return 0; + var x = thisEnd - thisStart; + var y = end - start; + var len = Math.min(x, y); + var thisCopy = this.slice(thisStart, thisEnd); + var targetCopy = target.slice(start, end); + + for (var i = 0; i < len; ++i) { + if (thisCopy[i] !== targetCopy[i]) { + x = thisCopy[i]; + y = targetCopy[i]; + break; + } + } + + if (x < y) return -1; + if (y < x) return 1; + return 0; + }; // Finds either the first index of `val` in `buffer` at offset >= `byteOffset`, + // OR the last index of `val` in `buffer` at offset <= `byteOffset`. + // + // Arguments: + // - buffer - a Buffer to search + // - val - a string, Buffer, or number + // - byteOffset - an index into `buffer`; will be clamped to an int32 + // - encoding - an optional encoding, relevant is val is a string + // - dir - true for indexOf, false for lastIndexOf + + + function bidirectionalIndexOf(buffer, val, byteOffset, encoding, dir) { + // Empty buffer means no match + if (buffer.length === 0) return -1; // Normalize byteOffset + + if (typeof byteOffset === 'string') { + encoding = byteOffset; + byteOffset = 0; + } else if (byteOffset > 0x7fffffff) { + byteOffset = 0x7fffffff; + } else if (byteOffset < -0x80000000) { + byteOffset = -0x80000000; + } + + byteOffset = +byteOffset; // Coerce to Number. + + if (numberIsNaN(byteOffset)) { + // byteOffset: it it's undefined, null, NaN, "foo", etc, search whole buffer + byteOffset = dir ? 0 : buffer.length - 1; + } // Normalize byteOffset: negative offsets start from the end of the buffer + + + if (byteOffset < 0) byteOffset = buffer.length + byteOffset; + + if (byteOffset >= buffer.length) { + if (dir) return -1;else byteOffset = buffer.length - 1; + } else if (byteOffset < 0) { + if (dir) byteOffset = 0;else return -1; + } // Normalize val + + + if (typeof val === 'string') { + val = Buffer.from(val, encoding); + } // Finally, search either indexOf (if dir is true) or lastIndexOf + + + if (Buffer.isBuffer(val)) { + // Special case: looking for empty string/buffer always fails + if (val.length === 0) { + return -1; + } + + return arrayIndexOf(buffer, val, byteOffset, encoding, dir); + } else if (typeof val === 'number') { + val = val & 0xFF; // Search for a byte value [0-255] + + if (typeof Uint8Array.prototype.indexOf === 'function') { + if (dir) { + return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset); + } else { + return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset); + } + } + + return arrayIndexOf(buffer, [val], byteOffset, encoding, dir); + } + + throw new TypeError('val must be string, number or Buffer'); + } + + function arrayIndexOf(arr, val, byteOffset, encoding, dir) { + var indexSize = 1; + var arrLength = arr.length; + var valLength = val.length; + + if (encoding !== undefined) { + encoding = String(encoding).toLowerCase(); + + if (encoding === 'ucs2' || encoding === 'ucs-2' || encoding === 'utf16le' || encoding === 'utf-16le') { + if (arr.length < 2 || val.length < 2) { + return -1; + } + + indexSize = 2; + arrLength /= 2; + valLength /= 2; + byteOffset /= 2; + } + } + + function read(buf, i) { + if (indexSize === 1) { + return buf[i]; + } else { + return buf.readUInt16BE(i * indexSize); + } + } + + var i; + + if (dir) { + var foundIndex = -1; + + for (i = byteOffset; i < arrLength; i++) { + if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) { + if (foundIndex === -1) foundIndex = i; + if (i - foundIndex + 1 === valLength) return foundIndex * indexSize; + } else { + if (foundIndex !== -1) i -= i - foundIndex; + foundIndex = -1; + } + } + } else { + if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength; + + for (i = byteOffset; i >= 0; i--) { + var found = true; + + for (var j = 0; j < valLength; j++) { + if (read(arr, i + j) !== read(val, j)) { + found = false; + break; + } + } + + if (found) return i; + } + } + + return -1; + } + + Buffer.prototype.includes = function includes(val, byteOffset, encoding) { + return this.indexOf(val, byteOffset, encoding) !== -1; + }; + + Buffer.prototype.indexOf = function indexOf(val, byteOffset, encoding) { + return bidirectionalIndexOf(this, val, byteOffset, encoding, true); + }; + + Buffer.prototype.lastIndexOf = function lastIndexOf(val, byteOffset, encoding) { + return bidirectionalIndexOf(this, val, byteOffset, encoding, false); + }; + + function hexWrite(buf, string, offset, length) { + offset = Number(offset) || 0; + var remaining = buf.length - offset; + + if (!length) { + length = remaining; + } else { + length = Number(length); + + if (length > remaining) { + length = remaining; + } + } + + var strLen = string.length; + + if (length > strLen / 2) { + length = strLen / 2; + } + + for (var i = 0; i < length; ++i) { + var parsed = parseInt(string.substr(i * 2, 2), 16); + if (numberIsNaN(parsed)) return i; + buf[offset + i] = parsed; + } + + return i; + } + + function utf8Write(buf, string, offset, length) { + return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length); + } + + function asciiWrite(buf, string, offset, length) { + return blitBuffer(asciiToBytes(string), buf, offset, length); + } + + function base64Write(buf, string, offset, length) { + return blitBuffer(base64ToBytes(string), buf, offset, length); + } + + function ucs2Write(buf, string, offset, length) { + return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length); + } + + Buffer.prototype.write = function write(string, offset, length, encoding) { + // Buffer#write(string) + if (offset === undefined) { + encoding = 'utf8'; + length = this.length; + offset = 0; // Buffer#write(string, encoding) + } else if (length === undefined && typeof offset === 'string') { + encoding = offset; + length = this.length; + offset = 0; // Buffer#write(string, offset[, length][, encoding]) + } else if (isFinite(offset)) { + offset = offset >>> 0; + + if (isFinite(length)) { + length = length >>> 0; + if (encoding === undefined) encoding = 'utf8'; + } else { + encoding = length; + length = undefined; + } + } else { + throw new Error('Buffer.write(string, encoding, offset[, length]) is no longer supported'); + } + + var remaining = this.length - offset; + if (length === undefined || length > remaining) length = remaining; + + if (string.length > 0 && (length < 0 || offset < 0) || offset > this.length) { + throw new RangeError('Attempt to write outside buffer bounds'); + } + + if (!encoding) encoding = 'utf8'; + var loweredCase = false; + + for (;;) { + switch (encoding) { + case 'hex': + return hexWrite(this, string, offset, length); + + case 'utf8': + case 'utf-8': + return utf8Write(this, string, offset, length); + + case 'ascii': + case 'latin1': + case 'binary': + return asciiWrite(this, string, offset, length); + + case 'base64': + // Warning: maxLength not taken into account in base64Write + return base64Write(this, string, offset, length); + + case 'ucs2': + case 'ucs-2': + case 'utf16le': + case 'utf-16le': + return ucs2Write(this, string, offset, length); + + default: + if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding); + encoding = ('' + encoding).toLowerCase(); + loweredCase = true; + } + } + }; + + Buffer.prototype.toJSON = function toJSON() { + return { + type: 'Buffer', + data: Array.prototype.slice.call(this._arr || this, 0) + }; + }; + + function base64Slice(buf, start, end) { + if (start === 0 && end === buf.length) { + return base64Js.fromByteArray(buf); + } else { + return base64Js.fromByteArray(buf.slice(start, end)); + } + } + + function utf8Slice(buf, start, end) { + end = Math.min(buf.length, end); + var res = []; + var i = start; + + while (i < end) { + var firstByte = buf[i]; + var codePoint = null; + var bytesPerSequence = firstByte > 0xEF ? 4 : firstByte > 0xDF ? 3 : firstByte > 0xBF ? 2 : 1; + + if (i + bytesPerSequence <= end) { + var secondByte, thirdByte, fourthByte, tempCodePoint; + + switch (bytesPerSequence) { + case 1: + if (firstByte < 0x80) { + codePoint = firstByte; + } + + break; + + case 2: + secondByte = buf[i + 1]; + + if ((secondByte & 0xC0) === 0x80) { + tempCodePoint = (firstByte & 0x1F) << 0x6 | secondByte & 0x3F; + + if (tempCodePoint > 0x7F) { + codePoint = tempCodePoint; + } + } + + break; + + case 3: + secondByte = buf[i + 1]; + thirdByte = buf[i + 2]; + + if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) { + tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | thirdByte & 0x3F; + + if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) { + codePoint = tempCodePoint; + } + } + + break; + + case 4: + secondByte = buf[i + 1]; + thirdByte = buf[i + 2]; + fourthByte = buf[i + 3]; + + if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) { + tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | fourthByte & 0x3F; + + if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) { + codePoint = tempCodePoint; + } + } + + } + } + + if (codePoint === null) { + // we did not generate a valid codePoint so insert a + // replacement char (U+FFFD) and advance only 1 byte + codePoint = 0xFFFD; + bytesPerSequence = 1; + } else if (codePoint > 0xFFFF) { + // encode to utf16 (surrogate pair dance) + codePoint -= 0x10000; + res.push(codePoint >>> 10 & 0x3FF | 0xD800); + codePoint = 0xDC00 | codePoint & 0x3FF; + } + + res.push(codePoint); + i += bytesPerSequence; + } + + return decodeCodePointsArray(res); + } // Based on http://stackoverflow.com/a/22747272/680742, the browser with + // the lowest limit is Chrome, with 0x10000 args. + // We go 1 magnitude less, for safety + + + var MAX_ARGUMENTS_LENGTH = 0x1000; + + function decodeCodePointsArray(codePoints) { + var len = codePoints.length; + + if (len <= MAX_ARGUMENTS_LENGTH) { + return String.fromCharCode.apply(String, codePoints); // avoid extra slice() + } // Decode in chunks to avoid "call stack size exceeded". + + + var res = ''; + var i = 0; + + while (i < len) { + res += String.fromCharCode.apply(String, codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)); + } + + return res; + } + + function asciiSlice(buf, start, end) { + var ret = ''; + end = Math.min(buf.length, end); + + for (var i = start; i < end; ++i) { + ret += String.fromCharCode(buf[i] & 0x7F); + } + + return ret; + } + + function latin1Slice(buf, start, end) { + var ret = ''; + end = Math.min(buf.length, end); + + for (var i = start; i < end; ++i) { + ret += String.fromCharCode(buf[i]); + } + + return ret; + } + + function hexSlice(buf, start, end) { + var len = buf.length; + if (!start || start < 0) start = 0; + if (!end || end < 0 || end > len) end = len; + var out = ''; + + for (var i = start; i < end; ++i) { + out += hexSliceLookupTable[buf[i]]; + } + + return out; + } + + function utf16leSlice(buf, start, end) { + var bytes = buf.slice(start, end); + var res = ''; // If bytes.length is odd, the last 8 bits must be ignored (same as node.js) + + for (var i = 0; i < bytes.length - 1; i += 2) { + res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256); + } + + return res; + } + + Buffer.prototype.slice = function slice(start, end) { + var len = this.length; + start = ~~start; + end = end === undefined ? len : ~~end; + + if (start < 0) { + start += len; + if (start < 0) start = 0; + } else if (start > len) { + start = len; + } + + if (end < 0) { + end += len; + if (end < 0) end = 0; + } else if (end > len) { + end = len; + } + + if (end < start) end = start; + var newBuf = this.subarray(start, end); // Return an augmented `Uint8Array` instance + + Object.setPrototypeOf(newBuf, Buffer.prototype); + return newBuf; + }; + /* + * Need to make sure that buffer isn't trying to write out of bounds. + */ + + + function checkOffset(offset, ext, length) { + if (offset % 1 !== 0 || offset < 0) throw new RangeError('offset is not uint'); + if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length'); + } + + Buffer.prototype.readUintLE = Buffer.prototype.readUIntLE = function readUIntLE(offset, byteLength, noAssert) { + offset = offset >>> 0; + byteLength = byteLength >>> 0; + if (!noAssert) checkOffset(offset, byteLength, this.length); + var val = this[offset]; + var mul = 1; + var i = 0; + + while (++i < byteLength && (mul *= 0x100)) { + val += this[offset + i] * mul; + } + + return val; + }; + + Buffer.prototype.readUintBE = Buffer.prototype.readUIntBE = function readUIntBE(offset, byteLength, noAssert) { + offset = offset >>> 0; + byteLength = byteLength >>> 0; + + if (!noAssert) { + checkOffset(offset, byteLength, this.length); + } + + var val = this[offset + --byteLength]; + var mul = 1; + + while (byteLength > 0 && (mul *= 0x100)) { + val += this[offset + --byteLength] * mul; + } + + return val; + }; + + Buffer.prototype.readUint8 = Buffer.prototype.readUInt8 = function readUInt8(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 1, this.length); + return this[offset]; + }; + + Buffer.prototype.readUint16LE = Buffer.prototype.readUInt16LE = function readUInt16LE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 2, this.length); + return this[offset] | this[offset + 1] << 8; + }; + + Buffer.prototype.readUint16BE = Buffer.prototype.readUInt16BE = function readUInt16BE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 2, this.length); + return this[offset] << 8 | this[offset + 1]; + }; + + Buffer.prototype.readUint32LE = Buffer.prototype.readUInt32LE = function readUInt32LE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 4, this.length); + return (this[offset] | this[offset + 1] << 8 | this[offset + 2] << 16) + this[offset + 3] * 0x1000000; + }; + + Buffer.prototype.readUint32BE = Buffer.prototype.readUInt32BE = function readUInt32BE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 4, this.length); + return this[offset] * 0x1000000 + (this[offset + 1] << 16 | this[offset + 2] << 8 | this[offset + 3]); + }; + + Buffer.prototype.readIntLE = function readIntLE(offset, byteLength, noAssert) { + offset = offset >>> 0; + byteLength = byteLength >>> 0; + if (!noAssert) checkOffset(offset, byteLength, this.length); + var val = this[offset]; + var mul = 1; + var i = 0; + + while (++i < byteLength && (mul *= 0x100)) { + val += this[offset + i] * mul; + } + + mul *= 0x80; + if (val >= mul) val -= Math.pow(2, 8 * byteLength); + return val; + }; + + Buffer.prototype.readIntBE = function readIntBE(offset, byteLength, noAssert) { + offset = offset >>> 0; + byteLength = byteLength >>> 0; + if (!noAssert) checkOffset(offset, byteLength, this.length); + var i = byteLength; + var mul = 1; + var val = this[offset + --i]; + + while (i > 0 && (mul *= 0x100)) { + val += this[offset + --i] * mul; + } + + mul *= 0x80; + if (val >= mul) val -= Math.pow(2, 8 * byteLength); + return val; + }; + + Buffer.prototype.readInt8 = function readInt8(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 1, this.length); + if (!(this[offset] & 0x80)) return this[offset]; + return (0xff - this[offset] + 1) * -1; + }; + + Buffer.prototype.readInt16LE = function readInt16LE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 2, this.length); + var val = this[offset] | this[offset + 1] << 8; + return val & 0x8000 ? val | 0xFFFF0000 : val; + }; + + Buffer.prototype.readInt16BE = function readInt16BE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 2, this.length); + var val = this[offset + 1] | this[offset] << 8; + return val & 0x8000 ? val | 0xFFFF0000 : val; + }; + + Buffer.prototype.readInt32LE = function readInt32LE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 4, this.length); + return this[offset] | this[offset + 1] << 8 | this[offset + 2] << 16 | this[offset + 3] << 24; + }; + + Buffer.prototype.readInt32BE = function readInt32BE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 4, this.length); + return this[offset] << 24 | this[offset + 1] << 16 | this[offset + 2] << 8 | this[offset + 3]; + }; + + Buffer.prototype.readFloatLE = function readFloatLE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 4, this.length); + return ieee754.read(this, offset, true, 23, 4); + }; + + Buffer.prototype.readFloatBE = function readFloatBE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 4, this.length); + return ieee754.read(this, offset, false, 23, 4); + }; + + Buffer.prototype.readDoubleLE = function readDoubleLE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 8, this.length); + return ieee754.read(this, offset, true, 52, 8); + }; + + Buffer.prototype.readDoubleBE = function readDoubleBE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 8, this.length); + return ieee754.read(this, offset, false, 52, 8); + }; + + function checkInt(buf, value, offset, ext, max, min) { + if (!Buffer.isBuffer(buf)) throw new TypeError('"buffer" argument must be a Buffer instance'); + if (value > max || value < min) throw new RangeError('"value" argument is out of bounds'); + if (offset + ext > buf.length) throw new RangeError('Index out of range'); + } + + Buffer.prototype.writeUintLE = Buffer.prototype.writeUIntLE = function writeUIntLE(value, offset, byteLength, noAssert) { + value = +value; + offset = offset >>> 0; + byteLength = byteLength >>> 0; + + if (!noAssert) { + var maxBytes = Math.pow(2, 8 * byteLength) - 1; + checkInt(this, value, offset, byteLength, maxBytes, 0); + } + + var mul = 1; + var i = 0; + this[offset] = value & 0xFF; + + while (++i < byteLength && (mul *= 0x100)) { + this[offset + i] = value / mul & 0xFF; + } + + return offset + byteLength; + }; + + Buffer.prototype.writeUintBE = Buffer.prototype.writeUIntBE = function writeUIntBE(value, offset, byteLength, noAssert) { + value = +value; + offset = offset >>> 0; + byteLength = byteLength >>> 0; + + if (!noAssert) { + var maxBytes = Math.pow(2, 8 * byteLength) - 1; + checkInt(this, value, offset, byteLength, maxBytes, 0); + } + + var i = byteLength - 1; + var mul = 1; + this[offset + i] = value & 0xFF; + + while (--i >= 0 && (mul *= 0x100)) { + this[offset + i] = value / mul & 0xFF; + } + + return offset + byteLength; + }; + + Buffer.prototype.writeUint8 = Buffer.prototype.writeUInt8 = function writeUInt8(value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0); + this[offset] = value & 0xff; + return offset + 1; + }; + + Buffer.prototype.writeUint16LE = Buffer.prototype.writeUInt16LE = function writeUInt16LE(value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0); + this[offset] = value & 0xff; + this[offset + 1] = value >>> 8; + return offset + 2; + }; + + Buffer.prototype.writeUint16BE = Buffer.prototype.writeUInt16BE = function writeUInt16BE(value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0); + this[offset] = value >>> 8; + this[offset + 1] = value & 0xff; + return offset + 2; + }; + + Buffer.prototype.writeUint32LE = Buffer.prototype.writeUInt32LE = function writeUInt32LE(value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0); + this[offset + 3] = value >>> 24; + this[offset + 2] = value >>> 16; + this[offset + 1] = value >>> 8; + this[offset] = value & 0xff; + return offset + 4; + }; + + Buffer.prototype.writeUint32BE = Buffer.prototype.writeUInt32BE = function writeUInt32BE(value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0); + this[offset] = value >>> 24; + this[offset + 1] = value >>> 16; + this[offset + 2] = value >>> 8; + this[offset + 3] = value & 0xff; + return offset + 4; + }; + + Buffer.prototype.writeIntLE = function writeIntLE(value, offset, byteLength, noAssert) { + value = +value; + offset = offset >>> 0; + + if (!noAssert) { + var limit = Math.pow(2, 8 * byteLength - 1); + checkInt(this, value, offset, byteLength, limit - 1, -limit); + } + + var i = 0; + var mul = 1; + var sub = 0; + this[offset] = value & 0xFF; + + while (++i < byteLength && (mul *= 0x100)) { + if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) { + sub = 1; + } + + this[offset + i] = (value / mul >> 0) - sub & 0xFF; + } + + return offset + byteLength; + }; + + Buffer.prototype.writeIntBE = function writeIntBE(value, offset, byteLength, noAssert) { + value = +value; + offset = offset >>> 0; + + if (!noAssert) { + var limit = Math.pow(2, 8 * byteLength - 1); + checkInt(this, value, offset, byteLength, limit - 1, -limit); + } + + var i = byteLength - 1; + var mul = 1; + var sub = 0; + this[offset + i] = value & 0xFF; + + while (--i >= 0 && (mul *= 0x100)) { + if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) { + sub = 1; + } + + this[offset + i] = (value / mul >> 0) - sub & 0xFF; + } + + return offset + byteLength; + }; + + Buffer.prototype.writeInt8 = function writeInt8(value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80); + if (value < 0) value = 0xff + value + 1; + this[offset] = value & 0xff; + return offset + 1; + }; + + Buffer.prototype.writeInt16LE = function writeInt16LE(value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000); + this[offset] = value & 0xff; + this[offset + 1] = value >>> 8; + return offset + 2; + }; + + Buffer.prototype.writeInt16BE = function writeInt16BE(value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000); + this[offset] = value >>> 8; + this[offset + 1] = value & 0xff; + return offset + 2; + }; + + Buffer.prototype.writeInt32LE = function writeInt32LE(value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000); + this[offset] = value & 0xff; + this[offset + 1] = value >>> 8; + this[offset + 2] = value >>> 16; + this[offset + 3] = value >>> 24; + return offset + 4; + }; + + Buffer.prototype.writeInt32BE = function writeInt32BE(value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000); + if (value < 0) value = 0xffffffff + value + 1; + this[offset] = value >>> 24; + this[offset + 1] = value >>> 16; + this[offset + 2] = value >>> 8; + this[offset + 3] = value & 0xff; + return offset + 4; + }; + + function checkIEEE754(buf, value, offset, ext, max, min) { + if (offset + ext > buf.length) throw new RangeError('Index out of range'); + if (offset < 0) throw new RangeError('Index out of range'); + } + + function writeFloat(buf, value, offset, littleEndian, noAssert) { + value = +value; + offset = offset >>> 0; + + if (!noAssert) { + checkIEEE754(buf, value, offset, 4); + } + + ieee754.write(buf, value, offset, littleEndian, 23, 4); + return offset + 4; + } + + Buffer.prototype.writeFloatLE = function writeFloatLE(value, offset, noAssert) { + return writeFloat(this, value, offset, true, noAssert); + }; + + Buffer.prototype.writeFloatBE = function writeFloatBE(value, offset, noAssert) { + return writeFloat(this, value, offset, false, noAssert); + }; + + function writeDouble(buf, value, offset, littleEndian, noAssert) { + value = +value; + offset = offset >>> 0; + + if (!noAssert) { + checkIEEE754(buf, value, offset, 8); + } + + ieee754.write(buf, value, offset, littleEndian, 52, 8); + return offset + 8; + } + + Buffer.prototype.writeDoubleLE = function writeDoubleLE(value, offset, noAssert) { + return writeDouble(this, value, offset, true, noAssert); + }; + + Buffer.prototype.writeDoubleBE = function writeDoubleBE(value, offset, noAssert) { + return writeDouble(this, value, offset, false, noAssert); + }; // copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length) + + + Buffer.prototype.copy = function copy(target, targetStart, start, end) { + if (!Buffer.isBuffer(target)) throw new TypeError('argument should be a Buffer'); + if (!start) start = 0; + if (!end && end !== 0) end = this.length; + if (targetStart >= target.length) targetStart = target.length; + if (!targetStart) targetStart = 0; + if (end > 0 && end < start) end = start; // Copy 0 bytes; we're done + + if (end === start) return 0; + if (target.length === 0 || this.length === 0) return 0; // Fatal error conditions + + if (targetStart < 0) { + throw new RangeError('targetStart out of bounds'); + } + + if (start < 0 || start >= this.length) throw new RangeError('Index out of range'); + if (end < 0) throw new RangeError('sourceEnd out of bounds'); // Are we oob? + + if (end > this.length) end = this.length; + + if (target.length - targetStart < end - start) { + end = target.length - targetStart + start; + } + + var len = end - start; + + if (this === target && typeof Uint8Array.prototype.copyWithin === 'function') { + // Use built-in when available, missing from IE11 + this.copyWithin(targetStart, start, end); + } else { + Uint8Array.prototype.set.call(target, this.subarray(start, end), targetStart); + } + + return len; + }; // Usage: + // buffer.fill(number[, offset[, end]]) + // buffer.fill(buffer[, offset[, end]]) + // buffer.fill(string[, offset[, end]][, encoding]) + + + Buffer.prototype.fill = function fill(val, start, end, encoding) { + // Handle string cases: + if (typeof val === 'string') { + if (typeof start === 'string') { + encoding = start; + start = 0; + end = this.length; + } else if (typeof end === 'string') { + encoding = end; + end = this.length; + } + + if (encoding !== undefined && typeof encoding !== 'string') { + throw new TypeError('encoding must be a string'); + } + + if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) { + throw new TypeError('Unknown encoding: ' + encoding); + } + + if (val.length === 1) { + var code = val.charCodeAt(0); + + if (encoding === 'utf8' && code < 128 || encoding === 'latin1') { + // Fast path: If `val` fits into a single byte, use that numeric value. + val = code; + } + } + } else if (typeof val === 'number') { + val = val & 255; + } else if (typeof val === 'boolean') { + val = Number(val); + } // Invalid ranges are not set to a default, so can range check early. + + + if (start < 0 || this.length < start || this.length < end) { + throw new RangeError('Out of range index'); + } + + if (end <= start) { + return this; + } + + start = start >>> 0; + end = end === undefined ? this.length : end >>> 0; + if (!val) val = 0; + var i; + + if (typeof val === 'number') { + for (i = start; i < end; ++i) { + this[i] = val; + } + } else { + var bytes = Buffer.isBuffer(val) ? val : Buffer.from(val, encoding); + var len = bytes.length; + + if (len === 0) { + throw new TypeError('The value "' + val + '" is invalid for argument "value"'); + } + + for (i = 0; i < end - start; ++i) { + this[i + start] = bytes[i % len]; + } + } + + return this; + }; // HELPER FUNCTIONS + // ================ + + + var INVALID_BASE64_RE = /[^+/0-9A-Za-z-_]/g; + + function base64clean(str) { + // Node takes equal signs as end of the Base64 encoding + str = str.split('=')[0]; // Node strips out invalid characters like \n and \t from the string, base64-js does not + + str = str.trim().replace(INVALID_BASE64_RE, ''); // Node converts strings with length < 2 to '' + + if (str.length < 2) return ''; // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not + + while (str.length % 4 !== 0) { + str = str + '='; + } + + return str; + } + + function utf8ToBytes(string, units) { + units = units || Infinity; + var codePoint; + var length = string.length; + var leadSurrogate = null; + var bytes = []; + + for (var i = 0; i < length; ++i) { + codePoint = string.charCodeAt(i); // is surrogate component + + if (codePoint > 0xD7FF && codePoint < 0xE000) { + // last char was a lead + if (!leadSurrogate) { + // no lead yet + if (codePoint > 0xDBFF) { + // unexpected trail + if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD); + continue; + } else if (i + 1 === length) { + // unpaired lead + if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD); + continue; + } // valid lead + + + leadSurrogate = codePoint; + continue; + } // 2 leads in a row + + + if (codePoint < 0xDC00) { + if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD); + leadSurrogate = codePoint; + continue; + } // valid surrogate pair + + + codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000; + } else if (leadSurrogate) { + // valid bmp char, but last char was a lead + if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD); + } + + leadSurrogate = null; // encode utf8 + + if (codePoint < 0x80) { + if ((units -= 1) < 0) break; + bytes.push(codePoint); + } else if (codePoint < 0x800) { + if ((units -= 2) < 0) break; + bytes.push(codePoint >> 0x6 | 0xC0, codePoint & 0x3F | 0x80); + } else if (codePoint < 0x10000) { + if ((units -= 3) < 0) break; + bytes.push(codePoint >> 0xC | 0xE0, codePoint >> 0x6 & 0x3F | 0x80, codePoint & 0x3F | 0x80); + } else if (codePoint < 0x110000) { + if ((units -= 4) < 0) break; + bytes.push(codePoint >> 0x12 | 0xF0, codePoint >> 0xC & 0x3F | 0x80, codePoint >> 0x6 & 0x3F | 0x80, codePoint & 0x3F | 0x80); + } else { + throw new Error('Invalid code point'); + } + } + + return bytes; + } + + function asciiToBytes(str) { + var byteArray = []; + + for (var i = 0; i < str.length; ++i) { + // Node's code seems to be doing this and not & 0x7F.. + byteArray.push(str.charCodeAt(i) & 0xFF); + } + + return byteArray; + } + + function utf16leToBytes(str, units) { + var c, hi, lo; + var byteArray = []; + + for (var i = 0; i < str.length; ++i) { + if ((units -= 2) < 0) break; + c = str.charCodeAt(i); + hi = c >> 8; + lo = c % 256; + byteArray.push(lo); + byteArray.push(hi); + } + + return byteArray; + } + + function base64ToBytes(str) { + return base64Js.toByteArray(base64clean(str)); + } + + function blitBuffer(src, dst, offset, length) { + for (var i = 0; i < length; ++i) { + if (i + offset >= dst.length || i >= src.length) break; + dst[i + offset] = src[i]; + } + + return i; + } // ArrayBuffer or Uint8Array objects from other contexts (i.e. iframes) do not pass + // the `instanceof` check but they should be treated as of that type. + // See: https://github.com/feross/buffer/issues/166 + + + function isInstance(obj, type) { + return obj instanceof type || obj != null && obj.constructor != null && obj.constructor.name != null && obj.constructor.name === type.name; + } + + function numberIsNaN(obj) { + // For IE11 support + return obj !== obj; // eslint-disable-line no-self-compare + } // Create lookup table for `toString('hex')` + // See: https://github.com/feross/buffer/issues/219 + + + var hexSliceLookupTable = function () { + var alphabet = '0123456789abcdef'; + var table = new Array(256); + + for (var i = 0; i < 16; ++i) { + var i16 = i * 16; + + for (var j = 0; j < 16; ++j) { + table[i16 + j] = alphabet[i] + alphabet[j]; + } + } + + return table; + }(); + }); + var buffer_1 = buffer$1.Buffer; + buffer$1.SlowBuffer; + buffer$1.INSPECT_MAX_BYTES; + buffer$1.kMaxLength; + + /*! ***************************************************************************** + Copyright (c) Microsoft Corporation. + + Permission to use, copy, modify, and/or distribute this software for any + purpose with or without fee is hereby granted. + + THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH + REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, + INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM + LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + PERFORMANCE OF THIS SOFTWARE. + ***************************************************************************** */ + + /* global Reflect, Promise */ + var _extendStatics = function extendStatics(d, b) { + _extendStatics = Object.setPrototypeOf || { + __proto__: [] + } instanceof Array && function (d, b) { + d.__proto__ = b; + } || function (d, b) { + for (var p in b) { + if (b.hasOwnProperty(p)) d[p] = b[p]; + } + }; + + return _extendStatics(d, b); + }; + + function __extends(d, b) { + _extendStatics(d, b); + + function __() { + this.constructor = d; + } + + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + } + + var _assign = function __assign() { + _assign = Object.assign || function __assign(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + + for (var p in s) { + if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; + } + } + + return t; + }; + + return _assign.apply(this, arguments); + }; + + /** @public */ + var BSONError = /** @class */ (function (_super) { + __extends(BSONError, _super); + function BSONError(message) { + var _this = _super.call(this, message) || this; + Object.setPrototypeOf(_this, BSONError.prototype); + return _this; + } + Object.defineProperty(BSONError.prototype, "name", { + get: function () { + return 'BSONError'; + }, + enumerable: false, + configurable: true + }); + return BSONError; + }(Error)); + /** @public */ + var BSONTypeError = /** @class */ (function (_super) { + __extends(BSONTypeError, _super); + function BSONTypeError(message) { + var _this = _super.call(this, message) || this; + Object.setPrototypeOf(_this, BSONTypeError.prototype); + return _this; + } + Object.defineProperty(BSONTypeError.prototype, "name", { + get: function () { + return 'BSONTypeError'; + }, + enumerable: false, + configurable: true + }); + return BSONTypeError; + }(TypeError)); + + function checkForMath(potentialGlobal) { + // eslint-disable-next-line eqeqeq + return potentialGlobal && potentialGlobal.Math == Math && potentialGlobal; + } + // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028 + function getGlobal() { + // eslint-disable-next-line no-undef + return (checkForMath(typeof globalThis === 'object' && globalThis) || + checkForMath(typeof window === 'object' && window) || + checkForMath(typeof self === 'object' && self) || + checkForMath(typeof global === 'object' && global) || + Function('return this')()); + } + + /** + * Normalizes our expected stringified form of a function across versions of node + * @param fn - The function to stringify + */ + function normalizedFunctionString(fn) { + return fn.toString().replace('function(', 'function ('); + } + function isReactNative() { + var g = getGlobal(); + return typeof g.navigator === 'object' && g.navigator.product === 'ReactNative'; + } + var insecureRandomBytes = function insecureRandomBytes(size) { + var insecureWarning = isReactNative() + ? 'BSON: For React Native please polyfill crypto.getRandomValues, e.g. using: https://www.npmjs.com/package/react-native-get-random-values.' + : 'BSON: No cryptographic implementation for random bytes present, falling back to a less secure implementation.'; + console.warn(insecureWarning); + var result = buffer_1.alloc(size); + for (var i = 0; i < size; ++i) + result[i] = Math.floor(Math.random() * 256); + return result; + }; + var detectRandomBytes = function () { + if (typeof window !== 'undefined') { + // browser crypto implementation(s) + var target_1 = window.crypto || window.msCrypto; // allow for IE11 + if (target_1 && target_1.getRandomValues) { + return function (size) { return target_1.getRandomValues(buffer_1.alloc(size)); }; + } + } + if (typeof global !== 'undefined' && global.crypto && global.crypto.getRandomValues) { + // allow for RN packages such as https://www.npmjs.com/package/react-native-get-random-values to populate global + return function (size) { return global.crypto.getRandomValues(buffer_1.alloc(size)); }; + } + var requiredRandomBytes; + try { + // eslint-disable-next-line @typescript-eslint/no-var-requires + requiredRandomBytes = require('crypto').randomBytes; + } + catch (e) { + // keep the fallback + } + // NOTE: in transpiled cases the above require might return null/undefined + return requiredRandomBytes || insecureRandomBytes; + }; + var randomBytes = detectRandomBytes(); + function isAnyArrayBuffer(value) { + return ['[object ArrayBuffer]', '[object SharedArrayBuffer]'].includes(Object.prototype.toString.call(value)); + } + function isUint8Array(value) { + return Object.prototype.toString.call(value) === '[object Uint8Array]'; + } + function isBigInt64Array(value) { + return Object.prototype.toString.call(value) === '[object BigInt64Array]'; + } + function isBigUInt64Array(value) { + return Object.prototype.toString.call(value) === '[object BigUint64Array]'; + } + function isRegExp(d) { + return Object.prototype.toString.call(d) === '[object RegExp]'; + } + function isMap(d) { + return Object.prototype.toString.call(d) === '[object Map]'; + } + // To ensure that 0.4 of node works correctly + function isDate(d) { + return isObjectLike(d) && Object.prototype.toString.call(d) === '[object Date]'; + } + /** + * @internal + * this is to solve the `'someKey' in x` problem where x is unknown. + * https://github.com/typescript-eslint/typescript-eslint/issues/1071#issuecomment-541955753 + */ + function isObjectLike(candidate) { + return typeof candidate === 'object' && candidate !== null; + } + function deprecate(fn, message) { + var warned = false; + function deprecated() { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + if (!warned) { + console.warn(message); + warned = true; + } + return fn.apply(this, args); + } + return deprecated; + } + + /** + * Makes sure that, if a Uint8Array is passed in, it is wrapped in a Buffer. + * + * @param potentialBuffer - The potential buffer + * @returns Buffer the input if potentialBuffer is a buffer, or a buffer that + * wraps a passed in Uint8Array + * @throws BSONTypeError If anything other than a Buffer or Uint8Array is passed in + */ + function ensureBuffer(potentialBuffer) { + if (ArrayBuffer.isView(potentialBuffer)) { + return buffer_1.from(potentialBuffer.buffer, potentialBuffer.byteOffset, potentialBuffer.byteLength); + } + if (isAnyArrayBuffer(potentialBuffer)) { + return buffer_1.from(potentialBuffer); + } + throw new BSONTypeError('Must use either Buffer or TypedArray'); + } + + // Validation regex for v4 uuid (validates with or without dashes) + var VALIDATION_REGEX = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|[0-9a-f]{12}4[0-9a-f]{3}[89ab][0-9a-f]{15})$/i; + var uuidValidateString = function (str) { + return typeof str === 'string' && VALIDATION_REGEX.test(str); + }; + var uuidHexStringToBuffer = function (hexString) { + if (!uuidValidateString(hexString)) { + throw new BSONTypeError('UUID string representations must be a 32 or 36 character hex string (dashes excluded/included). Format: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" or "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx".'); + } + var sanitizedHexString = hexString.replace(/-/g, ''); + return buffer_1.from(sanitizedHexString, 'hex'); + }; + var bufferToUuidHexString = function (buffer, includeDashes) { + if (includeDashes === void 0) { includeDashes = true; } + return includeDashes + ? buffer.toString('hex', 0, 4) + + '-' + + buffer.toString('hex', 4, 6) + + '-' + + buffer.toString('hex', 6, 8) + + '-' + + buffer.toString('hex', 8, 10) + + '-' + + buffer.toString('hex', 10, 16) + : buffer.toString('hex'); + }; + + var BYTE_LENGTH = 16; + var kId$1 = Symbol('id'); + /** + * A class representation of the BSON UUID type. + * @public + */ + var UUID = /** @class */ (function () { + /** + * Create an UUID type + * + * @param input - Can be a 32 or 36 character hex string (dashes excluded/included) or a 16 byte binary Buffer. + */ + function UUID(input) { + if (typeof input === 'undefined') { + // The most common use case (blank id, new UUID() instance) + this.id = UUID.generate(); + } + else if (input instanceof UUID) { + this[kId$1] = buffer_1.from(input.id); + this.__id = input.__id; + } + else if (ArrayBuffer.isView(input) && input.byteLength === BYTE_LENGTH) { + this.id = ensureBuffer(input); + } + else if (typeof input === 'string') { + this.id = uuidHexStringToBuffer(input); + } + else { + throw new BSONTypeError('Argument passed in UUID constructor must be a UUID, a 16 byte Buffer or a 32/36 character hex string (dashes excluded/included, format: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx).'); + } + } + Object.defineProperty(UUID.prototype, "id", { + /** + * The UUID bytes + * @readonly + */ + get: function () { + return this[kId$1]; + }, + set: function (value) { + this[kId$1] = value; + if (UUID.cacheHexString) { + this.__id = bufferToUuidHexString(value); + } + }, + enumerable: false, + configurable: true + }); + /** + * Generate a 16 byte uuid v4 buffer used in UUIDs + */ + /** + * Returns the UUID id as a 32 or 36 character hex string representation, excluding/including dashes (defaults to 36 character dash separated) + * @param includeDashes - should the string exclude dash-separators. + * */ + UUID.prototype.toHexString = function (includeDashes) { + if (includeDashes === void 0) { includeDashes = true; } + if (UUID.cacheHexString && this.__id) { + return this.__id; + } + var uuidHexString = bufferToUuidHexString(this.id, includeDashes); + if (UUID.cacheHexString) { + this.__id = uuidHexString; + } + return uuidHexString; + }; + /** + * Converts the id into a 36 character (dashes included) hex string, unless a encoding is specified. + */ + UUID.prototype.toString = function (encoding) { + return encoding ? this.id.toString(encoding) : this.toHexString(); + }; + /** + * Converts the id into its JSON string representation. + * A 36 character (dashes included) hex string in the format: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx + */ + UUID.prototype.toJSON = function () { + return this.toHexString(); + }; + /** + * Compares the equality of this UUID with `otherID`. + * + * @param otherId - UUID instance to compare against. + */ + UUID.prototype.equals = function (otherId) { + if (!otherId) { + return false; + } + if (otherId instanceof UUID) { + return otherId.id.equals(this.id); + } + try { + return new UUID(otherId).id.equals(this.id); + } + catch (_a) { + return false; + } + }; + /** + * Creates a Binary instance from the current UUID. + */ + UUID.prototype.toBinary = function () { + return new Binary(this.id, Binary.SUBTYPE_UUID); + }; + /** + * Generates a populated buffer containing a v4 uuid + */ + UUID.generate = function () { + var bytes = randomBytes(BYTE_LENGTH); + // Per 4.4, set bits for version and `clock_seq_hi_and_reserved` + // Kindly borrowed from https://github.com/uuidjs/uuid/blob/master/src/v4.js + bytes[6] = (bytes[6] & 0x0f) | 0x40; + bytes[8] = (bytes[8] & 0x3f) | 0x80; + return buffer_1.from(bytes); + }; + /** + * Checks if a value is a valid bson UUID + * @param input - UUID, string or Buffer to validate. + */ + UUID.isValid = function (input) { + if (!input) { + return false; + } + if (input instanceof UUID) { + return true; + } + if (typeof input === 'string') { + return uuidValidateString(input); + } + if (isUint8Array(input)) { + // check for length & uuid version (https://tools.ietf.org/html/rfc4122#section-4.1.3) + if (input.length !== BYTE_LENGTH) { + return false; + } + try { + // get this byte as hex: xxxxxxxx-xxxx-XXxx-xxxx-xxxxxxxxxxxx + // check first part as uuid version: xxxxxxxx-xxxx-Xxxx-xxxx-xxxxxxxxxxxx + return parseInt(input[6].toString(16)[0], 10) === Binary.SUBTYPE_UUID; + } + catch (_a) { + return false; + } + } + return false; + }; + /** + * Creates an UUID from a hex string representation of an UUID. + * @param hexString - 32 or 36 character hex string (dashes excluded/included). + */ + UUID.createFromHexString = function (hexString) { + var buffer = uuidHexStringToBuffer(hexString); + return new UUID(buffer); + }; + /** + * Converts to a string representation of this Id. + * + * @returns return the 36 character hex string representation. + * @internal + */ + UUID.prototype[Symbol.for('nodejs.util.inspect.custom')] = function () { + return this.inspect(); + }; + UUID.prototype.inspect = function () { + return "new UUID(\"" + this.toHexString() + "\")"; + }; + return UUID; + }()); + Object.defineProperty(UUID.prototype, '_bsontype', { value: 'UUID' }); + + /** + * A class representation of the BSON Binary type. + * @public + * @category BSONType + */ + var Binary = /** @class */ (function () { + /** + * @param buffer - a buffer object containing the binary data. + * @param subType - the option binary type. + */ + function Binary(buffer, subType) { + if (!(this instanceof Binary)) + return new Binary(buffer, subType); + if (!(buffer == null) && + !(typeof buffer === 'string') && + !ArrayBuffer.isView(buffer) && + !(buffer instanceof ArrayBuffer) && + !Array.isArray(buffer)) { + throw new BSONTypeError('Binary can only be constructed from string, Buffer, TypedArray, or Array'); + } + this.sub_type = subType !== null && subType !== void 0 ? subType : Binary.BSON_BINARY_SUBTYPE_DEFAULT; + if (buffer == null) { + // create an empty binary buffer + this.buffer = buffer_1.alloc(Binary.BUFFER_SIZE); + this.position = 0; + } + else { + if (typeof buffer === 'string') { + // string + this.buffer = buffer_1.from(buffer, 'binary'); + } + else if (Array.isArray(buffer)) { + // number[] + this.buffer = buffer_1.from(buffer); + } + else { + // Buffer | TypedArray | ArrayBuffer + this.buffer = ensureBuffer(buffer); + } + this.position = this.buffer.byteLength; + } + } + /** + * Updates this binary with byte_value. + * + * @param byteValue - a single byte we wish to write. + */ + Binary.prototype.put = function (byteValue) { + // If it's a string and a has more than one character throw an error + if (typeof byteValue === 'string' && byteValue.length !== 1) { + throw new BSONTypeError('only accepts single character String'); + } + else if (typeof byteValue !== 'number' && byteValue.length !== 1) + throw new BSONTypeError('only accepts single character Uint8Array or Array'); + // Decode the byte value once + var decodedByte; + if (typeof byteValue === 'string') { + decodedByte = byteValue.charCodeAt(0); + } + else if (typeof byteValue === 'number') { + decodedByte = byteValue; + } + else { + decodedByte = byteValue[0]; + } + if (decodedByte < 0 || decodedByte > 255) { + throw new BSONTypeError('only accepts number in a valid unsigned byte range 0-255'); + } + if (this.buffer.length > this.position) { + this.buffer[this.position++] = decodedByte; + } + else { + var buffer = buffer_1.alloc(Binary.BUFFER_SIZE + this.buffer.length); + // Combine the two buffers together + this.buffer.copy(buffer, 0, 0, this.buffer.length); + this.buffer = buffer; + this.buffer[this.position++] = decodedByte; + } + }; + /** + * Writes a buffer or string to the binary. + * + * @param sequence - a string or buffer to be written to the Binary BSON object. + * @param offset - specify the binary of where to write the content. + */ + Binary.prototype.write = function (sequence, offset) { + offset = typeof offset === 'number' ? offset : this.position; + // If the buffer is to small let's extend the buffer + if (this.buffer.length < offset + sequence.length) { + var buffer = buffer_1.alloc(this.buffer.length + sequence.length); + this.buffer.copy(buffer, 0, 0, this.buffer.length); + // Assign the new buffer + this.buffer = buffer; + } + if (ArrayBuffer.isView(sequence)) { + this.buffer.set(ensureBuffer(sequence), offset); + this.position = + offset + sequence.byteLength > this.position ? offset + sequence.length : this.position; + } + else if (typeof sequence === 'string') { + this.buffer.write(sequence, offset, sequence.length, 'binary'); + this.position = + offset + sequence.length > this.position ? offset + sequence.length : this.position; + } + }; + /** + * Reads **length** bytes starting at **position**. + * + * @param position - read from the given position in the Binary. + * @param length - the number of bytes to read. + */ + Binary.prototype.read = function (position, length) { + length = length && length > 0 ? length : this.position; + // Let's return the data based on the type we have + return this.buffer.slice(position, position + length); + }; + /** + * Returns the value of this binary as a string. + * @param asRaw - Will skip converting to a string + * @remarks + * This is handy when calling this function conditionally for some key value pairs and not others + */ + Binary.prototype.value = function (asRaw) { + asRaw = !!asRaw; + // Optimize to serialize for the situation where the data == size of buffer + if (asRaw && this.buffer.length === this.position) { + return this.buffer; + } + // If it's a node.js buffer object + if (asRaw) { + return this.buffer.slice(0, this.position); + } + return this.buffer.toString('binary', 0, this.position); + }; + /** the length of the binary sequence */ + Binary.prototype.length = function () { + return this.position; + }; + Binary.prototype.toJSON = function () { + return this.buffer.toString('base64'); + }; + Binary.prototype.toString = function (format) { + return this.buffer.toString(format); + }; + /** @internal */ + Binary.prototype.toExtendedJSON = function (options) { + options = options || {}; + var base64String = this.buffer.toString('base64'); + var subType = Number(this.sub_type).toString(16); + if (options.legacy) { + return { + $binary: base64String, + $type: subType.length === 1 ? '0' + subType : subType + }; + } + return { + $binary: { + base64: base64String, + subType: subType.length === 1 ? '0' + subType : subType + } + }; + }; + Binary.prototype.toUUID = function () { + if (this.sub_type === Binary.SUBTYPE_UUID) { + return new UUID(this.buffer.slice(0, this.position)); + } + throw new BSONError("Binary sub_type \"" + this.sub_type + "\" is not supported for converting to UUID. Only \"" + Binary.SUBTYPE_UUID + "\" is currently supported."); + }; + /** @internal */ + Binary.fromExtendedJSON = function (doc, options) { + options = options || {}; + var data; + var type; + if ('$binary' in doc) { + if (options.legacy && typeof doc.$binary === 'string' && '$type' in doc) { + type = doc.$type ? parseInt(doc.$type, 16) : 0; + data = buffer_1.from(doc.$binary, 'base64'); + } + else { + if (typeof doc.$binary !== 'string') { + type = doc.$binary.subType ? parseInt(doc.$binary.subType, 16) : 0; + data = buffer_1.from(doc.$binary.base64, 'base64'); + } + } + } + else if ('$uuid' in doc) { + type = 4; + data = uuidHexStringToBuffer(doc.$uuid); + } + if (!data) { + throw new BSONTypeError("Unexpected Binary Extended JSON format " + JSON.stringify(doc)); + } + return new Binary(data, type); + }; + /** @internal */ + Binary.prototype[Symbol.for('nodejs.util.inspect.custom')] = function () { + return this.inspect(); + }; + Binary.prototype.inspect = function () { + var asBuffer = this.value(true); + return "new Binary(Buffer.from(\"" + asBuffer.toString('hex') + "\", \"hex\"), " + this.sub_type + ")"; + }; + /** + * Binary default subtype + * @internal + */ + Binary.BSON_BINARY_SUBTYPE_DEFAULT = 0; + /** Initial buffer default size */ + Binary.BUFFER_SIZE = 256; + /** Default BSON type */ + Binary.SUBTYPE_DEFAULT = 0; + /** Function BSON type */ + Binary.SUBTYPE_FUNCTION = 1; + /** Byte Array BSON type */ + Binary.SUBTYPE_BYTE_ARRAY = 2; + /** Deprecated UUID BSON type @deprecated Please use SUBTYPE_UUID */ + Binary.SUBTYPE_UUID_OLD = 3; + /** UUID BSON type */ + Binary.SUBTYPE_UUID = 4; + /** MD5 BSON type */ + Binary.SUBTYPE_MD5 = 5; + /** Encrypted BSON type */ + Binary.SUBTYPE_ENCRYPTED = 6; + /** Column BSON type */ + Binary.SUBTYPE_COLUMN = 7; + /** User BSON type */ + Binary.SUBTYPE_USER_DEFINED = 128; + return Binary; + }()); + Object.defineProperty(Binary.prototype, '_bsontype', { value: 'Binary' }); + + /** + * A class representation of the BSON Code type. + * @public + * @category BSONType + */ + var Code = /** @class */ (function () { + /** + * @param code - a string or function. + * @param scope - an optional scope for the function. + */ + function Code(code, scope) { + if (!(this instanceof Code)) + return new Code(code, scope); + this.code = code; + this.scope = scope; + } + Code.prototype.toJSON = function () { + return { code: this.code, scope: this.scope }; + }; + /** @internal */ + Code.prototype.toExtendedJSON = function () { + if (this.scope) { + return { $code: this.code, $scope: this.scope }; + } + return { $code: this.code }; + }; + /** @internal */ + Code.fromExtendedJSON = function (doc) { + return new Code(doc.$code, doc.$scope); + }; + /** @internal */ + Code.prototype[Symbol.for('nodejs.util.inspect.custom')] = function () { + return this.inspect(); + }; + Code.prototype.inspect = function () { + var codeJson = this.toJSON(); + return "new Code(\"" + codeJson.code + "\"" + (codeJson.scope ? ", " + JSON.stringify(codeJson.scope) : '') + ")"; + }; + return Code; + }()); + Object.defineProperty(Code.prototype, '_bsontype', { value: 'Code' }); + + /** @internal */ + function isDBRefLike(value) { + return (isObjectLike(value) && + value.$id != null && + typeof value.$ref === 'string' && + (value.$db == null || typeof value.$db === 'string')); + } + /** + * A class representation of the BSON DBRef type. + * @public + * @category BSONType + */ + var DBRef = /** @class */ (function () { + /** + * @param collection - the collection name. + * @param oid - the reference ObjectId. + * @param db - optional db name, if omitted the reference is local to the current db. + */ + function DBRef(collection, oid, db, fields) { + if (!(this instanceof DBRef)) + return new DBRef(collection, oid, db, fields); + // check if namespace has been provided + var parts = collection.split('.'); + if (parts.length === 2) { + db = parts.shift(); + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + collection = parts.shift(); + } + this.collection = collection; + this.oid = oid; + this.db = db; + this.fields = fields || {}; + } + Object.defineProperty(DBRef.prototype, "namespace", { + // Property provided for compatibility with the 1.x parser + // the 1.x parser used a "namespace" property, while 4.x uses "collection" + /** @internal */ + get: function () { + return this.collection; + }, + set: function (value) { + this.collection = value; + }, + enumerable: false, + configurable: true + }); + DBRef.prototype.toJSON = function () { + var o = Object.assign({ + $ref: this.collection, + $id: this.oid + }, this.fields); + if (this.db != null) + o.$db = this.db; + return o; + }; + /** @internal */ + DBRef.prototype.toExtendedJSON = function (options) { + options = options || {}; + var o = { + $ref: this.collection, + $id: this.oid + }; + if (options.legacy) { + return o; + } + if (this.db) + o.$db = this.db; + o = Object.assign(o, this.fields); + return o; + }; + /** @internal */ + DBRef.fromExtendedJSON = function (doc) { + var copy = Object.assign({}, doc); + delete copy.$ref; + delete copy.$id; + delete copy.$db; + return new DBRef(doc.$ref, doc.$id, doc.$db, copy); + }; + /** @internal */ + DBRef.prototype[Symbol.for('nodejs.util.inspect.custom')] = function () { + return this.inspect(); + }; + DBRef.prototype.inspect = function () { + // NOTE: if OID is an ObjectId class it will just print the oid string. + var oid = this.oid === undefined || this.oid.toString === undefined ? this.oid : this.oid.toString(); + return "new DBRef(\"" + this.namespace + "\", new ObjectId(\"" + oid + "\")" + (this.db ? ", \"" + this.db + "\"" : '') + ")"; + }; + return DBRef; + }()); + Object.defineProperty(DBRef.prototype, '_bsontype', { value: 'DBRef' }); + + /** + * wasm optimizations, to do native i64 multiplication and divide + */ + var wasm = undefined; + try { + wasm = new WebAssembly.Instance(new WebAssembly.Module( + // prettier-ignore + new Uint8Array([0, 97, 115, 109, 1, 0, 0, 0, 1, 13, 2, 96, 0, 1, 127, 96, 4, 127, 127, 127, 127, 1, 127, 3, 7, 6, 0, 1, 1, 1, 1, 1, 6, 6, 1, 127, 1, 65, 0, 11, 7, 50, 6, 3, 109, 117, 108, 0, 1, 5, 100, 105, 118, 95, 115, 0, 2, 5, 100, 105, 118, 95, 117, 0, 3, 5, 114, 101, 109, 95, 115, 0, 4, 5, 114, 101, 109, 95, 117, 0, 5, 8, 103, 101, 116, 95, 104, 105, 103, 104, 0, 0, 10, 191, 1, 6, 4, 0, 35, 0, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 126, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 127, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 128, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 129, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 130, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11])), {}).exports; + } + catch (_a) { + // no wasm support + } + var TWO_PWR_16_DBL = 1 << 16; + var TWO_PWR_24_DBL = 1 << 24; + var TWO_PWR_32_DBL = TWO_PWR_16_DBL * TWO_PWR_16_DBL; + var TWO_PWR_64_DBL = TWO_PWR_32_DBL * TWO_PWR_32_DBL; + var TWO_PWR_63_DBL = TWO_PWR_64_DBL / 2; + /** A cache of the Long representations of small integer values. */ + var INT_CACHE = {}; + /** A cache of the Long representations of small unsigned integer values. */ + var UINT_CACHE = {}; + /** + * A class representing a 64-bit integer + * @public + * @category BSONType + * @remarks + * The internal representation of a long is the two given signed, 32-bit values. + * We use 32-bit pieces because these are the size of integers on which + * Javascript performs bit-operations. For operations like addition and + * multiplication, we split each number into 16 bit pieces, which can easily be + * multiplied within Javascript's floating-point representation without overflow + * or change in sign. + * In the algorithms below, we frequently reduce the negative case to the + * positive case by negating the input(s) and then post-processing the result. + * Note that we must ALWAYS check specially whether those values are MIN_VALUE + * (-2^63) because -MIN_VALUE == MIN_VALUE (since 2^63 cannot be represented as + * a positive number, it overflows back into a negative). Not handling this + * case would often result in infinite recursion. + * Common constant values ZERO, ONE, NEG_ONE, etc. are found as static properties on this class. + */ + var Long = /** @class */ (function () { + /** + * Constructs a 64 bit two's-complement integer, given its low and high 32 bit values as *signed* integers. + * See the from* functions below for more convenient ways of constructing Longs. + * + * Acceptable signatures are: + * - Long(low, high, unsigned?) + * - Long(bigint, unsigned?) + * - Long(string, unsigned?) + * + * @param low - The low (signed) 32 bits of the long + * @param high - The high (signed) 32 bits of the long + * @param unsigned - Whether unsigned or not, defaults to signed + */ + function Long(low, high, unsigned) { + if (low === void 0) { low = 0; } + if (!(this instanceof Long)) + return new Long(low, high, unsigned); + if (typeof low === 'bigint') { + Object.assign(this, Long.fromBigInt(low, !!high)); + } + else if (typeof low === 'string') { + Object.assign(this, Long.fromString(low, !!high)); + } + else { + this.low = low | 0; + this.high = high | 0; + this.unsigned = !!unsigned; + } + Object.defineProperty(this, '__isLong__', { + value: true, + configurable: false, + writable: false, + enumerable: false + }); + } + /** + * Returns a Long representing the 64 bit integer that comes by concatenating the given low and high bits. + * Each is assumed to use 32 bits. + * @param lowBits - The low 32 bits + * @param highBits - The high 32 bits + * @param unsigned - Whether unsigned or not, defaults to signed + * @returns The corresponding Long value + */ + Long.fromBits = function (lowBits, highBits, unsigned) { + return new Long(lowBits, highBits, unsigned); + }; + /** + * Returns a Long representing the given 32 bit integer value. + * @param value - The 32 bit integer in question + * @param unsigned - Whether unsigned or not, defaults to signed + * @returns The corresponding Long value + */ + Long.fromInt = function (value, unsigned) { + var obj, cachedObj, cache; + if (unsigned) { + value >>>= 0; + if ((cache = 0 <= value && value < 256)) { + cachedObj = UINT_CACHE[value]; + if (cachedObj) + return cachedObj; + } + obj = Long.fromBits(value, (value | 0) < 0 ? -1 : 0, true); + if (cache) + UINT_CACHE[value] = obj; + return obj; + } + else { + value |= 0; + if ((cache = -128 <= value && value < 128)) { + cachedObj = INT_CACHE[value]; + if (cachedObj) + return cachedObj; + } + obj = Long.fromBits(value, value < 0 ? -1 : 0, false); + if (cache) + INT_CACHE[value] = obj; + return obj; + } + }; + /** + * Returns a Long representing the given value, provided that it is a finite number. Otherwise, zero is returned. + * @param value - The number in question + * @param unsigned - Whether unsigned or not, defaults to signed + * @returns The corresponding Long value + */ + Long.fromNumber = function (value, unsigned) { + if (isNaN(value)) + return unsigned ? Long.UZERO : Long.ZERO; + if (unsigned) { + if (value < 0) + return Long.UZERO; + if (value >= TWO_PWR_64_DBL) + return Long.MAX_UNSIGNED_VALUE; + } + else { + if (value <= -TWO_PWR_63_DBL) + return Long.MIN_VALUE; + if (value + 1 >= TWO_PWR_63_DBL) + return Long.MAX_VALUE; + } + if (value < 0) + return Long.fromNumber(-value, unsigned).neg(); + return Long.fromBits(value % TWO_PWR_32_DBL | 0, (value / TWO_PWR_32_DBL) | 0, unsigned); + }; + /** + * Returns a Long representing the given value, provided that it is a finite number. Otherwise, zero is returned. + * @param value - The number in question + * @param unsigned - Whether unsigned or not, defaults to signed + * @returns The corresponding Long value + */ + Long.fromBigInt = function (value, unsigned) { + return Long.fromString(value.toString(), unsigned); + }; + /** + * Returns a Long representation of the given string, written using the specified radix. + * @param str - The textual representation of the Long + * @param unsigned - Whether unsigned or not, defaults to signed + * @param radix - The radix in which the text is written (2-36), defaults to 10 + * @returns The corresponding Long value + */ + Long.fromString = function (str, unsigned, radix) { + if (str.length === 0) + throw Error('empty string'); + if (str === 'NaN' || str === 'Infinity' || str === '+Infinity' || str === '-Infinity') + return Long.ZERO; + if (typeof unsigned === 'number') { + // For goog.math.long compatibility + (radix = unsigned), (unsigned = false); + } + else { + unsigned = !!unsigned; + } + radix = radix || 10; + if (radix < 2 || 36 < radix) + throw RangeError('radix'); + var p; + if ((p = str.indexOf('-')) > 0) + throw Error('interior hyphen'); + else if (p === 0) { + return Long.fromString(str.substring(1), unsigned, radix).neg(); + } + // Do several (8) digits each time through the loop, so as to + // minimize the calls to the very expensive emulated div. + var radixToPower = Long.fromNumber(Math.pow(radix, 8)); + var result = Long.ZERO; + for (var i = 0; i < str.length; i += 8) { + var size = Math.min(8, str.length - i), value = parseInt(str.substring(i, i + size), radix); + if (size < 8) { + var power = Long.fromNumber(Math.pow(radix, size)); + result = result.mul(power).add(Long.fromNumber(value)); + } + else { + result = result.mul(radixToPower); + result = result.add(Long.fromNumber(value)); + } + } + result.unsigned = unsigned; + return result; + }; + /** + * Creates a Long from its byte representation. + * @param bytes - Byte representation + * @param unsigned - Whether unsigned or not, defaults to signed + * @param le - Whether little or big endian, defaults to big endian + * @returns The corresponding Long value + */ + Long.fromBytes = function (bytes, unsigned, le) { + return le ? Long.fromBytesLE(bytes, unsigned) : Long.fromBytesBE(bytes, unsigned); + }; + /** + * Creates a Long from its little endian byte representation. + * @param bytes - Little endian byte representation + * @param unsigned - Whether unsigned or not, defaults to signed + * @returns The corresponding Long value + */ + Long.fromBytesLE = function (bytes, unsigned) { + return new Long(bytes[0] | (bytes[1] << 8) | (bytes[2] << 16) | (bytes[3] << 24), bytes[4] | (bytes[5] << 8) | (bytes[6] << 16) | (bytes[7] << 24), unsigned); + }; + /** + * Creates a Long from its big endian byte representation. + * @param bytes - Big endian byte representation + * @param unsigned - Whether unsigned or not, defaults to signed + * @returns The corresponding Long value + */ + Long.fromBytesBE = function (bytes, unsigned) { + return new Long((bytes[4] << 24) | (bytes[5] << 16) | (bytes[6] << 8) | bytes[7], (bytes[0] << 24) | (bytes[1] << 16) | (bytes[2] << 8) | bytes[3], unsigned); + }; + /** + * Tests if the specified object is a Long. + */ + // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types + Long.isLong = function (value) { + return isObjectLike(value) && value['__isLong__'] === true; + }; + /** + * Converts the specified value to a Long. + * @param unsigned - Whether unsigned or not, defaults to signed + */ + Long.fromValue = function (val, unsigned) { + if (typeof val === 'number') + return Long.fromNumber(val, unsigned); + if (typeof val === 'string') + return Long.fromString(val, unsigned); + // Throws for non-objects, converts non-instanceof Long: + return Long.fromBits(val.low, val.high, typeof unsigned === 'boolean' ? unsigned : val.unsigned); + }; + /** Returns the sum of this and the specified Long. */ + Long.prototype.add = function (addend) { + if (!Long.isLong(addend)) + addend = Long.fromValue(addend); + // Divide each number into 4 chunks of 16 bits, and then sum the chunks. + var a48 = this.high >>> 16; + var a32 = this.high & 0xffff; + var a16 = this.low >>> 16; + var a00 = this.low & 0xffff; + var b48 = addend.high >>> 16; + var b32 = addend.high & 0xffff; + var b16 = addend.low >>> 16; + var b00 = addend.low & 0xffff; + var c48 = 0, c32 = 0, c16 = 0, c00 = 0; + c00 += a00 + b00; + c16 += c00 >>> 16; + c00 &= 0xffff; + c16 += a16 + b16; + c32 += c16 >>> 16; + c16 &= 0xffff; + c32 += a32 + b32; + c48 += c32 >>> 16; + c32 &= 0xffff; + c48 += a48 + b48; + c48 &= 0xffff; + return Long.fromBits((c16 << 16) | c00, (c48 << 16) | c32, this.unsigned); + }; + /** + * Returns the sum of this and the specified Long. + * @returns Sum + */ + Long.prototype.and = function (other) { + if (!Long.isLong(other)) + other = Long.fromValue(other); + return Long.fromBits(this.low & other.low, this.high & other.high, this.unsigned); + }; + /** + * Compares this Long's value with the specified's. + * @returns 0 if they are the same, 1 if the this is greater and -1 if the given one is greater + */ + Long.prototype.compare = function (other) { + if (!Long.isLong(other)) + other = Long.fromValue(other); + if (this.eq(other)) + return 0; + var thisNeg = this.isNegative(), otherNeg = other.isNegative(); + if (thisNeg && !otherNeg) + return -1; + if (!thisNeg && otherNeg) + return 1; + // At this point the sign bits are the same + if (!this.unsigned) + return this.sub(other).isNegative() ? -1 : 1; + // Both are positive if at least one is unsigned + return other.high >>> 0 > this.high >>> 0 || + (other.high === this.high && other.low >>> 0 > this.low >>> 0) + ? -1 + : 1; + }; + /** This is an alias of {@link Long.compare} */ + Long.prototype.comp = function (other) { + return this.compare(other); + }; + /** + * Returns this Long divided by the specified. The result is signed if this Long is signed or unsigned if this Long is unsigned. + * @returns Quotient + */ + Long.prototype.divide = function (divisor) { + if (!Long.isLong(divisor)) + divisor = Long.fromValue(divisor); + if (divisor.isZero()) + throw Error('division by zero'); + // use wasm support if present + if (wasm) { + // guard against signed division overflow: the largest + // negative number / -1 would be 1 larger than the largest + // positive number, due to two's complement. + if (!this.unsigned && + this.high === -0x80000000 && + divisor.low === -1 && + divisor.high === -1) { + // be consistent with non-wasm code path + return this; + } + var low = (this.unsigned ? wasm.div_u : wasm.div_s)(this.low, this.high, divisor.low, divisor.high); + return Long.fromBits(low, wasm.get_high(), this.unsigned); + } + if (this.isZero()) + return this.unsigned ? Long.UZERO : Long.ZERO; + var approx, rem, res; + if (!this.unsigned) { + // This section is only relevant for signed longs and is derived from the + // closure library as a whole. + if (this.eq(Long.MIN_VALUE)) { + if (divisor.eq(Long.ONE) || divisor.eq(Long.NEG_ONE)) + return Long.MIN_VALUE; + // recall that -MIN_VALUE == MIN_VALUE + else if (divisor.eq(Long.MIN_VALUE)) + return Long.ONE; + else { + // At this point, we have |other| >= 2, so |this/other| < |MIN_VALUE|. + var halfThis = this.shr(1); + approx = halfThis.div(divisor).shl(1); + if (approx.eq(Long.ZERO)) { + return divisor.isNegative() ? Long.ONE : Long.NEG_ONE; + } + else { + rem = this.sub(divisor.mul(approx)); + res = approx.add(rem.div(divisor)); + return res; + } + } + } + else if (divisor.eq(Long.MIN_VALUE)) + return this.unsigned ? Long.UZERO : Long.ZERO; + if (this.isNegative()) { + if (divisor.isNegative()) + return this.neg().div(divisor.neg()); + return this.neg().div(divisor).neg(); + } + else if (divisor.isNegative()) + return this.div(divisor.neg()).neg(); + res = Long.ZERO; + } + else { + // The algorithm below has not been made for unsigned longs. It's therefore + // required to take special care of the MSB prior to running it. + if (!divisor.unsigned) + divisor = divisor.toUnsigned(); + if (divisor.gt(this)) + return Long.UZERO; + if (divisor.gt(this.shru(1))) + // 15 >>> 1 = 7 ; with divisor = 8 ; true + return Long.UONE; + res = Long.UZERO; + } + // Repeat the following until the remainder is less than other: find a + // floating-point that approximates remainder / other *from below*, add this + // into the result, and subtract it from the remainder. It is critical that + // the approximate value is less than or equal to the real value so that the + // remainder never becomes negative. + rem = this; + while (rem.gte(divisor)) { + // Approximate the result of division. This may be a little greater or + // smaller than the actual value. + approx = Math.max(1, Math.floor(rem.toNumber() / divisor.toNumber())); + // We will tweak the approximate result by changing it in the 48-th digit or + // the smallest non-fractional digit, whichever is larger. + var log2 = Math.ceil(Math.log(approx) / Math.LN2); + var delta = log2 <= 48 ? 1 : Math.pow(2, log2 - 48); + // Decrease the approximation until it is smaller than the remainder. Note + // that if it is too large, the product overflows and is negative. + var approxRes = Long.fromNumber(approx); + var approxRem = approxRes.mul(divisor); + while (approxRem.isNegative() || approxRem.gt(rem)) { + approx -= delta; + approxRes = Long.fromNumber(approx, this.unsigned); + approxRem = approxRes.mul(divisor); + } + // We know the answer can't be zero... and actually, zero would cause + // infinite recursion since we would make no progress. + if (approxRes.isZero()) + approxRes = Long.ONE; + res = res.add(approxRes); + rem = rem.sub(approxRem); + } + return res; + }; + /**This is an alias of {@link Long.divide} */ + Long.prototype.div = function (divisor) { + return this.divide(divisor); + }; + /** + * Tests if this Long's value equals the specified's. + * @param other - Other value + */ + Long.prototype.equals = function (other) { + if (!Long.isLong(other)) + other = Long.fromValue(other); + if (this.unsigned !== other.unsigned && this.high >>> 31 === 1 && other.high >>> 31 === 1) + return false; + return this.high === other.high && this.low === other.low; + }; + /** This is an alias of {@link Long.equals} */ + Long.prototype.eq = function (other) { + return this.equals(other); + }; + /** Gets the high 32 bits as a signed integer. */ + Long.prototype.getHighBits = function () { + return this.high; + }; + /** Gets the high 32 bits as an unsigned integer. */ + Long.prototype.getHighBitsUnsigned = function () { + return this.high >>> 0; + }; + /** Gets the low 32 bits as a signed integer. */ + Long.prototype.getLowBits = function () { + return this.low; + }; + /** Gets the low 32 bits as an unsigned integer. */ + Long.prototype.getLowBitsUnsigned = function () { + return this.low >>> 0; + }; + /** Gets the number of bits needed to represent the absolute value of this Long. */ + Long.prototype.getNumBitsAbs = function () { + if (this.isNegative()) { + // Unsigned Longs are never negative + return this.eq(Long.MIN_VALUE) ? 64 : this.neg().getNumBitsAbs(); + } + var val = this.high !== 0 ? this.high : this.low; + var bit; + for (bit = 31; bit > 0; bit--) + if ((val & (1 << bit)) !== 0) + break; + return this.high !== 0 ? bit + 33 : bit + 1; + }; + /** Tests if this Long's value is greater than the specified's. */ + Long.prototype.greaterThan = function (other) { + return this.comp(other) > 0; + }; + /** This is an alias of {@link Long.greaterThan} */ + Long.prototype.gt = function (other) { + return this.greaterThan(other); + }; + /** Tests if this Long's value is greater than or equal the specified's. */ + Long.prototype.greaterThanOrEqual = function (other) { + return this.comp(other) >= 0; + }; + /** This is an alias of {@link Long.greaterThanOrEqual} */ + Long.prototype.gte = function (other) { + return this.greaterThanOrEqual(other); + }; + /** This is an alias of {@link Long.greaterThanOrEqual} */ + Long.prototype.ge = function (other) { + return this.greaterThanOrEqual(other); + }; + /** Tests if this Long's value is even. */ + Long.prototype.isEven = function () { + return (this.low & 1) === 0; + }; + /** Tests if this Long's value is negative. */ + Long.prototype.isNegative = function () { + return !this.unsigned && this.high < 0; + }; + /** Tests if this Long's value is odd. */ + Long.prototype.isOdd = function () { + return (this.low & 1) === 1; + }; + /** Tests if this Long's value is positive. */ + Long.prototype.isPositive = function () { + return this.unsigned || this.high >= 0; + }; + /** Tests if this Long's value equals zero. */ + Long.prototype.isZero = function () { + return this.high === 0 && this.low === 0; + }; + /** Tests if this Long's value is less than the specified's. */ + Long.prototype.lessThan = function (other) { + return this.comp(other) < 0; + }; + /** This is an alias of {@link Long#lessThan}. */ + Long.prototype.lt = function (other) { + return this.lessThan(other); + }; + /** Tests if this Long's value is less than or equal the specified's. */ + Long.prototype.lessThanOrEqual = function (other) { + return this.comp(other) <= 0; + }; + /** This is an alias of {@link Long.lessThanOrEqual} */ + Long.prototype.lte = function (other) { + return this.lessThanOrEqual(other); + }; + /** Returns this Long modulo the specified. */ + Long.prototype.modulo = function (divisor) { + if (!Long.isLong(divisor)) + divisor = Long.fromValue(divisor); + // use wasm support if present + if (wasm) { + var low = (this.unsigned ? wasm.rem_u : wasm.rem_s)(this.low, this.high, divisor.low, divisor.high); + return Long.fromBits(low, wasm.get_high(), this.unsigned); + } + return this.sub(this.div(divisor).mul(divisor)); + }; + /** This is an alias of {@link Long.modulo} */ + Long.prototype.mod = function (divisor) { + return this.modulo(divisor); + }; + /** This is an alias of {@link Long.modulo} */ + Long.prototype.rem = function (divisor) { + return this.modulo(divisor); + }; + /** + * Returns the product of this and the specified Long. + * @param multiplier - Multiplier + * @returns Product + */ + Long.prototype.multiply = function (multiplier) { + if (this.isZero()) + return Long.ZERO; + if (!Long.isLong(multiplier)) + multiplier = Long.fromValue(multiplier); + // use wasm support if present + if (wasm) { + var low = wasm.mul(this.low, this.high, multiplier.low, multiplier.high); + return Long.fromBits(low, wasm.get_high(), this.unsigned); + } + if (multiplier.isZero()) + return Long.ZERO; + if (this.eq(Long.MIN_VALUE)) + return multiplier.isOdd() ? Long.MIN_VALUE : Long.ZERO; + if (multiplier.eq(Long.MIN_VALUE)) + return this.isOdd() ? Long.MIN_VALUE : Long.ZERO; + if (this.isNegative()) { + if (multiplier.isNegative()) + return this.neg().mul(multiplier.neg()); + else + return this.neg().mul(multiplier).neg(); + } + else if (multiplier.isNegative()) + return this.mul(multiplier.neg()).neg(); + // If both longs are small, use float multiplication + if (this.lt(Long.TWO_PWR_24) && multiplier.lt(Long.TWO_PWR_24)) + return Long.fromNumber(this.toNumber() * multiplier.toNumber(), this.unsigned); + // Divide each long into 4 chunks of 16 bits, and then add up 4x4 products. + // We can skip products that would overflow. + var a48 = this.high >>> 16; + var a32 = this.high & 0xffff; + var a16 = this.low >>> 16; + var a00 = this.low & 0xffff; + var b48 = multiplier.high >>> 16; + var b32 = multiplier.high & 0xffff; + var b16 = multiplier.low >>> 16; + var b00 = multiplier.low & 0xffff; + var c48 = 0, c32 = 0, c16 = 0, c00 = 0; + c00 += a00 * b00; + c16 += c00 >>> 16; + c00 &= 0xffff; + c16 += a16 * b00; + c32 += c16 >>> 16; + c16 &= 0xffff; + c16 += a00 * b16; + c32 += c16 >>> 16; + c16 &= 0xffff; + c32 += a32 * b00; + c48 += c32 >>> 16; + c32 &= 0xffff; + c32 += a16 * b16; + c48 += c32 >>> 16; + c32 &= 0xffff; + c32 += a00 * b32; + c48 += c32 >>> 16; + c32 &= 0xffff; + c48 += a48 * b00 + a32 * b16 + a16 * b32 + a00 * b48; + c48 &= 0xffff; + return Long.fromBits((c16 << 16) | c00, (c48 << 16) | c32, this.unsigned); + }; + /** This is an alias of {@link Long.multiply} */ + Long.prototype.mul = function (multiplier) { + return this.multiply(multiplier); + }; + /** Returns the Negation of this Long's value. */ + Long.prototype.negate = function () { + if (!this.unsigned && this.eq(Long.MIN_VALUE)) + return Long.MIN_VALUE; + return this.not().add(Long.ONE); + }; + /** This is an alias of {@link Long.negate} */ + Long.prototype.neg = function () { + return this.negate(); + }; + /** Returns the bitwise NOT of this Long. */ + Long.prototype.not = function () { + return Long.fromBits(~this.low, ~this.high, this.unsigned); + }; + /** Tests if this Long's value differs from the specified's. */ + Long.prototype.notEquals = function (other) { + return !this.equals(other); + }; + /** This is an alias of {@link Long.notEquals} */ + Long.prototype.neq = function (other) { + return this.notEquals(other); + }; + /** This is an alias of {@link Long.notEquals} */ + Long.prototype.ne = function (other) { + return this.notEquals(other); + }; + /** + * Returns the bitwise OR of this Long and the specified. + */ + Long.prototype.or = function (other) { + if (!Long.isLong(other)) + other = Long.fromValue(other); + return Long.fromBits(this.low | other.low, this.high | other.high, this.unsigned); + }; + /** + * Returns this Long with bits shifted to the left by the given amount. + * @param numBits - Number of bits + * @returns Shifted Long + */ + Long.prototype.shiftLeft = function (numBits) { + if (Long.isLong(numBits)) + numBits = numBits.toInt(); + if ((numBits &= 63) === 0) + return this; + else if (numBits < 32) + return Long.fromBits(this.low << numBits, (this.high << numBits) | (this.low >>> (32 - numBits)), this.unsigned); + else + return Long.fromBits(0, this.low << (numBits - 32), this.unsigned); + }; + /** This is an alias of {@link Long.shiftLeft} */ + Long.prototype.shl = function (numBits) { + return this.shiftLeft(numBits); + }; + /** + * Returns this Long with bits arithmetically shifted to the right by the given amount. + * @param numBits - Number of bits + * @returns Shifted Long + */ + Long.prototype.shiftRight = function (numBits) { + if (Long.isLong(numBits)) + numBits = numBits.toInt(); + if ((numBits &= 63) === 0) + return this; + else if (numBits < 32) + return Long.fromBits((this.low >>> numBits) | (this.high << (32 - numBits)), this.high >> numBits, this.unsigned); + else + return Long.fromBits(this.high >> (numBits - 32), this.high >= 0 ? 0 : -1, this.unsigned); + }; + /** This is an alias of {@link Long.shiftRight} */ + Long.prototype.shr = function (numBits) { + return this.shiftRight(numBits); + }; + /** + * Returns this Long with bits logically shifted to the right by the given amount. + * @param numBits - Number of bits + * @returns Shifted Long + */ + Long.prototype.shiftRightUnsigned = function (numBits) { + if (Long.isLong(numBits)) + numBits = numBits.toInt(); + numBits &= 63; + if (numBits === 0) + return this; + else { + var high = this.high; + if (numBits < 32) { + var low = this.low; + return Long.fromBits((low >>> numBits) | (high << (32 - numBits)), high >>> numBits, this.unsigned); + } + else if (numBits === 32) + return Long.fromBits(high, 0, this.unsigned); + else + return Long.fromBits(high >>> (numBits - 32), 0, this.unsigned); + } + }; + /** This is an alias of {@link Long.shiftRightUnsigned} */ + Long.prototype.shr_u = function (numBits) { + return this.shiftRightUnsigned(numBits); + }; + /** This is an alias of {@link Long.shiftRightUnsigned} */ + Long.prototype.shru = function (numBits) { + return this.shiftRightUnsigned(numBits); + }; + /** + * Returns the difference of this and the specified Long. + * @param subtrahend - Subtrahend + * @returns Difference + */ + Long.prototype.subtract = function (subtrahend) { + if (!Long.isLong(subtrahend)) + subtrahend = Long.fromValue(subtrahend); + return this.add(subtrahend.neg()); + }; + /** This is an alias of {@link Long.subtract} */ + Long.prototype.sub = function (subtrahend) { + return this.subtract(subtrahend); + }; + /** Converts the Long to a 32 bit integer, assuming it is a 32 bit integer. */ + Long.prototype.toInt = function () { + return this.unsigned ? this.low >>> 0 : this.low; + }; + /** Converts the Long to a the nearest floating-point representation of this value (double, 53 bit mantissa). */ + Long.prototype.toNumber = function () { + if (this.unsigned) + return (this.high >>> 0) * TWO_PWR_32_DBL + (this.low >>> 0); + return this.high * TWO_PWR_32_DBL + (this.low >>> 0); + }; + /** Converts the Long to a BigInt (arbitrary precision). */ + Long.prototype.toBigInt = function () { + return BigInt(this.toString()); + }; + /** + * Converts this Long to its byte representation. + * @param le - Whether little or big endian, defaults to big endian + * @returns Byte representation + */ + Long.prototype.toBytes = function (le) { + return le ? this.toBytesLE() : this.toBytesBE(); + }; + /** + * Converts this Long to its little endian byte representation. + * @returns Little endian byte representation + */ + Long.prototype.toBytesLE = function () { + var hi = this.high, lo = this.low; + return [ + lo & 0xff, + (lo >>> 8) & 0xff, + (lo >>> 16) & 0xff, + lo >>> 24, + hi & 0xff, + (hi >>> 8) & 0xff, + (hi >>> 16) & 0xff, + hi >>> 24 + ]; + }; + /** + * Converts this Long to its big endian byte representation. + * @returns Big endian byte representation + */ + Long.prototype.toBytesBE = function () { + var hi = this.high, lo = this.low; + return [ + hi >>> 24, + (hi >>> 16) & 0xff, + (hi >>> 8) & 0xff, + hi & 0xff, + lo >>> 24, + (lo >>> 16) & 0xff, + (lo >>> 8) & 0xff, + lo & 0xff + ]; + }; + /** + * Converts this Long to signed. + */ + Long.prototype.toSigned = function () { + if (!this.unsigned) + return this; + return Long.fromBits(this.low, this.high, false); + }; + /** + * Converts the Long to a string written in the specified radix. + * @param radix - Radix (2-36), defaults to 10 + * @throws RangeError If `radix` is out of range + */ + Long.prototype.toString = function (radix) { + radix = radix || 10; + if (radix < 2 || 36 < radix) + throw RangeError('radix'); + if (this.isZero()) + return '0'; + if (this.isNegative()) { + // Unsigned Longs are never negative + if (this.eq(Long.MIN_VALUE)) { + // We need to change the Long value before it can be negated, so we remove + // the bottom-most digit in this base and then recurse to do the rest. + var radixLong = Long.fromNumber(radix), div = this.div(radixLong), rem1 = div.mul(radixLong).sub(this); + return div.toString(radix) + rem1.toInt().toString(radix); + } + else + return '-' + this.neg().toString(radix); + } + // Do several (6) digits each time through the loop, so as to + // minimize the calls to the very expensive emulated div. + var radixToPower = Long.fromNumber(Math.pow(radix, 6), this.unsigned); + // eslint-disable-next-line @typescript-eslint/no-this-alias + var rem = this; + var result = ''; + // eslint-disable-next-line no-constant-condition + while (true) { + var remDiv = rem.div(radixToPower); + var intval = rem.sub(remDiv.mul(radixToPower)).toInt() >>> 0; + var digits = intval.toString(radix); + rem = remDiv; + if (rem.isZero()) { + return digits + result; + } + else { + while (digits.length < 6) + digits = '0' + digits; + result = '' + digits + result; + } + } + }; + /** Converts this Long to unsigned. */ + Long.prototype.toUnsigned = function () { + if (this.unsigned) + return this; + return Long.fromBits(this.low, this.high, true); + }; + /** Returns the bitwise XOR of this Long and the given one. */ + Long.prototype.xor = function (other) { + if (!Long.isLong(other)) + other = Long.fromValue(other); + return Long.fromBits(this.low ^ other.low, this.high ^ other.high, this.unsigned); + }; + /** This is an alias of {@link Long.isZero} */ + Long.prototype.eqz = function () { + return this.isZero(); + }; + /** This is an alias of {@link Long.lessThanOrEqual} */ + Long.prototype.le = function (other) { + return this.lessThanOrEqual(other); + }; + /* + **************************************************************** + * BSON SPECIFIC ADDITIONS * + **************************************************************** + */ + Long.prototype.toExtendedJSON = function (options) { + if (options && options.relaxed) + return this.toNumber(); + return { $numberLong: this.toString() }; + }; + Long.fromExtendedJSON = function (doc, options) { + var result = Long.fromString(doc.$numberLong); + return options && options.relaxed ? result.toNumber() : result; + }; + /** @internal */ + Long.prototype[Symbol.for('nodejs.util.inspect.custom')] = function () { + return this.inspect(); + }; + Long.prototype.inspect = function () { + return "new Long(\"" + this.toString() + "\"" + (this.unsigned ? ', true' : '') + ")"; + }; + Long.TWO_PWR_24 = Long.fromInt(TWO_PWR_24_DBL); + /** Maximum unsigned value. */ + Long.MAX_UNSIGNED_VALUE = Long.fromBits(0xffffffff | 0, 0xffffffff | 0, true); + /** Signed zero */ + Long.ZERO = Long.fromInt(0); + /** Unsigned zero. */ + Long.UZERO = Long.fromInt(0, true); + /** Signed one. */ + Long.ONE = Long.fromInt(1); + /** Unsigned one. */ + Long.UONE = Long.fromInt(1, true); + /** Signed negative one. */ + Long.NEG_ONE = Long.fromInt(-1); + /** Maximum signed value. */ + Long.MAX_VALUE = Long.fromBits(0xffffffff | 0, 0x7fffffff | 0, false); + /** Minimum signed value. */ + Long.MIN_VALUE = Long.fromBits(0, 0x80000000 | 0, false); + return Long; + }()); + Object.defineProperty(Long.prototype, '__isLong__', { value: true }); + Object.defineProperty(Long.prototype, '_bsontype', { value: 'Long' }); + + var PARSE_STRING_REGEXP = /^(\+|-)?(\d+|(\d*\.\d*))?(E|e)?([-+])?(\d+)?$/; + var PARSE_INF_REGEXP = /^(\+|-)?(Infinity|inf)$/i; + var PARSE_NAN_REGEXP = /^(\+|-)?NaN$/i; + var EXPONENT_MAX = 6111; + var EXPONENT_MIN = -6176; + var EXPONENT_BIAS = 6176; + var MAX_DIGITS = 34; + // Nan value bits as 32 bit values (due to lack of longs) + var NAN_BUFFER = [ + 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + ].reverse(); + // Infinity value bits 32 bit values (due to lack of longs) + var INF_NEGATIVE_BUFFER = [ + 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + ].reverse(); + var INF_POSITIVE_BUFFER = [ + 0x78, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + ].reverse(); + var EXPONENT_REGEX = /^([-+])?(\d+)?$/; + // Extract least significant 5 bits + var COMBINATION_MASK = 0x1f; + // Extract least significant 14 bits + var EXPONENT_MASK = 0x3fff; + // Value of combination field for Inf + var COMBINATION_INFINITY = 30; + // Value of combination field for NaN + var COMBINATION_NAN = 31; + // Detect if the value is a digit + function isDigit(value) { + return !isNaN(parseInt(value, 10)); + } + // Divide two uint128 values + function divideu128(value) { + var DIVISOR = Long.fromNumber(1000 * 1000 * 1000); + var _rem = Long.fromNumber(0); + if (!value.parts[0] && !value.parts[1] && !value.parts[2] && !value.parts[3]) { + return { quotient: value, rem: _rem }; + } + for (var i = 0; i <= 3; i++) { + // Adjust remainder to match value of next dividend + _rem = _rem.shiftLeft(32); + // Add the divided to _rem + _rem = _rem.add(new Long(value.parts[i], 0)); + value.parts[i] = _rem.div(DIVISOR).low; + _rem = _rem.modulo(DIVISOR); + } + return { quotient: value, rem: _rem }; + } + // Multiply two Long values and return the 128 bit value + function multiply64x2(left, right) { + if (!left && !right) { + return { high: Long.fromNumber(0), low: Long.fromNumber(0) }; + } + var leftHigh = left.shiftRightUnsigned(32); + var leftLow = new Long(left.getLowBits(), 0); + var rightHigh = right.shiftRightUnsigned(32); + var rightLow = new Long(right.getLowBits(), 0); + var productHigh = leftHigh.multiply(rightHigh); + var productMid = leftHigh.multiply(rightLow); + var productMid2 = leftLow.multiply(rightHigh); + var productLow = leftLow.multiply(rightLow); + productHigh = productHigh.add(productMid.shiftRightUnsigned(32)); + productMid = new Long(productMid.getLowBits(), 0) + .add(productMid2) + .add(productLow.shiftRightUnsigned(32)); + productHigh = productHigh.add(productMid.shiftRightUnsigned(32)); + productLow = productMid.shiftLeft(32).add(new Long(productLow.getLowBits(), 0)); + // Return the 128 bit result + return { high: productHigh, low: productLow }; + } + function lessThan(left, right) { + // Make values unsigned + var uhleft = left.high >>> 0; + var uhright = right.high >>> 0; + // Compare high bits first + if (uhleft < uhright) { + return true; + } + else if (uhleft === uhright) { + var ulleft = left.low >>> 0; + var ulright = right.low >>> 0; + if (ulleft < ulright) + return true; + } + return false; + } + function invalidErr(string, message) { + throw new BSONTypeError("\"" + string + "\" is not a valid Decimal128 string - " + message); + } + /** + * A class representation of the BSON Decimal128 type. + * @public + * @category BSONType + */ + var Decimal128 = /** @class */ (function () { + /** + * @param bytes - a buffer containing the raw Decimal128 bytes in little endian order, + * or a string representation as returned by .toString() + */ + function Decimal128(bytes) { + if (!(this instanceof Decimal128)) + return new Decimal128(bytes); + if (typeof bytes === 'string') { + this.bytes = Decimal128.fromString(bytes).bytes; + } + else if (isUint8Array(bytes)) { + if (bytes.byteLength !== 16) { + throw new BSONTypeError('Decimal128 must take a Buffer of 16 bytes'); + } + this.bytes = bytes; + } + else { + throw new BSONTypeError('Decimal128 must take a Buffer or string'); + } + } + /** + * Create a Decimal128 instance from a string representation + * + * @param representation - a numeric string representation. + */ + Decimal128.fromString = function (representation) { + // Parse state tracking + var isNegative = false; + var sawRadix = false; + var foundNonZero = false; + // Total number of significant digits (no leading or trailing zero) + var significantDigits = 0; + // Total number of significand digits read + var nDigitsRead = 0; + // Total number of digits (no leading zeros) + var nDigits = 0; + // The number of the digits after radix + var radixPosition = 0; + // The index of the first non-zero in *str* + var firstNonZero = 0; + // Digits Array + var digits = [0]; + // The number of digits in digits + var nDigitsStored = 0; + // Insertion pointer for digits + var digitsInsert = 0; + // The index of the first non-zero digit + var firstDigit = 0; + // The index of the last digit + var lastDigit = 0; + // Exponent + var exponent = 0; + // loop index over array + var i = 0; + // The high 17 digits of the significand + var significandHigh = new Long(0, 0); + // The low 17 digits of the significand + var significandLow = new Long(0, 0); + // The biased exponent + var biasedExponent = 0; + // Read index + var index = 0; + // Naively prevent against REDOS attacks. + // TODO: implementing a custom parsing for this, or refactoring the regex would yield + // further gains. + if (representation.length >= 7000) { + throw new BSONTypeError('' + representation + ' not a valid Decimal128 string'); + } + // Results + var stringMatch = representation.match(PARSE_STRING_REGEXP); + var infMatch = representation.match(PARSE_INF_REGEXP); + var nanMatch = representation.match(PARSE_NAN_REGEXP); + // Validate the string + if ((!stringMatch && !infMatch && !nanMatch) || representation.length === 0) { + throw new BSONTypeError('' + representation + ' not a valid Decimal128 string'); + } + if (stringMatch) { + // full_match = stringMatch[0] + // sign = stringMatch[1] + var unsignedNumber = stringMatch[2]; + // stringMatch[3] is undefined if a whole number (ex "1", 12") + // but defined if a number w/ decimal in it (ex "1.0, 12.2") + var e = stringMatch[4]; + var expSign = stringMatch[5]; + var expNumber = stringMatch[6]; + // they provided e, but didn't give an exponent number. for ex "1e" + if (e && expNumber === undefined) + invalidErr(representation, 'missing exponent power'); + // they provided e, but didn't give a number before it. for ex "e1" + if (e && unsignedNumber === undefined) + invalidErr(representation, 'missing exponent base'); + if (e === undefined && (expSign || expNumber)) { + invalidErr(representation, 'missing e before exponent'); + } + } + // Get the negative or positive sign + if (representation[index] === '+' || representation[index] === '-') { + isNegative = representation[index++] === '-'; + } + // Check if user passed Infinity or NaN + if (!isDigit(representation[index]) && representation[index] !== '.') { + if (representation[index] === 'i' || representation[index] === 'I') { + return new Decimal128(buffer_1.from(isNegative ? INF_NEGATIVE_BUFFER : INF_POSITIVE_BUFFER)); + } + else if (representation[index] === 'N') { + return new Decimal128(buffer_1.from(NAN_BUFFER)); + } + } + // Read all the digits + while (isDigit(representation[index]) || representation[index] === '.') { + if (representation[index] === '.') { + if (sawRadix) + invalidErr(representation, 'contains multiple periods'); + sawRadix = true; + index = index + 1; + continue; + } + if (nDigitsStored < 34) { + if (representation[index] !== '0' || foundNonZero) { + if (!foundNonZero) { + firstNonZero = nDigitsRead; + } + foundNonZero = true; + // Only store 34 digits + digits[digitsInsert++] = parseInt(representation[index], 10); + nDigitsStored = nDigitsStored + 1; + } + } + if (foundNonZero) + nDigits = nDigits + 1; + if (sawRadix) + radixPosition = radixPosition + 1; + nDigitsRead = nDigitsRead + 1; + index = index + 1; + } + if (sawRadix && !nDigitsRead) + throw new BSONTypeError('' + representation + ' not a valid Decimal128 string'); + // Read exponent if exists + if (representation[index] === 'e' || representation[index] === 'E') { + // Read exponent digits + var match = representation.substr(++index).match(EXPONENT_REGEX); + // No digits read + if (!match || !match[2]) + return new Decimal128(buffer_1.from(NAN_BUFFER)); + // Get exponent + exponent = parseInt(match[0], 10); + // Adjust the index + index = index + match[0].length; + } + // Return not a number + if (representation[index]) + return new Decimal128(buffer_1.from(NAN_BUFFER)); + // Done reading input + // Find first non-zero digit in digits + firstDigit = 0; + if (!nDigitsStored) { + firstDigit = 0; + lastDigit = 0; + digits[0] = 0; + nDigits = 1; + nDigitsStored = 1; + significantDigits = 0; + } + else { + lastDigit = nDigitsStored - 1; + significantDigits = nDigits; + if (significantDigits !== 1) { + while (digits[firstNonZero + significantDigits - 1] === 0) { + significantDigits = significantDigits - 1; + } + } + } + // Normalization of exponent + // Correct exponent based on radix position, and shift significand as needed + // to represent user input + // Overflow prevention + if (exponent <= radixPosition && radixPosition - exponent > 1 << 14) { + exponent = EXPONENT_MIN; + } + else { + exponent = exponent - radixPosition; + } + // Attempt to normalize the exponent + while (exponent > EXPONENT_MAX) { + // Shift exponent to significand and decrease + lastDigit = lastDigit + 1; + if (lastDigit - firstDigit > MAX_DIGITS) { + // Check if we have a zero then just hard clamp, otherwise fail + var digitsString = digits.join(''); + if (digitsString.match(/^0+$/)) { + exponent = EXPONENT_MAX; + break; + } + invalidErr(representation, 'overflow'); + } + exponent = exponent - 1; + } + while (exponent < EXPONENT_MIN || nDigitsStored < nDigits) { + // Shift last digit. can only do this if < significant digits than # stored. + if (lastDigit === 0 && significantDigits < nDigitsStored) { + exponent = EXPONENT_MIN; + significantDigits = 0; + break; + } + if (nDigitsStored < nDigits) { + // adjust to match digits not stored + nDigits = nDigits - 1; + } + else { + // adjust to round + lastDigit = lastDigit - 1; + } + if (exponent < EXPONENT_MAX) { + exponent = exponent + 1; + } + else { + // Check if we have a zero then just hard clamp, otherwise fail + var digitsString = digits.join(''); + if (digitsString.match(/^0+$/)) { + exponent = EXPONENT_MAX; + break; + } + invalidErr(representation, 'overflow'); + } + } + // Round + // We've normalized the exponent, but might still need to round. + if (lastDigit - firstDigit + 1 < significantDigits) { + var endOfString = nDigitsRead; + // If we have seen a radix point, 'string' is 1 longer than we have + // documented with ndigits_read, so inc the position of the first nonzero + // digit and the position that digits are read to. + if (sawRadix) { + firstNonZero = firstNonZero + 1; + endOfString = endOfString + 1; + } + // if negative, we need to increment again to account for - sign at start. + if (isNegative) { + firstNonZero = firstNonZero + 1; + endOfString = endOfString + 1; + } + var roundDigit = parseInt(representation[firstNonZero + lastDigit + 1], 10); + var roundBit = 0; + if (roundDigit >= 5) { + roundBit = 1; + if (roundDigit === 5) { + roundBit = digits[lastDigit] % 2 === 1 ? 1 : 0; + for (i = firstNonZero + lastDigit + 2; i < endOfString; i++) { + if (parseInt(representation[i], 10)) { + roundBit = 1; + break; + } + } + } + } + if (roundBit) { + var dIdx = lastDigit; + for (; dIdx >= 0; dIdx--) { + if (++digits[dIdx] > 9) { + digits[dIdx] = 0; + // overflowed most significant digit + if (dIdx === 0) { + if (exponent < EXPONENT_MAX) { + exponent = exponent + 1; + digits[dIdx] = 1; + } + else { + return new Decimal128(buffer_1.from(isNegative ? INF_NEGATIVE_BUFFER : INF_POSITIVE_BUFFER)); + } + } + } + } + } + } + // Encode significand + // The high 17 digits of the significand + significandHigh = Long.fromNumber(0); + // The low 17 digits of the significand + significandLow = Long.fromNumber(0); + // read a zero + if (significantDigits === 0) { + significandHigh = Long.fromNumber(0); + significandLow = Long.fromNumber(0); + } + else if (lastDigit - firstDigit < 17) { + var dIdx = firstDigit; + significandLow = Long.fromNumber(digits[dIdx++]); + significandHigh = new Long(0, 0); + for (; dIdx <= lastDigit; dIdx++) { + significandLow = significandLow.multiply(Long.fromNumber(10)); + significandLow = significandLow.add(Long.fromNumber(digits[dIdx])); + } + } + else { + var dIdx = firstDigit; + significandHigh = Long.fromNumber(digits[dIdx++]); + for (; dIdx <= lastDigit - 17; dIdx++) { + significandHigh = significandHigh.multiply(Long.fromNumber(10)); + significandHigh = significandHigh.add(Long.fromNumber(digits[dIdx])); + } + significandLow = Long.fromNumber(digits[dIdx++]); + for (; dIdx <= lastDigit; dIdx++) { + significandLow = significandLow.multiply(Long.fromNumber(10)); + significandLow = significandLow.add(Long.fromNumber(digits[dIdx])); + } + } + var significand = multiply64x2(significandHigh, Long.fromString('100000000000000000')); + significand.low = significand.low.add(significandLow); + if (lessThan(significand.low, significandLow)) { + significand.high = significand.high.add(Long.fromNumber(1)); + } + // Biased exponent + biasedExponent = exponent + EXPONENT_BIAS; + var dec = { low: Long.fromNumber(0), high: Long.fromNumber(0) }; + // Encode combination, exponent, and significand. + if (significand.high.shiftRightUnsigned(49).and(Long.fromNumber(1)).equals(Long.fromNumber(1))) { + // Encode '11' into bits 1 to 3 + dec.high = dec.high.or(Long.fromNumber(0x3).shiftLeft(61)); + dec.high = dec.high.or(Long.fromNumber(biasedExponent).and(Long.fromNumber(0x3fff).shiftLeft(47))); + dec.high = dec.high.or(significand.high.and(Long.fromNumber(0x7fffffffffff))); + } + else { + dec.high = dec.high.or(Long.fromNumber(biasedExponent & 0x3fff).shiftLeft(49)); + dec.high = dec.high.or(significand.high.and(Long.fromNumber(0x1ffffffffffff))); + } + dec.low = significand.low; + // Encode sign + if (isNegative) { + dec.high = dec.high.or(Long.fromString('9223372036854775808')); + } + // Encode into a buffer + var buffer = buffer_1.alloc(16); + index = 0; + // Encode the low 64 bits of the decimal + // Encode low bits + buffer[index++] = dec.low.low & 0xff; + buffer[index++] = (dec.low.low >> 8) & 0xff; + buffer[index++] = (dec.low.low >> 16) & 0xff; + buffer[index++] = (dec.low.low >> 24) & 0xff; + // Encode high bits + buffer[index++] = dec.low.high & 0xff; + buffer[index++] = (dec.low.high >> 8) & 0xff; + buffer[index++] = (dec.low.high >> 16) & 0xff; + buffer[index++] = (dec.low.high >> 24) & 0xff; + // Encode the high 64 bits of the decimal + // Encode low bits + buffer[index++] = dec.high.low & 0xff; + buffer[index++] = (dec.high.low >> 8) & 0xff; + buffer[index++] = (dec.high.low >> 16) & 0xff; + buffer[index++] = (dec.high.low >> 24) & 0xff; + // Encode high bits + buffer[index++] = dec.high.high & 0xff; + buffer[index++] = (dec.high.high >> 8) & 0xff; + buffer[index++] = (dec.high.high >> 16) & 0xff; + buffer[index++] = (dec.high.high >> 24) & 0xff; + // Return the new Decimal128 + return new Decimal128(buffer); + }; + /** Create a string representation of the raw Decimal128 value */ + Decimal128.prototype.toString = function () { + // Note: bits in this routine are referred to starting at 0, + // from the sign bit, towards the coefficient. + // decoded biased exponent (14 bits) + var biased_exponent; + // the number of significand digits + var significand_digits = 0; + // the base-10 digits in the significand + var significand = new Array(36); + for (var i = 0; i < significand.length; i++) + significand[i] = 0; + // read pointer into significand + var index = 0; + // true if the number is zero + var is_zero = false; + // the most significant significand bits (50-46) + var significand_msb; + // temporary storage for significand decoding + var significand128 = { parts: [0, 0, 0, 0] }; + // indexing variables + var j, k; + // Output string + var string = []; + // Unpack index + index = 0; + // Buffer reference + var buffer = this.bytes; + // Unpack the low 64bits into a long + // bits 96 - 127 + var low = buffer[index++] | (buffer[index++] << 8) | (buffer[index++] << 16) | (buffer[index++] << 24); + // bits 64 - 95 + var midl = buffer[index++] | (buffer[index++] << 8) | (buffer[index++] << 16) | (buffer[index++] << 24); + // Unpack the high 64bits into a long + // bits 32 - 63 + var midh = buffer[index++] | (buffer[index++] << 8) | (buffer[index++] << 16) | (buffer[index++] << 24); + // bits 0 - 31 + var high = buffer[index++] | (buffer[index++] << 8) | (buffer[index++] << 16) | (buffer[index++] << 24); + // Unpack index + index = 0; + // Create the state of the decimal + var dec = { + low: new Long(low, midl), + high: new Long(midh, high) + }; + if (dec.high.lessThan(Long.ZERO)) { + string.push('-'); + } + // Decode combination field and exponent + // bits 1 - 5 + var combination = (high >> 26) & COMBINATION_MASK; + if (combination >> 3 === 3) { + // Check for 'special' values + if (combination === COMBINATION_INFINITY) { + return string.join('') + 'Infinity'; + } + else if (combination === COMBINATION_NAN) { + return 'NaN'; + } + else { + biased_exponent = (high >> 15) & EXPONENT_MASK; + significand_msb = 0x08 + ((high >> 14) & 0x01); + } + } + else { + significand_msb = (high >> 14) & 0x07; + biased_exponent = (high >> 17) & EXPONENT_MASK; + } + // unbiased exponent + var exponent = biased_exponent - EXPONENT_BIAS; + // Create string of significand digits + // Convert the 114-bit binary number represented by + // (significand_high, significand_low) to at most 34 decimal + // digits through modulo and division. + significand128.parts[0] = (high & 0x3fff) + ((significand_msb & 0xf) << 14); + significand128.parts[1] = midh; + significand128.parts[2] = midl; + significand128.parts[3] = low; + if (significand128.parts[0] === 0 && + significand128.parts[1] === 0 && + significand128.parts[2] === 0 && + significand128.parts[3] === 0) { + is_zero = true; + } + else { + for (k = 3; k >= 0; k--) { + var least_digits = 0; + // Perform the divide + var result = divideu128(significand128); + significand128 = result.quotient; + least_digits = result.rem.low; + // We now have the 9 least significant digits (in base 2). + // Convert and output to string. + if (!least_digits) + continue; + for (j = 8; j >= 0; j--) { + // significand[k * 9 + j] = Math.round(least_digits % 10); + significand[k * 9 + j] = least_digits % 10; + // least_digits = Math.round(least_digits / 10); + least_digits = Math.floor(least_digits / 10); + } + } + } + // Output format options: + // Scientific - [-]d.dddE(+/-)dd or [-]dE(+/-)dd + // Regular - ddd.ddd + if (is_zero) { + significand_digits = 1; + significand[index] = 0; + } + else { + significand_digits = 36; + while (!significand[index]) { + significand_digits = significand_digits - 1; + index = index + 1; + } + } + // the exponent if scientific notation is used + var scientific_exponent = significand_digits - 1 + exponent; + // The scientific exponent checks are dictated by the string conversion + // specification and are somewhat arbitrary cutoffs. + // + // We must check exponent > 0, because if this is the case, the number + // has trailing zeros. However, we *cannot* output these trailing zeros, + // because doing so would change the precision of the value, and would + // change stored data if the string converted number is round tripped. + if (scientific_exponent >= 34 || scientific_exponent <= -7 || exponent > 0) { + // Scientific format + // if there are too many significant digits, we should just be treating numbers + // as + or - 0 and using the non-scientific exponent (this is for the "invalid + // representation should be treated as 0/-0" spec cases in decimal128-1.json) + if (significand_digits > 34) { + string.push("" + 0); + if (exponent > 0) + string.push('E+' + exponent); + else if (exponent < 0) + string.push('E' + exponent); + return string.join(''); + } + string.push("" + significand[index++]); + significand_digits = significand_digits - 1; + if (significand_digits) { + string.push('.'); + } + for (var i = 0; i < significand_digits; i++) { + string.push("" + significand[index++]); + } + // Exponent + string.push('E'); + if (scientific_exponent > 0) { + string.push('+' + scientific_exponent); + } + else { + string.push("" + scientific_exponent); + } + } + else { + // Regular format with no decimal place + if (exponent >= 0) { + for (var i = 0; i < significand_digits; i++) { + string.push("" + significand[index++]); + } + } + else { + var radix_position = significand_digits + exponent; + // non-zero digits before radix + if (radix_position > 0) { + for (var i = 0; i < radix_position; i++) { + string.push("" + significand[index++]); + } + } + else { + string.push('0'); + } + string.push('.'); + // add leading zeros after radix + while (radix_position++ < 0) { + string.push('0'); + } + for (var i = 0; i < significand_digits - Math.max(radix_position - 1, 0); i++) { + string.push("" + significand[index++]); + } + } + } + return string.join(''); + }; + Decimal128.prototype.toJSON = function () { + return { $numberDecimal: this.toString() }; + }; + /** @internal */ + Decimal128.prototype.toExtendedJSON = function () { + return { $numberDecimal: this.toString() }; + }; + /** @internal */ + Decimal128.fromExtendedJSON = function (doc) { + return Decimal128.fromString(doc.$numberDecimal); + }; + /** @internal */ + Decimal128.prototype[Symbol.for('nodejs.util.inspect.custom')] = function () { + return this.inspect(); + }; + Decimal128.prototype.inspect = function () { + return "new Decimal128(\"" + this.toString() + "\")"; + }; + return Decimal128; + }()); + Object.defineProperty(Decimal128.prototype, '_bsontype', { value: 'Decimal128' }); + + /** + * A class representation of the BSON Double type. + * @public + * @category BSONType + */ + var Double = /** @class */ (function () { + /** + * Create a Double type + * + * @param value - the number we want to represent as a double. + */ + function Double(value) { + if (!(this instanceof Double)) + return new Double(value); + if (value instanceof Number) { + value = value.valueOf(); + } + this.value = +value; + } + /** + * Access the number value. + * + * @returns returns the wrapped double number. + */ + Double.prototype.valueOf = function () { + return this.value; + }; + Double.prototype.toJSON = function () { + return this.value; + }; + Double.prototype.toString = function (radix) { + return this.value.toString(radix); + }; + /** @internal */ + Double.prototype.toExtendedJSON = function (options) { + if (options && (options.legacy || (options.relaxed && isFinite(this.value)))) { + return this.value; + } + // NOTE: JavaScript has +0 and -0, apparently to model limit calculations. If a user + // explicitly provided `-0` then we need to ensure the sign makes it into the output + if (Object.is(Math.sign(this.value), -0)) { + return { $numberDouble: "-" + this.value.toFixed(1) }; + } + var $numberDouble; + if (Number.isInteger(this.value)) { + $numberDouble = this.value.toFixed(1); + if ($numberDouble.length >= 13) { + $numberDouble = this.value.toExponential(13).toUpperCase(); + } + } + else { + $numberDouble = this.value.toString(); + } + return { $numberDouble: $numberDouble }; + }; + /** @internal */ + Double.fromExtendedJSON = function (doc, options) { + var doubleValue = parseFloat(doc.$numberDouble); + return options && options.relaxed ? doubleValue : new Double(doubleValue); + }; + /** @internal */ + Double.prototype[Symbol.for('nodejs.util.inspect.custom')] = function () { + return this.inspect(); + }; + Double.prototype.inspect = function () { + var eJSON = this.toExtendedJSON(); + return "new Double(" + eJSON.$numberDouble + ")"; + }; + return Double; + }()); + Object.defineProperty(Double.prototype, '_bsontype', { value: 'Double' }); + + /** + * A class representation of a BSON Int32 type. + * @public + * @category BSONType + */ + var Int32 = /** @class */ (function () { + /** + * Create an Int32 type + * + * @param value - the number we want to represent as an int32. + */ + function Int32(value) { + if (!(this instanceof Int32)) + return new Int32(value); + if (value instanceof Number) { + value = value.valueOf(); + } + this.value = +value | 0; + } + /** + * Access the number value. + * + * @returns returns the wrapped int32 number. + */ + Int32.prototype.valueOf = function () { + return this.value; + }; + Int32.prototype.toString = function (radix) { + return this.value.toString(radix); + }; + Int32.prototype.toJSON = function () { + return this.value; + }; + /** @internal */ + Int32.prototype.toExtendedJSON = function (options) { + if (options && (options.relaxed || options.legacy)) + return this.value; + return { $numberInt: this.value.toString() }; + }; + /** @internal */ + Int32.fromExtendedJSON = function (doc, options) { + return options && options.relaxed ? parseInt(doc.$numberInt, 10) : new Int32(doc.$numberInt); + }; + /** @internal */ + Int32.prototype[Symbol.for('nodejs.util.inspect.custom')] = function () { + return this.inspect(); + }; + Int32.prototype.inspect = function () { + return "new Int32(" + this.valueOf() + ")"; + }; + return Int32; + }()); + Object.defineProperty(Int32.prototype, '_bsontype', { value: 'Int32' }); + + /** + * A class representation of the BSON MaxKey type. + * @public + * @category BSONType + */ + var MaxKey = /** @class */ (function () { + function MaxKey() { + if (!(this instanceof MaxKey)) + return new MaxKey(); + } + /** @internal */ + MaxKey.prototype.toExtendedJSON = function () { + return { $maxKey: 1 }; + }; + /** @internal */ + MaxKey.fromExtendedJSON = function () { + return new MaxKey(); + }; + /** @internal */ + MaxKey.prototype[Symbol.for('nodejs.util.inspect.custom')] = function () { + return this.inspect(); + }; + MaxKey.prototype.inspect = function () { + return 'new MaxKey()'; + }; + return MaxKey; + }()); + Object.defineProperty(MaxKey.prototype, '_bsontype', { value: 'MaxKey' }); + + /** + * A class representation of the BSON MinKey type. + * @public + * @category BSONType + */ + var MinKey = /** @class */ (function () { + function MinKey() { + if (!(this instanceof MinKey)) + return new MinKey(); + } + /** @internal */ + MinKey.prototype.toExtendedJSON = function () { + return { $minKey: 1 }; + }; + /** @internal */ + MinKey.fromExtendedJSON = function () { + return new MinKey(); + }; + /** @internal */ + MinKey.prototype[Symbol.for('nodejs.util.inspect.custom')] = function () { + return this.inspect(); + }; + MinKey.prototype.inspect = function () { + return 'new MinKey()'; + }; + return MinKey; + }()); + Object.defineProperty(MinKey.prototype, '_bsontype', { value: 'MinKey' }); + + // Regular expression that checks for hex value + var checkForHexRegExp = new RegExp('^[0-9a-fA-F]{24}$'); + // Unique sequence for the current process (initialized on first use) + var PROCESS_UNIQUE = null; + var kId = Symbol('id'); + /** + * A class representation of the BSON ObjectId type. + * @public + * @category BSONType + */ + var ObjectId = /** @class */ (function () { + /** + * Create an ObjectId type + * + * @param inputId - Can be a 24 character hex string, 12 byte binary Buffer, or a number. + */ + function ObjectId(inputId) { + if (!(this instanceof ObjectId)) + return new ObjectId(inputId); + // workingId is set based on type of input and whether valid id exists for the input + var workingId; + if (typeof inputId === 'object' && inputId && 'id' in inputId) { + if (typeof inputId.id !== 'string' && !ArrayBuffer.isView(inputId.id)) { + throw new BSONTypeError('Argument passed in must have an id that is of type string or Buffer'); + } + if ('toHexString' in inputId && typeof inputId.toHexString === 'function') { + workingId = buffer_1.from(inputId.toHexString(), 'hex'); + } + else { + workingId = inputId.id; + } + } + else { + workingId = inputId; + } + // the following cases use workingId to construct an ObjectId + if (workingId == null || typeof workingId === 'number') { + // The most common use case (blank id, new objectId instance) + // Generate a new id + this[kId] = ObjectId.generate(typeof workingId === 'number' ? workingId : undefined); + } + else if (ArrayBuffer.isView(workingId) && workingId.byteLength === 12) { + // If intstanceof matches we can escape calling ensure buffer in Node.js environments + this[kId] = workingId instanceof buffer_1 ? workingId : ensureBuffer(workingId); + } + else if (typeof workingId === 'string') { + if (workingId.length === 12) { + var bytes = buffer_1.from(workingId); + if (bytes.byteLength === 12) { + this[kId] = bytes; + } + else { + throw new BSONTypeError('Argument passed in must be a string of 12 bytes'); + } + } + else if (workingId.length === 24 && checkForHexRegExp.test(workingId)) { + this[kId] = buffer_1.from(workingId, 'hex'); + } + else { + throw new BSONTypeError('Argument passed in must be a string of 12 bytes or a string of 24 hex characters or an integer'); + } + } + else { + throw new BSONTypeError('Argument passed in does not match the accepted types'); + } + // If we are caching the hex string + if (ObjectId.cacheHexString) { + this.__id = this.id.toString('hex'); + } + } + Object.defineProperty(ObjectId.prototype, "id", { + /** + * The ObjectId bytes + * @readonly + */ + get: function () { + return this[kId]; + }, + set: function (value) { + this[kId] = value; + if (ObjectId.cacheHexString) { + this.__id = value.toString('hex'); + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(ObjectId.prototype, "generationTime", { + /** + * The generation time of this ObjectId instance + * @deprecated Please use getTimestamp / createFromTime which returns an int32 epoch + */ + get: function () { + return this.id.readInt32BE(0); + }, + set: function (value) { + // Encode time into first 4 bytes + this.id.writeUInt32BE(value, 0); + }, + enumerable: false, + configurable: true + }); + /** Returns the ObjectId id as a 24 character hex string representation */ + ObjectId.prototype.toHexString = function () { + if (ObjectId.cacheHexString && this.__id) { + return this.__id; + } + var hexString = this.id.toString('hex'); + if (ObjectId.cacheHexString && !this.__id) { + this.__id = hexString; + } + return hexString; + }; + /** + * Update the ObjectId index + * @privateRemarks + * Used in generating new ObjectId's on the driver + * @internal + */ + ObjectId.getInc = function () { + return (ObjectId.index = (ObjectId.index + 1) % 0xffffff); + }; + /** + * Generate a 12 byte id buffer used in ObjectId's + * + * @param time - pass in a second based timestamp. + */ + ObjectId.generate = function (time) { + if ('number' !== typeof time) { + time = Math.floor(Date.now() / 1000); + } + var inc = ObjectId.getInc(); + var buffer = buffer_1.alloc(12); + // 4-byte timestamp + buffer.writeUInt32BE(time, 0); + // set PROCESS_UNIQUE if yet not initialized + if (PROCESS_UNIQUE === null) { + PROCESS_UNIQUE = randomBytes(5); + } + // 5-byte process unique + buffer[4] = PROCESS_UNIQUE[0]; + buffer[5] = PROCESS_UNIQUE[1]; + buffer[6] = PROCESS_UNIQUE[2]; + buffer[7] = PROCESS_UNIQUE[3]; + buffer[8] = PROCESS_UNIQUE[4]; + // 3-byte counter + buffer[11] = inc & 0xff; + buffer[10] = (inc >> 8) & 0xff; + buffer[9] = (inc >> 16) & 0xff; + return buffer; + }; + /** + * Converts the id into a 24 character hex string for printing + * + * @param format - The Buffer toString format parameter. + */ + ObjectId.prototype.toString = function (format) { + // Is the id a buffer then use the buffer toString method to return the format + if (format) + return this.id.toString(format); + return this.toHexString(); + }; + /** Converts to its JSON the 24 character hex string representation. */ + ObjectId.prototype.toJSON = function () { + return this.toHexString(); + }; + /** + * Compares the equality of this ObjectId with `otherID`. + * + * @param otherId - ObjectId instance to compare against. + */ + ObjectId.prototype.equals = function (otherId) { + if (otherId === undefined || otherId === null) { + return false; + } + if (otherId instanceof ObjectId) { + return this[kId][11] === otherId[kId][11] && this[kId].equals(otherId[kId]); + } + if (typeof otherId === 'string' && + ObjectId.isValid(otherId) && + otherId.length === 12 && + isUint8Array(this.id)) { + return otherId === buffer_1.prototype.toString.call(this.id, 'latin1'); + } + if (typeof otherId === 'string' && ObjectId.isValid(otherId) && otherId.length === 24) { + return otherId.toLowerCase() === this.toHexString(); + } + if (typeof otherId === 'string' && ObjectId.isValid(otherId) && otherId.length === 12) { + return buffer_1.from(otherId).equals(this.id); + } + if (typeof otherId === 'object' && + 'toHexString' in otherId && + typeof otherId.toHexString === 'function') { + var otherIdString = otherId.toHexString(); + var thisIdString = this.toHexString().toLowerCase(); + return typeof otherIdString === 'string' && otherIdString.toLowerCase() === thisIdString; + } + return false; + }; + /** Returns the generation date (accurate up to the second) that this ID was generated. */ + ObjectId.prototype.getTimestamp = function () { + var timestamp = new Date(); + var time = this.id.readUInt32BE(0); + timestamp.setTime(Math.floor(time) * 1000); + return timestamp; + }; + /** @internal */ + ObjectId.createPk = function () { + return new ObjectId(); + }; + /** + * Creates an ObjectId from a second based number, with the rest of the ObjectId zeroed out. Used for comparisons or sorting the ObjectId. + * + * @param time - an integer number representing a number of seconds. + */ + ObjectId.createFromTime = function (time) { + var buffer = buffer_1.from([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]); + // Encode time into first 4 bytes + buffer.writeUInt32BE(time, 0); + // Return the new objectId + return new ObjectId(buffer); + }; + /** + * Creates an ObjectId from a hex string representation of an ObjectId. + * + * @param hexString - create a ObjectId from a passed in 24 character hexstring. + */ + ObjectId.createFromHexString = function (hexString) { + // Throw an error if it's not a valid setup + if (typeof hexString === 'undefined' || (hexString != null && hexString.length !== 24)) { + throw new BSONTypeError('Argument passed in must be a single String of 12 bytes or a string of 24 hex characters'); + } + return new ObjectId(buffer_1.from(hexString, 'hex')); + }; + /** + * Checks if a value is a valid bson ObjectId + * + * @param id - ObjectId instance to validate. + */ + ObjectId.isValid = function (id) { + if (id == null) + return false; + try { + new ObjectId(id); + return true; + } + catch (_a) { + return false; + } + }; + /** @internal */ + ObjectId.prototype.toExtendedJSON = function () { + if (this.toHexString) + return { $oid: this.toHexString() }; + return { $oid: this.toString('hex') }; + }; + /** @internal */ + ObjectId.fromExtendedJSON = function (doc) { + return new ObjectId(doc.$oid); + }; + /** + * Converts to a string representation of this Id. + * + * @returns return the 24 character hex string representation. + * @internal + */ + ObjectId.prototype[Symbol.for('nodejs.util.inspect.custom')] = function () { + return this.inspect(); + }; + ObjectId.prototype.inspect = function () { + return "new ObjectId(\"" + this.toHexString() + "\")"; + }; + /** @internal */ + ObjectId.index = Math.floor(Math.random() * 0xffffff); + return ObjectId; + }()); + // Deprecated methods + Object.defineProperty(ObjectId.prototype, 'generate', { + value: deprecate(function (time) { return ObjectId.generate(time); }, 'Please use the static `ObjectId.generate(time)` instead') + }); + Object.defineProperty(ObjectId.prototype, 'getInc', { + value: deprecate(function () { return ObjectId.getInc(); }, 'Please use the static `ObjectId.getInc()` instead') + }); + Object.defineProperty(ObjectId.prototype, 'get_inc', { + value: deprecate(function () { return ObjectId.getInc(); }, 'Please use the static `ObjectId.getInc()` instead') + }); + Object.defineProperty(ObjectId, 'get_inc', { + value: deprecate(function () { return ObjectId.getInc(); }, 'Please use the static `ObjectId.getInc()` instead') + }); + Object.defineProperty(ObjectId.prototype, '_bsontype', { value: 'ObjectID' }); + + function alphabetize(str) { + return str.split('').sort().join(''); + } + /** + * A class representation of the BSON RegExp type. + * @public + * @category BSONType + */ + var BSONRegExp = /** @class */ (function () { + /** + * @param pattern - The regular expression pattern to match + * @param options - The regular expression options + */ + function BSONRegExp(pattern, options) { + if (!(this instanceof BSONRegExp)) + return new BSONRegExp(pattern, options); + this.pattern = pattern; + this.options = alphabetize(options !== null && options !== void 0 ? options : ''); + if (this.pattern.indexOf('\x00') !== -1) { + throw new BSONError("BSON Regex patterns cannot contain null bytes, found: " + JSON.stringify(this.pattern)); + } + if (this.options.indexOf('\x00') !== -1) { + throw new BSONError("BSON Regex options cannot contain null bytes, found: " + JSON.stringify(this.options)); + } + // Validate options + for (var i = 0; i < this.options.length; i++) { + if (!(this.options[i] === 'i' || + this.options[i] === 'm' || + this.options[i] === 'x' || + this.options[i] === 'l' || + this.options[i] === 's' || + this.options[i] === 'u')) { + throw new BSONError("The regular expression option [" + this.options[i] + "] is not supported"); + } + } + } + BSONRegExp.parseOptions = function (options) { + return options ? options.split('').sort().join('') : ''; + }; + /** @internal */ + BSONRegExp.prototype.toExtendedJSON = function (options) { + options = options || {}; + if (options.legacy) { + return { $regex: this.pattern, $options: this.options }; + } + return { $regularExpression: { pattern: this.pattern, options: this.options } }; + }; + /** @internal */ + BSONRegExp.fromExtendedJSON = function (doc) { + if ('$regex' in doc) { + if (typeof doc.$regex !== 'string') { + // This is for $regex query operators that have extended json values. + if (doc.$regex._bsontype === 'BSONRegExp') { + return doc; + } + } + else { + return new BSONRegExp(doc.$regex, BSONRegExp.parseOptions(doc.$options)); + } + } + if ('$regularExpression' in doc) { + return new BSONRegExp(doc.$regularExpression.pattern, BSONRegExp.parseOptions(doc.$regularExpression.options)); + } + throw new BSONTypeError("Unexpected BSONRegExp EJSON object form: " + JSON.stringify(doc)); + }; + return BSONRegExp; + }()); + Object.defineProperty(BSONRegExp.prototype, '_bsontype', { value: 'BSONRegExp' }); + + /** + * A class representation of the BSON Symbol type. + * @public + * @category BSONType + */ + var BSONSymbol = /** @class */ (function () { + /** + * @param value - the string representing the symbol. + */ + function BSONSymbol(value) { + if (!(this instanceof BSONSymbol)) + return new BSONSymbol(value); + this.value = value; + } + /** Access the wrapped string value. */ + BSONSymbol.prototype.valueOf = function () { + return this.value; + }; + BSONSymbol.prototype.toString = function () { + return this.value; + }; + /** @internal */ + BSONSymbol.prototype.inspect = function () { + return "new BSONSymbol(\"" + this.value + "\")"; + }; + BSONSymbol.prototype.toJSON = function () { + return this.value; + }; + /** @internal */ + BSONSymbol.prototype.toExtendedJSON = function () { + return { $symbol: this.value }; + }; + /** @internal */ + BSONSymbol.fromExtendedJSON = function (doc) { + return new BSONSymbol(doc.$symbol); + }; + /** @internal */ + BSONSymbol.prototype[Symbol.for('nodejs.util.inspect.custom')] = function () { + return this.inspect(); + }; + return BSONSymbol; + }()); + Object.defineProperty(BSONSymbol.prototype, '_bsontype', { value: 'Symbol' }); + + /** @public */ + var LongWithoutOverridesClass = Long; + /** + * @public + * @category BSONType + * */ + var Timestamp = /** @class */ (function (_super) { + __extends(Timestamp, _super); + function Timestamp(low, high) { + var _this = this; + // eslint-disable-next-line @typescript-eslint/ban-ts-comment + ///@ts-expect-error + if (!(_this instanceof Timestamp)) + return new Timestamp(low, high); + if (Long.isLong(low)) { + _this = _super.call(this, low.low, low.high, true) || this; + } + else if (isObjectLike(low) && typeof low.t !== 'undefined' && typeof low.i !== 'undefined') { + _this = _super.call(this, low.i, low.t, true) || this; + } + else { + _this = _super.call(this, low, high, true) || this; + } + Object.defineProperty(_this, '_bsontype', { + value: 'Timestamp', + writable: false, + configurable: false, + enumerable: false + }); + return _this; + } + Timestamp.prototype.toJSON = function () { + return { + $timestamp: this.toString() + }; + }; + /** Returns a Timestamp represented by the given (32-bit) integer value. */ + Timestamp.fromInt = function (value) { + return new Timestamp(Long.fromInt(value, true)); + }; + /** Returns a Timestamp representing the given number value, provided that it is a finite number. Otherwise, zero is returned. */ + Timestamp.fromNumber = function (value) { + return new Timestamp(Long.fromNumber(value, true)); + }; + /** + * Returns a Timestamp for the given high and low bits. Each is assumed to use 32 bits. + * + * @param lowBits - the low 32-bits. + * @param highBits - the high 32-bits. + */ + Timestamp.fromBits = function (lowBits, highBits) { + return new Timestamp(lowBits, highBits); + }; + /** + * Returns a Timestamp from the given string, optionally using the given radix. + * + * @param str - the textual representation of the Timestamp. + * @param optRadix - the radix in which the text is written. + */ + Timestamp.fromString = function (str, optRadix) { + return new Timestamp(Long.fromString(str, true, optRadix)); + }; + /** @internal */ + Timestamp.prototype.toExtendedJSON = function () { + return { $timestamp: { t: this.high >>> 0, i: this.low >>> 0 } }; + }; + /** @internal */ + Timestamp.fromExtendedJSON = function (doc) { + return new Timestamp(doc.$timestamp); + }; + /** @internal */ + Timestamp.prototype[Symbol.for('nodejs.util.inspect.custom')] = function () { + return this.inspect(); + }; + Timestamp.prototype.inspect = function () { + return "new Timestamp({ t: " + this.getHighBits() + ", i: " + this.getLowBits() + " })"; + }; + Timestamp.MAX_VALUE = Long.MAX_UNSIGNED_VALUE; + return Timestamp; + }(LongWithoutOverridesClass)); + + function isBSONType(value) { + return (isObjectLike(value) && Reflect.has(value, '_bsontype') && typeof value._bsontype === 'string'); + } + // INT32 boundaries + var BSON_INT32_MAX$1 = 0x7fffffff; + var BSON_INT32_MIN$1 = -0x80000000; + // INT64 boundaries + var BSON_INT64_MAX$1 = 0x7fffffffffffffff; + var BSON_INT64_MIN$1 = -0x8000000000000000; + // all the types where we don't need to do any special processing and can just pass the EJSON + //straight to type.fromExtendedJSON + var keysToCodecs = { + $oid: ObjectId, + $binary: Binary, + $uuid: Binary, + $symbol: BSONSymbol, + $numberInt: Int32, + $numberDecimal: Decimal128, + $numberDouble: Double, + $numberLong: Long, + $minKey: MinKey, + $maxKey: MaxKey, + $regex: BSONRegExp, + $regularExpression: BSONRegExp, + $timestamp: Timestamp + }; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + function deserializeValue(value, options) { + if (options === void 0) { options = {}; } + if (typeof value === 'number') { + if (options.relaxed || options.legacy) { + return value; + } + // if it's an integer, should interpret as smallest BSON integer + // that can represent it exactly. (if out of range, interpret as double.) + if (Math.floor(value) === value) { + if (value >= BSON_INT32_MIN$1 && value <= BSON_INT32_MAX$1) + return new Int32(value); + if (value >= BSON_INT64_MIN$1 && value <= BSON_INT64_MAX$1) + return Long.fromNumber(value); + } + // If the number is a non-integer or out of integer range, should interpret as BSON Double. + return new Double(value); + } + // from here on out we're looking for bson types, so bail if its not an object + if (value == null || typeof value !== 'object') + return value; + // upgrade deprecated undefined to null + if (value.$undefined) + return null; + var keys = Object.keys(value).filter(function (k) { return k.startsWith('$') && value[k] != null; }); + for (var i = 0; i < keys.length; i++) { + var c = keysToCodecs[keys[i]]; + if (c) + return c.fromExtendedJSON(value, options); + } + if (value.$date != null) { + var d = value.$date; + var date = new Date(); + if (options.legacy) { + if (typeof d === 'number') + date.setTime(d); + else if (typeof d === 'string') + date.setTime(Date.parse(d)); + } + else { + if (typeof d === 'string') + date.setTime(Date.parse(d)); + else if (Long.isLong(d)) + date.setTime(d.toNumber()); + else if (typeof d === 'number' && options.relaxed) + date.setTime(d); + } + return date; + } + if (value.$code != null) { + var copy = Object.assign({}, value); + if (value.$scope) { + copy.$scope = deserializeValue(value.$scope); + } + return Code.fromExtendedJSON(value); + } + if (isDBRefLike(value) || value.$dbPointer) { + var v = value.$ref ? value : value.$dbPointer; + // we run into this in a "degenerate EJSON" case (with $id and $ref order flipped) + // because of the order JSON.parse goes through the document + if (v instanceof DBRef) + return v; + var dollarKeys = Object.keys(v).filter(function (k) { return k.startsWith('$'); }); + var valid_1 = true; + dollarKeys.forEach(function (k) { + if (['$ref', '$id', '$db'].indexOf(k) === -1) + valid_1 = false; + }); + // only make DBRef if $ keys are all valid + if (valid_1) + return DBRef.fromExtendedJSON(v); + } + return value; + } + // eslint-disable-next-line @typescript-eslint/no-explicit-any + function serializeArray(array, options) { + return array.map(function (v, index) { + options.seenObjects.push({ propertyName: "index " + index, obj: null }); + try { + return serializeValue(v, options); + } + finally { + options.seenObjects.pop(); + } + }); + } + function getISOString(date) { + var isoStr = date.toISOString(); + // we should only show milliseconds in timestamp if they're non-zero + return date.getUTCMilliseconds() !== 0 ? isoStr : isoStr.slice(0, -5) + 'Z'; + } + // eslint-disable-next-line @typescript-eslint/no-explicit-any + function serializeValue(value, options) { + if ((typeof value === 'object' || typeof value === 'function') && value !== null) { + var index = options.seenObjects.findIndex(function (entry) { return entry.obj === value; }); + if (index !== -1) { + var props = options.seenObjects.map(function (entry) { return entry.propertyName; }); + var leadingPart = props + .slice(0, index) + .map(function (prop) { return prop + " -> "; }) + .join(''); + var alreadySeen = props[index]; + var circularPart = ' -> ' + + props + .slice(index + 1, props.length - 1) + .map(function (prop) { return prop + " -> "; }) + .join(''); + var current = props[props.length - 1]; + var leadingSpace = ' '.repeat(leadingPart.length + alreadySeen.length / 2); + var dashes = '-'.repeat(circularPart.length + (alreadySeen.length + current.length) / 2 - 1); + throw new BSONTypeError('Converting circular structure to EJSON:\n' + + (" " + leadingPart + alreadySeen + circularPart + current + "\n") + + (" " + leadingSpace + "\\" + dashes + "/")); + } + options.seenObjects[options.seenObjects.length - 1].obj = value; + } + if (Array.isArray(value)) + return serializeArray(value, options); + if (value === undefined) + return null; + if (value instanceof Date || isDate(value)) { + var dateNum = value.getTime(), + // is it in year range 1970-9999? + inRange = dateNum > -1 && dateNum < 253402318800000; + if (options.legacy) { + return options.relaxed && inRange + ? { $date: value.getTime() } + : { $date: getISOString(value) }; + } + return options.relaxed && inRange + ? { $date: getISOString(value) } + : { $date: { $numberLong: value.getTime().toString() } }; + } + if (typeof value === 'number' && (!options.relaxed || !isFinite(value))) { + // it's an integer + if (Math.floor(value) === value) { + var int32Range = value >= BSON_INT32_MIN$1 && value <= BSON_INT32_MAX$1, int64Range = value >= BSON_INT64_MIN$1 && value <= BSON_INT64_MAX$1; + // interpret as being of the smallest BSON integer type that can represent the number exactly + if (int32Range) + return { $numberInt: value.toString() }; + if (int64Range) + return { $numberLong: value.toString() }; + } + return { $numberDouble: value.toString() }; + } + if (value instanceof RegExp || isRegExp(value)) { + var flags = value.flags; + if (flags === undefined) { + var match = value.toString().match(/[gimuy]*$/); + if (match) { + flags = match[0]; + } + } + var rx = new BSONRegExp(value.source, flags); + return rx.toExtendedJSON(options); + } + if (value != null && typeof value === 'object') + return serializeDocument(value, options); + return value; + } + var BSON_TYPE_MAPPINGS = { + Binary: function (o) { return new Binary(o.value(), o.sub_type); }, + Code: function (o) { return new Code(o.code, o.scope); }, + DBRef: function (o) { return new DBRef(o.collection || o.namespace, o.oid, o.db, o.fields); }, + Decimal128: function (o) { return new Decimal128(o.bytes); }, + Double: function (o) { return new Double(o.value); }, + Int32: function (o) { return new Int32(o.value); }, + Long: function (o) { + return Long.fromBits( + // underscore variants for 1.x backwards compatibility + o.low != null ? o.low : o.low_, o.low != null ? o.high : o.high_, o.low != null ? o.unsigned : o.unsigned_); + }, + MaxKey: function () { return new MaxKey(); }, + MinKey: function () { return new MinKey(); }, + ObjectID: function (o) { return new ObjectId(o); }, + ObjectId: function (o) { return new ObjectId(o); }, + BSONRegExp: function (o) { return new BSONRegExp(o.pattern, o.options); }, + Symbol: function (o) { return new BSONSymbol(o.value); }, + Timestamp: function (o) { return Timestamp.fromBits(o.low, o.high); } + }; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + function serializeDocument(doc, options) { + if (doc == null || typeof doc !== 'object') + throw new BSONError('not an object instance'); + var bsontype = doc._bsontype; + if (typeof bsontype === 'undefined') { + // It's a regular object. Recursively serialize its property values. + var _doc = {}; + for (var name in doc) { + options.seenObjects.push({ propertyName: name, obj: null }); + try { + _doc[name] = serializeValue(doc[name], options); + } + finally { + options.seenObjects.pop(); + } + } + return _doc; + } + else if (isBSONType(doc)) { + // the "document" is really just a BSON type object + // eslint-disable-next-line @typescript-eslint/no-explicit-any + var outDoc = doc; + if (typeof outDoc.toExtendedJSON !== 'function') { + // There's no EJSON serialization function on the object. It's probably an + // object created by a previous version of this library (or another library) + // that's duck-typing objects to look like they were generated by this library). + // Copy the object into this library's version of that type. + var mapper = BSON_TYPE_MAPPINGS[doc._bsontype]; + if (!mapper) { + throw new BSONTypeError('Unrecognized or invalid _bsontype: ' + doc._bsontype); + } + outDoc = mapper(outDoc); + } + // Two BSON types may have nested objects that may need to be serialized too + if (bsontype === 'Code' && outDoc.scope) { + outDoc = new Code(outDoc.code, serializeValue(outDoc.scope, options)); + } + else if (bsontype === 'DBRef' && outDoc.oid) { + outDoc = new DBRef(serializeValue(outDoc.collection, options), serializeValue(outDoc.oid, options), serializeValue(outDoc.db, options), serializeValue(outDoc.fields, options)); + } + return outDoc.toExtendedJSON(options); + } + else { + throw new BSONError('_bsontype must be a string, but was: ' + typeof bsontype); + } + } + /** + * EJSON parse / stringify API + * @public + */ + // the namespace here is used to emulate `export * as EJSON from '...'` + // which as of now (sept 2020) api-extractor does not support + // eslint-disable-next-line @typescript-eslint/no-namespace + exports.EJSON = void 0; + (function (EJSON) { + /** + * Parse an Extended JSON string, constructing the JavaScript value or object described by that + * string. + * + * @example + * ```js + * const { EJSON } = require('bson'); + * const text = '{ "int32": { "$numberInt": "10" } }'; + * + * // prints { int32: { [String: '10'] _bsontype: 'Int32', value: '10' } } + * console.log(EJSON.parse(text, { relaxed: false })); + * + * // prints { int32: 10 } + * console.log(EJSON.parse(text)); + * ``` + */ + function parse(text, options) { + var finalOptions = Object.assign({}, { relaxed: true, legacy: false }, options); + // relaxed implies not strict + if (typeof finalOptions.relaxed === 'boolean') + finalOptions.strict = !finalOptions.relaxed; + if (typeof finalOptions.strict === 'boolean') + finalOptions.relaxed = !finalOptions.strict; + return JSON.parse(text, function (key, value) { + if (key.indexOf('\x00') !== -1) { + throw new BSONError("BSON Document field names cannot contain null bytes, found: " + JSON.stringify(key)); + } + return deserializeValue(value, finalOptions); + }); + } + EJSON.parse = parse; + /** + * Converts a BSON document to an Extended JSON string, optionally replacing values if a replacer + * function is specified or optionally including only the specified properties if a replacer array + * is specified. + * + * @param value - The value to convert to extended JSON + * @param replacer - A function that alters the behavior of the stringification process, or an array of String and Number objects that serve as a whitelist for selecting/filtering the properties of the value object to be included in the JSON string. If this value is null or not provided, all properties of the object are included in the resulting JSON string + * @param space - A String or Number object that's used to insert white space into the output JSON string for readability purposes. + * @param options - Optional settings + * + * @example + * ```js + * const { EJSON } = require('bson'); + * const Int32 = require('mongodb').Int32; + * const doc = { int32: new Int32(10) }; + * + * // prints '{"int32":{"$numberInt":"10"}}' + * console.log(EJSON.stringify(doc, { relaxed: false })); + * + * // prints '{"int32":10}' + * console.log(EJSON.stringify(doc)); + * ``` + */ + function stringify(value, + // eslint-disable-next-line @typescript-eslint/no-explicit-any + replacer, space, options) { + if (space != null && typeof space === 'object') { + options = space; + space = 0; + } + if (replacer != null && typeof replacer === 'object' && !Array.isArray(replacer)) { + options = replacer; + replacer = undefined; + space = 0; + } + var serializeOptions = Object.assign({ relaxed: true, legacy: false }, options, { + seenObjects: [{ propertyName: '(root)', obj: null }] + }); + var doc = serializeValue(value, serializeOptions); + return JSON.stringify(doc, replacer, space); + } + EJSON.stringify = stringify; + /** + * Serializes an object to an Extended JSON string, and reparse it as a JavaScript object. + * + * @param value - The object to serialize + * @param options - Optional settings passed to the `stringify` function + */ + function serialize(value, options) { + options = options || {}; + return JSON.parse(stringify(value, options)); + } + EJSON.serialize = serialize; + /** + * Deserializes an Extended JSON object into a plain JavaScript object with native/BSON types + * + * @param ejson - The Extended JSON object to deserialize + * @param options - Optional settings passed to the parse method + */ + function deserialize(ejson, options) { + options = options || {}; + return parse(JSON.stringify(ejson), options); + } + EJSON.deserialize = deserialize; + })(exports.EJSON || (exports.EJSON = {})); + + /* eslint-disable @typescript-eslint/no-explicit-any */ + /** @public */ + exports.Map = void 0; + var bsonGlobal = getGlobal(); + if (bsonGlobal.Map) { + exports.Map = bsonGlobal.Map; + } + else { + // We will return a polyfill + exports.Map = /** @class */ (function () { + function Map(array) { + if (array === void 0) { array = []; } + this._keys = []; + this._values = {}; + for (var i = 0; i < array.length; i++) { + if (array[i] == null) + continue; // skip null and undefined + var entry = array[i]; + var key = entry[0]; + var value = entry[1]; + // Add the key to the list of keys in order + this._keys.push(key); + // Add the key and value to the values dictionary with a point + // to the location in the ordered keys list + this._values[key] = { v: value, i: this._keys.length - 1 }; + } + } + Map.prototype.clear = function () { + this._keys = []; + this._values = {}; + }; + Map.prototype.delete = function (key) { + var value = this._values[key]; + if (value == null) + return false; + // Delete entry + delete this._values[key]; + // Remove the key from the ordered keys list + this._keys.splice(value.i, 1); + return true; + }; + Map.prototype.entries = function () { + var _this = this; + var index = 0; + return { + next: function () { + var key = _this._keys[index++]; + return { + value: key !== undefined ? [key, _this._values[key].v] : undefined, + done: key !== undefined ? false : true + }; + } + }; + }; + Map.prototype.forEach = function (callback, self) { + self = self || this; + for (var i = 0; i < this._keys.length; i++) { + var key = this._keys[i]; + // Call the forEach callback + callback.call(self, this._values[key].v, key, self); + } + }; + Map.prototype.get = function (key) { + return this._values[key] ? this._values[key].v : undefined; + }; + Map.prototype.has = function (key) { + return this._values[key] != null; + }; + Map.prototype.keys = function () { + var _this = this; + var index = 0; + return { + next: function () { + var key = _this._keys[index++]; + return { + value: key !== undefined ? key : undefined, + done: key !== undefined ? false : true + }; + } + }; + }; + Map.prototype.set = function (key, value) { + if (this._values[key]) { + this._values[key].v = value; + return this; + } + // Add the key to the list of keys in order + this._keys.push(key); + // Add the key and value to the values dictionary with a point + // to the location in the ordered keys list + this._values[key] = { v: value, i: this._keys.length - 1 }; + return this; + }; + Map.prototype.values = function () { + var _this = this; + var index = 0; + return { + next: function () { + var key = _this._keys[index++]; + return { + value: key !== undefined ? _this._values[key].v : undefined, + done: key !== undefined ? false : true + }; + } + }; + }; + Object.defineProperty(Map.prototype, "size", { + get: function () { + return this._keys.length; + }, + enumerable: false, + configurable: true + }); + return Map; + }()); + } + + /** @internal */ + var BSON_INT32_MAX = 0x7fffffff; + /** @internal */ + var BSON_INT32_MIN = -0x80000000; + /** @internal */ + var BSON_INT64_MAX = Math.pow(2, 63) - 1; + /** @internal */ + var BSON_INT64_MIN = -Math.pow(2, 63); + /** + * Any integer up to 2^53 can be precisely represented by a double. + * @internal + */ + var JS_INT_MAX = Math.pow(2, 53); + /** + * Any integer down to -2^53 can be precisely represented by a double. + * @internal + */ + var JS_INT_MIN = -Math.pow(2, 53); + /** Number BSON Type @internal */ + var BSON_DATA_NUMBER = 1; + /** String BSON Type @internal */ + var BSON_DATA_STRING = 2; + /** Object BSON Type @internal */ + var BSON_DATA_OBJECT = 3; + /** Array BSON Type @internal */ + var BSON_DATA_ARRAY = 4; + /** Binary BSON Type @internal */ + var BSON_DATA_BINARY = 5; + /** Binary BSON Type @internal */ + var BSON_DATA_UNDEFINED = 6; + /** ObjectId BSON Type @internal */ + var BSON_DATA_OID = 7; + /** Boolean BSON Type @internal */ + var BSON_DATA_BOOLEAN = 8; + /** Date BSON Type @internal */ + var BSON_DATA_DATE = 9; + /** null BSON Type @internal */ + var BSON_DATA_NULL = 10; + /** RegExp BSON Type @internal */ + var BSON_DATA_REGEXP = 11; + /** Code BSON Type @internal */ + var BSON_DATA_DBPOINTER = 12; + /** Code BSON Type @internal */ + var BSON_DATA_CODE = 13; + /** Symbol BSON Type @internal */ + var BSON_DATA_SYMBOL = 14; + /** Code with Scope BSON Type @internal */ + var BSON_DATA_CODE_W_SCOPE = 15; + /** 32 bit Integer BSON Type @internal */ + var BSON_DATA_INT = 16; + /** Timestamp BSON Type @internal */ + var BSON_DATA_TIMESTAMP = 17; + /** Long BSON Type @internal */ + var BSON_DATA_LONG = 18; + /** Decimal128 BSON Type @internal */ + var BSON_DATA_DECIMAL128 = 19; + /** MinKey BSON Type @internal */ + var BSON_DATA_MIN_KEY = 0xff; + /** MaxKey BSON Type @internal */ + var BSON_DATA_MAX_KEY = 0x7f; + /** Binary Default Type @internal */ + var BSON_BINARY_SUBTYPE_DEFAULT = 0; + /** Binary Function Type @internal */ + var BSON_BINARY_SUBTYPE_FUNCTION = 1; + /** Binary Byte Array Type @internal */ + var BSON_BINARY_SUBTYPE_BYTE_ARRAY = 2; + /** Binary Deprecated UUID Type @deprecated Please use BSON_BINARY_SUBTYPE_UUID_NEW @internal */ + var BSON_BINARY_SUBTYPE_UUID = 3; + /** Binary UUID Type @internal */ + var BSON_BINARY_SUBTYPE_UUID_NEW = 4; + /** Binary MD5 Type @internal */ + var BSON_BINARY_SUBTYPE_MD5 = 5; + /** Encrypted BSON type @internal */ + var BSON_BINARY_SUBTYPE_ENCRYPTED = 6; + /** Column BSON type @internal */ + var BSON_BINARY_SUBTYPE_COLUMN = 7; + /** Binary User Defined Type @internal */ + var BSON_BINARY_SUBTYPE_USER_DEFINED = 128; + + function calculateObjectSize$1(object, serializeFunctions, ignoreUndefined) { + var totalLength = 4 + 1; + if (Array.isArray(object)) { + for (var i = 0; i < object.length; i++) { + totalLength += calculateElement(i.toString(), object[i], serializeFunctions, true, ignoreUndefined); + } + } + else { + // If we have toBSON defined, override the current object + if (typeof (object === null || object === void 0 ? void 0 : object.toBSON) === 'function') { + object = object.toBSON(); + } + // Calculate size + for (var key in object) { + totalLength += calculateElement(key, object[key], serializeFunctions, false, ignoreUndefined); + } + } + return totalLength; + } + /** @internal */ + function calculateElement(name, + // eslint-disable-next-line @typescript-eslint/no-explicit-any + value, serializeFunctions, isArray, ignoreUndefined) { + if (serializeFunctions === void 0) { serializeFunctions = false; } + if (isArray === void 0) { isArray = false; } + if (ignoreUndefined === void 0) { ignoreUndefined = false; } + // If we have toBSON defined, override the current object + if (typeof (value === null || value === void 0 ? void 0 : value.toBSON) === 'function') { + value = value.toBSON(); + } + switch (typeof value) { + case 'string': + return 1 + buffer_1.byteLength(name, 'utf8') + 1 + 4 + buffer_1.byteLength(value, 'utf8') + 1; + case 'number': + if (Math.floor(value) === value && + value >= JS_INT_MIN && + value <= JS_INT_MAX) { + if (value >= BSON_INT32_MIN && value <= BSON_INT32_MAX) { + // 32 bit + return (name != null ? buffer_1.byteLength(name, 'utf8') + 1 : 0) + (4 + 1); + } + else { + return (name != null ? buffer_1.byteLength(name, 'utf8') + 1 : 0) + (8 + 1); + } + } + else { + // 64 bit + return (name != null ? buffer_1.byteLength(name, 'utf8') + 1 : 0) + (8 + 1); + } + case 'undefined': + if (isArray || !ignoreUndefined) + return (name != null ? buffer_1.byteLength(name, 'utf8') + 1 : 0) + 1; + return 0; + case 'boolean': + return (name != null ? buffer_1.byteLength(name, 'utf8') + 1 : 0) + (1 + 1); + case 'object': + if (value == null || value['_bsontype'] === 'MinKey' || value['_bsontype'] === 'MaxKey') { + return (name != null ? buffer_1.byteLength(name, 'utf8') + 1 : 0) + 1; + } + else if (value['_bsontype'] === 'ObjectId' || value['_bsontype'] === 'ObjectID') { + return (name != null ? buffer_1.byteLength(name, 'utf8') + 1 : 0) + (12 + 1); + } + else if (value instanceof Date || isDate(value)) { + return (name != null ? buffer_1.byteLength(name, 'utf8') + 1 : 0) + (8 + 1); + } + else if (ArrayBuffer.isView(value) || + value instanceof ArrayBuffer || + isAnyArrayBuffer(value)) { + return ((name != null ? buffer_1.byteLength(name, 'utf8') + 1 : 0) + (1 + 4 + 1) + value.byteLength); + } + else if (value['_bsontype'] === 'Long' || + value['_bsontype'] === 'Double' || + value['_bsontype'] === 'Timestamp') { + return (name != null ? buffer_1.byteLength(name, 'utf8') + 1 : 0) + (8 + 1); + } + else if (value['_bsontype'] === 'Decimal128') { + return (name != null ? buffer_1.byteLength(name, 'utf8') + 1 : 0) + (16 + 1); + } + else if (value['_bsontype'] === 'Code') { + // Calculate size depending on the availability of a scope + if (value.scope != null && Object.keys(value.scope).length > 0) { + return ((name != null ? buffer_1.byteLength(name, 'utf8') + 1 : 0) + + 1 + + 4 + + 4 + + buffer_1.byteLength(value.code.toString(), 'utf8') + + 1 + + calculateObjectSize$1(value.scope, serializeFunctions, ignoreUndefined)); + } + else { + return ((name != null ? buffer_1.byteLength(name, 'utf8') + 1 : 0) + + 1 + + 4 + + buffer_1.byteLength(value.code.toString(), 'utf8') + + 1); + } + } + else if (value['_bsontype'] === 'Binary') { + // Check what kind of subtype we have + if (value.sub_type === Binary.SUBTYPE_BYTE_ARRAY) { + return ((name != null ? buffer_1.byteLength(name, 'utf8') + 1 : 0) + + (value.position + 1 + 4 + 1 + 4)); + } + else { + return ((name != null ? buffer_1.byteLength(name, 'utf8') + 1 : 0) + (value.position + 1 + 4 + 1)); + } + } + else if (value['_bsontype'] === 'Symbol') { + return ((name != null ? buffer_1.byteLength(name, 'utf8') + 1 : 0) + + buffer_1.byteLength(value.value, 'utf8') + + 4 + + 1 + + 1); + } + else if (value['_bsontype'] === 'DBRef') { + // Set up correct object for serialization + var ordered_values = Object.assign({ + $ref: value.collection, + $id: value.oid + }, value.fields); + // Add db reference if it exists + if (value.db != null) { + ordered_values['$db'] = value.db; + } + return ((name != null ? buffer_1.byteLength(name, 'utf8') + 1 : 0) + + 1 + + calculateObjectSize$1(ordered_values, serializeFunctions, ignoreUndefined)); + } + else if (value instanceof RegExp || isRegExp(value)) { + return ((name != null ? buffer_1.byteLength(name, 'utf8') + 1 : 0) + + 1 + + buffer_1.byteLength(value.source, 'utf8') + + 1 + + (value.global ? 1 : 0) + + (value.ignoreCase ? 1 : 0) + + (value.multiline ? 1 : 0) + + 1); + } + else if (value['_bsontype'] === 'BSONRegExp') { + return ((name != null ? buffer_1.byteLength(name, 'utf8') + 1 : 0) + + 1 + + buffer_1.byteLength(value.pattern, 'utf8') + + 1 + + buffer_1.byteLength(value.options, 'utf8') + + 1); + } + else { + return ((name != null ? buffer_1.byteLength(name, 'utf8') + 1 : 0) + + calculateObjectSize$1(value, serializeFunctions, ignoreUndefined) + + 1); + } + case 'function': + // WTF for 0.4.X where typeof /someregexp/ === 'function' + if (value instanceof RegExp || isRegExp(value) || String.call(value) === '[object RegExp]') { + return ((name != null ? buffer_1.byteLength(name, 'utf8') + 1 : 0) + + 1 + + buffer_1.byteLength(value.source, 'utf8') + + 1 + + (value.global ? 1 : 0) + + (value.ignoreCase ? 1 : 0) + + (value.multiline ? 1 : 0) + + 1); + } + else { + if (serializeFunctions && value.scope != null && Object.keys(value.scope).length > 0) { + return ((name != null ? buffer_1.byteLength(name, 'utf8') + 1 : 0) + + 1 + + 4 + + 4 + + buffer_1.byteLength(normalizedFunctionString(value), 'utf8') + + 1 + + calculateObjectSize$1(value.scope, serializeFunctions, ignoreUndefined)); + } + else if (serializeFunctions) { + return ((name != null ? buffer_1.byteLength(name, 'utf8') + 1 : 0) + + 1 + + 4 + + buffer_1.byteLength(normalizedFunctionString(value), 'utf8') + + 1); + } + } + } + return 0; + } + + var FIRST_BIT = 0x80; + var FIRST_TWO_BITS = 0xc0; + var FIRST_THREE_BITS = 0xe0; + var FIRST_FOUR_BITS = 0xf0; + var FIRST_FIVE_BITS = 0xf8; + var TWO_BIT_CHAR = 0xc0; + var THREE_BIT_CHAR = 0xe0; + var FOUR_BIT_CHAR = 0xf0; + var CONTINUING_CHAR = 0x80; + /** + * Determines if the passed in bytes are valid utf8 + * @param bytes - An array of 8-bit bytes. Must be indexable and have length property + * @param start - The index to start validating + * @param end - The index to end validating + */ + function validateUtf8(bytes, start, end) { + var continuation = 0; + for (var i = start; i < end; i += 1) { + var byte = bytes[i]; + if (continuation) { + if ((byte & FIRST_TWO_BITS) !== CONTINUING_CHAR) { + return false; + } + continuation -= 1; + } + else if (byte & FIRST_BIT) { + if ((byte & FIRST_THREE_BITS) === TWO_BIT_CHAR) { + continuation = 1; + } + else if ((byte & FIRST_FOUR_BITS) === THREE_BIT_CHAR) { + continuation = 2; + } + else if ((byte & FIRST_FIVE_BITS) === FOUR_BIT_CHAR) { + continuation = 3; + } + else { + return false; + } + } + } + return !continuation; + } + + // Internal long versions + var JS_INT_MAX_LONG = Long.fromNumber(JS_INT_MAX); + var JS_INT_MIN_LONG = Long.fromNumber(JS_INT_MIN); + var functionCache = {}; + function deserialize$1(buffer, options, isArray) { + options = options == null ? {} : options; + var index = options && options.index ? options.index : 0; + // Read the document size + var size = buffer[index] | + (buffer[index + 1] << 8) | + (buffer[index + 2] << 16) | + (buffer[index + 3] << 24); + if (size < 5) { + throw new BSONError("bson size must be >= 5, is " + size); + } + if (options.allowObjectSmallerThanBufferSize && buffer.length < size) { + throw new BSONError("buffer length " + buffer.length + " must be >= bson size " + size); + } + if (!options.allowObjectSmallerThanBufferSize && buffer.length !== size) { + throw new BSONError("buffer length " + buffer.length + " must === bson size " + size); + } + if (size + index > buffer.byteLength) { + throw new BSONError("(bson size " + size + " + options.index " + index + " must be <= buffer length " + buffer.byteLength + ")"); + } + // Illegal end value + if (buffer[index + size - 1] !== 0) { + throw new BSONError("One object, sized correctly, with a spot for an EOO, but the EOO isn't 0x00"); + } + // Start deserializtion + return deserializeObject(buffer, index, options, isArray); + } + var allowedDBRefKeys = /^\$ref$|^\$id$|^\$db$/; + function deserializeObject(buffer, index, options, isArray) { + if (isArray === void 0) { isArray = false; } + var evalFunctions = options['evalFunctions'] == null ? false : options['evalFunctions']; + var cacheFunctions = options['cacheFunctions'] == null ? false : options['cacheFunctions']; + var fieldsAsRaw = options['fieldsAsRaw'] == null ? null : options['fieldsAsRaw']; + // Return raw bson buffer instead of parsing it + var raw = options['raw'] == null ? false : options['raw']; + // Return BSONRegExp objects instead of native regular expressions + var bsonRegExp = typeof options['bsonRegExp'] === 'boolean' ? options['bsonRegExp'] : false; + // Controls the promotion of values vs wrapper classes + var promoteBuffers = options['promoteBuffers'] == null ? false : options['promoteBuffers']; + var promoteLongs = options['promoteLongs'] == null ? true : options['promoteLongs']; + var promoteValues = options['promoteValues'] == null ? true : options['promoteValues']; + // Ensures default validation option if none given + var validation = options.validation == null ? { utf8: true } : options.validation; + // Shows if global utf-8 validation is enabled or disabled + var globalUTFValidation = true; + // Reflects utf-8 validation setting regardless of global or specific key validation + var validationSetting; + // Set of keys either to enable or disable validation on + var utf8KeysSet = new Set(); + // Check for boolean uniformity and empty validation option + var utf8ValidatedKeys = validation.utf8; + if (typeof utf8ValidatedKeys === 'boolean') { + validationSetting = utf8ValidatedKeys; + } + else { + globalUTFValidation = false; + var utf8ValidationValues = Object.keys(utf8ValidatedKeys).map(function (key) { + return utf8ValidatedKeys[key]; + }); + if (utf8ValidationValues.length === 0) { + throw new BSONError('UTF-8 validation setting cannot be empty'); + } + if (typeof utf8ValidationValues[0] !== 'boolean') { + throw new BSONError('Invalid UTF-8 validation option, must specify boolean values'); + } + validationSetting = utf8ValidationValues[0]; + // Ensures boolean uniformity in utf-8 validation (all true or all false) + if (!utf8ValidationValues.every(function (item) { return item === validationSetting; })) { + throw new BSONError('Invalid UTF-8 validation option - keys must be all true or all false'); + } + } + // Add keys to set that will either be validated or not based on validationSetting + if (!globalUTFValidation) { + for (var _i = 0, _a = Object.keys(utf8ValidatedKeys); _i < _a.length; _i++) { + var key = _a[_i]; + utf8KeysSet.add(key); + } + } + // Set the start index + var startIndex = index; + // Validate that we have at least 4 bytes of buffer + if (buffer.length < 5) + throw new BSONError('corrupt bson message < 5 bytes long'); + // Read the document size + var size = buffer[index++] | (buffer[index++] << 8) | (buffer[index++] << 16) | (buffer[index++] << 24); + // Ensure buffer is valid size + if (size < 5 || size > buffer.length) + throw new BSONError('corrupt bson message'); + // Create holding object + var object = isArray ? [] : {}; + // Used for arrays to skip having to perform utf8 decoding + var arrayIndex = 0; + var done = false; + var isPossibleDBRef = isArray ? false : null; + // While we have more left data left keep parsing + while (!done) { + // Read the type + var elementType = buffer[index++]; + // If we get a zero it's the last byte, exit + if (elementType === 0) + break; + // Get the start search index + var i = index; + // Locate the end of the c string + while (buffer[i] !== 0x00 && i < buffer.length) { + i++; + } + // If are at the end of the buffer there is a problem with the document + if (i >= buffer.byteLength) + throw new BSONError('Bad BSON Document: illegal CString'); + // Represents the key + var name = isArray ? arrayIndex++ : buffer.toString('utf8', index, i); + // shouldValidateKey is true if the key should be validated, false otherwise + var shouldValidateKey = true; + if (globalUTFValidation || utf8KeysSet.has(name)) { + shouldValidateKey = validationSetting; + } + else { + shouldValidateKey = !validationSetting; + } + if (isPossibleDBRef !== false && name[0] === '$') { + isPossibleDBRef = allowedDBRefKeys.test(name); + } + var value = void 0; + index = i + 1; + if (elementType === BSON_DATA_STRING) { + var stringSize = buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + if (stringSize <= 0 || + stringSize > buffer.length - index || + buffer[index + stringSize - 1] !== 0) { + throw new BSONError('bad string length in bson'); + } + value = getValidatedString(buffer, index, index + stringSize - 1, shouldValidateKey); + index = index + stringSize; + } + else if (elementType === BSON_DATA_OID) { + var oid = buffer_1.alloc(12); + buffer.copy(oid, 0, index, index + 12); + value = new ObjectId(oid); + index = index + 12; + } + else if (elementType === BSON_DATA_INT && promoteValues === false) { + value = new Int32(buffer[index++] | (buffer[index++] << 8) | (buffer[index++] << 16) | (buffer[index++] << 24)); + } + else if (elementType === BSON_DATA_INT) { + value = + buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + } + else if (elementType === BSON_DATA_NUMBER && promoteValues === false) { + value = new Double(buffer.readDoubleLE(index)); + index = index + 8; + } + else if (elementType === BSON_DATA_NUMBER) { + value = buffer.readDoubleLE(index); + index = index + 8; + } + else if (elementType === BSON_DATA_DATE) { + var lowBits = buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + var highBits = buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + value = new Date(new Long(lowBits, highBits).toNumber()); + } + else if (elementType === BSON_DATA_BOOLEAN) { + if (buffer[index] !== 0 && buffer[index] !== 1) + throw new BSONError('illegal boolean type value'); + value = buffer[index++] === 1; + } + else if (elementType === BSON_DATA_OBJECT) { + var _index = index; + var objectSize = buffer[index] | + (buffer[index + 1] << 8) | + (buffer[index + 2] << 16) | + (buffer[index + 3] << 24); + if (objectSize <= 0 || objectSize > buffer.length - index) + throw new BSONError('bad embedded document length in bson'); + // We have a raw value + if (raw) { + value = buffer.slice(index, index + objectSize); + } + else { + var objectOptions = options; + if (!globalUTFValidation) { + objectOptions = _assign(_assign({}, options), { validation: { utf8: shouldValidateKey } }); + } + value = deserializeObject(buffer, _index, objectOptions, false); + } + index = index + objectSize; + } + else if (elementType === BSON_DATA_ARRAY) { + var _index = index; + var objectSize = buffer[index] | + (buffer[index + 1] << 8) | + (buffer[index + 2] << 16) | + (buffer[index + 3] << 24); + var arrayOptions = options; + // Stop index + var stopIndex = index + objectSize; + // All elements of array to be returned as raw bson + if (fieldsAsRaw && fieldsAsRaw[name]) { + arrayOptions = {}; + for (var n in options) { + arrayOptions[n] = options[n]; + } + arrayOptions['raw'] = true; + } + if (!globalUTFValidation) { + arrayOptions = _assign(_assign({}, arrayOptions), { validation: { utf8: shouldValidateKey } }); + } + value = deserializeObject(buffer, _index, arrayOptions, true); + index = index + objectSize; + if (buffer[index - 1] !== 0) + throw new BSONError('invalid array terminator byte'); + if (index !== stopIndex) + throw new BSONError('corrupted array bson'); + } + else if (elementType === BSON_DATA_UNDEFINED) { + value = undefined; + } + else if (elementType === BSON_DATA_NULL) { + value = null; + } + else if (elementType === BSON_DATA_LONG) { + // Unpack the low and high bits + var lowBits = buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + var highBits = buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + var long = new Long(lowBits, highBits); + // Promote the long if possible + if (promoteLongs && promoteValues === true) { + value = + long.lessThanOrEqual(JS_INT_MAX_LONG) && long.greaterThanOrEqual(JS_INT_MIN_LONG) + ? long.toNumber() + : long; + } + else { + value = long; + } + } + else if (elementType === BSON_DATA_DECIMAL128) { + // Buffer to contain the decimal bytes + var bytes = buffer_1.alloc(16); + // Copy the next 16 bytes into the bytes buffer + buffer.copy(bytes, 0, index, index + 16); + // Update index + index = index + 16; + // Assign the new Decimal128 value + var decimal128 = new Decimal128(bytes); + // If we have an alternative mapper use that + if ('toObject' in decimal128 && typeof decimal128.toObject === 'function') { + value = decimal128.toObject(); + } + else { + value = decimal128; + } + } + else if (elementType === BSON_DATA_BINARY) { + var binarySize = buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + var totalBinarySize = binarySize; + var subType = buffer[index++]; + // Did we have a negative binary size, throw + if (binarySize < 0) + throw new BSONError('Negative binary type element size found'); + // Is the length longer than the document + if (binarySize > buffer.byteLength) + throw new BSONError('Binary type size larger than document size'); + // Decode as raw Buffer object if options specifies it + if (buffer['slice'] != null) { + // If we have subtype 2 skip the 4 bytes for the size + if (subType === Binary.SUBTYPE_BYTE_ARRAY) { + binarySize = + buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + if (binarySize < 0) + throw new BSONError('Negative binary type element size found for subtype 0x02'); + if (binarySize > totalBinarySize - 4) + throw new BSONError('Binary type with subtype 0x02 contains too long binary size'); + if (binarySize < totalBinarySize - 4) + throw new BSONError('Binary type with subtype 0x02 contains too short binary size'); + } + if (promoteBuffers && promoteValues) { + value = buffer.slice(index, index + binarySize); + } + else { + value = new Binary(buffer.slice(index, index + binarySize), subType); + } + } + else { + var _buffer = buffer_1.alloc(binarySize); + // If we have subtype 2 skip the 4 bytes for the size + if (subType === Binary.SUBTYPE_BYTE_ARRAY) { + binarySize = + buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + if (binarySize < 0) + throw new BSONError('Negative binary type element size found for subtype 0x02'); + if (binarySize > totalBinarySize - 4) + throw new BSONError('Binary type with subtype 0x02 contains too long binary size'); + if (binarySize < totalBinarySize - 4) + throw new BSONError('Binary type with subtype 0x02 contains too short binary size'); + } + // Copy the data + for (i = 0; i < binarySize; i++) { + _buffer[i] = buffer[index + i]; + } + if (promoteBuffers && promoteValues) { + value = _buffer; + } + else { + value = new Binary(_buffer, subType); + } + } + // Update the index + index = index + binarySize; + } + else if (elementType === BSON_DATA_REGEXP && bsonRegExp === false) { + // Get the start search index + i = index; + // Locate the end of the c string + while (buffer[i] !== 0x00 && i < buffer.length) { + i++; + } + // If are at the end of the buffer there is a problem with the document + if (i >= buffer.length) + throw new BSONError('Bad BSON Document: illegal CString'); + // Return the C string + var source = buffer.toString('utf8', index, i); + // Create the regexp + index = i + 1; + // Get the start search index + i = index; + // Locate the end of the c string + while (buffer[i] !== 0x00 && i < buffer.length) { + i++; + } + // If are at the end of the buffer there is a problem with the document + if (i >= buffer.length) + throw new BSONError('Bad BSON Document: illegal CString'); + // Return the C string + var regExpOptions = buffer.toString('utf8', index, i); + index = i + 1; + // For each option add the corresponding one for javascript + var optionsArray = new Array(regExpOptions.length); + // Parse options + for (i = 0; i < regExpOptions.length; i++) { + switch (regExpOptions[i]) { + case 'm': + optionsArray[i] = 'm'; + break; + case 's': + optionsArray[i] = 'g'; + break; + case 'i': + optionsArray[i] = 'i'; + break; + } + } + value = new RegExp(source, optionsArray.join('')); + } + else if (elementType === BSON_DATA_REGEXP && bsonRegExp === true) { + // Get the start search index + i = index; + // Locate the end of the c string + while (buffer[i] !== 0x00 && i < buffer.length) { + i++; + } + // If are at the end of the buffer there is a problem with the document + if (i >= buffer.length) + throw new BSONError('Bad BSON Document: illegal CString'); + // Return the C string + var source = buffer.toString('utf8', index, i); + index = i + 1; + // Get the start search index + i = index; + // Locate the end of the c string + while (buffer[i] !== 0x00 && i < buffer.length) { + i++; + } + // If are at the end of the buffer there is a problem with the document + if (i >= buffer.length) + throw new BSONError('Bad BSON Document: illegal CString'); + // Return the C string + var regExpOptions = buffer.toString('utf8', index, i); + index = i + 1; + // Set the object + value = new BSONRegExp(source, regExpOptions); + } + else if (elementType === BSON_DATA_SYMBOL) { + var stringSize = buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + if (stringSize <= 0 || + stringSize > buffer.length - index || + buffer[index + stringSize - 1] !== 0) { + throw new BSONError('bad string length in bson'); + } + var symbol = getValidatedString(buffer, index, index + stringSize - 1, shouldValidateKey); + value = promoteValues ? symbol : new BSONSymbol(symbol); + index = index + stringSize; + } + else if (elementType === BSON_DATA_TIMESTAMP) { + var lowBits = buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + var highBits = buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + value = new Timestamp(lowBits, highBits); + } + else if (elementType === BSON_DATA_MIN_KEY) { + value = new MinKey(); + } + else if (elementType === BSON_DATA_MAX_KEY) { + value = new MaxKey(); + } + else if (elementType === BSON_DATA_CODE) { + var stringSize = buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + if (stringSize <= 0 || + stringSize > buffer.length - index || + buffer[index + stringSize - 1] !== 0) { + throw new BSONError('bad string length in bson'); + } + var functionString = getValidatedString(buffer, index, index + stringSize - 1, shouldValidateKey); + // If we are evaluating the functions + if (evalFunctions) { + // If we have cache enabled let's look for the md5 of the function in the cache + if (cacheFunctions) { + // Got to do this to avoid V8 deoptimizing the call due to finding eval + value = isolateEval(functionString, functionCache, object); + } + else { + value = isolateEval(functionString); + } + } + else { + value = new Code(functionString); + } + // Update parse index position + index = index + stringSize; + } + else if (elementType === BSON_DATA_CODE_W_SCOPE) { + var totalSize = buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + // Element cannot be shorter than totalSize + stringSize + documentSize + terminator + if (totalSize < 4 + 4 + 4 + 1) { + throw new BSONError('code_w_scope total size shorter minimum expected length'); + } + // Get the code string size + var stringSize = buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + // Check if we have a valid string + if (stringSize <= 0 || + stringSize > buffer.length - index || + buffer[index + stringSize - 1] !== 0) { + throw new BSONError('bad string length in bson'); + } + // Javascript function + var functionString = getValidatedString(buffer, index, index + stringSize - 1, shouldValidateKey); + // Update parse index position + index = index + stringSize; + // Parse the element + var _index = index; + // Decode the size of the object document + var objectSize = buffer[index] | + (buffer[index + 1] << 8) | + (buffer[index + 2] << 16) | + (buffer[index + 3] << 24); + // Decode the scope object + var scopeObject = deserializeObject(buffer, _index, options, false); + // Adjust the index + index = index + objectSize; + // Check if field length is too short + if (totalSize < 4 + 4 + objectSize + stringSize) { + throw new BSONError('code_w_scope total size is too short, truncating scope'); + } + // Check if totalSize field is too long + if (totalSize > 4 + 4 + objectSize + stringSize) { + throw new BSONError('code_w_scope total size is too long, clips outer document'); + } + // If we are evaluating the functions + if (evalFunctions) { + // If we have cache enabled let's look for the md5 of the function in the cache + if (cacheFunctions) { + // Got to do this to avoid V8 deoptimizing the call due to finding eval + value = isolateEval(functionString, functionCache, object); + } + else { + value = isolateEval(functionString); + } + value.scope = scopeObject; + } + else { + value = new Code(functionString, scopeObject); + } + } + else if (elementType === BSON_DATA_DBPOINTER) { + // Get the code string size + var stringSize = buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + // Check if we have a valid string + if (stringSize <= 0 || + stringSize > buffer.length - index || + buffer[index + stringSize - 1] !== 0) + throw new BSONError('bad string length in bson'); + // Namespace + if (validation != null && validation.utf8) { + if (!validateUtf8(buffer, index, index + stringSize - 1)) { + throw new BSONError('Invalid UTF-8 string in BSON document'); + } + } + var namespace = buffer.toString('utf8', index, index + stringSize - 1); + // Update parse index position + index = index + stringSize; + // Read the oid + var oidBuffer = buffer_1.alloc(12); + buffer.copy(oidBuffer, 0, index, index + 12); + var oid = new ObjectId(oidBuffer); + // Update the index + index = index + 12; + // Upgrade to DBRef type + value = new DBRef(namespace, oid); + } + else { + throw new BSONError('Detected unknown BSON type ' + elementType.toString(16) + ' for fieldname "' + name + '"'); + } + if (name === '__proto__') { + Object.defineProperty(object, name, { + value: value, + writable: true, + enumerable: true, + configurable: true + }); + } + else { + object[name] = value; + } + } + // Check if the deserialization was against a valid array/object + if (size !== index - startIndex) { + if (isArray) + throw new BSONError('corrupt array bson'); + throw new BSONError('corrupt object bson'); + } + // if we did not find "$ref", "$id", "$db", or found an extraneous $key, don't make a DBRef + if (!isPossibleDBRef) + return object; + if (isDBRefLike(object)) { + var copy = Object.assign({}, object); + delete copy.$ref; + delete copy.$id; + delete copy.$db; + return new DBRef(object.$ref, object.$id, object.$db, copy); + } + return object; + } + /** + * Ensure eval is isolated, store the result in functionCache. + * + * @internal + */ + function isolateEval(functionString, functionCache, object) { + if (!functionCache) + return new Function(functionString); + // Check for cache hit, eval if missing and return cached function + if (functionCache[functionString] == null) { + functionCache[functionString] = new Function(functionString); + } + // Set the object + return functionCache[functionString].bind(object); + } + function getValidatedString(buffer, start, end, shouldValidateUtf8) { + var value = buffer.toString('utf8', start, end); + // if utf8 validation is on, do the check + if (shouldValidateUtf8) { + for (var i = 0; i < value.length; i++) { + if (value.charCodeAt(i) === 0xfffd) { + if (!validateUtf8(buffer, start, end)) { + throw new BSONError('Invalid UTF-8 string in BSON document'); + } + break; + } + } + } + return value; + } + + // Copyright (c) 2008, Fair Oaks Labs, Inc. + function writeIEEE754(buffer, value, offset, endian, mLen, nBytes) { + var e; + var m; + var c; + var bBE = endian === 'big'; + var eLen = nBytes * 8 - mLen - 1; + var eMax = (1 << eLen) - 1; + var eBias = eMax >> 1; + var rt = mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0; + var i = bBE ? nBytes - 1 : 0; + var d = bBE ? -1 : 1; + var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0; + value = Math.abs(value); + if (isNaN(value) || value === Infinity) { + m = isNaN(value) ? 1 : 0; + e = eMax; + } + else { + e = Math.floor(Math.log(value) / Math.LN2); + if (value * (c = Math.pow(2, -e)) < 1) { + e--; + c *= 2; + } + if (e + eBias >= 1) { + value += rt / c; + } + else { + value += rt * Math.pow(2, 1 - eBias); + } + if (value * c >= 2) { + e++; + c /= 2; + } + if (e + eBias >= eMax) { + m = 0; + e = eMax; + } + else if (e + eBias >= 1) { + m = (value * c - 1) * Math.pow(2, mLen); + e = e + eBias; + } + else { + m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen); + e = 0; + } + } + if (isNaN(value)) + m = 0; + while (mLen >= 8) { + buffer[offset + i] = m & 0xff; + i += d; + m /= 256; + mLen -= 8; + } + e = (e << mLen) | m; + if (isNaN(value)) + e += 8; + eLen += mLen; + while (eLen > 0) { + buffer[offset + i] = e & 0xff; + i += d; + e /= 256; + eLen -= 8; + } + buffer[offset + i - d] |= s * 128; + } + + var regexp = /\x00/; // eslint-disable-line no-control-regex + var ignoreKeys = new Set(['$db', '$ref', '$id', '$clusterTime']); + /* + * isArray indicates if we are writing to a BSON array (type 0x04) + * which forces the "key" which really an array index as a string to be written as ascii + * This will catch any errors in index as a string generation + */ + function serializeString(buffer, key, value, index, isArray) { + // Encode String type + buffer[index++] = BSON_DATA_STRING; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes + 1; + buffer[index - 1] = 0; + // Write the string + var size = buffer.write(value, index + 4, undefined, 'utf8'); + // Write the size of the string to buffer + buffer[index + 3] = ((size + 1) >> 24) & 0xff; + buffer[index + 2] = ((size + 1) >> 16) & 0xff; + buffer[index + 1] = ((size + 1) >> 8) & 0xff; + buffer[index] = (size + 1) & 0xff; + // Update index + index = index + 4 + size; + // Write zero + buffer[index++] = 0; + return index; + } + function serializeNumber(buffer, key, value, index, isArray) { + // We have an integer value + // TODO(NODE-2529): Add support for big int + if (Number.isInteger(value) && + value >= BSON_INT32_MIN && + value <= BSON_INT32_MAX) { + // If the value fits in 32 bits encode as int32 + // Set int type 32 bits or less + buffer[index++] = BSON_DATA_INT; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Write the int value + buffer[index++] = value & 0xff; + buffer[index++] = (value >> 8) & 0xff; + buffer[index++] = (value >> 16) & 0xff; + buffer[index++] = (value >> 24) & 0xff; + } + else { + // Encode as double + buffer[index++] = BSON_DATA_NUMBER; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Write float + writeIEEE754(buffer, value, index, 'little', 52, 8); + // Adjust index + index = index + 8; + } + return index; + } + function serializeNull(buffer, key, _, index, isArray) { + // Set long type + buffer[index++] = BSON_DATA_NULL; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + return index; + } + function serializeBoolean(buffer, key, value, index, isArray) { + // Write the type + buffer[index++] = BSON_DATA_BOOLEAN; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Encode the boolean value + buffer[index++] = value ? 1 : 0; + return index; + } + function serializeDate(buffer, key, value, index, isArray) { + // Write the type + buffer[index++] = BSON_DATA_DATE; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Write the date + var dateInMilis = Long.fromNumber(value.getTime()); + var lowBits = dateInMilis.getLowBits(); + var highBits = dateInMilis.getHighBits(); + // Encode low bits + buffer[index++] = lowBits & 0xff; + buffer[index++] = (lowBits >> 8) & 0xff; + buffer[index++] = (lowBits >> 16) & 0xff; + buffer[index++] = (lowBits >> 24) & 0xff; + // Encode high bits + buffer[index++] = highBits & 0xff; + buffer[index++] = (highBits >> 8) & 0xff; + buffer[index++] = (highBits >> 16) & 0xff; + buffer[index++] = (highBits >> 24) & 0xff; + return index; + } + function serializeRegExp(buffer, key, value, index, isArray) { + // Write the type + buffer[index++] = BSON_DATA_REGEXP; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + if (value.source && value.source.match(regexp) != null) { + throw Error('value ' + value.source + ' must not contain null bytes'); + } + // Adjust the index + index = index + buffer.write(value.source, index, undefined, 'utf8'); + // Write zero + buffer[index++] = 0x00; + // Write the parameters + if (value.ignoreCase) + buffer[index++] = 0x69; // i + if (value.global) + buffer[index++] = 0x73; // s + if (value.multiline) + buffer[index++] = 0x6d; // m + // Add ending zero + buffer[index++] = 0x00; + return index; + } + function serializeBSONRegExp(buffer, key, value, index, isArray) { + // Write the type + buffer[index++] = BSON_DATA_REGEXP; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Check the pattern for 0 bytes + if (value.pattern.match(regexp) != null) { + // The BSON spec doesn't allow keys with null bytes because keys are + // null-terminated. + throw Error('pattern ' + value.pattern + ' must not contain null bytes'); + } + // Adjust the index + index = index + buffer.write(value.pattern, index, undefined, 'utf8'); + // Write zero + buffer[index++] = 0x00; + // Write the options + index = index + buffer.write(value.options.split('').sort().join(''), index, undefined, 'utf8'); + // Add ending zero + buffer[index++] = 0x00; + return index; + } + function serializeMinMax(buffer, key, value, index, isArray) { + // Write the type of either min or max key + if (value === null) { + buffer[index++] = BSON_DATA_NULL; + } + else if (value._bsontype === 'MinKey') { + buffer[index++] = BSON_DATA_MIN_KEY; + } + else { + buffer[index++] = BSON_DATA_MAX_KEY; + } + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + return index; + } + function serializeObjectId(buffer, key, value, index, isArray) { + // Write the type + buffer[index++] = BSON_DATA_OID; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Write the objectId into the shared buffer + if (typeof value.id === 'string') { + buffer.write(value.id, index, undefined, 'binary'); + } + else if (isUint8Array(value.id)) { + // Use the standard JS methods here because buffer.copy() is buggy with the + // browser polyfill + buffer.set(value.id.subarray(0, 12), index); + } + else { + throw new BSONTypeError('object [' + JSON.stringify(value) + '] is not a valid ObjectId'); + } + // Adjust index + return index + 12; + } + function serializeBuffer(buffer, key, value, index, isArray) { + // Write the type + buffer[index++] = BSON_DATA_BINARY; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Get size of the buffer (current write point) + var size = value.length; + // Write the size of the string to buffer + buffer[index++] = size & 0xff; + buffer[index++] = (size >> 8) & 0xff; + buffer[index++] = (size >> 16) & 0xff; + buffer[index++] = (size >> 24) & 0xff; + // Write the default subtype + buffer[index++] = BSON_BINARY_SUBTYPE_DEFAULT; + // Copy the content form the binary field to the buffer + buffer.set(ensureBuffer(value), index); + // Adjust the index + index = index + size; + return index; + } + function serializeObject(buffer, key, value, index, checkKeys, depth, serializeFunctions, ignoreUndefined, isArray, path) { + if (checkKeys === void 0) { checkKeys = false; } + if (depth === void 0) { depth = 0; } + if (serializeFunctions === void 0) { serializeFunctions = false; } + if (ignoreUndefined === void 0) { ignoreUndefined = true; } + if (isArray === void 0) { isArray = false; } + if (path === void 0) { path = []; } + for (var i = 0; i < path.length; i++) { + if (path[i] === value) + throw new BSONError('cyclic dependency detected'); + } + // Push value to stack + path.push(value); + // Write the type + buffer[index++] = Array.isArray(value) ? BSON_DATA_ARRAY : BSON_DATA_OBJECT; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + var endIndex = serializeInto(buffer, value, checkKeys, index, depth + 1, serializeFunctions, ignoreUndefined, path); + // Pop stack + path.pop(); + return endIndex; + } + function serializeDecimal128(buffer, key, value, index, isArray) { + buffer[index++] = BSON_DATA_DECIMAL128; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Write the data from the value + // Prefer the standard JS methods because their typechecking is not buggy, + // unlike the `buffer` polyfill's. + buffer.set(value.bytes.subarray(0, 16), index); + return index + 16; + } + function serializeLong(buffer, key, value, index, isArray) { + // Write the type + buffer[index++] = + value._bsontype === 'Long' ? BSON_DATA_LONG : BSON_DATA_TIMESTAMP; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Write the date + var lowBits = value.getLowBits(); + var highBits = value.getHighBits(); + // Encode low bits + buffer[index++] = lowBits & 0xff; + buffer[index++] = (lowBits >> 8) & 0xff; + buffer[index++] = (lowBits >> 16) & 0xff; + buffer[index++] = (lowBits >> 24) & 0xff; + // Encode high bits + buffer[index++] = highBits & 0xff; + buffer[index++] = (highBits >> 8) & 0xff; + buffer[index++] = (highBits >> 16) & 0xff; + buffer[index++] = (highBits >> 24) & 0xff; + return index; + } + function serializeInt32(buffer, key, value, index, isArray) { + value = value.valueOf(); + // Set int type 32 bits or less + buffer[index++] = BSON_DATA_INT; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Write the int value + buffer[index++] = value & 0xff; + buffer[index++] = (value >> 8) & 0xff; + buffer[index++] = (value >> 16) & 0xff; + buffer[index++] = (value >> 24) & 0xff; + return index; + } + function serializeDouble(buffer, key, value, index, isArray) { + // Encode as double + buffer[index++] = BSON_DATA_NUMBER; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Write float + writeIEEE754(buffer, value.value, index, 'little', 52, 8); + // Adjust index + index = index + 8; + return index; + } + function serializeFunction(buffer, key, value, index, _checkKeys, _depth, isArray) { + buffer[index++] = BSON_DATA_CODE; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Function string + var functionString = normalizedFunctionString(value); + // Write the string + var size = buffer.write(functionString, index + 4, undefined, 'utf8') + 1; + // Write the size of the string to buffer + buffer[index] = size & 0xff; + buffer[index + 1] = (size >> 8) & 0xff; + buffer[index + 2] = (size >> 16) & 0xff; + buffer[index + 3] = (size >> 24) & 0xff; + // Update index + index = index + 4 + size - 1; + // Write zero + buffer[index++] = 0; + return index; + } + function serializeCode(buffer, key, value, index, checkKeys, depth, serializeFunctions, ignoreUndefined, isArray) { + if (checkKeys === void 0) { checkKeys = false; } + if (depth === void 0) { depth = 0; } + if (serializeFunctions === void 0) { serializeFunctions = false; } + if (ignoreUndefined === void 0) { ignoreUndefined = true; } + if (isArray === void 0) { isArray = false; } + if (value.scope && typeof value.scope === 'object') { + // Write the type + buffer[index++] = BSON_DATA_CODE_W_SCOPE; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Starting index + var startIndex = index; + // Serialize the function + // Get the function string + var functionString = typeof value.code === 'string' ? value.code : value.code.toString(); + // Index adjustment + index = index + 4; + // Write string into buffer + var codeSize = buffer.write(functionString, index + 4, undefined, 'utf8') + 1; + // Write the size of the string to buffer + buffer[index] = codeSize & 0xff; + buffer[index + 1] = (codeSize >> 8) & 0xff; + buffer[index + 2] = (codeSize >> 16) & 0xff; + buffer[index + 3] = (codeSize >> 24) & 0xff; + // Write end 0 + buffer[index + 4 + codeSize - 1] = 0; + // Write the + index = index + codeSize + 4; + // + // Serialize the scope value + var endIndex = serializeInto(buffer, value.scope, checkKeys, index, depth + 1, serializeFunctions, ignoreUndefined); + index = endIndex - 1; + // Writ the total + var totalSize = endIndex - startIndex; + // Write the total size of the object + buffer[startIndex++] = totalSize & 0xff; + buffer[startIndex++] = (totalSize >> 8) & 0xff; + buffer[startIndex++] = (totalSize >> 16) & 0xff; + buffer[startIndex++] = (totalSize >> 24) & 0xff; + // Write trailing zero + buffer[index++] = 0; + } + else { + buffer[index++] = BSON_DATA_CODE; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Function string + var functionString = value.code.toString(); + // Write the string + var size = buffer.write(functionString, index + 4, undefined, 'utf8') + 1; + // Write the size of the string to buffer + buffer[index] = size & 0xff; + buffer[index + 1] = (size >> 8) & 0xff; + buffer[index + 2] = (size >> 16) & 0xff; + buffer[index + 3] = (size >> 24) & 0xff; + // Update index + index = index + 4 + size - 1; + // Write zero + buffer[index++] = 0; + } + return index; + } + function serializeBinary(buffer, key, value, index, isArray) { + // Write the type + buffer[index++] = BSON_DATA_BINARY; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Extract the buffer + var data = value.value(true); + // Calculate size + var size = value.position; + // Add the deprecated 02 type 4 bytes of size to total + if (value.sub_type === Binary.SUBTYPE_BYTE_ARRAY) + size = size + 4; + // Write the size of the string to buffer + buffer[index++] = size & 0xff; + buffer[index++] = (size >> 8) & 0xff; + buffer[index++] = (size >> 16) & 0xff; + buffer[index++] = (size >> 24) & 0xff; + // Write the subtype to the buffer + buffer[index++] = value.sub_type; + // If we have binary type 2 the 4 first bytes are the size + if (value.sub_type === Binary.SUBTYPE_BYTE_ARRAY) { + size = size - 4; + buffer[index++] = size & 0xff; + buffer[index++] = (size >> 8) & 0xff; + buffer[index++] = (size >> 16) & 0xff; + buffer[index++] = (size >> 24) & 0xff; + } + // Write the data to the object + buffer.set(data, index); + // Adjust the index + index = index + value.position; + return index; + } + function serializeSymbol(buffer, key, value, index, isArray) { + // Write the type + buffer[index++] = BSON_DATA_SYMBOL; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Write the string + var size = buffer.write(value.value, index + 4, undefined, 'utf8') + 1; + // Write the size of the string to buffer + buffer[index] = size & 0xff; + buffer[index + 1] = (size >> 8) & 0xff; + buffer[index + 2] = (size >> 16) & 0xff; + buffer[index + 3] = (size >> 24) & 0xff; + // Update index + index = index + 4 + size - 1; + // Write zero + buffer[index++] = 0x00; + return index; + } + function serializeDBRef(buffer, key, value, index, depth, serializeFunctions, isArray) { + // Write the type + buffer[index++] = BSON_DATA_OBJECT; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + var startIndex = index; + var output = { + $ref: value.collection || value.namespace, + $id: value.oid + }; + if (value.db != null) { + output.$db = value.db; + } + output = Object.assign(output, value.fields); + var endIndex = serializeInto(buffer, output, false, index, depth + 1, serializeFunctions); + // Calculate object size + var size = endIndex - startIndex; + // Write the size + buffer[startIndex++] = size & 0xff; + buffer[startIndex++] = (size >> 8) & 0xff; + buffer[startIndex++] = (size >> 16) & 0xff; + buffer[startIndex++] = (size >> 24) & 0xff; + // Set index + return endIndex; + } + function serializeInto(buffer, object, checkKeys, startingIndex, depth, serializeFunctions, ignoreUndefined, path) { + if (checkKeys === void 0) { checkKeys = false; } + if (startingIndex === void 0) { startingIndex = 0; } + if (depth === void 0) { depth = 0; } + if (serializeFunctions === void 0) { serializeFunctions = false; } + if (ignoreUndefined === void 0) { ignoreUndefined = true; } + if (path === void 0) { path = []; } + startingIndex = startingIndex || 0; + path = path || []; + // Push the object to the path + path.push(object); + // Start place to serialize into + var index = startingIndex + 4; + // Special case isArray + if (Array.isArray(object)) { + // Get object keys + for (var i = 0; i < object.length; i++) { + var key = '' + i; + var value = object[i]; + // Is there an override value + if (typeof (value === null || value === void 0 ? void 0 : value.toBSON) === 'function') { + value = value.toBSON(); + } + if (typeof value === 'string') { + index = serializeString(buffer, key, value, index, true); + } + else if (typeof value === 'number') { + index = serializeNumber(buffer, key, value, index, true); + } + else if (typeof value === 'bigint') { + throw new BSONTypeError('Unsupported type BigInt, please use Decimal128'); + } + else if (typeof value === 'boolean') { + index = serializeBoolean(buffer, key, value, index, true); + } + else if (value instanceof Date || isDate(value)) { + index = serializeDate(buffer, key, value, index, true); + } + else if (value === undefined) { + index = serializeNull(buffer, key, value, index, true); + } + else if (value === null) { + index = serializeNull(buffer, key, value, index, true); + } + else if (value['_bsontype'] === 'ObjectId' || value['_bsontype'] === 'ObjectID') { + index = serializeObjectId(buffer, key, value, index, true); + } + else if (isUint8Array(value)) { + index = serializeBuffer(buffer, key, value, index, true); + } + else if (value instanceof RegExp || isRegExp(value)) { + index = serializeRegExp(buffer, key, value, index, true); + } + else if (typeof value === 'object' && value['_bsontype'] == null) { + index = serializeObject(buffer, key, value, index, checkKeys, depth, serializeFunctions, ignoreUndefined, true, path); + } + else if (typeof value === 'object' && + isBSONType(value) && + value._bsontype === 'Decimal128') { + index = serializeDecimal128(buffer, key, value, index, true); + } + else if (value['_bsontype'] === 'Long' || value['_bsontype'] === 'Timestamp') { + index = serializeLong(buffer, key, value, index, true); + } + else if (value['_bsontype'] === 'Double') { + index = serializeDouble(buffer, key, value, index, true); + } + else if (typeof value === 'function' && serializeFunctions) { + index = serializeFunction(buffer, key, value, index, checkKeys, depth, true); + } + else if (value['_bsontype'] === 'Code') { + index = serializeCode(buffer, key, value, index, checkKeys, depth, serializeFunctions, ignoreUndefined, true); + } + else if (value['_bsontype'] === 'Binary') { + index = serializeBinary(buffer, key, value, index, true); + } + else if (value['_bsontype'] === 'Symbol') { + index = serializeSymbol(buffer, key, value, index, true); + } + else if (value['_bsontype'] === 'DBRef') { + index = serializeDBRef(buffer, key, value, index, depth, serializeFunctions, true); + } + else if (value['_bsontype'] === 'BSONRegExp') { + index = serializeBSONRegExp(buffer, key, value, index, true); + } + else if (value['_bsontype'] === 'Int32') { + index = serializeInt32(buffer, key, value, index, true); + } + else if (value['_bsontype'] === 'MinKey' || value['_bsontype'] === 'MaxKey') { + index = serializeMinMax(buffer, key, value, index, true); + } + else if (typeof value['_bsontype'] !== 'undefined') { + throw new BSONTypeError('Unrecognized or invalid _bsontype: ' + value['_bsontype']); + } + } + } + else if (object instanceof exports.Map || isMap(object)) { + var iterator = object.entries(); + var done = false; + while (!done) { + // Unpack the next entry + var entry = iterator.next(); + done = !!entry.done; + // Are we done, then skip and terminate + if (done) + continue; + // Get the entry values + var key = entry.value[0]; + var value = entry.value[1]; + // Check the type of the value + var type = typeof value; + // Check the key and throw error if it's illegal + if (typeof key === 'string' && !ignoreKeys.has(key)) { + if (key.match(regexp) != null) { + // The BSON spec doesn't allow keys with null bytes because keys are + // null-terminated. + throw Error('key ' + key + ' must not contain null bytes'); + } + if (checkKeys) { + if ('$' === key[0]) { + throw Error('key ' + key + " must not start with '$'"); + } + else if (~key.indexOf('.')) { + throw Error('key ' + key + " must not contain '.'"); + } + } + } + if (type === 'string') { + index = serializeString(buffer, key, value, index); + } + else if (type === 'number') { + index = serializeNumber(buffer, key, value, index); + } + else if (type === 'bigint' || isBigInt64Array(value) || isBigUInt64Array(value)) { + throw new BSONTypeError('Unsupported type BigInt, please use Decimal128'); + } + else if (type === 'boolean') { + index = serializeBoolean(buffer, key, value, index); + } + else if (value instanceof Date || isDate(value)) { + index = serializeDate(buffer, key, value, index); + } + else if (value === null || (value === undefined && ignoreUndefined === false)) { + index = serializeNull(buffer, key, value, index); + } + else if (value['_bsontype'] === 'ObjectId' || value['_bsontype'] === 'ObjectID') { + index = serializeObjectId(buffer, key, value, index); + } + else if (isUint8Array(value)) { + index = serializeBuffer(buffer, key, value, index); + } + else if (value instanceof RegExp || isRegExp(value)) { + index = serializeRegExp(buffer, key, value, index); + } + else if (type === 'object' && value['_bsontype'] == null) { + index = serializeObject(buffer, key, value, index, checkKeys, depth, serializeFunctions, ignoreUndefined, false, path); + } + else if (type === 'object' && value['_bsontype'] === 'Decimal128') { + index = serializeDecimal128(buffer, key, value, index); + } + else if (value['_bsontype'] === 'Long' || value['_bsontype'] === 'Timestamp') { + index = serializeLong(buffer, key, value, index); + } + else if (value['_bsontype'] === 'Double') { + index = serializeDouble(buffer, key, value, index); + } + else if (value['_bsontype'] === 'Code') { + index = serializeCode(buffer, key, value, index, checkKeys, depth, serializeFunctions, ignoreUndefined); + } + else if (typeof value === 'function' && serializeFunctions) { + index = serializeFunction(buffer, key, value, index, checkKeys, depth, serializeFunctions); + } + else if (value['_bsontype'] === 'Binary') { + index = serializeBinary(buffer, key, value, index); + } + else if (value['_bsontype'] === 'Symbol') { + index = serializeSymbol(buffer, key, value, index); + } + else if (value['_bsontype'] === 'DBRef') { + index = serializeDBRef(buffer, key, value, index, depth, serializeFunctions); + } + else if (value['_bsontype'] === 'BSONRegExp') { + index = serializeBSONRegExp(buffer, key, value, index); + } + else if (value['_bsontype'] === 'Int32') { + index = serializeInt32(buffer, key, value, index); + } + else if (value['_bsontype'] === 'MinKey' || value['_bsontype'] === 'MaxKey') { + index = serializeMinMax(buffer, key, value, index); + } + else if (typeof value['_bsontype'] !== 'undefined') { + throw new BSONTypeError('Unrecognized or invalid _bsontype: ' + value['_bsontype']); + } + } + } + else { + if (typeof (object === null || object === void 0 ? void 0 : object.toBSON) === 'function') { + // Provided a custom serialization method + object = object.toBSON(); + if (object != null && typeof object !== 'object') { + throw new BSONTypeError('toBSON function did not return an object'); + } + } + // Iterate over all the keys + for (var key in object) { + var value = object[key]; + // Is there an override value + if (typeof (value === null || value === void 0 ? void 0 : value.toBSON) === 'function') { + value = value.toBSON(); + } + // Check the type of the value + var type = typeof value; + // Check the key and throw error if it's illegal + if (typeof key === 'string' && !ignoreKeys.has(key)) { + if (key.match(regexp) != null) { + // The BSON spec doesn't allow keys with null bytes because keys are + // null-terminated. + throw Error('key ' + key + ' must not contain null bytes'); + } + if (checkKeys) { + if ('$' === key[0]) { + throw Error('key ' + key + " must not start with '$'"); + } + else if (~key.indexOf('.')) { + throw Error('key ' + key + " must not contain '.'"); + } + } + } + if (type === 'string') { + index = serializeString(buffer, key, value, index); + } + else if (type === 'number') { + index = serializeNumber(buffer, key, value, index); + } + else if (type === 'bigint') { + throw new BSONTypeError('Unsupported type BigInt, please use Decimal128'); + } + else if (type === 'boolean') { + index = serializeBoolean(buffer, key, value, index); + } + else if (value instanceof Date || isDate(value)) { + index = serializeDate(buffer, key, value, index); + } + else if (value === undefined) { + if (ignoreUndefined === false) + index = serializeNull(buffer, key, value, index); + } + else if (value === null) { + index = serializeNull(buffer, key, value, index); + } + else if (value['_bsontype'] === 'ObjectId' || value['_bsontype'] === 'ObjectID') { + index = serializeObjectId(buffer, key, value, index); + } + else if (isUint8Array(value)) { + index = serializeBuffer(buffer, key, value, index); + } + else if (value instanceof RegExp || isRegExp(value)) { + index = serializeRegExp(buffer, key, value, index); + } + else if (type === 'object' && value['_bsontype'] == null) { + index = serializeObject(buffer, key, value, index, checkKeys, depth, serializeFunctions, ignoreUndefined, false, path); + } + else if (type === 'object' && value['_bsontype'] === 'Decimal128') { + index = serializeDecimal128(buffer, key, value, index); + } + else if (value['_bsontype'] === 'Long' || value['_bsontype'] === 'Timestamp') { + index = serializeLong(buffer, key, value, index); + } + else if (value['_bsontype'] === 'Double') { + index = serializeDouble(buffer, key, value, index); + } + else if (value['_bsontype'] === 'Code') { + index = serializeCode(buffer, key, value, index, checkKeys, depth, serializeFunctions, ignoreUndefined); + } + else if (typeof value === 'function' && serializeFunctions) { + index = serializeFunction(buffer, key, value, index, checkKeys, depth, serializeFunctions); + } + else if (value['_bsontype'] === 'Binary') { + index = serializeBinary(buffer, key, value, index); + } + else if (value['_bsontype'] === 'Symbol') { + index = serializeSymbol(buffer, key, value, index); + } + else if (value['_bsontype'] === 'DBRef') { + index = serializeDBRef(buffer, key, value, index, depth, serializeFunctions); + } + else if (value['_bsontype'] === 'BSONRegExp') { + index = serializeBSONRegExp(buffer, key, value, index); + } + else if (value['_bsontype'] === 'Int32') { + index = serializeInt32(buffer, key, value, index); + } + else if (value['_bsontype'] === 'MinKey' || value['_bsontype'] === 'MaxKey') { + index = serializeMinMax(buffer, key, value, index); + } + else if (typeof value['_bsontype'] !== 'undefined') { + throw new BSONTypeError('Unrecognized or invalid _bsontype: ' + value['_bsontype']); + } + } + } + // Remove the path + path.pop(); + // Final padding byte for object + buffer[index++] = 0x00; + // Final size + var size = index - startingIndex; + // Write the size of the object + buffer[startingIndex++] = size & 0xff; + buffer[startingIndex++] = (size >> 8) & 0xff; + buffer[startingIndex++] = (size >> 16) & 0xff; + buffer[startingIndex++] = (size >> 24) & 0xff; + return index; + } + + /** @internal */ + // Default Max Size + var MAXSIZE = 1024 * 1024 * 17; + // Current Internal Temporary Serialization Buffer + var buffer = buffer_1.alloc(MAXSIZE); + /** + * Sets the size of the internal serialization buffer. + * + * @param size - The desired size for the internal serialization buffer + * @public + */ + function setInternalBufferSize(size) { + // Resize the internal serialization buffer if needed + if (buffer.length < size) { + buffer = buffer_1.alloc(size); + } + } + /** + * Serialize a Javascript object. + * + * @param object - the Javascript object to serialize. + * @returns Buffer object containing the serialized object. + * @public + */ + function serialize(object, options) { + if (options === void 0) { options = {}; } + // Unpack the options + var checkKeys = typeof options.checkKeys === 'boolean' ? options.checkKeys : false; + var serializeFunctions = typeof options.serializeFunctions === 'boolean' ? options.serializeFunctions : false; + var ignoreUndefined = typeof options.ignoreUndefined === 'boolean' ? options.ignoreUndefined : true; + var minInternalBufferSize = typeof options.minInternalBufferSize === 'number' ? options.minInternalBufferSize : MAXSIZE; + // Resize the internal serialization buffer if needed + if (buffer.length < minInternalBufferSize) { + buffer = buffer_1.alloc(minInternalBufferSize); + } + // Attempt to serialize + var serializationIndex = serializeInto(buffer, object, checkKeys, 0, 0, serializeFunctions, ignoreUndefined, []); + // Create the final buffer + var finishedBuffer = buffer_1.alloc(serializationIndex); + // Copy into the finished buffer + buffer.copy(finishedBuffer, 0, 0, finishedBuffer.length); + // Return the buffer + return finishedBuffer; + } + /** + * Serialize a Javascript object using a predefined Buffer and index into the buffer, + * useful when pre-allocating the space for serialization. + * + * @param object - the Javascript object to serialize. + * @param finalBuffer - the Buffer you pre-allocated to store the serialized BSON object. + * @returns the index pointing to the last written byte in the buffer. + * @public + */ + function serializeWithBufferAndIndex(object, finalBuffer, options) { + if (options === void 0) { options = {}; } + // Unpack the options + var checkKeys = typeof options.checkKeys === 'boolean' ? options.checkKeys : false; + var serializeFunctions = typeof options.serializeFunctions === 'boolean' ? options.serializeFunctions : false; + var ignoreUndefined = typeof options.ignoreUndefined === 'boolean' ? options.ignoreUndefined : true; + var startIndex = typeof options.index === 'number' ? options.index : 0; + // Attempt to serialize + var serializationIndex = serializeInto(buffer, object, checkKeys, 0, 0, serializeFunctions, ignoreUndefined); + buffer.copy(finalBuffer, startIndex, 0, serializationIndex); + // Return the index + return startIndex + serializationIndex - 1; + } + /** + * Deserialize data as BSON. + * + * @param buffer - the buffer containing the serialized set of BSON documents. + * @returns returns the deserialized Javascript Object. + * @public + */ + function deserialize(buffer, options) { + if (options === void 0) { options = {}; } + return deserialize$1(buffer instanceof buffer_1 ? buffer : ensureBuffer(buffer), options); + } + /** + * Calculate the bson size for a passed in Javascript object. + * + * @param object - the Javascript object to calculate the BSON byte size for + * @returns size of BSON object in bytes + * @public + */ + function calculateObjectSize(object, options) { + if (options === void 0) { options = {}; } + options = options || {}; + var serializeFunctions = typeof options.serializeFunctions === 'boolean' ? options.serializeFunctions : false; + var ignoreUndefined = typeof options.ignoreUndefined === 'boolean' ? options.ignoreUndefined : true; + return calculateObjectSize$1(object, serializeFunctions, ignoreUndefined); + } + /** + * Deserialize stream data as BSON documents. + * + * @param data - the buffer containing the serialized set of BSON documents. + * @param startIndex - the start index in the data Buffer where the deserialization is to start. + * @param numberOfDocuments - number of documents to deserialize. + * @param documents - an array where to store the deserialized documents. + * @param docStartIndex - the index in the documents array from where to start inserting documents. + * @param options - additional options used for the deserialization. + * @returns next index in the buffer after deserialization **x** numbers of documents. + * @public + */ + function deserializeStream(data, startIndex, numberOfDocuments, documents, docStartIndex, options) { + var internalOptions = Object.assign({ allowObjectSmallerThanBufferSize: true, index: 0 }, options); + var bufferData = ensureBuffer(data); + var index = startIndex; + // Loop over all documents + for (var i = 0; i < numberOfDocuments; i++) { + // Find size of the document + var size = bufferData[index] | + (bufferData[index + 1] << 8) | + (bufferData[index + 2] << 16) | + (bufferData[index + 3] << 24); + // Update options with index + internalOptions.index = index; + // Parse the document at this point + documents[docStartIndex + i] = deserialize$1(bufferData, internalOptions); + // Adjust index by the document size + index = index + size; + } + // Return object containing end index of parsing and list of documents + return index; + } + /** + * BSON default export + * @deprecated Please use named exports + * @privateRemarks + * We want to someday deprecate the default export, + * so none of the new TS types are being exported on the default + * @public + */ + var BSON = { + Binary: Binary, + Code: Code, + DBRef: DBRef, + Decimal128: Decimal128, + Double: Double, + Int32: Int32, + Long: Long, + UUID: UUID, + Map: exports.Map, + MaxKey: MaxKey, + MinKey: MinKey, + ObjectId: ObjectId, + ObjectID: ObjectId, + BSONRegExp: BSONRegExp, + BSONSymbol: BSONSymbol, + Timestamp: Timestamp, + EJSON: exports.EJSON, + setInternalBufferSize: setInternalBufferSize, + serialize: serialize, + serializeWithBufferAndIndex: serializeWithBufferAndIndex, + deserialize: deserialize, + calculateObjectSize: calculateObjectSize, + deserializeStream: deserializeStream, + BSONError: BSONError, + BSONTypeError: BSONTypeError + }; + + exports.BSONError = BSONError; + exports.BSONRegExp = BSONRegExp; + exports.BSONSymbol = BSONSymbol; + exports.BSONTypeError = BSONTypeError; + exports.BSON_BINARY_SUBTYPE_BYTE_ARRAY = BSON_BINARY_SUBTYPE_BYTE_ARRAY; + exports.BSON_BINARY_SUBTYPE_COLUMN = BSON_BINARY_SUBTYPE_COLUMN; + exports.BSON_BINARY_SUBTYPE_DEFAULT = BSON_BINARY_SUBTYPE_DEFAULT; + exports.BSON_BINARY_SUBTYPE_ENCRYPTED = BSON_BINARY_SUBTYPE_ENCRYPTED; + exports.BSON_BINARY_SUBTYPE_FUNCTION = BSON_BINARY_SUBTYPE_FUNCTION; + exports.BSON_BINARY_SUBTYPE_MD5 = BSON_BINARY_SUBTYPE_MD5; + exports.BSON_BINARY_SUBTYPE_USER_DEFINED = BSON_BINARY_SUBTYPE_USER_DEFINED; + exports.BSON_BINARY_SUBTYPE_UUID = BSON_BINARY_SUBTYPE_UUID; + exports.BSON_BINARY_SUBTYPE_UUID_NEW = BSON_BINARY_SUBTYPE_UUID_NEW; + exports.BSON_DATA_ARRAY = BSON_DATA_ARRAY; + exports.BSON_DATA_BINARY = BSON_DATA_BINARY; + exports.BSON_DATA_BOOLEAN = BSON_DATA_BOOLEAN; + exports.BSON_DATA_CODE = BSON_DATA_CODE; + exports.BSON_DATA_CODE_W_SCOPE = BSON_DATA_CODE_W_SCOPE; + exports.BSON_DATA_DATE = BSON_DATA_DATE; + exports.BSON_DATA_DBPOINTER = BSON_DATA_DBPOINTER; + exports.BSON_DATA_DECIMAL128 = BSON_DATA_DECIMAL128; + exports.BSON_DATA_INT = BSON_DATA_INT; + exports.BSON_DATA_LONG = BSON_DATA_LONG; + exports.BSON_DATA_MAX_KEY = BSON_DATA_MAX_KEY; + exports.BSON_DATA_MIN_KEY = BSON_DATA_MIN_KEY; + exports.BSON_DATA_NULL = BSON_DATA_NULL; + exports.BSON_DATA_NUMBER = BSON_DATA_NUMBER; + exports.BSON_DATA_OBJECT = BSON_DATA_OBJECT; + exports.BSON_DATA_OID = BSON_DATA_OID; + exports.BSON_DATA_REGEXP = BSON_DATA_REGEXP; + exports.BSON_DATA_STRING = BSON_DATA_STRING; + exports.BSON_DATA_SYMBOL = BSON_DATA_SYMBOL; + exports.BSON_DATA_TIMESTAMP = BSON_DATA_TIMESTAMP; + exports.BSON_DATA_UNDEFINED = BSON_DATA_UNDEFINED; + exports.BSON_INT32_MAX = BSON_INT32_MAX; + exports.BSON_INT32_MIN = BSON_INT32_MIN; + exports.BSON_INT64_MAX = BSON_INT64_MAX; + exports.BSON_INT64_MIN = BSON_INT64_MIN; + exports.Binary = Binary; + exports.Code = Code; + exports.DBRef = DBRef; + exports.Decimal128 = Decimal128; + exports.Double = Double; + exports.Int32 = Int32; + exports.Long = Long; + exports.LongWithoutOverridesClass = LongWithoutOverridesClass; + exports.MaxKey = MaxKey; + exports.MinKey = MinKey; + exports.ObjectID = ObjectId; + exports.ObjectId = ObjectId; + exports.Timestamp = Timestamp; + exports.UUID = UUID; + exports.calculateObjectSize = calculateObjectSize; + exports.default = BSON; + exports.deserialize = deserialize; + exports.deserializeStream = deserializeStream; + exports.serialize = serialize; + exports.serializeWithBufferAndIndex = serializeWithBufferAndIndex; + exports.setInternalBufferSize = setInternalBufferSize; + + Object.defineProperty(exports, '__esModule', { value: true }); + + return exports; + +}({})); +//# sourceMappingURL=bson.bundle.js.map diff --git a/node_modules/bson/dist/bson.bundle.js.map b/node_modules/bson/dist/bson.bundle.js.map new file mode 100644 index 000000000..3e9f372ae --- /dev/null +++ b/node_modules/bson/dist/bson.bundle.js.map @@ -0,0 +1 @@ +{"version":3,"file":"bson.bundle.js","sources":["../node_modules/base64-js/index.js","../node_modules/ieee754/index.js","../node_modules/buffer/index.js","../node_modules/tslib/tslib.es6.js","../src/error.ts","../src/utils/global.ts","../src/parser/utils.ts","../src/ensure_buffer.ts","../src/uuid_utils.ts","../src/uuid.ts","../src/binary.ts","../src/code.ts","../src/db_ref.ts","../src/long.ts","../src/decimal128.ts","../src/double.ts","../src/int_32.ts","../src/max_key.ts","../src/min_key.ts","../src/objectid.ts","../src/regexp.ts","../src/symbol.ts","../src/timestamp.ts","../src/extended_json.ts","../src/map.ts","../src/constants.ts","../src/parser/calculate_size.ts","../src/validate_utf8.ts","../src/parser/deserializer.ts","../src/float_parser.ts","../src/parser/serializer.ts","../src/bson.ts"],"sourcesContent":["'use strict'\n\nexports.byteLength = byteLength\nexports.toByteArray = toByteArray\nexports.fromByteArray = fromByteArray\n\nvar lookup = []\nvar revLookup = []\nvar Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array\n\nvar code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'\nfor (var i = 0, len = code.length; i < len; ++i) {\n lookup[i] = code[i]\n revLookup[code.charCodeAt(i)] = i\n}\n\n// Support decoding URL-safe base64 strings, as Node.js does.\n// See: https://en.wikipedia.org/wiki/Base64#URL_applications\nrevLookup['-'.charCodeAt(0)] = 62\nrevLookup['_'.charCodeAt(0)] = 63\n\nfunction getLens (b64) {\n var len = b64.length\n\n if (len % 4 > 0) {\n throw new Error('Invalid string. Length must be a multiple of 4')\n }\n\n // Trim off extra bytes after placeholder bytes are found\n // See: https://github.com/beatgammit/base64-js/issues/42\n var validLen = b64.indexOf('=')\n if (validLen === -1) validLen = len\n\n var placeHoldersLen = validLen === len\n ? 0\n : 4 - (validLen % 4)\n\n return [validLen, placeHoldersLen]\n}\n\n// base64 is 4/3 + up to two characters of the original data\nfunction byteLength (b64) {\n var lens = getLens(b64)\n var validLen = lens[0]\n var placeHoldersLen = lens[1]\n return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen\n}\n\nfunction _byteLength (b64, validLen, placeHoldersLen) {\n return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen\n}\n\nfunction toByteArray (b64) {\n var tmp\n var lens = getLens(b64)\n var validLen = lens[0]\n var placeHoldersLen = lens[1]\n\n var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen))\n\n var curByte = 0\n\n // if there are placeholders, only get up to the last complete 4 chars\n var len = placeHoldersLen > 0\n ? validLen - 4\n : validLen\n\n var i\n for (i = 0; i < len; i += 4) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 18) |\n (revLookup[b64.charCodeAt(i + 1)] << 12) |\n (revLookup[b64.charCodeAt(i + 2)] << 6) |\n revLookup[b64.charCodeAt(i + 3)]\n arr[curByte++] = (tmp >> 16) & 0xFF\n arr[curByte++] = (tmp >> 8) & 0xFF\n arr[curByte++] = tmp & 0xFF\n }\n\n if (placeHoldersLen === 2) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 2) |\n (revLookup[b64.charCodeAt(i + 1)] >> 4)\n arr[curByte++] = tmp & 0xFF\n }\n\n if (placeHoldersLen === 1) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 10) |\n (revLookup[b64.charCodeAt(i + 1)] << 4) |\n (revLookup[b64.charCodeAt(i + 2)] >> 2)\n arr[curByte++] = (tmp >> 8) & 0xFF\n arr[curByte++] = tmp & 0xFF\n }\n\n return arr\n}\n\nfunction tripletToBase64 (num) {\n return lookup[num >> 18 & 0x3F] +\n lookup[num >> 12 & 0x3F] +\n lookup[num >> 6 & 0x3F] +\n lookup[num & 0x3F]\n}\n\nfunction encodeChunk (uint8, start, end) {\n var tmp\n var output = []\n for (var i = start; i < end; i += 3) {\n tmp =\n ((uint8[i] << 16) & 0xFF0000) +\n ((uint8[i + 1] << 8) & 0xFF00) +\n (uint8[i + 2] & 0xFF)\n output.push(tripletToBase64(tmp))\n }\n return output.join('')\n}\n\nfunction fromByteArray (uint8) {\n var tmp\n var len = uint8.length\n var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes\n var parts = []\n var maxChunkLength = 16383 // must be multiple of 3\n\n // go through the array every three bytes, we'll deal with trailing stuff later\n for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {\n parts.push(encodeChunk(uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)))\n }\n\n // pad the end with zeros, but make sure to not forget the extra bytes\n if (extraBytes === 1) {\n tmp = uint8[len - 1]\n parts.push(\n lookup[tmp >> 2] +\n lookup[(tmp << 4) & 0x3F] +\n '=='\n )\n } else if (extraBytes === 2) {\n tmp = (uint8[len - 2] << 8) + uint8[len - 1]\n parts.push(\n lookup[tmp >> 10] +\n lookup[(tmp >> 4) & 0x3F] +\n lookup[(tmp << 2) & 0x3F] +\n '='\n )\n }\n\n return parts.join('')\n}\n","/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */\nexports.read = function (buffer, offset, isLE, mLen, nBytes) {\n var e, m\n var eLen = (nBytes * 8) - mLen - 1\n var eMax = (1 << eLen) - 1\n var eBias = eMax >> 1\n var nBits = -7\n var i = isLE ? (nBytes - 1) : 0\n var d = isLE ? -1 : 1\n var s = buffer[offset + i]\n\n i += d\n\n e = s & ((1 << (-nBits)) - 1)\n s >>= (-nBits)\n nBits += eLen\n for (; nBits > 0; e = (e * 256) + buffer[offset + i], i += d, nBits -= 8) {}\n\n m = e & ((1 << (-nBits)) - 1)\n e >>= (-nBits)\n nBits += mLen\n for (; nBits > 0; m = (m * 256) + buffer[offset + i], i += d, nBits -= 8) {}\n\n if (e === 0) {\n e = 1 - eBias\n } else if (e === eMax) {\n return m ? NaN : ((s ? -1 : 1) * Infinity)\n } else {\n m = m + Math.pow(2, mLen)\n e = e - eBias\n }\n return (s ? -1 : 1) * m * Math.pow(2, e - mLen)\n}\n\nexports.write = function (buffer, value, offset, isLE, mLen, nBytes) {\n var e, m, c\n var eLen = (nBytes * 8) - mLen - 1\n var eMax = (1 << eLen) - 1\n var eBias = eMax >> 1\n var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0)\n var i = isLE ? 0 : (nBytes - 1)\n var d = isLE ? 1 : -1\n var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0\n\n value = Math.abs(value)\n\n if (isNaN(value) || value === Infinity) {\n m = isNaN(value) ? 1 : 0\n e = eMax\n } else {\n e = Math.floor(Math.log(value) / Math.LN2)\n if (value * (c = Math.pow(2, -e)) < 1) {\n e--\n c *= 2\n }\n if (e + eBias >= 1) {\n value += rt / c\n } else {\n value += rt * Math.pow(2, 1 - eBias)\n }\n if (value * c >= 2) {\n e++\n c /= 2\n }\n\n if (e + eBias >= eMax) {\n m = 0\n e = eMax\n } else if (e + eBias >= 1) {\n m = ((value * c) - 1) * Math.pow(2, mLen)\n e = e + eBias\n } else {\n m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen)\n e = 0\n }\n }\n\n for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {}\n\n e = (e << mLen) | m\n eLen += mLen\n for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {}\n\n buffer[offset + i - d] |= s * 128\n}\n","/*!\n * The buffer module from node.js, for the browser.\n *\n * @author Feross Aboukhadijeh \n * @license MIT\n */\n/* eslint-disable no-proto */\n\n'use strict'\n\nvar base64 = require('base64-js')\nvar ieee754 = require('ieee754')\nvar customInspectSymbol =\n (typeof Symbol === 'function' && typeof Symbol['for'] === 'function') // eslint-disable-line dot-notation\n ? Symbol['for']('nodejs.util.inspect.custom') // eslint-disable-line dot-notation\n : null\n\nexports.Buffer = Buffer\nexports.SlowBuffer = SlowBuffer\nexports.INSPECT_MAX_BYTES = 50\n\nvar K_MAX_LENGTH = 0x7fffffff\nexports.kMaxLength = K_MAX_LENGTH\n\n/**\n * If `Buffer.TYPED_ARRAY_SUPPORT`:\n * === true Use Uint8Array implementation (fastest)\n * === false Print warning and recommend using `buffer` v4.x which has an Object\n * implementation (most compatible, even IE6)\n *\n * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,\n * Opera 11.6+, iOS 4.2+.\n *\n * We report that the browser does not support typed arrays if the are not subclassable\n * using __proto__. Firefox 4-29 lacks support for adding new properties to `Uint8Array`\n * (See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438). IE 10 lacks support\n * for __proto__ and has a buggy typed array implementation.\n */\nBuffer.TYPED_ARRAY_SUPPORT = typedArraySupport()\n\nif (!Buffer.TYPED_ARRAY_SUPPORT && typeof console !== 'undefined' &&\n typeof console.error === 'function') {\n console.error(\n 'This browser lacks typed array (Uint8Array) support which is required by ' +\n '`buffer` v5.x. Use `buffer` v4.x if you require old browser support.'\n )\n}\n\nfunction typedArraySupport () {\n // Can typed array instances can be augmented?\n try {\n var arr = new Uint8Array(1)\n var proto = { foo: function () { return 42 } }\n Object.setPrototypeOf(proto, Uint8Array.prototype)\n Object.setPrototypeOf(arr, proto)\n return arr.foo() === 42\n } catch (e) {\n return false\n }\n}\n\nObject.defineProperty(Buffer.prototype, 'parent', {\n enumerable: true,\n get: function () {\n if (!Buffer.isBuffer(this)) return undefined\n return this.buffer\n }\n})\n\nObject.defineProperty(Buffer.prototype, 'offset', {\n enumerable: true,\n get: function () {\n if (!Buffer.isBuffer(this)) return undefined\n return this.byteOffset\n }\n})\n\nfunction createBuffer (length) {\n if (length > K_MAX_LENGTH) {\n throw new RangeError('The value \"' + length + '\" is invalid for option \"size\"')\n }\n // Return an augmented `Uint8Array` instance\n var buf = new Uint8Array(length)\n Object.setPrototypeOf(buf, Buffer.prototype)\n return buf\n}\n\n/**\n * The Buffer constructor returns instances of `Uint8Array` that have their\n * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of\n * `Uint8Array`, so the returned instances will have all the node `Buffer` methods\n * and the `Uint8Array` methods. Square bracket notation works as expected -- it\n * returns a single octet.\n *\n * The `Uint8Array` prototype remains unmodified.\n */\n\nfunction Buffer (arg, encodingOrOffset, length) {\n // Common case.\n if (typeof arg === 'number') {\n if (typeof encodingOrOffset === 'string') {\n throw new TypeError(\n 'The \"string\" argument must be of type string. Received type number'\n )\n }\n return allocUnsafe(arg)\n }\n return from(arg, encodingOrOffset, length)\n}\n\nBuffer.poolSize = 8192 // not used by this implementation\n\nfunction from (value, encodingOrOffset, length) {\n if (typeof value === 'string') {\n return fromString(value, encodingOrOffset)\n }\n\n if (ArrayBuffer.isView(value)) {\n return fromArrayView(value)\n }\n\n if (value == null) {\n throw new TypeError(\n 'The first argument must be one of type string, Buffer, ArrayBuffer, Array, ' +\n 'or Array-like Object. Received type ' + (typeof value)\n )\n }\n\n if (isInstance(value, ArrayBuffer) ||\n (value && isInstance(value.buffer, ArrayBuffer))) {\n return fromArrayBuffer(value, encodingOrOffset, length)\n }\n\n if (typeof SharedArrayBuffer !== 'undefined' &&\n (isInstance(value, SharedArrayBuffer) ||\n (value && isInstance(value.buffer, SharedArrayBuffer)))) {\n return fromArrayBuffer(value, encodingOrOffset, length)\n }\n\n if (typeof value === 'number') {\n throw new TypeError(\n 'The \"value\" argument must not be of type number. Received type number'\n )\n }\n\n var valueOf = value.valueOf && value.valueOf()\n if (valueOf != null && valueOf !== value) {\n return Buffer.from(valueOf, encodingOrOffset, length)\n }\n\n var b = fromObject(value)\n if (b) return b\n\n if (typeof Symbol !== 'undefined' && Symbol.toPrimitive != null &&\n typeof value[Symbol.toPrimitive] === 'function') {\n return Buffer.from(\n value[Symbol.toPrimitive]('string'), encodingOrOffset, length\n )\n }\n\n throw new TypeError(\n 'The first argument must be one of type string, Buffer, ArrayBuffer, Array, ' +\n 'or Array-like Object. Received type ' + (typeof value)\n )\n}\n\n/**\n * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError\n * if value is a number.\n * Buffer.from(str[, encoding])\n * Buffer.from(array)\n * Buffer.from(buffer)\n * Buffer.from(arrayBuffer[, byteOffset[, length]])\n **/\nBuffer.from = function (value, encodingOrOffset, length) {\n return from(value, encodingOrOffset, length)\n}\n\n// Note: Change prototype *after* Buffer.from is defined to workaround Chrome bug:\n// https://github.com/feross/buffer/pull/148\nObject.setPrototypeOf(Buffer.prototype, Uint8Array.prototype)\nObject.setPrototypeOf(Buffer, Uint8Array)\n\nfunction assertSize (size) {\n if (typeof size !== 'number') {\n throw new TypeError('\"size\" argument must be of type number')\n } else if (size < 0) {\n throw new RangeError('The value \"' + size + '\" is invalid for option \"size\"')\n }\n}\n\nfunction alloc (size, fill, encoding) {\n assertSize(size)\n if (size <= 0) {\n return createBuffer(size)\n }\n if (fill !== undefined) {\n // Only pay attention to encoding if it's a string. This\n // prevents accidentally sending in a number that would\n // be interpreted as a start offset.\n return typeof encoding === 'string'\n ? createBuffer(size).fill(fill, encoding)\n : createBuffer(size).fill(fill)\n }\n return createBuffer(size)\n}\n\n/**\n * Creates a new filled Buffer instance.\n * alloc(size[, fill[, encoding]])\n **/\nBuffer.alloc = function (size, fill, encoding) {\n return alloc(size, fill, encoding)\n}\n\nfunction allocUnsafe (size) {\n assertSize(size)\n return createBuffer(size < 0 ? 0 : checked(size) | 0)\n}\n\n/**\n * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance.\n * */\nBuffer.allocUnsafe = function (size) {\n return allocUnsafe(size)\n}\n/**\n * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.\n */\nBuffer.allocUnsafeSlow = function (size) {\n return allocUnsafe(size)\n}\n\nfunction fromString (string, encoding) {\n if (typeof encoding !== 'string' || encoding === '') {\n encoding = 'utf8'\n }\n\n if (!Buffer.isEncoding(encoding)) {\n throw new TypeError('Unknown encoding: ' + encoding)\n }\n\n var length = byteLength(string, encoding) | 0\n var buf = createBuffer(length)\n\n var actual = buf.write(string, encoding)\n\n if (actual !== length) {\n // Writing a hex string, for example, that contains invalid characters will\n // cause everything after the first invalid character to be ignored. (e.g.\n // 'abxxcd' will be treated as 'ab')\n buf = buf.slice(0, actual)\n }\n\n return buf\n}\n\nfunction fromArrayLike (array) {\n var length = array.length < 0 ? 0 : checked(array.length) | 0\n var buf = createBuffer(length)\n for (var i = 0; i < length; i += 1) {\n buf[i] = array[i] & 255\n }\n return buf\n}\n\nfunction fromArrayView (arrayView) {\n if (isInstance(arrayView, Uint8Array)) {\n var copy = new Uint8Array(arrayView)\n return fromArrayBuffer(copy.buffer, copy.byteOffset, copy.byteLength)\n }\n return fromArrayLike(arrayView)\n}\n\nfunction fromArrayBuffer (array, byteOffset, length) {\n if (byteOffset < 0 || array.byteLength < byteOffset) {\n throw new RangeError('\"offset\" is outside of buffer bounds')\n }\n\n if (array.byteLength < byteOffset + (length || 0)) {\n throw new RangeError('\"length\" is outside of buffer bounds')\n }\n\n var buf\n if (byteOffset === undefined && length === undefined) {\n buf = new Uint8Array(array)\n } else if (length === undefined) {\n buf = new Uint8Array(array, byteOffset)\n } else {\n buf = new Uint8Array(array, byteOffset, length)\n }\n\n // Return an augmented `Uint8Array` instance\n Object.setPrototypeOf(buf, Buffer.prototype)\n\n return buf\n}\n\nfunction fromObject (obj) {\n if (Buffer.isBuffer(obj)) {\n var len = checked(obj.length) | 0\n var buf = createBuffer(len)\n\n if (buf.length === 0) {\n return buf\n }\n\n obj.copy(buf, 0, 0, len)\n return buf\n }\n\n if (obj.length !== undefined) {\n if (typeof obj.length !== 'number' || numberIsNaN(obj.length)) {\n return createBuffer(0)\n }\n return fromArrayLike(obj)\n }\n\n if (obj.type === 'Buffer' && Array.isArray(obj.data)) {\n return fromArrayLike(obj.data)\n }\n}\n\nfunction checked (length) {\n // Note: cannot use `length < K_MAX_LENGTH` here because that fails when\n // length is NaN (which is otherwise coerced to zero.)\n if (length >= K_MAX_LENGTH) {\n throw new RangeError('Attempt to allocate Buffer larger than maximum ' +\n 'size: 0x' + K_MAX_LENGTH.toString(16) + ' bytes')\n }\n return length | 0\n}\n\nfunction SlowBuffer (length) {\n if (+length != length) { // eslint-disable-line eqeqeq\n length = 0\n }\n return Buffer.alloc(+length)\n}\n\nBuffer.isBuffer = function isBuffer (b) {\n return b != null && b._isBuffer === true &&\n b !== Buffer.prototype // so Buffer.isBuffer(Buffer.prototype) will be false\n}\n\nBuffer.compare = function compare (a, b) {\n if (isInstance(a, Uint8Array)) a = Buffer.from(a, a.offset, a.byteLength)\n if (isInstance(b, Uint8Array)) b = Buffer.from(b, b.offset, b.byteLength)\n if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) {\n throw new TypeError(\n 'The \"buf1\", \"buf2\" arguments must be one of type Buffer or Uint8Array'\n )\n }\n\n if (a === b) return 0\n\n var x = a.length\n var y = b.length\n\n for (var i = 0, len = Math.min(x, y); i < len; ++i) {\n if (a[i] !== b[i]) {\n x = a[i]\n y = b[i]\n break\n }\n }\n\n if (x < y) return -1\n if (y < x) return 1\n return 0\n}\n\nBuffer.isEncoding = function isEncoding (encoding) {\n switch (String(encoding).toLowerCase()) {\n case 'hex':\n case 'utf8':\n case 'utf-8':\n case 'ascii':\n case 'latin1':\n case 'binary':\n case 'base64':\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return true\n default:\n return false\n }\n}\n\nBuffer.concat = function concat (list, length) {\n if (!Array.isArray(list)) {\n throw new TypeError('\"list\" argument must be an Array of Buffers')\n }\n\n if (list.length === 0) {\n return Buffer.alloc(0)\n }\n\n var i\n if (length === undefined) {\n length = 0\n for (i = 0; i < list.length; ++i) {\n length += list[i].length\n }\n }\n\n var buffer = Buffer.allocUnsafe(length)\n var pos = 0\n for (i = 0; i < list.length; ++i) {\n var buf = list[i]\n if (isInstance(buf, Uint8Array)) {\n if (pos + buf.length > buffer.length) {\n Buffer.from(buf).copy(buffer, pos)\n } else {\n Uint8Array.prototype.set.call(\n buffer,\n buf,\n pos\n )\n }\n } else if (!Buffer.isBuffer(buf)) {\n throw new TypeError('\"list\" argument must be an Array of Buffers')\n } else {\n buf.copy(buffer, pos)\n }\n pos += buf.length\n }\n return buffer\n}\n\nfunction byteLength (string, encoding) {\n if (Buffer.isBuffer(string)) {\n return string.length\n }\n if (ArrayBuffer.isView(string) || isInstance(string, ArrayBuffer)) {\n return string.byteLength\n }\n if (typeof string !== 'string') {\n throw new TypeError(\n 'The \"string\" argument must be one of type string, Buffer, or ArrayBuffer. ' +\n 'Received type ' + typeof string\n )\n }\n\n var len = string.length\n var mustMatch = (arguments.length > 2 && arguments[2] === true)\n if (!mustMatch && len === 0) return 0\n\n // Use a for loop to avoid recursion\n var loweredCase = false\n for (;;) {\n switch (encoding) {\n case 'ascii':\n case 'latin1':\n case 'binary':\n return len\n case 'utf8':\n case 'utf-8':\n return utf8ToBytes(string).length\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return len * 2\n case 'hex':\n return len >>> 1\n case 'base64':\n return base64ToBytes(string).length\n default:\n if (loweredCase) {\n return mustMatch ? -1 : utf8ToBytes(string).length // assume utf8\n }\n encoding = ('' + encoding).toLowerCase()\n loweredCase = true\n }\n }\n}\nBuffer.byteLength = byteLength\n\nfunction slowToString (encoding, start, end) {\n var loweredCase = false\n\n // No need to verify that \"this.length <= MAX_UINT32\" since it's a read-only\n // property of a typed array.\n\n // This behaves neither like String nor Uint8Array in that we set start/end\n // to their upper/lower bounds if the value passed is out of range.\n // undefined is handled specially as per ECMA-262 6th Edition,\n // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization.\n if (start === undefined || start < 0) {\n start = 0\n }\n // Return early if start > this.length. Done here to prevent potential uint32\n // coercion fail below.\n if (start > this.length) {\n return ''\n }\n\n if (end === undefined || end > this.length) {\n end = this.length\n }\n\n if (end <= 0) {\n return ''\n }\n\n // Force coercion to uint32. This will also coerce falsey/NaN values to 0.\n end >>>= 0\n start >>>= 0\n\n if (end <= start) {\n return ''\n }\n\n if (!encoding) encoding = 'utf8'\n\n while (true) {\n switch (encoding) {\n case 'hex':\n return hexSlice(this, start, end)\n\n case 'utf8':\n case 'utf-8':\n return utf8Slice(this, start, end)\n\n case 'ascii':\n return asciiSlice(this, start, end)\n\n case 'latin1':\n case 'binary':\n return latin1Slice(this, start, end)\n\n case 'base64':\n return base64Slice(this, start, end)\n\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return utf16leSlice(this, start, end)\n\n default:\n if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)\n encoding = (encoding + '').toLowerCase()\n loweredCase = true\n }\n }\n}\n\n// This property is used by `Buffer.isBuffer` (and the `is-buffer` npm package)\n// to detect a Buffer instance. It's not possible to use `instanceof Buffer`\n// reliably in a browserify context because there could be multiple different\n// copies of the 'buffer' package in use. This method works even for Buffer\n// instances that were created from another copy of the `buffer` package.\n// See: https://github.com/feross/buffer/issues/154\nBuffer.prototype._isBuffer = true\n\nfunction swap (b, n, m) {\n var i = b[n]\n b[n] = b[m]\n b[m] = i\n}\n\nBuffer.prototype.swap16 = function swap16 () {\n var len = this.length\n if (len % 2 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 16-bits')\n }\n for (var i = 0; i < len; i += 2) {\n swap(this, i, i + 1)\n }\n return this\n}\n\nBuffer.prototype.swap32 = function swap32 () {\n var len = this.length\n if (len % 4 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 32-bits')\n }\n for (var i = 0; i < len; i += 4) {\n swap(this, i, i + 3)\n swap(this, i + 1, i + 2)\n }\n return this\n}\n\nBuffer.prototype.swap64 = function swap64 () {\n var len = this.length\n if (len % 8 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 64-bits')\n }\n for (var i = 0; i < len; i += 8) {\n swap(this, i, i + 7)\n swap(this, i + 1, i + 6)\n swap(this, i + 2, i + 5)\n swap(this, i + 3, i + 4)\n }\n return this\n}\n\nBuffer.prototype.toString = function toString () {\n var length = this.length\n if (length === 0) return ''\n if (arguments.length === 0) return utf8Slice(this, 0, length)\n return slowToString.apply(this, arguments)\n}\n\nBuffer.prototype.toLocaleString = Buffer.prototype.toString\n\nBuffer.prototype.equals = function equals (b) {\n if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer')\n if (this === b) return true\n return Buffer.compare(this, b) === 0\n}\n\nBuffer.prototype.inspect = function inspect () {\n var str = ''\n var max = exports.INSPECT_MAX_BYTES\n str = this.toString('hex', 0, max).replace(/(.{2})/g, '$1 ').trim()\n if (this.length > max) str += ' ... '\n return ''\n}\nif (customInspectSymbol) {\n Buffer.prototype[customInspectSymbol] = Buffer.prototype.inspect\n}\n\nBuffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) {\n if (isInstance(target, Uint8Array)) {\n target = Buffer.from(target, target.offset, target.byteLength)\n }\n if (!Buffer.isBuffer(target)) {\n throw new TypeError(\n 'The \"target\" argument must be one of type Buffer or Uint8Array. ' +\n 'Received type ' + (typeof target)\n )\n }\n\n if (start === undefined) {\n start = 0\n }\n if (end === undefined) {\n end = target ? target.length : 0\n }\n if (thisStart === undefined) {\n thisStart = 0\n }\n if (thisEnd === undefined) {\n thisEnd = this.length\n }\n\n if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) {\n throw new RangeError('out of range index')\n }\n\n if (thisStart >= thisEnd && start >= end) {\n return 0\n }\n if (thisStart >= thisEnd) {\n return -1\n }\n if (start >= end) {\n return 1\n }\n\n start >>>= 0\n end >>>= 0\n thisStart >>>= 0\n thisEnd >>>= 0\n\n if (this === target) return 0\n\n var x = thisEnd - thisStart\n var y = end - start\n var len = Math.min(x, y)\n\n var thisCopy = this.slice(thisStart, thisEnd)\n var targetCopy = target.slice(start, end)\n\n for (var i = 0; i < len; ++i) {\n if (thisCopy[i] !== targetCopy[i]) {\n x = thisCopy[i]\n y = targetCopy[i]\n break\n }\n }\n\n if (x < y) return -1\n if (y < x) return 1\n return 0\n}\n\n// Finds either the first index of `val` in `buffer` at offset >= `byteOffset`,\n// OR the last index of `val` in `buffer` at offset <= `byteOffset`.\n//\n// Arguments:\n// - buffer - a Buffer to search\n// - val - a string, Buffer, or number\n// - byteOffset - an index into `buffer`; will be clamped to an int32\n// - encoding - an optional encoding, relevant is val is a string\n// - dir - true for indexOf, false for lastIndexOf\nfunction bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {\n // Empty buffer means no match\n if (buffer.length === 0) return -1\n\n // Normalize byteOffset\n if (typeof byteOffset === 'string') {\n encoding = byteOffset\n byteOffset = 0\n } else if (byteOffset > 0x7fffffff) {\n byteOffset = 0x7fffffff\n } else if (byteOffset < -0x80000000) {\n byteOffset = -0x80000000\n }\n byteOffset = +byteOffset // Coerce to Number.\n if (numberIsNaN(byteOffset)) {\n // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n byteOffset = dir ? 0 : (buffer.length - 1)\n }\n\n // Normalize byteOffset: negative offsets start from the end of the buffer\n if (byteOffset < 0) byteOffset = buffer.length + byteOffset\n if (byteOffset >= buffer.length) {\n if (dir) return -1\n else byteOffset = buffer.length - 1\n } else if (byteOffset < 0) {\n if (dir) byteOffset = 0\n else return -1\n }\n\n // Normalize val\n if (typeof val === 'string') {\n val = Buffer.from(val, encoding)\n }\n\n // Finally, search either indexOf (if dir is true) or lastIndexOf\n if (Buffer.isBuffer(val)) {\n // Special case: looking for empty string/buffer always fails\n if (val.length === 0) {\n return -1\n }\n return arrayIndexOf(buffer, val, byteOffset, encoding, dir)\n } else if (typeof val === 'number') {\n val = val & 0xFF // Search for a byte value [0-255]\n if (typeof Uint8Array.prototype.indexOf === 'function') {\n if (dir) {\n return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)\n } else {\n return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)\n }\n }\n return arrayIndexOf(buffer, [val], byteOffset, encoding, dir)\n }\n\n throw new TypeError('val must be string, number or Buffer')\n}\n\nfunction arrayIndexOf (arr, val, byteOffset, encoding, dir) {\n var indexSize = 1\n var arrLength = arr.length\n var valLength = val.length\n\n if (encoding !== undefined) {\n encoding = String(encoding).toLowerCase()\n if (encoding === 'ucs2' || encoding === 'ucs-2' ||\n encoding === 'utf16le' || encoding === 'utf-16le') {\n if (arr.length < 2 || val.length < 2) {\n return -1\n }\n indexSize = 2\n arrLength /= 2\n valLength /= 2\n byteOffset /= 2\n }\n }\n\n function read (buf, i) {\n if (indexSize === 1) {\n return buf[i]\n } else {\n return buf.readUInt16BE(i * indexSize)\n }\n }\n\n var i\n if (dir) {\n var foundIndex = -1\n for (i = byteOffset; i < arrLength; i++) {\n if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {\n if (foundIndex === -1) foundIndex = i\n if (i - foundIndex + 1 === valLength) return foundIndex * indexSize\n } else {\n if (foundIndex !== -1) i -= i - foundIndex\n foundIndex = -1\n }\n }\n } else {\n if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength\n for (i = byteOffset; i >= 0; i--) {\n var found = true\n for (var j = 0; j < valLength; j++) {\n if (read(arr, i + j) !== read(val, j)) {\n found = false\n break\n }\n }\n if (found) return i\n }\n }\n\n return -1\n}\n\nBuffer.prototype.includes = function includes (val, byteOffset, encoding) {\n return this.indexOf(val, byteOffset, encoding) !== -1\n}\n\nBuffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) {\n return bidirectionalIndexOf(this, val, byteOffset, encoding, true)\n}\n\nBuffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) {\n return bidirectionalIndexOf(this, val, byteOffset, encoding, false)\n}\n\nfunction hexWrite (buf, string, offset, length) {\n offset = Number(offset) || 0\n var remaining = buf.length - offset\n if (!length) {\n length = remaining\n } else {\n length = Number(length)\n if (length > remaining) {\n length = remaining\n }\n }\n\n var strLen = string.length\n\n if (length > strLen / 2) {\n length = strLen / 2\n }\n for (var i = 0; i < length; ++i) {\n var parsed = parseInt(string.substr(i * 2, 2), 16)\n if (numberIsNaN(parsed)) return i\n buf[offset + i] = parsed\n }\n return i\n}\n\nfunction utf8Write (buf, string, offset, length) {\n return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length)\n}\n\nfunction asciiWrite (buf, string, offset, length) {\n return blitBuffer(asciiToBytes(string), buf, offset, length)\n}\n\nfunction base64Write (buf, string, offset, length) {\n return blitBuffer(base64ToBytes(string), buf, offset, length)\n}\n\nfunction ucs2Write (buf, string, offset, length) {\n return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length)\n}\n\nBuffer.prototype.write = function write (string, offset, length, encoding) {\n // Buffer#write(string)\n if (offset === undefined) {\n encoding = 'utf8'\n length = this.length\n offset = 0\n // Buffer#write(string, encoding)\n } else if (length === undefined && typeof offset === 'string') {\n encoding = offset\n length = this.length\n offset = 0\n // Buffer#write(string, offset[, length][, encoding])\n } else if (isFinite(offset)) {\n offset = offset >>> 0\n if (isFinite(length)) {\n length = length >>> 0\n if (encoding === undefined) encoding = 'utf8'\n } else {\n encoding = length\n length = undefined\n }\n } else {\n throw new Error(\n 'Buffer.write(string, encoding, offset[, length]) is no longer supported'\n )\n }\n\n var remaining = this.length - offset\n if (length === undefined || length > remaining) length = remaining\n\n if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) {\n throw new RangeError('Attempt to write outside buffer bounds')\n }\n\n if (!encoding) encoding = 'utf8'\n\n var loweredCase = false\n for (;;) {\n switch (encoding) {\n case 'hex':\n return hexWrite(this, string, offset, length)\n\n case 'utf8':\n case 'utf-8':\n return utf8Write(this, string, offset, length)\n\n case 'ascii':\n case 'latin1':\n case 'binary':\n return asciiWrite(this, string, offset, length)\n\n case 'base64':\n // Warning: maxLength not taken into account in base64Write\n return base64Write(this, string, offset, length)\n\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return ucs2Write(this, string, offset, length)\n\n default:\n if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)\n encoding = ('' + encoding).toLowerCase()\n loweredCase = true\n }\n }\n}\n\nBuffer.prototype.toJSON = function toJSON () {\n return {\n type: 'Buffer',\n data: Array.prototype.slice.call(this._arr || this, 0)\n }\n}\n\nfunction base64Slice (buf, start, end) {\n if (start === 0 && end === buf.length) {\n return base64.fromByteArray(buf)\n } else {\n return base64.fromByteArray(buf.slice(start, end))\n }\n}\n\nfunction utf8Slice (buf, start, end) {\n end = Math.min(buf.length, end)\n var res = []\n\n var i = start\n while (i < end) {\n var firstByte = buf[i]\n var codePoint = null\n var bytesPerSequence = (firstByte > 0xEF)\n ? 4\n : (firstByte > 0xDF)\n ? 3\n : (firstByte > 0xBF)\n ? 2\n : 1\n\n if (i + bytesPerSequence <= end) {\n var secondByte, thirdByte, fourthByte, tempCodePoint\n\n switch (bytesPerSequence) {\n case 1:\n if (firstByte < 0x80) {\n codePoint = firstByte\n }\n break\n case 2:\n secondByte = buf[i + 1]\n if ((secondByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F)\n if (tempCodePoint > 0x7F) {\n codePoint = tempCodePoint\n }\n }\n break\n case 3:\n secondByte = buf[i + 1]\n thirdByte = buf[i + 2]\n if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F)\n if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) {\n codePoint = tempCodePoint\n }\n }\n break\n case 4:\n secondByte = buf[i + 1]\n thirdByte = buf[i + 2]\n fourthByte = buf[i + 3]\n if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F)\n if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) {\n codePoint = tempCodePoint\n }\n }\n }\n }\n\n if (codePoint === null) {\n // we did not generate a valid codePoint so insert a\n // replacement char (U+FFFD) and advance only 1 byte\n codePoint = 0xFFFD\n bytesPerSequence = 1\n } else if (codePoint > 0xFFFF) {\n // encode to utf16 (surrogate pair dance)\n codePoint -= 0x10000\n res.push(codePoint >>> 10 & 0x3FF | 0xD800)\n codePoint = 0xDC00 | codePoint & 0x3FF\n }\n\n res.push(codePoint)\n i += bytesPerSequence\n }\n\n return decodeCodePointsArray(res)\n}\n\n// Based on http://stackoverflow.com/a/22747272/680742, the browser with\n// the lowest limit is Chrome, with 0x10000 args.\n// We go 1 magnitude less, for safety\nvar MAX_ARGUMENTS_LENGTH = 0x1000\n\nfunction decodeCodePointsArray (codePoints) {\n var len = codePoints.length\n if (len <= MAX_ARGUMENTS_LENGTH) {\n return String.fromCharCode.apply(String, codePoints) // avoid extra slice()\n }\n\n // Decode in chunks to avoid \"call stack size exceeded\".\n var res = ''\n var i = 0\n while (i < len) {\n res += String.fromCharCode.apply(\n String,\n codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)\n )\n }\n return res\n}\n\nfunction asciiSlice (buf, start, end) {\n var ret = ''\n end = Math.min(buf.length, end)\n\n for (var i = start; i < end; ++i) {\n ret += String.fromCharCode(buf[i] & 0x7F)\n }\n return ret\n}\n\nfunction latin1Slice (buf, start, end) {\n var ret = ''\n end = Math.min(buf.length, end)\n\n for (var i = start; i < end; ++i) {\n ret += String.fromCharCode(buf[i])\n }\n return ret\n}\n\nfunction hexSlice (buf, start, end) {\n var len = buf.length\n\n if (!start || start < 0) start = 0\n if (!end || end < 0 || end > len) end = len\n\n var out = ''\n for (var i = start; i < end; ++i) {\n out += hexSliceLookupTable[buf[i]]\n }\n return out\n}\n\nfunction utf16leSlice (buf, start, end) {\n var bytes = buf.slice(start, end)\n var res = ''\n // If bytes.length is odd, the last 8 bits must be ignored (same as node.js)\n for (var i = 0; i < bytes.length - 1; i += 2) {\n res += String.fromCharCode(bytes[i] + (bytes[i + 1] * 256))\n }\n return res\n}\n\nBuffer.prototype.slice = function slice (start, end) {\n var len = this.length\n start = ~~start\n end = end === undefined ? len : ~~end\n\n if (start < 0) {\n start += len\n if (start < 0) start = 0\n } else if (start > len) {\n start = len\n }\n\n if (end < 0) {\n end += len\n if (end < 0) end = 0\n } else if (end > len) {\n end = len\n }\n\n if (end < start) end = start\n\n var newBuf = this.subarray(start, end)\n // Return an augmented `Uint8Array` instance\n Object.setPrototypeOf(newBuf, Buffer.prototype)\n\n return newBuf\n}\n\n/*\n * Need to make sure that buffer isn't trying to write out of bounds.\n */\nfunction checkOffset (offset, ext, length) {\n if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n}\n\nBuffer.prototype.readUintLE =\nBuffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) {\n offset = offset >>> 0\n byteLength = byteLength >>> 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n var val = this[offset]\n var mul = 1\n var i = 0\n while (++i < byteLength && (mul *= 0x100)) {\n val += this[offset + i] * mul\n }\n\n return val\n}\n\nBuffer.prototype.readUintBE =\nBuffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) {\n offset = offset >>> 0\n byteLength = byteLength >>> 0\n if (!noAssert) {\n checkOffset(offset, byteLength, this.length)\n }\n\n var val = this[offset + --byteLength]\n var mul = 1\n while (byteLength > 0 && (mul *= 0x100)) {\n val += this[offset + --byteLength] * mul\n }\n\n return val\n}\n\nBuffer.prototype.readUint8 =\nBuffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 1, this.length)\n return this[offset]\n}\n\nBuffer.prototype.readUint16LE =\nBuffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 2, this.length)\n return this[offset] | (this[offset + 1] << 8)\n}\n\nBuffer.prototype.readUint16BE =\nBuffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 2, this.length)\n return (this[offset] << 8) | this[offset + 1]\n}\n\nBuffer.prototype.readUint32LE =\nBuffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return ((this[offset]) |\n (this[offset + 1] << 8) |\n (this[offset + 2] << 16)) +\n (this[offset + 3] * 0x1000000)\n}\n\nBuffer.prototype.readUint32BE =\nBuffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset] * 0x1000000) +\n ((this[offset + 1] << 16) |\n (this[offset + 2] << 8) |\n this[offset + 3])\n}\n\nBuffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) {\n offset = offset >>> 0\n byteLength = byteLength >>> 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n var val = this[offset]\n var mul = 1\n var i = 0\n while (++i < byteLength && (mul *= 0x100)) {\n val += this[offset + i] * mul\n }\n mul *= 0x80\n\n if (val >= mul) val -= Math.pow(2, 8 * byteLength)\n\n return val\n}\n\nBuffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) {\n offset = offset >>> 0\n byteLength = byteLength >>> 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n var i = byteLength\n var mul = 1\n var val = this[offset + --i]\n while (i > 0 && (mul *= 0x100)) {\n val += this[offset + --i] * mul\n }\n mul *= 0x80\n\n if (val >= mul) val -= Math.pow(2, 8 * byteLength)\n\n return val\n}\n\nBuffer.prototype.readInt8 = function readInt8 (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 1, this.length)\n if (!(this[offset] & 0x80)) return (this[offset])\n return ((0xff - this[offset] + 1) * -1)\n}\n\nBuffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 2, this.length)\n var val = this[offset] | (this[offset + 1] << 8)\n return (val & 0x8000) ? val | 0xFFFF0000 : val\n}\n\nBuffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 2, this.length)\n var val = this[offset + 1] | (this[offset] << 8)\n return (val & 0x8000) ? val | 0xFFFF0000 : val\n}\n\nBuffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset]) |\n (this[offset + 1] << 8) |\n (this[offset + 2] << 16) |\n (this[offset + 3] << 24)\n}\n\nBuffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset] << 24) |\n (this[offset + 1] << 16) |\n (this[offset + 2] << 8) |\n (this[offset + 3])\n}\n\nBuffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 4, this.length)\n return ieee754.read(this, offset, true, 23, 4)\n}\n\nBuffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 4, this.length)\n return ieee754.read(this, offset, false, 23, 4)\n}\n\nBuffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 8, this.length)\n return ieee754.read(this, offset, true, 52, 8)\n}\n\nBuffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 8, this.length)\n return ieee754.read(this, offset, false, 52, 8)\n}\n\nfunction checkInt (buf, value, offset, ext, max, min) {\n if (!Buffer.isBuffer(buf)) throw new TypeError('\"buffer\" argument must be a Buffer instance')\n if (value > max || value < min) throw new RangeError('\"value\" argument is out of bounds')\n if (offset + ext > buf.length) throw new RangeError('Index out of range')\n}\n\nBuffer.prototype.writeUintLE =\nBuffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset >>> 0\n byteLength = byteLength >>> 0\n if (!noAssert) {\n var maxBytes = Math.pow(2, 8 * byteLength) - 1\n checkInt(this, value, offset, byteLength, maxBytes, 0)\n }\n\n var mul = 1\n var i = 0\n this[offset] = value & 0xFF\n while (++i < byteLength && (mul *= 0x100)) {\n this[offset + i] = (value / mul) & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeUintBE =\nBuffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset >>> 0\n byteLength = byteLength >>> 0\n if (!noAssert) {\n var maxBytes = Math.pow(2, 8 * byteLength) - 1\n checkInt(this, value, offset, byteLength, maxBytes, 0)\n }\n\n var i = byteLength - 1\n var mul = 1\n this[offset + i] = value & 0xFF\n while (--i >= 0 && (mul *= 0x100)) {\n this[offset + i] = (value / mul) & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeUint8 =\nBuffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0)\n this[offset] = (value & 0xff)\n return offset + 1\n}\n\nBuffer.prototype.writeUint16LE =\nBuffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n return offset + 2\n}\n\nBuffer.prototype.writeUint16BE =\nBuffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)\n this[offset] = (value >>> 8)\n this[offset + 1] = (value & 0xff)\n return offset + 2\n}\n\nBuffer.prototype.writeUint32LE =\nBuffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)\n this[offset + 3] = (value >>> 24)\n this[offset + 2] = (value >>> 16)\n this[offset + 1] = (value >>> 8)\n this[offset] = (value & 0xff)\n return offset + 4\n}\n\nBuffer.prototype.writeUint32BE =\nBuffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)\n this[offset] = (value >>> 24)\n this[offset + 1] = (value >>> 16)\n this[offset + 2] = (value >>> 8)\n this[offset + 3] = (value & 0xff)\n return offset + 4\n}\n\nBuffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) {\n var limit = Math.pow(2, (8 * byteLength) - 1)\n\n checkInt(this, value, offset, byteLength, limit - 1, -limit)\n }\n\n var i = 0\n var mul = 1\n var sub = 0\n this[offset] = value & 0xFF\n while (++i < byteLength && (mul *= 0x100)) {\n if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) {\n sub = 1\n }\n this[offset + i] = ((value / mul) >> 0) - sub & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) {\n var limit = Math.pow(2, (8 * byteLength) - 1)\n\n checkInt(this, value, offset, byteLength, limit - 1, -limit)\n }\n\n var i = byteLength - 1\n var mul = 1\n var sub = 0\n this[offset + i] = value & 0xFF\n while (--i >= 0 && (mul *= 0x100)) {\n if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) {\n sub = 1\n }\n this[offset + i] = ((value / mul) >> 0) - sub & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80)\n if (value < 0) value = 0xff + value + 1\n this[offset] = (value & 0xff)\n return offset + 1\n}\n\nBuffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n return offset + 2\n}\n\nBuffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)\n this[offset] = (value >>> 8)\n this[offset + 1] = (value & 0xff)\n return offset + 2\n}\n\nBuffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n this[offset + 2] = (value >>> 16)\n this[offset + 3] = (value >>> 24)\n return offset + 4\n}\n\nBuffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)\n if (value < 0) value = 0xffffffff + value + 1\n this[offset] = (value >>> 24)\n this[offset + 1] = (value >>> 16)\n this[offset + 2] = (value >>> 8)\n this[offset + 3] = (value & 0xff)\n return offset + 4\n}\n\nfunction checkIEEE754 (buf, value, offset, ext, max, min) {\n if (offset + ext > buf.length) throw new RangeError('Index out of range')\n if (offset < 0) throw new RangeError('Index out of range')\n}\n\nfunction writeFloat (buf, value, offset, littleEndian, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) {\n checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38)\n }\n ieee754.write(buf, value, offset, littleEndian, 23, 4)\n return offset + 4\n}\n\nBuffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) {\n return writeFloat(this, value, offset, true, noAssert)\n}\n\nBuffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) {\n return writeFloat(this, value, offset, false, noAssert)\n}\n\nfunction writeDouble (buf, value, offset, littleEndian, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) {\n checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308)\n }\n ieee754.write(buf, value, offset, littleEndian, 52, 8)\n return offset + 8\n}\n\nBuffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) {\n return writeDouble(this, value, offset, true, noAssert)\n}\n\nBuffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) {\n return writeDouble(this, value, offset, false, noAssert)\n}\n\n// copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)\nBuffer.prototype.copy = function copy (target, targetStart, start, end) {\n if (!Buffer.isBuffer(target)) throw new TypeError('argument should be a Buffer')\n if (!start) start = 0\n if (!end && end !== 0) end = this.length\n if (targetStart >= target.length) targetStart = target.length\n if (!targetStart) targetStart = 0\n if (end > 0 && end < start) end = start\n\n // Copy 0 bytes; we're done\n if (end === start) return 0\n if (target.length === 0 || this.length === 0) return 0\n\n // Fatal error conditions\n if (targetStart < 0) {\n throw new RangeError('targetStart out of bounds')\n }\n if (start < 0 || start >= this.length) throw new RangeError('Index out of range')\n if (end < 0) throw new RangeError('sourceEnd out of bounds')\n\n // Are we oob?\n if (end > this.length) end = this.length\n if (target.length - targetStart < end - start) {\n end = target.length - targetStart + start\n }\n\n var len = end - start\n\n if (this === target && typeof Uint8Array.prototype.copyWithin === 'function') {\n // Use built-in when available, missing from IE11\n this.copyWithin(targetStart, start, end)\n } else {\n Uint8Array.prototype.set.call(\n target,\n this.subarray(start, end),\n targetStart\n )\n }\n\n return len\n}\n\n// Usage:\n// buffer.fill(number[, offset[, end]])\n// buffer.fill(buffer[, offset[, end]])\n// buffer.fill(string[, offset[, end]][, encoding])\nBuffer.prototype.fill = function fill (val, start, end, encoding) {\n // Handle string cases:\n if (typeof val === 'string') {\n if (typeof start === 'string') {\n encoding = start\n start = 0\n end = this.length\n } else if (typeof end === 'string') {\n encoding = end\n end = this.length\n }\n if (encoding !== undefined && typeof encoding !== 'string') {\n throw new TypeError('encoding must be a string')\n }\n if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) {\n throw new TypeError('Unknown encoding: ' + encoding)\n }\n if (val.length === 1) {\n var code = val.charCodeAt(0)\n if ((encoding === 'utf8' && code < 128) ||\n encoding === 'latin1') {\n // Fast path: If `val` fits into a single byte, use that numeric value.\n val = code\n }\n }\n } else if (typeof val === 'number') {\n val = val & 255\n } else if (typeof val === 'boolean') {\n val = Number(val)\n }\n\n // Invalid ranges are not set to a default, so can range check early.\n if (start < 0 || this.length < start || this.length < end) {\n throw new RangeError('Out of range index')\n }\n\n if (end <= start) {\n return this\n }\n\n start = start >>> 0\n end = end === undefined ? this.length : end >>> 0\n\n if (!val) val = 0\n\n var i\n if (typeof val === 'number') {\n for (i = start; i < end; ++i) {\n this[i] = val\n }\n } else {\n var bytes = Buffer.isBuffer(val)\n ? val\n : Buffer.from(val, encoding)\n var len = bytes.length\n if (len === 0) {\n throw new TypeError('The value \"' + val +\n '\" is invalid for argument \"value\"')\n }\n for (i = 0; i < end - start; ++i) {\n this[i + start] = bytes[i % len]\n }\n }\n\n return this\n}\n\n// HELPER FUNCTIONS\n// ================\n\nvar INVALID_BASE64_RE = /[^+/0-9A-Za-z-_]/g\n\nfunction base64clean (str) {\n // Node takes equal signs as end of the Base64 encoding\n str = str.split('=')[0]\n // Node strips out invalid characters like \\n and \\t from the string, base64-js does not\n str = str.trim().replace(INVALID_BASE64_RE, '')\n // Node converts strings with length < 2 to ''\n if (str.length < 2) return ''\n // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not\n while (str.length % 4 !== 0) {\n str = str + '='\n }\n return str\n}\n\nfunction utf8ToBytes (string, units) {\n units = units || Infinity\n var codePoint\n var length = string.length\n var leadSurrogate = null\n var bytes = []\n\n for (var i = 0; i < length; ++i) {\n codePoint = string.charCodeAt(i)\n\n // is surrogate component\n if (codePoint > 0xD7FF && codePoint < 0xE000) {\n // last char was a lead\n if (!leadSurrogate) {\n // no lead yet\n if (codePoint > 0xDBFF) {\n // unexpected trail\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n continue\n } else if (i + 1 === length) {\n // unpaired lead\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n continue\n }\n\n // valid lead\n leadSurrogate = codePoint\n\n continue\n }\n\n // 2 leads in a row\n if (codePoint < 0xDC00) {\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n leadSurrogate = codePoint\n continue\n }\n\n // valid surrogate pair\n codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000\n } else if (leadSurrogate) {\n // valid bmp char, but last char was a lead\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n }\n\n leadSurrogate = null\n\n // encode utf8\n if (codePoint < 0x80) {\n if ((units -= 1) < 0) break\n bytes.push(codePoint)\n } else if (codePoint < 0x800) {\n if ((units -= 2) < 0) break\n bytes.push(\n codePoint >> 0x6 | 0xC0,\n codePoint & 0x3F | 0x80\n )\n } else if (codePoint < 0x10000) {\n if ((units -= 3) < 0) break\n bytes.push(\n codePoint >> 0xC | 0xE0,\n codePoint >> 0x6 & 0x3F | 0x80,\n codePoint & 0x3F | 0x80\n )\n } else if (codePoint < 0x110000) {\n if ((units -= 4) < 0) break\n bytes.push(\n codePoint >> 0x12 | 0xF0,\n codePoint >> 0xC & 0x3F | 0x80,\n codePoint >> 0x6 & 0x3F | 0x80,\n codePoint & 0x3F | 0x80\n )\n } else {\n throw new Error('Invalid code point')\n }\n }\n\n return bytes\n}\n\nfunction asciiToBytes (str) {\n var byteArray = []\n for (var i = 0; i < str.length; ++i) {\n // Node's code seems to be doing this and not & 0x7F..\n byteArray.push(str.charCodeAt(i) & 0xFF)\n }\n return byteArray\n}\n\nfunction utf16leToBytes (str, units) {\n var c, hi, lo\n var byteArray = []\n for (var i = 0; i < str.length; ++i) {\n if ((units -= 2) < 0) break\n\n c = str.charCodeAt(i)\n hi = c >> 8\n lo = c % 256\n byteArray.push(lo)\n byteArray.push(hi)\n }\n\n return byteArray\n}\n\nfunction base64ToBytes (str) {\n return base64.toByteArray(base64clean(str))\n}\n\nfunction blitBuffer (src, dst, offset, length) {\n for (var i = 0; i < length; ++i) {\n if ((i + offset >= dst.length) || (i >= src.length)) break\n dst[i + offset] = src[i]\n }\n return i\n}\n\n// ArrayBuffer or Uint8Array objects from other contexts (i.e. iframes) do not pass\n// the `instanceof` check but they should be treated as of that type.\n// See: https://github.com/feross/buffer/issues/166\nfunction isInstance (obj, type) {\n return obj instanceof type ||\n (obj != null && obj.constructor != null && obj.constructor.name != null &&\n obj.constructor.name === type.name)\n}\nfunction numberIsNaN (obj) {\n // For IE11 support\n return obj !== obj // eslint-disable-line no-self-compare\n}\n\n// Create lookup table for `toString('hex')`\n// See: https://github.com/feross/buffer/issues/219\nvar hexSliceLookupTable = (function () {\n var alphabet = '0123456789abcdef'\n var table = new Array(256)\n for (var i = 0; i < 16; ++i) {\n var i16 = i * 16\n for (var j = 0; j < 16; ++j) {\n table[i16 + j] = alphabet[i] + alphabet[j]\n }\n }\n return table\n})()\n","/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport function __createBinding(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n}\r\n\r\nexport function __exportStar(m, exports) {\r\n for (var p in m) if (p !== \"default\" && !exports.hasOwnProperty(p)) exports[p] = m[p];\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n};\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\r\n result.default = mod;\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, privateMap) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to get private field on non-instance\");\r\n }\r\n return privateMap.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, privateMap, value) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to set private field on non-instance\");\r\n }\r\n privateMap.set(receiver, value);\r\n return value;\r\n}\r\n",null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],"names":["byteLength","toByteArray","fromByteArray","lookup","revLookup","Arr","Uint8Array","Array","code","i","len","length","charCodeAt","getLens","b64","Error","validLen","indexOf","placeHoldersLen","lens","_byteLength","tmp","arr","curByte","tripletToBase64","num","encodeChunk","uint8","start","end","output","push","join","extraBytes","parts","maxChunkLength","len2","buffer","offset","isLE","mLen","nBytes","e","m","eLen","eMax","eBias","nBits","d","s","NaN","Infinity","Math","pow","value","c","rt","abs","isNaN","floor","log","LN2","customInspectSymbol","Symbol","exports","Buffer","SlowBuffer","K_MAX_LENGTH","TYPED_ARRAY_SUPPORT","typedArraySupport","console","error","proto","foo","Object","setPrototypeOf","prototype","defineProperty","enumerable","get","isBuffer","undefined","byteOffset","createBuffer","RangeError","buf","arg","encodingOrOffset","TypeError","allocUnsafe","from","poolSize","fromString","ArrayBuffer","isView","fromArrayView","isInstance","fromArrayBuffer","SharedArrayBuffer","valueOf","b","fromObject","toPrimitive","assertSize","size","alloc","fill","encoding","checked","allocUnsafeSlow","string","isEncoding","actual","write","slice","fromArrayLike","array","arrayView","copy","obj","numberIsNaN","type","isArray","data","toString","_isBuffer","compare","a","x","y","min","String","toLowerCase","concat","list","pos","set","call","mustMatch","arguments","loweredCase","utf8ToBytes","base64ToBytes","slowToString","hexSlice","utf8Slice","asciiSlice","latin1Slice","base64Slice","utf16leSlice","swap","n","swap16","swap32","swap64","apply","toLocaleString","equals","inspect","str","max","INSPECT_MAX_BYTES","replace","trim","target","thisStart","thisEnd","thisCopy","targetCopy","bidirectionalIndexOf","val","dir","arrayIndexOf","lastIndexOf","indexSize","arrLength","valLength","read","readUInt16BE","foundIndex","found","j","includes","hexWrite","Number","remaining","strLen","parsed","parseInt","substr","utf8Write","blitBuffer","asciiWrite","asciiToBytes","base64Write","ucs2Write","utf16leToBytes","isFinite","toJSON","_arr","base64","res","firstByte","codePoint","bytesPerSequence","secondByte","thirdByte","fourthByte","tempCodePoint","decodeCodePointsArray","MAX_ARGUMENTS_LENGTH","codePoints","fromCharCode","ret","out","hexSliceLookupTable","bytes","newBuf","subarray","checkOffset","ext","readUintLE","readUIntLE","noAssert","mul","readUintBE","readUIntBE","readUint8","readUInt8","readUint16LE","readUInt16LE","readUint16BE","readUint32LE","readUInt32LE","readUint32BE","readUInt32BE","readIntLE","readIntBE","readInt8","readInt16LE","readInt16BE","readInt32LE","readInt32BE","readFloatLE","ieee754","readFloatBE","readDoubleLE","readDoubleBE","checkInt","writeUintLE","writeUIntLE","maxBytes","writeUintBE","writeUIntBE","writeUint8","writeUInt8","writeUint16LE","writeUInt16LE","writeUint16BE","writeUInt16BE","writeUint32LE","writeUInt32LE","writeUint32BE","writeUInt32BE","writeIntLE","limit","sub","writeIntBE","writeInt8","writeInt16LE","writeInt16BE","writeInt32LE","writeInt32BE","checkIEEE754","writeFloat","littleEndian","writeFloatLE","writeFloatBE","writeDouble","writeDoubleLE","writeDoubleBE","targetStart","copyWithin","INVALID_BASE64_RE","base64clean","split","units","leadSurrogate","byteArray","hi","lo","src","dst","constructor","name","alphabet","table","i16","extendStatics","__proto__","p","hasOwnProperty","__extends","__","create","__assign","assign","t","kId","BSON_INT32_MAX","BSON_INT32_MIN","BSON_INT64_MAX","BSON_INT64_MIN","EJSON","bsonMap","calculateObjectSize","constants.JS_INT_MIN","constants.JS_INT_MAX","constants.BSON_INT32_MIN","constants.BSON_INT32_MAX","deserialize","constants.BSON_DATA_STRING","constants.BSON_DATA_OID","constants.BSON_DATA_INT","constants.BSON_DATA_NUMBER","constants.BSON_DATA_DATE","constants.BSON_DATA_BOOLEAN","constants.BSON_DATA_OBJECT","constants.BSON_DATA_ARRAY","constants.BSON_DATA_UNDEFINED","constants.BSON_DATA_NULL","constants.BSON_DATA_LONG","constants.BSON_DATA_DECIMAL128","constants.BSON_DATA_BINARY","constants.BSON_DATA_REGEXP","constants.BSON_DATA_SYMBOL","constants.BSON_DATA_TIMESTAMP","constants.BSON_DATA_MIN_KEY","constants.BSON_DATA_MAX_KEY","constants.BSON_DATA_CODE","constants.BSON_DATA_CODE_W_SCOPE","constants.BSON_DATA_DBPOINTER","constants.BSON_BINARY_SUBTYPE_DEFAULT","Map","internalSerialize","internalDeserialize","internalCalculateObjectSize"],"mappings":";;;;;;;CAEA,gBAAkB,GAAGA,UAArB;CACA,iBAAmB,GAAGC,WAAtB;CACA,mBAAqB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AA;KACJ,KAAK,OAAA;KACL,UAAU,YAAA;KACV,MAAM,QAAA;KACN,KAAK,OAAA;KACL,IAAI,MAAA;KACJ,IAAI,MAAA;KACJ,GAAG,aAAA;KACH,MAAM,QAAA;KACN,MAAM,QAAA;KACN,QAAQ,UAAA;KACR,QAAQ,EAAE,QAAQ;KAClB,UAAU,YAAA;KACV,UAAU,YAAA;KACV,SAAS,WAAA;KACT,KAAK,eAAA;KACL,qBAAqB,uBAAA;KACrB,SAAS,WAAA;KACT,2BAA2B,6BAAA;KAC3B,WAAW,aAAA;KACX,mBAAmB,qBAAA;KACnB,iBAAiB,mBAAA;KACjB,SAAS,WAAA;KACT,aAAa,eAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/node_modules/bson/dist/bson.esm.js b/node_modules/bson/dist/bson.esm.js new file mode 100644 index 000000000..5d82f83ac --- /dev/null +++ b/node_modules/bson/dist/bson.esm.js @@ -0,0 +1,5488 @@ +import { Buffer } from 'buffer'; + +/*! ***************************************************************************** +Copyright (c) Microsoft Corporation. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. +***************************************************************************** */ + +/* global Reflect, Promise */ +var _extendStatics = function extendStatics(d, b) { + _extendStatics = Object.setPrototypeOf || { + __proto__: [] + } instanceof Array && function (d, b) { + d.__proto__ = b; + } || function (d, b) { + for (var p in b) { + if (b.hasOwnProperty(p)) d[p] = b[p]; + } + }; + + return _extendStatics(d, b); +}; + +function __extends(d, b) { + _extendStatics(d, b); + + function __() { + this.constructor = d; + } + + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +} + +var _assign = function __assign() { + _assign = Object.assign || function __assign(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + + for (var p in s) { + if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; + } + } + + return t; + }; + + return _assign.apply(this, arguments); +}; + +/** @public */ +var BSONError = /** @class */ (function (_super) { + __extends(BSONError, _super); + function BSONError(message) { + var _this = _super.call(this, message) || this; + Object.setPrototypeOf(_this, BSONError.prototype); + return _this; + } + Object.defineProperty(BSONError.prototype, "name", { + get: function () { + return 'BSONError'; + }, + enumerable: false, + configurable: true + }); + return BSONError; +}(Error)); +/** @public */ +var BSONTypeError = /** @class */ (function (_super) { + __extends(BSONTypeError, _super); + function BSONTypeError(message) { + var _this = _super.call(this, message) || this; + Object.setPrototypeOf(_this, BSONTypeError.prototype); + return _this; + } + Object.defineProperty(BSONTypeError.prototype, "name", { + get: function () { + return 'BSONTypeError'; + }, + enumerable: false, + configurable: true + }); + return BSONTypeError; +}(TypeError)); + +function checkForMath(potentialGlobal) { + // eslint-disable-next-line eqeqeq + return potentialGlobal && potentialGlobal.Math == Math && potentialGlobal; +} +// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028 +function getGlobal() { + // eslint-disable-next-line no-undef + return (checkForMath(typeof globalThis === 'object' && globalThis) || + checkForMath(typeof window === 'object' && window) || + checkForMath(typeof self === 'object' && self) || + checkForMath(typeof global === 'object' && global) || + Function('return this')()); +} + +/** + * Normalizes our expected stringified form of a function across versions of node + * @param fn - The function to stringify + */ +function normalizedFunctionString(fn) { + return fn.toString().replace('function(', 'function ('); +} +function isReactNative() { + var g = getGlobal(); + return typeof g.navigator === 'object' && g.navigator.product === 'ReactNative'; +} +var insecureRandomBytes = function insecureRandomBytes(size) { + var insecureWarning = isReactNative() + ? 'BSON: For React Native please polyfill crypto.getRandomValues, e.g. using: https://www.npmjs.com/package/react-native-get-random-values.' + : 'BSON: No cryptographic implementation for random bytes present, falling back to a less secure implementation.'; + console.warn(insecureWarning); + var result = Buffer.alloc(size); + for (var i = 0; i < size; ++i) + result[i] = Math.floor(Math.random() * 256); + return result; +}; +var detectRandomBytes = function () { + if (typeof window !== 'undefined') { + // browser crypto implementation(s) + var target_1 = window.crypto || window.msCrypto; // allow for IE11 + if (target_1 && target_1.getRandomValues) { + return function (size) { return target_1.getRandomValues(Buffer.alloc(size)); }; + } + } + if (typeof global !== 'undefined' && global.crypto && global.crypto.getRandomValues) { + // allow for RN packages such as https://www.npmjs.com/package/react-native-get-random-values to populate global + return function (size) { return global.crypto.getRandomValues(Buffer.alloc(size)); }; + } + var requiredRandomBytes; + try { + // eslint-disable-next-line @typescript-eslint/no-var-requires + requiredRandomBytes = require('crypto').randomBytes; + } + catch (e) { + // keep the fallback + } + // NOTE: in transpiled cases the above require might return null/undefined + return requiredRandomBytes || insecureRandomBytes; +}; +var randomBytes = detectRandomBytes(); +function isAnyArrayBuffer(value) { + return ['[object ArrayBuffer]', '[object SharedArrayBuffer]'].includes(Object.prototype.toString.call(value)); +} +function isUint8Array(value) { + return Object.prototype.toString.call(value) === '[object Uint8Array]'; +} +function isBigInt64Array(value) { + return Object.prototype.toString.call(value) === '[object BigInt64Array]'; +} +function isBigUInt64Array(value) { + return Object.prototype.toString.call(value) === '[object BigUint64Array]'; +} +function isRegExp(d) { + return Object.prototype.toString.call(d) === '[object RegExp]'; +} +function isMap(d) { + return Object.prototype.toString.call(d) === '[object Map]'; +} +// To ensure that 0.4 of node works correctly +function isDate(d) { + return isObjectLike(d) && Object.prototype.toString.call(d) === '[object Date]'; +} +/** + * @internal + * this is to solve the `'someKey' in x` problem where x is unknown. + * https://github.com/typescript-eslint/typescript-eslint/issues/1071#issuecomment-541955753 + */ +function isObjectLike(candidate) { + return typeof candidate === 'object' && candidate !== null; +} +function deprecate(fn, message) { + var warned = false; + function deprecated() { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + if (!warned) { + console.warn(message); + warned = true; + } + return fn.apply(this, args); + } + return deprecated; +} + +/** + * Makes sure that, if a Uint8Array is passed in, it is wrapped in a Buffer. + * + * @param potentialBuffer - The potential buffer + * @returns Buffer the input if potentialBuffer is a buffer, or a buffer that + * wraps a passed in Uint8Array + * @throws BSONTypeError If anything other than a Buffer or Uint8Array is passed in + */ +function ensureBuffer(potentialBuffer) { + if (ArrayBuffer.isView(potentialBuffer)) { + return Buffer.from(potentialBuffer.buffer, potentialBuffer.byteOffset, potentialBuffer.byteLength); + } + if (isAnyArrayBuffer(potentialBuffer)) { + return Buffer.from(potentialBuffer); + } + throw new BSONTypeError('Must use either Buffer or TypedArray'); +} + +// Validation regex for v4 uuid (validates with or without dashes) +var VALIDATION_REGEX = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|[0-9a-f]{12}4[0-9a-f]{3}[89ab][0-9a-f]{15})$/i; +var uuidValidateString = function (str) { + return typeof str === 'string' && VALIDATION_REGEX.test(str); +}; +var uuidHexStringToBuffer = function (hexString) { + if (!uuidValidateString(hexString)) { + throw new BSONTypeError('UUID string representations must be a 32 or 36 character hex string (dashes excluded/included). Format: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" or "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx".'); + } + var sanitizedHexString = hexString.replace(/-/g, ''); + return Buffer.from(sanitizedHexString, 'hex'); +}; +var bufferToUuidHexString = function (buffer, includeDashes) { + if (includeDashes === void 0) { includeDashes = true; } + return includeDashes + ? buffer.toString('hex', 0, 4) + + '-' + + buffer.toString('hex', 4, 6) + + '-' + + buffer.toString('hex', 6, 8) + + '-' + + buffer.toString('hex', 8, 10) + + '-' + + buffer.toString('hex', 10, 16) + : buffer.toString('hex'); +}; + +var BYTE_LENGTH = 16; +var kId$1 = Symbol('id'); +/** + * A class representation of the BSON UUID type. + * @public + */ +var UUID = /** @class */ (function () { + /** + * Create an UUID type + * + * @param input - Can be a 32 or 36 character hex string (dashes excluded/included) or a 16 byte binary Buffer. + */ + function UUID(input) { + if (typeof input === 'undefined') { + // The most common use case (blank id, new UUID() instance) + this.id = UUID.generate(); + } + else if (input instanceof UUID) { + this[kId$1] = Buffer.from(input.id); + this.__id = input.__id; + } + else if (ArrayBuffer.isView(input) && input.byteLength === BYTE_LENGTH) { + this.id = ensureBuffer(input); + } + else if (typeof input === 'string') { + this.id = uuidHexStringToBuffer(input); + } + else { + throw new BSONTypeError('Argument passed in UUID constructor must be a UUID, a 16 byte Buffer or a 32/36 character hex string (dashes excluded/included, format: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx).'); + } + } + Object.defineProperty(UUID.prototype, "id", { + /** + * The UUID bytes + * @readonly + */ + get: function () { + return this[kId$1]; + }, + set: function (value) { + this[kId$1] = value; + if (UUID.cacheHexString) { + this.__id = bufferToUuidHexString(value); + } + }, + enumerable: false, + configurable: true + }); + /** + * Generate a 16 byte uuid v4 buffer used in UUIDs + */ + /** + * Returns the UUID id as a 32 or 36 character hex string representation, excluding/including dashes (defaults to 36 character dash separated) + * @param includeDashes - should the string exclude dash-separators. + * */ + UUID.prototype.toHexString = function (includeDashes) { + if (includeDashes === void 0) { includeDashes = true; } + if (UUID.cacheHexString && this.__id) { + return this.__id; + } + var uuidHexString = bufferToUuidHexString(this.id, includeDashes); + if (UUID.cacheHexString) { + this.__id = uuidHexString; + } + return uuidHexString; + }; + /** + * Converts the id into a 36 character (dashes included) hex string, unless a encoding is specified. + */ + UUID.prototype.toString = function (encoding) { + return encoding ? this.id.toString(encoding) : this.toHexString(); + }; + /** + * Converts the id into its JSON string representation. + * A 36 character (dashes included) hex string in the format: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx + */ + UUID.prototype.toJSON = function () { + return this.toHexString(); + }; + /** + * Compares the equality of this UUID with `otherID`. + * + * @param otherId - UUID instance to compare against. + */ + UUID.prototype.equals = function (otherId) { + if (!otherId) { + return false; + } + if (otherId instanceof UUID) { + return otherId.id.equals(this.id); + } + try { + return new UUID(otherId).id.equals(this.id); + } + catch (_a) { + return false; + } + }; + /** + * Creates a Binary instance from the current UUID. + */ + UUID.prototype.toBinary = function () { + return new Binary(this.id, Binary.SUBTYPE_UUID); + }; + /** + * Generates a populated buffer containing a v4 uuid + */ + UUID.generate = function () { + var bytes = randomBytes(BYTE_LENGTH); + // Per 4.4, set bits for version and `clock_seq_hi_and_reserved` + // Kindly borrowed from https://github.com/uuidjs/uuid/blob/master/src/v4.js + bytes[6] = (bytes[6] & 0x0f) | 0x40; + bytes[8] = (bytes[8] & 0x3f) | 0x80; + return Buffer.from(bytes); + }; + /** + * Checks if a value is a valid bson UUID + * @param input - UUID, string or Buffer to validate. + */ + UUID.isValid = function (input) { + if (!input) { + return false; + } + if (input instanceof UUID) { + return true; + } + if (typeof input === 'string') { + return uuidValidateString(input); + } + if (isUint8Array(input)) { + // check for length & uuid version (https://tools.ietf.org/html/rfc4122#section-4.1.3) + if (input.length !== BYTE_LENGTH) { + return false; + } + try { + // get this byte as hex: xxxxxxxx-xxxx-XXxx-xxxx-xxxxxxxxxxxx + // check first part as uuid version: xxxxxxxx-xxxx-Xxxx-xxxx-xxxxxxxxxxxx + return parseInt(input[6].toString(16)[0], 10) === Binary.SUBTYPE_UUID; + } + catch (_a) { + return false; + } + } + return false; + }; + /** + * Creates an UUID from a hex string representation of an UUID. + * @param hexString - 32 or 36 character hex string (dashes excluded/included). + */ + UUID.createFromHexString = function (hexString) { + var buffer = uuidHexStringToBuffer(hexString); + return new UUID(buffer); + }; + /** + * Converts to a string representation of this Id. + * + * @returns return the 36 character hex string representation. + * @internal + */ + UUID.prototype[Symbol.for('nodejs.util.inspect.custom')] = function () { + return this.inspect(); + }; + UUID.prototype.inspect = function () { + return "new UUID(\"" + this.toHexString() + "\")"; + }; + return UUID; +}()); +Object.defineProperty(UUID.prototype, '_bsontype', { value: 'UUID' }); + +/** + * A class representation of the BSON Binary type. + * @public + * @category BSONType + */ +var Binary = /** @class */ (function () { + /** + * @param buffer - a buffer object containing the binary data. + * @param subType - the option binary type. + */ + function Binary(buffer, subType) { + if (!(this instanceof Binary)) + return new Binary(buffer, subType); + if (!(buffer == null) && + !(typeof buffer === 'string') && + !ArrayBuffer.isView(buffer) && + !(buffer instanceof ArrayBuffer) && + !Array.isArray(buffer)) { + throw new BSONTypeError('Binary can only be constructed from string, Buffer, TypedArray, or Array'); + } + this.sub_type = subType !== null && subType !== void 0 ? subType : Binary.BSON_BINARY_SUBTYPE_DEFAULT; + if (buffer == null) { + // create an empty binary buffer + this.buffer = Buffer.alloc(Binary.BUFFER_SIZE); + this.position = 0; + } + else { + if (typeof buffer === 'string') { + // string + this.buffer = Buffer.from(buffer, 'binary'); + } + else if (Array.isArray(buffer)) { + // number[] + this.buffer = Buffer.from(buffer); + } + else { + // Buffer | TypedArray | ArrayBuffer + this.buffer = ensureBuffer(buffer); + } + this.position = this.buffer.byteLength; + } + } + /** + * Updates this binary with byte_value. + * + * @param byteValue - a single byte we wish to write. + */ + Binary.prototype.put = function (byteValue) { + // If it's a string and a has more than one character throw an error + if (typeof byteValue === 'string' && byteValue.length !== 1) { + throw new BSONTypeError('only accepts single character String'); + } + else if (typeof byteValue !== 'number' && byteValue.length !== 1) + throw new BSONTypeError('only accepts single character Uint8Array or Array'); + // Decode the byte value once + var decodedByte; + if (typeof byteValue === 'string') { + decodedByte = byteValue.charCodeAt(0); + } + else if (typeof byteValue === 'number') { + decodedByte = byteValue; + } + else { + decodedByte = byteValue[0]; + } + if (decodedByte < 0 || decodedByte > 255) { + throw new BSONTypeError('only accepts number in a valid unsigned byte range 0-255'); + } + if (this.buffer.length > this.position) { + this.buffer[this.position++] = decodedByte; + } + else { + var buffer = Buffer.alloc(Binary.BUFFER_SIZE + this.buffer.length); + // Combine the two buffers together + this.buffer.copy(buffer, 0, 0, this.buffer.length); + this.buffer = buffer; + this.buffer[this.position++] = decodedByte; + } + }; + /** + * Writes a buffer or string to the binary. + * + * @param sequence - a string or buffer to be written to the Binary BSON object. + * @param offset - specify the binary of where to write the content. + */ + Binary.prototype.write = function (sequence, offset) { + offset = typeof offset === 'number' ? offset : this.position; + // If the buffer is to small let's extend the buffer + if (this.buffer.length < offset + sequence.length) { + var buffer = Buffer.alloc(this.buffer.length + sequence.length); + this.buffer.copy(buffer, 0, 0, this.buffer.length); + // Assign the new buffer + this.buffer = buffer; + } + if (ArrayBuffer.isView(sequence)) { + this.buffer.set(ensureBuffer(sequence), offset); + this.position = + offset + sequence.byteLength > this.position ? offset + sequence.length : this.position; + } + else if (typeof sequence === 'string') { + this.buffer.write(sequence, offset, sequence.length, 'binary'); + this.position = + offset + sequence.length > this.position ? offset + sequence.length : this.position; + } + }; + /** + * Reads **length** bytes starting at **position**. + * + * @param position - read from the given position in the Binary. + * @param length - the number of bytes to read. + */ + Binary.prototype.read = function (position, length) { + length = length && length > 0 ? length : this.position; + // Let's return the data based on the type we have + return this.buffer.slice(position, position + length); + }; + /** + * Returns the value of this binary as a string. + * @param asRaw - Will skip converting to a string + * @remarks + * This is handy when calling this function conditionally for some key value pairs and not others + */ + Binary.prototype.value = function (asRaw) { + asRaw = !!asRaw; + // Optimize to serialize for the situation where the data == size of buffer + if (asRaw && this.buffer.length === this.position) { + return this.buffer; + } + // If it's a node.js buffer object + if (asRaw) { + return this.buffer.slice(0, this.position); + } + return this.buffer.toString('binary', 0, this.position); + }; + /** the length of the binary sequence */ + Binary.prototype.length = function () { + return this.position; + }; + Binary.prototype.toJSON = function () { + return this.buffer.toString('base64'); + }; + Binary.prototype.toString = function (format) { + return this.buffer.toString(format); + }; + /** @internal */ + Binary.prototype.toExtendedJSON = function (options) { + options = options || {}; + var base64String = this.buffer.toString('base64'); + var subType = Number(this.sub_type).toString(16); + if (options.legacy) { + return { + $binary: base64String, + $type: subType.length === 1 ? '0' + subType : subType + }; + } + return { + $binary: { + base64: base64String, + subType: subType.length === 1 ? '0' + subType : subType + } + }; + }; + Binary.prototype.toUUID = function () { + if (this.sub_type === Binary.SUBTYPE_UUID) { + return new UUID(this.buffer.slice(0, this.position)); + } + throw new BSONError("Binary sub_type \"" + this.sub_type + "\" is not supported for converting to UUID. Only \"" + Binary.SUBTYPE_UUID + "\" is currently supported."); + }; + /** @internal */ + Binary.fromExtendedJSON = function (doc, options) { + options = options || {}; + var data; + var type; + if ('$binary' in doc) { + if (options.legacy && typeof doc.$binary === 'string' && '$type' in doc) { + type = doc.$type ? parseInt(doc.$type, 16) : 0; + data = Buffer.from(doc.$binary, 'base64'); + } + else { + if (typeof doc.$binary !== 'string') { + type = doc.$binary.subType ? parseInt(doc.$binary.subType, 16) : 0; + data = Buffer.from(doc.$binary.base64, 'base64'); + } + } + } + else if ('$uuid' in doc) { + type = 4; + data = uuidHexStringToBuffer(doc.$uuid); + } + if (!data) { + throw new BSONTypeError("Unexpected Binary Extended JSON format " + JSON.stringify(doc)); + } + return new Binary(data, type); + }; + /** @internal */ + Binary.prototype[Symbol.for('nodejs.util.inspect.custom')] = function () { + return this.inspect(); + }; + Binary.prototype.inspect = function () { + var asBuffer = this.value(true); + return "new Binary(Buffer.from(\"" + asBuffer.toString('hex') + "\", \"hex\"), " + this.sub_type + ")"; + }; + /** + * Binary default subtype + * @internal + */ + Binary.BSON_BINARY_SUBTYPE_DEFAULT = 0; + /** Initial buffer default size */ + Binary.BUFFER_SIZE = 256; + /** Default BSON type */ + Binary.SUBTYPE_DEFAULT = 0; + /** Function BSON type */ + Binary.SUBTYPE_FUNCTION = 1; + /** Byte Array BSON type */ + Binary.SUBTYPE_BYTE_ARRAY = 2; + /** Deprecated UUID BSON type @deprecated Please use SUBTYPE_UUID */ + Binary.SUBTYPE_UUID_OLD = 3; + /** UUID BSON type */ + Binary.SUBTYPE_UUID = 4; + /** MD5 BSON type */ + Binary.SUBTYPE_MD5 = 5; + /** Encrypted BSON type */ + Binary.SUBTYPE_ENCRYPTED = 6; + /** Column BSON type */ + Binary.SUBTYPE_COLUMN = 7; + /** User BSON type */ + Binary.SUBTYPE_USER_DEFINED = 128; + return Binary; +}()); +Object.defineProperty(Binary.prototype, '_bsontype', { value: 'Binary' }); + +/** + * A class representation of the BSON Code type. + * @public + * @category BSONType + */ +var Code = /** @class */ (function () { + /** + * @param code - a string or function. + * @param scope - an optional scope for the function. + */ + function Code(code, scope) { + if (!(this instanceof Code)) + return new Code(code, scope); + this.code = code; + this.scope = scope; + } + Code.prototype.toJSON = function () { + return { code: this.code, scope: this.scope }; + }; + /** @internal */ + Code.prototype.toExtendedJSON = function () { + if (this.scope) { + return { $code: this.code, $scope: this.scope }; + } + return { $code: this.code }; + }; + /** @internal */ + Code.fromExtendedJSON = function (doc) { + return new Code(doc.$code, doc.$scope); + }; + /** @internal */ + Code.prototype[Symbol.for('nodejs.util.inspect.custom')] = function () { + return this.inspect(); + }; + Code.prototype.inspect = function () { + var codeJson = this.toJSON(); + return "new Code(\"" + codeJson.code + "\"" + (codeJson.scope ? ", " + JSON.stringify(codeJson.scope) : '') + ")"; + }; + return Code; +}()); +Object.defineProperty(Code.prototype, '_bsontype', { value: 'Code' }); + +/** @internal */ +function isDBRefLike(value) { + return (isObjectLike(value) && + value.$id != null && + typeof value.$ref === 'string' && + (value.$db == null || typeof value.$db === 'string')); +} +/** + * A class representation of the BSON DBRef type. + * @public + * @category BSONType + */ +var DBRef = /** @class */ (function () { + /** + * @param collection - the collection name. + * @param oid - the reference ObjectId. + * @param db - optional db name, if omitted the reference is local to the current db. + */ + function DBRef(collection, oid, db, fields) { + if (!(this instanceof DBRef)) + return new DBRef(collection, oid, db, fields); + // check if namespace has been provided + var parts = collection.split('.'); + if (parts.length === 2) { + db = parts.shift(); + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + collection = parts.shift(); + } + this.collection = collection; + this.oid = oid; + this.db = db; + this.fields = fields || {}; + } + Object.defineProperty(DBRef.prototype, "namespace", { + // Property provided for compatibility with the 1.x parser + // the 1.x parser used a "namespace" property, while 4.x uses "collection" + /** @internal */ + get: function () { + return this.collection; + }, + set: function (value) { + this.collection = value; + }, + enumerable: false, + configurable: true + }); + DBRef.prototype.toJSON = function () { + var o = Object.assign({ + $ref: this.collection, + $id: this.oid + }, this.fields); + if (this.db != null) + o.$db = this.db; + return o; + }; + /** @internal */ + DBRef.prototype.toExtendedJSON = function (options) { + options = options || {}; + var o = { + $ref: this.collection, + $id: this.oid + }; + if (options.legacy) { + return o; + } + if (this.db) + o.$db = this.db; + o = Object.assign(o, this.fields); + return o; + }; + /** @internal */ + DBRef.fromExtendedJSON = function (doc) { + var copy = Object.assign({}, doc); + delete copy.$ref; + delete copy.$id; + delete copy.$db; + return new DBRef(doc.$ref, doc.$id, doc.$db, copy); + }; + /** @internal */ + DBRef.prototype[Symbol.for('nodejs.util.inspect.custom')] = function () { + return this.inspect(); + }; + DBRef.prototype.inspect = function () { + // NOTE: if OID is an ObjectId class it will just print the oid string. + var oid = this.oid === undefined || this.oid.toString === undefined ? this.oid : this.oid.toString(); + return "new DBRef(\"" + this.namespace + "\", new ObjectId(\"" + oid + "\")" + (this.db ? ", \"" + this.db + "\"" : '') + ")"; + }; + return DBRef; +}()); +Object.defineProperty(DBRef.prototype, '_bsontype', { value: 'DBRef' }); + +/** + * wasm optimizations, to do native i64 multiplication and divide + */ +var wasm = undefined; +try { + wasm = new WebAssembly.Instance(new WebAssembly.Module( + // prettier-ignore + new Uint8Array([0, 97, 115, 109, 1, 0, 0, 0, 1, 13, 2, 96, 0, 1, 127, 96, 4, 127, 127, 127, 127, 1, 127, 3, 7, 6, 0, 1, 1, 1, 1, 1, 6, 6, 1, 127, 1, 65, 0, 11, 7, 50, 6, 3, 109, 117, 108, 0, 1, 5, 100, 105, 118, 95, 115, 0, 2, 5, 100, 105, 118, 95, 117, 0, 3, 5, 114, 101, 109, 95, 115, 0, 4, 5, 114, 101, 109, 95, 117, 0, 5, 8, 103, 101, 116, 95, 104, 105, 103, 104, 0, 0, 10, 191, 1, 6, 4, 0, 35, 0, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 126, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 127, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 128, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 129, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 130, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11])), {}).exports; +} +catch (_a) { + // no wasm support +} +var TWO_PWR_16_DBL = 1 << 16; +var TWO_PWR_24_DBL = 1 << 24; +var TWO_PWR_32_DBL = TWO_PWR_16_DBL * TWO_PWR_16_DBL; +var TWO_PWR_64_DBL = TWO_PWR_32_DBL * TWO_PWR_32_DBL; +var TWO_PWR_63_DBL = TWO_PWR_64_DBL / 2; +/** A cache of the Long representations of small integer values. */ +var INT_CACHE = {}; +/** A cache of the Long representations of small unsigned integer values. */ +var UINT_CACHE = {}; +/** + * A class representing a 64-bit integer + * @public + * @category BSONType + * @remarks + * The internal representation of a long is the two given signed, 32-bit values. + * We use 32-bit pieces because these are the size of integers on which + * Javascript performs bit-operations. For operations like addition and + * multiplication, we split each number into 16 bit pieces, which can easily be + * multiplied within Javascript's floating-point representation without overflow + * or change in sign. + * In the algorithms below, we frequently reduce the negative case to the + * positive case by negating the input(s) and then post-processing the result. + * Note that we must ALWAYS check specially whether those values are MIN_VALUE + * (-2^63) because -MIN_VALUE == MIN_VALUE (since 2^63 cannot be represented as + * a positive number, it overflows back into a negative). Not handling this + * case would often result in infinite recursion. + * Common constant values ZERO, ONE, NEG_ONE, etc. are found as static properties on this class. + */ +var Long = /** @class */ (function () { + /** + * Constructs a 64 bit two's-complement integer, given its low and high 32 bit values as *signed* integers. + * See the from* functions below for more convenient ways of constructing Longs. + * + * Acceptable signatures are: + * - Long(low, high, unsigned?) + * - Long(bigint, unsigned?) + * - Long(string, unsigned?) + * + * @param low - The low (signed) 32 bits of the long + * @param high - The high (signed) 32 bits of the long + * @param unsigned - Whether unsigned or not, defaults to signed + */ + function Long(low, high, unsigned) { + if (low === void 0) { low = 0; } + if (!(this instanceof Long)) + return new Long(low, high, unsigned); + if (typeof low === 'bigint') { + Object.assign(this, Long.fromBigInt(low, !!high)); + } + else if (typeof low === 'string') { + Object.assign(this, Long.fromString(low, !!high)); + } + else { + this.low = low | 0; + this.high = high | 0; + this.unsigned = !!unsigned; + } + Object.defineProperty(this, '__isLong__', { + value: true, + configurable: false, + writable: false, + enumerable: false + }); + } + /** + * Returns a Long representing the 64 bit integer that comes by concatenating the given low and high bits. + * Each is assumed to use 32 bits. + * @param lowBits - The low 32 bits + * @param highBits - The high 32 bits + * @param unsigned - Whether unsigned or not, defaults to signed + * @returns The corresponding Long value + */ + Long.fromBits = function (lowBits, highBits, unsigned) { + return new Long(lowBits, highBits, unsigned); + }; + /** + * Returns a Long representing the given 32 bit integer value. + * @param value - The 32 bit integer in question + * @param unsigned - Whether unsigned or not, defaults to signed + * @returns The corresponding Long value + */ + Long.fromInt = function (value, unsigned) { + var obj, cachedObj, cache; + if (unsigned) { + value >>>= 0; + if ((cache = 0 <= value && value < 256)) { + cachedObj = UINT_CACHE[value]; + if (cachedObj) + return cachedObj; + } + obj = Long.fromBits(value, (value | 0) < 0 ? -1 : 0, true); + if (cache) + UINT_CACHE[value] = obj; + return obj; + } + else { + value |= 0; + if ((cache = -128 <= value && value < 128)) { + cachedObj = INT_CACHE[value]; + if (cachedObj) + return cachedObj; + } + obj = Long.fromBits(value, value < 0 ? -1 : 0, false); + if (cache) + INT_CACHE[value] = obj; + return obj; + } + }; + /** + * Returns a Long representing the given value, provided that it is a finite number. Otherwise, zero is returned. + * @param value - The number in question + * @param unsigned - Whether unsigned or not, defaults to signed + * @returns The corresponding Long value + */ + Long.fromNumber = function (value, unsigned) { + if (isNaN(value)) + return unsigned ? Long.UZERO : Long.ZERO; + if (unsigned) { + if (value < 0) + return Long.UZERO; + if (value >= TWO_PWR_64_DBL) + return Long.MAX_UNSIGNED_VALUE; + } + else { + if (value <= -TWO_PWR_63_DBL) + return Long.MIN_VALUE; + if (value + 1 >= TWO_PWR_63_DBL) + return Long.MAX_VALUE; + } + if (value < 0) + return Long.fromNumber(-value, unsigned).neg(); + return Long.fromBits(value % TWO_PWR_32_DBL | 0, (value / TWO_PWR_32_DBL) | 0, unsigned); + }; + /** + * Returns a Long representing the given value, provided that it is a finite number. Otherwise, zero is returned. + * @param value - The number in question + * @param unsigned - Whether unsigned or not, defaults to signed + * @returns The corresponding Long value + */ + Long.fromBigInt = function (value, unsigned) { + return Long.fromString(value.toString(), unsigned); + }; + /** + * Returns a Long representation of the given string, written using the specified radix. + * @param str - The textual representation of the Long + * @param unsigned - Whether unsigned or not, defaults to signed + * @param radix - The radix in which the text is written (2-36), defaults to 10 + * @returns The corresponding Long value + */ + Long.fromString = function (str, unsigned, radix) { + if (str.length === 0) + throw Error('empty string'); + if (str === 'NaN' || str === 'Infinity' || str === '+Infinity' || str === '-Infinity') + return Long.ZERO; + if (typeof unsigned === 'number') { + // For goog.math.long compatibility + (radix = unsigned), (unsigned = false); + } + else { + unsigned = !!unsigned; + } + radix = radix || 10; + if (radix < 2 || 36 < radix) + throw RangeError('radix'); + var p; + if ((p = str.indexOf('-')) > 0) + throw Error('interior hyphen'); + else if (p === 0) { + return Long.fromString(str.substring(1), unsigned, radix).neg(); + } + // Do several (8) digits each time through the loop, so as to + // minimize the calls to the very expensive emulated div. + var radixToPower = Long.fromNumber(Math.pow(radix, 8)); + var result = Long.ZERO; + for (var i = 0; i < str.length; i += 8) { + var size = Math.min(8, str.length - i), value = parseInt(str.substring(i, i + size), radix); + if (size < 8) { + var power = Long.fromNumber(Math.pow(radix, size)); + result = result.mul(power).add(Long.fromNumber(value)); + } + else { + result = result.mul(radixToPower); + result = result.add(Long.fromNumber(value)); + } + } + result.unsigned = unsigned; + return result; + }; + /** + * Creates a Long from its byte representation. + * @param bytes - Byte representation + * @param unsigned - Whether unsigned or not, defaults to signed + * @param le - Whether little or big endian, defaults to big endian + * @returns The corresponding Long value + */ + Long.fromBytes = function (bytes, unsigned, le) { + return le ? Long.fromBytesLE(bytes, unsigned) : Long.fromBytesBE(bytes, unsigned); + }; + /** + * Creates a Long from its little endian byte representation. + * @param bytes - Little endian byte representation + * @param unsigned - Whether unsigned or not, defaults to signed + * @returns The corresponding Long value + */ + Long.fromBytesLE = function (bytes, unsigned) { + return new Long(bytes[0] | (bytes[1] << 8) | (bytes[2] << 16) | (bytes[3] << 24), bytes[4] | (bytes[5] << 8) | (bytes[6] << 16) | (bytes[7] << 24), unsigned); + }; + /** + * Creates a Long from its big endian byte representation. + * @param bytes - Big endian byte representation + * @param unsigned - Whether unsigned or not, defaults to signed + * @returns The corresponding Long value + */ + Long.fromBytesBE = function (bytes, unsigned) { + return new Long((bytes[4] << 24) | (bytes[5] << 16) | (bytes[6] << 8) | bytes[7], (bytes[0] << 24) | (bytes[1] << 16) | (bytes[2] << 8) | bytes[3], unsigned); + }; + /** + * Tests if the specified object is a Long. + */ + // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types + Long.isLong = function (value) { + return isObjectLike(value) && value['__isLong__'] === true; + }; + /** + * Converts the specified value to a Long. + * @param unsigned - Whether unsigned or not, defaults to signed + */ + Long.fromValue = function (val, unsigned) { + if (typeof val === 'number') + return Long.fromNumber(val, unsigned); + if (typeof val === 'string') + return Long.fromString(val, unsigned); + // Throws for non-objects, converts non-instanceof Long: + return Long.fromBits(val.low, val.high, typeof unsigned === 'boolean' ? unsigned : val.unsigned); + }; + /** Returns the sum of this and the specified Long. */ + Long.prototype.add = function (addend) { + if (!Long.isLong(addend)) + addend = Long.fromValue(addend); + // Divide each number into 4 chunks of 16 bits, and then sum the chunks. + var a48 = this.high >>> 16; + var a32 = this.high & 0xffff; + var a16 = this.low >>> 16; + var a00 = this.low & 0xffff; + var b48 = addend.high >>> 16; + var b32 = addend.high & 0xffff; + var b16 = addend.low >>> 16; + var b00 = addend.low & 0xffff; + var c48 = 0, c32 = 0, c16 = 0, c00 = 0; + c00 += a00 + b00; + c16 += c00 >>> 16; + c00 &= 0xffff; + c16 += a16 + b16; + c32 += c16 >>> 16; + c16 &= 0xffff; + c32 += a32 + b32; + c48 += c32 >>> 16; + c32 &= 0xffff; + c48 += a48 + b48; + c48 &= 0xffff; + return Long.fromBits((c16 << 16) | c00, (c48 << 16) | c32, this.unsigned); + }; + /** + * Returns the sum of this and the specified Long. + * @returns Sum + */ + Long.prototype.and = function (other) { + if (!Long.isLong(other)) + other = Long.fromValue(other); + return Long.fromBits(this.low & other.low, this.high & other.high, this.unsigned); + }; + /** + * Compares this Long's value with the specified's. + * @returns 0 if they are the same, 1 if the this is greater and -1 if the given one is greater + */ + Long.prototype.compare = function (other) { + if (!Long.isLong(other)) + other = Long.fromValue(other); + if (this.eq(other)) + return 0; + var thisNeg = this.isNegative(), otherNeg = other.isNegative(); + if (thisNeg && !otherNeg) + return -1; + if (!thisNeg && otherNeg) + return 1; + // At this point the sign bits are the same + if (!this.unsigned) + return this.sub(other).isNegative() ? -1 : 1; + // Both are positive if at least one is unsigned + return other.high >>> 0 > this.high >>> 0 || + (other.high === this.high && other.low >>> 0 > this.low >>> 0) + ? -1 + : 1; + }; + /** This is an alias of {@link Long.compare} */ + Long.prototype.comp = function (other) { + return this.compare(other); + }; + /** + * Returns this Long divided by the specified. The result is signed if this Long is signed or unsigned if this Long is unsigned. + * @returns Quotient + */ + Long.prototype.divide = function (divisor) { + if (!Long.isLong(divisor)) + divisor = Long.fromValue(divisor); + if (divisor.isZero()) + throw Error('division by zero'); + // use wasm support if present + if (wasm) { + // guard against signed division overflow: the largest + // negative number / -1 would be 1 larger than the largest + // positive number, due to two's complement. + if (!this.unsigned && + this.high === -0x80000000 && + divisor.low === -1 && + divisor.high === -1) { + // be consistent with non-wasm code path + return this; + } + var low = (this.unsigned ? wasm.div_u : wasm.div_s)(this.low, this.high, divisor.low, divisor.high); + return Long.fromBits(low, wasm.get_high(), this.unsigned); + } + if (this.isZero()) + return this.unsigned ? Long.UZERO : Long.ZERO; + var approx, rem, res; + if (!this.unsigned) { + // This section is only relevant for signed longs and is derived from the + // closure library as a whole. + if (this.eq(Long.MIN_VALUE)) { + if (divisor.eq(Long.ONE) || divisor.eq(Long.NEG_ONE)) + return Long.MIN_VALUE; + // recall that -MIN_VALUE == MIN_VALUE + else if (divisor.eq(Long.MIN_VALUE)) + return Long.ONE; + else { + // At this point, we have |other| >= 2, so |this/other| < |MIN_VALUE|. + var halfThis = this.shr(1); + approx = halfThis.div(divisor).shl(1); + if (approx.eq(Long.ZERO)) { + return divisor.isNegative() ? Long.ONE : Long.NEG_ONE; + } + else { + rem = this.sub(divisor.mul(approx)); + res = approx.add(rem.div(divisor)); + return res; + } + } + } + else if (divisor.eq(Long.MIN_VALUE)) + return this.unsigned ? Long.UZERO : Long.ZERO; + if (this.isNegative()) { + if (divisor.isNegative()) + return this.neg().div(divisor.neg()); + return this.neg().div(divisor).neg(); + } + else if (divisor.isNegative()) + return this.div(divisor.neg()).neg(); + res = Long.ZERO; + } + else { + // The algorithm below has not been made for unsigned longs. It's therefore + // required to take special care of the MSB prior to running it. + if (!divisor.unsigned) + divisor = divisor.toUnsigned(); + if (divisor.gt(this)) + return Long.UZERO; + if (divisor.gt(this.shru(1))) + // 15 >>> 1 = 7 ; with divisor = 8 ; true + return Long.UONE; + res = Long.UZERO; + } + // Repeat the following until the remainder is less than other: find a + // floating-point that approximates remainder / other *from below*, add this + // into the result, and subtract it from the remainder. It is critical that + // the approximate value is less than or equal to the real value so that the + // remainder never becomes negative. + rem = this; + while (rem.gte(divisor)) { + // Approximate the result of division. This may be a little greater or + // smaller than the actual value. + approx = Math.max(1, Math.floor(rem.toNumber() / divisor.toNumber())); + // We will tweak the approximate result by changing it in the 48-th digit or + // the smallest non-fractional digit, whichever is larger. + var log2 = Math.ceil(Math.log(approx) / Math.LN2); + var delta = log2 <= 48 ? 1 : Math.pow(2, log2 - 48); + // Decrease the approximation until it is smaller than the remainder. Note + // that if it is too large, the product overflows and is negative. + var approxRes = Long.fromNumber(approx); + var approxRem = approxRes.mul(divisor); + while (approxRem.isNegative() || approxRem.gt(rem)) { + approx -= delta; + approxRes = Long.fromNumber(approx, this.unsigned); + approxRem = approxRes.mul(divisor); + } + // We know the answer can't be zero... and actually, zero would cause + // infinite recursion since we would make no progress. + if (approxRes.isZero()) + approxRes = Long.ONE; + res = res.add(approxRes); + rem = rem.sub(approxRem); + } + return res; + }; + /**This is an alias of {@link Long.divide} */ + Long.prototype.div = function (divisor) { + return this.divide(divisor); + }; + /** + * Tests if this Long's value equals the specified's. + * @param other - Other value + */ + Long.prototype.equals = function (other) { + if (!Long.isLong(other)) + other = Long.fromValue(other); + if (this.unsigned !== other.unsigned && this.high >>> 31 === 1 && other.high >>> 31 === 1) + return false; + return this.high === other.high && this.low === other.low; + }; + /** This is an alias of {@link Long.equals} */ + Long.prototype.eq = function (other) { + return this.equals(other); + }; + /** Gets the high 32 bits as a signed integer. */ + Long.prototype.getHighBits = function () { + return this.high; + }; + /** Gets the high 32 bits as an unsigned integer. */ + Long.prototype.getHighBitsUnsigned = function () { + return this.high >>> 0; + }; + /** Gets the low 32 bits as a signed integer. */ + Long.prototype.getLowBits = function () { + return this.low; + }; + /** Gets the low 32 bits as an unsigned integer. */ + Long.prototype.getLowBitsUnsigned = function () { + return this.low >>> 0; + }; + /** Gets the number of bits needed to represent the absolute value of this Long. */ + Long.prototype.getNumBitsAbs = function () { + if (this.isNegative()) { + // Unsigned Longs are never negative + return this.eq(Long.MIN_VALUE) ? 64 : this.neg().getNumBitsAbs(); + } + var val = this.high !== 0 ? this.high : this.low; + var bit; + for (bit = 31; bit > 0; bit--) + if ((val & (1 << bit)) !== 0) + break; + return this.high !== 0 ? bit + 33 : bit + 1; + }; + /** Tests if this Long's value is greater than the specified's. */ + Long.prototype.greaterThan = function (other) { + return this.comp(other) > 0; + }; + /** This is an alias of {@link Long.greaterThan} */ + Long.prototype.gt = function (other) { + return this.greaterThan(other); + }; + /** Tests if this Long's value is greater than or equal the specified's. */ + Long.prototype.greaterThanOrEqual = function (other) { + return this.comp(other) >= 0; + }; + /** This is an alias of {@link Long.greaterThanOrEqual} */ + Long.prototype.gte = function (other) { + return this.greaterThanOrEqual(other); + }; + /** This is an alias of {@link Long.greaterThanOrEqual} */ + Long.prototype.ge = function (other) { + return this.greaterThanOrEqual(other); + }; + /** Tests if this Long's value is even. */ + Long.prototype.isEven = function () { + return (this.low & 1) === 0; + }; + /** Tests if this Long's value is negative. */ + Long.prototype.isNegative = function () { + return !this.unsigned && this.high < 0; + }; + /** Tests if this Long's value is odd. */ + Long.prototype.isOdd = function () { + return (this.low & 1) === 1; + }; + /** Tests if this Long's value is positive. */ + Long.prototype.isPositive = function () { + return this.unsigned || this.high >= 0; + }; + /** Tests if this Long's value equals zero. */ + Long.prototype.isZero = function () { + return this.high === 0 && this.low === 0; + }; + /** Tests if this Long's value is less than the specified's. */ + Long.prototype.lessThan = function (other) { + return this.comp(other) < 0; + }; + /** This is an alias of {@link Long#lessThan}. */ + Long.prototype.lt = function (other) { + return this.lessThan(other); + }; + /** Tests if this Long's value is less than or equal the specified's. */ + Long.prototype.lessThanOrEqual = function (other) { + return this.comp(other) <= 0; + }; + /** This is an alias of {@link Long.lessThanOrEqual} */ + Long.prototype.lte = function (other) { + return this.lessThanOrEqual(other); + }; + /** Returns this Long modulo the specified. */ + Long.prototype.modulo = function (divisor) { + if (!Long.isLong(divisor)) + divisor = Long.fromValue(divisor); + // use wasm support if present + if (wasm) { + var low = (this.unsigned ? wasm.rem_u : wasm.rem_s)(this.low, this.high, divisor.low, divisor.high); + return Long.fromBits(low, wasm.get_high(), this.unsigned); + } + return this.sub(this.div(divisor).mul(divisor)); + }; + /** This is an alias of {@link Long.modulo} */ + Long.prototype.mod = function (divisor) { + return this.modulo(divisor); + }; + /** This is an alias of {@link Long.modulo} */ + Long.prototype.rem = function (divisor) { + return this.modulo(divisor); + }; + /** + * Returns the product of this and the specified Long. + * @param multiplier - Multiplier + * @returns Product + */ + Long.prototype.multiply = function (multiplier) { + if (this.isZero()) + return Long.ZERO; + if (!Long.isLong(multiplier)) + multiplier = Long.fromValue(multiplier); + // use wasm support if present + if (wasm) { + var low = wasm.mul(this.low, this.high, multiplier.low, multiplier.high); + return Long.fromBits(low, wasm.get_high(), this.unsigned); + } + if (multiplier.isZero()) + return Long.ZERO; + if (this.eq(Long.MIN_VALUE)) + return multiplier.isOdd() ? Long.MIN_VALUE : Long.ZERO; + if (multiplier.eq(Long.MIN_VALUE)) + return this.isOdd() ? Long.MIN_VALUE : Long.ZERO; + if (this.isNegative()) { + if (multiplier.isNegative()) + return this.neg().mul(multiplier.neg()); + else + return this.neg().mul(multiplier).neg(); + } + else if (multiplier.isNegative()) + return this.mul(multiplier.neg()).neg(); + // If both longs are small, use float multiplication + if (this.lt(Long.TWO_PWR_24) && multiplier.lt(Long.TWO_PWR_24)) + return Long.fromNumber(this.toNumber() * multiplier.toNumber(), this.unsigned); + // Divide each long into 4 chunks of 16 bits, and then add up 4x4 products. + // We can skip products that would overflow. + var a48 = this.high >>> 16; + var a32 = this.high & 0xffff; + var a16 = this.low >>> 16; + var a00 = this.low & 0xffff; + var b48 = multiplier.high >>> 16; + var b32 = multiplier.high & 0xffff; + var b16 = multiplier.low >>> 16; + var b00 = multiplier.low & 0xffff; + var c48 = 0, c32 = 0, c16 = 0, c00 = 0; + c00 += a00 * b00; + c16 += c00 >>> 16; + c00 &= 0xffff; + c16 += a16 * b00; + c32 += c16 >>> 16; + c16 &= 0xffff; + c16 += a00 * b16; + c32 += c16 >>> 16; + c16 &= 0xffff; + c32 += a32 * b00; + c48 += c32 >>> 16; + c32 &= 0xffff; + c32 += a16 * b16; + c48 += c32 >>> 16; + c32 &= 0xffff; + c32 += a00 * b32; + c48 += c32 >>> 16; + c32 &= 0xffff; + c48 += a48 * b00 + a32 * b16 + a16 * b32 + a00 * b48; + c48 &= 0xffff; + return Long.fromBits((c16 << 16) | c00, (c48 << 16) | c32, this.unsigned); + }; + /** This is an alias of {@link Long.multiply} */ + Long.prototype.mul = function (multiplier) { + return this.multiply(multiplier); + }; + /** Returns the Negation of this Long's value. */ + Long.prototype.negate = function () { + if (!this.unsigned && this.eq(Long.MIN_VALUE)) + return Long.MIN_VALUE; + return this.not().add(Long.ONE); + }; + /** This is an alias of {@link Long.negate} */ + Long.prototype.neg = function () { + return this.negate(); + }; + /** Returns the bitwise NOT of this Long. */ + Long.prototype.not = function () { + return Long.fromBits(~this.low, ~this.high, this.unsigned); + }; + /** Tests if this Long's value differs from the specified's. */ + Long.prototype.notEquals = function (other) { + return !this.equals(other); + }; + /** This is an alias of {@link Long.notEquals} */ + Long.prototype.neq = function (other) { + return this.notEquals(other); + }; + /** This is an alias of {@link Long.notEquals} */ + Long.prototype.ne = function (other) { + return this.notEquals(other); + }; + /** + * Returns the bitwise OR of this Long and the specified. + */ + Long.prototype.or = function (other) { + if (!Long.isLong(other)) + other = Long.fromValue(other); + return Long.fromBits(this.low | other.low, this.high | other.high, this.unsigned); + }; + /** + * Returns this Long with bits shifted to the left by the given amount. + * @param numBits - Number of bits + * @returns Shifted Long + */ + Long.prototype.shiftLeft = function (numBits) { + if (Long.isLong(numBits)) + numBits = numBits.toInt(); + if ((numBits &= 63) === 0) + return this; + else if (numBits < 32) + return Long.fromBits(this.low << numBits, (this.high << numBits) | (this.low >>> (32 - numBits)), this.unsigned); + else + return Long.fromBits(0, this.low << (numBits - 32), this.unsigned); + }; + /** This is an alias of {@link Long.shiftLeft} */ + Long.prototype.shl = function (numBits) { + return this.shiftLeft(numBits); + }; + /** + * Returns this Long with bits arithmetically shifted to the right by the given amount. + * @param numBits - Number of bits + * @returns Shifted Long + */ + Long.prototype.shiftRight = function (numBits) { + if (Long.isLong(numBits)) + numBits = numBits.toInt(); + if ((numBits &= 63) === 0) + return this; + else if (numBits < 32) + return Long.fromBits((this.low >>> numBits) | (this.high << (32 - numBits)), this.high >> numBits, this.unsigned); + else + return Long.fromBits(this.high >> (numBits - 32), this.high >= 0 ? 0 : -1, this.unsigned); + }; + /** This is an alias of {@link Long.shiftRight} */ + Long.prototype.shr = function (numBits) { + return this.shiftRight(numBits); + }; + /** + * Returns this Long with bits logically shifted to the right by the given amount. + * @param numBits - Number of bits + * @returns Shifted Long + */ + Long.prototype.shiftRightUnsigned = function (numBits) { + if (Long.isLong(numBits)) + numBits = numBits.toInt(); + numBits &= 63; + if (numBits === 0) + return this; + else { + var high = this.high; + if (numBits < 32) { + var low = this.low; + return Long.fromBits((low >>> numBits) | (high << (32 - numBits)), high >>> numBits, this.unsigned); + } + else if (numBits === 32) + return Long.fromBits(high, 0, this.unsigned); + else + return Long.fromBits(high >>> (numBits - 32), 0, this.unsigned); + } + }; + /** This is an alias of {@link Long.shiftRightUnsigned} */ + Long.prototype.shr_u = function (numBits) { + return this.shiftRightUnsigned(numBits); + }; + /** This is an alias of {@link Long.shiftRightUnsigned} */ + Long.prototype.shru = function (numBits) { + return this.shiftRightUnsigned(numBits); + }; + /** + * Returns the difference of this and the specified Long. + * @param subtrahend - Subtrahend + * @returns Difference + */ + Long.prototype.subtract = function (subtrahend) { + if (!Long.isLong(subtrahend)) + subtrahend = Long.fromValue(subtrahend); + return this.add(subtrahend.neg()); + }; + /** This is an alias of {@link Long.subtract} */ + Long.prototype.sub = function (subtrahend) { + return this.subtract(subtrahend); + }; + /** Converts the Long to a 32 bit integer, assuming it is a 32 bit integer. */ + Long.prototype.toInt = function () { + return this.unsigned ? this.low >>> 0 : this.low; + }; + /** Converts the Long to a the nearest floating-point representation of this value (double, 53 bit mantissa). */ + Long.prototype.toNumber = function () { + if (this.unsigned) + return (this.high >>> 0) * TWO_PWR_32_DBL + (this.low >>> 0); + return this.high * TWO_PWR_32_DBL + (this.low >>> 0); + }; + /** Converts the Long to a BigInt (arbitrary precision). */ + Long.prototype.toBigInt = function () { + return BigInt(this.toString()); + }; + /** + * Converts this Long to its byte representation. + * @param le - Whether little or big endian, defaults to big endian + * @returns Byte representation + */ + Long.prototype.toBytes = function (le) { + return le ? this.toBytesLE() : this.toBytesBE(); + }; + /** + * Converts this Long to its little endian byte representation. + * @returns Little endian byte representation + */ + Long.prototype.toBytesLE = function () { + var hi = this.high, lo = this.low; + return [ + lo & 0xff, + (lo >>> 8) & 0xff, + (lo >>> 16) & 0xff, + lo >>> 24, + hi & 0xff, + (hi >>> 8) & 0xff, + (hi >>> 16) & 0xff, + hi >>> 24 + ]; + }; + /** + * Converts this Long to its big endian byte representation. + * @returns Big endian byte representation + */ + Long.prototype.toBytesBE = function () { + var hi = this.high, lo = this.low; + return [ + hi >>> 24, + (hi >>> 16) & 0xff, + (hi >>> 8) & 0xff, + hi & 0xff, + lo >>> 24, + (lo >>> 16) & 0xff, + (lo >>> 8) & 0xff, + lo & 0xff + ]; + }; + /** + * Converts this Long to signed. + */ + Long.prototype.toSigned = function () { + if (!this.unsigned) + return this; + return Long.fromBits(this.low, this.high, false); + }; + /** + * Converts the Long to a string written in the specified radix. + * @param radix - Radix (2-36), defaults to 10 + * @throws RangeError If `radix` is out of range + */ + Long.prototype.toString = function (radix) { + radix = radix || 10; + if (radix < 2 || 36 < radix) + throw RangeError('radix'); + if (this.isZero()) + return '0'; + if (this.isNegative()) { + // Unsigned Longs are never negative + if (this.eq(Long.MIN_VALUE)) { + // We need to change the Long value before it can be negated, so we remove + // the bottom-most digit in this base and then recurse to do the rest. + var radixLong = Long.fromNumber(radix), div = this.div(radixLong), rem1 = div.mul(radixLong).sub(this); + return div.toString(radix) + rem1.toInt().toString(radix); + } + else + return '-' + this.neg().toString(radix); + } + // Do several (6) digits each time through the loop, so as to + // minimize the calls to the very expensive emulated div. + var radixToPower = Long.fromNumber(Math.pow(radix, 6), this.unsigned); + // eslint-disable-next-line @typescript-eslint/no-this-alias + var rem = this; + var result = ''; + // eslint-disable-next-line no-constant-condition + while (true) { + var remDiv = rem.div(radixToPower); + var intval = rem.sub(remDiv.mul(radixToPower)).toInt() >>> 0; + var digits = intval.toString(radix); + rem = remDiv; + if (rem.isZero()) { + return digits + result; + } + else { + while (digits.length < 6) + digits = '0' + digits; + result = '' + digits + result; + } + } + }; + /** Converts this Long to unsigned. */ + Long.prototype.toUnsigned = function () { + if (this.unsigned) + return this; + return Long.fromBits(this.low, this.high, true); + }; + /** Returns the bitwise XOR of this Long and the given one. */ + Long.prototype.xor = function (other) { + if (!Long.isLong(other)) + other = Long.fromValue(other); + return Long.fromBits(this.low ^ other.low, this.high ^ other.high, this.unsigned); + }; + /** This is an alias of {@link Long.isZero} */ + Long.prototype.eqz = function () { + return this.isZero(); + }; + /** This is an alias of {@link Long.lessThanOrEqual} */ + Long.prototype.le = function (other) { + return this.lessThanOrEqual(other); + }; + /* + **************************************************************** + * BSON SPECIFIC ADDITIONS * + **************************************************************** + */ + Long.prototype.toExtendedJSON = function (options) { + if (options && options.relaxed) + return this.toNumber(); + return { $numberLong: this.toString() }; + }; + Long.fromExtendedJSON = function (doc, options) { + var result = Long.fromString(doc.$numberLong); + return options && options.relaxed ? result.toNumber() : result; + }; + /** @internal */ + Long.prototype[Symbol.for('nodejs.util.inspect.custom')] = function () { + return this.inspect(); + }; + Long.prototype.inspect = function () { + return "new Long(\"" + this.toString() + "\"" + (this.unsigned ? ', true' : '') + ")"; + }; + Long.TWO_PWR_24 = Long.fromInt(TWO_PWR_24_DBL); + /** Maximum unsigned value. */ + Long.MAX_UNSIGNED_VALUE = Long.fromBits(0xffffffff | 0, 0xffffffff | 0, true); + /** Signed zero */ + Long.ZERO = Long.fromInt(0); + /** Unsigned zero. */ + Long.UZERO = Long.fromInt(0, true); + /** Signed one. */ + Long.ONE = Long.fromInt(1); + /** Unsigned one. */ + Long.UONE = Long.fromInt(1, true); + /** Signed negative one. */ + Long.NEG_ONE = Long.fromInt(-1); + /** Maximum signed value. */ + Long.MAX_VALUE = Long.fromBits(0xffffffff | 0, 0x7fffffff | 0, false); + /** Minimum signed value. */ + Long.MIN_VALUE = Long.fromBits(0, 0x80000000 | 0, false); + return Long; +}()); +Object.defineProperty(Long.prototype, '__isLong__', { value: true }); +Object.defineProperty(Long.prototype, '_bsontype', { value: 'Long' }); + +var PARSE_STRING_REGEXP = /^(\+|-)?(\d+|(\d*\.\d*))?(E|e)?([-+])?(\d+)?$/; +var PARSE_INF_REGEXP = /^(\+|-)?(Infinity|inf)$/i; +var PARSE_NAN_REGEXP = /^(\+|-)?NaN$/i; +var EXPONENT_MAX = 6111; +var EXPONENT_MIN = -6176; +var EXPONENT_BIAS = 6176; +var MAX_DIGITS = 34; +// Nan value bits as 32 bit values (due to lack of longs) +var NAN_BUFFER = [ + 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +].reverse(); +// Infinity value bits 32 bit values (due to lack of longs) +var INF_NEGATIVE_BUFFER = [ + 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +].reverse(); +var INF_POSITIVE_BUFFER = [ + 0x78, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +].reverse(); +var EXPONENT_REGEX = /^([-+])?(\d+)?$/; +// Extract least significant 5 bits +var COMBINATION_MASK = 0x1f; +// Extract least significant 14 bits +var EXPONENT_MASK = 0x3fff; +// Value of combination field for Inf +var COMBINATION_INFINITY = 30; +// Value of combination field for NaN +var COMBINATION_NAN = 31; +// Detect if the value is a digit +function isDigit(value) { + return !isNaN(parseInt(value, 10)); +} +// Divide two uint128 values +function divideu128(value) { + var DIVISOR = Long.fromNumber(1000 * 1000 * 1000); + var _rem = Long.fromNumber(0); + if (!value.parts[0] && !value.parts[1] && !value.parts[2] && !value.parts[3]) { + return { quotient: value, rem: _rem }; + } + for (var i = 0; i <= 3; i++) { + // Adjust remainder to match value of next dividend + _rem = _rem.shiftLeft(32); + // Add the divided to _rem + _rem = _rem.add(new Long(value.parts[i], 0)); + value.parts[i] = _rem.div(DIVISOR).low; + _rem = _rem.modulo(DIVISOR); + } + return { quotient: value, rem: _rem }; +} +// Multiply two Long values and return the 128 bit value +function multiply64x2(left, right) { + if (!left && !right) { + return { high: Long.fromNumber(0), low: Long.fromNumber(0) }; + } + var leftHigh = left.shiftRightUnsigned(32); + var leftLow = new Long(left.getLowBits(), 0); + var rightHigh = right.shiftRightUnsigned(32); + var rightLow = new Long(right.getLowBits(), 0); + var productHigh = leftHigh.multiply(rightHigh); + var productMid = leftHigh.multiply(rightLow); + var productMid2 = leftLow.multiply(rightHigh); + var productLow = leftLow.multiply(rightLow); + productHigh = productHigh.add(productMid.shiftRightUnsigned(32)); + productMid = new Long(productMid.getLowBits(), 0) + .add(productMid2) + .add(productLow.shiftRightUnsigned(32)); + productHigh = productHigh.add(productMid.shiftRightUnsigned(32)); + productLow = productMid.shiftLeft(32).add(new Long(productLow.getLowBits(), 0)); + // Return the 128 bit result + return { high: productHigh, low: productLow }; +} +function lessThan(left, right) { + // Make values unsigned + var uhleft = left.high >>> 0; + var uhright = right.high >>> 0; + // Compare high bits first + if (uhleft < uhright) { + return true; + } + else if (uhleft === uhright) { + var ulleft = left.low >>> 0; + var ulright = right.low >>> 0; + if (ulleft < ulright) + return true; + } + return false; +} +function invalidErr(string, message) { + throw new BSONTypeError("\"" + string + "\" is not a valid Decimal128 string - " + message); +} +/** + * A class representation of the BSON Decimal128 type. + * @public + * @category BSONType + */ +var Decimal128 = /** @class */ (function () { + /** + * @param bytes - a buffer containing the raw Decimal128 bytes in little endian order, + * or a string representation as returned by .toString() + */ + function Decimal128(bytes) { + if (!(this instanceof Decimal128)) + return new Decimal128(bytes); + if (typeof bytes === 'string') { + this.bytes = Decimal128.fromString(bytes).bytes; + } + else if (isUint8Array(bytes)) { + if (bytes.byteLength !== 16) { + throw new BSONTypeError('Decimal128 must take a Buffer of 16 bytes'); + } + this.bytes = bytes; + } + else { + throw new BSONTypeError('Decimal128 must take a Buffer or string'); + } + } + /** + * Create a Decimal128 instance from a string representation + * + * @param representation - a numeric string representation. + */ + Decimal128.fromString = function (representation) { + // Parse state tracking + var isNegative = false; + var sawRadix = false; + var foundNonZero = false; + // Total number of significant digits (no leading or trailing zero) + var significantDigits = 0; + // Total number of significand digits read + var nDigitsRead = 0; + // Total number of digits (no leading zeros) + var nDigits = 0; + // The number of the digits after radix + var radixPosition = 0; + // The index of the first non-zero in *str* + var firstNonZero = 0; + // Digits Array + var digits = [0]; + // The number of digits in digits + var nDigitsStored = 0; + // Insertion pointer for digits + var digitsInsert = 0; + // The index of the first non-zero digit + var firstDigit = 0; + // The index of the last digit + var lastDigit = 0; + // Exponent + var exponent = 0; + // loop index over array + var i = 0; + // The high 17 digits of the significand + var significandHigh = new Long(0, 0); + // The low 17 digits of the significand + var significandLow = new Long(0, 0); + // The biased exponent + var biasedExponent = 0; + // Read index + var index = 0; + // Naively prevent against REDOS attacks. + // TODO: implementing a custom parsing for this, or refactoring the regex would yield + // further gains. + if (representation.length >= 7000) { + throw new BSONTypeError('' + representation + ' not a valid Decimal128 string'); + } + // Results + var stringMatch = representation.match(PARSE_STRING_REGEXP); + var infMatch = representation.match(PARSE_INF_REGEXP); + var nanMatch = representation.match(PARSE_NAN_REGEXP); + // Validate the string + if ((!stringMatch && !infMatch && !nanMatch) || representation.length === 0) { + throw new BSONTypeError('' + representation + ' not a valid Decimal128 string'); + } + if (stringMatch) { + // full_match = stringMatch[0] + // sign = stringMatch[1] + var unsignedNumber = stringMatch[2]; + // stringMatch[3] is undefined if a whole number (ex "1", 12") + // but defined if a number w/ decimal in it (ex "1.0, 12.2") + var e = stringMatch[4]; + var expSign = stringMatch[5]; + var expNumber = stringMatch[6]; + // they provided e, but didn't give an exponent number. for ex "1e" + if (e && expNumber === undefined) + invalidErr(representation, 'missing exponent power'); + // they provided e, but didn't give a number before it. for ex "e1" + if (e && unsignedNumber === undefined) + invalidErr(representation, 'missing exponent base'); + if (e === undefined && (expSign || expNumber)) { + invalidErr(representation, 'missing e before exponent'); + } + } + // Get the negative or positive sign + if (representation[index] === '+' || representation[index] === '-') { + isNegative = representation[index++] === '-'; + } + // Check if user passed Infinity or NaN + if (!isDigit(representation[index]) && representation[index] !== '.') { + if (representation[index] === 'i' || representation[index] === 'I') { + return new Decimal128(Buffer.from(isNegative ? INF_NEGATIVE_BUFFER : INF_POSITIVE_BUFFER)); + } + else if (representation[index] === 'N') { + return new Decimal128(Buffer.from(NAN_BUFFER)); + } + } + // Read all the digits + while (isDigit(representation[index]) || representation[index] === '.') { + if (representation[index] === '.') { + if (sawRadix) + invalidErr(representation, 'contains multiple periods'); + sawRadix = true; + index = index + 1; + continue; + } + if (nDigitsStored < 34) { + if (representation[index] !== '0' || foundNonZero) { + if (!foundNonZero) { + firstNonZero = nDigitsRead; + } + foundNonZero = true; + // Only store 34 digits + digits[digitsInsert++] = parseInt(representation[index], 10); + nDigitsStored = nDigitsStored + 1; + } + } + if (foundNonZero) + nDigits = nDigits + 1; + if (sawRadix) + radixPosition = radixPosition + 1; + nDigitsRead = nDigitsRead + 1; + index = index + 1; + } + if (sawRadix && !nDigitsRead) + throw new BSONTypeError('' + representation + ' not a valid Decimal128 string'); + // Read exponent if exists + if (representation[index] === 'e' || representation[index] === 'E') { + // Read exponent digits + var match = representation.substr(++index).match(EXPONENT_REGEX); + // No digits read + if (!match || !match[2]) + return new Decimal128(Buffer.from(NAN_BUFFER)); + // Get exponent + exponent = parseInt(match[0], 10); + // Adjust the index + index = index + match[0].length; + } + // Return not a number + if (representation[index]) + return new Decimal128(Buffer.from(NAN_BUFFER)); + // Done reading input + // Find first non-zero digit in digits + firstDigit = 0; + if (!nDigitsStored) { + firstDigit = 0; + lastDigit = 0; + digits[0] = 0; + nDigits = 1; + nDigitsStored = 1; + significantDigits = 0; + } + else { + lastDigit = nDigitsStored - 1; + significantDigits = nDigits; + if (significantDigits !== 1) { + while (digits[firstNonZero + significantDigits - 1] === 0) { + significantDigits = significantDigits - 1; + } + } + } + // Normalization of exponent + // Correct exponent based on radix position, and shift significand as needed + // to represent user input + // Overflow prevention + if (exponent <= radixPosition && radixPosition - exponent > 1 << 14) { + exponent = EXPONENT_MIN; + } + else { + exponent = exponent - radixPosition; + } + // Attempt to normalize the exponent + while (exponent > EXPONENT_MAX) { + // Shift exponent to significand and decrease + lastDigit = lastDigit + 1; + if (lastDigit - firstDigit > MAX_DIGITS) { + // Check if we have a zero then just hard clamp, otherwise fail + var digitsString = digits.join(''); + if (digitsString.match(/^0+$/)) { + exponent = EXPONENT_MAX; + break; + } + invalidErr(representation, 'overflow'); + } + exponent = exponent - 1; + } + while (exponent < EXPONENT_MIN || nDigitsStored < nDigits) { + // Shift last digit. can only do this if < significant digits than # stored. + if (lastDigit === 0 && significantDigits < nDigitsStored) { + exponent = EXPONENT_MIN; + significantDigits = 0; + break; + } + if (nDigitsStored < nDigits) { + // adjust to match digits not stored + nDigits = nDigits - 1; + } + else { + // adjust to round + lastDigit = lastDigit - 1; + } + if (exponent < EXPONENT_MAX) { + exponent = exponent + 1; + } + else { + // Check if we have a zero then just hard clamp, otherwise fail + var digitsString = digits.join(''); + if (digitsString.match(/^0+$/)) { + exponent = EXPONENT_MAX; + break; + } + invalidErr(representation, 'overflow'); + } + } + // Round + // We've normalized the exponent, but might still need to round. + if (lastDigit - firstDigit + 1 < significantDigits) { + var endOfString = nDigitsRead; + // If we have seen a radix point, 'string' is 1 longer than we have + // documented with ndigits_read, so inc the position of the first nonzero + // digit and the position that digits are read to. + if (sawRadix) { + firstNonZero = firstNonZero + 1; + endOfString = endOfString + 1; + } + // if negative, we need to increment again to account for - sign at start. + if (isNegative) { + firstNonZero = firstNonZero + 1; + endOfString = endOfString + 1; + } + var roundDigit = parseInt(representation[firstNonZero + lastDigit + 1], 10); + var roundBit = 0; + if (roundDigit >= 5) { + roundBit = 1; + if (roundDigit === 5) { + roundBit = digits[lastDigit] % 2 === 1 ? 1 : 0; + for (i = firstNonZero + lastDigit + 2; i < endOfString; i++) { + if (parseInt(representation[i], 10)) { + roundBit = 1; + break; + } + } + } + } + if (roundBit) { + var dIdx = lastDigit; + for (; dIdx >= 0; dIdx--) { + if (++digits[dIdx] > 9) { + digits[dIdx] = 0; + // overflowed most significant digit + if (dIdx === 0) { + if (exponent < EXPONENT_MAX) { + exponent = exponent + 1; + digits[dIdx] = 1; + } + else { + return new Decimal128(Buffer.from(isNegative ? INF_NEGATIVE_BUFFER : INF_POSITIVE_BUFFER)); + } + } + } + } + } + } + // Encode significand + // The high 17 digits of the significand + significandHigh = Long.fromNumber(0); + // The low 17 digits of the significand + significandLow = Long.fromNumber(0); + // read a zero + if (significantDigits === 0) { + significandHigh = Long.fromNumber(0); + significandLow = Long.fromNumber(0); + } + else if (lastDigit - firstDigit < 17) { + var dIdx = firstDigit; + significandLow = Long.fromNumber(digits[dIdx++]); + significandHigh = new Long(0, 0); + for (; dIdx <= lastDigit; dIdx++) { + significandLow = significandLow.multiply(Long.fromNumber(10)); + significandLow = significandLow.add(Long.fromNumber(digits[dIdx])); + } + } + else { + var dIdx = firstDigit; + significandHigh = Long.fromNumber(digits[dIdx++]); + for (; dIdx <= lastDigit - 17; dIdx++) { + significandHigh = significandHigh.multiply(Long.fromNumber(10)); + significandHigh = significandHigh.add(Long.fromNumber(digits[dIdx])); + } + significandLow = Long.fromNumber(digits[dIdx++]); + for (; dIdx <= lastDigit; dIdx++) { + significandLow = significandLow.multiply(Long.fromNumber(10)); + significandLow = significandLow.add(Long.fromNumber(digits[dIdx])); + } + } + var significand = multiply64x2(significandHigh, Long.fromString('100000000000000000')); + significand.low = significand.low.add(significandLow); + if (lessThan(significand.low, significandLow)) { + significand.high = significand.high.add(Long.fromNumber(1)); + } + // Biased exponent + biasedExponent = exponent + EXPONENT_BIAS; + var dec = { low: Long.fromNumber(0), high: Long.fromNumber(0) }; + // Encode combination, exponent, and significand. + if (significand.high.shiftRightUnsigned(49).and(Long.fromNumber(1)).equals(Long.fromNumber(1))) { + // Encode '11' into bits 1 to 3 + dec.high = dec.high.or(Long.fromNumber(0x3).shiftLeft(61)); + dec.high = dec.high.or(Long.fromNumber(biasedExponent).and(Long.fromNumber(0x3fff).shiftLeft(47))); + dec.high = dec.high.or(significand.high.and(Long.fromNumber(0x7fffffffffff))); + } + else { + dec.high = dec.high.or(Long.fromNumber(biasedExponent & 0x3fff).shiftLeft(49)); + dec.high = dec.high.or(significand.high.and(Long.fromNumber(0x1ffffffffffff))); + } + dec.low = significand.low; + // Encode sign + if (isNegative) { + dec.high = dec.high.or(Long.fromString('9223372036854775808')); + } + // Encode into a buffer + var buffer = Buffer.alloc(16); + index = 0; + // Encode the low 64 bits of the decimal + // Encode low bits + buffer[index++] = dec.low.low & 0xff; + buffer[index++] = (dec.low.low >> 8) & 0xff; + buffer[index++] = (dec.low.low >> 16) & 0xff; + buffer[index++] = (dec.low.low >> 24) & 0xff; + // Encode high bits + buffer[index++] = dec.low.high & 0xff; + buffer[index++] = (dec.low.high >> 8) & 0xff; + buffer[index++] = (dec.low.high >> 16) & 0xff; + buffer[index++] = (dec.low.high >> 24) & 0xff; + // Encode the high 64 bits of the decimal + // Encode low bits + buffer[index++] = dec.high.low & 0xff; + buffer[index++] = (dec.high.low >> 8) & 0xff; + buffer[index++] = (dec.high.low >> 16) & 0xff; + buffer[index++] = (dec.high.low >> 24) & 0xff; + // Encode high bits + buffer[index++] = dec.high.high & 0xff; + buffer[index++] = (dec.high.high >> 8) & 0xff; + buffer[index++] = (dec.high.high >> 16) & 0xff; + buffer[index++] = (dec.high.high >> 24) & 0xff; + // Return the new Decimal128 + return new Decimal128(buffer); + }; + /** Create a string representation of the raw Decimal128 value */ + Decimal128.prototype.toString = function () { + // Note: bits in this routine are referred to starting at 0, + // from the sign bit, towards the coefficient. + // decoded biased exponent (14 bits) + var biased_exponent; + // the number of significand digits + var significand_digits = 0; + // the base-10 digits in the significand + var significand = new Array(36); + for (var i = 0; i < significand.length; i++) + significand[i] = 0; + // read pointer into significand + var index = 0; + // true if the number is zero + var is_zero = false; + // the most significant significand bits (50-46) + var significand_msb; + // temporary storage for significand decoding + var significand128 = { parts: [0, 0, 0, 0] }; + // indexing variables + var j, k; + // Output string + var string = []; + // Unpack index + index = 0; + // Buffer reference + var buffer = this.bytes; + // Unpack the low 64bits into a long + // bits 96 - 127 + var low = buffer[index++] | (buffer[index++] << 8) | (buffer[index++] << 16) | (buffer[index++] << 24); + // bits 64 - 95 + var midl = buffer[index++] | (buffer[index++] << 8) | (buffer[index++] << 16) | (buffer[index++] << 24); + // Unpack the high 64bits into a long + // bits 32 - 63 + var midh = buffer[index++] | (buffer[index++] << 8) | (buffer[index++] << 16) | (buffer[index++] << 24); + // bits 0 - 31 + var high = buffer[index++] | (buffer[index++] << 8) | (buffer[index++] << 16) | (buffer[index++] << 24); + // Unpack index + index = 0; + // Create the state of the decimal + var dec = { + low: new Long(low, midl), + high: new Long(midh, high) + }; + if (dec.high.lessThan(Long.ZERO)) { + string.push('-'); + } + // Decode combination field and exponent + // bits 1 - 5 + var combination = (high >> 26) & COMBINATION_MASK; + if (combination >> 3 === 3) { + // Check for 'special' values + if (combination === COMBINATION_INFINITY) { + return string.join('') + 'Infinity'; + } + else if (combination === COMBINATION_NAN) { + return 'NaN'; + } + else { + biased_exponent = (high >> 15) & EXPONENT_MASK; + significand_msb = 0x08 + ((high >> 14) & 0x01); + } + } + else { + significand_msb = (high >> 14) & 0x07; + biased_exponent = (high >> 17) & EXPONENT_MASK; + } + // unbiased exponent + var exponent = biased_exponent - EXPONENT_BIAS; + // Create string of significand digits + // Convert the 114-bit binary number represented by + // (significand_high, significand_low) to at most 34 decimal + // digits through modulo and division. + significand128.parts[0] = (high & 0x3fff) + ((significand_msb & 0xf) << 14); + significand128.parts[1] = midh; + significand128.parts[2] = midl; + significand128.parts[3] = low; + if (significand128.parts[0] === 0 && + significand128.parts[1] === 0 && + significand128.parts[2] === 0 && + significand128.parts[3] === 0) { + is_zero = true; + } + else { + for (k = 3; k >= 0; k--) { + var least_digits = 0; + // Perform the divide + var result = divideu128(significand128); + significand128 = result.quotient; + least_digits = result.rem.low; + // We now have the 9 least significant digits (in base 2). + // Convert and output to string. + if (!least_digits) + continue; + for (j = 8; j >= 0; j--) { + // significand[k * 9 + j] = Math.round(least_digits % 10); + significand[k * 9 + j] = least_digits % 10; + // least_digits = Math.round(least_digits / 10); + least_digits = Math.floor(least_digits / 10); + } + } + } + // Output format options: + // Scientific - [-]d.dddE(+/-)dd or [-]dE(+/-)dd + // Regular - ddd.ddd + if (is_zero) { + significand_digits = 1; + significand[index] = 0; + } + else { + significand_digits = 36; + while (!significand[index]) { + significand_digits = significand_digits - 1; + index = index + 1; + } + } + // the exponent if scientific notation is used + var scientific_exponent = significand_digits - 1 + exponent; + // The scientific exponent checks are dictated by the string conversion + // specification and are somewhat arbitrary cutoffs. + // + // We must check exponent > 0, because if this is the case, the number + // has trailing zeros. However, we *cannot* output these trailing zeros, + // because doing so would change the precision of the value, and would + // change stored data if the string converted number is round tripped. + if (scientific_exponent >= 34 || scientific_exponent <= -7 || exponent > 0) { + // Scientific format + // if there are too many significant digits, we should just be treating numbers + // as + or - 0 and using the non-scientific exponent (this is for the "invalid + // representation should be treated as 0/-0" spec cases in decimal128-1.json) + if (significand_digits > 34) { + string.push("" + 0); + if (exponent > 0) + string.push('E+' + exponent); + else if (exponent < 0) + string.push('E' + exponent); + return string.join(''); + } + string.push("" + significand[index++]); + significand_digits = significand_digits - 1; + if (significand_digits) { + string.push('.'); + } + for (var i = 0; i < significand_digits; i++) { + string.push("" + significand[index++]); + } + // Exponent + string.push('E'); + if (scientific_exponent > 0) { + string.push('+' + scientific_exponent); + } + else { + string.push("" + scientific_exponent); + } + } + else { + // Regular format with no decimal place + if (exponent >= 0) { + for (var i = 0; i < significand_digits; i++) { + string.push("" + significand[index++]); + } + } + else { + var radix_position = significand_digits + exponent; + // non-zero digits before radix + if (radix_position > 0) { + for (var i = 0; i < radix_position; i++) { + string.push("" + significand[index++]); + } + } + else { + string.push('0'); + } + string.push('.'); + // add leading zeros after radix + while (radix_position++ < 0) { + string.push('0'); + } + for (var i = 0; i < significand_digits - Math.max(radix_position - 1, 0); i++) { + string.push("" + significand[index++]); + } + } + } + return string.join(''); + }; + Decimal128.prototype.toJSON = function () { + return { $numberDecimal: this.toString() }; + }; + /** @internal */ + Decimal128.prototype.toExtendedJSON = function () { + return { $numberDecimal: this.toString() }; + }; + /** @internal */ + Decimal128.fromExtendedJSON = function (doc) { + return Decimal128.fromString(doc.$numberDecimal); + }; + /** @internal */ + Decimal128.prototype[Symbol.for('nodejs.util.inspect.custom')] = function () { + return this.inspect(); + }; + Decimal128.prototype.inspect = function () { + return "new Decimal128(\"" + this.toString() + "\")"; + }; + return Decimal128; +}()); +Object.defineProperty(Decimal128.prototype, '_bsontype', { value: 'Decimal128' }); + +/** + * A class representation of the BSON Double type. + * @public + * @category BSONType + */ +var Double = /** @class */ (function () { + /** + * Create a Double type + * + * @param value - the number we want to represent as a double. + */ + function Double(value) { + if (!(this instanceof Double)) + return new Double(value); + if (value instanceof Number) { + value = value.valueOf(); + } + this.value = +value; + } + /** + * Access the number value. + * + * @returns returns the wrapped double number. + */ + Double.prototype.valueOf = function () { + return this.value; + }; + Double.prototype.toJSON = function () { + return this.value; + }; + Double.prototype.toString = function (radix) { + return this.value.toString(radix); + }; + /** @internal */ + Double.prototype.toExtendedJSON = function (options) { + if (options && (options.legacy || (options.relaxed && isFinite(this.value)))) { + return this.value; + } + // NOTE: JavaScript has +0 and -0, apparently to model limit calculations. If a user + // explicitly provided `-0` then we need to ensure the sign makes it into the output + if (Object.is(Math.sign(this.value), -0)) { + return { $numberDouble: "-" + this.value.toFixed(1) }; + } + var $numberDouble; + if (Number.isInteger(this.value)) { + $numberDouble = this.value.toFixed(1); + if ($numberDouble.length >= 13) { + $numberDouble = this.value.toExponential(13).toUpperCase(); + } + } + else { + $numberDouble = this.value.toString(); + } + return { $numberDouble: $numberDouble }; + }; + /** @internal */ + Double.fromExtendedJSON = function (doc, options) { + var doubleValue = parseFloat(doc.$numberDouble); + return options && options.relaxed ? doubleValue : new Double(doubleValue); + }; + /** @internal */ + Double.prototype[Symbol.for('nodejs.util.inspect.custom')] = function () { + return this.inspect(); + }; + Double.prototype.inspect = function () { + var eJSON = this.toExtendedJSON(); + return "new Double(" + eJSON.$numberDouble + ")"; + }; + return Double; +}()); +Object.defineProperty(Double.prototype, '_bsontype', { value: 'Double' }); + +/** + * A class representation of a BSON Int32 type. + * @public + * @category BSONType + */ +var Int32 = /** @class */ (function () { + /** + * Create an Int32 type + * + * @param value - the number we want to represent as an int32. + */ + function Int32(value) { + if (!(this instanceof Int32)) + return new Int32(value); + if (value instanceof Number) { + value = value.valueOf(); + } + this.value = +value | 0; + } + /** + * Access the number value. + * + * @returns returns the wrapped int32 number. + */ + Int32.prototype.valueOf = function () { + return this.value; + }; + Int32.prototype.toString = function (radix) { + return this.value.toString(radix); + }; + Int32.prototype.toJSON = function () { + return this.value; + }; + /** @internal */ + Int32.prototype.toExtendedJSON = function (options) { + if (options && (options.relaxed || options.legacy)) + return this.value; + return { $numberInt: this.value.toString() }; + }; + /** @internal */ + Int32.fromExtendedJSON = function (doc, options) { + return options && options.relaxed ? parseInt(doc.$numberInt, 10) : new Int32(doc.$numberInt); + }; + /** @internal */ + Int32.prototype[Symbol.for('nodejs.util.inspect.custom')] = function () { + return this.inspect(); + }; + Int32.prototype.inspect = function () { + return "new Int32(" + this.valueOf() + ")"; + }; + return Int32; +}()); +Object.defineProperty(Int32.prototype, '_bsontype', { value: 'Int32' }); + +/** + * A class representation of the BSON MaxKey type. + * @public + * @category BSONType + */ +var MaxKey = /** @class */ (function () { + function MaxKey() { + if (!(this instanceof MaxKey)) + return new MaxKey(); + } + /** @internal */ + MaxKey.prototype.toExtendedJSON = function () { + return { $maxKey: 1 }; + }; + /** @internal */ + MaxKey.fromExtendedJSON = function () { + return new MaxKey(); + }; + /** @internal */ + MaxKey.prototype[Symbol.for('nodejs.util.inspect.custom')] = function () { + return this.inspect(); + }; + MaxKey.prototype.inspect = function () { + return 'new MaxKey()'; + }; + return MaxKey; +}()); +Object.defineProperty(MaxKey.prototype, '_bsontype', { value: 'MaxKey' }); + +/** + * A class representation of the BSON MinKey type. + * @public + * @category BSONType + */ +var MinKey = /** @class */ (function () { + function MinKey() { + if (!(this instanceof MinKey)) + return new MinKey(); + } + /** @internal */ + MinKey.prototype.toExtendedJSON = function () { + return { $minKey: 1 }; + }; + /** @internal */ + MinKey.fromExtendedJSON = function () { + return new MinKey(); + }; + /** @internal */ + MinKey.prototype[Symbol.for('nodejs.util.inspect.custom')] = function () { + return this.inspect(); + }; + MinKey.prototype.inspect = function () { + return 'new MinKey()'; + }; + return MinKey; +}()); +Object.defineProperty(MinKey.prototype, '_bsontype', { value: 'MinKey' }); + +// Regular expression that checks for hex value +var checkForHexRegExp = new RegExp('^[0-9a-fA-F]{24}$'); +// Unique sequence for the current process (initialized on first use) +var PROCESS_UNIQUE = null; +var kId = Symbol('id'); +/** + * A class representation of the BSON ObjectId type. + * @public + * @category BSONType + */ +var ObjectId = /** @class */ (function () { + /** + * Create an ObjectId type + * + * @param inputId - Can be a 24 character hex string, 12 byte binary Buffer, or a number. + */ + function ObjectId(inputId) { + if (!(this instanceof ObjectId)) + return new ObjectId(inputId); + // workingId is set based on type of input and whether valid id exists for the input + var workingId; + if (typeof inputId === 'object' && inputId && 'id' in inputId) { + if (typeof inputId.id !== 'string' && !ArrayBuffer.isView(inputId.id)) { + throw new BSONTypeError('Argument passed in must have an id that is of type string or Buffer'); + } + if ('toHexString' in inputId && typeof inputId.toHexString === 'function') { + workingId = Buffer.from(inputId.toHexString(), 'hex'); + } + else { + workingId = inputId.id; + } + } + else { + workingId = inputId; + } + // the following cases use workingId to construct an ObjectId + if (workingId == null || typeof workingId === 'number') { + // The most common use case (blank id, new objectId instance) + // Generate a new id + this[kId] = ObjectId.generate(typeof workingId === 'number' ? workingId : undefined); + } + else if (ArrayBuffer.isView(workingId) && workingId.byteLength === 12) { + // If intstanceof matches we can escape calling ensure buffer in Node.js environments + this[kId] = workingId instanceof Buffer ? workingId : ensureBuffer(workingId); + } + else if (typeof workingId === 'string') { + if (workingId.length === 12) { + var bytes = Buffer.from(workingId); + if (bytes.byteLength === 12) { + this[kId] = bytes; + } + else { + throw new BSONTypeError('Argument passed in must be a string of 12 bytes'); + } + } + else if (workingId.length === 24 && checkForHexRegExp.test(workingId)) { + this[kId] = Buffer.from(workingId, 'hex'); + } + else { + throw new BSONTypeError('Argument passed in must be a string of 12 bytes or a string of 24 hex characters or an integer'); + } + } + else { + throw new BSONTypeError('Argument passed in does not match the accepted types'); + } + // If we are caching the hex string + if (ObjectId.cacheHexString) { + this.__id = this.id.toString('hex'); + } + } + Object.defineProperty(ObjectId.prototype, "id", { + /** + * The ObjectId bytes + * @readonly + */ + get: function () { + return this[kId]; + }, + set: function (value) { + this[kId] = value; + if (ObjectId.cacheHexString) { + this.__id = value.toString('hex'); + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(ObjectId.prototype, "generationTime", { + /** + * The generation time of this ObjectId instance + * @deprecated Please use getTimestamp / createFromTime which returns an int32 epoch + */ + get: function () { + return this.id.readInt32BE(0); + }, + set: function (value) { + // Encode time into first 4 bytes + this.id.writeUInt32BE(value, 0); + }, + enumerable: false, + configurable: true + }); + /** Returns the ObjectId id as a 24 character hex string representation */ + ObjectId.prototype.toHexString = function () { + if (ObjectId.cacheHexString && this.__id) { + return this.__id; + } + var hexString = this.id.toString('hex'); + if (ObjectId.cacheHexString && !this.__id) { + this.__id = hexString; + } + return hexString; + }; + /** + * Update the ObjectId index + * @privateRemarks + * Used in generating new ObjectId's on the driver + * @internal + */ + ObjectId.getInc = function () { + return (ObjectId.index = (ObjectId.index + 1) % 0xffffff); + }; + /** + * Generate a 12 byte id buffer used in ObjectId's + * + * @param time - pass in a second based timestamp. + */ + ObjectId.generate = function (time) { + if ('number' !== typeof time) { + time = Math.floor(Date.now() / 1000); + } + var inc = ObjectId.getInc(); + var buffer = Buffer.alloc(12); + // 4-byte timestamp + buffer.writeUInt32BE(time, 0); + // set PROCESS_UNIQUE if yet not initialized + if (PROCESS_UNIQUE === null) { + PROCESS_UNIQUE = randomBytes(5); + } + // 5-byte process unique + buffer[4] = PROCESS_UNIQUE[0]; + buffer[5] = PROCESS_UNIQUE[1]; + buffer[6] = PROCESS_UNIQUE[2]; + buffer[7] = PROCESS_UNIQUE[3]; + buffer[8] = PROCESS_UNIQUE[4]; + // 3-byte counter + buffer[11] = inc & 0xff; + buffer[10] = (inc >> 8) & 0xff; + buffer[9] = (inc >> 16) & 0xff; + return buffer; + }; + /** + * Converts the id into a 24 character hex string for printing + * + * @param format - The Buffer toString format parameter. + */ + ObjectId.prototype.toString = function (format) { + // Is the id a buffer then use the buffer toString method to return the format + if (format) + return this.id.toString(format); + return this.toHexString(); + }; + /** Converts to its JSON the 24 character hex string representation. */ + ObjectId.prototype.toJSON = function () { + return this.toHexString(); + }; + /** + * Compares the equality of this ObjectId with `otherID`. + * + * @param otherId - ObjectId instance to compare against. + */ + ObjectId.prototype.equals = function (otherId) { + if (otherId === undefined || otherId === null) { + return false; + } + if (otherId instanceof ObjectId) { + return this[kId][11] === otherId[kId][11] && this[kId].equals(otherId[kId]); + } + if (typeof otherId === 'string' && + ObjectId.isValid(otherId) && + otherId.length === 12 && + isUint8Array(this.id)) { + return otherId === Buffer.prototype.toString.call(this.id, 'latin1'); + } + if (typeof otherId === 'string' && ObjectId.isValid(otherId) && otherId.length === 24) { + return otherId.toLowerCase() === this.toHexString(); + } + if (typeof otherId === 'string' && ObjectId.isValid(otherId) && otherId.length === 12) { + return Buffer.from(otherId).equals(this.id); + } + if (typeof otherId === 'object' && + 'toHexString' in otherId && + typeof otherId.toHexString === 'function') { + var otherIdString = otherId.toHexString(); + var thisIdString = this.toHexString().toLowerCase(); + return typeof otherIdString === 'string' && otherIdString.toLowerCase() === thisIdString; + } + return false; + }; + /** Returns the generation date (accurate up to the second) that this ID was generated. */ + ObjectId.prototype.getTimestamp = function () { + var timestamp = new Date(); + var time = this.id.readUInt32BE(0); + timestamp.setTime(Math.floor(time) * 1000); + return timestamp; + }; + /** @internal */ + ObjectId.createPk = function () { + return new ObjectId(); + }; + /** + * Creates an ObjectId from a second based number, with the rest of the ObjectId zeroed out. Used for comparisons or sorting the ObjectId. + * + * @param time - an integer number representing a number of seconds. + */ + ObjectId.createFromTime = function (time) { + var buffer = Buffer.from([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]); + // Encode time into first 4 bytes + buffer.writeUInt32BE(time, 0); + // Return the new objectId + return new ObjectId(buffer); + }; + /** + * Creates an ObjectId from a hex string representation of an ObjectId. + * + * @param hexString - create a ObjectId from a passed in 24 character hexstring. + */ + ObjectId.createFromHexString = function (hexString) { + // Throw an error if it's not a valid setup + if (typeof hexString === 'undefined' || (hexString != null && hexString.length !== 24)) { + throw new BSONTypeError('Argument passed in must be a single String of 12 bytes or a string of 24 hex characters'); + } + return new ObjectId(Buffer.from(hexString, 'hex')); + }; + /** + * Checks if a value is a valid bson ObjectId + * + * @param id - ObjectId instance to validate. + */ + ObjectId.isValid = function (id) { + if (id == null) + return false; + try { + new ObjectId(id); + return true; + } + catch (_a) { + return false; + } + }; + /** @internal */ + ObjectId.prototype.toExtendedJSON = function () { + if (this.toHexString) + return { $oid: this.toHexString() }; + return { $oid: this.toString('hex') }; + }; + /** @internal */ + ObjectId.fromExtendedJSON = function (doc) { + return new ObjectId(doc.$oid); + }; + /** + * Converts to a string representation of this Id. + * + * @returns return the 24 character hex string representation. + * @internal + */ + ObjectId.prototype[Symbol.for('nodejs.util.inspect.custom')] = function () { + return this.inspect(); + }; + ObjectId.prototype.inspect = function () { + return "new ObjectId(\"" + this.toHexString() + "\")"; + }; + /** @internal */ + ObjectId.index = Math.floor(Math.random() * 0xffffff); + return ObjectId; +}()); +// Deprecated methods +Object.defineProperty(ObjectId.prototype, 'generate', { + value: deprecate(function (time) { return ObjectId.generate(time); }, 'Please use the static `ObjectId.generate(time)` instead') +}); +Object.defineProperty(ObjectId.prototype, 'getInc', { + value: deprecate(function () { return ObjectId.getInc(); }, 'Please use the static `ObjectId.getInc()` instead') +}); +Object.defineProperty(ObjectId.prototype, 'get_inc', { + value: deprecate(function () { return ObjectId.getInc(); }, 'Please use the static `ObjectId.getInc()` instead') +}); +Object.defineProperty(ObjectId, 'get_inc', { + value: deprecate(function () { return ObjectId.getInc(); }, 'Please use the static `ObjectId.getInc()` instead') +}); +Object.defineProperty(ObjectId.prototype, '_bsontype', { value: 'ObjectID' }); + +function alphabetize(str) { + return str.split('').sort().join(''); +} +/** + * A class representation of the BSON RegExp type. + * @public + * @category BSONType + */ +var BSONRegExp = /** @class */ (function () { + /** + * @param pattern - The regular expression pattern to match + * @param options - The regular expression options + */ + function BSONRegExp(pattern, options) { + if (!(this instanceof BSONRegExp)) + return new BSONRegExp(pattern, options); + this.pattern = pattern; + this.options = alphabetize(options !== null && options !== void 0 ? options : ''); + if (this.pattern.indexOf('\x00') !== -1) { + throw new BSONError("BSON Regex patterns cannot contain null bytes, found: " + JSON.stringify(this.pattern)); + } + if (this.options.indexOf('\x00') !== -1) { + throw new BSONError("BSON Regex options cannot contain null bytes, found: " + JSON.stringify(this.options)); + } + // Validate options + for (var i = 0; i < this.options.length; i++) { + if (!(this.options[i] === 'i' || + this.options[i] === 'm' || + this.options[i] === 'x' || + this.options[i] === 'l' || + this.options[i] === 's' || + this.options[i] === 'u')) { + throw new BSONError("The regular expression option [" + this.options[i] + "] is not supported"); + } + } + } + BSONRegExp.parseOptions = function (options) { + return options ? options.split('').sort().join('') : ''; + }; + /** @internal */ + BSONRegExp.prototype.toExtendedJSON = function (options) { + options = options || {}; + if (options.legacy) { + return { $regex: this.pattern, $options: this.options }; + } + return { $regularExpression: { pattern: this.pattern, options: this.options } }; + }; + /** @internal */ + BSONRegExp.fromExtendedJSON = function (doc) { + if ('$regex' in doc) { + if (typeof doc.$regex !== 'string') { + // This is for $regex query operators that have extended json values. + if (doc.$regex._bsontype === 'BSONRegExp') { + return doc; + } + } + else { + return new BSONRegExp(doc.$regex, BSONRegExp.parseOptions(doc.$options)); + } + } + if ('$regularExpression' in doc) { + return new BSONRegExp(doc.$regularExpression.pattern, BSONRegExp.parseOptions(doc.$regularExpression.options)); + } + throw new BSONTypeError("Unexpected BSONRegExp EJSON object form: " + JSON.stringify(doc)); + }; + return BSONRegExp; +}()); +Object.defineProperty(BSONRegExp.prototype, '_bsontype', { value: 'BSONRegExp' }); + +/** + * A class representation of the BSON Symbol type. + * @public + * @category BSONType + */ +var BSONSymbol = /** @class */ (function () { + /** + * @param value - the string representing the symbol. + */ + function BSONSymbol(value) { + if (!(this instanceof BSONSymbol)) + return new BSONSymbol(value); + this.value = value; + } + /** Access the wrapped string value. */ + BSONSymbol.prototype.valueOf = function () { + return this.value; + }; + BSONSymbol.prototype.toString = function () { + return this.value; + }; + /** @internal */ + BSONSymbol.prototype.inspect = function () { + return "new BSONSymbol(\"" + this.value + "\")"; + }; + BSONSymbol.prototype.toJSON = function () { + return this.value; + }; + /** @internal */ + BSONSymbol.prototype.toExtendedJSON = function () { + return { $symbol: this.value }; + }; + /** @internal */ + BSONSymbol.fromExtendedJSON = function (doc) { + return new BSONSymbol(doc.$symbol); + }; + /** @internal */ + BSONSymbol.prototype[Symbol.for('nodejs.util.inspect.custom')] = function () { + return this.inspect(); + }; + return BSONSymbol; +}()); +Object.defineProperty(BSONSymbol.prototype, '_bsontype', { value: 'Symbol' }); + +/** @public */ +var LongWithoutOverridesClass = Long; +/** + * @public + * @category BSONType + * */ +var Timestamp = /** @class */ (function (_super) { + __extends(Timestamp, _super); + function Timestamp(low, high) { + var _this = this; + // eslint-disable-next-line @typescript-eslint/ban-ts-comment + ///@ts-expect-error + if (!(_this instanceof Timestamp)) + return new Timestamp(low, high); + if (Long.isLong(low)) { + _this = _super.call(this, low.low, low.high, true) || this; + } + else if (isObjectLike(low) && typeof low.t !== 'undefined' && typeof low.i !== 'undefined') { + _this = _super.call(this, low.i, low.t, true) || this; + } + else { + _this = _super.call(this, low, high, true) || this; + } + Object.defineProperty(_this, '_bsontype', { + value: 'Timestamp', + writable: false, + configurable: false, + enumerable: false + }); + return _this; + } + Timestamp.prototype.toJSON = function () { + return { + $timestamp: this.toString() + }; + }; + /** Returns a Timestamp represented by the given (32-bit) integer value. */ + Timestamp.fromInt = function (value) { + return new Timestamp(Long.fromInt(value, true)); + }; + /** Returns a Timestamp representing the given number value, provided that it is a finite number. Otherwise, zero is returned. */ + Timestamp.fromNumber = function (value) { + return new Timestamp(Long.fromNumber(value, true)); + }; + /** + * Returns a Timestamp for the given high and low bits. Each is assumed to use 32 bits. + * + * @param lowBits - the low 32-bits. + * @param highBits - the high 32-bits. + */ + Timestamp.fromBits = function (lowBits, highBits) { + return new Timestamp(lowBits, highBits); + }; + /** + * Returns a Timestamp from the given string, optionally using the given radix. + * + * @param str - the textual representation of the Timestamp. + * @param optRadix - the radix in which the text is written. + */ + Timestamp.fromString = function (str, optRadix) { + return new Timestamp(Long.fromString(str, true, optRadix)); + }; + /** @internal */ + Timestamp.prototype.toExtendedJSON = function () { + return { $timestamp: { t: this.high >>> 0, i: this.low >>> 0 } }; + }; + /** @internal */ + Timestamp.fromExtendedJSON = function (doc) { + return new Timestamp(doc.$timestamp); + }; + /** @internal */ + Timestamp.prototype[Symbol.for('nodejs.util.inspect.custom')] = function () { + return this.inspect(); + }; + Timestamp.prototype.inspect = function () { + return "new Timestamp({ t: " + this.getHighBits() + ", i: " + this.getLowBits() + " })"; + }; + Timestamp.MAX_VALUE = Long.MAX_UNSIGNED_VALUE; + return Timestamp; +}(LongWithoutOverridesClass)); + +function isBSONType(value) { + return (isObjectLike(value) && Reflect.has(value, '_bsontype') && typeof value._bsontype === 'string'); +} +// INT32 boundaries +var BSON_INT32_MAX$1 = 0x7fffffff; +var BSON_INT32_MIN$1 = -0x80000000; +// INT64 boundaries +var BSON_INT64_MAX$1 = 0x7fffffffffffffff; +var BSON_INT64_MIN$1 = -0x8000000000000000; +// all the types where we don't need to do any special processing and can just pass the EJSON +//straight to type.fromExtendedJSON +var keysToCodecs = { + $oid: ObjectId, + $binary: Binary, + $uuid: Binary, + $symbol: BSONSymbol, + $numberInt: Int32, + $numberDecimal: Decimal128, + $numberDouble: Double, + $numberLong: Long, + $minKey: MinKey, + $maxKey: MaxKey, + $regex: BSONRegExp, + $regularExpression: BSONRegExp, + $timestamp: Timestamp +}; +// eslint-disable-next-line @typescript-eslint/no-explicit-any +function deserializeValue(value, options) { + if (options === void 0) { options = {}; } + if (typeof value === 'number') { + if (options.relaxed || options.legacy) { + return value; + } + // if it's an integer, should interpret as smallest BSON integer + // that can represent it exactly. (if out of range, interpret as double.) + if (Math.floor(value) === value) { + if (value >= BSON_INT32_MIN$1 && value <= BSON_INT32_MAX$1) + return new Int32(value); + if (value >= BSON_INT64_MIN$1 && value <= BSON_INT64_MAX$1) + return Long.fromNumber(value); + } + // If the number is a non-integer or out of integer range, should interpret as BSON Double. + return new Double(value); + } + // from here on out we're looking for bson types, so bail if its not an object + if (value == null || typeof value !== 'object') + return value; + // upgrade deprecated undefined to null + if (value.$undefined) + return null; + var keys = Object.keys(value).filter(function (k) { return k.startsWith('$') && value[k] != null; }); + for (var i = 0; i < keys.length; i++) { + var c = keysToCodecs[keys[i]]; + if (c) + return c.fromExtendedJSON(value, options); + } + if (value.$date != null) { + var d = value.$date; + var date = new Date(); + if (options.legacy) { + if (typeof d === 'number') + date.setTime(d); + else if (typeof d === 'string') + date.setTime(Date.parse(d)); + } + else { + if (typeof d === 'string') + date.setTime(Date.parse(d)); + else if (Long.isLong(d)) + date.setTime(d.toNumber()); + else if (typeof d === 'number' && options.relaxed) + date.setTime(d); + } + return date; + } + if (value.$code != null) { + var copy = Object.assign({}, value); + if (value.$scope) { + copy.$scope = deserializeValue(value.$scope); + } + return Code.fromExtendedJSON(value); + } + if (isDBRefLike(value) || value.$dbPointer) { + var v = value.$ref ? value : value.$dbPointer; + // we run into this in a "degenerate EJSON" case (with $id and $ref order flipped) + // because of the order JSON.parse goes through the document + if (v instanceof DBRef) + return v; + var dollarKeys = Object.keys(v).filter(function (k) { return k.startsWith('$'); }); + var valid_1 = true; + dollarKeys.forEach(function (k) { + if (['$ref', '$id', '$db'].indexOf(k) === -1) + valid_1 = false; + }); + // only make DBRef if $ keys are all valid + if (valid_1) + return DBRef.fromExtendedJSON(v); + } + return value; +} +// eslint-disable-next-line @typescript-eslint/no-explicit-any +function serializeArray(array, options) { + return array.map(function (v, index) { + options.seenObjects.push({ propertyName: "index " + index, obj: null }); + try { + return serializeValue(v, options); + } + finally { + options.seenObjects.pop(); + } + }); +} +function getISOString(date) { + var isoStr = date.toISOString(); + // we should only show milliseconds in timestamp if they're non-zero + return date.getUTCMilliseconds() !== 0 ? isoStr : isoStr.slice(0, -5) + 'Z'; +} +// eslint-disable-next-line @typescript-eslint/no-explicit-any +function serializeValue(value, options) { + if ((typeof value === 'object' || typeof value === 'function') && value !== null) { + var index = options.seenObjects.findIndex(function (entry) { return entry.obj === value; }); + if (index !== -1) { + var props = options.seenObjects.map(function (entry) { return entry.propertyName; }); + var leadingPart = props + .slice(0, index) + .map(function (prop) { return prop + " -> "; }) + .join(''); + var alreadySeen = props[index]; + var circularPart = ' -> ' + + props + .slice(index + 1, props.length - 1) + .map(function (prop) { return prop + " -> "; }) + .join(''); + var current = props[props.length - 1]; + var leadingSpace = ' '.repeat(leadingPart.length + alreadySeen.length / 2); + var dashes = '-'.repeat(circularPart.length + (alreadySeen.length + current.length) / 2 - 1); + throw new BSONTypeError('Converting circular structure to EJSON:\n' + + (" " + leadingPart + alreadySeen + circularPart + current + "\n") + + (" " + leadingSpace + "\\" + dashes + "/")); + } + options.seenObjects[options.seenObjects.length - 1].obj = value; + } + if (Array.isArray(value)) + return serializeArray(value, options); + if (value === undefined) + return null; + if (value instanceof Date || isDate(value)) { + var dateNum = value.getTime(), + // is it in year range 1970-9999? + inRange = dateNum > -1 && dateNum < 253402318800000; + if (options.legacy) { + return options.relaxed && inRange + ? { $date: value.getTime() } + : { $date: getISOString(value) }; + } + return options.relaxed && inRange + ? { $date: getISOString(value) } + : { $date: { $numberLong: value.getTime().toString() } }; + } + if (typeof value === 'number' && (!options.relaxed || !isFinite(value))) { + // it's an integer + if (Math.floor(value) === value) { + var int32Range = value >= BSON_INT32_MIN$1 && value <= BSON_INT32_MAX$1, int64Range = value >= BSON_INT64_MIN$1 && value <= BSON_INT64_MAX$1; + // interpret as being of the smallest BSON integer type that can represent the number exactly + if (int32Range) + return { $numberInt: value.toString() }; + if (int64Range) + return { $numberLong: value.toString() }; + } + return { $numberDouble: value.toString() }; + } + if (value instanceof RegExp || isRegExp(value)) { + var flags = value.flags; + if (flags === undefined) { + var match = value.toString().match(/[gimuy]*$/); + if (match) { + flags = match[0]; + } + } + var rx = new BSONRegExp(value.source, flags); + return rx.toExtendedJSON(options); + } + if (value != null && typeof value === 'object') + return serializeDocument(value, options); + return value; +} +var BSON_TYPE_MAPPINGS = { + Binary: function (o) { return new Binary(o.value(), o.sub_type); }, + Code: function (o) { return new Code(o.code, o.scope); }, + DBRef: function (o) { return new DBRef(o.collection || o.namespace, o.oid, o.db, o.fields); }, + Decimal128: function (o) { return new Decimal128(o.bytes); }, + Double: function (o) { return new Double(o.value); }, + Int32: function (o) { return new Int32(o.value); }, + Long: function (o) { + return Long.fromBits( + // underscore variants for 1.x backwards compatibility + o.low != null ? o.low : o.low_, o.low != null ? o.high : o.high_, o.low != null ? o.unsigned : o.unsigned_); + }, + MaxKey: function () { return new MaxKey(); }, + MinKey: function () { return new MinKey(); }, + ObjectID: function (o) { return new ObjectId(o); }, + ObjectId: function (o) { return new ObjectId(o); }, + BSONRegExp: function (o) { return new BSONRegExp(o.pattern, o.options); }, + Symbol: function (o) { return new BSONSymbol(o.value); }, + Timestamp: function (o) { return Timestamp.fromBits(o.low, o.high); } +}; +// eslint-disable-next-line @typescript-eslint/no-explicit-any +function serializeDocument(doc, options) { + if (doc == null || typeof doc !== 'object') + throw new BSONError('not an object instance'); + var bsontype = doc._bsontype; + if (typeof bsontype === 'undefined') { + // It's a regular object. Recursively serialize its property values. + var _doc = {}; + for (var name in doc) { + options.seenObjects.push({ propertyName: name, obj: null }); + try { + _doc[name] = serializeValue(doc[name], options); + } + finally { + options.seenObjects.pop(); + } + } + return _doc; + } + else if (isBSONType(doc)) { + // the "document" is really just a BSON type object + // eslint-disable-next-line @typescript-eslint/no-explicit-any + var outDoc = doc; + if (typeof outDoc.toExtendedJSON !== 'function') { + // There's no EJSON serialization function on the object. It's probably an + // object created by a previous version of this library (or another library) + // that's duck-typing objects to look like they were generated by this library). + // Copy the object into this library's version of that type. + var mapper = BSON_TYPE_MAPPINGS[doc._bsontype]; + if (!mapper) { + throw new BSONTypeError('Unrecognized or invalid _bsontype: ' + doc._bsontype); + } + outDoc = mapper(outDoc); + } + // Two BSON types may have nested objects that may need to be serialized too + if (bsontype === 'Code' && outDoc.scope) { + outDoc = new Code(outDoc.code, serializeValue(outDoc.scope, options)); + } + else if (bsontype === 'DBRef' && outDoc.oid) { + outDoc = new DBRef(serializeValue(outDoc.collection, options), serializeValue(outDoc.oid, options), serializeValue(outDoc.db, options), serializeValue(outDoc.fields, options)); + } + return outDoc.toExtendedJSON(options); + } + else { + throw new BSONError('_bsontype must be a string, but was: ' + typeof bsontype); + } +} +/** + * EJSON parse / stringify API + * @public + */ +// the namespace here is used to emulate `export * as EJSON from '...'` +// which as of now (sept 2020) api-extractor does not support +// eslint-disable-next-line @typescript-eslint/no-namespace +var EJSON; +(function (EJSON) { + /** + * Parse an Extended JSON string, constructing the JavaScript value or object described by that + * string. + * + * @example + * ```js + * const { EJSON } = require('bson'); + * const text = '{ "int32": { "$numberInt": "10" } }'; + * + * // prints { int32: { [String: '10'] _bsontype: 'Int32', value: '10' } } + * console.log(EJSON.parse(text, { relaxed: false })); + * + * // prints { int32: 10 } + * console.log(EJSON.parse(text)); + * ``` + */ + function parse(text, options) { + var finalOptions = Object.assign({}, { relaxed: true, legacy: false }, options); + // relaxed implies not strict + if (typeof finalOptions.relaxed === 'boolean') + finalOptions.strict = !finalOptions.relaxed; + if (typeof finalOptions.strict === 'boolean') + finalOptions.relaxed = !finalOptions.strict; + return JSON.parse(text, function (key, value) { + if (key.indexOf('\x00') !== -1) { + throw new BSONError("BSON Document field names cannot contain null bytes, found: " + JSON.stringify(key)); + } + return deserializeValue(value, finalOptions); + }); + } + EJSON.parse = parse; + /** + * Converts a BSON document to an Extended JSON string, optionally replacing values if a replacer + * function is specified or optionally including only the specified properties if a replacer array + * is specified. + * + * @param value - The value to convert to extended JSON + * @param replacer - A function that alters the behavior of the stringification process, or an array of String and Number objects that serve as a whitelist for selecting/filtering the properties of the value object to be included in the JSON string. If this value is null or not provided, all properties of the object are included in the resulting JSON string + * @param space - A String or Number object that's used to insert white space into the output JSON string for readability purposes. + * @param options - Optional settings + * + * @example + * ```js + * const { EJSON } = require('bson'); + * const Int32 = require('mongodb').Int32; + * const doc = { int32: new Int32(10) }; + * + * // prints '{"int32":{"$numberInt":"10"}}' + * console.log(EJSON.stringify(doc, { relaxed: false })); + * + * // prints '{"int32":10}' + * console.log(EJSON.stringify(doc)); + * ``` + */ + function stringify(value, + // eslint-disable-next-line @typescript-eslint/no-explicit-any + replacer, space, options) { + if (space != null && typeof space === 'object') { + options = space; + space = 0; + } + if (replacer != null && typeof replacer === 'object' && !Array.isArray(replacer)) { + options = replacer; + replacer = undefined; + space = 0; + } + var serializeOptions = Object.assign({ relaxed: true, legacy: false }, options, { + seenObjects: [{ propertyName: '(root)', obj: null }] + }); + var doc = serializeValue(value, serializeOptions); + return JSON.stringify(doc, replacer, space); + } + EJSON.stringify = stringify; + /** + * Serializes an object to an Extended JSON string, and reparse it as a JavaScript object. + * + * @param value - The object to serialize + * @param options - Optional settings passed to the `stringify` function + */ + function serialize(value, options) { + options = options || {}; + return JSON.parse(stringify(value, options)); + } + EJSON.serialize = serialize; + /** + * Deserializes an Extended JSON object into a plain JavaScript object with native/BSON types + * + * @param ejson - The Extended JSON object to deserialize + * @param options - Optional settings passed to the parse method + */ + function deserialize(ejson, options) { + options = options || {}; + return parse(JSON.stringify(ejson), options); + } + EJSON.deserialize = deserialize; +})(EJSON || (EJSON = {})); + +/* eslint-disable @typescript-eslint/no-explicit-any */ +/** @public */ +var bsonMap; +var bsonGlobal = getGlobal(); +if (bsonGlobal.Map) { + bsonMap = bsonGlobal.Map; +} +else { + // We will return a polyfill + bsonMap = /** @class */ (function () { + function Map(array) { + if (array === void 0) { array = []; } + this._keys = []; + this._values = {}; + for (var i = 0; i < array.length; i++) { + if (array[i] == null) + continue; // skip null and undefined + var entry = array[i]; + var key = entry[0]; + var value = entry[1]; + // Add the key to the list of keys in order + this._keys.push(key); + // Add the key and value to the values dictionary with a point + // to the location in the ordered keys list + this._values[key] = { v: value, i: this._keys.length - 1 }; + } + } + Map.prototype.clear = function () { + this._keys = []; + this._values = {}; + }; + Map.prototype.delete = function (key) { + var value = this._values[key]; + if (value == null) + return false; + // Delete entry + delete this._values[key]; + // Remove the key from the ordered keys list + this._keys.splice(value.i, 1); + return true; + }; + Map.prototype.entries = function () { + var _this = this; + var index = 0; + return { + next: function () { + var key = _this._keys[index++]; + return { + value: key !== undefined ? [key, _this._values[key].v] : undefined, + done: key !== undefined ? false : true + }; + } + }; + }; + Map.prototype.forEach = function (callback, self) { + self = self || this; + for (var i = 0; i < this._keys.length; i++) { + var key = this._keys[i]; + // Call the forEach callback + callback.call(self, this._values[key].v, key, self); + } + }; + Map.prototype.get = function (key) { + return this._values[key] ? this._values[key].v : undefined; + }; + Map.prototype.has = function (key) { + return this._values[key] != null; + }; + Map.prototype.keys = function () { + var _this = this; + var index = 0; + return { + next: function () { + var key = _this._keys[index++]; + return { + value: key !== undefined ? key : undefined, + done: key !== undefined ? false : true + }; + } + }; + }; + Map.prototype.set = function (key, value) { + if (this._values[key]) { + this._values[key].v = value; + return this; + } + // Add the key to the list of keys in order + this._keys.push(key); + // Add the key and value to the values dictionary with a point + // to the location in the ordered keys list + this._values[key] = { v: value, i: this._keys.length - 1 }; + return this; + }; + Map.prototype.values = function () { + var _this = this; + var index = 0; + return { + next: function () { + var key = _this._keys[index++]; + return { + value: key !== undefined ? _this._values[key].v : undefined, + done: key !== undefined ? false : true + }; + } + }; + }; + Object.defineProperty(Map.prototype, "size", { + get: function () { + return this._keys.length; + }, + enumerable: false, + configurable: true + }); + return Map; + }()); +} + +/** @internal */ +var BSON_INT32_MAX = 0x7fffffff; +/** @internal */ +var BSON_INT32_MIN = -0x80000000; +/** @internal */ +var BSON_INT64_MAX = Math.pow(2, 63) - 1; +/** @internal */ +var BSON_INT64_MIN = -Math.pow(2, 63); +/** + * Any integer up to 2^53 can be precisely represented by a double. + * @internal + */ +var JS_INT_MAX = Math.pow(2, 53); +/** + * Any integer down to -2^53 can be precisely represented by a double. + * @internal + */ +var JS_INT_MIN = -Math.pow(2, 53); +/** Number BSON Type @internal */ +var BSON_DATA_NUMBER = 1; +/** String BSON Type @internal */ +var BSON_DATA_STRING = 2; +/** Object BSON Type @internal */ +var BSON_DATA_OBJECT = 3; +/** Array BSON Type @internal */ +var BSON_DATA_ARRAY = 4; +/** Binary BSON Type @internal */ +var BSON_DATA_BINARY = 5; +/** Binary BSON Type @internal */ +var BSON_DATA_UNDEFINED = 6; +/** ObjectId BSON Type @internal */ +var BSON_DATA_OID = 7; +/** Boolean BSON Type @internal */ +var BSON_DATA_BOOLEAN = 8; +/** Date BSON Type @internal */ +var BSON_DATA_DATE = 9; +/** null BSON Type @internal */ +var BSON_DATA_NULL = 10; +/** RegExp BSON Type @internal */ +var BSON_DATA_REGEXP = 11; +/** Code BSON Type @internal */ +var BSON_DATA_DBPOINTER = 12; +/** Code BSON Type @internal */ +var BSON_DATA_CODE = 13; +/** Symbol BSON Type @internal */ +var BSON_DATA_SYMBOL = 14; +/** Code with Scope BSON Type @internal */ +var BSON_DATA_CODE_W_SCOPE = 15; +/** 32 bit Integer BSON Type @internal */ +var BSON_DATA_INT = 16; +/** Timestamp BSON Type @internal */ +var BSON_DATA_TIMESTAMP = 17; +/** Long BSON Type @internal */ +var BSON_DATA_LONG = 18; +/** Decimal128 BSON Type @internal */ +var BSON_DATA_DECIMAL128 = 19; +/** MinKey BSON Type @internal */ +var BSON_DATA_MIN_KEY = 0xff; +/** MaxKey BSON Type @internal */ +var BSON_DATA_MAX_KEY = 0x7f; +/** Binary Default Type @internal */ +var BSON_BINARY_SUBTYPE_DEFAULT = 0; +/** Binary Function Type @internal */ +var BSON_BINARY_SUBTYPE_FUNCTION = 1; +/** Binary Byte Array Type @internal */ +var BSON_BINARY_SUBTYPE_BYTE_ARRAY = 2; +/** Binary Deprecated UUID Type @deprecated Please use BSON_BINARY_SUBTYPE_UUID_NEW @internal */ +var BSON_BINARY_SUBTYPE_UUID = 3; +/** Binary UUID Type @internal */ +var BSON_BINARY_SUBTYPE_UUID_NEW = 4; +/** Binary MD5 Type @internal */ +var BSON_BINARY_SUBTYPE_MD5 = 5; +/** Encrypted BSON type @internal */ +var BSON_BINARY_SUBTYPE_ENCRYPTED = 6; +/** Column BSON type @internal */ +var BSON_BINARY_SUBTYPE_COLUMN = 7; +/** Binary User Defined Type @internal */ +var BSON_BINARY_SUBTYPE_USER_DEFINED = 128; + +function calculateObjectSize$1(object, serializeFunctions, ignoreUndefined) { + var totalLength = 4 + 1; + if (Array.isArray(object)) { + for (var i = 0; i < object.length; i++) { + totalLength += calculateElement(i.toString(), object[i], serializeFunctions, true, ignoreUndefined); + } + } + else { + // If we have toBSON defined, override the current object + if (typeof (object === null || object === void 0 ? void 0 : object.toBSON) === 'function') { + object = object.toBSON(); + } + // Calculate size + for (var key in object) { + totalLength += calculateElement(key, object[key], serializeFunctions, false, ignoreUndefined); + } + } + return totalLength; +} +/** @internal */ +function calculateElement(name, +// eslint-disable-next-line @typescript-eslint/no-explicit-any +value, serializeFunctions, isArray, ignoreUndefined) { + if (serializeFunctions === void 0) { serializeFunctions = false; } + if (isArray === void 0) { isArray = false; } + if (ignoreUndefined === void 0) { ignoreUndefined = false; } + // If we have toBSON defined, override the current object + if (typeof (value === null || value === void 0 ? void 0 : value.toBSON) === 'function') { + value = value.toBSON(); + } + switch (typeof value) { + case 'string': + return 1 + Buffer.byteLength(name, 'utf8') + 1 + 4 + Buffer.byteLength(value, 'utf8') + 1; + case 'number': + if (Math.floor(value) === value && + value >= JS_INT_MIN && + value <= JS_INT_MAX) { + if (value >= BSON_INT32_MIN && value <= BSON_INT32_MAX) { + // 32 bit + return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + (4 + 1); + } + else { + return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + (8 + 1); + } + } + else { + // 64 bit + return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + (8 + 1); + } + case 'undefined': + if (isArray || !ignoreUndefined) + return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + 1; + return 0; + case 'boolean': + return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + (1 + 1); + case 'object': + if (value == null || value['_bsontype'] === 'MinKey' || value['_bsontype'] === 'MaxKey') { + return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + 1; + } + else if (value['_bsontype'] === 'ObjectId' || value['_bsontype'] === 'ObjectID') { + return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + (12 + 1); + } + else if (value instanceof Date || isDate(value)) { + return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + (8 + 1); + } + else if (ArrayBuffer.isView(value) || + value instanceof ArrayBuffer || + isAnyArrayBuffer(value)) { + return ((name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + (1 + 4 + 1) + value.byteLength); + } + else if (value['_bsontype'] === 'Long' || + value['_bsontype'] === 'Double' || + value['_bsontype'] === 'Timestamp') { + return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + (8 + 1); + } + else if (value['_bsontype'] === 'Decimal128') { + return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + (16 + 1); + } + else if (value['_bsontype'] === 'Code') { + // Calculate size depending on the availability of a scope + if (value.scope != null && Object.keys(value.scope).length > 0) { + return ((name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + + 1 + + 4 + + 4 + + Buffer.byteLength(value.code.toString(), 'utf8') + + 1 + + calculateObjectSize$1(value.scope, serializeFunctions, ignoreUndefined)); + } + else { + return ((name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + + 1 + + 4 + + Buffer.byteLength(value.code.toString(), 'utf8') + + 1); + } + } + else if (value['_bsontype'] === 'Binary') { + // Check what kind of subtype we have + if (value.sub_type === Binary.SUBTYPE_BYTE_ARRAY) { + return ((name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + + (value.position + 1 + 4 + 1 + 4)); + } + else { + return ((name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + (value.position + 1 + 4 + 1)); + } + } + else if (value['_bsontype'] === 'Symbol') { + return ((name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + + Buffer.byteLength(value.value, 'utf8') + + 4 + + 1 + + 1); + } + else if (value['_bsontype'] === 'DBRef') { + // Set up correct object for serialization + var ordered_values = Object.assign({ + $ref: value.collection, + $id: value.oid + }, value.fields); + // Add db reference if it exists + if (value.db != null) { + ordered_values['$db'] = value.db; + } + return ((name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + + 1 + + calculateObjectSize$1(ordered_values, serializeFunctions, ignoreUndefined)); + } + else if (value instanceof RegExp || isRegExp(value)) { + return ((name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + + 1 + + Buffer.byteLength(value.source, 'utf8') + + 1 + + (value.global ? 1 : 0) + + (value.ignoreCase ? 1 : 0) + + (value.multiline ? 1 : 0) + + 1); + } + else if (value['_bsontype'] === 'BSONRegExp') { + return ((name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + + 1 + + Buffer.byteLength(value.pattern, 'utf8') + + 1 + + Buffer.byteLength(value.options, 'utf8') + + 1); + } + else { + return ((name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + + calculateObjectSize$1(value, serializeFunctions, ignoreUndefined) + + 1); + } + case 'function': + // WTF for 0.4.X where typeof /someregexp/ === 'function' + if (value instanceof RegExp || isRegExp(value) || String.call(value) === '[object RegExp]') { + return ((name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + + 1 + + Buffer.byteLength(value.source, 'utf8') + + 1 + + (value.global ? 1 : 0) + + (value.ignoreCase ? 1 : 0) + + (value.multiline ? 1 : 0) + + 1); + } + else { + if (serializeFunctions && value.scope != null && Object.keys(value.scope).length > 0) { + return ((name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + + 1 + + 4 + + 4 + + Buffer.byteLength(normalizedFunctionString(value), 'utf8') + + 1 + + calculateObjectSize$1(value.scope, serializeFunctions, ignoreUndefined)); + } + else if (serializeFunctions) { + return ((name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + + 1 + + 4 + + Buffer.byteLength(normalizedFunctionString(value), 'utf8') + + 1); + } + } + } + return 0; +} + +var FIRST_BIT = 0x80; +var FIRST_TWO_BITS = 0xc0; +var FIRST_THREE_BITS = 0xe0; +var FIRST_FOUR_BITS = 0xf0; +var FIRST_FIVE_BITS = 0xf8; +var TWO_BIT_CHAR = 0xc0; +var THREE_BIT_CHAR = 0xe0; +var FOUR_BIT_CHAR = 0xf0; +var CONTINUING_CHAR = 0x80; +/** + * Determines if the passed in bytes are valid utf8 + * @param bytes - An array of 8-bit bytes. Must be indexable and have length property + * @param start - The index to start validating + * @param end - The index to end validating + */ +function validateUtf8(bytes, start, end) { + var continuation = 0; + for (var i = start; i < end; i += 1) { + var byte = bytes[i]; + if (continuation) { + if ((byte & FIRST_TWO_BITS) !== CONTINUING_CHAR) { + return false; + } + continuation -= 1; + } + else if (byte & FIRST_BIT) { + if ((byte & FIRST_THREE_BITS) === TWO_BIT_CHAR) { + continuation = 1; + } + else if ((byte & FIRST_FOUR_BITS) === THREE_BIT_CHAR) { + continuation = 2; + } + else if ((byte & FIRST_FIVE_BITS) === FOUR_BIT_CHAR) { + continuation = 3; + } + else { + return false; + } + } + } + return !continuation; +} + +// Internal long versions +var JS_INT_MAX_LONG = Long.fromNumber(JS_INT_MAX); +var JS_INT_MIN_LONG = Long.fromNumber(JS_INT_MIN); +var functionCache = {}; +function deserialize$1(buffer, options, isArray) { + options = options == null ? {} : options; + var index = options && options.index ? options.index : 0; + // Read the document size + var size = buffer[index] | + (buffer[index + 1] << 8) | + (buffer[index + 2] << 16) | + (buffer[index + 3] << 24); + if (size < 5) { + throw new BSONError("bson size must be >= 5, is " + size); + } + if (options.allowObjectSmallerThanBufferSize && buffer.length < size) { + throw new BSONError("buffer length " + buffer.length + " must be >= bson size " + size); + } + if (!options.allowObjectSmallerThanBufferSize && buffer.length !== size) { + throw new BSONError("buffer length " + buffer.length + " must === bson size " + size); + } + if (size + index > buffer.byteLength) { + throw new BSONError("(bson size " + size + " + options.index " + index + " must be <= buffer length " + buffer.byteLength + ")"); + } + // Illegal end value + if (buffer[index + size - 1] !== 0) { + throw new BSONError("One object, sized correctly, with a spot for an EOO, but the EOO isn't 0x00"); + } + // Start deserializtion + return deserializeObject(buffer, index, options, isArray); +} +var allowedDBRefKeys = /^\$ref$|^\$id$|^\$db$/; +function deserializeObject(buffer, index, options, isArray) { + if (isArray === void 0) { isArray = false; } + var evalFunctions = options['evalFunctions'] == null ? false : options['evalFunctions']; + var cacheFunctions = options['cacheFunctions'] == null ? false : options['cacheFunctions']; + var fieldsAsRaw = options['fieldsAsRaw'] == null ? null : options['fieldsAsRaw']; + // Return raw bson buffer instead of parsing it + var raw = options['raw'] == null ? false : options['raw']; + // Return BSONRegExp objects instead of native regular expressions + var bsonRegExp = typeof options['bsonRegExp'] === 'boolean' ? options['bsonRegExp'] : false; + // Controls the promotion of values vs wrapper classes + var promoteBuffers = options['promoteBuffers'] == null ? false : options['promoteBuffers']; + var promoteLongs = options['promoteLongs'] == null ? true : options['promoteLongs']; + var promoteValues = options['promoteValues'] == null ? true : options['promoteValues']; + // Ensures default validation option if none given + var validation = options.validation == null ? { utf8: true } : options.validation; + // Shows if global utf-8 validation is enabled or disabled + var globalUTFValidation = true; + // Reflects utf-8 validation setting regardless of global or specific key validation + var validationSetting; + // Set of keys either to enable or disable validation on + var utf8KeysSet = new Set(); + // Check for boolean uniformity and empty validation option + var utf8ValidatedKeys = validation.utf8; + if (typeof utf8ValidatedKeys === 'boolean') { + validationSetting = utf8ValidatedKeys; + } + else { + globalUTFValidation = false; + var utf8ValidationValues = Object.keys(utf8ValidatedKeys).map(function (key) { + return utf8ValidatedKeys[key]; + }); + if (utf8ValidationValues.length === 0) { + throw new BSONError('UTF-8 validation setting cannot be empty'); + } + if (typeof utf8ValidationValues[0] !== 'boolean') { + throw new BSONError('Invalid UTF-8 validation option, must specify boolean values'); + } + validationSetting = utf8ValidationValues[0]; + // Ensures boolean uniformity in utf-8 validation (all true or all false) + if (!utf8ValidationValues.every(function (item) { return item === validationSetting; })) { + throw new BSONError('Invalid UTF-8 validation option - keys must be all true or all false'); + } + } + // Add keys to set that will either be validated or not based on validationSetting + if (!globalUTFValidation) { + for (var _i = 0, _a = Object.keys(utf8ValidatedKeys); _i < _a.length; _i++) { + var key = _a[_i]; + utf8KeysSet.add(key); + } + } + // Set the start index + var startIndex = index; + // Validate that we have at least 4 bytes of buffer + if (buffer.length < 5) + throw new BSONError('corrupt bson message < 5 bytes long'); + // Read the document size + var size = buffer[index++] | (buffer[index++] << 8) | (buffer[index++] << 16) | (buffer[index++] << 24); + // Ensure buffer is valid size + if (size < 5 || size > buffer.length) + throw new BSONError('corrupt bson message'); + // Create holding object + var object = isArray ? [] : {}; + // Used for arrays to skip having to perform utf8 decoding + var arrayIndex = 0; + var done = false; + var isPossibleDBRef = isArray ? false : null; + // While we have more left data left keep parsing + while (!done) { + // Read the type + var elementType = buffer[index++]; + // If we get a zero it's the last byte, exit + if (elementType === 0) + break; + // Get the start search index + var i = index; + // Locate the end of the c string + while (buffer[i] !== 0x00 && i < buffer.length) { + i++; + } + // If are at the end of the buffer there is a problem with the document + if (i >= buffer.byteLength) + throw new BSONError('Bad BSON Document: illegal CString'); + // Represents the key + var name = isArray ? arrayIndex++ : buffer.toString('utf8', index, i); + // shouldValidateKey is true if the key should be validated, false otherwise + var shouldValidateKey = true; + if (globalUTFValidation || utf8KeysSet.has(name)) { + shouldValidateKey = validationSetting; + } + else { + shouldValidateKey = !validationSetting; + } + if (isPossibleDBRef !== false && name[0] === '$') { + isPossibleDBRef = allowedDBRefKeys.test(name); + } + var value = void 0; + index = i + 1; + if (elementType === BSON_DATA_STRING) { + var stringSize = buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + if (stringSize <= 0 || + stringSize > buffer.length - index || + buffer[index + stringSize - 1] !== 0) { + throw new BSONError('bad string length in bson'); + } + value = getValidatedString(buffer, index, index + stringSize - 1, shouldValidateKey); + index = index + stringSize; + } + else if (elementType === BSON_DATA_OID) { + var oid = Buffer.alloc(12); + buffer.copy(oid, 0, index, index + 12); + value = new ObjectId(oid); + index = index + 12; + } + else if (elementType === BSON_DATA_INT && promoteValues === false) { + value = new Int32(buffer[index++] | (buffer[index++] << 8) | (buffer[index++] << 16) | (buffer[index++] << 24)); + } + else if (elementType === BSON_DATA_INT) { + value = + buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + } + else if (elementType === BSON_DATA_NUMBER && promoteValues === false) { + value = new Double(buffer.readDoubleLE(index)); + index = index + 8; + } + else if (elementType === BSON_DATA_NUMBER) { + value = buffer.readDoubleLE(index); + index = index + 8; + } + else if (elementType === BSON_DATA_DATE) { + var lowBits = buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + var highBits = buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + value = new Date(new Long(lowBits, highBits).toNumber()); + } + else if (elementType === BSON_DATA_BOOLEAN) { + if (buffer[index] !== 0 && buffer[index] !== 1) + throw new BSONError('illegal boolean type value'); + value = buffer[index++] === 1; + } + else if (elementType === BSON_DATA_OBJECT) { + var _index = index; + var objectSize = buffer[index] | + (buffer[index + 1] << 8) | + (buffer[index + 2] << 16) | + (buffer[index + 3] << 24); + if (objectSize <= 0 || objectSize > buffer.length - index) + throw new BSONError('bad embedded document length in bson'); + // We have a raw value + if (raw) { + value = buffer.slice(index, index + objectSize); + } + else { + var objectOptions = options; + if (!globalUTFValidation) { + objectOptions = _assign(_assign({}, options), { validation: { utf8: shouldValidateKey } }); + } + value = deserializeObject(buffer, _index, objectOptions, false); + } + index = index + objectSize; + } + else if (elementType === BSON_DATA_ARRAY) { + var _index = index; + var objectSize = buffer[index] | + (buffer[index + 1] << 8) | + (buffer[index + 2] << 16) | + (buffer[index + 3] << 24); + var arrayOptions = options; + // Stop index + var stopIndex = index + objectSize; + // All elements of array to be returned as raw bson + if (fieldsAsRaw && fieldsAsRaw[name]) { + arrayOptions = {}; + for (var n in options) { + arrayOptions[n] = options[n]; + } + arrayOptions['raw'] = true; + } + if (!globalUTFValidation) { + arrayOptions = _assign(_assign({}, arrayOptions), { validation: { utf8: shouldValidateKey } }); + } + value = deserializeObject(buffer, _index, arrayOptions, true); + index = index + objectSize; + if (buffer[index - 1] !== 0) + throw new BSONError('invalid array terminator byte'); + if (index !== stopIndex) + throw new BSONError('corrupted array bson'); + } + else if (elementType === BSON_DATA_UNDEFINED) { + value = undefined; + } + else if (elementType === BSON_DATA_NULL) { + value = null; + } + else if (elementType === BSON_DATA_LONG) { + // Unpack the low and high bits + var lowBits = buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + var highBits = buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + var long = new Long(lowBits, highBits); + // Promote the long if possible + if (promoteLongs && promoteValues === true) { + value = + long.lessThanOrEqual(JS_INT_MAX_LONG) && long.greaterThanOrEqual(JS_INT_MIN_LONG) + ? long.toNumber() + : long; + } + else { + value = long; + } + } + else if (elementType === BSON_DATA_DECIMAL128) { + // Buffer to contain the decimal bytes + var bytes = Buffer.alloc(16); + // Copy the next 16 bytes into the bytes buffer + buffer.copy(bytes, 0, index, index + 16); + // Update index + index = index + 16; + // Assign the new Decimal128 value + var decimal128 = new Decimal128(bytes); + // If we have an alternative mapper use that + if ('toObject' in decimal128 && typeof decimal128.toObject === 'function') { + value = decimal128.toObject(); + } + else { + value = decimal128; + } + } + else if (elementType === BSON_DATA_BINARY) { + var binarySize = buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + var totalBinarySize = binarySize; + var subType = buffer[index++]; + // Did we have a negative binary size, throw + if (binarySize < 0) + throw new BSONError('Negative binary type element size found'); + // Is the length longer than the document + if (binarySize > buffer.byteLength) + throw new BSONError('Binary type size larger than document size'); + // Decode as raw Buffer object if options specifies it + if (buffer['slice'] != null) { + // If we have subtype 2 skip the 4 bytes for the size + if (subType === Binary.SUBTYPE_BYTE_ARRAY) { + binarySize = + buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + if (binarySize < 0) + throw new BSONError('Negative binary type element size found for subtype 0x02'); + if (binarySize > totalBinarySize - 4) + throw new BSONError('Binary type with subtype 0x02 contains too long binary size'); + if (binarySize < totalBinarySize - 4) + throw new BSONError('Binary type with subtype 0x02 contains too short binary size'); + } + if (promoteBuffers && promoteValues) { + value = buffer.slice(index, index + binarySize); + } + else { + value = new Binary(buffer.slice(index, index + binarySize), subType); + } + } + else { + var _buffer = Buffer.alloc(binarySize); + // If we have subtype 2 skip the 4 bytes for the size + if (subType === Binary.SUBTYPE_BYTE_ARRAY) { + binarySize = + buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + if (binarySize < 0) + throw new BSONError('Negative binary type element size found for subtype 0x02'); + if (binarySize > totalBinarySize - 4) + throw new BSONError('Binary type with subtype 0x02 contains too long binary size'); + if (binarySize < totalBinarySize - 4) + throw new BSONError('Binary type with subtype 0x02 contains too short binary size'); + } + // Copy the data + for (i = 0; i < binarySize; i++) { + _buffer[i] = buffer[index + i]; + } + if (promoteBuffers && promoteValues) { + value = _buffer; + } + else { + value = new Binary(_buffer, subType); + } + } + // Update the index + index = index + binarySize; + } + else if (elementType === BSON_DATA_REGEXP && bsonRegExp === false) { + // Get the start search index + i = index; + // Locate the end of the c string + while (buffer[i] !== 0x00 && i < buffer.length) { + i++; + } + // If are at the end of the buffer there is a problem with the document + if (i >= buffer.length) + throw new BSONError('Bad BSON Document: illegal CString'); + // Return the C string + var source = buffer.toString('utf8', index, i); + // Create the regexp + index = i + 1; + // Get the start search index + i = index; + // Locate the end of the c string + while (buffer[i] !== 0x00 && i < buffer.length) { + i++; + } + // If are at the end of the buffer there is a problem with the document + if (i >= buffer.length) + throw new BSONError('Bad BSON Document: illegal CString'); + // Return the C string + var regExpOptions = buffer.toString('utf8', index, i); + index = i + 1; + // For each option add the corresponding one for javascript + var optionsArray = new Array(regExpOptions.length); + // Parse options + for (i = 0; i < regExpOptions.length; i++) { + switch (regExpOptions[i]) { + case 'm': + optionsArray[i] = 'm'; + break; + case 's': + optionsArray[i] = 'g'; + break; + case 'i': + optionsArray[i] = 'i'; + break; + } + } + value = new RegExp(source, optionsArray.join('')); + } + else if (elementType === BSON_DATA_REGEXP && bsonRegExp === true) { + // Get the start search index + i = index; + // Locate the end of the c string + while (buffer[i] !== 0x00 && i < buffer.length) { + i++; + } + // If are at the end of the buffer there is a problem with the document + if (i >= buffer.length) + throw new BSONError('Bad BSON Document: illegal CString'); + // Return the C string + var source = buffer.toString('utf8', index, i); + index = i + 1; + // Get the start search index + i = index; + // Locate the end of the c string + while (buffer[i] !== 0x00 && i < buffer.length) { + i++; + } + // If are at the end of the buffer there is a problem with the document + if (i >= buffer.length) + throw new BSONError('Bad BSON Document: illegal CString'); + // Return the C string + var regExpOptions = buffer.toString('utf8', index, i); + index = i + 1; + // Set the object + value = new BSONRegExp(source, regExpOptions); + } + else if (elementType === BSON_DATA_SYMBOL) { + var stringSize = buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + if (stringSize <= 0 || + stringSize > buffer.length - index || + buffer[index + stringSize - 1] !== 0) { + throw new BSONError('bad string length in bson'); + } + var symbol = getValidatedString(buffer, index, index + stringSize - 1, shouldValidateKey); + value = promoteValues ? symbol : new BSONSymbol(symbol); + index = index + stringSize; + } + else if (elementType === BSON_DATA_TIMESTAMP) { + var lowBits = buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + var highBits = buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + value = new Timestamp(lowBits, highBits); + } + else if (elementType === BSON_DATA_MIN_KEY) { + value = new MinKey(); + } + else if (elementType === BSON_DATA_MAX_KEY) { + value = new MaxKey(); + } + else if (elementType === BSON_DATA_CODE) { + var stringSize = buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + if (stringSize <= 0 || + stringSize > buffer.length - index || + buffer[index + stringSize - 1] !== 0) { + throw new BSONError('bad string length in bson'); + } + var functionString = getValidatedString(buffer, index, index + stringSize - 1, shouldValidateKey); + // If we are evaluating the functions + if (evalFunctions) { + // If we have cache enabled let's look for the md5 of the function in the cache + if (cacheFunctions) { + // Got to do this to avoid V8 deoptimizing the call due to finding eval + value = isolateEval(functionString, functionCache, object); + } + else { + value = isolateEval(functionString); + } + } + else { + value = new Code(functionString); + } + // Update parse index position + index = index + stringSize; + } + else if (elementType === BSON_DATA_CODE_W_SCOPE) { + var totalSize = buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + // Element cannot be shorter than totalSize + stringSize + documentSize + terminator + if (totalSize < 4 + 4 + 4 + 1) { + throw new BSONError('code_w_scope total size shorter minimum expected length'); + } + // Get the code string size + var stringSize = buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + // Check if we have a valid string + if (stringSize <= 0 || + stringSize > buffer.length - index || + buffer[index + stringSize - 1] !== 0) { + throw new BSONError('bad string length in bson'); + } + // Javascript function + var functionString = getValidatedString(buffer, index, index + stringSize - 1, shouldValidateKey); + // Update parse index position + index = index + stringSize; + // Parse the element + var _index = index; + // Decode the size of the object document + var objectSize = buffer[index] | + (buffer[index + 1] << 8) | + (buffer[index + 2] << 16) | + (buffer[index + 3] << 24); + // Decode the scope object + var scopeObject = deserializeObject(buffer, _index, options, false); + // Adjust the index + index = index + objectSize; + // Check if field length is too short + if (totalSize < 4 + 4 + objectSize + stringSize) { + throw new BSONError('code_w_scope total size is too short, truncating scope'); + } + // Check if totalSize field is too long + if (totalSize > 4 + 4 + objectSize + stringSize) { + throw new BSONError('code_w_scope total size is too long, clips outer document'); + } + // If we are evaluating the functions + if (evalFunctions) { + // If we have cache enabled let's look for the md5 of the function in the cache + if (cacheFunctions) { + // Got to do this to avoid V8 deoptimizing the call due to finding eval + value = isolateEval(functionString, functionCache, object); + } + else { + value = isolateEval(functionString); + } + value.scope = scopeObject; + } + else { + value = new Code(functionString, scopeObject); + } + } + else if (elementType === BSON_DATA_DBPOINTER) { + // Get the code string size + var stringSize = buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + // Check if we have a valid string + if (stringSize <= 0 || + stringSize > buffer.length - index || + buffer[index + stringSize - 1] !== 0) + throw new BSONError('bad string length in bson'); + // Namespace + if (validation != null && validation.utf8) { + if (!validateUtf8(buffer, index, index + stringSize - 1)) { + throw new BSONError('Invalid UTF-8 string in BSON document'); + } + } + var namespace = buffer.toString('utf8', index, index + stringSize - 1); + // Update parse index position + index = index + stringSize; + // Read the oid + var oidBuffer = Buffer.alloc(12); + buffer.copy(oidBuffer, 0, index, index + 12); + var oid = new ObjectId(oidBuffer); + // Update the index + index = index + 12; + // Upgrade to DBRef type + value = new DBRef(namespace, oid); + } + else { + throw new BSONError('Detected unknown BSON type ' + elementType.toString(16) + ' for fieldname "' + name + '"'); + } + if (name === '__proto__') { + Object.defineProperty(object, name, { + value: value, + writable: true, + enumerable: true, + configurable: true + }); + } + else { + object[name] = value; + } + } + // Check if the deserialization was against a valid array/object + if (size !== index - startIndex) { + if (isArray) + throw new BSONError('corrupt array bson'); + throw new BSONError('corrupt object bson'); + } + // if we did not find "$ref", "$id", "$db", or found an extraneous $key, don't make a DBRef + if (!isPossibleDBRef) + return object; + if (isDBRefLike(object)) { + var copy = Object.assign({}, object); + delete copy.$ref; + delete copy.$id; + delete copy.$db; + return new DBRef(object.$ref, object.$id, object.$db, copy); + } + return object; +} +/** + * Ensure eval is isolated, store the result in functionCache. + * + * @internal + */ +function isolateEval(functionString, functionCache, object) { + if (!functionCache) + return new Function(functionString); + // Check for cache hit, eval if missing and return cached function + if (functionCache[functionString] == null) { + functionCache[functionString] = new Function(functionString); + } + // Set the object + return functionCache[functionString].bind(object); +} +function getValidatedString(buffer, start, end, shouldValidateUtf8) { + var value = buffer.toString('utf8', start, end); + // if utf8 validation is on, do the check + if (shouldValidateUtf8) { + for (var i = 0; i < value.length; i++) { + if (value.charCodeAt(i) === 0xfffd) { + if (!validateUtf8(buffer, start, end)) { + throw new BSONError('Invalid UTF-8 string in BSON document'); + } + break; + } + } + } + return value; +} + +// Copyright (c) 2008, Fair Oaks Labs, Inc. +function writeIEEE754(buffer, value, offset, endian, mLen, nBytes) { + var e; + var m; + var c; + var bBE = endian === 'big'; + var eLen = nBytes * 8 - mLen - 1; + var eMax = (1 << eLen) - 1; + var eBias = eMax >> 1; + var rt = mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0; + var i = bBE ? nBytes - 1 : 0; + var d = bBE ? -1 : 1; + var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0; + value = Math.abs(value); + if (isNaN(value) || value === Infinity) { + m = isNaN(value) ? 1 : 0; + e = eMax; + } + else { + e = Math.floor(Math.log(value) / Math.LN2); + if (value * (c = Math.pow(2, -e)) < 1) { + e--; + c *= 2; + } + if (e + eBias >= 1) { + value += rt / c; + } + else { + value += rt * Math.pow(2, 1 - eBias); + } + if (value * c >= 2) { + e++; + c /= 2; + } + if (e + eBias >= eMax) { + m = 0; + e = eMax; + } + else if (e + eBias >= 1) { + m = (value * c - 1) * Math.pow(2, mLen); + e = e + eBias; + } + else { + m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen); + e = 0; + } + } + if (isNaN(value)) + m = 0; + while (mLen >= 8) { + buffer[offset + i] = m & 0xff; + i += d; + m /= 256; + mLen -= 8; + } + e = (e << mLen) | m; + if (isNaN(value)) + e += 8; + eLen += mLen; + while (eLen > 0) { + buffer[offset + i] = e & 0xff; + i += d; + e /= 256; + eLen -= 8; + } + buffer[offset + i - d] |= s * 128; +} + +var regexp = /\x00/; // eslint-disable-line no-control-regex +var ignoreKeys = new Set(['$db', '$ref', '$id', '$clusterTime']); +/* + * isArray indicates if we are writing to a BSON array (type 0x04) + * which forces the "key" which really an array index as a string to be written as ascii + * This will catch any errors in index as a string generation + */ +function serializeString(buffer, key, value, index, isArray) { + // Encode String type + buffer[index++] = BSON_DATA_STRING; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes + 1; + buffer[index - 1] = 0; + // Write the string + var size = buffer.write(value, index + 4, undefined, 'utf8'); + // Write the size of the string to buffer + buffer[index + 3] = ((size + 1) >> 24) & 0xff; + buffer[index + 2] = ((size + 1) >> 16) & 0xff; + buffer[index + 1] = ((size + 1) >> 8) & 0xff; + buffer[index] = (size + 1) & 0xff; + // Update index + index = index + 4 + size; + // Write zero + buffer[index++] = 0; + return index; +} +function serializeNumber(buffer, key, value, index, isArray) { + // We have an integer value + // TODO(NODE-2529): Add support for big int + if (Number.isInteger(value) && + value >= BSON_INT32_MIN && + value <= BSON_INT32_MAX) { + // If the value fits in 32 bits encode as int32 + // Set int type 32 bits or less + buffer[index++] = BSON_DATA_INT; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Write the int value + buffer[index++] = value & 0xff; + buffer[index++] = (value >> 8) & 0xff; + buffer[index++] = (value >> 16) & 0xff; + buffer[index++] = (value >> 24) & 0xff; + } + else { + // Encode as double + buffer[index++] = BSON_DATA_NUMBER; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Write float + writeIEEE754(buffer, value, index, 'little', 52, 8); + // Adjust index + index = index + 8; + } + return index; +} +function serializeNull(buffer, key, _, index, isArray) { + // Set long type + buffer[index++] = BSON_DATA_NULL; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + return index; +} +function serializeBoolean(buffer, key, value, index, isArray) { + // Write the type + buffer[index++] = BSON_DATA_BOOLEAN; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Encode the boolean value + buffer[index++] = value ? 1 : 0; + return index; +} +function serializeDate(buffer, key, value, index, isArray) { + // Write the type + buffer[index++] = BSON_DATA_DATE; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Write the date + var dateInMilis = Long.fromNumber(value.getTime()); + var lowBits = dateInMilis.getLowBits(); + var highBits = dateInMilis.getHighBits(); + // Encode low bits + buffer[index++] = lowBits & 0xff; + buffer[index++] = (lowBits >> 8) & 0xff; + buffer[index++] = (lowBits >> 16) & 0xff; + buffer[index++] = (lowBits >> 24) & 0xff; + // Encode high bits + buffer[index++] = highBits & 0xff; + buffer[index++] = (highBits >> 8) & 0xff; + buffer[index++] = (highBits >> 16) & 0xff; + buffer[index++] = (highBits >> 24) & 0xff; + return index; +} +function serializeRegExp(buffer, key, value, index, isArray) { + // Write the type + buffer[index++] = BSON_DATA_REGEXP; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + if (value.source && value.source.match(regexp) != null) { + throw Error('value ' + value.source + ' must not contain null bytes'); + } + // Adjust the index + index = index + buffer.write(value.source, index, undefined, 'utf8'); + // Write zero + buffer[index++] = 0x00; + // Write the parameters + if (value.ignoreCase) + buffer[index++] = 0x69; // i + if (value.global) + buffer[index++] = 0x73; // s + if (value.multiline) + buffer[index++] = 0x6d; // m + // Add ending zero + buffer[index++] = 0x00; + return index; +} +function serializeBSONRegExp(buffer, key, value, index, isArray) { + // Write the type + buffer[index++] = BSON_DATA_REGEXP; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Check the pattern for 0 bytes + if (value.pattern.match(regexp) != null) { + // The BSON spec doesn't allow keys with null bytes because keys are + // null-terminated. + throw Error('pattern ' + value.pattern + ' must not contain null bytes'); + } + // Adjust the index + index = index + buffer.write(value.pattern, index, undefined, 'utf8'); + // Write zero + buffer[index++] = 0x00; + // Write the options + index = index + buffer.write(value.options.split('').sort().join(''), index, undefined, 'utf8'); + // Add ending zero + buffer[index++] = 0x00; + return index; +} +function serializeMinMax(buffer, key, value, index, isArray) { + // Write the type of either min or max key + if (value === null) { + buffer[index++] = BSON_DATA_NULL; + } + else if (value._bsontype === 'MinKey') { + buffer[index++] = BSON_DATA_MIN_KEY; + } + else { + buffer[index++] = BSON_DATA_MAX_KEY; + } + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + return index; +} +function serializeObjectId(buffer, key, value, index, isArray) { + // Write the type + buffer[index++] = BSON_DATA_OID; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Write the objectId into the shared buffer + if (typeof value.id === 'string') { + buffer.write(value.id, index, undefined, 'binary'); + } + else if (isUint8Array(value.id)) { + // Use the standard JS methods here because buffer.copy() is buggy with the + // browser polyfill + buffer.set(value.id.subarray(0, 12), index); + } + else { + throw new BSONTypeError('object [' + JSON.stringify(value) + '] is not a valid ObjectId'); + } + // Adjust index + return index + 12; +} +function serializeBuffer(buffer, key, value, index, isArray) { + // Write the type + buffer[index++] = BSON_DATA_BINARY; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Get size of the buffer (current write point) + var size = value.length; + // Write the size of the string to buffer + buffer[index++] = size & 0xff; + buffer[index++] = (size >> 8) & 0xff; + buffer[index++] = (size >> 16) & 0xff; + buffer[index++] = (size >> 24) & 0xff; + // Write the default subtype + buffer[index++] = BSON_BINARY_SUBTYPE_DEFAULT; + // Copy the content form the binary field to the buffer + buffer.set(ensureBuffer(value), index); + // Adjust the index + index = index + size; + return index; +} +function serializeObject(buffer, key, value, index, checkKeys, depth, serializeFunctions, ignoreUndefined, isArray, path) { + if (checkKeys === void 0) { checkKeys = false; } + if (depth === void 0) { depth = 0; } + if (serializeFunctions === void 0) { serializeFunctions = false; } + if (ignoreUndefined === void 0) { ignoreUndefined = true; } + if (isArray === void 0) { isArray = false; } + if (path === void 0) { path = []; } + for (var i = 0; i < path.length; i++) { + if (path[i] === value) + throw new BSONError('cyclic dependency detected'); + } + // Push value to stack + path.push(value); + // Write the type + buffer[index++] = Array.isArray(value) ? BSON_DATA_ARRAY : BSON_DATA_OBJECT; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + var endIndex = serializeInto(buffer, value, checkKeys, index, depth + 1, serializeFunctions, ignoreUndefined, path); + // Pop stack + path.pop(); + return endIndex; +} +function serializeDecimal128(buffer, key, value, index, isArray) { + buffer[index++] = BSON_DATA_DECIMAL128; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Write the data from the value + // Prefer the standard JS methods because their typechecking is not buggy, + // unlike the `buffer` polyfill's. + buffer.set(value.bytes.subarray(0, 16), index); + return index + 16; +} +function serializeLong(buffer, key, value, index, isArray) { + // Write the type + buffer[index++] = + value._bsontype === 'Long' ? BSON_DATA_LONG : BSON_DATA_TIMESTAMP; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Write the date + var lowBits = value.getLowBits(); + var highBits = value.getHighBits(); + // Encode low bits + buffer[index++] = lowBits & 0xff; + buffer[index++] = (lowBits >> 8) & 0xff; + buffer[index++] = (lowBits >> 16) & 0xff; + buffer[index++] = (lowBits >> 24) & 0xff; + // Encode high bits + buffer[index++] = highBits & 0xff; + buffer[index++] = (highBits >> 8) & 0xff; + buffer[index++] = (highBits >> 16) & 0xff; + buffer[index++] = (highBits >> 24) & 0xff; + return index; +} +function serializeInt32(buffer, key, value, index, isArray) { + value = value.valueOf(); + // Set int type 32 bits or less + buffer[index++] = BSON_DATA_INT; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Write the int value + buffer[index++] = value & 0xff; + buffer[index++] = (value >> 8) & 0xff; + buffer[index++] = (value >> 16) & 0xff; + buffer[index++] = (value >> 24) & 0xff; + return index; +} +function serializeDouble(buffer, key, value, index, isArray) { + // Encode as double + buffer[index++] = BSON_DATA_NUMBER; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Write float + writeIEEE754(buffer, value.value, index, 'little', 52, 8); + // Adjust index + index = index + 8; + return index; +} +function serializeFunction(buffer, key, value, index, _checkKeys, _depth, isArray) { + buffer[index++] = BSON_DATA_CODE; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Function string + var functionString = normalizedFunctionString(value); + // Write the string + var size = buffer.write(functionString, index + 4, undefined, 'utf8') + 1; + // Write the size of the string to buffer + buffer[index] = size & 0xff; + buffer[index + 1] = (size >> 8) & 0xff; + buffer[index + 2] = (size >> 16) & 0xff; + buffer[index + 3] = (size >> 24) & 0xff; + // Update index + index = index + 4 + size - 1; + // Write zero + buffer[index++] = 0; + return index; +} +function serializeCode(buffer, key, value, index, checkKeys, depth, serializeFunctions, ignoreUndefined, isArray) { + if (checkKeys === void 0) { checkKeys = false; } + if (depth === void 0) { depth = 0; } + if (serializeFunctions === void 0) { serializeFunctions = false; } + if (ignoreUndefined === void 0) { ignoreUndefined = true; } + if (isArray === void 0) { isArray = false; } + if (value.scope && typeof value.scope === 'object') { + // Write the type + buffer[index++] = BSON_DATA_CODE_W_SCOPE; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Starting index + var startIndex = index; + // Serialize the function + // Get the function string + var functionString = typeof value.code === 'string' ? value.code : value.code.toString(); + // Index adjustment + index = index + 4; + // Write string into buffer + var codeSize = buffer.write(functionString, index + 4, undefined, 'utf8') + 1; + // Write the size of the string to buffer + buffer[index] = codeSize & 0xff; + buffer[index + 1] = (codeSize >> 8) & 0xff; + buffer[index + 2] = (codeSize >> 16) & 0xff; + buffer[index + 3] = (codeSize >> 24) & 0xff; + // Write end 0 + buffer[index + 4 + codeSize - 1] = 0; + // Write the + index = index + codeSize + 4; + // + // Serialize the scope value + var endIndex = serializeInto(buffer, value.scope, checkKeys, index, depth + 1, serializeFunctions, ignoreUndefined); + index = endIndex - 1; + // Writ the total + var totalSize = endIndex - startIndex; + // Write the total size of the object + buffer[startIndex++] = totalSize & 0xff; + buffer[startIndex++] = (totalSize >> 8) & 0xff; + buffer[startIndex++] = (totalSize >> 16) & 0xff; + buffer[startIndex++] = (totalSize >> 24) & 0xff; + // Write trailing zero + buffer[index++] = 0; + } + else { + buffer[index++] = BSON_DATA_CODE; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Function string + var functionString = value.code.toString(); + // Write the string + var size = buffer.write(functionString, index + 4, undefined, 'utf8') + 1; + // Write the size of the string to buffer + buffer[index] = size & 0xff; + buffer[index + 1] = (size >> 8) & 0xff; + buffer[index + 2] = (size >> 16) & 0xff; + buffer[index + 3] = (size >> 24) & 0xff; + // Update index + index = index + 4 + size - 1; + // Write zero + buffer[index++] = 0; + } + return index; +} +function serializeBinary(buffer, key, value, index, isArray) { + // Write the type + buffer[index++] = BSON_DATA_BINARY; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Extract the buffer + var data = value.value(true); + // Calculate size + var size = value.position; + // Add the deprecated 02 type 4 bytes of size to total + if (value.sub_type === Binary.SUBTYPE_BYTE_ARRAY) + size = size + 4; + // Write the size of the string to buffer + buffer[index++] = size & 0xff; + buffer[index++] = (size >> 8) & 0xff; + buffer[index++] = (size >> 16) & 0xff; + buffer[index++] = (size >> 24) & 0xff; + // Write the subtype to the buffer + buffer[index++] = value.sub_type; + // If we have binary type 2 the 4 first bytes are the size + if (value.sub_type === Binary.SUBTYPE_BYTE_ARRAY) { + size = size - 4; + buffer[index++] = size & 0xff; + buffer[index++] = (size >> 8) & 0xff; + buffer[index++] = (size >> 16) & 0xff; + buffer[index++] = (size >> 24) & 0xff; + } + // Write the data to the object + buffer.set(data, index); + // Adjust the index + index = index + value.position; + return index; +} +function serializeSymbol(buffer, key, value, index, isArray) { + // Write the type + buffer[index++] = BSON_DATA_SYMBOL; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Write the string + var size = buffer.write(value.value, index + 4, undefined, 'utf8') + 1; + // Write the size of the string to buffer + buffer[index] = size & 0xff; + buffer[index + 1] = (size >> 8) & 0xff; + buffer[index + 2] = (size >> 16) & 0xff; + buffer[index + 3] = (size >> 24) & 0xff; + // Update index + index = index + 4 + size - 1; + // Write zero + buffer[index++] = 0x00; + return index; +} +function serializeDBRef(buffer, key, value, index, depth, serializeFunctions, isArray) { + // Write the type + buffer[index++] = BSON_DATA_OBJECT; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + var startIndex = index; + var output = { + $ref: value.collection || value.namespace, + $id: value.oid + }; + if (value.db != null) { + output.$db = value.db; + } + output = Object.assign(output, value.fields); + var endIndex = serializeInto(buffer, output, false, index, depth + 1, serializeFunctions); + // Calculate object size + var size = endIndex - startIndex; + // Write the size + buffer[startIndex++] = size & 0xff; + buffer[startIndex++] = (size >> 8) & 0xff; + buffer[startIndex++] = (size >> 16) & 0xff; + buffer[startIndex++] = (size >> 24) & 0xff; + // Set index + return endIndex; +} +function serializeInto(buffer, object, checkKeys, startingIndex, depth, serializeFunctions, ignoreUndefined, path) { + if (checkKeys === void 0) { checkKeys = false; } + if (startingIndex === void 0) { startingIndex = 0; } + if (depth === void 0) { depth = 0; } + if (serializeFunctions === void 0) { serializeFunctions = false; } + if (ignoreUndefined === void 0) { ignoreUndefined = true; } + if (path === void 0) { path = []; } + startingIndex = startingIndex || 0; + path = path || []; + // Push the object to the path + path.push(object); + // Start place to serialize into + var index = startingIndex + 4; + // Special case isArray + if (Array.isArray(object)) { + // Get object keys + for (var i = 0; i < object.length; i++) { + var key = '' + i; + var value = object[i]; + // Is there an override value + if (typeof (value === null || value === void 0 ? void 0 : value.toBSON) === 'function') { + value = value.toBSON(); + } + if (typeof value === 'string') { + index = serializeString(buffer, key, value, index, true); + } + else if (typeof value === 'number') { + index = serializeNumber(buffer, key, value, index, true); + } + else if (typeof value === 'bigint') { + throw new BSONTypeError('Unsupported type BigInt, please use Decimal128'); + } + else if (typeof value === 'boolean') { + index = serializeBoolean(buffer, key, value, index, true); + } + else if (value instanceof Date || isDate(value)) { + index = serializeDate(buffer, key, value, index, true); + } + else if (value === undefined) { + index = serializeNull(buffer, key, value, index, true); + } + else if (value === null) { + index = serializeNull(buffer, key, value, index, true); + } + else if (value['_bsontype'] === 'ObjectId' || value['_bsontype'] === 'ObjectID') { + index = serializeObjectId(buffer, key, value, index, true); + } + else if (isUint8Array(value)) { + index = serializeBuffer(buffer, key, value, index, true); + } + else if (value instanceof RegExp || isRegExp(value)) { + index = serializeRegExp(buffer, key, value, index, true); + } + else if (typeof value === 'object' && value['_bsontype'] == null) { + index = serializeObject(buffer, key, value, index, checkKeys, depth, serializeFunctions, ignoreUndefined, true, path); + } + else if (typeof value === 'object' && + isBSONType(value) && + value._bsontype === 'Decimal128') { + index = serializeDecimal128(buffer, key, value, index, true); + } + else if (value['_bsontype'] === 'Long' || value['_bsontype'] === 'Timestamp') { + index = serializeLong(buffer, key, value, index, true); + } + else if (value['_bsontype'] === 'Double') { + index = serializeDouble(buffer, key, value, index, true); + } + else if (typeof value === 'function' && serializeFunctions) { + index = serializeFunction(buffer, key, value, index, checkKeys, depth, true); + } + else if (value['_bsontype'] === 'Code') { + index = serializeCode(buffer, key, value, index, checkKeys, depth, serializeFunctions, ignoreUndefined, true); + } + else if (value['_bsontype'] === 'Binary') { + index = serializeBinary(buffer, key, value, index, true); + } + else if (value['_bsontype'] === 'Symbol') { + index = serializeSymbol(buffer, key, value, index, true); + } + else if (value['_bsontype'] === 'DBRef') { + index = serializeDBRef(buffer, key, value, index, depth, serializeFunctions, true); + } + else if (value['_bsontype'] === 'BSONRegExp') { + index = serializeBSONRegExp(buffer, key, value, index, true); + } + else if (value['_bsontype'] === 'Int32') { + index = serializeInt32(buffer, key, value, index, true); + } + else if (value['_bsontype'] === 'MinKey' || value['_bsontype'] === 'MaxKey') { + index = serializeMinMax(buffer, key, value, index, true); + } + else if (typeof value['_bsontype'] !== 'undefined') { + throw new BSONTypeError('Unrecognized or invalid _bsontype: ' + value['_bsontype']); + } + } + } + else if (object instanceof bsonMap || isMap(object)) { + var iterator = object.entries(); + var done = false; + while (!done) { + // Unpack the next entry + var entry = iterator.next(); + done = !!entry.done; + // Are we done, then skip and terminate + if (done) + continue; + // Get the entry values + var key = entry.value[0]; + var value = entry.value[1]; + // Check the type of the value + var type = typeof value; + // Check the key and throw error if it's illegal + if (typeof key === 'string' && !ignoreKeys.has(key)) { + if (key.match(regexp) != null) { + // The BSON spec doesn't allow keys with null bytes because keys are + // null-terminated. + throw Error('key ' + key + ' must not contain null bytes'); + } + if (checkKeys) { + if ('$' === key[0]) { + throw Error('key ' + key + " must not start with '$'"); + } + else if (~key.indexOf('.')) { + throw Error('key ' + key + " must not contain '.'"); + } + } + } + if (type === 'string') { + index = serializeString(buffer, key, value, index); + } + else if (type === 'number') { + index = serializeNumber(buffer, key, value, index); + } + else if (type === 'bigint' || isBigInt64Array(value) || isBigUInt64Array(value)) { + throw new BSONTypeError('Unsupported type BigInt, please use Decimal128'); + } + else if (type === 'boolean') { + index = serializeBoolean(buffer, key, value, index); + } + else if (value instanceof Date || isDate(value)) { + index = serializeDate(buffer, key, value, index); + } + else if (value === null || (value === undefined && ignoreUndefined === false)) { + index = serializeNull(buffer, key, value, index); + } + else if (value['_bsontype'] === 'ObjectId' || value['_bsontype'] === 'ObjectID') { + index = serializeObjectId(buffer, key, value, index); + } + else if (isUint8Array(value)) { + index = serializeBuffer(buffer, key, value, index); + } + else if (value instanceof RegExp || isRegExp(value)) { + index = serializeRegExp(buffer, key, value, index); + } + else if (type === 'object' && value['_bsontype'] == null) { + index = serializeObject(buffer, key, value, index, checkKeys, depth, serializeFunctions, ignoreUndefined, false, path); + } + else if (type === 'object' && value['_bsontype'] === 'Decimal128') { + index = serializeDecimal128(buffer, key, value, index); + } + else if (value['_bsontype'] === 'Long' || value['_bsontype'] === 'Timestamp') { + index = serializeLong(buffer, key, value, index); + } + else if (value['_bsontype'] === 'Double') { + index = serializeDouble(buffer, key, value, index); + } + else if (value['_bsontype'] === 'Code') { + index = serializeCode(buffer, key, value, index, checkKeys, depth, serializeFunctions, ignoreUndefined); + } + else if (typeof value === 'function' && serializeFunctions) { + index = serializeFunction(buffer, key, value, index, checkKeys, depth, serializeFunctions); + } + else if (value['_bsontype'] === 'Binary') { + index = serializeBinary(buffer, key, value, index); + } + else if (value['_bsontype'] === 'Symbol') { + index = serializeSymbol(buffer, key, value, index); + } + else if (value['_bsontype'] === 'DBRef') { + index = serializeDBRef(buffer, key, value, index, depth, serializeFunctions); + } + else if (value['_bsontype'] === 'BSONRegExp') { + index = serializeBSONRegExp(buffer, key, value, index); + } + else if (value['_bsontype'] === 'Int32') { + index = serializeInt32(buffer, key, value, index); + } + else if (value['_bsontype'] === 'MinKey' || value['_bsontype'] === 'MaxKey') { + index = serializeMinMax(buffer, key, value, index); + } + else if (typeof value['_bsontype'] !== 'undefined') { + throw new BSONTypeError('Unrecognized or invalid _bsontype: ' + value['_bsontype']); + } + } + } + else { + if (typeof (object === null || object === void 0 ? void 0 : object.toBSON) === 'function') { + // Provided a custom serialization method + object = object.toBSON(); + if (object != null && typeof object !== 'object') { + throw new BSONTypeError('toBSON function did not return an object'); + } + } + // Iterate over all the keys + for (var key in object) { + var value = object[key]; + // Is there an override value + if (typeof (value === null || value === void 0 ? void 0 : value.toBSON) === 'function') { + value = value.toBSON(); + } + // Check the type of the value + var type = typeof value; + // Check the key and throw error if it's illegal + if (typeof key === 'string' && !ignoreKeys.has(key)) { + if (key.match(regexp) != null) { + // The BSON spec doesn't allow keys with null bytes because keys are + // null-terminated. + throw Error('key ' + key + ' must not contain null bytes'); + } + if (checkKeys) { + if ('$' === key[0]) { + throw Error('key ' + key + " must not start with '$'"); + } + else if (~key.indexOf('.')) { + throw Error('key ' + key + " must not contain '.'"); + } + } + } + if (type === 'string') { + index = serializeString(buffer, key, value, index); + } + else if (type === 'number') { + index = serializeNumber(buffer, key, value, index); + } + else if (type === 'bigint') { + throw new BSONTypeError('Unsupported type BigInt, please use Decimal128'); + } + else if (type === 'boolean') { + index = serializeBoolean(buffer, key, value, index); + } + else if (value instanceof Date || isDate(value)) { + index = serializeDate(buffer, key, value, index); + } + else if (value === undefined) { + if (ignoreUndefined === false) + index = serializeNull(buffer, key, value, index); + } + else if (value === null) { + index = serializeNull(buffer, key, value, index); + } + else if (value['_bsontype'] === 'ObjectId' || value['_bsontype'] === 'ObjectID') { + index = serializeObjectId(buffer, key, value, index); + } + else if (isUint8Array(value)) { + index = serializeBuffer(buffer, key, value, index); + } + else if (value instanceof RegExp || isRegExp(value)) { + index = serializeRegExp(buffer, key, value, index); + } + else if (type === 'object' && value['_bsontype'] == null) { + index = serializeObject(buffer, key, value, index, checkKeys, depth, serializeFunctions, ignoreUndefined, false, path); + } + else if (type === 'object' && value['_bsontype'] === 'Decimal128') { + index = serializeDecimal128(buffer, key, value, index); + } + else if (value['_bsontype'] === 'Long' || value['_bsontype'] === 'Timestamp') { + index = serializeLong(buffer, key, value, index); + } + else if (value['_bsontype'] === 'Double') { + index = serializeDouble(buffer, key, value, index); + } + else if (value['_bsontype'] === 'Code') { + index = serializeCode(buffer, key, value, index, checkKeys, depth, serializeFunctions, ignoreUndefined); + } + else if (typeof value === 'function' && serializeFunctions) { + index = serializeFunction(buffer, key, value, index, checkKeys, depth, serializeFunctions); + } + else if (value['_bsontype'] === 'Binary') { + index = serializeBinary(buffer, key, value, index); + } + else if (value['_bsontype'] === 'Symbol') { + index = serializeSymbol(buffer, key, value, index); + } + else if (value['_bsontype'] === 'DBRef') { + index = serializeDBRef(buffer, key, value, index, depth, serializeFunctions); + } + else if (value['_bsontype'] === 'BSONRegExp') { + index = serializeBSONRegExp(buffer, key, value, index); + } + else if (value['_bsontype'] === 'Int32') { + index = serializeInt32(buffer, key, value, index); + } + else if (value['_bsontype'] === 'MinKey' || value['_bsontype'] === 'MaxKey') { + index = serializeMinMax(buffer, key, value, index); + } + else if (typeof value['_bsontype'] !== 'undefined') { + throw new BSONTypeError('Unrecognized or invalid _bsontype: ' + value['_bsontype']); + } + } + } + // Remove the path + path.pop(); + // Final padding byte for object + buffer[index++] = 0x00; + // Final size + var size = index - startingIndex; + // Write the size of the object + buffer[startingIndex++] = size & 0xff; + buffer[startingIndex++] = (size >> 8) & 0xff; + buffer[startingIndex++] = (size >> 16) & 0xff; + buffer[startingIndex++] = (size >> 24) & 0xff; + return index; +} + +/** @internal */ +// Default Max Size +var MAXSIZE = 1024 * 1024 * 17; +// Current Internal Temporary Serialization Buffer +var buffer = Buffer.alloc(MAXSIZE); +/** + * Sets the size of the internal serialization buffer. + * + * @param size - The desired size for the internal serialization buffer + * @public + */ +function setInternalBufferSize(size) { + // Resize the internal serialization buffer if needed + if (buffer.length < size) { + buffer = Buffer.alloc(size); + } +} +/** + * Serialize a Javascript object. + * + * @param object - the Javascript object to serialize. + * @returns Buffer object containing the serialized object. + * @public + */ +function serialize(object, options) { + if (options === void 0) { options = {}; } + // Unpack the options + var checkKeys = typeof options.checkKeys === 'boolean' ? options.checkKeys : false; + var serializeFunctions = typeof options.serializeFunctions === 'boolean' ? options.serializeFunctions : false; + var ignoreUndefined = typeof options.ignoreUndefined === 'boolean' ? options.ignoreUndefined : true; + var minInternalBufferSize = typeof options.minInternalBufferSize === 'number' ? options.minInternalBufferSize : MAXSIZE; + // Resize the internal serialization buffer if needed + if (buffer.length < minInternalBufferSize) { + buffer = Buffer.alloc(minInternalBufferSize); + } + // Attempt to serialize + var serializationIndex = serializeInto(buffer, object, checkKeys, 0, 0, serializeFunctions, ignoreUndefined, []); + // Create the final buffer + var finishedBuffer = Buffer.alloc(serializationIndex); + // Copy into the finished buffer + buffer.copy(finishedBuffer, 0, 0, finishedBuffer.length); + // Return the buffer + return finishedBuffer; +} +/** + * Serialize a Javascript object using a predefined Buffer and index into the buffer, + * useful when pre-allocating the space for serialization. + * + * @param object - the Javascript object to serialize. + * @param finalBuffer - the Buffer you pre-allocated to store the serialized BSON object. + * @returns the index pointing to the last written byte in the buffer. + * @public + */ +function serializeWithBufferAndIndex(object, finalBuffer, options) { + if (options === void 0) { options = {}; } + // Unpack the options + var checkKeys = typeof options.checkKeys === 'boolean' ? options.checkKeys : false; + var serializeFunctions = typeof options.serializeFunctions === 'boolean' ? options.serializeFunctions : false; + var ignoreUndefined = typeof options.ignoreUndefined === 'boolean' ? options.ignoreUndefined : true; + var startIndex = typeof options.index === 'number' ? options.index : 0; + // Attempt to serialize + var serializationIndex = serializeInto(buffer, object, checkKeys, 0, 0, serializeFunctions, ignoreUndefined); + buffer.copy(finalBuffer, startIndex, 0, serializationIndex); + // Return the index + return startIndex + serializationIndex - 1; +} +/** + * Deserialize data as BSON. + * + * @param buffer - the buffer containing the serialized set of BSON documents. + * @returns returns the deserialized Javascript Object. + * @public + */ +function deserialize(buffer, options) { + if (options === void 0) { options = {}; } + return deserialize$1(buffer instanceof Buffer ? buffer : ensureBuffer(buffer), options); +} +/** + * Calculate the bson size for a passed in Javascript object. + * + * @param object - the Javascript object to calculate the BSON byte size for + * @returns size of BSON object in bytes + * @public + */ +function calculateObjectSize(object, options) { + if (options === void 0) { options = {}; } + options = options || {}; + var serializeFunctions = typeof options.serializeFunctions === 'boolean' ? options.serializeFunctions : false; + var ignoreUndefined = typeof options.ignoreUndefined === 'boolean' ? options.ignoreUndefined : true; + return calculateObjectSize$1(object, serializeFunctions, ignoreUndefined); +} +/** + * Deserialize stream data as BSON documents. + * + * @param data - the buffer containing the serialized set of BSON documents. + * @param startIndex - the start index in the data Buffer where the deserialization is to start. + * @param numberOfDocuments - number of documents to deserialize. + * @param documents - an array where to store the deserialized documents. + * @param docStartIndex - the index in the documents array from where to start inserting documents. + * @param options - additional options used for the deserialization. + * @returns next index in the buffer after deserialization **x** numbers of documents. + * @public + */ +function deserializeStream(data, startIndex, numberOfDocuments, documents, docStartIndex, options) { + var internalOptions = Object.assign({ allowObjectSmallerThanBufferSize: true, index: 0 }, options); + var bufferData = ensureBuffer(data); + var index = startIndex; + // Loop over all documents + for (var i = 0; i < numberOfDocuments; i++) { + // Find size of the document + var size = bufferData[index] | + (bufferData[index + 1] << 8) | + (bufferData[index + 2] << 16) | + (bufferData[index + 3] << 24); + // Update options with index + internalOptions.index = index; + // Parse the document at this point + documents[docStartIndex + i] = deserialize$1(bufferData, internalOptions); + // Adjust index by the document size + index = index + size; + } + // Return object containing end index of parsing and list of documents + return index; +} +/** + * BSON default export + * @deprecated Please use named exports + * @privateRemarks + * We want to someday deprecate the default export, + * so none of the new TS types are being exported on the default + * @public + */ +var BSON = { + Binary: Binary, + Code: Code, + DBRef: DBRef, + Decimal128: Decimal128, + Double: Double, + Int32: Int32, + Long: Long, + UUID: UUID, + Map: bsonMap, + MaxKey: MaxKey, + MinKey: MinKey, + ObjectId: ObjectId, + ObjectID: ObjectId, + BSONRegExp: BSONRegExp, + BSONSymbol: BSONSymbol, + Timestamp: Timestamp, + EJSON: EJSON, + setInternalBufferSize: setInternalBufferSize, + serialize: serialize, + serializeWithBufferAndIndex: serializeWithBufferAndIndex, + deserialize: deserialize, + calculateObjectSize: calculateObjectSize, + deserializeStream: deserializeStream, + BSONError: BSONError, + BSONTypeError: BSONTypeError +}; + +export default BSON; +export { BSONError, BSONRegExp, BSONSymbol, BSONTypeError, BSON_BINARY_SUBTYPE_BYTE_ARRAY, BSON_BINARY_SUBTYPE_COLUMN, BSON_BINARY_SUBTYPE_DEFAULT, BSON_BINARY_SUBTYPE_ENCRYPTED, BSON_BINARY_SUBTYPE_FUNCTION, BSON_BINARY_SUBTYPE_MD5, BSON_BINARY_SUBTYPE_USER_DEFINED, BSON_BINARY_SUBTYPE_UUID, BSON_BINARY_SUBTYPE_UUID_NEW, BSON_DATA_ARRAY, BSON_DATA_BINARY, BSON_DATA_BOOLEAN, BSON_DATA_CODE, BSON_DATA_CODE_W_SCOPE, BSON_DATA_DATE, BSON_DATA_DBPOINTER, BSON_DATA_DECIMAL128, BSON_DATA_INT, BSON_DATA_LONG, BSON_DATA_MAX_KEY, BSON_DATA_MIN_KEY, BSON_DATA_NULL, BSON_DATA_NUMBER, BSON_DATA_OBJECT, BSON_DATA_OID, BSON_DATA_REGEXP, BSON_DATA_STRING, BSON_DATA_SYMBOL, BSON_DATA_TIMESTAMP, BSON_DATA_UNDEFINED, BSON_INT32_MAX, BSON_INT32_MIN, BSON_INT64_MAX, BSON_INT64_MIN, Binary, Code, DBRef, Decimal128, Double, EJSON, Int32, Long, LongWithoutOverridesClass, bsonMap as Map, MaxKey, MinKey, ObjectId as ObjectID, ObjectId, Timestamp, UUID, calculateObjectSize, deserialize, deserializeStream, serialize, serializeWithBufferAndIndex, setInternalBufferSize }; +//# sourceMappingURL=bson.esm.js.map diff --git a/node_modules/bson/dist/bson.esm.js.map b/node_modules/bson/dist/bson.esm.js.map new file mode 100644 index 000000000..de9e539ee --- /dev/null +++ b/node_modules/bson/dist/bson.esm.js.map @@ -0,0 +1 @@ +{"version":3,"file":"bson.esm.js","sources":["../node_modules/tslib/tslib.es6.js","../src/error.ts","../src/utils/global.ts","../src/parser/utils.ts","../src/ensure_buffer.ts","../src/uuid_utils.ts","../src/uuid.ts","../src/binary.ts","../src/code.ts","../src/db_ref.ts","../src/long.ts","../src/decimal128.ts","../src/double.ts","../src/int_32.ts","../src/max_key.ts","../src/min_key.ts","../src/objectid.ts","../src/regexp.ts","../src/symbol.ts","../src/timestamp.ts","../src/extended_json.ts","../src/map.ts","../src/constants.ts","../src/parser/calculate_size.ts","../src/validate_utf8.ts","../src/parser/deserializer.ts","../src/float_parser.ts","../src/parser/serializer.ts","../src/bson.ts"],"sourcesContent":["/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport function __createBinding(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n}\r\n\r\nexport function __exportStar(m, exports) {\r\n for (var p in m) if (p !== \"default\" && !exports.hasOwnProperty(p)) exports[p] = m[p];\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n};\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\r\n result.default = mod;\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, privateMap) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to get private field on non-instance\");\r\n }\r\n return privateMap.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, privateMap, value) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to set private field on non-instance\");\r\n }\r\n privateMap.set(receiver, value);\r\n return value;\r\n}\r\n",null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],"names":["extendStatics","d","b","Object","setPrototypeOf","__proto__","Array","p","hasOwnProperty","__extends","__","constructor","prototype","create","__assign","assign","t","s","i","n","arguments","length","call","apply","kId","BSON_INT32_MAX","BSON_INT32_MIN","BSON_INT64_MAX","BSON_INT64_MIN","calculateObjectSize","constants.JS_INT_MIN","constants.JS_INT_MAX","constants.BSON_INT32_MIN","constants.BSON_INT32_MAX","deserialize","constants.BSON_DATA_STRING","constants.BSON_DATA_OID","constants.BSON_DATA_INT","constants.BSON_DATA_NUMBER","constants.BSON_DATA_DATE","constants.BSON_DATA_BOOLEAN","constants.BSON_DATA_OBJECT","constants.BSON_DATA_ARRAY","constants.BSON_DATA_UNDEFINED","constants.BSON_DATA_NULL","constants.BSON_DATA_LONG","constants.BSON_DATA_DECIMAL128","constants.BSON_DATA_BINARY","constants.BSON_DATA_REGEXP","constants.BSON_DATA_SYMBOL","constants.BSON_DATA_TIMESTAMP","constants.BSON_DATA_MIN_KEY","constants.BSON_DATA_MAX_KEY","constants.BSON_DATA_CODE","constants.BSON_DATA_CODE_W_SCOPE","constants.BSON_DATA_DBPOINTER","constants.BSON_BINARY_SUBTYPE_DEFAULT","Map","internalSerialize","internalDeserialize","internalCalculateObjectSize"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA;AAEA,IAAIA,cAAa,GAAG,uBAASC,CAAT,EAAYC,CAAZ,EAAe;AAC/BF,EAAAA,cAAa,GAAGG,MAAM,CAACC,cAAP,IACX;AAAEC,IAAAA,SAAS,EAAE;AAAb,eAA6BC,KAA7B,IAAsC,UAAUL,CAAV,EAAaC,CAAb,EAAgB;AAAED,IAAAA,CAAC,CAACI,SAAF,GAAcH,CAAd;AAAk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,KAAK,CAAC;;QAE9B,SAAS,CAAC,aAAa,GAAG,CAAC,CAAC,GAAGD,aAAmB,CAAC,UAAU,EAAE,eAAe,CAAC,CAAC;;QAEhF,KAAK,GAAG,KAAK,GAAG,IAAI,CAAC;KACtB;;IAGD,OAAO,KAAK,CAAC;AACf,CAAC;AAED;;;;;;;;IAQM,IAAI,GAAG;IACX,MAAM,QAAA;IACN,IAAI,MAAA;IACJ,KAAK,OAAA;IACL,UAAU,YAAA;IACV,MAAM,QAAA;IACN,KAAK,OAAA;IACL,IAAI,MAAA;IACJ,IAAI,MAAA;IACJ,GAAG,SAAA;IACH,MAAM,QAAA;IACN,MAAM,QAAA;IACN,QAAQ,UAAA;IACR,QAAQ,EAAE,QAAQ;IAClB,UAAU,YAAA;IACV,UAAU,YAAA;IACV,SAAS,WAAA;IACT,KAAK,OAAA;IACL,qBAAqB,uBAAA;IACrB,SAAS,WAAA;IACT,2BAA2B,6BAAA;IAC3B,WAAW,aAAA;IACX,mBAAmB,qBAAA;IACnB,iBAAiB,mBAAA;IACjB,SAAS,WAAA;IACT,aAAa,eAAA;;;;;;"} \ No newline at end of file diff --git a/node_modules/bson/etc/prepare.js b/node_modules/bson/etc/prepare.js new file mode 100644 index 000000000..91e6f3a97 --- /dev/null +++ b/node_modules/bson/etc/prepare.js @@ -0,0 +1,19 @@ +#! /usr/bin/env node +var cp = require('child_process'); +var fs = require('fs'); + +var nodeMajorVersion = +process.version.match(/^v(\d+)\.\d+/)[1]; + +if (fs.existsSync('src') && nodeMajorVersion >= 10) { + cp.spawnSync('npm', ['run', 'build'], { stdio: 'inherit', shell: true }); +} else { + if (!fs.existsSync('lib')) { + console.warn('BSON: No compiled javascript present, the library is not installed correctly.'); + if (nodeMajorVersion < 10) { + console.warn( + 'This library can only be compiled in nodejs version 10 or later, currently running: ' + + nodeMajorVersion + ); + } + } +} diff --git a/node_modules/bson/lib/binary.js b/node_modules/bson/lib/binary.js new file mode 100644 index 000000000..6a4de5218 --- /dev/null +++ b/node_modules/bson/lib/binary.js @@ -0,0 +1,240 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Binary = void 0; +var buffer_1 = require("buffer"); +var ensure_buffer_1 = require("./ensure_buffer"); +var uuid_utils_1 = require("./uuid_utils"); +var uuid_1 = require("./uuid"); +var error_1 = require("./error"); +/** + * A class representation of the BSON Binary type. + * @public + * @category BSONType + */ +var Binary = /** @class */ (function () { + /** + * @param buffer - a buffer object containing the binary data. + * @param subType - the option binary type. + */ + function Binary(buffer, subType) { + if (!(this instanceof Binary)) + return new Binary(buffer, subType); + if (!(buffer == null) && + !(typeof buffer === 'string') && + !ArrayBuffer.isView(buffer) && + !(buffer instanceof ArrayBuffer) && + !Array.isArray(buffer)) { + throw new error_1.BSONTypeError('Binary can only be constructed from string, Buffer, TypedArray, or Array'); + } + this.sub_type = subType !== null && subType !== void 0 ? subType : Binary.BSON_BINARY_SUBTYPE_DEFAULT; + if (buffer == null) { + // create an empty binary buffer + this.buffer = buffer_1.Buffer.alloc(Binary.BUFFER_SIZE); + this.position = 0; + } + else { + if (typeof buffer === 'string') { + // string + this.buffer = buffer_1.Buffer.from(buffer, 'binary'); + } + else if (Array.isArray(buffer)) { + // number[] + this.buffer = buffer_1.Buffer.from(buffer); + } + else { + // Buffer | TypedArray | ArrayBuffer + this.buffer = ensure_buffer_1.ensureBuffer(buffer); + } + this.position = this.buffer.byteLength; + } + } + /** + * Updates this binary with byte_value. + * + * @param byteValue - a single byte we wish to write. + */ + Binary.prototype.put = function (byteValue) { + // If it's a string and a has more than one character throw an error + if (typeof byteValue === 'string' && byteValue.length !== 1) { + throw new error_1.BSONTypeError('only accepts single character String'); + } + else if (typeof byteValue !== 'number' && byteValue.length !== 1) + throw new error_1.BSONTypeError('only accepts single character Uint8Array or Array'); + // Decode the byte value once + var decodedByte; + if (typeof byteValue === 'string') { + decodedByte = byteValue.charCodeAt(0); + } + else if (typeof byteValue === 'number') { + decodedByte = byteValue; + } + else { + decodedByte = byteValue[0]; + } + if (decodedByte < 0 || decodedByte > 255) { + throw new error_1.BSONTypeError('only accepts number in a valid unsigned byte range 0-255'); + } + if (this.buffer.length > this.position) { + this.buffer[this.position++] = decodedByte; + } + else { + var buffer = buffer_1.Buffer.alloc(Binary.BUFFER_SIZE + this.buffer.length); + // Combine the two buffers together + this.buffer.copy(buffer, 0, 0, this.buffer.length); + this.buffer = buffer; + this.buffer[this.position++] = decodedByte; + } + }; + /** + * Writes a buffer or string to the binary. + * + * @param sequence - a string or buffer to be written to the Binary BSON object. + * @param offset - specify the binary of where to write the content. + */ + Binary.prototype.write = function (sequence, offset) { + offset = typeof offset === 'number' ? offset : this.position; + // If the buffer is to small let's extend the buffer + if (this.buffer.length < offset + sequence.length) { + var buffer = buffer_1.Buffer.alloc(this.buffer.length + sequence.length); + this.buffer.copy(buffer, 0, 0, this.buffer.length); + // Assign the new buffer + this.buffer = buffer; + } + if (ArrayBuffer.isView(sequence)) { + this.buffer.set(ensure_buffer_1.ensureBuffer(sequence), offset); + this.position = + offset + sequence.byteLength > this.position ? offset + sequence.length : this.position; + } + else if (typeof sequence === 'string') { + this.buffer.write(sequence, offset, sequence.length, 'binary'); + this.position = + offset + sequence.length > this.position ? offset + sequence.length : this.position; + } + }; + /** + * Reads **length** bytes starting at **position**. + * + * @param position - read from the given position in the Binary. + * @param length - the number of bytes to read. + */ + Binary.prototype.read = function (position, length) { + length = length && length > 0 ? length : this.position; + // Let's return the data based on the type we have + return this.buffer.slice(position, position + length); + }; + /** + * Returns the value of this binary as a string. + * @param asRaw - Will skip converting to a string + * @remarks + * This is handy when calling this function conditionally for some key value pairs and not others + */ + Binary.prototype.value = function (asRaw) { + asRaw = !!asRaw; + // Optimize to serialize for the situation where the data == size of buffer + if (asRaw && this.buffer.length === this.position) { + return this.buffer; + } + // If it's a node.js buffer object + if (asRaw) { + return this.buffer.slice(0, this.position); + } + return this.buffer.toString('binary', 0, this.position); + }; + /** the length of the binary sequence */ + Binary.prototype.length = function () { + return this.position; + }; + Binary.prototype.toJSON = function () { + return this.buffer.toString('base64'); + }; + Binary.prototype.toString = function (format) { + return this.buffer.toString(format); + }; + /** @internal */ + Binary.prototype.toExtendedJSON = function (options) { + options = options || {}; + var base64String = this.buffer.toString('base64'); + var subType = Number(this.sub_type).toString(16); + if (options.legacy) { + return { + $binary: base64String, + $type: subType.length === 1 ? '0' + subType : subType + }; + } + return { + $binary: { + base64: base64String, + subType: subType.length === 1 ? '0' + subType : subType + } + }; + }; + Binary.prototype.toUUID = function () { + if (this.sub_type === Binary.SUBTYPE_UUID) { + return new uuid_1.UUID(this.buffer.slice(0, this.position)); + } + throw new error_1.BSONError("Binary sub_type \"" + this.sub_type + "\" is not supported for converting to UUID. Only \"" + Binary.SUBTYPE_UUID + "\" is currently supported."); + }; + /** @internal */ + Binary.fromExtendedJSON = function (doc, options) { + options = options || {}; + var data; + var type; + if ('$binary' in doc) { + if (options.legacy && typeof doc.$binary === 'string' && '$type' in doc) { + type = doc.$type ? parseInt(doc.$type, 16) : 0; + data = buffer_1.Buffer.from(doc.$binary, 'base64'); + } + else { + if (typeof doc.$binary !== 'string') { + type = doc.$binary.subType ? parseInt(doc.$binary.subType, 16) : 0; + data = buffer_1.Buffer.from(doc.$binary.base64, 'base64'); + } + } + } + else if ('$uuid' in doc) { + type = 4; + data = uuid_utils_1.uuidHexStringToBuffer(doc.$uuid); + } + if (!data) { + throw new error_1.BSONTypeError("Unexpected Binary Extended JSON format " + JSON.stringify(doc)); + } + return new Binary(data, type); + }; + /** @internal */ + Binary.prototype[Symbol.for('nodejs.util.inspect.custom')] = function () { + return this.inspect(); + }; + Binary.prototype.inspect = function () { + var asBuffer = this.value(true); + return "new Binary(Buffer.from(\"" + asBuffer.toString('hex') + "\", \"hex\"), " + this.sub_type + ")"; + }; + /** + * Binary default subtype + * @internal + */ + Binary.BSON_BINARY_SUBTYPE_DEFAULT = 0; + /** Initial buffer default size */ + Binary.BUFFER_SIZE = 256; + /** Default BSON type */ + Binary.SUBTYPE_DEFAULT = 0; + /** Function BSON type */ + Binary.SUBTYPE_FUNCTION = 1; + /** Byte Array BSON type */ + Binary.SUBTYPE_BYTE_ARRAY = 2; + /** Deprecated UUID BSON type @deprecated Please use SUBTYPE_UUID */ + Binary.SUBTYPE_UUID_OLD = 3; + /** UUID BSON type */ + Binary.SUBTYPE_UUID = 4; + /** MD5 BSON type */ + Binary.SUBTYPE_MD5 = 5; + /** Encrypted BSON type */ + Binary.SUBTYPE_ENCRYPTED = 6; + /** Column BSON type */ + Binary.SUBTYPE_COLUMN = 7; + /** User BSON type */ + Binary.SUBTYPE_USER_DEFINED = 128; + return Binary; +}()); +exports.Binary = Binary; +Object.defineProperty(Binary.prototype, '_bsontype', { value: 'Binary' }); +//# sourceMappingURL=binary.js.map \ No newline at end of file diff --git a/node_modules/bson/lib/binary.js.map b/node_modules/bson/lib/binary.js.map new file mode 100644 index 000000000..4aa93c0e3 --- /dev/null +++ b/node_modules/bson/lib/binary.js.map @@ -0,0 +1 @@ +{"version":3,"file":"binary.js","sourceRoot":"","sources":["../src/binary.ts"],"names":[],"mappings":";;;AAAA,iCAAgC;AAChC,iDAA+C;AAC/C,2CAAqD;AACrD,+BAA4C;AAE5C,iCAAmD;AAmBnD;;;;GAIG;AACH;IAkCE;;;OAGG;IACH,gBAAY,MAAgC,EAAE,OAAgB;QAC5D,IAAI,CAAC,CAAC,IAAI,YAAY,MAAM,CAAC;YAAE,OAAO,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QAElE,IACE,CAAC,CAAC,MAAM,IAAI,IAAI,CAAC;YACjB,CAAC,CAAC,OAAO,MAAM,KAAK,QAAQ,CAAC;YAC7B,CAAC,WAAW,CAAC,MAAM,CAAC,MAAM,CAAC;YAC3B,CAAC,CAAC,MAAM,YAAY,WAAW,CAAC;YAChC,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,EACtB;YACA,MAAM,IAAI,qBAAa,CACrB,kFAAkF,CACnF,CAAC;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PC;AA/PY,wBAAM;AAiQnB,MAAM,CAAC,cAAc,CAAC,MAAM,CAAC,SAAS,EAAE,WAAW,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/bson/lib/bson.js b/node_modules/bson/lib/bson.js new file mode 100644 index 000000000..88cc59eba --- /dev/null +++ b/node_modules/bson/lib/bson.js @@ -0,0 +1,252 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.BSONRegExp = exports.MaxKey = exports.MinKey = exports.Int32 = exports.Double = exports.Timestamp = exports.Long = exports.UUID = exports.ObjectId = exports.Binary = exports.DBRef = exports.BSONSymbol = exports.Map = exports.Code = exports.LongWithoutOverridesClass = exports.EJSON = exports.BSON_INT64_MIN = exports.BSON_INT64_MAX = exports.BSON_INT32_MIN = exports.BSON_INT32_MAX = exports.BSON_DATA_UNDEFINED = exports.BSON_DATA_TIMESTAMP = exports.BSON_DATA_SYMBOL = exports.BSON_DATA_STRING = exports.BSON_DATA_REGEXP = exports.BSON_DATA_OID = exports.BSON_DATA_OBJECT = exports.BSON_DATA_NUMBER = exports.BSON_DATA_NULL = exports.BSON_DATA_MIN_KEY = exports.BSON_DATA_MAX_KEY = exports.BSON_DATA_LONG = exports.BSON_DATA_INT = exports.BSON_DATA_DECIMAL128 = exports.BSON_DATA_DBPOINTER = exports.BSON_DATA_DATE = exports.BSON_DATA_CODE_W_SCOPE = exports.BSON_DATA_CODE = exports.BSON_DATA_BOOLEAN = exports.BSON_DATA_BINARY = exports.BSON_DATA_ARRAY = exports.BSON_BINARY_SUBTYPE_COLUMN = exports.BSON_BINARY_SUBTYPE_ENCRYPTED = exports.BSON_BINARY_SUBTYPE_UUID_NEW = exports.BSON_BINARY_SUBTYPE_UUID = exports.BSON_BINARY_SUBTYPE_USER_DEFINED = exports.BSON_BINARY_SUBTYPE_MD5 = exports.BSON_BINARY_SUBTYPE_FUNCTION = exports.BSON_BINARY_SUBTYPE_DEFAULT = exports.BSON_BINARY_SUBTYPE_BYTE_ARRAY = void 0; +exports.deserializeStream = exports.calculateObjectSize = exports.deserialize = exports.serializeWithBufferAndIndex = exports.serialize = exports.setInternalBufferSize = exports.BSONTypeError = exports.BSONError = exports.ObjectID = exports.Decimal128 = void 0; +var buffer_1 = require("buffer"); +var binary_1 = require("./binary"); +Object.defineProperty(exports, "Binary", { enumerable: true, get: function () { return binary_1.Binary; } }); +var code_1 = require("./code"); +Object.defineProperty(exports, "Code", { enumerable: true, get: function () { return code_1.Code; } }); +var db_ref_1 = require("./db_ref"); +Object.defineProperty(exports, "DBRef", { enumerable: true, get: function () { return db_ref_1.DBRef; } }); +var decimal128_1 = require("./decimal128"); +Object.defineProperty(exports, "Decimal128", { enumerable: true, get: function () { return decimal128_1.Decimal128; } }); +var double_1 = require("./double"); +Object.defineProperty(exports, "Double", { enumerable: true, get: function () { return double_1.Double; } }); +var ensure_buffer_1 = require("./ensure_buffer"); +var extended_json_1 = require("./extended_json"); +var int_32_1 = require("./int_32"); +Object.defineProperty(exports, "Int32", { enumerable: true, get: function () { return int_32_1.Int32; } }); +var long_1 = require("./long"); +Object.defineProperty(exports, "Long", { enumerable: true, get: function () { return long_1.Long; } }); +var map_1 = require("./map"); +Object.defineProperty(exports, "Map", { enumerable: true, get: function () { return map_1.Map; } }); +var max_key_1 = require("./max_key"); +Object.defineProperty(exports, "MaxKey", { enumerable: true, get: function () { return max_key_1.MaxKey; } }); +var min_key_1 = require("./min_key"); +Object.defineProperty(exports, "MinKey", { enumerable: true, get: function () { return min_key_1.MinKey; } }); +var objectid_1 = require("./objectid"); +Object.defineProperty(exports, "ObjectId", { enumerable: true, get: function () { return objectid_1.ObjectId; } }); +Object.defineProperty(exports, "ObjectID", { enumerable: true, get: function () { return objectid_1.ObjectId; } }); +var error_1 = require("./error"); +var calculate_size_1 = require("./parser/calculate_size"); +// Parts of the parser +var deserializer_1 = require("./parser/deserializer"); +var serializer_1 = require("./parser/serializer"); +var regexp_1 = require("./regexp"); +Object.defineProperty(exports, "BSONRegExp", { enumerable: true, get: function () { return regexp_1.BSONRegExp; } }); +var symbol_1 = require("./symbol"); +Object.defineProperty(exports, "BSONSymbol", { enumerable: true, get: function () { return symbol_1.BSONSymbol; } }); +var timestamp_1 = require("./timestamp"); +Object.defineProperty(exports, "Timestamp", { enumerable: true, get: function () { return timestamp_1.Timestamp; } }); +var uuid_1 = require("./uuid"); +Object.defineProperty(exports, "UUID", { enumerable: true, get: function () { return uuid_1.UUID; } }); +var constants_1 = require("./constants"); +Object.defineProperty(exports, "BSON_BINARY_SUBTYPE_BYTE_ARRAY", { enumerable: true, get: function () { return constants_1.BSON_BINARY_SUBTYPE_BYTE_ARRAY; } }); +Object.defineProperty(exports, "BSON_BINARY_SUBTYPE_DEFAULT", { enumerable: true, get: function () { return constants_1.BSON_BINARY_SUBTYPE_DEFAULT; } }); +Object.defineProperty(exports, "BSON_BINARY_SUBTYPE_FUNCTION", { enumerable: true, get: function () { return constants_1.BSON_BINARY_SUBTYPE_FUNCTION; } }); +Object.defineProperty(exports, "BSON_BINARY_SUBTYPE_MD5", { enumerable: true, get: function () { return constants_1.BSON_BINARY_SUBTYPE_MD5; } }); +Object.defineProperty(exports, "BSON_BINARY_SUBTYPE_USER_DEFINED", { enumerable: true, get: function () { return constants_1.BSON_BINARY_SUBTYPE_USER_DEFINED; } }); +Object.defineProperty(exports, "BSON_BINARY_SUBTYPE_UUID", { enumerable: true, get: function () { return constants_1.BSON_BINARY_SUBTYPE_UUID; } }); +Object.defineProperty(exports, "BSON_BINARY_SUBTYPE_UUID_NEW", { enumerable: true, get: function () { return constants_1.BSON_BINARY_SUBTYPE_UUID_NEW; } }); +Object.defineProperty(exports, "BSON_BINARY_SUBTYPE_ENCRYPTED", { enumerable: true, get: function () { return constants_1.BSON_BINARY_SUBTYPE_ENCRYPTED; } }); +Object.defineProperty(exports, "BSON_BINARY_SUBTYPE_COLUMN", { enumerable: true, get: function () { return constants_1.BSON_BINARY_SUBTYPE_COLUMN; } }); +Object.defineProperty(exports, "BSON_DATA_ARRAY", { enumerable: true, get: function () { return constants_1.BSON_DATA_ARRAY; } }); +Object.defineProperty(exports, "BSON_DATA_BINARY", { enumerable: true, get: function () { return constants_1.BSON_DATA_BINARY; } }); +Object.defineProperty(exports, "BSON_DATA_BOOLEAN", { enumerable: true, get: function () { return constants_1.BSON_DATA_BOOLEAN; } }); +Object.defineProperty(exports, "BSON_DATA_CODE", { enumerable: true, get: function () { return constants_1.BSON_DATA_CODE; } }); +Object.defineProperty(exports, "BSON_DATA_CODE_W_SCOPE", { enumerable: true, get: function () { return constants_1.BSON_DATA_CODE_W_SCOPE; } }); +Object.defineProperty(exports, "BSON_DATA_DATE", { enumerable: true, get: function () { return constants_1.BSON_DATA_DATE; } }); +Object.defineProperty(exports, "BSON_DATA_DBPOINTER", { enumerable: true, get: function () { return constants_1.BSON_DATA_DBPOINTER; } }); +Object.defineProperty(exports, "BSON_DATA_DECIMAL128", { enumerable: true, get: function () { return constants_1.BSON_DATA_DECIMAL128; } }); +Object.defineProperty(exports, "BSON_DATA_INT", { enumerable: true, get: function () { return constants_1.BSON_DATA_INT; } }); +Object.defineProperty(exports, "BSON_DATA_LONG", { enumerable: true, get: function () { return constants_1.BSON_DATA_LONG; } }); +Object.defineProperty(exports, "BSON_DATA_MAX_KEY", { enumerable: true, get: function () { return constants_1.BSON_DATA_MAX_KEY; } }); +Object.defineProperty(exports, "BSON_DATA_MIN_KEY", { enumerable: true, get: function () { return constants_1.BSON_DATA_MIN_KEY; } }); +Object.defineProperty(exports, "BSON_DATA_NULL", { enumerable: true, get: function () { return constants_1.BSON_DATA_NULL; } }); +Object.defineProperty(exports, "BSON_DATA_NUMBER", { enumerable: true, get: function () { return constants_1.BSON_DATA_NUMBER; } }); +Object.defineProperty(exports, "BSON_DATA_OBJECT", { enumerable: true, get: function () { return constants_1.BSON_DATA_OBJECT; } }); +Object.defineProperty(exports, "BSON_DATA_OID", { enumerable: true, get: function () { return constants_1.BSON_DATA_OID; } }); +Object.defineProperty(exports, "BSON_DATA_REGEXP", { enumerable: true, get: function () { return constants_1.BSON_DATA_REGEXP; } }); +Object.defineProperty(exports, "BSON_DATA_STRING", { enumerable: true, get: function () { return constants_1.BSON_DATA_STRING; } }); +Object.defineProperty(exports, "BSON_DATA_SYMBOL", { enumerable: true, get: function () { return constants_1.BSON_DATA_SYMBOL; } }); +Object.defineProperty(exports, "BSON_DATA_TIMESTAMP", { enumerable: true, get: function () { return constants_1.BSON_DATA_TIMESTAMP; } }); +Object.defineProperty(exports, "BSON_DATA_UNDEFINED", { enumerable: true, get: function () { return constants_1.BSON_DATA_UNDEFINED; } }); +Object.defineProperty(exports, "BSON_INT32_MAX", { enumerable: true, get: function () { return constants_1.BSON_INT32_MAX; } }); +Object.defineProperty(exports, "BSON_INT32_MIN", { enumerable: true, get: function () { return constants_1.BSON_INT32_MIN; } }); +Object.defineProperty(exports, "BSON_INT64_MAX", { enumerable: true, get: function () { return constants_1.BSON_INT64_MAX; } }); +Object.defineProperty(exports, "BSON_INT64_MIN", { enumerable: true, get: function () { return constants_1.BSON_INT64_MIN; } }); +var extended_json_2 = require("./extended_json"); +Object.defineProperty(exports, "EJSON", { enumerable: true, get: function () { return extended_json_2.EJSON; } }); +var timestamp_2 = require("./timestamp"); +Object.defineProperty(exports, "LongWithoutOverridesClass", { enumerable: true, get: function () { return timestamp_2.LongWithoutOverridesClass; } }); +var error_2 = require("./error"); +Object.defineProperty(exports, "BSONError", { enumerable: true, get: function () { return error_2.BSONError; } }); +Object.defineProperty(exports, "BSONTypeError", { enumerable: true, get: function () { return error_2.BSONTypeError; } }); +/** @internal */ +// Default Max Size +var MAXSIZE = 1024 * 1024 * 17; +// Current Internal Temporary Serialization Buffer +var buffer = buffer_1.Buffer.alloc(MAXSIZE); +/** + * Sets the size of the internal serialization buffer. + * + * @param size - The desired size for the internal serialization buffer + * @public + */ +function setInternalBufferSize(size) { + // Resize the internal serialization buffer if needed + if (buffer.length < size) { + buffer = buffer_1.Buffer.alloc(size); + } +} +exports.setInternalBufferSize = setInternalBufferSize; +/** + * Serialize a Javascript object. + * + * @param object - the Javascript object to serialize. + * @returns Buffer object containing the serialized object. + * @public + */ +function serialize(object, options) { + if (options === void 0) { options = {}; } + // Unpack the options + var checkKeys = typeof options.checkKeys === 'boolean' ? options.checkKeys : false; + var serializeFunctions = typeof options.serializeFunctions === 'boolean' ? options.serializeFunctions : false; + var ignoreUndefined = typeof options.ignoreUndefined === 'boolean' ? options.ignoreUndefined : true; + var minInternalBufferSize = typeof options.minInternalBufferSize === 'number' ? options.minInternalBufferSize : MAXSIZE; + // Resize the internal serialization buffer if needed + if (buffer.length < minInternalBufferSize) { + buffer = buffer_1.Buffer.alloc(minInternalBufferSize); + } + // Attempt to serialize + var serializationIndex = serializer_1.serializeInto(buffer, object, checkKeys, 0, 0, serializeFunctions, ignoreUndefined, []); + // Create the final buffer + var finishedBuffer = buffer_1.Buffer.alloc(serializationIndex); + // Copy into the finished buffer + buffer.copy(finishedBuffer, 0, 0, finishedBuffer.length); + // Return the buffer + return finishedBuffer; +} +exports.serialize = serialize; +/** + * Serialize a Javascript object using a predefined Buffer and index into the buffer, + * useful when pre-allocating the space for serialization. + * + * @param object - the Javascript object to serialize. + * @param finalBuffer - the Buffer you pre-allocated to store the serialized BSON object. + * @returns the index pointing to the last written byte in the buffer. + * @public + */ +function serializeWithBufferAndIndex(object, finalBuffer, options) { + if (options === void 0) { options = {}; } + // Unpack the options + var checkKeys = typeof options.checkKeys === 'boolean' ? options.checkKeys : false; + var serializeFunctions = typeof options.serializeFunctions === 'boolean' ? options.serializeFunctions : false; + var ignoreUndefined = typeof options.ignoreUndefined === 'boolean' ? options.ignoreUndefined : true; + var startIndex = typeof options.index === 'number' ? options.index : 0; + // Attempt to serialize + var serializationIndex = serializer_1.serializeInto(buffer, object, checkKeys, 0, 0, serializeFunctions, ignoreUndefined); + buffer.copy(finalBuffer, startIndex, 0, serializationIndex); + // Return the index + return startIndex + serializationIndex - 1; +} +exports.serializeWithBufferAndIndex = serializeWithBufferAndIndex; +/** + * Deserialize data as BSON. + * + * @param buffer - the buffer containing the serialized set of BSON documents. + * @returns returns the deserialized Javascript Object. + * @public + */ +function deserialize(buffer, options) { + if (options === void 0) { options = {}; } + return deserializer_1.deserialize(buffer instanceof buffer_1.Buffer ? buffer : ensure_buffer_1.ensureBuffer(buffer), options); +} +exports.deserialize = deserialize; +/** + * Calculate the bson size for a passed in Javascript object. + * + * @param object - the Javascript object to calculate the BSON byte size for + * @returns size of BSON object in bytes + * @public + */ +function calculateObjectSize(object, options) { + if (options === void 0) { options = {}; } + options = options || {}; + var serializeFunctions = typeof options.serializeFunctions === 'boolean' ? options.serializeFunctions : false; + var ignoreUndefined = typeof options.ignoreUndefined === 'boolean' ? options.ignoreUndefined : true; + return calculate_size_1.calculateObjectSize(object, serializeFunctions, ignoreUndefined); +} +exports.calculateObjectSize = calculateObjectSize; +/** + * Deserialize stream data as BSON documents. + * + * @param data - the buffer containing the serialized set of BSON documents. + * @param startIndex - the start index in the data Buffer where the deserialization is to start. + * @param numberOfDocuments - number of documents to deserialize. + * @param documents - an array where to store the deserialized documents. + * @param docStartIndex - the index in the documents array from where to start inserting documents. + * @param options - additional options used for the deserialization. + * @returns next index in the buffer after deserialization **x** numbers of documents. + * @public + */ +function deserializeStream(data, startIndex, numberOfDocuments, documents, docStartIndex, options) { + var internalOptions = Object.assign({ allowObjectSmallerThanBufferSize: true, index: 0 }, options); + var bufferData = ensure_buffer_1.ensureBuffer(data); + var index = startIndex; + // Loop over all documents + for (var i = 0; i < numberOfDocuments; i++) { + // Find size of the document + var size = bufferData[index] | + (bufferData[index + 1] << 8) | + (bufferData[index + 2] << 16) | + (bufferData[index + 3] << 24); + // Update options with index + internalOptions.index = index; + // Parse the document at this point + documents[docStartIndex + i] = deserializer_1.deserialize(bufferData, internalOptions); + // Adjust index by the document size + index = index + size; + } + // Return object containing end index of parsing and list of documents + return index; +} +exports.deserializeStream = deserializeStream; +/** + * BSON default export + * @deprecated Please use named exports + * @privateRemarks + * We want to someday deprecate the default export, + * so none of the new TS types are being exported on the default + * @public + */ +var BSON = { + Binary: binary_1.Binary, + Code: code_1.Code, + DBRef: db_ref_1.DBRef, + Decimal128: decimal128_1.Decimal128, + Double: double_1.Double, + Int32: int_32_1.Int32, + Long: long_1.Long, + UUID: uuid_1.UUID, + Map: map_1.Map, + MaxKey: max_key_1.MaxKey, + MinKey: min_key_1.MinKey, + ObjectId: objectid_1.ObjectId, + ObjectID: objectid_1.ObjectId, + BSONRegExp: regexp_1.BSONRegExp, + BSONSymbol: symbol_1.BSONSymbol, + Timestamp: timestamp_1.Timestamp, + EJSON: extended_json_1.EJSON, + setInternalBufferSize: setInternalBufferSize, + serialize: serialize, + serializeWithBufferAndIndex: serializeWithBufferAndIndex, + deserialize: deserialize, + calculateObjectSize: calculateObjectSize, + deserializeStream: deserializeStream, + BSONError: error_1.BSONError, + BSONTypeError: error_1.BSONTypeError +}; +exports.default = BSON; +//# sourceMappingURL=bson.js.map \ No newline at end of file diff --git a/node_modules/bson/lib/bson.js.map b/node_modules/bson/lib/bson.js.map new file mode 100644 index 000000000..a195407c2 --- /dev/null +++ b/node_modules/bson/lib/bson.js.map @@ -0,0 +1 @@ +{"version":3,"file":"bson.js","sourceRoot":"","sources":["../src/bson.ts"],"names":[],"mappings":";;;;AAAA,iCAAgC;AAChC,mCAAkC;AAoFhC,uFApFO,eAAM,OAoFP;AAnFR,+BAA8B;AA+E5B,qFA/EO,WAAI,OA+EP;AA9EN,mCAAiC;AAiF/B,sFAjFO,cAAK,OAiFP;AAhFP,2CAA0C;AA2FxC,2FA3FO,uBAAU,OA2FP;AA1FZ,mCAAkC;AAqFhC,uFArFO,eAAM,OAqFP;AApFR,iDAA+C;AAC/C,iDAAwC;AACxC,mCAAiC;AAmF/B,sFAnFO,cAAK,OAmFP;AAlFP,+BAA8B;AA+E5B,qFA/EO,WAAI,OA+EP;AA9EN,6BAA4B;AAwE1B,oFAx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ACL,qBAAqB,uBAAA;IACrB,SAAS,WAAA;IACT,2BAA2B,6BAAA;IAC3B,WAAW,aAAA;IACX,mBAAmB,qBAAA;IACnB,iBAAiB,mBAAA;IACjB,SAAS,mBAAA;IACT,aAAa,uBAAA;CACd,CAAC;AACF,kBAAe,IAAI,CAAC"} \ No newline at end of file diff --git a/node_modules/bson/lib/code.js b/node_modules/bson/lib/code.js new file mode 100644 index 000000000..7cbec9674 --- /dev/null +++ b/node_modules/bson/lib/code.js @@ -0,0 +1,46 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Code = void 0; +/** + * A class representation of the BSON Code type. + * @public + * @category BSONType + */ +var Code = /** @class */ (function () { + /** + * @param code - a string or function. + * @param scope - an optional scope for the function. + */ + function Code(code, scope) { + if (!(this instanceof Code)) + return new Code(code, scope); + this.code = code; + this.scope = scope; + } + Code.prototype.toJSON = function () { + return { code: this.code, scope: this.scope }; + }; + /** @internal */ + Code.prototype.toExtendedJSON = function () { + if (this.scope) { + return { $code: this.code, $scope: this.scope }; + } + return { $code: this.code }; + }; + /** @internal */ + Code.fromExtendedJSON = function (doc) { + return new Code(doc.$code, doc.$scope); + }; + /** @internal */ + Code.prototype[Symbol.for('nodejs.util.inspect.custom')] = function () { + return this.inspect(); + }; + Code.prototype.inspect = function () { + var codeJson = this.toJSON(); + return "new Code(\"" + codeJson.code + "\"" + (codeJson.scope ? ", " + JSON.stringify(codeJson.scope) : '') + ")"; + }; + return Code; +}()); +exports.Code = Code; +Object.defineProperty(Code.prototype, '_bsontype', { value: 'Code' }); +//# sourceMappingURL=code.js.map \ No newline at end of file diff --git a/node_modules/bson/lib/code.js.map b/node_modules/bson/lib/code.js.map new file mode 100644 index 000000000..e4e9ea4b7 --- /dev/null +++ b/node_modules/bson/lib/code.js.map @@ -0,0 +1 @@ +{"version":3,"file":"code.js","sourceRoot":"","sources":["../src/code.ts"],"names":[],"mappings":";;;AAQA;;;;GAIG;AACH;IAKE;;;OAGG;IACH,cA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EAAE,WAAW,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/bson/lib/constants.js b/node_modules/bson/lib/constants.js new file mode 100644 index 000000000..ff8b68d3d --- /dev/null +++ b/node_modules/bson/lib/constants.js @@ -0,0 +1,82 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.BSON_BINARY_SUBTYPE_USER_DEFINED = exports.BSON_BINARY_SUBTYPE_COLUMN = exports.BSON_BINARY_SUBTYPE_ENCRYPTED = exports.BSON_BINARY_SUBTYPE_MD5 = exports.BSON_BINARY_SUBTYPE_UUID_NEW = exports.BSON_BINARY_SUBTYPE_UUID = exports.BSON_BINARY_SUBTYPE_BYTE_ARRAY = exports.BSON_BINARY_SUBTYPE_FUNCTION = exports.BSON_BINARY_SUBTYPE_DEFAULT = exports.BSON_DATA_MAX_KEY = exports.BSON_DATA_MIN_KEY = exports.BSON_DATA_DECIMAL128 = exports.BSON_DATA_LONG = exports.BSON_DATA_TIMESTAMP = exports.BSON_DATA_INT = exports.BSON_DATA_CODE_W_SCOPE = exports.BSON_DATA_SYMBOL = exports.BSON_DATA_CODE = exports.BSON_DATA_DBPOINTER = exports.BSON_DATA_REGEXP = exports.BSON_DATA_NULL = exports.BSON_DATA_DATE = exports.BSON_DATA_BOOLEAN = exports.BSON_DATA_OID = exports.BSON_DATA_UNDEFINED = exports.BSON_DATA_BINARY = exports.BSON_DATA_ARRAY = exports.BSON_DATA_OBJECT = exports.BSON_DATA_STRING = exports.BSON_DATA_NUMBER = exports.JS_INT_MIN = exports.JS_INT_MAX = exports.BSON_INT64_MIN = exports.BSON_INT64_MAX = exports.BSON_INT32_MIN = exports.BSON_INT32_MAX = void 0; +/** @internal */ +exports.BSON_INT32_MAX = 0x7fffffff; +/** @internal */ +exports.BSON_INT32_MIN = -0x80000000; +/** @internal */ +exports.BSON_INT64_MAX = Math.pow(2, 63) - 1; +/** @internal */ +exports.BSON_INT64_MIN = -Math.pow(2, 63); +/** + * Any integer up to 2^53 can be precisely represented by a double. + * @internal + */ +exports.JS_INT_MAX = Math.pow(2, 53); +/** + * Any integer down to -2^53 can be precisely represented by a double. + * @internal + */ +exports.JS_INT_MIN = -Math.pow(2, 53); +/** Number BSON Type @internal */ +exports.BSON_DATA_NUMBER = 1; +/** String BSON Type @internal */ +exports.BSON_DATA_STRING = 2; +/** Object BSON Type @internal */ +exports.BSON_DATA_OBJECT = 3; +/** Array BSON Type @internal */ +exports.BSON_DATA_ARRAY = 4; +/** Binary BSON Type @internal */ +exports.BSON_DATA_BINARY = 5; +/** Binary BSON Type @internal */ +exports.BSON_DATA_UNDEFINED = 6; +/** ObjectId BSON Type @internal */ +exports.BSON_DATA_OID = 7; +/** Boolean BSON Type @internal */ +exports.BSON_DATA_BOOLEAN = 8; +/** Date BSON Type @internal */ +exports.BSON_DATA_DATE = 9; +/** null BSON Type @internal */ +exports.BSON_DATA_NULL = 10; +/** RegExp BSON Type @internal */ +exports.BSON_DATA_REGEXP = 11; +/** Code BSON Type @internal */ +exports.BSON_DATA_DBPOINTER = 12; +/** Code BSON Type @internal */ +exports.BSON_DATA_CODE = 13; +/** Symbol BSON Type @internal */ +exports.BSON_DATA_SYMBOL = 14; +/** Code with Scope BSON Type @internal */ +exports.BSON_DATA_CODE_W_SCOPE = 15; +/** 32 bit Integer BSON Type @internal */ +exports.BSON_DATA_INT = 16; +/** Timestamp BSON Type @internal */ +exports.BSON_DATA_TIMESTAMP = 17; +/** Long BSON Type @internal */ +exports.BSON_DATA_LONG = 18; +/** Decimal128 BSON Type @internal */ +exports.BSON_DATA_DECIMAL128 = 19; +/** MinKey BSON Type @internal */ +exports.BSON_DATA_MIN_KEY = 0xff; +/** MaxKey BSON Type @internal */ +exports.BSON_DATA_MAX_KEY = 0x7f; +/** Binary Default Type @internal */ +exports.BSON_BINARY_SUBTYPE_DEFAULT = 0; +/** Binary Function Type @internal */ +exports.BSON_BINARY_SUBTYPE_FUNCTION = 1; +/** Binary Byte Array Type @internal */ +exports.BSON_BINARY_SUBTYPE_BYTE_ARRAY = 2; +/** Binary Deprecated UUID Type @deprecated Please use BSON_BINARY_SUBTYPE_UUID_NEW @internal */ +exports.BSON_BINARY_SUBTYPE_UUID = 3; +/** Binary UUID Type @internal */ +exports.BSON_BINARY_SUBTYPE_UUID_NEW = 4; +/** Binary MD5 Type @internal */ +exports.BSON_BINARY_SUBTYPE_MD5 = 5; +/** Encrypted BSON type @internal */ +exports.BSON_BINARY_SUBTYPE_ENCRYPTED = 6; +/** Column BSON type @internal */ +exports.BSON_BINARY_SUBTYPE_COLUMN = 7; +/** Binary User Defined Type @internal */ +exports.BSON_BINARY_SUBTYPE_USER_DEFINED = 128; +//# sourceMappingURL=constants.js.map \ No newline at end of file diff --git a/node_modules/bson/lib/constants.js.map b/node_modules/bson/lib/constants.js.map new file mode 100644 index 000000000..3b9c0ca6c --- /dev/null +++ b/node_modules/bson/lib/constants.js.map @@ -0,0 +1 @@ +{"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":";;;AAAA,gBAAgB;AACH,QAAA,cAAc,GAAG,UAAU,CAAC;AACzC,gBAAgB;AACH,QAAA,cAAc,GAAG,CAAC,UAAU,CAAC;AAC1C,gBAAgB;AACH,QAAA,cAAc,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,CAAC;AAClD,gBAAgB;AACH,QAAA,cAAc,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;AAE/C;;;GAGG;AACU,QAAA,UAAU,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;AAE1C;;;GAGG;AACU,QAAA,UAAU,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;AAE3C,iCAAiC;AACpB,QAAA,gBAAgB,GAAG,CAAC,CAAC;AAElC,iCAA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ACnF,QAAA,wBAAwB,GAAG,CAAC,CAAC;AAE1C,iCAAiC;AACpB,QAAA,4BAA4B,GAAG,CAAC,CAAC;AAE9C,gCAAgC;AACnB,QAAA,uBAAuB,GAAG,CAAC,CAAC;AAEzC,oCAAoC;AACvB,QAAA,6BAA6B,GAAG,CAAC,CAAC;AAE/C,iCAAiC;AACpB,QAAA,0BAA0B,GAAG,CAAC,CAAC;AAE5C,yCAAyC;AAC5B,QAAA,gCAAgC,GAAG,GAAG,CAAC"} \ No newline at end of file diff --git a/node_modules/bson/lib/db_ref.js b/node_modules/bson/lib/db_ref.js new file mode 100644 index 000000000..54d58393d --- /dev/null +++ b/node_modules/bson/lib/db_ref.js @@ -0,0 +1,97 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.DBRef = exports.isDBRefLike = void 0; +var utils_1 = require("./parser/utils"); +/** @internal */ +function isDBRefLike(value) { + return (utils_1.isObjectLike(value) && + value.$id != null && + typeof value.$ref === 'string' && + (value.$db == null || typeof value.$db === 'string')); +} +exports.isDBRefLike = isDBRefLike; +/** + * A class representation of the BSON DBRef type. + * @public + * @category BSONType + */ +var DBRef = /** @class */ (function () { + /** + * @param collection - the collection name. + * @param oid - the reference ObjectId. + * @param db - optional db name, if omitted the reference is local to the current db. + */ + function DBRef(collection, oid, db, fields) { + if (!(this instanceof DBRef)) + return new DBRef(collection, oid, db, fields); + // check if namespace has been provided + var parts = collection.split('.'); + if (parts.length === 2) { + db = parts.shift(); + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + collection = parts.shift(); + } + this.collection = collection; + this.oid = oid; + this.db = db; + this.fields = fields || {}; + } + Object.defineProperty(DBRef.prototype, "namespace", { + // Property provided for compatibility with the 1.x parser + // the 1.x parser used a "namespace" property, while 4.x uses "collection" + /** @internal */ + get: function () { + return this.collection; + }, + set: function (value) { + this.collection = value; + }, + enumerable: false, + configurable: true + }); + DBRef.prototype.toJSON = function () { + var o = Object.assign({ + $ref: this.collection, + $id: this.oid + }, this.fields); + if (this.db != null) + o.$db = this.db; + return o; + }; + /** @internal */ + DBRef.prototype.toExtendedJSON = function (options) { + options = options || {}; + var o = { + $ref: this.collection, + $id: this.oid + }; + if (options.legacy) { + return o; + } + if (this.db) + o.$db = this.db; + o = Object.assign(o, this.fields); + return o; + }; + /** @internal */ + DBRef.fromExtendedJSON = function (doc) { + var copy = Object.assign({}, doc); + delete copy.$ref; + delete copy.$id; + delete copy.$db; + return new DBRef(doc.$ref, doc.$id, doc.$db, copy); + }; + /** @internal */ + DBRef.prototype[Symbol.for('nodejs.util.inspect.custom')] = function () { + return this.inspect(); + }; + DBRef.prototype.inspect = function () { + // NOTE: if OID is an ObjectId class it will just print the oid string. + var oid = this.oid === undefined || this.oid.toString === undefined ? this.oid : this.oid.toString(); + return "new DBRef(\"" + this.namespace + "\", new ObjectId(\"" + oid + "\")" + (this.db ? ", \"" + this.db + "\"" : '') + ")"; + }; + return DBRef; +}()); +exports.DBRef = DBRef; +Object.defineProperty(DBRef.prototype, '_bsontype', { value: 'DBRef' }); +//# sourceMappingURL=db_ref.js.map \ No newline at end of file diff --git a/node_modules/bson/lib/db_ref.js.map b/node_modules/bson/lib/db_ref.js.map new file mode 100644 index 000000000..3e95f4b1b --- /dev/null +++ b/node_modules/bson/lib/db_ref.js.map @@ -0,0 +1 @@ +{"version":3,"file":"db_ref.js","sourceRoot":"","sources":["../src/db_ref.ts"],"names":[],"mappings":";;;AAGA,wCAA8C;AAS9C,gBAAgB;AAChB,SAAgB,WAAW,CAAC,KAAc;IACxC,OAAO,CACL,oBAAY,CAAC,KAAK,CAAC;QACnB,KAAK,CAAC,GAAG,IAAI,IAAI;QACjB,OAAO,KAAK,CAAC,IAAI,KAAK,QAAQ;QAC9B,CAAC,KAAK,CAAC,GAAG,IAAI,IAAI,IAAI,OAAO,KAAK,CAAC,GAAG,KAAK,QAAQ,CAAC,CACrD,CAAC;AACJ,CAAC;AAPD,kCAOC;AAED;;;;GAIG;AACH;IAQE;;;;O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,CAAC,CAAC,EAAE,OAC9B,CAAC;IACN,CAAC;IACH,YAAC;AAAD,CAAC,AA9FD,IA8FC;AA9FY,sBAAK;AAgGlB,MAAM,CAAC,cAAc,CAAC,KAAK,CAAC,SAAS,EAAE,WAAW,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/bson/lib/decimal128.js b/node_modules/bson/lib/decimal128.js new file mode 100644 index 000000000..6dc52f7bc --- /dev/null +++ b/node_modules/bson/lib/decimal128.js @@ -0,0 +1,669 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Decimal128 = void 0; +var buffer_1 = require("buffer"); +var error_1 = require("./error"); +var long_1 = require("./long"); +var utils_1 = require("./parser/utils"); +var PARSE_STRING_REGEXP = /^(\+|-)?(\d+|(\d*\.\d*))?(E|e)?([-+])?(\d+)?$/; +var PARSE_INF_REGEXP = /^(\+|-)?(Infinity|inf)$/i; +var PARSE_NAN_REGEXP = /^(\+|-)?NaN$/i; +var EXPONENT_MAX = 6111; +var EXPONENT_MIN = -6176; +var EXPONENT_BIAS = 6176; +var MAX_DIGITS = 34; +// Nan value bits as 32 bit values (due to lack of longs) +var NAN_BUFFER = [ + 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +].reverse(); +// Infinity value bits 32 bit values (due to lack of longs) +var INF_NEGATIVE_BUFFER = [ + 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +].reverse(); +var INF_POSITIVE_BUFFER = [ + 0x78, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +].reverse(); +var EXPONENT_REGEX = /^([-+])?(\d+)?$/; +// Extract least significant 5 bits +var COMBINATION_MASK = 0x1f; +// Extract least significant 14 bits +var EXPONENT_MASK = 0x3fff; +// Value of combination field for Inf +var COMBINATION_INFINITY = 30; +// Value of combination field for NaN +var COMBINATION_NAN = 31; +// Detect if the value is a digit +function isDigit(value) { + return !isNaN(parseInt(value, 10)); +} +// Divide two uint128 values +function divideu128(value) { + var DIVISOR = long_1.Long.fromNumber(1000 * 1000 * 1000); + var _rem = long_1.Long.fromNumber(0); + if (!value.parts[0] && !value.parts[1] && !value.parts[2] && !value.parts[3]) { + return { quotient: value, rem: _rem }; + } + for (var i = 0; i <= 3; i++) { + // Adjust remainder to match value of next dividend + _rem = _rem.shiftLeft(32); + // Add the divided to _rem + _rem = _rem.add(new long_1.Long(value.parts[i], 0)); + value.parts[i] = _rem.div(DIVISOR).low; + _rem = _rem.modulo(DIVISOR); + } + return { quotient: value, rem: _rem }; +} +// Multiply two Long values and return the 128 bit value +function multiply64x2(left, right) { + if (!left && !right) { + return { high: long_1.Long.fromNumber(0), low: long_1.Long.fromNumber(0) }; + } + var leftHigh = left.shiftRightUnsigned(32); + var leftLow = new long_1.Long(left.getLowBits(), 0); + var rightHigh = right.shiftRightUnsigned(32); + var rightLow = new long_1.Long(right.getLowBits(), 0); + var productHigh = leftHigh.multiply(rightHigh); + var productMid = leftHigh.multiply(rightLow); + var productMid2 = leftLow.multiply(rightHigh); + var productLow = leftLow.multiply(rightLow); + productHigh = productHigh.add(productMid.shiftRightUnsigned(32)); + productMid = new long_1.Long(productMid.getLowBits(), 0) + .add(productMid2) + .add(productLow.shiftRightUnsigned(32)); + productHigh = productHigh.add(productMid.shiftRightUnsigned(32)); + productLow = productMid.shiftLeft(32).add(new long_1.Long(productLow.getLowBits(), 0)); + // Return the 128 bit result + return { high: productHigh, low: productLow }; +} +function lessThan(left, right) { + // Make values unsigned + var uhleft = left.high >>> 0; + var uhright = right.high >>> 0; + // Compare high bits first + if (uhleft < uhright) { + return true; + } + else if (uhleft === uhright) { + var ulleft = left.low >>> 0; + var ulright = right.low >>> 0; + if (ulleft < ulright) + return true; + } + return false; +} +function invalidErr(string, message) { + throw new error_1.BSONTypeError("\"" + string + "\" is not a valid Decimal128 string - " + message); +} +/** + * A class representation of the BSON Decimal128 type. + * @public + * @category BSONType + */ +var Decimal128 = /** @class */ (function () { + /** + * @param bytes - a buffer containing the raw Decimal128 bytes in little endian order, + * or a string representation as returned by .toString() + */ + function Decimal128(bytes) { + if (!(this instanceof Decimal128)) + return new Decimal128(bytes); + if (typeof bytes === 'string') { + this.bytes = Decimal128.fromString(bytes).bytes; + } + else if (utils_1.isUint8Array(bytes)) { + if (bytes.byteLength !== 16) { + throw new error_1.BSONTypeError('Decimal128 must take a Buffer of 16 bytes'); + } + this.bytes = bytes; + } + else { + throw new error_1.BSONTypeError('Decimal128 must take a Buffer or string'); + } + } + /** + * Create a Decimal128 instance from a string representation + * + * @param representation - a numeric string representation. + */ + Decimal128.fromString = function (representation) { + // Parse state tracking + var isNegative = false; + var sawRadix = false; + var foundNonZero = false; + // Total number of significant digits (no leading or trailing zero) + var significantDigits = 0; + // Total number of significand digits read + var nDigitsRead = 0; + // Total number of digits (no leading zeros) + var nDigits = 0; + // The number of the digits after radix + var radixPosition = 0; + // The index of the first non-zero in *str* + var firstNonZero = 0; + // Digits Array + var digits = [0]; + // The number of digits in digits + var nDigitsStored = 0; + // Insertion pointer for digits + var digitsInsert = 0; + // The index of the first non-zero digit + var firstDigit = 0; + // The index of the last digit + var lastDigit = 0; + // Exponent + var exponent = 0; + // loop index over array + var i = 0; + // The high 17 digits of the significand + var significandHigh = new long_1.Long(0, 0); + // The low 17 digits of the significand + var significandLow = new long_1.Long(0, 0); + // The biased exponent + var biasedExponent = 0; + // Read index + var index = 0; + // Naively prevent against REDOS attacks. + // TODO: implementing a custom parsing for this, or refactoring the regex would yield + // further gains. + if (representation.length >= 7000) { + throw new error_1.BSONTypeError('' + representation + ' not a valid Decimal128 string'); + } + // Results + var stringMatch = representation.match(PARSE_STRING_REGEXP); + var infMatch = representation.match(PARSE_INF_REGEXP); + var nanMatch = representation.match(PARSE_NAN_REGEXP); + // Validate the string + if ((!stringMatch && !infMatch && !nanMatch) || representation.length === 0) { + throw new error_1.BSONTypeError('' + representation + ' not a valid Decimal128 string'); + } + if (stringMatch) { + // full_match = stringMatch[0] + // sign = stringMatch[1] + var unsignedNumber = stringMatch[2]; + // stringMatch[3] is undefined if a whole number (ex "1", 12") + // but defined if a number w/ decimal in it (ex "1.0, 12.2") + var e = stringMatch[4]; + var expSign = stringMatch[5]; + var expNumber = stringMatch[6]; + // they provided e, but didn't give an exponent number. for ex "1e" + if (e && expNumber === undefined) + invalidErr(representation, 'missing exponent power'); + // they provided e, but didn't give a number before it. for ex "e1" + if (e && unsignedNumber === undefined) + invalidErr(representation, 'missing exponent base'); + if (e === undefined && (expSign || expNumber)) { + invalidErr(representation, 'missing e before exponent'); + } + } + // Get the negative or positive sign + if (representation[index] === '+' || representation[index] === '-') { + isNegative = representation[index++] === '-'; + } + // Check if user passed Infinity or NaN + if (!isDigit(representation[index]) && representation[index] !== '.') { + if (representation[index] === 'i' || representation[index] === 'I') { + return new Decimal128(buffer_1.Buffer.from(isNegative ? INF_NEGATIVE_BUFFER : INF_POSITIVE_BUFFER)); + } + else if (representation[index] === 'N') { + return new Decimal128(buffer_1.Buffer.from(NAN_BUFFER)); + } + } + // Read all the digits + while (isDigit(representation[index]) || representation[index] === '.') { + if (representation[index] === '.') { + if (sawRadix) + invalidErr(representation, 'contains multiple periods'); + sawRadix = true; + index = index + 1; + continue; + } + if (nDigitsStored < 34) { + if (representation[index] !== '0' || foundNonZero) { + if (!foundNonZero) { + firstNonZero = nDigitsRead; + } + foundNonZero = true; + // Only store 34 digits + digits[digitsInsert++] = parseInt(representation[index], 10); + nDigitsStored = nDigitsStored + 1; + } + } + if (foundNonZero) + nDigits = nDigits + 1; + if (sawRadix) + radixPosition = radixPosition + 1; + nDigitsRead = nDigitsRead + 1; + index = index + 1; + } + if (sawRadix && !nDigitsRead) + throw new error_1.BSONTypeError('' + representation + ' not a valid Decimal128 string'); + // Read exponent if exists + if (representation[index] === 'e' || representation[index] === 'E') { + // Read exponent digits + var match = representation.substr(++index).match(EXPONENT_REGEX); + // No digits read + if (!match || !match[2]) + return new Decimal128(buffer_1.Buffer.from(NAN_BUFFER)); + // Get exponent + exponent = parseInt(match[0], 10); + // Adjust the index + index = index + match[0].length; + } + // Return not a number + if (representation[index]) + return new Decimal128(buffer_1.Buffer.from(NAN_BUFFER)); + // Done reading input + // Find first non-zero digit in digits + firstDigit = 0; + if (!nDigitsStored) { + firstDigit = 0; + lastDigit = 0; + digits[0] = 0; + nDigits = 1; + nDigitsStored = 1; + significantDigits = 0; + } + else { + lastDigit = nDigitsStored - 1; + significantDigits = nDigits; + if (significantDigits !== 1) { + while (digits[firstNonZero + significantDigits - 1] === 0) { + significantDigits = significantDigits - 1; + } + } + } + // Normalization of exponent + // Correct exponent based on radix position, and shift significand as needed + // to represent user input + // Overflow prevention + if (exponent <= radixPosition && radixPosition - exponent > 1 << 14) { + exponent = EXPONENT_MIN; + } + else { + exponent = exponent - radixPosition; + } + // Attempt to normalize the exponent + while (exponent > EXPONENT_MAX) { + // Shift exponent to significand and decrease + lastDigit = lastDigit + 1; + if (lastDigit - firstDigit > MAX_DIGITS) { + // Check if we have a zero then just hard clamp, otherwise fail + var digitsString = digits.join(''); + if (digitsString.match(/^0+$/)) { + exponent = EXPONENT_MAX; + break; + } + invalidErr(representation, 'overflow'); + } + exponent = exponent - 1; + } + while (exponent < EXPONENT_MIN || nDigitsStored < nDigits) { + // Shift last digit. can only do this if < significant digits than # stored. + if (lastDigit === 0 && significantDigits < nDigitsStored) { + exponent = EXPONENT_MIN; + significantDigits = 0; + break; + } + if (nDigitsStored < nDigits) { + // adjust to match digits not stored + nDigits = nDigits - 1; + } + else { + // adjust to round + lastDigit = lastDigit - 1; + } + if (exponent < EXPONENT_MAX) { + exponent = exponent + 1; + } + else { + // Check if we have a zero then just hard clamp, otherwise fail + var digitsString = digits.join(''); + if (digitsString.match(/^0+$/)) { + exponent = EXPONENT_MAX; + break; + } + invalidErr(representation, 'overflow'); + } + } + // Round + // We've normalized the exponent, but might still need to round. + if (lastDigit - firstDigit + 1 < significantDigits) { + var endOfString = nDigitsRead; + // If we have seen a radix point, 'string' is 1 longer than we have + // documented with ndigits_read, so inc the position of the first nonzero + // digit and the position that digits are read to. + if (sawRadix) { + firstNonZero = firstNonZero + 1; + endOfString = endOfString + 1; + } + // if negative, we need to increment again to account for - sign at start. + if (isNegative) { + firstNonZero = firstNonZero + 1; + endOfString = endOfString + 1; + } + var roundDigit = parseInt(representation[firstNonZero + lastDigit + 1], 10); + var roundBit = 0; + if (roundDigit >= 5) { + roundBit = 1; + if (roundDigit === 5) { + roundBit = digits[lastDigit] % 2 === 1 ? 1 : 0; + for (i = firstNonZero + lastDigit + 2; i < endOfString; i++) { + if (parseInt(representation[i], 10)) { + roundBit = 1; + break; + } + } + } + } + if (roundBit) { + var dIdx = lastDigit; + for (; dIdx >= 0; dIdx--) { + if (++digits[dIdx] > 9) { + digits[dIdx] = 0; + // overflowed most significant digit + if (dIdx === 0) { + if (exponent < EXPONENT_MAX) { + exponent = exponent + 1; + digits[dIdx] = 1; + } + else { + return new Decimal128(buffer_1.Buffer.from(isNegative ? INF_NEGATIVE_BUFFER : INF_POSITIVE_BUFFER)); + } + } + } + } + } + } + // Encode significand + // The high 17 digits of the significand + significandHigh = long_1.Long.fromNumber(0); + // The low 17 digits of the significand + significandLow = long_1.Long.fromNumber(0); + // read a zero + if (significantDigits === 0) { + significandHigh = long_1.Long.fromNumber(0); + significandLow = long_1.Long.fromNumber(0); + } + else if (lastDigit - firstDigit < 17) { + var dIdx = firstDigit; + significandLow = long_1.Long.fromNumber(digits[dIdx++]); + significandHigh = new long_1.Long(0, 0); + for (; dIdx <= lastDigit; dIdx++) { + significandLow = significandLow.multiply(long_1.Long.fromNumber(10)); + significandLow = significandLow.add(long_1.Long.fromNumber(digits[dIdx])); + } + } + else { + var dIdx = firstDigit; + significandHigh = long_1.Long.fromNumber(digits[dIdx++]); + for (; dIdx <= lastDigit - 17; dIdx++) { + significandHigh = significandHigh.multiply(long_1.Long.fromNumber(10)); + significandHigh = significandHigh.add(long_1.Long.fromNumber(digits[dIdx])); + } + significandLow = long_1.Long.fromNumber(digits[dIdx++]); + for (; dIdx <= lastDigit; dIdx++) { + significandLow = significandLow.multiply(long_1.Long.fromNumber(10)); + significandLow = significandLow.add(long_1.Long.fromNumber(digits[dIdx])); + } + } + var significand = multiply64x2(significandHigh, long_1.Long.fromString('100000000000000000')); + significand.low = significand.low.add(significandLow); + if (lessThan(significand.low, significandLow)) { + significand.high = significand.high.add(long_1.Long.fromNumber(1)); + } + // Biased exponent + biasedExponent = exponent + EXPONENT_BIAS; + var dec = { low: long_1.Long.fromNumber(0), high: long_1.Long.fromNumber(0) }; + // Encode combination, exponent, and significand. + if (significand.high.shiftRightUnsigned(49).and(long_1.Long.fromNumber(1)).equals(long_1.Long.fromNumber(1))) { + // Encode '11' into bits 1 to 3 + dec.high = dec.high.or(long_1.Long.fromNumber(0x3).shiftLeft(61)); + dec.high = dec.high.or(long_1.Long.fromNumber(biasedExponent).and(long_1.Long.fromNumber(0x3fff).shiftLeft(47))); + dec.high = dec.high.or(significand.high.and(long_1.Long.fromNumber(0x7fffffffffff))); + } + else { + dec.high = dec.high.or(long_1.Long.fromNumber(biasedExponent & 0x3fff).shiftLeft(49)); + dec.high = dec.high.or(significand.high.and(long_1.Long.fromNumber(0x1ffffffffffff))); + } + dec.low = significand.low; + // Encode sign + if (isNegative) { + dec.high = dec.high.or(long_1.Long.fromString('9223372036854775808')); + } + // Encode into a buffer + var buffer = buffer_1.Buffer.alloc(16); + index = 0; + // Encode the low 64 bits of the decimal + // Encode low bits + buffer[index++] = dec.low.low & 0xff; + buffer[index++] = (dec.low.low >> 8) & 0xff; + buffer[index++] = (dec.low.low >> 16) & 0xff; + buffer[index++] = (dec.low.low >> 24) & 0xff; + // Encode high bits + buffer[index++] = dec.low.high & 0xff; + buffer[index++] = (dec.low.high >> 8) & 0xff; + buffer[index++] = (dec.low.high >> 16) & 0xff; + buffer[index++] = (dec.low.high >> 24) & 0xff; + // Encode the high 64 bits of the decimal + // Encode low bits + buffer[index++] = dec.high.low & 0xff; + buffer[index++] = (dec.high.low >> 8) & 0xff; + buffer[index++] = (dec.high.low >> 16) & 0xff; + buffer[index++] = (dec.high.low >> 24) & 0xff; + // Encode high bits + buffer[index++] = dec.high.high & 0xff; + buffer[index++] = (dec.high.high >> 8) & 0xff; + buffer[index++] = (dec.high.high >> 16) & 0xff; + buffer[index++] = (dec.high.high >> 24) & 0xff; + // Return the new Decimal128 + return new Decimal128(buffer); + }; + /** Create a string representation of the raw Decimal128 value */ + Decimal128.prototype.toString = function () { + // Note: bits in this routine are referred to starting at 0, + // from the sign bit, towards the coefficient. + // decoded biased exponent (14 bits) + var biased_exponent; + // the number of significand digits + var significand_digits = 0; + // the base-10 digits in the significand + var significand = new Array(36); + for (var i = 0; i < significand.length; i++) + significand[i] = 0; + // read pointer into significand + var index = 0; + // true if the number is zero + var is_zero = false; + // the most significant significand bits (50-46) + var significand_msb; + // temporary storage for significand decoding + var significand128 = { parts: [0, 0, 0, 0] }; + // indexing variables + var j, k; + // Output string + var string = []; + // Unpack index + index = 0; + // Buffer reference + var buffer = this.bytes; + // Unpack the low 64bits into a long + // bits 96 - 127 + var low = buffer[index++] | (buffer[index++] << 8) | (buffer[index++] << 16) | (buffer[index++] << 24); + // bits 64 - 95 + var midl = buffer[index++] | (buffer[index++] << 8) | (buffer[index++] << 16) | (buffer[index++] << 24); + // Unpack the high 64bits into a long + // bits 32 - 63 + var midh = buffer[index++] | (buffer[index++] << 8) | (buffer[index++] << 16) | (buffer[index++] << 24); + // bits 0 - 31 + var high = buffer[index++] | (buffer[index++] << 8) | (buffer[index++] << 16) | (buffer[index++] << 24); + // Unpack index + index = 0; + // Create the state of the decimal + var dec = { + low: new long_1.Long(low, midl), + high: new long_1.Long(midh, high) + }; + if (dec.high.lessThan(long_1.Long.ZERO)) { + string.push('-'); + } + // Decode combination field and exponent + // bits 1 - 5 + var combination = (high >> 26) & COMBINATION_MASK; + if (combination >> 3 === 3) { + // Check for 'special' values + if (combination === COMBINATION_INFINITY) { + return string.join('') + 'Infinity'; + } + else if (combination === COMBINATION_NAN) { + return 'NaN'; + } + else { + biased_exponent = (high >> 15) & EXPONENT_MASK; + significand_msb = 0x08 + ((high >> 14) & 0x01); + } + } + else { + significand_msb = (high >> 14) & 0x07; + biased_exponent = (high >> 17) & EXPONENT_MASK; + } + // unbiased exponent + var exponent = biased_exponent - EXPONENT_BIAS; + // Create string of significand digits + // Convert the 114-bit binary number represented by + // (significand_high, significand_low) to at most 34 decimal + // digits through modulo and division. + significand128.parts[0] = (high & 0x3fff) + ((significand_msb & 0xf) << 14); + significand128.parts[1] = midh; + significand128.parts[2] = midl; + significand128.parts[3] = low; + if (significand128.parts[0] === 0 && + significand128.parts[1] === 0 && + significand128.parts[2] === 0 && + significand128.parts[3] === 0) { + is_zero = true; + } + else { + for (k = 3; k >= 0; k--) { + var least_digits = 0; + // Perform the divide + var result = divideu128(significand128); + significand128 = result.quotient; + least_digits = result.rem.low; + // We now have the 9 least significant digits (in base 2). + // Convert and output to string. + if (!least_digits) + continue; + for (j = 8; j >= 0; j--) { + // significand[k * 9 + j] = Math.round(least_digits % 10); + significand[k * 9 + j] = least_digits % 10; + // least_digits = Math.round(least_digits / 10); + least_digits = Math.floor(least_digits / 10); + } + } + } + // Output format options: + // Scientific - [-]d.dddE(+/-)dd or [-]dE(+/-)dd + // Regular - ddd.ddd + if (is_zero) { + significand_digits = 1; + significand[index] = 0; + } + else { + significand_digits = 36; + while (!significand[index]) { + significand_digits = significand_digits - 1; + index = index + 1; + } + } + // the exponent if scientific notation is used + var scientific_exponent = significand_digits - 1 + exponent; + // The scientific exponent checks are dictated by the string conversion + // specification and are somewhat arbitrary cutoffs. + // + // We must check exponent > 0, because if this is the case, the number + // has trailing zeros. However, we *cannot* output these trailing zeros, + // because doing so would change the precision of the value, and would + // change stored data if the string converted number is round tripped. + if (scientific_exponent >= 34 || scientific_exponent <= -7 || exponent > 0) { + // Scientific format + // if there are too many significant digits, we should just be treating numbers + // as + or - 0 and using the non-scientific exponent (this is for the "invalid + // representation should be treated as 0/-0" spec cases in decimal128-1.json) + if (significand_digits > 34) { + string.push("" + 0); + if (exponent > 0) + string.push('E+' + exponent); + else if (exponent < 0) + string.push('E' + exponent); + return string.join(''); + } + string.push("" + significand[index++]); + significand_digits = significand_digits - 1; + if (significand_digits) { + string.push('.'); + } + for (var i = 0; i < significand_digits; i++) { + string.push("" + significand[index++]); + } + // Exponent + string.push('E'); + if (scientific_exponent > 0) { + string.push('+' + scientific_exponent); + } + else { + string.push("" + scientific_exponent); + } + } + else { + // Regular format with no decimal place + if (exponent >= 0) { + for (var i = 0; i < significand_digits; i++) { + string.push("" + significand[index++]); + } + } + else { + var radix_position = significand_digits + exponent; + // non-zero digits before radix + if (radix_position > 0) { + for (var i = 0; i < radix_position; i++) { + string.push("" + significand[index++]); + } + } + else { + string.push('0'); + } + string.push('.'); + // add leading zeros after radix + while (radix_position++ < 0) { + string.push('0'); + } + for (var i = 0; i < significand_digits - Math.max(radix_position - 1, 0); i++) { + string.push("" + significand[index++]); + } + } + } + return string.join(''); + }; + Decimal128.prototype.toJSON = function () { + return { $numberDecimal: this.toString() }; + }; + /** @internal */ + Decimal128.prototype.toExtendedJSON = function () { + return { $numberDecimal: this.toString() }; + }; + /** @internal */ + Decimal128.fromExtendedJSON = function (doc) { + return Decimal128.fromString(doc.$numberDecimal); + }; + /** @internal */ + Decimal128.prototype[Symbol.for('nodejs.util.inspect.custom')] = function () { + return this.inspect(); + }; + Decimal128.prototype.inspect = function () { + return "new Decimal128(\"" + this.toString() + "\")"; + }; + return Decimal128; +}()); +exports.Decimal128 = Decimal128; +Object.defineProperty(Decimal128.prototype, '_bsontype', { value: 'Decimal128' }); +//# sourceMappingURL=decimal128.js.map \ No newline at end of file diff --git a/node_modules/bson/lib/decimal128.js.map b/node_modules/bson/lib/decimal128.js.map new file mode 100644 index 000000000..d56d5df39 --- /dev/null +++ b/node_modules/bson/lib/decimal128.js.map @@ -0,0 +1 @@ +{"version":3,"file":"decimal128.js","sourceRoot":"","sources":["../src/decimal128.ts"],"names":[],"mappings":";;;AAAA,iCAAgC;AAChC,iCAAwC;AACxC,+BAA8B;AAC9B,wCAA8C;AAE9C,IAAM,mBAAmB,GAAG,+CAA+C,CAAC;AAC5E,IAAM,gBAAgB,GAAG,0BAA0B,CAAC;AACpD,IAAM,gBAAgB,GAAG,eAAe,CAAC;AAEzC,IAAM,YAAY,GAAG,IAAI,CAAC;AAC1B,IAAM,YAAY,GAAG,CAAC,IAAI,CAAC;AAC3B,IAAM,aAAa,GAAG,IAAI,CAAC;AAC3B,IAAM,UAAU,GAAG,EAAE,CAAC;AAEtB,yDAAyD;AACzD,IAAM,UAAU,GAAG;IACjB,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI;CAC/F,CAAC,OAAO,EAAE,CAAC;AACZ,2DAA2D;AAC3D,IAAM,mBAAmB,GAAG;IAC1B,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI;CAC/F,CAAC,OAAO,EAAE,CAAC;AACZ,IAAM,mBAAmB,GAAG;IAC1B,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE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;oBAC3B,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;iBAClB;gBAED,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,kBAAkB,GAAG,IAAI,CAAC,GAAG,CAAC,cAAc,GAAG,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE;oBAC7E,MAAM,CAAC,IAAI,CAAC,KAAG,WAAW,CAAC,KAAK,EAAE,CAAG,CAAC,CAAC;iBACxC;aACF;SACF;QAED,OAAO,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACzB,CAAC;IAED,2BAAM,GAAN;QACE,OAAO,EAAE,cAAc,EAAE,IAAI,CAAC,QAAQ,EAAE,EAAE,CAAC;IAC7C,CAAC;IAED,gBAAgB;IAChB,mCAAc,GAAd;QACE,OAAO,EAAE,cAAc,EAAE,IAAI,CAAC,QAAQ,EAAE,EAAE,CAAC;IAC7C,CAAC;IAED,gBAAgB;IACT,2BAAgB,GAAvB,UAAwB,GAAuB;QAC7C,OAAO,UAAU,CAAC,UAAU,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;IACnD,CAAC;IAED,gBAAgB;IAChB,qBAAC,MAAM,CAAC,GAAG,CAAC,4BAA4B,CAAC,CAAC,GAA1C;QACE,OAAO,IAAI,CAAC,OAAO,EAAE,CAAC;IACxB,CAAC;IAED,4BAAO,GAAP;QACE,OAAO,sBAAmB,IAAI,CAAC,QAAQ,EAAE,QAAI,CAAC;IAChD,CAAC;IACH,iBAAC;AAAD,CAAC,AAxoBD,IAwoBC;AAxoBY,gCAAU;AA0oBvB,MAAM,CAAC,cAAc,CAAC,UAAU,CAAC,SAAS,EAAE,WAAW,EAAE,EAAE,KAAK,EAAE,YAAY,EAAE,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/bson/lib/double.js b/node_modules/bson/lib/double.js new file mode 100644 index 000000000..5cfe26b00 --- /dev/null +++ b/node_modules/bson/lib/double.js @@ -0,0 +1,76 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Double = void 0; +/** + * A class representation of the BSON Double type. + * @public + * @category BSONType + */ +var Double = /** @class */ (function () { + /** + * Create a Double type + * + * @param value - the number we want to represent as a double. + */ + function Double(value) { + if (!(this instanceof Double)) + return new Double(value); + if (value instanceof Number) { + value = value.valueOf(); + } + this.value = +value; + } + /** + * Access the number value. + * + * @returns returns the wrapped double number. + */ + Double.prototype.valueOf = function () { + return this.value; + }; + Double.prototype.toJSON = function () { + return this.value; + }; + Double.prototype.toString = function (radix) { + return this.value.toString(radix); + }; + /** @internal */ + Double.prototype.toExtendedJSON = function (options) { + if (options && (options.legacy || (options.relaxed && isFinite(this.value)))) { + return this.value; + } + // NOTE: JavaScript has +0 and -0, apparently to model limit calculations. If a user + // explicitly provided `-0` then we need to ensure the sign makes it into the output + if (Object.is(Math.sign(this.value), -0)) { + return { $numberDouble: "-" + this.value.toFixed(1) }; + } + var $numberDouble; + if (Number.isInteger(this.value)) { + $numberDouble = this.value.toFixed(1); + if ($numberDouble.length >= 13) { + $numberDouble = this.value.toExponential(13).toUpperCase(); + } + } + else { + $numberDouble = this.value.toString(); + } + return { $numberDouble: $numberDouble }; + }; + /** @internal */ + Double.fromExtendedJSON = function (doc, options) { + var doubleValue = parseFloat(doc.$numberDouble); + return options && options.relaxed ? doubleValue : new Double(doubleValue); + }; + /** @internal */ + Double.prototype[Symbol.for('nodejs.util.inspect.custom')] = function () { + return this.inspect(); + }; + Double.prototype.inspect = function () { + var eJSON = this.toExtendedJSON(); + return "new Double(" + eJSON.$numberDouble + ")"; + }; + return Double; +}()); +exports.Double = Double; +Object.defineProperty(Double.prototype, '_bsontype', { value: 'Double' }); +//# sourceMappingURL=double.js.map \ No newline at end of file diff --git a/node_modules/bson/lib/double.js.map b/node_modules/bson/lib/double.js.map new file mode 100644 index 000000000..3db5f55fa --- /dev/null +++ b/node_modules/bson/lib/double.js.map @@ -0,0 +1 @@ +{"version":3,"file":"double.js","sourceRoot":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IAAI,aAAa,CAAC,MAAM,IAAI,EAAE,EAAE;gBAC9B,aAAa,GAAG,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC;aAC5D;SACF;aAAM;YACL,aAAa,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC;SACvC;QAED,OAAO,EAAE,aAAa,eAAA,EAAE,CAAC;IAC3B,CAAC;IAED,gBAAgB;IACT,uBAAgB,GAAvB,UAAwB,GAAmB,EAAE,OAAsB;QACjE,IAAM,WAAW,GAAG,UAAU,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;QAClD,OAAO,OAAO,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,MAAM,CAAC,WAAW,CAAC,CAAC;IAC5E,CAAC;IAED,gBAAgB;IAChB,iBAAC,MAAM,CAAC,GAAG,CAAC,4BAA4B,CAAC,CAAC,GAA1C;QACE,OAAO,IAAI,CAAC,OAAO,EAAE,CAAC;IACxB,CAAC;IAED,wBAAO,GAAP;QACE,IAAM,KAAK,GAAG,IAAI,CAAC,cAAc,EAAoB,CAAC;QACtD,OAAO,gBAAc,KAAK,CAAC,aAAa,MAAG,CAAC;IAC9C,CAAC;IACH,aAAC;AAAD,CAAC,AA5ED,IA4EC;AA5EY,wBAAM;AA8EnB,MAAM,CAAC,cAAc,CAAC,MAAM,CAAC,SAAS,EAAE,WAAW,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/bson/lib/ensure_buffer.js b/node_modules/bson/lib/ensure_buffer.js new file mode 100644 index 000000000..f417fe2dd --- /dev/null +++ b/node_modules/bson/lib/ensure_buffer.js @@ -0,0 +1,25 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ensureBuffer = void 0; +var buffer_1 = require("buffer"); +var error_1 = require("./error"); +var utils_1 = require("./parser/utils"); +/** + * Makes sure that, if a Uint8Array is passed in, it is wrapped in a Buffer. + * + * @param potentialBuffer - The potential buffer + * @returns Buffer the input if potentialBuffer is a buffer, or a buffer that + * wraps a passed in Uint8Array + * @throws BSONTypeError If anything other than a Buffer or Uint8Array is passed in + */ +function ensureBuffer(potentialBuffer) { + if (ArrayBuffer.isView(potentialBuffer)) { + return buffer_1.Buffer.from(potentialBuffer.buffer, potentialBuffer.byteOffset, potentialBuffer.byteLength); + } + if (utils_1.isAnyArrayBuffer(potentialBuffer)) { + return buffer_1.Buffer.from(potentialBuffer); + } + throw new error_1.BSONTypeError('Must use either Buffer or TypedArray'); +} +exports.ensureBuffer = ensureBuffer; +//# sourceMappingURL=ensure_buffer.js.map \ No newline at end of file diff --git a/node_modules/bson/lib/ensure_buffer.js.map b/node_modules/bson/lib/ensure_buffer.js.map new file mode 100644 index 000000000..82bcfd341 --- /dev/null +++ b/node_modules/bson/lib/ensure_buffer.js.map @@ -0,0 +1 @@ +{"version":3,"file":"ensure_buffer.js","sourceRoot":"","sources":["../src/ensure_buffer.ts"],"names":[],"mappings":";;;AAAA,iCAAgC;AAChC,iCAAwC;AACxC,wCAAkD;AAElD;;;;;;;GAOG;AACH,SAAgB,YAAY,CAAC,eAAuD;IAClF,IAAI,WAAW,CAAC,MAAM,CAAC,eAAe,CAAC,EAAE;QACvC,OAAO,eAAM,CAAC,IAAI,CAChB,eAAe,CAAC,MAAM,EACtB,eAAe,CAAC,UAAU,EAC1B,eAAe,CAAC,UAAU,CAC3B,CAAC;KACH;IAED,IAAI,wBAAgB,CAAC,eAAe,CAAC,EAAE;QACrC,OAAO,eAAM,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;KACrC;IAED,MAAM,IAAI,qBAAa,CAAC,sCAAsC,CAAC,CAAC;AAClE,CAAC;AAdD,oCAcC"} \ No newline at end of file diff --git a/node_modules/bson/lib/error.js b/node_modules/bson/lib/error.js new file mode 100644 index 000000000..035ce86f1 --- /dev/null +++ b/node_modules/bson/lib/error.js @@ -0,0 +1,55 @@ +"use strict"; +var __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +exports.BSONTypeError = exports.BSONError = void 0; +/** @public */ +var BSONError = /** @class */ (function (_super) { + __extends(BSONError, _super); + function BSONError(message) { + var _this = _super.call(this, message) || this; + Object.setPrototypeOf(_this, BSONError.prototype); + return _this; + } + Object.defineProperty(BSONError.prototype, "name", { + get: function () { + return 'BSONError'; + }, + enumerable: false, + configurable: true + }); + return BSONError; +}(Error)); +exports.BSONError = BSONError; +/** @public */ +var BSONTypeError = /** @class */ (function (_super) { + __extends(BSONTypeError, _super); + function BSONTypeError(message) { + var _this = _super.call(this, message) || this; + Object.setPrototypeOf(_this, BSONTypeError.prototype); + return _this; + } + Object.defineProperty(BSONTypeError.prototype, "name", { + get: function () { + return 'BSONTypeError'; + }, + enumerable: false, + configurable: true + }); + return BSONTypeError; +}(TypeError)); +exports.BSONTypeError = BSONTypeError; +//# sourceMappingURL=error.js.map \ No newline at end of file diff --git a/node_modules/bson/lib/error.js.map b/node_modules/bson/lib/error.js.map new file mode 100644 index 000000000..2acd4ef3f --- /dev/null +++ b/node_modules/bson/lib/error.js.map @@ -0,0 +1 @@ +{"version":3,"file":"error.js","sourceRoot":"","sources":["../src/error.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,cAAc;AACd;IAA+B,6BAAK;IAClC,mBAAY,OAAe;QAA3B,YACE,kBAAM,OAAO,CAAC,SAEf;QADC,MAAM,CAAC,cAAc,CAAC,KAAI,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;;IACnD,CAAC;IAED,sBAAI,2BAAI;aAAR;YACE,OAAO,WAAW,CAAC;QACrB,CAAC;;;OAAA;IACH,gBAAC;AAAD,CAAC,AATD,CAA+B,KAAK,GASnC;AATY,8BAAS;AAWtB,cAAc;AACd;IAAmC,iCAAS;IAC1C,uBAAY,OAAe;QAA3B,YACE,kBAAM,OAAO,CAAC,SAEf;QADC,MAAM,CAAC,cAAc,CAAC,KAAI,EAAE,aAAa,CAAC,SAAS,CAAC,CAAC;;IACvD,CAAC;IAED,sBAAI,+BAAI;aAAR;YACE,OAAO,eAAe,CAAC;QACzB,CAAC;;;OAAA;IACH,oBAAC;AAAD,CAAC,AATD,CAAmC,SAAS,GAS3C;AATY,sCAAa"} \ No newline at end of file diff --git a/node_modules/bson/lib/extended_json.js b/node_modules/bson/lib/extended_json.js new file mode 100644 index 000000000..cf489f2e0 --- /dev/null +++ b/node_modules/bson/lib/extended_json.js @@ -0,0 +1,378 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.EJSON = exports.isBSONType = void 0; +var binary_1 = require("./binary"); +var code_1 = require("./code"); +var db_ref_1 = require("./db_ref"); +var decimal128_1 = require("./decimal128"); +var double_1 = require("./double"); +var error_1 = require("./error"); +var int_32_1 = require("./int_32"); +var long_1 = require("./long"); +var max_key_1 = require("./max_key"); +var min_key_1 = require("./min_key"); +var objectid_1 = require("./objectid"); +var utils_1 = require("./parser/utils"); +var regexp_1 = require("./regexp"); +var symbol_1 = require("./symbol"); +var timestamp_1 = require("./timestamp"); +function isBSONType(value) { + return (utils_1.isObjectLike(value) && Reflect.has(value, '_bsontype') && typeof value._bsontype === 'string'); +} +exports.isBSONType = isBSONType; +// INT32 boundaries +var BSON_INT32_MAX = 0x7fffffff; +var BSON_INT32_MIN = -0x80000000; +// INT64 boundaries +var BSON_INT64_MAX = 0x7fffffffffffffff; +var BSON_INT64_MIN = -0x8000000000000000; +// all the types where we don't need to do any special processing and can just pass the EJSON +//straight to type.fromExtendedJSON +var keysToCodecs = { + $oid: objectid_1.ObjectId, + $binary: binary_1.Binary, + $uuid: binary_1.Binary, + $symbol: symbol_1.BSONSymbol, + $numberInt: int_32_1.Int32, + $numberDecimal: decimal128_1.Decimal128, + $numberDouble: double_1.Double, + $numberLong: long_1.Long, + $minKey: min_key_1.MinKey, + $maxKey: max_key_1.MaxKey, + $regex: regexp_1.BSONRegExp, + $regularExpression: regexp_1.BSONRegExp, + $timestamp: timestamp_1.Timestamp +}; +// eslint-disable-next-line @typescript-eslint/no-explicit-any +function deserializeValue(value, options) { + if (options === void 0) { options = {}; } + if (typeof value === 'number') { + if (options.relaxed || options.legacy) { + return value; + } + // if it's an integer, should interpret as smallest BSON integer + // that can represent it exactly. (if out of range, interpret as double.) + if (Math.floor(value) === value) { + if (value >= BSON_INT32_MIN && value <= BSON_INT32_MAX) + return new int_32_1.Int32(value); + if (value >= BSON_INT64_MIN && value <= BSON_INT64_MAX) + return long_1.Long.fromNumber(value); + } + // If the number is a non-integer or out of integer range, should interpret as BSON Double. + return new double_1.Double(value); + } + // from here on out we're looking for bson types, so bail if its not an object + if (value == null || typeof value !== 'object') + return value; + // upgrade deprecated undefined to null + if (value.$undefined) + return null; + var keys = Object.keys(value).filter(function (k) { return k.startsWith('$') && value[k] != null; }); + for (var i = 0; i < keys.length; i++) { + var c = keysToCodecs[keys[i]]; + if (c) + return c.fromExtendedJSON(value, options); + } + if (value.$date != null) { + var d = value.$date; + var date = new Date(); + if (options.legacy) { + if (typeof d === 'number') + date.setTime(d); + else if (typeof d === 'string') + date.setTime(Date.parse(d)); + } + else { + if (typeof d === 'string') + date.setTime(Date.parse(d)); + else if (long_1.Long.isLong(d)) + date.setTime(d.toNumber()); + else if (typeof d === 'number' && options.relaxed) + date.setTime(d); + } + return date; + } + if (value.$code != null) { + var copy = Object.assign({}, value); + if (value.$scope) { + copy.$scope = deserializeValue(value.$scope); + } + return code_1.Code.fromExtendedJSON(value); + } + if (db_ref_1.isDBRefLike(value) || value.$dbPointer) { + var v = value.$ref ? value : value.$dbPointer; + // we run into this in a "degenerate EJSON" case (with $id and $ref order flipped) + // because of the order JSON.parse goes through the document + if (v instanceof db_ref_1.DBRef) + return v; + var dollarKeys = Object.keys(v).filter(function (k) { return k.startsWith('$'); }); + var valid_1 = true; + dollarKeys.forEach(function (k) { + if (['$ref', '$id', '$db'].indexOf(k) === -1) + valid_1 = false; + }); + // only make DBRef if $ keys are all valid + if (valid_1) + return db_ref_1.DBRef.fromExtendedJSON(v); + } + return value; +} +// eslint-disable-next-line @typescript-eslint/no-explicit-any +function serializeArray(array, options) { + return array.map(function (v, index) { + options.seenObjects.push({ propertyName: "index " + index, obj: null }); + try { + return serializeValue(v, options); + } + finally { + options.seenObjects.pop(); + } + }); +} +function getISOString(date) { + var isoStr = date.toISOString(); + // we should only show milliseconds in timestamp if they're non-zero + return date.getUTCMilliseconds() !== 0 ? isoStr : isoStr.slice(0, -5) + 'Z'; +} +// eslint-disable-next-line @typescript-eslint/no-explicit-any +function serializeValue(value, options) { + if ((typeof value === 'object' || typeof value === 'function') && value !== null) { + var index = options.seenObjects.findIndex(function (entry) { return entry.obj === value; }); + if (index !== -1) { + var props = options.seenObjects.map(function (entry) { return entry.propertyName; }); + var leadingPart = props + .slice(0, index) + .map(function (prop) { return prop + " -> "; }) + .join(''); + var alreadySeen = props[index]; + var circularPart = ' -> ' + + props + .slice(index + 1, props.length - 1) + .map(function (prop) { return prop + " -> "; }) + .join(''); + var current = props[props.length - 1]; + var leadingSpace = ' '.repeat(leadingPart.length + alreadySeen.length / 2); + var dashes = '-'.repeat(circularPart.length + (alreadySeen.length + current.length) / 2 - 1); + throw new error_1.BSONTypeError('Converting circular structure to EJSON:\n' + + (" " + leadingPart + alreadySeen + circularPart + current + "\n") + + (" " + leadingSpace + "\\" + dashes + "/")); + } + options.seenObjects[options.seenObjects.length - 1].obj = value; + } + if (Array.isArray(value)) + return serializeArray(value, options); + if (value === undefined) + return null; + if (value instanceof Date || utils_1.isDate(value)) { + var dateNum = value.getTime(), + // is it in year range 1970-9999? + inRange = dateNum > -1 && dateNum < 253402318800000; + if (options.legacy) { + return options.relaxed && inRange + ? { $date: value.getTime() } + : { $date: getISOString(value) }; + } + return options.relaxed && inRange + ? { $date: getISOString(value) } + : { $date: { $numberLong: value.getTime().toString() } }; + } + if (typeof value === 'number' && (!options.relaxed || !isFinite(value))) { + // it's an integer + if (Math.floor(value) === value) { + var int32Range = value >= BSON_INT32_MIN && value <= BSON_INT32_MAX, int64Range = value >= BSON_INT64_MIN && value <= BSON_INT64_MAX; + // interpret as being of the smallest BSON integer type that can represent the number exactly + if (int32Range) + return { $numberInt: value.toString() }; + if (int64Range) + return { $numberLong: value.toString() }; + } + return { $numberDouble: value.toString() }; + } + if (value instanceof RegExp || utils_1.isRegExp(value)) { + var flags = value.flags; + if (flags === undefined) { + var match = value.toString().match(/[gimuy]*$/); + if (match) { + flags = match[0]; + } + } + var rx = new regexp_1.BSONRegExp(value.source, flags); + return rx.toExtendedJSON(options); + } + if (value != null && typeof value === 'object') + return serializeDocument(value, options); + return value; +} +var BSON_TYPE_MAPPINGS = { + Binary: function (o) { return new binary_1.Binary(o.value(), o.sub_type); }, + Code: function (o) { return new code_1.Code(o.code, o.scope); }, + DBRef: function (o) { return new db_ref_1.DBRef(o.collection || o.namespace, o.oid, o.db, o.fields); }, + Decimal128: function (o) { return new decimal128_1.Decimal128(o.bytes); }, + Double: function (o) { return new double_1.Double(o.value); }, + Int32: function (o) { return new int_32_1.Int32(o.value); }, + Long: function (o) { + return long_1.Long.fromBits( + // underscore variants for 1.x backwards compatibility + o.low != null ? o.low : o.low_, o.low != null ? o.high : o.high_, o.low != null ? o.unsigned : o.unsigned_); + }, + MaxKey: function () { return new max_key_1.MaxKey(); }, + MinKey: function () { return new min_key_1.MinKey(); }, + ObjectID: function (o) { return new objectid_1.ObjectId(o); }, + ObjectId: function (o) { return new objectid_1.ObjectId(o); }, + BSONRegExp: function (o) { return new regexp_1.BSONRegExp(o.pattern, o.options); }, + Symbol: function (o) { return new symbol_1.BSONSymbol(o.value); }, + Timestamp: function (o) { return timestamp_1.Timestamp.fromBits(o.low, o.high); } +}; +// eslint-disable-next-line @typescript-eslint/no-explicit-any +function serializeDocument(doc, options) { + if (doc == null || typeof doc !== 'object') + throw new error_1.BSONError('not an object instance'); + var bsontype = doc._bsontype; + if (typeof bsontype === 'undefined') { + // It's a regular object. Recursively serialize its property values. + var _doc = {}; + for (var name in doc) { + options.seenObjects.push({ propertyName: name, obj: null }); + try { + _doc[name] = serializeValue(doc[name], options); + } + finally { + options.seenObjects.pop(); + } + } + return _doc; + } + else if (isBSONType(doc)) { + // the "document" is really just a BSON type object + // eslint-disable-next-line @typescript-eslint/no-explicit-any + var outDoc = doc; + if (typeof outDoc.toExtendedJSON !== 'function') { + // There's no EJSON serialization function on the object. It's probably an + // object created by a previous version of this library (or another library) + // that's duck-typing objects to look like they were generated by this library). + // Copy the object into this library's version of that type. + var mapper = BSON_TYPE_MAPPINGS[doc._bsontype]; + if (!mapper) { + throw new error_1.BSONTypeError('Unrecognized or invalid _bsontype: ' + doc._bsontype); + } + outDoc = mapper(outDoc); + } + // Two BSON types may have nested objects that may need to be serialized too + if (bsontype === 'Code' && outDoc.scope) { + outDoc = new code_1.Code(outDoc.code, serializeValue(outDoc.scope, options)); + } + else if (bsontype === 'DBRef' && outDoc.oid) { + outDoc = new db_ref_1.DBRef(serializeValue(outDoc.collection, options), serializeValue(outDoc.oid, options), serializeValue(outDoc.db, options), serializeValue(outDoc.fields, options)); + } + return outDoc.toExtendedJSON(options); + } + else { + throw new error_1.BSONError('_bsontype must be a string, but was: ' + typeof bsontype); + } +} +/** + * EJSON parse / stringify API + * @public + */ +// the namespace here is used to emulate `export * as EJSON from '...'` +// which as of now (sept 2020) api-extractor does not support +// eslint-disable-next-line @typescript-eslint/no-namespace +var EJSON; +(function (EJSON) { + /** + * Parse an Extended JSON string, constructing the JavaScript value or object described by that + * string. + * + * @example + * ```js + * const { EJSON } = require('bson'); + * const text = '{ "int32": { "$numberInt": "10" } }'; + * + * // prints { int32: { [String: '10'] _bsontype: 'Int32', value: '10' } } + * console.log(EJSON.parse(text, { relaxed: false })); + * + * // prints { int32: 10 } + * console.log(EJSON.parse(text)); + * ``` + */ + function parse(text, options) { + var finalOptions = Object.assign({}, { relaxed: true, legacy: false }, options); + // relaxed implies not strict + if (typeof finalOptions.relaxed === 'boolean') + finalOptions.strict = !finalOptions.relaxed; + if (typeof finalOptions.strict === 'boolean') + finalOptions.relaxed = !finalOptions.strict; + return JSON.parse(text, function (key, value) { + if (key.indexOf('\x00') !== -1) { + throw new error_1.BSONError("BSON Document field names cannot contain null bytes, found: " + JSON.stringify(key)); + } + return deserializeValue(value, finalOptions); + }); + } + EJSON.parse = parse; + /** + * Converts a BSON document to an Extended JSON string, optionally replacing values if a replacer + * function is specified or optionally including only the specified properties if a replacer array + * is specified. + * + * @param value - The value to convert to extended JSON + * @param replacer - A function that alters the behavior of the stringification process, or an array of String and Number objects that serve as a whitelist for selecting/filtering the properties of the value object to be included in the JSON string. If this value is null or not provided, all properties of the object are included in the resulting JSON string + * @param space - A String or Number object that's used to insert white space into the output JSON string for readability purposes. + * @param options - Optional settings + * + * @example + * ```js + * const { EJSON } = require('bson'); + * const Int32 = require('mongodb').Int32; + * const doc = { int32: new Int32(10) }; + * + * // prints '{"int32":{"$numberInt":"10"}}' + * console.log(EJSON.stringify(doc, { relaxed: false })); + * + * // prints '{"int32":10}' + * console.log(EJSON.stringify(doc)); + * ``` + */ + function stringify(value, + // eslint-disable-next-line @typescript-eslint/no-explicit-any + replacer, space, options) { + if (space != null && typeof space === 'object') { + options = space; + space = 0; + } + if (replacer != null && typeof replacer === 'object' && !Array.isArray(replacer)) { + options = replacer; + replacer = undefined; + space = 0; + } + var serializeOptions = Object.assign({ relaxed: true, legacy: false }, options, { + seenObjects: [{ propertyName: '(root)', obj: null }] + }); + var doc = serializeValue(value, serializeOptions); + return JSON.stringify(doc, replacer, space); + } + EJSON.stringify = stringify; + /** + * Serializes an object to an Extended JSON string, and reparse it as a JavaScript object. + * + * @param value - The object to serialize + * @param options - Optional settings passed to the `stringify` function + */ + function serialize(value, options) { + options = options || {}; + return JSON.parse(stringify(value, options)); + } + EJSON.serialize = serialize; + /** + * Deserializes an Extended JSON object into a plain JavaScript object with native/BSON types + * + * @param ejson - The Extended JSON object to deserialize + * @param options - Optional settings passed to the parse method + */ + function deserialize(ejson, options) { + options = options || {}; + return parse(JSON.stringify(ejson), options); + } + EJSON.deserialize = deserialize; +})(EJSON = exports.EJSON || (exports.EJSON = {})); +//# sourceMappingURL=extended_json.js.map \ No newline at end of file diff --git a/node_modules/bson/lib/extended_json.js.map b/node_modules/bson/lib/extended_json.js.map new file mode 100644 index 000000000..ae3a2cc11 --- /dev/null +++ b/node_modules/bson/lib/extended_json.js.map @@ -0,0 +1 @@ +{"version":3,"file":"extended_json.js","sourceRoot":"","sources":["../src/extended_json.ts"],"names":[],"mappings":";;;AAAA,mCAAkC;AAElC,+BAA8B;AAC9B,mCAA8C;AAC9C,2CAA0C;AAC1C,mCAAkC;AAClC,iCAAmD;AACnD,mCAAiC;AACjC,+BAA8B;AAC9B,qCAAmC;AACnC,qCAAmC;AACnC,uCAAsC;AACtC,wCAAgE;AAChE,mCAAsC;AACtC,mCAAsC;AACtC,yCAAwC;AAqBxC,SAAgB,UAAU,CAAC,KAAc;IACvC,OAAO,CACL,oBAAY,CAAC,KAAK,CAAC,IAAI,OAAO,CAAC,GAAG,CAAC,KAAK,EAAE,WAAW,CAAC,IAAI,OAAO,KAAK,CAAC,SAAS,KAAK,QAAQ,CAC9F,CAAC;AACJ,CAAC;AAJD,gCAIC;AAED,mBAAmB;AACnB,IAAM,cAAc,GAAG,UAAU,CAAC;AAClC,IAAM,cAAc,GAAG,CAAC,UAAU,CAAC;AACnC,mBAAmB;AACnB,IAAM,c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;IAC/C,CAAC;IAHe,eAAS,YAGxB,CAAA;IAED;;;;;OAKG;IACH,SAAgB,WAAW,CAAC,KAAe,EAAE,OAAuB;QAClE,OAAO,GAAG,OAAO,IAAI,EAAE,CAAC;QACxB,OAAO,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC,CAAC;IAC/C,CAAC;IAHe,iBAAW,cAG1B,CAAA;AACH,CAAC,EArHgB,KAAK,GAAL,aAAK,KAAL,aAAK,QAqHrB"} \ No newline at end of file diff --git a/node_modules/bson/lib/float_parser.js b/node_modules/bson/lib/float_parser.js new file mode 100644 index 000000000..f78a3a03f --- /dev/null +++ b/node_modules/bson/lib/float_parser.js @@ -0,0 +1,137 @@ +"use strict"; +// Copyright (c) 2008, Fair Oaks Labs, Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// +// * Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// +// * Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// * Neither the name of Fair Oaks Labs, Inc. nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// +// +// Modifications to writeIEEE754 to support negative zeroes made by Brian White +Object.defineProperty(exports, "__esModule", { value: true }); +exports.writeIEEE754 = exports.readIEEE754 = void 0; +function readIEEE754(buffer, offset, endian, mLen, nBytes) { + var e; + var m; + var bBE = endian === 'big'; + var eLen = nBytes * 8 - mLen - 1; + var eMax = (1 << eLen) - 1; + var eBias = eMax >> 1; + var nBits = -7; + var i = bBE ? 0 : nBytes - 1; + var d = bBE ? 1 : -1; + var s = buffer[offset + i]; + i += d; + e = s & ((1 << -nBits) - 1); + s >>= -nBits; + nBits += eLen; + for (; nBits > 0; e = e * 256 + buffer[offset + i], i += d, nBits -= 8) + ; + m = e & ((1 << -nBits) - 1); + e >>= -nBits; + nBits += mLen; + for (; nBits > 0; m = m * 256 + buffer[offset + i], i += d, nBits -= 8) + ; + if (e === 0) { + e = 1 - eBias; + } + else if (e === eMax) { + return m ? NaN : (s ? -1 : 1) * Infinity; + } + else { + m = m + Math.pow(2, mLen); + e = e - eBias; + } + return (s ? -1 : 1) * m * Math.pow(2, e - mLen); +} +exports.readIEEE754 = readIEEE754; +function writeIEEE754(buffer, value, offset, endian, mLen, nBytes) { + var e; + var m; + var c; + var bBE = endian === 'big'; + var eLen = nBytes * 8 - mLen - 1; + var eMax = (1 << eLen) - 1; + var eBias = eMax >> 1; + var rt = mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0; + var i = bBE ? nBytes - 1 : 0; + var d = bBE ? -1 : 1; + var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0; + value = Math.abs(value); + if (isNaN(value) || value === Infinity) { + m = isNaN(value) ? 1 : 0; + e = eMax; + } + else { + e = Math.floor(Math.log(value) / Math.LN2); + if (value * (c = Math.pow(2, -e)) < 1) { + e--; + c *= 2; + } + if (e + eBias >= 1) { + value += rt / c; + } + else { + value += rt * Math.pow(2, 1 - eBias); + } + if (value * c >= 2) { + e++; + c /= 2; + } + if (e + eBias >= eMax) { + m = 0; + e = eMax; + } + else if (e + eBias >= 1) { + m = (value * c - 1) * Math.pow(2, mLen); + e = e + eBias; + } + else { + m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen); + e = 0; + } + } + if (isNaN(value)) + m = 0; + while (mLen >= 8) { + buffer[offset + i] = m & 0xff; + i += d; + m /= 256; + mLen -= 8; + } + e = (e << mLen) | m; + if (isNaN(value)) + e += 8; + eLen += mLen; + while (eLen > 0) { + buffer[offset + i] = e & 0xff; + i += d; + e /= 256; + eLen -= 8; + } + buffer[offset + i - d] |= s * 128; +} +exports.writeIEEE754 = writeIEEE754; +//# sourceMappingURL=float_parser.js.map \ No newline at end of file diff --git a/node_modules/bson/lib/float_parser.js.map b/node_modules/bson/lib/float_parser.js.map new file mode 100644 index 000000000..5b6884336 --- /dev/null +++ b/node_modules/bson/lib/float_parser.js.map @@ -0,0 +1 @@ +{"version":3,"file":"float_parser.js","sourceRoot":"","sources":["../src/float_parser.ts"],"names":[],"mappings":";AAAA,2CAA2C;AAC3C,uBAAuB;AACvB,EAAE;AACF,qEAAqE;AACrE,8EAA8E;AAC9E,EAAE;AACF,4EAA4E;AAC5E,2DAA2D;AAC3D,EAAE;AACF,+EAA+E;AAC/E,+EAA+E;AAC/E,4DAA4D;AAC5D,EAAE;AACF,gFAAgF;AAChF,2EAA2E;AAC3E,gDAAgD;AAChD,EAAE;AACF,8EAA8E;AAC9E,4EAA4E;AAC5E,6EAA6E;AAC7E,4EAA4E;AAC5E,sEAAsE;AACtE,uEAAuE;AACvE,2EAA2E;AAC3E,0EAA0E;AAC1E,0EAA0E;AAC1E,6EAA6E;AAC7E,8BAA8B;AAC9B,EAAE;AACF,EAAE;AACF,+EAA+E;;;AAI/E,SAA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AAC;KACX;IAED,MAAM,CAAC,MAAM,GAAG,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,GAAG,CAAC;AACpC,CAAC;AA5ED,oCA4EC"} \ No newline at end of file diff --git a/node_modules/bson/lib/int_32.js b/node_modules/bson/lib/int_32.js new file mode 100644 index 000000000..b24655f8a --- /dev/null +++ b/node_modules/bson/lib/int_32.js @@ -0,0 +1,58 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Int32 = void 0; +/** + * A class representation of a BSON Int32 type. + * @public + * @category BSONType + */ +var Int32 = /** @class */ (function () { + /** + * Create an Int32 type + * + * @param value - the number we want to represent as an int32. + */ + function Int32(value) { + if (!(this instanceof Int32)) + return new Int32(value); + if (value instanceof Number) { + value = value.valueOf(); + } + this.value = +value | 0; + } + /** + * Access the number value. + * + * @returns returns the wrapped int32 number. + */ + Int32.prototype.valueOf = function () { + return this.value; + }; + Int32.prototype.toString = function (radix) { + return this.value.toString(radix); + }; + Int32.prototype.toJSON = function () { + return this.value; + }; + /** @internal */ + Int32.prototype.toExtendedJSON = function (options) { + if (options && (options.relaxed || options.legacy)) + return this.value; + return { $numberInt: this.value.toString() }; + }; + /** @internal */ + Int32.fromExtendedJSON = function (doc, options) { + return options && options.relaxed ? parseInt(doc.$numberInt, 10) : new Int32(doc.$numberInt); + }; + /** @internal */ + Int32.prototype[Symbol.for('nodejs.util.inspect.custom')] = function () { + return this.inspect(); + }; + Int32.prototype.inspect = function () { + return "new Int32(" + this.valueOf() + ")"; + }; + return Int32; +}()); +exports.Int32 = Int32; +Object.defineProperty(Int32.prototype, '_bsontype', { value: 'Int32' }); +//# sourceMappingURL=int_32.js.map \ No newline at end of file diff --git a/node_modules/bson/lib/int_32.js.map b/node_modules/bson/lib/int_32.js.map new file mode 100644 index 000000000..40e2d7dbe --- /dev/null +++ b/node_modules/bson/lib/int_32.js.map @@ -0,0 +1 @@ +{"version":3,"file":"int_32.js","sourceRoot":"","sources":["../src/int_32.ts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O,GAAP;QACE,OAAO,eAAa,IAAI,CAAC,OAAO,EAAE,MAAG,CAAC;IACxC,CAAC;IACH,YAAC;AAAD,CAAC,AAvDD,IAuDC;AAvDY,sBAAK;AAyDlB,MAAM,CAAC,cAAc,CAAC,KAAK,CAAC,SAAS,EAAE,WAAW,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/bson/lib/long.js b/node_modules/bson/lib/long.js new file mode 100644 index 000000000..4ba41624e --- /dev/null +++ b/node_modules/bson/lib/long.js @@ -0,0 +1,900 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Long = void 0; +var utils_1 = require("./parser/utils"); +/** + * wasm optimizations, to do native i64 multiplication and divide + */ +var wasm = undefined; +try { + wasm = new WebAssembly.Instance(new WebAssembly.Module( + // prettier-ignore + new Uint8Array([0, 97, 115, 109, 1, 0, 0, 0, 1, 13, 2, 96, 0, 1, 127, 96, 4, 127, 127, 127, 127, 1, 127, 3, 7, 6, 0, 1, 1, 1, 1, 1, 6, 6, 1, 127, 1, 65, 0, 11, 7, 50, 6, 3, 109, 117, 108, 0, 1, 5, 100, 105, 118, 95, 115, 0, 2, 5, 100, 105, 118, 95, 117, 0, 3, 5, 114, 101, 109, 95, 115, 0, 4, 5, 114, 101, 109, 95, 117, 0, 5, 8, 103, 101, 116, 95, 104, 105, 103, 104, 0, 0, 10, 191, 1, 6, 4, 0, 35, 0, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 126, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 127, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 128, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 129, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 130, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11])), {}).exports; +} +catch (_a) { + // no wasm support +} +var TWO_PWR_16_DBL = 1 << 16; +var TWO_PWR_24_DBL = 1 << 24; +var TWO_PWR_32_DBL = TWO_PWR_16_DBL * TWO_PWR_16_DBL; +var TWO_PWR_64_DBL = TWO_PWR_32_DBL * TWO_PWR_32_DBL; +var TWO_PWR_63_DBL = TWO_PWR_64_DBL / 2; +/** A cache of the Long representations of small integer values. */ +var INT_CACHE = {}; +/** A cache of the Long representations of small unsigned integer values. */ +var UINT_CACHE = {}; +/** + * A class representing a 64-bit integer + * @public + * @category BSONType + * @remarks + * The internal representation of a long is the two given signed, 32-bit values. + * We use 32-bit pieces because these are the size of integers on which + * Javascript performs bit-operations. For operations like addition and + * multiplication, we split each number into 16 bit pieces, which can easily be + * multiplied within Javascript's floating-point representation without overflow + * or change in sign. + * In the algorithms below, we frequently reduce the negative case to the + * positive case by negating the input(s) and then post-processing the result. + * Note that we must ALWAYS check specially whether those values are MIN_VALUE + * (-2^63) because -MIN_VALUE == MIN_VALUE (since 2^63 cannot be represented as + * a positive number, it overflows back into a negative). Not handling this + * case would often result in infinite recursion. + * Common constant values ZERO, ONE, NEG_ONE, etc. are found as static properties on this class. + */ +var Long = /** @class */ (function () { + /** + * Constructs a 64 bit two's-complement integer, given its low and high 32 bit values as *signed* integers. + * See the from* functions below for more convenient ways of constructing Longs. + * + * Acceptable signatures are: + * - Long(low, high, unsigned?) + * - Long(bigint, unsigned?) + * - Long(string, unsigned?) + * + * @param low - The low (signed) 32 bits of the long + * @param high - The high (signed) 32 bits of the long + * @param unsigned - Whether unsigned or not, defaults to signed + */ + function Long(low, high, unsigned) { + if (low === void 0) { low = 0; } + if (!(this instanceof Long)) + return new Long(low, high, unsigned); + if (typeof low === 'bigint') { + Object.assign(this, Long.fromBigInt(low, !!high)); + } + else if (typeof low === 'string') { + Object.assign(this, Long.fromString(low, !!high)); + } + else { + this.low = low | 0; + this.high = high | 0; + this.unsigned = !!unsigned; + } + Object.defineProperty(this, '__isLong__', { + value: true, + configurable: false, + writable: false, + enumerable: false + }); + } + /** + * Returns a Long representing the 64 bit integer that comes by concatenating the given low and high bits. + * Each is assumed to use 32 bits. + * @param lowBits - The low 32 bits + * @param highBits - The high 32 bits + * @param unsigned - Whether unsigned or not, defaults to signed + * @returns The corresponding Long value + */ + Long.fromBits = function (lowBits, highBits, unsigned) { + return new Long(lowBits, highBits, unsigned); + }; + /** + * Returns a Long representing the given 32 bit integer value. + * @param value - The 32 bit integer in question + * @param unsigned - Whether unsigned or not, defaults to signed + * @returns The corresponding Long value + */ + Long.fromInt = function (value, unsigned) { + var obj, cachedObj, cache; + if (unsigned) { + value >>>= 0; + if ((cache = 0 <= value && value < 256)) { + cachedObj = UINT_CACHE[value]; + if (cachedObj) + return cachedObj; + } + obj = Long.fromBits(value, (value | 0) < 0 ? -1 : 0, true); + if (cache) + UINT_CACHE[value] = obj; + return obj; + } + else { + value |= 0; + if ((cache = -128 <= value && value < 128)) { + cachedObj = INT_CACHE[value]; + if (cachedObj) + return cachedObj; + } + obj = Long.fromBits(value, value < 0 ? -1 : 0, false); + if (cache) + INT_CACHE[value] = obj; + return obj; + } + }; + /** + * Returns a Long representing the given value, provided that it is a finite number. Otherwise, zero is returned. + * @param value - The number in question + * @param unsigned - Whether unsigned or not, defaults to signed + * @returns The corresponding Long value + */ + Long.fromNumber = function (value, unsigned) { + if (isNaN(value)) + return unsigned ? Long.UZERO : Long.ZERO; + if (unsigned) { + if (value < 0) + return Long.UZERO; + if (value >= TWO_PWR_64_DBL) + return Long.MAX_UNSIGNED_VALUE; + } + else { + if (value <= -TWO_PWR_63_DBL) + return Long.MIN_VALUE; + if (value + 1 >= TWO_PWR_63_DBL) + return Long.MAX_VALUE; + } + if (value < 0) + return Long.fromNumber(-value, unsigned).neg(); + return Long.fromBits(value % TWO_PWR_32_DBL | 0, (value / TWO_PWR_32_DBL) | 0, unsigned); + }; + /** + * Returns a Long representing the given value, provided that it is a finite number. Otherwise, zero is returned. + * @param value - The number in question + * @param unsigned - Whether unsigned or not, defaults to signed + * @returns The corresponding Long value + */ + Long.fromBigInt = function (value, unsigned) { + return Long.fromString(value.toString(), unsigned); + }; + /** + * Returns a Long representation of the given string, written using the specified radix. + * @param str - The textual representation of the Long + * @param unsigned - Whether unsigned or not, defaults to signed + * @param radix - The radix in which the text is written (2-36), defaults to 10 + * @returns The corresponding Long value + */ + Long.fromString = function (str, unsigned, radix) { + if (str.length === 0) + throw Error('empty string'); + if (str === 'NaN' || str === 'Infinity' || str === '+Infinity' || str === '-Infinity') + return Long.ZERO; + if (typeof unsigned === 'number') { + // For goog.math.long compatibility + (radix = unsigned), (unsigned = false); + } + else { + unsigned = !!unsigned; + } + radix = radix || 10; + if (radix < 2 || 36 < radix) + throw RangeError('radix'); + var p; + if ((p = str.indexOf('-')) > 0) + throw Error('interior hyphen'); + else if (p === 0) { + return Long.fromString(str.substring(1), unsigned, radix).neg(); + } + // Do several (8) digits each time through the loop, so as to + // minimize the calls to the very expensive emulated div. + var radixToPower = Long.fromNumber(Math.pow(radix, 8)); + var result = Long.ZERO; + for (var i = 0; i < str.length; i += 8) { + var size = Math.min(8, str.length - i), value = parseInt(str.substring(i, i + size), radix); + if (size < 8) { + var power = Long.fromNumber(Math.pow(radix, size)); + result = result.mul(power).add(Long.fromNumber(value)); + } + else { + result = result.mul(radixToPower); + result = result.add(Long.fromNumber(value)); + } + } + result.unsigned = unsigned; + return result; + }; + /** + * Creates a Long from its byte representation. + * @param bytes - Byte representation + * @param unsigned - Whether unsigned or not, defaults to signed + * @param le - Whether little or big endian, defaults to big endian + * @returns The corresponding Long value + */ + Long.fromBytes = function (bytes, unsigned, le) { + return le ? Long.fromBytesLE(bytes, unsigned) : Long.fromBytesBE(bytes, unsigned); + }; + /** + * Creates a Long from its little endian byte representation. + * @param bytes - Little endian byte representation + * @param unsigned - Whether unsigned or not, defaults to signed + * @returns The corresponding Long value + */ + Long.fromBytesLE = function (bytes, unsigned) { + return new Long(bytes[0] | (bytes[1] << 8) | (bytes[2] << 16) | (bytes[3] << 24), bytes[4] | (bytes[5] << 8) | (bytes[6] << 16) | (bytes[7] << 24), unsigned); + }; + /** + * Creates a Long from its big endian byte representation. + * @param bytes - Big endian byte representation + * @param unsigned - Whether unsigned or not, defaults to signed + * @returns The corresponding Long value + */ + Long.fromBytesBE = function (bytes, unsigned) { + return new Long((bytes[4] << 24) | (bytes[5] << 16) | (bytes[6] << 8) | bytes[7], (bytes[0] << 24) | (bytes[1] << 16) | (bytes[2] << 8) | bytes[3], unsigned); + }; + /** + * Tests if the specified object is a Long. + */ + // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types + Long.isLong = function (value) { + return utils_1.isObjectLike(value) && value['__isLong__'] === true; + }; + /** + * Converts the specified value to a Long. + * @param unsigned - Whether unsigned or not, defaults to signed + */ + Long.fromValue = function (val, unsigned) { + if (typeof val === 'number') + return Long.fromNumber(val, unsigned); + if (typeof val === 'string') + return Long.fromString(val, unsigned); + // Throws for non-objects, converts non-instanceof Long: + return Long.fromBits(val.low, val.high, typeof unsigned === 'boolean' ? unsigned : val.unsigned); + }; + /** Returns the sum of this and the specified Long. */ + Long.prototype.add = function (addend) { + if (!Long.isLong(addend)) + addend = Long.fromValue(addend); + // Divide each number into 4 chunks of 16 bits, and then sum the chunks. + var a48 = this.high >>> 16; + var a32 = this.high & 0xffff; + var a16 = this.low >>> 16; + var a00 = this.low & 0xffff; + var b48 = addend.high >>> 16; + var b32 = addend.high & 0xffff; + var b16 = addend.low >>> 16; + var b00 = addend.low & 0xffff; + var c48 = 0, c32 = 0, c16 = 0, c00 = 0; + c00 += a00 + b00; + c16 += c00 >>> 16; + c00 &= 0xffff; + c16 += a16 + b16; + c32 += c16 >>> 16; + c16 &= 0xffff; + c32 += a32 + b32; + c48 += c32 >>> 16; + c32 &= 0xffff; + c48 += a48 + b48; + c48 &= 0xffff; + return Long.fromBits((c16 << 16) | c00, (c48 << 16) | c32, this.unsigned); + }; + /** + * Returns the sum of this and the specified Long. + * @returns Sum + */ + Long.prototype.and = function (other) { + if (!Long.isLong(other)) + other = Long.fromValue(other); + return Long.fromBits(this.low & other.low, this.high & other.high, this.unsigned); + }; + /** + * Compares this Long's value with the specified's. + * @returns 0 if they are the same, 1 if the this is greater and -1 if the given one is greater + */ + Long.prototype.compare = function (other) { + if (!Long.isLong(other)) + other = Long.fromValue(other); + if (this.eq(other)) + return 0; + var thisNeg = this.isNegative(), otherNeg = other.isNegative(); + if (thisNeg && !otherNeg) + return -1; + if (!thisNeg && otherNeg) + return 1; + // At this point the sign bits are the same + if (!this.unsigned) + return this.sub(other).isNegative() ? -1 : 1; + // Both are positive if at least one is unsigned + return other.high >>> 0 > this.high >>> 0 || + (other.high === this.high && other.low >>> 0 > this.low >>> 0) + ? -1 + : 1; + }; + /** This is an alias of {@link Long.compare} */ + Long.prototype.comp = function (other) { + return this.compare(other); + }; + /** + * Returns this Long divided by the specified. The result is signed if this Long is signed or unsigned if this Long is unsigned. + * @returns Quotient + */ + Long.prototype.divide = function (divisor) { + if (!Long.isLong(divisor)) + divisor = Long.fromValue(divisor); + if (divisor.isZero()) + throw Error('division by zero'); + // use wasm support if present + if (wasm) { + // guard against signed division overflow: the largest + // negative number / -1 would be 1 larger than the largest + // positive number, due to two's complement. + if (!this.unsigned && + this.high === -0x80000000 && + divisor.low === -1 && + divisor.high === -1) { + // be consistent with non-wasm code path + return this; + } + var low = (this.unsigned ? wasm.div_u : wasm.div_s)(this.low, this.high, divisor.low, divisor.high); + return Long.fromBits(low, wasm.get_high(), this.unsigned); + } + if (this.isZero()) + return this.unsigned ? Long.UZERO : Long.ZERO; + var approx, rem, res; + if (!this.unsigned) { + // This section is only relevant for signed longs and is derived from the + // closure library as a whole. + if (this.eq(Long.MIN_VALUE)) { + if (divisor.eq(Long.ONE) || divisor.eq(Long.NEG_ONE)) + return Long.MIN_VALUE; + // recall that -MIN_VALUE == MIN_VALUE + else if (divisor.eq(Long.MIN_VALUE)) + return Long.ONE; + else { + // At this point, we have |other| >= 2, so |this/other| < |MIN_VALUE|. + var halfThis = this.shr(1); + approx = halfThis.div(divisor).shl(1); + if (approx.eq(Long.ZERO)) { + return divisor.isNegative() ? Long.ONE : Long.NEG_ONE; + } + else { + rem = this.sub(divisor.mul(approx)); + res = approx.add(rem.div(divisor)); + return res; + } + } + } + else if (divisor.eq(Long.MIN_VALUE)) + return this.unsigned ? Long.UZERO : Long.ZERO; + if (this.isNegative()) { + if (divisor.isNegative()) + return this.neg().div(divisor.neg()); + return this.neg().div(divisor).neg(); + } + else if (divisor.isNegative()) + return this.div(divisor.neg()).neg(); + res = Long.ZERO; + } + else { + // The algorithm below has not been made for unsigned longs. It's therefore + // required to take special care of the MSB prior to running it. + if (!divisor.unsigned) + divisor = divisor.toUnsigned(); + if (divisor.gt(this)) + return Long.UZERO; + if (divisor.gt(this.shru(1))) + // 15 >>> 1 = 7 ; with divisor = 8 ; true + return Long.UONE; + res = Long.UZERO; + } + // Repeat the following until the remainder is less than other: find a + // floating-point that approximates remainder / other *from below*, add this + // into the result, and subtract it from the remainder. It is critical that + // the approximate value is less than or equal to the real value so that the + // remainder never becomes negative. + rem = this; + while (rem.gte(divisor)) { + // Approximate the result of division. This may be a little greater or + // smaller than the actual value. + approx = Math.max(1, Math.floor(rem.toNumber() / divisor.toNumber())); + // We will tweak the approximate result by changing it in the 48-th digit or + // the smallest non-fractional digit, whichever is larger. + var log2 = Math.ceil(Math.log(approx) / Math.LN2); + var delta = log2 <= 48 ? 1 : Math.pow(2, log2 - 48); + // Decrease the approximation until it is smaller than the remainder. Note + // that if it is too large, the product overflows and is negative. + var approxRes = Long.fromNumber(approx); + var approxRem = approxRes.mul(divisor); + while (approxRem.isNegative() || approxRem.gt(rem)) { + approx -= delta; + approxRes = Long.fromNumber(approx, this.unsigned); + approxRem = approxRes.mul(divisor); + } + // We know the answer can't be zero... and actually, zero would cause + // infinite recursion since we would make no progress. + if (approxRes.isZero()) + approxRes = Long.ONE; + res = res.add(approxRes); + rem = rem.sub(approxRem); + } + return res; + }; + /**This is an alias of {@link Long.divide} */ + Long.prototype.div = function (divisor) { + return this.divide(divisor); + }; + /** + * Tests if this Long's value equals the specified's. + * @param other - Other value + */ + Long.prototype.equals = function (other) { + if (!Long.isLong(other)) + other = Long.fromValue(other); + if (this.unsigned !== other.unsigned && this.high >>> 31 === 1 && other.high >>> 31 === 1) + return false; + return this.high === other.high && this.low === other.low; + }; + /** This is an alias of {@link Long.equals} */ + Long.prototype.eq = function (other) { + return this.equals(other); + }; + /** Gets the high 32 bits as a signed integer. */ + Long.prototype.getHighBits = function () { + return this.high; + }; + /** Gets the high 32 bits as an unsigned integer. */ + Long.prototype.getHighBitsUnsigned = function () { + return this.high >>> 0; + }; + /** Gets the low 32 bits as a signed integer. */ + Long.prototype.getLowBits = function () { + return this.low; + }; + /** Gets the low 32 bits as an unsigned integer. */ + Long.prototype.getLowBitsUnsigned = function () { + return this.low >>> 0; + }; + /** Gets the number of bits needed to represent the absolute value of this Long. */ + Long.prototype.getNumBitsAbs = function () { + if (this.isNegative()) { + // Unsigned Longs are never negative + return this.eq(Long.MIN_VALUE) ? 64 : this.neg().getNumBitsAbs(); + } + var val = this.high !== 0 ? this.high : this.low; + var bit; + for (bit = 31; bit > 0; bit--) + if ((val & (1 << bit)) !== 0) + break; + return this.high !== 0 ? bit + 33 : bit + 1; + }; + /** Tests if this Long's value is greater than the specified's. */ + Long.prototype.greaterThan = function (other) { + return this.comp(other) > 0; + }; + /** This is an alias of {@link Long.greaterThan} */ + Long.prototype.gt = function (other) { + return this.greaterThan(other); + }; + /** Tests if this Long's value is greater than or equal the specified's. */ + Long.prototype.greaterThanOrEqual = function (other) { + return this.comp(other) >= 0; + }; + /** This is an alias of {@link Long.greaterThanOrEqual} */ + Long.prototype.gte = function (other) { + return this.greaterThanOrEqual(other); + }; + /** This is an alias of {@link Long.greaterThanOrEqual} */ + Long.prototype.ge = function (other) { + return this.greaterThanOrEqual(other); + }; + /** Tests if this Long's value is even. */ + Long.prototype.isEven = function () { + return (this.low & 1) === 0; + }; + /** Tests if this Long's value is negative. */ + Long.prototype.isNegative = function () { + return !this.unsigned && this.high < 0; + }; + /** Tests if this Long's value is odd. */ + Long.prototype.isOdd = function () { + return (this.low & 1) === 1; + }; + /** Tests if this Long's value is positive. */ + Long.prototype.isPositive = function () { + return this.unsigned || this.high >= 0; + }; + /** Tests if this Long's value equals zero. */ + Long.prototype.isZero = function () { + return this.high === 0 && this.low === 0; + }; + /** Tests if this Long's value is less than the specified's. */ + Long.prototype.lessThan = function (other) { + return this.comp(other) < 0; + }; + /** This is an alias of {@link Long#lessThan}. */ + Long.prototype.lt = function (other) { + return this.lessThan(other); + }; + /** Tests if this Long's value is less than or equal the specified's. */ + Long.prototype.lessThanOrEqual = function (other) { + return this.comp(other) <= 0; + }; + /** This is an alias of {@link Long.lessThanOrEqual} */ + Long.prototype.lte = function (other) { + return this.lessThanOrEqual(other); + }; + /** Returns this Long modulo the specified. */ + Long.prototype.modulo = function (divisor) { + if (!Long.isLong(divisor)) + divisor = Long.fromValue(divisor); + // use wasm support if present + if (wasm) { + var low = (this.unsigned ? wasm.rem_u : wasm.rem_s)(this.low, this.high, divisor.low, divisor.high); + return Long.fromBits(low, wasm.get_high(), this.unsigned); + } + return this.sub(this.div(divisor).mul(divisor)); + }; + /** This is an alias of {@link Long.modulo} */ + Long.prototype.mod = function (divisor) { + return this.modulo(divisor); + }; + /** This is an alias of {@link Long.modulo} */ + Long.prototype.rem = function (divisor) { + return this.modulo(divisor); + }; + /** + * Returns the product of this and the specified Long. + * @param multiplier - Multiplier + * @returns Product + */ + Long.prototype.multiply = function (multiplier) { + if (this.isZero()) + return Long.ZERO; + if (!Long.isLong(multiplier)) + multiplier = Long.fromValue(multiplier); + // use wasm support if present + if (wasm) { + var low = wasm.mul(this.low, this.high, multiplier.low, multiplier.high); + return Long.fromBits(low, wasm.get_high(), this.unsigned); + } + if (multiplier.isZero()) + return Long.ZERO; + if (this.eq(Long.MIN_VALUE)) + return multiplier.isOdd() ? Long.MIN_VALUE : Long.ZERO; + if (multiplier.eq(Long.MIN_VALUE)) + return this.isOdd() ? Long.MIN_VALUE : Long.ZERO; + if (this.isNegative()) { + if (multiplier.isNegative()) + return this.neg().mul(multiplier.neg()); + else + return this.neg().mul(multiplier).neg(); + } + else if (multiplier.isNegative()) + return this.mul(multiplier.neg()).neg(); + // If both longs are small, use float multiplication + if (this.lt(Long.TWO_PWR_24) && multiplier.lt(Long.TWO_PWR_24)) + return Long.fromNumber(this.toNumber() * multiplier.toNumber(), this.unsigned); + // Divide each long into 4 chunks of 16 bits, and then add up 4x4 products. + // We can skip products that would overflow. + var a48 = this.high >>> 16; + var a32 = this.high & 0xffff; + var a16 = this.low >>> 16; + var a00 = this.low & 0xffff; + var b48 = multiplier.high >>> 16; + var b32 = multiplier.high & 0xffff; + var b16 = multiplier.low >>> 16; + var b00 = multiplier.low & 0xffff; + var c48 = 0, c32 = 0, c16 = 0, c00 = 0; + c00 += a00 * b00; + c16 += c00 >>> 16; + c00 &= 0xffff; + c16 += a16 * b00; + c32 += c16 >>> 16; + c16 &= 0xffff; + c16 += a00 * b16; + c32 += c16 >>> 16; + c16 &= 0xffff; + c32 += a32 * b00; + c48 += c32 >>> 16; + c32 &= 0xffff; + c32 += a16 * b16; + c48 += c32 >>> 16; + c32 &= 0xffff; + c32 += a00 * b32; + c48 += c32 >>> 16; + c32 &= 0xffff; + c48 += a48 * b00 + a32 * b16 + a16 * b32 + a00 * b48; + c48 &= 0xffff; + return Long.fromBits((c16 << 16) | c00, (c48 << 16) | c32, this.unsigned); + }; + /** This is an alias of {@link Long.multiply} */ + Long.prototype.mul = function (multiplier) { + return this.multiply(multiplier); + }; + /** Returns the Negation of this Long's value. */ + Long.prototype.negate = function () { + if (!this.unsigned && this.eq(Long.MIN_VALUE)) + return Long.MIN_VALUE; + return this.not().add(Long.ONE); + }; + /** This is an alias of {@link Long.negate} */ + Long.prototype.neg = function () { + return this.negate(); + }; + /** Returns the bitwise NOT of this Long. */ + Long.prototype.not = function () { + return Long.fromBits(~this.low, ~this.high, this.unsigned); + }; + /** Tests if this Long's value differs from the specified's. */ + Long.prototype.notEquals = function (other) { + return !this.equals(other); + }; + /** This is an alias of {@link Long.notEquals} */ + Long.prototype.neq = function (other) { + return this.notEquals(other); + }; + /** This is an alias of {@link Long.notEquals} */ + Long.prototype.ne = function (other) { + return this.notEquals(other); + }; + /** + * Returns the bitwise OR of this Long and the specified. + */ + Long.prototype.or = function (other) { + if (!Long.isLong(other)) + other = Long.fromValue(other); + return Long.fromBits(this.low | other.low, this.high | other.high, this.unsigned); + }; + /** + * Returns this Long with bits shifted to the left by the given amount. + * @param numBits - Number of bits + * @returns Shifted Long + */ + Long.prototype.shiftLeft = function (numBits) { + if (Long.isLong(numBits)) + numBits = numBits.toInt(); + if ((numBits &= 63) === 0) + return this; + else if (numBits < 32) + return Long.fromBits(this.low << numBits, (this.high << numBits) | (this.low >>> (32 - numBits)), this.unsigned); + else + return Long.fromBits(0, this.low << (numBits - 32), this.unsigned); + }; + /** This is an alias of {@link Long.shiftLeft} */ + Long.prototype.shl = function (numBits) { + return this.shiftLeft(numBits); + }; + /** + * Returns this Long with bits arithmetically shifted to the right by the given amount. + * @param numBits - Number of bits + * @returns Shifted Long + */ + Long.prototype.shiftRight = function (numBits) { + if (Long.isLong(numBits)) + numBits = numBits.toInt(); + if ((numBits &= 63) === 0) + return this; + else if (numBits < 32) + return Long.fromBits((this.low >>> numBits) | (this.high << (32 - numBits)), this.high >> numBits, this.unsigned); + else + return Long.fromBits(this.high >> (numBits - 32), this.high >= 0 ? 0 : -1, this.unsigned); + }; + /** This is an alias of {@link Long.shiftRight} */ + Long.prototype.shr = function (numBits) { + return this.shiftRight(numBits); + }; + /** + * Returns this Long with bits logically shifted to the right by the given amount. + * @param numBits - Number of bits + * @returns Shifted Long + */ + Long.prototype.shiftRightUnsigned = function (numBits) { + if (Long.isLong(numBits)) + numBits = numBits.toInt(); + numBits &= 63; + if (numBits === 0) + return this; + else { + var high = this.high; + if (numBits < 32) { + var low = this.low; + return Long.fromBits((low >>> numBits) | (high << (32 - numBits)), high >>> numBits, this.unsigned); + } + else if (numBits === 32) + return Long.fromBits(high, 0, this.unsigned); + else + return Long.fromBits(high >>> (numBits - 32), 0, this.unsigned); + } + }; + /** This is an alias of {@link Long.shiftRightUnsigned} */ + Long.prototype.shr_u = function (numBits) { + return this.shiftRightUnsigned(numBits); + }; + /** This is an alias of {@link Long.shiftRightUnsigned} */ + Long.prototype.shru = function (numBits) { + return this.shiftRightUnsigned(numBits); + }; + /** + * Returns the difference of this and the specified Long. + * @param subtrahend - Subtrahend + * @returns Difference + */ + Long.prototype.subtract = function (subtrahend) { + if (!Long.isLong(subtrahend)) + subtrahend = Long.fromValue(subtrahend); + return this.add(subtrahend.neg()); + }; + /** This is an alias of {@link Long.subtract} */ + Long.prototype.sub = function (subtrahend) { + return this.subtract(subtrahend); + }; + /** Converts the Long to a 32 bit integer, assuming it is a 32 bit integer. */ + Long.prototype.toInt = function () { + return this.unsigned ? this.low >>> 0 : this.low; + }; + /** Converts the Long to a the nearest floating-point representation of this value (double, 53 bit mantissa). */ + Long.prototype.toNumber = function () { + if (this.unsigned) + return (this.high >>> 0) * TWO_PWR_32_DBL + (this.low >>> 0); + return this.high * TWO_PWR_32_DBL + (this.low >>> 0); + }; + /** Converts the Long to a BigInt (arbitrary precision). */ + Long.prototype.toBigInt = function () { + return BigInt(this.toString()); + }; + /** + * Converts this Long to its byte representation. + * @param le - Whether little or big endian, defaults to big endian + * @returns Byte representation + */ + Long.prototype.toBytes = function (le) { + return le ? this.toBytesLE() : this.toBytesBE(); + }; + /** + * Converts this Long to its little endian byte representation. + * @returns Little endian byte representation + */ + Long.prototype.toBytesLE = function () { + var hi = this.high, lo = this.low; + return [ + lo & 0xff, + (lo >>> 8) & 0xff, + (lo >>> 16) & 0xff, + lo >>> 24, + hi & 0xff, + (hi >>> 8) & 0xff, + (hi >>> 16) & 0xff, + hi >>> 24 + ]; + }; + /** + * Converts this Long to its big endian byte representation. + * @returns Big endian byte representation + */ + Long.prototype.toBytesBE = function () { + var hi = this.high, lo = this.low; + return [ + hi >>> 24, + (hi >>> 16) & 0xff, + (hi >>> 8) & 0xff, + hi & 0xff, + lo >>> 24, + (lo >>> 16) & 0xff, + (lo >>> 8) & 0xff, + lo & 0xff + ]; + }; + /** + * Converts this Long to signed. + */ + Long.prototype.toSigned = function () { + if (!this.unsigned) + return this; + return Long.fromBits(this.low, this.high, false); + }; + /** + * Converts the Long to a string written in the specified radix. + * @param radix - Radix (2-36), defaults to 10 + * @throws RangeError If `radix` is out of range + */ + Long.prototype.toString = function (radix) { + radix = radix || 10; + if (radix < 2 || 36 < radix) + throw RangeError('radix'); + if (this.isZero()) + return '0'; + if (this.isNegative()) { + // Unsigned Longs are never negative + if (this.eq(Long.MIN_VALUE)) { + // We need to change the Long value before it can be negated, so we remove + // the bottom-most digit in this base and then recurse to do the rest. + var radixLong = Long.fromNumber(radix), div = this.div(radixLong), rem1 = div.mul(radixLong).sub(this); + return div.toString(radix) + rem1.toInt().toString(radix); + } + else + return '-' + this.neg().toString(radix); + } + // Do several (6) digits each time through the loop, so as to + // minimize the calls to the very expensive emulated div. + var radixToPower = Long.fromNumber(Math.pow(radix, 6), this.unsigned); + // eslint-disable-next-line @typescript-eslint/no-this-alias + var rem = this; + var result = ''; + // eslint-disable-next-line no-constant-condition + while (true) { + var remDiv = rem.div(radixToPower); + var intval = rem.sub(remDiv.mul(radixToPower)).toInt() >>> 0; + var digits = intval.toString(radix); + rem = remDiv; + if (rem.isZero()) { + return digits + result; + } + else { + while (digits.length < 6) + digits = '0' + digits; + result = '' + digits + result; + } + } + }; + /** Converts this Long to unsigned. */ + Long.prototype.toUnsigned = function () { + if (this.unsigned) + return this; + return Long.fromBits(this.low, this.high, true); + }; + /** Returns the bitwise XOR of this Long and the given one. */ + Long.prototype.xor = function (other) { + if (!Long.isLong(other)) + other = Long.fromValue(other); + return Long.fromBits(this.low ^ other.low, this.high ^ other.high, this.unsigned); + }; + /** This is an alias of {@link Long.isZero} */ + Long.prototype.eqz = function () { + return this.isZero(); + }; + /** This is an alias of {@link Long.lessThanOrEqual} */ + Long.prototype.le = function (other) { + return this.lessThanOrEqual(other); + }; + /* + **************************************************************** + * BSON SPECIFIC ADDITIONS * + **************************************************************** + */ + Long.prototype.toExtendedJSON = function (options) { + if (options && options.relaxed) + return this.toNumber(); + return { $numberLong: this.toString() }; + }; + Long.fromExtendedJSON = function (doc, options) { + var result = Long.fromString(doc.$numberLong); + return options && options.relaxed ? result.toNumber() : result; + }; + /** @internal */ + Long.prototype[Symbol.for('nodejs.util.inspect.custom')] = function () { + return this.inspect(); + }; + Long.prototype.inspect = function () { + return "new Long(\"" + this.toString() + "\"" + (this.unsigned ? ', true' : '') + ")"; + }; + Long.TWO_PWR_24 = Long.fromInt(TWO_PWR_24_DBL); + /** Maximum unsigned value. */ + Long.MAX_UNSIGNED_VALUE = Long.fromBits(0xffffffff | 0, 0xffffffff | 0, true); + /** Signed zero */ + Long.ZERO = Long.fromInt(0); + /** Unsigned zero. */ + Long.UZERO = Long.fromInt(0, true); + /** Signed one. */ + Long.ONE = Long.fromInt(1); + /** Unsigned one. */ + Long.UONE = Long.fromInt(1, true); + /** Signed negative one. */ + Long.NEG_ONE = Long.fromInt(-1); + /** Maximum signed value. */ + Long.MAX_VALUE = Long.fromBits(0xffffffff | 0, 0x7fffffff | 0, false); + /** Minimum signed value. */ + Long.MIN_VALUE = Long.fromBits(0, 0x80000000 | 0, false); + return Long; +}()); +exports.Long = Long; +Object.defineProperty(Long.prototype, '__isLong__', { value: true }); +Object.defineProperty(Long.prototype, '_bsontype', { value: 'Long' }); +//# sourceMappingURL=long.js.map \ No newline at end of file diff --git a/node_modules/bson/lib/long.js.map b/node_modules/bson/lib/long.js.map new file mode 100644 index 000000000..d233150a5 --- /dev/null +++ b/node_modules/bson/lib/long.js.map @@ -0,0 +1 @@ +{"version":3,"file":"long.js","sourceRoot":"","sources":["../src/long.ts"],"names":[],"mappings":";;;AACA,wCAA8C;AAkB9C;;GAEG;AACH,IAAI,IAAI,GAAgC,SAAS,CAAC;AAMlD,IAAI;IACF,IAAI,GAAG,IAAI,WAAW,CAAC,QAAQ,CAC7B,IAAI,WAAW,CAAC,MAAM;IACpB,kBAAkB;IAClB,IAAI,UAAU,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,GAAG,EAAE,EAAE,EAAE,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,EAAE,GA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CAAC;IAChF,kBAAkB;IACX,SAAI,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IAC9B,qBAAqB;IACd,UAAK,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC;IACrC,kBAAkB;IACX,QAAG,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IAC7B,oBAAoB;IACb,SAAI,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC;IACpC,2BAA2B;IACpB,YAAO,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;IAClC,4BAA4B;IACrB,cAAS,GAAG,IAAI,CAAC,QAAQ,CAAC,UAAU,GAAG,CAAC,EAAE,UAAU,GAAG,CAAC,EAAE,KAAK,CAAC,CAAC;IACxE,4BAA4B;IACrB,cAAS,GAAG,IAAI,CAAC,QAAQ,CAAC,CAAC,EAAE,UAAU,GAAG,CAAC,EAAE,KAAK,CAAC,CAAC;IA+1B7D,WAAC;CAAA,AAv6BD,IAu6BC;AAv6BY,oBAAI;AAy6BjB,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,SAAS,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AACrE,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,SAAS,EAAE,WAAW,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/bson/lib/map.js b/node_modules/bson/lib/map.js new file mode 100644 index 000000000..a92ae9c78 --- /dev/null +++ b/node_modules/bson/lib/map.js @@ -0,0 +1,123 @@ +"use strict"; +/* eslint-disable @typescript-eslint/no-explicit-any */ +// We have an ES6 Map available, return the native instance +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Map = void 0; +var global_1 = require("./utils/global"); +/** @public */ +var bsonMap; +exports.Map = bsonMap; +var bsonGlobal = global_1.getGlobal(); +if (bsonGlobal.Map) { + exports.Map = bsonMap = bsonGlobal.Map; +} +else { + // We will return a polyfill + exports.Map = bsonMap = /** @class */ (function () { + function Map(array) { + if (array === void 0) { array = []; } + this._keys = []; + this._values = {}; + for (var i = 0; i < array.length; i++) { + if (array[i] == null) + continue; // skip null and undefined + var entry = array[i]; + var key = entry[0]; + var value = entry[1]; + // Add the key to the list of keys in order + this._keys.push(key); + // Add the key and value to the values dictionary with a point + // to the location in the ordered keys list + this._values[key] = { v: value, i: this._keys.length - 1 }; + } + } + Map.prototype.clear = function () { + this._keys = []; + this._values = {}; + }; + Map.prototype.delete = function (key) { + var value = this._values[key]; + if (value == null) + return false; + // Delete entry + delete this._values[key]; + // Remove the key from the ordered keys list + this._keys.splice(value.i, 1); + return true; + }; + Map.prototype.entries = function () { + var _this = this; + var index = 0; + return { + next: function () { + var key = _this._keys[index++]; + return { + value: key !== undefined ? [key, _this._values[key].v] : undefined, + done: key !== undefined ? false : true + }; + } + }; + }; + Map.prototype.forEach = function (callback, self) { + self = self || this; + for (var i = 0; i < this._keys.length; i++) { + var key = this._keys[i]; + // Call the forEach callback + callback.call(self, this._values[key].v, key, self); + } + }; + Map.prototype.get = function (key) { + return this._values[key] ? this._values[key].v : undefined; + }; + Map.prototype.has = function (key) { + return this._values[key] != null; + }; + Map.prototype.keys = function () { + var _this = this; + var index = 0; + return { + next: function () { + var key = _this._keys[index++]; + return { + value: key !== undefined ? key : undefined, + done: key !== undefined ? false : true + }; + } + }; + }; + Map.prototype.set = function (key, value) { + if (this._values[key]) { + this._values[key].v = value; + return this; + } + // Add the key to the list of keys in order + this._keys.push(key); + // Add the key and value to the values dictionary with a point + // to the location in the ordered keys list + this._values[key] = { v: value, i: this._keys.length - 1 }; + return this; + }; + Map.prototype.values = function () { + var _this = this; + var index = 0; + return { + next: function () { + var key = _this._keys[index++]; + return { + value: key !== undefined ? _this._values[key].v : undefined, + done: key !== undefined ? false : true + }; + } + }; + }; + Object.defineProperty(Map.prototype, "size", { + get: function () { + return this._keys.length; + }, + enumerable: false, + configurable: true + }); + return Map; + }()); +} +//# sourceMappingURL=map.js.map \ No newline at end of file diff --git a/node_modules/bson/lib/map.js.map b/node_modules/bson/lib/map.js.map new file mode 100644 index 000000000..972de8824 --- /dev/null +++ b/node_modules/bson/lib/map.js.map @@ -0,0 +1 @@ +{"version":3,"file":"map.js","sourceRoot":"","sources":["../src/map.ts"],"names":[],"mappings":";AAAA,uDAAuD;AACvD,2DAA2D;;;AAE3D,yCAA2C;AAE3C,cAAc;AACd,IAAI,OAAuB,CAAC;AAgHR,sBAAG;AA9GvB,IAAM,UAAU,GAAG,kBAAS,EAA4B,CAAC;AACzD,IAAI,UAAU,CAAC,GAAG,EAAE;IAClB,cAAA,OAAO,GAAG,UAAU,CAAC,GAAG,CAAC;CAC1B;KAAM;IACL,4BAA4B;IAC5B,cAAA,OAAO,GAAG;QAGR,aAAY,KAA2B;YAA3B,sBAAA,EAAA,UAA2B;YACrC,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC;YAChB,IAAI,CAAC,OAAO,GAAG,EAAE,CAAC;YAElB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;gBACrC,IAAI,KAAK,CAAC,CAAC,CAAC,IAAI,IAAI;oBAAE,SAAS,CAAC,0BAA0B;gBAC1D,IAAM,KAAK,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;gBACvB,IAAM,GAAG,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;gBACrB,IAAM,KAAK,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;gBACvB,2CAA2C;gBAC3C,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;gBACrB,8DAA8D;gBAC9D,2CAA2C;gBAC3C,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,IAAI,CA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AAG,CAAC,GAAG,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAC3D,OAAO,IAAI,CAAC;QACd,CAAC;QACD,oBAAM,GAAN;YAAA,iBAYC;YAXC,IAAI,KAAK,GAAG,CAAC,CAAC;YAEd,OAAO;gBACL,IAAI,EAAE;oBACJ,IAAM,GAAG,GAAG,KAAI,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC,CAAC;oBAChC,OAAO;wBACL,KAAK,EAAE,GAAG,KAAK,SAAS,CAAC,CAAC,CAAC,KAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS;wBAC1D,IAAI,EAAE,GAAG,KAAK,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI;qBACvC,CAAC;gBACJ,CAAC;aACF,CAAC;QACJ,CAAC;QACD,sBAAI,qBAAI;iBAAR;gBACE,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC;YAC3B,CAAC;;;WAAA;QACH,UAAC;IAAD,CAAC,AAtGS,GAsGoB,CAAC;CAChC"} \ No newline at end of file diff --git a/node_modules/bson/lib/max_key.js b/node_modules/bson/lib/max_key.js new file mode 100644 index 000000000..f9fd37603 --- /dev/null +++ b/node_modules/bson/lib/max_key.js @@ -0,0 +1,33 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.MaxKey = void 0; +/** + * A class representation of the BSON MaxKey type. + * @public + * @category BSONType + */ +var MaxKey = /** @class */ (function () { + function MaxKey() { + if (!(this instanceof MaxKey)) + return new MaxKey(); + } + /** @internal */ + MaxKey.prototype.toExtendedJSON = function () { + return { $maxKey: 1 }; + }; + /** @internal */ + MaxKey.fromExtendedJSON = function () { + return new MaxKey(); + }; + /** @internal */ + MaxKey.prototype[Symbol.for('nodejs.util.inspect.custom')] = function () { + return this.inspect(); + }; + MaxKey.prototype.inspect = function () { + return 'new MaxKey()'; + }; + return MaxKey; +}()); +exports.MaxKey = MaxKey; +Object.defineProperty(MaxKey.prototype, '_bsontype', { value: 'MaxKey' }); +//# sourceMappingURL=max_key.js.map \ No newline at end of file diff --git a/node_modules/bson/lib/max_key.js.map b/node_modules/bson/lib/max_key.js.map new file mode 100644 index 000000000..f85a5900f --- /dev/null +++ b/node_modules/bson/lib/max_key.js.map @@ -0,0 +1 @@ +{"version":3,"file":"max_key.js","sourceRoot":"","sources":["../src/max_key.ts"],"names":[],"mappings":";;;AAKA;;;;GAIG;AACH;IAGE;QACE,IAAI,CAAC,CAAC,IAAI,YAAY,MAAM,CAAC;YAAE,OAAO,IAAI,MAAM,EAAE,CAAC;IACrD,CAAC;IAED,gBAAgB;IAChB,+BAAc,GAAd;QACE,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;IACxB,CAAC;IAED,gBAAgB;IACT,uBAAgB,GAAvB;QACE,OAAO,IAAI,MAAM,EAAE,CAAC;IACtB,CAAC;IAED,gBAAgB;IAChB,iBAAC,MAAM,CAAC,GAAG,CAAC,4BAA4B,CAAC,CAAC,GAA1C;QACE,OAAO,IAAI,CAAC,OAAO,EAAE,CAAC;IACxB,CAAC;IAED,wBAAO,GAAP;QACE,OAAO,cAAc,CAAC;IACxB,CAAC;IACH,aAAC;AAAD,CAAC,AAzBD,IAyBC;AAzBY,wBAAM;AA2BnB,MAAM,CAAC,cAAc,CAAC,MAAM,CAAC,SAAS,EAAE,WAAW,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/bson/lib/min_key.js b/node_modules/bson/lib/min_key.js new file mode 100644 index 000000000..c67b3df0b --- /dev/null +++ b/node_modules/bson/lib/min_key.js @@ -0,0 +1,33 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.MinKey = void 0; +/** + * A class representation of the BSON MinKey type. + * @public + * @category BSONType + */ +var MinKey = /** @class */ (function () { + function MinKey() { + if (!(this instanceof MinKey)) + return new MinKey(); + } + /** @internal */ + MinKey.prototype.toExtendedJSON = function () { + return { $minKey: 1 }; + }; + /** @internal */ + MinKey.fromExtendedJSON = function () { + return new MinKey(); + }; + /** @internal */ + MinKey.prototype[Symbol.for('nodejs.util.inspect.custom')] = function () { + return this.inspect(); + }; + MinKey.prototype.inspect = function () { + return 'new MinKey()'; + }; + return MinKey; +}()); +exports.MinKey = MinKey; +Object.defineProperty(MinKey.prototype, '_bsontype', { value: 'MinKey' }); +//# sourceMappingURL=min_key.js.map \ No newline at end of file diff --git a/node_modules/bson/lib/min_key.js.map b/node_modules/bson/lib/min_key.js.map new file mode 100644 index 000000000..2d642d17d --- /dev/null +++ b/node_modules/bson/lib/min_key.js.map @@ -0,0 +1 @@ +{"version":3,"file":"min_key.js","sourceRoot":"","sources":["../src/min_key.ts"],"names":[],"mappings":";;;AAKA;;;;GAIG;AACH;IAGE;QACE,IAAI,CAAC,CAAC,IAAI,YAAY,MAAM,CAAC;YAAE,OAAO,IAAI,MAAM,EAAE,CAAC;IACrD,CAAC;IAED,gBAAgB;IAChB,+BAAc,GAAd;QACE,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;IACxB,CAAC;IAED,gBAAgB;IACT,uBAAgB,GAAvB;QACE,OAAO,IAAI,MAAM,EAAE,CAAC;IACtB,CAAC;IAED,gBAAgB;IAChB,iBAAC,MAAM,CAAC,GAAG,CAAC,4BAA4B,CAAC,CAAC,GAA1C;QACE,OAAO,IAAI,CAAC,OAAO,EAAE,CAAC;IACxB,CAAC;IAED,wBAAO,GAAP;QACE,OAAO,cAAc,CAAC;IACxB,CAAC;IACH,aAAC;AAAD,CAAC,AAzBD,IAyBC;AAzBY,wBAAM;AA2BnB,MAAM,CAAC,cAAc,CAAC,MAAM,CAAC,SAAS,EAAE,WAAW,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/bson/lib/objectid.js b/node_modules/bson/lib/objectid.js new file mode 100644 index 000000000..490a5f913 --- /dev/null +++ b/node_modules/bson/lib/objectid.js @@ -0,0 +1,299 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ObjectId = void 0; +var buffer_1 = require("buffer"); +var ensure_buffer_1 = require("./ensure_buffer"); +var error_1 = require("./error"); +var utils_1 = require("./parser/utils"); +// Regular expression that checks for hex value +var checkForHexRegExp = new RegExp('^[0-9a-fA-F]{24}$'); +// Unique sequence for the current process (initialized on first use) +var PROCESS_UNIQUE = null; +var kId = Symbol('id'); +/** + * A class representation of the BSON ObjectId type. + * @public + * @category BSONType + */ +var ObjectId = /** @class */ (function () { + /** + * Create an ObjectId type + * + * @param inputId - Can be a 24 character hex string, 12 byte binary Buffer, or a number. + */ + function ObjectId(inputId) { + if (!(this instanceof ObjectId)) + return new ObjectId(inputId); + // workingId is set based on type of input and whether valid id exists for the input + var workingId; + if (typeof inputId === 'object' && inputId && 'id' in inputId) { + if (typeof inputId.id !== 'string' && !ArrayBuffer.isView(inputId.id)) { + throw new error_1.BSONTypeError('Argument passed in must have an id that is of type string or Buffer'); + } + if ('toHexString' in inputId && typeof inputId.toHexString === 'function') { + workingId = buffer_1.Buffer.from(inputId.toHexString(), 'hex'); + } + else { + workingId = inputId.id; + } + } + else { + workingId = inputId; + } + // the following cases use workingId to construct an ObjectId + if (workingId == null || typeof workingId === 'number') { + // The most common use case (blank id, new objectId instance) + // Generate a new id + this[kId] = ObjectId.generate(typeof workingId === 'number' ? workingId : undefined); + } + else if (ArrayBuffer.isView(workingId) && workingId.byteLength === 12) { + // If intstanceof matches we can escape calling ensure buffer in Node.js environments + this[kId] = workingId instanceof buffer_1.Buffer ? workingId : ensure_buffer_1.ensureBuffer(workingId); + } + else if (typeof workingId === 'string') { + if (workingId.length === 12) { + var bytes = buffer_1.Buffer.from(workingId); + if (bytes.byteLength === 12) { + this[kId] = bytes; + } + else { + throw new error_1.BSONTypeError('Argument passed in must be a string of 12 bytes'); + } + } + else if (workingId.length === 24 && checkForHexRegExp.test(workingId)) { + this[kId] = buffer_1.Buffer.from(workingId, 'hex'); + } + else { + throw new error_1.BSONTypeError('Argument passed in must be a string of 12 bytes or a string of 24 hex characters or an integer'); + } + } + else { + throw new error_1.BSONTypeError('Argument passed in does not match the accepted types'); + } + // If we are caching the hex string + if (ObjectId.cacheHexString) { + this.__id = this.id.toString('hex'); + } + } + Object.defineProperty(ObjectId.prototype, "id", { + /** + * The ObjectId bytes + * @readonly + */ + get: function () { + return this[kId]; + }, + set: function (value) { + this[kId] = value; + if (ObjectId.cacheHexString) { + this.__id = value.toString('hex'); + } + }, + enumerable: false, + configurable: true + }); + Object.defineProperty(ObjectId.prototype, "generationTime", { + /** + * The generation time of this ObjectId instance + * @deprecated Please use getTimestamp / createFromTime which returns an int32 epoch + */ + get: function () { + return this.id.readInt32BE(0); + }, + set: function (value) { + // Encode time into first 4 bytes + this.id.writeUInt32BE(value, 0); + }, + enumerable: false, + configurable: true + }); + /** Returns the ObjectId id as a 24 character hex string representation */ + ObjectId.prototype.toHexString = function () { + if (ObjectId.cacheHexString && this.__id) { + return this.__id; + } + var hexString = this.id.toString('hex'); + if (ObjectId.cacheHexString && !this.__id) { + this.__id = hexString; + } + return hexString; + }; + /** + * Update the ObjectId index + * @privateRemarks + * Used in generating new ObjectId's on the driver + * @internal + */ + ObjectId.getInc = function () { + return (ObjectId.index = (ObjectId.index + 1) % 0xffffff); + }; + /** + * Generate a 12 byte id buffer used in ObjectId's + * + * @param time - pass in a second based timestamp. + */ + ObjectId.generate = function (time) { + if ('number' !== typeof time) { + time = Math.floor(Date.now() / 1000); + } + var inc = ObjectId.getInc(); + var buffer = buffer_1.Buffer.alloc(12); + // 4-byte timestamp + buffer.writeUInt32BE(time, 0); + // set PROCESS_UNIQUE if yet not initialized + if (PROCESS_UNIQUE === null) { + PROCESS_UNIQUE = utils_1.randomBytes(5); + } + // 5-byte process unique + buffer[4] = PROCESS_UNIQUE[0]; + buffer[5] = PROCESS_UNIQUE[1]; + buffer[6] = PROCESS_UNIQUE[2]; + buffer[7] = PROCESS_UNIQUE[3]; + buffer[8] = PROCESS_UNIQUE[4]; + // 3-byte counter + buffer[11] = inc & 0xff; + buffer[10] = (inc >> 8) & 0xff; + buffer[9] = (inc >> 16) & 0xff; + return buffer; + }; + /** + * Converts the id into a 24 character hex string for printing + * + * @param format - The Buffer toString format parameter. + */ + ObjectId.prototype.toString = function (format) { + // Is the id a buffer then use the buffer toString method to return the format + if (format) + return this.id.toString(format); + return this.toHexString(); + }; + /** Converts to its JSON the 24 character hex string representation. */ + ObjectId.prototype.toJSON = function () { + return this.toHexString(); + }; + /** + * Compares the equality of this ObjectId with `otherID`. + * + * @param otherId - ObjectId instance to compare against. + */ + ObjectId.prototype.equals = function (otherId) { + if (otherId === undefined || otherId === null) { + return false; + } + if (otherId instanceof ObjectId) { + return this[kId][11] === otherId[kId][11] && this[kId].equals(otherId[kId]); + } + if (typeof otherId === 'string' && + ObjectId.isValid(otherId) && + otherId.length === 12 && + utils_1.isUint8Array(this.id)) { + return otherId === buffer_1.Buffer.prototype.toString.call(this.id, 'latin1'); + } + if (typeof otherId === 'string' && ObjectId.isValid(otherId) && otherId.length === 24) { + return otherId.toLowerCase() === this.toHexString(); + } + if (typeof otherId === 'string' && ObjectId.isValid(otherId) && otherId.length === 12) { + return buffer_1.Buffer.from(otherId).equals(this.id); + } + if (typeof otherId === 'object' && + 'toHexString' in otherId && + typeof otherId.toHexString === 'function') { + var otherIdString = otherId.toHexString(); + var thisIdString = this.toHexString().toLowerCase(); + return typeof otherIdString === 'string' && otherIdString.toLowerCase() === thisIdString; + } + return false; + }; + /** Returns the generation date (accurate up to the second) that this ID was generated. */ + ObjectId.prototype.getTimestamp = function () { + var timestamp = new Date(); + var time = this.id.readUInt32BE(0); + timestamp.setTime(Math.floor(time) * 1000); + return timestamp; + }; + /** @internal */ + ObjectId.createPk = function () { + return new ObjectId(); + }; + /** + * Creates an ObjectId from a second based number, with the rest of the ObjectId zeroed out. Used for comparisons or sorting the ObjectId. + * + * @param time - an integer number representing a number of seconds. + */ + ObjectId.createFromTime = function (time) { + var buffer = buffer_1.Buffer.from([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]); + // Encode time into first 4 bytes + buffer.writeUInt32BE(time, 0); + // Return the new objectId + return new ObjectId(buffer); + }; + /** + * Creates an ObjectId from a hex string representation of an ObjectId. + * + * @param hexString - create a ObjectId from a passed in 24 character hexstring. + */ + ObjectId.createFromHexString = function (hexString) { + // Throw an error if it's not a valid setup + if (typeof hexString === 'undefined' || (hexString != null && hexString.length !== 24)) { + throw new error_1.BSONTypeError('Argument passed in must be a single String of 12 bytes or a string of 24 hex characters'); + } + return new ObjectId(buffer_1.Buffer.from(hexString, 'hex')); + }; + /** + * Checks if a value is a valid bson ObjectId + * + * @param id - ObjectId instance to validate. + */ + ObjectId.isValid = function (id) { + if (id == null) + return false; + try { + new ObjectId(id); + return true; + } + catch (_a) { + return false; + } + }; + /** @internal */ + ObjectId.prototype.toExtendedJSON = function () { + if (this.toHexString) + return { $oid: this.toHexString() }; + return { $oid: this.toString('hex') }; + }; + /** @internal */ + ObjectId.fromExtendedJSON = function (doc) { + return new ObjectId(doc.$oid); + }; + /** + * Converts to a string representation of this Id. + * + * @returns return the 24 character hex string representation. + * @internal + */ + ObjectId.prototype[Symbol.for('nodejs.util.inspect.custom')] = function () { + return this.inspect(); + }; + ObjectId.prototype.inspect = function () { + return "new ObjectId(\"" + this.toHexString() + "\")"; + }; + /** @internal */ + ObjectId.index = Math.floor(Math.random() * 0xffffff); + return ObjectId; +}()); +exports.ObjectId = ObjectId; +// Deprecated methods +Object.defineProperty(ObjectId.prototype, 'generate', { + value: utils_1.deprecate(function (time) { return ObjectId.generate(time); }, 'Please use the static `ObjectId.generate(time)` instead') +}); +Object.defineProperty(ObjectId.prototype, 'getInc', { + value: utils_1.deprecate(function () { return ObjectId.getInc(); }, 'Please use the static `ObjectId.getInc()` instead') +}); +Object.defineProperty(ObjectId.prototype, 'get_inc', { + value: utils_1.deprecate(function () { return ObjectId.getInc(); }, 'Please use the static `ObjectId.getInc()` instead') +}); +Object.defineProperty(ObjectId, 'get_inc', { + value: utils_1.deprecate(function () { return ObjectId.getInc(); }, 'Please use the static `ObjectId.getInc()` instead') +}); +Object.defineProperty(ObjectId.prototype, '_bsontype', { value: 'ObjectID' }); +//# sourceMappingURL=objectid.js.map \ No newline at end of file diff --git a/node_modules/bson/lib/objectid.js.map b/node_modules/bson/lib/objectid.js.map new file mode 100644 index 000000000..12ccefca4 --- /dev/null +++ b/node_modules/bson/lib/objectid.js.map @@ -0,0 +1 @@ +{"version":3,"file":"objectid.js","sourceRoot":"","sources":["../src/objectid.ts"],"names":[],"mappings":";;;AAAA,iCAAgC;AAChC,iDAA+C;AAC/C,iCAAwC;AACxC,wCAAsE;AAEtE,+CAA+C;AAC/C,IAAM,iBAAiB,GAAG,IAAI,MAAM,CAAC,mBAAmB,CAAC,CAAC;AAE1D,qEAAqE;AACrE,IAAI,cAAc,GAAsB,IAAI,CAAC;AAc7C,IAAM,GAAG,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC;AAEzB;;;;GAIG;AACH;IAaE;;;;OAIG;IACH,kBAAY,OAAyE;QACnF,IAAI,CAAC,CAAC,IAAI,YAAY,QAAQ,CAAC;YAAE,OAAO,IAAI,QAAQ,CAAC,OAAO,CAAC,CAAC;QAE9D,oFAAoF;QACpF,IAAI,SAAS,CAAC;QACd,IAAI,OAAO,OAAO,KAAK,QAAQ,IAAI,OAAO,IAAI,IAAI,IAAI,OAAO,EAAE;YAC7D,IAAI,OAAO,OAAO,CAAC,EAAE,KAAK,QAAQ,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE;gBACrE,MAAM,IAAI,qBAAa,CACrB,qEAAqE,CACtE,CAAC;aACH;YACD,IAAI,aAAa,IAAI,OAAO,IAAI,OAAO,OAAO,CAA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AAgB;IACT,cAAK,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,QAAQ,CAAC,CAAC;IAyStD,eAAC;CAAA,AA7SD,IA6SC;AA7SY,4BAAQ;AA+SrB,qBAAqB;AACrB,MAAM,CAAC,cAAc,CAAC,QAAQ,CAAC,SAAS,EAAE,UAAU,EAAE;IACpD,KAAK,EAAE,iBAAS,CACd,UAAC,IAAY,IAAK,OAAA,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAvB,CAAuB,EACzC,yDAAyD,CAC1D;CACF,CAAC,CAAC;AAEH,MAAM,CAAC,cAAc,CAAC,QAAQ,CAAC,SAAS,EAAE,QAAQ,EAAE;IAClD,KAAK,EAAE,iBAAS,CAAC,cAAM,OAAA,QAAQ,CAAC,MAAM,EAAE,EAAjB,CAAiB,EAAE,mDAAmD,CAAC;CAC/F,CAAC,CAAC;AAEH,MAAM,CAAC,cAAc,CAAC,QAAQ,CAAC,SAAS,EAAE,SAAS,EAAE;IACnD,KAAK,EAAE,iBAAS,CAAC,cAAM,OAAA,QAAQ,CAAC,MAAM,EAAE,EAAjB,CAAiB,EAAE,mDAAmD,CAAC;CAC/F,CAAC,CAAC;AAEH,MAAM,CAAC,cAAc,CAAC,QAAQ,EAAE,SAAS,EAAE;IACzC,KAAK,EAAE,iBAAS,CAAC,cAAM,OAAA,QAAQ,CAAC,MAAM,EAAE,EAAjB,CAAiB,EAAE,mDAAmD,CAAC;CAC/F,CAAC,CAAC;AAEH,MAAM,CAAC,cAAc,CAAC,QAAQ,CAAC,SAAS,EAAE,WAAW,EAAE,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/bson/lib/parser/calculate_size.js b/node_modules/bson/lib/parser/calculate_size.js new file mode 100644 index 000000000..a1b095c36 --- /dev/null +++ b/node_modules/bson/lib/parser/calculate_size.js @@ -0,0 +1,193 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.calculateObjectSize = void 0; +var buffer_1 = require("buffer"); +var binary_1 = require("../binary"); +var constants = require("../constants"); +var utils_1 = require("./utils"); +function calculateObjectSize(object, serializeFunctions, ignoreUndefined) { + var totalLength = 4 + 1; + if (Array.isArray(object)) { + for (var i = 0; i < object.length; i++) { + totalLength += calculateElement(i.toString(), object[i], serializeFunctions, true, ignoreUndefined); + } + } + else { + // If we have toBSON defined, override the current object + if (typeof (object === null || object === void 0 ? void 0 : object.toBSON) === 'function') { + object = object.toBSON(); + } + // Calculate size + for (var key in object) { + totalLength += calculateElement(key, object[key], serializeFunctions, false, ignoreUndefined); + } + } + return totalLength; +} +exports.calculateObjectSize = calculateObjectSize; +/** @internal */ +function calculateElement(name, +// eslint-disable-next-line @typescript-eslint/no-explicit-any +value, serializeFunctions, isArray, ignoreUndefined) { + if (serializeFunctions === void 0) { serializeFunctions = false; } + if (isArray === void 0) { isArray = false; } + if (ignoreUndefined === void 0) { ignoreUndefined = false; } + // If we have toBSON defined, override the current object + if (typeof (value === null || value === void 0 ? void 0 : value.toBSON) === 'function') { + value = value.toBSON(); + } + switch (typeof value) { + case 'string': + return 1 + buffer_1.Buffer.byteLength(name, 'utf8') + 1 + 4 + buffer_1.Buffer.byteLength(value, 'utf8') + 1; + case 'number': + if (Math.floor(value) === value && + value >= constants.JS_INT_MIN && + value <= constants.JS_INT_MAX) { + if (value >= constants.BSON_INT32_MIN && value <= constants.BSON_INT32_MAX) { + // 32 bit + return (name != null ? buffer_1.Buffer.byteLength(name, 'utf8') + 1 : 0) + (4 + 1); + } + else { + return (name != null ? buffer_1.Buffer.byteLength(name, 'utf8') + 1 : 0) + (8 + 1); + } + } + else { + // 64 bit + return (name != null ? buffer_1.Buffer.byteLength(name, 'utf8') + 1 : 0) + (8 + 1); + } + case 'undefined': + if (isArray || !ignoreUndefined) + return (name != null ? buffer_1.Buffer.byteLength(name, 'utf8') + 1 : 0) + 1; + return 0; + case 'boolean': + return (name != null ? buffer_1.Buffer.byteLength(name, 'utf8') + 1 : 0) + (1 + 1); + case 'object': + if (value == null || value['_bsontype'] === 'MinKey' || value['_bsontype'] === 'MaxKey') { + return (name != null ? buffer_1.Buffer.byteLength(name, 'utf8') + 1 : 0) + 1; + } + else if (value['_bsontype'] === 'ObjectId' || value['_bsontype'] === 'ObjectID') { + return (name != null ? buffer_1.Buffer.byteLength(name, 'utf8') + 1 : 0) + (12 + 1); + } + else if (value instanceof Date || utils_1.isDate(value)) { + return (name != null ? buffer_1.Buffer.byteLength(name, 'utf8') + 1 : 0) + (8 + 1); + } + else if (ArrayBuffer.isView(value) || + value instanceof ArrayBuffer || + utils_1.isAnyArrayBuffer(value)) { + return ((name != null ? buffer_1.Buffer.byteLength(name, 'utf8') + 1 : 0) + (1 + 4 + 1) + value.byteLength); + } + else if (value['_bsontype'] === 'Long' || + value['_bsontype'] === 'Double' || + value['_bsontype'] === 'Timestamp') { + return (name != null ? buffer_1.Buffer.byteLength(name, 'utf8') + 1 : 0) + (8 + 1); + } + else if (value['_bsontype'] === 'Decimal128') { + return (name != null ? buffer_1.Buffer.byteLength(name, 'utf8') + 1 : 0) + (16 + 1); + } + else if (value['_bsontype'] === 'Code') { + // Calculate size depending on the availability of a scope + if (value.scope != null && Object.keys(value.scope).length > 0) { + return ((name != null ? buffer_1.Buffer.byteLength(name, 'utf8') + 1 : 0) + + 1 + + 4 + + 4 + + buffer_1.Buffer.byteLength(value.code.toString(), 'utf8') + + 1 + + calculateObjectSize(value.scope, serializeFunctions, ignoreUndefined)); + } + else { + return ((name != null ? buffer_1.Buffer.byteLength(name, 'utf8') + 1 : 0) + + 1 + + 4 + + buffer_1.Buffer.byteLength(value.code.toString(), 'utf8') + + 1); + } + } + else if (value['_bsontype'] === 'Binary') { + // Check what kind of subtype we have + if (value.sub_type === binary_1.Binary.SUBTYPE_BYTE_ARRAY) { + return ((name != null ? buffer_1.Buffer.byteLength(name, 'utf8') + 1 : 0) + + (value.position + 1 + 4 + 1 + 4)); + } + else { + return ((name != null ? buffer_1.Buffer.byteLength(name, 'utf8') + 1 : 0) + (value.position + 1 + 4 + 1)); + } + } + else if (value['_bsontype'] === 'Symbol') { + return ((name != null ? buffer_1.Buffer.byteLength(name, 'utf8') + 1 : 0) + + buffer_1.Buffer.byteLength(value.value, 'utf8') + + 4 + + 1 + + 1); + } + else if (value['_bsontype'] === 'DBRef') { + // Set up correct object for serialization + var ordered_values = Object.assign({ + $ref: value.collection, + $id: value.oid + }, value.fields); + // Add db reference if it exists + if (value.db != null) { + ordered_values['$db'] = value.db; + } + return ((name != null ? buffer_1.Buffer.byteLength(name, 'utf8') + 1 : 0) + + 1 + + calculateObjectSize(ordered_values, serializeFunctions, ignoreUndefined)); + } + else if (value instanceof RegExp || utils_1.isRegExp(value)) { + return ((name != null ? buffer_1.Buffer.byteLength(name, 'utf8') + 1 : 0) + + 1 + + buffer_1.Buffer.byteLength(value.source, 'utf8') + + 1 + + (value.global ? 1 : 0) + + (value.ignoreCase ? 1 : 0) + + (value.multiline ? 1 : 0) + + 1); + } + else if (value['_bsontype'] === 'BSONRegExp') { + return ((name != null ? buffer_1.Buffer.byteLength(name, 'utf8') + 1 : 0) + + 1 + + buffer_1.Buffer.byteLength(value.pattern, 'utf8') + + 1 + + buffer_1.Buffer.byteLength(value.options, 'utf8') + + 1); + } + else { + return ((name != null ? buffer_1.Buffer.byteLength(name, 'utf8') + 1 : 0) + + calculateObjectSize(value, serializeFunctions, ignoreUndefined) + + 1); + } + case 'function': + // WTF for 0.4.X where typeof /someregexp/ === 'function' + if (value instanceof RegExp || utils_1.isRegExp(value) || String.call(value) === '[object RegExp]') { + return ((name != null ? buffer_1.Buffer.byteLength(name, 'utf8') + 1 : 0) + + 1 + + buffer_1.Buffer.byteLength(value.source, 'utf8') + + 1 + + (value.global ? 1 : 0) + + (value.ignoreCase ? 1 : 0) + + (value.multiline ? 1 : 0) + + 1); + } + else { + if (serializeFunctions && value.scope != null && Object.keys(value.scope).length > 0) { + return ((name != null ? buffer_1.Buffer.byteLength(name, 'utf8') + 1 : 0) + + 1 + + 4 + + 4 + + buffer_1.Buffer.byteLength(utils_1.normalizedFunctionString(value), 'utf8') + + 1 + + calculateObjectSize(value.scope, serializeFunctions, ignoreUndefined)); + } + else if (serializeFunctions) { + return ((name != null ? buffer_1.Buffer.byteLength(name, 'utf8') + 1 : 0) + + 1 + + 4 + + buffer_1.Buffer.byteLength(utils_1.normalizedFunctionString(value), 'utf8') + + 1); + } + } + } + return 0; +} +//# sourceMappingURL=calculate_size.js.map \ No newline at end of file diff --git a/node_modules/bson/lib/parser/calculate_size.js.map b/node_modules/bson/lib/parser/calculate_size.js.map new file mode 100644 index 000000000..cb7e61473 --- /dev/null +++ b/node_modules/bson/lib/parser/calculate_size.js.map @@ -0,0 +1 @@ +{"version":3,"file":"calculate_size.js","sourceRoot":"","sources":["../../src/parser/calculate_size.ts"],"names":[],"mappings":";;;AAAA,iCAAgC;AAChC,oCAAmC;AAEnC,wCAA0C;AAC1C,iCAAuF;AAEvF,SAAgB,mBAAmB,CACjC,MAAgB,EAChB,kBAA4B,EAC5B,eAAyB;IAEzB,IAAI,WAAW,GAAG,CAAC,GAAG,CAAC,CAAC;IAExB,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE;QACzB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;YACtC,WAAW,IAAI,gBAAgB,CAC7B,CAAC,CAAC,QAAQ,EAAE,EACZ,MAAM,CAAC,CAAC,CAAC,EACT,kBAAkB,EAClB,IAAI,EACJ,eAAe,CAChB,CAAC;SACH;KACF;SAAM;QACL,yDAAyD;QAEzD,IAAI,OAAO,CAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,MAAM,CAAA,KAAK,UAAU,EAAE;YACxC,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC;SAC1B;QAED,iBAAiB;QACjB,KAAK,IAAM,GAAG,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,eAAM,CAAC,UAAU,CAAC,gCAAwB,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;wBAC1D,CAAC;wBACD,mBAAmB,CAAC,KAAK,CAAC,KAAK,EAAE,kBAAkB,EAAE,eAAe,CAAC,CACtE,CAAC;iBACH;qBAAM,IAAI,kBAAkB,EAAE;oBAC7B,OAAO,CACL,CAAC,IAAI,IAAI,IAAI,CAAC,CAAC,CAAC,eAAM,CAAC,UAAU,CAAC,IAAI,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;wBACxD,CAAC;wBACD,CAAC;wBACD,eAAM,CAAC,UAAU,CAAC,gCAAwB,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;wBAC1D,CAAC,CACF,CAAC;iBACH;aACF;KACJ;IAED,OAAO,CAAC,CAAC;AACX,CAAC"} \ No newline at end of file diff --git a/node_modules/bson/lib/parser/deserializer.js b/node_modules/bson/lib/parser/deserializer.js new file mode 100644 index 000000000..c29f3e0ad --- /dev/null +++ b/node_modules/bson/lib/parser/deserializer.js @@ -0,0 +1,656 @@ +"use strict"; +var __assign = (this && this.__assign) || function () { + __assign = Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; + }; + return __assign.apply(this, arguments); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.deserialize = void 0; +var buffer_1 = require("buffer"); +var binary_1 = require("../binary"); +var code_1 = require("../code"); +var constants = require("../constants"); +var db_ref_1 = require("../db_ref"); +var decimal128_1 = require("../decimal128"); +var double_1 = require("../double"); +var error_1 = require("../error"); +var int_32_1 = require("../int_32"); +var long_1 = require("../long"); +var max_key_1 = require("../max_key"); +var min_key_1 = require("../min_key"); +var objectid_1 = require("../objectid"); +var regexp_1 = require("../regexp"); +var symbol_1 = require("../symbol"); +var timestamp_1 = require("../timestamp"); +var validate_utf8_1 = require("../validate_utf8"); +// Internal long versions +var JS_INT_MAX_LONG = long_1.Long.fromNumber(constants.JS_INT_MAX); +var JS_INT_MIN_LONG = long_1.Long.fromNumber(constants.JS_INT_MIN); +var functionCache = {}; +function deserialize(buffer, options, isArray) { + options = options == null ? {} : options; + var index = options && options.index ? options.index : 0; + // Read the document size + var size = buffer[index] | + (buffer[index + 1] << 8) | + (buffer[index + 2] << 16) | + (buffer[index + 3] << 24); + if (size < 5) { + throw new error_1.BSONError("bson size must be >= 5, is " + size); + } + if (options.allowObjectSmallerThanBufferSize && buffer.length < size) { + throw new error_1.BSONError("buffer length " + buffer.length + " must be >= bson size " + size); + } + if (!options.allowObjectSmallerThanBufferSize && buffer.length !== size) { + throw new error_1.BSONError("buffer length " + buffer.length + " must === bson size " + size); + } + if (size + index > buffer.byteLength) { + throw new error_1.BSONError("(bson size " + size + " + options.index " + index + " must be <= buffer length " + buffer.byteLength + ")"); + } + // Illegal end value + if (buffer[index + size - 1] !== 0) { + throw new error_1.BSONError("One object, sized correctly, with a spot for an EOO, but the EOO isn't 0x00"); + } + // Start deserializtion + return deserializeObject(buffer, index, options, isArray); +} +exports.deserialize = deserialize; +var allowedDBRefKeys = /^\$ref$|^\$id$|^\$db$/; +function deserializeObject(buffer, index, options, isArray) { + if (isArray === void 0) { isArray = false; } + var evalFunctions = options['evalFunctions'] == null ? false : options['evalFunctions']; + var cacheFunctions = options['cacheFunctions'] == null ? false : options['cacheFunctions']; + var fieldsAsRaw = options['fieldsAsRaw'] == null ? null : options['fieldsAsRaw']; + // Return raw bson buffer instead of parsing it + var raw = options['raw'] == null ? false : options['raw']; + // Return BSONRegExp objects instead of native regular expressions + var bsonRegExp = typeof options['bsonRegExp'] === 'boolean' ? options['bsonRegExp'] : false; + // Controls the promotion of values vs wrapper classes + var promoteBuffers = options['promoteBuffers'] == null ? false : options['promoteBuffers']; + var promoteLongs = options['promoteLongs'] == null ? true : options['promoteLongs']; + var promoteValues = options['promoteValues'] == null ? true : options['promoteValues']; + // Ensures default validation option if none given + var validation = options.validation == null ? { utf8: true } : options.validation; + // Shows if global utf-8 validation is enabled or disabled + var globalUTFValidation = true; + // Reflects utf-8 validation setting regardless of global or specific key validation + var validationSetting; + // Set of keys either to enable or disable validation on + var utf8KeysSet = new Set(); + // Check for boolean uniformity and empty validation option + var utf8ValidatedKeys = validation.utf8; + if (typeof utf8ValidatedKeys === 'boolean') { + validationSetting = utf8ValidatedKeys; + } + else { + globalUTFValidation = false; + var utf8ValidationValues = Object.keys(utf8ValidatedKeys).map(function (key) { + return utf8ValidatedKeys[key]; + }); + if (utf8ValidationValues.length === 0) { + throw new error_1.BSONError('UTF-8 validation setting cannot be empty'); + } + if (typeof utf8ValidationValues[0] !== 'boolean') { + throw new error_1.BSONError('Invalid UTF-8 validation option, must specify boolean values'); + } + validationSetting = utf8ValidationValues[0]; + // Ensures boolean uniformity in utf-8 validation (all true or all false) + if (!utf8ValidationValues.every(function (item) { return item === validationSetting; })) { + throw new error_1.BSONError('Invalid UTF-8 validation option - keys must be all true or all false'); + } + } + // Add keys to set that will either be validated or not based on validationSetting + if (!globalUTFValidation) { + for (var _i = 0, _a = Object.keys(utf8ValidatedKeys); _i < _a.length; _i++) { + var key = _a[_i]; + utf8KeysSet.add(key); + } + } + // Set the start index + var startIndex = index; + // Validate that we have at least 4 bytes of buffer + if (buffer.length < 5) + throw new error_1.BSONError('corrupt bson message < 5 bytes long'); + // Read the document size + var size = buffer[index++] | (buffer[index++] << 8) | (buffer[index++] << 16) | (buffer[index++] << 24); + // Ensure buffer is valid size + if (size < 5 || size > buffer.length) + throw new error_1.BSONError('corrupt bson message'); + // Create holding object + var object = isArray ? [] : {}; + // Used for arrays to skip having to perform utf8 decoding + var arrayIndex = 0; + var done = false; + var isPossibleDBRef = isArray ? false : null; + // While we have more left data left keep parsing + while (!done) { + // Read the type + var elementType = buffer[index++]; + // If we get a zero it's the last byte, exit + if (elementType === 0) + break; + // Get the start search index + var i = index; + // Locate the end of the c string + while (buffer[i] !== 0x00 && i < buffer.length) { + i++; + } + // If are at the end of the buffer there is a problem with the document + if (i >= buffer.byteLength) + throw new error_1.BSONError('Bad BSON Document: illegal CString'); + // Represents the key + var name = isArray ? arrayIndex++ : buffer.toString('utf8', index, i); + // shouldValidateKey is true if the key should be validated, false otherwise + var shouldValidateKey = true; + if (globalUTFValidation || utf8KeysSet.has(name)) { + shouldValidateKey = validationSetting; + } + else { + shouldValidateKey = !validationSetting; + } + if (isPossibleDBRef !== false && name[0] === '$') { + isPossibleDBRef = allowedDBRefKeys.test(name); + } + var value = void 0; + index = i + 1; + if (elementType === constants.BSON_DATA_STRING) { + var stringSize = buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + if (stringSize <= 0 || + stringSize > buffer.length - index || + buffer[index + stringSize - 1] !== 0) { + throw new error_1.BSONError('bad string length in bson'); + } + value = getValidatedString(buffer, index, index + stringSize - 1, shouldValidateKey); + index = index + stringSize; + } + else if (elementType === constants.BSON_DATA_OID) { + var oid = buffer_1.Buffer.alloc(12); + buffer.copy(oid, 0, index, index + 12); + value = new objectid_1.ObjectId(oid); + index = index + 12; + } + else if (elementType === constants.BSON_DATA_INT && promoteValues === false) { + value = new int_32_1.Int32(buffer[index++] | (buffer[index++] << 8) | (buffer[index++] << 16) | (buffer[index++] << 24)); + } + else if (elementType === constants.BSON_DATA_INT) { + value = + buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + } + else if (elementType === constants.BSON_DATA_NUMBER && promoteValues === false) { + value = new double_1.Double(buffer.readDoubleLE(index)); + index = index + 8; + } + else if (elementType === constants.BSON_DATA_NUMBER) { + value = buffer.readDoubleLE(index); + index = index + 8; + } + else if (elementType === constants.BSON_DATA_DATE) { + var lowBits = buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + var highBits = buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + value = new Date(new long_1.Long(lowBits, highBits).toNumber()); + } + else if (elementType === constants.BSON_DATA_BOOLEAN) { + if (buffer[index] !== 0 && buffer[index] !== 1) + throw new error_1.BSONError('illegal boolean type value'); + value = buffer[index++] === 1; + } + else if (elementType === constants.BSON_DATA_OBJECT) { + var _index = index; + var objectSize = buffer[index] | + (buffer[index + 1] << 8) | + (buffer[index + 2] << 16) | + (buffer[index + 3] << 24); + if (objectSize <= 0 || objectSize > buffer.length - index) + throw new error_1.BSONError('bad embedded document length in bson'); + // We have a raw value + if (raw) { + value = buffer.slice(index, index + objectSize); + } + else { + var objectOptions = options; + if (!globalUTFValidation) { + objectOptions = __assign(__assign({}, options), { validation: { utf8: shouldValidateKey } }); + } + value = deserializeObject(buffer, _index, objectOptions, false); + } + index = index + objectSize; + } + else if (elementType === constants.BSON_DATA_ARRAY) { + var _index = index; + var objectSize = buffer[index] | + (buffer[index + 1] << 8) | + (buffer[index + 2] << 16) | + (buffer[index + 3] << 24); + var arrayOptions = options; + // Stop index + var stopIndex = index + objectSize; + // All elements of array to be returned as raw bson + if (fieldsAsRaw && fieldsAsRaw[name]) { + arrayOptions = {}; + for (var n in options) { + arrayOptions[n] = options[n]; + } + arrayOptions['raw'] = true; + } + if (!globalUTFValidation) { + arrayOptions = __assign(__assign({}, arrayOptions), { validation: { utf8: shouldValidateKey } }); + } + value = deserializeObject(buffer, _index, arrayOptions, true); + index = index + objectSize; + if (buffer[index - 1] !== 0) + throw new error_1.BSONError('invalid array terminator byte'); + if (index !== stopIndex) + throw new error_1.BSONError('corrupted array bson'); + } + else if (elementType === constants.BSON_DATA_UNDEFINED) { + value = undefined; + } + else if (elementType === constants.BSON_DATA_NULL) { + value = null; + } + else if (elementType === constants.BSON_DATA_LONG) { + // Unpack the low and high bits + var lowBits = buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + var highBits = buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + var long = new long_1.Long(lowBits, highBits); + // Promote the long if possible + if (promoteLongs && promoteValues === true) { + value = + long.lessThanOrEqual(JS_INT_MAX_LONG) && long.greaterThanOrEqual(JS_INT_MIN_LONG) + ? long.toNumber() + : long; + } + else { + value = long; + } + } + else if (elementType === constants.BSON_DATA_DECIMAL128) { + // Buffer to contain the decimal bytes + var bytes = buffer_1.Buffer.alloc(16); + // Copy the next 16 bytes into the bytes buffer + buffer.copy(bytes, 0, index, index + 16); + // Update index + index = index + 16; + // Assign the new Decimal128 value + var decimal128 = new decimal128_1.Decimal128(bytes); + // If we have an alternative mapper use that + if ('toObject' in decimal128 && typeof decimal128.toObject === 'function') { + value = decimal128.toObject(); + } + else { + value = decimal128; + } + } + else if (elementType === constants.BSON_DATA_BINARY) { + var binarySize = buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + var totalBinarySize = binarySize; + var subType = buffer[index++]; + // Did we have a negative binary size, throw + if (binarySize < 0) + throw new error_1.BSONError('Negative binary type element size found'); + // Is the length longer than the document + if (binarySize > buffer.byteLength) + throw new error_1.BSONError('Binary type size larger than document size'); + // Decode as raw Buffer object if options specifies it + if (buffer['slice'] != null) { + // If we have subtype 2 skip the 4 bytes for the size + if (subType === binary_1.Binary.SUBTYPE_BYTE_ARRAY) { + binarySize = + buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + if (binarySize < 0) + throw new error_1.BSONError('Negative binary type element size found for subtype 0x02'); + if (binarySize > totalBinarySize - 4) + throw new error_1.BSONError('Binary type with subtype 0x02 contains too long binary size'); + if (binarySize < totalBinarySize - 4) + throw new error_1.BSONError('Binary type with subtype 0x02 contains too short binary size'); + } + if (promoteBuffers && promoteValues) { + value = buffer.slice(index, index + binarySize); + } + else { + value = new binary_1.Binary(buffer.slice(index, index + binarySize), subType); + } + } + else { + var _buffer = buffer_1.Buffer.alloc(binarySize); + // If we have subtype 2 skip the 4 bytes for the size + if (subType === binary_1.Binary.SUBTYPE_BYTE_ARRAY) { + binarySize = + buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + if (binarySize < 0) + throw new error_1.BSONError('Negative binary type element size found for subtype 0x02'); + if (binarySize > totalBinarySize - 4) + throw new error_1.BSONError('Binary type with subtype 0x02 contains too long binary size'); + if (binarySize < totalBinarySize - 4) + throw new error_1.BSONError('Binary type with subtype 0x02 contains too short binary size'); + } + // Copy the data + for (i = 0; i < binarySize; i++) { + _buffer[i] = buffer[index + i]; + } + if (promoteBuffers && promoteValues) { + value = _buffer; + } + else { + value = new binary_1.Binary(_buffer, subType); + } + } + // Update the index + index = index + binarySize; + } + else if (elementType === constants.BSON_DATA_REGEXP && bsonRegExp === false) { + // Get the start search index + i = index; + // Locate the end of the c string + while (buffer[i] !== 0x00 && i < buffer.length) { + i++; + } + // If are at the end of the buffer there is a problem with the document + if (i >= buffer.length) + throw new error_1.BSONError('Bad BSON Document: illegal CString'); + // Return the C string + var source = buffer.toString('utf8', index, i); + // Create the regexp + index = i + 1; + // Get the start search index + i = index; + // Locate the end of the c string + while (buffer[i] !== 0x00 && i < buffer.length) { + i++; + } + // If are at the end of the buffer there is a problem with the document + if (i >= buffer.length) + throw new error_1.BSONError('Bad BSON Document: illegal CString'); + // Return the C string + var regExpOptions = buffer.toString('utf8', index, i); + index = i + 1; + // For each option add the corresponding one for javascript + var optionsArray = new Array(regExpOptions.length); + // Parse options + for (i = 0; i < regExpOptions.length; i++) { + switch (regExpOptions[i]) { + case 'm': + optionsArray[i] = 'm'; + break; + case 's': + optionsArray[i] = 'g'; + break; + case 'i': + optionsArray[i] = 'i'; + break; + } + } + value = new RegExp(source, optionsArray.join('')); + } + else if (elementType === constants.BSON_DATA_REGEXP && bsonRegExp === true) { + // Get the start search index + i = index; + // Locate the end of the c string + while (buffer[i] !== 0x00 && i < buffer.length) { + i++; + } + // If are at the end of the buffer there is a problem with the document + if (i >= buffer.length) + throw new error_1.BSONError('Bad BSON Document: illegal CString'); + // Return the C string + var source = buffer.toString('utf8', index, i); + index = i + 1; + // Get the start search index + i = index; + // Locate the end of the c string + while (buffer[i] !== 0x00 && i < buffer.length) { + i++; + } + // If are at the end of the buffer there is a problem with the document + if (i >= buffer.length) + throw new error_1.BSONError('Bad BSON Document: illegal CString'); + // Return the C string + var regExpOptions = buffer.toString('utf8', index, i); + index = i + 1; + // Set the object + value = new regexp_1.BSONRegExp(source, regExpOptions); + } + else if (elementType === constants.BSON_DATA_SYMBOL) { + var stringSize = buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + if (stringSize <= 0 || + stringSize > buffer.length - index || + buffer[index + stringSize - 1] !== 0) { + throw new error_1.BSONError('bad string length in bson'); + } + var symbol = getValidatedString(buffer, index, index + stringSize - 1, shouldValidateKey); + value = promoteValues ? symbol : new symbol_1.BSONSymbol(symbol); + index = index + stringSize; + } + else if (elementType === constants.BSON_DATA_TIMESTAMP) { + var lowBits = buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + var highBits = buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + value = new timestamp_1.Timestamp(lowBits, highBits); + } + else if (elementType === constants.BSON_DATA_MIN_KEY) { + value = new min_key_1.MinKey(); + } + else if (elementType === constants.BSON_DATA_MAX_KEY) { + value = new max_key_1.MaxKey(); + } + else if (elementType === constants.BSON_DATA_CODE) { + var stringSize = buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + if (stringSize <= 0 || + stringSize > buffer.length - index || + buffer[index + stringSize - 1] !== 0) { + throw new error_1.BSONError('bad string length in bson'); + } + var functionString = getValidatedString(buffer, index, index + stringSize - 1, shouldValidateKey); + // If we are evaluating the functions + if (evalFunctions) { + // If we have cache enabled let's look for the md5 of the function in the cache + if (cacheFunctions) { + // Got to do this to avoid V8 deoptimizing the call due to finding eval + value = isolateEval(functionString, functionCache, object); + } + else { + value = isolateEval(functionString); + } + } + else { + value = new code_1.Code(functionString); + } + // Update parse index position + index = index + stringSize; + } + else if (elementType === constants.BSON_DATA_CODE_W_SCOPE) { + var totalSize = buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + // Element cannot be shorter than totalSize + stringSize + documentSize + terminator + if (totalSize < 4 + 4 + 4 + 1) { + throw new error_1.BSONError('code_w_scope total size shorter minimum expected length'); + } + // Get the code string size + var stringSize = buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + // Check if we have a valid string + if (stringSize <= 0 || + stringSize > buffer.length - index || + buffer[index + stringSize - 1] !== 0) { + throw new error_1.BSONError('bad string length in bson'); + } + // Javascript function + var functionString = getValidatedString(buffer, index, index + stringSize - 1, shouldValidateKey); + // Update parse index position + index = index + stringSize; + // Parse the element + var _index = index; + // Decode the size of the object document + var objectSize = buffer[index] | + (buffer[index + 1] << 8) | + (buffer[index + 2] << 16) | + (buffer[index + 3] << 24); + // Decode the scope object + var scopeObject = deserializeObject(buffer, _index, options, false); + // Adjust the index + index = index + objectSize; + // Check if field length is too short + if (totalSize < 4 + 4 + objectSize + stringSize) { + throw new error_1.BSONError('code_w_scope total size is too short, truncating scope'); + } + // Check if totalSize field is too long + if (totalSize > 4 + 4 + objectSize + stringSize) { + throw new error_1.BSONError('code_w_scope total size is too long, clips outer document'); + } + // If we are evaluating the functions + if (evalFunctions) { + // If we have cache enabled let's look for the md5 of the function in the cache + if (cacheFunctions) { + // Got to do this to avoid V8 deoptimizing the call due to finding eval + value = isolateEval(functionString, functionCache, object); + } + else { + value = isolateEval(functionString); + } + value.scope = scopeObject; + } + else { + value = new code_1.Code(functionString, scopeObject); + } + } + else if (elementType === constants.BSON_DATA_DBPOINTER) { + // Get the code string size + var stringSize = buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + // Check if we have a valid string + if (stringSize <= 0 || + stringSize > buffer.length - index || + buffer[index + stringSize - 1] !== 0) + throw new error_1.BSONError('bad string length in bson'); + // Namespace + if (validation != null && validation.utf8) { + if (!validate_utf8_1.validateUtf8(buffer, index, index + stringSize - 1)) { + throw new error_1.BSONError('Invalid UTF-8 string in BSON document'); + } + } + var namespace = buffer.toString('utf8', index, index + stringSize - 1); + // Update parse index position + index = index + stringSize; + // Read the oid + var oidBuffer = buffer_1.Buffer.alloc(12); + buffer.copy(oidBuffer, 0, index, index + 12); + var oid = new objectid_1.ObjectId(oidBuffer); + // Update the index + index = index + 12; + // Upgrade to DBRef type + value = new db_ref_1.DBRef(namespace, oid); + } + else { + throw new error_1.BSONError('Detected unknown BSON type ' + elementType.toString(16) + ' for fieldname "' + name + '"'); + } + if (name === '__proto__') { + Object.defineProperty(object, name, { + value: value, + writable: true, + enumerable: true, + configurable: true + }); + } + else { + object[name] = value; + } + } + // Check if the deserialization was against a valid array/object + if (size !== index - startIndex) { + if (isArray) + throw new error_1.BSONError('corrupt array bson'); + throw new error_1.BSONError('corrupt object bson'); + } + // if we did not find "$ref", "$id", "$db", or found an extraneous $key, don't make a DBRef + if (!isPossibleDBRef) + return object; + if (db_ref_1.isDBRefLike(object)) { + var copy = Object.assign({}, object); + delete copy.$ref; + delete copy.$id; + delete copy.$db; + return new db_ref_1.DBRef(object.$ref, object.$id, object.$db, copy); + } + return object; +} +/** + * Ensure eval is isolated, store the result in functionCache. + * + * @internal + */ +function isolateEval(functionString, functionCache, object) { + if (!functionCache) + return new Function(functionString); + // Check for cache hit, eval if missing and return cached function + if (functionCache[functionString] == null) { + functionCache[functionString] = new Function(functionString); + } + // Set the object + return functionCache[functionString].bind(object); +} +function getValidatedString(buffer, start, end, shouldValidateUtf8) { + var value = buffer.toString('utf8', start, end); + // if utf8 validation is on, do the check + if (shouldValidateUtf8) { + for (var i = 0; i < value.length; i++) { + if (value.charCodeAt(i) === 0xfffd) { + if (!validate_utf8_1.validateUtf8(buffer, start, end)) { + throw new error_1.BSONError('Invalid UTF-8 string in BSON document'); + } + break; + } + } + } + return value; +} +//# sourceMappingURL=deserializer.js.map \ No newline at end of file diff --git a/node_modules/bson/lib/parser/deserializer.js.map b/node_modules/bson/lib/parser/deserializer.js.map new file mode 100644 index 000000000..0912087e3 --- /dev/null +++ b/node_modules/bson/lib/parser/deserializer.js.map @@ -0,0 +1 @@ +{"version":3,"file":"deserializer.js","sourceRoot":"","sources":["../../src/parser/deserializer.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,iCAAgC;AAChC,oCAAmC;AAEnC,gCAA+B;AAC/B,wCAA0C;AAC1C,oCAA0D;AAC1D,4CAA2C;AAC3C,oCAAmC;AACnC,kCAAqC;AACrC,oCAAkC;AAClC,gCAA+B;AAC/B,sCAAoC;AACpC,sCAAoC;AACpC,wCAAuC;AACvC,oCAAuC;AACvC,oCAAuC;AACvC,0CAAyC;AACzC,kDAAgD;AAgDhD,yBAAyB;AACzB,IAAM,eAAe,GAAG,WAAI,CAAC,UAAU,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;AAC9D,IAAM,eAAe,GAAG,WAAI,CAAC,UAAU,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;AAE9D,IAAM,aAAa,GAAiC,EAAE,CAAC;AAEvD,SAAgB,WAAW,CACzB,MAAc,EACd,OAA2B,EAC3B,OAAiB;IAEjB,OAAO,GAAG,OAAO,IAAI,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC;IACzC,IAAM,KAAK,GAAG,OAAO,IAAI,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IAC3D,yBAAyB;IACzB,IAAM,IAAI,GACR,MAAM,CAAC,KAAK,CAAC;QACb,CAAC,MAAM,CAAC,KAAK,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC;QACxB,CAAC,MAAM,CAAC,KAAK,GAAG,CAAC,C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C5C,MAAiB;IAEjB,IAAI,CAAC,aAAa;QAAE,OAAO,IAAI,QAAQ,CAAC,cAAc,CAAC,CAAC;IACxD,kEAAkE;IAClE,IAAI,aAAa,CAAC,cAAc,CAAC,IAAI,IAAI,EAAE;QACzC,aAAa,CAAC,cAAc,CAAC,GAAG,IAAI,QAAQ,CAAC,cAAc,CAAC,CAAC;KAC9D;IAED,iBAAiB;IACjB,OAAO,aAAa,CAAC,cAAc,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AACpD,CAAC;AAED,SAAS,kBAAkB,CACzB,MAAc,EACd,KAAa,EACb,GAAW,EACX,kBAA2B;IAE3B,IAAM,KAAK,GAAG,MAAM,CAAC,QAAQ,CAAC,MAAM,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC;IAClD,yCAAyC;IACzC,IAAI,kBAAkB,EAAE;QACtB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;YACrC,IAAI,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,KAAK,MAAM,EAAE;gBAClC,IAAI,CAAC,4BAAY,CAAC,MAAM,EAAE,KAAK,EAAE,GAAG,CAAC,EAAE;oBACrC,MAAM,IAAI,iBAAS,CAAC,uCAAuC,CAAC,CAAC;iBAC9D;gBACD,MAAM;aACP;SACF;KACF;IACD,OAAO,KAAK,CAAC;AACf,CAAC"} \ No newline at end of file diff --git a/node_modules/bson/lib/parser/serializer.js b/node_modules/bson/lib/parser/serializer.js new file mode 100644 index 000000000..6df8fead4 --- /dev/null +++ b/node_modules/bson/lib/parser/serializer.js @@ -0,0 +1,864 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.serializeInto = void 0; +var binary_1 = require("../binary"); +var constants = require("../constants"); +var ensure_buffer_1 = require("../ensure_buffer"); +var error_1 = require("../error"); +var extended_json_1 = require("../extended_json"); +var float_parser_1 = require("../float_parser"); +var long_1 = require("../long"); +var map_1 = require("../map"); +var utils_1 = require("./utils"); +var regexp = /\x00/; // eslint-disable-line no-control-regex +var ignoreKeys = new Set(['$db', '$ref', '$id', '$clusterTime']); +/* + * isArray indicates if we are writing to a BSON array (type 0x04) + * which forces the "key" which really an array index as a string to be written as ascii + * This will catch any errors in index as a string generation + */ +function serializeString(buffer, key, value, index, isArray) { + // Encode String type + buffer[index++] = constants.BSON_DATA_STRING; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes + 1; + buffer[index - 1] = 0; + // Write the string + var size = buffer.write(value, index + 4, undefined, 'utf8'); + // Write the size of the string to buffer + buffer[index + 3] = ((size + 1) >> 24) & 0xff; + buffer[index + 2] = ((size + 1) >> 16) & 0xff; + buffer[index + 1] = ((size + 1) >> 8) & 0xff; + buffer[index] = (size + 1) & 0xff; + // Update index + index = index + 4 + size; + // Write zero + buffer[index++] = 0; + return index; +} +function serializeNumber(buffer, key, value, index, isArray) { + // We have an integer value + // TODO(NODE-2529): Add support for big int + if (Number.isInteger(value) && + value >= constants.BSON_INT32_MIN && + value <= constants.BSON_INT32_MAX) { + // If the value fits in 32 bits encode as int32 + // Set int type 32 bits or less + buffer[index++] = constants.BSON_DATA_INT; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Write the int value + buffer[index++] = value & 0xff; + buffer[index++] = (value >> 8) & 0xff; + buffer[index++] = (value >> 16) & 0xff; + buffer[index++] = (value >> 24) & 0xff; + } + else { + // Encode as double + buffer[index++] = constants.BSON_DATA_NUMBER; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Write float + float_parser_1.writeIEEE754(buffer, value, index, 'little', 52, 8); + // Adjust index + index = index + 8; + } + return index; +} +function serializeNull(buffer, key, _, index, isArray) { + // Set long type + buffer[index++] = constants.BSON_DATA_NULL; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + return index; +} +function serializeBoolean(buffer, key, value, index, isArray) { + // Write the type + buffer[index++] = constants.BSON_DATA_BOOLEAN; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Encode the boolean value + buffer[index++] = value ? 1 : 0; + return index; +} +function serializeDate(buffer, key, value, index, isArray) { + // Write the type + buffer[index++] = constants.BSON_DATA_DATE; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Write the date + var dateInMilis = long_1.Long.fromNumber(value.getTime()); + var lowBits = dateInMilis.getLowBits(); + var highBits = dateInMilis.getHighBits(); + // Encode low bits + buffer[index++] = lowBits & 0xff; + buffer[index++] = (lowBits >> 8) & 0xff; + buffer[index++] = (lowBits >> 16) & 0xff; + buffer[index++] = (lowBits >> 24) & 0xff; + // Encode high bits + buffer[index++] = highBits & 0xff; + buffer[index++] = (highBits >> 8) & 0xff; + buffer[index++] = (highBits >> 16) & 0xff; + buffer[index++] = (highBits >> 24) & 0xff; + return index; +} +function serializeRegExp(buffer, key, value, index, isArray) { + // Write the type + buffer[index++] = constants.BSON_DATA_REGEXP; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + if (value.source && value.source.match(regexp) != null) { + throw Error('value ' + value.source + ' must not contain null bytes'); + } + // Adjust the index + index = index + buffer.write(value.source, index, undefined, 'utf8'); + // Write zero + buffer[index++] = 0x00; + // Write the parameters + if (value.ignoreCase) + buffer[index++] = 0x69; // i + if (value.global) + buffer[index++] = 0x73; // s + if (value.multiline) + buffer[index++] = 0x6d; // m + // Add ending zero + buffer[index++] = 0x00; + return index; +} +function serializeBSONRegExp(buffer, key, value, index, isArray) { + // Write the type + buffer[index++] = constants.BSON_DATA_REGEXP; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Check the pattern for 0 bytes + if (value.pattern.match(regexp) != null) { + // The BSON spec doesn't allow keys with null bytes because keys are + // null-terminated. + throw Error('pattern ' + value.pattern + ' must not contain null bytes'); + } + // Adjust the index + index = index + buffer.write(value.pattern, index, undefined, 'utf8'); + // Write zero + buffer[index++] = 0x00; + // Write the options + index = index + buffer.write(value.options.split('').sort().join(''), index, undefined, 'utf8'); + // Add ending zero + buffer[index++] = 0x00; + return index; +} +function serializeMinMax(buffer, key, value, index, isArray) { + // Write the type of either min or max key + if (value === null) { + buffer[index++] = constants.BSON_DATA_NULL; + } + else if (value._bsontype === 'MinKey') { + buffer[index++] = constants.BSON_DATA_MIN_KEY; + } + else { + buffer[index++] = constants.BSON_DATA_MAX_KEY; + } + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + return index; +} +function serializeObjectId(buffer, key, value, index, isArray) { + // Write the type + buffer[index++] = constants.BSON_DATA_OID; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Write the objectId into the shared buffer + if (typeof value.id === 'string') { + buffer.write(value.id, index, undefined, 'binary'); + } + else if (utils_1.isUint8Array(value.id)) { + // Use the standard JS methods here because buffer.copy() is buggy with the + // browser polyfill + buffer.set(value.id.subarray(0, 12), index); + } + else { + throw new error_1.BSONTypeError('object [' + JSON.stringify(value) + '] is not a valid ObjectId'); + } + // Adjust index + return index + 12; +} +function serializeBuffer(buffer, key, value, index, isArray) { + // Write the type + buffer[index++] = constants.BSON_DATA_BINARY; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Get size of the buffer (current write point) + var size = value.length; + // Write the size of the string to buffer + buffer[index++] = size & 0xff; + buffer[index++] = (size >> 8) & 0xff; + buffer[index++] = (size >> 16) & 0xff; + buffer[index++] = (size >> 24) & 0xff; + // Write the default subtype + buffer[index++] = constants.BSON_BINARY_SUBTYPE_DEFAULT; + // Copy the content form the binary field to the buffer + buffer.set(ensure_buffer_1.ensureBuffer(value), index); + // Adjust the index + index = index + size; + return index; +} +function serializeObject(buffer, key, value, index, checkKeys, depth, serializeFunctions, ignoreUndefined, isArray, path) { + if (checkKeys === void 0) { checkKeys = false; } + if (depth === void 0) { depth = 0; } + if (serializeFunctions === void 0) { serializeFunctions = false; } + if (ignoreUndefined === void 0) { ignoreUndefined = true; } + if (isArray === void 0) { isArray = false; } + if (path === void 0) { path = []; } + for (var i = 0; i < path.length; i++) { + if (path[i] === value) + throw new error_1.BSONError('cyclic dependency detected'); + } + // Push value to stack + path.push(value); + // Write the type + buffer[index++] = Array.isArray(value) ? constants.BSON_DATA_ARRAY : constants.BSON_DATA_OBJECT; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + var endIndex = serializeInto(buffer, value, checkKeys, index, depth + 1, serializeFunctions, ignoreUndefined, path); + // Pop stack + path.pop(); + return endIndex; +} +function serializeDecimal128(buffer, key, value, index, isArray) { + buffer[index++] = constants.BSON_DATA_DECIMAL128; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Write the data from the value + // Prefer the standard JS methods because their typechecking is not buggy, + // unlike the `buffer` polyfill's. + buffer.set(value.bytes.subarray(0, 16), index); + return index + 16; +} +function serializeLong(buffer, key, value, index, isArray) { + // Write the type + buffer[index++] = + value._bsontype === 'Long' ? constants.BSON_DATA_LONG : constants.BSON_DATA_TIMESTAMP; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Write the date + var lowBits = value.getLowBits(); + var highBits = value.getHighBits(); + // Encode low bits + buffer[index++] = lowBits & 0xff; + buffer[index++] = (lowBits >> 8) & 0xff; + buffer[index++] = (lowBits >> 16) & 0xff; + buffer[index++] = (lowBits >> 24) & 0xff; + // Encode high bits + buffer[index++] = highBits & 0xff; + buffer[index++] = (highBits >> 8) & 0xff; + buffer[index++] = (highBits >> 16) & 0xff; + buffer[index++] = (highBits >> 24) & 0xff; + return index; +} +function serializeInt32(buffer, key, value, index, isArray) { + value = value.valueOf(); + // Set int type 32 bits or less + buffer[index++] = constants.BSON_DATA_INT; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Write the int value + buffer[index++] = value & 0xff; + buffer[index++] = (value >> 8) & 0xff; + buffer[index++] = (value >> 16) & 0xff; + buffer[index++] = (value >> 24) & 0xff; + return index; +} +function serializeDouble(buffer, key, value, index, isArray) { + // Encode as double + buffer[index++] = constants.BSON_DATA_NUMBER; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Write float + float_parser_1.writeIEEE754(buffer, value.value, index, 'little', 52, 8); + // Adjust index + index = index + 8; + return index; +} +function serializeFunction(buffer, key, value, index, _checkKeys, _depth, isArray) { + if (_checkKeys === void 0) { _checkKeys = false; } + if (_depth === void 0) { _depth = 0; } + buffer[index++] = constants.BSON_DATA_CODE; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Function string + var functionString = utils_1.normalizedFunctionString(value); + // Write the string + var size = buffer.write(functionString, index + 4, undefined, 'utf8') + 1; + // Write the size of the string to buffer + buffer[index] = size & 0xff; + buffer[index + 1] = (size >> 8) & 0xff; + buffer[index + 2] = (size >> 16) & 0xff; + buffer[index + 3] = (size >> 24) & 0xff; + // Update index + index = index + 4 + size - 1; + // Write zero + buffer[index++] = 0; + return index; +} +function serializeCode(buffer, key, value, index, checkKeys, depth, serializeFunctions, ignoreUndefined, isArray) { + if (checkKeys === void 0) { checkKeys = false; } + if (depth === void 0) { depth = 0; } + if (serializeFunctions === void 0) { serializeFunctions = false; } + if (ignoreUndefined === void 0) { ignoreUndefined = true; } + if (isArray === void 0) { isArray = false; } + if (value.scope && typeof value.scope === 'object') { + // Write the type + buffer[index++] = constants.BSON_DATA_CODE_W_SCOPE; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Starting index + var startIndex = index; + // Serialize the function + // Get the function string + var functionString = typeof value.code === 'string' ? value.code : value.code.toString(); + // Index adjustment + index = index + 4; + // Write string into buffer + var codeSize = buffer.write(functionString, index + 4, undefined, 'utf8') + 1; + // Write the size of the string to buffer + buffer[index] = codeSize & 0xff; + buffer[index + 1] = (codeSize >> 8) & 0xff; + buffer[index + 2] = (codeSize >> 16) & 0xff; + buffer[index + 3] = (codeSize >> 24) & 0xff; + // Write end 0 + buffer[index + 4 + codeSize - 1] = 0; + // Write the + index = index + codeSize + 4; + // + // Serialize the scope value + var endIndex = serializeInto(buffer, value.scope, checkKeys, index, depth + 1, serializeFunctions, ignoreUndefined); + index = endIndex - 1; + // Writ the total + var totalSize = endIndex - startIndex; + // Write the total size of the object + buffer[startIndex++] = totalSize & 0xff; + buffer[startIndex++] = (totalSize >> 8) & 0xff; + buffer[startIndex++] = (totalSize >> 16) & 0xff; + buffer[startIndex++] = (totalSize >> 24) & 0xff; + // Write trailing zero + buffer[index++] = 0; + } + else { + buffer[index++] = constants.BSON_DATA_CODE; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Function string + var functionString = value.code.toString(); + // Write the string + var size = buffer.write(functionString, index + 4, undefined, 'utf8') + 1; + // Write the size of the string to buffer + buffer[index] = size & 0xff; + buffer[index + 1] = (size >> 8) & 0xff; + buffer[index + 2] = (size >> 16) & 0xff; + buffer[index + 3] = (size >> 24) & 0xff; + // Update index + index = index + 4 + size - 1; + // Write zero + buffer[index++] = 0; + } + return index; +} +function serializeBinary(buffer, key, value, index, isArray) { + // Write the type + buffer[index++] = constants.BSON_DATA_BINARY; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Extract the buffer + var data = value.value(true); + // Calculate size + var size = value.position; + // Add the deprecated 02 type 4 bytes of size to total + if (value.sub_type === binary_1.Binary.SUBTYPE_BYTE_ARRAY) + size = size + 4; + // Write the size of the string to buffer + buffer[index++] = size & 0xff; + buffer[index++] = (size >> 8) & 0xff; + buffer[index++] = (size >> 16) & 0xff; + buffer[index++] = (size >> 24) & 0xff; + // Write the subtype to the buffer + buffer[index++] = value.sub_type; + // If we have binary type 2 the 4 first bytes are the size + if (value.sub_type === binary_1.Binary.SUBTYPE_BYTE_ARRAY) { + size = size - 4; + buffer[index++] = size & 0xff; + buffer[index++] = (size >> 8) & 0xff; + buffer[index++] = (size >> 16) & 0xff; + buffer[index++] = (size >> 24) & 0xff; + } + // Write the data to the object + buffer.set(data, index); + // Adjust the index + index = index + value.position; + return index; +} +function serializeSymbol(buffer, key, value, index, isArray) { + // Write the type + buffer[index++] = constants.BSON_DATA_SYMBOL; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Write the string + var size = buffer.write(value.value, index + 4, undefined, 'utf8') + 1; + // Write the size of the string to buffer + buffer[index] = size & 0xff; + buffer[index + 1] = (size >> 8) & 0xff; + buffer[index + 2] = (size >> 16) & 0xff; + buffer[index + 3] = (size >> 24) & 0xff; + // Update index + index = index + 4 + size - 1; + // Write zero + buffer[index++] = 0x00; + return index; +} +function serializeDBRef(buffer, key, value, index, depth, serializeFunctions, isArray) { + // Write the type + buffer[index++] = constants.BSON_DATA_OBJECT; + // Number of written bytes + var numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + var startIndex = index; + var output = { + $ref: value.collection || value.namespace, + $id: value.oid + }; + if (value.db != null) { + output.$db = value.db; + } + output = Object.assign(output, value.fields); + var endIndex = serializeInto(buffer, output, false, index, depth + 1, serializeFunctions); + // Calculate object size + var size = endIndex - startIndex; + // Write the size + buffer[startIndex++] = size & 0xff; + buffer[startIndex++] = (size >> 8) & 0xff; + buffer[startIndex++] = (size >> 16) & 0xff; + buffer[startIndex++] = (size >> 24) & 0xff; + // Set index + return endIndex; +} +function serializeInto(buffer, object, checkKeys, startingIndex, depth, serializeFunctions, ignoreUndefined, path) { + if (checkKeys === void 0) { checkKeys = false; } + if (startingIndex === void 0) { startingIndex = 0; } + if (depth === void 0) { depth = 0; } + if (serializeFunctions === void 0) { serializeFunctions = false; } + if (ignoreUndefined === void 0) { ignoreUndefined = true; } + if (path === void 0) { path = []; } + startingIndex = startingIndex || 0; + path = path || []; + // Push the object to the path + path.push(object); + // Start place to serialize into + var index = startingIndex + 4; + // Special case isArray + if (Array.isArray(object)) { + // Get object keys + for (var i = 0; i < object.length; i++) { + var key = '' + i; + var value = object[i]; + // Is there an override value + if (typeof (value === null || value === void 0 ? void 0 : value.toBSON) === 'function') { + value = value.toBSON(); + } + if (typeof value === 'string') { + index = serializeString(buffer, key, value, index, true); + } + else if (typeof value === 'number') { + index = serializeNumber(buffer, key, value, index, true); + } + else if (typeof value === 'bigint') { + throw new error_1.BSONTypeError('Unsupported type BigInt, please use Decimal128'); + } + else if (typeof value === 'boolean') { + index = serializeBoolean(buffer, key, value, index, true); + } + else if (value instanceof Date || utils_1.isDate(value)) { + index = serializeDate(buffer, key, value, index, true); + } + else if (value === undefined) { + index = serializeNull(buffer, key, value, index, true); + } + else if (value === null) { + index = serializeNull(buffer, key, value, index, true); + } + else if (value['_bsontype'] === 'ObjectId' || value['_bsontype'] === 'ObjectID') { + index = serializeObjectId(buffer, key, value, index, true); + } + else if (utils_1.isUint8Array(value)) { + index = serializeBuffer(buffer, key, value, index, true); + } + else if (value instanceof RegExp || utils_1.isRegExp(value)) { + index = serializeRegExp(buffer, key, value, index, true); + } + else if (typeof value === 'object' && value['_bsontype'] == null) { + index = serializeObject(buffer, key, value, index, checkKeys, depth, serializeFunctions, ignoreUndefined, true, path); + } + else if (typeof value === 'object' && + extended_json_1.isBSONType(value) && + value._bsontype === 'Decimal128') { + index = serializeDecimal128(buffer, key, value, index, true); + } + else if (value['_bsontype'] === 'Long' || value['_bsontype'] === 'Timestamp') { + index = serializeLong(buffer, key, value, index, true); + } + else if (value['_bsontype'] === 'Double') { + index = serializeDouble(buffer, key, value, index, true); + } + else if (typeof value === 'function' && serializeFunctions) { + index = serializeFunction(buffer, key, value, index, checkKeys, depth, true); + } + else if (value['_bsontype'] === 'Code') { + index = serializeCode(buffer, key, value, index, checkKeys, depth, serializeFunctions, ignoreUndefined, true); + } + else if (value['_bsontype'] === 'Binary') { + index = serializeBinary(buffer, key, value, index, true); + } + else if (value['_bsontype'] === 'Symbol') { + index = serializeSymbol(buffer, key, value, index, true); + } + else if (value['_bsontype'] === 'DBRef') { + index = serializeDBRef(buffer, key, value, index, depth, serializeFunctions, true); + } + else if (value['_bsontype'] === 'BSONRegExp') { + index = serializeBSONRegExp(buffer, key, value, index, true); + } + else if (value['_bsontype'] === 'Int32') { + index = serializeInt32(buffer, key, value, index, true); + } + else if (value['_bsontype'] === 'MinKey' || value['_bsontype'] === 'MaxKey') { + index = serializeMinMax(buffer, key, value, index, true); + } + else if (typeof value['_bsontype'] !== 'undefined') { + throw new error_1.BSONTypeError('Unrecognized or invalid _bsontype: ' + value['_bsontype']); + } + } + } + else if (object instanceof map_1.Map || utils_1.isMap(object)) { + var iterator = object.entries(); + var done = false; + while (!done) { + // Unpack the next entry + var entry = iterator.next(); + done = !!entry.done; + // Are we done, then skip and terminate + if (done) + continue; + // Get the entry values + var key = entry.value[0]; + var value = entry.value[1]; + // Check the type of the value + var type = typeof value; + // Check the key and throw error if it's illegal + if (typeof key === 'string' && !ignoreKeys.has(key)) { + if (key.match(regexp) != null) { + // The BSON spec doesn't allow keys with null bytes because keys are + // null-terminated. + throw Error('key ' + key + ' must not contain null bytes'); + } + if (checkKeys) { + if ('$' === key[0]) { + throw Error('key ' + key + " must not start with '$'"); + } + else if (~key.indexOf('.')) { + throw Error('key ' + key + " must not contain '.'"); + } + } + } + if (type === 'string') { + index = serializeString(buffer, key, value, index); + } + else if (type === 'number') { + index = serializeNumber(buffer, key, value, index); + } + else if (type === 'bigint' || utils_1.isBigInt64Array(value) || utils_1.isBigUInt64Array(value)) { + throw new error_1.BSONTypeError('Unsupported type BigInt, please use Decimal128'); + } + else if (type === 'boolean') { + index = serializeBoolean(buffer, key, value, index); + } + else if (value instanceof Date || utils_1.isDate(value)) { + index = serializeDate(buffer, key, value, index); + } + else if (value === null || (value === undefined && ignoreUndefined === false)) { + index = serializeNull(buffer, key, value, index); + } + else if (value['_bsontype'] === 'ObjectId' || value['_bsontype'] === 'ObjectID') { + index = serializeObjectId(buffer, key, value, index); + } + else if (utils_1.isUint8Array(value)) { + index = serializeBuffer(buffer, key, value, index); + } + else if (value instanceof RegExp || utils_1.isRegExp(value)) { + index = serializeRegExp(buffer, key, value, index); + } + else if (type === 'object' && value['_bsontype'] == null) { + index = serializeObject(buffer, key, value, index, checkKeys, depth, serializeFunctions, ignoreUndefined, false, path); + } + else if (type === 'object' && value['_bsontype'] === 'Decimal128') { + index = serializeDecimal128(buffer, key, value, index); + } + else if (value['_bsontype'] === 'Long' || value['_bsontype'] === 'Timestamp') { + index = serializeLong(buffer, key, value, index); + } + else if (value['_bsontype'] === 'Double') { + index = serializeDouble(buffer, key, value, index); + } + else if (value['_bsontype'] === 'Code') { + index = serializeCode(buffer, key, value, index, checkKeys, depth, serializeFunctions, ignoreUndefined); + } + else if (typeof value === 'function' && serializeFunctions) { + index = serializeFunction(buffer, key, value, index, checkKeys, depth, serializeFunctions); + } + else if (value['_bsontype'] === 'Binary') { + index = serializeBinary(buffer, key, value, index); + } + else if (value['_bsontype'] === 'Symbol') { + index = serializeSymbol(buffer, key, value, index); + } + else if (value['_bsontype'] === 'DBRef') { + index = serializeDBRef(buffer, key, value, index, depth, serializeFunctions); + } + else if (value['_bsontype'] === 'BSONRegExp') { + index = serializeBSONRegExp(buffer, key, value, index); + } + else if (value['_bsontype'] === 'Int32') { + index = serializeInt32(buffer, key, value, index); + } + else if (value['_bsontype'] === 'MinKey' || value['_bsontype'] === 'MaxKey') { + index = serializeMinMax(buffer, key, value, index); + } + else if (typeof value['_bsontype'] !== 'undefined') { + throw new error_1.BSONTypeError('Unrecognized or invalid _bsontype: ' + value['_bsontype']); + } + } + } + else { + if (typeof (object === null || object === void 0 ? void 0 : object.toBSON) === 'function') { + // Provided a custom serialization method + object = object.toBSON(); + if (object != null && typeof object !== 'object') { + throw new error_1.BSONTypeError('toBSON function did not return an object'); + } + } + // Iterate over all the keys + for (var key in object) { + var value = object[key]; + // Is there an override value + if (typeof (value === null || value === void 0 ? void 0 : value.toBSON) === 'function') { + value = value.toBSON(); + } + // Check the type of the value + var type = typeof value; + // Check the key and throw error if it's illegal + if (typeof key === 'string' && !ignoreKeys.has(key)) { + if (key.match(regexp) != null) { + // The BSON spec doesn't allow keys with null bytes because keys are + // null-terminated. + throw Error('key ' + key + ' must not contain null bytes'); + } + if (checkKeys) { + if ('$' === key[0]) { + throw Error('key ' + key + " must not start with '$'"); + } + else if (~key.indexOf('.')) { + throw Error('key ' + key + " must not contain '.'"); + } + } + } + if (type === 'string') { + index = serializeString(buffer, key, value, index); + } + else if (type === 'number') { + index = serializeNumber(buffer, key, value, index); + } + else if (type === 'bigint') { + throw new error_1.BSONTypeError('Unsupported type BigInt, please use Decimal128'); + } + else if (type === 'boolean') { + index = serializeBoolean(buffer, key, value, index); + } + else if (value instanceof Date || utils_1.isDate(value)) { + index = serializeDate(buffer, key, value, index); + } + else if (value === undefined) { + if (ignoreUndefined === false) + index = serializeNull(buffer, key, value, index); + } + else if (value === null) { + index = serializeNull(buffer, key, value, index); + } + else if (value['_bsontype'] === 'ObjectId' || value['_bsontype'] === 'ObjectID') { + index = serializeObjectId(buffer, key, value, index); + } + else if (utils_1.isUint8Array(value)) { + index = serializeBuffer(buffer, key, value, index); + } + else if (value instanceof RegExp || utils_1.isRegExp(value)) { + index = serializeRegExp(buffer, key, value, index); + } + else if (type === 'object' && value['_bsontype'] == null) { + index = serializeObject(buffer, key, value, index, checkKeys, depth, serializeFunctions, ignoreUndefined, false, path); + } + else if (type === 'object' && value['_bsontype'] === 'Decimal128') { + index = serializeDecimal128(buffer, key, value, index); + } + else if (value['_bsontype'] === 'Long' || value['_bsontype'] === 'Timestamp') { + index = serializeLong(buffer, key, value, index); + } + else if (value['_bsontype'] === 'Double') { + index = serializeDouble(buffer, key, value, index); + } + else if (value['_bsontype'] === 'Code') { + index = serializeCode(buffer, key, value, index, checkKeys, depth, serializeFunctions, ignoreUndefined); + } + else if (typeof value === 'function' && serializeFunctions) { + index = serializeFunction(buffer, key, value, index, checkKeys, depth, serializeFunctions); + } + else if (value['_bsontype'] === 'Binary') { + index = serializeBinary(buffer, key, value, index); + } + else if (value['_bsontype'] === 'Symbol') { + index = serializeSymbol(buffer, key, value, index); + } + else if (value['_bsontype'] === 'DBRef') { + index = serializeDBRef(buffer, key, value, index, depth, serializeFunctions); + } + else if (value['_bsontype'] === 'BSONRegExp') { + index = serializeBSONRegExp(buffer, key, value, index); + } + else if (value['_bsontype'] === 'Int32') { + index = serializeInt32(buffer, key, value, index); + } + else if (value['_bsontype'] === 'MinKey' || value['_bsontype'] === 'MaxKey') { + index = serializeMinMax(buffer, key, value, index); + } + else if (typeof value['_bsontype'] !== 'undefined') { + throw new error_1.BSONTypeError('Unrecognized or invalid _bsontype: ' + value['_bsontype']); + } + } + } + // Remove the path + path.pop(); + // Final padding byte for object + buffer[index++] = 0x00; + // Final size + var size = index - startingIndex; + // Write the size of the object + buffer[startingIndex++] = size & 0xff; + buffer[startingIndex++] = (size >> 8) & 0xff; + buffer[startingIndex++] = (size >> 16) & 0xff; + buffer[startingIndex++] = (size >> 24) & 0xff; + return index; +} +exports.serializeInto = serializeInto; +//# sourceMappingURL=serializer.js.map \ No newline at end of file diff --git a/node_modules/bson/lib/parser/serializer.js.map b/node_modules/bson/lib/parser/serializer.js.map new file mode 100644 index 000000000..2aa0f2285 --- /dev/null +++ b/node_modules/bson/lib/parser/serializer.js.map @@ -0,0 +1 @@ +{"version":3,"file":"serializer.js","sourceRoot":"","sources":["../../src/parser/serializer.ts"],"names":[],"mappings":";;;AACA,oCAAmC;AAGnC,wCAA0C;AAI1C,kDAAgD;AAChD,kCAAoD;AACpD,kDAA8C;AAC9C,gDAA+C;AAE/C,gCAA+B;AAC/B,8BAA6B;AAI7B,iCAQiB;AAgBjB,IAAM,MAAM,GAAG,MAAM,CAAC,CAAC,uCAAuC;AAC9D,IAAM,UAAU,GAAG,IAAI,GAAG,CAAC,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,cAAc,CAAC,CAAC,CAAC;AAEnE;;;;GAIG;AAEH,SAAS,eAAe,CACtB,MAAc,EACd,GAAW,EACX,KAAa,EACb,KAAa,EACb,OAAiB;IAEjB,qBAAqB;IACrB,MAAM,CAAC,KAAK,EAAE,CAAC,GAAG,SAAS,CAAC,gBAAgB,CAAC;IAC7C,0BAA0B;IAC1B,IAAM,oBAAoB,GAAG,CAAC,OAAO;QACnC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,CAAC;QAC7C,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,EAAE,KAAK,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC;IACjD,kBAAkB;IAClB,KAAK,GAAG,KAAK,GAAG,oBAAoB,GAAG,CAAC,CAAC;IACzC,MAAM,CAAC,KAAK,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC;IACtB,mBAAmB;IACnB,IAAM,IAAI,GAAG,MAAM,CAAC,KAAK,CAAC,KAAK,EAAE,KAAK,GAAG,CAAC,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC;IAC/D,yCAAyC;IAC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AK,EAAE,KAAK,CAAC,CAAC;aACxD;iBAAM,IAAI,KAAK,CAAC,WAAW,CAAC,KAAK,OAAO,EAAE;gBACzC,KAAK,GAAG,cAAc,CAAC,MAAM,EAAE,GAAG,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;aACnD;iBAAM,IAAI,KAAK,CAAC,WAAW,CAAC,KAAK,QAAQ,IAAI,KAAK,CAAC,WAAW,CAAC,KAAK,QAAQ,EAAE;gBAC7E,KAAK,GAAG,eAAe,CAAC,MAAM,EAAE,GAAG,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;aACpD;iBAAM,IAAI,OAAO,KAAK,CAAC,WAAW,CAAC,KAAK,WAAW,EAAE;gBACpD,MAAM,IAAI,qBAAa,CAAC,qCAAqC,GAAG,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC;aACrF;SACF;KACF;IAED,kBAAkB;IAClB,IAAI,CAAC,GAAG,EAAE,CAAC;IAEX,gCAAgC;IAChC,MAAM,CAAC,KAAK,EAAE,CAAC,GAAG,IAAI,CAAC;IAEvB,aAAa;IACb,IAAM,IAAI,GAAG,KAAK,GAAG,aAAa,CAAC;IACnC,+BAA+B;IAC/B,MAAM,CAAC,aAAa,EAAE,CAAC,GAAG,IAAI,GAAG,IAAI,CAAC;IACtC,MAAM,CAAC,aAAa,EAAE,CAAC,GAAG,CAAC,IAAI,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC;IAC7C,MAAM,CAAC,aAAa,EAAE,CAAC,GAAG,CAAC,IAAI,IAAI,EAAE,CAAC,GAAG,IAAI,CAAC;IAC9C,MAAM,CAAC,aAAa,EAAE,CAAC,GAAG,CAAC,IAAI,IAAI,EAAE,CAAC,GAAG,IAAI,CAAC;IAC9C,OAAO,KAAK,CAAC;AACf,CAAC;AAtUD,sCAsUC"} \ No newline at end of file diff --git a/node_modules/bson/lib/parser/utils.js b/node_modules/bson/lib/parser/utils.js new file mode 100644 index 000000000..88817ec49 --- /dev/null +++ b/node_modules/bson/lib/parser/utils.js @@ -0,0 +1,111 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.deprecate = exports.isObjectLike = exports.isDate = exports.haveBuffer = exports.isMap = exports.isRegExp = exports.isBigUInt64Array = exports.isBigInt64Array = exports.isUint8Array = exports.isAnyArrayBuffer = exports.randomBytes = exports.normalizedFunctionString = void 0; +var buffer_1 = require("buffer"); +var global_1 = require("../utils/global"); +/** + * Normalizes our expected stringified form of a function across versions of node + * @param fn - The function to stringify + */ +function normalizedFunctionString(fn) { + return fn.toString().replace('function(', 'function ('); +} +exports.normalizedFunctionString = normalizedFunctionString; +function isReactNative() { + var g = global_1.getGlobal(); + return typeof g.navigator === 'object' && g.navigator.product === 'ReactNative'; +} +var insecureRandomBytes = function insecureRandomBytes(size) { + var insecureWarning = isReactNative() + ? 'BSON: For React Native please polyfill crypto.getRandomValues, e.g. using: https://www.npmjs.com/package/react-native-get-random-values.' + : 'BSON: No cryptographic implementation for random bytes present, falling back to a less secure implementation.'; + console.warn(insecureWarning); + var result = buffer_1.Buffer.alloc(size); + for (var i = 0; i < size; ++i) + result[i] = Math.floor(Math.random() * 256); + return result; +}; +var detectRandomBytes = function () { + if (typeof window !== 'undefined') { + // browser crypto implementation(s) + var target_1 = window.crypto || window.msCrypto; // allow for IE11 + if (target_1 && target_1.getRandomValues) { + return function (size) { return target_1.getRandomValues(buffer_1.Buffer.alloc(size)); }; + } + } + if (typeof global !== 'undefined' && global.crypto && global.crypto.getRandomValues) { + // allow for RN packages such as https://www.npmjs.com/package/react-native-get-random-values to populate global + return function (size) { return global.crypto.getRandomValues(buffer_1.Buffer.alloc(size)); }; + } + var requiredRandomBytes; + try { + // eslint-disable-next-line @typescript-eslint/no-var-requires + requiredRandomBytes = require('crypto').randomBytes; + } + catch (e) { + // keep the fallback + } + // NOTE: in transpiled cases the above require might return null/undefined + return requiredRandomBytes || insecureRandomBytes; +}; +exports.randomBytes = detectRandomBytes(); +function isAnyArrayBuffer(value) { + return ['[object ArrayBuffer]', '[object SharedArrayBuffer]'].includes(Object.prototype.toString.call(value)); +} +exports.isAnyArrayBuffer = isAnyArrayBuffer; +function isUint8Array(value) { + return Object.prototype.toString.call(value) === '[object Uint8Array]'; +} +exports.isUint8Array = isUint8Array; +function isBigInt64Array(value) { + return Object.prototype.toString.call(value) === '[object BigInt64Array]'; +} +exports.isBigInt64Array = isBigInt64Array; +function isBigUInt64Array(value) { + return Object.prototype.toString.call(value) === '[object BigUint64Array]'; +} +exports.isBigUInt64Array = isBigUInt64Array; +function isRegExp(d) { + return Object.prototype.toString.call(d) === '[object RegExp]'; +} +exports.isRegExp = isRegExp; +function isMap(d) { + return Object.prototype.toString.call(d) === '[object Map]'; +} +exports.isMap = isMap; +/** Call to check if your environment has `Buffer` */ +function haveBuffer() { + return typeof global !== 'undefined' && typeof global.Buffer !== 'undefined'; +} +exports.haveBuffer = haveBuffer; +// To ensure that 0.4 of node works correctly +function isDate(d) { + return isObjectLike(d) && Object.prototype.toString.call(d) === '[object Date]'; +} +exports.isDate = isDate; +/** + * @internal + * this is to solve the `'someKey' in x` problem where x is unknown. + * https://github.com/typescript-eslint/typescript-eslint/issues/1071#issuecomment-541955753 + */ +function isObjectLike(candidate) { + return typeof candidate === 'object' && candidate !== null; +} +exports.isObjectLike = isObjectLike; +function deprecate(fn, message) { + var warned = false; + function deprecated() { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + if (!warned) { + console.warn(message); + warned = true; + } + return fn.apply(this, args); + } + return deprecated; +} +exports.deprecate = deprecate; +//# sourceMappingURL=utils.js.map \ No newline at end of file diff --git a/node_modules/bson/lib/parser/utils.js.map b/node_modules/bson/lib/parser/utils.js.map new file mode 100644 index 000000000..caa7cec86 --- /dev/null +++ b/node_modules/bson/lib/parser/utils.js.map @@ -0,0 +1 @@ +{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/parser/utils.ts"],"names":[],"mappings":";;;AAAA,iCAAgC;AAChC,0CAA4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IAAI,CAAC,CAAC,CAAC,KAAK,iBAAiB,CAAC;AACjE,CAAC;AAFD,4BAEC;AAED,SAAgB,KAAK,CAAC,CAAU;IAC9B,OAAO,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,cAAc,CAAC;AAC9D,CAAC;AAFD,sBAEC;AAED,qDAAqD;AACrD,SAAgB,UAAU;IACxB,OAAO,OAAO,MAAM,KAAK,WAAW,IAAI,OAAO,MAAM,CAAC,MAAM,KAAK,WAAW,CAAC;AAC/E,CAAC;AAFD,gCAEC;AAED,6CAA6C;AAC7C,SAAgB,MAAM,CAAC,CAAU;IAC/B,OAAO,YAAY,CAAC,CAAC,CAAC,IAAI,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,eAAe,CAAC;AAClF,CAAC;AAFD,wBAEC;AAED;;;;GAIG;AACH,SAAgB,YAAY,CAAC,SAAkB;IAC7C,OAAO,OAAO,SAAS,KAAK,QAAQ,IAAI,SAAS,KAAK,IAAI,CAAC;AAC7D,CAAC;AAFD,oCAEC;AAGD,SAAgB,SAAS,CAAqB,EAAK,EAAE,OAAe;IAClE,IAAI,MAAM,GAAG,KAAK,CAAC;IACnB,SAAS,UAAU;QAAgB,cAAkB;aAAlB,UAAkB,EAAlB,qBAAkB,EAAlB,IAAkB;YAAlB,yBAAkB;;QACnD,IAAI,CAAC,MAAM,EAAE;YACX,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;YACtB,MAAM,GAAG,IAAI,CAAC;SACf;QACD,OAAO,EAAE,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IAC9B,CAAC;IACD,OAAO,UAA0B,CAAC;AACpC,CAAC;AAVD,8BAUC"} \ No newline at end of file diff --git a/node_modules/bson/lib/regexp.js b/node_modules/bson/lib/regexp.js new file mode 100644 index 000000000..87bf75752 --- /dev/null +++ b/node_modules/bson/lib/regexp.js @@ -0,0 +1,74 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.BSONRegExp = void 0; +var error_1 = require("./error"); +function alphabetize(str) { + return str.split('').sort().join(''); +} +/** + * A class representation of the BSON RegExp type. + * @public + * @category BSONType + */ +var BSONRegExp = /** @class */ (function () { + /** + * @param pattern - The regular expression pattern to match + * @param options - The regular expression options + */ + function BSONRegExp(pattern, options) { + if (!(this instanceof BSONRegExp)) + return new BSONRegExp(pattern, options); + this.pattern = pattern; + this.options = alphabetize(options !== null && options !== void 0 ? options : ''); + if (this.pattern.indexOf('\x00') !== -1) { + throw new error_1.BSONError("BSON Regex patterns cannot contain null bytes, found: " + JSON.stringify(this.pattern)); + } + if (this.options.indexOf('\x00') !== -1) { + throw new error_1.BSONError("BSON Regex options cannot contain null bytes, found: " + JSON.stringify(this.options)); + } + // Validate options + for (var i = 0; i < this.options.length; i++) { + if (!(this.options[i] === 'i' || + this.options[i] === 'm' || + this.options[i] === 'x' || + this.options[i] === 'l' || + this.options[i] === 's' || + this.options[i] === 'u')) { + throw new error_1.BSONError("The regular expression option [" + this.options[i] + "] is not supported"); + } + } + } + BSONRegExp.parseOptions = function (options) { + return options ? options.split('').sort().join('') : ''; + }; + /** @internal */ + BSONRegExp.prototype.toExtendedJSON = function (options) { + options = options || {}; + if (options.legacy) { + return { $regex: this.pattern, $options: this.options }; + } + return { $regularExpression: { pattern: this.pattern, options: this.options } }; + }; + /** @internal */ + BSONRegExp.fromExtendedJSON = function (doc) { + if ('$regex' in doc) { + if (typeof doc.$regex !== 'string') { + // This is for $regex query operators that have extended json values. + if (doc.$regex._bsontype === 'BSONRegExp') { + return doc; + } + } + else { + return new BSONRegExp(doc.$regex, BSONRegExp.parseOptions(doc.$options)); + } + } + if ('$regularExpression' in doc) { + return new BSONRegExp(doc.$regularExpression.pattern, BSONRegExp.parseOptions(doc.$regularExpression.options)); + } + throw new error_1.BSONTypeError("Unexpected BSONRegExp EJSON object form: " + JSON.stringify(doc)); + }; + return BSONRegExp; +}()); +exports.BSONRegExp = BSONRegExp; +Object.defineProperty(BSONRegExp.prototype, '_bsontype', { value: 'BSONRegExp' }); +//# sourceMappingURL=regexp.js.map \ No newline at end of file diff --git a/node_modules/bson/lib/regexp.js.map b/node_modules/bson/lib/regexp.js.map new file mode 100644 index 000000000..4ed2cf42e --- /dev/null +++ b/node_modules/bson/lib/regexp.js.map @@ -0,0 +1 @@ +{"version":3,"file":"regexp.js","sourceRoot":"","sources":["../src/regexp.ts"],"names":[],"mappings":";;;AAAA,iCAAmD;AAGnD,SAAS,WAAW,CAAC,GAAW;IAC9B,OAAO,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACvC,CAAC;AAgBD;;;;GAIG;AACH;IAKE;;;OAGG;IACH,oBAAY,OAAe,EAAE,OAAgB;QAC3C,IAAI,CAAC,CAAC,IAAI,YAAY,UAAU,CAAC;YAAE,OAAO,IAAI,UAAU,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QAE3E,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,OAAO,GAAG,WAAW,CAAC,OAAO,aAAP,OAAO,cAAP,OAAO,GAAI,EAAE,CAAC,CAAC;QAE1C,IAAI,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE;YACvC,MAAM,IAAI,iBAAS,CACjB,2DAAyD,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAG,CACxF,CAAC;SACH;QACD,IAAI,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE;YACvC,MAAM,IAAI,iBAAS,CACjB,0DAAwD,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAG,CACvF,CAAC;SACH;QAED,mBAAmB;QACnB,KAAK,IAAI,CAAC,GAAG,CAAC,EAA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,QAAQ,EAAE;gBAClC,qEAAqE;gBACrE,IAAI,GAAG,CAAC,MAAM,CAAC,SAAS,KAAK,YAAY,EAAE;oBACzC,OAAO,GAA4B,CAAC;iBACrC;aACF;iBAAM;gBACL,OAAO,IAAI,UAAU,CAAC,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,YAAY,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC;aAC1E;SACF;QACD,IAAI,oBAAoB,IAAI,GAAG,EAAE;YAC/B,OAAO,IAAI,UAAU,CACnB,GAAG,CAAC,kBAAkB,CAAC,OAAO,EAC9B,UAAU,CAAC,YAAY,CAAC,GAAG,CAAC,kBAAkB,CAAC,OAAO,CAAC,CACxD,CAAC;SACH;QACD,MAAM,IAAI,qBAAa,CAAC,8CAA4C,IAAI,CAAC,SAAS,CAAC,GAAG,CAAG,CAAC,CAAC;IAC7F,CAAC;IACH,iBAAC;AAAD,CAAC,AA5ED,IA4EC;AA5EY,gCAAU;AA8EvB,MAAM,CAAC,cAAc,CAAC,UAAU,CAAC,SAAS,EAAE,WAAW,EAAE,EAAE,KAAK,EAAE,YAAY,EAAE,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/bson/lib/symbol.js b/node_modules/bson/lib/symbol.js new file mode 100644 index 000000000..6e1aebece --- /dev/null +++ b/node_modules/bson/lib/symbol.js @@ -0,0 +1,48 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.BSONSymbol = void 0; +/** + * A class representation of the BSON Symbol type. + * @public + * @category BSONType + */ +var BSONSymbol = /** @class */ (function () { + /** + * @param value - the string representing the symbol. + */ + function BSONSymbol(value) { + if (!(this instanceof BSONSymbol)) + return new BSONSymbol(value); + this.value = value; + } + /** Access the wrapped string value. */ + BSONSymbol.prototype.valueOf = function () { + return this.value; + }; + BSONSymbol.prototype.toString = function () { + return this.value; + }; + /** @internal */ + BSONSymbol.prototype.inspect = function () { + return "new BSONSymbol(\"" + this.value + "\")"; + }; + BSONSymbol.prototype.toJSON = function () { + return this.value; + }; + /** @internal */ + BSONSymbol.prototype.toExtendedJSON = function () { + return { $symbol: this.value }; + }; + /** @internal */ + BSONSymbol.fromExtendedJSON = function (doc) { + return new BSONSymbol(doc.$symbol); + }; + /** @internal */ + BSONSymbol.prototype[Symbol.for('nodejs.util.inspect.custom')] = function () { + return this.inspect(); + }; + return BSONSymbol; +}()); +exports.BSONSymbol = BSONSymbol; +Object.defineProperty(BSONSymbol.prototype, '_bsontype', { value: 'Symbol' }); +//# sourceMappingURL=symbol.js.map \ No newline at end of file diff --git a/node_modules/bson/lib/symbol.js.map b/node_modules/bson/lib/symbol.js.map new file mode 100644 index 000000000..ef866ce59 --- /dev/null +++ b/node_modules/bson/lib/symbol.js.map @@ -0,0 +1 @@ +{"version":3,"file":"symbol.js","sourceRoot":"","sources":["../src/symbol.ts"],"names":[],"mappings":";;;AAKA;;;;GAIG;AACH;IAIE;;OAEG;IACH,oBAAY,KAAa;QACvB,IAAI,CAAC,CAAC,IAAI,YAAY,UAAU,CAAC;YAAE,OAAO,IAAI,UAAU,CAAC,KAAK,CAAC,CAAC;QAEhE,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACrB,CAAC;IAED,uCAAuC;IACvC,4BAAO,GAAP;QACE,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC;IAED,6BAAQ,GAAR;QACE,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC;IAED,gBAAgB;IAChB,4BAAO,GAAP;QACE,OAAO,sBAAmB,IAAI,CAAC,KAAK,QAAI,CAAC;IAC3C,CAAC;IAED,2BAAM,GAAN;QACE,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC;IAED,gBAAgB;IAChB,mCAAc,GAAd;QACE,OAAO,EAAE,OAAO,EAAE,IAAI,CAAC,KAAK,EAAE,CAAC;IACjC,CAAC;IAED,gBAAgB;IACT,2BAAgB,GAAvB,UAAwB,GAAuB;QAC7C,OAAO,IAAI,UAAU,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IACrC,CAAC;IAED,gBAAgB;IAChB,qBAAC,MAAM,CAAC,GAAG,CAAC,4BAA4B,CAAC,CAAC,GAA1C;QACE,OAAO,IAAI,CAAC,OAAO,EAAE,CAAC;IACxB,CAAC;IACH,iBAAC;AAAD,CAAC,AA7CD,IA6CC;AA7CY,gCAAU;AA+CvB,MAAM,CAAC,cAAc,CAAC,UAAU,CAAC,SAAS,EAAE,WAAW,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/bson/lib/timestamp.js b/node_modules/bson/lib/timestamp.js new file mode 100644 index 000000000..83320c2fd --- /dev/null +++ b/node_modules/bson/lib/timestamp.js @@ -0,0 +1,102 @@ +"use strict"; +var __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Timestamp = exports.LongWithoutOverridesClass = void 0; +var long_1 = require("./long"); +var utils_1 = require("./parser/utils"); +/** @public */ +exports.LongWithoutOverridesClass = long_1.Long; +/** + * @public + * @category BSONType + * */ +var Timestamp = /** @class */ (function (_super) { + __extends(Timestamp, _super); + function Timestamp(low, high) { + var _this = this; + // eslint-disable-next-line @typescript-eslint/ban-ts-comment + ///@ts-expect-error + if (!(_this instanceof Timestamp)) + return new Timestamp(low, high); + if (long_1.Long.isLong(low)) { + _this = _super.call(this, low.low, low.high, true) || this; + } + else if (utils_1.isObjectLike(low) && typeof low.t !== 'undefined' && typeof low.i !== 'undefined') { + _this = _super.call(this, low.i, low.t, true) || this; + } + else { + _this = _super.call(this, low, high, true) || this; + } + Object.defineProperty(_this, '_bsontype', { + value: 'Timestamp', + writable: false, + configurable: false, + enumerable: false + }); + return _this; + } + Timestamp.prototype.toJSON = function () { + return { + $timestamp: this.toString() + }; + }; + /** Returns a Timestamp represented by the given (32-bit) integer value. */ + Timestamp.fromInt = function (value) { + return new Timestamp(long_1.Long.fromInt(value, true)); + }; + /** Returns a Timestamp representing the given number value, provided that it is a finite number. Otherwise, zero is returned. */ + Timestamp.fromNumber = function (value) { + return new Timestamp(long_1.Long.fromNumber(value, true)); + }; + /** + * Returns a Timestamp for the given high and low bits. Each is assumed to use 32 bits. + * + * @param lowBits - the low 32-bits. + * @param highBits - the high 32-bits. + */ + Timestamp.fromBits = function (lowBits, highBits) { + return new Timestamp(lowBits, highBits); + }; + /** + * Returns a Timestamp from the given string, optionally using the given radix. + * + * @param str - the textual representation of the Timestamp. + * @param optRadix - the radix in which the text is written. + */ + Timestamp.fromString = function (str, optRadix) { + return new Timestamp(long_1.Long.fromString(str, true, optRadix)); + }; + /** @internal */ + Timestamp.prototype.toExtendedJSON = function () { + return { $timestamp: { t: this.high >>> 0, i: this.low >>> 0 } }; + }; + /** @internal */ + Timestamp.fromExtendedJSON = function (doc) { + return new Timestamp(doc.$timestamp); + }; + /** @internal */ + Timestamp.prototype[Symbol.for('nodejs.util.inspect.custom')] = function () { + return this.inspect(); + }; + Timestamp.prototype.inspect = function () { + return "new Timestamp({ t: " + this.getHighBits() + ", i: " + this.getLowBits() + " })"; + }; + Timestamp.MAX_VALUE = long_1.Long.MAX_UNSIGNED_VALUE; + return Timestamp; +}(exports.LongWithoutOverridesClass)); +exports.Timestamp = Timestamp; +//# sourceMappingURL=timestamp.js.map \ No newline at end of file diff --git a/node_modules/bson/lib/timestamp.js.map b/node_modules/bson/lib/timestamp.js.map new file mode 100644 index 000000000..af5d211c7 --- /dev/null +++ b/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/lib/utils/global.js b/node_modules/bson/lib/utils/global.js new file mode 100644 index 000000000..30218ea40 --- /dev/null +++ b/node_modules/bson/lib/utils/global.js @@ -0,0 +1,18 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getGlobal = void 0; +function checkForMath(potentialGlobal) { + // eslint-disable-next-line eqeqeq + return potentialGlobal && potentialGlobal.Math == Math && potentialGlobal; +} +// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028 +function getGlobal() { + // eslint-disable-next-line no-undef + return (checkForMath(typeof globalThis === 'object' && globalThis) || + checkForMath(typeof window === 'object' && window) || + checkForMath(typeof self === 'object' && self) || + checkForMath(typeof global === 'object' && global) || + Function('return this')()); +} +exports.getGlobal = getGlobal; +//# sourceMappingURL=global.js.map \ No newline at end of file diff --git a/node_modules/bson/lib/utils/global.js.map b/node_modules/bson/lib/utils/global.js.map new file mode 100644 index 000000000..ebd51ab59 --- /dev/null +++ b/node_modules/bson/lib/utils/global.js.map @@ -0,0 +1 @@ +{"version":3,"file":"global.js","sourceRoot":"","sources":["../../src/utils/global.ts"],"names":[],"mappings":";;;AAMA,SAAS,YAAY,CAAC,eAAoB;IACxC,kCAAkC;IAClC,OAAO,eAAe,IAAI,eAAe,CAAC,IAAI,IAAI,IAAI,IAAI,eAAe,CAAC;AAC5E,CAAC;AAED,uEAAuE;AACvE,SAAgB,SAAS;IACvB,oCAAoC;IACpC,OAAO,CACL,YAAY,CAAC,OAAO,UAAU,KAAK,QAAQ,IAAI,UAAU,CAAC;QAC1D,YAAY,CAAC,OAAO,MAAM,KAAK,QAAQ,IAAI,MAAM,CAAC;QAClD,YAAY,CAAC,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,CAAC;QAC9C,YAAY,CAAC,OAAO,MAAM,KAAK,QAAQ,IAAI,MAAM,CAAC;QAClD,QAAQ,CAAC,aAAa,CAAC,EAAE,CAC1B,CAAC;AACJ,CAAC;AATD,8BASC"} \ No newline at end of file diff --git a/node_modules/bson/lib/uuid.js b/node_modules/bson/lib/uuid.js new file mode 100644 index 000000000..bd0bf38bf --- /dev/null +++ b/node_modules/bson/lib/uuid.js @@ -0,0 +1,179 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.UUID = void 0; +var buffer_1 = require("buffer"); +var ensure_buffer_1 = require("./ensure_buffer"); +var binary_1 = require("./binary"); +var uuid_utils_1 = require("./uuid_utils"); +var utils_1 = require("./parser/utils"); +var error_1 = require("./error"); +var BYTE_LENGTH = 16; +var kId = Symbol('id'); +/** + * A class representation of the BSON UUID type. + * @public + */ +var UUID = /** @class */ (function () { + /** + * Create an UUID type + * + * @param input - Can be a 32 or 36 character hex string (dashes excluded/included) or a 16 byte binary Buffer. + */ + function UUID(input) { + if (typeof input === 'undefined') { + // The most common use case (blank id, new UUID() instance) + this.id = UUID.generate(); + } + else if (input instanceof UUID) { + this[kId] = buffer_1.Buffer.from(input.id); + this.__id = input.__id; + } + else if (ArrayBuffer.isView(input) && input.byteLength === BYTE_LENGTH) { + this.id = ensure_buffer_1.ensureBuffer(input); + } + else if (typeof input === 'string') { + this.id = uuid_utils_1.uuidHexStringToBuffer(input); + } + else { + throw new error_1.BSONTypeError('Argument passed in UUID constructor must be a UUID, a 16 byte Buffer or a 32/36 character hex string (dashes excluded/included, format: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx).'); + } + } + Object.defineProperty(UUID.prototype, "id", { + /** + * The UUID bytes + * @readonly + */ + get: function () { + return this[kId]; + }, + set: function (value) { + this[kId] = value; + if (UUID.cacheHexString) { + this.__id = uuid_utils_1.bufferToUuidHexString(value); + } + }, + enumerable: false, + configurable: true + }); + /** + * Generate a 16 byte uuid v4 buffer used in UUIDs + */ + /** + * Returns the UUID id as a 32 or 36 character hex string representation, excluding/including dashes (defaults to 36 character dash separated) + * @param includeDashes - should the string exclude dash-separators. + * */ + UUID.prototype.toHexString = function (includeDashes) { + if (includeDashes === void 0) { includeDashes = true; } + if (UUID.cacheHexString && this.__id) { + return this.__id; + } + var uuidHexString = uuid_utils_1.bufferToUuidHexString(this.id, includeDashes); + if (UUID.cacheHexString) { + this.__id = uuidHexString; + } + return uuidHexString; + }; + /** + * Converts the id into a 36 character (dashes included) hex string, unless a encoding is specified. + */ + UUID.prototype.toString = function (encoding) { + return encoding ? this.id.toString(encoding) : this.toHexString(); + }; + /** + * Converts the id into its JSON string representation. + * A 36 character (dashes included) hex string in the format: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx + */ + UUID.prototype.toJSON = function () { + return this.toHexString(); + }; + /** + * Compares the equality of this UUID with `otherID`. + * + * @param otherId - UUID instance to compare against. + */ + UUID.prototype.equals = function (otherId) { + if (!otherId) { + return false; + } + if (otherId instanceof UUID) { + return otherId.id.equals(this.id); + } + try { + return new UUID(otherId).id.equals(this.id); + } + catch (_a) { + return false; + } + }; + /** + * Creates a Binary instance from the current UUID. + */ + UUID.prototype.toBinary = function () { + return new binary_1.Binary(this.id, binary_1.Binary.SUBTYPE_UUID); + }; + /** + * Generates a populated buffer containing a v4 uuid + */ + UUID.generate = function () { + var bytes = utils_1.randomBytes(BYTE_LENGTH); + // Per 4.4, set bits for version and `clock_seq_hi_and_reserved` + // Kindly borrowed from https://github.com/uuidjs/uuid/blob/master/src/v4.js + bytes[6] = (bytes[6] & 0x0f) | 0x40; + bytes[8] = (bytes[8] & 0x3f) | 0x80; + return buffer_1.Buffer.from(bytes); + }; + /** + * Checks if a value is a valid bson UUID + * @param input - UUID, string or Buffer to validate. + */ + UUID.isValid = function (input) { + if (!input) { + return false; + } + if (input instanceof UUID) { + return true; + } + if (typeof input === 'string') { + return uuid_utils_1.uuidValidateString(input); + } + if (utils_1.isUint8Array(input)) { + // check for length & uuid version (https://tools.ietf.org/html/rfc4122#section-4.1.3) + if (input.length !== BYTE_LENGTH) { + return false; + } + try { + // get this byte as hex: xxxxxxxx-xxxx-XXxx-xxxx-xxxxxxxxxxxx + // check first part as uuid version: xxxxxxxx-xxxx-Xxxx-xxxx-xxxxxxxxxxxx + return parseInt(input[6].toString(16)[0], 10) === binary_1.Binary.SUBTYPE_UUID; + } + catch (_a) { + return false; + } + } + return false; + }; + /** + * Creates an UUID from a hex string representation of an UUID. + * @param hexString - 32 or 36 character hex string (dashes excluded/included). + */ + UUID.createFromHexString = function (hexString) { + var buffer = uuid_utils_1.uuidHexStringToBuffer(hexString); + return new UUID(buffer); + }; + /** + * Converts to a string representation of this Id. + * + * @returns return the 36 character hex string representation. + * @internal + */ + UUID.prototype[Symbol.for('nodejs.util.inspect.custom')] = function () { + return this.inspect(); + }; + UUID.prototype.inspect = function () { + return "new UUID(\"" + this.toHexString() + "\")"; + }; + return UUID; +}()); +exports.UUID = UUID; +Object.defineProperty(UUID.prototype, '_bsontype', { value: 'UUID' }); +//# sourceMappingURL=uuid.js.map \ No newline at end of file diff --git a/node_modules/bson/lib/uuid.js.map b/node_modules/bson/lib/uuid.js.map new file mode 100644 index 000000000..6eeb21651 --- /dev/null +++ b/node_modules/bson/lib/uuid.js.map @@ -0,0 +1 @@ +{"version":3,"file":"uuid.js","sourceRoot":"","sources":["../src/uuid.ts"],"names":[],"mappings":";;;AAAA,iCAAgC;AAChC,iDAA+C;AAC/C,mCAAkC;AAClC,2CAAgG;AAChG,wCAA2D;AAC3D,iCAAwC;AAOxC,IAAM,WAAW,GAAG,EAAE,CAAC;AAEvB,IAAM,GAAG,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC;AAEzB;;;GAGG;AACH;IAWE;;;;OAIG;IACH,cAAY,KAA8B;QACxC,IAAI,OAAO,KAAK,KAAK,WAAW,EAAE;YAChC,2DAA2D;YAC3D,IAAI,CAAC,EAAE,GAAG,IAAI,CAAC,QAAQ,EAAE,CAAC;SAC3B;aAAM,IAAI,KAAK,YAAY,IAAI,EAAE;YAChC,IAAI,CAAC,GAAG,CAAC,GAAG,eAAM,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;YAClC,IAAI,CAAC,IAAI,GAA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B,CAAC,KAAK,CAAC,CAAC;SAClC;QAED,IAAI,oBAAY,CAAC,KAAK,CAAC,EAAE;YACvB,sFAAsF;YACtF,IAAI,KAAK,CAAC,MAAM,KAAK,WAAW,EAAE;gBAChC,OAAO,KAAK,CAAC;aACd;YAED,IAAI;gBACF,yEAAyE;gBACzE,yEAAyE;gBACzE,OAAO,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,KAAK,eAAM,CAAC,YAAY,CAAC;aACvE;YAAC,WAAM;gBACN,OAAO,KAAK,CAAC;aACd;SACF;QAED,OAAO,KAAK,CAAC;IACf,CAAC;IAED;;;OAGG;IACI,wBAAmB,GAA1B,UAA2B,SAAiB;QAC1C,IAAM,MAAM,GAAG,kCAAqB,CAAC,SAAS,CAAC,CAAC;QAChD,OAAO,IAAI,IAAI,CAAC,MAAM,CAAC,CAAC;IAC1B,CAAC;IAED;;;;;OAKG;IACH,eAAC,MAAM,CAAC,GAAG,CAAC,4BAA4B,CAAC,CAAC,GAA1C;QACE,OAAO,IAAI,CAAC,OAAO,EAAE,CAAC;IACxB,CAAC;IAED,sBAAO,GAAP;QACE,OAAO,gBAAa,IAAI,CAAC,WAAW,EAAE,QAAI,CAAC;IAC7C,CAAC;IACH,WAAC;AAAD,CAAC,AA1LD,IA0LC;AA1LY,oBAAI;AA4LjB,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,SAAS,EAAE,WAAW,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/bson/lib/uuid_utils.js b/node_modules/bson/lib/uuid_utils.js new file mode 100644 index 000000000..7ccc6acc1 --- /dev/null +++ b/node_modules/bson/lib/uuid_utils.js @@ -0,0 +1,35 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.bufferToUuidHexString = exports.uuidHexStringToBuffer = exports.uuidValidateString = void 0; +var buffer_1 = require("buffer"); +var error_1 = require("./error"); +// Validation regex for v4 uuid (validates with or without dashes) +var VALIDATION_REGEX = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|[0-9a-f]{12}4[0-9a-f]{3}[89ab][0-9a-f]{15})$/i; +var uuidValidateString = function (str) { + return typeof str === 'string' && VALIDATION_REGEX.test(str); +}; +exports.uuidValidateString = uuidValidateString; +var uuidHexStringToBuffer = function (hexString) { + if (!exports.uuidValidateString(hexString)) { + throw new error_1.BSONTypeError('UUID string representations must be a 32 or 36 character hex string (dashes excluded/included). Format: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" or "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx".'); + } + var sanitizedHexString = hexString.replace(/-/g, ''); + return buffer_1.Buffer.from(sanitizedHexString, 'hex'); +}; +exports.uuidHexStringToBuffer = uuidHexStringToBuffer; +var bufferToUuidHexString = function (buffer, includeDashes) { + if (includeDashes === void 0) { includeDashes = true; } + return includeDashes + ? buffer.toString('hex', 0, 4) + + '-' + + buffer.toString('hex', 4, 6) + + '-' + + buffer.toString('hex', 6, 8) + + '-' + + buffer.toString('hex', 8, 10) + + '-' + + buffer.toString('hex', 10, 16) + : buffer.toString('hex'); +}; +exports.bufferToUuidHexString = bufferToUuidHexString; +//# sourceMappingURL=uuid_utils.js.map \ No newline at end of file diff --git a/node_modules/bson/lib/uuid_utils.js.map b/node_modules/bson/lib/uuid_utils.js.map new file mode 100644 index 000000000..0d7b1f108 --- /dev/null +++ b/node_modules/bson/lib/uuid_utils.js.map @@ -0,0 +1 @@ +{"version":3,"file":"uuid_utils.js","sourceRoot":"","sources":["../src/uuid_utils.ts"],"names":[],"mappings":";;;AAAA,iCAAgC;AAChC,iCAAwC;AAExC,kEAAkE;AAClE,IAAM,gBAAgB,GACpB,uHAAuH,CAAC;AAEnH,IAAM,kBAAkB,GAAG,UAAC,GAAW;IAC5C,OAAA,OAAO,GAAG,KAAK,QAAQ,IAAI,gBAAgB,CAAC,IAAI,CAAC,GAAG,CAAC;AAArD,CAAqD,CAAC;AAD3C,QAAA,kBAAkB,sBACyB;AAEjD,IAAM,qBAAqB,GAAG,UAAC,SAAiB;IACrD,IAAI,CAAC,0BAAkB,CAAC,SAAS,CAAC,EAAE;QAClC,MAAM,IAAI,qBAAa,CACrB,uLAAuL,CACxL,CAAC;KACH;IAED,IAAM,kBAAkB,GAAG,SAAS,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;IACvD,OAAO,eAAM,CAAC,IAAI,CAAC,kBAAkB,EAAE,KAAK,CAAC,CAAC;AAChD,CAAC,CAAC;AATW,QAAA,qBAAqB,yBAShC;AAEK,IAAM,qBAAqB,GAAG,UAAC,MAAc,EAAE,aAAoB;IAApB,8BAAA,EAAA,oBAAoB;IACxE,OAAA,aAAa;QACX,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,EAAE,CAAC,EAAE,CAAC,CAAC;YAC5B,GAAG;YACH,MAAM,CAAC,QAAQ,CAAC,KAAK,EAAE,CAAC,EAAE,CAAC,CAAC;YAC5B,GAAG;YACH,MAAM,CAAC,QAAQ,CAAC,KAAK,EAAE,CAAC,EAAE,CAAC,CAAC;YAC5B,GAAG;YACH,MAAM,CAAC,QAAQ,CAAC,KAAK,EAAE,CAAC,EAAE,EAAE,CAAC;YAC7B,GAAG;YACH,MAAM,CAAC,QAAQ,CAAC,KAAK,EAAE,EAAE,EAAE,EAAE,CAAC;QAChC,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC;AAV1B,CAU0B,CAAC;AAXhB,QAAA,qBAAqB,yBAWL"} \ No newline at end of file diff --git a/node_modules/bson/lib/validate_utf8.js b/node_modules/bson/lib/validate_utf8.js new file mode 100644 index 000000000..ec7801603 --- /dev/null +++ b/node_modules/bson/lib/validate_utf8.js @@ -0,0 +1,47 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.validateUtf8 = void 0; +var FIRST_BIT = 0x80; +var FIRST_TWO_BITS = 0xc0; +var FIRST_THREE_BITS = 0xe0; +var FIRST_FOUR_BITS = 0xf0; +var FIRST_FIVE_BITS = 0xf8; +var TWO_BIT_CHAR = 0xc0; +var THREE_BIT_CHAR = 0xe0; +var FOUR_BIT_CHAR = 0xf0; +var CONTINUING_CHAR = 0x80; +/** + * Determines if the passed in bytes are valid utf8 + * @param bytes - An array of 8-bit bytes. Must be indexable and have length property + * @param start - The index to start validating + * @param end - The index to end validating + */ +function validateUtf8(bytes, start, end) { + var continuation = 0; + for (var i = start; i < end; i += 1) { + var byte = bytes[i]; + if (continuation) { + if ((byte & FIRST_TWO_BITS) !== CONTINUING_CHAR) { + return false; + } + continuation -= 1; + } + else if (byte & FIRST_BIT) { + if ((byte & FIRST_THREE_BITS) === TWO_BIT_CHAR) { + continuation = 1; + } + else if ((byte & FIRST_FOUR_BITS) === THREE_BIT_CHAR) { + continuation = 2; + } + else if ((byte & FIRST_FIVE_BITS) === FOUR_BIT_CHAR) { + continuation = 3; + } + else { + return false; + } + } + } + return !continuation; +} +exports.validateUtf8 = validateUtf8; +//# sourceMappingURL=validate_utf8.js.map \ No newline at end of file diff --git a/node_modules/bson/lib/validate_utf8.js.map b/node_modules/bson/lib/validate_utf8.js.map new file mode 100644 index 000000000..f1e975be0 --- /dev/null +++ b/node_modules/bson/lib/validate_utf8.js.map @@ -0,0 +1 @@ +{"version":3,"file":"validate_utf8.js","sourceRoot":"","sources":["../src/validate_utf8.ts"],"names":[],"mappings":";;;AAAA,IAAM,SAAS,GAAG,IAAI,CAAC;AACvB,IAAM,cAAc,GAAG,IAAI,CAAC;AAC5B,IAAM,gBAAgB,GAAG,IAAI,CAAC;AAC9B,IAAM,eAAe,GAAG,IAAI,CAAC;AAC7B,IAAM,eAAe,GAAG,IAAI,CAAC;AAE7B,IAAM,YAAY,GAAG,IAAI,CAAC;AAC1B,IAAM,cAAc,GAAG,IAAI,CAAC;AAC5B,IAAM,aAAa,GAAG,IAAI,CAAC;AAC3B,IAAM,eAAe,GAAG,IAAI,CAAC;AAE7B;;;;;GAKG;AACH,SAAgB,YAAY,CAC1B,KAAkC,EAClC,KAAa,EACb,GAAW;IAEX,IAAI,YAAY,GAAG,CAAC,CAAC;IAErB,KAAK,IAAI,CAAC,GAAG,KAAK,EAAE,CAAC,GAAG,GAAG,EAAE,CAAC,IAAI,CAAC,EAAE;QACnC,IAAM,IAAI,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;QAEtB,IAAI,YAAY,EAAE;YAChB,IAAI,CAAC,IAAI,GAAG,cAAc,CAAC,KAAK,eAAe,EAAE;gBAC/C,OAAO,KAAK,CAAC;aACd;YACD,YAAY,IAAI,CAAC,CAAC;SACnB;aAAM,IAAI,IAAI,GAAG,SAAS,EAAE;YAC3B,IAAI,CAAC,IAAI,GAAG,gBAAgB,CAAC,KAAK,YAAY,EAAE;gBAC9C,YAAY,GAAG,CAAC,CAAC;aAClB;iBAAM,IAAI,CAAC,IAAI,GAAG,eAAe,CAAC,KAAK,cAAc,EAAE;gBACtD,YAAY,GAAG,CAAC,CAAC;aAClB;iBAAM,IAAI,CAAC,IAAI,GAAG,eAAe,CAAC,KAAK,aAAa,EAAE;gBACrD,YAAY,GAAG,CAAC,CAAC;aAClB;iBAAM;gBACL,OAAO,KAAK,CAAC;aACd;SACF;KACF;IAED,OAAO,CAAC,YAAY,CAAC;AACvB,CAAC;AA7BD,oCA6BC"} \ No newline at end of file diff --git a/node_modules/bson/package.json b/node_modules/bson/package.json new file mode 100644 index 000000000..b3ce5a40c --- /dev/null +++ b/node_modules/bson/package.json @@ -0,0 +1,123 @@ +{ + "name": "bson", + "description": "A bson parser for node.js and the browser", + "keywords": [ + "mongodb", + "bson", + "parser" + ], + "files": [ + "lib", + "src", + "dist", + "bson.d.ts", + "bson-ts34.d.ts", + "etc/prepare.js", + "bower.json" + ], + "types": "bson.d.ts", + "typesVersions": { + "<=4.0.2": { + "bson.d.ts": [ + "bson.ts34.d.ts" + ] + } + }, + "version": "4.6.4", + "author": { + "name": "The MongoDB NodeJS Team", + "email": "dbx-node@mongodb.com" + }, + "license": "Apache-2.0", + "contributors": [], + "repository": "mongodb/js-bson", + "bugs": { + "url": "https://jira.mongodb.org/projects/NODE/issues/" + }, + "devDependencies": { + "@babel/plugin-external-helpers": "^7.10.4", + "@babel/preset-env": "^7.11.0", + "@istanbuljs/nyc-config-typescript": "^1.0.1", + "@microsoft/api-extractor": "^7.11.2", + "@rollup/plugin-babel": "^5.2.0", + "@rollup/plugin-commonjs": "^15.0.0", + "@rollup/plugin-json": "^4.1.0", + "@rollup/plugin-node-resolve": "^9.0.0", + "@rollup/plugin-typescript": "^6.0.0", + "@typescript-eslint/eslint-plugin": "^3.10.1", + "@typescript-eslint/parser": "^3.10.1", + "array-includes": "^3.1.3", + "benchmark": "^2.1.4", + "chai": "^4.2.0", + "downlevel-dts": "^0.9.0", + "eslint": "^7.7.0", + "eslint-config-prettier": "^6.11.0", + "eslint-plugin-prettier": "^3.1.4", + "eslint-plugin-tsdoc": "^0.2.6", + "karma": "^6.3.4", + "karma-chai": "^0.1.0", + "karma-chrome-launcher": "^3.1.0", + "karma-mocha": "^2.0.1", + "karma-mocha-reporter": "^2.2.5", + "karma-rollup-preprocessor": "^7.0.5", + "mocha": "5.2.0", + "node-fetch": "^2.6.1", + "nyc": "^15.1.0", + "object.entries": "^1.1.4", + "prettier": "^2.1.1", + "rimraf": "^3.0.2", + "rollup": "^2.26.5", + "rollup-plugin-commonjs": "^10.1.0", + "rollup-plugin-node-globals": "^1.4.0", + "rollup-plugin-node-polyfills": "^0.2.1", + "rollup-plugin-polyfill-node": "^0.7.0", + "standard-version": "^9.3.0", + "ts-node": "^9.0.0", + "tsd": "^0.17.0", + "typedoc": "^0.21.2", + "typescript": "^4.0.2", + "typescript-cached-transpile": "0.0.6", + "uuid": "^8.3.2" + }, + "tsd": { + "directory": "test/types", + "compilerOptions": { + "strict": true, + "target": "esnext", + "module": "commonjs", + "moduleResolution": "node" + } + }, + "config": { + "native": false + }, + "main": "lib/bson.js", + "module": "dist/bson.esm.js", + "browser": { + "./lib/bson.js": "./dist/bson.browser.umd.js", + "./dist/bson.esm.js": "./dist/bson.browser.esm.js" + }, + "engines": { + "node": ">=6.9.0" + }, + "scripts": { + "docs": "typedoc", + "test": "npm run build && npm run test-node && npm run test-browser", + "test-node": "mocha test/node test/*_tests.js", + "test-tsd": "npm run build:dts && tsd", + "test-browser": "node --max-old-space-size=4096 ./node_modules/.bin/karma start karma.conf.js", + "build:ts": "tsc", + "build:dts": "npm run build:ts && api-extractor run --typescript-compiler-folder node_modules/typescript --local && rimraf 'lib/**/*.d.ts*' && downlevel-dts bson.d.ts bson-ts34.d.ts", + "build:bundle": "rollup -c rollup.config.js", + "build": "npm run build:dts && npm run build:bundle", + "lint": "eslint -v && eslint --ext '.js,.ts' --max-warnings=0 src test && tsc -v && tsc --noEmit && npm run test-tsd", + "format": "eslint --ext '.js,.ts' src test --fix", + "coverage": "nyc npm run test-node", + "coverage:html": "npm run coverage && open ./coverage/index.html", + "prepare": "node etc/prepare.js", + "release": "standard-version -i HISTORY.md" + }, + "dependencies": { + "buffer": "^5.6.0" + } +} diff --git a/node_modules/bson/src/binary.ts b/node_modules/bson/src/binary.ts new file mode 100644 index 000000000..cb6c67c6f --- /dev/null +++ b/node_modules/bson/src/binary.ts @@ -0,0 +1,287 @@ +import { Buffer } from 'buffer'; +import { ensureBuffer } from './ensure_buffer'; +import { uuidHexStringToBuffer } from './uuid_utils'; +import { UUID, UUIDExtended } from './uuid'; +import type { EJSONOptions } from './extended_json'; +import { BSONError, BSONTypeError } from './error'; + +/** @public */ +export type BinarySequence = Uint8Array | Buffer | number[]; + +/** @public */ +export interface BinaryExtendedLegacy { + $type: string; + $binary: string; +} + +/** @public */ +export interface BinaryExtended { + $binary: { + subType: string; + base64: string; + }; +} + +/** + * A class representation of the BSON Binary type. + * @public + * @category BSONType + */ +export class Binary { + _bsontype!: 'Binary'; + + /** + * Binary default subtype + * @internal + */ + private static readonly BSON_BINARY_SUBTYPE_DEFAULT = 0; + + /** Initial buffer default size */ + static readonly BUFFER_SIZE = 256; + /** Default BSON type */ + static readonly SUBTYPE_DEFAULT = 0; + /** Function BSON type */ + static readonly SUBTYPE_FUNCTION = 1; + /** Byte Array BSON type */ + static readonly SUBTYPE_BYTE_ARRAY = 2; + /** Deprecated UUID BSON type @deprecated Please use SUBTYPE_UUID */ + static readonly SUBTYPE_UUID_OLD = 3; + /** UUID BSON type */ + static readonly SUBTYPE_UUID = 4; + /** MD5 BSON type */ + static readonly SUBTYPE_MD5 = 5; + /** Encrypted BSON type */ + static readonly SUBTYPE_ENCRYPTED = 6; + /** Column BSON type */ + static readonly SUBTYPE_COLUMN = 7; + /** User BSON type */ + static readonly SUBTYPE_USER_DEFINED = 128; + + buffer!: Buffer; + sub_type!: number; + position!: number; + + /** + * @param buffer - a buffer object containing the binary data. + * @param subType - the option binary type. + */ + constructor(buffer?: string | BinarySequence, subType?: number) { + if (!(this instanceof Binary)) return new Binary(buffer, subType); + + if ( + !(buffer == null) && + !(typeof buffer === 'string') && + !ArrayBuffer.isView(buffer) && + !(buffer instanceof ArrayBuffer) && + !Array.isArray(buffer) + ) { + throw new BSONTypeError( + 'Binary can only be constructed from string, Buffer, TypedArray, or Array' + ); + } + + this.sub_type = subType ?? Binary.BSON_BINARY_SUBTYPE_DEFAULT; + + if (buffer == null) { + // create an empty binary buffer + this.buffer = Buffer.alloc(Binary.BUFFER_SIZE); + this.position = 0; + } else { + if (typeof buffer === 'string') { + // string + this.buffer = Buffer.from(buffer, 'binary'); + } else if (Array.isArray(buffer)) { + // number[] + this.buffer = Buffer.from(buffer); + } else { + // Buffer | TypedArray | ArrayBuffer + this.buffer = ensureBuffer(buffer); + } + + this.position = this.buffer.byteLength; + } + } + + /** + * Updates this binary with byte_value. + * + * @param byteValue - a single byte we wish to write. + */ + put(byteValue: string | number | Uint8Array | Buffer | number[]): void { + // If it's a string and a has more than one character throw an error + if (typeof byteValue === 'string' && byteValue.length !== 1) { + throw new BSONTypeError('only accepts single character String'); + } else if (typeof byteValue !== 'number' && byteValue.length !== 1) + throw new BSONTypeError('only accepts single character Uint8Array or Array'); + + // Decode the byte value once + let decodedByte: number; + if (typeof byteValue === 'string') { + decodedByte = byteValue.charCodeAt(0); + } else if (typeof byteValue === 'number') { + decodedByte = byteValue; + } else { + decodedByte = byteValue[0]; + } + + if (decodedByte < 0 || decodedByte > 255) { + throw new BSONTypeError('only accepts number in a valid unsigned byte range 0-255'); + } + + if (this.buffer.length > this.position) { + this.buffer[this.position++] = decodedByte; + } else { + const buffer = Buffer.alloc(Binary.BUFFER_SIZE + this.buffer.length); + // Combine the two buffers together + this.buffer.copy(buffer, 0, 0, this.buffer.length); + this.buffer = buffer; + this.buffer[this.position++] = decodedByte; + } + } + + /** + * Writes a buffer or string to the binary. + * + * @param sequence - a string or buffer to be written to the Binary BSON object. + * @param offset - specify the binary of where to write the content. + */ + write(sequence: string | BinarySequence, offset: number): void { + offset = typeof offset === 'number' ? offset : this.position; + + // If the buffer is to small let's extend the buffer + if (this.buffer.length < offset + sequence.length) { + const buffer = Buffer.alloc(this.buffer.length + sequence.length); + this.buffer.copy(buffer, 0, 0, this.buffer.length); + + // Assign the new buffer + this.buffer = buffer; + } + + if (ArrayBuffer.isView(sequence)) { + this.buffer.set(ensureBuffer(sequence), offset); + this.position = + offset + sequence.byteLength > this.position ? offset + sequence.length : this.position; + } else if (typeof sequence === 'string') { + this.buffer.write(sequence, offset, sequence.length, 'binary'); + this.position = + offset + sequence.length > this.position ? offset + sequence.length : this.position; + } + } + + /** + * Reads **length** bytes starting at **position**. + * + * @param position - read from the given position in the Binary. + * @param length - the number of bytes to read. + */ + read(position: number, length: number): BinarySequence { + length = length && length > 0 ? length : this.position; + + // Let's return the data based on the type we have + return this.buffer.slice(position, position + length); + } + + /** + * Returns the value of this binary as a string. + * @param asRaw - Will skip converting to a string + * @remarks + * This is handy when calling this function conditionally for some key value pairs and not others + */ + value(asRaw?: boolean): string | BinarySequence { + asRaw = !!asRaw; + + // Optimize to serialize for the situation where the data == size of buffer + if (asRaw && this.buffer.length === this.position) { + return this.buffer; + } + + // If it's a node.js buffer object + if (asRaw) { + return this.buffer.slice(0, this.position); + } + return this.buffer.toString('binary', 0, this.position); + } + + /** the length of the binary sequence */ + length(): number { + return this.position; + } + + toJSON(): string { + return this.buffer.toString('base64'); + } + + toString(format?: string): string { + return this.buffer.toString(format); + } + + /** @internal */ + toExtendedJSON(options?: EJSONOptions): BinaryExtendedLegacy | BinaryExtended { + options = options || {}; + const base64String = this.buffer.toString('base64'); + + const subType = Number(this.sub_type).toString(16); + if (options.legacy) { + return { + $binary: base64String, + $type: subType.length === 1 ? '0' + subType : subType + }; + } + return { + $binary: { + base64: base64String, + subType: subType.length === 1 ? '0' + subType : subType + } + }; + } + + toUUID(): UUID { + if (this.sub_type === Binary.SUBTYPE_UUID) { + return new UUID(this.buffer.slice(0, this.position)); + } + + throw new BSONError( + `Binary sub_type "${this.sub_type}" is not supported for converting to UUID. Only "${Binary.SUBTYPE_UUID}" is currently supported.` + ); + } + + /** @internal */ + static fromExtendedJSON( + doc: BinaryExtendedLegacy | BinaryExtended | UUIDExtended, + options?: EJSONOptions + ): Binary { + options = options || {}; + let data: Buffer | undefined; + let type; + if ('$binary' in doc) { + if (options.legacy && typeof doc.$binary === 'string' && '$type' in doc) { + type = doc.$type ? parseInt(doc.$type, 16) : 0; + data = Buffer.from(doc.$binary, 'base64'); + } else { + if (typeof doc.$binary !== 'string') { + type = doc.$binary.subType ? parseInt(doc.$binary.subType, 16) : 0; + data = Buffer.from(doc.$binary.base64, 'base64'); + } + } + } else if ('$uuid' in doc) { + type = 4; + data = uuidHexStringToBuffer(doc.$uuid); + } + if (!data) { + throw new BSONTypeError(`Unexpected Binary Extended JSON format ${JSON.stringify(doc)}`); + } + return new Binary(data, type); + } + + /** @internal */ + [Symbol.for('nodejs.util.inspect.custom')](): string { + return this.inspect(); + } + + inspect(): string { + const asBuffer = this.value(true); + return `new Binary(Buffer.from("${asBuffer.toString('hex')}", "hex"), ${this.sub_type})`; + } +} + +Object.defineProperty(Binary.prototype, '_bsontype', { value: 'Binary' }); diff --git a/node_modules/bson/src/bson.ts b/node_modules/bson/src/bson.ts new file mode 100644 index 000000000..924235aab --- /dev/null +++ b/node_modules/bson/src/bson.ts @@ -0,0 +1,335 @@ +import { Buffer } from 'buffer'; +import { Binary } from './binary'; +import { Code } from './code'; +import { DBRef } from './db_ref'; +import { Decimal128 } from './decimal128'; +import { Double } from './double'; +import { ensureBuffer } from './ensure_buffer'; +import { EJSON } from './extended_json'; +import { Int32 } from './int_32'; +import { Long } from './long'; +import { Map } from './map'; +import { MaxKey } from './max_key'; +import { MinKey } from './min_key'; +import { ObjectId } from './objectid'; +import { BSONError, BSONTypeError } from './error'; +import { calculateObjectSize as internalCalculateObjectSize } from './parser/calculate_size'; +// Parts of the parser +import { deserialize as internalDeserialize, DeserializeOptions } from './parser/deserializer'; +import { serializeInto as internalSerialize, SerializeOptions } from './parser/serializer'; +import { BSONRegExp } from './regexp'; +import { BSONSymbol } from './symbol'; +import { Timestamp } from './timestamp'; +import { UUID } from './uuid'; +export { BinaryExtended, BinaryExtendedLegacy, BinarySequence } from './binary'; +export { CodeExtended } from './code'; +export { + BSON_BINARY_SUBTYPE_BYTE_ARRAY, + BSON_BINARY_SUBTYPE_DEFAULT, + BSON_BINARY_SUBTYPE_FUNCTION, + BSON_BINARY_SUBTYPE_MD5, + BSON_BINARY_SUBTYPE_USER_DEFINED, + BSON_BINARY_SUBTYPE_UUID, + BSON_BINARY_SUBTYPE_UUID_NEW, + BSON_BINARY_SUBTYPE_ENCRYPTED, + BSON_BINARY_SUBTYPE_COLUMN, + BSON_DATA_ARRAY, + BSON_DATA_BINARY, + BSON_DATA_BOOLEAN, + BSON_DATA_CODE, + BSON_DATA_CODE_W_SCOPE, + BSON_DATA_DATE, + BSON_DATA_DBPOINTER, + BSON_DATA_DECIMAL128, + BSON_DATA_INT, + BSON_DATA_LONG, + BSON_DATA_MAX_KEY, + BSON_DATA_MIN_KEY, + BSON_DATA_NULL, + BSON_DATA_NUMBER, + BSON_DATA_OBJECT, + BSON_DATA_OID, + BSON_DATA_REGEXP, + BSON_DATA_STRING, + BSON_DATA_SYMBOL, + BSON_DATA_TIMESTAMP, + BSON_DATA_UNDEFINED, + BSON_INT32_MAX, + BSON_INT32_MIN, + BSON_INT64_MAX, + BSON_INT64_MIN +} from './constants'; +export { DBRefLike } from './db_ref'; +export { Decimal128Extended } from './decimal128'; +export { DoubleExtended } from './double'; +export { EJSON, EJSONOptions } from './extended_json'; +export { Int32Extended } from './int_32'; +export { LongExtended } from './long'; +export { MaxKeyExtended } from './max_key'; +export { MinKeyExtended } from './min_key'; +export { ObjectIdExtended, ObjectIdLike } from './objectid'; +export { BSONRegExpExtended, BSONRegExpExtendedLegacy } from './regexp'; +export { BSONSymbolExtended } from './symbol'; +export { + LongWithoutOverrides, + LongWithoutOverridesClass, + TimestampExtended, + TimestampOverrides +} from './timestamp'; +export { UUIDExtended } from './uuid'; +export { SerializeOptions, DeserializeOptions }; +export { + Code, + Map, + BSONSymbol, + DBRef, + Binary, + ObjectId, + UUID, + Long, + Timestamp, + Double, + Int32, + MinKey, + MaxKey, + BSONRegExp, + Decimal128, + // In 4.0.0 and 4.0.1, this property name was changed to ObjectId to match the class name. + // This caused interoperability problems with previous versions of the library, so in + // later builds we changed it back to ObjectID (capital D) to match legacy implementations. + ObjectId as ObjectID +}; +export { BSONError, BSONTypeError } from './error'; + +/** @public */ +export interface Document { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + [key: string]: any; +} + +/** @internal */ +// Default Max Size +const MAXSIZE = 1024 * 1024 * 17; + +// Current Internal Temporary Serialization Buffer +let buffer = Buffer.alloc(MAXSIZE); + +/** + * Sets the size of the internal serialization buffer. + * + * @param size - The desired size for the internal serialization buffer + * @public + */ +export function setInternalBufferSize(size: number): void { + // Resize the internal serialization buffer if needed + if (buffer.length < size) { + buffer = Buffer.alloc(size); + } +} + +/** + * Serialize a Javascript object. + * + * @param object - the Javascript object to serialize. + * @returns Buffer object containing the serialized object. + * @public + */ +export function serialize(object: Document, options: SerializeOptions = {}): Buffer { + // Unpack the options + const checkKeys = typeof options.checkKeys === 'boolean' ? options.checkKeys : false; + const serializeFunctions = + typeof options.serializeFunctions === 'boolean' ? options.serializeFunctions : false; + const ignoreUndefined = + typeof options.ignoreUndefined === 'boolean' ? options.ignoreUndefined : true; + const minInternalBufferSize = + typeof options.minInternalBufferSize === 'number' ? options.minInternalBufferSize : MAXSIZE; + + // Resize the internal serialization buffer if needed + if (buffer.length < minInternalBufferSize) { + buffer = Buffer.alloc(minInternalBufferSize); + } + + // Attempt to serialize + const serializationIndex = internalSerialize( + buffer, + object, + checkKeys, + 0, + 0, + serializeFunctions, + ignoreUndefined, + [] + ); + + // Create the final buffer + const finishedBuffer = Buffer.alloc(serializationIndex); + + // Copy into the finished buffer + buffer.copy(finishedBuffer, 0, 0, finishedBuffer.length); + + // Return the buffer + return finishedBuffer; +} + +/** + * Serialize a Javascript object using a predefined Buffer and index into the buffer, + * useful when pre-allocating the space for serialization. + * + * @param object - the Javascript object to serialize. + * @param finalBuffer - the Buffer you pre-allocated to store the serialized BSON object. + * @returns the index pointing to the last written byte in the buffer. + * @public + */ +export function serializeWithBufferAndIndex( + object: Document, + finalBuffer: Buffer, + options: SerializeOptions = {} +): number { + // Unpack the options + const checkKeys = typeof options.checkKeys === 'boolean' ? options.checkKeys : false; + const serializeFunctions = + typeof options.serializeFunctions === 'boolean' ? options.serializeFunctions : false; + const ignoreUndefined = + typeof options.ignoreUndefined === 'boolean' ? options.ignoreUndefined : true; + const startIndex = typeof options.index === 'number' ? options.index : 0; + + // Attempt to serialize + const serializationIndex = internalSerialize( + buffer, + object, + checkKeys, + 0, + 0, + serializeFunctions, + ignoreUndefined + ); + buffer.copy(finalBuffer, startIndex, 0, serializationIndex); + + // Return the index + return startIndex + serializationIndex - 1; +} + +/** + * Deserialize data as BSON. + * + * @param buffer - the buffer containing the serialized set of BSON documents. + * @returns returns the deserialized Javascript Object. + * @public + */ +export function deserialize( + buffer: Buffer | ArrayBufferView | ArrayBuffer, + options: DeserializeOptions = {} +): Document { + return internalDeserialize(buffer instanceof Buffer ? buffer : ensureBuffer(buffer), options); +} + +/** @public */ +export type CalculateObjectSizeOptions = Pick< + SerializeOptions, + 'serializeFunctions' | 'ignoreUndefined' +>; + +/** + * Calculate the bson size for a passed in Javascript object. + * + * @param object - the Javascript object to calculate the BSON byte size for + * @returns size of BSON object in bytes + * @public + */ +export function calculateObjectSize( + object: Document, + options: CalculateObjectSizeOptions = {} +): number { + options = options || {}; + + const serializeFunctions = + typeof options.serializeFunctions === 'boolean' ? options.serializeFunctions : false; + const ignoreUndefined = + typeof options.ignoreUndefined === 'boolean' ? options.ignoreUndefined : true; + + return internalCalculateObjectSize(object, serializeFunctions, ignoreUndefined); +} + +/** + * Deserialize stream data as BSON documents. + * + * @param data - the buffer containing the serialized set of BSON documents. + * @param startIndex - the start index in the data Buffer where the deserialization is to start. + * @param numberOfDocuments - number of documents to deserialize. + * @param documents - an array where to store the deserialized documents. + * @param docStartIndex - the index in the documents array from where to start inserting documents. + * @param options - additional options used for the deserialization. + * @returns next index in the buffer after deserialization **x** numbers of documents. + * @public + */ +export function deserializeStream( + data: Buffer | ArrayBufferView | ArrayBuffer, + startIndex: number, + numberOfDocuments: number, + documents: Document[], + docStartIndex: number, + options: DeserializeOptions +): number { + const internalOptions = Object.assign( + { allowObjectSmallerThanBufferSize: true, index: 0 }, + options + ); + const bufferData = ensureBuffer(data); + + let index = startIndex; + // Loop over all documents + for (let i = 0; i < numberOfDocuments; i++) { + // Find size of the document + const size = + bufferData[index] | + (bufferData[index + 1] << 8) | + (bufferData[index + 2] << 16) | + (bufferData[index + 3] << 24); + // Update options with index + internalOptions.index = index; + // Parse the document at this point + documents[docStartIndex + i] = internalDeserialize(bufferData, internalOptions); + // Adjust index by the document size + index = index + size; + } + + // Return object containing end index of parsing and list of documents + return index; +} + +/** + * BSON default export + * @deprecated Please use named exports + * @privateRemarks + * We want to someday deprecate the default export, + * so none of the new TS types are being exported on the default + * @public + */ +const BSON = { + Binary, + Code, + DBRef, + Decimal128, + Double, + Int32, + Long, + UUID, + Map, + MaxKey, + MinKey, + ObjectId, + ObjectID: ObjectId, + BSONRegExp, + BSONSymbol, + Timestamp, + EJSON, + setInternalBufferSize, + serialize, + serializeWithBufferAndIndex, + deserialize, + calculateObjectSize, + deserializeStream, + BSONError, + BSONTypeError +}; +export default BSON; diff --git a/node_modules/bson/src/code.ts b/node_modules/bson/src/code.ts new file mode 100644 index 000000000..d4459c135 --- /dev/null +++ b/node_modules/bson/src/code.ts @@ -0,0 +1,61 @@ +import type { Document } from './bson'; + +/** @public */ +export interface CodeExtended { + $code: string | Function; + $scope?: Document; +} + +/** + * A class representation of the BSON Code type. + * @public + * @category BSONType + */ +export class Code { + _bsontype!: 'Code'; + + code!: string | Function; + scope?: Document; + /** + * @param code - a string or function. + * @param scope - an optional scope for the function. + */ + constructor(code: string | Function, scope?: Document) { + if (!(this instanceof Code)) return new Code(code, scope); + + this.code = code; + this.scope = scope; + } + + toJSON(): { code: string | Function; scope?: Document } { + return { code: this.code, scope: this.scope }; + } + + /** @internal */ + toExtendedJSON(): CodeExtended { + if (this.scope) { + return { $code: this.code, $scope: this.scope }; + } + + return { $code: this.code }; + } + + /** @internal */ + static fromExtendedJSON(doc: CodeExtended): Code { + return new Code(doc.$code, doc.$scope); + } + + /** @internal */ + [Symbol.for('nodejs.util.inspect.custom')](): string { + return this.inspect(); + } + + inspect(): string { + const codeJson = this.toJSON(); + return `new Code("${codeJson.code}"${ + codeJson.scope ? `, ${JSON.stringify(codeJson.scope)}` : '' + })`; + } +} + +Object.defineProperty(Code.prototype, '_bsontype', { value: 'Code' }); diff --git a/node_modules/bson/src/constants.ts b/node_modules/bson/src/constants.ts new file mode 100644 index 000000000..6af63e694 --- /dev/null +++ b/node_modules/bson/src/constants.ts @@ -0,0 +1,110 @@ +/** @internal */ +export const BSON_INT32_MAX = 0x7fffffff; +/** @internal */ +export const BSON_INT32_MIN = -0x80000000; +/** @internal */ +export const BSON_INT64_MAX = Math.pow(2, 63) - 1; +/** @internal */ +export const BSON_INT64_MIN = -Math.pow(2, 63); + +/** + * Any integer up to 2^53 can be precisely represented by a double. + * @internal + */ +export const JS_INT_MAX = Math.pow(2, 53); + +/** + * Any integer down to -2^53 can be precisely represented by a double. + * @internal + */ +export const JS_INT_MIN = -Math.pow(2, 53); + +/** Number BSON Type @internal */ +export const BSON_DATA_NUMBER = 1; + +/** String BSON Type @internal */ +export const BSON_DATA_STRING = 2; + +/** Object BSON Type @internal */ +export const BSON_DATA_OBJECT = 3; + +/** Array BSON Type @internal */ +export const BSON_DATA_ARRAY = 4; + +/** Binary BSON Type @internal */ +export const BSON_DATA_BINARY = 5; + +/** Binary BSON Type @internal */ +export const BSON_DATA_UNDEFINED = 6; + +/** ObjectId BSON Type @internal */ +export const BSON_DATA_OID = 7; + +/** Boolean BSON Type @internal */ +export const BSON_DATA_BOOLEAN = 8; + +/** Date BSON Type @internal */ +export const BSON_DATA_DATE = 9; + +/** null BSON Type @internal */ +export const BSON_DATA_NULL = 10; + +/** RegExp BSON Type @internal */ +export const BSON_DATA_REGEXP = 11; + +/** Code BSON Type @internal */ +export const BSON_DATA_DBPOINTER = 12; + +/** Code BSON Type @internal */ +export const BSON_DATA_CODE = 13; + +/** Symbol BSON Type @internal */ +export const BSON_DATA_SYMBOL = 14; + +/** Code with Scope BSON Type @internal */ +export const BSON_DATA_CODE_W_SCOPE = 15; + +/** 32 bit Integer BSON Type @internal */ +export const BSON_DATA_INT = 16; + +/** Timestamp BSON Type @internal */ +export const BSON_DATA_TIMESTAMP = 17; + +/** Long BSON Type @internal */ +export const BSON_DATA_LONG = 18; + +/** Decimal128 BSON Type @internal */ +export const BSON_DATA_DECIMAL128 = 19; + +/** MinKey BSON Type @internal */ +export const BSON_DATA_MIN_KEY = 0xff; + +/** MaxKey BSON Type @internal */ +export const BSON_DATA_MAX_KEY = 0x7f; + +/** Binary Default Type @internal */ +export const BSON_BINARY_SUBTYPE_DEFAULT = 0; + +/** Binary Function Type @internal */ +export const BSON_BINARY_SUBTYPE_FUNCTION = 1; + +/** Binary Byte Array Type @internal */ +export const BSON_BINARY_SUBTYPE_BYTE_ARRAY = 2; + +/** Binary Deprecated UUID Type @deprecated Please use BSON_BINARY_SUBTYPE_UUID_NEW @internal */ +export const BSON_BINARY_SUBTYPE_UUID = 3; + +/** Binary UUID Type @internal */ +export const BSON_BINARY_SUBTYPE_UUID_NEW = 4; + +/** Binary MD5 Type @internal */ +export const BSON_BINARY_SUBTYPE_MD5 = 5; + +/** Encrypted BSON type @internal */ +export const BSON_BINARY_SUBTYPE_ENCRYPTED = 6; + +/** Column BSON type @internal */ +export const BSON_BINARY_SUBTYPE_COLUMN = 7; + +/** Binary User Defined Type @internal */ +export const BSON_BINARY_SUBTYPE_USER_DEFINED = 128; diff --git a/node_modules/bson/src/db_ref.ts b/node_modules/bson/src/db_ref.ts new file mode 100644 index 000000000..a46cd26de --- /dev/null +++ b/node_modules/bson/src/db_ref.ts @@ -0,0 +1,124 @@ +import type { Document } from './bson'; +import type { EJSONOptions } from './extended_json'; +import type { ObjectId } from './objectid'; +import { isObjectLike } from './parser/utils'; + +/** @public */ +export interface DBRefLike { + $ref: string; + $id: ObjectId; + $db?: string; +} + +/** @internal */ +export function isDBRefLike(value: unknown): value is DBRefLike { + return ( + isObjectLike(value) && + value.$id != null && + typeof value.$ref === 'string' && + (value.$db == null || typeof value.$db === 'string') + ); +} + +/** + * A class representation of the BSON DBRef type. + * @public + * @category BSONType + */ +export class DBRef { + _bsontype!: 'DBRef'; + + collection!: string; + oid!: ObjectId; + db?: string; + fields!: Document; + + /** + * @param collection - the collection name. + * @param oid - the reference ObjectId. + * @param db - optional db name, if omitted the reference is local to the current db. + */ + constructor(collection: string, oid: ObjectId, db?: string, fields?: Document) { + if (!(this instanceof DBRef)) return new DBRef(collection, oid, db, fields); + + // check if namespace has been provided + const parts = collection.split('.'); + if (parts.length === 2) { + db = parts.shift(); + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + collection = parts.shift()!; + } + + this.collection = collection; + this.oid = oid; + this.db = db; + this.fields = fields || {}; + } + + // Property provided for compatibility with the 1.x parser + // the 1.x parser used a "namespace" property, while 4.x uses "collection" + + /** @internal */ + get namespace(): string { + return this.collection; + } + + set namespace(value: string) { + this.collection = value; + } + + toJSON(): DBRefLike & Document { + const o = Object.assign( + { + $ref: this.collection, + $id: this.oid + }, + this.fields + ); + + if (this.db != null) o.$db = this.db; + return o; + } + + /** @internal */ + toExtendedJSON(options?: EJSONOptions): DBRefLike { + options = options || {}; + let o: DBRefLike = { + $ref: this.collection, + $id: this.oid + }; + + if (options.legacy) { + return o; + } + + if (this.db) o.$db = this.db; + o = Object.assign(o, this.fields); + return o; + } + + /** @internal */ + static fromExtendedJSON(doc: DBRefLike): DBRef { + const copy = Object.assign({}, doc) as Partial; + delete copy.$ref; + delete copy.$id; + delete copy.$db; + return new DBRef(doc.$ref, doc.$id, doc.$db, copy); + } + + /** @internal */ + [Symbol.for('nodejs.util.inspect.custom')](): string { + return this.inspect(); + } + + inspect(): string { + // NOTE: if OID is an ObjectId class it will just print the oid string. + const oid = + this.oid === undefined || this.oid.toString === undefined ? this.oid : this.oid.toString(); + return `new DBRef("${this.namespace}", new ObjectId("${oid}")${ + this.db ? `, "${this.db}"` : '' + })`; + } +} + +Object.defineProperty(DBRef.prototype, '_bsontype', { value: 'DBRef' }); diff --git a/node_modules/bson/src/decimal128.ts b/node_modules/bson/src/decimal128.ts new file mode 100644 index 000000000..8c663198b --- /dev/null +++ b/node_modules/bson/src/decimal128.ts @@ -0,0 +1,773 @@ +import { Buffer } from 'buffer'; +import { BSONTypeError } from './error'; +import { Long } from './long'; +import { isUint8Array } from './parser/utils'; + +const PARSE_STRING_REGEXP = /^(\+|-)?(\d+|(\d*\.\d*))?(E|e)?([-+])?(\d+)?$/; +const PARSE_INF_REGEXP = /^(\+|-)?(Infinity|inf)$/i; +const PARSE_NAN_REGEXP = /^(\+|-)?NaN$/i; + +const EXPONENT_MAX = 6111; +const EXPONENT_MIN = -6176; +const EXPONENT_BIAS = 6176; +const MAX_DIGITS = 34; + +// Nan value bits as 32 bit values (due to lack of longs) +const NAN_BUFFER = [ + 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +].reverse(); +// Infinity value bits 32 bit values (due to lack of longs) +const INF_NEGATIVE_BUFFER = [ + 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +].reverse(); +const INF_POSITIVE_BUFFER = [ + 0x78, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +].reverse(); + +const EXPONENT_REGEX = /^([-+])?(\d+)?$/; + +// Extract least significant 5 bits +const COMBINATION_MASK = 0x1f; +// Extract least significant 14 bits +const EXPONENT_MASK = 0x3fff; +// Value of combination field for Inf +const COMBINATION_INFINITY = 30; +// Value of combination field for NaN +const COMBINATION_NAN = 31; + +// Detect if the value is a digit +function isDigit(value: string): boolean { + return !isNaN(parseInt(value, 10)); +} + +// Divide two uint128 values +function divideu128(value: { parts: [number, number, number, number] }) { + const DIVISOR = Long.fromNumber(1000 * 1000 * 1000); + let _rem = Long.fromNumber(0); + + if (!value.parts[0] && !value.parts[1] && !value.parts[2] && !value.parts[3]) { + return { quotient: value, rem: _rem }; + } + + for (let i = 0; i <= 3; i++) { + // Adjust remainder to match value of next dividend + _rem = _rem.shiftLeft(32); + // Add the divided to _rem + _rem = _rem.add(new Long(value.parts[i], 0)); + value.parts[i] = _rem.div(DIVISOR).low; + _rem = _rem.modulo(DIVISOR); + } + + return { quotient: value, rem: _rem }; +} + +// Multiply two Long values and return the 128 bit value +function multiply64x2(left: Long, right: Long): { high: Long; low: Long } { + if (!left && !right) { + return { high: Long.fromNumber(0), low: Long.fromNumber(0) }; + } + + const leftHigh = left.shiftRightUnsigned(32); + const leftLow = new Long(left.getLowBits(), 0); + const rightHigh = right.shiftRightUnsigned(32); + const rightLow = new Long(right.getLowBits(), 0); + + let productHigh = leftHigh.multiply(rightHigh); + let productMid = leftHigh.multiply(rightLow); + const productMid2 = leftLow.multiply(rightHigh); + let productLow = leftLow.multiply(rightLow); + + productHigh = productHigh.add(productMid.shiftRightUnsigned(32)); + productMid = new Long(productMid.getLowBits(), 0) + .add(productMid2) + .add(productLow.shiftRightUnsigned(32)); + + productHigh = productHigh.add(productMid.shiftRightUnsigned(32)); + productLow = productMid.shiftLeft(32).add(new Long(productLow.getLowBits(), 0)); + + // Return the 128 bit result + return { high: productHigh, low: productLow }; +} + +function lessThan(left: Long, right: Long): boolean { + // Make values unsigned + const uhleft = left.high >>> 0; + const uhright = right.high >>> 0; + + // Compare high bits first + if (uhleft < uhright) { + return true; + } else if (uhleft === uhright) { + const ulleft = left.low >>> 0; + const ulright = right.low >>> 0; + if (ulleft < ulright) return true; + } + + return false; +} + +function invalidErr(string: string, message: string) { + throw new BSONTypeError(`"${string}" is not a valid Decimal128 string - ${message}`); +} + +/** @public */ +export interface Decimal128Extended { + $numberDecimal: string; +} + +/** + * A class representation of the BSON Decimal128 type. + * @public + * @category BSONType + */ +export class Decimal128 { + _bsontype!: 'Decimal128'; + + readonly bytes!: Buffer; + + /** + * @param bytes - a buffer containing the raw Decimal128 bytes in little endian order, + * or a string representation as returned by .toString() + */ + constructor(bytes: Buffer | string) { + if (!(this instanceof Decimal128)) return new Decimal128(bytes); + + if (typeof bytes === 'string') { + this.bytes = Decimal128.fromString(bytes).bytes; + } else if (isUint8Array(bytes)) { + if (bytes.byteLength !== 16) { + throw new BSONTypeError('Decimal128 must take a Buffer of 16 bytes'); + } + this.bytes = bytes; + } else { + throw new BSONTypeError('Decimal128 must take a Buffer or string'); + } + } + + /** + * Create a Decimal128 instance from a string representation + * + * @param representation - a numeric string representation. + */ + static fromString(representation: string): Decimal128 { + // Parse state tracking + let isNegative = false; + let sawRadix = false; + let foundNonZero = false; + + // Total number of significant digits (no leading or trailing zero) + let significantDigits = 0; + // Total number of significand digits read + let nDigitsRead = 0; + // Total number of digits (no leading zeros) + let nDigits = 0; + // The number of the digits after radix + let radixPosition = 0; + // The index of the first non-zero in *str* + let firstNonZero = 0; + + // Digits Array + const digits = [0]; + // The number of digits in digits + let nDigitsStored = 0; + // Insertion pointer for digits + let digitsInsert = 0; + // The index of the first non-zero digit + let firstDigit = 0; + // The index of the last digit + let lastDigit = 0; + + // Exponent + let exponent = 0; + // loop index over array + let i = 0; + // The high 17 digits of the significand + let significandHigh = new Long(0, 0); + // The low 17 digits of the significand + let significandLow = new Long(0, 0); + // The biased exponent + let biasedExponent = 0; + + // Read index + let index = 0; + + // Naively prevent against REDOS attacks. + // TODO: implementing a custom parsing for this, or refactoring the regex would yield + // further gains. + if (representation.length >= 7000) { + throw new BSONTypeError('' + representation + ' not a valid Decimal128 string'); + } + + // Results + const stringMatch = representation.match(PARSE_STRING_REGEXP); + const infMatch = representation.match(PARSE_INF_REGEXP); + const nanMatch = representation.match(PARSE_NAN_REGEXP); + + // Validate the string + if ((!stringMatch && !infMatch && !nanMatch) || representation.length === 0) { + throw new BSONTypeError('' + representation + ' not a valid Decimal128 string'); + } + + if (stringMatch) { + // full_match = stringMatch[0] + // sign = stringMatch[1] + + const unsignedNumber = stringMatch[2]; + // stringMatch[3] is undefined if a whole number (ex "1", 12") + // but defined if a number w/ decimal in it (ex "1.0, 12.2") + + const e = stringMatch[4]; + const expSign = stringMatch[5]; + const expNumber = stringMatch[6]; + + // they provided e, but didn't give an exponent number. for ex "1e" + if (e && expNumber === undefined) invalidErr(representation, 'missing exponent power'); + + // they provided e, but didn't give a number before it. for ex "e1" + if (e && unsignedNumber === undefined) invalidErr(representation, 'missing exponent base'); + + if (e === undefined && (expSign || expNumber)) { + invalidErr(representation, 'missing e before exponent'); + } + } + + // Get the negative or positive sign + if (representation[index] === '+' || representation[index] === '-') { + isNegative = representation[index++] === '-'; + } + + // Check if user passed Infinity or NaN + if (!isDigit(representation[index]) && representation[index] !== '.') { + if (representation[index] === 'i' || representation[index] === 'I') { + return new Decimal128(Buffer.from(isNegative ? INF_NEGATIVE_BUFFER : INF_POSITIVE_BUFFER)); + } else if (representation[index] === 'N') { + return new Decimal128(Buffer.from(NAN_BUFFER)); + } + } + + // Read all the digits + while (isDigit(representation[index]) || representation[index] === '.') { + if (representation[index] === '.') { + if (sawRadix) invalidErr(representation, 'contains multiple periods'); + + sawRadix = true; + index = index + 1; + continue; + } + + if (nDigitsStored < 34) { + if (representation[index] !== '0' || foundNonZero) { + if (!foundNonZero) { + firstNonZero = nDigitsRead; + } + + foundNonZero = true; + + // Only store 34 digits + digits[digitsInsert++] = parseInt(representation[index], 10); + nDigitsStored = nDigitsStored + 1; + } + } + + if (foundNonZero) nDigits = nDigits + 1; + if (sawRadix) radixPosition = radixPosition + 1; + + nDigitsRead = nDigitsRead + 1; + index = index + 1; + } + + if (sawRadix && !nDigitsRead) + throw new BSONTypeError('' + representation + ' not a valid Decimal128 string'); + + // Read exponent if exists + if (representation[index] === 'e' || representation[index] === 'E') { + // Read exponent digits + const match = representation.substr(++index).match(EXPONENT_REGEX); + + // No digits read + if (!match || !match[2]) return new Decimal128(Buffer.from(NAN_BUFFER)); + + // Get exponent + exponent = parseInt(match[0], 10); + + // Adjust the index + index = index + match[0].length; + } + + // Return not a number + if (representation[index]) return new Decimal128(Buffer.from(NAN_BUFFER)); + + // Done reading input + // Find first non-zero digit in digits + firstDigit = 0; + + if (!nDigitsStored) { + firstDigit = 0; + lastDigit = 0; + digits[0] = 0; + nDigits = 1; + nDigitsStored = 1; + significantDigits = 0; + } else { + lastDigit = nDigitsStored - 1; + significantDigits = nDigits; + if (significantDigits !== 1) { + while (digits[firstNonZero + significantDigits - 1] === 0) { + significantDigits = significantDigits - 1; + } + } + } + + // Normalization of exponent + // Correct exponent based on radix position, and shift significand as needed + // to represent user input + + // Overflow prevention + if (exponent <= radixPosition && radixPosition - exponent > 1 << 14) { + exponent = EXPONENT_MIN; + } else { + exponent = exponent - radixPosition; + } + + // Attempt to normalize the exponent + while (exponent > EXPONENT_MAX) { + // Shift exponent to significand and decrease + lastDigit = lastDigit + 1; + + if (lastDigit - firstDigit > MAX_DIGITS) { + // Check if we have a zero then just hard clamp, otherwise fail + const digitsString = digits.join(''); + if (digitsString.match(/^0+$/)) { + exponent = EXPONENT_MAX; + break; + } + + invalidErr(representation, 'overflow'); + } + exponent = exponent - 1; + } + + while (exponent < EXPONENT_MIN || nDigitsStored < nDigits) { + // Shift last digit. can only do this if < significant digits than # stored. + if (lastDigit === 0 && significantDigits < nDigitsStored) { + exponent = EXPONENT_MIN; + significantDigits = 0; + break; + } + + if (nDigitsStored < nDigits) { + // adjust to match digits not stored + nDigits = nDigits - 1; + } else { + // adjust to round + lastDigit = lastDigit - 1; + } + + if (exponent < EXPONENT_MAX) { + exponent = exponent + 1; + } else { + // Check if we have a zero then just hard clamp, otherwise fail + const digitsString = digits.join(''); + if (digitsString.match(/^0+$/)) { + exponent = EXPONENT_MAX; + break; + } + invalidErr(representation, 'overflow'); + } + } + + // Round + // We've normalized the exponent, but might still need to round. + if (lastDigit - firstDigit + 1 < significantDigits) { + let endOfString = nDigitsRead; + + // If we have seen a radix point, 'string' is 1 longer than we have + // documented with ndigits_read, so inc the position of the first nonzero + // digit and the position that digits are read to. + if (sawRadix) { + firstNonZero = firstNonZero + 1; + endOfString = endOfString + 1; + } + // if negative, we need to increment again to account for - sign at start. + if (isNegative) { + firstNonZero = firstNonZero + 1; + endOfString = endOfString + 1; + } + + const roundDigit = parseInt(representation[firstNonZero + lastDigit + 1], 10); + let roundBit = 0; + + if (roundDigit >= 5) { + roundBit = 1; + if (roundDigit === 5) { + roundBit = digits[lastDigit] % 2 === 1 ? 1 : 0; + for (i = firstNonZero + lastDigit + 2; i < endOfString; i++) { + if (parseInt(representation[i], 10)) { + roundBit = 1; + break; + } + } + } + } + + if (roundBit) { + let dIdx = lastDigit; + + for (; dIdx >= 0; dIdx--) { + if (++digits[dIdx] > 9) { + digits[dIdx] = 0; + + // overflowed most significant digit + if (dIdx === 0) { + if (exponent < EXPONENT_MAX) { + exponent = exponent + 1; + digits[dIdx] = 1; + } else { + return new Decimal128( + Buffer.from(isNegative ? INF_NEGATIVE_BUFFER : INF_POSITIVE_BUFFER) + ); + } + } + } + } + } + } + + // Encode significand + // The high 17 digits of the significand + significandHigh = Long.fromNumber(0); + // The low 17 digits of the significand + significandLow = Long.fromNumber(0); + + // read a zero + if (significantDigits === 0) { + significandHigh = Long.fromNumber(0); + significandLow = Long.fromNumber(0); + } else if (lastDigit - firstDigit < 17) { + let dIdx = firstDigit; + significandLow = Long.fromNumber(digits[dIdx++]); + significandHigh = new Long(0, 0); + + for (; dIdx <= lastDigit; dIdx++) { + significandLow = significandLow.multiply(Long.fromNumber(10)); + significandLow = significandLow.add(Long.fromNumber(digits[dIdx])); + } + } else { + let dIdx = firstDigit; + significandHigh = Long.fromNumber(digits[dIdx++]); + + for (; dIdx <= lastDigit - 17; dIdx++) { + significandHigh = significandHigh.multiply(Long.fromNumber(10)); + significandHigh = significandHigh.add(Long.fromNumber(digits[dIdx])); + } + + significandLow = Long.fromNumber(digits[dIdx++]); + + for (; dIdx <= lastDigit; dIdx++) { + significandLow = significandLow.multiply(Long.fromNumber(10)); + significandLow = significandLow.add(Long.fromNumber(digits[dIdx])); + } + } + + const significand = multiply64x2(significandHigh, Long.fromString('100000000000000000')); + significand.low = significand.low.add(significandLow); + + if (lessThan(significand.low, significandLow)) { + significand.high = significand.high.add(Long.fromNumber(1)); + } + + // Biased exponent + biasedExponent = exponent + EXPONENT_BIAS; + const dec = { low: Long.fromNumber(0), high: Long.fromNumber(0) }; + + // Encode combination, exponent, and significand. + if ( + significand.high.shiftRightUnsigned(49).and(Long.fromNumber(1)).equals(Long.fromNumber(1)) + ) { + // Encode '11' into bits 1 to 3 + dec.high = dec.high.or(Long.fromNumber(0x3).shiftLeft(61)); + dec.high = dec.high.or( + Long.fromNumber(biasedExponent).and(Long.fromNumber(0x3fff).shiftLeft(47)) + ); + dec.high = dec.high.or(significand.high.and(Long.fromNumber(0x7fffffffffff))); + } else { + dec.high = dec.high.or(Long.fromNumber(biasedExponent & 0x3fff).shiftLeft(49)); + dec.high = dec.high.or(significand.high.and(Long.fromNumber(0x1ffffffffffff))); + } + + dec.low = significand.low; + + // Encode sign + if (isNegative) { + dec.high = dec.high.or(Long.fromString('9223372036854775808')); + } + + // Encode into a buffer + const buffer = Buffer.alloc(16); + index = 0; + + // Encode the low 64 bits of the decimal + // Encode low bits + buffer[index++] = dec.low.low & 0xff; + buffer[index++] = (dec.low.low >> 8) & 0xff; + buffer[index++] = (dec.low.low >> 16) & 0xff; + buffer[index++] = (dec.low.low >> 24) & 0xff; + // Encode high bits + buffer[index++] = dec.low.high & 0xff; + buffer[index++] = (dec.low.high >> 8) & 0xff; + buffer[index++] = (dec.low.high >> 16) & 0xff; + buffer[index++] = (dec.low.high >> 24) & 0xff; + + // Encode the high 64 bits of the decimal + // Encode low bits + buffer[index++] = dec.high.low & 0xff; + buffer[index++] = (dec.high.low >> 8) & 0xff; + buffer[index++] = (dec.high.low >> 16) & 0xff; + buffer[index++] = (dec.high.low >> 24) & 0xff; + // Encode high bits + buffer[index++] = dec.high.high & 0xff; + buffer[index++] = (dec.high.high >> 8) & 0xff; + buffer[index++] = (dec.high.high >> 16) & 0xff; + buffer[index++] = (dec.high.high >> 24) & 0xff; + + // Return the new Decimal128 + return new Decimal128(buffer); + } + + /** Create a string representation of the raw Decimal128 value */ + toString(): string { + // Note: bits in this routine are referred to starting at 0, + // from the sign bit, towards the coefficient. + + // decoded biased exponent (14 bits) + let biased_exponent; + // the number of significand digits + let significand_digits = 0; + // the base-10 digits in the significand + const significand = new Array(36); + for (let i = 0; i < significand.length; i++) significand[i] = 0; + // read pointer into significand + let index = 0; + + // true if the number is zero + let is_zero = false; + + // the most significant significand bits (50-46) + let significand_msb; + // temporary storage for significand decoding + let significand128: { parts: [number, number, number, number] } = { parts: [0, 0, 0, 0] }; + // indexing variables + let j, k; + + // Output string + const string: string[] = []; + + // Unpack index + index = 0; + + // Buffer reference + const buffer = this.bytes; + + // Unpack the low 64bits into a long + // bits 96 - 127 + const low = + buffer[index++] | (buffer[index++] << 8) | (buffer[index++] << 16) | (buffer[index++] << 24); + // bits 64 - 95 + const midl = + buffer[index++] | (buffer[index++] << 8) | (buffer[index++] << 16) | (buffer[index++] << 24); + + // Unpack the high 64bits into a long + // bits 32 - 63 + const midh = + buffer[index++] | (buffer[index++] << 8) | (buffer[index++] << 16) | (buffer[index++] << 24); + // bits 0 - 31 + const high = + buffer[index++] | (buffer[index++] << 8) | (buffer[index++] << 16) | (buffer[index++] << 24); + + // Unpack index + index = 0; + + // Create the state of the decimal + const dec = { + low: new Long(low, midl), + high: new Long(midh, high) + }; + + if (dec.high.lessThan(Long.ZERO)) { + string.push('-'); + } + + // Decode combination field and exponent + // bits 1 - 5 + const combination = (high >> 26) & COMBINATION_MASK; + + if (combination >> 3 === 3) { + // Check for 'special' values + if (combination === COMBINATION_INFINITY) { + return string.join('') + 'Infinity'; + } else if (combination === COMBINATION_NAN) { + return 'NaN'; + } else { + biased_exponent = (high >> 15) & EXPONENT_MASK; + significand_msb = 0x08 + ((high >> 14) & 0x01); + } + } else { + significand_msb = (high >> 14) & 0x07; + biased_exponent = (high >> 17) & EXPONENT_MASK; + } + + // unbiased exponent + const exponent = biased_exponent - EXPONENT_BIAS; + + // Create string of significand digits + + // Convert the 114-bit binary number represented by + // (significand_high, significand_low) to at most 34 decimal + // digits through modulo and division. + significand128.parts[0] = (high & 0x3fff) + ((significand_msb & 0xf) << 14); + significand128.parts[1] = midh; + significand128.parts[2] = midl; + significand128.parts[3] = low; + + if ( + significand128.parts[0] === 0 && + significand128.parts[1] === 0 && + significand128.parts[2] === 0 && + significand128.parts[3] === 0 + ) { + is_zero = true; + } else { + for (k = 3; k >= 0; k--) { + let least_digits = 0; + // Perform the divide + const result = divideu128(significand128); + significand128 = result.quotient; + least_digits = result.rem.low; + + // We now have the 9 least significant digits (in base 2). + // Convert and output to string. + if (!least_digits) continue; + + for (j = 8; j >= 0; j--) { + // significand[k * 9 + j] = Math.round(least_digits % 10); + significand[k * 9 + j] = least_digits % 10; + // least_digits = Math.round(least_digits / 10); + least_digits = Math.floor(least_digits / 10); + } + } + } + + // Output format options: + // Scientific - [-]d.dddE(+/-)dd or [-]dE(+/-)dd + // Regular - ddd.ddd + + if (is_zero) { + significand_digits = 1; + significand[index] = 0; + } else { + significand_digits = 36; + while (!significand[index]) { + significand_digits = significand_digits - 1; + index = index + 1; + } + } + + // the exponent if scientific notation is used + const scientific_exponent = significand_digits - 1 + exponent; + + // The scientific exponent checks are dictated by the string conversion + // specification and are somewhat arbitrary cutoffs. + // + // We must check exponent > 0, because if this is the case, the number + // has trailing zeros. However, we *cannot* output these trailing zeros, + // because doing so would change the precision of the value, and would + // change stored data if the string converted number is round tripped. + if (scientific_exponent >= 34 || scientific_exponent <= -7 || exponent > 0) { + // Scientific format + + // if there are too many significant digits, we should just be treating numbers + // as + or - 0 and using the non-scientific exponent (this is for the "invalid + // representation should be treated as 0/-0" spec cases in decimal128-1.json) + if (significand_digits > 34) { + string.push(`${0}`); + if (exponent > 0) string.push('E+' + exponent); + else if (exponent < 0) string.push('E' + exponent); + return string.join(''); + } + + string.push(`${significand[index++]}`); + significand_digits = significand_digits - 1; + + if (significand_digits) { + string.push('.'); + } + + for (let i = 0; i < significand_digits; i++) { + string.push(`${significand[index++]}`); + } + + // Exponent + string.push('E'); + if (scientific_exponent > 0) { + string.push('+' + scientific_exponent); + } else { + string.push(`${scientific_exponent}`); + } + } else { + // Regular format with no decimal place + if (exponent >= 0) { + for (let i = 0; i < significand_digits; i++) { + string.push(`${significand[index++]}`); + } + } else { + let radix_position = significand_digits + exponent; + + // non-zero digits before radix + if (radix_position > 0) { + for (let i = 0; i < radix_position; i++) { + string.push(`${significand[index++]}`); + } + } else { + string.push('0'); + } + + string.push('.'); + // add leading zeros after radix + while (radix_position++ < 0) { + string.push('0'); + } + + for (let i = 0; i < significand_digits - Math.max(radix_position - 1, 0); i++) { + string.push(`${significand[index++]}`); + } + } + } + + return string.join(''); + } + + toJSON(): Decimal128Extended { + return { $numberDecimal: this.toString() }; + } + + /** @internal */ + toExtendedJSON(): Decimal128Extended { + return { $numberDecimal: this.toString() }; + } + + /** @internal */ + static fromExtendedJSON(doc: Decimal128Extended): Decimal128 { + return Decimal128.fromString(doc.$numberDecimal); + } + + /** @internal */ + [Symbol.for('nodejs.util.inspect.custom')](): string { + return this.inspect(); + } + + inspect(): string { + return `new Decimal128("${this.toString()}")`; + } +} + +Object.defineProperty(Decimal128.prototype, '_bsontype', { value: 'Decimal128' }); diff --git a/node_modules/bson/src/double.ts b/node_modules/bson/src/double.ts new file mode 100644 index 000000000..51bbf22d7 --- /dev/null +++ b/node_modules/bson/src/double.ts @@ -0,0 +1,91 @@ +import type { EJSONOptions } from './extended_json'; + +/** @public */ +export interface DoubleExtended { + $numberDouble: string; +} + +/** + * A class representation of the BSON Double type. + * @public + * @category BSONType + */ +export class Double { + _bsontype!: 'Double'; + + value!: number; + /** + * Create a Double type + * + * @param value - the number we want to represent as a double. + */ + constructor(value: number) { + if (!(this instanceof Double)) return new Double(value); + + if ((value as unknown) instanceof Number) { + value = value.valueOf(); + } + + this.value = +value; + } + + /** + * Access the number value. + * + * @returns returns the wrapped double number. + */ + valueOf(): number { + return this.value; + } + + toJSON(): number { + return this.value; + } + + toString(radix?: number): string { + return this.value.toString(radix); + } + + /** @internal */ + toExtendedJSON(options?: EJSONOptions): number | DoubleExtended { + if (options && (options.legacy || (options.relaxed && isFinite(this.value)))) { + return this.value; + } + + // NOTE: JavaScript has +0 and -0, apparently to model limit calculations. If a user + // explicitly provided `-0` then we need to ensure the sign makes it into the output + if (Object.is(Math.sign(this.value), -0)) { + return { $numberDouble: `-${this.value.toFixed(1)}` }; + } + + let $numberDouble: string; + if (Number.isInteger(this.value)) { + $numberDouble = this.value.toFixed(1); + if ($numberDouble.length >= 13) { + $numberDouble = this.value.toExponential(13).toUpperCase(); + } + } else { + $numberDouble = this.value.toString(); + } + + return { $numberDouble }; + } + + /** @internal */ + static fromExtendedJSON(doc: DoubleExtended, options?: EJSONOptions): number | Double { + const doubleValue = parseFloat(doc.$numberDouble); + return options && options.relaxed ? doubleValue : new Double(doubleValue); + } + + /** @internal */ + [Symbol.for('nodejs.util.inspect.custom')](): string { + return this.inspect(); + } + + inspect(): string { + const eJSON = this.toExtendedJSON() as DoubleExtended; + return `new Double(${eJSON.$numberDouble})`; + } +} + +Object.defineProperty(Double.prototype, '_bsontype', { value: 'Double' }); diff --git a/node_modules/bson/src/ensure_buffer.ts b/node_modules/bson/src/ensure_buffer.ts new file mode 100644 index 000000000..8b82a085e --- /dev/null +++ b/node_modules/bson/src/ensure_buffer.ts @@ -0,0 +1,27 @@ +import { Buffer } from 'buffer'; +import { BSONTypeError } from './error'; +import { isAnyArrayBuffer } from './parser/utils'; + +/** + * Makes sure that, if a Uint8Array is passed in, it is wrapped in a Buffer. + * + * @param potentialBuffer - The potential buffer + * @returns Buffer the input if potentialBuffer is a buffer, or a buffer that + * wraps a passed in Uint8Array + * @throws BSONTypeError If anything other than a Buffer or Uint8Array is passed in + */ +export function ensureBuffer(potentialBuffer: Buffer | ArrayBufferView | ArrayBuffer): Buffer { + if (ArrayBuffer.isView(potentialBuffer)) { + return Buffer.from( + potentialBuffer.buffer, + potentialBuffer.byteOffset, + potentialBuffer.byteLength + ); + } + + if (isAnyArrayBuffer(potentialBuffer)) { + return Buffer.from(potentialBuffer); + } + + throw new BSONTypeError('Must use either Buffer or TypedArray'); +} diff --git a/node_modules/bson/src/error.ts b/node_modules/bson/src/error.ts new file mode 100644 index 000000000..8f1a41736 --- /dev/null +++ b/node_modules/bson/src/error.ts @@ -0,0 +1,23 @@ +/** @public */ +export class BSONError extends Error { + constructor(message: string) { + super(message); + Object.setPrototypeOf(this, BSONError.prototype); + } + + get name(): string { + return 'BSONError'; + } +} + +/** @public */ +export class BSONTypeError extends TypeError { + constructor(message: string) { + super(message); + Object.setPrototypeOf(this, BSONTypeError.prototype); + } + + get name(): string { + return 'BSONTypeError'; + } +} diff --git a/node_modules/bson/src/extended_json.ts b/node_modules/bson/src/extended_json.ts new file mode 100644 index 000000000..e90464376 --- /dev/null +++ b/node_modules/bson/src/extended_json.ts @@ -0,0 +1,451 @@ +import { Binary } from './binary'; +import type { Document } from './bson'; +import { Code } from './code'; +import { DBRef, isDBRefLike } from './db_ref'; +import { Decimal128 } from './decimal128'; +import { Double } from './double'; +import { BSONError, BSONTypeError } from './error'; +import { Int32 } from './int_32'; +import { Long } from './long'; +import { MaxKey } from './max_key'; +import { MinKey } from './min_key'; +import { ObjectId } from './objectid'; +import { isDate, isObjectLike, isRegExp } from './parser/utils'; +import { BSONRegExp } from './regexp'; +import { BSONSymbol } from './symbol'; +import { Timestamp } from './timestamp'; + +/** @public */ +export type EJSONOptions = EJSON.Options; + +/** @internal */ +type BSONType = + | Binary + | Code + | DBRef + | Decimal128 + | Double + | Int32 + | Long + | MaxKey + | MinKey + | ObjectId + | BSONRegExp + | BSONSymbol + | Timestamp; + +export function isBSONType(value: unknown): value is BSONType { + return ( + isObjectLike(value) && Reflect.has(value, '_bsontype') && typeof value._bsontype === 'string' + ); +} + +// INT32 boundaries +const BSON_INT32_MAX = 0x7fffffff; +const BSON_INT32_MIN = -0x80000000; +// INT64 boundaries +const BSON_INT64_MAX = 0x7fffffffffffffff; +const BSON_INT64_MIN = -0x8000000000000000; + +// all the types where we don't need to do any special processing and can just pass the EJSON +//straight to type.fromExtendedJSON +const keysToCodecs = { + $oid: ObjectId, + $binary: Binary, + $uuid: Binary, + $symbol: BSONSymbol, + $numberInt: Int32, + $numberDecimal: Decimal128, + $numberDouble: Double, + $numberLong: Long, + $minKey: MinKey, + $maxKey: MaxKey, + $regex: BSONRegExp, + $regularExpression: BSONRegExp, + $timestamp: Timestamp +} as const; + +// eslint-disable-next-line @typescript-eslint/no-explicit-any +function deserializeValue(value: any, options: EJSON.Options = {}) { + if (typeof value === 'number') { + if (options.relaxed || options.legacy) { + return value; + } + + // if it's an integer, should interpret as smallest BSON integer + // that can represent it exactly. (if out of range, interpret as double.) + if (Math.floor(value) === value) { + if (value >= BSON_INT32_MIN && value <= BSON_INT32_MAX) return new Int32(value); + if (value >= BSON_INT64_MIN && value <= BSON_INT64_MAX) return Long.fromNumber(value); + } + + // If the number is a non-integer or out of integer range, should interpret as BSON Double. + return new Double(value); + } + + // from here on out we're looking for bson types, so bail if its not an object + if (value == null || typeof value !== 'object') return value; + + // upgrade deprecated undefined to null + if (value.$undefined) return null; + + const keys = Object.keys(value).filter( + k => k.startsWith('$') && value[k] != null + ) as (keyof typeof keysToCodecs)[]; + for (let i = 0; i < keys.length; i++) { + const c = keysToCodecs[keys[i]]; + if (c) return c.fromExtendedJSON(value, options); + } + + if (value.$date != null) { + const d = value.$date; + const date = new Date(); + + if (options.legacy) { + if (typeof d === 'number') date.setTime(d); + else if (typeof d === 'string') date.setTime(Date.parse(d)); + } else { + if (typeof d === 'string') date.setTime(Date.parse(d)); + else if (Long.isLong(d)) date.setTime(d.toNumber()); + else if (typeof d === 'number' && options.relaxed) date.setTime(d); + } + return date; + } + + if (value.$code != null) { + const copy = Object.assign({}, value); + if (value.$scope) { + copy.$scope = deserializeValue(value.$scope); + } + + return Code.fromExtendedJSON(value); + } + + if (isDBRefLike(value) || value.$dbPointer) { + const v = value.$ref ? value : value.$dbPointer; + + // we run into this in a "degenerate EJSON" case (with $id and $ref order flipped) + // because of the order JSON.parse goes through the document + if (v instanceof DBRef) return v; + + const dollarKeys = Object.keys(v).filter(k => k.startsWith('$')); + let valid = true; + dollarKeys.forEach(k => { + if (['$ref', '$id', '$db'].indexOf(k) === -1) valid = false; + }); + + // only make DBRef if $ keys are all valid + if (valid) return DBRef.fromExtendedJSON(v); + } + + return value; +} + +type EJSONSerializeOptions = EJSON.Options & { + seenObjects: { obj: unknown; propertyName: string }[]; +}; + +// eslint-disable-next-line @typescript-eslint/no-explicit-any +function serializeArray(array: any[], options: EJSONSerializeOptions): any[] { + return array.map((v: unknown, index: number) => { + options.seenObjects.push({ propertyName: `index ${index}`, obj: null }); + try { + return serializeValue(v, options); + } finally { + options.seenObjects.pop(); + } + }); +} + +function getISOString(date: Date) { + const isoStr = date.toISOString(); + // we should only show milliseconds in timestamp if they're non-zero + return date.getUTCMilliseconds() !== 0 ? isoStr : isoStr.slice(0, -5) + 'Z'; +} + +// eslint-disable-next-line @typescript-eslint/no-explicit-any +function serializeValue(value: any, options: EJSONSerializeOptions): any { + if ((typeof value === 'object' || typeof value === 'function') && value !== null) { + const index = options.seenObjects.findIndex(entry => entry.obj === value); + if (index !== -1) { + const props = options.seenObjects.map(entry => entry.propertyName); + const leadingPart = props + .slice(0, index) + .map(prop => `${prop} -> `) + .join(''); + const alreadySeen = props[index]; + const circularPart = + ' -> ' + + props + .slice(index + 1, props.length - 1) + .map(prop => `${prop} -> `) + .join(''); + const current = props[props.length - 1]; + const leadingSpace = ' '.repeat(leadingPart.length + alreadySeen.length / 2); + const dashes = '-'.repeat( + circularPart.length + (alreadySeen.length + current.length) / 2 - 1 + ); + + throw new BSONTypeError( + 'Converting circular structure to EJSON:\n' + + ` ${leadingPart}${alreadySeen}${circularPart}${current}\n` + + ` ${leadingSpace}\\${dashes}/` + ); + } + options.seenObjects[options.seenObjects.length - 1].obj = value; + } + + if (Array.isArray(value)) return serializeArray(value, options); + + if (value === undefined) return null; + + if (value instanceof Date || isDate(value)) { + const dateNum = value.getTime(), + // is it in year range 1970-9999? + inRange = dateNum > -1 && dateNum < 253402318800000; + + if (options.legacy) { + return options.relaxed && inRange + ? { $date: value.getTime() } + : { $date: getISOString(value) }; + } + return options.relaxed && inRange + ? { $date: getISOString(value) } + : { $date: { $numberLong: value.getTime().toString() } }; + } + + if (typeof value === 'number' && (!options.relaxed || !isFinite(value))) { + // it's an integer + if (Math.floor(value) === value) { + const int32Range = value >= BSON_INT32_MIN && value <= BSON_INT32_MAX, + int64Range = value >= BSON_INT64_MIN && value <= BSON_INT64_MAX; + + // interpret as being of the smallest BSON integer type that can represent the number exactly + if (int32Range) return { $numberInt: value.toString() }; + if (int64Range) return { $numberLong: value.toString() }; + } + return { $numberDouble: value.toString() }; + } + + if (value instanceof RegExp || isRegExp(value)) { + let flags = value.flags; + if (flags === undefined) { + const match = value.toString().match(/[gimuy]*$/); + if (match) { + flags = match[0]; + } + } + + const rx = new BSONRegExp(value.source, flags); + return rx.toExtendedJSON(options); + } + + if (value != null && typeof value === 'object') return serializeDocument(value, options); + return value; +} + +const BSON_TYPE_MAPPINGS = { + Binary: (o: Binary) => new Binary(o.value(), o.sub_type), + Code: (o: Code) => new Code(o.code, o.scope), + DBRef: (o: DBRef) => new DBRef(o.collection || o.namespace, o.oid, o.db, o.fields), // "namespace" for 1.x library backwards compat + Decimal128: (o: Decimal128) => new Decimal128(o.bytes), + Double: (o: Double) => new Double(o.value), + Int32: (o: Int32) => new Int32(o.value), + Long: ( + o: Long & { + low_: number; + high_: number; + unsigned_: boolean | undefined; + } + ) => + Long.fromBits( + // underscore variants for 1.x backwards compatibility + o.low != null ? o.low : o.low_, + o.low != null ? o.high : o.high_, + o.low != null ? o.unsigned : o.unsigned_ + ), + MaxKey: () => new MaxKey(), + MinKey: () => new MinKey(), + ObjectID: (o: ObjectId) => new ObjectId(o), + ObjectId: (o: ObjectId) => new ObjectId(o), // support 4.0.0/4.0.1 before _bsontype was reverted back to ObjectID + BSONRegExp: (o: BSONRegExp) => new BSONRegExp(o.pattern, o.options), + Symbol: (o: BSONSymbol) => new BSONSymbol(o.value), + Timestamp: (o: Timestamp) => Timestamp.fromBits(o.low, o.high) +} as const; + +// eslint-disable-next-line @typescript-eslint/no-explicit-any +function serializeDocument(doc: any, options: EJSONSerializeOptions) { + if (doc == null || typeof doc !== 'object') throw new BSONError('not an object instance'); + + const bsontype: BSONType['_bsontype'] = doc._bsontype; + if (typeof bsontype === 'undefined') { + // It's a regular object. Recursively serialize its property values. + const _doc: Document = {}; + for (const name in doc) { + options.seenObjects.push({ propertyName: name, obj: null }); + try { + _doc[name] = serializeValue(doc[name], options); + } finally { + options.seenObjects.pop(); + } + } + return _doc; + } else if (isBSONType(doc)) { + // the "document" is really just a BSON type object + // eslint-disable-next-line @typescript-eslint/no-explicit-any + let outDoc: any = doc; + if (typeof outDoc.toExtendedJSON !== 'function') { + // There's no EJSON serialization function on the object. It's probably an + // object created by a previous version of this library (or another library) + // that's duck-typing objects to look like they were generated by this library). + // Copy the object into this library's version of that type. + const mapper = BSON_TYPE_MAPPINGS[doc._bsontype]; + if (!mapper) { + throw new BSONTypeError('Unrecognized or invalid _bsontype: ' + doc._bsontype); + } + outDoc = mapper(outDoc); + } + + // Two BSON types may have nested objects that may need to be serialized too + if (bsontype === 'Code' && outDoc.scope) { + outDoc = new Code(outDoc.code, serializeValue(outDoc.scope, options)); + } else if (bsontype === 'DBRef' && outDoc.oid) { + outDoc = new DBRef( + serializeValue(outDoc.collection, options), + serializeValue(outDoc.oid, options), + serializeValue(outDoc.db, options), + serializeValue(outDoc.fields, options) + ); + } + + return outDoc.toExtendedJSON(options); + } else { + throw new BSONError('_bsontype must be a string, but was: ' + typeof bsontype); + } +} + +/** + * EJSON parse / stringify API + * @public + */ +// the namespace here is used to emulate `export * as EJSON from '...'` +// which as of now (sept 2020) api-extractor does not support +// eslint-disable-next-line @typescript-eslint/no-namespace +export namespace EJSON { + export interface Options { + /** Output using the Extended JSON v1 spec */ + legacy?: boolean; + /** Enable Extended JSON's `relaxed` mode, which attempts to return native JS types where possible, rather than BSON types */ + relaxed?: boolean; + /** + * Disable Extended JSON's `relaxed` mode, which attempts to return BSON types where possible, rather than native JS types + * @deprecated Please use the relaxed property instead + */ + strict?: boolean; + } + + /** + * Parse an Extended JSON string, constructing the JavaScript value or object described by that + * string. + * + * @example + * ```js + * const { EJSON } = require('bson'); + * const text = '{ "int32": { "$numberInt": "10" } }'; + * + * // prints { int32: { [String: '10'] _bsontype: 'Int32', value: '10' } } + * console.log(EJSON.parse(text, { relaxed: false })); + * + * // prints { int32: 10 } + * console.log(EJSON.parse(text)); + * ``` + */ + export function parse(text: string, options?: EJSON.Options): SerializableTypes { + const finalOptions = Object.assign({}, { relaxed: true, legacy: false }, options); + + // relaxed implies not strict + if (typeof finalOptions.relaxed === 'boolean') finalOptions.strict = !finalOptions.relaxed; + if (typeof finalOptions.strict === 'boolean') finalOptions.relaxed = !finalOptions.strict; + + return JSON.parse(text, (key, value) => { + if (key.indexOf('\x00') !== -1) { + throw new BSONError( + `BSON Document field names cannot contain null bytes, found: ${JSON.stringify(key)}` + ); + } + return deserializeValue(value, finalOptions); + }); + } + + export type JSONPrimitive = string | number | boolean | null; + export type SerializableTypes = Document | Array | JSONPrimitive; + + /** + * Converts a BSON document to an Extended JSON string, optionally replacing values if a replacer + * function is specified or optionally including only the specified properties if a replacer array + * is specified. + * + * @param value - The value to convert to extended JSON + * @param replacer - A function that alters the behavior of the stringification process, or an array of String and Number objects that serve as a whitelist for selecting/filtering the properties of the value object to be included in the JSON string. If this value is null or not provided, all properties of the object are included in the resulting JSON string + * @param space - A String or Number object that's used to insert white space into the output JSON string for readability purposes. + * @param options - Optional settings + * + * @example + * ```js + * const { EJSON } = require('bson'); + * const Int32 = require('mongodb').Int32; + * const doc = { int32: new Int32(10) }; + * + * // prints '{"int32":{"$numberInt":"10"}}' + * console.log(EJSON.stringify(doc, { relaxed: false })); + * + * // prints '{"int32":10}' + * console.log(EJSON.stringify(doc)); + * ``` + */ + export function stringify( + value: SerializableTypes, + // eslint-disable-next-line @typescript-eslint/no-explicit-any + replacer?: (number | string)[] | ((this: any, key: string, value: any) => any) | EJSON.Options, + space?: string | number, + options?: EJSON.Options + ): string { + if (space != null && typeof space === 'object') { + options = space; + space = 0; + } + if (replacer != null && typeof replacer === 'object' && !Array.isArray(replacer)) { + options = replacer; + replacer = undefined; + space = 0; + } + const serializeOptions = Object.assign({ relaxed: true, legacy: false }, options, { + seenObjects: [{ propertyName: '(root)', obj: null }] + }); + + const doc = serializeValue(value, serializeOptions); + return JSON.stringify(doc, replacer as Parameters[1], space); + } + + /** + * Serializes an object to an Extended JSON string, and reparse it as a JavaScript object. + * + * @param value - The object to serialize + * @param options - Optional settings passed to the `stringify` function + */ + export function serialize(value: SerializableTypes, options?: EJSON.Options): Document { + options = options || {}; + return JSON.parse(stringify(value, options)); + } + + /** + * Deserializes an Extended JSON object into a plain JavaScript object with native/BSON types + * + * @param ejson - The Extended JSON object to deserialize + * @param options - Optional settings passed to the parse method + */ + export function deserialize(ejson: Document, options?: EJSON.Options): SerializableTypes { + options = options || {}; + return parse(JSON.stringify(ejson), options); + } +} diff --git a/node_modules/bson/src/float_parser.ts b/node_modules/bson/src/float_parser.ts new file mode 100644 index 000000000..c881f4cf6 --- /dev/null +++ b/node_modules/bson/src/float_parser.ts @@ -0,0 +1,152 @@ +// Copyright (c) 2008, Fair Oaks Labs, Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// +// * Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// +// * Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// * Neither the name of Fair Oaks Labs, Inc. nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// +// +// Modifications to writeIEEE754 to support negative zeroes made by Brian White + +type NumericalSequence = { [index: number]: number }; + +export function readIEEE754( + buffer: NumericalSequence, + offset: number, + endian: 'big' | 'little', + mLen: number, + nBytes: number +): number { + let e: number; + let m: number; + const bBE = endian === 'big'; + const eLen = nBytes * 8 - mLen - 1; + const eMax = (1 << eLen) - 1; + const eBias = eMax >> 1; + let nBits = -7; + let i = bBE ? 0 : nBytes - 1; + const d = bBE ? 1 : -1; + let s = buffer[offset + i]; + + i += d; + + e = s & ((1 << -nBits) - 1); + s >>= -nBits; + nBits += eLen; + for (; nBits > 0; e = e * 256 + buffer[offset + i], i += d, nBits -= 8); + + m = e & ((1 << -nBits) - 1); + e >>= -nBits; + nBits += mLen; + for (; nBits > 0; m = m * 256 + buffer[offset + i], i += d, nBits -= 8); + + if (e === 0) { + e = 1 - eBias; + } else if (e === eMax) { + return m ? NaN : (s ? -1 : 1) * Infinity; + } else { + m = m + Math.pow(2, mLen); + e = e - eBias; + } + return (s ? -1 : 1) * m * Math.pow(2, e - mLen); +} + +export function writeIEEE754( + buffer: NumericalSequence, + value: number, + offset: number, + endian: 'big' | 'little', + mLen: number, + nBytes: number +): void { + let e: number; + let m: number; + let c: number; + const bBE = endian === 'big'; + let eLen = nBytes * 8 - mLen - 1; + const eMax = (1 << eLen) - 1; + const eBias = eMax >> 1; + const rt = mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0; + let i = bBE ? nBytes - 1 : 0; + const d = bBE ? -1 : 1; + const s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0; + + value = Math.abs(value); + + if (isNaN(value) || value === Infinity) { + m = isNaN(value) ? 1 : 0; + e = eMax; + } else { + e = Math.floor(Math.log(value) / Math.LN2); + if (value * (c = Math.pow(2, -e)) < 1) { + e--; + c *= 2; + } + if (e + eBias >= 1) { + value += rt / c; + } else { + value += rt * Math.pow(2, 1 - eBias); + } + if (value * c >= 2) { + e++; + c /= 2; + } + + if (e + eBias >= eMax) { + m = 0; + e = eMax; + } else if (e + eBias >= 1) { + m = (value * c - 1) * Math.pow(2, mLen); + e = e + eBias; + } else { + m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen); + e = 0; + } + } + + if (isNaN(value)) m = 0; + + while (mLen >= 8) { + buffer[offset + i] = m & 0xff; + i += d; + m /= 256; + mLen -= 8; + } + + e = (e << mLen) | m; + + if (isNaN(value)) e += 8; + + eLen += mLen; + + while (eLen > 0) { + buffer[offset + i] = e & 0xff; + i += d; + e /= 256; + eLen -= 8; + } + + buffer[offset + i - d] |= s * 128; +} diff --git a/node_modules/bson/src/int_32.ts b/node_modules/bson/src/int_32.ts new file mode 100644 index 000000000..b3b5760cc --- /dev/null +++ b/node_modules/bson/src/int_32.ts @@ -0,0 +1,70 @@ +import type { EJSONOptions } from './extended_json'; + +/** @public */ +export interface Int32Extended { + $numberInt: string; +} + +/** + * A class representation of a BSON Int32 type. + * @public + * @category BSONType + */ +export class Int32 { + _bsontype!: 'Int32'; + + value!: number; + /** + * Create an Int32 type + * + * @param value - the number we want to represent as an int32. + */ + constructor(value: number | string) { + if (!(this instanceof Int32)) return new Int32(value); + + if ((value as unknown) instanceof Number) { + value = value.valueOf(); + } + + this.value = +value | 0; + } + + /** + * Access the number value. + * + * @returns returns the wrapped int32 number. + */ + valueOf(): number { + return this.value; + } + + toString(radix?: number): string { + return this.value.toString(radix); + } + + toJSON(): number { + return this.value; + } + + /** @internal */ + toExtendedJSON(options?: EJSONOptions): number | Int32Extended { + if (options && (options.relaxed || options.legacy)) return this.value; + return { $numberInt: this.value.toString() }; + } + + /** @internal */ + static fromExtendedJSON(doc: Int32Extended, options?: EJSONOptions): number | Int32 { + return options && options.relaxed ? parseInt(doc.$numberInt, 10) : new Int32(doc.$numberInt); + } + + /** @internal */ + [Symbol.for('nodejs.util.inspect.custom')](): string { + return this.inspect(); + } + + inspect(): string { + return `new Int32(${this.valueOf()})`; + } +} + +Object.defineProperty(Int32.prototype, '_bsontype', { value: 'Int32' }); diff --git a/node_modules/bson/src/long.ts b/node_modules/bson/src/long.ts new file mode 100644 index 000000000..1f78b2b95 --- /dev/null +++ b/node_modules/bson/src/long.ts @@ -0,0 +1,1015 @@ +import type { EJSONOptions } from './extended_json'; +import { isObjectLike } from './parser/utils'; +import type { Timestamp } from './timestamp'; + +interface LongWASMHelpers { + /** Gets the high bits of the last operation performed */ + get_high(): number; + div_u(lowBits: number, highBits: number, lowBitsDivisor: number, highBitsDivisor: number): number; + div_s(lowBits: number, highBits: number, lowBitsDivisor: number, highBitsDivisor: number): number; + rem_u(lowBits: number, highBits: number, lowBitsDivisor: number, highBitsDivisor: number): number; + rem_s(lowBits: number, highBits: number, lowBitsDivisor: number, highBitsDivisor: number): number; + mul( + lowBits: number, + highBits: number, + lowBitsMultiplier: number, + highBitsMultiplier: number + ): number; +} + +/** + * wasm optimizations, to do native i64 multiplication and divide + */ +let wasm: LongWASMHelpers | undefined = undefined; + +/* We do not want to have to include DOM types just for this check */ +// eslint-disable-next-line @typescript-eslint/no-explicit-any +declare const WebAssembly: any; + +try { + wasm = new WebAssembly.Instance( + new WebAssembly.Module( + // prettier-ignore + new Uint8Array([0, 97, 115, 109, 1, 0, 0, 0, 1, 13, 2, 96, 0, 1, 127, 96, 4, 127, 127, 127, 127, 1, 127, 3, 7, 6, 0, 1, 1, 1, 1, 1, 6, 6, 1, 127, 1, 65, 0, 11, 7, 50, 6, 3, 109, 117, 108, 0, 1, 5, 100, 105, 118, 95, 115, 0, 2, 5, 100, 105, 118, 95, 117, 0, 3, 5, 114, 101, 109, 95, 115, 0, 4, 5, 114, 101, 109, 95, 117, 0, 5, 8, 103, 101, 116, 95, 104, 105, 103, 104, 0, 0, 10, 191, 1, 6, 4, 0, 35, 0, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 126, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 127, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 128, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 129, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 130, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11]) + ), + {} + ).exports as unknown as LongWASMHelpers; +} catch { + // no wasm support +} + +const TWO_PWR_16_DBL = 1 << 16; +const TWO_PWR_24_DBL = 1 << 24; +const TWO_PWR_32_DBL = TWO_PWR_16_DBL * TWO_PWR_16_DBL; +const TWO_PWR_64_DBL = TWO_PWR_32_DBL * TWO_PWR_32_DBL; +const TWO_PWR_63_DBL = TWO_PWR_64_DBL / 2; + +/** A cache of the Long representations of small integer values. */ +const INT_CACHE: { [key: number]: Long } = {}; + +/** A cache of the Long representations of small unsigned integer values. */ +const UINT_CACHE: { [key: number]: Long } = {}; + +/** @public */ +export interface LongExtended { + $numberLong: string; +} + +/** + * A class representing a 64-bit integer + * @public + * @category BSONType + * @remarks + * The internal representation of a long is the two given signed, 32-bit values. + * We use 32-bit pieces because these are the size of integers on which + * Javascript performs bit-operations. For operations like addition and + * multiplication, we split each number into 16 bit pieces, which can easily be + * multiplied within Javascript's floating-point representation without overflow + * or change in sign. + * In the algorithms below, we frequently reduce the negative case to the + * positive case by negating the input(s) and then post-processing the result. + * Note that we must ALWAYS check specially whether those values are MIN_VALUE + * (-2^63) because -MIN_VALUE == MIN_VALUE (since 2^63 cannot be represented as + * a positive number, it overflows back into a negative). Not handling this + * case would often result in infinite recursion. + * Common constant values ZERO, ONE, NEG_ONE, etc. are found as static properties on this class. + */ +export class Long { + _bsontype!: 'Long'; + + /** An indicator used to reliably determine if an object is a Long or not. */ + __isLong__!: true; + + /** + * The high 32 bits as a signed value. + */ + high!: number; + + /** + * The low 32 bits as a signed value. + */ + low!: number; + + /** + * Whether unsigned or not. + */ + unsigned!: boolean; + + /** + * Constructs a 64 bit two's-complement integer, given its low and high 32 bit values as *signed* integers. + * See the from* functions below for more convenient ways of constructing Longs. + * + * Acceptable signatures are: + * - Long(low, high, unsigned?) + * - Long(bigint, unsigned?) + * - Long(string, unsigned?) + * + * @param low - The low (signed) 32 bits of the long + * @param high - The high (signed) 32 bits of the long + * @param unsigned - Whether unsigned or not, defaults to signed + */ + constructor(low: number | bigint | string = 0, high?: number | boolean, unsigned?: boolean) { + if (!(this instanceof Long)) return new Long(low, high, unsigned); + + if (typeof low === 'bigint') { + Object.assign(this, Long.fromBigInt(low, !!high)); + } else if (typeof low === 'string') { + Object.assign(this, Long.fromString(low, !!high)); + } else { + this.low = low | 0; + this.high = (high as number) | 0; + this.unsigned = !!unsigned; + } + + Object.defineProperty(this, '__isLong__', { + value: true, + configurable: false, + writable: false, + enumerable: false + }); + } + + static TWO_PWR_24 = Long.fromInt(TWO_PWR_24_DBL); + + /** Maximum unsigned value. */ + static MAX_UNSIGNED_VALUE = Long.fromBits(0xffffffff | 0, 0xffffffff | 0, true); + /** Signed zero */ + static ZERO = Long.fromInt(0); + /** Unsigned zero. */ + static UZERO = Long.fromInt(0, true); + /** Signed one. */ + static ONE = Long.fromInt(1); + /** Unsigned one. */ + static UONE = Long.fromInt(1, true); + /** Signed negative one. */ + static NEG_ONE = Long.fromInt(-1); + /** Maximum signed value. */ + static MAX_VALUE = Long.fromBits(0xffffffff | 0, 0x7fffffff | 0, false); + /** Minimum signed value. */ + static MIN_VALUE = Long.fromBits(0, 0x80000000 | 0, false); + + /** + * Returns a Long representing the 64 bit integer that comes by concatenating the given low and high bits. + * Each is assumed to use 32 bits. + * @param lowBits - The low 32 bits + * @param highBits - The high 32 bits + * @param unsigned - Whether unsigned or not, defaults to signed + * @returns The corresponding Long value + */ + static fromBits(lowBits: number, highBits: number, unsigned?: boolean): Long { + return new Long(lowBits, highBits, unsigned); + } + + /** + * Returns a Long representing the given 32 bit integer value. + * @param value - The 32 bit integer in question + * @param unsigned - Whether unsigned or not, defaults to signed + * @returns The corresponding Long value + */ + static fromInt(value: number, unsigned?: boolean): Long { + let obj, cachedObj, cache; + if (unsigned) { + value >>>= 0; + if ((cache = 0 <= value && value < 256)) { + cachedObj = UINT_CACHE[value]; + if (cachedObj) return cachedObj; + } + obj = Long.fromBits(value, (value | 0) < 0 ? -1 : 0, true); + if (cache) UINT_CACHE[value] = obj; + return obj; + } else { + value |= 0; + if ((cache = -128 <= value && value < 128)) { + cachedObj = INT_CACHE[value]; + if (cachedObj) return cachedObj; + } + obj = Long.fromBits(value, value < 0 ? -1 : 0, false); + if (cache) INT_CACHE[value] = obj; + return obj; + } + } + + /** + * Returns a Long representing the given value, provided that it is a finite number. Otherwise, zero is returned. + * @param value - The number in question + * @param unsigned - Whether unsigned or not, defaults to signed + * @returns The corresponding Long value + */ + static fromNumber(value: number, unsigned?: boolean): Long { + if (isNaN(value)) return unsigned ? Long.UZERO : Long.ZERO; + if (unsigned) { + if (value < 0) return Long.UZERO; + if (value >= TWO_PWR_64_DBL) return Long.MAX_UNSIGNED_VALUE; + } else { + if (value <= -TWO_PWR_63_DBL) return Long.MIN_VALUE; + if (value + 1 >= TWO_PWR_63_DBL) return Long.MAX_VALUE; + } + if (value < 0) return Long.fromNumber(-value, unsigned).neg(); + return Long.fromBits(value % TWO_PWR_32_DBL | 0, (value / TWO_PWR_32_DBL) | 0, unsigned); + } + + /** + * Returns a Long representing the given value, provided that it is a finite number. Otherwise, zero is returned. + * @param value - The number in question + * @param unsigned - Whether unsigned or not, defaults to signed + * @returns The corresponding Long value + */ + static fromBigInt(value: bigint, unsigned?: boolean): Long { + return Long.fromString(value.toString(), unsigned); + } + + /** + * Returns a Long representation of the given string, written using the specified radix. + * @param str - The textual representation of the Long + * @param unsigned - Whether unsigned or not, defaults to signed + * @param radix - The radix in which the text is written (2-36), defaults to 10 + * @returns The corresponding Long value + */ + static fromString(str: string, unsigned?: boolean, radix?: number): Long { + if (str.length === 0) throw Error('empty string'); + if (str === 'NaN' || str === 'Infinity' || str === '+Infinity' || str === '-Infinity') + return Long.ZERO; + if (typeof unsigned === 'number') { + // For goog.math.long compatibility + (radix = unsigned), (unsigned = false); + } else { + unsigned = !!unsigned; + } + radix = radix || 10; + if (radix < 2 || 36 < radix) throw RangeError('radix'); + + let p; + if ((p = str.indexOf('-')) > 0) throw Error('interior hyphen'); + else if (p === 0) { + return Long.fromString(str.substring(1), unsigned, radix).neg(); + } + + // Do several (8) digits each time through the loop, so as to + // minimize the calls to the very expensive emulated div. + const radixToPower = Long.fromNumber(Math.pow(radix, 8)); + + let result = Long.ZERO; + for (let i = 0; i < str.length; i += 8) { + const size = Math.min(8, str.length - i), + value = parseInt(str.substring(i, i + size), radix); + if (size < 8) { + const power = Long.fromNumber(Math.pow(radix, size)); + result = result.mul(power).add(Long.fromNumber(value)); + } else { + result = result.mul(radixToPower); + result = result.add(Long.fromNumber(value)); + } + } + result.unsigned = unsigned; + return result; + } + + /** + * Creates a Long from its byte representation. + * @param bytes - Byte representation + * @param unsigned - Whether unsigned or not, defaults to signed + * @param le - Whether little or big endian, defaults to big endian + * @returns The corresponding Long value + */ + static fromBytes(bytes: number[], unsigned?: boolean, le?: boolean): Long { + return le ? Long.fromBytesLE(bytes, unsigned) : Long.fromBytesBE(bytes, unsigned); + } + + /** + * Creates a Long from its little endian byte representation. + * @param bytes - Little endian byte representation + * @param unsigned - Whether unsigned or not, defaults to signed + * @returns The corresponding Long value + */ + static fromBytesLE(bytes: number[], unsigned?: boolean): Long { + return new Long( + bytes[0] | (bytes[1] << 8) | (bytes[2] << 16) | (bytes[3] << 24), + bytes[4] | (bytes[5] << 8) | (bytes[6] << 16) | (bytes[7] << 24), + unsigned + ); + } + + /** + * Creates a Long from its big endian byte representation. + * @param bytes - Big endian byte representation + * @param unsigned - Whether unsigned or not, defaults to signed + * @returns The corresponding Long value + */ + static fromBytesBE(bytes: number[], unsigned?: boolean): Long { + return new Long( + (bytes[4] << 24) | (bytes[5] << 16) | (bytes[6] << 8) | bytes[7], + (bytes[0] << 24) | (bytes[1] << 16) | (bytes[2] << 8) | bytes[3], + unsigned + ); + } + + /** + * Tests if the specified object is a Long. + */ + // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types + static isLong(value: any): value is Long { + return isObjectLike(value) && value['__isLong__'] === true; + } + + /** + * Converts the specified value to a Long. + * @param unsigned - Whether unsigned or not, defaults to signed + */ + static fromValue( + val: number | string | { low: number; high: number; unsigned?: boolean }, + unsigned?: boolean + ): Long { + if (typeof val === 'number') return Long.fromNumber(val, unsigned); + if (typeof val === 'string') return Long.fromString(val, unsigned); + // Throws for non-objects, converts non-instanceof Long: + return Long.fromBits( + val.low, + val.high, + typeof unsigned === 'boolean' ? unsigned : val.unsigned + ); + } + + /** Returns the sum of this and the specified Long. */ + add(addend: string | number | Long | Timestamp): Long { + if (!Long.isLong(addend)) addend = Long.fromValue(addend); + + // Divide each number into 4 chunks of 16 bits, and then sum the chunks. + + const a48 = this.high >>> 16; + const a32 = this.high & 0xffff; + const a16 = this.low >>> 16; + const a00 = this.low & 0xffff; + + const b48 = addend.high >>> 16; + const b32 = addend.high & 0xffff; + const b16 = addend.low >>> 16; + const b00 = addend.low & 0xffff; + + let c48 = 0, + c32 = 0, + c16 = 0, + c00 = 0; + c00 += a00 + b00; + c16 += c00 >>> 16; + c00 &= 0xffff; + c16 += a16 + b16; + c32 += c16 >>> 16; + c16 &= 0xffff; + c32 += a32 + b32; + c48 += c32 >>> 16; + c32 &= 0xffff; + c48 += a48 + b48; + c48 &= 0xffff; + return Long.fromBits((c16 << 16) | c00, (c48 << 16) | c32, this.unsigned); + } + + /** + * Returns the sum of this and the specified Long. + * @returns Sum + */ + and(other: string | number | Long | Timestamp): Long { + if (!Long.isLong(other)) other = Long.fromValue(other); + return Long.fromBits(this.low & other.low, this.high & other.high, this.unsigned); + } + + /** + * Compares this Long's value with the specified's. + * @returns 0 if they are the same, 1 if the this is greater and -1 if the given one is greater + */ + compare(other: string | number | Long | Timestamp): 0 | 1 | -1 { + if (!Long.isLong(other)) other = Long.fromValue(other); + if (this.eq(other)) return 0; + const thisNeg = this.isNegative(), + otherNeg = other.isNegative(); + if (thisNeg && !otherNeg) return -1; + if (!thisNeg && otherNeg) return 1; + // At this point the sign bits are the same + if (!this.unsigned) return this.sub(other).isNegative() ? -1 : 1; + // Both are positive if at least one is unsigned + return other.high >>> 0 > this.high >>> 0 || + (other.high === this.high && other.low >>> 0 > this.low >>> 0) + ? -1 + : 1; + } + + /** This is an alias of {@link Long.compare} */ + comp(other: string | number | Long | Timestamp): 0 | 1 | -1 { + return this.compare(other); + } + + /** + * Returns this Long divided by the specified. The result is signed if this Long is signed or unsigned if this Long is unsigned. + * @returns Quotient + */ + divide(divisor: string | number | Long | Timestamp): Long { + if (!Long.isLong(divisor)) divisor = Long.fromValue(divisor); + if (divisor.isZero()) throw Error('division by zero'); + + // use wasm support if present + if (wasm) { + // guard against signed division overflow: the largest + // negative number / -1 would be 1 larger than the largest + // positive number, due to two's complement. + if ( + !this.unsigned && + this.high === -0x80000000 && + divisor.low === -1 && + divisor.high === -1 + ) { + // be consistent with non-wasm code path + return this; + } + const low = (this.unsigned ? wasm.div_u : wasm.div_s)( + this.low, + this.high, + divisor.low, + divisor.high + ); + return Long.fromBits(low, wasm.get_high(), this.unsigned); + } + + if (this.isZero()) return this.unsigned ? Long.UZERO : Long.ZERO; + let approx, rem, res; + if (!this.unsigned) { + // This section is only relevant for signed longs and is derived from the + // closure library as a whole. + if (this.eq(Long.MIN_VALUE)) { + if (divisor.eq(Long.ONE) || divisor.eq(Long.NEG_ONE)) return Long.MIN_VALUE; + // recall that -MIN_VALUE == MIN_VALUE + else if (divisor.eq(Long.MIN_VALUE)) return Long.ONE; + else { + // At this point, we have |other| >= 2, so |this/other| < |MIN_VALUE|. + const halfThis = this.shr(1); + approx = halfThis.div(divisor).shl(1); + if (approx.eq(Long.ZERO)) { + return divisor.isNegative() ? Long.ONE : Long.NEG_ONE; + } else { + rem = this.sub(divisor.mul(approx)); + res = approx.add(rem.div(divisor)); + return res; + } + } + } else if (divisor.eq(Long.MIN_VALUE)) return this.unsigned ? Long.UZERO : Long.ZERO; + if (this.isNegative()) { + if (divisor.isNegative()) return this.neg().div(divisor.neg()); + return this.neg().div(divisor).neg(); + } else if (divisor.isNegative()) return this.div(divisor.neg()).neg(); + res = Long.ZERO; + } else { + // The algorithm below has not been made for unsigned longs. It's therefore + // required to take special care of the MSB prior to running it. + if (!divisor.unsigned) divisor = divisor.toUnsigned(); + if (divisor.gt(this)) return Long.UZERO; + if (divisor.gt(this.shru(1))) + // 15 >>> 1 = 7 ; with divisor = 8 ; true + return Long.UONE; + res = Long.UZERO; + } + + // Repeat the following until the remainder is less than other: find a + // floating-point that approximates remainder / other *from below*, add this + // into the result, and subtract it from the remainder. It is critical that + // the approximate value is less than or equal to the real value so that the + // remainder never becomes negative. + rem = this; + while (rem.gte(divisor)) { + // Approximate the result of division. This may be a little greater or + // smaller than the actual value. + approx = Math.max(1, Math.floor(rem.toNumber() / divisor.toNumber())); + + // We will tweak the approximate result by changing it in the 48-th digit or + // the smallest non-fractional digit, whichever is larger. + const log2 = Math.ceil(Math.log(approx) / Math.LN2); + const delta = log2 <= 48 ? 1 : Math.pow(2, log2 - 48); + // Decrease the approximation until it is smaller than the remainder. Note + // that if it is too large, the product overflows and is negative. + let approxRes = Long.fromNumber(approx); + let approxRem = approxRes.mul(divisor); + while (approxRem.isNegative() || approxRem.gt(rem)) { + approx -= delta; + approxRes = Long.fromNumber(approx, this.unsigned); + approxRem = approxRes.mul(divisor); + } + + // We know the answer can't be zero... and actually, zero would cause + // infinite recursion since we would make no progress. + if (approxRes.isZero()) approxRes = Long.ONE; + + res = res.add(approxRes); + rem = rem.sub(approxRem); + } + return res; + } + + /**This is an alias of {@link Long.divide} */ + div(divisor: string | number | Long | Timestamp): Long { + return this.divide(divisor); + } + + /** + * Tests if this Long's value equals the specified's. + * @param other - Other value + */ + equals(other: string | number | Long | Timestamp): boolean { + if (!Long.isLong(other)) other = Long.fromValue(other); + if (this.unsigned !== other.unsigned && this.high >>> 31 === 1 && other.high >>> 31 === 1) + return false; + return this.high === other.high && this.low === other.low; + } + + /** This is an alias of {@link Long.equals} */ + eq(other: string | number | Long | Timestamp): boolean { + return this.equals(other); + } + + /** Gets the high 32 bits as a signed integer. */ + getHighBits(): number { + return this.high; + } + + /** Gets the high 32 bits as an unsigned integer. */ + getHighBitsUnsigned(): number { + return this.high >>> 0; + } + + /** Gets the low 32 bits as a signed integer. */ + getLowBits(): number { + return this.low; + } + + /** Gets the low 32 bits as an unsigned integer. */ + getLowBitsUnsigned(): number { + return this.low >>> 0; + } + + /** Gets the number of bits needed to represent the absolute value of this Long. */ + getNumBitsAbs(): number { + if (this.isNegative()) { + // Unsigned Longs are never negative + return this.eq(Long.MIN_VALUE) ? 64 : this.neg().getNumBitsAbs(); + } + const val = this.high !== 0 ? this.high : this.low; + let bit: number; + for (bit = 31; bit > 0; bit--) if ((val & (1 << bit)) !== 0) break; + return this.high !== 0 ? bit + 33 : bit + 1; + } + + /** Tests if this Long's value is greater than the specified's. */ + greaterThan(other: string | number | Long | Timestamp): boolean { + return this.comp(other) > 0; + } + + /** This is an alias of {@link Long.greaterThan} */ + gt(other: string | number | Long | Timestamp): boolean { + return this.greaterThan(other); + } + + /** Tests if this Long's value is greater than or equal the specified's. */ + greaterThanOrEqual(other: string | number | Long | Timestamp): boolean { + return this.comp(other) >= 0; + } + + /** This is an alias of {@link Long.greaterThanOrEqual} */ + gte(other: string | number | Long | Timestamp): boolean { + return this.greaterThanOrEqual(other); + } + /** This is an alias of {@link Long.greaterThanOrEqual} */ + ge(other: string | number | Long | Timestamp): boolean { + return this.greaterThanOrEqual(other); + } + + /** Tests if this Long's value is even. */ + isEven(): boolean { + return (this.low & 1) === 0; + } + + /** Tests if this Long's value is negative. */ + isNegative(): boolean { + return !this.unsigned && this.high < 0; + } + + /** Tests if this Long's value is odd. */ + isOdd(): boolean { + return (this.low & 1) === 1; + } + + /** Tests if this Long's value is positive. */ + isPositive(): boolean { + return this.unsigned || this.high >= 0; + } + + /** Tests if this Long's value equals zero. */ + isZero(): boolean { + return this.high === 0 && this.low === 0; + } + + /** Tests if this Long's value is less than the specified's. */ + lessThan(other: string | number | Long | Timestamp): boolean { + return this.comp(other) < 0; + } + + /** This is an alias of {@link Long#lessThan}. */ + lt(other: string | number | Long | Timestamp): boolean { + return this.lessThan(other); + } + + /** Tests if this Long's value is less than or equal the specified's. */ + lessThanOrEqual(other: string | number | Long | Timestamp): boolean { + return this.comp(other) <= 0; + } + + /** This is an alias of {@link Long.lessThanOrEqual} */ + lte(other: string | number | Long | Timestamp): boolean { + return this.lessThanOrEqual(other); + } + + /** Returns this Long modulo the specified. */ + modulo(divisor: string | number | Long | Timestamp): Long { + if (!Long.isLong(divisor)) divisor = Long.fromValue(divisor); + + // use wasm support if present + if (wasm) { + const low = (this.unsigned ? wasm.rem_u : wasm.rem_s)( + this.low, + this.high, + divisor.low, + divisor.high + ); + return Long.fromBits(low, wasm.get_high(), this.unsigned); + } + + return this.sub(this.div(divisor).mul(divisor)); + } + + /** This is an alias of {@link Long.modulo} */ + mod(divisor: string | number | Long | Timestamp): Long { + return this.modulo(divisor); + } + /** This is an alias of {@link Long.modulo} */ + rem(divisor: string | number | Long | Timestamp): Long { + return this.modulo(divisor); + } + + /** + * Returns the product of this and the specified Long. + * @param multiplier - Multiplier + * @returns Product + */ + multiply(multiplier: string | number | Long | Timestamp): Long { + if (this.isZero()) return Long.ZERO; + if (!Long.isLong(multiplier)) multiplier = Long.fromValue(multiplier); + + // use wasm support if present + if (wasm) { + const low = wasm.mul(this.low, this.high, multiplier.low, multiplier.high); + return Long.fromBits(low, wasm.get_high(), this.unsigned); + } + + if (multiplier.isZero()) return Long.ZERO; + if (this.eq(Long.MIN_VALUE)) return multiplier.isOdd() ? Long.MIN_VALUE : Long.ZERO; + if (multiplier.eq(Long.MIN_VALUE)) return this.isOdd() ? Long.MIN_VALUE : Long.ZERO; + + if (this.isNegative()) { + if (multiplier.isNegative()) return this.neg().mul(multiplier.neg()); + else return this.neg().mul(multiplier).neg(); + } else if (multiplier.isNegative()) return this.mul(multiplier.neg()).neg(); + + // If both longs are small, use float multiplication + if (this.lt(Long.TWO_PWR_24) && multiplier.lt(Long.TWO_PWR_24)) + return Long.fromNumber(this.toNumber() * multiplier.toNumber(), this.unsigned); + + // Divide each long into 4 chunks of 16 bits, and then add up 4x4 products. + // We can skip products that would overflow. + + const a48 = this.high >>> 16; + const a32 = this.high & 0xffff; + const a16 = this.low >>> 16; + const a00 = this.low & 0xffff; + + const b48 = multiplier.high >>> 16; + const b32 = multiplier.high & 0xffff; + const b16 = multiplier.low >>> 16; + const b00 = multiplier.low & 0xffff; + + let c48 = 0, + c32 = 0, + c16 = 0, + c00 = 0; + c00 += a00 * b00; + c16 += c00 >>> 16; + c00 &= 0xffff; + c16 += a16 * b00; + c32 += c16 >>> 16; + c16 &= 0xffff; + c16 += a00 * b16; + c32 += c16 >>> 16; + c16 &= 0xffff; + c32 += a32 * b00; + c48 += c32 >>> 16; + c32 &= 0xffff; + c32 += a16 * b16; + c48 += c32 >>> 16; + c32 &= 0xffff; + c32 += a00 * b32; + c48 += c32 >>> 16; + c32 &= 0xffff; + c48 += a48 * b00 + a32 * b16 + a16 * b32 + a00 * b48; + c48 &= 0xffff; + return Long.fromBits((c16 << 16) | c00, (c48 << 16) | c32, this.unsigned); + } + + /** This is an alias of {@link Long.multiply} */ + mul(multiplier: string | number | Long | Timestamp): Long { + return this.multiply(multiplier); + } + + /** Returns the Negation of this Long's value. */ + negate(): Long { + if (!this.unsigned && this.eq(Long.MIN_VALUE)) return Long.MIN_VALUE; + return this.not().add(Long.ONE); + } + + /** This is an alias of {@link Long.negate} */ + neg(): Long { + return this.negate(); + } + + /** Returns the bitwise NOT of this Long. */ + not(): Long { + return Long.fromBits(~this.low, ~this.high, this.unsigned); + } + + /** Tests if this Long's value differs from the specified's. */ + notEquals(other: string | number | Long | Timestamp): boolean { + return !this.equals(other); + } + + /** This is an alias of {@link Long.notEquals} */ + neq(other: string | number | Long | Timestamp): boolean { + return this.notEquals(other); + } + /** This is an alias of {@link Long.notEquals} */ + ne(other: string | number | Long | Timestamp): boolean { + return this.notEquals(other); + } + + /** + * Returns the bitwise OR of this Long and the specified. + */ + or(other: number | string | Long): Long { + if (!Long.isLong(other)) other = Long.fromValue(other); + return Long.fromBits(this.low | other.low, this.high | other.high, this.unsigned); + } + + /** + * Returns this Long with bits shifted to the left by the given amount. + * @param numBits - Number of bits + * @returns Shifted Long + */ + shiftLeft(numBits: number | Long): Long { + if (Long.isLong(numBits)) numBits = numBits.toInt(); + if ((numBits &= 63) === 0) return this; + else if (numBits < 32) + return Long.fromBits( + this.low << numBits, + (this.high << numBits) | (this.low >>> (32 - numBits)), + this.unsigned + ); + else return Long.fromBits(0, this.low << (numBits - 32), this.unsigned); + } + + /** This is an alias of {@link Long.shiftLeft} */ + shl(numBits: number | Long): Long { + return this.shiftLeft(numBits); + } + + /** + * Returns this Long with bits arithmetically shifted to the right by the given amount. + * @param numBits - Number of bits + * @returns Shifted Long + */ + shiftRight(numBits: number | Long): Long { + if (Long.isLong(numBits)) numBits = numBits.toInt(); + if ((numBits &= 63) === 0) return this; + else if (numBits < 32) + return Long.fromBits( + (this.low >>> numBits) | (this.high << (32 - numBits)), + this.high >> numBits, + this.unsigned + ); + else return Long.fromBits(this.high >> (numBits - 32), this.high >= 0 ? 0 : -1, this.unsigned); + } + + /** This is an alias of {@link Long.shiftRight} */ + shr(numBits: number | Long): Long { + return this.shiftRight(numBits); + } + + /** + * Returns this Long with bits logically shifted to the right by the given amount. + * @param numBits - Number of bits + * @returns Shifted Long + */ + shiftRightUnsigned(numBits: Long | number): Long { + if (Long.isLong(numBits)) numBits = numBits.toInt(); + numBits &= 63; + if (numBits === 0) return this; + else { + const high = this.high; + if (numBits < 32) { + const low = this.low; + return Long.fromBits( + (low >>> numBits) | (high << (32 - numBits)), + high >>> numBits, + this.unsigned + ); + } else if (numBits === 32) return Long.fromBits(high, 0, this.unsigned); + else return Long.fromBits(high >>> (numBits - 32), 0, this.unsigned); + } + } + + /** This is an alias of {@link Long.shiftRightUnsigned} */ + shr_u(numBits: number | Long): Long { + return this.shiftRightUnsigned(numBits); + } + /** This is an alias of {@link Long.shiftRightUnsigned} */ + shru(numBits: number | Long): Long { + return this.shiftRightUnsigned(numBits); + } + + /** + * Returns the difference of this and the specified Long. + * @param subtrahend - Subtrahend + * @returns Difference + */ + subtract(subtrahend: string | number | Long | Timestamp): Long { + if (!Long.isLong(subtrahend)) subtrahend = Long.fromValue(subtrahend); + return this.add(subtrahend.neg()); + } + + /** This is an alias of {@link Long.subtract} */ + sub(subtrahend: string | number | Long | Timestamp): Long { + return this.subtract(subtrahend); + } + + /** Converts the Long to a 32 bit integer, assuming it is a 32 bit integer. */ + toInt(): number { + return this.unsigned ? this.low >>> 0 : this.low; + } + + /** Converts the Long to a the nearest floating-point representation of this value (double, 53 bit mantissa). */ + toNumber(): number { + if (this.unsigned) return (this.high >>> 0) * TWO_PWR_32_DBL + (this.low >>> 0); + return this.high * TWO_PWR_32_DBL + (this.low >>> 0); + } + + /** Converts the Long to a BigInt (arbitrary precision). */ + toBigInt(): bigint { + return BigInt(this.toString()); + } + + /** + * Converts this Long to its byte representation. + * @param le - Whether little or big endian, defaults to big endian + * @returns Byte representation + */ + toBytes(le?: boolean): number[] { + return le ? this.toBytesLE() : this.toBytesBE(); + } + + /** + * Converts this Long to its little endian byte representation. + * @returns Little endian byte representation + */ + toBytesLE(): number[] { + const hi = this.high, + lo = this.low; + return [ + lo & 0xff, + (lo >>> 8) & 0xff, + (lo >>> 16) & 0xff, + lo >>> 24, + hi & 0xff, + (hi >>> 8) & 0xff, + (hi >>> 16) & 0xff, + hi >>> 24 + ]; + } + + /** + * Converts this Long to its big endian byte representation. + * @returns Big endian byte representation + */ + toBytesBE(): number[] { + const hi = this.high, + lo = this.low; + return [ + hi >>> 24, + (hi >>> 16) & 0xff, + (hi >>> 8) & 0xff, + hi & 0xff, + lo >>> 24, + (lo >>> 16) & 0xff, + (lo >>> 8) & 0xff, + lo & 0xff + ]; + } + + /** + * Converts this Long to signed. + */ + toSigned(): Long { + if (!this.unsigned) return this; + return Long.fromBits(this.low, this.high, false); + } + + /** + * Converts the Long to a string written in the specified radix. + * @param radix - Radix (2-36), defaults to 10 + * @throws RangeError If `radix` is out of range + */ + toString(radix?: number): string { + radix = radix || 10; + if (radix < 2 || 36 < radix) throw RangeError('radix'); + if (this.isZero()) return '0'; + if (this.isNegative()) { + // Unsigned Longs are never negative + if (this.eq(Long.MIN_VALUE)) { + // We need to change the Long value before it can be negated, so we remove + // the bottom-most digit in this base and then recurse to do the rest. + const radixLong = Long.fromNumber(radix), + div = this.div(radixLong), + rem1 = div.mul(radixLong).sub(this); + return div.toString(radix) + rem1.toInt().toString(radix); + } else return '-' + this.neg().toString(radix); + } + + // Do several (6) digits each time through the loop, so as to + // minimize the calls to the very expensive emulated div. + const radixToPower = Long.fromNumber(Math.pow(radix, 6), this.unsigned); + // eslint-disable-next-line @typescript-eslint/no-this-alias + let rem: Long = this; + let result = ''; + // eslint-disable-next-line no-constant-condition + while (true) { + const remDiv = rem.div(radixToPower); + const intval = rem.sub(remDiv.mul(radixToPower)).toInt() >>> 0; + let digits = intval.toString(radix); + rem = remDiv; + if (rem.isZero()) { + return digits + result; + } else { + while (digits.length < 6) digits = '0' + digits; + result = '' + digits + result; + } + } + } + + /** Converts this Long to unsigned. */ + toUnsigned(): Long { + if (this.unsigned) return this; + return Long.fromBits(this.low, this.high, true); + } + + /** Returns the bitwise XOR of this Long and the given one. */ + xor(other: Long | number | string): Long { + if (!Long.isLong(other)) other = Long.fromValue(other); + return Long.fromBits(this.low ^ other.low, this.high ^ other.high, this.unsigned); + } + + /** This is an alias of {@link Long.isZero} */ + eqz(): boolean { + return this.isZero(); + } + + /** This is an alias of {@link Long.lessThanOrEqual} */ + le(other: string | number | Long | Timestamp): boolean { + return this.lessThanOrEqual(other); + } + + /* + **************************************************************** + * BSON SPECIFIC ADDITIONS * + **************************************************************** + */ + toExtendedJSON(options?: EJSONOptions): number | LongExtended { + if (options && options.relaxed) return this.toNumber(); + return { $numberLong: this.toString() }; + } + static fromExtendedJSON(doc: { $numberLong: string }, options?: EJSONOptions): number | Long { + const result = Long.fromString(doc.$numberLong); + return options && options.relaxed ? result.toNumber() : result; + } + + /** @internal */ + [Symbol.for('nodejs.util.inspect.custom')](): string { + return this.inspect(); + } + + inspect(): string { + return `new Long("${this.toString()}"${this.unsigned ? ', true' : ''})`; + } +} + +Object.defineProperty(Long.prototype, '__isLong__', { value: true }); +Object.defineProperty(Long.prototype, '_bsontype', { value: 'Long' }); diff --git a/node_modules/bson/src/map.ts b/node_modules/bson/src/map.ts new file mode 100644 index 000000000..ba0032968 --- /dev/null +++ b/node_modules/bson/src/map.ts @@ -0,0 +1,119 @@ +/* eslint-disable @typescript-eslint/no-explicit-any */ +// We have an ES6 Map available, return the native instance + +import { getGlobal } from './utils/global'; + +/** @public */ +let bsonMap: MapConstructor; + +const bsonGlobal = getGlobal<{ Map?: MapConstructor }>(); +if (bsonGlobal.Map) { + bsonMap = bsonGlobal.Map; +} else { + // We will return a polyfill + bsonMap = class Map { + private _keys: string[]; + private _values: Record; + constructor(array: [string, any][] = []) { + this._keys = []; + this._values = {}; + + for (let i = 0; i < array.length; i++) { + if (array[i] == null) continue; // skip null and undefined + const entry = array[i]; + const key = entry[0]; + const value = entry[1]; + // Add the key to the list of keys in order + this._keys.push(key); + // Add the key and value to the values dictionary with a point + // to the location in the ordered keys list + this._values[key] = { v: value, i: this._keys.length - 1 }; + } + } + clear() { + this._keys = []; + this._values = {}; + } + delete(key: string) { + const value = this._values[key]; + if (value == null) return false; + // Delete entry + delete this._values[key]; + // Remove the key from the ordered keys list + this._keys.splice(value.i, 1); + return true; + } + entries() { + let index = 0; + + return { + next: () => { + const key = this._keys[index++]; + return { + value: key !== undefined ? [key, this._values[key].v] : undefined, + done: key !== undefined ? false : true + }; + } + }; + } + forEach(callback: (this: this, value: any, key: string, self: this) => void, self?: this) { + self = self || this; + + for (let i = 0; i < this._keys.length; i++) { + const key = this._keys[i]; + // Call the forEach callback + callback.call(self, this._values[key].v, key, self); + } + } + get(key: string) { + return this._values[key] ? this._values[key].v : undefined; + } + has(key: string) { + return this._values[key] != null; + } + keys() { + let index = 0; + + return { + next: () => { + const key = this._keys[index++]; + return { + value: key !== undefined ? key : undefined, + done: key !== undefined ? false : true + }; + } + }; + } + set(key: string, value: any) { + if (this._values[key]) { + this._values[key].v = value; + return this; + } + + // Add the key to the list of keys in order + this._keys.push(key); + // Add the key and value to the values dictionary with a point + // to the location in the ordered keys list + this._values[key] = { v: value, i: this._keys.length - 1 }; + return this; + } + values() { + let index = 0; + + return { + next: () => { + const key = this._keys[index++]; + return { + value: key !== undefined ? this._values[key].v : undefined, + done: key !== undefined ? false : true + }; + } + }; + } + get size() { + return this._keys.length; + } + } as unknown as MapConstructor; +} + +export { bsonMap as Map }; diff --git a/node_modules/bson/src/max_key.ts b/node_modules/bson/src/max_key.ts new file mode 100644 index 000000000..0ff3d3633 --- /dev/null +++ b/node_modules/bson/src/max_key.ts @@ -0,0 +1,38 @@ +/** @public */ +export interface MaxKeyExtended { + $maxKey: 1; +} + +/** + * A class representation of the BSON MaxKey type. + * @public + * @category BSONType + */ +export class MaxKey { + _bsontype!: 'MaxKey'; + + constructor() { + if (!(this instanceof MaxKey)) return new MaxKey(); + } + + /** @internal */ + toExtendedJSON(): MaxKeyExtended { + return { $maxKey: 1 }; + } + + /** @internal */ + static fromExtendedJSON(): MaxKey { + return new MaxKey(); + } + + /** @internal */ + [Symbol.for('nodejs.util.inspect.custom')](): string { + return this.inspect(); + } + + inspect(): string { + return 'new MaxKey()'; + } +} + +Object.defineProperty(MaxKey.prototype, '_bsontype', { value: 'MaxKey' }); diff --git a/node_modules/bson/src/min_key.ts b/node_modules/bson/src/min_key.ts new file mode 100644 index 000000000..f872b1eb1 --- /dev/null +++ b/node_modules/bson/src/min_key.ts @@ -0,0 +1,38 @@ +/** @public */ +export interface MinKeyExtended { + $minKey: 1; +} + +/** + * A class representation of the BSON MinKey type. + * @public + * @category BSONType + */ +export class MinKey { + _bsontype!: 'MinKey'; + + constructor() { + if (!(this instanceof MinKey)) return new MinKey(); + } + + /** @internal */ + toExtendedJSON(): MinKeyExtended { + return { $minKey: 1 }; + } + + /** @internal */ + static fromExtendedJSON(): MinKey { + return new MinKey(); + } + + /** @internal */ + [Symbol.for('nodejs.util.inspect.custom')](): string { + return this.inspect(); + } + + inspect(): string { + return 'new MinKey()'; + } +} + +Object.defineProperty(MinKey.prototype, '_bsontype', { value: 'MinKey' }); diff --git a/node_modules/bson/src/objectid.ts b/node_modules/bson/src/objectid.ts new file mode 100644 index 000000000..21e1b2e07 --- /dev/null +++ b/node_modules/bson/src/objectid.ts @@ -0,0 +1,354 @@ +import { Buffer } from 'buffer'; +import { ensureBuffer } from './ensure_buffer'; +import { BSONTypeError } from './error'; +import { deprecate, isUint8Array, randomBytes } from './parser/utils'; + +// Regular expression that checks for hex value +const checkForHexRegExp = new RegExp('^[0-9a-fA-F]{24}$'); + +// Unique sequence for the current process (initialized on first use) +let PROCESS_UNIQUE: Uint8Array | null = null; + +/** @public */ +export interface ObjectIdLike { + id: string | Buffer; + __id?: string; + toHexString(): string; +} + +/** @public */ +export interface ObjectIdExtended { + $oid: string; +} + +const kId = Symbol('id'); + +/** + * A class representation of the BSON ObjectId type. + * @public + * @category BSONType + */ +export class ObjectId { + _bsontype!: 'ObjectID'; + + /** @internal */ + static index = Math.floor(Math.random() * 0xffffff); + + static cacheHexString: boolean; + + /** ObjectId Bytes @internal */ + private [kId]: Buffer; + /** ObjectId hexString cache @internal */ + private __id?: string; + + /** + * Create an ObjectId type + * + * @param inputId - Can be a 24 character hex string, 12 byte binary Buffer, or a number. + */ + constructor(inputId?: string | number | ObjectId | ObjectIdLike | Buffer | Uint8Array) { + if (!(this instanceof ObjectId)) return new ObjectId(inputId); + + // workingId is set based on type of input and whether valid id exists for the input + let workingId; + if (typeof inputId === 'object' && inputId && 'id' in inputId) { + if (typeof inputId.id !== 'string' && !ArrayBuffer.isView(inputId.id)) { + throw new BSONTypeError( + 'Argument passed in must have an id that is of type string or Buffer' + ); + } + if ('toHexString' in inputId && typeof inputId.toHexString === 'function') { + workingId = Buffer.from(inputId.toHexString(), 'hex'); + } else { + workingId = inputId.id; + } + } else { + workingId = inputId; + } + + // the following cases use workingId to construct an ObjectId + if (workingId == null || typeof workingId === 'number') { + // The most common use case (blank id, new objectId instance) + // Generate a new id + this[kId] = ObjectId.generate(typeof workingId === 'number' ? workingId : undefined); + } else if (ArrayBuffer.isView(workingId) && workingId.byteLength === 12) { + // If intstanceof matches we can escape calling ensure buffer in Node.js environments + this[kId] = workingId instanceof Buffer ? workingId : ensureBuffer(workingId); + } else if (typeof workingId === 'string') { + if (workingId.length === 12) { + const bytes = Buffer.from(workingId); + if (bytes.byteLength === 12) { + this[kId] = bytes; + } else { + throw new BSONTypeError('Argument passed in must be a string of 12 bytes'); + } + } else if (workingId.length === 24 && checkForHexRegExp.test(workingId)) { + this[kId] = Buffer.from(workingId, 'hex'); + } else { + throw new BSONTypeError( + 'Argument passed in must be a string of 12 bytes or a string of 24 hex characters or an integer' + ); + } + } else { + throw new BSONTypeError('Argument passed in does not match the accepted types'); + } + // If we are caching the hex string + if (ObjectId.cacheHexString) { + this.__id = this.id.toString('hex'); + } + } + + /** + * The ObjectId bytes + * @readonly + */ + get id(): Buffer { + return this[kId]; + } + + set id(value: Buffer) { + this[kId] = value; + if (ObjectId.cacheHexString) { + this.__id = value.toString('hex'); + } + } + + /** + * The generation time of this ObjectId instance + * @deprecated Please use getTimestamp / createFromTime which returns an int32 epoch + */ + get generationTime(): number { + return this.id.readInt32BE(0); + } + + set generationTime(value: number) { + // Encode time into first 4 bytes + this.id.writeUInt32BE(value, 0); + } + + /** Returns the ObjectId id as a 24 character hex string representation */ + toHexString(): string { + if (ObjectId.cacheHexString && this.__id) { + return this.__id; + } + + const hexString = this.id.toString('hex'); + + if (ObjectId.cacheHexString && !this.__id) { + this.__id = hexString; + } + + return hexString; + } + + /** + * Update the ObjectId index + * @privateRemarks + * Used in generating new ObjectId's on the driver + * @internal + */ + static getInc(): number { + return (ObjectId.index = (ObjectId.index + 1) % 0xffffff); + } + + /** + * Generate a 12 byte id buffer used in ObjectId's + * + * @param time - pass in a second based timestamp. + */ + static generate(time?: number): Buffer { + if ('number' !== typeof time) { + time = Math.floor(Date.now() / 1000); + } + + const inc = ObjectId.getInc(); + const buffer = Buffer.alloc(12); + + // 4-byte timestamp + buffer.writeUInt32BE(time, 0); + + // set PROCESS_UNIQUE if yet not initialized + if (PROCESS_UNIQUE === null) { + PROCESS_UNIQUE = randomBytes(5); + } + + // 5-byte process unique + buffer[4] = PROCESS_UNIQUE[0]; + buffer[5] = PROCESS_UNIQUE[1]; + buffer[6] = PROCESS_UNIQUE[2]; + buffer[7] = PROCESS_UNIQUE[3]; + buffer[8] = PROCESS_UNIQUE[4]; + + // 3-byte counter + buffer[11] = inc & 0xff; + buffer[10] = (inc >> 8) & 0xff; + buffer[9] = (inc >> 16) & 0xff; + + return buffer; + } + + /** + * Converts the id into a 24 character hex string for printing + * + * @param format - The Buffer toString format parameter. + */ + toString(format?: string): string { + // Is the id a buffer then use the buffer toString method to return the format + if (format) return this.id.toString(format); + return this.toHexString(); + } + + /** Converts to its JSON the 24 character hex string representation. */ + toJSON(): string { + return this.toHexString(); + } + + /** + * Compares the equality of this ObjectId with `otherID`. + * + * @param otherId - ObjectId instance to compare against. + */ + equals(otherId: string | ObjectId | ObjectIdLike): boolean { + if (otherId === undefined || otherId === null) { + return false; + } + + if (otherId instanceof ObjectId) { + return this[kId][11] === otherId[kId][11] && this[kId].equals(otherId[kId]); + } + + if ( + typeof otherId === 'string' && + ObjectId.isValid(otherId) && + otherId.length === 12 && + isUint8Array(this.id) + ) { + return otherId === Buffer.prototype.toString.call(this.id, 'latin1'); + } + + if (typeof otherId === 'string' && ObjectId.isValid(otherId) && otherId.length === 24) { + return otherId.toLowerCase() === this.toHexString(); + } + + if (typeof otherId === 'string' && ObjectId.isValid(otherId) && otherId.length === 12) { + return Buffer.from(otherId).equals(this.id); + } + + if ( + typeof otherId === 'object' && + 'toHexString' in otherId && + typeof otherId.toHexString === 'function' + ) { + const otherIdString = otherId.toHexString(); + const thisIdString = this.toHexString().toLowerCase(); + return typeof otherIdString === 'string' && otherIdString.toLowerCase() === thisIdString; + } + + return false; + } + + /** Returns the generation date (accurate up to the second) that this ID was generated. */ + getTimestamp(): Date { + const timestamp = new Date(); + const time = this.id.readUInt32BE(0); + timestamp.setTime(Math.floor(time) * 1000); + return timestamp; + } + + /** @internal */ + static createPk(): ObjectId { + return new ObjectId(); + } + + /** + * Creates an ObjectId from a second based number, with the rest of the ObjectId zeroed out. Used for comparisons or sorting the ObjectId. + * + * @param time - an integer number representing a number of seconds. + */ + static createFromTime(time: number): ObjectId { + const buffer = Buffer.from([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]); + // Encode time into first 4 bytes + buffer.writeUInt32BE(time, 0); + // Return the new objectId + return new ObjectId(buffer); + } + + /** + * Creates an ObjectId from a hex string representation of an ObjectId. + * + * @param hexString - create a ObjectId from a passed in 24 character hexstring. + */ + static createFromHexString(hexString: string): ObjectId { + // Throw an error if it's not a valid setup + if (typeof hexString === 'undefined' || (hexString != null && hexString.length !== 24)) { + throw new BSONTypeError( + 'Argument passed in must be a single String of 12 bytes or a string of 24 hex characters' + ); + } + + return new ObjectId(Buffer.from(hexString, 'hex')); + } + + /** + * Checks if a value is a valid bson ObjectId + * + * @param id - ObjectId instance to validate. + */ + static isValid(id: string | number | ObjectId | ObjectIdLike | Buffer | Uint8Array): boolean { + if (id == null) return false; + + try { + new ObjectId(id); + return true; + } catch { + return false; + } + } + + /** @internal */ + toExtendedJSON(): ObjectIdExtended { + if (this.toHexString) return { $oid: this.toHexString() }; + return { $oid: this.toString('hex') }; + } + + /** @internal */ + static fromExtendedJSON(doc: ObjectIdExtended): ObjectId { + return new ObjectId(doc.$oid); + } + + /** + * Converts to a string representation of this Id. + * + * @returns return the 24 character hex string representation. + * @internal + */ + [Symbol.for('nodejs.util.inspect.custom')](): string { + return this.inspect(); + } + + inspect(): string { + return `new ObjectId("${this.toHexString()}")`; + } +} + +// Deprecated methods +Object.defineProperty(ObjectId.prototype, 'generate', { + value: deprecate( + (time: number) => ObjectId.generate(time), + 'Please use the static `ObjectId.generate(time)` instead' + ) +}); + +Object.defineProperty(ObjectId.prototype, 'getInc', { + value: deprecate(() => ObjectId.getInc(), 'Please use the static `ObjectId.getInc()` instead') +}); + +Object.defineProperty(ObjectId.prototype, 'get_inc', { + value: deprecate(() => ObjectId.getInc(), 'Please use the static `ObjectId.getInc()` instead') +}); + +Object.defineProperty(ObjectId, 'get_inc', { + value: deprecate(() => ObjectId.getInc(), 'Please use the static `ObjectId.getInc()` instead') +}); + +Object.defineProperty(ObjectId.prototype, '_bsontype', { value: 'ObjectID' }); diff --git a/node_modules/bson/src/parser/calculate_size.ts b/node_modules/bson/src/parser/calculate_size.ts new file mode 100644 index 000000000..14529b98a --- /dev/null +++ b/node_modules/bson/src/parser/calculate_size.ts @@ -0,0 +1,227 @@ +import { Buffer } from 'buffer'; +import { Binary } from '../binary'; +import type { Document } from '../bson'; +import * as constants from '../constants'; +import { isAnyArrayBuffer, isDate, isRegExp, normalizedFunctionString } from './utils'; + +export function calculateObjectSize( + object: Document, + serializeFunctions?: boolean, + ignoreUndefined?: boolean +): number { + let totalLength = 4 + 1; + + if (Array.isArray(object)) { + for (let i = 0; i < object.length; i++) { + totalLength += calculateElement( + i.toString(), + object[i], + serializeFunctions, + true, + ignoreUndefined + ); + } + } else { + // If we have toBSON defined, override the current object + + if (typeof object?.toBSON === 'function') { + object = object.toBSON(); + } + + // Calculate size + for (const key in object) { + totalLength += calculateElement(key, object[key], serializeFunctions, false, ignoreUndefined); + } + } + + return totalLength; +} + +/** @internal */ +function calculateElement( + name: string, + // eslint-disable-next-line @typescript-eslint/no-explicit-any + value: any, + serializeFunctions = false, + isArray = false, + ignoreUndefined = false +) { + // If we have toBSON defined, override the current object + if (typeof value?.toBSON === 'function') { + value = value.toBSON(); + } + + switch (typeof value) { + case 'string': + return 1 + Buffer.byteLength(name, 'utf8') + 1 + 4 + Buffer.byteLength(value, 'utf8') + 1; + case 'number': + if ( + Math.floor(value) === value && + value >= constants.JS_INT_MIN && + value <= constants.JS_INT_MAX + ) { + if (value >= constants.BSON_INT32_MIN && value <= constants.BSON_INT32_MAX) { + // 32 bit + return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + (4 + 1); + } else { + return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + (8 + 1); + } + } else { + // 64 bit + return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + (8 + 1); + } + case 'undefined': + if (isArray || !ignoreUndefined) + return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + 1; + return 0; + case 'boolean': + return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + (1 + 1); + case 'object': + if (value == null || value['_bsontype'] === 'MinKey' || value['_bsontype'] === 'MaxKey') { + return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + 1; + } else if (value['_bsontype'] === 'ObjectId' || value['_bsontype'] === 'ObjectID') { + return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + (12 + 1); + } else if (value instanceof Date || isDate(value)) { + return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + (8 + 1); + } else if ( + ArrayBuffer.isView(value) || + value instanceof ArrayBuffer || + isAnyArrayBuffer(value) + ) { + return ( + (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + (1 + 4 + 1) + value.byteLength + ); + } else if ( + value['_bsontype'] === 'Long' || + value['_bsontype'] === 'Double' || + value['_bsontype'] === 'Timestamp' + ) { + return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + (8 + 1); + } else if (value['_bsontype'] === 'Decimal128') { + return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + (16 + 1); + } else if (value['_bsontype'] === 'Code') { + // Calculate size depending on the availability of a scope + if (value.scope != null && Object.keys(value.scope).length > 0) { + return ( + (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + + 1 + + 4 + + 4 + + Buffer.byteLength(value.code.toString(), 'utf8') + + 1 + + calculateObjectSize(value.scope, serializeFunctions, ignoreUndefined) + ); + } else { + return ( + (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + + 1 + + 4 + + Buffer.byteLength(value.code.toString(), 'utf8') + + 1 + ); + } + } else if (value['_bsontype'] === 'Binary') { + // Check what kind of subtype we have + if (value.sub_type === Binary.SUBTYPE_BYTE_ARRAY) { + return ( + (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + + (value.position + 1 + 4 + 1 + 4) + ); + } else { + return ( + (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + (value.position + 1 + 4 + 1) + ); + } + } else if (value['_bsontype'] === 'Symbol') { + return ( + (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + + Buffer.byteLength(value.value, 'utf8') + + 4 + + 1 + + 1 + ); + } else if (value['_bsontype'] === 'DBRef') { + // Set up correct object for serialization + const ordered_values = Object.assign( + { + $ref: value.collection, + $id: value.oid + }, + value.fields + ); + + // Add db reference if it exists + if (value.db != null) { + ordered_values['$db'] = value.db; + } + + return ( + (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + + 1 + + calculateObjectSize(ordered_values, serializeFunctions, ignoreUndefined) + ); + } else if (value instanceof RegExp || isRegExp(value)) { + return ( + (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + + 1 + + Buffer.byteLength(value.source, 'utf8') + + 1 + + (value.global ? 1 : 0) + + (value.ignoreCase ? 1 : 0) + + (value.multiline ? 1 : 0) + + 1 + ); + } else if (value['_bsontype'] === 'BSONRegExp') { + return ( + (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + + 1 + + Buffer.byteLength(value.pattern, 'utf8') + + 1 + + Buffer.byteLength(value.options, 'utf8') + + 1 + ); + } else { + return ( + (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + + calculateObjectSize(value, serializeFunctions, ignoreUndefined) + + 1 + ); + } + case 'function': + // WTF for 0.4.X where typeof /someregexp/ === 'function' + if (value instanceof RegExp || isRegExp(value) || String.call(value) === '[object RegExp]') { + return ( + (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + + 1 + + Buffer.byteLength(value.source, 'utf8') + + 1 + + (value.global ? 1 : 0) + + (value.ignoreCase ? 1 : 0) + + (value.multiline ? 1 : 0) + + 1 + ); + } else { + if (serializeFunctions && value.scope != null && Object.keys(value.scope).length > 0) { + return ( + (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + + 1 + + 4 + + 4 + + Buffer.byteLength(normalizedFunctionString(value), 'utf8') + + 1 + + calculateObjectSize(value.scope, serializeFunctions, ignoreUndefined) + ); + } else if (serializeFunctions) { + return ( + (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + + 1 + + 4 + + Buffer.byteLength(normalizedFunctionString(value), 'utf8') + + 1 + ); + } + } + } + + return 0; +} diff --git a/node_modules/bson/src/parser/deserializer.ts b/node_modules/bson/src/parser/deserializer.ts new file mode 100644 index 000000000..411731e74 --- /dev/null +++ b/node_modules/bson/src/parser/deserializer.ts @@ -0,0 +1,774 @@ +import { Buffer } from 'buffer'; +import { Binary } from '../binary'; +import type { Document } from '../bson'; +import { Code } from '../code'; +import * as constants from '../constants'; +import { DBRef, DBRefLike, isDBRefLike } from '../db_ref'; +import { Decimal128 } from '../decimal128'; +import { Double } from '../double'; +import { BSONError } from '../error'; +import { Int32 } from '../int_32'; +import { Long } from '../long'; +import { MaxKey } from '../max_key'; +import { MinKey } from '../min_key'; +import { ObjectId } from '../objectid'; +import { BSONRegExp } from '../regexp'; +import { BSONSymbol } from '../symbol'; +import { Timestamp } from '../timestamp'; +import { validateUtf8 } from '../validate_utf8'; + +/** @public */ +export interface DeserializeOptions { + /** evaluate functions in the BSON document scoped to the object deserialized. */ + evalFunctions?: boolean; + /** cache evaluated functions for reuse. */ + cacheFunctions?: boolean; + /** + * use a crc32 code for caching, otherwise use the string of the function. + * @deprecated this option to use the crc32 function never worked as intended + * due to the fact that the crc32 function itself was never implemented. + * */ + cacheFunctionsCrc32?: boolean; + /** when deserializing a Long will fit it into a Number if it's smaller than 53 bits */ + promoteLongs?: boolean; + /** when deserializing a Binary will return it as a node.js Buffer instance. */ + promoteBuffers?: boolean; + /** when deserializing will promote BSON values to their Node.js closest equivalent types. */ + promoteValues?: boolean; + /** allow to specify if there what fields we wish to return as unserialized raw buffer. */ + fieldsAsRaw?: Document; + /** return BSON regular expressions as BSONRegExp instances. */ + bsonRegExp?: boolean; + /** allows the buffer to be larger than the parsed BSON object */ + allowObjectSmallerThanBufferSize?: boolean; + /** Offset into buffer to begin reading document from */ + index?: number; + + raw?: boolean; + /** Allows for opt-out utf-8 validation for all keys or + * specified keys. Must be all true or all false. + * + * @example + * ```js + * // disables validation on all keys + * validation: { utf8: false } + * + * // enables validation only on specified keys a, b, and c + * validation: { utf8: { a: true, b: true, c: true } } + * + * // disables validation only on specified keys a, b + * validation: { utf8: { a: false, b: false } } + * ``` + */ + validation?: { utf8: boolean | Record | Record }; +} + +// Internal long versions +const JS_INT_MAX_LONG = Long.fromNumber(constants.JS_INT_MAX); +const JS_INT_MIN_LONG = Long.fromNumber(constants.JS_INT_MIN); + +const functionCache: { [hash: string]: Function } = {}; + +export function deserialize( + buffer: Buffer, + options: DeserializeOptions, + isArray?: boolean +): Document { + options = options == null ? {} : options; + const index = options && options.index ? options.index : 0; + // Read the document size + const size = + buffer[index] | + (buffer[index + 1] << 8) | + (buffer[index + 2] << 16) | + (buffer[index + 3] << 24); + + if (size < 5) { + throw new BSONError(`bson size must be >= 5, is ${size}`); + } + + if (options.allowObjectSmallerThanBufferSize && buffer.length < size) { + throw new BSONError(`buffer length ${buffer.length} must be >= bson size ${size}`); + } + + if (!options.allowObjectSmallerThanBufferSize && buffer.length !== size) { + throw new BSONError(`buffer length ${buffer.length} must === bson size ${size}`); + } + + if (size + index > buffer.byteLength) { + throw new BSONError( + `(bson size ${size} + options.index ${index} must be <= buffer length ${buffer.byteLength})` + ); + } + + // Illegal end value + if (buffer[index + size - 1] !== 0) { + throw new BSONError( + "One object, sized correctly, with a spot for an EOO, but the EOO isn't 0x00" + ); + } + + // Start deserializtion + return deserializeObject(buffer, index, options, isArray); +} + +const allowedDBRefKeys = /^\$ref$|^\$id$|^\$db$/; + +function deserializeObject( + buffer: Buffer, + index: number, + options: DeserializeOptions, + isArray = false +) { + const evalFunctions = options['evalFunctions'] == null ? false : options['evalFunctions']; + const cacheFunctions = options['cacheFunctions'] == null ? false : options['cacheFunctions']; + + const fieldsAsRaw = options['fieldsAsRaw'] == null ? null : options['fieldsAsRaw']; + + // Return raw bson buffer instead of parsing it + const raw = options['raw'] == null ? false : options['raw']; + + // Return BSONRegExp objects instead of native regular expressions + const bsonRegExp = typeof options['bsonRegExp'] === 'boolean' ? options['bsonRegExp'] : false; + + // Controls the promotion of values vs wrapper classes + const promoteBuffers = options['promoteBuffers'] == null ? false : options['promoteBuffers']; + const promoteLongs = options['promoteLongs'] == null ? true : options['promoteLongs']; + const promoteValues = options['promoteValues'] == null ? true : options['promoteValues']; + + // Ensures default validation option if none given + const validation = options.validation == null ? { utf8: true } : options.validation; + + // Shows if global utf-8 validation is enabled or disabled + let globalUTFValidation = true; + // Reflects utf-8 validation setting regardless of global or specific key validation + let validationSetting: boolean; + // Set of keys either to enable or disable validation on + const utf8KeysSet = new Set(); + + // Check for boolean uniformity and empty validation option + const utf8ValidatedKeys = validation.utf8; + if (typeof utf8ValidatedKeys === 'boolean') { + validationSetting = utf8ValidatedKeys; + } else { + globalUTFValidation = false; + const utf8ValidationValues = Object.keys(utf8ValidatedKeys).map(function (key) { + return utf8ValidatedKeys[key]; + }); + if (utf8ValidationValues.length === 0) { + throw new BSONError('UTF-8 validation setting cannot be empty'); + } + if (typeof utf8ValidationValues[0] !== 'boolean') { + throw new BSONError('Invalid UTF-8 validation option, must specify boolean values'); + } + validationSetting = utf8ValidationValues[0]; + // Ensures boolean uniformity in utf-8 validation (all true or all false) + if (!utf8ValidationValues.every(item => item === validationSetting)) { + throw new BSONError('Invalid UTF-8 validation option - keys must be all true or all false'); + } + } + + // Add keys to set that will either be validated or not based on validationSetting + if (!globalUTFValidation) { + for (const key of Object.keys(utf8ValidatedKeys)) { + utf8KeysSet.add(key); + } + } + + // Set the start index + const startIndex = index; + + // Validate that we have at least 4 bytes of buffer + if (buffer.length < 5) throw new BSONError('corrupt bson message < 5 bytes long'); + + // Read the document size + const size = + buffer[index++] | (buffer[index++] << 8) | (buffer[index++] << 16) | (buffer[index++] << 24); + + // Ensure buffer is valid size + if (size < 5 || size > buffer.length) throw new BSONError('corrupt bson message'); + + // Create holding object + const object: Document = isArray ? [] : {}; + // Used for arrays to skip having to perform utf8 decoding + let arrayIndex = 0; + const done = false; + + let isPossibleDBRef = isArray ? false : null; + + // While we have more left data left keep parsing + while (!done) { + // Read the type + const elementType = buffer[index++]; + + // If we get a zero it's the last byte, exit + if (elementType === 0) break; + + // Get the start search index + let i = index; + // Locate the end of the c string + while (buffer[i] !== 0x00 && i < buffer.length) { + i++; + } + + // If are at the end of the buffer there is a problem with the document + if (i >= buffer.byteLength) throw new BSONError('Bad BSON Document: illegal CString'); + + // Represents the key + const name = isArray ? arrayIndex++ : buffer.toString('utf8', index, i); + + // shouldValidateKey is true if the key should be validated, false otherwise + let shouldValidateKey = true; + if (globalUTFValidation || utf8KeysSet.has(name)) { + shouldValidateKey = validationSetting; + } else { + shouldValidateKey = !validationSetting; + } + + if (isPossibleDBRef !== false && (name as string)[0] === '$') { + isPossibleDBRef = allowedDBRefKeys.test(name as string); + } + let value; + + index = i + 1; + + if (elementType === constants.BSON_DATA_STRING) { + const stringSize = + buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + if ( + stringSize <= 0 || + stringSize > buffer.length - index || + buffer[index + stringSize - 1] !== 0 + ) { + throw new BSONError('bad string length in bson'); + } + value = getValidatedString(buffer, index, index + stringSize - 1, shouldValidateKey); + index = index + stringSize; + } else if (elementType === constants.BSON_DATA_OID) { + const oid = Buffer.alloc(12); + buffer.copy(oid, 0, index, index + 12); + value = new ObjectId(oid); + index = index + 12; + } else if (elementType === constants.BSON_DATA_INT && promoteValues === false) { + value = new Int32( + buffer[index++] | (buffer[index++] << 8) | (buffer[index++] << 16) | (buffer[index++] << 24) + ); + } else if (elementType === constants.BSON_DATA_INT) { + value = + buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + } else if (elementType === constants.BSON_DATA_NUMBER && promoteValues === false) { + value = new Double(buffer.readDoubleLE(index)); + index = index + 8; + } else if (elementType === constants.BSON_DATA_NUMBER) { + value = buffer.readDoubleLE(index); + index = index + 8; + } else if (elementType === constants.BSON_DATA_DATE) { + const lowBits = + buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + const highBits = + buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + value = new Date(new Long(lowBits, highBits).toNumber()); + } else if (elementType === constants.BSON_DATA_BOOLEAN) { + if (buffer[index] !== 0 && buffer[index] !== 1) + throw new BSONError('illegal boolean type value'); + value = buffer[index++] === 1; + } else if (elementType === constants.BSON_DATA_OBJECT) { + const _index = index; + const objectSize = + buffer[index] | + (buffer[index + 1] << 8) | + (buffer[index + 2] << 16) | + (buffer[index + 3] << 24); + if (objectSize <= 0 || objectSize > buffer.length - index) + throw new BSONError('bad embedded document length in bson'); + + // We have a raw value + if (raw) { + value = buffer.slice(index, index + objectSize); + } else { + let objectOptions = options; + if (!globalUTFValidation) { + objectOptions = { ...options, validation: { utf8: shouldValidateKey } }; + } + value = deserializeObject(buffer, _index, objectOptions, false); + } + + index = index + objectSize; + } else if (elementType === constants.BSON_DATA_ARRAY) { + const _index = index; + const objectSize = + buffer[index] | + (buffer[index + 1] << 8) | + (buffer[index + 2] << 16) | + (buffer[index + 3] << 24); + let arrayOptions = options; + + // Stop index + const stopIndex = index + objectSize; + + // All elements of array to be returned as raw bson + if (fieldsAsRaw && fieldsAsRaw[name]) { + arrayOptions = {}; + for (const n in options) { + ( + arrayOptions as { + [key: string]: DeserializeOptions[keyof DeserializeOptions]; + } + )[n] = options[n as keyof DeserializeOptions]; + } + arrayOptions['raw'] = true; + } + if (!globalUTFValidation) { + arrayOptions = { ...arrayOptions, validation: { utf8: shouldValidateKey } }; + } + value = deserializeObject(buffer, _index, arrayOptions, true); + index = index + objectSize; + + if (buffer[index - 1] !== 0) throw new BSONError('invalid array terminator byte'); + if (index !== stopIndex) throw new BSONError('corrupted array bson'); + } else if (elementType === constants.BSON_DATA_UNDEFINED) { + value = undefined; + } else if (elementType === constants.BSON_DATA_NULL) { + value = null; + } else if (elementType === constants.BSON_DATA_LONG) { + // Unpack the low and high bits + const lowBits = + buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + const highBits = + buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + const long = new Long(lowBits, highBits); + // Promote the long if possible + if (promoteLongs && promoteValues === true) { + value = + long.lessThanOrEqual(JS_INT_MAX_LONG) && long.greaterThanOrEqual(JS_INT_MIN_LONG) + ? long.toNumber() + : long; + } else { + value = long; + } + } else if (elementType === constants.BSON_DATA_DECIMAL128) { + // Buffer to contain the decimal bytes + const bytes = Buffer.alloc(16); + // Copy the next 16 bytes into the bytes buffer + buffer.copy(bytes, 0, index, index + 16); + // Update index + index = index + 16; + // Assign the new Decimal128 value + const decimal128 = new Decimal128(bytes) as Decimal128 | { toObject(): unknown }; + // If we have an alternative mapper use that + if ('toObject' in decimal128 && typeof decimal128.toObject === 'function') { + value = decimal128.toObject(); + } else { + value = decimal128; + } + } else if (elementType === constants.BSON_DATA_BINARY) { + let binarySize = + buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + const totalBinarySize = binarySize; + const subType = buffer[index++]; + + // Did we have a negative binary size, throw + if (binarySize < 0) throw new BSONError('Negative binary type element size found'); + + // Is the length longer than the document + if (binarySize > buffer.byteLength) + throw new BSONError('Binary type size larger than document size'); + + // Decode as raw Buffer object if options specifies it + if (buffer['slice'] != null) { + // If we have subtype 2 skip the 4 bytes for the size + if (subType === Binary.SUBTYPE_BYTE_ARRAY) { + binarySize = + buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + if (binarySize < 0) + throw new BSONError('Negative binary type element size found for subtype 0x02'); + if (binarySize > totalBinarySize - 4) + throw new BSONError('Binary type with subtype 0x02 contains too long binary size'); + if (binarySize < totalBinarySize - 4) + throw new BSONError('Binary type with subtype 0x02 contains too short binary size'); + } + + if (promoteBuffers && promoteValues) { + value = buffer.slice(index, index + binarySize); + } else { + value = new Binary(buffer.slice(index, index + binarySize), subType); + } + } else { + const _buffer = Buffer.alloc(binarySize); + // If we have subtype 2 skip the 4 bytes for the size + if (subType === Binary.SUBTYPE_BYTE_ARRAY) { + binarySize = + buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + if (binarySize < 0) + throw new BSONError('Negative binary type element size found for subtype 0x02'); + if (binarySize > totalBinarySize - 4) + throw new BSONError('Binary type with subtype 0x02 contains too long binary size'); + if (binarySize < totalBinarySize - 4) + throw new BSONError('Binary type with subtype 0x02 contains too short binary size'); + } + + // Copy the data + for (i = 0; i < binarySize; i++) { + _buffer[i] = buffer[index + i]; + } + + if (promoteBuffers && promoteValues) { + value = _buffer; + } else { + value = new Binary(_buffer, subType); + } + } + + // Update the index + index = index + binarySize; + } else if (elementType === constants.BSON_DATA_REGEXP && bsonRegExp === false) { + // Get the start search index + i = index; + // Locate the end of the c string + while (buffer[i] !== 0x00 && i < buffer.length) { + i++; + } + // If are at the end of the buffer there is a problem with the document + if (i >= buffer.length) throw new BSONError('Bad BSON Document: illegal CString'); + // Return the C string + const source = buffer.toString('utf8', index, i); + // Create the regexp + index = i + 1; + + // Get the start search index + i = index; + // Locate the end of the c string + while (buffer[i] !== 0x00 && i < buffer.length) { + i++; + } + // If are at the end of the buffer there is a problem with the document + if (i >= buffer.length) throw new BSONError('Bad BSON Document: illegal CString'); + // Return the C string + const regExpOptions = buffer.toString('utf8', index, i); + index = i + 1; + + // For each option add the corresponding one for javascript + const optionsArray = new Array(regExpOptions.length); + + // Parse options + for (i = 0; i < regExpOptions.length; i++) { + switch (regExpOptions[i]) { + case 'm': + optionsArray[i] = 'm'; + break; + case 's': + optionsArray[i] = 'g'; + break; + case 'i': + optionsArray[i] = 'i'; + break; + } + } + + value = new RegExp(source, optionsArray.join('')); + } else if (elementType === constants.BSON_DATA_REGEXP && bsonRegExp === true) { + // Get the start search index + i = index; + // Locate the end of the c string + while (buffer[i] !== 0x00 && i < buffer.length) { + i++; + } + // If are at the end of the buffer there is a problem with the document + if (i >= buffer.length) throw new BSONError('Bad BSON Document: illegal CString'); + // Return the C string + const source = buffer.toString('utf8', index, i); + index = i + 1; + + // Get the start search index + i = index; + // Locate the end of the c string + while (buffer[i] !== 0x00 && i < buffer.length) { + i++; + } + // If are at the end of the buffer there is a problem with the document + if (i >= buffer.length) throw new BSONError('Bad BSON Document: illegal CString'); + // Return the C string + const regExpOptions = buffer.toString('utf8', index, i); + index = i + 1; + + // Set the object + value = new BSONRegExp(source, regExpOptions); + } else if (elementType === constants.BSON_DATA_SYMBOL) { + const stringSize = + buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + if ( + stringSize <= 0 || + stringSize > buffer.length - index || + buffer[index + stringSize - 1] !== 0 + ) { + throw new BSONError('bad string length in bson'); + } + const symbol = getValidatedString(buffer, index, index + stringSize - 1, shouldValidateKey); + value = promoteValues ? symbol : new BSONSymbol(symbol); + index = index + stringSize; + } else if (elementType === constants.BSON_DATA_TIMESTAMP) { + const lowBits = + buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + const highBits = + buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + + value = new Timestamp(lowBits, highBits); + } else if (elementType === constants.BSON_DATA_MIN_KEY) { + value = new MinKey(); + } else if (elementType === constants.BSON_DATA_MAX_KEY) { + value = new MaxKey(); + } else if (elementType === constants.BSON_DATA_CODE) { + const stringSize = + buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + if ( + stringSize <= 0 || + stringSize > buffer.length - index || + buffer[index + stringSize - 1] !== 0 + ) { + throw new BSONError('bad string length in bson'); + } + const functionString = getValidatedString( + buffer, + index, + index + stringSize - 1, + shouldValidateKey + ); + + // If we are evaluating the functions + if (evalFunctions) { + // If we have cache enabled let's look for the md5 of the function in the cache + if (cacheFunctions) { + // Got to do this to avoid V8 deoptimizing the call due to finding eval + value = isolateEval(functionString, functionCache, object); + } else { + value = isolateEval(functionString); + } + } else { + value = new Code(functionString); + } + + // Update parse index position + index = index + stringSize; + } else if (elementType === constants.BSON_DATA_CODE_W_SCOPE) { + const totalSize = + buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + + // Element cannot be shorter than totalSize + stringSize + documentSize + terminator + if (totalSize < 4 + 4 + 4 + 1) { + throw new BSONError('code_w_scope total size shorter minimum expected length'); + } + + // Get the code string size + const stringSize = + buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + // Check if we have a valid string + if ( + stringSize <= 0 || + stringSize > buffer.length - index || + buffer[index + stringSize - 1] !== 0 + ) { + throw new BSONError('bad string length in bson'); + } + + // Javascript function + const functionString = getValidatedString( + buffer, + index, + index + stringSize - 1, + shouldValidateKey + ); + // Update parse index position + index = index + stringSize; + // Parse the element + const _index = index; + // Decode the size of the object document + const objectSize = + buffer[index] | + (buffer[index + 1] << 8) | + (buffer[index + 2] << 16) | + (buffer[index + 3] << 24); + // Decode the scope object + const scopeObject = deserializeObject(buffer, _index, options, false); + // Adjust the index + index = index + objectSize; + + // Check if field length is too short + if (totalSize < 4 + 4 + objectSize + stringSize) { + throw new BSONError('code_w_scope total size is too short, truncating scope'); + } + + // Check if totalSize field is too long + if (totalSize > 4 + 4 + objectSize + stringSize) { + throw new BSONError('code_w_scope total size is too long, clips outer document'); + } + + // If we are evaluating the functions + if (evalFunctions) { + // If we have cache enabled let's look for the md5 of the function in the cache + if (cacheFunctions) { + // Got to do this to avoid V8 deoptimizing the call due to finding eval + value = isolateEval(functionString, functionCache, object); + } else { + value = isolateEval(functionString); + } + + value.scope = scopeObject; + } else { + value = new Code(functionString, scopeObject); + } + } else if (elementType === constants.BSON_DATA_DBPOINTER) { + // Get the code string size + const stringSize = + buffer[index++] | + (buffer[index++] << 8) | + (buffer[index++] << 16) | + (buffer[index++] << 24); + // Check if we have a valid string + if ( + stringSize <= 0 || + stringSize > buffer.length - index || + buffer[index + stringSize - 1] !== 0 + ) + throw new BSONError('bad string length in bson'); + // Namespace + if (validation != null && validation.utf8) { + if (!validateUtf8(buffer, index, index + stringSize - 1)) { + throw new BSONError('Invalid UTF-8 string in BSON document'); + } + } + const namespace = buffer.toString('utf8', index, index + stringSize - 1); + // Update parse index position + index = index + stringSize; + + // Read the oid + const oidBuffer = Buffer.alloc(12); + buffer.copy(oidBuffer, 0, index, index + 12); + const oid = new ObjectId(oidBuffer); + + // Update the index + index = index + 12; + + // Upgrade to DBRef type + value = new DBRef(namespace, oid); + } else { + throw new BSONError( + 'Detected unknown BSON type ' + elementType.toString(16) + ' for fieldname "' + name + '"' + ); + } + if (name === '__proto__') { + Object.defineProperty(object, name, { + value, + writable: true, + enumerable: true, + configurable: true + }); + } else { + object[name] = value; + } + } + + // Check if the deserialization was against a valid array/object + if (size !== index - startIndex) { + if (isArray) throw new BSONError('corrupt array bson'); + throw new BSONError('corrupt object bson'); + } + + // if we did not find "$ref", "$id", "$db", or found an extraneous $key, don't make a DBRef + if (!isPossibleDBRef) return object; + + if (isDBRefLike(object)) { + const copy = Object.assign({}, object) as Partial; + delete copy.$ref; + delete copy.$id; + delete copy.$db; + return new DBRef(object.$ref, object.$id, object.$db, copy); + } + + return object; +} + +/** + * Ensure eval is isolated, store the result in functionCache. + * + * @internal + */ +function isolateEval( + functionString: string, + functionCache?: { [hash: string]: Function }, + object?: Document +) { + if (!functionCache) return new Function(functionString); + // Check for cache hit, eval if missing and return cached function + if (functionCache[functionString] == null) { + functionCache[functionString] = new Function(functionString); + } + + // Set the object + return functionCache[functionString].bind(object); +} + +function getValidatedString( + buffer: Buffer, + start: number, + end: number, + shouldValidateUtf8: boolean +) { + const value = buffer.toString('utf8', start, end); + // if utf8 validation is on, do the check + if (shouldValidateUtf8) { + for (let i = 0; i < value.length; i++) { + if (value.charCodeAt(i) === 0xfffd) { + if (!validateUtf8(buffer, start, end)) { + throw new BSONError('Invalid UTF-8 string in BSON document'); + } + break; + } + } + } + return value; +} diff --git a/node_modules/bson/src/parser/serializer.ts b/node_modules/bson/src/parser/serializer.ts new file mode 100644 index 000000000..da94e1c4f --- /dev/null +++ b/node_modules/bson/src/parser/serializer.ts @@ -0,0 +1,1069 @@ +import type { Buffer } from 'buffer'; +import { Binary } from '../binary'; +import type { BSONSymbol, DBRef, Document, MaxKey } from '../bson'; +import type { Code } from '../code'; +import * as constants from '../constants'; +import type { DBRefLike } from '../db_ref'; +import type { Decimal128 } from '../decimal128'; +import type { Double } from '../double'; +import { ensureBuffer } from '../ensure_buffer'; +import { BSONError, BSONTypeError } from '../error'; +import { isBSONType } from '../extended_json'; +import { writeIEEE754 } from '../float_parser'; +import type { Int32 } from '../int_32'; +import { Long } from '../long'; +import { Map } from '../map'; +import type { MinKey } from '../min_key'; +import type { ObjectId } from '../objectid'; +import type { BSONRegExp } from '../regexp'; +import { + isBigInt64Array, + isBigUInt64Array, + isDate, + isMap, + isRegExp, + isUint8Array, + normalizedFunctionString +} from './utils'; + +/** @public */ +export interface SerializeOptions { + /** the serializer will check if keys are valid. */ + checkKeys?: boolean; + /** serialize the javascript functions **(default:false)**. */ + serializeFunctions?: boolean; + /** serialize will not emit undefined fields **(default:true)** */ + ignoreUndefined?: boolean; + /** @internal Resize internal buffer */ + minInternalBufferSize?: number; + /** the index in the buffer where we wish to start serializing into */ + index?: number; +} + +const regexp = /\x00/; // eslint-disable-line no-control-regex +const ignoreKeys = new Set(['$db', '$ref', '$id', '$clusterTime']); + +/* + * isArray indicates if we are writing to a BSON array (type 0x04) + * which forces the "key" which really an array index as a string to be written as ascii + * This will catch any errors in index as a string generation + */ + +function serializeString( + buffer: Buffer, + key: string, + value: string, + index: number, + isArray?: boolean +) { + // Encode String type + buffer[index++] = constants.BSON_DATA_STRING; + // Number of written bytes + const numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes + 1; + buffer[index - 1] = 0; + // Write the string + const size = buffer.write(value, index + 4, undefined, 'utf8'); + // Write the size of the string to buffer + buffer[index + 3] = ((size + 1) >> 24) & 0xff; + buffer[index + 2] = ((size + 1) >> 16) & 0xff; + buffer[index + 1] = ((size + 1) >> 8) & 0xff; + buffer[index] = (size + 1) & 0xff; + // Update index + index = index + 4 + size; + // Write zero + buffer[index++] = 0; + return index; +} + +function serializeNumber( + buffer: Buffer, + key: string, + value: number, + index: number, + isArray?: boolean +) { + // We have an integer value + // TODO(NODE-2529): Add support for big int + if ( + Number.isInteger(value) && + value >= constants.BSON_INT32_MIN && + value <= constants.BSON_INT32_MAX + ) { + // If the value fits in 32 bits encode as int32 + // Set int type 32 bits or less + buffer[index++] = constants.BSON_DATA_INT; + // Number of written bytes + const numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Write the int value + buffer[index++] = value & 0xff; + buffer[index++] = (value >> 8) & 0xff; + buffer[index++] = (value >> 16) & 0xff; + buffer[index++] = (value >> 24) & 0xff; + } else { + // Encode as double + buffer[index++] = constants.BSON_DATA_NUMBER; + // Number of written bytes + const numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Write float + writeIEEE754(buffer, value, index, 'little', 52, 8); + // Adjust index + index = index + 8; + } + + return index; +} + +function serializeNull(buffer: Buffer, key: string, _: unknown, index: number, isArray?: boolean) { + // Set long type + buffer[index++] = constants.BSON_DATA_NULL; + + // Number of written bytes + const numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + return index; +} + +function serializeBoolean( + buffer: Buffer, + key: string, + value: boolean, + index: number, + isArray?: boolean +) { + // Write the type + buffer[index++] = constants.BSON_DATA_BOOLEAN; + // Number of written bytes + const numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Encode the boolean value + buffer[index++] = value ? 1 : 0; + return index; +} + +function serializeDate(buffer: Buffer, key: string, value: Date, index: number, isArray?: boolean) { + // Write the type + buffer[index++] = constants.BSON_DATA_DATE; + // Number of written bytes + const numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + + // Write the date + const dateInMilis = Long.fromNumber(value.getTime()); + const lowBits = dateInMilis.getLowBits(); + const highBits = dateInMilis.getHighBits(); + // Encode low bits + buffer[index++] = lowBits & 0xff; + buffer[index++] = (lowBits >> 8) & 0xff; + buffer[index++] = (lowBits >> 16) & 0xff; + buffer[index++] = (lowBits >> 24) & 0xff; + // Encode high bits + buffer[index++] = highBits & 0xff; + buffer[index++] = (highBits >> 8) & 0xff; + buffer[index++] = (highBits >> 16) & 0xff; + buffer[index++] = (highBits >> 24) & 0xff; + return index; +} + +function serializeRegExp( + buffer: Buffer, + key: string, + value: RegExp, + index: number, + isArray?: boolean +) { + // Write the type + buffer[index++] = constants.BSON_DATA_REGEXP; + // Number of written bytes + const numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + if (value.source && value.source.match(regexp) != null) { + throw Error('value ' + value.source + ' must not contain null bytes'); + } + // Adjust the index + index = index + buffer.write(value.source, index, undefined, 'utf8'); + // Write zero + buffer[index++] = 0x00; + // Write the parameters + if (value.ignoreCase) buffer[index++] = 0x69; // i + if (value.global) buffer[index++] = 0x73; // s + if (value.multiline) buffer[index++] = 0x6d; // m + + // Add ending zero + buffer[index++] = 0x00; + return index; +} + +function serializeBSONRegExp( + buffer: Buffer, + key: string, + value: BSONRegExp, + index: number, + isArray?: boolean +) { + // Write the type + buffer[index++] = constants.BSON_DATA_REGEXP; + // Number of written bytes + const numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + + // Check the pattern for 0 bytes + if (value.pattern.match(regexp) != null) { + // The BSON spec doesn't allow keys with null bytes because keys are + // null-terminated. + throw Error('pattern ' + value.pattern + ' must not contain null bytes'); + } + + // Adjust the index + index = index + buffer.write(value.pattern, index, undefined, 'utf8'); + // Write zero + buffer[index++] = 0x00; + // Write the options + index = index + buffer.write(value.options.split('').sort().join(''), index, undefined, 'utf8'); + // Add ending zero + buffer[index++] = 0x00; + return index; +} + +function serializeMinMax( + buffer: Buffer, + key: string, + value: MinKey | MaxKey, + index: number, + isArray?: boolean +) { + // Write the type of either min or max key + if (value === null) { + buffer[index++] = constants.BSON_DATA_NULL; + } else if (value._bsontype === 'MinKey') { + buffer[index++] = constants.BSON_DATA_MIN_KEY; + } else { + buffer[index++] = constants.BSON_DATA_MAX_KEY; + } + + // Number of written bytes + const numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + return index; +} + +function serializeObjectId( + buffer: Buffer, + key: string, + value: ObjectId, + index: number, + isArray?: boolean +) { + // Write the type + buffer[index++] = constants.BSON_DATA_OID; + // Number of written bytes + const numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + + // Write the objectId into the shared buffer + if (typeof value.id === 'string') { + buffer.write(value.id, index, undefined, 'binary'); + } else if (isUint8Array(value.id)) { + // Use the standard JS methods here because buffer.copy() is buggy with the + // browser polyfill + buffer.set(value.id.subarray(0, 12), index); + } else { + throw new BSONTypeError('object [' + JSON.stringify(value) + '] is not a valid ObjectId'); + } + + // Adjust index + return index + 12; +} + +function serializeBuffer( + buffer: Buffer, + key: string, + value: Buffer | Uint8Array, + index: number, + isArray?: boolean +) { + // Write the type + buffer[index++] = constants.BSON_DATA_BINARY; + // Number of written bytes + const numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Get size of the buffer (current write point) + const size = value.length; + // Write the size of the string to buffer + buffer[index++] = size & 0xff; + buffer[index++] = (size >> 8) & 0xff; + buffer[index++] = (size >> 16) & 0xff; + buffer[index++] = (size >> 24) & 0xff; + // Write the default subtype + buffer[index++] = constants.BSON_BINARY_SUBTYPE_DEFAULT; + // Copy the content form the binary field to the buffer + buffer.set(ensureBuffer(value), index); + // Adjust the index + index = index + size; + return index; +} + +function serializeObject( + buffer: Buffer, + key: string, + value: Document, + index: number, + checkKeys = false, + depth = 0, + serializeFunctions = false, + ignoreUndefined = true, + isArray = false, + path: Document[] = [] +) { + for (let i = 0; i < path.length; i++) { + if (path[i] === value) throw new BSONError('cyclic dependency detected'); + } + + // Push value to stack + path.push(value); + // Write the type + buffer[index++] = Array.isArray(value) ? constants.BSON_DATA_ARRAY : constants.BSON_DATA_OBJECT; + // Number of written bytes + const numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + const endIndex = serializeInto( + buffer, + value, + checkKeys, + index, + depth + 1, + serializeFunctions, + ignoreUndefined, + path + ); + // Pop stack + path.pop(); + return endIndex; +} + +function serializeDecimal128( + buffer: Buffer, + key: string, + value: Decimal128, + index: number, + isArray?: boolean +) { + buffer[index++] = constants.BSON_DATA_DECIMAL128; + // Number of written bytes + const numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Write the data from the value + // Prefer the standard JS methods because their typechecking is not buggy, + // unlike the `buffer` polyfill's. + buffer.set(value.bytes.subarray(0, 16), index); + return index + 16; +} + +function serializeLong(buffer: Buffer, key: string, value: Long, index: number, isArray?: boolean) { + // Write the type + buffer[index++] = + value._bsontype === 'Long' ? constants.BSON_DATA_LONG : constants.BSON_DATA_TIMESTAMP; + // Number of written bytes + const numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Write the date + const lowBits = value.getLowBits(); + const highBits = value.getHighBits(); + // Encode low bits + buffer[index++] = lowBits & 0xff; + buffer[index++] = (lowBits >> 8) & 0xff; + buffer[index++] = (lowBits >> 16) & 0xff; + buffer[index++] = (lowBits >> 24) & 0xff; + // Encode high bits + buffer[index++] = highBits & 0xff; + buffer[index++] = (highBits >> 8) & 0xff; + buffer[index++] = (highBits >> 16) & 0xff; + buffer[index++] = (highBits >> 24) & 0xff; + return index; +} + +function serializeInt32( + buffer: Buffer, + key: string, + value: Int32 | number, + index: number, + isArray?: boolean +) { + value = value.valueOf(); + // Set int type 32 bits or less + buffer[index++] = constants.BSON_DATA_INT; + // Number of written bytes + const numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Write the int value + buffer[index++] = value & 0xff; + buffer[index++] = (value >> 8) & 0xff; + buffer[index++] = (value >> 16) & 0xff; + buffer[index++] = (value >> 24) & 0xff; + return index; +} + +function serializeDouble( + buffer: Buffer, + key: string, + value: Double, + index: number, + isArray?: boolean +) { + // Encode as double + buffer[index++] = constants.BSON_DATA_NUMBER; + + // Number of written bytes + const numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + + // Write float + writeIEEE754(buffer, value.value, index, 'little', 52, 8); + + // Adjust index + index = index + 8; + return index; +} + +function serializeFunction( + buffer: Buffer, + key: string, + value: Function, + index: number, + _checkKeys = false, + _depth = 0, + isArray?: boolean +) { + buffer[index++] = constants.BSON_DATA_CODE; + // Number of written bytes + const numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Function string + const functionString = normalizedFunctionString(value); + + // Write the string + const size = buffer.write(functionString, index + 4, undefined, 'utf8') + 1; + // Write the size of the string to buffer + buffer[index] = size & 0xff; + buffer[index + 1] = (size >> 8) & 0xff; + buffer[index + 2] = (size >> 16) & 0xff; + buffer[index + 3] = (size >> 24) & 0xff; + // Update index + index = index + 4 + size - 1; + // Write zero + buffer[index++] = 0; + return index; +} + +function serializeCode( + buffer: Buffer, + key: string, + value: Code, + index: number, + checkKeys = false, + depth = 0, + serializeFunctions = false, + ignoreUndefined = true, + isArray = false +) { + if (value.scope && typeof value.scope === 'object') { + // Write the type + buffer[index++] = constants.BSON_DATA_CODE_W_SCOPE; + // Number of written bytes + const numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + + // Starting index + let startIndex = index; + + // Serialize the function + // Get the function string + const functionString = typeof value.code === 'string' ? value.code : value.code.toString(); + // Index adjustment + index = index + 4; + // Write string into buffer + const codeSize = buffer.write(functionString, index + 4, undefined, 'utf8') + 1; + // Write the size of the string to buffer + buffer[index] = codeSize & 0xff; + buffer[index + 1] = (codeSize >> 8) & 0xff; + buffer[index + 2] = (codeSize >> 16) & 0xff; + buffer[index + 3] = (codeSize >> 24) & 0xff; + // Write end 0 + buffer[index + 4 + codeSize - 1] = 0; + // Write the + index = index + codeSize + 4; + + // + // Serialize the scope value + const endIndex = serializeInto( + buffer, + value.scope, + checkKeys, + index, + depth + 1, + serializeFunctions, + ignoreUndefined + ); + index = endIndex - 1; + + // Writ the total + const totalSize = endIndex - startIndex; + + // Write the total size of the object + buffer[startIndex++] = totalSize & 0xff; + buffer[startIndex++] = (totalSize >> 8) & 0xff; + buffer[startIndex++] = (totalSize >> 16) & 0xff; + buffer[startIndex++] = (totalSize >> 24) & 0xff; + // Write trailing zero + buffer[index++] = 0; + } else { + buffer[index++] = constants.BSON_DATA_CODE; + // Number of written bytes + const numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Function string + const functionString = value.code.toString(); + // Write the string + const size = buffer.write(functionString, index + 4, undefined, 'utf8') + 1; + // Write the size of the string to buffer + buffer[index] = size & 0xff; + buffer[index + 1] = (size >> 8) & 0xff; + buffer[index + 2] = (size >> 16) & 0xff; + buffer[index + 3] = (size >> 24) & 0xff; + // Update index + index = index + 4 + size - 1; + // Write zero + buffer[index++] = 0; + } + + return index; +} + +function serializeBinary( + buffer: Buffer, + key: string, + value: Binary, + index: number, + isArray?: boolean +) { + // Write the type + buffer[index++] = constants.BSON_DATA_BINARY; + // Number of written bytes + const numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Extract the buffer + const data = value.value(true) as Buffer | Uint8Array; + // Calculate size + let size = value.position; + // Add the deprecated 02 type 4 bytes of size to total + if (value.sub_type === Binary.SUBTYPE_BYTE_ARRAY) size = size + 4; + // Write the size of the string to buffer + buffer[index++] = size & 0xff; + buffer[index++] = (size >> 8) & 0xff; + buffer[index++] = (size >> 16) & 0xff; + buffer[index++] = (size >> 24) & 0xff; + // Write the subtype to the buffer + buffer[index++] = value.sub_type; + + // If we have binary type 2 the 4 first bytes are the size + if (value.sub_type === Binary.SUBTYPE_BYTE_ARRAY) { + size = size - 4; + buffer[index++] = size & 0xff; + buffer[index++] = (size >> 8) & 0xff; + buffer[index++] = (size >> 16) & 0xff; + buffer[index++] = (size >> 24) & 0xff; + } + + // Write the data to the object + buffer.set(data, index); + // Adjust the index + index = index + value.position; + return index; +} + +function serializeSymbol( + buffer: Buffer, + key: string, + value: BSONSymbol, + index: number, + isArray?: boolean +) { + // Write the type + buffer[index++] = constants.BSON_DATA_SYMBOL; + // Number of written bytes + const numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + // Write the string + const size = buffer.write(value.value, index + 4, undefined, 'utf8') + 1; + // Write the size of the string to buffer + buffer[index] = size & 0xff; + buffer[index + 1] = (size >> 8) & 0xff; + buffer[index + 2] = (size >> 16) & 0xff; + buffer[index + 3] = (size >> 24) & 0xff; + // Update index + index = index + 4 + size - 1; + // Write zero + buffer[index++] = 0x00; + return index; +} + +function serializeDBRef( + buffer: Buffer, + key: string, + value: DBRef, + index: number, + depth: number, + serializeFunctions: boolean, + isArray?: boolean +) { + // Write the type + buffer[index++] = constants.BSON_DATA_OBJECT; + // Number of written bytes + const numberOfWrittenBytes = !isArray + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); + + // Encode the name + index = index + numberOfWrittenBytes; + buffer[index++] = 0; + + let startIndex = index; + let output: DBRefLike = { + $ref: value.collection || value.namespace, // "namespace" was what library 1.x called "collection" + $id: value.oid + }; + + if (value.db != null) { + output.$db = value.db; + } + + output = Object.assign(output, value.fields); + const endIndex = serializeInto(buffer, output, false, index, depth + 1, serializeFunctions); + + // Calculate object size + const size = endIndex - startIndex; + // Write the size + buffer[startIndex++] = size & 0xff; + buffer[startIndex++] = (size >> 8) & 0xff; + buffer[startIndex++] = (size >> 16) & 0xff; + buffer[startIndex++] = (size >> 24) & 0xff; + // Set index + return endIndex; +} + +export function serializeInto( + buffer: Buffer, + object: Document, + checkKeys = false, + startingIndex = 0, + depth = 0, + serializeFunctions = false, + ignoreUndefined = true, + path: Document[] = [] +): number { + startingIndex = startingIndex || 0; + path = path || []; + + // Push the object to the path + path.push(object); + + // Start place to serialize into + let index = startingIndex + 4; + + // Special case isArray + if (Array.isArray(object)) { + // Get object keys + for (let i = 0; i < object.length; i++) { + const key = '' + i; + let value = object[i]; + + // Is there an override value + if (typeof value?.toBSON === 'function') { + value = value.toBSON(); + } + + if (typeof value === 'string') { + index = serializeString(buffer, key, value, index, true); + } else if (typeof value === 'number') { + index = serializeNumber(buffer, key, value, index, true); + } else if (typeof value === 'bigint') { + throw new BSONTypeError('Unsupported type BigInt, please use Decimal128'); + } else if (typeof value === 'boolean') { + index = serializeBoolean(buffer, key, value, index, true); + } else if (value instanceof Date || isDate(value)) { + index = serializeDate(buffer, key, value, index, true); + } else if (value === undefined) { + index = serializeNull(buffer, key, value, index, true); + } else if (value === null) { + index = serializeNull(buffer, key, value, index, true); + } else if (value['_bsontype'] === 'ObjectId' || value['_bsontype'] === 'ObjectID') { + index = serializeObjectId(buffer, key, value, index, true); + } else if (isUint8Array(value)) { + index = serializeBuffer(buffer, key, value, index, true); + } else if (value instanceof RegExp || isRegExp(value)) { + index = serializeRegExp(buffer, key, value, index, true); + } else if (typeof value === 'object' && value['_bsontype'] == null) { + index = serializeObject( + buffer, + key, + value, + index, + checkKeys, + depth, + serializeFunctions, + ignoreUndefined, + true, + path + ); + } else if ( + typeof value === 'object' && + isBSONType(value) && + value._bsontype === 'Decimal128' + ) { + index = serializeDecimal128(buffer, key, value, index, true); + } else if (value['_bsontype'] === 'Long' || value['_bsontype'] === 'Timestamp') { + index = serializeLong(buffer, key, value, index, true); + } else if (value['_bsontype'] === 'Double') { + index = serializeDouble(buffer, key, value, index, true); + } else if (typeof value === 'function' && serializeFunctions) { + index = serializeFunction(buffer, key, value, index, checkKeys, depth, true); + } else if (value['_bsontype'] === 'Code') { + index = serializeCode( + buffer, + key, + value, + index, + checkKeys, + depth, + serializeFunctions, + ignoreUndefined, + true + ); + } else if (value['_bsontype'] === 'Binary') { + index = serializeBinary(buffer, key, value, index, true); + } else if (value['_bsontype'] === 'Symbol') { + index = serializeSymbol(buffer, key, value, index, true); + } else if (value['_bsontype'] === 'DBRef') { + index = serializeDBRef(buffer, key, value, index, depth, serializeFunctions, true); + } else if (value['_bsontype'] === 'BSONRegExp') { + index = serializeBSONRegExp(buffer, key, value, index, true); + } else if (value['_bsontype'] === 'Int32') { + index = serializeInt32(buffer, key, value, index, true); + } else if (value['_bsontype'] === 'MinKey' || value['_bsontype'] === 'MaxKey') { + index = serializeMinMax(buffer, key, value, index, true); + } else if (typeof value['_bsontype'] !== 'undefined') { + throw new BSONTypeError('Unrecognized or invalid _bsontype: ' + value['_bsontype']); + } + } + } else if (object instanceof Map || isMap(object)) { + const iterator = object.entries(); + let done = false; + + while (!done) { + // Unpack the next entry + const entry = iterator.next(); + done = !!entry.done; + // Are we done, then skip and terminate + if (done) continue; + + // Get the entry values + const key = entry.value[0]; + const value = entry.value[1]; + + // Check the type of the value + const type = typeof value; + + // Check the key and throw error if it's illegal + if (typeof key === 'string' && !ignoreKeys.has(key)) { + if (key.match(regexp) != null) { + // The BSON spec doesn't allow keys with null bytes because keys are + // null-terminated. + throw Error('key ' + key + ' must not contain null bytes'); + } + + if (checkKeys) { + if ('$' === key[0]) { + throw Error('key ' + key + " must not start with '$'"); + } else if (~key.indexOf('.')) { + throw Error('key ' + key + " must not contain '.'"); + } + } + } + + if (type === 'string') { + index = serializeString(buffer, key, value, index); + } else if (type === 'number') { + index = serializeNumber(buffer, key, value, index); + } else if (type === 'bigint' || isBigInt64Array(value) || isBigUInt64Array(value)) { + throw new BSONTypeError('Unsupported type BigInt, please use Decimal128'); + } else if (type === 'boolean') { + index = serializeBoolean(buffer, key, value, index); + } else if (value instanceof Date || isDate(value)) { + index = serializeDate(buffer, key, value, index); + } else if (value === null || (value === undefined && ignoreUndefined === false)) { + index = serializeNull(buffer, key, value, index); + } else if (value['_bsontype'] === 'ObjectId' || value['_bsontype'] === 'ObjectID') { + index = serializeObjectId(buffer, key, value, index); + } else if (isUint8Array(value)) { + index = serializeBuffer(buffer, key, value, index); + } else if (value instanceof RegExp || isRegExp(value)) { + index = serializeRegExp(buffer, key, value, index); + } else if (type === 'object' && value['_bsontype'] == null) { + index = serializeObject( + buffer, + key, + value, + index, + checkKeys, + depth, + serializeFunctions, + ignoreUndefined, + false, + path + ); + } else if (type === 'object' && value['_bsontype'] === 'Decimal128') { + index = serializeDecimal128(buffer, key, value, index); + } else if (value['_bsontype'] === 'Long' || value['_bsontype'] === 'Timestamp') { + index = serializeLong(buffer, key, value, index); + } else if (value['_bsontype'] === 'Double') { + index = serializeDouble(buffer, key, value, index); + } else if (value['_bsontype'] === 'Code') { + index = serializeCode( + buffer, + key, + value, + index, + checkKeys, + depth, + serializeFunctions, + ignoreUndefined + ); + } else if (typeof value === 'function' && serializeFunctions) { + index = serializeFunction(buffer, key, value, index, checkKeys, depth, serializeFunctions); + } else if (value['_bsontype'] === 'Binary') { + index = serializeBinary(buffer, key, value, index); + } else if (value['_bsontype'] === 'Symbol') { + index = serializeSymbol(buffer, key, value, index); + } else if (value['_bsontype'] === 'DBRef') { + index = serializeDBRef(buffer, key, value, index, depth, serializeFunctions); + } else if (value['_bsontype'] === 'BSONRegExp') { + index = serializeBSONRegExp(buffer, key, value, index); + } else if (value['_bsontype'] === 'Int32') { + index = serializeInt32(buffer, key, value, index); + } else if (value['_bsontype'] === 'MinKey' || value['_bsontype'] === 'MaxKey') { + index = serializeMinMax(buffer, key, value, index); + } else if (typeof value['_bsontype'] !== 'undefined') { + throw new BSONTypeError('Unrecognized or invalid _bsontype: ' + value['_bsontype']); + } + } + } else { + if (typeof object?.toBSON === 'function') { + // Provided a custom serialization method + object = object.toBSON(); + if (object != null && typeof object !== 'object') { + throw new BSONTypeError('toBSON function did not return an object'); + } + } + + // Iterate over all the keys + for (const key in object) { + let value = object[key]; + // Is there an override value + if (typeof value?.toBSON === 'function') { + value = value.toBSON(); + } + + // Check the type of the value + const type = typeof value; + + // Check the key and throw error if it's illegal + if (typeof key === 'string' && !ignoreKeys.has(key)) { + if (key.match(regexp) != null) { + // The BSON spec doesn't allow keys with null bytes because keys are + // null-terminated. + throw Error('key ' + key + ' must not contain null bytes'); + } + + if (checkKeys) { + if ('$' === key[0]) { + throw Error('key ' + key + " must not start with '$'"); + } else if (~key.indexOf('.')) { + throw Error('key ' + key + " must not contain '.'"); + } + } + } + + if (type === 'string') { + index = serializeString(buffer, key, value, index); + } else if (type === 'number') { + index = serializeNumber(buffer, key, value, index); + } else if (type === 'bigint') { + throw new BSONTypeError('Unsupported type BigInt, please use Decimal128'); + } else if (type === 'boolean') { + index = serializeBoolean(buffer, key, value, index); + } else if (value instanceof Date || isDate(value)) { + index = serializeDate(buffer, key, value, index); + } else if (value === undefined) { + if (ignoreUndefined === false) index = serializeNull(buffer, key, value, index); + } else if (value === null) { + index = serializeNull(buffer, key, value, index); + } else if (value['_bsontype'] === 'ObjectId' || value['_bsontype'] === 'ObjectID') { + index = serializeObjectId(buffer, key, value, index); + } else if (isUint8Array(value)) { + index = serializeBuffer(buffer, key, value, index); + } else if (value instanceof RegExp || isRegExp(value)) { + index = serializeRegExp(buffer, key, value, index); + } else if (type === 'object' && value['_bsontype'] == null) { + index = serializeObject( + buffer, + key, + value, + index, + checkKeys, + depth, + serializeFunctions, + ignoreUndefined, + false, + path + ); + } else if (type === 'object' && value['_bsontype'] === 'Decimal128') { + index = serializeDecimal128(buffer, key, value, index); + } else if (value['_bsontype'] === 'Long' || value['_bsontype'] === 'Timestamp') { + index = serializeLong(buffer, key, value, index); + } else if (value['_bsontype'] === 'Double') { + index = serializeDouble(buffer, key, value, index); + } else if (value['_bsontype'] === 'Code') { + index = serializeCode( + buffer, + key, + value, + index, + checkKeys, + depth, + serializeFunctions, + ignoreUndefined + ); + } else if (typeof value === 'function' && serializeFunctions) { + index = serializeFunction(buffer, key, value, index, checkKeys, depth, serializeFunctions); + } else if (value['_bsontype'] === 'Binary') { + index = serializeBinary(buffer, key, value, index); + } else if (value['_bsontype'] === 'Symbol') { + index = serializeSymbol(buffer, key, value, index); + } else if (value['_bsontype'] === 'DBRef') { + index = serializeDBRef(buffer, key, value, index, depth, serializeFunctions); + } else if (value['_bsontype'] === 'BSONRegExp') { + index = serializeBSONRegExp(buffer, key, value, index); + } else if (value['_bsontype'] === 'Int32') { + index = serializeInt32(buffer, key, value, index); + } else if (value['_bsontype'] === 'MinKey' || value['_bsontype'] === 'MaxKey') { + index = serializeMinMax(buffer, key, value, index); + } else if (typeof value['_bsontype'] !== 'undefined') { + throw new BSONTypeError('Unrecognized or invalid _bsontype: ' + value['_bsontype']); + } + } + } + + // Remove the path + path.pop(); + + // Final padding byte for object + buffer[index++] = 0x00; + + // Final size + const size = index - startingIndex; + // Write the size of the object + buffer[startingIndex++] = size & 0xff; + buffer[startingIndex++] = (size >> 8) & 0xff; + buffer[startingIndex++] = (size >> 16) & 0xff; + buffer[startingIndex++] = (size >> 24) & 0xff; + return index; +} diff --git a/node_modules/bson/src/parser/utils.ts b/node_modules/bson/src/parser/utils.ts new file mode 100644 index 000000000..2cd128add --- /dev/null +++ b/node_modules/bson/src/parser/utils.ts @@ -0,0 +1,123 @@ +import { Buffer } from 'buffer'; +import { getGlobal } from '../utils/global'; + +type RandomBytesFunction = (size: number) => Uint8Array; + +/** + * Normalizes our expected stringified form of a function across versions of node + * @param fn - The function to stringify + */ +export function normalizedFunctionString(fn: Function): string { + return fn.toString().replace('function(', 'function ('); +} + +function isReactNative() { + const g = getGlobal<{ navigator?: { product?: string } }>(); + return typeof g.navigator === 'object' && g.navigator.product === 'ReactNative'; +} + +const insecureRandomBytes: RandomBytesFunction = function insecureRandomBytes(size: number) { + const insecureWarning = isReactNative() + ? 'BSON: For React Native please polyfill crypto.getRandomValues, e.g. using: https://www.npmjs.com/package/react-native-get-random-values.' + : 'BSON: No cryptographic implementation for random bytes present, falling back to a less secure implementation.'; + console.warn(insecureWarning); + + const result = Buffer.alloc(size); + for (let i = 0; i < size; ++i) result[i] = Math.floor(Math.random() * 256); + return result; +}; + +/* We do not want to have to include DOM types just for this check */ +// eslint-disable-next-line @typescript-eslint/no-explicit-any +declare let window: any; +declare let require: Function; +// eslint-disable-next-line @typescript-eslint/no-explicit-any +declare let global: any; +declare const self: unknown; + +const detectRandomBytes = (): RandomBytesFunction => { + if (typeof window !== 'undefined') { + // browser crypto implementation(s) + const target = window.crypto || window.msCrypto; // allow for IE11 + if (target && target.getRandomValues) { + return size => target.getRandomValues(Buffer.alloc(size)); + } + } + + if (typeof global !== 'undefined' && global.crypto && global.crypto.getRandomValues) { + // allow for RN packages such as https://www.npmjs.com/package/react-native-get-random-values to populate global + return size => global.crypto.getRandomValues(Buffer.alloc(size)); + } + + let requiredRandomBytes: RandomBytesFunction | null | undefined; + try { + // eslint-disable-next-line @typescript-eslint/no-var-requires + requiredRandomBytes = require('crypto').randomBytes; + } catch (e) { + // keep the fallback + } + + // NOTE: in transpiled cases the above require might return null/undefined + + return requiredRandomBytes || insecureRandomBytes; +}; + +export const randomBytes = detectRandomBytes(); + +export function isAnyArrayBuffer(value: unknown): value is ArrayBuffer { + return ['[object ArrayBuffer]', '[object SharedArrayBuffer]'].includes( + Object.prototype.toString.call(value) + ); +} + +export function isUint8Array(value: unknown): value is Uint8Array { + return Object.prototype.toString.call(value) === '[object Uint8Array]'; +} + +export function isBigInt64Array(value: unknown): value is BigInt64Array { + return Object.prototype.toString.call(value) === '[object BigInt64Array]'; +} + +export function isBigUInt64Array(value: unknown): value is BigUint64Array { + return Object.prototype.toString.call(value) === '[object BigUint64Array]'; +} + +export function isRegExp(d: unknown): d is RegExp { + return Object.prototype.toString.call(d) === '[object RegExp]'; +} + +export function isMap(d: unknown): d is Map { + return Object.prototype.toString.call(d) === '[object Map]'; +} + +/** Call to check if your environment has `Buffer` */ +export function haveBuffer(): boolean { + return typeof global !== 'undefined' && typeof global.Buffer !== 'undefined'; +} + +// To ensure that 0.4 of node works correctly +export function isDate(d: unknown): d is Date { + return isObjectLike(d) && Object.prototype.toString.call(d) === '[object Date]'; +} + +/** + * @internal + * this is to solve the `'someKey' in x` problem where x is unknown. + * https://github.com/typescript-eslint/typescript-eslint/issues/1071#issuecomment-541955753 + */ +export function isObjectLike(candidate: unknown): candidate is Record { + return typeof candidate === 'object' && candidate !== null; +} + +declare let console: { warn(...message: unknown[]): void }; +export function deprecate(fn: T, message: string): T { + let warned = false; + function deprecated(this: unknown, ...args: unknown[]) { + if (!warned) { + console.warn(message); + warned = true; + } + return fn.apply(this, args); + } + return deprecated as unknown as T; +} diff --git a/node_modules/bson/src/regexp.ts b/node_modules/bson/src/regexp.ts new file mode 100644 index 000000000..efd56280a --- /dev/null +++ b/node_modules/bson/src/regexp.ts @@ -0,0 +1,105 @@ +import { BSONError, BSONTypeError } from './error'; +import type { EJSONOptions } from './extended_json'; + +function alphabetize(str: string): string { + return str.split('').sort().join(''); +} + +/** @public */ +export interface BSONRegExpExtendedLegacy { + $regex: string | BSONRegExp; + $options: string; +} + +/** @public */ +export interface BSONRegExpExtended { + $regularExpression: { + pattern: string; + options: string; + }; +} + +/** + * A class representation of the BSON RegExp type. + * @public + * @category BSONType + */ +export class BSONRegExp { + _bsontype!: 'BSONRegExp'; + + pattern!: string; + options!: string; + /** + * @param pattern - The regular expression pattern to match + * @param options - The regular expression options + */ + constructor(pattern: string, options?: string) { + if (!(this instanceof BSONRegExp)) return new BSONRegExp(pattern, options); + + this.pattern = pattern; + this.options = alphabetize(options ?? ''); + + if (this.pattern.indexOf('\x00') !== -1) { + throw new BSONError( + `BSON Regex patterns cannot contain null bytes, found: ${JSON.stringify(this.pattern)}` + ); + } + if (this.options.indexOf('\x00') !== -1) { + throw new BSONError( + `BSON Regex options cannot contain null bytes, found: ${JSON.stringify(this.options)}` + ); + } + + // Validate options + for (let i = 0; i < this.options.length; i++) { + if ( + !( + this.options[i] === 'i' || + this.options[i] === 'm' || + this.options[i] === 'x' || + this.options[i] === 'l' || + this.options[i] === 's' || + this.options[i] === 'u' + ) + ) { + throw new BSONError(`The regular expression option [${this.options[i]}] is not supported`); + } + } + } + + static parseOptions(options?: string): string { + return options ? options.split('').sort().join('') : ''; + } + + /** @internal */ + toExtendedJSON(options?: EJSONOptions): BSONRegExpExtendedLegacy | BSONRegExpExtended { + options = options || {}; + if (options.legacy) { + return { $regex: this.pattern, $options: this.options }; + } + return { $regularExpression: { pattern: this.pattern, options: this.options } }; + } + + /** @internal */ + static fromExtendedJSON(doc: BSONRegExpExtendedLegacy | BSONRegExpExtended): BSONRegExp { + if ('$regex' in doc) { + if (typeof doc.$regex !== 'string') { + // This is for $regex query operators that have extended json values. + if (doc.$regex._bsontype === 'BSONRegExp') { + return doc as unknown as BSONRegExp; + } + } else { + return new BSONRegExp(doc.$regex, BSONRegExp.parseOptions(doc.$options)); + } + } + if ('$regularExpression' in doc) { + return new BSONRegExp( + doc.$regularExpression.pattern, + BSONRegExp.parseOptions(doc.$regularExpression.options) + ); + } + throw new BSONTypeError(`Unexpected BSONRegExp EJSON object form: ${JSON.stringify(doc)}`); + } +} + +Object.defineProperty(BSONRegExp.prototype, '_bsontype', { value: 'BSONRegExp' }); diff --git a/node_modules/bson/src/symbol.ts b/node_modules/bson/src/symbol.ts new file mode 100644 index 000000000..1e82fc1c3 --- /dev/null +++ b/node_modules/bson/src/symbol.ts @@ -0,0 +1,58 @@ +/** @public */ +export interface BSONSymbolExtended { + $symbol: string; +} + +/** + * A class representation of the BSON Symbol type. + * @public + * @category BSONType + */ +export class BSONSymbol { + _bsontype!: 'Symbol'; + + value!: string; + /** + * @param value - the string representing the symbol. + */ + constructor(value: string) { + if (!(this instanceof BSONSymbol)) return new BSONSymbol(value); + + this.value = value; + } + + /** Access the wrapped string value. */ + valueOf(): string { + return this.value; + } + + toString(): string { + return this.value; + } + + /** @internal */ + inspect(): string { + return `new BSONSymbol("${this.value}")`; + } + + toJSON(): string { + return this.value; + } + + /** @internal */ + toExtendedJSON(): BSONSymbolExtended { + return { $symbol: this.value }; + } + + /** @internal */ + static fromExtendedJSON(doc: BSONSymbolExtended): BSONSymbol { + return new BSONSymbol(doc.$symbol); + } + + /** @internal */ + [Symbol.for('nodejs.util.inspect.custom')](): string { + return this.inspect(); + } +} + +Object.defineProperty(BSONSymbol.prototype, '_bsontype', { value: 'Symbol' }); diff --git a/node_modules/bson/src/timestamp.ts b/node_modules/bson/src/timestamp.ts new file mode 100644 index 000000000..651c5cf49 --- /dev/null +++ b/node_modules/bson/src/timestamp.ts @@ -0,0 +1,119 @@ +import { Long } from './long'; +import { isObjectLike } from './parser/utils'; + +/** @public */ +export type TimestampOverrides = '_bsontype' | 'toExtendedJSON' | 'fromExtendedJSON' | 'inspect'; +/** @public */ +export type LongWithoutOverrides = new (low: unknown, high?: number, unsigned?: boolean) => { + [P in Exclude]: Long[P]; +}; +/** @public */ +export const LongWithoutOverridesClass: LongWithoutOverrides = + Long as unknown as LongWithoutOverrides; + +/** @public */ +export interface TimestampExtended { + $timestamp: { + t: number; + i: number; + }; +} + +/** + * @public + * @category BSONType + * */ +export class Timestamp extends LongWithoutOverridesClass { + _bsontype!: 'Timestamp'; + + static readonly MAX_VALUE = Long.MAX_UNSIGNED_VALUE; + + /** + * @param low - A 64-bit Long representing the Timestamp. + */ + constructor(long: Long); + /** + * @param value - A pair of two values indicating timestamp and increment. + */ + constructor(value: { t: number; i: number }); + /** + * @param low - the low (signed) 32 bits of the Timestamp. + * @param high - the high (signed) 32 bits of the Timestamp. + * @deprecated Please use `Timestamp({ t: high, i: low })` or `Timestamp(Long(low, high))` instead. + */ + constructor(low: number, high: number); + constructor(low: number | Long | { t: number; i: number }, high?: number) { + // eslint-disable-next-line @typescript-eslint/ban-ts-comment + ///@ts-expect-error + if (!(this instanceof Timestamp)) return new Timestamp(low, high); + + if (Long.isLong(low)) { + super(low.low, low.high, true); + } else if (isObjectLike(low) && typeof low.t !== 'undefined' && typeof low.i !== 'undefined') { + super(low.i, low.t, true); + } else { + super(low, high, true); + } + Object.defineProperty(this, '_bsontype', { + value: 'Timestamp', + writable: false, + configurable: false, + enumerable: false + }); + } + + toJSON(): { $timestamp: string } { + return { + $timestamp: this.toString() + }; + } + + /** Returns a Timestamp represented by the given (32-bit) integer value. */ + static fromInt(value: number): Timestamp { + return new Timestamp(Long.fromInt(value, true)); + } + + /** Returns a Timestamp representing the given number value, provided that it is a finite number. Otherwise, zero is returned. */ + static fromNumber(value: number): Timestamp { + return new Timestamp(Long.fromNumber(value, true)); + } + + /** + * Returns a Timestamp for the given high and low bits. Each is assumed to use 32 bits. + * + * @param lowBits - the low 32-bits. + * @param highBits - the high 32-bits. + */ + static fromBits(lowBits: number, highBits: number): Timestamp { + return new Timestamp(lowBits, highBits); + } + + /** + * Returns a Timestamp from the given string, optionally using the given radix. + * + * @param str - the textual representation of the Timestamp. + * @param optRadix - the radix in which the text is written. + */ + static fromString(str: string, optRadix: number): Timestamp { + return new Timestamp(Long.fromString(str, true, optRadix)); + } + + /** @internal */ + toExtendedJSON(): TimestampExtended { + return { $timestamp: { t: this.high >>> 0, i: this.low >>> 0 } }; + } + + /** @internal */ + static fromExtendedJSON(doc: TimestampExtended): Timestamp { + return new Timestamp(doc.$timestamp); + } + + /** @internal */ + [Symbol.for('nodejs.util.inspect.custom')](): string { + return this.inspect(); + } + + inspect(): string { + return `new Timestamp({ t: ${this.getHighBits()}, i: ${this.getLowBits()} })`; + } +} diff --git a/node_modules/bson/src/utils/global.ts b/node_modules/bson/src/utils/global.ts new file mode 100644 index 000000000..8b18e8512 --- /dev/null +++ b/node_modules/bson/src/utils/global.ts @@ -0,0 +1,22 @@ +/* eslint-disable @typescript-eslint/no-explicit-any */ +/* We do not want to have to include DOM types just for this check */ +declare const window: unknown; +declare const self: unknown; +declare const global: unknown; + +function checkForMath(potentialGlobal: any) { + // eslint-disable-next-line eqeqeq + return potentialGlobal && potentialGlobal.Math == Math && potentialGlobal; +} + +// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028 +export function getGlobal>(): T { + // eslint-disable-next-line no-undef + return ( + checkForMath(typeof globalThis === 'object' && globalThis) || + checkForMath(typeof window === 'object' && window) || + checkForMath(typeof self === 'object' && self) || + checkForMath(typeof global === 'object' && global) || + Function('return this')() + ); +} diff --git a/node_modules/bson/src/uuid.ts b/node_modules/bson/src/uuid.ts new file mode 100644 index 000000000..596baf3d4 --- /dev/null +++ b/node_modules/bson/src/uuid.ts @@ -0,0 +1,209 @@ +import { Buffer } from 'buffer'; +import { ensureBuffer } from './ensure_buffer'; +import { Binary } from './binary'; +import { bufferToUuidHexString, uuidHexStringToBuffer, uuidValidateString } from './uuid_utils'; +import { isUint8Array, randomBytes } from './parser/utils'; +import { BSONTypeError } from './error'; + +/** @public */ +export type UUIDExtended = { + $uuid: string; +}; + +const BYTE_LENGTH = 16; + +const kId = Symbol('id'); + +/** + * A class representation of the BSON UUID type. + * @public + */ +export class UUID { + // This property is not meant for direct serialization, but simply an indication that this type originates from this package. + _bsontype!: 'UUID'; + + static cacheHexString: boolean; + + /** UUID Bytes @internal */ + private [kId]: Buffer; + /** UUID hexString cache @internal */ + private __id?: string; + + /** + * Create an UUID type + * + * @param input - Can be a 32 or 36 character hex string (dashes excluded/included) or a 16 byte binary Buffer. + */ + constructor(input?: string | Buffer | UUID) { + if (typeof input === 'undefined') { + // The most common use case (blank id, new UUID() instance) + this.id = UUID.generate(); + } else if (input instanceof UUID) { + this[kId] = Buffer.from(input.id); + this.__id = input.__id; + } else if (ArrayBuffer.isView(input) && input.byteLength === BYTE_LENGTH) { + this.id = ensureBuffer(input); + } else if (typeof input === 'string') { + this.id = uuidHexStringToBuffer(input); + } else { + throw new BSONTypeError( + 'Argument passed in UUID constructor must be a UUID, a 16 byte Buffer or a 32/36 character hex string (dashes excluded/included, format: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx).' + ); + } + } + + /** + * The UUID bytes + * @readonly + */ + get id(): Buffer { + return this[kId]; + } + + set id(value: Buffer) { + this[kId] = value; + + if (UUID.cacheHexString) { + this.__id = bufferToUuidHexString(value); + } + } + + /** + * Generate a 16 byte uuid v4 buffer used in UUIDs + */ + + /** + * Returns the UUID id as a 32 or 36 character hex string representation, excluding/including dashes (defaults to 36 character dash separated) + * @param includeDashes - should the string exclude dash-separators. + * */ + toHexString(includeDashes = true): string { + if (UUID.cacheHexString && this.__id) { + return this.__id; + } + + const uuidHexString = bufferToUuidHexString(this.id, includeDashes); + + if (UUID.cacheHexString) { + this.__id = uuidHexString; + } + + return uuidHexString; + } + + /** + * Converts the id into a 36 character (dashes included) hex string, unless a encoding is specified. + */ + toString(encoding?: string): string { + return encoding ? this.id.toString(encoding) : this.toHexString(); + } + + /** + * Converts the id into its JSON string representation. + * A 36 character (dashes included) hex string in the format: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx + */ + toJSON(): string { + return this.toHexString(); + } + + /** + * Compares the equality of this UUID with `otherID`. + * + * @param otherId - UUID instance to compare against. + */ + equals(otherId: string | Buffer | UUID): boolean { + if (!otherId) { + return false; + } + + if (otherId instanceof UUID) { + return otherId.id.equals(this.id); + } + + try { + return new UUID(otherId).id.equals(this.id); + } catch { + return false; + } + } + + /** + * Creates a Binary instance from the current UUID. + */ + toBinary(): Binary { + return new Binary(this.id, Binary.SUBTYPE_UUID); + } + + /** + * Generates a populated buffer containing a v4 uuid + */ + static generate(): Buffer { + const bytes = randomBytes(BYTE_LENGTH); + + // Per 4.4, set bits for version and `clock_seq_hi_and_reserved` + // Kindly borrowed from https://github.com/uuidjs/uuid/blob/master/src/v4.js + bytes[6] = (bytes[6] & 0x0f) | 0x40; + bytes[8] = (bytes[8] & 0x3f) | 0x80; + + return Buffer.from(bytes); + } + + /** + * Checks if a value is a valid bson UUID + * @param input - UUID, string or Buffer to validate. + */ + static isValid(input: string | Buffer | UUID): boolean { + if (!input) { + return false; + } + + if (input instanceof UUID) { + return true; + } + + if (typeof input === 'string') { + return uuidValidateString(input); + } + + if (isUint8Array(input)) { + // check for length & uuid version (https://tools.ietf.org/html/rfc4122#section-4.1.3) + if (input.length !== BYTE_LENGTH) { + return false; + } + + try { + // get this byte as hex: xxxxxxxx-xxxx-XXxx-xxxx-xxxxxxxxxxxx + // check first part as uuid version: xxxxxxxx-xxxx-Xxxx-xxxx-xxxxxxxxxxxx + return parseInt(input[6].toString(16)[0], 10) === Binary.SUBTYPE_UUID; + } catch { + return false; + } + } + + return false; + } + + /** + * Creates an UUID from a hex string representation of an UUID. + * @param hexString - 32 or 36 character hex string (dashes excluded/included). + */ + static createFromHexString(hexString: string): UUID { + const buffer = uuidHexStringToBuffer(hexString); + return new UUID(buffer); + } + + /** + * Converts to a string representation of this Id. + * + * @returns return the 36 character hex string representation. + * @internal + */ + [Symbol.for('nodejs.util.inspect.custom')](): string { + return this.inspect(); + } + + inspect(): string { + return `new UUID("${this.toHexString()}")`; + } +} + +Object.defineProperty(UUID.prototype, '_bsontype', { value: 'UUID' }); diff --git a/node_modules/bson/src/uuid_utils.ts b/node_modules/bson/src/uuid_utils.ts new file mode 100644 index 000000000..f37b06592 --- /dev/null +++ b/node_modules/bson/src/uuid_utils.ts @@ -0,0 +1,33 @@ +import { Buffer } from 'buffer'; +import { BSONTypeError } from './error'; + +// Validation regex for v4 uuid (validates with or without dashes) +const VALIDATION_REGEX = + /^(?:[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|[0-9a-f]{12}4[0-9a-f]{3}[89ab][0-9a-f]{15})$/i; + +export const uuidValidateString = (str: string): boolean => + typeof str === 'string' && VALIDATION_REGEX.test(str); + +export const uuidHexStringToBuffer = (hexString: string): Buffer => { + if (!uuidValidateString(hexString)) { + throw new BSONTypeError( + 'UUID string representations must be a 32 or 36 character hex string (dashes excluded/included). Format: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" or "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx".' + ); + } + + const sanitizedHexString = hexString.replace(/-/g, ''); + return Buffer.from(sanitizedHexString, 'hex'); +}; + +export const bufferToUuidHexString = (buffer: Buffer, includeDashes = true): string => + includeDashes + ? buffer.toString('hex', 0, 4) + + '-' + + buffer.toString('hex', 4, 6) + + '-' + + buffer.toString('hex', 6, 8) + + '-' + + buffer.toString('hex', 8, 10) + + '-' + + buffer.toString('hex', 10, 16) + : buffer.toString('hex'); diff --git a/node_modules/bson/src/validate_utf8.ts b/node_modules/bson/src/validate_utf8.ts new file mode 100644 index 000000000..e1da934c6 --- /dev/null +++ b/node_modules/bson/src/validate_utf8.ts @@ -0,0 +1,47 @@ +const FIRST_BIT = 0x80; +const FIRST_TWO_BITS = 0xc0; +const FIRST_THREE_BITS = 0xe0; +const FIRST_FOUR_BITS = 0xf0; +const FIRST_FIVE_BITS = 0xf8; + +const TWO_BIT_CHAR = 0xc0; +const THREE_BIT_CHAR = 0xe0; +const FOUR_BIT_CHAR = 0xf0; +const CONTINUING_CHAR = 0x80; + +/** + * Determines if the passed in bytes are valid utf8 + * @param bytes - An array of 8-bit bytes. Must be indexable and have length property + * @param start - The index to start validating + * @param end - The index to end validating + */ +export function validateUtf8( + bytes: { [index: number]: number }, + start: number, + end: number +): boolean { + let continuation = 0; + + for (let i = start; i < end; i += 1) { + const byte = bytes[i]; + + if (continuation) { + if ((byte & FIRST_TWO_BITS) !== CONTINUING_CHAR) { + return false; + } + continuation -= 1; + } else if (byte & FIRST_BIT) { + if ((byte & FIRST_THREE_BITS) === TWO_BIT_CHAR) { + continuation = 1; + } else if ((byte & FIRST_FOUR_BITS) === THREE_BIT_CHAR) { + continuation = 2; + } else if ((byte & FIRST_FIVE_BITS) === FOUR_BIT_CHAR) { + continuation = 3; + } else { + return false; + } + } + } + + return !continuation; +} diff --git a/node_modules/cookie/HISTORY.md b/node_modules/cookie/HISTORY.md new file mode 100644 index 000000000..2d21760ef --- /dev/null +++ b/node_modules/cookie/HISTORY.md @@ -0,0 +1,134 @@ +0.4.2 / 2022-02-02 +================== + + * pref: read value only when assigning in parse + * pref: remove unnecessary regexp in parse + +0.4.1 / 2020-04-21 +================== + + * Fix `maxAge` option to reject invalid values + +0.4.0 / 2019-05-15 +================== + + * Add `SameSite=None` support + +0.3.1 / 2016-05-26 +================== + + * Fix `sameSite: true` to work with draft-7 clients + - `true` now sends `SameSite=Strict` instead of `SameSite` + +0.3.0 / 2016-05-26 +================== + + * Add `sameSite` option + - Replaces `firstPartyOnly` option, never implemented by browsers + * Improve error message when `encode` is not a function + * Improve error message when `expires` is not a `Date` + +0.2.4 / 2016-05-20 +================== + + * perf: enable strict mode + * perf: use for loop in parse + * perf: use string concatination for serialization + +0.2.3 / 2015-10-25 +================== + + * Fix cookie `Max-Age` to never be a floating point number + +0.2.2 / 2015-09-17 +================== + + * Fix regression when setting empty cookie value + - Ease the new restriction, which is just basic header-level validation + * Fix typo in invalid value errors + +0.2.1 / 2015-09-17 +================== + + * Throw on invalid values provided to `serialize` + - Ensures the resulting string is a valid HTTP header value + +0.2.0 / 2015-08-13 +================== + + * Add `firstPartyOnly` option + * Throw better error for invalid argument to parse + * perf: hoist regular expression + +0.1.5 / 2015-09-17 +================== + + * Fix regression when setting empty cookie value + - Ease the new restriction, which is just basic header-level validation + * Fix typo in invalid value errors + +0.1.4 / 2015-09-17 +================== + + * Throw better error for invalid argument to parse + * Throw on invalid values provided to `serialize` + - Ensures the resulting string is a valid HTTP header value + +0.1.3 / 2015-05-19 +================== + + * Reduce the scope of try-catch deopt + * Remove argument reassignments + +0.1.2 / 2014-04-16 +================== + + * Remove unnecessary files from npm package + +0.1.1 / 2014-02-23 +================== + + * Fix bad parse when cookie value contained a comma + * Fix support for `maxAge` of `0` + +0.1.0 / 2013-05-01 +================== + + * Add `decode` option + * Add `encode` option + +0.0.6 / 2013-04-08 +================== + + * Ignore cookie parts missing `=` + +0.0.5 / 2012-10-29 +================== + + * Return raw cookie value if value unescape errors + +0.0.4 / 2012-06-21 +================== + + * Use encode/decodeURIComponent for cookie encoding/decoding + - Improve server/client interoperability + +0.0.3 / 2012-06-06 +================== + + * Only escape special characters per the cookie RFC + +0.0.2 / 2012-06-01 +================== + + * Fix `maxAge` option to not throw error + +0.0.1 / 2012-05-28 +================== + + * Add more tests + +0.0.0 / 2012-05-28 +================== + + * Initial release diff --git a/node_modules/cookie/LICENSE b/node_modules/cookie/LICENSE new file mode 100644 index 000000000..058b6b4ef --- /dev/null +++ b/node_modules/cookie/LICENSE @@ -0,0 +1,24 @@ +(The MIT License) + +Copyright (c) 2012-2014 Roman Shtylman +Copyright (c) 2015 Douglas Christopher Wilson + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + diff --git a/node_modules/cookie/README.md b/node_modules/cookie/README.md new file mode 100644 index 000000000..e275c705b --- /dev/null +++ b/node_modules/cookie/README.md @@ -0,0 +1,286 @@ +# cookie + +[![NPM Version][npm-version-image]][npm-url] +[![NPM Downloads][npm-downloads-image]][npm-url] +[![Node.js Version][node-version-image]][node-version-url] +[![Build Status][github-actions-ci-image]][github-actions-ci-url] +[![Test Coverage][coveralls-image]][coveralls-url] + +Basic HTTP cookie parser and serializer for HTTP servers. + +## Installation + +This is a [Node.js](https://nodejs.org/en/) module available through the +[npm registry](https://www.npmjs.com/). Installation is done using the +[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally): + +```sh +$ npm install cookie +``` + +## API + +```js +var cookie = require('cookie'); +``` + +### cookie.parse(str, options) + +Parse an HTTP `Cookie` header string and returning an object of all cookie name-value pairs. +The `str` argument is the string representing a `Cookie` header value and `options` is an +optional object containing additional parsing options. + +```js +var cookies = cookie.parse('foo=bar; equation=E%3Dmc%5E2'); +// { foo: 'bar', equation: 'E=mc^2' } +``` + +#### Options + +`cookie.parse` accepts these properties in the options object. + +##### decode + +Specifies a function that will be used to decode a cookie's value. Since the value of a cookie +has a limited character set (and must be a simple string), this function can be used to decode +a previously-encoded cookie value into a JavaScript string or other object. + +The default function is the global `decodeURIComponent`, which will decode any URL-encoded +sequences into their byte representations. + +**note** if an error is thrown from this function, the original, non-decoded cookie value will +be returned as the cookie's value. + +### cookie.serialize(name, value, options) + +Serialize a cookie name-value pair into a `Set-Cookie` header string. The `name` argument is the +name for the cookie, the `value` argument is the value to set the cookie to, and the `options` +argument is an optional object containing additional serialization options. + +```js +var setCookie = cookie.serialize('foo', 'bar'); +// foo=bar +``` + +#### Options + +`cookie.serialize` accepts these properties in the options object. + +##### domain + +Specifies the value for the [`Domain` `Set-Cookie` attribute][rfc-6265-5.2.3]. By default, no +domain is set, and most clients will consider the cookie to apply to only the current domain. + +##### encode + +Specifies a function that will be used to encode a cookie's value. Since value of a cookie +has a limited character set (and must be a simple string), this function can be used to encode +a value into a string suited for a cookie's value. + +The default function is the global `encodeURIComponent`, which will encode a JavaScript string +into UTF-8 byte sequences and then URL-encode any that fall outside of the cookie range. + +##### expires + +Specifies the `Date` object to be the value for the [`Expires` `Set-Cookie` attribute][rfc-6265-5.2.1]. +By default, no expiration is set, and most clients will consider this a "non-persistent cookie" and +will delete it on a condition like exiting a web browser application. + +**note** the [cookie storage model specification][rfc-6265-5.3] states that if both `expires` and +`maxAge` are set, then `maxAge` takes precedence, but it is possible not all clients by obey this, +so if both are set, they should point to the same date and time. + +##### httpOnly + +Specifies the `boolean` value for the [`HttpOnly` `Set-Cookie` attribute][rfc-6265-5.2.6]. When truthy, +the `HttpOnly` attribute is set, otherwise it is not. By default, the `HttpOnly` attribute is not set. + +**note** be careful when setting this to `true`, as compliant clients will not allow client-side +JavaScript to see the cookie in `document.cookie`. + +##### maxAge + +Specifies the `number` (in seconds) to be the value for the [`Max-Age` `Set-Cookie` attribute][rfc-6265-5.2.2]. +The given number will be converted to an integer by rounding down. By default, no maximum age is set. + +**note** the [cookie storage model specification][rfc-6265-5.3] states that if both `expires` and +`maxAge` are set, then `maxAge` takes precedence, but it is possible not all clients by obey this, +so if both are set, they should point to the same date and time. + +##### path + +Specifies the value for the [`Path` `Set-Cookie` attribute][rfc-6265-5.2.4]. By default, the path +is considered the ["default path"][rfc-6265-5.1.4]. + +##### sameSite + +Specifies the `boolean` or `string` to be the value for the [`SameSite` `Set-Cookie` attribute][rfc-6265bis-03-4.1.2.7]. + + - `true` will set the `SameSite` attribute to `Strict` for strict same site enforcement. + - `false` will not set the `SameSite` attribute. + - `'lax'` will set the `SameSite` attribute to `Lax` for lax same site enforcement. + - `'none'` will set the `SameSite` attribute to `None` for an explicit cross-site cookie. + - `'strict'` will set the `SameSite` attribute to `Strict` for strict same site enforcement. + +More information about the different enforcement levels can be found in +[the specification][rfc-6265bis-03-4.1.2.7]. + +**note** This is an attribute that has not yet been fully standardized, and may change in the future. +This also means many clients may ignore this attribute until they understand it. + +##### secure + +Specifies the `boolean` value for the [`Secure` `Set-Cookie` attribute][rfc-6265-5.2.5]. When truthy, +the `Secure` attribute is set, otherwise it is not. By default, the `Secure` attribute is not set. + +**note** be careful when setting this to `true`, as compliant clients will not send the cookie back to +the server in the future if the browser does not have an HTTPS connection. + +## Example + +The following example uses this module in conjunction with the Node.js core HTTP server +to prompt a user for their name and display it back on future visits. + +```js +var cookie = require('cookie'); +var escapeHtml = require('escape-html'); +var http = require('http'); +var url = require('url'); + +function onRequest(req, res) { + // Parse the query string + var query = url.parse(req.url, true, true).query; + + if (query && query.name) { + // Set a new cookie with the name + res.setHeader('Set-Cookie', cookie.serialize('name', String(query.name), { + httpOnly: true, + maxAge: 60 * 60 * 24 * 7 // 1 week + })); + + // Redirect back after setting cookie + res.statusCode = 302; + res.setHeader('Location', req.headers.referer || '/'); + res.end(); + return; + } + + // Parse the cookies on the request + var cookies = cookie.parse(req.headers.cookie || ''); + + // Get the visitor name set in the cookie + var name = cookies.name; + + res.setHeader('Content-Type', 'text/html; charset=UTF-8'); + + if (name) { + res.write('

Welcome back, ' + escapeHtml(name) + '!

'); + } else { + res.write('

Hello, new visitor!

'); + } + + res.write('
'); + res.write(' '); + res.end('
'); +} + +http.createServer(onRequest).listen(3000); +``` + +## Testing + +```sh +$ npm test +``` + +## Benchmark + +``` +$ npm run bench + +> cookie@0.4.1 bench +> node benchmark/index.js + + node@16.13.1 + v8@9.4.146.24-node.14 + uv@1.42.0 + zlib@1.2.11 + brotli@1.0.9 + ares@1.18.1 + modules@93 + nghttp2@1.45.1 + napi@8 + llhttp@6.0.4 + openssl@1.1.1l+quic + cldr@39.0 + icu@69.1 + tz@2021a + unicode@13.0 + ngtcp2@0.1.0-DEV + nghttp3@0.1.0-DEV + +> node benchmark/parse-top.js + + cookie.parse - top sites + + 15 tests completed. + + parse accounts.google.com x 504,358 ops/sec ±6.55% (171 runs sampled) + parse apple.com x 1,369,991 ops/sec ±0.84% (189 runs sampled) + parse cloudflare.com x 360,669 ops/sec ±3.75% (182 runs sampled) + parse docs.google.com x 521,496 ops/sec ±4.90% (180 runs sampled) + parse drive.google.com x 553,514 ops/sec ±0.59% (189 runs sampled) + parse en.wikipedia.org x 286,052 ops/sec ±0.62% (188 runs sampled) + parse linkedin.com x 178,817 ops/sec ±0.61% (192 runs sampled) + parse maps.google.com x 284,585 ops/sec ±0.68% (188 runs sampled) + parse microsoft.com x 161,230 ops/sec ±0.56% (192 runs sampled) + parse play.google.com x 352,144 ops/sec ±1.01% (181 runs sampled) + parse plus.google.com x 275,204 ops/sec ±7.78% (156 runs sampled) + parse support.google.com x 339,493 ops/sec ±1.02% (191 runs sampled) + parse www.google.com x 286,110 ops/sec ±0.90% (191 runs sampled) + parse youtu.be x 548,557 ops/sec ±0.60% (184 runs sampled) + parse youtube.com x 545,293 ops/sec ±0.65% (191 runs sampled) + +> node benchmark/parse.js + + cookie.parse - generic + + 6 tests completed. + + simple x 1,266,646 ops/sec ±0.65% (191 runs sampled) + decode x 838,413 ops/sec ±0.60% (191 runs sampled) + unquote x 877,820 ops/sec ±0.72% (189 runs sampled) + duplicates x 516,680 ops/sec ±0.61% (191 runs sampled) + 10 cookies x 156,874 ops/sec ±0.52% (189 runs sampled) + 100 cookies x 14,663 ops/sec ±0.53% (191 runs sampled) +``` + +## References + +- [RFC 6265: HTTP State Management Mechanism][rfc-6265] +- [Same-site Cookies][rfc-6265bis-03-4.1.2.7] + +[rfc-6265bis-03-4.1.2.7]: https://tools.ietf.org/html/draft-ietf-httpbis-rfc6265bis-03#section-4.1.2.7 +[rfc-6265]: https://tools.ietf.org/html/rfc6265 +[rfc-6265-5.1.4]: https://tools.ietf.org/html/rfc6265#section-5.1.4 +[rfc-6265-5.2.1]: https://tools.ietf.org/html/rfc6265#section-5.2.1 +[rfc-6265-5.2.2]: https://tools.ietf.org/html/rfc6265#section-5.2.2 +[rfc-6265-5.2.3]: https://tools.ietf.org/html/rfc6265#section-5.2.3 +[rfc-6265-5.2.4]: https://tools.ietf.org/html/rfc6265#section-5.2.4 +[rfc-6265-5.2.5]: https://tools.ietf.org/html/rfc6265#section-5.2.5 +[rfc-6265-5.2.6]: https://tools.ietf.org/html/rfc6265#section-5.2.6 +[rfc-6265-5.3]: https://tools.ietf.org/html/rfc6265#section-5.3 + +## License + +[MIT](LICENSE) + +[coveralls-image]: https://badgen.net/coveralls/c/github/jshttp/cookie/master +[coveralls-url]: https://coveralls.io/r/jshttp/cookie?branch=master +[github-actions-ci-image]: https://img.shields.io/github/workflow/status/jshttp/cookie/ci/master?label=ci +[github-actions-ci-url]: https://github.com/jshttp/cookie/actions/workflows/ci.yml +[node-version-image]: https://badgen.net/npm/node/cookie +[node-version-url]: https://nodejs.org/en/download +[npm-downloads-image]: https://badgen.net/npm/dm/cookie +[npm-url]: https://npmjs.org/package/cookie +[npm-version-image]: https://badgen.net/npm/v/cookie diff --git a/node_modules/cookie/index.js b/node_modules/cookie/index.js new file mode 100644 index 000000000..55331d9a6 --- /dev/null +++ b/node_modules/cookie/index.js @@ -0,0 +1,202 @@ +/*! + * cookie + * Copyright(c) 2012-2014 Roman Shtylman + * Copyright(c) 2015 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict'; + +/** + * Module exports. + * @public + */ + +exports.parse = parse; +exports.serialize = serialize; + +/** + * Module variables. + * @private + */ + +var decode = decodeURIComponent; +var encode = encodeURIComponent; + +/** + * RegExp to match field-content in RFC 7230 sec 3.2 + * + * field-content = field-vchar [ 1*( SP / HTAB ) field-vchar ] + * field-vchar = VCHAR / obs-text + * obs-text = %x80-FF + */ + +var fieldContentRegExp = /^[\u0009\u0020-\u007e\u0080-\u00ff]+$/; + +/** + * Parse a cookie header. + * + * Parse the given cookie header string into an object + * The object has the various cookies as keys(names) => values + * + * @param {string} str + * @param {object} [options] + * @return {object} + * @public + */ + +function parse(str, options) { + if (typeof str !== 'string') { + throw new TypeError('argument str must be a string'); + } + + var obj = {} + var opt = options || {}; + var pairs = str.split(';') + var dec = opt.decode || decode; + + for (var i = 0; i < pairs.length; i++) { + var pair = pairs[i]; + var index = pair.indexOf('=') + + // skip things that don't look like key=value + if (index < 0) { + continue; + } + + var key = pair.substring(0, index).trim() + + // only assign once + if (undefined == obj[key]) { + var val = pair.substring(index + 1, pair.length).trim() + + // quoted values + if (val[0] === '"') { + val = val.slice(1, -1) + } + + obj[key] = tryDecode(val, dec); + } + } + + return obj; +} + +/** + * Serialize data into a cookie header. + * + * Serialize the a name value pair into a cookie string suitable for + * http headers. An optional options object specified cookie parameters. + * + * serialize('foo', 'bar', { httpOnly: true }) + * => "foo=bar; httpOnly" + * + * @param {string} name + * @param {string} val + * @param {object} [options] + * @return {string} + * @public + */ + +function serialize(name, val, options) { + var opt = options || {}; + var enc = opt.encode || encode; + + if (typeof enc !== 'function') { + throw new TypeError('option encode is invalid'); + } + + if (!fieldContentRegExp.test(name)) { + throw new TypeError('argument name is invalid'); + } + + var value = enc(val); + + if (value && !fieldContentRegExp.test(value)) { + throw new TypeError('argument val is invalid'); + } + + var str = name + '=' + value; + + if (null != opt.maxAge) { + var maxAge = opt.maxAge - 0; + + if (isNaN(maxAge) || !isFinite(maxAge)) { + throw new TypeError('option maxAge is invalid') + } + + str += '; Max-Age=' + Math.floor(maxAge); + } + + if (opt.domain) { + if (!fieldContentRegExp.test(opt.domain)) { + throw new TypeError('option domain is invalid'); + } + + str += '; Domain=' + opt.domain; + } + + if (opt.path) { + if (!fieldContentRegExp.test(opt.path)) { + throw new TypeError('option path is invalid'); + } + + str += '; Path=' + opt.path; + } + + if (opt.expires) { + if (typeof opt.expires.toUTCString !== 'function') { + throw new TypeError('option expires is invalid'); + } + + str += '; Expires=' + opt.expires.toUTCString(); + } + + if (opt.httpOnly) { + str += '; HttpOnly'; + } + + if (opt.secure) { + str += '; Secure'; + } + + if (opt.sameSite) { + var sameSite = typeof opt.sameSite === 'string' + ? opt.sameSite.toLowerCase() : opt.sameSite; + + switch (sameSite) { + case true: + str += '; SameSite=Strict'; + break; + case 'lax': + str += '; SameSite=Lax'; + break; + case 'strict': + str += '; SameSite=Strict'; + break; + case 'none': + str += '; SameSite=None'; + break; + default: + throw new TypeError('option sameSite is invalid'); + } + } + + return str; +} + +/** + * Try decoding a string using a decoding function. + * + * @param {string} str + * @param {function} decode + * @private + */ + +function tryDecode(str, decode) { + try { + return decode(str); + } catch (e) { + return str; + } +} diff --git a/node_modules/cookie/package.json b/node_modules/cookie/package.json new file mode 100644 index 000000000..cd40d0d1a --- /dev/null +++ b/node_modules/cookie/package.json @@ -0,0 +1,42 @@ +{ + "name": "cookie", + "description": "HTTP server cookie parsing and serialization", + "version": "0.4.2", + "author": "Roman Shtylman ", + "contributors": [ + "Douglas Christopher Wilson " + ], + "license": "MIT", + "keywords": [ + "cookie", + "cookies" + ], + "repository": "jshttp/cookie", + "devDependencies": { + "beautify-benchmark": "0.2.4", + "benchmark": "2.1.4", + "eslint": "7.32.0", + "eslint-plugin-markdown": "2.2.1", + "mocha": "9.2.0", + "nyc": "15.1.0", + "top-sites": "1.1.85" + }, + "files": [ + "HISTORY.md", + "LICENSE", + "README.md", + "index.js" + ], + "engines": { + "node": ">= 0.6" + }, + "scripts": { + "bench": "node benchmark/index.js", + "lint": "eslint .", + "test": "mocha --reporter spec --bail --check-leaks --ui qunit test/", + "test-ci": "nyc --reporter=lcov --reporter=text npm test", + "test-cov": "nyc --reporter=html --reporter=text npm test", + "update-bench": "node scripts/update-benchmark.js", + "version": "node scripts/version-history.js && git add HISTORY.md" + } +} diff --git a/node_modules/denque/CHANGELOG.md b/node_modules/denque/CHANGELOG.md new file mode 100644 index 000000000..0577ebc6e --- /dev/null +++ b/node_modules/denque/CHANGELOG.md @@ -0,0 +1,22 @@ +## 2.0.1 + + - fix(types): incorrect return type on `size()` + +## 2.0.0 + + - fix!: `push` & `unshift` now accept `undefined` values to match behaviour of `Array` (fixes #25) (#35) + - This is only a **BREAKING** change if you are currently expecting `push(undefined)` and `unshift(undefined)` to do + nothing - the new behaviour now correctly adds undefined values to the queue. + - **Note**: behaviour of `push()` & `unshift()` (no arguments) remains unchanged (nothing gets added to the queue). + - **Note**: If you need to differentiate between `undefined` values in the queue and the return value of `pop()` then + check the queue `.length` before popping. + - fix: incorrect methods in types definition file + +## 1.5.1 + + - perf: minor performance tweak when growing queue size (#29) + +## 1.5.0 + + - feat: adds capacity option for circular buffers (#27) + diff --git a/node_modules/denque/LICENSE b/node_modules/denque/LICENSE new file mode 100644 index 000000000..c9cde9201 --- /dev/null +++ b/node_modules/denque/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2018-present Invertase Limited + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/node_modules/denque/README.md b/node_modules/denque/README.md new file mode 100644 index 000000000..3c645d39c --- /dev/null +++ b/node_modules/denque/README.md @@ -0,0 +1,77 @@ +

+

Denque

+

+ +

+ NPM downloads + NPM version + Tests status + Coverage + License + Follow on Twitter +

+ +Denque is a well tested, extremely fast and lightweight [double-ended queue](http://en.wikipedia.org/wiki/Double-ended_queue) +implementation with zero dependencies and includes TypeScript types. + +Double-ended queues can also be used as a: + +- [Stack](http://en.wikipedia.org/wiki/Stack_\(abstract_data_type\)) +- [Queue](http://en.wikipedia.org/wiki/Queue_\(data_structure\)) + +This implementation is currently the fastest available, even faster than `double-ended-queue`, see the [benchmarks](https://docs.page/invertase/denque/benchmarks). + +Every queue operation is done at a constant `O(1)` - including random access from `.peekAt(index)`. + +**Works on all node versions >= v0.10** + +## Quick Start + +Install the package: + +```bash +npm install denque +``` + +Create and consume a queue: + +```js +const Denque = require("denque"); + +const denque = new Denque([1,2,3,4]); +denque.shift(); // 1 +denque.pop(); // 4 +``` + + +See the [API reference documentation](https://docs.page/invertase/denque/api) for more examples. + +--- + +## Who's using it? + +- [Kafka Node.js client](https://www.npmjs.com/package/kafka-node) +- [MariaDB Node.js client](https://www.npmjs.com/package/mariadb) +- [MongoDB Node.js client](https://www.npmjs.com/package/mongodb) +- [MySQL Node.js client](https://www.npmjs.com/package/mysql2) +- [Redis Node.js clients](https://www.npmjs.com/package/redis) + +... and [many more](https://www.npmjs.com/browse/depended/denque). + + +--- + +## License + +- See [LICENSE](/LICENSE) + +--- + +

+ + + +

+ Built and maintained by Invertase. +

+

diff --git a/node_modules/denque/index.d.ts b/node_modules/denque/index.d.ts new file mode 100644 index 000000000..e125dd471 --- /dev/null +++ b/node_modules/denque/index.d.ts @@ -0,0 +1,47 @@ +declare class Denque { + length: number; + + constructor(); + + constructor(array: T[]); + + constructor(array: T[], options: IDenqueOptions); + + push(item: T): number; + + unshift(item: T): number; + + pop(): T | undefined; + + shift(): T | undefined; + + peekBack(): T | undefined; + + peekFront(): T | undefined; + + peekAt(index: number): T | undefined; + + get(index: number): T | undefined; + + remove(index: number, count: number): T[]; + + removeOne(index: number): T | undefined; + + splice(index: number, count: number, ...item: T[]): T[] | undefined; + + isEmpty(): boolean; + + clear(): void; + + size(): number; + + toString(): string; + + toArray(): T[]; +} + +interface IDenqueOptions { + capacity?: number +} + +export = Denque; diff --git a/node_modules/denque/index.js b/node_modules/denque/index.js new file mode 100644 index 000000000..0e03764c9 --- /dev/null +++ b/node_modules/denque/index.js @@ -0,0 +1,443 @@ +'use strict'; + +/** + * Custom implementation of a double ended queue. + */ +function Denque(array, options) { + var options = options || {}; + + this._head = 0; + this._tail = 0; + this._capacity = options.capacity; + this._capacityMask = 0x3; + this._list = new Array(4); + if (Array.isArray(array)) { + this._fromArray(array); + } +} + +/** + * -------------- + * PUBLIC API + * ------------- + */ + +/** + * Returns the item at the specified index from the list. + * 0 is the first element, 1 is the second, and so on... + * Elements at negative values are that many from the end: -1 is one before the end + * (the last element), -2 is two before the end (one before last), etc. + * @param index + * @returns {*} + */ +Denque.prototype.peekAt = function peekAt(index) { + var i = index; + // expect a number or return undefined + if ((i !== (i | 0))) { + return void 0; + } + var len = this.size(); + if (i >= len || i < -len) return undefined; + if (i < 0) i += len; + i = (this._head + i) & this._capacityMask; + return this._list[i]; +}; + +/** + * Alias for peekAt() + * @param i + * @returns {*} + */ +Denque.prototype.get = function get(i) { + return this.peekAt(i); +}; + +/** + * Returns the first item in the list without removing it. + * @returns {*} + */ +Denque.prototype.peek = function peek() { + if (this._head === this._tail) return undefined; + return this._list[this._head]; +}; + +/** + * Alias for peek() + * @returns {*} + */ +Denque.prototype.peekFront = function peekFront() { + return this.peek(); +}; + +/** + * Returns the item that is at the back of the queue without removing it. + * Uses peekAt(-1) + */ +Denque.prototype.peekBack = function peekBack() { + return this.peekAt(-1); +}; + +/** + * Returns the current length of the queue + * @return {Number} + */ +Object.defineProperty(Denque.prototype, 'length', { + get: function length() { + return this.size(); + } +}); + +/** + * Return the number of items on the list, or 0 if empty. + * @returns {number} + */ +Denque.prototype.size = function size() { + if (this._head === this._tail) return 0; + if (this._head < this._tail) return this._tail - this._head; + else return this._capacityMask + 1 - (this._head - this._tail); +}; + +/** + * Add an item at the beginning of the list. + * @param item + */ +Denque.prototype.unshift = function unshift(item) { + if (arguments.length === 0) return this.size(); + var len = this._list.length; + this._head = (this._head - 1 + len) & this._capacityMask; + this._list[this._head] = item; + if (this._tail === this._head) this._growArray(); + if (this._capacity && this.size() > this._capacity) this.pop(); + if (this._head < this._tail) return this._tail - this._head; + else return this._capacityMask + 1 - (this._head - this._tail); +}; + +/** + * Remove and return the first item on the list, + * Returns undefined if the list is empty. + * @returns {*} + */ +Denque.prototype.shift = function shift() { + var head = this._head; + if (head === this._tail) return undefined; + var item = this._list[head]; + this._list[head] = undefined; + this._head = (head + 1) & this._capacityMask; + if (head < 2 && this._tail > 10000 && this._tail <= this._list.length >>> 2) this._shrinkArray(); + return item; +}; + +/** + * Add an item to the bottom of the list. + * @param item + */ +Denque.prototype.push = function push(item) { + if (arguments.length === 0) return this.size(); + var tail = this._tail; + this._list[tail] = item; + this._tail = (tail + 1) & this._capacityMask; + if (this._tail === this._head) { + this._growArray(); + } + if (this._capacity && this.size() > this._capacity) { + this.shift(); + } + if (this._head < this._tail) return this._tail - this._head; + else return this._capacityMask + 1 - (this._head - this._tail); +}; + +/** + * Remove and return the last item on the list. + * Returns undefined if the list is empty. + * @returns {*} + */ +Denque.prototype.pop = function pop() { + var tail = this._tail; + if (tail === this._head) return undefined; + var len = this._list.length; + this._tail = (tail - 1 + len) & this._capacityMask; + var item = this._list[this._tail]; + this._list[this._tail] = undefined; + if (this._head < 2 && tail > 10000 && tail <= len >>> 2) this._shrinkArray(); + return item; +}; + +/** + * Remove and return the item at the specified index from the list. + * Returns undefined if the list is empty. + * @param index + * @returns {*} + */ +Denque.prototype.removeOne = function removeOne(index) { + var i = index; + // expect a number or return undefined + if ((i !== (i | 0))) { + return void 0; + } + if (this._head === this._tail) return void 0; + var size = this.size(); + var len = this._list.length; + if (i >= size || i < -size) return void 0; + if (i < 0) i += size; + i = (this._head + i) & this._capacityMask; + var item = this._list[i]; + var k; + if (index < size / 2) { + for (k = index; k > 0; k--) { + this._list[i] = this._list[i = (i - 1 + len) & this._capacityMask]; + } + this._list[i] = void 0; + this._head = (this._head + 1 + len) & this._capacityMask; + } else { + for (k = size - 1 - index; k > 0; k--) { + this._list[i] = this._list[i = (i + 1 + len) & this._capacityMask]; + } + this._list[i] = void 0; + this._tail = (this._tail - 1 + len) & this._capacityMask; + } + return item; +}; + +/** + * Remove number of items from the specified index from the list. + * Returns array of removed items. + * Returns undefined if the list is empty. + * @param index + * @param count + * @returns {array} + */ +Denque.prototype.remove = function remove(index, count) { + var i = index; + var removed; + var del_count = count; + // expect a number or return undefined + if ((i !== (i | 0))) { + return void 0; + } + if (this._head === this._tail) return void 0; + var size = this.size(); + var len = this._list.length; + if (i >= size || i < -size || count < 1) return void 0; + if (i < 0) i += size; + if (count === 1 || !count) { + removed = new Array(1); + removed[0] = this.removeOne(i); + return removed; + } + if (i === 0 && i + count >= size) { + removed = this.toArray(); + this.clear(); + return removed; + } + if (i + count > size) count = size - i; + var k; + removed = new Array(count); + for (k = 0; k < count; k++) { + removed[k] = this._list[(this._head + i + k) & this._capacityMask]; + } + i = (this._head + i) & this._capacityMask; + if (index + count === size) { + this._tail = (this._tail - count + len) & this._capacityMask; + for (k = count; k > 0; k--) { + this._list[i = (i + 1 + len) & this._capacityMask] = void 0; + } + return removed; + } + if (index === 0) { + this._head = (this._head + count + len) & this._capacityMask; + for (k = count - 1; k > 0; k--) { + this._list[i = (i + 1 + len) & this._capacityMask] = void 0; + } + return removed; + } + if (i < size / 2) { + this._head = (this._head + index + count + len) & this._capacityMask; + for (k = index; k > 0; k--) { + this.unshift(this._list[i = (i - 1 + len) & this._capacityMask]); + } + i = (this._head - 1 + len) & this._capacityMask; + while (del_count > 0) { + this._list[i = (i - 1 + len) & this._capacityMask] = void 0; + del_count--; + } + if (index < 0) this._tail = i; + } else { + this._tail = i; + i = (i + count + len) & this._capacityMask; + for (k = size - (count + index); k > 0; k--) { + this.push(this._list[i++]); + } + i = this._tail; + while (del_count > 0) { + this._list[i = (i + 1 + len) & this._capacityMask] = void 0; + del_count--; + } + } + if (this._head < 2 && this._tail > 10000 && this._tail <= len >>> 2) this._shrinkArray(); + return removed; +}; + +/** + * Native splice implementation. + * Remove number of items from the specified index from the list and/or add new elements. + * Returns array of removed items or empty array if count == 0. + * Returns undefined if the list is empty. + * + * @param index + * @param count + * @param {...*} [elements] + * @returns {array} + */ +Denque.prototype.splice = function splice(index, count) { + var i = index; + // expect a number or return undefined + if ((i !== (i | 0))) { + return void 0; + } + var size = this.size(); + if (i < 0) i += size; + if (i > size) return void 0; + if (arguments.length > 2) { + var k; + var temp; + var removed; + var arg_len = arguments.length; + var len = this._list.length; + var arguments_index = 2; + if (!size || i < size / 2) { + temp = new Array(i); + for (k = 0; k < i; k++) { + temp[k] = this._list[(this._head + k) & this._capacityMask]; + } + if (count === 0) { + removed = []; + if (i > 0) { + this._head = (this._head + i + len) & this._capacityMask; + } + } else { + removed = this.remove(i, count); + this._head = (this._head + i + len) & this._capacityMask; + } + while (arg_len > arguments_index) { + this.unshift(arguments[--arg_len]); + } + for (k = i; k > 0; k--) { + this.unshift(temp[k - 1]); + } + } else { + temp = new Array(size - (i + count)); + var leng = temp.length; + for (k = 0; k < leng; k++) { + temp[k] = this._list[(this._head + i + count + k) & this._capacityMask]; + } + if (count === 0) { + removed = []; + if (i != size) { + this._tail = (this._head + i + len) & this._capacityMask; + } + } else { + removed = this.remove(i, count); + this._tail = (this._tail - leng + len) & this._capacityMask; + } + while (arguments_index < arg_len) { + this.push(arguments[arguments_index++]); + } + for (k = 0; k < leng; k++) { + this.push(temp[k]); + } + } + return removed; + } else { + return this.remove(i, count); + } +}; + +/** + * Soft clear - does not reset capacity. + */ +Denque.prototype.clear = function clear() { + this._head = 0; + this._tail = 0; +}; + +/** + * Returns true or false whether the list is empty. + * @returns {boolean} + */ +Denque.prototype.isEmpty = function isEmpty() { + return this._head === this._tail; +}; + +/** + * Returns an array of all queue items. + * @returns {Array} + */ +Denque.prototype.toArray = function toArray() { + return this._copyArray(false); +}; + +/** + * ------------- + * INTERNALS + * ------------- + */ + +/** + * Fills the queue with items from an array + * For use in the constructor + * @param array + * @private + */ +Denque.prototype._fromArray = function _fromArray(array) { + for (var i = 0; i < array.length; i++) this.push(array[i]); +}; + +/** + * + * @param fullCopy + * @returns {Array} + * @private + */ +Denque.prototype._copyArray = function _copyArray(fullCopy) { + var newArray = []; + var list = this._list; + var len = list.length; + var i; + if (fullCopy || this._head > this._tail) { + for (i = this._head; i < len; i++) newArray.push(list[i]); + for (i = 0; i < this._tail; i++) newArray.push(list[i]); + } else { + for (i = this._head; i < this._tail; i++) newArray.push(list[i]); + } + return newArray; +}; + +/** + * Grows the internal list array. + * @private + */ +Denque.prototype._growArray = function _growArray() { + if (this._head) { + // copy existing data, head to end, then beginning to tail. + this._list = this._copyArray(true); + this._head = 0; + } + + // head is at 0 and array is now full, safe to extend + this._tail = this._list.length; + + this._list.length <<= 1; + this._capacityMask = (this._capacityMask << 1) | 1; +}; + +/** + * Shrinks the internal list array. + * @private + */ +Denque.prototype._shrinkArray = function _shrinkArray() { + this._list.length >>>= 1; + this._capacityMask >>>= 1; +}; + + +module.exports = Denque; diff --git a/node_modules/denque/package.json b/node_modules/denque/package.json new file mode 100644 index 000000000..f1a0fcc7b --- /dev/null +++ b/node_modules/denque/package.json @@ -0,0 +1,55 @@ +{ + "name": "denque", + "version": "2.0.1", + "description": "The fastest javascript implementation of a double-ended queue. Used by the official Redis, MongoDB, MariaDB & MySQL libraries for Node.js and many other libraries. Maintains compatability with deque.", + "main": "index.js", + "engines": { + "node": ">=0.10" + }, + "keywords": [ + "data-structure", + "data-structures", + "queue", + "double", + "end", + "ended", + "deque", + "denque", + "double-ended-queue" + ], + "scripts": { + "test": "istanbul cover --report lcov _mocha && npm run typescript", + "coveralls": "cat ./coverage/lcov.info | coveralls", + "typescript": "tsc --project ./test/type/tsconfig.json", + "benchmark_thousand": "node benchmark/thousand", + "benchmark_2mil": "node benchmark/two_million", + "benchmark_splice": "node benchmark/splice", + "benchmark_remove": "node benchmark/remove", + "benchmark_removeOne": "node benchmark/removeOne" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/invertase/denque.git" + }, + "license": "Apache-2.0", + "author": { + "name": "Invertase", + "email": "oss@invertase.io", + "url": "http://github.com/invertase/" + }, + "contributors": [ + "Mike Diarmid (Salakar) " + ], + "bugs": { + "url": "https://github.com/invertase/denque/issues" + }, + "homepage": "https://docs.page/invertase/denque", + "devDependencies": { + "benchmark": "^2.1.4", + "codecov": "^3.8.3", + "double-ended-queue": "^2.1.0-0", + "istanbul": "^0.4.5", + "mocha": "^3.5.3", + "typescript": "^3.4.1" + } +} diff --git a/node_modules/dhn-api/database/JTmeme.json b/node_modules/dhn-api/database/JTmeme.json new file mode 100644 index 000000000..6f993987f --- /dev/null +++ b/node_modules/dhn-api/database/JTmeme.json @@ -0,0 +1,122 @@ +[ + "https://assets.jalantikus.com/assets/cache/560/420/userfiles/2018/11/03/Gambar-Lucu-2018-1-ab7c9.jpg", + "https://assets.jalantikus.com/assets/cache/560/320/userfiles/2018/11/03/Gambar-Lucu-2018-1-044b7.png", + "https://assets.jalantikus.com/assets/cache/560/315/userfiles/2018/11/03/Gambar-Lucu-2018-2-20eb2.jpg", + "https://assets.jalantikus.com/assets/cache/560/401/userfiles/2018/11/03/Gambar-Lucu-2018-3-42735.jpg", + "https://assets.jalantikus.com/assets/cache/350/350/userfiles/2020/02/24/12-b97a6.jpg", + "https://assets.jalantikus.com/assets/cache/560/496/userfiles/2018/11/03/Gambar-Lucu-2018-5-f8a9d.jpg", + "https://assets.jalantikus.com/assets/cache/560/420/userfiles/2018/11/03/Gambar-Lucu-2018-6-8b745.jpg", + "https://assets.jalantikus.com/assets/cache/560/510/userfiles/2018/11/03/Gambar-Lucu-2018-7-445fb.jpg", + "https://assets.jalantikus.com/assets/cache/560/560/userfiles/2018/11/03/Gambar-Lucu-2018-8-7679e.jpg", + "https://assets.jalantikus.com/assets/cache/560/415/userfiles/2018/11/03/Gambar-Lucu-2018-9-15dbe.jpg", + "https://assets.jalantikus.com/assets/cache/560/746/userfiles/2020/09/20/27-ee3a8.jpg", + "https://assets.jalantikus.com/assets/cache/560/532/userfiles/2020/09/20/26-9e360.jpg", + "https://assets.jalantikus.com/assets/cache/560/560/userfiles/2020/09/20/25-59ad8.jpg", + "https://assets.jalantikus.com/assets/cache/560/560/userfiles/2020/09/20/23-15f02.jpg", + "https://assets.jalantikus.com/assets/cache/560/662/userfiles/2020/09/20/22-90304.jpg", + "https://assets.jalantikus.com/assets/cache/80/80/tips/2020/04/15/gambar-sunda-lucu-1bf0f.jpg", + "https://assets.jalantikus.com/assets/cache/551/360/userfiles/2021/02/11/foto-kartun-lucu-f2864.jpeg", + "https://assets.jalantikus.com/assets/cache/360/360/userfiles/2021/02/11/foto-animasi-lucu-43228.jpeg", + "https://assets.jalantikus.com/assets/cache/362/360/userfiles/2021/02/11/foto-one-piece-lucu-51082.jpeg", + "https://assets.jalantikus.com/assets/cache/560/302/userfiles/2021/02/11/foto-animasi-kartun-lucu-815cb.jpeg", + "https://assets.jalantikus.com/assets/cache/560/294/userfiles/2021/02/11/animasi-lucu-33a80.jpeg", + "https://assets.jalantikus.com/assets/cache/490/360/userfiles/2021/02/11/foto-kartun-muslimah-51fac.jpeg", + "https://assets.jalantikus.com/assets/cache/480/360/userfiles/2021/02/11/animasi-bikin-ngakak-6f9ea.jpeg", + "https://assets.jalantikus.com/assets/cache/560/315/userfiles/2021/02/11/foto-animasi-002c8.jpeg", + "https://assets.jalantikus.com/assets/cache/480/360/userfiles/2021/02/11/kartun-lucu-dan-unik-fff3d.jpeg", + "https://assets.jalantikus.com/assets/cache/560/315/userfiles/2021/02/11/animasi-unik-6ee12.jpeg", + "https://assets.jalantikus.com/assets/cache/560/448/userfiles/2018/11/03/Gambar-Lucu-Gokil-1-7872d.jpg", + "https://assets.jalantikus.com/assets/cache/560/373/userfiles/2018/11/03/Gambar-Lucu-Gokil-2-1e8f7.jpg", + "https://assets.jalantikus.com/assets/cache/560/420/userfiles/2018/11/03/Gambar-Lucu-Gokil-3-2fea8.jpg", + "https://assets.jalantikus.com/assets/cache/560/315/userfiles/2018/11/03/Gambar-Lucu-Gokil-4-2a6d3.jpg", + "https://assets.jalantikus.com/assets/cache/560/444/userfiles/2018/11/03/Gambar-Lucu-Gokil-5-83bf0.jpg", + "https://assets.jalantikus.com/assets/cache/560/560/userfiles/2018/11/03/Gambar-Lucu-Gokil-6-3c8ae.jpg", + "https://assets.jalantikus.com/assets/cache/560/315/userfiles/2018/11/03/Gambar-Lucu-Gokil-7-0d9f7.jpg", + "https://assets.jalantikus.com/assets/cache/350/350/userfiles/2020/02/24/11-0d82f.jpg", + "https://assets.jalantikus.com/assets/cache/560/314/userfiles/2018/11/03/Gambar-Lucu-Gokil-9-09b37.jpg", + "https://assets.jalantikus.com/assets/cache/560/609/userfiles/2018/11/03/Gambar-Lucu-Gokil-10-de428.jpg", + "https://assets.jalantikus.com/assets/cache/80/80/tips/2018/12/15/gambar-lucu-jawa-banner2-60773.jpg", + "https://assets.jalantikus.com/assets/cache/350/350/userfiles/2020/02/24/13-f15c7.jpg", + "https://assets.jalantikus.com/assets/cache/560/336/userfiles/2018/11/03/Gambar-Lucu-Banget-1-26dfa.png", + "https://assets.jalantikus.com/assets/cache/560/352/userfiles/2018/11/03/Gambar-Lucu-Banget-2-0541c.jpg", + "https://assets.jalantikus.com/assets/cache/560/414/userfiles/2018/11/03/Gambar-Lucu-Banget-3-23b12.jpg", + "https://assets.jalantikus.com/assets/cache/560/372/userfiles/2018/11/03/Gambar-Lucu-Banget-4-c7c83.jpg", + "https://assets.jalantikus.com/assets/cache/560/548/userfiles/2018/11/03/Gambar-Lucu-Banget-5-d5a2d.jpg", + "https://assets.jalantikus.com/assets/cache/560/560/userfiles/2018/11/03/Gambar-Lucu-Banget-6-bee6b.jpg", + "https://assets.jalantikus.com/assets/cache/560/445/userfiles/2018/11/03/Gambar-Lucu-Banget-7-d23a2.jpg", + "https://assets.jalantikus.com/assets/cache/560/536/userfiles/2018/11/03/Gambar-Lucu-Banget-8-dd278.jpg", + "https://assets.jalantikus.com/assets/cache/560/560/userfiles/2018/11/03/Gambar-Lucu-Banget-9-37b0e.jpg", + "https://assets.jalantikus.com/assets/cache/560/656/userfiles/2020/09/20/24-e95a6.jpg", + "https://assets.jalantikus.com/assets/cache/560/563/userfiles/2020/09/20/21-769c5.jpg", + "https://assets.jalantikus.com/assets/cache/420/420/userfiles/2020/09/20/20-9a721.jpg", + "https://assets.jalantikus.com/assets/cache/560/561/userfiles/2020/09/20/18-06fa9.jpg", + "https://assets.jalantikus.com/assets/cache/560/560/userfiles/2020/09/20/13-19181.jpg", + "https://assets.jalantikus.com/assets/cache/80/80/gokil/2016/06/15/nostalgia-masa-kecil-banner.jpeg", + "https://assets.jalantikus.com/assets/cache/560/280/userfiles/2018/11/03/Gambar-Lucu-Bikin-Ngakak-1-efe16.jpg", + "https://assets.jalantikus.com/assets/cache/360/360/userfiles/2021/02/11/gambar-lucu-dan-unik-ff81d.jpeg", + "https://assets.jalantikus.com/assets/cache/560/315/userfiles/2018/11/03/Gambar-Lucu-Bikin-Ngakak-2-00774.jpg", + "https://assets.jalantikus.com/assets/cache/560/430/userfiles/2018/11/03/Gambar-Lucu-Bikin-Ngakak-3-b97b5.jpg", + "https://assets.jalantikus.com/assets/cache/560/560/userfiles/2018/11/03/Gambar-Lucu-Bikin-Ngakak-4-c69c9.jpg", + "https://assets.jalantikus.com/assets/cache/560/560/userfiles/2018/11/03/Gambar-Lucu-Bikin-Ngakak-5-730b2.jpg", + "https://assets.jalantikus.com/assets/cache/560/373/userfiles/2018/11/03/Gambar-Lucu-Bikin-Ngakak-6-f65d0.jpg", + "https://assets.jalantikus.com/assets/cache/560/560/userfiles/2018/11/03/Gambar-Lucu-Bikin-Ngakak-7-5b199.jpg", + "https://assets.jalantikus.com/assets/cache/560/314/userfiles/2018/11/03/Gambar-Lucu-Bikin-Ngakak-8-49cd8.jpg", + "https://assets.jalantikus.com/assets/cache/560/560/userfiles/2018/11/03/Gambar-Lucu-Bikin-Ngakak-9-11fcc.jpg", + "https://assets.jalantikus.com/assets/cache/560/315/userfiles/2018/11/03/Gambar-Lucu-Terbaru-1-9adcc.jpg", + "https://assets.jalantikus.com/assets/cache/560/595/userfiles/2018/11/03/Gambar-Lucu-Terbaru-1-e3cc0.png", + "https://assets.jalantikus.com/assets/cache/560/315/userfiles/2018/11/03/Gambar-Lucu-Terbaru-2-b71d6.jpg", + "https://assets.jalantikus.com/assets/cache/560/585/userfiles/2018/11/03/Gambar-Lucu-Terbaru-2-e8d13.png", + "https://assets.jalantikus.com/assets/cache/560/315/userfiles/2018/11/03/Gambar-Lucu-Terbaru-3-1b9d4.jpg", + "https://assets.jalantikus.com/assets/cache/560/585/userfiles/2018/11/03/Gambar-Lucu-Terbaru-3-aca0e.png", + "https://assets.jalantikus.com/assets/cache/560/560/userfiles/2018/11/03/Gambar-Lucu-Terbaru-4-923b5.jpg", + "https://assets.jalantikus.com/assets/cache/560/320/userfiles/2018/11/03/Gambar-Lucu-Terbaru-5-5b496.jpg", + "https://assets.jalantikus.com/assets/cache/560/560/userfiles/2018/11/03/Gambar-Lucu-Terbaru-6-3a1a3.jpg", + "https://assets.jalantikus.com/assets/cache/560/477/userfiles/2018/11/03/Gambar-Lucu-Terbaru-7-53534.jpg", + "https://assets.jalantikus.com/assets/cache/560/601/userfiles/2019/02/14/gambar-lucu-wa-1-77a51.jpeg", + "https://assets.jalantikus.com/assets/cache/560/693/userfiles/2019/02/14/gambar-lucu-wa-2-5b240.jpeg", + "https://assets.jalantikus.com/assets/cache/560/420/userfiles/2019/02/14/gambar-lucu-wa-1-1983f.jpg", + "https://assets.jalantikus.com/assets/cache/560/352/userfiles/2019/02/14/gambar-lucu-wa-2-36598.jpg", + "https://assets.jalantikus.com/assets/cache/560/418/userfiles/2019/02/14/gambar-lucu-wa-3-3a79b.jpg", + "https://assets.jalantikus.com/assets/cache/560/373/userfiles/2019/02/14/gambar-lucu-wa-4-f8e7e.JPG", + "https://assets.jalantikus.com/assets/cache/560/454/userfiles/2019/02/14/gambar-lucu-wa-5-3f5de.jpg", + "https://assets.jalantikus.com/assets/cache/560/821/userfiles/2019/02/14/gambar-lucu-wa-3-e2ec8.jpeg", + "https://assets.jalantikus.com/assets/cache/560/434/userfiles/2019/02/14/gambar-lucu-wa-4-f7a43.jpeg", + "https://assets.jalantikus.com/assets/cache/560/503/userfiles/2019/02/14/gambar-lucu-wa-5-66cfd.jpeg", + "https://assets.jalantikus.com/assets/cache/560/358/userfiles/2020/09/20/12-6f917.jpg", + "https://assets.jalantikus.com/assets/cache/500/533/userfiles/2020/09/20/17-d3131.jpg", + "https://assets.jalantikus.com/assets/cache/560/560/userfiles/2020/09/20/15-07fd9.jpg", + "https://assets.jalantikus.com/assets/cache/500/500/userfiles/2020/09/20/14-1b2ac.jpg", + "https://assets.jalantikus.com/assets/cache/560/560/userfiles/2020/09/20/29-476aa.jpg", + "https://assets.jalantikus.com/assets/cache/560/315/userfiles/2020/02/24/1-b4a5c.jpg", + "https://assets.jalantikus.com/assets/cache/350/350/userfiles/2020/02/24/2-7e6a1.jpg", + "https://assets.jalantikus.com/assets/cache/355/350/userfiles/2020/02/24/3-a75ec.jpg", + "https://assets.jalantikus.com/assets/cache/393/350/userfiles/2020/02/24/4-95663.jpg", + "https://assets.jalantikus.com/assets/cache/560/314/userfiles/2020/02/24/5-04a82.jpg", + "https://assets.jalantikus.com/assets/cache/350/350/userfiles/2020/02/24/6-3cc1d.jpg", + "https://assets.jalantikus.com/assets/cache/560/315/userfiles/2020/02/24/7-746de.jpg", + "https://assets.jalantikus.com/assets/cache/560/334/userfiles/2020/02/24/8-6f7c5.jpg", + "https://assets.jalantikus.com/assets/cache/500/350/userfiles/2020/02/24/9-4f030.jpg", + "https://assets.jalantikus.com/assets/cache/350/350/userfiles/2020/02/24/10-badd2.jpg", + "https://assets.jalantikus.com/assets/cache/431/360/userfiles/2020/09/20/19-b9676.jpg", + "https://assets.jalantikus.com/assets/cache/560/555/userfiles/2020/09/20/10-53417.jpg", + "https://assets.jalantikus.com/assets/cache/560/560/userfiles/2020/09/20/09-5f34e.jpg", + "https://assets.jalantikus.com/assets/cache/363/342/userfiles/2020/09/20/08-ba13c.jpg", + "https://assets.jalantikus.com/assets/cache/400/400/userfiles/2020/09/20/07-08280.jpeg", + "https://assets.jalantikus.com/assets/cache/560/560/userfiles/2020/09/20/06-b15c6.jpg", + "https://assets.jalantikus.com/assets/cache/560/629/userfiles/2020/09/20/05-1fee0.jpg", + "https://assets.jalantikus.com/assets/cache/560/320/userfiles/2020/09/20/04-c8395.jpg", + "https://assets.jalantikus.com/assets/cache/560/356/userfiles/2020/09/20/gambar-lucu-terbaru-bf4e2.jpg", + "https://assets.jalantikus.com/assets/cache/560/315/userfiles/2020/09/20/02-7d434.jpg", + "https://assets.jalantikus.com/assets/cache/453/605/userfiles/2020/09/20/01-720eb.jpg", + "https://assets.jalantikus.com/assets/cache/560/560/userfiles/2020/09/20/30-33540.jpg", + "https://assets.jalantikus.com/assets/cache/560/315/userfiles/2020/09/20/28-98e05.jpg", + "https://assets.jalantikus.com/assets/cache/560/560/userfiles/2020/09/20/11-c933e.jpg", + "https://assets.jalantikus.com/assets/cache/320/320/userfiles/2020/09/20/16-df666.jpg", + "https://assets.jalantikus.com/assets/cache/184/94/tips/2018/12/17/aplikasi-edit-video-lucu-banner-287ca.jpg", + "https://assets.jalantikus.com/assets/cache/184/94/tips/2020/04/07/film-lucu-indonesia-01-ffb7f.jpg", + "https://assets.jalantikus.com/assets/cache/184/94/gokil/2017/01/26/foto-kocak-editan-meitu-11.jpeg", + "https://assets.jalantikus.com/assets/cache/184/94/gokil/2015/09/25/single-vs-taken-banner.jpeg", + "https://assets.jalantikus.com/assets/cache/184/94/gokil/2018/09/05/header-13-7d1d3.jpg", + "https://assets.jalantikus.com/assets/cache/184/94/gokil/2017/06/09/photobomb-selebriti-banner.jpeg", + "https://assets.jalantikus.com/assets/cache/184/94/gokil/2016/06/09/perbedaan-laki-laki-sebelum-dan-sesudah-menikah-banner.jpeg" +] \ No newline at end of file diff --git a/node_modules/dhn-api/database/cerpen.json b/node_modules/dhn-api/database/cerpen.json new file mode 100644 index 000000000..832af0237 --- /dev/null +++ b/node_modules/dhn-api/database/cerpen.json @@ -0,0 +1,12 @@ +[ + "Cerpen Persahabatan – Sahabat Kecilku\n“Ini, buat kamu”, seraya menjulurkan bunga edelweis“Ini kan…”, belum sempat ku menyelesaikan kata kataku, tiba tiba dia memotong ucapanku“Iya, dulu kan kamu pernah minta ini kalau aku sudah pulang dari luar negeri” , jelasnya\nTernyata dia sama sekali tidak lupa, meskipun sudah 4 tahun tidak pernah saling menghubungi. Bunga yang melambangkan keabadian ini, memang sudah sejak lama aku menginginkannya. Tak ada yang berubah. Meskipun sudah 4 tahun aku tak melihatnya. Garis wajahnya, rambutnya yang ikal, alisnya yang hitam tebal, bola matanya yang bulat coklat, msh sama seperti dulu. Sudah sejak kecil aku mengenalnya. Dia tetangga baruku sewaktu aku kecil“Nama kamu siapa?“Aku Ines, kamu?“Aku Tio“Kamu pindah darimna?“Dari luar kota, karena Papa ku lagi ada urusan bisnis di sini, jadi kami terpaksa pindah ke sini“Hmm. Aku senang punya teman baru. Semoga kita bisa berteman baik ya“Iya, aku juga\nSejak saat itu aku menjadi akrab dengannya. Main bersama, jalan jalan bersama keluarganya dan keluargaku. Dan kami pun berjanji untuk tetap bersahabat baik hingga besar nanti. Ketika suatu hari ia mengajakku ke taman dekat rumah, sepertinya ada hal penting yang ingin ia bicarakan“Minggu depan aku akan pindah“Pindah kemana? Kenapa mendadak?“Ke luar negeri. Sebenarnya aku ingin memberitahumu sejak awal, tapi aku takut kamu sedih lalu menjauh darikuSebenarnya aku juga sudah tahu kalau dia ingin pindah ke luar negeri. Mamah yang memberitahuku. Ku kira itu hanya\nomongan saja, tapi ternyata…\n“Kamu mau minta hadiah apa dariku?“Apa aja?“Iya. Apa yang kamu mau, aku akan kasih“Kamu tahu kan, kalau dari dulu aku sangat menginginkan bunga itu?“Edelweis? Hanya itu saja?“Iya, hanya itu saja“Baiklah\nTiba tiba ia menyadarkan lamunanku. Membuat pandanganku membaur. Ia mulai mengungkapkan sesuatu“Maaf…”, kata katanya terputus“Aku tak bisa lama lama tinggal d sini”, sambungnya“Kenapa?” tanyaku penasaran“Maaf, aku baru bisa memberitahumu sekarang. Karena aku akan balik lagi ke luar negeri. Bulan depan aku akan menikahGlek. Menikah\nTiba tiba pandanganku menjadi buram. Bayangan wajahnya perlahan menghilang di telan bayangan“Ines… Ayo bangun! Sudah jam setengah 9. Nanti kamu telat kuliahnya!“Yaahhh, Mamah… Lagi nanggung juga mimpinyaTernyata hanya mimpi. Aku menghembuskan nafas lega\n", + "Cerpen Persahabatan – Siput dan Wijen\nPagi yang cerah, seorang gadis yang bernama Putri membuka jendela kamarnya dan membiarkan sinar matahari untuk masuk ke dalam kamarnya. “Hoamm, sejuk sekali udara pagi ini” ucap Putri sambil menghirup udara. “Ting ting” handphone Putri berbunyi tanda pesan singkat masuk. Seketika Putri langsung mengambil handphonenya dan membuka pesan singkat tersebut, ternyata itu dari Wijay teman Putri. “Pagi” begitu pesannya. “Pagi juga” Putri membalas. “Put, hari ini bisa tidak kita bertemu?” tanya Wijay pada Putri. “Emangnya mau ngapain?” balas Putri penasaran. “Sudah, nanti datang saja jam 10, aku tunggu di lapangan ya” balas Wijay kembali. “Baiklah” balas Putri\nPutri pun langsung mempersiapkan diri untuk datang menemui Wijay di lapangan. Ia segera mandi, dan setelah itu berdandan. Ketika Putri akan memakai baju, ia bingung ingin mengenakan baju yang mana. Dipilihnya baju berwarna ungu dengan motif bunga-bunga, celana putih, serta jilbab yang berwarna ungu. Setelah ia puas dengan apa yang ia kenakan, ia pun segera turun ke bawah untuk menemui Ayah dan Bundanya di meja makan. “Pagi Yah, pagi Bun” sapa Putri di meja makan pada Ayah dan Bundanya. “Pagi Putri” balas mereka hampir bersamaan. “Ayah, pagi ini Putri mau ke lapangan” ucap Putri. “Loh, mau ngapain?” tanya Ayah penasaran. “Itu, Wijay mau ketemu di lapangan jam 10 nanti” jawab Putri polos. “Oh begitu, ya sudah. Tapi maaf ya Put, Ayah nggak bisa nganter” ucap Ayahnya. “Iya Ayah, tidak apa-apa” balas Putri. Setelah itu Putri menghabiskan makanannya dan meminum segelas susunya sampai habis\nSetelah semuanya selesai, Putri langsung berpamitan kepada Ayah dan Bundanya. “Ayah Bunda, Putri berangkat dulu” ucap Putri berpamitan. “Iya Put, hati-hati ya” balas Bundanya. Setelah itu Putri mengayuh sepedanya dan menuju ke lapangan. Setelah menempuh waktu kurang lebih 10 menit, Putri akhirnya sampai di lapangan, dicarinya Wijay kesana kemari. Dan sampai akhirnya… “Putri!!!” seru seorang anak memanggil Putri. Seketika Putri pun menoleh ke sumber suara. “Hai! Wijay” ucap Putri tiba-tiba. “Hai” balas Wijay. “Mau ngapain sih kesini? Mau mentraktir aku?” ucap Putri dengan rasa percaya diri yang sangat tinggi. “Yee, traktir terus sih pikirannya” sungut Wijay sedikit kesal. “Iya iya, emang mau ngapain Kak Wijay yang paling WOW” ucap Putri dengan nada tak ikhlas. “Hmm, gini loh Put, kamu inget gak ini hari apa?” tanya Wijay pada Putri. “Ya inget lah, ini kan Hari Selasa” jawab Putri dengan mudahnya\n“Kok hari selasa sih? bukan itu maksudku” ucap Wijay sambil berharap. “Emm, emang hari ini hari apa sih?” tanya Putri dengan kepolosannya. “Yah Putri lupa, hari ini kan hari ulang tahunku” ucap Wijay dengan nada sedih. “Oh ya? Maaf aku lupa” balas Putri dengan nada menyesal. “Tak apa, ini ada birthday card buat kamu” ucap Wijay sambil memberikan kartu undangan tersebut. “Wah wah, ada pesta nih keliatannya” ledek Putri. “Hehe.. Iya nih, mumpung ada rezeki” balas Wijay. “Iya Alhamdulillah” jawab Putri turut senang. “Datang ya Put” pinta Wijay. “Insyaallah” ucap Putri tersenyum. “Lahh, pokoknya harus dateng!!” Wijay memaksa. “Loh? siapa tahu nanti aku sampai rumah udah gak ada, makanya aku bilang Insyaallah” jawab Putri bijak. “Kok gitu ngomongnya? serem banget” ucap Wijay keheranan. “Hmm, sudahlah lupakan saja” balas Putri tersenyum\nSetelah selesai bertemu, Putri pun berpamitan kepada Wijay untuk segera pulang ke rumah. “Aku pulang dulu ya Jay” ujar Putri. “Baiklah” jawab Wijay sedikit lesu. “Bye bye.. sampai bertemu di pesta ya” ucap Putri sambil mengedipkan sebelah matanya. “Oke oke” balas Wijay sambil mengedipkan sebelah matanya pula\nSetelah sampai di rumah, Putri langsung membuka kartu undangan tersebut. “Emm, jam 4 sore toh pestanya” ucap Putri sambil mengangguk-anggukan kepala tanda mengerti. “Loh? Berarti aku harus membeli hadiah untuk Wijay? Tapi apa ya?” ucap Putri lirih. Tiba-tiba Bunda Putri datang menghampirinya. “Ada apa Put?” tanya Bunda pada Putri. “Ini Bunda, tadi ternyata Wijay ketemu sama Putri, cuma mau ngasih kartu undangan ini” jelas Putri pada Bunda. “Terus?” jawab Bunda tak mengerti. “Yah Bunda, Putri kan mesti beli hadiah buat Wijay?” ucap Putri. “Oh begitu, ya sudah, belikan Wijay barang kesukaannya” Bunda memberi saran. “Emm? Jam tangan!” celetuk Putri. “Jam tangan? Itu barang kesukaannya Wijay?” tanya Bunda\n“Iya Bunda, Wijay paling suka sama jam tangan” seru Putri. “Ya sudah, nanti Bunda antar ke toko jam tangan ya?” ucap Bunda. “Nanti? Sekarang lah Bunda, undangannya kan jam 4?” ucap Putri mendesak Bundanya. “Hmm ya udah deh, Bunda ganti baju dulu ya” ucap Bunda menuruti permintaannya. “Oke Bunda, jangan terlalu lama yaa” kata Putri. Bundanya tak berkata apapun hanya membalas dengan sebuah senyuman\nPutri meununggu sudah lebih dari 5 menit. “Bunda lama amat sih ganti bajunya” batin Putri berkata. Tak lama dari itu, Bunda Putri keluar dari kamarnya. “Maaf ya, kalau lama” ucap Bunda. “Ya tidak apa-apa” jawab Putri cuek. Selanjutnya Putri langsung menuju depan rumah, dan Bunda Putri mengunci pintu rumah. Setelah semua itu selesai, Bunda dan Putri pun berangkat ke toko jam tangan. Putri segera berlari ke dalam toko jam tersebut, dan langsung melihat-lihat jam tangan yang dipajang. Seketika langkah Putri berhenti di depan jam tangan yang berwarna hitam\nPutri segera memanggil Bundanya “Bundaaa” ucap Putri setengah berteriak. “Ada apa?” balas Bunda sambil menghampiri Putri. “Mau itu” ucap Putri kembali sambil menunjuk jam tangan tersebut. “Yang itu?” tanya Bunda. “Iya” jawab Putri singkat. “Baiklah” ucap Bunda menuruti. “Mas mas, saya ambil yang ini ya?” ucap Bunda Putri kepada petugas toko. “Baik Bu” balas petugas toko dengan ramah. Setelah Bunda Putri membayar di kasir, mereka pun pulang ke rumah\nSesampainya di rumah, Putri segera membungkus jam tangan tersebut dengan kertas kado kesukaannya. Perlahan tapi pasti! Putri membungkus dengan sepenuh hati, karena hadiah itu untuk sahabat kesayangannya. Seselesainya Putri membungkus kado, Putri langsung mempersiapkan diri untuk pergi ke pesta ulang tahun Wijay. Lagi lagi, Putri kalah dalam hal berpakaian. Putri bingung harus mengenakan pakaian yang mana. “Bundaa!” teriaknya kencang. “Ada apa Put?” ujar Bunda sambil melangkah mendekati Putri. “Bundaa, Putri tak mengerti harus memakai baju yang mana?” keluh Putri\n“Gunakan saja yang menurutmu layak untuk dipakai” ucap Bunda tersenyum. Putri pun tak mengeluarkan sepatah kata pun. Putri terus mengukir apa maksud Bundanya tadi. “Mungkin memang aku harus mengenakan apa yang selayaknya aku kenakan” batinnya tersenyum. Lalu Putri mengambil baju yang berwarna Putih, celana jeans hitam, dan yang terakhir kerudung hitam. Tanpa berpikir panjang, Putri langsung mandi dan mengenakan pakaian yang telah dipilihnya tadi. Setelah dirinya siap, Putri pun langsung berangkat ke rumah Wijay\nTernyata telah banyak orang yang sudah datang. “Putriii!” panggil seseorang. Putri pun langsung mencari siapa yang memanggilnya tadi. Ternyata ia adalah teman sekelasnya, Nikmah. “Ehh kamu Kem?” ucap Putri. “Ahh Nikem terus? Jelek tau!” sungut Nikmah kesal. “Iya iya deh, ada apa?” tanya Putri. “Tidak, cuma mau nanya kamu kasih hadiah apa ke Wijay?” ujar Nikmah. “Emm? Adadeh kepo banget sih” ledek Putri. “Yeee.. nimbang nanya doang, pelit amat sih!” celetuk Nikmah. “Privasi dong” ucap Putri di telinga Nikmah dan pergi meninggalkannya\nPutri mencari Wijay kesana kemari, namun tak ada hasil. Lelah pun menghampiri Putri, akhirnya Putri pun memutuskan untuk duduk di bawah pohon mangga. “Nih minumnya” seseorang menyodorkan minuman tepat di depan muka Putri. Serentak Putri kaget, ternyata itu adalah Wijay. “Huuu Wijay ngagetin aja!” gerutu Putri. “Iya maaf maaf” ucapnya meminta maaf.. “Iya deh gak apa-apa” ucapnya. “Oiya! Nih kadonya” celetuk Putri. “Wahh.. Terimaksih sahabatku” ucapnya sambil tersenyum manis. “Oke deh sama-sama. Wle” balas Putri sambil menulurkan lidahnya. “Jelek” celetuk Wijay. “Oh gitu, ya sudah aku pulang!” ucap Putri dengan nada ngambek. “Jangan-jangan dong, aku kan cuma bercanda” jelas Wijay. Putri tak membalas perkataannya lagi, ia hanya diam, diam dan diam\nSaatnya acara tiup lilin. Wijay sudah bersiap di depan kue ulang tahunnya. Semua teman-temannya serempak menyanyikan lagu ulang tahun untuk Wijay. Setelah tiup lilin, kini saatnya first cake. Ya! Wijay memberikan first cake itu untuk bundanya tercinta. Tak lupa Wijay ucapkan terimakasih atas kehadiran teman-teman di acara pesta ulang tahunnya tersebut\nSebelum acaranya selesai, Wijay memberi pengumuman lewat pengeras suara. “Teman-teman, ini hari ulang tahunku yang sangat amat spesial. Karena di acara ulang tahunku sekarang ini, sahabat kesayanganku hadir disini” ucap Wijay. Wijay tak meneruskan ucapannya tadi, ia diam mematung. Tapi tiba-tiba… “Putrii!” celetuknya dengan sangat keras. “Hah?” ucap Putri tercengang. Semua mata langsung tertuju pada Putri yang berdiri di samping Nikmah. “Sini Put, maju ke depan” ucap Bunda Wijay. “Apaan sih Jen? Kok aku?” ucap Putri tak mengerti. “Kok Jen? Apalagi itu?” Wijay berbalik tanya. “Jen.. Wijen. Hahaha” ucap Putri tertawa geli\n“Huhh dasar Siput. Wle” ucap Wijay sambil menjulurkan lidahnya. “Loh? Kok Siput?” ucapnya penasaran. “Yoi, Siputri. Hahaha” ucapnya tertawa pula. “Ah sudahlah” ucap Putri lemas. “Haha, mulai sekarang aku panggil kamu Siput” ucap Wijay. “Okee, aku juga panggil kamu Wijen!” balasnya tak mau kalah juga. “Baik, Siput dan Wijen” ucap Wijay. “Hahahaha, itu konyol!” ujar Putri tertawa. “Yang penting happy” balas Wijay. Teman-teman Wijay dan Putri pun ikut tertawa geli juga mendengar Wijen mengatakan hal itu.", + "Cerpen Persahabatan – You’ll Never Know\nMatahari mulai memunculkan sinarnya di ufuk timur bumi, tanda hari kini sudah pagi. Ayam-ayam berkokok serentak membangunkan orang orang yang masih terlelap dalam tidur mereka. Carla terbangun dari tidur nyeyaknya dan segera beranjak menuju kamar mandi untuk segera bersiap-siap menuju sekolahnya\n“Carla cepatlah, kita bisa terlambat” teriak Mafalda sahabat sekaligus teman sekamar di tempat kost yang di sewa nya\n“sebentar” Carla berteriak balik dan segera keluar dari kamarnya sebelum Mafalda meninggalkannya\n\nMereka berjalan beiringan menuju sekolah yang sama, namun mereka tidak berada dalam kelas yang sama. Carla berada di kelas Bahasa sedangkan Mafalda berada di kelas Ipa. Hari itu mereka tepat waktu atau lebih tepatnya tepat ketika bel berbunyi mereka sampai di depan pintu gerbang sekolah. Mafalda segera berlari menuju kelas nya begitupun dengan Carla\n“syukurlah aku tidak terlambat lagi” gumam Carla saat memasuki kelasnya\n\nCarla berjalan menuju tempat duduknya yang berada di sebelah Olivia, dan berada persis di depan bangku Joshua, teman sekelasnya yang selalu membuat lelucon konyol dan juga biang keributan di dalam kelas. Dan Carla juga sering menjadi penyebab salah satu keributan itu bersama dengan Joshua\n“Carla” Joshua memanggilnya saat pelajaran baru saja dimulai\n“aku bawa kartu poker. Ayo kita main” ajaknya dengan tersenyum lebar\n“jangan! Ini sedang jam pelajaran, mainlah nanti” cegah Olivia\n“Ayo!” seru Carla bersemangat sementara Olivia dan Jason teman sebangku Joshua hanya menghela nafas pasrah oleh tingkah laku kedua teman mereka itu\n\nJoshua dan Carla sibuk dengan dunia mereka sendiri sementara guru mereka sedang menjelaskan pelajaran di depan. Tanpa mereka sadari guru itu mengetahui bahwa Carla dan Joshua tidak memperhatikan pelajarannya tanpa memberi peringatan dia pun langsung mendatangi tempat duduk mereka berdua\n“apa yang kalian lakukan?!” bentaknya\nCarla dan Joshua yang kaget langsung memasukkan kartu mereka ke dalam saku seragam masing-masing\n“tidak apa-apa, pak” ucap mereka bebarengan\n\n“Carla sejak kapan papan tulis menghadap ke belakang?! Hadap ke depan!” serunya dan Carla langsung membalikkan tubuhnya\n“kembali perhatikan pelajaran!” seru guru itu sebelum kembali melanjutkan pelajarannya\nSementara disisi lain Carla dan Joshua justru menertawakan entah hal apa yang menurut mereka lucu. Walaupun hanya terkikik pelan namun keadaan kelas yang sepi membuah mereka sangat mudah tertangkap\n“Carla, Joshua. Keluar dari kelas saya sekarang!!” guru itu berteriak, yang membuat Carla dan juga Joshua terdiam seketika\n\nSetelah mencoba meminta maaf namun tidak ada gunanya, akhirnya Carla dan Joshua pun keluar dari kelas dan duduk di taman yang berada di depan kelas mereka. Mereka saling bercakap-cakap dan seperti biasa membicarakan lelucon lelucon konyol dan akan tertawa bersama-sama atau lebih tepatnya Carla yang akan tertawa hingga memegangi perutnya\n\nTepat saat mereka masih duduk di taman, Mafalda lewat di koidor kelas mereka dan melihat Carla berada di luar kelas\n“Carla” Mafalda melambaikan tangannya pada Carla yang masih sibuk tertawa “kenapa kau tidak berada di kelas?” tanyanya\nCarla pun menghentikan tawanya dengan susah payah dan berjalan menuju Mafalda “aku mendapat hukuman bersama dengan Joshua” jawab Carla\n\n“yah, jangan sering bermain di kelas! Dasar kau. Ya sudah aku kembali ke kelas dulu” ucap Mafalda sebelum kembali ke kelasnya\n“siapa tadi?” tanya Joshua saat Carla kembali menghampirinya\n“Mafalda, temanku” jawab Carla\n“hey, boleh aku minta nomer ponselnya?” pinta Joshua\n“minta saja sendiri” ucap Carla sambil menjulurkan lidahnya\n\nTanpa di duga Joshua langsung berdiri dari duduknya dan berlari menghampiri Mafalda yang belum sempat masuk ke dalam kelas. Tentu Mafalda langsung memberikan nomer ponselnya karena dia tau bahwa Joshua adalah teman dari sahabatnya sendiri\n\nBeberapa minggu berlalu setelah Joshua meminta nomor ponsel Mafalda dan akhir-akhir ini dia juga sering menanyakan hal-hal yang bersangkutan dengan Mafalda pada Carla. Carla yang tidak tau apa maksud Joshua sebernarnya pun memberitahukan apa yang dia tau tentang Mafalda. Warna kesukaan barang barang kesukaannya dan lainnya\n\nSampai pada suatu hari, Carla tidak tau kenapa Joshua tiba-tiba menghindarinya. Dia bahkan tidak berbicara sama sekali pada Carla bahkan saat Carla mencoba bertanya padanya. Dia akan memutar tempat duduknya ke arah lain saat Carla mencoba menanyakan sesuatu padanya atau mengajaknya berbicara\n“apa yang sebenarnya terjadi padamu, huh?” tanya Olivia pada akhirnya yang mengetahui perubahan sikap Joshua yang sangat drastis\n“frustasi mungkin” canda CarlaDan Joshua sama sekali tidak menjawab pertanyaan mereka\n“sudahlah biarkan saja. Dia akan segera baikan” ucap Jason\n\nDan beberapa hari setelah itu Carla baru mengetahui bahwa Joshua telah menyatakan perasaannya pada Mafalda, temannya sendiri. Tidak bisa di pungkiri bahwa Carla merasa sedih karena sejujurnya dia menyimpan perasaan pada Joshua sejak lama. Dan dia baru menyadari mengapa Joshua selalu menanyakan hal-hal yang berhubungan dengan Mafalda. Apakah mungkin itu juga yang membuat nya menghindari Carla selama ini“wah, jadi kau menerimanya. Selamat!” ucap Carla sambil tertawa riang di depan Mafalda saat sahabatnya itu memberitahunya bahwa dia telah resmi berpacaran dengan Joshua\n\n“aku kira dia menyukaimu” ucap Mafalda yang membuat Carla terdiam sejenak\n“tentu saja tidak. Kami hanya teman biasa” ucapnya\n“aku tau. Terima kasih” gumam Mafalda dan memeluk erat sahabat terbaiknya itu\n\nCarla berangkat ke sekolah seperti biasa walaupun Mafalda sudah berangkat lebih dulu karena dia terlambat bangun pagi tadi. Sampai di kelas di menemukan Joshua yang sudah kembali berubah seperti dulu, Joshua yang periang dan selalu menceritakan lelucon lelucon konyolnya\n\n“jadi kau menghindariku beberapa hari ini karena kau sudah berpacaran dengan Mafalda?” tanya Carla saat mereka sudah kembali menjadi biang keributan di kelas\n“ha? Eum- aku hanya. Yah hm” jawab Joshua bingung atas pertanyaan Carla\n“hahaha oh ya, selamat ya!” ucap Carla yang melihat kebingungan di wajah Joshua\n“terima kasih” ucapnya\n\n‘you’ll never know what i feel’ batin Carla sedih dalam hatinya", + "Cerpen Persahabatan – Sahabat Itu Ga Ada Putusnya\nAku masih menatapnya tidak percaya saat ia mengatakan dengan jelas, di depan wajahku, dia memutuskan tali persahabatan yang telah terjalin sejak lima tahun yang lalu. Aku menggeleng-geleng, menatapnya nanar. Persahabatan yang telah susah payah dibangun dengan rasa sabar, hancur untuk alasan yang tidak kuketahui? Hoh, memalukan. Apa persahabatan ini serapuh itu\n“Kamu kenapa? Aneh. Jangan bercanda di saat-saat seperti ini, deh. Kenapa kamu tiba-tiba datang kesini, sambil berteriak kencang seolah-olah aku ini orang tuli, ‘persahabatan kita putus!’ apa itu cara yang baik untuk mengerjaiku?!” suaraku meninggi. Biar ini hanya bercanda, ini sungguh menyebalkan. Otakku masih berputar-putar, masih mencari-cari alasan ia mengatakan hal itu. Sudah jelas, ia tak mungkin mengatakannya untuk bercanda. Ia pasti punya alasan mengapa ia mengutarakan hal itu di depan wajahku tanpa memikirkan apa yang sedang dikatakannya\n“Aku kecewa sama kamu. Kecewa!” teriaknya. Kata-kata itu cukup mampu menusuk jantungku\nKami berargumen sangat lama, dengan cukup alot, hingga akhirnya aku kesal dan pergi. Ngapain masih disitu, memperjuangkan persahabatan yang memang sudah jatuh ke jurang? Aku juga masih punya harga diri untuk mengusiknya lagi. Biar saja dia bersama dengan teman-teman barunya, kita lihat saja siapa yang terbaik!\n\nSebentar lagi, ketika mereka sudah tidak membutuhkan kamu lagi, kamu pasti kembali padaku! Kamu pasti malu!\n\nDia mengatakan, aku telah merebut orang yang disukainya. Pasti anak-anak penyebar gosip itu lagi. Kenapa sih mulut mereka itu tidak bisa direm? Seharusnya mulut-mulut mereka itu ikut dioperasi agar tidak bisa lagi menyebarkan hal yang nggak jelas kebenarannya. Huh\nEsoknya, aku berangkat sekolah dengan wajah sedikit menyeramkan. Semalam aku tidak tidur, hanya tertawa dendam dan kesal-kesal sendiri. Aku rasa aku sudah gila. Pada saat acara sarapan pagi. Aku memelototi seluruh anggota keluargaku yang ada di meja makan. Ayah, ibu, kakak. Mereka semua telah dapat mataku yang mematikan ini. Mereka salah tingkah. Kakakku mengejekku lagi, ‘dasar perempuan mengerikan!’ sahutnya dari kejauhan\n“Kalau kau bicara lagi, besok kepalamu akan tergantung di depan sekolah,” ancamku sambil tersenyum licik. “Khu, Khu, khu…\nDi sekolah, aku langsung menuju kelasku, dan menduduki bangkuku tanpa menoleh sedikitpun ke arah belakang. Aku membiarkan bangku di sebelahku kosong. Daripada tasku harus tertindih, lebih baik ia mendapatkan kursi kosong itu sebagai tempat yang layak. Aku menggambar-gambar anime dan berusaha tidak menolehSalah satu dari mereka, mulai menunjukkan kekesalannya padaku. Karen menggebrak mejaku dengan kerasnya. Aku sama sekali tidak terkejut ataupun kesal karena dibandingkan ini, penganiayaan kakakku di rumah jauh lebih kejam, hehe\n“Sudah ditinggal sahabat begitu masih sombong. Pura-pura kuat. Memangnya kamu tidak punya rasa malu sampai-sampai mendekati cowok orang?!” bentaknya khas. Aku berdiri. Semua kata-kata yang akan kukeluarkan adalah kata-kata yang sudah kurancang selama semalaman penuh\n“Hei, berisik. Seharusnya aku yang tanya pada kalian, apa kalian tidak malu menyebarkan berita bohong seperti itu dan menghancurkan persahabatan orang?!” bentakku. “Kalau nggak tahu apa-apa, lebih baik diam dan jaga mulut lentur kalian itu. Dan, jangan campuri urusan orang. Apa kalian senang jika melihat orang menderita, hah?!\n“Tch…” Karen menggerakkan tangannya, ia mungkin ingin menamparku“Tampar saja kalau berani. Setelah kamu menamparku, tulang punggungmu akan kupatahkan dan kau akan kugantung di depan ruang kepala sekolah. Mau?Akhirnya dia menarik tangannya kembali, lalu duduk di bangkunya sambil mengumpat padaku\n—\n\n“Sebenarnya kenapa sih kamu?” Aku masih tidak mengerti. “Tiba-tiba percaya dengan pembicaraan mereka, padahal kita sama-sama tahu kalau sifat mereka seperti itu!“Aku nggak bisa percaya sama kamu lagi,” Isaknya. “Kamu jahat. Kamu ‘kan tahu aku suka sama Zumi. Kenapa kamu malah deket-deket dia?\n“Yumi, aku nggak bermaksud deket-deket, tapi memang ada pekerjaan yang harus kita selesaikan, itu alasannya…\n“Aku nggak percaya…” Dia tambah terisak. “Risa jahat!\nDia lalu berlari tanpa mendengarku. Aduh, gimana nih? Mungkin lebih baik aku bicara pada Zumi agar semua masalah selesai. Tapi, buat apa aku ngomong sama dia? Alasan apa yang harus aku bicarakan, ‘jelaskan kalau kita bukan apa-apa.’ Lalu dia akan bertanya, ‘memangnya kenapa?’ lalu aku jawab, ‘Yumi marah sama aku karena dia mengira kita pacaran.’ Lalu, berarti perasaan Yumi pada Zumi akan terbongkar. Sama saja menyiram bensin di atas api. Oh, oh, itu pikirkan nanti saja. Yang penting, Zumi harus kupaksa untuk bicara semuanya. Yeay!\n\n“Zumi, teman-teman mengira kita sedang dalam hubungan yang lebih dari teman, mereka salah paham, jadi mereka bermasalah denganku. Bisa bantu aku menjelaskannya?” akhirnya aku menemukan alasan yang tepat\n“Biar kutebak. Anak-anak bermulut setan itu?” ujarnya emosi. “Baik. Biar aku jelaskan pada mereka. Mereka memang tidak bisa berhenti beraksi.\nZumi bersedia membantuku. Esoknya, aku menyeret paksa Zumi ke hadapan anak-anak itu. Beberapa ada yang mencibir, mengejek, menghina, dan ucapan-ucapan menyakitkan semacamnya. Aku tidak begitu menghiraukan. Nggak ada gunanya juga\n“Jadi begini,” Zumi menjelaskannya dnegan gugup. “Kami ini sama sekali tidak ada apa-apa. Ingat festival pekan seni budaya yang akan diadakan minggu depan? Kami berdua diperintahkan oleh kepala sekolah untuk membuat event-event di dalamnya menjadi lebih hidup, dan mengatur jalannya festival. Kami juga bertanggung jawab atas dekorasi, tiket dan letak-letak stand. Jadi sejauh ini, kami hanya partner sementara yang disewa oleh sekolah untuk kelangsungan pekan seni budaya. Mengerti?“Jadi, kalian sebenarnya tidak ada apa-apa?” Yumi membuka mulutnya\n“Tidak,” Zumi menjawab. “Semua ini adalah tugas dari sekolah. Ingin lebih akurat? Mau kupanggil kepala sekolah untuk menjelaskannya sekarang?“Eh, tidak perlu repot-repot,” Karen mengelak. “Kami percaya kok.\nLalu gerombolan sial itu pergi ke luar, atau lebih tepatnya kabur. Aku dan Yumi sama-sama tersenyum, lalu kami berpelukan. Ia meminta maaf karena sempat tak percaya padaku. Tentu, aku memaafkannya. Persahabatan kami terjalin kembali. Lalu, kami berdua menatap ke arah Zumi, yang keheranan dengan sikap kami berdua\n“Sebenarnya ini ada apa sih? Kok jadi drama gini?” tanyanya bingung\nAku tersenyum. Biar saja waktu mengungkap rahasia ini pada saatnya…", + "Cerpen Persahabatan – Sahabat Jadi Cinta\nNama gue Liliana Septi Anugrah pratama. Gue biasa dipanggil Lili. Gue memang bukan cewek yang sempurna. Inget, di dunia ini nggak ada manusia yang sempurna. Kesempurnaan hanya milik Allah. Gua terkenal sebagai cewek tomboy yang maniak basket. And you know? Bagi gue basket is my soulmate. Ada saat suka maupun duka\nDah deh kenalannya. Sekarang ngomongin cinta (ceile… cinta). Jangan salah loh cewek tomboy juga punya cinta\nYa, dialah Andika Widi Gusmawan, biasa di panggil Widi. Cowok pendiem, ganteng, manis and super duper keren. Dialah cowok yang bener-bener bisa buat gue jatuh cinta. Walaupun dia bukan yang pertama tapi I hope dia yang terakhir. Amin\nGue kenal Widi dari awal gue masuk SMA. Kita sekolah di tempat yang sama bahkan di kelas yang sama. Awalnya kita nggak pernah saling nyapa. Bahkan, di hari pertama kita masuk kelas, kita berebutan bangku. Haduh, kesan pertama kok gini amat sih\nHingga akhirnya gue sebagai cewek tomboy yang punya jiwa friendly ngeberaniin diri buat ngobrol dan minta nomor hapenya. Trereng, Waca. Nomor hape dia sudah ada di tangan. Cowok mana sih yang berani nggak ngasih nomor hape sama cewek manis and imut seantero bumi dan mars. (Hahaha, lebay, narsis, GR and kePDan jadi satu)\n\nAwalnya kikuk sih, paling-paling sms cuman nanya lagi apa, dah makan belum dan beribu kalimat-kalimat nggak jelas yang sudah pasti ketahuan cuman basa-basi doank. Hehehe\nYa, hubungan kita flat dan monotone. Ya iyalah secara gue saat itu belum punya perasaan sama dia. Belum fallin love gitu. Saat itu gue juga punya cowok sebenarnya tapi gue jarang sms an atau pun telepon. Cowok gue ini tipe cowok yang basi abis. Susah diajak bercanda tapi bukan kutu buku atau bintang kelas gitu. Pokoknya basi deh\nSuatu hari, gue sms Widi dan yang bales ceweknya. Waduh, gawat ini ntar difikir gue cewek perusak rumah tangga orang. Eits salah, maksud gue perusak hubungan orang lain. Gue jadi males deh sms dia\nHari-hari gue terasa garing tanpa sms dari dia. Setelah hampir seminggu kita nggak sms an tiba-tiba dia sms\n“Hay Friend.”, tertera kalimat itu di layar hapeku“Waduh, tumben nih anak sms.”, batin gue“Hay juga. Tumben sms nggak takut dimarahin mbak pacar nih. Hahaha.”, balasku“Nggak boleh iya sms? Dah the end.”, jawabnya“Boleh. Hapeku terbuka untuk siapa aja yang lagi buang gratisan. Dah berapa episode kok dah the end sih? Haha“Hahaha, males pacaran sama anak kecil dikit-dikit ngambek. Mending ngejomblo. BEBAS gitu.\nBeberapa hari kemudian gue denger dia deket sama kakak kelas gue. Waduh playboy juga nih anak. Tapi dia malah makin sering sms gue setelah punya pacar baru. Ya sharing-sharing gitu lah. Makin ke sininya kita jadi akrab banget\nKita di kelas sudah kaya tikus dan kucing. Kocak and gokil abis. Tiap hari berantem dan tau nggak kata temen gue dimana ada gue di situ ada Widi. Emang iya? Nggak juga kali\nPokoknya kelas gue nggak pernah sepi dari kegokilan kita. Saking akrabnya gue jadi ngrasa nyaman dan mulai fallin love sama diaTapi gue sadar dia cuman nganggap gue sebagai sahabat, nggak lebih. Dia pun masih punya cewek dan ceweknya itu kakak kelas gue dan sahabat gue juga\nPagi ini dia cerita dia putus sama kakak kelas gue. Dalam hati sebenarya gue seneng banget. Hari ini dia datang ke sekolah dengan muka kusut. Kaya benang aja kusut. Tapi saat jam pelajaran gue nggak lihat dia ada di kelas. Dia bolos. Hellow, masih jaman iya galau karena putus cinta\nBeberapa hari kemudian gue denger dia deket sama temen seangkatan gue tapi beda kelas, Puspa. Hati gue rasanya remuk kaya dilindas truk kontainer full fill. Gue berusaha nutupin perasaan hati ini. Gua dukung dia sama Puspa\n“Hay Sob. Denger-denger Lu deket ma Puspa. Tembak aja Bro, keburu disamber orang loh.”, tantangku“Nggaklah Li, Gue cuman temenan sama dia. Gue masih sayang sam mantan gue.”, jawabnya lemah“Siapa Sob? Yani kakak kelas kita itu?\n“Bukanlah, Tiara. Lu belum kenal dia kok. Udahlah gue pusing, nggak usah bahas-bahas cewek lagi deh. Capek gue.“Oke.”, jawabku singkat seraya ninggalin dia pergi\nDi luar kelas gue melamun. Rasanya hati ini hancur banget denger pernyataan Widi tadi. Tapi gue bertekad buat nutupin rapat-rapat perasaan ini padanya\nPepatah serapat-rapatnya kamu menyimpan bangkai pasti akhirnya akan kecium juga baunya, mungkin benar. Sepandai-pandainya gue nutupin perasaan hati ini akhirnya Widi pasti tau\n“Sorry Sob, kita sahabatan aja ya. Gue lagi banyak masalah and lagi pengen sendiri.”, katanya padaku\nSebenarnya saat itu ingin rasanya air mataku mengalir tapi ku tahan. Aku tak ingin terlihat lemah di hadapannya. Hati ini hancur berkeping-keping. Memang tak ada yang berubah pada diri kita, kita tetap bersahabat tapi rasa ingin memilikinya seakan membuat diri ini ingin menangis saat di dekatnya. Rasa sayang sebagai seorang sahabat kini telah berubah. Aku sangat mengharapkannya, biarlah semua kan indah pada waktunya.", + "Cerpen Persahabatan – Pesawat Kertas\n“Plukk!” pesawat kertas itu jatuh tepat di depannya. “Mana pesawatnya?” ucap Putri. “Emm mana yaa?” jawab Yono. “Siniin dong, plisss!” pinta Putri. “Ya udah deh, nih” ucap Yono sambil memberikan pesawat kertas itu kepada Putri. “Nah gitu dong” ucap Putri manis. Putri pun memainkan pesawat kertasnya kembali\nPutri memang sangat suka dengan pesawat kertas. Entah, menurutnya pesawat kertas adalah hal yang paling menginspirasi dirinya. “Put, kenapa sih main pesawat terus?” tanya Via teman Putri. “Memangnya kenapa?” balas Putri sinis. “Ya gak apa-apa, kamu itu aneh!” ujar Via. Putri segera berhenti memainkan pesawat kertasnya itu. “Aneh kenapa?” ucap Putri tak mengerti. “Liat dong, semua anak main bareng! Tapi kamu? Asik sama dunia pesawatmu sendiri!” gerutu Via kesal. “Tapi? Ini memang aku! Maaf aku gak mau debat sama kamu! Aku lagi puasa” balas Putri sabar. Via hanya diam membatu setelah mendengar ucapan itu dari Putri, dan ia langsung meninggalkan Putri begitu saja\nPutri merenungi apa yang Via katakan. “Ya Allah, apa benar aku ini salah?” batinnya menangis. “Apa aku sibuk dengan duniaku sendiri? Tapi, ini bukan duniaku! Ini hanyalah cita-citaku saja” perlahan ia mulai meneteskan air mata\nKeesokan harinya, saat istirahat pertama Putri masih diam di tempat duduknya. “Put, kamu kenapa?” tanya Nita, teman Putri. “Ehh, gak gak papa kok” ucap Putri gugup. “Kamu dari tadi melamun? Biasanya kamu main pesawat kertas?” tanya Nita penasaran. “Iya, gak papa” ucap Putri tersenyum tipis. Putri menaruh kepalanya di atas meja. “Kamu sakit Put?” tanya Nita khawatir. “Tidak” balas Putri pendek. “Ya sudah kalau begitu, aku keluar ya?” ucap Nita. “Iya” jawab Putri\nPutri masih memikirkan kejadian yang kemarin, saat dirinya ditegur oleh Via. “Put, aku minta maaf” ucap seseorang menepuk pundak Putri. Serentak Putri menoleh ke arahnya. “Eh Via, Iya gak papa” ucap Putri seraya mengelap air matanya. “Putri kok nangis?” ucap Via penuh rasa bersalah. “Enggak gak papa” ucap Putri menenangkan diri. Tanpa berkata lain, Via langsung memeluk erat Putri. “Maaf yaa, kemarin aku ngomong gitu, karena aku ngerasa kamu gak mau deket sama kita” ucap Via berusaha menjelaskan. “Iya, tapi bukan itu maksudku” Putri berusaha menjawab. “Iya, ya sudahlah tidak usah dibahas kembali” ucap Via menyelesaikan\nDari kejadian itu, Putri membuang jauh-jauh tentang keinginannya untuk menjadi seorang Insinyur Pesawat. Putri tak ingin ada temannya yang merasa ia jauhi karena hanya sebuah pesawat kertas! “Mungkin mereka benar, aku hanya sibuk dengan dunia khayalku” ucap batinnya. Putri segera membuang semua pesawat kertasnya ke dalam tong sampah. “Loh Put kenapa dibuang?” tanya Gigih tak mengerti. “Emm, tak apa” balas Putri ringan. “Kamu itu aneh! Kemarin kamu buat pesawat kertas sampai buku kamu tipis? Sekarang malah dibuang? Mubadzir Put!” ujar Gigih menasehati. Putri diam dan tak tahu harus mengatakan apa. Akhirnya Putri langsung berlari meninggalkan Gigih. Hati Putri sangat kacau saat itu, air matanya terus membasahi pipinya. Putri tak habis pikir, semua yang ia lakukan selalu saja salah\nPutri segera mengambil buku diary yang ada di dalam tasnya. “Dear diary, Putri nggak paham sama semua ini. Hati Putri rapuh! Semua yang Putri lakukan selalu saja salah, Putri bingung Putri harus bagaimana?” tulis Putri pada diary tersebut. Setelah selesai menulis diary, Putri segera menaruhnya kembali ke dalam tas\nDetik berganti detik, menit berganti menit, jam berganti jam, dan hari berganti hari. Saatnya Putri kembali untuk masuk sekolah. Hari ini hari bagi Putri melaksanakan tugas piket. “Put, ini diisi dulu absensi kelasnya” ujar Aan. “Iya, taruh saja dulu di mejaku” balas Putri yang sedang menyapu lantai kelas. “Oke” ucap Aan sambil meletakkan absensi di meja Putri. Setelah lantai kelas terlihat bersih, Putri segera mengembalikan sapu di pojok kelas, dan segera kembali ke mejanya untuk mengisi absensi kelas\nWaktu pun berputar dengan sangat cepat, tak terasa sudah saatnya pulang. Putri segera meraih tasnya dan segera meninggalkan tempat duduknya. Ketika Putri sedang berjalan keluar kelas tiba-tiba hujan lebat pun turun. “Yahh? Kok hujan?” ucap Putri dengan nada kecewa. Putri pun memutuskan untuk menunggu hujan itu sampai reda. Setelah menunggu beberapa menit, hujan itu belum juga reda. “Pulangnya bagaimana ini?” hati Putri bertanya. Putri kebingungan karena hujan semakin deras. Seketika Putri memandang langit, Putri segera mengeluarkan buku diarynya. “Dear diary, Langit kenapa kamu nangis? Jangan menangis sekarang, cukup aku saja yang merasakan perih ini. Hentikan sekarang juga tangisanmu, aku sedih jika kau sedih. Kumohonn” tulis Putri pada diary tersebut. Ajaibb! Seketika langit langsung memunculkan senyumannya melalui cahaya matahari. Tanpa berpikir panjang, Putri langsung bergegas untuk kembali ke rumah.Pagi pun telah datang kembali. Saatnya berangkat sekolah. Pagi ini Putri kelihatan sangat lesu. “Kenapa? Sakit?” tanya Nikmah. “Tidak” singkatnya. “Tapi wajahmu pucat pasi” tanyanya kembali. “Sudah biasa” balas Putri renyah. “Biasa bagaimana?” ucapnya penasaran. “Sudahlah lupakan saja” ujar Putri. “Hari ini kamu sangat aneh” ucap Nikmah. “Sudah cukup! jangan bilang aku aneh lagi!” gerutu Putri. “Tapi hari ini? Kau tak seriang yang kemarin” ujar Nikmah. “Ya! Karena aku baru saja kehilangan cita-citaku” ucapnya meneteskan air mata. “Cita-citamu? Apa?” tanya Nikmah penasaran. “Insinyur pesawat” celetuk Putri sambil mengelap air matanya. “Kenapa” tanyanya belum mengerti. “Aku bingung, kau tahu kan? Aku sangat suka dengan pesawat? Tapi banyak orang yang merasa, kalau aku menjauhi mereka hanya karena sebuah pesawat kertas? Hanya karena aku sibuk dengan duniaku?” ucapnya dengan air mata yang mengalir\n“Siapa yang merasa? Aku tidak? Aku mendukungmu” ucapnya menenangkan. “Ya! Memang dia bukan kamu” ucap Putri menegaskan. “Lalu siapa?” tanyanya penasaran. “Sudahlah lupakan saja” ucap Putri membuang muka. “Put, percayalah! Jika Insinyur Pesawat adalah hidupmu, pasti kau bisa mencapainya” ucap Nikmah memotivasi. “Iya, tapi aku bingung” ucap Putri dengan hati tak karuan. Nikmah langsung menyobek kertas bukunya. “Nih, tulis saja apa yang kamu rasakan sekarang” perintahnya. “Untuk apa?” tanya Putri tak mengerti. “Sudahlah lakukan saja” perintahnya kembali. “Baiklah” ucap Putri menyerah\nPutri segera menuliskan perasaannya sekarang di kertas yang diberikan oleh Nikmah. “Sudah. Lalu mau kau apakan?” ucap Putri bingung. Tanpa mengeluarkan sepatah kata apapun, Nikmah langsung melipat kertas itu menjadi sebuah pesawat. “Apa maksudnya? Aku tak mengerti” ucap Putri. “Sudah, ayo ikut aku” balas Nikmah sambil menarik tangan Putri. “Heyy! Mau kemana?” bentak Putri. Nikmah tak menghiraukan suara Putri yang terus berteriak. Dan tiba-tiba Nikmah menghentikan langkahnya di depan Laboratorium Bahasa. “Mau apa sih? Malah kesini?” ucap Putri penuh bertanya. “Kamu itu dari tadi cerewet banget sih?” gerutu Nikmah kesal. “Iya iya deh” ucap Putri mengalah. “Sudah terbangkan pesawatmu disini” ucapnya memerintah kembali\n“Baiklah” ujar Putri. Putri segera menerbangkan pesawat kertasnya itu, dan anehnya pesawat itu langsung menghilang, entah kemana. “Loh? Pesawatnya kemana?” ucap Putri keheranan. “Sudahlah, mungkin sudah sampai ke Allah” ujar Nikmah menghibur. “Okee, mungkin saja” ucap Putri penuh dengan senyum. “Ya sudah, kamu kembali ke kelas dulu saja, aku masih ada urusan sebentar” ucap Nikmah. “Ya sudah, aku kembali” ujarnya sambil berlari kecil. Setelah Putri kembali ke kelas, Nikmah segera mencari pesawat milik Putri tadi. “Ini dia!” ucap Nikmah lirih. Setelah itu Nikmah langsung menyimpan pesawat milik Putri tadi di sakunya\n*Teeet* bel pulang sekolah berbunyi nyaring. Semua murid-murid berhamburan keluar kelas. Tapi beda halnya dengan Nikmah. Ketika bel pulang sekolah berbunyi, ia malah pergi ke perpustakaan. “Hey! Mau kemana kamu?” ujar Putri setengah berteriak. “Emm? Perpustakaan” jawab Nikmah kebingungan. “Ini kan sudah bel pulang? Perpustakaan pastinya sudah tutup” ucap Putri berpendapat. “Biarlah!” celetuk Nikmah. “Ya sudah kalau begitu! Aku pulang!” balas Putri kesal. Putri pun langsung membuang mukanya dan segera pergi meninggalkan Nikmah\nPagi pun telah datang kembali. Hari ini tepat umurnya bertambah menjadi 13 tahun. “Selamat Ulang Tahun Putri” ucap Ibu sambil membawa kue tart. “Wahh, terimakasih Bu” balas Putri sambil mencium ibunya. “Iya sama-sama Put. Ya sudah, pergi mandi dulu sana” ucap Ibunya lembut. “Baik Bu” balasnya menurut\nSetelah selesai, Putri segera bersiap-siap dan segera menuju ke sekolah. Putri berjalan dengan cepat untuk menuju ke kelasnya. “Kok pintunya ditutup? Ini kan masih setengah tujuh?” batinnya bergumam. Putri pun makin mempercepat langkahnya. Ia takut, jika pagi ini ada pelajaran jam nol. Ketika Putri membuka pintu kelasnya, Putri tersentak kaget! Karena teman-teman kelasnya membuat kejutan yang sangat spesial. Putri tercengang, memandangi setiap sudut kelasnya. “Pesawat kertas?” ucap Putri agak keras. “Maaf ya Put, sebenarnya kemarin aku membaca isi pesawat kertas yang kau terbangkan di depan Laboratorium Bahasa” jelasnya meminta maaf. “Kau membacanya?” tanya Putri. “Maaf Put” ucap Nikmah kembali\n“Tak apa. terimakasih atas semua ini. Aku suka” balas Putri penuh senyuman. “Iya Put sama-sama. Happy birthday sahabatku” ucap Nikmah seraya memeluk Putri. “Terimakasih” balas Putri sambil memeluk Nikmah juga. “Putriii..” panggil seseorang. “Via?” ucap Putri sambil menoleh ke arahnya. “Happy birthday yaa” ujarnya sambil menepuk pundak Putri. “Iya, terimakasih” balas Putri. “Maaf ya Put, kemarin aku melarangmu untuk..”. “Sudahlah tak apa” ucap Putri memotong perkataan Via. “Baiklah” ujar Via. “Put.. ini semua sebenarnya ide Via” ucap Yono tiba-tiba. “Oya?” celetuk Putri. “Iyaa Put” timpal Nikmah. “Terimakasih Via. Ini sangat amazing!” ujar Putri sambil memeluk Via. “Iya Put sama-sama” balas Via tersenyum manis\nAkhirnya, Putri dan teman kelasnya pun bergembira bersama dan bersenang-senang dengan semua pesawat kertas!!", + "Cerpen Perpisahan – Senyummu Tangisku\nAku tak ingin dirinya pergi, aku tak ingin melepas cinta yang telah tercipta.. namun begitu banyak masalah harus merelakan semuanya. Aku termenung di bawah rindang taman kota, semilir angin berhembus melambaikan rambutku\n“hey alifah sudah lama kamu di sini?” seorang pria datang dengan bunga dan beberapa makanan kecil di tangannnya“aku baru datang juga kokia tak akan pernah tahu sudah berpa lama aku menunggu.” batinku sedikit\n\nIa menyerahkan bunga dan kami terdiam. “gimana fred, apa kita masih bisa tetap bersama selamanya?, sedangkan orang tuamu menolak dan mengusirku. tanpa alasan” aku berkata memulai pembicaraan\nAlfred duduk disampingku dan termenung beberapa saat. “maafkan aku alifah, aku takut untuk mengatakan ini, tapi kamu tahu kan, orang tua ku tak mengizinkan hubungan kita.” alfred berkata sambil menahan senyum palsunya\n“Sudahlah fred, aku kan sudah bilang, ini bukan jalan terbaik untuk kita, kamu pergi saja dan jangan hiraukan aku.” aku berkata menatap matanyaSepi sekali disini, kami termenung seakan tak saling mengenal setelah sekian lamanya kami menjalin hubungan terlarang ini\nTiba-tiba sebuah kendaraan berhenti dan seorang turun menghampiri kami, ternyata mereka adalah orang tua alfred. Kami berdiri saling berpandangan, dan alfred berjalan lunglai menghadap orang tuanya\nMamanya alfred membisikan sesuatu ke kuping alfred, dan ia berlari ke depanku menatap dan hening beberapa saat\n“maafkan alifah, kamu membuatku tak fokus pada sekolah dan nilaiku berantakan, selamat tinggal. jagan hubungi aku lagi” alfred berkata dan melepaskan tangannya dan berlalu dengan perlu\nBeberapa bulan kemudian\n\naku termenung di kamar. beberpa kali mamaku mengajakku makan, namun aku tak bernafsu. Hp di samping tempat tidurku berdering “halo, ini aku alfred!” Sebuah suara di seberang sana\n“ia kenpa fred” aku berkata singkat memendam semua perasaan dan rindu yang bergejolak\nAlfred bicara panjang lebar dan aku hanya berkata “ya atau tidak?” aku hanya tak ingin mengulang rasa yang telah mati\nAku hanya katakan padanya aku mencintainya sepenuh hatiku. Dan sebagainya\nAku tak ingin alfred tahu kalau sekarang aku telah pindah ke jakarta meneruskan kuliah serta mencoba melupakan semua tentang masa lalu dengannya.. masa di mana aku merasa sangat berarti, dan semua terasa indah.", + "Cerpen Perpisahan – Kegagalan\nPerlahan ku buka sampul binder dari dalam tumpukan baju dalam lemari ku. Di lembar pertama terlihat jelas tulisan lamaku, sebuah kisah luka dengan gambar “Teddy Bear” di pojok kanan atasnya. Tanggal ini dua tahun lalu, tertulis jelas di atas kiri kertas di halaman pertama itu\nSekilas teringat kenangan saat tanggal dalam tulisan binder itu terjadi. Malam itu turun hujan. Seolah Allah memang telah merencanakan kegagalan urutan jadwal yang telah aku susun sehari sebelumnya. Padahal di siang hari sang sumber panas bumi bersinar sangat terik, menandakan tak akan turun hujan hari itu hingga malam. Kini aku sadar, Allah memang sudah mengatur semuanya agar rencana ku batal semua\nAku ingat betul janji Verli yang akan mengajak ku menemui ibunya dihari itu. Sedikit heran memang dengan sikapnya seminggu terakhir sebelum peristiwa itu terjadi. Ia lebih perhatian dari biasanya. Sikapnya manis\n“Nanti aku SMS kamu ya yanq, kalo aku sudah siap mau jemput kamu” Smsnya hadir mengisi layar handphone ku\n“ok. Jam berapa kira-kira kamu jemput aku?\n“ya nanti aku kasih kabar dech\n“kamu lagi apa sich yanq?\n“aku lagi tiduran.\n“haaah? Emang kamu mau jemput aku jam berapa sich? Ini hampir jam satu” aku mulai naik darah. Mau jam berapa lagi dia menjemputku, kalo jam satu siang saja dia masih berbaring santai di ranjang empuknya itu. Sedangkan aku dari tadi mondar-mandir merapikan baju dan make up q\n“Sayanq… Please. Sabar yaa, nanti aq kasi kabar. OK?\naku benar-benar kesal. Segera ku stater scoopy ku\n“Uukh,.. tau gak sich? Verli tu bener-bener ngeselin…!” oceh ku ketika Mini membukakan pintunya setelah mendengar ucapan salam ku yg berulang-ulang\n“Please deh non, jangan marah-marah di sini ya. Aku bukan tempat pelampiasan tau?” Balas Mini dengan nada malas\nAq langsung nyelonong kedalam kamarnya, dengan meraih bantal guling bergambar Hello Kity, q hempaskan tubuhku di atas spring bad Mini\n“Yaa ella… kamu tuh udah cantik, koq malah tiduran? Mau kemana si non?\n“Verli tuh ngeselin banget. Dia janji mau ngenalin aku ke nyokapnya. Tapi di ulur-ulur mulu’. Biasanya dia udah nongol dari jam 11 siang. Ini udah hampir jam 2 dia masih belum nongol. Dari tadi bilangnya mau ngabarin kalo dia udah siap jemput aku. Tapi mana…?\n“Mungkin masih ada yang harus disiapin sama nyokapnya. Secara mau ketemu calon mantua. Hihihi\n“Aku mau numpang mimpi disini\n“OK. Ayooo mama temeni bobok” ucap Mini menggoda ku\nTut…Tut…Tut…\n\nSegera ku raih hp ku yang sedari tadi ku selipkan di bawah bantal\nSayang, Ntar malam aja ya aku jemput kamu. Mama baru pulang tuh\n\nDiterima :\n\n16:12:27\n\nHari ini\n\nDari\n\nChayanq q\n\nAstaga, sudah jam empat lewat. Tapi dia malah membatalkan janji. Darah ku seakan-akan sudah berada di atas kepala. Air mata hampir tumpah karena menahan emosi\n“Mini sayang, aku pulang ya” kugoyang-goyangkan badan Mini berharap ia segera bangun untuk mendengar tangisanku\n\n“eemmm.. Iya.. ati-ati yaa. aku ngantuk banget. See You sayang\nUkh… Tega kamu Min. Aku lagi galau tau’? bangun dong… Pinta ku dalam hati\n\nDengan berat hati ku tinggalkan ruang 3X4 berwarna pink ini. Malas rasanya pulang kerumah. Mood ku bakal bertambah buruk. Apa lagi dengan ditemani foto-foto Verli\nEntah apa rencana Tuhan hari ini. baru saja aku melangkahkan kaki didalam istana ku, turun rintik hujan di iringi angin yang menusuk hingga kedalam tulang. Ini pertanda buruk fikirku. Semoga hanya fikirku. Semoga\nBenar saja. Hujan bertambah semakin deras. Fikiran dan perasaan ku semakin gak karuan. Verli masih tetap tak memberi kabar, padahal timer di layar hp ku sudah menunjukkan angka 19:19. Pasti hujan yang akan menjadi alasan utama saat ia menghubungi ku nanti\ntut…tut…tut… segera ku sambar hp ku setelah nada SMS berdering\n“Yanq, Hujan :(\nApa kataku. HUJAN. Yaa Hujan, aku tau koq, gerutuku dalam hati. Aku terdiam sesaat memikirkan kata-kata yang akan ku ketik untuk balasan SMS menyebalkan itu. Terlalu banyak rasanya emosi yang akan aku sampaikan lewat layar mungil itu. hingga akhirnya kuputuskan untuk menelponnya saja\n“Hallo” Suara lembut penuh ketenangan khas Verli terdengar\n“Kamu tuh ya… jangan mainin perasaan aku donk!\n“Yanq, hujan. Kamu gak mungkin mau hujan-hujanan kan saat ketemu sama mama? Lagian aku takut kamu jadi sakit\n“Iya aku tau koq kalau sekarang hujan. Tapi itu kan salah kamu. Aku udah nungguin kamu dari tadi siang. Tapi kamu nunda-nunda mulu’. Kayaknya kamu emang sengaja dech…!\n“Yanq… tolong dong ngertiin aku. dikit aja\n“harus sampe kapan sih aku ngertiin kamu…? kamu tuh yang gak pernah bisa ngertiin aku..! Kamu emang gak niat kan mau ngenalin aku sama mama kamu?!\n“OK. OK. Aku yang salah, aku minta maaf\n“Bosen tau dengerin ucapan maaf dari mulut kamu. Selalu cuma itu yang kamu lakuin…!\n“Jadi aku harus gimana?\n“Terserah kamu dech maunya gimana. Aku ngikutin aja apa maunya kamu. Aku tau koq, mama kamu pasti gak setuju sama aku. makanya kamu nunda-nunda mulu dari tadi.\n“Yanq bukannya gi…\n“Kenapa gak bilang dari dulu aja kalo kenyataannya emank gitu. Pasti aku gak akan berharap banyak dari kamu dan mungkin sekarang aku udah ngelupain kamu.\n“Yanq, dengerin dulu. Aku bener-bener minta maaf. Aku gak tau kalo kenyataannya harus kayak gini. Kamu bener, mama aku gak bisa terima kamu. Tapi aku sayang kamu Ve…\nPadahal aku hanya asal berucap, tapi nyatanya itu benar. Air mataku sudah tak mampu ku bendung. Untuk meluapkan emosi dalam bentuk cacian pun aku sudah tak sanggup. Kata-kata itu hampir keluar tapi tertahan di kerongkongan ku\n“Ve… Pliss jangan nangis. Aku juga berat mau jalanin semua ini. Jujur, aku sayang banget sama kamu Ve…\nAku tak menjawab apa-apa. Aku hanya mencoba menangkan hati ku\n“Ve… Veli… kita jalani hubungan ini sembunyi-sembunyi aja ya. Ve… Pliss jawab aku. Yanq…\nUcapan lembut Verli malah membuat aku semakin sakit. Air mata yang hampir tertahan pun malah semakin leluasa mengalir\n“Ki… Ta.. Pu..Tuss.. I…ngat… Ver, Hu..kummm… Kar…ma pas…ti …ber…laku. En…tah… p…da a..na…kmu ke…lak a…ta…u pa…da a…dik..mu… Ba…la…sa…n pass..sti a…ka..n le..bih me…nya…kitkann” susah mati aku mencoba bersuara\n\n“Yanq… Jangan putusin aku\n“Gak…!\nTut…Tut…Tut…\n\nSambungan telphone langsung ku matikan. Kutumpahkan semua luka dalam sapu tangan biru hadiah ulang tahun pemberian Verli. Menggunakannya justru malah semakin membuat kenangan manis hari kemarin terukir jelas dalam bayangan mataku. Kini sapu tangan itu kulipat rapi di bagian dalam cover Binder ini\nBeruntung setelah kepergiannya, Allah mempertemukan aku dengan Dino. Lelaki sempurna yang akan menjadi ayah dari janin yang sedang ku jaga dalam rahimku. Kukira aku akan mati, depresi atau bahkan gila setelah berpisah dari Verli. Sekali lagi aku benar-beanar bersyukur. Mungkin jika kami masih menjalin hubungan, aku tak akan pernah menemukan imam terbaik seperti Dino\nBelakangan ku dengar adik perempuan Verli satu-satunya telah hamil tanpa tahu siapa ayah dari janin itu. Aku sempat menyesal pernah mengucap sumpah seperti itu. Mungkin ini bukti Tuhan, hukum karma pasti berlaku.", + "Cerpen Perpisahan – Kaulah Segalanya Di Hidupku\nPerlahan aku berjalan menaiki jalan setapak menuju sebuah danau, bau tanah dari rintik hujan menemaniku menjelajahi petualangan tersebut.. Aku tersenyum melihat sesosok pria telah menungguku. Aku mempercepat langkahku, mencoba menghadapi lebih cepat, tak peduli hujan yang semakin deras, dan beceknya tanah khas pedesaan mengotori rok panjang putihku.\n“Dor~!! Hayo?, ngelamunin aku ya?” ujarku berniat mengagetkannya. “Kamu kok telat banget sih? Tuhkan udah tambah gelap. Lilinnya udah mati semua… terkena air hujan tuh!” jawabnya sambil menatap terus kearah lilin-lilin kecil yang telah padam terkena air hujan. “Lilin berwarna merah, warna kesukaanku”, kataku sambil terus memandangi kearah lilin-lilin kecil yang beberapa telah ditatanya sedemikian rupa membentuk hati, “ya memang lilin-lilin itu sangat indahAku melihatnya sekilas sebelum mati satu persatu. Namun, menurutku, lebih indah melihat senyumannya daripada lilin yang telah padam tersebut. Jauh lebih nyata dan indah.. “Aneh ya? tadi tuh di sekolah panas banget! Sekarang disini hujan..” ujarku memperbaiki suasana.. “Haha, matahari sama hujan kan kuatan matahari..” jawabnya tersenyum, “Kamu lama ya nunggunya? Aku minta maaf banget!” Kataku memohon, “Nggak kok.. baru aja.. aku cuma bercanda tadi” katanya sambil terus tersenyum.\n“Maaf ya kemarin aku gak bisa temani kamu check up ke dokter, aku ada pelajaran tambahan, gimana kata dokter?” tanyaku dengan lembut namun dengan nada khawatir. “Nggak apa-apa kok.. Aku baik-baik saja, aku akan selalu baik-baik saja kalau bertemu sama kamu” ujarnya sekali lagi dengan senyuman jahil khasnya.. “Ya maunya”.. yah aku tau keadaannya.. Dia kuat di luar namun rapuh di dalam.. Entah apa yang membuatnya selalu tegar menghadapi cobaan tersebut. Seolah kehabisan kata-kata kita hanya terdiam\nSore itu, aku dan kekasihku Justin, mengunjungi danau favorit kami.. tempat dimana kami pertama bertemu, berkenalan, bahkan mengerjakan segala hal bersama-sama. Danau Abadi. Ya begitulah Justin menamakan Danau itu. Memang terdengar aneh, berapa kali aku menanyakan mengapa dia menamakan seperti itu, dan Justin menjawab “Agar nanti saat aku tak ada lagi kamu tetap ada mengenangku di masa-masa dimana awal kita bertemu, sampai saat ini”Sekali lagi dia menjawabnya dengar senyuman jahil khasnya, “Kamu pernah nyadar gak ada sesuatu di danau ini?” tanyanya kepadaku, “Nyadar apaan? perasaan selama 4 tahun kita pacaran keadaan danau ini baik-baik aja deh..” kataku, “Dasar gak peka! Itu lho.. berang-berangnya!.. Aneh aja, masa musim panas gini main di danau..” jelasnya, “Apanya yang aneh? perasaan dari dulu deh kayak gitu..” ujarku nggak ngerti.. “Bukan itu maksudku.. mereka itukan sepasang dari dulu.. aku perhatiin mereka itu saling setia rasanya.. mereka gak pernah ganti pasangan.. Kamu mau nggak, kalau aku udah nggak ada nanti, kamu mau kan cari orang lain buat jagain kamu? yang lebih sehat dan gak sakit-sakitan?: pertanyaannya membuat ku tereguh.\n“Aku gak pernah berfikiran hal itu..” batinmu.. “Dulu, Justin itu optimis, tegar, kemana Justin yang dulu?” tanyaku kepada Justin, “Sebentar aku belum selesai.. aku hanya berjaga-jaga.. Nanti kalau aku sudah tidak ada, supaya kamu tak ragu untuk mencari penggantiku..” Jelasnya dengan nada lirih.. “Justin.. kamu harus optimis. Coba lihat matahari itu, Dia memang selalu terbit dan terbenam tiap hari.. Ibaratkan matahari itu kamu, itu tandanya kalau ada terang kan setelah gelap! Pasti ada harapan buat kamu, sekecil apa pun itu!” Ujarku, “Aku gak akan baik-baik saja.. tetapi aku akan selalu berusaha baik untukmu..” ujarnya kepadaku, akupun meneteskan beberapa butir air mata yang tak kuat ku tampung lagi, segera ku hapus sebelum dia melihatnya.. “Aku akan selalu menyanyangimu..” kataku yang segera memeluknya, “Danau ini abadi, berang-berang ini abadi, begitu juga cinta aku ke padamu akan selalu abadi.. Carilah seseorang yang lebih baik dariku suatu saat nanti..” katanya seraya menghapus air mata dari pelupuk mataku.. Air bening yang keluar dari pelupuk mataku sudah tak kuat ku bendung.\n“Hey! Sedang apa?” Kata Danny, menepuk bahuku, “Hah? Tidak.. Aku hanya sedang ingin mengingat kenangan ini.. dari diaryku..”, “Itu lagi? Kisah cintamu.. kekasihmu yang sudah meninggalkanmu.. dan segala-galanya dalam hidupmu.. akan abadi seperti danau ini.. tegarlah.. sudah 2 tahun kau seperti ini.. bangkit dan semangat!” kata Danny, sahabat terbaikku.. “Ya.. aku dan segala-galanya dalam hidupku akan abadi seperti danau ini..”", + "Cerpen Remaja – Masih Amatir\nSiang itu aku berjalan dengan santai menuju ruang guru untuk melaksanakan tugas yang telah diamanahkan kepadaku, tak terbebani sama sekali aku ini namun mata-mata yang curiga dan sok tau itu menilai dengan salah, saya memang agak terkesan loyo, lemah, dan putus asa namun itu hanyalah penampilan yang dilihat secara langsung tanpa adanya perhatian yang lebih khusus\nSesuai dengan kebiasaan sehari-harinya akupun melaksanakan kegiatan yang aku asumsikan sebagai kegiatan selain belajar yang bermanfaat di institusi ini, yah membaca mungkin bagi sebagian orang membaca itu sama saja denagan belajar namun itu sangatlah berbeda. Ketika kita belajar yang kita pelajari hanyalah mengenai masalah yang telah dicantumkan di kurikulum guru tidaklah boleh melewati batasan yang telah ditetapkan itu. Di kalangan guru aku memang tidak populer dan tidak ramah namun dengan pengurus perpustakaan merekalah yang melempar senyum dan kuberi balasan\nSeperti biasanya saya mencari buku yang sedang ingin saya baca atau melihat apa asa yang menarik atau tidak. Buku yang kucari tak kunjung menampakkan dirinya dan pada akhirnya ku temukan buku terebut namun sayangnya sedang dibaca. Ke menatap wanita tersebut dan mungkin karena tak merasa enak dia melihatku dan berkata “ada apa melihat saya dengan begitu?”. “oh tidak, saya hanya melihat buku itu” jawabku. “oh yang ini, buku ini cukup bagus” tanggapnya\nSetelah itu kami mengulas buku tersebut, aku memang sudah membaca namun belum selesai. Bel istirahat berakhir pun menyapa telinga kami yang mengingatkan pertemuan ini berakhir\nSetelah sampai di rumah aku pun mulai berpikir dan selalu mebayangkan wanita tersebut yang namanya adalah Yani. Besoknya di sekolah aku tak pernah melihat wanita ini lagi. Tak lama kemudian ketika di rumah hal yang tak terduga terjadi nada pesan handphoneku pun berbunyi dan ternyata itu adalah dia, aku pun mulai berkomunikasi dengan baik dengannya awalanya kamu hanya membahas topik yang umum hingga kemudian kami membahasa masalah pribadi dan tak terduga aku pun mulai memiliki perasaan kepadanya\nDunia memang bekerja dengan caranya yang benar-benar rahasia, terkadang kita tak menyadari apa yang telah dia perbuat kepada umat manusia dan apa yang umat manusia lakukan kepadanya. Hari berlalu, minggu berlalu, dan hampir sebulan sudah aku berkomunikasi dengannya dan jiwaku seakan hanya ingin diberikan makan oleh suaranya\nMalam itu aku pun memutuskan untuk menyatakan perasaan ku yang sebenarnya memang ini masih jarang ku lakukan dan mungkin itu pula alasannya aku gagal dia hanya mengatakan agar tetap berusaha siapa tau saja perasaannya muncul. Ketika sedang membahas suatu pembahasan dia tiba-tiba membahas orang lain yang merupakan teman dekatnya yang bernama Rani dan dia mengatakan perasaan sebenarnya mengenai temannya itu. “sebenarnya Rani itu munafik dia merebut gebetan temannya meski tau temannya sangat menyukai si Rudi, aku sih mau aja ngasih tau si Rudi gimana sih si Rani itu tapi biarin aja deh nanti kebaikan akan muncul” itulah yang dia sampaikan kepadaku, Rudi merupakan siswa lain yang keren, kaya, dan baik. Akupun meladeni dengan membahas temannya tersebut, sebenarnya bukan membahas namun menceritakan aib si Rani\nBulan berikutnya aku pun mulai berpikir bahwa Yani ini tidaklah pantas untukku dan tidak ada wanita yang pantas untukku dan aku pun memutusakan untuk jaga jarak dan mulai melupakannya\nPemikiranku bukannya tidak beralasan namun terkadang ketika berbincang dengannya dia masih merasa aku ini orang asing dan sedikit menutup masalah pribadinya dariku dan hanya membahas masalah sosial dan pelajaran di sekolah\nHampir dua minggu aku tak memberikan untaian sapa yang hangat dan perasaanku seakan membunuhku karena aku menjauhinya dengan alasannya yang merupakan asumsi pribadiku sendiri saja. Pekan Olahraga dan Seni di sekolahku dimulai, ketika itu aku mendukung teman sekolahku yang sedang tanding futsal dan Yani dan temannya Rika duduk di sisi lapangan yang satunya dengan bercanda gurau\nSesekali aku menatapnya dan ketika aku menatapnya dia juga menatapku. Sesampainya di rumah pesan singkat mampir di telpon genggamku dan kucoba mengecek dan ternyata itu adalah Yani. Hubungan kami pun kembali seperti dulu dan malah agak semakin dekat, aku juga menyempatkan waktu untuk menonton pementasan dramanya, rencananya aku ingin mengantarnya pulang namun dia menghilang\nAku pun menuju rumah dan menelponnya, aku pun bertanya dimana dia dan sama siapa pulang dan mengatakan dia sudah pulang dengan temannya, ketika aku mengatakan “tadi rencananya aku mau nganterin kamu pulang tapi kamu menghilang” dia tidak memberikan respon apapun dan disinilah mulai dugaanku yang sebenarnya bermulai namun masih ku kesampingkan karena cinta itu memang telah membutakan manusia yang satu ini\nDulunya aku dan dia hanya sekedar berkirim pesan singkat dan terjadi peningkatan intensitas komunikasi di antara kami, kau sudah telpon-menelpon dan hubungan kami telah seperti pacaran karena hampir seharian kami telpon menelpon\nHari itu merupakan dua hari terakhir tahun 2012 dan aku terus menghubunginya namun telponnya tidak diangkat dan pesanku tidak dibalas padahal besoknnya merupakan hari ulang tahunnya. Akupun takut terus menelponnya karena nanti menganggunya\nPamanku dan sepupuku pun menawari tahun baru di rumah pamanku dan aku pun setuju untuk ikut, meski bergitu aku masih terus menghubunginya karena perasaanku yang sedang tidak enak dan penasaran dengan keadaanya dan plus hari tersebut merupakan hari ulang tahunnya\nAku pun mengikuti firasatku yang mengatakan dia sudah tidak ingin dekat denganku pun ingin kubuktikan dengan mengirim pesan kepadanya dengan menggunakan nomor telpon sepupuku, meski hanya pesan yang sangat singkat dan tidak berguna dan dari orang yang tidak dikenal ternyata dia balas, perasaanku pun hancur ketika itu juga, namun aku menyembunyikan ekspresiku karena nanti akan berakibat buruk di depan pamanku dan keluarganya serta sepupuku\nSesampainya dirumah pamanku setelah merayakan tahun baru diluar aku mencoba menghubunginya dengan nomor telponku sendiri dan ketika dia mengangkatnya aku pun hanya mengatakan “kamu tadi lagi bikin apa? Kok gak ada info?”. “Maaf aku lagi sibuk sekarang baru available” balasnya. “oh kalau gitu udah dulu” aku menjawab dengan nada rendah. Aku menjelaskan yang telah aku lakukan, dan selidiki dengan pesan kepadanya dan dia pun ternyata membalas dengan mengatakan selama ini aku sudah berusaha dan ternyata perasaanku tetap sama\n“Muke gile, dia kira gue goblok apa? Gua ini introvert gue ngerti lagi yang loe maksud, gue gak naif meski gak berpengalaman di urusan percintaan, mana mungkin loe ngasih jawaban seperti itu secepat itu, pasti ada yang udah terjadi” itulah yang kukatkan dalam hatiku\nSeminggu liburanku terasa sakit luar biasa yang diakibatkan cinta ternyata hal seperti itu juga melandaku setelah aku memutuskan melupakan dia pernah menjejakkan kakinya di hatiku, alasan utamanya mengatakan hal tersebut ketika tahun baru pun baru kuketahui sebulan kemudian ketika aku menstalk twitternya, dia mengatakan dan meretweet dengan tegas twit yang terbaca “Kalo gebetan sudah sebulan gak jadi pacaran berarti Cuma dijadikan pelarian” meski sakit namun terasa segar karena telah jelas aku ini telah menjadi korban apa. Beberapa minggu kemudian dia telah terdengar dan terlihat telah berpacaran dengan Rudi\nBetapa luar biasanya kisah ini, aku dijadikan pelarian dari seorang wanita yang sedang menunggu pria yang disukainya yang sedang pacaran dengan temannya, dan tahun baruku juga ikut hancur. Masih ada satu hal yang membuatku penasaran yakni mengapa aku yang dia pilih menjadi korbannya\nDan itupun terjawab beberapa hari kemudian, aku mengingat ketika dia mengingatkanku dengan temannya yang aku permainkan ketika masih SMP karena dia juga merupakan siswa yang dari SMP yang sama denganku, mungkin itu pertanda niatnya yang sebenarnya namun waktu SMP aku masih sangat bodoh jadi tak dapat mengerti perasaan orang lain. Aku pun merasa ini sudah adil dan ini adalah hukuman namun hukumannya benar-benar parah\nSkenario yang luar biasa Yani dan aktingmu luar biasa.\n***" +] \ No newline at end of file diff --git a/node_modules/dhn-api/database/couple.json b/node_modules/dhn-api/database/couple.json new file mode 100644 index 000000000..348d3cd0e --- /dev/null +++ b/node_modules/dhn-api/database/couple.json @@ -0,0 +1,114 @@ +[ + { + "male": "https://i.ibb.co/HGZqdzb/9b8278060e2d.jpg", + "female": "https://i.ibb.co/V3kX3Cv/bf29432e6e21.jpg" + }, + { + "male": "https://i.ibb.co/NFPKcPj/6d61f9c4cede.jpg", + "female": "https://i.ibb.co/FwRqPDn/206818911fdd.jpg" + }, + { + "male": "https://i.ibb.co/yQzxptw/7faabc24c6ff.jpg", + "female": "https://i.ibb.co/2Yk4P2B/47fd82f61fd1.jpg" + }, + { + "male": "https://i.ibb.co/cNhsYRV/7bff8e448134.jpg", + "female": "https://i.ibb.co/j37Sc7X/a9600c228a8b.jpg" + }, + { + "male": "https://i.ibb.co/DbMk8nL/957395cbf134.jpg", + "female": "https://i.ibb.co/LQ4WJMR/f13a01cc7301.jpg" + }, + { + "male": "https://i.ibb.co/ypvdYHW/7905e485ff20.jpg", + "female": "https://i.ibb.co/4Z5rJrn/465bf6b56d86.jpg" + }, + { + "male": "https://i.ibb.co/3pKd9jZ/527105aba87a.jpg", + "female": "https://i.ibb.co/M9B742X/f608cecc4265.jpg" + }, + { + "male": "https://i.ibb.co/Jn3tkg8/a1aab3d67644.jpg", + "female": "https://i.ibb.co/CWx3NYc/8ad244372d8f.jpg" + }, + { + "male": "https://i.ibb.co/CbdscQp/5918b5b3b674.jpg", + "female": "https://i.ibb.co/ZWjNrZt/8257e3c9ffc0.jpg" + }, + { + "male": "https://i.ibb.co/8069RmW/cfe9ed16a5b4.jpg", + "female": "https://i.ibb.co/gPFp1DG/0e16334be10c.jpg" + }, + { + "male": "https://i.ibb.co/P1SsfbG/a12d71cd6b9a.jpg", + "female": "https://i.ibb.co/p4Xp2Xh/d7f6c5420b7a.jpg" + }, + { + "male": "https://i.ibb.co/P17CTF9/924deeb25a3d.jpg", + "female": "https://i.ibb.co/r55xYdy/8ee97786e6f8.jpg" + }, + { + "male": "https://i.ibb.co/WykFqbW/57f78370f1e2.jpg", + "female": "https://i.ibb.co/FWSCd2C/81e637d4a839.jpg" + }, + { + "male": "https://i.ibb.co/rf6pKtp/53a463d8ebe9.jpg", + "female": "https://i.ibb.co/Z2bDP7m/48990865816b.jpg" + }, + { + "male": "https://i.ibb.co/RYB9JWG/4428e27ef288.jpg", + "female": "https://i.ibb.co/LCnJfT7/5732f5315f2f.jpg" + }, + { + "male": "https://i.ibb.co/3CLJfw3/151663d07c51.jpg", + "female": "https://i.ibb.co/zXsJQ8R/96d088d2e0a0.jpg" + }, + { + "male": "https://i.ibb.co/rxBN0S5/bd3b07b67ad6.jpg", + "female": "https://i.ibb.co/6BYPMjC/4b36a8dfca20.jpg" + }, + { + "male": "https://i.ibb.co/NW2dv07/58348a3d4008.jpg", + "female": "https://i.ibb.co/sHkDdGd/87db7aaff335.jpg" + }, + { + "male": "https://i.ibb.co/b3sMMnW/a13cdff40c6e.jpg", + "female": "https://i.ibb.co/LgPn4vL/257ab65eb79d.jpg" + }, + { + "male": "https://i.ibb.co/JzMhQ2P/45754b045a6d.jpg", + "female": "https://i.ibb.co/nmftFnS/a1f2218f7c32.jpg" + }, + { + "male": "https://i.ibb.co/R72GdTZ/30ebace5e0c1.jpg", + "female": "https://i.ibb.co/7Rnb3Y0/d1459d6b3f59.jpg" + }, + { + "male": "https://i.ibb.co/SmMvhb5/da465242e083.jpg", + "female": "https://i.ibb.co/4gK0fVL/da35fc940b11.jpg" + }, + { + "male": "https://i.ibb.co/Tbj6tzF/e93d133529d5.jpg", + "female": "https://i.ibb.co/wwpFfqH/98bc4eb86562.jpg" + }, + { + "male": "https://i.ibb.co/CJpdHyJ/348e5a66c088.jpg", + "female": "https://i.ibb.co/9wd2mTM/fd4b6af0ccac.jpg" + }, + { + "male": "https://i.ibb.co/Xkp1wx5/3a15abeb6394.jpg", + "female": "https://i.ibb.co/8mzjZrt/3b2d60d15de4.jpg" + }, + { + "male": "https://i.ibb.co/mSMmmGx/300e252914f3.jpg", + "female": "https://i.ibb.co/LvTRt2w/c8f8d0b98c70.jpg" + }, + { + "male": "https://i.ibb.co/LpctfNL/e1a158f621ba.jpg", + "female": "https://i.ibb.co/YXpvh3j/2a91663a9f0a.jpg" + }, + { + "male": "https://i.ibb.co/xgTsmW8/7ca77ee661d6.jpg", + "female": "https://i.ibb.co/DMPWv4S/e3af8d2a6673.jpg" + } +] \ No newline at end of file diff --git a/node_modules/dhn-api/database/darkjoke.json b/node_modules/dhn-api/database/darkjoke.json new file mode 100644 index 000000000..7e0e0a5a3 --- /dev/null +++ b/node_modules/dhn-api/database/darkjoke.json @@ -0,0 +1,51 @@ +[ + "https://1.bp.blogspot.com/-TNGZGhSt_zI/X93Q4iKhQxI/AAAAAAAAVF4/L4rB8enc1HoFy5aXkvomfmxcR30kygKrACNcBGAsYHQ/s578/91913235_2830089170435663_4447843912417017856_n.jpg", + "https://1.bp.blogspot.com/-ZzhsovG6VQk/X93Qx6IXevI/AAAAAAAAVEY/oaPiOAPc8bU5L-Y5ec8zbtbvLeNEHYrlQCNcBGAsYHQ/s644/119497256_3289016287876280_933166537923688142_n.jpg", + "https://1.bp.blogspot.com/-hsAyoXFk5zs/X93QyywTwNI/AAAAAAAAVEk/dX567Ty7as09ik9xFviAf149KDI_VP23gCNcBGAsYHQ/s882/126930872_3494159250695315_2911318968773005963_n.jpg", + "https://1.bp.blogspot.com/-pOFY-ix58m0/X93Q0JXU_pI/AAAAAAAAVE0/XuehXz15kvMd0XXr3j28Uumlmf1KNwsFwCNcBGAsYHQ/s880/130285630_3533164500128123_8252253712135313050_n.jpg", + "https://1.bp.blogspot.com/-1MFwlkScLrI/X93Q1YblbBI/AAAAAAAAVFI/53P14xUzjwg5qJmdM4hTScslb8F8kxk_wCNcBGAsYHQ/s640/131951890_987790505043716_8334230285575794663_n.jpg", + "https://1.bp.blogspot.com/-ay00cMZrKOg/X9zzOPssmNI/AAAAAAAAUs0/qw3LkxYWZF8KmgM35uW3REByQKsGVMCJgCNcBGAsYHQ/s1080/meme_indonesia_gokil_130197811_250172589829349_4517924538788816617_n.jpg", + "https://1.bp.blogspot.com/-tzbh1u0Q0x0/X9zzSQ7ctPI/AAAAAAAAUtw/NfPFuKuRHLcXhNqDRLg5jEz3xx-G0cHywCNcBGAsYHQ/s1080/meme_indonesia_gokil_130559598_213820970312403_6565488242261858116_n.jpg", + "https://1.bp.blogspot.com/-BMoEg6cuBEA/X9zzS9kPYPI/AAAAAAAAUt0/V-oFvC1fyZY4W1_eicICtPEYQaXte9fwQCNcBGAsYHQ/s509/meme_indonesia_gokil_130574163_904871143585505_1836659838467416563_n.jpg", + "https://1.bp.blogspot.com/-BAuB7v9xDCc/X9zzTMMSGpI/AAAAAAAAUt4/vOiTozBkqVgT9V0MxS5HxDQXCt4tcy8KQCNcBGAsYHQ/s1343/meme_indonesia_gokil_130578626_1345636132445352_756377830767725509_n.jpg", + "https://1.bp.blogspot.com/-dVhqXKKa1ik/X9zzTSL1-2I/AAAAAAAAUt8/uXVO3gkS_zEngJO3pLsY-DZdfJqkNY3ogCNcBGAsYHQ/s320/meme_indonesia_gokil_130604522_394506938442748_2107040976320013530_n.jpg", + "https://1.bp.blogspot.com/-Md9rd0s1rRI/X9zzUSVOmGI/AAAAAAAAUuY/R32n1YFCLckpLgPJ5AvI3qObcK1O9P1twCNcBGAsYHQ/s1080/meme_indonesia_gokil_130732318_1014980098984055_6288320571321797344_n.jpg", + "https://1.bp.blogspot.com/-PSywVBZiO5s/X9zzYORk8NI/AAAAAAAAUu8/K3Xrj7YjjmQ4CiShvU11MfU0_kqPEDRhwCNcBGAsYHQ/s480/meme_indonesia_gokil_130829433_1263619567342642_2997987878465918953_n.jpg", + "https://1.bp.blogspot.com/-KEEcM_0Mqlw/X9zzbOgyVLI/AAAAAAAAUvo/6YFpXcc4QhoUIV94Mlwwj-P02b0zyHz3QCNcBGAsYHQ/s720/meme_indonesia_gokil_131283197_168966521596830_6491895756050266793_n%2B%25281%2529.jpg", + "https://1.bp.blogspot.com/-DF8XSLnKlw4/X7473ktG_oI/AAAAAAAAAAQ/iNQLgVv5ZH0TOtRMNX39MrDsR-9WvHcBgCLcBGAsYHQ/s600/dark_jokesidn_125413538_4708449659226988_2818050412611397571_n.jpg", + "https://1.bp.blogspot.com/-Uh4ZHwYDzgc/X7473pFJNtI/AAAAAAAAAAU/CDdg5yCpjYs0EAbM36wWJt64IaKCd9dwACLcBGAsYHQ/s600/dark_jokesidn_125763208_287219762648327_8451338174815846745_n.jpg", + "https://1.bp.blogspot.com/-5JbETHhqjsE/X7473dr_KAI/AAAAAAAAAAM/6PSuwjgwRi861Wv_wugXKK1F0V0htlsdwCLcBGAsYHQ/s600/dark_jokesidn_125771108_819438932212234_9195471701678220668_n.jpg", + "https://1.bp.blogspot.com/-ZKLUtEg7L4U/X7474BW4i0I/AAAAAAAAAAY/SwzC0fiT4JM4iLNKY5qw67Mkgg2khORRQCLcBGAsYHQ/s600/dark_jokesidn_125811246_134357671416788_976039294859462799_n.jpg", + "https://1.bp.blogspot.com/-NHj1zmuU64c/X7474tpGqAI/AAAAAAAAAAc/yqN7lmE5JRsRtzu27iU2Af5TKC0tPbidwCLcBGAsYHQ/s600/dark_jokesidn_125913814_669971630554090_4965983515042687120_n.jpg", + "https://1.bp.blogspot.com/-nWez8FBhNbc/X7474ufKrjI/AAAAAAAAAAg/zs5KlpQyte0r6NiBazZa1oEFamFMT5o7wCLcBGAsYHQ/s600/dark_jokesidn_125916215_1533013756892925_3229604459263123272_n.jpg", + "https://1.bp.blogspot.com/-_iBTwh2xmbs/X7475BGlZMI/AAAAAAAAAAk/Vw9x0AxutiUzOosLPOebxdYkMQczzk_YQCLcBGAsYHQ/s600/dark_jokesidn_125942119_190351036014132_7819076849939301140_n.jpg", + "https://1.bp.blogspot.com/-rauoH_JrIhk/X7475c2lNuI/AAAAAAAAAAo/tUWQ0A3n-hcpGqg6NygclGKkZpfZKRVlgCLcBGAsYHQ/s600/dark_jokesidn_125960559_2462771960685989_4545333058975253946_n.jpg", + "https://1.bp.blogspot.com/-iJNMg7iNyB8/X7475lXFYKI/AAAAAAAAAAs/YMmu9RzxMcYZV-NzKluO9Jrh_atKCliagCLcBGAsYHQ/s600/dark_jokesidn_125969103_173992064384728_9051904893274226019_n.jpg", + "https://1.bp.blogspot.com/--nwEy_pzB4A/X74756CNOjI/AAAAAAAAAAw/zHzgZjv6jhUXYahy3xx459Di9pVNCAO2QCLcBGAsYHQ/s600/dark_jokesidn_126042830_835992027203350_8414976899406572504_n.jpg", + "https://1.bp.blogspot.com/-VP2pHJDpkUE/X7476DJ5GcI/AAAAAAAAAA0/66CCNDo8hpwKPRbR5H30h6HeuMyHUjPWgCLcBGAsYHQ/s600/dark_jokesidn_126053972_189965019286221_4250381716346170758_n.jpg", + "https://1.bp.blogspot.com/-vmZ1KdoSyJY/X7476J_y6pI/AAAAAAAAAA4/oTD8eBIYHpUyfNWueq3kF5K2BIRgrwoGACLcBGAsYHQ/s600/dark_jokesidn_126059781_971971236546542_909575679588689725_n.jpg", + "https://1.bp.blogspot.com/-dhPv0Z7s714/X7476TDmk-I/AAAAAAAAAA8/hXfO6s1DpQU9EONnAWDABrd_prbnlorVACLcBGAsYHQ/s600/dark_jokesidn_126157501_199666855004682_7845085292892857199_n.jpg", + "https://1.bp.blogspot.com/-PR_PpFaI_B4/X7476wsfGwI/AAAAAAAAABA/oPyQMQlH8hcpJedHYz0JCflCdkIU2XWvgCLcBGAsYHQ/s600/dark_jokesidn_126200110_838776873613928_5199354286646414089_n.jpg", + "https://1.bp.blogspot.com/-8Ph_hrrwgOQ/X74761oaeJI/AAAAAAAAABE/b1kq8lXcGZMUTHYUc67q_x3DwGJL3Ds8gCLcBGAsYHQ/s600/dark_jokesidn_126235999_3883403391679404_3614733563626350889_n.jpg", + "https://1.bp.blogspot.com/-04jO_qjfrV4/X7477Qv_74I/AAAAAAAAABI/KmkuY_bArbEou9ilotUVhm4Uk3z-SYroACLcBGAsYHQ/s600/dark_jokesidn_126251235_216024523255792_3922178115706270584_n.jpg", + "https://1.bp.blogspot.com/-zhaZ7iCi1ys/X74771waEjI/AAAAAAAAABM/7xiV5jJSOjgwlYq418ac7ShxhqNvILgQgCLcBGAsYHQ/s600/dark_jokesidn_126335487_372190407378106_2938205683968546124_n.jpg", + "https://1.bp.blogspot.com/-3DBdWKpzbOA/X7478N3GB5I/AAAAAAAAABQ/z36Z5pDPaKMc26bAnaqGijs7K1fc_CZywCLcBGAsYHQ/s600/dark_jokesidn_126394759_1043996636067416_4574617667256314752_n.jpg", + "https://1.bp.blogspot.com/-uHRiqGgl68M/X7478fhBM4I/AAAAAAAAABU/NRubUeWWnsEi7dCPljXjuumnOiAIeWijwCLcBGAsYHQ/s600/dark_jokesidn_126454758_1296461424048801_624034565419100730_n.jpg", + "https://1.bp.blogspot.com/-aaFBXUN1uyM/X7478s8FIlI/AAAAAAAAABY/Dl21eQddqe4EkFGo-oaUJBHVDaF7DqiLACLcBGAsYHQ/s600/dark_jokesidn_126836665_3630431300329325_5011335601065475543_n.jpg", + "https://1.bp.blogspot.com/-uHRiqGgl68M/X7478fhBM4I/AAAAAAAAABU/NRubUeWWnsEi7dCPljXjuumnOiAIeWijwCLcBGAsYHQ/s600/dark_jokesidn_126454758_1296461424048801_624034565419100730_n.jpg", + "https://1.bp.blogspot.com/-281KugSTtC0/X7479JqwUWI/AAAAAAAAABc/RrAHYJMe_fsTjMEFBKo20_Jmr_H8pcSVgCLcBGAsYHQ/s600/dark_jokesidn_126913137_1242917436095143_565227427038302568_n.jpg", + "https://1.bp.blogspot.com/-y6y4P1k8uZM/X748KL8YsBI/AAAAAAAAAEk/svnRwRKKKHMHAggIobKsWVvfCnWk7oeFQCLcBGAsYHQ/s600/darkjokes101.id_83456045_113551443548110_2981589770713149046_n.jpg", + "https://1.bp.blogspot.com/-p_MJA1ZVLYk/X748KeWQhnI/AAAAAAAAAEo/M6jxZWCcaG0c7AVlbQcnJumkrIiKqaLpQCLcBGAsYHQ/s600/darkjokes101.id_83768105_301838390953572_5433897784320788913_n.jpg", + "https://1.bp.blogspot.com/-GhNEc-8J9r4/X748KhvyouI/AAAAAAAAAEs/LoEpWMYI424TTG7Has-Tji0Rcyr9GOQIQCLcBGAsYHQ/s600/darkjokes101.id_97563726_1383946805138463_6577185929966205658_n.jpg", + "https://1.bp.blogspot.com/-Bo3SIAOPBaY/X748LGxT9II/AAAAAAAAAEw/n9TQ0uUOR-IKrK2dsGYZ0o43MCPcVNTaQCLcBGAsYHQ/s600/darkjokes101.id_99064100_285325765968755_2858540684558876843_n.jpg", + "https://1.bp.blogspot.com/-2IbcoVnZK4E/X748LRnf4mI/AAAAAAAAAE0/06P-D_dOcZon6LWzvxj4qgZa043YEbuZACLcBGAsYHQ/s600/darkjokes101.id_99149721_263878304690485_4274403557054793854_n.jpg", + "https://1.bp.blogspot.com/-4qNDY60d7z0/X7479yMJ46I/AAAAAAAAABo/D2VyTwzHFBccoAC8CEIJIzjzpTRverH6gCLcBGAsYHQ/s600/darkjokes101.id_100077716_105592917757106_272558179785716903_n.jpg", + "https://1.bp.blogspot.com/-4qNDY60d7z0/X7479yMJ46I/AAAAAAAAABo/D2VyTwzHFBccoAC8CEIJIzjzpTRverH6gCLcBGAsYHQ/s600/darkjokes101.id_100077716_105592917757106_272558179785716903_n.jpg", + "https://1.bp.blogspot.com/-rKLWjz6XJHI/X74791fPsdI/AAAAAAAAABs/MrtpbAEK_sUaITHHqSk625Sk5FM6aNvXgCLcBGAsYHQ/s600/darkjokes101.id_100651682_3868977436508830_3723713845645912294_n.jpg", + "https://1.bp.blogspot.com/-FukQ6OqPkxE/X747-qCzgXI/AAAAAAAAABw/r5dsEdKg4VM_lZwa2MecdHA-CMM3dt7lwCLcBGAsYHQ/s600/darkjokes101.id_100870692_671623397011216_5615448684900827810_n.jpg", + "https://1.bp.blogspot.com/-3z22doJpmJI/X747-0ccp-I/AAAAAAAAAB0/9ywc1KdcuQEmqVZxnfCi8nSd7he_kdBWQCLcBGAsYHQ/s600/darkjokes101.id_100873414_1590418137799550_4205263227048486381_n.jpg", + "https://1.bp.blogspot.com/-mXUC4ZW3AWs/X747_mBSs0I/AAAAAAAAAB8/GaElPy8NgBA5jLS80QypsN8ydrKxE6rZgCLcBGAsYHQ/s600/darkjokes101.id_100950424_113362380167108_4925146108170457581_n.jpg", + "https://1.bp.blogspot.com/-Hc23nyIc1_Y/X747_x3wDYI/AAAAAAAAACA/ViZl4YjeLQk9yDzT5r0-GmwTFxs5W4xQACLcBGAsYHQ/s600/darkjokes101.id_100973869_130547945307990_5870879821283126654_n.jpg", + "https://1.bp.blogspot.com/-Akp4QaWpRwc/X747_w5n6aI/AAAAAAAAACE/eTDUTdDV8P8Mtc0MCsqGpqMCtTPKoVDVgCLcBGAsYHQ/s600/darkjokes101.id_101050187_2635453733392140_6919535255199617791_n.jpg", + "https://1.bp.blogspot.com/-U8ZcPPD54MQ/X748ArBXhII/AAAAAAAAACI/Z1KPh690DJ0Xs8Y2ii05eEgt0jvXY6n9wCLcBGAsYHQ/s600/darkjokes101.id_101070777_553214945563469_5198484444635252583_n.jpg" +] \ No newline at end of file diff --git a/node_modules/dhn-api/database/json.js b/node_modules/dhn-api/database/json.js new file mode 100644 index 000000000..353a5059e --- /dev/null +++ b/node_modules/dhn-api/database/json.js @@ -0,0 +1,47 @@ +const fs = require('fs'); +const path = require('path'); + +const cerpen = JSON.parse(fs.readFileSync(path.resolve(__dirname, 'cerpen.json'))); +const couple = JSON.parse(fs.readFileSync(path.resolve(__dirname, 'couple.json'))); +const quotes = JSON.parse(fs.readFileSync(path.resolve(__dirname, 'quotes.json'))); +const darkjoke = JSON.parse(fs.readFileSync(path.resolve(__dirname, 'darkjoke.json'))); +const JTmeme = JSON.parse(fs.readFileSync(path.resolve(__dirname, 'JTmeme.json'))); + +randomJson = (array) => { + return array[Math.floor(Math.random() * array.length)]; +}; + +const Cerpen_ = () => { + return randomJson(cerpen); +}; + +const Quotes_ = () => { + return randomJson(quotes); +}; + +const Couples = () => { + return randomJson(couple); +}; + +const JTMimers = () => { + return randomJson(JTmeme); +}; + +const Dark = () => { + return randomJson(darkjoke); +}; + +module.exports = { + Cerpen_, + Quotes_, + Couples, + JTMimers, + Dark +}; + +/* + * + * @dehan_j1ng + * An Example Api for De-BOTZ + * + */ \ No newline at end of file diff --git a/node_modules/dhn-api/database/json/JTmeme.json b/node_modules/dhn-api/database/json/JTmeme.json new file mode 100644 index 000000000..6f993987f --- /dev/null +++ b/node_modules/dhn-api/database/json/JTmeme.json @@ -0,0 +1,122 @@ +[ + "https://assets.jalantikus.com/assets/cache/560/420/userfiles/2018/11/03/Gambar-Lucu-2018-1-ab7c9.jpg", + "https://assets.jalantikus.com/assets/cache/560/320/userfiles/2018/11/03/Gambar-Lucu-2018-1-044b7.png", + "https://assets.jalantikus.com/assets/cache/560/315/userfiles/2018/11/03/Gambar-Lucu-2018-2-20eb2.jpg", + "https://assets.jalantikus.com/assets/cache/560/401/userfiles/2018/11/03/Gambar-Lucu-2018-3-42735.jpg", + "https://assets.jalantikus.com/assets/cache/350/350/userfiles/2020/02/24/12-b97a6.jpg", + "https://assets.jalantikus.com/assets/cache/560/496/userfiles/2018/11/03/Gambar-Lucu-2018-5-f8a9d.jpg", + "https://assets.jalantikus.com/assets/cache/560/420/userfiles/2018/11/03/Gambar-Lucu-2018-6-8b745.jpg", + "https://assets.jalantikus.com/assets/cache/560/510/userfiles/2018/11/03/Gambar-Lucu-2018-7-445fb.jpg", + "https://assets.jalantikus.com/assets/cache/560/560/userfiles/2018/11/03/Gambar-Lucu-2018-8-7679e.jpg", + "https://assets.jalantikus.com/assets/cache/560/415/userfiles/2018/11/03/Gambar-Lucu-2018-9-15dbe.jpg", + "https://assets.jalantikus.com/assets/cache/560/746/userfiles/2020/09/20/27-ee3a8.jpg", + "https://assets.jalantikus.com/assets/cache/560/532/userfiles/2020/09/20/26-9e360.jpg", + "https://assets.jalantikus.com/assets/cache/560/560/userfiles/2020/09/20/25-59ad8.jpg", + "https://assets.jalantikus.com/assets/cache/560/560/userfiles/2020/09/20/23-15f02.jpg", + "https://assets.jalantikus.com/assets/cache/560/662/userfiles/2020/09/20/22-90304.jpg", + "https://assets.jalantikus.com/assets/cache/80/80/tips/2020/04/15/gambar-sunda-lucu-1bf0f.jpg", + "https://assets.jalantikus.com/assets/cache/551/360/userfiles/2021/02/11/foto-kartun-lucu-f2864.jpeg", + "https://assets.jalantikus.com/assets/cache/360/360/userfiles/2021/02/11/foto-animasi-lucu-43228.jpeg", + "https://assets.jalantikus.com/assets/cache/362/360/userfiles/2021/02/11/foto-one-piece-lucu-51082.jpeg", + "https://assets.jalantikus.com/assets/cache/560/302/userfiles/2021/02/11/foto-animasi-kartun-lucu-815cb.jpeg", + "https://assets.jalantikus.com/assets/cache/560/294/userfiles/2021/02/11/animasi-lucu-33a80.jpeg", + "https://assets.jalantikus.com/assets/cache/490/360/userfiles/2021/02/11/foto-kartun-muslimah-51fac.jpeg", + "https://assets.jalantikus.com/assets/cache/480/360/userfiles/2021/02/11/animasi-bikin-ngakak-6f9ea.jpeg", + "https://assets.jalantikus.com/assets/cache/560/315/userfiles/2021/02/11/foto-animasi-002c8.jpeg", + "https://assets.jalantikus.com/assets/cache/480/360/userfiles/2021/02/11/kartun-lucu-dan-unik-fff3d.jpeg", + "https://assets.jalantikus.com/assets/cache/560/315/userfiles/2021/02/11/animasi-unik-6ee12.jpeg", + "https://assets.jalantikus.com/assets/cache/560/448/userfiles/2018/11/03/Gambar-Lucu-Gokil-1-7872d.jpg", + "https://assets.jalantikus.com/assets/cache/560/373/userfiles/2018/11/03/Gambar-Lucu-Gokil-2-1e8f7.jpg", + "https://assets.jalantikus.com/assets/cache/560/420/userfiles/2018/11/03/Gambar-Lucu-Gokil-3-2fea8.jpg", + "https://assets.jalantikus.com/assets/cache/560/315/userfiles/2018/11/03/Gambar-Lucu-Gokil-4-2a6d3.jpg", + "https://assets.jalantikus.com/assets/cache/560/444/userfiles/2018/11/03/Gambar-Lucu-Gokil-5-83bf0.jpg", + "https://assets.jalantikus.com/assets/cache/560/560/userfiles/2018/11/03/Gambar-Lucu-Gokil-6-3c8ae.jpg", + "https://assets.jalantikus.com/assets/cache/560/315/userfiles/2018/11/03/Gambar-Lucu-Gokil-7-0d9f7.jpg", + "https://assets.jalantikus.com/assets/cache/350/350/userfiles/2020/02/24/11-0d82f.jpg", + "https://assets.jalantikus.com/assets/cache/560/314/userfiles/2018/11/03/Gambar-Lucu-Gokil-9-09b37.jpg", + "https://assets.jalantikus.com/assets/cache/560/609/userfiles/2018/11/03/Gambar-Lucu-Gokil-10-de428.jpg", + "https://assets.jalantikus.com/assets/cache/80/80/tips/2018/12/15/gambar-lucu-jawa-banner2-60773.jpg", + "https://assets.jalantikus.com/assets/cache/350/350/userfiles/2020/02/24/13-f15c7.jpg", + "https://assets.jalantikus.com/assets/cache/560/336/userfiles/2018/11/03/Gambar-Lucu-Banget-1-26dfa.png", + "https://assets.jalantikus.com/assets/cache/560/352/userfiles/2018/11/03/Gambar-Lucu-Banget-2-0541c.jpg", + "https://assets.jalantikus.com/assets/cache/560/414/userfiles/2018/11/03/Gambar-Lucu-Banget-3-23b12.jpg", + "https://assets.jalantikus.com/assets/cache/560/372/userfiles/2018/11/03/Gambar-Lucu-Banget-4-c7c83.jpg", + "https://assets.jalantikus.com/assets/cache/560/548/userfiles/2018/11/03/Gambar-Lucu-Banget-5-d5a2d.jpg", + "https://assets.jalantikus.com/assets/cache/560/560/userfiles/2018/11/03/Gambar-Lucu-Banget-6-bee6b.jpg", + "https://assets.jalantikus.com/assets/cache/560/445/userfiles/2018/11/03/Gambar-Lucu-Banget-7-d23a2.jpg", + "https://assets.jalantikus.com/assets/cache/560/536/userfiles/2018/11/03/Gambar-Lucu-Banget-8-dd278.jpg", + "https://assets.jalantikus.com/assets/cache/560/560/userfiles/2018/11/03/Gambar-Lucu-Banget-9-37b0e.jpg", + "https://assets.jalantikus.com/assets/cache/560/656/userfiles/2020/09/20/24-e95a6.jpg", + "https://assets.jalantikus.com/assets/cache/560/563/userfiles/2020/09/20/21-769c5.jpg", + "https://assets.jalantikus.com/assets/cache/420/420/userfiles/2020/09/20/20-9a721.jpg", + "https://assets.jalantikus.com/assets/cache/560/561/userfiles/2020/09/20/18-06fa9.jpg", + "https://assets.jalantikus.com/assets/cache/560/560/userfiles/2020/09/20/13-19181.jpg", + "https://assets.jalantikus.com/assets/cache/80/80/gokil/2016/06/15/nostalgia-masa-kecil-banner.jpeg", + "https://assets.jalantikus.com/assets/cache/560/280/userfiles/2018/11/03/Gambar-Lucu-Bikin-Ngakak-1-efe16.jpg", + "https://assets.jalantikus.com/assets/cache/360/360/userfiles/2021/02/11/gambar-lucu-dan-unik-ff81d.jpeg", + "https://assets.jalantikus.com/assets/cache/560/315/userfiles/2018/11/03/Gambar-Lucu-Bikin-Ngakak-2-00774.jpg", + "https://assets.jalantikus.com/assets/cache/560/430/userfiles/2018/11/03/Gambar-Lucu-Bikin-Ngakak-3-b97b5.jpg", + "https://assets.jalantikus.com/assets/cache/560/560/userfiles/2018/11/03/Gambar-Lucu-Bikin-Ngakak-4-c69c9.jpg", + "https://assets.jalantikus.com/assets/cache/560/560/userfiles/2018/11/03/Gambar-Lucu-Bikin-Ngakak-5-730b2.jpg", + "https://assets.jalantikus.com/assets/cache/560/373/userfiles/2018/11/03/Gambar-Lucu-Bikin-Ngakak-6-f65d0.jpg", + "https://assets.jalantikus.com/assets/cache/560/560/userfiles/2018/11/03/Gambar-Lucu-Bikin-Ngakak-7-5b199.jpg", + "https://assets.jalantikus.com/assets/cache/560/314/userfiles/2018/11/03/Gambar-Lucu-Bikin-Ngakak-8-49cd8.jpg", + "https://assets.jalantikus.com/assets/cache/560/560/userfiles/2018/11/03/Gambar-Lucu-Bikin-Ngakak-9-11fcc.jpg", + "https://assets.jalantikus.com/assets/cache/560/315/userfiles/2018/11/03/Gambar-Lucu-Terbaru-1-9adcc.jpg", + "https://assets.jalantikus.com/assets/cache/560/595/userfiles/2018/11/03/Gambar-Lucu-Terbaru-1-e3cc0.png", + "https://assets.jalantikus.com/assets/cache/560/315/userfiles/2018/11/03/Gambar-Lucu-Terbaru-2-b71d6.jpg", + "https://assets.jalantikus.com/assets/cache/560/585/userfiles/2018/11/03/Gambar-Lucu-Terbaru-2-e8d13.png", + "https://assets.jalantikus.com/assets/cache/560/315/userfiles/2018/11/03/Gambar-Lucu-Terbaru-3-1b9d4.jpg", + "https://assets.jalantikus.com/assets/cache/560/585/userfiles/2018/11/03/Gambar-Lucu-Terbaru-3-aca0e.png", + "https://assets.jalantikus.com/assets/cache/560/560/userfiles/2018/11/03/Gambar-Lucu-Terbaru-4-923b5.jpg", + "https://assets.jalantikus.com/assets/cache/560/320/userfiles/2018/11/03/Gambar-Lucu-Terbaru-5-5b496.jpg", + "https://assets.jalantikus.com/assets/cache/560/560/userfiles/2018/11/03/Gambar-Lucu-Terbaru-6-3a1a3.jpg", + "https://assets.jalantikus.com/assets/cache/560/477/userfiles/2018/11/03/Gambar-Lucu-Terbaru-7-53534.jpg", + "https://assets.jalantikus.com/assets/cache/560/601/userfiles/2019/02/14/gambar-lucu-wa-1-77a51.jpeg", + "https://assets.jalantikus.com/assets/cache/560/693/userfiles/2019/02/14/gambar-lucu-wa-2-5b240.jpeg", + "https://assets.jalantikus.com/assets/cache/560/420/userfiles/2019/02/14/gambar-lucu-wa-1-1983f.jpg", + "https://assets.jalantikus.com/assets/cache/560/352/userfiles/2019/02/14/gambar-lucu-wa-2-36598.jpg", + "https://assets.jalantikus.com/assets/cache/560/418/userfiles/2019/02/14/gambar-lucu-wa-3-3a79b.jpg", + "https://assets.jalantikus.com/assets/cache/560/373/userfiles/2019/02/14/gambar-lucu-wa-4-f8e7e.JPG", + "https://assets.jalantikus.com/assets/cache/560/454/userfiles/2019/02/14/gambar-lucu-wa-5-3f5de.jpg", + "https://assets.jalantikus.com/assets/cache/560/821/userfiles/2019/02/14/gambar-lucu-wa-3-e2ec8.jpeg", + "https://assets.jalantikus.com/assets/cache/560/434/userfiles/2019/02/14/gambar-lucu-wa-4-f7a43.jpeg", + "https://assets.jalantikus.com/assets/cache/560/503/userfiles/2019/02/14/gambar-lucu-wa-5-66cfd.jpeg", + "https://assets.jalantikus.com/assets/cache/560/358/userfiles/2020/09/20/12-6f917.jpg", + "https://assets.jalantikus.com/assets/cache/500/533/userfiles/2020/09/20/17-d3131.jpg", + "https://assets.jalantikus.com/assets/cache/560/560/userfiles/2020/09/20/15-07fd9.jpg", + "https://assets.jalantikus.com/assets/cache/500/500/userfiles/2020/09/20/14-1b2ac.jpg", + "https://assets.jalantikus.com/assets/cache/560/560/userfiles/2020/09/20/29-476aa.jpg", + "https://assets.jalantikus.com/assets/cache/560/315/userfiles/2020/02/24/1-b4a5c.jpg", + "https://assets.jalantikus.com/assets/cache/350/350/userfiles/2020/02/24/2-7e6a1.jpg", + "https://assets.jalantikus.com/assets/cache/355/350/userfiles/2020/02/24/3-a75ec.jpg", + "https://assets.jalantikus.com/assets/cache/393/350/userfiles/2020/02/24/4-95663.jpg", + "https://assets.jalantikus.com/assets/cache/560/314/userfiles/2020/02/24/5-04a82.jpg", + "https://assets.jalantikus.com/assets/cache/350/350/userfiles/2020/02/24/6-3cc1d.jpg", + "https://assets.jalantikus.com/assets/cache/560/315/userfiles/2020/02/24/7-746de.jpg", + "https://assets.jalantikus.com/assets/cache/560/334/userfiles/2020/02/24/8-6f7c5.jpg", + "https://assets.jalantikus.com/assets/cache/500/350/userfiles/2020/02/24/9-4f030.jpg", + "https://assets.jalantikus.com/assets/cache/350/350/userfiles/2020/02/24/10-badd2.jpg", + "https://assets.jalantikus.com/assets/cache/431/360/userfiles/2020/09/20/19-b9676.jpg", + "https://assets.jalantikus.com/assets/cache/560/555/userfiles/2020/09/20/10-53417.jpg", + "https://assets.jalantikus.com/assets/cache/560/560/userfiles/2020/09/20/09-5f34e.jpg", + "https://assets.jalantikus.com/assets/cache/363/342/userfiles/2020/09/20/08-ba13c.jpg", + "https://assets.jalantikus.com/assets/cache/400/400/userfiles/2020/09/20/07-08280.jpeg", + "https://assets.jalantikus.com/assets/cache/560/560/userfiles/2020/09/20/06-b15c6.jpg", + "https://assets.jalantikus.com/assets/cache/560/629/userfiles/2020/09/20/05-1fee0.jpg", + "https://assets.jalantikus.com/assets/cache/560/320/userfiles/2020/09/20/04-c8395.jpg", + "https://assets.jalantikus.com/assets/cache/560/356/userfiles/2020/09/20/gambar-lucu-terbaru-bf4e2.jpg", + "https://assets.jalantikus.com/assets/cache/560/315/userfiles/2020/09/20/02-7d434.jpg", + "https://assets.jalantikus.com/assets/cache/453/605/userfiles/2020/09/20/01-720eb.jpg", + "https://assets.jalantikus.com/assets/cache/560/560/userfiles/2020/09/20/30-33540.jpg", + "https://assets.jalantikus.com/assets/cache/560/315/userfiles/2020/09/20/28-98e05.jpg", + "https://assets.jalantikus.com/assets/cache/560/560/userfiles/2020/09/20/11-c933e.jpg", + "https://assets.jalantikus.com/assets/cache/320/320/userfiles/2020/09/20/16-df666.jpg", + "https://assets.jalantikus.com/assets/cache/184/94/tips/2018/12/17/aplikasi-edit-video-lucu-banner-287ca.jpg", + "https://assets.jalantikus.com/assets/cache/184/94/tips/2020/04/07/film-lucu-indonesia-01-ffb7f.jpg", + "https://assets.jalantikus.com/assets/cache/184/94/gokil/2017/01/26/foto-kocak-editan-meitu-11.jpeg", + "https://assets.jalantikus.com/assets/cache/184/94/gokil/2015/09/25/single-vs-taken-banner.jpeg", + "https://assets.jalantikus.com/assets/cache/184/94/gokil/2018/09/05/header-13-7d1d3.jpg", + "https://assets.jalantikus.com/assets/cache/184/94/gokil/2017/06/09/photobomb-selebriti-banner.jpeg", + "https://assets.jalantikus.com/assets/cache/184/94/gokil/2016/06/09/perbedaan-laki-laki-sebelum-dan-sesudah-menikah-banner.jpeg" +] \ No newline at end of file diff --git a/node_modules/dhn-api/database/json/cerpen.json b/node_modules/dhn-api/database/json/cerpen.json new file mode 100644 index 000000000..832af0237 --- /dev/null +++ b/node_modules/dhn-api/database/json/cerpen.json @@ -0,0 +1,12 @@ +[ + "Cerpen Persahabatan – Sahabat Kecilku\n“Ini, buat kamu”, seraya menjulurkan bunga edelweis“Ini kan…”, belum sempat ku menyelesaikan kata kataku, tiba tiba dia memotong ucapanku“Iya, dulu kan kamu pernah minta ini kalau aku sudah pulang dari luar negeri” , jelasnya\nTernyata dia sama sekali tidak lupa, meskipun sudah 4 tahun tidak pernah saling menghubungi. Bunga yang melambangkan keabadian ini, memang sudah sejak lama aku menginginkannya. Tak ada yang berubah. Meskipun sudah 4 tahun aku tak melihatnya. Garis wajahnya, rambutnya yang ikal, alisnya yang hitam tebal, bola matanya yang bulat coklat, msh sama seperti dulu. Sudah sejak kecil aku mengenalnya. Dia tetangga baruku sewaktu aku kecil“Nama kamu siapa?“Aku Ines, kamu?“Aku Tio“Kamu pindah darimna?“Dari luar kota, karena Papa ku lagi ada urusan bisnis di sini, jadi kami terpaksa pindah ke sini“Hmm. Aku senang punya teman baru. Semoga kita bisa berteman baik ya“Iya, aku juga\nSejak saat itu aku menjadi akrab dengannya. Main bersama, jalan jalan bersama keluarganya dan keluargaku. Dan kami pun berjanji untuk tetap bersahabat baik hingga besar nanti. Ketika suatu hari ia mengajakku ke taman dekat rumah, sepertinya ada hal penting yang ingin ia bicarakan“Minggu depan aku akan pindah“Pindah kemana? Kenapa mendadak?“Ke luar negeri. Sebenarnya aku ingin memberitahumu sejak awal, tapi aku takut kamu sedih lalu menjauh darikuSebenarnya aku juga sudah tahu kalau dia ingin pindah ke luar negeri. Mamah yang memberitahuku. Ku kira itu hanya\nomongan saja, tapi ternyata…\n“Kamu mau minta hadiah apa dariku?“Apa aja?“Iya. Apa yang kamu mau, aku akan kasih“Kamu tahu kan, kalau dari dulu aku sangat menginginkan bunga itu?“Edelweis? Hanya itu saja?“Iya, hanya itu saja“Baiklah\nTiba tiba ia menyadarkan lamunanku. Membuat pandanganku membaur. Ia mulai mengungkapkan sesuatu“Maaf…”, kata katanya terputus“Aku tak bisa lama lama tinggal d sini”, sambungnya“Kenapa?” tanyaku penasaran“Maaf, aku baru bisa memberitahumu sekarang. Karena aku akan balik lagi ke luar negeri. Bulan depan aku akan menikahGlek. Menikah\nTiba tiba pandanganku menjadi buram. Bayangan wajahnya perlahan menghilang di telan bayangan“Ines… Ayo bangun! Sudah jam setengah 9. Nanti kamu telat kuliahnya!“Yaahhh, Mamah… Lagi nanggung juga mimpinyaTernyata hanya mimpi. Aku menghembuskan nafas lega\n", + "Cerpen Persahabatan – Siput dan Wijen\nPagi yang cerah, seorang gadis yang bernama Putri membuka jendela kamarnya dan membiarkan sinar matahari untuk masuk ke dalam kamarnya. “Hoamm, sejuk sekali udara pagi ini” ucap Putri sambil menghirup udara. “Ting ting” handphone Putri berbunyi tanda pesan singkat masuk. Seketika Putri langsung mengambil handphonenya dan membuka pesan singkat tersebut, ternyata itu dari Wijay teman Putri. “Pagi” begitu pesannya. “Pagi juga” Putri membalas. “Put, hari ini bisa tidak kita bertemu?” tanya Wijay pada Putri. “Emangnya mau ngapain?” balas Putri penasaran. “Sudah, nanti datang saja jam 10, aku tunggu di lapangan ya” balas Wijay kembali. “Baiklah” balas Putri\nPutri pun langsung mempersiapkan diri untuk datang menemui Wijay di lapangan. Ia segera mandi, dan setelah itu berdandan. Ketika Putri akan memakai baju, ia bingung ingin mengenakan baju yang mana. Dipilihnya baju berwarna ungu dengan motif bunga-bunga, celana putih, serta jilbab yang berwarna ungu. Setelah ia puas dengan apa yang ia kenakan, ia pun segera turun ke bawah untuk menemui Ayah dan Bundanya di meja makan. “Pagi Yah, pagi Bun” sapa Putri di meja makan pada Ayah dan Bundanya. “Pagi Putri” balas mereka hampir bersamaan. “Ayah, pagi ini Putri mau ke lapangan” ucap Putri. “Loh, mau ngapain?” tanya Ayah penasaran. “Itu, Wijay mau ketemu di lapangan jam 10 nanti” jawab Putri polos. “Oh begitu, ya sudah. Tapi maaf ya Put, Ayah nggak bisa nganter” ucap Ayahnya. “Iya Ayah, tidak apa-apa” balas Putri. Setelah itu Putri menghabiskan makanannya dan meminum segelas susunya sampai habis\nSetelah semuanya selesai, Putri langsung berpamitan kepada Ayah dan Bundanya. “Ayah Bunda, Putri berangkat dulu” ucap Putri berpamitan. “Iya Put, hati-hati ya” balas Bundanya. Setelah itu Putri mengayuh sepedanya dan menuju ke lapangan. Setelah menempuh waktu kurang lebih 10 menit, Putri akhirnya sampai di lapangan, dicarinya Wijay kesana kemari. Dan sampai akhirnya… “Putri!!!” seru seorang anak memanggil Putri. Seketika Putri pun menoleh ke sumber suara. “Hai! Wijay” ucap Putri tiba-tiba. “Hai” balas Wijay. “Mau ngapain sih kesini? Mau mentraktir aku?” ucap Putri dengan rasa percaya diri yang sangat tinggi. “Yee, traktir terus sih pikirannya” sungut Wijay sedikit kesal. “Iya iya, emang mau ngapain Kak Wijay yang paling WOW” ucap Putri dengan nada tak ikhlas. “Hmm, gini loh Put, kamu inget gak ini hari apa?” tanya Wijay pada Putri. “Ya inget lah, ini kan Hari Selasa” jawab Putri dengan mudahnya\n“Kok hari selasa sih? bukan itu maksudku” ucap Wijay sambil berharap. “Emm, emang hari ini hari apa sih?” tanya Putri dengan kepolosannya. “Yah Putri lupa, hari ini kan hari ulang tahunku” ucap Wijay dengan nada sedih. “Oh ya? Maaf aku lupa” balas Putri dengan nada menyesal. “Tak apa, ini ada birthday card buat kamu” ucap Wijay sambil memberikan kartu undangan tersebut. “Wah wah, ada pesta nih keliatannya” ledek Putri. “Hehe.. Iya nih, mumpung ada rezeki” balas Wijay. “Iya Alhamdulillah” jawab Putri turut senang. “Datang ya Put” pinta Wijay. “Insyaallah” ucap Putri tersenyum. “Lahh, pokoknya harus dateng!!” Wijay memaksa. “Loh? siapa tahu nanti aku sampai rumah udah gak ada, makanya aku bilang Insyaallah” jawab Putri bijak. “Kok gitu ngomongnya? serem banget” ucap Wijay keheranan. “Hmm, sudahlah lupakan saja” balas Putri tersenyum\nSetelah selesai bertemu, Putri pun berpamitan kepada Wijay untuk segera pulang ke rumah. “Aku pulang dulu ya Jay” ujar Putri. “Baiklah” jawab Wijay sedikit lesu. “Bye bye.. sampai bertemu di pesta ya” ucap Putri sambil mengedipkan sebelah matanya. “Oke oke” balas Wijay sambil mengedipkan sebelah matanya pula\nSetelah sampai di rumah, Putri langsung membuka kartu undangan tersebut. “Emm, jam 4 sore toh pestanya” ucap Putri sambil mengangguk-anggukan kepala tanda mengerti. “Loh? Berarti aku harus membeli hadiah untuk Wijay? Tapi apa ya?” ucap Putri lirih. Tiba-tiba Bunda Putri datang menghampirinya. “Ada apa Put?” tanya Bunda pada Putri. “Ini Bunda, tadi ternyata Wijay ketemu sama Putri, cuma mau ngasih kartu undangan ini” jelas Putri pada Bunda. “Terus?” jawab Bunda tak mengerti. “Yah Bunda, Putri kan mesti beli hadiah buat Wijay?” ucap Putri. “Oh begitu, ya sudah, belikan Wijay barang kesukaannya” Bunda memberi saran. “Emm? Jam tangan!” celetuk Putri. “Jam tangan? Itu barang kesukaannya Wijay?” tanya Bunda\n“Iya Bunda, Wijay paling suka sama jam tangan” seru Putri. “Ya sudah, nanti Bunda antar ke toko jam tangan ya?” ucap Bunda. “Nanti? Sekarang lah Bunda, undangannya kan jam 4?” ucap Putri mendesak Bundanya. “Hmm ya udah deh, Bunda ganti baju dulu ya” ucap Bunda menuruti permintaannya. “Oke Bunda, jangan terlalu lama yaa” kata Putri. Bundanya tak berkata apapun hanya membalas dengan sebuah senyuman\nPutri meununggu sudah lebih dari 5 menit. “Bunda lama amat sih ganti bajunya” batin Putri berkata. Tak lama dari itu, Bunda Putri keluar dari kamarnya. “Maaf ya, kalau lama” ucap Bunda. “Ya tidak apa-apa” jawab Putri cuek. Selanjutnya Putri langsung menuju depan rumah, dan Bunda Putri mengunci pintu rumah. Setelah semua itu selesai, Bunda dan Putri pun berangkat ke toko jam tangan. Putri segera berlari ke dalam toko jam tersebut, dan langsung melihat-lihat jam tangan yang dipajang. Seketika langkah Putri berhenti di depan jam tangan yang berwarna hitam\nPutri segera memanggil Bundanya “Bundaaa” ucap Putri setengah berteriak. “Ada apa?” balas Bunda sambil menghampiri Putri. “Mau itu” ucap Putri kembali sambil menunjuk jam tangan tersebut. “Yang itu?” tanya Bunda. “Iya” jawab Putri singkat. “Baiklah” ucap Bunda menuruti. “Mas mas, saya ambil yang ini ya?” ucap Bunda Putri kepada petugas toko. “Baik Bu” balas petugas toko dengan ramah. Setelah Bunda Putri membayar di kasir, mereka pun pulang ke rumah\nSesampainya di rumah, Putri segera membungkus jam tangan tersebut dengan kertas kado kesukaannya. Perlahan tapi pasti! Putri membungkus dengan sepenuh hati, karena hadiah itu untuk sahabat kesayangannya. Seselesainya Putri membungkus kado, Putri langsung mempersiapkan diri untuk pergi ke pesta ulang tahun Wijay. Lagi lagi, Putri kalah dalam hal berpakaian. Putri bingung harus mengenakan pakaian yang mana. “Bundaa!” teriaknya kencang. “Ada apa Put?” ujar Bunda sambil melangkah mendekati Putri. “Bundaa, Putri tak mengerti harus memakai baju yang mana?” keluh Putri\n“Gunakan saja yang menurutmu layak untuk dipakai” ucap Bunda tersenyum. Putri pun tak mengeluarkan sepatah kata pun. Putri terus mengukir apa maksud Bundanya tadi. “Mungkin memang aku harus mengenakan apa yang selayaknya aku kenakan” batinnya tersenyum. Lalu Putri mengambil baju yang berwarna Putih, celana jeans hitam, dan yang terakhir kerudung hitam. Tanpa berpikir panjang, Putri langsung mandi dan mengenakan pakaian yang telah dipilihnya tadi. Setelah dirinya siap, Putri pun langsung berangkat ke rumah Wijay\nTernyata telah banyak orang yang sudah datang. “Putriii!” panggil seseorang. Putri pun langsung mencari siapa yang memanggilnya tadi. Ternyata ia adalah teman sekelasnya, Nikmah. “Ehh kamu Kem?” ucap Putri. “Ahh Nikem terus? Jelek tau!” sungut Nikmah kesal. “Iya iya deh, ada apa?” tanya Putri. “Tidak, cuma mau nanya kamu kasih hadiah apa ke Wijay?” ujar Nikmah. “Emm? Adadeh kepo banget sih” ledek Putri. “Yeee.. nimbang nanya doang, pelit amat sih!” celetuk Nikmah. “Privasi dong” ucap Putri di telinga Nikmah dan pergi meninggalkannya\nPutri mencari Wijay kesana kemari, namun tak ada hasil. Lelah pun menghampiri Putri, akhirnya Putri pun memutuskan untuk duduk di bawah pohon mangga. “Nih minumnya” seseorang menyodorkan minuman tepat di depan muka Putri. Serentak Putri kaget, ternyata itu adalah Wijay. “Huuu Wijay ngagetin aja!” gerutu Putri. “Iya maaf maaf” ucapnya meminta maaf.. “Iya deh gak apa-apa” ucapnya. “Oiya! Nih kadonya” celetuk Putri. “Wahh.. Terimaksih sahabatku” ucapnya sambil tersenyum manis. “Oke deh sama-sama. Wle” balas Putri sambil menulurkan lidahnya. “Jelek” celetuk Wijay. “Oh gitu, ya sudah aku pulang!” ucap Putri dengan nada ngambek. “Jangan-jangan dong, aku kan cuma bercanda” jelas Wijay. Putri tak membalas perkataannya lagi, ia hanya diam, diam dan diam\nSaatnya acara tiup lilin. Wijay sudah bersiap di depan kue ulang tahunnya. Semua teman-temannya serempak menyanyikan lagu ulang tahun untuk Wijay. Setelah tiup lilin, kini saatnya first cake. Ya! Wijay memberikan first cake itu untuk bundanya tercinta. Tak lupa Wijay ucapkan terimakasih atas kehadiran teman-teman di acara pesta ulang tahunnya tersebut\nSebelum acaranya selesai, Wijay memberi pengumuman lewat pengeras suara. “Teman-teman, ini hari ulang tahunku yang sangat amat spesial. Karena di acara ulang tahunku sekarang ini, sahabat kesayanganku hadir disini” ucap Wijay. Wijay tak meneruskan ucapannya tadi, ia diam mematung. Tapi tiba-tiba… “Putrii!” celetuknya dengan sangat keras. “Hah?” ucap Putri tercengang. Semua mata langsung tertuju pada Putri yang berdiri di samping Nikmah. “Sini Put, maju ke depan” ucap Bunda Wijay. “Apaan sih Jen? Kok aku?” ucap Putri tak mengerti. “Kok Jen? Apalagi itu?” Wijay berbalik tanya. “Jen.. Wijen. Hahaha” ucap Putri tertawa geli\n“Huhh dasar Siput. Wle” ucap Wijay sambil menjulurkan lidahnya. “Loh? Kok Siput?” ucapnya penasaran. “Yoi, Siputri. Hahaha” ucapnya tertawa pula. “Ah sudahlah” ucap Putri lemas. “Haha, mulai sekarang aku panggil kamu Siput” ucap Wijay. “Okee, aku juga panggil kamu Wijen!” balasnya tak mau kalah juga. “Baik, Siput dan Wijen” ucap Wijay. “Hahahaha, itu konyol!” ujar Putri tertawa. “Yang penting happy” balas Wijay. Teman-teman Wijay dan Putri pun ikut tertawa geli juga mendengar Wijen mengatakan hal itu.", + "Cerpen Persahabatan – You’ll Never Know\nMatahari mulai memunculkan sinarnya di ufuk timur bumi, tanda hari kini sudah pagi. Ayam-ayam berkokok serentak membangunkan orang orang yang masih terlelap dalam tidur mereka. Carla terbangun dari tidur nyeyaknya dan segera beranjak menuju kamar mandi untuk segera bersiap-siap menuju sekolahnya\n“Carla cepatlah, kita bisa terlambat” teriak Mafalda sahabat sekaligus teman sekamar di tempat kost yang di sewa nya\n“sebentar” Carla berteriak balik dan segera keluar dari kamarnya sebelum Mafalda meninggalkannya\n\nMereka berjalan beiringan menuju sekolah yang sama, namun mereka tidak berada dalam kelas yang sama. Carla berada di kelas Bahasa sedangkan Mafalda berada di kelas Ipa. Hari itu mereka tepat waktu atau lebih tepatnya tepat ketika bel berbunyi mereka sampai di depan pintu gerbang sekolah. Mafalda segera berlari menuju kelas nya begitupun dengan Carla\n“syukurlah aku tidak terlambat lagi” gumam Carla saat memasuki kelasnya\n\nCarla berjalan menuju tempat duduknya yang berada di sebelah Olivia, dan berada persis di depan bangku Joshua, teman sekelasnya yang selalu membuat lelucon konyol dan juga biang keributan di dalam kelas. Dan Carla juga sering menjadi penyebab salah satu keributan itu bersama dengan Joshua\n“Carla” Joshua memanggilnya saat pelajaran baru saja dimulai\n“aku bawa kartu poker. Ayo kita main” ajaknya dengan tersenyum lebar\n“jangan! Ini sedang jam pelajaran, mainlah nanti” cegah Olivia\n“Ayo!” seru Carla bersemangat sementara Olivia dan Jason teman sebangku Joshua hanya menghela nafas pasrah oleh tingkah laku kedua teman mereka itu\n\nJoshua dan Carla sibuk dengan dunia mereka sendiri sementara guru mereka sedang menjelaskan pelajaran di depan. Tanpa mereka sadari guru itu mengetahui bahwa Carla dan Joshua tidak memperhatikan pelajarannya tanpa memberi peringatan dia pun langsung mendatangi tempat duduk mereka berdua\n“apa yang kalian lakukan?!” bentaknya\nCarla dan Joshua yang kaget langsung memasukkan kartu mereka ke dalam saku seragam masing-masing\n“tidak apa-apa, pak” ucap mereka bebarengan\n\n“Carla sejak kapan papan tulis menghadap ke belakang?! Hadap ke depan!” serunya dan Carla langsung membalikkan tubuhnya\n“kembali perhatikan pelajaran!” seru guru itu sebelum kembali melanjutkan pelajarannya\nSementara disisi lain Carla dan Joshua justru menertawakan entah hal apa yang menurut mereka lucu. Walaupun hanya terkikik pelan namun keadaan kelas yang sepi membuah mereka sangat mudah tertangkap\n“Carla, Joshua. Keluar dari kelas saya sekarang!!” guru itu berteriak, yang membuat Carla dan juga Joshua terdiam seketika\n\nSetelah mencoba meminta maaf namun tidak ada gunanya, akhirnya Carla dan Joshua pun keluar dari kelas dan duduk di taman yang berada di depan kelas mereka. Mereka saling bercakap-cakap dan seperti biasa membicarakan lelucon lelucon konyol dan akan tertawa bersama-sama atau lebih tepatnya Carla yang akan tertawa hingga memegangi perutnya\n\nTepat saat mereka masih duduk di taman, Mafalda lewat di koidor kelas mereka dan melihat Carla berada di luar kelas\n“Carla” Mafalda melambaikan tangannya pada Carla yang masih sibuk tertawa “kenapa kau tidak berada di kelas?” tanyanya\nCarla pun menghentikan tawanya dengan susah payah dan berjalan menuju Mafalda “aku mendapat hukuman bersama dengan Joshua” jawab Carla\n\n“yah, jangan sering bermain di kelas! Dasar kau. Ya sudah aku kembali ke kelas dulu” ucap Mafalda sebelum kembali ke kelasnya\n“siapa tadi?” tanya Joshua saat Carla kembali menghampirinya\n“Mafalda, temanku” jawab Carla\n“hey, boleh aku minta nomer ponselnya?” pinta Joshua\n“minta saja sendiri” ucap Carla sambil menjulurkan lidahnya\n\nTanpa di duga Joshua langsung berdiri dari duduknya dan berlari menghampiri Mafalda yang belum sempat masuk ke dalam kelas. Tentu Mafalda langsung memberikan nomer ponselnya karena dia tau bahwa Joshua adalah teman dari sahabatnya sendiri\n\nBeberapa minggu berlalu setelah Joshua meminta nomor ponsel Mafalda dan akhir-akhir ini dia juga sering menanyakan hal-hal yang bersangkutan dengan Mafalda pada Carla. Carla yang tidak tau apa maksud Joshua sebernarnya pun memberitahukan apa yang dia tau tentang Mafalda. Warna kesukaan barang barang kesukaannya dan lainnya\n\nSampai pada suatu hari, Carla tidak tau kenapa Joshua tiba-tiba menghindarinya. Dia bahkan tidak berbicara sama sekali pada Carla bahkan saat Carla mencoba bertanya padanya. Dia akan memutar tempat duduknya ke arah lain saat Carla mencoba menanyakan sesuatu padanya atau mengajaknya berbicara\n“apa yang sebenarnya terjadi padamu, huh?” tanya Olivia pada akhirnya yang mengetahui perubahan sikap Joshua yang sangat drastis\n“frustasi mungkin” canda CarlaDan Joshua sama sekali tidak menjawab pertanyaan mereka\n“sudahlah biarkan saja. Dia akan segera baikan” ucap Jason\n\nDan beberapa hari setelah itu Carla baru mengetahui bahwa Joshua telah menyatakan perasaannya pada Mafalda, temannya sendiri. Tidak bisa di pungkiri bahwa Carla merasa sedih karena sejujurnya dia menyimpan perasaan pada Joshua sejak lama. Dan dia baru menyadari mengapa Joshua selalu menanyakan hal-hal yang berhubungan dengan Mafalda. Apakah mungkin itu juga yang membuat nya menghindari Carla selama ini“wah, jadi kau menerimanya. Selamat!” ucap Carla sambil tertawa riang di depan Mafalda saat sahabatnya itu memberitahunya bahwa dia telah resmi berpacaran dengan Joshua\n\n“aku kira dia menyukaimu” ucap Mafalda yang membuat Carla terdiam sejenak\n“tentu saja tidak. Kami hanya teman biasa” ucapnya\n“aku tau. Terima kasih” gumam Mafalda dan memeluk erat sahabat terbaiknya itu\n\nCarla berangkat ke sekolah seperti biasa walaupun Mafalda sudah berangkat lebih dulu karena dia terlambat bangun pagi tadi. Sampai di kelas di menemukan Joshua yang sudah kembali berubah seperti dulu, Joshua yang periang dan selalu menceritakan lelucon lelucon konyolnya\n\n“jadi kau menghindariku beberapa hari ini karena kau sudah berpacaran dengan Mafalda?” tanya Carla saat mereka sudah kembali menjadi biang keributan di kelas\n“ha? Eum- aku hanya. Yah hm” jawab Joshua bingung atas pertanyaan Carla\n“hahaha oh ya, selamat ya!” ucap Carla yang melihat kebingungan di wajah Joshua\n“terima kasih” ucapnya\n\n‘you’ll never know what i feel’ batin Carla sedih dalam hatinya", + "Cerpen Persahabatan – Sahabat Itu Ga Ada Putusnya\nAku masih menatapnya tidak percaya saat ia mengatakan dengan jelas, di depan wajahku, dia memutuskan tali persahabatan yang telah terjalin sejak lima tahun yang lalu. Aku menggeleng-geleng, menatapnya nanar. Persahabatan yang telah susah payah dibangun dengan rasa sabar, hancur untuk alasan yang tidak kuketahui? Hoh, memalukan. Apa persahabatan ini serapuh itu\n“Kamu kenapa? Aneh. Jangan bercanda di saat-saat seperti ini, deh. Kenapa kamu tiba-tiba datang kesini, sambil berteriak kencang seolah-olah aku ini orang tuli, ‘persahabatan kita putus!’ apa itu cara yang baik untuk mengerjaiku?!” suaraku meninggi. Biar ini hanya bercanda, ini sungguh menyebalkan. Otakku masih berputar-putar, masih mencari-cari alasan ia mengatakan hal itu. Sudah jelas, ia tak mungkin mengatakannya untuk bercanda. Ia pasti punya alasan mengapa ia mengutarakan hal itu di depan wajahku tanpa memikirkan apa yang sedang dikatakannya\n“Aku kecewa sama kamu. Kecewa!” teriaknya. Kata-kata itu cukup mampu menusuk jantungku\nKami berargumen sangat lama, dengan cukup alot, hingga akhirnya aku kesal dan pergi. Ngapain masih disitu, memperjuangkan persahabatan yang memang sudah jatuh ke jurang? Aku juga masih punya harga diri untuk mengusiknya lagi. Biar saja dia bersama dengan teman-teman barunya, kita lihat saja siapa yang terbaik!\n\nSebentar lagi, ketika mereka sudah tidak membutuhkan kamu lagi, kamu pasti kembali padaku! Kamu pasti malu!\n\nDia mengatakan, aku telah merebut orang yang disukainya. Pasti anak-anak penyebar gosip itu lagi. Kenapa sih mulut mereka itu tidak bisa direm? Seharusnya mulut-mulut mereka itu ikut dioperasi agar tidak bisa lagi menyebarkan hal yang nggak jelas kebenarannya. Huh\nEsoknya, aku berangkat sekolah dengan wajah sedikit menyeramkan. Semalam aku tidak tidur, hanya tertawa dendam dan kesal-kesal sendiri. Aku rasa aku sudah gila. Pada saat acara sarapan pagi. Aku memelototi seluruh anggota keluargaku yang ada di meja makan. Ayah, ibu, kakak. Mereka semua telah dapat mataku yang mematikan ini. Mereka salah tingkah. Kakakku mengejekku lagi, ‘dasar perempuan mengerikan!’ sahutnya dari kejauhan\n“Kalau kau bicara lagi, besok kepalamu akan tergantung di depan sekolah,” ancamku sambil tersenyum licik. “Khu, Khu, khu…\nDi sekolah, aku langsung menuju kelasku, dan menduduki bangkuku tanpa menoleh sedikitpun ke arah belakang. Aku membiarkan bangku di sebelahku kosong. Daripada tasku harus tertindih, lebih baik ia mendapatkan kursi kosong itu sebagai tempat yang layak. Aku menggambar-gambar anime dan berusaha tidak menolehSalah satu dari mereka, mulai menunjukkan kekesalannya padaku. Karen menggebrak mejaku dengan kerasnya. Aku sama sekali tidak terkejut ataupun kesal karena dibandingkan ini, penganiayaan kakakku di rumah jauh lebih kejam, hehe\n“Sudah ditinggal sahabat begitu masih sombong. Pura-pura kuat. Memangnya kamu tidak punya rasa malu sampai-sampai mendekati cowok orang?!” bentaknya khas. Aku berdiri. Semua kata-kata yang akan kukeluarkan adalah kata-kata yang sudah kurancang selama semalaman penuh\n“Hei, berisik. Seharusnya aku yang tanya pada kalian, apa kalian tidak malu menyebarkan berita bohong seperti itu dan menghancurkan persahabatan orang?!” bentakku. “Kalau nggak tahu apa-apa, lebih baik diam dan jaga mulut lentur kalian itu. Dan, jangan campuri urusan orang. Apa kalian senang jika melihat orang menderita, hah?!\n“Tch…” Karen menggerakkan tangannya, ia mungkin ingin menamparku“Tampar saja kalau berani. Setelah kamu menamparku, tulang punggungmu akan kupatahkan dan kau akan kugantung di depan ruang kepala sekolah. Mau?Akhirnya dia menarik tangannya kembali, lalu duduk di bangkunya sambil mengumpat padaku\n—\n\n“Sebenarnya kenapa sih kamu?” Aku masih tidak mengerti. “Tiba-tiba percaya dengan pembicaraan mereka, padahal kita sama-sama tahu kalau sifat mereka seperti itu!“Aku nggak bisa percaya sama kamu lagi,” Isaknya. “Kamu jahat. Kamu ‘kan tahu aku suka sama Zumi. Kenapa kamu malah deket-deket dia?\n“Yumi, aku nggak bermaksud deket-deket, tapi memang ada pekerjaan yang harus kita selesaikan, itu alasannya…\n“Aku nggak percaya…” Dia tambah terisak. “Risa jahat!\nDia lalu berlari tanpa mendengarku. Aduh, gimana nih? Mungkin lebih baik aku bicara pada Zumi agar semua masalah selesai. Tapi, buat apa aku ngomong sama dia? Alasan apa yang harus aku bicarakan, ‘jelaskan kalau kita bukan apa-apa.’ Lalu dia akan bertanya, ‘memangnya kenapa?’ lalu aku jawab, ‘Yumi marah sama aku karena dia mengira kita pacaran.’ Lalu, berarti perasaan Yumi pada Zumi akan terbongkar. Sama saja menyiram bensin di atas api. Oh, oh, itu pikirkan nanti saja. Yang penting, Zumi harus kupaksa untuk bicara semuanya. Yeay!\n\n“Zumi, teman-teman mengira kita sedang dalam hubungan yang lebih dari teman, mereka salah paham, jadi mereka bermasalah denganku. Bisa bantu aku menjelaskannya?” akhirnya aku menemukan alasan yang tepat\n“Biar kutebak. Anak-anak bermulut setan itu?” ujarnya emosi. “Baik. Biar aku jelaskan pada mereka. Mereka memang tidak bisa berhenti beraksi.\nZumi bersedia membantuku. Esoknya, aku menyeret paksa Zumi ke hadapan anak-anak itu. Beberapa ada yang mencibir, mengejek, menghina, dan ucapan-ucapan menyakitkan semacamnya. Aku tidak begitu menghiraukan. Nggak ada gunanya juga\n“Jadi begini,” Zumi menjelaskannya dnegan gugup. “Kami ini sama sekali tidak ada apa-apa. Ingat festival pekan seni budaya yang akan diadakan minggu depan? Kami berdua diperintahkan oleh kepala sekolah untuk membuat event-event di dalamnya menjadi lebih hidup, dan mengatur jalannya festival. Kami juga bertanggung jawab atas dekorasi, tiket dan letak-letak stand. Jadi sejauh ini, kami hanya partner sementara yang disewa oleh sekolah untuk kelangsungan pekan seni budaya. Mengerti?“Jadi, kalian sebenarnya tidak ada apa-apa?” Yumi membuka mulutnya\n“Tidak,” Zumi menjawab. “Semua ini adalah tugas dari sekolah. Ingin lebih akurat? Mau kupanggil kepala sekolah untuk menjelaskannya sekarang?“Eh, tidak perlu repot-repot,” Karen mengelak. “Kami percaya kok.\nLalu gerombolan sial itu pergi ke luar, atau lebih tepatnya kabur. Aku dan Yumi sama-sama tersenyum, lalu kami berpelukan. Ia meminta maaf karena sempat tak percaya padaku. Tentu, aku memaafkannya. Persahabatan kami terjalin kembali. Lalu, kami berdua menatap ke arah Zumi, yang keheranan dengan sikap kami berdua\n“Sebenarnya ini ada apa sih? Kok jadi drama gini?” tanyanya bingung\nAku tersenyum. Biar saja waktu mengungkap rahasia ini pada saatnya…", + "Cerpen Persahabatan – Sahabat Jadi Cinta\nNama gue Liliana Septi Anugrah pratama. Gue biasa dipanggil Lili. Gue memang bukan cewek yang sempurna. Inget, di dunia ini nggak ada manusia yang sempurna. Kesempurnaan hanya milik Allah. Gua terkenal sebagai cewek tomboy yang maniak basket. And you know? Bagi gue basket is my soulmate. Ada saat suka maupun duka\nDah deh kenalannya. Sekarang ngomongin cinta (ceile… cinta). Jangan salah loh cewek tomboy juga punya cinta\nYa, dialah Andika Widi Gusmawan, biasa di panggil Widi. Cowok pendiem, ganteng, manis and super duper keren. Dialah cowok yang bener-bener bisa buat gue jatuh cinta. Walaupun dia bukan yang pertama tapi I hope dia yang terakhir. Amin\nGue kenal Widi dari awal gue masuk SMA. Kita sekolah di tempat yang sama bahkan di kelas yang sama. Awalnya kita nggak pernah saling nyapa. Bahkan, di hari pertama kita masuk kelas, kita berebutan bangku. Haduh, kesan pertama kok gini amat sih\nHingga akhirnya gue sebagai cewek tomboy yang punya jiwa friendly ngeberaniin diri buat ngobrol dan minta nomor hapenya. Trereng, Waca. Nomor hape dia sudah ada di tangan. Cowok mana sih yang berani nggak ngasih nomor hape sama cewek manis and imut seantero bumi dan mars. (Hahaha, lebay, narsis, GR and kePDan jadi satu)\n\nAwalnya kikuk sih, paling-paling sms cuman nanya lagi apa, dah makan belum dan beribu kalimat-kalimat nggak jelas yang sudah pasti ketahuan cuman basa-basi doank. Hehehe\nYa, hubungan kita flat dan monotone. Ya iyalah secara gue saat itu belum punya perasaan sama dia. Belum fallin love gitu. Saat itu gue juga punya cowok sebenarnya tapi gue jarang sms an atau pun telepon. Cowok gue ini tipe cowok yang basi abis. Susah diajak bercanda tapi bukan kutu buku atau bintang kelas gitu. Pokoknya basi deh\nSuatu hari, gue sms Widi dan yang bales ceweknya. Waduh, gawat ini ntar difikir gue cewek perusak rumah tangga orang. Eits salah, maksud gue perusak hubungan orang lain. Gue jadi males deh sms dia\nHari-hari gue terasa garing tanpa sms dari dia. Setelah hampir seminggu kita nggak sms an tiba-tiba dia sms\n“Hay Friend.”, tertera kalimat itu di layar hapeku“Waduh, tumben nih anak sms.”, batin gue“Hay juga. Tumben sms nggak takut dimarahin mbak pacar nih. Hahaha.”, balasku“Nggak boleh iya sms? Dah the end.”, jawabnya“Boleh. Hapeku terbuka untuk siapa aja yang lagi buang gratisan. Dah berapa episode kok dah the end sih? Haha“Hahaha, males pacaran sama anak kecil dikit-dikit ngambek. Mending ngejomblo. BEBAS gitu.\nBeberapa hari kemudian gue denger dia deket sama kakak kelas gue. Waduh playboy juga nih anak. Tapi dia malah makin sering sms gue setelah punya pacar baru. Ya sharing-sharing gitu lah. Makin ke sininya kita jadi akrab banget\nKita di kelas sudah kaya tikus dan kucing. Kocak and gokil abis. Tiap hari berantem dan tau nggak kata temen gue dimana ada gue di situ ada Widi. Emang iya? Nggak juga kali\nPokoknya kelas gue nggak pernah sepi dari kegokilan kita. Saking akrabnya gue jadi ngrasa nyaman dan mulai fallin love sama diaTapi gue sadar dia cuman nganggap gue sebagai sahabat, nggak lebih. Dia pun masih punya cewek dan ceweknya itu kakak kelas gue dan sahabat gue juga\nPagi ini dia cerita dia putus sama kakak kelas gue. Dalam hati sebenarya gue seneng banget. Hari ini dia datang ke sekolah dengan muka kusut. Kaya benang aja kusut. Tapi saat jam pelajaran gue nggak lihat dia ada di kelas. Dia bolos. Hellow, masih jaman iya galau karena putus cinta\nBeberapa hari kemudian gue denger dia deket sama temen seangkatan gue tapi beda kelas, Puspa. Hati gue rasanya remuk kaya dilindas truk kontainer full fill. Gue berusaha nutupin perasaan hati ini. Gua dukung dia sama Puspa\n“Hay Sob. Denger-denger Lu deket ma Puspa. Tembak aja Bro, keburu disamber orang loh.”, tantangku“Nggaklah Li, Gue cuman temenan sama dia. Gue masih sayang sam mantan gue.”, jawabnya lemah“Siapa Sob? Yani kakak kelas kita itu?\n“Bukanlah, Tiara. Lu belum kenal dia kok. Udahlah gue pusing, nggak usah bahas-bahas cewek lagi deh. Capek gue.“Oke.”, jawabku singkat seraya ninggalin dia pergi\nDi luar kelas gue melamun. Rasanya hati ini hancur banget denger pernyataan Widi tadi. Tapi gue bertekad buat nutupin rapat-rapat perasaan ini padanya\nPepatah serapat-rapatnya kamu menyimpan bangkai pasti akhirnya akan kecium juga baunya, mungkin benar. Sepandai-pandainya gue nutupin perasaan hati ini akhirnya Widi pasti tau\n“Sorry Sob, kita sahabatan aja ya. Gue lagi banyak masalah and lagi pengen sendiri.”, katanya padaku\nSebenarnya saat itu ingin rasanya air mataku mengalir tapi ku tahan. Aku tak ingin terlihat lemah di hadapannya. Hati ini hancur berkeping-keping. Memang tak ada yang berubah pada diri kita, kita tetap bersahabat tapi rasa ingin memilikinya seakan membuat diri ini ingin menangis saat di dekatnya. Rasa sayang sebagai seorang sahabat kini telah berubah. Aku sangat mengharapkannya, biarlah semua kan indah pada waktunya.", + "Cerpen Persahabatan – Pesawat Kertas\n“Plukk!” pesawat kertas itu jatuh tepat di depannya. “Mana pesawatnya?” ucap Putri. “Emm mana yaa?” jawab Yono. “Siniin dong, plisss!” pinta Putri. “Ya udah deh, nih” ucap Yono sambil memberikan pesawat kertas itu kepada Putri. “Nah gitu dong” ucap Putri manis. Putri pun memainkan pesawat kertasnya kembali\nPutri memang sangat suka dengan pesawat kertas. Entah, menurutnya pesawat kertas adalah hal yang paling menginspirasi dirinya. “Put, kenapa sih main pesawat terus?” tanya Via teman Putri. “Memangnya kenapa?” balas Putri sinis. “Ya gak apa-apa, kamu itu aneh!” ujar Via. Putri segera berhenti memainkan pesawat kertasnya itu. “Aneh kenapa?” ucap Putri tak mengerti. “Liat dong, semua anak main bareng! Tapi kamu? Asik sama dunia pesawatmu sendiri!” gerutu Via kesal. “Tapi? Ini memang aku! Maaf aku gak mau debat sama kamu! Aku lagi puasa” balas Putri sabar. Via hanya diam membatu setelah mendengar ucapan itu dari Putri, dan ia langsung meninggalkan Putri begitu saja\nPutri merenungi apa yang Via katakan. “Ya Allah, apa benar aku ini salah?” batinnya menangis. “Apa aku sibuk dengan duniaku sendiri? Tapi, ini bukan duniaku! Ini hanyalah cita-citaku saja” perlahan ia mulai meneteskan air mata\nKeesokan harinya, saat istirahat pertama Putri masih diam di tempat duduknya. “Put, kamu kenapa?” tanya Nita, teman Putri. “Ehh, gak gak papa kok” ucap Putri gugup. “Kamu dari tadi melamun? Biasanya kamu main pesawat kertas?” tanya Nita penasaran. “Iya, gak papa” ucap Putri tersenyum tipis. Putri menaruh kepalanya di atas meja. “Kamu sakit Put?” tanya Nita khawatir. “Tidak” balas Putri pendek. “Ya sudah kalau begitu, aku keluar ya?” ucap Nita. “Iya” jawab Putri\nPutri masih memikirkan kejadian yang kemarin, saat dirinya ditegur oleh Via. “Put, aku minta maaf” ucap seseorang menepuk pundak Putri. Serentak Putri menoleh ke arahnya. “Eh Via, Iya gak papa” ucap Putri seraya mengelap air matanya. “Putri kok nangis?” ucap Via penuh rasa bersalah. “Enggak gak papa” ucap Putri menenangkan diri. Tanpa berkata lain, Via langsung memeluk erat Putri. “Maaf yaa, kemarin aku ngomong gitu, karena aku ngerasa kamu gak mau deket sama kita” ucap Via berusaha menjelaskan. “Iya, tapi bukan itu maksudku” Putri berusaha menjawab. “Iya, ya sudahlah tidak usah dibahas kembali” ucap Via menyelesaikan\nDari kejadian itu, Putri membuang jauh-jauh tentang keinginannya untuk menjadi seorang Insinyur Pesawat. Putri tak ingin ada temannya yang merasa ia jauhi karena hanya sebuah pesawat kertas! “Mungkin mereka benar, aku hanya sibuk dengan dunia khayalku” ucap batinnya. Putri segera membuang semua pesawat kertasnya ke dalam tong sampah. “Loh Put kenapa dibuang?” tanya Gigih tak mengerti. “Emm, tak apa” balas Putri ringan. “Kamu itu aneh! Kemarin kamu buat pesawat kertas sampai buku kamu tipis? Sekarang malah dibuang? Mubadzir Put!” ujar Gigih menasehati. Putri diam dan tak tahu harus mengatakan apa. Akhirnya Putri langsung berlari meninggalkan Gigih. Hati Putri sangat kacau saat itu, air matanya terus membasahi pipinya. Putri tak habis pikir, semua yang ia lakukan selalu saja salah\nPutri segera mengambil buku diary yang ada di dalam tasnya. “Dear diary, Putri nggak paham sama semua ini. Hati Putri rapuh! Semua yang Putri lakukan selalu saja salah, Putri bingung Putri harus bagaimana?” tulis Putri pada diary tersebut. Setelah selesai menulis diary, Putri segera menaruhnya kembali ke dalam tas\nDetik berganti detik, menit berganti menit, jam berganti jam, dan hari berganti hari. Saatnya Putri kembali untuk masuk sekolah. Hari ini hari bagi Putri melaksanakan tugas piket. “Put, ini diisi dulu absensi kelasnya” ujar Aan. “Iya, taruh saja dulu di mejaku” balas Putri yang sedang menyapu lantai kelas. “Oke” ucap Aan sambil meletakkan absensi di meja Putri. Setelah lantai kelas terlihat bersih, Putri segera mengembalikan sapu di pojok kelas, dan segera kembali ke mejanya untuk mengisi absensi kelas\nWaktu pun berputar dengan sangat cepat, tak terasa sudah saatnya pulang. Putri segera meraih tasnya dan segera meninggalkan tempat duduknya. Ketika Putri sedang berjalan keluar kelas tiba-tiba hujan lebat pun turun. “Yahh? Kok hujan?” ucap Putri dengan nada kecewa. Putri pun memutuskan untuk menunggu hujan itu sampai reda. Setelah menunggu beberapa menit, hujan itu belum juga reda. “Pulangnya bagaimana ini?” hati Putri bertanya. Putri kebingungan karena hujan semakin deras. Seketika Putri memandang langit, Putri segera mengeluarkan buku diarynya. “Dear diary, Langit kenapa kamu nangis? Jangan menangis sekarang, cukup aku saja yang merasakan perih ini. Hentikan sekarang juga tangisanmu, aku sedih jika kau sedih. Kumohonn” tulis Putri pada diary tersebut. Ajaibb! Seketika langit langsung memunculkan senyumannya melalui cahaya matahari. Tanpa berpikir panjang, Putri langsung bergegas untuk kembali ke rumah.Pagi pun telah datang kembali. Saatnya berangkat sekolah. Pagi ini Putri kelihatan sangat lesu. “Kenapa? Sakit?” tanya Nikmah. “Tidak” singkatnya. “Tapi wajahmu pucat pasi” tanyanya kembali. “Sudah biasa” balas Putri renyah. “Biasa bagaimana?” ucapnya penasaran. “Sudahlah lupakan saja” ujar Putri. “Hari ini kamu sangat aneh” ucap Nikmah. “Sudah cukup! jangan bilang aku aneh lagi!” gerutu Putri. “Tapi hari ini? Kau tak seriang yang kemarin” ujar Nikmah. “Ya! Karena aku baru saja kehilangan cita-citaku” ucapnya meneteskan air mata. “Cita-citamu? Apa?” tanya Nikmah penasaran. “Insinyur pesawat” celetuk Putri sambil mengelap air matanya. “Kenapa” tanyanya belum mengerti. “Aku bingung, kau tahu kan? Aku sangat suka dengan pesawat? Tapi banyak orang yang merasa, kalau aku menjauhi mereka hanya karena sebuah pesawat kertas? Hanya karena aku sibuk dengan duniaku?” ucapnya dengan air mata yang mengalir\n“Siapa yang merasa? Aku tidak? Aku mendukungmu” ucapnya menenangkan. “Ya! Memang dia bukan kamu” ucap Putri menegaskan. “Lalu siapa?” tanyanya penasaran. “Sudahlah lupakan saja” ucap Putri membuang muka. “Put, percayalah! Jika Insinyur Pesawat adalah hidupmu, pasti kau bisa mencapainya” ucap Nikmah memotivasi. “Iya, tapi aku bingung” ucap Putri dengan hati tak karuan. Nikmah langsung menyobek kertas bukunya. “Nih, tulis saja apa yang kamu rasakan sekarang” perintahnya. “Untuk apa?” tanya Putri tak mengerti. “Sudahlah lakukan saja” perintahnya kembali. “Baiklah” ucap Putri menyerah\nPutri segera menuliskan perasaannya sekarang di kertas yang diberikan oleh Nikmah. “Sudah. Lalu mau kau apakan?” ucap Putri bingung. Tanpa mengeluarkan sepatah kata apapun, Nikmah langsung melipat kertas itu menjadi sebuah pesawat. “Apa maksudnya? Aku tak mengerti” ucap Putri. “Sudah, ayo ikut aku” balas Nikmah sambil menarik tangan Putri. “Heyy! Mau kemana?” bentak Putri. Nikmah tak menghiraukan suara Putri yang terus berteriak. Dan tiba-tiba Nikmah menghentikan langkahnya di depan Laboratorium Bahasa. “Mau apa sih? Malah kesini?” ucap Putri penuh bertanya. “Kamu itu dari tadi cerewet banget sih?” gerutu Nikmah kesal. “Iya iya deh” ucap Putri mengalah. “Sudah terbangkan pesawatmu disini” ucapnya memerintah kembali\n“Baiklah” ujar Putri. Putri segera menerbangkan pesawat kertasnya itu, dan anehnya pesawat itu langsung menghilang, entah kemana. “Loh? Pesawatnya kemana?” ucap Putri keheranan. “Sudahlah, mungkin sudah sampai ke Allah” ujar Nikmah menghibur. “Okee, mungkin saja” ucap Putri penuh dengan senyum. “Ya sudah, kamu kembali ke kelas dulu saja, aku masih ada urusan sebentar” ucap Nikmah. “Ya sudah, aku kembali” ujarnya sambil berlari kecil. Setelah Putri kembali ke kelas, Nikmah segera mencari pesawat milik Putri tadi. “Ini dia!” ucap Nikmah lirih. Setelah itu Nikmah langsung menyimpan pesawat milik Putri tadi di sakunya\n*Teeet* bel pulang sekolah berbunyi nyaring. Semua murid-murid berhamburan keluar kelas. Tapi beda halnya dengan Nikmah. Ketika bel pulang sekolah berbunyi, ia malah pergi ke perpustakaan. “Hey! Mau kemana kamu?” ujar Putri setengah berteriak. “Emm? Perpustakaan” jawab Nikmah kebingungan. “Ini kan sudah bel pulang? Perpustakaan pastinya sudah tutup” ucap Putri berpendapat. “Biarlah!” celetuk Nikmah. “Ya sudah kalau begitu! Aku pulang!” balas Putri kesal. Putri pun langsung membuang mukanya dan segera pergi meninggalkan Nikmah\nPagi pun telah datang kembali. Hari ini tepat umurnya bertambah menjadi 13 tahun. “Selamat Ulang Tahun Putri” ucap Ibu sambil membawa kue tart. “Wahh, terimakasih Bu” balas Putri sambil mencium ibunya. “Iya sama-sama Put. Ya sudah, pergi mandi dulu sana” ucap Ibunya lembut. “Baik Bu” balasnya menurut\nSetelah selesai, Putri segera bersiap-siap dan segera menuju ke sekolah. Putri berjalan dengan cepat untuk menuju ke kelasnya. “Kok pintunya ditutup? Ini kan masih setengah tujuh?” batinnya bergumam. Putri pun makin mempercepat langkahnya. Ia takut, jika pagi ini ada pelajaran jam nol. Ketika Putri membuka pintu kelasnya, Putri tersentak kaget! Karena teman-teman kelasnya membuat kejutan yang sangat spesial. Putri tercengang, memandangi setiap sudut kelasnya. “Pesawat kertas?” ucap Putri agak keras. “Maaf ya Put, sebenarnya kemarin aku membaca isi pesawat kertas yang kau terbangkan di depan Laboratorium Bahasa” jelasnya meminta maaf. “Kau membacanya?” tanya Putri. “Maaf Put” ucap Nikmah kembali\n“Tak apa. terimakasih atas semua ini. Aku suka” balas Putri penuh senyuman. “Iya Put sama-sama. Happy birthday sahabatku” ucap Nikmah seraya memeluk Putri. “Terimakasih” balas Putri sambil memeluk Nikmah juga. “Putriii..” panggil seseorang. “Via?” ucap Putri sambil menoleh ke arahnya. “Happy birthday yaa” ujarnya sambil menepuk pundak Putri. “Iya, terimakasih” balas Putri. “Maaf ya Put, kemarin aku melarangmu untuk..”. “Sudahlah tak apa” ucap Putri memotong perkataan Via. “Baiklah” ujar Via. “Put.. ini semua sebenarnya ide Via” ucap Yono tiba-tiba. “Oya?” celetuk Putri. “Iyaa Put” timpal Nikmah. “Terimakasih Via. Ini sangat amazing!” ujar Putri sambil memeluk Via. “Iya Put sama-sama” balas Via tersenyum manis\nAkhirnya, Putri dan teman kelasnya pun bergembira bersama dan bersenang-senang dengan semua pesawat kertas!!", + "Cerpen Perpisahan – Senyummu Tangisku\nAku tak ingin dirinya pergi, aku tak ingin melepas cinta yang telah tercipta.. namun begitu banyak masalah harus merelakan semuanya. Aku termenung di bawah rindang taman kota, semilir angin berhembus melambaikan rambutku\n“hey alifah sudah lama kamu di sini?” seorang pria datang dengan bunga dan beberapa makanan kecil di tangannnya“aku baru datang juga kokia tak akan pernah tahu sudah berpa lama aku menunggu.” batinku sedikit\n\nIa menyerahkan bunga dan kami terdiam. “gimana fred, apa kita masih bisa tetap bersama selamanya?, sedangkan orang tuamu menolak dan mengusirku. tanpa alasan” aku berkata memulai pembicaraan\nAlfred duduk disampingku dan termenung beberapa saat. “maafkan aku alifah, aku takut untuk mengatakan ini, tapi kamu tahu kan, orang tua ku tak mengizinkan hubungan kita.” alfred berkata sambil menahan senyum palsunya\n“Sudahlah fred, aku kan sudah bilang, ini bukan jalan terbaik untuk kita, kamu pergi saja dan jangan hiraukan aku.” aku berkata menatap matanyaSepi sekali disini, kami termenung seakan tak saling mengenal setelah sekian lamanya kami menjalin hubungan terlarang ini\nTiba-tiba sebuah kendaraan berhenti dan seorang turun menghampiri kami, ternyata mereka adalah orang tua alfred. Kami berdiri saling berpandangan, dan alfred berjalan lunglai menghadap orang tuanya\nMamanya alfred membisikan sesuatu ke kuping alfred, dan ia berlari ke depanku menatap dan hening beberapa saat\n“maafkan alifah, kamu membuatku tak fokus pada sekolah dan nilaiku berantakan, selamat tinggal. jagan hubungi aku lagi” alfred berkata dan melepaskan tangannya dan berlalu dengan perlu\nBeberapa bulan kemudian\n\naku termenung di kamar. beberpa kali mamaku mengajakku makan, namun aku tak bernafsu. Hp di samping tempat tidurku berdering “halo, ini aku alfred!” Sebuah suara di seberang sana\n“ia kenpa fred” aku berkata singkat memendam semua perasaan dan rindu yang bergejolak\nAlfred bicara panjang lebar dan aku hanya berkata “ya atau tidak?” aku hanya tak ingin mengulang rasa yang telah mati\nAku hanya katakan padanya aku mencintainya sepenuh hatiku. Dan sebagainya\nAku tak ingin alfred tahu kalau sekarang aku telah pindah ke jakarta meneruskan kuliah serta mencoba melupakan semua tentang masa lalu dengannya.. masa di mana aku merasa sangat berarti, dan semua terasa indah.", + "Cerpen Perpisahan – Kegagalan\nPerlahan ku buka sampul binder dari dalam tumpukan baju dalam lemari ku. Di lembar pertama terlihat jelas tulisan lamaku, sebuah kisah luka dengan gambar “Teddy Bear” di pojok kanan atasnya. Tanggal ini dua tahun lalu, tertulis jelas di atas kiri kertas di halaman pertama itu\nSekilas teringat kenangan saat tanggal dalam tulisan binder itu terjadi. Malam itu turun hujan. Seolah Allah memang telah merencanakan kegagalan urutan jadwal yang telah aku susun sehari sebelumnya. Padahal di siang hari sang sumber panas bumi bersinar sangat terik, menandakan tak akan turun hujan hari itu hingga malam. Kini aku sadar, Allah memang sudah mengatur semuanya agar rencana ku batal semua\nAku ingat betul janji Verli yang akan mengajak ku menemui ibunya dihari itu. Sedikit heran memang dengan sikapnya seminggu terakhir sebelum peristiwa itu terjadi. Ia lebih perhatian dari biasanya. Sikapnya manis\n“Nanti aku SMS kamu ya yanq, kalo aku sudah siap mau jemput kamu” Smsnya hadir mengisi layar handphone ku\n“ok. Jam berapa kira-kira kamu jemput aku?\n“ya nanti aku kasih kabar dech\n“kamu lagi apa sich yanq?\n“aku lagi tiduran.\n“haaah? Emang kamu mau jemput aku jam berapa sich? Ini hampir jam satu” aku mulai naik darah. Mau jam berapa lagi dia menjemputku, kalo jam satu siang saja dia masih berbaring santai di ranjang empuknya itu. Sedangkan aku dari tadi mondar-mandir merapikan baju dan make up q\n“Sayanq… Please. Sabar yaa, nanti aq kasi kabar. OK?\naku benar-benar kesal. Segera ku stater scoopy ku\n“Uukh,.. tau gak sich? Verli tu bener-bener ngeselin…!” oceh ku ketika Mini membukakan pintunya setelah mendengar ucapan salam ku yg berulang-ulang\n“Please deh non, jangan marah-marah di sini ya. Aku bukan tempat pelampiasan tau?” Balas Mini dengan nada malas\nAq langsung nyelonong kedalam kamarnya, dengan meraih bantal guling bergambar Hello Kity, q hempaskan tubuhku di atas spring bad Mini\n“Yaa ella… kamu tuh udah cantik, koq malah tiduran? Mau kemana si non?\n“Verli tuh ngeselin banget. Dia janji mau ngenalin aku ke nyokapnya. Tapi di ulur-ulur mulu’. Biasanya dia udah nongol dari jam 11 siang. Ini udah hampir jam 2 dia masih belum nongol. Dari tadi bilangnya mau ngabarin kalo dia udah siap jemput aku. Tapi mana…?\n“Mungkin masih ada yang harus disiapin sama nyokapnya. Secara mau ketemu calon mantua. Hihihi\n“Aku mau numpang mimpi disini\n“OK. Ayooo mama temeni bobok” ucap Mini menggoda ku\nTut…Tut…Tut…\n\nSegera ku raih hp ku yang sedari tadi ku selipkan di bawah bantal\nSayang, Ntar malam aja ya aku jemput kamu. Mama baru pulang tuh\n\nDiterima :\n\n16:12:27\n\nHari ini\n\nDari\n\nChayanq q\n\nAstaga, sudah jam empat lewat. Tapi dia malah membatalkan janji. Darah ku seakan-akan sudah berada di atas kepala. Air mata hampir tumpah karena menahan emosi\n“Mini sayang, aku pulang ya” kugoyang-goyangkan badan Mini berharap ia segera bangun untuk mendengar tangisanku\n\n“eemmm.. Iya.. ati-ati yaa. aku ngantuk banget. See You sayang\nUkh… Tega kamu Min. Aku lagi galau tau’? bangun dong… Pinta ku dalam hati\n\nDengan berat hati ku tinggalkan ruang 3X4 berwarna pink ini. Malas rasanya pulang kerumah. Mood ku bakal bertambah buruk. Apa lagi dengan ditemani foto-foto Verli\nEntah apa rencana Tuhan hari ini. baru saja aku melangkahkan kaki didalam istana ku, turun rintik hujan di iringi angin yang menusuk hingga kedalam tulang. Ini pertanda buruk fikirku. Semoga hanya fikirku. Semoga\nBenar saja. Hujan bertambah semakin deras. Fikiran dan perasaan ku semakin gak karuan. Verli masih tetap tak memberi kabar, padahal timer di layar hp ku sudah menunjukkan angka 19:19. Pasti hujan yang akan menjadi alasan utama saat ia menghubungi ku nanti\ntut…tut…tut… segera ku sambar hp ku setelah nada SMS berdering\n“Yanq, Hujan :(\nApa kataku. HUJAN. Yaa Hujan, aku tau koq, gerutuku dalam hati. Aku terdiam sesaat memikirkan kata-kata yang akan ku ketik untuk balasan SMS menyebalkan itu. Terlalu banyak rasanya emosi yang akan aku sampaikan lewat layar mungil itu. hingga akhirnya kuputuskan untuk menelponnya saja\n“Hallo” Suara lembut penuh ketenangan khas Verli terdengar\n“Kamu tuh ya… jangan mainin perasaan aku donk!\n“Yanq, hujan. Kamu gak mungkin mau hujan-hujanan kan saat ketemu sama mama? Lagian aku takut kamu jadi sakit\n“Iya aku tau koq kalau sekarang hujan. Tapi itu kan salah kamu. Aku udah nungguin kamu dari tadi siang. Tapi kamu nunda-nunda mulu’. Kayaknya kamu emang sengaja dech…!\n“Yanq… tolong dong ngertiin aku. dikit aja\n“harus sampe kapan sih aku ngertiin kamu…? kamu tuh yang gak pernah bisa ngertiin aku..! Kamu emang gak niat kan mau ngenalin aku sama mama kamu?!\n“OK. OK. Aku yang salah, aku minta maaf\n“Bosen tau dengerin ucapan maaf dari mulut kamu. Selalu cuma itu yang kamu lakuin…!\n“Jadi aku harus gimana?\n“Terserah kamu dech maunya gimana. Aku ngikutin aja apa maunya kamu. Aku tau koq, mama kamu pasti gak setuju sama aku. makanya kamu nunda-nunda mulu dari tadi.\n“Yanq bukannya gi…\n“Kenapa gak bilang dari dulu aja kalo kenyataannya emank gitu. Pasti aku gak akan berharap banyak dari kamu dan mungkin sekarang aku udah ngelupain kamu.\n“Yanq, dengerin dulu. Aku bener-bener minta maaf. Aku gak tau kalo kenyataannya harus kayak gini. Kamu bener, mama aku gak bisa terima kamu. Tapi aku sayang kamu Ve…\nPadahal aku hanya asal berucap, tapi nyatanya itu benar. Air mataku sudah tak mampu ku bendung. Untuk meluapkan emosi dalam bentuk cacian pun aku sudah tak sanggup. Kata-kata itu hampir keluar tapi tertahan di kerongkongan ku\n“Ve… Pliss jangan nangis. Aku juga berat mau jalanin semua ini. Jujur, aku sayang banget sama kamu Ve…\nAku tak menjawab apa-apa. Aku hanya mencoba menangkan hati ku\n“Ve… Veli… kita jalani hubungan ini sembunyi-sembunyi aja ya. Ve… Pliss jawab aku. Yanq…\nUcapan lembut Verli malah membuat aku semakin sakit. Air mata yang hampir tertahan pun malah semakin leluasa mengalir\n“Ki… Ta.. Pu..Tuss.. I…ngat… Ver, Hu..kummm… Kar…ma pas…ti …ber…laku. En…tah… p…da a..na…kmu ke…lak a…ta…u pa…da a…dik..mu… Ba…la…sa…n pass..sti a…ka..n le..bih me…nya…kitkann” susah mati aku mencoba bersuara\n\n“Yanq… Jangan putusin aku\n“Gak…!\nTut…Tut…Tut…\n\nSambungan telphone langsung ku matikan. Kutumpahkan semua luka dalam sapu tangan biru hadiah ulang tahun pemberian Verli. Menggunakannya justru malah semakin membuat kenangan manis hari kemarin terukir jelas dalam bayangan mataku. Kini sapu tangan itu kulipat rapi di bagian dalam cover Binder ini\nBeruntung setelah kepergiannya, Allah mempertemukan aku dengan Dino. Lelaki sempurna yang akan menjadi ayah dari janin yang sedang ku jaga dalam rahimku. Kukira aku akan mati, depresi atau bahkan gila setelah berpisah dari Verli. Sekali lagi aku benar-beanar bersyukur. Mungkin jika kami masih menjalin hubungan, aku tak akan pernah menemukan imam terbaik seperti Dino\nBelakangan ku dengar adik perempuan Verli satu-satunya telah hamil tanpa tahu siapa ayah dari janin itu. Aku sempat menyesal pernah mengucap sumpah seperti itu. Mungkin ini bukti Tuhan, hukum karma pasti berlaku.", + "Cerpen Perpisahan – Kaulah Segalanya Di Hidupku\nPerlahan aku berjalan menaiki jalan setapak menuju sebuah danau, bau tanah dari rintik hujan menemaniku menjelajahi petualangan tersebut.. Aku tersenyum melihat sesosok pria telah menungguku. Aku mempercepat langkahku, mencoba menghadapi lebih cepat, tak peduli hujan yang semakin deras, dan beceknya tanah khas pedesaan mengotori rok panjang putihku.\n“Dor~!! Hayo?, ngelamunin aku ya?” ujarku berniat mengagetkannya. “Kamu kok telat banget sih? Tuhkan udah tambah gelap. Lilinnya udah mati semua… terkena air hujan tuh!” jawabnya sambil menatap terus kearah lilin-lilin kecil yang telah padam terkena air hujan. “Lilin berwarna merah, warna kesukaanku”, kataku sambil terus memandangi kearah lilin-lilin kecil yang beberapa telah ditatanya sedemikian rupa membentuk hati, “ya memang lilin-lilin itu sangat indahAku melihatnya sekilas sebelum mati satu persatu. Namun, menurutku, lebih indah melihat senyumannya daripada lilin yang telah padam tersebut. Jauh lebih nyata dan indah.. “Aneh ya? tadi tuh di sekolah panas banget! Sekarang disini hujan..” ujarku memperbaiki suasana.. “Haha, matahari sama hujan kan kuatan matahari..” jawabnya tersenyum, “Kamu lama ya nunggunya? Aku minta maaf banget!” Kataku memohon, “Nggak kok.. baru aja.. aku cuma bercanda tadi” katanya sambil terus tersenyum.\n“Maaf ya kemarin aku gak bisa temani kamu check up ke dokter, aku ada pelajaran tambahan, gimana kata dokter?” tanyaku dengan lembut namun dengan nada khawatir. “Nggak apa-apa kok.. Aku baik-baik saja, aku akan selalu baik-baik saja kalau bertemu sama kamu” ujarnya sekali lagi dengan senyuman jahil khasnya.. “Ya maunya”.. yah aku tau keadaannya.. Dia kuat di luar namun rapuh di dalam.. Entah apa yang membuatnya selalu tegar menghadapi cobaan tersebut. Seolah kehabisan kata-kata kita hanya terdiam\nSore itu, aku dan kekasihku Justin, mengunjungi danau favorit kami.. tempat dimana kami pertama bertemu, berkenalan, bahkan mengerjakan segala hal bersama-sama. Danau Abadi. Ya begitulah Justin menamakan Danau itu. Memang terdengar aneh, berapa kali aku menanyakan mengapa dia menamakan seperti itu, dan Justin menjawab “Agar nanti saat aku tak ada lagi kamu tetap ada mengenangku di masa-masa dimana awal kita bertemu, sampai saat ini”Sekali lagi dia menjawabnya dengar senyuman jahil khasnya, “Kamu pernah nyadar gak ada sesuatu di danau ini?” tanyanya kepadaku, “Nyadar apaan? perasaan selama 4 tahun kita pacaran keadaan danau ini baik-baik aja deh..” kataku, “Dasar gak peka! Itu lho.. berang-berangnya!.. Aneh aja, masa musim panas gini main di danau..” jelasnya, “Apanya yang aneh? perasaan dari dulu deh kayak gitu..” ujarku nggak ngerti.. “Bukan itu maksudku.. mereka itukan sepasang dari dulu.. aku perhatiin mereka itu saling setia rasanya.. mereka gak pernah ganti pasangan.. Kamu mau nggak, kalau aku udah nggak ada nanti, kamu mau kan cari orang lain buat jagain kamu? yang lebih sehat dan gak sakit-sakitan?: pertanyaannya membuat ku tereguh.\n“Aku gak pernah berfikiran hal itu..” batinmu.. “Dulu, Justin itu optimis, tegar, kemana Justin yang dulu?” tanyaku kepada Justin, “Sebentar aku belum selesai.. aku hanya berjaga-jaga.. Nanti kalau aku sudah tidak ada, supaya kamu tak ragu untuk mencari penggantiku..” Jelasnya dengan nada lirih.. “Justin.. kamu harus optimis. Coba lihat matahari itu, Dia memang selalu terbit dan terbenam tiap hari.. Ibaratkan matahari itu kamu, itu tandanya kalau ada terang kan setelah gelap! Pasti ada harapan buat kamu, sekecil apa pun itu!” Ujarku, “Aku gak akan baik-baik saja.. tetapi aku akan selalu berusaha baik untukmu..” ujarnya kepadaku, akupun meneteskan beberapa butir air mata yang tak kuat ku tampung lagi, segera ku hapus sebelum dia melihatnya.. “Aku akan selalu menyanyangimu..” kataku yang segera memeluknya, “Danau ini abadi, berang-berang ini abadi, begitu juga cinta aku ke padamu akan selalu abadi.. Carilah seseorang yang lebih baik dariku suatu saat nanti..” katanya seraya menghapus air mata dari pelupuk mataku.. Air bening yang keluar dari pelupuk mataku sudah tak kuat ku bendung.\n“Hey! Sedang apa?” Kata Danny, menepuk bahuku, “Hah? Tidak.. Aku hanya sedang ingin mengingat kenangan ini.. dari diaryku..”, “Itu lagi? Kisah cintamu.. kekasihmu yang sudah meninggalkanmu.. dan segala-galanya dalam hidupmu.. akan abadi seperti danau ini.. tegarlah.. sudah 2 tahun kau seperti ini.. bangkit dan semangat!” kata Danny, sahabat terbaikku.. “Ya.. aku dan segala-galanya dalam hidupku akan abadi seperti danau ini..”", + "Cerpen Remaja – Masih Amatir\nSiang itu aku berjalan dengan santai menuju ruang guru untuk melaksanakan tugas yang telah diamanahkan kepadaku, tak terbebani sama sekali aku ini namun mata-mata yang curiga dan sok tau itu menilai dengan salah, saya memang agak terkesan loyo, lemah, dan putus asa namun itu hanyalah penampilan yang dilihat secara langsung tanpa adanya perhatian yang lebih khusus\nSesuai dengan kebiasaan sehari-harinya akupun melaksanakan kegiatan yang aku asumsikan sebagai kegiatan selain belajar yang bermanfaat di institusi ini, yah membaca mungkin bagi sebagian orang membaca itu sama saja denagan belajar namun itu sangatlah berbeda. Ketika kita belajar yang kita pelajari hanyalah mengenai masalah yang telah dicantumkan di kurikulum guru tidaklah boleh melewati batasan yang telah ditetapkan itu. Di kalangan guru aku memang tidak populer dan tidak ramah namun dengan pengurus perpustakaan merekalah yang melempar senyum dan kuberi balasan\nSeperti biasanya saya mencari buku yang sedang ingin saya baca atau melihat apa asa yang menarik atau tidak. Buku yang kucari tak kunjung menampakkan dirinya dan pada akhirnya ku temukan buku terebut namun sayangnya sedang dibaca. Ke menatap wanita tersebut dan mungkin karena tak merasa enak dia melihatku dan berkata “ada apa melihat saya dengan begitu?”. “oh tidak, saya hanya melihat buku itu” jawabku. “oh yang ini, buku ini cukup bagus” tanggapnya\nSetelah itu kami mengulas buku tersebut, aku memang sudah membaca namun belum selesai. Bel istirahat berakhir pun menyapa telinga kami yang mengingatkan pertemuan ini berakhir\nSetelah sampai di rumah aku pun mulai berpikir dan selalu mebayangkan wanita tersebut yang namanya adalah Yani. Besoknya di sekolah aku tak pernah melihat wanita ini lagi. Tak lama kemudian ketika di rumah hal yang tak terduga terjadi nada pesan handphoneku pun berbunyi dan ternyata itu adalah dia, aku pun mulai berkomunikasi dengan baik dengannya awalanya kamu hanya membahas topik yang umum hingga kemudian kami membahasa masalah pribadi dan tak terduga aku pun mulai memiliki perasaan kepadanya\nDunia memang bekerja dengan caranya yang benar-benar rahasia, terkadang kita tak menyadari apa yang telah dia perbuat kepada umat manusia dan apa yang umat manusia lakukan kepadanya. Hari berlalu, minggu berlalu, dan hampir sebulan sudah aku berkomunikasi dengannya dan jiwaku seakan hanya ingin diberikan makan oleh suaranya\nMalam itu aku pun memutuskan untuk menyatakan perasaan ku yang sebenarnya memang ini masih jarang ku lakukan dan mungkin itu pula alasannya aku gagal dia hanya mengatakan agar tetap berusaha siapa tau saja perasaannya muncul. Ketika sedang membahas suatu pembahasan dia tiba-tiba membahas orang lain yang merupakan teman dekatnya yang bernama Rani dan dia mengatakan perasaan sebenarnya mengenai temannya itu. “sebenarnya Rani itu munafik dia merebut gebetan temannya meski tau temannya sangat menyukai si Rudi, aku sih mau aja ngasih tau si Rudi gimana sih si Rani itu tapi biarin aja deh nanti kebaikan akan muncul” itulah yang dia sampaikan kepadaku, Rudi merupakan siswa lain yang keren, kaya, dan baik. Akupun meladeni dengan membahas temannya tersebut, sebenarnya bukan membahas namun menceritakan aib si Rani\nBulan berikutnya aku pun mulai berpikir bahwa Yani ini tidaklah pantas untukku dan tidak ada wanita yang pantas untukku dan aku pun memutusakan untuk jaga jarak dan mulai melupakannya\nPemikiranku bukannya tidak beralasan namun terkadang ketika berbincang dengannya dia masih merasa aku ini orang asing dan sedikit menutup masalah pribadinya dariku dan hanya membahas masalah sosial dan pelajaran di sekolah\nHampir dua minggu aku tak memberikan untaian sapa yang hangat dan perasaanku seakan membunuhku karena aku menjauhinya dengan alasannya yang merupakan asumsi pribadiku sendiri saja. Pekan Olahraga dan Seni di sekolahku dimulai, ketika itu aku mendukung teman sekolahku yang sedang tanding futsal dan Yani dan temannya Rika duduk di sisi lapangan yang satunya dengan bercanda gurau\nSesekali aku menatapnya dan ketika aku menatapnya dia juga menatapku. Sesampainya di rumah pesan singkat mampir di telpon genggamku dan kucoba mengecek dan ternyata itu adalah Yani. Hubungan kami pun kembali seperti dulu dan malah agak semakin dekat, aku juga menyempatkan waktu untuk menonton pementasan dramanya, rencananya aku ingin mengantarnya pulang namun dia menghilang\nAku pun menuju rumah dan menelponnya, aku pun bertanya dimana dia dan sama siapa pulang dan mengatakan dia sudah pulang dengan temannya, ketika aku mengatakan “tadi rencananya aku mau nganterin kamu pulang tapi kamu menghilang” dia tidak memberikan respon apapun dan disinilah mulai dugaanku yang sebenarnya bermulai namun masih ku kesampingkan karena cinta itu memang telah membutakan manusia yang satu ini\nDulunya aku dan dia hanya sekedar berkirim pesan singkat dan terjadi peningkatan intensitas komunikasi di antara kami, kau sudah telpon-menelpon dan hubungan kami telah seperti pacaran karena hampir seharian kami telpon menelpon\nHari itu merupakan dua hari terakhir tahun 2012 dan aku terus menghubunginya namun telponnya tidak diangkat dan pesanku tidak dibalas padahal besoknnya merupakan hari ulang tahunnya. Akupun takut terus menelponnya karena nanti menganggunya\nPamanku dan sepupuku pun menawari tahun baru di rumah pamanku dan aku pun setuju untuk ikut, meski bergitu aku masih terus menghubunginya karena perasaanku yang sedang tidak enak dan penasaran dengan keadaanya dan plus hari tersebut merupakan hari ulang tahunnya\nAku pun mengikuti firasatku yang mengatakan dia sudah tidak ingin dekat denganku pun ingin kubuktikan dengan mengirim pesan kepadanya dengan menggunakan nomor telpon sepupuku, meski hanya pesan yang sangat singkat dan tidak berguna dan dari orang yang tidak dikenal ternyata dia balas, perasaanku pun hancur ketika itu juga, namun aku menyembunyikan ekspresiku karena nanti akan berakibat buruk di depan pamanku dan keluarganya serta sepupuku\nSesampainya dirumah pamanku setelah merayakan tahun baru diluar aku mencoba menghubunginya dengan nomor telponku sendiri dan ketika dia mengangkatnya aku pun hanya mengatakan “kamu tadi lagi bikin apa? Kok gak ada info?”. “Maaf aku lagi sibuk sekarang baru available” balasnya. “oh kalau gitu udah dulu” aku menjawab dengan nada rendah. Aku menjelaskan yang telah aku lakukan, dan selidiki dengan pesan kepadanya dan dia pun ternyata membalas dengan mengatakan selama ini aku sudah berusaha dan ternyata perasaanku tetap sama\n“Muke gile, dia kira gue goblok apa? Gua ini introvert gue ngerti lagi yang loe maksud, gue gak naif meski gak berpengalaman di urusan percintaan, mana mungkin loe ngasih jawaban seperti itu secepat itu, pasti ada yang udah terjadi” itulah yang kukatkan dalam hatiku\nSeminggu liburanku terasa sakit luar biasa yang diakibatkan cinta ternyata hal seperti itu juga melandaku setelah aku memutuskan melupakan dia pernah menjejakkan kakinya di hatiku, alasan utamanya mengatakan hal tersebut ketika tahun baru pun baru kuketahui sebulan kemudian ketika aku menstalk twitternya, dia mengatakan dan meretweet dengan tegas twit yang terbaca “Kalo gebetan sudah sebulan gak jadi pacaran berarti Cuma dijadikan pelarian” meski sakit namun terasa segar karena telah jelas aku ini telah menjadi korban apa. Beberapa minggu kemudian dia telah terdengar dan terlihat telah berpacaran dengan Rudi\nBetapa luar biasanya kisah ini, aku dijadikan pelarian dari seorang wanita yang sedang menunggu pria yang disukainya yang sedang pacaran dengan temannya, dan tahun baruku juga ikut hancur. Masih ada satu hal yang membuatku penasaran yakni mengapa aku yang dia pilih menjadi korbannya\nDan itupun terjawab beberapa hari kemudian, aku mengingat ketika dia mengingatkanku dengan temannya yang aku permainkan ketika masih SMP karena dia juga merupakan siswa yang dari SMP yang sama denganku, mungkin itu pertanda niatnya yang sebenarnya namun waktu SMP aku masih sangat bodoh jadi tak dapat mengerti perasaan orang lain. Aku pun merasa ini sudah adil dan ini adalah hukuman namun hukumannya benar-benar parah\nSkenario yang luar biasa Yani dan aktingmu luar biasa.\n***" +] \ No newline at end of file diff --git a/node_modules/dhn-api/database/json/couple.json b/node_modules/dhn-api/database/json/couple.json new file mode 100644 index 000000000..348d3cd0e --- /dev/null +++ b/node_modules/dhn-api/database/json/couple.json @@ -0,0 +1,114 @@ +[ + { + "male": "https://i.ibb.co/HGZqdzb/9b8278060e2d.jpg", + "female": "https://i.ibb.co/V3kX3Cv/bf29432e6e21.jpg" + }, + { + "male": "https://i.ibb.co/NFPKcPj/6d61f9c4cede.jpg", + "female": "https://i.ibb.co/FwRqPDn/206818911fdd.jpg" + }, + { + "male": "https://i.ibb.co/yQzxptw/7faabc24c6ff.jpg", + "female": "https://i.ibb.co/2Yk4P2B/47fd82f61fd1.jpg" + }, + { + "male": "https://i.ibb.co/cNhsYRV/7bff8e448134.jpg", + "female": "https://i.ibb.co/j37Sc7X/a9600c228a8b.jpg" + }, + { + "male": "https://i.ibb.co/DbMk8nL/957395cbf134.jpg", + "female": "https://i.ibb.co/LQ4WJMR/f13a01cc7301.jpg" + }, + { + "male": "https://i.ibb.co/ypvdYHW/7905e485ff20.jpg", + "female": "https://i.ibb.co/4Z5rJrn/465bf6b56d86.jpg" + }, + { + "male": "https://i.ibb.co/3pKd9jZ/527105aba87a.jpg", + "female": "https://i.ibb.co/M9B742X/f608cecc4265.jpg" + }, + { + "male": "https://i.ibb.co/Jn3tkg8/a1aab3d67644.jpg", + "female": "https://i.ibb.co/CWx3NYc/8ad244372d8f.jpg" + }, + { + "male": "https://i.ibb.co/CbdscQp/5918b5b3b674.jpg", + "female": "https://i.ibb.co/ZWjNrZt/8257e3c9ffc0.jpg" + }, + { + "male": "https://i.ibb.co/8069RmW/cfe9ed16a5b4.jpg", + "female": "https://i.ibb.co/gPFp1DG/0e16334be10c.jpg" + }, + { + "male": "https://i.ibb.co/P1SsfbG/a12d71cd6b9a.jpg", + "female": "https://i.ibb.co/p4Xp2Xh/d7f6c5420b7a.jpg" + }, + { + "male": "https://i.ibb.co/P17CTF9/924deeb25a3d.jpg", + "female": "https://i.ibb.co/r55xYdy/8ee97786e6f8.jpg" + }, + { + "male": "https://i.ibb.co/WykFqbW/57f78370f1e2.jpg", + "female": "https://i.ibb.co/FWSCd2C/81e637d4a839.jpg" + }, + { + "male": "https://i.ibb.co/rf6pKtp/53a463d8ebe9.jpg", + "female": "https://i.ibb.co/Z2bDP7m/48990865816b.jpg" + }, + { + "male": "https://i.ibb.co/RYB9JWG/4428e27ef288.jpg", + "female": "https://i.ibb.co/LCnJfT7/5732f5315f2f.jpg" + }, + { + "male": "https://i.ibb.co/3CLJfw3/151663d07c51.jpg", + "female": "https://i.ibb.co/zXsJQ8R/96d088d2e0a0.jpg" + }, + { + "male": "https://i.ibb.co/rxBN0S5/bd3b07b67ad6.jpg", + "female": "https://i.ibb.co/6BYPMjC/4b36a8dfca20.jpg" + }, + { + "male": "https://i.ibb.co/NW2dv07/58348a3d4008.jpg", + "female": "https://i.ibb.co/sHkDdGd/87db7aaff335.jpg" + }, + { + "male": "https://i.ibb.co/b3sMMnW/a13cdff40c6e.jpg", + "female": "https://i.ibb.co/LgPn4vL/257ab65eb79d.jpg" + }, + { + "male": "https://i.ibb.co/JzMhQ2P/45754b045a6d.jpg", + "female": "https://i.ibb.co/nmftFnS/a1f2218f7c32.jpg" + }, + { + "male": "https://i.ibb.co/R72GdTZ/30ebace5e0c1.jpg", + "female": "https://i.ibb.co/7Rnb3Y0/d1459d6b3f59.jpg" + }, + { + "male": "https://i.ibb.co/SmMvhb5/da465242e083.jpg", + "female": "https://i.ibb.co/4gK0fVL/da35fc940b11.jpg" + }, + { + "male": "https://i.ibb.co/Tbj6tzF/e93d133529d5.jpg", + "female": "https://i.ibb.co/wwpFfqH/98bc4eb86562.jpg" + }, + { + "male": "https://i.ibb.co/CJpdHyJ/348e5a66c088.jpg", + "female": "https://i.ibb.co/9wd2mTM/fd4b6af0ccac.jpg" + }, + { + "male": "https://i.ibb.co/Xkp1wx5/3a15abeb6394.jpg", + "female": "https://i.ibb.co/8mzjZrt/3b2d60d15de4.jpg" + }, + { + "male": "https://i.ibb.co/mSMmmGx/300e252914f3.jpg", + "female": "https://i.ibb.co/LvTRt2w/c8f8d0b98c70.jpg" + }, + { + "male": "https://i.ibb.co/LpctfNL/e1a158f621ba.jpg", + "female": "https://i.ibb.co/YXpvh3j/2a91663a9f0a.jpg" + }, + { + "male": "https://i.ibb.co/xgTsmW8/7ca77ee661d6.jpg", + "female": "https://i.ibb.co/DMPWv4S/e3af8d2a6673.jpg" + } +] \ No newline at end of file diff --git a/node_modules/dhn-api/database/json/darkjoke.json b/node_modules/dhn-api/database/json/darkjoke.json new file mode 100644 index 000000000..7e0e0a5a3 --- /dev/null +++ b/node_modules/dhn-api/database/json/darkjoke.json @@ -0,0 +1,51 @@ +[ + "https://1.bp.blogspot.com/-TNGZGhSt_zI/X93Q4iKhQxI/AAAAAAAAVF4/L4rB8enc1HoFy5aXkvomfmxcR30kygKrACNcBGAsYHQ/s578/91913235_2830089170435663_4447843912417017856_n.jpg", + "https://1.bp.blogspot.com/-ZzhsovG6VQk/X93Qx6IXevI/AAAAAAAAVEY/oaPiOAPc8bU5L-Y5ec8zbtbvLeNEHYrlQCNcBGAsYHQ/s644/119497256_3289016287876280_933166537923688142_n.jpg", + "https://1.bp.blogspot.com/-hsAyoXFk5zs/X93QyywTwNI/AAAAAAAAVEk/dX567Ty7as09ik9xFviAf149KDI_VP23gCNcBGAsYHQ/s882/126930872_3494159250695315_2911318968773005963_n.jpg", + "https://1.bp.blogspot.com/-pOFY-ix58m0/X93Q0JXU_pI/AAAAAAAAVE0/XuehXz15kvMd0XXr3j28Uumlmf1KNwsFwCNcBGAsYHQ/s880/130285630_3533164500128123_8252253712135313050_n.jpg", + "https://1.bp.blogspot.com/-1MFwlkScLrI/X93Q1YblbBI/AAAAAAAAVFI/53P14xUzjwg5qJmdM4hTScslb8F8kxk_wCNcBGAsYHQ/s640/131951890_987790505043716_8334230285575794663_n.jpg", + "https://1.bp.blogspot.com/-ay00cMZrKOg/X9zzOPssmNI/AAAAAAAAUs0/qw3LkxYWZF8KmgM35uW3REByQKsGVMCJgCNcBGAsYHQ/s1080/meme_indonesia_gokil_130197811_250172589829349_4517924538788816617_n.jpg", + "https://1.bp.blogspot.com/-tzbh1u0Q0x0/X9zzSQ7ctPI/AAAAAAAAUtw/NfPFuKuRHLcXhNqDRLg5jEz3xx-G0cHywCNcBGAsYHQ/s1080/meme_indonesia_gokil_130559598_213820970312403_6565488242261858116_n.jpg", + "https://1.bp.blogspot.com/-BMoEg6cuBEA/X9zzS9kPYPI/AAAAAAAAUt0/V-oFvC1fyZY4W1_eicICtPEYQaXte9fwQCNcBGAsYHQ/s509/meme_indonesia_gokil_130574163_904871143585505_1836659838467416563_n.jpg", + "https://1.bp.blogspot.com/-BAuB7v9xDCc/X9zzTMMSGpI/AAAAAAAAUt4/vOiTozBkqVgT9V0MxS5HxDQXCt4tcy8KQCNcBGAsYHQ/s1343/meme_indonesia_gokil_130578626_1345636132445352_756377830767725509_n.jpg", + "https://1.bp.blogspot.com/-dVhqXKKa1ik/X9zzTSL1-2I/AAAAAAAAUt8/uXVO3gkS_zEngJO3pLsY-DZdfJqkNY3ogCNcBGAsYHQ/s320/meme_indonesia_gokil_130604522_394506938442748_2107040976320013530_n.jpg", + "https://1.bp.blogspot.com/-Md9rd0s1rRI/X9zzUSVOmGI/AAAAAAAAUuY/R32n1YFCLckpLgPJ5AvI3qObcK1O9P1twCNcBGAsYHQ/s1080/meme_indonesia_gokil_130732318_1014980098984055_6288320571321797344_n.jpg", + "https://1.bp.blogspot.com/-PSywVBZiO5s/X9zzYORk8NI/AAAAAAAAUu8/K3Xrj7YjjmQ4CiShvU11MfU0_kqPEDRhwCNcBGAsYHQ/s480/meme_indonesia_gokil_130829433_1263619567342642_2997987878465918953_n.jpg", + "https://1.bp.blogspot.com/-KEEcM_0Mqlw/X9zzbOgyVLI/AAAAAAAAUvo/6YFpXcc4QhoUIV94Mlwwj-P02b0zyHz3QCNcBGAsYHQ/s720/meme_indonesia_gokil_131283197_168966521596830_6491895756050266793_n%2B%25281%2529.jpg", + "https://1.bp.blogspot.com/-DF8XSLnKlw4/X7473ktG_oI/AAAAAAAAAAQ/iNQLgVv5ZH0TOtRMNX39MrDsR-9WvHcBgCLcBGAsYHQ/s600/dark_jokesidn_125413538_4708449659226988_2818050412611397571_n.jpg", + "https://1.bp.blogspot.com/-Uh4ZHwYDzgc/X7473pFJNtI/AAAAAAAAAAU/CDdg5yCpjYs0EAbM36wWJt64IaKCd9dwACLcBGAsYHQ/s600/dark_jokesidn_125763208_287219762648327_8451338174815846745_n.jpg", + "https://1.bp.blogspot.com/-5JbETHhqjsE/X7473dr_KAI/AAAAAAAAAAM/6PSuwjgwRi861Wv_wugXKK1F0V0htlsdwCLcBGAsYHQ/s600/dark_jokesidn_125771108_819438932212234_9195471701678220668_n.jpg", + "https://1.bp.blogspot.com/-ZKLUtEg7L4U/X7474BW4i0I/AAAAAAAAAAY/SwzC0fiT4JM4iLNKY5qw67Mkgg2khORRQCLcBGAsYHQ/s600/dark_jokesidn_125811246_134357671416788_976039294859462799_n.jpg", + "https://1.bp.blogspot.com/-NHj1zmuU64c/X7474tpGqAI/AAAAAAAAAAc/yqN7lmE5JRsRtzu27iU2Af5TKC0tPbidwCLcBGAsYHQ/s600/dark_jokesidn_125913814_669971630554090_4965983515042687120_n.jpg", + "https://1.bp.blogspot.com/-nWez8FBhNbc/X7474ufKrjI/AAAAAAAAAAg/zs5KlpQyte0r6NiBazZa1oEFamFMT5o7wCLcBGAsYHQ/s600/dark_jokesidn_125916215_1533013756892925_3229604459263123272_n.jpg", + "https://1.bp.blogspot.com/-_iBTwh2xmbs/X7475BGlZMI/AAAAAAAAAAk/Vw9x0AxutiUzOosLPOebxdYkMQczzk_YQCLcBGAsYHQ/s600/dark_jokesidn_125942119_190351036014132_7819076849939301140_n.jpg", + "https://1.bp.blogspot.com/-rauoH_JrIhk/X7475c2lNuI/AAAAAAAAAAo/tUWQ0A3n-hcpGqg6NygclGKkZpfZKRVlgCLcBGAsYHQ/s600/dark_jokesidn_125960559_2462771960685989_4545333058975253946_n.jpg", + "https://1.bp.blogspot.com/-iJNMg7iNyB8/X7475lXFYKI/AAAAAAAAAAs/YMmu9RzxMcYZV-NzKluO9Jrh_atKCliagCLcBGAsYHQ/s600/dark_jokesidn_125969103_173992064384728_9051904893274226019_n.jpg", + "https://1.bp.blogspot.com/--nwEy_pzB4A/X74756CNOjI/AAAAAAAAAAw/zHzgZjv6jhUXYahy3xx459Di9pVNCAO2QCLcBGAsYHQ/s600/dark_jokesidn_126042830_835992027203350_8414976899406572504_n.jpg", + "https://1.bp.blogspot.com/-VP2pHJDpkUE/X7476DJ5GcI/AAAAAAAAAA0/66CCNDo8hpwKPRbR5H30h6HeuMyHUjPWgCLcBGAsYHQ/s600/dark_jokesidn_126053972_189965019286221_4250381716346170758_n.jpg", + "https://1.bp.blogspot.com/-vmZ1KdoSyJY/X7476J_y6pI/AAAAAAAAAA4/oTD8eBIYHpUyfNWueq3kF5K2BIRgrwoGACLcBGAsYHQ/s600/dark_jokesidn_126059781_971971236546542_909575679588689725_n.jpg", + "https://1.bp.blogspot.com/-dhPv0Z7s714/X7476TDmk-I/AAAAAAAAAA8/hXfO6s1DpQU9EONnAWDABrd_prbnlorVACLcBGAsYHQ/s600/dark_jokesidn_126157501_199666855004682_7845085292892857199_n.jpg", + "https://1.bp.blogspot.com/-PR_PpFaI_B4/X7476wsfGwI/AAAAAAAAABA/oPyQMQlH8hcpJedHYz0JCflCdkIU2XWvgCLcBGAsYHQ/s600/dark_jokesidn_126200110_838776873613928_5199354286646414089_n.jpg", + "https://1.bp.blogspot.com/-8Ph_hrrwgOQ/X74761oaeJI/AAAAAAAAABE/b1kq8lXcGZMUTHYUc67q_x3DwGJL3Ds8gCLcBGAsYHQ/s600/dark_jokesidn_126235999_3883403391679404_3614733563626350889_n.jpg", + "https://1.bp.blogspot.com/-04jO_qjfrV4/X7477Qv_74I/AAAAAAAAABI/KmkuY_bArbEou9ilotUVhm4Uk3z-SYroACLcBGAsYHQ/s600/dark_jokesidn_126251235_216024523255792_3922178115706270584_n.jpg", + "https://1.bp.blogspot.com/-zhaZ7iCi1ys/X74771waEjI/AAAAAAAAABM/7xiV5jJSOjgwlYq418ac7ShxhqNvILgQgCLcBGAsYHQ/s600/dark_jokesidn_126335487_372190407378106_2938205683968546124_n.jpg", + "https://1.bp.blogspot.com/-3DBdWKpzbOA/X7478N3GB5I/AAAAAAAAABQ/z36Z5pDPaKMc26bAnaqGijs7K1fc_CZywCLcBGAsYHQ/s600/dark_jokesidn_126394759_1043996636067416_4574617667256314752_n.jpg", + "https://1.bp.blogspot.com/-uHRiqGgl68M/X7478fhBM4I/AAAAAAAAABU/NRubUeWWnsEi7dCPljXjuumnOiAIeWijwCLcBGAsYHQ/s600/dark_jokesidn_126454758_1296461424048801_624034565419100730_n.jpg", + "https://1.bp.blogspot.com/-aaFBXUN1uyM/X7478s8FIlI/AAAAAAAAABY/Dl21eQddqe4EkFGo-oaUJBHVDaF7DqiLACLcBGAsYHQ/s600/dark_jokesidn_126836665_3630431300329325_5011335601065475543_n.jpg", + "https://1.bp.blogspot.com/-uHRiqGgl68M/X7478fhBM4I/AAAAAAAAABU/NRubUeWWnsEi7dCPljXjuumnOiAIeWijwCLcBGAsYHQ/s600/dark_jokesidn_126454758_1296461424048801_624034565419100730_n.jpg", + "https://1.bp.blogspot.com/-281KugSTtC0/X7479JqwUWI/AAAAAAAAABc/RrAHYJMe_fsTjMEFBKo20_Jmr_H8pcSVgCLcBGAsYHQ/s600/dark_jokesidn_126913137_1242917436095143_565227427038302568_n.jpg", + "https://1.bp.blogspot.com/-y6y4P1k8uZM/X748KL8YsBI/AAAAAAAAAEk/svnRwRKKKHMHAggIobKsWVvfCnWk7oeFQCLcBGAsYHQ/s600/darkjokes101.id_83456045_113551443548110_2981589770713149046_n.jpg", + "https://1.bp.blogspot.com/-p_MJA1ZVLYk/X748KeWQhnI/AAAAAAAAAEo/M6jxZWCcaG0c7AVlbQcnJumkrIiKqaLpQCLcBGAsYHQ/s600/darkjokes101.id_83768105_301838390953572_5433897784320788913_n.jpg", + "https://1.bp.blogspot.com/-GhNEc-8J9r4/X748KhvyouI/AAAAAAAAAEs/LoEpWMYI424TTG7Has-Tji0Rcyr9GOQIQCLcBGAsYHQ/s600/darkjokes101.id_97563726_1383946805138463_6577185929966205658_n.jpg", + "https://1.bp.blogspot.com/-Bo3SIAOPBaY/X748LGxT9II/AAAAAAAAAEw/n9TQ0uUOR-IKrK2dsGYZ0o43MCPcVNTaQCLcBGAsYHQ/s600/darkjokes101.id_99064100_285325765968755_2858540684558876843_n.jpg", + "https://1.bp.blogspot.com/-2IbcoVnZK4E/X748LRnf4mI/AAAAAAAAAE0/06P-D_dOcZon6LWzvxj4qgZa043YEbuZACLcBGAsYHQ/s600/darkjokes101.id_99149721_263878304690485_4274403557054793854_n.jpg", + "https://1.bp.blogspot.com/-4qNDY60d7z0/X7479yMJ46I/AAAAAAAAABo/D2VyTwzHFBccoAC8CEIJIzjzpTRverH6gCLcBGAsYHQ/s600/darkjokes101.id_100077716_105592917757106_272558179785716903_n.jpg", + "https://1.bp.blogspot.com/-4qNDY60d7z0/X7479yMJ46I/AAAAAAAAABo/D2VyTwzHFBccoAC8CEIJIzjzpTRverH6gCLcBGAsYHQ/s600/darkjokes101.id_100077716_105592917757106_272558179785716903_n.jpg", + "https://1.bp.blogspot.com/-rKLWjz6XJHI/X74791fPsdI/AAAAAAAAABs/MrtpbAEK_sUaITHHqSk625Sk5FM6aNvXgCLcBGAsYHQ/s600/darkjokes101.id_100651682_3868977436508830_3723713845645912294_n.jpg", + "https://1.bp.blogspot.com/-FukQ6OqPkxE/X747-qCzgXI/AAAAAAAAABw/r5dsEdKg4VM_lZwa2MecdHA-CMM3dt7lwCLcBGAsYHQ/s600/darkjokes101.id_100870692_671623397011216_5615448684900827810_n.jpg", + "https://1.bp.blogspot.com/-3z22doJpmJI/X747-0ccp-I/AAAAAAAAAB0/9ywc1KdcuQEmqVZxnfCi8nSd7he_kdBWQCLcBGAsYHQ/s600/darkjokes101.id_100873414_1590418137799550_4205263227048486381_n.jpg", + "https://1.bp.blogspot.com/-mXUC4ZW3AWs/X747_mBSs0I/AAAAAAAAAB8/GaElPy8NgBA5jLS80QypsN8ydrKxE6rZgCLcBGAsYHQ/s600/darkjokes101.id_100950424_113362380167108_4925146108170457581_n.jpg", + "https://1.bp.blogspot.com/-Hc23nyIc1_Y/X747_x3wDYI/AAAAAAAAACA/ViZl4YjeLQk9yDzT5r0-GmwTFxs5W4xQACLcBGAsYHQ/s600/darkjokes101.id_100973869_130547945307990_5870879821283126654_n.jpg", + "https://1.bp.blogspot.com/-Akp4QaWpRwc/X747_w5n6aI/AAAAAAAAACE/eTDUTdDV8P8Mtc0MCsqGpqMCtTPKoVDVgCLcBGAsYHQ/s600/darkjokes101.id_101050187_2635453733392140_6919535255199617791_n.jpg", + "https://1.bp.blogspot.com/-U8ZcPPD54MQ/X748ArBXhII/AAAAAAAAACI/Z1KPh690DJ0Xs8Y2ii05eEgt0jvXY6n9wCLcBGAsYHQ/s600/darkjokes101.id_101070777_553214945563469_5198484444635252583_n.jpg" +] \ No newline at end of file diff --git a/node_modules/dhn-api/database/json/quotes.json b/node_modules/dhn-api/database/json/quotes.json new file mode 100644 index 000000000..481d3d1ba --- /dev/null +++ b/node_modules/dhn-api/database/json/quotes.json @@ -0,0 +1,1226 @@ +[ + { + "author": "A. France", + "quotes": "Lebih baik mengerti sedikit daripada salah mengerti." + }, + { + "author": "Abraham Lincoln", + "quotes": "Hampir semua pria memang mampu bertahan menghadapi kesulitan. Namun, jika Anda ingin menguji karakter sejati pria, beri dia kekuasaan." + }, + { + "author": "Aeschylus", + "quotes": "Bila tekad seseorang kuat dan teguh, Tuhan akan bergabung dalam usahanya." + }, + { + "author": "Aesop", + "quotes": "Penderitaan adalah pelajaran." + }, + { + "author": "Albert Einstein", + "quotes": "Ilmu pengetahuan tanpa agama adalah pincang." + }, + { + "author": "Albert Einstein", + "quotes": "Hidup itu seperti sebuah sepeda, agar tetap seimbang kita harus tetap bergerak." + }, + { + "author": "Albert Einstein", + "quotes": "Perbedaan masa lalu, sekarang, dan masa depan tak lebih dari ilusi yang keras kepala." + }, + { + "author": "Albert Einstein", + "quotes": "Sebuah meja, sebuah kursi, semangkuk buah, dan sebuah biola; apa lagi yang dibutuhkan agar seseorang bisa merasa bahagia?." + }, + { + "author": "Albert Enstein", + "quotes": "Belas kasihanlah terhadap sesama, bersikap keraslah terhadap diri sendiri." + }, + { + "author": "Alex Osborn", + "quotes": "Cara paling baik untuk menggerakkan diri Anda ialah memberi tugas kepada diri sendiri." + }, + { + "author": "Alexander A. Bogomoletz", + "quotes": "Kita tidak boleh kehilangan semangat. Semangat adalah stimulan terkuat untuk mencintai, berkreasi dan berkeinginan untuk hidup lebih lama." + }, + { + "author": "Alexander Solzhenitsyn", + "quotes": "Manusia akan bahagia selama ia memilih untuk bahagia." + }, + { + "author": "Ali Javan", + "quotes": "Saya tidak berharap menjadi segalanya bagi setiap orang. Saya hanya ingin menjadi sesuatu untuk seseorang." + }, + { + "author": "Ali bin Abi Thalib", + "quotes": "Apabila sempurna akal seseorang, maka sedikit perkataannya." + }, + { + "author": "Ali bin Abi Thalib", + "quotes": "Bahagialah orang yang dapat menjadi tuan untuk dirinya, menjadi kusir untuk nafsunya dan menjadi kapten untuk bahtera hidupnya." + }, + { + "author": "Ali bin Abi Thalib", + "quotes": "Sahabat yang jujur lebih besar harganya daripada harta benda yang diwarisi dari nenek moyang." + }, + { + "author": "Anne M. Lindbergh", + "quotes": "Yang palin melelahkan dalam hidup adalah menjadi orang yang tidak tulus." + }, + { + "author": "Anonim", + "quotes": "Terbuka untuk Anda, begitulah Tuhan memberi kita jalan untuk berusaha. Jangan pernah berfikir jalan sudah tertutup." + }, + { + "author": "Anonim", + "quotes": "Penundaan adalah kuburan dimana peluang dikuburkan." + }, + { + "author": "Antonie De Saint", + "quotes": "Cinta bukan saling menatap mata, namun melihat ke arah yang sama bersama-sama." + }, + { + "author": "Aristoteles", + "quotes": "Kita adalah apa yang kita kerjakan berulang kali. Dengan demikian, kecemerlangan bukan tindakan, tetapi kebiasaan." + }, + { + "author": "Arnold Glasow", + "quotes": "Jangan pernah mencoba menjadikan putra atau putri Anda menjadi seperti Anda. Diri Anda hanya cukup satu saja." + }, + { + "author": "Art Buchwald", + "quotes": "Jika Anda bisa membuat orang lain tertawa, maka Anda akan mendapatkan semua cinta yang Anda inginkan." + }, + { + "author": "Artemus Ward", + "quotes": "Masalah akan datang cepat atau lambat. Jika masalah datang, sambut dengan sebaik mungkin. Semakin ramah Anda menyapanya, semakin cepat ia pergi." + }, + { + "author": "Ashleigh Brilliant", + "quotes": "Kita tak bisa melakukan apapun untuk mengubah masa lalu. Tapi apapun yang kita lakukan bisa mengubah masa depan." + }, + { + "author": "Augustine", + "quotes": "Kesabaran adalah teman dari kebijaksanaan." + }, + { + "author": "Ayn Rand", + "quotes": "Orang-orang kreatif termotivasi oleh keinginan untuk maju, bukan oleh keinginan untuk mengalahkan orang lain." + }, + { + "author": "B. J. Habibie", + "quotes": "Dimanapun engkau berada selalulah menjadi yang terbaik dan berikan yang terbaik dari yang bisa kita berikan." + }, + { + "author": "Balzac", + "quotes": "Kebencian seperti halnya cinta, berkobar karena hal-hal kecil." + }, + { + "author": "Barbara Sher", + "quotes": "Anda tidak perlu harus berhasil pada kali pertama." + }, + { + "author": "Beecher", + "quotes": "Satu jam yang intensif, jauh lebih baik dan menguntungkan daripada bertahun-tahun bermimpi dan merenung-renung." + }, + { + "author": "Benjamin Disraeli", + "quotes": "Hal terbaik yang bisa Anda lakukan untuk orang lain bukanlah membagikan kekayaan Anda, tetapi membantu dia untuk memiliki kekayaannya sendiri." + }, + { + "author": "Bill Clinton", + "quotes": "Tidak ada jaminan keberhasilan, tetapi tidak berusaha adalah jaminan kegagalan." + }, + { + "author": "Bill Cosby", + "quotes": "Aku tidak tahu kunci sukses itu apa, tapi kunci menuju kegagalan adalah mencoba membuat semua orang senang." + }, + { + "author": "Bill Gates", + "quotes": "Konsumen yang paling tidak puas adalah sumber berharga untuk belajar." + }, + { + "author": "Bill Mccartney", + "quotes": "Kita ada disini bukan untuk saling bersaing. Kita ada disini untuk saling melengkapi." + }, + { + "author": "Brian Koslow", + "quotes": "Semakin kita bersedia bertanggung jawab atas perbuatan-perbuatan kita, semakin banyak kredibilitas yang kita miliki." + }, + { + "author": "Browning", + "quotes": "Selalu baik untuk memaafkan, tapi yang paling baik adalah melupakan sebuah kesalahan." + }, + { + "author": "Bruce Lee", + "quotes": "Jangan menjadi pohon kaku yang mudah patah. Jadilah bambu yang mampu bertahan melengkung melawan terpaan angin." + }, + { + "author": "Budha Gautama", + "quotes": "Jangan menangis karena kegagalan cinta, sebab manusia akan meninggalkan semua yang dicintainya." + }, + { + "author": "Bunda Teresa", + "quotes": "Jika Anda mengadili orang lain, Anda tak punya waktu untuk mencintai mereka." + }, + { + "author": "Bunda Teresa", + "quotes": "Jika tidak ada perdamaian, hal itu disebabkan kita telah lupa bahwa kita saling membutuhkan." + }, + { + "author": "Bung Hatta", + "quotes": "Kurang cerdas dapat diperbaiki dengan belajar, kurang cekatan dapat diperbaiki dengan pengalaman, kurang jujur sulit memperbaikinya." + }, + { + "author": "Burn", + "quotes": "Banyak orang sukses berkat banyaknya kesulitan dan kesukaran yang mesti dihadapi." + }, + { + "author": "Carol Burnet", + "quotes": "Hanya aku yang bisa merubah hidupku, tak ada seorang pun yang dapat melakukannya untukku." + }, + { + "author": "Charles Darwin", + "quotes": "Yang bisa bertahan hidup bukan spesies yang paling kuat. Bukan juga spesies yang paling cerdas. Tapi spesies yang paling responsif terhadap perubahan." + }, + { + "author": "Charles R. Swindoll", + "quotes": "Hidup adalah 10 persen yang terjadi kepada Anda, 90 persen bagaimana cara Anda menyikapinya." + }, + { + "author": "Ching Hai", + "quotes": "Memperbaiki diri kita adalah memperbaiki dunia." + }, + { + "author": "Ching Hai", + "quotes": "Jangan membeda-bedakan pekerjaan mana yang baik dan mana yang buruk. Masalah muncul jika kita membeda-bedakan dan memihak sesuatu." + }, + { + "author": "Ching Hai", + "quotes": "Kita bekerja harus tanpa pamrih. Itu berlaku untuk segala pekerjaan. Pengabdian tanpa syarat adalah yang terbaik." + }, + { + "author": "Ching Hai", + "quotes": "Kita harus menemukan kekuatan cinta dalam diri kita terlebih dahulu, barulah kita dapat benar-benar mencintai orang lain." + }, + { + "author": "Ching Hai", + "quotes": "Carilah uang secukupnya saja untuk membiayai kehidupan, agar dapat menyisihkan waktu dan tenaga untuk melatih spiritual." + }, + { + "author": "Christopher Colombus", + "quotes": "Harta benda tak membuat seseorang menjadi kaya raya, mereka hanya membuatnya lebih sibuk." + }, + { + "author": "Cicero", + "quotes": "Hati yang penuh syukur, bukan saja merupakan kebajikan terbesar, melainkan induk dari segala kebajikan yang lain." + }, + { + "author": "Cicero", + "quotes": "Hati yang penuh syukur, bukan saja merupakan kebajikan terbesar, melainkan juga induk dari segala kebajikan yang lain." + }, + { + "author": "Clarence Darrow", + "quotes": "Kebebasan itu berasal dari manusia, tidak dari undang-undang atau institusi." + }, + { + "author": "Confucius", + "quotes": "Hidup ini benar-benar sederhana, tapi kita malah bersikeras membuatnya menjadi rumit." + }, + { + "author": "Confucius", + "quotes": "Kemana pun Anda pergi, pergilah dengan sepenuh hati." + }, + { + "author": "Confucius", + "quotes": "Orang yang melakukan kesalahan dan tidak memperbaiki kesalahannya, melalakukan kesalahan yang lainnya." + }, + { + "author": "Confucius", + "quotes": "Kebanggaan kita yang terbesar bukan karena tidak pernah gagal, tetapi bangkit kembali setiap kita jatuh." + }, + { + "author": "Cowper", + "quotes": "Bunga yang tidak akan pernah layu dibumi adalah kebajikan." + }, + { + "author": "Cynthia Ozick", + "quotes": "Untuk membayangkan hal yang tak dapat dibayangkan, dibutuhkan imajinasi yang luar biasa." + }, + { + "author": "D. J. Schwartz", + "quotes": "Kesulitan apapun tidak tahan terhadap keuletan dan ketekunan. Tanpa keuletan, orang yang paling pintar dan paling berbakat sering gagal dalam hidupnya." + }, + { + "author": "Dale Carnegie", + "quotes": "Satu-satunya cara agar kita memperoleh kasih sayang, adalah jangan menuntut agar kita dicintai, tetapi mulailah memberi kasih sayang kepada orang lain tanpa mengharapkan balasan." + }, + { + "author": "Dale Carnegie", + "quotes": "Bila orang yang kuatir akan kekurangannya mau mensyukuri kekayaan yang mereka miliki, mereka akan berhenti kuatir." + }, + { + "author": "Dale Carnegie", + "quotes": "Usahakan membentuk suatu hubungan \"kawat\" antara otak dan hati Anda." + }, + { + "author": "Dale Carnegie", + "quotes": "Senyuman akan membuat kaya jiwa seseorang yang menerimanya, tanpa membuat miskin seseorang yang memberikannya." + }, + { + "author": "Dale Carnegie", + "quotes": "Orang jarang sukses kecuali jika mereka senang dengan apa yang dikerjakannya." + }, + { + "author": "David Livingston", + "quotes": "Saya akan pergi kemanapun selama itu arahnya ke depan." + }, + { + "author": "David V. Ambrose", + "quotes": "Jika Anda punya kemauan untuk menang, Anda sudah mencapai separuh sukses. Jika Anda tidak punya kemauan untuk menang, Anda sudah mencapai separuh kegagalan." + }, + { + "author": "David Weinbaum", + "quotes": "Rahasia menuju hidup kaya adalah mempunyai lebih banyak awal ketimbang akhir." + }, + { + "author": "Desbarolles", + "quotes": "Kebenaran yang tidak dimengerti akan menjadi kesalahan." + }, + { + "author": "Descrates", + "quotes": "Saya berpikir, karena itu saya ada." + }, + { + "author": "Djamaludin Abassy", + "quotes": "Mental yang lemah lebih parah dari fisik yang lemah." + }, + { + "author": "Donald Kendall", + "quotes": "Satu-satunya sukses yang diraih sebelum bekerja hanyalah ada di kamus saja." + }, + { + "author": "Dr. Frank Crane", + "quotes": "Sahabat terbaik dan musuh terburuk kita adalah pikiran-pikiran kita. Pikiran dapat lebih baik dari seorang dokter atau seorang bankir atau seorang teman kepercayaan. Juga dapat lebih berbahaya dadi penjahat." + }, + { + "author": "Dr. Ronald Niednagel", + "quotes": "Pergilah sejauh Anda bisa memandang, dan ketika Anda tiba disana, Anda akan memandang lebih jauh." + }, + { + "author": "Dr.\u00a0Johnnetta Cole", + "quotes": "Jika kamu ingin pergi cepat, pergilah sendiri. Jika kamu ingin pergi jauh, pergilah bersama-sama." + }, + { + "author": "Dwigt D. Esenhower", + "quotes": "Seorang intelektual tidak akan pernah mengatakan lebih daripada apa yang diketahuinya." + }, + { + "author": "Earl Campbell", + "quotes": "Persoalan-persoalan adalah harga yang Anda bayar untuk kemajuan." + }, + { + "author": "Earl Campbell", + "quotes": "Persoalan-persoalan adalah harga yang harus Anda bayar untuk kemajuan." + }, + { + "author": "Edgar Alnsel", + "quotes": "Hidup manusia penuh dengan bahaya, tetapi disitulah letak daya tariknya." + }, + { + "author": "Edmund Burke", + "quotes": "Anda tidak dapat merencanakan masa yang akan datang berdasarkan masa lalu." + }, + { + "author": "Edward L. Curtis", + "quotes": "Optimisme yang tidak disertai dengan usaha hanya merupakan pemikiran semata yang tidak menghasilkan buah." + }, + { + "author": "Edward de Bono", + "quotes": "Jika Anda termasuk orang yang senang menunggu datangnya peluang, Anda adalah bagian dari manusia pada umumnya." + }, + { + "author": "Edy Murphy", + "quotes": "Aku menghabiskan usia 30-an untuk memperbaiki segala kesalahanku di usia 20-an." + }, + { + "author": "Einstein", + "quotes": "Berusaha untuk tidak menjadi manusia yang berhasil tapi berusahalah menjadi manusia yang berguna." + }, + { + "author": "Eisenhower", + "quotes": "Mulai sekarang kita tidak usah membuang-buang waktu barang semenit pun untuk memikirkan orang-orang yang tidak kita sukai." + }, + { + "author": "Elanor Roosevelt", + "quotes": "Ketika kita berhenti membuat kontribusi, kita mulai mati." + }, + { + "author": "Elbert Hubbad", + "quotes": "Kesalahan terbesar yang dibuat manusia dalam kehidupannya adalah terus-menerus merasa takut bahwa mereka akan melakukan kesalahan." + }, + { + "author": "Elizabeth Browning", + "quotes": "Janganlah menyebut orang tidak bahagia sebelum dia mati. Jangan menilai pekerjaan seseorang sebelum pekerjaannya berakhir." + }, + { + "author": "Emerson", + "quotes": "Percaya pada diri sendiri adalah rahasia utama mencapai sukses." + }, + { + "author": "Engelbert Huperdinck", + "quotes": "Anda harus waspada dengan kesenangan. Pastikan bahwa Anda menikmatinya dan bukan dikendalikannya." + }, + { + "author": "Erich Watson", + "quotes": "Kehilangan kekayaan masih dapat dicari kembali, kehilangan kepercayaan sulit didapatkan kembali." + }, + { + "author": "Francois De La Roche", + "quotes": "Bila tidak mampu menemukan kedamaian dalam diri sendiri, tak ada gunanya mencari di tempat lain." + }, + { + "author": "Francois De La Roche", + "quotes": "Kita terbiasa menyembunyikan diri dari orang lain, sampai akhirnya kita sendiri tersembunyi dari diri kita." + }, + { + "author": "Francois Roche", + "quotes": "Kita lebih sibuk menyakinkan orang lain bahwa kita bahagia ketimbang benar-benar merasakan bahagia itu sendiri." + }, + { + "author": "Frank Crane", + "quotes": "Anda mungkin ditipu jika terlalu mempercayai, tetapi hidup Anda akan tersiksa jika tidak cukup mempercayai." + }, + { + "author": "Frank Giblin", + "quotes": "Jadilah diri Anda sendiri. Siapa lagi yang bisa melakukannya lebih baik ketimbang diri Anda sendiri?." + }, + { + "author": "Franklin", + "quotes": "Bila Anda ingin dicintai, cintailah dan bersikaplah sebagai orang yang patut dicintai." + }, + { + "author": "Fuller", + "quotes": "Contoh yang baik adalah nasihat terbaik." + }, + { + "author": "Galileo Galilei", + "quotes": "Rumput yang paling kuat tumbuhnya terdapat di atas tanah yang paling keras." + }, + { + "author": "Galileo Galilei", + "quotes": "Kamu tidak dapat mengajari seseorang apa pun, kamu hanya bisa membantunyanya menemukan apa yang ada dalam dirinya sendiri." + }, + { + "author": "Gandhi", + "quotes": "Mereka yang berjiwa lemah tak akan mampu memberi seuntai maaf tulus. Pemaaf sejati hanya melekat bagi mereka yang berjiwa tangguh." + }, + { + "author": "Gandhi", + "quotes": "Kebahagiaan tergantung pada apa yang dapat Anda berikan, bukan pada apa yang Anda peroleh." + }, + { + "author": "Gen Collin Powel", + "quotes": "Tak ada rahasia untuk menggapai sukses. Sukses itu dapat terjadi karena persiapan, kerja keras dan mau belajar dari kegagalan." + }, + { + "author": "George B. Shaw", + "quotes": "Hidup bukanlah tentang menemukan dirimu sendiri. Hidup adalah tentang menciptakan dirimu sendiri." + }, + { + "author": "George III", + "quotes": "Saya lebih baik kehilangan mahkota daripada melakukan tindakan yang menurut saya memalukan." + }, + { + "author": "George Santayana", + "quotes": "Tidak ada obat untuk kelahiran dan kematian, kecuali menikmati yang ada di antara keduanya." + }, + { + "author": "George W.", + "quotes": "Harapan tak pernah meninggalkan kita, kita yang meninggalkan harapan." + }, + { + "author": "Gilbert Chesterton", + "quotes": "Agar bisa menjadi cukup cerdas untuk meraih semua uang yang diinginkan, kita harus cukup bodoh untuk menginginkannya." + }, + { + "author": "Gothe", + "quotes": "Semua pengetahuan yang kumiliki bisa orang lain peroleh, tapi hatiku hanyalah untuk diriku sendiri." + }, + { + "author": "H. N. Spieghel", + "quotes": "Betapapun tingginya burung terbang, toh dia harus mencari dan mendapatkan makanannya di bumi juga." + }, + { + "author": "H.L Hunt", + "quotes": "Tetapkan apa yang Anda inginkan. Putuskan Anda ingin menukarnya dengan apa. Tentukan prioritas dan laksanakan." + }, + { + "author": "Hal Borland", + "quotes": "Melihat pohon, saya jadi mengerti tentang kesabaran. Memandang rumput, saya jadi menghargai ketekunan." + }, + { + "author": "Hamka", + "quotes": "Kecantikan yang abadi terletak pada keelokan adab dan ketinggian ilmu seseorang, bukan terletak pada wajah dan pakaiannya." + }, + { + "author": "Hamka", + "quotes": "Kita harus yakin bahwa apa yang ditentukan oleh Tuhan untuk kita, itulah yang terbaik." + }, + { + "author": "Hamka", + "quotes": "Berani menegakkan keadilan, walaupun mengenai diri sendiri, adalah puncak segala keberanian." + }, + { + "author": "Hamka", + "quotes": "Hawa nafsu membawa kesesatan dan tidak berpedoman. Sementara akal menjadi pedoman menuju keutamaan. Hawa nafsu menyuruhmu berangan-angan, tetapi akal menyuruhmu menimbang." + }, + { + "author": "Harriet Braiker", + "quotes": "Berusaha berhasil untuk memotivasi dirimu, tapi berusaha untuk selalu sempurna akan membuat tertekan." + }, + { + "author": "Helen Keller", + "quotes": "Kita tidak akan belajar berani dan sabar jika di dunia ini hanya ada kegembiraan." + }, + { + "author": "Henri Ford", + "quotes": "Kegagalan hanyalah kesempatan untuk memulai lagi dengan lebih pandai." + }, + { + "author": "Henry David Thoreau", + "quotes": "Kebaikan adalah satu-satunya investasi yang tidak akan merugikan." + }, + { + "author": "Henry Ford", + "quotes": "Idealis adalah orang yang membantu orang lain untuk makmur." + }, + { + "author": "Henry Ford", + "quotes": "Berpikir itu adalah pekerjaan yang berat di antara segala jenis pekerjaan. Itulah sebabnya sedikit sekali orang yang senang melakukannya." + }, + { + "author": "Henry Ford", + "quotes": "Persaingan yang tujuannya hanya untuk bersaing, untuk mengalahkan orang lain, tak pernah mendatangkan banyak manfaat." + }, + { + "author": "Henry Longfellow", + "quotes": "Kehidupan orang-orang besar mengingatkan kita bahwa kita bisa membuat kehidupan kita luhur." + }, + { + "author": "Henry Thoreau", + "quotes": "Hidupku menjadi hiburanku dan tak hentinya memberikan kejutan. Hidupku bagaikan drama dengan begitu banyak babak tanpa adegan penutup." + }, + { + "author": "Hubert Humprey", + "quotes": "Apa yang Anda lihat adalah apa yang Anda capai." + }, + { + "author": "Imam Al-Ghazali", + "quotes": "Kebahagiaan terletak pada kemenangan memerangi hawa nafsu dan menahan keinginan yang berlebih-lebihan." + }, + { + "author": "Imam Ghazali", + "quotes": "Caci maki dari seorang penjahat merupakan kehormatan bagi seorang yang jujur." + }, + { + "author": "J.C.F von Schiller", + "quotes": "Orang yang terlalu banyak merenung akan meraih sedikit." + }, + { + "author": "Jack Hyles", + "quotes": "Jangan gunakan orang-orang untuk membangun pekerjaan besar, gunakan pekerjaan Anda untuk membangun orang-orang besar." + }, + { + "author": "Jackson Brown", + "quotes": "Kesalahaan terbesar yang mungkin Anda buat adalah mempercayai bahwa Anda bekerja untuk orang lain." + }, + { + "author": "Jacques Audiberti", + "quotes": "Kepengecutan yang paling besar adalah ketika kita membuktikan kekuatan kita kepada kelemanan orang lain." + }, + { + "author": "James Thurber", + "quotes": "Jangan lihat masa lalu dengan penyesalan, jangan pula lihat masa depan dengan ketakutan, tapi lihatlah sekitar Anda dengan penuh kesadaran." + }, + { + "author": "Janet Erskine", + "quotes": "Jangan menunggu keadaan yang ideal. Jangan juga menunggu peluang-peluang terbaik. Keduanya tak akan pernah datang." + }, + { + "author": "Jeff Goins", + "quotes": "Kebanyakan orang sukses yang saya kenal bukan orang yang sibuk, mereka orang yang focus." + }, + { + "author": "Jerry West", + "quotes": "Anda tidak dapat melakukan banyak hal di hidup Anda, jika Anda hanya bekerja di hari-hari yang Anda rasakan baik." + }, + { + "author": "Jim Rohn", + "quotes": "Tembok yang kita bangun untuk menghambat kesedihan, juga membuat kita tertutup dari kebahagiaan." + }, + { + "author": "Jim Rohn", + "quotes": "Jika Anda tidak merancang hidup Anda sendiri, kemungkinan Anda akan menjalani rencana orang lain. Apa yang mereka rencanakan untuk Anda? Tidak banyak." + }, + { + "author": "Jim Ryan", + "quotes": "Motivasi adalah sesuatu yang membuat Anda memulai. Kebiasaan adalah sesuatu yang membuat Anda melanjutkan." + }, + { + "author": "Jimi Hendrix", + "quotes": "Ketika kekuatan akan cinta melebihi kecintaan akan kekuasaan, maka dunia pun menemukan kedamaian." + }, + { + "author": "Jimmy Dean", + "quotes": "Aku tak bisa merubah arah angin, tapi aku bisa menyesuaikan layarku untuk tetap bisa mencapai tujuanku." + }, + { + "author": "Joan Baez", + "quotes": "Kita tak bisa memilih bagaimana kita meninggal atau kapan. Kita hanya bisa memutuskan bagaimana kita hidup. Sekarang." + }, + { + "author": "John B. Gough", + "quotes": "Jika Anda ingin sukses, Anda harus menciptakan peluang untuk diri sendiri." + }, + { + "author": "John C. Maxwell", + "quotes": "Bekerja keras sekarang, merasakan hasilnya nanti; bermalas-malasan sekarang, merasakan akibatnya nanti." + }, + { + "author": "John C. Maxwell", + "quotes": "Untuk menangani diri Anda sendiri, gunakan kepala Anda. Untuk menangani orang lain, gunakan hati Anda." + }, + { + "author": "John C. Maxwell", + "quotes": "Bekerja keras sekarang, merasakannya nanti. Bermalas-malas sekarang, merasakan akibatnya nanti." + }, + { + "author": "John Craig", + "quotes": "Tidak peduli seberapa banyak yang dapat Anda lakukan, tidak peduli seberapa menarik hati kepribadian Anda, Anda tidak dapat melangkah jauh jika Anda tidak dapat bekerja bersama orang lain." + }, + { + "author": "John D. Rockefeller", + "quotes": "Orang termiskin adalah orang yang tidak mempunyai apa-apa kecuali uang." + }, + { + "author": "John Gardne", + "quotes": "Jika kita melayani, maka hidup akan lebih berarti." + }, + { + "author": "John Gray", + "quotes": "Sebenarnya semua kesulitan merupakan kesempatan bagi jiwa yang tumbuh." + }, + { + "author": "John Manson", + "quotes": "Anda dilahirkan orisinal, jadi tidak perlu setengah mati meniru orang lain." + }, + { + "author": "John Maxwell", + "quotes": "Seberapa jauh Anda gagal, tidak masalah, tetapi yang penting seberapa sering Anda bangkit kembali." + }, + { + "author": "John Q. Adams", + "quotes": "Jika tindakan-tindakan Anda mengilhami orang lain untuk bermimpi lebih, belajar lebih, bekerja lebih, dan menjadi lebih baik, Anda adalah seorang pemimpin." + }, + { + "author": "John Ruskin", + "quotes": "Saya yakin, ujian pertama bagi orang besar ialah kerendahan hati." + }, + { + "author": "John Ruskin", + "quotes": "Penghargaan tertinggi untuk kerja keras seseorang bukanlah apa yang ia hasilkan, tapi bagaimana ia berkembang karenanya." + }, + { + "author": "John Ruskin", + "quotes": "Penghargaan tertinggi untuk kerja keras seseorang bukanlah apa yang ia hasilkan, tetapi bagaimana ia berkembang karenanya." + }, + { + "author": "John Wolfgang", + "quotes": "Perbuatan-perbuatan salah adalah biasa bagi manusia, tetapi perbuatan pura-pura itulah sebenarnya yang menimbulkan permusuhan dan pengkhianatan." + }, + { + "author": "Joseph Addison", + "quotes": "Rahmat sering datang kepada kita dalam bentuk kesakitan, kehilangan dan kekecewaan; tetapi kalau kita sabar, kita segera akan melihat bentuk aslinya." + }, + { + "author": "Julia Roberts", + "quotes": "Cinta sejati tidak datang kepadamu, tetapi harus datang dari dalam dirimu." + }, + { + "author": "Junius", + "quotes": "Integritas seseorang diukur dengan tingkah lakunya bukan profesinya." + }, + { + "author": "Kahlil Gibran", + "quotes": "Kita berdoa kalau kesusahan dan membutuhkan sesuatu, mestinya kita juga berdoa dalam kegembiraan besar dan saat rezeki melimpah." + }, + { + "author": "Kahlil Gibran", + "quotes": "Untuk memahami hati dan pikiran seseorang, jangan lihat apa yang sudah dia capai, tapi lihat apa yang dia cita-citakan." + }, + { + "author": "Keri Russel", + "quotes": "Kadang kala, justru keputusan kecil yang akan mampu merubah hidup kita selamanya." + }, + { + "author": "Knute Rockne", + "quotes": "Apabila perjalanan menjadi sulit, orang ulet akan berjalan terus." + }, + { + "author": "Kong Hu Cu", + "quotes": "Orang yang berbudi tinggi selalu berpedoman pada keadilan dan selalu berusaha menjalankan kewajiban." + }, + { + "author": "Konrad Adenauer", + "quotes": "Kita semua hidup di bawah langit yang sama, tetapi tidak semua orang punya cakrawala yang sama." + }, + { + "author": "Kung Fu-Tze", + "quotes": "Ia yang bijak akan merasa malu, jika kata-katanya lebih baik daripada tindakannya." + }, + { + "author": "Lao Tzu", + "quotes": "Saat sadar bahwa kau tidak kekurangan suatu apa pun, seisi dunia menjadi milikku." + }, + { + "author": "Lao Tzu", + "quotes": "Saat sadar bahwa kau tidak kekurangan suatu apa pun, seisi dunia menjadi milikmu." + }, + { + "author": "Les Brown", + "quotes": "Terima tanggung jawab untuk diri Anda sendiri. Sadari bahwa hanya Anda sendiri, bukan orang lain, yang bisa membuat Anda pergi ke tempat yang Anda inginkan." + }, + { + "author": "Louis Gittner", + "quotes": "Meski yang kita hadapi adalah jalan buntu, namun cinta akan membangun jalan layang di atasnya." + }, + { + "author": "Louis Pasteur", + "quotes": "Tahukah Anda rahasia sukses saya dalam mencapai tujuan? Cuma keuletan, tak lebih dan tak kurang." + }, + { + "author": "Mahatma Gandhi", + "quotes": "Kepuasan terletak pada usaha, bukan pada hasil. Berusaha dengan keras adalah kemenangan yang hakiki." + }, + { + "author": "Marcel Ayme", + "quotes": "Kerendahan hati merupakan ruang tunggu bagi kesempurnaan." + }, + { + "author": "Maria Sharapova", + "quotes": "Saya belajar banyak dari kekalahan. Dan kekalahan-kekalahan itu, membuat saya semakin tabah." + }, + { + "author": "Mark Cuban", + "quotes": "Buatlah usaha Anda berhasil dengan satu-satunya cara: kerja keras!." + }, + { + "author": "Mark Twain", + "quotes": "Kebaikan adalah bahasa yang dapat didengar si tuli dan bisa dilihat si buta." + }, + { + "author": "Marsha Sinetar", + "quotes": "Lakukan apa yang Anda senangi, uang akan mengikuti." + }, + { + "author": "Martin Luther King", + "quotes": "Tak ada waktu yang tidak tepat untuk melakukan sesuatu yang benar." + }, + { + "author": "Mary McCarthy", + "quotes": "Kendatipun Anda berada di jalur yang tepat, Anda akan tetap terkejar jika hanya duduk-duduk saja disana." + }, + { + "author": "Maxim Gorky", + "quotes": "Kebahagiaan selalu tampak kecil saat berada dalam genggaman. Tapi coba lepaskan dan Anda akan langsung tahu, betapa besar dan berhargannya kebahagiaan." + }, + { + "author": "Mery Hemingway", + "quotes": "Latih diri Anda untuk tidak khawatir. Kekhawatiran tak pernah memperbaiki apa-apa." + }, + { + "author": "Michael Drury", + "quotes": "Kematangan bukanlah suatu keadaan yang dicapai dengan usia. Dia merupakan perkembangan dari cinta, belajar, membaca dan berpikir hingga menghasilkan kemampuan." + }, + { + "author": "Michael Pritchard", + "quotes": "Anda berhenti tertawa bukan karena bertambah tua. Sebaliknya Anda bertambah tua justru karena berhenti tertawa." + }, + { + "author": "Miguel de Cervantes", + "quotes": "Pepatah adalah kalimat singkat berdasarkan pengalaman panjang." + }, + { + "author": "Miguel de Unamuno", + "quotes": "Tidak dicintai orang lain memang menyedihkan, tapi lebih menyedihkan lagi kalau tidak bisa mencintai orang lain." + }, + { + "author": "N. H. Casson", + "quotes": "Kemiskinan jiwa lebih mengerikan daripada kemiskinan jasmani atau materi." + }, + { + "author": "Natalie Portman", + "quotes": "Anda belum bisa dibilang kaya sampai Anda memiliki sesuatu yang tidak dapat dibeli uang." + }, + { + "author": "Nelson Mandela", + "quotes": "Pendidikan adalah senjata paling ampuh dimana kau dapat menggunakannya untuk merubah dunia." + }, + { + "author": "Norman Peale", + "quotes": "Campakanlah jauh-jauh pikiran murung dan kesal itu, lalu bangkitkanlah." + }, + { + "author": "Nunse", + "quotes": "Bukanlah yang kuat, tetapi yang uletlah yang menjadikan mereka manusia yang besar." + }, + { + "author": "O. S. Marden", + "quotes": "Kemajuan adalah hasil dari memusatkan seluruh kekuatan jiwa dan pikiran pada cita-cita yang dituju." + }, + { + "author": "Oliver W. Holmes", + "quotes": "Semakin lama kita hidup, semakin kita menemukan bahwa kita mirip dengan orang lain." + }, + { + "author": "Oprah Winfrey", + "quotes": "Melakukan yang terbaik pada saat ini akan menempatkan Anda ke tempat terbaik pada saat berikutnya." + }, + { + "author": "Oscar Wilde", + "quotes": "Jika seseorang menyatakan kebenaran, dia yakin; cepat atau lambat; akan mendapatkannya." + }, + { + "author": "Pablo Picasso", + "quotes": "Bila semangat Anda menurun, lakukanlah sesuatu. Kalau Anda telah melakukan sesuatu keadaan tidak berubah, lakukanlah sesuatu yang berbeda." + }, + { + "author": "Paul Galvin", + "quotes": "Jangan takut dengan kesalahan. Kebijaksanaan biasanya lahir dari kesalahan." + }, + { + "author": "Paul Harvey", + "quotes": "Saya tidak pernah melihat suatu monumen didirikan bagi orang pesimis." + }, + { + "author": "Pepatah Cina", + "quotes": "Beranilah menyadari kesalahan dan mulai lagi." + }, + { + "author": "Pepatah Cina", + "quotes": "Benar jadi berani." + }, + { + "author": "Pepatah Cina", + "quotes": "Orang yang bertanya, bodoh dalam 5 menit. Dan orang yang tidak bertanya akan tetap bodoh untuk selamanya." + }, + { + "author": "Pepatah Cina", + "quotes": "Bila saya mendengar, saya akan lupa. Setelah melihat saya bisa mengerti. Dan setelah mengerjakan, barulah saya bisa memahami." + }, + { + "author": "Pepatah Cina", + "quotes": "Orang yang tersenyum selalu lebih kuat dari orang yang marah." + }, + { + "author": "Pepatah Cina", + "quotes": "Orang yang memindahkan gunung memulai dengan memindahkan batu-batu kecil." + }, + { + "author": "Pepatah Inggris", + "quotes": "Orang yang mencari masalah akan selalu mendapatkannya." + }, + { + "author": "Pepatah Inggriss", + "quotes": "Keterampilan dan keyakinan merupakan pasukan bersenjata yang tidak dapat dikalahkan." + }, + { + "author": "Pepatah Jepang", + "quotes": "Sebatang anak panah mudah dipatahkan, tetapi tidak demikian dengan sepuluh anak panah yang disatukan." + }, + { + "author": "Pepatah Jepang", + "quotes": "Visi tanpa aksi adalah mimpi di siang bolong. Aksi tanpa visi adalah mimpi buruk." + }, + { + "author": "Pepatah Jerman", + "quotes": "Orang yang tak pernah mencicipi pahit tak akan tahu apa itu manis." + }, + { + "author": "Pepatah Latin", + "quotes": "Dengan belajar Anda bisa mengajar. Dengan mengajar, Anda belajar." + }, + { + "author": "Pepatah Persia", + "quotes": "Saya menangis karena tak punya sepatu, sampai saya melihat orang tak punya kaki." + }, + { + "author": "Pepatah Roma", + "quotes": "Kesengsaraan menghasilkan ketekunan. Ketekunan menghasilkan watak, dan watak menghasilkan harapan." + }, + { + "author": "Pepatah Skotlandia", + "quotes": "Bila kemauan siap, kaki menjadi ringan." + }, + { + "author": "Pepatah Spanyol", + "quotes": "Mengenal diri sendiri adalah awal dari perbaikan diri." + }, + { + "author": "Pepatah Tibet", + "quotes": "Jangan meremehkan raja yang picik, seperti halnya jangan meremehkan sungai yang kecil." + }, + { + "author": "Pepatah Tibet", + "quotes": "Apabila seseorang mengajarkan sesuatu, dia sendiri harus melaksanakan ajaran itu." + }, + { + "author": "Peter Sinclair", + "quotes": "Kehidupan yang hebat adalah kulminasi dari pemikiran-pemikiran hebat disertai dengan tindakan-tindakan hebat." + }, + { + "author": "Phyllis Bottome", + "quotes": "Ada dua cara mengatasi kesulitan, Anda mengubah kesulitan-kesulitan atau Anda mengubah diri sendiri untuk mengatasinya." + }, + { + "author": "Plato", + "quotes": "Orang bijak berbicara karena mereka mempunyai sesuatu untuk dikatakan, orang bodoh berbicara karena mereka ingin mengatakan sesuatu." + }, + { + "author": "Plato", + "quotes": "Orang bijak berbicara karena ia memiliki sesuatu untuk dikatakan. Orang bodoh berbicara karena ia atau dia harus mengatakan sesuatu." + }, + { + "author": "Plato", + "quotes": "Berbuat tidak adil lebih memalukan daripada menderita ketidakadilan." + }, + { + "author": "Plato", + "quotes": "Siapa yang tidak bisa memimpin dirinya sendiri, tidak akan bisa memimpin orang." + }, + { + "author": "Plautus", + "quotes": "Kesabaran adalah obat terbaik untuk semua masalah." + }, + { + "author": "Plautus", + "quotes": "Jauh lebih mudah memulai secara baik daripada mengakhiri secara baik." + }, + { + "author": "Pliny The Elder", + "quotes": "Harapan adalah tiang yang menyangga dunia." + }, + { + "author": "R. A. Kartini", + "quotes": "Kemenangan gemilang tidak diperoleh dari medan pertempuran saja, tetapi sering diperoleh dari hati." + }, + { + "author": "R. Browning", + "quotes": "kita jatuh untuk bangun, berhenti untuk berjalan, dan tidur untuk bangun." + }, + { + "author": "R. W. Shephred", + "quotes": "Kamu harus menghadapi depresi, sama seperti kamu menghadapi seekor harimau." + }, + { + "author": "R.H. Grant", + "quotes": "Jika Anda mempekerjakan orang-orang yang lebih pintar dari Anda, Anda membuktikan Anda lebih pintar dari mereka." + }, + { + "author": "Rabbi Schachtel", + "quotes": "Kebahagiaan bukanlah memiliki apa yang kita inginkan, melainkan menginginkan apa yang kita miliki." + }, + { + "author": "Ralph W. Emerson", + "quotes": "Satu ons aksi jauh lebih berharga daripada satu ton teori." + }, + { + "author": "Ralph W. Emerson", + "quotes": "Seseorang itu sukses besar jika dia sadar, kegagalan-kegagalannya adalah persiapan untuk kemenangan-kemenangannya." + }, + { + "author": "Ralph Waldo Emerson", + "quotes": "Kedamaian tidak terdapat di dunia luar, melainkan terdapat dalam jiwa manusia itu sendiri." + }, + { + "author": "Ralph Waldo Emerson", + "quotes": "Percayalah kepada orang lain, dan mereka akan tulus kepada Anda. Perlakukan mereka seperti orang besar dan mereka akan memperlihatkan dirinya sebagai orang besar." + }, + { + "author": "Rene Descartes", + "quotes": "Tidak cukup hanya punya otak yang baik. Yang penting adalah menggunakannya secara baik." + }, + { + "author": "Richard Bach", + "quotes": "Tanyakan pada diri sendiri rahasia sukses. Dengarkan jawaban Anda, dan lakukan." + }, + { + "author": "Richard C. Miller", + "quotes": "Jika rumput tetangga lebih hijau, bersyukurlah Anda masih bisa berpijak di tanah untuk melihatnya." + }, + { + "author": "Robert Collier", + "quotes": "Kesempatan Anda untuk sukses di setiap kondisi selalu dapat diukur oleh seberapa besar kepercayaan Anda pada diri sendiri." + }, + { + "author": "Robert F. Kennedy", + "quotes": "Kemajuan merupakan kata-kata merdu, tetapi perubahanlah penggerakknya dan perubahan mempunyai banyak musuh." + }, + { + "author": "Robert Frost", + "quotes": "Dua jalan dipisahkan pohon, dan saya mengambil jalan yang jarang ditempuh orang. Dan itulah yang membuat perubahan." + }, + { + "author": "Robert Frost", + "quotes": "Alasan mengapa kecemasan membunuh lebih banyak orang dibanding kerja adalah, lebih banyak orang cemas dibanding bekerja." + }, + { + "author": "Robert G. Ingersoll", + "quotes": "Sedikit orang kaya yang memiliki harta. Kebanyakan harta yang memiliki mereka." + }, + { + "author": "Robert Half", + "quotes": "Ketekunan bisa membuat yang tidak mungkin jadi mungkin, membuat kemungkinan jadi kemungkinan besar, dan kemungkinan besar menjadi pasti." + }, + { + "author": "Robert S. Lynd", + "quotes": "Hanya ikan yang bodoh yang bisa dua kali kena pancing dengan umpan yang sama." + }, + { + "author": "Robert Von Hartman", + "quotes": "Ambisi seperti air laut, semakin banyak orang meminumnya semakin orang menjadi haus." + }, + { + "author": "Robinsori", + "quotes": "Cemas dan ketakutan adalah akibat kebodohan dan keraguan." + }, + { + "author": "Romand Rolland", + "quotes": "Pahlawan adalah seseorang yang melakukan apa yang mampu dia lakukan." + }, + { + "author": "Roosevelt", + "quotes": "Jika Anda ingin menjadi orang besar, janganlah suka beromong besar, kerjakanlah hal-hal yang kecil dahulu." + }, + { + "author": "Ross Cooper", + "quotes": "Satu-satunya cara untuk mengubah hidup kita adalah dengan mengubah pikiran kita." + }, + { + "author": "Ruth P. Freedman", + "quotes": "Perubahan terjadi ketika seseorang menjadi dirinya sendiri, bukan ketika ia mencoba menjadi orang lain." + }, + { + "author": "Salanter Lipkin", + "quotes": "Perbaiki diri Anda, tetapi jangan jatuhkan orang lain." + }, + { + "author": "Samuel Smiles", + "quotes": "Cara tercepat untuk menuntaskan banyak hal adalah dengan menyelesaikannya satu demi satu." + }, + { + "author": "Satya Sai Baba", + "quotes": "Dua hal yang harus dilupakan, kebaikan yang telah kita lakukan kepada orang lain dan kesalahan orang lain kepada kita." + }, + { + "author": "Scott Fitzgerald", + "quotes": "Ingatlah, jika Anda menutup mulut sebenarnya Anda telah melakukan pilihan." + }, + { + "author": "Seneca", + "quotes": "Hati manusia tidak akan pernah tenteram sebelum berdamai dengan diri sendiri." + }, + { + "author": "Seneca", + "quotes": "Hidup berarti berjuang. Hidup nikmat tanpa badai topan adalah laksana laut yang mati." + }, + { + "author": "Shackespeare", + "quotes": "Kesedihan hanya bisa ditanggulangi oleh orang yang mengalaminya sendiri." + }, + { + "author": "Shirley Briggs", + "quotes": "Beranikan diri untuk menjadi dirimu sendiri, karena kita bisa melakukan hal itu lebih baik daripada orang lain." + }, + { + "author": "Soe Hok Gie", + "quotes": "Lebih baik diasingkan daripada menyerah kepada kemunafikan." + }, + { + "author": "Soemantri Metodipuro", + "quotes": "Langkah pertama untuk memilih keyakinan pada diri sendiri adalah mengenal diri kita sendiri." + }, + { + "author": "Sophocles", + "quotes": "Bila seseorang kehilangan segala sumber kebahagiaan, dia tidak lagi hidup, tapi mayat yang bernafas." + }, + { + "author": "St. Jerome", + "quotes": "Baik, lebih baik, terbaik. Jangan pernah berhenti sampai baik menjadi lebih baik, dan lebih baik menjadi terbaik." + }, + { + "author": "Stephen R. Covey", + "quotes": "Motivasi adalah api dari dalam. Jika orang lain mencoba menyalakannya untuk Anda, kemungkinan apinya hanya menyala sebentar." + }, + { + "author": "Steve Jobs", + "quotes": "Saya bangga, baik pada hal yang tidak kami lakukan maupun pada hal yang kami lakukan." + }, + { + "author": "Sujiwo Tejo", + "quotes": "Cinta tak perlu pengorbanan. Pada saat kau merasa berkorban, pada saat itu cintamu mulai pudar." + }, + { + "author": "Sydney Harris", + "quotes": "Ancaman nyata sebenarnya bukan pada saat komputer mulai bisa berpikir seperti manusia, tetapi ketika manusia mulai berpikir seperti komputer." + }, + { + "author": "Theodore Rosevelt", + "quotes": "Lakukan apa yang dapat Anda lakukan dengan apa yang Anda miliki dan tempat Anda berada." + }, + { + "author": "Thomas Alva Edison", + "quotes": "Banyak kegagalan dalam ini dikarenakan orang-orang tidak menyadari betapa dekatnya mereka dengan keberhasilan saat mereka menyerah." + }, + { + "author": "Thomas Carlyle", + "quotes": "Pergilah sejauh mungkin yang bisa Anda lihat dan Anda akan bisa melihat lebih jauh." + }, + { + "author": "Thomas Fuller", + "quotes": "Orang yang tidak bisa memaafkan orang lain sama saja dengan orang yang memutuskan jembatan yang harus dilaluinya, karena semua orang perlu dimaafkan." + }, + { + "author": "Thomas Fuller", + "quotes": "Menyaksikan adalah mempercayai, tapi merasakan adalah kebenaran." + }, + { + "author": "Thomas Jefferson", + "quotes": "Dalam hal prinsip, usahakan kukuh seperti batu karang. Dalam hal selera, coba berenang mengikuti arus." + }, + { + "author": "Tung Desem Waringin", + "quotes": "Setiap badai pasti berlalu dan saya akan tumbuh semakin kuat." + }, + { + "author": "Tyler Durden", + "quotes": "Setelah kehilangan segalanya, barulah kita bebas melakukan apa saja." + }, + { + "author": "Umar bin Khattab", + "quotes": "Raihlah ilmu dan untuk meraih ilmu belajarlah untuk tenang dan sabar." + }, + { + "author": "Vicosta Efran", + "quotes": "Hiduplah seperti lilin yang menerangi orang lain. Jangan hidup seperti duri yang mencucuk diri dan menyakiti orang lain." + }, + { + "author": "Victor Hugo", + "quotes": "Kesedihan adalah buah. Tuhan tak pernah membiarkannya tumbuh dicabang yang terlalu lemah untuk menanggungnya." + }, + { + "author": "Victor Hugo", + "quotes": "Kebahagian tertinggi dalam kehidupan adalah kepastian bahwa Anda dicintai apa adanya, atau lebih tepatnya dicintai walaupun Anda seperti diri Anda adanya." + }, + { + "author": "Victor Hugo", + "quotes": "Masalahnya bukan kurangnya tenaga, tetapi kurangnya daya kemauan." + }, + { + "author": "Vince Lambardi", + "quotes": "Kemenangan bukanlah segala-galanya, tetapi perjuangan untuk menang adalah segala-galanya." + }, + { + "author": "Virginia Wolf", + "quotes": "Jika Anda tak bisa mengatakan hal yang benar dari diri Anda, maka Anda pun tak bisa mengatakan hal yang benar dari orang lain." + }, + { + "author": "W. Camden", + "quotes": "Burung yang terbang pagi akan memperoleh cacing paling banyak." + }, + { + "author": "Walt Disney", + "quotes": "Cara untuk memulai adalah berhenti berbicara dan mulai lakukan sesuatu." + }, + { + "author": "Walter Cronkite", + "quotes": "Sukses akan lebih permanen jika Anda meraihnya tanpa menghancurkan prinsip-prinsip Anda." + }, + { + "author": "Warren Buffett", + "quotes": "Dari dulu saya selalu yakin saya akan kaya. Saya kira saya tak pernah meragukannya, satu menit pun." + }, + { + "author": "Whitney Young", + "quotes": "Lebih baik menyiapkan diri untuk sebuah peluang dan tidak mendapatkannya daripada punya peluang dan tidak menyiapkan diri." + }, + { + "author": "William A. W.", + "quotes": "Satu-satunya yang bisa menghalangi kita adalah keyakinan yang salah dan sikap yang negatif." + }, + { + "author": "William Allen White", + "quotes": "Saya tidak takut pada hari esok karena saya sudah melihat hari kemarin dan saya mencintai hari ini." + }, + { + "author": "William Arthur", + "quotes": "Guru yang biasa-biasa, berbicara. Guru yang bagus, menerangkan. Guru yang hebat, mendemonstrasikan. Guru yang agung, memberi inspirasi." + }, + { + "author": "William F. Halsey", + "quotes": "Semua masalah menjadi lebih kecil jika Anda tidak mengelaknya, tapi menghadapinya." + }, + { + "author": "William J. Johnston", + "quotes": "Perubahan yang paling bermakna dalam hidup adalah perubahan sikap. Sikap yang benar akan menghasilkan tindakan yang benar." + }, + { + "author": "William James", + "quotes": "Jika Anda harus membuat pilihan dan Anda tidak melakukannya, itu saja sudah pilihan." + }, + { + "author": "William James", + "quotes": "Percaya bahwa hidup itu berharga, dan kepercayaan Anda akan membantu menciptakan hidup yang berharga." + }, + { + "author": "William Ralph Inge", + "quotes": "Kuatir sama seperti membayar bunga untuk uang yang mungkin tak pernah Anda pinjam." + }, + { + "author": "William Shakespeare", + "quotes": "Jangan sering menyalakan api kebencian terhadap musuhmu, karena nanti akan membakar dirimu sendiri." + }, + { + "author": "William Shakespeare", + "quotes": "Bila kamu jujur kepada dirimu sendiri, bagai siang pasti berganti malam, kamu takkan pernah berdusta kepada orang lain." + }, + { + "author": "William Shakespeare", + "quotes": "Kutu yang berani adalah kutu yang bisa berani mendapatkan sarapannya pada bibir seekor singa." + }, + { + "author": "Winston Churchill", + "quotes": "Kita menyambung hidup dengan apa yang kita peroleh, tapi kita menghadirkan kehidupkan dengan apa yang kita berikan." + }, + { + "author": "Wolfgang von Gothe", + "quotes": "Pengetahuan tidaklah cukup, kita harus mengamalkannya. Niat tidak cukup, kita harus melakukannya." + }, + { + "author": "Zachary Scott", + "quotes": "Ketika Anda bertambah tua, Anda akan menemukan satu-satunya hal yang Anda sesali adalah hal-hal yang tidak Anda lakukan." + }, + { + "author": "Zig Zaglar", + "quotes": "Batu fondasi untuk sukses yang seimbang adalah kejujuran, watak, integritas, iman, cinta dan kesetiaan." + }, + { + "author": "Zig Zaglar", + "quotes": "Kebanyakan orang gagal meraih cita-citanya bukan karena mereka tidak mampu, tetapi karena tidak berkomitmen." + }, + { + "author": "Zig Zaglar", + "quotes": "Kita tidak harus hebat saat memulai, tapi kita harus memulai untuk menjadi hebat." + } + ] \ No newline at end of file diff --git a/node_modules/dhn-api/database/manga.js b/node_modules/dhn-api/database/manga.js new file mode 100644 index 000000000..002dafd77 --- /dev/null +++ b/node_modules/dhn-api/database/manga.js @@ -0,0 +1,329 @@ +const axios = require('axios') +const cheerio = require('cheerio') + +/* + * @Komiku-Search + */ + const Komiku_ = async (manga) => { + if (!manga) { + return new TypeError("No Querry Input! Bakaaa >\/\/<"); + } + try { + const res = await axios.request(`https://data3.komiku.id/cari/?post_type=manga&s=${manga}`, { + method: "GET", + headers: { + "User-Agent": "Mozilla/5.0 (Linux; Android 9; Redmi 7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.77 Mobile Safari/537.36" + } + }) +const hasil = [] +const $ = cheerio.load(res.data) +$('div.bge').each(function (a, b) { +let title = $(b).find('a > h3').text().trim() +let url = $(b).find('a').attr('href') +let desc = $(b).find('p').text().trim() +let img = $(b).find('img').attr('data-src') +let chapter = $(b).find('div.new1 > a').attr('href') +let baru = $(b).find('div.new1 > a').eq(1).attr('href') +const result = { + status: res.status, + creator: "@dehan_j1ng", + manga: title, + manga_desc: desc, + manga_url: 'https://data3.komiku.id' + url, + manga_thumb: img, + chapter: { + pertama: 'https://data3.komiku.id' + chapter, + terbaru: 'https://data3.komiku.id' + baru + } +} +hasil.push(result) +}) +return hasil + } catch (eror404) { + return "=> Error =>" + eror404 + } +} + +/* + * @Anime-Planet Search + */ +const AnimePlanet_ = async (manga) => { +if (!manga) { + return new TypeError("No Querry Input! Bakaaa >\/\/<"); + } + try { +const res = await axios.get(`https://www.anime-planet.com/manga/all?name=` + manga, { +method: 'GET', +headers: { + "User-Agent": "Mozilla/5.0 (Linux; Android 9; Redmi 7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.77 Mobile Safari/537.36", + } +}) +const hasil = []; +const $ = cheerio.load(res.data); +$('li.card').find('a').each(function(a, b) { +let manga_name = $(b).find('h3.cardName').text() +let manga_thumb = $(b).find('div.crop > img').attr('data-src') +let manga_url = $(b).attr('href') +const result = { + status: res.status, + creator: "@dehan_j1ng", + manga_name, + manga_url: 'https://www.anime-planet.com' + manga_url, + manga_thumb: 'https://www.anime-planet.com' + manga_thumb, +} +hasil.push(result) +}) + return hasil + } catch (eror404) { + return "=> Error =>" + eror404 + } +} + +/* + * @Komik Fox - Search + */ +const KomikFox_ = async(manga) => { +if (!manga) { + return new TypeError("No Querry Input! Bakaaa >\/\/<"); + } + try { +const res = await axios.get(`https://komikfox.web.id/page/1/?s=`+ manga, { +method: 'GET', +headers: { + "User-Agent": "Mozilla/5.0 (Linux; Android 9; Redmi 7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.77 Mobile Safari/537.36", + } +}) +const hasil = []; +const $ = cheerio.load(res.data); +$('div.td_module_10.td_module_wrap.td-animation-stack').each(function(a, b) { +let manga_name = $(b).find('a.td-image-wrap').attr('title') +let manga_url = $(b).find('a').attr('href') +let manga_release = $(b).find('span.td-post-date').text() +let manga_thumb = $(b).find('img').attr('src').replace('//i0.wp.com/','') +const result = { + status: res.status, + creator: "@dehan_j1ng", + manga_name, + manga_url, + manga_thumb, + manga_release +} +hasil.push(result) +}) + return hasil + } catch (eror404) { + return "=> Error =>" + eror404 + } +} + +/* + * @Komik Station - Search + */ +const KomikStation_ = async(manga) => { +if (!manga) { + return new TypeError("No Querry Input! Bakaaa >\/\/<"); + } + try { +const res = await axios.get(`https://www.komikstation.com/?s=`+ manga, { +method: 'GET', +headers: { + "User-Agent": "Mozilla/5.0 (Linux; Android 9; Redmi 7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.77 Mobile Safari/537.36", + } +}) +const hasil = [] +const $ = cheerio.load(res.data); +$('div.bs').each(function(a, b) { +let manga_name = $(b).find('a').attr('title') +let manga_url = $(b).find('a').attr('href') +let manga_thumb = $(b).find('img').attr('src') +let manga_eps = $(b).find('div.epxs').text() +const result = { + status: res.status, + creator: "@dehan_j1ng", + manga_name, + manga_url, + manga_thumb, + manga_eps +} +hasil.push(result) +}) + return hasil + } catch (eror404) { + return "=> Error =>" + eror404 + } +} + +/* + * @Mangaku - Search + */ +const Mangakus_ = async (manga) => { +if (!manga) { + return new TypeError("No Querry Input! Bakaaa >\/\/<"); + } + try { +let mangasss = manga.replace(/ /g,'+') +const res = await axios.get(`https://mangaku.pro/search/`+ manga, { +headers: { + "User-Agent": "Mozilla/5.0 (Linux; Android 9; Redmi 7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.77 Mobile Safari/537.36", + } +}) +const hasil = []; +const $ = cheerio.load(res.data); +$('div.bs').each(function(a, b) { +let manga_name = $(b).find('div.tt').text().replace(' ','') +let manga_url = $(b).find('a').attr('href') +let manga_thumb = $(b).find('img').attr('data-src') +let manga_rating = $(b).find('span.vts > b').text() +let manga_eps = $(b).find('div.epxs > span').text() +const result = { + status: res.status, + creator: "@dehan_j1ng", + manga_name, + manga_url, + manga_thumb, + manga_eps, + manga_rating: manga_rating + ' rate', +} +hasil.push(result) +}) + return hasil + } catch (eror404) { + return "=> Error =>" + eror404 + } +} + +/* + * @Kiryuu.id - Search + */ +const Kiryuus_ = async (manga) => { +if (!manga) { + return new TypeError("No Querry Input! Bakaaa >\/\/<"); + } + try { +const res = await axios.get(`https://kiryuu.id/?s=`+ manga, { +method: 'GET', +headers: { + "User-Agent": "Mozilla/5.0 (Linux; Android 9; Redmi 7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.77 Mobile Safari/537.36", + } +}) +const hasil = []; +const $ = cheerio.load(res.data); +$('div.bs').each(function(a, b) { +let manga_name = $(b).find('div.tt').text().replace(' ','') +let manga_url = $(b).find('a').attr('href') +let manga_thumb = $(b).find('img').attr('src') +let manga_rating = $(b).find('div.numscore').text() +let manga_eps = $(b).find('div.epxs').text() +const result = { + status: res.status, + creator: "@dehan_j1ng", + manga_name, + manga_url, + manga_thumb, + manga_eps, + manga_rating: manga_rating + ' rate', +} +hasil.push(result) +}) + return hasil + } catch (eror404) { + return "=> Error =>" + eror404 + } +} + +/* + * @Kissmanga - Search + */ +const KissM_ = async(manga) => { +if (!manga) { + return new TypeError("No Querry Input! Bakaaa >\/\/<"); + } + try { +const res = await axios.get(`https://kissmanga.org/manga_list?q=${manga}&action=search`, { +method: 'GET', +headers: { + "User-Agent": "Mozilla/5.0 (Linux; Android 9; Redmi 7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.77 Mobile Safari/537.36", + } +}) +const hasil = []; +const $ = cheerio.load(res.data); +$('div.listing.full > div').each(function(a, b) { +let manga_name = $(b).find('a.item_movies_link').text() +let manga_url = $(b).find('a.item_movies_link').attr('href') +const result = { + status: res.status, + creator: "@dehan_j1ng", + manga_name, + manga_url: 'https://kissmanga.org'+ manga_url +} +hasil.push(result) +}) +akhir = hasil.filter(v => v.manga_name !== '' && v.manga_url !== undefined) + return akhir + } catch (eror404) { + return "=> Error =>" + eror404 + } +} + +/* + * @Klikmanga - Search + */ +const KlikS_ = async (manga) => { +if (!manga) { + return new TypeError("No Querry Input! Bakaaa >\/\/<"); + } + try { +const res = await axios.get(`https://klikmanga.com/?s=${manga}&post_type=wp-manga`, { +method: 'GET', +headers: { + "User-Agent": "Mozilla/5.0 (Linux; Android 9; Redmi 7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.77 Mobile Safari/537.36", + } +}) +const hasil = []; +const $ = cheerio.load(res.data); +$('div.row.c-tabs-item__content').each(function(a, b) { +let manga_name = $(b).find('h3').text() +let manga_url = $(b).find('a').attr('href') +let manga_thumb = $(b).find('img').attr('src') +let manga_desc = $(b).find('div.post-content_item.mg_alternative').text().slice(1) +let manga_author = $(b).find('div.post-content_item.mg_author').text().slice(1) +let manga_status = $(b).find('div.post-content_item.mg_status').text().slice(1) +let manga_release = $(b).find('div.post-content_item.mg_release').text().slice(1) +let manga_genre = $(b).find('div.post-content_item.mg_genres').text().slice(1) +const result = { + status: res.status, + creator: "@dehan_j1ng", + manga_name, + manga_url, + manga_thumb, + manga_author, + manga_genre, + manga_status, + manga_release, + manga_desc +} +hasil.push(result) +}) + return hasil + } catch (eror404) { + return "=> Error =>" + eror404 + } +} + +module.exports = { + Komiku_, + AnimePlanet_, + KomikFox_, + KomikStation_, + Mangakus_, + Kiryuus_, + KissM_, + KlikS_ +} + +/* + * + * @dehan_j1ng + * An Example Api for De-BOTZ + * + */ \ No newline at end of file diff --git a/node_modules/dhn-api/database/news.js b/node_modules/dhn-api/database/news.js new file mode 100644 index 000000000..bebae0a87 --- /dev/null +++ b/node_modules/dhn-api/database/news.js @@ -0,0 +1,728 @@ +const axios = require("axios"); +const cheerio = require("cheerio"); + +/* + * @BBC - News + */ + +const BBC = async () => { + try { + const hasil = []; + const link = `https://www.bbc.com/indonesia`; + const res = await axios.get(link, { + headers: { + "User-Agent": "Mozilla/5.0 (Linux; Android 9; Redmi 7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.77 Mobile Safari/537.36" + } + }); + const $ = cheerio.load(res.data); + $('li.e57qer20.bbc-lpu9rr.eom0ln51').each(function(a, b) { + let berita = $(b).find("p").text(); + let berita_diupload = $(b).find("time").text(); + let berita_url = $(b).find("a").attr("href"); + const result = { + status: res.status, + creator: "@dehan_j1ng", + berita, + berita_diupload, + berita_url: "https://www.bbc.com" + berita_url, + }; + hasil.push(result); + }); + akhir = hasil.filter(v => v.berita !== "" && v.berita_diupload !== ""); + return akhir; + } catch (eror404) { + return "=> Error =>" + eror404; + } +}; + +/* + * @Kumparan.com + */ +const Kumparan_ = async () => { + try { +const res = await axios.get(`https://m.kumparan.com/channel/news`, { +method: 'GET', +headers: { + "User-Agent": "Mozilla/5.0 (Linux; Android 9; Redmi 7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.77 Mobile Safari/537.36", + } +}) +const hasil = [] +const $ = cheerio.load(res.data) +$('div.Viewweb__StyledView-p5eu6e-0.erokzz').each(function(a, b) { +let berita = $(b).find('span.Textweb__StyledText-sc-1fa9e8r-0.jeegbA.CardContentweb__CustomText-sc-1wr516g-0.hpLohH').text().trim() +let berita_url = $(b).find('a').attr('href') +let berita_thumb = $(b).find('div.Imageweb__ImageWrapper-sc-1kvvof-0.eZCymS').attr('style').slice(15).replace(') center center / cover repeat','').replace('fl_progressive,fl_lossy,c_fill,e_blur:80,q_auto:best,w_16,ar_1:1/','') +let berita_diupload = $(b).find('span.Textweb__StyledText-sc-1fa9e8r-0.exBPjh').text().trim().replace(' ',' : ').slice(5) +const result = { + status: res.status, + creator: "@dehan_j1ng", + berita, + berita_url: 'https://m.kumparan.com' + berita_url, + berita_thumb, + berita_diupload +} +hasil.push(result) +}) + return hasil + } catch (eror404) { + return "=> Error =>" + eror404 + } +} + +/* + * @iNews TV + */ +const iNewsTV_ = async () => { + try { +const res = await axios.get(`https://www.inews.id/news`, { +method: 'GET', +headers: { + "User-Agent": "Mozilla/5.0 (Linux; Android 9; Redmi 7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.77 Mobile Safari/537.36", + } +}) +const hasil = [] +const $ = cheerio.load(res.data) +$('div.wdtop-row.more-news').each(function (a, b) { +let berita = $(b).find('h2.wdtop-text').text().trim() +let berita_diupload = $(b).find('span.wd-date').text().trim().slice(0, 35) +let berita_jenis = $(b).find('span.wd-date > strong').text().trim() +let berita_url = $(b).find('a').attr('href') +let berita_thumb = $(b).find('div.lazy.wdtop-col-img').attr('data-src') +const result = { + status: res.status, + creator: "@dehan_j1ng", + berita, + berita_url, + berita_diupload, + berita_jenis, + berita_thumb +} +hasil.push(result) +}) + return hasil + } catch (eror404) { + return "=> Error =>" + eror404 + } +} + +/* + * @CNN Indonesia + */ +const CNN_ = async () => { + try { +const res = await axios.get(`https://www.cnnindonesia.com/`, { +method: 'GET' +}) +const hasil = [] +const $ = cheerio.load(res.data) +$('article').each(function (a, b) { +let berita = $(b).find('a').attr('href') +let y = $(b).find('img').attr('alt') +let img = $(b).find('img').attr('src') +let jenis = $(b).find('span.date').text().trim() +const result = { + status: res.status, + creator: "@dehan_j1ng", + berita: y, + berita_url: berita, + berita_thumb: img +} +hasil.push(result) +}) +akhir = hasil.filter(v => v.berita !== undefined && v.berita_url !== undefined && v.berita_thumb !== undefined) + return akhir + } catch (eror404) { + return "=> Error =>" + eror404 + } +} + +/* + * @Metro TV + */ +const metroTV_ = async () => { + try { +const res = await axios.get(`https://m.metrotvnews.com/news`, { +method: 'GET' +}) +const hasil = [] +const $ = cheerio.load(res.data) +$('div.item-5-mobile').each(function(a, b) { +let img = $(b).find('img').attr('src') +let title = $(b).find('h2 > a').text().trim() +let berita_url = $(b).find('h2 > a').attr('href') +const result = { + status: res.status, + creator: "@dehan_j1ng", + berita: title, +berita_url: 'https://m.metrotvnews.com' + berita_url, + berita_thumb: img +} +hasil.push(result) +}) + return hasil + } catch (eror404) { + return "=> Error =>" + eror404 + } +} + +/* + * @Tribun News + */ +const Tribun_ = async () => { + try { +const res = await axios.get(`https://m.tribunnews.com/news`, { +method: 'GET', +headers: { + "User-Agent": "Mozilla/5.0 (Linux; Android 9; Redmi 7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.77 Mobile Safari/537.36", + } +}) +const hasil = [] +const $ = cheerio.load(res.data) +$('ul#latestul > li').next().next().next().next().next().next().next().next().next().next().next().each(function(a, b) { +let berita = $(b).find('h3').text().trim() +let berita_url = $(b).find('a').attr('href') +let berita_thumb = $(b).find('img').attr('src') +let berita_jenis = $(b).find('h4 > a').text().trim() +let berita_diupload = $(b).find('time').text().trim() +const result = { + status: res.status, + creator: "@dehan_j1ng", + berita, + berita_url, + berita_thumb, + berita_jenis, + berita_diupload +} +hasil.push(result) +}) + return hasil + } catch (eror404) { + return "=> Error =>" + eror404 + } +} + +/* + * @Dailynews + */ +const DailyNews_ = async () => { + try { +const res = await axios.get(`https://www.dailynewsindonesia.com/rubrik/news`, { +method: 'GET', +headers: { + "User-Agent": "Mozilla/5.0 (Linux; Android 9; Redmi 7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.77 Mobile Safari/537.36", + } +}) +const hasil = [] +const $ = cheerio.load(res.data) +$('div.jeg_posts.jeg_load_more_flag > article').each(function(a, b) { +let berita = $(b).find('h3.jeg_post_title').text().trim() +let berita_url = $(b).find('a').attr('href') +let berita_thumb = $(b).find('img').attr('data-src') +const result = { + status: res.status, + creator: "@dehan_j1ng", + berita, + berita_url, + berita_thumb +} +hasil.push(result) +}) + return hasil + } catch (eror404) { + return "=> Error =>" + eror404 + } +} + +/* + * @Detik.com + */ +const DetikNews_ = async () => { + try { +const res = await axios.get(`https://www.detik.com/terpopuler?tag_from=framebar&_ga=2.250751302.1905924499.1623147163-1763618333.1613153099`, { +method: 'GET' +}) +const hasil = [] +const $ = cheerio.load(res.data) +$('article').each(function (a, b) { +let berita = $(b).find('div > div > h3.media__title > a.media__link').text().trim() +let berita_url = $(b).find('a.media__link').attr('href') +let berita_thumb = $(b).find('img').attr('src').replace('?w=220&q=90','') +let berita_diupload = $(b).find('div.media__date > span').attr('title') +const result = { + status: res.status, + creator: "@dehan_j1ng", + berita, + berita_url, + berita_thumb, + berita_diupload +} +hasil.push(result) +}) + return hasil + } catch (eror404) { + return "=> Error =>" + eror404 + } +} + +/* + * @Okezone + */ +const Okezone_ = async() => { + try { +const res = await axios.get(`https://news.okezone.com/`, { +method: 'GET', +headers: { + "User-Agent": "Mozilla/5.0 (Linux; Android 9; Redmi 7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.77 Mobile Safari/537.36", + } +}) +const hasil = []; +const $ = cheerio.load(res.data); +$('ul.list-berita > div > li').each(function(a, b) { + $(b).find('div.img').each(function(c, d) { + $(b).find('h2.title').each(function(e, f) { +let berita = $(f).find('a').text().replace(/\n/g,'') +let berita_thumb = $(d).find('a').attr('data-original') +let berita_url = $(d).find('a').attr('href') +let berita_diupload = $(f).find('span.timego').text().slice(1) +const result = { + status: res.status, + creator: "@dehan_j1ng", + berita, + berita_url, + berita_thumb, + berita_diupload: ' - ' + berita_diupload +}; +hasil.push(result); +}) +}) +}) + return hasil + } catch (eror404) { + return "=> Error =>" + eror404 + } +} + +/* + * @CNBC Indonesia + */ +const CNBC_ = async () => { + try { +const res = await axios.get(`https://www.cnbcindonesia.com/news/indeks/3/1?kanal=3&date=`, { +method: 'GET', +headers: { + "User-Agent": "Mozilla/5.0 (Linux; Android 9; Redmi 7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.77 Mobile Safari/537.36", + } +}) +const hasil = [] +const $ = cheerio.load(res.data) +$('article.list__item.clearfix').each(function (a, b) { +let berita = $(b).find('h4').text().trim() +let berita_url = $(b).find('a').attr('href') +let berita_diupload = $(b).find('span.date').text().trim() +let berita_thumb = $(b).find('img').attr('src') +const result = { + status: res.status, + creator: "@dehan_j1ng", + berita, + berita_url, + berita_thumb, + berita_diupload +} +hasil.push(result) +}) + return hasil + } catch (eror404) { + return "=> Error =>" + eror404 + } +} + +/* + * @Fajar News + */ +const KoranFajar_ = async () => { + try { +const res = await axios.get(`https://fajar.co.id/category/nasional/`, { +method: 'GET', +headers: { + "User-Agent": "Mozilla/5.0 (Linux; Android 9; Redmi 7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.77 Mobile Safari/537.36", + } +}) +const hasil = [] +const $ = cheerio.load(res.data) +$('article').each(function (a, b) { +let berita = $(b).find('a.txt__3').text().trim() +let berita_url = $(b).find('a').attr('href') +let berita_diupload = $(b).find('span').text().trim() +let berita_jenis = $(b).find('li.post-meta').text().trim() +let berita_thumb = $(b).find('img.img-home.wp-post-image').attr('data-cfsrc') +const result = { + status: res.status, + creator: "@dehan_j1ng", + berita, + berita_url, + berita_thumb, + berita_jenis, + berita_diupload +} +hasil.push(result) +}) + return hasil + } catch (eror404) { + return "=> Error =>" + eror404 + } +} + +/* + * @Kompas.com + */ +const Kompas_ = async () => { + try { +const res = await axios.get(`https://news.kompas.com/`, { +method: 'GET', +headers: { + "User-Agent": "Mozilla/5.0 (Linux; Android 9; Redmi 7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.77 Mobile Safari/537.36", + } +}) +const hasil = [] +const $ = cheerio.load(res.data) +$('ul#latest_content > li.box-shadow-new > div.ListCol').each(function (a, b) { +let berita = $(b).find('h3 > a').text().trim() +let berita_url = $(b).find('a').attr('href') +let berita_thumb = $(b).find('img.lozad').attr('data-src') +let berita_jenis = $(b).find('strong > a').text().trim() +let berita_diupload = $(b).find('div.article__channel').text().trim().slice(11).replace(' - ','') +const result = { + status: res.status, + creator: "@dehan_j1ng", + berita, + berita_url, + berita_thumb, + berita_jenis, + berita_diupload +} +hasil.push(result) +}) + return hasil + } catch (eror404) { + return "=> Error =>" + eror404 + } +} + +/* + * @Koran Sindo + */ +const KoranSindo_ = async () => { + try { +const res = await axios.get(`https://nasional.sindonews.com/`, { +method: 'GET', +headers: { + "User-Agent": "Mozilla/5.0 (Linux; Android 9; Redmi 7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.77 Mobile Safari/537.36", + } +}) +const hasil = [] +const $ = cheerio.load(res.data) +$('div.news').find('ul > li').next().next().next().next().next().next().next().next().next().next().each(function (a, b) { +let berita = $(b).find('div.breaking-title > a').text().trim() +let berita_thumb = $(b).find('div > a > img').attr('src') +let berita_url = $(b).find('div > a').attr('href') +let berita_jenis = $(b).find('div.breaking-title > p').text().trim() +const result = { + status: res.status, + creator: "@dehan_j1ng", + berita, + berita_jenis, + berita_url, + berita_thumb +} +hasil.push(result) +}) + return hasil + } catch (eror404) { + return "=> Error =>" + eror404 + } +} + +/* + * @Tempo.com + */ +const TempoNews_ = async () => { + try { +const res = await axios.get(`https://nasional.tempo.co/`, { +method: 'GET', +headers: { + "User-Agent": "Mozilla/5.0 (Linux; Android 9; Redmi 7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.77 Mobile Safari/537.36", + } +}) +const hasil = []; +const $ = cheerio.load(res.data); +$('div.wrapper.clearfix').each(function(a, b) { +let berita = $(b).find('h2.title').text() +let berita_url = $(b).find('a').attr('href') +let berita_thumb = $(b).find('a > img').attr('src') +let berita_diupload = $(b).find('span').text() +const result = { + status: res.status, + creator: "@dehan_j1ng", + berita, + berita_url, + berita_thumb, + berita_diupload +} +hasil.push(result) +}) +akhir = hasil.filter(v => v.berita !== 'POPULER' && v.berita_thumb !== undefined) + return akhir + } catch (eror404) { + return "=> Error =>" + eror404 + } +} + +/* + * @Indozone News + */ +const Indozone_ = async () => { + try { +const res = await axios.get(`https://www.indozone.id/index`, { +method: 'GET', +headers: { + "User-Agent": "Mozilla/5.0 (Linux; Android 9; Redmi 7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.77 Mobile Safari/537.36", + } +}) +const hasil = []; +const $ = cheerio.load(res.data); +$('ul.news_box.square_box.image-left').each(function(f, d) { + $(d).find('li').each(function(a, b) { +let berita = $(b).find('h3').text().replace(/\n/g,'').replace(/ /g,'') +let berita_url = $(b).find('a').attr('href') +let berita_thumb = $(b).find('img').attr('src') +let berita_jenis = $(b).find('div.text').text().replace(/\n/g,'').replace(/ /g,'').slice(4).slice(0, 6).replace(/ /g,'') +let berita_diupload= $(b).find('div.info.un-i').text().replace(/\n/g,'').replace(/ /g,'') +const result = { + status: res.status, + creator: "@dehan_j1ng", + berita, + berita_url, + berita_thumb, + berita_diupload, + berita_jenis +} +hasil.push(result) +}) +}) +akhir = hasil.filter(v => v.berita_url !== undefined && v.berita_diupload !== '') + return akhir + } catch (eror404) { + return "=> Error =>" + eror404 + } +} + +/* + * @Antara News + */ +const AntaraNews_ = async () => { + try { +const res = await axios.get(`https://m.antaranews.com/terkini`, { +method: 'GET', +headers: { + "User-Agent": "Mozilla/5.0 (Linux; Android 9; Redmi 7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.77 Mobile Safari/537.36", + } +}) +const hasil = []; +const $ = cheerio.load(res.data); +$('div.row.item').each(function(a, b) { +let berita = $(b).find('h3').text() +let berita_url = $(b).find('a').attr('href') +let berita_jenis = $(b).find('div.meta > a').text() +let berita_diupload = $(b).find('div.meta').text().replace(' -',' ').slice(10).replace(/ /g,'') +let berita_thumb = $(b).find('img').attr('data-src') +const result = { + status: res.status, + creator: "@dehan_j1ng", + berita, + berita_url, + berita_thumb, + berita_jenis, + berita_diupload +} +hasil.push(result) +}) + return hasil + } catch (eror404) { + return "=> Error =>" + eror404 + } +} + +/* + * @Republika News + */ +const Republika_ = async() => { + try { +const res = await axios.get(`https://m.republika.co.id/kanal/news`, { +method: 'GET', +headers: { + "User-Agent": "Mozilla/5.0 (Linux; Android 9; Redmi 7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.77 Mobile Safari/537.36", + } +}) +const hasil = []; +const $ = cheerio.load(res.data); +$('article').each(function(a, b) { +let berita = $(b).find('h2').text() +let berita_url = $(b).find('a').attr('href') +let berita_jenis = $(b).find('a.nm-kanal').text() +let berita_diupload = $(b).find('span.date').text() +let berita_thumb = $(b).find('img').attr('data-original') +const result = { + status: res.status, + creator: "@dehan_j1ng", + berita, + berita_url, + berita_thumb, + berita_jenis, + berita_diupload +} +hasil.push(result) +}) +akhir = hasil.filter(v => v.berita_thumb !== '') + return akhir + } catch (eror404) { + return "=> Error =>" + eror404 + } +} + +/* + * @Viva.id - News + */ + +const VIVA_ = async () => { + try { + const res = await axios.request(`https://www.viva.co.id/amp/berita`, { + method: "GET", + headers: { + "User-Agent": "Mozilla/5.0 (Linux; Android 9; Redmi 7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.77 Mobile Safari/537.36" + } + }); + let hasil = []; + const $ = cheerio.load(res.data); + $("li > div.al-row").each(function(a, b) { + let berita = $(b).find("a.al-title > h3").text(); + let berita_url = $(b).find("a").attr("href"); + let berita_thumb = $(b).find(".coverimg").attr("src"); + let berita_jenis = $(b).find(".al-cate > h4").text().replace(/[\n|\t| ]/g,""); + let berita_diupload = $(b).find("li").eq(1).text(); + const result = { + berita, + berita_url, + berita_thumb, + berita_jenis, + berita_diupload + }; + hasil.push(result); + }); + var filter = hasil.filter(v => v.berita !== ""); + return filter; + } catch (error404) { + return "=> Error => " + error404; + } +} + +/* + * @Kontan.id - News + */ + +const Kontan_ = async () => { + try { + const res = await axios.request(`https://www.kontan.co.id/`, { + method: "GET", + headers: { + "User-Agent": "Mozilla/5.0 (Linux; Android 9; Redmi 7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.77 Mobile Safari/537.36" + } + }); + let hasil = []; + const $ = cheerio.load(res.data); + $("div.news-list > ul > li").each(function(a, b) { + let berita = $(b).find("div.box-news.fleft > a > h1").text(); + let berita_url = $(b).find("a").attr("href"); + let berita_thumb = $(b).find("div.image-thumb").find("img").attr("data-src"); + let berita_jenis = $(b).find("a.link-orange").text(); + let berita_diupload = $(b).find("div.box-news.fleft").text().split(/[|]/g).splice(1).join("").slice(1); + const result = { + berita, + berita_url, + berita_thumb, + berita_jenis, + berita_diupload + }; + hasil.push(result); + }); + var filter = hasil.filter(v => v.berita !== "" && v.berita_diupload !== undefined); + return filter; + } catch (error404) { + return "=> Error => " + error404; + } +} + +/* + * @Merdeka - News + */ + +const Merdeka_ = async () => { + try { + const res = await axios.request(`https://m.merdeka.com/`, { + method: "GET", + headers: { + "User-Agent": "Mozilla/5.0 (Linux; Android 9; Redmi 7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.77 Mobile Safari/537.36" + } + }); + let hasil = []; + const $ = cheerio.load(res.data); + $("li").find("div.mdk-top-stories-item-container").each(function(a, b) { + let berita = $(b).find("img.lazy_loaded").attr("title"); + let berita_url = "https://m.merdeka.com" + $(b).find("a").attr("href"); + let berita_thumb = $(b).find("img.lazy_loaded").attr("data-src"); + let berita_diupload = $(b).find("div.time").text(); + const result = { + status: res.status, + creator: "@dehan_j1ng", + berita, + berita_url, + berita_thumb, + berita_diupload + }; + hasil.push(result); + }); + var filter = hasil.filter(v => v.berita !== ""); + return filter; + } catch (error404) { + return "=> Error => " + error404; + } +} + +module.exports = { + metroTV_, + CNN_, + iNewsTV_, + Kumparan_, + Tribun_, + DailyNews_, + DetikNews_, + Okezone_, + CNBC_, + KoranFajar_, + Kompas_, + KoranSindo_, + TempoNews_, + Indozone_, + AntaraNews_, + Republika_, + BBC, + VIVA_, + Kontan_, + Merdeka_ +} + +/* + * + * @dehan_j1ng + * An Example Api for De-BOTZ + * + */ \ No newline at end of file diff --git a/node_modules/dhn-api/database/other.js b/node_modules/dhn-api/database/other.js new file mode 100644 index 000000000..b632f6320 --- /dev/null +++ b/node_modules/dhn-api/database/other.js @@ -0,0 +1,100 @@ +const axios = require("axios"); +const cheerio = require("cheerio"); + +const loghandler = { + noinput: "No Querry Input! Baakaa >\/\/<", + er: "=> Error:" +}; + +/* + * @Emojipedia + */ + +const Emojing_ = async (emoji) => { + _regex = /[a-z|0-9]/gi; + if (!emoji) { + return loghandler.noinput; + } + if (emoji.match(_regex)) { + return "Jangan huruf/angkah pack :v"; + } + try { + const hasil = {}; + const res = await axios.get("https://emojipedia.org/" + encodeURI(emoji) + "/", { + method: "GET", + headers: { + "User-Agent": "Mozilla/5.0 (Linux; Android 9; Redmi 7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.77 Mobile Safari/537.36" + } + }); + const $ = cheerio.load(res.data); + hasil.status = res.status; + hasil.creator = "@dehan_j1ng"; + hasil.unicode_name = $("section").eq(3).find("p").text().trim(); + hasil.unicode_alias = $(".aliases").find("ul > li").text().trim().split(emoji).join(" - " + emoji); + hasil.unicode_desc = $(".description").find("p").text().trim(); + hasil.unicode_pack = []; + $(".vendor-list > ul > li").each(function (a, b) { + let vendor_thumb = $(b).find("div.vendor-image > img").attr('data-cfsrc'); + let vendor_name = $(b).find("div.vendor-info > h2").text(); + const result = { + vendor_name, + vendor_thumb + }; + hasil.unicode_pack.push(result); + }); + hasil.vendor_pack = []; + $("ul.vendor-rollout > li").each(function(c, d) { + vendor_version = $(d).find("div.vendor-info > p").text(); + vendor_url = "https://emojipedia.org" + $(d).find("div.vendor-image > a").attr("href"); + vendor_thumb = $(d).find("div.vendor-image").find("img.vendor-rollout-lazy").attr("data-src"); + const result = { + vendor_version, + vendor_url, + vendor_thumb + }; + hasil.vendor_pack.push(result); + }); +return hasil; +} catch (error404) { + return loghandler.er + error404; +} +}; + +/* + * @Info Corona + */ + +const Corona_ = async (country) => { + if (!country) return loghandler.noinput; + try { + const res = await axios.request(`https://www.worldometers.info/coronavirus/country/` + country, { + method: "GET", + headers: { + "User-Agent": "Mozilla/5.0 (Linux; Android 9; Redmi 7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.77 Mobile Safari/537.36" + } + }); + let result = {}; + const $ = cheerio.load(res.data); + result.negara = $("div").find("h1").text().slice(3).split(/ /g)[0]; + result.total_kasus = $("div#maincounter-wrap").find("div.maincounter-number > span").eq(0).text() + " total"; + result.total_kematian = $("div#maincounter-wrap").find("div.maincounter-number > span").eq(1).text() + " total"; + result.total_sembuh = $("div#maincounter-wrap").find("div.maincounter-number > span").eq(2).text() + " total"; + result.informasi = $("div.content-inner > div").eq(1).text(); + result.informasi_lengkap = "https://www.worldometers.info/coronavirus/country/" + country; + return result; + } catch (error404) { + return "=> Error => " + error404; + } +}; + +module.exports = { + Emojing_, + Corona_ +}; + +/* + * + * @dehan_j1ng + * An Example Api for De-BOTZ + * + */ \ No newline at end of file diff --git a/node_modules/dhn-api/database/quotes.json b/node_modules/dhn-api/database/quotes.json new file mode 100644 index 000000000..481d3d1ba --- /dev/null +++ b/node_modules/dhn-api/database/quotes.json @@ -0,0 +1,1226 @@ +[ + { + "author": "A. France", + "quotes": "Lebih baik mengerti sedikit daripada salah mengerti." + }, + { + "author": "Abraham Lincoln", + "quotes": "Hampir semua pria memang mampu bertahan menghadapi kesulitan. Namun, jika Anda ingin menguji karakter sejati pria, beri dia kekuasaan." + }, + { + "author": "Aeschylus", + "quotes": "Bila tekad seseorang kuat dan teguh, Tuhan akan bergabung dalam usahanya." + }, + { + "author": "Aesop", + "quotes": "Penderitaan adalah pelajaran." + }, + { + "author": "Albert Einstein", + "quotes": "Ilmu pengetahuan tanpa agama adalah pincang." + }, + { + "author": "Albert Einstein", + "quotes": "Hidup itu seperti sebuah sepeda, agar tetap seimbang kita harus tetap bergerak." + }, + { + "author": "Albert Einstein", + "quotes": "Perbedaan masa lalu, sekarang, dan masa depan tak lebih dari ilusi yang keras kepala." + }, + { + "author": "Albert Einstein", + "quotes": "Sebuah meja, sebuah kursi, semangkuk buah, dan sebuah biola; apa lagi yang dibutuhkan agar seseorang bisa merasa bahagia?." + }, + { + "author": "Albert Enstein", + "quotes": "Belas kasihanlah terhadap sesama, bersikap keraslah terhadap diri sendiri." + }, + { + "author": "Alex Osborn", + "quotes": "Cara paling baik untuk menggerakkan diri Anda ialah memberi tugas kepada diri sendiri." + }, + { + "author": "Alexander A. Bogomoletz", + "quotes": "Kita tidak boleh kehilangan semangat. Semangat adalah stimulan terkuat untuk mencintai, berkreasi dan berkeinginan untuk hidup lebih lama." + }, + { + "author": "Alexander Solzhenitsyn", + "quotes": "Manusia akan bahagia selama ia memilih untuk bahagia." + }, + { + "author": "Ali Javan", + "quotes": "Saya tidak berharap menjadi segalanya bagi setiap orang. Saya hanya ingin menjadi sesuatu untuk seseorang." + }, + { + "author": "Ali bin Abi Thalib", + "quotes": "Apabila sempurna akal seseorang, maka sedikit perkataannya." + }, + { + "author": "Ali bin Abi Thalib", + "quotes": "Bahagialah orang yang dapat menjadi tuan untuk dirinya, menjadi kusir untuk nafsunya dan menjadi kapten untuk bahtera hidupnya." + }, + { + "author": "Ali bin Abi Thalib", + "quotes": "Sahabat yang jujur lebih besar harganya daripada harta benda yang diwarisi dari nenek moyang." + }, + { + "author": "Anne M. Lindbergh", + "quotes": "Yang palin melelahkan dalam hidup adalah menjadi orang yang tidak tulus." + }, + { + "author": "Anonim", + "quotes": "Terbuka untuk Anda, begitulah Tuhan memberi kita jalan untuk berusaha. Jangan pernah berfikir jalan sudah tertutup." + }, + { + "author": "Anonim", + "quotes": "Penundaan adalah kuburan dimana peluang dikuburkan." + }, + { + "author": "Antonie De Saint", + "quotes": "Cinta bukan saling menatap mata, namun melihat ke arah yang sama bersama-sama." + }, + { + "author": "Aristoteles", + "quotes": "Kita adalah apa yang kita kerjakan berulang kali. Dengan demikian, kecemerlangan bukan tindakan, tetapi kebiasaan." + }, + { + "author": "Arnold Glasow", + "quotes": "Jangan pernah mencoba menjadikan putra atau putri Anda menjadi seperti Anda. Diri Anda hanya cukup satu saja." + }, + { + "author": "Art Buchwald", + "quotes": "Jika Anda bisa membuat orang lain tertawa, maka Anda akan mendapatkan semua cinta yang Anda inginkan." + }, + { + "author": "Artemus Ward", + "quotes": "Masalah akan datang cepat atau lambat. Jika masalah datang, sambut dengan sebaik mungkin. Semakin ramah Anda menyapanya, semakin cepat ia pergi." + }, + { + "author": "Ashleigh Brilliant", + "quotes": "Kita tak bisa melakukan apapun untuk mengubah masa lalu. Tapi apapun yang kita lakukan bisa mengubah masa depan." + }, + { + "author": "Augustine", + "quotes": "Kesabaran adalah teman dari kebijaksanaan." + }, + { + "author": "Ayn Rand", + "quotes": "Orang-orang kreatif termotivasi oleh keinginan untuk maju, bukan oleh keinginan untuk mengalahkan orang lain." + }, + { + "author": "B. J. Habibie", + "quotes": "Dimanapun engkau berada selalulah menjadi yang terbaik dan berikan yang terbaik dari yang bisa kita berikan." + }, + { + "author": "Balzac", + "quotes": "Kebencian seperti halnya cinta, berkobar karena hal-hal kecil." + }, + { + "author": "Barbara Sher", + "quotes": "Anda tidak perlu harus berhasil pada kali pertama." + }, + { + "author": "Beecher", + "quotes": "Satu jam yang intensif, jauh lebih baik dan menguntungkan daripada bertahun-tahun bermimpi dan merenung-renung." + }, + { + "author": "Benjamin Disraeli", + "quotes": "Hal terbaik yang bisa Anda lakukan untuk orang lain bukanlah membagikan kekayaan Anda, tetapi membantu dia untuk memiliki kekayaannya sendiri." + }, + { + "author": "Bill Clinton", + "quotes": "Tidak ada jaminan keberhasilan, tetapi tidak berusaha adalah jaminan kegagalan." + }, + { + "author": "Bill Cosby", + "quotes": "Aku tidak tahu kunci sukses itu apa, tapi kunci menuju kegagalan adalah mencoba membuat semua orang senang." + }, + { + "author": "Bill Gates", + "quotes": "Konsumen yang paling tidak puas adalah sumber berharga untuk belajar." + }, + { + "author": "Bill Mccartney", + "quotes": "Kita ada disini bukan untuk saling bersaing. Kita ada disini untuk saling melengkapi." + }, + { + "author": "Brian Koslow", + "quotes": "Semakin kita bersedia bertanggung jawab atas perbuatan-perbuatan kita, semakin banyak kredibilitas yang kita miliki." + }, + { + "author": "Browning", + "quotes": "Selalu baik untuk memaafkan, tapi yang paling baik adalah melupakan sebuah kesalahan." + }, + { + "author": "Bruce Lee", + "quotes": "Jangan menjadi pohon kaku yang mudah patah. Jadilah bambu yang mampu bertahan melengkung melawan terpaan angin." + }, + { + "author": "Budha Gautama", + "quotes": "Jangan menangis karena kegagalan cinta, sebab manusia akan meninggalkan semua yang dicintainya." + }, + { + "author": "Bunda Teresa", + "quotes": "Jika Anda mengadili orang lain, Anda tak punya waktu untuk mencintai mereka." + }, + { + "author": "Bunda Teresa", + "quotes": "Jika tidak ada perdamaian, hal itu disebabkan kita telah lupa bahwa kita saling membutuhkan." + }, + { + "author": "Bung Hatta", + "quotes": "Kurang cerdas dapat diperbaiki dengan belajar, kurang cekatan dapat diperbaiki dengan pengalaman, kurang jujur sulit memperbaikinya." + }, + { + "author": "Burn", + "quotes": "Banyak orang sukses berkat banyaknya kesulitan dan kesukaran yang mesti dihadapi." + }, + { + "author": "Carol Burnet", + "quotes": "Hanya aku yang bisa merubah hidupku, tak ada seorang pun yang dapat melakukannya untukku." + }, + { + "author": "Charles Darwin", + "quotes": "Yang bisa bertahan hidup bukan spesies yang paling kuat. Bukan juga spesies yang paling cerdas. Tapi spesies yang paling responsif terhadap perubahan." + }, + { + "author": "Charles R. Swindoll", + "quotes": "Hidup adalah 10 persen yang terjadi kepada Anda, 90 persen bagaimana cara Anda menyikapinya." + }, + { + "author": "Ching Hai", + "quotes": "Memperbaiki diri kita adalah memperbaiki dunia." + }, + { + "author": "Ching Hai", + "quotes": "Jangan membeda-bedakan pekerjaan mana yang baik dan mana yang buruk. Masalah muncul jika kita membeda-bedakan dan memihak sesuatu." + }, + { + "author": "Ching Hai", + "quotes": "Kita bekerja harus tanpa pamrih. Itu berlaku untuk segala pekerjaan. Pengabdian tanpa syarat adalah yang terbaik." + }, + { + "author": "Ching Hai", + "quotes": "Kita harus menemukan kekuatan cinta dalam diri kita terlebih dahulu, barulah kita dapat benar-benar mencintai orang lain." + }, + { + "author": "Ching Hai", + "quotes": "Carilah uang secukupnya saja untuk membiayai kehidupan, agar dapat menyisihkan waktu dan tenaga untuk melatih spiritual." + }, + { + "author": "Christopher Colombus", + "quotes": "Harta benda tak membuat seseorang menjadi kaya raya, mereka hanya membuatnya lebih sibuk." + }, + { + "author": "Cicero", + "quotes": "Hati yang penuh syukur, bukan saja merupakan kebajikan terbesar, melainkan induk dari segala kebajikan yang lain." + }, + { + "author": "Cicero", + "quotes": "Hati yang penuh syukur, bukan saja merupakan kebajikan terbesar, melainkan juga induk dari segala kebajikan yang lain." + }, + { + "author": "Clarence Darrow", + "quotes": "Kebebasan itu berasal dari manusia, tidak dari undang-undang atau institusi." + }, + { + "author": "Confucius", + "quotes": "Hidup ini benar-benar sederhana, tapi kita malah bersikeras membuatnya menjadi rumit." + }, + { + "author": "Confucius", + "quotes": "Kemana pun Anda pergi, pergilah dengan sepenuh hati." + }, + { + "author": "Confucius", + "quotes": "Orang yang melakukan kesalahan dan tidak memperbaiki kesalahannya, melalakukan kesalahan yang lainnya." + }, + { + "author": "Confucius", + "quotes": "Kebanggaan kita yang terbesar bukan karena tidak pernah gagal, tetapi bangkit kembali setiap kita jatuh." + }, + { + "author": "Cowper", + "quotes": "Bunga yang tidak akan pernah layu dibumi adalah kebajikan." + }, + { + "author": "Cynthia Ozick", + "quotes": "Untuk membayangkan hal yang tak dapat dibayangkan, dibutuhkan imajinasi yang luar biasa." + }, + { + "author": "D. J. Schwartz", + "quotes": "Kesulitan apapun tidak tahan terhadap keuletan dan ketekunan. Tanpa keuletan, orang yang paling pintar dan paling berbakat sering gagal dalam hidupnya." + }, + { + "author": "Dale Carnegie", + "quotes": "Satu-satunya cara agar kita memperoleh kasih sayang, adalah jangan menuntut agar kita dicintai, tetapi mulailah memberi kasih sayang kepada orang lain tanpa mengharapkan balasan." + }, + { + "author": "Dale Carnegie", + "quotes": "Bila orang yang kuatir akan kekurangannya mau mensyukuri kekayaan yang mereka miliki, mereka akan berhenti kuatir." + }, + { + "author": "Dale Carnegie", + "quotes": "Usahakan membentuk suatu hubungan \"kawat\" antara otak dan hati Anda." + }, + { + "author": "Dale Carnegie", + "quotes": "Senyuman akan membuat kaya jiwa seseorang yang menerimanya, tanpa membuat miskin seseorang yang memberikannya." + }, + { + "author": "Dale Carnegie", + "quotes": "Orang jarang sukses kecuali jika mereka senang dengan apa yang dikerjakannya." + }, + { + "author": "David Livingston", + "quotes": "Saya akan pergi kemanapun selama itu arahnya ke depan." + }, + { + "author": "David V. Ambrose", + "quotes": "Jika Anda punya kemauan untuk menang, Anda sudah mencapai separuh sukses. Jika Anda tidak punya kemauan untuk menang, Anda sudah mencapai separuh kegagalan." + }, + { + "author": "David Weinbaum", + "quotes": "Rahasia menuju hidup kaya adalah mempunyai lebih banyak awal ketimbang akhir." + }, + { + "author": "Desbarolles", + "quotes": "Kebenaran yang tidak dimengerti akan menjadi kesalahan." + }, + { + "author": "Descrates", + "quotes": "Saya berpikir, karena itu saya ada." + }, + { + "author": "Djamaludin Abassy", + "quotes": "Mental yang lemah lebih parah dari fisik yang lemah." + }, + { + "author": "Donald Kendall", + "quotes": "Satu-satunya sukses yang diraih sebelum bekerja hanyalah ada di kamus saja." + }, + { + "author": "Dr. Frank Crane", + "quotes": "Sahabat terbaik dan musuh terburuk kita adalah pikiran-pikiran kita. Pikiran dapat lebih baik dari seorang dokter atau seorang bankir atau seorang teman kepercayaan. Juga dapat lebih berbahaya dadi penjahat." + }, + { + "author": "Dr. Ronald Niednagel", + "quotes": "Pergilah sejauh Anda bisa memandang, dan ketika Anda tiba disana, Anda akan memandang lebih jauh." + }, + { + "author": "Dr.\u00a0Johnnetta Cole", + "quotes": "Jika kamu ingin pergi cepat, pergilah sendiri. Jika kamu ingin pergi jauh, pergilah bersama-sama." + }, + { + "author": "Dwigt D. Esenhower", + "quotes": "Seorang intelektual tidak akan pernah mengatakan lebih daripada apa yang diketahuinya." + }, + { + "author": "Earl Campbell", + "quotes": "Persoalan-persoalan adalah harga yang Anda bayar untuk kemajuan." + }, + { + "author": "Earl Campbell", + "quotes": "Persoalan-persoalan adalah harga yang harus Anda bayar untuk kemajuan." + }, + { + "author": "Edgar Alnsel", + "quotes": "Hidup manusia penuh dengan bahaya, tetapi disitulah letak daya tariknya." + }, + { + "author": "Edmund Burke", + "quotes": "Anda tidak dapat merencanakan masa yang akan datang berdasarkan masa lalu." + }, + { + "author": "Edward L. Curtis", + "quotes": "Optimisme yang tidak disertai dengan usaha hanya merupakan pemikiran semata yang tidak menghasilkan buah." + }, + { + "author": "Edward de Bono", + "quotes": "Jika Anda termasuk orang yang senang menunggu datangnya peluang, Anda adalah bagian dari manusia pada umumnya." + }, + { + "author": "Edy Murphy", + "quotes": "Aku menghabiskan usia 30-an untuk memperbaiki segala kesalahanku di usia 20-an." + }, + { + "author": "Einstein", + "quotes": "Berusaha untuk tidak menjadi manusia yang berhasil tapi berusahalah menjadi manusia yang berguna." + }, + { + "author": "Eisenhower", + "quotes": "Mulai sekarang kita tidak usah membuang-buang waktu barang semenit pun untuk memikirkan orang-orang yang tidak kita sukai." + }, + { + "author": "Elanor Roosevelt", + "quotes": "Ketika kita berhenti membuat kontribusi, kita mulai mati." + }, + { + "author": "Elbert Hubbad", + "quotes": "Kesalahan terbesar yang dibuat manusia dalam kehidupannya adalah terus-menerus merasa takut bahwa mereka akan melakukan kesalahan." + }, + { + "author": "Elizabeth Browning", + "quotes": "Janganlah menyebut orang tidak bahagia sebelum dia mati. Jangan menilai pekerjaan seseorang sebelum pekerjaannya berakhir." + }, + { + "author": "Emerson", + "quotes": "Percaya pada diri sendiri adalah rahasia utama mencapai sukses." + }, + { + "author": "Engelbert Huperdinck", + "quotes": "Anda harus waspada dengan kesenangan. Pastikan bahwa Anda menikmatinya dan bukan dikendalikannya." + }, + { + "author": "Erich Watson", + "quotes": "Kehilangan kekayaan masih dapat dicari kembali, kehilangan kepercayaan sulit didapatkan kembali." + }, + { + "author": "Francois De La Roche", + "quotes": "Bila tidak mampu menemukan kedamaian dalam diri sendiri, tak ada gunanya mencari di tempat lain." + }, + { + "author": "Francois De La Roche", + "quotes": "Kita terbiasa menyembunyikan diri dari orang lain, sampai akhirnya kita sendiri tersembunyi dari diri kita." + }, + { + "author": "Francois Roche", + "quotes": "Kita lebih sibuk menyakinkan orang lain bahwa kita bahagia ketimbang benar-benar merasakan bahagia itu sendiri." + }, + { + "author": "Frank Crane", + "quotes": "Anda mungkin ditipu jika terlalu mempercayai, tetapi hidup Anda akan tersiksa jika tidak cukup mempercayai." + }, + { + "author": "Frank Giblin", + "quotes": "Jadilah diri Anda sendiri. Siapa lagi yang bisa melakukannya lebih baik ketimbang diri Anda sendiri?." + }, + { + "author": "Franklin", + "quotes": "Bila Anda ingin dicintai, cintailah dan bersikaplah sebagai orang yang patut dicintai." + }, + { + "author": "Fuller", + "quotes": "Contoh yang baik adalah nasihat terbaik." + }, + { + "author": "Galileo Galilei", + "quotes": "Rumput yang paling kuat tumbuhnya terdapat di atas tanah yang paling keras." + }, + { + "author": "Galileo Galilei", + "quotes": "Kamu tidak dapat mengajari seseorang apa pun, kamu hanya bisa membantunyanya menemukan apa yang ada dalam dirinya sendiri." + }, + { + "author": "Gandhi", + "quotes": "Mereka yang berjiwa lemah tak akan mampu memberi seuntai maaf tulus. Pemaaf sejati hanya melekat bagi mereka yang berjiwa tangguh." + }, + { + "author": "Gandhi", + "quotes": "Kebahagiaan tergantung pada apa yang dapat Anda berikan, bukan pada apa yang Anda peroleh." + }, + { + "author": "Gen Collin Powel", + "quotes": "Tak ada rahasia untuk menggapai sukses. Sukses itu dapat terjadi karena persiapan, kerja keras dan mau belajar dari kegagalan." + }, + { + "author": "George B. Shaw", + "quotes": "Hidup bukanlah tentang menemukan dirimu sendiri. Hidup adalah tentang menciptakan dirimu sendiri." + }, + { + "author": "George III", + "quotes": "Saya lebih baik kehilangan mahkota daripada melakukan tindakan yang menurut saya memalukan." + }, + { + "author": "George Santayana", + "quotes": "Tidak ada obat untuk kelahiran dan kematian, kecuali menikmati yang ada di antara keduanya." + }, + { + "author": "George W.", + "quotes": "Harapan tak pernah meninggalkan kita, kita yang meninggalkan harapan." + }, + { + "author": "Gilbert Chesterton", + "quotes": "Agar bisa menjadi cukup cerdas untuk meraih semua uang yang diinginkan, kita harus cukup bodoh untuk menginginkannya." + }, + { + "author": "Gothe", + "quotes": "Semua pengetahuan yang kumiliki bisa orang lain peroleh, tapi hatiku hanyalah untuk diriku sendiri." + }, + { + "author": "H. N. Spieghel", + "quotes": "Betapapun tingginya burung terbang, toh dia harus mencari dan mendapatkan makanannya di bumi juga." + }, + { + "author": "H.L Hunt", + "quotes": "Tetapkan apa yang Anda inginkan. Putuskan Anda ingin menukarnya dengan apa. Tentukan prioritas dan laksanakan." + }, + { + "author": "Hal Borland", + "quotes": "Melihat pohon, saya jadi mengerti tentang kesabaran. Memandang rumput, saya jadi menghargai ketekunan." + }, + { + "author": "Hamka", + "quotes": "Kecantikan yang abadi terletak pada keelokan adab dan ketinggian ilmu seseorang, bukan terletak pada wajah dan pakaiannya." + }, + { + "author": "Hamka", + "quotes": "Kita harus yakin bahwa apa yang ditentukan oleh Tuhan untuk kita, itulah yang terbaik." + }, + { + "author": "Hamka", + "quotes": "Berani menegakkan keadilan, walaupun mengenai diri sendiri, adalah puncak segala keberanian." + }, + { + "author": "Hamka", + "quotes": "Hawa nafsu membawa kesesatan dan tidak berpedoman. Sementara akal menjadi pedoman menuju keutamaan. Hawa nafsu menyuruhmu berangan-angan, tetapi akal menyuruhmu menimbang." + }, + { + "author": "Harriet Braiker", + "quotes": "Berusaha berhasil untuk memotivasi dirimu, tapi berusaha untuk selalu sempurna akan membuat tertekan." + }, + { + "author": "Helen Keller", + "quotes": "Kita tidak akan belajar berani dan sabar jika di dunia ini hanya ada kegembiraan." + }, + { + "author": "Henri Ford", + "quotes": "Kegagalan hanyalah kesempatan untuk memulai lagi dengan lebih pandai." + }, + { + "author": "Henry David Thoreau", + "quotes": "Kebaikan adalah satu-satunya investasi yang tidak akan merugikan." + }, + { + "author": "Henry Ford", + "quotes": "Idealis adalah orang yang membantu orang lain untuk makmur." + }, + { + "author": "Henry Ford", + "quotes": "Berpikir itu adalah pekerjaan yang berat di antara segala jenis pekerjaan. Itulah sebabnya sedikit sekali orang yang senang melakukannya." + }, + { + "author": "Henry Ford", + "quotes": "Persaingan yang tujuannya hanya untuk bersaing, untuk mengalahkan orang lain, tak pernah mendatangkan banyak manfaat." + }, + { + "author": "Henry Longfellow", + "quotes": "Kehidupan orang-orang besar mengingatkan kita bahwa kita bisa membuat kehidupan kita luhur." + }, + { + "author": "Henry Thoreau", + "quotes": "Hidupku menjadi hiburanku dan tak hentinya memberikan kejutan. Hidupku bagaikan drama dengan begitu banyak babak tanpa adegan penutup." + }, + { + "author": "Hubert Humprey", + "quotes": "Apa yang Anda lihat adalah apa yang Anda capai." + }, + { + "author": "Imam Al-Ghazali", + "quotes": "Kebahagiaan terletak pada kemenangan memerangi hawa nafsu dan menahan keinginan yang berlebih-lebihan." + }, + { + "author": "Imam Ghazali", + "quotes": "Caci maki dari seorang penjahat merupakan kehormatan bagi seorang yang jujur." + }, + { + "author": "J.C.F von Schiller", + "quotes": "Orang yang terlalu banyak merenung akan meraih sedikit." + }, + { + "author": "Jack Hyles", + "quotes": "Jangan gunakan orang-orang untuk membangun pekerjaan besar, gunakan pekerjaan Anda untuk membangun orang-orang besar." + }, + { + "author": "Jackson Brown", + "quotes": "Kesalahaan terbesar yang mungkin Anda buat adalah mempercayai bahwa Anda bekerja untuk orang lain." + }, + { + "author": "Jacques Audiberti", + "quotes": "Kepengecutan yang paling besar adalah ketika kita membuktikan kekuatan kita kepada kelemanan orang lain." + }, + { + "author": "James Thurber", + "quotes": "Jangan lihat masa lalu dengan penyesalan, jangan pula lihat masa depan dengan ketakutan, tapi lihatlah sekitar Anda dengan penuh kesadaran." + }, + { + "author": "Janet Erskine", + "quotes": "Jangan menunggu keadaan yang ideal. Jangan juga menunggu peluang-peluang terbaik. Keduanya tak akan pernah datang." + }, + { + "author": "Jeff Goins", + "quotes": "Kebanyakan orang sukses yang saya kenal bukan orang yang sibuk, mereka orang yang focus." + }, + { + "author": "Jerry West", + "quotes": "Anda tidak dapat melakukan banyak hal di hidup Anda, jika Anda hanya bekerja di hari-hari yang Anda rasakan baik." + }, + { + "author": "Jim Rohn", + "quotes": "Tembok yang kita bangun untuk menghambat kesedihan, juga membuat kita tertutup dari kebahagiaan." + }, + { + "author": "Jim Rohn", + "quotes": "Jika Anda tidak merancang hidup Anda sendiri, kemungkinan Anda akan menjalani rencana orang lain. Apa yang mereka rencanakan untuk Anda? Tidak banyak." + }, + { + "author": "Jim Ryan", + "quotes": "Motivasi adalah sesuatu yang membuat Anda memulai. Kebiasaan adalah sesuatu yang membuat Anda melanjutkan." + }, + { + "author": "Jimi Hendrix", + "quotes": "Ketika kekuatan akan cinta melebihi kecintaan akan kekuasaan, maka dunia pun menemukan kedamaian." + }, + { + "author": "Jimmy Dean", + "quotes": "Aku tak bisa merubah arah angin, tapi aku bisa menyesuaikan layarku untuk tetap bisa mencapai tujuanku." + }, + { + "author": "Joan Baez", + "quotes": "Kita tak bisa memilih bagaimana kita meninggal atau kapan. Kita hanya bisa memutuskan bagaimana kita hidup. Sekarang." + }, + { + "author": "John B. Gough", + "quotes": "Jika Anda ingin sukses, Anda harus menciptakan peluang untuk diri sendiri." + }, + { + "author": "John C. Maxwell", + "quotes": "Bekerja keras sekarang, merasakan hasilnya nanti; bermalas-malasan sekarang, merasakan akibatnya nanti." + }, + { + "author": "John C. Maxwell", + "quotes": "Untuk menangani diri Anda sendiri, gunakan kepala Anda. Untuk menangani orang lain, gunakan hati Anda." + }, + { + "author": "John C. Maxwell", + "quotes": "Bekerja keras sekarang, merasakannya nanti. Bermalas-malas sekarang, merasakan akibatnya nanti." + }, + { + "author": "John Craig", + "quotes": "Tidak peduli seberapa banyak yang dapat Anda lakukan, tidak peduli seberapa menarik hati kepribadian Anda, Anda tidak dapat melangkah jauh jika Anda tidak dapat bekerja bersama orang lain." + }, + { + "author": "John D. Rockefeller", + "quotes": "Orang termiskin adalah orang yang tidak mempunyai apa-apa kecuali uang." + }, + { + "author": "John Gardne", + "quotes": "Jika kita melayani, maka hidup akan lebih berarti." + }, + { + "author": "John Gray", + "quotes": "Sebenarnya semua kesulitan merupakan kesempatan bagi jiwa yang tumbuh." + }, + { + "author": "John Manson", + "quotes": "Anda dilahirkan orisinal, jadi tidak perlu setengah mati meniru orang lain." + }, + { + "author": "John Maxwell", + "quotes": "Seberapa jauh Anda gagal, tidak masalah, tetapi yang penting seberapa sering Anda bangkit kembali." + }, + { + "author": "John Q. Adams", + "quotes": "Jika tindakan-tindakan Anda mengilhami orang lain untuk bermimpi lebih, belajar lebih, bekerja lebih, dan menjadi lebih baik, Anda adalah seorang pemimpin." + }, + { + "author": "John Ruskin", + "quotes": "Saya yakin, ujian pertama bagi orang besar ialah kerendahan hati." + }, + { + "author": "John Ruskin", + "quotes": "Penghargaan tertinggi untuk kerja keras seseorang bukanlah apa yang ia hasilkan, tapi bagaimana ia berkembang karenanya." + }, + { + "author": "John Ruskin", + "quotes": "Penghargaan tertinggi untuk kerja keras seseorang bukanlah apa yang ia hasilkan, tetapi bagaimana ia berkembang karenanya." + }, + { + "author": "John Wolfgang", + "quotes": "Perbuatan-perbuatan salah adalah biasa bagi manusia, tetapi perbuatan pura-pura itulah sebenarnya yang menimbulkan permusuhan dan pengkhianatan." + }, + { + "author": "Joseph Addison", + "quotes": "Rahmat sering datang kepada kita dalam bentuk kesakitan, kehilangan dan kekecewaan; tetapi kalau kita sabar, kita segera akan melihat bentuk aslinya." + }, + { + "author": "Julia Roberts", + "quotes": "Cinta sejati tidak datang kepadamu, tetapi harus datang dari dalam dirimu." + }, + { + "author": "Junius", + "quotes": "Integritas seseorang diukur dengan tingkah lakunya bukan profesinya." + }, + { + "author": "Kahlil Gibran", + "quotes": "Kita berdoa kalau kesusahan dan membutuhkan sesuatu, mestinya kita juga berdoa dalam kegembiraan besar dan saat rezeki melimpah." + }, + { + "author": "Kahlil Gibran", + "quotes": "Untuk memahami hati dan pikiran seseorang, jangan lihat apa yang sudah dia capai, tapi lihat apa yang dia cita-citakan." + }, + { + "author": "Keri Russel", + "quotes": "Kadang kala, justru keputusan kecil yang akan mampu merubah hidup kita selamanya." + }, + { + "author": "Knute Rockne", + "quotes": "Apabila perjalanan menjadi sulit, orang ulet akan berjalan terus." + }, + { + "author": "Kong Hu Cu", + "quotes": "Orang yang berbudi tinggi selalu berpedoman pada keadilan dan selalu berusaha menjalankan kewajiban." + }, + { + "author": "Konrad Adenauer", + "quotes": "Kita semua hidup di bawah langit yang sama, tetapi tidak semua orang punya cakrawala yang sama." + }, + { + "author": "Kung Fu-Tze", + "quotes": "Ia yang bijak akan merasa malu, jika kata-katanya lebih baik daripada tindakannya." + }, + { + "author": "Lao Tzu", + "quotes": "Saat sadar bahwa kau tidak kekurangan suatu apa pun, seisi dunia menjadi milikku." + }, + { + "author": "Lao Tzu", + "quotes": "Saat sadar bahwa kau tidak kekurangan suatu apa pun, seisi dunia menjadi milikmu." + }, + { + "author": "Les Brown", + "quotes": "Terima tanggung jawab untuk diri Anda sendiri. Sadari bahwa hanya Anda sendiri, bukan orang lain, yang bisa membuat Anda pergi ke tempat yang Anda inginkan." + }, + { + "author": "Louis Gittner", + "quotes": "Meski yang kita hadapi adalah jalan buntu, namun cinta akan membangun jalan layang di atasnya." + }, + { + "author": "Louis Pasteur", + "quotes": "Tahukah Anda rahasia sukses saya dalam mencapai tujuan? Cuma keuletan, tak lebih dan tak kurang." + }, + { + "author": "Mahatma Gandhi", + "quotes": "Kepuasan terletak pada usaha, bukan pada hasil. Berusaha dengan keras adalah kemenangan yang hakiki." + }, + { + "author": "Marcel Ayme", + "quotes": "Kerendahan hati merupakan ruang tunggu bagi kesempurnaan." + }, + { + "author": "Maria Sharapova", + "quotes": "Saya belajar banyak dari kekalahan. Dan kekalahan-kekalahan itu, membuat saya semakin tabah." + }, + { + "author": "Mark Cuban", + "quotes": "Buatlah usaha Anda berhasil dengan satu-satunya cara: kerja keras!." + }, + { + "author": "Mark Twain", + "quotes": "Kebaikan adalah bahasa yang dapat didengar si tuli dan bisa dilihat si buta." + }, + { + "author": "Marsha Sinetar", + "quotes": "Lakukan apa yang Anda senangi, uang akan mengikuti." + }, + { + "author": "Martin Luther King", + "quotes": "Tak ada waktu yang tidak tepat untuk melakukan sesuatu yang benar." + }, + { + "author": "Mary McCarthy", + "quotes": "Kendatipun Anda berada di jalur yang tepat, Anda akan tetap terkejar jika hanya duduk-duduk saja disana." + }, + { + "author": "Maxim Gorky", + "quotes": "Kebahagiaan selalu tampak kecil saat berada dalam genggaman. Tapi coba lepaskan dan Anda akan langsung tahu, betapa besar dan berhargannya kebahagiaan." + }, + { + "author": "Mery Hemingway", + "quotes": "Latih diri Anda untuk tidak khawatir. Kekhawatiran tak pernah memperbaiki apa-apa." + }, + { + "author": "Michael Drury", + "quotes": "Kematangan bukanlah suatu keadaan yang dicapai dengan usia. Dia merupakan perkembangan dari cinta, belajar, membaca dan berpikir hingga menghasilkan kemampuan." + }, + { + "author": "Michael Pritchard", + "quotes": "Anda berhenti tertawa bukan karena bertambah tua. Sebaliknya Anda bertambah tua justru karena berhenti tertawa." + }, + { + "author": "Miguel de Cervantes", + "quotes": "Pepatah adalah kalimat singkat berdasarkan pengalaman panjang." + }, + { + "author": "Miguel de Unamuno", + "quotes": "Tidak dicintai orang lain memang menyedihkan, tapi lebih menyedihkan lagi kalau tidak bisa mencintai orang lain." + }, + { + "author": "N. H. Casson", + "quotes": "Kemiskinan jiwa lebih mengerikan daripada kemiskinan jasmani atau materi." + }, + { + "author": "Natalie Portman", + "quotes": "Anda belum bisa dibilang kaya sampai Anda memiliki sesuatu yang tidak dapat dibeli uang." + }, + { + "author": "Nelson Mandela", + "quotes": "Pendidikan adalah senjata paling ampuh dimana kau dapat menggunakannya untuk merubah dunia." + }, + { + "author": "Norman Peale", + "quotes": "Campakanlah jauh-jauh pikiran murung dan kesal itu, lalu bangkitkanlah." + }, + { + "author": "Nunse", + "quotes": "Bukanlah yang kuat, tetapi yang uletlah yang menjadikan mereka manusia yang besar." + }, + { + "author": "O. S. Marden", + "quotes": "Kemajuan adalah hasil dari memusatkan seluruh kekuatan jiwa dan pikiran pada cita-cita yang dituju." + }, + { + "author": "Oliver W. Holmes", + "quotes": "Semakin lama kita hidup, semakin kita menemukan bahwa kita mirip dengan orang lain." + }, + { + "author": "Oprah Winfrey", + "quotes": "Melakukan yang terbaik pada saat ini akan menempatkan Anda ke tempat terbaik pada saat berikutnya." + }, + { + "author": "Oscar Wilde", + "quotes": "Jika seseorang menyatakan kebenaran, dia yakin; cepat atau lambat; akan mendapatkannya." + }, + { + "author": "Pablo Picasso", + "quotes": "Bila semangat Anda menurun, lakukanlah sesuatu. Kalau Anda telah melakukan sesuatu keadaan tidak berubah, lakukanlah sesuatu yang berbeda." + }, + { + "author": "Paul Galvin", + "quotes": "Jangan takut dengan kesalahan. Kebijaksanaan biasanya lahir dari kesalahan." + }, + { + "author": "Paul Harvey", + "quotes": "Saya tidak pernah melihat suatu monumen didirikan bagi orang pesimis." + }, + { + "author": "Pepatah Cina", + "quotes": "Beranilah menyadari kesalahan dan mulai lagi." + }, + { + "author": "Pepatah Cina", + "quotes": "Benar jadi berani." + }, + { + "author": "Pepatah Cina", + "quotes": "Orang yang bertanya, bodoh dalam 5 menit. Dan orang yang tidak bertanya akan tetap bodoh untuk selamanya." + }, + { + "author": "Pepatah Cina", + "quotes": "Bila saya mendengar, saya akan lupa. Setelah melihat saya bisa mengerti. Dan setelah mengerjakan, barulah saya bisa memahami." + }, + { + "author": "Pepatah Cina", + "quotes": "Orang yang tersenyum selalu lebih kuat dari orang yang marah." + }, + { + "author": "Pepatah Cina", + "quotes": "Orang yang memindahkan gunung memulai dengan memindahkan batu-batu kecil." + }, + { + "author": "Pepatah Inggris", + "quotes": "Orang yang mencari masalah akan selalu mendapatkannya." + }, + { + "author": "Pepatah Inggriss", + "quotes": "Keterampilan dan keyakinan merupakan pasukan bersenjata yang tidak dapat dikalahkan." + }, + { + "author": "Pepatah Jepang", + "quotes": "Sebatang anak panah mudah dipatahkan, tetapi tidak demikian dengan sepuluh anak panah yang disatukan." + }, + { + "author": "Pepatah Jepang", + "quotes": "Visi tanpa aksi adalah mimpi di siang bolong. Aksi tanpa visi adalah mimpi buruk." + }, + { + "author": "Pepatah Jerman", + "quotes": "Orang yang tak pernah mencicipi pahit tak akan tahu apa itu manis." + }, + { + "author": "Pepatah Latin", + "quotes": "Dengan belajar Anda bisa mengajar. Dengan mengajar, Anda belajar." + }, + { + "author": "Pepatah Persia", + "quotes": "Saya menangis karena tak punya sepatu, sampai saya melihat orang tak punya kaki." + }, + { + "author": "Pepatah Roma", + "quotes": "Kesengsaraan menghasilkan ketekunan. Ketekunan menghasilkan watak, dan watak menghasilkan harapan." + }, + { + "author": "Pepatah Skotlandia", + "quotes": "Bila kemauan siap, kaki menjadi ringan." + }, + { + "author": "Pepatah Spanyol", + "quotes": "Mengenal diri sendiri adalah awal dari perbaikan diri." + }, + { + "author": "Pepatah Tibet", + "quotes": "Jangan meremehkan raja yang picik, seperti halnya jangan meremehkan sungai yang kecil." + }, + { + "author": "Pepatah Tibet", + "quotes": "Apabila seseorang mengajarkan sesuatu, dia sendiri harus melaksanakan ajaran itu." + }, + { + "author": "Peter Sinclair", + "quotes": "Kehidupan yang hebat adalah kulminasi dari pemikiran-pemikiran hebat disertai dengan tindakan-tindakan hebat." + }, + { + "author": "Phyllis Bottome", + "quotes": "Ada dua cara mengatasi kesulitan, Anda mengubah kesulitan-kesulitan atau Anda mengubah diri sendiri untuk mengatasinya." + }, + { + "author": "Plato", + "quotes": "Orang bijak berbicara karena mereka mempunyai sesuatu untuk dikatakan, orang bodoh berbicara karena mereka ingin mengatakan sesuatu." + }, + { + "author": "Plato", + "quotes": "Orang bijak berbicara karena ia memiliki sesuatu untuk dikatakan. Orang bodoh berbicara karena ia atau dia harus mengatakan sesuatu." + }, + { + "author": "Plato", + "quotes": "Berbuat tidak adil lebih memalukan daripada menderita ketidakadilan." + }, + { + "author": "Plato", + "quotes": "Siapa yang tidak bisa memimpin dirinya sendiri, tidak akan bisa memimpin orang." + }, + { + "author": "Plautus", + "quotes": "Kesabaran adalah obat terbaik untuk semua masalah." + }, + { + "author": "Plautus", + "quotes": "Jauh lebih mudah memulai secara baik daripada mengakhiri secara baik." + }, + { + "author": "Pliny The Elder", + "quotes": "Harapan adalah tiang yang menyangga dunia." + }, + { + "author": "R. A. Kartini", + "quotes": "Kemenangan gemilang tidak diperoleh dari medan pertempuran saja, tetapi sering diperoleh dari hati." + }, + { + "author": "R. Browning", + "quotes": "kita jatuh untuk bangun, berhenti untuk berjalan, dan tidur untuk bangun." + }, + { + "author": "R. W. Shephred", + "quotes": "Kamu harus menghadapi depresi, sama seperti kamu menghadapi seekor harimau." + }, + { + "author": "R.H. Grant", + "quotes": "Jika Anda mempekerjakan orang-orang yang lebih pintar dari Anda, Anda membuktikan Anda lebih pintar dari mereka." + }, + { + "author": "Rabbi Schachtel", + "quotes": "Kebahagiaan bukanlah memiliki apa yang kita inginkan, melainkan menginginkan apa yang kita miliki." + }, + { + "author": "Ralph W. Emerson", + "quotes": "Satu ons aksi jauh lebih berharga daripada satu ton teori." + }, + { + "author": "Ralph W. Emerson", + "quotes": "Seseorang itu sukses besar jika dia sadar, kegagalan-kegagalannya adalah persiapan untuk kemenangan-kemenangannya." + }, + { + "author": "Ralph Waldo Emerson", + "quotes": "Kedamaian tidak terdapat di dunia luar, melainkan terdapat dalam jiwa manusia itu sendiri." + }, + { + "author": "Ralph Waldo Emerson", + "quotes": "Percayalah kepada orang lain, dan mereka akan tulus kepada Anda. Perlakukan mereka seperti orang besar dan mereka akan memperlihatkan dirinya sebagai orang besar." + }, + { + "author": "Rene Descartes", + "quotes": "Tidak cukup hanya punya otak yang baik. Yang penting adalah menggunakannya secara baik." + }, + { + "author": "Richard Bach", + "quotes": "Tanyakan pada diri sendiri rahasia sukses. Dengarkan jawaban Anda, dan lakukan." + }, + { + "author": "Richard C. Miller", + "quotes": "Jika rumput tetangga lebih hijau, bersyukurlah Anda masih bisa berpijak di tanah untuk melihatnya." + }, + { + "author": "Robert Collier", + "quotes": "Kesempatan Anda untuk sukses di setiap kondisi selalu dapat diukur oleh seberapa besar kepercayaan Anda pada diri sendiri." + }, + { + "author": "Robert F. Kennedy", + "quotes": "Kemajuan merupakan kata-kata merdu, tetapi perubahanlah penggerakknya dan perubahan mempunyai banyak musuh." + }, + { + "author": "Robert Frost", + "quotes": "Dua jalan dipisahkan pohon, dan saya mengambil jalan yang jarang ditempuh orang. Dan itulah yang membuat perubahan." + }, + { + "author": "Robert Frost", + "quotes": "Alasan mengapa kecemasan membunuh lebih banyak orang dibanding kerja adalah, lebih banyak orang cemas dibanding bekerja." + }, + { + "author": "Robert G. Ingersoll", + "quotes": "Sedikit orang kaya yang memiliki harta. Kebanyakan harta yang memiliki mereka." + }, + { + "author": "Robert Half", + "quotes": "Ketekunan bisa membuat yang tidak mungkin jadi mungkin, membuat kemungkinan jadi kemungkinan besar, dan kemungkinan besar menjadi pasti." + }, + { + "author": "Robert S. Lynd", + "quotes": "Hanya ikan yang bodoh yang bisa dua kali kena pancing dengan umpan yang sama." + }, + { + "author": "Robert Von Hartman", + "quotes": "Ambisi seperti air laut, semakin banyak orang meminumnya semakin orang menjadi haus." + }, + { + "author": "Robinsori", + "quotes": "Cemas dan ketakutan adalah akibat kebodohan dan keraguan." + }, + { + "author": "Romand Rolland", + "quotes": "Pahlawan adalah seseorang yang melakukan apa yang mampu dia lakukan." + }, + { + "author": "Roosevelt", + "quotes": "Jika Anda ingin menjadi orang besar, janganlah suka beromong besar, kerjakanlah hal-hal yang kecil dahulu." + }, + { + "author": "Ross Cooper", + "quotes": "Satu-satunya cara untuk mengubah hidup kita adalah dengan mengubah pikiran kita." + }, + { + "author": "Ruth P. Freedman", + "quotes": "Perubahan terjadi ketika seseorang menjadi dirinya sendiri, bukan ketika ia mencoba menjadi orang lain." + }, + { + "author": "Salanter Lipkin", + "quotes": "Perbaiki diri Anda, tetapi jangan jatuhkan orang lain." + }, + { + "author": "Samuel Smiles", + "quotes": "Cara tercepat untuk menuntaskan banyak hal adalah dengan menyelesaikannya satu demi satu." + }, + { + "author": "Satya Sai Baba", + "quotes": "Dua hal yang harus dilupakan, kebaikan yang telah kita lakukan kepada orang lain dan kesalahan orang lain kepada kita." + }, + { + "author": "Scott Fitzgerald", + "quotes": "Ingatlah, jika Anda menutup mulut sebenarnya Anda telah melakukan pilihan." + }, + { + "author": "Seneca", + "quotes": "Hati manusia tidak akan pernah tenteram sebelum berdamai dengan diri sendiri." + }, + { + "author": "Seneca", + "quotes": "Hidup berarti berjuang. Hidup nikmat tanpa badai topan adalah laksana laut yang mati." + }, + { + "author": "Shackespeare", + "quotes": "Kesedihan hanya bisa ditanggulangi oleh orang yang mengalaminya sendiri." + }, + { + "author": "Shirley Briggs", + "quotes": "Beranikan diri untuk menjadi dirimu sendiri, karena kita bisa melakukan hal itu lebih baik daripada orang lain." + }, + { + "author": "Soe Hok Gie", + "quotes": "Lebih baik diasingkan daripada menyerah kepada kemunafikan." + }, + { + "author": "Soemantri Metodipuro", + "quotes": "Langkah pertama untuk memilih keyakinan pada diri sendiri adalah mengenal diri kita sendiri." + }, + { + "author": "Sophocles", + "quotes": "Bila seseorang kehilangan segala sumber kebahagiaan, dia tidak lagi hidup, tapi mayat yang bernafas." + }, + { + "author": "St. Jerome", + "quotes": "Baik, lebih baik, terbaik. Jangan pernah berhenti sampai baik menjadi lebih baik, dan lebih baik menjadi terbaik." + }, + { + "author": "Stephen R. Covey", + "quotes": "Motivasi adalah api dari dalam. Jika orang lain mencoba menyalakannya untuk Anda, kemungkinan apinya hanya menyala sebentar." + }, + { + "author": "Steve Jobs", + "quotes": "Saya bangga, baik pada hal yang tidak kami lakukan maupun pada hal yang kami lakukan." + }, + { + "author": "Sujiwo Tejo", + "quotes": "Cinta tak perlu pengorbanan. Pada saat kau merasa berkorban, pada saat itu cintamu mulai pudar." + }, + { + "author": "Sydney Harris", + "quotes": "Ancaman nyata sebenarnya bukan pada saat komputer mulai bisa berpikir seperti manusia, tetapi ketika manusia mulai berpikir seperti komputer." + }, + { + "author": "Theodore Rosevelt", + "quotes": "Lakukan apa yang dapat Anda lakukan dengan apa yang Anda miliki dan tempat Anda berada." + }, + { + "author": "Thomas Alva Edison", + "quotes": "Banyak kegagalan dalam ini dikarenakan orang-orang tidak menyadari betapa dekatnya mereka dengan keberhasilan saat mereka menyerah." + }, + { + "author": "Thomas Carlyle", + "quotes": "Pergilah sejauh mungkin yang bisa Anda lihat dan Anda akan bisa melihat lebih jauh." + }, + { + "author": "Thomas Fuller", + "quotes": "Orang yang tidak bisa memaafkan orang lain sama saja dengan orang yang memutuskan jembatan yang harus dilaluinya, karena semua orang perlu dimaafkan." + }, + { + "author": "Thomas Fuller", + "quotes": "Menyaksikan adalah mempercayai, tapi merasakan adalah kebenaran." + }, + { + "author": "Thomas Jefferson", + "quotes": "Dalam hal prinsip, usahakan kukuh seperti batu karang. Dalam hal selera, coba berenang mengikuti arus." + }, + { + "author": "Tung Desem Waringin", + "quotes": "Setiap badai pasti berlalu dan saya akan tumbuh semakin kuat." + }, + { + "author": "Tyler Durden", + "quotes": "Setelah kehilangan segalanya, barulah kita bebas melakukan apa saja." + }, + { + "author": "Umar bin Khattab", + "quotes": "Raihlah ilmu dan untuk meraih ilmu belajarlah untuk tenang dan sabar." + }, + { + "author": "Vicosta Efran", + "quotes": "Hiduplah seperti lilin yang menerangi orang lain. Jangan hidup seperti duri yang mencucuk diri dan menyakiti orang lain." + }, + { + "author": "Victor Hugo", + "quotes": "Kesedihan adalah buah. Tuhan tak pernah membiarkannya tumbuh dicabang yang terlalu lemah untuk menanggungnya." + }, + { + "author": "Victor Hugo", + "quotes": "Kebahagian tertinggi dalam kehidupan adalah kepastian bahwa Anda dicintai apa adanya, atau lebih tepatnya dicintai walaupun Anda seperti diri Anda adanya." + }, + { + "author": "Victor Hugo", + "quotes": "Masalahnya bukan kurangnya tenaga, tetapi kurangnya daya kemauan." + }, + { + "author": "Vince Lambardi", + "quotes": "Kemenangan bukanlah segala-galanya, tetapi perjuangan untuk menang adalah segala-galanya." + }, + { + "author": "Virginia Wolf", + "quotes": "Jika Anda tak bisa mengatakan hal yang benar dari diri Anda, maka Anda pun tak bisa mengatakan hal yang benar dari orang lain." + }, + { + "author": "W. Camden", + "quotes": "Burung yang terbang pagi akan memperoleh cacing paling banyak." + }, + { + "author": "Walt Disney", + "quotes": "Cara untuk memulai adalah berhenti berbicara dan mulai lakukan sesuatu." + }, + { + "author": "Walter Cronkite", + "quotes": "Sukses akan lebih permanen jika Anda meraihnya tanpa menghancurkan prinsip-prinsip Anda." + }, + { + "author": "Warren Buffett", + "quotes": "Dari dulu saya selalu yakin saya akan kaya. Saya kira saya tak pernah meragukannya, satu menit pun." + }, + { + "author": "Whitney Young", + "quotes": "Lebih baik menyiapkan diri untuk sebuah peluang dan tidak mendapatkannya daripada punya peluang dan tidak menyiapkan diri." + }, + { + "author": "William A. W.", + "quotes": "Satu-satunya yang bisa menghalangi kita adalah keyakinan yang salah dan sikap yang negatif." + }, + { + "author": "William Allen White", + "quotes": "Saya tidak takut pada hari esok karena saya sudah melihat hari kemarin dan saya mencintai hari ini." + }, + { + "author": "William Arthur", + "quotes": "Guru yang biasa-biasa, berbicara. Guru yang bagus, menerangkan. Guru yang hebat, mendemonstrasikan. Guru yang agung, memberi inspirasi." + }, + { + "author": "William F. Halsey", + "quotes": "Semua masalah menjadi lebih kecil jika Anda tidak mengelaknya, tapi menghadapinya." + }, + { + "author": "William J. Johnston", + "quotes": "Perubahan yang paling bermakna dalam hidup adalah perubahan sikap. Sikap yang benar akan menghasilkan tindakan yang benar." + }, + { + "author": "William James", + "quotes": "Jika Anda harus membuat pilihan dan Anda tidak melakukannya, itu saja sudah pilihan." + }, + { + "author": "William James", + "quotes": "Percaya bahwa hidup itu berharga, dan kepercayaan Anda akan membantu menciptakan hidup yang berharga." + }, + { + "author": "William Ralph Inge", + "quotes": "Kuatir sama seperti membayar bunga untuk uang yang mungkin tak pernah Anda pinjam." + }, + { + "author": "William Shakespeare", + "quotes": "Jangan sering menyalakan api kebencian terhadap musuhmu, karena nanti akan membakar dirimu sendiri." + }, + { + "author": "William Shakespeare", + "quotes": "Bila kamu jujur kepada dirimu sendiri, bagai siang pasti berganti malam, kamu takkan pernah berdusta kepada orang lain." + }, + { + "author": "William Shakespeare", + "quotes": "Kutu yang berani adalah kutu yang bisa berani mendapatkan sarapannya pada bibir seekor singa." + }, + { + "author": "Winston Churchill", + "quotes": "Kita menyambung hidup dengan apa yang kita peroleh, tapi kita menghadirkan kehidupkan dengan apa yang kita berikan." + }, + { + "author": "Wolfgang von Gothe", + "quotes": "Pengetahuan tidaklah cukup, kita harus mengamalkannya. Niat tidak cukup, kita harus melakukannya." + }, + { + "author": "Zachary Scott", + "quotes": "Ketika Anda bertambah tua, Anda akan menemukan satu-satunya hal yang Anda sesali adalah hal-hal yang tidak Anda lakukan." + }, + { + "author": "Zig Zaglar", + "quotes": "Batu fondasi untuk sukses yang seimbang adalah kejujuran, watak, integritas, iman, cinta dan kesetiaan." + }, + { + "author": "Zig Zaglar", + "quotes": "Kebanyakan orang gagal meraih cita-citanya bukan karena mereka tidak mampu, tetapi karena tidak berkomitmen." + }, + { + "author": "Zig Zaglar", + "quotes": "Kita tidak harus hebat saat memulai, tapi kita harus memulai untuk menjadi hebat." + } + ] \ No newline at end of file diff --git a/node_modules/dhn-api/database/search.js b/node_modules/dhn-api/database/search.js new file mode 100644 index 000000000..4866ae7ed --- /dev/null +++ b/node_modules/dhn-api/database/search.js @@ -0,0 +1,202 @@ +const axios = require('axios') +const cheerio = require('cheerio') + +/* + * @Layar Kaca 21 + */ + +const layarkaca_ = async (pilem) => { + if (!pilem) { + return new TypeError("No Querry Input! Bakaaa >\/\/<") + } + try { +const res = await axios.get(`http://149.56.24.226/?s=` + pilem, { +headers: { + "cache-control": "no-transform", + "content-type": "text/html; charset=UTF-8", + "User-Agent": "Mozilla/5.0 (Linux; Android 9; Redmi 7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.77 Mobile Safari/537.36", + } +}) +const hasil = [] +const $ = cheerio.load(res.data) +$('div.row > div.col-xs-3.col-sm-2.search-poster').each(function (a, b) { +let url = $(b).find('a').attr('href') +let img = $(b).find('img').attr('src').replace('//','') +let title = $(b).find('a').attr('title') +const result = { + status: res.status, + creator: "@dehan_j1ng", + film_title: title, + film_link: url, + film_thumb: img, +} +hasil.push(result) +}) + return hasil + } catch (error404) { + return new Error("=> Error =>" + error404) + } +} + +/* + * @Palingmurah.net + */ + +const palingmurah_ = async (produk) => { + if (!produk) { + return new TypeError("No Querry Input! Bakaaa >\/\/<") + } + try { +const res = await axios.get(`https://palingmurah.net/pencarian-produk/?term=` + produk) +const hasil = [] +const $ = cheerio.load(res.data) +$('div.ui.card.wpj-card-style-2 ').each(function (a, b) { +let url = $(b).find('a.image').attr('href') +let img = $(b).find('img.my_image.lazyload').attr('data-src') +let title = $(b).find('a.list-header').text().trim() +let product_desc = $(b).find('div.description.visible-on-list').text().trim() +let price = $(b).find('div.flex-master.card-job-price.text-right.text-vertical-center').text().trim() +const result = { + status: res.status, + creator: "@dehan_j1ng", + product: title, + product_desc: product_desc, + product_image: img, + product_url: url, + price +} +hasil.push(result) +}) + return hasil + } catch (error404) { + return new Error("=> Error =>" + error404) + } +} + +/* + * @AminoApps - Search + */ +const Amino_ = async (komu) => { + if (!komu) { + return new TypeError("No Querry Input! Bakaaa >\/\/<") + } + try { +const res = await axios.get(`https://aminoapps.com/search/community?q=`+ komu, { +method: 'GET', +headers: { + "User-Agent": "Mozilla/5.0 (Linux; Android 9; Redmi 7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.77 Mobile Safari/537.36", + } +}) +const hasil = []; +const $ = cheerio.load(res.data); +$('li.community-item.list-item').each(function(a, b) { +let title = $(b).find('h4.name.font-montserrat-black').text() +let desc = $(b).find('p.tagline').text() +let url = $(b).find('a').attr('href') +let member_count = $(b).find('div.desc > div.member-count').text().replace(/\n/g,'').replace(/ /g,'') +let image = $(b).find('img.logo').attr('src').replace('//','') +const result = { + status: res.status, + creator: "@dehan_j1ng", + community: title, + community_link: 'https://aminoapps.com' + url, + community_thumb: image, + community_desc: desc, + member_count +} +hasil.push(result) +}) + return hasil + } catch (error404) { + return new Error("=> Error =>" + error404) + } +} + +/* + * @Mangatoon - Search + */ + +const Mangatoon = async (search) => { + if (!search) return "No Querry Input! Bakaa >\/\/<"; + try { + const res = await axios.get(`https://mangatoon.mobi/en/search?word=${search}`, { + method: "GET", + headers: { + "User-Agent": "Mozilla/5.0 (Linux; Android 9; Redmi 7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.77 Mobile Safari/537.36" + } + }); + const hasil = []; + const $ = cheerio.load(res.data); + $('div.recommend-item').each(function(a, b) { + let comic_name = $(b).find('div.recommend-comics-title > span').text(); + let comic_type = $(b).find('div.comics-type > span').text().slice(1).split(/ /g).join(""); + let comic_url = $(b).find('a').attr('href'); + let comic_thumb = $(b).find('img').attr('src'); + const result = { + status: res.status, + creator: "@dehan_j1ng", + comic_name, + comic_type, + comic_url: 'https://mangatoon.mobi' + comic_url, + comic_thumb + }; + hasil.push(result); + }); + let filt = hasil.filter(v => v.comic_name !== undefined && v.comic_type !== undefined); + return filt; + } catch (eror404) { + return "=> Error =>" + eror404; + } +} + +/* + * @Whatsapp Mods - Search + */ + +const WAMods = async (search) => { + if (!search) return "No Querry Input! Bakaaa >\/\/<"; + try { + const res = await axios.request(`https://www.whatsappmods.net/search?q=${search}`, { + method: "GET", + headers: { + "User-Agent": "Mozilla/5.0 (Linux; Android 9; Redmi 7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.77 Mobile Safari/537.36" + } + }); + let hasil = []; + const $ = cheerio.load(res.data); + $('div.gmr-clearfix').each(function(a, b) { + let apk_name = $(b).find('h2.post-title.entry-title > a').text(); + let apk_url = $(b).find('a').attr('href'); + let apk_image = $(b).find('img.post-thumbnail').attr('src'); + let apk_desc = $(b).find('div.post-item.entry-content').text().split(/[\n]|-| /g).join(""); + const result = { + status: res.status, + creator: "@dehan_j1ng", + apk_name, + apk_url, + apk_image, + apk_desc + }; + hasil.push(result); + }); + akhir = hasil.filter(v => v.apk_name !== ''); + return akhir; + } catch (error404) { + return "=> Error =>" + error404; + } +} + +module.exports = { + palingmurah_, + layarkaca_, + Amino_, + Mangatoon, + WAMods +} + +/* + * + * @dehan_j1ng + * An Example Api for De-BOTZ + * + */ \ No newline at end of file diff --git a/node_modules/dhn-api/index.js b/node_modules/dhn-api/index.js new file mode 100644 index 000000000..e993e6973 --- /dev/null +++ b/node_modules/dhn-api/index.js @@ -0,0 +1,46 @@ +const news = require("./database/news.js"); +const anime = require("./database/manga.js"); +const search = require("./database/search.js"); +const other = require("./database/other.js"); +const json = require("./database/json.js"); + +exports.BBCNews = news.BBC; +exports.metroNews = news.metroTV_; +exports.CNNNews = news.CNN_; +exports.iNews = news.iNewsTV_; +exports.KumparanNews = news.Kumparan_; +exports.TribunNews = news.Tribun_; +exports.DailyNews = news.DailyNews_; +exports.DetikNews = news.DetikNews_; +exports.OkezoneNews = news.Okezone_; +exports.CNBCNews = news.CNBC_; +exports.FajarNews = news.KoranFajar_; +exports.KompasNews = news.Kompas_; +exports.SindoNews = news.KoranSindo_; +exports.TempoNews = news.TempoNews_; +exports.IndozoneNews = news.Indozone_; +exports.AntaraNews = news.AntaraNews_; +exports.RepublikaNews = news.Republika_; +exports.VivaNews = news.VIVA_; +exports.KontanNews = news.Kontan_; +exports.MerdekaNews = news.Merdeka_; +exports.KomikuSearch = anime.Komiku_; +exports.AniPlanetSearch = anime.AnimePlanet_; +exports.KomikFoxSearch = anime.KomikFox_; +exports.KomikStationSearch = anime.KomikStation_; +exports.MangakuSearch = anime.Mangakus_; +exports.KiryuuSearch = anime.Kiryuus_; +exports.KissMangaSearch = anime.KissM_; +exports.KlikMangaSearch = anime.KlikS_; +exports.PalingMurah = search.palingmurah_; +exports.LayarKaca21 = search.layarkaca_; +exports.AminoApps = search.Amino_; +exports.Mangatoon = search.Mangatoon; +exports.WAModsSearch = search.WAMods; +exports.Emojis = other.Emojing_; +exports.CoronaInfo = other.Corona_; +exports.Cerpen = json.Cerpen_; +exports.Quotes = json.Quotes_; +exports.Couples = json.Couples; +exports.JalanTikusMeme = json.JTMimers; +exports.Darkjokes = json.Dark; \ No newline at end of file diff --git a/node_modules/dhn-api/node_modules/axios/CHANGELOG.md b/node_modules/dhn-api/node_modules/axios/CHANGELOG.md new file mode 100644 index 000000000..5e2b3d079 --- /dev/null +++ b/node_modules/dhn-api/node_modules/axios/CHANGELOG.md @@ -0,0 +1,775 @@ +# Changelog + +### 0.21.4 (September 6, 2021) + +Fixes and Functionality: +- Fixing JSON transform when data is stringified. Providing backward compatibility and complying to the JSON RFC standard ([#4020](https://github.com/axios/axios/pull/4020)) + +Huge thanks to everyone who contributed to this release via code (authors listed below) or via reviews and triaging on GitHub: + +- [Jay](mailto:jasonsaayman@gmail.com) +- [Guillaume Fortaine](https://github.com/gfortaine) +- [Yusuke Kawasaki](https://github.com/kawanet) +- [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS) + +### 0.21.3 (September 4, 2021) + +Fixes and Functionality: +- Fixing response interceptor not being called when request interceptor is attached ([#4013](https://github.com/axios/axios/pull/4013)) + +Huge thanks to everyone who contributed to this release via code (authors listed below) or via reviews and triaging on GitHub: + +- [Jay](mailto:jasonsaayman@gmail.com) +- [Julian Hollmann](https://github.com/nerdbeere) + +### 0.21.2 (September 4, 2021) + +Fixes and Functionality: + +- Updating axios requests to be delayed by pre-emptive promise creation ([#2702](https://github.com/axios/axios/pull/2702)) +- Adding "synchronous" and "runWhen" options to interceptors api ([#2702](https://github.com/axios/axios/pull/2702)) +- Updating of transformResponse ([#3377](https://github.com/axios/axios/pull/3377)) +- Adding ability to omit User-Agent header ([#3703](https://github.com/axios/axios/pull/3703)) +- Adding multiple JSON improvements ([#3688](https://github.com/axios/axios/pull/3688), [#3763](https://github.com/axios/axios/pull/3763)) +- Fixing quadratic runtime and extra memory usage when setting a maxContentLength ([#3738](https://github.com/axios/axios/pull/3738)) +- Adding parseInt to config.timeout ([#3781](https://github.com/axios/axios/pull/3781)) +- Adding custom return type support to interceptor ([#3783](https://github.com/axios/axios/pull/3783)) +- Adding security fix for ReDoS vulnerability ([#3980](https://github.com/axios/axios/pull/3980)) + +Internal and Tests: + +- Updating build dev dependancies ([#3401](https://github.com/axios/axios/pull/3401)) +- Fixing builds running on Travis CI ([#3538](https://github.com/axios/axios/pull/3538)) +- Updating follow rediect version ([#3694](https://github.com/axios/axios/pull/3694), [#3771](https://github.com/axios/axios/pull/3771)) +- Updating karma sauce launcher to fix failing sauce tests ([#3712](https://github.com/axios/axios/pull/3712), [#3717](https://github.com/axios/axios/pull/3717)) +- Updating content-type header for application/json to not contain charset field, according do RFC 8259 ([#2154](https://github.com/axios/axios/pull/2154)) +- Fixing tests by bumping karma-sauce-launcher version ([#3813](https://github.com/axios/axios/pull/3813)) +- Changing testing process from Travis CI to GitHub Actions ([#3938](https://github.com/axios/axios/pull/3938)) + +Documentation: + +- Updating documentation around the use of `AUTH_TOKEN` with multiple domain endpoints ([#3539](https://github.com/axios/axios/pull/3539)) +- Remove duplication of item in changelog ([#3523](https://github.com/axios/axios/pull/3523)) +- Fixing gramatical errors ([#2642](https://github.com/axios/axios/pull/2642)) +- Fixing spelling error ([#3567](https://github.com/axios/axios/pull/3567)) +- Moving gitpod metion ([#2637](https://github.com/axios/axios/pull/2637)) +- Adding new axios documentation website link ([#3681](https://github.com/axios/axios/pull/3681), [#3707](https://github.com/axios/axios/pull/3707)) +- Updating documentation around dispatching requests ([#3772](https://github.com/axios/axios/pull/3772)) +- Adding documentation for the type guard isAxiosError ([#3767](https://github.com/axios/axios/pull/3767)) +- Adding explanation of cancel token ([#3803](https://github.com/axios/axios/pull/3803)) +- Updating CI status badge ([#3953](https://github.com/axios/axios/pull/3953)) +- Fixing errors with JSON documentation ([#3936](https://github.com/axios/axios/pull/3936)) +- Fixing README typo under Request Config ([#3825](https://github.com/axios/axios/pull/3825)) +- Adding axios-multi-api to the ecosystem file ([#3817](https://github.com/axios/axios/pull/3817)) +- Adding SECURITY.md to properly disclose security vulnerabilities ([#3981](https://github.com/axios/axios/pull/3981)) + +Huge thanks to everyone who contributed to this release via code (authors listed below) or via reviews and triaging on GitHub: + +- [Jay](mailto:jasonsaayman@gmail.com) +- [Sasha Korotkov](https://github.com/SashaKoro) +- [Daniel Lopretto](https://github.com/timemachine3030) +- [Mike Bishop](https://github.com/MikeBishop) +- [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS) +- [Mark](https://github.com/bimbiltu) +- [Philipe Gouveia Paixão](https://github.com/piiih) +- [hippo](https://github.com/hippo2cat) +- [ready-research](https://github.com/ready-research) +- [Xianming Zhong](https://github.com/chinesedfan) +- [Christopher Chrapka](https://github.com/OJezu) +- [Brian Anglin](https://github.com/anglinb) +- [Kohta Ito](https://github.com/koh110) +- [Ali Clark](https://github.com/aliclark) +- [caikan](https://github.com/caikan) +- [Elina Gorshkova](https://github.com/elinagorshkova) +- [Ryota Ikezawa](https://github.com/paveg) +- [Nisar Hassan Naqvi](https://github.com/nisarhassan12) +- [Jake](https://github.com/codemaster138) +- [TagawaHirotaka](https://github.com/wafuwafu13) +- [Johannes Jarbratt](https://github.com/johachi) +- [Mo Sattler](https://github.com/MoSattler) +- [Sam Carlton](https://github.com/ThatGuySam) +- [Matt Czapliński](https://github.com/MattCCC) +- [Ziding Zhang](https://github.com/zidingz) + +### 0.21.1 (December 21, 2020) + +Fixes and Functionality: + +- Hotfix: Prevent SSRF ([#3410](https://github.com/axios/axios/pull/3410)) +- Protocol not parsed when setting proxy config from env vars ([#3070](https://github.com/axios/axios/pull/3070)) +- Updating axios in types to be lower case ([#2797](https://github.com/axios/axios/pull/2797)) +- Adding a type guard for `AxiosError` ([#2949](https://github.com/axios/axios/pull/2949)) + +Internal and Tests: + +- Remove the skipping of the `socket` http test ([#3364](https://github.com/axios/axios/pull/3364)) +- Use different socket for Win32 test ([#3375](https://github.com/axios/axios/pull/3375)) + +Huge thanks to everyone who contributed to this release via code (authors listed below) or via reviews and triaging on GitHub: + +- Daniel Lopretto +- Jason Kwok +- Jay +- Jonathan Foster +- Remco Haszing +- Xianming Zhong + +### 0.21.0 (October 23, 2020) + +Fixes and Functionality: + +- Fixing requestHeaders.Authorization ([#3287](https://github.com/axios/axios/pull/3287)) +- Fixing node types ([#3237](https://github.com/axios/axios/pull/3237)) +- Fixing axios.delete ignores config.data ([#3282](https://github.com/axios/axios/pull/3282)) +- Revert "Fixing overwrite Blob/File type as Content-Type in browser. (#1773)" ([#3289](https://github.com/axios/axios/pull/3289)) +- Fixing an issue that type 'null' and 'undefined' is not assignable to validateStatus when typescript strict option is enabled ([#3200](https://github.com/axios/axios/pull/3200)) + +Internal and Tests: + +- Lock travis to not use node v15 ([#3361](https://github.com/axios/axios/pull/3361)) + +Documentation: + +- Fixing simple typo, existant -> existent ([#3252](https://github.com/axios/axios/pull/3252)) +- Fixing typos ([#3309](https://github.com/axios/axios/pull/3309)) + +Huge thanks to everyone who contributed to this release via code (authors listed below) or via reviews and triaging on GitHub: + +- Allan Cruz <57270969+Allanbcruz@users.noreply.github.com> +- George Cheng +- Jay +- Kevin Kirsche +- Remco Haszing +- Taemin Shin +- Tim Gates +- Xianming Zhong + +### 0.20.0 (August 20, 2020) + +Release of 0.20.0-pre as a full release with no other changes. + +### 0.20.0-pre (July 15, 2020) + +Fixes and Functionality: + +- Fixing response with utf-8 BOM can not parse to json ([#2419](https://github.com/axios/axios/pull/2419)) + - fix: remove byte order marker (UTF-8 BOM) when transform response + - fix: remove BOM only utf-8 + - test: utf-8 BOM + - fix: incorrect param name +- Refactor mergeConfig without utils.deepMerge ([#2844](https://github.com/axios/axios/pull/2844)) + - Adding failing test + - Fixing #2587 default custom config persisting + - Adding Concat keys and filter duplicates + - Fixed value from CPE + - update for review feedbacks + - no deepMerge + - only merge between plain objects + - fix rename + - always merge config by mergeConfig + - extract function mergeDeepProperties + - refactor mergeConfig with all keys, and add special logic for validateStatus + - add test for resetting headers + - add lots of tests and fix a bug + - should not inherit `data` + - use simple toString +- Fixing overwrite Blob/File type as Content-Type in browser. ([#1773](https://github.com/axios/axios/pull/1773)) +- Fixing an issue that type 'null' is not assignable to validateStatus ([#2773](https://github.com/axios/axios/pull/2773)) +- Fixing special char encoding ([#1671](https://github.com/axios/axios/pull/1671)) + - removing @ character from replacement list since it is a reserved character + - Updating buildURL test to not include the @ character + - Removing console logs +- Fixing password encoding with special characters in basic authentication ([#1492](https://github.com/axios/axios/pull/1492)) + - Fixing password encoding with special characters in basic authentication + - Adding test to check if password with non-Latin1 characters pass +- Fixing 'Network Error' in react native android ([#1487](https://github.com/axios/axios/pull/1487)) + There is a bug in react native Android platform when using get method. It will trigger a 'Network Error' when passing the requestData which is an empty string to request.send function. So if the requestData is an empty string we can set it to null as well to fix the bug. +- Fixing Cookie Helper with Async Components ([#1105](https://github.com/axios/axios/pull/1105)) ([#1107](https://github.com/axios/axios/pull/1107)) +- Fixing 'progressEvent' type ([#2851](https://github.com/axios/axios/pull/2851)) + - Fix 'progressEvent' type + - Update axios.ts +- Fixing getting local files (file://) failed ([#2470](https://github.com/axios/axios/pull/2470)) + - fix issue #2416, #2396 + - fix Eslint warn + - Modify judgment conditions + - add unit test + - update unit test + - update unit test +- Allow PURGE method in typings ([#2191](https://github.com/axios/axios/pull/2191)) +- Adding option to disable automatic decompression ([#2661](https://github.com/axios/axios/pull/2661)) + - Adding ability to disable auto decompression + - Updating decompress documentation in README + - Fixing test\unit\adapters\http.js lint errors + - Adding test for disabling auto decompression + - Removing changes that fixed lint errors in tests + - Removing formatting change to unit test +- Add independent `maxBodyLength` option ([#2781](https://github.com/axios/axios/pull/2781)) + - Add independent option to set the maximum size of the request body + - Remove maxBodyLength check + - Update README + - Assert for error code and message +- Adding responseEncoding to mergeConfig ([#1745](https://github.com/axios/axios/pull/1745)) +- Compatible with follow-redirect aborts the request ([#2689](https://github.com/axios/axios/pull/2689)) + - Compatible with follow-redirect aborts the request + - Use the error code +- Fix merging of params ([#2656](https://github.com/axios/axios/pull/2656)) + - Name function to avoid ESLint func-names warning + - Switch params config to merge list and update tests + - Restore testing of both false and null + - Restore test cases for keys without defaults + - Include test for non-object values that aren't false-y. +- Revert `finally` as `then` ([#2683](https://github.com/axios/axios/pull/2683)) + +Internal and Tests: + +- Fix stale bot config ([#3049](https://github.com/axios/axios/pull/3049)) + - fix stale bot config + - fix multiple lines +- Add days and change name to work ([#3035](https://github.com/axios/axios/pull/3035)) +- Update close-issues.yml ([#3031](https://github.com/axios/axios/pull/3031)) + - Update close-issues.yml + Update close message to read better 😄 + - Fix use of quotations + Use single quotes as per other .yml files + - Remove user name form message +- Add GitHub actions to close stale issues/prs ([#3029](https://github.com/axios/axios/pull/3029)) + - prepare stale actions + - update messages + - Add exempt labels and lighten up comments +- Add GitHub actions to close invalid issues ([#3022](https://github.com/axios/axios/pull/3022)) + - add close actions + - fix with checkout + - update issue templates + - add reminder + - update close message +- Add test with Node.js 12 ([#2860](https://github.com/axios/axios/pull/2860)) + - test with Node.js 12 + - test with latest +- Adding console log on sandbox server startup ([#2210](https://github.com/axios/axios/pull/2210)) + - Adding console log on sandbox server startup + - Update server.js + Add server error handling + - Update server.js + Better error message, remove retry. +- Adding tests for method `options` type definitions ([#1996](https://github.com/axios/axios/pull/1996)) + Update tests. +- Add test for redirecting with too large response ([#2695](https://github.com/axios/axios/pull/2695)) +- Fixing unit test failure in Windows OS ([#2601](https://github.com/axios/axios/pull/2601)) +- Fixing issue for HEAD method and gzipped response ([#2666](https://github.com/axios/axios/pull/2666)) +- Fix tests in browsers ([#2748](https://github.com/axios/axios/pull/2748)) +- chore: add `jsdelivr` and `unpkg` support ([#2443](https://github.com/axios/axios/pull/2443)) + +Documentation: + +- Adding support for URLSearchParams in node ([#1900](https://github.com/axios/axios/pull/1900)) + - Adding support for URLSearchParams in node + - Remove un-needed code + - Update utils.js + - Make changes as suggested +- Adding table of content (preview) ([#3050](https://github.com/axios/axios/pull/3050)) + - add toc (preview) + - remove toc in toc + Signed-off-by: Moni + - fix sublinks + - fix indentation + - remove redundant table links + - update caps and indent + - remove axios +- Replace 'blacklist' with 'blocklist' ([#3006](https://github.com/axios/axios/pull/3006)) +- docs(): Detailed config options environment. ([#2088](https://github.com/axios/axios/pull/2088)) + - docs(): Detailed config options environment. + - Update README.md +- Include axios-data-unpacker in ECOSYSTEM.md ([#2080](https://github.com/axios/axios/pull/2080)) +- Allow opening examples in Gitpod ([#1958](https://github.com/axios/axios/pull/1958)) +- Remove axios.all() and axios.spread() from Readme.md ([#2727](https://github.com/axios/axios/pull/2727)) + - remove axios.all(), axios.spread() + - replace example + - axios.all() -> Promise.all() + - axios.spread(function (acct, perms)) -> function (acct, perms) + - add deprecated mark +- Update README.md ([#2887](https://github.com/axios/axios/pull/2887)) + Small change to the data attribute doc of the config. A request body can also be set for DELETE methods but this wasn't mentioned in the documentation (it only mentioned POST, PUT and PATCH). Took my some 10-20 minutes until I realized that I don't need to manipulate the request body with transformRequest in the case of DELETE. +- Include swagger-taxos-codegen in ECOSYSTEM.md ([#2162](https://github.com/axios/axios/pull/2162)) +- Add CDNJS version badge in README.md ([#878](https://github.com/axios/axios/pull/878)) + This badge will show the version on CDNJS! +- Documentation update to clear up ambiguity in code examples ([#2928](https://github.com/axios/axios/pull/2928)) + - Made an adjustment to the documentation to clear up any ambiguity around the use of "fs". This should help clear up that the code examples with "fs" cannot be used on the client side. +- Update README.md about validateStatus ([#2912](https://github.com/axios/axios/pull/2912)) + Rewrote the comment from "Reject only if the status code is greater than or equal to 500" to "Resolve only if the status code is less than 500" +- Updating documentation for usage form-data ([#2805](https://github.com/axios/axios/pull/2805)) + Closes #2049 +- Fixing CHANGELOG.md issue link ([#2784](https://github.com/axios/axios/pull/2784)) +- Include axios-hooks in ECOSYSTEM.md ([#2003](https://github.com/axios/axios/pull/2003)) +- Added Response header access instructions ([#1901](https://github.com/axios/axios/pull/1901)) + - Added Response header access instructions + - Added note about using bracket notation +- Add `onUploadProgress` and `onDownloadProgress` are browser only ([#2763](https://github.com/axios/axios/pull/2763)) + Saw in #928 and #1966 that `onUploadProgress` and `onDownloadProgress` only work in the browser and was missing that from the README. +- Update ' sign to ` in proxy spec ([#2778](https://github.com/axios/axios/pull/2778)) +- Adding jsDelivr link in README ([#1110](https://github.com/axios/axios/pull/1110)) + - Adding jsDelivr link + - Add SRI + - Remove SRI + +Huge thanks to everyone who contributed to this release via code (authors listed +below) or via reviews and triaging on GitHub: + +- Alan Wang +- Alexandru Ungureanu +- Anubhav Srivastava +- Benny Neugebauer +- Cr <631807682@qq.com> +- David +- David Ko +- David Tanner +- Emily Morehouse +- Felipe Martins +- Fonger <5862369+Fonger@users.noreply.github.com> +- Frostack +- George Cheng +- grumblerchester +- Gustavo López +- hexaez <45806662+hexaez@users.noreply.github.com> +- huangzuizui +- Ian Wijma +- Jay +- jeffjing +- jennynju <46782518+jennynju@users.noreply.github.com> +- Jimmy Liao <52391190+jimmy-liao-gogoro@users.noreply.github.com> +- Jonathan Sharpe +- JounQin +- Justin Beckwith +- Kamil Posiadała <3dcreator.pl@gmail.com> +- Lukas Drgon +- marcinx +- Martti Laine +- Michał Zarach +- Moni +- Motonori Iwata <121048+iwata@users.noreply.github.com> +- Nikita Galkin +- Petr Mares +- Philippe Recto +- Remco Haszing +- rockcs1992 +- Ryan Bown +- Samina Fu +- Simone Busoli +- Spencer von der Ohe +- Sven Efftinge +- Taegyeoung Oh +- Taemin Shin +- Thibault Ehrhart <1208424+ehrhart@users.noreply.github.com> +- Xianming Zhong +- Yasu Flores +- Zac Delventhal + +### 0.19.2 (Jan 20, 2020) + +- Remove unnecessary XSS check ([#2679](https://github.com/axios/axios/pull/2679)) (see ([#2646](https://github.com/axios/axios/issues/2646)) for discussion) + +### 0.19.1 (Jan 7, 2020) + +Fixes and Functionality: + +- Fixing invalid agent issue ([#1904](https://github.com/axios/axios/pull/1904)) +- Fix ignore set withCredentials false ([#2582](https://github.com/axios/axios/pull/2582)) +- Delete useless default to hash ([#2458](https://github.com/axios/axios/pull/2458)) +- Fix HTTP/HTTPs agents passing to follow-redirect ([#1904](https://github.com/axios/axios/pull/1904)) +- Fix ignore set withCredentials false ([#2582](https://github.com/axios/axios/pull/2582)) +- Fix CI build failure ([#2570](https://github.com/axios/axios/pull/2570)) +- Remove dependency on is-buffer from package.json ([#1816](https://github.com/axios/axios/pull/1816)) +- Adding options typings ([#2341](https://github.com/axios/axios/pull/2341)) +- Adding Typescript HTTP method definition for LINK and UNLINK. ([#2444](https://github.com/axios/axios/pull/2444)) +- Update dist with newest changes, fixes Custom Attributes issue +- Change syntax to see if build passes ([#2488](https://github.com/axios/axios/pull/2488)) +- Update Webpack + deps, remove now unnecessary polyfills ([#2410](https://github.com/axios/axios/pull/2410)) +- Fix to prevent XSS, throw an error when the URL contains a JS script ([#2464](https://github.com/axios/axios/pull/2464)) +- Add custom timeout error copy in config ([#2275](https://github.com/axios/axios/pull/2275)) +- Add error toJSON example ([#2466](https://github.com/axios/axios/pull/2466)) +- Fixing Vulnerability A Fortify Scan finds a critical Cross-Site Scrip… ([#2451](https://github.com/axios/axios/pull/2451)) +- Fixing subdomain handling on no_proxy ([#2442](https://github.com/axios/axios/pull/2442)) +- Make redirection from HTTP to HTTPS work ([#2426](https://github.com/axios/axios/pull/2426)) and ([#2547](https://github.com/axios/axios/pull/2547)) +- Add toJSON property to AxiosError type ([#2427](https://github.com/axios/axios/pull/2427)) +- Fixing socket hang up error on node side for slow response. ([#1752](https://github.com/axios/axios/pull/1752)) +- Alternative syntax to send data into the body ([#2317](https://github.com/axios/axios/pull/2317)) +- Fixing custom config options ([#2207](https://github.com/axios/axios/pull/2207)) +- Fixing set `config.method` after mergeConfig for Axios.prototype.request ([#2383](https://github.com/axios/axios/pull/2383)) +- Axios create url bug ([#2290](https://github.com/axios/axios/pull/2290)) +- Do not modify config.url when using a relative baseURL (resolves [#1628](https://github.com/axios/axios/issues/1098)) ([#2391](https://github.com/axios/axios/pull/2391)) + +Internal: + +- Revert "Update Webpack + deps, remove now unnecessary polyfills" ([#2479](https://github.com/axios/axios/pull/2479)) +- Order of if/else blocks is causing unit tests mocking XHR. ([#2201](https://github.com/axios/axios/pull/2201)) +- Add license badge ([#2446](https://github.com/axios/axios/pull/2446)) +- Fix travis CI build [#2386](https://github.com/axios/axios/pull/2386) +- Fix cancellation error on build master. #2290 #2207 ([#2407](https://github.com/axios/axios/pull/2407)) + +Documentation: + +- Fixing typo in CHANGELOG.md: s/Functionallity/Functionality ([#2639](https://github.com/axios/axios/pull/2639)) +- Fix badge, use master branch ([#2538](https://github.com/axios/axios/pull/2538)) +- Fix typo in changelog [#2193](https://github.com/axios/axios/pull/2193) +- Document fix ([#2514](https://github.com/axios/axios/pull/2514)) +- Update docs with no_proxy change, issue #2484 ([#2513](https://github.com/axios/axios/pull/2513)) +- Fixing missing words in docs template ([#2259](https://github.com/axios/axios/pull/2259)) +- 🐛Fix request finally documentation in README ([#2189](https://github.com/axios/axios/pull/2189)) +- updating spelling and adding link to docs ([#2212](https://github.com/axios/axios/pull/2212)) +- docs: minor tweak ([#2404](https://github.com/axios/axios/pull/2404)) +- Update response interceptor docs ([#2399](https://github.com/axios/axios/pull/2399)) +- Update README.md ([#2504](https://github.com/axios/axios/pull/2504)) +- Fix word 'sintaxe' to 'syntax' in README.md ([#2432](https://github.com/axios/axios/pull/2432)) +- updating README: notes on CommonJS autocomplete ([#2256](https://github.com/axios/axios/pull/2256)) +- Fix grammar in README.md ([#2271](https://github.com/axios/axios/pull/2271)) +- Doc fixes, minor examples cleanup ([#2198](https://github.com/axios/axios/pull/2198)) + +### 0.19.0 (May 30, 2019) + +Fixes and Functionality: + +- Added support for no_proxy env variable ([#1693](https://github.com/axios/axios/pull/1693/files)) - Chance Dickson +- Unzip response body only for statuses != 204 ([#1129](https://github.com/axios/axios/pull/1129)) - drawski +- Destroy stream on exceeding maxContentLength (fixes [#1098](https://github.com/axios/axios/issues/1098)) ([#1485](https://github.com/axios/axios/pull/1485)) - Gadzhi Gadzhiev +- Makes Axios error generic to use AxiosResponse ([#1738](https://github.com/axios/axios/pull/1738)) - Suman Lama +- Fixing Mocha tests by locking follow-redirects version to 1.5.10 ([#1993](https://github.com/axios/axios/pull/1993)) - grumblerchester +- Allow uppercase methods in typings. ([#1781](https://github.com/axios/axios/pull/1781)) - Ken Powers +- Fixing building url with hash mark ([#1771](https://github.com/axios/axios/pull/1771)) - Anatoly Ryabov +- This commit fix building url with hash map (fragment identifier) when parameters are present: they must not be added after `#`, because client cut everything after `#` +- Preserve HTTP method when following redirect ([#1758](https://github.com/axios/axios/pull/1758)) - Rikki Gibson +- Add `getUri` signature to TypeScript definition. ([#1736](https://github.com/axios/axios/pull/1736)) - Alexander Trauzzi +- Adding isAxiosError flag to errors thrown by axios ([#1419](https://github.com/axios/axios/pull/1419)) - Ayush Gupta + +Internal: + +- Fixing .eslintrc without extension ([#1789](https://github.com/axios/axios/pull/1789)) - Manoel +- Fix failing SauceLabs tests by updating configuration - Emily Morehouse +- Add issue templates - Emily Morehouse + +Documentation: + +- Consistent coding style in README ([#1787](https://github.com/axios/axios/pull/1787)) - Ali Servet Donmez +- Add information about auth parameter to README ([#2166](https://github.com/axios/axios/pull/2166)) - xlaguna +- Add DELETE to list of methods that allow data as a config option ([#2169](https://github.com/axios/axios/pull/2169)) - Daniela Borges Matos de Carvalho +- Update ECOSYSTEM.md - Add Axios Endpoints ([#2176](https://github.com/axios/axios/pull/2176)) - Renan +- Add r2curl in ECOSYSTEM ([#2141](https://github.com/axios/axios/pull/2141)) - 유용우 / CX +- Update README.md - Add instructions for installing with yarn ([#2036](https://github.com/axios/axios/pull/2036)) - Victor Hermes +- Fixing spacing for README.md ([#2066](https://github.com/axios/axios/pull/2066)) - Josh McCarty +- Update README.md. - Change `.then` to `.finally` in example code ([#2090](https://github.com/axios/axios/pull/2090)) - Omar Cai +- Clarify what values responseType can have in Node ([#2121](https://github.com/axios/axios/pull/2121)) - Tyler Breisacher +- docs(ECOSYSTEM): add axios-api-versioning ([#2020](https://github.com/axios/axios/pull/2020)) - Weffe +- It seems that `responseType: 'blob'` doesn't actually work in Node (when I tried using it, response.data was a string, not a Blob, since Node doesn't have Blobs), so this clarifies that this option should only be used in the browser +- Update README.md. - Add Querystring library note ([#1896](https://github.com/axios/axios/pull/1896)) - Dmitriy Eroshenko +- Add react-hooks-axios to Libraries section of ECOSYSTEM.md ([#1925](https://github.com/axios/axios/pull/1925)) - Cody Chan +- Clarify in README that default timeout is 0 (no timeout) ([#1750](https://github.com/axios/axios/pull/1750)) - Ben Standefer + +### 0.19.0-beta.1 (Aug 9, 2018) + +**NOTE:** This is a beta version of this release. There may be functionality that is broken in +certain browsers, though we suspect that builds are hanging and not erroring. See +https://saucelabs.com/u/axios for the most up-to-date information. + +New Functionality: + +- Add getUri method ([#1712](https://github.com/axios/axios/issues/1712)) +- Add support for no_proxy env variable ([#1693](https://github.com/axios/axios/issues/1693)) +- Add toJSON to decorated Axios errors to facilitate serialization ([#1625](https://github.com/axios/axios/issues/1625)) +- Add second then on axios call ([#1623](https://github.com/axios/axios/issues/1623)) +- Typings: allow custom return types +- Add option to specify character set in responses (with http adapter) + +Fixes: + +- Fix Keep defaults local to instance ([#385](https://github.com/axios/axios/issues/385)) +- Correctly catch exception in http test ([#1475](https://github.com/axios/axios/issues/1475)) +- Fix accept header normalization ([#1698](https://github.com/axios/axios/issues/1698)) +- Fix http adapter to allow HTTPS connections via HTTP ([#959](https://github.com/axios/axios/issues/959)) +- Fix Removes usage of deprecated Buffer constructor. ([#1555](https://github.com/axios/axios/issues/1555), [#1622](https://github.com/axios/axios/issues/1622)) +- Fix defaults to use httpAdapter if available ([#1285](https://github.com/axios/axios/issues/1285)) + - Fixing defaults to use httpAdapter if available + - Use a safer, cross-platform method to detect the Node environment +- Fix Reject promise if request is cancelled by the browser ([#537](https://github.com/axios/axios/issues/537)) +- [Typescript] Fix missing type parameters on delete/head methods +- [NS]: Send `false` flag isStandardBrowserEnv for Nativescript +- Fix missing type parameters on delete/head +- Fix Default method for an instance always overwritten by get +- Fix type error when socketPath option in AxiosRequestConfig +- Capture errors on request data streams +- Decorate resolve and reject to clear timeout in all cases + +Huge thanks to everyone who contributed to this release via code (authors listed +below) or via reviews and triaging on GitHub: + +- Andrew Scott +- Anthony Gauthier +- arpit +- ascott18 +- Benedikt Rötsch +- Chance Dickson +- Dave Stewart +- Deric Cain +- Guillaume Briday +- Jacob Wejendorp +- Jim Lynch +- johntron +- Justin Beckwith +- Justin Beckwith +- Khaled Garbaya +- Lim Jing Rong +- Mark van den Broek +- Martti Laine +- mattridley +- mattridley +- Nicolas Del Valle +- Nilegfx +- pbarbiero +- Rikki Gibson +- Sako Hartounian +- Shane Fitzpatrick +- Stephan Schneider +- Steven +- Tim Garthwaite +- Tim Johns +- Yutaro Miyazaki + +### 0.18.0 (Feb 19, 2018) + +- Adding support for UNIX Sockets when running with Node.js ([#1070](https://github.com/axios/axios/pull/1070)) +- Fixing typings ([#1177](https://github.com/axios/axios/pull/1177)): + - AxiosRequestConfig.proxy: allows type false + - AxiosProxyConfig: added auth field +- Adding function signature in AxiosInstance interface so AxiosInstance can be invoked ([#1192](https://github.com/axios/axios/pull/1192), [#1254](https://github.com/axios/axios/pull/1254)) +- Allowing maxContentLength to pass through to redirected calls as maxBodyLength in follow-redirects config ([#1287](https://github.com/axios/axios/pull/1287)) +- Fixing configuration when using an instance - method can now be set ([#1342](https://github.com/axios/axios/pull/1342)) + +### 0.17.1 (Nov 11, 2017) + +- Fixing issue with web workers ([#1160](https://github.com/axios/axios/pull/1160)) +- Allowing overriding transport ([#1080](https://github.com/axios/axios/pull/1080)) +- Updating TypeScript typings ([#1165](https://github.com/axios/axios/pull/1165), [#1125](https://github.com/axios/axios/pull/1125), [#1131](https://github.com/axios/axios/pull/1131)) + +### 0.17.0 (Oct 21, 2017) + +- **BREAKING** Fixing issue with `baseURL` and interceptors ([#950](https://github.com/axios/axios/pull/950)) +- **BREAKING** Improving handing of duplicate headers ([#874](https://github.com/axios/axios/pull/874)) +- Adding support for disabling proxies ([#691](https://github.com/axios/axios/pull/691)) +- Updating TypeScript typings with generic type parameters ([#1061](https://github.com/axios/axios/pull/1061)) + +### 0.16.2 (Jun 3, 2017) + +- Fixing issue with including `buffer` in bundle ([#887](https://github.com/axios/axios/pull/887)) +- Including underlying request in errors ([#830](https://github.com/axios/axios/pull/830)) +- Convert `method` to lowercase ([#930](https://github.com/axios/axios/pull/930)) + +### 0.16.1 (Apr 8, 2017) + +- Improving HTTP adapter to return last request in case of redirects ([#828](https://github.com/axios/axios/pull/828)) +- Updating `follow-redirects` dependency ([#829](https://github.com/axios/axios/pull/829)) +- Adding support for passing `Buffer` in node ([#773](https://github.com/axios/axios/pull/773)) + +### 0.16.0 (Mar 31, 2017) + +- **BREAKING** Removing `Promise` from axios typings in favor of built-in type declarations ([#480](https://github.com/axios/axios/issues/480)) +- Adding `options` shortcut method ([#461](https://github.com/axios/axios/pull/461)) +- Fixing issue with using `responseType: 'json'` in browsers incompatible with XHR Level 2 ([#654](https://github.com/axios/axios/pull/654)) +- Improving React Native detection ([#731](https://github.com/axios/axios/pull/731)) +- Fixing `combineURLs` to support empty `relativeURL` ([#581](https://github.com/axios/axios/pull/581)) +- Removing `PROTECTION_PREFIX` support ([#561](https://github.com/axios/axios/pull/561)) + +### 0.15.3 (Nov 27, 2016) + +- Fixing issue with custom instances and global defaults ([#443](https://github.com/axios/axios/issues/443)) +- Renaming `axios.d.ts` to `index.d.ts` ([#519](https://github.com/axios/axios/issues/519)) +- Adding `get`, `head`, and `delete` to `defaults.headers` ([#509](https://github.com/axios/axios/issues/509)) +- Fixing issue with `btoa` and IE ([#507](https://github.com/axios/axios/issues/507)) +- Adding support for proxy authentication ([#483](https://github.com/axios/axios/pull/483)) +- Improving HTTP adapter to use `http` protocol by default ([#493](https://github.com/axios/axios/pull/493)) +- Fixing proxy issues ([#491](https://github.com/axios/axios/pull/491)) + +### 0.15.2 (Oct 17, 2016) + +- Fixing issue with calling `cancel` after response has been received ([#482](https://github.com/axios/axios/issues/482)) + +### 0.15.1 (Oct 14, 2016) + +- Fixing issue with UMD ([#485](https://github.com/axios/axios/issues/485)) + +### 0.15.0 (Oct 10, 2016) + +- Adding cancellation support ([#452](https://github.com/axios/axios/pull/452)) +- Moving default adapter to global defaults ([#437](https://github.com/axios/axios/pull/437)) +- Fixing issue with `file` URI scheme ([#440](https://github.com/axios/axios/pull/440)) +- Fixing issue with `params` objects that have no prototype ([#445](https://github.com/axios/axios/pull/445)) + +### 0.14.0 (Aug 27, 2016) + +- **BREAKING** Updating TypeScript definitions ([#419](https://github.com/axios/axios/pull/419)) +- **BREAKING** Replacing `agent` option with `httpAgent` and `httpsAgent` ([#387](https://github.com/axios/axios/pull/387)) +- **BREAKING** Splitting `progress` event handlers into `onUploadProgress` and `onDownloadProgress` ([#423](https://github.com/axios/axios/pull/423)) +- Adding support for `http_proxy` and `https_proxy` environment variables ([#366](https://github.com/axios/axios/pull/366)) +- Fixing issue with `auth` config option and `Authorization` header ([#397](https://github.com/axios/axios/pull/397)) +- Don't set XSRF header if `xsrfCookieName` is `null` ([#406](https://github.com/axios/axios/pull/406)) + +### 0.13.1 (Jul 16, 2016) + +- Fixing issue with response data not being transformed on error ([#378](https://github.com/axios/axios/issues/378)) + +### 0.13.0 (Jul 13, 2016) + +- **BREAKING** Improved error handling ([#345](https://github.com/axios/axios/pull/345)) +- **BREAKING** Response transformer now invoked in dispatcher not adapter ([10eb238](https://github.com/axios/axios/commit/10eb23865101f9347570552c04e9d6211376e25e)) +- **BREAKING** Request adapters now return a `Promise` ([157efd5](https://github.com/axios/axios/commit/157efd5615890301824e3121cc6c9d2f9b21f94a)) +- Fixing issue with `withCredentials` not being overwritten ([#343](https://github.com/axios/axios/issues/343)) +- Fixing regression with request transformer being called before request interceptor ([#352](https://github.com/axios/axios/issues/352)) +- Fixing custom instance defaults ([#341](https://github.com/axios/axios/issues/341)) +- Fixing instances created from `axios.create` to have same API as default axios ([#217](https://github.com/axios/axios/issues/217)) + +### 0.12.0 (May 31, 2016) + +- Adding support for `URLSearchParams` ([#317](https://github.com/axios/axios/pull/317)) +- Adding `maxRedirects` option ([#307](https://github.com/axios/axios/pull/307)) + +### 0.11.1 (May 17, 2016) + +- Fixing IE CORS support ([#313](https://github.com/axios/axios/pull/313)) +- Fixing detection of `FormData` ([#325](https://github.com/axios/axios/pull/325)) +- Adding `Axios` class to exports ([#321](https://github.com/axios/axios/pull/321)) + +### 0.11.0 (Apr 26, 2016) + +- Adding support for Stream with HTTP adapter ([#296](https://github.com/axios/axios/pull/296)) +- Adding support for custom HTTP status code error ranges ([#308](https://github.com/axios/axios/pull/308)) +- Fixing issue with ArrayBuffer ([#299](https://github.com/axios/axios/pull/299)) + +### 0.10.0 (Apr 20, 2016) + +- Fixing issue with some requests sending `undefined` instead of `null` ([#250](https://github.com/axios/axios/pull/250)) +- Fixing basic auth for HTTP adapter ([#252](https://github.com/axios/axios/pull/252)) +- Fixing request timeout for XHR adapter ([#227](https://github.com/axios/axios/pull/227)) +- Fixing IE8 support by using `onreadystatechange` instead of `onload` ([#249](https://github.com/axios/axios/pull/249)) +- Fixing IE9 cross domain requests ([#251](https://github.com/axios/axios/pull/251)) +- Adding `maxContentLength` option ([#275](https://github.com/axios/axios/pull/275)) +- Fixing XHR support for WebWorker environment ([#279](https://github.com/axios/axios/pull/279)) +- Adding request instance to response ([#200](https://github.com/axios/axios/pull/200)) + +### 0.9.1 (Jan 24, 2016) + +- Improving handling of request timeout in node ([#124](https://github.com/axios/axios/issues/124)) +- Fixing network errors not rejecting ([#205](https://github.com/axios/axios/pull/205)) +- Fixing issue with IE rejecting on HTTP 204 ([#201](https://github.com/axios/axios/issues/201)) +- Fixing host/port when following redirects ([#198](https://github.com/axios/axios/pull/198)) + +### 0.9.0 (Jan 18, 2016) + +- Adding support for custom adapters +- Fixing Content-Type header being removed when data is false ([#195](https://github.com/axios/axios/pull/195)) +- Improving XDomainRequest implementation ([#185](https://github.com/axios/axios/pull/185)) +- Improving config merging and order of precedence ([#183](https://github.com/axios/axios/pull/183)) +- Fixing XDomainRequest support for only <= IE9 ([#182](https://github.com/axios/axios/pull/182)) + +### 0.8.1 (Dec 14, 2015) + +- Adding support for passing XSRF token for cross domain requests when using `withCredentials` ([#168](https://github.com/axios/axios/pull/168)) +- Fixing error with format of basic auth header ([#178](https://github.com/axios/axios/pull/173)) +- Fixing error with JSON payloads throwing `InvalidStateError` in some cases ([#174](https://github.com/axios/axios/pull/174)) + +### 0.8.0 (Dec 11, 2015) + +- Adding support for creating instances of axios ([#123](https://github.com/axios/axios/pull/123)) +- Fixing http adapter to use `Buffer` instead of `String` in case of `responseType === 'arraybuffer'` ([#128](https://github.com/axios/axios/pull/128)) +- Adding support for using custom parameter serializer with `paramsSerializer` option ([#121](https://github.com/axios/axios/pull/121)) +- Fixing issue in IE8 caused by `forEach` on `arguments` ([#127](https://github.com/axios/axios/pull/127)) +- Adding support for following redirects in node ([#146](https://github.com/axios/axios/pull/146)) +- Adding support for transparent decompression if `content-encoding` is set ([#149](https://github.com/axios/axios/pull/149)) +- Adding support for transparent XDomainRequest to handle cross domain requests in IE9 ([#140](https://github.com/axios/axios/pull/140)) +- Adding support for HTTP basic auth via Authorization header ([#167](https://github.com/axios/axios/pull/167)) +- Adding support for baseURL option ([#160](https://github.com/axios/axios/pull/160)) + +### 0.7.0 (Sep 29, 2015) + +- Fixing issue with minified bundle in IE8 ([#87](https://github.com/axios/axios/pull/87)) +- Adding support for passing agent in node ([#102](https://github.com/axios/axios/pull/102)) +- Adding support for returning result from `axios.spread` for chaining ([#106](https://github.com/axios/axios/pull/106)) +- Fixing typescript definition ([#105](https://github.com/axios/axios/pull/105)) +- Fixing default timeout config for node ([#112](https://github.com/axios/axios/pull/112)) +- Adding support for use in web workers, and react-native ([#70](https://github.com/axios/axios/issue/70)), ([#98](https://github.com/axios/axios/pull/98)) +- Adding support for fetch like API `axios(url[, config])` ([#116](https://github.com/axios/axios/issues/116)) + +### 0.6.0 (Sep 21, 2015) + +- Removing deprecated success/error aliases +- Fixing issue with array params not being properly encoded ([#49](https://github.com/axios/axios/pull/49)) +- Fixing issue with User-Agent getting overridden ([#69](https://github.com/axios/axios/issues/69)) +- Adding support for timeout config ([#56](https://github.com/axios/axios/issues/56)) +- Removing es6-promise dependency +- Fixing issue preventing `length` to be used as a parameter ([#91](https://github.com/axios/axios/pull/91)) +- Fixing issue with IE8 ([#85](https://github.com/axios/axios/pull/85)) +- Converting build to UMD + +### 0.5.4 (Apr 08, 2015) + +- Fixing issue with FormData not being sent ([#53](https://github.com/axios/axios/issues/53)) + +### 0.5.3 (Apr 07, 2015) + +- Using JSON.parse unconditionally when transforming response string ([#55](https://github.com/axios/axios/issues/55)) + +### 0.5.2 (Mar 13, 2015) + +- Adding support for `statusText` in response ([#46](https://github.com/axios/axios/issues/46)) + +### 0.5.1 (Mar 10, 2015) + +- Fixing issue using strict mode ([#45](https://github.com/axios/axios/issues/45)) +- Fixing issue with standalone build ([#47](https://github.com/axios/axios/issues/47)) + +### 0.5.0 (Jan 23, 2015) + +- Adding support for intercepetors ([#14](https://github.com/axios/axios/issues/14)) +- Updating es6-promise dependency + +### 0.4.2 (Dec 10, 2014) + +- Fixing issue with `Content-Type` when using `FormData` ([#22](https://github.com/axios/axios/issues/22)) +- Adding support for TypeScript ([#25](https://github.com/axios/axios/issues/25)) +- Fixing issue with standalone build ([#29](https://github.com/axios/axios/issues/29)) +- Fixing issue with verbs needing to be capitalized in some browsers ([#30](https://github.com/axios/axios/issues/30)) + +### 0.4.1 (Oct 15, 2014) + +- Adding error handling to request for node.js ([#18](https://github.com/axios/axios/issues/18)) + +### 0.4.0 (Oct 03, 2014) + +- Adding support for `ArrayBuffer` and `ArrayBufferView` ([#10](https://github.com/axios/axios/issues/10)) +- Adding support for utf-8 for node.js ([#13](https://github.com/axios/axios/issues/13)) +- Adding support for SSL for node.js ([#12](https://github.com/axios/axios/issues/12)) +- Fixing incorrect `Content-Type` header ([#9](https://github.com/axios/axios/issues/9)) +- Adding standalone build without bundled es6-promise ([#11](https://github.com/axios/axios/issues/11)) +- Deprecating `success`/`error` in favor of `then`/`catch` + +### 0.3.1 (Sep 16, 2014) + +- Fixing missing post body when using node.js ([#3](https://github.com/axios/axios/issues/3)) + +### 0.3.0 (Sep 16, 2014) + +- Fixing `success` and `error` to properly receive response data as individual arguments ([#8](https://github.com/axios/axios/issues/8)) +- Updating `then` and `catch` to receive response data as a single object ([#6](https://github.com/axios/axios/issues/6)) +- Fixing issue with `all` not working ([#7](https://github.com/axios/axios/issues/7)) + +### 0.2.2 (Sep 14, 2014) + +- Fixing bundling with browserify ([#4](https://github.com/axios/axios/issues/4)) + +### 0.2.1 (Sep 12, 2014) + +- Fixing build problem causing ridiculous file sizes + +### 0.2.0 (Sep 12, 2014) + +- Adding support for `all` and `spread` +- Adding support for node.js ([#1](https://github.com/axios/axios/issues/1)) + +### 0.1.0 (Aug 29, 2014) + +- Initial release diff --git a/node_modules/dhn-api/node_modules/axios/LICENSE b/node_modules/dhn-api/node_modules/axios/LICENSE new file mode 100644 index 000000000..d36c80ef2 --- /dev/null +++ b/node_modules/dhn-api/node_modules/axios/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2014-present Matt Zabriskie + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/dhn-api/node_modules/axios/README.md b/node_modules/dhn-api/node_modules/axios/README.md new file mode 100644 index 000000000..b8c019a78 --- /dev/null +++ b/node_modules/dhn-api/node_modules/axios/README.md @@ -0,0 +1,868 @@ +# axios + +[![npm version](https://img.shields.io/npm/v/axios.svg?style=flat-square)](https://www.npmjs.org/package/axios) +[![CDNJS](https://img.shields.io/cdnjs/v/axios.svg?style=flat-square)](https://cdnjs.com/libraries/axios) +![Build status](https://github.com/axios/axios/actions/workflows/ci.yml/badge.svg) +[![Gitpod Ready-to-Code](https://img.shields.io/badge/Gitpod-Ready--to--Code-blue?logo=gitpod)](https://gitpod.io/#https://github.com/axios/axios) +[![code coverage](https://img.shields.io/coveralls/mzabriskie/axios.svg?style=flat-square)](https://coveralls.io/r/mzabriskie/axios) +[![install size](https://packagephobia.now.sh/badge?p=axios)](https://packagephobia.now.sh/result?p=axios) +[![npm downloads](https://img.shields.io/npm/dm/axios.svg?style=flat-square)](http://npm-stat.com/charts.html?package=axios) +[![gitter chat](https://img.shields.io/gitter/room/mzabriskie/axios.svg?style=flat-square)](https://gitter.im/mzabriskie/axios) +[![code helpers](https://www.codetriage.com/axios/axios/badges/users.svg)](https://www.codetriage.com/axios/axios) + +Promise based HTTP client for the browser and node.js + +> New axios docs website: [click here](https://axios-http.com/) + +## Table of Contents + + - [Features](#features) + - [Browser Support](#browser-support) + - [Installing](#installing) + - [Example](#example) + - [Axios API](#axios-api) + - [Request method aliases](#request-method-aliases) + - [Concurrency (Deprecated)](#concurrency-deprecated) + - [Creating an instance](#creating-an-instance) + - [Instance methods](#instance-methods) + - [Request Config](#request-config) + - [Response Schema](#response-schema) + - [Config Defaults](#config-defaults) + - [Global axios defaults](#global-axios-defaults) + - [Custom instance defaults](#custom-instance-defaults) + - [Config order of precedence](#config-order-of-precedence) + - [Interceptors](#interceptors) + - [Handling Errors](#handling-errors) + - [Cancellation](#cancellation) + - [Using application/x-www-form-urlencoded format](#using-applicationx-www-form-urlencoded-format) + - [Browser](#browser) + - [Node.js](#nodejs) + - [Query string](#query-string) + - [Form data](#form-data) + - [Semver](#semver) + - [Promises](#promises) + - [TypeScript](#typescript) + - [Resources](#resources) + - [Credits](#credits) + - [License](#license) + +## Features + +- Make [XMLHttpRequests](https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest) from the browser +- Make [http](http://nodejs.org/api/http.html) requests from node.js +- Supports the [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) API +- Intercept request and response +- Transform request and response data +- Cancel requests +- Automatic transforms for JSON data +- Client side support for protecting against [XSRF](http://en.wikipedia.org/wiki/Cross-site_request_forgery) + +## Browser Support + +![Chrome](https://raw.github.com/alrra/browser-logos/master/src/chrome/chrome_48x48.png) | ![Firefox](https://raw.github.com/alrra/browser-logos/master/src/firefox/firefox_48x48.png) | ![Safari](https://raw.github.com/alrra/browser-logos/master/src/safari/safari_48x48.png) | ![Opera](https://raw.github.com/alrra/browser-logos/master/src/opera/opera_48x48.png) | ![Edge](https://raw.github.com/alrra/browser-logos/master/src/edge/edge_48x48.png) | ![IE](https://raw.github.com/alrra/browser-logos/master/src/archive/internet-explorer_9-11/internet-explorer_9-11_48x48.png) | +--- | --- | --- | --- | --- | --- | +Latest ✔ | Latest ✔ | Latest ✔ | Latest ✔ | Latest ✔ | 11 ✔ | + +[![Browser Matrix](https://saucelabs.com/open_sauce/build_matrix/axios.svg)](https://saucelabs.com/u/axios) + +## Installing + +Using npm: + +```bash +$ npm install axios +``` + +Using bower: + +```bash +$ bower install axios +``` + +Using yarn: + +```bash +$ yarn add axios +``` + +Using jsDelivr CDN: + +```html + +``` + +Using unpkg CDN: + +```html + +``` + +## Example + +### note: CommonJS usage +In order to gain the TypeScript typings (for intellisense / autocomplete) while using CommonJS imports with `require()` use the following approach: + +```js +const axios = require('axios').default; + +// axios. will now provide autocomplete and parameter typings +``` + +Performing a `GET` request + +```js +const axios = require('axios'); + +// Make a request for a user with a given ID +axios.get('/user?ID=12345') + .then(function (response) { + // handle success + console.log(response); + }) + .catch(function (error) { + // handle error + console.log(error); + }) + .then(function () { + // always executed + }); + +// Optionally the request above could also be done as +axios.get('/user', { + params: { + ID: 12345 + } + }) + .then(function (response) { + console.log(response); + }) + .catch(function (error) { + console.log(error); + }) + .then(function () { + // always executed + }); + +// Want to use async/await? Add the `async` keyword to your outer function/method. +async function getUser() { + try { + const response = await axios.get('/user?ID=12345'); + console.log(response); + } catch (error) { + console.error(error); + } +} +``` + +> **NOTE:** `async/await` is part of ECMAScript 2017 and is not supported in Internet +> Explorer and older browsers, so use with caution. + +Performing a `POST` request + +```js +axios.post('/user', { + firstName: 'Fred', + lastName: 'Flintstone' + }) + .then(function (response) { + console.log(response); + }) + .catch(function (error) { + console.log(error); + }); +``` + +Performing multiple concurrent requests + +```js +function getUserAccount() { + return axios.get('/user/12345'); +} + +function getUserPermissions() { + return axios.get('/user/12345/permissions'); +} + +Promise.all([getUserAccount(), getUserPermissions()]) + .then(function (results) { + const acct = results[0]; + const perm = results[1]; + }); +``` + +## axios API + +Requests can be made by passing the relevant config to `axios`. + +##### axios(config) + +```js +// Send a POST request +axios({ + method: 'post', + url: '/user/12345', + data: { + firstName: 'Fred', + lastName: 'Flintstone' + } +}); +``` + +```js +// GET request for remote image in node.js +axios({ + method: 'get', + url: 'http://bit.ly/2mTM3nY', + responseType: 'stream' +}) + .then(function (response) { + response.data.pipe(fs.createWriteStream('ada_lovelace.jpg')) + }); +``` + +##### axios(url[, config]) + +```js +// Send a GET request (default method) +axios('/user/12345'); +``` + +### Request method aliases + +For convenience aliases have been provided for all supported request methods. + +##### axios.request(config) +##### axios.get(url[, config]) +##### axios.delete(url[, config]) +##### axios.head(url[, config]) +##### axios.options(url[, config]) +##### axios.post(url[, data[, config]]) +##### axios.put(url[, data[, config]]) +##### axios.patch(url[, data[, config]]) + +###### NOTE +When using the alias methods `url`, `method`, and `data` properties don't need to be specified in config. + +### Concurrency (Deprecated) +Please use `Promise.all` to replace the below functions. + +Helper functions for dealing with concurrent requests. + +axios.all(iterable) +axios.spread(callback) + +### Creating an instance + +You can create a new instance of axios with a custom config. + +##### axios.create([config]) + +```js +const instance = axios.create({ + baseURL: 'https://some-domain.com/api/', + timeout: 1000, + headers: {'X-Custom-Header': 'foobar'} +}); +``` + +### Instance methods + +The available instance methods are listed below. The specified config will be merged with the instance config. + +##### axios#request(config) +##### axios#get(url[, config]) +##### axios#delete(url[, config]) +##### axios#head(url[, config]) +##### axios#options(url[, config]) +##### axios#post(url[, data[, config]]) +##### axios#put(url[, data[, config]]) +##### axios#patch(url[, data[, config]]) +##### axios#getUri([config]) + +## Request Config + +These are the available config options for making requests. Only the `url` is required. Requests will default to `GET` if `method` is not specified. + +```js +{ + // `url` is the server URL that will be used for the request + url: '/user', + + // `method` is the request method to be used when making the request + method: 'get', // default + + // `baseURL` will be prepended to `url` unless `url` is absolute. + // It can be convenient to set `baseURL` for an instance of axios to pass relative URLs + // to methods of that instance. + baseURL: 'https://some-domain.com/api/', + + // `transformRequest` allows changes to the request data before it is sent to the server + // This is only applicable for request methods 'PUT', 'POST', 'PATCH' and 'DELETE' + // The last function in the array must return a string or an instance of Buffer, ArrayBuffer, + // FormData or Stream + // You may modify the headers object. + transformRequest: [function (data, headers) { + // Do whatever you want to transform the data + + return data; + }], + + // `transformResponse` allows changes to the response data to be made before + // it is passed to then/catch + transformResponse: [function (data) { + // Do whatever you want to transform the data + + return data; + }], + + // `headers` are custom headers to be sent + headers: {'X-Requested-With': 'XMLHttpRequest'}, + + // `params` are the URL parameters to be sent with the request + // Must be a plain object or a URLSearchParams object + params: { + ID: 12345 + }, + + // `paramsSerializer` is an optional function in charge of serializing `params` + // (e.g. https://www.npmjs.com/package/qs, http://api.jquery.com/jquery.param/) + paramsSerializer: function (params) { + return Qs.stringify(params, {arrayFormat: 'brackets'}) + }, + + // `data` is the data to be sent as the request body + // Only applicable for request methods 'PUT', 'POST', 'DELETE , and 'PATCH' + // When no `transformRequest` is set, must be of one of the following types: + // - string, plain object, ArrayBuffer, ArrayBufferView, URLSearchParams + // - Browser only: FormData, File, Blob + // - Node only: Stream, Buffer + data: { + firstName: 'Fred' + }, + + // syntax alternative to send data into the body + // method post + // only the value is sent, not the key + data: 'Country=Brasil&City=Belo Horizonte', + + // `timeout` specifies the number of milliseconds before the request times out. + // If the request takes longer than `timeout`, the request will be aborted. + timeout: 1000, // default is `0` (no timeout) + + // `withCredentials` indicates whether or not cross-site Access-Control requests + // should be made using credentials + withCredentials: false, // default + + // `adapter` allows custom handling of requests which makes testing easier. + // Return a promise and supply a valid response (see lib/adapters/README.md). + adapter: function (config) { + /* ... */ + }, + + // `auth` indicates that HTTP Basic auth should be used, and supplies credentials. + // This will set an `Authorization` header, overwriting any existing + // `Authorization` custom headers you have set using `headers`. + // Please note that only HTTP Basic auth is configurable through this parameter. + // For Bearer tokens and such, use `Authorization` custom headers instead. + auth: { + username: 'janedoe', + password: 's00pers3cret' + }, + + // `responseType` indicates the type of data that the server will respond with + // options are: 'arraybuffer', 'document', 'json', 'text', 'stream' + // browser only: 'blob' + responseType: 'json', // default + + // `responseEncoding` indicates encoding to use for decoding responses (Node.js only) + // Note: Ignored for `responseType` of 'stream' or client-side requests + responseEncoding: 'utf8', // default + + // `xsrfCookieName` is the name of the cookie to use as a value for xsrf token + xsrfCookieName: 'XSRF-TOKEN', // default + + // `xsrfHeaderName` is the name of the http header that carries the xsrf token value + xsrfHeaderName: 'X-XSRF-TOKEN', // default + + // `onUploadProgress` allows handling of progress events for uploads + // browser only + onUploadProgress: function (progressEvent) { + // Do whatever you want with the native progress event + }, + + // `onDownloadProgress` allows handling of progress events for downloads + // browser only + onDownloadProgress: function (progressEvent) { + // Do whatever you want with the native progress event + }, + + // `maxContentLength` defines the max size of the http response content in bytes allowed in node.js + maxContentLength: 2000, + + // `maxBodyLength` (Node only option) defines the max size of the http request content in bytes allowed + maxBodyLength: 2000, + + // `validateStatus` defines whether to resolve or reject the promise for a given + // HTTP response status code. If `validateStatus` returns `true` (or is set to `null` + // or `undefined`), the promise will be resolved; otherwise, the promise will be + // rejected. + validateStatus: function (status) { + return status >= 200 && status < 300; // default + }, + + // `maxRedirects` defines the maximum number of redirects to follow in node.js. + // If set to 0, no redirects will be followed. + maxRedirects: 5, // default + + // `socketPath` defines a UNIX Socket to be used in node.js. + // e.g. '/var/run/docker.sock' to send requests to the docker daemon. + // Only either `socketPath` or `proxy` can be specified. + // If both are specified, `socketPath` is used. + socketPath: null, // default + + // `httpAgent` and `httpsAgent` define a custom agent to be used when performing http + // and https requests, respectively, in node.js. This allows options to be added like + // `keepAlive` that are not enabled by default. + httpAgent: new http.Agent({ keepAlive: true }), + httpsAgent: new https.Agent({ keepAlive: true }), + + // `proxy` defines the hostname, port, and protocol of the proxy server. + // You can also define your proxy using the conventional `http_proxy` and + // `https_proxy` environment variables. If you are using environment variables + // for your proxy configuration, you can also define a `no_proxy` environment + // variable as a comma-separated list of domains that should not be proxied. + // Use `false` to disable proxies, ignoring environment variables. + // `auth` indicates that HTTP Basic auth should be used to connect to the proxy, and + // supplies credentials. + // This will set an `Proxy-Authorization` header, overwriting any existing + // `Proxy-Authorization` custom headers you have set using `headers`. + // If the proxy server uses HTTPS, then you must set the protocol to `https`. + proxy: { + protocol: 'https', + host: '127.0.0.1', + port: 9000, + auth: { + username: 'mikeymike', + password: 'rapunz3l' + } + }, + + // `cancelToken` specifies a cancel token that can be used to cancel the request + // (see Cancellation section below for details) + cancelToken: new CancelToken(function (cancel) { + }), + + // `decompress` indicates whether or not the response body should be decompressed + // automatically. If set to `true` will also remove the 'content-encoding' header + // from the responses objects of all decompressed responses + // - Node only (XHR cannot turn off decompression) + decompress: true, // default + + // transitional options for backward compatibility that may be removed in the newer versions + transitional: { + // silent JSON parsing mode + // `true` - ignore JSON parsing errors and set response.data to null if parsing failed (old behaviour) + // `false` - throw SyntaxError if JSON parsing failed (Note: responseType must be set to 'json') + silentJSONParsing: true, // default value for the current Axios version + + // try to parse the response string as JSON even if `responseType` is not 'json' + forcedJSONParsing: true, + + // throw ETIMEDOUT error instead of generic ECONNABORTED on request timeouts + clarifyTimeoutError: false, + } +} +``` + +## Response Schema + +The response for a request contains the following information. + +```js +{ + // `data` is the response that was provided by the server + data: {}, + + // `status` is the HTTP status code from the server response + status: 200, + + // `statusText` is the HTTP status message from the server response + statusText: 'OK', + + // `headers` the HTTP headers that the server responded with + // All header names are lower cased and can be accessed using the bracket notation. + // Example: `response.headers['content-type']` + headers: {}, + + // `config` is the config that was provided to `axios` for the request + config: {}, + + // `request` is the request that generated this response + // It is the last ClientRequest instance in node.js (in redirects) + // and an XMLHttpRequest instance in the browser + request: {} +} +``` + +When using `then`, you will receive the response as follows: + +```js +axios.get('/user/12345') + .then(function (response) { + console.log(response.data); + console.log(response.status); + console.log(response.statusText); + console.log(response.headers); + console.log(response.config); + }); +``` + +When using `catch`, or passing a [rejection callback](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/then) as second parameter of `then`, the response will be available through the `error` object as explained in the [Handling Errors](#handling-errors) section. + +## Config Defaults + +You can specify config defaults that will be applied to every request. + +### Global axios defaults + +```js +axios.defaults.baseURL = 'https://api.example.com'; + +// Important: If axios is used with multiple domains, the AUTH_TOKEN will be sent to all of them. +// See below for an example using Custom instance defaults instead. +axios.defaults.headers.common['Authorization'] = AUTH_TOKEN; + +axios.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded'; +``` + +### Custom instance defaults + +```js +// Set config defaults when creating the instance +const instance = axios.create({ + baseURL: 'https://api.example.com' +}); + +// Alter defaults after instance has been created +instance.defaults.headers.common['Authorization'] = AUTH_TOKEN; +``` + +### Config order of precedence + +Config will be merged with an order of precedence. The order is library defaults found in [lib/defaults.js](https://github.com/axios/axios/blob/master/lib/defaults.js#L28), then `defaults` property of the instance, and finally `config` argument for the request. The latter will take precedence over the former. Here's an example. + +```js +// Create an instance using the config defaults provided by the library +// At this point the timeout config value is `0` as is the default for the library +const instance = axios.create(); + +// Override timeout default for the library +// Now all requests using this instance will wait 2.5 seconds before timing out +instance.defaults.timeout = 2500; + +// Override timeout for this request as it's known to take a long time +instance.get('/longRequest', { + timeout: 5000 +}); +``` + +## Interceptors + +You can intercept requests or responses before they are handled by `then` or `catch`. + +```js +// Add a request interceptor +axios.interceptors.request.use(function (config) { + // Do something before request is sent + return config; + }, function (error) { + // Do something with request error + return Promise.reject(error); + }); + +// Add a response interceptor +axios.interceptors.response.use(function (response) { + // Any status code that lie within the range of 2xx cause this function to trigger + // Do something with response data + return response; + }, function (error) { + // Any status codes that falls outside the range of 2xx cause this function to trigger + // Do something with response error + return Promise.reject(error); + }); +``` + +If you need to remove an interceptor later you can. + +```js +const myInterceptor = axios.interceptors.request.use(function () {/*...*/}); +axios.interceptors.request.eject(myInterceptor); +``` + +You can add interceptors to a custom instance of axios. + +```js +const instance = axios.create(); +instance.interceptors.request.use(function () {/*...*/}); +``` + +When you add request interceptors, they are presumed to be asynchronous by default. This can cause a delay +in the execution of your axios request when the main thread is blocked (a promise is created under the hood for +the interceptor and your request gets put on the bottom of the call stack). If your request interceptors are synchronous you can add a flag +to the options object that will tell axios to run the code synchronously and avoid any delays in request execution. + +```js +axios.interceptors.request.use(function (config) { + config.headers.test = 'I am only a header!'; + return config; +}, null, { synchronous: true }); +``` + +If you want to execute a particular interceptor based on a runtime check, +you can add a `runWhen` function to the options object. The interceptor will not be executed **if and only if** the return +of `runWhen` is `false`. The function will be called with the config +object (don't forget that you can bind your own arguments to it as well.) This can be handy when you have an +asynchronous request interceptor that only needs to run at certain times. + +```js +function onGetCall(config) { + return config.method === 'get'; +} +axios.interceptors.request.use(function (config) { + config.headers.test = 'special get headers'; + return config; +}, null, { runWhen: onGetCall }); +``` + +## Handling Errors + +```js +axios.get('/user/12345') + .catch(function (error) { + if (error.response) { + // The request was made and the server responded with a status code + // that falls out of the range of 2xx + console.log(error.response.data); + console.log(error.response.status); + console.log(error.response.headers); + } else if (error.request) { + // The request was made but no response was received + // `error.request` is an instance of XMLHttpRequest in the browser and an instance of + // http.ClientRequest in node.js + console.log(error.request); + } else { + // Something happened in setting up the request that triggered an Error + console.log('Error', error.message); + } + console.log(error.config); + }); +``` + +Using the `validateStatus` config option, you can define HTTP code(s) that should throw an error. + +```js +axios.get('/user/12345', { + validateStatus: function (status) { + return status < 500; // Resolve only if the status code is less than 500 + } +}) +``` + +Using `toJSON` you get an object with more information about the HTTP error. + +```js +axios.get('/user/12345') + .catch(function (error) { + console.log(error.toJSON()); + }); +``` + +## Cancellation + +You can cancel a request using a *cancel token*. + +> The axios cancel token API is based on the withdrawn [cancelable promises proposal](https://github.com/tc39/proposal-cancelable-promises). + +You can create a cancel token using the `CancelToken.source` factory as shown below: + +```js +const CancelToken = axios.CancelToken; +const source = CancelToken.source(); + +axios.get('/user/12345', { + cancelToken: source.token +}).catch(function (thrown) { + if (axios.isCancel(thrown)) { + console.log('Request canceled', thrown.message); + } else { + // handle error + } +}); + +axios.post('/user/12345', { + name: 'new name' +}, { + cancelToken: source.token +}) + +// cancel the request (the message parameter is optional) +source.cancel('Operation canceled by the user.'); +``` + +You can also create a cancel token by passing an executor function to the `CancelToken` constructor: + +```js +const CancelToken = axios.CancelToken; +let cancel; + +axios.get('/user/12345', { + cancelToken: new CancelToken(function executor(c) { + // An executor function receives a cancel function as a parameter + cancel = c; + }) +}); + +// cancel the request +cancel(); +``` + +> Note: you can cancel several requests with the same cancel token. +> If a cancellation token is already cancelled at the moment of starting an Axios request, then the request is cancelled immediately, without any attempts to make real request. + +## Using application/x-www-form-urlencoded format + +By default, axios serializes JavaScript objects to `JSON`. To send data in the `application/x-www-form-urlencoded` format instead, you can use one of the following options. + +### Browser + +In a browser, you can use the [`URLSearchParams`](https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams) API as follows: + +```js +const params = new URLSearchParams(); +params.append('param1', 'value1'); +params.append('param2', 'value2'); +axios.post('/foo', params); +``` + +> Note that `URLSearchParams` is not supported by all browsers (see [caniuse.com](http://www.caniuse.com/#feat=urlsearchparams)), but there is a [polyfill](https://github.com/WebReflection/url-search-params) available (make sure to polyfill the global environment). + +Alternatively, you can encode data using the [`qs`](https://github.com/ljharb/qs) library: + +```js +const qs = require('qs'); +axios.post('/foo', qs.stringify({ 'bar': 123 })); +``` + +Or in another way (ES6), + +```js +import qs from 'qs'; +const data = { 'bar': 123 }; +const options = { + method: 'POST', + headers: { 'content-type': 'application/x-www-form-urlencoded' }, + data: qs.stringify(data), + url, +}; +axios(options); +``` + +### Node.js + +#### Query string + +In node.js, you can use the [`querystring`](https://nodejs.org/api/querystring.html) module as follows: + +```js +const querystring = require('querystring'); +axios.post('http://something.com/', querystring.stringify({ foo: 'bar' })); +``` + +or ['URLSearchParams'](https://nodejs.org/api/url.html#url_class_urlsearchparams) from ['url module'](https://nodejs.org/api/url.html) as follows: + +```js +const url = require('url'); +const params = new url.URLSearchParams({ foo: 'bar' }); +axios.post('http://something.com/', params.toString()); +``` + +You can also use the [`qs`](https://github.com/ljharb/qs) library. + +###### NOTE +The `qs` library is preferable if you need to stringify nested objects, as the `querystring` method has known issues with that use case (https://github.com/nodejs/node-v0.x-archive/issues/1665). + +#### Form data + +In node.js, you can use the [`form-data`](https://github.com/form-data/form-data) library as follows: + +```js +const FormData = require('form-data'); + +const form = new FormData(); +form.append('my_field', 'my value'); +form.append('my_buffer', new Buffer(10)); +form.append('my_file', fs.createReadStream('/foo/bar.jpg')); + +axios.post('https://example.com', form, { headers: form.getHeaders() }) +``` + +Alternatively, use an interceptor: + +```js +axios.interceptors.request.use(config => { + if (config.data instanceof FormData) { + Object.assign(config.headers, config.data.getHeaders()); + } + return config; +}); +``` + +## Semver + +Until axios reaches a `1.0` release, breaking changes will be released with a new minor version. For example `0.5.1`, and `0.5.4` will have the same API, but `0.6.0` will have breaking changes. + +## Promises + +axios depends on a native ES6 Promise implementation to be [supported](http://caniuse.com/promises). +If your environment doesn't support ES6 Promises, you can [polyfill](https://github.com/jakearchibald/es6-promise). + +## TypeScript + +axios includes [TypeScript](http://typescriptlang.org) definitions and a type guard for axios errors. + +```typescript +let user: User = null; +try { + const { data } = await axios.get('/user?ID=12345'); + user = data.userDetails; +} catch (error) { + if (axios.isAxiosError(error)) { + handleAxiosError(error); + } else { + handleUnexpectedError(error); + } +} +``` + +## Online one-click setup + +You can use Gitpod an online IDE(which is free for Open Source) for contributing or running the examples online. + +[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/axios/axios/blob/master/examples/server.js) + + +## Resources + +* [Changelog](https://github.com/axios/axios/blob/master/CHANGELOG.md) +* [Upgrade Guide](https://github.com/axios/axios/blob/master/UPGRADE_GUIDE.md) +* [Ecosystem](https://github.com/axios/axios/blob/master/ECOSYSTEM.md) +* [Contributing Guide](https://github.com/axios/axios/blob/master/CONTRIBUTING.md) +* [Code of Conduct](https://github.com/axios/axios/blob/master/CODE_OF_CONDUCT.md) + +## Credits + +axios is heavily inspired by the [$http service](https://docs.angularjs.org/api/ng/service/$http) provided in [Angular](https://angularjs.org/). Ultimately axios is an effort to provide a standalone `$http`-like service for use outside of Angular. + +## License + +[MIT](LICENSE) diff --git a/node_modules/dhn-api/node_modules/axios/SECURITY.md b/node_modules/dhn-api/node_modules/axios/SECURITY.md new file mode 100644 index 000000000..353df9a2f --- /dev/null +++ b/node_modules/dhn-api/node_modules/axios/SECURITY.md @@ -0,0 +1,5 @@ +# Security Policy + +## Reporting a Vulnerability + +Please report security issues to jasonsaayman@gmail.com diff --git a/node_modules/dhn-api/node_modules/axios/UPGRADE_GUIDE.md b/node_modules/dhn-api/node_modules/axios/UPGRADE_GUIDE.md new file mode 100644 index 000000000..745e80492 --- /dev/null +++ b/node_modules/dhn-api/node_modules/axios/UPGRADE_GUIDE.md @@ -0,0 +1,162 @@ +# Upgrade Guide + +### 0.15.x -> 0.16.0 + +#### `Promise` Type Declarations + +The `Promise` type declarations have been removed from the axios typings in favor of the built-in type declarations. If you use axios in a TypeScript project that targets `ES5`, please make sure to include the `es2015.promise` lib. Please see [this post](https://blog.mariusschulz.com/2016/11/25/typescript-2-0-built-in-type-declarations) for details. + +### 0.13.x -> 0.14.0 + +#### TypeScript Definitions + +The axios TypeScript definitions have been updated to match the axios API and use the ES2015 module syntax. + +Please use the following `import` statement to import axios in TypeScript: + +```typescript +import axios from 'axios'; + +axios.get('/foo') + .then(response => console.log(response)) + .catch(error => console.log(error)); +``` + +#### `agent` Config Option + +The `agent` config option has been replaced with two new options: `httpAgent` and `httpsAgent`. Please use them instead. + +```js +{ + // Define a custom agent for HTTP + httpAgent: new http.Agent({ keepAlive: true }), + // Define a custom agent for HTTPS + httpsAgent: new https.Agent({ keepAlive: true }) +} +``` + +#### `progress` Config Option + +The `progress` config option has been replaced with the `onUploadProgress` and `onDownloadProgress` options. + +```js +{ + // Define a handler for upload progress events + onUploadProgress: function (progressEvent) { + // ... + }, + + // Define a handler for download progress events + onDownloadProgress: function (progressEvent) { + // ... + } +} +``` + +### 0.12.x -> 0.13.0 + +The `0.13.0` release contains several changes to custom adapters and error handling. + +#### Error Handling + +Previous to this release an error could either be a server response with bad status code or an actual `Error`. With this release Promise will always reject with an `Error`. In the case that a response was received, the `Error` will also include the response. + +```js +axios.get('/user/12345') + .catch((error) => { + console.log(error.message); + console.log(error.code); // Not always specified + console.log(error.config); // The config that was used to make the request + console.log(error.response); // Only available if response was received from the server + }); +``` + +#### Request Adapters + +This release changes a few things about how request adapters work. Please take note if you are using your own custom adapter. + +1. Response transformer is now called outside of adapter. +2. Request adapter returns a `Promise`. + +This means that you no longer need to invoke `transformData` on response data. You will also no longer receive `resolve` and `reject` as arguments in your adapter. + +Previous code: + +```js +function myAdapter(resolve, reject, config) { + var response = { + data: transformData( + responseData, + responseHeaders, + config.transformResponse + ), + status: request.status, + statusText: request.statusText, + headers: responseHeaders + }; + settle(resolve, reject, response); +} +``` + +New code: + +```js +function myAdapter(config) { + return new Promise(function (resolve, reject) { + var response = { + data: responseData, + status: request.status, + statusText: request.statusText, + headers: responseHeaders + }; + settle(resolve, reject, response); + }); +} +``` + +See the related commits for more details: +- [Response transformers](https://github.com/axios/axios/commit/10eb23865101f9347570552c04e9d6211376e25e) +- [Request adapter Promise](https://github.com/axios/axios/commit/157efd5615890301824e3121cc6c9d2f9b21f94a) + +### 0.5.x -> 0.6.0 + +The `0.6.0` release contains mostly bug fixes, but there are a couple things to be aware of when upgrading. + +#### ES6 Promise Polyfill + +Up until the `0.6.0` release ES6 `Promise` was being polyfilled using [es6-promise](https://github.com/jakearchibald/es6-promise). With this release, the polyfill has been removed, and you will need to supply it yourself if your environment needs it. + +```js +require('es6-promise').polyfill(); +var axios = require('axios'); +``` + +This will polyfill the global environment, and only needs to be done once. + +#### `axios.success`/`axios.error` + +The `success`, and `error` aliases were deprecated in [0.4.0](https://github.com/axios/axios/blob/master/CHANGELOG.md#040-oct-03-2014). As of this release they have been removed entirely. Instead please use `axios.then`, and `axios.catch` respectively. + +```js +axios.get('some/url') + .then(function (res) { + /* ... */ + }) + .catch(function (err) { + /* ... */ + }); +``` + +#### UMD + +Previous versions of axios shipped with an AMD, CommonJS, and Global build. This has all been rolled into a single UMD build. + +```js +// AMD +require(['bower_components/axios/dist/axios'], function (axios) { + /* ... */ +}); + +// CommonJS +var axios = require('axios/dist/axios'); +``` diff --git a/node_modules/dhn-api/node_modules/axios/dist/axios.js b/node_modules/dhn-api/node_modules/axios/dist/axios.js new file mode 100644 index 000000000..f25391064 --- /dev/null +++ b/node_modules/dhn-api/node_modules/axios/dist/axios.js @@ -0,0 +1,2193 @@ +/* axios v0.21.4 | (c) 2021 by Matt Zabriskie */ +(function webpackUniversalModuleDefinition(root, factory) { + if(typeof exports === 'object' && typeof module === 'object') + module.exports = factory(); + else if(typeof define === 'function' && define.amd) + define([], factory); + else if(typeof exports === 'object') + exports["axios"] = factory(); + else + root["axios"] = factory(); +})(window, function() { +return /******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) { +/******/ return installedModules[moduleId].exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ i: moduleId, +/******/ l: false, +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __webpack_require__.c = installedModules; +/******/ +/******/ // define getter function for harmony exports +/******/ __webpack_require__.d = function(exports, name, getter) { +/******/ if(!__webpack_require__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); +/******/ } +/******/ }; +/******/ +/******/ // define __esModule on exports +/******/ __webpack_require__.r = function(exports) { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ +/******/ // create a fake namespace object +/******/ // mode & 1: value is a module id, require it +/******/ // mode & 2: merge all properties of value into the ns +/******/ // mode & 4: return value when already ns object +/******/ // mode & 8|1: behave like require +/******/ __webpack_require__.t = function(value, mode) { +/******/ if(mode & 1) value = __webpack_require__(value); +/******/ if(mode & 8) return value; +/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; +/******/ var ns = Object.create(null); +/******/ __webpack_require__.r(ns); +/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); +/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); +/******/ return ns; +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __webpack_require__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __webpack_require__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = ""; +/******/ +/******/ +/******/ // Load entry module and return exports +/******/ return __webpack_require__(__webpack_require__.s = "./index.js"); +/******/ }) +/************************************************************************/ +/******/ ({ + +/***/ "./index.js": +/*!******************!*\ + !*** ./index.js ***! + \******************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +module.exports = __webpack_require__(/*! ./lib/axios */ "./lib/axios.js"); + +/***/ }), + +/***/ "./lib/adapters/xhr.js": +/*!*****************************!*\ + !*** ./lib/adapters/xhr.js ***! + \*****************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var utils = __webpack_require__(/*! ./../utils */ "./lib/utils.js"); +var settle = __webpack_require__(/*! ./../core/settle */ "./lib/core/settle.js"); +var cookies = __webpack_require__(/*! ./../helpers/cookies */ "./lib/helpers/cookies.js"); +var buildURL = __webpack_require__(/*! ./../helpers/buildURL */ "./lib/helpers/buildURL.js"); +var buildFullPath = __webpack_require__(/*! ../core/buildFullPath */ "./lib/core/buildFullPath.js"); +var parseHeaders = __webpack_require__(/*! ./../helpers/parseHeaders */ "./lib/helpers/parseHeaders.js"); +var isURLSameOrigin = __webpack_require__(/*! ./../helpers/isURLSameOrigin */ "./lib/helpers/isURLSameOrigin.js"); +var createError = __webpack_require__(/*! ../core/createError */ "./lib/core/createError.js"); + +module.exports = function xhrAdapter(config) { + return new Promise(function dispatchXhrRequest(resolve, reject) { + var requestData = config.data; + var requestHeaders = config.headers; + var responseType = config.responseType; + + if (utils.isFormData(requestData)) { + delete requestHeaders['Content-Type']; // Let the browser set it + } + + var request = new XMLHttpRequest(); + + // HTTP basic authentication + if (config.auth) { + var username = config.auth.username || ''; + var password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : ''; + requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password); + } + + var fullPath = buildFullPath(config.baseURL, config.url); + request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true); + + // Set the request timeout in MS + request.timeout = config.timeout; + + function onloadend() { + if (!request) { + return; + } + // Prepare the response + var responseHeaders = 'getAllResponseHeaders' in request ? parseHeaders(request.getAllResponseHeaders()) : null; + var responseData = !responseType || responseType === 'text' || responseType === 'json' ? + request.responseText : request.response; + var response = { + data: responseData, + status: request.status, + statusText: request.statusText, + headers: responseHeaders, + config: config, + request: request + }; + + settle(resolve, reject, response); + + // Clean up request + request = null; + } + + if ('onloadend' in request) { + // Use onloadend if available + request.onloadend = onloadend; + } else { + // Listen for ready state to emulate onloadend + request.onreadystatechange = function handleLoad() { + if (!request || request.readyState !== 4) { + return; + } + + // The request errored out and we didn't get a response, this will be + // handled by onerror instead + // With one exception: request that using file: protocol, most browsers + // will return status as 0 even though it's a successful request + if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) { + return; + } + // readystate handler is calling before onerror or ontimeout handlers, + // so we should call onloadend on the next 'tick' + setTimeout(onloadend); + }; + } + + // Handle browser request cancellation (as opposed to a manual cancellation) + request.onabort = function handleAbort() { + if (!request) { + return; + } + + reject(createError('Request aborted', config, 'ECONNABORTED', request)); + + // Clean up request + request = null; + }; + + // Handle low level network errors + request.onerror = function handleError() { + // Real errors are hidden from us by the browser + // onerror should only fire if it's a network error + reject(createError('Network Error', config, null, request)); + + // Clean up request + request = null; + }; + + // Handle timeout + request.ontimeout = function handleTimeout() { + var timeoutErrorMessage = 'timeout of ' + config.timeout + 'ms exceeded'; + if (config.timeoutErrorMessage) { + timeoutErrorMessage = config.timeoutErrorMessage; + } + reject(createError( + timeoutErrorMessage, + config, + config.transitional && config.transitional.clarifyTimeoutError ? 'ETIMEDOUT' : 'ECONNABORTED', + request)); + + // Clean up request + request = null; + }; + + // Add xsrf header + // This is only done if running in a standard browser environment. + // Specifically not if we're in a web worker, or react-native. + if (utils.isStandardBrowserEnv()) { + // Add xsrf header + var xsrfValue = (config.withCredentials || isURLSameOrigin(fullPath)) && config.xsrfCookieName ? + cookies.read(config.xsrfCookieName) : + undefined; + + if (xsrfValue) { + requestHeaders[config.xsrfHeaderName] = xsrfValue; + } + } + + // Add headers to the request + if ('setRequestHeader' in request) { + utils.forEach(requestHeaders, function setRequestHeader(val, key) { + if (typeof requestData === 'undefined' && key.toLowerCase() === 'content-type') { + // Remove Content-Type if data is undefined + delete requestHeaders[key]; + } else { + // Otherwise add header to the request + request.setRequestHeader(key, val); + } + }); + } + + // Add withCredentials to request if needed + if (!utils.isUndefined(config.withCredentials)) { + request.withCredentials = !!config.withCredentials; + } + + // Add responseType to request if needed + if (responseType && responseType !== 'json') { + request.responseType = config.responseType; + } + + // Handle progress if needed + if (typeof config.onDownloadProgress === 'function') { + request.addEventListener('progress', config.onDownloadProgress); + } + + // Not all browsers support upload events + if (typeof config.onUploadProgress === 'function' && request.upload) { + request.upload.addEventListener('progress', config.onUploadProgress); + } + + if (config.cancelToken) { + // Handle cancellation + config.cancelToken.promise.then(function onCanceled(cancel) { + if (!request) { + return; + } + + request.abort(); + reject(cancel); + // Clean up request + request = null; + }); + } + + if (!requestData) { + requestData = null; + } + + // Send the request + request.send(requestData); + }); +}; + + +/***/ }), + +/***/ "./lib/axios.js": +/*!**********************!*\ + !*** ./lib/axios.js ***! + \**********************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var utils = __webpack_require__(/*! ./utils */ "./lib/utils.js"); +var bind = __webpack_require__(/*! ./helpers/bind */ "./lib/helpers/bind.js"); +var Axios = __webpack_require__(/*! ./core/Axios */ "./lib/core/Axios.js"); +var mergeConfig = __webpack_require__(/*! ./core/mergeConfig */ "./lib/core/mergeConfig.js"); +var defaults = __webpack_require__(/*! ./defaults */ "./lib/defaults.js"); + +/** + * Create an instance of Axios + * + * @param {Object} defaultConfig The default config for the instance + * @return {Axios} A new instance of Axios + */ +function createInstance(defaultConfig) { + var context = new Axios(defaultConfig); + var instance = bind(Axios.prototype.request, context); + + // Copy axios.prototype to instance + utils.extend(instance, Axios.prototype, context); + + // Copy context to instance + utils.extend(instance, context); + + return instance; +} + +// Create the default instance to be exported +var axios = createInstance(defaults); + +// Expose Axios class to allow class inheritance +axios.Axios = Axios; + +// Factory for creating new instances +axios.create = function create(instanceConfig) { + return createInstance(mergeConfig(axios.defaults, instanceConfig)); +}; + +// Expose Cancel & CancelToken +axios.Cancel = __webpack_require__(/*! ./cancel/Cancel */ "./lib/cancel/Cancel.js"); +axios.CancelToken = __webpack_require__(/*! ./cancel/CancelToken */ "./lib/cancel/CancelToken.js"); +axios.isCancel = __webpack_require__(/*! ./cancel/isCancel */ "./lib/cancel/isCancel.js"); + +// Expose all/spread +axios.all = function all(promises) { + return Promise.all(promises); +}; +axios.spread = __webpack_require__(/*! ./helpers/spread */ "./lib/helpers/spread.js"); + +// Expose isAxiosError +axios.isAxiosError = __webpack_require__(/*! ./helpers/isAxiosError */ "./lib/helpers/isAxiosError.js"); + +module.exports = axios; + +// Allow use of default import syntax in TypeScript +module.exports.default = axios; + + +/***/ }), + +/***/ "./lib/cancel/Cancel.js": +/*!******************************!*\ + !*** ./lib/cancel/Cancel.js ***! + \******************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +/** + * A `Cancel` is an object that is thrown when an operation is canceled. + * + * @class + * @param {string=} message The message. + */ +function Cancel(message) { + this.message = message; +} + +Cancel.prototype.toString = function toString() { + return 'Cancel' + (this.message ? ': ' + this.message : ''); +}; + +Cancel.prototype.__CANCEL__ = true; + +module.exports = Cancel; + + +/***/ }), + +/***/ "./lib/cancel/CancelToken.js": +/*!***********************************!*\ + !*** ./lib/cancel/CancelToken.js ***! + \***********************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var Cancel = __webpack_require__(/*! ./Cancel */ "./lib/cancel/Cancel.js"); + +/** + * A `CancelToken` is an object that can be used to request cancellation of an operation. + * + * @class + * @param {Function} executor The executor function. + */ +function CancelToken(executor) { + if (typeof executor !== 'function') { + throw new TypeError('executor must be a function.'); + } + + var resolvePromise; + this.promise = new Promise(function promiseExecutor(resolve) { + resolvePromise = resolve; + }); + + var token = this; + executor(function cancel(message) { + if (token.reason) { + // Cancellation has already been requested + return; + } + + token.reason = new Cancel(message); + resolvePromise(token.reason); + }); +} + +/** + * Throws a `Cancel` if cancellation has been requested. + */ +CancelToken.prototype.throwIfRequested = function throwIfRequested() { + if (this.reason) { + throw this.reason; + } +}; + +/** + * Returns an object that contains a new `CancelToken` and a function that, when called, + * cancels the `CancelToken`. + */ +CancelToken.source = function source() { + var cancel; + var token = new CancelToken(function executor(c) { + cancel = c; + }); + return { + token: token, + cancel: cancel + }; +}; + +module.exports = CancelToken; + + +/***/ }), + +/***/ "./lib/cancel/isCancel.js": +/*!********************************!*\ + !*** ./lib/cancel/isCancel.js ***! + \********************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +module.exports = function isCancel(value) { + return !!(value && value.__CANCEL__); +}; + + +/***/ }), + +/***/ "./lib/core/Axios.js": +/*!***************************!*\ + !*** ./lib/core/Axios.js ***! + \***************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var utils = __webpack_require__(/*! ./../utils */ "./lib/utils.js"); +var buildURL = __webpack_require__(/*! ../helpers/buildURL */ "./lib/helpers/buildURL.js"); +var InterceptorManager = __webpack_require__(/*! ./InterceptorManager */ "./lib/core/InterceptorManager.js"); +var dispatchRequest = __webpack_require__(/*! ./dispatchRequest */ "./lib/core/dispatchRequest.js"); +var mergeConfig = __webpack_require__(/*! ./mergeConfig */ "./lib/core/mergeConfig.js"); +var validator = __webpack_require__(/*! ../helpers/validator */ "./lib/helpers/validator.js"); + +var validators = validator.validators; +/** + * Create a new instance of Axios + * + * @param {Object} instanceConfig The default config for the instance + */ +function Axios(instanceConfig) { + this.defaults = instanceConfig; + this.interceptors = { + request: new InterceptorManager(), + response: new InterceptorManager() + }; +} + +/** + * Dispatch a request + * + * @param {Object} config The config specific for this request (merged with this.defaults) + */ +Axios.prototype.request = function request(config) { + /*eslint no-param-reassign:0*/ + // Allow for axios('example/url'[, config]) a la fetch API + if (typeof config === 'string') { + config = arguments[1] || {}; + config.url = arguments[0]; + } else { + config = config || {}; + } + + config = mergeConfig(this.defaults, config); + + // Set config.method + if (config.method) { + config.method = config.method.toLowerCase(); + } else if (this.defaults.method) { + config.method = this.defaults.method.toLowerCase(); + } else { + config.method = 'get'; + } + + var transitional = config.transitional; + + if (transitional !== undefined) { + validator.assertOptions(transitional, { + silentJSONParsing: validators.transitional(validators.boolean, '1.0.0'), + forcedJSONParsing: validators.transitional(validators.boolean, '1.0.0'), + clarifyTimeoutError: validators.transitional(validators.boolean, '1.0.0') + }, false); + } + + // filter out skipped interceptors + var requestInterceptorChain = []; + var synchronousRequestInterceptors = true; + this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) { + if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) { + return; + } + + synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous; + + requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected); + }); + + var responseInterceptorChain = []; + this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) { + responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected); + }); + + var promise; + + if (!synchronousRequestInterceptors) { + var chain = [dispatchRequest, undefined]; + + Array.prototype.unshift.apply(chain, requestInterceptorChain); + chain = chain.concat(responseInterceptorChain); + + promise = Promise.resolve(config); + while (chain.length) { + promise = promise.then(chain.shift(), chain.shift()); + } + + return promise; + } + + + var newConfig = config; + while (requestInterceptorChain.length) { + var onFulfilled = requestInterceptorChain.shift(); + var onRejected = requestInterceptorChain.shift(); + try { + newConfig = onFulfilled(newConfig); + } catch (error) { + onRejected(error); + break; + } + } + + try { + promise = dispatchRequest(newConfig); + } catch (error) { + return Promise.reject(error); + } + + while (responseInterceptorChain.length) { + promise = promise.then(responseInterceptorChain.shift(), responseInterceptorChain.shift()); + } + + return promise; +}; + +Axios.prototype.getUri = function getUri(config) { + config = mergeConfig(this.defaults, config); + return buildURL(config.url, config.params, config.paramsSerializer).replace(/^\?/, ''); +}; + +// Provide aliases for supported request methods +utils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) { + /*eslint func-names:0*/ + Axios.prototype[method] = function(url, config) { + return this.request(mergeConfig(config || {}, { + method: method, + url: url, + data: (config || {}).data + })); + }; +}); + +utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) { + /*eslint func-names:0*/ + Axios.prototype[method] = function(url, data, config) { + return this.request(mergeConfig(config || {}, { + method: method, + url: url, + data: data + })); + }; +}); + +module.exports = Axios; + + +/***/ }), + +/***/ "./lib/core/InterceptorManager.js": +/*!****************************************!*\ + !*** ./lib/core/InterceptorManager.js ***! + \****************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var utils = __webpack_require__(/*! ./../utils */ "./lib/utils.js"); + +function InterceptorManager() { + this.handlers = []; +} + +/** + * Add a new interceptor to the stack + * + * @param {Function} fulfilled The function to handle `then` for a `Promise` + * @param {Function} rejected The function to handle `reject` for a `Promise` + * + * @return {Number} An ID used to remove interceptor later + */ +InterceptorManager.prototype.use = function use(fulfilled, rejected, options) { + this.handlers.push({ + fulfilled: fulfilled, + rejected: rejected, + synchronous: options ? options.synchronous : false, + runWhen: options ? options.runWhen : null + }); + return this.handlers.length - 1; +}; + +/** + * Remove an interceptor from the stack + * + * @param {Number} id The ID that was returned by `use` + */ +InterceptorManager.prototype.eject = function eject(id) { + if (this.handlers[id]) { + this.handlers[id] = null; + } +}; + +/** + * Iterate over all the registered interceptors + * + * This method is particularly useful for skipping over any + * interceptors that may have become `null` calling `eject`. + * + * @param {Function} fn The function to call for each interceptor + */ +InterceptorManager.prototype.forEach = function forEach(fn) { + utils.forEach(this.handlers, function forEachHandler(h) { + if (h !== null) { + fn(h); + } + }); +}; + +module.exports = InterceptorManager; + + +/***/ }), + +/***/ "./lib/core/buildFullPath.js": +/*!***********************************!*\ + !*** ./lib/core/buildFullPath.js ***! + \***********************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var isAbsoluteURL = __webpack_require__(/*! ../helpers/isAbsoluteURL */ "./lib/helpers/isAbsoluteURL.js"); +var combineURLs = __webpack_require__(/*! ../helpers/combineURLs */ "./lib/helpers/combineURLs.js"); + +/** + * Creates a new URL by combining the baseURL with the requestedURL, + * only when the requestedURL is not already an absolute URL. + * If the requestURL is absolute, this function returns the requestedURL untouched. + * + * @param {string} baseURL The base URL + * @param {string} requestedURL Absolute or relative URL to combine + * @returns {string} The combined full path + */ +module.exports = function buildFullPath(baseURL, requestedURL) { + if (baseURL && !isAbsoluteURL(requestedURL)) { + return combineURLs(baseURL, requestedURL); + } + return requestedURL; +}; + + +/***/ }), + +/***/ "./lib/core/createError.js": +/*!*********************************!*\ + !*** ./lib/core/createError.js ***! + \*********************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var enhanceError = __webpack_require__(/*! ./enhanceError */ "./lib/core/enhanceError.js"); + +/** + * Create an Error with the specified message, config, error code, request and response. + * + * @param {string} message The error message. + * @param {Object} config The config. + * @param {string} [code] The error code (for example, 'ECONNABORTED'). + * @param {Object} [request] The request. + * @param {Object} [response] The response. + * @returns {Error} The created error. + */ +module.exports = function createError(message, config, code, request, response) { + var error = new Error(message); + return enhanceError(error, config, code, request, response); +}; + + +/***/ }), + +/***/ "./lib/core/dispatchRequest.js": +/*!*************************************!*\ + !*** ./lib/core/dispatchRequest.js ***! + \*************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var utils = __webpack_require__(/*! ./../utils */ "./lib/utils.js"); +var transformData = __webpack_require__(/*! ./transformData */ "./lib/core/transformData.js"); +var isCancel = __webpack_require__(/*! ../cancel/isCancel */ "./lib/cancel/isCancel.js"); +var defaults = __webpack_require__(/*! ../defaults */ "./lib/defaults.js"); + +/** + * Throws a `Cancel` if cancellation has been requested. + */ +function throwIfCancellationRequested(config) { + if (config.cancelToken) { + config.cancelToken.throwIfRequested(); + } +} + +/** + * Dispatch a request to the server using the configured adapter. + * + * @param {object} config The config that is to be used for the request + * @returns {Promise} The Promise to be fulfilled + */ +module.exports = function dispatchRequest(config) { + throwIfCancellationRequested(config); + + // Ensure headers exist + config.headers = config.headers || {}; + + // Transform request data + config.data = transformData.call( + config, + config.data, + config.headers, + config.transformRequest + ); + + // Flatten headers + config.headers = utils.merge( + config.headers.common || {}, + config.headers[config.method] || {}, + config.headers + ); + + utils.forEach( + ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'], + function cleanHeaderConfig(method) { + delete config.headers[method]; + } + ); + + var adapter = config.adapter || defaults.adapter; + + return adapter(config).then(function onAdapterResolution(response) { + throwIfCancellationRequested(config); + + // Transform response data + response.data = transformData.call( + config, + response.data, + response.headers, + config.transformResponse + ); + + return response; + }, function onAdapterRejection(reason) { + if (!isCancel(reason)) { + throwIfCancellationRequested(config); + + // Transform response data + if (reason && reason.response) { + reason.response.data = transformData.call( + config, + reason.response.data, + reason.response.headers, + config.transformResponse + ); + } + } + + return Promise.reject(reason); + }); +}; + + +/***/ }), + +/***/ "./lib/core/enhanceError.js": +/*!**********************************!*\ + !*** ./lib/core/enhanceError.js ***! + \**********************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +/** + * Update an Error with the specified config, error code, and response. + * + * @param {Error} error The error to update. + * @param {Object} config The config. + * @param {string} [code] The error code (for example, 'ECONNABORTED'). + * @param {Object} [request] The request. + * @param {Object} [response] The response. + * @returns {Error} The error. + */ +module.exports = function enhanceError(error, config, code, request, response) { + error.config = config; + if (code) { + error.code = code; + } + + error.request = request; + error.response = response; + error.isAxiosError = true; + + error.toJSON = function toJSON() { + return { + // Standard + message: this.message, + name: this.name, + // Microsoft + description: this.description, + number: this.number, + // Mozilla + fileName: this.fileName, + lineNumber: this.lineNumber, + columnNumber: this.columnNumber, + stack: this.stack, + // Axios + config: this.config, + code: this.code + }; + }; + return error; +}; + + +/***/ }), + +/***/ "./lib/core/mergeConfig.js": +/*!*********************************!*\ + !*** ./lib/core/mergeConfig.js ***! + \*********************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var utils = __webpack_require__(/*! ../utils */ "./lib/utils.js"); + +/** + * Config-specific merge-function which creates a new config-object + * by merging two configuration objects together. + * + * @param {Object} config1 + * @param {Object} config2 + * @returns {Object} New object resulting from merging config2 to config1 + */ +module.exports = function mergeConfig(config1, config2) { + // eslint-disable-next-line no-param-reassign + config2 = config2 || {}; + var config = {}; + + var valueFromConfig2Keys = ['url', 'method', 'data']; + var mergeDeepPropertiesKeys = ['headers', 'auth', 'proxy', 'params']; + var defaultToConfig2Keys = [ + 'baseURL', 'transformRequest', 'transformResponse', 'paramsSerializer', + 'timeout', 'timeoutMessage', 'withCredentials', 'adapter', 'responseType', 'xsrfCookieName', + 'xsrfHeaderName', 'onUploadProgress', 'onDownloadProgress', 'decompress', + 'maxContentLength', 'maxBodyLength', 'maxRedirects', 'transport', 'httpAgent', + 'httpsAgent', 'cancelToken', 'socketPath', 'responseEncoding' + ]; + var directMergeKeys = ['validateStatus']; + + function getMergedValue(target, source) { + if (utils.isPlainObject(target) && utils.isPlainObject(source)) { + return utils.merge(target, source); + } else if (utils.isPlainObject(source)) { + return utils.merge({}, source); + } else if (utils.isArray(source)) { + return source.slice(); + } + return source; + } + + function mergeDeepProperties(prop) { + if (!utils.isUndefined(config2[prop])) { + config[prop] = getMergedValue(config1[prop], config2[prop]); + } else if (!utils.isUndefined(config1[prop])) { + config[prop] = getMergedValue(undefined, config1[prop]); + } + } + + utils.forEach(valueFromConfig2Keys, function valueFromConfig2(prop) { + if (!utils.isUndefined(config2[prop])) { + config[prop] = getMergedValue(undefined, config2[prop]); + } + }); + + utils.forEach(mergeDeepPropertiesKeys, mergeDeepProperties); + + utils.forEach(defaultToConfig2Keys, function defaultToConfig2(prop) { + if (!utils.isUndefined(config2[prop])) { + config[prop] = getMergedValue(undefined, config2[prop]); + } else if (!utils.isUndefined(config1[prop])) { + config[prop] = getMergedValue(undefined, config1[prop]); + } + }); + + utils.forEach(directMergeKeys, function merge(prop) { + if (prop in config2) { + config[prop] = getMergedValue(config1[prop], config2[prop]); + } else if (prop in config1) { + config[prop] = getMergedValue(undefined, config1[prop]); + } + }); + + var axiosKeys = valueFromConfig2Keys + .concat(mergeDeepPropertiesKeys) + .concat(defaultToConfig2Keys) + .concat(directMergeKeys); + + var otherKeys = Object + .keys(config1) + .concat(Object.keys(config2)) + .filter(function filterAxiosKeys(key) { + return axiosKeys.indexOf(key) === -1; + }); + + utils.forEach(otherKeys, mergeDeepProperties); + + return config; +}; + + +/***/ }), + +/***/ "./lib/core/settle.js": +/*!****************************!*\ + !*** ./lib/core/settle.js ***! + \****************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var createError = __webpack_require__(/*! ./createError */ "./lib/core/createError.js"); + +/** + * Resolve or reject a Promise based on response status. + * + * @param {Function} resolve A function that resolves the promise. + * @param {Function} reject A function that rejects the promise. + * @param {object} response The response. + */ +module.exports = function settle(resolve, reject, response) { + var validateStatus = response.config.validateStatus; + if (!response.status || !validateStatus || validateStatus(response.status)) { + resolve(response); + } else { + reject(createError( + 'Request failed with status code ' + response.status, + response.config, + null, + response.request, + response + )); + } +}; + + +/***/ }), + +/***/ "./lib/core/transformData.js": +/*!***********************************!*\ + !*** ./lib/core/transformData.js ***! + \***********************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var utils = __webpack_require__(/*! ./../utils */ "./lib/utils.js"); +var defaults = __webpack_require__(/*! ./../defaults */ "./lib/defaults.js"); + +/** + * Transform the data for a request or a response + * + * @param {Object|String} data The data to be transformed + * @param {Array} headers The headers for the request or response + * @param {Array|Function} fns A single function or Array of functions + * @returns {*} The resulting transformed data + */ +module.exports = function transformData(data, headers, fns) { + var context = this || defaults; + /*eslint no-param-reassign:0*/ + utils.forEach(fns, function transform(fn) { + data = fn.call(context, data, headers); + }); + + return data; +}; + + +/***/ }), + +/***/ "./lib/defaults.js": +/*!*************************!*\ + !*** ./lib/defaults.js ***! + \*************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var utils = __webpack_require__(/*! ./utils */ "./lib/utils.js"); +var normalizeHeaderName = __webpack_require__(/*! ./helpers/normalizeHeaderName */ "./lib/helpers/normalizeHeaderName.js"); +var enhanceError = __webpack_require__(/*! ./core/enhanceError */ "./lib/core/enhanceError.js"); + +var DEFAULT_CONTENT_TYPE = { + 'Content-Type': 'application/x-www-form-urlencoded' +}; + +function setContentTypeIfUnset(headers, value) { + if (!utils.isUndefined(headers) && utils.isUndefined(headers['Content-Type'])) { + headers['Content-Type'] = value; + } +} + +function getDefaultAdapter() { + var adapter; + if (typeof XMLHttpRequest !== 'undefined') { + // For browsers use XHR adapter + adapter = __webpack_require__(/*! ./adapters/xhr */ "./lib/adapters/xhr.js"); + } else if (typeof process !== 'undefined' && Object.prototype.toString.call(process) === '[object process]') { + // For node use HTTP adapter + adapter = __webpack_require__(/*! ./adapters/http */ "./lib/adapters/xhr.js"); + } + return adapter; +} + +function stringifySafely(rawValue, parser, encoder) { + if (utils.isString(rawValue)) { + try { + (parser || JSON.parse)(rawValue); + return utils.trim(rawValue); + } catch (e) { + if (e.name !== 'SyntaxError') { + throw e; + } + } + } + + return (encoder || JSON.stringify)(rawValue); +} + +var defaults = { + + transitional: { + silentJSONParsing: true, + forcedJSONParsing: true, + clarifyTimeoutError: false + }, + + adapter: getDefaultAdapter(), + + transformRequest: [function transformRequest(data, headers) { + normalizeHeaderName(headers, 'Accept'); + normalizeHeaderName(headers, 'Content-Type'); + + if (utils.isFormData(data) || + utils.isArrayBuffer(data) || + utils.isBuffer(data) || + utils.isStream(data) || + utils.isFile(data) || + utils.isBlob(data) + ) { + return data; + } + if (utils.isArrayBufferView(data)) { + return data.buffer; + } + if (utils.isURLSearchParams(data)) { + setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8'); + return data.toString(); + } + if (utils.isObject(data) || (headers && headers['Content-Type'] === 'application/json')) { + setContentTypeIfUnset(headers, 'application/json'); + return stringifySafely(data); + } + return data; + }], + + transformResponse: [function transformResponse(data) { + var transitional = this.transitional; + var silentJSONParsing = transitional && transitional.silentJSONParsing; + var forcedJSONParsing = transitional && transitional.forcedJSONParsing; + var strictJSONParsing = !silentJSONParsing && this.responseType === 'json'; + + if (strictJSONParsing || (forcedJSONParsing && utils.isString(data) && data.length)) { + try { + return JSON.parse(data); + } catch (e) { + if (strictJSONParsing) { + if (e.name === 'SyntaxError') { + throw enhanceError(e, this, 'E_JSON_PARSE'); + } + throw e; + } + } + } + + return data; + }], + + /** + * A timeout in milliseconds to abort a request. If set to 0 (default) a + * timeout is not created. + */ + timeout: 0, + + xsrfCookieName: 'XSRF-TOKEN', + xsrfHeaderName: 'X-XSRF-TOKEN', + + maxContentLength: -1, + maxBodyLength: -1, + + validateStatus: function validateStatus(status) { + return status >= 200 && status < 300; + } +}; + +defaults.headers = { + common: { + 'Accept': 'application/json, text/plain, */*' + } +}; + +utils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) { + defaults.headers[method] = {}; +}); + +utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) { + defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE); +}); + +module.exports = defaults; + + +/***/ }), + +/***/ "./lib/helpers/bind.js": +/*!*****************************!*\ + !*** ./lib/helpers/bind.js ***! + \*****************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +module.exports = function bind(fn, thisArg) { + return function wrap() { + var args = new Array(arguments.length); + for (var i = 0; i < args.length; i++) { + args[i] = arguments[i]; + } + return fn.apply(thisArg, args); + }; +}; + + +/***/ }), + +/***/ "./lib/helpers/buildURL.js": +/*!*********************************!*\ + !*** ./lib/helpers/buildURL.js ***! + \*********************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var utils = __webpack_require__(/*! ./../utils */ "./lib/utils.js"); + +function encode(val) { + return encodeURIComponent(val). + replace(/%3A/gi, ':'). + replace(/%24/g, '$'). + replace(/%2C/gi, ','). + replace(/%20/g, '+'). + replace(/%5B/gi, '['). + replace(/%5D/gi, ']'); +} + +/** + * Build a URL by appending params to the end + * + * @param {string} url The base of the url (e.g., http://www.google.com) + * @param {object} [params] The params to be appended + * @returns {string} The formatted url + */ +module.exports = function buildURL(url, params, paramsSerializer) { + /*eslint no-param-reassign:0*/ + if (!params) { + return url; + } + + var serializedParams; + if (paramsSerializer) { + serializedParams = paramsSerializer(params); + } else if (utils.isURLSearchParams(params)) { + serializedParams = params.toString(); + } else { + var parts = []; + + utils.forEach(params, function serialize(val, key) { + if (val === null || typeof val === 'undefined') { + return; + } + + if (utils.isArray(val)) { + key = key + '[]'; + } else { + val = [val]; + } + + utils.forEach(val, function parseValue(v) { + if (utils.isDate(v)) { + v = v.toISOString(); + } else if (utils.isObject(v)) { + v = JSON.stringify(v); + } + parts.push(encode(key) + '=' + encode(v)); + }); + }); + + serializedParams = parts.join('&'); + } + + if (serializedParams) { + var hashmarkIndex = url.indexOf('#'); + if (hashmarkIndex !== -1) { + url = url.slice(0, hashmarkIndex); + } + + url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams; + } + + return url; +}; + + +/***/ }), + +/***/ "./lib/helpers/combineURLs.js": +/*!************************************!*\ + !*** ./lib/helpers/combineURLs.js ***! + \************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +/** + * Creates a new URL by combining the specified URLs + * + * @param {string} baseURL The base URL + * @param {string} relativeURL The relative URL + * @returns {string} The combined URL + */ +module.exports = function combineURLs(baseURL, relativeURL) { + return relativeURL + ? baseURL.replace(/\/+$/, '') + '/' + relativeURL.replace(/^\/+/, '') + : baseURL; +}; + + +/***/ }), + +/***/ "./lib/helpers/cookies.js": +/*!********************************!*\ + !*** ./lib/helpers/cookies.js ***! + \********************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var utils = __webpack_require__(/*! ./../utils */ "./lib/utils.js"); + +module.exports = ( + utils.isStandardBrowserEnv() ? + + // Standard browser envs support document.cookie + (function standardBrowserEnv() { + return { + write: function write(name, value, expires, path, domain, secure) { + var cookie = []; + cookie.push(name + '=' + encodeURIComponent(value)); + + if (utils.isNumber(expires)) { + cookie.push('expires=' + new Date(expires).toGMTString()); + } + + if (utils.isString(path)) { + cookie.push('path=' + path); + } + + if (utils.isString(domain)) { + cookie.push('domain=' + domain); + } + + if (secure === true) { + cookie.push('secure'); + } + + document.cookie = cookie.join('; '); + }, + + read: function read(name) { + var match = document.cookie.match(new RegExp('(^|;\\s*)(' + name + ')=([^;]*)')); + return (match ? decodeURIComponent(match[3]) : null); + }, + + remove: function remove(name) { + this.write(name, '', Date.now() - 86400000); + } + }; + })() : + + // Non standard browser env (web workers, react-native) lack needed support. + (function nonStandardBrowserEnv() { + return { + write: function write() {}, + read: function read() { return null; }, + remove: function remove() {} + }; + })() +); + + +/***/ }), + +/***/ "./lib/helpers/isAbsoluteURL.js": +/*!**************************************!*\ + !*** ./lib/helpers/isAbsoluteURL.js ***! + \**************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +/** + * Determines whether the specified URL is absolute + * + * @param {string} url The URL to test + * @returns {boolean} True if the specified URL is absolute, otherwise false + */ +module.exports = function isAbsoluteURL(url) { + // A URL is considered absolute if it begins with "://" or "//" (protocol-relative URL). + // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed + // by any combination of letters, digits, plus, period, or hyphen. + return /^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(url); +}; + + +/***/ }), + +/***/ "./lib/helpers/isAxiosError.js": +/*!*************************************!*\ + !*** ./lib/helpers/isAxiosError.js ***! + \*************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +/** + * Determines whether the payload is an error thrown by Axios + * + * @param {*} payload The value to test + * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false + */ +module.exports = function isAxiosError(payload) { + return (typeof payload === 'object') && (payload.isAxiosError === true); +}; + + +/***/ }), + +/***/ "./lib/helpers/isURLSameOrigin.js": +/*!****************************************!*\ + !*** ./lib/helpers/isURLSameOrigin.js ***! + \****************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var utils = __webpack_require__(/*! ./../utils */ "./lib/utils.js"); + +module.exports = ( + utils.isStandardBrowserEnv() ? + + // Standard browser envs have full support of the APIs needed to test + // whether the request URL is of the same origin as current location. + (function standardBrowserEnv() { + var msie = /(msie|trident)/i.test(navigator.userAgent); + var urlParsingNode = document.createElement('a'); + var originURL; + + /** + * Parse a URL to discover it's components + * + * @param {String} url The URL to be parsed + * @returns {Object} + */ + function resolveURL(url) { + var href = url; + + if (msie) { + // IE needs attribute set twice to normalize properties + urlParsingNode.setAttribute('href', href); + href = urlParsingNode.href; + } + + urlParsingNode.setAttribute('href', href); + + // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils + return { + href: urlParsingNode.href, + protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '', + host: urlParsingNode.host, + search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, '') : '', + hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '', + hostname: urlParsingNode.hostname, + port: urlParsingNode.port, + pathname: (urlParsingNode.pathname.charAt(0) === '/') ? + urlParsingNode.pathname : + '/' + urlParsingNode.pathname + }; + } + + originURL = resolveURL(window.location.href); + + /** + * Determine if a URL shares the same origin as the current location + * + * @param {String} requestURL The URL to test + * @returns {boolean} True if URL shares the same origin, otherwise false + */ + return function isURLSameOrigin(requestURL) { + var parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL; + return (parsed.protocol === originURL.protocol && + parsed.host === originURL.host); + }; + })() : + + // Non standard browser envs (web workers, react-native) lack needed support. + (function nonStandardBrowserEnv() { + return function isURLSameOrigin() { + return true; + }; + })() +); + + +/***/ }), + +/***/ "./lib/helpers/normalizeHeaderName.js": +/*!********************************************!*\ + !*** ./lib/helpers/normalizeHeaderName.js ***! + \********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var utils = __webpack_require__(/*! ../utils */ "./lib/utils.js"); + +module.exports = function normalizeHeaderName(headers, normalizedName) { + utils.forEach(headers, function processHeader(value, name) { + if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) { + headers[normalizedName] = value; + delete headers[name]; + } + }); +}; + + +/***/ }), + +/***/ "./lib/helpers/parseHeaders.js": +/*!*************************************!*\ + !*** ./lib/helpers/parseHeaders.js ***! + \*************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var utils = __webpack_require__(/*! ./../utils */ "./lib/utils.js"); + +// Headers whose duplicates are ignored by node +// c.f. https://nodejs.org/api/http.html#http_message_headers +var ignoreDuplicateOf = [ + 'age', 'authorization', 'content-length', 'content-type', 'etag', + 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since', + 'last-modified', 'location', 'max-forwards', 'proxy-authorization', + 'referer', 'retry-after', 'user-agent' +]; + +/** + * Parse headers into an object + * + * ``` + * Date: Wed, 27 Aug 2014 08:58:49 GMT + * Content-Type: application/json + * Connection: keep-alive + * Transfer-Encoding: chunked + * ``` + * + * @param {String} headers Headers needing to be parsed + * @returns {Object} Headers parsed into an object + */ +module.exports = function parseHeaders(headers) { + var parsed = {}; + var key; + var val; + var i; + + if (!headers) { return parsed; } + + utils.forEach(headers.split('\n'), function parser(line) { + i = line.indexOf(':'); + key = utils.trim(line.substr(0, i)).toLowerCase(); + val = utils.trim(line.substr(i + 1)); + + if (key) { + if (parsed[key] && ignoreDuplicateOf.indexOf(key) >= 0) { + return; + } + if (key === 'set-cookie') { + parsed[key] = (parsed[key] ? parsed[key] : []).concat([val]); + } else { + parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val; + } + } + }); + + return parsed; +}; + + +/***/ }), + +/***/ "./lib/helpers/spread.js": +/*!*******************************!*\ + !*** ./lib/helpers/spread.js ***! + \*******************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +/** + * Syntactic sugar for invoking a function and expanding an array for arguments. + * + * Common use case would be to use `Function.prototype.apply`. + * + * ```js + * function f(x, y, z) {} + * var args = [1, 2, 3]; + * f.apply(null, args); + * ``` + * + * With `spread` this example can be re-written. + * + * ```js + * spread(function(x, y, z) {})([1, 2, 3]); + * ``` + * + * @param {Function} callback + * @returns {Function} + */ +module.exports = function spread(callback) { + return function wrap(arr) { + return callback.apply(null, arr); + }; +}; + + +/***/ }), + +/***/ "./lib/helpers/validator.js": +/*!**********************************!*\ + !*** ./lib/helpers/validator.js ***! + \**********************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var pkg = __webpack_require__(/*! ./../../package.json */ "./package.json"); + +var validators = {}; + +// eslint-disable-next-line func-names +['object', 'boolean', 'number', 'function', 'string', 'symbol'].forEach(function(type, i) { + validators[type] = function validator(thing) { + return typeof thing === type || 'a' + (i < 1 ? 'n ' : ' ') + type; + }; +}); + +var deprecatedWarnings = {}; +var currentVerArr = pkg.version.split('.'); + +/** + * Compare package versions + * @param {string} version + * @param {string?} thanVersion + * @returns {boolean} + */ +function isOlderVersion(version, thanVersion) { + var pkgVersionArr = thanVersion ? thanVersion.split('.') : currentVerArr; + var destVer = version.split('.'); + for (var i = 0; i < 3; i++) { + if (pkgVersionArr[i] > destVer[i]) { + return true; + } else if (pkgVersionArr[i] < destVer[i]) { + return false; + } + } + return false; +} + +/** + * Transitional option validator + * @param {function|boolean?} validator + * @param {string?} version + * @param {string} message + * @returns {function} + */ +validators.transitional = function transitional(validator, version, message) { + var isDeprecated = version && isOlderVersion(version); + + function formatMessage(opt, desc) { + return '[Axios v' + pkg.version + '] Transitional option \'' + opt + '\'' + desc + (message ? '. ' + message : ''); + } + + // eslint-disable-next-line func-names + return function(value, opt, opts) { + if (validator === false) { + throw new Error(formatMessage(opt, ' has been removed in ' + version)); + } + + if (isDeprecated && !deprecatedWarnings[opt]) { + deprecatedWarnings[opt] = true; + // eslint-disable-next-line no-console + console.warn( + formatMessage( + opt, + ' has been deprecated since v' + version + ' and will be removed in the near future' + ) + ); + } + + return validator ? validator(value, opt, opts) : true; + }; +}; + +/** + * Assert object's properties type + * @param {object} options + * @param {object} schema + * @param {boolean?} allowUnknown + */ + +function assertOptions(options, schema, allowUnknown) { + if (typeof options !== 'object') { + throw new TypeError('options must be an object'); + } + var keys = Object.keys(options); + var i = keys.length; + while (i-- > 0) { + var opt = keys[i]; + var validator = schema[opt]; + if (validator) { + var value = options[opt]; + var result = value === undefined || validator(value, opt, options); + if (result !== true) { + throw new TypeError('option ' + opt + ' must be ' + result); + } + continue; + } + if (allowUnknown !== true) { + throw Error('Unknown option ' + opt); + } + } +} + +module.exports = { + isOlderVersion: isOlderVersion, + assertOptions: assertOptions, + validators: validators +}; + + +/***/ }), + +/***/ "./lib/utils.js": +/*!**********************!*\ + !*** ./lib/utils.js ***! + \**********************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var bind = __webpack_require__(/*! ./helpers/bind */ "./lib/helpers/bind.js"); + +// utils is a library of generic helper functions non-specific to axios + +var toString = Object.prototype.toString; + +/** + * Determine if a value is an Array + * + * @param {Object} val The value to test + * @returns {boolean} True if value is an Array, otherwise false + */ +function isArray(val) { + return toString.call(val) === '[object Array]'; +} + +/** + * Determine if a value is undefined + * + * @param {Object} val The value to test + * @returns {boolean} True if the value is undefined, otherwise false + */ +function isUndefined(val) { + return typeof val === 'undefined'; +} + +/** + * Determine if a value is a Buffer + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a Buffer, otherwise false + */ +function isBuffer(val) { + return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor) + && typeof val.constructor.isBuffer === 'function' && val.constructor.isBuffer(val); +} + +/** + * Determine if a value is an ArrayBuffer + * + * @param {Object} val The value to test + * @returns {boolean} True if value is an ArrayBuffer, otherwise false + */ +function isArrayBuffer(val) { + return toString.call(val) === '[object ArrayBuffer]'; +} + +/** + * Determine if a value is a FormData + * + * @param {Object} val The value to test + * @returns {boolean} True if value is an FormData, otherwise false + */ +function isFormData(val) { + return (typeof FormData !== 'undefined') && (val instanceof FormData); +} + +/** + * Determine if a value is a view on an ArrayBuffer + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false + */ +function isArrayBufferView(val) { + var result; + if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) { + result = ArrayBuffer.isView(val); + } else { + result = (val) && (val.buffer) && (val.buffer instanceof ArrayBuffer); + } + return result; +} + +/** + * Determine if a value is a String + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a String, otherwise false + */ +function isString(val) { + return typeof val === 'string'; +} + +/** + * Determine if a value is a Number + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a Number, otherwise false + */ +function isNumber(val) { + return typeof val === 'number'; +} + +/** + * Determine if a value is an Object + * + * @param {Object} val The value to test + * @returns {boolean} True if value is an Object, otherwise false + */ +function isObject(val) { + return val !== null && typeof val === 'object'; +} + +/** + * Determine if a value is a plain Object + * + * @param {Object} val The value to test + * @return {boolean} True if value is a plain Object, otherwise false + */ +function isPlainObject(val) { + if (toString.call(val) !== '[object Object]') { + return false; + } + + var prototype = Object.getPrototypeOf(val); + return prototype === null || prototype === Object.prototype; +} + +/** + * Determine if a value is a Date + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a Date, otherwise false + */ +function isDate(val) { + return toString.call(val) === '[object Date]'; +} + +/** + * Determine if a value is a File + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a File, otherwise false + */ +function isFile(val) { + return toString.call(val) === '[object File]'; +} + +/** + * Determine if a value is a Blob + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a Blob, otherwise false + */ +function isBlob(val) { + return toString.call(val) === '[object Blob]'; +} + +/** + * Determine if a value is a Function + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a Function, otherwise false + */ +function isFunction(val) { + return toString.call(val) === '[object Function]'; +} + +/** + * Determine if a value is a Stream + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a Stream, otherwise false + */ +function isStream(val) { + return isObject(val) && isFunction(val.pipe); +} + +/** + * Determine if a value is a URLSearchParams object + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a URLSearchParams object, otherwise false + */ +function isURLSearchParams(val) { + return typeof URLSearchParams !== 'undefined' && val instanceof URLSearchParams; +} + +/** + * Trim excess whitespace off the beginning and end of a string + * + * @param {String} str The String to trim + * @returns {String} The String freed of excess whitespace + */ +function trim(str) { + return str.trim ? str.trim() : str.replace(/^\s+|\s+$/g, ''); +} + +/** + * Determine if we're running in a standard browser environment + * + * This allows axios to run in a web worker, and react-native. + * Both environments support XMLHttpRequest, but not fully standard globals. + * + * web workers: + * typeof window -> undefined + * typeof document -> undefined + * + * react-native: + * navigator.product -> 'ReactNative' + * nativescript + * navigator.product -> 'NativeScript' or 'NS' + */ +function isStandardBrowserEnv() { + if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' || + navigator.product === 'NativeScript' || + navigator.product === 'NS')) { + return false; + } + return ( + typeof window !== 'undefined' && + typeof document !== 'undefined' + ); +} + +/** + * Iterate over an Array or an Object invoking a function for each item. + * + * If `obj` is an Array callback will be called passing + * the value, index, and complete array for each item. + * + * If 'obj' is an Object callback will be called passing + * the value, key, and complete object for each property. + * + * @param {Object|Array} obj The object to iterate + * @param {Function} fn The callback to invoke for each item + */ +function forEach(obj, fn) { + // Don't bother if no value provided + if (obj === null || typeof obj === 'undefined') { + return; + } + + // Force an array if not already something iterable + if (typeof obj !== 'object') { + /*eslint no-param-reassign:0*/ + obj = [obj]; + } + + if (isArray(obj)) { + // Iterate over array values + for (var i = 0, l = obj.length; i < l; i++) { + fn.call(null, obj[i], i, obj); + } + } else { + // Iterate over object keys + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) { + fn.call(null, obj[key], key, obj); + } + } + } +} + +/** + * Accepts varargs expecting each argument to be an object, then + * immutably merges the properties of each object and returns result. + * + * When multiple objects contain the same key the later object in + * the arguments list will take precedence. + * + * Example: + * + * ```js + * var result = merge({foo: 123}, {foo: 456}); + * console.log(result.foo); // outputs 456 + * ``` + * + * @param {Object} obj1 Object to merge + * @returns {Object} Result of all merge properties + */ +function merge(/* obj1, obj2, obj3, ... */) { + var result = {}; + function assignValue(val, key) { + if (isPlainObject(result[key]) && isPlainObject(val)) { + result[key] = merge(result[key], val); + } else if (isPlainObject(val)) { + result[key] = merge({}, val); + } else if (isArray(val)) { + result[key] = val.slice(); + } else { + result[key] = val; + } + } + + for (var i = 0, l = arguments.length; i < l; i++) { + forEach(arguments[i], assignValue); + } + return result; +} + +/** + * Extends object a by mutably adding to it the properties of object b. + * + * @param {Object} a The object to be extended + * @param {Object} b The object to copy properties from + * @param {Object} thisArg The object to bind function to + * @return {Object} The resulting value of object a + */ +function extend(a, b, thisArg) { + forEach(b, function assignValue(val, key) { + if (thisArg && typeof val === 'function') { + a[key] = bind(val, thisArg); + } else { + a[key] = val; + } + }); + return a; +} + +/** + * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM) + * + * @param {string} content with BOM + * @return {string} content value without BOM + */ +function stripBOM(content) { + if (content.charCodeAt(0) === 0xFEFF) { + content = content.slice(1); + } + return content; +} + +module.exports = { + isArray: isArray, + isArrayBuffer: isArrayBuffer, + isBuffer: isBuffer, + isFormData: isFormData, + isArrayBufferView: isArrayBufferView, + isString: isString, + isNumber: isNumber, + isObject: isObject, + isPlainObject: isPlainObject, + isUndefined: isUndefined, + isDate: isDate, + isFile: isFile, + isBlob: isBlob, + isFunction: isFunction, + isStream: isStream, + isURLSearchParams: isURLSearchParams, + isStandardBrowserEnv: isStandardBrowserEnv, + forEach: forEach, + merge: merge, + extend: extend, + trim: trim, + stripBOM: stripBOM +}; + + +/***/ }), + +/***/ "./package.json": +/*!**********************!*\ + !*** ./package.json ***! + \**********************/ +/*! exports provided: name, version, description, main, scripts, repository, keywords, author, license, bugs, homepage, devDependencies, browser, jsdelivr, unpkg, typings, dependencies, bundlesize, default */ +/***/ (function(module) { + +module.exports = JSON.parse("{\"name\":\"axios\",\"version\":\"0.21.4\",\"description\":\"Promise based HTTP client for the browser and node.js\",\"main\":\"index.js\",\"scripts\":{\"test\":\"grunt test\",\"start\":\"node ./sandbox/server.js\",\"build\":\"NODE_ENV=production grunt build\",\"preversion\":\"npm test\",\"version\":\"npm run build && grunt version && git add -A dist && git add CHANGELOG.md bower.json package.json\",\"postversion\":\"git push && git push --tags\",\"examples\":\"node ./examples/server.js\",\"coveralls\":\"cat coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js\",\"fix\":\"eslint --fix lib/**/*.js\"},\"repository\":{\"type\":\"git\",\"url\":\"https://github.com/axios/axios.git\"},\"keywords\":[\"xhr\",\"http\",\"ajax\",\"promise\",\"node\"],\"author\":\"Matt Zabriskie\",\"license\":\"MIT\",\"bugs\":{\"url\":\"https://github.com/axios/axios/issues\"},\"homepage\":\"https://axios-http.com\",\"devDependencies\":{\"coveralls\":\"^3.0.0\",\"es6-promise\":\"^4.2.4\",\"grunt\":\"^1.3.0\",\"grunt-banner\":\"^0.6.0\",\"grunt-cli\":\"^1.2.0\",\"grunt-contrib-clean\":\"^1.1.0\",\"grunt-contrib-watch\":\"^1.0.0\",\"grunt-eslint\":\"^23.0.0\",\"grunt-karma\":\"^4.0.0\",\"grunt-mocha-test\":\"^0.13.3\",\"grunt-ts\":\"^6.0.0-beta.19\",\"grunt-webpack\":\"^4.0.2\",\"istanbul-instrumenter-loader\":\"^1.0.0\",\"jasmine-core\":\"^2.4.1\",\"karma\":\"^6.3.2\",\"karma-chrome-launcher\":\"^3.1.0\",\"karma-firefox-launcher\":\"^2.1.0\",\"karma-jasmine\":\"^1.1.1\",\"karma-jasmine-ajax\":\"^0.1.13\",\"karma-safari-launcher\":\"^1.0.0\",\"karma-sauce-launcher\":\"^4.3.6\",\"karma-sinon\":\"^1.0.5\",\"karma-sourcemap-loader\":\"^0.3.8\",\"karma-webpack\":\"^4.0.2\",\"load-grunt-tasks\":\"^3.5.2\",\"minimist\":\"^1.2.0\",\"mocha\":\"^8.2.1\",\"sinon\":\"^4.5.0\",\"terser-webpack-plugin\":\"^4.2.3\",\"typescript\":\"^4.0.5\",\"url-search-params\":\"^0.10.0\",\"webpack\":\"^4.44.2\",\"webpack-dev-server\":\"^3.11.0\"},\"browser\":{\"./lib/adapters/http.js\":\"./lib/adapters/xhr.js\"},\"jsdelivr\":\"dist/axios.min.js\",\"unpkg\":\"dist/axios.min.js\",\"typings\":\"./index.d.ts\",\"dependencies\":{\"follow-redirects\":\"^1.14.0\"},\"bundlesize\":[{\"path\":\"./dist/axios.min.js\",\"threshold\":\"5kB\"}]}"); + +/***/ }) + +/******/ }); +}); +//# sourceMappingURL=axios.map \ No newline at end of file diff --git a/node_modules/dhn-api/node_modules/axios/dist/axios.map b/node_modules/dhn-api/node_modules/axios/dist/axios.map new file mode 100644 index 000000000..4aadb219e --- /dev/null +++ b/node_modules/dhn-api/node_modules/axios/dist/axios.map @@ -0,0 +1 @@ +{"version":3,"sources":["webpack://axios/webpack/universalModuleDefinition","webpack://axios/webpack/bootstrap","webpack://axios/./index.js","webpack://axios/./lib/adapters/xhr.js","webpack://axios/./lib/axios.js","webpack://axios/./lib/cancel/Cancel.js","webpack://axios/./lib/cancel/CancelToken.js","webpack://axios/./lib/cancel/isCancel.js","webpack://axios/./lib/core/Axios.js","webpack://axios/./lib/core/InterceptorManager.js","webpack://axios/./lib/core/buildFullPath.js","webpack://axios/./lib/core/createError.js","webpack://axios/./lib/core/dispatchRequest.js","webpack://axios/./lib/core/enhanceError.js","webpack://axios/./lib/core/mergeConfig.js","webpack://axios/./lib/core/settle.js","webpack://axios/./lib/core/transformData.js","webpack://axios/./lib/defaults.js","webpack://axios/./lib/helpers/bind.js","webpack://axios/./lib/helpers/buildURL.js","webpack://axios/./lib/helpers/combineURLs.js","webpack://axios/./lib/helpers/cookies.js","webpack://axios/./lib/helpers/isAbsoluteURL.js","webpack://axios/./lib/helpers/isAxiosError.js","webpack://axios/./lib/helpers/isURLSameOrigin.js","webpack://axios/./lib/helpers/normalizeHeaderName.js","webpack://axios/./lib/helpers/parseHeaders.js","webpack://axios/./lib/helpers/spread.js","webpack://axios/./lib/helpers/validator.js","webpack://axios/./lib/utils.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,O;QCVA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA,0CAA0C,gCAAgC;QAC1E;QACA;;QAEA;QACA;QACA;QACA,wDAAwD,kBAAkB;QAC1E;QACA,iDAAiD,cAAc;QAC/D;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA,yCAAyC,iCAAiC;QAC1E,gHAAgH,mBAAmB,EAAE;QACrI;QACA;;QAEA;QACA;QACA;QACA,2BAA2B,0BAA0B,EAAE;QACvD,iCAAiC,eAAe;QAChD;QACA;QACA;;QAEA;QACA,sDAAsD,+DAA+D;;QAErH;QACA;;;QAGA;QACA;;;;;;;;;;;;AClFA,iBAAiB,mBAAO,CAAC,mCAAa,E;;;;;;;;;;;;ACAzB;;AAEb,YAAY,mBAAO,CAAC,kCAAY;AAChC,aAAa,mBAAO,CAAC,8CAAkB;AACvC,cAAc,mBAAO,CAAC,sDAAsB;AAC5C,eAAe,mBAAO,CAAC,wDAAuB;AAC9C,oBAAoB,mBAAO,CAAC,0DAAuB;AACnD,mBAAmB,mBAAO,CAAC,gEAA2B;AACtD,sBAAsB,mBAAO,CAAC,sEAA8B;AAC5D,kBAAkB,mBAAO,CAAC,sDAAqB;;AAE/C;AACA;AACA;AACA;AACA;;AAEA;AACA,4CAA4C;AAC5C;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;;;;;;;;;;;;;AC5La;;AAEb,YAAY,mBAAO,CAAC,+BAAS;AAC7B,WAAW,mBAAO,CAAC,6CAAgB;AACnC,YAAY,mBAAO,CAAC,yCAAc;AAClC,kBAAkB,mBAAO,CAAC,qDAAoB;AAC9C,eAAe,mBAAO,CAAC,qCAAY;;AAEnC;AACA;AACA;AACA,WAAW,OAAO;AAClB,YAAY,MAAM;AAClB;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,eAAe,mBAAO,CAAC,+CAAiB;AACxC,oBAAoB,mBAAO,CAAC,yDAAsB;AAClD,iBAAiB,mBAAO,CAAC,mDAAmB;;AAE5C;AACA;AACA;AACA;AACA,eAAe,mBAAO,CAAC,iDAAkB;;AAEzC;AACA,qBAAqB,mBAAO,CAAC,6DAAwB;;AAErD;;AAEA;AACA;;;;;;;;;;;;;ACvDa;;AAEb;AACA;AACA;AACA;AACA,WAAW,QAAQ;AACnB;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;;;;;;;;;;;;;AClBa;;AAEb,aAAa,mBAAO,CAAC,wCAAU;;AAE/B;AACA;AACA;AACA;AACA,WAAW,SAAS;AACpB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;;ACxDa;;AAEb;AACA;AACA;;;;;;;;;;;;;ACJa;;AAEb,YAAY,mBAAO,CAAC,kCAAY;AAChC,eAAe,mBAAO,CAAC,sDAAqB;AAC5C,yBAAyB,mBAAO,CAAC,8DAAsB;AACvD,sBAAsB,mBAAO,CAAC,wDAAmB;AACjD,kBAAkB,mBAAO,CAAC,gDAAe;AACzC,gBAAgB,mBAAO,CAAC,wDAAsB;;AAE9C;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA,GAAG;;AAEH;AACA;AACA;AACA,GAAG;;AAEH;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,gDAAgD;AAChD;AACA;AACA,yBAAyB;AACzB,KAAK;AACL;AACA,CAAC;;AAED;AACA;AACA;AACA,gDAAgD;AAChD;AACA;AACA;AACA,KAAK;AACL;AACA,CAAC;;AAED;;;;;;;;;;;;;ACnJa;;AAEb,YAAY,mBAAO,CAAC,kCAAY;;AAEhC;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,SAAS;AACpB,WAAW,SAAS;AACpB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,SAAS;AACpB;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;AAEA;;;;;;;;;;;;;ACrDa;;AAEb,oBAAoB,mBAAO,CAAC,gEAA0B;AACtD,kBAAkB,mBAAO,CAAC,4DAAwB;;AAElD;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACnBa;;AAEb,mBAAmB,mBAAO,CAAC,kDAAgB;;AAE3C;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,MAAM;AACnB;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACjBa;;AAEb,YAAY,mBAAO,CAAC,kCAAY;AAChC,oBAAoB,mBAAO,CAAC,oDAAiB;AAC7C,eAAe,mBAAO,CAAC,oDAAoB;AAC3C,eAAe,mBAAO,CAAC,sCAAa;;AAEpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,+BAA+B;AAC/B,uCAAuC;AACvC;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,GAAG;AACH;;;;;;;;;;;;;ACjFa;;AAEb;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,MAAM;AACnB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACzCa;;AAEb,YAAY,mBAAO,CAAC,gCAAU;;AAE9B;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL,2BAA2B;AAC3B,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;;AAEH;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;;AAEA;AACA;;;;;;;;;;;;;ACtFa;;AAEb,kBAAkB,mBAAO,CAAC,gDAAe;;AAEzC;AACA;AACA;AACA,WAAW,SAAS;AACpB,WAAW,SAAS;AACpB,WAAW,OAAO;AAClB;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACxBa;;AAEb,YAAY,mBAAO,CAAC,kCAAY;AAChC,eAAe,mBAAO,CAAC,wCAAe;;AAEtC;AACA;AACA;AACA,WAAW,cAAc;AACzB,WAAW,MAAM;AACjB,WAAW,eAAe;AAC1B,aAAa,EAAE;AACf;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;;;;;;;;;;;;;ACrBa;;AAEb,YAAY,mBAAO,CAAC,+BAAS;AAC7B,0BAA0B,mBAAO,CAAC,2EAA+B;AACjE,mBAAmB,mBAAO,CAAC,uDAAqB;;AAEhD;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc,mBAAO,CAAC,6CAAgB;AACtC,GAAG;AACH;AACA,cAAc,mBAAO,CAAC,8CAAiB;AACvC;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,GAAG;;AAEH;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wEAAwE;AACxE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,CAAC;;AAED;AACA;AACA,CAAC;;AAED;;;;;;;;;;;;;ACrIa;;AAEb;AACA;AACA;AACA,mBAAmB,iBAAiB;AACpC;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACVa;;AAEb,YAAY,mBAAO,CAAC,kCAAY;;AAEhC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,OAAO;AACP,KAAK;;AAEL;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;;;;;;;;;;;;ACrEa;;AAEb;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACba;;AAEb,YAAY,mBAAO,CAAC,kCAAY;;AAEhC;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,0CAA0C;AAC1C,SAAS;;AAET;AACA,4DAA4D,wBAAwB;AACpF;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,kCAAkC;AAClC,+BAA+B,aAAa,EAAE;AAC9C;AACA;AACA,KAAK;AACL;;;;;;;;;;;;;ACpDa;;AAEb;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACba;;AAEb;AACA;AACA;AACA,WAAW,EAAE;AACb,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;;;;;;;;;;;;ACVa;;AAEb,YAAY,mBAAO,CAAC,kCAAY;;AAEhC;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,cAAc,OAAO;AACrB,gBAAgB;AAChB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,cAAc,OAAO;AACrB,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;;;;;;;;;;;;ACnEa;;AAEb,YAAY,mBAAO,CAAC,gCAAU;;AAE9B;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;;;;;;;;;;;;ACXa;;AAEb,YAAY,mBAAO,CAAC,kCAAY;;AAEhC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;;AAEA,iBAAiB,eAAe;;AAEhC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,GAAG;;AAEH;AACA;;;;;;;;;;;;;ACpDa;;AAEb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B;AAC/B;AACA;AACA,WAAW,SAAS;AACpB,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;AC1Ba;;AAEb,UAAU,mBAAO,CAAC,4CAAsB;;AAExC;;AAEA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;;AAEA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,QAAQ;AACnB,aAAa;AACb;AACA;AACA;AACA;AACA,iBAAiB,OAAO;AACxB;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,WAAW,kBAAkB;AAC7B,WAAW,QAAQ;AACnB,WAAW,OAAO;AAClB,aAAa;AACb;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,SAAS;AACpB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACxGa;;AAEb,WAAW,mBAAO,CAAC,6CAAgB;;AAEnC;;AAEA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,YAAY,QAAQ;AACpB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,OAAO;AACpB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,SAAS;AACpB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,mCAAmC,OAAO;AAC1C;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,SAAS,GAAG,SAAS;AAC5C,2BAA2B;AAC3B;AACA;AACA,WAAW,OAAO;AAClB,aAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,4BAA4B;AAC5B,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;;AAEA,uCAAuC,OAAO;AAC9C;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"axios.js","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[\"axios\"] = factory();\n\telse\n\t\troot[\"axios\"] = factory();\n})(window, function() {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = \"./index.js\");\n","module.exports = require('./lib/axios');","'use strict';\n\nvar utils = require('./../utils');\nvar settle = require('./../core/settle');\nvar cookies = require('./../helpers/cookies');\nvar buildURL = require('./../helpers/buildURL');\nvar buildFullPath = require('../core/buildFullPath');\nvar parseHeaders = require('./../helpers/parseHeaders');\nvar isURLSameOrigin = require('./../helpers/isURLSameOrigin');\nvar createError = require('../core/createError');\n\nmodule.exports = function xhrAdapter(config) {\n return new Promise(function dispatchXhrRequest(resolve, reject) {\n var requestData = config.data;\n var requestHeaders = config.headers;\n var responseType = config.responseType;\n\n if (utils.isFormData(requestData)) {\n delete requestHeaders['Content-Type']; // Let the browser set it\n }\n\n var request = new XMLHttpRequest();\n\n // HTTP basic authentication\n if (config.auth) {\n var username = config.auth.username || '';\n var password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : '';\n requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password);\n }\n\n var fullPath = buildFullPath(config.baseURL, config.url);\n request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true);\n\n // Set the request timeout in MS\n request.timeout = config.timeout;\n\n function onloadend() {\n if (!request) {\n return;\n }\n // Prepare the response\n var responseHeaders = 'getAllResponseHeaders' in request ? parseHeaders(request.getAllResponseHeaders()) : null;\n var responseData = !responseType || responseType === 'text' || responseType === 'json' ?\n request.responseText : request.response;\n var response = {\n data: responseData,\n status: request.status,\n statusText: request.statusText,\n headers: responseHeaders,\n config: config,\n request: request\n };\n\n settle(resolve, reject, response);\n\n // Clean up request\n request = null;\n }\n\n if ('onloadend' in request) {\n // Use onloadend if available\n request.onloadend = onloadend;\n } else {\n // Listen for ready state to emulate onloadend\n request.onreadystatechange = function handleLoad() {\n if (!request || request.readyState !== 4) {\n return;\n }\n\n // The request errored out and we didn't get a response, this will be\n // handled by onerror instead\n // With one exception: request that using file: protocol, most browsers\n // will return status as 0 even though it's a successful request\n if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {\n return;\n }\n // readystate handler is calling before onerror or ontimeout handlers,\n // so we should call onloadend on the next 'tick'\n setTimeout(onloadend);\n };\n }\n\n // Handle browser request cancellation (as opposed to a manual cancellation)\n request.onabort = function handleAbort() {\n if (!request) {\n return;\n }\n\n reject(createError('Request aborted', config, 'ECONNABORTED', request));\n\n // Clean up request\n request = null;\n };\n\n // Handle low level network errors\n request.onerror = function handleError() {\n // Real errors are hidden from us by the browser\n // onerror should only fire if it's a network error\n reject(createError('Network Error', config, null, request));\n\n // Clean up request\n request = null;\n };\n\n // Handle timeout\n request.ontimeout = function handleTimeout() {\n var timeoutErrorMessage = 'timeout of ' + config.timeout + 'ms exceeded';\n if (config.timeoutErrorMessage) {\n timeoutErrorMessage = config.timeoutErrorMessage;\n }\n reject(createError(\n timeoutErrorMessage,\n config,\n config.transitional && config.transitional.clarifyTimeoutError ? 'ETIMEDOUT' : 'ECONNABORTED',\n request));\n\n // Clean up request\n request = null;\n };\n\n // Add xsrf header\n // This is only done if running in a standard browser environment.\n // Specifically not if we're in a web worker, or react-native.\n if (utils.isStandardBrowserEnv()) {\n // Add xsrf header\n var xsrfValue = (config.withCredentials || isURLSameOrigin(fullPath)) && config.xsrfCookieName ?\n cookies.read(config.xsrfCookieName) :\n undefined;\n\n if (xsrfValue) {\n requestHeaders[config.xsrfHeaderName] = xsrfValue;\n }\n }\n\n // Add headers to the request\n if ('setRequestHeader' in request) {\n utils.forEach(requestHeaders, function setRequestHeader(val, key) {\n if (typeof requestData === 'undefined' && key.toLowerCase() === 'content-type') {\n // Remove Content-Type if data is undefined\n delete requestHeaders[key];\n } else {\n // Otherwise add header to the request\n request.setRequestHeader(key, val);\n }\n });\n }\n\n // Add withCredentials to request if needed\n if (!utils.isUndefined(config.withCredentials)) {\n request.withCredentials = !!config.withCredentials;\n }\n\n // Add responseType to request if needed\n if (responseType && responseType !== 'json') {\n request.responseType = config.responseType;\n }\n\n // Handle progress if needed\n if (typeof config.onDownloadProgress === 'function') {\n request.addEventListener('progress', config.onDownloadProgress);\n }\n\n // Not all browsers support upload events\n if (typeof config.onUploadProgress === 'function' && request.upload) {\n request.upload.addEventListener('progress', config.onUploadProgress);\n }\n\n if (config.cancelToken) {\n // Handle cancellation\n config.cancelToken.promise.then(function onCanceled(cancel) {\n if (!request) {\n return;\n }\n\n request.abort();\n reject(cancel);\n // Clean up request\n request = null;\n });\n }\n\n if (!requestData) {\n requestData = null;\n }\n\n // Send the request\n request.send(requestData);\n });\n};\n","'use strict';\n\nvar utils = require('./utils');\nvar bind = require('./helpers/bind');\nvar Axios = require('./core/Axios');\nvar mergeConfig = require('./core/mergeConfig');\nvar defaults = require('./defaults');\n\n/**\n * Create an instance of Axios\n *\n * @param {Object} defaultConfig The default config for the instance\n * @return {Axios} A new instance of Axios\n */\nfunction createInstance(defaultConfig) {\n var context = new Axios(defaultConfig);\n var instance = bind(Axios.prototype.request, context);\n\n // Copy axios.prototype to instance\n utils.extend(instance, Axios.prototype, context);\n\n // Copy context to instance\n utils.extend(instance, context);\n\n return instance;\n}\n\n// Create the default instance to be exported\nvar axios = createInstance(defaults);\n\n// Expose Axios class to allow class inheritance\naxios.Axios = Axios;\n\n// Factory for creating new instances\naxios.create = function create(instanceConfig) {\n return createInstance(mergeConfig(axios.defaults, instanceConfig));\n};\n\n// Expose Cancel & CancelToken\naxios.Cancel = require('./cancel/Cancel');\naxios.CancelToken = require('./cancel/CancelToken');\naxios.isCancel = require('./cancel/isCancel');\n\n// Expose all/spread\naxios.all = function all(promises) {\n return Promise.all(promises);\n};\naxios.spread = require('./helpers/spread');\n\n// Expose isAxiosError\naxios.isAxiosError = require('./helpers/isAxiosError');\n\nmodule.exports = axios;\n\n// Allow use of default import syntax in TypeScript\nmodule.exports.default = axios;\n","'use strict';\n\n/**\n * A `Cancel` is an object that is thrown when an operation is canceled.\n *\n * @class\n * @param {string=} message The message.\n */\nfunction Cancel(message) {\n this.message = message;\n}\n\nCancel.prototype.toString = function toString() {\n return 'Cancel' + (this.message ? ': ' + this.message : '');\n};\n\nCancel.prototype.__CANCEL__ = true;\n\nmodule.exports = Cancel;\n","'use strict';\n\nvar Cancel = require('./Cancel');\n\n/**\n * A `CancelToken` is an object that can be used to request cancellation of an operation.\n *\n * @class\n * @param {Function} executor The executor function.\n */\nfunction CancelToken(executor) {\n if (typeof executor !== 'function') {\n throw new TypeError('executor must be a function.');\n }\n\n var resolvePromise;\n this.promise = new Promise(function promiseExecutor(resolve) {\n resolvePromise = resolve;\n });\n\n var token = this;\n executor(function cancel(message) {\n if (token.reason) {\n // Cancellation has already been requested\n return;\n }\n\n token.reason = new Cancel(message);\n resolvePromise(token.reason);\n });\n}\n\n/**\n * Throws a `Cancel` if cancellation has been requested.\n */\nCancelToken.prototype.throwIfRequested = function throwIfRequested() {\n if (this.reason) {\n throw this.reason;\n }\n};\n\n/**\n * Returns an object that contains a new `CancelToken` and a function that, when called,\n * cancels the `CancelToken`.\n */\nCancelToken.source = function source() {\n var cancel;\n var token = new CancelToken(function executor(c) {\n cancel = c;\n });\n return {\n token: token,\n cancel: cancel\n };\n};\n\nmodule.exports = CancelToken;\n","'use strict';\n\nmodule.exports = function isCancel(value) {\n return !!(value && value.__CANCEL__);\n};\n","'use strict';\n\nvar utils = require('./../utils');\nvar buildURL = require('../helpers/buildURL');\nvar InterceptorManager = require('./InterceptorManager');\nvar dispatchRequest = require('./dispatchRequest');\nvar mergeConfig = require('./mergeConfig');\nvar validator = require('../helpers/validator');\n\nvar validators = validator.validators;\n/**\n * Create a new instance of Axios\n *\n * @param {Object} instanceConfig The default config for the instance\n */\nfunction Axios(instanceConfig) {\n this.defaults = instanceConfig;\n this.interceptors = {\n request: new InterceptorManager(),\n response: new InterceptorManager()\n };\n}\n\n/**\n * Dispatch a request\n *\n * @param {Object} config The config specific for this request (merged with this.defaults)\n */\nAxios.prototype.request = function request(config) {\n /*eslint no-param-reassign:0*/\n // Allow for axios('example/url'[, config]) a la fetch API\n if (typeof config === 'string') {\n config = arguments[1] || {};\n config.url = arguments[0];\n } else {\n config = config || {};\n }\n\n config = mergeConfig(this.defaults, config);\n\n // Set config.method\n if (config.method) {\n config.method = config.method.toLowerCase();\n } else if (this.defaults.method) {\n config.method = this.defaults.method.toLowerCase();\n } else {\n config.method = 'get';\n }\n\n var transitional = config.transitional;\n\n if (transitional !== undefined) {\n validator.assertOptions(transitional, {\n silentJSONParsing: validators.transitional(validators.boolean, '1.0.0'),\n forcedJSONParsing: validators.transitional(validators.boolean, '1.0.0'),\n clarifyTimeoutError: validators.transitional(validators.boolean, '1.0.0')\n }, false);\n }\n\n // filter out skipped interceptors\n var requestInterceptorChain = [];\n var synchronousRequestInterceptors = true;\n this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {\n if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) {\n return;\n }\n\n synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;\n\n requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);\n });\n\n var responseInterceptorChain = [];\n this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {\n responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);\n });\n\n var promise;\n\n if (!synchronousRequestInterceptors) {\n var chain = [dispatchRequest, undefined];\n\n Array.prototype.unshift.apply(chain, requestInterceptorChain);\n chain = chain.concat(responseInterceptorChain);\n\n promise = Promise.resolve(config);\n while (chain.length) {\n promise = promise.then(chain.shift(), chain.shift());\n }\n\n return promise;\n }\n\n\n var newConfig = config;\n while (requestInterceptorChain.length) {\n var onFulfilled = requestInterceptorChain.shift();\n var onRejected = requestInterceptorChain.shift();\n try {\n newConfig = onFulfilled(newConfig);\n } catch (error) {\n onRejected(error);\n break;\n }\n }\n\n try {\n promise = dispatchRequest(newConfig);\n } catch (error) {\n return Promise.reject(error);\n }\n\n while (responseInterceptorChain.length) {\n promise = promise.then(responseInterceptorChain.shift(), responseInterceptorChain.shift());\n }\n\n return promise;\n};\n\nAxios.prototype.getUri = function getUri(config) {\n config = mergeConfig(this.defaults, config);\n return buildURL(config.url, config.params, config.paramsSerializer).replace(/^\\?/, '');\n};\n\n// Provide aliases for supported request methods\nutils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, config) {\n return this.request(mergeConfig(config || {}, {\n method: method,\n url: url,\n data: (config || {}).data\n }));\n };\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, data, config) {\n return this.request(mergeConfig(config || {}, {\n method: method,\n url: url,\n data: data\n }));\n };\n});\n\nmodule.exports = Axios;\n","'use strict';\n\nvar utils = require('./../utils');\n\nfunction InterceptorManager() {\n this.handlers = [];\n}\n\n/**\n * Add a new interceptor to the stack\n *\n * @param {Function} fulfilled The function to handle `then` for a `Promise`\n * @param {Function} rejected The function to handle `reject` for a `Promise`\n *\n * @return {Number} An ID used to remove interceptor later\n */\nInterceptorManager.prototype.use = function use(fulfilled, rejected, options) {\n this.handlers.push({\n fulfilled: fulfilled,\n rejected: rejected,\n synchronous: options ? options.synchronous : false,\n runWhen: options ? options.runWhen : null\n });\n return this.handlers.length - 1;\n};\n\n/**\n * Remove an interceptor from the stack\n *\n * @param {Number} id The ID that was returned by `use`\n */\nInterceptorManager.prototype.eject = function eject(id) {\n if (this.handlers[id]) {\n this.handlers[id] = null;\n }\n};\n\n/**\n * Iterate over all the registered interceptors\n *\n * This method is particularly useful for skipping over any\n * interceptors that may have become `null` calling `eject`.\n *\n * @param {Function} fn The function to call for each interceptor\n */\nInterceptorManager.prototype.forEach = function forEach(fn) {\n utils.forEach(this.handlers, function forEachHandler(h) {\n if (h !== null) {\n fn(h);\n }\n });\n};\n\nmodule.exports = InterceptorManager;\n","'use strict';\n\nvar isAbsoluteURL = require('../helpers/isAbsoluteURL');\nvar combineURLs = require('../helpers/combineURLs');\n\n/**\n * Creates a new URL by combining the baseURL with the requestedURL,\n * only when the requestedURL is not already an absolute URL.\n * If the requestURL is absolute, this function returns the requestedURL untouched.\n *\n * @param {string} baseURL The base URL\n * @param {string} requestedURL Absolute or relative URL to combine\n * @returns {string} The combined full path\n */\nmodule.exports = function buildFullPath(baseURL, requestedURL) {\n if (baseURL && !isAbsoluteURL(requestedURL)) {\n return combineURLs(baseURL, requestedURL);\n }\n return requestedURL;\n};\n","'use strict';\n\nvar enhanceError = require('./enhanceError');\n\n/**\n * Create an Error with the specified message, config, error code, request and response.\n *\n * @param {string} message The error message.\n * @param {Object} config The config.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n * @returns {Error} The created error.\n */\nmodule.exports = function createError(message, config, code, request, response) {\n var error = new Error(message);\n return enhanceError(error, config, code, request, response);\n};\n","'use strict';\n\nvar utils = require('./../utils');\nvar transformData = require('./transformData');\nvar isCancel = require('../cancel/isCancel');\nvar defaults = require('../defaults');\n\n/**\n * Throws a `Cancel` if cancellation has been requested.\n */\nfunction throwIfCancellationRequested(config) {\n if (config.cancelToken) {\n config.cancelToken.throwIfRequested();\n }\n}\n\n/**\n * Dispatch a request to the server using the configured adapter.\n *\n * @param {object} config The config that is to be used for the request\n * @returns {Promise} The Promise to be fulfilled\n */\nmodule.exports = function dispatchRequest(config) {\n throwIfCancellationRequested(config);\n\n // Ensure headers exist\n config.headers = config.headers || {};\n\n // Transform request data\n config.data = transformData.call(\n config,\n config.data,\n config.headers,\n config.transformRequest\n );\n\n // Flatten headers\n config.headers = utils.merge(\n config.headers.common || {},\n config.headers[config.method] || {},\n config.headers\n );\n\n utils.forEach(\n ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],\n function cleanHeaderConfig(method) {\n delete config.headers[method];\n }\n );\n\n var adapter = config.adapter || defaults.adapter;\n\n return adapter(config).then(function onAdapterResolution(response) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n response.data = transformData.call(\n config,\n response.data,\n response.headers,\n config.transformResponse\n );\n\n return response;\n }, function onAdapterRejection(reason) {\n if (!isCancel(reason)) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n if (reason && reason.response) {\n reason.response.data = transformData.call(\n config,\n reason.response.data,\n reason.response.headers,\n config.transformResponse\n );\n }\n }\n\n return Promise.reject(reason);\n });\n};\n","'use strict';\n\n/**\n * Update an Error with the specified config, error code, and response.\n *\n * @param {Error} error The error to update.\n * @param {Object} config The config.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n * @returns {Error} The error.\n */\nmodule.exports = function enhanceError(error, config, code, request, response) {\n error.config = config;\n if (code) {\n error.code = code;\n }\n\n error.request = request;\n error.response = response;\n error.isAxiosError = true;\n\n error.toJSON = function toJSON() {\n return {\n // Standard\n message: this.message,\n name: this.name,\n // Microsoft\n description: this.description,\n number: this.number,\n // Mozilla\n fileName: this.fileName,\n lineNumber: this.lineNumber,\n columnNumber: this.columnNumber,\n stack: this.stack,\n // Axios\n config: this.config,\n code: this.code\n };\n };\n return error;\n};\n","'use strict';\n\nvar utils = require('../utils');\n\n/**\n * Config-specific merge-function which creates a new config-object\n * by merging two configuration objects together.\n *\n * @param {Object} config1\n * @param {Object} config2\n * @returns {Object} New object resulting from merging config2 to config1\n */\nmodule.exports = function mergeConfig(config1, config2) {\n // eslint-disable-next-line no-param-reassign\n config2 = config2 || {};\n var config = {};\n\n var valueFromConfig2Keys = ['url', 'method', 'data'];\n var mergeDeepPropertiesKeys = ['headers', 'auth', 'proxy', 'params'];\n var defaultToConfig2Keys = [\n 'baseURL', 'transformRequest', 'transformResponse', 'paramsSerializer',\n 'timeout', 'timeoutMessage', 'withCredentials', 'adapter', 'responseType', 'xsrfCookieName',\n 'xsrfHeaderName', 'onUploadProgress', 'onDownloadProgress', 'decompress',\n 'maxContentLength', 'maxBodyLength', 'maxRedirects', 'transport', 'httpAgent',\n 'httpsAgent', 'cancelToken', 'socketPath', 'responseEncoding'\n ];\n var directMergeKeys = ['validateStatus'];\n\n function getMergedValue(target, source) {\n if (utils.isPlainObject(target) && utils.isPlainObject(source)) {\n return utils.merge(target, source);\n } else if (utils.isPlainObject(source)) {\n return utils.merge({}, source);\n } else if (utils.isArray(source)) {\n return source.slice();\n }\n return source;\n }\n\n function mergeDeepProperties(prop) {\n if (!utils.isUndefined(config2[prop])) {\n config[prop] = getMergedValue(config1[prop], config2[prop]);\n } else if (!utils.isUndefined(config1[prop])) {\n config[prop] = getMergedValue(undefined, config1[prop]);\n }\n }\n\n utils.forEach(valueFromConfig2Keys, function valueFromConfig2(prop) {\n if (!utils.isUndefined(config2[prop])) {\n config[prop] = getMergedValue(undefined, config2[prop]);\n }\n });\n\n utils.forEach(mergeDeepPropertiesKeys, mergeDeepProperties);\n\n utils.forEach(defaultToConfig2Keys, function defaultToConfig2(prop) {\n if (!utils.isUndefined(config2[prop])) {\n config[prop] = getMergedValue(undefined, config2[prop]);\n } else if (!utils.isUndefined(config1[prop])) {\n config[prop] = getMergedValue(undefined, config1[prop]);\n }\n });\n\n utils.forEach(directMergeKeys, function merge(prop) {\n if (prop in config2) {\n config[prop] = getMergedValue(config1[prop], config2[prop]);\n } else if (prop in config1) {\n config[prop] = getMergedValue(undefined, config1[prop]);\n }\n });\n\n var axiosKeys = valueFromConfig2Keys\n .concat(mergeDeepPropertiesKeys)\n .concat(defaultToConfig2Keys)\n .concat(directMergeKeys);\n\n var otherKeys = Object\n .keys(config1)\n .concat(Object.keys(config2))\n .filter(function filterAxiosKeys(key) {\n return axiosKeys.indexOf(key) === -1;\n });\n\n utils.forEach(otherKeys, mergeDeepProperties);\n\n return config;\n};\n","'use strict';\n\nvar createError = require('./createError');\n\n/**\n * Resolve or reject a Promise based on response status.\n *\n * @param {Function} resolve A function that resolves the promise.\n * @param {Function} reject A function that rejects the promise.\n * @param {object} response The response.\n */\nmodule.exports = function settle(resolve, reject, response) {\n var validateStatus = response.config.validateStatus;\n if (!response.status || !validateStatus || validateStatus(response.status)) {\n resolve(response);\n } else {\n reject(createError(\n 'Request failed with status code ' + response.status,\n response.config,\n null,\n response.request,\n response\n ));\n }\n};\n","'use strict';\n\nvar utils = require('./../utils');\nvar defaults = require('./../defaults');\n\n/**\n * Transform the data for a request or a response\n *\n * @param {Object|String} data The data to be transformed\n * @param {Array} headers The headers for the request or response\n * @param {Array|Function} fns A single function or Array of functions\n * @returns {*} The resulting transformed data\n */\nmodule.exports = function transformData(data, headers, fns) {\n var context = this || defaults;\n /*eslint no-param-reassign:0*/\n utils.forEach(fns, function transform(fn) {\n data = fn.call(context, data, headers);\n });\n\n return data;\n};\n","'use strict';\n\nvar utils = require('./utils');\nvar normalizeHeaderName = require('./helpers/normalizeHeaderName');\nvar enhanceError = require('./core/enhanceError');\n\nvar DEFAULT_CONTENT_TYPE = {\n 'Content-Type': 'application/x-www-form-urlencoded'\n};\n\nfunction setContentTypeIfUnset(headers, value) {\n if (!utils.isUndefined(headers) && utils.isUndefined(headers['Content-Type'])) {\n headers['Content-Type'] = value;\n }\n}\n\nfunction getDefaultAdapter() {\n var adapter;\n if (typeof XMLHttpRequest !== 'undefined') {\n // For browsers use XHR adapter\n adapter = require('./adapters/xhr');\n } else if (typeof process !== 'undefined' && Object.prototype.toString.call(process) === '[object process]') {\n // For node use HTTP adapter\n adapter = require('./adapters/http');\n }\n return adapter;\n}\n\nfunction stringifySafely(rawValue, parser, encoder) {\n if (utils.isString(rawValue)) {\n try {\n (parser || JSON.parse)(rawValue);\n return utils.trim(rawValue);\n } catch (e) {\n if (e.name !== 'SyntaxError') {\n throw e;\n }\n }\n }\n\n return (encoder || JSON.stringify)(rawValue);\n}\n\nvar defaults = {\n\n transitional: {\n silentJSONParsing: true,\n forcedJSONParsing: true,\n clarifyTimeoutError: false\n },\n\n adapter: getDefaultAdapter(),\n\n transformRequest: [function transformRequest(data, headers) {\n normalizeHeaderName(headers, 'Accept');\n normalizeHeaderName(headers, 'Content-Type');\n\n if (utils.isFormData(data) ||\n utils.isArrayBuffer(data) ||\n utils.isBuffer(data) ||\n utils.isStream(data) ||\n utils.isFile(data) ||\n utils.isBlob(data)\n ) {\n return data;\n }\n if (utils.isArrayBufferView(data)) {\n return data.buffer;\n }\n if (utils.isURLSearchParams(data)) {\n setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8');\n return data.toString();\n }\n if (utils.isObject(data) || (headers && headers['Content-Type'] === 'application/json')) {\n setContentTypeIfUnset(headers, 'application/json');\n return stringifySafely(data);\n }\n return data;\n }],\n\n transformResponse: [function transformResponse(data) {\n var transitional = this.transitional;\n var silentJSONParsing = transitional && transitional.silentJSONParsing;\n var forcedJSONParsing = transitional && transitional.forcedJSONParsing;\n var strictJSONParsing = !silentJSONParsing && this.responseType === 'json';\n\n if (strictJSONParsing || (forcedJSONParsing && utils.isString(data) && data.length)) {\n try {\n return JSON.parse(data);\n } catch (e) {\n if (strictJSONParsing) {\n if (e.name === 'SyntaxError') {\n throw enhanceError(e, this, 'E_JSON_PARSE');\n }\n throw e;\n }\n }\n }\n\n return data;\n }],\n\n /**\n * A timeout in milliseconds to abort a request. If set to 0 (default) a\n * timeout is not created.\n */\n timeout: 0,\n\n xsrfCookieName: 'XSRF-TOKEN',\n xsrfHeaderName: 'X-XSRF-TOKEN',\n\n maxContentLength: -1,\n maxBodyLength: -1,\n\n validateStatus: function validateStatus(status) {\n return status >= 200 && status < 300;\n }\n};\n\ndefaults.headers = {\n common: {\n 'Accept': 'application/json, text/plain, */*'\n }\n};\n\nutils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) {\n defaults.headers[method] = {};\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE);\n});\n\nmodule.exports = defaults;\n","'use strict';\n\nmodule.exports = function bind(fn, thisArg) {\n return function wrap() {\n var args = new Array(arguments.length);\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i];\n }\n return fn.apply(thisArg, args);\n };\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\nfunction encode(val) {\n return encodeURIComponent(val).\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%20/g, '+').\n replace(/%5B/gi, '[').\n replace(/%5D/gi, ']');\n}\n\n/**\n * Build a URL by appending params to the end\n *\n * @param {string} url The base of the url (e.g., http://www.google.com)\n * @param {object} [params] The params to be appended\n * @returns {string} The formatted url\n */\nmodule.exports = function buildURL(url, params, paramsSerializer) {\n /*eslint no-param-reassign:0*/\n if (!params) {\n return url;\n }\n\n var serializedParams;\n if (paramsSerializer) {\n serializedParams = paramsSerializer(params);\n } else if (utils.isURLSearchParams(params)) {\n serializedParams = params.toString();\n } else {\n var parts = [];\n\n utils.forEach(params, function serialize(val, key) {\n if (val === null || typeof val === 'undefined') {\n return;\n }\n\n if (utils.isArray(val)) {\n key = key + '[]';\n } else {\n val = [val];\n }\n\n utils.forEach(val, function parseValue(v) {\n if (utils.isDate(v)) {\n v = v.toISOString();\n } else if (utils.isObject(v)) {\n v = JSON.stringify(v);\n }\n parts.push(encode(key) + '=' + encode(v));\n });\n });\n\n serializedParams = parts.join('&');\n }\n\n if (serializedParams) {\n var hashmarkIndex = url.indexOf('#');\n if (hashmarkIndex !== -1) {\n url = url.slice(0, hashmarkIndex);\n }\n\n url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;\n }\n\n return url;\n};\n","'use strict';\n\n/**\n * Creates a new URL by combining the specified URLs\n *\n * @param {string} baseURL The base URL\n * @param {string} relativeURL The relative URL\n * @returns {string} The combined URL\n */\nmodule.exports = function combineURLs(baseURL, relativeURL) {\n return relativeURL\n ? baseURL.replace(/\\/+$/, '') + '/' + relativeURL.replace(/^\\/+/, '')\n : baseURL;\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\nmodule.exports = (\n utils.isStandardBrowserEnv() ?\n\n // Standard browser envs support document.cookie\n (function standardBrowserEnv() {\n return {\n write: function write(name, value, expires, path, domain, secure) {\n var cookie = [];\n cookie.push(name + '=' + encodeURIComponent(value));\n\n if (utils.isNumber(expires)) {\n cookie.push('expires=' + new Date(expires).toGMTString());\n }\n\n if (utils.isString(path)) {\n cookie.push('path=' + path);\n }\n\n if (utils.isString(domain)) {\n cookie.push('domain=' + domain);\n }\n\n if (secure === true) {\n cookie.push('secure');\n }\n\n document.cookie = cookie.join('; ');\n },\n\n read: function read(name) {\n var match = document.cookie.match(new RegExp('(^|;\\\\s*)(' + name + ')=([^;]*)'));\n return (match ? decodeURIComponent(match[3]) : null);\n },\n\n remove: function remove(name) {\n this.write(name, '', Date.now() - 86400000);\n }\n };\n })() :\n\n // Non standard browser env (web workers, react-native) lack needed support.\n (function nonStandardBrowserEnv() {\n return {\n write: function write() {},\n read: function read() { return null; },\n remove: function remove() {}\n };\n })()\n);\n","'use strict';\n\n/**\n * Determines whether the specified URL is absolute\n *\n * @param {string} url The URL to test\n * @returns {boolean} True if the specified URL is absolute, otherwise false\n */\nmodule.exports = function isAbsoluteURL(url) {\n // A URL is considered absolute if it begins with \"://\" or \"//\" (protocol-relative URL).\n // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed\n // by any combination of letters, digits, plus, period, or hyphen.\n return /^([a-z][a-z\\d\\+\\-\\.]*:)?\\/\\//i.test(url);\n};\n","'use strict';\n\n/**\n * Determines whether the payload is an error thrown by Axios\n *\n * @param {*} payload The value to test\n * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false\n */\nmodule.exports = function isAxiosError(payload) {\n return (typeof payload === 'object') && (payload.isAxiosError === true);\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\nmodule.exports = (\n utils.isStandardBrowserEnv() ?\n\n // Standard browser envs have full support of the APIs needed to test\n // whether the request URL is of the same origin as current location.\n (function standardBrowserEnv() {\n var msie = /(msie|trident)/i.test(navigator.userAgent);\n var urlParsingNode = document.createElement('a');\n var originURL;\n\n /**\n * Parse a URL to discover it's components\n *\n * @param {String} url The URL to be parsed\n * @returns {Object}\n */\n function resolveURL(url) {\n var href = url;\n\n if (msie) {\n // IE needs attribute set twice to normalize properties\n urlParsingNode.setAttribute('href', href);\n href = urlParsingNode.href;\n }\n\n urlParsingNode.setAttribute('href', href);\n\n // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils\n return {\n href: urlParsingNode.href,\n protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',\n host: urlParsingNode.host,\n search: urlParsingNode.search ? urlParsingNode.search.replace(/^\\?/, '') : '',\n hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',\n hostname: urlParsingNode.hostname,\n port: urlParsingNode.port,\n pathname: (urlParsingNode.pathname.charAt(0) === '/') ?\n urlParsingNode.pathname :\n '/' + urlParsingNode.pathname\n };\n }\n\n originURL = resolveURL(window.location.href);\n\n /**\n * Determine if a URL shares the same origin as the current location\n *\n * @param {String} requestURL The URL to test\n * @returns {boolean} True if URL shares the same origin, otherwise false\n */\n return function isURLSameOrigin(requestURL) {\n var parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL;\n return (parsed.protocol === originURL.protocol &&\n parsed.host === originURL.host);\n };\n })() :\n\n // Non standard browser envs (web workers, react-native) lack needed support.\n (function nonStandardBrowserEnv() {\n return function isURLSameOrigin() {\n return true;\n };\n })()\n);\n","'use strict';\n\nvar utils = require('../utils');\n\nmodule.exports = function normalizeHeaderName(headers, normalizedName) {\n utils.forEach(headers, function processHeader(value, name) {\n if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) {\n headers[normalizedName] = value;\n delete headers[name];\n }\n });\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\n// Headers whose duplicates are ignored by node\n// c.f. https://nodejs.org/api/http.html#http_message_headers\nvar ignoreDuplicateOf = [\n 'age', 'authorization', 'content-length', 'content-type', 'etag',\n 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',\n 'last-modified', 'location', 'max-forwards', 'proxy-authorization',\n 'referer', 'retry-after', 'user-agent'\n];\n\n/**\n * Parse headers into an object\n *\n * ```\n * Date: Wed, 27 Aug 2014 08:58:49 GMT\n * Content-Type: application/json\n * Connection: keep-alive\n * Transfer-Encoding: chunked\n * ```\n *\n * @param {String} headers Headers needing to be parsed\n * @returns {Object} Headers parsed into an object\n */\nmodule.exports = function parseHeaders(headers) {\n var parsed = {};\n var key;\n var val;\n var i;\n\n if (!headers) { return parsed; }\n\n utils.forEach(headers.split('\\n'), function parser(line) {\n i = line.indexOf(':');\n key = utils.trim(line.substr(0, i)).toLowerCase();\n val = utils.trim(line.substr(i + 1));\n\n if (key) {\n if (parsed[key] && ignoreDuplicateOf.indexOf(key) >= 0) {\n return;\n }\n if (key === 'set-cookie') {\n parsed[key] = (parsed[key] ? parsed[key] : []).concat([val]);\n } else {\n parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;\n }\n }\n });\n\n return parsed;\n};\n","'use strict';\n\n/**\n * Syntactic sugar for invoking a function and expanding an array for arguments.\n *\n * Common use case would be to use `Function.prototype.apply`.\n *\n * ```js\n * function f(x, y, z) {}\n * var args = [1, 2, 3];\n * f.apply(null, args);\n * ```\n *\n * With `spread` this example can be re-written.\n *\n * ```js\n * spread(function(x, y, z) {})([1, 2, 3]);\n * ```\n *\n * @param {Function} callback\n * @returns {Function}\n */\nmodule.exports = function spread(callback) {\n return function wrap(arr) {\n return callback.apply(null, arr);\n };\n};\n","'use strict';\n\nvar pkg = require('./../../package.json');\n\nvar validators = {};\n\n// eslint-disable-next-line func-names\n['object', 'boolean', 'number', 'function', 'string', 'symbol'].forEach(function(type, i) {\n validators[type] = function validator(thing) {\n return typeof thing === type || 'a' + (i < 1 ? 'n ' : ' ') + type;\n };\n});\n\nvar deprecatedWarnings = {};\nvar currentVerArr = pkg.version.split('.');\n\n/**\n * Compare package versions\n * @param {string} version\n * @param {string?} thanVersion\n * @returns {boolean}\n */\nfunction isOlderVersion(version, thanVersion) {\n var pkgVersionArr = thanVersion ? thanVersion.split('.') : currentVerArr;\n var destVer = version.split('.');\n for (var i = 0; i < 3; i++) {\n if (pkgVersionArr[i] > destVer[i]) {\n return true;\n } else if (pkgVersionArr[i] < destVer[i]) {\n return false;\n }\n }\n return false;\n}\n\n/**\n * Transitional option validator\n * @param {function|boolean?} validator\n * @param {string?} version\n * @param {string} message\n * @returns {function}\n */\nvalidators.transitional = function transitional(validator, version, message) {\n var isDeprecated = version && isOlderVersion(version);\n\n function formatMessage(opt, desc) {\n return '[Axios v' + pkg.version + '] Transitional option \\'' + opt + '\\'' + desc + (message ? '. ' + message : '');\n }\n\n // eslint-disable-next-line func-names\n return function(value, opt, opts) {\n if (validator === false) {\n throw new Error(formatMessage(opt, ' has been removed in ' + version));\n }\n\n if (isDeprecated && !deprecatedWarnings[opt]) {\n deprecatedWarnings[opt] = true;\n // eslint-disable-next-line no-console\n console.warn(\n formatMessage(\n opt,\n ' has been deprecated since v' + version + ' and will be removed in the near future'\n )\n );\n }\n\n return validator ? validator(value, opt, opts) : true;\n };\n};\n\n/**\n * Assert object's properties type\n * @param {object} options\n * @param {object} schema\n * @param {boolean?} allowUnknown\n */\n\nfunction assertOptions(options, schema, allowUnknown) {\n if (typeof options !== 'object') {\n throw new TypeError('options must be an object');\n }\n var keys = Object.keys(options);\n var i = keys.length;\n while (i-- > 0) {\n var opt = keys[i];\n var validator = schema[opt];\n if (validator) {\n var value = options[opt];\n var result = value === undefined || validator(value, opt, options);\n if (result !== true) {\n throw new TypeError('option ' + opt + ' must be ' + result);\n }\n continue;\n }\n if (allowUnknown !== true) {\n throw Error('Unknown option ' + opt);\n }\n }\n}\n\nmodule.exports = {\n isOlderVersion: isOlderVersion,\n assertOptions: assertOptions,\n validators: validators\n};\n","'use strict';\n\nvar bind = require('./helpers/bind');\n\n// utils is a library of generic helper functions non-specific to axios\n\nvar toString = Object.prototype.toString;\n\n/**\n * Determine if a value is an Array\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an Array, otherwise false\n */\nfunction isArray(val) {\n return toString.call(val) === '[object Array]';\n}\n\n/**\n * Determine if a value is undefined\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if the value is undefined, otherwise false\n */\nfunction isUndefined(val) {\n return typeof val === 'undefined';\n}\n\n/**\n * Determine if a value is a Buffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Buffer, otherwise false\n */\nfunction isBuffer(val) {\n return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor)\n && typeof val.constructor.isBuffer === 'function' && val.constructor.isBuffer(val);\n}\n\n/**\n * Determine if a value is an ArrayBuffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an ArrayBuffer, otherwise false\n */\nfunction isArrayBuffer(val) {\n return toString.call(val) === '[object ArrayBuffer]';\n}\n\n/**\n * Determine if a value is a FormData\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an FormData, otherwise false\n */\nfunction isFormData(val) {\n return (typeof FormData !== 'undefined') && (val instanceof FormData);\n}\n\n/**\n * Determine if a value is a view on an ArrayBuffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false\n */\nfunction isArrayBufferView(val) {\n var result;\n if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {\n result = ArrayBuffer.isView(val);\n } else {\n result = (val) && (val.buffer) && (val.buffer instanceof ArrayBuffer);\n }\n return result;\n}\n\n/**\n * Determine if a value is a String\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a String, otherwise false\n */\nfunction isString(val) {\n return typeof val === 'string';\n}\n\n/**\n * Determine if a value is a Number\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Number, otherwise false\n */\nfunction isNumber(val) {\n return typeof val === 'number';\n}\n\n/**\n * Determine if a value is an Object\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an Object, otherwise false\n */\nfunction isObject(val) {\n return val !== null && typeof val === 'object';\n}\n\n/**\n * Determine if a value is a plain Object\n *\n * @param {Object} val The value to test\n * @return {boolean} True if value is a plain Object, otherwise false\n */\nfunction isPlainObject(val) {\n if (toString.call(val) !== '[object Object]') {\n return false;\n }\n\n var prototype = Object.getPrototypeOf(val);\n return prototype === null || prototype === Object.prototype;\n}\n\n/**\n * Determine if a value is a Date\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Date, otherwise false\n */\nfunction isDate(val) {\n return toString.call(val) === '[object Date]';\n}\n\n/**\n * Determine if a value is a File\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a File, otherwise false\n */\nfunction isFile(val) {\n return toString.call(val) === '[object File]';\n}\n\n/**\n * Determine if a value is a Blob\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Blob, otherwise false\n */\nfunction isBlob(val) {\n return toString.call(val) === '[object Blob]';\n}\n\n/**\n * Determine if a value is a Function\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Function, otherwise false\n */\nfunction isFunction(val) {\n return toString.call(val) === '[object Function]';\n}\n\n/**\n * Determine if a value is a Stream\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Stream, otherwise false\n */\nfunction isStream(val) {\n return isObject(val) && isFunction(val.pipe);\n}\n\n/**\n * Determine if a value is a URLSearchParams object\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a URLSearchParams object, otherwise false\n */\nfunction isURLSearchParams(val) {\n return typeof URLSearchParams !== 'undefined' && val instanceof URLSearchParams;\n}\n\n/**\n * Trim excess whitespace off the beginning and end of a string\n *\n * @param {String} str The String to trim\n * @returns {String} The String freed of excess whitespace\n */\nfunction trim(str) {\n return str.trim ? str.trim() : str.replace(/^\\s+|\\s+$/g, '');\n}\n\n/**\n * Determine if we're running in a standard browser environment\n *\n * This allows axios to run in a web worker, and react-native.\n * Both environments support XMLHttpRequest, but not fully standard globals.\n *\n * web workers:\n * typeof window -> undefined\n * typeof document -> undefined\n *\n * react-native:\n * navigator.product -> 'ReactNative'\n * nativescript\n * navigator.product -> 'NativeScript' or 'NS'\n */\nfunction isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}\n\n/**\n * Iterate over an Array or an Object invoking a function for each item.\n *\n * If `obj` is an Array callback will be called passing\n * the value, index, and complete array for each item.\n *\n * If 'obj' is an Object callback will be called passing\n * the value, key, and complete object for each property.\n *\n * @param {Object|Array} obj The object to iterate\n * @param {Function} fn The callback to invoke for each item\n */\nfunction forEach(obj, fn) {\n // Don't bother if no value provided\n if (obj === null || typeof obj === 'undefined') {\n return;\n }\n\n // Force an array if not already something iterable\n if (typeof obj !== 'object') {\n /*eslint no-param-reassign:0*/\n obj = [obj];\n }\n\n if (isArray(obj)) {\n // Iterate over array values\n for (var i = 0, l = obj.length; i < l; i++) {\n fn.call(null, obj[i], i, obj);\n }\n } else {\n // Iterate over object keys\n for (var key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key)) {\n fn.call(null, obj[key], key, obj);\n }\n }\n }\n}\n\n/**\n * Accepts varargs expecting each argument to be an object, then\n * immutably merges the properties of each object and returns result.\n *\n * When multiple objects contain the same key the later object in\n * the arguments list will take precedence.\n *\n * Example:\n *\n * ```js\n * var result = merge({foo: 123}, {foo: 456});\n * console.log(result.foo); // outputs 456\n * ```\n *\n * @param {Object} obj1 Object to merge\n * @returns {Object} Result of all merge properties\n */\nfunction merge(/* obj1, obj2, obj3, ... */) {\n var result = {};\n function assignValue(val, key) {\n if (isPlainObject(result[key]) && isPlainObject(val)) {\n result[key] = merge(result[key], val);\n } else if (isPlainObject(val)) {\n result[key] = merge({}, val);\n } else if (isArray(val)) {\n result[key] = val.slice();\n } else {\n result[key] = val;\n }\n }\n\n for (var i = 0, l = arguments.length; i < l; i++) {\n forEach(arguments[i], assignValue);\n }\n return result;\n}\n\n/**\n * Extends object a by mutably adding to it the properties of object b.\n *\n * @param {Object} a The object to be extended\n * @param {Object} b The object to copy properties from\n * @param {Object} thisArg The object to bind function to\n * @return {Object} The resulting value of object a\n */\nfunction extend(a, b, thisArg) {\n forEach(b, function assignValue(val, key) {\n if (thisArg && typeof val === 'function') {\n a[key] = bind(val, thisArg);\n } else {\n a[key] = val;\n }\n });\n return a;\n}\n\n/**\n * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM)\n *\n * @param {string} content with BOM\n * @return {string} content value without BOM\n */\nfunction stripBOM(content) {\n if (content.charCodeAt(0) === 0xFEFF) {\n content = content.slice(1);\n }\n return content;\n}\n\nmodule.exports = {\n isArray: isArray,\n isArrayBuffer: isArrayBuffer,\n isBuffer: isBuffer,\n isFormData: isFormData,\n isArrayBufferView: isArrayBufferView,\n isString: isString,\n isNumber: isNumber,\n isObject: isObject,\n isPlainObject: isPlainObject,\n isUndefined: isUndefined,\n isDate: isDate,\n isFile: isFile,\n isBlob: isBlob,\n isFunction: isFunction,\n isStream: isStream,\n isURLSearchParams: isURLSearchParams,\n isStandardBrowserEnv: isStandardBrowserEnv,\n forEach: forEach,\n merge: merge,\n extend: extend,\n trim: trim,\n stripBOM: stripBOM\n};\n"],"sourceRoot":""} \ No newline at end of file diff --git a/node_modules/dhn-api/node_modules/axios/dist/axios.min.js b/node_modules/dhn-api/node_modules/axios/dist/axios.min.js new file mode 100644 index 000000000..d5b138ad0 --- /dev/null +++ b/node_modules/dhn-api/node_modules/axios/dist/axios.min.js @@ -0,0 +1,3 @@ +/* axios v0.21.4 | (c) 2021 by Matt Zabriskie */ +!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.axios=t():e.axios=t()}(window,(function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=10)}([function(e,t,r){"use strict";var n=r(2),o=Object.prototype.toString;function i(e){return"[object Array]"===o.call(e)}function s(e){return void 0===e}function a(e){return null!==e&&"object"==typeof e}function u(e){if("[object Object]"!==o.call(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}function c(e){return"[object Function]"===o.call(e)}function f(e,t){if(null!=e)if("object"!=typeof e&&(e=[e]),i(e))for(var r=0,n=e.length;r=200&&e<300}};c.headers={common:{Accept:"application/json, text/plain, */*"}},n.forEach(["delete","get","head"],(function(e){c.headers[e]={}})),n.forEach(["post","put","patch"],(function(e){c.headers[e]=n.merge(s)})),e.exports=c},function(e,t,r){"use strict";e.exports=function(e,t){return function(){for(var r=new Array(arguments.length),n=0;n=0)return;s[t]="set-cookie"===t?(s[t]?s[t]:[]).concat([r]):s[t]?s[t]+", "+r:r}})),s):s}},function(e,t,r){"use strict";var n=r(0);e.exports=n.isStandardBrowserEnv()?function(){var e,t=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a");function o(e){var n=e;return t&&(r.setAttribute("href",n),n=r.href),r.setAttribute("href",n),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:"/"===r.pathname.charAt(0)?r.pathname:"/"+r.pathname}}return e=o(window.location.href),function(t){var r=n.isString(t)?o(t):t;return r.protocol===e.protocol&&r.host===e.host}}():function(){return!0}},function(e,t,r){"use strict";var n=r(25),o={};["object","boolean","number","function","string","symbol"].forEach((function(e,t){o[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}}));var i={},s=n.version.split(".");function a(e,t){for(var r=t?t.split("."):s,n=e.split("."),o=0;o<3;o++){if(r[o]>n[o])return!0;if(r[o]0;){var i=n[o],s=t[i];if(s){var a=e[i],u=void 0===a||s(a,i,e);if(!0!==u)throw new TypeError("option "+i+" must be "+u)}else if(!0!==r)throw Error("Unknown option "+i)}},validators:o}},function(e){e.exports=JSON.parse('{"name":"axios","version":"0.21.4","description":"Promise based HTTP client for the browser and node.js","main":"index.js","scripts":{"test":"grunt test","start":"node ./sandbox/server.js","build":"NODE_ENV=production grunt build","preversion":"npm test","version":"npm run build && grunt version && git add -A dist && git add CHANGELOG.md bower.json package.json","postversion":"git push && git push --tags","examples":"node ./examples/server.js","coveralls":"cat coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js","fix":"eslint --fix lib/**/*.js"},"repository":{"type":"git","url":"https://github.com/axios/axios.git"},"keywords":["xhr","http","ajax","promise","node"],"author":"Matt Zabriskie","license":"MIT","bugs":{"url":"https://github.com/axios/axios/issues"},"homepage":"https://axios-http.com","devDependencies":{"coveralls":"^3.0.0","es6-promise":"^4.2.4","grunt":"^1.3.0","grunt-banner":"^0.6.0","grunt-cli":"^1.2.0","grunt-contrib-clean":"^1.1.0","grunt-contrib-watch":"^1.0.0","grunt-eslint":"^23.0.0","grunt-karma":"^4.0.0","grunt-mocha-test":"^0.13.3","grunt-ts":"^6.0.0-beta.19","grunt-webpack":"^4.0.2","istanbul-instrumenter-loader":"^1.0.0","jasmine-core":"^2.4.1","karma":"^6.3.2","karma-chrome-launcher":"^3.1.0","karma-firefox-launcher":"^2.1.0","karma-jasmine":"^1.1.1","karma-jasmine-ajax":"^0.1.13","karma-safari-launcher":"^1.0.0","karma-sauce-launcher":"^4.3.6","karma-sinon":"^1.0.5","karma-sourcemap-loader":"^0.3.8","karma-webpack":"^4.0.2","load-grunt-tasks":"^3.5.2","minimist":"^1.2.0","mocha":"^8.2.1","sinon":"^4.5.0","terser-webpack-plugin":"^4.2.3","typescript":"^4.0.5","url-search-params":"^0.10.0","webpack":"^4.44.2","webpack-dev-server":"^3.11.0"},"browser":{"./lib/adapters/http.js":"./lib/adapters/xhr.js"},"jsdelivr":"dist/axios.min.js","unpkg":"dist/axios.min.js","typings":"./index.d.ts","dependencies":{"follow-redirects":"^1.14.0"},"bundlesize":[{"path":"./dist/axios.min.js","threshold":"5kB"}]}')},function(e,t,r){"use strict";var n=r(9);function o(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise((function(e){t=e}));var r=this;e((function(e){r.reason||(r.reason=new n(e),t(r.reason))}))}o.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},o.source=function(){var e;return{token:new o((function(t){e=t})),cancel:e}},e.exports=o},function(e,t,r){"use strict";e.exports=function(e){return function(t){return e.apply(null,t)}}},function(e,t,r){"use strict";e.exports=function(e){return"object"==typeof e&&!0===e.isAxiosError}}])})); +//# sourceMappingURL=axios.min.map \ No newline at end of file diff --git a/node_modules/dhn-api/node_modules/axios/dist/axios.min.map b/node_modules/dhn-api/node_modules/axios/dist/axios.min.map new file mode 100644 index 000000000..468a5babc --- /dev/null +++ b/node_modules/dhn-api/node_modules/axios/dist/axios.min.map @@ -0,0 +1 @@ +{"version":3,"sources":["webpack://axios/webpack/universalModuleDefinition","webpack://axios/webpack/bootstrap","webpack://axios/./lib/utils.js","webpack://axios/./lib/defaults.js","webpack://axios/./lib/helpers/bind.js","webpack://axios/./lib/helpers/buildURL.js","webpack://axios/./lib/core/enhanceError.js","webpack://axios/./lib/adapters/xhr.js","webpack://axios/./lib/core/createError.js","webpack://axios/./lib/cancel/isCancel.js","webpack://axios/./lib/core/mergeConfig.js","webpack://axios/./lib/cancel/Cancel.js","webpack://axios/./index.js","webpack://axios/./lib/axios.js","webpack://axios/./lib/core/Axios.js","webpack://axios/./lib/core/InterceptorManager.js","webpack://axios/./lib/core/dispatchRequest.js","webpack://axios/./lib/core/transformData.js","webpack://axios/./lib/helpers/normalizeHeaderName.js","webpack://axios/./lib/core/settle.js","webpack://axios/./lib/helpers/cookies.js","webpack://axios/./lib/core/buildFullPath.js","webpack://axios/./lib/helpers/isAbsoluteURL.js","webpack://axios/./lib/helpers/combineURLs.js","webpack://axios/./lib/helpers/parseHeaders.js","webpack://axios/./lib/helpers/isURLSameOrigin.js","webpack://axios/./lib/helpers/validator.js","webpack://axios/./lib/cancel/CancelToken.js","webpack://axios/./lib/helpers/spread.js","webpack://axios/./lib/helpers/isAxiosError.js"],"names":["root","factory","exports","module","define","amd","window","installedModules","__webpack_require__","moduleId","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","toString","isArray","val","isUndefined","isObject","isPlainObject","getPrototypeOf","isFunction","forEach","obj","fn","length","isArrayBuffer","isBuffer","constructor","isFormData","FormData","isArrayBufferView","ArrayBuffer","isView","buffer","isString","isNumber","isDate","isFile","isBlob","isStream","pipe","isURLSearchParams","URLSearchParams","isStandardBrowserEnv","navigator","product","document","merge","result","assignValue","slice","arguments","extend","a","b","thisArg","trim","str","replace","stripBOM","content","charCodeAt","utils","normalizeHeaderName","enhanceError","DEFAULT_CONTENT_TYPE","setContentTypeIfUnset","headers","adapter","defaults","transitional","silentJSONParsing","forcedJSONParsing","clarifyTimeoutError","XMLHttpRequest","process","transformRequest","data","rawValue","parser","encoder","JSON","parse","e","stringify","stringifySafely","transformResponse","this","strictJSONParsing","responseType","timeout","xsrfCookieName","xsrfHeaderName","maxContentLength","maxBodyLength","validateStatus","status","common","method","args","Array","apply","encode","encodeURIComponent","url","params","paramsSerializer","serializedParams","parts","v","toISOString","push","join","hashmarkIndex","indexOf","error","config","code","request","response","isAxiosError","toJSON","message","description","number","fileName","lineNumber","columnNumber","stack","settle","cookies","buildURL","buildFullPath","parseHeaders","isURLSameOrigin","createError","Promise","resolve","reject","requestData","requestHeaders","auth","username","password","unescape","Authorization","btoa","fullPath","baseURL","onloadend","responseHeaders","getAllResponseHeaders","responseText","statusText","open","toUpperCase","onreadystatechange","readyState","responseURL","setTimeout","onabort","onerror","ontimeout","timeoutErrorMessage","xsrfValue","withCredentials","read","undefined","toLowerCase","setRequestHeader","onDownloadProgress","addEventListener","onUploadProgress","upload","cancelToken","promise","then","cancel","abort","send","Error","__CANCEL__","config1","config2","valueFromConfig2Keys","mergeDeepPropertiesKeys","defaultToConfig2Keys","directMergeKeys","getMergedValue","target","source","mergeDeepProperties","prop","axiosKeys","concat","otherKeys","keys","filter","Cancel","Axios","mergeConfig","createInstance","defaultConfig","context","instance","axios","instanceConfig","CancelToken","isCancel","all","promises","spread","default","InterceptorManager","dispatchRequest","validator","validators","interceptors","assertOptions","boolean","requestInterceptorChain","synchronousRequestInterceptors","interceptor","runWhen","synchronous","unshift","fulfilled","rejected","responseInterceptorChain","chain","shift","newConfig","onFulfilled","onRejected","getUri","handlers","use","options","eject","id","h","transformData","throwIfCancellationRequested","throwIfRequested","reason","fns","normalizedName","write","expires","path","domain","secure","cookie","Date","toGMTString","match","RegExp","decodeURIComponent","remove","now","isAbsoluteURL","combineURLs","requestedURL","test","relativeURL","ignoreDuplicateOf","parsed","split","line","substr","originURL","msie","userAgent","urlParsingNode","createElement","resolveURL","href","setAttribute","protocol","host","search","hash","hostname","port","pathname","charAt","location","requestURL","pkg","type","thing","deprecatedWarnings","currentVerArr","version","isOlderVersion","thanVersion","pkgVersionArr","destVer","isDeprecated","formatMessage","opt","desc","opts","console","warn","schema","allowUnknown","TypeError","executor","resolvePromise","token","callback","arr","payload"],"mappings":"CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,IACQ,mBAAXG,QAAyBA,OAAOC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ACvC,GAAI5J,KAAK6J,OACP,MAAM7J,KAAK6J,QAQfrC,EAAYjB,OAAS,WACnB,IAAIb,EAIJ,MAAO,CACLqI,MAJU,IAAIvG,GAAY,SAAkB7N,GAC5C+L,EAAS/L,KAIT+L,OAAQA,IAIZ3M,EAAOD,QAAU0O,G,6BClCjBzO,EAAOD,QAAU,SAAgBkV,GAC/B,OAAO,SAAcC,GACnB,OAAOD,EAASlN,MAAM,KAAMmN,M,6BChBhClV,EAAOD,QAAU,SAAsBoV,GACrC,MAA2B,iBAAZA,IAAmD,IAAzBA,EAAQjM","file":"axios.min.js","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[\"axios\"] = factory();\n\telse\n\t\troot[\"axios\"] = factory();\n})(window, function() {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 10);\n","'use strict';\n\nvar bind = require('./helpers/bind');\n\n// utils is a library of generic helper functions non-specific to axios\n\nvar toString = Object.prototype.toString;\n\n/**\n * Determine if a value is an Array\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an Array, otherwise false\n */\nfunction isArray(val) {\n return toString.call(val) === '[object Array]';\n}\n\n/**\n * Determine if a value is undefined\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if the value is undefined, otherwise false\n */\nfunction isUndefined(val) {\n return typeof val === 'undefined';\n}\n\n/**\n * Determine if a value is a Buffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Buffer, otherwise false\n */\nfunction isBuffer(val) {\n return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor)\n && typeof val.constructor.isBuffer === 'function' && val.constructor.isBuffer(val);\n}\n\n/**\n * Determine if a value is an ArrayBuffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an ArrayBuffer, otherwise false\n */\nfunction isArrayBuffer(val) {\n return toString.call(val) === '[object ArrayBuffer]';\n}\n\n/**\n * Determine if a value is a FormData\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an FormData, otherwise false\n */\nfunction isFormData(val) {\n return (typeof FormData !== 'undefined') && (val instanceof FormData);\n}\n\n/**\n * Determine if a value is a view on an ArrayBuffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false\n */\nfunction isArrayBufferView(val) {\n var result;\n if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {\n result = ArrayBuffer.isView(val);\n } else {\n result = (val) && (val.buffer) && (val.buffer instanceof ArrayBuffer);\n }\n return result;\n}\n\n/**\n * Determine if a value is a String\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a String, otherwise false\n */\nfunction isString(val) {\n return typeof val === 'string';\n}\n\n/**\n * Determine if a value is a Number\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Number, otherwise false\n */\nfunction isNumber(val) {\n return typeof val === 'number';\n}\n\n/**\n * Determine if a value is an Object\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an Object, otherwise false\n */\nfunction isObject(val) {\n return val !== null && typeof val === 'object';\n}\n\n/**\n * Determine if a value is a plain Object\n *\n * @param {Object} val The value to test\n * @return {boolean} True if value is a plain Object, otherwise false\n */\nfunction isPlainObject(val) {\n if (toString.call(val) !== '[object Object]') {\n return false;\n }\n\n var prototype = Object.getPrototypeOf(val);\n return prototype === null || prototype === Object.prototype;\n}\n\n/**\n * Determine if a value is a Date\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Date, otherwise false\n */\nfunction isDate(val) {\n return toString.call(val) === '[object Date]';\n}\n\n/**\n * Determine if a value is a File\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a File, otherwise false\n */\nfunction isFile(val) {\n return toString.call(val) === '[object File]';\n}\n\n/**\n * Determine if a value is a Blob\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Blob, otherwise false\n */\nfunction isBlob(val) {\n return toString.call(val) === '[object Blob]';\n}\n\n/**\n * Determine if a value is a Function\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Function, otherwise false\n */\nfunction isFunction(val) {\n return toString.call(val) === '[object Function]';\n}\n\n/**\n * Determine if a value is a Stream\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Stream, otherwise false\n */\nfunction isStream(val) {\n return isObject(val) && isFunction(val.pipe);\n}\n\n/**\n * Determine if a value is a URLSearchParams object\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a URLSearchParams object, otherwise false\n */\nfunction isURLSearchParams(val) {\n return typeof URLSearchParams !== 'undefined' && val instanceof URLSearchParams;\n}\n\n/**\n * Trim excess whitespace off the beginning and end of a string\n *\n * @param {String} str The String to trim\n * @returns {String} The String freed of excess whitespace\n */\nfunction trim(str) {\n return str.trim ? str.trim() : str.replace(/^\\s+|\\s+$/g, '');\n}\n\n/**\n * Determine if we're running in a standard browser environment\n *\n * This allows axios to run in a web worker, and react-native.\n * Both environments support XMLHttpRequest, but not fully standard globals.\n *\n * web workers:\n * typeof window -> undefined\n * typeof document -> undefined\n *\n * react-native:\n * navigator.product -> 'ReactNative'\n * nativescript\n * navigator.product -> 'NativeScript' or 'NS'\n */\nfunction isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}\n\n/**\n * Iterate over an Array or an Object invoking a function for each item.\n *\n * If `obj` is an Array callback will be called passing\n * the value, index, and complete array for each item.\n *\n * If 'obj' is an Object callback will be called passing\n * the value, key, and complete object for each property.\n *\n * @param {Object|Array} obj The object to iterate\n * @param {Function} fn The callback to invoke for each item\n */\nfunction forEach(obj, fn) {\n // Don't bother if no value provided\n if (obj === null || typeof obj === 'undefined') {\n return;\n }\n\n // Force an array if not already something iterable\n if (typeof obj !== 'object') {\n /*eslint no-param-reassign:0*/\n obj = [obj];\n }\n\n if (isArray(obj)) {\n // Iterate over array values\n for (var i = 0, l = obj.length; i < l; i++) {\n fn.call(null, obj[i], i, obj);\n }\n } else {\n // Iterate over object keys\n for (var key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key)) {\n fn.call(null, obj[key], key, obj);\n }\n }\n }\n}\n\n/**\n * Accepts varargs expecting each argument to be an object, then\n * immutably merges the properties of each object and returns result.\n *\n * When multiple objects contain the same key the later object in\n * the arguments list will take precedence.\n *\n * Example:\n *\n * ```js\n * var result = merge({foo: 123}, {foo: 456});\n * console.log(result.foo); // outputs 456\n * ```\n *\n * @param {Object} obj1 Object to merge\n * @returns {Object} Result of all merge properties\n */\nfunction merge(/* obj1, obj2, obj3, ... */) {\n var result = {};\n function assignValue(val, key) {\n if (isPlainObject(result[key]) && isPlainObject(val)) {\n result[key] = merge(result[key], val);\n } else if (isPlainObject(val)) {\n result[key] = merge({}, val);\n } else if (isArray(val)) {\n result[key] = val.slice();\n } else {\n result[key] = val;\n }\n }\n\n for (var i = 0, l = arguments.length; i < l; i++) {\n forEach(arguments[i], assignValue);\n }\n return result;\n}\n\n/**\n * Extends object a by mutably adding to it the properties of object b.\n *\n * @param {Object} a The object to be extended\n * @param {Object} b The object to copy properties from\n * @param {Object} thisArg The object to bind function to\n * @return {Object} The resulting value of object a\n */\nfunction extend(a, b, thisArg) {\n forEach(b, function assignValue(val, key) {\n if (thisArg && typeof val === 'function') {\n a[key] = bind(val, thisArg);\n } else {\n a[key] = val;\n }\n });\n return a;\n}\n\n/**\n * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM)\n *\n * @param {string} content with BOM\n * @return {string} content value without BOM\n */\nfunction stripBOM(content) {\n if (content.charCodeAt(0) === 0xFEFF) {\n content = content.slice(1);\n }\n return content;\n}\n\nmodule.exports = {\n isArray: isArray,\n isArrayBuffer: isArrayBuffer,\n isBuffer: isBuffer,\n isFormData: isFormData,\n isArrayBufferView: isArrayBufferView,\n isString: isString,\n isNumber: isNumber,\n isObject: isObject,\n isPlainObject: isPlainObject,\n isUndefined: isUndefined,\n isDate: isDate,\n isFile: isFile,\n isBlob: isBlob,\n isFunction: isFunction,\n isStream: isStream,\n isURLSearchParams: isURLSearchParams,\n isStandardBrowserEnv: isStandardBrowserEnv,\n forEach: forEach,\n merge: merge,\n extend: extend,\n trim: trim,\n stripBOM: stripBOM\n};\n","'use strict';\n\nvar utils = require('./utils');\nvar normalizeHeaderName = require('./helpers/normalizeHeaderName');\nvar enhanceError = require('./core/enhanceError');\n\nvar DEFAULT_CONTENT_TYPE = {\n 'Content-Type': 'application/x-www-form-urlencoded'\n};\n\nfunction setContentTypeIfUnset(headers, value) {\n if (!utils.isUndefined(headers) && utils.isUndefined(headers['Content-Type'])) {\n headers['Content-Type'] = value;\n }\n}\n\nfunction getDefaultAdapter() {\n var adapter;\n if (typeof XMLHttpRequest !== 'undefined') {\n // For browsers use XHR adapter\n adapter = require('./adapters/xhr');\n } else if (typeof process !== 'undefined' && Object.prototype.toString.call(process) === '[object process]') {\n // For node use HTTP adapter\n adapter = require('./adapters/http');\n }\n return adapter;\n}\n\nfunction stringifySafely(rawValue, parser, encoder) {\n if (utils.isString(rawValue)) {\n try {\n (parser || JSON.parse)(rawValue);\n return utils.trim(rawValue);\n } catch (e) {\n if (e.name !== 'SyntaxError') {\n throw e;\n }\n }\n }\n\n return (encoder || JSON.stringify)(rawValue);\n}\n\nvar defaults = {\n\n transitional: {\n silentJSONParsing: true,\n forcedJSONParsing: true,\n clarifyTimeoutError: false\n },\n\n adapter: getDefaultAdapter(),\n\n transformRequest: [function transformRequest(data, headers) {\n normalizeHeaderName(headers, 'Accept');\n normalizeHeaderName(headers, 'Content-Type');\n\n if (utils.isFormData(data) ||\n utils.isArrayBuffer(data) ||\n utils.isBuffer(data) ||\n utils.isStream(data) ||\n utils.isFile(data) ||\n utils.isBlob(data)\n ) {\n return data;\n }\n if (utils.isArrayBufferView(data)) {\n return data.buffer;\n }\n if (utils.isURLSearchParams(data)) {\n setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8');\n return data.toString();\n }\n if (utils.isObject(data) || (headers && headers['Content-Type'] === 'application/json')) {\n setContentTypeIfUnset(headers, 'application/json');\n return stringifySafely(data);\n }\n return data;\n }],\n\n transformResponse: [function transformResponse(data) {\n var transitional = this.transitional;\n var silentJSONParsing = transitional && transitional.silentJSONParsing;\n var forcedJSONParsing = transitional && transitional.forcedJSONParsing;\n var strictJSONParsing = !silentJSONParsing && this.responseType === 'json';\n\n if (strictJSONParsing || (forcedJSONParsing && utils.isString(data) && data.length)) {\n try {\n return JSON.parse(data);\n } catch (e) {\n if (strictJSONParsing) {\n if (e.name === 'SyntaxError') {\n throw enhanceError(e, this, 'E_JSON_PARSE');\n }\n throw e;\n }\n }\n }\n\n return data;\n }],\n\n /**\n * A timeout in milliseconds to abort a request. If set to 0 (default) a\n * timeout is not created.\n */\n timeout: 0,\n\n xsrfCookieName: 'XSRF-TOKEN',\n xsrfHeaderName: 'X-XSRF-TOKEN',\n\n maxContentLength: -1,\n maxBodyLength: -1,\n\n validateStatus: function validateStatus(status) {\n return status >= 200 && status < 300;\n }\n};\n\ndefaults.headers = {\n common: {\n 'Accept': 'application/json, text/plain, */*'\n }\n};\n\nutils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) {\n defaults.headers[method] = {};\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE);\n});\n\nmodule.exports = defaults;\n","'use strict';\n\nmodule.exports = function bind(fn, thisArg) {\n return function wrap() {\n var args = new Array(arguments.length);\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i];\n }\n return fn.apply(thisArg, args);\n };\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\nfunction encode(val) {\n return encodeURIComponent(val).\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%20/g, '+').\n replace(/%5B/gi, '[').\n replace(/%5D/gi, ']');\n}\n\n/**\n * Build a URL by appending params to the end\n *\n * @param {string} url The base of the url (e.g., http://www.google.com)\n * @param {object} [params] The params to be appended\n * @returns {string} The formatted url\n */\nmodule.exports = function buildURL(url, params, paramsSerializer) {\n /*eslint no-param-reassign:0*/\n if (!params) {\n return url;\n }\n\n var serializedParams;\n if (paramsSerializer) {\n serializedParams = paramsSerializer(params);\n } else if (utils.isURLSearchParams(params)) {\n serializedParams = params.toString();\n } else {\n var parts = [];\n\n utils.forEach(params, function serialize(val, key) {\n if (val === null || typeof val === 'undefined') {\n return;\n }\n\n if (utils.isArray(val)) {\n key = key + '[]';\n } else {\n val = [val];\n }\n\n utils.forEach(val, function parseValue(v) {\n if (utils.isDate(v)) {\n v = v.toISOString();\n } else if (utils.isObject(v)) {\n v = JSON.stringify(v);\n }\n parts.push(encode(key) + '=' + encode(v));\n });\n });\n\n serializedParams = parts.join('&');\n }\n\n if (serializedParams) {\n var hashmarkIndex = url.indexOf('#');\n if (hashmarkIndex !== -1) {\n url = url.slice(0, hashmarkIndex);\n }\n\n url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;\n }\n\n return url;\n};\n","'use strict';\n\n/**\n * Update an Error with the specified config, error code, and response.\n *\n * @param {Error} error The error to update.\n * @param {Object} config The config.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n * @returns {Error} The error.\n */\nmodule.exports = function enhanceError(error, config, code, request, response) {\n error.config = config;\n if (code) {\n error.code = code;\n }\n\n error.request = request;\n error.response = response;\n error.isAxiosError = true;\n\n error.toJSON = function toJSON() {\n return {\n // Standard\n message: this.message,\n name: this.name,\n // Microsoft\n description: this.description,\n number: this.number,\n // Mozilla\n fileName: this.fileName,\n lineNumber: this.lineNumber,\n columnNumber: this.columnNumber,\n stack: this.stack,\n // Axios\n config: this.config,\n code: this.code\n };\n };\n return error;\n};\n","'use strict';\n\nvar utils = require('./../utils');\nvar settle = require('./../core/settle');\nvar cookies = require('./../helpers/cookies');\nvar buildURL = require('./../helpers/buildURL');\nvar buildFullPath = require('../core/buildFullPath');\nvar parseHeaders = require('./../helpers/parseHeaders');\nvar isURLSameOrigin = require('./../helpers/isURLSameOrigin');\nvar createError = require('../core/createError');\n\nmodule.exports = function xhrAdapter(config) {\n return new Promise(function dispatchXhrRequest(resolve, reject) {\n var requestData = config.data;\n var requestHeaders = config.headers;\n var responseType = config.responseType;\n\n if (utils.isFormData(requestData)) {\n delete requestHeaders['Content-Type']; // Let the browser set it\n }\n\n var request = new XMLHttpRequest();\n\n // HTTP basic authentication\n if (config.auth) {\n var username = config.auth.username || '';\n var password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : '';\n requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password);\n }\n\n var fullPath = buildFullPath(config.baseURL, config.url);\n request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true);\n\n // Set the request timeout in MS\n request.timeout = config.timeout;\n\n function onloadend() {\n if (!request) {\n return;\n }\n // Prepare the response\n var responseHeaders = 'getAllResponseHeaders' in request ? parseHeaders(request.getAllResponseHeaders()) : null;\n var responseData = !responseType || responseType === 'text' || responseType === 'json' ?\n request.responseText : request.response;\n var response = {\n data: responseData,\n status: request.status,\n statusText: request.statusText,\n headers: responseHeaders,\n config: config,\n request: request\n };\n\n settle(resolve, reject, response);\n\n // Clean up request\n request = null;\n }\n\n if ('onloadend' in request) {\n // Use onloadend if available\n request.onloadend = onloadend;\n } else {\n // Listen for ready state to emulate onloadend\n request.onreadystatechange = function handleLoad() {\n if (!request || request.readyState !== 4) {\n return;\n }\n\n // The request errored out and we didn't get a response, this will be\n // handled by onerror instead\n // With one exception: request that using file: protocol, most browsers\n // will return status as 0 even though it's a successful request\n if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {\n return;\n }\n // readystate handler is calling before onerror or ontimeout handlers,\n // so we should call onloadend on the next 'tick'\n setTimeout(onloadend);\n };\n }\n\n // Handle browser request cancellation (as opposed to a manual cancellation)\n request.onabort = function handleAbort() {\n if (!request) {\n return;\n }\n\n reject(createError('Request aborted', config, 'ECONNABORTED', request));\n\n // Clean up request\n request = null;\n };\n\n // Handle low level network errors\n request.onerror = function handleError() {\n // Real errors are hidden from us by the browser\n // onerror should only fire if it's a network error\n reject(createError('Network Error', config, null, request));\n\n // Clean up request\n request = null;\n };\n\n // Handle timeout\n request.ontimeout = function handleTimeout() {\n var timeoutErrorMessage = 'timeout of ' + config.timeout + 'ms exceeded';\n if (config.timeoutErrorMessage) {\n timeoutErrorMessage = config.timeoutErrorMessage;\n }\n reject(createError(\n timeoutErrorMessage,\n config,\n config.transitional && config.transitional.clarifyTimeoutError ? 'ETIMEDOUT' : 'ECONNABORTED',\n request));\n\n // Clean up request\n request = null;\n };\n\n // Add xsrf header\n // This is only done if running in a standard browser environment.\n // Specifically not if we're in a web worker, or react-native.\n if (utils.isStandardBrowserEnv()) {\n // Add xsrf header\n var xsrfValue = (config.withCredentials || isURLSameOrigin(fullPath)) && config.xsrfCookieName ?\n cookies.read(config.xsrfCookieName) :\n undefined;\n\n if (xsrfValue) {\n requestHeaders[config.xsrfHeaderName] = xsrfValue;\n }\n }\n\n // Add headers to the request\n if ('setRequestHeader' in request) {\n utils.forEach(requestHeaders, function setRequestHeader(val, key) {\n if (typeof requestData === 'undefined' && key.toLowerCase() === 'content-type') {\n // Remove Content-Type if data is undefined\n delete requestHeaders[key];\n } else {\n // Otherwise add header to the request\n request.setRequestHeader(key, val);\n }\n });\n }\n\n // Add withCredentials to request if needed\n if (!utils.isUndefined(config.withCredentials)) {\n request.withCredentials = !!config.withCredentials;\n }\n\n // Add responseType to request if needed\n if (responseType && responseType !== 'json') {\n request.responseType = config.responseType;\n }\n\n // Handle progress if needed\n if (typeof config.onDownloadProgress === 'function') {\n request.addEventListener('progress', config.onDownloadProgress);\n }\n\n // Not all browsers support upload events\n if (typeof config.onUploadProgress === 'function' && request.upload) {\n request.upload.addEventListener('progress', config.onUploadProgress);\n }\n\n if (config.cancelToken) {\n // Handle cancellation\n config.cancelToken.promise.then(function onCanceled(cancel) {\n if (!request) {\n return;\n }\n\n request.abort();\n reject(cancel);\n // Clean up request\n request = null;\n });\n }\n\n if (!requestData) {\n requestData = null;\n }\n\n // Send the request\n request.send(requestData);\n });\n};\n","'use strict';\n\nvar enhanceError = require('./enhanceError');\n\n/**\n * Create an Error with the specified message, config, error code, request and response.\n *\n * @param {string} message The error message.\n * @param {Object} config The config.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n * @returns {Error} The created error.\n */\nmodule.exports = function createError(message, config, code, request, response) {\n var error = new Error(message);\n return enhanceError(error, config, code, request, response);\n};\n","'use strict';\n\nmodule.exports = function isCancel(value) {\n return !!(value && value.__CANCEL__);\n};\n","'use strict';\n\nvar utils = require('../utils');\n\n/**\n * Config-specific merge-function which creates a new config-object\n * by merging two configuration objects together.\n *\n * @param {Object} config1\n * @param {Object} config2\n * @returns {Object} New object resulting from merging config2 to config1\n */\nmodule.exports = function mergeConfig(config1, config2) {\n // eslint-disable-next-line no-param-reassign\n config2 = config2 || {};\n var config = {};\n\n var valueFromConfig2Keys = ['url', 'method', 'data'];\n var mergeDeepPropertiesKeys = ['headers', 'auth', 'proxy', 'params'];\n var defaultToConfig2Keys = [\n 'baseURL', 'transformRequest', 'transformResponse', 'paramsSerializer',\n 'timeout', 'timeoutMessage', 'withCredentials', 'adapter', 'responseType', 'xsrfCookieName',\n 'xsrfHeaderName', 'onUploadProgress', 'onDownloadProgress', 'decompress',\n 'maxContentLength', 'maxBodyLength', 'maxRedirects', 'transport', 'httpAgent',\n 'httpsAgent', 'cancelToken', 'socketPath', 'responseEncoding'\n ];\n var directMergeKeys = ['validateStatus'];\n\n function getMergedValue(target, source) {\n if (utils.isPlainObject(target) && utils.isPlainObject(source)) {\n return utils.merge(target, source);\n } else if (utils.isPlainObject(source)) {\n return utils.merge({}, source);\n } else if (utils.isArray(source)) {\n return source.slice();\n }\n return source;\n }\n\n function mergeDeepProperties(prop) {\n if (!utils.isUndefined(config2[prop])) {\n config[prop] = getMergedValue(config1[prop], config2[prop]);\n } else if (!utils.isUndefined(config1[prop])) {\n config[prop] = getMergedValue(undefined, config1[prop]);\n }\n }\n\n utils.forEach(valueFromConfig2Keys, function valueFromConfig2(prop) {\n if (!utils.isUndefined(config2[prop])) {\n config[prop] = getMergedValue(undefined, config2[prop]);\n }\n });\n\n utils.forEach(mergeDeepPropertiesKeys, mergeDeepProperties);\n\n utils.forEach(defaultToConfig2Keys, function defaultToConfig2(prop) {\n if (!utils.isUndefined(config2[prop])) {\n config[prop] = getMergedValue(undefined, config2[prop]);\n } else if (!utils.isUndefined(config1[prop])) {\n config[prop] = getMergedValue(undefined, config1[prop]);\n }\n });\n\n utils.forEach(directMergeKeys, function merge(prop) {\n if (prop in config2) {\n config[prop] = getMergedValue(config1[prop], config2[prop]);\n } else if (prop in config1) {\n config[prop] = getMergedValue(undefined, config1[prop]);\n }\n });\n\n var axiosKeys = valueFromConfig2Keys\n .concat(mergeDeepPropertiesKeys)\n .concat(defaultToConfig2Keys)\n .concat(directMergeKeys);\n\n var otherKeys = Object\n .keys(config1)\n .concat(Object.keys(config2))\n .filter(function filterAxiosKeys(key) {\n return axiosKeys.indexOf(key) === -1;\n });\n\n utils.forEach(otherKeys, mergeDeepProperties);\n\n return config;\n};\n","'use strict';\n\n/**\n * A `Cancel` is an object that is thrown when an operation is canceled.\n *\n * @class\n * @param {string=} message The message.\n */\nfunction Cancel(message) {\n this.message = message;\n}\n\nCancel.prototype.toString = function toString() {\n return 'Cancel' + (this.message ? ': ' + this.message : '');\n};\n\nCancel.prototype.__CANCEL__ = true;\n\nmodule.exports = Cancel;\n","module.exports = require('./lib/axios');","'use strict';\n\nvar utils = require('./utils');\nvar bind = require('./helpers/bind');\nvar Axios = require('./core/Axios');\nvar mergeConfig = require('./core/mergeConfig');\nvar defaults = require('./defaults');\n\n/**\n * Create an instance of Axios\n *\n * @param {Object} defaultConfig The default config for the instance\n * @return {Axios} A new instance of Axios\n */\nfunction createInstance(defaultConfig) {\n var context = new Axios(defaultConfig);\n var instance = bind(Axios.prototype.request, context);\n\n // Copy axios.prototype to instance\n utils.extend(instance, Axios.prototype, context);\n\n // Copy context to instance\n utils.extend(instance, context);\n\n return instance;\n}\n\n// Create the default instance to be exported\nvar axios = createInstance(defaults);\n\n// Expose Axios class to allow class inheritance\naxios.Axios = Axios;\n\n// Factory for creating new instances\naxios.create = function create(instanceConfig) {\n return createInstance(mergeConfig(axios.defaults, instanceConfig));\n};\n\n// Expose Cancel & CancelToken\naxios.Cancel = require('./cancel/Cancel');\naxios.CancelToken = require('./cancel/CancelToken');\naxios.isCancel = require('./cancel/isCancel');\n\n// Expose all/spread\naxios.all = function all(promises) {\n return Promise.all(promises);\n};\naxios.spread = require('./helpers/spread');\n\n// Expose isAxiosError\naxios.isAxiosError = require('./helpers/isAxiosError');\n\nmodule.exports = axios;\n\n// Allow use of default import syntax in TypeScript\nmodule.exports.default = axios;\n","'use strict';\n\nvar utils = require('./../utils');\nvar buildURL = require('../helpers/buildURL');\nvar InterceptorManager = require('./InterceptorManager');\nvar dispatchRequest = require('./dispatchRequest');\nvar mergeConfig = require('./mergeConfig');\nvar validator = require('../helpers/validator');\n\nvar validators = validator.validators;\n/**\n * Create a new instance of Axios\n *\n * @param {Object} instanceConfig The default config for the instance\n */\nfunction Axios(instanceConfig) {\n this.defaults = instanceConfig;\n this.interceptors = {\n request: new InterceptorManager(),\n response: new InterceptorManager()\n };\n}\n\n/**\n * Dispatch a request\n *\n * @param {Object} config The config specific for this request (merged with this.defaults)\n */\nAxios.prototype.request = function request(config) {\n /*eslint no-param-reassign:0*/\n // Allow for axios('example/url'[, config]) a la fetch API\n if (typeof config === 'string') {\n config = arguments[1] || {};\n config.url = arguments[0];\n } else {\n config = config || {};\n }\n\n config = mergeConfig(this.defaults, config);\n\n // Set config.method\n if (config.method) {\n config.method = config.method.toLowerCase();\n } else if (this.defaults.method) {\n config.method = this.defaults.method.toLowerCase();\n } else {\n config.method = 'get';\n }\n\n var transitional = config.transitional;\n\n if (transitional !== undefined) {\n validator.assertOptions(transitional, {\n silentJSONParsing: validators.transitional(validators.boolean, '1.0.0'),\n forcedJSONParsing: validators.transitional(validators.boolean, '1.0.0'),\n clarifyTimeoutError: validators.transitional(validators.boolean, '1.0.0')\n }, false);\n }\n\n // filter out skipped interceptors\n var requestInterceptorChain = [];\n var synchronousRequestInterceptors = true;\n this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {\n if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) {\n return;\n }\n\n synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;\n\n requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);\n });\n\n var responseInterceptorChain = [];\n this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {\n responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);\n });\n\n var promise;\n\n if (!synchronousRequestInterceptors) {\n var chain = [dispatchRequest, undefined];\n\n Array.prototype.unshift.apply(chain, requestInterceptorChain);\n chain = chain.concat(responseInterceptorChain);\n\n promise = Promise.resolve(config);\n while (chain.length) {\n promise = promise.then(chain.shift(), chain.shift());\n }\n\n return promise;\n }\n\n\n var newConfig = config;\n while (requestInterceptorChain.length) {\n var onFulfilled = requestInterceptorChain.shift();\n var onRejected = requestInterceptorChain.shift();\n try {\n newConfig = onFulfilled(newConfig);\n } catch (error) {\n onRejected(error);\n break;\n }\n }\n\n try {\n promise = dispatchRequest(newConfig);\n } catch (error) {\n return Promise.reject(error);\n }\n\n while (responseInterceptorChain.length) {\n promise = promise.then(responseInterceptorChain.shift(), responseInterceptorChain.shift());\n }\n\n return promise;\n};\n\nAxios.prototype.getUri = function getUri(config) {\n config = mergeConfig(this.defaults, config);\n return buildURL(config.url, config.params, config.paramsSerializer).replace(/^\\?/, '');\n};\n\n// Provide aliases for supported request methods\nutils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, config) {\n return this.request(mergeConfig(config || {}, {\n method: method,\n url: url,\n data: (config || {}).data\n }));\n };\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, data, config) {\n return this.request(mergeConfig(config || {}, {\n method: method,\n url: url,\n data: data\n }));\n };\n});\n\nmodule.exports = Axios;\n","'use strict';\n\nvar utils = require('./../utils');\n\nfunction InterceptorManager() {\n this.handlers = [];\n}\n\n/**\n * Add a new interceptor to the stack\n *\n * @param {Function} fulfilled The function to handle `then` for a `Promise`\n * @param {Function} rejected The function to handle `reject` for a `Promise`\n *\n * @return {Number} An ID used to remove interceptor later\n */\nInterceptorManager.prototype.use = function use(fulfilled, rejected, options) {\n this.handlers.push({\n fulfilled: fulfilled,\n rejected: rejected,\n synchronous: options ? options.synchronous : false,\n runWhen: options ? options.runWhen : null\n });\n return this.handlers.length - 1;\n};\n\n/**\n * Remove an interceptor from the stack\n *\n * @param {Number} id The ID that was returned by `use`\n */\nInterceptorManager.prototype.eject = function eject(id) {\n if (this.handlers[id]) {\n this.handlers[id] = null;\n }\n};\n\n/**\n * Iterate over all the registered interceptors\n *\n * This method is particularly useful for skipping over any\n * interceptors that may have become `null` calling `eject`.\n *\n * @param {Function} fn The function to call for each interceptor\n */\nInterceptorManager.prototype.forEach = function forEach(fn) {\n utils.forEach(this.handlers, function forEachHandler(h) {\n if (h !== null) {\n fn(h);\n }\n });\n};\n\nmodule.exports = InterceptorManager;\n","'use strict';\n\nvar utils = require('./../utils');\nvar transformData = require('./transformData');\nvar isCancel = require('../cancel/isCancel');\nvar defaults = require('../defaults');\n\n/**\n * Throws a `Cancel` if cancellation has been requested.\n */\nfunction throwIfCancellationRequested(config) {\n if (config.cancelToken) {\n config.cancelToken.throwIfRequested();\n }\n}\n\n/**\n * Dispatch a request to the server using the configured adapter.\n *\n * @param {object} config The config that is to be used for the request\n * @returns {Promise} The Promise to be fulfilled\n */\nmodule.exports = function dispatchRequest(config) {\n throwIfCancellationRequested(config);\n\n // Ensure headers exist\n config.headers = config.headers || {};\n\n // Transform request data\n config.data = transformData.call(\n config,\n config.data,\n config.headers,\n config.transformRequest\n );\n\n // Flatten headers\n config.headers = utils.merge(\n config.headers.common || {},\n config.headers[config.method] || {},\n config.headers\n );\n\n utils.forEach(\n ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],\n function cleanHeaderConfig(method) {\n delete config.headers[method];\n }\n );\n\n var adapter = config.adapter || defaults.adapter;\n\n return adapter(config).then(function onAdapterResolution(response) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n response.data = transformData.call(\n config,\n response.data,\n response.headers,\n config.transformResponse\n );\n\n return response;\n }, function onAdapterRejection(reason) {\n if (!isCancel(reason)) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n if (reason && reason.response) {\n reason.response.data = transformData.call(\n config,\n reason.response.data,\n reason.response.headers,\n config.transformResponse\n );\n }\n }\n\n return Promise.reject(reason);\n });\n};\n","'use strict';\n\nvar utils = require('./../utils');\nvar defaults = require('./../defaults');\n\n/**\n * Transform the data for a request or a response\n *\n * @param {Object|String} data The data to be transformed\n * @param {Array} headers The headers for the request or response\n * @param {Array|Function} fns A single function or Array of functions\n * @returns {*} The resulting transformed data\n */\nmodule.exports = function transformData(data, headers, fns) {\n var context = this || defaults;\n /*eslint no-param-reassign:0*/\n utils.forEach(fns, function transform(fn) {\n data = fn.call(context, data, headers);\n });\n\n return data;\n};\n","'use strict';\n\nvar utils = require('../utils');\n\nmodule.exports = function normalizeHeaderName(headers, normalizedName) {\n utils.forEach(headers, function processHeader(value, name) {\n if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) {\n headers[normalizedName] = value;\n delete headers[name];\n }\n });\n};\n","'use strict';\n\nvar createError = require('./createError');\n\n/**\n * Resolve or reject a Promise based on response status.\n *\n * @param {Function} resolve A function that resolves the promise.\n * @param {Function} reject A function that rejects the promise.\n * @param {object} response The response.\n */\nmodule.exports = function settle(resolve, reject, response) {\n var validateStatus = response.config.validateStatus;\n if (!response.status || !validateStatus || validateStatus(response.status)) {\n resolve(response);\n } else {\n reject(createError(\n 'Request failed with status code ' + response.status,\n response.config,\n null,\n response.request,\n response\n ));\n }\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\nmodule.exports = (\n utils.isStandardBrowserEnv() ?\n\n // Standard browser envs support document.cookie\n (function standardBrowserEnv() {\n return {\n write: function write(name, value, expires, path, domain, secure) {\n var cookie = [];\n cookie.push(name + '=' + encodeURIComponent(value));\n\n if (utils.isNumber(expires)) {\n cookie.push('expires=' + new Date(expires).toGMTString());\n }\n\n if (utils.isString(path)) {\n cookie.push('path=' + path);\n }\n\n if (utils.isString(domain)) {\n cookie.push('domain=' + domain);\n }\n\n if (secure === true) {\n cookie.push('secure');\n }\n\n document.cookie = cookie.join('; ');\n },\n\n read: function read(name) {\n var match = document.cookie.match(new RegExp('(^|;\\\\s*)(' + name + ')=([^;]*)'));\n return (match ? decodeURIComponent(match[3]) : null);\n },\n\n remove: function remove(name) {\n this.write(name, '', Date.now() - 86400000);\n }\n };\n })() :\n\n // Non standard browser env (web workers, react-native) lack needed support.\n (function nonStandardBrowserEnv() {\n return {\n write: function write() {},\n read: function read() { return null; },\n remove: function remove() {}\n };\n })()\n);\n","'use strict';\n\nvar isAbsoluteURL = require('../helpers/isAbsoluteURL');\nvar combineURLs = require('../helpers/combineURLs');\n\n/**\n * Creates a new URL by combining the baseURL with the requestedURL,\n * only when the requestedURL is not already an absolute URL.\n * If the requestURL is absolute, this function returns the requestedURL untouched.\n *\n * @param {string} baseURL The base URL\n * @param {string} requestedURL Absolute or relative URL to combine\n * @returns {string} The combined full path\n */\nmodule.exports = function buildFullPath(baseURL, requestedURL) {\n if (baseURL && !isAbsoluteURL(requestedURL)) {\n return combineURLs(baseURL, requestedURL);\n }\n return requestedURL;\n};\n","'use strict';\n\n/**\n * Determines whether the specified URL is absolute\n *\n * @param {string} url The URL to test\n * @returns {boolean} True if the specified URL is absolute, otherwise false\n */\nmodule.exports = function isAbsoluteURL(url) {\n // A URL is considered absolute if it begins with \"://\" or \"//\" (protocol-relative URL).\n // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed\n // by any combination of letters, digits, plus, period, or hyphen.\n return /^([a-z][a-z\\d\\+\\-\\.]*:)?\\/\\//i.test(url);\n};\n","'use strict';\n\n/**\n * Creates a new URL by combining the specified URLs\n *\n * @param {string} baseURL The base URL\n * @param {string} relativeURL The relative URL\n * @returns {string} The combined URL\n */\nmodule.exports = function combineURLs(baseURL, relativeURL) {\n return relativeURL\n ? baseURL.replace(/\\/+$/, '') + '/' + relativeURL.replace(/^\\/+/, '')\n : baseURL;\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\n// Headers whose duplicates are ignored by node\n// c.f. https://nodejs.org/api/http.html#http_message_headers\nvar ignoreDuplicateOf = [\n 'age', 'authorization', 'content-length', 'content-type', 'etag',\n 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',\n 'last-modified', 'location', 'max-forwards', 'proxy-authorization',\n 'referer', 'retry-after', 'user-agent'\n];\n\n/**\n * Parse headers into an object\n *\n * ```\n * Date: Wed, 27 Aug 2014 08:58:49 GMT\n * Content-Type: application/json\n * Connection: keep-alive\n * Transfer-Encoding: chunked\n * ```\n *\n * @param {String} headers Headers needing to be parsed\n * @returns {Object} Headers parsed into an object\n */\nmodule.exports = function parseHeaders(headers) {\n var parsed = {};\n var key;\n var val;\n var i;\n\n if (!headers) { return parsed; }\n\n utils.forEach(headers.split('\\n'), function parser(line) {\n i = line.indexOf(':');\n key = utils.trim(line.substr(0, i)).toLowerCase();\n val = utils.trim(line.substr(i + 1));\n\n if (key) {\n if (parsed[key] && ignoreDuplicateOf.indexOf(key) >= 0) {\n return;\n }\n if (key === 'set-cookie') {\n parsed[key] = (parsed[key] ? parsed[key] : []).concat([val]);\n } else {\n parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;\n }\n }\n });\n\n return parsed;\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\nmodule.exports = (\n utils.isStandardBrowserEnv() ?\n\n // Standard browser envs have full support of the APIs needed to test\n // whether the request URL is of the same origin as current location.\n (function standardBrowserEnv() {\n var msie = /(msie|trident)/i.test(navigator.userAgent);\n var urlParsingNode = document.createElement('a');\n var originURL;\n\n /**\n * Parse a URL to discover it's components\n *\n * @param {String} url The URL to be parsed\n * @returns {Object}\n */\n function resolveURL(url) {\n var href = url;\n\n if (msie) {\n // IE needs attribute set twice to normalize properties\n urlParsingNode.setAttribute('href', href);\n href = urlParsingNode.href;\n }\n\n urlParsingNode.setAttribute('href', href);\n\n // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils\n return {\n href: urlParsingNode.href,\n protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',\n host: urlParsingNode.host,\n search: urlParsingNode.search ? urlParsingNode.search.replace(/^\\?/, '') : '',\n hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',\n hostname: urlParsingNode.hostname,\n port: urlParsingNode.port,\n pathname: (urlParsingNode.pathname.charAt(0) === '/') ?\n urlParsingNode.pathname :\n '/' + urlParsingNode.pathname\n };\n }\n\n originURL = resolveURL(window.location.href);\n\n /**\n * Determine if a URL shares the same origin as the current location\n *\n * @param {String} requestURL The URL to test\n * @returns {boolean} True if URL shares the same origin, otherwise false\n */\n return function isURLSameOrigin(requestURL) {\n var parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL;\n return (parsed.protocol === originURL.protocol &&\n parsed.host === originURL.host);\n };\n })() :\n\n // Non standard browser envs (web workers, react-native) lack needed support.\n (function nonStandardBrowserEnv() {\n return function isURLSameOrigin() {\n return true;\n };\n })()\n);\n","'use strict';\n\nvar pkg = require('./../../package.json');\n\nvar validators = {};\n\n// eslint-disable-next-line func-names\n['object', 'boolean', 'number', 'function', 'string', 'symbol'].forEach(function(type, i) {\n validators[type] = function validator(thing) {\n return typeof thing === type || 'a' + (i < 1 ? 'n ' : ' ') + type;\n };\n});\n\nvar deprecatedWarnings = {};\nvar currentVerArr = pkg.version.split('.');\n\n/**\n * Compare package versions\n * @param {string} version\n * @param {string?} thanVersion\n * @returns {boolean}\n */\nfunction isOlderVersion(version, thanVersion) {\n var pkgVersionArr = thanVersion ? thanVersion.split('.') : currentVerArr;\n var destVer = version.split('.');\n for (var i = 0; i < 3; i++) {\n if (pkgVersionArr[i] > destVer[i]) {\n return true;\n } else if (pkgVersionArr[i] < destVer[i]) {\n return false;\n }\n }\n return false;\n}\n\n/**\n * Transitional option validator\n * @param {function|boolean?} validator\n * @param {string?} version\n * @param {string} message\n * @returns {function}\n */\nvalidators.transitional = function transitional(validator, version, message) {\n var isDeprecated = version && isOlderVersion(version);\n\n function formatMessage(opt, desc) {\n return '[Axios v' + pkg.version + '] Transitional option \\'' + opt + '\\'' + desc + (message ? '. ' + message : '');\n }\n\n // eslint-disable-next-line func-names\n return function(value, opt, opts) {\n if (validator === false) {\n throw new Error(formatMessage(opt, ' has been removed in ' + version));\n }\n\n if (isDeprecated && !deprecatedWarnings[opt]) {\n deprecatedWarnings[opt] = true;\n // eslint-disable-next-line no-console\n console.warn(\n formatMessage(\n opt,\n ' has been deprecated since v' + version + ' and will be removed in the near future'\n )\n );\n }\n\n return validator ? validator(value, opt, opts) : true;\n };\n};\n\n/**\n * Assert object's properties type\n * @param {object} options\n * @param {object} schema\n * @param {boolean?} allowUnknown\n */\n\nfunction assertOptions(options, schema, allowUnknown) {\n if (typeof options !== 'object') {\n throw new TypeError('options must be an object');\n }\n var keys = Object.keys(options);\n var i = keys.length;\n while (i-- > 0) {\n var opt = keys[i];\n var validator = schema[opt];\n if (validator) {\n var value = options[opt];\n var result = value === undefined || validator(value, opt, options);\n if (result !== true) {\n throw new TypeError('option ' + opt + ' must be ' + result);\n }\n continue;\n }\n if (allowUnknown !== true) {\n throw Error('Unknown option ' + opt);\n }\n }\n}\n\nmodule.exports = {\n isOlderVersion: isOlderVersion,\n assertOptions: assertOptions,\n validators: validators\n};\n","'use strict';\n\nvar Cancel = require('./Cancel');\n\n/**\n * A `CancelToken` is an object that can be used to request cancellation of an operation.\n *\n * @class\n * @param {Function} executor The executor function.\n */\nfunction CancelToken(executor) {\n if (typeof executor !== 'function') {\n throw new TypeError('executor must be a function.');\n }\n\n var resolvePromise;\n this.promise = new Promise(function promiseExecutor(resolve) {\n resolvePromise = resolve;\n });\n\n var token = this;\n executor(function cancel(message) {\n if (token.reason) {\n // Cancellation has already been requested\n return;\n }\n\n token.reason = new Cancel(message);\n resolvePromise(token.reason);\n });\n}\n\n/**\n * Throws a `Cancel` if cancellation has been requested.\n */\nCancelToken.prototype.throwIfRequested = function throwIfRequested() {\n if (this.reason) {\n throw this.reason;\n }\n};\n\n/**\n * Returns an object that contains a new `CancelToken` and a function that, when called,\n * cancels the `CancelToken`.\n */\nCancelToken.source = function source() {\n var cancel;\n var token = new CancelToken(function executor(c) {\n cancel = c;\n });\n return {\n token: token,\n cancel: cancel\n };\n};\n\nmodule.exports = CancelToken;\n","'use strict';\n\n/**\n * Syntactic sugar for invoking a function and expanding an array for arguments.\n *\n * Common use case would be to use `Function.prototype.apply`.\n *\n * ```js\n * function f(x, y, z) {}\n * var args = [1, 2, 3];\n * f.apply(null, args);\n * ```\n *\n * With `spread` this example can be re-written.\n *\n * ```js\n * spread(function(x, y, z) {})([1, 2, 3]);\n * ```\n *\n * @param {Function} callback\n * @returns {Function}\n */\nmodule.exports = function spread(callback) {\n return function wrap(arr) {\n return callback.apply(null, arr);\n };\n};\n","'use strict';\n\n/**\n * Determines whether the payload is an error thrown by Axios\n *\n * @param {*} payload The value to test\n * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false\n */\nmodule.exports = function isAxiosError(payload) {\n return (typeof payload === 'object') && (payload.isAxiosError === true);\n};\n"],"sourceRoot":""} \ No newline at end of file diff --git a/node_modules/dhn-api/node_modules/axios/index.d.ts b/node_modules/dhn-api/node_modules/axios/index.d.ts new file mode 100644 index 000000000..78f733f89 --- /dev/null +++ b/node_modules/dhn-api/node_modules/axios/index.d.ts @@ -0,0 +1,168 @@ +export interface AxiosTransformer { + (data: any, headers?: any): any; +} + +export interface AxiosAdapter { + (config: AxiosRequestConfig): AxiosPromise; +} + +export interface AxiosBasicCredentials { + username: string; + password: string; +} + +export interface AxiosProxyConfig { + host: string; + port: number; + auth?: { + username: string; + password:string; + }; + protocol?: string; +} + +export type Method = + | 'get' | 'GET' + | 'delete' | 'DELETE' + | 'head' | 'HEAD' + | 'options' | 'OPTIONS' + | 'post' | 'POST' + | 'put' | 'PUT' + | 'patch' | 'PATCH' + | 'purge' | 'PURGE' + | 'link' | 'LINK' + | 'unlink' | 'UNLINK' + +export type ResponseType = + | 'arraybuffer' + | 'blob' + | 'document' + | 'json' + | 'text' + | 'stream' + +export interface TransitionalOptions{ + silentJSONParsing: boolean; + forcedJSONParsing: boolean; + clarifyTimeoutError: boolean; +} + +export interface AxiosRequestConfig { + url?: string; + method?: Method; + baseURL?: string; + transformRequest?: AxiosTransformer | AxiosTransformer[]; + transformResponse?: AxiosTransformer | AxiosTransformer[]; + headers?: any; + params?: any; + paramsSerializer?: (params: any) => string; + data?: any; + timeout?: number; + timeoutErrorMessage?: string; + withCredentials?: boolean; + adapter?: AxiosAdapter; + auth?: AxiosBasicCredentials; + responseType?: ResponseType; + xsrfCookieName?: string; + xsrfHeaderName?: string; + onUploadProgress?: (progressEvent: any) => void; + onDownloadProgress?: (progressEvent: any) => void; + maxContentLength?: number; + validateStatus?: ((status: number) => boolean) | null; + maxBodyLength?: number; + maxRedirects?: number; + socketPath?: string | null; + httpAgent?: any; + httpsAgent?: any; + proxy?: AxiosProxyConfig | false; + cancelToken?: CancelToken; + decompress?: boolean; + transitional?: TransitionalOptions +} + +export interface AxiosResponse { + data: T; + status: number; + statusText: string; + headers: any; + config: AxiosRequestConfig; + request?: any; +} + +export interface AxiosError extends Error { + config: AxiosRequestConfig; + code?: string; + request?: any; + response?: AxiosResponse; + isAxiosError: boolean; + toJSON: () => object; +} + +export interface AxiosPromise extends Promise> { +} + +export interface CancelStatic { + new (message?: string): Cancel; +} + +export interface Cancel { + message: string; +} + +export interface Canceler { + (message?: string): void; +} + +export interface CancelTokenStatic { + new (executor: (cancel: Canceler) => void): CancelToken; + source(): CancelTokenSource; +} + +export interface CancelToken { + promise: Promise; + reason?: Cancel; + throwIfRequested(): void; +} + +export interface CancelTokenSource { + token: CancelToken; + cancel: Canceler; +} + +export interface AxiosInterceptorManager { + use(onFulfilled?: (value: V) => T | Promise, onRejected?: (error: any) => any): number; + eject(id: number): void; +} + +export interface AxiosInstance { + (config: AxiosRequestConfig): AxiosPromise; + (url: string, config?: AxiosRequestConfig): AxiosPromise; + defaults: AxiosRequestConfig; + interceptors: { + request: AxiosInterceptorManager; + response: AxiosInterceptorManager; + }; + getUri(config?: AxiosRequestConfig): string; + request> (config: AxiosRequestConfig): Promise; + get>(url: string, config?: AxiosRequestConfig): Promise; + delete>(url: string, config?: AxiosRequestConfig): Promise; + head>(url: string, config?: AxiosRequestConfig): Promise; + options>(url: string, config?: AxiosRequestConfig): Promise; + post>(url: string, data?: any, config?: AxiosRequestConfig): Promise; + put>(url: string, data?: any, config?: AxiosRequestConfig): Promise; + patch>(url: string, data?: any, config?: AxiosRequestConfig): Promise; +} + +export interface AxiosStatic extends AxiosInstance { + create(config?: AxiosRequestConfig): AxiosInstance; + Cancel: CancelStatic; + CancelToken: CancelTokenStatic; + isCancel(value: any): boolean; + all(values: (T | Promise)[]): Promise; + spread(callback: (...args: T[]) => R): (array: T[]) => R; + isAxiosError(payload: any): payload is AxiosError; +} + +declare const axios: AxiosStatic; + +export default axios; diff --git a/node_modules/dhn-api/node_modules/axios/index.js b/node_modules/dhn-api/node_modules/axios/index.js new file mode 100644 index 000000000..79dfd09dd --- /dev/null +++ b/node_modules/dhn-api/node_modules/axios/index.js @@ -0,0 +1 @@ +module.exports = require('./lib/axios'); \ No newline at end of file diff --git a/node_modules/dhn-api/node_modules/axios/lib/adapters/README.md b/node_modules/dhn-api/node_modules/axios/lib/adapters/README.md new file mode 100644 index 000000000..68f111895 --- /dev/null +++ b/node_modules/dhn-api/node_modules/axios/lib/adapters/README.md @@ -0,0 +1,37 @@ +# axios // adapters + +The modules under `adapters/` are modules that handle dispatching a request and settling a returned `Promise` once a response is received. + +## Example + +```js +var settle = require('./../core/settle'); + +module.exports = function myAdapter(config) { + // At this point: + // - config has been merged with defaults + // - request transformers have already run + // - request interceptors have already run + + // Make the request using config provided + // Upon response settle the Promise + + return new Promise(function(resolve, reject) { + + var response = { + data: responseData, + status: request.status, + statusText: request.statusText, + headers: responseHeaders, + config: config, + request: request + }; + + settle(resolve, reject, response); + + // From here: + // - response transformers will run + // - response interceptors will run + }); +} +``` diff --git a/node_modules/dhn-api/node_modules/axios/lib/adapters/http.js b/node_modules/dhn-api/node_modules/axios/lib/adapters/http.js new file mode 100644 index 000000000..0cca3bdfb --- /dev/null +++ b/node_modules/dhn-api/node_modules/axios/lib/adapters/http.js @@ -0,0 +1,331 @@ +'use strict'; + +var utils = require('./../utils'); +var settle = require('./../core/settle'); +var buildFullPath = require('../core/buildFullPath'); +var buildURL = require('./../helpers/buildURL'); +var http = require('http'); +var https = require('https'); +var httpFollow = require('follow-redirects').http; +var httpsFollow = require('follow-redirects').https; +var url = require('url'); +var zlib = require('zlib'); +var pkg = require('./../../package.json'); +var createError = require('../core/createError'); +var enhanceError = require('../core/enhanceError'); + +var isHttps = /https:?/; + +/** + * + * @param {http.ClientRequestArgs} options + * @param {AxiosProxyConfig} proxy + * @param {string} location + */ +function setProxy(options, proxy, location) { + options.hostname = proxy.host; + options.host = proxy.host; + options.port = proxy.port; + options.path = location; + + // Basic proxy authorization + if (proxy.auth) { + var base64 = Buffer.from(proxy.auth.username + ':' + proxy.auth.password, 'utf8').toString('base64'); + options.headers['Proxy-Authorization'] = 'Basic ' + base64; + } + + // If a proxy is used, any redirects must also pass through the proxy + options.beforeRedirect = function beforeRedirect(redirection) { + redirection.headers.host = redirection.host; + setProxy(redirection, proxy, redirection.href); + }; +} + +/*eslint consistent-return:0*/ +module.exports = function httpAdapter(config) { + return new Promise(function dispatchHttpRequest(resolvePromise, rejectPromise) { + var resolve = function resolve(value) { + resolvePromise(value); + }; + var reject = function reject(value) { + rejectPromise(value); + }; + var data = config.data; + var headers = config.headers; + + // Set User-Agent (required by some servers) + // See https://github.com/axios/axios/issues/69 + if ('User-Agent' in headers || 'user-agent' in headers) { + // User-Agent is specified; handle case where no UA header is desired + if (!headers['User-Agent'] && !headers['user-agent']) { + delete headers['User-Agent']; + delete headers['user-agent']; + } + // Otherwise, use specified value + } else { + // Only set header if it hasn't been set in config + headers['User-Agent'] = 'axios/' + pkg.version; + } + + if (data && !utils.isStream(data)) { + if (Buffer.isBuffer(data)) { + // Nothing to do... + } else if (utils.isArrayBuffer(data)) { + data = Buffer.from(new Uint8Array(data)); + } else if (utils.isString(data)) { + data = Buffer.from(data, 'utf-8'); + } else { + return reject(createError( + 'Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream', + config + )); + } + + // Add Content-Length header if data exists + headers['Content-Length'] = data.length; + } + + // HTTP basic authentication + var auth = undefined; + if (config.auth) { + var username = config.auth.username || ''; + var password = config.auth.password || ''; + auth = username + ':' + password; + } + + // Parse url + var fullPath = buildFullPath(config.baseURL, config.url); + var parsed = url.parse(fullPath); + var protocol = parsed.protocol || 'http:'; + + if (!auth && parsed.auth) { + var urlAuth = parsed.auth.split(':'); + var urlUsername = urlAuth[0] || ''; + var urlPassword = urlAuth[1] || ''; + auth = urlUsername + ':' + urlPassword; + } + + if (auth) { + delete headers.Authorization; + } + + var isHttpsRequest = isHttps.test(protocol); + var agent = isHttpsRequest ? config.httpsAgent : config.httpAgent; + + var options = { + path: buildURL(parsed.path, config.params, config.paramsSerializer).replace(/^\?/, ''), + method: config.method.toUpperCase(), + headers: headers, + agent: agent, + agents: { http: config.httpAgent, https: config.httpsAgent }, + auth: auth + }; + + if (config.socketPath) { + options.socketPath = config.socketPath; + } else { + options.hostname = parsed.hostname; + options.port = parsed.port; + } + + var proxy = config.proxy; + if (!proxy && proxy !== false) { + var proxyEnv = protocol.slice(0, -1) + '_proxy'; + var proxyUrl = process.env[proxyEnv] || process.env[proxyEnv.toUpperCase()]; + if (proxyUrl) { + var parsedProxyUrl = url.parse(proxyUrl); + var noProxyEnv = process.env.no_proxy || process.env.NO_PROXY; + var shouldProxy = true; + + if (noProxyEnv) { + var noProxy = noProxyEnv.split(',').map(function trim(s) { + return s.trim(); + }); + + shouldProxy = !noProxy.some(function proxyMatch(proxyElement) { + if (!proxyElement) { + return false; + } + if (proxyElement === '*') { + return true; + } + if (proxyElement[0] === '.' && + parsed.hostname.substr(parsed.hostname.length - proxyElement.length) === proxyElement) { + return true; + } + + return parsed.hostname === proxyElement; + }); + } + + if (shouldProxy) { + proxy = { + host: parsedProxyUrl.hostname, + port: parsedProxyUrl.port, + protocol: parsedProxyUrl.protocol + }; + + if (parsedProxyUrl.auth) { + var proxyUrlAuth = parsedProxyUrl.auth.split(':'); + proxy.auth = { + username: proxyUrlAuth[0], + password: proxyUrlAuth[1] + }; + } + } + } + } + + if (proxy) { + options.headers.host = parsed.hostname + (parsed.port ? ':' + parsed.port : ''); + setProxy(options, proxy, protocol + '//' + parsed.hostname + (parsed.port ? ':' + parsed.port : '') + options.path); + } + + var transport; + var isHttpsProxy = isHttpsRequest && (proxy ? isHttps.test(proxy.protocol) : true); + if (config.transport) { + transport = config.transport; + } else if (config.maxRedirects === 0) { + transport = isHttpsProxy ? https : http; + } else { + if (config.maxRedirects) { + options.maxRedirects = config.maxRedirects; + } + transport = isHttpsProxy ? httpsFollow : httpFollow; + } + + if (config.maxBodyLength > -1) { + options.maxBodyLength = config.maxBodyLength; + } + + // Create the request + var req = transport.request(options, function handleResponse(res) { + if (req.aborted) return; + + // uncompress the response body transparently if required + var stream = res; + + // return the last request in case of redirects + var lastRequest = res.req || req; + + + // if no content, is HEAD request or decompress disabled we should not decompress + if (res.statusCode !== 204 && lastRequest.method !== 'HEAD' && config.decompress !== false) { + switch (res.headers['content-encoding']) { + /*eslint default-case:0*/ + case 'gzip': + case 'compress': + case 'deflate': + // add the unzipper to the body stream processing pipeline + stream = stream.pipe(zlib.createUnzip()); + + // remove the content-encoding in order to not confuse downstream operations + delete res.headers['content-encoding']; + break; + } + } + + var response = { + status: res.statusCode, + statusText: res.statusMessage, + headers: res.headers, + config: config, + request: lastRequest + }; + + if (config.responseType === 'stream') { + response.data = stream; + settle(resolve, reject, response); + } else { + var responseBuffer = []; + var totalResponseBytes = 0; + stream.on('data', function handleStreamData(chunk) { + responseBuffer.push(chunk); + totalResponseBytes += chunk.length; + + // make sure the content length is not over the maxContentLength if specified + if (config.maxContentLength > -1 && totalResponseBytes > config.maxContentLength) { + stream.destroy(); + reject(createError('maxContentLength size of ' + config.maxContentLength + ' exceeded', + config, null, lastRequest)); + } + }); + + stream.on('error', function handleStreamError(err) { + if (req.aborted) return; + reject(enhanceError(err, config, null, lastRequest)); + }); + + stream.on('end', function handleStreamEnd() { + var responseData = Buffer.concat(responseBuffer); + if (config.responseType !== 'arraybuffer') { + responseData = responseData.toString(config.responseEncoding); + if (!config.responseEncoding || config.responseEncoding === 'utf8') { + responseData = utils.stripBOM(responseData); + } + } + + response.data = responseData; + settle(resolve, reject, response); + }); + } + }); + + // Handle errors + req.on('error', function handleRequestError(err) { + if (req.aborted && err.code !== 'ERR_FR_TOO_MANY_REDIRECTS') return; + reject(enhanceError(err, config, null, req)); + }); + + // Handle request timeout + if (config.timeout) { + // This is forcing a int timeout to avoid problems if the `req` interface doesn't handle other types. + var timeout = parseInt(config.timeout, 10); + + if (isNaN(timeout)) { + reject(createError( + 'error trying to parse `config.timeout` to int', + config, + 'ERR_PARSE_TIMEOUT', + req + )); + + return; + } + + // Sometime, the response will be very slow, and does not respond, the connect event will be block by event loop system. + // And timer callback will be fired, and abort() will be invoked before connection, then get "socket hang up" and code ECONNRESET. + // At this time, if we have a large number of request, nodejs will hang up some socket on background. and the number will up and up. + // And then these socket which be hang up will devoring CPU little by little. + // ClientRequest.setTimeout will be fired on the specify milliseconds, and can make sure that abort() will be fired after connect. + req.setTimeout(timeout, function handleRequestTimeout() { + req.abort(); + reject(createError( + 'timeout of ' + timeout + 'ms exceeded', + config, + config.transitional && config.transitional.clarifyTimeoutError ? 'ETIMEDOUT' : 'ECONNABORTED', + req + )); + }); + } + + if (config.cancelToken) { + // Handle cancellation + config.cancelToken.promise.then(function onCanceled(cancel) { + if (req.aborted) return; + + req.abort(); + reject(cancel); + }); + } + + // Send the request + if (utils.isStream(data)) { + data.on('error', function handleStreamError(err) { + reject(enhanceError(err, config, null, req)); + }).pipe(req); + } else { + req.end(data); + } + }); +}; diff --git a/node_modules/dhn-api/node_modules/axios/lib/adapters/xhr.js b/node_modules/dhn-api/node_modules/axios/lib/adapters/xhr.js new file mode 100644 index 000000000..a386dd24a --- /dev/null +++ b/node_modules/dhn-api/node_modules/axios/lib/adapters/xhr.js @@ -0,0 +1,189 @@ +'use strict'; + +var utils = require('./../utils'); +var settle = require('./../core/settle'); +var cookies = require('./../helpers/cookies'); +var buildURL = require('./../helpers/buildURL'); +var buildFullPath = require('../core/buildFullPath'); +var parseHeaders = require('./../helpers/parseHeaders'); +var isURLSameOrigin = require('./../helpers/isURLSameOrigin'); +var createError = require('../core/createError'); + +module.exports = function xhrAdapter(config) { + return new Promise(function dispatchXhrRequest(resolve, reject) { + var requestData = config.data; + var requestHeaders = config.headers; + var responseType = config.responseType; + + if (utils.isFormData(requestData)) { + delete requestHeaders['Content-Type']; // Let the browser set it + } + + var request = new XMLHttpRequest(); + + // HTTP basic authentication + if (config.auth) { + var username = config.auth.username || ''; + var password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : ''; + requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password); + } + + var fullPath = buildFullPath(config.baseURL, config.url); + request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true); + + // Set the request timeout in MS + request.timeout = config.timeout; + + function onloadend() { + if (!request) { + return; + } + // Prepare the response + var responseHeaders = 'getAllResponseHeaders' in request ? parseHeaders(request.getAllResponseHeaders()) : null; + var responseData = !responseType || responseType === 'text' || responseType === 'json' ? + request.responseText : request.response; + var response = { + data: responseData, + status: request.status, + statusText: request.statusText, + headers: responseHeaders, + config: config, + request: request + }; + + settle(resolve, reject, response); + + // Clean up request + request = null; + } + + if ('onloadend' in request) { + // Use onloadend if available + request.onloadend = onloadend; + } else { + // Listen for ready state to emulate onloadend + request.onreadystatechange = function handleLoad() { + if (!request || request.readyState !== 4) { + return; + } + + // The request errored out and we didn't get a response, this will be + // handled by onerror instead + // With one exception: request that using file: protocol, most browsers + // will return status as 0 even though it's a successful request + if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) { + return; + } + // readystate handler is calling before onerror or ontimeout handlers, + // so we should call onloadend on the next 'tick' + setTimeout(onloadend); + }; + } + + // Handle browser request cancellation (as opposed to a manual cancellation) + request.onabort = function handleAbort() { + if (!request) { + return; + } + + reject(createError('Request aborted', config, 'ECONNABORTED', request)); + + // Clean up request + request = null; + }; + + // Handle low level network errors + request.onerror = function handleError() { + // Real errors are hidden from us by the browser + // onerror should only fire if it's a network error + reject(createError('Network Error', config, null, request)); + + // Clean up request + request = null; + }; + + // Handle timeout + request.ontimeout = function handleTimeout() { + var timeoutErrorMessage = 'timeout of ' + config.timeout + 'ms exceeded'; + if (config.timeoutErrorMessage) { + timeoutErrorMessage = config.timeoutErrorMessage; + } + reject(createError( + timeoutErrorMessage, + config, + config.transitional && config.transitional.clarifyTimeoutError ? 'ETIMEDOUT' : 'ECONNABORTED', + request)); + + // Clean up request + request = null; + }; + + // Add xsrf header + // This is only done if running in a standard browser environment. + // Specifically not if we're in a web worker, or react-native. + if (utils.isStandardBrowserEnv()) { + // Add xsrf header + var xsrfValue = (config.withCredentials || isURLSameOrigin(fullPath)) && config.xsrfCookieName ? + cookies.read(config.xsrfCookieName) : + undefined; + + if (xsrfValue) { + requestHeaders[config.xsrfHeaderName] = xsrfValue; + } + } + + // Add headers to the request + if ('setRequestHeader' in request) { + utils.forEach(requestHeaders, function setRequestHeader(val, key) { + if (typeof requestData === 'undefined' && key.toLowerCase() === 'content-type') { + // Remove Content-Type if data is undefined + delete requestHeaders[key]; + } else { + // Otherwise add header to the request + request.setRequestHeader(key, val); + } + }); + } + + // Add withCredentials to request if needed + if (!utils.isUndefined(config.withCredentials)) { + request.withCredentials = !!config.withCredentials; + } + + // Add responseType to request if needed + if (responseType && responseType !== 'json') { + request.responseType = config.responseType; + } + + // Handle progress if needed + if (typeof config.onDownloadProgress === 'function') { + request.addEventListener('progress', config.onDownloadProgress); + } + + // Not all browsers support upload events + if (typeof config.onUploadProgress === 'function' && request.upload) { + request.upload.addEventListener('progress', config.onUploadProgress); + } + + if (config.cancelToken) { + // Handle cancellation + config.cancelToken.promise.then(function onCanceled(cancel) { + if (!request) { + return; + } + + request.abort(); + reject(cancel); + // Clean up request + request = null; + }); + } + + if (!requestData) { + requestData = null; + } + + // Send the request + request.send(requestData); + }); +}; diff --git a/node_modules/dhn-api/node_modules/axios/lib/axios.js b/node_modules/dhn-api/node_modules/axios/lib/axios.js new file mode 100644 index 000000000..c6357b005 --- /dev/null +++ b/node_modules/dhn-api/node_modules/axios/lib/axios.js @@ -0,0 +1,56 @@ +'use strict'; + +var utils = require('./utils'); +var bind = require('./helpers/bind'); +var Axios = require('./core/Axios'); +var mergeConfig = require('./core/mergeConfig'); +var defaults = require('./defaults'); + +/** + * Create an instance of Axios + * + * @param {Object} defaultConfig The default config for the instance + * @return {Axios} A new instance of Axios + */ +function createInstance(defaultConfig) { + var context = new Axios(defaultConfig); + var instance = bind(Axios.prototype.request, context); + + // Copy axios.prototype to instance + utils.extend(instance, Axios.prototype, context); + + // Copy context to instance + utils.extend(instance, context); + + return instance; +} + +// Create the default instance to be exported +var axios = createInstance(defaults); + +// Expose Axios class to allow class inheritance +axios.Axios = Axios; + +// Factory for creating new instances +axios.create = function create(instanceConfig) { + return createInstance(mergeConfig(axios.defaults, instanceConfig)); +}; + +// Expose Cancel & CancelToken +axios.Cancel = require('./cancel/Cancel'); +axios.CancelToken = require('./cancel/CancelToken'); +axios.isCancel = require('./cancel/isCancel'); + +// Expose all/spread +axios.all = function all(promises) { + return Promise.all(promises); +}; +axios.spread = require('./helpers/spread'); + +// Expose isAxiosError +axios.isAxiosError = require('./helpers/isAxiosError'); + +module.exports = axios; + +// Allow use of default import syntax in TypeScript +module.exports.default = axios; diff --git a/node_modules/dhn-api/node_modules/axios/lib/cancel/Cancel.js b/node_modules/dhn-api/node_modules/axios/lib/cancel/Cancel.js new file mode 100644 index 000000000..e0de4003f --- /dev/null +++ b/node_modules/dhn-api/node_modules/axios/lib/cancel/Cancel.js @@ -0,0 +1,19 @@ +'use strict'; + +/** + * A `Cancel` is an object that is thrown when an operation is canceled. + * + * @class + * @param {string=} message The message. + */ +function Cancel(message) { + this.message = message; +} + +Cancel.prototype.toString = function toString() { + return 'Cancel' + (this.message ? ': ' + this.message : ''); +}; + +Cancel.prototype.__CANCEL__ = true; + +module.exports = Cancel; diff --git a/node_modules/dhn-api/node_modules/axios/lib/cancel/CancelToken.js b/node_modules/dhn-api/node_modules/axios/lib/cancel/CancelToken.js new file mode 100644 index 000000000..6b46e6662 --- /dev/null +++ b/node_modules/dhn-api/node_modules/axios/lib/cancel/CancelToken.js @@ -0,0 +1,57 @@ +'use strict'; + +var Cancel = require('./Cancel'); + +/** + * A `CancelToken` is an object that can be used to request cancellation of an operation. + * + * @class + * @param {Function} executor The executor function. + */ +function CancelToken(executor) { + if (typeof executor !== 'function') { + throw new TypeError('executor must be a function.'); + } + + var resolvePromise; + this.promise = new Promise(function promiseExecutor(resolve) { + resolvePromise = resolve; + }); + + var token = this; + executor(function cancel(message) { + if (token.reason) { + // Cancellation has already been requested + return; + } + + token.reason = new Cancel(message); + resolvePromise(token.reason); + }); +} + +/** + * Throws a `Cancel` if cancellation has been requested. + */ +CancelToken.prototype.throwIfRequested = function throwIfRequested() { + if (this.reason) { + throw this.reason; + } +}; + +/** + * Returns an object that contains a new `CancelToken` and a function that, when called, + * cancels the `CancelToken`. + */ +CancelToken.source = function source() { + var cancel; + var token = new CancelToken(function executor(c) { + cancel = c; + }); + return { + token: token, + cancel: cancel + }; +}; + +module.exports = CancelToken; diff --git a/node_modules/dhn-api/node_modules/axios/lib/cancel/isCancel.js b/node_modules/dhn-api/node_modules/axios/lib/cancel/isCancel.js new file mode 100644 index 000000000..051f3ae4c --- /dev/null +++ b/node_modules/dhn-api/node_modules/axios/lib/cancel/isCancel.js @@ -0,0 +1,5 @@ +'use strict'; + +module.exports = function isCancel(value) { + return !!(value && value.__CANCEL__); +}; diff --git a/node_modules/dhn-api/node_modules/axios/lib/core/Axios.js b/node_modules/dhn-api/node_modules/axios/lib/core/Axios.js new file mode 100644 index 000000000..42ea75e7e --- /dev/null +++ b/node_modules/dhn-api/node_modules/axios/lib/core/Axios.js @@ -0,0 +1,148 @@ +'use strict'; + +var utils = require('./../utils'); +var buildURL = require('../helpers/buildURL'); +var InterceptorManager = require('./InterceptorManager'); +var dispatchRequest = require('./dispatchRequest'); +var mergeConfig = require('./mergeConfig'); +var validator = require('../helpers/validator'); + +var validators = validator.validators; +/** + * Create a new instance of Axios + * + * @param {Object} instanceConfig The default config for the instance + */ +function Axios(instanceConfig) { + this.defaults = instanceConfig; + this.interceptors = { + request: new InterceptorManager(), + response: new InterceptorManager() + }; +} + +/** + * Dispatch a request + * + * @param {Object} config The config specific for this request (merged with this.defaults) + */ +Axios.prototype.request = function request(config) { + /*eslint no-param-reassign:0*/ + // Allow for axios('example/url'[, config]) a la fetch API + if (typeof config === 'string') { + config = arguments[1] || {}; + config.url = arguments[0]; + } else { + config = config || {}; + } + + config = mergeConfig(this.defaults, config); + + // Set config.method + if (config.method) { + config.method = config.method.toLowerCase(); + } else if (this.defaults.method) { + config.method = this.defaults.method.toLowerCase(); + } else { + config.method = 'get'; + } + + var transitional = config.transitional; + + if (transitional !== undefined) { + validator.assertOptions(transitional, { + silentJSONParsing: validators.transitional(validators.boolean, '1.0.0'), + forcedJSONParsing: validators.transitional(validators.boolean, '1.0.0'), + clarifyTimeoutError: validators.transitional(validators.boolean, '1.0.0') + }, false); + } + + // filter out skipped interceptors + var requestInterceptorChain = []; + var synchronousRequestInterceptors = true; + this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) { + if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) { + return; + } + + synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous; + + requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected); + }); + + var responseInterceptorChain = []; + this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) { + responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected); + }); + + var promise; + + if (!synchronousRequestInterceptors) { + var chain = [dispatchRequest, undefined]; + + Array.prototype.unshift.apply(chain, requestInterceptorChain); + chain = chain.concat(responseInterceptorChain); + + promise = Promise.resolve(config); + while (chain.length) { + promise = promise.then(chain.shift(), chain.shift()); + } + + return promise; + } + + + var newConfig = config; + while (requestInterceptorChain.length) { + var onFulfilled = requestInterceptorChain.shift(); + var onRejected = requestInterceptorChain.shift(); + try { + newConfig = onFulfilled(newConfig); + } catch (error) { + onRejected(error); + break; + } + } + + try { + promise = dispatchRequest(newConfig); + } catch (error) { + return Promise.reject(error); + } + + while (responseInterceptorChain.length) { + promise = promise.then(responseInterceptorChain.shift(), responseInterceptorChain.shift()); + } + + return promise; +}; + +Axios.prototype.getUri = function getUri(config) { + config = mergeConfig(this.defaults, config); + return buildURL(config.url, config.params, config.paramsSerializer).replace(/^\?/, ''); +}; + +// Provide aliases for supported request methods +utils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) { + /*eslint func-names:0*/ + Axios.prototype[method] = function(url, config) { + return this.request(mergeConfig(config || {}, { + method: method, + url: url, + data: (config || {}).data + })); + }; +}); + +utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) { + /*eslint func-names:0*/ + Axios.prototype[method] = function(url, data, config) { + return this.request(mergeConfig(config || {}, { + method: method, + url: url, + data: data + })); + }; +}); + +module.exports = Axios; diff --git a/node_modules/dhn-api/node_modules/axios/lib/core/InterceptorManager.js b/node_modules/dhn-api/node_modules/axios/lib/core/InterceptorManager.js new file mode 100644 index 000000000..900f44880 --- /dev/null +++ b/node_modules/dhn-api/node_modules/axios/lib/core/InterceptorManager.js @@ -0,0 +1,54 @@ +'use strict'; + +var utils = require('./../utils'); + +function InterceptorManager() { + this.handlers = []; +} + +/** + * Add a new interceptor to the stack + * + * @param {Function} fulfilled The function to handle `then` for a `Promise` + * @param {Function} rejected The function to handle `reject` for a `Promise` + * + * @return {Number} An ID used to remove interceptor later + */ +InterceptorManager.prototype.use = function use(fulfilled, rejected, options) { + this.handlers.push({ + fulfilled: fulfilled, + rejected: rejected, + synchronous: options ? options.synchronous : false, + runWhen: options ? options.runWhen : null + }); + return this.handlers.length - 1; +}; + +/** + * Remove an interceptor from the stack + * + * @param {Number} id The ID that was returned by `use` + */ +InterceptorManager.prototype.eject = function eject(id) { + if (this.handlers[id]) { + this.handlers[id] = null; + } +}; + +/** + * Iterate over all the registered interceptors + * + * This method is particularly useful for skipping over any + * interceptors that may have become `null` calling `eject`. + * + * @param {Function} fn The function to call for each interceptor + */ +InterceptorManager.prototype.forEach = function forEach(fn) { + utils.forEach(this.handlers, function forEachHandler(h) { + if (h !== null) { + fn(h); + } + }); +}; + +module.exports = InterceptorManager; diff --git a/node_modules/dhn-api/node_modules/axios/lib/core/README.md b/node_modules/dhn-api/node_modules/axios/lib/core/README.md new file mode 100644 index 000000000..84559ce7c --- /dev/null +++ b/node_modules/dhn-api/node_modules/axios/lib/core/README.md @@ -0,0 +1,8 @@ +# axios // core + +The modules found in `core/` should be modules that are specific to the domain logic of axios. These modules would most likely not make sense to be consumed outside of the axios module, as their logic is too specific. Some examples of core modules are: + +- Dispatching requests + - Requests sent via `adapters/` (see lib/adapters/README.md) +- Managing interceptors +- Handling config diff --git a/node_modules/dhn-api/node_modules/axios/lib/core/buildFullPath.js b/node_modules/dhn-api/node_modules/axios/lib/core/buildFullPath.js new file mode 100644 index 000000000..00b2b050a --- /dev/null +++ b/node_modules/dhn-api/node_modules/axios/lib/core/buildFullPath.js @@ -0,0 +1,20 @@ +'use strict'; + +var isAbsoluteURL = require('../helpers/isAbsoluteURL'); +var combineURLs = require('../helpers/combineURLs'); + +/** + * Creates a new URL by combining the baseURL with the requestedURL, + * only when the requestedURL is not already an absolute URL. + * If the requestURL is absolute, this function returns the requestedURL untouched. + * + * @param {string} baseURL The base URL + * @param {string} requestedURL Absolute or relative URL to combine + * @returns {string} The combined full path + */ +module.exports = function buildFullPath(baseURL, requestedURL) { + if (baseURL && !isAbsoluteURL(requestedURL)) { + return combineURLs(baseURL, requestedURL); + } + return requestedURL; +}; diff --git a/node_modules/dhn-api/node_modules/axios/lib/core/createError.js b/node_modules/dhn-api/node_modules/axios/lib/core/createError.js new file mode 100644 index 000000000..933680f69 --- /dev/null +++ b/node_modules/dhn-api/node_modules/axios/lib/core/createError.js @@ -0,0 +1,18 @@ +'use strict'; + +var enhanceError = require('./enhanceError'); + +/** + * Create an Error with the specified message, config, error code, request and response. + * + * @param {string} message The error message. + * @param {Object} config The config. + * @param {string} [code] The error code (for example, 'ECONNABORTED'). + * @param {Object} [request] The request. + * @param {Object} [response] The response. + * @returns {Error} The created error. + */ +module.exports = function createError(message, config, code, request, response) { + var error = new Error(message); + return enhanceError(error, config, code, request, response); +}; diff --git a/node_modules/dhn-api/node_modules/axios/lib/core/dispatchRequest.js b/node_modules/dhn-api/node_modules/axios/lib/core/dispatchRequest.js new file mode 100644 index 000000000..9ce3b96e6 --- /dev/null +++ b/node_modules/dhn-api/node_modules/axios/lib/core/dispatchRequest.js @@ -0,0 +1,82 @@ +'use strict'; + +var utils = require('./../utils'); +var transformData = require('./transformData'); +var isCancel = require('../cancel/isCancel'); +var defaults = require('../defaults'); + +/** + * Throws a `Cancel` if cancellation has been requested. + */ +function throwIfCancellationRequested(config) { + if (config.cancelToken) { + config.cancelToken.throwIfRequested(); + } +} + +/** + * Dispatch a request to the server using the configured adapter. + * + * @param {object} config The config that is to be used for the request + * @returns {Promise} The Promise to be fulfilled + */ +module.exports = function dispatchRequest(config) { + throwIfCancellationRequested(config); + + // Ensure headers exist + config.headers = config.headers || {}; + + // Transform request data + config.data = transformData.call( + config, + config.data, + config.headers, + config.transformRequest + ); + + // Flatten headers + config.headers = utils.merge( + config.headers.common || {}, + config.headers[config.method] || {}, + config.headers + ); + + utils.forEach( + ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'], + function cleanHeaderConfig(method) { + delete config.headers[method]; + } + ); + + var adapter = config.adapter || defaults.adapter; + + return adapter(config).then(function onAdapterResolution(response) { + throwIfCancellationRequested(config); + + // Transform response data + response.data = transformData.call( + config, + response.data, + response.headers, + config.transformResponse + ); + + return response; + }, function onAdapterRejection(reason) { + if (!isCancel(reason)) { + throwIfCancellationRequested(config); + + // Transform response data + if (reason && reason.response) { + reason.response.data = transformData.call( + config, + reason.response.data, + reason.response.headers, + config.transformResponse + ); + } + } + + return Promise.reject(reason); + }); +}; diff --git a/node_modules/dhn-api/node_modules/axios/lib/core/enhanceError.js b/node_modules/dhn-api/node_modules/axios/lib/core/enhanceError.js new file mode 100644 index 000000000..b6bc4444e --- /dev/null +++ b/node_modules/dhn-api/node_modules/axios/lib/core/enhanceError.js @@ -0,0 +1,42 @@ +'use strict'; + +/** + * Update an Error with the specified config, error code, and response. + * + * @param {Error} error The error to update. + * @param {Object} config The config. + * @param {string} [code] The error code (for example, 'ECONNABORTED'). + * @param {Object} [request] The request. + * @param {Object} [response] The response. + * @returns {Error} The error. + */ +module.exports = function enhanceError(error, config, code, request, response) { + error.config = config; + if (code) { + error.code = code; + } + + error.request = request; + error.response = response; + error.isAxiosError = true; + + error.toJSON = function toJSON() { + return { + // Standard + message: this.message, + name: this.name, + // Microsoft + description: this.description, + number: this.number, + // Mozilla + fileName: this.fileName, + lineNumber: this.lineNumber, + columnNumber: this.columnNumber, + stack: this.stack, + // Axios + config: this.config, + code: this.code + }; + }; + return error; +}; diff --git a/node_modules/dhn-api/node_modules/axios/lib/core/mergeConfig.js b/node_modules/dhn-api/node_modules/axios/lib/core/mergeConfig.js new file mode 100644 index 000000000..5a2c10cb0 --- /dev/null +++ b/node_modules/dhn-api/node_modules/axios/lib/core/mergeConfig.js @@ -0,0 +1,87 @@ +'use strict'; + +var utils = require('../utils'); + +/** + * Config-specific merge-function which creates a new config-object + * by merging two configuration objects together. + * + * @param {Object} config1 + * @param {Object} config2 + * @returns {Object} New object resulting from merging config2 to config1 + */ +module.exports = function mergeConfig(config1, config2) { + // eslint-disable-next-line no-param-reassign + config2 = config2 || {}; + var config = {}; + + var valueFromConfig2Keys = ['url', 'method', 'data']; + var mergeDeepPropertiesKeys = ['headers', 'auth', 'proxy', 'params']; + var defaultToConfig2Keys = [ + 'baseURL', 'transformRequest', 'transformResponse', 'paramsSerializer', + 'timeout', 'timeoutMessage', 'withCredentials', 'adapter', 'responseType', 'xsrfCookieName', + 'xsrfHeaderName', 'onUploadProgress', 'onDownloadProgress', 'decompress', + 'maxContentLength', 'maxBodyLength', 'maxRedirects', 'transport', 'httpAgent', + 'httpsAgent', 'cancelToken', 'socketPath', 'responseEncoding' + ]; + var directMergeKeys = ['validateStatus']; + + function getMergedValue(target, source) { + if (utils.isPlainObject(target) && utils.isPlainObject(source)) { + return utils.merge(target, source); + } else if (utils.isPlainObject(source)) { + return utils.merge({}, source); + } else if (utils.isArray(source)) { + return source.slice(); + } + return source; + } + + function mergeDeepProperties(prop) { + if (!utils.isUndefined(config2[prop])) { + config[prop] = getMergedValue(config1[prop], config2[prop]); + } else if (!utils.isUndefined(config1[prop])) { + config[prop] = getMergedValue(undefined, config1[prop]); + } + } + + utils.forEach(valueFromConfig2Keys, function valueFromConfig2(prop) { + if (!utils.isUndefined(config2[prop])) { + config[prop] = getMergedValue(undefined, config2[prop]); + } + }); + + utils.forEach(mergeDeepPropertiesKeys, mergeDeepProperties); + + utils.forEach(defaultToConfig2Keys, function defaultToConfig2(prop) { + if (!utils.isUndefined(config2[prop])) { + config[prop] = getMergedValue(undefined, config2[prop]); + } else if (!utils.isUndefined(config1[prop])) { + config[prop] = getMergedValue(undefined, config1[prop]); + } + }); + + utils.forEach(directMergeKeys, function merge(prop) { + if (prop in config2) { + config[prop] = getMergedValue(config1[prop], config2[prop]); + } else if (prop in config1) { + config[prop] = getMergedValue(undefined, config1[prop]); + } + }); + + var axiosKeys = valueFromConfig2Keys + .concat(mergeDeepPropertiesKeys) + .concat(defaultToConfig2Keys) + .concat(directMergeKeys); + + var otherKeys = Object + .keys(config1) + .concat(Object.keys(config2)) + .filter(function filterAxiosKeys(key) { + return axiosKeys.indexOf(key) === -1; + }); + + utils.forEach(otherKeys, mergeDeepProperties); + + return config; +}; diff --git a/node_modules/dhn-api/node_modules/axios/lib/core/settle.js b/node_modules/dhn-api/node_modules/axios/lib/core/settle.js new file mode 100644 index 000000000..886adb0c1 --- /dev/null +++ b/node_modules/dhn-api/node_modules/axios/lib/core/settle.js @@ -0,0 +1,25 @@ +'use strict'; + +var createError = require('./createError'); + +/** + * Resolve or reject a Promise based on response status. + * + * @param {Function} resolve A function that resolves the promise. + * @param {Function} reject A function that rejects the promise. + * @param {object} response The response. + */ +module.exports = function settle(resolve, reject, response) { + var validateStatus = response.config.validateStatus; + if (!response.status || !validateStatus || validateStatus(response.status)) { + resolve(response); + } else { + reject(createError( + 'Request failed with status code ' + response.status, + response.config, + null, + response.request, + response + )); + } +}; diff --git a/node_modules/dhn-api/node_modules/axios/lib/core/transformData.js b/node_modules/dhn-api/node_modules/axios/lib/core/transformData.js new file mode 100644 index 000000000..c584d12bc --- /dev/null +++ b/node_modules/dhn-api/node_modules/axios/lib/core/transformData.js @@ -0,0 +1,22 @@ +'use strict'; + +var utils = require('./../utils'); +var defaults = require('./../defaults'); + +/** + * Transform the data for a request or a response + * + * @param {Object|String} data The data to be transformed + * @param {Array} headers The headers for the request or response + * @param {Array|Function} fns A single function or Array of functions + * @returns {*} The resulting transformed data + */ +module.exports = function transformData(data, headers, fns) { + var context = this || defaults; + /*eslint no-param-reassign:0*/ + utils.forEach(fns, function transform(fn) { + data = fn.call(context, data, headers); + }); + + return data; +}; diff --git a/node_modules/dhn-api/node_modules/axios/lib/defaults.js b/node_modules/dhn-api/node_modules/axios/lib/defaults.js new file mode 100644 index 000000000..55e69d9ae --- /dev/null +++ b/node_modules/dhn-api/node_modules/axios/lib/defaults.js @@ -0,0 +1,134 @@ +'use strict'; + +var utils = require('./utils'); +var normalizeHeaderName = require('./helpers/normalizeHeaderName'); +var enhanceError = require('./core/enhanceError'); + +var DEFAULT_CONTENT_TYPE = { + 'Content-Type': 'application/x-www-form-urlencoded' +}; + +function setContentTypeIfUnset(headers, value) { + if (!utils.isUndefined(headers) && utils.isUndefined(headers['Content-Type'])) { + headers['Content-Type'] = value; + } +} + +function getDefaultAdapter() { + var adapter; + if (typeof XMLHttpRequest !== 'undefined') { + // For browsers use XHR adapter + adapter = require('./adapters/xhr'); + } else if (typeof process !== 'undefined' && Object.prototype.toString.call(process) === '[object process]') { + // For node use HTTP adapter + adapter = require('./adapters/http'); + } + return adapter; +} + +function stringifySafely(rawValue, parser, encoder) { + if (utils.isString(rawValue)) { + try { + (parser || JSON.parse)(rawValue); + return utils.trim(rawValue); + } catch (e) { + if (e.name !== 'SyntaxError') { + throw e; + } + } + } + + return (encoder || JSON.stringify)(rawValue); +} + +var defaults = { + + transitional: { + silentJSONParsing: true, + forcedJSONParsing: true, + clarifyTimeoutError: false + }, + + adapter: getDefaultAdapter(), + + transformRequest: [function transformRequest(data, headers) { + normalizeHeaderName(headers, 'Accept'); + normalizeHeaderName(headers, 'Content-Type'); + + if (utils.isFormData(data) || + utils.isArrayBuffer(data) || + utils.isBuffer(data) || + utils.isStream(data) || + utils.isFile(data) || + utils.isBlob(data) + ) { + return data; + } + if (utils.isArrayBufferView(data)) { + return data.buffer; + } + if (utils.isURLSearchParams(data)) { + setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8'); + return data.toString(); + } + if (utils.isObject(data) || (headers && headers['Content-Type'] === 'application/json')) { + setContentTypeIfUnset(headers, 'application/json'); + return stringifySafely(data); + } + return data; + }], + + transformResponse: [function transformResponse(data) { + var transitional = this.transitional; + var silentJSONParsing = transitional && transitional.silentJSONParsing; + var forcedJSONParsing = transitional && transitional.forcedJSONParsing; + var strictJSONParsing = !silentJSONParsing && this.responseType === 'json'; + + if (strictJSONParsing || (forcedJSONParsing && utils.isString(data) && data.length)) { + try { + return JSON.parse(data); + } catch (e) { + if (strictJSONParsing) { + if (e.name === 'SyntaxError') { + throw enhanceError(e, this, 'E_JSON_PARSE'); + } + throw e; + } + } + } + + return data; + }], + + /** + * A timeout in milliseconds to abort a request. If set to 0 (default) a + * timeout is not created. + */ + timeout: 0, + + xsrfCookieName: 'XSRF-TOKEN', + xsrfHeaderName: 'X-XSRF-TOKEN', + + maxContentLength: -1, + maxBodyLength: -1, + + validateStatus: function validateStatus(status) { + return status >= 200 && status < 300; + } +}; + +defaults.headers = { + common: { + 'Accept': 'application/json, text/plain, */*' + } +}; + +utils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) { + defaults.headers[method] = {}; +}); + +utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) { + defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE); +}); + +module.exports = defaults; diff --git a/node_modules/dhn-api/node_modules/axios/lib/helpers/README.md b/node_modules/dhn-api/node_modules/axios/lib/helpers/README.md new file mode 100644 index 000000000..4ae34193a --- /dev/null +++ b/node_modules/dhn-api/node_modules/axios/lib/helpers/README.md @@ -0,0 +1,7 @@ +# axios // helpers + +The modules found in `helpers/` should be generic modules that are _not_ specific to the domain logic of axios. These modules could theoretically be published to npm on their own and consumed by other modules or apps. Some examples of generic modules are things like: + +- Browser polyfills +- Managing cookies +- Parsing HTTP headers diff --git a/node_modules/dhn-api/node_modules/axios/lib/helpers/bind.js b/node_modules/dhn-api/node_modules/axios/lib/helpers/bind.js new file mode 100644 index 000000000..6147c608e --- /dev/null +++ b/node_modules/dhn-api/node_modules/axios/lib/helpers/bind.js @@ -0,0 +1,11 @@ +'use strict'; + +module.exports = function bind(fn, thisArg) { + return function wrap() { + var args = new Array(arguments.length); + for (var i = 0; i < args.length; i++) { + args[i] = arguments[i]; + } + return fn.apply(thisArg, args); + }; +}; diff --git a/node_modules/dhn-api/node_modules/axios/lib/helpers/buildURL.js b/node_modules/dhn-api/node_modules/axios/lib/helpers/buildURL.js new file mode 100644 index 000000000..31595c33a --- /dev/null +++ b/node_modules/dhn-api/node_modules/axios/lib/helpers/buildURL.js @@ -0,0 +1,70 @@ +'use strict'; + +var utils = require('./../utils'); + +function encode(val) { + return encodeURIComponent(val). + replace(/%3A/gi, ':'). + replace(/%24/g, '$'). + replace(/%2C/gi, ','). + replace(/%20/g, '+'). + replace(/%5B/gi, '['). + replace(/%5D/gi, ']'); +} + +/** + * Build a URL by appending params to the end + * + * @param {string} url The base of the url (e.g., http://www.google.com) + * @param {object} [params] The params to be appended + * @returns {string} The formatted url + */ +module.exports = function buildURL(url, params, paramsSerializer) { + /*eslint no-param-reassign:0*/ + if (!params) { + return url; + } + + var serializedParams; + if (paramsSerializer) { + serializedParams = paramsSerializer(params); + } else if (utils.isURLSearchParams(params)) { + serializedParams = params.toString(); + } else { + var parts = []; + + utils.forEach(params, function serialize(val, key) { + if (val === null || typeof val === 'undefined') { + return; + } + + if (utils.isArray(val)) { + key = key + '[]'; + } else { + val = [val]; + } + + utils.forEach(val, function parseValue(v) { + if (utils.isDate(v)) { + v = v.toISOString(); + } else if (utils.isObject(v)) { + v = JSON.stringify(v); + } + parts.push(encode(key) + '=' + encode(v)); + }); + }); + + serializedParams = parts.join('&'); + } + + if (serializedParams) { + var hashmarkIndex = url.indexOf('#'); + if (hashmarkIndex !== -1) { + url = url.slice(0, hashmarkIndex); + } + + url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams; + } + + return url; +}; diff --git a/node_modules/dhn-api/node_modules/axios/lib/helpers/combineURLs.js b/node_modules/dhn-api/node_modules/axios/lib/helpers/combineURLs.js new file mode 100644 index 000000000..f1b58a586 --- /dev/null +++ b/node_modules/dhn-api/node_modules/axios/lib/helpers/combineURLs.js @@ -0,0 +1,14 @@ +'use strict'; + +/** + * Creates a new URL by combining the specified URLs + * + * @param {string} baseURL The base URL + * @param {string} relativeURL The relative URL + * @returns {string} The combined URL + */ +module.exports = function combineURLs(baseURL, relativeURL) { + return relativeURL + ? baseURL.replace(/\/+$/, '') + '/' + relativeURL.replace(/^\/+/, '') + : baseURL; +}; diff --git a/node_modules/dhn-api/node_modules/axios/lib/helpers/cookies.js b/node_modules/dhn-api/node_modules/axios/lib/helpers/cookies.js new file mode 100644 index 000000000..5a8a66661 --- /dev/null +++ b/node_modules/dhn-api/node_modules/axios/lib/helpers/cookies.js @@ -0,0 +1,53 @@ +'use strict'; + +var utils = require('./../utils'); + +module.exports = ( + utils.isStandardBrowserEnv() ? + + // Standard browser envs support document.cookie + (function standardBrowserEnv() { + return { + write: function write(name, value, expires, path, domain, secure) { + var cookie = []; + cookie.push(name + '=' + encodeURIComponent(value)); + + if (utils.isNumber(expires)) { + cookie.push('expires=' + new Date(expires).toGMTString()); + } + + if (utils.isString(path)) { + cookie.push('path=' + path); + } + + if (utils.isString(domain)) { + cookie.push('domain=' + domain); + } + + if (secure === true) { + cookie.push('secure'); + } + + document.cookie = cookie.join('; '); + }, + + read: function read(name) { + var match = document.cookie.match(new RegExp('(^|;\\s*)(' + name + ')=([^;]*)')); + return (match ? decodeURIComponent(match[3]) : null); + }, + + remove: function remove(name) { + this.write(name, '', Date.now() - 86400000); + } + }; + })() : + + // Non standard browser env (web workers, react-native) lack needed support. + (function nonStandardBrowserEnv() { + return { + write: function write() {}, + read: function read() { return null; }, + remove: function remove() {} + }; + })() +); diff --git a/node_modules/dhn-api/node_modules/axios/lib/helpers/deprecatedMethod.js b/node_modules/dhn-api/node_modules/axios/lib/helpers/deprecatedMethod.js new file mode 100644 index 000000000..ed40965ba --- /dev/null +++ b/node_modules/dhn-api/node_modules/axios/lib/helpers/deprecatedMethod.js @@ -0,0 +1,24 @@ +'use strict'; + +/*eslint no-console:0*/ + +/** + * Supply a warning to the developer that a method they are using + * has been deprecated. + * + * @param {string} method The name of the deprecated method + * @param {string} [instead] The alternate method to use if applicable + * @param {string} [docs] The documentation URL to get further details + */ +module.exports = function deprecatedMethod(method, instead, docs) { + try { + console.warn( + 'DEPRECATED method `' + method + '`.' + + (instead ? ' Use `' + instead + '` instead.' : '') + + ' This method will be removed in a future release.'); + + if (docs) { + console.warn('For more information about usage see ' + docs); + } + } catch (e) { /* Ignore */ } +}; diff --git a/node_modules/dhn-api/node_modules/axios/lib/helpers/isAbsoluteURL.js b/node_modules/dhn-api/node_modules/axios/lib/helpers/isAbsoluteURL.js new file mode 100644 index 000000000..d33e99275 --- /dev/null +++ b/node_modules/dhn-api/node_modules/axios/lib/helpers/isAbsoluteURL.js @@ -0,0 +1,14 @@ +'use strict'; + +/** + * Determines whether the specified URL is absolute + * + * @param {string} url The URL to test + * @returns {boolean} True if the specified URL is absolute, otherwise false + */ +module.exports = function isAbsoluteURL(url) { + // A URL is considered absolute if it begins with "://" or "//" (protocol-relative URL). + // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed + // by any combination of letters, digits, plus, period, or hyphen. + return /^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(url); +}; diff --git a/node_modules/dhn-api/node_modules/axios/lib/helpers/isAxiosError.js b/node_modules/dhn-api/node_modules/axios/lib/helpers/isAxiosError.js new file mode 100644 index 000000000..29ff41af8 --- /dev/null +++ b/node_modules/dhn-api/node_modules/axios/lib/helpers/isAxiosError.js @@ -0,0 +1,11 @@ +'use strict'; + +/** + * Determines whether the payload is an error thrown by Axios + * + * @param {*} payload The value to test + * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false + */ +module.exports = function isAxiosError(payload) { + return (typeof payload === 'object') && (payload.isAxiosError === true); +}; diff --git a/node_modules/dhn-api/node_modules/axios/lib/helpers/isURLSameOrigin.js b/node_modules/dhn-api/node_modules/axios/lib/helpers/isURLSameOrigin.js new file mode 100644 index 000000000..f1d89ad19 --- /dev/null +++ b/node_modules/dhn-api/node_modules/axios/lib/helpers/isURLSameOrigin.js @@ -0,0 +1,68 @@ +'use strict'; + +var utils = require('./../utils'); + +module.exports = ( + utils.isStandardBrowserEnv() ? + + // Standard browser envs have full support of the APIs needed to test + // whether the request URL is of the same origin as current location. + (function standardBrowserEnv() { + var msie = /(msie|trident)/i.test(navigator.userAgent); + var urlParsingNode = document.createElement('a'); + var originURL; + + /** + * Parse a URL to discover it's components + * + * @param {String} url The URL to be parsed + * @returns {Object} + */ + function resolveURL(url) { + var href = url; + + if (msie) { + // IE needs attribute set twice to normalize properties + urlParsingNode.setAttribute('href', href); + href = urlParsingNode.href; + } + + urlParsingNode.setAttribute('href', href); + + // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils + return { + href: urlParsingNode.href, + protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '', + host: urlParsingNode.host, + search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, '') : '', + hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '', + hostname: urlParsingNode.hostname, + port: urlParsingNode.port, + pathname: (urlParsingNode.pathname.charAt(0) === '/') ? + urlParsingNode.pathname : + '/' + urlParsingNode.pathname + }; + } + + originURL = resolveURL(window.location.href); + + /** + * Determine if a URL shares the same origin as the current location + * + * @param {String} requestURL The URL to test + * @returns {boolean} True if URL shares the same origin, otherwise false + */ + return function isURLSameOrigin(requestURL) { + var parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL; + return (parsed.protocol === originURL.protocol && + parsed.host === originURL.host); + }; + })() : + + // Non standard browser envs (web workers, react-native) lack needed support. + (function nonStandardBrowserEnv() { + return function isURLSameOrigin() { + return true; + }; + })() +); diff --git a/node_modules/dhn-api/node_modules/axios/lib/helpers/normalizeHeaderName.js b/node_modules/dhn-api/node_modules/axios/lib/helpers/normalizeHeaderName.js new file mode 100644 index 000000000..738c9fe40 --- /dev/null +++ b/node_modules/dhn-api/node_modules/axios/lib/helpers/normalizeHeaderName.js @@ -0,0 +1,12 @@ +'use strict'; + +var utils = require('../utils'); + +module.exports = function normalizeHeaderName(headers, normalizedName) { + utils.forEach(headers, function processHeader(value, name) { + if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) { + headers[normalizedName] = value; + delete headers[name]; + } + }); +}; diff --git a/node_modules/dhn-api/node_modules/axios/lib/helpers/parseHeaders.js b/node_modules/dhn-api/node_modules/axios/lib/helpers/parseHeaders.js new file mode 100644 index 000000000..8af2cc7f1 --- /dev/null +++ b/node_modules/dhn-api/node_modules/axios/lib/helpers/parseHeaders.js @@ -0,0 +1,53 @@ +'use strict'; + +var utils = require('./../utils'); + +// Headers whose duplicates are ignored by node +// c.f. https://nodejs.org/api/http.html#http_message_headers +var ignoreDuplicateOf = [ + 'age', 'authorization', 'content-length', 'content-type', 'etag', + 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since', + 'last-modified', 'location', 'max-forwards', 'proxy-authorization', + 'referer', 'retry-after', 'user-agent' +]; + +/** + * Parse headers into an object + * + * ``` + * Date: Wed, 27 Aug 2014 08:58:49 GMT + * Content-Type: application/json + * Connection: keep-alive + * Transfer-Encoding: chunked + * ``` + * + * @param {String} headers Headers needing to be parsed + * @returns {Object} Headers parsed into an object + */ +module.exports = function parseHeaders(headers) { + var parsed = {}; + var key; + var val; + var i; + + if (!headers) { return parsed; } + + utils.forEach(headers.split('\n'), function parser(line) { + i = line.indexOf(':'); + key = utils.trim(line.substr(0, i)).toLowerCase(); + val = utils.trim(line.substr(i + 1)); + + if (key) { + if (parsed[key] && ignoreDuplicateOf.indexOf(key) >= 0) { + return; + } + if (key === 'set-cookie') { + parsed[key] = (parsed[key] ? parsed[key] : []).concat([val]); + } else { + parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val; + } + } + }); + + return parsed; +}; diff --git a/node_modules/dhn-api/node_modules/axios/lib/helpers/spread.js b/node_modules/dhn-api/node_modules/axios/lib/helpers/spread.js new file mode 100644 index 000000000..25e3cdd39 --- /dev/null +++ b/node_modules/dhn-api/node_modules/axios/lib/helpers/spread.js @@ -0,0 +1,27 @@ +'use strict'; + +/** + * Syntactic sugar for invoking a function and expanding an array for arguments. + * + * Common use case would be to use `Function.prototype.apply`. + * + * ```js + * function f(x, y, z) {} + * var args = [1, 2, 3]; + * f.apply(null, args); + * ``` + * + * With `spread` this example can be re-written. + * + * ```js + * spread(function(x, y, z) {})([1, 2, 3]); + * ``` + * + * @param {Function} callback + * @returns {Function} + */ +module.exports = function spread(callback) { + return function wrap(arr) { + return callback.apply(null, arr); + }; +}; diff --git a/node_modules/dhn-api/node_modules/axios/lib/helpers/validator.js b/node_modules/dhn-api/node_modules/axios/lib/helpers/validator.js new file mode 100644 index 000000000..7f1bc7dfa --- /dev/null +++ b/node_modules/dhn-api/node_modules/axios/lib/helpers/validator.js @@ -0,0 +1,105 @@ +'use strict'; + +var pkg = require('./../../package.json'); + +var validators = {}; + +// eslint-disable-next-line func-names +['object', 'boolean', 'number', 'function', 'string', 'symbol'].forEach(function(type, i) { + validators[type] = function validator(thing) { + return typeof thing === type || 'a' + (i < 1 ? 'n ' : ' ') + type; + }; +}); + +var deprecatedWarnings = {}; +var currentVerArr = pkg.version.split('.'); + +/** + * Compare package versions + * @param {string} version + * @param {string?} thanVersion + * @returns {boolean} + */ +function isOlderVersion(version, thanVersion) { + var pkgVersionArr = thanVersion ? thanVersion.split('.') : currentVerArr; + var destVer = version.split('.'); + for (var i = 0; i < 3; i++) { + if (pkgVersionArr[i] > destVer[i]) { + return true; + } else if (pkgVersionArr[i] < destVer[i]) { + return false; + } + } + return false; +} + +/** + * Transitional option validator + * @param {function|boolean?} validator + * @param {string?} version + * @param {string} message + * @returns {function} + */ +validators.transitional = function transitional(validator, version, message) { + var isDeprecated = version && isOlderVersion(version); + + function formatMessage(opt, desc) { + return '[Axios v' + pkg.version + '] Transitional option \'' + opt + '\'' + desc + (message ? '. ' + message : ''); + } + + // eslint-disable-next-line func-names + return function(value, opt, opts) { + if (validator === false) { + throw new Error(formatMessage(opt, ' has been removed in ' + version)); + } + + if (isDeprecated && !deprecatedWarnings[opt]) { + deprecatedWarnings[opt] = true; + // eslint-disable-next-line no-console + console.warn( + formatMessage( + opt, + ' has been deprecated since v' + version + ' and will be removed in the near future' + ) + ); + } + + return validator ? validator(value, opt, opts) : true; + }; +}; + +/** + * Assert object's properties type + * @param {object} options + * @param {object} schema + * @param {boolean?} allowUnknown + */ + +function assertOptions(options, schema, allowUnknown) { + if (typeof options !== 'object') { + throw new TypeError('options must be an object'); + } + var keys = Object.keys(options); + var i = keys.length; + while (i-- > 0) { + var opt = keys[i]; + var validator = schema[opt]; + if (validator) { + var value = options[opt]; + var result = value === undefined || validator(value, opt, options); + if (result !== true) { + throw new TypeError('option ' + opt + ' must be ' + result); + } + continue; + } + if (allowUnknown !== true) { + throw Error('Unknown option ' + opt); + } + } +} + +module.exports = { + isOlderVersion: isOlderVersion, + assertOptions: assertOptions, + validators: validators +}; diff --git a/node_modules/dhn-api/node_modules/axios/lib/utils.js b/node_modules/dhn-api/node_modules/axios/lib/utils.js new file mode 100644 index 000000000..5d966f444 --- /dev/null +++ b/node_modules/dhn-api/node_modules/axios/lib/utils.js @@ -0,0 +1,349 @@ +'use strict'; + +var bind = require('./helpers/bind'); + +// utils is a library of generic helper functions non-specific to axios + +var toString = Object.prototype.toString; + +/** + * Determine if a value is an Array + * + * @param {Object} val The value to test + * @returns {boolean} True if value is an Array, otherwise false + */ +function isArray(val) { + return toString.call(val) === '[object Array]'; +} + +/** + * Determine if a value is undefined + * + * @param {Object} val The value to test + * @returns {boolean} True if the value is undefined, otherwise false + */ +function isUndefined(val) { + return typeof val === 'undefined'; +} + +/** + * Determine if a value is a Buffer + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a Buffer, otherwise false + */ +function isBuffer(val) { + return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor) + && typeof val.constructor.isBuffer === 'function' && val.constructor.isBuffer(val); +} + +/** + * Determine if a value is an ArrayBuffer + * + * @param {Object} val The value to test + * @returns {boolean} True if value is an ArrayBuffer, otherwise false + */ +function isArrayBuffer(val) { + return toString.call(val) === '[object ArrayBuffer]'; +} + +/** + * Determine if a value is a FormData + * + * @param {Object} val The value to test + * @returns {boolean} True if value is an FormData, otherwise false + */ +function isFormData(val) { + return (typeof FormData !== 'undefined') && (val instanceof FormData); +} + +/** + * Determine if a value is a view on an ArrayBuffer + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false + */ +function isArrayBufferView(val) { + var result; + if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) { + result = ArrayBuffer.isView(val); + } else { + result = (val) && (val.buffer) && (val.buffer instanceof ArrayBuffer); + } + return result; +} + +/** + * Determine if a value is a String + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a String, otherwise false + */ +function isString(val) { + return typeof val === 'string'; +} + +/** + * Determine if a value is a Number + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a Number, otherwise false + */ +function isNumber(val) { + return typeof val === 'number'; +} + +/** + * Determine if a value is an Object + * + * @param {Object} val The value to test + * @returns {boolean} True if value is an Object, otherwise false + */ +function isObject(val) { + return val !== null && typeof val === 'object'; +} + +/** + * Determine if a value is a plain Object + * + * @param {Object} val The value to test + * @return {boolean} True if value is a plain Object, otherwise false + */ +function isPlainObject(val) { + if (toString.call(val) !== '[object Object]') { + return false; + } + + var prototype = Object.getPrototypeOf(val); + return prototype === null || prototype === Object.prototype; +} + +/** + * Determine if a value is a Date + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a Date, otherwise false + */ +function isDate(val) { + return toString.call(val) === '[object Date]'; +} + +/** + * Determine if a value is a File + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a File, otherwise false + */ +function isFile(val) { + return toString.call(val) === '[object File]'; +} + +/** + * Determine if a value is a Blob + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a Blob, otherwise false + */ +function isBlob(val) { + return toString.call(val) === '[object Blob]'; +} + +/** + * Determine if a value is a Function + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a Function, otherwise false + */ +function isFunction(val) { + return toString.call(val) === '[object Function]'; +} + +/** + * Determine if a value is a Stream + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a Stream, otherwise false + */ +function isStream(val) { + return isObject(val) && isFunction(val.pipe); +} + +/** + * Determine if a value is a URLSearchParams object + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a URLSearchParams object, otherwise false + */ +function isURLSearchParams(val) { + return typeof URLSearchParams !== 'undefined' && val instanceof URLSearchParams; +} + +/** + * Trim excess whitespace off the beginning and end of a string + * + * @param {String} str The String to trim + * @returns {String} The String freed of excess whitespace + */ +function trim(str) { + return str.trim ? str.trim() : str.replace(/^\s+|\s+$/g, ''); +} + +/** + * Determine if we're running in a standard browser environment + * + * This allows axios to run in a web worker, and react-native. + * Both environments support XMLHttpRequest, but not fully standard globals. + * + * web workers: + * typeof window -> undefined + * typeof document -> undefined + * + * react-native: + * navigator.product -> 'ReactNative' + * nativescript + * navigator.product -> 'NativeScript' or 'NS' + */ +function isStandardBrowserEnv() { + if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' || + navigator.product === 'NativeScript' || + navigator.product === 'NS')) { + return false; + } + return ( + typeof window !== 'undefined' && + typeof document !== 'undefined' + ); +} + +/** + * Iterate over an Array or an Object invoking a function for each item. + * + * If `obj` is an Array callback will be called passing + * the value, index, and complete array for each item. + * + * If 'obj' is an Object callback will be called passing + * the value, key, and complete object for each property. + * + * @param {Object|Array} obj The object to iterate + * @param {Function} fn The callback to invoke for each item + */ +function forEach(obj, fn) { + // Don't bother if no value provided + if (obj === null || typeof obj === 'undefined') { + return; + } + + // Force an array if not already something iterable + if (typeof obj !== 'object') { + /*eslint no-param-reassign:0*/ + obj = [obj]; + } + + if (isArray(obj)) { + // Iterate over array values + for (var i = 0, l = obj.length; i < l; i++) { + fn.call(null, obj[i], i, obj); + } + } else { + // Iterate over object keys + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) { + fn.call(null, obj[key], key, obj); + } + } + } +} + +/** + * Accepts varargs expecting each argument to be an object, then + * immutably merges the properties of each object and returns result. + * + * When multiple objects contain the same key the later object in + * the arguments list will take precedence. + * + * Example: + * + * ```js + * var result = merge({foo: 123}, {foo: 456}); + * console.log(result.foo); // outputs 456 + * ``` + * + * @param {Object} obj1 Object to merge + * @returns {Object} Result of all merge properties + */ +function merge(/* obj1, obj2, obj3, ... */) { + var result = {}; + function assignValue(val, key) { + if (isPlainObject(result[key]) && isPlainObject(val)) { + result[key] = merge(result[key], val); + } else if (isPlainObject(val)) { + result[key] = merge({}, val); + } else if (isArray(val)) { + result[key] = val.slice(); + } else { + result[key] = val; + } + } + + for (var i = 0, l = arguments.length; i < l; i++) { + forEach(arguments[i], assignValue); + } + return result; +} + +/** + * Extends object a by mutably adding to it the properties of object b. + * + * @param {Object} a The object to be extended + * @param {Object} b The object to copy properties from + * @param {Object} thisArg The object to bind function to + * @return {Object} The resulting value of object a + */ +function extend(a, b, thisArg) { + forEach(b, function assignValue(val, key) { + if (thisArg && typeof val === 'function') { + a[key] = bind(val, thisArg); + } else { + a[key] = val; + } + }); + return a; +} + +/** + * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM) + * + * @param {string} content with BOM + * @return {string} content value without BOM + */ +function stripBOM(content) { + if (content.charCodeAt(0) === 0xFEFF) { + content = content.slice(1); + } + return content; +} + +module.exports = { + isArray: isArray, + isArrayBuffer: isArrayBuffer, + isBuffer: isBuffer, + isFormData: isFormData, + isArrayBufferView: isArrayBufferView, + isString: isString, + isNumber: isNumber, + isObject: isObject, + isPlainObject: isPlainObject, + isUndefined: isUndefined, + isDate: isDate, + isFile: isFile, + isBlob: isBlob, + isFunction: isFunction, + isStream: isStream, + isURLSearchParams: isURLSearchParams, + isStandardBrowserEnv: isStandardBrowserEnv, + forEach: forEach, + merge: merge, + extend: extend, + trim: trim, + stripBOM: stripBOM +}; diff --git a/node_modules/dhn-api/node_modules/axios/package.json b/node_modules/dhn-api/node_modules/axios/package.json new file mode 100644 index 000000000..7c895b3a9 --- /dev/null +++ b/node_modules/dhn-api/node_modules/axios/package.json @@ -0,0 +1,84 @@ +{ + "name": "axios", + "version": "0.21.4", + "description": "Promise based HTTP client for the browser and node.js", + "main": "index.js", + "scripts": { + "test": "grunt test", + "start": "node ./sandbox/server.js", + "build": "NODE_ENV=production grunt build", + "preversion": "npm test", + "version": "npm run build && grunt version && git add -A dist && git add CHANGELOG.md bower.json package.json", + "postversion": "git push && git push --tags", + "examples": "node ./examples/server.js", + "coveralls": "cat coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js", + "fix": "eslint --fix lib/**/*.js" + }, + "repository": { + "type": "git", + "url": "https://github.com/axios/axios.git" + }, + "keywords": [ + "xhr", + "http", + "ajax", + "promise", + "node" + ], + "author": "Matt Zabriskie", + "license": "MIT", + "bugs": { + "url": "https://github.com/axios/axios/issues" + }, + "homepage": "https://axios-http.com", + "devDependencies": { + "coveralls": "^3.0.0", + "es6-promise": "^4.2.4", + "grunt": "^1.3.0", + "grunt-banner": "^0.6.0", + "grunt-cli": "^1.2.0", + "grunt-contrib-clean": "^1.1.0", + "grunt-contrib-watch": "^1.0.0", + "grunt-eslint": "^23.0.0", + "grunt-karma": "^4.0.0", + "grunt-mocha-test": "^0.13.3", + "grunt-ts": "^6.0.0-beta.19", + "grunt-webpack": "^4.0.2", + "istanbul-instrumenter-loader": "^1.0.0", + "jasmine-core": "^2.4.1", + "karma": "^6.3.2", + "karma-chrome-launcher": "^3.1.0", + "karma-firefox-launcher": "^2.1.0", + "karma-jasmine": "^1.1.1", + "karma-jasmine-ajax": "^0.1.13", + "karma-safari-launcher": "^1.0.0", + "karma-sauce-launcher": "^4.3.6", + "karma-sinon": "^1.0.5", + "karma-sourcemap-loader": "^0.3.8", + "karma-webpack": "^4.0.2", + "load-grunt-tasks": "^3.5.2", + "minimist": "^1.2.0", + "mocha": "^8.2.1", + "sinon": "^4.5.0", + "terser-webpack-plugin": "^4.2.3", + "typescript": "^4.0.5", + "url-search-params": "^0.10.0", + "webpack": "^4.44.2", + "webpack-dev-server": "^3.11.0" + }, + "browser": { + "./lib/adapters/http.js": "./lib/adapters/xhr.js" + }, + "jsdelivr": "dist/axios.min.js", + "unpkg": "dist/axios.min.js", + "typings": "./index.d.ts", + "dependencies": { + "follow-redirects": "^1.14.0" + }, + "bundlesize": [ + { + "path": "./dist/axios.min.js", + "threshold": "5kB" + } + ] +} diff --git a/node_modules/dhn-api/package.json b/node_modules/dhn-api/package.json new file mode 100644 index 000000000..02707f62c --- /dev/null +++ b/node_modules/dhn-api/package.json @@ -0,0 +1,24 @@ +{ + "name": "dhn-api", + "version": "1.1.3", + "description": "An Example Api's", + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "repository": { + "type": "git", + "url": "https://github.com/dehan-j1ng" + }, + "keywords": [ + "scrapper", + "api" + ], + "author": "Dehante (https://dhn-api.herokuapp.com/api)", + "license": "ISC", + "dependencies": { + "axios": "^0.21.1", + "cheerio": "^1.0.0-rc.10", + "path": "^0.12.7" + } +} diff --git a/node_modules/dhn-api/readme.md b/node_modules/dhn-api/readme.md new file mode 100644 index 000000000..6f1b85bae --- /dev/null +++ b/node_modules/dhn-api/readme.md @@ -0,0 +1,179 @@ +# Installing + +```bash +pkg update +pkg upgrade +pkg install nodejs +npm i dhn-api --save +``` + + +### De-BOTZ Example Case For dhn-api +| Link | Thank You >\/\/< | +|------|------------------| +|[HERE](https://dehan-j1ng/De-BOTZ)| De-BOTZ | +|[HERE](https://dhn-api.herokuapp.com/api)| Dhn-Api Rest | + +**Bakaaa Onichann >\/\/<** + + +## Usages + +```bash +const dhn_api = require("dhn-api"); + +(async() => { + const API = await dhn_api.KomikuSearch("naruto"); + console.log(API); +}(); +``` + + +**Output:** + +```bash +[ + { + status: 200, + creator: '@dehan_j1ng', + manga: 'Naruto', + manga_desc: 'Update 10 bulan lalu. Naruto adalah ninja adalah sesama penghuni desa.', + manga_url: 'https://data3.komiku.id/manga/naruto/', + manga_thumb: 'https://cover.komiku.id/wp-content/uploads/2020/08/Komik-Naruto.jpg?resize=450,235&quality=60', + chapter: { + pertama: 'https://data3.komiku.id/ch/komik-naruto-chapter-1-bahasa-indonesia/', + terbaru: 'https://data3.komiku.id/ch/komik-naruto-chapter-711-bahasa-indonesia/' + } + } +] +``` + +### Try this to show All + +```bash +const dhn_api = require("dhn-api"); + +( async () => { + const API = await dhn_api; + console.log(API); +})(); +``` + + +**Output:** + +```bash +{ + BBCNews: [AsyncFunction: BBC], + metroNews: [AsyncFunction: metroTV_], + CNNNews: [AsyncFunction: CNN_], + iNews: [AsyncFunction: iNewsTV_], + KumparanNews: [AsyncFunction: Kumparan_], + TribunNews: [AsyncFunction: Tribun_], + DailyNews: [AsyncFunction: DailyNews_], + DetikNews: [AsyncFunction: DetikNews_], + OkezoneNews: [AsyncFunction: Okezone_], + CNBCNews: [AsyncFunction: CNBC_], + FajarNews: [AsyncFunction: KoranFajar_], + KompasNews: [AsyncFunction: Kompas_], + SindoNews: [AsyncFunction: KoranSindo_], + TempoNews: [AsyncFunction: TempoNews_], + IndozoneNews: [AsyncFunction: Indozone_], + AntaraNews: [AsyncFunction: AntaraNews_], + RepublikaNews: [AsyncFunction: Republika_], + VivaNews: [AsyncFunction: VIVA_], + KontanNews: [AsyncFunction: Kontan_], + MerdekaNews: [AsyncFunction: Merdeka_], + KomikuSearch: [AsyncFunction: Komiku_], + AniPlanetSearch: [AsyncFunction: AnimePlanet_], + KomikFoxSearch: [AsyncFunction: KomikFox_], + KomikStationSearch: [AsyncFunction: KomikStation_], + MangakuSearch: [AsyncFunction: Mangakus_], + KiryuuSearch: [AsyncFunction: Kiryuus_], + KissMangaSearch: [AsyncFunction: KissM_], + KlikMangaSearch: [AsyncFunction: KlikS_], + PalingMurah: [AsyncFunction: palingmurah_], + LayarKaca21: [AsyncFunction: layarkaca_], + AminoApps: [AsyncFunction: Amino_], + Mangatoon: [AsyncFunction: Mangatoon], + WAModsSearch: [AsyncFunction: WAMods], + Emojis: [AsyncFunction: Emojing_], + CoronaInfo: [AsyncFunction: Corona_], + Cerpen: [Function: Cerpen_], + Quotes: [Function: Quotes_], + Couples: [Function: Couples], + JalanTikusMeme: [Function: JTMimers], + Darkjokes: [Function: Dark] +} +``` + +#### List Features +
+ +| List | Name | +|------|------| +| Type | Anime | +| 1 | Komiku Search | +| 2 | Anime Planet Search | +| 3 | Komik Fox Search | +| 4 | Komok Station Search | +| 5 | Mangaku Search | +| 6 | Kiryuu Search | +| 7 | Kissmanga Search | +| 8 | Klikmanga Search | +
+ +| List | Name | +|------|------| +| Type | News | +| 1 | Kompas News | +| 2 | CNN News | +| 3 | CNBC News | +| 4 | Tribun News | +| 5 | Kumparan News | +| 6 | Daily News | +| 7 | Detik News | +| 8 | BCC News | +| 9 | Metro News | +| 10 | INews News | +| 11 | Sindo News | +| 12 | Fajar News | +| 13 | Okezone News | +| 14 | Indozone News | +| 15 | Tempo News | +| 16 | Republika News | +| 17 | Antara News | +| 18 | Viva News | +| 19 | Kontan News | +| 20 | Merdeka News | +
+ +| List | Name | +|------|------| +| Type | Search | +| 1 | Paling Murah Search | +| 2 | LayarKaca21 Search | +| 3 | AminoApps Search | +| 4 | Mangatoon Search | +| 5 | Whatsapp Mods Search | +
+ +| List | Name | +|------|------| +| Type | Other | +| 1 | Emoji to Png | +| 2 | Corona Info | +
+ +| List | Name | +|------|------| +| Type | Random | +| 1 | Quotes Random | +| 2 | Cerpen Random | +| 3 | Darkjokes Random | +| 4 | Couples Wallpaper Random | +| 5 | Jalantikus Meme Random | + +### Thanks you for installing this packages >\/\/\/< + +baakaaaaa !1!1!1!1!!!! :3 \ No newline at end of file diff --git a/node_modules/emoji-api/LICENSE b/node_modules/emoji-api/LICENSE new file mode 100644 index 000000000..f288702d2 --- /dev/null +++ b/node_modules/emoji-api/LICENSE @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. diff --git a/node_modules/emoji-api/README.md b/node_modules/emoji-api/README.md new file mode 100644 index 000000000..902a4366a --- /dev/null +++ b/node_modules/emoji-api/README.md @@ -0,0 +1,117 @@ +# EmojiAPI +Simple Emoji API. + +# Installing + +```sh +$ npm i emoji-api +``` + +# Example + +```js +const { EmojiAPI } = require("emoji-api"); +const emoji = new EmojiAPI(); + +emoji.get("😂") + .then(emoji => { + console.log(emoji); + }) + +/* +Emoji { + emoji: '😂', + unicode: 'U+1F602', + name: 'Face with Tears of Joy', + description: 'A yellow face with a big grin, uplifted eyebrows, and smiling eyes, each shedding a tear from laughing so hard. Widely used to show something is funny or pleasing.', + images: [ + { + index: 0, + vendor: 'Apple', + url: 'https://emojipedia-us.s3.dualstack.us-west-1.amazonaws.com/thumbs/120/apple/271/face-with-tears-of-joy_1f602.png' + }, + { + index: 1, + vendor: 'Google', + url: 'https://emojipedia-us.s3.dualstack.us-west-1.amazonaws.com/thumbs/120/google/274/face-with-tears-of-joy_1f602.png' + }, + { + index: 2, + vendor: 'Samsung', + url: 'https://emojipedia-us.s3.dualstack.us-west-1.amazonaws.com/thumbs/120/samsung/265/face-with-tears-of-joy_1f602.png' + }, + { + index: 3, + vendor: 'Microsoft', + url: 'https://emojipedia-us.s3.dualstack.us-west-1.amazonaws.com/thumbs/120/microsoft/209/face-with-tears-of-joy_1f602.png' + }, + { + index: 4, + vendor: 'WhatsApp', + url: 'https://emojipedia-us.s3.dualstack.us-west-1.amazonaws.com/thumbs/120/whatsapp/273/face-with-tears-of-joy_1f602.png' + }, + { + index: 5, + vendor: 'Twitter', + url: 'https://emojipedia-us.s3.dualstack.us-west-1.amazonaws.com/thumbs/120/twitter/259/face-with-tears-of-joy_1f602.png' + }, + { + index: 6, + vendor: 'Facebook', + url: 'https://emojipedia-us.s3.dualstack.us-west-1.amazonaws.com/thumbs/120/facebook/230/face-with-tears-of-joy_1f602.png' + }, + { + index: 7, + vendor: 'JoyPixels', + url: 'https://emojipedia-us.s3.dualstack.us-west-1.amazonaws.com/thumbs/120/joypixels/257/face-with-tears-of-joy_1f602.png' + }, + { + index: 8, + vendor: 'OpenMoji', + url: 'https://emojipedia-us.s3.dualstack.us-west-1.amazonaws.com/thumbs/120/openmoji/272/face-with-tears-of-joy_1f602.png' + }, + { + index: 9, + vendor: 'emojidex', + url: 'https://emojipedia-us.s3.dualstack.us-west-1.amazonaws.com/thumbs/120/emojidex/112/face-with-tears-of-joy_1f602.png' + }, + { + index: 10, + vendor: 'Messenger', + url: 'https://emojipedia-us.s3.dualstack.us-west-1.amazonaws.com/thumbs/120/facebook/65/face-with-tears-of-joy_1f602.png' + }, + { + index: 11, + vendor: 'LG', + url: 'https://emojipedia-us.s3.dualstack.us-west-1.amazonaws.com/thumbs/120/lg/57/face-with-tears-of-joy_1f602.png' + }, + { + index: 12, + vendor: 'HTC', + url: 'https://emojipedia-us.s3.dualstack.us-west-1.amazonaws.com/thumbs/120/htc/122/face-with-tears-of-joy_1f602.png' + }, + { + index: 13, + vendor: 'Mozilla', + url: 'https://emojipedia-us.s3.dualstack.us-west-1.amazonaws.com/thumbs/120/mozilla/36/face-with-tears-of-joy_1f602.png' + }, + { + index: 14, + vendor: 'SoftBank', + url: 'https://emojipedia-us.s3.dualstack.us-west-1.amazonaws.com/thumbs/120/softbank/145/face-with-tears-of-joy_1f602.png' + }, + { + index: 15, + vendor: 'Docomo', + url: 'https://emojipedia-us.s3.dualstack.us-west-1.amazonaws.com/thumbs/120/docomo/205/face-with-tears-of-joy_1f602.png' + }, + { + index: 16, + vendor: 'au by KDDI', + url: 'https://emojipedia-us.s3.dualstack.us-west-1.amazonaws.com/thumbs/120/au-kddi/190/face-with-tears-of-joy_1f602.png' + } + ], + shortCodes: [ ':joy:', ':face_with_tears_of_joy:' ] +} +*/ +``` \ No newline at end of file diff --git a/node_modules/emoji-api/build/Emoji.d.ts b/node_modules/emoji-api/build/Emoji.d.ts new file mode 100644 index 000000000..d0f791cc8 --- /dev/null +++ b/node_modules/emoji-api/build/Emoji.d.ts @@ -0,0 +1,40 @@ +import { EmojiImage } from "./Parser"; +declare class Emoji { + emoji?: string; + unicode?: string; + name?: string; + description?: string; + images: EmojiImage[]; + shortCodes: string[]; + constructor(data: any); + _patch(data: any): void; + get encodeURI(): string; + get Apple(): EmojiImage; + get Google(): EmojiImage; + get Samsung(): EmojiImage; + get Microsoft(): EmojiImage; + get WhatsApp(): EmojiImage; + get Twitter(): EmojiImage; + get Facebook(): EmojiImage; + get JoyPixels(): EmojiImage; + get OpenMoji(): EmojiImage; + get Emojidex(): EmojiImage; + get Messenger(): EmojiImage; + get LG(): EmojiImage; + get HTC(): EmojiImage; + get Mozilla(): EmojiImage; + get SoftBank(): EmojiImage; + get Docomo(): EmojiImage; + get auByKDDI(): EmojiImage; + toArray(): EmojiImage[]; + toString(): string; + toJSON(): { + emoji: string; + name: string; + unicode: string; + description: string; + images: EmojiImage[]; + shortCodes: string[]; + }; +} +export { Emoji }; diff --git a/node_modules/emoji-api/build/Emoji.js b/node_modules/emoji-api/build/Emoji.js new file mode 100644 index 000000000..2e93e3c21 --- /dev/null +++ b/node_modules/emoji-api/build/Emoji.js @@ -0,0 +1,89 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Emoji = void 0; +class Emoji { + constructor(data) { + if (!data) + throw new Error(`Cannot instantiate ${this.constructor.name} class without data!`); + this._patch(data); + } + _patch(data) { + this.emoji = data.emoji || null; + this.unicode = data.unicode ? `U+${String(data.unicode).toUpperCase()}` : null; + this.name = data.name || null; + this.description = data.description || null; + this.images = data.images || []; + this.shortCodes = data.shortCodes || []; + } + get encodeURI() { + return encodeURIComponent(this.emoji || ""); + } + get Apple() { + return this.images.find(i => i.vendor.toLowerCase().includes("apple")); + } + get Google() { + return this.images.find(i => i.vendor.toLowerCase().includes("google")); + } + get Samsung() { + return this.images.find(i => i.vendor.toLowerCase().includes("samsung")); + } + get Microsoft() { + return this.images.find(i => i.vendor.toLowerCase().includes("microsoft")); + } + get WhatsApp() { + return this.images.find(i => i.vendor.toLowerCase().includes("whatsapp")); + } + get Twitter() { + return this.images.find(i => i.vendor.toLowerCase().includes("twitter")); + } + get Facebook() { + return this.images.find(i => i.vendor.toLowerCase().includes("facebook")); + } + get JoyPixels() { + return this.images.find(i => i.vendor.toLowerCase().includes("joypixels")); + } + get OpenMoji() { + return this.images.find(i => i.vendor.toLowerCase().includes("openmoji")); + } + get Emojidex() { + return this.images.find(i => i.vendor.toLowerCase().includes("emojidex")); + } + get Messenger() { + return this.images.find(i => i.vendor.toLowerCase().includes("messenger")); + } + get LG() { + return this.images.find(i => i.vendor.toLowerCase().includes("lg")); + } + get HTC() { + return this.images.find(i => i.vendor.toLowerCase().includes("htc")); + } + get Mozilla() { + return this.images.find(i => i.vendor.toLowerCase().includes("mozilla")); + } + get SoftBank() { + return this.images.find(i => i.vendor.toLowerCase().includes("softbank")); + } + get Docomo() { + return this.images.find(i => i.vendor.toLowerCase().includes("docomo")); + } + get auByKDDI() { + return this.images.find(i => i.vendor.toLowerCase().includes("kddi")); + } + toArray() { + return this.images; + } + toString() { + return this.name || ""; + } + toJSON() { + return { + emoji: this.emoji, + name: this.name, + unicode: this.unicode, + description: this.description, + images: this.images, + shortCodes: this.shortCodes + }; + } +} +exports.Emoji = Emoji; diff --git a/node_modules/emoji-api/build/Parser.d.ts b/node_modules/emoji-api/build/Parser.d.ts new file mode 100644 index 000000000..029bbfbce --- /dev/null +++ b/node_modules/emoji-api/build/Parser.d.ts @@ -0,0 +1,18 @@ +export interface EmojiRawData { + emoji: string; + unicode: string; + name: string; + description: string; + images: EmojiImage[]; + shortCodes: string[]; +} +export interface EmojiImage { + index: number; + vendor: string; + url: string; +} +export declare class Parser { + static getHTML(emoji: string): Promise; + static fetchData(html: string): EmojiRawData; + static emojiUnicode(emoji: string): string; +} diff --git a/node_modules/emoji-api/build/Parser.js b/node_modules/emoji-api/build/Parser.js new file mode 100644 index 000000000..60681bc7a --- /dev/null +++ b/node_modules/emoji-api/build/Parser.js @@ -0,0 +1,58 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Parser = void 0; +const node_fetch_1 = __importDefault(require("node-fetch")); +const jsdom_1 = require("jsdom"); +const BASE_URL = "https://emojipedia.org"; +class Parser { + static async getHTML(emoji) { + try { + const data = await node_fetch_1.default(`${BASE_URL}/${encodeURIComponent(emoji)}`); + const res = await data.text(); + return res; + } + catch { + return null; + } + } + static fetchData(html) { + const { document } = new jsdom_1.JSDOM(html).window; + const res = { + emoji: document.title.split(" ")[0], + unicode: Parser.emojiUnicode(document.title.split(" ")[0]), + name: html.split(`

${document.title.split(" ")[0]}`)[1].split("

")[0].trim(), + description: document.querySelector('section[class="description"]').querySelector("p").textContent.trim(), + images: [], + shortCodes: [] + }; + const vendors = document.getElementsByClassName("vendor-rollout-target"); + for (let i = 0; i < vendors.length; i++) { + const vendor = vendors[i]; + const title = vendor.querySelector("a").textContent.trim(); + const vendorurl = vendor.querySelector("img").src; + res.images.push({ + index: i, + vendor: title, + url: vendorurl + }); + } + const shortcodes = document.querySelector('ul[class="shortcodes"]').querySelectorAll('span[class="shortcode"]'); + for (let i = 0; i < shortcodes.length; i++) { + let r = shortcodes[i]; + res.shortCodes.push(r.textContent.trim()); + } + return res; + } + static emojiUnicode(emoji) { + if (emoji.length === 1) + return emoji.charCodeAt(0).toString(16); + let comp = ((emoji.charCodeAt(0) - 0xD800) * 0x400 + (emoji.charCodeAt(1) - 0xDC00) + 0x10000); + if (comp < 0) + return emoji.charCodeAt(0).toString(16); + return comp.toString(16); + } +} +exports.Parser = Parser; diff --git a/node_modules/emoji-api/build/index.d.ts b/node_modules/emoji-api/build/index.d.ts new file mode 100644 index 000000000..bc3c7bd85 --- /dev/null +++ b/node_modules/emoji-api/build/index.d.ts @@ -0,0 +1,10 @@ +import { Parser, EmojiRawData, EmojiImage } from "./Parser"; +import { Emoji } from "./Emoji"; +declare class EmojiAPI { + get(emoji: string): Promise; + getBasicInfo(emoji: string): Promise; + EmojiToUnicode(emoji: string): string; + UnicodeToEmoji(unicode: string): string; +} +export { EmojiAPI, Parser, EmojiRawData, EmojiImage, Emoji }; +export default EmojiAPI; diff --git a/node_modules/emoji-api/build/index.js b/node_modules/emoji-api/build/index.js new file mode 100644 index 000000000..aba1c20a1 --- /dev/null +++ b/node_modules/emoji-api/build/index.js @@ -0,0 +1,33 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Emoji = exports.Parser = exports.EmojiAPI = void 0; +const Parser_1 = require("./Parser"); +Object.defineProperty(exports, "Parser", { enumerable: true, get: function () { return Parser_1.Parser; } }); +const Emoji_1 = require("./Emoji"); +Object.defineProperty(exports, "Emoji", { enumerable: true, get: function () { return Emoji_1.Emoji; } }); +class EmojiAPI { + async get(emoji) { + const basicInfo = await this.getBasicInfo(emoji); + return new Emoji_1.Emoji(basicInfo || {}); + } + async getBasicInfo(emoji) { + try { + const raw = await Parser_1.Parser.getHTML(emoji); + if (!raw) + return null; + const basicInfo = Parser_1.Parser.fetchData(raw); + return basicInfo; + } + catch { + return null; + } + } + EmojiToUnicode(emoji) { + return Parser_1.Parser.emojiUnicode(emoji); + } + UnicodeToEmoji(unicode) { + return String.fromCodePoint(parseInt(unicode, 16)); + } +} +exports.EmojiAPI = EmojiAPI; +exports.default = EmojiAPI; diff --git a/node_modules/emoji-api/package.json b/node_modules/emoji-api/package.json new file mode 100644 index 000000000..5dddaf5aa --- /dev/null +++ b/node_modules/emoji-api/package.json @@ -0,0 +1,35 @@ +{ + "name": "emoji-api", + "version": "1.0.2", + "description": "Simple Emoji API", + "main": "build/index.js", + "types": "build/index.d.ts", + "scripts": { + "build": "tsc", + "test": "cd test && node index.js" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/DevSnowflake/emoji-api.git" + }, + "keywords": [ + "emoji", + "emoji-api", + "parser", + "emoji-parser" + ], + "author": "Snowflake107", + "license": "GPL-3.0", + "bugs": { + "url": "https://github.com/DevSnowflake/emoji-api/issues" + }, + "homepage": "https://github.com/DevSnowflake/emoji-api#readme", + "dependencies": { + "jsdom": "^16.4.0", + "node-fetch": "^2.6.1" + }, + "devDependencies": { + "@types/jsdom": "^16.2.5", + "@types/node-fetch": "^2.5.7" + } +} diff --git a/node_modules/emoji-api/src/Emoji.ts b/node_modules/emoji-api/src/Emoji.ts new file mode 100644 index 000000000..edf785c32 --- /dev/null +++ b/node_modules/emoji-api/src/Emoji.ts @@ -0,0 +1,118 @@ +import { EmojiImage } from "./Parser"; + +class Emoji { + emoji?: string; + unicode?: string; + name?: string; + description?: string; + images: EmojiImage[]; + shortCodes: string[]; + + constructor(data: any) { + if (!data) throw new Error(`Cannot instantiate ${this.constructor.name} class without data!`); + this._patch(data); + } + + _patch(data: any) { + this.emoji = data.emoji || null; + this.unicode = data.unicode ? `U+${String(data.unicode).toUpperCase()}` : null; + this.name = data.name || null; + this.description = data.description || null; + this.images = data.images || []; + this.shortCodes = data.shortCodes || []; + } + + get encodeURI() { + return encodeURIComponent(this.emoji || ""); + } + + get Apple(): EmojiImage { + return this.images.find(i => i.vendor.toLowerCase().includes("apple")); + } + + get Google(): EmojiImage { + return this.images.find(i => i.vendor.toLowerCase().includes("google")); + } + + get Samsung(): EmojiImage { + return this.images.find(i => i.vendor.toLowerCase().includes("samsung")); + } + + get Microsoft(): EmojiImage { + return this.images.find(i => i.vendor.toLowerCase().includes("microsoft")); + } + + get WhatsApp(): EmojiImage { + return this.images.find(i => i.vendor.toLowerCase().includes("whatsapp")); + } + + get Twitter(): EmojiImage { + return this.images.find(i => i.vendor.toLowerCase().includes("twitter")); + } + + get Facebook(): EmojiImage { + return this.images.find(i => i.vendor.toLowerCase().includes("facebook")); + } + + get JoyPixels(): EmojiImage { + return this.images.find(i => i.vendor.toLowerCase().includes("joypixels")); + } + + get OpenMoji(): EmojiImage { + return this.images.find(i => i.vendor.toLowerCase().includes("openmoji")); + } + + get Emojidex(): EmojiImage { + return this.images.find(i => i.vendor.toLowerCase().includes("emojidex")); + } + + get Messenger(): EmojiImage { + return this.images.find(i => i.vendor.toLowerCase().includes("messenger")); + } + + get LG(): EmojiImage { + return this.images.find(i => i.vendor.toLowerCase().includes("lg")); + } + + get HTC(): EmojiImage { + return this.images.find(i => i.vendor.toLowerCase().includes("htc")); + } + + get Mozilla(): EmojiImage { + return this.images.find(i => i.vendor.toLowerCase().includes("mozilla")); + } + + get SoftBank(): EmojiImage { + return this.images.find(i => i.vendor.toLowerCase().includes("softbank")); + } + + get Docomo(): EmojiImage { + return this.images.find(i => i.vendor.toLowerCase().includes("docomo")); + } + + get auByKDDI(): EmojiImage { + return this.images.find(i => i.vendor.toLowerCase().includes("kddi")); + } + + toArray(): EmojiImage[] { + return this.images; + } + + toString() { + return this.name || ""; + } + + toJSON() { + return { + emoji: this.emoji, + name: this.name, + unicode: this.unicode, + description: this.description, + images: this.images, + shortCodes: this.shortCodes + }; + + } +} + +export { Emoji } \ No newline at end of file diff --git a/node_modules/emoji-api/src/Parser.ts b/node_modules/emoji-api/src/Parser.ts new file mode 100644 index 000000000..763d7b0db --- /dev/null +++ b/node_modules/emoji-api/src/Parser.ts @@ -0,0 +1,81 @@ +import fetch from "node-fetch"; +import { JSDOM } from "jsdom"; + +const BASE_URL = "https://emojipedia.org"; + +export interface EmojiRawData { + emoji: string; + unicode: string; + name: string; + description: string; + images: EmojiImage[]; + shortCodes: string[]; +} + +export interface EmojiImage { + index: number; + vendor: string; + url: string; +} + +export class Parser { + + static async getHTML(emoji: string): Promise { + try { + const data = await fetch(`${BASE_URL}/${encodeURIComponent(emoji)}`); + const res = await data.text(); + + return res; + } catch { + return null; + } + } + + static fetchData(html: string) { + const { document } = new JSDOM(html).window; + + const res: EmojiRawData = { + emoji: document.title.split(" ")[0], + unicode: Parser.emojiUnicode(document.title.split(" ")[0]), + name: html.split(`

${document.title.split(" ")[0]}`)[1].split("

")[0].trim(), + description: document.querySelector('section[class="description"]').querySelector("p").textContent.trim(), + images: [], + shortCodes: [] + }; + + const vendors = document.getElementsByClassName("vendor-rollout-target"); + + for (let i = 0; i < vendors.length; i++) { + const vendor = vendors[i]; + + const title = vendor.querySelector("a").textContent.trim(); + const vendorurl = vendor.querySelector("img").src; + + res.images.push({ + index: i, + vendor: title, + url: vendorurl + }); + } + + const shortcodes = document.querySelector('ul[class="shortcodes"]').querySelectorAll('span[class="shortcode"]'); + + for (let i = 0; i < shortcodes.length; i++) { + let r = shortcodes[i]; + res.shortCodes.push(r.textContent.trim()); + } + + return res + } + + static emojiUnicode(emoji: string): string { + if (emoji.length === 1) return emoji.charCodeAt(0).toString(16); + + let comp = ((emoji.charCodeAt(0) - 0xD800) * 0x400 + (emoji.charCodeAt(1) - 0xDC00) + 0x10000); + + if (comp < 0) return emoji.charCodeAt(0).toString(16); + + return comp.toString(16); + } + +} \ No newline at end of file diff --git a/node_modules/emoji-api/src/index.ts b/node_modules/emoji-api/src/index.ts new file mode 100644 index 000000000..163215cd8 --- /dev/null +++ b/node_modules/emoji-api/src/index.ts @@ -0,0 +1,35 @@ +import { Parser, EmojiRawData, EmojiImage } from "./Parser" +import { Emoji } from "./Emoji"; + +class EmojiAPI { + + async get(emoji: string): Promise { + const basicInfo = await this.getBasicInfo(emoji); + + return new Emoji(basicInfo || {}); + } + + async getBasicInfo(emoji: string): Promise { + try { + const raw = await Parser.getHTML(emoji); + if (!raw) return null; + const basicInfo = Parser.fetchData(raw); + + return basicInfo; + } catch { + return null; + } + } + + EmojiToUnicode(emoji: string) { + return Parser.emojiUnicode(emoji); + } + + UnicodeToEmoji(unicode: string) { + return String.fromCodePoint(parseInt(unicode, 16)); + } + +} + +export { EmojiAPI, Parser, EmojiRawData, EmojiImage, Emoji } +export default EmojiAPI; \ No newline at end of file diff --git a/node_modules/emoji-api/tsconfig.json b/node_modules/emoji-api/tsconfig.json new file mode 100644 index 000000000..e1d3aa613 --- /dev/null +++ b/node_modules/emoji-api/tsconfig.json @@ -0,0 +1,16 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "ES2020", + "declaration": true, + "strict": true, + "strictNullChecks": false, + "esModuleInterop": true, + "outDir": "./build/" + }, + "files": [ + "src/Parser.ts", + "src/Emoji.ts", + "src/index.ts" + ] +} \ No newline at end of file diff --git a/node_modules/futoin-hkdf/LICENSE b/node_modules/futoin-hkdf/LICENSE new file mode 100644 index 000000000..d64569567 --- /dev/null +++ b/node_modules/futoin-hkdf/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/node_modules/futoin-hkdf/README.md b/node_modules/futoin-hkdf/README.md new file mode 100644 index 000000000..d612cd49d --- /dev/null +++ b/node_modules/futoin-hkdf/README.md @@ -0,0 +1,253 @@ + + [![NPM Version](https://img.shields.io/npm/v/futoin-hkdf.svg?style=flat)](https://www.npmjs.com/package/futoin-hkdf) + [![NPM Downloads](https://img.shields.io/npm/dm/futoin-hkdf.svg?style=flat)](https://www.npmjs.com/package/futoin-hkdf) + [![stable](https://img.shields.io/badge/stability-stable-green.svg?style=flat)](https://www.npmjs.com/package/futoin-hkdf) + + [![NPM](https://nodei.co/npm/futoin-hkdf.png?downloads=true&downloadRank=true&stars=true)](https://nodei.co/npm/futoin-hkdf/) + + +# About + +Node.js implementation of [RFC5869: HMAC-based Extract-and-Expand Key Derivation Function (HKDF)](https://tools.ietf.org/html/rfc5869). + +Additionally, it supports a `HKDF-Expand-Label` variation based on [RFC8446: The Transport Layer Security (TLS) Protocol Version 1.3, section 7.1. Key Schedule](https://datatracker.ietf.org/doc/html/rfc8446#section-7.1). + +The implementation is fully compliant with test vectors provided in the RFC. + +There are alternative modules, but they are: +* much less performing and/or +* have quite poor code quality at the moment and/or +* are not compliant with RFC (e.g. work only with string parameters) and/or +* not working with current Node.js versions and/or +* do not support arbitrary hash functions and/or +* not reliable dependency for FutoIn™ Security concept in general. + +Standalone HKDF `extract()` and `expand()` actions are also available for advanced usage. + +**Documentation** --> [FutoIn™ Guide](https://futoin.org/docs/miscjs/hkdf/) + +Author: [Andrey Galkin](mailto:andrey@futoin.org) + +# Performance comparison + +The figures in "derived keys per second". + +* **futoin-hkdf** - **74 642** + - fully compliant +* `node-hdkf`/`hdkf` modules - *57 707* (~22% slower) + - seems to be broken by design + - **produces wrong results with RFC test vectors** +* `ctrlpanel-hdkf` - *52 181* (~30% slower) + - seems to be compliant +* `@stablelib/hkdf` - *39 808* (~46% slower) + - seems to be compliant + +# Installation for Node.js + +Command line: +```sh +$ npm install futoin-hkdf --save +``` +or: + +```sh +$ yarn add futoin-hkdf --save +``` + +# Examples + +```javascript +const hkdf = require('futoin-hkdf'); + +// Parameter overview +//------------------- +// initial keying material +const ikm = 'string-or-buffer'; +// required output length in bytes +const length = 16; +// can be empty string or false equivalent +const salt = 'strongly-encouraged'; +// optional parameter +const info = 'optional-context'; +// HMAC hashing algorithm to use +const hash = 'SHA-256'; + +// Generic derivation +//------------------- +hkdf(ikm, length, {salt, info, hash}); // Buffer(length) - derived key +hkdf(ikm, length, {salt, info, hash}).toString('hex'); // String(2*length) + +// NOTE: all optional paramaters are passed in object + +// With some parameters omitted +//------------------- +hkdf(ikm, length, {salt}); +hkdf(ikm, length, {info}); +hkdf(ikm, length, {hash}); +hkdf(ikm, length); + +// Advanced usage (only if you know what you are doing) +//------------------- + +// As in underlying Node.js crypto library +const lhash = hash.toLowerCase().replace( '-', '' ); // 'sha256' + +hkdf.hash_length(lhash); // get hash_len +hkdf.extract(lhash, hash_len, ikm, salt); // run only step #1 +hkdf.expand(lhash, hash_len, prk, length, info); // run only step #2 + +// TLS v1.3+ +//------------------- +const hkdf_tls = require('futoin-hkdf/tls'); + +const label = 'tls13 ...'; +const context = Buffer.from( /* E.g some binary hash generation */ '' ); + +hkdf_tls(ikm, length, {salt, label, context, hash}); // Buffer(length) - derived key + +// Advanced usage +hkdf_tls.expand_label(lhash, hash_len, prk, length, label, context); + +// Same as: +hkdf.expand(lhash, hash_len, prk, length, hkdf_tls.info(length, label, context)); + +``` + +# API documentation + +## Functions + +
+
hkdf(ikm, length, salt, info, hash)Buffer
+

HMAC-based Extract-and-Expand Key Derivation Function (HKDF)

+
+
tls(ikm, length, salt, label, info, hash)Buffer
+

TLS v1.3 HKDF-extract + HKFD-Expand-Label action

+
+
+ + + +## hkdf(ikm, length, salt, info, hash) ⇒ Buffer +HMAC-based Extract-and-Expand Key Derivation Function (HKDF) + +**Kind**: global function +**Returns**: Buffer - Raw buffer with derived key of @p length bytes + +| Param | Type | Default | Description | +| --- | --- | --- | --- | +| ikm | Buffer \| string | | Initial Keying Material | +| length | integer | | Required byte length of output | +| salt | Buffer \| string | '' | Optional salt (recommended) | +| info | Buffer \| string | '' | Optional context (safe to skip) | +| hash | string | "'SHA-256'" | HMAC hash function to use | + + +* [hkdf(ikm, length, salt, info, hash)](#hkdf) ⇒ Buffer + * [.hash_length(hash)](#hkdf.hash_length) ⇒ integer + * [.extract(hash, hash_len, ikm, salt)](#hkdf.extract) ⇒ Buffer + * [.expand(hash, hash_len, prk, length, info)](#hkdf.expand) ⇒ Buffer + + + +### hkdf.hash\_length(hash) ⇒ integer +Get expected hash length. + +**Kind**: static method of [hkdf](#hkdf) +**Returns**: integer - hash digest byte length +**Note**: Values are hardcoded with fallback for unknown algorithms. + +| Param | Type | Description | +| --- | --- | --- | +| hash | string | Hash algorithm (as in underlying Node.js crypto library) | + + + +### hkdf.extract(hash, hash_len, ikm, salt) ⇒ Buffer +HKDF extract action. + +**Kind**: static method of [hkdf](#hkdf) +**Returns**: Buffer - A buffer with pseudorandom key +**Note**: Values are hardcoded with fallback for unknown algorithms. + +| Param | Type | Description | +| --- | --- | --- | +| hash | string | Hash algorithm (as in underlying Node.js crypto library) | +| hash_len | integer | Hash digest length | +| ikm | Buffer \| string | Initial Keying Material | +| salt | Buffer \| string | Optional salt (recommended) | + + + +### hkdf.expand(hash, hash_len, prk, length, info) ⇒ Buffer +HKDF expand action. + +**Kind**: static method of [hkdf](#hkdf) +**Returns**: Buffer - A buffer with output keying material +**Note**: Values are hardcoded with fallback for unknown algorithms. + +| Param | Type | Description | +| --- | --- | --- | +| hash | string | Hash algorithm (as in underlying Node.js crypto library) | +| hash_len | integer | Hash digest length | +| prk | Buffer \| string | A buffer with pseudorandom key | +| length | integer | length of output keying material in octets | +| info | Buffer \| string | Optional context (safe to skip) | + + + +## tls(ikm, length, salt, label, info, hash) ⇒ Buffer +TLS v1.3 HKDF-extract + HKFD-Expand-Label action + +**Kind**: global function +**Returns**: Buffer - Raw buffer with derived key of @p length bytes +**Note**: label and context are limited to 255 bytes! + +| Param | Type | Default | Description | +| --- | --- | --- | --- | +| ikm | Buffer \| string | | Initial Keying Material | +| length | integer | | Required byte length of output | +| salt | Buffer \| string | '' | Optional salt (required by fact) | +| label | Buffer \| string | '' | Optional label (required by fact) | +| info | Buffer \| string | '' | Optional context (safe to skip) | +| hash | string | "'SHA-256'" | HMAC hash function to use | + + +* [tls(ikm, length, salt, label, info, hash)](#tls) ⇒ Buffer + * [.info(length, label, context)](#tls.info) ⇒ Buffer + * [.expand_label(hash, hash_len, prk, length, label, context)](#tls.expand_label) ⇒ Buffer + + + +### tls.info(length, label, context) ⇒ Buffer +Encode HKDF context parameter in TLS v1.3 style based on RFC8446 TLS v1.3. + +**Kind**: static method of [tls](#tls) +**Returns**: Buffer - A buffer with encoded HKDF context +**Note**: label and context are limited to 255 bytes! + +| Param | Type | Description | +| --- | --- | --- | +| length | integer | length of output keying material in octets | +| label | string | ASCII label | +| context | Buffer \| string | Binary context or empty string | + + + +### tls.expand\_label(hash, hash_len, prk, length, label, context) ⇒ Buffer +TLS-HKDF expand label action - a HKDF-Expand-Label variation based on RFC8446 TLS v1.3. + +**Kind**: static method of [tls](#tls) +**Returns**: Buffer - A buffer with output keying material +**Note**: label and context are limited to 255 bytes! + +| Param | Type | Description | +| --- | --- | --- | +| hash | string | Hash algorithm (as in underlying Node.js crypto library) | +| hash_len | integer | Hash digest length | +| prk | Buffer \| string | A buffer with pseudorandom key | +| length | integer | length of output keying material in octets | +| label | string | ASCII label | +| context | Buffer \| string | Binary context or empty string | + + diff --git a/node_modules/futoin-hkdf/futoin.json b/node_modules/futoin-hkdf/futoin.json new file mode 100644 index 000000000..cc601fb79 --- /dev/null +++ b/node_modules/futoin-hkdf/futoin.json @@ -0,0 +1,21 @@ +{ + "name": "futoin-hkdf", + "version": "1.5.1", + "vcs": "git", + "rms": "npm", + "rmsRepo": "ignored", + "plugins": { + "release": "futoin.cid.misc.releasetool" + }, + "actions": { + "test": [ + "@cid tool envexec node -- sh -c \"test $NODE_ENV != production\"", + "@cte grunt test", + "@cte node node_modules/.bin/tsd" + ], + "upgrade-deps": [ + "@cid tool update", + "@cte yarn upgrade --latest" + ] + } +} diff --git a/node_modules/futoin-hkdf/hkdf.d.ts b/node_modules/futoin-hkdf/hkdf.d.ts new file mode 100644 index 000000000..945475337 --- /dev/null +++ b/node_modules/futoin-hkdf/hkdf.d.ts @@ -0,0 +1,29 @@ +declare function hkdf( + ikm: Buffer | string, + length: number, + option?: hkdf.Options +): Buffer; + +declare namespace hkdf { + interface Options { + salt?: Buffer | string; + info?: Buffer | string; + hash?: string; + } + export function hash_length(hash: string): number; + export function extract( + hash: string, + hash_len: number, + ikm: Buffer | string, + salt: Buffer | string + ): Buffer; + export function expand( + hash: string, + hash_len: number, + prk: Buffer | string, + length: number, + info: Buffer | string + ): Buffer; +} + +export = hkdf; diff --git a/node_modules/futoin-hkdf/hkdf.js b/node_modules/futoin-hkdf/hkdf.js new file mode 100644 index 000000000..45cd7dc39 --- /dev/null +++ b/node_modules/futoin-hkdf/hkdf.js @@ -0,0 +1,175 @@ +'use strict'; + +/** + * @file + * + * Copyright 2018 FutoIn Project (https://futoin.org) + * Copyright 2018 Andrey Galkin + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +const { Buffer } = require( 'buffer' ); +const { createHash, createHmac } = require( 'crypto' ); + +const g_digestLenCache = {}; + +/** + * Get expected hash length. + * + * @func + * @alias hkdf.hash_length + * @param {string} hash - Hash algorithm (as in underlying Node.js crypto library) + * @returns {integer} hash digest byte length + * + * @note Values are hardcoded with fallback for unknown algorithms. + */ +const hash_length = ( hash ) => { + switch ( hash ) { + case 'sha256': return 32; + case 'sha512': return 64; + case 'sha224': return 28; + case 'sha384': return 48; + case 'sha3-256': return 32; + case 'sha3-512': return 64; + case 'sha3-224': return 28; + case 'sha3-384': return 48; + case 'blake2s256': return 32; + case 'blake2b512': return 64; + case 'sha1': return 20; + case 'md5': return 16; + default: { + let len = g_digestLenCache[hash]; + + if ( len === undefined ) { + len = createHash( hash ).digest().length; + g_digestLenCache[hash] = len; + } + + return len; + } + } +}; + +/** + * HKDF extract action. + * + * @func + * @alias hkdf.extract + * @param {string} hash - Hash algorithm (as in underlying Node.js crypto library) + * @param {integer} hash_len - Hash digest length + * @param {Buffer|string} ikm - Initial Keying Material + * @param {Buffer|string} salt - Optional salt (recommended) + * @returns {Buffer} A buffer with pseudorandom key + * + * @note Values are hardcoded with fallback for unknown algorithms. + */ +const hkdf_extract = ( hash, hash_len, ikm, salt ) => { + const b_ikm = Buffer.isBuffer( ikm ) ? ikm : Buffer.from( ikm ); + const b_salt = ( salt && salt.length ) ? Buffer.from( salt ) : Buffer.alloc( hash_len, 0 ); + + return createHmac( hash, b_salt ).update( b_ikm ).digest(); +}; + +/** + * HKDF expand action. + * + * @func + * @alias hkdf.expand + * @param {string} hash - Hash algorithm (as in underlying Node.js crypto library) + * @param {integer} hash_len - Hash digest length + * @param {Buffer|string} prk - A buffer with pseudorandom key + * @param {integer} length - length of output keying material in octets + * @param {Buffer|string} info - Optional context (safe to skip) + * @returns {Buffer} A buffer with output keying material + * + * @note Values are hardcoded with fallback for unknown algorithms. + */ +const hkdf_expand = ( hash, hash_len, prk, length, info ) => { + const b_info = Buffer.isBuffer( info ) ? info : Buffer.from( info || '' ); + const info_len = b_info.length; + + const steps = Math.ceil( length / hash_len ); + + if ( steps > 0xFF ) { + throw new Error( `OKM length ${length} is too long for ${hash} hash` ); + } + + // use single buffer with unnecessary create/copy/move operations + const t = Buffer.alloc( hash_len * steps + info_len + 1 ); + + for ( let c = 1, start = 0, end = 0; c <= steps; ++c ) { + // add info + b_info.copy( t, end ); + // add counter + t[ end + info_len ] = c; + + createHmac( hash, prk ) + // use view: T(C) = T(C-1) | info | C + .update( t.slice( start, end + info_len + 1 ) ) + .digest() + // put back to the same buffer + .copy( t, end ); + + start = end; // used for T(C-1) start + end += hash_len; // used for T(C-1) end & overall end + } + + return t.slice( 0, length ); +}; + +/** + * HMAC-based Extract-and-Expand Key Derivation Function (HKDF) + * + * @param {Buffer|string} ikm - Initial Keying Material + * @param {integer} length - Required byte length of output + * @param {Buffer|string} salt='' - Optional salt (recommended) + * @param {Buffer|string} info='' - Optional context (safe to skip) + * @param {string} hash='SHA-256' - HMAC hash function to use + * @returns {Buffer} Raw buffer with derived key of @p length bytes + */ +function hkdf( ikm, length, { salt='', info='', hash='SHA-256' } = {} ) { + hash = hash.toLowerCase().replace( '-', '' ); + + // 0. Hash length + const hash_len = hash_length( hash ); + + // 1. extract + const prk = hkdf_extract( hash, hash_len, ikm, salt ); + + // 2. expand + return hkdf_expand( hash, hash_len, prk, length, info ); +} + +Object.defineProperties( hkdf, { + hash_length : { + configurable: false, + enumerable: false, + writable: false, + value: hash_length, + }, + extract : { + configurable: false, + enumerable: false, + writable: false, + value: hkdf_extract, + }, + expand : { + configurable: false, + enumerable: false, + writable: false, + value: hkdf_expand, + }, +} ); + +module.exports = hkdf; diff --git a/node_modules/futoin-hkdf/package.json b/node_modules/futoin-hkdf/package.json new file mode 100644 index 000000000..8f120842e --- /dev/null +++ b/node_modules/futoin-hkdf/package.json @@ -0,0 +1,52 @@ +{ + "name": "futoin-hkdf", + "version": "1.5.1", + "description": "RFC5869: HMAC-based Extract-and-Expand Key Derivation Function (HKDF)", + "main": "hkdf.js", + "types": "hkdf.d.ts", + "files": [ + "hkdf.js", + "hkdf.d.ts", + "futoin.json", + "tls.js", + "tls.d.ts" + ], + "engines": { + "node": ">=8" + }, + "scripts": { + "test": "grunt test && tsd" + }, + "repository": { + "type": "git", + "url": "https://github.com/futoin/util-js-hkdf.git" + }, + "keywords": [ + "futoin", + "crypto", + "hkdf", + "kdf" + ], + "author": { + "name": "Andrey Galkin", + "email": "andrey@futoin.org" + }, + "license": "Apache-2.0", + "bugs": { + "url": "https://github.com/futoin/util-js-hkdf/issues", + "email": "support@futoin.org" + }, + "devDependencies": { + "@types/node": "^17.0.35", + "benchmark": "^2.1.4", + "chai": "^4.3.6", + "eslint": "^8.16.0", + "grunt": "^1.5.3", + "grunt-eslint": "^24.0.0", + "grunt-jsdoc-to-markdown": "^6.0.0", + "grunt-simple-nyc": "^3.0.1", + "grunt-text-replace": "^0.4.0", + "mocha": "^10.0.0", + "tsd": "^0.20.0" + } +} diff --git a/node_modules/futoin-hkdf/tls.d.ts b/node_modules/futoin-hkdf/tls.d.ts new file mode 100644 index 000000000..b16569985 --- /dev/null +++ b/node_modules/futoin-hkdf/tls.d.ts @@ -0,0 +1,29 @@ +declare function tls( + ikm: Buffer | string, + length: number, + option?: tls.Options +): Buffer; + +declare namespace tls { + interface Options { + salt?: Buffer | string; + label?: string; + context?: Buffer | string; + hash?: string; + } + export function info( + length: number, + label: string, + context?: Buffer | string, + ): Buffer; + export function expand_label( + hash: string, + hash_len: number, + prk: Buffer | string, + length: number, + label: string, + context?: Buffer | string, + ): Buffer; +} + +export = tls; diff --git a/node_modules/futoin-hkdf/tls.js b/node_modules/futoin-hkdf/tls.js new file mode 100644 index 000000000..01b6c4b0a --- /dev/null +++ b/node_modules/futoin-hkdf/tls.js @@ -0,0 +1,113 @@ +'use strict'; + +/** + * @file + * + * Copyright 2018 FutoIn Project (https://futoin.org) + * Copyright 2018 Andrey Galkin + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +const { Buffer } = require( 'buffer' ); +const hkdf = require( './hkdf' ); + +/** + * Encode HKDF context parameter in TLS v1.3 style based on RFC8446 TLS v1.3. + * + * @func + * @alias tls.info + * @param {integer} length - length of output keying material in octets + * @param {string} label - ASCII label + * @param {Buffer|string} context - Binary context or empty string + * @returns {Buffer} A buffer with encoded HKDF context + * + * @note label and context are limited to 255 bytes! + */ +const tls_info = ( length, label, context ) => { + const b_context = Buffer.isBuffer( context ) ? context : Buffer.from( context, 'hex' ); + + const label_length = label.length; + const context_length = b_context.length; + + const b_info = Buffer.allocUnsafe( 4 + label_length + context_length ); + b_info.writeUInt16BE( length, 0 ); + b_info.writeUInt8( label_length, 2 ); + b_info.write( label, 3, label_length, 'ascii' ); + b_info.writeUInt8( context_length, 3 + label_length ); + b_context.copy( b_info, 4 + label_length, 0, context_length ); + + return b_info; +}; + +/** + * TLS-HKDF expand label action - a HKDF-Expand-Label variation based on RFC8446 TLS v1.3. + * + * @func + * @alias tls.expand_label + * @param {string} hash - Hash algorithm (as in underlying Node.js crypto library) + * @param {integer} hash_len - Hash digest length + * @param {Buffer|string} prk - A buffer with pseudorandom key + * @param {integer} length - length of output keying material in octets + * @param {string} label - ASCII label + * @param {Buffer|string} context - Binary context or empty string + * @returns {Buffer} A buffer with output keying material + * + * @note label and context are limited to 255 bytes! + */ +const tls_expand_label = ( hash, hash_len, prk, length, label, context ) => { + return hkdf.expand( hash, hash_len, prk, length, tls_info( length, label, context ) ); +}; + +/** + * TLS v1.3 HKDF-extract + HKFD-Expand-Label action + * + * @param {Buffer|string} ikm - Initial Keying Material + * @param {integer} length - Required byte length of output + * @param {Buffer|string} salt='' - Optional salt (required by fact) + * @param {Buffer|string} label='' - Optional label (required by fact) + * @param {Buffer|string} info='' - Optional context (safe to skip) + * @param {string} hash='SHA-256' - HMAC hash function to use + * @returns {Buffer} Raw buffer with derived key of @p length bytes + * + * @note label and context are limited to 255 bytes! + */ +function tls( ikm, length, { salt='', label='', context='', hash='SHA-256' } = {} ) { + hash = hash.toLowerCase().replace( '-', '' ); + + // 0. Hash length + const hash_len = hkdf.hash_length( hash ); + + // 1. extract + const prk = hkdf.extract( hash, hash_len, ikm, salt ); + + // 2. expand + return tls_expand_label( hash, hash_len, prk, length, label, context ); +} + +Object.defineProperties( tls, { + info : { + configurable: false, + enumerable: false, + writable: false, + value: tls_info, + }, + expand_label : { + configurable: false, + enumerable: false, + writable: false, + value: tls_expand_label, + }, +} ); + +module.exports = tls; diff --git a/node_modules/hxz-api/README.md b/node_modules/hxz-api/README.md new file mode 100644 index 000000000..0746f8138 --- /dev/null +++ b/node_modules/hxz-api/README.md @@ -0,0 +1,347 @@ +
+Hexa + +## HEXA-API + +
+ +

+ +

+

+ +

+

+ +

+ +## ```INSTALL And UNINSTALL``` +> npm install hxz-api +> +> npm uninstall hxz-api + + +## ```Otakudesu``` +``` +const hx = require('hxz-api'); +const judul = 'kaifuku' + +hx.otakudesu(judul) + .then(result => { + console.log(result) +}); +``` +## ```Covid``` +``` +const hx = require('hxz-api'); + +hx.covid() + .then(result => { + console.log(result) +}); +``` + +## ```Ongoing``` +``` +const hx = require('hxz-api'); + +hx.ongoing() + .then(result => { + console.log(result) +}); +``` + +## ```Komiku``` +``` +const hx = require('hxz-api'); +const judul = 'kanojo mo kanojo' + +hx.komiku(judul) + .then(result => { + console.log(result) +}); +``` + +## ```Tebak Gambar``` +``` +const hx = require('hxz-api'); + +hx.tebakgambar() + .then(result => { + console.log(result) +}); +``` + +## ```Surah``` +``` +const hx = require('hxz-api'); +const no = '1' + +hx.surah(no) + .then(result => { + console.log(result) +}); +``` + +## ```Sholat``` +``` +const hx = require('hxz-api'); +const no = '1' + +hx.sholat(no) + .then(result => { + console.log(result) +}); +``` + +## ```Lirik``` +``` +const hx = require('hxz-api'); +const judul = 'black catcher' + +hx.lirik(judul) + .then(result => { + console.log(result) +}); +``` + +## ```Chara``` +``` +const hx = require('hxz-api'); +const name = 'nino' + +hx.chara(name) + .then(result => { + console.log(result) +}); +``` + +## ```Wattpad``` +``` +const hx = require('hxz-api'); +const judul = 'love' + +hx.wattpad(judul) + .then(result => { + console.log(result) +}); +``` + +## ```Play Store``` +``` +const hx = require('hxz-api'); +const judul = 'game 8 bit' + +hx.playstore(judul) + .then(result => { + console.log(result) +}); +``` + +## ```Link Wa``` +``` +const hx = require('hxz-api'); +const judul = 'Editod bekentod' + +hx.linkwa(judul) + .then(result => { + console.log(result) +}); +``` + +## ```Pinterest``` +``` +const hx = require('hxz-api'); +const judul = 'nakano nino' + +hx.pinterest(judul) + .then(result => { + console.log(result) +}); +``` + +## ```IG Downloader``` +``` +const hx = require('hxz-api'); +const link = 'https://www.instagram.com/p/CQpUpGvAhWq/?utm_source=ig_web_copy_link' + +hx.igdl(link) + .then(result => { + console.log(result) +}); +``` + + +## ```IG Story``` +``` +const hx = require('hxz-api'); +const username = 'yabegitulahaha' + +hx.igstory(username) + .then(result => { + console.log(result) +}); +``` +## ```IG Stalk``` +``` +const hx = require('hxz-api'); +const username = 'yabegitulahaha' + +hx.igstalk(username) + .then(result => { + console.log(result) +}); +``` + +## ```Twitter Downloader``` +``` +const hx = require('hxz-api'); +const link = 'https://twitter.com/PassengersMovie/status/821025484150423557' + +hx.twitter(link) + .then(result => { + console.log(result) +}); +``` + +## ```Facebook Downloader``` +``` +const hx = require('hxz-api'); +const link = 'https://fb.watch/6vQOvEENLW/' + +hx.fbdown(link) + .then(result => { + console.log(result) +}); +``` + +## ```Youtube Downloader``` +``` +const hx = require('hxz-api'); +const link = 'https://youtu.be/5C8yvJUVB-0' + +hx.youtube(link) + .then(result => { + console.log(result) +}); +``` + +## ```Tiktok Downloader``` +``` +const hx = require('hxz-api'); +const link = 'https://www.tiktok.com/@daniajaa7/video/6980287183517125890?sender_device=pc&sender_web_id=6978811994732938753&is_from_webapp=v1&is_copy_url=0' + +hx.ttdownloader(link) + .then(result => { + console.log(result) +}); +``` +# ```LIST JADWAL SHOLAT``` +``` +Jakarta = 1 +Ambon = 39 +Balikpapan = 42 +Banda Aceh = 17 +Bandar Lampung = 22 +Bandung = 7 +Banjar = 44 +Banjarbaru = 46 +Banjarmasin = 32 +Banyuwangi = 48 +Batam = 8 +Batu = 50 +Bau-bau = 52 +Bekasi = 54 +Bengkulu = 21 +Bima = 56 +Binjai = 58 +Bitung = 60 +Blitar = 62 +Bogor = 64 +Bontang = 66 +Bukittinggi = 68 +Cilegon = 70 +Cimahi = 72 +Cirebon = 74 +Denpasar = 6 +Depok = 76 +Dumai = 78 +Gorontalo = 38 +Gunungsitoli = 80 +Jambi = 19 +Jayapura = 9 +Jember = 82 +Kediri = 84 +Kendari = 36 +Kotamobagu = 86 +Kupang = 28 +Langsa = 88 +Lhokseumawe = 90 +Lubuklinggau = 92 +Madiun = 94 +Magelang = 98 +Makassar = 13 +Malang = 96 +Mamuju = 37 +Manado = 15 +Manokwari = 41 +Mataram = 29 +Medan = 14 +Mojokerto = 100 +Padang = 16 +Padangpanjang = 102 +Padangsidempuan = 104 +Pagar Alam = 106 +Palangkaraya = 31 +Palembang = 20 +Palopo = 108 +Palu = 35 +Pangkal Pinang = 23 +Pangkalpinang = 110 +Parepare = 112 +Pariaman = 114 +Pasuruan = 116 +Payakumbuh = 118 +Pekalongan = 120 +Pekanbaru = 18 +Pematangsiantar = 122 +Pontianak = 30 +Prabumulih = 124 +Probolinggo = 126 +Sabang = 128 +Salatiga = 130 +Samarinda = 33 +Sawahlunto = 132 +Semarang = 26 +Serang = 27 +Sibolga = 134 +Singkawang = 136 +Sofifi = 138 +Solo = 40 +Solok = 140 +Sorong = 142 +Subulussalam = 144 +Sukabumi = 146 +Sungai Penuh = 148 +Surabaya = 4 +Surakarta = 150 +Tangerang = 152 +Tangerang Selatan = 154 +Tanjung Pinang = 24 +Tanjung Selor = 34 +Tanjungbalai = 156 +Tarakan = 158 +Tasikmalaya = 160 +Tebing Tinggi = 162 +Tegal = 164 +Ternate = 166 +Tidore Kepulauan = 168 +Tomohon = 170 +Tual = 172 +Yogyakarta = 25 +``` + + # Thanks To +* [`MRHRTZ`](https://github.com/MRHRTZ) + + diff --git a/node_modules/hxz-api/index.js b/node_modules/hxz-api/index.js new file mode 100644 index 000000000..1dff6a2f0 --- /dev/null +++ b/node_modules/hxz-api/index.js @@ -0,0 +1,46 @@ +const { + otakudesu, + covid, + ongoing, + komiku, + tebakgambar, + surah, + sholat, + lirik, + chara, + wattpad, + playstore, + linkwa, + pinterest, + igdl, + igstory, + igstalk, + twitter, + fbdown, + youtube, + ttdownloader +} = require('./lib/function') + +module.exports.otakudesu = otakudesu +module.exports.covid = covid +module.exports.ongoing = ongoing +module.exports.komiku = komiku +module.exports.tebakgambar = tebakgambar +module.exports.surah = surah +module.exports.sholat = sholat +module.exports.lirik = lirik +module.exports.chara = chara +module.exports.wattpad = wattpad +module.exports.playstore = playstore +module.exports.linkwa = linkwa +module.exports.pinterest = pinterest +module.exports.igdl = igdl +module.exports.igstory = igstory +module.exports.igstalk = igstalk +module.exports.twitter = twitter +module.exports.fbdown = fbdown +module.exports.youtube = youtube +module.exports.ttdownloader = ttdownloader + + + diff --git a/node_modules/hxz-api/lib/function.js b/node_modules/hxz-api/lib/function.js new file mode 100644 index 000000000..ac03ae116 --- /dev/null +++ b/node_modules/hxz-api/lib/function.js @@ -0,0 +1,727 @@ +const cheerio = require("cheerio") +const axios = require("axios") +const qs = require("qs") + +function otakudesu(judul){ + return new Promise(async(resolve, reject) => { + axios.get('https://otakudesu.moe/?s=' + judul + '&post_type=anime') + .then(({ data }) => { + const $ = cheerio.load(data) + const result = {}; + let limk = $('#venkonten > div > div.venser > div > div > ul > li:nth-child(1) > h2 > a').attr('href') + axios.get(limk).then(({ data }) => { + const $$ = cheerio.load(data) + result.message = 'By Hexagon' + result.img = $$('#venkonten > div.venser > div.fotoanime').find('img').attr('src') + $$('#venkonten > div.venser > div.fotoanime > div.infozin > div').each(function(a, b) { + result.judul = $$(b).find('p:nth-child(1)').text().replace('Judul: ','') + result.jepang = $$(b).find('p:nth-child(2)').text().replace('Japanese: ','') + result.rate = $$(b).find('p:nth-child(3)').text().replace('Skor: ','') + result.produser = $$(b).find('p:nth-child(4)').text().replace('Produser: ','') + result.tipe = $$(b).find('p:nth-child(5)').text().replace('Tipe: ','') + result.status = $$(b).find('p:nth-child(6)').text().replace('Status: ','') + result.episode = $$(b).find('p:nth-child(7)').text().replace('Total Episode: ','') + result.durasi = $$(b).find('p:nth-child(8)').text().replace('Durasi: ','') + result.rilis = $$(b).find('p:nth-child(9)').text().replace('Tanggal Rilis: ','') + result.studio = $$(b).find('p:nth-child(10)').text().replace('Studio: ','') + result.genre = $$(b).find('p:nth-child(11)').text().replace('Genre: ','') + result.desc = $$('#venkonten > div.venser > div.fotoanime > div.sinopc').text().replace('.','\n') + $$(b).find('div.sinopc > p:nth-child(2)').text() + result.batch = $$('#venkonten > div.venser > div:nth-child(10) > ul > li > span:nth-child(1) > a').attr('href') + }) + const lim = $$('#venkonten > div.venser > div:nth-child(10) > ul > li > span:nth-child(1) > a').attr('href') + axios.get(lim).then(({ data }) => { + const $$$ = cheerio.load(data) + result.batchSD = $$$('#venkonten > div:nth-child(6) > ul > li:nth-child(1) > a:nth-child(3)').attr('href') + result.batchHD = $$$('#venkonten > div:nth-child(6) > ul > li:nth-child(3) > a:nth-child(3)').attr('href') + resolve(result) + }) + }) + }) + .catch(reject) + }) +} + +function covid(){ + return new Promise(async(resolve, reject) => { + axios.get('https://covid19.go.id/') + .then(({ data }) => { + const $ = cheerio.load(data) + const hasil = []; + $('#case > div > div > div > div > div:nth-child(2)').each(function(a,b) { + const pindo = $(b).find('div:nth-child(3) > strong').text() + const mindo = $(b).find('div:nth-child(5) > strong').text() + const sindo = $(b).find('div:nth-child(4) > strong').text() + const upindo = $(b).find('div.pt-4.text-color-black.text-1').text().trim() + $('#case > div > div > div > div > div:nth-child(1)').each(function(c,d) { + const neg = $(d).find('div:nth-child(3) > strong').text() + const pglo = $(d).find('div:nth-child(4) > strong').text() + const nglo = $(d).find('div:nth-child(5) > strong').text() + const up = $(d).find('div.pt-4.text-color-grey.text-1').text().trim() + const result = { + message: 'By Hexagon', + indo : { + positif_indo: pindo, + meninggal_indo: mindo, + sembuh_indo: sindo, + update_indo: upindo.split(':')[1] + }, + global: { + negara: neg, + positif: pglo, + meninggal: nglo, + update: up.split(':')[1].split('\n')[0] + + } + } + hasil.push(result) + }) + }) + resolve(hasil) + }) + .catch(reject) + }) +} + +function ongoing(){ + return new Promise((reject,resolve) => { + axios.get('https://otakudesu.moe/ongoing-anime/').then(({ data}) => { + const $ = cheerio.load(data) + const result = []; + const img = []; + const epz = []; + const ne = []; + const th = []; + const ep = []; + const nm =[]; + $('div.detpost').each(function(a,b) { + img.push($(b).find('img').attr('src')) + nm.push($(b).find('h2').text()) + th.push($(b).find('a').attr('href')) + }) + $('div.epztipe').each(function(d,c) { + epz.push($(c).text()) + }) + $('div.newnime').each(function(f,g) { + ne.push($(g).text()) + }) + $('div.epz').each(function(m,n){ + ep.push($(n).text()) + }) + for( let i = 0; i < img.length; i++){ + result.push({ + nama: nm[i], + image: img[i], + episode: ep[i], + setiap: epz[i], + rilis: ne[i], + link: th[i] + }) + } + resolve(result) + }) + .catch(reject) + }) +} + +function komiku(judul) { + return new Promise(async(resolve,reject) => { + axios.get('https://data3.komiku.id/cari/?post_type=manga&s=' + encodeURIComponent(judul)) + .then(({ data }) => { + const $ = cheerio.load(data) + const img = []; + const or = []; + const ind = []; + const up = []; + const des = []; + const li = []; + const ch = []; + const ch1 = []; + $('div.daftar').each(function (a,b) { + img.push($(b).find('img').attr('data-src')) + $('div.kan').each(function(c,d) { + or.push($(d).find('h3').text().trim()) + ind.push($(d).find('span.judul2').text()) + li.push('https://komiku.id' + $(d).find('a').attr('href')) + up.push($(d).find('p').text().trim().split('. ')[0]) + des.push($(d).find('p').text().trim().split('. ')[1]) + ch1.push($(d).find('div:nth-child(5) > a').attr('title')) + $('div.new1').each(function(e,f) { + ch.push($(f).find('a').attr('title')) + }) + }) +}) + for (let i = 0 ; i < img.length; i++) { + resolve({ + image: img[i], + title: or[i], + indo: ind[i], + update: up[i], + desc: des[i], + chapter_awal: ch[i], + chapter_akhir: ch1[i], + link: li[i] + }) + } +}) + .catch(reject) + }) +} + +function tebakgambar() { + return new Promise(async(resolve, reject) => { + axios.get('https://jawabantebakgambar.net/all-answers/') + .then(({ data }) => { + const $ = cheerio.load(data) + const result = []; + let random = Math.floor(Math.random() * 2836) + 2; + let link2 = 'https://jawabantebakgambar.net' + $(`#images > li:nth-child(${random}) > a`).each(function(a, b) { + const img = link2 + $(b).find('img').attr('data-src') + const jwb = $(b).find('img').attr('alt') + result.push({ + message: 'By Hexagon', + image: img, + jawaban: jwb + }) + + resolve(result) + }) + }) + .catch(reject) + }) +} + +function surah(no){ + return new Promise(async(resolve, reject) => { + axios.get('https://kalam.sindonews.com/surah/' + no) + .then(({ data }) => { + const $ = cheerio.load(data) + const result = []; + const ar = []; + const id = []; + const lt = []; + const au = []; + $('div.breadcrumb-new > ul > li:nth-child(5)').each(function(c,d) { + result.audio = $(d).find('a').attr('href').replace('surah','audioframe') + }) + $('div.ayat-arab').each(function(a, b) { + ar.push($(b).text()) + }) + $('li > div.ayat-text').each(function(e, f) { + id.push($(f).text().replace(',','').trim()) }) + $('div.ayat-latin').each(function(g, h) { + lt.push($(h).text().trim()) }) + for(let i = 0; i < ar.length ; i++){ + result.push({ + arab: ar[i], + indo: id[i], + latin: lt[i], + }) + } + resolve(result) + }) + .catch(reject) + }) +} +function sholat(NO) { + return new Promise(async(resolve, reject) =>{ + axios.get('https://kalam.sindonews.com/jadwalsholat/' + NO).then(({ data }) => { + const $ = cheerio.load(data) + const result = {}; + $('div.imsakiyah-content').each(function(a, b) { + result.Tanggal = $(b).find('tr:nth-child(1) > td:nth-child(1)').text() + result.imsak = $(b).find('tr:nth-child(1) > td:nth-child(2)').text() + result.subuh = $(b).find('tr:nth-child(1) > td:nth-child(3)').text() + result.zuhur = $(b).find('tr:nth-child(1) > td:nth-child(4)').text() + result.ashar = $(b).find('tr:nth-child(1) > td:nth-child(5)').text() + result.maghrib = $(b).find('tr:nth-child(1) > td:nth-child(6)').text() + result.isya = $(b).find('tr:nth-child(1) > td:nth-child(7)').text() + }) + resolve(result) + }) + .catch(reject) + }) +} + +function lirik(judul){ + return new Promise(async(resolve, reject) => { + axios.get('https://www.musixmatch.com/search/' + judul) + .then(async({ data }) => { + const $ = cheerio.load(data) + const hasil = {}; + let limk = 'https://www.musixmatch.com' + const link = limk + $('div.media-card-body > div > h2').find('a').attr('href') + await axios.get(link) + .then(({ data }) => { + const $$ = cheerio.load(data) + hasil.thumb = 'https:' + $$('div.col-sm-1.col-md-2.col-ml-3.col-lg-3.static-position > div > div > div').find('img').attr('src') + $$('div.col-sm-10.col-md-8.col-ml-6.col-lg-6 > div.mxm-lyrics').each(function(a,b) { + hasil.lirik = $$(b).find('span > p > span').text() +'\n' + $$(b).find('span > div > p > span').text() + }) + }) + resolve(hasil) + }) + .catch(reject) + }) +} + +function chara(query) { + return new Promise((resolve, reject) => { + axios.get('https://www.wallpaperflare.com/search?wallpaper='+ query,{ + headers: { + "user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36", + "cookie": "_ga=GA1.2.863074474.1624987429; _gid=GA1.2.857771494.1624987429; __gads=ID=84d12a6ae82d0a63-2242b0820eca0058:T=1624987427:RT=1624987427:S=ALNI_MaJYaH0-_xRbokdDkQ0B49vSYgYcQ" + } + }) + .then(({ data }) => { + const $ = cheerio.load(data) + const result = []; + $('#gallery > li > figure > a').each(function(a, b) { + result.push($(b).find('img').attr('data-src')) + }) + resolve(result) + }) + .catch({status: 'err'}) + }) +} + +function wattpad(judul){ + return new Promise((resolve, reject) => { + axios.get('https://www.wattpad.com/search/' + judul) + .then(({data}) => { + const $ = cheerio.load(data) + const result = []; + const jdl = []; + const img = []; + const des = []; + const lnk = []; + const red = []; + const vt = []; + const limk = 'https://www.wattpad.com/' + $('div.cover.cover-xs.pull-left').each(function(a,b){ + img.push($(b).find('img').attr('src')) + }) + $('div.content > h5').each(function(a,b) { + jdl.push($(b).text().trim()) + }) + $('div.content > p').each(function(a,b){ + des.push($(b).text().trim()) + }) + $('#results-stories > div > ul > li').each(function(a,b){ + lnk.push(limk + $(b).find('a.on-result').attr('data-id')) + }) + $('div.content > div > small.reads').each(function(a,b){ + red.push($(b).text()) + }) + $('div.content > div > small.votes').each(function(a, b) { + vt.push($(b).text()) + }) + for (let i = 0; i < lnk.length; i++){ + result.push({ + judul: jdl[i], + desc: des[i], + vote: vt[i], + reads: red[i], + image: img[i], + link: lnk[i] + }) + resolve(result) + } + }) + .catch({message: 'err'}) + }) +} + +function playstore(name){ + return new Promise((resolve, reject) => { + axios.get('https://play.google.com/store/search?q='+ name +'&c=apps') + .then(({ data }) => { + const $ = cheerio.load(data) + let ln = []; + let nm = []; + let dv = []; + let lm = []; + const result = []; + $('div.wXUyZd > a').each(function(a,b){ + const link = 'https://play.google.com' + $(b).attr('href') + ln.push(link); + }) + $('div.b8cIId.ReQCgd.Q9MA7b > a > div').each(function(d,e){ + const name = $(e).text().trim() + nm.push(name); + }) + $('div.b8cIId.ReQCgd.KoLSrc > a > div').each(function(f,g){ + const dev = $(g).text().trim(); + dv.push(dev) + }) + $('div.b8cIId.ReQCgd.KoLSrc > a').each(function(h,i){ + const limk = 'https://play.google.com' + $(i).attr('href'); + lm.push(limk); + }) + for (let i = 0; i < ln.length; i++){ + result.push({ + name: nm[i], + link: ln[i], + developer: dv[i], + link_dev: lm[i] + }) + } + resolve(result) + }) + .catch(reject) + }) +} + +function linkwa(nama){ + return new Promise((resolve,reject) => { + axios.get('http://ngarang.com/link-grup-wa/daftar-link-grup-wa.php?search='+ nama +'&searchby=name') + .then(({ data }) => { + const $ = cheerio.load(data); + const result = []; + const lnk = []; + const nm = []; + $('div.wa-chat-title-container').each(function(a,b){ + const limk = $(b).find('a').attr('href'); + lnk.push(limk) + }) + $('div.wa-chat-title-text').each(function(c,d) { + const name = $(d).text(); + nm.push(name) + }) + for( let i = 0; i < lnk.length; i++){ + result.push({ + nama: nm[i].split('. ')[1], + link: lnk[i].split('?')[0] + }) + } + resolve(result) + }) + .catch(reject) + }) +} + +function pinterest(querry){ + return new Promise(async(resolve,reject) => { + axios.get('https://id.pinterest.com/search/pins/?autologin=true&q=' + querry, { + headers: { + "cookie" : "_auth=1; _b=\"AVna7S1p7l1C5I9u0+nR3YzijpvXOPc6d09SyCzO+DcwpersQH36SmGiYfymBKhZcGg=\"; _pinterest_sess=TWc9PSZHamJOZ0JobUFiSEpSN3Z4a2NsMk9wZ3gxL1NSc2k2NkFLaUw5bVY5cXR5alZHR0gxY2h2MVZDZlNQalNpUUJFRVR5L3NlYy9JZkthekp3bHo5bXFuaFZzVHJFMnkrR3lTbm56U3YvQXBBTW96VUgzVUhuK1Z4VURGKzczUi9hNHdDeTJ5Y2pBTmxhc2owZ2hkSGlDemtUSnYvVXh5dDNkaDN3TjZCTk8ycTdHRHVsOFg2b2NQWCtpOWxqeDNjNkk3cS85MkhhSklSb0hwTnZvZVFyZmJEUllwbG9UVnpCYVNTRzZxOXNJcmduOVc4aURtM3NtRFo3STlmWjJvSjlWTU5ITzg0VUg1NGhOTEZzME9SNFNhVWJRWjRJK3pGMFA4Q3UvcHBnWHdaYXZpa2FUNkx6Z3RNQjEzTFJEOHZoaHRvazc1c1UrYlRuUmdKcDg3ZEY4cjNtZlBLRTRBZjNYK0lPTXZJTzQ5dU8ybDdVS015bWJKT0tjTWYyRlBzclpiamdsNmtpeUZnRjlwVGJXUmdOMXdTUkFHRWloVjBMR0JlTE5YcmhxVHdoNzFHbDZ0YmFHZ1VLQXU1QnpkM1FqUTNMTnhYb3VKeDVGbnhNSkdkNXFSMXQybjRGL3pyZXRLR0ZTc0xHZ0JvbTJCNnAzQzE0cW1WTndIK0trY05HV1gxS09NRktadnFCSDR2YzBoWmRiUGZiWXFQNjcwWmZhaDZQRm1UbzNxc21pV1p5WDlabm1UWGQzanc1SGlrZXB1bDVDWXQvUis3elN2SVFDbm1DSVE5Z0d4YW1sa2hsSkZJb1h0MTFpck5BdDR0d0lZOW1Pa2RDVzNySWpXWmUwOUFhQmFSVUpaOFQ3WlhOQldNMkExeDIvMjZHeXdnNjdMYWdiQUhUSEFBUlhUVTdBMThRRmh1ekJMYWZ2YTJkNlg0cmFCdnU2WEpwcXlPOVZYcGNhNkZDd051S3lGZmo0eHV0ZE42NW8xRm5aRWpoQnNKNnNlSGFad1MzOHNkdWtER0xQTFN5Z3lmRERsZnZWWE5CZEJneVRlMDd2VmNPMjloK0g5eCswZUVJTS9CRkFweHc5RUh6K1JocGN6clc1JmZtL3JhRE1sc0NMTFlpMVErRGtPcllvTGdldz0=; _ir=0" + } + }).then(({ data }) => { + const $ = cheerio.load(data) + const result = []; + const hasil = []; + $('div > a').get().map(b => { + const link = $(b).find('img').attr('src') + result.push(link) + }); + result.forEach(v => { + if(v == undefined) return + hasil.push(v.replace(/236/g,'736')) + }) + hasil.shift(); + resolve(hasil) + }) + }) +} + +function igdl(url){ + return new Promise(async(resolve, reject) => { + axios.request({ + url: 'https://www.instagramsave.com/download-instagram-videos.php', + method: 'GET', + headers:{ + "user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36", + "cookie": "PHPSESSID=ugpgvu6fgc4592jh7ht9d18v49; _ga=GA1.2.1126798330.1625045680; _gid=GA1.2.1475525047.1625045680; __gads=ID=92b58ed9ed58d147-221917af11ca0021:T=1625045679:RT=1625045679:S=ALNI_MYnQToDW3kOUClBGEzULNjeyAqOtg" + } + }) + .then(({ data }) => { + const $ = cheerio.load(data) + const token = $('#token').attr('value') + let config ={ + headers: { + 'content-type': 'application/x-www-form-urlencoded; charset=UTF-8', + "sec-ch-ua": '" Not;A Brand";v="99", "Google Chrome";v="91", "Chromium";v="91"', + "cookie": "PHPSESSID=ugpgvu6fgc4592jh7ht9d18v49; _ga=GA1.2.1126798330.1625045680; _gid=GA1.2.1475525047.1625045680; __gads=ID=92b58ed9ed58d147-221917af11ca0021:T=1625045679:RT=1625045679:S=ALNI_MYnQToDW3kOUClBGEzULNjeyAqOtg", + "user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36", + }, + data: { + 'url': url, + 'action': 'post', + 'token': token + } + } + axios.post('https://www.instagramsave.com/system/action.php',qs.stringify(config.data), { headers: config.headers }) + .then(({ data }) => { + resolve(data) + }) + }) + .catch(reject) + }) +} + +function igstory(username){ + return new Promise(async(resolve, reject) => { + axios.request({ + url: 'https://www.instagramsave.com/instagram-story-downloader.php', + method: 'GET', + headers:{ + "user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36", + "cookie": "PHPSESSID=ugpgvu6fgc4592jh7ht9d18v49; _ga=GA1.2.1126798330.1625045680; _gid=GA1.2.1475525047.1625045680; __gads=ID=92b58ed9ed58d147-221917af11ca0021:T=1625045679:RT=1625045679:S=ALNI_MYnQToDW3kOUClBGEzULNjeyAqOtg" + } + }) + .then(({ data }) => { + const $ = cheerio.load(data) + const token = $('#token').attr('value') + let config ={ + headers: { + 'content-type': 'application/x-www-form-urlencoded; charset=UTF-8', + "sec-ch-ua": '" Not;A Brand";v="99", "Google Chrome";v="91", "Chromium";v="91"', + "cookie": "PHPSESSID=ugpgvu6fgc4592jh7ht9d18v49; _ga=GA1.2.1126798330.1625045680; _gid=GA1.2.1475525047.1625045680; __gads=ID=92b58ed9ed58d147-221917af11ca0021:T=1625045679:RT=1625045679:S=ALNI_MYnQToDW3kOUClBGEzULNjeyAqOtg", + "user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36", + }, + data: { + 'url':'https://www.instagram.com/'+ username, + 'action': 'story', + 'token': token + } + } + axios.post('https://www.instagramsave.com/system/action.php',qs.stringify(config.data), { headers: config.headers }) + .then(({ data }) => { + resolve(data) + }) + }) + .catch(reject) + }) +} + +function igstalk(username){ + return new Promise((resolve,reject) => { + axios.get('https://www.instagram.com/'+ username +'/?__a=1',{ + method: 'GET', + headers: { + "user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.114 Safari/537.36", + "cookie": "mid=XBXl1AALAAEbFoAEfNjZlMMG9dwX; ig_did=91E66A48-5AA2-445D-BFE6-84DC4456DE8F; fbm_124024574287414=base_domain=.instagram.com; ig_nrcb=1; shbid=\"12737\0544008624962\0541656157971:01f72a5102dc07af6845adf923ca70eb86e81ab95fa9dbfdaf157c9eef0e82fd1f10fe23\"; shbts=\"1624621971\0544008624962\0541656157971:01f74841fba8e77a0066b47ea891dec8fba6fdf9216c0816f9fb3532292f769828800ae2\"; fbsr_124024574287414=86D8femzH4_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akFnTzVKOHQ5M0V3U3dvNkRtZ0RiY1l1Z3dQSTIybnExOUxLd3lpZTVfZll0bkNXZXBuM1hoYWFLX0w2R0pZaUpzaDBOTDBhb3pmTVBkRTVQRC12X3FnbUgxLXZYdGVmcHhfaFU0aUZNZVMxNHhFUk5OblJyMmxYTUpDa2RFYTdISXNCR2swdHhaaGF0NUt4UDR3cWZTamRwcVFfQ19sa1RUek5fU0taUTYtMjlzTkdnLUVWb3oxMUZWc3Q2OEx2ZnlIY0V0eFp0ZUxacXpiWmh6MzZrVl83VmFGd0FqVnVkTGFQN2VzT3ZRcmlTQ2pLUE5XbVcyNWhudzIzejJBSnVURW00YWR1cmN6a3ZLWU1icTd2SnN0SVdJV09RIiwib2F1dGhfdG9rZW4iOiJFQUFCd3pMaXhuallCQUJBZmJuQ3haQzZMd3h4MDFJV2MyZ3dsQ3k3Qmp0b05UNUY0WDY2NHBrUzRQeERNVXRsdmhWWkI3SXE0MGsyZ2hJQm55RHRPcW5iVjlPbUNiWGhyTFBaQUhBQjFzVFpBdHF6RFEzVTROUkhOU1V6MFVXWkNtTEdLcDNNWDRoazVIOURLbERHN0QwUlhZNHY4dHBCdVNNYjN4dnBTRGtQcHdYRlBXVU82VCIsImFsZ29yaXRobSI6IkhNQUMtU0hBMjU2IiwiaXNzdWVkX2F0IjoxNjI0NjIxOTgxfQ; csrftoken=PpiPMEl0R2pAwThsw4NXynO6cVIXHZDo; ds_user_id=38316792800; sessionid=38316792800:rQj5Tr3g5zkg7b:4; rur=\"RVA\05438316792800\0541656158332:01f759cf624bef147397144805bb4c26f6c8b36a232e0f5738c570ee492f6b629f84f6e5\"" + } + }) + .then(({ data }) => { + const user = data.graphql.user + let result = { + message: 'By Hexagon', + id: user.id, + biography: user.biography, + followers: user.edge_followed_by.count, + following: user.edge_follow.count, + fullName: user.full_name, + highlightCount: user.highlight_reel_count, + isBusinessAccount: user.is_business_account, + isRecentUser: user.is_joined_recently, + accountCategory: user.business_category_name, + linkedFacebookPage: user.connected_fb_page, + isPrivate: user.is_private, + isVerified: user.is_verified, + profilePicHD: user.profile_pic_url_hd, + username: user.username, + postsCount: user.edge_owner_to_timeline_media.count + } + resolve(result) + }) + .catch(reject) + }) +} + +function twitter(link){ + return new Promise((resolve, reject) => { + let config = { + 'URL': link + } + axios.post('https://twdown.net/download.php',qs.stringify(config),{ + headers: { + "accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9", + "sec-ch-ua": '" Not;A Brand";v="99", "Google Chrome";v="91", "Chromium";v="91"', + "user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36", + "cookie": "_ga=GA1.2.1388798541.1625064838; _gid=GA1.2.1351476739.1625064838; __gads=ID=7a60905ab10b2596-229566750eca0064:T=1625064837:RT=1625064837:S=ALNI_Mbg3GGC2b3oBVCUJt9UImup-j20Iw; _gat=1" + } + }) + .then(({ data }) => { + const $ = cheerio.load(data) + resolve({ + desc: $('div:nth-child(1) > div:nth-child(2) > p').text().trim(), + thumb: $('div:nth-child(1) > img').attr('src'), + HD: $('tbody > tr:nth-child(1) > td:nth-child(4) > a').attr('href'), + SD: $('tr:nth-child(2) > td:nth-child(4) > a').attr('href'), + audio: 'https://twdown.net/' + $('tr:nth-child(4) > td:nth-child(4) > a').attr('href') + }) + }) + .catch(reject) + }) +} + +function fbdown(link){ + return new Promise((resolve,reject) => { + let config = { + 'url': link + } + axios('https://www.getfvid.com/downloader',{ + method: 'POST', + data: new URLSearchParams(Object.entries(config)), + headers: { + "content-type": "application/x-www-form-urlencoded", + "user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36", + "cookie": "_ga=GA1.2.1310699039.1624884412; _pbjs_userid_consent_data=3524755945110770; cto_bidid=rQH5Tl9NNm5IWFZsem00SVVuZGpEd21sWnp0WmhUeTZpRXdkWlRUOSUyQkYlMkJQQnJRSHVPZ3Fhb1R2UUFiTWJuVGlhVkN1TGM2anhDT1M1Qk0ydHlBb21LJTJGNkdCOWtZalRtZFlxJTJGa3FVTG1TaHlzdDRvJTNE; cto_bundle=g1Ka319NaThuSmh6UklyWm5vV2pkb3NYaUZMeWlHVUtDbVBmeldhNm5qVGVwWnJzSUElMkJXVDdORmU5VElvV2pXUTJhQ3owVWI5enE1WjJ4ZHR5NDZqd1hCZnVHVGZmOEd0eURzcSUyQkNDcHZsR0xJcTZaRFZEMDkzUk1xSmhYMlY0TTdUY0hpZm9NTk5GYXVxWjBJZTR0dE9rQmZ3JTNEJTNE; _gid=GA1.2.908874955.1625126838; __gads=ID=5be9d413ff899546-22e04a9e18ca0046:T=1625126836:RT=1625126836:S=ALNI_Ma0axY94aSdwMIg95hxZVZ-JGNT2w; cookieconsent_status=dismiss" + } + }) + .then(async({ data }) => { + const $ = cheerio.load(data); + resolve({ + Normal_video: $('div.col-md-4.btns-download > p:nth-child(2) > a').attr('href'), + HD: $('div.col-md-4.btns-download > p:nth-child(1) > a').attr('href'), + audio: $('div.col-md-4.btns-download > p:nth-child(3) > a').attr('href') + }) + }) + .catch(reject) + }) +} + +function youtube(link){ + return new Promise((resolve, reject) => { + const ytIdRegex = /(?:http(?:s|):\/\/|)(?:(?:www\.|)youtube(?:\-nocookie|)\.com\/(?:watch\?.*(?:|\&)v=|embed\/|v\/)|youtu\.be\/)([-_0-9A-Za-z]{11})/ + if (ytIdRegex.test(link)) { + let url = ytIdRegex.exec(link) + let config = { + 'url': 'https://www.youtube.be/' + url, + 'q_auto': 0, + 'ajax': 1 + } + let headerss = { + "sec-ch-ua": '" Not;A Brand";v="99", "Google Chrome";v="91", "Chromium";v="91"', + "user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36", + "Cookie": 'PHPSESSID=6jo2ggb63g5mjvgj45f612ogt7; _ga=GA1.2.405896420.1625200423; _gid=GA1.2.2135261581.1625200423; _PN_SBSCRBR_FALLBACK_DENIED=1625200785624; MarketGidStorage={"0":{},"C702514":{"page":5,"time":1625200846733}}' + } + axios('https://www.y2mate.com/mates/en68/analyze/ajax',{ + method: 'POST', + data: new URLSearchParams(Object.entries(config)), + headers: headerss + }) + .then(({ data }) => { + const $ = cheerio.load(data.result) + let img = $('div.thumbnail.cover > a > img').attr('src'); + let title = $('div.thumbnail.cover > div > b').text(); + let size = $('#mp4 > table > tbody > tr:nth-child(3) > td:nth-child(2)').text() + let size_mp3 = $('#audio > table > tbody > tr:nth-child(1) > td:nth-child(2)').text() + let id = /var k__id = "(.*?)"/.exec(data.result)[1] + let configs = { + type: 'youtube', + _id: id, + v_id: url[1], + ajax: '1', + token: '', + ftype: 'mp4', + fquality: 480 + } + axios('https://www.y2mate.com/mates/en68/convert',{ + method: 'POST', + data: new URLSearchParams(Object.entries(configs)), + headers: headerss + }) + .then(({data}) => { + const $ = cheerio.load(data.result) + let link = $('div > a').attr('href') + let configss = { + type: 'youtube', + _id: id, + v_id: url[1], + ajax: '1', + token: '', + ftype: 'mp3', + fquality: 128 + } + axios('https://www.y2mate.com/mates/en68/convert',{ + method: 'POST', + data: new URLSearchParams(Object.entries(configss)), + headers: headerss + }) + .then(({ data }) => { + const $ = cheerio.load(data.result) + let audio = $('div > a').attr('href') + resolve({ + id: url[1], + title: title, + size: size, + quality: '480p', + thumb: img, + link: link, + size_mp3: size_mp3, + mp3: audio + }) + + }) + }) + }) + .catch(reject) + }else reject('link invalid') + }) +} + +function ttdownloader(url){ + return new Promise(async(resolve, reject) => { + axios.get('https://ttdownloader.com/',{ + headers: { + "accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9", + "user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36", + "cookie": "PHPSESSID=9ut8phujrprrmll6oc3bist01t; popCookie=1; _ga=GA1.2.1068750365.1625213061; _gid=GA1.2.842420949.1625213061" + } + }) + .then(({ data }) => { + const $ = cheerio.load(data) + let token = $('#token').attr('value') + let config = { + 'url': url, + 'format': '', + 'token': token + } + axios('https://ttdownloader.com/req/',{ + method: 'POST', + data : new URLSearchParams(Object.entries(config)), + headers: { + "accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9", + "user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36", + "cookie": "PHPSESSID=9ut8phujrprrmll6oc3bist01t; popCookie=1; _ga=GA1.2.1068750365.1625213061; _gid=GA1.2.842420949.1625213061" + } + }) + .then(({ data }) => { + const $ = cheerio.load(data) + resolve({ + message: 'By Hexagon', + nowm: $('div:nth-child(2) > div.download > a').attr('href'), + wm: $('div:nth-child(3) > div.download > a').attr('href'), + audio: $('div:nth-child(4) > div.download > a').attr('href') + }) + }) + }) + .catch(reject) + }) +} + +module.exports.otakudesu = otakudesu +module.exports.covid = covid +module.exports.ongoing = ongoing +module.exports.komiku = komiku +module.exports.tebakgambar = tebakgambar +module.exports.surah = surah +module.exports.sholat = sholat +module.exports.lirik = lirik +module.exports.chara = chara +module.exports.wattpad = wattpad +module.exports.playstore = playstore +module.exports.linkwa = linkwa +module.exports.pinterest = pinterest +module.exports.igdl = igdl +module.exports.igstory = igstory +module.exports.igstalk = igstalk +module.exports.twitter = twitter +module.exports.fbdown = fbdown +module.exports.youtube = youtube +module.exports.ttdownloader = ttdownloader + + + diff --git a/node_modules/hxz-api/node_modules/axios/CHANGELOG.md b/node_modules/hxz-api/node_modules/axios/CHANGELOG.md new file mode 100644 index 000000000..5e2b3d079 --- /dev/null +++ b/node_modules/hxz-api/node_modules/axios/CHANGELOG.md @@ -0,0 +1,775 @@ +# Changelog + +### 0.21.4 (September 6, 2021) + +Fixes and Functionality: +- Fixing JSON transform when data is stringified. Providing backward compatibility and complying to the JSON RFC standard ([#4020](https://github.com/axios/axios/pull/4020)) + +Huge thanks to everyone who contributed to this release via code (authors listed below) or via reviews and triaging on GitHub: + +- [Jay](mailto:jasonsaayman@gmail.com) +- [Guillaume Fortaine](https://github.com/gfortaine) +- [Yusuke Kawasaki](https://github.com/kawanet) +- [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS) + +### 0.21.3 (September 4, 2021) + +Fixes and Functionality: +- Fixing response interceptor not being called when request interceptor is attached ([#4013](https://github.com/axios/axios/pull/4013)) + +Huge thanks to everyone who contributed to this release via code (authors listed below) or via reviews and triaging on GitHub: + +- [Jay](mailto:jasonsaayman@gmail.com) +- [Julian Hollmann](https://github.com/nerdbeere) + +### 0.21.2 (September 4, 2021) + +Fixes and Functionality: + +- Updating axios requests to be delayed by pre-emptive promise creation ([#2702](https://github.com/axios/axios/pull/2702)) +- Adding "synchronous" and "runWhen" options to interceptors api ([#2702](https://github.com/axios/axios/pull/2702)) +- Updating of transformResponse ([#3377](https://github.com/axios/axios/pull/3377)) +- Adding ability to omit User-Agent header ([#3703](https://github.com/axios/axios/pull/3703)) +- Adding multiple JSON improvements ([#3688](https://github.com/axios/axios/pull/3688), [#3763](https://github.com/axios/axios/pull/3763)) +- Fixing quadratic runtime and extra memory usage when setting a maxContentLength ([#3738](https://github.com/axios/axios/pull/3738)) +- Adding parseInt to config.timeout ([#3781](https://github.com/axios/axios/pull/3781)) +- Adding custom return type support to interceptor ([#3783](https://github.com/axios/axios/pull/3783)) +- Adding security fix for ReDoS vulnerability ([#3980](https://github.com/axios/axios/pull/3980)) + +Internal and Tests: + +- Updating build dev dependancies ([#3401](https://github.com/axios/axios/pull/3401)) +- Fixing builds running on Travis CI ([#3538](https://github.com/axios/axios/pull/3538)) +- Updating follow rediect version ([#3694](https://github.com/axios/axios/pull/3694), [#3771](https://github.com/axios/axios/pull/3771)) +- Updating karma sauce launcher to fix failing sauce tests ([#3712](https://github.com/axios/axios/pull/3712), [#3717](https://github.com/axios/axios/pull/3717)) +- Updating content-type header for application/json to not contain charset field, according do RFC 8259 ([#2154](https://github.com/axios/axios/pull/2154)) +- Fixing tests by bumping karma-sauce-launcher version ([#3813](https://github.com/axios/axios/pull/3813)) +- Changing testing process from Travis CI to GitHub Actions ([#3938](https://github.com/axios/axios/pull/3938)) + +Documentation: + +- Updating documentation around the use of `AUTH_TOKEN` with multiple domain endpoints ([#3539](https://github.com/axios/axios/pull/3539)) +- Remove duplication of item in changelog ([#3523](https://github.com/axios/axios/pull/3523)) +- Fixing gramatical errors ([#2642](https://github.com/axios/axios/pull/2642)) +- Fixing spelling error ([#3567](https://github.com/axios/axios/pull/3567)) +- Moving gitpod metion ([#2637](https://github.com/axios/axios/pull/2637)) +- Adding new axios documentation website link ([#3681](https://github.com/axios/axios/pull/3681), [#3707](https://github.com/axios/axios/pull/3707)) +- Updating documentation around dispatching requests ([#3772](https://github.com/axios/axios/pull/3772)) +- Adding documentation for the type guard isAxiosError ([#3767](https://github.com/axios/axios/pull/3767)) +- Adding explanation of cancel token ([#3803](https://github.com/axios/axios/pull/3803)) +- Updating CI status badge ([#3953](https://github.com/axios/axios/pull/3953)) +- Fixing errors with JSON documentation ([#3936](https://github.com/axios/axios/pull/3936)) +- Fixing README typo under Request Config ([#3825](https://github.com/axios/axios/pull/3825)) +- Adding axios-multi-api to the ecosystem file ([#3817](https://github.com/axios/axios/pull/3817)) +- Adding SECURITY.md to properly disclose security vulnerabilities ([#3981](https://github.com/axios/axios/pull/3981)) + +Huge thanks to everyone who contributed to this release via code (authors listed below) or via reviews and triaging on GitHub: + +- [Jay](mailto:jasonsaayman@gmail.com) +- [Sasha Korotkov](https://github.com/SashaKoro) +- [Daniel Lopretto](https://github.com/timemachine3030) +- [Mike Bishop](https://github.com/MikeBishop) +- [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS) +- [Mark](https://github.com/bimbiltu) +- [Philipe Gouveia Paixão](https://github.com/piiih) +- [hippo](https://github.com/hippo2cat) +- [ready-research](https://github.com/ready-research) +- [Xianming Zhong](https://github.com/chinesedfan) +- [Christopher Chrapka](https://github.com/OJezu) +- [Brian Anglin](https://github.com/anglinb) +- [Kohta Ito](https://github.com/koh110) +- [Ali Clark](https://github.com/aliclark) +- [caikan](https://github.com/caikan) +- [Elina Gorshkova](https://github.com/elinagorshkova) +- [Ryota Ikezawa](https://github.com/paveg) +- [Nisar Hassan Naqvi](https://github.com/nisarhassan12) +- [Jake](https://github.com/codemaster138) +- [TagawaHirotaka](https://github.com/wafuwafu13) +- [Johannes Jarbratt](https://github.com/johachi) +- [Mo Sattler](https://github.com/MoSattler) +- [Sam Carlton](https://github.com/ThatGuySam) +- [Matt Czapliński](https://github.com/MattCCC) +- [Ziding Zhang](https://github.com/zidingz) + +### 0.21.1 (December 21, 2020) + +Fixes and Functionality: + +- Hotfix: Prevent SSRF ([#3410](https://github.com/axios/axios/pull/3410)) +- Protocol not parsed when setting proxy config from env vars ([#3070](https://github.com/axios/axios/pull/3070)) +- Updating axios in types to be lower case ([#2797](https://github.com/axios/axios/pull/2797)) +- Adding a type guard for `AxiosError` ([#2949](https://github.com/axios/axios/pull/2949)) + +Internal and Tests: + +- Remove the skipping of the `socket` http test ([#3364](https://github.com/axios/axios/pull/3364)) +- Use different socket for Win32 test ([#3375](https://github.com/axios/axios/pull/3375)) + +Huge thanks to everyone who contributed to this release via code (authors listed below) or via reviews and triaging on GitHub: + +- Daniel Lopretto +- Jason Kwok +- Jay +- Jonathan Foster +- Remco Haszing +- Xianming Zhong + +### 0.21.0 (October 23, 2020) + +Fixes and Functionality: + +- Fixing requestHeaders.Authorization ([#3287](https://github.com/axios/axios/pull/3287)) +- Fixing node types ([#3237](https://github.com/axios/axios/pull/3237)) +- Fixing axios.delete ignores config.data ([#3282](https://github.com/axios/axios/pull/3282)) +- Revert "Fixing overwrite Blob/File type as Content-Type in browser. (#1773)" ([#3289](https://github.com/axios/axios/pull/3289)) +- Fixing an issue that type 'null' and 'undefined' is not assignable to validateStatus when typescript strict option is enabled ([#3200](https://github.com/axios/axios/pull/3200)) + +Internal and Tests: + +- Lock travis to not use node v15 ([#3361](https://github.com/axios/axios/pull/3361)) + +Documentation: + +- Fixing simple typo, existant -> existent ([#3252](https://github.com/axios/axios/pull/3252)) +- Fixing typos ([#3309](https://github.com/axios/axios/pull/3309)) + +Huge thanks to everyone who contributed to this release via code (authors listed below) or via reviews and triaging on GitHub: + +- Allan Cruz <57270969+Allanbcruz@users.noreply.github.com> +- George Cheng +- Jay +- Kevin Kirsche +- Remco Haszing +- Taemin Shin +- Tim Gates +- Xianming Zhong + +### 0.20.0 (August 20, 2020) + +Release of 0.20.0-pre as a full release with no other changes. + +### 0.20.0-pre (July 15, 2020) + +Fixes and Functionality: + +- Fixing response with utf-8 BOM can not parse to json ([#2419](https://github.com/axios/axios/pull/2419)) + - fix: remove byte order marker (UTF-8 BOM) when transform response + - fix: remove BOM only utf-8 + - test: utf-8 BOM + - fix: incorrect param name +- Refactor mergeConfig without utils.deepMerge ([#2844](https://github.com/axios/axios/pull/2844)) + - Adding failing test + - Fixing #2587 default custom config persisting + - Adding Concat keys and filter duplicates + - Fixed value from CPE + - update for review feedbacks + - no deepMerge + - only merge between plain objects + - fix rename + - always merge config by mergeConfig + - extract function mergeDeepProperties + - refactor mergeConfig with all keys, and add special logic for validateStatus + - add test for resetting headers + - add lots of tests and fix a bug + - should not inherit `data` + - use simple toString +- Fixing overwrite Blob/File type as Content-Type in browser. ([#1773](https://github.com/axios/axios/pull/1773)) +- Fixing an issue that type 'null' is not assignable to validateStatus ([#2773](https://github.com/axios/axios/pull/2773)) +- Fixing special char encoding ([#1671](https://github.com/axios/axios/pull/1671)) + - removing @ character from replacement list since it is a reserved character + - Updating buildURL test to not include the @ character + - Removing console logs +- Fixing password encoding with special characters in basic authentication ([#1492](https://github.com/axios/axios/pull/1492)) + - Fixing password encoding with special characters in basic authentication + - Adding test to check if password with non-Latin1 characters pass +- Fixing 'Network Error' in react native android ([#1487](https://github.com/axios/axios/pull/1487)) + There is a bug in react native Android platform when using get method. It will trigger a 'Network Error' when passing the requestData which is an empty string to request.send function. So if the requestData is an empty string we can set it to null as well to fix the bug. +- Fixing Cookie Helper with Async Components ([#1105](https://github.com/axios/axios/pull/1105)) ([#1107](https://github.com/axios/axios/pull/1107)) +- Fixing 'progressEvent' type ([#2851](https://github.com/axios/axios/pull/2851)) + - Fix 'progressEvent' type + - Update axios.ts +- Fixing getting local files (file://) failed ([#2470](https://github.com/axios/axios/pull/2470)) + - fix issue #2416, #2396 + - fix Eslint warn + - Modify judgment conditions + - add unit test + - update unit test + - update unit test +- Allow PURGE method in typings ([#2191](https://github.com/axios/axios/pull/2191)) +- Adding option to disable automatic decompression ([#2661](https://github.com/axios/axios/pull/2661)) + - Adding ability to disable auto decompression + - Updating decompress documentation in README + - Fixing test\unit\adapters\http.js lint errors + - Adding test for disabling auto decompression + - Removing changes that fixed lint errors in tests + - Removing formatting change to unit test +- Add independent `maxBodyLength` option ([#2781](https://github.com/axios/axios/pull/2781)) + - Add independent option to set the maximum size of the request body + - Remove maxBodyLength check + - Update README + - Assert for error code and message +- Adding responseEncoding to mergeConfig ([#1745](https://github.com/axios/axios/pull/1745)) +- Compatible with follow-redirect aborts the request ([#2689](https://github.com/axios/axios/pull/2689)) + - Compatible with follow-redirect aborts the request + - Use the error code +- Fix merging of params ([#2656](https://github.com/axios/axios/pull/2656)) + - Name function to avoid ESLint func-names warning + - Switch params config to merge list and update tests + - Restore testing of both false and null + - Restore test cases for keys without defaults + - Include test for non-object values that aren't false-y. +- Revert `finally` as `then` ([#2683](https://github.com/axios/axios/pull/2683)) + +Internal and Tests: + +- Fix stale bot config ([#3049](https://github.com/axios/axios/pull/3049)) + - fix stale bot config + - fix multiple lines +- Add days and change name to work ([#3035](https://github.com/axios/axios/pull/3035)) +- Update close-issues.yml ([#3031](https://github.com/axios/axios/pull/3031)) + - Update close-issues.yml + Update close message to read better 😄 + - Fix use of quotations + Use single quotes as per other .yml files + - Remove user name form message +- Add GitHub actions to close stale issues/prs ([#3029](https://github.com/axios/axios/pull/3029)) + - prepare stale actions + - update messages + - Add exempt labels and lighten up comments +- Add GitHub actions to close invalid issues ([#3022](https://github.com/axios/axios/pull/3022)) + - add close actions + - fix with checkout + - update issue templates + - add reminder + - update close message +- Add test with Node.js 12 ([#2860](https://github.com/axios/axios/pull/2860)) + - test with Node.js 12 + - test with latest +- Adding console log on sandbox server startup ([#2210](https://github.com/axios/axios/pull/2210)) + - Adding console log on sandbox server startup + - Update server.js + Add server error handling + - Update server.js + Better error message, remove retry. +- Adding tests for method `options` type definitions ([#1996](https://github.com/axios/axios/pull/1996)) + Update tests. +- Add test for redirecting with too large response ([#2695](https://github.com/axios/axios/pull/2695)) +- Fixing unit test failure in Windows OS ([#2601](https://github.com/axios/axios/pull/2601)) +- Fixing issue for HEAD method and gzipped response ([#2666](https://github.com/axios/axios/pull/2666)) +- Fix tests in browsers ([#2748](https://github.com/axios/axios/pull/2748)) +- chore: add `jsdelivr` and `unpkg` support ([#2443](https://github.com/axios/axios/pull/2443)) + +Documentation: + +- Adding support for URLSearchParams in node ([#1900](https://github.com/axios/axios/pull/1900)) + - Adding support for URLSearchParams in node + - Remove un-needed code + - Update utils.js + - Make changes as suggested +- Adding table of content (preview) ([#3050](https://github.com/axios/axios/pull/3050)) + - add toc (preview) + - remove toc in toc + Signed-off-by: Moni + - fix sublinks + - fix indentation + - remove redundant table links + - update caps and indent + - remove axios +- Replace 'blacklist' with 'blocklist' ([#3006](https://github.com/axios/axios/pull/3006)) +- docs(): Detailed config options environment. ([#2088](https://github.com/axios/axios/pull/2088)) + - docs(): Detailed config options environment. + - Update README.md +- Include axios-data-unpacker in ECOSYSTEM.md ([#2080](https://github.com/axios/axios/pull/2080)) +- Allow opening examples in Gitpod ([#1958](https://github.com/axios/axios/pull/1958)) +- Remove axios.all() and axios.spread() from Readme.md ([#2727](https://github.com/axios/axios/pull/2727)) + - remove axios.all(), axios.spread() + - replace example + - axios.all() -> Promise.all() + - axios.spread(function (acct, perms)) -> function (acct, perms) + - add deprecated mark +- Update README.md ([#2887](https://github.com/axios/axios/pull/2887)) + Small change to the data attribute doc of the config. A request body can also be set for DELETE methods but this wasn't mentioned in the documentation (it only mentioned POST, PUT and PATCH). Took my some 10-20 minutes until I realized that I don't need to manipulate the request body with transformRequest in the case of DELETE. +- Include swagger-taxos-codegen in ECOSYSTEM.md ([#2162](https://github.com/axios/axios/pull/2162)) +- Add CDNJS version badge in README.md ([#878](https://github.com/axios/axios/pull/878)) + This badge will show the version on CDNJS! +- Documentation update to clear up ambiguity in code examples ([#2928](https://github.com/axios/axios/pull/2928)) + - Made an adjustment to the documentation to clear up any ambiguity around the use of "fs". This should help clear up that the code examples with "fs" cannot be used on the client side. +- Update README.md about validateStatus ([#2912](https://github.com/axios/axios/pull/2912)) + Rewrote the comment from "Reject only if the status code is greater than or equal to 500" to "Resolve only if the status code is less than 500" +- Updating documentation for usage form-data ([#2805](https://github.com/axios/axios/pull/2805)) + Closes #2049 +- Fixing CHANGELOG.md issue link ([#2784](https://github.com/axios/axios/pull/2784)) +- Include axios-hooks in ECOSYSTEM.md ([#2003](https://github.com/axios/axios/pull/2003)) +- Added Response header access instructions ([#1901](https://github.com/axios/axios/pull/1901)) + - Added Response header access instructions + - Added note about using bracket notation +- Add `onUploadProgress` and `onDownloadProgress` are browser only ([#2763](https://github.com/axios/axios/pull/2763)) + Saw in #928 and #1966 that `onUploadProgress` and `onDownloadProgress` only work in the browser and was missing that from the README. +- Update ' sign to ` in proxy spec ([#2778](https://github.com/axios/axios/pull/2778)) +- Adding jsDelivr link in README ([#1110](https://github.com/axios/axios/pull/1110)) + - Adding jsDelivr link + - Add SRI + - Remove SRI + +Huge thanks to everyone who contributed to this release via code (authors listed +below) or via reviews and triaging on GitHub: + +- Alan Wang +- Alexandru Ungureanu +- Anubhav Srivastava +- Benny Neugebauer +- Cr <631807682@qq.com> +- David +- David Ko +- David Tanner +- Emily Morehouse +- Felipe Martins +- Fonger <5862369+Fonger@users.noreply.github.com> +- Frostack +- George Cheng +- grumblerchester +- Gustavo López +- hexaez <45806662+hexaez@users.noreply.github.com> +- huangzuizui +- Ian Wijma +- Jay +- jeffjing +- jennynju <46782518+jennynju@users.noreply.github.com> +- Jimmy Liao <52391190+jimmy-liao-gogoro@users.noreply.github.com> +- Jonathan Sharpe +- JounQin +- Justin Beckwith +- Kamil Posiadała <3dcreator.pl@gmail.com> +- Lukas Drgon +- marcinx +- Martti Laine +- Michał Zarach +- Moni +- Motonori Iwata <121048+iwata@users.noreply.github.com> +- Nikita Galkin +- Petr Mares +- Philippe Recto +- Remco Haszing +- rockcs1992 +- Ryan Bown +- Samina Fu +- Simone Busoli +- Spencer von der Ohe +- Sven Efftinge +- Taegyeoung Oh +- Taemin Shin +- Thibault Ehrhart <1208424+ehrhart@users.noreply.github.com> +- Xianming Zhong +- Yasu Flores +- Zac Delventhal + +### 0.19.2 (Jan 20, 2020) + +- Remove unnecessary XSS check ([#2679](https://github.com/axios/axios/pull/2679)) (see ([#2646](https://github.com/axios/axios/issues/2646)) for discussion) + +### 0.19.1 (Jan 7, 2020) + +Fixes and Functionality: + +- Fixing invalid agent issue ([#1904](https://github.com/axios/axios/pull/1904)) +- Fix ignore set withCredentials false ([#2582](https://github.com/axios/axios/pull/2582)) +- Delete useless default to hash ([#2458](https://github.com/axios/axios/pull/2458)) +- Fix HTTP/HTTPs agents passing to follow-redirect ([#1904](https://github.com/axios/axios/pull/1904)) +- Fix ignore set withCredentials false ([#2582](https://github.com/axios/axios/pull/2582)) +- Fix CI build failure ([#2570](https://github.com/axios/axios/pull/2570)) +- Remove dependency on is-buffer from package.json ([#1816](https://github.com/axios/axios/pull/1816)) +- Adding options typings ([#2341](https://github.com/axios/axios/pull/2341)) +- Adding Typescript HTTP method definition for LINK and UNLINK. ([#2444](https://github.com/axios/axios/pull/2444)) +- Update dist with newest changes, fixes Custom Attributes issue +- Change syntax to see if build passes ([#2488](https://github.com/axios/axios/pull/2488)) +- Update Webpack + deps, remove now unnecessary polyfills ([#2410](https://github.com/axios/axios/pull/2410)) +- Fix to prevent XSS, throw an error when the URL contains a JS script ([#2464](https://github.com/axios/axios/pull/2464)) +- Add custom timeout error copy in config ([#2275](https://github.com/axios/axios/pull/2275)) +- Add error toJSON example ([#2466](https://github.com/axios/axios/pull/2466)) +- Fixing Vulnerability A Fortify Scan finds a critical Cross-Site Scrip… ([#2451](https://github.com/axios/axios/pull/2451)) +- Fixing subdomain handling on no_proxy ([#2442](https://github.com/axios/axios/pull/2442)) +- Make redirection from HTTP to HTTPS work ([#2426](https://github.com/axios/axios/pull/2426)) and ([#2547](https://github.com/axios/axios/pull/2547)) +- Add toJSON property to AxiosError type ([#2427](https://github.com/axios/axios/pull/2427)) +- Fixing socket hang up error on node side for slow response. ([#1752](https://github.com/axios/axios/pull/1752)) +- Alternative syntax to send data into the body ([#2317](https://github.com/axios/axios/pull/2317)) +- Fixing custom config options ([#2207](https://github.com/axios/axios/pull/2207)) +- Fixing set `config.method` after mergeConfig for Axios.prototype.request ([#2383](https://github.com/axios/axios/pull/2383)) +- Axios create url bug ([#2290](https://github.com/axios/axios/pull/2290)) +- Do not modify config.url when using a relative baseURL (resolves [#1628](https://github.com/axios/axios/issues/1098)) ([#2391](https://github.com/axios/axios/pull/2391)) + +Internal: + +- Revert "Update Webpack + deps, remove now unnecessary polyfills" ([#2479](https://github.com/axios/axios/pull/2479)) +- Order of if/else blocks is causing unit tests mocking XHR. ([#2201](https://github.com/axios/axios/pull/2201)) +- Add license badge ([#2446](https://github.com/axios/axios/pull/2446)) +- Fix travis CI build [#2386](https://github.com/axios/axios/pull/2386) +- Fix cancellation error on build master. #2290 #2207 ([#2407](https://github.com/axios/axios/pull/2407)) + +Documentation: + +- Fixing typo in CHANGELOG.md: s/Functionallity/Functionality ([#2639](https://github.com/axios/axios/pull/2639)) +- Fix badge, use master branch ([#2538](https://github.com/axios/axios/pull/2538)) +- Fix typo in changelog [#2193](https://github.com/axios/axios/pull/2193) +- Document fix ([#2514](https://github.com/axios/axios/pull/2514)) +- Update docs with no_proxy change, issue #2484 ([#2513](https://github.com/axios/axios/pull/2513)) +- Fixing missing words in docs template ([#2259](https://github.com/axios/axios/pull/2259)) +- 🐛Fix request finally documentation in README ([#2189](https://github.com/axios/axios/pull/2189)) +- updating spelling and adding link to docs ([#2212](https://github.com/axios/axios/pull/2212)) +- docs: minor tweak ([#2404](https://github.com/axios/axios/pull/2404)) +- Update response interceptor docs ([#2399](https://github.com/axios/axios/pull/2399)) +- Update README.md ([#2504](https://github.com/axios/axios/pull/2504)) +- Fix word 'sintaxe' to 'syntax' in README.md ([#2432](https://github.com/axios/axios/pull/2432)) +- updating README: notes on CommonJS autocomplete ([#2256](https://github.com/axios/axios/pull/2256)) +- Fix grammar in README.md ([#2271](https://github.com/axios/axios/pull/2271)) +- Doc fixes, minor examples cleanup ([#2198](https://github.com/axios/axios/pull/2198)) + +### 0.19.0 (May 30, 2019) + +Fixes and Functionality: + +- Added support for no_proxy env variable ([#1693](https://github.com/axios/axios/pull/1693/files)) - Chance Dickson +- Unzip response body only for statuses != 204 ([#1129](https://github.com/axios/axios/pull/1129)) - drawski +- Destroy stream on exceeding maxContentLength (fixes [#1098](https://github.com/axios/axios/issues/1098)) ([#1485](https://github.com/axios/axios/pull/1485)) - Gadzhi Gadzhiev +- Makes Axios error generic to use AxiosResponse ([#1738](https://github.com/axios/axios/pull/1738)) - Suman Lama +- Fixing Mocha tests by locking follow-redirects version to 1.5.10 ([#1993](https://github.com/axios/axios/pull/1993)) - grumblerchester +- Allow uppercase methods in typings. ([#1781](https://github.com/axios/axios/pull/1781)) - Ken Powers +- Fixing building url with hash mark ([#1771](https://github.com/axios/axios/pull/1771)) - Anatoly Ryabov +- This commit fix building url with hash map (fragment identifier) when parameters are present: they must not be added after `#`, because client cut everything after `#` +- Preserve HTTP method when following redirect ([#1758](https://github.com/axios/axios/pull/1758)) - Rikki Gibson +- Add `getUri` signature to TypeScript definition. ([#1736](https://github.com/axios/axios/pull/1736)) - Alexander Trauzzi +- Adding isAxiosError flag to errors thrown by axios ([#1419](https://github.com/axios/axios/pull/1419)) - Ayush Gupta + +Internal: + +- Fixing .eslintrc without extension ([#1789](https://github.com/axios/axios/pull/1789)) - Manoel +- Fix failing SauceLabs tests by updating configuration - Emily Morehouse +- Add issue templates - Emily Morehouse + +Documentation: + +- Consistent coding style in README ([#1787](https://github.com/axios/axios/pull/1787)) - Ali Servet Donmez +- Add information about auth parameter to README ([#2166](https://github.com/axios/axios/pull/2166)) - xlaguna +- Add DELETE to list of methods that allow data as a config option ([#2169](https://github.com/axios/axios/pull/2169)) - Daniela Borges Matos de Carvalho +- Update ECOSYSTEM.md - Add Axios Endpoints ([#2176](https://github.com/axios/axios/pull/2176)) - Renan +- Add r2curl in ECOSYSTEM ([#2141](https://github.com/axios/axios/pull/2141)) - 유용우 / CX +- Update README.md - Add instructions for installing with yarn ([#2036](https://github.com/axios/axios/pull/2036)) - Victor Hermes +- Fixing spacing for README.md ([#2066](https://github.com/axios/axios/pull/2066)) - Josh McCarty +- Update README.md. - Change `.then` to `.finally` in example code ([#2090](https://github.com/axios/axios/pull/2090)) - Omar Cai +- Clarify what values responseType can have in Node ([#2121](https://github.com/axios/axios/pull/2121)) - Tyler Breisacher +- docs(ECOSYSTEM): add axios-api-versioning ([#2020](https://github.com/axios/axios/pull/2020)) - Weffe +- It seems that `responseType: 'blob'` doesn't actually work in Node (when I tried using it, response.data was a string, not a Blob, since Node doesn't have Blobs), so this clarifies that this option should only be used in the browser +- Update README.md. - Add Querystring library note ([#1896](https://github.com/axios/axios/pull/1896)) - Dmitriy Eroshenko +- Add react-hooks-axios to Libraries section of ECOSYSTEM.md ([#1925](https://github.com/axios/axios/pull/1925)) - Cody Chan +- Clarify in README that default timeout is 0 (no timeout) ([#1750](https://github.com/axios/axios/pull/1750)) - Ben Standefer + +### 0.19.0-beta.1 (Aug 9, 2018) + +**NOTE:** This is a beta version of this release. There may be functionality that is broken in +certain browsers, though we suspect that builds are hanging and not erroring. See +https://saucelabs.com/u/axios for the most up-to-date information. + +New Functionality: + +- Add getUri method ([#1712](https://github.com/axios/axios/issues/1712)) +- Add support for no_proxy env variable ([#1693](https://github.com/axios/axios/issues/1693)) +- Add toJSON to decorated Axios errors to facilitate serialization ([#1625](https://github.com/axios/axios/issues/1625)) +- Add second then on axios call ([#1623](https://github.com/axios/axios/issues/1623)) +- Typings: allow custom return types +- Add option to specify character set in responses (with http adapter) + +Fixes: + +- Fix Keep defaults local to instance ([#385](https://github.com/axios/axios/issues/385)) +- Correctly catch exception in http test ([#1475](https://github.com/axios/axios/issues/1475)) +- Fix accept header normalization ([#1698](https://github.com/axios/axios/issues/1698)) +- Fix http adapter to allow HTTPS connections via HTTP ([#959](https://github.com/axios/axios/issues/959)) +- Fix Removes usage of deprecated Buffer constructor. ([#1555](https://github.com/axios/axios/issues/1555), [#1622](https://github.com/axios/axios/issues/1622)) +- Fix defaults to use httpAdapter if available ([#1285](https://github.com/axios/axios/issues/1285)) + - Fixing defaults to use httpAdapter if available + - Use a safer, cross-platform method to detect the Node environment +- Fix Reject promise if request is cancelled by the browser ([#537](https://github.com/axios/axios/issues/537)) +- [Typescript] Fix missing type parameters on delete/head methods +- [NS]: Send `false` flag isStandardBrowserEnv for Nativescript +- Fix missing type parameters on delete/head +- Fix Default method for an instance always overwritten by get +- Fix type error when socketPath option in AxiosRequestConfig +- Capture errors on request data streams +- Decorate resolve and reject to clear timeout in all cases + +Huge thanks to everyone who contributed to this release via code (authors listed +below) or via reviews and triaging on GitHub: + +- Andrew Scott +- Anthony Gauthier +- arpit +- ascott18 +- Benedikt Rötsch +- Chance Dickson +- Dave Stewart +- Deric Cain +- Guillaume Briday +- Jacob Wejendorp +- Jim Lynch +- johntron +- Justin Beckwith +- Justin Beckwith +- Khaled Garbaya +- Lim Jing Rong +- Mark van den Broek +- Martti Laine +- mattridley +- mattridley +- Nicolas Del Valle +- Nilegfx +- pbarbiero +- Rikki Gibson +- Sako Hartounian +- Shane Fitzpatrick +- Stephan Schneider +- Steven +- Tim Garthwaite +- Tim Johns +- Yutaro Miyazaki + +### 0.18.0 (Feb 19, 2018) + +- Adding support for UNIX Sockets when running with Node.js ([#1070](https://github.com/axios/axios/pull/1070)) +- Fixing typings ([#1177](https://github.com/axios/axios/pull/1177)): + - AxiosRequestConfig.proxy: allows type false + - AxiosProxyConfig: added auth field +- Adding function signature in AxiosInstance interface so AxiosInstance can be invoked ([#1192](https://github.com/axios/axios/pull/1192), [#1254](https://github.com/axios/axios/pull/1254)) +- Allowing maxContentLength to pass through to redirected calls as maxBodyLength in follow-redirects config ([#1287](https://github.com/axios/axios/pull/1287)) +- Fixing configuration when using an instance - method can now be set ([#1342](https://github.com/axios/axios/pull/1342)) + +### 0.17.1 (Nov 11, 2017) + +- Fixing issue with web workers ([#1160](https://github.com/axios/axios/pull/1160)) +- Allowing overriding transport ([#1080](https://github.com/axios/axios/pull/1080)) +- Updating TypeScript typings ([#1165](https://github.com/axios/axios/pull/1165), [#1125](https://github.com/axios/axios/pull/1125), [#1131](https://github.com/axios/axios/pull/1131)) + +### 0.17.0 (Oct 21, 2017) + +- **BREAKING** Fixing issue with `baseURL` and interceptors ([#950](https://github.com/axios/axios/pull/950)) +- **BREAKING** Improving handing of duplicate headers ([#874](https://github.com/axios/axios/pull/874)) +- Adding support for disabling proxies ([#691](https://github.com/axios/axios/pull/691)) +- Updating TypeScript typings with generic type parameters ([#1061](https://github.com/axios/axios/pull/1061)) + +### 0.16.2 (Jun 3, 2017) + +- Fixing issue with including `buffer` in bundle ([#887](https://github.com/axios/axios/pull/887)) +- Including underlying request in errors ([#830](https://github.com/axios/axios/pull/830)) +- Convert `method` to lowercase ([#930](https://github.com/axios/axios/pull/930)) + +### 0.16.1 (Apr 8, 2017) + +- Improving HTTP adapter to return last request in case of redirects ([#828](https://github.com/axios/axios/pull/828)) +- Updating `follow-redirects` dependency ([#829](https://github.com/axios/axios/pull/829)) +- Adding support for passing `Buffer` in node ([#773](https://github.com/axios/axios/pull/773)) + +### 0.16.0 (Mar 31, 2017) + +- **BREAKING** Removing `Promise` from axios typings in favor of built-in type declarations ([#480](https://github.com/axios/axios/issues/480)) +- Adding `options` shortcut method ([#461](https://github.com/axios/axios/pull/461)) +- Fixing issue with using `responseType: 'json'` in browsers incompatible with XHR Level 2 ([#654](https://github.com/axios/axios/pull/654)) +- Improving React Native detection ([#731](https://github.com/axios/axios/pull/731)) +- Fixing `combineURLs` to support empty `relativeURL` ([#581](https://github.com/axios/axios/pull/581)) +- Removing `PROTECTION_PREFIX` support ([#561](https://github.com/axios/axios/pull/561)) + +### 0.15.3 (Nov 27, 2016) + +- Fixing issue with custom instances and global defaults ([#443](https://github.com/axios/axios/issues/443)) +- Renaming `axios.d.ts` to `index.d.ts` ([#519](https://github.com/axios/axios/issues/519)) +- Adding `get`, `head`, and `delete` to `defaults.headers` ([#509](https://github.com/axios/axios/issues/509)) +- Fixing issue with `btoa` and IE ([#507](https://github.com/axios/axios/issues/507)) +- Adding support for proxy authentication ([#483](https://github.com/axios/axios/pull/483)) +- Improving HTTP adapter to use `http` protocol by default ([#493](https://github.com/axios/axios/pull/493)) +- Fixing proxy issues ([#491](https://github.com/axios/axios/pull/491)) + +### 0.15.2 (Oct 17, 2016) + +- Fixing issue with calling `cancel` after response has been received ([#482](https://github.com/axios/axios/issues/482)) + +### 0.15.1 (Oct 14, 2016) + +- Fixing issue with UMD ([#485](https://github.com/axios/axios/issues/485)) + +### 0.15.0 (Oct 10, 2016) + +- Adding cancellation support ([#452](https://github.com/axios/axios/pull/452)) +- Moving default adapter to global defaults ([#437](https://github.com/axios/axios/pull/437)) +- Fixing issue with `file` URI scheme ([#440](https://github.com/axios/axios/pull/440)) +- Fixing issue with `params` objects that have no prototype ([#445](https://github.com/axios/axios/pull/445)) + +### 0.14.0 (Aug 27, 2016) + +- **BREAKING** Updating TypeScript definitions ([#419](https://github.com/axios/axios/pull/419)) +- **BREAKING** Replacing `agent` option with `httpAgent` and `httpsAgent` ([#387](https://github.com/axios/axios/pull/387)) +- **BREAKING** Splitting `progress` event handlers into `onUploadProgress` and `onDownloadProgress` ([#423](https://github.com/axios/axios/pull/423)) +- Adding support for `http_proxy` and `https_proxy` environment variables ([#366](https://github.com/axios/axios/pull/366)) +- Fixing issue with `auth` config option and `Authorization` header ([#397](https://github.com/axios/axios/pull/397)) +- Don't set XSRF header if `xsrfCookieName` is `null` ([#406](https://github.com/axios/axios/pull/406)) + +### 0.13.1 (Jul 16, 2016) + +- Fixing issue with response data not being transformed on error ([#378](https://github.com/axios/axios/issues/378)) + +### 0.13.0 (Jul 13, 2016) + +- **BREAKING** Improved error handling ([#345](https://github.com/axios/axios/pull/345)) +- **BREAKING** Response transformer now invoked in dispatcher not adapter ([10eb238](https://github.com/axios/axios/commit/10eb23865101f9347570552c04e9d6211376e25e)) +- **BREAKING** Request adapters now return a `Promise` ([157efd5](https://github.com/axios/axios/commit/157efd5615890301824e3121cc6c9d2f9b21f94a)) +- Fixing issue with `withCredentials` not being overwritten ([#343](https://github.com/axios/axios/issues/343)) +- Fixing regression with request transformer being called before request interceptor ([#352](https://github.com/axios/axios/issues/352)) +- Fixing custom instance defaults ([#341](https://github.com/axios/axios/issues/341)) +- Fixing instances created from `axios.create` to have same API as default axios ([#217](https://github.com/axios/axios/issues/217)) + +### 0.12.0 (May 31, 2016) + +- Adding support for `URLSearchParams` ([#317](https://github.com/axios/axios/pull/317)) +- Adding `maxRedirects` option ([#307](https://github.com/axios/axios/pull/307)) + +### 0.11.1 (May 17, 2016) + +- Fixing IE CORS support ([#313](https://github.com/axios/axios/pull/313)) +- Fixing detection of `FormData` ([#325](https://github.com/axios/axios/pull/325)) +- Adding `Axios` class to exports ([#321](https://github.com/axios/axios/pull/321)) + +### 0.11.0 (Apr 26, 2016) + +- Adding support for Stream with HTTP adapter ([#296](https://github.com/axios/axios/pull/296)) +- Adding support for custom HTTP status code error ranges ([#308](https://github.com/axios/axios/pull/308)) +- Fixing issue with ArrayBuffer ([#299](https://github.com/axios/axios/pull/299)) + +### 0.10.0 (Apr 20, 2016) + +- Fixing issue with some requests sending `undefined` instead of `null` ([#250](https://github.com/axios/axios/pull/250)) +- Fixing basic auth for HTTP adapter ([#252](https://github.com/axios/axios/pull/252)) +- Fixing request timeout for XHR adapter ([#227](https://github.com/axios/axios/pull/227)) +- Fixing IE8 support by using `onreadystatechange` instead of `onload` ([#249](https://github.com/axios/axios/pull/249)) +- Fixing IE9 cross domain requests ([#251](https://github.com/axios/axios/pull/251)) +- Adding `maxContentLength` option ([#275](https://github.com/axios/axios/pull/275)) +- Fixing XHR support for WebWorker environment ([#279](https://github.com/axios/axios/pull/279)) +- Adding request instance to response ([#200](https://github.com/axios/axios/pull/200)) + +### 0.9.1 (Jan 24, 2016) + +- Improving handling of request timeout in node ([#124](https://github.com/axios/axios/issues/124)) +- Fixing network errors not rejecting ([#205](https://github.com/axios/axios/pull/205)) +- Fixing issue with IE rejecting on HTTP 204 ([#201](https://github.com/axios/axios/issues/201)) +- Fixing host/port when following redirects ([#198](https://github.com/axios/axios/pull/198)) + +### 0.9.0 (Jan 18, 2016) + +- Adding support for custom adapters +- Fixing Content-Type header being removed when data is false ([#195](https://github.com/axios/axios/pull/195)) +- Improving XDomainRequest implementation ([#185](https://github.com/axios/axios/pull/185)) +- Improving config merging and order of precedence ([#183](https://github.com/axios/axios/pull/183)) +- Fixing XDomainRequest support for only <= IE9 ([#182](https://github.com/axios/axios/pull/182)) + +### 0.8.1 (Dec 14, 2015) + +- Adding support for passing XSRF token for cross domain requests when using `withCredentials` ([#168](https://github.com/axios/axios/pull/168)) +- Fixing error with format of basic auth header ([#178](https://github.com/axios/axios/pull/173)) +- Fixing error with JSON payloads throwing `InvalidStateError` in some cases ([#174](https://github.com/axios/axios/pull/174)) + +### 0.8.0 (Dec 11, 2015) + +- Adding support for creating instances of axios ([#123](https://github.com/axios/axios/pull/123)) +- Fixing http adapter to use `Buffer` instead of `String` in case of `responseType === 'arraybuffer'` ([#128](https://github.com/axios/axios/pull/128)) +- Adding support for using custom parameter serializer with `paramsSerializer` option ([#121](https://github.com/axios/axios/pull/121)) +- Fixing issue in IE8 caused by `forEach` on `arguments` ([#127](https://github.com/axios/axios/pull/127)) +- Adding support for following redirects in node ([#146](https://github.com/axios/axios/pull/146)) +- Adding support for transparent decompression if `content-encoding` is set ([#149](https://github.com/axios/axios/pull/149)) +- Adding support for transparent XDomainRequest to handle cross domain requests in IE9 ([#140](https://github.com/axios/axios/pull/140)) +- Adding support for HTTP basic auth via Authorization header ([#167](https://github.com/axios/axios/pull/167)) +- Adding support for baseURL option ([#160](https://github.com/axios/axios/pull/160)) + +### 0.7.0 (Sep 29, 2015) + +- Fixing issue with minified bundle in IE8 ([#87](https://github.com/axios/axios/pull/87)) +- Adding support for passing agent in node ([#102](https://github.com/axios/axios/pull/102)) +- Adding support for returning result from `axios.spread` for chaining ([#106](https://github.com/axios/axios/pull/106)) +- Fixing typescript definition ([#105](https://github.com/axios/axios/pull/105)) +- Fixing default timeout config for node ([#112](https://github.com/axios/axios/pull/112)) +- Adding support for use in web workers, and react-native ([#70](https://github.com/axios/axios/issue/70)), ([#98](https://github.com/axios/axios/pull/98)) +- Adding support for fetch like API `axios(url[, config])` ([#116](https://github.com/axios/axios/issues/116)) + +### 0.6.0 (Sep 21, 2015) + +- Removing deprecated success/error aliases +- Fixing issue with array params not being properly encoded ([#49](https://github.com/axios/axios/pull/49)) +- Fixing issue with User-Agent getting overridden ([#69](https://github.com/axios/axios/issues/69)) +- Adding support for timeout config ([#56](https://github.com/axios/axios/issues/56)) +- Removing es6-promise dependency +- Fixing issue preventing `length` to be used as a parameter ([#91](https://github.com/axios/axios/pull/91)) +- Fixing issue with IE8 ([#85](https://github.com/axios/axios/pull/85)) +- Converting build to UMD + +### 0.5.4 (Apr 08, 2015) + +- Fixing issue with FormData not being sent ([#53](https://github.com/axios/axios/issues/53)) + +### 0.5.3 (Apr 07, 2015) + +- Using JSON.parse unconditionally when transforming response string ([#55](https://github.com/axios/axios/issues/55)) + +### 0.5.2 (Mar 13, 2015) + +- Adding support for `statusText` in response ([#46](https://github.com/axios/axios/issues/46)) + +### 0.5.1 (Mar 10, 2015) + +- Fixing issue using strict mode ([#45](https://github.com/axios/axios/issues/45)) +- Fixing issue with standalone build ([#47](https://github.com/axios/axios/issues/47)) + +### 0.5.0 (Jan 23, 2015) + +- Adding support for intercepetors ([#14](https://github.com/axios/axios/issues/14)) +- Updating es6-promise dependency + +### 0.4.2 (Dec 10, 2014) + +- Fixing issue with `Content-Type` when using `FormData` ([#22](https://github.com/axios/axios/issues/22)) +- Adding support for TypeScript ([#25](https://github.com/axios/axios/issues/25)) +- Fixing issue with standalone build ([#29](https://github.com/axios/axios/issues/29)) +- Fixing issue with verbs needing to be capitalized in some browsers ([#30](https://github.com/axios/axios/issues/30)) + +### 0.4.1 (Oct 15, 2014) + +- Adding error handling to request for node.js ([#18](https://github.com/axios/axios/issues/18)) + +### 0.4.0 (Oct 03, 2014) + +- Adding support for `ArrayBuffer` and `ArrayBufferView` ([#10](https://github.com/axios/axios/issues/10)) +- Adding support for utf-8 for node.js ([#13](https://github.com/axios/axios/issues/13)) +- Adding support for SSL for node.js ([#12](https://github.com/axios/axios/issues/12)) +- Fixing incorrect `Content-Type` header ([#9](https://github.com/axios/axios/issues/9)) +- Adding standalone build without bundled es6-promise ([#11](https://github.com/axios/axios/issues/11)) +- Deprecating `success`/`error` in favor of `then`/`catch` + +### 0.3.1 (Sep 16, 2014) + +- Fixing missing post body when using node.js ([#3](https://github.com/axios/axios/issues/3)) + +### 0.3.0 (Sep 16, 2014) + +- Fixing `success` and `error` to properly receive response data as individual arguments ([#8](https://github.com/axios/axios/issues/8)) +- Updating `then` and `catch` to receive response data as a single object ([#6](https://github.com/axios/axios/issues/6)) +- Fixing issue with `all` not working ([#7](https://github.com/axios/axios/issues/7)) + +### 0.2.2 (Sep 14, 2014) + +- Fixing bundling with browserify ([#4](https://github.com/axios/axios/issues/4)) + +### 0.2.1 (Sep 12, 2014) + +- Fixing build problem causing ridiculous file sizes + +### 0.2.0 (Sep 12, 2014) + +- Adding support for `all` and `spread` +- Adding support for node.js ([#1](https://github.com/axios/axios/issues/1)) + +### 0.1.0 (Aug 29, 2014) + +- Initial release diff --git a/node_modules/hxz-api/node_modules/axios/LICENSE b/node_modules/hxz-api/node_modules/axios/LICENSE new file mode 100644 index 000000000..d36c80ef2 --- /dev/null +++ b/node_modules/hxz-api/node_modules/axios/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2014-present Matt Zabriskie + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/hxz-api/node_modules/axios/README.md b/node_modules/hxz-api/node_modules/axios/README.md new file mode 100644 index 000000000..b8c019a78 --- /dev/null +++ b/node_modules/hxz-api/node_modules/axios/README.md @@ -0,0 +1,868 @@ +# axios + +[![npm version](https://img.shields.io/npm/v/axios.svg?style=flat-square)](https://www.npmjs.org/package/axios) +[![CDNJS](https://img.shields.io/cdnjs/v/axios.svg?style=flat-square)](https://cdnjs.com/libraries/axios) +![Build status](https://github.com/axios/axios/actions/workflows/ci.yml/badge.svg) +[![Gitpod Ready-to-Code](https://img.shields.io/badge/Gitpod-Ready--to--Code-blue?logo=gitpod)](https://gitpod.io/#https://github.com/axios/axios) +[![code coverage](https://img.shields.io/coveralls/mzabriskie/axios.svg?style=flat-square)](https://coveralls.io/r/mzabriskie/axios) +[![install size](https://packagephobia.now.sh/badge?p=axios)](https://packagephobia.now.sh/result?p=axios) +[![npm downloads](https://img.shields.io/npm/dm/axios.svg?style=flat-square)](http://npm-stat.com/charts.html?package=axios) +[![gitter chat](https://img.shields.io/gitter/room/mzabriskie/axios.svg?style=flat-square)](https://gitter.im/mzabriskie/axios) +[![code helpers](https://www.codetriage.com/axios/axios/badges/users.svg)](https://www.codetriage.com/axios/axios) + +Promise based HTTP client for the browser and node.js + +> New axios docs website: [click here](https://axios-http.com/) + +## Table of Contents + + - [Features](#features) + - [Browser Support](#browser-support) + - [Installing](#installing) + - [Example](#example) + - [Axios API](#axios-api) + - [Request method aliases](#request-method-aliases) + - [Concurrency (Deprecated)](#concurrency-deprecated) + - [Creating an instance](#creating-an-instance) + - [Instance methods](#instance-methods) + - [Request Config](#request-config) + - [Response Schema](#response-schema) + - [Config Defaults](#config-defaults) + - [Global axios defaults](#global-axios-defaults) + - [Custom instance defaults](#custom-instance-defaults) + - [Config order of precedence](#config-order-of-precedence) + - [Interceptors](#interceptors) + - [Handling Errors](#handling-errors) + - [Cancellation](#cancellation) + - [Using application/x-www-form-urlencoded format](#using-applicationx-www-form-urlencoded-format) + - [Browser](#browser) + - [Node.js](#nodejs) + - [Query string](#query-string) + - [Form data](#form-data) + - [Semver](#semver) + - [Promises](#promises) + - [TypeScript](#typescript) + - [Resources](#resources) + - [Credits](#credits) + - [License](#license) + +## Features + +- Make [XMLHttpRequests](https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest) from the browser +- Make [http](http://nodejs.org/api/http.html) requests from node.js +- Supports the [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) API +- Intercept request and response +- Transform request and response data +- Cancel requests +- Automatic transforms for JSON data +- Client side support for protecting against [XSRF](http://en.wikipedia.org/wiki/Cross-site_request_forgery) + +## Browser Support + +![Chrome](https://raw.github.com/alrra/browser-logos/master/src/chrome/chrome_48x48.png) | ![Firefox](https://raw.github.com/alrra/browser-logos/master/src/firefox/firefox_48x48.png) | ![Safari](https://raw.github.com/alrra/browser-logos/master/src/safari/safari_48x48.png) | ![Opera](https://raw.github.com/alrra/browser-logos/master/src/opera/opera_48x48.png) | ![Edge](https://raw.github.com/alrra/browser-logos/master/src/edge/edge_48x48.png) | ![IE](https://raw.github.com/alrra/browser-logos/master/src/archive/internet-explorer_9-11/internet-explorer_9-11_48x48.png) | +--- | --- | --- | --- | --- | --- | +Latest ✔ | Latest ✔ | Latest ✔ | Latest ✔ | Latest ✔ | 11 ✔ | + +[![Browser Matrix](https://saucelabs.com/open_sauce/build_matrix/axios.svg)](https://saucelabs.com/u/axios) + +## Installing + +Using npm: + +```bash +$ npm install axios +``` + +Using bower: + +```bash +$ bower install axios +``` + +Using yarn: + +```bash +$ yarn add axios +``` + +Using jsDelivr CDN: + +```html + +``` + +Using unpkg CDN: + +```html + +``` + +## Example + +### note: CommonJS usage +In order to gain the TypeScript typings (for intellisense / autocomplete) while using CommonJS imports with `require()` use the following approach: + +```js +const axios = require('axios').default; + +// axios. will now provide autocomplete and parameter typings +``` + +Performing a `GET` request + +```js +const axios = require('axios'); + +// Make a request for a user with a given ID +axios.get('/user?ID=12345') + .then(function (response) { + // handle success + console.log(response); + }) + .catch(function (error) { + // handle error + console.log(error); + }) + .then(function () { + // always executed + }); + +// Optionally the request above could also be done as +axios.get('/user', { + params: { + ID: 12345 + } + }) + .then(function (response) { + console.log(response); + }) + .catch(function (error) { + console.log(error); + }) + .then(function () { + // always executed + }); + +// Want to use async/await? Add the `async` keyword to your outer function/method. +async function getUser() { + try { + const response = await axios.get('/user?ID=12345'); + console.log(response); + } catch (error) { + console.error(error); + } +} +``` + +> **NOTE:** `async/await` is part of ECMAScript 2017 and is not supported in Internet +> Explorer and older browsers, so use with caution. + +Performing a `POST` request + +```js +axios.post('/user', { + firstName: 'Fred', + lastName: 'Flintstone' + }) + .then(function (response) { + console.log(response); + }) + .catch(function (error) { + console.log(error); + }); +``` + +Performing multiple concurrent requests + +```js +function getUserAccount() { + return axios.get('/user/12345'); +} + +function getUserPermissions() { + return axios.get('/user/12345/permissions'); +} + +Promise.all([getUserAccount(), getUserPermissions()]) + .then(function (results) { + const acct = results[0]; + const perm = results[1]; + }); +``` + +## axios API + +Requests can be made by passing the relevant config to `axios`. + +##### axios(config) + +```js +// Send a POST request +axios({ + method: 'post', + url: '/user/12345', + data: { + firstName: 'Fred', + lastName: 'Flintstone' + } +}); +``` + +```js +// GET request for remote image in node.js +axios({ + method: 'get', + url: 'http://bit.ly/2mTM3nY', + responseType: 'stream' +}) + .then(function (response) { + response.data.pipe(fs.createWriteStream('ada_lovelace.jpg')) + }); +``` + +##### axios(url[, config]) + +```js +// Send a GET request (default method) +axios('/user/12345'); +``` + +### Request method aliases + +For convenience aliases have been provided for all supported request methods. + +##### axios.request(config) +##### axios.get(url[, config]) +##### axios.delete(url[, config]) +##### axios.head(url[, config]) +##### axios.options(url[, config]) +##### axios.post(url[, data[, config]]) +##### axios.put(url[, data[, config]]) +##### axios.patch(url[, data[, config]]) + +###### NOTE +When using the alias methods `url`, `method`, and `data` properties don't need to be specified in config. + +### Concurrency (Deprecated) +Please use `Promise.all` to replace the below functions. + +Helper functions for dealing with concurrent requests. + +axios.all(iterable) +axios.spread(callback) + +### Creating an instance + +You can create a new instance of axios with a custom config. + +##### axios.create([config]) + +```js +const instance = axios.create({ + baseURL: 'https://some-domain.com/api/', + timeout: 1000, + headers: {'X-Custom-Header': 'foobar'} +}); +``` + +### Instance methods + +The available instance methods are listed below. The specified config will be merged with the instance config. + +##### axios#request(config) +##### axios#get(url[, config]) +##### axios#delete(url[, config]) +##### axios#head(url[, config]) +##### axios#options(url[, config]) +##### axios#post(url[, data[, config]]) +##### axios#put(url[, data[, config]]) +##### axios#patch(url[, data[, config]]) +##### axios#getUri([config]) + +## Request Config + +These are the available config options for making requests. Only the `url` is required. Requests will default to `GET` if `method` is not specified. + +```js +{ + // `url` is the server URL that will be used for the request + url: '/user', + + // `method` is the request method to be used when making the request + method: 'get', // default + + // `baseURL` will be prepended to `url` unless `url` is absolute. + // It can be convenient to set `baseURL` for an instance of axios to pass relative URLs + // to methods of that instance. + baseURL: 'https://some-domain.com/api/', + + // `transformRequest` allows changes to the request data before it is sent to the server + // This is only applicable for request methods 'PUT', 'POST', 'PATCH' and 'DELETE' + // The last function in the array must return a string or an instance of Buffer, ArrayBuffer, + // FormData or Stream + // You may modify the headers object. + transformRequest: [function (data, headers) { + // Do whatever you want to transform the data + + return data; + }], + + // `transformResponse` allows changes to the response data to be made before + // it is passed to then/catch + transformResponse: [function (data) { + // Do whatever you want to transform the data + + return data; + }], + + // `headers` are custom headers to be sent + headers: {'X-Requested-With': 'XMLHttpRequest'}, + + // `params` are the URL parameters to be sent with the request + // Must be a plain object or a URLSearchParams object + params: { + ID: 12345 + }, + + // `paramsSerializer` is an optional function in charge of serializing `params` + // (e.g. https://www.npmjs.com/package/qs, http://api.jquery.com/jquery.param/) + paramsSerializer: function (params) { + return Qs.stringify(params, {arrayFormat: 'brackets'}) + }, + + // `data` is the data to be sent as the request body + // Only applicable for request methods 'PUT', 'POST', 'DELETE , and 'PATCH' + // When no `transformRequest` is set, must be of one of the following types: + // - string, plain object, ArrayBuffer, ArrayBufferView, URLSearchParams + // - Browser only: FormData, File, Blob + // - Node only: Stream, Buffer + data: { + firstName: 'Fred' + }, + + // syntax alternative to send data into the body + // method post + // only the value is sent, not the key + data: 'Country=Brasil&City=Belo Horizonte', + + // `timeout` specifies the number of milliseconds before the request times out. + // If the request takes longer than `timeout`, the request will be aborted. + timeout: 1000, // default is `0` (no timeout) + + // `withCredentials` indicates whether or not cross-site Access-Control requests + // should be made using credentials + withCredentials: false, // default + + // `adapter` allows custom handling of requests which makes testing easier. + // Return a promise and supply a valid response (see lib/adapters/README.md). + adapter: function (config) { + /* ... */ + }, + + // `auth` indicates that HTTP Basic auth should be used, and supplies credentials. + // This will set an `Authorization` header, overwriting any existing + // `Authorization` custom headers you have set using `headers`. + // Please note that only HTTP Basic auth is configurable through this parameter. + // For Bearer tokens and such, use `Authorization` custom headers instead. + auth: { + username: 'janedoe', + password: 's00pers3cret' + }, + + // `responseType` indicates the type of data that the server will respond with + // options are: 'arraybuffer', 'document', 'json', 'text', 'stream' + // browser only: 'blob' + responseType: 'json', // default + + // `responseEncoding` indicates encoding to use for decoding responses (Node.js only) + // Note: Ignored for `responseType` of 'stream' or client-side requests + responseEncoding: 'utf8', // default + + // `xsrfCookieName` is the name of the cookie to use as a value for xsrf token + xsrfCookieName: 'XSRF-TOKEN', // default + + // `xsrfHeaderName` is the name of the http header that carries the xsrf token value + xsrfHeaderName: 'X-XSRF-TOKEN', // default + + // `onUploadProgress` allows handling of progress events for uploads + // browser only + onUploadProgress: function (progressEvent) { + // Do whatever you want with the native progress event + }, + + // `onDownloadProgress` allows handling of progress events for downloads + // browser only + onDownloadProgress: function (progressEvent) { + // Do whatever you want with the native progress event + }, + + // `maxContentLength` defines the max size of the http response content in bytes allowed in node.js + maxContentLength: 2000, + + // `maxBodyLength` (Node only option) defines the max size of the http request content in bytes allowed + maxBodyLength: 2000, + + // `validateStatus` defines whether to resolve or reject the promise for a given + // HTTP response status code. If `validateStatus` returns `true` (or is set to `null` + // or `undefined`), the promise will be resolved; otherwise, the promise will be + // rejected. + validateStatus: function (status) { + return status >= 200 && status < 300; // default + }, + + // `maxRedirects` defines the maximum number of redirects to follow in node.js. + // If set to 0, no redirects will be followed. + maxRedirects: 5, // default + + // `socketPath` defines a UNIX Socket to be used in node.js. + // e.g. '/var/run/docker.sock' to send requests to the docker daemon. + // Only either `socketPath` or `proxy` can be specified. + // If both are specified, `socketPath` is used. + socketPath: null, // default + + // `httpAgent` and `httpsAgent` define a custom agent to be used when performing http + // and https requests, respectively, in node.js. This allows options to be added like + // `keepAlive` that are not enabled by default. + httpAgent: new http.Agent({ keepAlive: true }), + httpsAgent: new https.Agent({ keepAlive: true }), + + // `proxy` defines the hostname, port, and protocol of the proxy server. + // You can also define your proxy using the conventional `http_proxy` and + // `https_proxy` environment variables. If you are using environment variables + // for your proxy configuration, you can also define a `no_proxy` environment + // variable as a comma-separated list of domains that should not be proxied. + // Use `false` to disable proxies, ignoring environment variables. + // `auth` indicates that HTTP Basic auth should be used to connect to the proxy, and + // supplies credentials. + // This will set an `Proxy-Authorization` header, overwriting any existing + // `Proxy-Authorization` custom headers you have set using `headers`. + // If the proxy server uses HTTPS, then you must set the protocol to `https`. + proxy: { + protocol: 'https', + host: '127.0.0.1', + port: 9000, + auth: { + username: 'mikeymike', + password: 'rapunz3l' + } + }, + + // `cancelToken` specifies a cancel token that can be used to cancel the request + // (see Cancellation section below for details) + cancelToken: new CancelToken(function (cancel) { + }), + + // `decompress` indicates whether or not the response body should be decompressed + // automatically. If set to `true` will also remove the 'content-encoding' header + // from the responses objects of all decompressed responses + // - Node only (XHR cannot turn off decompression) + decompress: true, // default + + // transitional options for backward compatibility that may be removed in the newer versions + transitional: { + // silent JSON parsing mode + // `true` - ignore JSON parsing errors and set response.data to null if parsing failed (old behaviour) + // `false` - throw SyntaxError if JSON parsing failed (Note: responseType must be set to 'json') + silentJSONParsing: true, // default value for the current Axios version + + // try to parse the response string as JSON even if `responseType` is not 'json' + forcedJSONParsing: true, + + // throw ETIMEDOUT error instead of generic ECONNABORTED on request timeouts + clarifyTimeoutError: false, + } +} +``` + +## Response Schema + +The response for a request contains the following information. + +```js +{ + // `data` is the response that was provided by the server + data: {}, + + // `status` is the HTTP status code from the server response + status: 200, + + // `statusText` is the HTTP status message from the server response + statusText: 'OK', + + // `headers` the HTTP headers that the server responded with + // All header names are lower cased and can be accessed using the bracket notation. + // Example: `response.headers['content-type']` + headers: {}, + + // `config` is the config that was provided to `axios` for the request + config: {}, + + // `request` is the request that generated this response + // It is the last ClientRequest instance in node.js (in redirects) + // and an XMLHttpRequest instance in the browser + request: {} +} +``` + +When using `then`, you will receive the response as follows: + +```js +axios.get('/user/12345') + .then(function (response) { + console.log(response.data); + console.log(response.status); + console.log(response.statusText); + console.log(response.headers); + console.log(response.config); + }); +``` + +When using `catch`, or passing a [rejection callback](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/then) as second parameter of `then`, the response will be available through the `error` object as explained in the [Handling Errors](#handling-errors) section. + +## Config Defaults + +You can specify config defaults that will be applied to every request. + +### Global axios defaults + +```js +axios.defaults.baseURL = 'https://api.example.com'; + +// Important: If axios is used with multiple domains, the AUTH_TOKEN will be sent to all of them. +// See below for an example using Custom instance defaults instead. +axios.defaults.headers.common['Authorization'] = AUTH_TOKEN; + +axios.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded'; +``` + +### Custom instance defaults + +```js +// Set config defaults when creating the instance +const instance = axios.create({ + baseURL: 'https://api.example.com' +}); + +// Alter defaults after instance has been created +instance.defaults.headers.common['Authorization'] = AUTH_TOKEN; +``` + +### Config order of precedence + +Config will be merged with an order of precedence. The order is library defaults found in [lib/defaults.js](https://github.com/axios/axios/blob/master/lib/defaults.js#L28), then `defaults` property of the instance, and finally `config` argument for the request. The latter will take precedence over the former. Here's an example. + +```js +// Create an instance using the config defaults provided by the library +// At this point the timeout config value is `0` as is the default for the library +const instance = axios.create(); + +// Override timeout default for the library +// Now all requests using this instance will wait 2.5 seconds before timing out +instance.defaults.timeout = 2500; + +// Override timeout for this request as it's known to take a long time +instance.get('/longRequest', { + timeout: 5000 +}); +``` + +## Interceptors + +You can intercept requests or responses before they are handled by `then` or `catch`. + +```js +// Add a request interceptor +axios.interceptors.request.use(function (config) { + // Do something before request is sent + return config; + }, function (error) { + // Do something with request error + return Promise.reject(error); + }); + +// Add a response interceptor +axios.interceptors.response.use(function (response) { + // Any status code that lie within the range of 2xx cause this function to trigger + // Do something with response data + return response; + }, function (error) { + // Any status codes that falls outside the range of 2xx cause this function to trigger + // Do something with response error + return Promise.reject(error); + }); +``` + +If you need to remove an interceptor later you can. + +```js +const myInterceptor = axios.interceptors.request.use(function () {/*...*/}); +axios.interceptors.request.eject(myInterceptor); +``` + +You can add interceptors to a custom instance of axios. + +```js +const instance = axios.create(); +instance.interceptors.request.use(function () {/*...*/}); +``` + +When you add request interceptors, they are presumed to be asynchronous by default. This can cause a delay +in the execution of your axios request when the main thread is blocked (a promise is created under the hood for +the interceptor and your request gets put on the bottom of the call stack). If your request interceptors are synchronous you can add a flag +to the options object that will tell axios to run the code synchronously and avoid any delays in request execution. + +```js +axios.interceptors.request.use(function (config) { + config.headers.test = 'I am only a header!'; + return config; +}, null, { synchronous: true }); +``` + +If you want to execute a particular interceptor based on a runtime check, +you can add a `runWhen` function to the options object. The interceptor will not be executed **if and only if** the return +of `runWhen` is `false`. The function will be called with the config +object (don't forget that you can bind your own arguments to it as well.) This can be handy when you have an +asynchronous request interceptor that only needs to run at certain times. + +```js +function onGetCall(config) { + return config.method === 'get'; +} +axios.interceptors.request.use(function (config) { + config.headers.test = 'special get headers'; + return config; +}, null, { runWhen: onGetCall }); +``` + +## Handling Errors + +```js +axios.get('/user/12345') + .catch(function (error) { + if (error.response) { + // The request was made and the server responded with a status code + // that falls out of the range of 2xx + console.log(error.response.data); + console.log(error.response.status); + console.log(error.response.headers); + } else if (error.request) { + // The request was made but no response was received + // `error.request` is an instance of XMLHttpRequest in the browser and an instance of + // http.ClientRequest in node.js + console.log(error.request); + } else { + // Something happened in setting up the request that triggered an Error + console.log('Error', error.message); + } + console.log(error.config); + }); +``` + +Using the `validateStatus` config option, you can define HTTP code(s) that should throw an error. + +```js +axios.get('/user/12345', { + validateStatus: function (status) { + return status < 500; // Resolve only if the status code is less than 500 + } +}) +``` + +Using `toJSON` you get an object with more information about the HTTP error. + +```js +axios.get('/user/12345') + .catch(function (error) { + console.log(error.toJSON()); + }); +``` + +## Cancellation + +You can cancel a request using a *cancel token*. + +> The axios cancel token API is based on the withdrawn [cancelable promises proposal](https://github.com/tc39/proposal-cancelable-promises). + +You can create a cancel token using the `CancelToken.source` factory as shown below: + +```js +const CancelToken = axios.CancelToken; +const source = CancelToken.source(); + +axios.get('/user/12345', { + cancelToken: source.token +}).catch(function (thrown) { + if (axios.isCancel(thrown)) { + console.log('Request canceled', thrown.message); + } else { + // handle error + } +}); + +axios.post('/user/12345', { + name: 'new name' +}, { + cancelToken: source.token +}) + +// cancel the request (the message parameter is optional) +source.cancel('Operation canceled by the user.'); +``` + +You can also create a cancel token by passing an executor function to the `CancelToken` constructor: + +```js +const CancelToken = axios.CancelToken; +let cancel; + +axios.get('/user/12345', { + cancelToken: new CancelToken(function executor(c) { + // An executor function receives a cancel function as a parameter + cancel = c; + }) +}); + +// cancel the request +cancel(); +``` + +> Note: you can cancel several requests with the same cancel token. +> If a cancellation token is already cancelled at the moment of starting an Axios request, then the request is cancelled immediately, without any attempts to make real request. + +## Using application/x-www-form-urlencoded format + +By default, axios serializes JavaScript objects to `JSON`. To send data in the `application/x-www-form-urlencoded` format instead, you can use one of the following options. + +### Browser + +In a browser, you can use the [`URLSearchParams`](https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams) API as follows: + +```js +const params = new URLSearchParams(); +params.append('param1', 'value1'); +params.append('param2', 'value2'); +axios.post('/foo', params); +``` + +> Note that `URLSearchParams` is not supported by all browsers (see [caniuse.com](http://www.caniuse.com/#feat=urlsearchparams)), but there is a [polyfill](https://github.com/WebReflection/url-search-params) available (make sure to polyfill the global environment). + +Alternatively, you can encode data using the [`qs`](https://github.com/ljharb/qs) library: + +```js +const qs = require('qs'); +axios.post('/foo', qs.stringify({ 'bar': 123 })); +``` + +Or in another way (ES6), + +```js +import qs from 'qs'; +const data = { 'bar': 123 }; +const options = { + method: 'POST', + headers: { 'content-type': 'application/x-www-form-urlencoded' }, + data: qs.stringify(data), + url, +}; +axios(options); +``` + +### Node.js + +#### Query string + +In node.js, you can use the [`querystring`](https://nodejs.org/api/querystring.html) module as follows: + +```js +const querystring = require('querystring'); +axios.post('http://something.com/', querystring.stringify({ foo: 'bar' })); +``` + +or ['URLSearchParams'](https://nodejs.org/api/url.html#url_class_urlsearchparams) from ['url module'](https://nodejs.org/api/url.html) as follows: + +```js +const url = require('url'); +const params = new url.URLSearchParams({ foo: 'bar' }); +axios.post('http://something.com/', params.toString()); +``` + +You can also use the [`qs`](https://github.com/ljharb/qs) library. + +###### NOTE +The `qs` library is preferable if you need to stringify nested objects, as the `querystring` method has known issues with that use case (https://github.com/nodejs/node-v0.x-archive/issues/1665). + +#### Form data + +In node.js, you can use the [`form-data`](https://github.com/form-data/form-data) library as follows: + +```js +const FormData = require('form-data'); + +const form = new FormData(); +form.append('my_field', 'my value'); +form.append('my_buffer', new Buffer(10)); +form.append('my_file', fs.createReadStream('/foo/bar.jpg')); + +axios.post('https://example.com', form, { headers: form.getHeaders() }) +``` + +Alternatively, use an interceptor: + +```js +axios.interceptors.request.use(config => { + if (config.data instanceof FormData) { + Object.assign(config.headers, config.data.getHeaders()); + } + return config; +}); +``` + +## Semver + +Until axios reaches a `1.0` release, breaking changes will be released with a new minor version. For example `0.5.1`, and `0.5.4` will have the same API, but `0.6.0` will have breaking changes. + +## Promises + +axios depends on a native ES6 Promise implementation to be [supported](http://caniuse.com/promises). +If your environment doesn't support ES6 Promises, you can [polyfill](https://github.com/jakearchibald/es6-promise). + +## TypeScript + +axios includes [TypeScript](http://typescriptlang.org) definitions and a type guard for axios errors. + +```typescript +let user: User = null; +try { + const { data } = await axios.get('/user?ID=12345'); + user = data.userDetails; +} catch (error) { + if (axios.isAxiosError(error)) { + handleAxiosError(error); + } else { + handleUnexpectedError(error); + } +} +``` + +## Online one-click setup + +You can use Gitpod an online IDE(which is free for Open Source) for contributing or running the examples online. + +[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/axios/axios/blob/master/examples/server.js) + + +## Resources + +* [Changelog](https://github.com/axios/axios/blob/master/CHANGELOG.md) +* [Upgrade Guide](https://github.com/axios/axios/blob/master/UPGRADE_GUIDE.md) +* [Ecosystem](https://github.com/axios/axios/blob/master/ECOSYSTEM.md) +* [Contributing Guide](https://github.com/axios/axios/blob/master/CONTRIBUTING.md) +* [Code of Conduct](https://github.com/axios/axios/blob/master/CODE_OF_CONDUCT.md) + +## Credits + +axios is heavily inspired by the [$http service](https://docs.angularjs.org/api/ng/service/$http) provided in [Angular](https://angularjs.org/). Ultimately axios is an effort to provide a standalone `$http`-like service for use outside of Angular. + +## License + +[MIT](LICENSE) diff --git a/node_modules/hxz-api/node_modules/axios/SECURITY.md b/node_modules/hxz-api/node_modules/axios/SECURITY.md new file mode 100644 index 000000000..353df9a2f --- /dev/null +++ b/node_modules/hxz-api/node_modules/axios/SECURITY.md @@ -0,0 +1,5 @@ +# Security Policy + +## Reporting a Vulnerability + +Please report security issues to jasonsaayman@gmail.com diff --git a/node_modules/hxz-api/node_modules/axios/UPGRADE_GUIDE.md b/node_modules/hxz-api/node_modules/axios/UPGRADE_GUIDE.md new file mode 100644 index 000000000..745e80492 --- /dev/null +++ b/node_modules/hxz-api/node_modules/axios/UPGRADE_GUIDE.md @@ -0,0 +1,162 @@ +# Upgrade Guide + +### 0.15.x -> 0.16.0 + +#### `Promise` Type Declarations + +The `Promise` type declarations have been removed from the axios typings in favor of the built-in type declarations. If you use axios in a TypeScript project that targets `ES5`, please make sure to include the `es2015.promise` lib. Please see [this post](https://blog.mariusschulz.com/2016/11/25/typescript-2-0-built-in-type-declarations) for details. + +### 0.13.x -> 0.14.0 + +#### TypeScript Definitions + +The axios TypeScript definitions have been updated to match the axios API and use the ES2015 module syntax. + +Please use the following `import` statement to import axios in TypeScript: + +```typescript +import axios from 'axios'; + +axios.get('/foo') + .then(response => console.log(response)) + .catch(error => console.log(error)); +``` + +#### `agent` Config Option + +The `agent` config option has been replaced with two new options: `httpAgent` and `httpsAgent`. Please use them instead. + +```js +{ + // Define a custom agent for HTTP + httpAgent: new http.Agent({ keepAlive: true }), + // Define a custom agent for HTTPS + httpsAgent: new https.Agent({ keepAlive: true }) +} +``` + +#### `progress` Config Option + +The `progress` config option has been replaced with the `onUploadProgress` and `onDownloadProgress` options. + +```js +{ + // Define a handler for upload progress events + onUploadProgress: function (progressEvent) { + // ... + }, + + // Define a handler for download progress events + onDownloadProgress: function (progressEvent) { + // ... + } +} +``` + +### 0.12.x -> 0.13.0 + +The `0.13.0` release contains several changes to custom adapters and error handling. + +#### Error Handling + +Previous to this release an error could either be a server response with bad status code or an actual `Error`. With this release Promise will always reject with an `Error`. In the case that a response was received, the `Error` will also include the response. + +```js +axios.get('/user/12345') + .catch((error) => { + console.log(error.message); + console.log(error.code); // Not always specified + console.log(error.config); // The config that was used to make the request + console.log(error.response); // Only available if response was received from the server + }); +``` + +#### Request Adapters + +This release changes a few things about how request adapters work. Please take note if you are using your own custom adapter. + +1. Response transformer is now called outside of adapter. +2. Request adapter returns a `Promise`. + +This means that you no longer need to invoke `transformData` on response data. You will also no longer receive `resolve` and `reject` as arguments in your adapter. + +Previous code: + +```js +function myAdapter(resolve, reject, config) { + var response = { + data: transformData( + responseData, + responseHeaders, + config.transformResponse + ), + status: request.status, + statusText: request.statusText, + headers: responseHeaders + }; + settle(resolve, reject, response); +} +``` + +New code: + +```js +function myAdapter(config) { + return new Promise(function (resolve, reject) { + var response = { + data: responseData, + status: request.status, + statusText: request.statusText, + headers: responseHeaders + }; + settle(resolve, reject, response); + }); +} +``` + +See the related commits for more details: +- [Response transformers](https://github.com/axios/axios/commit/10eb23865101f9347570552c04e9d6211376e25e) +- [Request adapter Promise](https://github.com/axios/axios/commit/157efd5615890301824e3121cc6c9d2f9b21f94a) + +### 0.5.x -> 0.6.0 + +The `0.6.0` release contains mostly bug fixes, but there are a couple things to be aware of when upgrading. + +#### ES6 Promise Polyfill + +Up until the `0.6.0` release ES6 `Promise` was being polyfilled using [es6-promise](https://github.com/jakearchibald/es6-promise). With this release, the polyfill has been removed, and you will need to supply it yourself if your environment needs it. + +```js +require('es6-promise').polyfill(); +var axios = require('axios'); +``` + +This will polyfill the global environment, and only needs to be done once. + +#### `axios.success`/`axios.error` + +The `success`, and `error` aliases were deprecated in [0.4.0](https://github.com/axios/axios/blob/master/CHANGELOG.md#040-oct-03-2014). As of this release they have been removed entirely. Instead please use `axios.then`, and `axios.catch` respectively. + +```js +axios.get('some/url') + .then(function (res) { + /* ... */ + }) + .catch(function (err) { + /* ... */ + }); +``` + +#### UMD + +Previous versions of axios shipped with an AMD, CommonJS, and Global build. This has all been rolled into a single UMD build. + +```js +// AMD +require(['bower_components/axios/dist/axios'], function (axios) { + /* ... */ +}); + +// CommonJS +var axios = require('axios/dist/axios'); +``` diff --git a/node_modules/hxz-api/node_modules/axios/dist/axios.js b/node_modules/hxz-api/node_modules/axios/dist/axios.js new file mode 100644 index 000000000..f25391064 --- /dev/null +++ b/node_modules/hxz-api/node_modules/axios/dist/axios.js @@ -0,0 +1,2193 @@ +/* axios v0.21.4 | (c) 2021 by Matt Zabriskie */ +(function webpackUniversalModuleDefinition(root, factory) { + if(typeof exports === 'object' && typeof module === 'object') + module.exports = factory(); + else if(typeof define === 'function' && define.amd) + define([], factory); + else if(typeof exports === 'object') + exports["axios"] = factory(); + else + root["axios"] = factory(); +})(window, function() { +return /******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) { +/******/ return installedModules[moduleId].exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ i: moduleId, +/******/ l: false, +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __webpack_require__.c = installedModules; +/******/ +/******/ // define getter function for harmony exports +/******/ __webpack_require__.d = function(exports, name, getter) { +/******/ if(!__webpack_require__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); +/******/ } +/******/ }; +/******/ +/******/ // define __esModule on exports +/******/ __webpack_require__.r = function(exports) { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ +/******/ // create a fake namespace object +/******/ // mode & 1: value is a module id, require it +/******/ // mode & 2: merge all properties of value into the ns +/******/ // mode & 4: return value when already ns object +/******/ // mode & 8|1: behave like require +/******/ __webpack_require__.t = function(value, mode) { +/******/ if(mode & 1) value = __webpack_require__(value); +/******/ if(mode & 8) return value; +/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; +/******/ var ns = Object.create(null); +/******/ __webpack_require__.r(ns); +/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); +/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); +/******/ return ns; +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __webpack_require__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __webpack_require__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = ""; +/******/ +/******/ +/******/ // Load entry module and return exports +/******/ return __webpack_require__(__webpack_require__.s = "./index.js"); +/******/ }) +/************************************************************************/ +/******/ ({ + +/***/ "./index.js": +/*!******************!*\ + !*** ./index.js ***! + \******************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +module.exports = __webpack_require__(/*! ./lib/axios */ "./lib/axios.js"); + +/***/ }), + +/***/ "./lib/adapters/xhr.js": +/*!*****************************!*\ + !*** ./lib/adapters/xhr.js ***! + \*****************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var utils = __webpack_require__(/*! ./../utils */ "./lib/utils.js"); +var settle = __webpack_require__(/*! ./../core/settle */ "./lib/core/settle.js"); +var cookies = __webpack_require__(/*! ./../helpers/cookies */ "./lib/helpers/cookies.js"); +var buildURL = __webpack_require__(/*! ./../helpers/buildURL */ "./lib/helpers/buildURL.js"); +var buildFullPath = __webpack_require__(/*! ../core/buildFullPath */ "./lib/core/buildFullPath.js"); +var parseHeaders = __webpack_require__(/*! ./../helpers/parseHeaders */ "./lib/helpers/parseHeaders.js"); +var isURLSameOrigin = __webpack_require__(/*! ./../helpers/isURLSameOrigin */ "./lib/helpers/isURLSameOrigin.js"); +var createError = __webpack_require__(/*! ../core/createError */ "./lib/core/createError.js"); + +module.exports = function xhrAdapter(config) { + return new Promise(function dispatchXhrRequest(resolve, reject) { + var requestData = config.data; + var requestHeaders = config.headers; + var responseType = config.responseType; + + if (utils.isFormData(requestData)) { + delete requestHeaders['Content-Type']; // Let the browser set it + } + + var request = new XMLHttpRequest(); + + // HTTP basic authentication + if (config.auth) { + var username = config.auth.username || ''; + var password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : ''; + requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password); + } + + var fullPath = buildFullPath(config.baseURL, config.url); + request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true); + + // Set the request timeout in MS + request.timeout = config.timeout; + + function onloadend() { + if (!request) { + return; + } + // Prepare the response + var responseHeaders = 'getAllResponseHeaders' in request ? parseHeaders(request.getAllResponseHeaders()) : null; + var responseData = !responseType || responseType === 'text' || responseType === 'json' ? + request.responseText : request.response; + var response = { + data: responseData, + status: request.status, + statusText: request.statusText, + headers: responseHeaders, + config: config, + request: request + }; + + settle(resolve, reject, response); + + // Clean up request + request = null; + } + + if ('onloadend' in request) { + // Use onloadend if available + request.onloadend = onloadend; + } else { + // Listen for ready state to emulate onloadend + request.onreadystatechange = function handleLoad() { + if (!request || request.readyState !== 4) { + return; + } + + // The request errored out and we didn't get a response, this will be + // handled by onerror instead + // With one exception: request that using file: protocol, most browsers + // will return status as 0 even though it's a successful request + if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) { + return; + } + // readystate handler is calling before onerror or ontimeout handlers, + // so we should call onloadend on the next 'tick' + setTimeout(onloadend); + }; + } + + // Handle browser request cancellation (as opposed to a manual cancellation) + request.onabort = function handleAbort() { + if (!request) { + return; + } + + reject(createError('Request aborted', config, 'ECONNABORTED', request)); + + // Clean up request + request = null; + }; + + // Handle low level network errors + request.onerror = function handleError() { + // Real errors are hidden from us by the browser + // onerror should only fire if it's a network error + reject(createError('Network Error', config, null, request)); + + // Clean up request + request = null; + }; + + // Handle timeout + request.ontimeout = function handleTimeout() { + var timeoutErrorMessage = 'timeout of ' + config.timeout + 'ms exceeded'; + if (config.timeoutErrorMessage) { + timeoutErrorMessage = config.timeoutErrorMessage; + } + reject(createError( + timeoutErrorMessage, + config, + config.transitional && config.transitional.clarifyTimeoutError ? 'ETIMEDOUT' : 'ECONNABORTED', + request)); + + // Clean up request + request = null; + }; + + // Add xsrf header + // This is only done if running in a standard browser environment. + // Specifically not if we're in a web worker, or react-native. + if (utils.isStandardBrowserEnv()) { + // Add xsrf header + var xsrfValue = (config.withCredentials || isURLSameOrigin(fullPath)) && config.xsrfCookieName ? + cookies.read(config.xsrfCookieName) : + undefined; + + if (xsrfValue) { + requestHeaders[config.xsrfHeaderName] = xsrfValue; + } + } + + // Add headers to the request + if ('setRequestHeader' in request) { + utils.forEach(requestHeaders, function setRequestHeader(val, key) { + if (typeof requestData === 'undefined' && key.toLowerCase() === 'content-type') { + // Remove Content-Type if data is undefined + delete requestHeaders[key]; + } else { + // Otherwise add header to the request + request.setRequestHeader(key, val); + } + }); + } + + // Add withCredentials to request if needed + if (!utils.isUndefined(config.withCredentials)) { + request.withCredentials = !!config.withCredentials; + } + + // Add responseType to request if needed + if (responseType && responseType !== 'json') { + request.responseType = config.responseType; + } + + // Handle progress if needed + if (typeof config.onDownloadProgress === 'function') { + request.addEventListener('progress', config.onDownloadProgress); + } + + // Not all browsers support upload events + if (typeof config.onUploadProgress === 'function' && request.upload) { + request.upload.addEventListener('progress', config.onUploadProgress); + } + + if (config.cancelToken) { + // Handle cancellation + config.cancelToken.promise.then(function onCanceled(cancel) { + if (!request) { + return; + } + + request.abort(); + reject(cancel); + // Clean up request + request = null; + }); + } + + if (!requestData) { + requestData = null; + } + + // Send the request + request.send(requestData); + }); +}; + + +/***/ }), + +/***/ "./lib/axios.js": +/*!**********************!*\ + !*** ./lib/axios.js ***! + \**********************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var utils = __webpack_require__(/*! ./utils */ "./lib/utils.js"); +var bind = __webpack_require__(/*! ./helpers/bind */ "./lib/helpers/bind.js"); +var Axios = __webpack_require__(/*! ./core/Axios */ "./lib/core/Axios.js"); +var mergeConfig = __webpack_require__(/*! ./core/mergeConfig */ "./lib/core/mergeConfig.js"); +var defaults = __webpack_require__(/*! ./defaults */ "./lib/defaults.js"); + +/** + * Create an instance of Axios + * + * @param {Object} defaultConfig The default config for the instance + * @return {Axios} A new instance of Axios + */ +function createInstance(defaultConfig) { + var context = new Axios(defaultConfig); + var instance = bind(Axios.prototype.request, context); + + // Copy axios.prototype to instance + utils.extend(instance, Axios.prototype, context); + + // Copy context to instance + utils.extend(instance, context); + + return instance; +} + +// Create the default instance to be exported +var axios = createInstance(defaults); + +// Expose Axios class to allow class inheritance +axios.Axios = Axios; + +// Factory for creating new instances +axios.create = function create(instanceConfig) { + return createInstance(mergeConfig(axios.defaults, instanceConfig)); +}; + +// Expose Cancel & CancelToken +axios.Cancel = __webpack_require__(/*! ./cancel/Cancel */ "./lib/cancel/Cancel.js"); +axios.CancelToken = __webpack_require__(/*! ./cancel/CancelToken */ "./lib/cancel/CancelToken.js"); +axios.isCancel = __webpack_require__(/*! ./cancel/isCancel */ "./lib/cancel/isCancel.js"); + +// Expose all/spread +axios.all = function all(promises) { + return Promise.all(promises); +}; +axios.spread = __webpack_require__(/*! ./helpers/spread */ "./lib/helpers/spread.js"); + +// Expose isAxiosError +axios.isAxiosError = __webpack_require__(/*! ./helpers/isAxiosError */ "./lib/helpers/isAxiosError.js"); + +module.exports = axios; + +// Allow use of default import syntax in TypeScript +module.exports.default = axios; + + +/***/ }), + +/***/ "./lib/cancel/Cancel.js": +/*!******************************!*\ + !*** ./lib/cancel/Cancel.js ***! + \******************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +/** + * A `Cancel` is an object that is thrown when an operation is canceled. + * + * @class + * @param {string=} message The message. + */ +function Cancel(message) { + this.message = message; +} + +Cancel.prototype.toString = function toString() { + return 'Cancel' + (this.message ? ': ' + this.message : ''); +}; + +Cancel.prototype.__CANCEL__ = true; + +module.exports = Cancel; + + +/***/ }), + +/***/ "./lib/cancel/CancelToken.js": +/*!***********************************!*\ + !*** ./lib/cancel/CancelToken.js ***! + \***********************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var Cancel = __webpack_require__(/*! ./Cancel */ "./lib/cancel/Cancel.js"); + +/** + * A `CancelToken` is an object that can be used to request cancellation of an operation. + * + * @class + * @param {Function} executor The executor function. + */ +function CancelToken(executor) { + if (typeof executor !== 'function') { + throw new TypeError('executor must be a function.'); + } + + var resolvePromise; + this.promise = new Promise(function promiseExecutor(resolve) { + resolvePromise = resolve; + }); + + var token = this; + executor(function cancel(message) { + if (token.reason) { + // Cancellation has already been requested + return; + } + + token.reason = new Cancel(message); + resolvePromise(token.reason); + }); +} + +/** + * Throws a `Cancel` if cancellation has been requested. + */ +CancelToken.prototype.throwIfRequested = function throwIfRequested() { + if (this.reason) { + throw this.reason; + } +}; + +/** + * Returns an object that contains a new `CancelToken` and a function that, when called, + * cancels the `CancelToken`. + */ +CancelToken.source = function source() { + var cancel; + var token = new CancelToken(function executor(c) { + cancel = c; + }); + return { + token: token, + cancel: cancel + }; +}; + +module.exports = CancelToken; + + +/***/ }), + +/***/ "./lib/cancel/isCancel.js": +/*!********************************!*\ + !*** ./lib/cancel/isCancel.js ***! + \********************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +module.exports = function isCancel(value) { + return !!(value && value.__CANCEL__); +}; + + +/***/ }), + +/***/ "./lib/core/Axios.js": +/*!***************************!*\ + !*** ./lib/core/Axios.js ***! + \***************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var utils = __webpack_require__(/*! ./../utils */ "./lib/utils.js"); +var buildURL = __webpack_require__(/*! ../helpers/buildURL */ "./lib/helpers/buildURL.js"); +var InterceptorManager = __webpack_require__(/*! ./InterceptorManager */ "./lib/core/InterceptorManager.js"); +var dispatchRequest = __webpack_require__(/*! ./dispatchRequest */ "./lib/core/dispatchRequest.js"); +var mergeConfig = __webpack_require__(/*! ./mergeConfig */ "./lib/core/mergeConfig.js"); +var validator = __webpack_require__(/*! ../helpers/validator */ "./lib/helpers/validator.js"); + +var validators = validator.validators; +/** + * Create a new instance of Axios + * + * @param {Object} instanceConfig The default config for the instance + */ +function Axios(instanceConfig) { + this.defaults = instanceConfig; + this.interceptors = { + request: new InterceptorManager(), + response: new InterceptorManager() + }; +} + +/** + * Dispatch a request + * + * @param {Object} config The config specific for this request (merged with this.defaults) + */ +Axios.prototype.request = function request(config) { + /*eslint no-param-reassign:0*/ + // Allow for axios('example/url'[, config]) a la fetch API + if (typeof config === 'string') { + config = arguments[1] || {}; + config.url = arguments[0]; + } else { + config = config || {}; + } + + config = mergeConfig(this.defaults, config); + + // Set config.method + if (config.method) { + config.method = config.method.toLowerCase(); + } else if (this.defaults.method) { + config.method = this.defaults.method.toLowerCase(); + } else { + config.method = 'get'; + } + + var transitional = config.transitional; + + if (transitional !== undefined) { + validator.assertOptions(transitional, { + silentJSONParsing: validators.transitional(validators.boolean, '1.0.0'), + forcedJSONParsing: validators.transitional(validators.boolean, '1.0.0'), + clarifyTimeoutError: validators.transitional(validators.boolean, '1.0.0') + }, false); + } + + // filter out skipped interceptors + var requestInterceptorChain = []; + var synchronousRequestInterceptors = true; + this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) { + if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) { + return; + } + + synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous; + + requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected); + }); + + var responseInterceptorChain = []; + this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) { + responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected); + }); + + var promise; + + if (!synchronousRequestInterceptors) { + var chain = [dispatchRequest, undefined]; + + Array.prototype.unshift.apply(chain, requestInterceptorChain); + chain = chain.concat(responseInterceptorChain); + + promise = Promise.resolve(config); + while (chain.length) { + promise = promise.then(chain.shift(), chain.shift()); + } + + return promise; + } + + + var newConfig = config; + while (requestInterceptorChain.length) { + var onFulfilled = requestInterceptorChain.shift(); + var onRejected = requestInterceptorChain.shift(); + try { + newConfig = onFulfilled(newConfig); + } catch (error) { + onRejected(error); + break; + } + } + + try { + promise = dispatchRequest(newConfig); + } catch (error) { + return Promise.reject(error); + } + + while (responseInterceptorChain.length) { + promise = promise.then(responseInterceptorChain.shift(), responseInterceptorChain.shift()); + } + + return promise; +}; + +Axios.prototype.getUri = function getUri(config) { + config = mergeConfig(this.defaults, config); + return buildURL(config.url, config.params, config.paramsSerializer).replace(/^\?/, ''); +}; + +// Provide aliases for supported request methods +utils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) { + /*eslint func-names:0*/ + Axios.prototype[method] = function(url, config) { + return this.request(mergeConfig(config || {}, { + method: method, + url: url, + data: (config || {}).data + })); + }; +}); + +utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) { + /*eslint func-names:0*/ + Axios.prototype[method] = function(url, data, config) { + return this.request(mergeConfig(config || {}, { + method: method, + url: url, + data: data + })); + }; +}); + +module.exports = Axios; + + +/***/ }), + +/***/ "./lib/core/InterceptorManager.js": +/*!****************************************!*\ + !*** ./lib/core/InterceptorManager.js ***! + \****************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var utils = __webpack_require__(/*! ./../utils */ "./lib/utils.js"); + +function InterceptorManager() { + this.handlers = []; +} + +/** + * Add a new interceptor to the stack + * + * @param {Function} fulfilled The function to handle `then` for a `Promise` + * @param {Function} rejected The function to handle `reject` for a `Promise` + * + * @return {Number} An ID used to remove interceptor later + */ +InterceptorManager.prototype.use = function use(fulfilled, rejected, options) { + this.handlers.push({ + fulfilled: fulfilled, + rejected: rejected, + synchronous: options ? options.synchronous : false, + runWhen: options ? options.runWhen : null + }); + return this.handlers.length - 1; +}; + +/** + * Remove an interceptor from the stack + * + * @param {Number} id The ID that was returned by `use` + */ +InterceptorManager.prototype.eject = function eject(id) { + if (this.handlers[id]) { + this.handlers[id] = null; + } +}; + +/** + * Iterate over all the registered interceptors + * + * This method is particularly useful for skipping over any + * interceptors that may have become `null` calling `eject`. + * + * @param {Function} fn The function to call for each interceptor + */ +InterceptorManager.prototype.forEach = function forEach(fn) { + utils.forEach(this.handlers, function forEachHandler(h) { + if (h !== null) { + fn(h); + } + }); +}; + +module.exports = InterceptorManager; + + +/***/ }), + +/***/ "./lib/core/buildFullPath.js": +/*!***********************************!*\ + !*** ./lib/core/buildFullPath.js ***! + \***********************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var isAbsoluteURL = __webpack_require__(/*! ../helpers/isAbsoluteURL */ "./lib/helpers/isAbsoluteURL.js"); +var combineURLs = __webpack_require__(/*! ../helpers/combineURLs */ "./lib/helpers/combineURLs.js"); + +/** + * Creates a new URL by combining the baseURL with the requestedURL, + * only when the requestedURL is not already an absolute URL. + * If the requestURL is absolute, this function returns the requestedURL untouched. + * + * @param {string} baseURL The base URL + * @param {string} requestedURL Absolute or relative URL to combine + * @returns {string} The combined full path + */ +module.exports = function buildFullPath(baseURL, requestedURL) { + if (baseURL && !isAbsoluteURL(requestedURL)) { + return combineURLs(baseURL, requestedURL); + } + return requestedURL; +}; + + +/***/ }), + +/***/ "./lib/core/createError.js": +/*!*********************************!*\ + !*** ./lib/core/createError.js ***! + \*********************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var enhanceError = __webpack_require__(/*! ./enhanceError */ "./lib/core/enhanceError.js"); + +/** + * Create an Error with the specified message, config, error code, request and response. + * + * @param {string} message The error message. + * @param {Object} config The config. + * @param {string} [code] The error code (for example, 'ECONNABORTED'). + * @param {Object} [request] The request. + * @param {Object} [response] The response. + * @returns {Error} The created error. + */ +module.exports = function createError(message, config, code, request, response) { + var error = new Error(message); + return enhanceError(error, config, code, request, response); +}; + + +/***/ }), + +/***/ "./lib/core/dispatchRequest.js": +/*!*************************************!*\ + !*** ./lib/core/dispatchRequest.js ***! + \*************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var utils = __webpack_require__(/*! ./../utils */ "./lib/utils.js"); +var transformData = __webpack_require__(/*! ./transformData */ "./lib/core/transformData.js"); +var isCancel = __webpack_require__(/*! ../cancel/isCancel */ "./lib/cancel/isCancel.js"); +var defaults = __webpack_require__(/*! ../defaults */ "./lib/defaults.js"); + +/** + * Throws a `Cancel` if cancellation has been requested. + */ +function throwIfCancellationRequested(config) { + if (config.cancelToken) { + config.cancelToken.throwIfRequested(); + } +} + +/** + * Dispatch a request to the server using the configured adapter. + * + * @param {object} config The config that is to be used for the request + * @returns {Promise} The Promise to be fulfilled + */ +module.exports = function dispatchRequest(config) { + throwIfCancellationRequested(config); + + // Ensure headers exist + config.headers = config.headers || {}; + + // Transform request data + config.data = transformData.call( + config, + config.data, + config.headers, + config.transformRequest + ); + + // Flatten headers + config.headers = utils.merge( + config.headers.common || {}, + config.headers[config.method] || {}, + config.headers + ); + + utils.forEach( + ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'], + function cleanHeaderConfig(method) { + delete config.headers[method]; + } + ); + + var adapter = config.adapter || defaults.adapter; + + return adapter(config).then(function onAdapterResolution(response) { + throwIfCancellationRequested(config); + + // Transform response data + response.data = transformData.call( + config, + response.data, + response.headers, + config.transformResponse + ); + + return response; + }, function onAdapterRejection(reason) { + if (!isCancel(reason)) { + throwIfCancellationRequested(config); + + // Transform response data + if (reason && reason.response) { + reason.response.data = transformData.call( + config, + reason.response.data, + reason.response.headers, + config.transformResponse + ); + } + } + + return Promise.reject(reason); + }); +}; + + +/***/ }), + +/***/ "./lib/core/enhanceError.js": +/*!**********************************!*\ + !*** ./lib/core/enhanceError.js ***! + \**********************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +/** + * Update an Error with the specified config, error code, and response. + * + * @param {Error} error The error to update. + * @param {Object} config The config. + * @param {string} [code] The error code (for example, 'ECONNABORTED'). + * @param {Object} [request] The request. + * @param {Object} [response] The response. + * @returns {Error} The error. + */ +module.exports = function enhanceError(error, config, code, request, response) { + error.config = config; + if (code) { + error.code = code; + } + + error.request = request; + error.response = response; + error.isAxiosError = true; + + error.toJSON = function toJSON() { + return { + // Standard + message: this.message, + name: this.name, + // Microsoft + description: this.description, + number: this.number, + // Mozilla + fileName: this.fileName, + lineNumber: this.lineNumber, + columnNumber: this.columnNumber, + stack: this.stack, + // Axios + config: this.config, + code: this.code + }; + }; + return error; +}; + + +/***/ }), + +/***/ "./lib/core/mergeConfig.js": +/*!*********************************!*\ + !*** ./lib/core/mergeConfig.js ***! + \*********************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var utils = __webpack_require__(/*! ../utils */ "./lib/utils.js"); + +/** + * Config-specific merge-function which creates a new config-object + * by merging two configuration objects together. + * + * @param {Object} config1 + * @param {Object} config2 + * @returns {Object} New object resulting from merging config2 to config1 + */ +module.exports = function mergeConfig(config1, config2) { + // eslint-disable-next-line no-param-reassign + config2 = config2 || {}; + var config = {}; + + var valueFromConfig2Keys = ['url', 'method', 'data']; + var mergeDeepPropertiesKeys = ['headers', 'auth', 'proxy', 'params']; + var defaultToConfig2Keys = [ + 'baseURL', 'transformRequest', 'transformResponse', 'paramsSerializer', + 'timeout', 'timeoutMessage', 'withCredentials', 'adapter', 'responseType', 'xsrfCookieName', + 'xsrfHeaderName', 'onUploadProgress', 'onDownloadProgress', 'decompress', + 'maxContentLength', 'maxBodyLength', 'maxRedirects', 'transport', 'httpAgent', + 'httpsAgent', 'cancelToken', 'socketPath', 'responseEncoding' + ]; + var directMergeKeys = ['validateStatus']; + + function getMergedValue(target, source) { + if (utils.isPlainObject(target) && utils.isPlainObject(source)) { + return utils.merge(target, source); + } else if (utils.isPlainObject(source)) { + return utils.merge({}, source); + } else if (utils.isArray(source)) { + return source.slice(); + } + return source; + } + + function mergeDeepProperties(prop) { + if (!utils.isUndefined(config2[prop])) { + config[prop] = getMergedValue(config1[prop], config2[prop]); + } else if (!utils.isUndefined(config1[prop])) { + config[prop] = getMergedValue(undefined, config1[prop]); + } + } + + utils.forEach(valueFromConfig2Keys, function valueFromConfig2(prop) { + if (!utils.isUndefined(config2[prop])) { + config[prop] = getMergedValue(undefined, config2[prop]); + } + }); + + utils.forEach(mergeDeepPropertiesKeys, mergeDeepProperties); + + utils.forEach(defaultToConfig2Keys, function defaultToConfig2(prop) { + if (!utils.isUndefined(config2[prop])) { + config[prop] = getMergedValue(undefined, config2[prop]); + } else if (!utils.isUndefined(config1[prop])) { + config[prop] = getMergedValue(undefined, config1[prop]); + } + }); + + utils.forEach(directMergeKeys, function merge(prop) { + if (prop in config2) { + config[prop] = getMergedValue(config1[prop], config2[prop]); + } else if (prop in config1) { + config[prop] = getMergedValue(undefined, config1[prop]); + } + }); + + var axiosKeys = valueFromConfig2Keys + .concat(mergeDeepPropertiesKeys) + .concat(defaultToConfig2Keys) + .concat(directMergeKeys); + + var otherKeys = Object + .keys(config1) + .concat(Object.keys(config2)) + .filter(function filterAxiosKeys(key) { + return axiosKeys.indexOf(key) === -1; + }); + + utils.forEach(otherKeys, mergeDeepProperties); + + return config; +}; + + +/***/ }), + +/***/ "./lib/core/settle.js": +/*!****************************!*\ + !*** ./lib/core/settle.js ***! + \****************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var createError = __webpack_require__(/*! ./createError */ "./lib/core/createError.js"); + +/** + * Resolve or reject a Promise based on response status. + * + * @param {Function} resolve A function that resolves the promise. + * @param {Function} reject A function that rejects the promise. + * @param {object} response The response. + */ +module.exports = function settle(resolve, reject, response) { + var validateStatus = response.config.validateStatus; + if (!response.status || !validateStatus || validateStatus(response.status)) { + resolve(response); + } else { + reject(createError( + 'Request failed with status code ' + response.status, + response.config, + null, + response.request, + response + )); + } +}; + + +/***/ }), + +/***/ "./lib/core/transformData.js": +/*!***********************************!*\ + !*** ./lib/core/transformData.js ***! + \***********************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var utils = __webpack_require__(/*! ./../utils */ "./lib/utils.js"); +var defaults = __webpack_require__(/*! ./../defaults */ "./lib/defaults.js"); + +/** + * Transform the data for a request or a response + * + * @param {Object|String} data The data to be transformed + * @param {Array} headers The headers for the request or response + * @param {Array|Function} fns A single function or Array of functions + * @returns {*} The resulting transformed data + */ +module.exports = function transformData(data, headers, fns) { + var context = this || defaults; + /*eslint no-param-reassign:0*/ + utils.forEach(fns, function transform(fn) { + data = fn.call(context, data, headers); + }); + + return data; +}; + + +/***/ }), + +/***/ "./lib/defaults.js": +/*!*************************!*\ + !*** ./lib/defaults.js ***! + \*************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var utils = __webpack_require__(/*! ./utils */ "./lib/utils.js"); +var normalizeHeaderName = __webpack_require__(/*! ./helpers/normalizeHeaderName */ "./lib/helpers/normalizeHeaderName.js"); +var enhanceError = __webpack_require__(/*! ./core/enhanceError */ "./lib/core/enhanceError.js"); + +var DEFAULT_CONTENT_TYPE = { + 'Content-Type': 'application/x-www-form-urlencoded' +}; + +function setContentTypeIfUnset(headers, value) { + if (!utils.isUndefined(headers) && utils.isUndefined(headers['Content-Type'])) { + headers['Content-Type'] = value; + } +} + +function getDefaultAdapter() { + var adapter; + if (typeof XMLHttpRequest !== 'undefined') { + // For browsers use XHR adapter + adapter = __webpack_require__(/*! ./adapters/xhr */ "./lib/adapters/xhr.js"); + } else if (typeof process !== 'undefined' && Object.prototype.toString.call(process) === '[object process]') { + // For node use HTTP adapter + adapter = __webpack_require__(/*! ./adapters/http */ "./lib/adapters/xhr.js"); + } + return adapter; +} + +function stringifySafely(rawValue, parser, encoder) { + if (utils.isString(rawValue)) { + try { + (parser || JSON.parse)(rawValue); + return utils.trim(rawValue); + } catch (e) { + if (e.name !== 'SyntaxError') { + throw e; + } + } + } + + return (encoder || JSON.stringify)(rawValue); +} + +var defaults = { + + transitional: { + silentJSONParsing: true, + forcedJSONParsing: true, + clarifyTimeoutError: false + }, + + adapter: getDefaultAdapter(), + + transformRequest: [function transformRequest(data, headers) { + normalizeHeaderName(headers, 'Accept'); + normalizeHeaderName(headers, 'Content-Type'); + + if (utils.isFormData(data) || + utils.isArrayBuffer(data) || + utils.isBuffer(data) || + utils.isStream(data) || + utils.isFile(data) || + utils.isBlob(data) + ) { + return data; + } + if (utils.isArrayBufferView(data)) { + return data.buffer; + } + if (utils.isURLSearchParams(data)) { + setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8'); + return data.toString(); + } + if (utils.isObject(data) || (headers && headers['Content-Type'] === 'application/json')) { + setContentTypeIfUnset(headers, 'application/json'); + return stringifySafely(data); + } + return data; + }], + + transformResponse: [function transformResponse(data) { + var transitional = this.transitional; + var silentJSONParsing = transitional && transitional.silentJSONParsing; + var forcedJSONParsing = transitional && transitional.forcedJSONParsing; + var strictJSONParsing = !silentJSONParsing && this.responseType === 'json'; + + if (strictJSONParsing || (forcedJSONParsing && utils.isString(data) && data.length)) { + try { + return JSON.parse(data); + } catch (e) { + if (strictJSONParsing) { + if (e.name === 'SyntaxError') { + throw enhanceError(e, this, 'E_JSON_PARSE'); + } + throw e; + } + } + } + + return data; + }], + + /** + * A timeout in milliseconds to abort a request. If set to 0 (default) a + * timeout is not created. + */ + timeout: 0, + + xsrfCookieName: 'XSRF-TOKEN', + xsrfHeaderName: 'X-XSRF-TOKEN', + + maxContentLength: -1, + maxBodyLength: -1, + + validateStatus: function validateStatus(status) { + return status >= 200 && status < 300; + } +}; + +defaults.headers = { + common: { + 'Accept': 'application/json, text/plain, */*' + } +}; + +utils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) { + defaults.headers[method] = {}; +}); + +utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) { + defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE); +}); + +module.exports = defaults; + + +/***/ }), + +/***/ "./lib/helpers/bind.js": +/*!*****************************!*\ + !*** ./lib/helpers/bind.js ***! + \*****************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +module.exports = function bind(fn, thisArg) { + return function wrap() { + var args = new Array(arguments.length); + for (var i = 0; i < args.length; i++) { + args[i] = arguments[i]; + } + return fn.apply(thisArg, args); + }; +}; + + +/***/ }), + +/***/ "./lib/helpers/buildURL.js": +/*!*********************************!*\ + !*** ./lib/helpers/buildURL.js ***! + \*********************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var utils = __webpack_require__(/*! ./../utils */ "./lib/utils.js"); + +function encode(val) { + return encodeURIComponent(val). + replace(/%3A/gi, ':'). + replace(/%24/g, '$'). + replace(/%2C/gi, ','). + replace(/%20/g, '+'). + replace(/%5B/gi, '['). + replace(/%5D/gi, ']'); +} + +/** + * Build a URL by appending params to the end + * + * @param {string} url The base of the url (e.g., http://www.google.com) + * @param {object} [params] The params to be appended + * @returns {string} The formatted url + */ +module.exports = function buildURL(url, params, paramsSerializer) { + /*eslint no-param-reassign:0*/ + if (!params) { + return url; + } + + var serializedParams; + if (paramsSerializer) { + serializedParams = paramsSerializer(params); + } else if (utils.isURLSearchParams(params)) { + serializedParams = params.toString(); + } else { + var parts = []; + + utils.forEach(params, function serialize(val, key) { + if (val === null || typeof val === 'undefined') { + return; + } + + if (utils.isArray(val)) { + key = key + '[]'; + } else { + val = [val]; + } + + utils.forEach(val, function parseValue(v) { + if (utils.isDate(v)) { + v = v.toISOString(); + } else if (utils.isObject(v)) { + v = JSON.stringify(v); + } + parts.push(encode(key) + '=' + encode(v)); + }); + }); + + serializedParams = parts.join('&'); + } + + if (serializedParams) { + var hashmarkIndex = url.indexOf('#'); + if (hashmarkIndex !== -1) { + url = url.slice(0, hashmarkIndex); + } + + url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams; + } + + return url; +}; + + +/***/ }), + +/***/ "./lib/helpers/combineURLs.js": +/*!************************************!*\ + !*** ./lib/helpers/combineURLs.js ***! + \************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +/** + * Creates a new URL by combining the specified URLs + * + * @param {string} baseURL The base URL + * @param {string} relativeURL The relative URL + * @returns {string} The combined URL + */ +module.exports = function combineURLs(baseURL, relativeURL) { + return relativeURL + ? baseURL.replace(/\/+$/, '') + '/' + relativeURL.replace(/^\/+/, '') + : baseURL; +}; + + +/***/ }), + +/***/ "./lib/helpers/cookies.js": +/*!********************************!*\ + !*** ./lib/helpers/cookies.js ***! + \********************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var utils = __webpack_require__(/*! ./../utils */ "./lib/utils.js"); + +module.exports = ( + utils.isStandardBrowserEnv() ? + + // Standard browser envs support document.cookie + (function standardBrowserEnv() { + return { + write: function write(name, value, expires, path, domain, secure) { + var cookie = []; + cookie.push(name + '=' + encodeURIComponent(value)); + + if (utils.isNumber(expires)) { + cookie.push('expires=' + new Date(expires).toGMTString()); + } + + if (utils.isString(path)) { + cookie.push('path=' + path); + } + + if (utils.isString(domain)) { + cookie.push('domain=' + domain); + } + + if (secure === true) { + cookie.push('secure'); + } + + document.cookie = cookie.join('; '); + }, + + read: function read(name) { + var match = document.cookie.match(new RegExp('(^|;\\s*)(' + name + ')=([^;]*)')); + return (match ? decodeURIComponent(match[3]) : null); + }, + + remove: function remove(name) { + this.write(name, '', Date.now() - 86400000); + } + }; + })() : + + // Non standard browser env (web workers, react-native) lack needed support. + (function nonStandardBrowserEnv() { + return { + write: function write() {}, + read: function read() { return null; }, + remove: function remove() {} + }; + })() +); + + +/***/ }), + +/***/ "./lib/helpers/isAbsoluteURL.js": +/*!**************************************!*\ + !*** ./lib/helpers/isAbsoluteURL.js ***! + \**************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +/** + * Determines whether the specified URL is absolute + * + * @param {string} url The URL to test + * @returns {boolean} True if the specified URL is absolute, otherwise false + */ +module.exports = function isAbsoluteURL(url) { + // A URL is considered absolute if it begins with "://" or "//" (protocol-relative URL). + // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed + // by any combination of letters, digits, plus, period, or hyphen. + return /^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(url); +}; + + +/***/ }), + +/***/ "./lib/helpers/isAxiosError.js": +/*!*************************************!*\ + !*** ./lib/helpers/isAxiosError.js ***! + \*************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +/** + * Determines whether the payload is an error thrown by Axios + * + * @param {*} payload The value to test + * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false + */ +module.exports = function isAxiosError(payload) { + return (typeof payload === 'object') && (payload.isAxiosError === true); +}; + + +/***/ }), + +/***/ "./lib/helpers/isURLSameOrigin.js": +/*!****************************************!*\ + !*** ./lib/helpers/isURLSameOrigin.js ***! + \****************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var utils = __webpack_require__(/*! ./../utils */ "./lib/utils.js"); + +module.exports = ( + utils.isStandardBrowserEnv() ? + + // Standard browser envs have full support of the APIs needed to test + // whether the request URL is of the same origin as current location. + (function standardBrowserEnv() { + var msie = /(msie|trident)/i.test(navigator.userAgent); + var urlParsingNode = document.createElement('a'); + var originURL; + + /** + * Parse a URL to discover it's components + * + * @param {String} url The URL to be parsed + * @returns {Object} + */ + function resolveURL(url) { + var href = url; + + if (msie) { + // IE needs attribute set twice to normalize properties + urlParsingNode.setAttribute('href', href); + href = urlParsingNode.href; + } + + urlParsingNode.setAttribute('href', href); + + // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils + return { + href: urlParsingNode.href, + protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '', + host: urlParsingNode.host, + search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, '') : '', + hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '', + hostname: urlParsingNode.hostname, + port: urlParsingNode.port, + pathname: (urlParsingNode.pathname.charAt(0) === '/') ? + urlParsingNode.pathname : + '/' + urlParsingNode.pathname + }; + } + + originURL = resolveURL(window.location.href); + + /** + * Determine if a URL shares the same origin as the current location + * + * @param {String} requestURL The URL to test + * @returns {boolean} True if URL shares the same origin, otherwise false + */ + return function isURLSameOrigin(requestURL) { + var parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL; + return (parsed.protocol === originURL.protocol && + parsed.host === originURL.host); + }; + })() : + + // Non standard browser envs (web workers, react-native) lack needed support. + (function nonStandardBrowserEnv() { + return function isURLSameOrigin() { + return true; + }; + })() +); + + +/***/ }), + +/***/ "./lib/helpers/normalizeHeaderName.js": +/*!********************************************!*\ + !*** ./lib/helpers/normalizeHeaderName.js ***! + \********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var utils = __webpack_require__(/*! ../utils */ "./lib/utils.js"); + +module.exports = function normalizeHeaderName(headers, normalizedName) { + utils.forEach(headers, function processHeader(value, name) { + if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) { + headers[normalizedName] = value; + delete headers[name]; + } + }); +}; + + +/***/ }), + +/***/ "./lib/helpers/parseHeaders.js": +/*!*************************************!*\ + !*** ./lib/helpers/parseHeaders.js ***! + \*************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var utils = __webpack_require__(/*! ./../utils */ "./lib/utils.js"); + +// Headers whose duplicates are ignored by node +// c.f. https://nodejs.org/api/http.html#http_message_headers +var ignoreDuplicateOf = [ + 'age', 'authorization', 'content-length', 'content-type', 'etag', + 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since', + 'last-modified', 'location', 'max-forwards', 'proxy-authorization', + 'referer', 'retry-after', 'user-agent' +]; + +/** + * Parse headers into an object + * + * ``` + * Date: Wed, 27 Aug 2014 08:58:49 GMT + * Content-Type: application/json + * Connection: keep-alive + * Transfer-Encoding: chunked + * ``` + * + * @param {String} headers Headers needing to be parsed + * @returns {Object} Headers parsed into an object + */ +module.exports = function parseHeaders(headers) { + var parsed = {}; + var key; + var val; + var i; + + if (!headers) { return parsed; } + + utils.forEach(headers.split('\n'), function parser(line) { + i = line.indexOf(':'); + key = utils.trim(line.substr(0, i)).toLowerCase(); + val = utils.trim(line.substr(i + 1)); + + if (key) { + if (parsed[key] && ignoreDuplicateOf.indexOf(key) >= 0) { + return; + } + if (key === 'set-cookie') { + parsed[key] = (parsed[key] ? parsed[key] : []).concat([val]); + } else { + parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val; + } + } + }); + + return parsed; +}; + + +/***/ }), + +/***/ "./lib/helpers/spread.js": +/*!*******************************!*\ + !*** ./lib/helpers/spread.js ***! + \*******************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +/** + * Syntactic sugar for invoking a function and expanding an array for arguments. + * + * Common use case would be to use `Function.prototype.apply`. + * + * ```js + * function f(x, y, z) {} + * var args = [1, 2, 3]; + * f.apply(null, args); + * ``` + * + * With `spread` this example can be re-written. + * + * ```js + * spread(function(x, y, z) {})([1, 2, 3]); + * ``` + * + * @param {Function} callback + * @returns {Function} + */ +module.exports = function spread(callback) { + return function wrap(arr) { + return callback.apply(null, arr); + }; +}; + + +/***/ }), + +/***/ "./lib/helpers/validator.js": +/*!**********************************!*\ + !*** ./lib/helpers/validator.js ***! + \**********************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var pkg = __webpack_require__(/*! ./../../package.json */ "./package.json"); + +var validators = {}; + +// eslint-disable-next-line func-names +['object', 'boolean', 'number', 'function', 'string', 'symbol'].forEach(function(type, i) { + validators[type] = function validator(thing) { + return typeof thing === type || 'a' + (i < 1 ? 'n ' : ' ') + type; + }; +}); + +var deprecatedWarnings = {}; +var currentVerArr = pkg.version.split('.'); + +/** + * Compare package versions + * @param {string} version + * @param {string?} thanVersion + * @returns {boolean} + */ +function isOlderVersion(version, thanVersion) { + var pkgVersionArr = thanVersion ? thanVersion.split('.') : currentVerArr; + var destVer = version.split('.'); + for (var i = 0; i < 3; i++) { + if (pkgVersionArr[i] > destVer[i]) { + return true; + } else if (pkgVersionArr[i] < destVer[i]) { + return false; + } + } + return false; +} + +/** + * Transitional option validator + * @param {function|boolean?} validator + * @param {string?} version + * @param {string} message + * @returns {function} + */ +validators.transitional = function transitional(validator, version, message) { + var isDeprecated = version && isOlderVersion(version); + + function formatMessage(opt, desc) { + return '[Axios v' + pkg.version + '] Transitional option \'' + opt + '\'' + desc + (message ? '. ' + message : ''); + } + + // eslint-disable-next-line func-names + return function(value, opt, opts) { + if (validator === false) { + throw new Error(formatMessage(opt, ' has been removed in ' + version)); + } + + if (isDeprecated && !deprecatedWarnings[opt]) { + deprecatedWarnings[opt] = true; + // eslint-disable-next-line no-console + console.warn( + formatMessage( + opt, + ' has been deprecated since v' + version + ' and will be removed in the near future' + ) + ); + } + + return validator ? validator(value, opt, opts) : true; + }; +}; + +/** + * Assert object's properties type + * @param {object} options + * @param {object} schema + * @param {boolean?} allowUnknown + */ + +function assertOptions(options, schema, allowUnknown) { + if (typeof options !== 'object') { + throw new TypeError('options must be an object'); + } + var keys = Object.keys(options); + var i = keys.length; + while (i-- > 0) { + var opt = keys[i]; + var validator = schema[opt]; + if (validator) { + var value = options[opt]; + var result = value === undefined || validator(value, opt, options); + if (result !== true) { + throw new TypeError('option ' + opt + ' must be ' + result); + } + continue; + } + if (allowUnknown !== true) { + throw Error('Unknown option ' + opt); + } + } +} + +module.exports = { + isOlderVersion: isOlderVersion, + assertOptions: assertOptions, + validators: validators +}; + + +/***/ }), + +/***/ "./lib/utils.js": +/*!**********************!*\ + !*** ./lib/utils.js ***! + \**********************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var bind = __webpack_require__(/*! ./helpers/bind */ "./lib/helpers/bind.js"); + +// utils is a library of generic helper functions non-specific to axios + +var toString = Object.prototype.toString; + +/** + * Determine if a value is an Array + * + * @param {Object} val The value to test + * @returns {boolean} True if value is an Array, otherwise false + */ +function isArray(val) { + return toString.call(val) === '[object Array]'; +} + +/** + * Determine if a value is undefined + * + * @param {Object} val The value to test + * @returns {boolean} True if the value is undefined, otherwise false + */ +function isUndefined(val) { + return typeof val === 'undefined'; +} + +/** + * Determine if a value is a Buffer + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a Buffer, otherwise false + */ +function isBuffer(val) { + return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor) + && typeof val.constructor.isBuffer === 'function' && val.constructor.isBuffer(val); +} + +/** + * Determine if a value is an ArrayBuffer + * + * @param {Object} val The value to test + * @returns {boolean} True if value is an ArrayBuffer, otherwise false + */ +function isArrayBuffer(val) { + return toString.call(val) === '[object ArrayBuffer]'; +} + +/** + * Determine if a value is a FormData + * + * @param {Object} val The value to test + * @returns {boolean} True if value is an FormData, otherwise false + */ +function isFormData(val) { + return (typeof FormData !== 'undefined') && (val instanceof FormData); +} + +/** + * Determine if a value is a view on an ArrayBuffer + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false + */ +function isArrayBufferView(val) { + var result; + if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) { + result = ArrayBuffer.isView(val); + } else { + result = (val) && (val.buffer) && (val.buffer instanceof ArrayBuffer); + } + return result; +} + +/** + * Determine if a value is a String + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a String, otherwise false + */ +function isString(val) { + return typeof val === 'string'; +} + +/** + * Determine if a value is a Number + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a Number, otherwise false + */ +function isNumber(val) { + return typeof val === 'number'; +} + +/** + * Determine if a value is an Object + * + * @param {Object} val The value to test + * @returns {boolean} True if value is an Object, otherwise false + */ +function isObject(val) { + return val !== null && typeof val === 'object'; +} + +/** + * Determine if a value is a plain Object + * + * @param {Object} val The value to test + * @return {boolean} True if value is a plain Object, otherwise false + */ +function isPlainObject(val) { + if (toString.call(val) !== '[object Object]') { + return false; + } + + var prototype = Object.getPrototypeOf(val); + return prototype === null || prototype === Object.prototype; +} + +/** + * Determine if a value is a Date + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a Date, otherwise false + */ +function isDate(val) { + return toString.call(val) === '[object Date]'; +} + +/** + * Determine if a value is a File + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a File, otherwise false + */ +function isFile(val) { + return toString.call(val) === '[object File]'; +} + +/** + * Determine if a value is a Blob + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a Blob, otherwise false + */ +function isBlob(val) { + return toString.call(val) === '[object Blob]'; +} + +/** + * Determine if a value is a Function + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a Function, otherwise false + */ +function isFunction(val) { + return toString.call(val) === '[object Function]'; +} + +/** + * Determine if a value is a Stream + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a Stream, otherwise false + */ +function isStream(val) { + return isObject(val) && isFunction(val.pipe); +} + +/** + * Determine if a value is a URLSearchParams object + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a URLSearchParams object, otherwise false + */ +function isURLSearchParams(val) { + return typeof URLSearchParams !== 'undefined' && val instanceof URLSearchParams; +} + +/** + * Trim excess whitespace off the beginning and end of a string + * + * @param {String} str The String to trim + * @returns {String} The String freed of excess whitespace + */ +function trim(str) { + return str.trim ? str.trim() : str.replace(/^\s+|\s+$/g, ''); +} + +/** + * Determine if we're running in a standard browser environment + * + * This allows axios to run in a web worker, and react-native. + * Both environments support XMLHttpRequest, but not fully standard globals. + * + * web workers: + * typeof window -> undefined + * typeof document -> undefined + * + * react-native: + * navigator.product -> 'ReactNative' + * nativescript + * navigator.product -> 'NativeScript' or 'NS' + */ +function isStandardBrowserEnv() { + if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' || + navigator.product === 'NativeScript' || + navigator.product === 'NS')) { + return false; + } + return ( + typeof window !== 'undefined' && + typeof document !== 'undefined' + ); +} + +/** + * Iterate over an Array or an Object invoking a function for each item. + * + * If `obj` is an Array callback will be called passing + * the value, index, and complete array for each item. + * + * If 'obj' is an Object callback will be called passing + * the value, key, and complete object for each property. + * + * @param {Object|Array} obj The object to iterate + * @param {Function} fn The callback to invoke for each item + */ +function forEach(obj, fn) { + // Don't bother if no value provided + if (obj === null || typeof obj === 'undefined') { + return; + } + + // Force an array if not already something iterable + if (typeof obj !== 'object') { + /*eslint no-param-reassign:0*/ + obj = [obj]; + } + + if (isArray(obj)) { + // Iterate over array values + for (var i = 0, l = obj.length; i < l; i++) { + fn.call(null, obj[i], i, obj); + } + } else { + // Iterate over object keys + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) { + fn.call(null, obj[key], key, obj); + } + } + } +} + +/** + * Accepts varargs expecting each argument to be an object, then + * immutably merges the properties of each object and returns result. + * + * When multiple objects contain the same key the later object in + * the arguments list will take precedence. + * + * Example: + * + * ```js + * var result = merge({foo: 123}, {foo: 456}); + * console.log(result.foo); // outputs 456 + * ``` + * + * @param {Object} obj1 Object to merge + * @returns {Object} Result of all merge properties + */ +function merge(/* obj1, obj2, obj3, ... */) { + var result = {}; + function assignValue(val, key) { + if (isPlainObject(result[key]) && isPlainObject(val)) { + result[key] = merge(result[key], val); + } else if (isPlainObject(val)) { + result[key] = merge({}, val); + } else if (isArray(val)) { + result[key] = val.slice(); + } else { + result[key] = val; + } + } + + for (var i = 0, l = arguments.length; i < l; i++) { + forEach(arguments[i], assignValue); + } + return result; +} + +/** + * Extends object a by mutably adding to it the properties of object b. + * + * @param {Object} a The object to be extended + * @param {Object} b The object to copy properties from + * @param {Object} thisArg The object to bind function to + * @return {Object} The resulting value of object a + */ +function extend(a, b, thisArg) { + forEach(b, function assignValue(val, key) { + if (thisArg && typeof val === 'function') { + a[key] = bind(val, thisArg); + } else { + a[key] = val; + } + }); + return a; +} + +/** + * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM) + * + * @param {string} content with BOM + * @return {string} content value without BOM + */ +function stripBOM(content) { + if (content.charCodeAt(0) === 0xFEFF) { + content = content.slice(1); + } + return content; +} + +module.exports = { + isArray: isArray, + isArrayBuffer: isArrayBuffer, + isBuffer: isBuffer, + isFormData: isFormData, + isArrayBufferView: isArrayBufferView, + isString: isString, + isNumber: isNumber, + isObject: isObject, + isPlainObject: isPlainObject, + isUndefined: isUndefined, + isDate: isDate, + isFile: isFile, + isBlob: isBlob, + isFunction: isFunction, + isStream: isStream, + isURLSearchParams: isURLSearchParams, + isStandardBrowserEnv: isStandardBrowserEnv, + forEach: forEach, + merge: merge, + extend: extend, + trim: trim, + stripBOM: stripBOM +}; + + +/***/ }), + +/***/ "./package.json": +/*!**********************!*\ + !*** ./package.json ***! + \**********************/ +/*! exports provided: name, version, description, main, scripts, repository, keywords, author, license, bugs, homepage, devDependencies, browser, jsdelivr, unpkg, typings, dependencies, bundlesize, default */ +/***/ (function(module) { + +module.exports = JSON.parse("{\"name\":\"axios\",\"version\":\"0.21.4\",\"description\":\"Promise based HTTP client for the browser and node.js\",\"main\":\"index.js\",\"scripts\":{\"test\":\"grunt test\",\"start\":\"node ./sandbox/server.js\",\"build\":\"NODE_ENV=production grunt build\",\"preversion\":\"npm test\",\"version\":\"npm run build && grunt version && git add -A dist && git add CHANGELOG.md bower.json package.json\",\"postversion\":\"git push && git push --tags\",\"examples\":\"node ./examples/server.js\",\"coveralls\":\"cat coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js\",\"fix\":\"eslint --fix lib/**/*.js\"},\"repository\":{\"type\":\"git\",\"url\":\"https://github.com/axios/axios.git\"},\"keywords\":[\"xhr\",\"http\",\"ajax\",\"promise\",\"node\"],\"author\":\"Matt Zabriskie\",\"license\":\"MIT\",\"bugs\":{\"url\":\"https://github.com/axios/axios/issues\"},\"homepage\":\"https://axios-http.com\",\"devDependencies\":{\"coveralls\":\"^3.0.0\",\"es6-promise\":\"^4.2.4\",\"grunt\":\"^1.3.0\",\"grunt-banner\":\"^0.6.0\",\"grunt-cli\":\"^1.2.0\",\"grunt-contrib-clean\":\"^1.1.0\",\"grunt-contrib-watch\":\"^1.0.0\",\"grunt-eslint\":\"^23.0.0\",\"grunt-karma\":\"^4.0.0\",\"grunt-mocha-test\":\"^0.13.3\",\"grunt-ts\":\"^6.0.0-beta.19\",\"grunt-webpack\":\"^4.0.2\",\"istanbul-instrumenter-loader\":\"^1.0.0\",\"jasmine-core\":\"^2.4.1\",\"karma\":\"^6.3.2\",\"karma-chrome-launcher\":\"^3.1.0\",\"karma-firefox-launcher\":\"^2.1.0\",\"karma-jasmine\":\"^1.1.1\",\"karma-jasmine-ajax\":\"^0.1.13\",\"karma-safari-launcher\":\"^1.0.0\",\"karma-sauce-launcher\":\"^4.3.6\",\"karma-sinon\":\"^1.0.5\",\"karma-sourcemap-loader\":\"^0.3.8\",\"karma-webpack\":\"^4.0.2\",\"load-grunt-tasks\":\"^3.5.2\",\"minimist\":\"^1.2.0\",\"mocha\":\"^8.2.1\",\"sinon\":\"^4.5.0\",\"terser-webpack-plugin\":\"^4.2.3\",\"typescript\":\"^4.0.5\",\"url-search-params\":\"^0.10.0\",\"webpack\":\"^4.44.2\",\"webpack-dev-server\":\"^3.11.0\"},\"browser\":{\"./lib/adapters/http.js\":\"./lib/adapters/xhr.js\"},\"jsdelivr\":\"dist/axios.min.js\",\"unpkg\":\"dist/axios.min.js\",\"typings\":\"./index.d.ts\",\"dependencies\":{\"follow-redirects\":\"^1.14.0\"},\"bundlesize\":[{\"path\":\"./dist/axios.min.js\",\"threshold\":\"5kB\"}]}"); + +/***/ }) + +/******/ }); +}); +//# sourceMappingURL=axios.map \ No newline at end of file diff --git a/node_modules/hxz-api/node_modules/axios/dist/axios.map b/node_modules/hxz-api/node_modules/axios/dist/axios.map new file mode 100644 index 000000000..4aadb219e --- /dev/null +++ b/node_modules/hxz-api/node_modules/axios/dist/axios.map @@ -0,0 +1 @@ +{"version":3,"sources":["webpack://axios/webpack/universalModuleDefinition","webpack://axios/webpack/bootstrap","webpack://axios/./index.js","webpack://axios/./lib/adapters/xhr.js","webpack://axios/./lib/axios.js","webpack://axios/./lib/cancel/Cancel.js","webpack://axios/./lib/cancel/CancelToken.js","webpack://axios/./lib/cancel/isCancel.js","webpack://axios/./lib/core/Axios.js","webpack://axios/./lib/core/InterceptorManager.js","webpack://axios/./lib/core/buildFullPath.js","webpack://axios/./lib/core/createError.js","webpack://axios/./lib/core/dispatchRequest.js","webpack://axios/./lib/core/enhanceError.js","webpack://axios/./lib/core/mergeConfig.js","webpack://axios/./lib/core/settle.js","webpack://axios/./lib/core/transformData.js","webpack://axios/./lib/defaults.js","webpack://axios/./lib/helpers/bind.js","webpack://axios/./lib/helpers/buildURL.js","webpack://axios/./lib/helpers/combineURLs.js","webpack://axios/./lib/helpers/cookies.js","webpack://axios/./lib/helpers/isAbsoluteURL.js","webpack://axios/./lib/helpers/isAxiosError.js","webpack://axios/./lib/helpers/isURLSameOrigin.js","webpack://axios/./lib/helpers/normalizeHeaderName.js","webpack://axios/./lib/helpers/parseHeaders.js","webpack://axios/./lib/helpers/spread.js","webpack://axios/./lib/helpers/validator.js","webpack://axios/./lib/utils.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,O;QCVA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA,0CAA0C,gCAAgC;QAC1E;QACA;;QAEA;QACA;QACA;QACA,wDAAwD,kBAAkB;QAC1E;QACA,iDAAiD,cAAc;QAC/D;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA,yCAAyC,iCAAiC;QAC1E,gHAAgH,mBAAmB,EAAE;QACrI;QACA;;QAEA;QACA;QACA;QACA,2BAA2B,0BAA0B,EAAE;QACvD,iCAAiC,eAAe;QAChD;QACA;QACA;;QAEA;QACA,sDAAsD,+DAA+D;;QAErH;QACA;;;QAGA;QACA;;;;;;;;;;;;AClFA,iBAAiB,mBAAO,CAAC,mCAAa,E;;;;;;;;;;;;ACAzB;;AAEb,YAAY,mBAAO,CAAC,kCAAY;AAChC,aAAa,mBAAO,CAAC,8CAAkB;AACvC,cAAc,mBAAO,CAAC,sDAAsB;AAC5C,eAAe,mBAAO,CAAC,wDAAuB;AAC9C,oBAAoB,mBAAO,CAAC,0DAAuB;AACnD,mBAAmB,mBAAO,CAAC,gEAA2B;AACtD,sBAAsB,mBAAO,CAAC,sEAA8B;AAC5D,kBAAkB,mBAAO,CAAC,sDAAqB;;AAE/C;AACA;AACA;AACA;AACA;;AAEA;AACA,4CAA4C;AAC5C;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;;;;;;;;;;;;;AC5La;;AAEb,YAAY,mBAAO,CAAC,+BAAS;AAC7B,WAAW,mBAAO,CAAC,6CAAgB;AACnC,YAAY,mBAAO,CAAC,yCAAc;AAClC,kBAAkB,mBAAO,CAAC,qDAAoB;AAC9C,eAAe,mBAAO,CAAC,qCAAY;;AAEnC;AACA;AACA;AACA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AG;AACH;AACA;;AAEA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA,GAAG;;AAEH;AACA;AACA;AACA,GAAG;;AAEH;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,gDAAgD;AAChD;AACA;AACA,yBAAyB;AACzB,KAAK;AACL;AACA,CAAC;;AAED;AACA;AACA;AACA,gDAAgD;AAChD;AACA;AACA;AACA,KAAK;AACL;AACA,CAAC;;AAED;;;;;;;;;;;;;ACnJa;;AAEb,YAAY,mBAAO,CAAC,kCAAY;;AAEhC;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,SAAS;AACpB,WAAW,SAAS;AACpB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,SAAS;AACpB;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;AAEA;;;;;;;;;;;;;ACrDa;;AAEb,oBAAoB,mBAAO,CAAC,gEAA0B;AACtD,kBAAkB,mBAAO,CAAC,4DAAwB;;AAElD;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACnBa;;AAEb,mBAAmB,mBAAO,CAAC,kDAAgB;;AAE3C;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,MAAM;AACnB;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACjBa;;AAEb,YAAY,mBAAO,CAAC,kCAAY;AAChC,oBAAoB,mBAAO,CAAC,oDAAiB;AAC7C,eAAe,mBAAO,CAAC,oDAAoB;AAC3C,eAAe,mBAAO,CAAC,sCAAa;;AAEpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,+BAA+B;AAC/B,uCAAuC;AACvC;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,GAAG;AACH;;;;;;;;;;;;;ACjFa;;AAEb;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,MAAM;AACnB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACzCa;;AAEb,YAAY,mBAAO,CAAC,gCAAU;;AAE9B;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL,2BAA2B;AAC3B,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;;AAEH;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;;AAEA;AACA;;;;;;;;;;;;;ACtFa;;AAEb,kBAAkB,mBAAO,CAAC,gDAAe;;AAEzC;AACA;AACA;AACA,WAAW,SAAS;AACpB,WAAW,SAAS;AACpB,WAAW,OAAO;AAClB;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACxBa;;AAEb,YAAY,mBAAO,CAAC,kCAAY;AAChC,eAAe,mBAAO,CAAC,wCAAe;;AAEtC;AACA;AACA;AACA,WAAW,cAAc;AACzB,WAAW,MAAM;AACjB,WAAW,eAAe;AAC1B,aAAa,EAAE;AACf;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;;;;;;;;;;;;;ACrBa;;AAEb,YAAY,mBAAO,CAAC,+BAAS;AAC7B,0BAA0B,mBAAO,CAAC,2EAA+B;AACjE,mBAAmB,mBAAO,CAAC,uDAAqB;;AAEhD;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc,mBAAO,CAAC,6CAAgB;AACtC,GAAG;AACH;AACA,cAAc,mBAAO,CAAC,8CAAiB;AACvC;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,GAAG;;AAEH;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wEAAwE;AACxE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,CAAC;;AAED;AACA;AACA,CAAC;;AAED;;;;;;;;;;;;;ACrIa;;AAEb;AACA;AACA;AACA,mBAAmB,iBAAiB;AACpC;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACVa;;AAEb,YAAY,mBAAO,CAAC,kCAAY;;AAEhC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,OAAO;AACP,KAAK;;AAEL;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;;;;;;;;;;;;ACrEa;;AAEb;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACba;;AAEb,YAAY,mBAAO,CAAC,kCAAY;;AAEhC;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,0CAA0C;AAC1C,SAAS;;AAET;AACA,4DAA4D,wBAAwB;AACpF;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,kCAAkC;AAClC,+BAA+B,aAAa,EAAE;AAC9C;AACA;AACA,KAAK;AACL;;;;;;;;;;;;;ACpDa;;AAEb;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACba;;AAEb;AACA;AACA;AACA,WAAW,EAAE;AACb,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;;;;;;;;;;;;ACVa;;AAEb,YAAY,mBAAO,CAAC,kCAAY;;AAEhC;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,cAAc,OAAO;AACrB,gBAAgB;AAChB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,cAAc,OAAO;AACrB,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;;;;;;;;;;;;ACnEa;;AAEb,YAAY,mBAAO,CAAC,gCAAU;;AAE9B;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;;;;;;;;;;;;ACXa;;AAEb,YAAY,mBAAO,CAAC,kCAAY;;AAEhC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;;AAEA,iBAAiB,eAAe;;AAEhC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,GAAG;;AAEH;AACA;;;;;;;;;;;;;ACpDa;;AAEb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B;AAC/B;AACA;AACA,WAAW,SAAS;AACpB,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;AC1Ba;;AAEb,UAAU,mBAAO,CAAC,4CAAsB;;AAExC;;AAEA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;;AAEA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,QAAQ;AACnB,aAAa;AACb;AACA;AACA;AACA;AACA,iBAAiB,OAAO;AACxB;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,WAAW,kBAAkB;AAC7B,WAAW,QAAQ;AACnB,WAAW,OAAO;AAClB,aAAa;AACb;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,SAAS;AACpB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACxGa;;AAEb,WAAW,mBAAO,CAAC,6CAAgB;;AAEnC;;AAEA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,YAAY,QAAQ;AACpB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,OAAO;AACpB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,SAAS;AACpB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,mCAAmC,OAAO;AAC1C;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,SAAS,GAAG,SAAS;AAC5C,2BAA2B;AAC3B;AACA;AACA,WAAW,OAAO;AAClB,aAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,4BAA4B;AAC5B,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;;AAEA,uCAAuC,OAAO;AAC9C;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"axios.js","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[\"axios\"] = factory();\n\telse\n\t\troot[\"axios\"] = factory();\n})(window, function() {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = \"./index.js\");\n","module.exports = require('./lib/axios');","'use strict';\n\nvar utils = require('./../utils');\nvar settle = require('./../core/settle');\nvar cookies = require('./../helpers/cookies');\nvar buildURL = require('./../helpers/buildURL');\nvar buildFullPath = require('../core/buildFullPath');\nvar parseHeaders = require('./../helpers/parseHeaders');\nvar isURLSameOrigin = require('./../helpers/isURLSameOrigin');\nvar createError = require('../core/createError');\n\nmodule.exports = function xhrAdapter(config) {\n return new Promise(function dispatchXhrRequest(resolve, reject) {\n var requestData = config.data;\n var requestHeaders = config.headers;\n var responseType = config.responseType;\n\n if (utils.isFormData(requestData)) {\n delete requestHeaders['Content-Type']; // Let the browser set it\n }\n\n var request = new XMLHttpRequest();\n\n // HTTP basic authentication\n if (config.auth) {\n var username = config.auth.username || '';\n var password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : '';\n requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password);\n }\n\n var fullPath = buildFullPath(config.baseURL, config.url);\n request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true);\n\n // Set the request timeout in MS\n request.timeout = config.timeout;\n\n function onloadend() {\n if (!request) {\n return;\n }\n // Prepare the response\n var responseHeaders = 'getAllResponseHeaders' in request ? parseHeaders(request.getAllResponseHeaders()) : null;\n var responseData = !responseType || responseType === 'text' || responseType === 'json' ?\n request.responseText : request.response;\n var response = {\n data: responseData,\n status: request.status,\n statusText: request.statusText,\n headers: responseHeaders,\n config: config,\n request: request\n };\n\n settle(resolve, reject, response);\n\n // Clean up request\n request = null;\n }\n\n if ('onloadend' in request) {\n // Use onloadend if available\n request.onloadend = onloadend;\n } else {\n // Listen for ready state to emulate onloadend\n request.onreadystatechange = function handleLoad() {\n if (!request || request.readyState !== 4) {\n return;\n }\n\n // The request errored out and we didn't get a response, this will be\n // handled by onerror instead\n // With one exception: request that using file: protocol, most browsers\n // will return status as 0 even though it's a successful request\n if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {\n return;\n }\n // readystate handler is calling before onerror or ontimeout handlers,\n // so we should call onloadend on the next 'tick'\n setTimeout(onloadend);\n };\n }\n\n // Handle browser request cancellation (as opposed to a manual cancellation)\n request.onabort = function handleAbort() {\n if (!request) {\n return;\n }\n\n reject(createError('Request aborted', config, 'ECONNABORTED', request));\n\n // Clean up request\n request = null;\n };\n\n // Handle low level network errors\n request.onerror = function handleError() {\n // Real errors are hidden from us by the browser\n // onerror should only fire if it's a network error\n reject(createError('Network Error', config, null, request));\n\n // Clean up request\n request = null;\n };\n\n // Handle timeout\n request.ontimeout = function handleTimeout() {\n var timeoutErrorMessage = 'timeout of ' + config.timeout + 'ms exceeded';\n if (config.timeoutErrorMessage) {\n timeoutErrorMessage = config.timeoutErrorMessage;\n }\n reject(createError(\n timeoutErrorMessage,\n config,\n config.transitional && config.transitional.clarifyTimeoutError ? 'ETIMEDOUT' : 'ECONNABORTED',\n request));\n\n // Clean up request\n request = null;\n };\n\n // Add xsrf header\n // This is only done if running in a standard browser environment.\n // Specifically not if we're in a web worker, or react-native.\n if (utils.isStandardBrowserEnv()) {\n // Add xsrf header\n var xsrfValue = (config.withCredentials || isURLSameOrigin(fullPath)) && config.xsrfCookieName ?\n cookies.read(config.xsrfCookieName) :\n undefined;\n\n if (xsrfValue) {\n requestHeaders[config.xsrfHeaderName] = xsrfValue;\n }\n }\n\n // Add headers to the request\n if ('setRequestHeader' in request) {\n utils.forEach(requestHeaders, function setRequestHeader(val, key) {\n if (typeof requestData === 'undefined' && key.toLowerCase() === 'content-type') {\n // Remove Content-Type if data is undefined\n delete requestHeaders[key];\n } else {\n // Otherwise add header to the request\n request.setRequestHeader(key, val);\n }\n });\n }\n\n // Add withCredentials to request if needed\n if (!utils.isUndefined(config.withCredentials)) {\n request.withCredentials = !!config.withCredentials;\n }\n\n // Add responseType to request if needed\n if (responseType && responseType !== 'json') {\n request.responseType = config.responseType;\n }\n\n // Handle progress if needed\n if (typeof config.onDownloadProgress === 'function') {\n request.addEventListener('progress', config.onDownloadProgress);\n }\n\n // Not all browsers support upload events\n if (typeof config.onUploadProgress === 'function' && request.upload) {\n request.upload.addEventListener('progress', config.onUploadProgress);\n }\n\n if (config.cancelToken) {\n // Handle cancellation\n config.cancelToken.promise.then(function onCanceled(cancel) {\n if (!request) {\n return;\n }\n\n request.abort();\n reject(cancel);\n // Clean up request\n request = null;\n });\n }\n\n if (!requestData) {\n requestData = null;\n }\n\n // Send the request\n request.send(requestData);\n });\n};\n","'use strict';\n\nvar utils = require('./utils');\nvar bind = require('./helpers/bind');\nvar Axios = require('./core/Axios');\nvar mergeConfig = require('./core/mergeConfig');\nvar defaults = require('./defaults');\n\n/**\n * Create an instance of Axios\n *\n * @param {Object} defaultConfig The default config for the instance\n * @return {Axios} A new instance of Axios\n */\nfunction createInstance(defaultConfig) {\n var context = new Axios(defaultConfig);\n var instance = bind(Axios.prototype.request, context);\n\n // Copy axios.prototype to instance\n utils.extend(instance, Axios.prototype, context);\n\n // Copy context to instance\n utils.extend(instance, context);\n\n return instance;\n}\n\n// Create the default instance to be exported\nvar axios = createInstance(defaults);\n\n// Expose Axios class to allow class inheritance\naxios.Axios = Axios;\n\n// Factory for creating new instances\naxios.create = function create(instanceConfig) {\n return createInstance(mergeConfig(axios.defaults, instanceConfig));\n};\n\n// Expose Cancel & CancelToken\naxios.Cancel = require('./cancel/Cancel');\naxios.CancelToken = require('./cancel/CancelToken');\naxios.isCancel = require('./cancel/isCancel');\n\n// Expose all/spread\naxios.all = function all(promises) {\n return Promise.all(promises);\n};\naxios.spread = require('./helpers/spread');\n\n// Expose isAxiosError\naxios.isAxiosError = require('./helpers/isAxiosError');\n\nmodule.exports = axios;\n\n// Allow use of default import syntax in TypeScript\nmodule.exports.default = axios;\n","'use strict';\n\n/**\n * A `Cancel` is an object that is thrown when an operation is canceled.\n *\n * @class\n * @param {string=} message The message.\n */\nfunction Cancel(message) {\n this.message = message;\n}\n\nCancel.prototype.toString = function toString() {\n return 'Cancel' + (this.message ? ': ' + this.message : '');\n};\n\nCancel.prototype.__CANCEL__ = true;\n\nmodule.exports = Cancel;\n","'use strict';\n\nvar Cancel = require('./Cancel');\n\n/**\n * A `CancelToken` is an object that can be used to request cancellation of an operation.\n *\n * @class\n * @param {Function} executor The executor function.\n */\nfunction CancelToken(executor) {\n if (typeof executor !== 'function') {\n throw new TypeError('executor must be a function.');\n }\n\n var resolvePromise;\n this.promise = new Promise(function promiseExecutor(resolve) {\n resolvePromise = resolve;\n });\n\n var token = this;\n executor(function cancel(message) {\n if (token.reason) {\n // Cancellation has already been requested\n return;\n }\n\n token.reason = new Cancel(message);\n resolvePromise(token.reason);\n });\n}\n\n/**\n * Throws a `Cancel` if cancellation has been requested.\n */\nCancelToken.prototype.throwIfRequested = function throwIfRequested() {\n if (this.reason) {\n throw this.reason;\n }\n};\n\n/**\n * Returns an object that contains a new `CancelToken` and a function that, when called,\n * cancels the `CancelToken`.\n */\nCancelToken.source = function source() {\n var cancel;\n var token = new CancelToken(function executor(c) {\n cancel = c;\n });\n return {\n token: token,\n cancel: cancel\n };\n};\n\nmodule.exports = CancelToken;\n","'use strict';\n\nmodule.exports = function isCancel(value) {\n return !!(value && value.__CANCEL__);\n};\n","'use strict';\n\nvar utils = require('./../utils');\nvar buildURL = require('../helpers/buildURL');\nvar InterceptorManager = require('./InterceptorManager');\nvar dispatchRequest = require('./dispatchRequest');\nvar mergeConfig = require('./mergeConfig');\nvar validator = require('../helpers/validator');\n\nvar validators = validator.validators;\n/**\n * Create a new instance of Axios\n *\n * @param {Object} instanceConfig The default config for the instance\n */\nfunction Axios(instanceConfig) {\n this.defaults = instanceConfig;\n this.interceptors = {\n request: new InterceptorManager(),\n response: new InterceptorManager()\n };\n}\n\n/**\n * Dispatch a request\n *\n * @param {Object} config The config specific for this request (merged with this.defaults)\n */\nAxios.prototype.request = function request(config) {\n /*eslint no-param-reassign:0*/\n // Allow for axios('example/url'[, config]) a la fetch API\n if (typeof config === 'string') {\n config = arguments[1] || {};\n config.url = arguments[0];\n } else {\n config = config || {};\n }\n\n config = mergeConfig(this.defaults, config);\n\n // Set config.method\n if (config.method) {\n config.method = config.method.toLowerCase();\n } else if (this.defaults.method) {\n config.method = this.defaults.method.toLowerCase();\n } else {\n config.method = 'get';\n }\n\n var transitional = config.transitional;\n\n if (transitional !== undefined) {\n validator.assertOptions(transitional, {\n silentJSONParsing: validators.transitional(validators.boolean, '1.0.0'),\n forcedJSONParsing: validators.transitional(validators.boolean, '1.0.0'),\n clarifyTimeoutError: validators.transitional(validators.boolean, '1.0.0')\n }, false);\n }\n\n // filter out skipped interceptors\n var requestInterceptorChain = [];\n var synchronousRequestInterceptors = true;\n this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {\n if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) {\n return;\n }\n\n synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;\n\n requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);\n });\n\n var responseInterceptorChain = [];\n this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {\n responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);\n });\n\n var promise;\n\n if (!synchronousRequestInterceptors) {\n var chain = [dispatchRequest, undefined];\n\n Array.prototype.unshift.apply(chain, requestInterceptorChain);\n chain = chain.concat(responseInterceptorChain);\n\n promise = Promise.resolve(config);\n while (chain.length) {\n promise = promise.then(chain.shift(), chain.shift());\n }\n\n return promise;\n }\n\n\n var newConfig = config;\n while (requestInterceptorChain.length) {\n var onFulfilled = requestInterceptorChain.shift();\n var onRejected = requestInterceptorChain.shift();\n try {\n newConfig = onFulfilled(newConfig);\n } catch (error) {\n onRejected(error);\n break;\n }\n }\n\n try {\n promise = dispatchRequest(newConfig);\n } catch (error) {\n return Promise.reject(error);\n }\n\n while (responseInterceptorChain.length) {\n promise = promise.then(responseInterceptorChain.shift(), responseInterceptorChain.shift());\n }\n\n return promise;\n};\n\nAxios.prototype.getUri = function getUri(config) {\n config = mergeConfig(this.defaults, config);\n return buildURL(config.url, config.params, config.paramsSerializer).replace(/^\\?/, '');\n};\n\n// Provide aliases for supported request methods\nutils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, config) {\n return this.request(mergeConfig(config || {}, {\n method: method,\n url: url,\n data: (config || {}).data\n }));\n };\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, data, config) {\n return this.request(mergeConfig(config || {}, {\n method: method,\n url: url,\n data: data\n }));\n };\n});\n\nmodule.exports = Axios;\n","'use strict';\n\nvar utils = require('./../utils');\n\nfunction InterceptorManager() {\n this.handlers = [];\n}\n\n/**\n * Add a new interceptor to the stack\n *\n * @param {Function} fulfilled The function to handle `then` for a `Promise`\n * @param {Function} rejected The function to handle `reject` for a `Promise`\n *\n * @return {Number} An ID used to remove interceptor later\n */\nInterceptorManager.prototype.use = function use(fulfilled, rejected, options) {\n this.handlers.push({\n fulfilled: fulfilled,\n rejected: rejected,\n synchronous: options ? options.synchronous : false,\n runWhen: options ? options.runWhen : null\n });\n return this.handlers.length - 1;\n};\n\n/**\n * Remove an interceptor from the stack\n *\n * @param {Number} id The ID that was returned by `use`\n */\nInterceptorManager.prototype.eject = function eject(id) {\n if (this.handlers[id]) {\n this.handlers[id] = null;\n }\n};\n\n/**\n * Iterate over all the registered interceptors\n *\n * This method is particularly useful for skipping over any\n * interceptors that may have become `null` calling `eject`.\n *\n * @param {Function} fn The function to call for each interceptor\n */\nInterceptorManager.prototype.forEach = function forEach(fn) {\n utils.forEach(this.handlers, function forEachHandler(h) {\n if (h !== null) {\n fn(h);\n }\n });\n};\n\nmodule.exports = InterceptorManager;\n","'use strict';\n\nvar isAbsoluteURL = require('../helpers/isAbsoluteURL');\nvar combineURLs = require('../helpers/combineURLs');\n\n/**\n * Creates a new URL by combining the baseURL with the requestedURL,\n * only when the requestedURL is not already an absolute URL.\n * If the requestURL is absolute, this function returns the requestedURL untouched.\n *\n * @param {string} baseURL The base URL\n * @param {string} requestedURL Absolute or relative URL to combine\n * @returns {string} The combined full path\n */\nmodule.exports = function buildFullPath(baseURL, requestedURL) {\n if (baseURL && !isAbsoluteURL(requestedURL)) {\n return combineURLs(baseURL, requestedURL);\n }\n return requestedURL;\n};\n","'use strict';\n\nvar enhanceError = require('./enhanceError');\n\n/**\n * Create an Error with the specified message, config, error code, request and response.\n *\n * @param {string} message The error message.\n * @param {Object} config The config.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n * @returns {Error} The created error.\n */\nmodule.exports = function createError(message, config, code, request, response) {\n var error = new Error(message);\n return enhanceError(error, config, code, request, response);\n};\n","'use strict';\n\nvar utils = require('./../utils');\nvar transformData = require('./transformData');\nvar isCancel = require('../cancel/isCancel');\nvar defaults = require('../defaults');\n\n/**\n * Throws a `Cancel` if cancellation has been requested.\n */\nfunction throwIfCancellationRequested(config) {\n if (config.cancelToken) {\n config.cancelToken.throwIfRequested();\n }\n}\n\n/**\n * Dispatch a request to the server using the configured adapter.\n *\n * @param {object} config The config that is to be used for the request\n * @returns {Promise} The Promise to be fulfilled\n */\nmodule.exports = function dispatchRequest(config) {\n throwIfCancellationRequested(config);\n\n // Ensure headers exist\n config.headers = config.headers || {};\n\n // Transform request data\n config.data = transformData.call(\n config,\n config.data,\n config.headers,\n config.transformRequest\n );\n\n // Flatten headers\n config.headers = utils.merge(\n config.headers.common || {},\n config.headers[config.method] || {},\n config.headers\n );\n\n utils.forEach(\n ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],\n function cleanHeaderConfig(method) {\n delete config.headers[method];\n }\n );\n\n var adapter = config.adapter || defaults.adapter;\n\n return adapter(config).then(function onAdapterResolution(response) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n response.data = transformData.call(\n config,\n response.data,\n response.headers,\n config.transformResponse\n );\n\n return response;\n }, function onAdapterRejection(reason) {\n if (!isCancel(reason)) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n if (reason && reason.response) {\n reason.response.data = transformData.call(\n config,\n reason.response.data,\n reason.response.headers,\n config.transformResponse\n );\n }\n }\n\n return Promise.reject(reason);\n });\n};\n","'use strict';\n\n/**\n * Update an Error with the specified config, error code, and response.\n *\n * @param {Error} error The error to update.\n * @param {Object} config The config.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n * @returns {Error} The error.\n */\nmodule.exports = function enhanceError(error, config, code, request, response) {\n error.config = config;\n if (code) {\n error.code = code;\n }\n\n error.request = request;\n error.response = response;\n error.isAxiosError = true;\n\n error.toJSON = function toJSON() {\n return {\n // Standard\n message: this.message,\n name: this.name,\n // Microsoft\n description: this.description,\n number: this.number,\n // Mozilla\n fileName: this.fileName,\n lineNumber: this.lineNumber,\n columnNumber: this.columnNumber,\n stack: this.stack,\n // Axios\n config: this.config,\n code: this.code\n };\n };\n return error;\n};\n","'use strict';\n\nvar utils = require('../utils');\n\n/**\n * Config-specific merge-function which creates a new config-object\n * by merging two configuration objects together.\n *\n * @param {Object} config1\n * @param {Object} config2\n * @returns {Object} New object resulting from merging config2 to config1\n */\nmodule.exports = function mergeConfig(config1, config2) {\n // eslint-disable-next-line no-param-reassign\n config2 = config2 || {};\n var config = {};\n\n var valueFromConfig2Keys = ['url', 'method', 'data'];\n var mergeDeepPropertiesKeys = ['headers', 'auth', 'proxy', 'params'];\n var defaultToConfig2Keys = [\n 'baseURL', 'transformRequest', 'transformResponse', 'paramsSerializer',\n 'timeout', 'timeoutMessage', 'withCredentials', 'adapter', 'responseType', 'xsrfCookieName',\n 'xsrfHeaderName', 'onUploadProgress', 'onDownloadProgress', 'decompress',\n 'maxContentLength', 'maxBodyLength', 'maxRedirects', 'transport', 'httpAgent',\n 'httpsAgent', 'cancelToken', 'socketPath', 'responseEncoding'\n ];\n var directMergeKeys = ['validateStatus'];\n\n function getMergedValue(target, source) {\n if (utils.isPlainObject(target) && utils.isPlainObject(source)) {\n return utils.merge(target, source);\n } else if (utils.isPlainObject(source)) {\n return utils.merge({}, source);\n } else if (utils.isArray(source)) {\n return source.slice();\n }\n return source;\n }\n\n function mergeDeepProperties(prop) {\n if (!utils.isUndefined(config2[prop])) {\n config[prop] = getMergedValue(config1[prop], config2[prop]);\n } else if (!utils.isUndefined(config1[prop])) {\n config[prop] = getMergedValue(undefined, config1[prop]);\n }\n }\n\n utils.forEach(valueFromConfig2Keys, function valueFromConfig2(prop) {\n if (!utils.isUndefined(config2[prop])) {\n config[prop] = getMergedValue(undefined, config2[prop]);\n }\n });\n\n utils.forEach(mergeDeepPropertiesKeys, mergeDeepProperties);\n\n utils.forEach(defaultToConfig2Keys, function defaultToConfig2(prop) {\n if (!utils.isUndefined(config2[prop])) {\n config[prop] = getMergedValue(undefined, config2[prop]);\n } else if (!utils.isUndefined(config1[prop])) {\n config[prop] = getMergedValue(undefined, config1[prop]);\n }\n });\n\n utils.forEach(directMergeKeys, function merge(prop) {\n if (prop in config2) {\n config[prop] = getMergedValue(config1[prop], config2[prop]);\n } else if (prop in config1) {\n config[prop] = getMergedValue(undefined, config1[prop]);\n }\n });\n\n var axiosKeys = valueFromConfig2Keys\n .concat(mergeDeepPropertiesKeys)\n .concat(defaultToConfig2Keys)\n .concat(directMergeKeys);\n\n var otherKeys = Object\n .keys(config1)\n .concat(Object.keys(config2))\n .filter(function filterAxiosKeys(key) {\n return axiosKeys.indexOf(key) === -1;\n });\n\n utils.forEach(otherKeys, mergeDeepProperties);\n\n return config;\n};\n","'use strict';\n\nvar createError = require('./createError');\n\n/**\n * Resolve or reject a Promise based on response status.\n *\n * @param {Function} resolve A function that resolves the promise.\n * @param {Function} reject A function that rejects the promise.\n * @param {object} response The response.\n */\nmodule.exports = function settle(resolve, reject, response) {\n var validateStatus = response.config.validateStatus;\n if (!response.status || !validateStatus || validateStatus(response.status)) {\n resolve(response);\n } else {\n reject(createError(\n 'Request failed with status code ' + response.status,\n response.config,\n null,\n response.request,\n response\n ));\n }\n};\n","'use strict';\n\nvar utils = require('./../utils');\nvar defaults = require('./../defaults');\n\n/**\n * Transform the data for a request or a response\n *\n * @param {Object|String} data The data to be transformed\n * @param {Array} headers The headers for the request or response\n * @param {Array|Function} fns A single function or Array of functions\n * @returns {*} The resulting transformed data\n */\nmodule.exports = function transformData(data, headers, fns) {\n var context = this || defaults;\n /*eslint no-param-reassign:0*/\n utils.forEach(fns, function transform(fn) {\n data = fn.call(context, data, headers);\n });\n\n return data;\n};\n","'use strict';\n\nvar utils = require('./utils');\nvar normalizeHeaderName = require('./helpers/normalizeHeaderName');\nvar enhanceError = require('./core/enhanceError');\n\nvar DEFAULT_CONTENT_TYPE = {\n 'Content-Type': 'application/x-www-form-urlencoded'\n};\n\nfunction setContentTypeIfUnset(headers, value) {\n if (!utils.isUndefined(headers) && utils.isUndefined(headers['Content-Type'])) {\n headers['Content-Type'] = value;\n }\n}\n\nfunction getDefaultAdapter() {\n var adapter;\n if (typeof XMLHttpRequest !== 'undefined') {\n // For browsers use XHR adapter\n adapter = require('./adapters/xhr');\n } else if (typeof process !== 'undefined' && Object.prototype.toString.call(process) === '[object process]') {\n // For node use HTTP adapter\n adapter = require('./adapters/http');\n }\n return adapter;\n}\n\nfunction stringifySafely(rawValue, parser, encoder) {\n if (utils.isString(rawValue)) {\n try {\n (parser || JSON.parse)(rawValue);\n return utils.trim(rawValue);\n } catch (e) {\n if (e.name !== 'SyntaxError') {\n throw e;\n }\n }\n }\n\n return (encoder || JSON.stringify)(rawValue);\n}\n\nvar defaults = {\n\n transitional: {\n silentJSONParsing: true,\n forcedJSONParsing: true,\n clarifyTimeoutError: false\n },\n\n adapter: getDefaultAdapter(),\n\n transformRequest: [function transformRequest(data, headers) {\n normalizeHeaderName(headers, 'Accept');\n normalizeHeaderName(headers, 'Content-Type');\n\n if (utils.isFormData(data) ||\n utils.isArrayBuffer(data) ||\n utils.isBuffer(data) ||\n utils.isStream(data) ||\n utils.isFile(data) ||\n utils.isBlob(data)\n ) {\n return data;\n }\n if (utils.isArrayBufferView(data)) {\n return data.buffer;\n }\n if (utils.isURLSearchParams(data)) {\n setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8');\n return data.toString();\n }\n if (utils.isObject(data) || (headers && headers['Content-Type'] === 'application/json')) {\n setContentTypeIfUnset(headers, 'application/json');\n return stringifySafely(data);\n }\n return data;\n }],\n\n transformResponse: [function transformResponse(data) {\n var transitional = this.transitional;\n var silentJSONParsing = transitional && transitional.silentJSONParsing;\n var forcedJSONParsing = transitional && transitional.forcedJSONParsing;\n var strictJSONParsing = !silentJSONParsing && this.responseType === 'json';\n\n if (strictJSONParsing || (forcedJSONParsing && utils.isString(data) && data.length)) {\n try {\n return JSON.parse(data);\n } catch (e) {\n if (strictJSONParsing) {\n if (e.name === 'SyntaxError') {\n throw enhanceError(e, this, 'E_JSON_PARSE');\n }\n throw e;\n }\n }\n }\n\n return data;\n }],\n\n /**\n * A timeout in milliseconds to abort a request. If set to 0 (default) a\n * timeout is not created.\n */\n timeout: 0,\n\n xsrfCookieName: 'XSRF-TOKEN',\n xsrfHeaderName: 'X-XSRF-TOKEN',\n\n maxContentLength: -1,\n maxBodyLength: -1,\n\n validateStatus: function validateStatus(status) {\n return status >= 200 && status < 300;\n }\n};\n\ndefaults.headers = {\n common: {\n 'Accept': 'application/json, text/plain, */*'\n }\n};\n\nutils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) {\n defaults.headers[method] = {};\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE);\n});\n\nmodule.exports = defaults;\n","'use strict';\n\nmodule.exports = function bind(fn, thisArg) {\n return function wrap() {\n var args = new Array(arguments.length);\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i];\n }\n return fn.apply(thisArg, args);\n };\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\nfunction encode(val) {\n return encodeURIComponent(val).\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%20/g, '+').\n replace(/%5B/gi, '[').\n replace(/%5D/gi, ']');\n}\n\n/**\n * Build a URL by appending params to the end\n *\n * @param {string} url The base of the url (e.g., http://www.google.com)\n * @param {object} [params] The params to be appended\n * @returns {string} The formatted url\n */\nmodule.exports = function buildURL(url, params, paramsSerializer) {\n /*eslint no-param-reassign:0*/\n if (!params) {\n return url;\n }\n\n var serializedParams;\n if (paramsSerializer) {\n serializedParams = paramsSerializer(params);\n } else if (utils.isURLSearchParams(params)) {\n serializedParams = params.toString();\n } else {\n var parts = [];\n\n utils.forEach(params, function serialize(val, key) {\n if (val === null || typeof val === 'undefined') {\n return;\n }\n\n if (utils.isArray(val)) {\n key = key + '[]';\n } else {\n val = [val];\n }\n\n utils.forEach(val, function parseValue(v) {\n if (utils.isDate(v)) {\n v = v.toISOString();\n } else if (utils.isObject(v)) {\n v = JSON.stringify(v);\n }\n parts.push(encode(key) + '=' + encode(v));\n });\n });\n\n serializedParams = parts.join('&');\n }\n\n if (serializedParams) {\n var hashmarkIndex = url.indexOf('#');\n if (hashmarkIndex !== -1) {\n url = url.slice(0, hashmarkIndex);\n }\n\n url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;\n }\n\n return url;\n};\n","'use strict';\n\n/**\n * Creates a new URL by combining the specified URLs\n *\n * @param {string} baseURL The base URL\n * @param {string} relativeURL The relative URL\n * @returns {string} The combined URL\n */\nmodule.exports = function combineURLs(baseURL, relativeURL) {\n return relativeURL\n ? baseURL.replace(/\\/+$/, '') + '/' + relativeURL.replace(/^\\/+/, '')\n : baseURL;\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\nmodule.exports = (\n utils.isStandardBrowserEnv() ?\n\n // Standard browser envs support document.cookie\n (function standardBrowserEnv() {\n return {\n write: function write(name, value, expires, path, domain, secure) {\n var cookie = [];\n cookie.push(name + '=' + encodeURIComponent(value));\n\n if (utils.isNumber(expires)) {\n cookie.push('expires=' + new Date(expires).toGMTString());\n }\n\n if (utils.isString(path)) {\n cookie.push('path=' + path);\n }\n\n if (utils.isString(domain)) {\n cookie.push('domain=' + domain);\n }\n\n if (secure === true) {\n cookie.push('secure');\n }\n\n document.cookie = cookie.join('; ');\n },\n\n read: function read(name) {\n var match = document.cookie.match(new RegExp('(^|;\\\\s*)(' + name + ')=([^;]*)'));\n return (match ? decodeURIComponent(match[3]) : null);\n },\n\n remove: function remove(name) {\n this.write(name, '', Date.now() - 86400000);\n }\n };\n })() :\n\n // Non standard browser env (web workers, react-native) lack needed support.\n (function nonStandardBrowserEnv() {\n return {\n write: function write() {},\n read: function read() { return null; },\n remove: function remove() {}\n };\n })()\n);\n","'use strict';\n\n/**\n * Determines whether the specified URL is absolute\n *\n * @param {string} url The URL to test\n * @returns {boolean} True if the specified URL is absolute, otherwise false\n */\nmodule.exports = function isAbsoluteURL(url) {\n // A URL is considered absolute if it begins with \"://\" or \"//\" (protocol-relative URL).\n // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed\n // by any combination of letters, digits, plus, period, or hyphen.\n return /^([a-z][a-z\\d\\+\\-\\.]*:)?\\/\\//i.test(url);\n};\n","'use strict';\n\n/**\n * Determines whether the payload is an error thrown by Axios\n *\n * @param {*} payload The value to test\n * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false\n */\nmodule.exports = function isAxiosError(payload) {\n return (typeof payload === 'object') && (payload.isAxiosError === true);\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\nmodule.exports = (\n utils.isStandardBrowserEnv() ?\n\n // Standard browser envs have full support of the APIs needed to test\n // whether the request URL is of the same origin as current location.\n (function standardBrowserEnv() {\n var msie = /(msie|trident)/i.test(navigator.userAgent);\n var urlParsingNode = document.createElement('a');\n var originURL;\n\n /**\n * Parse a URL to discover it's components\n *\n * @param {String} url The URL to be parsed\n * @returns {Object}\n */\n function resolveURL(url) {\n var href = url;\n\n if (msie) {\n // IE needs attribute set twice to normalize properties\n urlParsingNode.setAttribute('href', href);\n href = urlParsingNode.href;\n }\n\n urlParsingNode.setAttribute('href', href);\n\n // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils\n return {\n href: urlParsingNode.href,\n protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',\n host: urlParsingNode.host,\n search: urlParsingNode.search ? urlParsingNode.search.replace(/^\\?/, '') : '',\n hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',\n hostname: urlParsingNode.hostname,\n port: urlParsingNode.port,\n pathname: (urlParsingNode.pathname.charAt(0) === '/') ?\n urlParsingNode.pathname :\n '/' + urlParsingNode.pathname\n };\n }\n\n originURL = resolveURL(window.location.href);\n\n /**\n * Determine if a URL shares the same origin as the current location\n *\n * @param {String} requestURL The URL to test\n * @returns {boolean} True if URL shares the same origin, otherwise false\n */\n return function isURLSameOrigin(requestURL) {\n var parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL;\n return (parsed.protocol === originURL.protocol &&\n parsed.host === originURL.host);\n };\n })() :\n\n // Non standard browser envs (web workers, react-native) lack needed support.\n (function nonStandardBrowserEnv() {\n return function isURLSameOrigin() {\n return true;\n };\n })()\n);\n","'use strict';\n\nvar utils = require('../utils');\n\nmodule.exports = function normalizeHeaderName(headers, normalizedName) {\n utils.forEach(headers, function processHeader(value, name) {\n if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) {\n headers[normalizedName] = value;\n delete headers[name];\n }\n });\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\n// Headers whose duplicates are ignored by node\n// c.f. https://nodejs.org/api/http.html#http_message_headers\nvar ignoreDuplicateOf = [\n 'age', 'authorization', 'content-length', 'content-type', 'etag',\n 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',\n 'last-modified', 'location', 'max-forwards', 'proxy-authorization',\n 'referer', 'retry-after', 'user-agent'\n];\n\n/**\n * Parse headers into an object\n *\n * ```\n * Date: Wed, 27 Aug 2014 08:58:49 GMT\n * Content-Type: application/json\n * Connection: keep-alive\n * Transfer-Encoding: chunked\n * ```\n *\n * @param {String} headers Headers needing to be parsed\n * @returns {Object} Headers parsed into an object\n */\nmodule.exports = function parseHeaders(headers) {\n var parsed = {};\n var key;\n var val;\n var i;\n\n if (!headers) { return parsed; }\n\n utils.forEach(headers.split('\\n'), function parser(line) {\n i = line.indexOf(':');\n key = utils.trim(line.substr(0, i)).toLowerCase();\n val = utils.trim(line.substr(i + 1));\n\n if (key) {\n if (parsed[key] && ignoreDuplicateOf.indexOf(key) >= 0) {\n return;\n }\n if (key === 'set-cookie') {\n parsed[key] = (parsed[key] ? parsed[key] : []).concat([val]);\n } else {\n parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;\n }\n }\n });\n\n return parsed;\n};\n","'use strict';\n\n/**\n * Syntactic sugar for invoking a function and expanding an array for arguments.\n *\n * Common use case would be to use `Function.prototype.apply`.\n *\n * ```js\n * function f(x, y, z) {}\n * var args = [1, 2, 3];\n * f.apply(null, args);\n * ```\n *\n * With `spread` this example can be re-written.\n *\n * ```js\n * spread(function(x, y, z) {})([1, 2, 3]);\n * ```\n *\n * @param {Function} callback\n * @returns {Function}\n */\nmodule.exports = function spread(callback) {\n return function wrap(arr) {\n return callback.apply(null, arr);\n };\n};\n","'use strict';\n\nvar pkg = require('./../../package.json');\n\nvar validators = {};\n\n// eslint-disable-next-line func-names\n['object', 'boolean', 'number', 'function', 'string', 'symbol'].forEach(function(type, i) {\n validators[type] = function validator(thing) {\n return typeof thing === type || 'a' + (i < 1 ? 'n ' : ' ') + type;\n };\n});\n\nvar deprecatedWarnings = {};\nvar currentVerArr = pkg.version.split('.');\n\n/**\n * Compare package versions\n * @param {string} version\n * @param {string?} thanVersion\n * @returns {boolean}\n */\nfunction isOlderVersion(version, thanVersion) {\n var pkgVersionArr = thanVersion ? thanVersion.split('.') : currentVerArr;\n var destVer = version.split('.');\n for (var i = 0; i < 3; i++) {\n if (pkgVersionArr[i] > destVer[i]) {\n return true;\n } else if (pkgVersionArr[i] < destVer[i]) {\n return false;\n }\n }\n return false;\n}\n\n/**\n * Transitional option validator\n * @param {function|boolean?} validator\n * @param {string?} version\n * @param {string} message\n * @returns {function}\n */\nvalidators.transitional = function transitional(validator, version, message) {\n var isDeprecated = version && isOlderVersion(version);\n\n function formatMessage(opt, desc) {\n return '[Axios v' + pkg.version + '] Transitional option \\'' + opt + '\\'' + desc + (message ? '. ' + message : '');\n }\n\n // eslint-disable-next-line func-names\n return function(value, opt, opts) {\n if (validator === false) {\n throw new Error(formatMessage(opt, ' has been removed in ' + version));\n }\n\n if (isDeprecated && !deprecatedWarnings[opt]) {\n deprecatedWarnings[opt] = true;\n // eslint-disable-next-line no-console\n console.warn(\n formatMessage(\n opt,\n ' has been deprecated since v' + version + ' and will be removed in the near future'\n )\n );\n }\n\n return validator ? validator(value, opt, opts) : true;\n };\n};\n\n/**\n * Assert object's properties type\n * @param {object} options\n * @param {object} schema\n * @param {boolean?} allowUnknown\n */\n\nfunction assertOptions(options, schema, allowUnknown) {\n if (typeof options !== 'object') {\n throw new TypeError('options must be an object');\n }\n var keys = Object.keys(options);\n var i = keys.length;\n while (i-- > 0) {\n var opt = keys[i];\n var validator = schema[opt];\n if (validator) {\n var value = options[opt];\n var result = value === undefined || validator(value, opt, options);\n if (result !== true) {\n throw new TypeError('option ' + opt + ' must be ' + result);\n }\n continue;\n }\n if (allowUnknown !== true) {\n throw Error('Unknown option ' + opt);\n }\n }\n}\n\nmodule.exports = {\n isOlderVersion: isOlderVersion,\n assertOptions: assertOptions,\n validators: validators\n};\n","'use strict';\n\nvar bind = require('./helpers/bind');\n\n// utils is a library of generic helper functions non-specific to axios\n\nvar toString = Object.prototype.toString;\n\n/**\n * Determine if a value is an Array\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an Array, otherwise false\n */\nfunction isArray(val) {\n return toString.call(val) === '[object Array]';\n}\n\n/**\n * Determine if a value is undefined\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if the value is undefined, otherwise false\n */\nfunction isUndefined(val) {\n return typeof val === 'undefined';\n}\n\n/**\n * Determine if a value is a Buffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Buffer, otherwise false\n */\nfunction isBuffer(val) {\n return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor)\n && typeof val.constructor.isBuffer === 'function' && val.constructor.isBuffer(val);\n}\n\n/**\n * Determine if a value is an ArrayBuffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an ArrayBuffer, otherwise false\n */\nfunction isArrayBuffer(val) {\n return toString.call(val) === '[object ArrayBuffer]';\n}\n\n/**\n * Determine if a value is a FormData\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an FormData, otherwise false\n */\nfunction isFormData(val) {\n return (typeof FormData !== 'undefined') && (val instanceof FormData);\n}\n\n/**\n * Determine if a value is a view on an ArrayBuffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false\n */\nfunction isArrayBufferView(val) {\n var result;\n if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {\n result = ArrayBuffer.isView(val);\n } else {\n result = (val) && (val.buffer) && (val.buffer instanceof ArrayBuffer);\n }\n return result;\n}\n\n/**\n * Determine if a value is a String\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a String, otherwise false\n */\nfunction isString(val) {\n return typeof val === 'string';\n}\n\n/**\n * Determine if a value is a Number\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Number, otherwise false\n */\nfunction isNumber(val) {\n return typeof val === 'number';\n}\n\n/**\n * Determine if a value is an Object\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an Object, otherwise false\n */\nfunction isObject(val) {\n return val !== null && typeof val === 'object';\n}\n\n/**\n * Determine if a value is a plain Object\n *\n * @param {Object} val The value to test\n * @return {boolean} True if value is a plain Object, otherwise false\n */\nfunction isPlainObject(val) {\n if (toString.call(val) !== '[object Object]') {\n return false;\n }\n\n var prototype = Object.getPrototypeOf(val);\n return prototype === null || prototype === Object.prototype;\n}\n\n/**\n * Determine if a value is a Date\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Date, otherwise false\n */\nfunction isDate(val) {\n return toString.call(val) === '[object Date]';\n}\n\n/**\n * Determine if a value is a File\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a File, otherwise false\n */\nfunction isFile(val) {\n return toString.call(val) === '[object File]';\n}\n\n/**\n * Determine if a value is a Blob\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Blob, otherwise false\n */\nfunction isBlob(val) {\n return toString.call(val) === '[object Blob]';\n}\n\n/**\n * Determine if a value is a Function\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Function, otherwise false\n */\nfunction isFunction(val) {\n return toString.call(val) === '[object Function]';\n}\n\n/**\n * Determine if a value is a Stream\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Stream, otherwise false\n */\nfunction isStream(val) {\n return isObject(val) && isFunction(val.pipe);\n}\n\n/**\n * Determine if a value is a URLSearchParams object\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a URLSearchParams object, otherwise false\n */\nfunction isURLSearchParams(val) {\n return typeof URLSearchParams !== 'undefined' && val instanceof URLSearchParams;\n}\n\n/**\n * Trim excess whitespace off the beginning and end of a string\n *\n * @param {String} str The String to trim\n * @returns {String} The String freed of excess whitespace\n */\nfunction trim(str) {\n return str.trim ? str.trim() : str.replace(/^\\s+|\\s+$/g, '');\n}\n\n/**\n * Determine if we're running in a standard browser environment\n *\n * This allows axios to run in a web worker, and react-native.\n * Both environments support XMLHttpRequest, but not fully standard globals.\n *\n * web workers:\n * typeof window -> undefined\n * typeof document -> undefined\n *\n * react-native:\n * navigator.product -> 'ReactNative'\n * nativescript\n * navigator.product -> 'NativeScript' or 'NS'\n */\nfunction isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}\n\n/**\n * Iterate over an Array or an Object invoking a function for each item.\n *\n * If `obj` is an Array callback will be called passing\n * the value, index, and complete array for each item.\n *\n * If 'obj' is an Object callback will be called passing\n * the value, key, and complete object for each property.\n *\n * @param {Object|Array} obj The object to iterate\n * @param {Function} fn The callback to invoke for each item\n */\nfunction forEach(obj, fn) {\n // Don't bother if no value provided\n if (obj === null || typeof obj === 'undefined') {\n return;\n }\n\n // Force an array if not already something iterable\n if (typeof obj !== 'object') {\n /*eslint no-param-reassign:0*/\n obj = [obj];\n }\n\n if (isArray(obj)) {\n // Iterate over array values\n for (var i = 0, l = obj.length; i < l; i++) {\n fn.call(null, obj[i], i, obj);\n }\n } else {\n // Iterate over object keys\n for (var key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key)) {\n fn.call(null, obj[key], key, obj);\n }\n }\n }\n}\n\n/**\n * Accepts varargs expecting each argument to be an object, then\n * immutably merges the properties of each object and returns result.\n *\n * When multiple objects contain the same key the later object in\n * the arguments list will take precedence.\n *\n * Example:\n *\n * ```js\n * var result = merge({foo: 123}, {foo: 456});\n * console.log(result.foo); // outputs 456\n * ```\n *\n * @param {Object} obj1 Object to merge\n * @returns {Object} Result of all merge properties\n */\nfunction merge(/* obj1, obj2, obj3, ... */) {\n var result = {};\n function assignValue(val, key) {\n if (isPlainObject(result[key]) && isPlainObject(val)) {\n result[key] = merge(result[key], val);\n } else if (isPlainObject(val)) {\n result[key] = merge({}, val);\n } else if (isArray(val)) {\n result[key] = val.slice();\n } else {\n result[key] = val;\n }\n }\n\n for (var i = 0, l = arguments.length; i < l; i++) {\n forEach(arguments[i], assignValue);\n }\n return result;\n}\n\n/**\n * Extends object a by mutably adding to it the properties of object b.\n *\n * @param {Object} a The object to be extended\n * @param {Object} b The object to copy properties from\n * @param {Object} thisArg The object to bind function to\n * @return {Object} The resulting value of object a\n */\nfunction extend(a, b, thisArg) {\n forEach(b, function assignValue(val, key) {\n if (thisArg && typeof val === 'function') {\n a[key] = bind(val, thisArg);\n } else {\n a[key] = val;\n }\n });\n return a;\n}\n\n/**\n * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM)\n *\n * @param {string} content with BOM\n * @return {string} content value without BOM\n */\nfunction stripBOM(content) {\n if (content.charCodeAt(0) === 0xFEFF) {\n content = content.slice(1);\n }\n return content;\n}\n\nmodule.exports = {\n isArray: isArray,\n isArrayBuffer: isArrayBuffer,\n isBuffer: isBuffer,\n isFormData: isFormData,\n isArrayBufferView: isArrayBufferView,\n isString: isString,\n isNumber: isNumber,\n isObject: isObject,\n isPlainObject: isPlainObject,\n isUndefined: isUndefined,\n isDate: isDate,\n isFile: isFile,\n isBlob: isBlob,\n isFunction: isFunction,\n isStream: isStream,\n isURLSearchParams: isURLSearchParams,\n isStandardBrowserEnv: isStandardBrowserEnv,\n forEach: forEach,\n merge: merge,\n extend: extend,\n trim: trim,\n stripBOM: stripBOM\n};\n"],"sourceRoot":""} \ No newline at end of file diff --git a/node_modules/hxz-api/node_modules/axios/dist/axios.min.js b/node_modules/hxz-api/node_modules/axios/dist/axios.min.js new file mode 100644 index 000000000..d5b138ad0 --- /dev/null +++ b/node_modules/hxz-api/node_modules/axios/dist/axios.min.js @@ -0,0 +1,3 @@ +/* axios v0.21.4 | (c) 2021 by Matt Zabriskie */ +!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.axios=t():e.axios=t()}(window,(function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=10)}([function(e,t,r){"use strict";var n=r(2),o=Object.prototype.toString;function i(e){return"[object Array]"===o.call(e)}function s(e){return void 0===e}function a(e){return null!==e&&"object"==typeof e}function u(e){if("[object Object]"!==o.call(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}function c(e){return"[object Function]"===o.call(e)}function f(e,t){if(null!=e)if("object"!=typeof e&&(e=[e]),i(e))for(var r=0,n=e.length;r=200&&e<300}};c.headers={common:{Accept:"application/json, text/plain, */*"}},n.forEach(["delete","get","head"],(function(e){c.headers[e]={}})),n.forEach(["post","put","patch"],(function(e){c.headers[e]=n.merge(s)})),e.exports=c},function(e,t,r){"use strict";e.exports=function(e,t){return function(){for(var r=new Array(arguments.length),n=0;n=0)return;s[t]="set-cookie"===t?(s[t]?s[t]:[]).concat([r]):s[t]?s[t]+", "+r:r}})),s):s}},function(e,t,r){"use strict";var n=r(0);e.exports=n.isStandardBrowserEnv()?function(){var e,t=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a");function o(e){var n=e;return t&&(r.setAttribute("href",n),n=r.href),r.setAttribute("href",n),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:"/"===r.pathname.charAt(0)?r.pathname:"/"+r.pathname}}return e=o(window.location.href),function(t){var r=n.isString(t)?o(t):t;return r.protocol===e.protocol&&r.host===e.host}}():function(){return!0}},function(e,t,r){"use strict";var n=r(25),o={};["object","boolean","number","function","string","symbol"].forEach((function(e,t){o[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}}));var i={},s=n.version.split(".");function a(e,t){for(var r=t?t.split("."):s,n=e.split("."),o=0;o<3;o++){if(r[o]>n[o])return!0;if(r[o]0;){var i=n[o],s=t[i];if(s){var a=e[i],u=void 0===a||s(a,i,e);if(!0!==u)throw new TypeError("option "+i+" must be "+u)}else if(!0!==r)throw Error("Unknown option "+i)}},validators:o}},function(e){e.exports=JSON.parse('{"name":"axios","version":"0.21.4","description":"Promise based HTTP client for the browser and node.js","main":"index.js","scripts":{"test":"grunt test","start":"node ./sandbox/server.js","build":"NODE_ENV=production grunt build","preversion":"npm test","version":"npm run build && grunt version && git add -A dist && git add CHANGELOG.md bower.json package.json","postversion":"git push && git push --tags","examples":"node ./examples/server.js","coveralls":"cat coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js","fix":"eslint --fix lib/**/*.js"},"repository":{"type":"git","url":"https://github.com/axios/axios.git"},"keywords":["xhr","http","ajax","promise","node"],"author":"Matt Zabriskie","license":"MIT","bugs":{"url":"https://github.com/axios/axios/issues"},"homepage":"https://axios-http.com","devDependencies":{"coveralls":"^3.0.0","es6-promise":"^4.2.4","grunt":"^1.3.0","grunt-banner":"^0.6.0","grunt-cli":"^1.2.0","grunt-contrib-clean":"^1.1.0","grunt-contrib-watch":"^1.0.0","grunt-eslint":"^23.0.0","grunt-karma":"^4.0.0","grunt-mocha-test":"^0.13.3","grunt-ts":"^6.0.0-beta.19","grunt-webpack":"^4.0.2","istanbul-instrumenter-loader":"^1.0.0","jasmine-core":"^2.4.1","karma":"^6.3.2","karma-chrome-launcher":"^3.1.0","karma-firefox-launcher":"^2.1.0","karma-jasmine":"^1.1.1","karma-jasmine-ajax":"^0.1.13","karma-safari-launcher":"^1.0.0","karma-sauce-launcher":"^4.3.6","karma-sinon":"^1.0.5","karma-sourcemap-loader":"^0.3.8","karma-webpack":"^4.0.2","load-grunt-tasks":"^3.5.2","minimist":"^1.2.0","mocha":"^8.2.1","sinon":"^4.5.0","terser-webpack-plugin":"^4.2.3","typescript":"^4.0.5","url-search-params":"^0.10.0","webpack":"^4.44.2","webpack-dev-server":"^3.11.0"},"browser":{"./lib/adapters/http.js":"./lib/adapters/xhr.js"},"jsdelivr":"dist/axios.min.js","unpkg":"dist/axios.min.js","typings":"./index.d.ts","dependencies":{"follow-redirects":"^1.14.0"},"bundlesize":[{"path":"./dist/axios.min.js","threshold":"5kB"}]}')},function(e,t,r){"use strict";var n=r(9);function o(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise((function(e){t=e}));var r=this;e((function(e){r.reason||(r.reason=new n(e),t(r.reason))}))}o.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},o.source=function(){var e;return{token:new o((function(t){e=t})),cancel:e}},e.exports=o},function(e,t,r){"use strict";e.exports=function(e){return function(t){return e.apply(null,t)}}},function(e,t,r){"use strict";e.exports=function(e){return"object"==typeof e&&!0===e.isAxiosError}}])})); +//# sourceMappingURL=axios.min.map \ No newline at end of file diff --git a/node_modules/hxz-api/node_modules/axios/dist/axios.min.map b/node_modules/hxz-api/node_modules/axios/dist/axios.min.map new file mode 100644 index 000000000..468a5babc --- /dev/null +++ b/node_modules/hxz-api/node_modules/axios/dist/axios.min.map @@ -0,0 +1 @@ +{"version":3,"sources":["webpack://axios/webpack/universalModuleDefinition","webpack://axios/webpack/bootstrap","webpack://axios/./lib/utils.js","webpack://axios/./lib/defaults.js","webpack://axios/./lib/helpers/bind.js","webpack://axios/./lib/helpers/buildURL.js","webpack://axios/./lib/core/enhanceError.js","webpack://axios/./lib/adapters/xhr.js","webpack://axios/./lib/core/createError.js","webpack://axios/./lib/cancel/isCancel.js","webpack://axios/./lib/core/mergeConfig.js","webpack://axios/./lib/cancel/Cancel.js","webpack://axios/./index.js","webpack://axios/./lib/axios.js","webpack://axios/./lib/core/Axios.js","webpack://axios/./lib/core/InterceptorManager.js","webpack://axios/./lib/core/dispatchRequest.js","webpack://axios/./lib/core/transformData.js","webpack://axios/./lib/helpers/normalizeHeaderName.js","webpack://axios/./lib/core/settle.js","webpack://axios/./lib/helpers/cookies.js","webpack://axios/./lib/core/buildFullPath.js","webpack://axios/./lib/helpers/isAbsoluteURL.js","webpack://axios/./lib/helpers/combineURLs.js","webpack://axios/./lib/helpers/parseHeaders.js","webpack://axios/./lib/helpers/isURLSameOrigin.js","webpack://axios/./lib/helpers/validator.js","webpack://axios/./lib/cancel/CancelToken.js","webpack://axios/./lib/helpers/spread.js","webpack://axios/./lib/helpers/isAxiosError.js"],"names":["root","factory","exports","module","define","amd","window","installedModules","__webpack_require__","moduleId","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","toString","isArray","val","isUndefined","isObject","isPlainObject","getPrototypeOf","isFunction","forEach","obj","fn","length","isArrayBuffer","isBuffer","constructor","isFormData","FormData","isArrayBufferView","ArrayBuffer","isView","buffer","isString","isNumber","isDate","isFile","isBlob","isStream","pipe","isURLSearchParams","URLSearchParams","isStandardBrowserEnv","navigator","product","document","merge","result","assignValue","slice","arguments","extend","a","b","thisArg","trim","str","replace","stripBOM","content","charCodeAt","utils","normalizeHeaderName","enhanceError","DEFAULT_CONTENT_TYPE","setContentTypeIfUnset","headers","adapter","defaults","transitional","silentJSONParsing","forcedJSONParsing","clarifyTimeoutError","XMLHttpRequest","process","transformRequest","data","rawValue","parser","encoder","JSON","parse","e","stringify","stringifySafely","transformResponse","this","strictJSONParsing","responseType","timeout","xsrfCookieName","xsrfHeaderName","maxContentLength","maxBodyLength","validateStatus","status","common","method","args","Array","apply","encode","encodeURIComponent","url","params","paramsSerializer","serializedParams","parts","v","toISOString","push","join","hashmarkIndex","indexOf","error","config","code","request","response","isAxiosError","toJSON","message","description","number","fileName","lineNumber","columnNumber","stack","settle","cookies","buildURL","buildFullPath","parseHeaders","isURLSameOrigin","createError","Promise","resolve","reject","requestData","requestHeaders","auth","username","password","unescape","Authorization","btoa","fullPath","baseURL","onloadend","responseHeaders","getAllResponseHeaders","responseText","statusText","open","toUpperCase","onreadystatechange","readyState","responseURL","setTimeout","onabort","onerror","ontimeout","timeoutErrorMessage","xsrfValue","withCredentials","read","undefined","toLowerCase","setRequestHeader","onDownloadProgress","addEventListener","onUploadProgress","upload","cancelToken","promise","then","cancel","abort","send","Error","__CANCEL__","config1","config2","valueFromConfig2Keys","mergeDeepPropertiesKeys","defaultToConfig2Keys","directMergeKeys","getMergedValue","target","source","mergeDeepProperties","prop","axiosKeys","concat","otherKeys","keys","filter","Cancel","Axios","mergeConfig","createInstance","defaultConfig","context","instance","axios","instanceConfig","CancelToken","isCancel","all","promises","spread","default","InterceptorManager","dispatchRequest","validator","validators","interceptors","assertOptions","boolean","requestInterceptorChain","synchronousRequestInterceptors","interceptor","runWhen","synchronous","unshift","fulfilled","rejected","responseInterceptorChain","chain","shift","newConfig","onFulfilled","onRejected","getUri","handlers","use","options","eject","id","h","transformData","throwIfCancellationRequested","throwIfRequested","reason","fns","normalizedName","write","expires","path","domain","secure","cookie","Date","toGMTString","match","RegExp","decodeURIComponent","remove","now","isAbsoluteURL","combineURLs","requestedURL","test","relativeURL","ignoreDuplicateOf","parsed","split","line","substr","originURL","msie","userAgent","urlParsingNode","createElement","resolveURL","href","setAttribute","protocol","host","search","hash","hostname","port","pathname","charAt","location","requestURL","pkg","type","thing","deprecatedWarnings","currentVerArr","version","isOlderVersion","thanVersion","pkgVersionArr","destVer","isDeprecated","formatMessage","opt","desc","opts","console","warn","schema","allowUnknown","TypeError","executor","resolvePromise","token","callback","arr","payload"],"mappings":"CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,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YAOzBrC,EAAYtM,UAAU0O,iBAAmB,WACvC,GAAI5J,KAAK6J,OACP,MAAM7J,KAAK6J,QAQfrC,EAAYjB,OAAS,WACnB,IAAIb,EAIJ,MAAO,CACLqI,MAJU,IAAIvG,GAAY,SAAkB7N,GAC5C+L,EAAS/L,KAIT+L,OAAQA,IAIZ3M,EAAOD,QAAU0O,G,6BClCjBzO,EAAOD,QAAU,SAAgBkV,GAC/B,OAAO,SAAcC,GACnB,OAAOD,EAASlN,MAAM,KAAMmN,M,6BChBhClV,EAAOD,QAAU,SAAsBoV,GACrC,MAA2B,iBAAZA,IAAmD,IAAzBA,EAAQjM","file":"axios.min.js","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[\"axios\"] = factory();\n\telse\n\t\troot[\"axios\"] = factory();\n})(window, function() {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 10);\n","'use strict';\n\nvar bind = require('./helpers/bind');\n\n// utils is a library of generic helper functions non-specific to axios\n\nvar toString = Object.prototype.toString;\n\n/**\n * Determine if a value is an Array\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an Array, otherwise false\n */\nfunction isArray(val) {\n return toString.call(val) === '[object Array]';\n}\n\n/**\n * Determine if a value is undefined\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if the value is undefined, otherwise false\n */\nfunction isUndefined(val) {\n return typeof val === 'undefined';\n}\n\n/**\n * Determine if a value is a Buffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Buffer, otherwise false\n */\nfunction isBuffer(val) {\n return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor)\n && typeof val.constructor.isBuffer === 'function' && val.constructor.isBuffer(val);\n}\n\n/**\n * Determine if a value is an ArrayBuffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an ArrayBuffer, otherwise false\n */\nfunction isArrayBuffer(val) {\n return toString.call(val) === '[object ArrayBuffer]';\n}\n\n/**\n * Determine if a value is a FormData\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an FormData, otherwise false\n */\nfunction isFormData(val) {\n return (typeof FormData !== 'undefined') && (val instanceof FormData);\n}\n\n/**\n * Determine if a value is a view on an ArrayBuffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false\n */\nfunction isArrayBufferView(val) {\n var result;\n if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {\n result = ArrayBuffer.isView(val);\n } else {\n result = (val) && (val.buffer) && (val.buffer instanceof ArrayBuffer);\n }\n return result;\n}\n\n/**\n * Determine if a value is a String\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a String, otherwise false\n */\nfunction isString(val) {\n return typeof val === 'string';\n}\n\n/**\n * Determine if a value is a Number\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Number, otherwise false\n */\nfunction isNumber(val) {\n return typeof val === 'number';\n}\n\n/**\n * Determine if a value is an Object\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an Object, otherwise false\n */\nfunction isObject(val) {\n return val !== null && typeof val === 'object';\n}\n\n/**\n * Determine if a value is a plain Object\n *\n * @param {Object} val The value to test\n * @return {boolean} True if value is a plain Object, otherwise false\n */\nfunction isPlainObject(val) {\n if (toString.call(val) !== '[object Object]') {\n return false;\n }\n\n var prototype = Object.getPrototypeOf(val);\n return prototype === null || prototype === Object.prototype;\n}\n\n/**\n * Determine if a value is a Date\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Date, otherwise false\n */\nfunction isDate(val) {\n return toString.call(val) === '[object Date]';\n}\n\n/**\n * Determine if a value is a File\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a File, otherwise false\n */\nfunction isFile(val) {\n return toString.call(val) === '[object File]';\n}\n\n/**\n * Determine if a value is a Blob\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Blob, otherwise false\n */\nfunction isBlob(val) {\n return toString.call(val) === '[object Blob]';\n}\n\n/**\n * Determine if a value is a Function\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Function, otherwise false\n */\nfunction isFunction(val) {\n return toString.call(val) === '[object Function]';\n}\n\n/**\n * Determine if a value is a Stream\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Stream, otherwise false\n */\nfunction isStream(val) {\n return isObject(val) && isFunction(val.pipe);\n}\n\n/**\n * Determine if a value is a URLSearchParams object\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a URLSearchParams object, otherwise false\n */\nfunction isURLSearchParams(val) {\n return typeof URLSearchParams !== 'undefined' && val instanceof URLSearchParams;\n}\n\n/**\n * Trim excess whitespace off the beginning and end of a string\n *\n * @param {String} str The String to trim\n * @returns {String} The String freed of excess whitespace\n */\nfunction trim(str) {\n return str.trim ? str.trim() : str.replace(/^\\s+|\\s+$/g, '');\n}\n\n/**\n * Determine if we're running in a standard browser environment\n *\n * This allows axios to run in a web worker, and react-native.\n * Both environments support XMLHttpRequest, but not fully standard globals.\n *\n * web workers:\n * typeof window -> undefined\n * typeof document -> undefined\n *\n * react-native:\n * navigator.product -> 'ReactNative'\n * nativescript\n * navigator.product -> 'NativeScript' or 'NS'\n */\nfunction isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}\n\n/**\n * Iterate over an Array or an Object invoking a function for each item.\n *\n * If `obj` is an Array callback will be called passing\n * the value, index, and complete array for each item.\n *\n * If 'obj' is an Object callback will be called passing\n * the value, key, and complete object for each property.\n *\n * @param {Object|Array} obj The object to iterate\n * @param {Function} fn The callback to invoke for each item\n */\nfunction forEach(obj, fn) {\n // Don't bother if no value provided\n if (obj === null || typeof obj === 'undefined') {\n return;\n }\n\n // Force an array if not already something iterable\n if (typeof obj !== 'object') {\n /*eslint no-param-reassign:0*/\n obj = [obj];\n }\n\n if (isArray(obj)) {\n // Iterate over array values\n for (var i = 0, l = obj.length; i < l; i++) {\n fn.call(null, obj[i], i, obj);\n }\n } else {\n // Iterate over object keys\n for (var key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key)) {\n fn.call(null, obj[key], key, obj);\n }\n }\n }\n}\n\n/**\n * Accepts varargs expecting each argument to be an object, then\n * immutably merges the properties of each object and returns result.\n *\n * When multiple objects contain the same key the later object in\n * the arguments list will take precedence.\n *\n * Example:\n *\n * ```js\n * var result = merge({foo: 123}, {foo: 456});\n * console.log(result.foo); // outputs 456\n * ```\n *\n * @param {Object} obj1 Object to merge\n * @returns {Object} Result of all merge properties\n */\nfunction merge(/* obj1, obj2, obj3, ... */) {\n var result = {};\n function assignValue(val, key) {\n if (isPlainObject(result[key]) && isPlainObject(val)) {\n result[key] = merge(result[key], val);\n } else if (isPlainObject(val)) {\n result[key] = merge({}, val);\n } else if (isArray(val)) {\n result[key] = val.slice();\n } else {\n result[key] = val;\n }\n }\n\n for (var i = 0, l = arguments.length; i < l; i++) {\n forEach(arguments[i], assignValue);\n }\n return result;\n}\n\n/**\n * Extends object a by mutably adding to it the properties of object b.\n *\n * @param {Object} a The object to be extended\n * @param {Object} b The object to copy properties from\n * @param {Object} thisArg The object to bind function to\n * @return {Object} The resulting value of object a\n */\nfunction extend(a, b, thisArg) {\n forEach(b, function assignValue(val, key) {\n if (thisArg && typeof val === 'function') {\n a[key] = bind(val, thisArg);\n } else {\n a[key] = val;\n }\n });\n return a;\n}\n\n/**\n * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM)\n *\n * @param {string} content with BOM\n * @return {string} content value without BOM\n */\nfunction stripBOM(content) {\n if (content.charCodeAt(0) === 0xFEFF) {\n content = content.slice(1);\n }\n return content;\n}\n\nmodule.exports = {\n isArray: isArray,\n isArrayBuffer: isArrayBuffer,\n isBuffer: isBuffer,\n isFormData: isFormData,\n isArrayBufferView: isArrayBufferView,\n isString: isString,\n isNumber: isNumber,\n isObject: isObject,\n isPlainObject: isPlainObject,\n isUndefined: isUndefined,\n isDate: isDate,\n isFile: isFile,\n isBlob: isBlob,\n isFunction: isFunction,\n isStream: isStream,\n isURLSearchParams: isURLSearchParams,\n isStandardBrowserEnv: isStandardBrowserEnv,\n forEach: forEach,\n merge: merge,\n extend: extend,\n trim: trim,\n stripBOM: stripBOM\n};\n","'use strict';\n\nvar utils = require('./utils');\nvar normalizeHeaderName = require('./helpers/normalizeHeaderName');\nvar enhanceError = require('./core/enhanceError');\n\nvar DEFAULT_CONTENT_TYPE = {\n 'Content-Type': 'application/x-www-form-urlencoded'\n};\n\nfunction setContentTypeIfUnset(headers, value) {\n if (!utils.isUndefined(headers) && utils.isUndefined(headers['Content-Type'])) {\n headers['Content-Type'] = value;\n }\n}\n\nfunction getDefaultAdapter() {\n var adapter;\n if (typeof XMLHttpRequest !== 'undefined') {\n // For browsers use XHR adapter\n adapter = require('./adapters/xhr');\n } else if (typeof process !== 'undefined' && Object.prototype.toString.call(process) === '[object process]') {\n // For node use HTTP adapter\n adapter = require('./adapters/http');\n }\n return adapter;\n}\n\nfunction stringifySafely(rawValue, parser, encoder) {\n if (utils.isString(rawValue)) {\n try {\n (parser || JSON.parse)(rawValue);\n return utils.trim(rawValue);\n } catch (e) {\n if (e.name !== 'SyntaxError') {\n throw e;\n }\n }\n }\n\n return (encoder || JSON.stringify)(rawValue);\n}\n\nvar defaults = {\n\n transitional: {\n silentJSONParsing: true,\n forcedJSONParsing: true,\n clarifyTimeoutError: false\n },\n\n adapter: getDefaultAdapter(),\n\n transformRequest: [function transformRequest(data, headers) {\n normalizeHeaderName(headers, 'Accept');\n normalizeHeaderName(headers, 'Content-Type');\n\n if (utils.isFormData(data) ||\n utils.isArrayBuffer(data) ||\n utils.isBuffer(data) ||\n utils.isStream(data) ||\n utils.isFile(data) ||\n utils.isBlob(data)\n ) {\n return data;\n }\n if (utils.isArrayBufferView(data)) {\n return data.buffer;\n }\n if (utils.isURLSearchParams(data)) {\n setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8');\n return data.toString();\n }\n if (utils.isObject(data) || (headers && headers['Content-Type'] === 'application/json')) {\n setContentTypeIfUnset(headers, 'application/json');\n return stringifySafely(data);\n }\n return data;\n }],\n\n transformResponse: [function transformResponse(data) {\n var transitional = this.transitional;\n var silentJSONParsing = transitional && transitional.silentJSONParsing;\n var forcedJSONParsing = transitional && transitional.forcedJSONParsing;\n var strictJSONParsing = !silentJSONParsing && this.responseType === 'json';\n\n if (strictJSONParsing || (forcedJSONParsing && utils.isString(data) && data.length)) {\n try {\n return JSON.parse(data);\n } catch (e) {\n if (strictJSONParsing) {\n if (e.name === 'SyntaxError') {\n throw enhanceError(e, this, 'E_JSON_PARSE');\n }\n throw e;\n }\n }\n }\n\n return data;\n }],\n\n /**\n * A timeout in milliseconds to abort a request. If set to 0 (default) a\n * timeout is not created.\n */\n timeout: 0,\n\n xsrfCookieName: 'XSRF-TOKEN',\n xsrfHeaderName: 'X-XSRF-TOKEN',\n\n maxContentLength: -1,\n maxBodyLength: -1,\n\n validateStatus: function validateStatus(status) {\n return status >= 200 && status < 300;\n }\n};\n\ndefaults.headers = {\n common: {\n 'Accept': 'application/json, text/plain, */*'\n }\n};\n\nutils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) {\n defaults.headers[method] = {};\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE);\n});\n\nmodule.exports = defaults;\n","'use strict';\n\nmodule.exports = function bind(fn, thisArg) {\n return function wrap() {\n var args = new Array(arguments.length);\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i];\n }\n return fn.apply(thisArg, args);\n };\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\nfunction encode(val) {\n return encodeURIComponent(val).\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%20/g, '+').\n replace(/%5B/gi, '[').\n replace(/%5D/gi, ']');\n}\n\n/**\n * Build a URL by appending params to the end\n *\n * @param {string} url The base of the url (e.g., http://www.google.com)\n * @param {object} [params] The params to be appended\n * @returns {string} The formatted url\n */\nmodule.exports = function buildURL(url, params, paramsSerializer) {\n /*eslint no-param-reassign:0*/\n if (!params) {\n return url;\n }\n\n var serializedParams;\n if (paramsSerializer) {\n serializedParams = paramsSerializer(params);\n } else if (utils.isURLSearchParams(params)) {\n serializedParams = params.toString();\n } else {\n var parts = [];\n\n utils.forEach(params, function serialize(val, key) {\n if (val === null || typeof val === 'undefined') {\n return;\n }\n\n if (utils.isArray(val)) {\n key = key + '[]';\n } else {\n val = [val];\n }\n\n utils.forEach(val, function parseValue(v) {\n if (utils.isDate(v)) {\n v = v.toISOString();\n } else if (utils.isObject(v)) {\n v = JSON.stringify(v);\n }\n parts.push(encode(key) + '=' + encode(v));\n });\n });\n\n serializedParams = parts.join('&');\n }\n\n if (serializedParams) {\n var hashmarkIndex = url.indexOf('#');\n if (hashmarkIndex !== -1) {\n url = url.slice(0, hashmarkIndex);\n }\n\n url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;\n }\n\n return url;\n};\n","'use strict';\n\n/**\n * Update an Error with the specified config, error code, and response.\n *\n * @param {Error} error The error to update.\n * @param {Object} config The config.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n * @returns {Error} The error.\n */\nmodule.exports = function enhanceError(error, config, code, request, response) {\n error.config = config;\n if (code) {\n error.code = code;\n }\n\n error.request = request;\n error.response = response;\n error.isAxiosError = true;\n\n error.toJSON = function toJSON() {\n return {\n // Standard\n message: this.message,\n name: this.name,\n // Microsoft\n description: this.description,\n number: this.number,\n // Mozilla\n fileName: this.fileName,\n lineNumber: this.lineNumber,\n columnNumber: this.columnNumber,\n stack: this.stack,\n // Axios\n config: this.config,\n code: this.code\n };\n };\n return error;\n};\n","'use strict';\n\nvar utils = require('./../utils');\nvar settle = require('./../core/settle');\nvar cookies = require('./../helpers/cookies');\nvar buildURL = require('./../helpers/buildURL');\nvar buildFullPath = require('../core/buildFullPath');\nvar parseHeaders = require('./../helpers/parseHeaders');\nvar isURLSameOrigin = require('./../helpers/isURLSameOrigin');\nvar createError = require('../core/createError');\n\nmodule.exports = function xhrAdapter(config) {\n return new Promise(function dispatchXhrRequest(resolve, reject) {\n var requestData = config.data;\n var requestHeaders = config.headers;\n var responseType = config.responseType;\n\n if (utils.isFormData(requestData)) {\n delete requestHeaders['Content-Type']; // Let the browser set it\n }\n\n var request = new XMLHttpRequest();\n\n // HTTP basic authentication\n if (config.auth) {\n var username = config.auth.username || '';\n var password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : '';\n requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password);\n }\n\n var fullPath = buildFullPath(config.baseURL, config.url);\n request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true);\n\n // Set the request timeout in MS\n request.timeout = config.timeout;\n\n function onloadend() {\n if (!request) {\n return;\n }\n // Prepare the response\n var responseHeaders = 'getAllResponseHeaders' in request ? parseHeaders(request.getAllResponseHeaders()) : null;\n var responseData = !responseType || responseType === 'text' || responseType === 'json' ?\n request.responseText : request.response;\n var response = {\n data: responseData,\n status: request.status,\n statusText: request.statusText,\n headers: responseHeaders,\n config: config,\n request: request\n };\n\n settle(resolve, reject, response);\n\n // Clean up request\n request = null;\n }\n\n if ('onloadend' in request) {\n // Use onloadend if available\n request.onloadend = onloadend;\n } else {\n // Listen for ready state to emulate onloadend\n request.onreadystatechange = function handleLoad() {\n if (!request || request.readyState !== 4) {\n return;\n }\n\n // The request errored out and we didn't get a response, this will be\n // handled by onerror instead\n // With one exception: request that using file: protocol, most browsers\n // will return status as 0 even though it's a successful request\n if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {\n return;\n }\n // readystate handler is calling before onerror or ontimeout handlers,\n // so we should call onloadend on the next 'tick'\n setTimeout(onloadend);\n };\n }\n\n // Handle browser request cancellation (as opposed to a manual cancellation)\n request.onabort = function handleAbort() {\n if (!request) {\n return;\n }\n\n reject(createError('Request aborted', config, 'ECONNABORTED', request));\n\n // Clean up request\n request = null;\n };\n\n // Handle low level network errors\n request.onerror = function handleError() {\n // Real errors are hidden from us by the browser\n // onerror should only fire if it's a network error\n reject(createError('Network Error', config, null, request));\n\n // Clean up request\n request = null;\n };\n\n // Handle timeout\n request.ontimeout = function handleTimeout() {\n var timeoutErrorMessage = 'timeout of ' + config.timeout + 'ms exceeded';\n if (config.timeoutErrorMessage) {\n timeoutErrorMessage = config.timeoutErrorMessage;\n }\n reject(createError(\n timeoutErrorMessage,\n config,\n config.transitional && config.transitional.clarifyTimeoutError ? 'ETIMEDOUT' : 'ECONNABORTED',\n request));\n\n // Clean up request\n request = null;\n };\n\n // Add xsrf header\n // This is only done if running in a standard browser environment.\n // Specifically not if we're in a web worker, or react-native.\n if (utils.isStandardBrowserEnv()) {\n // Add xsrf header\n var xsrfValue = (config.withCredentials || isURLSameOrigin(fullPath)) && config.xsrfCookieName ?\n cookies.read(config.xsrfCookieName) :\n undefined;\n\n if (xsrfValue) {\n requestHeaders[config.xsrfHeaderName] = xsrfValue;\n }\n }\n\n // Add headers to the request\n if ('setRequestHeader' in request) {\n utils.forEach(requestHeaders, function setRequestHeader(val, key) {\n if (typeof requestData === 'undefined' && key.toLowerCase() === 'content-type') {\n // Remove Content-Type if data is undefined\n delete requestHeaders[key];\n } else {\n // Otherwise add header to the request\n request.setRequestHeader(key, val);\n }\n });\n }\n\n // Add withCredentials to request if needed\n if (!utils.isUndefined(config.withCredentials)) {\n request.withCredentials = !!config.withCredentials;\n }\n\n // Add responseType to request if needed\n if (responseType && responseType !== 'json') {\n request.responseType = config.responseType;\n }\n\n // Handle progress if needed\n if (typeof config.onDownloadProgress === 'function') {\n request.addEventListener('progress', config.onDownloadProgress);\n }\n\n // Not all browsers support upload events\n if (typeof config.onUploadProgress === 'function' && request.upload) {\n request.upload.addEventListener('progress', config.onUploadProgress);\n }\n\n if (config.cancelToken) {\n // Handle cancellation\n config.cancelToken.promise.then(function onCanceled(cancel) {\n if (!request) {\n return;\n }\n\n request.abort();\n reject(cancel);\n // Clean up request\n request = null;\n });\n }\n\n if (!requestData) {\n requestData = null;\n }\n\n // Send the request\n request.send(requestData);\n });\n};\n","'use strict';\n\nvar enhanceError = require('./enhanceError');\n\n/**\n * Create an Error with the specified message, config, error code, request and response.\n *\n * @param {string} message The error message.\n * @param {Object} config The config.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n * @returns {Error} The created error.\n */\nmodule.exports = function createError(message, config, code, request, response) {\n var error = new Error(message);\n return enhanceError(error, config, code, request, response);\n};\n","'use strict';\n\nmodule.exports = function isCancel(value) {\n return !!(value && value.__CANCEL__);\n};\n","'use strict';\n\nvar utils = require('../utils');\n\n/**\n * Config-specific merge-function which creates a new config-object\n * by merging two configuration objects together.\n *\n * @param {Object} config1\n * @param {Object} config2\n * @returns {Object} New object resulting from merging config2 to config1\n */\nmodule.exports = function mergeConfig(config1, config2) {\n // eslint-disable-next-line no-param-reassign\n config2 = config2 || {};\n var config = {};\n\n var valueFromConfig2Keys = ['url', 'method', 'data'];\n var mergeDeepPropertiesKeys = ['headers', 'auth', 'proxy', 'params'];\n var defaultToConfig2Keys = [\n 'baseURL', 'transformRequest', 'transformResponse', 'paramsSerializer',\n 'timeout', 'timeoutMessage', 'withCredentials', 'adapter', 'responseType', 'xsrfCookieName',\n 'xsrfHeaderName', 'onUploadProgress', 'onDownloadProgress', 'decompress',\n 'maxContentLength', 'maxBodyLength', 'maxRedirects', 'transport', 'httpAgent',\n 'httpsAgent', 'cancelToken', 'socketPath', 'responseEncoding'\n ];\n var directMergeKeys = ['validateStatus'];\n\n function getMergedValue(target, source) {\n if (utils.isPlainObject(target) && utils.isPlainObject(source)) {\n return utils.merge(target, source);\n } else if (utils.isPlainObject(source)) {\n return utils.merge({}, source);\n } else if (utils.isArray(source)) {\n return source.slice();\n }\n return source;\n }\n\n function mergeDeepProperties(prop) {\n if (!utils.isUndefined(config2[prop])) {\n config[prop] = getMergedValue(config1[prop], config2[prop]);\n } else if (!utils.isUndefined(config1[prop])) {\n config[prop] = getMergedValue(undefined, config1[prop]);\n }\n }\n\n utils.forEach(valueFromConfig2Keys, function valueFromConfig2(prop) {\n if (!utils.isUndefined(config2[prop])) {\n config[prop] = getMergedValue(undefined, config2[prop]);\n }\n });\n\n utils.forEach(mergeDeepPropertiesKeys, mergeDeepProperties);\n\n utils.forEach(defaultToConfig2Keys, function defaultToConfig2(prop) {\n if (!utils.isUndefined(config2[prop])) {\n config[prop] = getMergedValue(undefined, config2[prop]);\n } else if (!utils.isUndefined(config1[prop])) {\n config[prop] = getMergedValue(undefined, config1[prop]);\n }\n });\n\n utils.forEach(directMergeKeys, function merge(prop) {\n if (prop in config2) {\n config[prop] = getMergedValue(config1[prop], config2[prop]);\n } else if (prop in config1) {\n config[prop] = getMergedValue(undefined, config1[prop]);\n }\n });\n\n var axiosKeys = valueFromConfig2Keys\n .concat(mergeDeepPropertiesKeys)\n .concat(defaultToConfig2Keys)\n .concat(directMergeKeys);\n\n var otherKeys = Object\n .keys(config1)\n .concat(Object.keys(config2))\n .filter(function filterAxiosKeys(key) {\n return axiosKeys.indexOf(key) === -1;\n });\n\n utils.forEach(otherKeys, mergeDeepProperties);\n\n return config;\n};\n","'use strict';\n\n/**\n * A `Cancel` is an object that is thrown when an operation is canceled.\n *\n * @class\n * @param {string=} message The message.\n */\nfunction Cancel(message) {\n this.message = message;\n}\n\nCancel.prototype.toString = function toString() {\n return 'Cancel' + (this.message ? ': ' + this.message : '');\n};\n\nCancel.prototype.__CANCEL__ = true;\n\nmodule.exports = Cancel;\n","module.exports = require('./lib/axios');","'use strict';\n\nvar utils = require('./utils');\nvar bind = require('./helpers/bind');\nvar Axios = require('./core/Axios');\nvar mergeConfig = require('./core/mergeConfig');\nvar defaults = require('./defaults');\n\n/**\n * Create an instance of Axios\n *\n * @param {Object} defaultConfig The default config for the instance\n * @return {Axios} A new instance of Axios\n */\nfunction createInstance(defaultConfig) {\n var context = new Axios(defaultConfig);\n var instance = bind(Axios.prototype.request, context);\n\n // Copy axios.prototype to instance\n utils.extend(instance, Axios.prototype, context);\n\n // Copy context to instance\n utils.extend(instance, context);\n\n return instance;\n}\n\n// Create the default instance to be exported\nvar axios = createInstance(defaults);\n\n// Expose Axios class to allow class inheritance\naxios.Axios = Axios;\n\n// Factory for creating new instances\naxios.create = function create(instanceConfig) {\n return createInstance(mergeConfig(axios.defaults, instanceConfig));\n};\n\n// Expose Cancel & CancelToken\naxios.Cancel = require('./cancel/Cancel');\naxios.CancelToken = require('./cancel/CancelToken');\naxios.isCancel = require('./cancel/isCancel');\n\n// Expose all/spread\naxios.all = function all(promises) {\n return Promise.all(promises);\n};\naxios.spread = require('./helpers/spread');\n\n// Expose isAxiosError\naxios.isAxiosError = require('./helpers/isAxiosError');\n\nmodule.exports = axios;\n\n// Allow use of default import syntax in TypeScript\nmodule.exports.default = axios;\n","'use strict';\n\nvar utils = require('./../utils');\nvar buildURL = require('../helpers/buildURL');\nvar InterceptorManager = require('./InterceptorManager');\nvar dispatchRequest = require('./dispatchRequest');\nvar mergeConfig = require('./mergeConfig');\nvar validator = require('../helpers/validator');\n\nvar validators = validator.validators;\n/**\n * Create a new instance of Axios\n *\n * @param {Object} instanceConfig The default config for the instance\n */\nfunction Axios(instanceConfig) {\n this.defaults = instanceConfig;\n this.interceptors = {\n request: new InterceptorManager(),\n response: new InterceptorManager()\n };\n}\n\n/**\n * Dispatch a request\n *\n * @param {Object} config The config specific for this request (merged with this.defaults)\n */\nAxios.prototype.request = function request(config) {\n /*eslint no-param-reassign:0*/\n // Allow for axios('example/url'[, config]) a la fetch API\n if (typeof config === 'string') {\n config = arguments[1] || {};\n config.url = arguments[0];\n } else {\n config = config || {};\n }\n\n config = mergeConfig(this.defaults, config);\n\n // Set config.method\n if (config.method) {\n config.method = config.method.toLowerCase();\n } else if (this.defaults.method) {\n config.method = this.defaults.method.toLowerCase();\n } else {\n config.method = 'get';\n }\n\n var transitional = config.transitional;\n\n if (transitional !== undefined) {\n validator.assertOptions(transitional, {\n silentJSONParsing: validators.transitional(validators.boolean, '1.0.0'),\n forcedJSONParsing: validators.transitional(validators.boolean, '1.0.0'),\n clarifyTimeoutError: validators.transitional(validators.boolean, '1.0.0')\n }, false);\n }\n\n // filter out skipped interceptors\n var requestInterceptorChain = [];\n var synchronousRequestInterceptors = true;\n this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {\n if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) {\n return;\n }\n\n synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;\n\n requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);\n });\n\n var responseInterceptorChain = [];\n this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {\n responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);\n });\n\n var promise;\n\n if (!synchronousRequestInterceptors) {\n var chain = [dispatchRequest, undefined];\n\n Array.prototype.unshift.apply(chain, requestInterceptorChain);\n chain = chain.concat(responseInterceptorChain);\n\n promise = Promise.resolve(config);\n while (chain.length) {\n promise = promise.then(chain.shift(), chain.shift());\n }\n\n return promise;\n }\n\n\n var newConfig = config;\n while (requestInterceptorChain.length) {\n var onFulfilled = requestInterceptorChain.shift();\n var onRejected = requestInterceptorChain.shift();\n try {\n newConfig = onFulfilled(newConfig);\n } catch (error) {\n onRejected(error);\n break;\n }\n }\n\n try {\n promise = dispatchRequest(newConfig);\n } catch (error) {\n return Promise.reject(error);\n }\n\n while (responseInterceptorChain.length) {\n promise = promise.then(responseInterceptorChain.shift(), responseInterceptorChain.shift());\n }\n\n return promise;\n};\n\nAxios.prototype.getUri = function getUri(config) {\n config = mergeConfig(this.defaults, config);\n return buildURL(config.url, config.params, config.paramsSerializer).replace(/^\\?/, '');\n};\n\n// Provide aliases for supported request methods\nutils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, config) {\n return this.request(mergeConfig(config || {}, {\n method: method,\n url: url,\n data: (config || {}).data\n }));\n };\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, data, config) {\n return this.request(mergeConfig(config || {}, {\n method: method,\n url: url,\n data: data\n }));\n };\n});\n\nmodule.exports = Axios;\n","'use strict';\n\nvar utils = require('./../utils');\n\nfunction InterceptorManager() {\n this.handlers = [];\n}\n\n/**\n * Add a new interceptor to the stack\n *\n * @param {Function} fulfilled The function to handle `then` for a `Promise`\n * @param {Function} rejected The function to handle `reject` for a `Promise`\n *\n * @return {Number} An ID used to remove interceptor later\n */\nInterceptorManager.prototype.use = function use(fulfilled, rejected, options) {\n this.handlers.push({\n fulfilled: fulfilled,\n rejected: rejected,\n synchronous: options ? options.synchronous : false,\n runWhen: options ? options.runWhen : null\n });\n return this.handlers.length - 1;\n};\n\n/**\n * Remove an interceptor from the stack\n *\n * @param {Number} id The ID that was returned by `use`\n */\nInterceptorManager.prototype.eject = function eject(id) {\n if (this.handlers[id]) {\n this.handlers[id] = null;\n }\n};\n\n/**\n * Iterate over all the registered interceptors\n *\n * This method is particularly useful for skipping over any\n * interceptors that may have become `null` calling `eject`.\n *\n * @param {Function} fn The function to call for each interceptor\n */\nInterceptorManager.prototype.forEach = function forEach(fn) {\n utils.forEach(this.handlers, function forEachHandler(h) {\n if (h !== null) {\n fn(h);\n }\n });\n};\n\nmodule.exports = InterceptorManager;\n","'use strict';\n\nvar utils = require('./../utils');\nvar transformData = require('./transformData');\nvar isCancel = require('../cancel/isCancel');\nvar defaults = require('../defaults');\n\n/**\n * Throws a `Cancel` if cancellation has been requested.\n */\nfunction throwIfCancellationRequested(config) {\n if (config.cancelToken) {\n config.cancelToken.throwIfRequested();\n }\n}\n\n/**\n * Dispatch a request to the server using the configured adapter.\n *\n * @param {object} config The config that is to be used for the request\n * @returns {Promise} The Promise to be fulfilled\n */\nmodule.exports = function dispatchRequest(config) {\n throwIfCancellationRequested(config);\n\n // Ensure headers exist\n config.headers = config.headers || {};\n\n // Transform request data\n config.data = transformData.call(\n config,\n config.data,\n config.headers,\n config.transformRequest\n );\n\n // Flatten headers\n config.headers = utils.merge(\n config.headers.common || {},\n config.headers[config.method] || {},\n config.headers\n );\n\n utils.forEach(\n ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],\n function cleanHeaderConfig(method) {\n delete config.headers[method];\n }\n );\n\n var adapter = config.adapter || defaults.adapter;\n\n return adapter(config).then(function onAdapterResolution(response) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n response.data = transformData.call(\n config,\n response.data,\n response.headers,\n config.transformResponse\n );\n\n return response;\n }, function onAdapterRejection(reason) {\n if (!isCancel(reason)) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n if (reason && reason.response) {\n reason.response.data = transformData.call(\n config,\n reason.response.data,\n reason.response.headers,\n config.transformResponse\n );\n }\n }\n\n return Promise.reject(reason);\n });\n};\n","'use strict';\n\nvar utils = require('./../utils');\nvar defaults = require('./../defaults');\n\n/**\n * Transform the data for a request or a response\n *\n * @param {Object|String} data The data to be transformed\n * @param {Array} headers The headers for the request or response\n * @param {Array|Function} fns A single function or Array of functions\n * @returns {*} The resulting transformed data\n */\nmodule.exports = function transformData(data, headers, fns) {\n var context = this || defaults;\n /*eslint no-param-reassign:0*/\n utils.forEach(fns, function transform(fn) {\n data = fn.call(context, data, headers);\n });\n\n return data;\n};\n","'use strict';\n\nvar utils = require('../utils');\n\nmodule.exports = function normalizeHeaderName(headers, normalizedName) {\n utils.forEach(headers, function processHeader(value, name) {\n if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) {\n headers[normalizedName] = value;\n delete headers[name];\n }\n });\n};\n","'use strict';\n\nvar createError = require('./createError');\n\n/**\n * Resolve or reject a Promise based on response status.\n *\n * @param {Function} resolve A function that resolves the promise.\n * @param {Function} reject A function that rejects the promise.\n * @param {object} response The response.\n */\nmodule.exports = function settle(resolve, reject, response) {\n var validateStatus = response.config.validateStatus;\n if (!response.status || !validateStatus || validateStatus(response.status)) {\n resolve(response);\n } else {\n reject(createError(\n 'Request failed with status code ' + response.status,\n response.config,\n null,\n response.request,\n response\n ));\n }\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\nmodule.exports = (\n utils.isStandardBrowserEnv() ?\n\n // Standard browser envs support document.cookie\n (function standardBrowserEnv() {\n return {\n write: function write(name, value, expires, path, domain, secure) {\n var cookie = [];\n cookie.push(name + '=' + encodeURIComponent(value));\n\n if (utils.isNumber(expires)) {\n cookie.push('expires=' + new Date(expires).toGMTString());\n }\n\n if (utils.isString(path)) {\n cookie.push('path=' + path);\n }\n\n if (utils.isString(domain)) {\n cookie.push('domain=' + domain);\n }\n\n if (secure === true) {\n cookie.push('secure');\n }\n\n document.cookie = cookie.join('; ');\n },\n\n read: function read(name) {\n var match = document.cookie.match(new RegExp('(^|;\\\\s*)(' + name + ')=([^;]*)'));\n return (match ? decodeURIComponent(match[3]) : null);\n },\n\n remove: function remove(name) {\n this.write(name, '', Date.now() - 86400000);\n }\n };\n })() :\n\n // Non standard browser env (web workers, react-native) lack needed support.\n (function nonStandardBrowserEnv() {\n return {\n write: function write() {},\n read: function read() { return null; },\n remove: function remove() {}\n };\n })()\n);\n","'use strict';\n\nvar isAbsoluteURL = require('../helpers/isAbsoluteURL');\nvar combineURLs = require('../helpers/combineURLs');\n\n/**\n * Creates a new URL by combining the baseURL with the requestedURL,\n * only when the requestedURL is not already an absolute URL.\n * If the requestURL is absolute, this function returns the requestedURL untouched.\n *\n * @param {string} baseURL The base URL\n * @param {string} requestedURL Absolute or relative URL to combine\n * @returns {string} The combined full path\n */\nmodule.exports = function buildFullPath(baseURL, requestedURL) {\n if (baseURL && !isAbsoluteURL(requestedURL)) {\n return combineURLs(baseURL, requestedURL);\n }\n return requestedURL;\n};\n","'use strict';\n\n/**\n * Determines whether the specified URL is absolute\n *\n * @param {string} url The URL to test\n * @returns {boolean} True if the specified URL is absolute, otherwise false\n */\nmodule.exports = function isAbsoluteURL(url) {\n // A URL is considered absolute if it begins with \"://\" or \"//\" (protocol-relative URL).\n // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed\n // by any combination of letters, digits, plus, period, or hyphen.\n return /^([a-z][a-z\\d\\+\\-\\.]*:)?\\/\\//i.test(url);\n};\n","'use strict';\n\n/**\n * Creates a new URL by combining the specified URLs\n *\n * @param {string} baseURL The base URL\n * @param {string} relativeURL The relative URL\n * @returns {string} The combined URL\n */\nmodule.exports = function combineURLs(baseURL, relativeURL) {\n return relativeURL\n ? baseURL.replace(/\\/+$/, '') + '/' + relativeURL.replace(/^\\/+/, '')\n : baseURL;\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\n// Headers whose duplicates are ignored by node\n// c.f. https://nodejs.org/api/http.html#http_message_headers\nvar ignoreDuplicateOf = [\n 'age', 'authorization', 'content-length', 'content-type', 'etag',\n 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',\n 'last-modified', 'location', 'max-forwards', 'proxy-authorization',\n 'referer', 'retry-after', 'user-agent'\n];\n\n/**\n * Parse headers into an object\n *\n * ```\n * Date: Wed, 27 Aug 2014 08:58:49 GMT\n * Content-Type: application/json\n * Connection: keep-alive\n * Transfer-Encoding: chunked\n * ```\n *\n * @param {String} headers Headers needing to be parsed\n * @returns {Object} Headers parsed into an object\n */\nmodule.exports = function parseHeaders(headers) {\n var parsed = {};\n var key;\n var val;\n var i;\n\n if (!headers) { return parsed; }\n\n utils.forEach(headers.split('\\n'), function parser(line) {\n i = line.indexOf(':');\n key = utils.trim(line.substr(0, i)).toLowerCase();\n val = utils.trim(line.substr(i + 1));\n\n if (key) {\n if (parsed[key] && ignoreDuplicateOf.indexOf(key) >= 0) {\n return;\n }\n if (key === 'set-cookie') {\n parsed[key] = (parsed[key] ? parsed[key] : []).concat([val]);\n } else {\n parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;\n }\n }\n });\n\n return parsed;\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\nmodule.exports = (\n utils.isStandardBrowserEnv() ?\n\n // Standard browser envs have full support of the APIs needed to test\n // whether the request URL is of the same origin as current location.\n (function standardBrowserEnv() {\n var msie = /(msie|trident)/i.test(navigator.userAgent);\n var urlParsingNode = document.createElement('a');\n var originURL;\n\n /**\n * Parse a URL to discover it's components\n *\n * @param {String} url The URL to be parsed\n * @returns {Object}\n */\n function resolveURL(url) {\n var href = url;\n\n if (msie) {\n // IE needs attribute set twice to normalize properties\n urlParsingNode.setAttribute('href', href);\n href = urlParsingNode.href;\n }\n\n urlParsingNode.setAttribute('href', href);\n\n // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils\n return {\n href: urlParsingNode.href,\n protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',\n host: urlParsingNode.host,\n search: urlParsingNode.search ? urlParsingNode.search.replace(/^\\?/, '') : '',\n hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',\n hostname: urlParsingNode.hostname,\n port: urlParsingNode.port,\n pathname: (urlParsingNode.pathname.charAt(0) === '/') ?\n urlParsingNode.pathname :\n '/' + urlParsingNode.pathname\n };\n }\n\n originURL = resolveURL(window.location.href);\n\n /**\n * Determine if a URL shares the same origin as the current location\n *\n * @param {String} requestURL The URL to test\n * @returns {boolean} True if URL shares the same origin, otherwise false\n */\n return function isURLSameOrigin(requestURL) {\n var parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL;\n return (parsed.protocol === originURL.protocol &&\n parsed.host === originURL.host);\n };\n })() :\n\n // Non standard browser envs (web workers, react-native) lack needed support.\n (function nonStandardBrowserEnv() {\n return function isURLSameOrigin() {\n return true;\n };\n })()\n);\n","'use strict';\n\nvar pkg = require('./../../package.json');\n\nvar validators = {};\n\n// eslint-disable-next-line func-names\n['object', 'boolean', 'number', 'function', 'string', 'symbol'].forEach(function(type, i) {\n validators[type] = function validator(thing) {\n return typeof thing === type || 'a' + (i < 1 ? 'n ' : ' ') + type;\n };\n});\n\nvar deprecatedWarnings = {};\nvar currentVerArr = pkg.version.split('.');\n\n/**\n * Compare package versions\n * @param {string} version\n * @param {string?} thanVersion\n * @returns {boolean}\n */\nfunction isOlderVersion(version, thanVersion) {\n var pkgVersionArr = thanVersion ? thanVersion.split('.') : currentVerArr;\n var destVer = version.split('.');\n for (var i = 0; i < 3; i++) {\n if (pkgVersionArr[i] > destVer[i]) {\n return true;\n } else if (pkgVersionArr[i] < destVer[i]) {\n return false;\n }\n }\n return false;\n}\n\n/**\n * Transitional option validator\n * @param {function|boolean?} validator\n * @param {string?} version\n * @param {string} message\n * @returns {function}\n */\nvalidators.transitional = function transitional(validator, version, message) {\n var isDeprecated = version && isOlderVersion(version);\n\n function formatMessage(opt, desc) {\n return '[Axios v' + pkg.version + '] Transitional option \\'' + opt + '\\'' + desc + (message ? '. ' + message : '');\n }\n\n // eslint-disable-next-line func-names\n return function(value, opt, opts) {\n if (validator === false) {\n throw new Error(formatMessage(opt, ' has been removed in ' + version));\n }\n\n if (isDeprecated && !deprecatedWarnings[opt]) {\n deprecatedWarnings[opt] = true;\n // eslint-disable-next-line no-console\n console.warn(\n formatMessage(\n opt,\n ' has been deprecated since v' + version + ' and will be removed in the near future'\n )\n );\n }\n\n return validator ? validator(value, opt, opts) : true;\n };\n};\n\n/**\n * Assert object's properties type\n * @param {object} options\n * @param {object} schema\n * @param {boolean?} allowUnknown\n */\n\nfunction assertOptions(options, schema, allowUnknown) {\n if (typeof options !== 'object') {\n throw new TypeError('options must be an object');\n }\n var keys = Object.keys(options);\n var i = keys.length;\n while (i-- > 0) {\n var opt = keys[i];\n var validator = schema[opt];\n if (validator) {\n var value = options[opt];\n var result = value === undefined || validator(value, opt, options);\n if (result !== true) {\n throw new TypeError('option ' + opt + ' must be ' + result);\n }\n continue;\n }\n if (allowUnknown !== true) {\n throw Error('Unknown option ' + opt);\n }\n }\n}\n\nmodule.exports = {\n isOlderVersion: isOlderVersion,\n assertOptions: assertOptions,\n validators: validators\n};\n","'use strict';\n\nvar Cancel = require('./Cancel');\n\n/**\n * A `CancelToken` is an object that can be used to request cancellation of an operation.\n *\n * @class\n * @param {Function} executor The executor function.\n */\nfunction CancelToken(executor) {\n if (typeof executor !== 'function') {\n throw new TypeError('executor must be a function.');\n }\n\n var resolvePromise;\n this.promise = new Promise(function promiseExecutor(resolve) {\n resolvePromise = resolve;\n });\n\n var token = this;\n executor(function cancel(message) {\n if (token.reason) {\n // Cancellation has already been requested\n return;\n }\n\n token.reason = new Cancel(message);\n resolvePromise(token.reason);\n });\n}\n\n/**\n * Throws a `Cancel` if cancellation has been requested.\n */\nCancelToken.prototype.throwIfRequested = function throwIfRequested() {\n if (this.reason) {\n throw this.reason;\n }\n};\n\n/**\n * Returns an object that contains a new `CancelToken` and a function that, when called,\n * cancels the `CancelToken`.\n */\nCancelToken.source = function source() {\n var cancel;\n var token = new CancelToken(function executor(c) {\n cancel = c;\n });\n return {\n token: token,\n cancel: cancel\n };\n};\n\nmodule.exports = CancelToken;\n","'use strict';\n\n/**\n * Syntactic sugar for invoking a function and expanding an array for arguments.\n *\n * Common use case would be to use `Function.prototype.apply`.\n *\n * ```js\n * function f(x, y, z) {}\n * var args = [1, 2, 3];\n * f.apply(null, args);\n * ```\n *\n * With `spread` this example can be re-written.\n *\n * ```js\n * spread(function(x, y, z) {})([1, 2, 3]);\n * ```\n *\n * @param {Function} callback\n * @returns {Function}\n */\nmodule.exports = function spread(callback) {\n return function wrap(arr) {\n return callback.apply(null, arr);\n };\n};\n","'use strict';\n\n/**\n * Determines whether the payload is an error thrown by Axios\n *\n * @param {*} payload The value to test\n * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false\n */\nmodule.exports = function isAxiosError(payload) {\n return (typeof payload === 'object') && (payload.isAxiosError === true);\n};\n"],"sourceRoot":""} \ No newline at end of file diff --git a/node_modules/hxz-api/node_modules/axios/index.d.ts b/node_modules/hxz-api/node_modules/axios/index.d.ts new file mode 100644 index 000000000..78f733f89 --- /dev/null +++ b/node_modules/hxz-api/node_modules/axios/index.d.ts @@ -0,0 +1,168 @@ +export interface AxiosTransformer { + (data: any, headers?: any): any; +} + +export interface AxiosAdapter { + (config: AxiosRequestConfig): AxiosPromise; +} + +export interface AxiosBasicCredentials { + username: string; + password: string; +} + +export interface AxiosProxyConfig { + host: string; + port: number; + auth?: { + username: string; + password:string; + }; + protocol?: string; +} + +export type Method = + | 'get' | 'GET' + | 'delete' | 'DELETE' + | 'head' | 'HEAD' + | 'options' | 'OPTIONS' + | 'post' | 'POST' + | 'put' | 'PUT' + | 'patch' | 'PATCH' + | 'purge' | 'PURGE' + | 'link' | 'LINK' + | 'unlink' | 'UNLINK' + +export type ResponseType = + | 'arraybuffer' + | 'blob' + | 'document' + | 'json' + | 'text' + | 'stream' + +export interface TransitionalOptions{ + silentJSONParsing: boolean; + forcedJSONParsing: boolean; + clarifyTimeoutError: boolean; +} + +export interface AxiosRequestConfig { + url?: string; + method?: Method; + baseURL?: string; + transformRequest?: AxiosTransformer | AxiosTransformer[]; + transformResponse?: AxiosTransformer | AxiosTransformer[]; + headers?: any; + params?: any; + paramsSerializer?: (params: any) => string; + data?: any; + timeout?: number; + timeoutErrorMessage?: string; + withCredentials?: boolean; + adapter?: AxiosAdapter; + auth?: AxiosBasicCredentials; + responseType?: ResponseType; + xsrfCookieName?: string; + xsrfHeaderName?: string; + onUploadProgress?: (progressEvent: any) => void; + onDownloadProgress?: (progressEvent: any) => void; + maxContentLength?: number; + validateStatus?: ((status: number) => boolean) | null; + maxBodyLength?: number; + maxRedirects?: number; + socketPath?: string | null; + httpAgent?: any; + httpsAgent?: any; + proxy?: AxiosProxyConfig | false; + cancelToken?: CancelToken; + decompress?: boolean; + transitional?: TransitionalOptions +} + +export interface AxiosResponse { + data: T; + status: number; + statusText: string; + headers: any; + config: AxiosRequestConfig; + request?: any; +} + +export interface AxiosError extends Error { + config: AxiosRequestConfig; + code?: string; + request?: any; + response?: AxiosResponse; + isAxiosError: boolean; + toJSON: () => object; +} + +export interface AxiosPromise extends Promise> { +} + +export interface CancelStatic { + new (message?: string): Cancel; +} + +export interface Cancel { + message: string; +} + +export interface Canceler { + (message?: string): void; +} + +export interface CancelTokenStatic { + new (executor: (cancel: Canceler) => void): CancelToken; + source(): CancelTokenSource; +} + +export interface CancelToken { + promise: Promise; + reason?: Cancel; + throwIfRequested(): void; +} + +export interface CancelTokenSource { + token: CancelToken; + cancel: Canceler; +} + +export interface AxiosInterceptorManager { + use(onFulfilled?: (value: V) => T | Promise, onRejected?: (error: any) => any): number; + eject(id: number): void; +} + +export interface AxiosInstance { + (config: AxiosRequestConfig): AxiosPromise; + (url: string, config?: AxiosRequestConfig): AxiosPromise; + defaults: AxiosRequestConfig; + interceptors: { + request: AxiosInterceptorManager; + response: AxiosInterceptorManager; + }; + getUri(config?: AxiosRequestConfig): string; + request> (config: AxiosRequestConfig): Promise; + get>(url: string, config?: AxiosRequestConfig): Promise; + delete>(url: string, config?: AxiosRequestConfig): Promise; + head>(url: string, config?: AxiosRequestConfig): Promise; + options>(url: string, config?: AxiosRequestConfig): Promise; + post>(url: string, data?: any, config?: AxiosRequestConfig): Promise; + put>(url: string, data?: any, config?: AxiosRequestConfig): Promise; + patch>(url: string, data?: any, config?: AxiosRequestConfig): Promise; +} + +export interface AxiosStatic extends AxiosInstance { + create(config?: AxiosRequestConfig): AxiosInstance; + Cancel: CancelStatic; + CancelToken: CancelTokenStatic; + isCancel(value: any): boolean; + all(values: (T | Promise)[]): Promise; + spread(callback: (...args: T[]) => R): (array: T[]) => R; + isAxiosError(payload: any): payload is AxiosError; +} + +declare const axios: AxiosStatic; + +export default axios; diff --git a/node_modules/hxz-api/node_modules/axios/index.js b/node_modules/hxz-api/node_modules/axios/index.js new file mode 100644 index 000000000..79dfd09dd --- /dev/null +++ b/node_modules/hxz-api/node_modules/axios/index.js @@ -0,0 +1 @@ +module.exports = require('./lib/axios'); \ No newline at end of file diff --git a/node_modules/hxz-api/node_modules/axios/lib/adapters/README.md b/node_modules/hxz-api/node_modules/axios/lib/adapters/README.md new file mode 100644 index 000000000..68f111895 --- /dev/null +++ b/node_modules/hxz-api/node_modules/axios/lib/adapters/README.md @@ -0,0 +1,37 @@ +# axios // adapters + +The modules under `adapters/` are modules that handle dispatching a request and settling a returned `Promise` once a response is received. + +## Example + +```js +var settle = require('./../core/settle'); + +module.exports = function myAdapter(config) { + // At this point: + // - config has been merged with defaults + // - request transformers have already run + // - request interceptors have already run + + // Make the request using config provided + // Upon response settle the Promise + + return new Promise(function(resolve, reject) { + + var response = { + data: responseData, + status: request.status, + statusText: request.statusText, + headers: responseHeaders, + config: config, + request: request + }; + + settle(resolve, reject, response); + + // From here: + // - response transformers will run + // - response interceptors will run + }); +} +``` diff --git a/node_modules/hxz-api/node_modules/axios/lib/adapters/http.js b/node_modules/hxz-api/node_modules/axios/lib/adapters/http.js new file mode 100644 index 000000000..0cca3bdfb --- /dev/null +++ b/node_modules/hxz-api/node_modules/axios/lib/adapters/http.js @@ -0,0 +1,331 @@ +'use strict'; + +var utils = require('./../utils'); +var settle = require('./../core/settle'); +var buildFullPath = require('../core/buildFullPath'); +var buildURL = require('./../helpers/buildURL'); +var http = require('http'); +var https = require('https'); +var httpFollow = require('follow-redirects').http; +var httpsFollow = require('follow-redirects').https; +var url = require('url'); +var zlib = require('zlib'); +var pkg = require('./../../package.json'); +var createError = require('../core/createError'); +var enhanceError = require('../core/enhanceError'); + +var isHttps = /https:?/; + +/** + * + * @param {http.ClientRequestArgs} options + * @param {AxiosProxyConfig} proxy + * @param {string} location + */ +function setProxy(options, proxy, location) { + options.hostname = proxy.host; + options.host = proxy.host; + options.port = proxy.port; + options.path = location; + + // Basic proxy authorization + if (proxy.auth) { + var base64 = Buffer.from(proxy.auth.username + ':' + proxy.auth.password, 'utf8').toString('base64'); + options.headers['Proxy-Authorization'] = 'Basic ' + base64; + } + + // If a proxy is used, any redirects must also pass through the proxy + options.beforeRedirect = function beforeRedirect(redirection) { + redirection.headers.host = redirection.host; + setProxy(redirection, proxy, redirection.href); + }; +} + +/*eslint consistent-return:0*/ +module.exports = function httpAdapter(config) { + return new Promise(function dispatchHttpRequest(resolvePromise, rejectPromise) { + var resolve = function resolve(value) { + resolvePromise(value); + }; + var reject = function reject(value) { + rejectPromise(value); + }; + var data = config.data; + var headers = config.headers; + + // Set User-Agent (required by some servers) + // See https://github.com/axios/axios/issues/69 + if ('User-Agent' in headers || 'user-agent' in headers) { + // User-Agent is specified; handle case where no UA header is desired + if (!headers['User-Agent'] && !headers['user-agent']) { + delete headers['User-Agent']; + delete headers['user-agent']; + } + // Otherwise, use specified value + } else { + // Only set header if it hasn't been set in config + headers['User-Agent'] = 'axios/' + pkg.version; + } + + if (data && !utils.isStream(data)) { + if (Buffer.isBuffer(data)) { + // Nothing to do... + } else if (utils.isArrayBuffer(data)) { + data = Buffer.from(new Uint8Array(data)); + } else if (utils.isString(data)) { + data = Buffer.from(data, 'utf-8'); + } else { + return reject(createError( + 'Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream', + config + )); + } + + // Add Content-Length header if data exists + headers['Content-Length'] = data.length; + } + + // HTTP basic authentication + var auth = undefined; + if (config.auth) { + var username = config.auth.username || ''; + var password = config.auth.password || ''; + auth = username + ':' + password; + } + + // Parse url + var fullPath = buildFullPath(config.baseURL, config.url); + var parsed = url.parse(fullPath); + var protocol = parsed.protocol || 'http:'; + + if (!auth && parsed.auth) { + var urlAuth = parsed.auth.split(':'); + var urlUsername = urlAuth[0] || ''; + var urlPassword = urlAuth[1] || ''; + auth = urlUsername + ':' + urlPassword; + } + + if (auth) { + delete headers.Authorization; + } + + var isHttpsRequest = isHttps.test(protocol); + var agent = isHttpsRequest ? config.httpsAgent : config.httpAgent; + + var options = { + path: buildURL(parsed.path, config.params, config.paramsSerializer).replace(/^\?/, ''), + method: config.method.toUpperCase(), + headers: headers, + agent: agent, + agents: { http: config.httpAgent, https: config.httpsAgent }, + auth: auth + }; + + if (config.socketPath) { + options.socketPath = config.socketPath; + } else { + options.hostname = parsed.hostname; + options.port = parsed.port; + } + + var proxy = config.proxy; + if (!proxy && proxy !== false) { + var proxyEnv = protocol.slice(0, -1) + '_proxy'; + var proxyUrl = process.env[proxyEnv] || process.env[proxyEnv.toUpperCase()]; + if (proxyUrl) { + var parsedProxyUrl = url.parse(proxyUrl); + var noProxyEnv = process.env.no_proxy || process.env.NO_PROXY; + var shouldProxy = true; + + if (noProxyEnv) { + var noProxy = noProxyEnv.split(',').map(function trim(s) { + return s.trim(); + }); + + shouldProxy = !noProxy.some(function proxyMatch(proxyElement) { + if (!proxyElement) { + return false; + } + if (proxyElement === '*') { + return true; + } + if (proxyElement[0] === '.' && + parsed.hostname.substr(parsed.hostname.length - proxyElement.length) === proxyElement) { + return true; + } + + return parsed.hostname === proxyElement; + }); + } + + if (shouldProxy) { + proxy = { + host: parsedProxyUrl.hostname, + port: parsedProxyUrl.port, + protocol: parsedProxyUrl.protocol + }; + + if (parsedProxyUrl.auth) { + var proxyUrlAuth = parsedProxyUrl.auth.split(':'); + proxy.auth = { + username: proxyUrlAuth[0], + password: proxyUrlAuth[1] + }; + } + } + } + } + + if (proxy) { + options.headers.host = parsed.hostname + (parsed.port ? ':' + parsed.port : ''); + setProxy(options, proxy, protocol + '//' + parsed.hostname + (parsed.port ? ':' + parsed.port : '') + options.path); + } + + var transport; + var isHttpsProxy = isHttpsRequest && (proxy ? isHttps.test(proxy.protocol) : true); + if (config.transport) { + transport = config.transport; + } else if (config.maxRedirects === 0) { + transport = isHttpsProxy ? https : http; + } else { + if (config.maxRedirects) { + options.maxRedirects = config.maxRedirects; + } + transport = isHttpsProxy ? httpsFollow : httpFollow; + } + + if (config.maxBodyLength > -1) { + options.maxBodyLength = config.maxBodyLength; + } + + // Create the request + var req = transport.request(options, function handleResponse(res) { + if (req.aborted) return; + + // uncompress the response body transparently if required + var stream = res; + + // return the last request in case of redirects + var lastRequest = res.req || req; + + + // if no content, is HEAD request or decompress disabled we should not decompress + if (res.statusCode !== 204 && lastRequest.method !== 'HEAD' && config.decompress !== false) { + switch (res.headers['content-encoding']) { + /*eslint default-case:0*/ + case 'gzip': + case 'compress': + case 'deflate': + // add the unzipper to the body stream processing pipeline + stream = stream.pipe(zlib.createUnzip()); + + // remove the content-encoding in order to not confuse downstream operations + delete res.headers['content-encoding']; + break; + } + } + + var response = { + status: res.statusCode, + statusText: res.statusMessage, + headers: res.headers, + config: config, + request: lastRequest + }; + + if (config.responseType === 'stream') { + response.data = stream; + settle(resolve, reject, response); + } else { + var responseBuffer = []; + var totalResponseBytes = 0; + stream.on('data', function handleStreamData(chunk) { + responseBuffer.push(chunk); + totalResponseBytes += chunk.length; + + // make sure the content length is not over the maxContentLength if specified + if (config.maxContentLength > -1 && totalResponseBytes > config.maxContentLength) { + stream.destroy(); + reject(createError('maxContentLength size of ' + config.maxContentLength + ' exceeded', + config, null, lastRequest)); + } + }); + + stream.on('error', function handleStreamError(err) { + if (req.aborted) return; + reject(enhanceError(err, config, null, lastRequest)); + }); + + stream.on('end', function handleStreamEnd() { + var responseData = Buffer.concat(responseBuffer); + if (config.responseType !== 'arraybuffer') { + responseData = responseData.toString(config.responseEncoding); + if (!config.responseEncoding || config.responseEncoding === 'utf8') { + responseData = utils.stripBOM(responseData); + } + } + + response.data = responseData; + settle(resolve, reject, response); + }); + } + }); + + // Handle errors + req.on('error', function handleRequestError(err) { + if (req.aborted && err.code !== 'ERR_FR_TOO_MANY_REDIRECTS') return; + reject(enhanceError(err, config, null, req)); + }); + + // Handle request timeout + if (config.timeout) { + // This is forcing a int timeout to avoid problems if the `req` interface doesn't handle other types. + var timeout = parseInt(config.timeout, 10); + + if (isNaN(timeout)) { + reject(createError( + 'error trying to parse `config.timeout` to int', + config, + 'ERR_PARSE_TIMEOUT', + req + )); + + return; + } + + // Sometime, the response will be very slow, and does not respond, the connect event will be block by event loop system. + // And timer callback will be fired, and abort() will be invoked before connection, then get "socket hang up" and code ECONNRESET. + // At this time, if we have a large number of request, nodejs will hang up some socket on background. and the number will up and up. + // And then these socket which be hang up will devoring CPU little by little. + // ClientRequest.setTimeout will be fired on the specify milliseconds, and can make sure that abort() will be fired after connect. + req.setTimeout(timeout, function handleRequestTimeout() { + req.abort(); + reject(createError( + 'timeout of ' + timeout + 'ms exceeded', + config, + config.transitional && config.transitional.clarifyTimeoutError ? 'ETIMEDOUT' : 'ECONNABORTED', + req + )); + }); + } + + if (config.cancelToken) { + // Handle cancellation + config.cancelToken.promise.then(function onCanceled(cancel) { + if (req.aborted) return; + + req.abort(); + reject(cancel); + }); + } + + // Send the request + if (utils.isStream(data)) { + data.on('error', function handleStreamError(err) { + reject(enhanceError(err, config, null, req)); + }).pipe(req); + } else { + req.end(data); + } + }); +}; diff --git a/node_modules/hxz-api/node_modules/axios/lib/adapters/xhr.js b/node_modules/hxz-api/node_modules/axios/lib/adapters/xhr.js new file mode 100644 index 000000000..a386dd24a --- /dev/null +++ b/node_modules/hxz-api/node_modules/axios/lib/adapters/xhr.js @@ -0,0 +1,189 @@ +'use strict'; + +var utils = require('./../utils'); +var settle = require('./../core/settle'); +var cookies = require('./../helpers/cookies'); +var buildURL = require('./../helpers/buildURL'); +var buildFullPath = require('../core/buildFullPath'); +var parseHeaders = require('./../helpers/parseHeaders'); +var isURLSameOrigin = require('./../helpers/isURLSameOrigin'); +var createError = require('../core/createError'); + +module.exports = function xhrAdapter(config) { + return new Promise(function dispatchXhrRequest(resolve, reject) { + var requestData = config.data; + var requestHeaders = config.headers; + var responseType = config.responseType; + + if (utils.isFormData(requestData)) { + delete requestHeaders['Content-Type']; // Let the browser set it + } + + var request = new XMLHttpRequest(); + + // HTTP basic authentication + if (config.auth) { + var username = config.auth.username || ''; + var password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : ''; + requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password); + } + + var fullPath = buildFullPath(config.baseURL, config.url); + request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true); + + // Set the request timeout in MS + request.timeout = config.timeout; + + function onloadend() { + if (!request) { + return; + } + // Prepare the response + var responseHeaders = 'getAllResponseHeaders' in request ? parseHeaders(request.getAllResponseHeaders()) : null; + var responseData = !responseType || responseType === 'text' || responseType === 'json' ? + request.responseText : request.response; + var response = { + data: responseData, + status: request.status, + statusText: request.statusText, + headers: responseHeaders, + config: config, + request: request + }; + + settle(resolve, reject, response); + + // Clean up request + request = null; + } + + if ('onloadend' in request) { + // Use onloadend if available + request.onloadend = onloadend; + } else { + // Listen for ready state to emulate onloadend + request.onreadystatechange = function handleLoad() { + if (!request || request.readyState !== 4) { + return; + } + + // The request errored out and we didn't get a response, this will be + // handled by onerror instead + // With one exception: request that using file: protocol, most browsers + // will return status as 0 even though it's a successful request + if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) { + return; + } + // readystate handler is calling before onerror or ontimeout handlers, + // so we should call onloadend on the next 'tick' + setTimeout(onloadend); + }; + } + + // Handle browser request cancellation (as opposed to a manual cancellation) + request.onabort = function handleAbort() { + if (!request) { + return; + } + + reject(createError('Request aborted', config, 'ECONNABORTED', request)); + + // Clean up request + request = null; + }; + + // Handle low level network errors + request.onerror = function handleError() { + // Real errors are hidden from us by the browser + // onerror should only fire if it's a network error + reject(createError('Network Error', config, null, request)); + + // Clean up request + request = null; + }; + + // Handle timeout + request.ontimeout = function handleTimeout() { + var timeoutErrorMessage = 'timeout of ' + config.timeout + 'ms exceeded'; + if (config.timeoutErrorMessage) { + timeoutErrorMessage = config.timeoutErrorMessage; + } + reject(createError( + timeoutErrorMessage, + config, + config.transitional && config.transitional.clarifyTimeoutError ? 'ETIMEDOUT' : 'ECONNABORTED', + request)); + + // Clean up request + request = null; + }; + + // Add xsrf header + // This is only done if running in a standard browser environment. + // Specifically not if we're in a web worker, or react-native. + if (utils.isStandardBrowserEnv()) { + // Add xsrf header + var xsrfValue = (config.withCredentials || isURLSameOrigin(fullPath)) && config.xsrfCookieName ? + cookies.read(config.xsrfCookieName) : + undefined; + + if (xsrfValue) { + requestHeaders[config.xsrfHeaderName] = xsrfValue; + } + } + + // Add headers to the request + if ('setRequestHeader' in request) { + utils.forEach(requestHeaders, function setRequestHeader(val, key) { + if (typeof requestData === 'undefined' && key.toLowerCase() === 'content-type') { + // Remove Content-Type if data is undefined + delete requestHeaders[key]; + } else { + // Otherwise add header to the request + request.setRequestHeader(key, val); + } + }); + } + + // Add withCredentials to request if needed + if (!utils.isUndefined(config.withCredentials)) { + request.withCredentials = !!config.withCredentials; + } + + // Add responseType to request if needed + if (responseType && responseType !== 'json') { + request.responseType = config.responseType; + } + + // Handle progress if needed + if (typeof config.onDownloadProgress === 'function') { + request.addEventListener('progress', config.onDownloadProgress); + } + + // Not all browsers support upload events + if (typeof config.onUploadProgress === 'function' && request.upload) { + request.upload.addEventListener('progress', config.onUploadProgress); + } + + if (config.cancelToken) { + // Handle cancellation + config.cancelToken.promise.then(function onCanceled(cancel) { + if (!request) { + return; + } + + request.abort(); + reject(cancel); + // Clean up request + request = null; + }); + } + + if (!requestData) { + requestData = null; + } + + // Send the request + request.send(requestData); + }); +}; diff --git a/node_modules/hxz-api/node_modules/axios/lib/axios.js b/node_modules/hxz-api/node_modules/axios/lib/axios.js new file mode 100644 index 000000000..c6357b005 --- /dev/null +++ b/node_modules/hxz-api/node_modules/axios/lib/axios.js @@ -0,0 +1,56 @@ +'use strict'; + +var utils = require('./utils'); +var bind = require('./helpers/bind'); +var Axios = require('./core/Axios'); +var mergeConfig = require('./core/mergeConfig'); +var defaults = require('./defaults'); + +/** + * Create an instance of Axios + * + * @param {Object} defaultConfig The default config for the instance + * @return {Axios} A new instance of Axios + */ +function createInstance(defaultConfig) { + var context = new Axios(defaultConfig); + var instance = bind(Axios.prototype.request, context); + + // Copy axios.prototype to instance + utils.extend(instance, Axios.prototype, context); + + // Copy context to instance + utils.extend(instance, context); + + return instance; +} + +// Create the default instance to be exported +var axios = createInstance(defaults); + +// Expose Axios class to allow class inheritance +axios.Axios = Axios; + +// Factory for creating new instances +axios.create = function create(instanceConfig) { + return createInstance(mergeConfig(axios.defaults, instanceConfig)); +}; + +// Expose Cancel & CancelToken +axios.Cancel = require('./cancel/Cancel'); +axios.CancelToken = require('./cancel/CancelToken'); +axios.isCancel = require('./cancel/isCancel'); + +// Expose all/spread +axios.all = function all(promises) { + return Promise.all(promises); +}; +axios.spread = require('./helpers/spread'); + +// Expose isAxiosError +axios.isAxiosError = require('./helpers/isAxiosError'); + +module.exports = axios; + +// Allow use of default import syntax in TypeScript +module.exports.default = axios; diff --git a/node_modules/hxz-api/node_modules/axios/lib/cancel/Cancel.js b/node_modules/hxz-api/node_modules/axios/lib/cancel/Cancel.js new file mode 100644 index 000000000..e0de4003f --- /dev/null +++ b/node_modules/hxz-api/node_modules/axios/lib/cancel/Cancel.js @@ -0,0 +1,19 @@ +'use strict'; + +/** + * A `Cancel` is an object that is thrown when an operation is canceled. + * + * @class + * @param {string=} message The message. + */ +function Cancel(message) { + this.message = message; +} + +Cancel.prototype.toString = function toString() { + return 'Cancel' + (this.message ? ': ' + this.message : ''); +}; + +Cancel.prototype.__CANCEL__ = true; + +module.exports = Cancel; diff --git a/node_modules/hxz-api/node_modules/axios/lib/cancel/CancelToken.js b/node_modules/hxz-api/node_modules/axios/lib/cancel/CancelToken.js new file mode 100644 index 000000000..6b46e6662 --- /dev/null +++ b/node_modules/hxz-api/node_modules/axios/lib/cancel/CancelToken.js @@ -0,0 +1,57 @@ +'use strict'; + +var Cancel = require('./Cancel'); + +/** + * A `CancelToken` is an object that can be used to request cancellation of an operation. + * + * @class + * @param {Function} executor The executor function. + */ +function CancelToken(executor) { + if (typeof executor !== 'function') { + throw new TypeError('executor must be a function.'); + } + + var resolvePromise; + this.promise = new Promise(function promiseExecutor(resolve) { + resolvePromise = resolve; + }); + + var token = this; + executor(function cancel(message) { + if (token.reason) { + // Cancellation has already been requested + return; + } + + token.reason = new Cancel(message); + resolvePromise(token.reason); + }); +} + +/** + * Throws a `Cancel` if cancellation has been requested. + */ +CancelToken.prototype.throwIfRequested = function throwIfRequested() { + if (this.reason) { + throw this.reason; + } +}; + +/** + * Returns an object that contains a new `CancelToken` and a function that, when called, + * cancels the `CancelToken`. + */ +CancelToken.source = function source() { + var cancel; + var token = new CancelToken(function executor(c) { + cancel = c; + }); + return { + token: token, + cancel: cancel + }; +}; + +module.exports = CancelToken; diff --git a/node_modules/hxz-api/node_modules/axios/lib/cancel/isCancel.js b/node_modules/hxz-api/node_modules/axios/lib/cancel/isCancel.js new file mode 100644 index 000000000..051f3ae4c --- /dev/null +++ b/node_modules/hxz-api/node_modules/axios/lib/cancel/isCancel.js @@ -0,0 +1,5 @@ +'use strict'; + +module.exports = function isCancel(value) { + return !!(value && value.__CANCEL__); +}; diff --git a/node_modules/hxz-api/node_modules/axios/lib/core/Axios.js b/node_modules/hxz-api/node_modules/axios/lib/core/Axios.js new file mode 100644 index 000000000..42ea75e7e --- /dev/null +++ b/node_modules/hxz-api/node_modules/axios/lib/core/Axios.js @@ -0,0 +1,148 @@ +'use strict'; + +var utils = require('./../utils'); +var buildURL = require('../helpers/buildURL'); +var InterceptorManager = require('./InterceptorManager'); +var dispatchRequest = require('./dispatchRequest'); +var mergeConfig = require('./mergeConfig'); +var validator = require('../helpers/validator'); + +var validators = validator.validators; +/** + * Create a new instance of Axios + * + * @param {Object} instanceConfig The default config for the instance + */ +function Axios(instanceConfig) { + this.defaults = instanceConfig; + this.interceptors = { + request: new InterceptorManager(), + response: new InterceptorManager() + }; +} + +/** + * Dispatch a request + * + * @param {Object} config The config specific for this request (merged with this.defaults) + */ +Axios.prototype.request = function request(config) { + /*eslint no-param-reassign:0*/ + // Allow for axios('example/url'[, config]) a la fetch API + if (typeof config === 'string') { + config = arguments[1] || {}; + config.url = arguments[0]; + } else { + config = config || {}; + } + + config = mergeConfig(this.defaults, config); + + // Set config.method + if (config.method) { + config.method = config.method.toLowerCase(); + } else if (this.defaults.method) { + config.method = this.defaults.method.toLowerCase(); + } else { + config.method = 'get'; + } + + var transitional = config.transitional; + + if (transitional !== undefined) { + validator.assertOptions(transitional, { + silentJSONParsing: validators.transitional(validators.boolean, '1.0.0'), + forcedJSONParsing: validators.transitional(validators.boolean, '1.0.0'), + clarifyTimeoutError: validators.transitional(validators.boolean, '1.0.0') + }, false); + } + + // filter out skipped interceptors + var requestInterceptorChain = []; + var synchronousRequestInterceptors = true; + this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) { + if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) { + return; + } + + synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous; + + requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected); + }); + + var responseInterceptorChain = []; + this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) { + responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected); + }); + + var promise; + + if (!synchronousRequestInterceptors) { + var chain = [dispatchRequest, undefined]; + + Array.prototype.unshift.apply(chain, requestInterceptorChain); + chain = chain.concat(responseInterceptorChain); + + promise = Promise.resolve(config); + while (chain.length) { + promise = promise.then(chain.shift(), chain.shift()); + } + + return promise; + } + + + var newConfig = config; + while (requestInterceptorChain.length) { + var onFulfilled = requestInterceptorChain.shift(); + var onRejected = requestInterceptorChain.shift(); + try { + newConfig = onFulfilled(newConfig); + } catch (error) { + onRejected(error); + break; + } + } + + try { + promise = dispatchRequest(newConfig); + } catch (error) { + return Promise.reject(error); + } + + while (responseInterceptorChain.length) { + promise = promise.then(responseInterceptorChain.shift(), responseInterceptorChain.shift()); + } + + return promise; +}; + +Axios.prototype.getUri = function getUri(config) { + config = mergeConfig(this.defaults, config); + return buildURL(config.url, config.params, config.paramsSerializer).replace(/^\?/, ''); +}; + +// Provide aliases for supported request methods +utils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) { + /*eslint func-names:0*/ + Axios.prototype[method] = function(url, config) { + return this.request(mergeConfig(config || {}, { + method: method, + url: url, + data: (config || {}).data + })); + }; +}); + +utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) { + /*eslint func-names:0*/ + Axios.prototype[method] = function(url, data, config) { + return this.request(mergeConfig(config || {}, { + method: method, + url: url, + data: data + })); + }; +}); + +module.exports = Axios; diff --git a/node_modules/hxz-api/node_modules/axios/lib/core/InterceptorManager.js b/node_modules/hxz-api/node_modules/axios/lib/core/InterceptorManager.js new file mode 100644 index 000000000..900f44880 --- /dev/null +++ b/node_modules/hxz-api/node_modules/axios/lib/core/InterceptorManager.js @@ -0,0 +1,54 @@ +'use strict'; + +var utils = require('./../utils'); + +function InterceptorManager() { + this.handlers = []; +} + +/** + * Add a new interceptor to the stack + * + * @param {Function} fulfilled The function to handle `then` for a `Promise` + * @param {Function} rejected The function to handle `reject` for a `Promise` + * + * @return {Number} An ID used to remove interceptor later + */ +InterceptorManager.prototype.use = function use(fulfilled, rejected, options) { + this.handlers.push({ + fulfilled: fulfilled, + rejected: rejected, + synchronous: options ? options.synchronous : false, + runWhen: options ? options.runWhen : null + }); + return this.handlers.length - 1; +}; + +/** + * Remove an interceptor from the stack + * + * @param {Number} id The ID that was returned by `use` + */ +InterceptorManager.prototype.eject = function eject(id) { + if (this.handlers[id]) { + this.handlers[id] = null; + } +}; + +/** + * Iterate over all the registered interceptors + * + * This method is particularly useful for skipping over any + * interceptors that may have become `null` calling `eject`. + * + * @param {Function} fn The function to call for each interceptor + */ +InterceptorManager.prototype.forEach = function forEach(fn) { + utils.forEach(this.handlers, function forEachHandler(h) { + if (h !== null) { + fn(h); + } + }); +}; + +module.exports = InterceptorManager; diff --git a/node_modules/hxz-api/node_modules/axios/lib/core/README.md b/node_modules/hxz-api/node_modules/axios/lib/core/README.md new file mode 100644 index 000000000..84559ce7c --- /dev/null +++ b/node_modules/hxz-api/node_modules/axios/lib/core/README.md @@ -0,0 +1,8 @@ +# axios // core + +The modules found in `core/` should be modules that are specific to the domain logic of axios. These modules would most likely not make sense to be consumed outside of the axios module, as their logic is too specific. Some examples of core modules are: + +- Dispatching requests + - Requests sent via `adapters/` (see lib/adapters/README.md) +- Managing interceptors +- Handling config diff --git a/node_modules/hxz-api/node_modules/axios/lib/core/buildFullPath.js b/node_modules/hxz-api/node_modules/axios/lib/core/buildFullPath.js new file mode 100644 index 000000000..00b2b050a --- /dev/null +++ b/node_modules/hxz-api/node_modules/axios/lib/core/buildFullPath.js @@ -0,0 +1,20 @@ +'use strict'; + +var isAbsoluteURL = require('../helpers/isAbsoluteURL'); +var combineURLs = require('../helpers/combineURLs'); + +/** + * Creates a new URL by combining the baseURL with the requestedURL, + * only when the requestedURL is not already an absolute URL. + * If the requestURL is absolute, this function returns the requestedURL untouched. + * + * @param {string} baseURL The base URL + * @param {string} requestedURL Absolute or relative URL to combine + * @returns {string} The combined full path + */ +module.exports = function buildFullPath(baseURL, requestedURL) { + if (baseURL && !isAbsoluteURL(requestedURL)) { + return combineURLs(baseURL, requestedURL); + } + return requestedURL; +}; diff --git a/node_modules/hxz-api/node_modules/axios/lib/core/createError.js b/node_modules/hxz-api/node_modules/axios/lib/core/createError.js new file mode 100644 index 000000000..933680f69 --- /dev/null +++ b/node_modules/hxz-api/node_modules/axios/lib/core/createError.js @@ -0,0 +1,18 @@ +'use strict'; + +var enhanceError = require('./enhanceError'); + +/** + * Create an Error with the specified message, config, error code, request and response. + * + * @param {string} message The error message. + * @param {Object} config The config. + * @param {string} [code] The error code (for example, 'ECONNABORTED'). + * @param {Object} [request] The request. + * @param {Object} [response] The response. + * @returns {Error} The created error. + */ +module.exports = function createError(message, config, code, request, response) { + var error = new Error(message); + return enhanceError(error, config, code, request, response); +}; diff --git a/node_modules/hxz-api/node_modules/axios/lib/core/dispatchRequest.js b/node_modules/hxz-api/node_modules/axios/lib/core/dispatchRequest.js new file mode 100644 index 000000000..9ce3b96e6 --- /dev/null +++ b/node_modules/hxz-api/node_modules/axios/lib/core/dispatchRequest.js @@ -0,0 +1,82 @@ +'use strict'; + +var utils = require('./../utils'); +var transformData = require('./transformData'); +var isCancel = require('../cancel/isCancel'); +var defaults = require('../defaults'); + +/** + * Throws a `Cancel` if cancellation has been requested. + */ +function throwIfCancellationRequested(config) { + if (config.cancelToken) { + config.cancelToken.throwIfRequested(); + } +} + +/** + * Dispatch a request to the server using the configured adapter. + * + * @param {object} config The config that is to be used for the request + * @returns {Promise} The Promise to be fulfilled + */ +module.exports = function dispatchRequest(config) { + throwIfCancellationRequested(config); + + // Ensure headers exist + config.headers = config.headers || {}; + + // Transform request data + config.data = transformData.call( + config, + config.data, + config.headers, + config.transformRequest + ); + + // Flatten headers + config.headers = utils.merge( + config.headers.common || {}, + config.headers[config.method] || {}, + config.headers + ); + + utils.forEach( + ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'], + function cleanHeaderConfig(method) { + delete config.headers[method]; + } + ); + + var adapter = config.adapter || defaults.adapter; + + return adapter(config).then(function onAdapterResolution(response) { + throwIfCancellationRequested(config); + + // Transform response data + response.data = transformData.call( + config, + response.data, + response.headers, + config.transformResponse + ); + + return response; + }, function onAdapterRejection(reason) { + if (!isCancel(reason)) { + throwIfCancellationRequested(config); + + // Transform response data + if (reason && reason.response) { + reason.response.data = transformData.call( + config, + reason.response.data, + reason.response.headers, + config.transformResponse + ); + } + } + + return Promise.reject(reason); + }); +}; diff --git a/node_modules/hxz-api/node_modules/axios/lib/core/enhanceError.js b/node_modules/hxz-api/node_modules/axios/lib/core/enhanceError.js new file mode 100644 index 000000000..b6bc4444e --- /dev/null +++ b/node_modules/hxz-api/node_modules/axios/lib/core/enhanceError.js @@ -0,0 +1,42 @@ +'use strict'; + +/** + * Update an Error with the specified config, error code, and response. + * + * @param {Error} error The error to update. + * @param {Object} config The config. + * @param {string} [code] The error code (for example, 'ECONNABORTED'). + * @param {Object} [request] The request. + * @param {Object} [response] The response. + * @returns {Error} The error. + */ +module.exports = function enhanceError(error, config, code, request, response) { + error.config = config; + if (code) { + error.code = code; + } + + error.request = request; + error.response = response; + error.isAxiosError = true; + + error.toJSON = function toJSON() { + return { + // Standard + message: this.message, + name: this.name, + // Microsoft + description: this.description, + number: this.number, + // Mozilla + fileName: this.fileName, + lineNumber: this.lineNumber, + columnNumber: this.columnNumber, + stack: this.stack, + // Axios + config: this.config, + code: this.code + }; + }; + return error; +}; diff --git a/node_modules/hxz-api/node_modules/axios/lib/core/mergeConfig.js b/node_modules/hxz-api/node_modules/axios/lib/core/mergeConfig.js new file mode 100644 index 000000000..5a2c10cb0 --- /dev/null +++ b/node_modules/hxz-api/node_modules/axios/lib/core/mergeConfig.js @@ -0,0 +1,87 @@ +'use strict'; + +var utils = require('../utils'); + +/** + * Config-specific merge-function which creates a new config-object + * by merging two configuration objects together. + * + * @param {Object} config1 + * @param {Object} config2 + * @returns {Object} New object resulting from merging config2 to config1 + */ +module.exports = function mergeConfig(config1, config2) { + // eslint-disable-next-line no-param-reassign + config2 = config2 || {}; + var config = {}; + + var valueFromConfig2Keys = ['url', 'method', 'data']; + var mergeDeepPropertiesKeys = ['headers', 'auth', 'proxy', 'params']; + var defaultToConfig2Keys = [ + 'baseURL', 'transformRequest', 'transformResponse', 'paramsSerializer', + 'timeout', 'timeoutMessage', 'withCredentials', 'adapter', 'responseType', 'xsrfCookieName', + 'xsrfHeaderName', 'onUploadProgress', 'onDownloadProgress', 'decompress', + 'maxContentLength', 'maxBodyLength', 'maxRedirects', 'transport', 'httpAgent', + 'httpsAgent', 'cancelToken', 'socketPath', 'responseEncoding' + ]; + var directMergeKeys = ['validateStatus']; + + function getMergedValue(target, source) { + if (utils.isPlainObject(target) && utils.isPlainObject(source)) { + return utils.merge(target, source); + } else if (utils.isPlainObject(source)) { + return utils.merge({}, source); + } else if (utils.isArray(source)) { + return source.slice(); + } + return source; + } + + function mergeDeepProperties(prop) { + if (!utils.isUndefined(config2[prop])) { + config[prop] = getMergedValue(config1[prop], config2[prop]); + } else if (!utils.isUndefined(config1[prop])) { + config[prop] = getMergedValue(undefined, config1[prop]); + } + } + + utils.forEach(valueFromConfig2Keys, function valueFromConfig2(prop) { + if (!utils.isUndefined(config2[prop])) { + config[prop] = getMergedValue(undefined, config2[prop]); + } + }); + + utils.forEach(mergeDeepPropertiesKeys, mergeDeepProperties); + + utils.forEach(defaultToConfig2Keys, function defaultToConfig2(prop) { + if (!utils.isUndefined(config2[prop])) { + config[prop] = getMergedValue(undefined, config2[prop]); + } else if (!utils.isUndefined(config1[prop])) { + config[prop] = getMergedValue(undefined, config1[prop]); + } + }); + + utils.forEach(directMergeKeys, function merge(prop) { + if (prop in config2) { + config[prop] = getMergedValue(config1[prop], config2[prop]); + } else if (prop in config1) { + config[prop] = getMergedValue(undefined, config1[prop]); + } + }); + + var axiosKeys = valueFromConfig2Keys + .concat(mergeDeepPropertiesKeys) + .concat(defaultToConfig2Keys) + .concat(directMergeKeys); + + var otherKeys = Object + .keys(config1) + .concat(Object.keys(config2)) + .filter(function filterAxiosKeys(key) { + return axiosKeys.indexOf(key) === -1; + }); + + utils.forEach(otherKeys, mergeDeepProperties); + + return config; +}; diff --git a/node_modules/hxz-api/node_modules/axios/lib/core/settle.js b/node_modules/hxz-api/node_modules/axios/lib/core/settle.js new file mode 100644 index 000000000..886adb0c1 --- /dev/null +++ b/node_modules/hxz-api/node_modules/axios/lib/core/settle.js @@ -0,0 +1,25 @@ +'use strict'; + +var createError = require('./createError'); + +/** + * Resolve or reject a Promise based on response status. + * + * @param {Function} resolve A function that resolves the promise. + * @param {Function} reject A function that rejects the promise. + * @param {object} response The response. + */ +module.exports = function settle(resolve, reject, response) { + var validateStatus = response.config.validateStatus; + if (!response.status || !validateStatus || validateStatus(response.status)) { + resolve(response); + } else { + reject(createError( + 'Request failed with status code ' + response.status, + response.config, + null, + response.request, + response + )); + } +}; diff --git a/node_modules/hxz-api/node_modules/axios/lib/core/transformData.js b/node_modules/hxz-api/node_modules/axios/lib/core/transformData.js new file mode 100644 index 000000000..c584d12bc --- /dev/null +++ b/node_modules/hxz-api/node_modules/axios/lib/core/transformData.js @@ -0,0 +1,22 @@ +'use strict'; + +var utils = require('./../utils'); +var defaults = require('./../defaults'); + +/** + * Transform the data for a request or a response + * + * @param {Object|String} data The data to be transformed + * @param {Array} headers The headers for the request or response + * @param {Array|Function} fns A single function or Array of functions + * @returns {*} The resulting transformed data + */ +module.exports = function transformData(data, headers, fns) { + var context = this || defaults; + /*eslint no-param-reassign:0*/ + utils.forEach(fns, function transform(fn) { + data = fn.call(context, data, headers); + }); + + return data; +}; diff --git a/node_modules/hxz-api/node_modules/axios/lib/defaults.js b/node_modules/hxz-api/node_modules/axios/lib/defaults.js new file mode 100644 index 000000000..55e69d9ae --- /dev/null +++ b/node_modules/hxz-api/node_modules/axios/lib/defaults.js @@ -0,0 +1,134 @@ +'use strict'; + +var utils = require('./utils'); +var normalizeHeaderName = require('./helpers/normalizeHeaderName'); +var enhanceError = require('./core/enhanceError'); + +var DEFAULT_CONTENT_TYPE = { + 'Content-Type': 'application/x-www-form-urlencoded' +}; + +function setContentTypeIfUnset(headers, value) { + if (!utils.isUndefined(headers) && utils.isUndefined(headers['Content-Type'])) { + headers['Content-Type'] = value; + } +} + +function getDefaultAdapter() { + var adapter; + if (typeof XMLHttpRequest !== 'undefined') { + // For browsers use XHR adapter + adapter = require('./adapters/xhr'); + } else if (typeof process !== 'undefined' && Object.prototype.toString.call(process) === '[object process]') { + // For node use HTTP adapter + adapter = require('./adapters/http'); + } + return adapter; +} + +function stringifySafely(rawValue, parser, encoder) { + if (utils.isString(rawValue)) { + try { + (parser || JSON.parse)(rawValue); + return utils.trim(rawValue); + } catch (e) { + if (e.name !== 'SyntaxError') { + throw e; + } + } + } + + return (encoder || JSON.stringify)(rawValue); +} + +var defaults = { + + transitional: { + silentJSONParsing: true, + forcedJSONParsing: true, + clarifyTimeoutError: false + }, + + adapter: getDefaultAdapter(), + + transformRequest: [function transformRequest(data, headers) { + normalizeHeaderName(headers, 'Accept'); + normalizeHeaderName(headers, 'Content-Type'); + + if (utils.isFormData(data) || + utils.isArrayBuffer(data) || + utils.isBuffer(data) || + utils.isStream(data) || + utils.isFile(data) || + utils.isBlob(data) + ) { + return data; + } + if (utils.isArrayBufferView(data)) { + return data.buffer; + } + if (utils.isURLSearchParams(data)) { + setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8'); + return data.toString(); + } + if (utils.isObject(data) || (headers && headers['Content-Type'] === 'application/json')) { + setContentTypeIfUnset(headers, 'application/json'); + return stringifySafely(data); + } + return data; + }], + + transformResponse: [function transformResponse(data) { + var transitional = this.transitional; + var silentJSONParsing = transitional && transitional.silentJSONParsing; + var forcedJSONParsing = transitional && transitional.forcedJSONParsing; + var strictJSONParsing = !silentJSONParsing && this.responseType === 'json'; + + if (strictJSONParsing || (forcedJSONParsing && utils.isString(data) && data.length)) { + try { + return JSON.parse(data); + } catch (e) { + if (strictJSONParsing) { + if (e.name === 'SyntaxError') { + throw enhanceError(e, this, 'E_JSON_PARSE'); + } + throw e; + } + } + } + + return data; + }], + + /** + * A timeout in milliseconds to abort a request. If set to 0 (default) a + * timeout is not created. + */ + timeout: 0, + + xsrfCookieName: 'XSRF-TOKEN', + xsrfHeaderName: 'X-XSRF-TOKEN', + + maxContentLength: -1, + maxBodyLength: -1, + + validateStatus: function validateStatus(status) { + return status >= 200 && status < 300; + } +}; + +defaults.headers = { + common: { + 'Accept': 'application/json, text/plain, */*' + } +}; + +utils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) { + defaults.headers[method] = {}; +}); + +utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) { + defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE); +}); + +module.exports = defaults; diff --git a/node_modules/hxz-api/node_modules/axios/lib/helpers/README.md b/node_modules/hxz-api/node_modules/axios/lib/helpers/README.md new file mode 100644 index 000000000..4ae34193a --- /dev/null +++ b/node_modules/hxz-api/node_modules/axios/lib/helpers/README.md @@ -0,0 +1,7 @@ +# axios // helpers + +The modules found in `helpers/` should be generic modules that are _not_ specific to the domain logic of axios. These modules could theoretically be published to npm on their own and consumed by other modules or apps. Some examples of generic modules are things like: + +- Browser polyfills +- Managing cookies +- Parsing HTTP headers diff --git a/node_modules/hxz-api/node_modules/axios/lib/helpers/bind.js b/node_modules/hxz-api/node_modules/axios/lib/helpers/bind.js new file mode 100644 index 000000000..6147c608e --- /dev/null +++ b/node_modules/hxz-api/node_modules/axios/lib/helpers/bind.js @@ -0,0 +1,11 @@ +'use strict'; + +module.exports = function bind(fn, thisArg) { + return function wrap() { + var args = new Array(arguments.length); + for (var i = 0; i < args.length; i++) { + args[i] = arguments[i]; + } + return fn.apply(thisArg, args); + }; +}; diff --git a/node_modules/hxz-api/node_modules/axios/lib/helpers/buildURL.js b/node_modules/hxz-api/node_modules/axios/lib/helpers/buildURL.js new file mode 100644 index 000000000..31595c33a --- /dev/null +++ b/node_modules/hxz-api/node_modules/axios/lib/helpers/buildURL.js @@ -0,0 +1,70 @@ +'use strict'; + +var utils = require('./../utils'); + +function encode(val) { + return encodeURIComponent(val). + replace(/%3A/gi, ':'). + replace(/%24/g, '$'). + replace(/%2C/gi, ','). + replace(/%20/g, '+'). + replace(/%5B/gi, '['). + replace(/%5D/gi, ']'); +} + +/** + * Build a URL by appending params to the end + * + * @param {string} url The base of the url (e.g., http://www.google.com) + * @param {object} [params] The params to be appended + * @returns {string} The formatted url + */ +module.exports = function buildURL(url, params, paramsSerializer) { + /*eslint no-param-reassign:0*/ + if (!params) { + return url; + } + + var serializedParams; + if (paramsSerializer) { + serializedParams = paramsSerializer(params); + } else if (utils.isURLSearchParams(params)) { + serializedParams = params.toString(); + } else { + var parts = []; + + utils.forEach(params, function serialize(val, key) { + if (val === null || typeof val === 'undefined') { + return; + } + + if (utils.isArray(val)) { + key = key + '[]'; + } else { + val = [val]; + } + + utils.forEach(val, function parseValue(v) { + if (utils.isDate(v)) { + v = v.toISOString(); + } else if (utils.isObject(v)) { + v = JSON.stringify(v); + } + parts.push(encode(key) + '=' + encode(v)); + }); + }); + + serializedParams = parts.join('&'); + } + + if (serializedParams) { + var hashmarkIndex = url.indexOf('#'); + if (hashmarkIndex !== -1) { + url = url.slice(0, hashmarkIndex); + } + + url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams; + } + + return url; +}; diff --git a/node_modules/hxz-api/node_modules/axios/lib/helpers/combineURLs.js b/node_modules/hxz-api/node_modules/axios/lib/helpers/combineURLs.js new file mode 100644 index 000000000..f1b58a586 --- /dev/null +++ b/node_modules/hxz-api/node_modules/axios/lib/helpers/combineURLs.js @@ -0,0 +1,14 @@ +'use strict'; + +/** + * Creates a new URL by combining the specified URLs + * + * @param {string} baseURL The base URL + * @param {string} relativeURL The relative URL + * @returns {string} The combined URL + */ +module.exports = function combineURLs(baseURL, relativeURL) { + return relativeURL + ? baseURL.replace(/\/+$/, '') + '/' + relativeURL.replace(/^\/+/, '') + : baseURL; +}; diff --git a/node_modules/hxz-api/node_modules/axios/lib/helpers/cookies.js b/node_modules/hxz-api/node_modules/axios/lib/helpers/cookies.js new file mode 100644 index 000000000..5a8a66661 --- /dev/null +++ b/node_modules/hxz-api/node_modules/axios/lib/helpers/cookies.js @@ -0,0 +1,53 @@ +'use strict'; + +var utils = require('./../utils'); + +module.exports = ( + utils.isStandardBrowserEnv() ? + + // Standard browser envs support document.cookie + (function standardBrowserEnv() { + return { + write: function write(name, value, expires, path, domain, secure) { + var cookie = []; + cookie.push(name + '=' + encodeURIComponent(value)); + + if (utils.isNumber(expires)) { + cookie.push('expires=' + new Date(expires).toGMTString()); + } + + if (utils.isString(path)) { + cookie.push('path=' + path); + } + + if (utils.isString(domain)) { + cookie.push('domain=' + domain); + } + + if (secure === true) { + cookie.push('secure'); + } + + document.cookie = cookie.join('; '); + }, + + read: function read(name) { + var match = document.cookie.match(new RegExp('(^|;\\s*)(' + name + ')=([^;]*)')); + return (match ? decodeURIComponent(match[3]) : null); + }, + + remove: function remove(name) { + this.write(name, '', Date.now() - 86400000); + } + }; + })() : + + // Non standard browser env (web workers, react-native) lack needed support. + (function nonStandardBrowserEnv() { + return { + write: function write() {}, + read: function read() { return null; }, + remove: function remove() {} + }; + })() +); diff --git a/node_modules/hxz-api/node_modules/axios/lib/helpers/deprecatedMethod.js b/node_modules/hxz-api/node_modules/axios/lib/helpers/deprecatedMethod.js new file mode 100644 index 000000000..ed40965ba --- /dev/null +++ b/node_modules/hxz-api/node_modules/axios/lib/helpers/deprecatedMethod.js @@ -0,0 +1,24 @@ +'use strict'; + +/*eslint no-console:0*/ + +/** + * Supply a warning to the developer that a method they are using + * has been deprecated. + * + * @param {string} method The name of the deprecated method + * @param {string} [instead] The alternate method to use if applicable + * @param {string} [docs] The documentation URL to get further details + */ +module.exports = function deprecatedMethod(method, instead, docs) { + try { + console.warn( + 'DEPRECATED method `' + method + '`.' + + (instead ? ' Use `' + instead + '` instead.' : '') + + ' This method will be removed in a future release.'); + + if (docs) { + console.warn('For more information about usage see ' + docs); + } + } catch (e) { /* Ignore */ } +}; diff --git a/node_modules/hxz-api/node_modules/axios/lib/helpers/isAbsoluteURL.js b/node_modules/hxz-api/node_modules/axios/lib/helpers/isAbsoluteURL.js new file mode 100644 index 000000000..d33e99275 --- /dev/null +++ b/node_modules/hxz-api/node_modules/axios/lib/helpers/isAbsoluteURL.js @@ -0,0 +1,14 @@ +'use strict'; + +/** + * Determines whether the specified URL is absolute + * + * @param {string} url The URL to test + * @returns {boolean} True if the specified URL is absolute, otherwise false + */ +module.exports = function isAbsoluteURL(url) { + // A URL is considered absolute if it begins with "://" or "//" (protocol-relative URL). + // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed + // by any combination of letters, digits, plus, period, or hyphen. + return /^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(url); +}; diff --git a/node_modules/hxz-api/node_modules/axios/lib/helpers/isAxiosError.js b/node_modules/hxz-api/node_modules/axios/lib/helpers/isAxiosError.js new file mode 100644 index 000000000..29ff41af8 --- /dev/null +++ b/node_modules/hxz-api/node_modules/axios/lib/helpers/isAxiosError.js @@ -0,0 +1,11 @@ +'use strict'; + +/** + * Determines whether the payload is an error thrown by Axios + * + * @param {*} payload The value to test + * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false + */ +module.exports = function isAxiosError(payload) { + return (typeof payload === 'object') && (payload.isAxiosError === true); +}; diff --git a/node_modules/hxz-api/node_modules/axios/lib/helpers/isURLSameOrigin.js b/node_modules/hxz-api/node_modules/axios/lib/helpers/isURLSameOrigin.js new file mode 100644 index 000000000..f1d89ad19 --- /dev/null +++ b/node_modules/hxz-api/node_modules/axios/lib/helpers/isURLSameOrigin.js @@ -0,0 +1,68 @@ +'use strict'; + +var utils = require('./../utils'); + +module.exports = ( + utils.isStandardBrowserEnv() ? + + // Standard browser envs have full support of the APIs needed to test + // whether the request URL is of the same origin as current location. + (function standardBrowserEnv() { + var msie = /(msie|trident)/i.test(navigator.userAgent); + var urlParsingNode = document.createElement('a'); + var originURL; + + /** + * Parse a URL to discover it's components + * + * @param {String} url The URL to be parsed + * @returns {Object} + */ + function resolveURL(url) { + var href = url; + + if (msie) { + // IE needs attribute set twice to normalize properties + urlParsingNode.setAttribute('href', href); + href = urlParsingNode.href; + } + + urlParsingNode.setAttribute('href', href); + + // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils + return { + href: urlParsingNode.href, + protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '', + host: urlParsingNode.host, + search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, '') : '', + hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '', + hostname: urlParsingNode.hostname, + port: urlParsingNode.port, + pathname: (urlParsingNode.pathname.charAt(0) === '/') ? + urlParsingNode.pathname : + '/' + urlParsingNode.pathname + }; + } + + originURL = resolveURL(window.location.href); + + /** + * Determine if a URL shares the same origin as the current location + * + * @param {String} requestURL The URL to test + * @returns {boolean} True if URL shares the same origin, otherwise false + */ + return function isURLSameOrigin(requestURL) { + var parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL; + return (parsed.protocol === originURL.protocol && + parsed.host === originURL.host); + }; + })() : + + // Non standard browser envs (web workers, react-native) lack needed support. + (function nonStandardBrowserEnv() { + return function isURLSameOrigin() { + return true; + }; + })() +); diff --git a/node_modules/hxz-api/node_modules/axios/lib/helpers/normalizeHeaderName.js b/node_modules/hxz-api/node_modules/axios/lib/helpers/normalizeHeaderName.js new file mode 100644 index 000000000..738c9fe40 --- /dev/null +++ b/node_modules/hxz-api/node_modules/axios/lib/helpers/normalizeHeaderName.js @@ -0,0 +1,12 @@ +'use strict'; + +var utils = require('../utils'); + +module.exports = function normalizeHeaderName(headers, normalizedName) { + utils.forEach(headers, function processHeader(value, name) { + if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) { + headers[normalizedName] = value; + delete headers[name]; + } + }); +}; diff --git a/node_modules/hxz-api/node_modules/axios/lib/helpers/parseHeaders.js b/node_modules/hxz-api/node_modules/axios/lib/helpers/parseHeaders.js new file mode 100644 index 000000000..8af2cc7f1 --- /dev/null +++ b/node_modules/hxz-api/node_modules/axios/lib/helpers/parseHeaders.js @@ -0,0 +1,53 @@ +'use strict'; + +var utils = require('./../utils'); + +// Headers whose duplicates are ignored by node +// c.f. https://nodejs.org/api/http.html#http_message_headers +var ignoreDuplicateOf = [ + 'age', 'authorization', 'content-length', 'content-type', 'etag', + 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since', + 'last-modified', 'location', 'max-forwards', 'proxy-authorization', + 'referer', 'retry-after', 'user-agent' +]; + +/** + * Parse headers into an object + * + * ``` + * Date: Wed, 27 Aug 2014 08:58:49 GMT + * Content-Type: application/json + * Connection: keep-alive + * Transfer-Encoding: chunked + * ``` + * + * @param {String} headers Headers needing to be parsed + * @returns {Object} Headers parsed into an object + */ +module.exports = function parseHeaders(headers) { + var parsed = {}; + var key; + var val; + var i; + + if (!headers) { return parsed; } + + utils.forEach(headers.split('\n'), function parser(line) { + i = line.indexOf(':'); + key = utils.trim(line.substr(0, i)).toLowerCase(); + val = utils.trim(line.substr(i + 1)); + + if (key) { + if (parsed[key] && ignoreDuplicateOf.indexOf(key) >= 0) { + return; + } + if (key === 'set-cookie') { + parsed[key] = (parsed[key] ? parsed[key] : []).concat([val]); + } else { + parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val; + } + } + }); + + return parsed; +}; diff --git a/node_modules/hxz-api/node_modules/axios/lib/helpers/spread.js b/node_modules/hxz-api/node_modules/axios/lib/helpers/spread.js new file mode 100644 index 000000000..25e3cdd39 --- /dev/null +++ b/node_modules/hxz-api/node_modules/axios/lib/helpers/spread.js @@ -0,0 +1,27 @@ +'use strict'; + +/** + * Syntactic sugar for invoking a function and expanding an array for arguments. + * + * Common use case would be to use `Function.prototype.apply`. + * + * ```js + * function f(x, y, z) {} + * var args = [1, 2, 3]; + * f.apply(null, args); + * ``` + * + * With `spread` this example can be re-written. + * + * ```js + * spread(function(x, y, z) {})([1, 2, 3]); + * ``` + * + * @param {Function} callback + * @returns {Function} + */ +module.exports = function spread(callback) { + return function wrap(arr) { + return callback.apply(null, arr); + }; +}; diff --git a/node_modules/hxz-api/node_modules/axios/lib/helpers/validator.js b/node_modules/hxz-api/node_modules/axios/lib/helpers/validator.js new file mode 100644 index 000000000..7f1bc7dfa --- /dev/null +++ b/node_modules/hxz-api/node_modules/axios/lib/helpers/validator.js @@ -0,0 +1,105 @@ +'use strict'; + +var pkg = require('./../../package.json'); + +var validators = {}; + +// eslint-disable-next-line func-names +['object', 'boolean', 'number', 'function', 'string', 'symbol'].forEach(function(type, i) { + validators[type] = function validator(thing) { + return typeof thing === type || 'a' + (i < 1 ? 'n ' : ' ') + type; + }; +}); + +var deprecatedWarnings = {}; +var currentVerArr = pkg.version.split('.'); + +/** + * Compare package versions + * @param {string} version + * @param {string?} thanVersion + * @returns {boolean} + */ +function isOlderVersion(version, thanVersion) { + var pkgVersionArr = thanVersion ? thanVersion.split('.') : currentVerArr; + var destVer = version.split('.'); + for (var i = 0; i < 3; i++) { + if (pkgVersionArr[i] > destVer[i]) { + return true; + } else if (pkgVersionArr[i] < destVer[i]) { + return false; + } + } + return false; +} + +/** + * Transitional option validator + * @param {function|boolean?} validator + * @param {string?} version + * @param {string} message + * @returns {function} + */ +validators.transitional = function transitional(validator, version, message) { + var isDeprecated = version && isOlderVersion(version); + + function formatMessage(opt, desc) { + return '[Axios v' + pkg.version + '] Transitional option \'' + opt + '\'' + desc + (message ? '. ' + message : ''); + } + + // eslint-disable-next-line func-names + return function(value, opt, opts) { + if (validator === false) { + throw new Error(formatMessage(opt, ' has been removed in ' + version)); + } + + if (isDeprecated && !deprecatedWarnings[opt]) { + deprecatedWarnings[opt] = true; + // eslint-disable-next-line no-console + console.warn( + formatMessage( + opt, + ' has been deprecated since v' + version + ' and will be removed in the near future' + ) + ); + } + + return validator ? validator(value, opt, opts) : true; + }; +}; + +/** + * Assert object's properties type + * @param {object} options + * @param {object} schema + * @param {boolean?} allowUnknown + */ + +function assertOptions(options, schema, allowUnknown) { + if (typeof options !== 'object') { + throw new TypeError('options must be an object'); + } + var keys = Object.keys(options); + var i = keys.length; + while (i-- > 0) { + var opt = keys[i]; + var validator = schema[opt]; + if (validator) { + var value = options[opt]; + var result = value === undefined || validator(value, opt, options); + if (result !== true) { + throw new TypeError('option ' + opt + ' must be ' + result); + } + continue; + } + if (allowUnknown !== true) { + throw Error('Unknown option ' + opt); + } + } +} + +module.exports = { + isOlderVersion: isOlderVersion, + assertOptions: assertOptions, + validators: validators +}; diff --git a/node_modules/hxz-api/node_modules/axios/lib/utils.js b/node_modules/hxz-api/node_modules/axios/lib/utils.js new file mode 100644 index 000000000..5d966f444 --- /dev/null +++ b/node_modules/hxz-api/node_modules/axios/lib/utils.js @@ -0,0 +1,349 @@ +'use strict'; + +var bind = require('./helpers/bind'); + +// utils is a library of generic helper functions non-specific to axios + +var toString = Object.prototype.toString; + +/** + * Determine if a value is an Array + * + * @param {Object} val The value to test + * @returns {boolean} True if value is an Array, otherwise false + */ +function isArray(val) { + return toString.call(val) === '[object Array]'; +} + +/** + * Determine if a value is undefined + * + * @param {Object} val The value to test + * @returns {boolean} True if the value is undefined, otherwise false + */ +function isUndefined(val) { + return typeof val === 'undefined'; +} + +/** + * Determine if a value is a Buffer + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a Buffer, otherwise false + */ +function isBuffer(val) { + return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor) + && typeof val.constructor.isBuffer === 'function' && val.constructor.isBuffer(val); +} + +/** + * Determine if a value is an ArrayBuffer + * + * @param {Object} val The value to test + * @returns {boolean} True if value is an ArrayBuffer, otherwise false + */ +function isArrayBuffer(val) { + return toString.call(val) === '[object ArrayBuffer]'; +} + +/** + * Determine if a value is a FormData + * + * @param {Object} val The value to test + * @returns {boolean} True if value is an FormData, otherwise false + */ +function isFormData(val) { + return (typeof FormData !== 'undefined') && (val instanceof FormData); +} + +/** + * Determine if a value is a view on an ArrayBuffer + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false + */ +function isArrayBufferView(val) { + var result; + if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) { + result = ArrayBuffer.isView(val); + } else { + result = (val) && (val.buffer) && (val.buffer instanceof ArrayBuffer); + } + return result; +} + +/** + * Determine if a value is a String + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a String, otherwise false + */ +function isString(val) { + return typeof val === 'string'; +} + +/** + * Determine if a value is a Number + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a Number, otherwise false + */ +function isNumber(val) { + return typeof val === 'number'; +} + +/** + * Determine if a value is an Object + * + * @param {Object} val The value to test + * @returns {boolean} True if value is an Object, otherwise false + */ +function isObject(val) { + return val !== null && typeof val === 'object'; +} + +/** + * Determine if a value is a plain Object + * + * @param {Object} val The value to test + * @return {boolean} True if value is a plain Object, otherwise false + */ +function isPlainObject(val) { + if (toString.call(val) !== '[object Object]') { + return false; + } + + var prototype = Object.getPrototypeOf(val); + return prototype === null || prototype === Object.prototype; +} + +/** + * Determine if a value is a Date + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a Date, otherwise false + */ +function isDate(val) { + return toString.call(val) === '[object Date]'; +} + +/** + * Determine if a value is a File + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a File, otherwise false + */ +function isFile(val) { + return toString.call(val) === '[object File]'; +} + +/** + * Determine if a value is a Blob + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a Blob, otherwise false + */ +function isBlob(val) { + return toString.call(val) === '[object Blob]'; +} + +/** + * Determine if a value is a Function + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a Function, otherwise false + */ +function isFunction(val) { + return toString.call(val) === '[object Function]'; +} + +/** + * Determine if a value is a Stream + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a Stream, otherwise false + */ +function isStream(val) { + return isObject(val) && isFunction(val.pipe); +} + +/** + * Determine if a value is a URLSearchParams object + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a URLSearchParams object, otherwise false + */ +function isURLSearchParams(val) { + return typeof URLSearchParams !== 'undefined' && val instanceof URLSearchParams; +} + +/** + * Trim excess whitespace off the beginning and end of a string + * + * @param {String} str The String to trim + * @returns {String} The String freed of excess whitespace + */ +function trim(str) { + return str.trim ? str.trim() : str.replace(/^\s+|\s+$/g, ''); +} + +/** + * Determine if we're running in a standard browser environment + * + * This allows axios to run in a web worker, and react-native. + * Both environments support XMLHttpRequest, but not fully standard globals. + * + * web workers: + * typeof window -> undefined + * typeof document -> undefined + * + * react-native: + * navigator.product -> 'ReactNative' + * nativescript + * navigator.product -> 'NativeScript' or 'NS' + */ +function isStandardBrowserEnv() { + if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' || + navigator.product === 'NativeScript' || + navigator.product === 'NS')) { + return false; + } + return ( + typeof window !== 'undefined' && + typeof document !== 'undefined' + ); +} + +/** + * Iterate over an Array or an Object invoking a function for each item. + * + * If `obj` is an Array callback will be called passing + * the value, index, and complete array for each item. + * + * If 'obj' is an Object callback will be called passing + * the value, key, and complete object for each property. + * + * @param {Object|Array} obj The object to iterate + * @param {Function} fn The callback to invoke for each item + */ +function forEach(obj, fn) { + // Don't bother if no value provided + if (obj === null || typeof obj === 'undefined') { + return; + } + + // Force an array if not already something iterable + if (typeof obj !== 'object') { + /*eslint no-param-reassign:0*/ + obj = [obj]; + } + + if (isArray(obj)) { + // Iterate over array values + for (var i = 0, l = obj.length; i < l; i++) { + fn.call(null, obj[i], i, obj); + } + } else { + // Iterate over object keys + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) { + fn.call(null, obj[key], key, obj); + } + } + } +} + +/** + * Accepts varargs expecting each argument to be an object, then + * immutably merges the properties of each object and returns result. + * + * When multiple objects contain the same key the later object in + * the arguments list will take precedence. + * + * Example: + * + * ```js + * var result = merge({foo: 123}, {foo: 456}); + * console.log(result.foo); // outputs 456 + * ``` + * + * @param {Object} obj1 Object to merge + * @returns {Object} Result of all merge properties + */ +function merge(/* obj1, obj2, obj3, ... */) { + var result = {}; + function assignValue(val, key) { + if (isPlainObject(result[key]) && isPlainObject(val)) { + result[key] = merge(result[key], val); + } else if (isPlainObject(val)) { + result[key] = merge({}, val); + } else if (isArray(val)) { + result[key] = val.slice(); + } else { + result[key] = val; + } + } + + for (var i = 0, l = arguments.length; i < l; i++) { + forEach(arguments[i], assignValue); + } + return result; +} + +/** + * Extends object a by mutably adding to it the properties of object b. + * + * @param {Object} a The object to be extended + * @param {Object} b The object to copy properties from + * @param {Object} thisArg The object to bind function to + * @return {Object} The resulting value of object a + */ +function extend(a, b, thisArg) { + forEach(b, function assignValue(val, key) { + if (thisArg && typeof val === 'function') { + a[key] = bind(val, thisArg); + } else { + a[key] = val; + } + }); + return a; +} + +/** + * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM) + * + * @param {string} content with BOM + * @return {string} content value without BOM + */ +function stripBOM(content) { + if (content.charCodeAt(0) === 0xFEFF) { + content = content.slice(1); + } + return content; +} + +module.exports = { + isArray: isArray, + isArrayBuffer: isArrayBuffer, + isBuffer: isBuffer, + isFormData: isFormData, + isArrayBufferView: isArrayBufferView, + isString: isString, + isNumber: isNumber, + isObject: isObject, + isPlainObject: isPlainObject, + isUndefined: isUndefined, + isDate: isDate, + isFile: isFile, + isBlob: isBlob, + isFunction: isFunction, + isStream: isStream, + isURLSearchParams: isURLSearchParams, + isStandardBrowserEnv: isStandardBrowserEnv, + forEach: forEach, + merge: merge, + extend: extend, + trim: trim, + stripBOM: stripBOM +}; diff --git a/node_modules/hxz-api/node_modules/axios/package.json b/node_modules/hxz-api/node_modules/axios/package.json new file mode 100644 index 000000000..7c895b3a9 --- /dev/null +++ b/node_modules/hxz-api/node_modules/axios/package.json @@ -0,0 +1,84 @@ +{ + "name": "axios", + "version": "0.21.4", + "description": "Promise based HTTP client for the browser and node.js", + "main": "index.js", + "scripts": { + "test": "grunt test", + "start": "node ./sandbox/server.js", + "build": "NODE_ENV=production grunt build", + "preversion": "npm test", + "version": "npm run build && grunt version && git add -A dist && git add CHANGELOG.md bower.json package.json", + "postversion": "git push && git push --tags", + "examples": "node ./examples/server.js", + "coveralls": "cat coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js", + "fix": "eslint --fix lib/**/*.js" + }, + "repository": { + "type": "git", + "url": "https://github.com/axios/axios.git" + }, + "keywords": [ + "xhr", + "http", + "ajax", + "promise", + "node" + ], + "author": "Matt Zabriskie", + "license": "MIT", + "bugs": { + "url": "https://github.com/axios/axios/issues" + }, + "homepage": "https://axios-http.com", + "devDependencies": { + "coveralls": "^3.0.0", + "es6-promise": "^4.2.4", + "grunt": "^1.3.0", + "grunt-banner": "^0.6.0", + "grunt-cli": "^1.2.0", + "grunt-contrib-clean": "^1.1.0", + "grunt-contrib-watch": "^1.0.0", + "grunt-eslint": "^23.0.0", + "grunt-karma": "^4.0.0", + "grunt-mocha-test": "^0.13.3", + "grunt-ts": "^6.0.0-beta.19", + "grunt-webpack": "^4.0.2", + "istanbul-instrumenter-loader": "^1.0.0", + "jasmine-core": "^2.4.1", + "karma": "^6.3.2", + "karma-chrome-launcher": "^3.1.0", + "karma-firefox-launcher": "^2.1.0", + "karma-jasmine": "^1.1.1", + "karma-jasmine-ajax": "^0.1.13", + "karma-safari-launcher": "^1.0.0", + "karma-sauce-launcher": "^4.3.6", + "karma-sinon": "^1.0.5", + "karma-sourcemap-loader": "^0.3.8", + "karma-webpack": "^4.0.2", + "load-grunt-tasks": "^3.5.2", + "minimist": "^1.2.0", + "mocha": "^8.2.1", + "sinon": "^4.5.0", + "terser-webpack-plugin": "^4.2.3", + "typescript": "^4.0.5", + "url-search-params": "^0.10.0", + "webpack": "^4.44.2", + "webpack-dev-server": "^3.11.0" + }, + "browser": { + "./lib/adapters/http.js": "./lib/adapters/xhr.js" + }, + "jsdelivr": "dist/axios.min.js", + "unpkg": "dist/axios.min.js", + "typings": "./index.d.ts", + "dependencies": { + "follow-redirects": "^1.14.0" + }, + "bundlesize": [ + { + "path": "./dist/axios.min.js", + "threshold": "5kB" + } + ] +} diff --git a/node_modules/hxz-api/package.json b/node_modules/hxz-api/package.json new file mode 100644 index 000000000..12524387c --- /dev/null +++ b/node_modules/hxz-api/package.json @@ -0,0 +1,30 @@ +{ + "name": "hxz-api", + "version": "1.0.1", + "description": "hexa-api", + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/Hexagonz/Hexa-api.git" + }, + "keywords": [ + "YNTKTS" + ], + "author": "Hexagon", + "license": "ISC", + "bugs": { + "url": "https://github.com/Hexagonz/Hexa-Api/issues" + }, + "homepage": "https://github.com/Hexagonz/Hexa-Api#readme", + "dependencies": { + "axios": "^0.21.1", + "cheerio": "^1.0.0-rc.10", + "qs": "^6.10.1" + }, + "directories": { + "lib": "lib" + } +} diff --git a/node_modules/ip/README.md b/node_modules/ip/README.md new file mode 100644 index 000000000..22e5819ff --- /dev/null +++ b/node_modules/ip/README.md @@ -0,0 +1,90 @@ +# IP +[![](https://badge.fury.io/js/ip.svg)](https://www.npmjs.com/package/ip) + +IP address utilities for node.js + +## Installation + +### npm +```shell +npm install ip +``` + +### git + +```shell +git clone https://github.com/indutny/node-ip.git +``` + +## Usage +Get your ip address, compare ip addresses, validate ip addresses, etc. + +```js +var ip = require('ip'); + +ip.address() // my ip address +ip.isEqual('::1', '::0:1'); // true +ip.toBuffer('127.0.0.1') // Buffer([127, 0, 0, 1]) +ip.toString(new Buffer([127, 0, 0, 1])) // 127.0.0.1 +ip.fromPrefixLen(24) // 255.255.255.0 +ip.mask('192.168.1.134', '255.255.255.0') // 192.168.1.0 +ip.cidr('192.168.1.134/26') // 192.168.1.128 +ip.not('255.255.255.0') // 0.0.0.255 +ip.or('192.168.1.134', '0.0.0.255') // 192.168.1.255 +ip.isPrivate('127.0.0.1') // true +ip.isV4Format('127.0.0.1'); // true +ip.isV6Format('::ffff:127.0.0.1'); // true + +// operate on buffers in-place +var buf = new Buffer(128); +var offset = 64; +ip.toBuffer('127.0.0.1', buf, offset); // [127, 0, 0, 1] at offset 64 +ip.toString(buf, offset, 4); // '127.0.0.1' + +// subnet information +ip.subnet('192.168.1.134', '255.255.255.192') +// { networkAddress: '192.168.1.128', +// firstAddress: '192.168.1.129', +// lastAddress: '192.168.1.190', +// broadcastAddress: '192.168.1.191', +// subnetMask: '255.255.255.192', +// subnetMaskLength: 26, +// numHosts: 62, +// length: 64, +// contains: function(addr){...} } +ip.cidrSubnet('192.168.1.134/26') +// Same as previous. + +// range checking +ip.cidrSubnet('192.168.1.134/26').contains('192.168.1.190') // true + + +// ipv4 long conversion +ip.toLong('127.0.0.1'); // 2130706433 +ip.fromLong(2130706433); // '127.0.0.1' +``` + +### License + +This software is licensed under the MIT License. + +Copyright Fedor Indutny, 2012. + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to permit +persons to whom the Software is furnished to do so, subject to the +following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/ip/lib/ip.js b/node_modules/ip/lib/ip.js new file mode 100644 index 000000000..5b5ccc246 --- /dev/null +++ b/node_modules/ip/lib/ip.js @@ -0,0 +1,427 @@ +var ip = exports; +var { Buffer } = require('buffer'); +var os = require('os'); + +ip.toBuffer = function (ip, buff, offset) { + offset = ~~offset; + + var result; + + if (this.isV4Format(ip)) { + result = buff || new Buffer(offset + 4); + ip.split(/\./g).map((byte) => { + result[offset++] = parseInt(byte, 10) & 0xff; + }); + } else if (this.isV6Format(ip)) { + var sections = ip.split(':', 8); + + var i; + for (i = 0; i < sections.length; i++) { + var isv4 = this.isV4Format(sections[i]); + var v4Buffer; + + if (isv4) { + v4Buffer = this.toBuffer(sections[i]); + sections[i] = v4Buffer.slice(0, 2).toString('hex'); + } + + if (v4Buffer && ++i < 8) { + sections.splice(i, 0, v4Buffer.slice(2, 4).toString('hex')); + } + } + + if (sections[0] === '') { + while (sections.length < 8) sections.unshift('0'); + } else if (sections[sections.length - 1] === '') { + while (sections.length < 8) sections.push('0'); + } else if (sections.length < 8) { + for (i = 0; i < sections.length && sections[i] !== ''; i++); + var argv = [i, 1]; + for (i = 9 - sections.length; i > 0; i--) { + argv.push('0'); + } + sections.splice.apply(sections, argv); + } + + result = buff || new Buffer(offset + 16); + for (i = 0; i < sections.length; i++) { + var word = parseInt(sections[i], 16); + result[offset++] = (word >> 8) & 0xff; + result[offset++] = word & 0xff; + } + } + + if (!result) { + throw Error(`Invalid ip address: ${ip}`); + } + + return result; +}; + +ip.toString = function (buff, offset, length) { + offset = ~~offset; + length = length || (buff.length - offset); + + var result = []; + var i; + if (length === 4) { + // IPv4 + for (i = 0; i < length; i++) { + result.push(buff[offset + i]); + } + result = result.join('.'); + } else if (length === 16) { + // IPv6 + for (i = 0; i < length; i += 2) { + result.push(buff.readUInt16BE(offset + i).toString(16)); + } + result = result.join(':'); + result = result.replace(/(^|:)0(:0)*:0(:|$)/, '$1::$3'); + result = result.replace(/:{3,4}/, '::'); + } + + return result; +}; + +var ipv4Regex = /^(\d{1,3}\.){3,3}\d{1,3}$/; +var ipv6Regex = /^(::)?(((\d{1,3}\.){3}(\d{1,3}){1})?([0-9a-f]){0,4}:{0,2}){1,8}(::)?$/i; + +ip.isV4Format = function (ip) { + return ipv4Regex.test(ip); +}; + +ip.isV6Format = function (ip) { + return ipv6Regex.test(ip); +}; + +function _normalizeFamily(family) { + if (family === 4) { + return 'ipv4'; + } + if (family === 6) { + return 'ipv6'; + } + return family ? family.toLowerCase() : 'ipv4'; +} + +ip.fromPrefixLen = function (prefixlen, family) { + if (prefixlen > 32) { + family = 'ipv6'; + } else { + family = _normalizeFamily(family); + } + + var len = 4; + if (family === 'ipv6') { + len = 16; + } + var buff = new Buffer(len); + + for (var i = 0, n = buff.length; i < n; ++i) { + var bits = 8; + if (prefixlen < 8) { + bits = prefixlen; + } + prefixlen -= bits; + + buff[i] = ~(0xff >> bits) & 0xff; + } + + return ip.toString(buff); +}; + +ip.mask = function (addr, mask) { + addr = ip.toBuffer(addr); + mask = ip.toBuffer(mask); + + var result = new Buffer(Math.max(addr.length, mask.length)); + + // Same protocol - do bitwise and + var i; + if (addr.length === mask.length) { + for (i = 0; i < addr.length; i++) { + result[i] = addr[i] & mask[i]; + } + } else if (mask.length === 4) { + // IPv6 address and IPv4 mask + // (Mask low bits) + for (i = 0; i < mask.length; i++) { + result[i] = addr[addr.length - 4 + i] & mask[i]; + } + } else { + // IPv6 mask and IPv4 addr + for (i = 0; i < result.length - 6; i++) { + result[i] = 0; + } + + // ::ffff:ipv4 + result[10] = 0xff; + result[11] = 0xff; + for (i = 0; i < addr.length; i++) { + result[i + 12] = addr[i] & mask[i + 12]; + } + i += 12; + } + for (; i < result.length; i++) { + result[i] = 0; + } + + return ip.toString(result); +}; + +ip.cidr = function (cidrString) { + var cidrParts = cidrString.split('/'); + + var addr = cidrParts[0]; + if (cidrParts.length !== 2) { + throw new Error(`invalid CIDR subnet: ${addr}`); + } + + var mask = ip.fromPrefixLen(parseInt(cidrParts[1], 10)); + + return ip.mask(addr, mask); +}; + +ip.subnet = function (addr, mask) { + var networkAddress = ip.toLong(ip.mask(addr, mask)); + + // Calculate the mask's length. + var maskBuffer = ip.toBuffer(mask); + var maskLength = 0; + + for (var i = 0; i < maskBuffer.length; i++) { + if (maskBuffer[i] === 0xff) { + maskLength += 8; + } else { + var octet = maskBuffer[i] & 0xff; + while (octet) { + octet = (octet << 1) & 0xff; + maskLength++; + } + } + } + + var numberOfAddresses = Math.pow(2, 32 - maskLength); + + return { + networkAddress: ip.fromLong(networkAddress), + firstAddress: numberOfAddresses <= 2 + ? ip.fromLong(networkAddress) + : ip.fromLong(networkAddress + 1), + lastAddress: numberOfAddresses <= 2 + ? ip.fromLong(networkAddress + numberOfAddresses - 1) + : ip.fromLong(networkAddress + numberOfAddresses - 2), + broadcastAddress: ip.fromLong(networkAddress + numberOfAddresses - 1), + subnetMask: mask, + subnetMaskLength: maskLength, + numHosts: numberOfAddresses <= 2 + ? numberOfAddresses : numberOfAddresses - 2, + length: numberOfAddresses, + contains(other) { + return networkAddress === ip.toLong(ip.mask(other, mask)); + }, + }; +}; + +ip.cidrSubnet = function (cidrString) { + var cidrParts = cidrString.split('/'); + + var addr = cidrParts[0]; + if (cidrParts.length !== 2) { + throw new Error(`invalid CIDR subnet: ${addr}`); + } + + var mask = ip.fromPrefixLen(parseInt(cidrParts[1], 10)); + + return ip.subnet(addr, mask); +}; + +ip.not = function (addr) { + var buff = ip.toBuffer(addr); + for (var i = 0; i < buff.length; i++) { + buff[i] = 0xff ^ buff[i]; + } + return ip.toString(buff); +}; + +ip.or = function (a, b) { + var i; + + a = ip.toBuffer(a); + b = ip.toBuffer(b); + + // same protocol + if (a.length === b.length) { + for (i = 0; i < a.length; ++i) { + a[i] |= b[i]; + } + return ip.toString(a); + + // mixed protocols + } + var buff = a; + var other = b; + if (b.length > a.length) { + buff = b; + other = a; + } + + var offset = buff.length - other.length; + for (i = offset; i < buff.length; ++i) { + buff[i] |= other[i - offset]; + } + + return ip.toString(buff); +}; + +ip.isEqual = function (a, b) { + var i; + + a = ip.toBuffer(a); + b = ip.toBuffer(b); + + // Same protocol + if (a.length === b.length) { + for (i = 0; i < a.length; i++) { + if (a[i] !== b[i]) return false; + } + return true; + } + + // Swap + if (b.length === 4) { + var t = b; + b = a; + a = t; + } + + // a - IPv4, b - IPv6 + for (i = 0; i < 10; i++) { + if (b[i] !== 0) return false; + } + + var word = b.readUInt16BE(10); + if (word !== 0 && word !== 0xffff) return false; + + for (i = 0; i < 4; i++) { + if (a[i] !== b[i + 12]) return false; + } + + return true; +}; + +ip.isPrivate = function (addr) { + return /^(::f{4}:)?10\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})$/i + .test(addr) + || /^(::f{4}:)?192\.168\.([0-9]{1,3})\.([0-9]{1,3})$/i.test(addr) + || /^(::f{4}:)?172\.(1[6-9]|2\d|30|31)\.([0-9]{1,3})\.([0-9]{1,3})$/i + .test(addr) + || /^(::f{4}:)?127\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})$/i.test(addr) + || /^(::f{4}:)?169\.254\.([0-9]{1,3})\.([0-9]{1,3})$/i.test(addr) + || /^f[cd][0-9a-f]{2}:/i.test(addr) + || /^fe80:/i.test(addr) + || /^::1$/.test(addr) + || /^::$/.test(addr); +}; + +ip.isPublic = function (addr) { + return !ip.isPrivate(addr); +}; + +ip.isLoopback = function (addr) { + return /^(::f{4}:)?127\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})/ + .test(addr) + || /^fe80::1$/.test(addr) + || /^::1$/.test(addr) + || /^::$/.test(addr); +}; + +ip.loopback = function (family) { + // + // Default to `ipv4` + // + family = _normalizeFamily(family); + + if (family !== 'ipv4' && family !== 'ipv6') { + throw new Error('family must be ipv4 or ipv6'); + } + + return family === 'ipv4' ? '127.0.0.1' : 'fe80::1'; +}; + +// +// ### function address (name, family) +// #### @name {string|'public'|'private'} **Optional** Name or security +// of the network interface. +// #### @family {ipv4|ipv6} **Optional** IP family of the address (defaults +// to ipv4). +// +// Returns the address for the network interface on the current system with +// the specified `name`: +// * String: First `family` address of the interface. +// If not found see `undefined`. +// * 'public': the first public ip address of family. +// * 'private': the first private ip address of family. +// * undefined: First address with `ipv4` or loopback address `127.0.0.1`. +// +ip.address = function (name, family) { + var interfaces = os.networkInterfaces(); + + // + // Default to `ipv4` + // + family = _normalizeFamily(family); + + // + // If a specific network interface has been named, + // return the address. + // + if (name && name !== 'private' && name !== 'public') { + var res = interfaces[name].filter((details) => { + var itemFamily = _normalizeFamily(details.family); + return itemFamily === family; + }); + if (res.length === 0) { + return undefined; + } + return res[0].address; + } + + var all = Object.keys(interfaces).map((nic) => { + // + // Note: name will only be `public` or `private` + // when this is called. + // + var addresses = interfaces[nic].filter((details) => { + details.family = _normalizeFamily(details.family); + if (details.family !== family || ip.isLoopback(details.address)) { + return false; + } if (!name) { + return true; + } + + return name === 'public' ? ip.isPrivate(details.address) + : ip.isPublic(details.address); + }); + + return addresses.length ? addresses[0].address : undefined; + }).filter(Boolean); + + return !all.length ? ip.loopback(family) : all[0]; +}; + +ip.toLong = function (ip) { + var ipl = 0; + ip.split('.').forEach((octet) => { + ipl <<= 8; + ipl += parseInt(octet); + }); + return (ipl >>> 0); +}; + +ip.fromLong = function (ipl) { + return (`${ipl >>> 24}.${ + ipl >> 16 & 255}.${ + ipl >> 8 & 255}.${ + ipl & 255}`); +}; diff --git a/node_modules/ip/package.json b/node_modules/ip/package.json new file mode 100644 index 000000000..70e1a4f02 --- /dev/null +++ b/node_modules/ip/package.json @@ -0,0 +1,25 @@ +{ + "name": "ip", + "version": "1.1.8", + "author": "Fedor Indutny ", + "homepage": "https://github.com/indutny/node-ip", + "repository": { + "type": "git", + "url": "http://github.com/indutny/node-ip.git" + }, + "files": [ + "lib", + "README.md" + ], + "main": "lib/ip", + "devDependencies": { + "eslint": "^8.15.0", + "mocha": "^10.0.0" + }, + "scripts": { + "lint": "eslint lib/*.js test/*.js", + "test": "npm run lint && mocha --reporter spec test/*-test.js", + "fix": "npm run lint -- --fix" + }, + "license": "MIT" +} diff --git a/node_modules/kareem/.eslintrc.json b/node_modules/kareem/.eslintrc.json new file mode 100644 index 000000000..3fee7aed1 --- /dev/null +++ b/node_modules/kareem/.eslintrc.json @@ -0,0 +1,16 @@ +{ + "extends": [ + "@masteringjs" + ], + "parserOptions": { + "ecmaVersion": 2020 + }, + "env": { + "node": true, + "es6": true + }, + "rules": { + "no-var": "off", + "prefer-const": "off" + } +} \ No newline at end of file diff --git a/node_modules/kareem/.github/workflows/test.yml b/node_modules/kareem/.github/workflows/test.yml new file mode 100644 index 000000000..ed306cb6a --- /dev/null +++ b/node_modules/kareem/.github/workflows/test.yml @@ -0,0 +1,47 @@ +name: Test +on: + pull_request: + push: +permissions: + contents: read + +jobs: + test: + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + node: [12, 14, 16, 18] + os: [ubuntu-20.04] + name: Node ${{ matrix.node }} + steps: + - uses: actions/checkout@a12a3943b4bdde767164f792f33f40b04645d846 # v3 + + - name: Setup node + uses: actions/setup-node@5b52f097d36d4b0b2f94ed6de710023fbb8b2236 # v3.1.0 + with: + node-version: ${{ matrix.node }} + + - run: npm install + + - run: npm test + + lint: + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + node: [18] + os: [ubuntu-20.04] + name: Lint + steps: + - uses: actions/checkout@a12a3943b4bdde767164f792f33f40b04645d846 # v3 + + - name: Setup node + uses: actions/setup-node@5b52f097d36d4b0b2f94ed6de710023fbb8b2236 # v3.1.0 + with: + node-version: ${{ matrix.node }} + + - run: npm install + + - run: npm run lint \ No newline at end of file diff --git a/node_modules/kareem/.travis.yml b/node_modules/kareem/.travis.yml new file mode 100644 index 000000000..0a388b901 --- /dev/null +++ b/node_modules/kareem/.travis.yml @@ -0,0 +1,12 @@ +language: node_js +node_js: + - "12" + - "10" + - "9" + - "8" + - "7" + - "6" + - "5" + - "4" +script: "npm run-script test-travis" +after_script: "npm install coveralls@2.10.0 && cat ./coverage/lcov.info | coveralls" diff --git a/node_modules/kareem/CHANGELOG.md b/node_modules/kareem/CHANGELOG.md new file mode 100644 index 000000000..02830dd1a --- /dev/null +++ b/node_modules/kareem/CHANGELOG.md @@ -0,0 +1,808 @@ +# Changelog + + +## 2.4.0 (2022-06-13) + +* feat: add `overwriteResult()` and `skipWrappedFunction()` for more advanced control flow + + +## 2.3.4 (2022-02-10) + +* perf: various performance improvements #27 #24 #23 #22 #21 #20 + + +## 2.3.3 (2021-12-26) + +* fix: handle sync errors in `wrap()` + + +## 2.3.2 (2020-12-08) + +* fix: handle sync errors in pre hooks if there are multiple hooks + + +## 2.3.0 (2018-09-24) + +* chore(release): 2.2.3 ([c8f2695](https://github.com/vkarpov15/kareem/commit/c8f2695)) +* chore(release): 2.2.4 ([a377a4f](https://github.com/vkarpov15/kareem/commit/a377a4f)) +* chore(release): 2.2.5 ([5a495e3](https://github.com/vkarpov15/kareem/commit/5a495e3)) +* fix(filter): copy async pres correctly with `filter()` ([1b1ed8a](https://github.com/vkarpov15/kareem/commit/1b1ed8a)), closes [Automattic/mongoose#3054](https://github.com/Automattic/mongoose/issues/3054) +* feat: add filter() function ([1f641f4](https://github.com/vkarpov15/kareem/commit/1f641f4)) +* feat: support storing options on pre and post hooks ([59220b9](https://github.com/vkarpov15/kareem/commit/59220b9)) + + + + +## 2.2.3 (2018-09-10) + +* chore: release 2.2.3 ([af653a3](https://github.com/vkarpov15/kareem/commit/af653a3)) + + + + +## 2.2.2 (2018-09-10) + +* chore: release 2.2.2 ([3f0144d](https://github.com/vkarpov15/kareem/commit/3f0144d)) +* fix: allow merge() to not clone ([e628d65](https://github.com/vkarpov15/kareem/commit/e628d65)) + + + + +## 2.2.1 (2018-06-05) + +* chore: release 2.2.1 ([4625a64](https://github.com/vkarpov15/kareem/commit/4625a64)) +* chore: remove lockfile from git ([7f3e4e6](https://github.com/vkarpov15/kareem/commit/7f3e4e6)) +* fix: handle numAsync correctly when merging ([fef8e7e](https://github.com/vkarpov15/kareem/commit/fef8e7e)) +* test: repro issue with not copying numAsync ([952d9db](https://github.com/vkarpov15/kareem/commit/952d9db)) + + + + +## 2.2.0 (2018-06-05) + +* chore: release 2.2.0 ([ff9ad03](https://github.com/vkarpov15/kareem/commit/ff9ad03)) +* fix: use maps instead of objects for _pres and _posts so `toString()` doesn't get reported as having ([55df303](https://github.com/vkarpov15/kareem/commit/55df303)), closes [Automattic/mongoose#6538](https://github.com/Automattic/mongoose/issues/6538) + + + + +## 2.1.0 (2018-05-16) + +* chore: release 2.1.0 ([ba5f1bc](https://github.com/vkarpov15/kareem/commit/ba5f1bc)) +* feat: add option to check wrapped function return value for promises ([c9d7dd1](https://github.com/vkarpov15/kareem/commit/c9d7dd1)) +* refactor: use const in wrap() ([0fc21f9](https://github.com/vkarpov15/kareem/commit/0fc21f9)) + + + + +## 2.0.7 (2018-04-28) + +* chore: release 2.0.7 ([0bf91e6](https://github.com/vkarpov15/kareem/commit/0bf91e6)) +* feat: add `hasHooks()` ([225f18d](https://github.com/vkarpov15/kareem/commit/225f18d)), closes [Automattic/mongoose#6385](https://github.com/Automattic/mongoose/issues/6385) + + + + +## 2.0.6 (2018-03-22) + +* chore: release 2.0.6 ([f3d406b](https://github.com/vkarpov15/kareem/commit/f3d406b)) +* fix(wrap): ensure fast path still wraps function in `nextTick()` for chaining ([7000494](https://github.com/vkarpov15/kareem/commit/7000494)), closes [Automattic/mongoose#6250](https://github.com/Automattic/mongoose/issues/6250) [dsanel/mongoose-delete#36](https://github.com/dsanel/mongoose-delete/issues/36) + + + + +## 2.0.5 (2018-02-22) + +* chore: release 2.0.5 ([3286612](https://github.com/vkarpov15/kareem/commit/3286612)) +* perf(createWrapper): don't create wrapper if there are no hooks ([5afc5b9](https://github.com/vkarpov15/kareem/commit/5afc5b9)), closes [Automattic/mongoose#6126](https://github.com/Automattic/mongoose/issues/6126) + + + + +## 2.0.4 (2018-02-08) + +* chore: release 2.0.4 ([2ab0293](https://github.com/vkarpov15/kareem/commit/2ab0293)) + + + + +## 2.0.3 (2018-02-01) + +* chore: release 2.0.3 ([3c1abe5](https://github.com/vkarpov15/kareem/commit/3c1abe5)) +* fix: use process.nextTick() re: Automattic/mongoose#6074 ([e5bfe33](https://github.com/vkarpov15/kareem/commit/e5bfe33)), closes [Automattic/mongoose#6074](https://github.com/Automattic/mongoose/issues/6074) + + + + +## 2.0.2 (2018-01-24) + +* chore: fix license ([a9d755c](https://github.com/vkarpov15/kareem/commit/a9d755c)), closes [#10](https://github.com/vkarpov15/kareem/issues/10) +* chore: release 2.0.2 ([fe87ab6](https://github.com/vkarpov15/kareem/commit/fe87ab6)) + + + + +## 2.0.1 (2018-01-09) + +* chore: release 2.0.1 with lockfile bump ([09c44fb](https://github.com/vkarpov15/kareem/commit/09c44fb)) + + + + +## 2.0.0 (2018-01-09) + +* chore: bump marked re: security ([cc564a9](https://github.com/vkarpov15/kareem/commit/cc564a9)) +* chore: release 2.0.0 ([f511d1c](https://github.com/vkarpov15/kareem/commit/f511d1c)) + + + + +## 2.0.0-rc5 (2017-12-23) + +* chore: fix build on node 4+5 ([6dac5a4](https://github.com/vkarpov15/kareem/commit/6dac5a4)) +* chore: fix built on node 4 + 5 again ([434ef0a](https://github.com/vkarpov15/kareem/commit/434ef0a)) +* chore: release 2.0.0-rc5 ([25a32ee](https://github.com/vkarpov15/kareem/commit/25a32ee)) + + + + +## 2.0.0-rc4 (2017-12-22) + +* chore: release 2.0.0-rc4 ([49fc083](https://github.com/vkarpov15/kareem/commit/49fc083)) +* BREAKING CHANGE: deduplicate when merging hooks re: Automattic/mongoose#2945 ([d458573](https://github.com/vkarpov15/kareem/commit/d458573)), closes [Automattic/mongoose#2945](https://github.com/Automattic/mongoose/issues/2945) + + + + +## 2.0.0-rc3 (2017-12-22) + +* chore: release 2.0.0-rc3 ([adaaa00](https://github.com/vkarpov15/kareem/commit/adaaa00)) +* feat: support returning promises from middleware functions ([05b4480](https://github.com/vkarpov15/kareem/commit/05b4480)), closes [Automattic/mongoose#3779](https://github.com/Automattic/mongoose/issues/3779) + + + + +## 2.0.0-rc2 (2017-12-21) + +* chore: release 2.0.0-rc2 ([76325fa](https://github.com/vkarpov15/kareem/commit/76325fa)) +* fix: ensure next() and done() run in next tick ([6c20684](https://github.com/vkarpov15/kareem/commit/6c20684)) + + + + +## 2.0.0-rc1 (2017-12-21) + +* chore: improve test coverage re: Automattic/mongoose#3232 ([7b45cf0](https://github.com/vkarpov15/kareem/commit/7b45cf0)), closes [Automattic/mongoose#3232](https://github.com/Automattic/mongoose/issues/3232) +* chore: release 2.0.0-rc1 ([9b83f52](https://github.com/vkarpov15/kareem/commit/9b83f52)) +* BREAKING CHANGE: report sync exceptions as errors, only allow calling next() and done() once ([674adcc](https://github.com/vkarpov15/kareem/commit/674adcc)), closes [Automattic/mongoose#3483](https://github.com/Automattic/mongoose/issues/3483) + + + + +## 2.0.0-rc0 (2017-12-17) + +* chore: release 2.0.0-rc0 ([16b44b5](https://github.com/vkarpov15/kareem/commit/16b44b5)) +* BREAKING CHANGE: drop support for node < 4 ([9cbb8c7](https://github.com/vkarpov15/kareem/commit/9cbb8c7)) +* BREAKING CHANGE: remove useLegacyPost and add several new features ([6dd8531](https://github.com/vkarpov15/kareem/commit/6dd8531)), closes [Automattic/mongoose#3232](https://github.com/Automattic/mongoose/issues/3232) + + + + +## 1.5.0 (2017-07-20) + +* chore: release 1.5.0 ([9c491a0](https://github.com/vkarpov15/kareem/commit/9c491a0)) +* fix: improve post error handlers results ([9928dd5](https://github.com/vkarpov15/kareem/commit/9928dd5)), closes [Automattic/mongoose#5466](https://github.com/Automattic/mongoose/issues/5466) + + + + +## 1.4.2 (2017-07-06) + +* chore: release 1.4.2 ([8d14ac5](https://github.com/vkarpov15/kareem/commit/8d14ac5)) +* fix: correct args re: Automattic/mongoose#5405 ([3f28ae6](https://github.com/vkarpov15/kareem/commit/3f28ae6)), closes [Automattic/mongoose#5405](https://github.com/Automattic/mongoose/issues/5405) + + + + +## 1.4.1 (2017-04-25) + +* chore: release 1.4.1 ([5ecf0c2](https://github.com/vkarpov15/kareem/commit/5ecf0c2)) +* fix: handle numAsyncPres with clone() ([c72e857](https://github.com/vkarpov15/kareem/commit/c72e857)), closes [#8](https://github.com/vkarpov15/kareem/issues/8) +* test: repro #8 ([9b4d6b2](https://github.com/vkarpov15/kareem/commit/9b4d6b2)), closes [#8](https://github.com/vkarpov15/kareem/issues/8) + + + + +## 1.4.0 (2017-04-19) + +* chore: release 1.4.0 ([101c5f5](https://github.com/vkarpov15/kareem/commit/101c5f5)) +* feat: add merge() function ([285325e](https://github.com/vkarpov15/kareem/commit/285325e)) + + + + +## 1.3.0 (2017-03-26) + +* chore: release 1.3.0 ([f3a9e50](https://github.com/vkarpov15/kareem/commit/f3a9e50)) +* feat: pass function args to execPre ([4dd466d](https://github.com/vkarpov15/kareem/commit/4dd466d)) + + + + +## 1.2.1 (2017-02-03) + +* chore: release 1.2.1 ([d97081f](https://github.com/vkarpov15/kareem/commit/d97081f)) +* fix: filter out _kareemIgnored args for error handlers re: Automattic/mongoose#4925 ([ddc7aeb](https://github.com/vkarpov15/kareem/commit/ddc7aeb)), closes [Automattic/mongoose#4925](https://github.com/Automattic/mongoose/issues/4925) +* fix: make error handlers handle errors in pre hooks ([af38033](https://github.com/vkarpov15/kareem/commit/af38033)), closes [Automattic/mongoose#4927](https://github.com/Automattic/mongoose/issues/4927) + + + + +## 1.2.0 (2017-01-02) + +* chore: release 1.2.0 ([033225c](https://github.com/vkarpov15/kareem/commit/033225c)) +* chore: upgrade deps ([f9e9a09](https://github.com/vkarpov15/kareem/commit/f9e9a09)) +* feat: add _kareemIgnore re: Automattic/mongoose#4836 ([7957771](https://github.com/vkarpov15/kareem/commit/7957771)), closes [Automattic/mongoose#4836](https://github.com/Automattic/mongoose/issues/4836) + + + + +## 1.1.5 (2016-12-13) + +* chore: release 1.1.5 ([1a9f684](https://github.com/vkarpov15/kareem/commit/1a9f684)) +* fix: correct field name ([04a0e9d](https://github.com/vkarpov15/kareem/commit/04a0e9d)) + + + + +## 1.1.4 (2016-12-09) + +* chore: release 1.1.4 ([ece401c](https://github.com/vkarpov15/kareem/commit/ece401c)) +* chore: run tests on node 6 ([e0cb1cb](https://github.com/vkarpov15/kareem/commit/e0cb1cb)) +* fix: only copy own properties in clone() ([dfe28ce](https://github.com/vkarpov15/kareem/commit/dfe28ce)), closes [#7](https://github.com/vkarpov15/kareem/issues/7) + + + + +## 1.1.3 (2016-06-27) + +* chore: release 1.1.3 ([87171c8](https://github.com/vkarpov15/kareem/commit/87171c8)) +* fix: couple more issues with arg processing ([c65f523](https://github.com/vkarpov15/kareem/commit/c65f523)) + + + + +## 1.1.2 (2016-06-27) + +* chore: release 1.1.2 ([8e102b6](https://github.com/vkarpov15/kareem/commit/8e102b6)) +* fix: add early return ([4feda4e](https://github.com/vkarpov15/kareem/commit/4feda4e)) + + + + +## 1.1.1 (2016-06-27) + +* chore: release 1.1.1 ([8bb3050](https://github.com/vkarpov15/kareem/commit/8bb3050)) +* fix: skip error handlers if no error ([0eb3a44](https://github.com/vkarpov15/kareem/commit/0eb3a44)) + + + + +## 1.1.0 (2016-05-11) + +* chore: release 1.1.0 ([85332d9](https://github.com/vkarpov15/kareem/commit/85332d9)) +* chore: test on node 4 and node 5 ([1faefa1](https://github.com/vkarpov15/kareem/commit/1faefa1)) +* 100% coverage again ([c9aee4e](https://github.com/vkarpov15/kareem/commit/c9aee4e)) +* add support for error post hooks ([d378113](https://github.com/vkarpov15/kareem/commit/d378113)) +* basic setup for sync hooks #4 ([55aa081](https://github.com/vkarpov15/kareem/commit/55aa081)), closes [#4](https://github.com/vkarpov15/kareem/issues/4) +* proof of concept for error handlers ([e4a07d9](https://github.com/vkarpov15/kareem/commit/e4a07d9)) +* refactor out handleWrapError helper ([b19af38](https://github.com/vkarpov15/kareem/commit/b19af38)) + + + + +## 1.0.1 (2015-05-10) + +* Fix #1 ([de60dc6](https://github.com/vkarpov15/kareem/commit/de60dc6)), closes [#1](https://github.com/vkarpov15/kareem/issues/1) +* release 1.0.1 ([6971088](https://github.com/vkarpov15/kareem/commit/6971088)) +* Run tests on iojs in travis ([adcd201](https://github.com/vkarpov15/kareem/commit/adcd201)) +* support legacy post hook behavior in wrap() ([23fa74c](https://github.com/vkarpov15/kareem/commit/23fa74c)) +* Use node 0.12 in travis ([834689d](https://github.com/vkarpov15/kareem/commit/834689d)) + + + + +## 1.0.0 (2015-01-28) + +* Tag 1.0.0 ([4c5a35a](https://github.com/vkarpov15/kareem/commit/4c5a35a)) + + + + +## 0.0.8 (2015-01-27) + +* Add clone function ([688bba7](https://github.com/vkarpov15/kareem/commit/688bba7)) +* Add jscs for style checking ([5c93149](https://github.com/vkarpov15/kareem/commit/5c93149)) +* Bump 0.0.8 ([03c0d2f](https://github.com/vkarpov15/kareem/commit/03c0d2f)) +* Fix jscs config, add gulp rules ([9989abf](https://github.com/vkarpov15/kareem/commit/9989abf)) +* fix Makefile typo ([1f7e61a](https://github.com/vkarpov15/kareem/commit/1f7e61a)) + + + + +## 0.0.7 (2015-01-04) + +* Bump 0.0.7 ([98ef173](https://github.com/vkarpov15/kareem/commit/98ef173)) +* fix LearnBoost/mongoose#2553 - use null instead of undefined for err ([9157b48](https://github.com/vkarpov15/kareem/commit/9157b48)), closes [LearnBoost/mongoose#2553](https://github.com/LearnBoost/mongoose/issues/2553) +* Regenerate docs ([2331cdf](https://github.com/vkarpov15/kareem/commit/2331cdf)) + + + + +## 0.0.6 (2015-01-01) + +* Update docs and bump 0.0.6 ([92c12a7](https://github.com/vkarpov15/kareem/commit/92c12a7)) + + + + +## 0.0.5 (2015-01-01) + +* Add coverage rule to Makefile ([825a91c](https://github.com/vkarpov15/kareem/commit/825a91c)) +* Add coveralls to README ([fb52369](https://github.com/vkarpov15/kareem/commit/fb52369)) +* Add coveralls to travis ([93f6f15](https://github.com/vkarpov15/kareem/commit/93f6f15)) +* Add createWrapper() function ([ea77741](https://github.com/vkarpov15/kareem/commit/ea77741)) +* Add istanbul code coverage ([6eceeef](https://github.com/vkarpov15/kareem/commit/6eceeef)) +* Add some more comments for examples ([c5b0c6f](https://github.com/vkarpov15/kareem/commit/c5b0c6f)) +* Add travis ([e6dcb06](https://github.com/vkarpov15/kareem/commit/e6dcb06)) +* Add travis badge to docs ([ad8c9b3](https://github.com/vkarpov15/kareem/commit/ad8c9b3)) +* Add wrap() tests, 100% coverage ([6945be4](https://github.com/vkarpov15/kareem/commit/6945be4)) +* Better test coverage for execPost ([d9ad539](https://github.com/vkarpov15/kareem/commit/d9ad539)) +* Bump 0.0.5 ([69875b1](https://github.com/vkarpov15/kareem/commit/69875b1)) +* Docs fix ([15b7098](https://github.com/vkarpov15/kareem/commit/15b7098)) +* Fix silly mistake in docs generation ([50373eb](https://github.com/vkarpov15/kareem/commit/50373eb)) +* Fix typo in readme ([fec4925](https://github.com/vkarpov15/kareem/commit/fec4925)) +* Linkify travis badge ([92b25fe](https://github.com/vkarpov15/kareem/commit/92b25fe)) +* Make travis run coverage ([747157b](https://github.com/vkarpov15/kareem/commit/747157b)) +* Move travis status badge ([d52e89b](https://github.com/vkarpov15/kareem/commit/d52e89b)) +* Quick fix for coverage ([50bbddb](https://github.com/vkarpov15/kareem/commit/50bbddb)) +* Typo fix ([adea794](https://github.com/vkarpov15/kareem/commit/adea794)) + + + + +## 0.0.4 (2014-12-13) + +* Bump 0.0.4, run docs generation ([51a15fe](https://github.com/vkarpov15/kareem/commit/51a15fe)) +* Use correct post parameters in wrap() ([9bb5da3](https://github.com/vkarpov15/kareem/commit/9bb5da3)) + + + + +## 0.0.3 (2014-12-12) + +* Add npm test script, fix small bug with args not getting passed through post ([49e3e68](https://github.com/vkarpov15/kareem/commit/49e3e68)) +* Bump 0.0.3 ([65621d8](https://github.com/vkarpov15/kareem/commit/65621d8)) +* Update readme ([901388b](https://github.com/vkarpov15/kareem/commit/901388b)) + + + + +## 0.0.2 (2014-12-12) + +* Add github repo and bump 0.0.2 ([59db8be](https://github.com/vkarpov15/kareem/commit/59db8be)) + + + + +## 0.0.1 (2014-12-12) + +* Add basic docs ([ad29ea4](https://github.com/vkarpov15/kareem/commit/ad29ea4)) +* Add pre hooks ([2ffc356](https://github.com/vkarpov15/kareem/commit/2ffc356)) +* Add wrap function ([68c540c](https://github.com/vkarpov15/kareem/commit/68c540c)) +* Bump to version 0.0.1 ([a4bfd68](https://github.com/vkarpov15/kareem/commit/a4bfd68)) +* Initial commit ([4002458](https://github.com/vkarpov15/kareem/commit/4002458)) +* Initial deposit ([98fc489](https://github.com/vkarpov15/kareem/commit/98fc489)) +* Post hooks ([395b67c](https://github.com/vkarpov15/kareem/commit/395b67c)) +* Some basic setup work ([82df75e](https://github.com/vkarpov15/kareem/commit/82df75e)) +* Support sync pre hooks ([1cc1b9f](https://github.com/vkarpov15/kareem/commit/1cc1b9f)) +* Update package.json description ([978da18](https://github.com/vkarpov15/kareem/commit/978da18)) + + + + +## 2.2.5 (2018-09-24) + + + + + +## 2.2.4 (2018-09-24) + + + + + +## 2.2.3 (2018-09-24) + +* fix(filter): copy async pres correctly with `filter()` ([1b1ed8a](https://github.com/vkarpov15/kareem/commit/1b1ed8a)), closes [Automattic/mongoose#3054](https://github.com/Automattic/mongoose/issues/3054) +* feat: add filter() function ([1f641f4](https://github.com/vkarpov15/kareem/commit/1f641f4)) +* feat: support storing options on pre and post hooks ([59220b9](https://github.com/vkarpov15/kareem/commit/59220b9)) + + + + +## 2.2.3 (2018-09-10) + +* chore: release 2.2.3 ([af653a3](https://github.com/vkarpov15/kareem/commit/af653a3)) + + + + +## 2.2.2 (2018-09-10) + +* chore: release 2.2.2 ([3f0144d](https://github.com/vkarpov15/kareem/commit/3f0144d)) +* fix: allow merge() to not clone ([e628d65](https://github.com/vkarpov15/kareem/commit/e628d65)) + + + + +## 2.2.1 (2018-06-05) + +* chore: release 2.2.1 ([4625a64](https://github.com/vkarpov15/kareem/commit/4625a64)) +* chore: remove lockfile from git ([7f3e4e6](https://github.com/vkarpov15/kareem/commit/7f3e4e6)) +* fix: handle numAsync correctly when merging ([fef8e7e](https://github.com/vkarpov15/kareem/commit/fef8e7e)) +* test: repro issue with not copying numAsync ([952d9db](https://github.com/vkarpov15/kareem/commit/952d9db)) + + + + +## 2.2.0 (2018-06-05) + +* chore: release 2.2.0 ([ff9ad03](https://github.com/vkarpov15/kareem/commit/ff9ad03)) +* fix: use maps instead of objects for _pres and _posts so `toString()` doesn't get reported as having ([55df303](https://github.com/vkarpov15/kareem/commit/55df303)), closes [Automattic/mongoose#6538](https://github.com/Automattic/mongoose/issues/6538) + + + + +## 2.1.0 (2018-05-16) + +* chore: release 2.1.0 ([ba5f1bc](https://github.com/vkarpov15/kareem/commit/ba5f1bc)) +* feat: add option to check wrapped function return value for promises ([c9d7dd1](https://github.com/vkarpov15/kareem/commit/c9d7dd1)) +* refactor: use const in wrap() ([0fc21f9](https://github.com/vkarpov15/kareem/commit/0fc21f9)) + + + + +## 2.0.7 (2018-04-28) + +* chore: release 2.0.7 ([0bf91e6](https://github.com/vkarpov15/kareem/commit/0bf91e6)) +* feat: add `hasHooks()` ([225f18d](https://github.com/vkarpov15/kareem/commit/225f18d)), closes [Automattic/mongoose#6385](https://github.com/Automattic/mongoose/issues/6385) + + + + +## 2.0.6 (2018-03-22) + +* chore: release 2.0.6 ([f3d406b](https://github.com/vkarpov15/kareem/commit/f3d406b)) +* fix(wrap): ensure fast path still wraps function in `nextTick()` for chaining ([7000494](https://github.com/vkarpov15/kareem/commit/7000494)), closes [Automattic/mongoose#6250](https://github.com/Automattic/mongoose/issues/6250) [dsanel/mongoose-delete#36](https://github.com/dsanel/mongoose-delete/issues/36) + + + + +## 2.0.5 (2018-02-22) + +* chore: release 2.0.5 ([3286612](https://github.com/vkarpov15/kareem/commit/3286612)) +* perf(createWrapper): don't create wrapper if there are no hooks ([5afc5b9](https://github.com/vkarpov15/kareem/commit/5afc5b9)), closes [Automattic/mongoose#6126](https://github.com/Automattic/mongoose/issues/6126) + + + + +## 2.0.4 (2018-02-08) + +* chore: release 2.0.4 ([2ab0293](https://github.com/vkarpov15/kareem/commit/2ab0293)) + + + + +## 2.0.3 (2018-02-01) + +* chore: release 2.0.3 ([3c1abe5](https://github.com/vkarpov15/kareem/commit/3c1abe5)) +* fix: use process.nextTick() re: Automattic/mongoose#6074 ([e5bfe33](https://github.com/vkarpov15/kareem/commit/e5bfe33)), closes [Automattic/mongoose#6074](https://github.com/Automattic/mongoose/issues/6074) + + + + +## 2.0.2 (2018-01-24) + +* chore: fix license ([a9d755c](https://github.com/vkarpov15/kareem/commit/a9d755c)), closes [#10](https://github.com/vkarpov15/kareem/issues/10) +* chore: release 2.0.2 ([fe87ab6](https://github.com/vkarpov15/kareem/commit/fe87ab6)) + + + + +## 2.0.1 (2018-01-09) + +* chore: release 2.0.1 with lockfile bump ([09c44fb](https://github.com/vkarpov15/kareem/commit/09c44fb)) + + + + +## 2.0.0 (2018-01-09) + +* chore: bump marked re: security ([cc564a9](https://github.com/vkarpov15/kareem/commit/cc564a9)) +* chore: release 2.0.0 ([f511d1c](https://github.com/vkarpov15/kareem/commit/f511d1c)) + + + + +## 2.0.0-rc5 (2017-12-23) + +* chore: fix build on node 4+5 ([6dac5a4](https://github.com/vkarpov15/kareem/commit/6dac5a4)) +* chore: fix built on node 4 + 5 again ([434ef0a](https://github.com/vkarpov15/kareem/commit/434ef0a)) +* chore: release 2.0.0-rc5 ([25a32ee](https://github.com/vkarpov15/kareem/commit/25a32ee)) + + + + +## 2.0.0-rc4 (2017-12-22) + +* chore: release 2.0.0-rc4 ([49fc083](https://github.com/vkarpov15/kareem/commit/49fc083)) +* BREAKING CHANGE: deduplicate when merging hooks re: Automattic/mongoose#2945 ([d458573](https://github.com/vkarpov15/kareem/commit/d458573)), closes [Automattic/mongoose#2945](https://github.com/Automattic/mongoose/issues/2945) + + + + +## 2.0.0-rc3 (2017-12-22) + +* chore: release 2.0.0-rc3 ([adaaa00](https://github.com/vkarpov15/kareem/commit/adaaa00)) +* feat: support returning promises from middleware functions ([05b4480](https://github.com/vkarpov15/kareem/commit/05b4480)), closes [Automattic/mongoose#3779](https://github.com/Automattic/mongoose/issues/3779) + + + + +## 2.0.0-rc2 (2017-12-21) + +* chore: release 2.0.0-rc2 ([76325fa](https://github.com/vkarpov15/kareem/commit/76325fa)) +* fix: ensure next() and done() run in next tick ([6c20684](https://github.com/vkarpov15/kareem/commit/6c20684)) + + + + +## 2.0.0-rc1 (2017-12-21) + +* chore: improve test coverage re: Automattic/mongoose#3232 ([7b45cf0](https://github.com/vkarpov15/kareem/commit/7b45cf0)), closes [Automattic/mongoose#3232](https://github.com/Automattic/mongoose/issues/3232) +* chore: release 2.0.0-rc1 ([9b83f52](https://github.com/vkarpov15/kareem/commit/9b83f52)) +* BREAKING CHANGE: report sync exceptions as errors, only allow calling next() and done() once ([674adcc](https://github.com/vkarpov15/kareem/commit/674adcc)), closes [Automattic/mongoose#3483](https://github.com/Automattic/mongoose/issues/3483) + + + + +## 2.0.0-rc0 (2017-12-17) + +* chore: release 2.0.0-rc0 ([16b44b5](https://github.com/vkarpov15/kareem/commit/16b44b5)) +* BREAKING CHANGE: drop support for node < 4 ([9cbb8c7](https://github.com/vkarpov15/kareem/commit/9cbb8c7)) +* BREAKING CHANGE: remove useLegacyPost and add several new features ([6dd8531](https://github.com/vkarpov15/kareem/commit/6dd8531)), closes [Automattic/mongoose#3232](https://github.com/Automattic/mongoose/issues/3232) + + + + +## 1.5.0 (2017-07-20) + +* chore: release 1.5.0 ([9c491a0](https://github.com/vkarpov15/kareem/commit/9c491a0)) +* fix: improve post error handlers results ([9928dd5](https://github.com/vkarpov15/kareem/commit/9928dd5)), closes [Automattic/mongoose#5466](https://github.com/Automattic/mongoose/issues/5466) + + + + +## 1.4.2 (2017-07-06) + +* chore: release 1.4.2 ([8d14ac5](https://github.com/vkarpov15/kareem/commit/8d14ac5)) +* fix: correct args re: Automattic/mongoose#5405 ([3f28ae6](https://github.com/vkarpov15/kareem/commit/3f28ae6)), closes [Automattic/mongoose#5405](https://github.com/Automattic/mongoose/issues/5405) + + + + +## 1.4.1 (2017-04-25) + +* chore: release 1.4.1 ([5ecf0c2](https://github.com/vkarpov15/kareem/commit/5ecf0c2)) +* fix: handle numAsyncPres with clone() ([c72e857](https://github.com/vkarpov15/kareem/commit/c72e857)), closes [#8](https://github.com/vkarpov15/kareem/issues/8) +* test: repro #8 ([9b4d6b2](https://github.com/vkarpov15/kareem/commit/9b4d6b2)), closes [#8](https://github.com/vkarpov15/kareem/issues/8) + + + + +## 1.4.0 (2017-04-19) + +* chore: release 1.4.0 ([101c5f5](https://github.com/vkarpov15/kareem/commit/101c5f5)) +* feat: add merge() function ([285325e](https://github.com/vkarpov15/kareem/commit/285325e)) + + + + +## 1.3.0 (2017-03-26) + +* chore: release 1.3.0 ([f3a9e50](https://github.com/vkarpov15/kareem/commit/f3a9e50)) +* feat: pass function args to execPre ([4dd466d](https://github.com/vkarpov15/kareem/commit/4dd466d)) + + + + +## 1.2.1 (2017-02-03) + +* chore: release 1.2.1 ([d97081f](https://github.com/vkarpov15/kareem/commit/d97081f)) +* fix: filter out _kareemIgnored args for error handlers re: Automattic/mongoose#4925 ([ddc7aeb](https://github.com/vkarpov15/kareem/commit/ddc7aeb)), closes [Automattic/mongoose#4925](https://github.com/Automattic/mongoose/issues/4925) +* fix: make error handlers handle errors in pre hooks ([af38033](https://github.com/vkarpov15/kareem/commit/af38033)), closes [Automattic/mongoose#4927](https://github.com/Automattic/mongoose/issues/4927) + + + + +## 1.2.0 (2017-01-02) + +* chore: release 1.2.0 ([033225c](https://github.com/vkarpov15/kareem/commit/033225c)) +* chore: upgrade deps ([f9e9a09](https://github.com/vkarpov15/kareem/commit/f9e9a09)) +* feat: add _kareemIgnore re: Automattic/mongoose#4836 ([7957771](https://github.com/vkarpov15/kareem/commit/7957771)), closes [Automattic/mongoose#4836](https://github.com/Automattic/mongoose/issues/4836) + + + + +## 1.1.5 (2016-12-13) + +* chore: release 1.1.5 ([1a9f684](https://github.com/vkarpov15/kareem/commit/1a9f684)) +* fix: correct field name ([04a0e9d](https://github.com/vkarpov15/kareem/commit/04a0e9d)) + + + + +## 1.1.4 (2016-12-09) + +* chore: release 1.1.4 ([ece401c](https://github.com/vkarpov15/kareem/commit/ece401c)) +* chore: run tests on node 6 ([e0cb1cb](https://github.com/vkarpov15/kareem/commit/e0cb1cb)) +* fix: only copy own properties in clone() ([dfe28ce](https://github.com/vkarpov15/kareem/commit/dfe28ce)), closes [#7](https://github.com/vkarpov15/kareem/issues/7) + + + + +## 1.1.3 (2016-06-27) + +* chore: release 1.1.3 ([87171c8](https://github.com/vkarpov15/kareem/commit/87171c8)) +* fix: couple more issues with arg processing ([c65f523](https://github.com/vkarpov15/kareem/commit/c65f523)) + + + + +## 1.1.2 (2016-06-27) + +* chore: release 1.1.2 ([8e102b6](https://github.com/vkarpov15/kareem/commit/8e102b6)) +* fix: add early return ([4feda4e](https://github.com/vkarpov15/kareem/commit/4feda4e)) + + + + +## 1.1.1 (2016-06-27) + +* chore: release 1.1.1 ([8bb3050](https://github.com/vkarpov15/kareem/commit/8bb3050)) +* fix: skip error handlers if no error ([0eb3a44](https://github.com/vkarpov15/kareem/commit/0eb3a44)) + + + + +## 1.1.0 (2016-05-11) + +* chore: release 1.1.0 ([85332d9](https://github.com/vkarpov15/kareem/commit/85332d9)) +* chore: test on node 4 and node 5 ([1faefa1](https://github.com/vkarpov15/kareem/commit/1faefa1)) +* 100% coverage again ([c9aee4e](https://github.com/vkarpov15/kareem/commit/c9aee4e)) +* add support for error post hooks ([d378113](https://github.com/vkarpov15/kareem/commit/d378113)) +* basic setup for sync hooks #4 ([55aa081](https://github.com/vkarpov15/kareem/commit/55aa081)), closes [#4](https://github.com/vkarpov15/kareem/issues/4) +* proof of concept for error handlers ([e4a07d9](https://github.com/vkarpov15/kareem/commit/e4a07d9)) +* refactor out handleWrapError helper ([b19af38](https://github.com/vkarpov15/kareem/commit/b19af38)) + + + + +## 1.0.1 (2015-05-10) + +* Fix #1 ([de60dc6](https://github.com/vkarpov15/kareem/commit/de60dc6)), closes [#1](https://github.com/vkarpov15/kareem/issues/1) +* release 1.0.1 ([6971088](https://github.com/vkarpov15/kareem/commit/6971088)) +* Run tests on iojs in travis ([adcd201](https://github.com/vkarpov15/kareem/commit/adcd201)) +* support legacy post hook behavior in wrap() ([23fa74c](https://github.com/vkarpov15/kareem/commit/23fa74c)) +* Use node 0.12 in travis ([834689d](https://github.com/vkarpov15/kareem/commit/834689d)) + + + + +## 1.0.0 (2015-01-28) + +* Tag 1.0.0 ([4c5a35a](https://github.com/vkarpov15/kareem/commit/4c5a35a)) + + + + +## 0.0.8 (2015-01-27) + +* Add clone function ([688bba7](https://github.com/vkarpov15/kareem/commit/688bba7)) +* Add jscs for style checking ([5c93149](https://github.com/vkarpov15/kareem/commit/5c93149)) +* Bump 0.0.8 ([03c0d2f](https://github.com/vkarpov15/kareem/commit/03c0d2f)) +* Fix jscs config, add gulp rules ([9989abf](https://github.com/vkarpov15/kareem/commit/9989abf)) +* fix Makefile typo ([1f7e61a](https://github.com/vkarpov15/kareem/commit/1f7e61a)) + + + + +## 0.0.7 (2015-01-04) + +* Bump 0.0.7 ([98ef173](https://github.com/vkarpov15/kareem/commit/98ef173)) +* fix LearnBoost/mongoose#2553 - use null instead of undefined for err ([9157b48](https://github.com/vkarpov15/kareem/commit/9157b48)), closes [LearnBoost/mongoose#2553](https://github.com/LearnBoost/mongoose/issues/2553) +* Regenerate docs ([2331cdf](https://github.com/vkarpov15/kareem/commit/2331cdf)) + + + + +## 0.0.6 (2015-01-01) + +* Update docs and bump 0.0.6 ([92c12a7](https://github.com/vkarpov15/kareem/commit/92c12a7)) + + + + +## 0.0.5 (2015-01-01) + +* Add coverage rule to Makefile ([825a91c](https://github.com/vkarpov15/kareem/commit/825a91c)) +* Add coveralls to README ([fb52369](https://github.com/vkarpov15/kareem/commit/fb52369)) +* Add coveralls to travis ([93f6f15](https://github.com/vkarpov15/kareem/commit/93f6f15)) +* Add createWrapper() function ([ea77741](https://github.com/vkarpov15/kareem/commit/ea77741)) +* Add istanbul code coverage ([6eceeef](https://github.com/vkarpov15/kareem/commit/6eceeef)) +* Add some more comments for examples ([c5b0c6f](https://github.com/vkarpov15/kareem/commit/c5b0c6f)) +* Add travis ([e6dcb06](https://github.com/vkarpov15/kareem/commit/e6dcb06)) +* Add travis badge to docs ([ad8c9b3](https://github.com/vkarpov15/kareem/commit/ad8c9b3)) +* Add wrap() tests, 100% coverage ([6945be4](https://github.com/vkarpov15/kareem/commit/6945be4)) +* Better test coverage for execPost ([d9ad539](https://github.com/vkarpov15/kareem/commit/d9ad539)) +* Bump 0.0.5 ([69875b1](https://github.com/vkarpov15/kareem/commit/69875b1)) +* Docs fix ([15b7098](https://github.com/vkarpov15/kareem/commit/15b7098)) +* Fix silly mistake in docs generation ([50373eb](https://github.com/vkarpov15/kareem/commit/50373eb)) +* Fix typo in readme ([fec4925](https://github.com/vkarpov15/kareem/commit/fec4925)) +* Linkify travis badge ([92b25fe](https://github.com/vkarpov15/kareem/commit/92b25fe)) +* Make travis run coverage ([747157b](https://github.com/vkarpov15/kareem/commit/747157b)) +* Move travis status badge ([d52e89b](https://github.com/vkarpov15/kareem/commit/d52e89b)) +* Quick fix for coverage ([50bbddb](https://github.com/vkarpov15/kareem/commit/50bbddb)) +* Typo fix ([adea794](https://github.com/vkarpov15/kareem/commit/adea794)) + + + + +## 0.0.4 (2014-12-13) + +* Bump 0.0.4, run docs generation ([51a15fe](https://github.com/vkarpov15/kareem/commit/51a15fe)) +* Use correct post parameters in wrap() ([9bb5da3](https://github.com/vkarpov15/kareem/commit/9bb5da3)) + + + + +## 0.0.3 (2014-12-12) + +* Add npm test script, fix small bug with args not getting passed through post ([49e3e68](https://github.com/vkarpov15/kareem/commit/49e3e68)) +* Bump 0.0.3 ([65621d8](https://github.com/vkarpov15/kareem/commit/65621d8)) +* Update readme ([901388b](https://github.com/vkarpov15/kareem/commit/901388b)) + + + + +## 0.0.2 (2014-12-12) + +* Add github repo and bump 0.0.2 ([59db8be](https://github.com/vkarpov15/kareem/commit/59db8be)) + + + + +## 0.0.1 (2014-12-12) + +* Add basic docs ([ad29ea4](https://github.com/vkarpov15/kareem/commit/ad29ea4)) +* Add pre hooks ([2ffc356](https://github.com/vkarpov15/kareem/commit/2ffc356)) +* Add wrap function ([68c540c](https://github.com/vkarpov15/kareem/commit/68c540c)) +* Bump to version 0.0.1 ([a4bfd68](https://github.com/vkarpov15/kareem/commit/a4bfd68)) +* Initial commit ([4002458](https://github.com/vkarpov15/kareem/commit/4002458)) +* Initial deposit ([98fc489](https://github.com/vkarpov15/kareem/commit/98fc489)) +* Post hooks ([395b67c](https://github.com/vkarpov15/kareem/commit/395b67c)) +* Some basic setup work ([82df75e](https://github.com/vkarpov15/kareem/commit/82df75e)) +* Support sync pre hooks ([1cc1b9f](https://github.com/vkarpov15/kareem/commit/1cc1b9f)) +* Update package.json description ([978da18](https://github.com/vkarpov15/kareem/commit/978da18)) diff --git a/node_modules/kareem/LICENSE b/node_modules/kareem/LICENSE new file mode 100644 index 000000000..e06d20818 --- /dev/null +++ b/node_modules/kareem/LICENSE @@ -0,0 +1,202 @@ +Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright {yyyy} {name of copyright owner} + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + diff --git a/node_modules/kareem/Makefile b/node_modules/kareem/Makefile new file mode 100644 index 000000000..f71ba9008 --- /dev/null +++ b/node_modules/kareem/Makefile @@ -0,0 +1,5 @@ +docs: + node ./docs.js + +coverage: + ./node_modules/istanbul/lib/cli.js cover ./node_modules/mocha/bin/_mocha -- -R spec ./test/* diff --git a/node_modules/kareem/README.md b/node_modules/kareem/README.md new file mode 100644 index 000000000..aaf84717b --- /dev/null +++ b/node_modules/kareem/README.md @@ -0,0 +1,420 @@ +# kareem + + [![Build Status](https://travis-ci.org/vkarpov15/kareem.svg?branch=master)](https://travis-ci.org/vkarpov15/kareem) + [![Coverage Status](https://img.shields.io/coveralls/vkarpov15/kareem.svg)](https://coveralls.io/r/vkarpov15/kareem) + +Re-imagined take on the [hooks](http://npmjs.org/package/hooks) module, meant to offer additional flexibility in allowing you to execute hooks whenever necessary, as opposed to simply wrapping a single function. + +Named for the NBA's all-time leading scorer Kareem Abdul-Jabbar, known for his mastery of the [hook shot](http://en.wikipedia.org/wiki/Kareem_Abdul-Jabbar#Skyhook) + + + +# API + +## pre hooks + +Much like [hooks](https://npmjs.org/package/hooks), kareem lets you define +pre and post hooks: pre hooks are called before a given function executes. +Unlike hooks, kareem stores hooks and other internal state in a separate +object, rather than relying on inheritance. Furthermore, kareem exposes +an `execPre()` function that allows you to execute your pre hooks when +appropriate, giving you more fine-grained control over your function hooks. + + +#### It runs without any hooks specified + +```javascript +hooks.execPre('cook', null, function() { + // ... +}); +``` + +#### It runs basic serial pre hooks + +pre hook functions take one parameter, a "done" function that you execute +when your pre hook is finished. + + +```javascript +var count = 0; + +hooks.pre('cook', function(done) { + ++count; + done(); +}); + +hooks.execPre('cook', null, function() { + assert.equal(1, count); +}); +``` + +#### It can run multipe pre hooks + +```javascript +var count1 = 0; +var count2 = 0; + +hooks.pre('cook', function(done) { + ++count1; + done(); +}); + +hooks.pre('cook', function(done) { + ++count2; + done(); +}); + +hooks.execPre('cook', null, function() { + assert.equal(1, count1); + assert.equal(1, count2); +}); +``` + +#### It can run fully synchronous pre hooks + +If your pre hook function takes no parameters, its assumed to be +fully synchronous. + + +```javascript +var count1 = 0; +var count2 = 0; + +hooks.pre('cook', function() { + ++count1; +}); + +hooks.pre('cook', function() { + ++count2; +}); + +hooks.execPre('cook', null, function(error) { + assert.equal(null, error); + assert.equal(1, count1); + assert.equal(1, count2); +}); +``` + +#### It properly attaches context to pre hooks + +Pre save hook functions are bound to the second parameter to `execPre()` + + +```javascript +hooks.pre('cook', function(done) { + this.bacon = 3; + done(); +}); + +hooks.pre('cook', function(done) { + this.eggs = 4; + done(); +}); + +var obj = { bacon: 0, eggs: 0 }; + +// In the pre hooks, `this` will refer to `obj` +hooks.execPre('cook', obj, function(error) { + assert.equal(null, error); + assert.equal(3, obj.bacon); + assert.equal(4, obj.eggs); +}); +``` + +#### It can execute parallel (async) pre hooks + +Like the hooks module, you can declare "async" pre hooks - these take two +parameters, the functions `next()` and `done()`. `next()` passes control to +the next pre hook, but the underlying function won't be called until all +async pre hooks have called `done()`. + + +```javascript +hooks.pre('cook', true, function(next, done) { + this.bacon = 3; + next(); + setTimeout(function() { + done(); + }, 5); +}); + +hooks.pre('cook', true, function(next, done) { + next(); + var _this = this; + setTimeout(function() { + _this.eggs = 4; + done(); + }, 10); +}); + +hooks.pre('cook', function(next) { + this.waffles = false; + next(); +}); + +var obj = { bacon: 0, eggs: 0 }; + +hooks.execPre('cook', obj, function() { + assert.equal(3, obj.bacon); + assert.equal(4, obj.eggs); + assert.equal(false, obj.waffles); +}); +``` + +#### It supports returning a promise + +You can also return a promise from your pre hooks instead of calling +`next()`. When the returned promise resolves, kareem will kick off the +next middleware. + + +```javascript +hooks.pre('cook', function() { + return new Promise(resolve => { + setTimeout(() => { + this.bacon = 3; + resolve(); + }, 100); + }); +}); + +var obj = { bacon: 0 }; + +hooks.execPre('cook', obj, function() { + assert.equal(3, obj.bacon); +}); +``` + +## post hooks + +acquit:ignore:end + +#### It runs without any hooks specified + +```javascript +hooks.execPost('cook', null, [1], function(error, eggs) { + assert.ifError(error); + assert.equal(1, eggs); + done(); +}); +``` + +#### It executes with parameters passed in + +```javascript +hooks.post('cook', function(eggs, bacon, callback) { + assert.equal(1, eggs); + assert.equal(2, bacon); + callback(); +}); + +hooks.execPost('cook', null, [1, 2], function(error, eggs, bacon) { + assert.ifError(error); + assert.equal(1, eggs); + assert.equal(2, bacon); +}); +``` + +#### It can use synchronous post hooks + +```javascript +var execed = {}; + +hooks.post('cook', function(eggs, bacon) { + execed.first = true; + assert.equal(1, eggs); + assert.equal(2, bacon); +}); + +hooks.post('cook', function(eggs, bacon, callback) { + execed.second = true; + assert.equal(1, eggs); + assert.equal(2, bacon); + callback(); +}); + +hooks.execPost('cook', null, [1, 2], function(error, eggs, bacon) { + assert.ifError(error); + assert.equal(2, Object.keys(execed).length); + assert.ok(execed.first); + assert.ok(execed.second); + assert.equal(1, eggs); + assert.equal(2, bacon); +}); +``` + +#### It supports returning a promise + +You can also return a promise from your post hooks instead of calling +`next()`. When the returned promise resolves, kareem will kick off the +next middleware. + + +```javascript +hooks.post('cook', function(bacon) { + return new Promise(resolve => { + setTimeout(() => { + this.bacon = 3; + resolve(); + }, 100); + }); +}); + +var obj = { bacon: 0 }; + +hooks.execPost('cook', obj, obj, function() { + assert.equal(obj.bacon, 3); +}); +``` + +## wrap() + +acquit:ignore:end + +#### It wraps pre and post calls into one call + +```javascript +hooks.pre('cook', true, function(next, done) { + this.bacon = 3; + next(); + setTimeout(function() { + done(); + }, 5); +}); + +hooks.pre('cook', true, function(next, done) { + next(); + var _this = this; + setTimeout(function() { + _this.eggs = 4; + done(); + }, 10); +}); + +hooks.pre('cook', function(next) { + this.waffles = false; + next(); +}); + +hooks.post('cook', function(obj) { + obj.tofu = 'no'; +}); + +var obj = { bacon: 0, eggs: 0 }; + +var args = [obj]; +args.push(function(error, result) { + assert.ifError(error); + assert.equal(null, error); + assert.equal(3, obj.bacon); + assert.equal(4, obj.eggs); + assert.equal(false, obj.waffles); + assert.equal('no', obj.tofu); + + assert.equal(obj, result); +}); + +hooks.wrap( + 'cook', + function(o, callback) { + assert.equal(3, obj.bacon); + assert.equal(4, obj.eggs); + assert.equal(false, obj.waffles); + assert.equal(undefined, obj.tofu); + callback(null, o); + }, + obj, + args); +``` + +## createWrapper() + +#### It wraps wrap() into a callable function + +```javascript +hooks.pre('cook', true, function(next, done) { + this.bacon = 3; + next(); + setTimeout(function() { + done(); + }, 5); +}); + +hooks.pre('cook', true, function(next, done) { + next(); + var _this = this; + setTimeout(function() { + _this.eggs = 4; + done(); + }, 10); +}); + +hooks.pre('cook', function(next) { + this.waffles = false; + next(); +}); + +hooks.post('cook', function(obj) { + obj.tofu = 'no'; +}); + +var obj = { bacon: 0, eggs: 0 }; + +var cook = hooks.createWrapper( + 'cook', + function(o, callback) { + assert.equal(3, obj.bacon); + assert.equal(4, obj.eggs); + assert.equal(false, obj.waffles); + assert.equal(undefined, obj.tofu); + callback(null, o); + }, + obj); + +cook(obj, function(error, result) { + assert.ifError(error); + assert.equal(3, obj.bacon); + assert.equal(4, obj.eggs); + assert.equal(false, obj.waffles); + assert.equal('no', obj.tofu); + + assert.equal(obj, result); +}); +``` + +## clone() + +acquit:ignore:end + +#### It clones a Kareem object + +```javascript +var k1 = new Kareem(); +k1.pre('cook', function() {}); +k1.post('cook', function() {}); + +var k2 = k1.clone(); +assert.deepEqual(Array.from(k2._pres.keys()), ['cook']); +assert.deepEqual(Array.from(k2._posts.keys()), ['cook']); +``` + +## merge() + +#### It pulls hooks from another Kareem object + +```javascript +var k1 = new Kareem(); +var test1 = function() {}; +k1.pre('cook', test1); +k1.post('cook', function() {}); + +var k2 = new Kareem(); +var test2 = function() {}; +k2.pre('cook', test2); +var k3 = k2.merge(k1); +assert.equal(k3._pres.get('cook').length, 2); +assert.equal(k3._pres.get('cook')[0].fn, test2); +assert.equal(k3._pres.get('cook')[1].fn, test1); +assert.equal(k3._posts.get('cook').length, 1); +``` + diff --git a/node_modules/kareem/docs.js b/node_modules/kareem/docs.js new file mode 100644 index 000000000..cf5bda2c3 --- /dev/null +++ b/node_modules/kareem/docs.js @@ -0,0 +1,41 @@ +'use strict'; + +var acquit = require('acquit'); + +require('acquit-ignore')(); + +var content = require('fs').readFileSync('./test/examples.test.js').toString(); +var blocks = acquit.parse(content); + +var mdOutput = + '# kareem\n\n' + + ' [![Build Status](https://travis-ci.org/vkarpov15/kareem.svg?branch=master)](https://travis-ci.org/vkarpov15/kareem)\n' + + ' [![Coverage Status](https://img.shields.io/coveralls/vkarpov15/kareem.svg)](https://coveralls.io/r/vkarpov15/kareem)\n\n' + + 'Re-imagined take on the [hooks](http://npmjs.org/package/hooks) module, ' + + 'meant to offer additional flexibility in allowing you to execute hooks ' + + 'whenever necessary, as opposed to simply wrapping a single function.\n\n' + + 'Named for the NBA\'s all-time leading scorer Kareem Abdul-Jabbar, known ' + + 'for his mastery of the [hook shot](http://en.wikipedia.org/wiki/Kareem_Abdul-Jabbar#Skyhook)\n\n' + + '\n\n' + + '# API\n\n'; + +for (var i = 0; i < blocks.length; ++i) { + var describe = blocks[i]; + mdOutput += '## ' + describe.contents + '\n\n'; + mdOutput += describe.comments[0] ? + acquit.trimEachLine(describe.comments[0]) + '\n\n' : + ''; + + for (var j = 0; j < describe.blocks.length; ++j) { + var it = describe.blocks[j]; + mdOutput += '#### It ' + it.contents + '\n\n'; + mdOutput += it.comments[0] ? + acquit.trimEachLine(it.comments[0]) + '\n\n' : + ''; + mdOutput += '```javascript\n'; + mdOutput += it.code + '\n'; + mdOutput += '```\n\n'; + } +} + +require('fs').writeFileSync('README.md', mdOutput); diff --git a/node_modules/kareem/index.js b/node_modules/kareem/index.js new file mode 100644 index 000000000..b10aaf9a1 --- /dev/null +++ b/node_modules/kareem/index.js @@ -0,0 +1,563 @@ +'use strict'; + +function Kareem() { + this._pres = new Map(); + this._posts = new Map(); +} + +Kareem.skipWrappedFunction = function skipWrappedFunction() { + if (!(this instanceof Kareem.skipWrappedFunction)) { + return new Kareem.skipWrappedFunction(...arguments); + } + + this.args = [...arguments]; +}; + +Kareem.overwriteResult = function overwriteResult() { + if (!(this instanceof Kareem.overwriteResult)) { + return new Kareem.overwriteResult(...arguments); + } + + this.args = [...arguments]; +}; + +Kareem.prototype.execPre = function(name, context, args, callback) { + if (arguments.length === 3) { + callback = args; + args = []; + } + var pres = this._pres.get(name) || []; + var numPres = pres.length; + var numAsyncPres = pres.numAsync || 0; + var currentPre = 0; + var asyncPresLeft = numAsyncPres; + var done = false; + var $args = args; + var shouldSkipWrappedFunction = null; + + if (!numPres) { + return nextTick(function() { + callback(null); + }); + } + + var next = function() { + if (currentPre >= numPres) { + return; + } + var pre = pres[currentPre]; + + if (pre.isAsync) { + var args = [ + decorateNextFn(_next), + decorateNextFn(function(error) { + if (error) { + if (done) { + return; + } + if (error instanceof Kareem.skipWrappedFunction) { + shouldSkipWrappedFunction = error; + } else { + done = true; + return callback(error); + } + } + if (--asyncPresLeft === 0 && currentPre >= numPres) { + return callback(shouldSkipWrappedFunction); + } + }) + ]; + + callMiddlewareFunction(pre.fn, context, args, args[0]); + } else if (pre.fn.length > 0) { + var args = [decorateNextFn(_next)]; + var _args = arguments.length >= 2 ? arguments : [null].concat($args); + for (var i = 1; i < _args.length; ++i) { + args.push(_args[i]); + } + + callMiddlewareFunction(pre.fn, context, args, args[0]); + } else { + let maybePromiseLike = null; + try { + maybePromiseLike = pre.fn.call(context); + } catch (err) { + if (err != null) { + return callback(err); + } + } + + if (isPromiseLike(maybePromiseLike)) { + maybePromiseLike.then(() => _next(), err => _next(err)); + } else { + if (++currentPre >= numPres) { + if (asyncPresLeft > 0) { + // Leave parallel hooks to run + return; + } else { + return nextTick(function() { + callback(shouldSkipWrappedFunction); + }); + } + } + next(); + } + } + }; + + next.apply(null, [null].concat(args)); + + function _next(error) { + if (error) { + if (done) { + return; + } + if (error instanceof Kareem.skipWrappedFunction) { + shouldSkipWrappedFunction = error; + } else { + done = true; + return callback(error); + } + } + + if (++currentPre >= numPres) { + if (asyncPresLeft > 0) { + // Leave parallel hooks to run + return; + } else { + return callback(shouldSkipWrappedFunction); + } + } + + next.apply(context, arguments); + } +}; + +Kareem.prototype.execPreSync = function(name, context, args) { + var pres = this._pres.get(name) || []; + var numPres = pres.length; + + for (var i = 0; i < numPres; ++i) { + pres[i].fn.apply(context, args || []); + } +}; + +Kareem.prototype.execPost = function(name, context, args, options, callback) { + if (arguments.length < 5) { + callback = options; + options = null; + } + var posts = this._posts.get(name) || []; + var numPosts = posts.length; + var currentPost = 0; + + var firstError = null; + if (options && options.error) { + firstError = options.error; + } + + if (!numPosts) { + return nextTick(function() { + callback.apply(null, [firstError].concat(args)); + }); + } + + var next = function() { + var post = posts[currentPost].fn; + var numArgs = 0; + var argLength = args.length; + var newArgs = []; + for (var i = 0; i < argLength; ++i) { + numArgs += args[i] && args[i]._kareemIgnore ? 0 : 1; + if (!args[i] || !args[i]._kareemIgnore) { + newArgs.push(args[i]); + } + } + + if (firstError) { + if (post.length === numArgs + 2) { + const _cb = decorateNextFn(function(error) { + if (error) { + if (error instanceof Kareem.overwriteResult) { + args = error.args; + if (++currentPost >= numPosts) { + return callback.call(null, firstError); + } + return next(); + } + firstError = error; + } + if (++currentPost >= numPosts) { + return callback.call(null, firstError); + } + next(); + }); + + callMiddlewareFunction(post, context, + [firstError].concat(newArgs).concat([_cb]), _cb); + } else { + if (++currentPost >= numPosts) { + return callback.call(null, firstError); + } + next(); + } + } else { + const _cb = decorateNextFn(function(error) { + if (error) { + if (error instanceof Kareem.overwriteResult) { + args = error.args; + if (++currentPost >= numPosts) { + return callback.apply(null, [null].concat(args)); + } + return next(); + } + firstError = error; + return next(); + } + + if (++currentPost >= numPosts) { + return callback.apply(null, [null].concat(args)); + } + + next(); + }); + + if (post.length === numArgs + 2) { + // Skip error handlers if no error + if (++currentPost >= numPosts) { + return callback.apply(null, [null].concat(args)); + } + return next(); + } + if (post.length === numArgs + 1) { + callMiddlewareFunction(post, context, newArgs.concat([_cb]), _cb); + } else { + let error; + let maybePromiseLike; + try { + maybePromiseLike = post.apply(context, newArgs); + } catch (err) { + error = err; + firstError = err; + } + + if (isPromiseLike(maybePromiseLike)) { + return maybePromiseLike.then( + (res) => { + _cb(res instanceof Kareem.overwriteResult ? res : null); + }, + err => _cb(err) + ); + } + + if (maybePromiseLike instanceof Kareem.overwriteResult) { + args = maybePromiseLike.args; + } + + if (++currentPost >= numPosts) { + return callback.apply(null, [error].concat(args)); + } + + next(); + } + } + }; + + next(); +}; + +Kareem.prototype.execPostSync = function(name, context, args) { + const posts = this._posts.get(name) || []; + const numPosts = posts.length; + + for (let i = 0; i < numPosts; ++i) { + const res = posts[i].fn.apply(context, args || []); + if (res instanceof Kareem.overwriteResult) { + args = res.args; + } + } + + return args; +}; + +Kareem.prototype.createWrapperSync = function(name, fn) { + var kareem = this; + return function syncWrapper() { + kareem.execPreSync(name, this, arguments); + + var toReturn = fn.apply(this, arguments); + + const result = kareem.execPostSync(name, this, [toReturn]); + + return result[0]; + }; +}; + +function _handleWrapError(instance, error, name, context, args, options, callback) { + if (options.useErrorHandlers) { + return instance.execPost(name, context, args, { error: error }, function(error) { + return typeof callback === 'function' && callback(error); + }); + } else { + return typeof callback === 'function' && callback(error); + } +} + +Kareem.prototype.wrap = function(name, fn, context, args, options) { + const lastArg = (args.length > 0 ? args[args.length - 1] : null); + let argsWithoutCb = Array.from(args); + typeof lastArg === 'function' && argsWithoutCb.pop(); + const _this = this; + + options = options || {}; + const checkForPromise = options.checkForPromise; + + this.execPre(name, context, args, function(error) { + if (error && !(error instanceof Kareem.skipWrappedFunction)) { + const numCallbackParams = options.numCallbackParams || 0; + const errorArgs = options.contextParameter ? [context] : []; + for (var i = errorArgs.length; i < numCallbackParams; ++i) { + errorArgs.push(null); + } + return _handleWrapError(_this, error, name, context, errorArgs, + options, lastArg); + } + + const numParameters = fn.length; + let ret; + + if (error instanceof Kareem.skipWrappedFunction) { + ret = error.args[0]; + return _cb(null, ...error.args); + } else { + try { + ret = fn.apply(context, argsWithoutCb.concat(_cb)); + } catch (err) { + return _cb(err); + } + } + + if (checkForPromise) { + if (isPromiseLike(ret)) { + // Thenable, use it + return ret.then( + res => _cb(null, res), + err => _cb(err) + ); + } + + // If `fn()` doesn't have a callback argument and doesn't return a + // promise, assume it is sync + if (numParameters < argsWithoutCb.length + 1) { + return _cb(null, ret); + } + } + + function _cb() { + const argsWithoutError = Array.from(arguments); + argsWithoutError.shift(); + if (options.nullResultByDefault && argsWithoutError.length === 0) { + argsWithoutError.push(null); + } + if (arguments[0]) { + // Assume error + return _handleWrapError(_this, arguments[0], name, context, + argsWithoutError, options, lastArg); + } else { + _this.execPost(name, context, argsWithoutError, function() { + if (lastArg === null) { + return; + } + arguments[0] + ? lastArg(arguments[0]) + : lastArg.apply(context, arguments); + }); + } + } + }); +}; + +Kareem.prototype.filter = function(fn) { + const clone = this.clone(); + + const pres = Array.from(clone._pres.keys()); + for (const name of pres) { + const hooks = this._pres.get(name). + map(h => Object.assign({}, h, { name: name })). + filter(fn); + + if (hooks.length === 0) { + clone._pres.delete(name); + continue; + } + + hooks.numAsync = hooks.filter(h => h.isAsync).length; + + clone._pres.set(name, hooks); + } + + const posts = Array.from(clone._posts.keys()); + for (const name of posts) { + const hooks = this._posts.get(name). + map(h => Object.assign({}, h, { name: name })). + filter(fn); + + if (hooks.length === 0) { + clone._posts.delete(name); + continue; + } + + clone._posts.set(name, hooks); + } + + return clone; +}; + +Kareem.prototype.hasHooks = function(name) { + return this._pres.has(name) || this._posts.has(name); +}; + +Kareem.prototype.createWrapper = function(name, fn, context, options) { + var _this = this; + if (!this.hasHooks(name)) { + // Fast path: if there's no hooks for this function, just return the + // function wrapped in a nextTick() + return function() { + nextTick(() => fn.apply(this, arguments)); + }; + } + return function() { + var _context = context || this; + _this.wrap(name, fn, _context, Array.from(arguments), options); + }; +}; + +Kareem.prototype.pre = function(name, isAsync, fn, error, unshift) { + let options = {}; + if (typeof isAsync === 'object' && isAsync !== null) { + options = isAsync; + isAsync = options.isAsync; + } else if (typeof arguments[1] !== 'boolean') { + fn = isAsync; + isAsync = false; + } + + const pres = this._pres.get(name) || []; + this._pres.set(name, pres); + + if (isAsync) { + pres.numAsync = pres.numAsync || 0; + ++pres.numAsync; + } + + if (typeof fn !== 'function') { + throw new Error('pre() requires a function, got "' + typeof fn + '"'); + } + + if (unshift) { + pres.unshift(Object.assign({}, options, { fn: fn, isAsync: isAsync })); + } else { + pres.push(Object.assign({}, options, { fn: fn, isAsync: isAsync })); + } + + return this; +}; + +Kareem.prototype.post = function(name, options, fn, unshift) { + const hooks = this._posts.get(name) || []; + + if (typeof options === 'function') { + unshift = !!fn; + fn = options; + options = {}; + } + + if (typeof fn !== 'function') { + throw new Error('post() requires a function, got "' + typeof fn + '"'); + } + + if (unshift) { + hooks.unshift(Object.assign({}, options, { fn: fn })); + } else { + hooks.push(Object.assign({}, options, { fn: fn })); + } + this._posts.set(name, hooks); + return this; +}; + +Kareem.prototype.clone = function() { + const n = new Kareem(); + + for (let key of this._pres.keys()) { + const clone = this._pres.get(key).slice(); + clone.numAsync = this._pres.get(key).numAsync; + n._pres.set(key, clone); + } + for (let key of this._posts.keys()) { + n._posts.set(key, this._posts.get(key).slice()); + } + + return n; +}; + +Kareem.prototype.merge = function(other, clone) { + clone = arguments.length === 1 ? true : clone; + var ret = clone ? this.clone() : this; + + for (let key of other._pres.keys()) { + const sourcePres = ret._pres.get(key) || []; + const deduplicated = other._pres.get(key). + // Deduplicate based on `fn` + filter(p => sourcePres.map(_p => _p.fn).indexOf(p.fn) === -1); + const combined = sourcePres.concat(deduplicated); + combined.numAsync = sourcePres.numAsync || 0; + combined.numAsync += deduplicated.filter(p => p.isAsync).length; + ret._pres.set(key, combined); + } + for (let key of other._posts.keys()) { + const sourcePosts = ret._posts.get(key) || []; + const deduplicated = other._posts.get(key). + filter(p => sourcePosts.indexOf(p) === -1); + ret._posts.set(key, sourcePosts.concat(deduplicated)); + } + + return ret; +}; + +function callMiddlewareFunction(fn, context, args, next) { + let maybePromiseLike; + try { + maybePromiseLike = fn.apply(context, args); + } catch (error) { + return next(error); + } + + if (isPromiseLike(maybePromiseLike)) { + maybePromiseLike.then(() => next(), err => next(err)); + } +} + +function isPromiseLike(v) { + return (typeof v === 'object' && v !== null && typeof v.then === 'function'); +} + +function decorateNextFn(fn) { + var called = false; + var _this = this; + return function() { + // Ensure this function can only be called once + if (called) { + return; + } + called = true; + // Make sure to clear the stack so try/catch doesn't catch errors + // in subsequent middleware + return nextTick(() => fn.apply(_this, arguments)); + }; +} + +const nextTick = typeof process === 'object' && process !== null && process.nextTick || function nextTick(cb) { + setTimeout(cb, 0); +}; + +module.exports = Kareem; diff --git a/node_modules/kareem/package.json b/node_modules/kareem/package.json new file mode 100644 index 000000000..437dded94 --- /dev/null +++ b/node_modules/kareem/package.json @@ -0,0 +1,25 @@ +{ + "name": "kareem", + "version": "2.4.1", + "description": "Next-generation take on pre/post function hooks", + "main": "index.js", + "scripts": { + "lint": "eslint .", + "test": "mocha ./test/*", + "test-travis": "nyc mocha ./test/*" + }, + "repository": { + "type": "git", + "url": "git://github.com/vkarpov15/kareem.git" + }, + "devDependencies": { + "@masteringjs/eslint-config": "0.0.1", + "acquit": "1.x", + "acquit-ignore": "0.1.x", + "eslint": "8.15.0", + "mocha": "9.2.0", + "nyc": "15.1.0" + }, + "author": "Valeri Karpov ", + "license": "Apache-2.0" +} diff --git a/node_modules/kareem/test/examples.test.js b/node_modules/kareem/test/examples.test.js new file mode 100644 index 000000000..a267be333 --- /dev/null +++ b/node_modules/kareem/test/examples.test.js @@ -0,0 +1,429 @@ +'use strict'; + +var assert = require('assert'); +const { beforeEach, describe, it } = require('mocha'); +var Kareem = require('../'); + +/* Much like [hooks](https://npmjs.org/package/hooks), kareem lets you define + * pre and post hooks: pre hooks are called before a given function executes. + * Unlike hooks, kareem stores hooks and other internal state in a separate + * object, rather than relying on inheritance. Furthermore, kareem exposes + * an `execPre()` function that allows you to execute your pre hooks when + * appropriate, giving you more fine-grained control over your function hooks. + */ +describe('pre hooks', function() { + var hooks; + + beforeEach(function() { + hooks = new Kareem(); + }); + + it('runs without any hooks specified', function(done) { + hooks.execPre('cook', null, function() { + // ... + // acquit:ignore:start + done(); + // acquit:ignore:end + }); + }); + + /* pre hook functions take one parameter, a "done" function that you execute + * when your pre hook is finished. + */ + it('runs basic serial pre hooks', function(done) { + var count = 0; + + hooks.pre('cook', function(done) { + ++count; + done(); + }); + + hooks.execPre('cook', null, function() { + assert.equal(1, count); + // acquit:ignore:start + done(); + // acquit:ignore:end + }); + }); + + it('can run multipe pre hooks', function(done) { + var count1 = 0; + var count2 = 0; + + hooks.pre('cook', function(done) { + ++count1; + done(); + }); + + hooks.pre('cook', function(done) { + ++count2; + done(); + }); + + hooks.execPre('cook', null, function() { + assert.equal(1, count1); + assert.equal(1, count2); + // acquit:ignore:start + done(); + // acquit:ignore:end + }); + }); + + /* If your pre hook function takes no parameters, its assumed to be + * fully synchronous. + */ + it('can run fully synchronous pre hooks', function(done) { + var count1 = 0; + var count2 = 0; + + hooks.pre('cook', function() { + ++count1; + }); + + hooks.pre('cook', function() { + ++count2; + }); + + hooks.execPre('cook', null, function(error) { + assert.equal(null, error); + assert.equal(1, count1); + assert.equal(1, count2); + // acquit:ignore:start + done(); + // acquit:ignore:end + }); + }); + + /* Pre save hook functions are bound to the second parameter to `execPre()` + */ + it('properly attaches context to pre hooks', function(done) { + hooks.pre('cook', function(done) { + this.bacon = 3; + done(); + }); + + hooks.pre('cook', function(done) { + this.eggs = 4; + done(); + }); + + var obj = { bacon: 0, eggs: 0 }; + + // In the pre hooks, `this` will refer to `obj` + hooks.execPre('cook', obj, function(error) { + assert.equal(null, error); + assert.equal(3, obj.bacon); + assert.equal(4, obj.eggs); + // acquit:ignore:start + done(); + // acquit:ignore:end + }); + }); + + /* Like the hooks module, you can declare "async" pre hooks - these take two + * parameters, the functions `next()` and `done()`. `next()` passes control to + * the next pre hook, but the underlying function won't be called until all + * async pre hooks have called `done()`. + */ + it('can execute parallel (async) pre hooks', function(done) { + hooks.pre('cook', true, function(next, done) { + this.bacon = 3; + next(); + setTimeout(function() { + done(); + }, 5); + }); + + hooks.pre('cook', true, function(next, done) { + next(); + var _this = this; + setTimeout(function() { + _this.eggs = 4; + done(); + }, 10); + }); + + hooks.pre('cook', function(next) { + this.waffles = false; + next(); + }); + + var obj = { bacon: 0, eggs: 0 }; + + hooks.execPre('cook', obj, function() { + assert.equal(3, obj.bacon); + assert.equal(4, obj.eggs); + assert.equal(false, obj.waffles); + // acquit:ignore:start + done(); + // acquit:ignore:end + }); + }); + + /* You can also return a promise from your pre hooks instead of calling + * `next()`. When the returned promise resolves, kareem will kick off the + * next middleware. + */ + it('supports returning a promise', function(done) { + hooks.pre('cook', function() { + return new Promise(resolve => { + setTimeout(() => { + this.bacon = 3; + resolve(); + }, 100); + }); + }); + + var obj = { bacon: 0 }; + + hooks.execPre('cook', obj, function() { + assert.equal(3, obj.bacon); + // acquit:ignore:start + done(); + // acquit:ignore:end + }); + }); +}); + +describe('post hooks', function() { + var hooks; + + beforeEach(function() { + hooks = new Kareem(); + }); + + it('runs without any hooks specified', function(done) { + hooks.execPost('cook', null, [1], function(error, eggs) { + assert.ifError(error); + assert.equal(1, eggs); + done(); + }); + }); + + it('executes with parameters passed in', function(done) { + hooks.post('cook', function(eggs, bacon, callback) { + assert.equal(1, eggs); + assert.equal(2, bacon); + callback(); + }); + + hooks.execPost('cook', null, [1, 2], function(error, eggs, bacon) { + assert.ifError(error); + assert.equal(1, eggs); + assert.equal(2, bacon); + // acquit:ignore:start + done(); + // acquit:ignore:end + }); + }); + + it('can use synchronous post hooks', function(done) { + var execed = {}; + + hooks.post('cook', function(eggs, bacon) { + execed.first = true; + assert.equal(1, eggs); + assert.equal(2, bacon); + }); + + hooks.post('cook', function(eggs, bacon, callback) { + execed.second = true; + assert.equal(1, eggs); + assert.equal(2, bacon); + callback(); + }); + + hooks.execPost('cook', null, [1, 2], function(error, eggs, bacon) { + assert.ifError(error); + assert.equal(2, Object.keys(execed).length); + assert.ok(execed.first); + assert.ok(execed.second); + assert.equal(1, eggs); + assert.equal(2, bacon); + // acquit:ignore:start + done(); + // acquit:ignore:end + }); + }); + + /* You can also return a promise from your post hooks instead of calling + * `next()`. When the returned promise resolves, kareem will kick off the + * next middleware. + */ + it('supports returning a promise', function(done) { + hooks.post('cook', function(bacon) { + return new Promise(resolve => { + setTimeout(() => { + this.bacon = 3; + resolve(); + }, 100); + }); + }); + + var obj = { bacon: 0 }; + + hooks.execPost('cook', obj, obj, function() { + assert.equal(obj.bacon, 3); + // acquit:ignore:start + done(); + // acquit:ignore:end + }); + }); +}); + +describe('wrap()', function() { + var hooks; + + beforeEach(function() { + hooks = new Kareem(); + }); + + it('wraps pre and post calls into one call', function(done) { + hooks.pre('cook', true, function(next, done) { + this.bacon = 3; + next(); + setTimeout(function() { + done(); + }, 5); + }); + + hooks.pre('cook', true, function(next, done) { + next(); + var _this = this; + setTimeout(function() { + _this.eggs = 4; + done(); + }, 10); + }); + + hooks.pre('cook', function(next) { + this.waffles = false; + next(); + }); + + hooks.post('cook', function(obj) { + obj.tofu = 'no'; + }); + + var obj = { bacon: 0, eggs: 0 }; + + var args = [obj]; + args.push(function(error, result) { + assert.ifError(error); + assert.equal(null, error); + assert.equal(3, obj.bacon); + assert.equal(4, obj.eggs); + assert.equal(false, obj.waffles); + assert.equal('no', obj.tofu); + + assert.equal(obj, result); + // acquit:ignore:start + done(); + // acquit:ignore:end + }); + + hooks.wrap( + 'cook', + function(o, callback) { + assert.equal(3, obj.bacon); + assert.equal(4, obj.eggs); + assert.equal(false, obj.waffles); + assert.equal(undefined, obj.tofu); + callback(null, o); + }, + obj, + args); + }); +}); + +describe('createWrapper()', function() { + var hooks; + + beforeEach(function() { + hooks = new Kareem(); + }); + + it('wraps wrap() into a callable function', function(done) { + hooks.pre('cook', true, function(next, done) { + this.bacon = 3; + next(); + setTimeout(function() { + done(); + }, 5); + }); + + hooks.pre('cook', true, function(next, done) { + next(); + var _this = this; + setTimeout(function() { + _this.eggs = 4; + done(); + }, 10); + }); + + hooks.pre('cook', function(next) { + this.waffles = false; + next(); + }); + + hooks.post('cook', function(obj) { + obj.tofu = 'no'; + }); + + var obj = { bacon: 0, eggs: 0 }; + + var cook = hooks.createWrapper( + 'cook', + function(o, callback) { + assert.equal(3, obj.bacon); + assert.equal(4, obj.eggs); + assert.equal(false, obj.waffles); + assert.equal(undefined, obj.tofu); + callback(null, o); + }, + obj); + + cook(obj, function(error, result) { + assert.ifError(error); + assert.equal(3, obj.bacon); + assert.equal(4, obj.eggs); + assert.equal(false, obj.waffles); + assert.equal('no', obj.tofu); + + assert.equal(obj, result); + // acquit:ignore:start + done(); + // acquit:ignore:end + }); + }); +}); + +describe('clone()', function() { + it('clones a Kareem object', function() { + var k1 = new Kareem(); + k1.pre('cook', function() {}); + k1.post('cook', function() {}); + + var k2 = k1.clone(); + assert.deepEqual(Array.from(k2._pres.keys()), ['cook']); + assert.deepEqual(Array.from(k2._posts.keys()), ['cook']); + }); +}); + +describe('merge()', function() { + it('pulls hooks from another Kareem object', function() { + var k1 = new Kareem(); + var test1 = function() {}; + k1.pre('cook', test1); + k1.post('cook', function() {}); + + var k2 = new Kareem(); + var test2 = function() {}; + k2.pre('cook', test2); + var k3 = k2.merge(k1); + assert.equal(k3._pres.get('cook').length, 2); + assert.equal(k3._pres.get('cook')[0].fn, test2); + assert.equal(k3._pres.get('cook')[1].fn, test1); + assert.equal(k3._posts.get('cook').length, 1); + }); +}); diff --git a/node_modules/kareem/test/misc.test.js b/node_modules/kareem/test/misc.test.js new file mode 100644 index 000000000..db3e4e6bf --- /dev/null +++ b/node_modules/kareem/test/misc.test.js @@ -0,0 +1,71 @@ +'use strict'; + +const assert = require('assert'); +const Kareem = require('../'); +const { describe, it } = require('mocha'); + +describe('hasHooks', function() { + it('returns false for toString (Automattic/mongoose#6538)', function() { + const k = new Kareem(); + assert.ok(!k.hasHooks('toString')); + }); +}); + +describe('merge', function() { + it('handles async pres if source doesnt have them', function() { + const k1 = new Kareem(); + k1.pre('cook', true, function(next, done) { + setTimeout( + function() { + done('error!'); + }, + 5); + + next(); + }); + + assert.equal(k1._pres.get('cook').numAsync, 1); + + const k2 = new Kareem(); + const k3 = k2.merge(k1); + assert.equal(k3._pres.get('cook').numAsync, 1); + }); +}); + +describe('filter', function() { + it('returns clone with only hooks that match `fn()`', function() { + const k1 = new Kareem(); + + k1.pre('update', { document: true }, f1); + k1.pre('update', { query: true }, f2); + k1.pre('remove', { document: true }, f3); + + k1.post('update', { document: true }, f1); + k1.post('update', { query: true }, f2); + k1.post('remove', { document: true }, f3); + + const k2 = k1.filter(hook => hook.document); + assert.equal(k2._pres.get('update').length, 1); + assert.equal(k2._pres.get('update')[0].fn, f1); + assert.equal(k2._pres.get('remove').length, 1); + assert.equal(k2._pres.get('remove')[0].fn, f3); + + assert.equal(k2._posts.get('update').length, 1); + assert.equal(k2._posts.get('update')[0].fn, f1); + assert.equal(k2._posts.get('remove').length, 1); + assert.equal(k2._posts.get('remove')[0].fn, f3); + + const k3 = k1.filter(hook => hook.query); + assert.equal(k3._pres.get('update').length, 1); + assert.equal(k3._pres.get('update')[0].fn, f2); + assert.ok(!k3._pres.has('remove')); + + assert.equal(k3._posts.get('update').length, 1); + assert.equal(k3._posts.get('update')[0].fn, f2); + assert.ok(!k3._posts.has('remove')); + + function f1() {} + function f2() {} + function f3() {} + }); +}); diff --git a/node_modules/kareem/test/post.test.js b/node_modules/kareem/test/post.test.js new file mode 100644 index 000000000..36a307292 --- /dev/null +++ b/node_modules/kareem/test/post.test.js @@ -0,0 +1,264 @@ +'use strict'; + +const assert = require('assert'); +const Kareem = require('../'); +const { beforeEach, describe, it } = require('mocha'); + +describe('execPost', function() { + var hooks; + + beforeEach(function() { + hooks = new Kareem(); + }); + + it('handles errors', function(done) { + hooks.post('cook', function(eggs, callback) { + callback('error!'); + }); + + hooks.execPost('cook', null, [4], function(error, eggs) { + assert.equal('error!', error); + assert.ok(!eggs); + done(); + }); + }); + + it('unshift', function() { + var f1 = function() {}; + var f2 = function() {}; + hooks.post('cook', f1); + hooks.post('cook', f2, true); + assert.strictEqual(hooks._posts.get('cook')[0].fn, f2); + assert.strictEqual(hooks._posts.get('cook')[1].fn, f1); + }); + + it('arbitrary options', function() { + const f1 = function() {}; + const f2 = function() {}; + hooks.post('cook', { foo: 'bar' }, f1); + hooks.post('cook', { bar: 'baz' }, f2, true); + assert.equal(hooks._posts.get('cook')[1].foo, 'bar'); + assert.equal(hooks._posts.get('cook')[0].bar, 'baz'); + }); + + it('throws error if no function', function() { + assert.throws(() => hooks.post('test'), /got "undefined"/); + }); + + it('multiple posts', function(done) { + hooks.post('cook', function(eggs, callback) { + setTimeout( + function() { + callback(); + }, + 5); + }); + + hooks.post('cook', function(eggs, callback) { + setTimeout( + function() { + callback(); + }, + 5); + }); + + hooks.execPost('cook', null, [4], function(error, eggs) { + assert.ifError(error); + assert.equal(4, eggs); + done(); + }); + }); + + it('error posts', function(done) { + var called = {}; + hooks.post('cook', function(eggs, callback) { + called.first = true; + callback(); + }); + + hooks.post('cook', function(eggs, callback) { + called.second = true; + callback(new Error('fail')); + }); + + hooks.post('cook', function(eggs, callback) { + assert.ok(false); + }); + + hooks.post('cook', function(error, eggs, callback) { + called.fourth = true; + assert.equal(error.message, 'fail'); + callback(new Error('fourth')); + }); + + hooks.post('cook', function(error, eggs, callback) { + called.fifth = true; + assert.equal(error.message, 'fourth'); + callback(new Error('fifth')); + }); + + hooks.execPost('cook', null, [4], function(error, eggs) { + assert.ok(error); + assert.equal(error.message, 'fifth'); + assert.deepEqual(called, { + first: true, + second: true, + fourth: true, + fifth: true + }); + done(); + }); + }); + + it('error posts with initial error', function(done) { + var called = {}; + + hooks.post('cook', function(eggs, callback) { + assert.ok(false); + }); + + hooks.post('cook', function(error, eggs, callback) { + called.second = true; + assert.equal(error.message, 'fail'); + callback(new Error('second')); + }); + + hooks.post('cook', function(error, eggs, callback) { + called.third = true; + assert.equal(error.message, 'second'); + callback(new Error('third')); + }); + + hooks.post('cook', function(error, eggs, callback) { + called.fourth = true; + assert.equal(error.message, 'third'); + callback(); + }); + + var options = { error: new Error('fail') }; + hooks.execPost('cook', null, [4], options, function(error, eggs) { + assert.ok(error); + assert.equal(error.message, 'third'); + assert.deepEqual(called, { + second: true, + third: true, + fourth: true + }); + done(); + }); + }); + + it('supports returning a promise', function(done) { + var calledPost = 0; + + hooks.post('cook', function() { + return new Promise(resolve => { + setTimeout(() => { + ++calledPost; + resolve(); + }, 100); + }); + }); + + hooks.execPost('cook', null, [], {}, function(error) { + assert.ifError(error); + assert.equal(calledPost, 1); + done(); + }); + }); + + it('supports overwriteResult', function(done) { + hooks.post('cook', function(eggs, callback) { + callback(Kareem.overwriteResult(5)); + }); + + hooks.post('cook', function(eggs, callback) { + assert.equal(eggs, 5); + callback(); + }); + + var options = {}; + hooks.execPost('cook', null, [4], options, function(error, eggs) { + assert.equal(eggs, 5); + done(); + }); + }); + + it('supports sync returning overwriteResult', function(done) { + hooks.post('cook', function() { + return Kareem.overwriteResult(5); + }); + + hooks.post('cook', function(eggs, callback) { + assert.equal(eggs, 5); + callback(); + }); + + var options = {}; + hooks.execPost('cook', null, [4], options, function(error, eggs) { + assert.ifError(error); + assert.equal(eggs, 5); + done(); + }); + }); + + it('supports sync overwriteResult', function() { + hooks.post('cook', function(eggs) { + return Kareem.overwriteResult(5); + }); + + hooks.post('cook', function(eggs) { + assert.equal(eggs, 5); + }); + + var options = {}; + const res = hooks.execPostSync('cook', null, [4], options); + assert.deepEqual(res, [5]); + }); + + it('supports overwriteResult with promises', function(done) { + hooks.post('cook', function(eggs) { + return Promise.resolve(Kareem.overwriteResult(5)); + }); + + hooks.post('cook', function(eggs) { + assert.equal(eggs, 5); + }); + + var options = {}; + hooks.execPost('cook', null, [4], options, function(error, eggs) { + assert.equal(eggs, 5); + done(); + }); + }); +}); + +describe('execPostSync', function() { + var hooks; + + beforeEach(function() { + hooks = new Kareem(); + }); + + it('executes hooks synchronously', function() { + var execed = {}; + + hooks.post('cook', function() { + execed.first = true; + }); + + hooks.post('cook', function() { + execed.second = true; + }); + + hooks.execPostSync('cook', null); + assert.ok(execed.first); + assert.ok(execed.second); + }); + + it('works with no hooks specified', function() { + assert.doesNotThrow(function() { + hooks.execPostSync('cook', null); + }); + }); +}); diff --git a/node_modules/kareem/test/pre.test.js b/node_modules/kareem/test/pre.test.js new file mode 100644 index 000000000..3c2a8593f --- /dev/null +++ b/node_modules/kareem/test/pre.test.js @@ -0,0 +1,359 @@ +'use strict'; + +const assert = require('assert'); +const Kareem = require('../'); +const { beforeEach, describe, it } = require('mocha'); + +describe('execPre', function() { + var hooks; + + beforeEach(function() { + hooks = new Kareem(); + }); + + it('handles errors with multiple pres', function(done) { + var execed = {}; + + hooks.pre('cook', function(done) { + execed.first = true; + done(); + }); + + hooks.pre('cook', function(done) { + execed.second = true; + done('error!'); + }); + + hooks.pre('cook', function(done) { + execed.third = true; + done(); + }); + + hooks.execPre('cook', null, function(err) { + assert.equal('error!', err); + assert.equal(2, Object.keys(execed).length); + assert.ok(execed.first); + assert.ok(execed.second); + done(); + }); + }); + + it('sync errors', function(done) { + var called = 0; + + hooks.pre('cook', function(next) { + throw new Error('woops!'); + }); + + hooks.pre('cook', function(next) { + ++called; + next(); + }); + + hooks.execPre('cook', null, function(err) { + assert.equal(err.message, 'woops!'); + assert.equal(called, 0); + done(); + }); + }); + + it('unshift', function() { + var f1 = function() {}; + var f2 = function() {}; + hooks.pre('cook', false, f1); + hooks.pre('cook', false, f2, null, true); + assert.strictEqual(hooks._pres.get('cook')[0].fn, f2); + assert.strictEqual(hooks._pres.get('cook')[1].fn, f1); + }); + + it('throws error if no function', function() { + assert.throws(() => hooks.pre('test'), /got "undefined"/); + }); + + it('arbitrary options', function() { + const f1 = function() {}; + const f2 = function() {}; + hooks.pre('cook', { foo: 'bar' }, f1); + hooks.pre('cook', { bar: 'baz' }, f2, null, true); + assert.equal(hooks._pres.get('cook')[1].foo, 'bar'); + assert.equal(hooks._pres.get('cook')[0].bar, 'baz'); + }); + + it('handles async errors', function(done) { + var execed = {}; + + hooks.pre('cook', true, function(next, done) { + execed.first = true; + setTimeout( + function() { + done('error!'); + }, + 5); + + next(); + }); + + hooks.pre('cook', true, function(next, done) { + execed.second = true; + setTimeout( + function() { + done('other error!'); + }, + 10); + + next(); + }); + + hooks.execPre('cook', null, function(err) { + assert.equal('error!', err); + assert.equal(2, Object.keys(execed).length); + assert.ok(execed.first); + assert.ok(execed.second); + done(); + }); + }); + + it('handles async errors in next()', function(done) { + var execed = {}; + + hooks.pre('cook', true, function(next, done) { + execed.first = true; + setTimeout( + function() { + done('other error!'); + }, + 15); + + next(); + }); + + hooks.pre('cook', true, function(next, done) { + execed.second = true; + setTimeout( + function() { + next('error!'); + done('another error!'); + }, + 5); + }); + + hooks.execPre('cook', null, function(err) { + assert.equal('error!', err); + assert.equal(2, Object.keys(execed).length); + assert.ok(execed.first); + assert.ok(execed.second); + done(); + }); + }); + + it('handles async errors in next() when already done', function(done) { + var execed = {}; + + hooks.pre('cook', true, function(next, done) { + execed.first = true; + setTimeout( + function() { + done('other error!'); + }, + 5); + + next(); + }); + + hooks.pre('cook', true, function(next, done) { + execed.second = true; + setTimeout( + function() { + next('error!'); + done('another error!'); + }, + 25); + }); + + hooks.execPre('cook', null, function(err) { + assert.equal('other error!', err); + assert.equal(2, Object.keys(execed).length); + assert.ok(execed.first); + assert.ok(execed.second); + done(); + }); + }); + + it('async pres with clone()', function(done) { + var execed = false; + + hooks.pre('cook', true, function(next, done) { + execed = true; + setTimeout( + function() { + done(); + }, + 5); + + next(); + }); + + hooks.clone().execPre('cook', null, function(err) { + assert.ifError(err); + assert.ok(execed); + done(); + }); + }); + + it('returns correct error when async pre errors', function(done) { + var execed = {}; + + hooks.pre('cook', true, function(next, done) { + execed.first = true; + setTimeout( + function() { + done('other error!'); + }, + 5); + + next(); + }); + + hooks.pre('cook', function(next) { + execed.second = true; + setTimeout( + function() { + next('error!'); + }, + 15); + }); + + hooks.execPre('cook', null, function(err) { + assert.equal('other error!', err); + assert.equal(2, Object.keys(execed).length); + assert.ok(execed.first); + assert.ok(execed.second); + done(); + }); + }); + + it('lets async pres run when fully sync pres are done', function(done) { + var execed = {}; + + hooks.pre('cook', true, function(next, done) { + execed.first = true; + setTimeout( + function() { + done(); + }, + 5); + + next(); + }); + + hooks.pre('cook', function() { + execed.second = true; + }); + + hooks.execPre('cook', null, function(err) { + assert.ifError(err); + assert.equal(2, Object.keys(execed).length); + assert.ok(execed.first); + assert.ok(execed.second); + done(); + }); + }); + + it('allows passing arguments to the next pre', function(done) { + var execed = {}; + + hooks.pre('cook', function(next) { + execed.first = true; + next(null, 'test'); + }); + + hooks.pre('cook', function(next, p) { + execed.second = true; + assert.equal(p, 'test'); + next(); + }); + + hooks.pre('cook', function(next, p) { + execed.third = true; + assert.ok(!p); + next(); + }); + + hooks.execPre('cook', null, function(err) { + assert.ifError(err); + assert.equal(3, Object.keys(execed).length); + assert.ok(execed.first); + assert.ok(execed.second); + assert.ok(execed.third); + done(); + }); + }); + + it('handles sync errors in pre if there are more hooks', function(done) { + var execed = {}; + + hooks.pre('cook', function() { + execed.first = true; + throw new Error('Oops!'); + }); + + hooks.pre('cook', function() { + execed.second = true; + }); + + hooks.execPre('cook', null, function(err) { + assert.ok(err); + assert.ok(execed.first); + assert.equal(err.message, 'Oops!'); + done(); + }); + }); + + it('supports skipWrappedFunction', function(done) { + var execed = {}; + + hooks.pre('cook', function(callback) { + callback(Kareem.skipWrappedFunction(42)); + }); + + hooks.pre('cook', function() { + execed.second = true; + }); + + hooks.execPre('cook', null, function(err) { + assert.ok(execed.second); + assert.ok(err instanceof Kareem.skipWrappedFunction); + done(); + }); + }); +}); + +describe('execPreSync', function() { + var hooks; + + beforeEach(function() { + hooks = new Kareem(); + }); + + it('executes hooks synchronously', function() { + var execed = {}; + + hooks.pre('cook', function() { + execed.first = true; + }); + + hooks.pre('cook', function() { + execed.second = true; + }); + + hooks.execPreSync('cook', null); + assert.ok(execed.first); + assert.ok(execed.second); + }); + + it('works with no hooks specified', function() { + assert.doesNotThrow(function() { + hooks.execPreSync('cook', null); + }); + }); +}); diff --git a/node_modules/kareem/test/wrap.test.js b/node_modules/kareem/test/wrap.test.js new file mode 100644 index 000000000..c248686ff --- /dev/null +++ b/node_modules/kareem/test/wrap.test.js @@ -0,0 +1,467 @@ +'use strict'; + +var assert = require('assert'); +var Kareem = require('../'); +const { beforeEach, describe, it } = require('mocha'); + +describe('wrap()', function() { + var hooks; + + beforeEach(function() { + hooks = new Kareem(); + }); + + it('handles pre errors', function(done) { + hooks.pre('cook', function(done) { + done('error!'); + }); + + hooks.post('cook', function(obj) { + obj.tofu = 'no'; + }); + + var obj = { bacon: 0, eggs: 0 }; + + var args = [obj]; + args.push(function(error, result) { + assert.equal('error!', error); + assert.ok(!result); + assert.equal(undefined, obj.tofu); + done(); + }); + + hooks.wrap( + 'cook', + function(o, callback) { + // Should never get called + assert.ok(false); + callback(null, o); + }, + obj, + args); + }); + + it('handles pre errors when no callback defined', function(done) { + hooks.pre('cook', function(done) { + done('error!'); + }); + + hooks.post('cook', function(obj) { + obj.tofu = 'no'; + }); + + var obj = { bacon: 0, eggs: 0 }; + + var args = [obj]; + + hooks.wrap( + 'cook', + function(o, callback) { + // Should never get called + assert.ok(false); + callback(null, o); + }, + obj, + args); + + setTimeout( + function() { + done(); + }, + 25); + }); + + it('handles errors in wrapped function', function(done) { + hooks.pre('cook', function(done) { + done(); + }); + + hooks.post('cook', function(obj) { + obj.tofu = 'no'; + }); + + var obj = { bacon: 0, eggs: 0 }; + + var args = [obj]; + args.push(function(error, result) { + assert.equal('error!', error); + assert.ok(!result); + assert.equal(undefined, obj.tofu); + done(); + }); + + hooks.wrap( + 'cook', + function(o, callback) { + callback('error!'); + }, + obj, + args); + }); + + it('handles errors in post', function(done) { + hooks.pre('cook', function(done) { + done(); + }); + + hooks.post('cook', function(obj, callback) { + obj.tofu = 'no'; + callback('error!'); + }); + + var obj = { bacon: 0, eggs: 0 }; + + var args = [obj]; + args.push(function(error, result) { + assert.equal('error!', error); + assert.ok(!result); + assert.equal('no', obj.tofu); + done(); + }); + + hooks.wrap( + 'cook', + function(o, callback) { + callback(null, o); + }, + obj, + args); + }); + + it('defers errors to post hooks if enabled', function(done) { + hooks.pre('cook', function(done) { + done(new Error('fail')); + }); + + hooks.post('cook', function(error, res, callback) { + callback(new Error('another error occurred')); + }); + + var args = []; + args.push(function(error) { + assert.equal(error.message, 'another error occurred'); + done(); + }); + + hooks.wrap( + 'cook', + function(callback) { + assert.ok(false); + callback(); + }, + null, + args, + { useErrorHandlers: true, numCallbackParams: 1 }); + }); + + it('error handlers with no callback', function(done) { + hooks.pre('cook', function(done) { + done(new Error('fail')); + }); + + hooks.post('cook', function(error, callback) { + assert.equal(error.message, 'fail'); + done(); + }); + + var args = []; + + hooks.wrap( + 'cook', + function(callback) { + assert.ok(false); + callback(); + }, + null, + args, + { useErrorHandlers: true }); + }); + + it('error handlers with no error', function(done) { + hooks.post('cook', function(error, callback) { + callback(new Error('another error occurred')); + }); + + var args = []; + args.push(function(error) { + assert.ifError(error); + done(); + }); + + hooks.wrap( + 'cook', + function(callback) { + callback(); + }, + null, + args, + { useErrorHandlers: true }); + }); + + it('works with no args', function(done) { + hooks.pre('cook', function(done) { + done(); + }); + + hooks.post('cook', function(callback) { + obj.tofu = 'no'; + callback(); + }); + + var obj = { bacon: 0, eggs: 0 }; + + var args = []; + + hooks.wrap( + 'cook', + function(callback) { + callback(null); + }, + obj, + args); + + setTimeout( + function() { + assert.equal('no', obj.tofu); + done(); + }, + 25); + }); + + it('handles pre errors with no args', function(done) { + hooks.pre('cook', function(done) { + done('error!'); + }); + + hooks.post('cook', function(callback) { + obj.tofu = 'no'; + callback(); + }); + + var obj = { bacon: 0, eggs: 0 }; + + var args = []; + + hooks.wrap( + 'cook', + function(callback) { + callback(null); + }, + obj, + args); + + setTimeout( + function() { + assert.equal(undefined, obj.tofu); + done(); + }, + 25); + }); + + it('handles wrapped function errors with no args', function(done) { + hooks.pre('cook', function(done) { + obj.waffles = false; + done(); + }); + + hooks.post('cook', function(callback) { + obj.tofu = 'no'; + callback(); + }); + + var obj = { bacon: 0, eggs: 0 }; + + var args = []; + + hooks.wrap( + 'cook', + function(callback) { + callback('error!'); + }, + obj, + args); + + setTimeout( + function() { + assert.equal(false, obj.waffles); + assert.equal(undefined, obj.tofu); + done(); + }, + 25); + }); + + it('supports overwriteResult', function(done) { + hooks.post('cook', function(eggs, callback) { + callback(Kareem.overwriteResult(5)); + }); + + const args = [(err, res) => { + assert.ifError(err); + assert.equal(res, 5); + done(); + }]; + + hooks.wrap( + 'cook', + function(callback) { + callback(null, 4); + }, + null, + args); + }); + + it('supports skipWrappedFunction', function(done) { + const execed = {}; + hooks.pre('cook', function pre(callback) { + execed.pre = true; + callback(Kareem.skipWrappedFunction(3)); + }); + + hooks.post('cook', function(res, callback) { + assert.equal(res, 3); + execed.post = true; + callback(); + }); + + const args = [(err, res) => { + assert.ifError(err); + assert.equal(res, 3); + assert.ok(execed.pre); + assert.ok(execed.post); + assert.ok(!execed.wrapped); + done(); + }]; + + hooks.wrap( + 'cook', + function wrapped(callback) { + execed.wrapped = true; + callback(); + }, + null, + args); + }); + + it('supports skipWrappedFunction with arguments', function(done) { + const execed = {}; + hooks.pre('cook', function pre(callback, arg) { + execed.pre = true; + assert.strictEqual(arg, 4); + callback(Kareem.skipWrappedFunction(3)); + }); + + hooks.post('cook', function(res, callback) { + assert.equal(res, 3); + execed.post = true; + callback(); + }); + + const args = [4, (err, res) => { + assert.ifError(err); + assert.equal(res, 3); + assert.ok(execed.pre); + assert.ok(execed.post); + assert.ok(!execed.wrapped); + done(); + }]; + + hooks.wrap( + 'cook', + function wrapped(arg, callback) { + execed.wrapped = true; + callback(); + }, + null, + args); + }); + + it('handles post errors with no args', function(done) { + hooks.pre('cook', function(done) { + obj.waffles = false; + done(); + }); + + hooks.post('cook', function(callback) { + obj.tofu = 'no'; + callback('error!'); + }); + + var obj = { bacon: 0, eggs: 0 }; + + var args = []; + + hooks.wrap( + 'cook', + function(callback) { + callback(); + }, + obj, + args); + + setTimeout( + function() { + assert.equal(false, obj.waffles); + assert.equal('no', obj.tofu); + done(); + }, + 25); + }); + + it('catches sync errors', function(done) { + hooks.pre('cook', function(done) { + done(); + }); + + hooks.post('cook', function(callback) { + callback(); + }); + + var args = []; + args.push(function(error) { + assert.equal(error.message, 'oops!'); + done(); + }); + + hooks.wrap( + 'cook', + function() { + throw new Error('oops!'); + }, + null, + args); + }); + + it('sync wrappers', function() { + var calledPre = 0; + var calledFn = 0; + var calledPost = 0; + hooks.pre('cook', function() { + ++calledPre; + }); + + hooks.post('cook', function() { + ++calledPost; + }); + + var wrapper = hooks.createWrapperSync('cook', function() { ++calledFn; }); + + wrapper(); + + assert.equal(calledPre, 1); + assert.equal(calledFn, 1); + assert.equal(calledPost, 1); + }); + + it('sync wrappers with overwriteResult', function() { + hooks.pre('cook', function() { + }); + + hooks.post('cook', function() { + return Kareem.overwriteResult(5); + }); + + const wrapper = hooks.createWrapperSync('cook', function() { return 4; }); + + assert.strictEqual(wrapper(), 5); + }); +}); diff --git a/node_modules/minecraft-query/LICENSE b/node_modules/minecraft-query/LICENSE new file mode 100644 index 000000000..f288702d2 --- /dev/null +++ b/node_modules/minecraft-query/LICENSE @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. diff --git a/node_modules/minecraft-query/Query.js b/node_modules/minecraft-query/Query.js new file mode 100644 index 000000000..82ba8de04 --- /dev/null +++ b/node_modules/minecraft-query/Query.js @@ -0,0 +1,175 @@ +const udp = require('dgram'); +const EventEmitter = require('events'); +const crypto = require('crypto'); + +// https://wiki.vg/Query + +class Query { + constructor(obj) { + this.emitter = new EventEmitter(); + this.host = obj.host; + this.port = obj.port; + this.timeout = obj.timeout || 5000; + this.authenticating = false; + this.basic_stat = false; + this.sessionid = crypto.randomBytes(4) // a safe 32-bit integer + this.full_stat = false; + this.closed = false; + this.client = udp.createSocket('udp4'); + + this.client.on('message', (data, info) => { + + if (this.authenticating) { + var t = parseInt(data.toString('utf-8', 5)); // got the token! + this.emitter.emit('challenge_token', t); + this.authenticating = false; + } + //Fix by @KevBelisle + if (this.full_stat) { + try { + var final = data.toString('utf-8', 11).split("\x00\x01player_\x00\x00"); // splicing the output as suggested + var kv = final[0].split("\0"); + var players = final[1].split("\0").filter((item) => { + return item != ""; + }); + + this.emitter.emit('full_stat', { + motd: kv[3], + gametype: kv[5], + game_id: kv[7], + version: kv[9], + plugins: kv[11], + map: kv[13], + online_players: kv[15], + max_players: kv[17], + port: kv[19], + players + }); + } catch (err) { + throw err; + } + } + //Also added a catch for basic stat + if (this.basic_stat) { + try { + var final = data.toString().split('\0'); + this.emitter.emit('basic_stat', { + motd: final[5], + gametype: final[6], + map: final[7], + online_players: final[8], + max_players: final[9] + }); + } catch (err) { + throw err; + } + } + }); + } + + fullStat() { + return new Promise( + async (resolve, reject) => { + + // building the packet + if (this.closed) + return reject(new Error('Cannot query if UDP connection is closed')) + + try { + var token = await this._generateChallengeToken(); + var buffer = Buffer.alloc(15) // short + byte + int32 + int32 = 11 bytes + buffer.writeUInt16BE(0xFEFD, 0); // magic number, as usual + buffer.writeUInt8(0, 2); // 0 for stat + buffer.writeInt32BE(this.sessionid, 3); // our session id + buffer.writeInt32BE(token, 7); + buffer.writeInt32BE(0x00, 11); + + this.full_stat = true; + + this.emitter.once('full_stat', (stat) => { + this.full_stat = false; + resolve(stat); + }); + + this.client.send(buffer, this.port, this.host, (err) => { + if (err) { + reject(err); + } + }); + } catch (err) { + reject(err); + } + } + ); + } + + basicStat() { + return new Promise( + async (resolve, reject) => { + + if (this.closed) + return reject(new Error('Cannot query if UDP connection is closed')) + + // building the packet + try { + var token = await this._generateChallengeToken(); + var buffer = Buffer.alloc(11) // short + byte + int32 + int32 = 11 bytes + buffer.writeUInt16BE(0xFEFD, 0); // magic number, as usual + buffer.writeUInt8(0, 2); // 0 is basic stat + buffer.writeInt32BE(this.sessionid, 3); // our session id + buffer.writeInt32BE(token, 7); + this.basic_stat = true; + + this.emitter.once('basic_stat', (stat) => { + this.basic_stat = false; + resolve(stat); + }); + + this.client.send(buffer, this.port, this.host, (err) => { + if (err) reject(err); + }); + } catch (err) { + reject(err); + } + + } + ); + } + + close() { + this.closed = true; + this.client.close(); + } + + _generateChallengeToken() { + return new Promise((resolve, reject) => { + // building the packet + + var buffer = Buffer.alloc(7); + buffer.writeUInt16BE(0xFEFD, 0); // magic number + buffer.writeUInt8(9, 2); // 9 is handshake + buffer.writeInt32BE(this.sessionid, 3); // this.sessionid is our sessionid + buffer.write("", 7); // empty payload + this.authenticating = true; + + var timeout = setTimeout(() => { // take advantage of lexical bindings in arrow functions + reject(new Error(`Challenge token generation timeout: ${this.host}`)); + }, this.timeout); + + this.client.send(buffer, this.port, this.host, (err) => { + if (err) { + reject(err); + } + + this.emitter.once('challenge_token', (token) => { + clearTimeout(timeout); + this.authenticating = false; + resolve(token); + }); + }); + } + ); + } +} + +module.exports = Query; diff --git a/node_modules/minecraft-query/README.md b/node_modules/minecraft-query/README.md new file mode 100644 index 000000000..25378d3a1 --- /dev/null +++ b/node_modules/minecraft-query/README.md @@ -0,0 +1,95 @@ +# query +A Node.js implementation of Minecraft's query protocol + +# Installation +`npm install minecraft-query` +# + +# Prerequisites +You will first have to configure your server to recieve queries from clients.
+To do so, set the `enable-query` flag to `true` in your `server.properties` file and then set the `query.port` flag as you wish.
+The configuration should look like this
+``` +... +enable-query=true +query.port=<1-65535> +... +``` + +# Example use +``` +const Query = require("minecraft-query"); + +const q = new Query({host: 'localhost', port: 9630, timeout: 7500}); + +q.fullStat() + .then(success => { + + console.log(success); + + return q.basicStat() + + }) + + .then(success => { + + console.log(success); + + q.close(); + + }) +``` +# + +# API +*class* `Query({host, port, timeout})`
+##### Arguments: +* `host`: the address of the server +* `port`: the query port of the server +* `timeout`: handshake timeout in ms (default 5000) + +It returns a Query instance.
+# + +`Query#basicStat()`
+##### Arguments: +* none + +A promise that returns an object that corresponds to the [basic stat query type](https://wiki.vg/Query#Basic_stat). +The object should look like this: +``` +{ + motd: 'MOTD here', + gametype: 'SMP', + map: 'world', + online_players: '0', + max_players: '20' +} +``` +# +`Query#close()` +##### Arguments: +* none + +It ends the connection +# +`Query#fullStat()` +##### Arguments: +* none + +A promise that returns an object that corresponds to the [full stat query type](https://wiki.vg/Query#Full_stat). +The object should look like this: +``` +{ + motd: 'MOTD here', + gametype: 'SMP', + game_id: 'MINECRAFT', + version: '1.14.2', + plugins: 'Paper on 1.14.2-R0.1-SNAPSHOT', + map: 'world', + online_players: '4', + max_players: '20', + port: '9630', + players: ['macca_ferri', 'player1', 'notch', 'jeb'] +} +``` diff --git a/node_modules/minecraft-query/index.js b/node_modules/minecraft-query/index.js new file mode 100644 index 000000000..1e072d937 --- /dev/null +++ b/node_modules/minecraft-query/index.js @@ -0,0 +1,25 @@ +const Query = require("./Query"); + +const q = new Query({host: 'macca.cloud', port: 25565}); + +q.fullStat() + .then(success => { + + console.log(success); + + return q.basicStat() + + }) + + .then(success => { + + console.log(success); + + q.close(); + + }) + .catch(err => { + + console.log(err); + + }) diff --git a/node_modules/minecraft-query/package.json b/node_modules/minecraft-query/package.json new file mode 100644 index 000000000..827b3eb72 --- /dev/null +++ b/node_modules/minecraft-query/package.json @@ -0,0 +1,28 @@ +{ + "name": "minecraft-query", + "version": "1.0.13", + "description": "A Node.js implementation of Minecraft's query protocol", + "main": "Query.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/emilianomaccaferri/query.git" + }, + "keywords": [ + "Minecraft", + "Query", + "data", + "players", + "online", + "players", + "MOTD" + ], + "author": "Emiliano Maccaferri", + "license": "GPL-3.0", + "bugs": { + "url": "https://github.com/emilianomaccaferri/query/issues" + }, + "homepage": "https://github.com/emilianomaccaferri/query#readme" +} diff --git a/node_modules/mongodb-connection-string-url/.esm-wrapper.mjs b/node_modules/mongodb-connection-string-url/.esm-wrapper.mjs new file mode 100644 index 000000000..a0f5be52e --- /dev/null +++ b/node_modules/mongodb-connection-string-url/.esm-wrapper.mjs @@ -0,0 +1,6 @@ +import mod from "./lib/index.js"; + +export default mod["default"]; +export const CommaAndColonSeparatedRecord = mod.CommaAndColonSeparatedRecord; +export const ConnectionString = mod.ConnectionString; +export const redactConnectionString = mod.redactConnectionString; diff --git a/node_modules/mongodb-connection-string-url/LICENSE b/node_modules/mongodb-connection-string-url/LICENSE new file mode 100644 index 000000000..d57f55f4e --- /dev/null +++ b/node_modules/mongodb-connection-string-url/LICENSE @@ -0,0 +1,192 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + Copyright 2020 MongoDB Inc. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + diff --git a/node_modules/mongodb-connection-string-url/README.md b/node_modules/mongodb-connection-string-url/README.md new file mode 100644 index 000000000..0eb65d00f --- /dev/null +++ b/node_modules/mongodb-connection-string-url/README.md @@ -0,0 +1,25 @@ +# mongodb-connection-string-url + +MongoDB connection strings, based on the WhatWG URL API + +```js +import ConnectionString from 'mongodb-connection-string-url'; + +const cs = new ConnectionString('mongodb://localhost'); +cs.searchParams.set('readPreference', 'secondary'); +console.log(cs.href); // 'mongodb://localhost/?readPreference=secondary' +``` + +## Deviations from the WhatWG URL package + +- URL parameters are case-insensitive +- The `.host`, `.hostname` and `.port` properties cannot be set, and reading + them does not return meaningful results (and are typed as `never`in TypeScript) +- The `.hosts` property contains a list of all hosts in the connection string +- The `.href` property cannot be set, only read +- There is an additional `.isSRV` property, set to `true` for `mongodb+srv://` +- There is an additional `.clone()` utility method on the prototype + +## LICENSE + +Apache-2.0 diff --git a/node_modules/mongodb-connection-string-url/lib/index.d.ts b/node_modules/mongodb-connection-string-url/lib/index.d.ts new file mode 100644 index 000000000..49c18ea29 --- /dev/null +++ b/node_modules/mongodb-connection-string-url/lib/index.d.ts @@ -0,0 +1,62 @@ +import { URL } from 'whatwg-url'; +import { redactConnectionString, ConnectionStringRedactionOptions } from './redact'; +export { redactConnectionString, ConnectionStringRedactionOptions }; +declare class CaseInsensitiveMap extends Map { + delete(name: K): boolean; + get(name: K): string | undefined; + has(name: K): boolean; + set(name: K, value: any): this; + _normalizeKey(name: any): K; +} +declare abstract class URLWithoutHost extends URL { + abstract get host(): never; + abstract set host(value: never); + abstract get hostname(): never; + abstract set hostname(value: never); + abstract get port(): never; + abstract set port(value: never); + abstract get href(): string; + abstract set href(value: string); +} +export interface ConnectionStringParsingOptions { + looseValidation?: boolean; +} +export declare class ConnectionString extends URLWithoutHost { + _hosts: string[]; + constructor(uri: string, options?: ConnectionStringParsingOptions); + get host(): never; + set host(_ignored: never); + get hostname(): never; + set hostname(_ignored: never); + get port(): never; + set port(_ignored: never); + get href(): string; + set href(_ignored: string); + get isSRV(): boolean; + get hosts(): string[]; + set hosts(list: string[]); + toString(): string; + clone(): ConnectionString; + redact(options?: ConnectionStringRedactionOptions): ConnectionString; + typedSearchParams(): { + append(name: keyof T & string, value: any): void; + delete(name: keyof T & string): void; + get(name: keyof T & string): string | null; + getAll(name: keyof T & string): string[]; + has(name: keyof T & string): boolean; + set(name: keyof T & string, value: any): void; + keys(): IterableIterator; + values(): IterableIterator; + entries(): IterableIterator<[keyof T & string, string]>; + _normalizeKey(name: keyof T & string): string; + [Symbol.iterator](): IterableIterator<[keyof T & string, string]>; + sort(): void; + forEach(callback: (this: THIS_ARG, value: string, name: string, searchParams: any) => void, thisArg?: THIS_ARG | undefined): void; + readonly [Symbol.toStringTag]: "URLSearchParams"; + }; +} +export declare class CommaAndColonSeparatedRecord> extends CaseInsensitiveMap { + constructor(from?: string | null); + toString(): string; +} +export default ConnectionString; diff --git a/node_modules/mongodb-connection-string-url/lib/index.js b/node_modules/mongodb-connection-string-url/lib/index.js new file mode 100644 index 000000000..297908c1c --- /dev/null +++ b/node_modules/mongodb-connection-string-url/lib/index.js @@ -0,0 +1,213 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.CommaAndColonSeparatedRecord = exports.ConnectionString = exports.redactConnectionString = void 0; +const whatwg_url_1 = require("whatwg-url"); +const redact_1 = require("./redact"); +Object.defineProperty(exports, "redactConnectionString", { enumerable: true, get: function () { return redact_1.redactConnectionString; } }); +const DUMMY_HOSTNAME = '__this_is_a_placeholder__'; +function connectionStringHasValidScheme(connectionString) { + return (connectionString.startsWith('mongodb://') || + connectionString.startsWith('mongodb+srv://')); +} +const HOSTS_REGEX = /^(?[^/]+):\/\/(?:(?[^:]*)(?::(?[^@]*))?@)?(?(?!:)[^/?@]*)(?.*)/; +class CaseInsensitiveMap extends Map { + delete(name) { + return super.delete(this._normalizeKey(name)); + } + get(name) { + return super.get(this._normalizeKey(name)); + } + has(name) { + return super.has(this._normalizeKey(name)); + } + set(name, value) { + return super.set(this._normalizeKey(name), value); + } + _normalizeKey(name) { + name = `${name}`; + for (const key of this.keys()) { + if (key.toLowerCase() === name.toLowerCase()) { + name = key; + break; + } + } + return name; + } +} +function caseInsenstiveURLSearchParams(Ctor) { + return class CaseInsenstiveURLSearchParams extends Ctor { + append(name, value) { + return super.append(this._normalizeKey(name), value); + } + delete(name) { + return super.delete(this._normalizeKey(name)); + } + get(name) { + return super.get(this._normalizeKey(name)); + } + getAll(name) { + return super.getAll(this._normalizeKey(name)); + } + has(name) { + return super.has(this._normalizeKey(name)); + } + set(name, value) { + return super.set(this._normalizeKey(name), value); + } + keys() { + return super.keys(); + } + values() { + return super.values(); + } + entries() { + return super.entries(); + } + [Symbol.iterator]() { + return super[Symbol.iterator](); + } + _normalizeKey(name) { + return CaseInsensitiveMap.prototype._normalizeKey.call(this, name); + } + }; +} +class URLWithoutHost extends whatwg_url_1.URL { +} +class MongoParseError extends Error { + get name() { + return 'MongoParseError'; + } +} +class ConnectionString extends URLWithoutHost { + constructor(uri, options = {}) { + var _a; + const { looseValidation } = options; + if (!looseValidation && !connectionStringHasValidScheme(uri)) { + throw new MongoParseError('Invalid scheme, expected connection string to start with "mongodb://" or "mongodb+srv://"'); + } + const match = uri.match(HOSTS_REGEX); + if (!match) { + throw new MongoParseError(`Invalid connection string "${uri}"`); + } + const { protocol, username, password, hosts, rest } = (_a = match.groups) !== null && _a !== void 0 ? _a : {}; + if (!looseValidation) { + if (!protocol || !hosts) { + throw new MongoParseError(`Protocol and host list are required in "${uri}"`); + } + try { + decodeURIComponent(username !== null && username !== void 0 ? username : ''); + decodeURIComponent(password !== null && password !== void 0 ? password : ''); + } + catch (err) { + throw new MongoParseError(err.message); + } + const illegalCharacters = /[:/?#[\]@]/gi; + if (username === null || username === void 0 ? void 0 : username.match(illegalCharacters)) { + throw new MongoParseError(`Username contains unescaped characters ${username}`); + } + if (!username || !password) { + const uriWithoutProtocol = uri.replace(`${protocol}://`, ''); + if (uriWithoutProtocol.startsWith('@') || uriWithoutProtocol.startsWith(':')) { + throw new MongoParseError('URI contained empty userinfo section'); + } + } + if (password === null || password === void 0 ? void 0 : password.match(illegalCharacters)) { + throw new MongoParseError('Password contains unescaped characters'); + } + } + let authString = ''; + if (typeof username === 'string') + authString += username; + if (typeof password === 'string') + authString += `:${password}`; + if (authString) + authString += '@'; + try { + super(`${protocol.toLowerCase()}://${authString}${DUMMY_HOSTNAME}${rest}`); + } + catch (err) { + if (looseValidation) { + new ConnectionString(uri, { + ...options, + looseValidation: false + }); + } + if (typeof err.message === 'string') { + err.message = err.message.replace(DUMMY_HOSTNAME, hosts); + } + throw err; + } + this._hosts = hosts.split(','); + if (!looseValidation) { + if (this.isSRV && this.hosts.length !== 1) { + throw new MongoParseError('mongodb+srv URI cannot have multiple service names'); + } + if (this.isSRV && this.hosts.some(host => host.includes(':'))) { + throw new MongoParseError('mongodb+srv URI cannot have port number'); + } + } + if (!this.pathname) { + this.pathname = '/'; + } + Object.setPrototypeOf(this.searchParams, caseInsenstiveURLSearchParams(this.searchParams.constructor).prototype); + } + get host() { return DUMMY_HOSTNAME; } + set host(_ignored) { throw new Error('No single host for connection string'); } + get hostname() { return DUMMY_HOSTNAME; } + set hostname(_ignored) { throw new Error('No single host for connection string'); } + get port() { return ''; } + set port(_ignored) { throw new Error('No single host for connection string'); } + get href() { return this.toString(); } + set href(_ignored) { throw new Error('Cannot set href for connection strings'); } + get isSRV() { + return this.protocol.includes('srv'); + } + get hosts() { + return this._hosts; + } + set hosts(list) { + this._hosts = list; + } + toString() { + return super.toString().replace(DUMMY_HOSTNAME, this.hosts.join(',')); + } + clone() { + return new ConnectionString(this.toString(), { + looseValidation: true + }); + } + redact(options) { + return (0, redact_1.redactValidConnectionString)(this, options); + } + typedSearchParams() { + const sametype = false && new (caseInsenstiveURLSearchParams(whatwg_url_1.URLSearchParams))(); + return this.searchParams; + } + [Symbol.for('nodejs.util.inspect.custom')]() { + const { href, origin, protocol, username, password, hosts, pathname, search, searchParams, hash } = this; + return { href, origin, protocol, username, password, hosts, pathname, search, searchParams, hash }; + } +} +exports.ConnectionString = ConnectionString; +class CommaAndColonSeparatedRecord extends CaseInsensitiveMap { + constructor(from) { + super(); + for (const entry of (from !== null && from !== void 0 ? from : '').split(',')) { + if (!entry) + continue; + const colonIndex = entry.indexOf(':'); + if (colonIndex === -1) { + this.set(entry, ''); + } + else { + this.set(entry.slice(0, colonIndex), entry.slice(colonIndex + 1)); + } + } + } + toString() { + return [...this].map(entry => entry.join(':')).join(','); + } +} +exports.CommaAndColonSeparatedRecord = CommaAndColonSeparatedRecord; +exports.default = ConnectionString; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/mongodb-connection-string-url/lib/index.js.map b/node_modules/mongodb-connection-string-url/lib/index.js.map new file mode 100644 index 000000000..aea1c0e09 --- /dev/null +++ b/node_modules/mongodb-connection-string-url/lib/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,2CAAkD;AAClD,qCAIkB;AACT,uGAHP,+BAAsB,OAGO;AAE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AAI,CAAC,IAAI,aAAJ,IAAI,cAAJ,IAAI,GAAI,EAAE,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE;YAC3C,IAAI,CAAC,KAAK;gBAAE,SAAS;YACrB,MAAM,UAAU,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;YAEtC,IAAI,UAAU,KAAK,CAAC,CAAC,EAAE;gBACrB,IAAI,CAAC,GAAG,CAAC,KAA2B,EAAE,EAAE,CAAC,CAAC;aAC3C;iBAAM;gBACL,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,UAAU,CAAuB,EAAE,KAAK,CAAC,KAAK,CAAC,UAAU,GAAG,CAAC,CAAC,CAAC,CAAC;aACzF;SACF;IACH,CAAC;IAED,QAAQ;QACN,OAAO,CAAC,GAAG,IAAI,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC3D,CAAC;CACF;AAlBD,oEAkBC;AAED,kBAAe,gBAAgB,CAAC"} \ No newline at end of file diff --git a/node_modules/mongodb-connection-string-url/lib/redact.d.ts b/node_modules/mongodb-connection-string-url/lib/redact.d.ts new file mode 100644 index 000000000..94a64defc --- /dev/null +++ b/node_modules/mongodb-connection-string-url/lib/redact.d.ts @@ -0,0 +1,7 @@ +import ConnectionString from './index'; +export interface ConnectionStringRedactionOptions { + redactUsernames?: boolean; + replacementString?: string; +} +export declare function redactValidConnectionString(inputUrl: Readonly, options?: ConnectionStringRedactionOptions): ConnectionString; +export declare function redactConnectionString(uri: string, options?: ConnectionStringRedactionOptions): string; diff --git a/node_modules/mongodb-connection-string-url/lib/redact.js b/node_modules/mongodb-connection-string-url/lib/redact.js new file mode 100644 index 000000000..6c558fbdd --- /dev/null +++ b/node_modules/mongodb-connection-string-url/lib/redact.js @@ -0,0 +1,83 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.redactConnectionString = exports.redactValidConnectionString = void 0; +const index_1 = __importStar(require("./index")); +function redactValidConnectionString(inputUrl, options) { + var _a, _b; + const url = inputUrl.clone(); + const replacementString = (_a = options === null || options === void 0 ? void 0 : options.replacementString) !== null && _a !== void 0 ? _a : '_credentials_'; + const redactUsernames = (_b = options === null || options === void 0 ? void 0 : options.redactUsernames) !== null && _b !== void 0 ? _b : true; + if ((url.username || url.password) && redactUsernames) { + url.username = replacementString; + url.password = ''; + } + else if (url.password) { + url.password = replacementString; + } + if (url.searchParams.has('authMechanismProperties')) { + const props = new index_1.CommaAndColonSeparatedRecord(url.searchParams.get('authMechanismProperties')); + if (props.get('AWS_SESSION_TOKEN')) { + props.set('AWS_SESSION_TOKEN', replacementString); + url.searchParams.set('authMechanismProperties', props.toString()); + } + } + if (url.searchParams.has('tlsCertificateKeyFilePassword')) { + url.searchParams.set('tlsCertificateKeyFilePassword', replacementString); + } + if (url.searchParams.has('proxyUsername') && redactUsernames) { + url.searchParams.set('proxyUsername', replacementString); + } + if (url.searchParams.has('proxyPassword')) { + url.searchParams.set('proxyPassword', replacementString); + } + return url; +} +exports.redactValidConnectionString = redactValidConnectionString; +function redactConnectionString(uri, options) { + var _a, _b; + const replacementString = (_a = options === null || options === void 0 ? void 0 : options.replacementString) !== null && _a !== void 0 ? _a : ''; + const redactUsernames = (_b = options === null || options === void 0 ? void 0 : options.redactUsernames) !== null && _b !== void 0 ? _b : true; + let parsed; + try { + parsed = new index_1.default(uri); + } + catch (_c) { } + if (parsed) { + options = { ...options, replacementString: '___credentials___' }; + return parsed.redact(options).toString().replace(/___credentials___/g, replacementString); + } + const regexes = [ + redactUsernames ? /(?<=\/\/)(.*)(?=@)/g : /(?<=\/\/[^@]+:)(.*)(?=@)/g, + /(?<=AWS_SESSION_TOKEN(:|%3A))([^,&]+)/gi, + /(?<=tlsCertificateKeyFilePassword=)([^&]+)/gi, + redactUsernames ? /(?<=proxyUsername=)([^&]+)/gi : null, + /(?<=proxyPassword=)([^&]+)/gi + ]; + for (const r of regexes) { + if (r !== null) { + uri = uri.replace(r, replacementString); + } + } + return uri; +} +exports.redactConnectionString = redactConnectionString; +//# sourceMappingURL=redact.js.map \ No newline at end of file diff --git a/node_modules/mongodb-connection-string-url/lib/redact.js.map b/node_modules/mongodb-connection-string-url/lib/redact.js.map new file mode 100644 index 000000000..1d971eee3 --- /dev/null +++ b/node_modules/mongodb-connection-string-url/lib/redact.js.map @@ -0,0 +1 @@ +{"version":3,"file":"redact.js","sourceRoot":"","sources":["../src/redact.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,iDAAyE;AAOzE,SAAgB,2BAA2B,CACzC,QAAoC,EACpC,OAA0C;;IAC1C,MAAM,GAAG,GAAG,QAAQ,CAAC,KAAK,EAAE,CAAC;IAC7B,MAAM,iBAAiB,GAAG,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,iBAAiB,mCAAI,eAAe,CAAC;IACxE,MAAM,eAAe,GAAG,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,eAAe,mCAAI,IAAI,CAAC;IAEzD,IAAI,CAAC,GAAG,CAAC,QAAQ,IAAI,GAAG,CAAC,QAAQ,CAAC,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iB,mCAAI,eAAe,CAAC;IACxE,MAAM,eAAe,GAAG,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,eAAe,mCAAI,IAAI,CAAC;IAEzD,IAAI,MAAoC,CAAC;IACzC,IAAI;QACF,MAAM,GAAG,IAAI,eAAgB,CAAC,GAAG,CAAC,CAAC;KACpC;IAAC,WAAM,GAAE;IACV,IAAI,MAAM,EAAE;QAGV,OAAO,GAAG,EAAE,GAAG,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,CAAC;QACjE,OAAO,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,oBAAoB,EAAE,iBAAiB,CAAC,CAAC;KAC3F;IAED,MAAM,OAAO,GAAsB;QAEjC,eAAe,CAAC,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC,2BAA2B;QAErE,yCAAyC;QAEzC,8CAA8C;QAE9C,eAAe,CAAC,CAAC,CAAC,8BAA8B,CAAC,CAAC,CAAC,IAAI;QAEvD,8BAA8B;KAC/B,CAAC;IACF,KAAK,MAAM,CAAC,IAAI,OAAO,EAAE;QACvB,IAAI,CAAC,KAAK,IAAI,EAAE;YACd,GAAG,GAAG,GAAG,CAAC,OAAO,CAAC,CAAC,EAAE,iBAAiB,CAAC,CAAC;SACzC;KACF;IACD,OAAO,GAAG,CAAC;AACb,CAAC;AAnCD,wDAmCC"} \ No newline at end of file diff --git a/node_modules/mongodb-connection-string-url/node_modules/tr46/LICENSE.md b/node_modules/mongodb-connection-string-url/node_modules/tr46/LICENSE.md new file mode 100644 index 000000000..62c0de28a --- /dev/null +++ b/node_modules/mongodb-connection-string-url/node_modules/tr46/LICENSE.md @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sebastian Mayr + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/mongodb-connection-string-url/node_modules/tr46/README.md b/node_modules/mongodb-connection-string-url/node_modules/tr46/README.md new file mode 100644 index 000000000..1df7915b7 --- /dev/null +++ b/node_modules/mongodb-connection-string-url/node_modules/tr46/README.md @@ -0,0 +1,78 @@ +# tr46 + +An JavaScript implementation of [Unicode Technical Standard #46: Unicode IDNA Compatibility Processing](https://unicode.org/reports/tr46/). + +## Installation + +[Node.js](http://nodejs.org) ≥ 12 is required. To install, type this at the command line: + +```shell +npm install tr46 +# or +yarn add tr46 +``` + +## API + +### `toASCII(domainName[, options])` + +Converts a string of Unicode symbols to a case-folded Punycode string of ASCII symbols. + +Available options: + +* [`checkBidi`](#checkBidi) +* [`checkHyphens`](#checkHyphens) +* [`checkJoiners`](#checkJoiners) +* [`processingOption`](#processingOption) +* [`useSTD3ASCIIRules`](#useSTD3ASCIIRules) +* [`verifyDNSLength`](#verifyDNSLength) + +### `toUnicode(domainName[, options])` + +Converts a case-folded Punycode string of ASCII symbols to a string of Unicode symbols. + +Available options: + +* [`checkBidi`](#checkBidi) +* [`checkHyphens`](#checkHyphens) +* [`checkJoiners`](#checkJoiners) +* [`processingOption`](#processingOption) +* [`useSTD3ASCIIRules`](#useSTD3ASCIIRules) + +## Options + +### `checkBidi` + +Type: `boolean` +Default value: `false` +When set to `true`, any bi-directional text within the input will be checked for validation. + +### `checkHyphens` + +Type: `boolean` +Default value: `false` +When set to `true`, the positions of any hyphen characters within the input will be checked for validation. + +### `checkJoiners` + +Type: `boolean` +Default value: `false` +When set to `true`, any word joiner characters within the input will be checked for validation. + +### `processingOption` + +Type: `string` +Default value: `"nontransitional"` +When set to `"transitional"`, symbols within the input will be validated according to the older IDNA2003 protocol. When set to `"nontransitional"`, the current IDNA2008 protocol will be used. + +### `useSTD3ASCIIRules` + +Type: `boolean` +Default value: `false` +When set to `true`, input will be validated according to [STD3 Rules](http://unicode.org/reports/tr46/#STD3_Rules). + +### `verifyDNSLength` + +Type: `boolean` +Default value: `false` +When set to `true`, the length of each DNS label within the input will be checked for validation. diff --git a/node_modules/mongodb-connection-string-url/node_modules/tr46/index.js b/node_modules/mongodb-connection-string-url/node_modules/tr46/index.js new file mode 100644 index 000000000..7ce053272 --- /dev/null +++ b/node_modules/mongodb-connection-string-url/node_modules/tr46/index.js @@ -0,0 +1,298 @@ +"use strict"; + +const punycode = require("punycode"); +const regexes = require("./lib/regexes.js"); +const mappingTable = require("./lib/mappingTable.json"); +const { STATUS_MAPPING } = require("./lib/statusMapping.js"); + +function containsNonASCII(str) { + return /[^\x00-\x7F]/u.test(str); +} + +function findStatus(val, { useSTD3ASCIIRules }) { + let start = 0; + let end = mappingTable.length - 1; + + while (start <= end) { + const mid = Math.floor((start + end) / 2); + + const target = mappingTable[mid]; + const min = Array.isArray(target[0]) ? target[0][0] : target[0]; + const max = Array.isArray(target[0]) ? target[0][1] : target[0]; + + if (min <= val && max >= val) { + if (useSTD3ASCIIRules && + (target[1] === STATUS_MAPPING.disallowed_STD3_valid || target[1] === STATUS_MAPPING.disallowed_STD3_mapped)) { + return [STATUS_MAPPING.disallowed, ...target.slice(2)]; + } else if (target[1] === STATUS_MAPPING.disallowed_STD3_valid) { + return [STATUS_MAPPING.valid, ...target.slice(2)]; + } else if (target[1] === STATUS_MAPPING.disallowed_STD3_mapped) { + return [STATUS_MAPPING.mapped, ...target.slice(2)]; + } + + return target.slice(1); + } else if (min > val) { + end = mid - 1; + } else { + start = mid + 1; + } + } + + return null; +} + +function mapChars(domainName, { useSTD3ASCIIRules, processingOption }) { + let hasError = false; + let processed = ""; + + for (const ch of domainName) { + const [status, mapping] = findStatus(ch.codePointAt(0), { useSTD3ASCIIRules }); + + switch (status) { + case STATUS_MAPPING.disallowed: + hasError = true; + processed += ch; + break; + case STATUS_MAPPING.ignored: + break; + case STATUS_MAPPING.mapped: + processed += mapping; + break; + case STATUS_MAPPING.deviation: + if (processingOption === "transitional") { + processed += mapping; + } else { + processed += ch; + } + break; + case STATUS_MAPPING.valid: + processed += ch; + break; + } + } + + return { + string: processed, + error: hasError + }; +} + +function validateLabel(label, { checkHyphens, checkBidi, checkJoiners, processingOption, useSTD3ASCIIRules }) { + if (label.normalize("NFC") !== label) { + return false; + } + + const codePoints = Array.from(label); + + if (checkHyphens) { + if ((codePoints[2] === "-" && codePoints[3] === "-") || + (label.startsWith("-") || label.endsWith("-"))) { + return false; + } + } + + if (label.includes(".") || + (codePoints.length > 0 && regexes.combiningMarks.test(codePoints[0]))) { + return false; + } + + for (const ch of codePoints) { + const [status] = findStatus(ch.codePointAt(0), { useSTD3ASCIIRules }); + if ((processingOption === "transitional" && status !== STATUS_MAPPING.valid) || + (processingOption === "nontransitional" && + status !== STATUS_MAPPING.valid && status !== STATUS_MAPPING.deviation)) { + return false; + } + } + + // https://tools.ietf.org/html/rfc5892#appendix-A + if (checkJoiners) { + let last = 0; + for (const [i, ch] of codePoints.entries()) { + if (ch === "\u200C" || ch === "\u200D") { + if (i > 0) { + if (regexes.combiningClassVirama.test(codePoints[i - 1])) { + continue; + } + if (ch === "\u200C") { + // TODO: make this more efficient + const next = codePoints.indexOf("\u200C", i + 1); + const test = next < 0 ? codePoints.slice(last) : codePoints.slice(last, next); + if (regexes.validZWNJ.test(test.join(""))) { + last = i + 1; + continue; + } + } + } + return false; + } + } + } + + // https://tools.ietf.org/html/rfc5893#section-2 + if (checkBidi) { + let rtl; + + // 1 + if (regexes.bidiS1LTR.test(codePoints[0])) { + rtl = false; + } else if (regexes.bidiS1RTL.test(codePoints[0])) { + rtl = true; + } else { + return false; + } + + if (rtl) { + // 2-4 + if (!regexes.bidiS2.test(label) || + !regexes.bidiS3.test(label) || + (regexes.bidiS4EN.test(label) && regexes.bidiS4AN.test(label))) { + return false; + } + } else if (!regexes.bidiS5.test(label) || + !regexes.bidiS6.test(label)) { // 5-6 + return false; + } + } + + return true; +} + +function isBidiDomain(labels) { + const domain = labels.map(label => { + if (label.startsWith("xn--")) { + try { + return punycode.decode(label.substring(4)); + } catch (err) { + return ""; + } + } + return label; + }).join("."); + return regexes.bidiDomain.test(domain); +} + +function processing(domainName, options) { + const { processingOption } = options; + + // 1. Map. + let { string, error } = mapChars(domainName, options); + + // 2. Normalize. + string = string.normalize("NFC"); + + // 3. Break. + const labels = string.split("."); + const isBidi = isBidiDomain(labels); + + // 4. Convert/Validate. + for (const [i, origLabel] of labels.entries()) { + let label = origLabel; + let curProcessing = processingOption; + if (label.startsWith("xn--")) { + try { + label = punycode.decode(label.substring(4)); + labels[i] = label; + } catch (err) { + error = true; + continue; + } + curProcessing = "nontransitional"; + } + + // No need to validate if we already know there is an error. + if (error) { + continue; + } + const validation = validateLabel(label, { + ...options, + processingOption: curProcessing, + checkBidi: options.checkBidi && isBidi + }); + if (!validation) { + error = true; + } + } + + return { + string: labels.join("."), + error + }; +} + +function toASCII(domainName, { + checkHyphens = false, + checkBidi = false, + checkJoiners = false, + useSTD3ASCIIRules = false, + processingOption = "nontransitional", + verifyDNSLength = false +} = {}) { + if (processingOption !== "transitional" && processingOption !== "nontransitional") { + throw new RangeError("processingOption must be either transitional or nontransitional"); + } + + const result = processing(domainName, { + processingOption, + checkHyphens, + checkBidi, + checkJoiners, + useSTD3ASCIIRules + }); + let labels = result.string.split("."); + labels = labels.map(l => { + if (containsNonASCII(l)) { + try { + return `xn--${punycode.encode(l)}`; + } catch (e) { + result.error = true; + } + } + return l; + }); + + if (verifyDNSLength) { + const total = labels.join(".").length; + if (total > 253 || total === 0) { + result.error = true; + } + + for (let i = 0; i < labels.length; ++i) { + if (labels[i].length > 63 || labels[i].length === 0) { + result.error = true; + break; + } + } + } + + if (result.error) { + return null; + } + return labels.join("."); +} + +function toUnicode(domainName, { + checkHyphens = false, + checkBidi = false, + checkJoiners = false, + useSTD3ASCIIRules = false, + processingOption = "nontransitional" +} = {}) { + const result = processing(domainName, { + processingOption, + checkHyphens, + checkBidi, + checkJoiners, + useSTD3ASCIIRules + }); + + return { + domain: result.string, + error: result.error + }; +} + +module.exports = { + toASCII, + toUnicode +}; diff --git a/node_modules/mongodb-connection-string-url/node_modules/tr46/lib/mappingTable.json b/node_modules/mongodb-connection-string-url/node_modules/tr46/lib/mappingTable.json new file mode 100644 index 000000000..3d71a5eff --- /dev/null +++ b/node_modules/mongodb-connection-string-url/node_modules/tr46/lib/mappingTable.json @@ -0,0 +1 @@ +[[[0,44],4],[[45,46],2],[47,4],[[48,57],2],[[58,64],4],[65,1,"a"],[66,1,"b"],[67,1,"c"],[68,1,"d"],[69,1,"e"],[70,1,"f"],[71,1,"g"],[72,1,"h"],[73,1,"i"],[74,1,"j"],[75,1,"k"],[76,1,"l"],[77,1,"m"],[78,1,"n"],[79,1,"o"],[80,1,"p"],[81,1,"q"],[82,1,"r"],[83,1,"s"],[84,1,"t"],[85,1,"u"],[86,1,"v"],[87,1,"w"],[88,1,"x"],[89,1,"y"],[90,1,"z"],[[91,96],4],[[97,122],2],[[123,127],4],[[128,159],3],[160,5," "],[[161,167],2],[168,5," ̈"],[169,2],[170,1,"a"],[[171,172],2],[173,7],[174,2],[175,5," ̄"],[[176,177],2],[178,1,"2"],[179,1,"3"],[180,5," ́"],[181,1,"μ"],[182,2],[183,2],[184,5," ̧"],[185,1,"1"],[186,1,"o"],[187,2],[188,1,"1⁄4"],[189,1,"1⁄2"],[190,1,"3⁄4"],[191,2],[192,1,"à"],[193,1,"á"],[194,1,"â"],[195,1,"ã"],[196,1,"ä"],[197,1,"å"],[198,1,"æ"],[199,1,"ç"],[200,1,"è"],[201,1,"é"],[202,1,"ê"],[203,1,"ë"],[204,1,"ì"],[205,1,"í"],[206,1,"î"],[207,1,"ï"],[208,1,"ð"],[209,1,"ñ"],[210,1,"ò"],[211,1,"ó"],[212,1,"ô"],[213,1,"õ"],[214,1,"ö"],[215,2],[216,1,"ø"],[217,1,"ù"],[218,1,"ú"],[219,1,"û"],[220,1,"ü"],[221,1,"ý"],[222,1,"þ"],[223,6,"ss"],[[224,246],2],[247,2],[[248,255],2],[256,1,"ā"],[257,2],[258,1,"ă"],[259,2],[260,1,"ą"],[261,2],[262,1,"ć"],[263,2],[264,1,"ĉ"],[265,2],[266,1,"ċ"],[267,2],[268,1,"č"],[269,2],[270,1,"ď"],[271,2],[272,1,"đ"],[273,2],[274,1,"ē"],[275,2],[276,1,"ĕ"],[277,2],[278,1,"ė"],[279,2],[280,1,"ę"],[281,2],[282,1,"ě"],[283,2],[284,1,"ĝ"],[285,2],[286,1,"ğ"],[287,2],[288,1,"ġ"],[289,2],[290,1,"ģ"],[291,2],[292,1,"ĥ"],[293,2],[294,1,"ħ"],[295,2],[296,1,"ĩ"],[297,2],[298,1,"ī"],[299,2],[300,1,"ĭ"],[301,2],[302,1,"į"],[303,2],[304,1,"i̇"],[305,2],[[306,307],1,"ij"],[308,1,"ĵ"],[309,2],[310,1,"ķ"],[[311,312],2],[313,1,"ĺ"],[314,2],[315,1,"ļ"],[316,2],[317,1,"ľ"],[318,2],[[319,320],1,"l·"],[321,1,"ł"],[322,2],[323,1,"ń"],[324,2],[325,1,"ņ"],[326,2],[327,1,"ň"],[328,2],[329,1,"ʼn"],[330,1,"ŋ"],[331,2],[332,1,"ō"],[333,2],[334,1,"ŏ"],[335,2],[336,1,"ő"],[337,2],[338,1,"œ"],[339,2],[340,1,"ŕ"],[341,2],[342,1,"ŗ"],[343,2],[344,1,"ř"],[345,2],[346,1,"ś"],[347,2],[348,1,"ŝ"],[349,2],[350,1,"ş"],[351,2],[352,1,"š"],[353,2],[354,1,"ţ"],[355,2],[356,1,"ť"],[357,2],[358,1,"ŧ"],[359,2],[360,1,"ũ"],[361,2],[362,1,"ū"],[363,2],[364,1,"ŭ"],[365,2],[366,1,"ů"],[367,2],[368,1,"ű"],[369,2],[370,1,"ų"],[371,2],[372,1,"ŵ"],[373,2],[374,1,"ŷ"],[375,2],[376,1,"ÿ"],[377,1,"ź"],[378,2],[379,1,"ż"],[380,2],[381,1,"ž"],[382,2],[383,1,"s"],[384,2],[385,1,"ɓ"],[386,1,"ƃ"],[387,2],[388,1,"ƅ"],[389,2],[390,1,"ɔ"],[391,1,"ƈ"],[392,2],[393,1,"ɖ"],[394,1,"ɗ"],[395,1,"ƌ"],[[396,397],2],[398,1,"ǝ"],[399,1,"ə"],[400,1,"ɛ"],[401,1,"ƒ"],[402,2],[403,1,"ɠ"],[404,1,"ɣ"],[405,2],[406,1,"ɩ"],[407,1,"ɨ"],[408,1,"ƙ"],[[409,411],2],[412,1,"ɯ"],[413,1,"ɲ"],[414,2],[415,1,"ɵ"],[416,1,"ơ"],[417,2],[418,1,"ƣ"],[419,2],[420,1,"ƥ"],[421,2],[422,1,"ʀ"],[423,1,"ƨ"],[424,2],[425,1,"ʃ"],[[426,427],2],[428,1,"ƭ"],[429,2],[430,1,"ʈ"],[431,1,"ư"],[432,2],[433,1,"ʊ"],[434,1,"ʋ"],[435,1,"ƴ"],[436,2],[437,1,"ƶ"],[438,2],[439,1,"ʒ"],[440,1,"ƹ"],[[441,443],2],[444,1,"ƽ"],[[445,451],2],[[452,454],1,"dž"],[[455,457],1,"lj"],[[458,460],1,"nj"],[461,1,"ǎ"],[462,2],[463,1,"ǐ"],[464,2],[465,1,"ǒ"],[466,2],[467,1,"ǔ"],[468,2],[469,1,"ǖ"],[470,2],[471,1,"ǘ"],[472,2],[473,1,"ǚ"],[474,2],[475,1,"ǜ"],[[476,477],2],[478,1,"ǟ"],[479,2],[480,1,"ǡ"],[481,2],[482,1,"ǣ"],[483,2],[484,1,"ǥ"],[485,2],[486,1,"ǧ"],[487,2],[488,1,"ǩ"],[489,2],[490,1,"ǫ"],[491,2],[492,1,"ǭ"],[493,2],[494,1,"ǯ"],[[495,496],2],[[497,499],1,"dz"],[500,1,"ǵ"],[501,2],[502,1,"ƕ"],[503,1,"ƿ"],[504,1,"ǹ"],[505,2],[506,1,"ǻ"],[507,2],[508,1,"ǽ"],[509,2],[510,1,"ǿ"],[511,2],[512,1,"ȁ"],[513,2],[514,1,"ȃ"],[515,2],[516,1,"ȅ"],[517,2],[518,1,"ȇ"],[519,2],[520,1,"ȉ"],[521,2],[522,1,"ȋ"],[523,2],[524,1,"ȍ"],[525,2],[526,1,"ȏ"],[527,2],[528,1,"ȑ"],[529,2],[530,1,"ȓ"],[531,2],[532,1,"ȕ"],[533,2],[534,1,"ȗ"],[535,2],[536,1,"ș"],[537,2],[538,1,"ț"],[539,2],[540,1,"ȝ"],[541,2],[542,1,"ȟ"],[543,2],[544,1,"ƞ"],[545,2],[546,1,"ȣ"],[547,2],[548,1,"ȥ"],[549,2],[550,1,"ȧ"],[551,2],[552,1,"ȩ"],[553,2],[554,1,"ȫ"],[555,2],[556,1,"ȭ"],[557,2],[558,1,"ȯ"],[559,2],[560,1,"ȱ"],[561,2],[562,1,"ȳ"],[563,2],[[564,566],2],[[567,569],2],[570,1,"ⱥ"],[571,1,"ȼ"],[572,2],[573,1,"ƚ"],[574,1,"ⱦ"],[[575,576],2],[577,1,"ɂ"],[578,2],[579,1,"ƀ"],[580,1,"ʉ"],[581,1,"ʌ"],[582,1,"ɇ"],[583,2],[584,1,"ɉ"],[585,2],[586,1,"ɋ"],[587,2],[588,1,"ɍ"],[589,2],[590,1,"ɏ"],[591,2],[[592,680],2],[[681,685],2],[[686,687],2],[688,1,"h"],[689,1,"ɦ"],[690,1,"j"],[691,1,"r"],[692,1,"ɹ"],[693,1,"ɻ"],[694,1,"ʁ"],[695,1,"w"],[696,1,"y"],[[697,705],2],[[706,709],2],[[710,721],2],[[722,727],2],[728,5," ̆"],[729,5," ̇"],[730,5," ̊"],[731,5," ̨"],[732,5," ̃"],[733,5," ̋"],[734,2],[735,2],[736,1,"ɣ"],[737,1,"l"],[738,1,"s"],[739,1,"x"],[740,1,"ʕ"],[[741,745],2],[[746,747],2],[748,2],[749,2],[750,2],[[751,767],2],[[768,831],2],[832,1,"̀"],[833,1,"́"],[834,2],[835,1,"̓"],[836,1,"̈́"],[837,1,"ι"],[[838,846],2],[847,7],[[848,855],2],[[856,860],2],[[861,863],2],[[864,865],2],[866,2],[[867,879],2],[880,1,"ͱ"],[881,2],[882,1,"ͳ"],[883,2],[884,1,"ʹ"],[885,2],[886,1,"ͷ"],[887,2],[[888,889],3],[890,5," ι"],[[891,893],2],[894,5,";"],[895,1,"ϳ"],[[896,899],3],[900,5," ́"],[901,5," ̈́"],[902,1,"ά"],[903,1,"·"],[904,1,"έ"],[905,1,"ή"],[906,1,"ί"],[907,3],[908,1,"ό"],[909,3],[910,1,"ύ"],[911,1,"ώ"],[912,2],[913,1,"α"],[914,1,"β"],[915,1,"γ"],[916,1,"δ"],[917,1,"ε"],[918,1,"ζ"],[919,1,"η"],[920,1,"θ"],[921,1,"ι"],[922,1,"κ"],[923,1,"λ"],[924,1,"μ"],[925,1,"ν"],[926,1,"ξ"],[927,1,"ο"],[928,1,"π"],[929,1,"ρ"],[930,3],[931,1,"σ"],[932,1,"τ"],[933,1,"υ"],[934,1,"φ"],[935,1,"χ"],[936,1,"ψ"],[937,1,"ω"],[938,1,"ϊ"],[939,1,"ϋ"],[[940,961],2],[962,6,"σ"],[[963,974],2],[975,1,"ϗ"],[976,1,"β"],[977,1,"θ"],[978,1,"υ"],[979,1,"ύ"],[980,1,"ϋ"],[981,1,"φ"],[982,1,"π"],[983,2],[984,1,"ϙ"],[985,2],[986,1,"ϛ"],[987,2],[988,1,"ϝ"],[989,2],[990,1,"ϟ"],[991,2],[992,1,"ϡ"],[993,2],[994,1,"ϣ"],[995,2],[996,1,"ϥ"],[997,2],[998,1,"ϧ"],[999,2],[1000,1,"ϩ"],[1001,2],[1002,1,"ϫ"],[1003,2],[1004,1,"ϭ"],[1005,2],[1006,1,"ϯ"],[1007,2],[1008,1,"κ"],[1009,1,"ρ"],[1010,1,"σ"],[1011,2],[1012,1,"θ"],[1013,1,"ε"],[1014,2],[1015,1,"ϸ"],[1016,2],[1017,1,"σ"],[1018,1,"ϻ"],[1019,2],[1020,2],[1021,1,"ͻ"],[1022,1,"ͼ"],[1023,1,"ͽ"],[1024,1,"ѐ"],[1025,1,"ё"],[1026,1,"ђ"],[1027,1,"ѓ"],[1028,1,"є"],[1029,1,"ѕ"],[1030,1,"і"],[1031,1,"ї"],[1032,1,"ј"],[1033,1,"љ"],[1034,1,"њ"],[1035,1,"ћ"],[1036,1,"ќ"],[1037,1,"ѝ"],[1038,1,"ў"],[1039,1,"џ"],[1040,1,"а"],[1041,1,"б"],[1042,1,"в"],[1043,1,"г"],[1044,1,"д"],[1045,1,"е"],[1046,1,"ж"],[1047,1,"з"],[1048,1,"и"],[1049,1,"й"],[1050,1,"к"],[1051,1,"л"],[1052,1,"м"],[1053,1,"н"],[1054,1,"о"],[1055,1,"п"],[1056,1,"р"],[1057,1,"с"],[1058,1,"т"],[1059,1,"у"],[1060,1,"ф"],[1061,1,"х"],[1062,1,"ц"],[1063,1,"ч"],[1064,1,"ш"],[1065,1,"щ"],[1066,1,"ъ"],[1067,1,"ы"],[1068,1,"ь"],[1069,1,"э"],[1070,1,"ю"],[1071,1,"я"],[[1072,1103],2],[1104,2],[[1105,1116],2],[1117,2],[[1118,1119],2],[1120,1,"ѡ"],[1121,2],[1122,1,"ѣ"],[1123,2],[1124,1,"ѥ"],[1125,2],[1126,1,"ѧ"],[1127,2],[1128,1,"ѩ"],[1129,2],[1130,1,"ѫ"],[1131,2],[1132,1,"ѭ"],[1133,2],[1134,1,"ѯ"],[1135,2],[1136,1,"ѱ"],[1137,2],[1138,1,"ѳ"],[1139,2],[1140,1,"ѵ"],[1141,2],[1142,1,"ѷ"],[1143,2],[1144,1,"ѹ"],[1145,2],[1146,1,"ѻ"],[1147,2],[1148,1,"ѽ"],[1149,2],[1150,1,"ѿ"],[1151,2],[1152,1,"ҁ"],[1153,2],[1154,2],[[1155,1158],2],[1159,2],[[1160,1161],2],[1162,1,"ҋ"],[1163,2],[1164,1,"ҍ"],[1165,2],[1166,1,"ҏ"],[1167,2],[1168,1,"ґ"],[1169,2],[1170,1,"ғ"],[1171,2],[1172,1,"ҕ"],[1173,2],[1174,1,"җ"],[1175,2],[1176,1,"ҙ"],[1177,2],[1178,1,"қ"],[1179,2],[1180,1,"ҝ"],[1181,2],[1182,1,"ҟ"],[1183,2],[1184,1,"ҡ"],[1185,2],[1186,1,"ң"],[1187,2],[1188,1,"ҥ"],[1189,2],[1190,1,"ҧ"],[1191,2],[1192,1,"ҩ"],[1193,2],[1194,1,"ҫ"],[1195,2],[1196,1,"ҭ"],[1197,2],[1198,1,"ү"],[1199,2],[1200,1,"ұ"],[1201,2],[1202,1,"ҳ"],[1203,2],[1204,1,"ҵ"],[1205,2],[1206,1,"ҷ"],[1207,2],[1208,1,"ҹ"],[1209,2],[1210,1,"һ"],[1211,2],[1212,1,"ҽ"],[1213,2],[1214,1,"ҿ"],[1215,2],[1216,3],[1217,1,"ӂ"],[1218,2],[1219,1,"ӄ"],[1220,2],[1221,1,"ӆ"],[1222,2],[1223,1,"ӈ"],[1224,2],[1225,1,"ӊ"],[1226,2],[1227,1,"ӌ"],[1228,2],[1229,1,"ӎ"],[1230,2],[1231,2],[1232,1,"ӑ"],[1233,2],[1234,1,"ӓ"],[1235,2],[1236,1,"ӕ"],[1237,2],[1238,1,"ӗ"],[1239,2],[1240,1,"ә"],[1241,2],[1242,1,"ӛ"],[1243,2],[1244,1,"ӝ"],[1245,2],[1246,1,"ӟ"],[1247,2],[1248,1,"ӡ"],[1249,2],[1250,1,"ӣ"],[1251,2],[1252,1,"ӥ"],[1253,2],[1254,1,"ӧ"],[1255,2],[1256,1,"ө"],[1257,2],[1258,1,"ӫ"],[1259,2],[1260,1,"ӭ"],[1261,2],[1262,1,"ӯ"],[1263,2],[1264,1,"ӱ"],[1265,2],[1266,1,"ӳ"],[1267,2],[1268,1,"ӵ"],[1269,2],[1270,1,"ӷ"],[1271,2],[1272,1,"ӹ"],[1273,2],[1274,1,"ӻ"],[1275,2],[1276,1,"ӽ"],[1277,2],[1278,1,"ӿ"],[1279,2],[1280,1,"ԁ"],[1281,2],[1282,1,"ԃ"],[1283,2],[1284,1,"ԅ"],[1285,2],[1286,1,"ԇ"],[1287,2],[1288,1,"ԉ"],[1289,2],[1290,1,"ԋ"],[1291,2],[1292,1,"ԍ"],[1293,2],[1294,1,"ԏ"],[1295,2],[1296,1,"ԑ"],[1297,2],[1298,1,"ԓ"],[1299,2],[1300,1,"ԕ"],[1301,2],[1302,1,"ԗ"],[1303,2],[1304,1,"ԙ"],[1305,2],[1306,1,"ԛ"],[1307,2],[1308,1,"ԝ"],[1309,2],[1310,1,"ԟ"],[1311,2],[1312,1,"ԡ"],[1313,2],[1314,1,"ԣ"],[1315,2],[1316,1,"ԥ"],[1317,2],[1318,1,"ԧ"],[1319,2],[1320,1,"ԩ"],[1321,2],[1322,1,"ԫ"],[1323,2],[1324,1,"ԭ"],[1325,2],[1326,1,"ԯ"],[1327,2],[1328,3],[1329,1,"ա"],[1330,1,"բ"],[1331,1,"գ"],[1332,1,"դ"],[1333,1,"ե"],[1334,1,"զ"],[1335,1,"է"],[1336,1,"ը"],[1337,1,"թ"],[1338,1,"ժ"],[1339,1,"ի"],[1340,1,"լ"],[1341,1,"խ"],[1342,1,"ծ"],[1343,1,"կ"],[1344,1,"հ"],[1345,1,"ձ"],[1346,1,"ղ"],[1347,1,"ճ"],[1348,1,"մ"],[1349,1,"յ"],[1350,1,"ն"],[1351,1,"շ"],[1352,1,"ո"],[1353,1,"չ"],[1354,1,"պ"],[1355,1,"ջ"],[1356,1,"ռ"],[1357,1,"ս"],[1358,1,"վ"],[1359,1,"տ"],[1360,1,"ր"],[1361,1,"ց"],[1362,1,"ւ"],[1363,1,"փ"],[1364,1,"ք"],[1365,1,"օ"],[1366,1,"ֆ"],[[1367,1368],3],[1369,2],[[1370,1375],2],[1376,2],[[1377,1414],2],[1415,1,"եւ"],[1416,2],[1417,2],[1418,2],[[1419,1420],3],[[1421,1422],2],[1423,2],[1424,3],[[1425,1441],2],[1442,2],[[1443,1455],2],[[1456,1465],2],[1466,2],[[1467,1469],2],[1470,2],[1471,2],[1472,2],[[1473,1474],2],[1475,2],[1476,2],[1477,2],[1478,2],[1479,2],[[1480,1487],3],[[1488,1514],2],[[1515,1518],3],[1519,2],[[1520,1524],2],[[1525,1535],3],[[1536,1539],3],[1540,3],[1541,3],[[1542,1546],2],[1547,2],[1548,2],[[1549,1551],2],[[1552,1557],2],[[1558,1562],2],[1563,2],[1564,3],[1565,2],[1566,2],[1567,2],[1568,2],[[1569,1594],2],[[1595,1599],2],[1600,2],[[1601,1618],2],[[1619,1621],2],[[1622,1624],2],[[1625,1630],2],[1631,2],[[1632,1641],2],[[1642,1645],2],[[1646,1647],2],[[1648,1652],2],[1653,1,"اٴ"],[1654,1,"وٴ"],[1655,1,"ۇٴ"],[1656,1,"يٴ"],[[1657,1719],2],[[1720,1721],2],[[1722,1726],2],[1727,2],[[1728,1742],2],[1743,2],[[1744,1747],2],[1748,2],[[1749,1756],2],[1757,3],[1758,2],[[1759,1768],2],[1769,2],[[1770,1773],2],[[1774,1775],2],[[1776,1785],2],[[1786,1790],2],[1791,2],[[1792,1805],2],[1806,3],[1807,3],[[1808,1836],2],[[1837,1839],2],[[1840,1866],2],[[1867,1868],3],[[1869,1871],2],[[1872,1901],2],[[1902,1919],2],[[1920,1968],2],[1969,2],[[1970,1983],3],[[1984,2037],2],[[2038,2042],2],[[2043,2044],3],[2045,2],[[2046,2047],2],[[2048,2093],2],[[2094,2095],3],[[2096,2110],2],[2111,3],[[2112,2139],2],[[2140,2141],3],[2142,2],[2143,3],[[2144,2154],2],[[2155,2159],3],[[2160,2183],2],[2184,2],[[2185,2190],2],[2191,3],[[2192,2193],3],[[2194,2199],3],[[2200,2207],2],[2208,2],[2209,2],[[2210,2220],2],[[2221,2226],2],[[2227,2228],2],[2229,2],[[2230,2237],2],[[2238,2247],2],[[2248,2258],2],[2259,2],[[2260,2273],2],[2274,3],[2275,2],[[2276,2302],2],[2303,2],[2304,2],[[2305,2307],2],[2308,2],[[2309,2361],2],[[2362,2363],2],[[2364,2381],2],[2382,2],[2383,2],[[2384,2388],2],[2389,2],[[2390,2391],2],[2392,1,"क़"],[2393,1,"ख़"],[2394,1,"ग़"],[2395,1,"ज़"],[2396,1,"ड़"],[2397,1,"ढ़"],[2398,1,"फ़"],[2399,1,"य़"],[[2400,2403],2],[[2404,2405],2],[[2406,2415],2],[2416,2],[[2417,2418],2],[[2419,2423],2],[2424,2],[[2425,2426],2],[[2427,2428],2],[2429,2],[[2430,2431],2],[2432,2],[[2433,2435],2],[2436,3],[[2437,2444],2],[[2445,2446],3],[[2447,2448],2],[[2449,2450],3],[[2451,2472],2],[2473,3],[[2474,2480],2],[2481,3],[2482,2],[[2483,2485],3],[[2486,2489],2],[[2490,2491],3],[2492,2],[2493,2],[[2494,2500],2],[[2501,2502],3],[[2503,2504],2],[[2505,2506],3],[[2507,2509],2],[2510,2],[[2511,2518],3],[2519,2],[[2520,2523],3],[2524,1,"ড়"],[2525,1,"ঢ়"],[2526,3],[2527,1,"য়"],[[2528,2531],2],[[2532,2533],3],[[2534,2545],2],[[2546,2554],2],[2555,2],[2556,2],[2557,2],[2558,2],[[2559,2560],3],[2561,2],[2562,2],[2563,2],[2564,3],[[2565,2570],2],[[2571,2574],3],[[2575,2576],2],[[2577,2578],3],[[2579,2600],2],[2601,3],[[2602,2608],2],[2609,3],[2610,2],[2611,1,"ਲ਼"],[2612,3],[2613,2],[2614,1,"ਸ਼"],[2615,3],[[2616,2617],2],[[2618,2619],3],[2620,2],[2621,3],[[2622,2626],2],[[2627,2630],3],[[2631,2632],2],[[2633,2634],3],[[2635,2637],2],[[2638,2640],3],[2641,2],[[2642,2648],3],[2649,1,"ਖ਼"],[2650,1,"ਗ਼"],[2651,1,"ਜ਼"],[2652,2],[2653,3],[2654,1,"ਫ਼"],[[2655,2661],3],[[2662,2676],2],[2677,2],[2678,2],[[2679,2688],3],[[2689,2691],2],[2692,3],[[2693,2699],2],[2700,2],[2701,2],[2702,3],[[2703,2705],2],[2706,3],[[2707,2728],2],[2729,3],[[2730,2736],2],[2737,3],[[2738,2739],2],[2740,3],[[2741,2745],2],[[2746,2747],3],[[2748,2757],2],[2758,3],[[2759,2761],2],[2762,3],[[2763,2765],2],[[2766,2767],3],[2768,2],[[2769,2783],3],[2784,2],[[2785,2787],2],[[2788,2789],3],[[2790,2799],2],[2800,2],[2801,2],[[2802,2808],3],[2809,2],[[2810,2815],2],[2816,3],[[2817,2819],2],[2820,3],[[2821,2828],2],[[2829,2830],3],[[2831,2832],2],[[2833,2834],3],[[2835,2856],2],[2857,3],[[2858,2864],2],[2865,3],[[2866,2867],2],[2868,3],[2869,2],[[2870,2873],2],[[2874,2875],3],[[2876,2883],2],[2884,2],[[2885,2886],3],[[2887,2888],2],[[2889,2890],3],[[2891,2893],2],[[2894,2900],3],[2901,2],[[2902,2903],2],[[2904,2907],3],[2908,1,"ଡ଼"],[2909,1,"ଢ଼"],[2910,3],[[2911,2913],2],[[2914,2915],2],[[2916,2917],3],[[2918,2927],2],[2928,2],[2929,2],[[2930,2935],2],[[2936,2945],3],[[2946,2947],2],[2948,3],[[2949,2954],2],[[2955,2957],3],[[2958,2960],2],[2961,3],[[2962,2965],2],[[2966,2968],3],[[2969,2970],2],[2971,3],[2972,2],[2973,3],[[2974,2975],2],[[2976,2978],3],[[2979,2980],2],[[2981,2983],3],[[2984,2986],2],[[2987,2989],3],[[2990,2997],2],[2998,2],[[2999,3001],2],[[3002,3005],3],[[3006,3010],2],[[3011,3013],3],[[3014,3016],2],[3017,3],[[3018,3021],2],[[3022,3023],3],[3024,2],[[3025,3030],3],[3031,2],[[3032,3045],3],[3046,2],[[3047,3055],2],[[3056,3058],2],[[3059,3066],2],[[3067,3071],3],[3072,2],[[3073,3075],2],[3076,2],[[3077,3084],2],[3085,3],[[3086,3088],2],[3089,3],[[3090,3112],2],[3113,3],[[3114,3123],2],[3124,2],[[3125,3129],2],[[3130,3131],3],[3132,2],[3133,2],[[3134,3140],2],[3141,3],[[3142,3144],2],[3145,3],[[3146,3149],2],[[3150,3156],3],[[3157,3158],2],[3159,3],[[3160,3161],2],[3162,2],[[3163,3164],3],[3165,2],[[3166,3167],3],[[3168,3169],2],[[3170,3171],2],[[3172,3173],3],[[3174,3183],2],[[3184,3190],3],[3191,2],[[3192,3199],2],[3200,2],[3201,2],[[3202,3203],2],[3204,2],[[3205,3212],2],[3213,3],[[3214,3216],2],[3217,3],[[3218,3240],2],[3241,3],[[3242,3251],2],[3252,3],[[3253,3257],2],[[3258,3259],3],[[3260,3261],2],[[3262,3268],2],[3269,3],[[3270,3272],2],[3273,3],[[3274,3277],2],[[3278,3284],3],[[3285,3286],2],[[3287,3292],3],[3293,2],[3294,2],[3295,3],[[3296,3297],2],[[3298,3299],2],[[3300,3301],3],[[3302,3311],2],[3312,3],[[3313,3314],2],[[3315,3327],3],[3328,2],[3329,2],[[3330,3331],2],[3332,2],[[3333,3340],2],[3341,3],[[3342,3344],2],[3345,3],[[3346,3368],2],[3369,2],[[3370,3385],2],[3386,2],[[3387,3388],2],[3389,2],[[3390,3395],2],[3396,2],[3397,3],[[3398,3400],2],[3401,3],[[3402,3405],2],[3406,2],[3407,2],[[3408,3411],3],[[3412,3414],2],[3415,2],[[3416,3422],2],[3423,2],[[3424,3425],2],[[3426,3427],2],[[3428,3429],3],[[3430,3439],2],[[3440,3445],2],[[3446,3448],2],[3449,2],[[3450,3455],2],[3456,3],[3457,2],[[3458,3459],2],[3460,3],[[3461,3478],2],[[3479,3481],3],[[3482,3505],2],[3506,3],[[3507,3515],2],[3516,3],[3517,2],[[3518,3519],3],[[3520,3526],2],[[3527,3529],3],[3530,2],[[3531,3534],3],[[3535,3540],2],[3541,3],[3542,2],[3543,3],[[3544,3551],2],[[3552,3557],3],[[3558,3567],2],[[3568,3569],3],[[3570,3571],2],[3572,2],[[3573,3584],3],[[3585,3634],2],[3635,1,"ํา"],[[3636,3642],2],[[3643,3646],3],[3647,2],[[3648,3662],2],[3663,2],[[3664,3673],2],[[3674,3675],2],[[3676,3712],3],[[3713,3714],2],[3715,3],[3716,2],[3717,3],[3718,2],[[3719,3720],2],[3721,2],[3722,2],[3723,3],[3724,2],[3725,2],[[3726,3731],2],[[3732,3735],2],[3736,2],[[3737,3743],2],[3744,2],[[3745,3747],2],[3748,3],[3749,2],[3750,3],[3751,2],[[3752,3753],2],[[3754,3755],2],[3756,2],[[3757,3762],2],[3763,1,"ໍາ"],[[3764,3769],2],[3770,2],[[3771,3773],2],[[3774,3775],3],[[3776,3780],2],[3781,3],[3782,2],[3783,3],[[3784,3789],2],[[3790,3791],3],[[3792,3801],2],[[3802,3803],3],[3804,1,"ຫນ"],[3805,1,"ຫມ"],[[3806,3807],2],[[3808,3839],3],[3840,2],[[3841,3850],2],[3851,2],[3852,1,"་"],[[3853,3863],2],[[3864,3865],2],[[3866,3871],2],[[3872,3881],2],[[3882,3892],2],[3893,2],[3894,2],[3895,2],[3896,2],[3897,2],[[3898,3901],2],[[3902,3906],2],[3907,1,"གྷ"],[[3908,3911],2],[3912,3],[[3913,3916],2],[3917,1,"ཌྷ"],[[3918,3921],2],[3922,1,"དྷ"],[[3923,3926],2],[3927,1,"བྷ"],[[3928,3931],2],[3932,1,"ཛྷ"],[[3933,3944],2],[3945,1,"ཀྵ"],[3946,2],[[3947,3948],2],[[3949,3952],3],[[3953,3954],2],[3955,1,"ཱི"],[3956,2],[3957,1,"ཱུ"],[3958,1,"ྲྀ"],[3959,1,"ྲཱྀ"],[3960,1,"ླྀ"],[3961,1,"ླཱྀ"],[[3962,3968],2],[3969,1,"ཱྀ"],[[3970,3972],2],[3973,2],[[3974,3979],2],[[3980,3983],2],[[3984,3986],2],[3987,1,"ྒྷ"],[[3988,3989],2],[3990,2],[3991,2],[3992,3],[[3993,3996],2],[3997,1,"ྜྷ"],[[3998,4001],2],[4002,1,"ྡྷ"],[[4003,4006],2],[4007,1,"ྦྷ"],[[4008,4011],2],[4012,1,"ྫྷ"],[4013,2],[[4014,4016],2],[[4017,4023],2],[4024,2],[4025,1,"ྐྵ"],[[4026,4028],2],[4029,3],[[4030,4037],2],[4038,2],[[4039,4044],2],[4045,3],[4046,2],[4047,2],[[4048,4049],2],[[4050,4052],2],[[4053,4056],2],[[4057,4058],2],[[4059,4095],3],[[4096,4129],2],[4130,2],[[4131,4135],2],[4136,2],[[4137,4138],2],[4139,2],[[4140,4146],2],[[4147,4149],2],[[4150,4153],2],[[4154,4159],2],[[4160,4169],2],[[4170,4175],2],[[4176,4185],2],[[4186,4249],2],[[4250,4253],2],[[4254,4255],2],[[4256,4293],3],[4294,3],[4295,1,"ⴧ"],[[4296,4300],3],[4301,1,"ⴭ"],[[4302,4303],3],[[4304,4342],2],[[4343,4344],2],[[4345,4346],2],[4347,2],[4348,1,"ნ"],[[4349,4351],2],[[4352,4441],2],[[4442,4446],2],[[4447,4448],3],[[4449,4514],2],[[4515,4519],2],[[4520,4601],2],[[4602,4607],2],[[4608,4614],2],[4615,2],[[4616,4678],2],[4679,2],[4680,2],[4681,3],[[4682,4685],2],[[4686,4687],3],[[4688,4694],2],[4695,3],[4696,2],[4697,3],[[4698,4701],2],[[4702,4703],3],[[4704,4742],2],[4743,2],[4744,2],[4745,3],[[4746,4749],2],[[4750,4751],3],[[4752,4782],2],[4783,2],[4784,2],[4785,3],[[4786,4789],2],[[4790,4791],3],[[4792,4798],2],[4799,3],[4800,2],[4801,3],[[4802,4805],2],[[4806,4807],3],[[4808,4814],2],[4815,2],[[4816,4822],2],[4823,3],[[4824,4846],2],[4847,2],[[4848,4878],2],[4879,2],[4880,2],[4881,3],[[4882,4885],2],[[4886,4887],3],[[4888,4894],2],[4895,2],[[4896,4934],2],[4935,2],[[4936,4954],2],[[4955,4956],3],[[4957,4958],2],[4959,2],[4960,2],[[4961,4988],2],[[4989,4991],3],[[4992,5007],2],[[5008,5017],2],[[5018,5023],3],[[5024,5108],2],[5109,2],[[5110,5111],3],[5112,1,"Ᏸ"],[5113,1,"Ᏹ"],[5114,1,"Ᏺ"],[5115,1,"Ᏻ"],[5116,1,"Ᏼ"],[5117,1,"Ᏽ"],[[5118,5119],3],[5120,2],[[5121,5740],2],[[5741,5742],2],[[5743,5750],2],[[5751,5759],2],[5760,3],[[5761,5786],2],[[5787,5788],2],[[5789,5791],3],[[5792,5866],2],[[5867,5872],2],[[5873,5880],2],[[5881,5887],3],[[5888,5900],2],[5901,2],[[5902,5908],2],[5909,2],[[5910,5918],3],[5919,2],[[5920,5940],2],[[5941,5942],2],[[5943,5951],3],[[5952,5971],2],[[5972,5983],3],[[5984,5996],2],[5997,3],[[5998,6000],2],[6001,3],[[6002,6003],2],[[6004,6015],3],[[6016,6067],2],[[6068,6069],3],[[6070,6099],2],[[6100,6102],2],[6103,2],[[6104,6107],2],[6108,2],[6109,2],[[6110,6111],3],[[6112,6121],2],[[6122,6127],3],[[6128,6137],2],[[6138,6143],3],[[6144,6149],2],[6150,3],[[6151,6154],2],[[6155,6157],7],[6158,3],[6159,7],[[6160,6169],2],[[6170,6175],3],[[6176,6263],2],[6264,2],[[6265,6271],3],[[6272,6313],2],[6314,2],[[6315,6319],3],[[6320,6389],2],[[6390,6399],3],[[6400,6428],2],[[6429,6430],2],[6431,3],[[6432,6443],2],[[6444,6447],3],[[6448,6459],2],[[6460,6463],3],[6464,2],[[6465,6467],3],[[6468,6469],2],[[6470,6509],2],[[6510,6511],3],[[6512,6516],2],[[6517,6527],3],[[6528,6569],2],[[6570,6571],2],[[6572,6575],3],[[6576,6601],2],[[6602,6607],3],[[6608,6617],2],[6618,2],[[6619,6621],3],[[6622,6623],2],[[6624,6655],2],[[6656,6683],2],[[6684,6685],3],[[6686,6687],2],[[6688,6750],2],[6751,3],[[6752,6780],2],[[6781,6782],3],[[6783,6793],2],[[6794,6799],3],[[6800,6809],2],[[6810,6815],3],[[6816,6822],2],[6823,2],[[6824,6829],2],[[6830,6831],3],[[6832,6845],2],[6846,2],[[6847,6848],2],[[6849,6862],2],[[6863,6911],3],[[6912,6987],2],[6988,2],[[6989,6991],3],[[6992,7001],2],[[7002,7018],2],[[7019,7027],2],[[7028,7036],2],[[7037,7038],2],[7039,3],[[7040,7082],2],[[7083,7085],2],[[7086,7097],2],[[7098,7103],2],[[7104,7155],2],[[7156,7163],3],[[7164,7167],2],[[7168,7223],2],[[7224,7226],3],[[7227,7231],2],[[7232,7241],2],[[7242,7244],3],[[7245,7293],2],[[7294,7295],2],[7296,1,"в"],[7297,1,"д"],[7298,1,"о"],[7299,1,"с"],[[7300,7301],1,"т"],[7302,1,"ъ"],[7303,1,"ѣ"],[7304,1,"ꙋ"],[[7305,7311],3],[7312,1,"ა"],[7313,1,"ბ"],[7314,1,"გ"],[7315,1,"დ"],[7316,1,"ე"],[7317,1,"ვ"],[7318,1,"ზ"],[7319,1,"თ"],[7320,1,"ი"],[7321,1,"კ"],[7322,1,"ლ"],[7323,1,"მ"],[7324,1,"ნ"],[7325,1,"ო"],[7326,1,"პ"],[7327,1,"ჟ"],[7328,1,"რ"],[7329,1,"ს"],[7330,1,"ტ"],[7331,1,"უ"],[7332,1,"ფ"],[7333,1,"ქ"],[7334,1,"ღ"],[7335,1,"ყ"],[7336,1,"შ"],[7337,1,"ჩ"],[7338,1,"ც"],[7339,1,"ძ"],[7340,1,"წ"],[7341,1,"ჭ"],[7342,1,"ხ"],[7343,1,"ჯ"],[7344,1,"ჰ"],[7345,1,"ჱ"],[7346,1,"ჲ"],[7347,1,"ჳ"],[7348,1,"ჴ"],[7349,1,"ჵ"],[7350,1,"ჶ"],[7351,1,"ჷ"],[7352,1,"ჸ"],[7353,1,"ჹ"],[7354,1,"ჺ"],[[7355,7356],3],[7357,1,"ჽ"],[7358,1,"ჾ"],[7359,1,"ჿ"],[[7360,7367],2],[[7368,7375],3],[[7376,7378],2],[7379,2],[[7380,7410],2],[[7411,7414],2],[7415,2],[[7416,7417],2],[7418,2],[[7419,7423],3],[[7424,7467],2],[7468,1,"a"],[7469,1,"æ"],[7470,1,"b"],[7471,2],[7472,1,"d"],[7473,1,"e"],[7474,1,"ǝ"],[7475,1,"g"],[7476,1,"h"],[7477,1,"i"],[7478,1,"j"],[7479,1,"k"],[7480,1,"l"],[7481,1,"m"],[7482,1,"n"],[7483,2],[7484,1,"o"],[7485,1,"ȣ"],[7486,1,"p"],[7487,1,"r"],[7488,1,"t"],[7489,1,"u"],[7490,1,"w"],[7491,1,"a"],[7492,1,"ɐ"],[7493,1,"ɑ"],[7494,1,"ᴂ"],[7495,1,"b"],[7496,1,"d"],[7497,1,"e"],[7498,1,"ə"],[7499,1,"ɛ"],[7500,1,"ɜ"],[7501,1,"g"],[7502,2],[7503,1,"k"],[7504,1,"m"],[7505,1,"ŋ"],[7506,1,"o"],[7507,1,"ɔ"],[7508,1,"ᴖ"],[7509,1,"ᴗ"],[7510,1,"p"],[7511,1,"t"],[7512,1,"u"],[7513,1,"ᴝ"],[7514,1,"ɯ"],[7515,1,"v"],[7516,1,"ᴥ"],[7517,1,"β"],[7518,1,"γ"],[7519,1,"δ"],[7520,1,"φ"],[7521,1,"χ"],[7522,1,"i"],[7523,1,"r"],[7524,1,"u"],[7525,1,"v"],[7526,1,"β"],[7527,1,"γ"],[7528,1,"ρ"],[7529,1,"φ"],[7530,1,"χ"],[7531,2],[[7532,7543],2],[7544,1,"н"],[[7545,7578],2],[7579,1,"ɒ"],[7580,1,"c"],[7581,1,"ɕ"],[7582,1,"ð"],[7583,1,"ɜ"],[7584,1,"f"],[7585,1,"ɟ"],[7586,1,"ɡ"],[7587,1,"ɥ"],[7588,1,"ɨ"],[7589,1,"ɩ"],[7590,1,"ɪ"],[7591,1,"ᵻ"],[7592,1,"ʝ"],[7593,1,"ɭ"],[7594,1,"ᶅ"],[7595,1,"ʟ"],[7596,1,"ɱ"],[7597,1,"ɰ"],[7598,1,"ɲ"],[7599,1,"ɳ"],[7600,1,"ɴ"],[7601,1,"ɵ"],[7602,1,"ɸ"],[7603,1,"ʂ"],[7604,1,"ʃ"],[7605,1,"ƫ"],[7606,1,"ʉ"],[7607,1,"ʊ"],[7608,1,"ᴜ"],[7609,1,"ʋ"],[7610,1,"ʌ"],[7611,1,"z"],[7612,1,"ʐ"],[7613,1,"ʑ"],[7614,1,"ʒ"],[7615,1,"θ"],[[7616,7619],2],[[7620,7626],2],[[7627,7654],2],[[7655,7669],2],[[7670,7673],2],[7674,2],[7675,2],[7676,2],[7677,2],[[7678,7679],2],[7680,1,"ḁ"],[7681,2],[7682,1,"ḃ"],[7683,2],[7684,1,"ḅ"],[7685,2],[7686,1,"ḇ"],[7687,2],[7688,1,"ḉ"],[7689,2],[7690,1,"ḋ"],[7691,2],[7692,1,"ḍ"],[7693,2],[7694,1,"ḏ"],[7695,2],[7696,1,"ḑ"],[7697,2],[7698,1,"ḓ"],[7699,2],[7700,1,"ḕ"],[7701,2],[7702,1,"ḗ"],[7703,2],[7704,1,"ḙ"],[7705,2],[7706,1,"ḛ"],[7707,2],[7708,1,"ḝ"],[7709,2],[7710,1,"ḟ"],[7711,2],[7712,1,"ḡ"],[7713,2],[7714,1,"ḣ"],[7715,2],[7716,1,"ḥ"],[7717,2],[7718,1,"ḧ"],[7719,2],[7720,1,"ḩ"],[7721,2],[7722,1,"ḫ"],[7723,2],[7724,1,"ḭ"],[7725,2],[7726,1,"ḯ"],[7727,2],[7728,1,"ḱ"],[7729,2],[7730,1,"ḳ"],[7731,2],[7732,1,"ḵ"],[7733,2],[7734,1,"ḷ"],[7735,2],[7736,1,"ḹ"],[7737,2],[7738,1,"ḻ"],[7739,2],[7740,1,"ḽ"],[7741,2],[7742,1,"ḿ"],[7743,2],[7744,1,"ṁ"],[7745,2],[7746,1,"ṃ"],[7747,2],[7748,1,"ṅ"],[7749,2],[7750,1,"ṇ"],[7751,2],[7752,1,"ṉ"],[7753,2],[7754,1,"ṋ"],[7755,2],[7756,1,"ṍ"],[7757,2],[7758,1,"ṏ"],[7759,2],[7760,1,"ṑ"],[7761,2],[7762,1,"ṓ"],[7763,2],[7764,1,"ṕ"],[7765,2],[7766,1,"ṗ"],[7767,2],[7768,1,"ṙ"],[7769,2],[7770,1,"ṛ"],[7771,2],[7772,1,"ṝ"],[7773,2],[7774,1,"ṟ"],[7775,2],[7776,1,"ṡ"],[7777,2],[7778,1,"ṣ"],[7779,2],[7780,1,"ṥ"],[7781,2],[7782,1,"ṧ"],[7783,2],[7784,1,"ṩ"],[7785,2],[7786,1,"ṫ"],[7787,2],[7788,1,"ṭ"],[7789,2],[7790,1,"ṯ"],[7791,2],[7792,1,"ṱ"],[7793,2],[7794,1,"ṳ"],[7795,2],[7796,1,"ṵ"],[7797,2],[7798,1,"ṷ"],[7799,2],[7800,1,"ṹ"],[7801,2],[7802,1,"ṻ"],[7803,2],[7804,1,"ṽ"],[7805,2],[7806,1,"ṿ"],[7807,2],[7808,1,"ẁ"],[7809,2],[7810,1,"ẃ"],[7811,2],[7812,1,"ẅ"],[7813,2],[7814,1,"ẇ"],[7815,2],[7816,1,"ẉ"],[7817,2],[7818,1,"ẋ"],[7819,2],[7820,1,"ẍ"],[7821,2],[7822,1,"ẏ"],[7823,2],[7824,1,"ẑ"],[7825,2],[7826,1,"ẓ"],[7827,2],[7828,1,"ẕ"],[[7829,7833],2],[7834,1,"aʾ"],[7835,1,"ṡ"],[[7836,7837],2],[7838,1,"ss"],[7839,2],[7840,1,"ạ"],[7841,2],[7842,1,"ả"],[7843,2],[7844,1,"ấ"],[7845,2],[7846,1,"ầ"],[7847,2],[7848,1,"ẩ"],[7849,2],[7850,1,"ẫ"],[7851,2],[7852,1,"ậ"],[7853,2],[7854,1,"ắ"],[7855,2],[7856,1,"ằ"],[7857,2],[7858,1,"ẳ"],[7859,2],[7860,1,"ẵ"],[7861,2],[7862,1,"ặ"],[7863,2],[7864,1,"ẹ"],[7865,2],[7866,1,"ẻ"],[7867,2],[7868,1,"ẽ"],[7869,2],[7870,1,"ế"],[7871,2],[7872,1,"ề"],[7873,2],[7874,1,"ể"],[7875,2],[7876,1,"ễ"],[7877,2],[7878,1,"ệ"],[7879,2],[7880,1,"ỉ"],[7881,2],[7882,1,"ị"],[7883,2],[7884,1,"ọ"],[7885,2],[7886,1,"ỏ"],[7887,2],[7888,1,"ố"],[7889,2],[7890,1,"ồ"],[7891,2],[7892,1,"ổ"],[7893,2],[7894,1,"ỗ"],[7895,2],[7896,1,"ộ"],[7897,2],[7898,1,"ớ"],[7899,2],[7900,1,"ờ"],[7901,2],[7902,1,"ở"],[7903,2],[7904,1,"ỡ"],[7905,2],[7906,1,"ợ"],[7907,2],[7908,1,"ụ"],[7909,2],[7910,1,"ủ"],[7911,2],[7912,1,"ứ"],[7913,2],[7914,1,"ừ"],[7915,2],[7916,1,"ử"],[7917,2],[7918,1,"ữ"],[7919,2],[7920,1,"ự"],[7921,2],[7922,1,"ỳ"],[7923,2],[7924,1,"ỵ"],[7925,2],[7926,1,"ỷ"],[7927,2],[7928,1,"ỹ"],[7929,2],[7930,1,"ỻ"],[7931,2],[7932,1,"ỽ"],[7933,2],[7934,1,"ỿ"],[7935,2],[[7936,7943],2],[7944,1,"ἀ"],[7945,1,"ἁ"],[7946,1,"ἂ"],[7947,1,"ἃ"],[7948,1,"ἄ"],[7949,1,"ἅ"],[7950,1,"ἆ"],[7951,1,"ἇ"],[[7952,7957],2],[[7958,7959],3],[7960,1,"ἐ"],[7961,1,"ἑ"],[7962,1,"ἒ"],[7963,1,"ἓ"],[7964,1,"ἔ"],[7965,1,"ἕ"],[[7966,7967],3],[[7968,7975],2],[7976,1,"ἠ"],[7977,1,"ἡ"],[7978,1,"ἢ"],[7979,1,"ἣ"],[7980,1,"ἤ"],[7981,1,"ἥ"],[7982,1,"ἦ"],[7983,1,"ἧ"],[[7984,7991],2],[7992,1,"ἰ"],[7993,1,"ἱ"],[7994,1,"ἲ"],[7995,1,"ἳ"],[7996,1,"ἴ"],[7997,1,"ἵ"],[7998,1,"ἶ"],[7999,1,"ἷ"],[[8000,8005],2],[[8006,8007],3],[8008,1,"ὀ"],[8009,1,"ὁ"],[8010,1,"ὂ"],[8011,1,"ὃ"],[8012,1,"ὄ"],[8013,1,"ὅ"],[[8014,8015],3],[[8016,8023],2],[8024,3],[8025,1,"ὑ"],[8026,3],[8027,1,"ὓ"],[8028,3],[8029,1,"ὕ"],[8030,3],[8031,1,"ὗ"],[[8032,8039],2],[8040,1,"ὠ"],[8041,1,"ὡ"],[8042,1,"ὢ"],[8043,1,"ὣ"],[8044,1,"ὤ"],[8045,1,"ὥ"],[8046,1,"ὦ"],[8047,1,"ὧ"],[8048,2],[8049,1,"ά"],[8050,2],[8051,1,"έ"],[8052,2],[8053,1,"ή"],[8054,2],[8055,1,"ί"],[8056,2],[8057,1,"ό"],[8058,2],[8059,1,"ύ"],[8060,2],[8061,1,"ώ"],[[8062,8063],3],[8064,1,"ἀι"],[8065,1,"ἁι"],[8066,1,"ἂι"],[8067,1,"ἃι"],[8068,1,"ἄι"],[8069,1,"ἅι"],[8070,1,"ἆι"],[8071,1,"ἇι"],[8072,1,"ἀι"],[8073,1,"ἁι"],[8074,1,"ἂι"],[8075,1,"ἃι"],[8076,1,"ἄι"],[8077,1,"ἅι"],[8078,1,"ἆι"],[8079,1,"ἇι"],[8080,1,"ἠι"],[8081,1,"ἡι"],[8082,1,"ἢι"],[8083,1,"ἣι"],[8084,1,"ἤι"],[8085,1,"ἥι"],[8086,1,"ἦι"],[8087,1,"ἧι"],[8088,1,"ἠι"],[8089,1,"ἡι"],[8090,1,"ἢι"],[8091,1,"ἣι"],[8092,1,"ἤι"],[8093,1,"ἥι"],[8094,1,"ἦι"],[8095,1,"ἧι"],[8096,1,"ὠι"],[8097,1,"ὡι"],[8098,1,"ὢι"],[8099,1,"ὣι"],[8100,1,"ὤι"],[8101,1,"ὥι"],[8102,1,"ὦι"],[8103,1,"ὧι"],[8104,1,"ὠι"],[8105,1,"ὡι"],[8106,1,"ὢι"],[8107,1,"ὣι"],[8108,1,"ὤι"],[8109,1,"ὥι"],[8110,1,"ὦι"],[8111,1,"ὧι"],[[8112,8113],2],[8114,1,"ὰι"],[8115,1,"αι"],[8116,1,"άι"],[8117,3],[8118,2],[8119,1,"ᾶι"],[8120,1,"ᾰ"],[8121,1,"ᾱ"],[8122,1,"ὰ"],[8123,1,"ά"],[8124,1,"αι"],[8125,5," ̓"],[8126,1,"ι"],[8127,5," ̓"],[8128,5," ͂"],[8129,5," ̈͂"],[8130,1,"ὴι"],[8131,1,"ηι"],[8132,1,"ήι"],[8133,3],[8134,2],[8135,1,"ῆι"],[8136,1,"ὲ"],[8137,1,"έ"],[8138,1,"ὴ"],[8139,1,"ή"],[8140,1,"ηι"],[8141,5," ̓̀"],[8142,5," ̓́"],[8143,5," ̓͂"],[[8144,8146],2],[8147,1,"ΐ"],[[8148,8149],3],[[8150,8151],2],[8152,1,"ῐ"],[8153,1,"ῑ"],[8154,1,"ὶ"],[8155,1,"ί"],[8156,3],[8157,5," ̔̀"],[8158,5," ̔́"],[8159,5," ̔͂"],[[8160,8162],2],[8163,1,"ΰ"],[[8164,8167],2],[8168,1,"ῠ"],[8169,1,"ῡ"],[8170,1,"ὺ"],[8171,1,"ύ"],[8172,1,"ῥ"],[8173,5," ̈̀"],[8174,5," ̈́"],[8175,5,"`"],[[8176,8177],3],[8178,1,"ὼι"],[8179,1,"ωι"],[8180,1,"ώι"],[8181,3],[8182,2],[8183,1,"ῶι"],[8184,1,"ὸ"],[8185,1,"ό"],[8186,1,"ὼ"],[8187,1,"ώ"],[8188,1,"ωι"],[8189,5," ́"],[8190,5," ̔"],[8191,3],[[8192,8202],5," "],[8203,7],[[8204,8205],6,""],[[8206,8207],3],[8208,2],[8209,1,"‐"],[[8210,8214],2],[8215,5," ̳"],[[8216,8227],2],[[8228,8230],3],[8231,2],[[8232,8238],3],[8239,5," "],[[8240,8242],2],[8243,1,"′′"],[8244,1,"′′′"],[8245,2],[8246,1,"‵‵"],[8247,1,"‵‵‵"],[[8248,8251],2],[8252,5,"!!"],[8253,2],[8254,5," ̅"],[[8255,8262],2],[8263,5,"??"],[8264,5,"?!"],[8265,5,"!?"],[[8266,8269],2],[[8270,8274],2],[[8275,8276],2],[[8277,8278],2],[8279,1,"′′′′"],[[8280,8286],2],[8287,5," "],[8288,7],[[8289,8291],3],[8292,7],[8293,3],[[8294,8297],3],[[8298,8303],3],[8304,1,"0"],[8305,1,"i"],[[8306,8307],3],[8308,1,"4"],[8309,1,"5"],[8310,1,"6"],[8311,1,"7"],[8312,1,"8"],[8313,1,"9"],[8314,5,"+"],[8315,1,"−"],[8316,5,"="],[8317,5,"("],[8318,5,")"],[8319,1,"n"],[8320,1,"0"],[8321,1,"1"],[8322,1,"2"],[8323,1,"3"],[8324,1,"4"],[8325,1,"5"],[8326,1,"6"],[8327,1,"7"],[8328,1,"8"],[8329,1,"9"],[8330,5,"+"],[8331,1,"−"],[8332,5,"="],[8333,5,"("],[8334,5,")"],[8335,3],[8336,1,"a"],[8337,1,"e"],[8338,1,"o"],[8339,1,"x"],[8340,1,"ə"],[8341,1,"h"],[8342,1,"k"],[8343,1,"l"],[8344,1,"m"],[8345,1,"n"],[8346,1,"p"],[8347,1,"s"],[8348,1,"t"],[[8349,8351],3],[[8352,8359],2],[8360,1,"rs"],[[8361,8362],2],[8363,2],[8364,2],[[8365,8367],2],[[8368,8369],2],[[8370,8373],2],[[8374,8376],2],[8377,2],[8378,2],[[8379,8381],2],[8382,2],[8383,2],[8384,2],[[8385,8399],3],[[8400,8417],2],[[8418,8419],2],[[8420,8426],2],[8427,2],[[8428,8431],2],[8432,2],[[8433,8447],3],[8448,5,"a/c"],[8449,5,"a/s"],[8450,1,"c"],[8451,1,"°c"],[8452,2],[8453,5,"c/o"],[8454,5,"c/u"],[8455,1,"ɛ"],[8456,2],[8457,1,"°f"],[8458,1,"g"],[[8459,8462],1,"h"],[8463,1,"ħ"],[[8464,8465],1,"i"],[[8466,8467],1,"l"],[8468,2],[8469,1,"n"],[8470,1,"no"],[[8471,8472],2],[8473,1,"p"],[8474,1,"q"],[[8475,8477],1,"r"],[[8478,8479],2],[8480,1,"sm"],[8481,1,"tel"],[8482,1,"tm"],[8483,2],[8484,1,"z"],[8485,2],[8486,1,"ω"],[8487,2],[8488,1,"z"],[8489,2],[8490,1,"k"],[8491,1,"å"],[8492,1,"b"],[8493,1,"c"],[8494,2],[[8495,8496],1,"e"],[8497,1,"f"],[8498,3],[8499,1,"m"],[8500,1,"o"],[8501,1,"א"],[8502,1,"ב"],[8503,1,"ג"],[8504,1,"ד"],[8505,1,"i"],[8506,2],[8507,1,"fax"],[8508,1,"π"],[[8509,8510],1,"γ"],[8511,1,"π"],[8512,1,"∑"],[[8513,8516],2],[[8517,8518],1,"d"],[8519,1,"e"],[8520,1,"i"],[8521,1,"j"],[[8522,8523],2],[8524,2],[8525,2],[8526,2],[8527,2],[8528,1,"1⁄7"],[8529,1,"1⁄9"],[8530,1,"1⁄10"],[8531,1,"1⁄3"],[8532,1,"2⁄3"],[8533,1,"1⁄5"],[8534,1,"2⁄5"],[8535,1,"3⁄5"],[8536,1,"4⁄5"],[8537,1,"1⁄6"],[8538,1,"5⁄6"],[8539,1,"1⁄8"],[8540,1,"3⁄8"],[8541,1,"5⁄8"],[8542,1,"7⁄8"],[8543,1,"1⁄"],[8544,1,"i"],[8545,1,"ii"],[8546,1,"iii"],[8547,1,"iv"],[8548,1,"v"],[8549,1,"vi"],[8550,1,"vii"],[8551,1,"viii"],[8552,1,"ix"],[8553,1,"x"],[8554,1,"xi"],[8555,1,"xii"],[8556,1,"l"],[8557,1,"c"],[8558,1,"d"],[8559,1,"m"],[8560,1,"i"],[8561,1,"ii"],[8562,1,"iii"],[8563,1,"iv"],[8564,1,"v"],[8565,1,"vi"],[8566,1,"vii"],[8567,1,"viii"],[8568,1,"ix"],[8569,1,"x"],[8570,1,"xi"],[8571,1,"xii"],[8572,1,"l"],[8573,1,"c"],[8574,1,"d"],[8575,1,"m"],[[8576,8578],2],[8579,3],[8580,2],[[8581,8584],2],[8585,1,"0⁄3"],[[8586,8587],2],[[8588,8591],3],[[8592,8682],2],[[8683,8691],2],[[8692,8703],2],[[8704,8747],2],[8748,1,"∫∫"],[8749,1,"∫∫∫"],[8750,2],[8751,1,"∮∮"],[8752,1,"∮∮∮"],[[8753,8799],2],[8800,4],[[8801,8813],2],[[8814,8815],4],[[8816,8945],2],[[8946,8959],2],[8960,2],[8961,2],[[8962,9000],2],[9001,1,"〈"],[9002,1,"〉"],[[9003,9082],2],[9083,2],[9084,2],[[9085,9114],2],[[9115,9166],2],[[9167,9168],2],[[9169,9179],2],[[9180,9191],2],[9192,2],[[9193,9203],2],[[9204,9210],2],[[9211,9214],2],[9215,2],[[9216,9252],2],[[9253,9254],2],[[9255,9279],3],[[9280,9290],2],[[9291,9311],3],[9312,1,"1"],[9313,1,"2"],[9314,1,"3"],[9315,1,"4"],[9316,1,"5"],[9317,1,"6"],[9318,1,"7"],[9319,1,"8"],[9320,1,"9"],[9321,1,"10"],[9322,1,"11"],[9323,1,"12"],[9324,1,"13"],[9325,1,"14"],[9326,1,"15"],[9327,1,"16"],[9328,1,"17"],[9329,1,"18"],[9330,1,"19"],[9331,1,"20"],[9332,5,"(1)"],[9333,5,"(2)"],[9334,5,"(3)"],[9335,5,"(4)"],[9336,5,"(5)"],[9337,5,"(6)"],[9338,5,"(7)"],[9339,5,"(8)"],[9340,5,"(9)"],[9341,5,"(10)"],[9342,5,"(11)"],[9343,5,"(12)"],[9344,5,"(13)"],[9345,5,"(14)"],[9346,5,"(15)"],[9347,5,"(16)"],[9348,5,"(17)"],[9349,5,"(18)"],[9350,5,"(19)"],[9351,5,"(20)"],[[9352,9371],3],[9372,5,"(a)"],[9373,5,"(b)"],[9374,5,"(c)"],[9375,5,"(d)"],[9376,5,"(e)"],[9377,5,"(f)"],[9378,5,"(g)"],[9379,5,"(h)"],[9380,5,"(i)"],[9381,5,"(j)"],[9382,5,"(k)"],[9383,5,"(l)"],[9384,5,"(m)"],[9385,5,"(n)"],[9386,5,"(o)"],[9387,5,"(p)"],[9388,5,"(q)"],[9389,5,"(r)"],[9390,5,"(s)"],[9391,5,"(t)"],[9392,5,"(u)"],[9393,5,"(v)"],[9394,5,"(w)"],[9395,5,"(x)"],[9396,5,"(y)"],[9397,5,"(z)"],[9398,1,"a"],[9399,1,"b"],[9400,1,"c"],[9401,1,"d"],[9402,1,"e"],[9403,1,"f"],[9404,1,"g"],[9405,1,"h"],[9406,1,"i"],[9407,1,"j"],[9408,1,"k"],[9409,1,"l"],[9410,1,"m"],[9411,1,"n"],[9412,1,"o"],[9413,1,"p"],[9414,1,"q"],[9415,1,"r"],[9416,1,"s"],[9417,1,"t"],[9418,1,"u"],[9419,1,"v"],[9420,1,"w"],[9421,1,"x"],[9422,1,"y"],[9423,1,"z"],[9424,1,"a"],[9425,1,"b"],[9426,1,"c"],[9427,1,"d"],[9428,1,"e"],[9429,1,"f"],[9430,1,"g"],[9431,1,"h"],[9432,1,"i"],[9433,1,"j"],[9434,1,"k"],[9435,1,"l"],[9436,1,"m"],[9437,1,"n"],[9438,1,"o"],[9439,1,"p"],[9440,1,"q"],[9441,1,"r"],[9442,1,"s"],[9443,1,"t"],[9444,1,"u"],[9445,1,"v"],[9446,1,"w"],[9447,1,"x"],[9448,1,"y"],[9449,1,"z"],[9450,1,"0"],[[9451,9470],2],[9471,2],[[9472,9621],2],[[9622,9631],2],[[9632,9711],2],[[9712,9719],2],[[9720,9727],2],[[9728,9747],2],[[9748,9749],2],[[9750,9751],2],[9752,2],[9753,2],[[9754,9839],2],[[9840,9841],2],[[9842,9853],2],[[9854,9855],2],[[9856,9865],2],[[9866,9873],2],[[9874,9884],2],[9885,2],[[9886,9887],2],[[9888,9889],2],[[9890,9905],2],[9906,2],[[9907,9916],2],[[9917,9919],2],[[9920,9923],2],[[9924,9933],2],[9934,2],[[9935,9953],2],[9954,2],[9955,2],[[9956,9959],2],[[9960,9983],2],[9984,2],[[9985,9988],2],[9989,2],[[9990,9993],2],[[9994,9995],2],[[9996,10023],2],[10024,2],[[10025,10059],2],[10060,2],[10061,2],[10062,2],[[10063,10066],2],[[10067,10069],2],[10070,2],[10071,2],[[10072,10078],2],[[10079,10080],2],[[10081,10087],2],[[10088,10101],2],[[10102,10132],2],[[10133,10135],2],[[10136,10159],2],[10160,2],[[10161,10174],2],[10175,2],[[10176,10182],2],[[10183,10186],2],[10187,2],[10188,2],[10189,2],[[10190,10191],2],[[10192,10219],2],[[10220,10223],2],[[10224,10239],2],[[10240,10495],2],[[10496,10763],2],[10764,1,"∫∫∫∫"],[[10765,10867],2],[10868,5,"::="],[10869,5,"=="],[10870,5,"==="],[[10871,10971],2],[10972,1,"⫝̸"],[[10973,11007],2],[[11008,11021],2],[[11022,11027],2],[[11028,11034],2],[[11035,11039],2],[[11040,11043],2],[[11044,11084],2],[[11085,11087],2],[[11088,11092],2],[[11093,11097],2],[[11098,11123],2],[[11124,11125],3],[[11126,11157],2],[11158,3],[11159,2],[[11160,11193],2],[[11194,11196],2],[[11197,11208],2],[11209,2],[[11210,11217],2],[11218,2],[[11219,11243],2],[[11244,11247],2],[[11248,11262],2],[11263,2],[11264,1,"ⰰ"],[11265,1,"ⰱ"],[11266,1,"ⰲ"],[11267,1,"ⰳ"],[11268,1,"ⰴ"],[11269,1,"ⰵ"],[11270,1,"ⰶ"],[11271,1,"ⰷ"],[11272,1,"ⰸ"],[11273,1,"ⰹ"],[11274,1,"ⰺ"],[11275,1,"ⰻ"],[11276,1,"ⰼ"],[11277,1,"ⰽ"],[11278,1,"ⰾ"],[11279,1,"ⰿ"],[11280,1,"ⱀ"],[11281,1,"ⱁ"],[11282,1,"ⱂ"],[11283,1,"ⱃ"],[11284,1,"ⱄ"],[11285,1,"ⱅ"],[11286,1,"ⱆ"],[11287,1,"ⱇ"],[11288,1,"ⱈ"],[11289,1,"ⱉ"],[11290,1,"ⱊ"],[11291,1,"ⱋ"],[11292,1,"ⱌ"],[11293,1,"ⱍ"],[11294,1,"ⱎ"],[11295,1,"ⱏ"],[11296,1,"ⱐ"],[11297,1,"ⱑ"],[11298,1,"ⱒ"],[11299,1,"ⱓ"],[11300,1,"ⱔ"],[11301,1,"ⱕ"],[11302,1,"ⱖ"],[11303,1,"ⱗ"],[11304,1,"ⱘ"],[11305,1,"ⱙ"],[11306,1,"ⱚ"],[11307,1,"ⱛ"],[11308,1,"ⱜ"],[11309,1,"ⱝ"],[11310,1,"ⱞ"],[11311,1,"ⱟ"],[[11312,11358],2],[11359,2],[11360,1,"ⱡ"],[11361,2],[11362,1,"ɫ"],[11363,1,"ᵽ"],[11364,1,"ɽ"],[[11365,11366],2],[11367,1,"ⱨ"],[11368,2],[11369,1,"ⱪ"],[11370,2],[11371,1,"ⱬ"],[11372,2],[11373,1,"ɑ"],[11374,1,"ɱ"],[11375,1,"ɐ"],[11376,1,"ɒ"],[11377,2],[11378,1,"ⱳ"],[11379,2],[11380,2],[11381,1,"ⱶ"],[[11382,11383],2],[[11384,11387],2],[11388,1,"j"],[11389,1,"v"],[11390,1,"ȿ"],[11391,1,"ɀ"],[11392,1,"ⲁ"],[11393,2],[11394,1,"ⲃ"],[11395,2],[11396,1,"ⲅ"],[11397,2],[11398,1,"ⲇ"],[11399,2],[11400,1,"ⲉ"],[11401,2],[11402,1,"ⲋ"],[11403,2],[11404,1,"ⲍ"],[11405,2],[11406,1,"ⲏ"],[11407,2],[11408,1,"ⲑ"],[11409,2],[11410,1,"ⲓ"],[11411,2],[11412,1,"ⲕ"],[11413,2],[11414,1,"ⲗ"],[11415,2],[11416,1,"ⲙ"],[11417,2],[11418,1,"ⲛ"],[11419,2],[11420,1,"ⲝ"],[11421,2],[11422,1,"ⲟ"],[11423,2],[11424,1,"ⲡ"],[11425,2],[11426,1,"ⲣ"],[11427,2],[11428,1,"ⲥ"],[11429,2],[11430,1,"ⲧ"],[11431,2],[11432,1,"ⲩ"],[11433,2],[11434,1,"ⲫ"],[11435,2],[11436,1,"ⲭ"],[11437,2],[11438,1,"ⲯ"],[11439,2],[11440,1,"ⲱ"],[11441,2],[11442,1,"ⲳ"],[11443,2],[11444,1,"ⲵ"],[11445,2],[11446,1,"ⲷ"],[11447,2],[11448,1,"ⲹ"],[11449,2],[11450,1,"ⲻ"],[11451,2],[11452,1,"ⲽ"],[11453,2],[11454,1,"ⲿ"],[11455,2],[11456,1,"ⳁ"],[11457,2],[11458,1,"ⳃ"],[11459,2],[11460,1,"ⳅ"],[11461,2],[11462,1,"ⳇ"],[11463,2],[11464,1,"ⳉ"],[11465,2],[11466,1,"ⳋ"],[11467,2],[11468,1,"ⳍ"],[11469,2],[11470,1,"ⳏ"],[11471,2],[11472,1,"ⳑ"],[11473,2],[11474,1,"ⳓ"],[11475,2],[11476,1,"ⳕ"],[11477,2],[11478,1,"ⳗ"],[11479,2],[11480,1,"ⳙ"],[11481,2],[11482,1,"ⳛ"],[11483,2],[11484,1,"ⳝ"],[11485,2],[11486,1,"ⳟ"],[11487,2],[11488,1,"ⳡ"],[11489,2],[11490,1,"ⳣ"],[[11491,11492],2],[[11493,11498],2],[11499,1,"ⳬ"],[11500,2],[11501,1,"ⳮ"],[[11502,11505],2],[11506,1,"ⳳ"],[11507,2],[[11508,11512],3],[[11513,11519],2],[[11520,11557],2],[11558,3],[11559,2],[[11560,11564],3],[11565,2],[[11566,11567],3],[[11568,11621],2],[[11622,11623],2],[[11624,11630],3],[11631,1,"ⵡ"],[11632,2],[[11633,11646],3],[11647,2],[[11648,11670],2],[[11671,11679],3],[[11680,11686],2],[11687,3],[[11688,11694],2],[11695,3],[[11696,11702],2],[11703,3],[[11704,11710],2],[11711,3],[[11712,11718],2],[11719,3],[[11720,11726],2],[11727,3],[[11728,11734],2],[11735,3],[[11736,11742],2],[11743,3],[[11744,11775],2],[[11776,11799],2],[[11800,11803],2],[[11804,11805],2],[[11806,11822],2],[11823,2],[11824,2],[11825,2],[[11826,11835],2],[[11836,11842],2],[[11843,11844],2],[[11845,11849],2],[[11850,11854],2],[11855,2],[[11856,11858],2],[[11859,11869],2],[[11870,11903],3],[[11904,11929],2],[11930,3],[[11931,11934],2],[11935,1,"母"],[[11936,12018],2],[12019,1,"龟"],[[12020,12031],3],[12032,1,"一"],[12033,1,"丨"],[12034,1,"丶"],[12035,1,"丿"],[12036,1,"乙"],[12037,1,"亅"],[12038,1,"二"],[12039,1,"亠"],[12040,1,"人"],[12041,1,"儿"],[12042,1,"入"],[12043,1,"八"],[12044,1,"冂"],[12045,1,"冖"],[12046,1,"冫"],[12047,1,"几"],[12048,1,"凵"],[12049,1,"刀"],[12050,1,"力"],[12051,1,"勹"],[12052,1,"匕"],[12053,1,"匚"],[12054,1,"匸"],[12055,1,"十"],[12056,1,"卜"],[12057,1,"卩"],[12058,1,"厂"],[12059,1,"厶"],[12060,1,"又"],[12061,1,"口"],[12062,1,"囗"],[12063,1,"土"],[12064,1,"士"],[12065,1,"夂"],[12066,1,"夊"],[12067,1,"夕"],[12068,1,"大"],[12069,1,"女"],[12070,1,"子"],[12071,1,"宀"],[12072,1,"寸"],[12073,1,"小"],[12074,1,"尢"],[12075,1,"尸"],[12076,1,"屮"],[12077,1,"山"],[12078,1,"巛"],[12079,1,"工"],[12080,1,"己"],[12081,1,"巾"],[12082,1,"干"],[12083,1,"幺"],[12084,1,"广"],[12085,1,"廴"],[12086,1,"廾"],[12087,1,"弋"],[12088,1,"弓"],[12089,1,"彐"],[12090,1,"彡"],[12091,1,"彳"],[12092,1,"心"],[12093,1,"戈"],[12094,1,"戶"],[12095,1,"手"],[12096,1,"支"],[12097,1,"攴"],[12098,1,"文"],[12099,1,"斗"],[12100,1,"斤"],[12101,1,"方"],[12102,1,"无"],[12103,1,"日"],[12104,1,"曰"],[12105,1,"月"],[12106,1,"木"],[12107,1,"欠"],[12108,1,"止"],[12109,1,"歹"],[12110,1,"殳"],[12111,1,"毋"],[12112,1,"比"],[12113,1,"毛"],[12114,1,"氏"],[12115,1,"气"],[12116,1,"水"],[12117,1,"火"],[12118,1,"爪"],[12119,1,"父"],[12120,1,"爻"],[12121,1,"爿"],[12122,1,"片"],[12123,1,"牙"],[12124,1,"牛"],[12125,1,"犬"],[12126,1,"玄"],[12127,1,"玉"],[12128,1,"瓜"],[12129,1,"瓦"],[12130,1,"甘"],[12131,1,"生"],[12132,1,"用"],[12133,1,"田"],[12134,1,"疋"],[12135,1,"疒"],[12136,1,"癶"],[12137,1,"白"],[12138,1,"皮"],[12139,1,"皿"],[12140,1,"目"],[12141,1,"矛"],[12142,1,"矢"],[12143,1,"石"],[12144,1,"示"],[12145,1,"禸"],[12146,1,"禾"],[12147,1,"穴"],[12148,1,"立"],[12149,1,"竹"],[12150,1,"米"],[12151,1,"糸"],[12152,1,"缶"],[12153,1,"网"],[12154,1,"羊"],[12155,1,"羽"],[12156,1,"老"],[12157,1,"而"],[12158,1,"耒"],[12159,1,"耳"],[12160,1,"聿"],[12161,1,"肉"],[12162,1,"臣"],[12163,1,"自"],[12164,1,"至"],[12165,1,"臼"],[12166,1,"舌"],[12167,1,"舛"],[12168,1,"舟"],[12169,1,"艮"],[12170,1,"色"],[12171,1,"艸"],[12172,1,"虍"],[12173,1,"虫"],[12174,1,"血"],[12175,1,"行"],[12176,1,"衣"],[12177,1,"襾"],[12178,1,"見"],[12179,1,"角"],[12180,1,"言"],[12181,1,"谷"],[12182,1,"豆"],[12183,1,"豕"],[12184,1,"豸"],[12185,1,"貝"],[12186,1,"赤"],[12187,1,"走"],[12188,1,"足"],[12189,1,"身"],[12190,1,"車"],[12191,1,"辛"],[12192,1,"辰"],[12193,1,"辵"],[12194,1,"邑"],[12195,1,"酉"],[12196,1,"釆"],[12197,1,"里"],[12198,1,"金"],[12199,1,"長"],[12200,1,"門"],[12201,1,"阜"],[12202,1,"隶"],[12203,1,"隹"],[12204,1,"雨"],[12205,1,"靑"],[12206,1,"非"],[12207,1,"面"],[12208,1,"革"],[12209,1,"韋"],[12210,1,"韭"],[12211,1,"音"],[12212,1,"頁"],[12213,1,"風"],[12214,1,"飛"],[12215,1,"食"],[12216,1,"首"],[12217,1,"香"],[12218,1,"馬"],[12219,1,"骨"],[12220,1,"高"],[12221,1,"髟"],[12222,1,"鬥"],[12223,1,"鬯"],[12224,1,"鬲"],[12225,1,"鬼"],[12226,1,"魚"],[12227,1,"鳥"],[12228,1,"鹵"],[12229,1,"鹿"],[12230,1,"麥"],[12231,1,"麻"],[12232,1,"黃"],[12233,1,"黍"],[12234,1,"黑"],[12235,1,"黹"],[12236,1,"黽"],[12237,1,"鼎"],[12238,1,"鼓"],[12239,1,"鼠"],[12240,1,"鼻"],[12241,1,"齊"],[12242,1,"齒"],[12243,1,"龍"],[12244,1,"龜"],[12245,1,"龠"],[[12246,12271],3],[[12272,12283],3],[[12284,12287],3],[12288,5," "],[12289,2],[12290,1,"."],[[12291,12292],2],[[12293,12295],2],[[12296,12329],2],[[12330,12333],2],[[12334,12341],2],[12342,1,"〒"],[12343,2],[12344,1,"十"],[12345,1,"卄"],[12346,1,"卅"],[12347,2],[12348,2],[12349,2],[12350,2],[12351,2],[12352,3],[[12353,12436],2],[[12437,12438],2],[[12439,12440],3],[[12441,12442],2],[12443,5," ゙"],[12444,5," ゚"],[[12445,12446],2],[12447,1,"より"],[12448,2],[[12449,12542],2],[12543,1,"コト"],[[12544,12548],3],[[12549,12588],2],[12589,2],[12590,2],[12591,2],[12592,3],[12593,1,"ᄀ"],[12594,1,"ᄁ"],[12595,1,"ᆪ"],[12596,1,"ᄂ"],[12597,1,"ᆬ"],[12598,1,"ᆭ"],[12599,1,"ᄃ"],[12600,1,"ᄄ"],[12601,1,"ᄅ"],[12602,1,"ᆰ"],[12603,1,"ᆱ"],[12604,1,"ᆲ"],[12605,1,"ᆳ"],[12606,1,"ᆴ"],[12607,1,"ᆵ"],[12608,1,"ᄚ"],[12609,1,"ᄆ"],[12610,1,"ᄇ"],[12611,1,"ᄈ"],[12612,1,"ᄡ"],[12613,1,"ᄉ"],[12614,1,"ᄊ"],[12615,1,"ᄋ"],[12616,1,"ᄌ"],[12617,1,"ᄍ"],[12618,1,"ᄎ"],[12619,1,"ᄏ"],[12620,1,"ᄐ"],[12621,1,"ᄑ"],[12622,1,"ᄒ"],[12623,1,"ᅡ"],[12624,1,"ᅢ"],[12625,1,"ᅣ"],[12626,1,"ᅤ"],[12627,1,"ᅥ"],[12628,1,"ᅦ"],[12629,1,"ᅧ"],[12630,1,"ᅨ"],[12631,1,"ᅩ"],[12632,1,"ᅪ"],[12633,1,"ᅫ"],[12634,1,"ᅬ"],[12635,1,"ᅭ"],[12636,1,"ᅮ"],[12637,1,"ᅯ"],[12638,1,"ᅰ"],[12639,1,"ᅱ"],[12640,1,"ᅲ"],[12641,1,"ᅳ"],[12642,1,"ᅴ"],[12643,1,"ᅵ"],[12644,3],[12645,1,"ᄔ"],[12646,1,"ᄕ"],[12647,1,"ᇇ"],[12648,1,"ᇈ"],[12649,1,"ᇌ"],[12650,1,"ᇎ"],[12651,1,"ᇓ"],[12652,1,"ᇗ"],[12653,1,"ᇙ"],[12654,1,"ᄜ"],[12655,1,"ᇝ"],[12656,1,"ᇟ"],[12657,1,"ᄝ"],[12658,1,"ᄞ"],[12659,1,"ᄠ"],[12660,1,"ᄢ"],[12661,1,"ᄣ"],[12662,1,"ᄧ"],[12663,1,"ᄩ"],[12664,1,"ᄫ"],[12665,1,"ᄬ"],[12666,1,"ᄭ"],[12667,1,"ᄮ"],[12668,1,"ᄯ"],[12669,1,"ᄲ"],[12670,1,"ᄶ"],[12671,1,"ᅀ"],[12672,1,"ᅇ"],[12673,1,"ᅌ"],[12674,1,"ᇱ"],[12675,1,"ᇲ"],[12676,1,"ᅗ"],[12677,1,"ᅘ"],[12678,1,"ᅙ"],[12679,1,"ᆄ"],[12680,1,"ᆅ"],[12681,1,"ᆈ"],[12682,1,"ᆑ"],[12683,1,"ᆒ"],[12684,1,"ᆔ"],[12685,1,"ᆞ"],[12686,1,"ᆡ"],[12687,3],[[12688,12689],2],[12690,1,"一"],[12691,1,"二"],[12692,1,"三"],[12693,1,"四"],[12694,1,"上"],[12695,1,"中"],[12696,1,"下"],[12697,1,"甲"],[12698,1,"乙"],[12699,1,"丙"],[12700,1,"丁"],[12701,1,"天"],[12702,1,"地"],[12703,1,"人"],[[12704,12727],2],[[12728,12730],2],[[12731,12735],2],[[12736,12751],2],[[12752,12771],2],[[12772,12783],3],[[12784,12799],2],[12800,5,"(ᄀ)"],[12801,5,"(ᄂ)"],[12802,5,"(ᄃ)"],[12803,5,"(ᄅ)"],[12804,5,"(ᄆ)"],[12805,5,"(ᄇ)"],[12806,5,"(ᄉ)"],[12807,5,"(ᄋ)"],[12808,5,"(ᄌ)"],[12809,5,"(ᄎ)"],[12810,5,"(ᄏ)"],[12811,5,"(ᄐ)"],[12812,5,"(ᄑ)"],[12813,5,"(ᄒ)"],[12814,5,"(가)"],[12815,5,"(나)"],[12816,5,"(다)"],[12817,5,"(라)"],[12818,5,"(마)"],[12819,5,"(바)"],[12820,5,"(사)"],[12821,5,"(아)"],[12822,5,"(자)"],[12823,5,"(차)"],[12824,5,"(카)"],[12825,5,"(타)"],[12826,5,"(파)"],[12827,5,"(하)"],[12828,5,"(주)"],[12829,5,"(오전)"],[12830,5,"(오후)"],[12831,3],[12832,5,"(一)"],[12833,5,"(二)"],[12834,5,"(三)"],[12835,5,"(四)"],[12836,5,"(五)"],[12837,5,"(六)"],[12838,5,"(七)"],[12839,5,"(八)"],[12840,5,"(九)"],[12841,5,"(十)"],[12842,5,"(月)"],[12843,5,"(火)"],[12844,5,"(水)"],[12845,5,"(木)"],[12846,5,"(金)"],[12847,5,"(土)"],[12848,5,"(日)"],[12849,5,"(株)"],[12850,5,"(有)"],[12851,5,"(社)"],[12852,5,"(名)"],[12853,5,"(特)"],[12854,5,"(財)"],[12855,5,"(祝)"],[12856,5,"(労)"],[12857,5,"(代)"],[12858,5,"(呼)"],[12859,5,"(学)"],[12860,5,"(監)"],[12861,5,"(企)"],[12862,5,"(資)"],[12863,5,"(協)"],[12864,5,"(祭)"],[12865,5,"(休)"],[12866,5,"(自)"],[12867,5,"(至)"],[12868,1,"問"],[12869,1,"幼"],[12870,1,"文"],[12871,1,"箏"],[[12872,12879],2],[12880,1,"pte"],[12881,1,"21"],[12882,1,"22"],[12883,1,"23"],[12884,1,"24"],[12885,1,"25"],[12886,1,"26"],[12887,1,"27"],[12888,1,"28"],[12889,1,"29"],[12890,1,"30"],[12891,1,"31"],[12892,1,"32"],[12893,1,"33"],[12894,1,"34"],[12895,1,"35"],[12896,1,"ᄀ"],[12897,1,"ᄂ"],[12898,1,"ᄃ"],[12899,1,"ᄅ"],[12900,1,"ᄆ"],[12901,1,"ᄇ"],[12902,1,"ᄉ"],[12903,1,"ᄋ"],[12904,1,"ᄌ"],[12905,1,"ᄎ"],[12906,1,"ᄏ"],[12907,1,"ᄐ"],[12908,1,"ᄑ"],[12909,1,"ᄒ"],[12910,1,"가"],[12911,1,"나"],[12912,1,"다"],[12913,1,"라"],[12914,1,"마"],[12915,1,"바"],[12916,1,"사"],[12917,1,"아"],[12918,1,"자"],[12919,1,"차"],[12920,1,"카"],[12921,1,"타"],[12922,1,"파"],[12923,1,"하"],[12924,1,"참고"],[12925,1,"주의"],[12926,1,"우"],[12927,2],[12928,1,"一"],[12929,1,"二"],[12930,1,"三"],[12931,1,"四"],[12932,1,"五"],[12933,1,"六"],[12934,1,"七"],[12935,1,"八"],[12936,1,"九"],[12937,1,"十"],[12938,1,"月"],[12939,1,"火"],[12940,1,"水"],[12941,1,"木"],[12942,1,"金"],[12943,1,"土"],[12944,1,"日"],[12945,1,"株"],[12946,1,"有"],[12947,1,"社"],[12948,1,"名"],[12949,1,"特"],[12950,1,"財"],[12951,1,"祝"],[12952,1,"労"],[12953,1,"秘"],[12954,1,"男"],[12955,1,"女"],[12956,1,"適"],[12957,1,"優"],[12958,1,"印"],[12959,1,"注"],[12960,1,"項"],[12961,1,"休"],[12962,1,"写"],[12963,1,"正"],[12964,1,"上"],[12965,1,"中"],[12966,1,"下"],[12967,1,"左"],[12968,1,"右"],[12969,1,"医"],[12970,1,"宗"],[12971,1,"学"],[12972,1,"監"],[12973,1,"企"],[12974,1,"資"],[12975,1,"協"],[12976,1,"夜"],[12977,1,"36"],[12978,1,"37"],[12979,1,"38"],[12980,1,"39"],[12981,1,"40"],[12982,1,"41"],[12983,1,"42"],[12984,1,"43"],[12985,1,"44"],[12986,1,"45"],[12987,1,"46"],[12988,1,"47"],[12989,1,"48"],[12990,1,"49"],[12991,1,"50"],[12992,1,"1月"],[12993,1,"2月"],[12994,1,"3月"],[12995,1,"4月"],[12996,1,"5月"],[12997,1,"6月"],[12998,1,"7月"],[12999,1,"8月"],[13000,1,"9月"],[13001,1,"10月"],[13002,1,"11月"],[13003,1,"12月"],[13004,1,"hg"],[13005,1,"erg"],[13006,1,"ev"],[13007,1,"ltd"],[13008,1,"ア"],[13009,1,"イ"],[13010,1,"ウ"],[13011,1,"エ"],[13012,1,"オ"],[13013,1,"カ"],[13014,1,"キ"],[13015,1,"ク"],[13016,1,"ケ"],[13017,1,"コ"],[13018,1,"サ"],[13019,1,"シ"],[13020,1,"ス"],[13021,1,"セ"],[13022,1,"ソ"],[13023,1,"タ"],[13024,1,"チ"],[13025,1,"ツ"],[13026,1,"テ"],[13027,1,"ト"],[13028,1,"ナ"],[13029,1,"ニ"],[13030,1,"ヌ"],[13031,1,"ネ"],[13032,1,"ノ"],[13033,1,"ハ"],[13034,1,"ヒ"],[13035,1,"フ"],[13036,1,"ヘ"],[13037,1,"ホ"],[13038,1,"マ"],[13039,1,"ミ"],[13040,1,"ム"],[13041,1,"メ"],[13042,1,"モ"],[13043,1,"ヤ"],[13044,1,"ユ"],[13045,1,"ヨ"],[13046,1,"ラ"],[13047,1,"リ"],[13048,1,"ル"],[13049,1,"レ"],[13050,1,"ロ"],[13051,1,"ワ"],[13052,1,"ヰ"],[13053,1,"ヱ"],[13054,1,"ヲ"],[13055,1,"令和"],[13056,1,"アパート"],[13057,1,"アルファ"],[13058,1,"アンペア"],[13059,1,"アール"],[13060,1,"イニング"],[13061,1,"インチ"],[13062,1,"ウォン"],[13063,1,"エスクード"],[13064,1,"エーカー"],[13065,1,"オンス"],[13066,1,"オーム"],[13067,1,"カイリ"],[13068,1,"カラット"],[13069,1,"カロリー"],[13070,1,"ガロン"],[13071,1,"ガンマ"],[13072,1,"ギガ"],[13073,1,"ギニー"],[13074,1,"キュリー"],[13075,1,"ギルダー"],[13076,1,"キロ"],[13077,1,"キログラム"],[13078,1,"キロメートル"],[13079,1,"キロワット"],[13080,1,"グラム"],[13081,1,"グラムトン"],[13082,1,"クルゼイロ"],[13083,1,"クローネ"],[13084,1,"ケース"],[13085,1,"コルナ"],[13086,1,"コーポ"],[13087,1,"サイクル"],[13088,1,"サンチーム"],[13089,1,"シリング"],[13090,1,"センチ"],[13091,1,"セント"],[13092,1,"ダース"],[13093,1,"デシ"],[13094,1,"ドル"],[13095,1,"トン"],[13096,1,"ナノ"],[13097,1,"ノット"],[13098,1,"ハイツ"],[13099,1,"パーセント"],[13100,1,"パーツ"],[13101,1,"バーレル"],[13102,1,"ピアストル"],[13103,1,"ピクル"],[13104,1,"ピコ"],[13105,1,"ビル"],[13106,1,"ファラッド"],[13107,1,"フィート"],[13108,1,"ブッシェル"],[13109,1,"フラン"],[13110,1,"ヘクタール"],[13111,1,"ペソ"],[13112,1,"ペニヒ"],[13113,1,"ヘルツ"],[13114,1,"ペンス"],[13115,1,"ページ"],[13116,1,"ベータ"],[13117,1,"ポイント"],[13118,1,"ボルト"],[13119,1,"ホン"],[13120,1,"ポンド"],[13121,1,"ホール"],[13122,1,"ホーン"],[13123,1,"マイクロ"],[13124,1,"マイル"],[13125,1,"マッハ"],[13126,1,"マルク"],[13127,1,"マンション"],[13128,1,"ミクロン"],[13129,1,"ミリ"],[13130,1,"ミリバール"],[13131,1,"メガ"],[13132,1,"メガトン"],[13133,1,"メートル"],[13134,1,"ヤード"],[13135,1,"ヤール"],[13136,1,"ユアン"],[13137,1,"リットル"],[13138,1,"リラ"],[13139,1,"ルピー"],[13140,1,"ルーブル"],[13141,1,"レム"],[13142,1,"レントゲン"],[13143,1,"ワット"],[13144,1,"0点"],[13145,1,"1点"],[13146,1,"2点"],[13147,1,"3点"],[13148,1,"4点"],[13149,1,"5点"],[13150,1,"6点"],[13151,1,"7点"],[13152,1,"8点"],[13153,1,"9点"],[13154,1,"10点"],[13155,1,"11点"],[13156,1,"12点"],[13157,1,"13点"],[13158,1,"14点"],[13159,1,"15点"],[13160,1,"16点"],[13161,1,"17点"],[13162,1,"18点"],[13163,1,"19点"],[13164,1,"20点"],[13165,1,"21点"],[13166,1,"22点"],[13167,1,"23点"],[13168,1,"24点"],[13169,1,"hpa"],[13170,1,"da"],[13171,1,"au"],[13172,1,"bar"],[13173,1,"ov"],[13174,1,"pc"],[13175,1,"dm"],[13176,1,"dm2"],[13177,1,"dm3"],[13178,1,"iu"],[13179,1,"平成"],[13180,1,"昭和"],[13181,1,"大正"],[13182,1,"明治"],[13183,1,"株式会社"],[13184,1,"pa"],[13185,1,"na"],[13186,1,"μa"],[13187,1,"ma"],[13188,1,"ka"],[13189,1,"kb"],[13190,1,"mb"],[13191,1,"gb"],[13192,1,"cal"],[13193,1,"kcal"],[13194,1,"pf"],[13195,1,"nf"],[13196,1,"μf"],[13197,1,"μg"],[13198,1,"mg"],[13199,1,"kg"],[13200,1,"hz"],[13201,1,"khz"],[13202,1,"mhz"],[13203,1,"ghz"],[13204,1,"thz"],[13205,1,"μl"],[13206,1,"ml"],[13207,1,"dl"],[13208,1,"kl"],[13209,1,"fm"],[13210,1,"nm"],[13211,1,"μm"],[13212,1,"mm"],[13213,1,"cm"],[13214,1,"km"],[13215,1,"mm2"],[13216,1,"cm2"],[13217,1,"m2"],[13218,1,"km2"],[13219,1,"mm3"],[13220,1,"cm3"],[13221,1,"m3"],[13222,1,"km3"],[13223,1,"m∕s"],[13224,1,"m∕s2"],[13225,1,"pa"],[13226,1,"kpa"],[13227,1,"mpa"],[13228,1,"gpa"],[13229,1,"rad"],[13230,1,"rad∕s"],[13231,1,"rad∕s2"],[13232,1,"ps"],[13233,1,"ns"],[13234,1,"μs"],[13235,1,"ms"],[13236,1,"pv"],[13237,1,"nv"],[13238,1,"μv"],[13239,1,"mv"],[13240,1,"kv"],[13241,1,"mv"],[13242,1,"pw"],[13243,1,"nw"],[13244,1,"μw"],[13245,1,"mw"],[13246,1,"kw"],[13247,1,"mw"],[13248,1,"kω"],[13249,1,"mω"],[13250,3],[13251,1,"bq"],[13252,1,"cc"],[13253,1,"cd"],[13254,1,"c∕kg"],[13255,3],[13256,1,"db"],[13257,1,"gy"],[13258,1,"ha"],[13259,1,"hp"],[13260,1,"in"],[13261,1,"kk"],[13262,1,"km"],[13263,1,"kt"],[13264,1,"lm"],[13265,1,"ln"],[13266,1,"log"],[13267,1,"lx"],[13268,1,"mb"],[13269,1,"mil"],[13270,1,"mol"],[13271,1,"ph"],[13272,3],[13273,1,"ppm"],[13274,1,"pr"],[13275,1,"sr"],[13276,1,"sv"],[13277,1,"wb"],[13278,1,"v∕m"],[13279,1,"a∕m"],[13280,1,"1日"],[13281,1,"2日"],[13282,1,"3日"],[13283,1,"4日"],[13284,1,"5日"],[13285,1,"6日"],[13286,1,"7日"],[13287,1,"8日"],[13288,1,"9日"],[13289,1,"10日"],[13290,1,"11日"],[13291,1,"12日"],[13292,1,"13日"],[13293,1,"14日"],[13294,1,"15日"],[13295,1,"16日"],[13296,1,"17日"],[13297,1,"18日"],[13298,1,"19日"],[13299,1,"20日"],[13300,1,"21日"],[13301,1,"22日"],[13302,1,"23日"],[13303,1,"24日"],[13304,1,"25日"],[13305,1,"26日"],[13306,1,"27日"],[13307,1,"28日"],[13308,1,"29日"],[13309,1,"30日"],[13310,1,"31日"],[13311,1,"gal"],[[13312,19893],2],[[19894,19903],2],[[19904,19967],2],[[19968,40869],2],[[40870,40891],2],[[40892,40899],2],[[40900,40907],2],[40908,2],[[40909,40917],2],[[40918,40938],2],[[40939,40943],2],[[40944,40956],2],[[40957,40959],2],[[40960,42124],2],[[42125,42127],3],[[42128,42145],2],[[42146,42147],2],[[42148,42163],2],[42164,2],[[42165,42176],2],[42177,2],[[42178,42180],2],[42181,2],[42182,2],[[42183,42191],3],[[42192,42237],2],[[42238,42239],2],[[42240,42508],2],[[42509,42511],2],[[42512,42539],2],[[42540,42559],3],[42560,1,"ꙁ"],[42561,2],[42562,1,"ꙃ"],[42563,2],[42564,1,"ꙅ"],[42565,2],[42566,1,"ꙇ"],[42567,2],[42568,1,"ꙉ"],[42569,2],[42570,1,"ꙋ"],[42571,2],[42572,1,"ꙍ"],[42573,2],[42574,1,"ꙏ"],[42575,2],[42576,1,"ꙑ"],[42577,2],[42578,1,"ꙓ"],[42579,2],[42580,1,"ꙕ"],[42581,2],[42582,1,"ꙗ"],[42583,2],[42584,1,"ꙙ"],[42585,2],[42586,1,"ꙛ"],[42587,2],[42588,1,"ꙝ"],[42589,2],[42590,1,"ꙟ"],[42591,2],[42592,1,"ꙡ"],[42593,2],[42594,1,"ꙣ"],[42595,2],[42596,1,"ꙥ"],[42597,2],[42598,1,"ꙧ"],[42599,2],[42600,1,"ꙩ"],[42601,2],[42602,1,"ꙫ"],[42603,2],[42604,1,"ꙭ"],[[42605,42607],2],[[42608,42611],2],[[42612,42619],2],[[42620,42621],2],[42622,2],[42623,2],[42624,1,"ꚁ"],[42625,2],[42626,1,"ꚃ"],[42627,2],[42628,1,"ꚅ"],[42629,2],[42630,1,"ꚇ"],[42631,2],[42632,1,"ꚉ"],[42633,2],[42634,1,"ꚋ"],[42635,2],[42636,1,"ꚍ"],[42637,2],[42638,1,"ꚏ"],[42639,2],[42640,1,"ꚑ"],[42641,2],[42642,1,"ꚓ"],[42643,2],[42644,1,"ꚕ"],[42645,2],[42646,1,"ꚗ"],[42647,2],[42648,1,"ꚙ"],[42649,2],[42650,1,"ꚛ"],[42651,2],[42652,1,"ъ"],[42653,1,"ь"],[42654,2],[42655,2],[[42656,42725],2],[[42726,42735],2],[[42736,42737],2],[[42738,42743],2],[[42744,42751],3],[[42752,42774],2],[[42775,42778],2],[[42779,42783],2],[[42784,42785],2],[42786,1,"ꜣ"],[42787,2],[42788,1,"ꜥ"],[42789,2],[42790,1,"ꜧ"],[42791,2],[42792,1,"ꜩ"],[42793,2],[42794,1,"ꜫ"],[42795,2],[42796,1,"ꜭ"],[42797,2],[42798,1,"ꜯ"],[[42799,42801],2],[42802,1,"ꜳ"],[42803,2],[42804,1,"ꜵ"],[42805,2],[42806,1,"ꜷ"],[42807,2],[42808,1,"ꜹ"],[42809,2],[42810,1,"ꜻ"],[42811,2],[42812,1,"ꜽ"],[42813,2],[42814,1,"ꜿ"],[42815,2],[42816,1,"ꝁ"],[42817,2],[42818,1,"ꝃ"],[42819,2],[42820,1,"ꝅ"],[42821,2],[42822,1,"ꝇ"],[42823,2],[42824,1,"ꝉ"],[42825,2],[42826,1,"ꝋ"],[42827,2],[42828,1,"ꝍ"],[42829,2],[42830,1,"ꝏ"],[42831,2],[42832,1,"ꝑ"],[42833,2],[42834,1,"ꝓ"],[42835,2],[42836,1,"ꝕ"],[42837,2],[42838,1,"ꝗ"],[42839,2],[42840,1,"ꝙ"],[42841,2],[42842,1,"ꝛ"],[42843,2],[42844,1,"ꝝ"],[42845,2],[42846,1,"ꝟ"],[42847,2],[42848,1,"ꝡ"],[42849,2],[42850,1,"ꝣ"],[42851,2],[42852,1,"ꝥ"],[42853,2],[42854,1,"ꝧ"],[42855,2],[42856,1,"ꝩ"],[42857,2],[42858,1,"ꝫ"],[42859,2],[42860,1,"ꝭ"],[42861,2],[42862,1,"ꝯ"],[42863,2],[42864,1,"ꝯ"],[[42865,42872],2],[42873,1,"ꝺ"],[42874,2],[42875,1,"ꝼ"],[42876,2],[42877,1,"ᵹ"],[42878,1,"ꝿ"],[42879,2],[42880,1,"ꞁ"],[42881,2],[42882,1,"ꞃ"],[42883,2],[42884,1,"ꞅ"],[42885,2],[42886,1,"ꞇ"],[[42887,42888],2],[[42889,42890],2],[42891,1,"ꞌ"],[42892,2],[42893,1,"ɥ"],[42894,2],[42895,2],[42896,1,"ꞑ"],[42897,2],[42898,1,"ꞓ"],[42899,2],[[42900,42901],2],[42902,1,"ꞗ"],[42903,2],[42904,1,"ꞙ"],[42905,2],[42906,1,"ꞛ"],[42907,2],[42908,1,"ꞝ"],[42909,2],[42910,1,"ꞟ"],[42911,2],[42912,1,"ꞡ"],[42913,2],[42914,1,"ꞣ"],[42915,2],[42916,1,"ꞥ"],[42917,2],[42918,1,"ꞧ"],[42919,2],[42920,1,"ꞩ"],[42921,2],[42922,1,"ɦ"],[42923,1,"ɜ"],[42924,1,"ɡ"],[42925,1,"ɬ"],[42926,1,"ɪ"],[42927,2],[42928,1,"ʞ"],[42929,1,"ʇ"],[42930,1,"ʝ"],[42931,1,"ꭓ"],[42932,1,"ꞵ"],[42933,2],[42934,1,"ꞷ"],[42935,2],[42936,1,"ꞹ"],[42937,2],[42938,1,"ꞻ"],[42939,2],[42940,1,"ꞽ"],[42941,2],[42942,1,"ꞿ"],[42943,2],[42944,1,"ꟁ"],[42945,2],[42946,1,"ꟃ"],[42947,2],[42948,1,"ꞔ"],[42949,1,"ʂ"],[42950,1,"ᶎ"],[42951,1,"ꟈ"],[42952,2],[42953,1,"ꟊ"],[42954,2],[[42955,42959],3],[42960,1,"ꟑ"],[42961,2],[42962,3],[42963,2],[42964,3],[42965,2],[42966,1,"ꟗ"],[42967,2],[42968,1,"ꟙ"],[42969,2],[[42970,42993],3],[42994,1,"c"],[42995,1,"f"],[42996,1,"q"],[42997,1,"ꟶ"],[42998,2],[42999,2],[43000,1,"ħ"],[43001,1,"œ"],[43002,2],[[43003,43007],2],[[43008,43047],2],[[43048,43051],2],[43052,2],[[43053,43055],3],[[43056,43065],2],[[43066,43071],3],[[43072,43123],2],[[43124,43127],2],[[43128,43135],3],[[43136,43204],2],[43205,2],[[43206,43213],3],[[43214,43215],2],[[43216,43225],2],[[43226,43231],3],[[43232,43255],2],[[43256,43258],2],[43259,2],[43260,2],[43261,2],[[43262,43263],2],[[43264,43309],2],[[43310,43311],2],[[43312,43347],2],[[43348,43358],3],[43359,2],[[43360,43388],2],[[43389,43391],3],[[43392,43456],2],[[43457,43469],2],[43470,3],[[43471,43481],2],[[43482,43485],3],[[43486,43487],2],[[43488,43518],2],[43519,3],[[43520,43574],2],[[43575,43583],3],[[43584,43597],2],[[43598,43599],3],[[43600,43609],2],[[43610,43611],3],[[43612,43615],2],[[43616,43638],2],[[43639,43641],2],[[43642,43643],2],[[43644,43647],2],[[43648,43714],2],[[43715,43738],3],[[43739,43741],2],[[43742,43743],2],[[43744,43759],2],[[43760,43761],2],[[43762,43766],2],[[43767,43776],3],[[43777,43782],2],[[43783,43784],3],[[43785,43790],2],[[43791,43792],3],[[43793,43798],2],[[43799,43807],3],[[43808,43814],2],[43815,3],[[43816,43822],2],[43823,3],[[43824,43866],2],[43867,2],[43868,1,"ꜧ"],[43869,1,"ꬷ"],[43870,1,"ɫ"],[43871,1,"ꭒ"],[[43872,43875],2],[[43876,43877],2],[[43878,43879],2],[43880,2],[43881,1,"ʍ"],[[43882,43883],2],[[43884,43887],3],[43888,1,"Ꭰ"],[43889,1,"Ꭱ"],[43890,1,"Ꭲ"],[43891,1,"Ꭳ"],[43892,1,"Ꭴ"],[43893,1,"Ꭵ"],[43894,1,"Ꭶ"],[43895,1,"Ꭷ"],[43896,1,"Ꭸ"],[43897,1,"Ꭹ"],[43898,1,"Ꭺ"],[43899,1,"Ꭻ"],[43900,1,"Ꭼ"],[43901,1,"Ꭽ"],[43902,1,"Ꭾ"],[43903,1,"Ꭿ"],[43904,1,"Ꮀ"],[43905,1,"Ꮁ"],[43906,1,"Ꮂ"],[43907,1,"Ꮃ"],[43908,1,"Ꮄ"],[43909,1,"Ꮅ"],[43910,1,"Ꮆ"],[43911,1,"Ꮇ"],[43912,1,"Ꮈ"],[43913,1,"Ꮉ"],[43914,1,"Ꮊ"],[43915,1,"Ꮋ"],[43916,1,"Ꮌ"],[43917,1,"Ꮍ"],[43918,1,"Ꮎ"],[43919,1,"Ꮏ"],[43920,1,"Ꮐ"],[43921,1,"Ꮑ"],[43922,1,"Ꮒ"],[43923,1,"Ꮓ"],[43924,1,"Ꮔ"],[43925,1,"Ꮕ"],[43926,1,"Ꮖ"],[43927,1,"Ꮗ"],[43928,1,"Ꮘ"],[43929,1,"Ꮙ"],[43930,1,"Ꮚ"],[43931,1,"Ꮛ"],[43932,1,"Ꮜ"],[43933,1,"Ꮝ"],[43934,1,"Ꮞ"],[43935,1,"Ꮟ"],[43936,1,"Ꮠ"],[43937,1,"Ꮡ"],[43938,1,"Ꮢ"],[43939,1,"Ꮣ"],[43940,1,"Ꮤ"],[43941,1,"Ꮥ"],[43942,1,"Ꮦ"],[43943,1,"Ꮧ"],[43944,1,"Ꮨ"],[43945,1,"Ꮩ"],[43946,1,"Ꮪ"],[43947,1,"Ꮫ"],[43948,1,"Ꮬ"],[43949,1,"Ꮭ"],[43950,1,"Ꮮ"],[43951,1,"Ꮯ"],[43952,1,"Ꮰ"],[43953,1,"Ꮱ"],[43954,1,"Ꮲ"],[43955,1,"Ꮳ"],[43956,1,"Ꮴ"],[43957,1,"Ꮵ"],[43958,1,"Ꮶ"],[43959,1,"Ꮷ"],[43960,1,"Ꮸ"],[43961,1,"Ꮹ"],[43962,1,"Ꮺ"],[43963,1,"Ꮻ"],[43964,1,"Ꮼ"],[43965,1,"Ꮽ"],[43966,1,"Ꮾ"],[43967,1,"Ꮿ"],[[43968,44010],2],[44011,2],[[44012,44013],2],[[44014,44015],3],[[44016,44025],2],[[44026,44031],3],[[44032,55203],2],[[55204,55215],3],[[55216,55238],2],[[55239,55242],3],[[55243,55291],2],[[55292,55295],3],[[55296,57343],3],[[57344,63743],3],[63744,1,"豈"],[63745,1,"更"],[63746,1,"車"],[63747,1,"賈"],[63748,1,"滑"],[63749,1,"串"],[63750,1,"句"],[[63751,63752],1,"龜"],[63753,1,"契"],[63754,1,"金"],[63755,1,"喇"],[63756,1,"奈"],[63757,1,"懶"],[63758,1,"癩"],[63759,1,"羅"],[63760,1,"蘿"],[63761,1,"螺"],[63762,1,"裸"],[63763,1,"邏"],[63764,1,"樂"],[63765,1,"洛"],[63766,1,"烙"],[63767,1,"珞"],[63768,1,"落"],[63769,1,"酪"],[63770,1,"駱"],[63771,1,"亂"],[63772,1,"卵"],[63773,1,"欄"],[63774,1,"爛"],[63775,1,"蘭"],[63776,1,"鸞"],[63777,1,"嵐"],[63778,1,"濫"],[63779,1,"藍"],[63780,1,"襤"],[63781,1,"拉"],[63782,1,"臘"],[63783,1,"蠟"],[63784,1,"廊"],[63785,1,"朗"],[63786,1,"浪"],[63787,1,"狼"],[63788,1,"郎"],[63789,1,"來"],[63790,1,"冷"],[63791,1,"勞"],[63792,1,"擄"],[63793,1,"櫓"],[63794,1,"爐"],[63795,1,"盧"],[63796,1,"老"],[63797,1,"蘆"],[63798,1,"虜"],[63799,1,"路"],[63800,1,"露"],[63801,1,"魯"],[63802,1,"鷺"],[63803,1,"碌"],[63804,1,"祿"],[63805,1,"綠"],[63806,1,"菉"],[63807,1,"錄"],[63808,1,"鹿"],[63809,1,"論"],[63810,1,"壟"],[63811,1,"弄"],[63812,1,"籠"],[63813,1,"聾"],[63814,1,"牢"],[63815,1,"磊"],[63816,1,"賂"],[63817,1,"雷"],[63818,1,"壘"],[63819,1,"屢"],[63820,1,"樓"],[63821,1,"淚"],[63822,1,"漏"],[63823,1,"累"],[63824,1,"縷"],[63825,1,"陋"],[63826,1,"勒"],[63827,1,"肋"],[63828,1,"凜"],[63829,1,"凌"],[63830,1,"稜"],[63831,1,"綾"],[63832,1,"菱"],[63833,1,"陵"],[63834,1,"讀"],[63835,1,"拏"],[63836,1,"樂"],[63837,1,"諾"],[63838,1,"丹"],[63839,1,"寧"],[63840,1,"怒"],[63841,1,"率"],[63842,1,"異"],[63843,1,"北"],[63844,1,"磻"],[63845,1,"便"],[63846,1,"復"],[63847,1,"不"],[63848,1,"泌"],[63849,1,"數"],[63850,1,"索"],[63851,1,"參"],[63852,1,"塞"],[63853,1,"省"],[63854,1,"葉"],[63855,1,"說"],[63856,1,"殺"],[63857,1,"辰"],[63858,1,"沈"],[63859,1,"拾"],[63860,1,"若"],[63861,1,"掠"],[63862,1,"略"],[63863,1,"亮"],[63864,1,"兩"],[63865,1,"凉"],[63866,1,"梁"],[63867,1,"糧"],[63868,1,"良"],[63869,1,"諒"],[63870,1,"量"],[63871,1,"勵"],[63872,1,"呂"],[63873,1,"女"],[63874,1,"廬"],[63875,1,"旅"],[63876,1,"濾"],[63877,1,"礪"],[63878,1,"閭"],[63879,1,"驪"],[63880,1,"麗"],[63881,1,"黎"],[63882,1,"力"],[63883,1,"曆"],[63884,1,"歷"],[63885,1,"轢"],[63886,1,"年"],[63887,1,"憐"],[63888,1,"戀"],[63889,1,"撚"],[63890,1,"漣"],[63891,1,"煉"],[63892,1,"璉"],[63893,1,"秊"],[63894,1,"練"],[63895,1,"聯"],[63896,1,"輦"],[63897,1,"蓮"],[63898,1,"連"],[63899,1,"鍊"],[63900,1,"列"],[63901,1,"劣"],[63902,1,"咽"],[63903,1,"烈"],[63904,1,"裂"],[63905,1,"說"],[63906,1,"廉"],[63907,1,"念"],[63908,1,"捻"],[63909,1,"殮"],[63910,1,"簾"],[63911,1,"獵"],[63912,1,"令"],[63913,1,"囹"],[63914,1,"寧"],[63915,1,"嶺"],[63916,1,"怜"],[63917,1,"玲"],[63918,1,"瑩"],[63919,1,"羚"],[63920,1,"聆"],[63921,1,"鈴"],[63922,1,"零"],[63923,1,"靈"],[63924,1,"領"],[63925,1,"例"],[63926,1,"禮"],[63927,1,"醴"],[63928,1,"隸"],[63929,1,"惡"],[63930,1,"了"],[63931,1,"僚"],[63932,1,"寮"],[63933,1,"尿"],[63934,1,"料"],[63935,1,"樂"],[63936,1,"燎"],[63937,1,"療"],[63938,1,"蓼"],[63939,1,"遼"],[63940,1,"龍"],[63941,1,"暈"],[63942,1,"阮"],[63943,1,"劉"],[63944,1,"杻"],[63945,1,"柳"],[63946,1,"流"],[63947,1,"溜"],[63948,1,"琉"],[63949,1,"留"],[63950,1,"硫"],[63951,1,"紐"],[63952,1,"類"],[63953,1,"六"],[63954,1,"戮"],[63955,1,"陸"],[63956,1,"倫"],[63957,1,"崙"],[63958,1,"淪"],[63959,1,"輪"],[63960,1,"律"],[63961,1,"慄"],[63962,1,"栗"],[63963,1,"率"],[63964,1,"隆"],[63965,1,"利"],[63966,1,"吏"],[63967,1,"履"],[63968,1,"易"],[63969,1,"李"],[63970,1,"梨"],[63971,1,"泥"],[63972,1,"理"],[63973,1,"痢"],[63974,1,"罹"],[63975,1,"裏"],[63976,1,"裡"],[63977,1,"里"],[63978,1,"離"],[63979,1,"匿"],[63980,1,"溺"],[63981,1,"吝"],[63982,1,"燐"],[63983,1,"璘"],[63984,1,"藺"],[63985,1,"隣"],[63986,1,"鱗"],[63987,1,"麟"],[63988,1,"林"],[63989,1,"淋"],[63990,1,"臨"],[63991,1,"立"],[63992,1,"笠"],[63993,1,"粒"],[63994,1,"狀"],[63995,1,"炙"],[63996,1,"識"],[63997,1,"什"],[63998,1,"茶"],[63999,1,"刺"],[64000,1,"切"],[64001,1,"度"],[64002,1,"拓"],[64003,1,"糖"],[64004,1,"宅"],[64005,1,"洞"],[64006,1,"暴"],[64007,1,"輻"],[64008,1,"行"],[64009,1,"降"],[64010,1,"見"],[64011,1,"廓"],[64012,1,"兀"],[64013,1,"嗀"],[[64014,64015],2],[64016,1,"塚"],[64017,2],[64018,1,"晴"],[[64019,64020],2],[64021,1,"凞"],[64022,1,"猪"],[64023,1,"益"],[64024,1,"礼"],[64025,1,"神"],[64026,1,"祥"],[64027,1,"福"],[64028,1,"靖"],[64029,1,"精"],[64030,1,"羽"],[64031,2],[64032,1,"蘒"],[64033,2],[64034,1,"諸"],[[64035,64036],2],[64037,1,"逸"],[64038,1,"都"],[[64039,64041],2],[64042,1,"飯"],[64043,1,"飼"],[64044,1,"館"],[64045,1,"鶴"],[64046,1,"郞"],[64047,1,"隷"],[64048,1,"侮"],[64049,1,"僧"],[64050,1,"免"],[64051,1,"勉"],[64052,1,"勤"],[64053,1,"卑"],[64054,1,"喝"],[64055,1,"嘆"],[64056,1,"器"],[64057,1,"塀"],[64058,1,"墨"],[64059,1,"層"],[64060,1,"屮"],[64061,1,"悔"],[64062,1,"慨"],[64063,1,"憎"],[64064,1,"懲"],[64065,1,"敏"],[64066,1,"既"],[64067,1,"暑"],[64068,1,"梅"],[64069,1,"海"],[64070,1,"渚"],[64071,1,"漢"],[64072,1,"煮"],[64073,1,"爫"],[64074,1,"琢"],[64075,1,"碑"],[64076,1,"社"],[64077,1,"祉"],[64078,1,"祈"],[64079,1,"祐"],[64080,1,"祖"],[64081,1,"祝"],[64082,1,"禍"],[64083,1,"禎"],[64084,1,"穀"],[64085,1,"突"],[64086,1,"節"],[64087,1,"練"],[64088,1,"縉"],[64089,1,"繁"],[64090,1,"署"],[64091,1,"者"],[64092,1,"臭"],[[64093,64094],1,"艹"],[64095,1,"著"],[64096,1,"褐"],[64097,1,"視"],[64098,1,"謁"],[64099,1,"謹"],[64100,1,"賓"],[64101,1,"贈"],[64102,1,"辶"],[64103,1,"逸"],[64104,1,"難"],[64105,1,"響"],[64106,1,"頻"],[64107,1,"恵"],[64108,1,"𤋮"],[64109,1,"舘"],[[64110,64111],3],[64112,1,"並"],[64113,1,"况"],[64114,1,"全"],[64115,1,"侀"],[64116,1,"充"],[64117,1,"冀"],[64118,1,"勇"],[64119,1,"勺"],[64120,1,"喝"],[64121,1,"啕"],[64122,1,"喙"],[64123,1,"嗢"],[64124,1,"塚"],[64125,1,"墳"],[64126,1,"奄"],[64127,1,"奔"],[64128,1,"婢"],[64129,1,"嬨"],[64130,1,"廒"],[64131,1,"廙"],[64132,1,"彩"],[64133,1,"徭"],[64134,1,"惘"],[64135,1,"慎"],[64136,1,"愈"],[64137,1,"憎"],[64138,1,"慠"],[64139,1,"懲"],[64140,1,"戴"],[64141,1,"揄"],[64142,1,"搜"],[64143,1,"摒"],[64144,1,"敖"],[64145,1,"晴"],[64146,1,"朗"],[64147,1,"望"],[64148,1,"杖"],[64149,1,"歹"],[64150,1,"殺"],[64151,1,"流"],[64152,1,"滛"],[64153,1,"滋"],[64154,1,"漢"],[64155,1,"瀞"],[64156,1,"煮"],[64157,1,"瞧"],[64158,1,"爵"],[64159,1,"犯"],[64160,1,"猪"],[64161,1,"瑱"],[64162,1,"甆"],[64163,1,"画"],[64164,1,"瘝"],[64165,1,"瘟"],[64166,1,"益"],[64167,1,"盛"],[64168,1,"直"],[64169,1,"睊"],[64170,1,"着"],[64171,1,"磌"],[64172,1,"窱"],[64173,1,"節"],[64174,1,"类"],[64175,1,"絛"],[64176,1,"練"],[64177,1,"缾"],[64178,1,"者"],[64179,1,"荒"],[64180,1,"華"],[64181,1,"蝹"],[64182,1,"襁"],[64183,1,"覆"],[64184,1,"視"],[64185,1,"調"],[64186,1,"諸"],[64187,1,"請"],[64188,1,"謁"],[64189,1,"諾"],[64190,1,"諭"],[64191,1,"謹"],[64192,1,"變"],[64193,1,"贈"],[64194,1,"輸"],[64195,1,"遲"],[64196,1,"醙"],[64197,1,"鉶"],[64198,1,"陼"],[64199,1,"難"],[64200,1,"靖"],[64201,1,"韛"],[64202,1,"響"],[64203,1,"頋"],[64204,1,"頻"],[64205,1,"鬒"],[64206,1,"龜"],[64207,1,"𢡊"],[64208,1,"𢡄"],[64209,1,"𣏕"],[64210,1,"㮝"],[64211,1,"䀘"],[64212,1,"䀹"],[64213,1,"𥉉"],[64214,1,"𥳐"],[64215,1,"𧻓"],[64216,1,"齃"],[64217,1,"龎"],[[64218,64255],3],[64256,1,"ff"],[64257,1,"fi"],[64258,1,"fl"],[64259,1,"ffi"],[64260,1,"ffl"],[[64261,64262],1,"st"],[[64263,64274],3],[64275,1,"մն"],[64276,1,"մե"],[64277,1,"մի"],[64278,1,"վն"],[64279,1,"մխ"],[[64280,64284],3],[64285,1,"יִ"],[64286,2],[64287,1,"ײַ"],[64288,1,"ע"],[64289,1,"א"],[64290,1,"ד"],[64291,1,"ה"],[64292,1,"כ"],[64293,1,"ל"],[64294,1,"ם"],[64295,1,"ר"],[64296,1,"ת"],[64297,5,"+"],[64298,1,"שׁ"],[64299,1,"שׂ"],[64300,1,"שּׁ"],[64301,1,"שּׂ"],[64302,1,"אַ"],[64303,1,"אָ"],[64304,1,"אּ"],[64305,1,"בּ"],[64306,1,"גּ"],[64307,1,"דּ"],[64308,1,"הּ"],[64309,1,"וּ"],[64310,1,"זּ"],[64311,3],[64312,1,"טּ"],[64313,1,"יּ"],[64314,1,"ךּ"],[64315,1,"כּ"],[64316,1,"לּ"],[64317,3],[64318,1,"מּ"],[64319,3],[64320,1,"נּ"],[64321,1,"סּ"],[64322,3],[64323,1,"ףּ"],[64324,1,"פּ"],[64325,3],[64326,1,"צּ"],[64327,1,"קּ"],[64328,1,"רּ"],[64329,1,"שּ"],[64330,1,"תּ"],[64331,1,"וֹ"],[64332,1,"בֿ"],[64333,1,"כֿ"],[64334,1,"פֿ"],[64335,1,"אל"],[[64336,64337],1,"ٱ"],[[64338,64341],1,"ٻ"],[[64342,64345],1,"پ"],[[64346,64349],1,"ڀ"],[[64350,64353],1,"ٺ"],[[64354,64357],1,"ٿ"],[[64358,64361],1,"ٹ"],[[64362,64365],1,"ڤ"],[[64366,64369],1,"ڦ"],[[64370,64373],1,"ڄ"],[[64374,64377],1,"ڃ"],[[64378,64381],1,"چ"],[[64382,64385],1,"ڇ"],[[64386,64387],1,"ڍ"],[[64388,64389],1,"ڌ"],[[64390,64391],1,"ڎ"],[[64392,64393],1,"ڈ"],[[64394,64395],1,"ژ"],[[64396,64397],1,"ڑ"],[[64398,64401],1,"ک"],[[64402,64405],1,"گ"],[[64406,64409],1,"ڳ"],[[64410,64413],1,"ڱ"],[[64414,64415],1,"ں"],[[64416,64419],1,"ڻ"],[[64420,64421],1,"ۀ"],[[64422,64425],1,"ہ"],[[64426,64429],1,"ھ"],[[64430,64431],1,"ے"],[[64432,64433],1,"ۓ"],[[64434,64449],2],[64450,2],[[64451,64466],3],[[64467,64470],1,"ڭ"],[[64471,64472],1,"ۇ"],[[64473,64474],1,"ۆ"],[[64475,64476],1,"ۈ"],[64477,1,"ۇٴ"],[[64478,64479],1,"ۋ"],[[64480,64481],1,"ۅ"],[[64482,64483],1,"ۉ"],[[64484,64487],1,"ې"],[[64488,64489],1,"ى"],[[64490,64491],1,"ئا"],[[64492,64493],1,"ئە"],[[64494,64495],1,"ئو"],[[64496,64497],1,"ئۇ"],[[64498,64499],1,"ئۆ"],[[64500,64501],1,"ئۈ"],[[64502,64504],1,"ئې"],[[64505,64507],1,"ئى"],[[64508,64511],1,"ی"],[64512,1,"ئج"],[64513,1,"ئح"],[64514,1,"ئم"],[64515,1,"ئى"],[64516,1,"ئي"],[64517,1,"بج"],[64518,1,"بح"],[64519,1,"بخ"],[64520,1,"بم"],[64521,1,"بى"],[64522,1,"بي"],[64523,1,"تج"],[64524,1,"تح"],[64525,1,"تخ"],[64526,1,"تم"],[64527,1,"تى"],[64528,1,"تي"],[64529,1,"ثج"],[64530,1,"ثم"],[64531,1,"ثى"],[64532,1,"ثي"],[64533,1,"جح"],[64534,1,"جم"],[64535,1,"حج"],[64536,1,"حم"],[64537,1,"خج"],[64538,1,"خح"],[64539,1,"خم"],[64540,1,"سج"],[64541,1,"سح"],[64542,1,"سخ"],[64543,1,"سم"],[64544,1,"صح"],[64545,1,"صم"],[64546,1,"ضج"],[64547,1,"ضح"],[64548,1,"ضخ"],[64549,1,"ضم"],[64550,1,"طح"],[64551,1,"طم"],[64552,1,"ظم"],[64553,1,"عج"],[64554,1,"عم"],[64555,1,"غج"],[64556,1,"غم"],[64557,1,"فج"],[64558,1,"فح"],[64559,1,"فخ"],[64560,1,"فم"],[64561,1,"فى"],[64562,1,"في"],[64563,1,"قح"],[64564,1,"قم"],[64565,1,"قى"],[64566,1,"قي"],[64567,1,"كا"],[64568,1,"كج"],[64569,1,"كح"],[64570,1,"كخ"],[64571,1,"كل"],[64572,1,"كم"],[64573,1,"كى"],[64574,1,"كي"],[64575,1,"لج"],[64576,1,"لح"],[64577,1,"لخ"],[64578,1,"لم"],[64579,1,"لى"],[64580,1,"لي"],[64581,1,"مج"],[64582,1,"مح"],[64583,1,"مخ"],[64584,1,"مم"],[64585,1,"مى"],[64586,1,"مي"],[64587,1,"نج"],[64588,1,"نح"],[64589,1,"نخ"],[64590,1,"نم"],[64591,1,"نى"],[64592,1,"ني"],[64593,1,"هج"],[64594,1,"هم"],[64595,1,"هى"],[64596,1,"هي"],[64597,1,"يج"],[64598,1,"يح"],[64599,1,"يخ"],[64600,1,"يم"],[64601,1,"يى"],[64602,1,"يي"],[64603,1,"ذٰ"],[64604,1,"رٰ"],[64605,1,"ىٰ"],[64606,5," ٌّ"],[64607,5," ٍّ"],[64608,5," َّ"],[64609,5," ُّ"],[64610,5," ِّ"],[64611,5," ّٰ"],[64612,1,"ئر"],[64613,1,"ئز"],[64614,1,"ئم"],[64615,1,"ئن"],[64616,1,"ئى"],[64617,1,"ئي"],[64618,1,"بر"],[64619,1,"بز"],[64620,1,"بم"],[64621,1,"بن"],[64622,1,"بى"],[64623,1,"بي"],[64624,1,"تر"],[64625,1,"تز"],[64626,1,"تم"],[64627,1,"تن"],[64628,1,"تى"],[64629,1,"تي"],[64630,1,"ثر"],[64631,1,"ثز"],[64632,1,"ثم"],[64633,1,"ثن"],[64634,1,"ثى"],[64635,1,"ثي"],[64636,1,"فى"],[64637,1,"في"],[64638,1,"قى"],[64639,1,"قي"],[64640,1,"كا"],[64641,1,"كل"],[64642,1,"كم"],[64643,1,"كى"],[64644,1,"كي"],[64645,1,"لم"],[64646,1,"لى"],[64647,1,"لي"],[64648,1,"ما"],[64649,1,"مم"],[64650,1,"نر"],[64651,1,"نز"],[64652,1,"نم"],[64653,1,"نن"],[64654,1,"نى"],[64655,1,"ني"],[64656,1,"ىٰ"],[64657,1,"ير"],[64658,1,"يز"],[64659,1,"يم"],[64660,1,"ين"],[64661,1,"يى"],[64662,1,"يي"],[64663,1,"ئج"],[64664,1,"ئح"],[64665,1,"ئخ"],[64666,1,"ئم"],[64667,1,"ئه"],[64668,1,"بج"],[64669,1,"بح"],[64670,1,"بخ"],[64671,1,"بم"],[64672,1,"به"],[64673,1,"تج"],[64674,1,"تح"],[64675,1,"تخ"],[64676,1,"تم"],[64677,1,"ته"],[64678,1,"ثم"],[64679,1,"جح"],[64680,1,"جم"],[64681,1,"حج"],[64682,1,"حم"],[64683,1,"خج"],[64684,1,"خم"],[64685,1,"سج"],[64686,1,"سح"],[64687,1,"سخ"],[64688,1,"سم"],[64689,1,"صح"],[64690,1,"صخ"],[64691,1,"صم"],[64692,1,"ضج"],[64693,1,"ضح"],[64694,1,"ضخ"],[64695,1,"ضم"],[64696,1,"طح"],[64697,1,"ظم"],[64698,1,"عج"],[64699,1,"عم"],[64700,1,"غج"],[64701,1,"غم"],[64702,1,"فج"],[64703,1,"فح"],[64704,1,"فخ"],[64705,1,"فم"],[64706,1,"قح"],[64707,1,"قم"],[64708,1,"كج"],[64709,1,"كح"],[64710,1,"كخ"],[64711,1,"كل"],[64712,1,"كم"],[64713,1,"لج"],[64714,1,"لح"],[64715,1,"لخ"],[64716,1,"لم"],[64717,1,"له"],[64718,1,"مج"],[64719,1,"مح"],[64720,1,"مخ"],[64721,1,"مم"],[64722,1,"نج"],[64723,1,"نح"],[64724,1,"نخ"],[64725,1,"نم"],[64726,1,"نه"],[64727,1,"هج"],[64728,1,"هم"],[64729,1,"هٰ"],[64730,1,"يج"],[64731,1,"يح"],[64732,1,"يخ"],[64733,1,"يم"],[64734,1,"يه"],[64735,1,"ئم"],[64736,1,"ئه"],[64737,1,"بم"],[64738,1,"به"],[64739,1,"تم"],[64740,1,"ته"],[64741,1,"ثم"],[64742,1,"ثه"],[64743,1,"سم"],[64744,1,"سه"],[64745,1,"شم"],[64746,1,"شه"],[64747,1,"كل"],[64748,1,"كم"],[64749,1,"لم"],[64750,1,"نم"],[64751,1,"نه"],[64752,1,"يم"],[64753,1,"يه"],[64754,1,"ـَّ"],[64755,1,"ـُّ"],[64756,1,"ـِّ"],[64757,1,"طى"],[64758,1,"طي"],[64759,1,"عى"],[64760,1,"عي"],[64761,1,"غى"],[64762,1,"غي"],[64763,1,"سى"],[64764,1,"سي"],[64765,1,"شى"],[64766,1,"شي"],[64767,1,"حى"],[64768,1,"حي"],[64769,1,"جى"],[64770,1,"جي"],[64771,1,"خى"],[64772,1,"خي"],[64773,1,"صى"],[64774,1,"صي"],[64775,1,"ضى"],[64776,1,"ضي"],[64777,1,"شج"],[64778,1,"شح"],[64779,1,"شخ"],[64780,1,"شم"],[64781,1,"شر"],[64782,1,"سر"],[64783,1,"صر"],[64784,1,"ضر"],[64785,1,"طى"],[64786,1,"طي"],[64787,1,"عى"],[64788,1,"عي"],[64789,1,"غى"],[64790,1,"غي"],[64791,1,"سى"],[64792,1,"سي"],[64793,1,"شى"],[64794,1,"شي"],[64795,1,"حى"],[64796,1,"حي"],[64797,1,"جى"],[64798,1,"جي"],[64799,1,"خى"],[64800,1,"خي"],[64801,1,"صى"],[64802,1,"صي"],[64803,1,"ضى"],[64804,1,"ضي"],[64805,1,"شج"],[64806,1,"شح"],[64807,1,"شخ"],[64808,1,"شم"],[64809,1,"شر"],[64810,1,"سر"],[64811,1,"صر"],[64812,1,"ضر"],[64813,1,"شج"],[64814,1,"شح"],[64815,1,"شخ"],[64816,1,"شم"],[64817,1,"سه"],[64818,1,"شه"],[64819,1,"طم"],[64820,1,"سج"],[64821,1,"سح"],[64822,1,"سخ"],[64823,1,"شج"],[64824,1,"شح"],[64825,1,"شخ"],[64826,1,"طم"],[64827,1,"ظم"],[[64828,64829],1,"اً"],[[64830,64831],2],[[64832,64847],2],[64848,1,"تجم"],[[64849,64850],1,"تحج"],[64851,1,"تحم"],[64852,1,"تخم"],[64853,1,"تمج"],[64854,1,"تمح"],[64855,1,"تمخ"],[[64856,64857],1,"جمح"],[64858,1,"حمي"],[64859,1,"حمى"],[64860,1,"سحج"],[64861,1,"سجح"],[64862,1,"سجى"],[[64863,64864],1,"سمح"],[64865,1,"سمج"],[[64866,64867],1,"سمم"],[[64868,64869],1,"صحح"],[64870,1,"صمم"],[[64871,64872],1,"شحم"],[64873,1,"شجي"],[[64874,64875],1,"شمخ"],[[64876,64877],1,"شمم"],[64878,1,"ضحى"],[[64879,64880],1,"ضخم"],[[64881,64882],1,"طمح"],[64883,1,"طمم"],[64884,1,"طمي"],[64885,1,"عجم"],[[64886,64887],1,"عمم"],[64888,1,"عمى"],[64889,1,"غمم"],[64890,1,"غمي"],[64891,1,"غمى"],[[64892,64893],1,"فخم"],[64894,1,"قمح"],[64895,1,"قمم"],[64896,1,"لحم"],[64897,1,"لحي"],[64898,1,"لحى"],[[64899,64900],1,"لجج"],[[64901,64902],1,"لخم"],[[64903,64904],1,"لمح"],[64905,1,"محج"],[64906,1,"محم"],[64907,1,"محي"],[64908,1,"مجح"],[64909,1,"مجم"],[64910,1,"مخج"],[64911,1,"مخم"],[[64912,64913],3],[64914,1,"مجخ"],[64915,1,"همج"],[64916,1,"همم"],[64917,1,"نحم"],[64918,1,"نحى"],[[64919,64920],1,"نجم"],[64921,1,"نجى"],[64922,1,"نمي"],[64923,1,"نمى"],[[64924,64925],1,"يمم"],[64926,1,"بخي"],[64927,1,"تجي"],[64928,1,"تجى"],[64929,1,"تخي"],[64930,1,"تخى"],[64931,1,"تمي"],[64932,1,"تمى"],[64933,1,"جمي"],[64934,1,"جحى"],[64935,1,"جمى"],[64936,1,"سخى"],[64937,1,"صحي"],[64938,1,"شحي"],[64939,1,"ضحي"],[64940,1,"لجي"],[64941,1,"لمي"],[64942,1,"يحي"],[64943,1,"يجي"],[64944,1,"يمي"],[64945,1,"ممي"],[64946,1,"قمي"],[64947,1,"نحي"],[64948,1,"قمح"],[64949,1,"لحم"],[64950,1,"عمي"],[64951,1,"كمي"],[64952,1,"نجح"],[64953,1,"مخي"],[64954,1,"لجم"],[64955,1,"كمم"],[64956,1,"لجم"],[64957,1,"نجح"],[64958,1,"جحي"],[64959,1,"حجي"],[64960,1,"مجي"],[64961,1,"فمي"],[64962,1,"بحي"],[64963,1,"كمم"],[64964,1,"عجم"],[64965,1,"صمم"],[64966,1,"سخي"],[64967,1,"نجي"],[[64968,64974],3],[64975,2],[[64976,65007],3],[65008,1,"صلے"],[65009,1,"قلے"],[65010,1,"الله"],[65011,1,"اكبر"],[65012,1,"محمد"],[65013,1,"صلعم"],[65014,1,"رسول"],[65015,1,"عليه"],[65016,1,"وسلم"],[65017,1,"صلى"],[65018,5,"صلى الله عليه وسلم"],[65019,5,"جل جلاله"],[65020,1,"ریال"],[65021,2],[[65022,65023],2],[[65024,65039],7],[65040,5,","],[65041,1,"、"],[65042,3],[65043,5,":"],[65044,5,";"],[65045,5,"!"],[65046,5,"?"],[65047,1,"〖"],[65048,1,"〗"],[65049,3],[[65050,65055],3],[[65056,65059],2],[[65060,65062],2],[[65063,65069],2],[[65070,65071],2],[65072,3],[65073,1,"—"],[65074,1,"–"],[[65075,65076],5,"_"],[65077,5,"("],[65078,5,")"],[65079,5,"{"],[65080,5,"}"],[65081,1,"〔"],[65082,1,"〕"],[65083,1,"【"],[65084,1,"】"],[65085,1,"《"],[65086,1,"》"],[65087,1,"〈"],[65088,1,"〉"],[65089,1,"「"],[65090,1,"」"],[65091,1,"『"],[65092,1,"』"],[[65093,65094],2],[65095,5,"["],[65096,5,"]"],[[65097,65100],5," ̅"],[[65101,65103],5,"_"],[65104,5,","],[65105,1,"、"],[65106,3],[65107,3],[65108,5,";"],[65109,5,":"],[65110,5,"?"],[65111,5,"!"],[65112,1,"—"],[65113,5,"("],[65114,5,")"],[65115,5,"{"],[65116,5,"}"],[65117,1,"〔"],[65118,1,"〕"],[65119,5,"#"],[65120,5,"&"],[65121,5,"*"],[65122,5,"+"],[65123,1,"-"],[65124,5,"<"],[65125,5,">"],[65126,5,"="],[65127,3],[65128,5,"\\"],[65129,5,"$"],[65130,5,"%"],[65131,5,"@"],[[65132,65135],3],[65136,5," ً"],[65137,1,"ـً"],[65138,5," ٌ"],[65139,2],[65140,5," ٍ"],[65141,3],[65142,5," َ"],[65143,1,"ـَ"],[65144,5," ُ"],[65145,1,"ـُ"],[65146,5," ِ"],[65147,1,"ـِ"],[65148,5," ّ"],[65149,1,"ـّ"],[65150,5," ْ"],[65151,1,"ـْ"],[65152,1,"ء"],[[65153,65154],1,"آ"],[[65155,65156],1,"أ"],[[65157,65158],1,"ؤ"],[[65159,65160],1,"إ"],[[65161,65164],1,"ئ"],[[65165,65166],1,"ا"],[[65167,65170],1,"ب"],[[65171,65172],1,"ة"],[[65173,65176],1,"ت"],[[65177,65180],1,"ث"],[[65181,65184],1,"ج"],[[65185,65188],1,"ح"],[[65189,65192],1,"خ"],[[65193,65194],1,"د"],[[65195,65196],1,"ذ"],[[65197,65198],1,"ر"],[[65199,65200],1,"ز"],[[65201,65204],1,"س"],[[65205,65208],1,"ش"],[[65209,65212],1,"ص"],[[65213,65216],1,"ض"],[[65217,65220],1,"ط"],[[65221,65224],1,"ظ"],[[65225,65228],1,"ع"],[[65229,65232],1,"غ"],[[65233,65236],1,"ف"],[[65237,65240],1,"ق"],[[65241,65244],1,"ك"],[[65245,65248],1,"ل"],[[65249,65252],1,"م"],[[65253,65256],1,"ن"],[[65257,65260],1,"ه"],[[65261,65262],1,"و"],[[65263,65264],1,"ى"],[[65265,65268],1,"ي"],[[65269,65270],1,"لآ"],[[65271,65272],1,"لأ"],[[65273,65274],1,"لإ"],[[65275,65276],1,"لا"],[[65277,65278],3],[65279,7],[65280,3],[65281,5,"!"],[65282,5,"\""],[65283,5,"#"],[65284,5,"$"],[65285,5,"%"],[65286,5,"&"],[65287,5,"'"],[65288,5,"("],[65289,5,")"],[65290,5,"*"],[65291,5,"+"],[65292,5,","],[65293,1,"-"],[65294,1,"."],[65295,5,"/"],[65296,1,"0"],[65297,1,"1"],[65298,1,"2"],[65299,1,"3"],[65300,1,"4"],[65301,1,"5"],[65302,1,"6"],[65303,1,"7"],[65304,1,"8"],[65305,1,"9"],[65306,5,":"],[65307,5,";"],[65308,5,"<"],[65309,5,"="],[65310,5,">"],[65311,5,"?"],[65312,5,"@"],[65313,1,"a"],[65314,1,"b"],[65315,1,"c"],[65316,1,"d"],[65317,1,"e"],[65318,1,"f"],[65319,1,"g"],[65320,1,"h"],[65321,1,"i"],[65322,1,"j"],[65323,1,"k"],[65324,1,"l"],[65325,1,"m"],[65326,1,"n"],[65327,1,"o"],[65328,1,"p"],[65329,1,"q"],[65330,1,"r"],[65331,1,"s"],[65332,1,"t"],[65333,1,"u"],[65334,1,"v"],[65335,1,"w"],[65336,1,"x"],[65337,1,"y"],[65338,1,"z"],[65339,5,"["],[65340,5,"\\"],[65341,5,"]"],[65342,5,"^"],[65343,5,"_"],[65344,5,"`"],[65345,1,"a"],[65346,1,"b"],[65347,1,"c"],[65348,1,"d"],[65349,1,"e"],[65350,1,"f"],[65351,1,"g"],[65352,1,"h"],[65353,1,"i"],[65354,1,"j"],[65355,1,"k"],[65356,1,"l"],[65357,1,"m"],[65358,1,"n"],[65359,1,"o"],[65360,1,"p"],[65361,1,"q"],[65362,1,"r"],[65363,1,"s"],[65364,1,"t"],[65365,1,"u"],[65366,1,"v"],[65367,1,"w"],[65368,1,"x"],[65369,1,"y"],[65370,1,"z"],[65371,5,"{"],[65372,5,"|"],[65373,5,"}"],[65374,5,"~"],[65375,1,"⦅"],[65376,1,"⦆"],[65377,1,"."],[65378,1,"「"],[65379,1,"」"],[65380,1,"、"],[65381,1,"・"],[65382,1,"ヲ"],[65383,1,"ァ"],[65384,1,"ィ"],[65385,1,"ゥ"],[65386,1,"ェ"],[65387,1,"ォ"],[65388,1,"ャ"],[65389,1,"ュ"],[65390,1,"ョ"],[65391,1,"ッ"],[65392,1,"ー"],[65393,1,"ア"],[65394,1,"イ"],[65395,1,"ウ"],[65396,1,"エ"],[65397,1,"オ"],[65398,1,"カ"],[65399,1,"キ"],[65400,1,"ク"],[65401,1,"ケ"],[65402,1,"コ"],[65403,1,"サ"],[65404,1,"シ"],[65405,1,"ス"],[65406,1,"セ"],[65407,1,"ソ"],[65408,1,"タ"],[65409,1,"チ"],[65410,1,"ツ"],[65411,1,"テ"],[65412,1,"ト"],[65413,1,"ナ"],[65414,1,"ニ"],[65415,1,"ヌ"],[65416,1,"ネ"],[65417,1,"ノ"],[65418,1,"ハ"],[65419,1,"ヒ"],[65420,1,"フ"],[65421,1,"ヘ"],[65422,1,"ホ"],[65423,1,"マ"],[65424,1,"ミ"],[65425,1,"ム"],[65426,1,"メ"],[65427,1,"モ"],[65428,1,"ヤ"],[65429,1,"ユ"],[65430,1,"ヨ"],[65431,1,"ラ"],[65432,1,"リ"],[65433,1,"ル"],[65434,1,"レ"],[65435,1,"ロ"],[65436,1,"ワ"],[65437,1,"ン"],[65438,1,"゙"],[65439,1,"゚"],[65440,3],[65441,1,"ᄀ"],[65442,1,"ᄁ"],[65443,1,"ᆪ"],[65444,1,"ᄂ"],[65445,1,"ᆬ"],[65446,1,"ᆭ"],[65447,1,"ᄃ"],[65448,1,"ᄄ"],[65449,1,"ᄅ"],[65450,1,"ᆰ"],[65451,1,"ᆱ"],[65452,1,"ᆲ"],[65453,1,"ᆳ"],[65454,1,"ᆴ"],[65455,1,"ᆵ"],[65456,1,"ᄚ"],[65457,1,"ᄆ"],[65458,1,"ᄇ"],[65459,1,"ᄈ"],[65460,1,"ᄡ"],[65461,1,"ᄉ"],[65462,1,"ᄊ"],[65463,1,"ᄋ"],[65464,1,"ᄌ"],[65465,1,"ᄍ"],[65466,1,"ᄎ"],[65467,1,"ᄏ"],[65468,1,"ᄐ"],[65469,1,"ᄑ"],[65470,1,"ᄒ"],[[65471,65473],3],[65474,1,"ᅡ"],[65475,1,"ᅢ"],[65476,1,"ᅣ"],[65477,1,"ᅤ"],[65478,1,"ᅥ"],[65479,1,"ᅦ"],[[65480,65481],3],[65482,1,"ᅧ"],[65483,1,"ᅨ"],[65484,1,"ᅩ"],[65485,1,"ᅪ"],[65486,1,"ᅫ"],[65487,1,"ᅬ"],[[65488,65489],3],[65490,1,"ᅭ"],[65491,1,"ᅮ"],[65492,1,"ᅯ"],[65493,1,"ᅰ"],[65494,1,"ᅱ"],[65495,1,"ᅲ"],[[65496,65497],3],[65498,1,"ᅳ"],[65499,1,"ᅴ"],[65500,1,"ᅵ"],[[65501,65503],3],[65504,1,"¢"],[65505,1,"£"],[65506,1,"¬"],[65507,5," ̄"],[65508,1,"¦"],[65509,1,"¥"],[65510,1,"₩"],[65511,3],[65512,1,"│"],[65513,1,"←"],[65514,1,"↑"],[65515,1,"→"],[65516,1,"↓"],[65517,1,"■"],[65518,1,"○"],[[65519,65528],3],[[65529,65531],3],[65532,3],[65533,3],[[65534,65535],3],[[65536,65547],2],[65548,3],[[65549,65574],2],[65575,3],[[65576,65594],2],[65595,3],[[65596,65597],2],[65598,3],[[65599,65613],2],[[65614,65615],3],[[65616,65629],2],[[65630,65663],3],[[65664,65786],2],[[65787,65791],3],[[65792,65794],2],[[65795,65798],3],[[65799,65843],2],[[65844,65846],3],[[65847,65855],2],[[65856,65930],2],[[65931,65932],2],[[65933,65934],2],[65935,3],[[65936,65947],2],[65948,2],[[65949,65951],3],[65952,2],[[65953,65999],3],[[66000,66044],2],[66045,2],[[66046,66175],3],[[66176,66204],2],[[66205,66207],3],[[66208,66256],2],[[66257,66271],3],[66272,2],[[66273,66299],2],[[66300,66303],3],[[66304,66334],2],[66335,2],[[66336,66339],2],[[66340,66348],3],[[66349,66351],2],[[66352,66368],2],[66369,2],[[66370,66377],2],[66378,2],[[66379,66383],3],[[66384,66426],2],[[66427,66431],3],[[66432,66461],2],[66462,3],[66463,2],[[66464,66499],2],[[66500,66503],3],[[66504,66511],2],[[66512,66517],2],[[66518,66559],3],[66560,1,"𐐨"],[66561,1,"𐐩"],[66562,1,"𐐪"],[66563,1,"𐐫"],[66564,1,"𐐬"],[66565,1,"𐐭"],[66566,1,"𐐮"],[66567,1,"𐐯"],[66568,1,"𐐰"],[66569,1,"𐐱"],[66570,1,"𐐲"],[66571,1,"𐐳"],[66572,1,"𐐴"],[66573,1,"𐐵"],[66574,1,"𐐶"],[66575,1,"𐐷"],[66576,1,"𐐸"],[66577,1,"𐐹"],[66578,1,"𐐺"],[66579,1,"𐐻"],[66580,1,"𐐼"],[66581,1,"𐐽"],[66582,1,"𐐾"],[66583,1,"𐐿"],[66584,1,"𐑀"],[66585,1,"𐑁"],[66586,1,"𐑂"],[66587,1,"𐑃"],[66588,1,"𐑄"],[66589,1,"𐑅"],[66590,1,"𐑆"],[66591,1,"𐑇"],[66592,1,"𐑈"],[66593,1,"𐑉"],[66594,1,"𐑊"],[66595,1,"𐑋"],[66596,1,"𐑌"],[66597,1,"𐑍"],[66598,1,"𐑎"],[66599,1,"𐑏"],[[66600,66637],2],[[66638,66717],2],[[66718,66719],3],[[66720,66729],2],[[66730,66735],3],[66736,1,"𐓘"],[66737,1,"𐓙"],[66738,1,"𐓚"],[66739,1,"𐓛"],[66740,1,"𐓜"],[66741,1,"𐓝"],[66742,1,"𐓞"],[66743,1,"𐓟"],[66744,1,"𐓠"],[66745,1,"𐓡"],[66746,1,"𐓢"],[66747,1,"𐓣"],[66748,1,"𐓤"],[66749,1,"𐓥"],[66750,1,"𐓦"],[66751,1,"𐓧"],[66752,1,"𐓨"],[66753,1,"𐓩"],[66754,1,"𐓪"],[66755,1,"𐓫"],[66756,1,"𐓬"],[66757,1,"𐓭"],[66758,1,"𐓮"],[66759,1,"𐓯"],[66760,1,"𐓰"],[66761,1,"𐓱"],[66762,1,"𐓲"],[66763,1,"𐓳"],[66764,1,"𐓴"],[66765,1,"𐓵"],[66766,1,"𐓶"],[66767,1,"𐓷"],[66768,1,"𐓸"],[66769,1,"𐓹"],[66770,1,"𐓺"],[66771,1,"𐓻"],[[66772,66775],3],[[66776,66811],2],[[66812,66815],3],[[66816,66855],2],[[66856,66863],3],[[66864,66915],2],[[66916,66926],3],[66927,2],[66928,1,"𐖗"],[66929,1,"𐖘"],[66930,1,"𐖙"],[66931,1,"𐖚"],[66932,1,"𐖛"],[66933,1,"𐖜"],[66934,1,"𐖝"],[66935,1,"𐖞"],[66936,1,"𐖟"],[66937,1,"𐖠"],[66938,1,"𐖡"],[66939,3],[66940,1,"𐖣"],[66941,1,"𐖤"],[66942,1,"𐖥"],[66943,1,"𐖦"],[66944,1,"𐖧"],[66945,1,"𐖨"],[66946,1,"𐖩"],[66947,1,"𐖪"],[66948,1,"𐖫"],[66949,1,"𐖬"],[66950,1,"𐖭"],[66951,1,"𐖮"],[66952,1,"𐖯"],[66953,1,"𐖰"],[66954,1,"𐖱"],[66955,3],[66956,1,"𐖳"],[66957,1,"𐖴"],[66958,1,"𐖵"],[66959,1,"𐖶"],[66960,1,"𐖷"],[66961,1,"𐖸"],[66962,1,"𐖹"],[66963,3],[66964,1,"𐖻"],[66965,1,"𐖼"],[66966,3],[[66967,66977],2],[66978,3],[[66979,66993],2],[66994,3],[[66995,67001],2],[67002,3],[[67003,67004],2],[[67005,67071],3],[[67072,67382],2],[[67383,67391],3],[[67392,67413],2],[[67414,67423],3],[[67424,67431],2],[[67432,67455],3],[67456,2],[67457,1,"ː"],[67458,1,"ˑ"],[67459,1,"æ"],[67460,1,"ʙ"],[67461,1,"ɓ"],[67462,3],[67463,1,"ʣ"],[67464,1,"ꭦ"],[67465,1,"ʥ"],[67466,1,"ʤ"],[67467,1,"ɖ"],[67468,1,"ɗ"],[67469,1,"ᶑ"],[67470,1,"ɘ"],[67471,1,"ɞ"],[67472,1,"ʩ"],[67473,1,"ɤ"],[67474,1,"ɢ"],[67475,1,"ɠ"],[67476,1,"ʛ"],[67477,1,"ħ"],[67478,1,"ʜ"],[67479,1,"ɧ"],[67480,1,"ʄ"],[67481,1,"ʪ"],[67482,1,"ʫ"],[67483,1,"ɬ"],[67484,1,"𝼄"],[67485,1,"ꞎ"],[67486,1,"ɮ"],[67487,1,"𝼅"],[67488,1,"ʎ"],[67489,1,"𝼆"],[67490,1,"ø"],[67491,1,"ɶ"],[67492,1,"ɷ"],[67493,1,"q"],[67494,1,"ɺ"],[67495,1,"𝼈"],[67496,1,"ɽ"],[67497,1,"ɾ"],[67498,1,"ʀ"],[67499,1,"ʨ"],[67500,1,"ʦ"],[67501,1,"ꭧ"],[67502,1,"ʧ"],[67503,1,"ʈ"],[67504,1,"ⱱ"],[67505,3],[67506,1,"ʏ"],[67507,1,"ʡ"],[67508,1,"ʢ"],[67509,1,"ʘ"],[67510,1,"ǀ"],[67511,1,"ǁ"],[67512,1,"ǂ"],[67513,1,"𝼊"],[67514,1,"𝼞"],[[67515,67583],3],[[67584,67589],2],[[67590,67591],3],[67592,2],[67593,3],[[67594,67637],2],[67638,3],[[67639,67640],2],[[67641,67643],3],[67644,2],[[67645,67646],3],[67647,2],[[67648,67669],2],[67670,3],[[67671,67679],2],[[67680,67702],2],[[67703,67711],2],[[67712,67742],2],[[67743,67750],3],[[67751,67759],2],[[67760,67807],3],[[67808,67826],2],[67827,3],[[67828,67829],2],[[67830,67834],3],[[67835,67839],2],[[67840,67861],2],[[67862,67865],2],[[67866,67867],2],[[67868,67870],3],[67871,2],[[67872,67897],2],[[67898,67902],3],[67903,2],[[67904,67967],3],[[67968,68023],2],[[68024,68027],3],[[68028,68029],2],[[68030,68031],2],[[68032,68047],2],[[68048,68049],3],[[68050,68095],2],[[68096,68099],2],[68100,3],[[68101,68102],2],[[68103,68107],3],[[68108,68115],2],[68116,3],[[68117,68119],2],[68120,3],[[68121,68147],2],[[68148,68149],2],[[68150,68151],3],[[68152,68154],2],[[68155,68158],3],[68159,2],[[68160,68167],2],[68168,2],[[68169,68175],3],[[68176,68184],2],[[68185,68191],3],[[68192,68220],2],[[68221,68223],2],[[68224,68252],2],[[68253,68255],2],[[68256,68287],3],[[68288,68295],2],[68296,2],[[68297,68326],2],[[68327,68330],3],[[68331,68342],2],[[68343,68351],3],[[68352,68405],2],[[68406,68408],3],[[68409,68415],2],[[68416,68437],2],[[68438,68439],3],[[68440,68447],2],[[68448,68466],2],[[68467,68471],3],[[68472,68479],2],[[68480,68497],2],[[68498,68504],3],[[68505,68508],2],[[68509,68520],3],[[68521,68527],2],[[68528,68607],3],[[68608,68680],2],[[68681,68735],3],[68736,1,"𐳀"],[68737,1,"𐳁"],[68738,1,"𐳂"],[68739,1,"𐳃"],[68740,1,"𐳄"],[68741,1,"𐳅"],[68742,1,"𐳆"],[68743,1,"𐳇"],[68744,1,"𐳈"],[68745,1,"𐳉"],[68746,1,"𐳊"],[68747,1,"𐳋"],[68748,1,"𐳌"],[68749,1,"𐳍"],[68750,1,"𐳎"],[68751,1,"𐳏"],[68752,1,"𐳐"],[68753,1,"𐳑"],[68754,1,"𐳒"],[68755,1,"𐳓"],[68756,1,"𐳔"],[68757,1,"𐳕"],[68758,1,"𐳖"],[68759,1,"𐳗"],[68760,1,"𐳘"],[68761,1,"𐳙"],[68762,1,"𐳚"],[68763,1,"𐳛"],[68764,1,"𐳜"],[68765,1,"𐳝"],[68766,1,"𐳞"],[68767,1,"𐳟"],[68768,1,"𐳠"],[68769,1,"𐳡"],[68770,1,"𐳢"],[68771,1,"𐳣"],[68772,1,"𐳤"],[68773,1,"𐳥"],[68774,1,"𐳦"],[68775,1,"𐳧"],[68776,1,"𐳨"],[68777,1,"𐳩"],[68778,1,"𐳪"],[68779,1,"𐳫"],[68780,1,"𐳬"],[68781,1,"𐳭"],[68782,1,"𐳮"],[68783,1,"𐳯"],[68784,1,"𐳰"],[68785,1,"𐳱"],[68786,1,"𐳲"],[[68787,68799],3],[[68800,68850],2],[[68851,68857],3],[[68858,68863],2],[[68864,68903],2],[[68904,68911],3],[[68912,68921],2],[[68922,69215],3],[[69216,69246],2],[69247,3],[[69248,69289],2],[69290,3],[[69291,69292],2],[69293,2],[[69294,69295],3],[[69296,69297],2],[[69298,69375],3],[[69376,69404],2],[[69405,69414],2],[69415,2],[[69416,69423],3],[[69424,69456],2],[[69457,69465],2],[[69466,69487],3],[[69488,69509],2],[[69510,69513],2],[[69514,69551],3],[[69552,69572],2],[[69573,69579],2],[[69580,69599],3],[[69600,69622],2],[[69623,69631],3],[[69632,69702],2],[[69703,69709],2],[[69710,69713],3],[[69714,69733],2],[[69734,69743],2],[[69744,69749],2],[[69750,69758],3],[69759,2],[[69760,69818],2],[[69819,69820],2],[69821,3],[[69822,69825],2],[69826,2],[[69827,69836],3],[69837,3],[[69838,69839],3],[[69840,69864],2],[[69865,69871],3],[[69872,69881],2],[[69882,69887],3],[[69888,69940],2],[69941,3],[[69942,69951],2],[[69952,69955],2],[[69956,69958],2],[69959,2],[[69960,69967],3],[[69968,70003],2],[[70004,70005],2],[70006,2],[[70007,70015],3],[[70016,70084],2],[[70085,70088],2],[[70089,70092],2],[70093,2],[[70094,70095],2],[[70096,70105],2],[70106,2],[70107,2],[70108,2],[[70109,70111],2],[70112,3],[[70113,70132],2],[[70133,70143],3],[[70144,70161],2],[70162,3],[[70163,70199],2],[[70200,70205],2],[70206,2],[[70207,70271],3],[[70272,70278],2],[70279,3],[70280,2],[70281,3],[[70282,70285],2],[70286,3],[[70287,70301],2],[70302,3],[[70303,70312],2],[70313,2],[[70314,70319],3],[[70320,70378],2],[[70379,70383],3],[[70384,70393],2],[[70394,70399],3],[70400,2],[[70401,70403],2],[70404,3],[[70405,70412],2],[[70413,70414],3],[[70415,70416],2],[[70417,70418],3],[[70419,70440],2],[70441,3],[[70442,70448],2],[70449,3],[[70450,70451],2],[70452,3],[[70453,70457],2],[70458,3],[70459,2],[[70460,70468],2],[[70469,70470],3],[[70471,70472],2],[[70473,70474],3],[[70475,70477],2],[[70478,70479],3],[70480,2],[[70481,70486],3],[70487,2],[[70488,70492],3],[[70493,70499],2],[[70500,70501],3],[[70502,70508],2],[[70509,70511],3],[[70512,70516],2],[[70517,70655],3],[[70656,70730],2],[[70731,70735],2],[[70736,70745],2],[70746,2],[70747,2],[70748,3],[70749,2],[70750,2],[70751,2],[[70752,70753],2],[[70754,70783],3],[[70784,70853],2],[70854,2],[70855,2],[[70856,70863],3],[[70864,70873],2],[[70874,71039],3],[[71040,71093],2],[[71094,71095],3],[[71096,71104],2],[[71105,71113],2],[[71114,71127],2],[[71128,71133],2],[[71134,71167],3],[[71168,71232],2],[[71233,71235],2],[71236,2],[[71237,71247],3],[[71248,71257],2],[[71258,71263],3],[[71264,71276],2],[[71277,71295],3],[[71296,71351],2],[71352,2],[71353,2],[[71354,71359],3],[[71360,71369],2],[[71370,71423],3],[[71424,71449],2],[71450,2],[[71451,71452],3],[[71453,71467],2],[[71468,71471],3],[[71472,71481],2],[[71482,71487],2],[[71488,71494],2],[[71495,71679],3],[[71680,71738],2],[71739,2],[[71740,71839],3],[71840,1,"𑣀"],[71841,1,"𑣁"],[71842,1,"𑣂"],[71843,1,"𑣃"],[71844,1,"𑣄"],[71845,1,"𑣅"],[71846,1,"𑣆"],[71847,1,"𑣇"],[71848,1,"𑣈"],[71849,1,"𑣉"],[71850,1,"𑣊"],[71851,1,"𑣋"],[71852,1,"𑣌"],[71853,1,"𑣍"],[71854,1,"𑣎"],[71855,1,"𑣏"],[71856,1,"𑣐"],[71857,1,"𑣑"],[71858,1,"𑣒"],[71859,1,"𑣓"],[71860,1,"𑣔"],[71861,1,"𑣕"],[71862,1,"𑣖"],[71863,1,"𑣗"],[71864,1,"𑣘"],[71865,1,"𑣙"],[71866,1,"𑣚"],[71867,1,"𑣛"],[71868,1,"𑣜"],[71869,1,"𑣝"],[71870,1,"𑣞"],[71871,1,"𑣟"],[[71872,71913],2],[[71914,71922],2],[[71923,71934],3],[71935,2],[[71936,71942],2],[[71943,71944],3],[71945,2],[[71946,71947],3],[[71948,71955],2],[71956,3],[[71957,71958],2],[71959,3],[[71960,71989],2],[71990,3],[[71991,71992],2],[[71993,71994],3],[[71995,72003],2],[[72004,72006],2],[[72007,72015],3],[[72016,72025],2],[[72026,72095],3],[[72096,72103],2],[[72104,72105],3],[[72106,72151],2],[[72152,72153],3],[[72154,72161],2],[72162,2],[[72163,72164],2],[[72165,72191],3],[[72192,72254],2],[[72255,72262],2],[72263,2],[[72264,72271],3],[[72272,72323],2],[[72324,72325],2],[[72326,72345],2],[[72346,72348],2],[72349,2],[[72350,72354],2],[[72355,72367],3],[[72368,72383],2],[[72384,72440],2],[[72441,72703],3],[[72704,72712],2],[72713,3],[[72714,72758],2],[72759,3],[[72760,72768],2],[[72769,72773],2],[[72774,72783],3],[[72784,72793],2],[[72794,72812],2],[[72813,72815],3],[[72816,72817],2],[[72818,72847],2],[[72848,72849],3],[[72850,72871],2],[72872,3],[[72873,72886],2],[[72887,72959],3],[[72960,72966],2],[72967,3],[[72968,72969],2],[72970,3],[[72971,73014],2],[[73015,73017],3],[73018,2],[73019,3],[[73020,73021],2],[73022,3],[[73023,73031],2],[[73032,73039],3],[[73040,73049],2],[[73050,73055],3],[[73056,73061],2],[73062,3],[[73063,73064],2],[73065,3],[[73066,73102],2],[73103,3],[[73104,73105],2],[73106,3],[[73107,73112],2],[[73113,73119],3],[[73120,73129],2],[[73130,73439],3],[[73440,73462],2],[[73463,73464],2],[[73465,73647],3],[73648,2],[[73649,73663],3],[[73664,73713],2],[[73714,73726],3],[73727,2],[[73728,74606],2],[[74607,74648],2],[74649,2],[[74650,74751],3],[[74752,74850],2],[[74851,74862],2],[74863,3],[[74864,74867],2],[74868,2],[[74869,74879],3],[[74880,75075],2],[[75076,77711],3],[[77712,77808],2],[[77809,77810],2],[[77811,77823],3],[[77824,78894],2],[78895,3],[[78896,78904],3],[[78905,82943],3],[[82944,83526],2],[[83527,92159],3],[[92160,92728],2],[[92729,92735],3],[[92736,92766],2],[92767,3],[[92768,92777],2],[[92778,92781],3],[[92782,92783],2],[[92784,92862],2],[92863,3],[[92864,92873],2],[[92874,92879],3],[[92880,92909],2],[[92910,92911],3],[[92912,92916],2],[92917,2],[[92918,92927],3],[[92928,92982],2],[[92983,92991],2],[[92992,92995],2],[[92996,92997],2],[[92998,93007],3],[[93008,93017],2],[93018,3],[[93019,93025],2],[93026,3],[[93027,93047],2],[[93048,93052],3],[[93053,93071],2],[[93072,93759],3],[93760,1,"𖹠"],[93761,1,"𖹡"],[93762,1,"𖹢"],[93763,1,"𖹣"],[93764,1,"𖹤"],[93765,1,"𖹥"],[93766,1,"𖹦"],[93767,1,"𖹧"],[93768,1,"𖹨"],[93769,1,"𖹩"],[93770,1,"𖹪"],[93771,1,"𖹫"],[93772,1,"𖹬"],[93773,1,"𖹭"],[93774,1,"𖹮"],[93775,1,"𖹯"],[93776,1,"𖹰"],[93777,1,"𖹱"],[93778,1,"𖹲"],[93779,1,"𖹳"],[93780,1,"𖹴"],[93781,1,"𖹵"],[93782,1,"𖹶"],[93783,1,"𖹷"],[93784,1,"𖹸"],[93785,1,"𖹹"],[93786,1,"𖹺"],[93787,1,"𖹻"],[93788,1,"𖹼"],[93789,1,"𖹽"],[93790,1,"𖹾"],[93791,1,"𖹿"],[[93792,93823],2],[[93824,93850],2],[[93851,93951],3],[[93952,94020],2],[[94021,94026],2],[[94027,94030],3],[94031,2],[[94032,94078],2],[[94079,94087],2],[[94088,94094],3],[[94095,94111],2],[[94112,94175],3],[94176,2],[94177,2],[94178,2],[94179,2],[94180,2],[[94181,94191],3],[[94192,94193],2],[[94194,94207],3],[[94208,100332],2],[[100333,100337],2],[[100338,100343],2],[[100344,100351],3],[[100352,101106],2],[[101107,101589],2],[[101590,101631],3],[[101632,101640],2],[[101641,110575],3],[[110576,110579],2],[110580,3],[[110581,110587],2],[110588,3],[[110589,110590],2],[110591,3],[[110592,110593],2],[[110594,110878],2],[[110879,110882],2],[[110883,110927],3],[[110928,110930],2],[[110931,110947],3],[[110948,110951],2],[[110952,110959],3],[[110960,111355],2],[[111356,113663],3],[[113664,113770],2],[[113771,113775],3],[[113776,113788],2],[[113789,113791],3],[[113792,113800],2],[[113801,113807],3],[[113808,113817],2],[[113818,113819],3],[113820,2],[[113821,113822],2],[113823,2],[[113824,113827],7],[[113828,118527],3],[[118528,118573],2],[[118574,118575],3],[[118576,118598],2],[[118599,118607],3],[[118608,118723],2],[[118724,118783],3],[[118784,119029],2],[[119030,119039],3],[[119040,119078],2],[[119079,119080],3],[119081,2],[[119082,119133],2],[119134,1,"𝅗𝅥"],[119135,1,"𝅘𝅥"],[119136,1,"𝅘𝅥𝅮"],[119137,1,"𝅘𝅥𝅯"],[119138,1,"𝅘𝅥𝅰"],[119139,1,"𝅘𝅥𝅱"],[119140,1,"𝅘𝅥𝅲"],[[119141,119154],2],[[119155,119162],3],[[119163,119226],2],[119227,1,"𝆹𝅥"],[119228,1,"𝆺𝅥"],[119229,1,"𝆹𝅥𝅮"],[119230,1,"𝆺𝅥𝅮"],[119231,1,"𝆹𝅥𝅯"],[119232,1,"𝆺𝅥𝅯"],[[119233,119261],2],[[119262,119272],2],[[119273,119274],2],[[119275,119295],3],[[119296,119365],2],[[119366,119519],3],[[119520,119539],2],[[119540,119551],3],[[119552,119638],2],[[119639,119647],3],[[119648,119665],2],[[119666,119672],2],[[119673,119807],3],[119808,1,"a"],[119809,1,"b"],[119810,1,"c"],[119811,1,"d"],[119812,1,"e"],[119813,1,"f"],[119814,1,"g"],[119815,1,"h"],[119816,1,"i"],[119817,1,"j"],[119818,1,"k"],[119819,1,"l"],[119820,1,"m"],[119821,1,"n"],[119822,1,"o"],[119823,1,"p"],[119824,1,"q"],[119825,1,"r"],[119826,1,"s"],[119827,1,"t"],[119828,1,"u"],[119829,1,"v"],[119830,1,"w"],[119831,1,"x"],[119832,1,"y"],[119833,1,"z"],[119834,1,"a"],[119835,1,"b"],[119836,1,"c"],[119837,1,"d"],[119838,1,"e"],[119839,1,"f"],[119840,1,"g"],[119841,1,"h"],[119842,1,"i"],[119843,1,"j"],[119844,1,"k"],[119845,1,"l"],[119846,1,"m"],[119847,1,"n"],[119848,1,"o"],[119849,1,"p"],[119850,1,"q"],[119851,1,"r"],[119852,1,"s"],[119853,1,"t"],[119854,1,"u"],[119855,1,"v"],[119856,1,"w"],[119857,1,"x"],[119858,1,"y"],[119859,1,"z"],[119860,1,"a"],[119861,1,"b"],[119862,1,"c"],[119863,1,"d"],[119864,1,"e"],[119865,1,"f"],[119866,1,"g"],[119867,1,"h"],[119868,1,"i"],[119869,1,"j"],[119870,1,"k"],[119871,1,"l"],[119872,1,"m"],[119873,1,"n"],[119874,1,"o"],[119875,1,"p"],[119876,1,"q"],[119877,1,"r"],[119878,1,"s"],[119879,1,"t"],[119880,1,"u"],[119881,1,"v"],[119882,1,"w"],[119883,1,"x"],[119884,1,"y"],[119885,1,"z"],[119886,1,"a"],[119887,1,"b"],[119888,1,"c"],[119889,1,"d"],[119890,1,"e"],[119891,1,"f"],[119892,1,"g"],[119893,3],[119894,1,"i"],[119895,1,"j"],[119896,1,"k"],[119897,1,"l"],[119898,1,"m"],[119899,1,"n"],[119900,1,"o"],[119901,1,"p"],[119902,1,"q"],[119903,1,"r"],[119904,1,"s"],[119905,1,"t"],[119906,1,"u"],[119907,1,"v"],[119908,1,"w"],[119909,1,"x"],[119910,1,"y"],[119911,1,"z"],[119912,1,"a"],[119913,1,"b"],[119914,1,"c"],[119915,1,"d"],[119916,1,"e"],[119917,1,"f"],[119918,1,"g"],[119919,1,"h"],[119920,1,"i"],[119921,1,"j"],[119922,1,"k"],[119923,1,"l"],[119924,1,"m"],[119925,1,"n"],[119926,1,"o"],[119927,1,"p"],[119928,1,"q"],[119929,1,"r"],[119930,1,"s"],[119931,1,"t"],[119932,1,"u"],[119933,1,"v"],[119934,1,"w"],[119935,1,"x"],[119936,1,"y"],[119937,1,"z"],[119938,1,"a"],[119939,1,"b"],[119940,1,"c"],[119941,1,"d"],[119942,1,"e"],[119943,1,"f"],[119944,1,"g"],[119945,1,"h"],[119946,1,"i"],[119947,1,"j"],[119948,1,"k"],[119949,1,"l"],[119950,1,"m"],[119951,1,"n"],[119952,1,"o"],[119953,1,"p"],[119954,1,"q"],[119955,1,"r"],[119956,1,"s"],[119957,1,"t"],[119958,1,"u"],[119959,1,"v"],[119960,1,"w"],[119961,1,"x"],[119962,1,"y"],[119963,1,"z"],[119964,1,"a"],[119965,3],[119966,1,"c"],[119967,1,"d"],[[119968,119969],3],[119970,1,"g"],[[119971,119972],3],[119973,1,"j"],[119974,1,"k"],[[119975,119976],3],[119977,1,"n"],[119978,1,"o"],[119979,1,"p"],[119980,1,"q"],[119981,3],[119982,1,"s"],[119983,1,"t"],[119984,1,"u"],[119985,1,"v"],[119986,1,"w"],[119987,1,"x"],[119988,1,"y"],[119989,1,"z"],[119990,1,"a"],[119991,1,"b"],[119992,1,"c"],[119993,1,"d"],[119994,3],[119995,1,"f"],[119996,3],[119997,1,"h"],[119998,1,"i"],[119999,1,"j"],[120000,1,"k"],[120001,1,"l"],[120002,1,"m"],[120003,1,"n"],[120004,3],[120005,1,"p"],[120006,1,"q"],[120007,1,"r"],[120008,1,"s"],[120009,1,"t"],[120010,1,"u"],[120011,1,"v"],[120012,1,"w"],[120013,1,"x"],[120014,1,"y"],[120015,1,"z"],[120016,1,"a"],[120017,1,"b"],[120018,1,"c"],[120019,1,"d"],[120020,1,"e"],[120021,1,"f"],[120022,1,"g"],[120023,1,"h"],[120024,1,"i"],[120025,1,"j"],[120026,1,"k"],[120027,1,"l"],[120028,1,"m"],[120029,1,"n"],[120030,1,"o"],[120031,1,"p"],[120032,1,"q"],[120033,1,"r"],[120034,1,"s"],[120035,1,"t"],[120036,1,"u"],[120037,1,"v"],[120038,1,"w"],[120039,1,"x"],[120040,1,"y"],[120041,1,"z"],[120042,1,"a"],[120043,1,"b"],[120044,1,"c"],[120045,1,"d"],[120046,1,"e"],[120047,1,"f"],[120048,1,"g"],[120049,1,"h"],[120050,1,"i"],[120051,1,"j"],[120052,1,"k"],[120053,1,"l"],[120054,1,"m"],[120055,1,"n"],[120056,1,"o"],[120057,1,"p"],[120058,1,"q"],[120059,1,"r"],[120060,1,"s"],[120061,1,"t"],[120062,1,"u"],[120063,1,"v"],[120064,1,"w"],[120065,1,"x"],[120066,1,"y"],[120067,1,"z"],[120068,1,"a"],[120069,1,"b"],[120070,3],[120071,1,"d"],[120072,1,"e"],[120073,1,"f"],[120074,1,"g"],[[120075,120076],3],[120077,1,"j"],[120078,1,"k"],[120079,1,"l"],[120080,1,"m"],[120081,1,"n"],[120082,1,"o"],[120083,1,"p"],[120084,1,"q"],[120085,3],[120086,1,"s"],[120087,1,"t"],[120088,1,"u"],[120089,1,"v"],[120090,1,"w"],[120091,1,"x"],[120092,1,"y"],[120093,3],[120094,1,"a"],[120095,1,"b"],[120096,1,"c"],[120097,1,"d"],[120098,1,"e"],[120099,1,"f"],[120100,1,"g"],[120101,1,"h"],[120102,1,"i"],[120103,1,"j"],[120104,1,"k"],[120105,1,"l"],[120106,1,"m"],[120107,1,"n"],[120108,1,"o"],[120109,1,"p"],[120110,1,"q"],[120111,1,"r"],[120112,1,"s"],[120113,1,"t"],[120114,1,"u"],[120115,1,"v"],[120116,1,"w"],[120117,1,"x"],[120118,1,"y"],[120119,1,"z"],[120120,1,"a"],[120121,1,"b"],[120122,3],[120123,1,"d"],[120124,1,"e"],[120125,1,"f"],[120126,1,"g"],[120127,3],[120128,1,"i"],[120129,1,"j"],[120130,1,"k"],[120131,1,"l"],[120132,1,"m"],[120133,3],[120134,1,"o"],[[120135,120137],3],[120138,1,"s"],[120139,1,"t"],[120140,1,"u"],[120141,1,"v"],[120142,1,"w"],[120143,1,"x"],[120144,1,"y"],[120145,3],[120146,1,"a"],[120147,1,"b"],[120148,1,"c"],[120149,1,"d"],[120150,1,"e"],[120151,1,"f"],[120152,1,"g"],[120153,1,"h"],[120154,1,"i"],[120155,1,"j"],[120156,1,"k"],[120157,1,"l"],[120158,1,"m"],[120159,1,"n"],[120160,1,"o"],[120161,1,"p"],[120162,1,"q"],[120163,1,"r"],[120164,1,"s"],[120165,1,"t"],[120166,1,"u"],[120167,1,"v"],[120168,1,"w"],[120169,1,"x"],[120170,1,"y"],[120171,1,"z"],[120172,1,"a"],[120173,1,"b"],[120174,1,"c"],[120175,1,"d"],[120176,1,"e"],[120177,1,"f"],[120178,1,"g"],[120179,1,"h"],[120180,1,"i"],[120181,1,"j"],[120182,1,"k"],[120183,1,"l"],[120184,1,"m"],[120185,1,"n"],[120186,1,"o"],[120187,1,"p"],[120188,1,"q"],[120189,1,"r"],[120190,1,"s"],[120191,1,"t"],[120192,1,"u"],[120193,1,"v"],[120194,1,"w"],[120195,1,"x"],[120196,1,"y"],[120197,1,"z"],[120198,1,"a"],[120199,1,"b"],[120200,1,"c"],[120201,1,"d"],[120202,1,"e"],[120203,1,"f"],[120204,1,"g"],[120205,1,"h"],[120206,1,"i"],[120207,1,"j"],[120208,1,"k"],[120209,1,"l"],[120210,1,"m"],[120211,1,"n"],[120212,1,"o"],[120213,1,"p"],[120214,1,"q"],[120215,1,"r"],[120216,1,"s"],[120217,1,"t"],[120218,1,"u"],[120219,1,"v"],[120220,1,"w"],[120221,1,"x"],[120222,1,"y"],[120223,1,"z"],[120224,1,"a"],[120225,1,"b"],[120226,1,"c"],[120227,1,"d"],[120228,1,"e"],[120229,1,"f"],[120230,1,"g"],[120231,1,"h"],[120232,1,"i"],[120233,1,"j"],[120234,1,"k"],[120235,1,"l"],[120236,1,"m"],[120237,1,"n"],[120238,1,"o"],[120239,1,"p"],[120240,1,"q"],[120241,1,"r"],[120242,1,"s"],[120243,1,"t"],[120244,1,"u"],[120245,1,"v"],[120246,1,"w"],[120247,1,"x"],[120248,1,"y"],[120249,1,"z"],[120250,1,"a"],[120251,1,"b"],[120252,1,"c"],[120253,1,"d"],[120254,1,"e"],[120255,1,"f"],[120256,1,"g"],[120257,1,"h"],[120258,1,"i"],[120259,1,"j"],[120260,1,"k"],[120261,1,"l"],[120262,1,"m"],[120263,1,"n"],[120264,1,"o"],[120265,1,"p"],[120266,1,"q"],[120267,1,"r"],[120268,1,"s"],[120269,1,"t"],[120270,1,"u"],[120271,1,"v"],[120272,1,"w"],[120273,1,"x"],[120274,1,"y"],[120275,1,"z"],[120276,1,"a"],[120277,1,"b"],[120278,1,"c"],[120279,1,"d"],[120280,1,"e"],[120281,1,"f"],[120282,1,"g"],[120283,1,"h"],[120284,1,"i"],[120285,1,"j"],[120286,1,"k"],[120287,1,"l"],[120288,1,"m"],[120289,1,"n"],[120290,1,"o"],[120291,1,"p"],[120292,1,"q"],[120293,1,"r"],[120294,1,"s"],[120295,1,"t"],[120296,1,"u"],[120297,1,"v"],[120298,1,"w"],[120299,1,"x"],[120300,1,"y"],[120301,1,"z"],[120302,1,"a"],[120303,1,"b"],[120304,1,"c"],[120305,1,"d"],[120306,1,"e"],[120307,1,"f"],[120308,1,"g"],[120309,1,"h"],[120310,1,"i"],[120311,1,"j"],[120312,1,"k"],[120313,1,"l"],[120314,1,"m"],[120315,1,"n"],[120316,1,"o"],[120317,1,"p"],[120318,1,"q"],[120319,1,"r"],[120320,1,"s"],[120321,1,"t"],[120322,1,"u"],[120323,1,"v"],[120324,1,"w"],[120325,1,"x"],[120326,1,"y"],[120327,1,"z"],[120328,1,"a"],[120329,1,"b"],[120330,1,"c"],[120331,1,"d"],[120332,1,"e"],[120333,1,"f"],[120334,1,"g"],[120335,1,"h"],[120336,1,"i"],[120337,1,"j"],[120338,1,"k"],[120339,1,"l"],[120340,1,"m"],[120341,1,"n"],[120342,1,"o"],[120343,1,"p"],[120344,1,"q"],[120345,1,"r"],[120346,1,"s"],[120347,1,"t"],[120348,1,"u"],[120349,1,"v"],[120350,1,"w"],[120351,1,"x"],[120352,1,"y"],[120353,1,"z"],[120354,1,"a"],[120355,1,"b"],[120356,1,"c"],[120357,1,"d"],[120358,1,"e"],[120359,1,"f"],[120360,1,"g"],[120361,1,"h"],[120362,1,"i"],[120363,1,"j"],[120364,1,"k"],[120365,1,"l"],[120366,1,"m"],[120367,1,"n"],[120368,1,"o"],[120369,1,"p"],[120370,1,"q"],[120371,1,"r"],[120372,1,"s"],[120373,1,"t"],[120374,1,"u"],[120375,1,"v"],[120376,1,"w"],[120377,1,"x"],[120378,1,"y"],[120379,1,"z"],[120380,1,"a"],[120381,1,"b"],[120382,1,"c"],[120383,1,"d"],[120384,1,"e"],[120385,1,"f"],[120386,1,"g"],[120387,1,"h"],[120388,1,"i"],[120389,1,"j"],[120390,1,"k"],[120391,1,"l"],[120392,1,"m"],[120393,1,"n"],[120394,1,"o"],[120395,1,"p"],[120396,1,"q"],[120397,1,"r"],[120398,1,"s"],[120399,1,"t"],[120400,1,"u"],[120401,1,"v"],[120402,1,"w"],[120403,1,"x"],[120404,1,"y"],[120405,1,"z"],[120406,1,"a"],[120407,1,"b"],[120408,1,"c"],[120409,1,"d"],[120410,1,"e"],[120411,1,"f"],[120412,1,"g"],[120413,1,"h"],[120414,1,"i"],[120415,1,"j"],[120416,1,"k"],[120417,1,"l"],[120418,1,"m"],[120419,1,"n"],[120420,1,"o"],[120421,1,"p"],[120422,1,"q"],[120423,1,"r"],[120424,1,"s"],[120425,1,"t"],[120426,1,"u"],[120427,1,"v"],[120428,1,"w"],[120429,1,"x"],[120430,1,"y"],[120431,1,"z"],[120432,1,"a"],[120433,1,"b"],[120434,1,"c"],[120435,1,"d"],[120436,1,"e"],[120437,1,"f"],[120438,1,"g"],[120439,1,"h"],[120440,1,"i"],[120441,1,"j"],[120442,1,"k"],[120443,1,"l"],[120444,1,"m"],[120445,1,"n"],[120446,1,"o"],[120447,1,"p"],[120448,1,"q"],[120449,1,"r"],[120450,1,"s"],[120451,1,"t"],[120452,1,"u"],[120453,1,"v"],[120454,1,"w"],[120455,1,"x"],[120456,1,"y"],[120457,1,"z"],[120458,1,"a"],[120459,1,"b"],[120460,1,"c"],[120461,1,"d"],[120462,1,"e"],[120463,1,"f"],[120464,1,"g"],[120465,1,"h"],[120466,1,"i"],[120467,1,"j"],[120468,1,"k"],[120469,1,"l"],[120470,1,"m"],[120471,1,"n"],[120472,1,"o"],[120473,1,"p"],[120474,1,"q"],[120475,1,"r"],[120476,1,"s"],[120477,1,"t"],[120478,1,"u"],[120479,1,"v"],[120480,1,"w"],[120481,1,"x"],[120482,1,"y"],[120483,1,"z"],[120484,1,"ı"],[120485,1,"ȷ"],[[120486,120487],3],[120488,1,"α"],[120489,1,"β"],[120490,1,"γ"],[120491,1,"δ"],[120492,1,"ε"],[120493,1,"ζ"],[120494,1,"η"],[120495,1,"θ"],[120496,1,"ι"],[120497,1,"κ"],[120498,1,"λ"],[120499,1,"μ"],[120500,1,"ν"],[120501,1,"ξ"],[120502,1,"ο"],[120503,1,"π"],[120504,1,"ρ"],[120505,1,"θ"],[120506,1,"σ"],[120507,1,"τ"],[120508,1,"υ"],[120509,1,"φ"],[120510,1,"χ"],[120511,1,"ψ"],[120512,1,"ω"],[120513,1,"∇"],[120514,1,"α"],[120515,1,"β"],[120516,1,"γ"],[120517,1,"δ"],[120518,1,"ε"],[120519,1,"ζ"],[120520,1,"η"],[120521,1,"θ"],[120522,1,"ι"],[120523,1,"κ"],[120524,1,"λ"],[120525,1,"μ"],[120526,1,"ν"],[120527,1,"ξ"],[120528,1,"ο"],[120529,1,"π"],[120530,1,"ρ"],[[120531,120532],1,"σ"],[120533,1,"τ"],[120534,1,"υ"],[120535,1,"φ"],[120536,1,"χ"],[120537,1,"ψ"],[120538,1,"ω"],[120539,1,"∂"],[120540,1,"ε"],[120541,1,"θ"],[120542,1,"κ"],[120543,1,"φ"],[120544,1,"ρ"],[120545,1,"π"],[120546,1,"α"],[120547,1,"β"],[120548,1,"γ"],[120549,1,"δ"],[120550,1,"ε"],[120551,1,"ζ"],[120552,1,"η"],[120553,1,"θ"],[120554,1,"ι"],[120555,1,"κ"],[120556,1,"λ"],[120557,1,"μ"],[120558,1,"ν"],[120559,1,"ξ"],[120560,1,"ο"],[120561,1,"π"],[120562,1,"ρ"],[120563,1,"θ"],[120564,1,"σ"],[120565,1,"τ"],[120566,1,"υ"],[120567,1,"φ"],[120568,1,"χ"],[120569,1,"ψ"],[120570,1,"ω"],[120571,1,"∇"],[120572,1,"α"],[120573,1,"β"],[120574,1,"γ"],[120575,1,"δ"],[120576,1,"ε"],[120577,1,"ζ"],[120578,1,"η"],[120579,1,"θ"],[120580,1,"ι"],[120581,1,"κ"],[120582,1,"λ"],[120583,1,"μ"],[120584,1,"ν"],[120585,1,"ξ"],[120586,1,"ο"],[120587,1,"π"],[120588,1,"ρ"],[[120589,120590],1,"σ"],[120591,1,"τ"],[120592,1,"υ"],[120593,1,"φ"],[120594,1,"χ"],[120595,1,"ψ"],[120596,1,"ω"],[120597,1,"∂"],[120598,1,"ε"],[120599,1,"θ"],[120600,1,"κ"],[120601,1,"φ"],[120602,1,"ρ"],[120603,1,"π"],[120604,1,"α"],[120605,1,"β"],[120606,1,"γ"],[120607,1,"δ"],[120608,1,"ε"],[120609,1,"ζ"],[120610,1,"η"],[120611,1,"θ"],[120612,1,"ι"],[120613,1,"κ"],[120614,1,"λ"],[120615,1,"μ"],[120616,1,"ν"],[120617,1,"ξ"],[120618,1,"ο"],[120619,1,"π"],[120620,1,"ρ"],[120621,1,"θ"],[120622,1,"σ"],[120623,1,"τ"],[120624,1,"υ"],[120625,1,"φ"],[120626,1,"χ"],[120627,1,"ψ"],[120628,1,"ω"],[120629,1,"∇"],[120630,1,"α"],[120631,1,"β"],[120632,1,"γ"],[120633,1,"δ"],[120634,1,"ε"],[120635,1,"ζ"],[120636,1,"η"],[120637,1,"θ"],[120638,1,"ι"],[120639,1,"κ"],[120640,1,"λ"],[120641,1,"μ"],[120642,1,"ν"],[120643,1,"ξ"],[120644,1,"ο"],[120645,1,"π"],[120646,1,"ρ"],[[120647,120648],1,"σ"],[120649,1,"τ"],[120650,1,"υ"],[120651,1,"φ"],[120652,1,"χ"],[120653,1,"ψ"],[120654,1,"ω"],[120655,1,"∂"],[120656,1,"ε"],[120657,1,"θ"],[120658,1,"κ"],[120659,1,"φ"],[120660,1,"ρ"],[120661,1,"π"],[120662,1,"α"],[120663,1,"β"],[120664,1,"γ"],[120665,1,"δ"],[120666,1,"ε"],[120667,1,"ζ"],[120668,1,"η"],[120669,1,"θ"],[120670,1,"ι"],[120671,1,"κ"],[120672,1,"λ"],[120673,1,"μ"],[120674,1,"ν"],[120675,1,"ξ"],[120676,1,"ο"],[120677,1,"π"],[120678,1,"ρ"],[120679,1,"θ"],[120680,1,"σ"],[120681,1,"τ"],[120682,1,"υ"],[120683,1,"φ"],[120684,1,"χ"],[120685,1,"ψ"],[120686,1,"ω"],[120687,1,"∇"],[120688,1,"α"],[120689,1,"β"],[120690,1,"γ"],[120691,1,"δ"],[120692,1,"ε"],[120693,1,"ζ"],[120694,1,"η"],[120695,1,"θ"],[120696,1,"ι"],[120697,1,"κ"],[120698,1,"λ"],[120699,1,"μ"],[120700,1,"ν"],[120701,1,"ξ"],[120702,1,"ο"],[120703,1,"π"],[120704,1,"ρ"],[[120705,120706],1,"σ"],[120707,1,"τ"],[120708,1,"υ"],[120709,1,"φ"],[120710,1,"χ"],[120711,1,"ψ"],[120712,1,"ω"],[120713,1,"∂"],[120714,1,"ε"],[120715,1,"θ"],[120716,1,"κ"],[120717,1,"φ"],[120718,1,"ρ"],[120719,1,"π"],[120720,1,"α"],[120721,1,"β"],[120722,1,"γ"],[120723,1,"δ"],[120724,1,"ε"],[120725,1,"ζ"],[120726,1,"η"],[120727,1,"θ"],[120728,1,"ι"],[120729,1,"κ"],[120730,1,"λ"],[120731,1,"μ"],[120732,1,"ν"],[120733,1,"ξ"],[120734,1,"ο"],[120735,1,"π"],[120736,1,"ρ"],[120737,1,"θ"],[120738,1,"σ"],[120739,1,"τ"],[120740,1,"υ"],[120741,1,"φ"],[120742,1,"χ"],[120743,1,"ψ"],[120744,1,"ω"],[120745,1,"∇"],[120746,1,"α"],[120747,1,"β"],[120748,1,"γ"],[120749,1,"δ"],[120750,1,"ε"],[120751,1,"ζ"],[120752,1,"η"],[120753,1,"θ"],[120754,1,"ι"],[120755,1,"κ"],[120756,1,"λ"],[120757,1,"μ"],[120758,1,"ν"],[120759,1,"ξ"],[120760,1,"ο"],[120761,1,"π"],[120762,1,"ρ"],[[120763,120764],1,"σ"],[120765,1,"τ"],[120766,1,"υ"],[120767,1,"φ"],[120768,1,"χ"],[120769,1,"ψ"],[120770,1,"ω"],[120771,1,"∂"],[120772,1,"ε"],[120773,1,"θ"],[120774,1,"κ"],[120775,1,"φ"],[120776,1,"ρ"],[120777,1,"π"],[[120778,120779],1,"ϝ"],[[120780,120781],3],[120782,1,"0"],[120783,1,"1"],[120784,1,"2"],[120785,1,"3"],[120786,1,"4"],[120787,1,"5"],[120788,1,"6"],[120789,1,"7"],[120790,1,"8"],[120791,1,"9"],[120792,1,"0"],[120793,1,"1"],[120794,1,"2"],[120795,1,"3"],[120796,1,"4"],[120797,1,"5"],[120798,1,"6"],[120799,1,"7"],[120800,1,"8"],[120801,1,"9"],[120802,1,"0"],[120803,1,"1"],[120804,1,"2"],[120805,1,"3"],[120806,1,"4"],[120807,1,"5"],[120808,1,"6"],[120809,1,"7"],[120810,1,"8"],[120811,1,"9"],[120812,1,"0"],[120813,1,"1"],[120814,1,"2"],[120815,1,"3"],[120816,1,"4"],[120817,1,"5"],[120818,1,"6"],[120819,1,"7"],[120820,1,"8"],[120821,1,"9"],[120822,1,"0"],[120823,1,"1"],[120824,1,"2"],[120825,1,"3"],[120826,1,"4"],[120827,1,"5"],[120828,1,"6"],[120829,1,"7"],[120830,1,"8"],[120831,1,"9"],[[120832,121343],2],[[121344,121398],2],[[121399,121402],2],[[121403,121452],2],[[121453,121460],2],[121461,2],[[121462,121475],2],[121476,2],[[121477,121483],2],[[121484,121498],3],[[121499,121503],2],[121504,3],[[121505,121519],2],[[121520,122623],3],[[122624,122654],2],[[122655,122879],3],[[122880,122886],2],[122887,3],[[122888,122904],2],[[122905,122906],3],[[122907,122913],2],[122914,3],[[122915,122916],2],[122917,3],[[122918,122922],2],[[122923,123135],3],[[123136,123180],2],[[123181,123183],3],[[123184,123197],2],[[123198,123199],3],[[123200,123209],2],[[123210,123213],3],[123214,2],[123215,2],[[123216,123535],3],[[123536,123566],2],[[123567,123583],3],[[123584,123641],2],[[123642,123646],3],[123647,2],[[123648,124895],3],[[124896,124902],2],[124903,3],[[124904,124907],2],[124908,3],[[124909,124910],2],[124911,3],[[124912,124926],2],[124927,3],[[124928,125124],2],[[125125,125126],3],[[125127,125135],2],[[125136,125142],2],[[125143,125183],3],[125184,1,"𞤢"],[125185,1,"𞤣"],[125186,1,"𞤤"],[125187,1,"𞤥"],[125188,1,"𞤦"],[125189,1,"𞤧"],[125190,1,"𞤨"],[125191,1,"𞤩"],[125192,1,"𞤪"],[125193,1,"𞤫"],[125194,1,"𞤬"],[125195,1,"𞤭"],[125196,1,"𞤮"],[125197,1,"𞤯"],[125198,1,"𞤰"],[125199,1,"𞤱"],[125200,1,"𞤲"],[125201,1,"𞤳"],[125202,1,"𞤴"],[125203,1,"𞤵"],[125204,1,"𞤶"],[125205,1,"𞤷"],[125206,1,"𞤸"],[125207,1,"𞤹"],[125208,1,"𞤺"],[125209,1,"𞤻"],[125210,1,"𞤼"],[125211,1,"𞤽"],[125212,1,"𞤾"],[125213,1,"𞤿"],[125214,1,"𞥀"],[125215,1,"𞥁"],[125216,1,"𞥂"],[125217,1,"𞥃"],[[125218,125258],2],[125259,2],[[125260,125263],3],[[125264,125273],2],[[125274,125277],3],[[125278,125279],2],[[125280,126064],3],[[126065,126132],2],[[126133,126208],3],[[126209,126269],2],[[126270,126463],3],[126464,1,"ا"],[126465,1,"ب"],[126466,1,"ج"],[126467,1,"د"],[126468,3],[126469,1,"و"],[126470,1,"ز"],[126471,1,"ح"],[126472,1,"ط"],[126473,1,"ي"],[126474,1,"ك"],[126475,1,"ل"],[126476,1,"م"],[126477,1,"ن"],[126478,1,"س"],[126479,1,"ع"],[126480,1,"ف"],[126481,1,"ص"],[126482,1,"ق"],[126483,1,"ر"],[126484,1,"ش"],[126485,1,"ت"],[126486,1,"ث"],[126487,1,"خ"],[126488,1,"ذ"],[126489,1,"ض"],[126490,1,"ظ"],[126491,1,"غ"],[126492,1,"ٮ"],[126493,1,"ں"],[126494,1,"ڡ"],[126495,1,"ٯ"],[126496,3],[126497,1,"ب"],[126498,1,"ج"],[126499,3],[126500,1,"ه"],[[126501,126502],3],[126503,1,"ح"],[126504,3],[126505,1,"ي"],[126506,1,"ك"],[126507,1,"ل"],[126508,1,"م"],[126509,1,"ن"],[126510,1,"س"],[126511,1,"ع"],[126512,1,"ف"],[126513,1,"ص"],[126514,1,"ق"],[126515,3],[126516,1,"ش"],[126517,1,"ت"],[126518,1,"ث"],[126519,1,"خ"],[126520,3],[126521,1,"ض"],[126522,3],[126523,1,"غ"],[[126524,126529],3],[126530,1,"ج"],[[126531,126534],3],[126535,1,"ح"],[126536,3],[126537,1,"ي"],[126538,3],[126539,1,"ل"],[126540,3],[126541,1,"ن"],[126542,1,"س"],[126543,1,"ع"],[126544,3],[126545,1,"ص"],[126546,1,"ق"],[126547,3],[126548,1,"ش"],[[126549,126550],3],[126551,1,"خ"],[126552,3],[126553,1,"ض"],[126554,3],[126555,1,"غ"],[126556,3],[126557,1,"ں"],[126558,3],[126559,1,"ٯ"],[126560,3],[126561,1,"ب"],[126562,1,"ج"],[126563,3],[126564,1,"ه"],[[126565,126566],3],[126567,1,"ح"],[126568,1,"ط"],[126569,1,"ي"],[126570,1,"ك"],[126571,3],[126572,1,"م"],[126573,1,"ن"],[126574,1,"س"],[126575,1,"ع"],[126576,1,"ف"],[126577,1,"ص"],[126578,1,"ق"],[126579,3],[126580,1,"ش"],[126581,1,"ت"],[126582,1,"ث"],[126583,1,"خ"],[126584,3],[126585,1,"ض"],[126586,1,"ظ"],[126587,1,"غ"],[126588,1,"ٮ"],[126589,3],[126590,1,"ڡ"],[126591,3],[126592,1,"ا"],[126593,1,"ب"],[126594,1,"ج"],[126595,1,"د"],[126596,1,"ه"],[126597,1,"و"],[126598,1,"ز"],[126599,1,"ح"],[126600,1,"ط"],[126601,1,"ي"],[126602,3],[126603,1,"ل"],[126604,1,"م"],[126605,1,"ن"],[126606,1,"س"],[126607,1,"ع"],[126608,1,"ف"],[126609,1,"ص"],[126610,1,"ق"],[126611,1,"ر"],[126612,1,"ش"],[126613,1,"ت"],[126614,1,"ث"],[126615,1,"خ"],[126616,1,"ذ"],[126617,1,"ض"],[126618,1,"ظ"],[126619,1,"غ"],[[126620,126624],3],[126625,1,"ب"],[126626,1,"ج"],[126627,1,"د"],[126628,3],[126629,1,"و"],[126630,1,"ز"],[126631,1,"ح"],[126632,1,"ط"],[126633,1,"ي"],[126634,3],[126635,1,"ل"],[126636,1,"م"],[126637,1,"ن"],[126638,1,"س"],[126639,1,"ع"],[126640,1,"ف"],[126641,1,"ص"],[126642,1,"ق"],[126643,1,"ر"],[126644,1,"ش"],[126645,1,"ت"],[126646,1,"ث"],[126647,1,"خ"],[126648,1,"ذ"],[126649,1,"ض"],[126650,1,"ظ"],[126651,1,"غ"],[[126652,126703],3],[[126704,126705],2],[[126706,126975],3],[[126976,127019],2],[[127020,127023],3],[[127024,127123],2],[[127124,127135],3],[[127136,127150],2],[[127151,127152],3],[[127153,127166],2],[127167,2],[127168,3],[[127169,127183],2],[127184,3],[[127185,127199],2],[[127200,127221],2],[[127222,127231],3],[127232,3],[127233,5,"0,"],[127234,5,"1,"],[127235,5,"2,"],[127236,5,"3,"],[127237,5,"4,"],[127238,5,"5,"],[127239,5,"6,"],[127240,5,"7,"],[127241,5,"8,"],[127242,5,"9,"],[[127243,127244],2],[[127245,127247],2],[127248,5,"(a)"],[127249,5,"(b)"],[127250,5,"(c)"],[127251,5,"(d)"],[127252,5,"(e)"],[127253,5,"(f)"],[127254,5,"(g)"],[127255,5,"(h)"],[127256,5,"(i)"],[127257,5,"(j)"],[127258,5,"(k)"],[127259,5,"(l)"],[127260,5,"(m)"],[127261,5,"(n)"],[127262,5,"(o)"],[127263,5,"(p)"],[127264,5,"(q)"],[127265,5,"(r)"],[127266,5,"(s)"],[127267,5,"(t)"],[127268,5,"(u)"],[127269,5,"(v)"],[127270,5,"(w)"],[127271,5,"(x)"],[127272,5,"(y)"],[127273,5,"(z)"],[127274,1,"〔s〕"],[127275,1,"c"],[127276,1,"r"],[127277,1,"cd"],[127278,1,"wz"],[127279,2],[127280,1,"a"],[127281,1,"b"],[127282,1,"c"],[127283,1,"d"],[127284,1,"e"],[127285,1,"f"],[127286,1,"g"],[127287,1,"h"],[127288,1,"i"],[127289,1,"j"],[127290,1,"k"],[127291,1,"l"],[127292,1,"m"],[127293,1,"n"],[127294,1,"o"],[127295,1,"p"],[127296,1,"q"],[127297,1,"r"],[127298,1,"s"],[127299,1,"t"],[127300,1,"u"],[127301,1,"v"],[127302,1,"w"],[127303,1,"x"],[127304,1,"y"],[127305,1,"z"],[127306,1,"hv"],[127307,1,"mv"],[127308,1,"sd"],[127309,1,"ss"],[127310,1,"ppv"],[127311,1,"wc"],[[127312,127318],2],[127319,2],[[127320,127326],2],[127327,2],[[127328,127337],2],[127338,1,"mc"],[127339,1,"md"],[127340,1,"mr"],[[127341,127343],2],[[127344,127352],2],[127353,2],[127354,2],[[127355,127356],2],[[127357,127358],2],[127359,2],[[127360,127369],2],[[127370,127373],2],[[127374,127375],2],[127376,1,"dj"],[[127377,127386],2],[[127387,127404],2],[127405,2],[[127406,127461],3],[[127462,127487],2],[127488,1,"ほか"],[127489,1,"ココ"],[127490,1,"サ"],[[127491,127503],3],[127504,1,"手"],[127505,1,"字"],[127506,1,"双"],[127507,1,"デ"],[127508,1,"二"],[127509,1,"多"],[127510,1,"解"],[127511,1,"天"],[127512,1,"交"],[127513,1,"映"],[127514,1,"無"],[127515,1,"料"],[127516,1,"前"],[127517,1,"後"],[127518,1,"再"],[127519,1,"新"],[127520,1,"初"],[127521,1,"終"],[127522,1,"生"],[127523,1,"販"],[127524,1,"声"],[127525,1,"吹"],[127526,1,"演"],[127527,1,"投"],[127528,1,"捕"],[127529,1,"一"],[127530,1,"三"],[127531,1,"遊"],[127532,1,"左"],[127533,1,"中"],[127534,1,"右"],[127535,1,"指"],[127536,1,"走"],[127537,1,"打"],[127538,1,"禁"],[127539,1,"空"],[127540,1,"合"],[127541,1,"満"],[127542,1,"有"],[127543,1,"月"],[127544,1,"申"],[127545,1,"割"],[127546,1,"営"],[127547,1,"配"],[[127548,127551],3],[127552,1,"〔本〕"],[127553,1,"〔三〕"],[127554,1,"〔二〕"],[127555,1,"〔安〕"],[127556,1,"〔点〕"],[127557,1,"〔打〕"],[127558,1,"〔盗〕"],[127559,1,"〔勝〕"],[127560,1,"〔敗〕"],[[127561,127567],3],[127568,1,"得"],[127569,1,"可"],[[127570,127583],3],[[127584,127589],2],[[127590,127743],3],[[127744,127776],2],[[127777,127788],2],[[127789,127791],2],[[127792,127797],2],[127798,2],[[127799,127868],2],[127869,2],[[127870,127871],2],[[127872,127891],2],[[127892,127903],2],[[127904,127940],2],[127941,2],[[127942,127946],2],[[127947,127950],2],[[127951,127955],2],[[127956,127967],2],[[127968,127984],2],[[127985,127991],2],[[127992,127999],2],[[128000,128062],2],[128063,2],[128064,2],[128065,2],[[128066,128247],2],[128248,2],[[128249,128252],2],[[128253,128254],2],[128255,2],[[128256,128317],2],[[128318,128319],2],[[128320,128323],2],[[128324,128330],2],[[128331,128335],2],[[128336,128359],2],[[128360,128377],2],[128378,2],[[128379,128419],2],[128420,2],[[128421,128506],2],[[128507,128511],2],[128512,2],[[128513,128528],2],[128529,2],[[128530,128532],2],[128533,2],[128534,2],[128535,2],[128536,2],[128537,2],[128538,2],[128539,2],[[128540,128542],2],[128543,2],[[128544,128549],2],[[128550,128551],2],[[128552,128555],2],[128556,2],[128557,2],[[128558,128559],2],[[128560,128563],2],[128564,2],[[128565,128576],2],[[128577,128578],2],[[128579,128580],2],[[128581,128591],2],[[128592,128639],2],[[128640,128709],2],[[128710,128719],2],[128720,2],[[128721,128722],2],[[128723,128724],2],[128725,2],[[128726,128727],2],[[128728,128732],3],[[128733,128735],2],[[128736,128748],2],[[128749,128751],3],[[128752,128755],2],[[128756,128758],2],[[128759,128760],2],[128761,2],[128762,2],[[128763,128764],2],[[128765,128767],3],[[128768,128883],2],[[128884,128895],3],[[128896,128980],2],[[128981,128984],2],[[128985,128991],3],[[128992,129003],2],[[129004,129007],3],[129008,2],[[129009,129023],3],[[129024,129035],2],[[129036,129039],3],[[129040,129095],2],[[129096,129103],3],[[129104,129113],2],[[129114,129119],3],[[129120,129159],2],[[129160,129167],3],[[129168,129197],2],[[129198,129199],3],[[129200,129201],2],[[129202,129279],3],[[129280,129291],2],[129292,2],[[129293,129295],2],[[129296,129304],2],[[129305,129310],2],[129311,2],[[129312,129319],2],[[129320,129327],2],[129328,2],[[129329,129330],2],[[129331,129342],2],[129343,2],[[129344,129355],2],[129356,2],[[129357,129359],2],[[129360,129374],2],[[129375,129387],2],[[129388,129392],2],[129393,2],[129394,2],[[129395,129398],2],[[129399,129400],2],[129401,2],[129402,2],[129403,2],[[129404,129407],2],[[129408,129412],2],[[129413,129425],2],[[129426,129431],2],[[129432,129442],2],[[129443,129444],2],[[129445,129450],2],[[129451,129453],2],[[129454,129455],2],[[129456,129465],2],[[129466,129471],2],[129472,2],[[129473,129474],2],[[129475,129482],2],[129483,2],[129484,2],[[129485,129487],2],[[129488,129510],2],[[129511,129535],2],[[129536,129619],2],[[129620,129631],3],[[129632,129645],2],[[129646,129647],3],[[129648,129651],2],[129652,2],[[129653,129655],3],[[129656,129658],2],[[129659,129660],2],[[129661,129663],3],[[129664,129666],2],[[129667,129670],2],[[129671,129679],3],[[129680,129685],2],[[129686,129704],2],[[129705,129708],2],[[129709,129711],3],[[129712,129718],2],[[129719,129722],2],[[129723,129727],3],[[129728,129730],2],[[129731,129733],2],[[129734,129743],3],[[129744,129750],2],[[129751,129753],2],[[129754,129759],3],[[129760,129767],2],[[129768,129775],3],[[129776,129782],2],[[129783,129791],3],[[129792,129938],2],[129939,3],[[129940,129994],2],[[129995,130031],3],[130032,1,"0"],[130033,1,"1"],[130034,1,"2"],[130035,1,"3"],[130036,1,"4"],[130037,1,"5"],[130038,1,"6"],[130039,1,"7"],[130040,1,"8"],[130041,1,"9"],[[130042,131069],3],[[131070,131071],3],[[131072,173782],2],[[173783,173789],2],[[173790,173791],2],[[173792,173823],3],[[173824,177972],2],[[177973,177976],2],[[177977,177983],3],[[177984,178205],2],[[178206,178207],3],[[178208,183969],2],[[183970,183983],3],[[183984,191456],2],[[191457,194559],3],[194560,1,"丽"],[194561,1,"丸"],[194562,1,"乁"],[194563,1,"𠄢"],[194564,1,"你"],[194565,1,"侮"],[194566,1,"侻"],[194567,1,"倂"],[194568,1,"偺"],[194569,1,"備"],[194570,1,"僧"],[194571,1,"像"],[194572,1,"㒞"],[194573,1,"𠘺"],[194574,1,"免"],[194575,1,"兔"],[194576,1,"兤"],[194577,1,"具"],[194578,1,"𠔜"],[194579,1,"㒹"],[194580,1,"內"],[194581,1,"再"],[194582,1,"𠕋"],[194583,1,"冗"],[194584,1,"冤"],[194585,1,"仌"],[194586,1,"冬"],[194587,1,"况"],[194588,1,"𩇟"],[194589,1,"凵"],[194590,1,"刃"],[194591,1,"㓟"],[194592,1,"刻"],[194593,1,"剆"],[194594,1,"割"],[194595,1,"剷"],[194596,1,"㔕"],[194597,1,"勇"],[194598,1,"勉"],[194599,1,"勤"],[194600,1,"勺"],[194601,1,"包"],[194602,1,"匆"],[194603,1,"北"],[194604,1,"卉"],[194605,1,"卑"],[194606,1,"博"],[194607,1,"即"],[194608,1,"卽"],[[194609,194611],1,"卿"],[194612,1,"𠨬"],[194613,1,"灰"],[194614,1,"及"],[194615,1,"叟"],[194616,1,"𠭣"],[194617,1,"叫"],[194618,1,"叱"],[194619,1,"吆"],[194620,1,"咞"],[194621,1,"吸"],[194622,1,"呈"],[194623,1,"周"],[194624,1,"咢"],[194625,1,"哶"],[194626,1,"唐"],[194627,1,"啓"],[194628,1,"啣"],[[194629,194630],1,"善"],[194631,1,"喙"],[194632,1,"喫"],[194633,1,"喳"],[194634,1,"嗂"],[194635,1,"圖"],[194636,1,"嘆"],[194637,1,"圗"],[194638,1,"噑"],[194639,1,"噴"],[194640,1,"切"],[194641,1,"壮"],[194642,1,"城"],[194643,1,"埴"],[194644,1,"堍"],[194645,1,"型"],[194646,1,"堲"],[194647,1,"報"],[194648,1,"墬"],[194649,1,"𡓤"],[194650,1,"売"],[194651,1,"壷"],[194652,1,"夆"],[194653,1,"多"],[194654,1,"夢"],[194655,1,"奢"],[194656,1,"𡚨"],[194657,1,"𡛪"],[194658,1,"姬"],[194659,1,"娛"],[194660,1,"娧"],[194661,1,"姘"],[194662,1,"婦"],[194663,1,"㛮"],[194664,3],[194665,1,"嬈"],[[194666,194667],1,"嬾"],[194668,1,"𡧈"],[194669,1,"寃"],[194670,1,"寘"],[194671,1,"寧"],[194672,1,"寳"],[194673,1,"𡬘"],[194674,1,"寿"],[194675,1,"将"],[194676,3],[194677,1,"尢"],[194678,1,"㞁"],[194679,1,"屠"],[194680,1,"屮"],[194681,1,"峀"],[194682,1,"岍"],[194683,1,"𡷤"],[194684,1,"嵃"],[194685,1,"𡷦"],[194686,1,"嵮"],[194687,1,"嵫"],[194688,1,"嵼"],[194689,1,"巡"],[194690,1,"巢"],[194691,1,"㠯"],[194692,1,"巽"],[194693,1,"帨"],[194694,1,"帽"],[194695,1,"幩"],[194696,1,"㡢"],[194697,1,"𢆃"],[194698,1,"㡼"],[194699,1,"庰"],[194700,1,"庳"],[194701,1,"庶"],[194702,1,"廊"],[194703,1,"𪎒"],[194704,1,"廾"],[[194705,194706],1,"𢌱"],[194707,1,"舁"],[[194708,194709],1,"弢"],[194710,1,"㣇"],[194711,1,"𣊸"],[194712,1,"𦇚"],[194713,1,"形"],[194714,1,"彫"],[194715,1,"㣣"],[194716,1,"徚"],[194717,1,"忍"],[194718,1,"志"],[194719,1,"忹"],[194720,1,"悁"],[194721,1,"㤺"],[194722,1,"㤜"],[194723,1,"悔"],[194724,1,"𢛔"],[194725,1,"惇"],[194726,1,"慈"],[194727,1,"慌"],[194728,1,"慎"],[194729,1,"慌"],[194730,1,"慺"],[194731,1,"憎"],[194732,1,"憲"],[194733,1,"憤"],[194734,1,"憯"],[194735,1,"懞"],[194736,1,"懲"],[194737,1,"懶"],[194738,1,"成"],[194739,1,"戛"],[194740,1,"扝"],[194741,1,"抱"],[194742,1,"拔"],[194743,1,"捐"],[194744,1,"𢬌"],[194745,1,"挽"],[194746,1,"拼"],[194747,1,"捨"],[194748,1,"掃"],[194749,1,"揤"],[194750,1,"𢯱"],[194751,1,"搢"],[194752,1,"揅"],[194753,1,"掩"],[194754,1,"㨮"],[194755,1,"摩"],[194756,1,"摾"],[194757,1,"撝"],[194758,1,"摷"],[194759,1,"㩬"],[194760,1,"敏"],[194761,1,"敬"],[194762,1,"𣀊"],[194763,1,"旣"],[194764,1,"書"],[194765,1,"晉"],[194766,1,"㬙"],[194767,1,"暑"],[194768,1,"㬈"],[194769,1,"㫤"],[194770,1,"冒"],[194771,1,"冕"],[194772,1,"最"],[194773,1,"暜"],[194774,1,"肭"],[194775,1,"䏙"],[194776,1,"朗"],[194777,1,"望"],[194778,1,"朡"],[194779,1,"杞"],[194780,1,"杓"],[194781,1,"𣏃"],[194782,1,"㭉"],[194783,1,"柺"],[194784,1,"枅"],[194785,1,"桒"],[194786,1,"梅"],[194787,1,"𣑭"],[194788,1,"梎"],[194789,1,"栟"],[194790,1,"椔"],[194791,1,"㮝"],[194792,1,"楂"],[194793,1,"榣"],[194794,1,"槪"],[194795,1,"檨"],[194796,1,"𣚣"],[194797,1,"櫛"],[194798,1,"㰘"],[194799,1,"次"],[194800,1,"𣢧"],[194801,1,"歔"],[194802,1,"㱎"],[194803,1,"歲"],[194804,1,"殟"],[194805,1,"殺"],[194806,1,"殻"],[194807,1,"𣪍"],[194808,1,"𡴋"],[194809,1,"𣫺"],[194810,1,"汎"],[194811,1,"𣲼"],[194812,1,"沿"],[194813,1,"泍"],[194814,1,"汧"],[194815,1,"洖"],[194816,1,"派"],[194817,1,"海"],[194818,1,"流"],[194819,1,"浩"],[194820,1,"浸"],[194821,1,"涅"],[194822,1,"𣴞"],[194823,1,"洴"],[194824,1,"港"],[194825,1,"湮"],[194826,1,"㴳"],[194827,1,"滋"],[194828,1,"滇"],[194829,1,"𣻑"],[194830,1,"淹"],[194831,1,"潮"],[194832,1,"𣽞"],[194833,1,"𣾎"],[194834,1,"濆"],[194835,1,"瀹"],[194836,1,"瀞"],[194837,1,"瀛"],[194838,1,"㶖"],[194839,1,"灊"],[194840,1,"災"],[194841,1,"灷"],[194842,1,"炭"],[194843,1,"𠔥"],[194844,1,"煅"],[194845,1,"𤉣"],[194846,1,"熜"],[194847,3],[194848,1,"爨"],[194849,1,"爵"],[194850,1,"牐"],[194851,1,"𤘈"],[194852,1,"犀"],[194853,1,"犕"],[194854,1,"𤜵"],[194855,1,"𤠔"],[194856,1,"獺"],[194857,1,"王"],[194858,1,"㺬"],[194859,1,"玥"],[[194860,194861],1,"㺸"],[194862,1,"瑇"],[194863,1,"瑜"],[194864,1,"瑱"],[194865,1,"璅"],[194866,1,"瓊"],[194867,1,"㼛"],[194868,1,"甤"],[194869,1,"𤰶"],[194870,1,"甾"],[194871,1,"𤲒"],[194872,1,"異"],[194873,1,"𢆟"],[194874,1,"瘐"],[194875,1,"𤾡"],[194876,1,"𤾸"],[194877,1,"𥁄"],[194878,1,"㿼"],[194879,1,"䀈"],[194880,1,"直"],[194881,1,"𥃳"],[194882,1,"𥃲"],[194883,1,"𥄙"],[194884,1,"𥄳"],[194885,1,"眞"],[[194886,194887],1,"真"],[194888,1,"睊"],[194889,1,"䀹"],[194890,1,"瞋"],[194891,1,"䁆"],[194892,1,"䂖"],[194893,1,"𥐝"],[194894,1,"硎"],[194895,1,"碌"],[194896,1,"磌"],[194897,1,"䃣"],[194898,1,"𥘦"],[194899,1,"祖"],[194900,1,"𥚚"],[194901,1,"𥛅"],[194902,1,"福"],[194903,1,"秫"],[194904,1,"䄯"],[194905,1,"穀"],[194906,1,"穊"],[194907,1,"穏"],[194908,1,"𥥼"],[[194909,194910],1,"𥪧"],[194911,3],[194912,1,"䈂"],[194913,1,"𥮫"],[194914,1,"篆"],[194915,1,"築"],[194916,1,"䈧"],[194917,1,"𥲀"],[194918,1,"糒"],[194919,1,"䊠"],[194920,1,"糨"],[194921,1,"糣"],[194922,1,"紀"],[194923,1,"𥾆"],[194924,1,"絣"],[194925,1,"䌁"],[194926,1,"緇"],[194927,1,"縂"],[194928,1,"繅"],[194929,1,"䌴"],[194930,1,"𦈨"],[194931,1,"𦉇"],[194932,1,"䍙"],[194933,1,"𦋙"],[194934,1,"罺"],[194935,1,"𦌾"],[194936,1,"羕"],[194937,1,"翺"],[194938,1,"者"],[194939,1,"𦓚"],[194940,1,"𦔣"],[194941,1,"聠"],[194942,1,"𦖨"],[194943,1,"聰"],[194944,1,"𣍟"],[194945,1,"䏕"],[194946,1,"育"],[194947,1,"脃"],[194948,1,"䐋"],[194949,1,"脾"],[194950,1,"媵"],[194951,1,"𦞧"],[194952,1,"𦞵"],[194953,1,"𣎓"],[194954,1,"𣎜"],[194955,1,"舁"],[194956,1,"舄"],[194957,1,"辞"],[194958,1,"䑫"],[194959,1,"芑"],[194960,1,"芋"],[194961,1,"芝"],[194962,1,"劳"],[194963,1,"花"],[194964,1,"芳"],[194965,1,"芽"],[194966,1,"苦"],[194967,1,"𦬼"],[194968,1,"若"],[194969,1,"茝"],[194970,1,"荣"],[194971,1,"莭"],[194972,1,"茣"],[194973,1,"莽"],[194974,1,"菧"],[194975,1,"著"],[194976,1,"荓"],[194977,1,"菊"],[194978,1,"菌"],[194979,1,"菜"],[194980,1,"𦰶"],[194981,1,"𦵫"],[194982,1,"𦳕"],[194983,1,"䔫"],[194984,1,"蓱"],[194985,1,"蓳"],[194986,1,"蔖"],[194987,1,"𧏊"],[194988,1,"蕤"],[194989,1,"𦼬"],[194990,1,"䕝"],[194991,1,"䕡"],[194992,1,"𦾱"],[194993,1,"𧃒"],[194994,1,"䕫"],[194995,1,"虐"],[194996,1,"虜"],[194997,1,"虧"],[194998,1,"虩"],[194999,1,"蚩"],[195000,1,"蚈"],[195001,1,"蜎"],[195002,1,"蛢"],[195003,1,"蝹"],[195004,1,"蜨"],[195005,1,"蝫"],[195006,1,"螆"],[195007,3],[195008,1,"蟡"],[195009,1,"蠁"],[195010,1,"䗹"],[195011,1,"衠"],[195012,1,"衣"],[195013,1,"𧙧"],[195014,1,"裗"],[195015,1,"裞"],[195016,1,"䘵"],[195017,1,"裺"],[195018,1,"㒻"],[195019,1,"𧢮"],[195020,1,"𧥦"],[195021,1,"䚾"],[195022,1,"䛇"],[195023,1,"誠"],[195024,1,"諭"],[195025,1,"變"],[195026,1,"豕"],[195027,1,"𧲨"],[195028,1,"貫"],[195029,1,"賁"],[195030,1,"贛"],[195031,1,"起"],[195032,1,"𧼯"],[195033,1,"𠠄"],[195034,1,"跋"],[195035,1,"趼"],[195036,1,"跰"],[195037,1,"𠣞"],[195038,1,"軔"],[195039,1,"輸"],[195040,1,"𨗒"],[195041,1,"𨗭"],[195042,1,"邔"],[195043,1,"郱"],[195044,1,"鄑"],[195045,1,"𨜮"],[195046,1,"鄛"],[195047,1,"鈸"],[195048,1,"鋗"],[195049,1,"鋘"],[195050,1,"鉼"],[195051,1,"鏹"],[195052,1,"鐕"],[195053,1,"𨯺"],[195054,1,"開"],[195055,1,"䦕"],[195056,1,"閷"],[195057,1,"𨵷"],[195058,1,"䧦"],[195059,1,"雃"],[195060,1,"嶲"],[195061,1,"霣"],[195062,1,"𩅅"],[195063,1,"𩈚"],[195064,1,"䩮"],[195065,1,"䩶"],[195066,1,"韠"],[195067,1,"𩐊"],[195068,1,"䪲"],[195069,1,"𩒖"],[[195070,195071],1,"頋"],[195072,1,"頩"],[195073,1,"𩖶"],[195074,1,"飢"],[195075,1,"䬳"],[195076,1,"餩"],[195077,1,"馧"],[195078,1,"駂"],[195079,1,"駾"],[195080,1,"䯎"],[195081,1,"𩬰"],[195082,1,"鬒"],[195083,1,"鱀"],[195084,1,"鳽"],[195085,1,"䳎"],[195086,1,"䳭"],[195087,1,"鵧"],[195088,1,"𪃎"],[195089,1,"䳸"],[195090,1,"𪄅"],[195091,1,"𪈎"],[195092,1,"𪊑"],[195093,1,"麻"],[195094,1,"䵖"],[195095,1,"黹"],[195096,1,"黾"],[195097,1,"鼅"],[195098,1,"鼏"],[195099,1,"鼖"],[195100,1,"鼻"],[195101,1,"𪘀"],[[195102,196605],3],[[196606,196607],3],[[196608,201546],2],[[201547,262141],3],[[262142,262143],3],[[262144,327677],3],[[327678,327679],3],[[327680,393213],3],[[393214,393215],3],[[393216,458749],3],[[458750,458751],3],[[458752,524285],3],[[524286,524287],3],[[524288,589821],3],[[589822,589823],3],[[589824,655357],3],[[655358,655359],3],[[655360,720893],3],[[720894,720895],3],[[720896,786429],3],[[786430,786431],3],[[786432,851965],3],[[851966,851967],3],[[851968,917501],3],[[917502,917503],3],[917504,3],[917505,3],[[917506,917535],3],[[917536,917631],3],[[917632,917759],3],[[917760,917999],7],[[918000,983037],3],[[983038,983039],3],[[983040,1048573],3],[[1048574,1048575],3],[[1048576,1114109],3],[[1114110,1114111],3]] \ No newline at end of file diff --git a/node_modules/mongodb-connection-string-url/node_modules/tr46/lib/regexes.js b/node_modules/mongodb-connection-string-url/node_modules/tr46/lib/regexes.js new file mode 100644 index 000000000..4dd8051e2 --- /dev/null +++ b/node_modules/mongodb-connection-string-url/node_modules/tr46/lib/regexes.js @@ -0,0 +1,29 @@ +"use strict"; + +const combiningMarks = /[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0898-\u089F\u08CA-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3C\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D81-\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u180F\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ACE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA82C\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\u{101FD}\u{102E0}\u{10376}-\u{1037A}\u{10A01}-\u{10A03}\u{10A05}\u{10A06}\u{10A0C}-\u{10A0F}\u{10A38}-\u{10A3A}\u{10A3F}\u{10AE5}\u{10AE6}\u{10D24}-\u{10D27}\u{10EAB}\u{10EAC}\u{10F46}-\u{10F50}\u{10F82}-\u{10F85}\u{11000}-\u{11002}\u{11038}-\u{11046}\u{11070}\u{11073}\u{11074}\u{1107F}-\u{11082}\u{110B0}-\u{110BA}\u{110C2}\u{11100}-\u{11102}\u{11127}-\u{11134}\u{11145}\u{11146}\u{11173}\u{11180}-\u{11182}\u{111B3}-\u{111C0}\u{111C9}-\u{111CC}\u{111CE}\u{111CF}\u{1122C}-\u{11237}\u{1123E}\u{112DF}-\u{112EA}\u{11300}-\u{11303}\u{1133B}\u{1133C}\u{1133E}-\u{11344}\u{11347}\u{11348}\u{1134B}-\u{1134D}\u{11357}\u{11362}\u{11363}\u{11366}-\u{1136C}\u{11370}-\u{11374}\u{11435}-\u{11446}\u{1145E}\u{114B0}-\u{114C3}\u{115AF}-\u{115B5}\u{115B8}-\u{115C0}\u{115DC}\u{115DD}\u{11630}-\u{11640}\u{116AB}-\u{116B7}\u{1171D}-\u{1172B}\u{1182C}-\u{1183A}\u{11930}-\u{11935}\u{11937}\u{11938}\u{1193B}-\u{1193E}\u{11940}\u{11942}\u{11943}\u{119D1}-\u{119D7}\u{119DA}-\u{119E0}\u{119E4}\u{11A01}-\u{11A0A}\u{11A33}-\u{11A39}\u{11A3B}-\u{11A3E}\u{11A47}\u{11A51}-\u{11A5B}\u{11A8A}-\u{11A99}\u{11C2F}-\u{11C36}\u{11C38}-\u{11C3F}\u{11C92}-\u{11CA7}\u{11CA9}-\u{11CB6}\u{11D31}-\u{11D36}\u{11D3A}\u{11D3C}\u{11D3D}\u{11D3F}-\u{11D45}\u{11D47}\u{11D8A}-\u{11D8E}\u{11D90}\u{11D91}\u{11D93}-\u{11D97}\u{11EF3}-\u{11EF6}\u{16AF0}-\u{16AF4}\u{16B30}-\u{16B36}\u{16F4F}\u{16F51}-\u{16F87}\u{16F8F}-\u{16F92}\u{16FE4}\u{16FF0}\u{16FF1}\u{1BC9D}\u{1BC9E}\u{1CF00}-\u{1CF2D}\u{1CF30}-\u{1CF46}\u{1D165}-\u{1D169}\u{1D16D}-\u{1D172}\u{1D17B}-\u{1D182}\u{1D185}-\u{1D18B}\u{1D1AA}-\u{1D1AD}\u{1D242}-\u{1D244}\u{1DA00}-\u{1DA36}\u{1DA3B}-\u{1DA6C}\u{1DA75}\u{1DA84}\u{1DA9B}-\u{1DA9F}\u{1DAA1}-\u{1DAAF}\u{1E000}-\u{1E006}\u{1E008}-\u{1E018}\u{1E01B}-\u{1E021}\u{1E023}\u{1E024}\u{1E026}-\u{1E02A}\u{1E130}-\u{1E136}\u{1E2AE}\u{1E2EC}-\u{1E2EF}\u{1E8D0}-\u{1E8D6}\u{1E944}-\u{1E94A}\u{E0100}-\u{E01EF}]/u; +const combiningClassVirama = /[\u094D\u09CD\u0A4D\u0ACD\u0B4D\u0BCD\u0C4D\u0CCD\u0D3B\u0D3C\u0D4D\u0DCA\u0E3A\u0EBA\u0F84\u1039\u103A\u1714\u1734\u17D2\u1A60\u1B44\u1BAA\u1BAB\u1BF2\u1BF3\u2D7F\uA806\uA8C4\uA953\uA9C0\uAAF6\uABED\u{10A3F}\u{11046}\u{1107F}\u{110B9}\u{11133}\u{11134}\u{111C0}\u{11235}\u{112EA}\u{1134D}\u{11442}\u{114C2}\u{115BF}\u{1163F}\u{116B6}\u{1172B}\u{11839}\u{119E0}\u{11A34}\u{11A47}\u{11A99}\u{11C3F}\u{11D44}\u{11D45}\u{11D97}]/u; +const validZWNJ = /[\u0620\u0626\u0628\u062A-\u062E\u0633-\u063F\u0641-\u0647\u0649\u064A\u066E\u066F\u0678-\u0687\u069A-\u06BF\u06C1\u06C2\u06CC\u06CE\u06D0\u06D1\u06FA-\u06FC\u06FF\u0712-\u0714\u071A-\u071D\u071F-\u0727\u0729\u072B\u072D\u072E\u074E-\u0758\u075C-\u076A\u076D-\u0770\u0772\u0775-\u0777\u077A-\u077F\u07CA-\u07EA\u0841-\u0845\u0848\u084A-\u0853\u0855\u0860\u0862-\u0865\u0868\u08A0-\u08A9\u08AF\u08B0\u08B3\u08B4\u08B6-\u08B8\u08BA-\u08BD\u1807\u1820-\u1878\u1887-\u18A8\u18AA\uA840-\uA872\u{10AC0}-\u{10AC4}\u{10ACD}\u{10AD3}-\u{10ADC}\u{10ADE}-\u{10AE0}\u{10AEB}-\u{10AEE}\u{10B80}\u{10B82}\u{10B86}-\u{10B88}\u{10B8A}\u{10B8B}\u{10B8D}\u{10B90}\u{10BAD}\u{10BAE}\u{10D00}-\u{10D21}\u{10D23}\u{10F30}-\u{10F32}\u{10F34}-\u{10F44}\u{10F51}-\u{10F53}\u{1E900}-\u{1E943}][\xAD\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u061C\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u070F\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D3-\u08E1\u08E3-\u0902\u093A\u093C\u0941-\u0948\u094D\u0951-\u0957\u0962\u0963\u0981\u09BC\u09C1-\u09C4\u09CD\u09E2\u09E3\u09FE\u0A01\u0A02\u0A3C\u0A41\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81\u0A82\u0ABC\u0AC1-\u0AC5\u0AC7\u0AC8\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01\u0B3C\u0B3F\u0B41-\u0B44\u0B4D\u0B56\u0B62\u0B63\u0B82\u0BC0\u0BCD\u0C00\u0C04\u0C3E-\u0C40\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81\u0CBC\u0CBF\u0CC6\u0CCC\u0CCD\u0CE2\u0CE3\u0D00\u0D01\u0D3B\u0D3C\u0D41-\u0D44\u0D4D\u0D62\u0D63\u0DCA\u0DD2-\u0DD4\u0DD6\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F71-\u0F7E\u0F80-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102D-\u1030\u1032-\u1037\u1039\u103A\u103D\u103E\u1058\u1059\u105E-\u1060\u1071-\u1074\u1082\u1085\u1086\u108D\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4\u17B5\u17B7-\u17BD\u17C6\u17C9-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193B\u1A17\u1A18\u1A1B\u1A56\u1A58-\u1A5E\u1A60\u1A62\u1A65-\u1A6C\u1A73-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B03\u1B34\u1B36-\u1B3A\u1B3C\u1B42\u1B6B-\u1B73\u1B80\u1B81\u1BA2-\u1BA5\u1BA8\u1BA9\u1BAB-\u1BAD\u1BE6\u1BE8\u1BE9\u1BED\u1BEF-\u1BF1\u1C2C-\u1C33\u1C36\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE0\u1CE2-\u1CE8\u1CED\u1CF4\u1CF8\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u200B\u200E\u200F\u202A-\u202E\u2060-\u2064\u206A-\u206F\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302D\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA825\uA826\uA8C4\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA951\uA980-\uA982\uA9B3\uA9B6-\uA9B9\uA9BC\uA9BD\uA9E5\uAA29-\uAA2E\uAA31\uAA32\uAA35\uAA36\uAA43\uAA4C\uAA7C\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEC\uAAED\uAAF6\uABE5\uABE8\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFEFF\uFFF9-\uFFFB\u{101FD}\u{102E0}\u{10376}-\u{1037A}\u{10A01}-\u{10A03}\u{10A05}\u{10A06}\u{10A0C}-\u{10A0F}\u{10A38}-\u{10A3A}\u{10A3F}\u{10AE5}\u{10AE6}\u{10D24}-\u{10D27}\u{10F46}-\u{10F50}\u{11001}\u{11038}-\u{11046}\u{1107F}-\u{11081}\u{110B3}-\u{110B6}\u{110B9}\u{110BA}\u{11100}-\u{11102}\u{11127}-\u{1112B}\u{1112D}-\u{11134}\u{11173}\u{11180}\u{11181}\u{111B6}-\u{111BE}\u{111C9}-\u{111CC}\u{1122F}-\u{11231}\u{11234}\u{11236}\u{11237}\u{1123E}\u{112DF}\u{112E3}-\u{112EA}\u{11300}\u{11301}\u{1133B}\u{1133C}\u{11340}\u{11366}-\u{1136C}\u{11370}-\u{11374}\u{11438}-\u{1143F}\u{11442}-\u{11444}\u{11446}\u{1145E}\u{114B3}-\u{114B8}\u{114BA}\u{114BF}\u{114C0}\u{114C2}\u{114C3}\u{115B2}-\u{115B5}\u{115BC}\u{115BD}\u{115BF}\u{115C0}\u{115DC}\u{115DD}\u{11633}-\u{1163A}\u{1163D}\u{1163F}\u{11640}\u{116AB}\u{116AD}\u{116B0}-\u{116B5}\u{116B7}\u{1171D}-\u{1171F}\u{11722}-\u{11725}\u{11727}-\u{1172B}\u{1182F}-\u{11837}\u{11839}\u{1183A}\u{119D4}-\u{119D7}\u{119DA}\u{119DB}\u{119E0}\u{11A01}-\u{11A0A}\u{11A33}-\u{11A38}\u{11A3B}-\u{11A3E}\u{11A47}\u{11A51}-\u{11A56}\u{11A59}-\u{11A5B}\u{11A8A}-\u{11A96}\u{11A98}\u{11A99}\u{11C30}-\u{11C36}\u{11C38}-\u{11C3D}\u{11C3F}\u{11C92}-\u{11CA7}\u{11CAA}-\u{11CB0}\u{11CB2}\u{11CB3}\u{11CB5}\u{11CB6}\u{11D31}-\u{11D36}\u{11D3A}\u{11D3C}\u{11D3D}\u{11D3F}-\u{11D45}\u{11D47}\u{11D90}\u{11D91}\u{11D95}\u{11D97}\u{11EF3}\u{11EF4}\u{13430}-\u{13438}\u{16AF0}-\u{16AF4}\u{16B30}-\u{16B36}\u{16F4F}\u{16F8F}-\u{16F92}\u{1BC9D}\u{1BC9E}\u{1BCA0}-\u{1BCA3}\u{1D167}-\u{1D169}\u{1D173}-\u{1D182}\u{1D185}-\u{1D18B}\u{1D1AA}-\u{1D1AD}\u{1D242}-\u{1D244}\u{1DA00}-\u{1DA36}\u{1DA3B}-\u{1DA6C}\u{1DA75}\u{1DA84}\u{1DA9B}-\u{1DA9F}\u{1DAA1}-\u{1DAAF}\u{1E000}-\u{1E006}\u{1E008}-\u{1E018}\u{1E01B}-\u{1E021}\u{1E023}\u{1E024}\u{1E026}-\u{1E02A}\u{1E130}-\u{1E136}\u{1E2EC}-\u{1E2EF}\u{1E8D0}-\u{1E8D6}\u{1E944}-\u{1E94B}\u{E0001}\u{E0020}-\u{E007F}\u{E0100}-\u{E01EF}]*\u200C[\xAD\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u061C\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u070F\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D3-\u08E1\u08E3-\u0902\u093A\u093C\u0941-\u0948\u094D\u0951-\u0957\u0962\u0963\u0981\u09BC\u09C1-\u09C4\u09CD\u09E2\u09E3\u09FE\u0A01\u0A02\u0A3C\u0A41\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81\u0A82\u0ABC\u0AC1-\u0AC5\u0AC7\u0AC8\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01\u0B3C\u0B3F\u0B41-\u0B44\u0B4D\u0B56\u0B62\u0B63\u0B82\u0BC0\u0BCD\u0C00\u0C04\u0C3E-\u0C40\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81\u0CBC\u0CBF\u0CC6\u0CCC\u0CCD\u0CE2\u0CE3\u0D00\u0D01\u0D3B\u0D3C\u0D41-\u0D44\u0D4D\u0D62\u0D63\u0DCA\u0DD2-\u0DD4\u0DD6\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F71-\u0F7E\u0F80-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102D-\u1030\u1032-\u1037\u1039\u103A\u103D\u103E\u1058\u1059\u105E-\u1060\u1071-\u1074\u1082\u1085\u1086\u108D\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4\u17B5\u17B7-\u17BD\u17C6\u17C9-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193B\u1A17\u1A18\u1A1B\u1A56\u1A58-\u1A5E\u1A60\u1A62\u1A65-\u1A6C\u1A73-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B03\u1B34\u1B36-\u1B3A\u1B3C\u1B42\u1B6B-\u1B73\u1B80\u1B81\u1BA2-\u1BA5\u1BA8\u1BA9\u1BAB-\u1BAD\u1BE6\u1BE8\u1BE9\u1BED\u1BEF-\u1BF1\u1C2C-\u1C33\u1C36\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE0\u1CE2-\u1CE8\u1CED\u1CF4\u1CF8\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u200B\u200E\u200F\u202A-\u202E\u2060-\u2064\u206A-\u206F\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302D\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA825\uA826\uA8C4\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA951\uA980-\uA982\uA9B3\uA9B6-\uA9B9\uA9BC\uA9BD\uA9E5\uAA29-\uAA2E\uAA31\uAA32\uAA35\uAA36\uAA43\uAA4C\uAA7C\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEC\uAAED\uAAF6\uABE5\uABE8\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFEFF\uFFF9-\uFFFB\u{101FD}\u{102E0}\u{10376}-\u{1037A}\u{10A01}-\u{10A03}\u{10A05}\u{10A06}\u{10A0C}-\u{10A0F}\u{10A38}-\u{10A3A}\u{10A3F}\u{10AE5}\u{10AE6}\u{10D24}-\u{10D27}\u{10F46}-\u{10F50}\u{11001}\u{11038}-\u{11046}\u{1107F}-\u{11081}\u{110B3}-\u{110B6}\u{110B9}\u{110BA}\u{11100}-\u{11102}\u{11127}-\u{1112B}\u{1112D}-\u{11134}\u{11173}\u{11180}\u{11181}\u{111B6}-\u{111BE}\u{111C9}-\u{111CC}\u{1122F}-\u{11231}\u{11234}\u{11236}\u{11237}\u{1123E}\u{112DF}\u{112E3}-\u{112EA}\u{11300}\u{11301}\u{1133B}\u{1133C}\u{11340}\u{11366}-\u{1136C}\u{11370}-\u{11374}\u{11438}-\u{1143F}\u{11442}-\u{11444}\u{11446}\u{1145E}\u{114B3}-\u{114B8}\u{114BA}\u{114BF}\u{114C0}\u{114C2}\u{114C3}\u{115B2}-\u{115B5}\u{115BC}\u{115BD}\u{115BF}\u{115C0}\u{115DC}\u{115DD}\u{11633}-\u{1163A}\u{1163D}\u{1163F}\u{11640}\u{116AB}\u{116AD}\u{116B0}-\u{116B5}\u{116B7}\u{1171D}-\u{1171F}\u{11722}-\u{11725}\u{11727}-\u{1172B}\u{1182F}-\u{11837}\u{11839}\u{1183A}\u{119D4}-\u{119D7}\u{119DA}\u{119DB}\u{119E0}\u{11A01}-\u{11A0A}\u{11A33}-\u{11A38}\u{11A3B}-\u{11A3E}\u{11A47}\u{11A51}-\u{11A56}\u{11A59}-\u{11A5B}\u{11A8A}-\u{11A96}\u{11A98}\u{11A99}\u{11C30}-\u{11C36}\u{11C38}-\u{11C3D}\u{11C3F}\u{11C92}-\u{11CA7}\u{11CAA}-\u{11CB0}\u{11CB2}\u{11CB3}\u{11CB5}\u{11CB6}\u{11D31}-\u{11D36}\u{11D3A}\u{11D3C}\u{11D3D}\u{11D3F}-\u{11D45}\u{11D47}\u{11D90}\u{11D91}\u{11D95}\u{11D97}\u{11EF3}\u{11EF4}\u{13430}-\u{13438}\u{16AF0}-\u{16AF4}\u{16B30}-\u{16B36}\u{16F4F}\u{16F8F}-\u{16F92}\u{1BC9D}\u{1BC9E}\u{1BCA0}-\u{1BCA3}\u{1D167}-\u{1D169}\u{1D173}-\u{1D182}\u{1D185}-\u{1D18B}\u{1D1AA}-\u{1D1AD}\u{1D242}-\u{1D244}\u{1DA00}-\u{1DA36}\u{1DA3B}-\u{1DA6C}\u{1DA75}\u{1DA84}\u{1DA9B}-\u{1DA9F}\u{1DAA1}-\u{1DAAF}\u{1E000}-\u{1E006}\u{1E008}-\u{1E018}\u{1E01B}-\u{1E021}\u{1E023}\u{1E024}\u{1E026}-\u{1E02A}\u{1E130}-\u{1E136}\u{1E2EC}-\u{1E2EF}\u{1E8D0}-\u{1E8D6}\u{1E944}-\u{1E94B}\u{E0001}\u{E0020}-\u{E007F}\u{E0100}-\u{E01EF}]*[\u0620\u0622-\u063F\u0641-\u064A\u066E\u066F\u0671-\u0673\u0675-\u06D3\u06D5\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u077F\u07CA-\u07EA\u0840-\u0855\u0860\u0862-\u0865\u0867-\u086A\u08A0-\u08AC\u08AE-\u08B4\u08B6-\u08BD\u1807\u1820-\u1878\u1887-\u18A8\u18AA\uA840-\uA871\u{10AC0}-\u{10AC5}\u{10AC7}\u{10AC9}\u{10ACA}\u{10ACE}-\u{10AD6}\u{10AD8}-\u{10AE1}\u{10AE4}\u{10AEB}-\u{10AEF}\u{10B80}-\u{10B91}\u{10BA9}-\u{10BAE}\u{10D01}-\u{10D23}\u{10F30}-\u{10F44}\u{10F51}-\u{10F54}\u{1E900}-\u{1E943}]/u; +const bidiDomain = /[\u05BE\u05C0\u05C3\u05C6\u05D0-\u05EA\u05EF-\u05F4\u0600-\u0605\u0608\u060B\u060D\u061B-\u064A\u0660-\u0669\u066B-\u066F\u0671-\u06D5\u06DD\u06E5\u06E6\u06EE\u06EF\u06FA-\u070D\u070F\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07C0-\u07EA\u07F4\u07F5\u07FA\u07FE-\u0815\u081A\u0824\u0828\u0830-\u083E\u0840-\u0858\u085E\u0860-\u086A\u0870-\u088E\u0890\u0891\u08A0-\u08C9\u08E2\u200F\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBC2\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFC\uFE70-\uFE74\uFE76-\uFEFC\u{10800}-\u{10805}\u{10808}\u{1080A}-\u{10835}\u{10837}\u{10838}\u{1083C}\u{1083F}-\u{10855}\u{10857}-\u{1089E}\u{108A7}-\u{108AF}\u{108E0}-\u{108F2}\u{108F4}\u{108F5}\u{108FB}-\u{1091B}\u{10920}-\u{10939}\u{1093F}\u{10980}-\u{109B7}\u{109BC}-\u{109CF}\u{109D2}-\u{10A00}\u{10A10}-\u{10A13}\u{10A15}-\u{10A17}\u{10A19}-\u{10A35}\u{10A40}-\u{10A48}\u{10A50}-\u{10A58}\u{10A60}-\u{10A9F}\u{10AC0}-\u{10AE4}\u{10AEB}-\u{10AF6}\u{10B00}-\u{10B35}\u{10B40}-\u{10B55}\u{10B58}-\u{10B72}\u{10B78}-\u{10B91}\u{10B99}-\u{10B9C}\u{10BA9}-\u{10BAF}\u{10C00}-\u{10C48}\u{10C80}-\u{10CB2}\u{10CC0}-\u{10CF2}\u{10CFA}-\u{10D23}\u{10D30}-\u{10D39}\u{10E60}-\u{10E7E}\u{10E80}-\u{10EA9}\u{10EAD}\u{10EB0}\u{10EB1}\u{10F00}-\u{10F27}\u{10F30}-\u{10F45}\u{10F51}-\u{10F59}\u{10F70}-\u{10F81}\u{10F86}-\u{10F89}\u{10FB0}-\u{10FCB}\u{10FE0}-\u{10FF6}\u{1E800}-\u{1E8C4}\u{1E8C7}-\u{1E8CF}\u{1E900}-\u{1E943}\u{1E94B}\u{1E950}-\u{1E959}\u{1E95E}\u{1E95F}\u{1EC71}-\u{1ECB4}\u{1ED01}-\u{1ED3D}\u{1EE00}-\u{1EE03}\u{1EE05}-\u{1EE1F}\u{1EE21}\u{1EE22}\u{1EE24}\u{1EE27}\u{1EE29}-\u{1EE32}\u{1EE34}-\u{1EE37}\u{1EE39}\u{1EE3B}\u{1EE42}\u{1EE47}\u{1EE49}\u{1EE4B}\u{1EE4D}-\u{1EE4F}\u{1EE51}\u{1EE52}\u{1EE54}\u{1EE57}\u{1EE59}\u{1EE5B}\u{1EE5D}\u{1EE5F}\u{1EE61}\u{1EE62}\u{1EE64}\u{1EE67}-\u{1EE6A}\u{1EE6C}-\u{1EE72}\u{1EE74}-\u{1EE77}\u{1EE79}-\u{1EE7C}\u{1EE7E}\u{1EE80}-\u{1EE89}\u{1EE8B}-\u{1EE9B}\u{1EEA1}-\u{1EEA3}\u{1EEA5}-\u{1EEA9}\u{1EEAB}-\u{1EEBB}]/u; +const bidiS1LTR = /[A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02B8\u02BB-\u02C1\u02D0\u02D1\u02E0-\u02E4\u02EE\u0370-\u0373\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0482\u048A-\u052F\u0531-\u0556\u0559-\u0589\u0903-\u0939\u093B\u093D-\u0940\u0949-\u094C\u094E-\u0950\u0958-\u0961\u0964-\u0980\u0982\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD-\u09C0\u09C7\u09C8\u09CB\u09CC\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E1\u09E6-\u09F1\u09F4-\u09FA\u09FC\u09FD\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36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-\u0DD1\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2-\u0DF4\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E4F-\u0E5B\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00-\u0F17\u0F1A-\u0F34\u0F36\u0F38\u0F3E-\u0F47\u0F49-\u0F6C\u0F7F\u0F85\u0F88-\u0F8C\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE-\u0FDA\u1000-\u102C\u1031\u1038\u103B\u103C\u103F-\u1057\u105A-\u105D\u1061-\u1070\u1075-\u1081\u1083\u1084\u1087-\u108C\u108E-\u109C\u109E-\u10C5\u10C7\u10CD\u10D0-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1360-\u137C\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u167F\u1681-\u169A\u16A0-\u16F8\u1700-\u1711\u1715\u171F-\u1731\u1734-\u1736\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17B6\u17BE-\u17C5\u17C7\u17C8\u17D4-\u17DA\u17DC\u17E0-\u17E9\u1810-\u1819\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1923-\u1926\u1929-\u192B\u1930\u1931\u1933-\u1938\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A16\u1A19\u1A1A\u1A1E-\u1A55\u1A57\u1A61\u1A63\u1A64\u1A6D-\u1A72\u1A80-\u1A89\u1A90-\u1A99\u1AA0-\u1AAD\u1B04-\u1B33\u1B35\u1B3B\u1B3D-\u1B41\u1B43-\u1B4C\u1B50-\u1B6A\u1B74-\u1B7E\u1B82-\u1BA1\u1BA6\u1BA7\u1BAA\u1BAE-\u1BE5\u1BE7\u1BEA-\u1BEC\u1BEE\u1BF2\u1BF3\u1BFC-\u1C2B\u1C34\u1C35\u1C3B-\u1C49\u1C4D-\u1C88\u1C90-\u1CBA\u1CBD-\u1CC7\u1CD3\u1CE1\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5-\u1CF7\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u200E\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u214F\u2160-\u2188\u2336-\u237A\u2395\u249C-\u24E9\u26AC\u2800-\u28FF\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D70\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u302E\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u3190-\u31BF\u31F0-\u321C\u3220-\u324F\u3260-\u327B\u327F-\u32B0\u32C0-\u32CB\u32D0-\u3376\u337B-\u33DD\u33E0-\u33FE\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA60C\uA610-\uA62B\uA640-\uA66E\uA680-\uA69D\uA6A0-\uA6EF\uA6F2-\uA6F7\uA722-\uA787\uA789-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA824\uA827\uA830-\uA837\uA840-\uA873\uA880-\uA8C3\uA8CE-\uA8D9\uA8F2-\uA8FE\uA900-\uA925\uA92E-\uA946\uA952\uA953\uA95F-\uA97C\uA983-\uA9B2\uA9B4\uA9B5\uA9BA\uA9BB\uA9BE-\uA9CD\uA9CF-\uA9D9\uA9DE-\uA9E4\uA9E6-\uA9FE\uAA00-\uAA28\uAA2F\uAA30\uAA33\uAA34\uAA40-\uAA42\uAA44-\uAA4B\uAA4D\uAA50-\uAA59\uAA5C-\uAA7B\uAA7D-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAAEB\uAAEE-\uAAF5\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB69\uAB70-\uABE4\uABE6\uABE7\uABE9-\uABEC\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uD800-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC\u{10000}-\u{1000B}\u{1000D}-\u{10026}\u{10028}-\u{1003A}\u{1003C}\u{1003D}\u{1003F}-\u{1004D}\u{10050}-\u{1005D}\u{10080}-\u{100FA}\u{10100}\u{10102}\u{10107}-\u{10133}\u{10137}-\u{1013F}\u{1018D}\u{1018E}\u{101D0}-\u{101FC}\u{10280}-\u{1029C}\u{102A0}-\u{102D0}\u{10300}-\u{10323}\u{1032D}-\u{1034A}\u{10350}-\u{10375}\u{10380}-\u{1039D}\u{1039F}-\u{103C3}\u{103C8}-\u{103D5}\u{10400}-\u{1049D}\u{104A0}-\u{104A9}\u{104B0}-\u{104D3}\u{104D8}-\u{104FB}\u{10500}-\u{10527}\u{10530}-\u{10563}\u{1056F}-\u{1057A}\u{1057C}-\u{1058A}\u{1058C}-\u{10592}\u{10594}\u{10595}\u{10597}-\u{105A1}\u{105A3}-\u{105B1}\u{105B3}-\u{105B9}\u{105BB}\u{105BC}\u{10600}-\u{10736}\u{10740}-\u{10755}\u{10760}-\u{10767}\u{10780}-\u{10785}\u{10787}-\u{107B0}\u{107B2}-\u{107BA}\u{11000}\u{11002}-\u{11037}\u{11047}-\u{1104D}\u{11066}-\u{1106F}\u{11071}\u{11072}\u{11075}\u{11082}-\u{110B2}\u{110B7}\u{110B8}\u{110BB}-\u{110C1}\u{110CD}\u{110D0}-\u{110E8}\u{110F0}-\u{110F9}\u{11103}-\u{11126}\u{1112C}\u{11136}-\u{11147}\u{11150}-\u{11172}\u{11174}-\u{11176}\u{11182}-\u{111B5}\u{111BF}-\u{111C8}\u{111CD}\u{111CE}\u{111D0}-\u{111DF}\u{111E1}-\u{111F4}\u{11200}-\u{11211}\u{11213}-\u{1122E}\u{11232}\u{11233}\u{11235}\u{11238}-\u{1123D}\u{11280}-\u{11286}\u{11288}\u{1128A}-\u{1128D}\u{1128F}-\u{1129D}\u{1129F}-\u{112A9}\u{112B0}-\u{112DE}\u{112E0}-\u{112E2}\u{112F0}-\u{112F9}\u{11302}\u{11303}\u{11305}-\u{1130C}\u{1130F}\u{11310}\u{11313}-\u{11328}\u{1132A}-\u{11330}\u{11332}\u{11333}\u{11335}-\u{11339}\u{1133D}-\u{1133F}\u{11341}-\u{11344}\u{11347}\u{11348}\u{1134B}-\u{1134D}\u{11350}\u{11357}\u{1135D}-\u{11363}\u{11400}-\u{11437}\u{11440}\u{11441}\u{11445}\u{11447}-\u{1145B}\u{1145D}\u{1145F}-\u{11461}\u{11480}-\u{114B2}\u{114B9}\u{114BB}-\u{114BE}\u{114C1}\u{114C4}-\u{114C7}\u{114D0}-\u{114D9}\u{11580}-\u{115B1}\u{115B8}-\u{115BB}\u{115BE}\u{115C1}-\u{115DB}\u{11600}-\u{11632}\u{1163B}\u{1163C}\u{1163E}\u{11641}-\u{11644}\u{11650}-\u{11659}\u{11680}-\u{116AA}\u{116AC}\u{116AE}\u{116AF}\u{116B6}\u{116B8}\u{116B9}\u{116C0}-\u{116C9}\u{11700}-\u{1171A}\u{11720}\u{11721}\u{11726}\u{11730}-\u{11746}\u{11800}-\u{1182E}\u{11838}\u{1183B}\u{118A0}-\u{118F2}\u{118FF}-\u{11906}\u{11909}\u{1190C}-\u{11913}\u{11915}\u{11916}\u{11918}-\u{11935}\u{11937}\u{11938}\u{1193D}\u{1193F}-\u{11942}\u{11944}-\u{11946}\u{11950}-\u{11959}\u{119A0}-\u{119A7}\u{119AA}-\u{119D3}\u{119DC}-\u{119DF}\u{119E1}-\u{119E4}\u{11A00}\u{11A07}\u{11A08}\u{11A0B}-\u{11A32}\u{11A39}\u{11A3A}\u{11A3F}-\u{11A46}\u{11A50}\u{11A57}\u{11A58}\u{11A5C}-\u{11A89}\u{11A97}\u{11A9A}-\u{11AA2}\u{11AB0}-\u{11AF8}\u{11C00}-\u{11C08}\u{11C0A}-\u{11C2F}\u{11C3E}-\u{11C45}\u{11C50}-\u{11C6C}\u{11C70}-\u{11C8F}\u{11CA9}\u{11CB1}\u{11CB4}\u{11D00}-\u{11D06}\u{11D08}\u{11D09}\u{11D0B}-\u{11D30}\u{11D46}\u{11D50}-\u{11D59}\u{11D60}-\u{11D65}\u{11D67}\u{11D68}\u{11D6A}-\u{11D8E}\u{11D93}\u{11D94}\u{11D96}\u{11D98}\u{11DA0}-\u{11DA9}\u{11EE0}-\u{11EF2}\u{11EF5}-\u{11EF8}\u{11FB0}\u{11FC0}-\u{11FD4}\u{11FFF}-\u{12399}\u{12400}-\u{1246E}\u{12470}-\u{12474}\u{12480}-\u{12543}\u{12F90}-\u{12FF2}\u{13000}-\u{1342E}\u{13430}-\u{13438}\u{14400}-\u{14646}\u{16800}-\u{16A38}\u{16A40}-\u{16A5E}\u{16A60}-\u{16A69}\u{16A6E}-\u{16ABE}\u{16AC0}-\u{16AC9}\u{16AD0}-\u{16AED}\u{16AF5}\u{16B00}-\u{16B2F}\u{16B37}-\u{16B45}\u{16B50}-\u{16B59}\u{16B5B}-\u{16B61}\u{16B63}-\u{16B77}\u{16B7D}-\u{16B8F}\u{16E40}-\u{16E9A}\u{16F00}-\u{16F4A}\u{16F50}-\u{16F87}\u{16F93}-\u{16F9F}\u{16FE0}\u{16FE1}\u{16FE3}\u{16FF0}\u{16FF1}\u{17000}-\u{187F7}\u{18800}-\u{18CD5}\u{18D00}-\u{18D08}\u{1AFF0}-\u{1AFF3}\u{1AFF5}-\u{1AFFB}\u{1AFFD}\u{1AFFE}\u{1B000}-\u{1B122}\u{1B150}-\u{1B152}\u{1B164}-\u{1B167}\u{1B170}-\u{1B2FB}\u{1BC00}-\u{1BC6A}\u{1BC70}-\u{1BC7C}\u{1BC80}-\u{1BC88}\u{1BC90}-\u{1BC99}\u{1BC9C}\u{1BC9F}\u{1CF50}-\u{1CFC3}\u{1D000}-\u{1D0F5}\u{1D100}-\u{1D126}\u{1D129}-\u{1D166}\u{1D16A}-\u{1D172}\u{1D183}\u{1D184}\u{1D18C}-\u{1D1A9}\u{1D1AE}-\u{1D1E8}\u{1D2E0}-\u{1D2F3}\u{1D360}-\u{1D378}\u{1D400}-\u{1D454}\u{1D456}-\u{1D49C}\u{1D49E}\u{1D49F}\u{1D4A2}\u{1D4A5}\u{1D4A6}\u{1D4A9}-\u{1D4AC}\u{1D4AE}-\u{1D4B9}\u{1D4BB}\u{1D4BD}-\u{1D4C3}\u{1D4C5}-\u{1D505}\u{1D507}-\u{1D50A}\u{1D50D}-\u{1D514}\u{1D516}-\u{1D51C}\u{1D51E}-\u{1D539}\u{1D53B}-\u{1D53E}\u{1D540}-\u{1D544}\u{1D546}\u{1D54A}-\u{1D550}\u{1D552}-\u{1D6A5}\u{1D6A8}-\u{1D6DA}\u{1D6DC}-\u{1D714}\u{1D716}-\u{1D74E}\u{1D750}-\u{1D788}\u{1D78A}-\u{1D7C2}\u{1D7C4}-\u{1D7CB}\u{1D800}-\u{1D9FF}\u{1DA37}-\u{1DA3A}\u{1DA6D}-\u{1DA74}\u{1DA76}-\u{1DA83}\u{1DA85}-\u{1DA8B}\u{1DF00}-\u{1DF1E}\u{1E100}-\u{1E12C}\u{1E137}-\u{1E13D}\u{1E140}-\u{1E149}\u{1E14E}\u{1E14F}\u{1E290}-\u{1E2AD}\u{1E2C0}-\u{1E2EB}\u{1E2F0}-\u{1E2F9}\u{1E7E0}-\u{1E7E6}\u{1E7E8}-\u{1E7EB}\u{1E7ED}\u{1E7EE}\u{1E7F0}-\u{1E7FE}\u{1F110}-\u{1F12E}\u{1F130}-\u{1F169}\u{1F170}-\u{1F1AC}\u{1F1E6}-\u{1F202}\u{1F210}-\u{1F23B}\u{1F240}-\u{1F248}\u{1F250}\u{1F251}\u{20000}-\u{2A6DF}\u{2A700}-\u{2B738}\u{2B740}-\u{2B81D}\u{2B820}-\u{2CEA1}\u{2CEB0}-\u{2EBE0}\u{2F800}-\u{2FA1D}\u{30000}-\u{3134A}\u{F0000}-\u{FFFFD}\u{100000}-\u{10FFFD}]/u; +const bidiS1RTL = /[\u05BE\u05C0\u05C3\u05C6\u05D0-\u05EA\u05EF-\u05F4\u0608\u060B\u060D\u061B-\u064A\u066D-\u066F\u0671-\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u070D\u070F\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07C0-\u07EA\u07F4\u07F5\u07FA\u07FE-\u0815\u081A\u0824\u0828\u0830-\u083E\u0840-\u0858\u085E\u0860-\u086A\u0870-\u088E\u08A0-\u08C9\u200F\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBC2\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFC\uFE70-\uFE74\uFE76-\uFEFC\u{10800}-\u{10805}\u{10808}\u{1080A}-\u{10835}\u{10837}\u{10838}\u{1083C}\u{1083F}-\u{10855}\u{10857}-\u{1089E}\u{108A7}-\u{108AF}\u{108E0}-\u{108F2}\u{108F4}\u{108F5}\u{108FB}-\u{1091B}\u{10920}-\u{10939}\u{1093F}\u{10980}-\u{109B7}\u{109BC}-\u{109CF}\u{109D2}-\u{10A00}\u{10A10}-\u{10A13}\u{10A15}-\u{10A17}\u{10A19}-\u{10A35}\u{10A40}-\u{10A48}\u{10A50}-\u{10A58}\u{10A60}-\u{10A9F}\u{10AC0}-\u{10AE4}\u{10AEB}-\u{10AF6}\u{10B00}-\u{10B35}\u{10B40}-\u{10B55}\u{10B58}-\u{10B72}\u{10B78}-\u{10B91}\u{10B99}-\u{10B9C}\u{10BA9}-\u{10BAF}\u{10C00}-\u{10C48}\u{10C80}-\u{10CB2}\u{10CC0}-\u{10CF2}\u{10CFA}-\u{10D23}\u{10E80}-\u{10EA9}\u{10EAD}\u{10EB0}\u{10EB1}\u{10F00}-\u{10F27}\u{10F30}-\u{10F45}\u{10F51}-\u{10F59}\u{10F70}-\u{10F81}\u{10F86}-\u{10F89}\u{10FB0}-\u{10FCB}\u{10FE0}-\u{10FF6}\u{1E800}-\u{1E8C4}\u{1E8C7}-\u{1E8CF}\u{1E900}-\u{1E943}\u{1E94B}\u{1E950}-\u{1E959}\u{1E95E}\u{1E95F}\u{1EC71}-\u{1ECB4}\u{1ED01}-\u{1ED3D}\u{1EE00}-\u{1EE03}\u{1EE05}-\u{1EE1F}\u{1EE21}\u{1EE22}\u{1EE24}\u{1EE27}\u{1EE29}-\u{1EE32}\u{1EE34}-\u{1EE37}\u{1EE39}\u{1EE3B}\u{1EE42}\u{1EE47}\u{1EE49}\u{1EE4B}\u{1EE4D}-\u{1EE4F}\u{1EE51}\u{1EE52}\u{1EE54}\u{1EE57}\u{1EE59}\u{1EE5B}\u{1EE5D}\u{1EE5F}\u{1EE61}\u{1EE62}\u{1EE64}\u{1EE67}-\u{1EE6A}\u{1EE6C}-\u{1EE72}\u{1EE74}-\u{1EE77}\u{1EE79}-\u{1EE7C}\u{1EE7E}\u{1EE80}-\u{1EE89}\u{1EE8B}-\u{1EE9B}\u{1EEA1}-\u{1EEA3}\u{1EEA5}-\u{1EEA9}\u{1EEAB}-\u{1EEBB}]/u; +const bidiS2 = /^[\0-\x08\x0E-\x1B!-@\[-`\{-\x84\x86-\xA9\xAB-\xB4\xB6-\xB9\xBB-\xBF\xD7\xF7\u02B9\u02BA\u02C2-\u02CF\u02D2-\u02DF\u02E5-\u02ED\u02EF-\u036F\u0374\u0375\u037E\u0384\u0385\u0387\u03F6\u0483-\u0489\u058A\u058D-\u058F\u0591-\u05C7\u05D0-\u05EA\u05EF-\u05F4\u0600-\u070D\u070F-\u074A\u074D-\u07B1\u07C0-\u07FA\u07FD-\u082D\u0830-\u083E\u0840-\u085B\u085E\u0860-\u086A\u0870-\u088E\u0890\u0891\u0898-\u0902\u093A\u093C\u0941-\u0948\u094D\u0951-\u0957\u0962\u0963\u0981\u09BC\u09C1-\u09C4\u09CD\u09E2\u09E3\u09F2\u09F3\u09FB\u09FE\u0A01\u0A02\u0A3C\u0A41\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81\u0A82\u0ABC\u0AC1-\u0AC5\u0AC7\u0AC8\u0ACD\u0AE2\u0AE3\u0AF1\u0AFA-\u0AFF\u0B01\u0B3C\u0B3F\u0B41-\u0B44\u0B4D\u0B55\u0B56\u0B62\u0B63\u0B82\u0BC0\u0BCD\u0BF3-\u0BFA\u0C00\u0C04\u0C3C\u0C3E-\u0C40\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C78-\u0C7E\u0C81\u0CBC\u0CCC\u0CCD\u0CE2\u0CE3\u0D00\u0D01\u0D3B\u0D3C\u0D41-\u0D44\u0D4D\u0D62\u0D63\u0D81\u0DCA\u0DD2-\u0DD4\u0DD6\u0E31\u0E34-\u0E3A\u0E3F\u0E47-\u0E4E\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39-\u0F3D\u0F71-\u0F7E\u0F80-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102D-\u1030\u1032-\u1037\u1039\u103A\u103D\u103E\u1058\u1059\u105E-\u1060\u1071-\u1074\u1082\u1085\u1086\u108D\u109D\u135D-\u135F\u1390-\u1399\u1400\u169B\u169C\u1712-\u1714\u1732\u1733\u1752\u1753\u1772\u1773\u17B4\u17B5\u17B7-\u17BD\u17C6\u17C9-\u17D3\u17DB\u17DD\u17F0-\u17F9\u1800-\u180F\u1885\u1886\u18A9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193B\u1940\u1944\u1945\u19DE-\u19FF\u1A17\u1A18\u1A1B\u1A56\u1A58-\u1A5E\u1A60\u1A62\u1A65-\u1A6C\u1A73-\u1A7C\u1A7F\u1AB0-\u1ACE\u1B00-\u1B03\u1B34\u1B36-\u1B3A\u1B3C\u1B42\u1B6B-\u1B73\u1B80\u1B81\u1BA2-\u1BA5\u1BA8\u1BA9\u1BAB-\u1BAD\u1BE6\u1BE8\u1BE9\u1BED\u1BEF-\u1BF1\u1C2C-\u1C33\u1C36\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE0\u1CE2-\u1CE8\u1CED\u1CF4\u1CF8\u1CF9\u1DC0-\u1DFF\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u200B-\u200D\u200F-\u2027\u202F-\u205E\u2060-\u2064\u206A-\u2070\u2074-\u207E\u2080-\u208E\u20A0-\u20C0\u20D0-\u20F0\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u2150-\u215F\u2189-\u218B\u2190-\u2335\u237B-\u2394\u2396-\u2426\u2440-\u244A\u2460-\u249B\u24EA-\u26AB\u26AD-\u27FF\u2900-\u2B73\u2B76-\u2B95\u2B97-\u2BFF\u2CE5-\u2CEA\u2CEF-\u2CF1\u2CF9-\u2CFF\u2D7F\u2DE0-\u2E5D\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFB\u3001-\u3004\u3008-\u3020\u302A-\u302D\u3030\u3036\u3037\u303D-\u303F\u3099-\u309C\u30A0\u30FB\u31C0-\u31E3\u321D\u321E\u3250-\u325F\u327C-\u327E\u32B1-\u32BF\u32CC-\u32CF\u3377-\u337A\u33DE\u33DF\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA60D-\uA60F\uA66F-\uA67F\uA69E\uA69F\uA6F0\uA6F1\uA700-\uA721\uA788\uA802\uA806\uA80B\uA825\uA826\uA828-\uA82C\uA838\uA839\uA874-\uA877\uA8C4\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA951\uA980-\uA982\uA9B3\uA9B6-\uA9B9\uA9BC\uA9BD\uA9E5\uAA29-\uAA2E\uAA31\uAA32\uAA35\uAA36\uAA43\uAA4C\uAA7C\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEC\uAAED\uAAF6\uAB6A\uAB6B\uABE5\uABE8\uABED\uFB1D-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBC2\uFBD3-\uFD8F\uFD92-\uFDC7\uFDCF\uFDF0-\uFE19\uFE20-\uFE52\uFE54-\uFE66\uFE68-\uFE6B\uFE70-\uFE74\uFE76-\uFEFC\uFEFF\uFF01-\uFF20\uFF3B-\uFF40\uFF5B-\uFF65\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFF9-\uFFFD\u{10101}\u{10140}-\u{1018C}\u{10190}-\u{1019C}\u{101A0}\u{101FD}\u{102E0}-\u{102FB}\u{10376}-\u{1037A}\u{10800}-\u{10805}\u{10808}\u{1080A}-\u{10835}\u{10837}\u{10838}\u{1083C}\u{1083F}-\u{10855}\u{10857}-\u{1089E}\u{108A7}-\u{108AF}\u{108E0}-\u{108F2}\u{108F4}\u{108F5}\u{108FB}-\u{1091B}\u{1091F}-\u{10939}\u{1093F}\u{10980}-\u{109B7}\u{109BC}-\u{109CF}\u{109D2}-\u{10A03}\u{10A05}\u{10A06}\u{10A0C}-\u{10A13}\u{10A15}-\u{10A17}\u{10A19}-\u{10A35}\u{10A38}-\u{10A3A}\u{10A3F}-\u{10A48}\u{10A50}-\u{10A58}\u{10A60}-\u{10A9F}\u{10AC0}-\u{10AE6}\u{10AEB}-\u{10AF6}\u{10B00}-\u{10B35}\u{10B39}-\u{10B55}\u{10B58}-\u{10B72}\u{10B78}-\u{10B91}\u{10B99}-\u{10B9C}\u{10BA9}-\u{10BAF}\u{10C00}-\u{10C48}\u{10C80}-\u{10CB2}\u{10CC0}-\u{10CF2}\u{10CFA}-\u{10D27}\u{10D30}-\u{10D39}\u{10E60}-\u{10E7E}\u{10E80}-\u{10EA9}\u{10EAB}-\u{10EAD}\u{10EB0}\u{10EB1}\u{10F00}-\u{10F27}\u{10F30}-\u{10F59}\u{10F70}-\u{10F89}\u{10FB0}-\u{10FCB}\u{10FE0}-\u{10FF6}\u{11001}\u{11038}-\u{11046}\u{11052}-\u{11065}\u{11070}\u{11073}\u{11074}\u{1107F}-\u{11081}\u{110B3}-\u{110B6}\u{110B9}\u{110BA}\u{110C2}\u{11100}-\u{11102}\u{11127}-\u{1112B}\u{1112D}-\u{11134}\u{11173}\u{11180}\u{11181}\u{111B6}-\u{111BE}\u{111C9}-\u{111CC}\u{111CF}\u{1122F}-\u{11231}\u{11234}\u{11236}\u{11237}\u{1123E}\u{112DF}\u{112E3}-\u{112EA}\u{11300}\u{11301}\u{1133B}\u{1133C}\u{11340}\u{11366}-\u{1136C}\u{11370}-\u{11374}\u{11438}-\u{1143F}\u{11442}-\u{11444}\u{11446}\u{1145E}\u{114B3}-\u{114B8}\u{114BA}\u{114BF}\u{114C0}\u{114C2}\u{114C3}\u{115B2}-\u{115B5}\u{115BC}\u{115BD}\u{115BF}\u{115C0}\u{115DC}\u{115DD}\u{11633}-\u{1163A}\u{1163D}\u{1163F}\u{11640}\u{11660}-\u{1166C}\u{116AB}\u{116AD}\u{116B0}-\u{116B5}\u{116B7}\u{1171D}-\u{1171F}\u{11722}-\u{11725}\u{11727}-\u{1172B}\u{1182F}-\u{11837}\u{11839}\u{1183A}\u{1193B}\u{1193C}\u{1193E}\u{11943}\u{119D4}-\u{119D7}\u{119DA}\u{119DB}\u{119E0}\u{11A01}-\u{11A06}\u{11A09}\u{11A0A}\u{11A33}-\u{11A38}\u{11A3B}-\u{11A3E}\u{11A47}\u{11A51}-\u{11A56}\u{11A59}-\u{11A5B}\u{11A8A}-\u{11A96}\u{11A98}\u{11A99}\u{11C30}-\u{11C36}\u{11C38}-\u{11C3D}\u{11C92}-\u{11CA7}\u{11CAA}-\u{11CB0}\u{11CB2}\u{11CB3}\u{11CB5}\u{11CB6}\u{11D31}-\u{11D36}\u{11D3A}\u{11D3C}\u{11D3D}\u{11D3F}-\u{11D45}\u{11D47}\u{11D90}\u{11D91}\u{11D95}\u{11D97}\u{11EF3}\u{11EF4}\u{11FD5}-\u{11FF1}\u{16AF0}-\u{16AF4}\u{16B30}-\u{16B36}\u{16F4F}\u{16F8F}-\u{16F92}\u{16FE2}\u{16FE4}\u{1BC9D}\u{1BC9E}\u{1BCA0}-\u{1BCA3}\u{1CF00}-\u{1CF2D}\u{1CF30}-\u{1CF46}\u{1D167}-\u{1D169}\u{1D173}-\u{1D182}\u{1D185}-\u{1D18B}\u{1D1AA}-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F10F}\u{1F12F}\u{1F16A}-\u{1F16F}\u{1F1AD}\u{1F260}-\u{1F265}\u{1F300}-\u{1F6D7}\u{1F6DD}-\u{1F6EC}\u{1F6F0}-\u{1F6FC}\u{1F700}-\u{1F773}\u{1F780}-\u{1F7D8}\u{1F7E0}-\u{1F7EB}\u{1F7F0}\u{1F800}-\u{1F80B}\u{1F810}-\u{1F847}\u{1F850}-\u{1F859}\u{1F860}-\u{1F887}\u{1F890}-\u{1F8AD}\u{1F8B0}\u{1F8B1}\u{1F900}-\u{1FA53}\u{1FA60}-\u{1FA6D}\u{1FA70}-\u{1FA74}\u{1FA78}-\u{1FA7C}\u{1FA80}-\u{1FA86}\u{1FA90}-\u{1FAAC}\u{1FAB0}-\u{1FABA}\u{1FAC0}-\u{1FAC5}\u{1FAD0}-\u{1FAD9}\u{1FAE0}-\u{1FAE7}\u{1FAF0}-\u{1FAF6}\u{1FB00}-\u{1FB92}\u{1FB94}-\u{1FBCA}\u{1FBF0}-\u{1FBF9}\u{E0001}\u{E0020}-\u{E007F}\u{E0100}-\u{E01EF}]*$/u; +const bidiS3 = /[0-9\xB2\xB3\xB9\u05BE\u05C0\u05C3\u05C6\u05D0-\u05EA\u05EF-\u05F4\u0600-\u0605\u0608\u060B\u060D\u061B-\u064A\u0660-\u0669\u066B-\u066F\u0671-\u06D5\u06DD\u06E5\u06E6\u06EE-\u070D\u070F\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07C0-\u07EA\u07F4\u07F5\u07FA\u07FE-\u0815\u081A\u0824\u0828\u0830-\u083E\u0840-\u0858\u085E\u0860-\u086A\u0870-\u088E\u0890\u0891\u08A0-\u08C9\u08E2\u200F\u2070\u2074-\u2079\u2080-\u2089\u2488-\u249B\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBC2\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFC\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\u{102E1}-\u{102FB}\u{10800}-\u{10805}\u{10808}\u{1080A}-\u{10835}\u{10837}\u{10838}\u{1083C}\u{1083F}-\u{10855}\u{10857}-\u{1089E}\u{108A7}-\u{108AF}\u{108E0}-\u{108F2}\u{108F4}\u{108F5}\u{108FB}-\u{1091B}\u{10920}-\u{10939}\u{1093F}\u{10980}-\u{109B7}\u{109BC}-\u{109CF}\u{109D2}-\u{10A00}\u{10A10}-\u{10A13}\u{10A15}-\u{10A17}\u{10A19}-\u{10A35}\u{10A40}-\u{10A48}\u{10A50}-\u{10A58}\u{10A60}-\u{10A9F}\u{10AC0}-\u{10AE4}\u{10AEB}-\u{10AF6}\u{10B00}-\u{10B35}\u{10B40}-\u{10B55}\u{10B58}-\u{10B72}\u{10B78}-\u{10B91}\u{10B99}-\u{10B9C}\u{10BA9}-\u{10BAF}\u{10C00}-\u{10C48}\u{10C80}-\u{10CB2}\u{10CC0}-\u{10CF2}\u{10CFA}-\u{10D23}\u{10D30}-\u{10D39}\u{10E60}-\u{10E7E}\u{10E80}-\u{10EA9}\u{10EAD}\u{10EB0}\u{10EB1}\u{10F00}-\u{10F27}\u{10F30}-\u{10F45}\u{10F51}-\u{10F59}\u{10F70}-\u{10F81}\u{10F86}-\u{10F89}\u{10FB0}-\u{10FCB}\u{10FE0}-\u{10FF6}\u{1D7CE}-\u{1D7FF}\u{1E800}-\u{1E8C4}\u{1E8C7}-\u{1E8CF}\u{1E900}-\u{1E943}\u{1E94B}\u{1E950}-\u{1E959}\u{1E95E}\u{1E95F}\u{1EC71}-\u{1ECB4}\u{1ED01}-\u{1ED3D}\u{1EE00}-\u{1EE03}\u{1EE05}-\u{1EE1F}\u{1EE21}\u{1EE22}\u{1EE24}\u{1EE27}\u{1EE29}-\u{1EE32}\u{1EE34}-\u{1EE37}\u{1EE39}\u{1EE3B}\u{1EE42}\u{1EE47}\u{1EE49}\u{1EE4B}\u{1EE4D}-\u{1EE4F}\u{1EE51}\u{1EE52}\u{1EE54}\u{1EE57}\u{1EE59}\u{1EE5B}\u{1EE5D}\u{1EE5F}\u{1EE61}\u{1EE62}\u{1EE64}\u{1EE67}-\u{1EE6A}\u{1EE6C}-\u{1EE72}\u{1EE74}-\u{1EE77}\u{1EE79}-\u{1EE7C}\u{1EE7E}\u{1EE80}-\u{1EE89}\u{1EE8B}-\u{1EE9B}\u{1EEA1}-\u{1EEA3}\u{1EEA5}-\u{1EEA9}\u{1EEAB}-\u{1EEBB}\u{1F100}-\u{1F10A}\u{1FBF0}-\u{1FBF9}][\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0898-\u089F\u08CA-\u08E1\u08E3-\u0902\u093A\u093C\u0941-\u0948\u094D\u0951-\u0957\u0962\u0963\u0981\u09BC\u09C1-\u09C4\u09CD\u09E2\u09E3\u09FE\u0A01\u0A02\u0A3C\u0A41\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81\u0A82\u0ABC\u0AC1-\u0AC5\u0AC7\u0AC8\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01\u0B3C\u0B3F\u0B41-\u0B44\u0B4D\u0B55\u0B56\u0B62\u0B63\u0B82\u0BC0\u0BCD\u0C00\u0C04\u0C3C\u0C3E-\u0C40\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81\u0CBC\u0CCC\u0CCD\u0CE2\u0CE3\u0D00\u0D01\u0D3B\u0D3C\u0D41-\u0D44\u0D4D\u0D62\u0D63\u0D81\u0DCA\u0DD2-\u0DD4\u0DD6\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F71-\u0F7E\u0F80-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102D-\u1030\u1032-\u1037\u1039\u103A\u103D\u103E\u1058\u1059\u105E-\u1060\u1071-\u1074\u1082\u1085\u1086\u108D\u109D\u135D-\u135F\u1712-\u1714\u1732\u1733\u1752\u1753\u1772\u1773\u17B4\u17B5\u17B7-\u17BD\u17C6\u17C9-\u17D3\u17DD\u180B-\u180D\u180F\u1885\u1886\u18A9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193B\u1A17\u1A18\u1A1B\u1A56\u1A58-\u1A5E\u1A60\u1A62\u1A65-\u1A6C\u1A73-\u1A7C\u1A7F\u1AB0-\u1ACE\u1B00-\u1B03\u1B34\u1B36-\u1B3A\u1B3C\u1B42\u1B6B-\u1B73\u1B80\u1B81\u1BA2-\u1BA5\u1BA8\u1BA9\u1BAB-\u1BAD\u1BE6\u1BE8\u1BE9\u1BED\u1BEF-\u1BF1\u1C2C-\u1C33\u1C36\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE0\u1CE2-\u1CE8\u1CED\u1CF4\u1CF8\u1CF9\u1DC0-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302D\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA825\uA826\uA82C\uA8C4\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA951\uA980-\uA982\uA9B3\uA9B6-\uA9B9\uA9BC\uA9BD\uA9E5\uAA29-\uAA2E\uAA31\uAA32\uAA35\uAA36\uAA43\uAA4C\uAA7C\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEC\uAAED\uAAF6\uABE5\uABE8\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\u{101FD}\u{102E0}\u{10376}-\u{1037A}\u{10A01}-\u{10A03}\u{10A05}\u{10A06}\u{10A0C}-\u{10A0F}\u{10A38}-\u{10A3A}\u{10A3F}\u{10AE5}\u{10AE6}\u{10D24}-\u{10D27}\u{10EAB}\u{10EAC}\u{10F46}-\u{10F50}\u{10F82}-\u{10F85}\u{11001}\u{11038}-\u{11046}\u{11070}\u{11073}\u{11074}\u{1107F}-\u{11081}\u{110B3}-\u{110B6}\u{110B9}\u{110BA}\u{110C2}\u{11100}-\u{11102}\u{11127}-\u{1112B}\u{1112D}-\u{11134}\u{11173}\u{11180}\u{11181}\u{111B6}-\u{111BE}\u{111C9}-\u{111CC}\u{111CF}\u{1122F}-\u{11231}\u{11234}\u{11236}\u{11237}\u{1123E}\u{112DF}\u{112E3}-\u{112EA}\u{11300}\u{11301}\u{1133B}\u{1133C}\u{11340}\u{11366}-\u{1136C}\u{11370}-\u{11374}\u{11438}-\u{1143F}\u{11442}-\u{11444}\u{11446}\u{1145E}\u{114B3}-\u{114B8}\u{114BA}\u{114BF}\u{114C0}\u{114C2}\u{114C3}\u{115B2}-\u{115B5}\u{115BC}\u{115BD}\u{115BF}\u{115C0}\u{115DC}\u{115DD}\u{11633}-\u{1163A}\u{1163D}\u{1163F}\u{11640}\u{116AB}\u{116AD}\u{116B0}-\u{116B5}\u{116B7}\u{1171D}-\u{1171F}\u{11722}-\u{11725}\u{11727}-\u{1172B}\u{1182F}-\u{11837}\u{11839}\u{1183A}\u{1193B}\u{1193C}\u{1193E}\u{11943}\u{119D4}-\u{119D7}\u{119DA}\u{119DB}\u{119E0}\u{11A01}-\u{11A06}\u{11A09}\u{11A0A}\u{11A33}-\u{11A38}\u{11A3B}-\u{11A3E}\u{11A47}\u{11A51}-\u{11A56}\u{11A59}-\u{11A5B}\u{11A8A}-\u{11A96}\u{11A98}\u{11A99}\u{11C30}-\u{11C36}\u{11C38}-\u{11C3D}\u{11C92}-\u{11CA7}\u{11CAA}-\u{11CB0}\u{11CB2}\u{11CB3}\u{11CB5}\u{11CB6}\u{11D31}-\u{11D36}\u{11D3A}\u{11D3C}\u{11D3D}\u{11D3F}-\u{11D45}\u{11D47}\u{11D90}\u{11D91}\u{11D95}\u{11D97}\u{11EF3}\u{11EF4}\u{16AF0}-\u{16AF4}\u{16B30}-\u{16B36}\u{16F4F}\u{16F8F}-\u{16F92}\u{16FE4}\u{1BC9D}\u{1BC9E}\u{1CF00}-\u{1CF2D}\u{1CF30}-\u{1CF46}\u{1D167}-\u{1D169}\u{1D17B}-\u{1D182}\u{1D185}-\u{1D18B}\u{1D1AA}-\u{1D1AD}\u{1D242}-\u{1D244}\u{1DA00}-\u{1DA36}\u{1DA3B}-\u{1DA6C}\u{1DA75}\u{1DA84}\u{1DA9B}-\u{1DA9F}\u{1DAA1}-\u{1DAAF}\u{1E000}-\u{1E006}\u{1E008}-\u{1E018}\u{1E01B}-\u{1E021}\u{1E023}\u{1E024}\u{1E026}-\u{1E02A}\u{1E130}-\u{1E136}\u{1E2AE}\u{1E2EC}-\u{1E2EF}\u{1E8D0}-\u{1E8D6}\u{1E944}-\u{1E94A}\u{E0100}-\u{E01EF}]*$/u; +const bidiS4EN = /[0-9\xB2\xB3\xB9\u06F0-\u06F9\u2070\u2074-\u2079\u2080-\u2089\u2488-\u249B\uFF10-\uFF19\u{102E1}-\u{102FB}\u{1D7CE}-\u{1D7FF}\u{1F100}-\u{1F10A}\u{1FBF0}-\u{1FBF9}]/u; +const bidiS4AN = /[\u0600-\u0605\u0660-\u0669\u066B\u066C\u06DD\u0890\u0891\u08E2\u{10D30}-\u{10D39}\u{10E60}-\u{10E7E}]/u; +const bidiS5 = /^[\0-\x08\x0E-\x1B!-\x84\x86-\u0377\u037A-\u037F\u0384-\u038A\u038C\u038E-\u03A1\u03A3-\u052F\u0531-\u0556\u0559-\u058A\u058D-\u058F\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0606\u0607\u0609\u060A\u060C\u060E-\u061A\u064B-\u065F\u066A\u0670\u06D6-\u06DC\u06DE-\u06E4\u06E7-\u06ED\u06F0-\u06F9\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07F6-\u07F9\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0898-\u089F\u08CA-\u08E1\u08E3-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09FE\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A76\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AF1\u0AF9-\u0AFF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B77\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BFA\u0C00-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3C-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C5D\u0C60-\u0C63\u0C66-\u0C6F\u0C77-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDD\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D00-\u0D0C\u0D0E-\u0D10\u0D12-\u0D44\u0D46-\u0D48\u0D4A-\u0D4F\u0D54-\u0D63\u0D66-\u0D7F\u0D81-\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2-\u0DF4\u0E01-\u0E3A\u0E3F-\u0E5B\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00-\u0F47\u0F49-\u0F6C\u0F71-\u0F97\u0F99-\u0FBC\u0FBE-\u0FCC\u0FCE-\u0FDA\u1000-\u10C5\u10C7\u10CD\u10D0-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u137C\u1380-\u1399\u13A0-\u13F5\u13F8-\u13FD\u1400-\u167F\u1681-\u169C\u16A0-\u16F8\u1700-\u1715\u171F-\u1736\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17DD\u17E0-\u17E9\u17F0-\u17F9\u1800-\u1819\u1820-\u1878\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1940\u1944-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u19DE-\u1A1B\u1A1E-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA0-\u1AAD\u1AB0-\u1ACE\u1B00-\u1B4C\u1B50-\u1B7E\u1B80-\u1BF3\u1BFC-\u1C37\u1C3B-\u1C49\u1C4D-\u1C88\u1C90-\u1CBA\u1CBD-\u1CC7\u1CD0-\u1CFA\u1D00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FC4\u1FC6-\u1FD3\u1FD6-\u1FDB\u1FDD-\u1FEF\u1FF2-\u1FF4\u1FF6-\u1FFE\u200B-\u200E\u2010-\u2027\u202F-\u205E\u2060-\u2064\u206A-\u2071\u2074-\u208E\u2090-\u209C\u20A0-\u20C0\u20D0-\u20F0\u2100-\u218B\u2190-\u2426\u2440-\u244A\u2460-\u2B73\u2B76-\u2B95\u2B97-\u2CF3\u2CF9-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D70\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2E5D\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFB\u3001-\u303F\u3041-\u3096\u3099-\u30FF\u3105-\u312F\u3131-\u318E\u3190-\u31E3\u31F0-\u321E\u3220-\uA48C\uA490-\uA4C6\uA4D0-\uA62B\uA640-\uA6F7\uA700-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA82C\uA830-\uA839\uA840-\uA877\uA880-\uA8C5\uA8CE-\uA8D9\uA8E0-\uA953\uA95F-\uA97C\uA980-\uA9CD\uA9CF-\uA9D9\uA9DE-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA5C-\uAAC2\uAADB-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB6B\uAB70-\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uD800-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1E\uFB29\uFD3E-\uFD4F\uFDCF\uFDFD-\uFE19\uFE20-\uFE52\uFE54-\uFE66\uFE68-\uFE6B\uFEFF\uFF01-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFF9-\uFFFD\u{10000}-\u{1000B}\u{1000D}-\u{10026}\u{10028}-\u{1003A}\u{1003C}\u{1003D}\u{1003F}-\u{1004D}\u{10050}-\u{1005D}\u{10080}-\u{100FA}\u{10100}-\u{10102}\u{10107}-\u{10133}\u{10137}-\u{1018E}\u{10190}-\u{1019C}\u{101A0}\u{101D0}-\u{101FD}\u{10280}-\u{1029C}\u{102A0}-\u{102D0}\u{102E0}-\u{102FB}\u{10300}-\u{10323}\u{1032D}-\u{1034A}\u{10350}-\u{1037A}\u{10380}-\u{1039D}\u{1039F}-\u{103C3}\u{103C8}-\u{103D5}\u{10400}-\u{1049D}\u{104A0}-\u{104A9}\u{104B0}-\u{104D3}\u{104D8}-\u{104FB}\u{10500}-\u{10527}\u{10530}-\u{10563}\u{1056F}-\u{1057A}\u{1057C}-\u{1058A}\u{1058C}-\u{10592}\u{10594}\u{10595}\u{10597}-\u{105A1}\u{105A3}-\u{105B1}\u{105B3}-\u{105B9}\u{105BB}\u{105BC}\u{10600}-\u{10736}\u{10740}-\u{10755}\u{10760}-\u{10767}\u{10780}-\u{10785}\u{10787}-\u{107B0}\u{107B2}-\u{107BA}\u{1091F}\u{10A01}-\u{10A03}\u{10A05}\u{10A06}\u{10A0C}-\u{10A0F}\u{10A38}-\u{10A3A}\u{10A3F}\u{10AE5}\u{10AE6}\u{10B39}-\u{10B3F}\u{10D24}-\u{10D27}\u{10EAB}\u{10EAC}\u{10F46}-\u{10F50}\u{10F82}-\u{10F85}\u{11000}-\u{1104D}\u{11052}-\u{11075}\u{1107F}-\u{110C2}\u{110CD}\u{110D0}-\u{110E8}\u{110F0}-\u{110F9}\u{11100}-\u{11134}\u{11136}-\u{11147}\u{11150}-\u{11176}\u{11180}-\u{111DF}\u{111E1}-\u{111F4}\u{11200}-\u{11211}\u{11213}-\u{1123E}\u{11280}-\u{11286}\u{11288}\u{1128A}-\u{1128D}\u{1128F}-\u{1129D}\u{1129F}-\u{112A9}\u{112B0}-\u{112EA}\u{112F0}-\u{112F9}\u{11300}-\u{11303}\u{11305}-\u{1130C}\u{1130F}\u{11310}\u{11313}-\u{11328}\u{1132A}-\u{11330}\u{11332}\u{11333}\u{11335}-\u{11339}\u{1133B}-\u{11344}\u{11347}\u{11348}\u{1134B}-\u{1134D}\u{11350}\u{11357}\u{1135D}-\u{11363}\u{11366}-\u{1136C}\u{11370}-\u{11374}\u{11400}-\u{1145B}\u{1145D}-\u{11461}\u{11480}-\u{114C7}\u{114D0}-\u{114D9}\u{11580}-\u{115B5}\u{115B8}-\u{115DD}\u{11600}-\u{11644}\u{11650}-\u{11659}\u{11660}-\u{1166C}\u{11680}-\u{116B9}\u{116C0}-\u{116C9}\u{11700}-\u{1171A}\u{1171D}-\u{1172B}\u{11730}-\u{11746}\u{11800}-\u{1183B}\u{118A0}-\u{118F2}\u{118FF}-\u{11906}\u{11909}\u{1190C}-\u{11913}\u{11915}\u{11916}\u{11918}-\u{11935}\u{11937}\u{11938}\u{1193B}-\u{11946}\u{11950}-\u{11959}\u{119A0}-\u{119A7}\u{119AA}-\u{119D7}\u{119DA}-\u{119E4}\u{11A00}-\u{11A47}\u{11A50}-\u{11AA2}\u{11AB0}-\u{11AF8}\u{11C00}-\u{11C08}\u{11C0A}-\u{11C36}\u{11C38}-\u{11C45}\u{11C50}-\u{11C6C}\u{11C70}-\u{11C8F}\u{11C92}-\u{11CA7}\u{11CA9}-\u{11CB6}\u{11D00}-\u{11D06}\u{11D08}\u{11D09}\u{11D0B}-\u{11D36}\u{11D3A}\u{11D3C}\u{11D3D}\u{11D3F}-\u{11D47}\u{11D50}-\u{11D59}\u{11D60}-\u{11D65}\u{11D67}\u{11D68}\u{11D6A}-\u{11D8E}\u{11D90}\u{11D91}\u{11D93}-\u{11D98}\u{11DA0}-\u{11DA9}\u{11EE0}-\u{11EF8}\u{11FB0}\u{11FC0}-\u{11FF1}\u{11FFF}-\u{12399}\u{12400}-\u{1246E}\u{12470}-\u{12474}\u{12480}-\u{12543}\u{12F90}-\u{12FF2}\u{13000}-\u{1342E}\u{13430}-\u{13438}\u{14400}-\u{14646}\u{16800}-\u{16A38}\u{16A40}-\u{16A5E}\u{16A60}-\u{16A69}\u{16A6E}-\u{16ABE}\u{16AC0}-\u{16AC9}\u{16AD0}-\u{16AED}\u{16AF0}-\u{16AF5}\u{16B00}-\u{16B45}\u{16B50}-\u{16B59}\u{16B5B}-\u{16B61}\u{16B63}-\u{16B77}\u{16B7D}-\u{16B8F}\u{16E40}-\u{16E9A}\u{16F00}-\u{16F4A}\u{16F4F}-\u{16F87}\u{16F8F}-\u{16F9F}\u{16FE0}-\u{16FE4}\u{16FF0}\u{16FF1}\u{17000}-\u{187F7}\u{18800}-\u{18CD5}\u{18D00}-\u{18D08}\u{1AFF0}-\u{1AFF3}\u{1AFF5}-\u{1AFFB}\u{1AFFD}\u{1AFFE}\u{1B000}-\u{1B122}\u{1B150}-\u{1B152}\u{1B164}-\u{1B167}\u{1B170}-\u{1B2FB}\u{1BC00}-\u{1BC6A}\u{1BC70}-\u{1BC7C}\u{1BC80}-\u{1BC88}\u{1BC90}-\u{1BC99}\u{1BC9C}-\u{1BCA3}\u{1CF00}-\u{1CF2D}\u{1CF30}-\u{1CF46}\u{1CF50}-\u{1CFC3}\u{1D000}-\u{1D0F5}\u{1D100}-\u{1D126}\u{1D129}-\u{1D1EA}\u{1D200}-\u{1D245}\u{1D2E0}-\u{1D2F3}\u{1D300}-\u{1D356}\u{1D360}-\u{1D378}\u{1D400}-\u{1D454}\u{1D456}-\u{1D49C}\u{1D49E}\u{1D49F}\u{1D4A2}\u{1D4A5}\u{1D4A6}\u{1D4A9}-\u{1D4AC}\u{1D4AE}-\u{1D4B9}\u{1D4BB}\u{1D4BD}-\u{1D4C3}\u{1D4C5}-\u{1D505}\u{1D507}-\u{1D50A}\u{1D50D}-\u{1D514}\u{1D516}-\u{1D51C}\u{1D51E}-\u{1D539}\u{1D53B}-\u{1D53E}\u{1D540}-\u{1D544}\u{1D546}\u{1D54A}-\u{1D550}\u{1D552}-\u{1D6A5}\u{1D6A8}-\u{1D7CB}\u{1D7CE}-\u{1DA8B}\u{1DA9B}-\u{1DA9F}\u{1DAA1}-\u{1DAAF}\u{1DF00}-\u{1DF1E}\u{1E000}-\u{1E006}\u{1E008}-\u{1E018}\u{1E01B}-\u{1E021}\u{1E023}\u{1E024}\u{1E026}-\u{1E02A}\u{1E100}-\u{1E12C}\u{1E130}-\u{1E13D}\u{1E140}-\u{1E149}\u{1E14E}\u{1E14F}\u{1E290}-\u{1E2AE}\u{1E2C0}-\u{1E2F9}\u{1E2FF}\u{1E7E0}-\u{1E7E6}\u{1E7E8}-\u{1E7EB}\u{1E7ED}\u{1E7EE}\u{1E7F0}-\u{1E7FE}\u{1E8D0}-\u{1E8D6}\u{1E944}-\u{1E94A}\u{1EEF0}\u{1EEF1}\u{1F000}-\u{1F02B}\u{1F030}-\u{1F093}\u{1F0A0}-\u{1F0AE}\u{1F0B1}-\u{1F0BF}\u{1F0C1}-\u{1F0CF}\u{1F0D1}-\u{1F0F5}\u{1F100}-\u{1F1AD}\u{1F1E6}-\u{1F202}\u{1F210}-\u{1F23B}\u{1F240}-\u{1F248}\u{1F250}\u{1F251}\u{1F260}-\u{1F265}\u{1F300}-\u{1F6D7}\u{1F6DD}-\u{1F6EC}\u{1F6F0}-\u{1F6FC}\u{1F700}-\u{1F773}\u{1F780}-\u{1F7D8}\u{1F7E0}-\u{1F7EB}\u{1F7F0}\u{1F800}-\u{1F80B}\u{1F810}-\u{1F847}\u{1F850}-\u{1F859}\u{1F860}-\u{1F887}\u{1F890}-\u{1F8AD}\u{1F8B0}\u{1F8B1}\u{1F900}-\u{1FA53}\u{1FA60}-\u{1FA6D}\u{1FA70}-\u{1FA74}\u{1FA78}-\u{1FA7C}\u{1FA80}-\u{1FA86}\u{1FA90}-\u{1FAAC}\u{1FAB0}-\u{1FABA}\u{1FAC0}-\u{1FAC5}\u{1FAD0}-\u{1FAD9}\u{1FAE0}-\u{1FAE7}\u{1FAF0}-\u{1FAF6}\u{1FB00}-\u{1FB92}\u{1FB94}-\u{1FBCA}\u{1FBF0}-\u{1FBF9}\u{20000}-\u{2A6DF}\u{2A700}-\u{2B738}\u{2B740}-\u{2B81D}\u{2B820}-\u{2CEA1}\u{2CEB0}-\u{2EBE0}\u{2F800}-\u{2FA1D}\u{30000}-\u{3134A}\u{E0001}\u{E0020}-\u{E007F}\u{E0100}-\u{E01EF}\u{F0000}-\u{FFFFD}\u{100000}-\u{10FFFD}]*$/u; +const bidiS6 = /[0-9A-Za-z\xAA\xB2\xB3\xB5\xB9\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02B8\u02BB-\u02C1\u02D0\u02D1\u02E0-\u02E4\u02EE\u0370-\u0373\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0482\u048A-\u052F\u0531-\u0556\u0559-\u0589\u06F0-\u06F9\u0903-\u0939\u093B\u093D-\u0940\u0949-\u094C\u094E-\u0950\u0958-\u0961\u0964-\u0980\u0982\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD-\u09C0\u09C7\u09C8\u09CB\u09CC\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E1\u09E6-\u09F1\u09F4-\u09FA\u09FC\u09FD\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3E-\u0A40\u0A59-\u0A5C\u0A5E\u0A66-\u0A6F\u0A72-\u0A74\u0A76\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD-\u0AC0\u0AC9\u0ACB\u0ACC\u0AD0\u0AE0\u0AE1\u0AE6-\u0AF0\u0AF9\u0B02\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B3E\u0B40\u0B47\u0B48\u0B4B\u0B4C\u0B57\u0B5C\u0B5D\u0B5F-\u0B61\u0B66-\u0B77\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE\u0BBF\u0BC1\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCC\u0BD0\u0BD7\u0BE6-\u0BF2\u0C01-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C41-\u0C44\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C66-\u0C6F\u0C77\u0C7F\u0C80\u0C82-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD-\u0CC4\u0CC6-\u0CC8\u0CCA\u0CCB\u0CD5\u0CD6\u0CDD\u0CDE\u0CE0\u0CE1\u0CE6-\u0CEF\u0CF1\u0CF2\u0D02-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D40\u0D46-\u0D48\u0D4A-\u0D4C\u0D4E\u0D4F\u0D54-\u0D61\u0D66-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCF-\u0DD1\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2-\u0DF4\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E4F-\u0E5B\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00-\u0F17\u0F1A-\u0F34\u0F36\u0F38\u0F3E-\u0F47\u0F49-\u0F6C\u0F7F\u0F85\u0F88-\u0F8C\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE-\u0FDA\u1000-\u102C\u1031\u1038\u103B\u103C\u103F-\u1057\u105A-\u105D\u1061-\u1070\u1075-\u1081\u1083\u1084\u1087-\u108C\u108E-\u109C\u109E-\u10C5\u10C7\u10CD\u10D0-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1360-\u137C\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u167F\u1681-\u169A\u16A0-\u16F8\u1700-\u1711\u1715\u171F-\u1731\u1734-\u1736\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17B6\u17BE-\u17C5\u17C7\u17C8\u17D4-\u17DA\u17DC\u17E0-\u17E9\u1810-\u1819\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1923-\u1926\u1929-\u192B\u1930\u1931\u1933-\u1938\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A16\u1A19\u1A1A\u1A1E-\u1A55\u1A57\u1A61\u1A63\u1A64\u1A6D-\u1A72\u1A80-\u1A89\u1A90-\u1A99\u1AA0-\u1AAD\u1B04-\u1B33\u1B35\u1B3B\u1B3D-\u1B41\u1B43-\u1B4C\u1B50-\u1B6A\u1B74-\u1B7E\u1B82-\u1BA1\u1BA6\u1BA7\u1BAA\u1BAE-\u1BE5\u1BE7\u1BEA-\u1BEC\u1BEE\u1BF2\u1BF3\u1BFC-\u1C2B\u1C34\u1C35\u1C3B-\u1C49\u1C4D-\u1C88\u1C90-\u1CBA\u1CBD-\u1CC7\u1CD3\u1CE1\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5-\u1CF7\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u200E\u2070\u2071\u2074-\u2079\u207F-\u2089\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u214F\u2160-\u2188\u2336-\u237A\u2395\u2488-\u24E9\u26AC\u2800-\u28FF\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D70\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u302E\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u3190-\u31BF\u31F0-\u321C\u3220-\u324F\u3260-\u327B\u327F-\u32B0\u32C0-\u32CB\u32D0-\u3376\u337B-\u33DD\u33E0-\u33FE\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA60C\uA610-\uA62B\uA640-\uA66E\uA680-\uA69D\uA6A0-\uA6EF\uA6F2-\uA6F7\uA722-\uA787\uA789-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA824\uA827\uA830-\uA837\uA840-\uA873\uA880-\uA8C3\uA8CE-\uA8D9\uA8F2-\uA8FE\uA900-\uA925\uA92E-\uA946\uA952\uA953\uA95F-\uA97C\uA983-\uA9B2\uA9B4\uA9B5\uA9BA\uA9BB\uA9BE-\uA9CD\uA9CF-\uA9D9\uA9DE-\uA9E4\uA9E6-\uA9FE\uAA00-\uAA28\uAA2F\uAA30\uAA33\uAA34\uAA40-\uAA42\uAA44-\uAA4B\uAA4D\uAA50-\uAA59\uAA5C-\uAA7B\uAA7D-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAAEB\uAAEE-\uAAF5\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB69\uAB70-\uABE4\uABE6\uABE7\uABE9-\uABEC\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uD800-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFF10-\uFF19\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC\u{10000}-\u{1000B}\u{1000D}-\u{10026}\u{10028}-\u{1003A}\u{1003C}\u{1003D}\u{1003F}-\u{1004D}\u{10050}-\u{1005D}\u{10080}-\u{100FA}\u{10100}\u{10102}\u{10107}-\u{10133}\u{10137}-\u{1013F}\u{1018D}\u{1018E}\u{101D0}-\u{101FC}\u{10280}-\u{1029C}\u{102A0}-\u{102D0}\u{102E1}-\u{102FB}\u{10300}-\u{10323}\u{1032D}-\u{1034A}\u{10350}-\u{10375}\u{10380}-\u{1039D}\u{1039F}-\u{103C3}\u{103C8}-\u{103D5}\u{10400}-\u{1049D}\u{104A0}-\u{104A9}\u{104B0}-\u{104D3}\u{104D8}-\u{104FB}\u{10500}-\u{10527}\u{10530}-\u{10563}\u{1056F}-\u{1057A}\u{1057C}-\u{1058A}\u{1058C}-\u{10592}\u{10594}\u{10595}\u{10597}-\u{105A1}\u{105A3}-\u{105B1}\u{105B3}-\u{105B9}\u{105BB}\u{105BC}\u{10600}-\u{10736}\u{10740}-\u{10755}\u{10760}-\u{10767}\u{10780}-\u{10785}\u{10787}-\u{107B0}\u{107B2}-\u{107BA}\u{11000}\u{11002}-\u{11037}\u{11047}-\u{1104D}\u{11066}-\u{1106F}\u{11071}\u{11072}\u{11075}\u{11082}-\u{110B2}\u{110B7}\u{110B8}\u{110BB}-\u{110C1}\u{110CD}\u{110D0}-\u{110E8}\u{110F0}-\u{110F9}\u{11103}-\u{11126}\u{1112C}\u{11136}-\u{11147}\u{11150}-\u{11172}\u{11174}-\u{11176}\u{11182}-\u{111B5}\u{111BF}-\u{111C8}\u{111CD}\u{111CE}\u{111D0}-\u{111DF}\u{111E1}-\u{111F4}\u{11200}-\u{11211}\u{11213}-\u{1122E}\u{11232}\u{11233}\u{11235}\u{11238}-\u{1123D}\u{11280}-\u{11286}\u{11288}\u{1128A}-\u{1128D}\u{1128F}-\u{1129D}\u{1129F}-\u{112A9}\u{112B0}-\u{112DE}\u{112E0}-\u{112E2}\u{112F0}-\u{112F9}\u{11302}\u{11303}\u{11305}-\u{1130C}\u{1130F}\u{11310}\u{11313}-\u{11328}\u{1132A}-\u{11330}\u{11332}\u{11333}\u{11335}-\u{11339}\u{1133D}-\u{1133F}\u{11341}-\u{11344}\u{11347}\u{11348}\u{1134B}-\u{1134D}\u{11350}\u{11357}\u{1135D}-\u{11363}\u{11400}-\u{11437}\u{11440}\u{11441}\u{11445}\u{11447}-\u{1145B}\u{1145D}\u{1145F}-\u{11461}\u{11480}-\u{114B2}\u{114B9}\u{114BB}-\u{114BE}\u{114C1}\u{114C4}-\u{114C7}\u{114D0}-\u{114D9}\u{11580}-\u{115B1}\u{115B8}-\u{115BB}\u{115BE}\u{115C1}-\u{115DB}\u{11600}-\u{11632}\u{1163B}\u{1163C}\u{1163E}\u{11641}-\u{11644}\u{11650}-\u{11659}\u{11680}-\u{116AA}\u{116AC}\u{116AE}\u{116AF}\u{116B6}\u{116B8}\u{116B9}\u{116C0}-\u{116C9}\u{11700}-\u{1171A}\u{11720}\u{11721}\u{11726}\u{11730}-\u{11746}\u{11800}-\u{1182E}\u{11838}\u{1183B}\u{118A0}-\u{118F2}\u{118FF}-\u{11906}\u{11909}\u{1190C}-\u{11913}\u{11915}\u{11916}\u{11918}-\u{11935}\u{11937}\u{11938}\u{1193D}\u{1193F}-\u{11942}\u{11944}-\u{11946}\u{11950}-\u{11959}\u{119A0}-\u{119A7}\u{119AA}-\u{119D3}\u{119DC}-\u{119DF}\u{119E1}-\u{119E4}\u{11A00}\u{11A07}\u{11A08}\u{11A0B}-\u{11A32}\u{11A39}\u{11A3A}\u{11A3F}-\u{11A46}\u{11A50}\u{11A57}\u{11A58}\u{11A5C}-\u{11A89}\u{11A97}\u{11A9A}-\u{11AA2}\u{11AB0}-\u{11AF8}\u{11C00}-\u{11C08}\u{11C0A}-\u{11C2F}\u{11C3E}-\u{11C45}\u{11C50}-\u{11C6C}\u{11C70}-\u{11C8F}\u{11CA9}\u{11CB1}\u{11CB4}\u{11D00}-\u{11D06}\u{11D08}\u{11D09}\u{11D0B}-\u{11D30}\u{11D46}\u{11D50}-\u{11D59}\u{11D60}-\u{11D65}\u{11D67}\u{11D68}\u{11D6A}-\u{11D8E}\u{11D93}\u{11D94}\u{11D96}\u{11D98}\u{11DA0}-\u{11DA9}\u{11EE0}-\u{11EF2}\u{11EF5}-\u{11EF8}\u{11FB0}\u{11FC0}-\u{11FD4}\u{11FFF}-\u{12399}\u{12400}-\u{1246E}\u{12470}-\u{12474}\u{12480}-\u{12543}\u{12F90}-\u{12FF2}\u{13000}-\u{1342E}\u{13430}-\u{13438}\u{14400}-\u{14646}\u{16800}-\u{16A38}\u{16A40}-\u{16A5E}\u{16A60}-\u{16A69}\u{16A6E}-\u{16ABE}\u{16AC0}-\u{16AC9}\u{16AD0}-\u{16AED}\u{16AF5}\u{16B00}-\u{16B2F}\u{16B37}-\u{16B45}\u{16B50}-\u{16B59}\u{16B5B}-\u{16B61}\u{16B63}-\u{16B77}\u{16B7D}-\u{16B8F}\u{16E40}-\u{16E9A}\u{16F00}-\u{16F4A}\u{16F50}-\u{16F87}\u{16F93}-\u{16F9F}\u{16FE0}\u{16FE1}\u{16FE3}\u{16FF0}\u{16FF1}\u{17000}-\u{187F7}\u{18800}-\u{18CD5}\u{18D00}-\u{18D08}\u{1AFF0}-\u{1AFF3}\u{1AFF5}-\u{1AFFB}\u{1AFFD}\u{1AFFE}\u{1B000}-\u{1B122}\u{1B150}-\u{1B152}\u{1B164}-\u{1B167}\u{1B170}-\u{1B2FB}\u{1BC00}-\u{1BC6A}\u{1BC70}-\u{1BC7C}\u{1BC80}-\u{1BC88}\u{1BC90}-\u{1BC99}\u{1BC9C}\u{1BC9F}\u{1CF50}-\u{1CFC3}\u{1D000}-\u{1D0F5}\u{1D100}-\u{1D126}\u{1D129}-\u{1D166}\u{1D16A}-\u{1D172}\u{1D183}\u{1D184}\u{1D18C}-\u{1D1A9}\u{1D1AE}-\u{1D1E8}\u{1D2E0}-\u{1D2F3}\u{1D360}-\u{1D378}\u{1D400}-\u{1D454}\u{1D456}-\u{1D49C}\u{1D49E}\u{1D49F}\u{1D4A2}\u{1D4A5}\u{1D4A6}\u{1D4A9}-\u{1D4AC}\u{1D4AE}-\u{1D4B9}\u{1D4BB}\u{1D4BD}-\u{1D4C3}\u{1D4C5}-\u{1D505}\u{1D507}-\u{1D50A}\u{1D50D}-\u{1D514}\u{1D516}-\u{1D51C}\u{1D51E}-\u{1D539}\u{1D53B}-\u{1D53E}\u{1D540}-\u{1D544}\u{1D546}\u{1D54A}-\u{1D550}\u{1D552}-\u{1D6A5}\u{1D6A8}-\u{1D6DA}\u{1D6DC}-\u{1D714}\u{1D716}-\u{1D74E}\u{1D750}-\u{1D788}\u{1D78A}-\u{1D7C2}\u{1D7C4}-\u{1D7CB}\u{1D7CE}-\u{1D9FF}\u{1DA37}-\u{1DA3A}\u{1DA6D}-\u{1DA74}\u{1DA76}-\u{1DA83}\u{1DA85}-\u{1DA8B}\u{1DF00}-\u{1DF1E}\u{1E100}-\u{1E12C}\u{1E137}-\u{1E13D}\u{1E140}-\u{1E149}\u{1E14E}\u{1E14F}\u{1E290}-\u{1E2AD}\u{1E2C0}-\u{1E2EB}\u{1E2F0}-\u{1E2F9}\u{1E7E0}-\u{1E7E6}\u{1E7E8}-\u{1E7EB}\u{1E7ED}\u{1E7EE}\u{1E7F0}-\u{1E7FE}\u{1F100}-\u{1F10A}\u{1F110}-\u{1F12E}\u{1F130}-\u{1F169}\u{1F170}-\u{1F1AC}\u{1F1E6}-\u{1F202}\u{1F210}-\u{1F23B}\u{1F240}-\u{1F248}\u{1F250}\u{1F251}\u{1FBF0}-\u{1FBF9}\u{20000}-\u{2A6DF}\u{2A700}-\u{2B738}\u{2B740}-\u{2B81D}\u{2B820}-\u{2CEA1}\u{2CEB0}-\u{2EBE0}\u{2F800}-\u{2FA1D}\u{30000}-\u{3134A}\u{F0000}-\u{FFFFD}\u{100000}-\u{10FFFD}][\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0898-\u089F\u08CA-\u08E1\u08E3-\u0902\u093A\u093C\u0941-\u0948\u094D\u0951-\u0957\u0962\u0963\u0981\u09BC\u09C1-\u09C4\u09CD\u09E2\u09E3\u09FE\u0A01\u0A02\u0A3C\u0A41\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81\u0A82\u0ABC\u0AC1-\u0AC5\u0AC7\u0AC8\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01\u0B3C\u0B3F\u0B41-\u0B44\u0B4D\u0B55\u0B56\u0B62\u0B63\u0B82\u0BC0\u0BCD\u0C00\u0C04\u0C3C\u0C3E-\u0C40\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81\u0CBC\u0CCC\u0CCD\u0CE2\u0CE3\u0D00\u0D01\u0D3B\u0D3C\u0D41-\u0D44\u0D4D\u0D62\u0D63\u0D81\u0DCA\u0DD2-\u0DD4\u0DD6\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F71-\u0F7E\u0F80-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102D-\u1030\u1032-\u1037\u1039\u103A\u103D\u103E\u1058\u1059\u105E-\u1060\u1071-\u1074\u1082\u1085\u1086\u108D\u109D\u135D-\u135F\u1712-\u1714\u1732\u1733\u1752\u1753\u1772\u1773\u17B4\u17B5\u17B7-\u17BD\u17C6\u17C9-\u17D3\u17DD\u180B-\u180D\u180F\u1885\u1886\u18A9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193B\u1A17\u1A18\u1A1B\u1A56\u1A58-\u1A5E\u1A60\u1A62\u1A65-\u1A6C\u1A73-\u1A7C\u1A7F\u1AB0-\u1ACE\u1B00-\u1B03\u1B34\u1B36-\u1B3A\u1B3C\u1B42\u1B6B-\u1B73\u1B80\u1B81\u1BA2-\u1BA5\u1BA8\u1BA9\u1BAB-\u1BAD\u1BE6\u1BE8\u1BE9\u1BED\u1BEF-\u1BF1\u1C2C-\u1C33\u1C36\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE0\u1CE2-\u1CE8\u1CED\u1CF4\u1CF8\u1CF9\u1DC0-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302D\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA825\uA826\uA82C\uA8C4\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA951\uA980-\uA982\uA9B3\uA9B6-\uA9B9\uA9BC\uA9BD\uA9E5\uAA29-\uAA2E\uAA31\uAA32\uAA35\uAA36\uAA43\uAA4C\uAA7C\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEC\uAAED\uAAF6\uABE5\uABE8\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\u{101FD}\u{102E0}\u{10376}-\u{1037A}\u{10A01}-\u{10A03}\u{10A05}\u{10A06}\u{10A0C}-\u{10A0F}\u{10A38}-\u{10A3A}\u{10A3F}\u{10AE5}\u{10AE6}\u{10D24}-\u{10D27}\u{10EAB}\u{10EAC}\u{10F46}-\u{10F50}\u{10F82}-\u{10F85}\u{11001}\u{11038}-\u{11046}\u{11070}\u{11073}\u{11074}\u{1107F}-\u{11081}\u{110B3}-\u{110B6}\u{110B9}\u{110BA}\u{110C2}\u{11100}-\u{11102}\u{11127}-\u{1112B}\u{1112D}-\u{11134}\u{11173}\u{11180}\u{11181}\u{111B6}-\u{111BE}\u{111C9}-\u{111CC}\u{111CF}\u{1122F}-\u{11231}\u{11234}\u{11236}\u{11237}\u{1123E}\u{112DF}\u{112E3}-\u{112EA}\u{11300}\u{11301}\u{1133B}\u{1133C}\u{11340}\u{11366}-\u{1136C}\u{11370}-\u{11374}\u{11438}-\u{1143F}\u{11442}-\u{11444}\u{11446}\u{1145E}\u{114B3}-\u{114B8}\u{114BA}\u{114BF}\u{114C0}\u{114C2}\u{114C3}\u{115B2}-\u{115B5}\u{115BC}\u{115BD}\u{115BF}\u{115C0}\u{115DC}\u{115DD}\u{11633}-\u{1163A}\u{1163D}\u{1163F}\u{11640}\u{116AB}\u{116AD}\u{116B0}-\u{116B5}\u{116B7}\u{1171D}-\u{1171F}\u{11722}-\u{11725}\u{11727}-\u{1172B}\u{1182F}-\u{11837}\u{11839}\u{1183A}\u{1193B}\u{1193C}\u{1193E}\u{11943}\u{119D4}-\u{119D7}\u{119DA}\u{119DB}\u{119E0}\u{11A01}-\u{11A06}\u{11A09}\u{11A0A}\u{11A33}-\u{11A38}\u{11A3B}-\u{11A3E}\u{11A47}\u{11A51}-\u{11A56}\u{11A59}-\u{11A5B}\u{11A8A}-\u{11A96}\u{11A98}\u{11A99}\u{11C30}-\u{11C36}\u{11C38}-\u{11C3D}\u{11C92}-\u{11CA7}\u{11CAA}-\u{11CB0}\u{11CB2}\u{11CB3}\u{11CB5}\u{11CB6}\u{11D31}-\u{11D36}\u{11D3A}\u{11D3C}\u{11D3D}\u{11D3F}-\u{11D45}\u{11D47}\u{11D90}\u{11D91}\u{11D95}\u{11D97}\u{11EF3}\u{11EF4}\u{16AF0}-\u{16AF4}\u{16B30}-\u{16B36}\u{16F4F}\u{16F8F}-\u{16F92}\u{16FE4}\u{1BC9D}\u{1BC9E}\u{1CF00}-\u{1CF2D}\u{1CF30}-\u{1CF46}\u{1D167}-\u{1D169}\u{1D17B}-\u{1D182}\u{1D185}-\u{1D18B}\u{1D1AA}-\u{1D1AD}\u{1D242}-\u{1D244}\u{1DA00}-\u{1DA36}\u{1DA3B}-\u{1DA6C}\u{1DA75}\u{1DA84}\u{1DA9B}-\u{1DA9F}\u{1DAA1}-\u{1DAAF}\u{1E000}-\u{1E006}\u{1E008}-\u{1E018}\u{1E01B}-\u{1E021}\u{1E023}\u{1E024}\u{1E026}-\u{1E02A}\u{1E130}-\u{1E136}\u{1E2AE}\u{1E2EC}-\u{1E2EF}\u{1E8D0}-\u{1E8D6}\u{1E944}-\u{1E94A}\u{E0100}-\u{E01EF}]*$/u; + +module.exports = { + combiningMarks, + combiningClassVirama, + validZWNJ, + bidiDomain, + bidiS1LTR, + bidiS1RTL, + bidiS2, + bidiS3, + bidiS4EN, + bidiS4AN, + bidiS5, + bidiS6 +}; diff --git a/node_modules/mongodb-connection-string-url/node_modules/tr46/lib/statusMapping.js b/node_modules/mongodb-connection-string-url/node_modules/tr46/lib/statusMapping.js new file mode 100644 index 000000000..cfed6d6a7 --- /dev/null +++ b/node_modules/mongodb-connection-string-url/node_modules/tr46/lib/statusMapping.js @@ -0,0 +1,11 @@ +"use strict"; + +module.exports.STATUS_MAPPING = { + mapped: 1, + valid: 2, + disallowed: 3, + disallowed_STD3_valid: 4, + disallowed_STD3_mapped: 5, + deviation: 6, + ignored: 7 +}; diff --git a/node_modules/mongodb-connection-string-url/node_modules/tr46/package.json b/node_modules/mongodb-connection-string-url/node_modules/tr46/package.json new file mode 100644 index 000000000..8e79ba6cd --- /dev/null +++ b/node_modules/mongodb-connection-string-url/node_modules/tr46/package.json @@ -0,0 +1,47 @@ +{ + "name": "tr46", + "version": "3.0.0", + "engines": { + "node": ">=12" + }, + "description": "An implementation of the Unicode UTS #46: Unicode IDNA Compatibility Processing", + "main": "index.js", + "files": [ + "index.js", + "lib/mappingTable.json", + "lib/regexes.js", + "lib/statusMapping.js" + ], + "scripts": { + "test": "mocha", + "lint": "eslint .", + "pretest": "node scripts/getLatestTests.js", + "prepublish": "node scripts/generateMappingTable.js && node scripts/generateRegexes.js" + }, + "repository": "https://github.com/jsdom/tr46", + "keywords": [ + "unicode", + "tr46", + "uts46", + "punycode", + "url", + "whatwg" + ], + "author": "Sebastian Mayr ", + "contributors": [ + "Timothy Gu " + ], + "license": "MIT", + "dependencies": { + "punycode": "^2.1.1" + }, + "devDependencies": { + "@domenic/eslint-config": "^1.4.0", + "@unicode/unicode-14.0.0": "^1.2.1", + "eslint": "^7.32.0", + "minipass-fetch": "^1.4.1", + "mocha": "^9.1.1", + "regenerate": "^1.4.2" + }, + "unicodeVersion": "14.0.0" +} diff --git a/node_modules/mongodb-connection-string-url/node_modules/webidl-conversions/LICENSE.md b/node_modules/mongodb-connection-string-url/node_modules/webidl-conversions/LICENSE.md new file mode 100644 index 000000000..d4a994f50 --- /dev/null +++ b/node_modules/mongodb-connection-string-url/node_modules/webidl-conversions/LICENSE.md @@ -0,0 +1,12 @@ +# The BSD 2-Clause License + +Copyright (c) 2014, Domenic Denicola +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/node_modules/mongodb-connection-string-url/node_modules/webidl-conversions/README.md b/node_modules/mongodb-connection-string-url/node_modules/webidl-conversions/README.md new file mode 100644 index 000000000..16cc39315 --- /dev/null +++ b/node_modules/mongodb-connection-string-url/node_modules/webidl-conversions/README.md @@ -0,0 +1,99 @@ +# Web IDL Type Conversions on JavaScript Values + +This package implements, in JavaScript, the algorithms to convert a given JavaScript value according to a given [Web IDL](http://heycam.github.io/webidl/) [type](http://heycam.github.io/webidl/#idl-types). + +The goal is that you should be able to write code like + +```js +"use strict"; +const conversions = require("webidl-conversions"); + +function doStuff(x, y) { + x = conversions["boolean"](x); + y = conversions["unsigned long"](y); + // actual algorithm code here +} +``` + +and your function `doStuff` will behave the same as a Web IDL operation declared as + +```webidl +undefined doStuff(boolean x, unsigned long y); +``` + +## API + +This package's main module's default export is an object with a variety of methods, each corresponding to a different Web IDL type. Each method, when invoked on a JavaScript value, will give back the new JavaScript value that results after passing through the Web IDL conversion rules. (See below for more details on what that means.) Alternately, the method could throw an error, if the Web IDL algorithm is specified to do so: for example `conversions["float"](NaN)` [will throw a `TypeError`](http://heycam.github.io/webidl/#es-float). + +Each method also accepts a second, optional, parameter for miscellaneous options. For conversion methods that throw errors, a string option `{ context }` may be provided to provide more information in the error message. (For example, `conversions["float"](NaN, { context: "Argument 1 of Interface's operation" })` will throw an error with message `"Argument 1 of Interface's operation is not a finite floating-point value."`) + +If we are dealing with multiple JavaScript realms (such as those created using Node.js' [vm](https://nodejs.org/api/vm.html) module or the HTML `iframe` element), and exceptions from another realm need to be thrown, one can supply an object option `globals` containing the following properties: + +```js +{ + globals: { + Number, + String, + TypeError + } +} +``` + +Those specific functions will be used when throwing exceptions. + +Specific conversions may also accept other options, the details of which can be found below. + +## Conversions implemented + +Conversions for all of the basic types from the Web IDL specification are implemented: + +- [`any`](https://heycam.github.io/webidl/#es-any) +- [`undefined`](https://heycam.github.io/webidl/#es-undefined) +- [`boolean`](https://heycam.github.io/webidl/#es-boolean) +- [Integer types](https://heycam.github.io/webidl/#es-integer-types), which can additionally be provided the boolean options `{ clamp, enforceRange }` as a second parameter +- [`float`](https://heycam.github.io/webidl/#es-float), [`unrestricted float`](https://heycam.github.io/webidl/#es-unrestricted-float) +- [`double`](https://heycam.github.io/webidl/#es-double), [`unrestricted double`](https://heycam.github.io/webidl/#es-unrestricted-double) +- [`DOMString`](https://heycam.github.io/webidl/#es-DOMString), which can additionally be provided the boolean option `{ treatNullAsEmptyString }` as a second parameter +- [`ByteString`](https://heycam.github.io/webidl/#es-ByteString), [`USVString`](https://heycam.github.io/webidl/#es-USVString) +- [`object`](https://heycam.github.io/webidl/#es-object) +- [Buffer source types](https://heycam.github.io/webidl/#es-buffer-source-types), which can additionally be provided with the boolean option `{ allowShared }` as a second parameter + +Additionally, for convenience, the following derived type definitions are implemented: + +- [`ArrayBufferView`](https://heycam.github.io/webidl/#ArrayBufferView), which can additionally be provided with the boolean option `{ allowShared }` as a second parameter +- [`BufferSource`](https://heycam.github.io/webidl/#BufferSource) +- [`DOMTimeStamp`](https://heycam.github.io/webidl/#DOMTimeStamp) + +Derived types, such as nullable types, promise types, sequences, records, etc. are not handled by this library. You may wish to investigate the [webidl2js](https://github.com/jsdom/webidl2js) project. + +### A note on the `long long` types + +The `long long` and `unsigned long long` Web IDL types can hold values that cannot be stored in JavaScript numbers. Conversions are still accurate as we make use of BigInt in the conversion process, but in the case of `unsigned long long` we simply cannot represent some possible output values in JavaScript. For example, converting the JavaScript number `-1` to a Web IDL `unsigned long long` is supposed to produce the Web IDL value `18446744073709551615`. Since we are representing our Web IDL values in JavaScript, we can't represent `18446744073709551615`, so we instead the best we could do is `18446744073709551616` as the output. + +To mitigate this, we could return the raw BigInt value from the conversion function, but right now it is not implemented. If your use case requires such precision, [file an issue](https://github.com/jsdom/webidl-conversions/issues/new). + +On the other hand, `long long` conversion is always accurate, since the input value can never be more precise than the output value. + +### A note on `BufferSource` types + +All of the `BufferSource` types will throw when the relevant `ArrayBuffer` has been detached. This technically is not part of the [specified conversion algorithm](https://heycam.github.io/webidl/#es-buffer-source-types), but instead part of the [getting a reference/getting a copy](https://heycam.github.io/webidl/#ref-for-dfn-get-buffer-source-reference%E2%91%A0) algorithms. We've consolidated them here for convenience and ease of implementation, but if there is a need to separate them in the future, please open an issue so we can investigate. + +## Background + +What's actually going on here, conceptually, is pretty weird. Let's try to explain. + +Web IDL, as part of its madness-inducing design, has its own type system. When people write algorithms in web platform specs, they usually operate on Web IDL values, i.e. instances of Web IDL types. For example, if they were specifying the algorithm for our `doStuff` operation above, they would treat `x` as a Web IDL value of [Web IDL type `boolean`](http://heycam.github.io/webidl/#idl-boolean). Crucially, they would _not_ treat `x` as a JavaScript variable whose value is either the JavaScript `true` or `false`. They're instead working in a different type system altogether, with its own rules. + +Separately from its type system, Web IDL defines a ["binding"](http://heycam.github.io/webidl/#ecmascript-binding) of the type system into JavaScript. This contains rules like: when you pass a JavaScript value to the JavaScript method that manifests a given Web IDL operation, how does that get converted into a Web IDL value? For example, a JavaScript `true` passed in the position of a Web IDL `boolean` argument becomes a Web IDL `true`. But, a JavaScript `true` passed in the position of a [Web IDL `unsigned long`](http://heycam.github.io/webidl/#idl-unsigned-long) becomes a Web IDL `1`. And so on. + +Finally, we have the actual implementation code. This is usually C++, although these days [some smart people are using Rust](https://github.com/servo/servo). The implementation, of course, has its own type system. So when they implement the Web IDL algorithms, they don't actually use Web IDL values, since those aren't "real" outside of specs. Instead, implementations apply the Web IDL binding rules in such a way as to convert incoming JavaScript values into C++ values. For example, if code in the browser called `doStuff(true, true)`, then the implementation code would eventually receive a C++ `bool` containing `true` and a C++ `uint32_t` containing `1`. + +The upside of all this is that implementations can abstract all the conversion logic away, letting Web IDL handle it, and focus on implementing the relevant methods in C++ with values of the correct type already provided. That is payoff of Web IDL, in a nutshell. + +And getting to that payoff is the goal of _this_ project—but for JavaScript implementations, instead of C++ ones. That is, this library is designed to make it easier for JavaScript developers to write functions that behave like a given Web IDL operation. So conceptually, the conversion pipeline, which in its general form is JavaScript values ↦ Web IDL values ↦ implementation-language values, in this case becomes JavaScript values ↦ Web IDL values ↦ JavaScript values. And that intermediate step is where all the logic is performed: a JavaScript `true` becomes a Web IDL `1` in an unsigned long context, which then becomes a JavaScript `1`. + +## Don't use this + +Seriously, why would you ever use this? You really shouldn't. Web IDL is … strange, and you shouldn't be emulating its semantics. If you're looking for a generic argument-processing library, you should find one with better rules than those from Web IDL. In general, your JavaScript should not be trying to become more like Web IDL; if anything, we should fix Web IDL to make it more like JavaScript. + +The _only_ people who should use this are those trying to create faithful implementations (or polyfills) of web platform interfaces defined in Web IDL. Its main consumer is the [jsdom](https://github.com/jsdom/jsdom) project. diff --git a/node_modules/mongodb-connection-string-url/node_modules/webidl-conversions/lib/index.js b/node_modules/mongodb-connection-string-url/node_modules/webidl-conversions/lib/index.js new file mode 100644 index 000000000..0229347c1 --- /dev/null +++ b/node_modules/mongodb-connection-string-url/node_modules/webidl-conversions/lib/index.js @@ -0,0 +1,450 @@ +"use strict"; + +function makeException(ErrorType, message, options) { + if (options.globals) { + ErrorType = options.globals[ErrorType.name]; + } + return new ErrorType(`${options.context ? options.context : "Value"} ${message}.`); +} + +function toNumber(value, options) { + if (typeof value === "bigint") { + throw makeException(TypeError, "is a BigInt which cannot be converted to a number", options); + } + if (!options.globals) { + return Number(value); + } + return options.globals.Number(value); +} + +// Round x to the nearest integer, choosing the even integer if it lies halfway between two. +function evenRound(x) { + // There are four cases for numbers with fractional part being .5: + // + // case | x | floor(x) | round(x) | expected | x <> 0 | x % 1 | x & 1 | example + // 1 | 2n + 0.5 | 2n | 2n + 1 | 2n | > | 0.5 | 0 | 0.5 -> 0 + // 2 | 2n + 1.5 | 2n + 1 | 2n + 2 | 2n + 2 | > | 0.5 | 1 | 1.5 -> 2 + // 3 | -2n - 0.5 | -2n - 1 | -2n | -2n | < | -0.5 | 0 | -0.5 -> 0 + // 4 | -2n - 1.5 | -2n - 2 | -2n - 1 | -2n - 2 | < | -0.5 | 1 | -1.5 -> -2 + // (where n is a non-negative integer) + // + // Branch here for cases 1 and 4 + if ((x > 0 && (x % 1) === +0.5 && (x & 1) === 0) || + (x < 0 && (x % 1) === -0.5 && (x & 1) === 1)) { + return censorNegativeZero(Math.floor(x)); + } + + return censorNegativeZero(Math.round(x)); +} + +function integerPart(n) { + return censorNegativeZero(Math.trunc(n)); +} + +function sign(x) { + return x < 0 ? -1 : 1; +} + +function modulo(x, y) { + // https://tc39.github.io/ecma262/#eqn-modulo + // Note that http://stackoverflow.com/a/4467559/3191 does NOT work for large modulos + const signMightNotMatch = x % y; + if (sign(y) !== sign(signMightNotMatch)) { + return signMightNotMatch + y; + } + return signMightNotMatch; +} + +function censorNegativeZero(x) { + return x === 0 ? 0 : x; +} + +function createIntegerConversion(bitLength, { unsigned }) { + let lowerBound, upperBound; + if (unsigned) { + lowerBound = 0; + upperBound = 2 ** bitLength - 1; + } else { + lowerBound = -(2 ** (bitLength - 1)); + upperBound = 2 ** (bitLength - 1) - 1; + } + + const twoToTheBitLength = 2 ** bitLength; + const twoToOneLessThanTheBitLength = 2 ** (bitLength - 1); + + return (value, options = {}) => { + let x = toNumber(value, options); + x = censorNegativeZero(x); + + if (options.enforceRange) { + if (!Number.isFinite(x)) { + throw makeException(TypeError, "is not a finite number", options); + } + + x = integerPart(x); + + if (x < lowerBound || x > upperBound) { + throw makeException( + TypeError, + `is outside the accepted range of ${lowerBound} to ${upperBound}, inclusive`, + options + ); + } + + return x; + } + + if (!Number.isNaN(x) && options.clamp) { + x = Math.min(Math.max(x, lowerBound), upperBound); + x = evenRound(x); + return x; + } + + if (!Number.isFinite(x) || x === 0) { + return 0; + } + x = integerPart(x); + + // Math.pow(2, 64) is not accurately representable in JavaScript, so try to avoid these per-spec operations if + // possible. Hopefully it's an optimization for the non-64-bitLength cases too. + if (x >= lowerBound && x <= upperBound) { + return x; + } + + // These will not work great for bitLength of 64, but oh well. See the README for more details. + x = modulo(x, twoToTheBitLength); + if (!unsigned && x >= twoToOneLessThanTheBitLength) { + return x - twoToTheBitLength; + } + return x; + }; +} + +function createLongLongConversion(bitLength, { unsigned }) { + const upperBound = Number.MAX_SAFE_INTEGER; + const lowerBound = unsigned ? 0 : Number.MIN_SAFE_INTEGER; + const asBigIntN = unsigned ? BigInt.asUintN : BigInt.asIntN; + + return (value, options = {}) => { + let x = toNumber(value, options); + x = censorNegativeZero(x); + + if (options.enforceRange) { + if (!Number.isFinite(x)) { + throw makeException(TypeError, "is not a finite number", options); + } + + x = integerPart(x); + + if (x < lowerBound || x > upperBound) { + throw makeException( + TypeError, + `is outside the accepted range of ${lowerBound} to ${upperBound}, inclusive`, + options + ); + } + + return x; + } + + if (!Number.isNaN(x) && options.clamp) { + x = Math.min(Math.max(x, lowerBound), upperBound); + x = evenRound(x); + return x; + } + + if (!Number.isFinite(x) || x === 0) { + return 0; + } + + let xBigInt = BigInt(integerPart(x)); + xBigInt = asBigIntN(bitLength, xBigInt); + return Number(xBigInt); + }; +} + +exports.any = value => { + return value; +}; + +exports.undefined = () => { + return undefined; +}; + +exports.boolean = value => { + return Boolean(value); +}; + +exports.byte = createIntegerConversion(8, { unsigned: false }); +exports.octet = createIntegerConversion(8, { unsigned: true }); + +exports.short = createIntegerConversion(16, { unsigned: false }); +exports["unsigned short"] = createIntegerConversion(16, { unsigned: true }); + +exports.long = createIntegerConversion(32, { unsigned: false }); +exports["unsigned long"] = createIntegerConversion(32, { unsigned: true }); + +exports["long long"] = createLongLongConversion(64, { unsigned: false }); +exports["unsigned long long"] = createLongLongConversion(64, { unsigned: true }); + +exports.double = (value, options = {}) => { + const x = toNumber(value, options); + + if (!Number.isFinite(x)) { + throw makeException(TypeError, "is not a finite floating-point value", options); + } + + return x; +}; + +exports["unrestricted double"] = (value, options = {}) => { + const x = toNumber(value, options); + + return x; +}; + +exports.float = (value, options = {}) => { + const x = toNumber(value, options); + + if (!Number.isFinite(x)) { + throw makeException(TypeError, "is not a finite floating-point value", options); + } + + if (Object.is(x, -0)) { + return x; + } + + const y = Math.fround(x); + + if (!Number.isFinite(y)) { + throw makeException(TypeError, "is outside the range of a single-precision floating-point value", options); + } + + return y; +}; + +exports["unrestricted float"] = (value, options = {}) => { + const x = toNumber(value, options); + + if (isNaN(x)) { + return x; + } + + if (Object.is(x, -0)) { + return x; + } + + return Math.fround(x); +}; + +exports.DOMString = (value, options = {}) => { + if (options.treatNullAsEmptyString && value === null) { + return ""; + } + + if (typeof value === "symbol") { + throw makeException(TypeError, "is a symbol, which cannot be converted to a string", options); + } + + const StringCtor = options.globals ? options.globals.String : String; + return StringCtor(value); +}; + +exports.ByteString = (value, options = {}) => { + const x = exports.DOMString(value, options); + let c; + for (let i = 0; (c = x.codePointAt(i)) !== undefined; ++i) { + if (c > 255) { + throw makeException(TypeError, "is not a valid ByteString", options); + } + } + + return x; +}; + +exports.USVString = (value, options = {}) => { + const S = exports.DOMString(value, options); + const n = S.length; + const U = []; + for (let i = 0; i < n; ++i) { + const c = S.charCodeAt(i); + if (c < 0xD800 || c > 0xDFFF) { + U.push(String.fromCodePoint(c)); + } else if (0xDC00 <= c && c <= 0xDFFF) { + U.push(String.fromCodePoint(0xFFFD)); + } else if (i === n - 1) { + U.push(String.fromCodePoint(0xFFFD)); + } else { + const d = S.charCodeAt(i + 1); + if (0xDC00 <= d && d <= 0xDFFF) { + const a = c & 0x3FF; + const b = d & 0x3FF; + U.push(String.fromCodePoint((2 << 15) + ((2 << 9) * a) + b)); + ++i; + } else { + U.push(String.fromCodePoint(0xFFFD)); + } + } + } + + return U.join(""); +}; + +exports.object = (value, options = {}) => { + if (value === null || (typeof value !== "object" && typeof value !== "function")) { + throw makeException(TypeError, "is not an object", options); + } + + return value; +}; + +const abByteLengthGetter = + Object.getOwnPropertyDescriptor(ArrayBuffer.prototype, "byteLength").get; +const sabByteLengthGetter = + typeof SharedArrayBuffer === "function" ? + Object.getOwnPropertyDescriptor(SharedArrayBuffer.prototype, "byteLength").get : + null; + +function isNonSharedArrayBuffer(value) { + try { + // This will throw on SharedArrayBuffers, but not detached ArrayBuffers. + // (The spec says it should throw, but the spec conflicts with implementations: https://github.com/tc39/ecma262/issues/678) + abByteLengthGetter.call(value); + + return true; + } catch { + return false; + } +} + +function isSharedArrayBuffer(value) { + try { + sabByteLengthGetter.call(value); + return true; + } catch { + return false; + } +} + +function isArrayBufferDetached(value) { + try { + // eslint-disable-next-line no-new + new Uint8Array(value); + return false; + } catch { + return true; + } +} + +exports.ArrayBuffer = (value, options = {}) => { + if (!isNonSharedArrayBuffer(value)) { + if (options.allowShared && !isSharedArrayBuffer(value)) { + throw makeException(TypeError, "is not an ArrayBuffer or SharedArrayBuffer", options); + } + throw makeException(TypeError, "is not an ArrayBuffer", options); + } + if (isArrayBufferDetached(value)) { + throw makeException(TypeError, "is a detached ArrayBuffer", options); + } + + return value; +}; + +const dvByteLengthGetter = + Object.getOwnPropertyDescriptor(DataView.prototype, "byteLength").get; +exports.DataView = (value, options = {}) => { + try { + dvByteLengthGetter.call(value); + } catch (e) { + throw makeException(TypeError, "is not a DataView", options); + } + + if (!options.allowShared && isSharedArrayBuffer(value.buffer)) { + throw makeException(TypeError, "is backed by a SharedArrayBuffer, which is not allowed", options); + } + if (isArrayBufferDetached(value.buffer)) { + throw makeException(TypeError, "is backed by a detached ArrayBuffer", options); + } + + return value; +}; + +// Returns the unforgeable `TypedArray` constructor name or `undefined`, +// if the `this` value isn't a valid `TypedArray` object. +// +// https://tc39.es/ecma262/#sec-get-%typedarray%.prototype-@@tostringtag +const typedArrayNameGetter = Object.getOwnPropertyDescriptor( + Object.getPrototypeOf(Uint8Array).prototype, + Symbol.toStringTag +).get; +[ + Int8Array, + Int16Array, + Int32Array, + Uint8Array, + Uint16Array, + Uint32Array, + Uint8ClampedArray, + Float32Array, + Float64Array +].forEach(func => { + const { name } = func; + const article = /^[AEIOU]/u.test(name) ? "an" : "a"; + exports[name] = (value, options = {}) => { + if (!ArrayBuffer.isView(value) || typedArrayNameGetter.call(value) !== name) { + throw makeException(TypeError, `is not ${article} ${name} object`, options); + } + if (!options.allowShared && isSharedArrayBuffer(value.buffer)) { + throw makeException(TypeError, "is a view on a SharedArrayBuffer, which is not allowed", options); + } + if (isArrayBufferDetached(value.buffer)) { + throw makeException(TypeError, "is a view on a detached ArrayBuffer", options); + } + + return value; + }; +}); + +// Common definitions + +exports.ArrayBufferView = (value, options = {}) => { + if (!ArrayBuffer.isView(value)) { + throw makeException(TypeError, "is not a view on an ArrayBuffer or SharedArrayBuffer", options); + } + + if (!options.allowShared && isSharedArrayBuffer(value.buffer)) { + throw makeException(TypeError, "is a view on a SharedArrayBuffer, which is not allowed", options); + } + + if (isArrayBufferDetached(value.buffer)) { + throw makeException(TypeError, "is a view on a detached ArrayBuffer", options); + } + return value; +}; + +exports.BufferSource = (value, options = {}) => { + if (ArrayBuffer.isView(value)) { + if (!options.allowShared && isSharedArrayBuffer(value.buffer)) { + throw makeException(TypeError, "is a view on a SharedArrayBuffer, which is not allowed", options); + } + + if (isArrayBufferDetached(value.buffer)) { + throw makeException(TypeError, "is a view on a detached ArrayBuffer", options); + } + return value; + } + + if (!options.allowShared && !isNonSharedArrayBuffer(value)) { + throw makeException(TypeError, "is not an ArrayBuffer or a view on one", options); + } + if (options.allowShared && !isSharedArrayBuffer(value) && !isNonSharedArrayBuffer(value)) { + throw makeException(TypeError, "is not an ArrayBuffer, SharedArrayBuffer, or a view on one", options); + } + if (isArrayBufferDetached(value)) { + throw makeException(TypeError, "is a detached ArrayBuffer", options); + } + + return value; +}; + +exports.DOMTimeStamp = exports["unsigned long long"]; diff --git a/node_modules/mongodb-connection-string-url/node_modules/webidl-conversions/package.json b/node_modules/mongodb-connection-string-url/node_modules/webidl-conversions/package.json new file mode 100644 index 000000000..20747bb42 --- /dev/null +++ b/node_modules/mongodb-connection-string-url/node_modules/webidl-conversions/package.json @@ -0,0 +1,35 @@ +{ + "name": "webidl-conversions", + "version": "7.0.0", + "description": "Implements the WebIDL algorithms for converting to and from JavaScript values", + "main": "lib/index.js", + "scripts": { + "lint": "eslint .", + "test": "mocha test/*.js", + "test-no-sab": "mocha --parallel --jobs 2 --require test/helpers/delete-sab.js test/*.js", + "coverage": "nyc mocha test/*.js" + }, + "_scripts_comments": { + "test-no-sab": "Node.js internals are broken by deleting SharedArrayBuffer if you run tests on the main thread. Using Mocha's parallel mode avoids this." + }, + "repository": "jsdom/webidl-conversions", + "keywords": [ + "webidl", + "web", + "types" + ], + "files": [ + "lib/" + ], + "author": "Domenic Denicola (https://domenic.me/)", + "license": "BSD-2-Clause", + "devDependencies": { + "@domenic/eslint-config": "^1.3.0", + "eslint": "^7.32.0", + "mocha": "^9.1.1", + "nyc": "^15.1.0" + }, + "engines": { + "node": ">=12" + } +} diff --git a/node_modules/mongodb-connection-string-url/node_modules/whatwg-url/LICENSE.txt b/node_modules/mongodb-connection-string-url/node_modules/whatwg-url/LICENSE.txt new file mode 100644 index 000000000..8e8c25c3a --- /dev/null +++ b/node_modules/mongodb-connection-string-url/node_modules/whatwg-url/LICENSE.txt @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sebastian Mayr + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/mongodb-connection-string-url/node_modules/whatwg-url/README.md b/node_modules/mongodb-connection-string-url/node_modules/whatwg-url/README.md new file mode 100644 index 000000000..4d089006f --- /dev/null +++ b/node_modules/mongodb-connection-string-url/node_modules/whatwg-url/README.md @@ -0,0 +1,106 @@ +# whatwg-url + +whatwg-url is a full implementation of the WHATWG [URL Standard](https://url.spec.whatwg.org/). It can be used standalone, but it also exposes a lot of the internal algorithms that are useful for integrating a URL parser into a project like [jsdom](https://github.com/jsdom/jsdom). + +## Specification conformance + +whatwg-url is currently up to date with the URL spec up to commit [43c2713](https://github.com/whatwg/url/commit/43c27137a0bc82c4b800fe74be893255fbeb35f4). + +For `file:` URLs, whose [origin is left unspecified](https://url.spec.whatwg.org/#concept-url-origin), whatwg-url chooses to use a new opaque origin (which serializes to `"null"`). + +whatwg-url does not yet implement any encoding handling beyond UTF-8. That is, the _encoding override_ parameter does not exist in our API. + +## API + +### The `URL` and `URLSearchParams` classes + +The main API is provided by the [`URL`](https://url.spec.whatwg.org/#url-class) and [`URLSearchParams`](https://url.spec.whatwg.org/#interface-urlsearchparams) exports, which follows the spec's behavior in all ways (including e.g. `USVString` conversion). Most consumers of this library will want to use these. + +### Low-level URL Standard API + +The following methods are exported for use by places like jsdom that need to implement things like [`HTMLHyperlinkElementUtils`](https://html.spec.whatwg.org/#htmlhyperlinkelementutils). They mostly operate on or return an "internal URL" or ["URL record"](https://url.spec.whatwg.org/#concept-url) type. + +- [URL parser](https://url.spec.whatwg.org/#concept-url-parser): `parseURL(input, { baseURL })` +- [Basic URL parser](https://url.spec.whatwg.org/#concept-basic-url-parser): `basicURLParse(input, { baseURL, url, stateOverride })` +- [URL serializer](https://url.spec.whatwg.org/#concept-url-serializer): `serializeURL(urlRecord, excludeFragment)` +- [Host serializer](https://url.spec.whatwg.org/#concept-host-serializer): `serializeHost(hostFromURLRecord)` +- [URL path serializer](https://url.spec.whatwg.org/#url-path-serializer): `serializePath(urlRecord)` +- [Serialize an integer](https://url.spec.whatwg.org/#serialize-an-integer): `serializeInteger(number)` +- [Origin](https://url.spec.whatwg.org/#concept-url-origin) [serializer](https://html.spec.whatwg.org/multipage/origin.html#ascii-serialisation-of-an-origin): `serializeURLOrigin(urlRecord)` +- [Set the username](https://url.spec.whatwg.org/#set-the-username): `setTheUsername(urlRecord, usernameString)` +- [Set the password](https://url.spec.whatwg.org/#set-the-password): `setThePassword(urlRecord, passwordString)` +- [Has an opaque path](https://url.spec.whatwg.org/#url-opaque-path): `hasAnOpaquePath(urlRecord)` +- [Cannot have a username/password/port](https://url.spec.whatwg.org/#cannot-have-a-username-password-port): `cannotHaveAUsernamePasswordPort(urlRecord)` +- [Percent decode bytes](https://url.spec.whatwg.org/#percent-decode): `percentDecodeBytes(uint8Array)` +- [Percent decode a string](https://url.spec.whatwg.org/#percent-decode-string): `percentDecodeString(string)` + +The `stateOverride` parameter is one of the following strings: + +- [`"scheme start"`](https://url.spec.whatwg.org/#scheme-start-state) +- [`"scheme"`](https://url.spec.whatwg.org/#scheme-state) +- [`"no scheme"`](https://url.spec.whatwg.org/#no-scheme-state) +- [`"special relative or authority"`](https://url.spec.whatwg.org/#special-relative-or-authority-state) +- [`"path or authority"`](https://url.spec.whatwg.org/#path-or-authority-state) +- [`"relative"`](https://url.spec.whatwg.org/#relative-state) +- [`"relative slash"`](https://url.spec.whatwg.org/#relative-slash-state) +- [`"special authority slashes"`](https://url.spec.whatwg.org/#special-authority-slashes-state) +- [`"special authority ignore slashes"`](https://url.spec.whatwg.org/#special-authority-ignore-slashes-state) +- [`"authority"`](https://url.spec.whatwg.org/#authority-state) +- [`"host"`](https://url.spec.whatwg.org/#host-state) +- [`"hostname"`](https://url.spec.whatwg.org/#hostname-state) +- [`"port"`](https://url.spec.whatwg.org/#port-state) +- [`"file"`](https://url.spec.whatwg.org/#file-state) +- [`"file slash"`](https://url.spec.whatwg.org/#file-slash-state) +- [`"file host"`](https://url.spec.whatwg.org/#file-host-state) +- [`"path start"`](https://url.spec.whatwg.org/#path-start-state) +- [`"path"`](https://url.spec.whatwg.org/#path-state) +- [`"opaque path"`](https://url.spec.whatwg.org/#cannot-be-a-base-url-path-state) +- [`"query"`](https://url.spec.whatwg.org/#query-state) +- [`"fragment"`](https://url.spec.whatwg.org/#fragment-state) + +The URL record type has the following API: + +- [`scheme`](https://url.spec.whatwg.org/#concept-url-scheme) +- [`username`](https://url.spec.whatwg.org/#concept-url-username) +- [`password`](https://url.spec.whatwg.org/#concept-url-password) +- [`host`](https://url.spec.whatwg.org/#concept-url-host) +- [`port`](https://url.spec.whatwg.org/#concept-url-port) +- [`path`](https://url.spec.whatwg.org/#concept-url-path) (as an array of strings, or a string) +- [`query`](https://url.spec.whatwg.org/#concept-url-query) +- [`fragment`](https://url.spec.whatwg.org/#concept-url-fragment) + +These properties should be treated with care, as in general changing them will cause the URL record to be in an inconsistent state until the appropriate invocation of `basicURLParse` is used to fix it up. You can see examples of this in the URL Standard, where there are many step sequences like "4. Set context object’s url’s fragment to the empty string. 5. Basic URL parse _input_ with context object’s url as _url_ and fragment state as _state override_." In between those two steps, a URL record is in an unusable state. + +The return value of "failure" in the spec is represented by `null`. That is, functions like `parseURL` and `basicURLParse` can return _either_ a URL record _or_ `null`. + +### `whatwg-url/webidl2js-wrapper` module + +This module exports the `URL` and `URLSearchParams` [interface wrappers API](https://github.com/jsdom/webidl2js#for-interfaces) generated by [webidl2js](https://github.com/jsdom/webidl2js). + +## Development instructions + +First, install [Node.js](https://nodejs.org/). Then, fetch the dependencies of whatwg-url, by running from this directory: + + npm install + +To run tests: + + npm test + +To generate a coverage report: + + npm run coverage + +To build and run the live viewer: + + npm run prepare + npm run build-live-viewer + +Serve the contents of the `live-viewer` directory using any web server. + +## Supporting whatwg-url + +The jsdom project (including whatwg-url) is a community-driven project maintained by a team of [volunteers](https://github.com/orgs/jsdom/people). You could support us by: + +- [Getting professional support for whatwg-url](https://tidelift.com/subscription/pkg/npm-whatwg-url?utm_source=npm-whatwg-url&utm_medium=referral&utm_campaign=readme) as part of a Tidelift subscription. Tidelift helps making open source sustainable for us while giving teams assurances for maintenance, licensing, and security. +- Contributing directly to the project. diff --git a/node_modules/mongodb-connection-string-url/node_modules/whatwg-url/index.js b/node_modules/mongodb-connection-string-url/node_modules/whatwg-url/index.js new file mode 100644 index 000000000..c470e48e4 --- /dev/null +++ b/node_modules/mongodb-connection-string-url/node_modules/whatwg-url/index.js @@ -0,0 +1,27 @@ +"use strict"; + +const { URL, URLSearchParams } = require("./webidl2js-wrapper"); +const urlStateMachine = require("./lib/url-state-machine"); +const percentEncoding = require("./lib/percent-encoding"); + +const sharedGlobalObject = { Array, Object, Promise, String, TypeError }; +URL.install(sharedGlobalObject, ["Window"]); +URLSearchParams.install(sharedGlobalObject, ["Window"]); + +exports.URL = sharedGlobalObject.URL; +exports.URLSearchParams = sharedGlobalObject.URLSearchParams; + +exports.parseURL = urlStateMachine.parseURL; +exports.basicURLParse = urlStateMachine.basicURLParse; +exports.serializeURL = urlStateMachine.serializeURL; +exports.serializePath = urlStateMachine.serializePath; +exports.serializeHost = urlStateMachine.serializeHost; +exports.serializeInteger = urlStateMachine.serializeInteger; +exports.serializeURLOrigin = urlStateMachine.serializeURLOrigin; +exports.setTheUsername = urlStateMachine.setTheUsername; +exports.setThePassword = urlStateMachine.setThePassword; +exports.cannotHaveAUsernamePasswordPort = urlStateMachine.cannotHaveAUsernamePasswordPort; +exports.hasAnOpaquePath = urlStateMachine.hasAnOpaquePath; + +exports.percentDecodeString = percentEncoding.percentDecodeString; +exports.percentDecodeBytes = percentEncoding.percentDecodeBytes; diff --git a/node_modules/mongodb-connection-string-url/node_modules/whatwg-url/lib/Function.js b/node_modules/mongodb-connection-string-url/node_modules/whatwg-url/lib/Function.js new file mode 100644 index 000000000..ea8712fd7 --- /dev/null +++ b/node_modules/mongodb-connection-string-url/node_modules/whatwg-url/lib/Function.js @@ -0,0 +1,42 @@ +"use strict"; + +const conversions = require("webidl-conversions"); +const utils = require("./utils.js"); + +exports.convert = (globalObject, value, { context = "The provided value" } = {}) => { + if (typeof value !== "function") { + throw new globalObject.TypeError(context + " is not a function"); + } + + function invokeTheCallbackFunction(...args) { + const thisArg = utils.tryWrapperForImpl(this); + let callResult; + + for (let i = 0; i < args.length; i++) { + args[i] = utils.tryWrapperForImpl(args[i]); + } + + callResult = Reflect.apply(value, thisArg, args); + + callResult = conversions["any"](callResult, { context: context, globals: globalObject }); + + return callResult; + } + + invokeTheCallbackFunction.construct = (...args) => { + for (let i = 0; i < args.length; i++) { + args[i] = utils.tryWrapperForImpl(args[i]); + } + + let callResult = Reflect.construct(value, args); + + callResult = conversions["any"](callResult, { context: context, globals: globalObject }); + + return callResult; + }; + + invokeTheCallbackFunction[utils.wrapperSymbol] = value; + invokeTheCallbackFunction.objectReference = value; + + return invokeTheCallbackFunction; +}; diff --git a/node_modules/mongodb-connection-string-url/node_modules/whatwg-url/lib/URL-impl.js b/node_modules/mongodb-connection-string-url/node_modules/whatwg-url/lib/URL-impl.js new file mode 100644 index 000000000..db3a0aea0 --- /dev/null +++ b/node_modules/mongodb-connection-string-url/node_modules/whatwg-url/lib/URL-impl.js @@ -0,0 +1,209 @@ +"use strict"; +const usm = require("./url-state-machine"); +const urlencoded = require("./urlencoded"); +const URLSearchParams = require("./URLSearchParams"); + +exports.implementation = class URLImpl { + constructor(globalObject, constructorArgs) { + const url = constructorArgs[0]; + const base = constructorArgs[1]; + + let parsedBase = null; + if (base !== undefined) { + parsedBase = usm.basicURLParse(base); + if (parsedBase === null) { + throw new TypeError(`Invalid base URL: ${base}`); + } + } + + const parsedURL = usm.basicURLParse(url, { baseURL: parsedBase }); + if (parsedURL === null) { + throw new TypeError(`Invalid URL: ${url}`); + } + + const query = parsedURL.query !== null ? parsedURL.query : ""; + + this._url = parsedURL; + + // We cannot invoke the "new URLSearchParams object" algorithm without going through the constructor, which strips + // question mark by default. Therefore the doNotStripQMark hack is used. + this._query = URLSearchParams.createImpl(globalObject, [query], { doNotStripQMark: true }); + this._query._url = this; + } + + get href() { + return usm.serializeURL(this._url); + } + + set href(v) { + const parsedURL = usm.basicURLParse(v); + if (parsedURL === null) { + throw new TypeError(`Invalid URL: ${v}`); + } + + this._url = parsedURL; + + this._query._list.splice(0); + const { query } = parsedURL; + if (query !== null) { + this._query._list = urlencoded.parseUrlencodedString(query); + } + } + + get origin() { + return usm.serializeURLOrigin(this._url); + } + + get protocol() { + return `${this._url.scheme}:`; + } + + set protocol(v) { + usm.basicURLParse(`${v}:`, { url: this._url, stateOverride: "scheme start" }); + } + + get username() { + return this._url.username; + } + + set username(v) { + if (usm.cannotHaveAUsernamePasswordPort(this._url)) { + return; + } + + usm.setTheUsername(this._url, v); + } + + get password() { + return this._url.password; + } + + set password(v) { + if (usm.cannotHaveAUsernamePasswordPort(this._url)) { + return; + } + + usm.setThePassword(this._url, v); + } + + get host() { + const url = this._url; + + if (url.host === null) { + return ""; + } + + if (url.port === null) { + return usm.serializeHost(url.host); + } + + return `${usm.serializeHost(url.host)}:${usm.serializeInteger(url.port)}`; + } + + set host(v) { + if (usm.hasAnOpaquePath(this._url)) { + return; + } + + usm.basicURLParse(v, { url: this._url, stateOverride: "host" }); + } + + get hostname() { + if (this._url.host === null) { + return ""; + } + + return usm.serializeHost(this._url.host); + } + + set hostname(v) { + if (usm.hasAnOpaquePath(this._url)) { + return; + } + + usm.basicURLParse(v, { url: this._url, stateOverride: "hostname" }); + } + + get port() { + if (this._url.port === null) { + return ""; + } + + return usm.serializeInteger(this._url.port); + } + + set port(v) { + if (usm.cannotHaveAUsernamePasswordPort(this._url)) { + return; + } + + if (v === "") { + this._url.port = null; + } else { + usm.basicURLParse(v, { url: this._url, stateOverride: "port" }); + } + } + + get pathname() { + return usm.serializePath(this._url); + } + + set pathname(v) { + if (usm.hasAnOpaquePath(this._url)) { + return; + } + + this._url.path = []; + usm.basicURLParse(v, { url: this._url, stateOverride: "path start" }); + } + + get search() { + if (this._url.query === null || this._url.query === "") { + return ""; + } + + return `?${this._url.query}`; + } + + set search(v) { + const url = this._url; + + if (v === "") { + url.query = null; + this._query._list = []; + return; + } + + const input = v[0] === "?" ? v.substring(1) : v; + url.query = ""; + usm.basicURLParse(input, { url, stateOverride: "query" }); + this._query._list = urlencoded.parseUrlencodedString(input); + } + + get searchParams() { + return this._query; + } + + get hash() { + if (this._url.fragment === null || this._url.fragment === "") { + return ""; + } + + return `#${this._url.fragment}`; + } + + set hash(v) { + if (v === "") { + this._url.fragment = null; + return; + } + + const input = v[0] === "#" ? v.substring(1) : v; + this._url.fragment = ""; + usm.basicURLParse(input, { url: this._url, stateOverride: "fragment" }); + } + + toJSON() { + return this.href; + } +}; diff --git a/node_modules/mongodb-connection-string-url/node_modules/whatwg-url/lib/URL.js b/node_modules/mongodb-connection-string-url/node_modules/whatwg-url/lib/URL.js new file mode 100644 index 000000000..d62ac3e76 --- /dev/null +++ b/node_modules/mongodb-connection-string-url/node_modules/whatwg-url/lib/URL.js @@ -0,0 +1,442 @@ +"use strict"; + +const conversions = require("webidl-conversions"); +const utils = require("./utils.js"); + +const implSymbol = utils.implSymbol; +const ctorRegistrySymbol = utils.ctorRegistrySymbol; + +const interfaceName = "URL"; + +exports.is = value => { + return utils.isObject(value) && utils.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; +}; +exports.isImpl = value => { + return utils.isObject(value) && value instanceof Impl.implementation; +}; +exports.convert = (globalObject, value, { context = "The provided value" } = {}) => { + if (exports.is(value)) { + return utils.implForWrapper(value); + } + throw new globalObject.TypeError(`${context} is not of type 'URL'.`); +}; + +function makeWrapper(globalObject, newTarget) { + let proto; + if (newTarget !== undefined) { + proto = newTarget.prototype; + } + + if (!utils.isObject(proto)) { + proto = globalObject[ctorRegistrySymbol]["URL"].prototype; + } + + return Object.create(proto); +} + +exports.create = (globalObject, constructorArgs, privateData) => { + const wrapper = makeWrapper(globalObject); + return exports.setup(wrapper, globalObject, constructorArgs, privateData); +}; + +exports.createImpl = (globalObject, constructorArgs, privateData) => { + const wrapper = exports.create(globalObject, constructorArgs, privateData); + return utils.implForWrapper(wrapper); +}; + +exports._internalSetup = (wrapper, globalObject) => {}; + +exports.setup = (wrapper, globalObject, constructorArgs = [], privateData = {}) => { + privateData.wrapper = wrapper; + + exports._internalSetup(wrapper, globalObject); + Object.defineProperty(wrapper, implSymbol, { + value: new Impl.implementation(globalObject, constructorArgs, privateData), + configurable: true + }); + + wrapper[implSymbol][utils.wrapperSymbol] = wrapper; + if (Impl.init) { + Impl.init(wrapper[implSymbol]); + } + return wrapper; +}; + +exports.new = (globalObject, newTarget) => { + const wrapper = makeWrapper(globalObject, newTarget); + + exports._internalSetup(wrapper, globalObject); + Object.defineProperty(wrapper, implSymbol, { + value: Object.create(Impl.implementation.prototype), + configurable: true + }); + + wrapper[implSymbol][utils.wrapperSymbol] = wrapper; + if (Impl.init) { + Impl.init(wrapper[implSymbol]); + } + return wrapper[implSymbol]; +}; + +const exposed = new Set(["Window", "Worker"]); + +exports.install = (globalObject, globalNames) => { + if (!globalNames.some(globalName => exposed.has(globalName))) { + return; + } + + const ctorRegistry = utils.initCtorRegistry(globalObject); + class URL { + constructor(url) { + if (arguments.length < 1) { + throw new globalObject.TypeError( + `Failed to construct 'URL': 1 argument required, but only ${arguments.length} present.` + ); + } + const args = []; + { + let curArg = arguments[0]; + curArg = conversions["USVString"](curArg, { + context: "Failed to construct 'URL': parameter 1", + globals: globalObject + }); + args.push(curArg); + } + { + let curArg = arguments[1]; + if (curArg !== undefined) { + curArg = conversions["USVString"](curArg, { + context: "Failed to construct 'URL': parameter 2", + globals: globalObject + }); + } + args.push(curArg); + } + return exports.setup(Object.create(new.target.prototype), globalObject, args); + } + + toJSON() { + const esValue = this !== null && this !== undefined ? this : globalObject; + if (!exports.is(esValue)) { + throw new globalObject.TypeError("'toJSON' called on an object that is not a valid instance of URL."); + } + + return esValue[implSymbol].toJSON(); + } + + get href() { + const esValue = this !== null && this !== undefined ? this : globalObject; + + if (!exports.is(esValue)) { + throw new globalObject.TypeError("'get href' called on an object that is not a valid instance of URL."); + } + + return esValue[implSymbol]["href"]; + } + + set href(V) { + const esValue = this !== null && this !== undefined ? this : globalObject; + + if (!exports.is(esValue)) { + throw new globalObject.TypeError("'set href' called on an object that is not a valid instance of URL."); + } + + V = conversions["USVString"](V, { + context: "Failed to set the 'href' property on 'URL': The provided value", + globals: globalObject + }); + + esValue[implSymbol]["href"] = V; + } + + toString() { + const esValue = this; + if (!exports.is(esValue)) { + throw new globalObject.TypeError("'toString' called on an object that is not a valid instance of URL."); + } + + return esValue[implSymbol]["href"]; + } + + get origin() { + const esValue = this !== null && this !== undefined ? this : globalObject; + + if (!exports.is(esValue)) { + throw new globalObject.TypeError("'get origin' called on an object that is not a valid instance of URL."); + } + + return esValue[implSymbol]["origin"]; + } + + get protocol() { + const esValue = this !== null && this !== undefined ? this : globalObject; + + if (!exports.is(esValue)) { + throw new globalObject.TypeError("'get protocol' called on an object that is not a valid instance of URL."); + } + + return esValue[implSymbol]["protocol"]; + } + + set protocol(V) { + const esValue = this !== null && this !== undefined ? this : globalObject; + + if (!exports.is(esValue)) { + throw new globalObject.TypeError("'set protocol' called on an object that is not a valid instance of URL."); + } + + V = conversions["USVString"](V, { + context: "Failed to set the 'protocol' property on 'URL': The provided value", + globals: globalObject + }); + + esValue[implSymbol]["protocol"] = V; + } + + get username() { + const esValue = this !== null && this !== undefined ? this : globalObject; + + if (!exports.is(esValue)) { + throw new globalObject.TypeError("'get username' called on an object that is not a valid instance of URL."); + } + + return esValue[implSymbol]["username"]; + } + + set username(V) { + const esValue = this !== null && this !== undefined ? this : globalObject; + + if (!exports.is(esValue)) { + throw new globalObject.TypeError("'set username' called on an object that is not a valid instance of URL."); + } + + V = conversions["USVString"](V, { + context: "Failed to set the 'username' property on 'URL': The provided value", + globals: globalObject + }); + + esValue[implSymbol]["username"] = V; + } + + get password() { + const esValue = this !== null && this !== undefined ? this : globalObject; + + if (!exports.is(esValue)) { + throw new globalObject.TypeError("'get password' called on an object that is not a valid instance of URL."); + } + + return esValue[implSymbol]["password"]; + } + + set password(V) { + const esValue = this !== null && this !== undefined ? this : globalObject; + + if (!exports.is(esValue)) { + throw new globalObject.TypeError("'set password' called on an object that is not a valid instance of URL."); + } + + V = conversions["USVString"](V, { + context: "Failed to set the 'password' property on 'URL': The provided value", + globals: globalObject + }); + + esValue[implSymbol]["password"] = V; + } + + get host() { + const esValue = this !== null && this !== undefined ? this : globalObject; + + if (!exports.is(esValue)) { + throw new globalObject.TypeError("'get host' called on an object that is not a valid instance of URL."); + } + + return esValue[implSymbol]["host"]; + } + + set host(V) { + const esValue = this !== null && this !== undefined ? this : globalObject; + + if (!exports.is(esValue)) { + throw new globalObject.TypeError("'set host' called on an object that is not a valid instance of URL."); + } + + V = conversions["USVString"](V, { + context: "Failed to set the 'host' property on 'URL': The provided value", + globals: globalObject + }); + + esValue[implSymbol]["host"] = V; + } + + get hostname() { + const esValue = this !== null && this !== undefined ? this : globalObject; + + if (!exports.is(esValue)) { + throw new globalObject.TypeError("'get hostname' called on an object that is not a valid instance of URL."); + } + + return esValue[implSymbol]["hostname"]; + } + + set hostname(V) { + const esValue = this !== null && this !== undefined ? this : globalObject; + + if (!exports.is(esValue)) { + throw new globalObject.TypeError("'set hostname' called on an object that is not a valid instance of URL."); + } + + V = conversions["USVString"](V, { + context: "Failed to set the 'hostname' property on 'URL': The provided value", + globals: globalObject + }); + + esValue[implSymbol]["hostname"] = V; + } + + get port() { + const esValue = this !== null && this !== undefined ? this : globalObject; + + if (!exports.is(esValue)) { + throw new globalObject.TypeError("'get port' called on an object that is not a valid instance of URL."); + } + + return esValue[implSymbol]["port"]; + } + + set port(V) { + const esValue = this !== null && this !== undefined ? this : globalObject; + + if (!exports.is(esValue)) { + throw new globalObject.TypeError("'set port' called on an object that is not a valid instance of URL."); + } + + V = conversions["USVString"](V, { + context: "Failed to set the 'port' property on 'URL': The provided value", + globals: globalObject + }); + + esValue[implSymbol]["port"] = V; + } + + get pathname() { + const esValue = this !== null && this !== undefined ? this : globalObject; + + if (!exports.is(esValue)) { + throw new globalObject.TypeError("'get pathname' called on an object that is not a valid instance of URL."); + } + + return esValue[implSymbol]["pathname"]; + } + + set pathname(V) { + const esValue = this !== null && this !== undefined ? this : globalObject; + + if (!exports.is(esValue)) { + throw new globalObject.TypeError("'set pathname' called on an object that is not a valid instance of URL."); + } + + V = conversions["USVString"](V, { + context: "Failed to set the 'pathname' property on 'URL': The provided value", + globals: globalObject + }); + + esValue[implSymbol]["pathname"] = V; + } + + get search() { + const esValue = this !== null && this !== undefined ? this : globalObject; + + if (!exports.is(esValue)) { + throw new globalObject.TypeError("'get search' called on an object that is not a valid instance of URL."); + } + + return esValue[implSymbol]["search"]; + } + + set search(V) { + const esValue = this !== null && this !== undefined ? this : globalObject; + + if (!exports.is(esValue)) { + throw new globalObject.TypeError("'set search' called on an object that is not a valid instance of URL."); + } + + V = conversions["USVString"](V, { + context: "Failed to set the 'search' property on 'URL': The provided value", + globals: globalObject + }); + + esValue[implSymbol]["search"] = V; + } + + get searchParams() { + const esValue = this !== null && this !== undefined ? this : globalObject; + + if (!exports.is(esValue)) { + throw new globalObject.TypeError("'get searchParams' called on an object that is not a valid instance of URL."); + } + + return utils.getSameObject(this, "searchParams", () => { + return utils.tryWrapperForImpl(esValue[implSymbol]["searchParams"]); + }); + } + + get hash() { + const esValue = this !== null && this !== undefined ? this : globalObject; + + if (!exports.is(esValue)) { + throw new globalObject.TypeError("'get hash' called on an object that is not a valid instance of URL."); + } + + return esValue[implSymbol]["hash"]; + } + + set hash(V) { + const esValue = this !== null && this !== undefined ? this : globalObject; + + if (!exports.is(esValue)) { + throw new globalObject.TypeError("'set hash' called on an object that is not a valid instance of URL."); + } + + V = conversions["USVString"](V, { + context: "Failed to set the 'hash' property on 'URL': The provided value", + globals: globalObject + }); + + esValue[implSymbol]["hash"] = V; + } + } + Object.defineProperties(URL.prototype, { + toJSON: { enumerable: true }, + href: { enumerable: true }, + toString: { enumerable: true }, + origin: { enumerable: true }, + protocol: { enumerable: true }, + username: { enumerable: true }, + password: { enumerable: true }, + host: { enumerable: true }, + hostname: { enumerable: true }, + port: { enumerable: true }, + pathname: { enumerable: true }, + search: { enumerable: true }, + searchParams: { enumerable: true }, + hash: { enumerable: true }, + [Symbol.toStringTag]: { value: "URL", configurable: true } + }); + ctorRegistry[interfaceName] = URL; + + Object.defineProperty(globalObject, interfaceName, { + configurable: true, + writable: true, + value: URL + }); + + if (globalNames.includes("Window")) { + Object.defineProperty(globalObject, "webkitURL", { + configurable: true, + writable: true, + value: URL + }); + } +}; + +const Impl = require("./URL-impl.js"); diff --git a/node_modules/mongodb-connection-string-url/node_modules/whatwg-url/lib/URLSearchParams-impl.js b/node_modules/mongodb-connection-string-url/node_modules/whatwg-url/lib/URLSearchParams-impl.js new file mode 100644 index 000000000..ef8d604ed --- /dev/null +++ b/node_modules/mongodb-connection-string-url/node_modules/whatwg-url/lib/URLSearchParams-impl.js @@ -0,0 +1,130 @@ +"use strict"; +const urlencoded = require("./urlencoded"); + +exports.implementation = class URLSearchParamsImpl { + constructor(globalObject, constructorArgs, { doNotStripQMark = false }) { + let init = constructorArgs[0]; + this._list = []; + this._url = null; + + if (!doNotStripQMark && typeof init === "string" && init[0] === "?") { + init = init.slice(1); + } + + if (Array.isArray(init)) { + for (const pair of init) { + if (pair.length !== 2) { + throw new TypeError("Failed to construct 'URLSearchParams': parameter 1 sequence's element does not " + + "contain exactly two elements."); + } + this._list.push([pair[0], pair[1]]); + } + } else if (typeof init === "object" && Object.getPrototypeOf(init) === null) { + for (const name of Object.keys(init)) { + const value = init[name]; + this._list.push([name, value]); + } + } else { + this._list = urlencoded.parseUrlencodedString(init); + } + } + + _updateSteps() { + if (this._url !== null) { + let query = urlencoded.serializeUrlencoded(this._list); + if (query === "") { + query = null; + } + this._url._url.query = query; + } + } + + append(name, value) { + this._list.push([name, value]); + this._updateSteps(); + } + + delete(name) { + let i = 0; + while (i < this._list.length) { + if (this._list[i][0] === name) { + this._list.splice(i, 1); + } else { + i++; + } + } + this._updateSteps(); + } + + get(name) { + for (const tuple of this._list) { + if (tuple[0] === name) { + return tuple[1]; + } + } + return null; + } + + getAll(name) { + const output = []; + for (const tuple of this._list) { + if (tuple[0] === name) { + output.push(tuple[1]); + } + } + return output; + } + + has(name) { + for (const tuple of this._list) { + if (tuple[0] === name) { + return true; + } + } + return false; + } + + set(name, value) { + let found = false; + let i = 0; + while (i < this._list.length) { + if (this._list[i][0] === name) { + if (found) { + this._list.splice(i, 1); + } else { + found = true; + this._list[i][1] = value; + i++; + } + } else { + i++; + } + } + if (!found) { + this._list.push([name, value]); + } + this._updateSteps(); + } + + sort() { + this._list.sort((a, b) => { + if (a[0] < b[0]) { + return -1; + } + if (a[0] > b[0]) { + return 1; + } + return 0; + }); + + this._updateSteps(); + } + + [Symbol.iterator]() { + return this._list[Symbol.iterator](); + } + + toString() { + return urlencoded.serializeUrlencoded(this._list); + } +}; diff --git a/node_modules/mongodb-connection-string-url/node_modules/whatwg-url/lib/URLSearchParams.js b/node_modules/mongodb-connection-string-url/node_modules/whatwg-url/lib/URLSearchParams.js new file mode 100644 index 000000000..a7c24eff8 --- /dev/null +++ b/node_modules/mongodb-connection-string-url/node_modules/whatwg-url/lib/URLSearchParams.js @@ -0,0 +1,472 @@ +"use strict"; + +const conversions = require("webidl-conversions"); +const utils = require("./utils.js"); + +const Function = require("./Function.js"); +const newObjectInRealm = utils.newObjectInRealm; +const implSymbol = utils.implSymbol; +const ctorRegistrySymbol = utils.ctorRegistrySymbol; + +const interfaceName = "URLSearchParams"; + +exports.is = value => { + return utils.isObject(value) && utils.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; +}; +exports.isImpl = value => { + return utils.isObject(value) && value instanceof Impl.implementation; +}; +exports.convert = (globalObject, value, { context = "The provided value" } = {}) => { + if (exports.is(value)) { + return utils.implForWrapper(value); + } + throw new globalObject.TypeError(`${context} is not of type 'URLSearchParams'.`); +}; + +exports.createDefaultIterator = (globalObject, target, kind) => { + const ctorRegistry = globalObject[ctorRegistrySymbol]; + const iteratorPrototype = ctorRegistry["URLSearchParams Iterator"]; + const iterator = Object.create(iteratorPrototype); + Object.defineProperty(iterator, utils.iterInternalSymbol, { + value: { target, kind, index: 0 }, + configurable: true + }); + return iterator; +}; + +function makeWrapper(globalObject, newTarget) { + let proto; + if (newTarget !== undefined) { + proto = newTarget.prototype; + } + + if (!utils.isObject(proto)) { + proto = globalObject[ctorRegistrySymbol]["URLSearchParams"].prototype; + } + + return Object.create(proto); +} + +exports.create = (globalObject, constructorArgs, privateData) => { + const wrapper = makeWrapper(globalObject); + return exports.setup(wrapper, globalObject, constructorArgs, privateData); +}; + +exports.createImpl = (globalObject, constructorArgs, privateData) => { + const wrapper = exports.create(globalObject, constructorArgs, privateData); + return utils.implForWrapper(wrapper); +}; + +exports._internalSetup = (wrapper, globalObject) => {}; + +exports.setup = (wrapper, globalObject, constructorArgs = [], privateData = {}) => { + privateData.wrapper = wrapper; + + exports._internalSetup(wrapper, globalObject); + Object.defineProperty(wrapper, implSymbol, { + value: new Impl.implementation(globalObject, constructorArgs, privateData), + configurable: true + }); + + wrapper[implSymbol][utils.wrapperSymbol] = wrapper; + if (Impl.init) { + Impl.init(wrapper[implSymbol]); + } + return wrapper; +}; + +exports.new = (globalObject, newTarget) => { + const wrapper = makeWrapper(globalObject, newTarget); + + exports._internalSetup(wrapper, globalObject); + Object.defineProperty(wrapper, implSymbol, { + value: Object.create(Impl.implementation.prototype), + configurable: true + }); + + wrapper[implSymbol][utils.wrapperSymbol] = wrapper; + if (Impl.init) { + Impl.init(wrapper[implSymbol]); + } + return wrapper[implSymbol]; +}; + +const exposed = new Set(["Window", "Worker"]); + +exports.install = (globalObject, globalNames) => { + if (!globalNames.some(globalName => exposed.has(globalName))) { + return; + } + + const ctorRegistry = utils.initCtorRegistry(globalObject); + class URLSearchParams { + constructor() { + const args = []; + { + let curArg = arguments[0]; + if (curArg !== undefined) { + if (utils.isObject(curArg)) { + if (curArg[Symbol.iterator] !== undefined) { + if (!utils.isObject(curArg)) { + throw new globalObject.TypeError( + "Failed to construct 'URLSearchParams': parameter 1" + " sequence" + " is not an iterable object." + ); + } else { + const V = []; + const tmp = curArg; + for (let nextItem of tmp) { + if (!utils.isObject(nextItem)) { + throw new globalObject.TypeError( + "Failed to construct 'URLSearchParams': parameter 1" + + " sequence" + + "'s element" + + " is not an iterable object." + ); + } else { + const V = []; + const tmp = nextItem; + for (let nextItem of tmp) { + nextItem = conversions["USVString"](nextItem, { + context: + "Failed to construct 'URLSearchParams': parameter 1" + + " sequence" + + "'s element" + + "'s element", + globals: globalObject + }); + + V.push(nextItem); + } + nextItem = V; + } + + V.push(nextItem); + } + curArg = V; + } + } else { + if (!utils.isObject(curArg)) { + throw new globalObject.TypeError( + "Failed to construct 'URLSearchParams': parameter 1" + " record" + " is not an object." + ); + } else { + const result = Object.create(null); + for (const key of Reflect.ownKeys(curArg)) { + const desc = Object.getOwnPropertyDescriptor(curArg, key); + if (desc && desc.enumerable) { + let typedKey = key; + + typedKey = conversions["USVString"](typedKey, { + context: "Failed to construct 'URLSearchParams': parameter 1" + " record" + "'s key", + globals: globalObject + }); + + let typedValue = curArg[key]; + + typedValue = conversions["USVString"](typedValue, { + context: "Failed to construct 'URLSearchParams': parameter 1" + " record" + "'s value", + globals: globalObject + }); + + result[typedKey] = typedValue; + } + } + curArg = result; + } + } + } else { + curArg = conversions["USVString"](curArg, { + context: "Failed to construct 'URLSearchParams': parameter 1", + globals: globalObject + }); + } + } else { + curArg = ""; + } + args.push(curArg); + } + return exports.setup(Object.create(new.target.prototype), globalObject, args); + } + + append(name, value) { + const esValue = this !== null && this !== undefined ? this : globalObject; + if (!exports.is(esValue)) { + throw new globalObject.TypeError( + "'append' called on an object that is not a valid instance of URLSearchParams." + ); + } + + if (arguments.length < 2) { + throw new globalObject.TypeError( + `Failed to execute 'append' on 'URLSearchParams': 2 arguments required, but only ${arguments.length} present.` + ); + } + const args = []; + { + let curArg = arguments[0]; + curArg = conversions["USVString"](curArg, { + context: "Failed to execute 'append' on 'URLSearchParams': parameter 1", + globals: globalObject + }); + args.push(curArg); + } + { + let curArg = arguments[1]; + curArg = conversions["USVString"](curArg, { + context: "Failed to execute 'append' on 'URLSearchParams': parameter 2", + globals: globalObject + }); + args.push(curArg); + } + return utils.tryWrapperForImpl(esValue[implSymbol].append(...args)); + } + + delete(name) { + const esValue = this !== null && this !== undefined ? this : globalObject; + if (!exports.is(esValue)) { + throw new globalObject.TypeError( + "'delete' called on an object that is not a valid instance of URLSearchParams." + ); + } + + if (arguments.length < 1) { + throw new globalObject.TypeError( + `Failed to execute 'delete' on 'URLSearchParams': 1 argument required, but only ${arguments.length} present.` + ); + } + const args = []; + { + let curArg = arguments[0]; + curArg = conversions["USVString"](curArg, { + context: "Failed to execute 'delete' on 'URLSearchParams': parameter 1", + globals: globalObject + }); + args.push(curArg); + } + return utils.tryWrapperForImpl(esValue[implSymbol].delete(...args)); + } + + get(name) { + const esValue = this !== null && this !== undefined ? this : globalObject; + if (!exports.is(esValue)) { + throw new globalObject.TypeError("'get' called on an object that is not a valid instance of URLSearchParams."); + } + + if (arguments.length < 1) { + throw new globalObject.TypeError( + `Failed to execute 'get' on 'URLSearchParams': 1 argument required, but only ${arguments.length} present.` + ); + } + const args = []; + { + let curArg = arguments[0]; + curArg = conversions["USVString"](curArg, { + context: "Failed to execute 'get' on 'URLSearchParams': parameter 1", + globals: globalObject + }); + args.push(curArg); + } + return esValue[implSymbol].get(...args); + } + + getAll(name) { + const esValue = this !== null && this !== undefined ? this : globalObject; + if (!exports.is(esValue)) { + throw new globalObject.TypeError( + "'getAll' called on an object that is not a valid instance of URLSearchParams." + ); + } + + if (arguments.length < 1) { + throw new globalObject.TypeError( + `Failed to execute 'getAll' on 'URLSearchParams': 1 argument required, but only ${arguments.length} present.` + ); + } + const args = []; + { + let curArg = arguments[0]; + curArg = conversions["USVString"](curArg, { + context: "Failed to execute 'getAll' on 'URLSearchParams': parameter 1", + globals: globalObject + }); + args.push(curArg); + } + return utils.tryWrapperForImpl(esValue[implSymbol].getAll(...args)); + } + + has(name) { + const esValue = this !== null && this !== undefined ? this : globalObject; + if (!exports.is(esValue)) { + throw new globalObject.TypeError("'has' called on an object that is not a valid instance of URLSearchParams."); + } + + if (arguments.length < 1) { + throw new globalObject.TypeError( + `Failed to execute 'has' on 'URLSearchParams': 1 argument required, but only ${arguments.length} present.` + ); + } + const args = []; + { + let curArg = arguments[0]; + curArg = conversions["USVString"](curArg, { + context: "Failed to execute 'has' on 'URLSearchParams': parameter 1", + globals: globalObject + }); + args.push(curArg); + } + return esValue[implSymbol].has(...args); + } + + set(name, value) { + const esValue = this !== null && this !== undefined ? this : globalObject; + if (!exports.is(esValue)) { + throw new globalObject.TypeError("'set' called on an object that is not a valid instance of URLSearchParams."); + } + + if (arguments.length < 2) { + throw new globalObject.TypeError( + `Failed to execute 'set' on 'URLSearchParams': 2 arguments required, but only ${arguments.length} present.` + ); + } + const args = []; + { + let curArg = arguments[0]; + curArg = conversions["USVString"](curArg, { + context: "Failed to execute 'set' on 'URLSearchParams': parameter 1", + globals: globalObject + }); + args.push(curArg); + } + { + let curArg = arguments[1]; + curArg = conversions["USVString"](curArg, { + context: "Failed to execute 'set' on 'URLSearchParams': parameter 2", + globals: globalObject + }); + args.push(curArg); + } + return utils.tryWrapperForImpl(esValue[implSymbol].set(...args)); + } + + sort() { + const esValue = this !== null && this !== undefined ? this : globalObject; + if (!exports.is(esValue)) { + throw new globalObject.TypeError("'sort' called on an object that is not a valid instance of URLSearchParams."); + } + + return utils.tryWrapperForImpl(esValue[implSymbol].sort()); + } + + toString() { + const esValue = this !== null && this !== undefined ? this : globalObject; + if (!exports.is(esValue)) { + throw new globalObject.TypeError( + "'toString' called on an object that is not a valid instance of URLSearchParams." + ); + } + + return esValue[implSymbol].toString(); + } + + keys() { + if (!exports.is(this)) { + throw new globalObject.TypeError("'keys' called on an object that is not a valid instance of URLSearchParams."); + } + return exports.createDefaultIterator(globalObject, this, "key"); + } + + values() { + if (!exports.is(this)) { + throw new globalObject.TypeError( + "'values' called on an object that is not a valid instance of URLSearchParams." + ); + } + return exports.createDefaultIterator(globalObject, this, "value"); + } + + entries() { + if (!exports.is(this)) { + throw new globalObject.TypeError( + "'entries' called on an object that is not a valid instance of URLSearchParams." + ); + } + return exports.createDefaultIterator(globalObject, this, "key+value"); + } + + forEach(callback) { + if (!exports.is(this)) { + throw new globalObject.TypeError( + "'forEach' called on an object that is not a valid instance of URLSearchParams." + ); + } + if (arguments.length < 1) { + throw new globalObject.TypeError( + "Failed to execute 'forEach' on 'iterable': 1 argument required, but only 0 present." + ); + } + callback = Function.convert(globalObject, callback, { + context: "Failed to execute 'forEach' on 'iterable': The callback provided as parameter 1" + }); + const thisArg = arguments[1]; + let pairs = Array.from(this[implSymbol]); + let i = 0; + while (i < pairs.length) { + const [key, value] = pairs[i].map(utils.tryWrapperForImpl); + callback.call(thisArg, value, key, this); + pairs = Array.from(this[implSymbol]); + i++; + } + } + } + Object.defineProperties(URLSearchParams.prototype, { + append: { enumerable: true }, + delete: { enumerable: true }, + get: { enumerable: true }, + getAll: { enumerable: true }, + has: { enumerable: true }, + set: { enumerable: true }, + sort: { enumerable: true }, + toString: { enumerable: true }, + keys: { enumerable: true }, + values: { enumerable: true }, + entries: { enumerable: true }, + forEach: { enumerable: true }, + [Symbol.toStringTag]: { value: "URLSearchParams", configurable: true }, + [Symbol.iterator]: { value: URLSearchParams.prototype.entries, configurable: true, writable: true } + }); + ctorRegistry[interfaceName] = URLSearchParams; + + ctorRegistry["URLSearchParams Iterator"] = Object.create(ctorRegistry["%IteratorPrototype%"], { + [Symbol.toStringTag]: { + configurable: true, + value: "URLSearchParams Iterator" + } + }); + utils.define(ctorRegistry["URLSearchParams Iterator"], { + next() { + const internal = this && this[utils.iterInternalSymbol]; + if (!internal) { + throw new globalObject.TypeError("next() called on a value that is not a URLSearchParams iterator object"); + } + + const { target, kind, index } = internal; + const values = Array.from(target[implSymbol]); + const len = values.length; + if (index >= len) { + return newObjectInRealm(globalObject, { value: undefined, done: true }); + } + + const pair = values[index]; + internal.index = index + 1; + return newObjectInRealm(globalObject, utils.iteratorResult(pair.map(utils.tryWrapperForImpl), kind)); + } + }); + + Object.defineProperty(globalObject, interfaceName, { + configurable: true, + writable: true, + value: URLSearchParams + }); +}; + +const Impl = require("./URLSearchParams-impl.js"); diff --git a/node_modules/mongodb-connection-string-url/node_modules/whatwg-url/lib/VoidFunction.js b/node_modules/mongodb-connection-string-url/node_modules/whatwg-url/lib/VoidFunction.js new file mode 100644 index 000000000..9a00672a7 --- /dev/null +++ b/node_modules/mongodb-connection-string-url/node_modules/whatwg-url/lib/VoidFunction.js @@ -0,0 +1,26 @@ +"use strict"; + +const conversions = require("webidl-conversions"); +const utils = require("./utils.js"); + +exports.convert = (globalObject, value, { context = "The provided value" } = {}) => { + if (typeof value !== "function") { + throw new globalObject.TypeError(context + " is not a function"); + } + + function invokeTheCallbackFunction() { + const thisArg = utils.tryWrapperForImpl(this); + let callResult; + + callResult = Reflect.apply(value, thisArg, []); + } + + invokeTheCallbackFunction.construct = () => { + let callResult = Reflect.construct(value, []); + }; + + invokeTheCallbackFunction[utils.wrapperSymbol] = value; + invokeTheCallbackFunction.objectReference = value; + + return invokeTheCallbackFunction; +}; diff --git a/node_modules/mongodb-connection-string-url/node_modules/whatwg-url/lib/encoding.js b/node_modules/mongodb-connection-string-url/node_modules/whatwg-url/lib/encoding.js new file mode 100644 index 000000000..cb66b8f10 --- /dev/null +++ b/node_modules/mongodb-connection-string-url/node_modules/whatwg-url/lib/encoding.js @@ -0,0 +1,16 @@ +"use strict"; +const utf8Encoder = new TextEncoder(); +const utf8Decoder = new TextDecoder("utf-8", { ignoreBOM: true }); + +function utf8Encode(string) { + return utf8Encoder.encode(string); +} + +function utf8DecodeWithoutBOM(bytes) { + return utf8Decoder.decode(bytes); +} + +module.exports = { + utf8Encode, + utf8DecodeWithoutBOM +}; diff --git a/node_modules/mongodb-connection-string-url/node_modules/whatwg-url/lib/infra.js b/node_modules/mongodb-connection-string-url/node_modules/whatwg-url/lib/infra.js new file mode 100644 index 000000000..4a984a3b3 --- /dev/null +++ b/node_modules/mongodb-connection-string-url/node_modules/whatwg-url/lib/infra.js @@ -0,0 +1,26 @@ +"use strict"; + +// Note that we take code points as JS numbers, not JS strings. + +function isASCIIDigit(c) { + return c >= 0x30 && c <= 0x39; +} + +function isASCIIAlpha(c) { + return (c >= 0x41 && c <= 0x5A) || (c >= 0x61 && c <= 0x7A); +} + +function isASCIIAlphanumeric(c) { + return isASCIIAlpha(c) || isASCIIDigit(c); +} + +function isASCIIHex(c) { + return isASCIIDigit(c) || (c >= 0x41 && c <= 0x46) || (c >= 0x61 && c <= 0x66); +} + +module.exports = { + isASCIIDigit, + isASCIIAlpha, + isASCIIAlphanumeric, + isASCIIHex +}; diff --git a/node_modules/mongodb-connection-string-url/node_modules/whatwg-url/lib/percent-encoding.js b/node_modules/mongodb-connection-string-url/node_modules/whatwg-url/lib/percent-encoding.js new file mode 100644 index 000000000..f8308673c --- /dev/null +++ b/node_modules/mongodb-connection-string-url/node_modules/whatwg-url/lib/percent-encoding.js @@ -0,0 +1,142 @@ +"use strict"; +const { isASCIIHex } = require("./infra"); +const { utf8Encode } = require("./encoding"); + +function p(char) { + return char.codePointAt(0); +} + +// https://url.spec.whatwg.org/#percent-encode +function percentEncode(c) { + let hex = c.toString(16).toUpperCase(); + if (hex.length === 1) { + hex = `0${hex}`; + } + + return `%${hex}`; +} + +// https://url.spec.whatwg.org/#percent-decode +function percentDecodeBytes(input) { + const output = new Uint8Array(input.byteLength); + let outputIndex = 0; + for (let i = 0; i < input.byteLength; ++i) { + const byte = input[i]; + if (byte !== 0x25) { + output[outputIndex++] = byte; + } else if (byte === 0x25 && (!isASCIIHex(input[i + 1]) || !isASCIIHex(input[i + 2]))) { + output[outputIndex++] = byte; + } else { + const bytePoint = parseInt(String.fromCodePoint(input[i + 1], input[i + 2]), 16); + output[outputIndex++] = bytePoint; + i += 2; + } + } + + return output.slice(0, outputIndex); +} + +// https://url.spec.whatwg.org/#string-percent-decode +function percentDecodeString(input) { + const bytes = utf8Encode(input); + return percentDecodeBytes(bytes); +} + +// https://url.spec.whatwg.org/#c0-control-percent-encode-set +function isC0ControlPercentEncode(c) { + return c <= 0x1F || c > 0x7E; +} + +// https://url.spec.whatwg.org/#fragment-percent-encode-set +const extraFragmentPercentEncodeSet = new Set([p(" "), p("\""), p("<"), p(">"), p("`")]); +function isFragmentPercentEncode(c) { + return isC0ControlPercentEncode(c) || extraFragmentPercentEncodeSet.has(c); +} + +// https://url.spec.whatwg.org/#query-percent-encode-set +const extraQueryPercentEncodeSet = new Set([p(" "), p("\""), p("#"), p("<"), p(">")]); +function isQueryPercentEncode(c) { + return isC0ControlPercentEncode(c) || extraQueryPercentEncodeSet.has(c); +} + +// https://url.spec.whatwg.org/#special-query-percent-encode-set +function isSpecialQueryPercentEncode(c) { + return isQueryPercentEncode(c) || c === p("'"); +} + +// https://url.spec.whatwg.org/#path-percent-encode-set +const extraPathPercentEncodeSet = new Set([p("?"), p("`"), p("{"), p("}")]); +function isPathPercentEncode(c) { + return isQueryPercentEncode(c) || extraPathPercentEncodeSet.has(c); +} + +// https://url.spec.whatwg.org/#userinfo-percent-encode-set +const extraUserinfoPercentEncodeSet = + new Set([p("/"), p(":"), p(";"), p("="), p("@"), p("["), p("\\"), p("]"), p("^"), p("|")]); +function isUserinfoPercentEncode(c) { + return isPathPercentEncode(c) || extraUserinfoPercentEncodeSet.has(c); +} + +// https://url.spec.whatwg.org/#component-percent-encode-set +const extraComponentPercentEncodeSet = new Set([p("$"), p("%"), p("&"), p("+"), p(",")]); +function isComponentPercentEncode(c) { + return isUserinfoPercentEncode(c) || extraComponentPercentEncodeSet.has(c); +} + +// https://url.spec.whatwg.org/#application-x-www-form-urlencoded-percent-encode-set +const extraURLEncodedPercentEncodeSet = new Set([p("!"), p("'"), p("("), p(")"), p("~")]); +function isURLEncodedPercentEncode(c) { + return isComponentPercentEncode(c) || extraURLEncodedPercentEncodeSet.has(c); +} + +// https://url.spec.whatwg.org/#code-point-percent-encode-after-encoding +// https://url.spec.whatwg.org/#utf-8-percent-encode +// Assuming encoding is always utf-8 allows us to trim one of the logic branches. TODO: support encoding. +// The "-Internal" variant here has code points as JS strings. The external version used by other files has code points +// as JS numbers, like the rest of the codebase. +function utf8PercentEncodeCodePointInternal(codePoint, percentEncodePredicate) { + const bytes = utf8Encode(codePoint); + let output = ""; + for (const byte of bytes) { + // Our percentEncodePredicate operates on bytes, not code points, so this is slightly different from the spec. + if (!percentEncodePredicate(byte)) { + output += String.fromCharCode(byte); + } else { + output += percentEncode(byte); + } + } + + return output; +} + +function utf8PercentEncodeCodePoint(codePoint, percentEncodePredicate) { + return utf8PercentEncodeCodePointInternal(String.fromCodePoint(codePoint), percentEncodePredicate); +} + +// https://url.spec.whatwg.org/#string-percent-encode-after-encoding +// https://url.spec.whatwg.org/#string-utf-8-percent-encode +function utf8PercentEncodeString(input, percentEncodePredicate, spaceAsPlus = false) { + let output = ""; + for (const codePoint of input) { + if (spaceAsPlus && codePoint === " ") { + output += "+"; + } else { + output += utf8PercentEncodeCodePointInternal(codePoint, percentEncodePredicate); + } + } + return output; +} + +module.exports = { + isC0ControlPercentEncode, + isFragmentPercentEncode, + isQueryPercentEncode, + isSpecialQueryPercentEncode, + isPathPercentEncode, + isUserinfoPercentEncode, + isURLEncodedPercentEncode, + percentDecodeString, + percentDecodeBytes, + utf8PercentEncodeString, + utf8PercentEncodeCodePoint +}; diff --git a/node_modules/mongodb-connection-string-url/node_modules/whatwg-url/lib/url-state-machine.js b/node_modules/mongodb-connection-string-url/node_modules/whatwg-url/lib/url-state-machine.js new file mode 100644 index 000000000..d9ecae2e9 --- /dev/null +++ b/node_modules/mongodb-connection-string-url/node_modules/whatwg-url/lib/url-state-machine.js @@ -0,0 +1,1244 @@ +"use strict"; +const tr46 = require("tr46"); + +const infra = require("./infra"); +const { utf8DecodeWithoutBOM } = require("./encoding"); +const { percentDecodeString, utf8PercentEncodeCodePoint, utf8PercentEncodeString, isC0ControlPercentEncode, + isFragmentPercentEncode, isQueryPercentEncode, isSpecialQueryPercentEncode, isPathPercentEncode, + isUserinfoPercentEncode } = require("./percent-encoding"); + +function p(char) { + return char.codePointAt(0); +} + +const specialSchemes = { + ftp: 21, + file: null, + http: 80, + https: 443, + ws: 80, + wss: 443 +}; + +const failure = Symbol("failure"); + +function countSymbols(str) { + return [...str].length; +} + +function at(input, idx) { + const c = input[idx]; + return isNaN(c) ? undefined : String.fromCodePoint(c); +} + +function isSingleDot(buffer) { + return buffer === "." || buffer.toLowerCase() === "%2e"; +} + +function isDoubleDot(buffer) { + buffer = buffer.toLowerCase(); + return buffer === ".." || buffer === "%2e." || buffer === ".%2e" || buffer === "%2e%2e"; +} + +function isWindowsDriveLetterCodePoints(cp1, cp2) { + return infra.isASCIIAlpha(cp1) && (cp2 === p(":") || cp2 === p("|")); +} + +function isWindowsDriveLetterString(string) { + return string.length === 2 && infra.isASCIIAlpha(string.codePointAt(0)) && (string[1] === ":" || string[1] === "|"); +} + +function isNormalizedWindowsDriveLetterString(string) { + return string.length === 2 && infra.isASCIIAlpha(string.codePointAt(0)) && string[1] === ":"; +} + +function containsForbiddenHostCodePoint(string) { + return string.search(/\u0000|\u0009|\u000A|\u000D|\u0020|#|%|\/|:|<|>|\?|@|\[|\\|\]|\^|\|/u) !== -1; +} + +function containsForbiddenHostCodePointExcludingPercent(string) { + return string.search(/\u0000|\u0009|\u000A|\u000D|\u0020|#|\/|:|<|>|\?|@|\[|\\|\]|\^|\|/u) !== -1; +} + +function isSpecialScheme(scheme) { + return specialSchemes[scheme] !== undefined; +} + +function isSpecial(url) { + return isSpecialScheme(url.scheme); +} + +function isNotSpecial(url) { + return !isSpecialScheme(url.scheme); +} + +function defaultPort(scheme) { + return specialSchemes[scheme]; +} + +function parseIPv4Number(input) { + if (input === "") { + return failure; + } + + let R = 10; + + if (input.length >= 2 && input.charAt(0) === "0" && input.charAt(1).toLowerCase() === "x") { + input = input.substring(2); + R = 16; + } else if (input.length >= 2 && input.charAt(0) === "0") { + input = input.substring(1); + R = 8; + } + + if (input === "") { + return 0; + } + + let regex = /[^0-7]/u; + if (R === 10) { + regex = /[^0-9]/u; + } + if (R === 16) { + regex = /[^0-9A-Fa-f]/u; + } + + if (regex.test(input)) { + return failure; + } + + return parseInt(input, R); +} + +function parseIPv4(input) { + const parts = input.split("."); + if (parts[parts.length - 1] === "") { + if (parts.length > 1) { + parts.pop(); + } + } + + if (parts.length > 4) { + return failure; + } + + const numbers = []; + for (const part of parts) { + const n = parseIPv4Number(part); + if (n === failure) { + return failure; + } + + numbers.push(n); + } + + for (let i = 0; i < numbers.length - 1; ++i) { + if (numbers[i] > 255) { + return failure; + } + } + if (numbers[numbers.length - 1] >= 256 ** (5 - numbers.length)) { + return failure; + } + + let ipv4 = numbers.pop(); + let counter = 0; + + for (const n of numbers) { + ipv4 += n * 256 ** (3 - counter); + ++counter; + } + + return ipv4; +} + +function serializeIPv4(address) { + let output = ""; + let n = address; + + for (let i = 1; i <= 4; ++i) { + output = String(n % 256) + output; + if (i !== 4) { + output = `.${output}`; + } + n = Math.floor(n / 256); + } + + return output; +} + +function parseIPv6(input) { + const address = [0, 0, 0, 0, 0, 0, 0, 0]; + let pieceIndex = 0; + let compress = null; + let pointer = 0; + + input = Array.from(input, c => c.codePointAt(0)); + + if (input[pointer] === p(":")) { + if (input[pointer + 1] !== p(":")) { + return failure; + } + + pointer += 2; + ++pieceIndex; + compress = pieceIndex; + } + + while (pointer < input.length) { + if (pieceIndex === 8) { + return failure; + } + + if (input[pointer] === p(":")) { + if (compress !== null) { + return failure; + } + ++pointer; + ++pieceIndex; + compress = pieceIndex; + continue; + } + + let value = 0; + let length = 0; + + while (length < 4 && infra.isASCIIHex(input[pointer])) { + value = value * 0x10 + parseInt(at(input, pointer), 16); + ++pointer; + ++length; + } + + if (input[pointer] === p(".")) { + if (length === 0) { + return failure; + } + + pointer -= length; + + if (pieceIndex > 6) { + return failure; + } + + let numbersSeen = 0; + + while (input[pointer] !== undefined) { + let ipv4Piece = null; + + if (numbersSeen > 0) { + if (input[pointer] === p(".") && numbersSeen < 4) { + ++pointer; + } else { + return failure; + } + } + + if (!infra.isASCIIDigit(input[pointer])) { + return failure; + } + + while (infra.isASCIIDigit(input[pointer])) { + const number = parseInt(at(input, pointer)); + if (ipv4Piece === null) { + ipv4Piece = number; + } else if (ipv4Piece === 0) { + return failure; + } else { + ipv4Piece = ipv4Piece * 10 + number; + } + if (ipv4Piece > 255) { + return failure; + } + ++pointer; + } + + address[pieceIndex] = address[pieceIndex] * 0x100 + ipv4Piece; + + ++numbersSeen; + + if (numbersSeen === 2 || numbersSeen === 4) { + ++pieceIndex; + } + } + + if (numbersSeen !== 4) { + return failure; + } + + break; + } else if (input[pointer] === p(":")) { + ++pointer; + if (input[pointer] === undefined) { + return failure; + } + } else if (input[pointer] !== undefined) { + return failure; + } + + address[pieceIndex] = value; + ++pieceIndex; + } + + if (compress !== null) { + let swaps = pieceIndex - compress; + pieceIndex = 7; + while (pieceIndex !== 0 && swaps > 0) { + const temp = address[compress + swaps - 1]; + address[compress + swaps - 1] = address[pieceIndex]; + address[pieceIndex] = temp; + --pieceIndex; + --swaps; + } + } else if (compress === null && pieceIndex !== 8) { + return failure; + } + + return address; +} + +function serializeIPv6(address) { + let output = ""; + const compress = findLongestZeroSequence(address); + let ignore0 = false; + + for (let pieceIndex = 0; pieceIndex <= 7; ++pieceIndex) { + if (ignore0 && address[pieceIndex] === 0) { + continue; + } else if (ignore0) { + ignore0 = false; + } + + if (compress === pieceIndex) { + const separator = pieceIndex === 0 ? "::" : ":"; + output += separator; + ignore0 = true; + continue; + } + + output += address[pieceIndex].toString(16); + + if (pieceIndex !== 7) { + output += ":"; + } + } + + return output; +} + +function parseHost(input, isNotSpecialArg = false) { + if (input[0] === "[") { + if (input[input.length - 1] !== "]") { + return failure; + } + + return parseIPv6(input.substring(1, input.length - 1)); + } + + if (isNotSpecialArg) { + return parseOpaqueHost(input); + } + + const domain = utf8DecodeWithoutBOM(percentDecodeString(input)); + const asciiDomain = domainToASCII(domain); + if (asciiDomain === failure) { + return failure; + } + + if (containsForbiddenHostCodePoint(asciiDomain)) { + return failure; + } + + if (endsInANumber(asciiDomain)) { + return parseIPv4(asciiDomain); + } + + return asciiDomain; +} + +function endsInANumber(input) { + const parts = input.split("."); + if (parts[parts.length - 1] === "") { + if (parts.length === 1) { + return false; + } + parts.pop(); + } + + const last = parts[parts.length - 1]; + if (parseIPv4Number(last) !== failure) { + return true; + } + + if (/^[0-9]+$/u.test(last)) { + return true; + } + + return false; +} + +function parseOpaqueHost(input) { + if (containsForbiddenHostCodePointExcludingPercent(input)) { + return failure; + } + + return utf8PercentEncodeString(input, isC0ControlPercentEncode); +} + +function findLongestZeroSequence(arr) { + let maxIdx = null; + let maxLen = 1; // only find elements > 1 + let currStart = null; + let currLen = 0; + + for (let i = 0; i < arr.length; ++i) { + if (arr[i] !== 0) { + if (currLen > maxLen) { + maxIdx = currStart; + maxLen = currLen; + } + + currStart = null; + currLen = 0; + } else { + if (currStart === null) { + currStart = i; + } + ++currLen; + } + } + + // if trailing zeros + if (currLen > maxLen) { + return currStart; + } + + return maxIdx; +} + +function serializeHost(host) { + if (typeof host === "number") { + return serializeIPv4(host); + } + + // IPv6 serializer + if (host instanceof Array) { + return `[${serializeIPv6(host)}]`; + } + + return host; +} + +function domainToASCII(domain, beStrict = false) { + const result = tr46.toASCII(domain, { + checkBidi: true, + checkHyphens: false, + checkJoiners: true, + useSTD3ASCIIRules: beStrict, + verifyDNSLength: beStrict + }); + if (result === null || result === "") { + return failure; + } + return result; +} + +function trimControlChars(url) { + return url.replace(/^[\u0000-\u001F\u0020]+|[\u0000-\u001F\u0020]+$/ug, ""); +} + +function trimTabAndNewline(url) { + return url.replace(/\u0009|\u000A|\u000D/ug, ""); +} + +function shortenPath(url) { + const { path } = url; + if (path.length === 0) { + return; + } + if (url.scheme === "file" && path.length === 1 && isNormalizedWindowsDriveLetter(path[0])) { + return; + } + + path.pop(); +} + +function includesCredentials(url) { + return url.username !== "" || url.password !== ""; +} + +function cannotHaveAUsernamePasswordPort(url) { + return url.host === null || url.host === "" || hasAnOpaquePath(url) || url.scheme === "file"; +} + +function hasAnOpaquePath(url) { + return typeof url.path === "string"; +} + +function isNormalizedWindowsDriveLetter(string) { + return /^[A-Za-z]:$/u.test(string); +} + +function URLStateMachine(input, base, encodingOverride, url, stateOverride) { + this.pointer = 0; + this.input = input; + this.base = base || null; + this.encodingOverride = encodingOverride || "utf-8"; + this.stateOverride = stateOverride; + this.url = url; + this.failure = false; + this.parseError = false; + + if (!this.url) { + this.url = { + scheme: "", + username: "", + password: "", + host: null, + port: null, + path: [], + query: null, + fragment: null + }; + + const res = trimControlChars(this.input); + if (res !== this.input) { + this.parseError = true; + } + this.input = res; + } + + const res = trimTabAndNewline(this.input); + if (res !== this.input) { + this.parseError = true; + } + this.input = res; + + this.state = stateOverride || "scheme start"; + + this.buffer = ""; + this.atFlag = false; + this.arrFlag = false; + this.passwordTokenSeenFlag = false; + + this.input = Array.from(this.input, c => c.codePointAt(0)); + + for (; this.pointer <= this.input.length; ++this.pointer) { + const c = this.input[this.pointer]; + const cStr = isNaN(c) ? undefined : String.fromCodePoint(c); + + // exec state machine + const ret = this[`parse ${this.state}`](c, cStr); + if (!ret) { + break; // terminate algorithm + } else if (ret === failure) { + this.failure = true; + break; + } + } +} + +URLStateMachine.prototype["parse scheme start"] = function parseSchemeStart(c, cStr) { + if (infra.isASCIIAlpha(c)) { + this.buffer += cStr.toLowerCase(); + this.state = "scheme"; + } else if (!this.stateOverride) { + this.state = "no scheme"; + --this.pointer; + } else { + this.parseError = true; + return failure; + } + + return true; +}; + +URLStateMachine.prototype["parse scheme"] = function parseScheme(c, cStr) { + if (infra.isASCIIAlphanumeric(c) || c === p("+") || c === p("-") || c === p(".")) { + this.buffer += cStr.toLowerCase(); + } else if (c === p(":")) { + if (this.stateOverride) { + if (isSpecial(this.url) && !isSpecialScheme(this.buffer)) { + return false; + } + + if (!isSpecial(this.url) && isSpecialScheme(this.buffer)) { + return false; + } + + if ((includesCredentials(this.url) || this.url.port !== null) && this.buffer === "file") { + return false; + } + + if (this.url.scheme === "file" && this.url.host === "") { + return false; + } + } + this.url.scheme = this.buffer; + if (this.stateOverride) { + if (this.url.port === defaultPort(this.url.scheme)) { + this.url.port = null; + } + return false; + } + this.buffer = ""; + if (this.url.scheme === "file") { + if (this.input[this.pointer + 1] !== p("/") || this.input[this.pointer + 2] !== p("/")) { + this.parseError = true; + } + this.state = "file"; + } else if (isSpecial(this.url) && this.base !== null && this.base.scheme === this.url.scheme) { + this.state = "special relative or authority"; + } else if (isSpecial(this.url)) { + this.state = "special authority slashes"; + } else if (this.input[this.pointer + 1] === p("/")) { + this.state = "path or authority"; + ++this.pointer; + } else { + this.url.path = ""; + this.state = "opaque path"; + } + } else if (!this.stateOverride) { + this.buffer = ""; + this.state = "no scheme"; + this.pointer = -1; + } else { + this.parseError = true; + return failure; + } + + return true; +}; + +URLStateMachine.prototype["parse no scheme"] = function parseNoScheme(c) { + if (this.base === null || (hasAnOpaquePath(this.base) && c !== p("#"))) { + return failure; + } else if (hasAnOpaquePath(this.base) && c === p("#")) { + this.url.scheme = this.base.scheme; + this.url.path = this.base.path; + this.url.query = this.base.query; + this.url.fragment = ""; + this.state = "fragment"; + } else if (this.base.scheme === "file") { + this.state = "file"; + --this.pointer; + } else { + this.state = "relative"; + --this.pointer; + } + + return true; +}; + +URLStateMachine.prototype["parse special relative or authority"] = function parseSpecialRelativeOrAuthority(c) { + if (c === p("/") && this.input[this.pointer + 1] === p("/")) { + this.state = "special authority ignore slashes"; + ++this.pointer; + } else { + this.parseError = true; + this.state = "relative"; + --this.pointer; + } + + return true; +}; + +URLStateMachine.prototype["parse path or authority"] = function parsePathOrAuthority(c) { + if (c === p("/")) { + this.state = "authority"; + } else { + this.state = "path"; + --this.pointer; + } + + return true; +}; + +URLStateMachine.prototype["parse relative"] = function parseRelative(c) { + this.url.scheme = this.base.scheme; + if (c === p("/")) { + this.state = "relative slash"; + } else if (isSpecial(this.url) && c === p("\\")) { + this.parseError = true; + this.state = "relative slash"; + } else { + this.url.username = this.base.username; + this.url.password = this.base.password; + this.url.host = this.base.host; + this.url.port = this.base.port; + this.url.path = this.base.path.slice(); + this.url.query = this.base.query; + if (c === p("?")) { + this.url.query = ""; + this.state = "query"; + } else if (c === p("#")) { + this.url.fragment = ""; + this.state = "fragment"; + } else if (!isNaN(c)) { + this.url.query = null; + this.url.path.pop(); + this.state = "path"; + --this.pointer; + } + } + + return true; +}; + +URLStateMachine.prototype["parse relative slash"] = function parseRelativeSlash(c) { + if (isSpecial(this.url) && (c === p("/") || c === p("\\"))) { + if (c === p("\\")) { + this.parseError = true; + } + this.state = "special authority ignore slashes"; + } else if (c === p("/")) { + this.state = "authority"; + } else { + this.url.username = this.base.username; + this.url.password = this.base.password; + this.url.host = this.base.host; + this.url.port = this.base.port; + this.state = "path"; + --this.pointer; + } + + return true; +}; + +URLStateMachine.prototype["parse special authority slashes"] = function parseSpecialAuthoritySlashes(c) { + if (c === p("/") && this.input[this.pointer + 1] === p("/")) { + this.state = "special authority ignore slashes"; + ++this.pointer; + } else { + this.parseError = true; + this.state = "special authority ignore slashes"; + --this.pointer; + } + + return true; +}; + +URLStateMachine.prototype["parse special authority ignore slashes"] = function parseSpecialAuthorityIgnoreSlashes(c) { + if (c !== p("/") && c !== p("\\")) { + this.state = "authority"; + --this.pointer; + } else { + this.parseError = true; + } + + return true; +}; + +URLStateMachine.prototype["parse authority"] = function parseAuthority(c, cStr) { + if (c === p("@")) { + this.parseError = true; + if (this.atFlag) { + this.buffer = `%40${this.buffer}`; + } + this.atFlag = true; + + // careful, this is based on buffer and has its own pointer (this.pointer != pointer) and inner chars + const len = countSymbols(this.buffer); + for (let pointer = 0; pointer < len; ++pointer) { + const codePoint = this.buffer.codePointAt(pointer); + + if (codePoint === p(":") && !this.passwordTokenSeenFlag) { + this.passwordTokenSeenFlag = true; + continue; + } + const encodedCodePoints = utf8PercentEncodeCodePoint(codePoint, isUserinfoPercentEncode); + if (this.passwordTokenSeenFlag) { + this.url.password += encodedCodePoints; + } else { + this.url.username += encodedCodePoints; + } + } + this.buffer = ""; + } else if (isNaN(c) || c === p("/") || c === p("?") || c === p("#") || + (isSpecial(this.url) && c === p("\\"))) { + if (this.atFlag && this.buffer === "") { + this.parseError = true; + return failure; + } + this.pointer -= countSymbols(this.buffer) + 1; + this.buffer = ""; + this.state = "host"; + } else { + this.buffer += cStr; + } + + return true; +}; + +URLStateMachine.prototype["parse hostname"] = +URLStateMachine.prototype["parse host"] = function parseHostName(c, cStr) { + if (this.stateOverride && this.url.scheme === "file") { + --this.pointer; + this.state = "file host"; + } else if (c === p(":") && !this.arrFlag) { + if (this.buffer === "") { + this.parseError = true; + return failure; + } + + if (this.stateOverride === "hostname") { + return false; + } + + const host = parseHost(this.buffer, isNotSpecial(this.url)); + if (host === failure) { + return failure; + } + + this.url.host = host; + this.buffer = ""; + this.state = "port"; + } else if (isNaN(c) || c === p("/") || c === p("?") || c === p("#") || + (isSpecial(this.url) && c === p("\\"))) { + --this.pointer; + if (isSpecial(this.url) && this.buffer === "") { + this.parseError = true; + return failure; + } else if (this.stateOverride && this.buffer === "" && + (includesCredentials(this.url) || this.url.port !== null)) { + this.parseError = true; + return false; + } + + const host = parseHost(this.buffer, isNotSpecial(this.url)); + if (host === failure) { + return failure; + } + + this.url.host = host; + this.buffer = ""; + this.state = "path start"; + if (this.stateOverride) { + return false; + } + } else { + if (c === p("[")) { + this.arrFlag = true; + } else if (c === p("]")) { + this.arrFlag = false; + } + this.buffer += cStr; + } + + return true; +}; + +URLStateMachine.prototype["parse port"] = function parsePort(c, cStr) { + if (infra.isASCIIDigit(c)) { + this.buffer += cStr; + } else if (isNaN(c) || c === p("/") || c === p("?") || c === p("#") || + (isSpecial(this.url) && c === p("\\")) || + this.stateOverride) { + if (this.buffer !== "") { + const port = parseInt(this.buffer); + if (port > 2 ** 16 - 1) { + this.parseError = true; + return failure; + } + this.url.port = port === defaultPort(this.url.scheme) ? null : port; + this.buffer = ""; + } + if (this.stateOverride) { + return false; + } + this.state = "path start"; + --this.pointer; + } else { + this.parseError = true; + return failure; + } + + return true; +}; + +const fileOtherwiseCodePoints = new Set([p("/"), p("\\"), p("?"), p("#")]); + +function startsWithWindowsDriveLetter(input, pointer) { + const length = input.length - pointer; + return length >= 2 && + isWindowsDriveLetterCodePoints(input[pointer], input[pointer + 1]) && + (length === 2 || fileOtherwiseCodePoints.has(input[pointer + 2])); +} + +URLStateMachine.prototype["parse file"] = function parseFile(c) { + this.url.scheme = "file"; + this.url.host = ""; + + if (c === p("/") || c === p("\\")) { + if (c === p("\\")) { + this.parseError = true; + } + this.state = "file slash"; + } else if (this.base !== null && this.base.scheme === "file") { + this.url.host = this.base.host; + this.url.path = this.base.path.slice(); + this.url.query = this.base.query; + if (c === p("?")) { + this.url.query = ""; + this.state = "query"; + } else if (c === p("#")) { + this.url.fragment = ""; + this.state = "fragment"; + } else if (!isNaN(c)) { + this.url.query = null; + if (!startsWithWindowsDriveLetter(this.input, this.pointer)) { + shortenPath(this.url); + } else { + this.parseError = true; + this.url.path = []; + } + + this.state = "path"; + --this.pointer; + } + } else { + this.state = "path"; + --this.pointer; + } + + return true; +}; + +URLStateMachine.prototype["parse file slash"] = function parseFileSlash(c) { + if (c === p("/") || c === p("\\")) { + if (c === p("\\")) { + this.parseError = true; + } + this.state = "file host"; + } else { + if (this.base !== null && this.base.scheme === "file") { + if (!startsWithWindowsDriveLetter(this.input, this.pointer) && + isNormalizedWindowsDriveLetterString(this.base.path[0])) { + this.url.path.push(this.base.path[0]); + } + this.url.host = this.base.host; + } + this.state = "path"; + --this.pointer; + } + + return true; +}; + +URLStateMachine.prototype["parse file host"] = function parseFileHost(c, cStr) { + if (isNaN(c) || c === p("/") || c === p("\\") || c === p("?") || c === p("#")) { + --this.pointer; + if (!this.stateOverride && isWindowsDriveLetterString(this.buffer)) { + this.parseError = true; + this.state = "path"; + } else if (this.buffer === "") { + this.url.host = ""; + if (this.stateOverride) { + return false; + } + this.state = "path start"; + } else { + let host = parseHost(this.buffer, isNotSpecial(this.url)); + if (host === failure) { + return failure; + } + if (host === "localhost") { + host = ""; + } + this.url.host = host; + + if (this.stateOverride) { + return false; + } + + this.buffer = ""; + this.state = "path start"; + } + } else { + this.buffer += cStr; + } + + return true; +}; + +URLStateMachine.prototype["parse path start"] = function parsePathStart(c) { + if (isSpecial(this.url)) { + if (c === p("\\")) { + this.parseError = true; + } + this.state = "path"; + + if (c !== p("/") && c !== p("\\")) { + --this.pointer; + } + } else if (!this.stateOverride && c === p("?")) { + this.url.query = ""; + this.state = "query"; + } else if (!this.stateOverride && c === p("#")) { + this.url.fragment = ""; + this.state = "fragment"; + } else if (c !== undefined) { + this.state = "path"; + if (c !== p("/")) { + --this.pointer; + } + } else if (this.stateOverride && this.url.host === null) { + this.url.path.push(""); + } + + return true; +}; + +URLStateMachine.prototype["parse path"] = function parsePath(c) { + if (isNaN(c) || c === p("/") || (isSpecial(this.url) && c === p("\\")) || + (!this.stateOverride && (c === p("?") || c === p("#")))) { + if (isSpecial(this.url) && c === p("\\")) { + this.parseError = true; + } + + if (isDoubleDot(this.buffer)) { + shortenPath(this.url); + if (c !== p("/") && !(isSpecial(this.url) && c === p("\\"))) { + this.url.path.push(""); + } + } else if (isSingleDot(this.buffer) && c !== p("/") && + !(isSpecial(this.url) && c === p("\\"))) { + this.url.path.push(""); + } else if (!isSingleDot(this.buffer)) { + if (this.url.scheme === "file" && this.url.path.length === 0 && isWindowsDriveLetterString(this.buffer)) { + this.buffer = `${this.buffer[0]}:`; + } + this.url.path.push(this.buffer); + } + this.buffer = ""; + if (c === p("?")) { + this.url.query = ""; + this.state = "query"; + } + if (c === p("#")) { + this.url.fragment = ""; + this.state = "fragment"; + } + } else { + // TODO: If c is not a URL code point and not "%", parse error. + + if (c === p("%") && + (!infra.isASCIIHex(this.input[this.pointer + 1]) || + !infra.isASCIIHex(this.input[this.pointer + 2]))) { + this.parseError = true; + } + + this.buffer += utf8PercentEncodeCodePoint(c, isPathPercentEncode); + } + + return true; +}; + +URLStateMachine.prototype["parse opaque path"] = function parseOpaquePath(c) { + if (c === p("?")) { + this.url.query = ""; + this.state = "query"; + } else if (c === p("#")) { + this.url.fragment = ""; + this.state = "fragment"; + } else { + // TODO: Add: not a URL code point + if (!isNaN(c) && c !== p("%")) { + this.parseError = true; + } + + if (c === p("%") && + (!infra.isASCIIHex(this.input[this.pointer + 1]) || + !infra.isASCIIHex(this.input[this.pointer + 2]))) { + this.parseError = true; + } + + if (!isNaN(c)) { + this.url.path += utf8PercentEncodeCodePoint(c, isC0ControlPercentEncode); + } + } + + return true; +}; + +URLStateMachine.prototype["parse query"] = function parseQuery(c, cStr) { + if (!isSpecial(this.url) || this.url.scheme === "ws" || this.url.scheme === "wss") { + this.encodingOverride = "utf-8"; + } + + if ((!this.stateOverride && c === p("#")) || isNaN(c)) { + const queryPercentEncodePredicate = isSpecial(this.url) ? isSpecialQueryPercentEncode : isQueryPercentEncode; + this.url.query += utf8PercentEncodeString(this.buffer, queryPercentEncodePredicate); + + this.buffer = ""; + + if (c === p("#")) { + this.url.fragment = ""; + this.state = "fragment"; + } + } else if (!isNaN(c)) { + // TODO: If c is not a URL code point and not "%", parse error. + + if (c === p("%") && + (!infra.isASCIIHex(this.input[this.pointer + 1]) || + !infra.isASCIIHex(this.input[this.pointer + 2]))) { + this.parseError = true; + } + + this.buffer += cStr; + } + + return true; +}; + +URLStateMachine.prototype["parse fragment"] = function parseFragment(c) { + if (!isNaN(c)) { + // TODO: If c is not a URL code point and not "%", parse error. + if (c === p("%") && + (!infra.isASCIIHex(this.input[this.pointer + 1]) || + !infra.isASCIIHex(this.input[this.pointer + 2]))) { + this.parseError = true; + } + + this.url.fragment += utf8PercentEncodeCodePoint(c, isFragmentPercentEncode); + } + + return true; +}; + +function serializeURL(url, excludeFragment) { + let output = `${url.scheme}:`; + if (url.host !== null) { + output += "//"; + + if (url.username !== "" || url.password !== "") { + output += url.username; + if (url.password !== "") { + output += `:${url.password}`; + } + output += "@"; + } + + output += serializeHost(url.host); + + if (url.port !== null) { + output += `:${url.port}`; + } + } + + if (url.host === null && !hasAnOpaquePath(url) && url.path.length > 1 && url.path[0] === "") { + output += "/."; + } + output += serializePath(url); + + if (url.query !== null) { + output += `?${url.query}`; + } + + if (!excludeFragment && url.fragment !== null) { + output += `#${url.fragment}`; + } + + return output; +} + +function serializeOrigin(tuple) { + let result = `${tuple.scheme}://`; + result += serializeHost(tuple.host); + + if (tuple.port !== null) { + result += `:${tuple.port}`; + } + + return result; +} + +function serializePath(url) { + if (hasAnOpaquePath(url)) { + return url.path; + } + + let output = ""; + for (const segment of url.path) { + output += `/${segment}`; + } + return output; +} + +module.exports.serializeURL = serializeURL; + +module.exports.serializePath = serializePath; + +module.exports.serializeURLOrigin = function (url) { + // https://url.spec.whatwg.org/#concept-url-origin + switch (url.scheme) { + case "blob": + try { + return module.exports.serializeURLOrigin(module.exports.parseURL(serializePath(url))); + } catch (e) { + // serializing an opaque origin returns "null" + return "null"; + } + case "ftp": + case "http": + case "https": + case "ws": + case "wss": + return serializeOrigin({ + scheme: url.scheme, + host: url.host, + port: url.port + }); + case "file": + // The spec says: + // > Unfortunate as it is, this is left as an exercise to the reader. When in doubt, return a new opaque origin. + // Browsers tested so far: + // - Chrome says "file://", but treats file: URLs as cross-origin for most (all?) purposes; see e.g. + // https://bugs.chromium.org/p/chromium/issues/detail?id=37586 + // - Firefox says "null", but treats file: URLs as same-origin sometimes based on directory stuff; see + // https://developer.mozilla.org/en-US/docs/Archive/Misc_top_level/Same-origin_policy_for_file:_URIs + return "null"; + default: + // serializing an opaque origin returns "null" + return "null"; + } +}; + +module.exports.basicURLParse = function (input, options) { + if (options === undefined) { + options = {}; + } + + const usm = new URLStateMachine(input, options.baseURL, options.encodingOverride, options.url, options.stateOverride); + if (usm.failure) { + return null; + } + + return usm.url; +}; + +module.exports.setTheUsername = function (url, username) { + url.username = utf8PercentEncodeString(username, isUserinfoPercentEncode); +}; + +module.exports.setThePassword = function (url, password) { + url.password = utf8PercentEncodeString(password, isUserinfoPercentEncode); +}; + +module.exports.serializeHost = serializeHost; + +module.exports.cannotHaveAUsernamePasswordPort = cannotHaveAUsernamePasswordPort; + +module.exports.hasAnOpaquePath = hasAnOpaquePath; + +module.exports.serializeInteger = function (integer) { + return String(integer); +}; + +module.exports.parseURL = function (input, options) { + if (options === undefined) { + options = {}; + } + + // We don't handle blobs, so this just delegates: + return module.exports.basicURLParse(input, { baseURL: options.baseURL, encodingOverride: options.encodingOverride }); +}; diff --git a/node_modules/mongodb-connection-string-url/node_modules/whatwg-url/lib/urlencoded.js b/node_modules/mongodb-connection-string-url/node_modules/whatwg-url/lib/urlencoded.js new file mode 100644 index 000000000..e72306374 --- /dev/null +++ b/node_modules/mongodb-connection-string-url/node_modules/whatwg-url/lib/urlencoded.js @@ -0,0 +1,106 @@ +"use strict"; +const { utf8Encode, utf8DecodeWithoutBOM } = require("./encoding"); +const { percentDecodeBytes, utf8PercentEncodeString, isURLEncodedPercentEncode } = require("./percent-encoding"); + +function p(char) { + return char.codePointAt(0); +} + +// https://url.spec.whatwg.org/#concept-urlencoded-parser +function parseUrlencoded(input) { + const sequences = strictlySplitByteSequence(input, p("&")); + const output = []; + for (const bytes of sequences) { + if (bytes.length === 0) { + continue; + } + + let name, value; + const indexOfEqual = bytes.indexOf(p("=")); + + if (indexOfEqual >= 0) { + name = bytes.slice(0, indexOfEqual); + value = bytes.slice(indexOfEqual + 1); + } else { + name = bytes; + value = new Uint8Array(0); + } + + name = replaceByteInByteSequence(name, 0x2B, 0x20); + value = replaceByteInByteSequence(value, 0x2B, 0x20); + + const nameString = utf8DecodeWithoutBOM(percentDecodeBytes(name)); + const valueString = utf8DecodeWithoutBOM(percentDecodeBytes(value)); + + output.push([nameString, valueString]); + } + return output; +} + +// https://url.spec.whatwg.org/#concept-urlencoded-string-parser +function parseUrlencodedString(input) { + return parseUrlencoded(utf8Encode(input)); +} + +// https://url.spec.whatwg.org/#concept-urlencoded-serializer +function serializeUrlencoded(tuples, encodingOverride = undefined) { + let encoding = "utf-8"; + if (encodingOverride !== undefined) { + // TODO "get the output encoding", i.e. handle encoding labels vs. names. + encoding = encodingOverride; + } + + let output = ""; + for (const [i, tuple] of tuples.entries()) { + // TODO: handle encoding override + + const name = utf8PercentEncodeString(tuple[0], isURLEncodedPercentEncode, true); + + let value = tuple[1]; + if (tuple.length > 2 && tuple[2] !== undefined) { + if (tuple[2] === "hidden" && name === "_charset_") { + value = encoding; + } else if (tuple[2] === "file") { + // value is a File object + value = value.name; + } + } + + value = utf8PercentEncodeString(value, isURLEncodedPercentEncode, true); + + if (i !== 0) { + output += "&"; + } + output += `${name}=${value}`; + } + return output; +} + +function strictlySplitByteSequence(buf, cp) { + const list = []; + let last = 0; + let i = buf.indexOf(cp); + while (i >= 0) { + list.push(buf.slice(last, i)); + last = i + 1; + i = buf.indexOf(cp, last); + } + if (last !== buf.length) { + list.push(buf.slice(last)); + } + return list; +} + +function replaceByteInByteSequence(buf, from, to) { + let i = buf.indexOf(from); + while (i >= 0) { + buf[i] = to; + i = buf.indexOf(from, i + 1); + } + return buf; +} + +module.exports = { + parseUrlencodedString, + serializeUrlencoded +}; diff --git a/node_modules/mongodb-connection-string-url/node_modules/whatwg-url/lib/utils.js b/node_modules/mongodb-connection-string-url/node_modules/whatwg-url/lib/utils.js new file mode 100644 index 000000000..3af17706f --- /dev/null +++ b/node_modules/mongodb-connection-string-url/node_modules/whatwg-url/lib/utils.js @@ -0,0 +1,190 @@ +"use strict"; + +// Returns "Type(value) is Object" in ES terminology. +function isObject(value) { + return (typeof value === "object" && value !== null) || typeof value === "function"; +} + +const hasOwn = Function.prototype.call.bind(Object.prototype.hasOwnProperty); + +// Like `Object.assign`, but using `[[GetOwnProperty]]` and `[[DefineOwnProperty]]` +// instead of `[[Get]]` and `[[Set]]` and only allowing objects +function define(target, source) { + for (const key of Reflect.ownKeys(source)) { + const descriptor = Reflect.getOwnPropertyDescriptor(source, key); + if (descriptor && !Reflect.defineProperty(target, key, descriptor)) { + throw new TypeError(`Cannot redefine property: ${String(key)}`); + } + } +} + +function newObjectInRealm(globalObject, object) { + const ctorRegistry = initCtorRegistry(globalObject); + return Object.defineProperties( + Object.create(ctorRegistry["%Object.prototype%"]), + Object.getOwnPropertyDescriptors(object) + ); +} + +const wrapperSymbol = Symbol("wrapper"); +const implSymbol = Symbol("impl"); +const sameObjectCaches = Symbol("SameObject caches"); +const ctorRegistrySymbol = Symbol.for("[webidl2js] constructor registry"); + +const AsyncIteratorPrototype = Object.getPrototypeOf(Object.getPrototypeOf(async function* () {}).prototype); + +function initCtorRegistry(globalObject) { + if (hasOwn(globalObject, ctorRegistrySymbol)) { + return globalObject[ctorRegistrySymbol]; + } + + const ctorRegistry = Object.create(null); + + // In addition to registering all the WebIDL2JS-generated types in the constructor registry, + // we also register a few intrinsics that we make use of in generated code, since they are not + // easy to grab from the globalObject variable. + ctorRegistry["%Object.prototype%"] = globalObject.Object.prototype; + ctorRegistry["%IteratorPrototype%"] = Object.getPrototypeOf( + Object.getPrototypeOf(new globalObject.Array()[Symbol.iterator]()) + ); + + try { + ctorRegistry["%AsyncIteratorPrototype%"] = Object.getPrototypeOf( + Object.getPrototypeOf( + globalObject.eval("(async function* () {})").prototype + ) + ); + } catch { + ctorRegistry["%AsyncIteratorPrototype%"] = AsyncIteratorPrototype; + } + + globalObject[ctorRegistrySymbol] = ctorRegistry; + return ctorRegistry; +} + +function getSameObject(wrapper, prop, creator) { + if (!wrapper[sameObjectCaches]) { + wrapper[sameObjectCaches] = Object.create(null); + } + + if (prop in wrapper[sameObjectCaches]) { + return wrapper[sameObjectCaches][prop]; + } + + wrapper[sameObjectCaches][prop] = creator(); + return wrapper[sameObjectCaches][prop]; +} + +function wrapperForImpl(impl) { + return impl ? impl[wrapperSymbol] : null; +} + +function implForWrapper(wrapper) { + return wrapper ? wrapper[implSymbol] : null; +} + +function tryWrapperForImpl(impl) { + const wrapper = wrapperForImpl(impl); + return wrapper ? wrapper : impl; +} + +function tryImplForWrapper(wrapper) { + const impl = implForWrapper(wrapper); + return impl ? impl : wrapper; +} + +const iterInternalSymbol = Symbol("internal"); + +function isArrayIndexPropName(P) { + if (typeof P !== "string") { + return false; + } + const i = P >>> 0; + if (i === 2 ** 32 - 1) { + return false; + } + const s = `${i}`; + if (P !== s) { + return false; + } + return true; +} + +const byteLengthGetter = + Object.getOwnPropertyDescriptor(ArrayBuffer.prototype, "byteLength").get; +function isArrayBuffer(value) { + try { + byteLengthGetter.call(value); + return true; + } catch (e) { + return false; + } +} + +function iteratorResult([key, value], kind) { + let result; + switch (kind) { + case "key": + result = key; + break; + case "value": + result = value; + break; + case "key+value": + result = [key, value]; + break; + } + return { value: result, done: false }; +} + +const supportsPropertyIndex = Symbol("supports property index"); +const supportedPropertyIndices = Symbol("supported property indices"); +const supportsPropertyName = Symbol("supports property name"); +const supportedPropertyNames = Symbol("supported property names"); +const indexedGet = Symbol("indexed property get"); +const indexedSetNew = Symbol("indexed property set new"); +const indexedSetExisting = Symbol("indexed property set existing"); +const namedGet = Symbol("named property get"); +const namedSetNew = Symbol("named property set new"); +const namedSetExisting = Symbol("named property set existing"); +const namedDelete = Symbol("named property delete"); + +const asyncIteratorNext = Symbol("async iterator get the next iteration result"); +const asyncIteratorReturn = Symbol("async iterator return steps"); +const asyncIteratorInit = Symbol("async iterator initialization steps"); +const asyncIteratorEOI = Symbol("async iterator end of iteration"); + +module.exports = exports = { + isObject, + hasOwn, + define, + newObjectInRealm, + wrapperSymbol, + implSymbol, + getSameObject, + ctorRegistrySymbol, + initCtorRegistry, + wrapperForImpl, + implForWrapper, + tryWrapperForImpl, + tryImplForWrapper, + iterInternalSymbol, + isArrayBuffer, + isArrayIndexPropName, + supportsPropertyIndex, + supportedPropertyIndices, + supportsPropertyName, + supportedPropertyNames, + indexedGet, + indexedSetNew, + indexedSetExisting, + namedGet, + namedSetNew, + namedSetExisting, + namedDelete, + asyncIteratorNext, + asyncIteratorReturn, + asyncIteratorInit, + asyncIteratorEOI, + iteratorResult +}; diff --git a/node_modules/mongodb-connection-string-url/node_modules/whatwg-url/package.json b/node_modules/mongodb-connection-string-url/node_modules/whatwg-url/package.json new file mode 100644 index 000000000..9cb209f9d --- /dev/null +++ b/node_modules/mongodb-connection-string-url/node_modules/whatwg-url/package.json @@ -0,0 +1,58 @@ +{ + "name": "whatwg-url", + "version": "11.0.0", + "description": "An implementation of the WHATWG URL Standard's URL API and parsing machinery", + "main": "index.js", + "files": [ + "index.js", + "webidl2js-wrapper.js", + "lib/*.js" + ], + "author": "Sebastian Mayr ", + "license": "MIT", + "repository": "jsdom/whatwg-url", + "dependencies": { + "tr46": "^3.0.0", + "webidl-conversions": "^7.0.0" + }, + "devDependencies": { + "@domenic/eslint-config": "^1.4.0", + "benchmark": "^2.1.4", + "browserify": "^17.0.0", + "domexception": "^4.0.0", + "eslint": "^7.32.0", + "got": "^11.8.2", + "jest": "^27.2.4", + "webidl2js": "^17.0.0" + }, + "engines": { + "node": ">=12" + }, + "scripts": { + "coverage": "jest --coverage", + "lint": "eslint .", + "prepare": "node scripts/transform.js", + "pretest": "node scripts/get-latest-platform-tests.js && node scripts/transform.js", + "build-live-viewer": "browserify index.js --standalone whatwgURL > live-viewer/whatwg-url.js", + "test": "jest" + }, + "jest": { + "collectCoverageFrom": [ + "lib/**/*.js", + "!lib/utils.js" + ], + "coverageDirectory": "coverage", + "coverageReporters": [ + "lcov", + "text-summary" + ], + "testEnvironment": "node", + "testMatch": [ + "/test/**/*.js" + ], + "testPathIgnorePatterns": [ + "^/test/testharness.js$", + "^/test/web-platform-tests/" + ] + } +} diff --git a/node_modules/mongodb-connection-string-url/node_modules/whatwg-url/webidl2js-wrapper.js b/node_modules/mongodb-connection-string-url/node_modules/whatwg-url/webidl2js-wrapper.js new file mode 100644 index 000000000..b731ace5f --- /dev/null +++ b/node_modules/mongodb-connection-string-url/node_modules/whatwg-url/webidl2js-wrapper.js @@ -0,0 +1,7 @@ +"use strict"; + +const URL = require("./lib/URL"); +const URLSearchParams = require("./lib/URLSearchParams"); + +exports.URL = URL; +exports.URLSearchParams = URLSearchParams; diff --git a/node_modules/mongodb-connection-string-url/package.json b/node_modules/mongodb-connection-string-url/package.json new file mode 100644 index 000000000..cfb44d9f8 --- /dev/null +++ b/node_modules/mongodb-connection-string-url/package.json @@ -0,0 +1,62 @@ +{ + "name": "mongodb-connection-string-url", + "version": "2.5.2", + "description": "MongoDB connection strings, based on the WhatWG URL API", + "keywords": [ + "password", + "prompt", + "tty" + ], + "homepage": "https://github.com/mongodb-js/mongodb-connection-string-url", + "repository": { + "type": "git", + "url": "https://github.com/mongodb-js/mongodb-connection-string-url.git" + }, + "bugs": { + "url": "https://github.com/mongodb-js/mongodb-connection-string-url/issues" + }, + "main": "lib/index.js", + "exports": { + "require": "./lib/index.js", + "import": "./.esm-wrapper.mjs" + }, + "files": [ + "LICENSE", + "lib", + "package.json", + "README.md", + ".esm-wrapper.mjs" + ], + "scripts": { + "lint": "eslint \"{src,test}/**/*.ts\"", + "test": "npm run lint && npm run build && nyc mocha --colors -r ts-node/register test/*.ts", + "build": "npm run compile-ts && gen-esm-wrapper . ./.esm-wrapper.mjs", + "prepack": "npm run build", + "compile-ts": "tsc -p tsconfig.json" + }, + "license": "Apache-2.0", + "devDependencies": { + "@types/chai": "^4.2.5", + "@types/mocha": "^8.0.3", + "@types/node": "^14.11.1", + "@typescript-eslint/eslint-plugin": "^4.2.0", + "@typescript-eslint/parser": "^4.2.0", + "chai": "^4.2.0", + "eslint": "^7.9.0", + "eslint-config-semistandard": "^15.0.1", + "eslint-config-standard": "^14.1.1", + "eslint-plugin-import": "^2.22.0", + "eslint-plugin-node": "^11.1.0", + "eslint-plugin-promise": "^4.2.1", + "eslint-plugin-standard": "^4.0.1", + "gen-esm-wrapper": "^1.1.3", + "mocha": "^8.1.3", + "nyc": "^15.1.0", + "ts-node": "^9.0.0", + "typescript": "^4.0.3" + }, + "dependencies": { + "@types/whatwg-url": "^8.2.1", + "whatwg-url": "^11.0.0" + } +} diff --git a/node_modules/mongodb/LICENSE.md b/node_modules/mongodb/LICENSE.md new file mode 100644 index 000000000..ad410e113 --- /dev/null +++ b/node_modules/mongodb/LICENSE.md @@ -0,0 +1,201 @@ +Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright {yyyy} {name of copyright owner} + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. \ No newline at end of file diff --git a/node_modules/mongodb/README.md b/node_modules/mongodb/README.md new file mode 100644 index 000000000..1811de369 --- /dev/null +++ b/node_modules/mongodb/README.md @@ -0,0 +1,280 @@ +# MongoDB NodeJS Driver + +The official [MongoDB](https://www.mongodb.com/) driver for Node.js. + +**Upgrading to version 4? Take a look at our [upgrade guide here](https://github.com/mongodb/node-mongodb-native/blob/HEAD/etc/notes/CHANGES_4.0.0.md)!** + +## Quick Links + +| what | where | +| ------------- | ------------------------------------------------------------------------------------------------------- | +| documentation | [docs.mongodb.com/drivers/node](https://docs.mongodb.com/drivers/node) | +| api-doc | [mongodb.github.io/node-mongodb-native/](https://mongodb.github.io/node-mongodb-native/) | +| npm package | [www.npmjs.com/package/mongodb](https://www.npmjs.com/package/mongodb) | +| source | [github.com/mongodb/node-mongodb-native](https://github.com/mongodb/node-mongodb-native) | +| mongodb | [www.mongodb.com](https://www.mongodb.com) | +| changelog | [HISTORY.md](https://github.com/mongodb/node-mongodb-native/blob/HEAD/HISTORY.md) | +| upgrade to v4 | [etc/notes/CHANGES_4.0.0.md](https://github.com/mongodb/node-mongodb-native/blob/HEAD/etc/notes/CHANGES_4.0.0.md) | +| contributing | [CONTRIBUTING.md](https://github.com/mongodb/node-mongodb-native/blob/HEAD/CONTRIBUTING.md) | + +### Bugs / Feature Requests + +Think you’ve found a bug? Want to see a new feature in `node-mongodb-native`? Please open a +case in our issue management tool, JIRA: + +- Create an account and login [jira.mongodb.org](https://jira.mongodb.org). +- Navigate to the NODE project [jira.mongodb.org/browse/NODE](https://jira.mongodb.org/browse/NODE). +- Click **Create Issue** - Please provide as much information as possible about the issue type and how to reproduce it. + +Bug reports in JIRA for all driver projects (i.e. NODE, PYTHON, CSHARP, JAVA) and the +Core Server (i.e. SERVER) project are **public**. + +### Support / Feedback + +For issues with, questions about, or feedback for the Node.js driver, please look into our [support channels](https://docs.mongodb.com/manual/support). Please do not email any of the driver developers directly with issues or questions - you're more likely to get an answer on the [MongoDB Community Forums](https://community.mongodb.com/tags/c/drivers-odms-connectors/7/node-js-driver). + +### Change Log + +Change history can be found in [`HISTORY.md`](https://github.com/mongodb/node-mongodb-native/blob/HEAD/HISTORY.md). + +### Compatibility + +For version compatibility matrices, please refer to the following links: + +- [MongoDB](https://docs.mongodb.com/drivers/node/current/compatibility/#mongodb-compatibility) +- [NodeJS](https://docs.mongodb.com/drivers/node/current/compatibility/#language-compatibility) + +#### Typescript Version + +We recommend using the latest version of typescript, however we currently ensure the driver's public types compile against `typescript@4.1.6`. +This is the lowest typescript version guaranteed to work with our driver: older versions may or may not work - use at your own risk. +Since typescript [does not restrict breaking changes to major versions](https://github.com/Microsoft/TypeScript/wiki/Breaking-Changes) we consider this support best effort. +If you run into any unexpected compiler failures against our supported TypeScript versions please let us know by filing an issue on our [JIRA](https://jira.mongodb.org/browse/NODE). + +## Installation + +The recommended way to get started using the Node.js 4.x driver is by using the `npm` (Node Package Manager) to install the dependency in your project. + +After you've created your own project using `npm init`, you can run: + +```bash +npm install mongodb +# or ... +yarn add mongodb +``` + +This will download the MongoDB driver and add a dependency entry in your `package.json` file. + +If you are a Typescript user, you will need the Node.js type definitions to use the driver's definitions: + +```sh +npm install -D @types/node +``` + +## Troubleshooting + +The MongoDB driver depends on several other packages. These are: + +- [bson](https://github.com/mongodb/js-bson) +- [bson-ext](https://github.com/mongodb-js/bson-ext) +- [kerberos](https://github.com/mongodb-js/kerberos) +- [mongodb-client-encryption](https://github.com/mongodb/libmongocrypt#readme) + +Some of these packages include native C++ extensions. Consult the [trouble shooting guide here](https://github.com/mongodb/node-mongodb-native/blob/HEAD/etc/notes/native-extensions.md) if you run into issues. + +## Quick Start + +This guide will show you how to set up a simple application using Node.js and MongoDB. Its scope is only how to set up the driver and perform the simple CRUD operations. For more in-depth coverage, see the [official documentation](https://docs.mongodb.com/drivers/node/). + +### Create the `package.json` file + +First, create a directory where your application will live. + +```bash +mkdir myProject +cd myProject +``` + +Enter the following command and answer the questions to create the initial structure for your new project: + +```bash +npm init -y +``` + +Next, install the driver as a dependency. + +```bash +npm install mongodb +``` + +### Start a MongoDB Server + +For complete MongoDB installation instructions, see [the manual](https://docs.mongodb.org/manual/installation/). + +1. Download the right MongoDB version from [MongoDB](https://www.mongodb.org/downloads) +2. Create a database directory (in this case under **/data**). +3. Install and start a `mongod` process. + +```bash +mongod --dbpath=/data +``` + +You should see the **mongod** process start up and print some status information. + +### Connect to MongoDB + +Create a new **app.js** file and add the following code to try out some basic CRUD +operations using the MongoDB driver. + +Add code to connect to the server and the database **myProject**: + +> **NOTE:** All the examples below use async/await syntax. +> +> However, all async API calls support an optional callback as the final argument, +> if a callback is provided a Promise will not be returned. + +```js +const { MongoClient } = require('mongodb'); +// or as an es module: +// import { MongoClient } from 'mongodb' + +// Connection URL +const url = 'mongodb://localhost:27017'; +const client = new MongoClient(url); + +// Database Name +const dbName = 'myProject'; + +async function main() { + // Use connect method to connect to the server + await client.connect(); + console.log('Connected successfully to server'); + const db = client.db(dbName); + const collection = db.collection('documents'); + + // the following code examples can be pasted here... + + return 'done.'; +} + +main() + .then(console.log) + .catch(console.error) + .finally(() => client.close()); +``` + +Run your app from the command line with: + +```bash +node app.js +``` + +The application should print **Connected successfully to server** to the console. + +### Insert a Document + +Add to **app.js** the following function which uses the **insertMany** +method to add three documents to the **documents** collection. + +```js +const insertResult = await collection.insertMany([{ a: 1 }, { a: 2 }, { a: 3 }]); +console.log('Inserted documents =>', insertResult); +``` + +The **insertMany** command returns an object with information about the insert operations. + +### Find All Documents + +Add a query that returns all the documents. + +```js +const findResult = await collection.find({}).toArray(); +console.log('Found documents =>', findResult); +``` + +This query returns all the documents in the **documents** collection. +If you add this below the insertMany example you'll see the document's you've inserted. + +### Find Documents with a Query Filter + +Add a query filter to find only documents which meet the query criteria. + +```js +const filteredDocs = await collection.find({ a: 3 }).toArray(); +console.log('Found documents filtered by { a: 3 } =>', filteredDocs); +``` + +Only the documents which match `'a' : 3` should be returned. + +### Update a document + +The following operation updates a document in the **documents** collection. + +```js +const updateResult = await collection.updateOne({ a: 3 }, { $set: { b: 1 } }); +console.log('Updated documents =>', updateResult); +``` + +The method updates the first document where the field **a** is equal to **3** by adding a new field **b** to the document set to **1**. `updateResult` contains information about whether there was a matching document to update or not. + +### Remove a document + +Remove the document where the field **a** is equal to **3**. + +```js +const deleteResult = await collection.deleteMany({ a: 3 }); +console.log('Deleted documents =>', deleteResult); +``` + +### Index a Collection + +[Indexes](https://docs.mongodb.org/manual/indexes/) can improve your application's +performance. The following function creates an index on the **a** field in the +**documents** collection. + +```js +const indexName = await collection.createIndex({ a: 1 }); +console.log('index name =', indexName); +``` + +For more detailed information, see the [indexing strategies page](https://docs.mongodb.com/manual/applications/indexes/). + +## Error Handling + +If you need to filter certain errors from our driver we have a helpful tree of errors described in [etc/notes/errors.md](https://github.com/mongodb/node-mongodb-native/blob/HEAD/etc/notes/errors.md). + +It is our recommendation to use `instanceof` checks on errors and to avoid relying on parsing `error.message` and `error.name` strings in your code. +We guarantee `instanceof` checks will pass according to semver guidelines, but errors may be sub-classed or their messages may change at any time, even patch releases, as we see fit to increase the helpfulness of the errors. + +Any new errors we add to the driver will directly extend an existing error class and no existing error will be moved to a different parent class outside of a major release. +This means `instanceof` will always be able to accurately capture the errors that our driver throws (or returns in a callback). + +```typescript +const client = new MongoClient(url); +await client.connect(); +const collection = client.db().collection('collection'); + +try { + await collection.insertOne({ _id: 1 }); + await collection.insertOne({ _id: 1 }); // duplicate key error +} catch (error) { + if (error instanceof MongoServerError) { + console.log(`Error worth logging: ${error}`); // special case for some reason + } + throw error; // still want to crash +} +``` + +## Next Steps + +- [MongoDB Documentation](https://docs.mongodb.com/manual/) +- [MongoDB Node Driver Documentation](https://docs.mongodb.com/drivers/node/) +- [Read about Schemas](https://docs.mongodb.com/manual/core/data-modeling-introduction/) +- [Star us on GitHub](https://github.com/mongodb/node-mongodb-native) + +## License + +[Apache 2.0](LICENSE.md) + +© 2009-2012 Christian Amor Kvalheim +© 2012-present MongoDB [Contributors](https://github.com/mongodb/node-mongodb-native/blob/HEAD/CONTRIBUTORS.md) diff --git a/node_modules/mongodb/etc/prepare.js b/node_modules/mongodb/etc/prepare.js new file mode 100644 index 000000000..2039d0b33 --- /dev/null +++ b/node_modules/mongodb/etc/prepare.js @@ -0,0 +1,12 @@ +#! /usr/bin/env node +var cp = require('child_process'); +var fs = require('fs'); +var os = require('os'); + +if (fs.existsSync('src')) { + cp.spawn('npm', ['run', 'build:dts'], { stdio: 'inherit', shell: os.platform() === 'win32' }); +} else { + if (!fs.existsSync('lib')) { + console.warn('MongoDB: No compiled javascript present, the driver is not installed correctly.'); + } +} diff --git a/node_modules/mongodb/lib/admin.js b/node_modules/mongodb/lib/admin.js new file mode 100644 index 000000000..f984a9ee5 --- /dev/null +++ b/node_modules/mongodb/lib/admin.js @@ -0,0 +1,123 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Admin = void 0; +const add_user_1 = require("./operations/add_user"); +const execute_operation_1 = require("./operations/execute_operation"); +const list_databases_1 = require("./operations/list_databases"); +const remove_user_1 = require("./operations/remove_user"); +const run_command_1 = require("./operations/run_command"); +const validate_collection_1 = require("./operations/validate_collection"); +/** + * The **Admin** class is an internal class that allows convenient access to + * the admin functionality and commands for MongoDB. + * + * **ADMIN Cannot directly be instantiated** + * @public + * + * @example + * ```js + * const MongoClient = require('mongodb').MongoClient; + * const test = require('assert'); + * // Connection url + * const url = 'mongodb://localhost:27017'; + * // Database Name + * const dbName = 'test'; + * + * // Connect using MongoClient + * MongoClient.connect(url, function(err, client) { + * // Use the admin database for the operation + * const adminDb = client.db(dbName).admin(); + * + * // List all the available databases + * adminDb.listDatabases(function(err, dbs) { + * expect(err).to.not.exist; + * test.ok(dbs.databases.length > 0); + * client.close(); + * }); + * }); + * ``` + */ +class Admin { + /** + * Create a new Admin instance + * @internal + */ + constructor(db) { + this.s = { db }; + } + command(command, options, callback) { + if (typeof options === 'function') + (callback = options), (options = {}); + options = Object.assign({ dbName: 'admin' }, options); + return (0, execute_operation_1.executeOperation)(this.s.db.s.client, new run_command_1.RunCommandOperation(this.s.db, command, options), callback); + } + buildInfo(options, callback) { + if (typeof options === 'function') + (callback = options), (options = {}); + options = options !== null && options !== void 0 ? options : {}; + return this.command({ buildinfo: 1 }, options, callback); + } + serverInfo(options, callback) { + if (typeof options === 'function') + (callback = options), (options = {}); + options = options !== null && options !== void 0 ? options : {}; + return this.command({ buildinfo: 1 }, options, callback); + } + serverStatus(options, callback) { + if (typeof options === 'function') + (callback = options), (options = {}); + options = options !== null && options !== void 0 ? options : {}; + return this.command({ serverStatus: 1 }, options, callback); + } + ping(options, callback) { + if (typeof options === 'function') + (callback = options), (options = {}); + options = options !== null && options !== void 0 ? options : {}; + return this.command({ ping: 1 }, options, callback); + } + addUser(username, password, options, callback) { + if (typeof password === 'function') { + (callback = password), (password = undefined), (options = {}); + } + else if (typeof password !== 'string') { + if (typeof options === 'function') { + (callback = options), (options = password), (password = undefined); + } + else { + (options = password), (callback = undefined), (password = undefined); + } + } + else { + if (typeof options === 'function') + (callback = options), (options = {}); + } + options = Object.assign({ dbName: 'admin' }, options); + return (0, execute_operation_1.executeOperation)(this.s.db.s.client, new add_user_1.AddUserOperation(this.s.db, username, password, options), callback); + } + removeUser(username, options, callback) { + if (typeof options === 'function') + (callback = options), (options = {}); + options = Object.assign({ dbName: 'admin' }, options); + return (0, execute_operation_1.executeOperation)(this.s.db.s.client, new remove_user_1.RemoveUserOperation(this.s.db, username, options), callback); + } + validateCollection(collectionName, options, callback) { + if (typeof options === 'function') + (callback = options), (options = {}); + options = options !== null && options !== void 0 ? options : {}; + return (0, execute_operation_1.executeOperation)(this.s.db.s.client, new validate_collection_1.ValidateCollectionOperation(this, collectionName, options), callback); + } + listDatabases(options, callback) { + if (typeof options === 'function') + (callback = options), (options = {}); + options = options !== null && options !== void 0 ? options : {}; + return (0, execute_operation_1.executeOperation)(this.s.db.s.client, new list_databases_1.ListDatabasesOperation(this.s.db, options), callback); + } + replSetGetStatus(options, callback) { + if (typeof options === 'function') + (callback = options), (options = {}); + options = options !== null && options !== void 0 ? options : {}; + return this.command({ replSetGetStatus: 1 }, options, callback); + } +} +exports.Admin = Admin; +//# sourceMappingURL=admin.js.map \ No newline at end of file diff --git a/node_modules/mongodb/lib/admin.js.map b/node_modules/mongodb/lib/admin.js.map new file mode 100644 index 000000000..da5ef61d4 --- /dev/null +++ b/node_modules/mongodb/lib/admin.js.map @@ -0,0 +1 @@ +{"version":3,"file":"admin.js","sourceRoot":"","sources":["../src/admin.ts"],"names":[],"mappings":";;;AA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AAO,CAAC,EAAE,CAAC,OAAO,GAAG,EAAE,CAAC,CAAC;QACxE,OAAO,GAAG,OAAO,aAAP,OAAO,cAAP,OAAO,GAAI,EAAE,CAAC;QAExB,OAAO,IAAA,oCAAgB,EACrB,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,EAClB,IAAI,iDAA2B,CAAC,IAAI,EAAE,cAAc,EAAE,OAAO,CAAC,EAC9D,QAAQ,CACT,CAAC;IACJ,CAAC;IAYD,aAAa,CACX,OAA8D,EAC9D,QAAwC;QAExC,IAAI,OAAO,OAAO,KAAK,UAAU;YAAE,CAAC,QAAQ,GAAG,OAAO,CAAC,EAAE,CAAC,OAAO,GAAG,EAAE,CAAC,CAAC;QACxE,OAAO,GAAG,OAAO,aAAP,OAAO,cAAP,OAAO,GAAI,EAAE,CAAC;QAExB,OAAO,IAAA,oCAAgB,EACrB,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,EAClB,IAAI,uCAAsB,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,OAAO,CAAC,EAC9C,QAAQ,CACT,CAAC;IACJ,CAAC;IAYD,gBAAgB,CACd,OAAsD,EACtD,QAA6B;QAE7B,IAAI,OAAO,OAAO,KAAK,UAAU;YAAE,CAAC,QAAQ,GAAG,OAAO,CAAC,EAAE,CAAC,OAAO,GAAG,EAAE,CAAC,CAAC;QACxE,OAAO,GAAG,OAAO,aAAP,OAAO,cAAP,OAAO,GAAI,EAAE,CAAC;QACxB,OAAO,IAAI,CAAC,OAAO,CAAC,EAAE,gBAAgB,EAAE,CAAC,EAAE,EAAE,OAAO,EAAE,QAA8B,CAAC,CAAC;IACxF,CAAC;CACF;AApQD,sBAoQC"} \ No newline at end of file diff --git a/node_modules/mongodb/lib/bson.js b/node_modules/mongodb/lib/bson.js new file mode 100644 index 000000000..f825a907f --- /dev/null +++ b/node_modules/mongodb/lib/bson.js @@ -0,0 +1,69 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.resolveBSONOptions = exports.pluckBSONSerializeOptions = exports.Timestamp = exports.ObjectId = exports.MinKey = exports.MaxKey = exports.Map = exports.Long = exports.Int32 = exports.Double = exports.Decimal128 = exports.DBRef = exports.Code = exports.BSONSymbol = exports.BSONRegExp = exports.Binary = exports.calculateObjectSize = exports.serialize = exports.deserialize = void 0; +// eslint-disable-next-line @typescript-eslint/no-var-requires +let BSON = require('bson'); +try { + // Ensure you always wrap an optional require in the try block NODE-3199 + BSON = require('bson-ext'); +} +catch { } // eslint-disable-line +/** @internal */ +exports.deserialize = BSON.deserialize; +/** @internal */ +exports.serialize = BSON.serialize; +/** @internal */ +exports.calculateObjectSize = BSON.calculateObjectSize; +var bson_1 = require("bson"); +Object.defineProperty(exports, "Binary", { enumerable: true, get: function () { return bson_1.Binary; } }); +Object.defineProperty(exports, "BSONRegExp", { enumerable: true, get: function () { return bson_1.BSONRegExp; } }); +Object.defineProperty(exports, "BSONSymbol", { enumerable: true, get: function () { return bson_1.BSONSymbol; } }); +Object.defineProperty(exports, "Code", { enumerable: true, get: function () { return bson_1.Code; } }); +Object.defineProperty(exports, "DBRef", { enumerable: true, get: function () { return bson_1.DBRef; } }); +Object.defineProperty(exports, "Decimal128", { enumerable: true, get: function () { return bson_1.Decimal128; } }); +Object.defineProperty(exports, "Double", { enumerable: true, get: function () { return bson_1.Double; } }); +Object.defineProperty(exports, "Int32", { enumerable: true, get: function () { return bson_1.Int32; } }); +Object.defineProperty(exports, "Long", { enumerable: true, get: function () { return bson_1.Long; } }); +Object.defineProperty(exports, "Map", { enumerable: true, get: function () { return bson_1.Map; } }); +Object.defineProperty(exports, "MaxKey", { enumerable: true, get: function () { return bson_1.MaxKey; } }); +Object.defineProperty(exports, "MinKey", { enumerable: true, get: function () { return bson_1.MinKey; } }); +Object.defineProperty(exports, "ObjectId", { enumerable: true, get: function () { return bson_1.ObjectId; } }); +Object.defineProperty(exports, "Timestamp", { enumerable: true, get: function () { return bson_1.Timestamp; } }); +function pluckBSONSerializeOptions(options) { + const { fieldsAsRaw, promoteValues, promoteBuffers, promoteLongs, serializeFunctions, ignoreUndefined, bsonRegExp, raw, enableUtf8Validation } = options; + return { + fieldsAsRaw, + promoteValues, + promoteBuffers, + promoteLongs, + serializeFunctions, + ignoreUndefined, + bsonRegExp, + raw, + enableUtf8Validation + }; +} +exports.pluckBSONSerializeOptions = pluckBSONSerializeOptions; +/** + * Merge the given BSONSerializeOptions, preferring options over the parent's options, and + * substituting defaults for values not set. + * + * @internal + */ +function resolveBSONOptions(options, parent) { + var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t; + const parentOptions = parent === null || parent === void 0 ? void 0 : parent.bsonOptions; + return { + raw: (_b = (_a = options === null || options === void 0 ? void 0 : options.raw) !== null && _a !== void 0 ? _a : parentOptions === null || parentOptions === void 0 ? void 0 : parentOptions.raw) !== null && _b !== void 0 ? _b : false, + promoteLongs: (_d = (_c = options === null || options === void 0 ? void 0 : options.promoteLongs) !== null && _c !== void 0 ? _c : parentOptions === null || parentOptions === void 0 ? void 0 : parentOptions.promoteLongs) !== null && _d !== void 0 ? _d : true, + promoteValues: (_f = (_e = options === null || options === void 0 ? void 0 : options.promoteValues) !== null && _e !== void 0 ? _e : parentOptions === null || parentOptions === void 0 ? void 0 : parentOptions.promoteValues) !== null && _f !== void 0 ? _f : true, + promoteBuffers: (_h = (_g = options === null || options === void 0 ? void 0 : options.promoteBuffers) !== null && _g !== void 0 ? _g : parentOptions === null || parentOptions === void 0 ? void 0 : parentOptions.promoteBuffers) !== null && _h !== void 0 ? _h : false, + ignoreUndefined: (_k = (_j = options === null || options === void 0 ? void 0 : options.ignoreUndefined) !== null && _j !== void 0 ? _j : parentOptions === null || parentOptions === void 0 ? void 0 : parentOptions.ignoreUndefined) !== null && _k !== void 0 ? _k : false, + bsonRegExp: (_m = (_l = options === null || options === void 0 ? void 0 : options.bsonRegExp) !== null && _l !== void 0 ? _l : parentOptions === null || parentOptions === void 0 ? void 0 : parentOptions.bsonRegExp) !== null && _m !== void 0 ? _m : false, + serializeFunctions: (_p = (_o = options === null || options === void 0 ? void 0 : options.serializeFunctions) !== null && _o !== void 0 ? _o : parentOptions === null || parentOptions === void 0 ? void 0 : parentOptions.serializeFunctions) !== null && _p !== void 0 ? _p : false, + fieldsAsRaw: (_r = (_q = options === null || options === void 0 ? void 0 : options.fieldsAsRaw) !== null && _q !== void 0 ? _q : parentOptions === null || parentOptions === void 0 ? void 0 : parentOptions.fieldsAsRaw) !== null && _r !== void 0 ? _r : {}, + enableUtf8Validation: (_t = (_s = options === null || options === void 0 ? void 0 : options.enableUtf8Validation) !== null && _s !== void 0 ? _s : parentOptions === null || parentOptions === void 0 ? void 0 : parentOptions.enableUtf8Validation) !== null && _t !== void 0 ? _t : true + }; +} +exports.resolveBSONOptions = resolveBSONOptions; +//# sourceMappingURL=bson.js.map \ No newline at end of file diff --git a/node_modules/mongodb/lib/bson.js.map b/node_modules/mongodb/lib/bson.js.map new file mode 100644 index 000000000..fcd7b7a3f --- /dev/null +++ b/node_modules/mongodb/lib/bson.js.map @@ -0,0 +1 @@ +{"version":3,"file":"bson.js","sourceRoot":"","sources":["../src/bson.ts"],"names":[],"mappings":";;;AAQA,8DAA8D;AAC9D,IAAI,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;AAE3B,IAAI;IACF,wEAAwE;IACxE,IAAI,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;CAC5B;AAAC,MAAM,GAAE,CAAC,sBAAsB;AAEjC,gBAAgB;AACH,QAAA,WAAW,GAAG,IAAI,CAAC,WAAmC,CAAC;AACpE,gBAAgB;AACH,QAAA,SAAS,GAAG,IAAI,CAAC,SAA+B,CAAC;AAC9D,gBAAgB;AACH,QAAA,mBAAmB,GAAG,IAAI,CAAC,mBAAmD,CAAC;AAE5F,6BAgBc;AAfZ,8FAAA,MAAM,OAAA;AACN,kGAAA,UAAU,OA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,aAAP,OAAO,uBAAP,OAAO,CAAE,cAAc,mCAAI,aAAa,aAAb,aAAa,uBAAb,aAAa,CAAE,cAAc,mCAAI,KAAK;QACjF,eAAe,EAAE,MAAA,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,eAAe,mCAAI,aAAa,aAAb,aAAa,uBAAb,aAAa,CAAE,eAAe,mCAAI,KAAK;QACpF,UAAU,EAAE,MAAA,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,UAAU,mCAAI,aAAa,aAAb,aAAa,uBAAb,aAAa,CAAE,UAAU,mCAAI,KAAK;QACrE,kBAAkB,EAAE,MAAA,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,kBAAkB,mCAAI,aAAa,aAAb,aAAa,uBAAb,aAAa,CAAE,kBAAkB,mCAAI,KAAK;QAC7F,WAAW,EAAE,MAAA,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,WAAW,mCAAI,aAAa,aAAb,aAAa,uBAAb,aAAa,CAAE,WAAW,mCAAI,EAAE;QACrE,oBAAoB,EAClB,MAAA,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,oBAAoB,mCAAI,aAAa,aAAb,aAAa,uBAAb,aAAa,CAAE,oBAAoB,mCAAI,IAAI;KAC/E,CAAC;AACJ,CAAC;AAjBD,gDAiBC"} \ No newline at end of file diff --git a/node_modules/mongodb/lib/bulk/common.js b/node_modules/mongodb/lib/bulk/common.js new file mode 100644 index 000000000..330761cab --- /dev/null +++ b/node_modules/mongodb/lib/bulk/common.js @@ -0,0 +1,966 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.BulkOperationBase = exports.FindOperators = exports.MongoBulkWriteError = exports.mergeBatchResults = exports.WriteError = exports.WriteConcernError = exports.BulkWriteResult = exports.Batch = exports.BatchType = void 0; +const bson_1 = require("../bson"); +const error_1 = require("../error"); +const delete_1 = require("../operations/delete"); +const execute_operation_1 = require("../operations/execute_operation"); +const insert_1 = require("../operations/insert"); +const operation_1 = require("../operations/operation"); +const update_1 = require("../operations/update"); +const promise_provider_1 = require("../promise_provider"); +const utils_1 = require("../utils"); +const write_concern_1 = require("../write_concern"); +/** @internal */ +const kServerError = Symbol('serverError'); +/** @public */ +exports.BatchType = Object.freeze({ + INSERT: 1, + UPDATE: 2, + DELETE: 3 +}); +/** + * Keeps the state of a unordered batch so we can rewrite the results + * correctly after command execution + * + * @public + */ +class Batch { + constructor(batchType, originalZeroIndex) { + this.originalZeroIndex = originalZeroIndex; + this.currentIndex = 0; + this.originalIndexes = []; + this.batchType = batchType; + this.operations = []; + this.size = 0; + this.sizeBytes = 0; + } +} +exports.Batch = Batch; +/** + * @public + * The result of a bulk write. + */ +class BulkWriteResult { + /** + * Create a new BulkWriteResult instance + * @internal + */ + constructor(bulkResult) { + this.result = bulkResult; + } + /** Number of documents inserted. */ + get insertedCount() { + var _a; + return (_a = this.result.nInserted) !== null && _a !== void 0 ? _a : 0; + } + /** Number of documents matched for update. */ + get matchedCount() { + var _a; + return (_a = this.result.nMatched) !== null && _a !== void 0 ? _a : 0; + } + /** Number of documents modified. */ + get modifiedCount() { + var _a; + return (_a = this.result.nModified) !== null && _a !== void 0 ? _a : 0; + } + /** Number of documents deleted. */ + get deletedCount() { + var _a; + return (_a = this.result.nRemoved) !== null && _a !== void 0 ? _a : 0; + } + /** Number of documents upserted. */ + get upsertedCount() { + var _a; + return (_a = this.result.upserted.length) !== null && _a !== void 0 ? _a : 0; + } + /** Upserted document generated Id's, hash key is the index of the originating operation */ + get upsertedIds() { + var _a; + const upserted = {}; + for (const doc of (_a = this.result.upserted) !== null && _a !== void 0 ? _a : []) { + upserted[doc.index] = doc._id; + } + return upserted; + } + /** Inserted document generated Id's, hash key is the index of the originating operation */ + get insertedIds() { + var _a; + const inserted = {}; + for (const doc of (_a = this.result.insertedIds) !== null && _a !== void 0 ? _a : []) { + inserted[doc.index] = doc._id; + } + return inserted; + } + /** Evaluates to true if the bulk operation correctly executes */ + get ok() { + return this.result.ok; + } + /** The number of inserted documents */ + get nInserted() { + return this.result.nInserted; + } + /** Number of upserted documents */ + get nUpserted() { + return this.result.nUpserted; + } + /** Number of matched documents */ + get nMatched() { + return this.result.nMatched; + } + /** Number of documents updated physically on disk */ + get nModified() { + return this.result.nModified; + } + /** Number of removed documents */ + get nRemoved() { + return this.result.nRemoved; + } + /** Returns an array of all inserted ids */ + getInsertedIds() { + return this.result.insertedIds; + } + /** Returns an array of all upserted ids */ + getUpsertedIds() { + return this.result.upserted; + } + /** Returns the upserted id at the given index */ + getUpsertedIdAt(index) { + return this.result.upserted[index]; + } + /** Returns raw internal result */ + getRawResponse() { + return this.result; + } + /** Returns true if the bulk operation contains a write error */ + hasWriteErrors() { + return this.result.writeErrors.length > 0; + } + /** Returns the number of write errors off the bulk operation */ + getWriteErrorCount() { + return this.result.writeErrors.length; + } + /** Returns a specific write error object */ + getWriteErrorAt(index) { + return index < this.result.writeErrors.length ? this.result.writeErrors[index] : undefined; + } + /** Retrieve all write errors */ + getWriteErrors() { + return this.result.writeErrors; + } + /** Retrieve lastOp if available */ + getLastOp() { + return this.result.opTime; + } + /** Retrieve the write concern error if one exists */ + getWriteConcernError() { + if (this.result.writeConcernErrors.length === 0) { + return; + } + else if (this.result.writeConcernErrors.length === 1) { + // Return the error + return this.result.writeConcernErrors[0]; + } + else { + // Combine the errors + let errmsg = ''; + for (let i = 0; i < this.result.writeConcernErrors.length; i++) { + const err = this.result.writeConcernErrors[i]; + errmsg = errmsg + err.errmsg; + // TODO: Something better + if (i === 0) + errmsg = errmsg + ' and '; + } + return new WriteConcernError({ errmsg, code: error_1.MONGODB_ERROR_CODES.WriteConcernFailed }); + } + } + toJSON() { + return this.result; + } + toString() { + return `BulkWriteResult(${this.toJSON()})`; + } + isOk() { + return this.result.ok === 1; + } +} +exports.BulkWriteResult = BulkWriteResult; +/** + * An error representing a failure by the server to apply the requested write concern to the bulk operation. + * @public + * @category Error + */ +class WriteConcernError { + constructor(error) { + this[kServerError] = error; + } + /** Write concern error code. */ + get code() { + return this[kServerError].code; + } + /** Write concern error message. */ + get errmsg() { + return this[kServerError].errmsg; + } + /** Write concern error info. */ + get errInfo() { + return this[kServerError].errInfo; + } + /** @deprecated The `err` prop that contained a MongoServerError has been deprecated. */ + get err() { + return this[kServerError]; + } + toJSON() { + return this[kServerError]; + } + toString() { + return `WriteConcernError(${this.errmsg})`; + } +} +exports.WriteConcernError = WriteConcernError; +/** + * An error that occurred during a BulkWrite on the server. + * @public + * @category Error + */ +class WriteError { + constructor(err) { + this.err = err; + } + /** WriteError code. */ + get code() { + return this.err.code; + } + /** WriteError original bulk operation index. */ + get index() { + return this.err.index; + } + /** WriteError message. */ + get errmsg() { + return this.err.errmsg; + } + /** WriteError details. */ + get errInfo() { + return this.err.errInfo; + } + /** Returns the underlying operation that caused the error */ + getOperation() { + return this.err.op; + } + toJSON() { + return { code: this.err.code, index: this.err.index, errmsg: this.err.errmsg, op: this.err.op }; + } + toString() { + return `WriteError(${JSON.stringify(this.toJSON())})`; + } +} +exports.WriteError = WriteError; +/** Converts the number to a Long or returns it. */ +function longOrConvert(value) { + return typeof value === 'number' ? bson_1.Long.fromNumber(value) : value; +} +/** Merges results into shared data structure */ +function mergeBatchResults(batch, bulkResult, err, result) { + // If we have an error set the result to be the err object + if (err) { + result = err; + } + else if (result && result.result) { + result = result.result; + } + if (result == null) { + return; + } + // Do we have a top level error stop processing and return + if (result.ok === 0 && bulkResult.ok === 1) { + bulkResult.ok = 0; + const writeError = { + index: 0, + code: result.code || 0, + errmsg: result.message, + errInfo: result.errInfo, + op: batch.operations[0] + }; + bulkResult.writeErrors.push(new WriteError(writeError)); + return; + } + else if (result.ok === 0 && bulkResult.ok === 0) { + return; + } + // The server write command specification states that lastOp is an optional + // mongod only field that has a type of timestamp. Across various scarce specs + // where opTime is mentioned, it is an "opaque" object that can have a "ts" and + // "t" field with Timestamp and Long as their types respectively. + // The "lastOp" field of the bulk write result is never mentioned in the driver + // specifications or the bulk write spec, so we should probably just keep its + // value consistent since it seems to vary. + // See: https://github.com/mongodb/specifications/blob/master/source/driver-bulk-update.rst#results-object + if (result.opTime || result.lastOp) { + let opTime = result.lastOp || result.opTime; + // If the opTime is a Timestamp, convert it to a consistent format to be + // able to compare easily. Converting to the object from a timestamp is + // much more straightforward than the other direction. + if (opTime._bsontype === 'Timestamp') { + opTime = { ts: opTime, t: bson_1.Long.ZERO }; + } + // If there's no lastOp, just set it. + if (!bulkResult.opTime) { + bulkResult.opTime = opTime; + } + else { + // First compare the ts values and set if the opTimeTS value is greater. + const lastOpTS = longOrConvert(bulkResult.opTime.ts); + const opTimeTS = longOrConvert(opTime.ts); + if (opTimeTS.greaterThan(lastOpTS)) { + bulkResult.opTime = opTime; + } + else if (opTimeTS.equals(lastOpTS)) { + // If the ts values are equal, then compare using the t values. + const lastOpT = longOrConvert(bulkResult.opTime.t); + const opTimeT = longOrConvert(opTime.t); + if (opTimeT.greaterThan(lastOpT)) { + bulkResult.opTime = opTime; + } + } + } + } + // If we have an insert Batch type + if (isInsertBatch(batch) && result.n) { + bulkResult.nInserted = bulkResult.nInserted + result.n; + } + // If we have an insert Batch type + if (isDeleteBatch(batch) && result.n) { + bulkResult.nRemoved = bulkResult.nRemoved + result.n; + } + let nUpserted = 0; + // We have an array of upserted values, we need to rewrite the indexes + if (Array.isArray(result.upserted)) { + nUpserted = result.upserted.length; + for (let i = 0; i < result.upserted.length; i++) { + bulkResult.upserted.push({ + index: result.upserted[i].index + batch.originalZeroIndex, + _id: result.upserted[i]._id + }); + } + } + else if (result.upserted) { + nUpserted = 1; + bulkResult.upserted.push({ + index: batch.originalZeroIndex, + _id: result.upserted + }); + } + // If we have an update Batch type + if (isUpdateBatch(batch) && result.n) { + const nModified = result.nModified; + bulkResult.nUpserted = bulkResult.nUpserted + nUpserted; + bulkResult.nMatched = bulkResult.nMatched + (result.n - nUpserted); + if (typeof nModified === 'number') { + bulkResult.nModified = bulkResult.nModified + nModified; + } + else { + bulkResult.nModified = 0; + } + } + if (Array.isArray(result.writeErrors)) { + for (let i = 0; i < result.writeErrors.length; i++) { + const writeError = { + index: batch.originalIndexes[result.writeErrors[i].index], + code: result.writeErrors[i].code, + errmsg: result.writeErrors[i].errmsg, + errInfo: result.writeErrors[i].errInfo, + op: batch.operations[result.writeErrors[i].index] + }; + bulkResult.writeErrors.push(new WriteError(writeError)); + } + } + if (result.writeConcernError) { + bulkResult.writeConcernErrors.push(new WriteConcernError(result.writeConcernError)); + } +} +exports.mergeBatchResults = mergeBatchResults; +function executeCommands(bulkOperation, options, callback) { + if (bulkOperation.s.batches.length === 0) { + return callback(undefined, new BulkWriteResult(bulkOperation.s.bulkResult)); + } + const batch = bulkOperation.s.batches.shift(); + function resultHandler(err, result) { + // Error is a driver related error not a bulk op error, return early + if (err && 'message' in err && !(err instanceof error_1.MongoWriteConcernError)) { + return callback(new MongoBulkWriteError(err, new BulkWriteResult(bulkOperation.s.bulkResult))); + } + if (err instanceof error_1.MongoWriteConcernError) { + return handleMongoWriteConcernError(batch, bulkOperation.s.bulkResult, err, callback); + } + // Merge the results together + const writeResult = new BulkWriteResult(bulkOperation.s.bulkResult); + const mergeResult = mergeBatchResults(batch, bulkOperation.s.bulkResult, err, result); + if (mergeResult != null) { + return callback(undefined, writeResult); + } + if (bulkOperation.handleWriteError(callback, writeResult)) + return; + // Execute the next command in line + executeCommands(bulkOperation, options, callback); + } + const finalOptions = (0, utils_1.resolveOptions)(bulkOperation, { + ...options, + ordered: bulkOperation.isOrdered + }); + if (finalOptions.bypassDocumentValidation !== true) { + delete finalOptions.bypassDocumentValidation; + } + // Set an operationIf if provided + if (bulkOperation.operationId) { + resultHandler.operationId = bulkOperation.operationId; + } + // Is the bypassDocumentValidation options specific + if (bulkOperation.s.bypassDocumentValidation === true) { + finalOptions.bypassDocumentValidation = true; + } + // Is the checkKeys option disabled + if (bulkOperation.s.checkKeys === false) { + finalOptions.checkKeys = false; + } + if (finalOptions.retryWrites) { + if (isUpdateBatch(batch)) { + finalOptions.retryWrites = finalOptions.retryWrites && !batch.operations.some(op => op.multi); + } + if (isDeleteBatch(batch)) { + finalOptions.retryWrites = + finalOptions.retryWrites && !batch.operations.some(op => op.limit === 0); + } + } + try { + if (isInsertBatch(batch)) { + (0, execute_operation_1.executeOperation)(bulkOperation.s.collection.s.db.s.client, new insert_1.InsertOperation(bulkOperation.s.namespace, batch.operations, finalOptions), resultHandler); + } + else if (isUpdateBatch(batch)) { + (0, execute_operation_1.executeOperation)(bulkOperation.s.collection.s.db.s.client, new update_1.UpdateOperation(bulkOperation.s.namespace, batch.operations, finalOptions), resultHandler); + } + else if (isDeleteBatch(batch)) { + (0, execute_operation_1.executeOperation)(bulkOperation.s.collection.s.db.s.client, new delete_1.DeleteOperation(bulkOperation.s.namespace, batch.operations, finalOptions), resultHandler); + } + } + catch (err) { + // Force top level error + err.ok = 0; + // Merge top level error and return + mergeBatchResults(batch, bulkOperation.s.bulkResult, err, undefined); + callback(); + } +} +function handleMongoWriteConcernError(batch, bulkResult, err, callback) { + var _a, _b; + mergeBatchResults(batch, bulkResult, undefined, err.result); + callback(new MongoBulkWriteError({ + message: (_a = err.result) === null || _a === void 0 ? void 0 : _a.writeConcernError.errmsg, + code: (_b = err.result) === null || _b === void 0 ? void 0 : _b.writeConcernError.result + }, new BulkWriteResult(bulkResult))); +} +/** + * An error indicating an unsuccessful Bulk Write + * @public + * @category Error + */ +class MongoBulkWriteError extends error_1.MongoServerError { + /** Creates a new MongoBulkWriteError */ + constructor(error, result) { + var _a; + super(error); + this.writeErrors = []; + if (error instanceof WriteConcernError) + this.err = error; + else if (!(error instanceof Error)) { + this.message = error.message; + this.code = error.code; + this.writeErrors = (_a = error.writeErrors) !== null && _a !== void 0 ? _a : []; + } + this.result = result; + Object.assign(this, error); + } + get name() { + return 'MongoBulkWriteError'; + } + /** Number of documents inserted. */ + get insertedCount() { + return this.result.insertedCount; + } + /** Number of documents matched for update. */ + get matchedCount() { + return this.result.matchedCount; + } + /** Number of documents modified. */ + get modifiedCount() { + return this.result.modifiedCount; + } + /** Number of documents deleted. */ + get deletedCount() { + return this.result.deletedCount; + } + /** Number of documents upserted. */ + get upsertedCount() { + return this.result.upsertedCount; + } + /** Inserted document generated Id's, hash key is the index of the originating operation */ + get insertedIds() { + return this.result.insertedIds; + } + /** Upserted document generated Id's, hash key is the index of the originating operation */ + get upsertedIds() { + return this.result.upsertedIds; + } +} +exports.MongoBulkWriteError = MongoBulkWriteError; +/** + * A builder object that is returned from {@link BulkOperationBase#find}. + * Is used to build a write operation that involves a query filter. + * + * @public + */ +class FindOperators { + /** + * Creates a new FindOperators object. + * @internal + */ + constructor(bulkOperation) { + this.bulkOperation = bulkOperation; + } + /** Add a multiple update operation to the bulk operation */ + update(updateDocument) { + const currentOp = buildCurrentOp(this.bulkOperation); + return this.bulkOperation.addToOperationsList(exports.BatchType.UPDATE, (0, update_1.makeUpdateStatement)(currentOp.selector, updateDocument, { + ...currentOp, + multi: true + })); + } + /** Add a single update operation to the bulk operation */ + updateOne(updateDocument) { + if (!(0, utils_1.hasAtomicOperators)(updateDocument)) { + throw new error_1.MongoInvalidArgumentError('Update document requires atomic operators'); + } + const currentOp = buildCurrentOp(this.bulkOperation); + return this.bulkOperation.addToOperationsList(exports.BatchType.UPDATE, (0, update_1.makeUpdateStatement)(currentOp.selector, updateDocument, { ...currentOp, multi: false })); + } + /** Add a replace one operation to the bulk operation */ + replaceOne(replacement) { + if ((0, utils_1.hasAtomicOperators)(replacement)) { + throw new error_1.MongoInvalidArgumentError('Replacement document must not use atomic operators'); + } + const currentOp = buildCurrentOp(this.bulkOperation); + return this.bulkOperation.addToOperationsList(exports.BatchType.UPDATE, (0, update_1.makeUpdateStatement)(currentOp.selector, replacement, { ...currentOp, multi: false })); + } + /** Add a delete one operation to the bulk operation */ + deleteOne() { + const currentOp = buildCurrentOp(this.bulkOperation); + return this.bulkOperation.addToOperationsList(exports.BatchType.DELETE, (0, delete_1.makeDeleteStatement)(currentOp.selector, { ...currentOp, limit: 1 })); + } + /** Add a delete many operation to the bulk operation */ + delete() { + const currentOp = buildCurrentOp(this.bulkOperation); + return this.bulkOperation.addToOperationsList(exports.BatchType.DELETE, (0, delete_1.makeDeleteStatement)(currentOp.selector, { ...currentOp, limit: 0 })); + } + /** Upsert modifier for update bulk operation, noting that this operation is an upsert. */ + upsert() { + if (!this.bulkOperation.s.currentOp) { + this.bulkOperation.s.currentOp = {}; + } + this.bulkOperation.s.currentOp.upsert = true; + return this; + } + /** Specifies the collation for the query condition. */ + collation(collation) { + if (!this.bulkOperation.s.currentOp) { + this.bulkOperation.s.currentOp = {}; + } + this.bulkOperation.s.currentOp.collation = collation; + return this; + } + /** Specifies arrayFilters for UpdateOne or UpdateMany bulk operations. */ + arrayFilters(arrayFilters) { + if (!this.bulkOperation.s.currentOp) { + this.bulkOperation.s.currentOp = {}; + } + this.bulkOperation.s.currentOp.arrayFilters = arrayFilters; + return this; + } +} +exports.FindOperators = FindOperators; +/** + * TODO(NODE-4063) + * BulkWrites merge complexity is implemented in executeCommands + * This provides a vehicle to treat bulkOperations like any other operation (hence "shim") + * We would like this logic to simply live inside the BulkWriteOperation class + * @internal + */ +class BulkWriteShimOperation extends operation_1.AbstractOperation { + constructor(bulkOperation, options) { + super(options); + this.bulkOperation = bulkOperation; + } + execute(server, session, callback) { + if (this.options.session == null) { + // An implicit session could have been created by 'executeOperation' + // So if we stick it on finalOptions here, each bulk operation + // will use this same session, it'll be passed in the same way + // an explicit session would be + this.options.session = session; + } + return executeCommands(this.bulkOperation, this.options, callback); + } +} +/** @public */ +class BulkOperationBase { + /** + * Create a new OrderedBulkOperation or UnorderedBulkOperation instance + * @internal + */ + constructor(collection, options, isOrdered) { + // determine whether bulkOperation is ordered or unordered + this.isOrdered = isOrdered; + const topology = (0, utils_1.getTopology)(collection); + options = options == null ? {} : options; + // TODO Bring from driver information in hello + // Get the namespace for the write operations + const namespace = collection.s.namespace; + // Used to mark operation as executed + const executed = false; + // Current item + const currentOp = undefined; + // Set max byte size + const hello = topology.lastHello(); + // If we have autoEncryption on, batch-splitting must be done on 2mb chunks, but single documents + // over 2mb are still allowed + const usingAutoEncryption = !!(topology.s.options && topology.s.options.autoEncrypter); + const maxBsonObjectSize = hello && hello.maxBsonObjectSize ? hello.maxBsonObjectSize : 1024 * 1024 * 16; + const maxBatchSizeBytes = usingAutoEncryption ? 1024 * 1024 * 2 : maxBsonObjectSize; + const maxWriteBatchSize = hello && hello.maxWriteBatchSize ? hello.maxWriteBatchSize : 1000; + // Calculates the largest possible size of an Array key, represented as a BSON string + // element. This calculation: + // 1 byte for BSON type + // # of bytes = length of (string representation of (maxWriteBatchSize - 1)) + // + 1 bytes for null terminator + const maxKeySize = (maxWriteBatchSize - 1).toString(10).length + 2; + // Final options for retryable writes + let finalOptions = Object.assign({}, options); + finalOptions = (0, utils_1.applyRetryableWrites)(finalOptions, collection.s.db); + // Final results + const bulkResult = { + ok: 1, + writeErrors: [], + writeConcernErrors: [], + insertedIds: [], + nInserted: 0, + nUpserted: 0, + nMatched: 0, + nModified: 0, + nRemoved: 0, + upserted: [] + }; + // Internal state + this.s = { + // Final result + bulkResult, + // Current batch state + currentBatch: undefined, + currentIndex: 0, + // ordered specific + currentBatchSize: 0, + currentBatchSizeBytes: 0, + // unordered specific + currentInsertBatch: undefined, + currentUpdateBatch: undefined, + currentRemoveBatch: undefined, + batches: [], + // Write concern + writeConcern: write_concern_1.WriteConcern.fromOptions(options), + // Max batch size options + maxBsonObjectSize, + maxBatchSizeBytes, + maxWriteBatchSize, + maxKeySize, + // Namespace + namespace, + // Topology + topology, + // Options + options: finalOptions, + // BSON options + bsonOptions: (0, bson_1.resolveBSONOptions)(options), + // Current operation + currentOp, + // Executed + executed, + // Collection + collection, + // Fundamental error + err: undefined, + // check keys + checkKeys: typeof options.checkKeys === 'boolean' ? options.checkKeys : false + }; + // bypass Validation + if (options.bypassDocumentValidation === true) { + this.s.bypassDocumentValidation = true; + } + } + /** + * Add a single insert document to the bulk operation + * + * @example + * ```js + * const bulkOp = collection.initializeOrderedBulkOp(); + * + * // Adds three inserts to the bulkOp. + * bulkOp + * .insert({ a: 1 }) + * .insert({ b: 2 }) + * .insert({ c: 3 }); + * await bulkOp.execute(); + * ``` + */ + insert(document) { + if (document._id == null && !shouldForceServerObjectId(this)) { + document._id = new bson_1.ObjectId(); + } + return this.addToOperationsList(exports.BatchType.INSERT, document); + } + /** + * Builds a find operation for an update/updateOne/delete/deleteOne/replaceOne. + * Returns a builder object used to complete the definition of the operation. + * + * @example + * ```js + * const bulkOp = collection.initializeOrderedBulkOp(); + * + * // Add an updateOne to the bulkOp + * bulkOp.find({ a: 1 }).updateOne({ $set: { b: 2 } }); + * + * // Add an updateMany to the bulkOp + * bulkOp.find({ c: 3 }).update({ $set: { d: 4 } }); + * + * // Add an upsert + * bulkOp.find({ e: 5 }).upsert().updateOne({ $set: { f: 6 } }); + * + * // Add a deletion + * bulkOp.find({ g: 7 }).deleteOne(); + * + * // Add a multi deletion + * bulkOp.find({ h: 8 }).delete(); + * + * // Add a replaceOne + * bulkOp.find({ i: 9 }).replaceOne({writeConcern: { j: 10 }}); + * + * // Update using a pipeline (requires Mongodb 4.2 or higher) + * bulk.find({ k: 11, y: { $exists: true }, z: { $exists: true } }).updateOne([ + * { $set: { total: { $sum: [ '$y', '$z' ] } } } + * ]); + * + * // All of the ops will now be executed + * await bulkOp.execute(); + * ``` + */ + find(selector) { + if (!selector) { + throw new error_1.MongoInvalidArgumentError('Bulk find operation must specify a selector'); + } + // Save a current selector + this.s.currentOp = { + selector: selector + }; + return new FindOperators(this); + } + /** Specifies a raw operation to perform in the bulk write. */ + raw(op) { + if (op == null || typeof op !== 'object') { + throw new error_1.MongoInvalidArgumentError('Operation must be an object with an operation key'); + } + if ('insertOne' in op) { + const forceServerObjectId = shouldForceServerObjectId(this); + if (op.insertOne && op.insertOne.document == null) { + // NOTE: provided for legacy support, but this is a malformed operation + if (forceServerObjectId !== true && op.insertOne._id == null) { + op.insertOne._id = new bson_1.ObjectId(); + } + return this.addToOperationsList(exports.BatchType.INSERT, op.insertOne); + } + if (forceServerObjectId !== true && op.insertOne.document._id == null) { + op.insertOne.document._id = new bson_1.ObjectId(); + } + return this.addToOperationsList(exports.BatchType.INSERT, op.insertOne.document); + } + if ('replaceOne' in op || 'updateOne' in op || 'updateMany' in op) { + if ('replaceOne' in op) { + if ('q' in op.replaceOne) { + throw new error_1.MongoInvalidArgumentError('Raw operations are not allowed'); + } + const updateStatement = (0, update_1.makeUpdateStatement)(op.replaceOne.filter, op.replaceOne.replacement, { ...op.replaceOne, multi: false }); + if ((0, utils_1.hasAtomicOperators)(updateStatement.u)) { + throw new error_1.MongoInvalidArgumentError('Replacement document must not use atomic operators'); + } + return this.addToOperationsList(exports.BatchType.UPDATE, updateStatement); + } + if ('updateOne' in op) { + if ('q' in op.updateOne) { + throw new error_1.MongoInvalidArgumentError('Raw operations are not allowed'); + } + const updateStatement = (0, update_1.makeUpdateStatement)(op.updateOne.filter, op.updateOne.update, { + ...op.updateOne, + multi: false + }); + if (!(0, utils_1.hasAtomicOperators)(updateStatement.u)) { + throw new error_1.MongoInvalidArgumentError('Update document requires atomic operators'); + } + return this.addToOperationsList(exports.BatchType.UPDATE, updateStatement); + } + if ('updateMany' in op) { + if ('q' in op.updateMany) { + throw new error_1.MongoInvalidArgumentError('Raw operations are not allowed'); + } + const updateStatement = (0, update_1.makeUpdateStatement)(op.updateMany.filter, op.updateMany.update, { + ...op.updateMany, + multi: true + }); + if (!(0, utils_1.hasAtomicOperators)(updateStatement.u)) { + throw new error_1.MongoInvalidArgumentError('Update document requires atomic operators'); + } + return this.addToOperationsList(exports.BatchType.UPDATE, updateStatement); + } + } + if ('deleteOne' in op) { + if ('q' in op.deleteOne) { + throw new error_1.MongoInvalidArgumentError('Raw operations are not allowed'); + } + return this.addToOperationsList(exports.BatchType.DELETE, (0, delete_1.makeDeleteStatement)(op.deleteOne.filter, { ...op.deleteOne, limit: 1 })); + } + if ('deleteMany' in op) { + if ('q' in op.deleteMany) { + throw new error_1.MongoInvalidArgumentError('Raw operations are not allowed'); + } + return this.addToOperationsList(exports.BatchType.DELETE, (0, delete_1.makeDeleteStatement)(op.deleteMany.filter, { ...op.deleteMany, limit: 0 })); + } + // otherwise an unknown operation was provided + throw new error_1.MongoInvalidArgumentError('bulkWrite only supports insertOne, updateOne, updateMany, deleteOne, deleteMany'); + } + get bsonOptions() { + return this.s.bsonOptions; + } + get writeConcern() { + return this.s.writeConcern; + } + get batches() { + const batches = [...this.s.batches]; + if (this.isOrdered) { + if (this.s.currentBatch) + batches.push(this.s.currentBatch); + } + else { + if (this.s.currentInsertBatch) + batches.push(this.s.currentInsertBatch); + if (this.s.currentUpdateBatch) + batches.push(this.s.currentUpdateBatch); + if (this.s.currentRemoveBatch) + batches.push(this.s.currentRemoveBatch); + } + return batches; + } + execute(options, callback) { + if (typeof options === 'function') + (callback = options), (options = {}); + options = options !== null && options !== void 0 ? options : {}; + if (this.s.executed) { + return handleEarlyError(new error_1.MongoBatchReExecutionError(), callback); + } + const writeConcern = write_concern_1.WriteConcern.fromOptions(options); + if (writeConcern) { + this.s.writeConcern = writeConcern; + } + // If we have current batch + if (this.isOrdered) { + if (this.s.currentBatch) + this.s.batches.push(this.s.currentBatch); + } + else { + if (this.s.currentInsertBatch) + this.s.batches.push(this.s.currentInsertBatch); + if (this.s.currentUpdateBatch) + this.s.batches.push(this.s.currentUpdateBatch); + if (this.s.currentRemoveBatch) + this.s.batches.push(this.s.currentRemoveBatch); + } + // If we have no operations in the bulk raise an error + if (this.s.batches.length === 0) { + const emptyBatchError = new error_1.MongoInvalidArgumentError('Invalid BulkOperation, Batch cannot be empty'); + return handleEarlyError(emptyBatchError, callback); + } + this.s.executed = true; + const finalOptions = { ...this.s.options, ...options }; + const operation = new BulkWriteShimOperation(this, finalOptions); + return (0, execute_operation_1.executeOperation)(this.s.collection.s.db.s.client, operation, callback); + } + /** + * Handles the write error before executing commands + * @internal + */ + handleWriteError(callback, writeResult) { + if (this.s.bulkResult.writeErrors.length > 0) { + const msg = this.s.bulkResult.writeErrors[0].errmsg + ? this.s.bulkResult.writeErrors[0].errmsg + : 'write operation failed'; + callback(new MongoBulkWriteError({ + message: msg, + code: this.s.bulkResult.writeErrors[0].code, + writeErrors: this.s.bulkResult.writeErrors + }, writeResult)); + return true; + } + const writeConcernError = writeResult.getWriteConcernError(); + if (writeConcernError) { + callback(new MongoBulkWriteError(writeConcernError, writeResult)); + return true; + } + return false; + } +} +exports.BulkOperationBase = BulkOperationBase; +Object.defineProperty(BulkOperationBase.prototype, 'length', { + enumerable: true, + get() { + return this.s.currentIndex; + } +}); +/** helper function to assist with promiseOrCallback behavior */ +function handleEarlyError(err, callback) { + const Promise = promise_provider_1.PromiseProvider.get(); + if (typeof callback === 'function') { + callback(err); + return; + } + return Promise.reject(err); +} +function shouldForceServerObjectId(bulkOperation) { + var _a, _b; + if (typeof bulkOperation.s.options.forceServerObjectId === 'boolean') { + return bulkOperation.s.options.forceServerObjectId; + } + if (typeof ((_a = bulkOperation.s.collection.s.db.options) === null || _a === void 0 ? void 0 : _a.forceServerObjectId) === 'boolean') { + return (_b = bulkOperation.s.collection.s.db.options) === null || _b === void 0 ? void 0 : _b.forceServerObjectId; + } + return false; +} +function isInsertBatch(batch) { + return batch.batchType === exports.BatchType.INSERT; +} +function isUpdateBatch(batch) { + return batch.batchType === exports.BatchType.UPDATE; +} +function isDeleteBatch(batch) { + return batch.batchType === exports.BatchType.DELETE; +} +function buildCurrentOp(bulkOp) { + let { currentOp } = bulkOp.s; + bulkOp.s.currentOp = undefined; + if (!currentOp) + currentOp = {}; + return currentOp; +} +//# sourceMappingURL=common.js.map \ No newline at end of file diff --git a/node_modules/mongodb/lib/bulk/common.js.map b/node_modules/mongodb/lib/bulk/common.js.map new file mode 100644 index 000000000..c512e0af3 --- /dev/null +++ b/node_modules/mongodb/lib/bulk/common.js.map @@ -0,0 +1 @@ +{"version":3,"file":"common.js","sourceRoot":"","sources":["../../src/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AAM,CAAC,CAAC,CAAC,SAAS,GAAG,SAAS,CAAC;IAC/B,IAAI,CAAC,SAAS;QAAE,SAAS,GAAG,EAAE,CAAC;IAC/B,OAAO,SAAS,CAAC;AACnB,CAAC"} \ No newline at end of file diff --git a/node_modules/mongodb/lib/bulk/ordered.js b/node_modules/mongodb/lib/bulk/ordered.js new file mode 100644 index 000000000..f7e5418d7 --- /dev/null +++ b/node_modules/mongodb/lib/bulk/ordered.js @@ -0,0 +1,66 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.OrderedBulkOperation = void 0; +const BSON = require("../bson"); +const error_1 = require("../error"); +const common_1 = require("./common"); +/** @public */ +class OrderedBulkOperation extends common_1.BulkOperationBase { + constructor(collection, options) { + super(collection, options, true); + } + addToOperationsList(batchType, document) { + // Get the bsonSize + const bsonSize = BSON.calculateObjectSize(document, { + checkKeys: false, + // Since we don't know what the user selected for BSON options here, + // err on the safe side, and check the size with ignoreUndefined: false. + ignoreUndefined: false + }); + // Throw error if the doc is bigger than the max BSON size + if (bsonSize >= this.s.maxBsonObjectSize) + // TODO(NODE-3483): Change this to MongoBSONError + throw new error_1.MongoInvalidArgumentError(`Document is larger than the maximum size ${this.s.maxBsonObjectSize}`); + // Create a new batch object if we don't have a current one + if (this.s.currentBatch == null) { + this.s.currentBatch = new common_1.Batch(batchType, this.s.currentIndex); + } + const maxKeySize = this.s.maxKeySize; + // Check if we need to create a new batch + if ( + // New batch if we exceed the max batch op size + this.s.currentBatchSize + 1 >= this.s.maxWriteBatchSize || + // New batch if we exceed the maxBatchSizeBytes. Only matters if batch already has a doc, + // since we can't sent an empty batch + (this.s.currentBatchSize > 0 && + this.s.currentBatchSizeBytes + maxKeySize + bsonSize >= this.s.maxBatchSizeBytes) || + // New batch if the new op does not have the same op type as the current batch + this.s.currentBatch.batchType !== batchType) { + // Save the batch to the execution stack + this.s.batches.push(this.s.currentBatch); + // Create a new batch + this.s.currentBatch = new common_1.Batch(batchType, this.s.currentIndex); + // Reset the current size trackers + this.s.currentBatchSize = 0; + this.s.currentBatchSizeBytes = 0; + } + if (batchType === common_1.BatchType.INSERT) { + this.s.bulkResult.insertedIds.push({ + index: this.s.currentIndex, + _id: document._id + }); + } + // We have an array of documents + if (Array.isArray(document)) { + throw new error_1.MongoInvalidArgumentError('Operation passed in cannot be an Array'); + } + this.s.currentBatch.originalIndexes.push(this.s.currentIndex); + this.s.currentBatch.operations.push(document); + this.s.currentBatchSize += 1; + this.s.currentBatchSizeBytes += maxKeySize + bsonSize; + this.s.currentIndex += 1; + return this; + } +} +exports.OrderedBulkOperation = OrderedBulkOperation; +//# sourceMappingURL=ordered.js.map \ No newline at end of file diff --git a/node_modules/mongodb/lib/bulk/ordered.js.map b/node_modules/mongodb/lib/bulk/ordered.js.map new file mode 100644 index 000000000..4058c1cde --- /dev/null +++ b/node_modules/mongodb/lib/bulk/ordered.js.map @@ -0,0 +1 @@ +{"version":3,"file":"ordered.js","sourceRoot":"","sources":["../../src/bulk/ordered.ts"],"names":[],"mappings":";;;AACA,gCAAgC;AAEhC,oCAAqD;AAGrD,qCAAiF;AAEjF,cAAc;AACd,MAAa,oBAAqB,SAAQ,0BAAiB;IACzD,YAAY,UAAsB,EAAE,OAAyB;QAC3D,KAAK,CAAC,UAAU,EAAE,OAAO,EAAE,IAAI,CAAC,CAAC;IACnC,CAAC;IAED,mBAAmB,CACjB,SAAoB,EACpB,QAAsD;QAEtD,mBAAmB;QACnB,MAAM,QAAQ,GAAG,IAAI,CAAC,mBAAmB,CAAC,QAAQ,EAAE;YAClD,SAAS,EAAE,KAAK;YAChB,oEAAoE;YACpE,wEAAwE;YACxE,eAAe,EAAE,KAAK;SAChB,CAAC,CAAC;QAEV,0DAA0D;QAC1D,IAAI,QAAQ,IAAI,IAAI,CAAC,CAAC,CAAC,iBAAiB;YACtC,iDAAiD;YACjD,MAAM,IAAI,iCAAyB,CACjC,4CAA4C,IAAI,CAAC,CAAC,CAAC,iBAAiB,EAAE,CACvE,CAAC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C,GAAG;aAChC,CAAC,CAAC;SACJ;QAED,gCAAgC;QAChC,IAAI,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE;YAC3B,MAAM,IAAI,iCAAyB,CAAC,wCAAwC,CAAC,CAAC;SAC/E;QAED,IAAI,CAAC,CAAC,CAAC,YAAY,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC;QAC9D,IAAI,CAAC,CAAC,CAAC,YAAY,CAAC,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAC9C,IAAI,CAAC,CAAC,CAAC,gBAAgB,IAAI,CAAC,CAAC;QAC7B,IAAI,CAAC,CAAC,CAAC,qBAAqB,IAAI,UAAU,GAAG,QAAQ,CAAC;QACtD,IAAI,CAAC,CAAC,CAAC,YAAY,IAAI,CAAC,CAAC;QACzB,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AAxED,oDAwEC"} \ No newline at end of file diff --git a/node_modules/mongodb/lib/bulk/unordered.js b/node_modules/mongodb/lib/bulk/unordered.js new file mode 100644 index 000000000..f5a34180e --- /dev/null +++ b/node_modules/mongodb/lib/bulk/unordered.js @@ -0,0 +1,91 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.UnorderedBulkOperation = void 0; +const BSON = require("../bson"); +const error_1 = require("../error"); +const common_1 = require("./common"); +/** @public */ +class UnorderedBulkOperation extends common_1.BulkOperationBase { + constructor(collection, options) { + super(collection, options, false); + } + handleWriteError(callback, writeResult) { + if (this.s.batches.length) { + return false; + } + return super.handleWriteError(callback, writeResult); + } + addToOperationsList(batchType, document) { + // Get the bsonSize + const bsonSize = BSON.calculateObjectSize(document, { + checkKeys: false, + // Since we don't know what the user selected for BSON options here, + // err on the safe side, and check the size with ignoreUndefined: false. + ignoreUndefined: false + }); + // Throw error if the doc is bigger than the max BSON size + if (bsonSize >= this.s.maxBsonObjectSize) { + // TODO(NODE-3483): Change this to MongoBSONError + throw new error_1.MongoInvalidArgumentError(`Document is larger than the maximum size ${this.s.maxBsonObjectSize}`); + } + // Holds the current batch + this.s.currentBatch = undefined; + // Get the right type of batch + if (batchType === common_1.BatchType.INSERT) { + this.s.currentBatch = this.s.currentInsertBatch; + } + else if (batchType === common_1.BatchType.UPDATE) { + this.s.currentBatch = this.s.currentUpdateBatch; + } + else if (batchType === common_1.BatchType.DELETE) { + this.s.currentBatch = this.s.currentRemoveBatch; + } + const maxKeySize = this.s.maxKeySize; + // Create a new batch object if we don't have a current one + if (this.s.currentBatch == null) { + this.s.currentBatch = new common_1.Batch(batchType, this.s.currentIndex); + } + // Check if we need to create a new batch + if ( + // New batch if we exceed the max batch op size + this.s.currentBatch.size + 1 >= this.s.maxWriteBatchSize || + // New batch if we exceed the maxBatchSizeBytes. Only matters if batch already has a doc, + // since we can't sent an empty batch + (this.s.currentBatch.size > 0 && + this.s.currentBatch.sizeBytes + maxKeySize + bsonSize >= this.s.maxBatchSizeBytes) || + // New batch if the new op does not have the same op type as the current batch + this.s.currentBatch.batchType !== batchType) { + // Save the batch to the execution stack + this.s.batches.push(this.s.currentBatch); + // Create a new batch + this.s.currentBatch = new common_1.Batch(batchType, this.s.currentIndex); + } + // We have an array of documents + if (Array.isArray(document)) { + throw new error_1.MongoInvalidArgumentError('Operation passed in cannot be an Array'); + } + this.s.currentBatch.operations.push(document); + this.s.currentBatch.originalIndexes.push(this.s.currentIndex); + this.s.currentIndex = this.s.currentIndex + 1; + // Save back the current Batch to the right type + if (batchType === common_1.BatchType.INSERT) { + this.s.currentInsertBatch = this.s.currentBatch; + this.s.bulkResult.insertedIds.push({ + index: this.s.bulkResult.insertedIds.length, + _id: document._id + }); + } + else if (batchType === common_1.BatchType.UPDATE) { + this.s.currentUpdateBatch = this.s.currentBatch; + } + else if (batchType === common_1.BatchType.DELETE) { + this.s.currentRemoveBatch = this.s.currentBatch; + } + // Update current batch size + this.s.currentBatch.size += 1; + this.s.currentBatch.sizeBytes += maxKeySize + bsonSize; + return this; + } +} +exports.UnorderedBulkOperation = UnorderedBulkOperation; +//# sourceMappingURL=unordered.js.map \ No newline at end of file diff --git a/node_modules/mongodb/lib/bulk/unordered.js.map b/node_modules/mongodb/lib/bulk/unordered.js.map new file mode 100644 index 000000000..476e1998e --- /dev/null +++ b/node_modules/mongodb/lib/bulk/unordered.js.map @@ -0,0 +1 @@ +{"version":3,"file":"unordered.js","sourceRoot":"","sources":["../../src/bulk/unordered.ts"],"names":[],"mappings":";;;AACA,gCAAgC;AAEhC,oCAAqD;AAIrD,qCAAkG;AAElG,cAAc;AACd,MAAa,sBAAuB,SAAQ,0BAAiB;IAC3D,YAAY,UAAsB,EAAE,OAAyB;QAC3D,KAAK,CAAC,UAAU,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;IACpC,CAAC;IAEQ,gBAAgB,CAAC,QAAkB,EAAE,WAA4B;QACxE,IAAI,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE;YACzB,OAAO,KAAK,CAAC;SACd;QAED,OAAO,KAAK,CAAC,gBAAgB,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAC;IACvD,CAAC;IAED,mBAAmB,CACjB,SAAoB,EACpB,QAAsD;QAEtD,mBAAmB;QACnB,MAAM,QAAQ,GAAG,IAAI,CAAC,mBAAmB,CAAC,QAAQ,EAAE;YAClD,SAAS,EAAE,KAAK;YAEhB,oEAAoE;YACpE,wEAAwE;YACxE,eAAe,EAAE,KAAK;SAChB,CAAC,CAAC;QAEV,0DAA0D;QAC1D,IAAI,QAAQ,IAAI,IAAI,CAAC,CAAC,CAAC,iBAAiB,EAAE;YACxC,iDAAiD;YACjD,MAAM,IAAI,iCAAyB,CACjC,4CAA4C,IAAI,CAAC,CAAC,CAAC,iBAAiB,EAAE,CACvE,CAAC;SACH;QAED,0BAA0B;QAC1B,IAAI,CAAC,CAAC,CAAC,YAAY,GAAG,SAAS,CAAC;QAChC,8BAA8B;QAC9B,IAAI,SAAS,KAAK,kBAAS,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AAC,SAAS,IAAI,UAAU,GAAG,QAAQ,CAAC;QAEvD,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AAlGD,wDAkGC"} \ No newline at end of file diff --git a/node_modules/mongodb/lib/change_stream.js b/node_modules/mongodb/lib/change_stream.js new file mode 100644 index 000000000..d898e849a --- /dev/null +++ b/node_modules/mongodb/lib/change_stream.js @@ -0,0 +1,509 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ChangeStreamCursor = exports.ChangeStream = void 0; +const Denque = require("denque"); +const timers_1 = require("timers"); +const collection_1 = require("./collection"); +const constants_1 = require("./constants"); +const abstract_cursor_1 = require("./cursor/abstract_cursor"); +const db_1 = require("./db"); +const error_1 = require("./error"); +const mongo_client_1 = require("./mongo_client"); +const mongo_types_1 = require("./mongo_types"); +const aggregate_1 = require("./operations/aggregate"); +const execute_operation_1 = require("./operations/execute_operation"); +const utils_1 = require("./utils"); +/** @internal */ +const kResumeQueue = Symbol('resumeQueue'); +/** @internal */ +const kCursorStream = Symbol('cursorStream'); +/** @internal */ +const kClosed = Symbol('closed'); +/** @internal */ +const kMode = Symbol('mode'); +const CHANGE_STREAM_OPTIONS = [ + 'resumeAfter', + 'startAfter', + 'startAtOperationTime', + 'fullDocument', + 'fullDocumentBeforeChange', + 'showExpandedEvents' +]; +const CHANGE_DOMAIN_TYPES = { + COLLECTION: Symbol('Collection'), + DATABASE: Symbol('Database'), + CLUSTER: Symbol('Cluster') +}; +const SELECTION_TIMEOUT = 30000; +const CHANGE_STREAM_EVENTS = [constants_1.RESUME_TOKEN_CHANGED, constants_1.END, constants_1.CLOSE]; +const NO_RESUME_TOKEN_ERROR = 'A change stream document has been received that lacks a resume token (_id).'; +const NO_CURSOR_ERROR = 'ChangeStream has no cursor'; +const CHANGESTREAM_CLOSED_ERROR = 'ChangeStream is closed'; +/** + * Creates a new Change Stream instance. Normally created using {@link Collection#watch|Collection.watch()}. + * @public + */ +class ChangeStream extends mongo_types_1.TypedEventEmitter { + /** + * @internal + * + * @param parent - The parent object that created this change stream + * @param pipeline - An array of {@link https://docs.mongodb.com/manual/reference/operator/aggregation-pipeline/|aggregation pipeline stages} through which to pass change stream documents + */ + constructor(parent, pipeline = [], options = {}) { + super(); + this.pipeline = pipeline; + this.options = options; + if (parent instanceof collection_1.Collection) { + this.type = CHANGE_DOMAIN_TYPES.COLLECTION; + } + else if (parent instanceof db_1.Db) { + this.type = CHANGE_DOMAIN_TYPES.DATABASE; + } + else if (parent instanceof mongo_client_1.MongoClient) { + this.type = CHANGE_DOMAIN_TYPES.CLUSTER; + } + else { + throw new error_1.MongoChangeStreamError('Parent provided to ChangeStream constructor must be an instance of Collection, Db, or MongoClient'); + } + this.parent = parent; + this.namespace = parent.s.namespace; + if (!this.options.readPreference && parent.readPreference) { + this.options.readPreference = parent.readPreference; + } + this[kResumeQueue] = new Denque(); + // Create contained Change Stream cursor + this.cursor = this._createChangeStreamCursor(options); + this[kClosed] = false; + this[kMode] = false; + // Listen for any `change` listeners being added to ChangeStream + this.on('newListener', eventName => { + if (eventName === 'change' && this.cursor && this.listenerCount('change') === 0) { + this._streamEvents(this.cursor); + } + }); + this.on('removeListener', eventName => { + var _a; + if (eventName === 'change' && this.listenerCount('change') === 0 && this.cursor) { + (_a = this[kCursorStream]) === null || _a === void 0 ? void 0 : _a.removeAllListeners('data'); + } + }); + } + /** @internal */ + get cursorStream() { + return this[kCursorStream]; + } + /** The cached resume token that is used to resume after the most recently returned change. */ + get resumeToken() { + var _a; + return (_a = this.cursor) === null || _a === void 0 ? void 0 : _a.resumeToken; + } + hasNext(callback) { + this._setIsIterator(); + return (0, utils_1.maybePromise)(callback, cb => { + this._getCursor((err, cursor) => { + if (err || !cursor) + return cb(err); // failed to resume, raise an error + cursor.hasNext(cb); + }); + }); + } + next(callback) { + this._setIsIterator(); + return (0, utils_1.maybePromise)(callback, cb => { + this._getCursor((err, cursor) => { + if (err || !cursor) + return cb(err); // failed to resume, raise an error + cursor.next((error, change) => { + if (error) { + this[kResumeQueue].push(() => this.next(cb)); + this._processError(error, cb); + return; + } + this._processNewChange(change !== null && change !== void 0 ? change : null, cb); + }); + }); + }); + } + /** Is the cursor closed */ + get closed() { + var _a, _b; + return this[kClosed] || ((_b = (_a = this.cursor) === null || _a === void 0 ? void 0 : _a.closed) !== null && _b !== void 0 ? _b : false); + } + /** Close the Change Stream */ + close(callback) { + this[kClosed] = true; + return (0, utils_1.maybePromise)(callback, cb => { + if (!this.cursor) { + return cb(); + } + const cursor = this.cursor; + return cursor.close(err => { + this._endStream(); + this.cursor = undefined; + return cb(err); + }); + }); + } + /** + * Return a modified Readable stream including a possible transform method. + * @throws MongoDriverError if this.cursor is undefined + */ + stream(options) { + this.streamOptions = options; + if (!this.cursor) + throw new error_1.MongoChangeStreamError(NO_CURSOR_ERROR); + return this.cursor.stream(options); + } + tryNext(callback) { + this._setIsIterator(); + return (0, utils_1.maybePromise)(callback, cb => { + this._getCursor((err, cursor) => { + if (err || !cursor) + return cb(err); // failed to resume, raise an error + return cursor.tryNext(cb); + }); + }); + } + /** @internal */ + _setIsEmitter() { + if (this[kMode] === 'iterator') { + // TODO(NODE-3485): Replace with MongoChangeStreamModeError + throw new error_1.MongoAPIError('ChangeStream cannot be used as an EventEmitter after being used as an iterator'); + } + this[kMode] = 'emitter'; + } + /** @internal */ + _setIsIterator() { + if (this[kMode] === 'emitter') { + // TODO(NODE-3485): Replace with MongoChangeStreamModeError + throw new error_1.MongoAPIError('ChangeStream cannot be used as an iterator after being used as an EventEmitter'); + } + this[kMode] = 'iterator'; + } + /** + * Create a new change stream cursor based on self's configuration + * @internal + */ + _createChangeStreamCursor(options) { + const changeStreamStageOptions = (0, utils_1.filterOptions)(options, CHANGE_STREAM_OPTIONS); + if (this.type === CHANGE_DOMAIN_TYPES.CLUSTER) { + changeStreamStageOptions.allChangesForCluster = true; + } + const pipeline = [{ $changeStream: changeStreamStageOptions }, ...this.pipeline]; + const client = this.type === CHANGE_DOMAIN_TYPES.CLUSTER + ? this.parent + : this.type === CHANGE_DOMAIN_TYPES.DATABASE + ? this.parent.s.client + : this.type === CHANGE_DOMAIN_TYPES.COLLECTION + ? this.parent.s.db.s.client + : null; + if (client == null) { + // This should never happen because of the assertion in the constructor + throw new error_1.MongoRuntimeError(`Changestream type should only be one of cluster, database, collection. Found ${this.type.toString()}`); + } + const changeStreamCursor = new ChangeStreamCursor(client, this.namespace, pipeline, options); + for (const event of CHANGE_STREAM_EVENTS) { + changeStreamCursor.on(event, e => this.emit(event, e)); + } + if (this.listenerCount(ChangeStream.CHANGE) > 0) { + this._streamEvents(changeStreamCursor); + } + return changeStreamCursor; + } + /** + * This method performs a basic server selection loop, satisfying the requirements of + * ChangeStream resumability until the new SDAM layer can be used. + * @internal + */ + _waitForTopologyConnected(topology, options, callback) { + (0, timers_1.setTimeout)(() => { + if (options && options.start == null) { + options.start = (0, utils_1.now)(); + } + const start = options.start || (0, utils_1.now)(); + const timeout = options.timeout || SELECTION_TIMEOUT; + if (topology.isConnected()) { + return callback(); + } + if ((0, utils_1.calculateDurationInMs)(start) > timeout) { + // TODO(NODE-3497): Replace with MongoNetworkTimeoutError + return callback(new error_1.MongoRuntimeError('Timed out waiting for connection')); + } + this._waitForTopologyConnected(topology, options, callback); + }, 500); // this is an arbitrary wait time to allow SDAM to transition + } + /** @internal */ + _closeWithError(error, callback) { + if (!callback) { + this.emit(ChangeStream.ERROR, error); + } + this.close(() => callback && callback(error)); + } + /** @internal */ + _streamEvents(cursor) { + var _a; + this._setIsEmitter(); + const stream = (_a = this[kCursorStream]) !== null && _a !== void 0 ? _a : cursor.stream(); + this[kCursorStream] = stream; + stream.on('data', change => this._processNewChange(change)); + stream.on('error', error => this._processError(error)); + } + /** @internal */ + _endStream() { + const cursorStream = this[kCursorStream]; + if (cursorStream) { + ['data', 'close', 'end', 'error'].forEach(event => cursorStream.removeAllListeners(event)); + cursorStream.destroy(); + } + this[kCursorStream] = undefined; + } + /** @internal */ + _processNewChange(change, callback) { + var _a; + if (this[kClosed]) { + // TODO(NODE-3485): Replace with MongoChangeStreamClosedError + if (callback) + callback(new error_1.MongoAPIError(CHANGESTREAM_CLOSED_ERROR)); + return; + } + // a null change means the cursor has been notified, implicitly closing the change stream + if (change == null) { + // TODO(NODE-3485): Replace with MongoChangeStreamClosedError + return this._closeWithError(new error_1.MongoRuntimeError(CHANGESTREAM_CLOSED_ERROR), callback); + } + if (change && !change._id) { + return this._closeWithError(new error_1.MongoChangeStreamError(NO_RESUME_TOKEN_ERROR), callback); + } + // cache the resume token + (_a = this.cursor) === null || _a === void 0 ? void 0 : _a.cacheResumeToken(change._id); + // wipe the startAtOperationTime if there was one so that there won't be a conflict + // between resumeToken and startAtOperationTime if we need to reconnect the cursor + this.options.startAtOperationTime = undefined; + // Return the change + if (!callback) + return this.emit(ChangeStream.CHANGE, change); + return callback(undefined, change); + } + /** @internal */ + _processError(error, callback) { + const cursor = this.cursor; + // If the change stream has been closed explicitly, do not process error. + if (this[kClosed]) { + // TODO(NODE-3485): Replace with MongoChangeStreamClosedError + if (callback) + callback(new error_1.MongoAPIError(CHANGESTREAM_CLOSED_ERROR)); + return; + } + // if the resume succeeds, continue with the new cursor + const resumeWithCursor = (newCursor) => { + this.cursor = newCursor; + this._processResumeQueue(); + }; + // otherwise, raise an error and close the change stream + const unresumableError = (err) => { + if (!callback) { + this.emit(ChangeStream.ERROR, err); + } + this.close(() => this._processResumeQueue(err)); + }; + if (cursor && (0, error_1.isResumableError)(error, (0, utils_1.maxWireVersion)(cursor.server))) { + this.cursor = undefined; + // stop listening to all events from old cursor + this._endStream(); + // close internal cursor, ignore errors + cursor.close(); + const topology = (0, utils_1.getTopology)(this.parent); + this._waitForTopologyConnected(topology, { readPreference: cursor.readPreference }, err => { + // if the topology can't reconnect, close the stream + if (err) + return unresumableError(err); + // create a new cursor, preserving the old cursor's options + const newCursor = this._createChangeStreamCursor(cursor.resumeOptions); + // attempt to continue in emitter mode + if (!callback) + return resumeWithCursor(newCursor); + // attempt to continue in iterator mode + newCursor.hasNext(err => { + // if there's an error immediately after resuming, close the stream + if (err) + return unresumableError(err); + resumeWithCursor(newCursor); + }); + }); + return; + } + // if initial error wasn't resumable, raise an error and close the change stream + return this._closeWithError(error, callback); + } + /** @internal */ + _getCursor(callback) { + if (this[kClosed]) { + // TODO(NODE-3485): Replace with MongoChangeStreamClosedError + callback(new error_1.MongoAPIError(CHANGESTREAM_CLOSED_ERROR)); + return; + } + // if a cursor exists and it is open, return it + if (this.cursor) { + callback(undefined, this.cursor); + return; + } + // no cursor, queue callback until topology reconnects + this[kResumeQueue].push(callback); + } + /** + * Drain the resume queue when a new has become available + * @internal + * + * @param error - error getting a new cursor + */ + _processResumeQueue(error) { + var _a; + while (this[kResumeQueue].length) { + const request = this[kResumeQueue].pop(); + if (!request) + break; // Should never occur but TS can't use the length check in the while condition + if (!error) { + if (this[kClosed]) { + // TODO(NODE-3485): Replace with MongoChangeStreamClosedError + request(new error_1.MongoAPIError(CHANGESTREAM_CLOSED_ERROR)); + return; + } + if (!this.cursor) { + request(new error_1.MongoChangeStreamError(NO_CURSOR_ERROR)); + return; + } + } + request(error, (_a = this.cursor) !== null && _a !== void 0 ? _a : undefined); + } + } +} +exports.ChangeStream = ChangeStream; +/** @event */ +ChangeStream.RESPONSE = constants_1.RESPONSE; +/** @event */ +ChangeStream.MORE = constants_1.MORE; +/** @event */ +ChangeStream.INIT = constants_1.INIT; +/** @event */ +ChangeStream.CLOSE = constants_1.CLOSE; +/** + * Fired for each new matching change in the specified namespace. Attaching a `change` + * event listener to a Change Stream will switch the stream into flowing mode. Data will + * then be passed as soon as it is available. + * @event + */ +ChangeStream.CHANGE = constants_1.CHANGE; +/** @event */ +ChangeStream.END = constants_1.END; +/** @event */ +ChangeStream.ERROR = constants_1.ERROR; +/** + * Emitted each time the change stream stores a new resume token. + * @event + */ +ChangeStream.RESUME_TOKEN_CHANGED = constants_1.RESUME_TOKEN_CHANGED; +/** @internal */ +class ChangeStreamCursor extends abstract_cursor_1.AbstractCursor { + constructor(client, namespace, pipeline = [], options = {}) { + super(client, namespace, options); + this.pipeline = pipeline; + this.options = options; + this._resumeToken = null; + this.startAtOperationTime = options.startAtOperationTime; + if (options.startAfter) { + this.resumeToken = options.startAfter; + } + else if (options.resumeAfter) { + this.resumeToken = options.resumeAfter; + } + } + set resumeToken(token) { + this._resumeToken = token; + this.emit(ChangeStream.RESUME_TOKEN_CHANGED, token); + } + get resumeToken() { + return this._resumeToken; + } + get resumeOptions() { + const options = { + ...this.options + }; + for (const key of ['resumeAfter', 'startAfter', 'startAtOperationTime']) { + delete options[key]; + } + if (this.resumeToken != null) { + if (this.options.startAfter && !this.hasReceived) { + options.startAfter = this.resumeToken; + } + else { + options.resumeAfter = this.resumeToken; + } + } + else if (this.startAtOperationTime != null && (0, utils_1.maxWireVersion)(this.server) >= 7) { + options.startAtOperationTime = this.startAtOperationTime; + } + return options; + } + cacheResumeToken(resumeToken) { + if (this.bufferedCount() === 0 && this.postBatchResumeToken) { + this.resumeToken = this.postBatchResumeToken; + } + else { + this.resumeToken = resumeToken; + } + this.hasReceived = true; + } + _processBatch(response) { + const cursor = response.cursor; + if (cursor.postBatchResumeToken) { + this.postBatchResumeToken = response.cursor.postBatchResumeToken; + const batch = 'firstBatch' in response.cursor ? response.cursor.firstBatch : response.cursor.nextBatch; + if (batch.length === 0) { + this.resumeToken = cursor.postBatchResumeToken; + } + } + } + clone() { + return new ChangeStreamCursor(this.client, this.namespace, this.pipeline, { + ...this.cursorOptions + }); + } + _initialize(session, callback) { + const aggregateOperation = new aggregate_1.AggregateOperation(this.namespace, this.pipeline, { + ...this.cursorOptions, + ...this.options, + session + }); + (0, execute_operation_1.executeOperation)(session.client, aggregateOperation, (err, response) => { + if (err || response == null) { + return callback(err); + } + const server = aggregateOperation.server; + if (this.startAtOperationTime == null && + this.resumeAfter == null && + this.startAfter == null && + (0, utils_1.maxWireVersion)(server) >= 7) { + this.startAtOperationTime = response.operationTime; + } + this._processBatch(response); + this.emit(ChangeStream.INIT, response); + this.emit(ChangeStream.RESPONSE); + // TODO: NODE-2882 + callback(undefined, { server, session, response }); + }); + } + _getMore(batchSize, callback) { + super._getMore(batchSize, (err, response) => { + if (err) { + return callback(err); + } + this._processBatch(response); + this.emit(ChangeStream.MORE, response); + this.emit(ChangeStream.RESPONSE); + callback(err, response); + }); + } +} +exports.ChangeStreamCursor = ChangeStreamCursor; +//# sourceMappingURL=change_stream.js.map \ No newline at end of file diff --git a/node_modules/mongodb/lib/change_stream.js.map b/node_modules/mongodb/lib/change_stream.js.map new file mode 100644 index 000000000..bad180bd0 --- /dev/null +++ b/node_modules/mongodb/lib/change_stream.js.map @@ -0,0 +1 @@ +{"version":3,"file":"change_stream.js","sourceRoot":"","sources":["../src/change_stream.ts"],"names":[],"mappings":";;;AAAA,iCAAkC;AAElC,mCAAoC;AAGpC,6CAA0C;AAC1C,2CAAoG;AACpG,8DAKkC;AAClC,6BAA0B;AAC1B,mCAMiB;AACjB,iDAA6C;AAC7C,+CAA+E;AAC/E,sDAA8E;AAE9E,sEAAmF;AAInF,mCASiB;AAEjB,gBAAgB;AAChB,MAAM,YAAY,GAAG,MAAM,CAAC,aAAa,CAAC,CAAC;AAC3C,gBAAgB;AAChB,MAAM,aAAa,GAAG,MAAM,CAAC,cAAc,CAAC,CAAC;AAC7C,gBAAgB;AAChB,MAAM,OAAO,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC;AACjC,gBAAgB;AAChB,MAAM,KAAK,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC;AAE7B,MAAM,qBAAqB,GAAG;IAC5B,aAAa;IACb,YAAY;IACZ,sBAAsB;IACtB,cAAc;IACd,0BAA0B;IAC1B,oBAAoB;CACZ,CAAC;AAEX,MAAM,mBAAmB,GAAG;IAC1B,UAAU,EAAE,MAAM,CAAC,YAAY,CAAC;IAChC,QAAQ,EAAE,MAAM,CAAC,UAAU,CAAC;IAC5B,OAAO,EAAE,MAAM,CAAC,SAAS,CAAC;CAC3B,CAAC;AAQ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,IAAI,CAAC,YAAY,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;YACvC,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC;YACjC,QAAQ,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;QAC1B,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AA9ID,gDA8IC"} \ No newline at end of file diff --git a/node_modules/mongodb/lib/cmap/auth/auth_provider.js b/node_modules/mongodb/lib/cmap/auth/auth_provider.js new file mode 100644 index 000000000..b9a840ee8 --- /dev/null +++ b/node_modules/mongodb/lib/cmap/auth/auth_provider.js @@ -0,0 +1,36 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.AuthProvider = exports.AuthContext = void 0; +const error_1 = require("../../error"); +/** Context used during authentication */ +class AuthContext { + constructor(connection, credentials, options) { + this.connection = connection; + this.credentials = credentials; + this.options = options; + } +} +exports.AuthContext = AuthContext; +class AuthProvider { + /** + * Prepare the handshake document before the initial handshake. + * + * @param handshakeDoc - The document used for the initial handshake on a connection + * @param authContext - Context for authentication flow + */ + prepare(handshakeDoc, authContext, callback) { + callback(undefined, handshakeDoc); + } + /** + * Authenticate + * + * @param context - A shared context for authentication flow + * @param callback - The callback to return the result from the authentication + */ + auth(context, callback) { + // TODO(NODE-3483): Replace this with MongoMethodOverrideError + callback(new error_1.MongoRuntimeError('`auth` method must be overridden by subclass')); + } +} +exports.AuthProvider = AuthProvider; +//# sourceMappingURL=auth_provider.js.map \ No newline at end of file diff --git a/node_modules/mongodb/lib/cmap/auth/auth_provider.js.map b/node_modules/mongodb/lib/cmap/auth/auth_provider.js.map new file mode 100644 index 000000000..c03ab3749 --- /dev/null +++ b/node_modules/mongodb/lib/cmap/auth/auth_provider.js.map @@ -0,0 +1 @@ +{"version":3,"file":"auth_provider.js","sourceRoot":"","sources":["../../../src/cmap/auth/auth_provider.ts"],"names":[],"mappings":";;;AACA,uCAAgD;AAQhD,yCAAyC;AACzC,MAAa,WAAW;IAatB,YACE,UAAsB,EACtB,WAAyC,EACzC,OAA2B;QAE3B,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;QAC/B,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;CACF;AAtBD,kCAsBC;AAED,MAAa,YAAY;IACvB;;;;;OAKG;IACH,OAAO,CACL,YAA+B,EAC/B,WAAwB,EACxB,QAAqC;QAErC,QAAQ,CAAC,SAAS,EAAE,YAAY,CAAC,CAAC;IACpC,CAAC;IAED;;;;;OAKG;IACH,IAAI,CAAC,OAAoB,EAAE,QAAkB;QAC3C,8DAA8D;QAC9D,QAAQ,CAAC,IAAI,yBAAiB,CAAC,8CAA8C,CAAC,CAAC,CAAC;IAClF,CAAC;CACF;AAzBD,oCAyBC"} \ No newline at end of file diff --git a/node_modules/mongodb/lib/cmap/auth/gssapi.js b/node_modules/mongodb/lib/cmap/auth/gssapi.js new file mode 100644 index 000000000..0f16b587e --- /dev/null +++ b/node_modules/mongodb/lib/cmap/auth/gssapi.js @@ -0,0 +1,190 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.resolveCname = exports.performGSSAPICanonicalizeHostName = exports.GSSAPI = exports.GSSAPICanonicalizationValue = void 0; +const dns = require("dns"); +const deps_1 = require("../../deps"); +const error_1 = require("../../error"); +const utils_1 = require("../../utils"); +const auth_provider_1 = require("./auth_provider"); +/** @public */ +exports.GSSAPICanonicalizationValue = Object.freeze({ + on: true, + off: false, + none: 'none', + forward: 'forward', + forwardAndReverse: 'forwardAndReverse' +}); +class GSSAPI extends auth_provider_1.AuthProvider { + auth(authContext, callback) { + const { connection, credentials } = authContext; + if (credentials == null) + return callback(new error_1.MongoMissingCredentialsError('Credentials required for GSSAPI authentication')); + const { username } = credentials; + function externalCommand(command, cb) { + return connection.command((0, utils_1.ns)('$external.$cmd'), command, undefined, cb); + } + makeKerberosClient(authContext, (err, client) => { + if (err) + return callback(err); + if (client == null) + return callback(new error_1.MongoMissingDependencyError('GSSAPI client missing')); + client.step('', (err, payload) => { + if (err) + return callback(err); + externalCommand(saslStart(payload), (err, result) => { + if (err) + return callback(err); + if (result == null) + return callback(); + negotiate(client, 10, result.payload, (err, payload) => { + if (err) + return callback(err); + externalCommand(saslContinue(payload, result.conversationId), (err, result) => { + if (err) + return callback(err); + if (result == null) + return callback(); + finalize(client, username, result.payload, (err, payload) => { + if (err) + return callback(err); + externalCommand({ + saslContinue: 1, + conversationId: result.conversationId, + payload + }, (err, result) => { + if (err) + return callback(err); + callback(undefined, result); + }); + }); + }); + }); + }); + }); + }); + } +} +exports.GSSAPI = GSSAPI; +function makeKerberosClient(authContext, callback) { + var _a; + const { hostAddress } = authContext.options; + const { credentials } = authContext; + if (!hostAddress || typeof hostAddress.host !== 'string' || !credentials) { + return callback(new error_1.MongoInvalidArgumentError('Connection must have host and port and credentials defined.')); + } + if ('kModuleError' in deps_1.Kerberos) { + return callback(deps_1.Kerberos['kModuleError']); + } + const { initializeClient } = deps_1.Kerberos; + const { username, password } = credentials; + const mechanismProperties = credentials.mechanismProperties; + const serviceName = (_a = mechanismProperties.SERVICE_NAME) !== null && _a !== void 0 ? _a : 'mongodb'; + performGSSAPICanonicalizeHostName(hostAddress.host, mechanismProperties, (err, host) => { + var _a; + if (err) + return callback(err); + const initOptions = {}; + if (password != null) { + Object.assign(initOptions, { user: username, password: password }); + } + const spnHost = (_a = mechanismProperties.SERVICE_HOST) !== null && _a !== void 0 ? _a : host; + let spn = `${serviceName}${process.platform === 'win32' ? '/' : '@'}${spnHost}`; + if ('SERVICE_REALM' in mechanismProperties) { + spn = `${spn}@${mechanismProperties.SERVICE_REALM}`; + } + initializeClient(spn, initOptions, (err, client) => { + // TODO(NODE-3483) + if (err) + return callback(new error_1.MongoRuntimeError(err)); + callback(undefined, client); + }); + }); +} +function saslStart(payload) { + return { + saslStart: 1, + mechanism: 'GSSAPI', + payload, + autoAuthorize: 1 + }; +} +function saslContinue(payload, conversationId) { + return { + saslContinue: 1, + conversationId, + payload + }; +} +function negotiate(client, retries, payload, callback) { + client.step(payload, (err, response) => { + // Retries exhausted, raise error + if (err && retries === 0) + return callback(err); + // Adjust number of retries and call step again + if (err) + return negotiate(client, retries - 1, payload, callback); + // Return the payload + callback(undefined, response || ''); + }); +} +function finalize(client, user, payload, callback) { + // GSS Client Unwrap + client.unwrap(payload, (err, response) => { + if (err) + return callback(err); + // Wrap the response + client.wrap(response || '', { user }, (err, wrapped) => { + if (err) + return callback(err); + // Return the payload + callback(undefined, wrapped); + }); + }); +} +function performGSSAPICanonicalizeHostName(host, mechanismProperties, callback) { + const mode = mechanismProperties.CANONICALIZE_HOST_NAME; + if (!mode || mode === exports.GSSAPICanonicalizationValue.none) { + return callback(undefined, host); + } + // If forward and reverse or true + if (mode === exports.GSSAPICanonicalizationValue.on || + mode === exports.GSSAPICanonicalizationValue.forwardAndReverse) { + // Perform the lookup of the ip address. + dns.lookup(host, (error, address) => { + // No ip found, return the error. + if (error) + return callback(error); + // Perform a reverse ptr lookup on the ip address. + dns.resolvePtr(address, (err, results) => { + // This can error as ptr records may not exist for all ips. In this case + // fallback to a cname lookup as dns.lookup() does not return the + // cname. + if (err) { + return resolveCname(host, callback); + } + // If the ptr did not error but had no results, return the host. + callback(undefined, results.length > 0 ? results[0] : host); + }); + }); + } + else { + // The case for forward is just to resolve the cname as dns.lookup() + // will not return it. + resolveCname(host, callback); + } +} +exports.performGSSAPICanonicalizeHostName = performGSSAPICanonicalizeHostName; +function resolveCname(host, callback) { + // Attempt to resolve the host name + dns.resolveCname(host, (err, r) => { + if (err) + return callback(undefined, host); + // Get the first resolve host id + if (r.length > 0) { + return callback(undefined, r[0]); + } + callback(undefined, host); + }); +} +exports.resolveCname = resolveCname; +//# sourceMappingURL=gssapi.js.map \ No newline at end of file diff --git a/node_modules/mongodb/lib/cmap/auth/gssapi.js.map b/node_modules/mongodb/lib/cmap/auth/gssapi.js.map new file mode 100644 index 000000000..341c2e07a --- /dev/null +++ b/node_modules/mongodb/lib/cmap/auth/gssapi.js.map @@ -0,0 +1 @@ +{"version":3,"file":"gssapi.js","sourceRoot":"","sources":["../../../src/cmap/auth/gssapi.ts"],"names":[],"mappings":";;;AAAA,2BAA2B;AAG3B,qCAAsD;AACtD,uCAMqB;AACrB,uCAA2C;AAC3C,mDAA4D;AAE5D,cAAc;AACD,QAAA,2BAA2B,GAAG,MAAM,CAAC,MAAM,CAAC;IACvD,EAAE,EAAE,IAAI;IACR,GAAG,EAAE,KAAK;IACV,IAAI,EAAE,MAAM;IACZ,OAAO,EAAE,SAAS;IAClB,iBAAiB,EAAE,mBAAmB;CAC9B,CAAC,CAAC;AAeZ,MAAa,MAAO,SAAQ,4BAAY;IAC7B,IAAI,CAAC,WAAwB,EAAE,QAAkB;QACxD,MAAM,EAAE,UAAU,EAAE,WAAW,EAAE,GAAG,WAAW,CAAC;QAChD,IAAI,WAAW,IAAI,IAAI;YACrB,OAAO,QAAQ,CACb,IAAI,oCAA4B,CAAC,gDAAgD,CAAC,CACnF,CAAC;QACJ,MAAM,EAAE,QAAQ,EAAE,GAAG,WAAW,CAAC;QACjC,SAAS,eAAe,CACtB,OAAiB,EACjB,EAAsD;YAEtD,OAAO,UAAU,CAAC,OAAO,CAAC,IAAA,UAAE,EAAC,gBAAgB,CAAC,EAAE,OAAO,EAAE,SAAS,EAAE,EAAE,CAAC,CAAC;QAC1E,CAAC;QACD,kBAAkB,CAAC,WAAW,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,EAAE;YAC9C,IAAI,GAAG;gBAAE,OAAO,QAAQ,CAAC,GAAG,CAAC,CAAC;YAC9B,IAAI,MAAM,IAAI,IAAI;gBAAE,OAAO,QAAQ,CAAC,IAAI,mCAA2B,CAAC,uBAAuB,CAAC,CAAC,CAAC;YAC9F,MAAM,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC,GAAG,EAAE,OAAO,EAAE,EAAE;gBAC/B,IAAI,GAAG;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YAAY,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;iBACrC;gBACD,gEAAgE;gBAChE,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;YAC9D,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;KACJ;SAAM;QACL,oEAAoE;QACpE,sBAAsB;QACtB,YAAY,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;KAC9B;AACH,CAAC;AArCD,8EAqCC;AAED,SAAgB,YAAY,CAAC,IAAY,EAAE,QAA0B;IACnE,mCAAmC;IACnC,GAAG,CAAC,YAAY,CAAC,IAAI,EAAE,CAAC,GAAG,EAAE,CAAC,EAAE,EAAE;QAChC,IAAI,GAAG;YAAE,OAAO,QAAQ,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;QAE1C,gCAAgC;QAChC,IAAI,CAAC,CAAC,MAAM,GAAG,CAAC,EAAE;YAChB,OAAO,QAAQ,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;SAClC;QAED,QAAQ,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;IAC5B,CAAC,CAAC,CAAC;AACL,CAAC;AAZD,oCAYC"} \ No newline at end of file diff --git a/node_modules/mongodb/lib/cmap/auth/mongo_credentials.js b/node_modules/mongodb/lib/cmap/auth/mongo_credentials.js new file mode 100644 index 000000000..7fe66e5b5 --- /dev/null +++ b/node_modules/mongodb/lib/cmap/auth/mongo_credentials.js @@ -0,0 +1,134 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.MongoCredentials = void 0; +const error_1 = require("../../error"); +const utils_1 = require("../../utils"); +const gssapi_1 = require("./gssapi"); +const providers_1 = require("./providers"); +// https://github.com/mongodb/specifications/blob/master/source/auth/auth.rst +function getDefaultAuthMechanism(hello) { + if (hello) { + // If hello contains saslSupportedMechs, use scram-sha-256 + // if it is available, else scram-sha-1 + if (Array.isArray(hello.saslSupportedMechs)) { + return hello.saslSupportedMechs.includes(providers_1.AuthMechanism.MONGODB_SCRAM_SHA256) + ? providers_1.AuthMechanism.MONGODB_SCRAM_SHA256 + : providers_1.AuthMechanism.MONGODB_SCRAM_SHA1; + } + // Fallback to legacy selection method. If wire version >= 3, use scram-sha-1 + if (hello.maxWireVersion >= 3) { + return providers_1.AuthMechanism.MONGODB_SCRAM_SHA1; + } + } + // Default for wireprotocol < 3 + return providers_1.AuthMechanism.MONGODB_CR; +} +/** + * A representation of the credentials used by MongoDB + * @public + */ +class MongoCredentials { + constructor(options) { + this.username = options.username; + this.password = options.password; + this.source = options.source; + if (!this.source && options.db) { + this.source = options.db; + } + this.mechanism = options.mechanism || providers_1.AuthMechanism.MONGODB_DEFAULT; + this.mechanismProperties = options.mechanismProperties || {}; + if (this.mechanism.match(/MONGODB-AWS/i)) { + if (!this.username && process.env.AWS_ACCESS_KEY_ID) { + this.username = process.env.AWS_ACCESS_KEY_ID; + } + if (!this.password && process.env.AWS_SECRET_ACCESS_KEY) { + this.password = process.env.AWS_SECRET_ACCESS_KEY; + } + if (this.mechanismProperties.AWS_SESSION_TOKEN == null && + process.env.AWS_SESSION_TOKEN != null) { + this.mechanismProperties = { + ...this.mechanismProperties, + AWS_SESSION_TOKEN: process.env.AWS_SESSION_TOKEN + }; + } + } + if ('gssapiCanonicalizeHostName' in this.mechanismProperties) { + (0, utils_1.emitWarningOnce)('gssapiCanonicalizeHostName is deprecated. Please use CANONICALIZE_HOST_NAME instead.'); + this.mechanismProperties.CANONICALIZE_HOST_NAME = + this.mechanismProperties.gssapiCanonicalizeHostName; + } + Object.freeze(this.mechanismProperties); + Object.freeze(this); + } + /** Determines if two MongoCredentials objects are equivalent */ + equals(other) { + return (this.mechanism === other.mechanism && + this.username === other.username && + this.password === other.password && + this.source === other.source); + } + /** + * If the authentication mechanism is set to "default", resolves the authMechanism + * based on the server version and server supported sasl mechanisms. + * + * @param hello - A hello response from the server + */ + resolveAuthMechanism(hello) { + // If the mechanism is not "default", then it does not need to be resolved + if (this.mechanism.match(/DEFAULT/i)) { + return new MongoCredentials({ + username: this.username, + password: this.password, + source: this.source, + mechanism: getDefaultAuthMechanism(hello), + mechanismProperties: this.mechanismProperties + }); + } + return this; + } + validate() { + var _a; + if ((this.mechanism === providers_1.AuthMechanism.MONGODB_GSSAPI || + this.mechanism === providers_1.AuthMechanism.MONGODB_CR || + this.mechanism === providers_1.AuthMechanism.MONGODB_PLAIN || + this.mechanism === providers_1.AuthMechanism.MONGODB_SCRAM_SHA1 || + this.mechanism === providers_1.AuthMechanism.MONGODB_SCRAM_SHA256) && + !this.username) { + throw new error_1.MongoMissingCredentialsError(`Username required for mechanism '${this.mechanism}'`); + } + if (providers_1.AUTH_MECHS_AUTH_SRC_EXTERNAL.has(this.mechanism)) { + if (this.source != null && this.source !== '$external') { + // TODO(NODE-3485): Replace this with a MongoAuthValidationError + throw new error_1.MongoAPIError(`Invalid source '${this.source}' for mechanism '${this.mechanism}' specified.`); + } + } + if (this.mechanism === providers_1.AuthMechanism.MONGODB_PLAIN && this.source == null) { + // TODO(NODE-3485): Replace this with a MongoAuthValidationError + throw new error_1.MongoAPIError('PLAIN Authentication Mechanism needs an auth source'); + } + if (this.mechanism === providers_1.AuthMechanism.MONGODB_X509 && this.password != null) { + if (this.password === '') { + Reflect.set(this, 'password', undefined); + return; + } + // TODO(NODE-3485): Replace this with a MongoAuthValidationError + throw new error_1.MongoAPIError(`Password not allowed for mechanism MONGODB-X509`); + } + const canonicalization = (_a = this.mechanismProperties.CANONICALIZE_HOST_NAME) !== null && _a !== void 0 ? _a : false; + if (!Object.values(gssapi_1.GSSAPICanonicalizationValue).includes(canonicalization)) { + throw new error_1.MongoAPIError(`Invalid CANONICALIZE_HOST_NAME value: ${canonicalization}`); + } + } + static merge(creds, options) { + var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l; + return new MongoCredentials({ + username: (_b = (_a = options.username) !== null && _a !== void 0 ? _a : creds === null || creds === void 0 ? void 0 : creds.username) !== null && _b !== void 0 ? _b : '', + password: (_d = (_c = options.password) !== null && _c !== void 0 ? _c : creds === null || creds === void 0 ? void 0 : creds.password) !== null && _d !== void 0 ? _d : '', + mechanism: (_f = (_e = options.mechanism) !== null && _e !== void 0 ? _e : creds === null || creds === void 0 ? void 0 : creds.mechanism) !== null && _f !== void 0 ? _f : providers_1.AuthMechanism.MONGODB_DEFAULT, + mechanismProperties: (_h = (_g = options.mechanismProperties) !== null && _g !== void 0 ? _g : creds === null || creds === void 0 ? void 0 : creds.mechanismProperties) !== null && _h !== void 0 ? _h : {}, + source: (_l = (_k = (_j = options.source) !== null && _j !== void 0 ? _j : options.db) !== null && _k !== void 0 ? _k : creds === null || creds === void 0 ? void 0 : creds.source) !== null && _l !== void 0 ? _l : 'admin' + }); + } +} +exports.MongoCredentials = MongoCredentials; +//# sourceMappingURL=mongo_credentials.js.map \ No newline at end of file diff --git a/node_modules/mongodb/lib/cmap/auth/mongo_credentials.js.map b/node_modules/mongodb/lib/cmap/auth/mongo_credentials.js.map new file mode 100644 index 000000000..3f88b0fe6 --- /dev/null +++ b/node_modules/mongodb/lib/cmap/auth/mongo_credentials.js.map @@ -0,0 +1 @@ +{"version":3,"file":"mongo_credentials.js","sourceRoot":"","sources":["../../../src/cmap/auth/mongo_credentials.ts"],"names":[],"mappings":";;;AAEA,uCAA0E;AAC1E,uCAA8C;AAC9C,qCAAuD;AACvD,2CAA0E;AAE1E,6EAA6E;AAC7E,SAAS,uBAAuB,CAAC,KAAgB;IAC/C,IAAI,KAAK,EAAE;QACT,0DAA0D;QAC1D,uCAAuC;QACvC,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,kBAAkB,CAAC,EAAE;YAC3C,OAAO,KAAK,CAAC,kBAAkB,CAAC,QAAQ,CAAC,yBAAa,CAAC,oBAAoB,CAAC;gBAC1E,CAAC,CAAC,yBAAa,CAAC,o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AC,CAAC,QAAQ,CAAC,gBAAgB,CAAC,EAAE;YAC1E,MAAM,IAAI,qBAAa,CAAC,yCAAyC,gBAAgB,EAAE,CAAC,CAAC;SACtF;IACH,CAAC;IAED,MAAM,CAAC,KAAK,CACV,KAAmC,EACnC,OAAyC;;QAEzC,OAAO,IAAI,gBAAgB,CAAC;YAC1B,QAAQ,EAAE,MAAA,MAAA,OAAO,CAAC,QAAQ,mCAAI,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,QAAQ,mCAAI,EAAE;YACnD,QAAQ,EAAE,MAAA,MAAA,OAAO,CAAC,QAAQ,mCAAI,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,QAAQ,mCAAI,EAAE;YACnD,SAAS,EAAE,MAAA,MAAA,OAAO,CAAC,SAAS,mCAAI,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,SAAS,mCAAI,yBAAa,CAAC,eAAe;YACjF,mBAAmB,EAAE,MAAA,MAAA,OAAO,CAAC,mBAAmB,mCAAI,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,mBAAmB,mCAAI,EAAE;YACpF,MAAM,EAAE,MAAA,MAAA,MAAA,OAAO,CAAC,MAAM,mCAAI,OAAO,CAAC,EAAE,mCAAI,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,MAAM,mCAAI,OAAO;SACjE,CAAC,CAAC;IACL,CAAC;CACF;AA1ID,4CA0IC"} \ No newline at end of file diff --git a/node_modules/mongodb/lib/cmap/auth/mongocr.js b/node_modules/mongodb/lib/cmap/auth/mongocr.js new file mode 100644 index 000000000..f8afea2dd --- /dev/null +++ b/node_modules/mongodb/lib/cmap/auth/mongocr.js @@ -0,0 +1,44 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.MongoCR = void 0; +const crypto = require("crypto"); +const error_1 = require("../../error"); +const utils_1 = require("../../utils"); +const auth_provider_1 = require("./auth_provider"); +class MongoCR extends auth_provider_1.AuthProvider { + auth(authContext, callback) { + const { connection, credentials } = authContext; + if (!credentials) { + return callback(new error_1.MongoMissingCredentialsError('AuthContext must provide credentials.')); + } + const username = credentials.username; + const password = credentials.password; + const source = credentials.source; + connection.command((0, utils_1.ns)(`${source}.$cmd`), { getnonce: 1 }, undefined, (err, r) => { + let nonce = null; + let key = null; + // Get nonce + if (err == null) { + nonce = r.nonce; + // Use node md5 generator + let md5 = crypto.createHash('md5'); + // Generate keys used for authentication + md5.update(`${username}:mongo:${password}`, 'utf8'); + const hash_password = md5.digest('hex'); + // Final key + md5 = crypto.createHash('md5'); + md5.update(nonce + username + hash_password, 'utf8'); + key = md5.digest('hex'); + } + const authenticateCommand = { + authenticate: 1, + user: username, + nonce, + key + }; + connection.command((0, utils_1.ns)(`${source}.$cmd`), authenticateCommand, undefined, callback); + }); + } +} +exports.MongoCR = MongoCR; +//# sourceMappingURL=mongocr.js.map \ No newline at end of file diff --git a/node_modules/mongodb/lib/cmap/auth/mongocr.js.map b/node_modules/mongodb/lib/cmap/auth/mongocr.js.map new file mode 100644 index 000000000..62e4f9796 --- /dev/null +++ b/node_modules/mongodb/lib/cmap/auth/mongocr.js.map @@ -0,0 +1 @@ +{"version":3,"file":"mongocr.js","sourceRoot":"","sources":["../../../src/cmap/auth/mongocr.ts"],"names":[],"mappings":";;;AAAA,iCAAiC;AAEjC,uCAA2D;AAC3D,uCAA2C;AAC3C,mDAA4D;AAE5D,MAAa,OAAQ,SAAQ,4BAAY;IAC9B,IAAI,CAAC,WAAwB,EAAE,QAAkB;QACxD,MAAM,EAAE,UAAU,EAAE,WAAW,EAAE,GAAG,WAAW,CAAC;QAChD,IAAI,CAAC,WAAW,EAAE;YAChB,OAAO,QAAQ,CAAC,IAAI,oCAA4B,CAAC,uCAAuC,CAAC,CAAC,CAAC;SAC5F;QACD,MAAM,QAAQ,GAAG,WAAW,CAAC,QAAQ,CAAC;QACtC,MAAM,QAAQ,GAAG,WAAW,CAAC,QAAQ,CAAC;QACtC,MAAM,MAAM,GAAG,WAAW,CAAC,MAAM,CAAC;QAClC,UAAU,CAAC,OAAO,CAAC,IAAA,UAAE,EAAC,GAAG,MAAM,OAAO,CAAC,EAAE,EAAE,QAAQ,EAAE,CAAC,EAAE,EAAE,SAAS,EAAE,CAAC,GAAG,EAAE,CAAC,EAAE,EAAE;YAC9E,IAAI,KAAK,GAAG,IAAI,CAAC;YACjB,IAAI,GAAG,GAAG,IAAI,CAAC;YAEf,YAAY;YACZ,IAAI,GAAG,IAAI,IAAI,EAAE;gBACf,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC;gBAEhB,yBAAyB;gBACzB,IAAI,GAAG,GAAG,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;gBAEnC,wCAAwC;gBACxC,GAAG,CAAC,MAAM,CAAC,GAAG,QAAQ,UAAU,QAAQ,EAAE,EAAE,MAAM,CAAC,CAAC;gBACpD,MAAM,aAAa,GAAG,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;gBAExC,YAAY;gBACZ,GAAG,GAAG,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;gBAC/B,GAAG,CAAC,MAAM,CAAC,KAAK,GAAG,QAAQ,GAAG,aAAa,EAAE,MAAM,CAAC,CAAC;gBACrD,GAAG,GAAG,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;aACzB;YAED,MAAM,mBAAmB,GAAG;gBAC1B,YAAY,EAAE,CAAC;gBACf,IAAI,EAAE,QAAQ;gBACd,KAAK;gBACL,GAAG;aACJ,CAAC;YAEF,UAAU,CAAC,OAAO,CAAC,IAAA,UAAE,EAAC,GAAG,MAAM,OAAO,CAAC,EAAE,mBAAmB,EAAE,SAAS,EAAE,QAAQ,CAAC,CAAC;QACrF,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AAxCD,0BAwCC"} \ No newline at end of file diff --git a/node_modules/mongodb/lib/cmap/auth/mongodb_aws.js b/node_modules/mongodb/lib/cmap/auth/mongodb_aws.js new file mode 100644 index 000000000..ba0679fd1 --- /dev/null +++ b/node_modules/mongodb/lib/cmap/auth/mongodb_aws.js @@ -0,0 +1,204 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.MongoDBAWS = void 0; +const crypto = require("crypto"); +const http = require("http"); +const url = require("url"); +const BSON = require("../../bson"); +const deps_1 = require("../../deps"); +const error_1 = require("../../error"); +const utils_1 = require("../../utils"); +const auth_provider_1 = require("./auth_provider"); +const mongo_credentials_1 = require("./mongo_credentials"); +const providers_1 = require("./providers"); +const ASCII_N = 110; +const AWS_RELATIVE_URI = 'http://169.254.170.2'; +const AWS_EC2_URI = 'http://169.254.169.254'; +const AWS_EC2_PATH = '/latest/meta-data/iam/security-credentials'; +const bsonOptions = { + promoteLongs: true, + promoteValues: true, + promoteBuffers: false, + bsonRegExp: false +}; +class MongoDBAWS extends auth_provider_1.AuthProvider { + auth(authContext, callback) { + const { connection, credentials } = authContext; + if (!credentials) { + return callback(new error_1.MongoMissingCredentialsError('AuthContext must provide credentials.')); + } + if ('kModuleError' in deps_1.aws4) { + return callback(deps_1.aws4['kModuleError']); + } + const { sign } = deps_1.aws4; + if ((0, utils_1.maxWireVersion)(connection) < 9) { + callback(new error_1.MongoCompatibilityError('MONGODB-AWS authentication requires MongoDB version 4.4 or later')); + return; + } + if (!credentials.username) { + makeTempCredentials(credentials, (err, tempCredentials) => { + if (err || !tempCredentials) + return callback(err); + authContext.credentials = tempCredentials; + this.auth(authContext, callback); + }); + return; + } + const accessKeyId = credentials.username; + const secretAccessKey = credentials.password; + const sessionToken = credentials.mechanismProperties.AWS_SESSION_TOKEN; + // If all three defined, include sessionToken, else include username and pass, else no credentials + const awsCredentials = accessKeyId && secretAccessKey && sessionToken + ? { accessKeyId, secretAccessKey, sessionToken } + : accessKeyId && secretAccessKey + ? { accessKeyId, secretAccessKey } + : undefined; + const db = credentials.source; + crypto.randomBytes(32, (err, nonce) => { + if (err) { + callback(err); + return; + } + const saslStart = { + saslStart: 1, + mechanism: 'MONGODB-AWS', + payload: BSON.serialize({ r: nonce, p: ASCII_N }, bsonOptions) + }; + connection.command((0, utils_1.ns)(`${db}.$cmd`), saslStart, undefined, (err, res) => { + if (err) + return callback(err); + const serverResponse = BSON.deserialize(res.payload.buffer, bsonOptions); + const host = serverResponse.h; + const serverNonce = serverResponse.s.buffer; + if (serverNonce.length !== 64) { + callback( + // TODO(NODE-3483) + new error_1.MongoRuntimeError(`Invalid server nonce length ${serverNonce.length}, expected 64`)); + return; + } + if (serverNonce.compare(nonce, 0, nonce.length, 0, nonce.length) !== 0) { + // TODO(NODE-3483) + callback(new error_1.MongoRuntimeError('Server nonce does not begin with client nonce')); + return; + } + if (host.length < 1 || host.length > 255 || host.indexOf('..') !== -1) { + // TODO(NODE-3483) + callback(new error_1.MongoRuntimeError(`Server returned an invalid host: "${host}"`)); + return; + } + const body = 'Action=GetCallerIdentity&Version=2011-06-15'; + const options = sign({ + method: 'POST', + host, + region: deriveRegion(serverResponse.h), + service: 'sts', + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + 'Content-Length': body.length, + 'X-MongoDB-Server-Nonce': serverNonce.toString('base64'), + 'X-MongoDB-GS2-CB-Flag': 'n' + }, + path: '/', + body + }, awsCredentials); + const payload = { + a: options.headers.Authorization, + d: options.headers['X-Amz-Date'] + }; + if (sessionToken) { + payload.t = sessionToken; + } + const saslContinue = { + saslContinue: 1, + conversationId: 1, + payload: BSON.serialize(payload, bsonOptions) + }; + connection.command((0, utils_1.ns)(`${db}.$cmd`), saslContinue, undefined, callback); + }); + }); + } +} +exports.MongoDBAWS = MongoDBAWS; +function makeTempCredentials(credentials, callback) { + function done(creds) { + if (!creds.AccessKeyId || !creds.SecretAccessKey || !creds.Token) { + callback(new error_1.MongoMissingCredentialsError('Could not obtain temporary MONGODB-AWS credentials')); + return; + } + callback(undefined, new mongo_credentials_1.MongoCredentials({ + username: creds.AccessKeyId, + password: creds.SecretAccessKey, + source: credentials.source, + mechanism: providers_1.AuthMechanism.MONGODB_AWS, + mechanismProperties: { + AWS_SESSION_TOKEN: creds.Token + } + })); + } + // If the environment variable AWS_CONTAINER_CREDENTIALS_RELATIVE_URI + // is set then drivers MUST assume that it was set by an AWS ECS agent + if (process.env.AWS_CONTAINER_CREDENTIALS_RELATIVE_URI) { + request(`${AWS_RELATIVE_URI}${process.env.AWS_CONTAINER_CREDENTIALS_RELATIVE_URI}`, undefined, (err, res) => { + if (err) + return callback(err); + done(res); + }); + return; + } + // Otherwise assume we are on an EC2 instance + // get a token + request(`${AWS_EC2_URI}/latest/api/token`, { method: 'PUT', json: false, headers: { 'X-aws-ec2-metadata-token-ttl-seconds': 30 } }, (err, token) => { + if (err) + return callback(err); + // get role name + request(`${AWS_EC2_URI}/${AWS_EC2_PATH}`, { json: false, headers: { 'X-aws-ec2-metadata-token': token } }, (err, roleName) => { + if (err) + return callback(err); + // get temp credentials + request(`${AWS_EC2_URI}/${AWS_EC2_PATH}/${roleName}`, { headers: { 'X-aws-ec2-metadata-token': token } }, (err, creds) => { + if (err) + return callback(err); + done(creds); + }); + }); + }); +} +function deriveRegion(host) { + const parts = host.split('.'); + if (parts.length === 1 || parts[1] === 'amazonaws') { + return 'us-east-1'; + } + return parts[1]; +} +function request(uri, _options, callback) { + const options = Object.assign({ + method: 'GET', + timeout: 10000, + json: true + }, url.parse(uri), _options); + const req = http.request(options, res => { + res.setEncoding('utf8'); + let data = ''; + res.on('data', d => (data += d)); + res.on('end', () => { + if (options.json === false) { + callback(undefined, data); + return; + } + try { + const parsed = JSON.parse(data); + callback(undefined, parsed); + } + catch (err) { + // TODO(NODE-3483) + callback(new error_1.MongoRuntimeError(`Invalid JSON response: "${data}"`)); + } + }); + }); + req.on('timeout', () => { + req.destroy(new error_1.MongoAWSError(`AWS request to ${uri} timed out after ${options.timeout} ms`)); + }); + req.on('error', err => callback(err)); + req.end(); +} +//# sourceMappingURL=mongodb_aws.js.map \ No newline at end of file diff --git a/node_modules/mongodb/lib/cmap/auth/mongodb_aws.js.map b/node_modules/mongodb/lib/cmap/auth/mongodb_aws.js.map new file mode 100644 index 000000000..f88f08b05 --- /dev/null +++ b/node_modules/mongodb/lib/cmap/auth/mongodb_aws.js.map @@ -0,0 +1 @@ +{"version":3,"file":"mongodb_aws.js","sourceRoot":"","sources":["../../../src/cmap/auth/mongodb_aws.ts"],"names":[],"mappings":";;;AAAA,iCAAiC;AACjC,6BAA6B;AAC7B,2BAA2B;AAG3B,mCAAmC;AACnC,qCAAkC;AAClC,uCAKqB;AACrB,uCAA2D;AAC3D,mDAA4D;AAC5D,2DAAuD;AACvD,2CAA4C;AAE5C,MAAM,OAAO,GAAG,GAAG,CAAC;AACpB,MAAM,gBAAgB,GAAG,sBAAsB,CAAC;AAChD,MAAM,WAAW,GAAG,wBAAwB,CAAC;AAC7C,MAAM,YAAY,GAAG,4CAA4C,CAAC;AAClE,MAAM,WAAW,GAAyB;IACxC,YAAY,EAAE,IAAI;IAClB,aAAa,EAAE,IAAI;IACnB,cAAc,EAAE,KAAK;IACrB,UAAU,EAAE,KAAK;CAClB,CAAC;AAQF,MAAa,UAAW,SAAQ,4BAAY;IACjC,IAAI,CAAC,WAAwB,EAAE,QAAkB;QACxD,MAAM,EAAE,UAAU,EAAE,WAAW,EAAE,GAAG,WAAW,CAAC;QAChD,IAAI,CAAC,WAAW,EAAE;YAChB,OAAO,QAAQ,CAAC,IAAI,oCAA4B,CAAC,uCAAuC,CAAC,CAAC,CAAC;SAC5F;QAED,IAAI,cAAc,IAAI,WAAI,EAAE;YAC1B,OAAO,QAAQ,CAAC,WAAI,CAAC,cAAc,CAAC,CAAC,CAAC;SACvC;QACD,MAAM,EAAE,IAAI,EAAE,GAAG,WAAI,CAAC;QAEtB,IAAI,IAAA,sBAAc,EAAC,UAAU,CAAC,GAAG,CAAC,EAAE;YAClC,QAAQ,CACN,IAAI,+BAAuB,CACzB,kEAAkE,CACnE,CACF,CAAC;YACF,OAAO;SACR;QAED,IAAI,CAAC,WAAW,CAAC,QAAQ,EAAE;YACzB,mBA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B,QAAQ,CAAC,IAAI,yBAAiB,CAAC,2BAA2B,IAAI,GAAG,CAAC,CAAC,CAAC;aACrE;QACH,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,GAAG,CAAC,EAAE,CAAC,SAAS,EAAE,GAAG,EAAE;QACrB,GAAG,CAAC,OAAO,CAAC,IAAI,qBAAa,CAAC,kBAAkB,GAAG,oBAAoB,OAAO,CAAC,OAAO,KAAK,CAAC,CAAC,CAAC;IAChG,CAAC,CAAC,CAAC;IAEH,GAAG,CAAC,EAAE,CAAC,OAAO,EAAE,GAAG,CAAC,EAAE,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC;IACtC,GAAG,CAAC,GAAG,EAAE,CAAC;AACZ,CAAC"} \ No newline at end of file diff --git a/node_modules/mongodb/lib/cmap/auth/plain.js b/node_modules/mongodb/lib/cmap/auth/plain.js new file mode 100644 index 000000000..e7153a58c --- /dev/null +++ b/node_modules/mongodb/lib/cmap/auth/plain.js @@ -0,0 +1,27 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Plain = void 0; +const bson_1 = require("../../bson"); +const error_1 = require("../../error"); +const utils_1 = require("../../utils"); +const auth_provider_1 = require("./auth_provider"); +class Plain extends auth_provider_1.AuthProvider { + auth(authContext, callback) { + const { connection, credentials } = authContext; + if (!credentials) { + return callback(new error_1.MongoMissingCredentialsError('AuthContext must provide credentials.')); + } + const username = credentials.username; + const password = credentials.password; + const payload = new bson_1.Binary(Buffer.from(`\x00${username}\x00${password}`)); + const command = { + saslStart: 1, + mechanism: 'PLAIN', + payload: payload, + autoAuthorize: 1 + }; + connection.command((0, utils_1.ns)('$external.$cmd'), command, undefined, callback); + } +} +exports.Plain = Plain; +//# sourceMappingURL=plain.js.map \ No newline at end of file diff --git a/node_modules/mongodb/lib/cmap/auth/plain.js.map b/node_modules/mongodb/lib/cmap/auth/plain.js.map new file mode 100644 index 000000000..a03580a35 --- /dev/null +++ b/node_modules/mongodb/lib/cmap/auth/plain.js.map @@ -0,0 +1 @@ +{"version":3,"file":"plain.js","sourceRoot":"","sources":["../../../src/cmap/auth/plain.ts"],"names":[],"mappings":";;;AAAA,qCAAoC;AACpC,uCAA2D;AAC3D,uCAA2C;AAC3C,mDAA4D;AAE5D,MAAa,KAAM,SAAQ,4BAAY;IAC5B,IAAI,CAAC,WAAwB,EAAE,QAAkB;QACxD,MAAM,EAAE,UAAU,EAAE,WAAW,EAAE,GAAG,WAAW,CAAC;QAChD,IAAI,CAAC,WAAW,EAAE;YAChB,OAAO,QAAQ,CAAC,IAAI,oCAA4B,CAAC,uCAAuC,CAAC,CAAC,CAAC;SAC5F;QACD,MAAM,QAAQ,GAAG,WAAW,CAAC,QAAQ,CAAC;QACtC,MAAM,QAAQ,GAAG,WAAW,CAAC,QAAQ,CAAC;QAEtC,MAAM,OAAO,GAAG,IAAI,aAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,QAAQ,OAAO,QAAQ,EAAE,CAAC,CAAC,CAAC;QAC1E,MAAM,OAAO,GAAG;YACd,SAAS,EAAE,CAAC;YACZ,SAAS,EAAE,OAAO;YAClB,OAAO,EAAE,OAAO;YAChB,aAAa,EAAE,CAAC;SACjB,CAAC;QAEF,UAAU,CAAC,OAAO,CAAC,IAAA,UAAE,EAAC,gBAAgB,CAAC,EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,CAAC,CAAC;IACzE,CAAC;CACF;AAnBD,sBAmBC"} \ No newline at end of file diff --git a/node_modules/mongodb/lib/cmap/auth/providers.js b/node_modules/mongodb/lib/cmap/auth/providers.js new file mode 100644 index 000000000..d287765f0 --- /dev/null +++ b/node_modules/mongodb/lib/cmap/auth/providers.js @@ -0,0 +1,21 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.AUTH_MECHS_AUTH_SRC_EXTERNAL = exports.AuthMechanism = void 0; +/** @public */ +exports.AuthMechanism = Object.freeze({ + MONGODB_AWS: 'MONGODB-AWS', + MONGODB_CR: 'MONGODB-CR', + MONGODB_DEFAULT: 'DEFAULT', + MONGODB_GSSAPI: 'GSSAPI', + MONGODB_PLAIN: 'PLAIN', + MONGODB_SCRAM_SHA1: 'SCRAM-SHA-1', + MONGODB_SCRAM_SHA256: 'SCRAM-SHA-256', + MONGODB_X509: 'MONGODB-X509' +}); +/** @internal */ +exports.AUTH_MECHS_AUTH_SRC_EXTERNAL = new Set([ + exports.AuthMechanism.MONGODB_GSSAPI, + exports.AuthMechanism.MONGODB_AWS, + exports.AuthMechanism.MONGODB_X509 +]); +//# sourceMappingURL=providers.js.map \ No newline at end of file diff --git a/node_modules/mongodb/lib/cmap/auth/providers.js.map b/node_modules/mongodb/lib/cmap/auth/providers.js.map new file mode 100644 index 000000000..48b58e79e --- /dev/null +++ b/node_modules/mongodb/lib/cmap/auth/providers.js.map @@ -0,0 +1 @@ +{"version":3,"file":"providers.js","sourceRoot":"","sources":["../../../src/cmap/auth/providers.ts"],"names":[],"mappings":";;;AAAA,cAAc;AACD,QAAA,aAAa,GAAG,MAAM,CAAC,MAAM,CAAC;IACzC,WAAW,EAAE,aAAa;IAC1B,UAAU,EAAE,YAAY;IACxB,eAAe,EAAE,SAAS;IAC1B,cAAc,EAAE,QAAQ;IACxB,aAAa,EAAE,OAAO;IACtB,kBAAkB,EAAE,aAAa;IACjC,oBAAoB,EAAE,eAAe;IACrC,YAAY,EAAE,cAAc;CACpB,CAAC,CAAC;AAKZ,gBAAgB;AACH,QAAA,4BAA4B,GAAG,IAAI,GAAG,CAAgB;IACjE,qBAAa,CAAC,cAAc;IAC5B,qBAAa,CAAC,WAAW;IACzB,qBAAa,CAAC,YAAY;CAC3B,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/mongodb/lib/cmap/auth/scram.js b/node_modules/mongodb/lib/cmap/auth/scram.js new file mode 100644 index 000000000..00a77ac00 --- /dev/null +++ b/node_modules/mongodb/lib/cmap/auth/scram.js @@ -0,0 +1,288 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ScramSHA256 = exports.ScramSHA1 = void 0; +const crypto = require("crypto"); +const bson_1 = require("../../bson"); +const deps_1 = require("../../deps"); +const error_1 = require("../../error"); +const utils_1 = require("../../utils"); +const auth_provider_1 = require("./auth_provider"); +const providers_1 = require("./providers"); +class ScramSHA extends auth_provider_1.AuthProvider { + constructor(cryptoMethod) { + super(); + this.cryptoMethod = cryptoMethod || 'sha1'; + } + prepare(handshakeDoc, authContext, callback) { + const cryptoMethod = this.cryptoMethod; + const credentials = authContext.credentials; + if (!credentials) { + return callback(new error_1.MongoMissingCredentialsError('AuthContext must provide credentials.')); + } + if (cryptoMethod === 'sha256' && deps_1.saslprep == null) { + (0, utils_1.emitWarning)('Warning: no saslprep library specified. Passwords will not be sanitized'); + } + crypto.randomBytes(24, (err, nonce) => { + if (err) { + return callback(err); + } + // store the nonce for later use + Object.assign(authContext, { nonce }); + const request = Object.assign({}, handshakeDoc, { + speculativeAuthenticate: Object.assign(makeFirstMessage(cryptoMethod, credentials, nonce), { + db: credentials.source + }) + }); + callback(undefined, request); + }); + } + auth(authContext, callback) { + const response = authContext.response; + if (response && response.speculativeAuthenticate) { + continueScramConversation(this.cryptoMethod, response.speculativeAuthenticate, authContext, callback); + return; + } + executeScram(this.cryptoMethod, authContext, callback); + } +} +function cleanUsername(username) { + return username.replace('=', '=3D').replace(',', '=2C'); +} +function clientFirstMessageBare(username, nonce) { + // NOTE: This is done b/c Javascript uses UTF-16, but the server is hashing in UTF-8. + // Since the username is not sasl-prep-d, we need to do this here. + return Buffer.concat([ + Buffer.from('n=', 'utf8'), + Buffer.from(username, 'utf8'), + Buffer.from(',r=', 'utf8'), + Buffer.from(nonce.toString('base64'), 'utf8') + ]); +} +function makeFirstMessage(cryptoMethod, credentials, nonce) { + const username = cleanUsername(credentials.username); + const mechanism = cryptoMethod === 'sha1' ? providers_1.AuthMechanism.MONGODB_SCRAM_SHA1 : providers_1.AuthMechanism.MONGODB_SCRAM_SHA256; + // NOTE: This is done b/c Javascript uses UTF-16, but the server is hashing in UTF-8. + // Since the username is not sasl-prep-d, we need to do this here. + return { + saslStart: 1, + mechanism, + payload: new bson_1.Binary(Buffer.concat([Buffer.from('n,,', 'utf8'), clientFirstMessageBare(username, nonce)])), + autoAuthorize: 1, + options: { skipEmptyExchange: true } + }; +} +function executeScram(cryptoMethod, authContext, callback) { + const { connection, credentials } = authContext; + if (!credentials) { + return callback(new error_1.MongoMissingCredentialsError('AuthContext must provide credentials.')); + } + if (!authContext.nonce) { + return callback(new error_1.MongoInvalidArgumentError('AuthContext must contain a valid nonce property')); + } + const nonce = authContext.nonce; + const db = credentials.source; + const saslStartCmd = makeFirstMessage(cryptoMethod, credentials, nonce); + connection.command((0, utils_1.ns)(`${db}.$cmd`), saslStartCmd, undefined, (_err, result) => { + const err = resolveError(_err, result); + if (err) { + return callback(err); + } + continueScramConversation(cryptoMethod, result, authContext, callback); + }); +} +function continueScramConversation(cryptoMethod, response, authContext, callback) { + const connection = authContext.connection; + const credentials = authContext.credentials; + if (!credentials) { + return callback(new error_1.MongoMissingCredentialsError('AuthContext must provide credentials.')); + } + if (!authContext.nonce) { + return callback(new error_1.MongoInvalidArgumentError('Unable to continue SCRAM without valid nonce')); + } + const nonce = authContext.nonce; + const db = credentials.source; + const username = cleanUsername(credentials.username); + const password = credentials.password; + let processedPassword; + if (cryptoMethod === 'sha256') { + processedPassword = 'kModuleError' in deps_1.saslprep ? password : (0, deps_1.saslprep)(password); + } + else { + try { + processedPassword = passwordDigest(username, password); + } + catch (e) { + return callback(e); + } + } + const payload = Buffer.isBuffer(response.payload) + ? new bson_1.Binary(response.payload) + : response.payload; + const dict = parsePayload(payload.value()); + const iterations = parseInt(dict.i, 10); + if (iterations && iterations < 4096) { + callback( + // TODO(NODE-3483) + new error_1.MongoRuntimeError(`Server returned an invalid iteration count ${iterations}`), false); + return; + } + const salt = dict.s; + const rnonce = dict.r; + if (rnonce.startsWith('nonce')) { + // TODO(NODE-3483) + callback(new error_1.MongoRuntimeError(`Server returned an invalid nonce: ${rnonce}`), false); + return; + } + // Set up start of proof + const withoutProof = `c=biws,r=${rnonce}`; + const saltedPassword = HI(processedPassword, Buffer.from(salt, 'base64'), iterations, cryptoMethod); + const clientKey = HMAC(cryptoMethod, saltedPassword, 'Client Key'); + const serverKey = HMAC(cryptoMethod, saltedPassword, 'Server Key'); + const storedKey = H(cryptoMethod, clientKey); + const authMessage = [clientFirstMessageBare(username, nonce), payload.value(), withoutProof].join(','); + const clientSignature = HMAC(cryptoMethod, storedKey, authMessage); + const clientProof = `p=${xor(clientKey, clientSignature)}`; + const clientFinal = [withoutProof, clientProof].join(','); + const serverSignature = HMAC(cryptoMethod, serverKey, authMessage); + const saslContinueCmd = { + saslContinue: 1, + conversationId: response.conversationId, + payload: new bson_1.Binary(Buffer.from(clientFinal)) + }; + connection.command((0, utils_1.ns)(`${db}.$cmd`), saslContinueCmd, undefined, (_err, r) => { + const err = resolveError(_err, r); + if (err) { + return callback(err); + } + const parsedResponse = parsePayload(r.payload.value()); + if (!compareDigest(Buffer.from(parsedResponse.v, 'base64'), serverSignature)) { + callback(new error_1.MongoRuntimeError('Server returned an invalid signature')); + return; + } + if (!r || r.done !== false) { + return callback(err, r); + } + const retrySaslContinueCmd = { + saslContinue: 1, + conversationId: r.conversationId, + payload: Buffer.alloc(0) + }; + connection.command((0, utils_1.ns)(`${db}.$cmd`), retrySaslContinueCmd, undefined, callback); + }); +} +function parsePayload(payload) { + const dict = {}; + const parts = payload.split(','); + for (let i = 0; i < parts.length; i++) { + const valueParts = parts[i].split('='); + dict[valueParts[0]] = valueParts[1]; + } + return dict; +} +function passwordDigest(username, password) { + if (typeof username !== 'string') { + throw new error_1.MongoInvalidArgumentError('Username must be a string'); + } + if (typeof password !== 'string') { + throw new error_1.MongoInvalidArgumentError('Password must be a string'); + } + if (password.length === 0) { + throw new error_1.MongoInvalidArgumentError('Password cannot be empty'); + } + let md5; + try { + md5 = crypto.createHash('md5'); + } + catch (err) { + if (crypto.getFips()) { + // This error is (slightly) more helpful than what comes from OpenSSL directly, e.g. + // 'Error: error:060800C8:digital envelope routines:EVP_DigestInit_ex:disabled for FIPS' + throw new Error('Auth mechanism SCRAM-SHA-1 is not supported in FIPS mode'); + } + throw err; + } + md5.update(`${username}:mongo:${password}`, 'utf8'); + return md5.digest('hex'); +} +// XOR two buffers +function xor(a, b) { + if (!Buffer.isBuffer(a)) { + a = Buffer.from(a); + } + if (!Buffer.isBuffer(b)) { + b = Buffer.from(b); + } + const length = Math.max(a.length, b.length); + const res = []; + for (let i = 0; i < length; i += 1) { + res.push(a[i] ^ b[i]); + } + return Buffer.from(res).toString('base64'); +} +function H(method, text) { + return crypto.createHash(method).update(text).digest(); +} +function HMAC(method, key, text) { + return crypto.createHmac(method, key).update(text).digest(); +} +let _hiCache = {}; +let _hiCacheCount = 0; +function _hiCachePurge() { + _hiCache = {}; + _hiCacheCount = 0; +} +const hiLengthMap = { + sha256: 32, + sha1: 20 +}; +function HI(data, salt, iterations, cryptoMethod) { + // omit the work if already generated + const key = [data, salt.toString('base64'), iterations].join('_'); + if (_hiCache[key] != null) { + return _hiCache[key]; + } + // generate the salt + const saltedData = crypto.pbkdf2Sync(data, salt, iterations, hiLengthMap[cryptoMethod], cryptoMethod); + // cache a copy to speed up the next lookup, but prevent unbounded cache growth + if (_hiCacheCount >= 200) { + _hiCachePurge(); + } + _hiCache[key] = saltedData; + _hiCacheCount += 1; + return saltedData; +} +function compareDigest(lhs, rhs) { + if (lhs.length !== rhs.length) { + return false; + } + if (typeof crypto.timingSafeEqual === 'function') { + return crypto.timingSafeEqual(lhs, rhs); + } + let result = 0; + for (let i = 0; i < lhs.length; i++) { + result |= lhs[i] ^ rhs[i]; + } + return result === 0; +} +function resolveError(err, result) { + if (err) + return err; + if (result) { + if (result.$err || result.errmsg) + return new error_1.MongoServerError(result); + } + return; +} +class ScramSHA1 extends ScramSHA { + constructor() { + super('sha1'); + } +} +exports.ScramSHA1 = ScramSHA1; +class ScramSHA256 extends ScramSHA { + constructor() { + super('sha256'); + } +} +exports.ScramSHA256 = ScramSHA256; +//# sourceMappingURL=scram.js.map \ No newline at end of file diff --git a/node_modules/mongodb/lib/cmap/auth/scram.js.map b/node_modules/mongodb/lib/cmap/auth/scram.js.map new file mode 100644 index 000000000..c94940db2 --- /dev/null +++ b/node_modules/mongodb/lib/cmap/auth/scram.js.map @@ -0,0 +1 @@ +{"version":3,"file":"scram.js","sourceRoot":"","sources":["../../../src/cmap/auth/scram.ts"],"names":[],"mappings":";;;AAAA,iCAAiC;AAEjC,qCAA8C;AAC9C,qCAAsC;AACtC,uCAMqB;AACrB,uCAAwD;AAExD,mDAA4D;AAE5D,2CAA4C;AAI5C,MAAM,QAAS,SAAQ,4BAAY;IAEjC,YAAY,YAA0B;QACpC,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,YAAY,GAAG,YAAY,IAAI,MAAM,CAAC;IAC7C,CAAC;IAEQ,OAAO,CAAC,YAA+B,EAAE,WAAwB,EAAE,QAAkB;QAC5F,MAAM,YAAY,GAAG,IAAI,CAAC,YAAY,CAAC;QACvC,MAAM,WAAW,GAAG,WAAW,CAAC,WAAW,CAAC;QAC5C,IAAI,CAAC,WAAW,EAAE;YAChB,OAAO,QAAQ,CAAC,IAAI,oCAA4B,CAAC,uCAAuC,CAAC,CAAC,CAAC;SAC5F;QACD,IAAI,YAAY,KAAK,QAAQ,IAAI,eAAQ,IAAI,IAAI,EAAE;YACjD,IAAA,mBAAW,EAAC,yEAAyE,CAAC,CAAC;SACxF;QAED,MAAM,CAAC,WAAW,CAAC,EAAE,EAAE,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE;YACpC,IAAI,GAAG,EAAE;gBACP,OAAO,QAAQ,CAAC,GAAG,CAAC,CAAC;aACtB;YAED,gCAAgC;YAChC,MAAM,CAAC,MAAM,CAAC,WAAW,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC;YAEtC,MAAM,OAAO,GAAG,MAAM,CAAC,MAA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K,CAAC;KACd;IAED,IAAI,OAAO,MAAM,CAAC,eAAe,KAAK,UAAU,EAAE;QAChD,OAAO,MAAM,CAAC,eAAe,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;KACzC;IAED,IAAI,MAAM,GAAG,CAAC,CAAC;IACf,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QACnC,MAAM,IAAI,GAAG,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC;KAC3B;IAED,OAAO,MAAM,KAAK,CAAC,CAAC;AACtB,CAAC;AAED,SAAS,YAAY,CAAC,GAAc,EAAE,MAAiB;IACrD,IAAI,GAAG;QAAE,OAAO,GAAG,CAAC;IACpB,IAAI,MAAM,EAAE;QACV,IAAI,MAAM,CAAC,IAAI,IAAI,MAAM,CAAC,MAAM;YAAE,OAAO,IAAI,wBAAgB,CAAC,MAAM,CAAC,CAAC;KACvE;IACD,OAAO;AACT,CAAC;AAED,MAAa,SAAU,SAAQ,QAAQ;IACrC;QACE,KAAK,CAAC,MAAM,CAAC,CAAC;IAChB,CAAC;CACF;AAJD,8BAIC;AAED,MAAa,WAAY,SAAQ,QAAQ;IACvC;QACE,KAAK,CAAC,QAAQ,CAAC,CAAC;IAClB,CAAC;CACF;AAJD,kCAIC"} \ No newline at end of file diff --git a/node_modules/mongodb/lib/cmap/auth/x509.js b/node_modules/mongodb/lib/cmap/auth/x509.js new file mode 100644 index 000000000..02fe38539 --- /dev/null +++ b/node_modules/mongodb/lib/cmap/auth/x509.js @@ -0,0 +1,39 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.X509 = void 0; +const error_1 = require("../../error"); +const utils_1 = require("../../utils"); +const auth_provider_1 = require("./auth_provider"); +class X509 extends auth_provider_1.AuthProvider { + prepare(handshakeDoc, authContext, callback) { + const { credentials } = authContext; + if (!credentials) { + return callback(new error_1.MongoMissingCredentialsError('AuthContext must provide credentials.')); + } + Object.assign(handshakeDoc, { + speculativeAuthenticate: x509AuthenticateCommand(credentials) + }); + callback(undefined, handshakeDoc); + } + auth(authContext, callback) { + const connection = authContext.connection; + const credentials = authContext.credentials; + if (!credentials) { + return callback(new error_1.MongoMissingCredentialsError('AuthContext must provide credentials.')); + } + const response = authContext.response; + if (response && response.speculativeAuthenticate) { + return callback(); + } + connection.command((0, utils_1.ns)('$external.$cmd'), x509AuthenticateCommand(credentials), undefined, callback); + } +} +exports.X509 = X509; +function x509AuthenticateCommand(credentials) { + const command = { authenticate: 1, mechanism: 'MONGODB-X509' }; + if (credentials.username) { + command.user = credentials.username; + } + return command; +} +//# sourceMappingURL=x509.js.map \ No newline at end of file diff --git a/node_modules/mongodb/lib/cmap/auth/x509.js.map b/node_modules/mongodb/lib/cmap/auth/x509.js.map new file mode 100644 index 000000000..84af5792f --- /dev/null +++ b/node_modules/mongodb/lib/cmap/auth/x509.js.map @@ -0,0 +1 @@ +{"version":3,"file":"x509.js","sourceRoot":"","sources":["../../../src/cmap/auth/x509.ts"],"names":[],"mappings":";;;AACA,uCAA2D;AAC3D,uCAA2C;AAE3C,mDAA4D;AAG5D,MAAa,IAAK,SAAQ,4BAAY;IAC3B,OAAO,CACd,YAA+B,EAC/B,WAAwB,EACxB,QAAkB;QAElB,MAAM,EAAE,WAAW,EAAE,GAAG,WAAW,CAAC;QACpC,IAAI,CAAC,WAAW,EAAE;YAChB,OAAO,QAAQ,CAAC,IAAI,oCAA4B,CAAC,uCAAuC,CAAC,CAAC,CAAC;SAC5F;QACD,MAAM,CAAC,MAAM,CAAC,YAAY,EAAE;YAC1B,uBAAuB,EAAE,uBAAuB,CAAC,WAAW,CAAC;SAC9D,CAAC,CAAC;QAEH,QAAQ,CAAC,SAAS,EAAE,YAAY,CAAC,CAAC;IACpC,CAAC;IAEQ,IAAI,CAAC,WAAwB,EAAE,QAAkB;QACxD,MAAM,UAAU,GAAG,WAAW,CAAC,UAAU,CAAC;QAC1C,MAAM,WAAW,GAAG,WAAW,CAAC,WAAW,CAAC;QAC5C,IAAI,CAAC,WAAW,EAAE;YAChB,OAAO,QAAQ,CAAC,IAAI,oCAA4B,CAAC,uCAAuC,CAAC,CAAC,CAAC;SAC5F;QACD,MAAM,QAAQ,GAAG,WAAW,CAAC,QAAQ,CAAC;QAEtC,IAAI,QAAQ,IAAI,QAAQ,CAAC,uBAAuB,EAAE;YAChD,OAAO,QAAQ,EAAE,CAAC;SACnB;QAED,UAAU,CAAC,OAAO,CAChB,IAAA,UAAE,EAAC,gBAAgB,CAAC,EACpB,uBAAuB,CAAC,WAAW,CAAC,EACpC,SAAS,EACT,QAAQ,CACT,CAAC;IACJ,CAAC;CACF;AApCD,oBAoCC;AAED,SAAS,uBAAuB,CAAC,WAA6B;IAC5D,MAAM,OAAO,GAAa,EAAE,YAAY,EAAE,CAAC,EAAE,SAAS,EAAE,cAAc,EAAE,CAAC;IACzE,IAAI,WAAW,CAAC,QAAQ,EAAE;QACxB,OAAO,CAAC,IAAI,GAAG,WAAW,CAAC,QAAQ,CAAC;KACrC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC"} \ No newline at end of file diff --git a/node_modules/mongodb/lib/cmap/command_monitoring_events.js b/node_modules/mongodb/lib/cmap/command_monitoring_events.js new file mode 100644 index 000000000..6cfaa31a6 --- /dev/null +++ b/node_modules/mongodb/lib/cmap/command_monitoring_events.js @@ -0,0 +1,273 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.CommandFailedEvent = exports.CommandSucceededEvent = exports.CommandStartedEvent = void 0; +const constants_1 = require("../constants"); +const utils_1 = require("../utils"); +const commands_1 = require("./commands"); +/** + * An event indicating the start of a given + * @public + * @category Event + */ +class CommandStartedEvent { + /** + * Create a started event + * + * @internal + * @param pool - the pool that originated the command + * @param command - the command + */ + constructor(connection, command) { + const cmd = extractCommand(command); + const commandName = extractCommandName(cmd); + const { address, connectionId, serviceId } = extractConnectionDetails(connection); + // TODO: remove in major revision, this is not spec behavior + if (SENSITIVE_COMMANDS.has(commandName)) { + this.commandObj = {}; + this.commandObj[commandName] = true; + } + this.address = address; + this.connectionId = connectionId; + this.serviceId = serviceId; + this.requestId = command.requestId; + this.databaseName = databaseName(command); + this.commandName = commandName; + this.command = maybeRedact(commandName, cmd, cmd); + } + /* @internal */ + get hasServiceId() { + return !!this.serviceId; + } +} +exports.CommandStartedEvent = CommandStartedEvent; +/** + * An event indicating the success of a given command + * @public + * @category Event + */ +class CommandSucceededEvent { + /** + * Create a succeeded event + * + * @internal + * @param pool - the pool that originated the command + * @param command - the command + * @param reply - the reply for this command from the server + * @param started - a high resolution tuple timestamp of when the command was first sent, to calculate duration + */ + constructor(connection, command, reply, started) { + const cmd = extractCommand(command); + const commandName = extractCommandName(cmd); + const { address, connectionId, serviceId } = extractConnectionDetails(connection); + this.address = address; + this.connectionId = connectionId; + this.serviceId = serviceId; + this.requestId = command.requestId; + this.commandName = commandName; + this.duration = (0, utils_1.calculateDurationInMs)(started); + this.reply = maybeRedact(commandName, cmd, extractReply(command, reply)); + } + /* @internal */ + get hasServiceId() { + return !!this.serviceId; + } +} +exports.CommandSucceededEvent = CommandSucceededEvent; +/** + * An event indicating the failure of a given command + * @public + * @category Event + */ +class CommandFailedEvent { + /** + * Create a failure event + * + * @internal + * @param pool - the pool that originated the command + * @param command - the command + * @param error - the generated error or a server error response + * @param started - a high resolution tuple timestamp of when the command was first sent, to calculate duration + */ + constructor(connection, command, error, started) { + const cmd = extractCommand(command); + const commandName = extractCommandName(cmd); + const { address, connectionId, serviceId } = extractConnectionDetails(connection); + this.address = address; + this.connectionId = connectionId; + this.serviceId = serviceId; + this.requestId = command.requestId; + this.commandName = commandName; + this.duration = (0, utils_1.calculateDurationInMs)(started); + this.failure = maybeRedact(commandName, cmd, error); + } + /* @internal */ + get hasServiceId() { + return !!this.serviceId; + } +} +exports.CommandFailedEvent = CommandFailedEvent; +/** Commands that we want to redact because of the sensitive nature of their contents */ +const SENSITIVE_COMMANDS = new Set([ + 'authenticate', + 'saslStart', + 'saslContinue', + 'getnonce', + 'createUser', + 'updateUser', + 'copydbgetnonce', + 'copydbsaslstart', + 'copydb' +]); +const HELLO_COMMANDS = new Set(['hello', constants_1.LEGACY_HELLO_COMMAND, constants_1.LEGACY_HELLO_COMMAND_CAMEL_CASE]); +// helper methods +const extractCommandName = (commandDoc) => Object.keys(commandDoc)[0]; +const namespace = (command) => command.ns; +const databaseName = (command) => command.ns.split('.')[0]; +const collectionName = (command) => command.ns.split('.')[1]; +const maybeRedact = (commandName, commandDoc, result) => SENSITIVE_COMMANDS.has(commandName) || + (HELLO_COMMANDS.has(commandName) && commandDoc.speculativeAuthenticate) + ? {} + : result; +const LEGACY_FIND_QUERY_MAP = { + $query: 'filter', + $orderby: 'sort', + $hint: 'hint', + $comment: 'comment', + $maxScan: 'maxScan', + $max: 'max', + $min: 'min', + $returnKey: 'returnKey', + $showDiskLoc: 'showRecordId', + $maxTimeMS: 'maxTimeMS', + $snapshot: 'snapshot' +}; +const LEGACY_FIND_OPTIONS_MAP = { + numberToSkip: 'skip', + numberToReturn: 'batchSize', + returnFieldSelector: 'projection' +}; +const OP_QUERY_KEYS = [ + 'tailable', + 'oplogReplay', + 'noCursorTimeout', + 'awaitData', + 'partial', + 'exhaust' +]; +/** Extract the actual command from the query, possibly up-converting if it's a legacy format */ +function extractCommand(command) { + var _a; + if (command instanceof commands_1.GetMore) { + return { + getMore: (0, utils_1.deepCopy)(command.cursorId), + collection: collectionName(command), + batchSize: command.numberToReturn + }; + } + if (command instanceof commands_1.KillCursor) { + return { + killCursors: collectionName(command), + cursors: (0, utils_1.deepCopy)(command.cursorIds) + }; + } + if (command instanceof commands_1.Msg) { + return (0, utils_1.deepCopy)(command.command); + } + if ((_a = command.query) === null || _a === void 0 ? void 0 : _a.$query) { + let result; + if (command.ns === 'admin.$cmd') { + // up-convert legacy command + result = Object.assign({}, command.query.$query); + } + else { + // up-convert legacy find command + result = { find: collectionName(command) }; + Object.keys(LEGACY_FIND_QUERY_MAP).forEach(key => { + if (command.query[key] != null) { + result[LEGACY_FIND_QUERY_MAP[key]] = (0, utils_1.deepCopy)(command.query[key]); + } + }); + } + Object.keys(LEGACY_FIND_OPTIONS_MAP).forEach(key => { + const legacyKey = key; + if (command[legacyKey] != null) { + result[LEGACY_FIND_OPTIONS_MAP[legacyKey]] = (0, utils_1.deepCopy)(command[legacyKey]); + } + }); + OP_QUERY_KEYS.forEach(key => { + const opKey = key; + if (command[opKey]) { + result[opKey] = command[opKey]; + } + }); + if (command.pre32Limit != null) { + result.limit = command.pre32Limit; + } + if (command.query.$explain) { + return { explain: result }; + } + return result; + } + const clonedQuery = {}; + const clonedCommand = {}; + if (command.query) { + for (const k in command.query) { + clonedQuery[k] = (0, utils_1.deepCopy)(command.query[k]); + } + clonedCommand.query = clonedQuery; + } + for (const k in command) { + if (k === 'query') + continue; + clonedCommand[k] = (0, utils_1.deepCopy)(command[k]); + } + return command.query ? clonedQuery : clonedCommand; +} +function extractReply(command, reply) { + if (command instanceof commands_1.KillCursor) { + return { + ok: 1, + cursorsUnknown: command.cursorIds + }; + } + if (!reply) { + return reply; + } + if (command instanceof commands_1.GetMore) { + return { + ok: 1, + cursor: { + id: (0, utils_1.deepCopy)(reply.cursorId), + ns: namespace(command), + nextBatch: (0, utils_1.deepCopy)(reply.documents) + } + }; + } + if (command instanceof commands_1.Msg) { + return (0, utils_1.deepCopy)(reply.result ? reply.result : reply); + } + // is this a legacy find command? + if (command.query && command.query.$query != null) { + return { + ok: 1, + cursor: { + id: (0, utils_1.deepCopy)(reply.cursorId), + ns: namespace(command), + firstBatch: (0, utils_1.deepCopy)(reply.documents) + } + }; + } + return (0, utils_1.deepCopy)(reply.result ? reply.result : reply); +} +function extractConnectionDetails(connection) { + let connectionId; + if ('id' in connection) { + connectionId = connection.id; + } + return { + address: connection.address, + serviceId: connection.serviceId, + connectionId + }; +} +//# sourceMappingURL=command_monitoring_events.js.map \ No newline at end of file diff --git a/node_modules/mongodb/lib/cmap/command_monitoring_events.js.map b/node_modules/mongodb/lib/cmap/command_monitoring_events.js.map new file mode 100644 index 000000000..2c53ca4de --- /dev/null +++ b/node_modules/mongodb/lib/cmap/command_monitoring_events.js.map @@ -0,0 +1 @@ +{"version":3,"file":"command_monitoring_events.js","sourceRoot":"","sources":["../../src/cmap/command_monitoring_events.ts"],"names":[],"mappings":";;;AACA,4CAAqF;AACrF,oCAA2D;AAC3D,yCAAgF;AAGhF;;;;GAIG;AACH,MAAa,mBAAmB;IAU9B;;;;;;OAMG;IACH,YAAY,UAAsB,EAAE,OAAiC;QACnE,MAAM,GAAG,GAAG,cAAc,CAAC,OAAO,CAAC,CAAC;QACpC,MAAM,WAAW,GAAG,kBAAkB,CAAC,GAAG,CAAC,CAAC;QAC5C,MAAM,EAAE,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,GAAG,wBAAwB,CAAC,UAAU,CAAC,CAAC;QAElF,4DAA4D;QAC5D,IAAI,kBAAkB,CAAC,GAAG,CAAC,WAAW,CAAC,EAAE;YACvC,IAAI,CAAC,UAAU,GAAG,EAAE,CAAC;YACrB,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC,GAAG,IAAI,CAAC;SACrC;QAED,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;QACjC,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,SAAS,GAAG,OAAO,CAAC,SAAS,CAAC;QACnC,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC,OAAO,CAAC,CAAC;QAC1C,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;QAC/B,IAAI,CAAC,OAAO,GAAG,WAAW,CAAC,WAAW,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;IACpD,CAAC;IAED,eAAe;IACf,IAAI,YAAY;QACd,OAAO,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC;IAC1B,CAAC;CACF;AAzC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5B,EAAE,EAAE,SAAS,CAAC,OAAO,CAAC;gBACtB,SAAS,EAAE,IAAA,gBAAQ,EAAC,KAAK,CAAC,SAAS,CAAC;aACrC;SACF,CAAC;KACH;IAED,IAAI,OAAO,YAAY,cAAG,EAAE;QAC1B,OAAO,IAAA,gBAAQ,EAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;KACtD;IAED,iCAAiC;IACjC,IAAI,OAAO,CAAC,KAAK,IAAI,OAAO,CAAC,KAAK,CAAC,MAAM,IAAI,IAAI,EAAE;QACjD,OAAO;YACL,EAAE,EAAE,CAAC;YACL,MAAM,EAAE;gBACN,EAAE,EAAE,IAAA,gBAAQ,EAAC,KAAK,CAAC,QAAQ,CAAC;gBAC5B,EAAE,EAAE,SAAS,CAAC,OAAO,CAAC;gBACtB,UAAU,EAAE,IAAA,gBAAQ,EAAC,KAAK,CAAC,SAAS,CAAC;aACtC;SACF,CAAC;KACH;IAED,OAAO,IAAA,gBAAQ,EAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;AACvD,CAAC;AAED,SAAS,wBAAwB,CAAC,UAAsB;IACtD,IAAI,YAAY,CAAC;IACjB,IAAI,IAAI,IAAI,UAAU,EAAE;QACtB,YAAY,GAAG,UAAU,CAAC,EAAE,CAAC;KAC9B;IACD,OAAO;QACL,OAAO,EAAE,UAAU,CAAC,OAAO;QAC3B,SAAS,EAAE,UAAU,CAAC,SAAS;QAC/B,YAAY;KACb,CAAC;AACJ,CAAC"} \ No newline at end of file diff --git a/node_modules/mongodb/lib/cmap/commands.js b/node_modules/mongodb/lib/cmap/commands.js new file mode 100644 index 000000000..415a4b6f1 --- /dev/null +++ b/node_modules/mongodb/lib/cmap/commands.js @@ -0,0 +1,633 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.BinMsg = exports.Msg = exports.Response = exports.KillCursor = exports.GetMore = exports.Query = void 0; +const BSON = require("../bson"); +const error_1 = require("../error"); +const read_preference_1 = require("../read_preference"); +const utils_1 = require("../utils"); +const constants_1 = require("./wire_protocol/constants"); +// Incrementing request id +let _requestId = 0; +// Query flags +const OPTS_TAILABLE_CURSOR = 2; +const OPTS_SECONDARY = 4; +const OPTS_OPLOG_REPLAY = 8; +const OPTS_NO_CURSOR_TIMEOUT = 16; +const OPTS_AWAIT_DATA = 32; +const OPTS_EXHAUST = 64; +const OPTS_PARTIAL = 128; +// Response flags +const CURSOR_NOT_FOUND = 1; +const QUERY_FAILURE = 2; +const SHARD_CONFIG_STALE = 4; +const AWAIT_CAPABLE = 8; +/************************************************************** + * QUERY + **************************************************************/ +/** @internal */ +class Query { + constructor(ns, query, options) { + // Basic options needed to be passed in + // TODO(NODE-3483): Replace with MongoCommandError + if (ns == null) + throw new error_1.MongoRuntimeError('Namespace must be specified for query'); + // TODO(NODE-3483): Replace with MongoCommandError + if (query == null) + throw new error_1.MongoRuntimeError('A query document must be specified for query'); + // Validate that we are not passing 0x00 in the collection name + if (ns.indexOf('\x00') !== -1) { + // TODO(NODE-3483): Use MongoNamespace static method + throw new error_1.MongoRuntimeError('Namespace cannot contain a null character'); + } + // Basic options + this.ns = ns; + this.query = query; + // Additional options + this.numberToSkip = options.numberToSkip || 0; + this.numberToReturn = options.numberToReturn || 0; + this.returnFieldSelector = options.returnFieldSelector || undefined; + this.requestId = Query.getRequestId(); + // special case for pre-3.2 find commands, delete ASAP + this.pre32Limit = options.pre32Limit; + // Serialization option + this.serializeFunctions = + typeof options.serializeFunctions === 'boolean' ? options.serializeFunctions : false; + this.ignoreUndefined = + typeof options.ignoreUndefined === 'boolean' ? options.ignoreUndefined : false; + this.maxBsonSize = options.maxBsonSize || 1024 * 1024 * 16; + this.checkKeys = typeof options.checkKeys === 'boolean' ? options.checkKeys : false; + this.batchSize = this.numberToReturn; + // Flags + this.tailable = false; + this.secondaryOk = typeof options.secondaryOk === 'boolean' ? options.secondaryOk : false; + this.oplogReplay = false; + this.noCursorTimeout = false; + this.awaitData = false; + this.exhaust = false; + this.partial = false; + } + /** Assign next request Id. */ + incRequestId() { + this.requestId = _requestId++; + } + /** Peek next request Id. */ + nextRequestId() { + return _requestId + 1; + } + /** Increment then return next request Id. */ + static getRequestId() { + return ++_requestId; + } + // Uses a single allocated buffer for the process, avoiding multiple memory allocations + toBin() { + const buffers = []; + let projection = null; + // Set up the flags + let flags = 0; + if (this.tailable) { + flags |= OPTS_TAILABLE_CURSOR; + } + if (this.secondaryOk) { + flags |= OPTS_SECONDARY; + } + if (this.oplogReplay) { + flags |= OPTS_OPLOG_REPLAY; + } + if (this.noCursorTimeout) { + flags |= OPTS_NO_CURSOR_TIMEOUT; + } + if (this.awaitData) { + flags |= OPTS_AWAIT_DATA; + } + if (this.exhaust) { + flags |= OPTS_EXHAUST; + } + if (this.partial) { + flags |= OPTS_PARTIAL; + } + // If batchSize is different to this.numberToReturn + if (this.batchSize !== this.numberToReturn) + this.numberToReturn = this.batchSize; + // Allocate write protocol header buffer + const header = Buffer.alloc(4 * 4 + // Header + 4 + // Flags + Buffer.byteLength(this.ns) + + 1 + // namespace + 4 + // numberToSkip + 4 // numberToReturn + ); + // Add header to buffers + buffers.push(header); + // Serialize the query + const query = BSON.serialize(this.query, { + checkKeys: this.checkKeys, + serializeFunctions: this.serializeFunctions, + ignoreUndefined: this.ignoreUndefined + }); + // Add query document + buffers.push(query); + if (this.returnFieldSelector && Object.keys(this.returnFieldSelector).length > 0) { + // Serialize the projection document + projection = BSON.serialize(this.returnFieldSelector, { + checkKeys: this.checkKeys, + serializeFunctions: this.serializeFunctions, + ignoreUndefined: this.ignoreUndefined + }); + // Add projection document + buffers.push(projection); + } + // Total message size + const totalLength = header.length + query.length + (projection ? projection.length : 0); + // Set up the index + let index = 4; + // Write total document length + header[3] = (totalLength >> 24) & 0xff; + header[2] = (totalLength >> 16) & 0xff; + header[1] = (totalLength >> 8) & 0xff; + header[0] = totalLength & 0xff; + // Write header information requestId + header[index + 3] = (this.requestId >> 24) & 0xff; + header[index + 2] = (this.requestId >> 16) & 0xff; + header[index + 1] = (this.requestId >> 8) & 0xff; + header[index] = this.requestId & 0xff; + index = index + 4; + // Write header information responseTo + header[index + 3] = (0 >> 24) & 0xff; + header[index + 2] = (0 >> 16) & 0xff; + header[index + 1] = (0 >> 8) & 0xff; + header[index] = 0 & 0xff; + index = index + 4; + // Write header information OP_QUERY + header[index + 3] = (constants_1.OP_QUERY >> 24) & 0xff; + header[index + 2] = (constants_1.OP_QUERY >> 16) & 0xff; + header[index + 1] = (constants_1.OP_QUERY >> 8) & 0xff; + header[index] = constants_1.OP_QUERY & 0xff; + index = index + 4; + // Write header information flags + header[index + 3] = (flags >> 24) & 0xff; + header[index + 2] = (flags >> 16) & 0xff; + header[index + 1] = (flags >> 8) & 0xff; + header[index] = flags & 0xff; + index = index + 4; + // Write collection name + index = index + header.write(this.ns, index, 'utf8') + 1; + header[index - 1] = 0; + // Write header information flags numberToSkip + header[index + 3] = (this.numberToSkip >> 24) & 0xff; + header[index + 2] = (this.numberToSkip >> 16) & 0xff; + header[index + 1] = (this.numberToSkip >> 8) & 0xff; + header[index] = this.numberToSkip & 0xff; + index = index + 4; + // Write header information flags numberToReturn + header[index + 3] = (this.numberToReturn >> 24) & 0xff; + header[index + 2] = (this.numberToReturn >> 16) & 0xff; + header[index + 1] = (this.numberToReturn >> 8) & 0xff; + header[index] = this.numberToReturn & 0xff; + index = index + 4; + // Return the buffers + return buffers; + } +} +exports.Query = Query; +/************************************************************** + * GETMORE + **************************************************************/ +/** @internal */ +class GetMore { + constructor(ns, cursorId, opts = {}) { + this.numberToReturn = opts.numberToReturn || 0; + this.requestId = _requestId++; + this.ns = ns; + this.cursorId = cursorId; + } + // Uses a single allocated buffer for the process, avoiding multiple memory allocations + toBin() { + const length = 4 + Buffer.byteLength(this.ns) + 1 + 4 + 8 + 4 * 4; + // Create command buffer + let index = 0; + // Allocate buffer + const _buffer = Buffer.alloc(length); + // Write header information + // index = write32bit(index, _buffer, length); + _buffer[index + 3] = (length >> 24) & 0xff; + _buffer[index + 2] = (length >> 16) & 0xff; + _buffer[index + 1] = (length >> 8) & 0xff; + _buffer[index] = length & 0xff; + index = index + 4; + // index = write32bit(index, _buffer, requestId); + _buffer[index + 3] = (this.requestId >> 24) & 0xff; + _buffer[index + 2] = (this.requestId >> 16) & 0xff; + _buffer[index + 1] = (this.requestId >> 8) & 0xff; + _buffer[index] = this.requestId & 0xff; + index = index + 4; + // index = write32bit(index, _buffer, 0); + _buffer[index + 3] = (0 >> 24) & 0xff; + _buffer[index + 2] = (0 >> 16) & 0xff; + _buffer[index + 1] = (0 >> 8) & 0xff; + _buffer[index] = 0 & 0xff; + index = index + 4; + // index = write32bit(index, _buffer, OP_GETMORE); + _buffer[index + 3] = (constants_1.OP_GETMORE >> 24) & 0xff; + _buffer[index + 2] = (constants_1.OP_GETMORE >> 16) & 0xff; + _buffer[index + 1] = (constants_1.OP_GETMORE >> 8) & 0xff; + _buffer[index] = constants_1.OP_GETMORE & 0xff; + index = index + 4; + // index = write32bit(index, _buffer, 0); + _buffer[index + 3] = (0 >> 24) & 0xff; + _buffer[index + 2] = (0 >> 16) & 0xff; + _buffer[index + 1] = (0 >> 8) & 0xff; + _buffer[index] = 0 & 0xff; + index = index + 4; + // Write collection name + index = index + _buffer.write(this.ns, index, 'utf8') + 1; + _buffer[index - 1] = 0; + // Write batch size + // index = write32bit(index, _buffer, numberToReturn); + _buffer[index + 3] = (this.numberToReturn >> 24) & 0xff; + _buffer[index + 2] = (this.numberToReturn >> 16) & 0xff; + _buffer[index + 1] = (this.numberToReturn >> 8) & 0xff; + _buffer[index] = this.numberToReturn & 0xff; + index = index + 4; + // Write cursor id + // index = write32bit(index, _buffer, cursorId.getLowBits()); + _buffer[index + 3] = (this.cursorId.getLowBits() >> 24) & 0xff; + _buffer[index + 2] = (this.cursorId.getLowBits() >> 16) & 0xff; + _buffer[index + 1] = (this.cursorId.getLowBits() >> 8) & 0xff; + _buffer[index] = this.cursorId.getLowBits() & 0xff; + index = index + 4; + // index = write32bit(index, _buffer, cursorId.getHighBits()); + _buffer[index + 3] = (this.cursorId.getHighBits() >> 24) & 0xff; + _buffer[index + 2] = (this.cursorId.getHighBits() >> 16) & 0xff; + _buffer[index + 1] = (this.cursorId.getHighBits() >> 8) & 0xff; + _buffer[index] = this.cursorId.getHighBits() & 0xff; + index = index + 4; + // Return buffer + return [_buffer]; + } +} +exports.GetMore = GetMore; +/************************************************************** + * KILLCURSOR + **************************************************************/ +/** @internal */ +class KillCursor { + constructor(ns, cursorIds) { + this.ns = ns; + this.requestId = _requestId++; + this.cursorIds = cursorIds; + } + // Uses a single allocated buffer for the process, avoiding multiple memory allocations + toBin() { + const length = 4 + 4 + 4 * 4 + this.cursorIds.length * 8; + // Create command buffer + let index = 0; + const _buffer = Buffer.alloc(length); + // Write header information + // index = write32bit(index, _buffer, length); + _buffer[index + 3] = (length >> 24) & 0xff; + _buffer[index + 2] = (length >> 16) & 0xff; + _buffer[index + 1] = (length >> 8) & 0xff; + _buffer[index] = length & 0xff; + index = index + 4; + // index = write32bit(index, _buffer, requestId); + _buffer[index + 3] = (this.requestId >> 24) & 0xff; + _buffer[index + 2] = (this.requestId >> 16) & 0xff; + _buffer[index + 1] = (this.requestId >> 8) & 0xff; + _buffer[index] = this.requestId & 0xff; + index = index + 4; + // index = write32bit(index, _buffer, 0); + _buffer[index + 3] = (0 >> 24) & 0xff; + _buffer[index + 2] = (0 >> 16) & 0xff; + _buffer[index + 1] = (0 >> 8) & 0xff; + _buffer[index] = 0 & 0xff; + index = index + 4; + // index = write32bit(index, _buffer, OP_KILL_CURSORS); + _buffer[index + 3] = (constants_1.OP_KILL_CURSORS >> 24) & 0xff; + _buffer[index + 2] = (constants_1.OP_KILL_CURSORS >> 16) & 0xff; + _buffer[index + 1] = (constants_1.OP_KILL_CURSORS >> 8) & 0xff; + _buffer[index] = constants_1.OP_KILL_CURSORS & 0xff; + index = index + 4; + // index = write32bit(index, _buffer, 0); + _buffer[index + 3] = (0 >> 24) & 0xff; + _buffer[index + 2] = (0 >> 16) & 0xff; + _buffer[index + 1] = (0 >> 8) & 0xff; + _buffer[index] = 0 & 0xff; + index = index + 4; + // Write batch size + // index = write32bit(index, _buffer, this.cursorIds.length); + _buffer[index + 3] = (this.cursorIds.length >> 24) & 0xff; + _buffer[index + 2] = (this.cursorIds.length >> 16) & 0xff; + _buffer[index + 1] = (this.cursorIds.length >> 8) & 0xff; + _buffer[index] = this.cursorIds.length & 0xff; + index = index + 4; + // Write all the cursor ids into the array + for (let i = 0; i < this.cursorIds.length; i++) { + // Write cursor id + // index = write32bit(index, _buffer, cursorIds[i].getLowBits()); + _buffer[index + 3] = (this.cursorIds[i].getLowBits() >> 24) & 0xff; + _buffer[index + 2] = (this.cursorIds[i].getLowBits() >> 16) & 0xff; + _buffer[index + 1] = (this.cursorIds[i].getLowBits() >> 8) & 0xff; + _buffer[index] = this.cursorIds[i].getLowBits() & 0xff; + index = index + 4; + // index = write32bit(index, _buffer, cursorIds[i].getHighBits()); + _buffer[index + 3] = (this.cursorIds[i].getHighBits() >> 24) & 0xff; + _buffer[index + 2] = (this.cursorIds[i].getHighBits() >> 16) & 0xff; + _buffer[index + 1] = (this.cursorIds[i].getHighBits() >> 8) & 0xff; + _buffer[index] = this.cursorIds[i].getHighBits() & 0xff; + index = index + 4; + } + // Return buffer + return [_buffer]; + } +} +exports.KillCursor = KillCursor; +/** @internal */ +class Response { + constructor(message, msgHeader, msgBody, opts) { + this.documents = new Array(0); + this.parsed = false; + this.raw = message; + this.data = msgBody; + this.opts = opts !== null && opts !== void 0 ? opts : { + promoteLongs: true, + promoteValues: true, + promoteBuffers: false, + bsonRegExp: false + }; + // Read the message header + this.length = msgHeader.length; + this.requestId = msgHeader.requestId; + this.responseTo = msgHeader.responseTo; + this.opCode = msgHeader.opCode; + this.fromCompressed = msgHeader.fromCompressed; + // Flag values + this.promoteLongs = typeof this.opts.promoteLongs === 'boolean' ? this.opts.promoteLongs : true; + this.promoteValues = + typeof this.opts.promoteValues === 'boolean' ? this.opts.promoteValues : true; + this.promoteBuffers = + typeof this.opts.promoteBuffers === 'boolean' ? this.opts.promoteBuffers : false; + this.bsonRegExp = typeof this.opts.bsonRegExp === 'boolean' ? this.opts.bsonRegExp : false; + } + isParsed() { + return this.parsed; + } + parse(options) { + var _a, _b, _c, _d; + // Don't parse again if not needed + if (this.parsed) + return; + options = options !== null && options !== void 0 ? options : {}; + // Allow the return of raw documents instead of parsing + const raw = options.raw || false; + const documentsReturnedIn = options.documentsReturnedIn || null; + const promoteLongs = (_a = options.promoteLongs) !== null && _a !== void 0 ? _a : this.opts.promoteLongs; + const promoteValues = (_b = options.promoteValues) !== null && _b !== void 0 ? _b : this.opts.promoteValues; + const promoteBuffers = (_c = options.promoteBuffers) !== null && _c !== void 0 ? _c : this.opts.promoteBuffers; + const bsonRegExp = (_d = options.bsonRegExp) !== null && _d !== void 0 ? _d : this.opts.bsonRegExp; + let bsonSize; + // Set up the options + const _options = { + promoteLongs, + promoteValues, + promoteBuffers, + bsonRegExp + }; + // Position within OP_REPLY at which documents start + // (See https://docs.mongodb.com/manual/reference/mongodb-wire-protocol/#wire-op-reply) + this.index = 20; + // Read the message body + this.responseFlags = this.data.readInt32LE(0); + this.cursorId = new BSON.Long(this.data.readInt32LE(4), this.data.readInt32LE(8)); + this.startingFrom = this.data.readInt32LE(12); + this.numberReturned = this.data.readInt32LE(16); + // Preallocate document array + this.documents = new Array(this.numberReturned); + this.cursorNotFound = (this.responseFlags & CURSOR_NOT_FOUND) !== 0; + this.queryFailure = (this.responseFlags & QUERY_FAILURE) !== 0; + this.shardConfigStale = (this.responseFlags & SHARD_CONFIG_STALE) !== 0; + this.awaitCapable = (this.responseFlags & AWAIT_CAPABLE) !== 0; + // Parse Body + for (let i = 0; i < this.numberReturned; i++) { + bsonSize = + this.data[this.index] | + (this.data[this.index + 1] << 8) | + (this.data[this.index + 2] << 16) | + (this.data[this.index + 3] << 24); + // If we have raw results specified slice the return document + if (raw) { + this.documents[i] = this.data.slice(this.index, this.index + bsonSize); + } + else { + this.documents[i] = BSON.deserialize(this.data.slice(this.index, this.index + bsonSize), _options); + } + // Adjust the index + this.index = this.index + bsonSize; + } + if (this.documents.length === 1 && documentsReturnedIn != null && raw) { + const fieldsAsRaw = {}; + fieldsAsRaw[documentsReturnedIn] = true; + _options.fieldsAsRaw = fieldsAsRaw; + const doc = BSON.deserialize(this.documents[0], _options); + this.documents = [doc]; + } + // Set parsed + this.parsed = true; + } +} +exports.Response = Response; +// Implementation of OP_MSG spec: +// https://github.com/mongodb/specifications/blob/master/source/message/OP_MSG.rst +// +// struct Section { +// uint8 payloadType; +// union payload { +// document document; // payloadType == 0 +// struct sequence { // payloadType == 1 +// int32 size; +// cstring identifier; +// document* documents; +// }; +// }; +// }; +// struct OP_MSG { +// struct MsgHeader { +// int32 messageLength; +// int32 requestID; +// int32 responseTo; +// int32 opCode = 2013; +// }; +// uint32 flagBits; +// Section+ sections; +// [uint32 checksum;] +// }; +// Msg Flags +const OPTS_CHECKSUM_PRESENT = 1; +const OPTS_MORE_TO_COME = 2; +const OPTS_EXHAUST_ALLOWED = 1 << 16; +/** @internal */ +class Msg { + constructor(ns, command, options) { + // Basic options needed to be passed in + if (command == null) + throw new error_1.MongoInvalidArgumentError('Query document must be specified for query'); + // Basic options + this.ns = ns; + this.command = command; + this.command.$db = (0, utils_1.databaseNamespace)(ns); + if (options.readPreference && options.readPreference.mode !== read_preference_1.ReadPreference.PRIMARY) { + this.command.$readPreference = options.readPreference.toJSON(); + } + // Ensure empty options + this.options = options !== null && options !== void 0 ? options : {}; + // Additional options + this.requestId = options.requestId ? options.requestId : Msg.getRequestId(); + // Serialization option + this.serializeFunctions = + typeof options.serializeFunctions === 'boolean' ? options.serializeFunctions : false; + this.ignoreUndefined = + typeof options.ignoreUndefined === 'boolean' ? options.ignoreUndefined : false; + this.checkKeys = typeof options.checkKeys === 'boolean' ? options.checkKeys : false; + this.maxBsonSize = options.maxBsonSize || 1024 * 1024 * 16; + // flags + this.checksumPresent = false; + this.moreToCome = options.moreToCome || false; + this.exhaustAllowed = + typeof options.exhaustAllowed === 'boolean' ? options.exhaustAllowed : false; + } + toBin() { + const buffers = []; + let flags = 0; + if (this.checksumPresent) { + flags |= OPTS_CHECKSUM_PRESENT; + } + if (this.moreToCome) { + flags |= OPTS_MORE_TO_COME; + } + if (this.exhaustAllowed) { + flags |= OPTS_EXHAUST_ALLOWED; + } + const header = Buffer.alloc(4 * 4 + // Header + 4 // Flags + ); + buffers.push(header); + let totalLength = header.length; + const command = this.command; + totalLength += this.makeDocumentSegment(buffers, command); + header.writeInt32LE(totalLength, 0); // messageLength + header.writeInt32LE(this.requestId, 4); // requestID + header.writeInt32LE(0, 8); // responseTo + header.writeInt32LE(constants_1.OP_MSG, 12); // opCode + header.writeUInt32LE(flags, 16); // flags + return buffers; + } + makeDocumentSegment(buffers, document) { + const payloadTypeBuffer = Buffer.alloc(1); + payloadTypeBuffer[0] = 0; + const documentBuffer = this.serializeBson(document); + buffers.push(payloadTypeBuffer); + buffers.push(documentBuffer); + return payloadTypeBuffer.length + documentBuffer.length; + } + serializeBson(document) { + return BSON.serialize(document, { + checkKeys: this.checkKeys, + serializeFunctions: this.serializeFunctions, + ignoreUndefined: this.ignoreUndefined + }); + } + static getRequestId() { + _requestId = (_requestId + 1) & 0x7fffffff; + return _requestId; + } +} +exports.Msg = Msg; +/** @internal */ +class BinMsg { + constructor(message, msgHeader, msgBody, opts) { + this.parsed = false; + this.raw = message; + this.data = msgBody; + this.opts = opts !== null && opts !== void 0 ? opts : { + promoteLongs: true, + promoteValues: true, + promoteBuffers: false, + bsonRegExp: false + }; + // Read the message header + this.length = msgHeader.length; + this.requestId = msgHeader.requestId; + this.responseTo = msgHeader.responseTo; + this.opCode = msgHeader.opCode; + this.fromCompressed = msgHeader.fromCompressed; + // Read response flags + this.responseFlags = msgBody.readInt32LE(0); + this.checksumPresent = (this.responseFlags & OPTS_CHECKSUM_PRESENT) !== 0; + this.moreToCome = (this.responseFlags & OPTS_MORE_TO_COME) !== 0; + this.exhaustAllowed = (this.responseFlags & OPTS_EXHAUST_ALLOWED) !== 0; + this.promoteLongs = typeof this.opts.promoteLongs === 'boolean' ? this.opts.promoteLongs : true; + this.promoteValues = + typeof this.opts.promoteValues === 'boolean' ? this.opts.promoteValues : true; + this.promoteBuffers = + typeof this.opts.promoteBuffers === 'boolean' ? this.opts.promoteBuffers : false; + this.bsonRegExp = typeof this.opts.bsonRegExp === 'boolean' ? this.opts.bsonRegExp : false; + this.documents = []; + } + isParsed() { + return this.parsed; + } + parse(options) { + var _a, _b, _c, _d; + // Don't parse again if not needed + if (this.parsed) + return; + options = options !== null && options !== void 0 ? options : {}; + this.index = 4; + // Allow the return of raw documents instead of parsing + const raw = options.raw || false; + const documentsReturnedIn = options.documentsReturnedIn || null; + const promoteLongs = (_a = options.promoteLongs) !== null && _a !== void 0 ? _a : this.opts.promoteLongs; + const promoteValues = (_b = options.promoteValues) !== null && _b !== void 0 ? _b : this.opts.promoteValues; + const promoteBuffers = (_c = options.promoteBuffers) !== null && _c !== void 0 ? _c : this.opts.promoteBuffers; + const bsonRegExp = (_d = options.bsonRegExp) !== null && _d !== void 0 ? _d : this.opts.bsonRegExp; + const validation = this.parseBsonSerializationOptions(options); + // Set up the options + const bsonOptions = { + promoteLongs, + promoteValues, + promoteBuffers, + bsonRegExp, + validation + // Due to the strictness of the BSON libraries validation option we need this cast + }; + while (this.index < this.data.length) { + const payloadType = this.data.readUInt8(this.index++); + if (payloadType === 0) { + const bsonSize = this.data.readUInt32LE(this.index); + const bin = this.data.slice(this.index, this.index + bsonSize); + this.documents.push(raw ? bin : BSON.deserialize(bin, bsonOptions)); + this.index += bsonSize; + } + else if (payloadType === 1) { + // It was decided that no driver makes use of payload type 1 + // TODO(NODE-3483): Replace with MongoDeprecationError + throw new error_1.MongoRuntimeError('OP_MSG Payload Type 1 detected unsupported protocol'); + } + } + if (this.documents.length === 1 && documentsReturnedIn != null && raw) { + const fieldsAsRaw = {}; + fieldsAsRaw[documentsReturnedIn] = true; + bsonOptions.fieldsAsRaw = fieldsAsRaw; + const doc = BSON.deserialize(this.documents[0], bsonOptions); + this.documents = [doc]; + } + this.parsed = true; + } + parseBsonSerializationOptions({ enableUtf8Validation }) { + if (enableUtf8Validation === false) { + return { utf8: false }; + } + return { utf8: { writeErrors: false } }; + } +} +exports.BinMsg = BinMsg; +//# sourceMappingURL=commands.js.map \ No newline at end of file diff --git a/node_modules/mongodb/lib/cmap/commands.js.map b/node_modules/mongodb/lib/cmap/commands.js.map new file mode 100644 index 000000000..051635790 --- /dev/null +++ b/node_modules/mongodb/lib/cmap/commands.js.map @@ -0,0 +1 @@ +{"version":3,"file":"commands.js","sourceRoot":"","sources":["../../src/cmap/commands.ts"],"names":[],"mappings":";;;AACA,gCAAgC;AAChC,oCAAwE;AACxE,wDAAoD;AAEpD,oCAA6C;AAE7C,yDAA0F;AAE1F,0BAA0B;AAC1B,IAAI,UAAU,GAAG,CAAC,CAAC;AAEnB,cAAc;AACd,MAAM,oBAAoB,GAAG,CAAC,CAAC;AAC/B,MAAM,cAAc,GAAG,CAAC,CAAC;AACzB,MAAM,iBAAiB,GAAG,CAAC,CAAC;AAC5B,MAAM,sBAAsB,GAAG,EAAE,CAAC;AAClC,MAAM,eAAe,GAAG,EAAE,CAAC;AAC3B,MAAM,YAAY,GAAG,EAAE,CAAC;AACxB,MAAM,YAAY,GAAG,GAAG,CAAC;AAEzB,iBAAiB;AACjB,MAAM,gBAAgB,GAAG,CAAC,CAAC;AAC3B,MAAM,aAAa,GAAG,CAAC,CAAC;AACxB,MAAM,kBAAkB,GAAG,CAAC,CAAC;AAC7B,MAAM,aAAa,GAAG,CAAC,CAAC;AA0BxB;;gEAEgE;AAChE,gBAAgB;AAChB,MAAa,KAAK;IAsBhB,YAAY,EAAU,EAAE,KAAe,EAAE,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AAM,KAAK,CAAC,IAAI,mBAAmB,IAAI,IAAI,IAAI,GAAG,EAAE;YACrE,MAAM,WAAW,GAAa,EAAE,CAAC;YACjC,WAAW,CAAC,mBAAmB,CAAC,GAAG,IAAI,CAAC;YACxC,WAAW,CAAC,WAAW,GAAG,WAAW,CAAC;YACtC,MAAM,GAAG,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAW,EAAE,WAAW,CAAC,CAAC;YACvE,IAAI,CAAC,SAAS,GAAG,CAAC,GAAG,CAAC,CAAC;SACxB;QAED,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;IACrB,CAAC;IAED,6BAA6B,CAAC,EAAE,oBAAoB,EAAwB;QAG1E,IAAI,oBAAoB,KAAK,KAAK,EAAE;YAClC,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;SACxB;QAED,OAAO,EAAE,IAAI,EAAE,EAAE,WAAW,EAAE,KAAK,EAAE,EAAE,CAAC;IAC1C,CAAC;CACF;AA3HD,wBA2HC"} \ No newline at end of file diff --git a/node_modules/mongodb/lib/cmap/connect.js b/node_modules/mongodb/lib/cmap/connect.js new file mode 100644 index 000000000..8643d6896 --- /dev/null +++ b/node_modules/mongodb/lib/cmap/connect.js @@ -0,0 +1,393 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.LEGAL_TCP_SOCKET_OPTIONS = exports.LEGAL_TLS_SOCKET_OPTIONS = exports.connect = void 0; +const net = require("net"); +const socks_1 = require("socks"); +const tls = require("tls"); +const bson_1 = require("../bson"); +const constants_1 = require("../constants"); +const error_1 = require("../error"); +const utils_1 = require("../utils"); +const auth_provider_1 = require("./auth/auth_provider"); +const gssapi_1 = require("./auth/gssapi"); +const mongocr_1 = require("./auth/mongocr"); +const mongodb_aws_1 = require("./auth/mongodb_aws"); +const plain_1 = require("./auth/plain"); +const providers_1 = require("./auth/providers"); +const scram_1 = require("./auth/scram"); +const x509_1 = require("./auth/x509"); +const connection_1 = require("./connection"); +const constants_2 = require("./wire_protocol/constants"); +const AUTH_PROVIDERS = new Map([ + [providers_1.AuthMechanism.MONGODB_AWS, new mongodb_aws_1.MongoDBAWS()], + [providers_1.AuthMechanism.MONGODB_CR, new mongocr_1.MongoCR()], + [providers_1.AuthMechanism.MONGODB_GSSAPI, new gssapi_1.GSSAPI()], + [providers_1.AuthMechanism.MONGODB_PLAIN, new plain_1.Plain()], + [providers_1.AuthMechanism.MONGODB_SCRAM_SHA1, new scram_1.ScramSHA1()], + [providers_1.AuthMechanism.MONGODB_SCRAM_SHA256, new scram_1.ScramSHA256()], + [providers_1.AuthMechanism.MONGODB_X509, new x509_1.X509()] +]); +function connect(options, callback) { + makeConnection({ ...options, existingSocket: undefined }, (err, socket) => { + var _a; + if (err || !socket) { + return callback(err); + } + let ConnectionType = (_a = options.connectionType) !== null && _a !== void 0 ? _a : connection_1.Connection; + if (options.autoEncrypter) { + ConnectionType = connection_1.CryptoConnection; + } + performInitialHandshake(new ConnectionType(socket, options), options, callback); + }); +} +exports.connect = connect; +function checkSupportedServer(hello, options) { + var _a; + const serverVersionHighEnough = hello && + (typeof hello.maxWireVersion === 'number' || hello.maxWireVersion instanceof bson_1.Int32) && + hello.maxWireVersion >= constants_2.MIN_SUPPORTED_WIRE_VERSION; + const serverVersionLowEnough = hello && + (typeof hello.minWireVersion === 'number' || hello.minWireVersion instanceof bson_1.Int32) && + hello.minWireVersion <= constants_2.MAX_SUPPORTED_WIRE_VERSION; + if (serverVersionHighEnough) { + if (serverVersionLowEnough) { + return null; + } + const message = `Server at ${options.hostAddress} reports minimum wire version ${JSON.stringify(hello.minWireVersion)}, but this version of the Node.js Driver requires at most ${constants_2.MAX_SUPPORTED_WIRE_VERSION} (MongoDB ${constants_2.MAX_SUPPORTED_SERVER_VERSION})`; + return new error_1.MongoCompatibilityError(message); + } + const message = `Server at ${options.hostAddress} reports maximum wire version ${(_a = JSON.stringify(hello.maxWireVersion)) !== null && _a !== void 0 ? _a : 0}, but this version of the Node.js Driver requires at least ${constants_2.MIN_SUPPORTED_WIRE_VERSION} (MongoDB ${constants_2.MIN_SUPPORTED_SERVER_VERSION})`; + return new error_1.MongoCompatibilityError(message); +} +function performInitialHandshake(conn, options, _callback) { + const callback = function (err, ret) { + if (err && conn) { + conn.destroy(); + } + _callback(err, ret); + }; + const credentials = options.credentials; + if (credentials) { + if (!(credentials.mechanism === providers_1.AuthMechanism.MONGODB_DEFAULT) && + !AUTH_PROVIDERS.get(credentials.mechanism)) { + callback(new error_1.MongoInvalidArgumentError(`AuthMechanism '${credentials.mechanism}' not supported`)); + return; + } + } + const authContext = new auth_provider_1.AuthContext(conn, credentials, options); + prepareHandshakeDocument(authContext, (err, handshakeDoc) => { + if (err || !handshakeDoc) { + return callback(err); + } + const handshakeOptions = Object.assign({}, options); + if (typeof options.connectTimeoutMS === 'number') { + // The handshake technically is a monitoring check, so its socket timeout should be connectTimeoutMS + handshakeOptions.socketTimeoutMS = options.connectTimeoutMS; + } + const start = new Date().getTime(); + conn.command((0, utils_1.ns)('admin.$cmd'), handshakeDoc, handshakeOptions, (err, response) => { + if (err) { + callback(err); + return; + } + if ((response === null || response === void 0 ? void 0 : response.ok) === 0) { + callback(new error_1.MongoServerError(response)); + return; + } + if (!('isWritablePrimary' in response)) { + // Provide hello-style response document. + response.isWritablePrimary = response[constants_1.LEGACY_HELLO_COMMAND]; + } + if (response.helloOk) { + conn.helloOk = true; + } + const supportedServerErr = checkSupportedServer(response, options); + if (supportedServerErr) { + callback(supportedServerErr); + return; + } + if (options.loadBalanced) { + if (!response.serviceId) { + return callback(new error_1.MongoCompatibilityError('Driver attempted to initialize in load balancing mode, ' + + 'but the server does not support this mode.')); + } + } + // NOTE: This is metadata attached to the connection while porting away from + // handshake being done in the `Server` class. Likely, it should be + // relocated, or at very least restructured. + conn.hello = response; + conn.lastHelloMS = new Date().getTime() - start; + if (!response.arbiterOnly && credentials) { + // store the response on auth context + authContext.response = response; + const resolvedCredentials = credentials.resolveAuthMechanism(response); + const provider = AUTH_PROVIDERS.get(resolvedCredentials.mechanism); + if (!provider) { + return callback(new error_1.MongoInvalidArgumentError(`No AuthProvider for ${resolvedCredentials.mechanism} defined.`)); + } + provider.auth(authContext, err => { + if (err) { + if (err instanceof error_1.MongoError) { + err.addErrorLabel(error_1.MongoErrorLabel.HandshakeError); + if ((0, error_1.needsRetryableWriteLabel)(err, response.maxWireVersion)) { + err.addErrorLabel(error_1.MongoErrorLabel.RetryableWriteError); + } + } + return callback(err); + } + callback(undefined, conn); + }); + return; + } + callback(undefined, conn); + }); + }); +} +function prepareHandshakeDocument(authContext, callback) { + const options = authContext.options; + const compressors = options.compressors ? options.compressors : []; + const { serverApi } = authContext.connection; + const handshakeDoc = { + [(serverApi === null || serverApi === void 0 ? void 0 : serverApi.version) ? 'hello' : constants_1.LEGACY_HELLO_COMMAND]: true, + helloOk: true, + client: options.metadata || (0, utils_1.makeClientMetadata)(options), + compression: compressors, + loadBalanced: options.loadBalanced + }; + const credentials = authContext.credentials; + if (credentials) { + if (credentials.mechanism === providers_1.AuthMechanism.MONGODB_DEFAULT && credentials.username) { + handshakeDoc.saslSupportedMechs = `${credentials.source}.${credentials.username}`; + const provider = AUTH_PROVIDERS.get(providers_1.AuthMechanism.MONGODB_SCRAM_SHA256); + if (!provider) { + // This auth mechanism is always present. + return callback(new error_1.MongoInvalidArgumentError(`No AuthProvider for ${providers_1.AuthMechanism.MONGODB_SCRAM_SHA256} defined.`)); + } + return provider.prepare(handshakeDoc, authContext, callback); + } + const provider = AUTH_PROVIDERS.get(credentials.mechanism); + if (!provider) { + return callback(new error_1.MongoInvalidArgumentError(`No AuthProvider for ${credentials.mechanism} defined.`)); + } + return provider.prepare(handshakeDoc, authContext, callback); + } + callback(undefined, handshakeDoc); +} +/** @public */ +exports.LEGAL_TLS_SOCKET_OPTIONS = [ + 'ALPNProtocols', + 'ca', + 'cert', + 'checkServerIdentity', + 'ciphers', + 'crl', + 'ecdhCurve', + 'key', + 'minDHSize', + 'passphrase', + 'pfx', + 'rejectUnauthorized', + 'secureContext', + 'secureProtocol', + 'servername', + 'session' +]; +/** @public */ +exports.LEGAL_TCP_SOCKET_OPTIONS = [ + 'family', + 'hints', + 'localAddress', + 'localPort', + 'lookup' +]; +function parseConnectOptions(options) { + const hostAddress = options.hostAddress; + if (!hostAddress) + throw new error_1.MongoInvalidArgumentError('Option "hostAddress" is required'); + const result = {}; + for (const name of exports.LEGAL_TCP_SOCKET_OPTIONS) { + if (options[name] != null) { + result[name] = options[name]; + } + } + if (typeof hostAddress.socketPath === 'string') { + result.path = hostAddress.socketPath; + return result; + } + else if (typeof hostAddress.host === 'string') { + result.host = hostAddress.host; + result.port = hostAddress.port; + return result; + } + else { + // This should never happen since we set up HostAddresses + // But if we don't throw here the socket could hang until timeout + // TODO(NODE-3483) + throw new error_1.MongoRuntimeError(`Unexpected HostAddress ${JSON.stringify(hostAddress)}`); + } +} +function parseSslOptions(options) { + const result = parseConnectOptions(options); + // Merge in valid SSL options + for (const name of exports.LEGAL_TLS_SOCKET_OPTIONS) { + if (options[name] != null) { + result[name] = options[name]; + } + } + if (options.existingSocket) { + result.socket = options.existingSocket; + } + // Set default sni servername to be the same as host + if (result.servername == null && result.host && !net.isIP(result.host)) { + result.servername = result.host; + } + return result; +} +const SOCKET_ERROR_EVENT_LIST = ['error', 'close', 'timeout', 'parseError']; +const SOCKET_ERROR_EVENTS = new Set(SOCKET_ERROR_EVENT_LIST); +function makeConnection(options, _callback) { + var _a, _b, _c, _d, _e, _f, _g, _h, _j; + const useTLS = (_a = options.tls) !== null && _a !== void 0 ? _a : false; + const keepAlive = (_b = options.keepAlive) !== null && _b !== void 0 ? _b : true; + const socketTimeoutMS = (_d = (_c = options.socketTimeoutMS) !== null && _c !== void 0 ? _c : Reflect.get(options, 'socketTimeout')) !== null && _d !== void 0 ? _d : 0; + const noDelay = (_e = options.noDelay) !== null && _e !== void 0 ? _e : true; + const connectTimeoutMS = (_f = options.connectTimeoutMS) !== null && _f !== void 0 ? _f : 30000; + const rejectUnauthorized = (_g = options.rejectUnauthorized) !== null && _g !== void 0 ? _g : true; + const keepAliveInitialDelay = (_j = (((_h = options.keepAliveInitialDelay) !== null && _h !== void 0 ? _h : 120000) > socketTimeoutMS + ? Math.round(socketTimeoutMS / 2) + : options.keepAliveInitialDelay)) !== null && _j !== void 0 ? _j : 120000; + const existingSocket = options.existingSocket; + let socket; + const callback = function (err, ret) { + if (err && socket) { + socket.destroy(); + } + _callback(err, ret); + }; + if (options.proxyHost != null) { + // Currently, only Socks5 is supported. + return makeSocks5Connection({ + ...options, + connectTimeoutMS // Should always be present for Socks5 + }, callback); + } + if (useTLS) { + const tlsSocket = tls.connect(parseSslOptions(options)); + if (typeof tlsSocket.disableRenegotiation === 'function') { + tlsSocket.disableRenegotiation(); + } + socket = tlsSocket; + } + else if (existingSocket) { + // In the TLS case, parseSslOptions() sets options.socket to existingSocket, + // so we only need to handle the non-TLS case here (where existingSocket + // gives us all we need out of the box). + socket = existingSocket; + } + else { + socket = net.createConnection(parseConnectOptions(options)); + } + socket.setKeepAlive(keepAlive, keepAliveInitialDelay); + socket.setTimeout(connectTimeoutMS); + socket.setNoDelay(noDelay); + const connectEvent = useTLS ? 'secureConnect' : 'connect'; + let cancellationHandler; + function errorHandler(eventName) { + return (err) => { + SOCKET_ERROR_EVENTS.forEach(event => socket.removeAllListeners(event)); + if (cancellationHandler && options.cancellationToken) { + options.cancellationToken.removeListener('cancel', cancellationHandler); + } + socket.removeListener(connectEvent, connectHandler); + callback(connectionFailureError(eventName, err)); + }; + } + function connectHandler() { + SOCKET_ERROR_EVENTS.forEach(event => socket.removeAllListeners(event)); + if (cancellationHandler && options.cancellationToken) { + options.cancellationToken.removeListener('cancel', cancellationHandler); + } + if ('authorizationError' in socket) { + if (socket.authorizationError && rejectUnauthorized) { + return callback(socket.authorizationError); + } + } + socket.setTimeout(socketTimeoutMS); + callback(undefined, socket); + } + SOCKET_ERROR_EVENTS.forEach(event => socket.once(event, errorHandler(event))); + if (options.cancellationToken) { + cancellationHandler = errorHandler('cancel'); + options.cancellationToken.once('cancel', cancellationHandler); + } + if (existingSocket) { + process.nextTick(connectHandler); + } + else { + socket.once(connectEvent, connectHandler); + } +} +function makeSocks5Connection(options, callback) { + var _a, _b; + const hostAddress = utils_1.HostAddress.fromHostPort((_a = options.proxyHost) !== null && _a !== void 0 ? _a : '', // proxyHost is guaranteed to set here + (_b = options.proxyPort) !== null && _b !== void 0 ? _b : 1080); + // First, connect to the proxy server itself: + makeConnection({ + ...options, + hostAddress, + tls: false, + proxyHost: undefined + }, (err, rawSocket) => { + if (err) { + return callback(err); + } + const destination = parseConnectOptions(options); + if (typeof destination.host !== 'string' || typeof destination.port !== 'number') { + return callback(new error_1.MongoInvalidArgumentError('Can only make Socks5 connections to TCP hosts')); + } + // Then, establish the Socks5 proxy connection: + socks_1.SocksClient.createConnection({ + existing_socket: rawSocket, + timeout: options.connectTimeoutMS, + command: 'connect', + destination: { + host: destination.host, + port: destination.port + }, + proxy: { + // host and port are ignored because we pass existing_socket + host: 'iLoveJavaScript', + port: 0, + type: 5, + userId: options.proxyUsername || undefined, + password: options.proxyPassword || undefined + } + }, (err, info) => { + if (err) { + return callback(connectionFailureError('error', err)); + } + // Finally, now treat the resulting duplex stream as the + // socket over which we send and receive wire protocol messages: + makeConnection({ + ...options, + existingSocket: info.socket, + proxyHost: undefined + }, callback); + }); + }); +} +function connectionFailureError(type, err) { + switch (type) { + case 'error': + return new error_1.MongoNetworkError(err); + case 'timeout': + return new error_1.MongoNetworkTimeoutError('connection timed out'); + case 'close': + return new error_1.MongoNetworkError('connection closed'); + case 'cancel': + return new error_1.MongoNetworkError('connection establishment was cancelled'); + default: + return new error_1.MongoNetworkError('unknown network error'); + } +} +//# sourceMappingURL=connect.js.map \ No newline at end of file diff --git a/node_modules/mongodb/lib/cmap/connect.js.map b/node_modules/mongodb/lib/cmap/connect.js.map new file mode 100644 index 000000000..2f7131e21 --- /dev/null +++ b/node_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C;SACF,EACD,CAAC,GAAa,EAAE,IAAwB,EAAE,EAAE;YAC1C,IAAI,GAAG,EAAE;gBACP,OAAO,QAAQ,CAAC,sBAAsB,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC,CAAC;aACvD;YAED,wDAAwD;YACxD,gEAAgE;YAChE,cAAc,CACZ;gBACE,GAAG,OAAO;gBACV,cAAc,EAAE,IAAI,CAAC,MAAM;gBAC3B,SAAS,EAAE,SAAS;aACrB,EACD,QAAQ,CACT,CAAC;QACJ,CAAC,CACF,CAAC;IACJ,CAAC,CACF,CAAC;AACJ,CAAC;AAED,SAAS,sBAAsB,CAAC,IAA2B,EAAE,GAAU;IACrE,QAAQ,IAAI,EAAE;QACZ,KAAK,OAAO;YACV,OAAO,IAAI,yBAAiB,CAAC,GAAG,CAAC,CAAC;QACpC,KAAK,SAAS;YACZ,OAAO,IAAI,gCAAwB,CAAC,sBAAsB,CAAC,CAAC;QAC9D,KAAK,OAAO;YACV,OAAO,IAAI,yBAAiB,CAAC,mBAAmB,CAAC,CAAC;QACpD,KAAK,QAAQ;YACX,OAAO,IAAI,yBAAiB,CAAC,wCAAwC,CAAC,CAAC;QACzE;YACE,OAAO,IAAI,yBAAiB,CAAC,uBAAuB,CAAC,CAAC;KACzD;AACH,CAAC"} \ No newline at end of file diff --git a/node_modules/mongodb/lib/cmap/connection.js b/node_modules/mongodb/lib/cmap/connection.js new file mode 100644 index 000000000..1ad803cd7 --- /dev/null +++ b/node_modules/mongodb/lib/cmap/connection.js @@ -0,0 +1,532 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.hasSessionSupport = exports.CryptoConnection = exports.Connection = void 0; +const timers_1 = require("timers"); +const bson_1 = require("../bson"); +const constants_1 = require("../constants"); +const error_1 = require("../error"); +const mongo_types_1 = require("../mongo_types"); +const sessions_1 = require("../sessions"); +const utils_1 = require("../utils"); +const command_monitoring_events_1 = require("./command_monitoring_events"); +const commands_1 = require("./commands"); +const message_stream_1 = require("./message_stream"); +const stream_description_1 = require("./stream_description"); +const shared_1 = require("./wire_protocol/shared"); +/** @internal */ +const kStream = Symbol('stream'); +/** @internal */ +const kQueue = Symbol('queue'); +/** @internal */ +const kMessageStream = Symbol('messageStream'); +/** @internal */ +const kGeneration = Symbol('generation'); +/** @internal */ +const kLastUseTime = Symbol('lastUseTime'); +/** @internal */ +const kClusterTime = Symbol('clusterTime'); +/** @internal */ +const kDescription = Symbol('description'); +/** @internal */ +const kHello = Symbol('hello'); +/** @internal */ +const kAutoEncrypter = Symbol('autoEncrypter'); +/** @internal */ +const kFullResult = Symbol('fullResult'); +/** @internal */ +const kDelayedTimeoutId = Symbol('delayedTimeoutId'); +/** @internal */ +class Connection extends mongo_types_1.TypedEventEmitter { + constructor(stream, options) { + var _a, _b; + super(); + this.id = options.id; + this.address = streamIdentifier(stream, options); + this.socketTimeoutMS = (_a = options.socketTimeoutMS) !== null && _a !== void 0 ? _a : 0; + this.monitorCommands = options.monitorCommands; + this.serverApi = options.serverApi; + this.closed = false; + this.destroyed = false; + this[kHello] = null; + this[kClusterTime] = null; + this[kDescription] = new stream_description_1.StreamDescription(this.address, options); + this[kGeneration] = options.generation; + this[kLastUseTime] = (0, utils_1.now)(); + // setup parser stream and message handling + this[kQueue] = new Map(); + this[kMessageStream] = new message_stream_1.MessageStream({ + ...options, + maxBsonMessageSize: (_b = this.hello) === null || _b === void 0 ? void 0 : _b.maxBsonMessageSize + }); + this[kStream] = stream; + this[kDelayedTimeoutId] = null; + this[kMessageStream].on('message', message => this.onMessage(message)); + this[kMessageStream].on('error', error => this.onError(error)); + this[kStream].on('close', () => this.onClose()); + this[kStream].on('timeout', () => this.onTimeout()); + this[kStream].on('error', () => { + /* ignore errors, listen to `close` instead */ + }); + // hook the message stream up to the passed in stream + this[kStream].pipe(this[kMessageStream]); + this[kMessageStream].pipe(this[kStream]); + } + get description() { + return this[kDescription]; + } + get hello() { + return this[kHello]; + } + // the `connect` method stores the result of the handshake hello on the connection + set hello(response) { + this[kDescription].receiveResponse(response); + this[kDescription] = Object.freeze(this[kDescription]); + // TODO: remove this, and only use the `StreamDescription` in the future + this[kHello] = response; + } + // Set the whether the message stream is for a monitoring connection. + set isMonitoringConnection(value) { + this[kMessageStream].isMonitoringConnection = value; + } + get isMonitoringConnection() { + return this[kMessageStream].isMonitoringConnection; + } + get serviceId() { + var _a; + return (_a = this.hello) === null || _a === void 0 ? void 0 : _a.serviceId; + } + get loadBalanced() { + return this.description.loadBalanced; + } + get generation() { + return this[kGeneration] || 0; + } + set generation(generation) { + this[kGeneration] = generation; + } + get idleTime() { + return (0, utils_1.calculateDurationInMs)(this[kLastUseTime]); + } + get clusterTime() { + return this[kClusterTime]; + } + get stream() { + return this[kStream]; + } + markAvailable() { + this[kLastUseTime] = (0, utils_1.now)(); + } + onError(error) { + if (this.closed) { + return; + } + this[kStream].destroy(error); + this.closed = true; + for (const op of this[kQueue].values()) { + op.cb(error); + } + this[kQueue].clear(); + this.emit(Connection.CLOSE); + } + onClose() { + if (this.closed) { + return; + } + this.closed = true; + const message = `connection ${this.id} to ${this.address} closed`; + for (const op of this[kQueue].values()) { + op.cb(new error_1.MongoNetworkError(message)); + } + this[kQueue].clear(); + this.emit(Connection.CLOSE); + } + onTimeout() { + if (this.closed) { + return; + } + this[kDelayedTimeoutId] = (0, timers_1.setTimeout)(() => { + this[kStream].destroy(); + this.closed = true; + const message = `connection ${this.id} to ${this.address} timed out`; + const beforeHandshake = this.hello == null; + for (const op of this[kQueue].values()) { + op.cb(new error_1.MongoNetworkTimeoutError(message, { beforeHandshake })); + } + this[kQueue].clear(); + this.emit(Connection.CLOSE); + }, 1).unref(); // No need for this timer to hold the event loop open + } + onMessage(message) { + const delayedTimeoutId = this[kDelayedTimeoutId]; + if (delayedTimeoutId != null) { + clearTimeout(delayedTimeoutId); + this[kDelayedTimeoutId] = null; + } + // always emit the message, in case we are streaming + this.emit('message', message); + const operationDescription = this[kQueue].get(message.responseTo); + if (!operationDescription) { + return; + } + const callback = operationDescription.cb; + // SERVER-45775: For exhaust responses we should be able to use the same requestId to + // track response, however the server currently synthetically produces remote requests + // making the `responseTo` change on each response + this[kQueue].delete(message.responseTo); + if ('moreToCome' in message && message.moreToCome) { + // requeue the callback for next synthetic request + this[kQueue].set(message.requestId, operationDescription); + } + else if (operationDescription.socketTimeoutOverride) { + this[kStream].setTimeout(this.socketTimeoutMS); + } + try { + // Pass in the entire description because it has BSON parsing options + message.parse(operationDescription); + } + catch (err) { + // If this error is generated by our own code, it will already have the correct class applied + // if it is not, then it is coming from a catastrophic data parse failure or the BSON library + // in either case, it should not be wrapped + callback(err); + return; + } + if (message.documents[0]) { + const document = message.documents[0]; + const session = operationDescription.session; + if (session) { + (0, sessions_1.updateSessionFromResponse)(session, document); + } + if (document.$clusterTime) { + this[kClusterTime] = document.$clusterTime; + this.emit(Connection.CLUSTER_TIME_RECEIVED, document.$clusterTime); + } + if (operationDescription.command) { + if (document.writeConcernError) { + callback(new error_1.MongoWriteConcernError(document.writeConcernError, document)); + return; + } + if (document.ok === 0 || document.$err || document.errmsg || document.code) { + callback(new error_1.MongoServerError(document)); + return; + } + } + else { + // Pre 3.2 support + if (document.ok === 0 || document.$err || document.errmsg) { + callback(new error_1.MongoServerError(document)); + return; + } + } + } + callback(undefined, operationDescription.fullResult ? message : message.documents[0]); + } + destroy(options, callback) { + if (typeof options === 'function') { + callback = options; + options = { force: false }; + } + this.removeAllListeners(Connection.PINNED); + this.removeAllListeners(Connection.UNPINNED); + options = Object.assign({ force: false }, options); + if (this[kStream] == null || this.destroyed) { + this.destroyed = true; + if (typeof callback === 'function') { + callback(); + } + return; + } + if (options.force) { + this[kStream].destroy(); + this.destroyed = true; + if (typeof callback === 'function') { + callback(); + } + return; + } + this[kStream].end(() => { + this.destroyed = true; + if (typeof callback === 'function') { + callback(); + } + }); + } + command(ns, cmd, options, callback) { + if (!(ns instanceof utils_1.MongoDBNamespace)) { + // TODO(NODE-3483): Replace this with a MongoCommandError + throw new error_1.MongoRuntimeError('Must provide a MongoDBNamespace instance'); + } + const readPreference = (0, shared_1.getReadPreference)(cmd, options); + const shouldUseOpMsg = supportsOpMsg(this); + const session = options === null || options === void 0 ? void 0 : options.session; + let clusterTime = this.clusterTime; + let finalCmd = Object.assign({}, cmd); + if (this.serverApi) { + const { version, strict, deprecationErrors } = this.serverApi; + finalCmd.apiVersion = version; + if (strict != null) + finalCmd.apiStrict = strict; + if (deprecationErrors != null) + finalCmd.apiDeprecationErrors = deprecationErrors; + } + if (hasSessionSupport(this) && session) { + if (session.clusterTime && + clusterTime && + session.clusterTime.clusterTime.greaterThan(clusterTime.clusterTime)) { + clusterTime = session.clusterTime; + } + const err = (0, sessions_1.applySession)(session, finalCmd, options); + if (err) { + return callback(err); + } + } + // if we have a known cluster time, gossip it + if (clusterTime) { + finalCmd.$clusterTime = clusterTime; + } + if ((0, shared_1.isSharded)(this) && !shouldUseOpMsg && readPreference && readPreference.mode !== 'primary') { + finalCmd = { + $query: finalCmd, + $readPreference: readPreference.toJSON() + }; + } + const commandOptions = Object.assign({ + command: true, + numberToSkip: 0, + numberToReturn: -1, + checkKeys: false, + // This value is not overridable + secondaryOk: readPreference.secondaryOk() + }, options); + const cmdNs = `${ns.db}.$cmd`; + const message = shouldUseOpMsg + ? new commands_1.Msg(cmdNs, finalCmd, commandOptions) + : new commands_1.Query(cmdNs, finalCmd, commandOptions); + try { + write(this, message, commandOptions, callback); + } + catch (err) { + callback(err); + } + } + getMore(ns, cursorId, options, callback) { + const fullResult = !!options[kFullResult]; + const wireVersion = (0, utils_1.maxWireVersion)(this); + if (!cursorId) { + // TODO(NODE-3483): Replace this with a MongoCommandError + callback(new error_1.MongoRuntimeError('Invalid internal cursor state, no known cursor id')); + return; + } + if (wireVersion < 4) { + const getMoreOp = new commands_1.GetMore(ns.toString(), cursorId, { numberToReturn: options.batchSize }); + const queryOptions = (0, shared_1.applyCommonQueryOptions)({}, Object.assign(options, { ...(0, bson_1.pluckBSONSerializeOptions)(options) })); + queryOptions[kFullResult] = true; + queryOptions.command = true; + write(this, getMoreOp, queryOptions, (err, response) => { + if (fullResult) + return callback(err, response); + if (err) + return callback(err); + callback(undefined, { cursor: { id: response.cursorId, nextBatch: response.documents } }); + }); + return; + } + const getMoreCmd = { + getMore: cursorId, + collection: ns.collection + }; + if (typeof options.batchSize === 'number') { + getMoreCmd.batchSize = Math.abs(options.batchSize); + } + if (typeof options.maxAwaitTimeMS === 'number') { + getMoreCmd.maxTimeMS = options.maxAwaitTimeMS; + } + // we check for undefined specifically here to allow falsy values + // eslint-disable-next-line no-restricted-syntax + if (options.comment !== undefined) { + getMoreCmd.comment = options.comment; + } + const commandOptions = Object.assign({ + returnFieldSelector: null, + documentsReturnedIn: 'nextBatch' + }, options); + this.command(ns, getMoreCmd, commandOptions, callback); + } + killCursors(ns, cursorIds, options, callback) { + if (!cursorIds || !Array.isArray(cursorIds)) { + // TODO(NODE-3483): Replace this with a MongoCommandError + throw new error_1.MongoRuntimeError(`Invalid list of cursor ids provided: ${cursorIds}`); + } + if ((0, utils_1.maxWireVersion)(this) < 4) { + try { + write(this, new commands_1.KillCursor(ns.toString(), cursorIds), { noResponse: true, ...options }, callback); + } + catch (err) { + callback(err); + } + return; + } + this.command(ns, { killCursors: ns.collection, cursors: cursorIds }, { [kFullResult]: true, ...options }, (err, response) => { + if (err || !response) + return callback(err); + if (response.cursorNotFound) { + return callback(new error_1.MongoNetworkError('cursor killed or timed out'), null); + } + if (!Array.isArray(response.documents) || response.documents.length === 0) { + return callback( + // TODO(NODE-3483) + new error_1.MongoRuntimeError(`invalid killCursors result returned for cursor id ${cursorIds[0]}`)); + } + callback(undefined, response.documents[0]); + }); + } +} +exports.Connection = Connection; +/** @event */ +Connection.COMMAND_STARTED = constants_1.COMMAND_STARTED; +/** @event */ +Connection.COMMAND_SUCCEEDED = constants_1.COMMAND_SUCCEEDED; +/** @event */ +Connection.COMMAND_FAILED = constants_1.COMMAND_FAILED; +/** @event */ +Connection.CLUSTER_TIME_RECEIVED = constants_1.CLUSTER_TIME_RECEIVED; +/** @event */ +Connection.CLOSE = constants_1.CLOSE; +/** @event */ +Connection.MESSAGE = constants_1.MESSAGE; +/** @event */ +Connection.PINNED = constants_1.PINNED; +/** @event */ +Connection.UNPINNED = constants_1.UNPINNED; +/** @internal */ +class CryptoConnection extends Connection { + constructor(stream, options) { + super(stream, options); + this[kAutoEncrypter] = options.autoEncrypter; + } + /** @internal @override */ + command(ns, cmd, options, callback) { + const autoEncrypter = this[kAutoEncrypter]; + if (!autoEncrypter) { + return callback(new error_1.MongoMissingDependencyError('No AutoEncrypter available for encryption')); + } + const serverWireVersion = (0, utils_1.maxWireVersion)(this); + if (serverWireVersion === 0) { + // This means the initial handshake hasn't happened yet + return super.command(ns, cmd, options, callback); + } + if (serverWireVersion < 8) { + callback(new error_1.MongoCompatibilityError('Auto-encryption requires a minimum MongoDB version of 4.2')); + return; + } + autoEncrypter.encrypt(ns.toString(), cmd, options, (err, encrypted) => { + if (err || encrypted == null) { + callback(err, null); + return; + } + super.command(ns, encrypted, options, (err, response) => { + if (err || response == null) { + callback(err, response); + return; + } + autoEncrypter.decrypt(response, options, callback); + }); + }); + } +} +exports.CryptoConnection = CryptoConnection; +/** @internal */ +function hasSessionSupport(conn) { + const description = conn.description; + return description.logicalSessionTimeoutMinutes != null || !!description.loadBalanced; +} +exports.hasSessionSupport = hasSessionSupport; +function supportsOpMsg(conn) { + const description = conn.description; + if (description == null) { + return false; + } + return (0, utils_1.maxWireVersion)(conn) >= 6 && !description.__nodejs_mock_server__; +} +function streamIdentifier(stream, options) { + if (options.proxyHost) { + // If proxy options are specified, the properties of `stream` itself + // will not accurately reflect what endpoint this is connected to. + return options.hostAddress.toString(); + } + if (typeof stream.address === 'function') { + return `${stream.remoteAddress}:${stream.remotePort}`; + } + return (0, utils_1.uuidV4)().toString('hex'); +} +function write(conn, command, options, callback) { + if (typeof options === 'function') { + callback = options; + } + options = options !== null && options !== void 0 ? options : {}; + const operationDescription = { + requestId: command.requestId, + cb: callback, + session: options.session, + fullResult: !!options[kFullResult], + noResponse: typeof options.noResponse === 'boolean' ? options.noResponse : false, + documentsReturnedIn: options.documentsReturnedIn, + command: !!options.command, + // for BSON parsing + promoteLongs: typeof options.promoteLongs === 'boolean' ? options.promoteLongs : true, + promoteValues: typeof options.promoteValues === 'boolean' ? options.promoteValues : true, + promoteBuffers: typeof options.promoteBuffers === 'boolean' ? options.promoteBuffers : false, + bsonRegExp: typeof options.bsonRegExp === 'boolean' ? options.bsonRegExp : false, + enableUtf8Validation: typeof options.enableUtf8Validation === 'boolean' ? options.enableUtf8Validation : true, + raw: typeof options.raw === 'boolean' ? options.raw : false, + started: 0 + }; + if (conn[kDescription] && conn[kDescription].compressor) { + operationDescription.agreedCompressor = conn[kDescription].compressor; + if (conn[kDescription].zlibCompressionLevel) { + operationDescription.zlibCompressionLevel = conn[kDescription].zlibCompressionLevel; + } + } + if (typeof options.socketTimeoutMS === 'number') { + operationDescription.socketTimeoutOverride = true; + conn[kStream].setTimeout(options.socketTimeoutMS); + } + // if command monitoring is enabled we need to modify the callback here + if (conn.monitorCommands) { + conn.emit(Connection.COMMAND_STARTED, new command_monitoring_events_1.CommandStartedEvent(conn, command)); + operationDescription.started = (0, utils_1.now)(); + operationDescription.cb = (err, reply) => { + if (err) { + conn.emit(Connection.COMMAND_FAILED, new command_monitoring_events_1.CommandFailedEvent(conn, command, err, operationDescription.started)); + } + else { + if (reply && (reply.ok === 0 || reply.$err)) { + conn.emit(Connection.COMMAND_FAILED, new command_monitoring_events_1.CommandFailedEvent(conn, command, reply, operationDescription.started)); + } + else { + conn.emit(Connection.COMMAND_SUCCEEDED, new command_monitoring_events_1.CommandSucceededEvent(conn, command, reply, operationDescription.started)); + } + } + if (typeof callback === 'function') { + callback(err, reply); + } + }; + } + if (!operationDescription.noResponse) { + conn[kQueue].set(operationDescription.requestId, operationDescription); + } + try { + conn[kMessageStream].writeCommand(command, operationDescription); + } + catch (e) { + if (!operationDescription.noResponse) { + conn[kQueue].delete(operationDescription.requestId); + operationDescription.cb(e); + return; + } + } + if (operationDescription.noResponse) { + operationDescription.cb(); + } +} +//# sourceMappingURL=connection.js.map \ No newline at end of file diff --git a/node_modules/mongodb/lib/cmap/connection.js.map b/node_modules/mongodb/lib/cmap/connection.js.map new file mode 100644 index 000000000..fda34479b --- /dev/null +++ b/node_modules/mongodb/lib/cmap/connection.js.map @@ -0,0 +1 @@ +{"version":3,"file":"connection.js","sourceRoot":"","sources":["../../src/cmap/connection.ts"],"names":[],"mappings":";;;AAAA,mCAAoC;AAEpC,kCAAoG;AACpG,4CASsB;AAEtB,oCAQkB;AAElB,gDAAsE;AAEtE,0CAAqF;AACrF,oCASkB;AAGlB,2EAIqC;AACrC,yCAQoB;AAEpB,qDAAuE;AACvE,6DAAmF;AACnF,mDAA+F;AAE/F,gBAAgB;AAChB,MAAM,OAAO,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC;AACjC,gBAAgB;AAChB,MAAM,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC;AAC/B,gBAAgB;AAChB,MAAM,cAAc,GAAG,MAAM,CAAC,eAAe,CAAC,CAAC;AAC/C,gBAAgB;AAChB,MAAM,WAAW,GAAG,MAAM,CAAC,YAAY,CAAC,CAAC;AACzC,gBAAgB;AAChB,MAAM,YAAY,GAAG,MAAM,CAAC,aAAa,CAAC,CAAC;AAC3C,gBAAgB;AAChB,MAAM,YAAY,GAAG,MAAM,CAAC,aAAa,CAAC,CAAC;AAC3C,gBAAgB;AAChB,MAAM,YAAY,GAAG,MAAM,CAAC,aAAa,CAAC,CAAC;AAC3C,gBAAgB;AAChB,MAAM,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC;AAC/B,gBAAgB;AAChB,MAAM,cAAc,GAAG,MAAM,CAAC,eAAe,CAAC,CAAC;AAC/C,gBAAgB;AAChB,MAAM,WAAW,GAAG,MAAM,CAAC,YAAY,CAAC,CAAC;AACzC,gBAAgB;AAChB,MAAM,iBAAiB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F;IAED,IAAI,oBAAoB,CAAC,UAAU,EAAE;QACnC,oBAAoB,CAAC,EAAE,EAAE,CAAC;KAC3B;AACH,CAAC"} \ No newline at end of file diff --git a/node_modules/mongodb/lib/cmap/connection_pool.js b/node_modules/mongodb/lib/cmap/connection_pool.js new file mode 100644 index 000000000..257572af4 --- /dev/null +++ b/node_modules/mongodb/lib/cmap/connection_pool.js @@ -0,0 +1,497 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ConnectionPool = void 0; +const Denque = require("denque"); +const timers_1 = require("timers"); +const constants_1 = require("../constants"); +const error_1 = require("../error"); +const logger_1 = require("../logger"); +const mongo_types_1 = require("../mongo_types"); +const utils_1 = require("../utils"); +const connect_1 = require("./connect"); +const connection_1 = require("./connection"); +const connection_pool_events_1 = require("./connection_pool_events"); +const errors_1 = require("./errors"); +const metrics_1 = require("./metrics"); +/** @internal */ +const kLogger = Symbol('logger'); +/** @internal */ +const kConnections = Symbol('connections'); +/** @internal */ +const kPending = Symbol('pending'); +/** @internal */ +const kCheckedOut = Symbol('checkedOut'); +/** @internal */ +const kMinPoolSizeTimer = Symbol('minPoolSizeTimer'); +/** @internal */ +const kGeneration = Symbol('generation'); +/** @internal */ +const kServiceGenerations = Symbol('serviceGenerations'); +/** @internal */ +const kConnectionCounter = Symbol('connectionCounter'); +/** @internal */ +const kCancellationToken = Symbol('cancellationToken'); +/** @internal */ +const kWaitQueue = Symbol('waitQueue'); +/** @internal */ +const kCancelled = Symbol('cancelled'); +/** @internal */ +const kMetrics = Symbol('metrics'); +/** @internal */ +const kProcessingWaitQueue = Symbol('processingWaitQueue'); +/** + * A pool of connections which dynamically resizes, and emit events related to pool activity + * @internal + */ +class ConnectionPool extends mongo_types_1.TypedEventEmitter { + /** @internal */ + constructor(options) { + var _a, _b, _c, _d, _e; + super(); + this.closed = false; + this.options = Object.freeze({ + ...options, + connectionType: connection_1.Connection, + maxPoolSize: (_a = options.maxPoolSize) !== null && _a !== void 0 ? _a : 100, + minPoolSize: (_b = options.minPoolSize) !== null && _b !== void 0 ? _b : 0, + maxConnecting: (_c = options.maxConnecting) !== null && _c !== void 0 ? _c : 2, + maxIdleTimeMS: (_d = options.maxIdleTimeMS) !== null && _d !== void 0 ? _d : 0, + waitQueueTimeoutMS: (_e = options.waitQueueTimeoutMS) !== null && _e !== void 0 ? _e : 0, + autoEncrypter: options.autoEncrypter, + metadata: options.metadata + }); + if (this.options.minPoolSize > this.options.maxPoolSize) { + throw new error_1.MongoInvalidArgumentError('Connection pool minimum size must not be greater than maximum pool size'); + } + this[kLogger] = new logger_1.Logger('ConnectionPool'); + this[kConnections] = new Denque(); + this[kPending] = 0; + this[kCheckedOut] = 0; + this[kMinPoolSizeTimer] = undefined; + this[kGeneration] = 0; + this[kServiceGenerations] = new Map(); + this[kConnectionCounter] = (0, utils_1.makeCounter)(1); + this[kCancellationToken] = new mongo_types_1.CancellationToken(); + this[kCancellationToken].setMaxListeners(Infinity); + this[kWaitQueue] = new Denque(); + this[kMetrics] = new metrics_1.ConnectionPoolMetrics(); + this[kProcessingWaitQueue] = false; + process.nextTick(() => { + this.emit(ConnectionPool.CONNECTION_POOL_CREATED, new connection_pool_events_1.ConnectionPoolCreatedEvent(this)); + ensureMinPoolSize(this); + }); + } + /** The address of the endpoint the pool is connected to */ + get address() { + return this.options.hostAddress.toString(); + } + /** An integer representing the SDAM generation of the pool */ + get generation() { + return this[kGeneration]; + } + /** An integer expressing how many total connections (available + pending + in use) the pool currently has */ + get totalConnectionCount() { + return (this.availableConnectionCount + this.pendingConnectionCount + this.currentCheckedOutCount); + } + /** An integer expressing how many connections are currently available in the pool. */ + get availableConnectionCount() { + return this[kConnections].length; + } + get pendingConnectionCount() { + return this[kPending]; + } + get currentCheckedOutCount() { + return this[kCheckedOut]; + } + get waitQueueSize() { + return this[kWaitQueue].length; + } + get loadBalanced() { + return this.options.loadBalanced; + } + get serviceGenerations() { + return this[kServiceGenerations]; + } + /** + * Get the metrics information for the pool when a wait queue timeout occurs. + */ + waitQueueErrorMetrics() { + return this[kMetrics].info(this.options.maxPoolSize); + } + /** + * Check a connection out of this pool. The connection will continue to be tracked, but no reference to it + * will be held by the pool. This means that if a connection is checked out it MUST be checked back in or + * explicitly destroyed by the new owner. + */ + checkOut(callback) { + this.emit(ConnectionPool.CONNECTION_CHECK_OUT_STARTED, new connection_pool_events_1.ConnectionCheckOutStartedEvent(this)); + if (this.closed) { + this.emit(ConnectionPool.CONNECTION_CHECK_OUT_FAILED, new connection_pool_events_1.ConnectionCheckOutFailedEvent(this, 'poolClosed')); + callback(new errors_1.PoolClosedError(this)); + return; + } + const waitQueueMember = { callback }; + const waitQueueTimeoutMS = this.options.waitQueueTimeoutMS; + if (waitQueueTimeoutMS) { + waitQueueMember.timer = (0, timers_1.setTimeout)(() => { + waitQueueMember[kCancelled] = true; + waitQueueMember.timer = undefined; + this.emit(ConnectionPool.CONNECTION_CHECK_OUT_FAILED, new connection_pool_events_1.ConnectionCheckOutFailedEvent(this, 'timeout')); + waitQueueMember.callback(new errors_1.WaitQueueTimeoutError(this.loadBalanced + ? this.waitQueueErrorMetrics() + : 'Timed out while checking out a connection from connection pool', this.address)); + }, waitQueueTimeoutMS); + } + this[kWaitQueue].push(waitQueueMember); + process.nextTick(processWaitQueue, this); + } + /** + * Check a connection into the pool. + * + * @param connection - The connection to check in + */ + checkIn(connection) { + const poolClosed = this.closed; + const stale = connectionIsStale(this, connection); + const willDestroy = !!(poolClosed || stale || connection.closed); + if (!willDestroy) { + connection.markAvailable(); + this[kConnections].unshift(connection); + } + this[kCheckedOut]--; + this.emit(ConnectionPool.CONNECTION_CHECKED_IN, new connection_pool_events_1.ConnectionCheckedInEvent(this, connection)); + if (willDestroy) { + const reason = connection.closed ? 'error' : poolClosed ? 'poolClosed' : 'stale'; + destroyConnection(this, connection, reason); + } + process.nextTick(processWaitQueue, this); + } + /** + * Clear the pool + * + * Pool reset is handled by incrementing the pool's generation count. Any existing connection of a + * previous generation will eventually be pruned during subsequent checkouts. + */ + clear(serviceId) { + if (this.loadBalanced && serviceId) { + const sid = serviceId.toHexString(); + const generation = this.serviceGenerations.get(sid); + // Only need to worry if the generation exists, since it should + // always be there but typescript needs the check. + if (generation == null) { + // TODO(NODE-3483) + throw new error_1.MongoRuntimeError('Service generations are required in load balancer mode.'); + } + else { + // Increment the generation for the service id. + this.serviceGenerations.set(sid, generation + 1); + } + } + else { + this[kGeneration] += 1; + } + this.emit('connectionPoolCleared', new connection_pool_events_1.ConnectionPoolClearedEvent(this, serviceId)); + } + close(_options, _cb) { + let options = _options; + const callback = (_cb !== null && _cb !== void 0 ? _cb : _options); + if (typeof options === 'function') { + options = {}; + } + options = Object.assign({ force: false }, options); + if (this.closed) { + return callback(); + } + // immediately cancel any in-flight connections + this[kCancellationToken].emit('cancel'); + // drain the wait queue + while (this.waitQueueSize) { + const waitQueueMember = this[kWaitQueue].pop(); + if (waitQueueMember) { + if (waitQueueMember.timer) { + clearTimeout(waitQueueMember.timer); + } + if (!waitQueueMember[kCancelled]) { + // TODO(NODE-3483): Replace with MongoConnectionPoolClosedError + waitQueueMember.callback(new error_1.MongoRuntimeError('Connection pool closed')); + } + } + } + // clear the min pool size timer + const minPoolSizeTimer = this[kMinPoolSizeTimer]; + if (minPoolSizeTimer) { + clearTimeout(minPoolSizeTimer); + } + // end the connection counter + if (typeof this[kConnectionCounter].return === 'function') { + this[kConnectionCounter].return(undefined); + } + // mark the pool as closed immediately + this.closed = true; + (0, utils_1.eachAsync)(this[kConnections].toArray(), (conn, cb) => { + this.emit(ConnectionPool.CONNECTION_CLOSED, new connection_pool_events_1.ConnectionClosedEvent(this, conn, 'poolClosed')); + conn.destroy(options, cb); + }, err => { + this[kConnections].clear(); + this.emit(ConnectionPool.CONNECTION_POOL_CLOSED, new connection_pool_events_1.ConnectionPoolClosedEvent(this)); + callback(err); + }); + } + /** + * Runs a lambda with an implicitly checked out connection, checking that connection back in when the lambda + * has completed by calling back. + * + * NOTE: please note the required signature of `fn` + * + * @remarks When in load balancer mode, connections can be pinned to cursors or transactions. + * In these cases we pass the connection in to this method to ensure it is used and a new + * connection is not checked out. + * + * @param conn - A pinned connection for use in load balancing mode. + * @param fn - A function which operates on a managed connection + * @param callback - The original callback + */ + withConnection(conn, fn, callback) { + if (conn) { + // use the provided connection, and do _not_ check it in after execution + fn(undefined, conn, (fnErr, result) => { + if (typeof callback === 'function') { + if (fnErr) { + callback(fnErr); + } + else { + callback(undefined, result); + } + } + }); + return; + } + this.checkOut((err, conn) => { + // don't callback with `err` here, we might want to act upon it inside `fn` + fn(err, conn, (fnErr, result) => { + if (typeof callback === 'function') { + if (fnErr) { + callback(fnErr); + } + else { + callback(undefined, result); + } + } + if (conn) { + this.checkIn(conn); + } + }); + }); + } +} +exports.ConnectionPool = ConnectionPool; +/** + * Emitted when the connection pool is created. + * @event + */ +ConnectionPool.CONNECTION_POOL_CREATED = constants_1.CONNECTION_POOL_CREATED; +/** + * Emitted once when the connection pool is closed + * @event + */ +ConnectionPool.CONNECTION_POOL_CLOSED = constants_1.CONNECTION_POOL_CLOSED; +/** + * Emitted each time the connection pool is cleared and it's generation incremented + * @event + */ +ConnectionPool.CONNECTION_POOL_CLEARED = constants_1.CONNECTION_POOL_CLEARED; +/** + * Emitted when a connection is created. + * @event + */ +ConnectionPool.CONNECTION_CREATED = constants_1.CONNECTION_CREATED; +/** + * Emitted when a connection becomes established, and is ready to use + * @event + */ +ConnectionPool.CONNECTION_READY = constants_1.CONNECTION_READY; +/** + * Emitted when a connection is closed + * @event + */ +ConnectionPool.CONNECTION_CLOSED = constants_1.CONNECTION_CLOSED; +/** + * Emitted when an attempt to check out a connection begins + * @event + */ +ConnectionPool.CONNECTION_CHECK_OUT_STARTED = constants_1.CONNECTION_CHECK_OUT_STARTED; +/** + * Emitted when an attempt to check out a connection fails + * @event + */ +ConnectionPool.CONNECTION_CHECK_OUT_FAILED = constants_1.CONNECTION_CHECK_OUT_FAILED; +/** + * Emitted each time a connection is successfully checked out of the connection pool + * @event + */ +ConnectionPool.CONNECTION_CHECKED_OUT = constants_1.CONNECTION_CHECKED_OUT; +/** + * Emitted each time a connection is successfully checked into the connection pool + * @event + */ +ConnectionPool.CONNECTION_CHECKED_IN = constants_1.CONNECTION_CHECKED_IN; +function ensureMinPoolSize(pool) { + const minPoolSize = pool.options.minPoolSize; + if (pool.closed || minPoolSize === 0) { + return; + } + if (pool.totalConnectionCount < minPoolSize && + pool.pendingConnectionCount < pool.options.maxConnecting) { + // NOTE: ensureMinPoolSize should not try to get all the pending + // connection permits because that potentially delays the availability of + // the connection to a checkout request + createConnection(pool, (err, connection) => { + pool[kPending]--; + if (!err && connection) { + pool[kConnections].push(connection); + process.nextTick(processWaitQueue, pool); + } + pool[kMinPoolSizeTimer] = (0, timers_1.setTimeout)(() => ensureMinPoolSize(pool), 10); + }); + } + else { + pool[kMinPoolSizeTimer] = (0, timers_1.setTimeout)(() => ensureMinPoolSize(pool), 100); + } +} +function connectionIsStale(pool, connection) { + const serviceId = connection.serviceId; + if (pool.loadBalanced && serviceId) { + const sid = serviceId.toHexString(); + const generation = pool.serviceGenerations.get(sid); + return connection.generation !== generation; + } + return connection.generation !== pool[kGeneration]; +} +function connectionIsIdle(pool, connection) { + return !!(pool.options.maxIdleTimeMS && connection.idleTime > pool.options.maxIdleTimeMS); +} +function createConnection(pool, callback) { + const connectOptions = { + ...pool.options, + id: pool[kConnectionCounter].next().value, + generation: pool[kGeneration], + cancellationToken: pool[kCancellationToken] + }; + pool[kPending]++; + // This is our version of a "virtual" no-I/O connection as the spec requires + pool.emit(ConnectionPool.CONNECTION_CREATED, new connection_pool_events_1.ConnectionCreatedEvent(pool, { id: connectOptions.id })); + (0, connect_1.connect)(connectOptions, (err, connection) => { + if (err || !connection) { + pool[kLogger].debug(`connection attempt failed with error [${JSON.stringify(err)}]`); + callback(err); + return; + } + // The pool might have closed since we started trying to create a connection + if (pool.closed) { + pool[kPending]--; + connection.destroy({ force: true }); + return; + } + // forward all events from the connection to the pool + for (const event of [...constants_1.APM_EVENTS, connection_1.Connection.CLUSTER_TIME_RECEIVED]) { + connection.on(event, (e) => pool.emit(event, e)); + } + if (pool.loadBalanced) { + connection.on(connection_1.Connection.PINNED, pinType => pool[kMetrics].markPinned(pinType)); + connection.on(connection_1.Connection.UNPINNED, pinType => pool[kMetrics].markUnpinned(pinType)); + const serviceId = connection.serviceId; + if (serviceId) { + let generation; + const sid = serviceId.toHexString(); + if ((generation = pool.serviceGenerations.get(sid))) { + connection.generation = generation; + } + else { + pool.serviceGenerations.set(sid, 0); + connection.generation = 0; + } + } + } + connection.markAvailable(); + pool.emit(ConnectionPool.CONNECTION_READY, new connection_pool_events_1.ConnectionReadyEvent(pool, connection)); + callback(undefined, connection); + return; + }); +} +function destroyConnection(pool, connection, reason) { + pool.emit(ConnectionPool.CONNECTION_CLOSED, new connection_pool_events_1.ConnectionClosedEvent(pool, connection, reason)); + // destroy the connection + process.nextTick(() => connection.destroy()); +} +function processWaitQueue(pool) { + if (pool.closed || pool[kProcessingWaitQueue]) { + return; + } + pool[kProcessingWaitQueue] = true; + while (pool.waitQueueSize) { + const waitQueueMember = pool[kWaitQueue].peekFront(); + if (!waitQueueMember) { + pool[kWaitQueue].shift(); + continue; + } + if (waitQueueMember[kCancelled]) { + pool[kWaitQueue].shift(); + continue; + } + if (!pool.availableConnectionCount) { + break; + } + const connection = pool[kConnections].shift(); + if (!connection) { + break; + } + const isStale = connectionIsStale(pool, connection); + const isIdle = connectionIsIdle(pool, connection); + if (!isStale && !isIdle && !connection.closed) { + pool[kCheckedOut]++; + pool.emit(ConnectionPool.CONNECTION_CHECKED_OUT, new connection_pool_events_1.ConnectionCheckedOutEvent(pool, connection)); + if (waitQueueMember.timer) { + clearTimeout(waitQueueMember.timer); + } + pool[kWaitQueue].shift(); + waitQueueMember.callback(undefined, connection); + } + else { + const reason = connection.closed ? 'error' : isStale ? 'stale' : 'idle'; + destroyConnection(pool, connection, reason); + } + } + const { maxPoolSize, maxConnecting } = pool.options; + while (pool.waitQueueSize > 0 && + pool.pendingConnectionCount < maxConnecting && + (maxPoolSize === 0 || pool.totalConnectionCount < maxPoolSize)) { + const waitQueueMember = pool[kWaitQueue].shift(); + if (!waitQueueMember || waitQueueMember[kCancelled]) { + continue; + } + createConnection(pool, (err, connection) => { + pool[kPending]--; + if (waitQueueMember[kCancelled]) { + if (!err && connection) { + pool[kConnections].push(connection); + } + } + else { + if (err) { + pool.emit(ConnectionPool.CONNECTION_CHECK_OUT_FAILED, new connection_pool_events_1.ConnectionCheckOutFailedEvent(pool, err)); + } + else if (connection) { + pool[kCheckedOut]++; + pool.emit(ConnectionPool.CONNECTION_CHECKED_OUT, new connection_pool_events_1.ConnectionCheckedOutEvent(pool, connection)); + } + if (waitQueueMember.timer) { + clearTimeout(waitQueueMember.timer); + } + waitQueueMember.callback(err, connection); + } + process.nextTick(processWaitQueue, pool); + }); + } + pool[kProcessingWaitQueue] = false; +} +//# sourceMappingURL=connection_pool.js.map \ No newline at end of file diff --git a/node_modules/mongodb/lib/cmap/connection_pool.js.map b/node_modules/mongodb/lib/cmap/connection_pool.js.map new file mode 100644 index 000000000..d0dd20db2 --- /dev/null +++ b/node_modules/mongodb/lib/cmap/connection_pool.js.map @@ -0,0 +1 @@ +{"version":3,"file":"connection_pool.js","sourceRoot":"","sources":["../../src/cmap/connection_pool.ts"],"names":[],"mappings":";;;AAAA,iCAAkC;AAClC,mCAAoC;AAGpC,4CAYsB;AACtB,oCAAoF;AACpF,sCAAmC;AACnC,gDAAsE;AACtE,oCAA4D;AAC5D,uCAAoC;AACpC,6CAA+E;AAC/E,qEAWkC;AAClC,qCAAkE;AAClE,uCAAkD;AAElD,gBAAgB;AAChB,MAAM,OAAO,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC;AACjC,gBAAgB;AAChB,MAAM,YAAY,GAAG,MAAM,CAAC,aAAa,CAAC,CAAC;AAC3C,gBAAgB;AAChB,MAAM,QAAQ,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC;AACnC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Q,CAAC,gBAAgB,EAAE,IAAI,CAAC,CAAC;QAC3C,CAAC,CAAC,CAAC;KACJ;IACD,IAAI,CAAC,oBAAoB,CAAC,GAAG,KAAK,CAAC;AACrC,CAAC"} \ No newline at end of file diff --git a/node_modules/mongodb/lib/cmap/connection_pool_events.js b/node_modules/mongodb/lib/cmap/connection_pool_events.js new file mode 100644 index 000000000..86aeaef8a --- /dev/null +++ b/node_modules/mongodb/lib/cmap/connection_pool_events.js @@ -0,0 +1,147 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ConnectionPoolClearedEvent = exports.ConnectionCheckedInEvent = exports.ConnectionCheckedOutEvent = exports.ConnectionCheckOutFailedEvent = exports.ConnectionCheckOutStartedEvent = exports.ConnectionClosedEvent = exports.ConnectionReadyEvent = exports.ConnectionCreatedEvent = exports.ConnectionPoolClosedEvent = exports.ConnectionPoolCreatedEvent = exports.ConnectionPoolMonitoringEvent = void 0; +/** + * The base export class for all monitoring events published from the connection pool + * @public + * @category Event + */ +class ConnectionPoolMonitoringEvent { + /** @internal */ + constructor(pool) { + this.time = new Date(); + this.address = pool.address; + } +} +exports.ConnectionPoolMonitoringEvent = ConnectionPoolMonitoringEvent; +/** + * An event published when a connection pool is created + * @public + * @category Event + */ +class ConnectionPoolCreatedEvent extends ConnectionPoolMonitoringEvent { + /** @internal */ + constructor(pool) { + super(pool); + this.options = pool.options; + } +} +exports.ConnectionPoolCreatedEvent = ConnectionPoolCreatedEvent; +/** + * An event published when a connection pool is closed + * @public + * @category Event + */ +class ConnectionPoolClosedEvent extends ConnectionPoolMonitoringEvent { + /** @internal */ + constructor(pool) { + super(pool); + } +} +exports.ConnectionPoolClosedEvent = ConnectionPoolClosedEvent; +/** + * An event published when a connection pool creates a new connection + * @public + * @category Event + */ +class ConnectionCreatedEvent extends ConnectionPoolMonitoringEvent { + /** @internal */ + constructor(pool, connection) { + super(pool); + this.connectionId = connection.id; + } +} +exports.ConnectionCreatedEvent = ConnectionCreatedEvent; +/** + * An event published when a connection is ready for use + * @public + * @category Event + */ +class ConnectionReadyEvent extends ConnectionPoolMonitoringEvent { + /** @internal */ + constructor(pool, connection) { + super(pool); + this.connectionId = connection.id; + } +} +exports.ConnectionReadyEvent = ConnectionReadyEvent; +/** + * An event published when a connection is closed + * @public + * @category Event + */ +class ConnectionClosedEvent extends ConnectionPoolMonitoringEvent { + /** @internal */ + constructor(pool, connection, reason) { + super(pool); + this.connectionId = connection.id; + this.reason = reason || 'unknown'; + this.serviceId = connection.serviceId; + } +} +exports.ConnectionClosedEvent = ConnectionClosedEvent; +/** + * An event published when a request to check a connection out begins + * @public + * @category Event + */ +class ConnectionCheckOutStartedEvent extends ConnectionPoolMonitoringEvent { + /** @internal */ + constructor(pool) { + super(pool); + } +} +exports.ConnectionCheckOutStartedEvent = ConnectionCheckOutStartedEvent; +/** + * An event published when a request to check a connection out fails + * @public + * @category Event + */ +class ConnectionCheckOutFailedEvent extends ConnectionPoolMonitoringEvent { + /** @internal */ + constructor(pool, reason) { + super(pool); + this.reason = reason; + } +} +exports.ConnectionCheckOutFailedEvent = ConnectionCheckOutFailedEvent; +/** + * An event published when a connection is checked out of the connection pool + * @public + * @category Event + */ +class ConnectionCheckedOutEvent extends ConnectionPoolMonitoringEvent { + /** @internal */ + constructor(pool, connection) { + super(pool); + this.connectionId = connection.id; + } +} +exports.ConnectionCheckedOutEvent = ConnectionCheckedOutEvent; +/** + * An event published when a connection is checked into the connection pool + * @public + * @category Event + */ +class ConnectionCheckedInEvent extends ConnectionPoolMonitoringEvent { + /** @internal */ + constructor(pool, connection) { + super(pool); + this.connectionId = connection.id; + } +} +exports.ConnectionCheckedInEvent = ConnectionCheckedInEvent; +/** + * An event published when a connection pool is cleared + * @public + * @category Event + */ +class ConnectionPoolClearedEvent extends ConnectionPoolMonitoringEvent { + /** @internal */ + constructor(pool, serviceId) { + super(pool); + this.serviceId = serviceId; + } +} +exports.ConnectionPoolClearedEvent = ConnectionPoolClearedEvent; +//# sourceMappingURL=connection_pool_events.js.map \ No newline at end of file diff --git a/node_modules/mongodb/lib/cmap/connection_pool_events.js.map b/node_modules/mongodb/lib/cmap/connection_pool_events.js.map new file mode 100644 index 000000000..47ecacd5a --- /dev/null +++ b/node_modules/mongodb/lib/cmap/connection_pool_events.js.map @@ -0,0 +1 @@ +{"version":3,"file":"connection_pool_events.js","sourceRoot":"","sources":["../../src/cmap/connection_pool_events.ts"],"names":[],"mappings":";;;AAKA;;;;GAIG;AACH,MAAa,6BAA6B;IAMxC,gBAAgB;IAChB,YAAY,IAAoB;QAC9B,IAAI,CAAC,IAAI,GAAG,IAAI,IAAI,EAAE,CAAC;QACvB,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC;IAC9B,CAAC;CACF;AAXD,sEAWC;AAED;;;;GAIG;AACH,MAAa,0BAA2B,SAAQ,6BAA6B;IAI3E,gBAAgB;IAChB,YAAY,IAAoB;QAC9B,KAAK,CAAC,IAAI,CAAC,CAAC;QACZ,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC;IAC9B,CAAC;CACF;AATD,gEASC;AAED;;;;GAIG;AACH,MAAa,yBAA0B,SAAQ,6BAA6B;IAC1E,gBAAgB;IAChB,YAAY,IAAoB;QAC9B,KAAK,CAAC,IAAI,CAAC,CAAC;IACd,CAAC;CACF;AALD,8DAKC;AAED;;;;GAIG;AACH,MAAa,sBAAuB,SAAQ,6BAA6B;IAIvE,gBAAgB;IAChB,YAAY,IAAoB,EAAE,UAAwC;QACxE,KAAK,CAAC,IAAI,CAAC,CAAC;QACZ,IAAI,CAAC,YAAY,GAAG,UAAU,CAAC,EAAE,CAAC;IACpC,CAAC;CACF;AATD,wDASC;AAED;;;;GAIG;AACH,MAAa,oBAAqB,SAAQ,6BAA6B;IAIrE,gBAAgB;IAChB,YAAY,IAAoB,EAAE,UAAsB;QACtD,KAAK,CAAC,IAAI,CAAC,CAAC;QACZ,IAAI,CAAC,YAAY,GAAG,UAAU,CAAC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,YAAY,IAAoB,EAAE,SAAoB;QACpD,KAAK,CAAC,IAAI,CAAC,CAAC;QACZ,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;IAC7B,CAAC;CACF;AATD,gEASC"} \ No newline at end of file diff --git a/node_modules/mongodb/lib/cmap/errors.js b/node_modules/mongodb/lib/cmap/errors.js new file mode 100644 index 000000000..63112628a --- /dev/null +++ b/node_modules/mongodb/lib/cmap/errors.js @@ -0,0 +1,33 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.WaitQueueTimeoutError = exports.PoolClosedError = void 0; +const error_1 = require("../error"); +/** + * An error indicating a connection pool is closed + * @category Error + */ +class PoolClosedError extends error_1.MongoDriverError { + constructor(pool) { + super('Attempted to check out a connection from closed connection pool'); + this.address = pool.address; + } + get name() { + return 'MongoPoolClosedError'; + } +} +exports.PoolClosedError = PoolClosedError; +/** + * An error thrown when a request to check out a connection times out + * @category Error + */ +class WaitQueueTimeoutError extends error_1.MongoDriverError { + constructor(message, address) { + super(message); + this.address = address; + } + get name() { + return 'MongoWaitQueueTimeoutError'; + } +} +exports.WaitQueueTimeoutError = WaitQueueTimeoutError; +//# sourceMappingURL=errors.js.map \ No newline at end of file diff --git a/node_modules/mongodb/lib/cmap/errors.js.map b/node_modules/mongodb/lib/cmap/errors.js.map new file mode 100644 index 000000000..ae7e49659 --- /dev/null +++ b/node_modules/mongodb/lib/cmap/errors.js.map @@ -0,0 +1 @@ +{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/cmap/errors.ts"],"names":[],"mappings":";;;AAAA,oCAA4C;AAG5C;;;GAGG;AACH,MAAa,eAAgB,SAAQ,wBAAgB;IAInD,YAAY,IAAoB;QAC9B,KAAK,CAAC,iEAAiE,CAAC,CAAC;QACzE,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC;IAC9B,CAAC;IAED,IAAa,IAAI;QACf,OAAO,sBAAsB,CAAC;IAChC,CAAC;CACF;AAZD,0CAYC;AAED;;;GAGG;AACH,MAAa,qBAAsB,SAAQ,wBAAgB;IAIzD,YAAY,OAAe,EAAE,OAAe;QAC1C,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;IAED,IAAa,IAAI;QACf,OAAO,4BAA4B,CAAC;IACtC,CAAC;CACF;AAZD,sDAYC"} \ No newline at end of file diff --git a/node_modules/mongodb/lib/cmap/message_stream.js b/node_modules/mongodb/lib/cmap/message_stream.js new file mode 100644 index 000000000..de7e7d7a5 --- /dev/null +++ b/node_modules/mongodb/lib/cmap/message_stream.js @@ -0,0 +1,175 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.MessageStream = void 0; +const stream_1 = require("stream"); +const error_1 = require("../error"); +const utils_1 = require("../utils"); +const commands_1 = require("./commands"); +const compression_1 = require("./wire_protocol/compression"); +const constants_1 = require("./wire_protocol/constants"); +const MESSAGE_HEADER_SIZE = 16; +const COMPRESSION_DETAILS_SIZE = 9; // originalOpcode + uncompressedSize, compressorID +const kDefaultMaxBsonMessageSize = 1024 * 1024 * 16 * 4; +/** @internal */ +const kBuffer = Symbol('buffer'); +/** + * A duplex stream that is capable of reading and writing raw wire protocol messages, with + * support for optional compression + * @internal + */ +class MessageStream extends stream_1.Duplex { + constructor(options = {}) { + super(options); + /** @internal */ + this.isMonitoringConnection = false; + this.maxBsonMessageSize = options.maxBsonMessageSize || kDefaultMaxBsonMessageSize; + this[kBuffer] = new utils_1.BufferPool(); + } + get buffer() { + return this[kBuffer]; + } + _write(chunk, _, callback) { + this[kBuffer].append(chunk); + processIncomingData(this, callback); + } + _read( /* size */) { + // NOTE: This implementation is empty because we explicitly push data to be read + // when `writeMessage` is called. + return; + } + writeCommand(command, operationDescription) { + // TODO: agreed compressor should live in `StreamDescription` + const compressorName = operationDescription && operationDescription.agreedCompressor + ? operationDescription.agreedCompressor + : 'none'; + if (compressorName === 'none' || !canCompress(command)) { + const data = command.toBin(); + this.push(Array.isArray(data) ? Buffer.concat(data) : data); + return; + } + // otherwise, compress the message + const concatenatedOriginalCommandBuffer = Buffer.concat(command.toBin()); + const messageToBeCompressed = concatenatedOriginalCommandBuffer.slice(MESSAGE_HEADER_SIZE); + // Extract information needed for OP_COMPRESSED from the uncompressed message + const originalCommandOpCode = concatenatedOriginalCommandBuffer.readInt32LE(12); + // Compress the message body + (0, compression_1.compress)({ options: operationDescription }, messageToBeCompressed, (err, compressedMessage) => { + if (err || !compressedMessage) { + operationDescription.cb(err); + return; + } + // Create the msgHeader of OP_COMPRESSED + const msgHeader = Buffer.alloc(MESSAGE_HEADER_SIZE); + msgHeader.writeInt32LE(MESSAGE_HEADER_SIZE + COMPRESSION_DETAILS_SIZE + compressedMessage.length, 0); // messageLength + msgHeader.writeInt32LE(command.requestId, 4); // requestID + msgHeader.writeInt32LE(0, 8); // responseTo (zero) + msgHeader.writeInt32LE(constants_1.OP_COMPRESSED, 12); // opCode + // Create the compression details of OP_COMPRESSED + const compressionDetails = Buffer.alloc(COMPRESSION_DETAILS_SIZE); + compressionDetails.writeInt32LE(originalCommandOpCode, 0); // originalOpcode + compressionDetails.writeInt32LE(messageToBeCompressed.length, 4); // Size of the uncompressed compressedMessage, excluding the MsgHeader + compressionDetails.writeUInt8(compression_1.Compressor[compressorName], 8); // compressorID + this.push(Buffer.concat([msgHeader, compressionDetails, compressedMessage])); + }); + } +} +exports.MessageStream = MessageStream; +// Return whether a command contains an uncompressible command term +// Will return true if command contains no uncompressible command terms +function canCompress(command) { + const commandDoc = command instanceof commands_1.Msg ? command.command : command.query; + const commandName = Object.keys(commandDoc)[0]; + return !compression_1.uncompressibleCommands.has(commandName); +} +function processIncomingData(stream, callback) { + const buffer = stream[kBuffer]; + if (buffer.length < 4) { + callback(); + return; + } + const sizeOfMessage = buffer.peek(4).readInt32LE(); + if (sizeOfMessage < 0) { + callback(new error_1.MongoParseError(`Invalid message size: ${sizeOfMessage}`)); + return; + } + if (sizeOfMessage > stream.maxBsonMessageSize) { + callback(new error_1.MongoParseError(`Invalid message size: ${sizeOfMessage}, max allowed: ${stream.maxBsonMessageSize}`)); + return; + } + if (sizeOfMessage > buffer.length) { + callback(); + return; + } + const message = buffer.read(sizeOfMessage); + const messageHeader = { + length: message.readInt32LE(0), + requestId: message.readInt32LE(4), + responseTo: message.readInt32LE(8), + opCode: message.readInt32LE(12) + }; + const monitorHasAnotherHello = () => { + if (stream.isMonitoringConnection) { + // Can we read the next message size? + if (buffer.length >= 4) { + const sizeOfMessage = buffer.peek(4).readInt32LE(); + if (sizeOfMessage <= buffer.length) { + return true; + } + } + } + return false; + }; + let ResponseType = messageHeader.opCode === constants_1.OP_MSG ? commands_1.BinMsg : commands_1.Response; + if (messageHeader.opCode !== constants_1.OP_COMPRESSED) { + const messageBody = message.slice(MESSAGE_HEADER_SIZE); + // If we are a monitoring connection message stream and + // there is more in the buffer that can be read, skip processing since we + // want the last hello command response that is in the buffer. + if (monitorHasAnotherHello()) { + processIncomingData(stream, callback); + } + else { + stream.emit('message', new ResponseType(message, messageHeader, messageBody)); + if (buffer.length >= 4) { + processIncomingData(stream, callback); + } + else { + callback(); + } + } + return; + } + messageHeader.fromCompressed = true; + messageHeader.opCode = message.readInt32LE(MESSAGE_HEADER_SIZE); + messageHeader.length = message.readInt32LE(MESSAGE_HEADER_SIZE + 4); + const compressorID = message[MESSAGE_HEADER_SIZE + 8]; + const compressedBuffer = message.slice(MESSAGE_HEADER_SIZE + 9); + // recalculate based on wrapped opcode + ResponseType = messageHeader.opCode === constants_1.OP_MSG ? commands_1.BinMsg : commands_1.Response; + (0, compression_1.decompress)(compressorID, compressedBuffer, (err, messageBody) => { + if (err || !messageBody) { + callback(err); + return; + } + if (messageBody.length !== messageHeader.length) { + callback(new error_1.MongoDecompressionError('Message body and message header must be the same length')); + return; + } + // If we are a monitoring connection message stream and + // there is more in the buffer that can be read, skip processing since we + // want the last hello command response that is in the buffer. + if (monitorHasAnotherHello()) { + processIncomingData(stream, callback); + } + else { + stream.emit('message', new ResponseType(message, messageHeader, messageBody)); + if (buffer.length >= 4) { + processIncomingData(stream, callback); + } + else { + callback(); + } + } + }); +} +//# sourceMappingURL=message_stream.js.map \ No newline at end of file diff --git a/node_modules/mongodb/lib/cmap/message_stream.js.map b/node_modules/mongodb/lib/cmap/message_stream.js.map new file mode 100644 index 000000000..e2aa88dc6 --- /dev/null +++ b/node_modules/mongodb/lib/cmap/message_stream.js.map @@ -0,0 +1 @@ +{"version":3,"file":"message_stream.js","sourceRoot":"","sources":["../../src/cmap/message_stream.ts"],"names":[],"mappings":";;;AAAA,mCAA+C;AAG/C,oCAAoE;AAEpE,oCAAgD;AAChD,yCAAmG;AACnG,6DAMqC;AACrC,yDAAkE;AAElE,MAAM,mBAAmB,GAAG,EAAE,CAAC;AAC/B,MAAM,wBAAwB,GAAG,CAAC,CAAC,CAAC,kDAAkD;AAEtF,MAAM,0BAA0B,GAAG,IAAI,GAAG,IAAI,GAAG,EAAE,GAAG,CAAC,CAAC;AACxD,gBAAgB;AAChB,MAAM,OAAO,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC;AAwBjC;;;;GAIG;AACH,MAAa,aAAc,SAAQ,eAAM;IAQvC,YAAY,UAAgC,EAAE;QAC5C,KAAK,CAAC,OAAO,CAAC,CAAC;QAJjB,gBAAgB;QAChB,2BAAsB,GAAG,KAAK,CAAC;QAI7B,IAAI,CAAC,kBAAkB,GAAG,OAAO,CAAC,kBAAkB,IAAI,0BAA0B,CAAC;QACnF,IAAI,CAAC,OAAO,CAAC,GAAG,IAAI,kBAAU,EAAE,CAAC;IACnC,CAAC;IAED,IAAI,MAAM;QACR,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC;IACvB,CAAC;IAEQ,MAAM,CAAC,KAAa,EAAE,CAAU,EAAE,QAA0B;QACnE,IAAI,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QAC5B,mBAAmB,CAAC,IAAI,EAAE,QAAQ,CAA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,EAAE,WAAW,EAAE,EAAE;QAC9D,IAAI,GAAG,IAAI,CAAC,WAAW,EAAE;YACvB,QAAQ,CAAC,GAAG,CAAC,CAAC;YACd,OAAO;SACR;QAED,IAAI,WAAW,CAAC,MAAM,KAAK,aAAa,CAAC,MAAM,EAAE;YAC/C,QAAQ,CACN,IAAI,+BAAuB,CAAC,yDAAyD,CAAC,CACvF,CAAC;YAEF,OAAO;SACR;QAED,uDAAuD;QACvD,yEAAyE;QACzE,8DAA8D;QAC9D,IAAI,sBAAsB,EAAE,EAAE;YAC5B,mBAAmB,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;SACvC;aAAM;YACL,MAAM,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,YAAY,CAAC,OAAO,EAAE,aAAa,EAAE,WAAW,CAAC,CAAC,CAAC;YAE9E,IAAI,MAAM,CAAC,MAAM,IAAI,CAAC,EAAE;gBACtB,mBAAmB,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;aACvC;iBAAM;gBACL,QAAQ,EAAE,CAAC;aACZ;SACF;IACH,CAAC,CAAC,CAAC;AACL,CAAC"} \ No newline at end of file diff --git a/node_modules/mongodb/lib/cmap/metrics.js b/node_modules/mongodb/lib/cmap/metrics.js new file mode 100644 index 000000000..89c221091 --- /dev/null +++ b/node_modules/mongodb/lib/cmap/metrics.js @@ -0,0 +1,62 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ConnectionPoolMetrics = void 0; +/** @internal */ +class ConnectionPoolMetrics { + constructor() { + this.txnConnections = 0; + this.cursorConnections = 0; + this.otherConnections = 0; + } + /** + * Mark a connection as pinned for a specific operation. + */ + markPinned(pinType) { + if (pinType === ConnectionPoolMetrics.TXN) { + this.txnConnections += 1; + } + else if (pinType === ConnectionPoolMetrics.CURSOR) { + this.cursorConnections += 1; + } + else { + this.otherConnections += 1; + } + } + /** + * Unmark a connection as pinned for an operation. + */ + markUnpinned(pinType) { + if (pinType === ConnectionPoolMetrics.TXN) { + this.txnConnections -= 1; + } + else if (pinType === ConnectionPoolMetrics.CURSOR) { + this.cursorConnections -= 1; + } + else { + this.otherConnections -= 1; + } + } + /** + * Return information about the cmap metrics as a string. + */ + info(maxPoolSize) { + return ('Timed out while checking out a connection from connection pool: ' + + `maxPoolSize: ${maxPoolSize}, ` + + `connections in use by cursors: ${this.cursorConnections}, ` + + `connections in use by transactions: ${this.txnConnections}, ` + + `connections in use by other operations: ${this.otherConnections}`); + } + /** + * Reset the metrics to the initial values. + */ + reset() { + this.txnConnections = 0; + this.cursorConnections = 0; + this.otherConnections = 0; + } +} +exports.ConnectionPoolMetrics = ConnectionPoolMetrics; +ConnectionPoolMetrics.TXN = 'txn'; +ConnectionPoolMetrics.CURSOR = 'cursor'; +ConnectionPoolMetrics.OTHER = 'other'; +//# sourceMappingURL=metrics.js.map \ No newline at end of file diff --git a/node_modules/mongodb/lib/cmap/metrics.js.map b/node_modules/mongodb/lib/cmap/metrics.js.map new file mode 100644 index 000000000..270cefe79 --- /dev/null +++ b/node_modules/mongodb/lib/cmap/metrics.js.map @@ -0,0 +1 @@ +{"version":3,"file":"metrics.js","sourceRoot":"","sources":["../../src/cmap/metrics.ts"],"names":[],"mappings":";;;AAAA,gBAAgB;AAChB,MAAa,qBAAqB;IAAlC;QAKE,mBAAc,GAAG,CAAC,CAAC;QACnB,sBAAiB,GAAG,CAAC,CAAC;QACtB,qBAAgB,GAAG,CAAC,CAAC;IAiDvB,CAAC;IA/CC;;OAEG;IACH,UAAU,CAAC,OAAe;QACxB,IAAI,OAAO,KAAK,qBAAqB,CAAC,GAAG,EAAE;YACzC,IAAI,CAAC,cAAc,IAAI,CAAC,CAAC;SAC1B;aAAM,IAAI,OAAO,KAAK,qBAAqB,CAAC,MAAM,EAAE;YACnD,IAAI,CAAC,iBAAiB,IAAI,CAAC,CAAC;SAC7B;aAAM;YACL,IAAI,CAAC,gBAAgB,IAAI,CAAC,CAAC;SAC5B;IACH,CAAC;IAED;;OAEG;IACH,YAAY,CAAC,OAAe;QAC1B,IAAI,OAAO,KAAK,qBAAqB,CAAC,GAAG,EAAE;YACzC,IAAI,CAAC,cAAc,IAAI,CAAC,CAAC;SAC1B;aAAM,IAAI,OAAO,KAAK,qBAAqB,CAAC,MAAM,EAAE;YACnD,IAAI,CAAC,iBAAiB,IAAI,CAAC,CAAC;SAC7B;aAAM;YACL,IAAI,CAAC,gBAAgB,IAAI,CAAC,CAAC;SAC5B;IACH,CAAC;IAED;;OAEG;IACH,IAAI,CAAC,WAAmB;QACtB,OAAO,CACL,kEAAkE;YAClE,gBAAgB,WAAW,IAAI;YAC/B,kCAAkC,IAAI,CAAC,iBAAiB,IAAI;YAC5D,uCAAuC,IAAI,CAAC,cAAc,IAAI;YAC9D,2CAA2C,IAAI,CAAC,gBAAgB,EAAE,CACnE,CAAC;IACJ,CAAC;IAED;;OAEG;IACH,KAAK;QACH,IAAI,CAAC,cAAc,GAAG,CAAC,CAAC;QACxB,IAAI,CAAC,iBAAiB,GAAG,CAAC,CAAC;QAC3B,IAAI,CAAC,gBAAgB,GAAG,CAAC,CAAC;IAC5B,CAAC;;AAvDH,sDAwDC;AAvDiB,yBAAG,GAAG,KAAc,CAAC;AACrB,4BAAM,GAAG,QAAiB,CAAC;AAC3B,2BAAK,GAAG,OAAgB,CAAC"} \ No newline at end of file diff --git a/node_modules/mongodb/lib/cmap/stream_description.js b/node_modules/mongodb/lib/cmap/stream_description.js new file mode 100644 index 000000000..4d4eb3293 --- /dev/null +++ b/node_modules/mongodb/lib/cmap/stream_description.js @@ -0,0 +1,51 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.StreamDescription = void 0; +const common_1 = require("../sdam/common"); +const server_description_1 = require("../sdam/server_description"); +const RESPONSE_FIELDS = [ + 'minWireVersion', + 'maxWireVersion', + 'maxBsonObjectSize', + 'maxMessageSizeBytes', + 'maxWriteBatchSize', + 'logicalSessionTimeoutMinutes' +]; +/** @public */ +class StreamDescription { + constructor(address, options) { + this.address = address; + this.type = common_1.ServerType.Unknown; + this.minWireVersion = undefined; + this.maxWireVersion = undefined; + this.maxBsonObjectSize = 16777216; + this.maxMessageSizeBytes = 48000000; + this.maxWriteBatchSize = 100000; + this.logicalSessionTimeoutMinutes = options === null || options === void 0 ? void 0 : options.logicalSessionTimeoutMinutes; + this.loadBalanced = !!(options === null || options === void 0 ? void 0 : options.loadBalanced); + this.compressors = + options && options.compressors && Array.isArray(options.compressors) + ? options.compressors + : []; + } + receiveResponse(response) { + if (response == null) { + return; + } + this.type = (0, server_description_1.parseServerType)(response); + for (const field of RESPONSE_FIELDS) { + if (response[field] != null) { + this[field] = response[field]; + } + // testing case + if ('__nodejs_mock_server__' in response) { + this.__nodejs_mock_server__ = response['__nodejs_mock_server__']; + } + } + if (response.compression) { + this.compressor = this.compressors.filter(c => { var _a; return (_a = response.compression) === null || _a === void 0 ? void 0 : _a.includes(c); })[0]; + } + } +} +exports.StreamDescription = StreamDescription; +//# sourceMappingURL=stream_description.js.map \ No newline at end of file diff --git a/node_modules/mongodb/lib/cmap/stream_description.js.map b/node_modules/mongodb/lib/cmap/stream_description.js.map new file mode 100644 index 000000000..1cebe013f --- /dev/null +++ b/node_modules/mongodb/lib/cmap/stream_description.js.map @@ -0,0 +1 @@ +{"version":3,"file":"stream_description.js","sourceRoot":"","sources":["../../src/cmap/stream_description.ts"],"names":[],"mappings":";;;AACA,2CAA4C;AAC5C,mEAA6D;AAG7D,MAAM,eAAe,GAAG;IACtB,gBAAgB;IAChB,gBAAgB;IAChB,mBAAmB;IACnB,qBAAqB;IACrB,mBAAmB;IACnB,8BAA8B;CACtB,CAAC;AASX,cAAc;AACd,MAAa,iBAAiB;IAiB5B,YAAY,OAAe,EAAE,OAAkC;QAC7D,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,IAAI,GAAG,mBAAU,CAAC,OAAO,CAAC;QAC/B,IAAI,CAAC,cAAc,GAAG,SAAS,CAAC;QAChC,IAAI,CA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IACH,CAAC;CACF;AArDD,8CAqDC"} \ No newline at end of file diff --git a/node_modules/mongodb/lib/cmap/wire_protocol/compression.js b/node_modules/mongodb/lib/cmap/wire_protocol/compression.js new file mode 100644 index 000000000..1bd17a369 --- /dev/null +++ b/node_modules/mongodb/lib/cmap/wire_protocol/compression.js @@ -0,0 +1,100 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.decompress = exports.compress = exports.uncompressibleCommands = exports.Compressor = void 0; +const zlib = require("zlib"); +const constants_1 = require("../../constants"); +const deps_1 = require("../../deps"); +const error_1 = require("../../error"); +/** @public */ +exports.Compressor = Object.freeze({ + none: 0, + snappy: 1, + zlib: 2, + zstd: 3 +}); +exports.uncompressibleCommands = new Set([ + constants_1.LEGACY_HELLO_COMMAND, + 'saslStart', + 'saslContinue', + 'getnonce', + 'authenticate', + 'createUser', + 'updateUser', + 'copydbSaslStart', + 'copydbgetnonce', + 'copydb' +]); +const MAX_COMPRESSOR_ID = 3; +const ZSTD_COMPRESSION_LEVEL = 3; +// Facilitate compressing a message using an agreed compressor +function compress(self, dataToBeCompressed, callback) { + const zlibOptions = {}; + switch (self.options.agreedCompressor) { + case 'snappy': { + if ('kModuleError' in deps_1.Snappy) { + return callback(deps_1.Snappy['kModuleError']); + } + if (deps_1.Snappy[deps_1.PKG_VERSION].major <= 6) { + deps_1.Snappy.compress(dataToBeCompressed, callback); + } + else { + deps_1.Snappy.compress(dataToBeCompressed) + .then(buffer => callback(undefined, buffer)) + .catch(error => callback(error)); + } + break; + } + case 'zlib': + // Determine zlibCompressionLevel + if (self.options.zlibCompressionLevel) { + zlibOptions.level = self.options.zlibCompressionLevel; + } + zlib.deflate(dataToBeCompressed, zlibOptions, callback); + break; + case 'zstd': + if ('kModuleError' in deps_1.ZStandard) { + return callback(deps_1.ZStandard['kModuleError']); + } + deps_1.ZStandard.compress(dataToBeCompressed, ZSTD_COMPRESSION_LEVEL).then(buffer => callback(undefined, buffer), error => callback(error)); + break; + default: + throw new error_1.MongoInvalidArgumentError(`Unknown compressor ${self.options.agreedCompressor} failed to compress`); + } +} +exports.compress = compress; +// Decompress a message using the given compressor +function decompress(compressorID, compressedData, callback) { + if (compressorID < 0 || compressorID > MAX_COMPRESSOR_ID) { + throw new error_1.MongoDecompressionError(`Server sent message compressed using an unsupported compressor. (Received compressor ID ${compressorID})`); + } + switch (compressorID) { + case exports.Compressor.snappy: { + if ('kModuleError' in deps_1.Snappy) { + return callback(deps_1.Snappy['kModuleError']); + } + if (deps_1.Snappy[deps_1.PKG_VERSION].major <= 6) { + deps_1.Snappy.uncompress(compressedData, { asBuffer: true }, callback); + } + else { + deps_1.Snappy.uncompress(compressedData, { asBuffer: true }) + .then(buffer => callback(undefined, buffer)) + .catch(error => callback(error)); + } + break; + } + case exports.Compressor.zstd: { + if ('kModuleError' in deps_1.ZStandard) { + return callback(deps_1.ZStandard['kModuleError']); + } + deps_1.ZStandard.decompress(compressedData).then(buffer => callback(undefined, buffer), error => callback(error)); + break; + } + case exports.Compressor.zlib: + zlib.inflate(compressedData, callback); + break; + default: + callback(undefined, compressedData); + } +} +exports.decompress = decompress; +//# sourceMappingURL=compression.js.map \ No newline at end of file diff --git a/node_modules/mongodb/lib/cmap/wire_protocol/compression.js.map b/node_modules/mongodb/lib/cmap/wire_protocol/compression.js.map new file mode 100644 index 000000000..113379734 --- /dev/null +++ b/node_modules/mongodb/lib/cmap/wire_protocol/compression.js.map @@ -0,0 +1 @@ +{"version":3,"file":"compression.js","sourceRoot":"","sources":["../../../src/cmap/wire_protocol/compression.ts"],"names":[],"mappings":";;;AAAA,6BAA6B;AAE7B,+CAAuD;AACvD,qCAA4D;AAC5D,uCAAiF;AAIjF,cAAc;AACD,QAAA,UAAU,GAAG,MAAM,CAAC,MAAM,CAAC;IACtC,IAAI,EAAE,CAAC;IACP,MAAM,EAAE,CAAC;IACT,IAAI,EAAE,CAAC;IACP,IAAI,EAAE,CAAC;CACC,CAAC,CAAC;AAQC,QAAA,sBAAsB,GA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D,MAAM;SACP;QACD,KAAK,kBAAU,CAAC,IAAI,CAAC,CAAC;YACpB,IAAI,cAAc,IAAI,gBAAS,EAAE;gBAC/B,OAAO,QAAQ,CAAC,gBAAS,CAAC,cAAc,CAAC,CAAC,CAAC;aAC5C;YAED,gBAAS,CAAC,UAAU,CAAC,cAAc,CAAC,CAAC,IAAI,CACvC,MAAM,CAAC,EAAE,CAAC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC,EACrC,KAAK,CAAC,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,CACzB,CAAC;YACF,MAAM;SACP;QACD,KAAK,kBAAU,CAAC,IAAI;YAClB,IAAI,CAAC,OAAO,CAAC,cAAc,EAAE,QAAiC,CAAC,CAAC;YAChE,MAAM;QACR;YACE,QAAQ,CAAC,SAAS,EAAE,cAAc,CAAC,CAAC;KACvC;AACH,CAAC;AA3CD,gCA2CC"} \ No newline at end of file diff --git a/node_modules/mongodb/lib/cmap/wire_protocol/constants.js b/node_modules/mongodb/lib/cmap/wire_protocol/constants.js new file mode 100644 index 000000000..ee5de73aa --- /dev/null +++ b/node_modules/mongodb/lib/cmap/wire_protocol/constants.js @@ -0,0 +1,17 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.OP_MSG = exports.OP_COMPRESSED = exports.OP_KILL_CURSORS = exports.OP_DELETE = exports.OP_GETMORE = exports.OP_QUERY = exports.OP_INSERT = exports.OP_UPDATE = exports.OP_REPLY = exports.MAX_SUPPORTED_WIRE_VERSION = exports.MIN_SUPPORTED_WIRE_VERSION = exports.MAX_SUPPORTED_SERVER_VERSION = exports.MIN_SUPPORTED_SERVER_VERSION = void 0; +exports.MIN_SUPPORTED_SERVER_VERSION = '3.6'; +exports.MAX_SUPPORTED_SERVER_VERSION = '6.0'; +exports.MIN_SUPPORTED_WIRE_VERSION = 6; +exports.MAX_SUPPORTED_WIRE_VERSION = 17; +exports.OP_REPLY = 1; +exports.OP_UPDATE = 2001; +exports.OP_INSERT = 2002; +exports.OP_QUERY = 2004; +exports.OP_GETMORE = 2005; +exports.OP_DELETE = 2006; +exports.OP_KILL_CURSORS = 2007; +exports.OP_COMPRESSED = 2012; +exports.OP_MSG = 2013; +//# sourceMappingURL=constants.js.map \ No newline at end of file diff --git a/node_modules/mongodb/lib/cmap/wire_protocol/constants.js.map b/node_modules/mongodb/lib/cmap/wire_protocol/constants.js.map new file mode 100644 index 000000000..9dc053b22 --- /dev/null +++ b/node_modules/mongodb/lib/cmap/wire_protocol/constants.js.map @@ -0,0 +1 @@ +{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/cmap/wire_protocol/constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,4BAA4B,GAAG,KAAK,CAAC;AACrC,QAAA,4BAA4B,GAAG,KAAK,CAAC;AACrC,QAAA,0BAA0B,GAAG,CAAC,CAAC;AAC/B,QAAA,0BAA0B,GAAG,EAAE,CAAC;AAChC,QAAA,QAAQ,GAAG,CAAC,CAAC;AACb,QAAA,SAAS,GAAG,IAAI,CAAC;AACjB,QAAA,SAAS,GAAG,IAAI,CAAC;AACjB,QAAA,QAAQ,GAAG,IAAI,CAAC;AAChB,QAAA,UAAU,GAAG,IAAI,CAAC;AAClB,QAAA,SAAS,GAAG,IAAI,CAAC;AACjB,QAAA,eAAe,GAAG,IAAI,CAAC;AACvB,QAAA,aAAa,GAAG,IAAI,CAAC;AACrB,QAAA,MAAM,GAAG,IAAI,CAAC"} \ No newline at end of file diff --git a/node_modules/mongodb/lib/cmap/wire_protocol/shared.js b/node_modules/mongodb/lib/cmap/wire_protocol/shared.js new file mode 100644 index 000000000..b5d127828 --- /dev/null +++ b/node_modules/mongodb/lib/cmap/wire_protocol/shared.js @@ -0,0 +1,55 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.isSharded = exports.applyCommonQueryOptions = exports.getReadPreference = void 0; +const error_1 = require("../../error"); +const read_preference_1 = require("../../read_preference"); +const common_1 = require("../../sdam/common"); +const topology_description_1 = require("../../sdam/topology_description"); +function getReadPreference(cmd, options) { + // Default to command version of the readPreference + let readPreference = cmd.readPreference || read_preference_1.ReadPreference.primary; + // If we have an option readPreference override the command one + if (options === null || options === void 0 ? void 0 : options.readPreference) { + readPreference = options.readPreference; + } + if (typeof readPreference === 'string') { + readPreference = read_preference_1.ReadPreference.fromString(readPreference); + } + if (!(readPreference instanceof read_preference_1.ReadPreference)) { + throw new error_1.MongoInvalidArgumentError('Option "readPreference" must be a ReadPreference instance'); + } + return readPreference; +} +exports.getReadPreference = getReadPreference; +function applyCommonQueryOptions(queryOptions, options) { + Object.assign(queryOptions, { + raw: typeof options.raw === 'boolean' ? options.raw : false, + promoteLongs: typeof options.promoteLongs === 'boolean' ? options.promoteLongs : true, + promoteValues: typeof options.promoteValues === 'boolean' ? options.promoteValues : true, + promoteBuffers: typeof options.promoteBuffers === 'boolean' ? options.promoteBuffers : false, + bsonRegExp: typeof options.bsonRegExp === 'boolean' ? options.bsonRegExp : false, + enableUtf8Validation: typeof options.enableUtf8Validation === 'boolean' ? options.enableUtf8Validation : true + }); + if (options.session) { + queryOptions.session = options.session; + } + return queryOptions; +} +exports.applyCommonQueryOptions = applyCommonQueryOptions; +function isSharded(topologyOrServer) { + if (topologyOrServer == null) { + return false; + } + if (topologyOrServer.description && topologyOrServer.description.type === common_1.ServerType.Mongos) { + return true; + } + // NOTE: This is incredibly inefficient, and should be removed once command construction + // happens based on `Server` not `Topology`. + if (topologyOrServer.description && topologyOrServer.description instanceof topology_description_1.TopologyDescription) { + const servers = Array.from(topologyOrServer.description.servers.values()); + return servers.some((server) => server.type === common_1.ServerType.Mongos); + } + return false; +} +exports.isSharded = isSharded; +//# sourceMappingURL=shared.js.map \ No newline at end of file diff --git a/node_modules/mongodb/lib/cmap/wire_protocol/shared.js.map b/node_modules/mongodb/lib/cmap/wire_protocol/shared.js.map new file mode 100644 index 000000000..2d5b2275f --- /dev/null +++ b/node_modules/mongodb/lib/cmap/wire_protocol/shared.js.map @@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C,KAAK;QAC5F,UAAU,EAAE,OAAO,OAAO,CAAC,UAAU,KAAK,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,KAAK;QAChF,oBAAoB,EAClB,OAAO,OAAO,CAAC,oBAAoB,KAAK,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,oBAAoB,CAAC,CAAC,CAAC,IAAI;KAC1F,CAAC,CAAC;IAEH,IAAI,OAAO,CAAC,OAAO,EAAE;QACnB,YAAY,CAAC,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;KACxC;IAED,OAAO,YAAY,CAAC;AACtB,CAAC;AAnBD,0DAmBC;AAED,SAAgB,SAAS,CAAC,gBAAiD;IACzE,IAAI,gBAAgB,IAAI,IAAI,EAAE;QAC5B,OAAO,KAAK,CAAC;KACd;IAED,IAAI,gBAAgB,CAAC,WAAW,IAAI,gBAAgB,CAAC,WAAW,CAAC,IAAI,KAAK,mBAAU,CAAC,MAAM,EAAE;QAC3F,OAAO,IAAI,CAAC;KACb;IAED,wFAAwF;IACxF,kDAAkD;IAClD,IAAI,gBAAgB,CAAC,WAAW,IAAI,gBAAgB,CAAC,WAAW,YAAY,0CAAmB,EAAE;QAC/F,MAAM,OAAO,GAAwB,KAAK,CAAC,IAAI,CAAC,gBAAgB,CAAC,WAAW,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;QAC/F,OAAO,OAAO,CAAC,IAAI,CAAC,CAAC,MAAyB,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,KAAK,mBAAU,CAAC,MAAM,CAAC,CAAC;KACvF;IAED,OAAO,KAAK,CAAC;AACf,CAAC;AAjBD,8BAiBC"} \ No newline at end of file diff --git a/node_modules/mongodb/lib/collection.js b/node_modules/mongodb/lib/collection.js new file mode 100644 index 000000000..a47d1ce8f --- /dev/null +++ b/node_modules/mongodb/lib/collection.js @@ -0,0 +1,522 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Collection = void 0; +const bson_1 = require("./bson"); +const ordered_1 = require("./bulk/ordered"); +const unordered_1 = require("./bulk/unordered"); +const change_stream_1 = require("./change_stream"); +const aggregation_cursor_1 = require("./cursor/aggregation_cursor"); +const find_cursor_1 = require("./cursor/find_cursor"); +const error_1 = require("./error"); +const bulk_write_1 = require("./operations/bulk_write"); +const count_1 = require("./operations/count"); +const count_documents_1 = require("./operations/count_documents"); +const delete_1 = require("./operations/delete"); +const distinct_1 = require("./operations/distinct"); +const drop_1 = require("./operations/drop"); +const estimated_document_count_1 = require("./operations/estimated_document_count"); +const execute_operation_1 = require("./operations/execute_operation"); +const find_and_modify_1 = require("./operations/find_and_modify"); +const indexes_1 = require("./operations/indexes"); +const insert_1 = require("./operations/insert"); +const is_capped_1 = require("./operations/is_capped"); +const map_reduce_1 = require("./operations/map_reduce"); +const options_operation_1 = require("./operations/options_operation"); +const rename_1 = require("./operations/rename"); +const stats_1 = require("./operations/stats"); +const update_1 = require("./operations/update"); +const read_concern_1 = require("./read_concern"); +const read_preference_1 = require("./read_preference"); +const utils_1 = require("./utils"); +const write_concern_1 = require("./write_concern"); +/** + * The **Collection** class is an internal class that embodies a MongoDB collection + * allowing for insert/update/remove/find and other command operation on that MongoDB collection. + * + * **COLLECTION Cannot directly be instantiated** + * @public + * + * @example + * ```js + * const MongoClient = require('mongodb').MongoClient; + * const test = require('assert'); + * // Connection url + * const url = 'mongodb://localhost:27017'; + * // Database Name + * const dbName = 'test'; + * // Connect using MongoClient + * MongoClient.connect(url, function(err, client) { + * // Create a collection we want to drop later + * const col = client.db(dbName).collection('createIndexExample1'); + * // Show that duplicate records got dropped + * col.find({}).toArray(function(err, items) { + * expect(err).to.not.exist; + * test.equal(4, items.length); + * client.close(); + * }); + * }); + * ``` + */ +class Collection { + /** + * Create a new Collection instance + * @internal + */ + constructor(db, name, options) { + var _a, _b; + (0, utils_1.checkCollectionName)(name); + // Internal state + this.s = { + db, + options, + namespace: new utils_1.MongoDBNamespace(db.databaseName, name), + pkFactory: (_b = (_a = db.options) === null || _a === void 0 ? void 0 : _a.pkFactory) !== null && _b !== void 0 ? _b : utils_1.DEFAULT_PK_FACTORY, + readPreference: read_preference_1.ReadPreference.fromOptions(options), + bsonOptions: (0, bson_1.resolveBSONOptions)(options, db), + readConcern: read_concern_1.ReadConcern.fromOptions(options), + writeConcern: write_concern_1.WriteConcern.fromOptions(options) + }; + } + /** + * The name of the database this collection belongs to + */ + get dbName() { + return this.s.namespace.db; + } + /** + * The name of this collection + */ + get collectionName() { + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + return this.s.namespace.collection; + } + /** + * The namespace of this collection, in the format `${this.dbName}.${this.collectionName}` + */ + get namespace() { + return this.s.namespace.toString(); + } + /** + * The current readConcern of the collection. If not explicitly defined for + * this collection, will be inherited from the parent DB + */ + get readConcern() { + if (this.s.readConcern == null) { + return this.s.db.readConcern; + } + return this.s.readConcern; + } + /** + * The current readPreference of the collection. If not explicitly defined for + * this collection, will be inherited from the parent DB + */ + get readPreference() { + if (this.s.readPreference == null) { + return this.s.db.readPreference; + } + return this.s.readPreference; + } + get bsonOptions() { + return this.s.bsonOptions; + } + /** + * The current writeConcern of the collection. If not explicitly defined for + * this collection, will be inherited from the parent DB + */ + get writeConcern() { + if (this.s.writeConcern == null) { + return this.s.db.writeConcern; + } + return this.s.writeConcern; + } + /** The current index hint for the collection */ + get hint() { + return this.s.collectionHint; + } + set hint(v) { + this.s.collectionHint = (0, utils_1.normalizeHintField)(v); + } + insertOne(doc, options, callback) { + if (typeof options === 'function') { + callback = options; + options = {}; + } + // CSFLE passes in { w: 'majority' } to ensure the lib works in both 3.x and 4.x + // we support that option style here only + if (options && Reflect.get(options, 'w')) { + options.writeConcern = write_concern_1.WriteConcern.fromOptions(Reflect.get(options, 'w')); + } + return (0, execute_operation_1.executeOperation)(this.s.db.s.client, new insert_1.InsertOneOperation(this, doc, (0, utils_1.resolveOptions)(this, options)), callback); + } + insertMany(docs, options, callback) { + if (typeof options === 'function') + (callback = options), (options = {}); + options = options ? Object.assign({}, options) : { ordered: true }; + return (0, execute_operation_1.executeOperation)(this.s.db.s.client, new insert_1.InsertManyOperation(this, docs, (0, utils_1.resolveOptions)(this, options)), callback); + } + bulkWrite(operations, options, callback) { + if (typeof options === 'function') + (callback = options), (options = {}); + options = options || { ordered: true }; + if (!Array.isArray(operations)) { + throw new error_1.MongoInvalidArgumentError('Argument "operations" must be an array of documents'); + } + return (0, execute_operation_1.executeOperation)(this.s.db.s.client, new bulk_write_1.BulkWriteOperation(this, operations, (0, utils_1.resolveOptions)(this, options)), callback); + } + updateOne(filter, update, options, callback) { + if (typeof options === 'function') + (callback = options), (options = {}); + return (0, execute_operation_1.executeOperation)(this.s.db.s.client, new update_1.UpdateOneOperation(this, filter, update, (0, utils_1.resolveOptions)(this, options)), callback); + } + replaceOne(filter, replacement, options, callback) { + if (typeof options === 'function') + (callback = options), (options = {}); + return (0, execute_operation_1.executeOperation)(this.s.db.s.client, new update_1.ReplaceOneOperation(this, filter, replacement, (0, utils_1.resolveOptions)(this, options)), callback); + } + updateMany(filter, update, options, callback) { + if (typeof options === 'function') + (callback = options), (options = {}); + return (0, execute_operation_1.executeOperation)(this.s.db.s.client, new update_1.UpdateManyOperation(this, filter, update, (0, utils_1.resolveOptions)(this, options)), callback); + } + deleteOne(filter, options, callback) { + if (typeof options === 'function') + (callback = options), (options = {}); + return (0, execute_operation_1.executeOperation)(this.s.db.s.client, new delete_1.DeleteOneOperation(this, filter, (0, utils_1.resolveOptions)(this, options)), callback); + } + deleteMany(filter, options, callback) { + if (filter == null) { + filter = {}; + options = {}; + callback = undefined; + } + else if (typeof filter === 'function') { + callback = filter; + filter = {}; + options = {}; + } + else if (typeof options === 'function') { + callback = options; + options = {}; + } + return (0, execute_operation_1.executeOperation)(this.s.db.s.client, new delete_1.DeleteManyOperation(this, filter, (0, utils_1.resolveOptions)(this, options)), callback); + } + rename(newName, options, callback) { + if (typeof options === 'function') + (callback = options), (options = {}); + // Intentionally, we do not inherit options from parent for this operation. + return (0, execute_operation_1.executeOperation)(this.s.db.s.client, new rename_1.RenameOperation(this, newName, { + ...options, + readPreference: read_preference_1.ReadPreference.PRIMARY + }), callback); + } + drop(options, callback) { + if (typeof options === 'function') + (callback = options), (options = {}); + options = options !== null && options !== void 0 ? options : {}; + return (0, execute_operation_1.executeOperation)(this.s.db.s.client, new drop_1.DropCollectionOperation(this.s.db, this.collectionName, options), callback); + } + findOne(filter, options, callback) { + if (callback != null && typeof callback !== 'function') { + throw new error_1.MongoInvalidArgumentError('Third parameter to `findOne()` must be a callback or undefined'); + } + if (typeof filter === 'function') { + callback = filter; + filter = {}; + options = {}; + } + if (typeof options === 'function') { + callback = options; + options = {}; + } + const finalFilter = filter !== null && filter !== void 0 ? filter : {}; + const finalOptions = options !== null && options !== void 0 ? options : {}; + return this.find(finalFilter, finalOptions).limit(-1).batchSize(1).next(callback); + } + find(filter, options) { + if (arguments.length > 2) { + throw new error_1.MongoInvalidArgumentError('Method "collection.find()" accepts at most two arguments'); + } + if (typeof options === 'function') { + throw new error_1.MongoInvalidArgumentError('Argument "options" must not be function'); + } + return new find_cursor_1.FindCursor(this.s.db.s.client, this.s.namespace, filter, (0, utils_1.resolveOptions)(this, options)); + } + options(options, callback) { + if (typeof options === 'function') + (callback = options), (options = {}); + return (0, execute_operation_1.executeOperation)(this.s.db.s.client, new options_operation_1.OptionsOperation(this, (0, utils_1.resolveOptions)(this, options)), callback); + } + isCapped(options, callback) { + if (typeof options === 'function') + (callback = options), (options = {}); + return (0, execute_operation_1.executeOperation)(this.s.db.s.client, new is_capped_1.IsCappedOperation(this, (0, utils_1.resolveOptions)(this, options)), callback); + } + createIndex(indexSpec, options, callback) { + if (typeof options === 'function') + (callback = options), (options = {}); + return (0, execute_operation_1.executeOperation)(this.s.db.s.client, new indexes_1.CreateIndexOperation(this, this.collectionName, indexSpec, (0, utils_1.resolveOptions)(this, options)), callback); + } + createIndexes(indexSpecs, options, callback) { + if (typeof options === 'function') + (callback = options), (options = {}); + options = options ? Object.assign({}, options) : {}; + if (typeof options.maxTimeMS !== 'number') + delete options.maxTimeMS; + return (0, execute_operation_1.executeOperation)(this.s.db.s.client, new indexes_1.CreateIndexesOperation(this, this.collectionName, indexSpecs, (0, utils_1.resolveOptions)(this, options)), callback); + } + dropIndex(indexName, options, callback) { + if (typeof options === 'function') + (callback = options), (options = {}); + options = (0, utils_1.resolveOptions)(this, options); + // Run only against primary + options.readPreference = read_preference_1.ReadPreference.primary; + return (0, execute_operation_1.executeOperation)(this.s.db.s.client, new indexes_1.DropIndexOperation(this, indexName, options), callback); + } + dropIndexes(options, callback) { + if (typeof options === 'function') + (callback = options), (options = {}); + return (0, execute_operation_1.executeOperation)(this.s.db.s.client, new indexes_1.DropIndexesOperation(this, (0, utils_1.resolveOptions)(this, options)), callback); + } + /** + * Get the list of all indexes information for the collection. + * + * @param options - Optional settings for the command + */ + listIndexes(options) { + return new indexes_1.ListIndexesCursor(this, (0, utils_1.resolveOptions)(this, options)); + } + indexExists(indexes, options, callback) { + if (typeof options === 'function') + (callback = options), (options = {}); + return (0, execute_operation_1.executeOperation)(this.s.db.s.client, new indexes_1.IndexExistsOperation(this, indexes, (0, utils_1.resolveOptions)(this, options)), callback); + } + indexInformation(options, callback) { + if (typeof options === 'function') + (callback = options), (options = {}); + return (0, execute_operation_1.executeOperation)(this.s.db.s.client, new indexes_1.IndexInformationOperation(this.s.db, this.collectionName, (0, utils_1.resolveOptions)(this, options)), callback); + } + estimatedDocumentCount(options, callback) { + if (typeof options === 'function') + (callback = options), (options = {}); + return (0, execute_operation_1.executeOperation)(this.s.db.s.client, new estimated_document_count_1.EstimatedDocumentCountOperation(this, (0, utils_1.resolveOptions)(this, options)), callback); + } + countDocuments(filter, options, callback) { + if (filter == null) { + (filter = {}), (options = {}), (callback = undefined); + } + else if (typeof filter === 'function') { + (callback = filter), (filter = {}), (options = {}); + } + else { + if (arguments.length === 2) { + if (typeof options === 'function') + (callback = options), (options = {}); + } + } + filter !== null && filter !== void 0 ? filter : (filter = {}); + return (0, execute_operation_1.executeOperation)(this.s.db.s.client, new count_documents_1.CountDocumentsOperation(this, filter, (0, utils_1.resolveOptions)(this, options)), callback); + } + // Implementation + distinct(key, filter, options, callback) { + if (typeof filter === 'function') { + (callback = filter), (filter = {}), (options = {}); + } + else { + if (arguments.length === 3 && typeof options === 'function') { + (callback = options), (options = {}); + } + } + filter !== null && filter !== void 0 ? filter : (filter = {}); + return (0, execute_operation_1.executeOperation)(this.s.db.s.client, new distinct_1.DistinctOperation(this, key, filter, (0, utils_1.resolveOptions)(this, options)), callback); + } + indexes(options, callback) { + if (typeof options === 'function') + (callback = options), (options = {}); + return (0, execute_operation_1.executeOperation)(this.s.db.s.client, new indexes_1.IndexesOperation(this, (0, utils_1.resolveOptions)(this, options)), callback); + } + stats(options, callback) { + if (typeof options === 'function') + (callback = options), (options = {}); + options = options !== null && options !== void 0 ? options : {}; + return (0, execute_operation_1.executeOperation)(this.s.db.s.client, new stats_1.CollStatsOperation(this, options), callback); + } + findOneAndDelete(filter, options, callback) { + if (typeof options === 'function') + (callback = options), (options = {}); + return (0, execute_operation_1.executeOperation)(this.s.db.s.client, new find_and_modify_1.FindOneAndDeleteOperation(this, filter, (0, utils_1.resolveOptions)(this, options)), callback); + } + findOneAndReplace(filter, replacement, options, callback) { + if (typeof options === 'function') + (callback = options), (options = {}); + return (0, execute_operation_1.executeOperation)(this.s.db.s.client, new find_and_modify_1.FindOneAndReplaceOperation(this, filter, replacement, (0, utils_1.resolveOptions)(this, options)), callback); + } + findOneAndUpdate(filter, update, options, callback) { + if (typeof options === 'function') + (callback = options), (options = {}); + return (0, execute_operation_1.executeOperation)(this.s.db.s.client, new find_and_modify_1.FindOneAndUpdateOperation(this, filter, update, (0, utils_1.resolveOptions)(this, options)), callback); + } + /** + * Execute an aggregation framework pipeline against the collection, needs MongoDB \>= 2.2 + * + * @param pipeline - An array of aggregation pipelines to execute + * @param options - Optional settings for the command + */ + aggregate(pipeline = [], options) { + if (arguments.length > 2) { + throw new error_1.MongoInvalidArgumentError('Method "collection.aggregate()" accepts at most two arguments'); + } + if (!Array.isArray(pipeline)) { + throw new error_1.MongoInvalidArgumentError('Argument "pipeline" must be an array of aggregation stages'); + } + if (typeof options === 'function') { + throw new error_1.MongoInvalidArgumentError('Argument "options" must not be function'); + } + return new aggregation_cursor_1.AggregationCursor(this.s.db.s.client, this.s.namespace, pipeline, (0, utils_1.resolveOptions)(this, options)); + } + /** + * Create a new Change Stream, watching for new changes (insertions, updates, replacements, deletions, and invalidations) in this collection. + * + * @remarks + * watch() accepts two generic arguments for distinct usecases: + * - The first is to override the schema that may be defined for this specific collection + * - The second is to override the shape of the change stream document entirely, if it is not provided the type will default to ChangeStreamDocument of the first argument + * @example + * By just providing the first argument I can type the change to be `ChangeStreamDocument<{ _id: number }>` + * ```ts + * collection.watch<{ _id: number }>() + * .on('change', change => console.log(change._id.toFixed(4))); + * ``` + * + * @example + * Passing a second argument provides a way to reflect the type changes caused by an advanced pipeline. + * Here, we are using a pipeline to have MongoDB filter for insert changes only and add a comment. + * No need start from scratch on the ChangeStreamInsertDocument type! + * By using an intersection we can save time and ensure defaults remain the same type! + * ```ts + * collection + * .watch & { comment: string }>([ + * { $addFields: { comment: 'big changes' } }, + * { $match: { operationType: 'insert' } } + * ]) + * .on('change', change => { + * change.comment.startsWith('big'); + * change.operationType === 'insert'; + * // No need to narrow in code because the generics did that for us! + * expectType(change.fullDocument); + * }); + * ``` + * + * @param pipeline - An array of {@link https://docs.mongodb.com/manual/reference/operator/aggregation-pipeline/|aggregation pipeline stages} through which to pass change stream documents. This allows for filtering (using $match) and manipulating the change stream documents. + * @param options - Optional settings for the command + * @typeParam TLocal - Type of the data being detected by the change stream + * @typeParam TChange - Type of the whole change stream document emitted + */ + watch(pipeline = [], options = {}) { + // Allow optionally not specifying a pipeline + if (!Array.isArray(pipeline)) { + options = pipeline; + pipeline = []; + } + return new change_stream_1.ChangeStream(this, pipeline, (0, utils_1.resolveOptions)(this, options)); + } + mapReduce(map, reduce, options, callback) { + (0, utils_1.emitWarningOnce)('collection.mapReduce is deprecated. Use the aggregation pipeline instead. Visit https://docs.mongodb.com/manual/reference/map-reduce-to-aggregation-pipeline for more information on how to translate map-reduce operations to the aggregation pipeline.'); + if ('function' === typeof options) + (callback = options), (options = {}); + // Out must always be defined (make sure we don't break weirdly on pre 1.8+ servers) + // TODO NODE-3339: Figure out if this is still necessary given we no longer officially support pre-1.8 + if ((options === null || options === void 0 ? void 0 : options.out) == null) { + throw new error_1.MongoInvalidArgumentError('Option "out" must be defined, see mongodb docs for possible values'); + } + if ('function' === typeof map) { + map = map.toString(); + } + if ('function' === typeof reduce) { + reduce = reduce.toString(); + } + if ('function' === typeof options.finalize) { + options.finalize = options.finalize.toString(); + } + return (0, execute_operation_1.executeOperation)(this.s.db.s.client, new map_reduce_1.MapReduceOperation(this, map, reduce, (0, utils_1.resolveOptions)(this, options)), callback); + } + /** Initiate an Out of order batch write operation. All operations will be buffered into insert/update/remove commands executed out of order. */ + initializeUnorderedBulkOp(options) { + return new unordered_1.UnorderedBulkOperation(this, (0, utils_1.resolveOptions)(this, options)); + } + /** Initiate an In order bulk write operation. Operations will be serially executed in the order they are added, creating a new operation for each switch in types. */ + initializeOrderedBulkOp(options) { + return new ordered_1.OrderedBulkOperation(this, (0, utils_1.resolveOptions)(this, options)); + } + /** Get the db scoped logger */ + getLogger() { + return this.s.db.s.logger; + } + get logger() { + return this.s.db.s.logger; + } + /** + * Inserts a single document or a an array of documents into MongoDB. If documents passed in do not contain the **_id** field, + * one will be added to each of the documents missing it by the driver, mutating the document. This behavior + * can be overridden by setting the **forceServerObjectId** flag. + * + * @deprecated Use insertOne, insertMany or bulkWrite instead. + * @param docs - The documents to insert + * @param options - Optional settings for the command + * @param callback - An optional callback, a Promise will be returned if none is provided + */ + insert(docs, options, callback) { + (0, utils_1.emitWarningOnce)('collection.insert is deprecated. Use insertOne, insertMany or bulkWrite instead.'); + if (typeof options === 'function') + (callback = options), (options = {}); + options = options || { ordered: false }; + docs = !Array.isArray(docs) ? [docs] : docs; + if (options.keepGoing === true) { + options.ordered = false; + } + return this.insertMany(docs, options, callback); + } + /** + * Updates documents. + * + * @deprecated use updateOne, updateMany or bulkWrite + * @param selector - The selector for the update operation. + * @param update - The update operations to be applied to the documents + * @param options - Optional settings for the command + * @param callback - An optional callback, a Promise will be returned if none is provided + */ + update(selector, update, options, callback) { + (0, utils_1.emitWarningOnce)('collection.update is deprecated. Use updateOne, updateMany, or bulkWrite instead.'); + if (typeof options === 'function') + (callback = options), (options = {}); + options = options !== null && options !== void 0 ? options : {}; + return this.updateMany(selector, update, options, callback); + } + /** + * Remove documents. + * + * @deprecated use deleteOne, deleteMany or bulkWrite + * @param selector - The selector for the update operation. + * @param options - Optional settings for the command + * @param callback - An optional callback, a Promise will be returned if none is provided + */ + remove(selector, options, callback) { + (0, utils_1.emitWarningOnce)('collection.remove is deprecated. Use deleteOne, deleteMany, or bulkWrite instead.'); + if (typeof options === 'function') + (callback = options), (options = {}); + options = options !== null && options !== void 0 ? options : {}; + return this.deleteMany(selector, options, callback); + } + count(filter, options, callback) { + if (typeof filter === 'function') { + (callback = filter), (filter = {}), (options = {}); + } + else { + if (typeof options === 'function') + (callback = options), (options = {}); + } + filter !== null && filter !== void 0 ? filter : (filter = {}); + return (0, execute_operation_1.executeOperation)(this.s.db.s.client, new count_1.CountOperation(utils_1.MongoDBNamespace.fromString(this.namespace), filter, (0, utils_1.resolveOptions)(this, options)), callback); + } +} +exports.Collection = Collection; +//# sourceMappingURL=collection.js.map \ No newline at end of file diff --git a/node_modules/mongodb/lib/collection.js.map b/node_modules/mongodb/lib/collection.js.map new file mode 100644 index 000000000..07a0ce944 --- /dev/null +++ b/node_modules/mongodb/lib/collection.js.map @@ -0,0 +1 @@ +{"version":3,"file":"collection.js","sourceRoot":"","sources":["../src/collection.ts"],"names":[],"mappings":";;;AAAA,iCAA4E;AAE5E,4CAAsD;AACtD,gDAA0D;AAC1D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AU,CAAC,QAAQ,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;IACtD,CAAC;IAyBD,KAAK,CACH,MAA0D,EAC1D,OAAyC,EACzC,QAA2B;QAE3B,IAAI,OAAO,MAAM,KAAK,UAAU,EAAE;YAChC,CAAC,QAAQ,GAAG,MAA0B,CAAC,EAAE,CAAC,MAAM,GAAG,EAAE,CAAC,EAAE,CAAC,OAAO,GAAG,EAAE,CAAC,CAAC;SACxE;aAAM;YACL,IAAI,OAAO,OAAO,KAAK,UAAU;gBAAE,CAAC,QAAQ,GAAG,OAAO,CAAC,EAAE,CAAC,OAAO,GAAG,EAAE,CAAC,CAAC;SACzE;QAED,MAAM,aAAN,MAAM,cAAN,MAAM,IAAN,MAAM,GAAK,EAAE,EAAC;QACd,OAAO,IAAA,oCAAgB,EACrB,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,EAClB,IAAI,sBAAc,CAChB,wBAAgB,CAAC,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC,EAC3C,MAAM,EACN,IAAA,sBAAc,EAAC,IAAI,EAAE,OAAO,CAAC,CAC9B,EACD,QAAQ,CACT,CAAC;IACJ,CAAC;CACF;AAj/CD,gCAi/CC"} \ No newline at end of file diff --git a/node_modules/mongodb/lib/connection_string.js b/node_modules/mongodb/lib/connection_string.js new file mode 100644 index 000000000..f48447fef --- /dev/null +++ b/node_modules/mongodb/lib/connection_string.js @@ -0,0 +1,1094 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.FEATURE_FLAGS = exports.DEFAULT_OPTIONS = exports.OPTIONS = exports.parseOptions = exports.checkTLSOptions = exports.resolveSRVRecord = void 0; +const dns = require("dns"); +const fs = require("fs"); +const mongodb_connection_string_url_1 = require("mongodb-connection-string-url"); +const url_1 = require("url"); +const mongo_credentials_1 = require("./cmap/auth/mongo_credentials"); +const providers_1 = require("./cmap/auth/providers"); +const compression_1 = require("./cmap/wire_protocol/compression"); +const encrypter_1 = require("./encrypter"); +const error_1 = require("./error"); +const logger_1 = require("./logger"); +const mongo_client_1 = require("./mongo_client"); +const promise_provider_1 = require("./promise_provider"); +const read_concern_1 = require("./read_concern"); +const read_preference_1 = require("./read_preference"); +const utils_1 = require("./utils"); +const write_concern_1 = require("./write_concern"); +const VALID_TXT_RECORDS = ['authSource', 'replicaSet', 'loadBalanced']; +const LB_SINGLE_HOST_ERROR = 'loadBalanced option only supported with a single host in the URI'; +const LB_REPLICA_SET_ERROR = 'loadBalanced option not supported with a replicaSet option'; +const LB_DIRECT_CONNECTION_ERROR = 'loadBalanced option not supported when directConnection is provided'; +/** + * Determines whether a provided address matches the provided parent domain in order + * to avoid certain attack vectors. + * + * @param srvAddress - The address to check against a domain + * @param parentDomain - The domain to check the provided address against + * @returns Whether the provided address matches the parent domain + */ +function matchesParentDomain(srvAddress, parentDomain) { + const regex = /^.*?\./; + const srv = `.${srvAddress.replace(regex, '')}`; + const parent = `.${parentDomain.replace(regex, '')}`; + return srv.endsWith(parent); +} +/** + * Lookup a `mongodb+srv` connection string, combine the parts and reparse it as a normal + * connection string. + * + * @param uri - The connection string to parse + * @param options - Optional user provided connection string options + */ +function resolveSRVRecord(options, callback) { + if (typeof options.srvHost !== 'string') { + return callback(new error_1.MongoAPIError('Option "srvHost" must not be empty')); + } + if (options.srvHost.split('.').length < 3) { + // TODO(NODE-3484): Replace with MongoConnectionStringError + return callback(new error_1.MongoAPIError('URI must include hostname, domain name, and tld')); + } + // Resolve the SRV record and use the result as the list of hosts to connect to. + const lookupAddress = options.srvHost; + dns.resolveSrv(`_${options.srvServiceName}._tcp.${lookupAddress}`, (err, addresses) => { + if (err) + return callback(err); + if (addresses.length === 0) { + return callback(new error_1.MongoAPIError('No addresses found at host')); + } + for (const { name } of addresses) { + if (!matchesParentDomain(name, lookupAddress)) { + return callback(new error_1.MongoAPIError('Server record does not share hostname with parent URI')); + } + } + const hostAddresses = addresses.map(r => { var _a; return utils_1.HostAddress.fromString(`${r.name}:${(_a = r.port) !== null && _a !== void 0 ? _a : 27017}`); }); + const lbError = validateLoadBalancedOptions(hostAddresses, options, true); + if (lbError) { + return callback(lbError); + } + // Resolve TXT record and add options from there if they exist. + dns.resolveTxt(lookupAddress, (err, record) => { + var _a, _b, _c; + if (err) { + if (err.code !== 'ENODATA' && err.code !== 'ENOTFOUND') { + return callback(err); + } + } + else { + if (record.length > 1) { + return callback(new error_1.MongoParseError('Multiple text records not allowed')); + } + const txtRecordOptions = new url_1.URLSearchParams(record[0].join('')); + const txtRecordOptionKeys = [...txtRecordOptions.keys()]; + if (txtRecordOptionKeys.some(key => !VALID_TXT_RECORDS.includes(key))) { + return callback(new error_1.MongoParseError(`Text record may only set any of: ${VALID_TXT_RECORDS.join(', ')}`)); + } + if (VALID_TXT_RECORDS.some(option => txtRecordOptions.get(option) === '')) { + return callback(new error_1.MongoParseError('Cannot have empty URI params in DNS TXT Record')); + } + const source = (_a = txtRecordOptions.get('authSource')) !== null && _a !== void 0 ? _a : undefined; + const replicaSet = (_b = txtRecordOptions.get('replicaSet')) !== null && _b !== void 0 ? _b : undefined; + const loadBalanced = (_c = txtRecordOptions.get('loadBalanced')) !== null && _c !== void 0 ? _c : undefined; + if (!options.userSpecifiedAuthSource && + source && + options.credentials && + !providers_1.AUTH_MECHS_AUTH_SRC_EXTERNAL.has(options.credentials.mechanism)) { + options.credentials = mongo_credentials_1.MongoCredentials.merge(options.credentials, { source }); + } + if (!options.userSpecifiedReplicaSet && replicaSet) { + options.replicaSet = replicaSet; + } + if (loadBalanced === 'true') { + options.loadBalanced = true; + } + if (options.replicaSet && options.srvMaxHosts > 0) { + return callback(new error_1.MongoParseError('Cannot combine replicaSet option with srvMaxHosts')); + } + const lbError = validateLoadBalancedOptions(hostAddresses, options, true); + if (lbError) { + return callback(lbError); + } + } + callback(undefined, hostAddresses); + }); + }); +} +exports.resolveSRVRecord = resolveSRVRecord; +/** + * Checks if TLS options are valid + * + * @param options - The options used for options parsing + * @throws MongoParseError if TLS options are invalid + */ +function checkTLSOptions(options) { + if (!options) + return; + const check = (a, b) => { + if (Reflect.has(options, a) && Reflect.has(options, b)) { + throw new error_1.MongoParseError(`The '${a}' option cannot be used with '${b}'`); + } + }; + check('tlsInsecure', 'tlsAllowInvalidCertificates'); + check('tlsInsecure', 'tlsAllowInvalidHostnames'); + check('tlsInsecure', 'tlsDisableCertificateRevocationCheck'); + check('tlsInsecure', 'tlsDisableOCSPEndpointCheck'); + check('tlsAllowInvalidCertificates', 'tlsDisableCertificateRevocationCheck'); + check('tlsAllowInvalidCertificates', 'tlsDisableOCSPEndpointCheck'); + check('tlsDisableCertificateRevocationCheck', 'tlsDisableOCSPEndpointCheck'); +} +exports.checkTLSOptions = checkTLSOptions; +const TRUTHS = new Set(['true', 't', '1', 'y', 'yes']); +const FALSEHOODS = new Set(['false', 'f', '0', 'n', 'no', '-1']); +function getBoolean(name, value) { + if (typeof value === 'boolean') + return value; + const valueString = String(value).toLowerCase(); + if (TRUTHS.has(valueString)) { + if (valueString !== 'true') { + (0, utils_1.emitWarningOnce)(`deprecated value for ${name} : ${valueString} - please update to ${name} : true instead`); + } + return true; + } + if (FALSEHOODS.has(valueString)) { + if (valueString !== 'false') { + (0, utils_1.emitWarningOnce)(`deprecated value for ${name} : ${valueString} - please update to ${name} : false instead`); + } + return false; + } + throw new error_1.MongoParseError(`Expected ${name} to be stringified boolean value, got: ${value}`); +} +function getInt(name, value) { + if (typeof value === 'number') + return Math.trunc(value); + const parsedValue = Number.parseInt(String(value), 10); + if (!Number.isNaN(parsedValue)) + return parsedValue; + throw new error_1.MongoParseError(`Expected ${name} to be stringified int value, got: ${value}`); +} +function getUint(name, value) { + const parsedValue = getInt(name, value); + if (parsedValue < 0) { + throw new error_1.MongoParseError(`${name} can only be a positive int value, got: ${value}`); + } + return parsedValue; +} +function* entriesFromString(value) { + const keyValuePairs = value.split(','); + for (const keyValue of keyValuePairs) { + const [key, value] = keyValue.split(':'); + if (value == null) { + throw new error_1.MongoParseError('Cannot have undefined values in key value pairs'); + } + yield [key, value]; + } +} +class CaseInsensitiveMap extends Map { + constructor(entries = []) { + super(entries.map(([k, v]) => [k.toLowerCase(), v])); + } + has(k) { + return super.has(k.toLowerCase()); + } + get(k) { + return super.get(k.toLowerCase()); + } + set(k, v) { + return super.set(k.toLowerCase(), v); + } + delete(k) { + return super.delete(k.toLowerCase()); + } +} +function parseOptions(uri, mongoClient = undefined, options = {}) { + if (mongoClient != null && !(mongoClient instanceof mongo_client_1.MongoClient)) { + options = mongoClient; + mongoClient = undefined; + } + const url = new mongodb_connection_string_url_1.default(uri); + const { hosts, isSRV } = url; + const mongoOptions = Object.create(null); + // Feature flags + for (const flag of Object.getOwnPropertySymbols(options)) { + if (exports.FEATURE_FLAGS.has(flag)) { + mongoOptions[flag] = options[flag]; + } + } + mongoOptions.hosts = isSRV ? [] : hosts.map(utils_1.HostAddress.fromString); + const urlOptions = new CaseInsensitiveMap(); + if (url.pathname !== '/' && url.pathname !== '') { + const dbName = decodeURIComponent(url.pathname[0] === '/' ? url.pathname.slice(1) : url.pathname); + if (dbName) { + urlOptions.set('dbName', [dbName]); + } + } + if (url.username !== '') { + const auth = { + username: decodeURIComponent(url.username) + }; + if (typeof url.password === 'string') { + auth.password = decodeURIComponent(url.password); + } + urlOptions.set('auth', [auth]); + } + for (const key of url.searchParams.keys()) { + const values = [...url.searchParams.getAll(key)]; + if (values.includes('')) { + throw new error_1.MongoAPIError('URI cannot contain options with no value'); + } + if (!urlOptions.has(key)) { + urlOptions.set(key, values); + } + } + const objectOptions = new CaseInsensitiveMap(Object.entries(options).filter(([, v]) => v != null)); + // Validate options that can only be provided by one of uri or object + if (urlOptions.has('serverApi')) { + throw new error_1.MongoParseError('URI cannot contain `serverApi`, it can only be passed to the client'); + } + if (objectOptions.has('loadBalanced')) { + throw new error_1.MongoParseError('loadBalanced is only a valid option in the URI'); + } + // All option collection + const allOptions = new CaseInsensitiveMap(); + const allKeys = new Set([ + ...urlOptions.keys(), + ...objectOptions.keys(), + ...exports.DEFAULT_OPTIONS.keys() + ]); + for (const key of allKeys) { + const values = []; + const objectOptionValue = objectOptions.get(key); + if (objectOptionValue != null) { + values.push(objectOptionValue); + } + const urlValue = urlOptions.get(key); + if (urlValue != null) { + values.push(...urlValue); + } + const defaultOptionsValue = exports.DEFAULT_OPTIONS.get(key); + if (defaultOptionsValue != null) { + values.push(defaultOptionsValue); + } + allOptions.set(key, values); + } + if (allOptions.has('tlsCertificateKeyFile') && !allOptions.has('tlsCertificateFile')) { + allOptions.set('tlsCertificateFile', allOptions.get('tlsCertificateKeyFile')); + } + if (allOptions.has('tls') || allOptions.has('ssl')) { + const tlsAndSslOpts = (allOptions.get('tls') || []) + .concat(allOptions.get('ssl') || []) + .map(getBoolean.bind(null, 'tls/ssl')); + if (new Set(tlsAndSslOpts).size !== 1) { + throw new error_1.MongoParseError('All values of tls/ssl must be the same.'); + } + } + const unsupportedOptions = (0, utils_1.setDifference)(allKeys, Array.from(Object.keys(exports.OPTIONS)).map(s => s.toLowerCase())); + if (unsupportedOptions.size !== 0) { + const optionWord = unsupportedOptions.size > 1 ? 'options' : 'option'; + const isOrAre = unsupportedOptions.size > 1 ? 'are' : 'is'; + throw new error_1.MongoParseError(`${optionWord} ${Array.from(unsupportedOptions).join(', ')} ${isOrAre} not supported`); + } + // Option parsing and setting + for (const [key, descriptor] of Object.entries(exports.OPTIONS)) { + const values = allOptions.get(key); + if (!values || values.length === 0) + continue; + setOption(mongoOptions, key, descriptor, values); + } + if (mongoOptions.credentials) { + const isGssapi = mongoOptions.credentials.mechanism === providers_1.AuthMechanism.MONGODB_GSSAPI; + const isX509 = mongoOptions.credentials.mechanism === providers_1.AuthMechanism.MONGODB_X509; + const isAws = mongoOptions.credentials.mechanism === providers_1.AuthMechanism.MONGODB_AWS; + if ((isGssapi || isX509) && + allOptions.has('authSource') && + mongoOptions.credentials.source !== '$external') { + // If authSource was explicitly given and its incorrect, we error + throw new error_1.MongoParseError(`${mongoOptions.credentials} can only have authSource set to '$external'`); + } + if (!(isGssapi || isX509 || isAws) && mongoOptions.dbName && !allOptions.has('authSource')) { + // inherit the dbName unless GSSAPI or X509, then silently ignore dbName + // and there was no specific authSource given + mongoOptions.credentials = mongo_credentials_1.MongoCredentials.merge(mongoOptions.credentials, { + source: mongoOptions.dbName + }); + } + mongoOptions.credentials.validate(); + // Check if the only auth related option provided was authSource, if so we can remove credentials + if (mongoOptions.credentials.password === '' && + mongoOptions.credentials.username === '' && + mongoOptions.credentials.mechanism === providers_1.AuthMechanism.MONGODB_DEFAULT && + Object.keys(mongoOptions.credentials.mechanismProperties).length === 0) { + delete mongoOptions.credentials; + } + } + if (!mongoOptions.dbName) { + // dbName default is applied here because of the credential validation above + mongoOptions.dbName = 'test'; + } + checkTLSOptions(mongoOptions); + if (options.promiseLibrary) + promise_provider_1.PromiseProvider.set(options.promiseLibrary); + const lbError = validateLoadBalancedOptions(hosts, mongoOptions, isSRV); + if (lbError) { + throw lbError; + } + if (mongoClient && mongoOptions.autoEncryption) { + encrypter_1.Encrypter.checkForMongoCrypt(); + mongoOptions.encrypter = new encrypter_1.Encrypter(mongoClient, uri, options); + mongoOptions.autoEncrypter = mongoOptions.encrypter.autoEncrypter; + } + // Potential SRV Overrides and SRV connection string validations + mongoOptions.userSpecifiedAuthSource = + objectOptions.has('authSource') || urlOptions.has('authSource'); + mongoOptions.userSpecifiedReplicaSet = + objectOptions.has('replicaSet') || urlOptions.has('replicaSet'); + if (isSRV) { + // SRV Record is resolved upon connecting + mongoOptions.srvHost = hosts[0]; + if (mongoOptions.directConnection) { + throw new error_1.MongoAPIError('SRV URI does not support directConnection'); + } + if (mongoOptions.srvMaxHosts > 0 && typeof mongoOptions.replicaSet === 'string') { + throw new error_1.MongoParseError('Cannot use srvMaxHosts option with replicaSet'); + } + // SRV turns on TLS by default, but users can override and turn it off + const noUserSpecifiedTLS = !objectOptions.has('tls') && !urlOptions.has('tls'); + const noUserSpecifiedSSL = !objectOptions.has('ssl') && !urlOptions.has('ssl'); + if (noUserSpecifiedTLS && noUserSpecifiedSSL) { + mongoOptions.tls = true; + } + } + else { + const userSpecifiedSrvOptions = urlOptions.has('srvMaxHosts') || + objectOptions.has('srvMaxHosts') || + urlOptions.has('srvServiceName') || + objectOptions.has('srvServiceName'); + if (userSpecifiedSrvOptions) { + throw new error_1.MongoParseError('Cannot use srvMaxHosts or srvServiceName with a non-srv connection string'); + } + } + if (mongoOptions.directConnection && mongoOptions.hosts.length !== 1) { + throw new error_1.MongoParseError('directConnection option requires exactly one host'); + } + if (!mongoOptions.proxyHost && + (mongoOptions.proxyPort || mongoOptions.proxyUsername || mongoOptions.proxyPassword)) { + throw new error_1.MongoParseError('Must specify proxyHost if other proxy options are passed'); + } + if ((mongoOptions.proxyUsername && !mongoOptions.proxyPassword) || + (!mongoOptions.proxyUsername && mongoOptions.proxyPassword)) { + throw new error_1.MongoParseError('Can only specify both of proxy username/password or neither'); + } + const proxyOptions = ['proxyHost', 'proxyPort', 'proxyUsername', 'proxyPassword'].map(key => { var _a; return (_a = urlOptions.get(key)) !== null && _a !== void 0 ? _a : []; }); + if (proxyOptions.some(options => options.length > 1)) { + throw new error_1.MongoParseError('Proxy options cannot be specified multiple times in the connection string'); + } + return mongoOptions; +} +exports.parseOptions = parseOptions; +function validateLoadBalancedOptions(hosts, mongoOptions, isSrv) { + if (mongoOptions.loadBalanced) { + if (hosts.length > 1) { + return new error_1.MongoParseError(LB_SINGLE_HOST_ERROR); + } + if (mongoOptions.replicaSet) { + return new error_1.MongoParseError(LB_REPLICA_SET_ERROR); + } + if (mongoOptions.directConnection) { + return new error_1.MongoParseError(LB_DIRECT_CONNECTION_ERROR); + } + if (isSrv && mongoOptions.srvMaxHosts > 0) { + return new error_1.MongoParseError('Cannot limit srv hosts with loadBalanced enabled'); + } + } + return; +} +function setOption(mongoOptions, key, descriptor, values) { + const { target, type, transform, deprecated } = descriptor; + const name = target !== null && target !== void 0 ? target : key; + if (deprecated) { + const deprecatedMsg = typeof deprecated === 'string' ? `: ${deprecated}` : ''; + (0, utils_1.emitWarning)(`${key} is a deprecated option${deprecatedMsg}`); + } + switch (type) { + case 'boolean': + mongoOptions[name] = getBoolean(name, values[0]); + break; + case 'int': + mongoOptions[name] = getInt(name, values[0]); + break; + case 'uint': + mongoOptions[name] = getUint(name, values[0]); + break; + case 'string': + if (values[0] == null) { + break; + } + mongoOptions[name] = String(values[0]); + break; + case 'record': + if (!(0, utils_1.isRecord)(values[0])) { + throw new error_1.MongoParseError(`${name} must be an object`); + } + mongoOptions[name] = values[0]; + break; + case 'any': + mongoOptions[name] = values[0]; + break; + default: { + if (!transform) { + throw new error_1.MongoParseError('Descriptors missing a type must define a transform'); + } + const transformValue = transform({ name, options: mongoOptions, values }); + mongoOptions[name] = transformValue; + break; + } + } +} +exports.OPTIONS = { + appName: { + target: 'metadata', + transform({ options, values: [value] }) { + return (0, utils_1.makeClientMetadata)({ ...options.driverInfo, appName: String(value) }); + } + }, + auth: { + target: 'credentials', + transform({ name, options, values: [value] }) { + if (!(0, utils_1.isRecord)(value, ['username', 'password'])) { + throw new error_1.MongoParseError(`${name} must be an object with 'username' and 'password' properties`); + } + return mongo_credentials_1.MongoCredentials.merge(options.credentials, { + username: value.username, + password: value.password + }); + } + }, + authMechanism: { + target: 'credentials', + transform({ options, values: [value] }) { + var _a, _b; + const mechanisms = Object.values(providers_1.AuthMechanism); + const [mechanism] = mechanisms.filter(m => m.match(RegExp(String.raw `\b${value}\b`, 'i'))); + if (!mechanism) { + throw new error_1.MongoParseError(`authMechanism one of ${mechanisms}, got ${value}`); + } + let source = (_a = options.credentials) === null || _a === void 0 ? void 0 : _a.source; + if (mechanism === providers_1.AuthMechanism.MONGODB_PLAIN || + providers_1.AUTH_MECHS_AUTH_SRC_EXTERNAL.has(mechanism)) { + // some mechanisms have '$external' as the Auth Source + source = '$external'; + } + let password = (_b = options.credentials) === null || _b === void 0 ? void 0 : _b.password; + if (mechanism === providers_1.AuthMechanism.MONGODB_X509 && password === '') { + password = undefined; + } + return mongo_credentials_1.MongoCredentials.merge(options.credentials, { + mechanism, + source, + password + }); + } + }, + authMechanismProperties: { + target: 'credentials', + transform({ options, values: [optionValue] }) { + if (typeof optionValue === 'string') { + const mechanismProperties = Object.create(null); + for (const [key, value] of entriesFromString(optionValue)) { + try { + mechanismProperties[key] = getBoolean(key, value); + } + catch { + mechanismProperties[key] = value; + } + } + return mongo_credentials_1.MongoCredentials.merge(options.credentials, { + mechanismProperties + }); + } + if (!(0, utils_1.isRecord)(optionValue)) { + throw new error_1.MongoParseError('AuthMechanismProperties must be an object'); + } + return mongo_credentials_1.MongoCredentials.merge(options.credentials, { mechanismProperties: optionValue }); + } + }, + authSource: { + target: 'credentials', + transform({ options, values: [value] }) { + const source = String(value); + return mongo_credentials_1.MongoCredentials.merge(options.credentials, { source }); + } + }, + autoEncryption: { + type: 'record' + }, + bsonRegExp: { + type: 'boolean' + }, + serverApi: { + target: 'serverApi', + transform({ values: [version] }) { + const serverApiToValidate = typeof version === 'string' ? { version } : version; + const versionToValidate = serverApiToValidate && serverApiToValidate.version; + if (!versionToValidate) { + throw new error_1.MongoParseError(`Invalid \`serverApi\` property; must specify a version from the following enum: ["${Object.values(mongo_client_1.ServerApiVersion).join('", "')}"]`); + } + if (!Object.values(mongo_client_1.ServerApiVersion).some(v => v === versionToValidate)) { + throw new error_1.MongoParseError(`Invalid server API version=${versionToValidate}; must be in the following enum: ["${Object.values(mongo_client_1.ServerApiVersion).join('", "')}"]`); + } + return serverApiToValidate; + } + }, + checkKeys: { + type: 'boolean' + }, + compressors: { + default: 'none', + target: 'compressors', + transform({ values }) { + const compressionList = new Set(); + for (const compVal of values) { + const compValArray = typeof compVal === 'string' ? compVal.split(',') : compVal; + if (!Array.isArray(compValArray)) { + throw new error_1.MongoInvalidArgumentError('compressors must be an array or a comma-delimited list of strings'); + } + for (const c of compValArray) { + if (Object.keys(compression_1.Compressor).includes(String(c))) { + compressionList.add(String(c)); + } + else { + throw new error_1.MongoInvalidArgumentError(`${c} is not a valid compression mechanism. Must be one of: ${Object.keys(compression_1.Compressor)}.`); + } + } + } + return [...compressionList]; + } + }, + connectTimeoutMS: { + default: 30000, + type: 'uint' + }, + dbName: { + type: 'string' + }, + directConnection: { + default: false, + type: 'boolean' + }, + driverInfo: { + target: 'metadata', + default: (0, utils_1.makeClientMetadata)(), + transform({ options, values: [value] }) { + var _a, _b; + if (!(0, utils_1.isRecord)(value)) + throw new error_1.MongoParseError('DriverInfo must be an object'); + return (0, utils_1.makeClientMetadata)({ + driverInfo: value, + appName: (_b = (_a = options.metadata) === null || _a === void 0 ? void 0 : _a.application) === null || _b === void 0 ? void 0 : _b.name + }); + } + }, + enableUtf8Validation: { type: 'boolean', default: true }, + family: { + transform({ name, values: [value] }) { + const transformValue = getInt(name, value); + if (transformValue === 4 || transformValue === 6) { + return transformValue; + } + throw new error_1.MongoParseError(`Option 'family' must be 4 or 6 got ${transformValue}.`); + } + }, + fieldsAsRaw: { + type: 'record' + }, + forceServerObjectId: { + default: false, + type: 'boolean' + }, + fsync: { + deprecated: 'Please use journal instead', + target: 'writeConcern', + transform({ name, options, values: [value] }) { + const wc = write_concern_1.WriteConcern.fromOptions({ + writeConcern: { + ...options.writeConcern, + fsync: getBoolean(name, value) + } + }); + if (!wc) + throw new error_1.MongoParseError(`Unable to make a writeConcern from fsync=${value}`); + return wc; + } + }, + heartbeatFrequencyMS: { + default: 10000, + type: 'uint' + }, + ignoreUndefined: { + type: 'boolean' + }, + j: { + deprecated: 'Please use journal instead', + target: 'writeConcern', + transform({ name, options, values: [value] }) { + const wc = write_concern_1.WriteConcern.fromOptions({ + writeConcern: { + ...options.writeConcern, + journal: getBoolean(name, value) + } + }); + if (!wc) + throw new error_1.MongoParseError(`Unable to make a writeConcern from journal=${value}`); + return wc; + } + }, + journal: { + target: 'writeConcern', + transform({ name, options, values: [value] }) { + const wc = write_concern_1.WriteConcern.fromOptions({ + writeConcern: { + ...options.writeConcern, + journal: getBoolean(name, value) + } + }); + if (!wc) + throw new error_1.MongoParseError(`Unable to make a writeConcern from journal=${value}`); + return wc; + } + }, + keepAlive: { + default: true, + type: 'boolean' + }, + keepAliveInitialDelay: { + default: 120000, + type: 'uint' + }, + loadBalanced: { + default: false, + type: 'boolean' + }, + localThresholdMS: { + default: 15, + type: 'uint' + }, + logger: { + default: new logger_1.Logger('MongoClient'), + transform({ values: [value] }) { + if (value instanceof logger_1.Logger) { + return value; + } + (0, utils_1.emitWarning)('Alternative loggers might not be supported'); + // TODO: make Logger an interface that others can implement, make usage consistent in driver + // DRIVERS-1204 + return; + } + }, + loggerLevel: { + target: 'logger', + transform({ values: [value] }) { + return new logger_1.Logger('MongoClient', { loggerLevel: value }); + } + }, + maxConnecting: { + default: 2, + transform({ name, values: [value] }) { + const maxConnecting = getUint(name, value); + if (maxConnecting === 0) { + throw new error_1.MongoInvalidArgumentError('maxConnecting must be > 0 if specified'); + } + return maxConnecting; + } + }, + maxIdleTimeMS: { + default: 0, + type: 'uint' + }, + maxPoolSize: { + default: 100, + type: 'uint' + }, + maxStalenessSeconds: { + target: 'readPreference', + transform({ name, options, values: [value] }) { + const maxStalenessSeconds = getUint(name, value); + if (options.readPreference) { + return read_preference_1.ReadPreference.fromOptions({ + readPreference: { ...options.readPreference, maxStalenessSeconds } + }); + } + else { + return new read_preference_1.ReadPreference('secondary', undefined, { maxStalenessSeconds }); + } + } + }, + minInternalBufferSize: { + type: 'uint' + }, + minPoolSize: { + default: 0, + type: 'uint' + }, + minHeartbeatFrequencyMS: { + default: 500, + type: 'uint' + }, + monitorCommands: { + default: false, + type: 'boolean' + }, + name: { + target: 'driverInfo', + transform({ values: [value], options }) { + return { ...options.driverInfo, name: String(value) }; + } + }, + noDelay: { + default: true, + type: 'boolean' + }, + pkFactory: { + default: utils_1.DEFAULT_PK_FACTORY, + transform({ values: [value] }) { + if ((0, utils_1.isRecord)(value, ['createPk']) && typeof value.createPk === 'function') { + return value; + } + throw new error_1.MongoParseError(`Option pkFactory must be an object with a createPk function, got ${value}`); + } + }, + promiseLibrary: { + deprecated: true, + type: 'any' + }, + promoteBuffers: { + type: 'boolean' + }, + promoteLongs: { + type: 'boolean' + }, + promoteValues: { + type: 'boolean' + }, + proxyHost: { + type: 'string' + }, + proxyPassword: { + type: 'string' + }, + proxyPort: { + type: 'uint' + }, + proxyUsername: { + type: 'string' + }, + raw: { + default: false, + type: 'boolean' + }, + readConcern: { + transform({ values: [value], options }) { + if (value instanceof read_concern_1.ReadConcern || (0, utils_1.isRecord)(value, ['level'])) { + return read_concern_1.ReadConcern.fromOptions({ ...options.readConcern, ...value }); + } + throw new error_1.MongoParseError(`ReadConcern must be an object, got ${JSON.stringify(value)}`); + } + }, + readConcernLevel: { + target: 'readConcern', + transform({ values: [level], options }) { + return read_concern_1.ReadConcern.fromOptions({ + ...options.readConcern, + level: level + }); + } + }, + readPreference: { + default: read_preference_1.ReadPreference.primary, + transform({ values: [value], options }) { + var _a, _b, _c; + if (value instanceof read_preference_1.ReadPreference) { + return read_preference_1.ReadPreference.fromOptions({ + readPreference: { ...options.readPreference, ...value }, + ...value + }); + } + if ((0, utils_1.isRecord)(value, ['mode'])) { + const rp = read_preference_1.ReadPreference.fromOptions({ + readPreference: { ...options.readPreference, ...value }, + ...value + }); + if (rp) + return rp; + else + throw new error_1.MongoParseError(`Cannot make read preference from ${JSON.stringify(value)}`); + } + if (typeof value === 'string') { + const rpOpts = { + hedge: (_a = options.readPreference) === null || _a === void 0 ? void 0 : _a.hedge, + maxStalenessSeconds: (_b = options.readPreference) === null || _b === void 0 ? void 0 : _b.maxStalenessSeconds + }; + return new read_preference_1.ReadPreference(value, (_c = options.readPreference) === null || _c === void 0 ? void 0 : _c.tags, rpOpts); + } + throw new error_1.MongoParseError(`Unknown ReadPreference value: ${value}`); + } + }, + readPreferenceTags: { + target: 'readPreference', + transform({ values, options }) { + const tags = Array.isArray(values[0]) + ? values[0] + : values; + const readPreferenceTags = []; + for (const tag of tags) { + const readPreferenceTag = Object.create(null); + if (typeof tag === 'string') { + for (const [k, v] of entriesFromString(tag)) { + readPreferenceTag[k] = v; + } + } + if ((0, utils_1.isRecord)(tag)) { + for (const [k, v] of Object.entries(tag)) { + readPreferenceTag[k] = v; + } + } + readPreferenceTags.push(readPreferenceTag); + } + return read_preference_1.ReadPreference.fromOptions({ + readPreference: options.readPreference, + readPreferenceTags + }); + } + }, + replicaSet: { + type: 'string' + }, + retryReads: { + default: true, + type: 'boolean' + }, + retryWrites: { + default: true, + type: 'boolean' + }, + serializeFunctions: { + type: 'boolean' + }, + serverSelectionTimeoutMS: { + default: 30000, + type: 'uint' + }, + servername: { + type: 'string' + }, + socketTimeoutMS: { + default: 0, + type: 'uint' + }, + srvMaxHosts: { + type: 'uint', + default: 0 + }, + srvServiceName: { + type: 'string', + default: 'mongodb' + }, + ssl: { + target: 'tls', + type: 'boolean' + }, + sslCA: { + target: 'ca', + transform({ values: [value] }) { + return fs.readFileSync(String(value), { encoding: 'ascii' }); + } + }, + sslCRL: { + target: 'crl', + transform({ values: [value] }) { + return fs.readFileSync(String(value), { encoding: 'ascii' }); + } + }, + sslCert: { + target: 'cert', + transform({ values: [value] }) { + return fs.readFileSync(String(value), { encoding: 'ascii' }); + } + }, + sslKey: { + target: 'key', + transform({ values: [value] }) { + return fs.readFileSync(String(value), { encoding: 'ascii' }); + } + }, + sslPass: { + deprecated: true, + target: 'passphrase', + type: 'string' + }, + sslValidate: { + target: 'rejectUnauthorized', + type: 'boolean' + }, + tls: { + type: 'boolean' + }, + tlsAllowInvalidCertificates: { + target: 'rejectUnauthorized', + transform({ name, values: [value] }) { + // allowInvalidCertificates is the inverse of rejectUnauthorized + return !getBoolean(name, value); + } + }, + tlsAllowInvalidHostnames: { + target: 'checkServerIdentity', + transform({ name, values: [value] }) { + // tlsAllowInvalidHostnames means setting the checkServerIdentity function to a noop + return getBoolean(name, value) ? () => undefined : undefined; + } + }, + tlsCAFile: { + target: 'ca', + transform({ values: [value] }) { + return fs.readFileSync(String(value), { encoding: 'ascii' }); + } + }, + tlsCertificateFile: { + target: 'cert', + transform({ values: [value] }) { + return fs.readFileSync(String(value), { encoding: 'ascii' }); + } + }, + tlsCertificateKeyFile: { + target: 'key', + transform({ values: [value] }) { + return fs.readFileSync(String(value), { encoding: 'ascii' }); + } + }, + tlsCertificateKeyFilePassword: { + target: 'passphrase', + type: 'any' + }, + tlsInsecure: { + transform({ name, options, values: [value] }) { + const tlsInsecure = getBoolean(name, value); + if (tlsInsecure) { + options.checkServerIdentity = () => undefined; + options.rejectUnauthorized = false; + } + else { + options.checkServerIdentity = options.tlsAllowInvalidHostnames + ? () => undefined + : undefined; + options.rejectUnauthorized = options.tlsAllowInvalidCertificates ? false : true; + } + return tlsInsecure; + } + }, + w: { + target: 'writeConcern', + transform({ values: [value], options }) { + return write_concern_1.WriteConcern.fromOptions({ writeConcern: { ...options.writeConcern, w: value } }); + } + }, + waitQueueTimeoutMS: { + default: 0, + type: 'uint' + }, + writeConcern: { + target: 'writeConcern', + transform({ values: [value], options }) { + if ((0, utils_1.isRecord)(value) || value instanceof write_concern_1.WriteConcern) { + return write_concern_1.WriteConcern.fromOptions({ + writeConcern: { + ...options.writeConcern, + ...value + } + }); + } + else if (value === 'majority' || typeof value === 'number') { + return write_concern_1.WriteConcern.fromOptions({ + writeConcern: { + ...options.writeConcern, + w: value + } + }); + } + throw new error_1.MongoParseError(`Invalid WriteConcern cannot parse: ${JSON.stringify(value)}`); + } + }, + wtimeout: { + deprecated: 'Please use wtimeoutMS instead', + target: 'writeConcern', + transform({ values: [value], options }) { + const wc = write_concern_1.WriteConcern.fromOptions({ + writeConcern: { + ...options.writeConcern, + wtimeout: getUint('wtimeout', value) + } + }); + if (wc) + return wc; + throw new error_1.MongoParseError(`Cannot make WriteConcern from wtimeout`); + } + }, + wtimeoutMS: { + target: 'writeConcern', + transform({ values: [value], options }) { + const wc = write_concern_1.WriteConcern.fromOptions({ + writeConcern: { + ...options.writeConcern, + wtimeoutMS: getUint('wtimeoutMS', value) + } + }); + if (wc) + return wc; + throw new error_1.MongoParseError(`Cannot make WriteConcern from wtimeout`); + } + }, + zlibCompressionLevel: { + default: 0, + type: 'int' + }, + // Custom types for modifying core behavior + connectionType: { type: 'any' }, + srvPoller: { type: 'any' }, + // Accepted NodeJS Options + minDHSize: { type: 'any' }, + pskCallback: { type: 'any' }, + secureContext: { type: 'any' }, + enableTrace: { type: 'any' }, + requestCert: { type: 'any' }, + rejectUnauthorized: { type: 'any' }, + checkServerIdentity: { type: 'any' }, + ALPNProtocols: { type: 'any' }, + SNICallback: { type: 'any' }, + session: { type: 'any' }, + requestOCSP: { type: 'any' }, + localAddress: { type: 'any' }, + localPort: { type: 'any' }, + hints: { type: 'any' }, + lookup: { type: 'any' }, + ca: { type: 'any' }, + cert: { type: 'any' }, + ciphers: { type: 'any' }, + crl: { type: 'any' }, + ecdhCurve: { type: 'any' }, + key: { type: 'any' }, + passphrase: { type: 'any' }, + pfx: { type: 'any' }, + secureProtocol: { type: 'any' }, + index: { type: 'any' }, + // Legacy Options, these are unused but left here to avoid errors with CSFLE lib + useNewUrlParser: { type: 'boolean' }, + useUnifiedTopology: { type: 'boolean' } +}; +exports.DEFAULT_OPTIONS = new CaseInsensitiveMap(Object.entries(exports.OPTIONS) + .filter(([, descriptor]) => descriptor.default != null) + .map(([k, d]) => [k, d.default])); +/** + * Set of permitted feature flags + * @internal + */ +exports.FEATURE_FLAGS = new Set([Symbol.for('@@mdb.skipPingOnConnect')]); +//# sourceMappingURL=connection_string.js.map \ No newline at end of file diff --git a/node_modules/mongodb/lib/connection_string.js.map b/node_modules/mongodb/lib/connection_string.js.map new file mode 100644 index 000000000..1584fccce --- /dev/null +++ b/node_modules/mongodb/lib/connection_string.js.map @@ -0,0 +1 @@ +{"version":3,"file":"connection_string.js","sourceRoot":"","sources":["../src/connection_string.ts"],"names":[],"mappings":";;;AAAA,2BAA2B;AAC3B,yBAAyB;AACzB,iFAA6D;AAC7D,6BAAsC;AAGtC,qEAAiE;AACjE,qDAAoF;AACpF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E;IACtB,MAAM,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE;IACvB,EAAE,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE;IACnB,IAAI,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE;IACrB,OAAO,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE;IACxB,GAAG,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE;IACpB,SAAS,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE;IAC1B,GAAG,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE;IACpB,UAAU,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE;IAC3B,GAAG,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE;IACpB,cAAc,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE;IAC/B,KAAK,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE;IACtB,gFAAgF;IAChF,eAAe,EAAE,EAAE,IAAI,EAAE,SAAS,EAAsB;IACxD,kBAAkB,EAAE,EAAE,IAAI,EAAE,SAAS,EAAsB;CACN,CAAC;AAE3C,QAAA,eAAe,GAAG,IAAI,kBAAkB,CACnD,MAAM,CAAC,OAAO,CAAC,eAAO,CAAC;KACpB,MAAM,CAAC,CAAC,CAAC,EAAE,UAAU,CAAC,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,IAAI,IAAI,CAAC;KACtD,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CACnC,CAAC;AAEF;;;GAGG;AACU,QAAA,aAAa,GAAG,IAAI,GAAG,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,yBAAyB,CAAC,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/mongodb/lib/constants.js b/node_modules/mongodb/lib/constants.js new file mode 100644 index 000000000..83653840d --- /dev/null +++ b/node_modules/mongodb/lib/constants.js @@ -0,0 +1,129 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.APM_EVENTS = exports.TOPOLOGY_EVENTS = exports.CMAP_EVENTS = exports.HEARTBEAT_EVENTS = exports.RESUME_TOKEN_CHANGED = exports.END = exports.CHANGE = exports.INIT = exports.MORE = exports.RESPONSE = exports.SERVER_HEARTBEAT_FAILED = exports.SERVER_HEARTBEAT_SUCCEEDED = exports.SERVER_HEARTBEAT_STARTED = exports.COMMAND_FAILED = exports.COMMAND_SUCCEEDED = exports.COMMAND_STARTED = exports.CLUSTER_TIME_RECEIVED = exports.CONNECTION_CHECKED_IN = exports.CONNECTION_CHECKED_OUT = exports.CONNECTION_CHECK_OUT_FAILED = exports.CONNECTION_CHECK_OUT_STARTED = exports.CONNECTION_CLOSED = exports.CONNECTION_READY = exports.CONNECTION_CREATED = exports.CONNECTION_POOL_CLEARED = exports.CONNECTION_POOL_CLOSED = exports.CONNECTION_POOL_CREATED = exports.TOPOLOGY_DESCRIPTION_CHANGED = exports.TOPOLOGY_CLOSED = exports.TOPOLOGY_OPENING = exports.SERVER_DESCRIPTION_CHANGED = exports.SERVER_CLOSED = exports.SERVER_OPENING = exports.DESCRIPTION_RECEIVED = exports.UNPINNED = exports.PINNED = exports.MESSAGE = exports.ENDED = exports.CLOSED = exports.CONNECT = exports.OPEN = exports.CLOSE = exports.TIMEOUT = exports.ERROR = exports.SYSTEM_JS_COLLECTION = exports.SYSTEM_COMMAND_COLLECTION = exports.SYSTEM_USER_COLLECTION = exports.SYSTEM_PROFILE_COLLECTION = exports.SYSTEM_INDEX_COLLECTION = exports.SYSTEM_NAMESPACE_COLLECTION = void 0; +exports.LEGACY_HELLO_COMMAND_CAMEL_CASE = exports.LEGACY_HELLO_COMMAND = exports.MONGO_CLIENT_EVENTS = exports.LOCAL_SERVER_EVENTS = exports.SERVER_RELAY_EVENTS = void 0; +exports.SYSTEM_NAMESPACE_COLLECTION = 'system.namespaces'; +exports.SYSTEM_INDEX_COLLECTION = 'system.indexes'; +exports.SYSTEM_PROFILE_COLLECTION = 'system.profile'; +exports.SYSTEM_USER_COLLECTION = 'system.users'; +exports.SYSTEM_COMMAND_COLLECTION = '$cmd'; +exports.SYSTEM_JS_COLLECTION = 'system.js'; +// events +exports.ERROR = 'error'; +exports.TIMEOUT = 'timeout'; +exports.CLOSE = 'close'; +exports.OPEN = 'open'; +exports.CONNECT = 'connect'; +exports.CLOSED = 'closed'; +exports.ENDED = 'ended'; +exports.MESSAGE = 'message'; +exports.PINNED = 'pinned'; +exports.UNPINNED = 'unpinned'; +exports.DESCRIPTION_RECEIVED = 'descriptionReceived'; +exports.SERVER_OPENING = 'serverOpening'; +exports.SERVER_CLOSED = 'serverClosed'; +exports.SERVER_DESCRIPTION_CHANGED = 'serverDescriptionChanged'; +exports.TOPOLOGY_OPENING = 'topologyOpening'; +exports.TOPOLOGY_CLOSED = 'topologyClosed'; +exports.TOPOLOGY_DESCRIPTION_CHANGED = 'topologyDescriptionChanged'; +exports.CONNECTION_POOL_CREATED = 'connectionPoolCreated'; +exports.CONNECTION_POOL_CLOSED = 'connectionPoolClosed'; +exports.CONNECTION_POOL_CLEARED = 'connectionPoolCleared'; +exports.CONNECTION_CREATED = 'connectionCreated'; +exports.CONNECTION_READY = 'connectionReady'; +exports.CONNECTION_CLOSED = 'connectionClosed'; +exports.CONNECTION_CHECK_OUT_STARTED = 'connectionCheckOutStarted'; +exports.CONNECTION_CHECK_OUT_FAILED = 'connectionCheckOutFailed'; +exports.CONNECTION_CHECKED_OUT = 'connectionCheckedOut'; +exports.CONNECTION_CHECKED_IN = 'connectionCheckedIn'; +exports.CLUSTER_TIME_RECEIVED = 'clusterTimeReceived'; +exports.COMMAND_STARTED = 'commandStarted'; +exports.COMMAND_SUCCEEDED = 'commandSucceeded'; +exports.COMMAND_FAILED = 'commandFailed'; +exports.SERVER_HEARTBEAT_STARTED = 'serverHeartbeatStarted'; +exports.SERVER_HEARTBEAT_SUCCEEDED = 'serverHeartbeatSucceeded'; +exports.SERVER_HEARTBEAT_FAILED = 'serverHeartbeatFailed'; +exports.RESPONSE = 'response'; +exports.MORE = 'more'; +exports.INIT = 'init'; +exports.CHANGE = 'change'; +exports.END = 'end'; +exports.RESUME_TOKEN_CHANGED = 'resumeTokenChanged'; +/** @public */ +exports.HEARTBEAT_EVENTS = Object.freeze([ + exports.SERVER_HEARTBEAT_STARTED, + exports.SERVER_HEARTBEAT_SUCCEEDED, + exports.SERVER_HEARTBEAT_FAILED +]); +/** @public */ +exports.CMAP_EVENTS = Object.freeze([ + exports.CONNECTION_POOL_CREATED, + exports.CONNECTION_POOL_CLOSED, + exports.CONNECTION_CREATED, + exports.CONNECTION_READY, + exports.CONNECTION_CLOSED, + exports.CONNECTION_CHECK_OUT_STARTED, + exports.CONNECTION_CHECK_OUT_FAILED, + exports.CONNECTION_CHECKED_OUT, + exports.CONNECTION_CHECKED_IN, + exports.CONNECTION_POOL_CLEARED +]); +/** @public */ +exports.TOPOLOGY_EVENTS = Object.freeze([ + exports.SERVER_OPENING, + exports.SERVER_CLOSED, + exports.SERVER_DESCRIPTION_CHANGED, + exports.TOPOLOGY_OPENING, + exports.TOPOLOGY_CLOSED, + exports.TOPOLOGY_DESCRIPTION_CHANGED, + exports.ERROR, + exports.TIMEOUT, + exports.CLOSE +]); +/** @public */ +exports.APM_EVENTS = Object.freeze([ + exports.COMMAND_STARTED, + exports.COMMAND_SUCCEEDED, + exports.COMMAND_FAILED +]); +/** + * All events that we relay to the `Topology` + * @internal + */ +exports.SERVER_RELAY_EVENTS = Object.freeze([ + exports.SERVER_HEARTBEAT_STARTED, + exports.SERVER_HEARTBEAT_SUCCEEDED, + exports.SERVER_HEARTBEAT_FAILED, + exports.COMMAND_STARTED, + exports.COMMAND_SUCCEEDED, + exports.COMMAND_FAILED, + ...exports.CMAP_EVENTS +]); +/** + * All events we listen to from `Server` instances, but do not forward to the client + * @internal + */ +exports.LOCAL_SERVER_EVENTS = Object.freeze([ + exports.CONNECT, + exports.DESCRIPTION_RECEIVED, + exports.CLOSED, + exports.ENDED +]); +/** @public */ +exports.MONGO_CLIENT_EVENTS = Object.freeze([ + ...exports.CMAP_EVENTS, + ...exports.APM_EVENTS, + ...exports.TOPOLOGY_EVENTS, + ...exports.HEARTBEAT_EVENTS +]); +/** + * @internal + * The legacy hello command that was deprecated in MongoDB 5.0. + */ +exports.LEGACY_HELLO_COMMAND = 'ismaster'; +/** + * @internal + * The legacy hello command that was deprecated in MongoDB 5.0. + */ +exports.LEGACY_HELLO_COMMAND_CAMEL_CASE = 'isMaster'; +//# sourceMappingURL=constants.js.map \ No newline at end of file diff --git a/node_modules/mongodb/lib/constants.js.map b/node_modules/mongodb/lib/constants.js.map new file mode 100644 index 000000000..f6e3365c5 --- /dev/null +++ b/node_modules/mongodb/lib/constants.js.map @@ -0,0 +1 @@ +{"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":";;;;AAAa,QAAA,2BAA2B,GAAG,mBAAmB,CAAC;AAClD,QAAA,uBAAuB,GAAG,gBAAgB,CAAC;AAC3C,QAAA,yBAAyB,GAAG,gBAAgB,CAAC;AAC7C,QAAA,sBAAsB,GAAG,cAAc,CAAC;AACxC,QAAA,yBAAyB,GAAG,MAAM,CAAC;AACnC,QAAA,oBAAoB,GAAG,WAAW,CAAC;AAEhD,SAAS;AACI,QAAA,KAAK,GAAG,OAAgB,CAAC;AACzB,QAAA,OAAO,GAAG,SAAkB,CAAC;AAC7B,QAAA,KAAK,GAAG,OAAgB,CAAC;AACzB,QAAA,IAAI,GAAG,MAAe,CAAC;AACvB,QAAA,OAAO,GAAG,SAAkB,CAAC;AAC7B,QAAA,MAAM,GAAG,QAAiB,CAAC;AAC3B,QAAA,KAAK,GAAG,OAAgB,CAAC;AACzB,QAAA,OAAO,GAAG,SAAkB,CAAC;AAC7B,QAAA,MAAM,GAAG,QAAiB,CAAC;AAC3B,QAAA,QAAQ,GAAG,UAAmB,CAAC;AAC/B,QAAA,oBAAoB,GAAG,qBAAqB,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modules/mongodb/lib/cursor/abstract_cursor.js new file mode 100644 index 000000000..5b518f7c6 --- /dev/null +++ b/node_modules/mongodb/lib/cursor/abstract_cursor.js @@ -0,0 +1,659 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.assertUninitialized = exports.AbstractCursor = exports.CURSOR_FLAGS = void 0; +const stream_1 = require("stream"); +const bson_1 = require("../bson"); +const error_1 = require("../error"); +const mongo_types_1 = require("../mongo_types"); +const execute_operation_1 = require("../operations/execute_operation"); +const get_more_1 = require("../operations/get_more"); +const read_concern_1 = require("../read_concern"); +const read_preference_1 = require("../read_preference"); +const sessions_1 = require("../sessions"); +const utils_1 = require("../utils"); +/** @internal */ +const kId = Symbol('id'); +/** @internal */ +const kDocuments = Symbol('documents'); +/** @internal */ +const kServer = Symbol('server'); +/** @internal */ +const kNamespace = Symbol('namespace'); +/** @internal */ +const kClient = Symbol('client'); +/** @internal */ +const kSession = Symbol('session'); +/** @internal */ +const kOptions = Symbol('options'); +/** @internal */ +const kTransform = Symbol('transform'); +/** @internal */ +const kInitialized = Symbol('initialized'); +/** @internal */ +const kClosed = Symbol('closed'); +/** @internal */ +const kKilled = Symbol('killed'); +/** @internal */ +const kInit = Symbol('kInit'); +/** @public */ +exports.CURSOR_FLAGS = [ + 'tailable', + 'oplogReplay', + 'noCursorTimeout', + 'awaitData', + 'exhaust', + 'partial' +]; +/** @public */ +class AbstractCursor extends mongo_types_1.TypedEventEmitter { + /** @internal */ + constructor(client, namespace, options = {}) { + super(); + if (!client.s.isMongoClient) { + throw new error_1.MongoRuntimeError('Cursor must be constructed with MongoClient'); + } + this[kClient] = client; + this[kNamespace] = namespace; + this[kDocuments] = []; // TODO: https://github.com/microsoft/TypeScript/issues/36230 + this[kInitialized] = false; + this[kClosed] = false; + this[kKilled] = false; + this[kOptions] = { + readPreference: options.readPreference && options.readPreference instanceof read_preference_1.ReadPreference + ? options.readPreference + : read_preference_1.ReadPreference.primary, + ...(0, bson_1.pluckBSONSerializeOptions)(options) + }; + const readConcern = read_concern_1.ReadConcern.fromOptions(options); + if (readConcern) { + this[kOptions].readConcern = readConcern; + } + if (typeof options.batchSize === 'number') { + this[kOptions].batchSize = options.batchSize; + } + // we check for undefined specifically here to allow falsy values + // eslint-disable-next-line no-restricted-syntax + if (options.comment !== undefined) { + this[kOptions].comment = options.comment; + } + if (typeof options.maxTimeMS === 'number') { + this[kOptions].maxTimeMS = options.maxTimeMS; + } + if (options.session instanceof sessions_1.ClientSession) { + this[kSession] = options.session; + } + } + get id() { + return this[kId]; + } + /** @internal */ + get client() { + return this[kClient]; + } + /** @internal */ + get server() { + return this[kServer]; + } + get namespace() { + return this[kNamespace]; + } + get readPreference() { + return this[kOptions].readPreference; + } + get readConcern() { + return this[kOptions].readConcern; + } + /** @internal */ + get session() { + return this[kSession]; + } + set session(clientSession) { + this[kSession] = clientSession; + } + /** @internal */ + get cursorOptions() { + return this[kOptions]; + } + get closed() { + return this[kClosed]; + } + get killed() { + return this[kKilled]; + } + get loadBalanced() { + var _a; + return !!((_a = this[kClient].topology) === null || _a === void 0 ? void 0 : _a.loadBalanced); + } + /** Returns current buffered documents length */ + bufferedCount() { + return this[kDocuments].length; + } + /** Returns current buffered documents */ + readBufferedDocuments(number) { + return this[kDocuments].splice(0, number !== null && number !== void 0 ? number : this[kDocuments].length); + } + [Symbol.asyncIterator]() { + return { + next: () => this.next().then(value => value != null ? { value, done: false } : { value: undefined, done: true }) + }; + } + stream(options) { + if (options === null || options === void 0 ? void 0 : options.transform) { + const transform = options.transform; + const readable = makeCursorStream(this); + return readable.pipe(new stream_1.Transform({ + objectMode: true, + highWaterMark: 1, + transform(chunk, _, callback) { + try { + const transformed = transform(chunk); + callback(undefined, transformed); + } + catch (err) { + callback(err); + } + } + })); + } + return makeCursorStream(this); + } + hasNext(callback) { + return (0, utils_1.maybePromise)(callback, done => { + if (this[kId] === bson_1.Long.ZERO) { + return done(undefined, false); + } + if (this[kDocuments].length) { + return done(undefined, true); + } + next(this, true, (err, doc) => { + if (err) + return done(err); + if (doc) { + this[kDocuments].unshift(doc); + done(undefined, true); + return; + } + done(undefined, false); + }); + }); + } + next(callback) { + return (0, utils_1.maybePromise)(callback, done => { + if (this[kId] === bson_1.Long.ZERO) { + return done(new error_1.MongoCursorExhaustedError()); + } + next(this, true, done); + }); + } + tryNext(callback) { + return (0, utils_1.maybePromise)(callback, done => { + if (this[kId] === bson_1.Long.ZERO) { + return done(new error_1.MongoCursorExhaustedError()); + } + next(this, false, done); + }); + } + forEach(iterator, callback) { + if (typeof iterator !== 'function') { + throw new error_1.MongoInvalidArgumentError('Argument "iterator" must be a function'); + } + return (0, utils_1.maybePromise)(callback, done => { + const transform = this[kTransform]; + const fetchDocs = () => { + next(this, true, (err, doc) => { + if (err || doc == null) + return done(err); + let result; + // NOTE: no need to transform because `next` will do this automatically + try { + result = iterator(doc); // TODO(NODE-3283): Improve transform typing + } + catch (error) { + return done(error); + } + if (result === false) + return done(); + // these do need to be transformed since they are copying the rest of the batch + const internalDocs = this[kDocuments].splice(0, this[kDocuments].length); + for (let i = 0; i < internalDocs.length; ++i) { + try { + result = iterator((transform ? transform(internalDocs[i]) : internalDocs[i]) // TODO(NODE-3283): Improve transform typing + ); + } + catch (error) { + return done(error); + } + if (result === false) + return done(); + } + fetchDocs(); + }); + }; + fetchDocs(); + }); + } + close(options, callback) { + if (typeof options === 'function') + (callback = options), (options = {}); + options = options !== null && options !== void 0 ? options : {}; + const needsToEmitClosed = !this[kClosed]; + this[kClosed] = true; + return (0, utils_1.maybePromise)(callback, done => cleanupCursor(this, { needsToEmitClosed }, done)); + } + toArray(callback) { + return (0, utils_1.maybePromise)(callback, done => { + const docs = []; + const transform = this[kTransform]; + const fetchDocs = () => { + // NOTE: if we add a `nextBatch` then we should use it here + next(this, true, (err, doc) => { + if (err) + return done(err); + if (doc == null) + return done(undefined, docs); + // NOTE: no need to transform because `next` will do this automatically + docs.push(doc); + // these do need to be transformed since they are copying the rest of the batch + const internalDocs = (transform + ? this[kDocuments].splice(0, this[kDocuments].length).map(transform) + : this[kDocuments].splice(0, this[kDocuments].length)); // TODO(NODE-3283): Improve transform typing + if (internalDocs) { + docs.push(...internalDocs); + } + fetchDocs(); + }); + }; + fetchDocs(); + }); + } + /** + * Add a cursor flag to the cursor + * + * @param flag - The flag to set, must be one of following ['tailable', 'oplogReplay', 'noCursorTimeout', 'awaitData', 'partial' -. + * @param value - The flag boolean value. + */ + addCursorFlag(flag, value) { + assertUninitialized(this); + if (!exports.CURSOR_FLAGS.includes(flag)) { + throw new error_1.MongoInvalidArgumentError(`Flag ${flag} is not one of ${exports.CURSOR_FLAGS}`); + } + if (typeof value !== 'boolean') { + throw new error_1.MongoInvalidArgumentError(`Flag ${flag} must be a boolean value`); + } + this[kOptions][flag] = value; + return this; + } + /** + * Map all documents using the provided function + * If there is a transform set on the cursor, that will be called first and the result passed to + * this function's transform. + * + * @remarks + * **Note for Typescript Users:** adding a transform changes the return type of the iteration of this cursor, + * it **does not** return a new instance of a cursor. This means when calling map, + * you should always assign the result to a new variable in order to get a correctly typed cursor variable. + * Take note of the following example: + * + * @example + * ```typescript + * const cursor: FindCursor = coll.find(); + * const mappedCursor: FindCursor = cursor.map(doc => Object.keys(doc).length); + * const keyCounts: number[] = await mappedCursor.toArray(); // cursor.toArray() still returns Document[] + * ``` + * @param transform - The mapping transformation method. + */ + map(transform) { + assertUninitialized(this); + const oldTransform = this[kTransform]; // TODO(NODE-3283): Improve transform typing + if (oldTransform) { + this[kTransform] = doc => { + return transform(oldTransform(doc)); + }; + } + else { + this[kTransform] = transform; + } + return this; + } + /** + * Set the ReadPreference for the cursor. + * + * @param readPreference - The new read preference for the cursor. + */ + withReadPreference(readPreference) { + assertUninitialized(this); + if (readPreference instanceof read_preference_1.ReadPreference) { + this[kOptions].readPreference = readPreference; + } + else if (typeof readPreference === 'string') { + this[kOptions].readPreference = read_preference_1.ReadPreference.fromString(readPreference); + } + else { + throw new error_1.MongoInvalidArgumentError(`Invalid read preference: ${readPreference}`); + } + return this; + } + /** + * Set the ReadPreference for the cursor. + * + * @param readPreference - The new read preference for the cursor. + */ + withReadConcern(readConcern) { + assertUninitialized(this); + const resolvedReadConcern = read_concern_1.ReadConcern.fromOptions({ readConcern }); + if (resolvedReadConcern) { + this[kOptions].readConcern = resolvedReadConcern; + } + return this; + } + /** + * Set a maxTimeMS on the cursor query, allowing for hard timeout limits on queries (Only supported on MongoDB 2.6 or higher) + * + * @param value - Number of milliseconds to wait before aborting the query. + */ + maxTimeMS(value) { + assertUninitialized(this); + if (typeof value !== 'number') { + throw new error_1.MongoInvalidArgumentError('Argument for maxTimeMS must be a number'); + } + this[kOptions].maxTimeMS = value; + return this; + } + /** + * Set the batch size for the cursor. + * + * @param value - The number of documents to return per batch. See {@link https://docs.mongodb.com/manual/reference/command/find/|find command documentation}. + */ + batchSize(value) { + assertUninitialized(this); + if (this[kOptions].tailable) { + throw new error_1.MongoTailableCursorError('Tailable cursor does not support batchSize'); + } + if (typeof value !== 'number') { + throw new error_1.MongoInvalidArgumentError('Operation "batchSize" requires an integer'); + } + this[kOptions].batchSize = value; + return this; + } + /** + * Rewind this cursor to its uninitialized state. Any options that are present on the cursor will + * remain in effect. Iterating this cursor will cause new queries to be sent to the server, even + * if the resultant data has already been retrieved by this cursor. + */ + rewind() { + if (!this[kInitialized]) { + return; + } + this[kId] = undefined; + this[kDocuments] = []; + this[kClosed] = false; + this[kKilled] = false; + this[kInitialized] = false; + const session = this[kSession]; + if (session) { + // We only want to end this session if we created it, and it hasn't ended yet + if (session.explicit === false && !session.hasEnded) { + session.endSession(); + } + this[kSession] = undefined; + } + } + /** @internal */ + _getMore(batchSize, callback) { + const cursorId = this[kId]; + const cursorNs = this[kNamespace]; + const server = this[kServer]; + if (cursorId == null) { + callback(new error_1.MongoRuntimeError('Unable to iterate cursor with no id')); + return; + } + if (server == null) { + callback(new error_1.MongoRuntimeError('Unable to iterate cursor without selected server')); + return; + } + const getMoreOperation = new get_more_1.GetMoreOperation(cursorNs, cursorId, server, { + ...this[kOptions], + session: this[kSession], + batchSize + }); + (0, execute_operation_1.executeOperation)(this[kClient], getMoreOperation, callback); + } + /** + * @internal + * + * This function is exposed for the unified test runner's createChangeStream + * operation. We cannot refactor to use the abstract _initialize method without + * a significant refactor. + */ + [kInit](callback) { + var _a, _b, _c, _d; + if (this[kSession] == null) { + if ((_a = this[kClient].topology) === null || _a === void 0 ? void 0 : _a.shouldCheckForSessionSupport()) { + return (_b = this[kClient].topology) === null || _b === void 0 ? void 0 : _b.selectServer(read_preference_1.ReadPreference.primaryPreferred, {}, err => { + if (err) + return callback(err); + return this[kInit](callback); + }); + } + else if ((_c = this[kClient].topology) === null || _c === void 0 ? void 0 : _c.hasSessionSupport()) { + this[kSession] = (_d = this[kClient].topology) === null || _d === void 0 ? void 0 : _d.startSession({ owner: this, explicit: false }); + } + } + this._initialize(this[kSession], (err, state) => { + if (state) { + const response = state.response; + this[kServer] = state.server; + this[kSession] = state.session; + if (response.cursor) { + this[kId] = + typeof response.cursor.id === 'number' + ? bson_1.Long.fromNumber(response.cursor.id) + : response.cursor.id; + if (response.cursor.ns) { + this[kNamespace] = (0, utils_1.ns)(response.cursor.ns); + } + this[kDocuments] = response.cursor.firstBatch; + } + // When server responses return without a cursor document, we close this cursor + // and return the raw server response. This is often the case for explain commands + // for example + if (this[kId] == null) { + this[kId] = bson_1.Long.ZERO; + // TODO(NODE-3286): ExecutionResult needs to accept a generic parameter + this[kDocuments] = [state.response]; + } + } + // the cursor is now initialized, even if an error occurred or it is dead + this[kInitialized] = true; + if (err || cursorIsDead(this)) { + return cleanupCursor(this, { error: err }, () => callback(err, nextDocument(this))); + } + callback(); + }); + } +} +exports.AbstractCursor = AbstractCursor; +/** @event */ +AbstractCursor.CLOSE = 'close'; +function nextDocument(cursor) { + if (cursor[kDocuments] == null || !cursor[kDocuments].length) { + return null; + } + const doc = cursor[kDocuments].shift(); + if (doc) { + const transform = cursor[kTransform]; + if (transform) { + return transform(doc); + } + return doc; + } + return null; +} +function next(cursor, blocking, callback) { + const cursorId = cursor[kId]; + if (cursor.closed) { + return callback(undefined, null); + } + if (cursor[kDocuments] && cursor[kDocuments].length) { + callback(undefined, nextDocument(cursor)); + return; + } + if (cursorId == null) { + // All cursors must operate within a session, one must be made implicitly if not explicitly provided + cursor[kInit]((err, value) => { + if (err) + return callback(err); + if (value) { + return callback(undefined, value); + } + return next(cursor, blocking, callback); + }); + return; + } + if (cursorIsDead(cursor)) { + return cleanupCursor(cursor, undefined, () => callback(undefined, null)); + } + // otherwise need to call getMore + const batchSize = cursor[kOptions].batchSize || 1000; + cursor._getMore(batchSize, (err, response) => { + if (response) { + const cursorId = typeof response.cursor.id === 'number' + ? bson_1.Long.fromNumber(response.cursor.id) + : response.cursor.id; + cursor[kDocuments] = response.cursor.nextBatch; + cursor[kId] = cursorId; + } + if (err || cursorIsDead(cursor)) { + return cleanupCursor(cursor, { error: err }, () => callback(err, nextDocument(cursor))); + } + if (cursor[kDocuments].length === 0 && blocking === false) { + return callback(undefined, null); + } + next(cursor, blocking, callback); + }); +} +function cursorIsDead(cursor) { + const cursorId = cursor[kId]; + return !!cursorId && cursorId.isZero(); +} +function cleanupCursor(cursor, options, callback) { + var _a; + const cursorId = cursor[kId]; + const cursorNs = cursor[kNamespace]; + const server = cursor[kServer]; + const session = cursor[kSession]; + const error = options === null || options === void 0 ? void 0 : options.error; + const needsToEmitClosed = (_a = options === null || options === void 0 ? void 0 : options.needsToEmitClosed) !== null && _a !== void 0 ? _a : cursor[kDocuments].length === 0; + if (error) { + if (cursor.loadBalanced && error instanceof error_1.MongoNetworkError) { + return completeCleanup(); + } + } + if (cursorId == null || server == null || cursorId.isZero() || cursorNs == null) { + if (needsToEmitClosed) { + cursor[kClosed] = true; + cursor[kId] = bson_1.Long.ZERO; + cursor.emit(AbstractCursor.CLOSE); + } + if (session) { + if (session.owner === cursor) { + return session.endSession({ error }, callback); + } + if (!session.inTransaction()) { + (0, sessions_1.maybeClearPinnedConnection)(session, { error }); + } + } + return callback(); + } + function completeCleanup() { + if (session) { + if (session.owner === cursor) { + return session.endSession({ error }, () => { + cursor.emit(AbstractCursor.CLOSE); + callback(); + }); + } + if (!session.inTransaction()) { + (0, sessions_1.maybeClearPinnedConnection)(session, { error }); + } + } + cursor.emit(AbstractCursor.CLOSE); + return callback(); + } + cursor[kKilled] = true; + server.killCursors(cursorNs, [cursorId], { ...(0, bson_1.pluckBSONSerializeOptions)(cursor[kOptions]), session }, () => completeCleanup()); +} +/** @internal */ +function assertUninitialized(cursor) { + if (cursor[kInitialized]) { + throw new error_1.MongoCursorInUseError(); + } +} +exports.assertUninitialized = assertUninitialized; +function makeCursorStream(cursor) { + const readable = new stream_1.Readable({ + objectMode: true, + autoDestroy: false, + highWaterMark: 1 + }); + let initialized = false; + let reading = false; + let needToClose = true; // NOTE: we must close the cursor if we never read from it, use `_construct` in future node versions + readable._read = function () { + if (initialized === false) { + needToClose = false; + initialized = true; + } + if (!reading) { + reading = true; + readNext(); + } + }; + readable._destroy = function (error, cb) { + if (needToClose) { + cursor.close(err => process.nextTick(cb, err || error)); + } + else { + cb(error); + } + }; + function readNext() { + needToClose = false; + next(cursor, true, (err, result) => { + needToClose = err ? !cursor.closed : result != null; + if (err) { + // NOTE: This is questionable, but we have a test backing the behavior. It seems the + // desired behavior is that a stream ends cleanly when a user explicitly closes + // a client during iteration. Alternatively, we could do the "right" thing and + // propagate the error message by removing this special case. + if (err.message.match(/server is closed/)) { + cursor.close(); + return readable.push(null); + } + // NOTE: This is also perhaps questionable. The rationale here is that these errors tend + // to be "operation interrupted", where a cursor has been closed but there is an + // active getMore in-flight. This used to check if the cursor was killed but once + // that changed to happen in cleanup legitimate errors would not destroy the + // stream. There are change streams test specifically test these cases. + if (err.message.match(/interrupted/)) { + return readable.push(null); + } + return readable.destroy(err); + } + if (result == null) { + readable.push(null); + } + else if (readable.destroyed) { + cursor.close(); + } + else { + if (readable.push(result)) { + return readNext(); + } + reading = false; + } + }); + } + return readable; +} +//# sourceMappingURL=abstract_cursor.js.map \ No newline at end of file diff --git a/node_modules/mongodb/lib/cursor/abstract_cursor.js.map b/node_modules/mongodb/lib/cursor/abstract_cursor.js.map new file mode 100644 index 000000000..2a14e2a64 --- /dev/null +++ b/node_modules/mongodb/lib/cursor/abstract_cursor.js.map @@ -0,0 +1 @@ +{"version":3,"file":"abstract_cursor.js","sourceRoot":"","sources":["../../src/cursor/abstract_cursor.ts"],"names":[],"mappings":";;;AAAA,mCAA6C;AAE7C,kCAA0F;AAC1F,oCAQkB;AAElB,gDAAmE;AACnE,uEAAoF;AACpF,qDAA0D;AAC1D,kDAA+D;AAC/D,wDAAwE;AAExE,0CAAwE;AACxE,oCAAwE;AAExE,gBAAgB;AAChB,MAAM,GAAG,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC;AACzB,gBAAgB;AAChB,MAAM,UAAU,GAAG,MAAM,CAAC,WAAW,CAAC,CAAC;AACvC,gBAAgB;AAChB,MAAM,OAAO,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC;AACjC,gBAAgB;AAChB,MAAM,UAAU,GAAG,MAAM,CAAC,WAAW,CAAC,CAAC;AACvC,gBAAgB;AAChB,MAAM,OAAO,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC;AACjC,gBAAgB;AAChB,MAAM,QAAQ,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC;AACnC,gBAAgB;AAChB,MAAM,QAAQ,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC;AACnC,gBAAgB;AAChB,MAAM,UAAU,GAAG,MAAM,CAAC,WAAW,CAAC,CAAC;AACvC,gBAAgB;AAChB,MAAM,YAAY,GAAG,MAAM,CAAC,aAAa,CAAC,CAAC;AAC3C,gBAAgB;AAChB,MAAM,OAAO,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC;AACjC,gBAAgB;AAChB,MAAM,OAAO,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC;AACjC,gBAAgB;AAChB,MAAM,KAAK,GAAG,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lib/cursor/aggregation_cursor.js new file mode 100644 index 000000000..ad77c58a0 --- /dev/null +++ b/node_modules/mongodb/lib/cursor/aggregation_cursor.js @@ -0,0 +1,172 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.AggregationCursor = void 0; +const aggregate_1 = require("../operations/aggregate"); +const execute_operation_1 = require("../operations/execute_operation"); +const utils_1 = require("../utils"); +const abstract_cursor_1 = require("./abstract_cursor"); +/** @internal */ +const kPipeline = Symbol('pipeline'); +/** @internal */ +const kOptions = Symbol('options'); +/** + * The **AggregationCursor** class is an internal class that embodies an aggregation cursor on MongoDB + * allowing for iteration over the results returned from the underlying query. It supports + * one by one document iteration, conversion to an array or can be iterated as a Node 4.X + * or higher stream + * @public + */ +class AggregationCursor extends abstract_cursor_1.AbstractCursor { + /** @internal */ + constructor(client, namespace, pipeline = [], options = {}) { + super(client, namespace, options); + this[kPipeline] = pipeline; + this[kOptions] = options; + } + get pipeline() { + return this[kPipeline]; + } + clone() { + const clonedOptions = (0, utils_1.mergeOptions)({}, this[kOptions]); + delete clonedOptions.session; + return new AggregationCursor(this.client, this.namespace, this[kPipeline], { + ...clonedOptions + }); + } + map(transform) { + return super.map(transform); + } + /** @internal */ + _initialize(session, callback) { + const aggregateOperation = new aggregate_1.AggregateOperation(this.namespace, this[kPipeline], { + ...this[kOptions], + ...this.cursorOptions, + session + }); + (0, execute_operation_1.executeOperation)(this.client, aggregateOperation, (err, response) => { + if (err || response == null) + return callback(err); + // TODO: NODE-2882 + callback(undefined, { server: aggregateOperation.server, session, response }); + }); + } + explain(verbosity, callback) { + if (typeof verbosity === 'function') + (callback = verbosity), (verbosity = true); + if (verbosity == null) + verbosity = true; + return (0, execute_operation_1.executeOperation)(this.client, new aggregate_1.AggregateOperation(this.namespace, this[kPipeline], { + ...this[kOptions], + ...this.cursorOptions, + explain: verbosity + }), callback); + } + group($group) { + (0, abstract_cursor_1.assertUninitialized)(this); + this[kPipeline].push({ $group }); + return this; + } + /** Add a limit stage to the aggregation pipeline */ + limit($limit) { + (0, abstract_cursor_1.assertUninitialized)(this); + this[kPipeline].push({ $limit }); + return this; + } + /** Add a match stage to the aggregation pipeline */ + match($match) { + (0, abstract_cursor_1.assertUninitialized)(this); + this[kPipeline].push({ $match }); + return this; + } + /** Add an out stage to the aggregation pipeline */ + out($out) { + (0, abstract_cursor_1.assertUninitialized)(this); + this[kPipeline].push({ $out }); + return this; + } + /** + * Add a project stage to the aggregation pipeline + * + * @remarks + * In order to strictly type this function you must provide an interface + * that represents the effect of your projection on the result documents. + * + * By default chaining a projection to your cursor changes the returned type to the generic {@link Document} type. + * You should specify a parameterized type to have assertions on your final results. + * + * @example + * ```typescript + * // Best way + * const docs: AggregationCursor<{ a: number }> = cursor.project<{ a: number }>({ _id: 0, a: true }); + * // Flexible way + * const docs: AggregationCursor = cursor.project({ _id: 0, a: true }); + * ``` + * + * @remarks + * In order to strictly type this function you must provide an interface + * that represents the effect of your projection on the result documents. + * + * **Note for Typescript Users:** adding a transform changes the return type of the iteration of this cursor, + * it **does not** return a new instance of a cursor. This means when calling project, + * you should always assign the result to a new variable in order to get a correctly typed cursor variable. + * Take note of the following example: + * + * @example + * ```typescript + * const cursor: AggregationCursor<{ a: number; b: string }> = coll.aggregate([]); + * const projectCursor = cursor.project<{ a: number }>({ _id: 0, a: true }); + * const aPropOnlyArray: {a: number}[] = await projectCursor.toArray(); + * + * // or always use chaining and save the final cursor + * + * const cursor = coll.aggregate().project<{ a: string }>({ + * _id: 0, + * a: { $convert: { input: '$a', to: 'string' } + * }}); + * ``` + */ + project($project) { + (0, abstract_cursor_1.assertUninitialized)(this); + this[kPipeline].push({ $project }); + return this; + } + /** Add a lookup stage to the aggregation pipeline */ + lookup($lookup) { + (0, abstract_cursor_1.assertUninitialized)(this); + this[kPipeline].push({ $lookup }); + return this; + } + /** Add a redact stage to the aggregation pipeline */ + redact($redact) { + (0, abstract_cursor_1.assertUninitialized)(this); + this[kPipeline].push({ $redact }); + return this; + } + /** Add a skip stage to the aggregation pipeline */ + skip($skip) { + (0, abstract_cursor_1.assertUninitialized)(this); + this[kPipeline].push({ $skip }); + return this; + } + /** Add a sort stage to the aggregation pipeline */ + sort($sort) { + (0, abstract_cursor_1.assertUninitialized)(this); + this[kPipeline].push({ $sort }); + return this; + } + /** Add a unwind stage to the aggregation pipeline */ + unwind($unwind) { + (0, abstract_cursor_1.assertUninitialized)(this); + this[kPipeline].push({ $unwind }); + return this; + } + // deprecated methods + /** @deprecated Add a geoNear stage to the aggregation pipeline */ + geoNear($geoNear) { + (0, abstract_cursor_1.assertUninitialized)(this); + this[kPipeline].push({ $geoNear }); + return this; + } +} +exports.AggregationCursor = AggregationCursor; +//# sourceMappingURL=aggregation_cursor.js.map \ No newline at end of file diff --git a/node_modules/mongodb/lib/cursor/aggregation_cursor.js.map b/node_modules/mongodb/lib/cursor/aggregation_cursor.js.map new file mode 100644 index 000000000..ed6d31ea0 --- /dev/null +++ b/node_modules/mongodb/lib/cursor/aggregation_cursor.js.map @@ -0,0 +1 @@ +{"version":3,"file":"aggregation_cursor.js","sourceRoot":"","sources":["../../src/cursor/aggregation_cursor.ts"],"names":[],"mappings":";;;AAGA,uDAA+E;AAC/E,uEAAoF;AAIpF,oCAAwC;AAExC,uDAAwE;AAKxE,gBAAgB;AAChB,MAAM,SAAS,GAAG,MAAM,CAAC,UAAU,CAAC,CAAC;AACrC,gBAAgB;AAChB,MAAM,QAAQ,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC;AAEnC;;;;;;GAMG;AACH,MAAa,iBAAiC,SAAQ,gCAAuB;IAM3E,gBAAgB;IAChB,YACE,MAAmB,EACnB,SAA2B,EAC3B,WAAuB,EAAE,EACzB,UAA4B,EAAE;QAE9B,KAAK,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC;QAElC,IAAI,CAAC,SAAS,CAAC,GAAG,QAAQ,CAAC;QAC3B,IAAI,CAAC,QAAQ,CAAC,GAAG,OAAO,CAAC;IAC3B,C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AAI,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC;QACnC,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AA/LD,8CA+LC"} \ No newline at end of file diff --git a/node_modules/mongodb/lib/cursor/find_cursor.js b/node_modules/mongodb/lib/cursor/find_cursor.js new file mode 100644 index 000000000..072bf789d --- /dev/null +++ b/node_modules/mongodb/lib/cursor/find_cursor.js @@ -0,0 +1,382 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.FindCursor = exports.FLAGS = void 0; +const error_1 = require("../error"); +const count_1 = require("../operations/count"); +const execute_operation_1 = require("../operations/execute_operation"); +const find_1 = require("../operations/find"); +const sort_1 = require("../sort"); +const utils_1 = require("../utils"); +const abstract_cursor_1 = require("./abstract_cursor"); +/** @internal */ +const kFilter = Symbol('filter'); +/** @internal */ +const kNumReturned = Symbol('numReturned'); +/** @internal */ +const kBuiltOptions = Symbol('builtOptions'); +/** @public Flags allowed for cursor */ +exports.FLAGS = [ + 'tailable', + 'oplogReplay', + 'noCursorTimeout', + 'awaitData', + 'exhaust', + 'partial' +]; +/** @public */ +class FindCursor extends abstract_cursor_1.AbstractCursor { + /** @internal */ + constructor(client, namespace, filter, options = {}) { + super(client, namespace, options); + this[kFilter] = filter || {}; + this[kBuiltOptions] = options; + if (options.sort != null) { + this[kBuiltOptions].sort = (0, sort_1.formatSort)(options.sort); + } + } + clone() { + const clonedOptions = (0, utils_1.mergeOptions)({}, this[kBuiltOptions]); + delete clonedOptions.session; + return new FindCursor(this.client, this.namespace, this[kFilter], { + ...clonedOptions + }); + } + map(transform) { + return super.map(transform); + } + /** @internal */ + _initialize(session, callback) { + const findOperation = new find_1.FindOperation(undefined, this.namespace, this[kFilter], { + ...this[kBuiltOptions], + ...this.cursorOptions, + session + }); + (0, execute_operation_1.executeOperation)(this.client, findOperation, (err, response) => { + if (err || response == null) + return callback(err); + // TODO: We only need this for legacy queries that do not support `limit`, maybe + // the value should only be saved in those cases. + if (response.cursor) { + this[kNumReturned] = response.cursor.firstBatch.length; + } + else { + this[kNumReturned] = response.documents ? response.documents.length : 0; + } + // TODO: NODE-2882 + callback(undefined, { server: findOperation.server, session, response }); + }); + } + /** @internal */ + _getMore(batchSize, callback) { + // NOTE: this is to support client provided limits in pre-command servers + const numReturned = this[kNumReturned]; + if (numReturned) { + const limit = this[kBuiltOptions].limit; + batchSize = + limit && limit > 0 && numReturned + batchSize > limit ? limit - numReturned : batchSize; + if (batchSize <= 0) { + return this.close(callback); + } + } + super._getMore(batchSize, (err, response) => { + if (err) + return callback(err); + // TODO: wrap this in some logic to prevent it from happening if we don't need this support + if (response) { + this[kNumReturned] = this[kNumReturned] + response.cursor.nextBatch.length; + } + callback(undefined, response); + }); + } + count(options, callback) { + (0, utils_1.emitWarningOnce)('cursor.count is deprecated and will be removed in the next major version, please use `collection.estimatedDocumentCount` or `collection.countDocuments` instead '); + if (typeof options === 'boolean') { + throw new error_1.MongoInvalidArgumentError('Invalid first parameter to count'); + } + if (typeof options === 'function') + (callback = options), (options = {}); + options = options !== null && options !== void 0 ? options : {}; + return (0, execute_operation_1.executeOperation)(this.client, new count_1.CountOperation(this.namespace, this[kFilter], { + ...this[kBuiltOptions], + ...this.cursorOptions, + ...options + }), callback); + } + explain(verbosity, callback) { + if (typeof verbosity === 'function') + (callback = verbosity), (verbosity = true); + if (verbosity == null) + verbosity = true; + return (0, execute_operation_1.executeOperation)(this.client, new find_1.FindOperation(undefined, this.namespace, this[kFilter], { + ...this[kBuiltOptions], + ...this.cursorOptions, + explain: verbosity + }), callback); + } + /** Set the cursor query */ + filter(filter) { + (0, abstract_cursor_1.assertUninitialized)(this); + this[kFilter] = filter; + return this; + } + /** + * Set the cursor hint + * + * @param hint - If specified, then the query system will only consider plans using the hinted index. + */ + hint(hint) { + (0, abstract_cursor_1.assertUninitialized)(this); + this[kBuiltOptions].hint = hint; + return this; + } + /** + * Set the cursor min + * + * @param min - Specify a $min value to specify the inclusive lower bound for a specific index in order to constrain the results of find(). The $min specifies the lower bound for all keys of a specific index in order. + */ + min(min) { + (0, abstract_cursor_1.assertUninitialized)(this); + this[kBuiltOptions].min = min; + return this; + } + /** + * Set the cursor max + * + * @param max - Specify a $max value to specify the exclusive upper bound for a specific index in order to constrain the results of find(). The $max specifies the upper bound for all keys of a specific index in order. + */ + max(max) { + (0, abstract_cursor_1.assertUninitialized)(this); + this[kBuiltOptions].max = max; + return this; + } + /** + * Set the cursor returnKey. + * If set to true, modifies the cursor to only return the index field or fields for the results of the query, rather than documents. + * If set to true and the query does not use an index to perform the read operation, the returned documents will not contain any fields. + * + * @param value - the returnKey value. + */ + returnKey(value) { + (0, abstract_cursor_1.assertUninitialized)(this); + this[kBuiltOptions].returnKey = value; + return this; + } + /** + * Modifies the output of a query by adding a field $recordId to matching documents. $recordId is the internal key which uniquely identifies a document in a collection. + * + * @param value - The $showDiskLoc option has now been deprecated and replaced with the showRecordId field. $showDiskLoc will still be accepted for OP_QUERY stye find. + */ + showRecordId(value) { + (0, abstract_cursor_1.assertUninitialized)(this); + this[kBuiltOptions].showRecordId = value; + return this; + } + /** + * Add a query modifier to the cursor query + * + * @param name - The query modifier (must start with $, such as $orderby etc) + * @param value - The modifier value. + */ + addQueryModifier(name, value) { + (0, abstract_cursor_1.assertUninitialized)(this); + if (name[0] !== '$') { + throw new error_1.MongoInvalidArgumentError(`${name} is not a valid query modifier`); + } + // Strip of the $ + const field = name.substr(1); + // NOTE: consider some TS magic for this + switch (field) { + case 'comment': + this[kBuiltOptions].comment = value; + break; + case 'explain': + this[kBuiltOptions].explain = value; + break; + case 'hint': + this[kBuiltOptions].hint = value; + break; + case 'max': + this[kBuiltOptions].max = value; + break; + case 'maxTimeMS': + this[kBuiltOptions].maxTimeMS = value; + break; + case 'min': + this[kBuiltOptions].min = value; + break; + case 'orderby': + this[kBuiltOptions].sort = (0, sort_1.formatSort)(value); + break; + case 'query': + this[kFilter] = value; + break; + case 'returnKey': + this[kBuiltOptions].returnKey = value; + break; + case 'showDiskLoc': + this[kBuiltOptions].showRecordId = value; + break; + default: + throw new error_1.MongoInvalidArgumentError(`Invalid query modifier: ${name}`); + } + return this; + } + /** + * Add a comment to the cursor query allowing for tracking the comment in the log. + * + * @param value - The comment attached to this query. + */ + comment(value) { + (0, abstract_cursor_1.assertUninitialized)(this); + this[kBuiltOptions].comment = value; + return this; + } + /** + * Set a maxAwaitTimeMS on a tailing cursor query to allow to customize the timeout value for the option awaitData (Only supported on MongoDB 3.2 or higher, ignored otherwise) + * + * @param value - Number of milliseconds to wait before aborting the tailed query. + */ + maxAwaitTimeMS(value) { + (0, abstract_cursor_1.assertUninitialized)(this); + if (typeof value !== 'number') { + throw new error_1.MongoInvalidArgumentError('Argument for maxAwaitTimeMS must be a number'); + } + this[kBuiltOptions].maxAwaitTimeMS = value; + return this; + } + /** + * Set a maxTimeMS on the cursor query, allowing for hard timeout limits on queries (Only supported on MongoDB 2.6 or higher) + * + * @param value - Number of milliseconds to wait before aborting the query. + */ + maxTimeMS(value) { + (0, abstract_cursor_1.assertUninitialized)(this); + if (typeof value !== 'number') { + throw new error_1.MongoInvalidArgumentError('Argument for maxTimeMS must be a number'); + } + this[kBuiltOptions].maxTimeMS = value; + return this; + } + /** + * Add a project stage to the aggregation pipeline + * + * @remarks + * In order to strictly type this function you must provide an interface + * that represents the effect of your projection on the result documents. + * + * By default chaining a projection to your cursor changes the returned type to the generic + * {@link Document} type. + * You should specify a parameterized type to have assertions on your final results. + * + * @example + * ```typescript + * // Best way + * const docs: FindCursor<{ a: number }> = cursor.project<{ a: number }>({ _id: 0, a: true }); + * // Flexible way + * const docs: FindCursor = cursor.project({ _id: 0, a: true }); + * ``` + * + * @remarks + * + * **Note for Typescript Users:** adding a transform changes the return type of the iteration of this cursor, + * it **does not** return a new instance of a cursor. This means when calling project, + * you should always assign the result to a new variable in order to get a correctly typed cursor variable. + * Take note of the following example: + * + * @example + * ```typescript + * const cursor: FindCursor<{ a: number; b: string }> = coll.find(); + * const projectCursor = cursor.project<{ a: number }>({ _id: 0, a: true }); + * const aPropOnlyArray: {a: number}[] = await projectCursor.toArray(); + * + * // or always use chaining and save the final cursor + * + * const cursor = coll.find().project<{ a: string }>({ + * _id: 0, + * a: { $convert: { input: '$a', to: 'string' } + * }}); + * ``` + */ + project(value) { + (0, abstract_cursor_1.assertUninitialized)(this); + this[kBuiltOptions].projection = value; + return this; + } + /** + * Sets the sort order of the cursor query. + * + * @param sort - The key or keys set for the sort. + * @param direction - The direction of the sorting (1 or -1). + */ + sort(sort, direction) { + (0, abstract_cursor_1.assertUninitialized)(this); + if (this[kBuiltOptions].tailable) { + throw new error_1.MongoTailableCursorError('Tailable cursor does not support sorting'); + } + this[kBuiltOptions].sort = (0, sort_1.formatSort)(sort, direction); + return this; + } + /** + * Allows disk use for blocking sort operations exceeding 100MB memory. (MongoDB 3.2 or higher) + * + * @remarks + * {@link https://docs.mongodb.com/manual/reference/command/find/#find-cmd-allowdiskuse | find command allowDiskUse documentation} + */ + allowDiskUse(allow = true) { + (0, abstract_cursor_1.assertUninitialized)(this); + if (!this[kBuiltOptions].sort) { + throw new error_1.MongoInvalidArgumentError('Option "allowDiskUse" requires a sort specification'); + } + // As of 6.0 the default is true. This allows users to get back to the old behaviour. + if (!allow) { + this[kBuiltOptions].allowDiskUse = false; + return this; + } + this[kBuiltOptions].allowDiskUse = true; + return this; + } + /** + * Set the collation options for the cursor. + * + * @param value - The cursor collation options (MongoDB 3.4 or higher) settings for update operation (see 3.4 documentation for available fields). + */ + collation(value) { + (0, abstract_cursor_1.assertUninitialized)(this); + this[kBuiltOptions].collation = value; + return this; + } + /** + * Set the limit for the cursor. + * + * @param value - The limit for the cursor query. + */ + limit(value) { + (0, abstract_cursor_1.assertUninitialized)(this); + if (this[kBuiltOptions].tailable) { + throw new error_1.MongoTailableCursorError('Tailable cursor does not support limit'); + } + if (typeof value !== 'number') { + throw new error_1.MongoInvalidArgumentError('Operation "limit" requires an integer'); + } + this[kBuiltOptions].limit = value; + return this; + } + /** + * Set the skip for the cursor. + * + * @param value - The skip for the cursor query. + */ + skip(value) { + (0, abstract_cursor_1.assertUninitialized)(this); + if (this[kBuiltOptions].tailable) { + throw new error_1.MongoTailableCursorError('Tailable cursor does not support skip'); + } + if (typeof value !== 'number') { + throw new error_1.MongoInvalidArgumentError('Operation "skip" requires an integer'); + } + this[kBuiltOptions].skip = value; + return this; + } +} +exports.FindCursor = FindCursor; +//# sourceMappingURL=find_cursor.js.map \ No newline at end of file diff --git a/node_modules/mongodb/lib/cursor/find_cursor.js.map b/node_modules/mongodb/lib/cursor/find_cursor.js.map new file mode 100644 index 000000000..494320a58 --- /dev/null +++ b/node_modules/mongodb/lib/cursor/find_cursor.js.map @@ -0,0 +1 @@ +{"version":3,"file":"find_cursor.js","sourceRoot":"","sources":["../../src/cursor/find_cursor.ts"],"names":[],"mappings":";;;AACA,oCAA+E;AAI/E,+CAAmE;AACnE,uEAAoF;AACpF,6CAAgE;AAGhE,kCAA0D;AAC1D,oCAAqF;AACrF,uDAAwE;AAExE,gBAAgB;AAChB,MAAM,OAAO,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC;AACjC,gBAAgB;AAChB,MAAM,YAAY,GAAG,MAAM,CAAC,aAAa,CAAC,CAAC;AAC3C,gBAAgB;AAChB,MAAM,aAAa,GAAG,MAAM,CAAC,cAAc,CAAC,CAAC;AAE7C,uCAAuC;AAC1B,QAAA,KAAK,GAAG;IACnB,UAAU;IACV,aAAa;IACb,iBAAiB;IACjB,WAAW;IACX,SAAS;IACT,SAAS;CACD,CAAC;AAEX,cAAc;AACd,MAAa,UAA0B,SAAQ,gCAAuB;IAQpE,gBAAgB;IAChB,YACE,MAAmB,EACnB,SAA2B,EAC3B,MAA4B,EAC5B,UAAuB,EAAE;QAEzB,KAAK,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC;QAElC,IAAI,CAAC,OAAO,CAAC,GAAG,MAAM,IAAI,EAAE,CAAC;QAC7B,IAAI,CAAC,aAAa,CAAC,GAAG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;IACd,CAAC;CACF;AA/bD,gCA+bC"} \ No newline at end of file diff --git a/node_modules/mongodb/lib/db.js b/node_modules/mongodb/lib/db.js new file mode 100644 index 000000000..0fcadb4e4 --- /dev/null +++ b/node_modules/mongodb/lib/db.js @@ -0,0 +1,334 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Db = void 0; +const admin_1 = require("./admin"); +const bson_1 = require("./bson"); +const change_stream_1 = require("./change_stream"); +const collection_1 = require("./collection"); +const CONSTANTS = require("./constants"); +const aggregation_cursor_1 = require("./cursor/aggregation_cursor"); +const error_1 = require("./error"); +const logger_1 = require("./logger"); +const add_user_1 = require("./operations/add_user"); +const collections_1 = require("./operations/collections"); +const create_collection_1 = require("./operations/create_collection"); +const drop_1 = require("./operations/drop"); +const execute_operation_1 = require("./operations/execute_operation"); +const indexes_1 = require("./operations/indexes"); +const list_collections_1 = require("./operations/list_collections"); +const profiling_level_1 = require("./operations/profiling_level"); +const remove_user_1 = require("./operations/remove_user"); +const rename_1 = require("./operations/rename"); +const run_command_1 = require("./operations/run_command"); +const set_profiling_level_1 = require("./operations/set_profiling_level"); +const stats_1 = require("./operations/stats"); +const read_concern_1 = require("./read_concern"); +const read_preference_1 = require("./read_preference"); +const utils_1 = require("./utils"); +const write_concern_1 = require("./write_concern"); +// Allowed parameters +const DB_OPTIONS_ALLOW_LIST = [ + 'writeConcern', + 'readPreference', + 'readPreferenceTags', + 'native_parser', + 'forceServerObjectId', + 'pkFactory', + 'serializeFunctions', + 'raw', + 'authSource', + 'ignoreUndefined', + 'readConcern', + 'retryMiliSeconds', + 'numberOfRetries', + 'loggerLevel', + 'logger', + 'promoteBuffers', + 'promoteLongs', + 'bsonRegExp', + 'enableUtf8Validation', + 'promoteValues', + 'compression', + 'retryWrites' +]; +/** + * The **Db** class is a class that represents a MongoDB Database. + * @public + * + * @example + * ```js + * const { MongoClient } = require('mongodb'); + * // Connection url + * const url = 'mongodb://localhost:27017'; + * // Database Name + * const dbName = 'test'; + * // Connect using MongoClient + * MongoClient.connect(url, function(err, client) { + * // Select the database by name + * const testDb = client.db(dbName); + * client.close(); + * }); + * ``` + */ +class Db { + /** + * Creates a new Db instance + * + * @param client - The MongoClient for the database. + * @param databaseName - The name of the database this instance represents. + * @param options - Optional settings for Db construction + */ + constructor(client, databaseName, options) { + var _a; + options = options !== null && options !== void 0 ? options : {}; + // Filter the options + options = (0, utils_1.filterOptions)(options, DB_OPTIONS_ALLOW_LIST); + // Ensure we have a valid db name + validateDatabaseName(databaseName); + // Internal state of the db object + this.s = { + // Client + client, + // Options + options, + // Logger instance + logger: new logger_1.Logger('Db', options), + // Unpack read preference + readPreference: read_preference_1.ReadPreference.fromOptions(options), + // Merge bson options + bsonOptions: (0, bson_1.resolveBSONOptions)(options, client), + // Set up the primary key factory or fallback to ObjectId + pkFactory: (_a = options === null || options === void 0 ? void 0 : options.pkFactory) !== null && _a !== void 0 ? _a : utils_1.DEFAULT_PK_FACTORY, + // ReadConcern + readConcern: read_concern_1.ReadConcern.fromOptions(options), + writeConcern: write_concern_1.WriteConcern.fromOptions(options), + // Namespace + namespace: new utils_1.MongoDBNamespace(databaseName) + }; + } + get databaseName() { + return this.s.namespace.db; + } + // Options + get options() { + return this.s.options; + } + /** + * slaveOk specified + * @deprecated Use secondaryOk instead + */ + get slaveOk() { + return this.secondaryOk; + } + /** + * Check if a secondary can be used (because the read preference is *not* set to primary) + */ + get secondaryOk() { + var _a; + return ((_a = this.s.readPreference) === null || _a === void 0 ? void 0 : _a.preference) !== 'primary' || false; + } + get readConcern() { + return this.s.readConcern; + } + /** + * The current readPreference of the Db. If not explicitly defined for + * this Db, will be inherited from the parent MongoClient + */ + get readPreference() { + if (this.s.readPreference == null) { + return this.s.client.readPreference; + } + return this.s.readPreference; + } + get bsonOptions() { + return this.s.bsonOptions; + } + // get the write Concern + get writeConcern() { + return this.s.writeConcern; + } + get namespace() { + return this.s.namespace.toString(); + } + createCollection(name, options, callback) { + if (typeof options === 'function') + (callback = options), (options = {}); + return (0, execute_operation_1.executeOperation)(this.s.client, new create_collection_1.CreateCollectionOperation(this, name, (0, utils_1.resolveOptions)(this, options)), callback); + } + command(command, options, callback) { + if (typeof options === 'function') + (callback = options), (options = {}); + // Intentionally, we do not inherit options from parent for this operation. + return (0, execute_operation_1.executeOperation)(this.s.client, new run_command_1.RunCommandOperation(this, command, options !== null && options !== void 0 ? options : {}), callback); + } + /** + * Execute an aggregation framework pipeline against the database, needs MongoDB \>= 3.6 + * + * @param pipeline - An array of aggregation stages to be executed + * @param options - Optional settings for the command + */ + aggregate(pipeline = [], options) { + if (arguments.length > 2) { + throw new error_1.MongoInvalidArgumentError('Method "db.aggregate()" accepts at most two arguments'); + } + if (typeof pipeline === 'function') { + throw new error_1.MongoInvalidArgumentError('Argument "pipeline" must not be function'); + } + if (typeof options === 'function') { + throw new error_1.MongoInvalidArgumentError('Argument "options" must not be function'); + } + return new aggregation_cursor_1.AggregationCursor(this.s.client, this.s.namespace, pipeline, (0, utils_1.resolveOptions)(this, options)); + } + /** Return the Admin db instance */ + admin() { + return new admin_1.Admin(this); + } + /** + * Returns a reference to a MongoDB Collection. If it does not exist it will be created implicitly. + * + * @param name - the collection name we wish to access. + * @returns return the new Collection instance + */ + collection(name, options = {}) { + if (typeof options === 'function') { + throw new error_1.MongoInvalidArgumentError('The callback form of this helper has been removed.'); + } + const finalOptions = (0, utils_1.resolveOptions)(this, options); + return new collection_1.Collection(this, name, finalOptions); + } + stats(options, callback) { + if (typeof options === 'function') + (callback = options), (options = {}); + return (0, execute_operation_1.executeOperation)(this.s.client, new stats_1.DbStatsOperation(this, (0, utils_1.resolveOptions)(this, options)), callback); + } + listCollections(filter = {}, options = {}) { + return new list_collections_1.ListCollectionsCursor(this, filter, (0, utils_1.resolveOptions)(this, options)); + } + renameCollection(fromCollection, toCollection, options, callback) { + if (typeof options === 'function') + (callback = options), (options = {}); + // Intentionally, we do not inherit options from parent for this operation. + options = { ...options, readPreference: read_preference_1.ReadPreference.PRIMARY }; + // Add return new collection + options.new_collection = true; + return (0, execute_operation_1.executeOperation)(this.s.client, new rename_1.RenameOperation(this.collection(fromCollection), toCollection, options), callback); + } + dropCollection(name, options, callback) { + if (typeof options === 'function') + (callback = options), (options = {}); + return (0, execute_operation_1.executeOperation)(this.s.client, new drop_1.DropCollectionOperation(this, name, (0, utils_1.resolveOptions)(this, options)), callback); + } + dropDatabase(options, callback) { + if (typeof options === 'function') + (callback = options), (options = {}); + return (0, execute_operation_1.executeOperation)(this.s.client, new drop_1.DropDatabaseOperation(this, (0, utils_1.resolveOptions)(this, options)), callback); + } + collections(options, callback) { + if (typeof options === 'function') + (callback = options), (options = {}); + return (0, execute_operation_1.executeOperation)(this.s.client, new collections_1.CollectionsOperation(this, (0, utils_1.resolveOptions)(this, options)), callback); + } + createIndex(name, indexSpec, options, callback) { + if (typeof options === 'function') + (callback = options), (options = {}); + return (0, execute_operation_1.executeOperation)(this.s.client, new indexes_1.CreateIndexOperation(this, name, indexSpec, (0, utils_1.resolveOptions)(this, options)), callback); + } + addUser(username, password, options, callback) { + if (typeof password === 'function') { + (callback = password), (password = undefined), (options = {}); + } + else if (typeof password !== 'string') { + if (typeof options === 'function') { + (callback = options), (options = password), (password = undefined); + } + else { + (options = password), (callback = undefined), (password = undefined); + } + } + else { + if (typeof options === 'function') + (callback = options), (options = {}); + } + return (0, execute_operation_1.executeOperation)(this.s.client, new add_user_1.AddUserOperation(this, username, password, (0, utils_1.resolveOptions)(this, options)), callback); + } + removeUser(username, options, callback) { + if (typeof options === 'function') + (callback = options), (options = {}); + return (0, execute_operation_1.executeOperation)(this.s.client, new remove_user_1.RemoveUserOperation(this, username, (0, utils_1.resolveOptions)(this, options)), callback); + } + setProfilingLevel(level, options, callback) { + if (typeof options === 'function') + (callback = options), (options = {}); + return (0, execute_operation_1.executeOperation)(this.s.client, new set_profiling_level_1.SetProfilingLevelOperation(this, level, (0, utils_1.resolveOptions)(this, options)), callback); + } + profilingLevel(options, callback) { + if (typeof options === 'function') + (callback = options), (options = {}); + return (0, execute_operation_1.executeOperation)(this.s.client, new profiling_level_1.ProfilingLevelOperation(this, (0, utils_1.resolveOptions)(this, options)), callback); + } + indexInformation(name, options, callback) { + if (typeof options === 'function') + (callback = options), (options = {}); + return (0, execute_operation_1.executeOperation)(this.s.client, new indexes_1.IndexInformationOperation(this, name, (0, utils_1.resolveOptions)(this, options)), callback); + } + /** + * Unref all sockets + * @deprecated This function is deprecated and will be removed in the next major version. + */ + unref() { + (0, utils_1.getTopology)(this).unref(); + } + /** + * Create a new Change Stream, watching for new changes (insertions, updates, + * replacements, deletions, and invalidations) in this database. Will ignore all + * changes to system collections. + * + * @remarks + * watch() accepts two generic arguments for distinct usecases: + * - The first is to provide the schema that may be defined for all the collections within this database + * - The second is to override the shape of the change stream document entirely, if it is not provided the type will default to ChangeStreamDocument of the first argument + * + * @param pipeline - An array of {@link https://docs.mongodb.com/manual/reference/operator/aggregation-pipeline/|aggregation pipeline stages} through which to pass change stream documents. This allows for filtering (using $match) and manipulating the change stream documents. + * @param options - Optional settings for the command + * @typeParam TSchema - Type of the data being detected by the change stream + * @typeParam TChange - Type of the whole change stream document emitted + */ + watch(pipeline = [], options = {}) { + // Allow optionally not specifying a pipeline + if (!Array.isArray(pipeline)) { + options = pipeline; + pipeline = []; + } + return new change_stream_1.ChangeStream(this, pipeline, (0, utils_1.resolveOptions)(this, options)); + } + /** Return the db logger */ + getLogger() { + return this.s.logger; + } + get logger() { + return this.s.logger; + } +} +exports.Db = Db; +Db.SYSTEM_NAMESPACE_COLLECTION = CONSTANTS.SYSTEM_NAMESPACE_COLLECTION; +Db.SYSTEM_INDEX_COLLECTION = CONSTANTS.SYSTEM_INDEX_COLLECTION; +Db.SYSTEM_PROFILE_COLLECTION = CONSTANTS.SYSTEM_PROFILE_COLLECTION; +Db.SYSTEM_USER_COLLECTION = CONSTANTS.SYSTEM_USER_COLLECTION; +Db.SYSTEM_COMMAND_COLLECTION = CONSTANTS.SYSTEM_COMMAND_COLLECTION; +Db.SYSTEM_JS_COLLECTION = CONSTANTS.SYSTEM_JS_COLLECTION; +// TODO(NODE-3484): Refactor into MongoDBNamespace +// Validate the database name +function validateDatabaseName(databaseName) { + if (typeof databaseName !== 'string') + throw new error_1.MongoInvalidArgumentError('Database name must be a string'); + if (databaseName.length === 0) + throw new error_1.MongoInvalidArgumentError('Database name cannot be the empty string'); + if (databaseName === '$external') + return; + const invalidChars = [' ', '.', '$', '/', '\\']; + for (let i = 0; i < invalidChars.length; i++) { + if (databaseName.indexOf(invalidChars[i]) !== -1) + throw new error_1.MongoAPIError(`database names cannot contain the character '${invalidChars[i]}'`); + } +} +//# sourceMappingURL=db.js.map \ No newline at end of file diff --git a/node_modules/mongodb/lib/db.js.map b/node_modules/mongodb/lib/db.js.map new file mode 100644 index 000000000..d701a292f --- /dev/null +++ b/node_modules/mongodb/lib/db.js.map @@ -0,0 +1 @@ +{"version":3,"file":"db.js","sourceRoot":"","sources":["../src/db.ts"],"names":[],"mappings":";;;AAAA,mCAAgC;AAChC,iCAA4E;AAC5E,mDAA0F;AAC1F,6CAA6D;AAC7D,yCAAyC;AACzC,oEAAgE;AAChE,mCAAmE;AACnE,qCAAiD;AAGjD,oDAAyE;AAEzE,0DAAgE;AAEhE,sEAAoG;AACpG,4CAK2B;AAC3B,sEAAkE;AAClE,kDAK8B;AAC9B,oEAIuC;AACvC,kEAA8F;AAC9F,0DAAkF;AAClF,gDAAqE;AACrE,0DAAkF;AAClF,0EAI0C;AAC1C,8CAAsE;AACtE,iDAA6C;AAC7C,uDAAuE;AACvE,mCAOiB;AACjB,mDAAoE;AAEpE,qBAAqB;AACrB,MAAM,qBAAqB,GAAG;IAC5B,cAAc;IACd,gBAAgB;IAChB,oBAAoB;IACpB,eAAe;IACf,qBAAqB;IACrB,WAAW;IACX,oBAAoB;IACpB,KAAK;IACL,YAAY;IACZ,iBAAiB;IACjB,aAAa;IACb,kBAAkB;IAClB,iBAAiB;IACjB,aAAa;IACb,QAAQ;IACR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,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,YAAY,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QAC5C,IAAI,YAAY,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;YAC9C,MAAM,IAAI,qBAAa,CAAC,gDAAgD,YAAY,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;KAC/F;AACH,CAAC"} \ No newline at end of file diff --git a/node_modules/mongodb/lib/deps.js b/node_modules/mongodb/lib/deps.js new file mode 100644 index 000000000..6a73e6322 --- /dev/null +++ b/node_modules/mongodb/lib/deps.js @@ -0,0 +1,63 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.AutoEncryptionLoggerLevel = exports.aws4 = exports.saslprep = exports.Snappy = exports.ZStandard = exports.Kerberos = exports.PKG_VERSION = void 0; +const error_1 = require("./error"); +const utils_1 = require("./utils"); +exports.PKG_VERSION = Symbol('kPkgVersion'); +function makeErrorModule(error) { + const props = error ? { kModuleError: error } : {}; + return new Proxy(props, { + get: (_, key) => { + if (key === 'kModuleError') { + return error; + } + throw error; + }, + set: () => { + throw error; + } + }); +} +exports.Kerberos = makeErrorModule(new error_1.MongoMissingDependencyError('Optional module `kerberos` not found. Please install it to enable kerberos authentication')); +try { + // Ensure you always wrap an optional require in the try block NODE-3199 + exports.Kerberos = require('kerberos'); +} +catch { } // eslint-disable-line +exports.ZStandard = makeErrorModule(new error_1.MongoMissingDependencyError('Optional module `@mongodb-js/zstd` not found. Please install it to enable zstd compression')); +try { + exports.ZStandard = require('@mongodb-js/zstd'); +} +catch { } // eslint-disable-line +exports.Snappy = makeErrorModule(new error_1.MongoMissingDependencyError('Optional module `snappy` not found. Please install it to enable snappy compression')); +try { + // Ensure you always wrap an optional require in the try block NODE-3199 + exports.Snappy = require('snappy'); + try { + exports.Snappy[exports.PKG_VERSION] = (0, utils_1.parsePackageVersion)(require('snappy/package.json')); + } + catch { } // eslint-disable-line +} +catch { } // eslint-disable-line +exports.saslprep = makeErrorModule(new error_1.MongoMissingDependencyError('Optional module `saslprep` not found.' + + ' Please install it to enable Stringprep Profile for User Names and Passwords')); +try { + // Ensure you always wrap an optional require in the try block NODE-3199 + exports.saslprep = require('saslprep'); +} +catch { } // eslint-disable-line +exports.aws4 = makeErrorModule(new error_1.MongoMissingDependencyError('Optional module `aws4` not found. Please install it to enable AWS authentication')); +try { + // Ensure you always wrap an optional require in the try block NODE-3199 + exports.aws4 = require('aws4'); +} +catch { } // eslint-disable-line +/** @public */ +exports.AutoEncryptionLoggerLevel = Object.freeze({ + FatalError: 0, + Error: 1, + Warning: 2, + Info: 3, + Trace: 4 +}); +//# sourceMappingURL=deps.js.map \ No newline at end of file diff --git a/node_modules/mongodb/lib/deps.js.map b/node_modules/mongodb/lib/deps.js.map new file mode 100644 index 000000000..e3e0228c5 --- /dev/null +++ b/node_modules/mongodb/lib/deps.js.map @@ -0,0 +1 @@ +{"version":3,"file":"deps.js","sourceRoot":"","sources":["../src/deps.ts"],"names":[],"mappings":";;;AAGA,mCAAsD;AAEtD,mCAAwD;AAE3C,QAAA,WAAW,GAAG,MAAM,CAAC,aAAa,CAAC,CAAC;AAEjD,SAAS,eAAe,CAAC,KAAU;IACjC,MAAM,KAAK,GAAG,KAAK,CAAC,CAAC,CAAC,EAAE,YAAY,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;IACnD,OAAO,IAAI,KAAK,CAAC,KAAK,EAAE;QACtB,GAAG,EAAE,CAAC,CAAM,EAAE,GAAQ,EAAE,EAAE;YACxB,IAAI,GAAG,KAAK,cAAc,EAAE;gBAC1B,OAAO,KAAK,CAAC;aACd;YACD,MAAM,KAAK,CAAC;QACd,CAAC;QACD,GAAG,EAAE,GAAG,EAAE;YACR,MAAM,KAAK,CAAC;QACd,CAAC;KACF,CAAC,CAAC;AACL,CAAC;AAEU,QAAA,QAAQ,GACjB,eAAe,CACb,IAAI,mCAA2B,CAC7B,2F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AAE,CAAC;IACP,KAAK,EAAE,CAAC;CACA,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/mongodb/lib/encrypter.js b/node_modules/mongodb/lib/encrypter.js new file mode 100644 index 000000000..624da54c7 --- /dev/null +++ b/node_modules/mongodb/lib/encrypter.js @@ -0,0 +1,119 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Encrypter = void 0; +/* eslint-disable @typescript-eslint/no-var-requires */ +const bson_1 = require("./bson"); +const constants_1 = require("./constants"); +const error_1 = require("./error"); +const mongo_client_1 = require("./mongo_client"); +let AutoEncrypterClass; +/** @internal */ +const kInternalClient = Symbol('internalClient'); +/** @internal */ +class Encrypter { + constructor(client, uri, options) { + if (typeof options.autoEncryption !== 'object') { + throw new error_1.MongoInvalidArgumentError('Option "autoEncryption" must be specified'); + } + // initialize to null, if we call getInternalClient, we may set this it is important to not overwrite those function calls. + this[kInternalClient] = null; + this.bypassAutoEncryption = !!options.autoEncryption.bypassAutoEncryption; + this.needsConnecting = false; + if (options.maxPoolSize === 0 && options.autoEncryption.keyVaultClient == null) { + options.autoEncryption.keyVaultClient = client; + } + else if (options.autoEncryption.keyVaultClient == null) { + options.autoEncryption.keyVaultClient = this.getInternalClient(client, uri, options); + } + if (this.bypassAutoEncryption) { + options.autoEncryption.metadataClient = undefined; + } + else if (options.maxPoolSize === 0) { + options.autoEncryption.metadataClient = client; + } + else { + options.autoEncryption.metadataClient = this.getInternalClient(client, uri, options); + } + if (options.proxyHost) { + options.autoEncryption.proxyOptions = { + proxyHost: options.proxyHost, + proxyPort: options.proxyPort, + proxyUsername: options.proxyUsername, + proxyPassword: options.proxyPassword + }; + } + options.autoEncryption.bson = Object.create(null); + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + options.autoEncryption.bson.serialize = bson_1.serialize; + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + options.autoEncryption.bson.deserialize = bson_1.deserialize; + this.autoEncrypter = new AutoEncrypterClass(client, options.autoEncryption); + } + getInternalClient(client, uri, options) { + // TODO(NODE-4144): Remove new variable for type narrowing + let internalClient = this[kInternalClient]; + if (internalClient == null) { + const clonedOptions = {}; + for (const key of [ + ...Object.getOwnPropertyNames(options), + ...Object.getOwnPropertySymbols(options) + ]) { + if (['autoEncryption', 'minPoolSize', 'servers', 'caseTranslate', 'dbName'].includes(key)) + continue; + Reflect.set(clonedOptions, key, Reflect.get(options, key)); + } + clonedOptions.minPoolSize = 0; + internalClient = new mongo_client_1.MongoClient(uri, clonedOptions); + this[kInternalClient] = internalClient; + for (const eventName of constants_1.MONGO_CLIENT_EVENTS) { + for (const listener of client.listeners(eventName)) { + internalClient.on(eventName, listener); + } + } + client.on('newListener', (eventName, listener) => { + internalClient === null || internalClient === void 0 ? void 0 : internalClient.on(eventName, listener); + }); + this.needsConnecting = true; + } + return internalClient; + } + connectInternalClient(callback) { + // TODO(NODE-4144): Remove new variable for type narrowing + const internalClient = this[kInternalClient]; + if (this.needsConnecting && internalClient != null) { + this.needsConnecting = false; + return internalClient.connect(callback); + } + return callback(); + } + close(client, force, callback) { + this.autoEncrypter.teardown(!!force, e => { + const internalClient = this[kInternalClient]; + if (internalClient != null && client !== internalClient) { + return internalClient.close(force, callback); + } + callback(e); + }); + } + static checkForMongoCrypt() { + let mongodbClientEncryption = undefined; + // Ensure you always wrap an optional require in the try block NODE-3199 + try { + // Note (NODE-4254): This is to get around the circular dependency between + // mongodb-client-encryption and the driver in the test scenarios. + if (process.env.MONGODB_CLIENT_ENCRYPTION_OVERRIDE) { + mongodbClientEncryption = require(process.env.MONGODB_CLIENT_ENCRYPTION_OVERRIDE); + } + else { + mongodbClientEncryption = require('mongodb-client-encryption'); + } + } + catch (err) { + throw new error_1.MongoMissingDependencyError('Auto-encryption requested, but the module is not installed. ' + + 'Please add `mongodb-client-encryption` as a dependency of your project'); + } + AutoEncrypterClass = mongodbClientEncryption.extension(require('../lib/index')).AutoEncrypter; + } +} +exports.Encrypter = Encrypter; +//# sourceMappingURL=encrypter.js.map \ No newline at end of file diff --git a/node_modules/mongodb/lib/encrypter.js.map b/node_modules/mongodb/lib/encrypter.js.map new file mode 100644 index 000000000..c4fd5ae22 --- /dev/null +++ b/node_modules/mongodb/lib/encrypter.js.map @@ -0,0 +1 @@ +{"version":3,"file":"encrypter.js","sourceRoot":"","sources":["../src/encrypter.ts"],"names":[],"mappings":";;;AAAA,uDAAuD;AACvD,iCAAgD;AAChD,2CAAkD;AAElD,mCAAiF;AACjF,iDAAiE;AAGjE,IAAI,kBAAiC,CAAC;AAEtC,gBAAgB;AAChB,MAAM,eAAe,GAAG,MAAM,CAAC,gBAAgB,CAAC,CAAC;AAQjD,gBAAgB;AAChB,MAAa,SAAS;IAMpB,YAAY,MAAmB,EAAE,GAAW,EAAE,OAA2B;QACvE,IAAI,OAAO,OAAO,CAAC,cAAc,KAAK,QAAQ,EAAE;YAC9C,MAAM,IAAI,iCAAyB,CAAC,2CAA2C,CAAC,CAAC;SAClF;QACD,2HAA2H;QAC3H,IAAI,CAAC,eAAe,CAAC,GAAG,IAAI,CAAC;QAE7B,IAAI,CAAC,oBAAoB,GAAG,CAAC,CAAC,OAAO,CAAC,cAAc,CAAC,oBAAoB,CAAC;QAC1E,IAAI,CAAC,eAAe,GAAG,KAAK,CAAC;QAE7B,IAAI,OAAO,CAAC,WAAW,KAAK,CAAC,IAAI,OAAO,CAAC,cAAc,CAAC,cAAc,IAAI,IAAI,EAAE;YAC9E,OAAO,CAAC,cAAc,CAAC,cAAc,GAAG,MAAM,CAAC;SAChD;aAAM,IAAI,OAAO,CAAC,cAAc,CAAC,cAAc,IAAI,IAAI,EAAE;YACxD,OAAO,CAAC,cAAc,CAAC,cAAc,GAAG,IAAI,CAAC,iBAAiB,CAAC,MAAM,EAAE,GAAG,EAAE,OAAO,CAAC,CAAC;SACtF;QAED,IAAI,IAAI,CAAC,oBAAoB,EAAE;YAC7B,OAAO,CAAC,cAAc,CAAC,cAAc,GAAG,SAAS,CAAC;SACnD;aAAM,IA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AE,CAAC,CAAC,EAAE;YACvC,MAAM,cAAc,GAAG,IAAI,CAAC,eAAe,CAAC,CAAC;YAC7C,IAAI,cAAc,IAAI,IAAI,IAAI,MAAM,KAAK,cAAc,EAAE;gBACvD,OAAO,cAAc,CAAC,KAAK,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;aAC9C;YACD,QAAQ,CAAC,CAAC,CAAC,CAAC;QACd,CAAC,CAAC,CAAC;IACL,CAAC;IAED,MAAM,CAAC,kBAAkB;QACvB,IAAI,uBAAuB,GAAG,SAAS,CAAC;QACxC,wEAAwE;QACxE,IAAI;YACF,0EAA0E;YAC1E,kEAAkE;YAClE,IAAI,OAAO,CAAC,GAAG,CAAC,kCAAkC,EAAE;gBAClD,uBAAuB,GAAG,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,kCAAkC,CAAC,CAAC;aACnF;iBAAM;gBACL,uBAAuB,GAAG,OAAO,CAAC,2BAA2B,CAAC,CAAC;aAChE;SACF;QAAC,OAAO,GAAG,EAAE;YACZ,MAAM,IAAI,mCAA2B,CACnC,8DAA8D;gBAC5D,wEAAwE,CAC3E,CAAC;SACH;QAED,kBAAkB,GAAG,uBAAuB,CAAC,SAAS,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC,CAAC,aAAa,CAAC;IAChG,CAAC;CACF;AA5HD,8BA4HC"} \ No newline at end of file diff --git a/node_modules/mongodb/lib/error.js b/node_modules/mongodb/lib/error.js new file mode 100644 index 000000000..cf28508db --- /dev/null +++ b/node_modules/mongodb/lib/error.js @@ -0,0 +1,799 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.isResumableError = exports.isNetworkTimeoutError = exports.isSDAMUnrecoverableError = exports.isNodeShuttingDownError = exports.isRetryableReadError = exports.isRetryableWriteError = exports.needsRetryableWriteLabel = exports.MongoWriteConcernError = exports.MongoServerSelectionError = exports.MongoSystemError = exports.MongoMissingDependencyError = exports.MongoMissingCredentialsError = exports.MongoCompatibilityError = exports.MongoInvalidArgumentError = exports.MongoParseError = exports.MongoNetworkTimeoutError = exports.MongoNetworkError = exports.isNetworkErrorBeforeHandshake = exports.MongoTopologyClosedError = exports.MongoCursorExhaustedError = exports.MongoServerClosedError = exports.MongoCursorInUseError = exports.MongoUnexpectedServerResponseError = exports.MongoGridFSChunkError = exports.MongoGridFSStreamError = exports.MongoTailableCursorError = exports.MongoChangeStreamError = exports.MongoAWSError = exports.MongoKerberosError = exports.MongoExpiredSessionError = exports.MongoTransactionError = exports.MongoNotConnectedError = exports.MongoDecompressionError = exports.MongoBatchReExecutionError = exports.MongoRuntimeError = exports.MongoAPIError = exports.MongoDriverError = exports.MongoServerError = exports.MongoError = exports.MongoErrorLabel = exports.GET_MORE_RESUMABLE_CODES = exports.MONGODB_ERROR_CODES = exports.NODE_IS_RECOVERING_ERROR_MESSAGE = exports.LEGACY_NOT_PRIMARY_OR_SECONDARY_ERROR_MESSAGE = exports.LEGACY_NOT_WRITABLE_PRIMARY_ERROR_MESSAGE = void 0; +/** @internal */ +const kErrorLabels = Symbol('errorLabels'); +/** + * @internal + * The legacy error message from the server that indicates the node is not a writable primary + * https://github.com/mongodb/specifications/blob/b07c26dc40d04ac20349f989db531c9845fdd755/source/server-discovery-and-monitoring/server-discovery-and-monitoring.rst#not-writable-primary-and-node-is-recovering + */ +exports.LEGACY_NOT_WRITABLE_PRIMARY_ERROR_MESSAGE = new RegExp('not master', 'i'); +/** + * @internal + * The legacy error message from the server that indicates the node is not a primary or secondary + * https://github.com/mongodb/specifications/blob/b07c26dc40d04ac20349f989db531c9845fdd755/source/server-discovery-and-monitoring/server-discovery-and-monitoring.rst#not-writable-primary-and-node-is-recovering + */ +exports.LEGACY_NOT_PRIMARY_OR_SECONDARY_ERROR_MESSAGE = new RegExp('not master or secondary', 'i'); +/** + * @internal + * The error message from the server that indicates the node is recovering + * https://github.com/mongodb/specifications/blob/b07c26dc40d04ac20349f989db531c9845fdd755/source/server-discovery-and-monitoring/server-discovery-and-monitoring.rst#not-writable-primary-and-node-is-recovering + */ +exports.NODE_IS_RECOVERING_ERROR_MESSAGE = new RegExp('node is recovering', 'i'); +/** @internal MongoDB Error Codes */ +exports.MONGODB_ERROR_CODES = Object.freeze({ + HostUnreachable: 6, + HostNotFound: 7, + NetworkTimeout: 89, + ShutdownInProgress: 91, + PrimarySteppedDown: 189, + ExceededTimeLimit: 262, + SocketException: 9001, + NotWritablePrimary: 10107, + InterruptedAtShutdown: 11600, + InterruptedDueToReplStateChange: 11602, + NotPrimaryNoSecondaryOk: 13435, + NotPrimaryOrSecondary: 13436, + StaleShardVersion: 63, + StaleEpoch: 150, + StaleConfig: 13388, + RetryChangeStream: 234, + FailedToSatisfyReadPreference: 133, + CursorNotFound: 43, + LegacyNotPrimary: 10058, + WriteConcernFailed: 64, + NamespaceNotFound: 26, + IllegalOperation: 20, + MaxTimeMSExpired: 50, + UnknownReplWriteConcern: 79, + UnsatisfiableWriteConcern: 100 +}); +// From spec@https://github.com/mongodb/specifications/blob/f93d78191f3db2898a59013a7ed5650352ef6da8/source/change-streams/change-streams.rst#resumable-error +exports.GET_MORE_RESUMABLE_CODES = new Set([ + exports.MONGODB_ERROR_CODES.HostUnreachable, + exports.MONGODB_ERROR_CODES.HostNotFound, + exports.MONGODB_ERROR_CODES.NetworkTimeout, + exports.MONGODB_ERROR_CODES.ShutdownInProgress, + exports.MONGODB_ERROR_CODES.PrimarySteppedDown, + exports.MONGODB_ERROR_CODES.ExceededTimeLimit, + exports.MONGODB_ERROR_CODES.SocketException, + exports.MONGODB_ERROR_CODES.NotWritablePrimary, + exports.MONGODB_ERROR_CODES.InterruptedAtShutdown, + exports.MONGODB_ERROR_CODES.InterruptedDueToReplStateChange, + exports.MONGODB_ERROR_CODES.NotPrimaryNoSecondaryOk, + exports.MONGODB_ERROR_CODES.NotPrimaryOrSecondary, + exports.MONGODB_ERROR_CODES.StaleShardVersion, + exports.MONGODB_ERROR_CODES.StaleEpoch, + exports.MONGODB_ERROR_CODES.StaleConfig, + exports.MONGODB_ERROR_CODES.RetryChangeStream, + exports.MONGODB_ERROR_CODES.FailedToSatisfyReadPreference, + exports.MONGODB_ERROR_CODES.CursorNotFound +]); +/** @public */ +exports.MongoErrorLabel = Object.freeze({ + RetryableWriteError: 'RetryableWriteError', + TransientTransactionError: 'TransientTransactionError', + UnknownTransactionCommitResult: 'UnknownTransactionCommitResult', + ResumableChangeStreamError: 'ResumableChangeStreamError', + HandshakeError: 'HandshakeError' +}); +/** + * @public + * @category Error + * + * @privateRemarks + * CSFLE has a dependency on this error, it uses the constructor with a string argument + */ +class MongoError extends Error { + constructor(message) { + if (message instanceof Error) { + super(message.message); + } + else { + super(message); + } + this[kErrorLabels] = new Set(); + } + get name() { + return 'MongoError'; + } + /** Legacy name for server error responses */ + get errmsg() { + return this.message; + } + /** + * Checks the error to see if it has an error label + * + * @param label - The error label to check for + * @returns returns true if the error has the provided error label + */ + hasErrorLabel(label) { + return this[kErrorLabels].has(label); + } + addErrorLabel(label) { + this[kErrorLabels].add(label); + } + get errorLabels() { + return Array.from(this[kErrorLabels]); + } +} +exports.MongoError = MongoError; +/** + * An error coming from the mongo server + * + * @public + * @category Error + */ +class MongoServerError extends MongoError { + constructor(message) { + super(message.message || message.errmsg || message.$err || 'n/a'); + if (message.errorLabels) { + this[kErrorLabels] = new Set(message.errorLabels); + } + for (const name in message) { + if (name !== 'errorLabels' && name !== 'errmsg' && name !== 'message') + this[name] = message[name]; + } + } + get name() { + return 'MongoServerError'; + } +} +exports.MongoServerError = MongoServerError; +/** + * An error generated by the driver + * + * @public + * @category Error + */ +class MongoDriverError extends MongoError { + constructor(message) { + super(message); + } + get name() { + return 'MongoDriverError'; + } +} +exports.MongoDriverError = MongoDriverError; +/** + * An error generated when the driver API is used incorrectly + * + * @privateRemarks + * Should **never** be directly instantiated + * + * @public + * @category Error + */ +class MongoAPIError extends MongoDriverError { + constructor(message) { + super(message); + } + get name() { + return 'MongoAPIError'; + } +} +exports.MongoAPIError = MongoAPIError; +/** + * An error generated when the driver encounters unexpected input + * or reaches an unexpected/invalid internal state + * + * @privateRemarks + * Should **never** be directly instantiated. + * + * @public + * @category Error + */ +class MongoRuntimeError extends MongoDriverError { + constructor(message) { + super(message); + } + get name() { + return 'MongoRuntimeError'; + } +} +exports.MongoRuntimeError = MongoRuntimeError; +/** + * An error generated when a batch command is re-executed after one of the commands in the batch + * has failed + * + * @public + * @category Error + */ +class MongoBatchReExecutionError extends MongoAPIError { + constructor(message = 'This batch has already been executed, create new batch to execute') { + super(message); + } + get name() { + return 'MongoBatchReExecutionError'; + } +} +exports.MongoBatchReExecutionError = MongoBatchReExecutionError; +/** + * An error generated when the driver fails to decompress + * data received from the server. + * + * @public + * @category Error + */ +class MongoDecompressionError extends MongoRuntimeError { + constructor(message) { + super(message); + } + get name() { + return 'MongoDecompressionError'; + } +} +exports.MongoDecompressionError = MongoDecompressionError; +/** + * An error thrown when the user attempts to operate on a database or collection through a MongoClient + * that has not yet successfully called the "connect" method + * + * @public + * @category Error + */ +class MongoNotConnectedError extends MongoAPIError { + constructor(message) { + super(message); + } + get name() { + return 'MongoNotConnectedError'; + } +} +exports.MongoNotConnectedError = MongoNotConnectedError; +/** + * An error generated when the user makes a mistake in the usage of transactions. + * (e.g. attempting to commit a transaction with a readPreference other than primary) + * + * @public + * @category Error + */ +class MongoTransactionError extends MongoAPIError { + constructor(message) { + super(message); + } + get name() { + return 'MongoTransactionError'; + } +} +exports.MongoTransactionError = MongoTransactionError; +/** + * An error generated when the user attempts to operate + * on a session that has expired or has been closed. + * + * @public + * @category Error + */ +class MongoExpiredSessionError extends MongoAPIError { + constructor(message = 'Cannot use a session that has ended') { + super(message); + } + get name() { + return 'MongoExpiredSessionError'; + } +} +exports.MongoExpiredSessionError = MongoExpiredSessionError; +/** + * A error generated when the user attempts to authenticate + * via Kerberos, but fails to connect to the Kerberos client. + * + * @public + * @category Error + */ +class MongoKerberosError extends MongoRuntimeError { + constructor(message) { + super(message); + } + get name() { + return 'MongoKerberosError'; + } +} +exports.MongoKerberosError = MongoKerberosError; +/** + * A error generated when the user attempts to authenticate + * via AWS, but fails + * + * @public + * @category Error + */ +class MongoAWSError extends MongoRuntimeError { + constructor(message) { + super(message); + } + get name() { + return 'MongoAWSError'; + } +} +exports.MongoAWSError = MongoAWSError; +/** + * An error generated when a ChangeStream operation fails to execute. + * + * @public + * @category Error + */ +class MongoChangeStreamError extends MongoRuntimeError { + constructor(message) { + super(message); + } + get name() { + return 'MongoChangeStreamError'; + } +} +exports.MongoChangeStreamError = MongoChangeStreamError; +/** + * An error thrown when the user calls a function or method not supported on a tailable cursor + * + * @public + * @category Error + */ +class MongoTailableCursorError extends MongoAPIError { + constructor(message = 'Tailable cursor does not support this operation') { + super(message); + } + get name() { + return 'MongoTailableCursorError'; + } +} +exports.MongoTailableCursorError = MongoTailableCursorError; +/** An error generated when a GridFSStream operation fails to execute. + * + * @public + * @category Error + */ +class MongoGridFSStreamError extends MongoRuntimeError { + constructor(message) { + super(message); + } + get name() { + return 'MongoGridFSStreamError'; + } +} +exports.MongoGridFSStreamError = MongoGridFSStreamError; +/** + * An error generated when a malformed or invalid chunk is + * encountered when reading from a GridFSStream. + * + * @public + * @category Error + */ +class MongoGridFSChunkError extends MongoRuntimeError { + constructor(message) { + super(message); + } + get name() { + return 'MongoGridFSChunkError'; + } +} +exports.MongoGridFSChunkError = MongoGridFSChunkError; +/** + * An error generated when a **parsable** unexpected response comes from the server. + * This is generally an error where the driver in a state expecting a certain behavior to occur in + * the next message from MongoDB but it receives something else. + * This error **does not** represent an issue with wire message formatting. + * + * #### Example + * When an operation fails, it is the driver's job to retry it. It must perform serverSelection + * again to make sure that it attempts the operation against a server in a good state. If server + * selection returns a server that does not support retryable operations, this error is used. + * This scenario is unlikely as retryable support would also have been determined on the first attempt + * but it is possible the state change could report a selectable server that does not support retries. + * + * @public + * @category Error + */ +class MongoUnexpectedServerResponseError extends MongoRuntimeError { + constructor(message) { + super(message); + } + get name() { + return 'MongoUnexpectedServerResponseError'; + } +} +exports.MongoUnexpectedServerResponseError = MongoUnexpectedServerResponseError; +/** + * An error thrown when the user attempts to add options to a cursor that has already been + * initialized + * + * @public + * @category Error + */ +class MongoCursorInUseError extends MongoAPIError { + constructor(message = 'Cursor is already initialized') { + super(message); + } + get name() { + return 'MongoCursorInUseError'; + } +} +exports.MongoCursorInUseError = MongoCursorInUseError; +/** + * An error generated when an attempt is made to operate + * on a closed/closing server. + * + * @public + * @category Error + */ +class MongoServerClosedError extends MongoAPIError { + constructor(message = 'Server is closed') { + super(message); + } + get name() { + return 'MongoServerClosedError'; + } +} +exports.MongoServerClosedError = MongoServerClosedError; +/** + * An error thrown when an attempt is made to read from a cursor that has been exhausted + * + * @public + * @category Error + */ +class MongoCursorExhaustedError extends MongoAPIError { + constructor(message) { + super(message || 'Cursor is exhausted'); + } + get name() { + return 'MongoCursorExhaustedError'; + } +} +exports.MongoCursorExhaustedError = MongoCursorExhaustedError; +/** + * An error generated when an attempt is made to operate on a + * dropped, or otherwise unavailable, database. + * + * @public + * @category Error + */ +class MongoTopologyClosedError extends MongoAPIError { + constructor(message = 'Topology is closed') { + super(message); + } + get name() { + return 'MongoTopologyClosedError'; + } +} +exports.MongoTopologyClosedError = MongoTopologyClosedError; +/** @internal */ +const kBeforeHandshake = Symbol('beforeHandshake'); +function isNetworkErrorBeforeHandshake(err) { + return err[kBeforeHandshake] === true; +} +exports.isNetworkErrorBeforeHandshake = isNetworkErrorBeforeHandshake; +/** + * An error indicating an issue with the network, including TCP errors and timeouts. + * @public + * @category Error + */ +class MongoNetworkError extends MongoError { + constructor(message, options) { + super(message); + if (options && typeof options.beforeHandshake === 'boolean') { + this[kBeforeHandshake] = options.beforeHandshake; + } + } + get name() { + return 'MongoNetworkError'; + } +} +exports.MongoNetworkError = MongoNetworkError; +/** + * An error indicating a network timeout occurred + * @public + * @category Error + * + * @privateRemarks + * CSFLE has a dependency on this error with an instanceof check + */ +class MongoNetworkTimeoutError extends MongoNetworkError { + constructor(message, options) { + super(message, options); + } + get name() { + return 'MongoNetworkTimeoutError'; + } +} +exports.MongoNetworkTimeoutError = MongoNetworkTimeoutError; +/** + * An error used when attempting to parse a value (like a connection string) + * @public + * @category Error + */ +class MongoParseError extends MongoDriverError { + constructor(message) { + super(message); + } + get name() { + return 'MongoParseError'; + } +} +exports.MongoParseError = MongoParseError; +/** + * An error generated when the user supplies malformed or unexpected arguments + * or when a required argument or field is not provided. + * + * + * @public + * @category Error + */ +class MongoInvalidArgumentError extends MongoAPIError { + constructor(message) { + super(message); + } + get name() { + return 'MongoInvalidArgumentError'; + } +} +exports.MongoInvalidArgumentError = MongoInvalidArgumentError; +/** + * An error generated when a feature that is not enabled or allowed for the current server + * configuration is used + * + * + * @public + * @category Error + */ +class MongoCompatibilityError extends MongoAPIError { + constructor(message) { + super(message); + } + get name() { + return 'MongoCompatibilityError'; + } +} +exports.MongoCompatibilityError = MongoCompatibilityError; +/** + * An error generated when the user fails to provide authentication credentials before attempting + * to connect to a mongo server instance. + * + * + * @public + * @category Error + */ +class MongoMissingCredentialsError extends MongoAPIError { + constructor(message) { + super(message); + } + get name() { + return 'MongoMissingCredentialsError'; + } +} +exports.MongoMissingCredentialsError = MongoMissingCredentialsError; +/** + * An error generated when a required module or dependency is not present in the local environment + * + * @public + * @category Error + */ +class MongoMissingDependencyError extends MongoAPIError { + constructor(message) { + super(message); + } + get name() { + return 'MongoMissingDependencyError'; + } +} +exports.MongoMissingDependencyError = MongoMissingDependencyError; +/** + * An error signifying a general system issue + * @public + * @category Error + */ +class MongoSystemError extends MongoError { + constructor(message, reason) { + var _a; + if (reason && reason.error) { + super(reason.error.message || reason.error); + } + else { + super(message); + } + if (reason) { + this.reason = reason; + } + this.code = (_a = reason.error) === null || _a === void 0 ? void 0 : _a.code; + } + get name() { + return 'MongoSystemError'; + } +} +exports.MongoSystemError = MongoSystemError; +/** + * An error signifying a client-side server selection error + * @public + * @category Error + */ +class MongoServerSelectionError extends MongoSystemError { + constructor(message, reason) { + super(message, reason); + } + get name() { + return 'MongoServerSelectionError'; + } +} +exports.MongoServerSelectionError = MongoServerSelectionError; +function makeWriteConcernResultObject(input) { + const output = Object.assign({}, input); + if (output.ok === 0) { + output.ok = 1; + delete output.errmsg; + delete output.code; + delete output.codeName; + } + return output; +} +/** + * An error thrown when the server reports a writeConcernError + * @public + * @category Error + */ +class MongoWriteConcernError extends MongoServerError { + constructor(message, result) { + if (result && Array.isArray(result.errorLabels)) { + message.errorLabels = result.errorLabels; + } + super(message); + this.errInfo = message.errInfo; + if (result != null) { + this.result = makeWriteConcernResultObject(result); + } + } + get name() { + return 'MongoWriteConcernError'; + } +} +exports.MongoWriteConcernError = MongoWriteConcernError; +// https://github.com/mongodb/specifications/blob/master/source/retryable-reads/retryable-reads.rst#retryable-error +const RETRYABLE_READ_ERROR_CODES = new Set([ + exports.MONGODB_ERROR_CODES.HostUnreachable, + exports.MONGODB_ERROR_CODES.HostNotFound, + exports.MONGODB_ERROR_CODES.NetworkTimeout, + exports.MONGODB_ERROR_CODES.ShutdownInProgress, + exports.MONGODB_ERROR_CODES.PrimarySteppedDown, + exports.MONGODB_ERROR_CODES.SocketException, + exports.MONGODB_ERROR_CODES.NotWritablePrimary, + exports.MONGODB_ERROR_CODES.InterruptedAtShutdown, + exports.MONGODB_ERROR_CODES.InterruptedDueToReplStateChange, + exports.MONGODB_ERROR_CODES.NotPrimaryNoSecondaryOk, + exports.MONGODB_ERROR_CODES.NotPrimaryOrSecondary +]); +// see: https://github.com/mongodb/specifications/blob/master/source/retryable-writes/retryable-writes.rst#terms +const RETRYABLE_WRITE_ERROR_CODES = new Set([ + ...RETRYABLE_READ_ERROR_CODES, + exports.MONGODB_ERROR_CODES.ExceededTimeLimit +]); +function needsRetryableWriteLabel(error, maxWireVersion) { + var _a, _b, _c; + // pre-4.4 server, then the driver adds an error label for every valid case + // execute operation will only inspect the label, code/message logic is handled here + if (error instanceof MongoNetworkError) { + return true; + } + if (error instanceof MongoError) { + if ((maxWireVersion >= 9 || error.hasErrorLabel(exports.MongoErrorLabel.RetryableWriteError)) && + !error.hasErrorLabel(exports.MongoErrorLabel.HandshakeError)) { + // If we already have the error label no need to add it again. 4.4+ servers add the label. + // In the case where we have a handshake error, need to fall down to the logic checking + // the codes. + return false; + } + } + if (error instanceof MongoWriteConcernError) { + return RETRYABLE_WRITE_ERROR_CODES.has((_c = (_b = (_a = error.result) === null || _a === void 0 ? void 0 : _a.code) !== null && _b !== void 0 ? _b : error.code) !== null && _c !== void 0 ? _c : 0); + } + if (error instanceof MongoError && typeof error.code === 'number') { + return RETRYABLE_WRITE_ERROR_CODES.has(error.code); + } + const isNotWritablePrimaryError = exports.LEGACY_NOT_WRITABLE_PRIMARY_ERROR_MESSAGE.test(error.message); + if (isNotWritablePrimaryError) { + return true; + } + const isNodeIsRecoveringError = exports.NODE_IS_RECOVERING_ERROR_MESSAGE.test(error.message); + if (isNodeIsRecoveringError) { + return true; + } + return false; +} +exports.needsRetryableWriteLabel = needsRetryableWriteLabel; +function isRetryableWriteError(error) { + return error.hasErrorLabel(exports.MongoErrorLabel.RetryableWriteError); +} +exports.isRetryableWriteError = isRetryableWriteError; +/** Determines whether an error is something the driver should attempt to retry */ +function isRetryableReadError(error) { + const hasRetryableErrorCode = typeof error.code === 'number' ? RETRYABLE_READ_ERROR_CODES.has(error.code) : false; + if (hasRetryableErrorCode) { + return true; + } + if (error instanceof MongoNetworkError) { + return true; + } + const isNotWritablePrimaryError = exports.LEGACY_NOT_WRITABLE_PRIMARY_ERROR_MESSAGE.test(error.message); + if (isNotWritablePrimaryError) { + return true; + } + const isNodeIsRecoveringError = exports.NODE_IS_RECOVERING_ERROR_MESSAGE.test(error.message); + if (isNodeIsRecoveringError) { + return true; + } + return false; +} +exports.isRetryableReadError = isRetryableReadError; +const SDAM_RECOVERING_CODES = new Set([ + exports.MONGODB_ERROR_CODES.ShutdownInProgress, + exports.MONGODB_ERROR_CODES.PrimarySteppedDown, + exports.MONGODB_ERROR_CODES.InterruptedAtShutdown, + exports.MONGODB_ERROR_CODES.InterruptedDueToReplStateChange, + exports.MONGODB_ERROR_CODES.NotPrimaryOrSecondary +]); +const SDAM_NOT_PRIMARY_CODES = new Set([ + exports.MONGODB_ERROR_CODES.NotWritablePrimary, + exports.MONGODB_ERROR_CODES.NotPrimaryNoSecondaryOk, + exports.MONGODB_ERROR_CODES.LegacyNotPrimary +]); +const SDAM_NODE_SHUTTING_DOWN_ERROR_CODES = new Set([ + exports.MONGODB_ERROR_CODES.InterruptedAtShutdown, + exports.MONGODB_ERROR_CODES.ShutdownInProgress +]); +function isRecoveringError(err) { + if (typeof err.code === 'number') { + // If any error code exists, we ignore the error.message + return SDAM_RECOVERING_CODES.has(err.code); + } + return (exports.LEGACY_NOT_PRIMARY_OR_SECONDARY_ERROR_MESSAGE.test(err.message) || + exports.NODE_IS_RECOVERING_ERROR_MESSAGE.test(err.message)); +} +function isNotWritablePrimaryError(err) { + if (typeof err.code === 'number') { + // If any error code exists, we ignore the error.message + return SDAM_NOT_PRIMARY_CODES.has(err.code); + } + if (isRecoveringError(err)) { + return false; + } + return exports.LEGACY_NOT_WRITABLE_PRIMARY_ERROR_MESSAGE.test(err.message); +} +function isNodeShuttingDownError(err) { + return !!(typeof err.code === 'number' && SDAM_NODE_SHUTTING_DOWN_ERROR_CODES.has(err.code)); +} +exports.isNodeShuttingDownError = isNodeShuttingDownError; +/** + * Determines whether SDAM can recover from a given error. If it cannot + * then the pool will be cleared, and server state will completely reset + * locally. + * + * @see https://github.com/mongodb/specifications/blob/master/source/server-discovery-and-monitoring/server-discovery-and-monitoring.rst#not-master-and-node-is-recovering + */ +function isSDAMUnrecoverableError(error) { + // NOTE: null check is here for a strictly pre-CMAP world, a timeout or + // close event are considered unrecoverable + if (error instanceof MongoParseError || error == null) { + return true; + } + return isRecoveringError(error) || isNotWritablePrimaryError(error); +} +exports.isSDAMUnrecoverableError = isSDAMUnrecoverableError; +function isNetworkTimeoutError(err) { + return !!(err instanceof MongoNetworkError && err.message.match(/timed out/)); +} +exports.isNetworkTimeoutError = isNetworkTimeoutError; +function isResumableError(error, wireVersion) { + if (error == null || !(error instanceof MongoError)) { + return false; + } + if (error instanceof MongoNetworkError) { + return true; + } + if (wireVersion != null && wireVersion >= 9) { + // DRIVERS-1308: For 4.4 drivers running against 4.4 servers, drivers will add a special case to treat the CursorNotFound error code as resumable + if (error.code === exports.MONGODB_ERROR_CODES.CursorNotFound) { + return true; + } + return error.hasErrorLabel(exports.MongoErrorLabel.ResumableChangeStreamError); + } + if (typeof error.code === 'number') { + return exports.GET_MORE_RESUMABLE_CODES.has(error.code); + } + return false; +} +exports.isResumableError = isResumableError; +//# sourceMappingURL=error.js.map \ No newline at end of file diff --git a/node_modules/mongodb/lib/error.js.map b/node_modules/mongodb/lib/error.js.map new file mode 100644 index 000000000..c02c2d88e --- /dev/null +++ b/node_modules/mongodb/lib/error.js.map @@ -0,0 +1 @@ +{"version":3,"file":"error.js","sourceRoot":"","sources":["../src/error.ts"],"names":[],"mappings":";;;AAOA,gBAAgB;AAChB,MAAM,YAAY,GAAG,MAAM,CAAC,aAAa,CAAC,CAAC;AAE3C;;;;GAIG;AACU,QAAA,yCAAyC,GAAG,IAAI,MAAM,CAAC,YAAY,EAAE,GAAG,CAAC,CAAC;AAEvF;;;;GAIG;AACU,QAAA,6CAA6C,GAAG,IAAI,MAAM,CACrE,yBAAyB,EACzB,GAAG,CACJ,CAAC;AAEF;;;;GAIG;AACU,QAAA,gCAAgC,GAAG,IAAI,MAAM,CAAC,oBAAoB,EAAE,GAAG,CAAC,CAAC;AAEtF,oCAAoC;AACvB,QAAA,mBAAmB,GAAG,MAAM,CAAC,MAAM,CAAC;IAC/C,eAAe,EAAE,CAAC;IAClB,YAAY,EAAE,CAAC;IACf,cAAc,EAAE,EAAE;IAClB,kBAAkB,EAAE,EAAE;IACtB,kBAAkB,EAAE,GAAG;IACvB,iBAAiB,EAAE,GAAG;IACtB,eAAe,EAAE,IAAI;IACrB,kBAAkB,EAAE,KAAK;IACzB,q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IACnD,OAAO,CAAC,CAAC,CAAC,GAAG,YAAY,iBAAiB,IAAI,GAAG,CAAC,OAAO,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC;AAChF,CAAC;AAFD,sDAEC;AAED,SAAgB,gBAAgB,CAAC,KAAa,EAAE,WAAoB;IAClE,IAAI,KAAK,IAAI,IAAI,IAAI,CAAC,CAAC,KAAK,YAAY,UAAU,CAAC,EAAE;QACnD,OAAO,KAAK,CAAC;KACd;IAED,IAAI,KAAK,YAAY,iBAAiB,EAAE;QACtC,OAAO,IAAI,CAAC;KACb;IAED,IAAI,WAAW,IAAI,IAAI,IAAI,WAAW,IAAI,CAAC,EAAE;QAC3C,iJAAiJ;QACjJ,IAAI,KAAK,CAAC,IAAI,KAAK,2BAAmB,CAAC,cAAc,EAAE;YACrD,OAAO,IAAI,CAAC;SACb;QACD,OAAO,KAAK,CAAC,aAAa,CAAC,uBAAe,CAAC,0BAA0B,CAAC,CAAC;KACxE;IAED,IAAI,OAAO,KAAK,CAAC,IAAI,KAAK,QAAQ,EAAE;QAClC,OAAO,gCAAwB,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;KACjD;IAED,OAAO,KAAK,CAAC;AACf,CAAC;AAtBD,4CAsBC"} \ No newline at end of file diff --git a/node_modules/mongodb/lib/explain.js b/node_modules/mongodb/lib/explain.js new file mode 100644 index 000000000..bc55e1fee --- /dev/null +++ b/node_modules/mongodb/lib/explain.js @@ -0,0 +1,35 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Explain = exports.ExplainVerbosity = void 0; +const error_1 = require("./error"); +/** @public */ +exports.ExplainVerbosity = Object.freeze({ + queryPlanner: 'queryPlanner', + queryPlannerExtended: 'queryPlannerExtended', + executionStats: 'executionStats', + allPlansExecution: 'allPlansExecution' +}); +/** @internal */ +class Explain { + constructor(verbosity) { + if (typeof verbosity === 'boolean') { + this.verbosity = verbosity + ? exports.ExplainVerbosity.allPlansExecution + : exports.ExplainVerbosity.queryPlanner; + } + else { + this.verbosity = verbosity; + } + } + static fromOptions(options) { + if ((options === null || options === void 0 ? void 0 : options.explain) == null) + return; + const explain = options.explain; + if (typeof explain === 'boolean' || typeof explain === 'string') { + return new Explain(explain); + } + throw new error_1.MongoInvalidArgumentError('Field "explain" must be a string or a boolean'); + } +} +exports.Explain = Explain; +//# sourceMappingURL=explain.js.map \ No newline at end of file diff --git a/node_modules/mongodb/lib/explain.js.map b/node_modules/mongodb/lib/explain.js.map new file mode 100644 index 000000000..ae503b22b --- /dev/null +++ b/node_modules/mongodb/lib/explain.js.map @@ -0,0 +1 @@ +{"version":3,"file":"explain.js","sourceRoot":"","sources":["../src/explain.ts"],"names":[],"mappings":";;;AAAA,mCAAoD;AAEpD,cAAc;AACD,QAAA,gBAAgB,GAAG,MAAM,CAAC,MAAM,CAAC;IAC5C,YAAY,EAAE,cAAc;IAC5B,oBAAoB,EAAE,sBAAsB;IAC5C,cAAc,EAAE,gBAAgB;IAChC,iBAAiB,EAAE,mBAAmB;CAC9B,CAAC,CAAC;AAmBZ,gBAAgB;AAChB,MAAa,OAAO;IAGlB,YAAY,SAA+B;QACzC,IAAI,OAAO,SAAS,KAAK,SAAS,EAAE;YAClC,IAAI,CAAC,SAAS,GAAG,SAAS;gBACxB,CAAC,CAAC,wBAAgB,CAAC,iBAAiB;gBACpC,CAAC,CAAC,wBAAgB,CAAC,YAAY,CAAC;SACnC;aAAM;YACL,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;SAC5B;IACH,CAAC;IAED,MAAM,CAAC,WAAW,CAAC,OAAwB;QACzC,IAAI,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,OAAO,KAAI,IAAI;YAAE,OAAO;QAErC,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;QAChC,IAAI,OAAO,OAAO,KAAK,SAAS,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE;YAC/D,OAAO,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC;SAC7B;QAED,MAAM,IAAI,iCAAyB,CAAC,+CAA+C,CAAC,CAAC;IACvF,CAAC;CACF;AAvBD,0BAuBC"} \ No newline at end of file diff --git a/node_modules/mongodb/lib/gridfs/download.js b/node_modules/mongodb/lib/gridfs/download.js new file mode 100644 index 000000000..ad7c2d08f --- /dev/null +++ b/node_modules/mongodb/lib/gridfs/download.js @@ -0,0 +1,317 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.GridFSBucketReadStream = void 0; +const stream_1 = require("stream"); +const error_1 = require("../error"); +/** + * A readable stream that enables you to read buffers from GridFS. + * + * Do not instantiate this class directly. Use `openDownloadStream()` instead. + * @public + */ +class GridFSBucketReadStream extends stream_1.Readable { + /** @internal + * @param chunks - Handle for chunks collection + * @param files - Handle for files collection + * @param readPreference - The read preference to use + * @param filter - The filter to use to find the file document + */ + constructor(chunks, files, readPreference, filter, options) { + super(); + this.s = { + bytesToTrim: 0, + bytesToSkip: 0, + bytesRead: 0, + chunks, + expected: 0, + files, + filter, + init: false, + expectedEnd: 0, + options: { + start: 0, + end: 0, + ...options + }, + readPreference + }; + } + /** + * Reads from the cursor and pushes to the stream. + * Private Impl, do not call directly + * @internal + */ + _read() { + if (this.destroyed) + return; + waitForFile(this, () => doRead(this)); + } + /** + * Sets the 0-based offset in bytes to start streaming from. Throws + * an error if this stream has entered flowing mode + * (e.g. if you've already called `on('data')`) + * + * @param start - 0-based offset in bytes to start streaming from + */ + start(start = 0) { + throwIfInitialized(this); + this.s.options.start = start; + return this; + } + /** + * Sets the 0-based offset in bytes to start streaming from. Throws + * an error if this stream has entered flowing mode + * (e.g. if you've already called `on('data')`) + * + * @param end - Offset in bytes to stop reading at + */ + end(end = 0) { + throwIfInitialized(this); + this.s.options.end = end; + return this; + } + /** + * Marks this stream as aborted (will never push another `data` event) + * and kills the underlying cursor. Will emit the 'end' event, and then + * the 'close' event once the cursor is successfully killed. + * + * @param callback - called when the cursor is successfully closed or an error occurred. + */ + abort(callback) { + this.push(null); + this.destroyed = true; + if (this.s.cursor) { + this.s.cursor.close(error => { + this.emit(GridFSBucketReadStream.CLOSE); + callback && callback(error); + }); + } + else { + if (!this.s.init) { + // If not initialized, fire close event because we will never + // get a cursor + this.emit(GridFSBucketReadStream.CLOSE); + } + callback && callback(); + } + } +} +exports.GridFSBucketReadStream = GridFSBucketReadStream; +/** + * An error occurred + * @event + */ +GridFSBucketReadStream.ERROR = 'error'; +/** + * Fires when the stream loaded the file document corresponding to the provided id. + * @event + */ +GridFSBucketReadStream.FILE = 'file'; +/** + * Emitted when a chunk of data is available to be consumed. + * @event + */ +GridFSBucketReadStream.DATA = 'data'; +/** + * Fired when the stream is exhausted (no more data events). + * @event + */ +GridFSBucketReadStream.END = 'end'; +/** + * Fired when the stream is exhausted and the underlying cursor is killed + * @event + */ +GridFSBucketReadStream.CLOSE = 'close'; +function throwIfInitialized(stream) { + if (stream.s.init) { + throw new error_1.MongoGridFSStreamError('Options cannot be changed after the stream is initialized'); + } +} +function doRead(stream) { + if (stream.destroyed) + return; + if (!stream.s.cursor) + return; + if (!stream.s.file) + return; + stream.s.cursor.next((error, doc) => { + if (stream.destroyed) { + return; + } + if (error) { + stream.emit(GridFSBucketReadStream.ERROR, error); + return; + } + if (!doc) { + stream.push(null); + process.nextTick(() => { + if (!stream.s.cursor) + return; + stream.s.cursor.close(error => { + if (error) { + stream.emit(GridFSBucketReadStream.ERROR, error); + return; + } + stream.emit(GridFSBucketReadStream.CLOSE); + }); + }); + return; + } + if (!stream.s.file) + return; + const bytesRemaining = stream.s.file.length - stream.s.bytesRead; + const expectedN = stream.s.expected++; + const expectedLength = Math.min(stream.s.file.chunkSize, bytesRemaining); + if (doc.n > expectedN) { + return stream.emit(GridFSBucketReadStream.ERROR, new error_1.MongoGridFSChunkError(`ChunkIsMissing: Got unexpected n: ${doc.n}, expected: ${expectedN}`)); + } + if (doc.n < expectedN) { + return stream.emit(GridFSBucketReadStream.ERROR, new error_1.MongoGridFSChunkError(`ExtraChunk: Got unexpected n: ${doc.n}, expected: ${expectedN}`)); + } + let buf = Buffer.isBuffer(doc.data) ? doc.data : doc.data.buffer; + if (buf.byteLength !== expectedLength) { + if (bytesRemaining <= 0) { + return stream.emit(GridFSBucketReadStream.ERROR, new error_1.MongoGridFSChunkError(`ExtraChunk: Got unexpected n: ${doc.n}, expected file length ${stream.s.file.length} bytes but already read ${stream.s.bytesRead} bytes`)); + } + return stream.emit(GridFSBucketReadStream.ERROR, new error_1.MongoGridFSChunkError(`ChunkIsWrongSize: Got unexpected length: ${buf.byteLength}, expected: ${expectedLength}`)); + } + stream.s.bytesRead += buf.byteLength; + if (buf.byteLength === 0) { + return stream.push(null); + } + let sliceStart = null; + let sliceEnd = null; + if (stream.s.bytesToSkip != null) { + sliceStart = stream.s.bytesToSkip; + stream.s.bytesToSkip = 0; + } + const atEndOfStream = expectedN === stream.s.expectedEnd - 1; + const bytesLeftToRead = stream.s.options.end - stream.s.bytesToSkip; + if (atEndOfStream && stream.s.bytesToTrim != null) { + sliceEnd = stream.s.file.chunkSize - stream.s.bytesToTrim; + } + else if (stream.s.options.end && bytesLeftToRead < doc.data.byteLength) { + sliceEnd = bytesLeftToRead; + } + if (sliceStart != null || sliceEnd != null) { + buf = buf.slice(sliceStart || 0, sliceEnd || buf.byteLength); + } + stream.push(buf); + return; + }); +} +function init(stream) { + const findOneOptions = {}; + if (stream.s.readPreference) { + findOneOptions.readPreference = stream.s.readPreference; + } + if (stream.s.options && stream.s.options.sort) { + findOneOptions.sort = stream.s.options.sort; + } + if (stream.s.options && stream.s.options.skip) { + findOneOptions.skip = stream.s.options.skip; + } + stream.s.files.findOne(stream.s.filter, findOneOptions, (error, doc) => { + if (error) { + return stream.emit(GridFSBucketReadStream.ERROR, error); + } + if (!doc) { + const identifier = stream.s.filter._id + ? stream.s.filter._id.toString() + : stream.s.filter.filename; + const errmsg = `FileNotFound: file ${identifier} was not found`; + // TODO(NODE-3483) + const err = new error_1.MongoRuntimeError(errmsg); + err.code = 'ENOENT'; // TODO: NODE-3338 set property as part of constructor + return stream.emit(GridFSBucketReadStream.ERROR, err); + } + // If document is empty, kill the stream immediately and don't + // execute any reads + if (doc.length <= 0) { + stream.push(null); + return; + } + if (stream.destroyed) { + // If user destroys the stream before we have a cursor, wait + // until the query is done to say we're 'closed' because we can't + // cancel a query. + stream.emit(GridFSBucketReadStream.CLOSE); + return; + } + try { + stream.s.bytesToSkip = handleStartOption(stream, doc, stream.s.options); + } + catch (error) { + return stream.emit(GridFSBucketReadStream.ERROR, error); + } + const filter = { files_id: doc._id }; + // Currently (MongoDB 3.4.4) skip function does not support the index, + // it needs to retrieve all the documents first and then skip them. (CS-25811) + // As work around we use $gte on the "n" field. + if (stream.s.options && stream.s.options.start != null) { + const skip = Math.floor(stream.s.options.start / doc.chunkSize); + if (skip > 0) { + filter['n'] = { $gte: skip }; + } + } + stream.s.cursor = stream.s.chunks.find(filter).sort({ n: 1 }); + if (stream.s.readPreference) { + stream.s.cursor.withReadPreference(stream.s.readPreference); + } + stream.s.expectedEnd = Math.ceil(doc.length / doc.chunkSize); + stream.s.file = doc; + try { + stream.s.bytesToTrim = handleEndOption(stream, doc, stream.s.cursor, stream.s.options); + } + catch (error) { + return stream.emit(GridFSBucketReadStream.ERROR, error); + } + stream.emit(GridFSBucketReadStream.FILE, doc); + return; + }); +} +function waitForFile(stream, callback) { + if (stream.s.file) { + return callback(); + } + if (!stream.s.init) { + init(stream); + stream.s.init = true; + } + stream.once('file', () => { + callback(); + }); +} +function handleStartOption(stream, doc, options) { + if (options && options.start != null) { + if (options.start > doc.length) { + throw new error_1.MongoInvalidArgumentError(`Stream start (${options.start}) must not be more than the length of the file (${doc.length})`); + } + if (options.start < 0) { + throw new error_1.MongoInvalidArgumentError(`Stream start (${options.start}) must not be negative`); + } + if (options.end != null && options.end < options.start) { + throw new error_1.MongoInvalidArgumentError(`Stream start (${options.start}) must not be greater than stream end (${options.end})`); + } + stream.s.bytesRead = Math.floor(options.start / doc.chunkSize) * doc.chunkSize; + stream.s.expected = Math.floor(options.start / doc.chunkSize); + return options.start - stream.s.bytesRead; + } + throw new error_1.MongoInvalidArgumentError('Start option must be defined'); +} +function handleEndOption(stream, doc, cursor, options) { + if (options && options.end != null) { + if (options.end > doc.length) { + throw new error_1.MongoInvalidArgumentError(`Stream end (${options.end}) must not be more than the length of the file (${doc.length})`); + } + if (options.start == null || options.start < 0) { + throw new error_1.MongoInvalidArgumentError(`Stream end (${options.end}) must not be negative`); + } + const start = options.start != null ? Math.floor(options.start / doc.chunkSize) : 0; + cursor.limit(Math.ceil(options.end / doc.chunkSize) - start); + stream.s.expectedEnd = Math.ceil(options.end / doc.chunkSize); + return Math.ceil(options.end / doc.chunkSize) * doc.chunkSize - options.end; + } + throw new error_1.MongoInvalidArgumentError('End option must be defined'); +} +//# sourceMappingURL=download.js.map \ No newline at end of file diff --git a/node_modules/mongodb/lib/gridfs/download.js.map b/node_modules/mongodb/lib/gridfs/download.js.map new file mode 100644 index 000000000..a06049afc --- /dev/null +++ b/node_modules/mongodb/lib/gridfs/download.js.map @@ -0,0 +1 @@ +{"version":3,"file":"download.js","sourceRoot":"","sources":["../../src/gridfs/download.ts"],"names":[],"mappings":";;;AAAA,mCAAkC;AAKlC,oCAKkB;AA2DlB;;;;;GAKG;AACH,MAAa,sBAAuB,SAAQ,iBAAQ;IA8BlD;;;;;OAKG;IACH,YACE,MAA+B,EAC/B,KAA6B,EAC7B,cAA0C,EAC1C,MAAgB,EAChB,OAAuC;QAEvC,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,CAAC,GAAG;YACP,WAAW,EAAE,CAAC;YACd,WAAW,EAAE,CAAC;YACd,SAAS,EAAE,CAAC;YACZ,MAAM;YACN,QAAQ,EAAE,CAAC;YACX,KAAK;YACL,MAAM;YACN,IAAI,EAAE,KAAK;YACX,WAAW,EAAE,CAAC;YACd,OAAO,EAAE;gBACP,KAAK,EAAE,CAAC;gBACR,GAAG,EAAE,CAAC;gBACN,G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,EAC9B,GAAa,EACb,MAA+B,EAC/B,OAAsC;IAEtC,IAAI,OAAO,IAAI,OAAO,CAAC,GAAG,IAAI,IAAI,EAAE;QAClC,IAAI,OAAO,CAAC,GAAG,GAAG,GAAG,CAAC,MAAM,EAAE;YAC5B,MAAM,IAAI,iCAAyB,CACjC,eAAe,OAAO,CAAC,GAAG,mDAAmD,GAAG,CAAC,MAAM,GAAG,CAC3F,CAAC;SACH;QACD,IAAI,OAAO,CAAC,KAAK,IAAI,IAAI,IAAI,OAAO,CAAC,KAAK,GAAG,CAAC,EAAE;YAC9C,MAAM,IAAI,iCAAyB,CAAC,eAAe,OAAO,CAAC,GAAG,wBAAwB,CAAC,CAAC;SACzF;QAED,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,IAAI,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,GAAG,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAEpF,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,GAAG,GAAG,CAAC,SAAS,CAAC,GAAG,KAAK,CAAC,CAAC;QAE7D,MAAM,CAAC,CAAC,CAAC,WAAW,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,GAAG,GAAG,CAAC,SAAS,CAAC,CAAC;QAE9D,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,GAAG,GAAG,CAAC,SAAS,CAAC,GAAG,GAAG,CAAC,SAAS,GAAG,OAAO,CAAC,GAAG,CAAC;KAC7E;IACD,MAAM,IAAI,iCAAyB,CAAC,4BAA4B,CAAC,CAAC;AACpE,CAAC"} \ No newline at end of file diff --git a/node_modules/mongodb/lib/gridfs/index.js b/node_modules/mongodb/lib/gridfs/index.js new file mode 100644 index 000000000..cfe89d060 --- /dev/null +++ b/node_modules/mongodb/lib/gridfs/index.js @@ -0,0 +1,152 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.GridFSBucket = void 0; +const error_1 = require("../error"); +const mongo_types_1 = require("../mongo_types"); +const utils_1 = require("../utils"); +const write_concern_1 = require("../write_concern"); +const download_1 = require("./download"); +const upload_1 = require("./upload"); +const DEFAULT_GRIDFS_BUCKET_OPTIONS = { + bucketName: 'fs', + chunkSizeBytes: 255 * 1024 +}; +/** + * Constructor for a streaming GridFS interface + * @public + */ +class GridFSBucket extends mongo_types_1.TypedEventEmitter { + constructor(db, options) { + super(); + this.setMaxListeners(0); + const privateOptions = { + ...DEFAULT_GRIDFS_BUCKET_OPTIONS, + ...options, + writeConcern: write_concern_1.WriteConcern.fromOptions(options) + }; + this.s = { + db, + options: privateOptions, + _chunksCollection: db.collection(privateOptions.bucketName + '.chunks'), + _filesCollection: db.collection(privateOptions.bucketName + '.files'), + checkedIndexes: false, + calledOpenUploadStream: false + }; + } + /** + * Returns a writable stream (GridFSBucketWriteStream) for writing + * buffers to GridFS. The stream's 'id' property contains the resulting + * file's id. + * + * @param filename - The value of the 'filename' key in the files doc + * @param options - Optional settings. + */ + openUploadStream(filename, options) { + return new upload_1.GridFSBucketWriteStream(this, filename, options); + } + /** + * Returns a writable stream (GridFSBucketWriteStream) for writing + * buffers to GridFS for a custom file id. The stream's 'id' property contains the resulting + * file's id. + */ + openUploadStreamWithId(id, filename, options) { + return new upload_1.GridFSBucketWriteStream(this, filename, { ...options, id }); + } + /** Returns a readable stream (GridFSBucketReadStream) for streaming file data from GridFS. */ + openDownloadStream(id, options) { + return new download_1.GridFSBucketReadStream(this.s._chunksCollection, this.s._filesCollection, this.s.options.readPreference, { _id: id }, options); + } + delete(id, callback) { + return (0, utils_1.maybePromise)(callback, callback => { + return this.s._filesCollection.deleteOne({ _id: id }, (error, res) => { + if (error) { + return callback(error); + } + return this.s._chunksCollection.deleteMany({ files_id: id }, error => { + if (error) { + return callback(error); + } + // Delete orphaned chunks before returning FileNotFound + if (!(res === null || res === void 0 ? void 0 : res.deletedCount)) { + // TODO(NODE-3483): Replace with more appropriate error + // Consider creating new error MongoGridFSFileNotFoundError + return callback(new error_1.MongoRuntimeError(`File not found for id ${id}`)); + } + return callback(); + }); + }); + }); + } + /** Convenience wrapper around find on the files collection */ + find(filter, options) { + filter !== null && filter !== void 0 ? filter : (filter = {}); + options = options !== null && options !== void 0 ? options : {}; + return this.s._filesCollection.find(filter, options); + } + /** + * Returns a readable stream (GridFSBucketReadStream) for streaming the + * file with the given name from GridFS. If there are multiple files with + * the same name, this will stream the most recent file with the given name + * (as determined by the `uploadDate` field). You can set the `revision` + * option to change this behavior. + */ + openDownloadStreamByName(filename, options) { + let sort = { uploadDate: -1 }; + let skip = undefined; + if (options && options.revision != null) { + if (options.revision >= 0) { + sort = { uploadDate: 1 }; + skip = options.revision; + } + else { + skip = -options.revision - 1; + } + } + return new download_1.GridFSBucketReadStream(this.s._chunksCollection, this.s._filesCollection, this.s.options.readPreference, { filename }, { ...options, sort, skip }); + } + rename(id, filename, callback) { + return (0, utils_1.maybePromise)(callback, callback => { + const filter = { _id: id }; + const update = { $set: { filename } }; + return this.s._filesCollection.updateOne(filter, update, (error, res) => { + if (error) { + return callback(error); + } + if (!(res === null || res === void 0 ? void 0 : res.matchedCount)) { + return callback(new error_1.MongoRuntimeError(`File with id ${id} not found`)); + } + return callback(); + }); + }); + } + drop(callback) { + return (0, utils_1.maybePromise)(callback, callback => { + return this.s._filesCollection.drop(error => { + if (error) { + return callback(error); + } + return this.s._chunksCollection.drop(error => { + if (error) { + return callback(error); + } + return callback(); + }); + }); + }); + } + /** Get the Db scoped logger. */ + getLogger() { + return this.s.db.s.logger; + } +} +exports.GridFSBucket = GridFSBucket; +/** + * When the first call to openUploadStream is made, the upload stream will + * check to see if it needs to create the proper indexes on the chunks and + * files collections. This event is fired either when 1) it determines that + * no index creation is necessary, 2) when it successfully creates the + * necessary indexes. + * @event + */ +GridFSBucket.INDEX = 'index'; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/mongodb/lib/gridfs/index.js.map b/node_modules/mongodb/lib/gridfs/index.js.map new file mode 100644 index 000000000..861e3b8c2 --- /dev/null +++ b/node_modules/mongodb/lib/gridfs/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/gridfs/index.ts"],"names":[],"mappings":";;;AAIA,oCAA6C;AAE7C,gDAA2D;AAG3D,oCAAkD;AAClD,oDAAqE;AAErE,yCAKoB;AACpB,qCAAgG;AAEhG,MAAM,6BAA6B,GAG/B;IACF,UAAU,EAAE,IAAI;IAChB,cAAc,EAAE,GAAG,GAAG,IAAI;CAC3B,CAAC;AAgCF;;;GAGG;AACH,MAAa,YAAa,SAAQ,+BAAqC;IAcrE,YAAY,EAAM,EAAE,OAA6B;QAC/C,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC;QACxB,MAAM,cAAc,GAAG;YACrB,GAAG,6BAA6B;YAChC,GAAG,OAAO;YACV,YAAY,EAAE,4BAAY,CAAC,WAAW,CAAC,OAAO,CAAC;SAChD,CAAC;QACF,IAAI,CAAC,CAAC,GAAG;YACP,EAAE;YACF,OAAO,EAAE,cAAc;YACvB,iBAAiB,EAAE,EAAE,CAAC,UAAU,CAAc,cAAc,CAAC,UAAU,GAAG,SAAS,CAAC;YACpF,gBAAgB,EAAE,EAAE,CAAC,UAAU,CAAa,cAAc,CAAC,UAAU,GAAG,QAAQ,CAAC;YACjF,cAAc,EAAE,KAAK;YACrB,sBAAsB,EAAE,KAAK;SAC9B,CAAC;IACJ,CAAC;IAED;;;;;;;OAOG;IAEH,gBAAgB,CACd,QAAgB,EAChB,OAAwC;QAExC,OAAO,IAAI,gCAAuB,CAAC,IAAI,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC;IAC9D,CAAC;IAED;;;;OAIG;IACH,sBAAsB,CACpB,EAAY,EACZ,QAAgB,EAChB,OAAwC;QAExC,OAAO,IAAI,gCAAuB,CAAC,I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index 000000000..71507d377 --- /dev/null +++ b/node_modules/mongodb/lib/gridfs/upload.js @@ -0,0 +1,376 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.GridFSBucketWriteStream = void 0; +const stream_1 = require("stream"); +const bson_1 = require("../bson"); +const error_1 = require("../error"); +const utils_1 = require("../utils"); +const write_concern_1 = require("./../write_concern"); +/** + * A writable stream that enables you to write buffers to GridFS. + * + * Do not instantiate this class directly. Use `openUploadStream()` instead. + * @public + */ +class GridFSBucketWriteStream extends stream_1.Writable { + /** @internal + * @param bucket - Handle for this stream's corresponding bucket + * @param filename - The value of the 'filename' key in the files doc + * @param options - Optional settings. + */ + constructor(bucket, filename, options) { + super(); + options = options !== null && options !== void 0 ? options : {}; + this.bucket = bucket; + this.chunks = bucket.s._chunksCollection; + this.filename = filename; + this.files = bucket.s._filesCollection; + this.options = options; + this.writeConcern = write_concern_1.WriteConcern.fromOptions(options) || bucket.s.options.writeConcern; + // Signals the write is all done + this.done = false; + this.id = options.id ? options.id : new bson_1.ObjectId(); + // properly inherit the default chunksize from parent + this.chunkSizeBytes = options.chunkSizeBytes || this.bucket.s.options.chunkSizeBytes; + this.bufToStore = Buffer.alloc(this.chunkSizeBytes); + this.length = 0; + this.n = 0; + this.pos = 0; + this.state = { + streamEnd: false, + outstandingRequests: 0, + errored: false, + aborted: false + }; + if (!this.bucket.s.calledOpenUploadStream) { + this.bucket.s.calledOpenUploadStream = true; + checkIndexes(this, () => { + this.bucket.s.checkedIndexes = true; + this.bucket.emit('index'); + }); + } + } + write(chunk, encodingOrCallback, callback) { + const encoding = typeof encodingOrCallback === 'function' ? undefined : encodingOrCallback; + callback = typeof encodingOrCallback === 'function' ? encodingOrCallback : callback; + return waitForIndexes(this, () => doWrite(this, chunk, encoding, callback)); + } + abort(callback) { + return (0, utils_1.maybePromise)(callback, callback => { + if (this.state.streamEnd) { + // TODO(NODE-3485): Replace with MongoGridFSStreamClosed + return callback(new error_1.MongoAPIError('Cannot abort a stream that has already completed')); + } + if (this.state.aborted) { + // TODO(NODE-3485): Replace with MongoGridFSStreamClosed + return callback(new error_1.MongoAPIError('Cannot call abort() on a stream twice')); + } + this.state.aborted = true; + this.chunks.deleteMany({ files_id: this.id }, error => callback(error)); + }); + } + end(chunkOrCallback, encodingOrCallback, callback) { + const chunk = typeof chunkOrCallback === 'function' ? undefined : chunkOrCallback; + const encoding = typeof encodingOrCallback === 'function' ? undefined : encodingOrCallback; + callback = + typeof chunkOrCallback === 'function' + ? chunkOrCallback + : typeof encodingOrCallback === 'function' + ? encodingOrCallback + : callback; + if (this.state.streamEnd || checkAborted(this, callback)) + return this; + this.state.streamEnd = true; + if (callback) { + this.once(GridFSBucketWriteStream.FINISH, (result) => { + if (callback) + callback(undefined, result); + }); + } + if (!chunk) { + waitForIndexes(this, () => !!writeRemnant(this)); + return this; + } + this.write(chunk, encoding, () => { + writeRemnant(this); + }); + return this; + } +} +exports.GridFSBucketWriteStream = GridFSBucketWriteStream; +/** @event */ +GridFSBucketWriteStream.CLOSE = 'close'; +/** @event */ +GridFSBucketWriteStream.ERROR = 'error'; +/** + * `end()` was called and the write stream successfully wrote the file metadata and all the chunks to MongoDB. + * @event + */ +GridFSBucketWriteStream.FINISH = 'finish'; +function __handleError(stream, error, callback) { + if (stream.state.errored) { + return; + } + stream.state.errored = true; + if (callback) { + return callback(error); + } + stream.emit(GridFSBucketWriteStream.ERROR, error); +} +function createChunkDoc(filesId, n, data) { + return { + _id: new bson_1.ObjectId(), + files_id: filesId, + n, + data + }; +} +function checkChunksIndex(stream, callback) { + stream.chunks.listIndexes().toArray((error, indexes) => { + let index; + if (error) { + // Collection doesn't exist so create index + if (error instanceof error_1.MongoError && error.code === error_1.MONGODB_ERROR_CODES.NamespaceNotFound) { + index = { files_id: 1, n: 1 }; + stream.chunks.createIndex(index, { background: false, unique: true }, error => { + if (error) { + return callback(error); + } + callback(); + }); + return; + } + return callback(error); + } + let hasChunksIndex = false; + if (indexes) { + indexes.forEach((index) => { + if (index.key) { + const keys = Object.keys(index.key); + if (keys.length === 2 && index.key.files_id === 1 && index.key.n === 1) { + hasChunksIndex = true; + } + } + }); + } + if (hasChunksIndex) { + callback(); + } + else { + index = { files_id: 1, n: 1 }; + const writeConcernOptions = getWriteOptions(stream); + stream.chunks.createIndex(index, { + ...writeConcernOptions, + background: true, + unique: true + }, callback); + } + }); +} +function checkDone(stream, callback) { + if (stream.done) + return true; + if (stream.state.streamEnd && stream.state.outstandingRequests === 0 && !stream.state.errored) { + // Set done so we do not trigger duplicate createFilesDoc + stream.done = true; + // Create a new files doc + const filesDoc = createFilesDoc(stream.id, stream.length, stream.chunkSizeBytes, stream.filename, stream.options.contentType, stream.options.aliases, stream.options.metadata); + if (checkAborted(stream, callback)) { + return false; + } + stream.files.insertOne(filesDoc, getWriteOptions(stream), (error) => { + if (error) { + return __handleError(stream, error, callback); + } + stream.emit(GridFSBucketWriteStream.FINISH, filesDoc); + stream.emit(GridFSBucketWriteStream.CLOSE); + }); + return true; + } + return false; +} +function checkIndexes(stream, callback) { + stream.files.findOne({}, { projection: { _id: 1 } }, (error, doc) => { + if (error) { + return callback(error); + } + if (doc) { + return callback(); + } + stream.files.listIndexes().toArray((error, indexes) => { + let index; + if (error) { + // Collection doesn't exist so create index + if (error instanceof error_1.MongoError && error.code === error_1.MONGODB_ERROR_CODES.NamespaceNotFound) { + index = { filename: 1, uploadDate: 1 }; + stream.files.createIndex(index, { background: false }, (error) => { + if (error) { + return callback(error); + } + checkChunksIndex(stream, callback); + }); + return; + } + return callback(error); + } + let hasFileIndex = false; + if (indexes) { + indexes.forEach((index) => { + const keys = Object.keys(index.key); + if (keys.length === 2 && index.key.filename === 1 && index.key.uploadDate === 1) { + hasFileIndex = true; + } + }); + } + if (hasFileIndex) { + checkChunksIndex(stream, callback); + } + else { + index = { filename: 1, uploadDate: 1 }; + const writeConcernOptions = getWriteOptions(stream); + stream.files.createIndex(index, { + ...writeConcernOptions, + background: false + }, (error) => { + if (error) { + return callback(error); + } + checkChunksIndex(stream, callback); + }); + } + }); + }); +} +function createFilesDoc(_id, length, chunkSize, filename, contentType, aliases, metadata) { + const ret = { + _id, + length, + chunkSize, + uploadDate: new Date(), + filename + }; + if (contentType) { + ret.contentType = contentType; + } + if (aliases) { + ret.aliases = aliases; + } + if (metadata) { + ret.metadata = metadata; + } + return ret; +} +function doWrite(stream, chunk, encoding, callback) { + if (checkAborted(stream, callback)) { + return false; + } + const inputBuf = Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk, encoding); + stream.length += inputBuf.length; + // Input is small enough to fit in our buffer + if (stream.pos + inputBuf.length < stream.chunkSizeBytes) { + inputBuf.copy(stream.bufToStore, stream.pos); + stream.pos += inputBuf.length; + callback && callback(); + // Note that we reverse the typical semantics of write's return value + // to be compatible with node's `.pipe()` function. + // True means client can keep writing. + return true; + } + // Otherwise, buffer is too big for current chunk, so we need to flush + // to MongoDB. + let inputBufRemaining = inputBuf.length; + let spaceRemaining = stream.chunkSizeBytes - stream.pos; + let numToCopy = Math.min(spaceRemaining, inputBuf.length); + let outstandingRequests = 0; + while (inputBufRemaining > 0) { + const inputBufPos = inputBuf.length - inputBufRemaining; + inputBuf.copy(stream.bufToStore, stream.pos, inputBufPos, inputBufPos + numToCopy); + stream.pos += numToCopy; + spaceRemaining -= numToCopy; + let doc; + if (spaceRemaining === 0) { + doc = createChunkDoc(stream.id, stream.n, Buffer.from(stream.bufToStore)); + ++stream.state.outstandingRequests; + ++outstandingRequests; + if (checkAborted(stream, callback)) { + return false; + } + stream.chunks.insertOne(doc, getWriteOptions(stream), (error) => { + if (error) { + return __handleError(stream, error); + } + --stream.state.outstandingRequests; + --outstandingRequests; + if (!outstandingRequests) { + stream.emit('drain', doc); + callback && callback(); + checkDone(stream); + } + }); + spaceRemaining = stream.chunkSizeBytes; + stream.pos = 0; + ++stream.n; + } + inputBufRemaining -= numToCopy; + numToCopy = Math.min(spaceRemaining, inputBufRemaining); + } + // Note that we reverse the typical semantics of write's return value + // to be compatible with node's `.pipe()` function. + // False means the client should wait for the 'drain' event. + return false; +} +function getWriteOptions(stream) { + const obj = {}; + if (stream.writeConcern) { + obj.writeConcern = { + w: stream.writeConcern.w, + wtimeout: stream.writeConcern.wtimeout, + j: stream.writeConcern.j + }; + } + return obj; +} +function waitForIndexes(stream, callback) { + if (stream.bucket.s.checkedIndexes) { + return callback(false); + } + stream.bucket.once('index', () => { + callback(true); + }); + return true; +} +function writeRemnant(stream, callback) { + // Buffer is empty, so don't bother to insert + if (stream.pos === 0) { + return checkDone(stream, callback); + } + ++stream.state.outstandingRequests; + // Create a new buffer to make sure the buffer isn't bigger than it needs + // to be. + const remnant = Buffer.alloc(stream.pos); + stream.bufToStore.copy(remnant, 0, 0, stream.pos); + const doc = createChunkDoc(stream.id, stream.n, remnant); + // If the stream was aborted, do not write remnant + if (checkAborted(stream, callback)) { + return false; + } + stream.chunks.insertOne(doc, getWriteOptions(stream), (error) => { + if (error) { + return __handleError(stream, error); + } + --stream.state.outstandingRequests; + checkDone(stream); + }); + return true; +} +function checkAborted(stream, callback) { + if (stream.state.aborted) { + if (typeof callback === 'function') { + // TODO(NODE-3485): Replace with MongoGridFSStreamClosedError + callback(new error_1.MongoAPIError('Stream has been aborted')); + } + return true; + } + return false; +} +//# sourceMappingURL=upload.js.map \ No newline at end of file diff --git a/node_modules/mongodb/lib/gridfs/upload.js.map b/node_modules/mongodb/lib/gridfs/upload.js.map new file mode 100644 index 000000000..c9c6c481a --- /dev/null +++ b/node_modules/mongodb/lib/gridfs/upload.js.map @@ -0,0 +1 @@ +{"version":3,"file":"upload.js","sourceRoot":"","sources":["../../src/gridfs/upload.ts"],"names":[],"mappings":";;;AAAA,mCAAkC;AAGlC,kCAAmC;AAEnC,oCAAoF;AACpF,oCAAkD;AAElD,sDAAkD;AA0BlD;;;;;GAKG;AACH,MAAa,uBAAwB,SAAQ,iBAAQ;IA+BnD;;;;OAIG;IACH,YAAY,MAAoB,EAAE,QAAgB,EAAE,OAAwC;QAC1F,K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EAAE;QACxB,IAAI,OAAO,QAAQ,KAAK,UAAU,EAAE;YAClC,6DAA6D;YAC7D,QAAQ,CAAC,IAAI,qBAAa,CAAC,yBAAyB,CAAC,CAAC,CAAC;SACxD;QACD,OAAO,IAAI,CAAC;KACb;IACD,OAAO,KAAK,CAAC;AACf,CAAC"} \ No newline at end of file diff --git a/node_modules/mongodb/lib/index.js b/node_modules/mongodb/lib/index.js new file mode 100644 index 000000000..d806b1177 --- /dev/null +++ b/node_modules/mongodb/lib/index.js @@ -0,0 +1,157 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.AggregationCursor = exports.Admin = exports.AbstractCursor = exports.MongoWriteConcernError = exports.MongoUnexpectedServerResponseError = exports.MongoTransactionError = exports.MongoTopologyClosedError = exports.MongoTailableCursorError = exports.MongoSystemError = exports.MongoServerSelectionError = exports.MongoServerError = exports.MongoServerClosedError = exports.MongoRuntimeError = exports.MongoParseError = exports.MongoNotConnectedError = exports.MongoNetworkTimeoutError = exports.MongoNetworkError = exports.MongoMissingDependencyError = exports.MongoMissingCredentialsError = exports.MongoKerberosError = exports.MongoInvalidArgumentError = exports.MongoGridFSStreamError = exports.MongoGridFSChunkError = exports.MongoExpiredSessionError = exports.MongoError = exports.MongoDriverError = exports.MongoDecompressionError = exports.MongoCursorInUseError = exports.MongoCursorExhaustedError = exports.MongoCompatibilityError = exports.MongoChangeStreamError = exports.MongoBatchReExecutionError = exports.MongoAWSError = exports.MongoAPIError = exports.MongoBulkWriteError = exports.ObjectID = exports.Timestamp = exports.ObjectId = exports.MinKey = exports.MaxKey = exports.Map = exports.Long = exports.Int32 = exports.Double = exports.Decimal128 = exports.DBRef = exports.Code = exports.BSONSymbol = exports.BSONRegExp = exports.Binary = void 0; +exports.ServerOpeningEvent = exports.ServerHeartbeatSucceededEvent = exports.ServerHeartbeatStartedEvent = exports.ServerHeartbeatFailedEvent = exports.ServerDescriptionChangedEvent = exports.ServerClosedEvent = exports.ConnectionReadyEvent = exports.ConnectionPoolMonitoringEvent = exports.ConnectionPoolCreatedEvent = exports.ConnectionPoolClosedEvent = exports.ConnectionPoolClearedEvent = exports.ConnectionCreatedEvent = exports.ConnectionClosedEvent = exports.ConnectionCheckOutStartedEvent = exports.ConnectionCheckOutFailedEvent = exports.ConnectionCheckedOutEvent = exports.ConnectionCheckedInEvent = exports.CommandSucceededEvent = exports.CommandStartedEvent = exports.CommandFailedEvent = exports.WriteConcern = exports.ReadPreference = exports.ReadConcern = exports.TopologyType = exports.ServerType = exports.ReadPreferenceMode = exports.ReadConcernLevel = exports.ProfilingLevel = exports.ReturnDocument = exports.BSONType = exports.ServerApiVersion = exports.LoggerLevel = exports.ExplainVerbosity = exports.MongoErrorLabel = exports.AutoEncryptionLoggerLevel = exports.CURSOR_FLAGS = exports.Compressor = exports.AuthMechanism = exports.GSSAPICanonicalizationValue = exports.BatchType = exports.Promise = exports.MongoClient = exports.Logger = exports.ListIndexesCursor = exports.ListCollectionsCursor = exports.GridFSBucket = exports.FindCursor = exports.Db = exports.Collection = exports.CancellationToken = void 0; +exports.SrvPollingEvent = exports.TopologyOpeningEvent = exports.TopologyDescriptionChangedEvent = exports.TopologyClosedEvent = void 0; +const admin_1 = require("./admin"); +Object.defineProperty(exports, "Admin", { enumerable: true, get: function () { return admin_1.Admin; } }); +const bson_1 = require("./bson"); +const collection_1 = require("./collection"); +Object.defineProperty(exports, "Collection", { enumerable: true, get: function () { return collection_1.Collection; } }); +const abstract_cursor_1 = require("./cursor/abstract_cursor"); +Object.defineProperty(exports, "AbstractCursor", { enumerable: true, get: function () { return abstract_cursor_1.AbstractCursor; } }); +const aggregation_cursor_1 = require("./cursor/aggregation_cursor"); +Object.defineProperty(exports, "AggregationCursor", { enumerable: true, get: function () { return aggregation_cursor_1.AggregationCursor; } }); +const find_cursor_1 = require("./cursor/find_cursor"); +Object.defineProperty(exports, "FindCursor", { enumerable: true, get: function () { return find_cursor_1.FindCursor; } }); +const db_1 = require("./db"); +Object.defineProperty(exports, "Db", { enumerable: true, get: function () { return db_1.Db; } }); +const gridfs_1 = require("./gridfs"); +Object.defineProperty(exports, "GridFSBucket", { enumerable: true, get: function () { return gridfs_1.GridFSBucket; } }); +const logger_1 = require("./logger"); +Object.defineProperty(exports, "Logger", { enumerable: true, get: function () { return logger_1.Logger; } }); +const mongo_client_1 = require("./mongo_client"); +Object.defineProperty(exports, "MongoClient", { enumerable: true, get: function () { return mongo_client_1.MongoClient; } }); +const mongo_types_1 = require("./mongo_types"); +Object.defineProperty(exports, "CancellationToken", { enumerable: true, get: function () { return mongo_types_1.CancellationToken; } }); +const indexes_1 = require("./operations/indexes"); +Object.defineProperty(exports, "ListIndexesCursor", { enumerable: true, get: function () { return indexes_1.ListIndexesCursor; } }); +const list_collections_1 = require("./operations/list_collections"); +Object.defineProperty(exports, "ListCollectionsCursor", { enumerable: true, get: function () { return list_collections_1.ListCollectionsCursor; } }); +const promise_provider_1 = require("./promise_provider"); +Object.defineProperty(exports, "Promise", { enumerable: true, get: function () { return promise_provider_1.PromiseProvider; } }); +var bson_2 = require("./bson"); +Object.defineProperty(exports, "Binary", { enumerable: true, get: function () { return bson_2.Binary; } }); +Object.defineProperty(exports, "BSONRegExp", { enumerable: true, get: function () { return bson_2.BSONRegExp; } }); +Object.defineProperty(exports, "BSONSymbol", { enumerable: true, get: function () { return bson_2.BSONSymbol; } }); +Object.defineProperty(exports, "Code", { enumerable: true, get: function () { return bson_2.Code; } }); +Object.defineProperty(exports, "DBRef", { enumerable: true, get: function () { return bson_2.DBRef; } }); +Object.defineProperty(exports, "Decimal128", { enumerable: true, get: function () { return bson_2.Decimal128; } }); +Object.defineProperty(exports, "Double", { enumerable: true, get: function () { return bson_2.Double; } }); +Object.defineProperty(exports, "Int32", { enumerable: true, get: function () { return bson_2.Int32; } }); +Object.defineProperty(exports, "Long", { enumerable: true, get: function () { return bson_2.Long; } }); +Object.defineProperty(exports, "Map", { enumerable: true, get: function () { return bson_2.Map; } }); +Object.defineProperty(exports, "MaxKey", { enumerable: true, get: function () { return bson_2.MaxKey; } }); +Object.defineProperty(exports, "MinKey", { enumerable: true, get: function () { return bson_2.MinKey; } }); +Object.defineProperty(exports, "ObjectId", { enumerable: true, get: function () { return bson_2.ObjectId; } }); +Object.defineProperty(exports, "Timestamp", { enumerable: true, get: function () { return bson_2.Timestamp; } }); +/** + * @public + * @deprecated Please use `ObjectId` + */ +exports.ObjectID = bson_1.ObjectId; +var common_1 = require("./bulk/common"); +Object.defineProperty(exports, "MongoBulkWriteError", { enumerable: true, get: function () { return common_1.MongoBulkWriteError; } }); +var error_1 = require("./error"); +Object.defineProperty(exports, "MongoAPIError", { enumerable: true, get: function () { return error_1.MongoAPIError; } }); +Object.defineProperty(exports, "MongoAWSError", { enumerable: true, get: function () { return error_1.MongoAWSError; } }); +Object.defineProperty(exports, "MongoBatchReExecutionError", { enumerable: true, get: function () { return error_1.MongoBatchReExecutionError; } }); +Object.defineProperty(exports, "MongoChangeStreamError", { enumerable: true, get: function () { return error_1.MongoChangeStreamError; } }); +Object.defineProperty(exports, "MongoCompatibilityError", { enumerable: true, get: function () { return error_1.MongoCompatibilityError; } }); +Object.defineProperty(exports, "MongoCursorExhaustedError", { enumerable: true, get: function () { return error_1.MongoCursorExhaustedError; } }); +Object.defineProperty(exports, "MongoCursorInUseError", { enumerable: true, get: function () { return error_1.MongoCursorInUseError; } }); +Object.defineProperty(exports, "MongoDecompressionError", { enumerable: true, get: function () { return error_1.MongoDecompressionError; } }); +Object.defineProperty(exports, "MongoDriverError", { enumerable: true, get: function () { return error_1.MongoDriverError; } }); +Object.defineProperty(exports, "MongoError", { enumerable: true, get: function () { return error_1.MongoError; } }); +Object.defineProperty(exports, "MongoExpiredSessionError", { enumerable: true, get: function () { return error_1.MongoExpiredSessionError; } }); +Object.defineProperty(exports, "MongoGridFSChunkError", { enumerable: true, get: function () { return error_1.MongoGridFSChunkError; } }); +Object.defineProperty(exports, "MongoGridFSStreamError", { enumerable: true, get: function () { return error_1.MongoGridFSStreamError; } }); +Object.defineProperty(exports, "MongoInvalidArgumentError", { enumerable: true, get: function () { return error_1.MongoInvalidArgumentError; } }); +Object.defineProperty(exports, "MongoKerberosError", { enumerable: true, get: function () { return error_1.MongoKerberosError; } }); +Object.defineProperty(exports, "MongoMissingCredentialsError", { enumerable: true, get: function () { return error_1.MongoMissingCredentialsError; } }); +Object.defineProperty(exports, "MongoMissingDependencyError", { enumerable: true, get: function () { return error_1.MongoMissingDependencyError; } }); +Object.defineProperty(exports, "MongoNetworkError", { enumerable: true, get: function () { return error_1.MongoNetworkError; } }); +Object.defineProperty(exports, "MongoNetworkTimeoutError", { enumerable: true, get: function () { return error_1.MongoNetworkTimeoutError; } }); +Object.defineProperty(exports, "MongoNotConnectedError", { enumerable: true, get: function () { return error_1.MongoNotConnectedError; } }); +Object.defineProperty(exports, "MongoParseError", { enumerable: true, get: function () { return error_1.MongoParseError; } }); +Object.defineProperty(exports, "MongoRuntimeError", { enumerable: true, get: function () { return error_1.MongoRuntimeError; } }); +Object.defineProperty(exports, "MongoServerClosedError", { enumerable: true, get: function () { return error_1.MongoServerClosedError; } }); +Object.defineProperty(exports, "MongoServerError", { enumerable: true, get: function () { return error_1.MongoServerError; } }); +Object.defineProperty(exports, "MongoServerSelectionError", { enumerable: true, get: function () { return error_1.MongoServerSelectionError; } }); +Object.defineProperty(exports, "MongoSystemError", { enumerable: true, get: function () { return error_1.MongoSystemError; } }); +Object.defineProperty(exports, "MongoTailableCursorError", { enumerable: true, get: function () { return error_1.MongoTailableCursorError; } }); +Object.defineProperty(exports, "MongoTopologyClosedError", { enumerable: true, get: function () { return error_1.MongoTopologyClosedError; } }); +Object.defineProperty(exports, "MongoTransactionError", { enumerable: true, get: function () { return error_1.MongoTransactionError; } }); +Object.defineProperty(exports, "MongoUnexpectedServerResponseError", { enumerable: true, get: function () { return error_1.MongoUnexpectedServerResponseError; } }); +Object.defineProperty(exports, "MongoWriteConcernError", { enumerable: true, get: function () { return error_1.MongoWriteConcernError; } }); +// enums +var common_2 = require("./bulk/common"); +Object.defineProperty(exports, "BatchType", { enumerable: true, get: function () { return common_2.BatchType; } }); +var gssapi_1 = require("./cmap/auth/gssapi"); +Object.defineProperty(exports, "GSSAPICanonicalizationValue", { enumerable: true, get: function () { return gssapi_1.GSSAPICanonicalizationValue; } }); +var providers_1 = require("./cmap/auth/providers"); +Object.defineProperty(exports, "AuthMechanism", { enumerable: true, get: function () { return providers_1.AuthMechanism; } }); +var compression_1 = require("./cmap/wire_protocol/compression"); +Object.defineProperty(exports, "Compressor", { enumerable: true, get: function () { return compression_1.Compressor; } }); +var abstract_cursor_2 = require("./cursor/abstract_cursor"); +Object.defineProperty(exports, "CURSOR_FLAGS", { enumerable: true, get: function () { return abstract_cursor_2.CURSOR_FLAGS; } }); +var deps_1 = require("./deps"); +Object.defineProperty(exports, "AutoEncryptionLoggerLevel", { enumerable: true, get: function () { return deps_1.AutoEncryptionLoggerLevel; } }); +var error_2 = require("./error"); +Object.defineProperty(exports, "MongoErrorLabel", { enumerable: true, get: function () { return error_2.MongoErrorLabel; } }); +var explain_1 = require("./explain"); +Object.defineProperty(exports, "ExplainVerbosity", { enumerable: true, get: function () { return explain_1.ExplainVerbosity; } }); +var logger_2 = require("./logger"); +Object.defineProperty(exports, "LoggerLevel", { enumerable: true, get: function () { return logger_2.LoggerLevel; } }); +var mongo_client_2 = require("./mongo_client"); +Object.defineProperty(exports, "ServerApiVersion", { enumerable: true, get: function () { return mongo_client_2.ServerApiVersion; } }); +var mongo_types_2 = require("./mongo_types"); +Object.defineProperty(exports, "BSONType", { enumerable: true, get: function () { return mongo_types_2.BSONType; } }); +var find_and_modify_1 = require("./operations/find_and_modify"); +Object.defineProperty(exports, "ReturnDocument", { enumerable: true, get: function () { return find_and_modify_1.ReturnDocument; } }); +var set_profiling_level_1 = require("./operations/set_profiling_level"); +Object.defineProperty(exports, "ProfilingLevel", { enumerable: true, get: function () { return set_profiling_level_1.ProfilingLevel; } }); +var read_concern_1 = require("./read_concern"); +Object.defineProperty(exports, "ReadConcernLevel", { enumerable: true, get: function () { return read_concern_1.ReadConcernLevel; } }); +var read_preference_1 = require("./read_preference"); +Object.defineProperty(exports, "ReadPreferenceMode", { enumerable: true, get: function () { return read_preference_1.ReadPreferenceMode; } }); +var common_3 = require("./sdam/common"); +Object.defineProperty(exports, "ServerType", { enumerable: true, get: function () { return common_3.ServerType; } }); +Object.defineProperty(exports, "TopologyType", { enumerable: true, get: function () { return common_3.TopologyType; } }); +// Helper classes +var read_concern_2 = require("./read_concern"); +Object.defineProperty(exports, "ReadConcern", { enumerable: true, get: function () { return read_concern_2.ReadConcern; } }); +var read_preference_2 = require("./read_preference"); +Object.defineProperty(exports, "ReadPreference", { enumerable: true, get: function () { return read_preference_2.ReadPreference; } }); +var write_concern_1 = require("./write_concern"); +Object.defineProperty(exports, "WriteConcern", { enumerable: true, get: function () { return write_concern_1.WriteConcern; } }); +// events +var command_monitoring_events_1 = require("./cmap/command_monitoring_events"); +Object.defineProperty(exports, "CommandFailedEvent", { enumerable: true, get: function () { return command_monitoring_events_1.CommandFailedEvent; } }); +Object.defineProperty(exports, "CommandStartedEvent", { enumerable: true, get: function () { return command_monitoring_events_1.CommandStartedEvent; } }); +Object.defineProperty(exports, "CommandSucceededEvent", { enumerable: true, get: function () { return command_monitoring_events_1.CommandSucceededEvent; } }); +var connection_pool_events_1 = require("./cmap/connection_pool_events"); +Object.defineProperty(exports, "ConnectionCheckedInEvent", { enumerable: true, get: function () { return connection_pool_events_1.ConnectionCheckedInEvent; } }); +Object.defineProperty(exports, "ConnectionCheckedOutEvent", { enumerable: true, get: function () { return connection_pool_events_1.ConnectionCheckedOutEvent; } }); +Object.defineProperty(exports, "ConnectionCheckOutFailedEvent", { enumerable: true, get: function () { return connection_pool_events_1.ConnectionCheckOutFailedEvent; } }); +Object.defineProperty(exports, "ConnectionCheckOutStartedEvent", { enumerable: true, get: function () { return connection_pool_events_1.ConnectionCheckOutStartedEvent; } }); +Object.defineProperty(exports, "ConnectionClosedEvent", { enumerable: true, get: function () { return connection_pool_events_1.ConnectionClosedEvent; } }); +Object.defineProperty(exports, "ConnectionCreatedEvent", { enumerable: true, get: function () { return connection_pool_events_1.ConnectionCreatedEvent; } }); +Object.defineProperty(exports, "ConnectionPoolClearedEvent", { enumerable: true, get: function () { return connection_pool_events_1.ConnectionPoolClearedEvent; } }); +Object.defineProperty(exports, "ConnectionPoolClosedEvent", { enumerable: true, get: function () { return connection_pool_events_1.ConnectionPoolClosedEvent; } }); +Object.defineProperty(exports, "ConnectionPoolCreatedEvent", { enumerable: true, get: function () { return connection_pool_events_1.ConnectionPoolCreatedEvent; } }); +Object.defineProperty(exports, "ConnectionPoolMonitoringEvent", { enumerable: true, get: function () { return connection_pool_events_1.ConnectionPoolMonitoringEvent; } }); +Object.defineProperty(exports, "ConnectionReadyEvent", { enumerable: true, get: function () { return connection_pool_events_1.ConnectionReadyEvent; } }); +var events_1 = require("./sdam/events"); +Object.defineProperty(exports, "ServerClosedEvent", { enumerable: true, get: function () { return events_1.ServerClosedEvent; } }); +Object.defineProperty(exports, "ServerDescriptionChangedEvent", { enumerable: true, get: function () { return events_1.ServerDescriptionChangedEvent; } }); +Object.defineProperty(exports, "ServerHeartbeatFailedEvent", { enumerable: true, get: function () { return events_1.ServerHeartbeatFailedEvent; } }); +Object.defineProperty(exports, "ServerHeartbeatStartedEvent", { enumerable: true, get: function () { return events_1.ServerHeartbeatStartedEvent; } }); +Object.defineProperty(exports, "ServerHeartbeatSucceededEvent", { enumerable: true, get: function () { return events_1.ServerHeartbeatSucceededEvent; } }); +Object.defineProperty(exports, "ServerOpeningEvent", { enumerable: true, get: function () { return events_1.ServerOpeningEvent; } }); +Object.defineProperty(exports, "TopologyClosedEvent", { enumerable: true, get: function () { return events_1.TopologyClosedEvent; } }); +Object.defineProperty(exports, "TopologyDescriptionChangedEvent", { enumerable: true, get: function () { return events_1.TopologyDescriptionChangedEvent; } }); +Object.defineProperty(exports, "TopologyOpeningEvent", { enumerable: true, get: function () { return events_1.TopologyOpeningEvent; } }); +var srv_polling_1 = require("./sdam/srv_polling"); +Object.defineProperty(exports, "SrvPollingEvent", { enumerable: true, get: function () { return srv_polling_1.SrvPollingEvent; } }); +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/mongodb/lib/index.js.map b/node_modules/mongodb/lib/index.js.map new file mode 100644 index 000000000..f25fd4588 --- /dev/null +++ b/node_modules/mongodb/lib/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;AAAA,mCAAgC;AA0E9B,sFA1EO,aAAK,OA0EP;AAzEP,iCAAkC;AAClC,6CAA0C;AA2ExC,2FA3EO,uBAAU,OA2EP;AA1EZ,8DAA0D;AAqExD,+FArEO,gCAAc,OAqEP;AApEhB,oEAAgE;AAuE9D,kGAvEO,sCAAiB,OAuEP;AAtEnB,sDAAkD;AA0EhD,2FA1EO,wBAAU,OA0EP;AAzEZ,6BAA0B;AAwExB,mFAxEO,OAAE,OAwEP;AAvEJ,qCAAwC;AAyEtC,6FAzEO,qBAAY,OAyEP;AAxEd,qCAAkC;AA2EhC,uFA3EO,eAAM,OA2EP;AA1ER,iDAA6C;AA2E3C,4FA3EO,0BAAW,OA2EP;AA1Eb,+CAAkD;AAkEhD,kGAlEO,+BAAiB,OAkEP;AAjEnB,kDAAyD;AAuEvD,kGAvEO,2BAAiB,OAuEP;AAtEnB,oEAAsE;AAqEpE,sGArEO,wCAAqB,OAqEP;AApEvB,yDAAqD;AAyEhC,wFAzEZ,kCAAe,OAyEI;AAvE5B,+BAegB;AAdd,8FAAA,MAAM,OAAA;AACN,kGAAA,UAAU,OAAA;AACV,kGAAA,UAAU,OAAA;AACV,4FAAA,IAAI,OAAA;AACJ,6FAAA,KAAK,OAAA;AACL,kGAAA,UAAU,OAAA;AACV,8FAAA,MAAM,OAAA;AACN,6FAAA,KAAK,OAAA;AACL,4FAAA,IAAI,OAAA;AACJ,2FAAA,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A,2BAA2B,OAAA;AAC3B,uHAAA,6BAA6B,OAAA;AAC7B,4GAAA,kBAAkB,OAAA;AAClB,6GAAA,mBAAmB,OAAA;AACnB,yHAAA,+BAA+B,OAAA;AAC/B,8GAAA,oBAAoB,OAAA;AAEtB,kDAAqD;AAA5C,8GAAA,eAAe,OAAA"} \ No newline at end of file diff --git a/node_modules/mongodb/lib/logger.js b/node_modules/mongodb/lib/logger.js new file mode 100644 index 000000000..03e036e7c --- /dev/null +++ b/node_modules/mongodb/lib/logger.js @@ -0,0 +1,217 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Logger = exports.LoggerLevel = void 0; +const util_1 = require("util"); +const error_1 = require("./error"); +const utils_1 = require("./utils"); +// Filters for classes +const classFilters = {}; +let filteredClasses = {}; +let level; +// Save the process id +const pid = process.pid; +// current logger +// eslint-disable-next-line no-console +let currentLogger = console.warn; +/** @public */ +exports.LoggerLevel = Object.freeze({ + ERROR: 'error', + WARN: 'warn', + INFO: 'info', + DEBUG: 'debug', + error: 'error', + warn: 'warn', + info: 'info', + debug: 'debug' +}); +/** + * @public + */ +class Logger { + /** + * Creates a new Logger instance + * + * @param className - The Class name associated with the logging instance + * @param options - Optional logging settings + */ + constructor(className, options) { + options = options !== null && options !== void 0 ? options : {}; + // Current reference + this.className = className; + // Current logger + if (!(options.logger instanceof Logger) && typeof options.logger === 'function') { + currentLogger = options.logger; + } + // Set level of logging, default is error + if (options.loggerLevel) { + level = options.loggerLevel || exports.LoggerLevel.ERROR; + } + // Add all class names + if (filteredClasses[this.className] == null) { + classFilters[this.className] = true; + } + } + /** + * Log a message at the debug level + * + * @param message - The message to log + * @param object - Additional meta data to log + */ + debug(message, object) { + if (this.isDebug() && + ((Object.keys(filteredClasses).length > 0 && filteredClasses[this.className]) || + (Object.keys(filteredClasses).length === 0 && classFilters[this.className]))) { + const dateTime = new Date().getTime(); + const msg = (0, util_1.format)('[%s-%s:%s] %s %s', 'DEBUG', this.className, pid, dateTime, message); + const state = { + type: exports.LoggerLevel.DEBUG, + message, + className: this.className, + pid, + date: dateTime + }; + if (object) + state.meta = object; + currentLogger(msg, state); + } + } + /** + * Log a message at the warn level + * + * @param message - The message to log + * @param object - Additional meta data to log + */ + warn(message, object) { + if (this.isWarn() && + ((Object.keys(filteredClasses).length > 0 && filteredClasses[this.className]) || + (Object.keys(filteredClasses).length === 0 && classFilters[this.className]))) { + const dateTime = new Date().getTime(); + const msg = (0, util_1.format)('[%s-%s:%s] %s %s', 'WARN', this.className, pid, dateTime, message); + const state = { + type: exports.LoggerLevel.WARN, + message, + className: this.className, + pid, + date: dateTime + }; + if (object) + state.meta = object; + currentLogger(msg, state); + } + } + /** + * Log a message at the info level + * + * @param message - The message to log + * @param object - Additional meta data to log + */ + info(message, object) { + if (this.isInfo() && + ((Object.keys(filteredClasses).length > 0 && filteredClasses[this.className]) || + (Object.keys(filteredClasses).length === 0 && classFilters[this.className]))) { + const dateTime = new Date().getTime(); + const msg = (0, util_1.format)('[%s-%s:%s] %s %s', 'INFO', this.className, pid, dateTime, message); + const state = { + type: exports.LoggerLevel.INFO, + message, + className: this.className, + pid, + date: dateTime + }; + if (object) + state.meta = object; + currentLogger(msg, state); + } + } + /** + * Log a message at the error level + * + * @param message - The message to log + * @param object - Additional meta data to log + */ + error(message, object) { + if (this.isError() && + ((Object.keys(filteredClasses).length > 0 && filteredClasses[this.className]) || + (Object.keys(filteredClasses).length === 0 && classFilters[this.className]))) { + const dateTime = new Date().getTime(); + const msg = (0, util_1.format)('[%s-%s:%s] %s %s', 'ERROR', this.className, pid, dateTime, message); + const state = { + type: exports.LoggerLevel.ERROR, + message, + className: this.className, + pid, + date: dateTime + }; + if (object) + state.meta = object; + currentLogger(msg, state); + } + } + /** Is the logger set at info level */ + isInfo() { + return level === exports.LoggerLevel.INFO || level === exports.LoggerLevel.DEBUG; + } + /** Is the logger set at error level */ + isError() { + return level === exports.LoggerLevel.ERROR || level === exports.LoggerLevel.INFO || level === exports.LoggerLevel.DEBUG; + } + /** Is the logger set at error level */ + isWarn() { + return (level === exports.LoggerLevel.ERROR || + level === exports.LoggerLevel.WARN || + level === exports.LoggerLevel.INFO || + level === exports.LoggerLevel.DEBUG); + } + /** Is the logger set at debug level */ + isDebug() { + return level === exports.LoggerLevel.DEBUG; + } + /** Resets the logger to default settings, error and no filtered classes */ + static reset() { + level = exports.LoggerLevel.ERROR; + filteredClasses = {}; + } + /** Get the current logger function */ + static currentLogger() { + return currentLogger; + } + /** + * Set the current logger function + * + * @param logger - Custom logging function + */ + static setCurrentLogger(logger) { + if (typeof logger !== 'function') { + throw new error_1.MongoInvalidArgumentError('Current logger must be a function'); + } + currentLogger = logger; + } + /** + * Filter log messages for a particular class + * + * @param type - The type of filter (currently only class) + * @param values - The filters to apply + */ + static filter(type, values) { + if (type === 'class' && Array.isArray(values)) { + filteredClasses = {}; + values.forEach(x => (filteredClasses[x] = true)); + } + } + /** + * Set the current log level + * + * @param newLevel - Set current log level (debug, warn, info, error) + */ + static setLevel(newLevel) { + if (newLevel !== exports.LoggerLevel.INFO && + newLevel !== exports.LoggerLevel.ERROR && + newLevel !== exports.LoggerLevel.DEBUG && + newLevel !== exports.LoggerLevel.WARN) { + throw new error_1.MongoInvalidArgumentError(`Argument "newLevel" should be one of ${(0, utils_1.enumToString)(exports.LoggerLevel)}`); + } + level = newLevel; + } +} +exports.Logger = Logger; +//# sourceMappingURL=logger.js.map \ No newline at end of file diff --git a/node_modules/mongodb/lib/logger.js.map b/node_modules/mongodb/lib/logger.js.map new file mode 100644 index 000000000..4bd0592f8 --- /dev/null +++ b/node_modules/mongodb/lib/logger.js.map @@ -0,0 +1 @@ +{"version":3,"file":"logger.js","sourceRoot":"","sources":["../src/logger.ts"],"names":[],"mappings":";;;AAAA,+BAA8B;AAE9B,mCAAoD;AACpD,mCAAuC;AAEvC,sBAAsB;AACtB,MAAM,YAAY,GAAQ,EAAE,CAAC;AAC7B,IAAI,eAAe,GAAQ,EAAE,CAAC;AAC9B,IAAI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js new file mode 100644 index 000000000..093804083 --- /dev/null +++ b/node_modules/mongodb/lib/mongo_client.js @@ -0,0 +1,267 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.MongoClient = exports.ServerApiVersion = void 0; +const bson_1 = require("./bson"); +const change_stream_1 = require("./change_stream"); +const connection_string_1 = require("./connection_string"); +const db_1 = require("./db"); +const error_1 = require("./error"); +const mongo_types_1 = require("./mongo_types"); +const connect_1 = require("./operations/connect"); +const promise_provider_1 = require("./promise_provider"); +const utils_1 = require("./utils"); +/** @public */ +exports.ServerApiVersion = Object.freeze({ + v1: '1' +}); +/** @internal */ +const kOptions = Symbol('options'); +/** + * The **MongoClient** class is a class that allows for making Connections to MongoDB. + * @public + * + * @remarks + * The programmatically provided options take precedent over the URI options. + * + * @example + * ```js + * // Connect using a MongoClient instance + * const MongoClient = require('mongodb').MongoClient; + * const test = require('assert'); + * // Connection url + * const url = 'mongodb://localhost:27017'; + * // Database Name + * const dbName = 'test'; + * // Connect using MongoClient + * const mongoClient = new MongoClient(url); + * mongoClient.connect(function(err, client) { + * const db = client.db(dbName); + * client.close(); + * }); + * ``` + * + * @example + * ```js + * // Connect using the MongoClient.connect static method + * const MongoClient = require('mongodb').MongoClient; + * const test = require('assert'); + * // Connection url + * const url = 'mongodb://localhost:27017'; + * // Database Name + * const dbName = 'test'; + * // Connect using MongoClient + * MongoClient.connect(url, function(err, client) { + * const db = client.db(dbName); + * client.close(); + * }); + * ``` + */ +class MongoClient extends mongo_types_1.TypedEventEmitter { + constructor(url, options) { + super(); + this[kOptions] = (0, connection_string_1.parseOptions)(url, this, options); + // eslint-disable-next-line @typescript-eslint/no-this-alias + const client = this; + // The internal state + this.s = { + url, + sessions: new Set(), + bsonOptions: (0, bson_1.resolveBSONOptions)(this[kOptions]), + namespace: (0, utils_1.ns)('admin'), + hasBeenClosed: false, + get options() { + return client[kOptions]; + }, + get readConcern() { + return client[kOptions].readConcern; + }, + get writeConcern() { + return client[kOptions].writeConcern; + }, + get readPreference() { + return client[kOptions].readPreference; + }, + get logger() { + return client[kOptions].logger; + }, + get isMongoClient() { + return true; + } + }; + } + get options() { + return Object.freeze({ ...this[kOptions] }); + } + get serverApi() { + return this[kOptions].serverApi && Object.freeze({ ...this[kOptions].serverApi }); + } + /** + * Intended for APM use only + * @internal + */ + get monitorCommands() { + return this[kOptions].monitorCommands; + } + set monitorCommands(value) { + this[kOptions].monitorCommands = value; + } + get autoEncrypter() { + return this[kOptions].autoEncrypter; + } + get readConcern() { + return this.s.readConcern; + } + get writeConcern() { + return this.s.writeConcern; + } + get readPreference() { + return this.s.readPreference; + } + get bsonOptions() { + return this.s.bsonOptions; + } + get logger() { + return this.s.logger; + } + connect(callback) { + if (callback && typeof callback !== 'function') { + throw new error_1.MongoInvalidArgumentError('Method `connect` only accepts a callback'); + } + return (0, utils_1.maybePromise)(callback, cb => { + (0, connect_1.connect)(this, this[kOptions], err => { + if (err) + return cb(err); + cb(undefined, this); + }); + }); + } + close(forceOrCallback, callback) { + // There's no way to set hasBeenClosed back to false + Object.defineProperty(this.s, 'hasBeenClosed', { + value: true, + enumerable: true, + configurable: false, + writable: false + }); + if (typeof forceOrCallback === 'function') { + callback = forceOrCallback; + } + const force = typeof forceOrCallback === 'boolean' ? forceOrCallback : false; + return (0, utils_1.maybePromise)(callback, callback => { + if (this.topology == null) { + return callback(); + } + // clear out references to old topology + const topology = this.topology; + this.topology = undefined; + topology.close({ force }, error => { + if (error) + return callback(error); + const { encrypter } = this[kOptions]; + if (encrypter) { + return encrypter.close(this, force, error => { + callback(error); + }); + } + callback(); + }); + }); + } + /** + * Create a new Db instance sharing the current socket connections. + * + * @param dbName - The name of the database we want to use. If not provided, use database name from connection string. + * @param options - Optional settings for Db construction + */ + db(dbName, options) { + options = options !== null && options !== void 0 ? options : {}; + // Default to db from connection string if not provided + if (!dbName) { + dbName = this.options.dbName; + } + // Copy the options and add out internal override of the not shared flag + const finalOptions = Object.assign({}, this[kOptions], options); + // Return the db object + const db = new db_1.Db(this, dbName, finalOptions); + // Return the database + return db; + } + static connect(url, options, callback) { + if (typeof options === 'function') + (callback = options), (options = {}); + options = options !== null && options !== void 0 ? options : {}; + try { + // Create client + const mongoClient = new MongoClient(url, options); + // Execute the connect method + if (callback) { + return mongoClient.connect(callback); + } + else { + return mongoClient.connect(); + } + } + catch (error) { + if (callback) + return callback(error); + else + return promise_provider_1.PromiseProvider.get().reject(error); + } + } + startSession(options) { + options = Object.assign({ explicit: true }, options); + if (!this.topology) { + throw new error_1.MongoNotConnectedError('MongoClient must be connected to start a session'); + } + return this.topology.startSession(options, this.s.options); + } + withSession(optionsOrOperation, callback) { + const options = { + // Always define an owner + owner: Symbol(), + // If it's an object inherit the options + ...(typeof optionsOrOperation === 'object' ? optionsOrOperation : {}) + }; + const withSessionCallback = typeof optionsOrOperation === 'function' ? optionsOrOperation : callback; + if (withSessionCallback == null) { + throw new error_1.MongoInvalidArgumentError('Missing required callback parameter'); + } + const session = this.startSession(options); + const Promise = promise_provider_1.PromiseProvider.get(); + return Promise.resolve() + .then(() => withSessionCallback(session)) + .then(() => { + // Do not return the result of callback + }) + .finally(() => session.endSession()); + } + /** + * Create a new Change Stream, watching for new changes (insertions, updates, + * replacements, deletions, and invalidations) in this cluster. Will ignore all + * changes to system collections, as well as the local, admin, and config databases. + * + * @remarks + * watch() accepts two generic arguments for distinct usecases: + * - The first is to provide the schema that may be defined for all the data within the current cluster + * - The second is to override the shape of the change stream document entirely, if it is not provided the type will default to ChangeStreamDocument of the first argument + * + * @param pipeline - An array of {@link https://docs.mongodb.com/manual/reference/operator/aggregation-pipeline/|aggregation pipeline stages} through which to pass change stream documents. This allows for filtering (using $match) and manipulating the change stream documents. + * @param options - Optional settings for the command + * @typeParam TSchema - Type of the data being detected by the change stream + * @typeParam TChange - Type of the whole change stream document emitted + */ + watch(pipeline = [], options = {}) { + // Allow optionally not specifying a pipeline + if (!Array.isArray(pipeline)) { + options = pipeline; + pipeline = []; + } + return new change_stream_1.ChangeStream(this, pipeline, (0, utils_1.resolveOptions)(this, options)); + } + /** Return the mongo client logger */ + getLogger() { + return this.s.logger; + } +} +exports.MongoClient = MongoClient; +//# sourceMappingURL=mongo_client.js.map \ No newline at end of file diff --git a/node_modules/mongodb/lib/mongo_client.js.map b/node_modules/mongodb/lib/mongo_client.js.map new file mode 100644 index 000000000..ef6453c97 --- /dev/null +++ b/node_modules/mongodb/lib/mongo_client.js.map @@ -0,0 +1 @@ +{"version":3,"file":"mongo_client.js","sourceRoot":"","sources":["../src/mongo_client.ts"],"names":[],"mappings":";;;AAGA,iCAA4E;AAC5E,mDAA0F;AAM1F,2DAAmD;AAEnD,6BAAqC;AAGrC,mCAA4E;AAE5E,+CAAkD;AAClD,kDAA+C;AAC/C,yDAAqD;AAOrD,mCAQiB;AAGjB,cAAc;AACD,QAAA,gBAAgB,GAAG,MAAM,CAAC,MAAM,CAAC;IAC5C,EAAE,EAAE,GAAG;CACC,CAAC,CAAC;AAwPZ,gBAAgB;AAChB,MAAM,QAAQ,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC;AAEnC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,MAAa,WAAY,SAAQ,+BAAoC;IAYnE,YAAY,GAAW,EAAE,OAA4B;QACnD,KAAK,EAAE,CAAC;QAER,IAAI,CAAC,QAAQ,CAAC,GAAG,IAAA,gCAAY,EAAC,GAAG,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;QAElD,4DAA4D;QAC5D,MAAM,MAAM,GAAG,IAAI,CAAC;QAEpB,qBAAqB;QACrB,IAAI,CAAC,CAAC,GAAG;YACP,GAAG;YACH,QAAQ,EAAE,IAAI,GAAG,EAAE;YACnB,WAAW,EAAE,IAAA,yBAAkB,EAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;YAC/C,SAAS,EAAE,IAAA,UAAE,EAAC,OAAO,CAAC;YACtB,aAAa,EAAE,KAAK;YAEpB,IAAI,OAAO;gBACT,OAAO,M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E;YAC/B,MAAM,IAAI,iCAAyB,CAAC,qCAAqC,CAAC,CAAC;SAC5E;QAED,MAAM,OAAO,GAAG,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;QAC3C,MAAM,OAAO,GAAG,kCAAe,CAAC,GAAG,EAAE,CAAC;QAEtC,OAAO,OAAO,CAAC,OAAO,EAAE;aACrB,IAAI,CAAC,GAAG,EAAE,CAAC,mBAAmB,CAAC,OAAO,CAAC,CAAC;aACxC,IAAI,CAAC,GAAG,EAAE;YACT,uCAAuC;QACzC,CAAC,CAAC;aACD,OAAO,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,UAAU,EAAE,CAAC,CAAC;IACzC,CAAC;IAED;;;;;;;;;;;;;;OAcG;IACH,KAAK,CAGH,WAAuB,EAAE,EAAE,UAA+B,EAAE;QAC5D,6CAA6C;QAC7C,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE;YAC5B,OAAO,GAAG,QAAQ,CAAC;YACnB,QAAQ,GAAG,EAAE,CAAC;SACf;QAED,OAAO,IAAI,4BAAY,CAAmB,IAAI,EAAE,QAAQ,EAAE,IAAA,sBAAc,EAAC,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC;IAC3F,CAAC;IAED,qCAAqC;IACrC,SAAS;QACP,OAAO,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC;IACvB,CAAC;CACF;AAhTD,kCAgTC"} \ No newline at end of file diff --git a/node_modules/mongodb/lib/mongo_types.js b/node_modules/mongodb/lib/mongo_types.js new file mode 100644 index 000000000..7cd40483f --- /dev/null +++ b/node_modules/mongodb/lib/mongo_types.js @@ -0,0 +1,41 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.CancellationToken = exports.TypedEventEmitter = exports.BSONType = void 0; +const events_1 = require("events"); +/** @public */ +exports.BSONType = Object.freeze({ + double: 1, + string: 2, + object: 3, + array: 4, + binData: 5, + undefined: 6, + objectId: 7, + bool: 8, + date: 9, + null: 10, + regex: 11, + dbPointer: 12, + javascript: 13, + symbol: 14, + javascriptWithScope: 15, + int: 16, + timestamp: 17, + long: 18, + decimal: 19, + minKey: -1, + maxKey: 127 +}); +/** + * Typescript type safe event emitter + * @public + */ +// eslint-disable-next-line @typescript-eslint/no-unused-vars +class TypedEventEmitter extends events_1.EventEmitter { +} +exports.TypedEventEmitter = TypedEventEmitter; +/** @public */ +class CancellationToken extends TypedEventEmitter { +} +exports.CancellationToken = CancellationToken; +//# sourceMappingURL=mongo_types.js.map \ No newline at end of file diff --git a/node_modules/mongodb/lib/mongo_types.js.map b/node_modules/mongodb/lib/mongo_types.js.map new file mode 100644 index 000000000..dde1a8780 --- /dev/null +++ b/node_modules/mongodb/lib/mongo_types.js.map @@ -0,0 +1 @@ +{"version":3,"file":"mongo_types.js","sourceRoot":"","sources":["../src/mongo_types.ts"],"names":[],"mappings":";;;AACA,mCAAsC;AAmKtC,cAAc;AACD,QAAA,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC;IACpC,MAAM,EAAE,CAAC;IACT,MAAM,EAAE,CAAC;IACT,MAAM,EAAE,CAAC;IACT,KAAK,EAAE,CAAC;IACR,OAAO,EAAE,CAAC;IACV,SAAS,EAAE,CAAC;IACZ,QAAQ,EAAE,CAAC;IACX,IAAI,EAAE,CAAC;IACP,IAAI,EAAE,CAAC;IACP,IAAI,EAAE,EAAE;IACR,KAAK,EAAE,EAAE;IACT,SAAS,EAAE,EAAE;IACb,UAAU,EAAE,EAAE;IACd,MAAM,EAAE,EAAE;IACV,mBAAmB,EAAE,EAAE;IACvB,GAAG,EAAE,EAAE;IACP,SAAS,EAAE,EAAE;IACb,IAAI,EAAE,EAAE;IACR,OAAO,EAAE,EAAE;IACX,MAAM,EAAE,CAAC,CAAC;IACV,MAAM,EAAE,GAAG;CACH,CAAC,CAAC;AA0PZ;;;GAGG;AACH,6DAA6D;AAC7D,MAAa,iBAAoD,SAAQ,qBAAY;CAAG;AAAxF,8CAAwF;AAExF,cAAc;AACd,MAAa,iBAAkB,SAAQ,iBAAqC;CAAG;AAA/E,8CAA+E"} \ No newline at end of file diff --git a/node_modules/mongodb/lib/operations/add_user.js b/node_modules/mongodb/lib/operations/add_user.js new file mode 100644 index 000000000..0ef426bb3 --- /dev/null +++ b/node_modules/mongodb/lib/operations/add_user.js @@ -0,0 +1,72 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.AddUserOperation = void 0; +const crypto = require("crypto"); +const error_1 = require("../error"); +const utils_1 = require("../utils"); +const command_1 = require("./command"); +const operation_1 = require("./operation"); +/** @internal */ +class AddUserOperation extends command_1.CommandOperation { + constructor(db, username, password, options) { + super(db, options); + this.db = db; + this.username = username; + this.password = password; + this.options = options !== null && options !== void 0 ? options : {}; + } + execute(server, session, callback) { + const db = this.db; + const username = this.username; + const password = this.password; + const options = this.options; + // Error out if digestPassword set + if (options.digestPassword != null) { + return callback(new error_1.MongoInvalidArgumentError('Option "digestPassword" not supported via addUser, use db.command(...) instead')); + } + let roles; + if (!options.roles || (Array.isArray(options.roles) && options.roles.length === 0)) { + (0, utils_1.emitWarningOnce)('Creating a user without roles is deprecated. Defaults to "root" if db is "admin" or "dbOwner" otherwise'); + if (db.databaseName.toLowerCase() === 'admin') { + roles = ['root']; + } + else { + roles = ['dbOwner']; + } + } + else { + roles = Array.isArray(options.roles) ? options.roles : [options.roles]; + } + let topology; + try { + topology = (0, utils_1.getTopology)(db); + } + catch (error) { + return callback(error); + } + const digestPassword = topology.lastHello().maxWireVersion >= 7; + let userPassword = password; + if (!digestPassword) { + // Use node md5 generator + const md5 = crypto.createHash('md5'); + // Generate keys used for authentication + md5.update(`${username}:mongo:${password}`); + userPassword = md5.digest('hex'); + } + // Build the command to execute + const command = { + createUser: username, + customData: options.customData || {}, + roles: roles, + digestPassword + }; + // No password + if (typeof password === 'string') { + command.pwd = userPassword; + } + super.executeCommand(server, session, command, callback); + } +} +exports.AddUserOperation = AddUserOperation; +(0, operation_1.defineAspects)(AddUserOperation, [operation_1.Aspect.WRITE_OPERATION]); +//# sourceMappingURL=add_user.js.map \ No newline at end of file diff --git a/node_modules/mongodb/lib/operations/add_user.js.map b/node_modules/mongodb/lib/operations/add_user.js.map new file mode 100644 index 000000000..c102b8a16 --- /dev/null +++ b/node_modules/mongodb/lib/operations/add_user.js.map @@ -0,0 +1 @@ +{"version":3,"file":"add_user.js","sourceRoot":"","sources":["../../src/operations/add_user.ts"],"names":[],"mappings":";;;AAAA,iCAAiC;AAIjC,oCAAqD;AAGrD,oCAAkE;AAClE,uCAAsE;AACtE,2CAAoD;AAuBpD,gBAAgB;AAChB,MAAa,gBAAiB,SAAQ,0BAA0B;IAM9D,YAAY,EAAM,EAAE,QAAgB,EAAE,QAA4B,EAAE,OAAwB;QAC1F,KAAK,CAAC,EAAE,EAAE,OAAO,CAAC,CAAC;QAEnB,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC;QACb,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,OAAO,GAAG,OAAO,aAAP,OAAO,cAAP,OAAO,GAAI,EAAE,CAAC;IAC/B,CAAC;IAEQ,OAAO,CACd,MAAc,EACd,OAAkC,EAClC,QAA4B;QAE5B,MAAM,EAAE,GAAG,IAAI,CAAC,EAAE,CAAC;QACnB,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC;QAC/B,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC;QAC/B,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC;QAE7B,kCAAkC;QAClC,IAAI,OAAO,CAAC,cAAc,IAAI,IAAI,EAAE;YAClC,OAAO,QAAQ,CACb,IAAI,iCAAyB,CAC3B,gFAAgF,CACjF,CACF,CAAC;SACH;QAED,IAAI,KAAK,CAAC;QACV,IAAI,CAAC,OAAO,CAAC,KAAK,IAAI,CAAC,KAAK,CAAC,OAAO,CAA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AAQ,EAAE;YAChC,OAAO,CAAC,GAAG,GAAG,YAAY,CAAC;SAC5B;QAED,KAAK,CAAC,cAAc,CAAC,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;IAC3D,CAAC;CACF;AAlFD,4CAkFC;AAED,IAAA,yBAAa,EAAC,gBAAgB,EAAE,CAAC,kBAAM,CAAC,eAAe,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/mongodb/lib/operations/aggregate.js b/node_modules/mongodb/lib/operations/aggregate.js new file mode 100644 index 000000000..33b513600 --- /dev/null +++ b/node_modules/mongodb/lib/operations/aggregate.js @@ -0,0 +1,90 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.AggregateOperation = exports.DB_AGGREGATE_COLLECTION = void 0; +const error_1 = require("../error"); +const utils_1 = require("../utils"); +const command_1 = require("./command"); +const operation_1 = require("./operation"); +/** @internal */ +exports.DB_AGGREGATE_COLLECTION = 1; +const MIN_WIRE_VERSION_$OUT_READ_CONCERN_SUPPORT = 8; +/** @internal */ +class AggregateOperation extends command_1.CommandOperation { + constructor(ns, pipeline, options) { + super(undefined, { ...options, dbName: ns.db }); + this.options = options !== null && options !== void 0 ? options : {}; + // Covers when ns.collection is null, undefined or the empty string, use DB_AGGREGATE_COLLECTION + this.target = ns.collection || exports.DB_AGGREGATE_COLLECTION; + this.pipeline = pipeline; + // determine if we have a write stage, override read preference if so + this.hasWriteStage = false; + if (typeof (options === null || options === void 0 ? void 0 : options.out) === 'string') { + this.pipeline = this.pipeline.concat({ $out: options.out }); + this.hasWriteStage = true; + } + else if (pipeline.length > 0) { + const finalStage = pipeline[pipeline.length - 1]; + if (finalStage.$out || finalStage.$merge) { + this.hasWriteStage = true; + } + } + if (this.hasWriteStage) { + this.trySecondaryWrite = true; + } + if (this.explain && this.writeConcern) { + throw new error_1.MongoInvalidArgumentError('Option "explain" cannot be used on an aggregate call with writeConcern'); + } + if ((options === null || options === void 0 ? void 0 : options.cursor) != null && typeof options.cursor !== 'object') { + throw new error_1.MongoInvalidArgumentError('Cursor options must be an object'); + } + } + get canRetryRead() { + return !this.hasWriteStage; + } + addToPipeline(stage) { + this.pipeline.push(stage); + } + execute(server, session, callback) { + const options = this.options; + const serverWireVersion = (0, utils_1.maxWireVersion)(server); + const command = { aggregate: this.target, pipeline: this.pipeline }; + if (this.hasWriteStage && serverWireVersion < MIN_WIRE_VERSION_$OUT_READ_CONCERN_SUPPORT) { + this.readConcern = undefined; + } + if (serverWireVersion >= 5) { + if (this.hasWriteStage && this.writeConcern) { + Object.assign(command, { writeConcern: this.writeConcern }); + } + } + if (options.bypassDocumentValidation === true) { + command.bypassDocumentValidation = options.bypassDocumentValidation; + } + if (typeof options.allowDiskUse === 'boolean') { + command.allowDiskUse = options.allowDiskUse; + } + if (options.hint) { + command.hint = options.hint; + } + if (options.let) { + command.let = options.let; + } + // we check for undefined specifically here to allow falsy values + // eslint-disable-next-line no-restricted-syntax + if (options.comment !== undefined) { + command.comment = options.comment; + } + command.cursor = options.cursor || {}; + if (options.batchSize && !this.hasWriteStage) { + command.cursor.batchSize = options.batchSize; + } + super.executeCommand(server, session, command, callback); + } +} +exports.AggregateOperation = AggregateOperation; +(0, operation_1.defineAspects)(AggregateOperation, [ + operation_1.Aspect.READ_OPERATION, + operation_1.Aspect.RETRYABLE, + operation_1.Aspect.EXPLAINABLE, + operation_1.Aspect.CURSOR_CREATING +]); +//# sourceMappingURL=aggregate.js.map \ No newline at end of file diff --git a/node_modules/mongodb/lib/operations/aggregate.js.map b/node_modules/mongodb/lib/operations/aggregate.js.map new file mode 100644 index 000000000..a8dc5fcfb --- /dev/null +++ b/node_modules/mongodb/lib/operations/aggregate.js.map @@ -0,0 +1 @@ +{"version":3,"file":"aggregate.js","sourceRoot":"","sources":["../../src/operations/aggregate.ts"],"names":[],"mappings":";;;AACA,oCAAqD;AAGrD,oCAAsE;AACtE,uCAAwF;AACxF,2CAA0D;AAE1D,gBAAgB;AACH,Q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,CAAC,IAAI,EAAE;YAChB,OAAO,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;SAC7B;QAED,IAAI,OAAO,CAAC,GAAG,EAAE;YACf,OAAO,CAAC,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC;SAC3B;QAED,iEAAiE;QACjE,gDAAgD;QAChD,IAAI,OAAO,CAAC,OAAO,KAAK,SAAS,EAAE;YACjC,OAAO,CAAC,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;SACnC;QAED,OAAO,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,IAAI,EAAE,CAAC;QACtC,IAAI,OAAO,CAAC,SAAS,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE;YAC5C,OAAO,CAAC,MAAM,CAAC,SAAS,GAAG,OAAO,CAAC,SAAS,CAAC;SAC9C;QAED,KAAK,CAAC,cAAc,CAAC,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;IAC3D,CAAC;CACF;AAnGD,gDAmGC;AAED,IAAA,yBAAa,EAAC,kBAAkB,EAAE;IAChC,kBAAM,CAAC,cAAc;IACrB,kBAAM,CAAC,SAAS;IAChB,kBAAM,CAAC,WAAW;IAClB,kBAAM,CAAC,eAAe;CACvB,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/mongodb/lib/operations/bulk_write.js b/node_modules/mongodb/lib/operations/bulk_write.js new file mode 100644 index 000000000..cab8ab7e2 --- /dev/null +++ b/node_modules/mongodb/lib/operations/bulk_write.js @@ -0,0 +1,43 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.BulkWriteOperation = void 0; +const operation_1 = require("./operation"); +/** @internal */ +class BulkWriteOperation extends operation_1.AbstractOperation { + constructor(collection, operations, options) { + super(options); + this.options = options; + this.collection = collection; + this.operations = operations; + } + execute(server, session, callback) { + const coll = this.collection; + const operations = this.operations; + const options = { ...this.options, ...this.bsonOptions, readPreference: this.readPreference }; + // Create the bulk operation + const bulk = options.ordered === false + ? coll.initializeUnorderedBulkOp(options) + : coll.initializeOrderedBulkOp(options); + // for each op go through and add to the bulk + try { + for (let i = 0; i < operations.length; i++) { + bulk.raw(operations[i]); + } + } + catch (err) { + return callback(err); + } + // Execute the bulk + bulk.execute({ ...options, session }, (err, r) => { + // We have connection level error + if (!r && err) { + return callback(err); + } + // Return the results + callback(undefined, r); + }); + } +} +exports.BulkWriteOperation = BulkWriteOperation; +(0, operation_1.defineAspects)(BulkWriteOperation, [operation_1.Aspect.WRITE_OPERATION]); +//# sourceMappingURL=bulk_write.js.map \ No newline at end of file diff --git a/node_modules/mongodb/lib/operations/bulk_write.js.map b/node_modules/mongodb/lib/operations/bulk_write.js.map new file mode 100644 index 000000000..e49d9459c --- /dev/null +++ b/node_modules/mongodb/lib/operations/bulk_write.js.map @@ -0,0 +1 @@ +{"version":3,"file":"bulk_write.js","sourceRoot":"","sources":["../../src/operations/bulk_write.ts"],"names":[],"mappings":";;;AAUA,2CAAuE;AAEvE,gBAAgB;AAChB,MAAa,kBAAmB,SAAQ,6BAAkC;IAKxE,YACE,UAAsB,EACtB,UAAmC,EACnC,OAAyB;QAEzB,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;IAC/B,CAAC;IAEQ,OAAO,CACd,MAAc,EACd,OAAkC,EAClC,QAAmC;QAEnC,MAAM,IAAI,GAAG,IAAI,CAAC,UAAU,CAAC;QAC7B,MAAM,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC;QACnC,MAAM,OAAO,GAAG,EAAE,GAAG,IAAI,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,WAAW,EAAE,cAAc,EAAE,IAAI,CAAC,cAAc,EAAE,CAAC;QAE9F,4BAA4B;QAC5B,MAAM,IAAI,GACR,OAAO,CAAC,OAAO,KAAK,KAAK;YACvB,CAAC,CAAC,IAAI,CAAC,yBAAyB,CAAC,OAAO,CAAC;YACzC,CAAC,CAAC,IAAI,CAAC,uBAAuB,CAAC,OAAO,CAAC,CAAC;QAE5C,6CAA6C;QAC7C,IAAI;YACF,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,UAAU,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;gBAC1C,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;aACzB;SACF;QAAC,OAAO,GAAG,EAAE;YACZ,OAAO,QAAQ,CAAC,GAAG,CAAC,CAAC;SACtB;QAED,mBAAmB;QACnB,IAAI,CAAC,OAAO,CAAC,EAAE,GAAG,OAAO,EAAE,OAAO,EAAE,EAAE,CAAC,GAAG,EAAE,CAAC,EAAE,EAAE;YAC/C,iCAAiC;YACjC,IAAI,CAAC,CAAC,IAAI,GAAG,EAAE;gBACb,OAAO,QAAQ,CAAC,GAAG,CAAC,CAAC;aACtB;YAED,qBAAqB;YACrB,QAAQ,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC;QACzB,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AAnDD,gDAmDC;AAED,IAAA,yBAAa,EAAC,kBAAkB,EAAE,CAAC,kBAAM,CAAC,eAAe,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/mongodb/lib/operations/collections.js b/node_modules/mongodb/lib/operations/collections.js new file mode 100644 index 000000000..d0a1b1fd8 --- /dev/null +++ b/node_modules/mongodb/lib/operations/collections.js @@ -0,0 +1,29 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.CollectionsOperation = void 0; +const collection_1 = require("../collection"); +const operation_1 = require("./operation"); +/** @internal */ +class CollectionsOperation extends operation_1.AbstractOperation { + constructor(db, options) { + super(options); + this.options = options; + this.db = db; + } + execute(server, session, callback) { + const db = this.db; + // Let's get the collection names + db.listCollections({}, { ...this.options, nameOnly: true, readPreference: this.readPreference, session }).toArray((err, documents) => { + if (err || !documents) + return callback(err); + // Filter collections removing any illegal ones + documents = documents.filter(doc => doc.name.indexOf('$') === -1); + // Return the collection objects + callback(undefined, documents.map(d => { + return new collection_1.Collection(db, d.name, db.s.options); + })); + }); + } +} +exports.CollectionsOperation = CollectionsOperation; +//# sourceMappingURL=collections.js.map \ No newline at end of file diff --git a/node_modules/mongodb/lib/operations/collections.js.map b/node_modules/mongodb/lib/operations/collections.js.map new file mode 100644 index 000000000..960c51a66 --- /dev/null +++ b/node_modules/mongodb/lib/operations/collections.js.map @@ -0,0 +1 @@ +{"version":3,"file":"collections.js","sourceRoot":"","sources":["../../src/operations/collections.ts"],"names":[],"mappings":";;;AAAA,8CAA2C;AAK3C,2CAAkE;AAMlE,gBAAgB;AAChB,MAAa,oBAAqB,SAAQ,6BAA+B;IAIvE,YAAY,EAAM,EAAE,OAA2B;QAC7C,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC;IACf,CAAC;IAEQ,OAAO,CACd,MAAc,EACd,OAAkC,EAClC,QAAgC;QAEhC,MAAM,EAAE,GAAG,IAAI,CAAC,EAAE,CAAC;QAEnB,iCAAiC;QACjC,EAAE,CAAC,eAAe,CAChB,EAAE,EACF,EAAE,GAAG,IAAI,CAAC,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,cAAc,EAAE,IAAI,CAAC,cAAc,EAAE,OAAO,EAAE,CAClF,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,SAAS,EAAE,EAAE;YAC3B,IAAI,GAAG,IAAI,CAAC,SAAS;gBAAE,OAAO,QAAQ,CAAC,GAAG,CAAC,CAAC;YAC5C,+CAA+C;YAC/C,SAAS,GAAG,SAAS,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;YAElE,gCAAgC;YAChC,QAAQ,CACN,SAAS,EACT,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE;gBAChB,OAAO,IAAI,uBAAU,CAAC,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;YAClD,CAAC,CAAC,CACH,CAAC;QACJ,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AAnCD,oDAmCC"} \ No newline at end of file diff --git a/node_modules/mongodb/lib/operations/command.js b/node_modules/mongodb/lib/operations/command.js new file mode 100644 index 000000000..55ce871ee --- /dev/null +++ b/node_modules/mongodb/lib/operations/command.js @@ -0,0 +1,95 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.CommandOperation = void 0; +const error_1 = require("../error"); +const explain_1 = require("../explain"); +const read_concern_1 = require("../read_concern"); +const server_selection_1 = require("../sdam/server_selection"); +const utils_1 = require("../utils"); +const write_concern_1 = require("../write_concern"); +const operation_1 = require("./operation"); +const SUPPORTS_WRITE_CONCERN_AND_COLLATION = 5; +/** @internal */ +class CommandOperation extends operation_1.AbstractOperation { + constructor(parent, options) { + super(options); + this.options = options !== null && options !== void 0 ? options : {}; + // NOTE: this was explicitly added for the add/remove user operations, it's likely + // something we'd want to reconsider. Perhaps those commands can use `Admin` + // as a parent? + const dbNameOverride = (options === null || options === void 0 ? void 0 : options.dbName) || (options === null || options === void 0 ? void 0 : options.authdb); + if (dbNameOverride) { + this.ns = new utils_1.MongoDBNamespace(dbNameOverride, '$cmd'); + } + else { + this.ns = parent + ? parent.s.namespace.withCollection('$cmd') + : new utils_1.MongoDBNamespace('admin', '$cmd'); + } + this.readConcern = read_concern_1.ReadConcern.fromOptions(options); + this.writeConcern = write_concern_1.WriteConcern.fromOptions(options); + // TODO(NODE-2056): make logger another "inheritable" property + if (parent && parent.logger) { + this.logger = parent.logger; + } + if (this.hasAspect(operation_1.Aspect.EXPLAINABLE)) { + this.explain = explain_1.Explain.fromOptions(options); + } + else if ((options === null || options === void 0 ? void 0 : options.explain) != null) { + throw new error_1.MongoInvalidArgumentError(`Option "explain" is not supported on this command`); + } + } + get canRetryWrite() { + if (this.hasAspect(operation_1.Aspect.EXPLAINABLE)) { + return this.explain == null; + } + return true; + } + executeCommand(server, session, cmd, callback) { + // TODO: consider making this a non-enumerable property + this.server = server; + const options = { + ...this.options, + ...this.bsonOptions, + readPreference: this.readPreference, + session + }; + const serverWireVersion = (0, utils_1.maxWireVersion)(server); + const inTransaction = this.session && this.session.inTransaction(); + if (this.readConcern && (0, utils_1.commandSupportsReadConcern)(cmd) && !inTransaction) { + Object.assign(cmd, { readConcern: this.readConcern }); + } + if (this.trySecondaryWrite && serverWireVersion < server_selection_1.MIN_SECONDARY_WRITE_WIRE_VERSION) { + options.omitReadPreference = true; + } + if (options.collation && serverWireVersion < SUPPORTS_WRITE_CONCERN_AND_COLLATION) { + callback(new error_1.MongoCompatibilityError(`Server ${server.name}, which reports wire version ${serverWireVersion}, does not support collation`)); + return; + } + if (this.writeConcern && this.hasAspect(operation_1.Aspect.WRITE_OPERATION) && !inTransaction) { + Object.assign(cmd, { writeConcern: this.writeConcern }); + } + if (serverWireVersion >= SUPPORTS_WRITE_CONCERN_AND_COLLATION) { + if (options.collation && + typeof options.collation === 'object' && + !this.hasAspect(operation_1.Aspect.SKIP_COLLATION)) { + Object.assign(cmd, { collation: options.collation }); + } + } + if (typeof options.maxTimeMS === 'number') { + cmd.maxTimeMS = options.maxTimeMS; + } + if (this.hasAspect(operation_1.Aspect.EXPLAINABLE) && this.explain) { + if (serverWireVersion < 6 && cmd.aggregate) { + // Prior to 3.6, with aggregate, verbosity is ignored, and we must pass in "explain: true" + cmd.explain = true; + } + else { + cmd = (0, utils_1.decorateWithExplain)(cmd, this.explain); + } + } + server.command(this.ns, cmd, options, callback); + } +} +exports.CommandOperation = CommandOperation; +//# sourceMappingURL=command.js.map \ No newline at end of file diff --git a/node_modules/mongodb/lib/operations/command.js.map b/node_modules/mongodb/lib/operations/command.js.map new file mode 100644 index 000000000..5f49482f9 --- /dev/null +++ b/node_modules/mongodb/lib/operations/command.js.map @@ -0,0 +1 @@ +{"version":3,"file":"command.js","sourceRoot":"","sources":["../../src/operations/command.ts"],"names":[],"mappings":";;;AACA,oCAA8E;AAC9E,wCAAqD;AAErD,kDAA8C;AAG9C,+DAA4E;AAE5E,oCAMkB;AAClB,oDAAqE;AAErE,2CAA0E;AAE1E,MAAM,oCAAoC,GAAG,CAAC,CAAC;AAuD/C,gBAAgB;AAChB,MAAsB,gBAAoB,SAAQ,6BAAoB;IAOpE,YAAY,MAAwB,EAAE,OAAiC;QACrE,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,OAAO,GAAG,OAAO,aAAP,OAAO,cAAP,OAAO,GAAI,EAAE,CAAC;QAE7B,kFAAkF;QAClF,kFAAkF;QAClF,qBAAqB;QACrB,MAAM,cAAc,GAAG,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,MAAM,MAAI,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,MAAM,CAAA,CAAC;QAC1D,IAAI,cAAc,EAAE;YAClB,IAAI,CAAC,EAAE,GAAG,IAAI,wBAAgB,CAAC,cAAc,EAAE,MAAM,CAAC,CAAC;SACxD;aAAM;YACL,IAAI,CAAC,EAAE,GAAG,MAAM;gBACd,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC,cAAc,CAAC,MAAM,CAAC;gBAC3C,CAAC,CAAC,IAAI,wBAAgB,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;SAC3C;QAED,IAAI,CAAC,WAAW,GAAG,0BAAW,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;QACpD,IAAI,CAAC,YAAY,GAAG,4BAAY,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;QAEtD,8DAA8D;QAC9D,IAAI,MAAM,IAAI,MAAM,CAAC,MAAM,EAAE;YAC3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AC;IAClD,CAAC;CACF;AApHD,4CAoHC"} \ No newline at end of file diff --git a/node_modules/mongodb/lib/operations/common_functions.js b/node_modules/mongodb/lib/operations/common_functions.js new file mode 100644 index 000000000..60ac62d5e --- /dev/null +++ b/node_modules/mongodb/lib/operations/common_functions.js @@ -0,0 +1,71 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.prepareDocs = exports.indexInformation = void 0; +const error_1 = require("../error"); +const utils_1 = require("../utils"); +function indexInformation(db, name, _optionsOrCallback, _callback) { + let options = _optionsOrCallback; + let callback = _callback; + if ('function' === typeof _optionsOrCallback) { + callback = _optionsOrCallback; + options = {}; + } + // If we specified full information + const full = options.full == null ? false : options.full; + let topology; + try { + topology = (0, utils_1.getTopology)(db); + } + catch (error) { + return callback(error); + } + // Did the user destroy the topology + if (topology.isDestroyed()) + return callback(new error_1.MongoTopologyClosedError()); + // Process all the results from the index command and collection + function processResults(indexes) { + // Contains all the information + const info = {}; + // Process all the indexes + for (let i = 0; i < indexes.length; i++) { + const index = indexes[i]; + // Let's unpack the object + info[index.name] = []; + for (const name in index.key) { + info[index.name].push([name, index.key[name]]); + } + } + return info; + } + // Get the list of indexes of the specified collection + db.collection(name) + .listIndexes(options) + .toArray((err, indexes) => { + if (err) + return callback(err); + if (!Array.isArray(indexes)) + return callback(undefined, []); + if (full) + return callback(undefined, indexes); + callback(undefined, processResults(indexes)); + }); +} +exports.indexInformation = indexInformation; +function prepareDocs(coll, docs, options) { + var _a; + const forceServerObjectId = typeof options.forceServerObjectId === 'boolean' + ? options.forceServerObjectId + : (_a = coll.s.db.options) === null || _a === void 0 ? void 0 : _a.forceServerObjectId; + // no need to modify the docs if server sets the ObjectId + if (forceServerObjectId === true) { + return docs; + } + return docs.map(doc => { + if (doc._id == null) { + doc._id = coll.s.pkFactory.createPk(); + } + return doc; + }); +} +exports.prepareDocs = prepareDocs; +//# sourceMappingURL=common_functions.js.map \ No newline at end of file diff --git a/node_modules/mongodb/lib/operations/common_functions.js.map b/node_modules/mongodb/lib/operations/common_functions.js.map new file mode 100644 index 000000000..980fd92de --- /dev/null +++ b/node_modules/mongodb/lib/operations/common_functions.js.map @@ -0,0 +1 @@ +{"version":3,"file":"common_functions.js","sourceRoot":"","sources":["../../src/operations/common_functions.ts"],"names":[],"mappings":";;;AAGA,oCAAoD;AAGpD,oCAAiD;AAqBjD,SAAgB,gBAAgB,CAC9B,EAAM,EACN,IAAY,EACZ,kBAAsD,EACtD,SAAoB;IAEpB,IAAI,OAAO,GAAG,kBAA6C,CAAC;IAC5D,IAAI,QAAQ,GAAG,SAAqB,CAAC;IACrC,IAAI,UAAU,KAAK,OAAO,kBAAkB,EAAE;QAC5C,QAAQ,GAAG,kBAA8B,CAAC;QAC1C,OAAO,GAAG,EAAE,CAAC;KACd;IACD,mCAAmC;IACnC,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,IAAI,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC;IAEzD,IAAI,QAAQ,CAAC;IACb,IAAI;QACF,QAAQ,GAAG,IAAA,mBAAW,EAAC,EAAE,CAAC,CAAC;KAC5B;IAAC,OAAO,KAAK,EAAE;QACd,OAAO,QAAQ,CAAC,KAAK,CAAC,CAAC;KACxB;IAED,oCAAoC;IACpC,IAAI,QAAQ,CAAC,WAAW,EAAE;QAAE,OAAO,QAAQ,CAAC,IAAI,gCAAwB,EAAE,CAAC,CAAC;IAC5E,gEAAgE;IAChE,SAAS,cAAc,CAAC,OAAY;QAClC,+BAA+B;QAC/B,MAAM,IAAI,GAAQ,EAAE,CAAC;QACrB,0BAA0B;QAC1B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;YACvC,MAAM,KAAK,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;YACzB,0BAA0B;YAC1B,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,GA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AC,CAAC,CAAC,SAAS,CAAC,QAAQ,EAAE,CAAC;SACvC;QAED,OAAO,GAAG,CAAC;IACb,CAAC,CAAC,CAAC;AACL,CAAC;AAtBD,kCAsBC"} \ No newline at end of file diff --git a/node_modules/mongodb/lib/operations/connect.js b/node_modules/mongodb/lib/operations/connect.js new file mode 100644 index 000000000..eb7abc874 --- /dev/null +++ b/node_modules/mongodb/lib/operations/connect.js @@ -0,0 +1,85 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.connect = void 0; +const connection_string_1 = require("../connection_string"); +const constants_1 = require("../constants"); +const error_1 = require("../error"); +const topology_1 = require("../sdam/topology"); +function connect(mongoClient, options, callback) { + if (!callback) { + throw new error_1.MongoInvalidArgumentError('Callback function must be provided'); + } + // If a connection already been established, we can terminate early + if (mongoClient.topology && mongoClient.topology.isConnected()) { + return callback(undefined, mongoClient); + } + const logger = mongoClient.logger; + const connectCallback = err => { + const warningMessage = 'seed list contains no mongos proxies, replicaset connections requires ' + + 'the parameter replicaSet to be supplied in the URI or options object, ' + + 'mongodb://server:port/db?replicaSet=name'; + if (err && err.message === 'no mongos proxies found in seed list') { + if (logger.isWarn()) { + logger.warn(warningMessage); + } + // Return a more specific error message for MongoClient.connect + // TODO(NODE-3483) + return callback(new error_1.MongoRuntimeError(warningMessage)); + } + callback(err, mongoClient); + }; + if (typeof options.srvHost === 'string') { + return (0, connection_string_1.resolveSRVRecord)(options, (err, hosts) => { + if (err || !hosts) + return callback(err); + for (const [index, host] of hosts.entries()) { + options.hosts[index] = host; + } + return createTopology(mongoClient, options, connectCallback); + }); + } + return createTopology(mongoClient, options, connectCallback); +} +exports.connect = connect; +function createTopology(mongoClient, options, callback) { + // Create the topology + const topology = new topology_1.Topology(options.hosts, options); + // Events can be emitted before initialization is complete so we have to + // save the reference to the topology on the client ASAP if the event handlers need to access it + mongoClient.topology = topology; + topology.client = mongoClient; + topology.once(topology_1.Topology.OPEN, () => mongoClient.emit('open', mongoClient)); + for (const event of constants_1.MONGO_CLIENT_EVENTS) { + topology.on(event, (...args) => mongoClient.emit(event, ...args)); + } + // initialize CSFLE if requested + if (mongoClient.autoEncrypter) { + mongoClient.autoEncrypter.init(err => { + if (err) { + return callback(err); + } + topology.connect(options, err => { + if (err) { + topology.close({ force: true }); + return callback(err); + } + options.encrypter.connectInternalClient(error => { + if (error) + return callback(error); + callback(undefined, topology); + }); + }); + }); + return; + } + // otherwise connect normally + topology.connect(options, err => { + if (err) { + topology.close({ force: true }); + return callback(err); + } + callback(undefined, topology); + return; + }); +} +//# sourceMappingURL=connect.js.map \ No newline at end of file diff --git a/node_modules/mongodb/lib/operations/connect.js.map b/node_modules/mongodb/lib/operations/connect.js.map new file mode 100644 index 000000000..f39e04be5 --- /dev/null +++ b/node_modules/mongodb/lib/operations/connect.js.map @@ -0,0 +1 @@ +{"version":3,"file":"connect.js","sourceRoot":"","sources":["../../src/operations/connect.ts"],"names":[],"mappings":";;;AAAA,4DAAwD;AACxD,4CAAmD;AACnD,oCAAwE;AAExE,+CAA4C;AAG5C,SAAgB,OAAO,CACrB,WAAwB,EACxB,OAAqB,EACrB,QAA+B;IAE/B,IAAI,CAAC,QAAQ,EAAE;QACb,MAAM,IAAI,iCAAyB,CAAC,oCAAoC,CAAC,CAAC;KAC3E;IAED,mEAAmE;IACnE,IAAI,WAAW,CAAC,QAAQ,IAAI,WAAW,CAAC,QAAQ,CAAC,WAAW,EAAE,EAAE;QAC9D,OAAO,QAAQ,CAAC,SAAS,EAAE,WAAW,CAAC,CAAC;KACzC;IAED,MAAM,MAAM,GAAG,WAAW,CAAC,MAAM,CAAC;IAClC,MAAM,eAAe,GAAa,GAAG,CAAC,EAAE;QACtC,MAAM,cAAc,GAClB,wEAAwE;YACxE,wEAAwE;YACxE,0CAA0C,CAAC;QAC7C,IAAI,GAAG,IAAI,GAAG,CAAC,OAAO,KAAK,sCAAsC,EAAE;YACjE,IAAI,MAAM,CAAC,MAAM,EAAE,EAAE;gBACnB,MAAM,CA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E;QACvC,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC,GAAG,IAAW,EAAE,EAAE,CAAC,WAAW,CAAC,IAAI,CAAC,KAAK,EAAE,GAAI,IAAY,CAAC,CAAC,CAAC;KACnF;IAED,gCAAgC;IAChC,IAAI,WAAW,CAAC,aAAa,EAAE;QAC7B,WAAW,CAAC,aAAa,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE;YACnC,IAAI,GAAG,EAAE;gBACP,OAAO,QAAQ,CAAC,GAAG,CAAC,CAAC;aACtB;YAED,QAAQ,CAAC,OAAO,CAAC,OAAO,EAAE,GAAG,CAAC,EAAE;gBAC9B,IAAI,GAAG,EAAE;oBACP,QAAQ,CAAC,KAAK,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;oBAChC,OAAO,QAAQ,CAAC,GAAG,CAAC,CAAC;iBACtB;gBAED,OAAO,CAAC,SAAS,CAAC,qBAAqB,CAAC,KAAK,CAAC,EAAE;oBAC9C,IAAI,KAAK;wBAAE,OAAO,QAAQ,CAAC,KAAK,CAAC,CAAC;oBAElC,QAAQ,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;gBAChC,CAAC,CAAC,CAAC;YACL,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;QAEH,OAAO;KACR;IAED,6BAA6B;IAC7B,QAAQ,CAAC,OAAO,CAAC,OAAO,EAAE,GAAG,CAAC,EAAE;QAC9B,IAAI,GAAG,EAAE;YACP,QAAQ,CAAC,KAAK,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;YAChC,OAAO,QAAQ,CAAC,GAAG,CAAC,CAAC;SACtB;QAED,QAAQ,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;QAC9B,OAAO;IACT,CAAC,CAAC,CAAC;AACL,CAAC"} \ No newline at end of file diff --git a/node_modules/mongodb/lib/operations/count.js b/node_modules/mongodb/lib/operations/count.js new file mode 100644 index 000000000..706dde671 --- /dev/null +++ b/node_modules/mongodb/lib/operations/count.js @@ -0,0 +1,39 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.CountOperation = void 0; +const command_1 = require("./command"); +const operation_1 = require("./operation"); +/** @internal */ +class CountOperation extends command_1.CommandOperation { + constructor(namespace, filter, options) { + super({ s: { namespace: namespace } }, options); + this.options = options; + this.collectionName = namespace.collection; + this.query = filter; + } + execute(server, session, callback) { + const options = this.options; + const cmd = { + count: this.collectionName, + query: this.query + }; + if (typeof options.limit === 'number') { + cmd.limit = options.limit; + } + if (typeof options.skip === 'number') { + cmd.skip = options.skip; + } + if (options.hint != null) { + cmd.hint = options.hint; + } + if (typeof options.maxTimeMS === 'number') { + cmd.maxTimeMS = options.maxTimeMS; + } + super.executeCommand(server, session, cmd, (err, result) => { + callback(err, result ? result.n : 0); + }); + } +} +exports.CountOperation = CountOperation; +(0, operation_1.defineAspects)(CountOperation, [operation_1.Aspect.READ_OPERATION, operation_1.Aspect.RETRYABLE]); +//# sourceMappingURL=count.js.map \ No newline at end of file diff --git a/node_modules/mongodb/lib/operations/count.js.map b/node_modules/mongodb/lib/operations/count.js.map new file mode 100644 index 000000000..aeee5fd7c --- /dev/null +++ b/node_modules/mongodb/lib/operations/count.js.map @@ -0,0 +1 @@ +{"version":3,"file":"count.js","sourceRoot":"","sources":["../../src/operations/count.ts"],"names":[],"mappings":";;;AAKA,uCAAsE;AACtE,2CAAoD;AAcpD,gBAAgB;AAChB,MAAa,cAAe,SAAQ,0BAAwB;IAK1D,YAAY,SAA2B,EAAE,MAAgB,EAAE,OAAqB;QAC9E,KAAK,CAAC,EAAE,CAAC,EAAE,EAAE,SAAS,EAAE,SAAS,EAAE,EAA2B,EAAE,OAAO,CAAC,CAAC;QAEzE,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,cAAc,GAAG,SAAS,CAAC,UAAU,CAAC;QAC3C,IAAI,CAAC,KAAK,GAAG,MAAM,CAAC;IACtB,CAAC;IAEQ,OAAO,CACd,MAAc,EACd,OAAkC,EAClC,QAA0B;QAE1B,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC;QAC7B,MAAM,GAAG,GAAa;YACpB,KAAK,EAAE,IAAI,CAAC,cAAc;YAC1B,KAAK,EAAE,IAAI,CAAC,KAAK;SAClB,CAAC;QAEF,IAAI,OAAO,OAAO,CAAC,KAAK,KAAK,QAAQ,EAAE;YACrC,GAAG,CAAC,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC;SAC3B;QAED,IAAI,OAAO,OAAO,CAAC,IAAI,KAAK,QAAQ,EAAE;YACpC,GAAG,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;SACzB;QAED,IAAI,OAAO,CAAC,IAAI,IAAI,IAAI,EAAE;YACxB,GAAG,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;SACzB;QAED,IAAI,OAAO,OAAO,CAAC,SAAS,KAAK,QAAQ,EAAE;YACzC,GAAG,CAAC,SAAS,GAAG,OAAO,CAAC,SAAS,CAAC;SACnC;QAED,KAAK,CAAC,cAAc,CAAC,MAAM,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,EAAE;YACzD,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QACvC,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AA5CD,wCA4CC;AAED,IAAA,yBAAa,EAAC,cAAc,EAAE,CAAC,kBAAM,CAAC,cAAc,EAAE,kBAAM,CAAC,SAAS,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/mongodb/lib/operations/count_documents.js b/node_modules/mongodb/lib/operations/count_documents.js new file mode 100644 index 000000000..562c9c068 --- /dev/null +++ b/node_modules/mongodb/lib/operations/count_documents.js @@ -0,0 +1,37 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.CountDocumentsOperation = void 0; +const aggregate_1 = require("./aggregate"); +/** @internal */ +class CountDocumentsOperation extends aggregate_1.AggregateOperation { + constructor(collection, query, options) { + const pipeline = []; + pipeline.push({ $match: query }); + if (typeof options.skip === 'number') { + pipeline.push({ $skip: options.skip }); + } + if (typeof options.limit === 'number') { + pipeline.push({ $limit: options.limit }); + } + pipeline.push({ $group: { _id: 1, n: { $sum: 1 } } }); + super(collection.s.namespace, pipeline, options); + } + execute(server, session, callback) { + super.execute(server, session, (err, result) => { + if (err || !result) { + callback(err); + return; + } + // NOTE: We're avoiding creating a cursor here to reduce the callstack. + const response = result; + if (response.cursor == null || response.cursor.firstBatch == null) { + callback(undefined, 0); + return; + } + const docs = response.cursor.firstBatch; + callback(undefined, docs.length ? docs[0].n : 0); + }); + } +} +exports.CountDocumentsOperation = CountDocumentsOperation; +//# sourceMappingURL=count_documents.js.map \ No newline at end of file diff --git a/node_modules/mongodb/lib/operations/count_documents.js.map b/node_modules/mongodb/lib/operations/count_documents.js.map new file mode 100644 index 000000000..bc1ce7b67 --- /dev/null +++ b/node_modules/mongodb/lib/operations/count_documents.js.map @@ -0,0 +1 @@ +{"version":3,"file":"count_documents.js","sourceRoot":"","sources":["../../src/operations/count_documents.ts"],"names":[],"mappings":";;;AAKA,2CAAmE;AAUnE,gBAAgB;AAChB,MAAa,uBAAwB,SAAQ,8BAA0B;IACrE,YAAY,UAAsB,EAAE,KAAe,EAAE,OAA8B;QACjF,MAAM,QAAQ,GAAG,EAAE,CAAC;QACpB,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,CAAC;QAEjC,IAAI,OAAO,OAAO,CAAC,IAAI,KAAK,QAAQ,EAAE;YACpC,QAAQ,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC;SACxC;QAED,IAAI,OAAO,OAAO,CAAC,KAAK,KAAK,QAAQ,EAAE;YACrC,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,KAAK,EAAE,CAAC,CAAC;SAC1C;QAED,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;QAEtD,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,SAAS,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC;IACnD,CAAC;IAEQ,OAAO,CACd,MAAc,EACd,OAAkC,EAClC,QAA0B;QAE1B,KAAK,CAAC,OAAO,CAAC,MAAM,EAAE,OAAO,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,EAAE;YAC7C,IAAI,GAAG,IAAI,CAAC,MAAM,EAAE;gBAClB,QAAQ,CAAC,GAAG,CAAC,CAAC;gBACd,OAAO;aACR;YAED,uEAAuE;YACvE,MAAM,QAAQ,GAAG,MAA6B,CAAC;YAC/C,IAAI,QAAQ,CAAC,MAAM,IAAI,IAAI,IAAI,QAAQ,CAAC,MAAM,CAAC,UAAU,IAAI,IAAI,EAAE;gBACjE,QAAQ,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC;gBACvB,OAAO;aACR;YAED,MAAM,IAAI,GAAG,QAAQ,CAAC,MAAM,CAAC,UAAU,CAAC;YACxC,QAAQ,CAAC,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QACnD,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AAxCD,0DAwCC"} \ No newline at end of file diff --git a/node_modules/mongodb/lib/operations/create_collection.js b/node_modules/mongodb/lib/operations/create_collection.js new file mode 100644 index 000000000..4d6c8a50e --- /dev/null +++ b/node_modules/mongodb/lib/operations/create_collection.js @@ -0,0 +1,100 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.CreateCollectionOperation = void 0; +const collection_1 = require("../collection"); +const command_1 = require("./command"); +const indexes_1 = require("./indexes"); +const operation_1 = require("./operation"); +const ILLEGAL_COMMAND_FIELDS = new Set([ + 'w', + 'wtimeout', + 'j', + 'fsync', + 'autoIndexId', + 'pkFactory', + 'raw', + 'readPreference', + 'session', + 'readConcern', + 'writeConcern', + 'raw', + 'fieldsAsRaw', + 'promoteLongs', + 'promoteValues', + 'promoteBuffers', + 'bsonRegExp', + 'serializeFunctions', + 'ignoreUndefined', + 'enableUtf8Validation' +]); +/** @internal */ +class CreateCollectionOperation extends command_1.CommandOperation { + constructor(db, name, options = {}) { + super(db, options); + this.options = options; + this.db = db; + this.name = name; + } + execute(server, session, callback) { + (async () => { + var _a, _b, _c, _d, _e, _f; + const db = this.db; + const name = this.name; + const options = this.options; + const encryptedFields = (_a = options.encryptedFields) !== null && _a !== void 0 ? _a : (_c = (_b = db.s.client.options.autoEncryption) === null || _b === void 0 ? void 0 : _b.encryptedFieldsMap) === null || _c === void 0 ? void 0 : _c[`${db.databaseName}.${name}`]; + if (encryptedFields) { + // Create auxilliary collections for queryable encryption support. + const escCollection = (_d = encryptedFields.escCollection) !== null && _d !== void 0 ? _d : `enxcol_.${name}.esc`; + const eccCollection = (_e = encryptedFields.eccCollection) !== null && _e !== void 0 ? _e : `enxcol_.${name}.ecc`; + const ecocCollection = (_f = encryptedFields.ecocCollection) !== null && _f !== void 0 ? _f : `enxcol_.${name}.ecoc`; + for (const collectionName of [escCollection, eccCollection, ecocCollection]) { + const createOp = new CreateCollectionOperation(db, collectionName, { + clusteredIndex: { + key: { _id: 1 }, + unique: true + } + }); + await createOp.executeWithoutEncryptedFieldsCheck(server, session); + } + if (!options.encryptedFields) { + this.options = { ...this.options, encryptedFields }; + } + } + const coll = await this.executeWithoutEncryptedFieldsCheck(server, session); + if (encryptedFields) { + // Create the required index for queryable encryption support. + const createIndexOp = new indexes_1.CreateIndexOperation(db, name, { __safeContent__: 1 }, {}); + await new Promise((resolve, reject) => { + createIndexOp.execute(server, session, err => (err ? reject(err) : resolve())); + }); + } + return coll; + })().then(coll => callback(undefined, coll), err => callback(err)); + } + executeWithoutEncryptedFieldsCheck(server, session) { + return new Promise((resolve, reject) => { + const db = this.db; + const name = this.name; + const options = this.options; + const done = err => { + if (err) { + return reject(err); + } + resolve(new collection_1.Collection(db, name, options)); + }; + const cmd = { create: name }; + for (const n in options) { + if (options[n] != null && + typeof options[n] !== 'function' && + !ILLEGAL_COMMAND_FIELDS.has(n)) { + cmd[n] = options[n]; + } + } + // otherwise just execute the command + super.executeCommand(server, session, cmd, done); + }); + } +} +exports.CreateCollectionOperation = CreateCollectionOperation; +(0, operation_1.defineAspects)(CreateCollectionOperation, [operation_1.Aspect.WRITE_OPERATION]); +//# sourceMappingURL=create_collection.js.map \ No newline at end of file diff --git a/node_modules/mongodb/lib/operations/create_collection.js.map b/node_modules/mongodb/lib/operations/create_collection.js.map new file mode 100644 index 000000000..397690f8b --- /dev/null +++ b/node_modules/mongodb/lib/operations/create_collection.js.map @@ -0,0 +1 @@ +{"version":3,"file":"create_collection.js","sourceRoot":"","sources":["../../src/operations/create_collection.ts"],"names":[],"mappings":";;;AACA,8CAA2C;AAM3C,uCAAsE;AACtE,uCAAiD;AACjD,2CAAoD;AAEpD,MAAM,sBAAsB,GAAG,IAAI,GAAG,CAAC;IACrC,GAAG;IACH,UAAU;IACV,GAAG;IACH,OAAO;IACP,aAAa;IACb,WAAW;IACX,KAAK;IACL,gBAAgB;IAChB,SAAS;IACT,aAAa;IACb,cAAc;IACd,KAAK;IACL,aAAa;IACb,cAAc;IACd,eAAe;IACf,gBAAgB;IAChB,YAAY;IACZ,oBAAoB;IACpB,iBAAiB;IACjB,sBAAsB;CACvB,CAAC,CAAC;AAoEH,gBAAgB;AAChB,MAAa,yBAA0B,SAAQ,0BAA4B;IAKzE,YAAY,EAAM,EAAE,IAAY,EAAE,UAAmC,EAAE;QACrE,KAAK,CAAC,EAAE,EAAE,OAA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,CAAC,IAAI,uBAAU,CAAC,EAAE,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC;YAC7C,CAAC,CAAC;YAEF,MAAM,GAAG,GAAa,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;YACvC,KAAK,MAAM,CAAC,IAAI,OAAO,EAAE;gBACvB,IACG,OAAe,CAAC,CAAC,CAAC,IAAI,IAAI;oBAC3B,OAAQ,OAAe,CAAC,CAAC,CAAC,KAAK,UAAU;oBACzC,CAAC,sBAAsB,CAAC,GAAG,CAAC,CAAC,CAAC,EAC9B;oBACA,GAAG,CAAC,CAAC,CAAC,GAAI,OAAe,CAAC,CAAC,CAAC,CAAC;iBAC9B;aACF;YAED,qCAAqC;YACrC,KAAK,CAAC,cAAc,CAAC,MAAM,EAAE,OAAO,EAAE,GAAG,EAAE,IAAI,CAAC,CAAC;QACnD,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AAjGD,8DAiGC;AAED,IAAA,yBAAa,EAAC,yBAAyB,EAAE,CAAC,kBAAM,CAAC,eAAe,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/mongodb/lib/operations/delete.js b/node_modules/mongodb/lib/operations/delete.js new file mode 100644 index 000000000..34cd24a10 --- /dev/null +++ b/node_modules/mongodb/lib/operations/delete.js @@ -0,0 +1,135 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.makeDeleteStatement = exports.DeleteManyOperation = exports.DeleteOneOperation = exports.DeleteOperation = void 0; +const error_1 = require("../error"); +const utils_1 = require("../utils"); +const command_1 = require("./command"); +const operation_1 = require("./operation"); +/** @internal */ +class DeleteOperation extends command_1.CommandOperation { + constructor(ns, statements, options) { + super(undefined, options); + this.options = options; + this.ns = ns; + this.statements = statements; + } + get canRetryWrite() { + if (super.canRetryWrite === false) { + return false; + } + return this.statements.every(op => (op.limit != null ? op.limit > 0 : true)); + } + execute(server, session, callback) { + var _a; + const options = (_a = this.options) !== null && _a !== void 0 ? _a : {}; + const ordered = typeof options.ordered === 'boolean' ? options.ordered : true; + const command = { + delete: this.ns.collection, + deletes: this.statements, + ordered + }; + if (options.let) { + command.let = options.let; + } + // we check for undefined specifically here to allow falsy values + // eslint-disable-next-line no-restricted-syntax + if (options.comment !== undefined) { + command.comment = options.comment; + } + if (options.explain != null && (0, utils_1.maxWireVersion)(server) < 3) { + return callback + ? callback(new error_1.MongoCompatibilityError(`Server ${server.name} does not support explain on delete`)) + : undefined; + } + const unacknowledgedWrite = this.writeConcern && this.writeConcern.w === 0; + if (unacknowledgedWrite || (0, utils_1.maxWireVersion)(server) < 5) { + if (this.statements.find((o) => o.hint)) { + callback(new error_1.MongoCompatibilityError(`Servers < 3.4 do not support hint on delete`)); + return; + } + } + const statementWithCollation = this.statements.find(statement => !!statement.collation); + if (statementWithCollation && (0, utils_1.collationNotSupported)(server, statementWithCollation)) { + callback(new error_1.MongoCompatibilityError(`Server ${server.name} does not support collation`)); + return; + } + super.executeCommand(server, session, command, callback); + } +} +exports.DeleteOperation = DeleteOperation; +class DeleteOneOperation extends DeleteOperation { + constructor(collection, filter, options) { + super(collection.s.namespace, [makeDeleteStatement(filter, { ...options, limit: 1 })], options); + } + execute(server, session, callback) { + super.execute(server, session, (err, res) => { + var _a, _b; + if (err || res == null) + return callback(err); + if (res.code) + return callback(new error_1.MongoServerError(res)); + if (res.writeErrors) + return callback(new error_1.MongoServerError(res.writeErrors[0])); + if (this.explain) + return callback(undefined, res); + callback(undefined, { + acknowledged: (_b = ((_a = this.writeConcern) === null || _a === void 0 ? void 0 : _a.w) !== 0) !== null && _b !== void 0 ? _b : true, + deletedCount: res.n + }); + }); + } +} +exports.DeleteOneOperation = DeleteOneOperation; +class DeleteManyOperation extends DeleteOperation { + constructor(collection, filter, options) { + super(collection.s.namespace, [makeDeleteStatement(filter, options)], options); + } + execute(server, session, callback) { + super.execute(server, session, (err, res) => { + var _a, _b; + if (err || res == null) + return callback(err); + if (res.code) + return callback(new error_1.MongoServerError(res)); + if (res.writeErrors) + return callback(new error_1.MongoServerError(res.writeErrors[0])); + if (this.explain) + return callback(undefined, res); + callback(undefined, { + acknowledged: (_b = ((_a = this.writeConcern) === null || _a === void 0 ? void 0 : _a.w) !== 0) !== null && _b !== void 0 ? _b : true, + deletedCount: res.n + }); + }); + } +} +exports.DeleteManyOperation = DeleteManyOperation; +function makeDeleteStatement(filter, options) { + const op = { + q: filter, + limit: typeof options.limit === 'number' ? options.limit : 0 + }; + if (options.single === true) { + op.limit = 1; + } + if (options.collation) { + op.collation = options.collation; + } + if (options.hint) { + op.hint = options.hint; + } + return op; +} +exports.makeDeleteStatement = makeDeleteStatement; +(0, operation_1.defineAspects)(DeleteOperation, [operation_1.Aspect.RETRYABLE, operation_1.Aspect.WRITE_OPERATION]); +(0, operation_1.defineAspects)(DeleteOneOperation, [ + operation_1.Aspect.RETRYABLE, + operation_1.Aspect.WRITE_OPERATION, + operation_1.Aspect.EXPLAINABLE, + operation_1.Aspect.SKIP_COLLATION +]); +(0, operation_1.defineAspects)(DeleteManyOperation, [ + operation_1.Aspect.WRITE_OPERATION, + operation_1.Aspect.EXPLAINABLE, + operation_1.Aspect.SKIP_COLLATION +]); +//# sourceMappingURL=delete.js.map \ No newline at end of file diff --git a/node_modules/mongodb/lib/operations/delete.js.map b/node_modules/mongodb/lib/operations/delete.js.map new file mode 100644 index 000000000..e716dfe5e --- /dev/null +++ b/node_modules/mongodb/lib/operations/delete.js.map @@ -0,0 +1 @@ +{"version":3,"file":"delete.js","sourceRoot":"","sources":["../../src/operations/delete.ts"],"names":[],"mappings":";;;AAEA,oCAAqE;AAGrE,oCAA6F;AAE7F,uCAAwF;AACxF,2CAA0D;AAqC1D,gBAAgB;AAChB,MAAa,eAAgB,SAAQ,0BAA0B;IAI7D,YAAY,EAAoB,EAAE,UAA6B,EAAE,OAAsB;QACrF,KAAK,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;QAC1B,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CA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AC;AACH,IAAA,yBAAa,EAAC,mBAAmB,EAAE;IACjC,kBAAM,CAAC,eAAe;IACtB,kBAAM,CAAC,WAAW;IAClB,kBAAM,CAAC,cAAc;CACtB,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/mongodb/lib/operations/distinct.js b/node_modules/mongodb/lib/operations/distinct.js new file mode 100644 index 000000000..4e2e8264f --- /dev/null +++ b/node_modules/mongodb/lib/operations/distinct.js @@ -0,0 +1,67 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.DistinctOperation = void 0; +const error_1 = require("../error"); +const utils_1 = require("../utils"); +const command_1 = require("./command"); +const operation_1 = require("./operation"); +/** + * Return a list of distinct values for the given key across a collection. + * @internal + */ +class DistinctOperation extends command_1.CommandOperation { + /** + * Construct a Distinct operation. + * + * @param collection - Collection instance. + * @param key - Field of the document to find distinct values for. + * @param query - The query for filtering the set of documents to which we apply the distinct filter. + * @param options - Optional settings. See Collection.prototype.distinct for a list of options. + */ + constructor(collection, key, query, options) { + super(collection, options); + this.options = options !== null && options !== void 0 ? options : {}; + this.collection = collection; + this.key = key; + this.query = query; + } + execute(server, session, callback) { + const coll = this.collection; + const key = this.key; + const query = this.query; + const options = this.options; + // Distinct command + const cmd = { + distinct: coll.collectionName, + key: key, + query: query + }; + // Add maxTimeMS if defined + if (typeof options.maxTimeMS === 'number') { + cmd.maxTimeMS = options.maxTimeMS; + } + // Do we have a readConcern specified + (0, utils_1.decorateWithReadConcern)(cmd, coll, options); + // Have we specified collation + try { + (0, utils_1.decorateWithCollation)(cmd, coll, options); + } + catch (err) { + return callback(err); + } + if (this.explain && (0, utils_1.maxWireVersion)(server) < 4) { + callback(new error_1.MongoCompatibilityError(`Server ${server.name} does not support explain on distinct`)); + return; + } + super.executeCommand(server, session, cmd, (err, result) => { + if (err) { + callback(err); + return; + } + callback(undefined, this.explain ? result : result.values); + }); + } +} +exports.DistinctOperation = DistinctOperation; +(0, operation_1.defineAspects)(DistinctOperation, [operation_1.Aspect.READ_OPERATION, operation_1.Aspect.RETRYABLE, operation_1.Aspect.EXPLAINABLE]); +//# sourceMappingURL=distinct.js.map \ No newline at end of file diff --git a/node_modules/mongodb/lib/operations/distinct.js.map b/node_modules/mongodb/lib/operations/distinct.js.map new file mode 100644 index 000000000..1b111c909 --- /dev/null +++ b/node_modules/mongodb/lib/operations/distinct.js.map @@ -0,0 +1 @@ +{"version":3,"file":"distinct.js","sourceRoot":"","sources":["../../src/operations/distinct.ts"],"names":[],"mappings":";;;AAEA,oCAAmD;AAGnD,oCAAoG;AACpG,uCAAsE;AACtE,2CAAoD;AAKpD;;;GAGG;AACH,MAAa,iBAAkB,SAAQ,0BAAuB;IAQ5D;;;;;;;OAOG;IACH,YAAY,UAAsB,EAAE,GAAW,EAAE,KAAe,EAAE,OAAyB;QACzF,KAAK,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;QAE3B,IAAI,CAAC,OAAO,GAAG,OAAO,aAAP,OAAO,cAAP,OAAO,GAAI,EAAE,CAAC;QAC7B,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;QACf,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACrB,CAAC;IAEQ,OAAO,CACd,MAAc,EACd,OAAkC,EAClC,QAAyB;QAEzB,MAAM,IAAI,GAAG,IAAI,CAAC,UAAU,CAAC;QAC7B,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC;QACrB,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;QACzB,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC;QAE7B,mBAAmB;QACnB,MAAM,GAAG,GAAa;YACpB,QAAQ,EAAE,IAAI,CAAC,cAAc;YAC7B,GAAG,EAAE,GAAG;YACR,KAAK,EAAE,KAAK;SACb,CAAC;QAEF,2BAA2B;QAC3B,IAAI,OAAO,OAAO,CAAC,SAAS,KAAK,QAAQ,EAAE;YACzC,GAAG,CAAC,SAAS,GAAG,OAAO,CAAC,SAAS,CAAC;SACnC;QAED,qCAAqC;QACrC,IAAA,+BAAuB,EAAC,GAAG,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;QAE5C,8BAA8B;QAC9B,IAAI;YACF,IAAA,6BAAqB,EAAC,GAAG,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;SAC3C;QAAC,OAAO,GAAG,EAAE;YACZ,OAAO,QAAQ,CAAC,GAAG,CAAC,CAAC;SACtB;QAED,IAAI,IAAI,CAAC,OAAO,IAAI,IAAA,sBAAc,EAAC,MAAM,CAAC,GAAG,CAAC,EAAE;YAC9C,QAAQ,CACN,IAAI,+BAAuB,CAAC,UAAU,MAAM,CAAC,IAAI,uCAAuC,CAAC,CAC1F,CAAC;YACF,OAAO;SACR;QAED,KAAK,CAAC,cAAc,CAAC,MAAM,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,EAAE;YACzD,IAAI,GAAG,EAAE;gBACP,QAAQ,CAAC,GAAG,CAAC,CAAC;gBACd,OAAO;aACR;YAED,QAAQ,CAAC,SAAS,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;QAC7D,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AAzED,8CAyEC;AAED,IAAA,yBAAa,EAAC,iBAAiB,EAAE,CAAC,kBAAM,CAAC,cAAc,EAAE,kBAAM,CAAC,SAAS,EAAE,kBAAM,CAAC,WAAW,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/mongodb/lib/operations/drop.js b/node_modules/mongodb/lib/operations/drop.js new file mode 100644 index 000000000..c0cbcf2f4 --- /dev/null +++ b/node_modules/mongodb/lib/operations/drop.js @@ -0,0 +1,84 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.DropDatabaseOperation = exports.DropCollectionOperation = void 0; +const error_1 = require("../error"); +const command_1 = require("./command"); +const operation_1 = require("./operation"); +/** @internal */ +class DropCollectionOperation extends command_1.CommandOperation { + constructor(db, name, options = {}) { + super(db, options); + this.db = db; + this.options = options; + this.name = name; + } + execute(server, session, callback) { + (async () => { + var _a, _b, _c, _d; + const db = this.db; + const options = this.options; + const name = this.name; + const encryptedFieldsMap = (_a = db.s.client.options.autoEncryption) === null || _a === void 0 ? void 0 : _a.encryptedFieldsMap; + let encryptedFields = (_b = options.encryptedFields) !== null && _b !== void 0 ? _b : encryptedFieldsMap === null || encryptedFieldsMap === void 0 ? void 0 : encryptedFieldsMap[`${db.databaseName}.${name}`]; + if (!encryptedFields && encryptedFieldsMap) { + // If the MongoClient was configued with an encryptedFieldsMap, + // and no encryptedFields config was available in it or explicitly + // passed as an argument, the spec tells us to look one up using + // listCollections(). + const listCollectionsResult = await db + .listCollections({ name }, { nameOnly: false }) + .toArray(); + encryptedFields = (_d = (_c = listCollectionsResult === null || listCollectionsResult === void 0 ? void 0 : listCollectionsResult[0]) === null || _c === void 0 ? void 0 : _c.options) === null || _d === void 0 ? void 0 : _d.encryptedFields; + } + if (encryptedFields) { + const escCollection = encryptedFields.escCollection || `enxcol_.${name}.esc`; + const eccCollection = encryptedFields.eccCollection || `enxcol_.${name}.ecc`; + const ecocCollection = encryptedFields.ecocCollection || `enxcol_.${name}.ecoc`; + for (const collectionName of [escCollection, eccCollection, ecocCollection]) { + // Drop auxilliary collections, ignoring potential NamespaceNotFound errors. + const dropOp = new DropCollectionOperation(db, collectionName); + try { + await dropOp.executeWithoutEncryptedFieldsCheck(server, session); + } + catch (err) { + if (!(err instanceof error_1.MongoServerError) || + err.code !== error_1.MONGODB_ERROR_CODES.NamespaceNotFound) { + throw err; + } + } + } + } + return await this.executeWithoutEncryptedFieldsCheck(server, session); + })().then(result => callback(undefined, result), err => callback(err)); + } + executeWithoutEncryptedFieldsCheck(server, session) { + return new Promise((resolve, reject) => { + super.executeCommand(server, session, { drop: this.name }, (err, result) => { + if (err) + return reject(err); + resolve(!!result.ok); + }); + }); + } +} +exports.DropCollectionOperation = DropCollectionOperation; +/** @internal */ +class DropDatabaseOperation extends command_1.CommandOperation { + constructor(db, options) { + super(db, options); + this.options = options; + } + execute(server, session, callback) { + super.executeCommand(server, session, { dropDatabase: 1 }, (err, result) => { + if (err) + return callback(err); + if (result.ok) + return callback(undefined, true); + callback(undefined, false); + }); + } +} +exports.DropDatabaseOperation = DropDatabaseOperation; +(0, operation_1.defineAspects)(DropCollectionOperation, [operation_1.Aspect.WRITE_OPERATION]); +(0, operation_1.defineAspects)(DropDatabaseOperation, [operation_1.Aspect.WRITE_OPERATION]); +//# sourceMappingURL=drop.js.map \ No newline at end of file diff --git a/node_modules/mongodb/lib/operations/drop.js.map b/node_modules/mongodb/lib/operations/drop.js.map new file mode 100644 index 000000000..6f6e283b4 --- /dev/null +++ b/node_modules/mongodb/lib/operations/drop.js.map @@ -0,0 +1 @@ +{"version":3,"file":"drop.js","sourceRoot":"","sources":["../../src/operations/drop.ts"],"names":[],"mappings":";;;AAEA,oCAAiE;AAIjE,uCAAsE;AACtE,2CAAoD;AAQpD,gBAAgB;AAChB,MAAa,uBAAwB,SAAQ,0BAAyB;IAKpE,YAAY,EAAM,EAAE,IAAY,EAAE,UAAiC,EAAE;QACnE,KAAK,CAAC,EAAE,EAAE,OAAO,CAAC,CAAC;QACnB,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC;QACb,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;IAEQ,OAAO,CACd,MAAc,EACd,OAAkC,EAClC,QAA2B;QAE3B,CAAC,KAAK,IAAI,EAAE;;YACV,MAAM,EAAE,GAAG,IAAI,CAAC,EAAE,CAAC;YACnB,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC;YAC7B,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;YAEvB,MAAM,kBAAkB,GAAG,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C,EAAE;gBAAE,OAAO,QAAQ,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;YAChD,QAAQ,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC;QAC7B,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AAlBD,sDAkBC;AAED,IAAA,yBAAa,EAAC,uBAAuB,EAAE,CAAC,kBAAM,CAAC,eAAe,CAAC,CAAC,CAAC;AACjE,IAAA,yBAAa,EAAC,qBAAqB,EAAE,CAAC,kBAAM,CAAC,eAAe,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/mongodb/lib/operations/estimated_document_count.js b/node_modules/mongodb/lib/operations/estimated_document_count.js new file mode 100644 index 000000000..eb303af36 --- /dev/null +++ b/node_modules/mongodb/lib/operations/estimated_document_count.js @@ -0,0 +1,33 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.EstimatedDocumentCountOperation = void 0; +const command_1 = require("./command"); +const operation_1 = require("./operation"); +/** @internal */ +class EstimatedDocumentCountOperation extends command_1.CommandOperation { + constructor(collection, options = {}) { + super(collection, options); + this.options = options; + this.collectionName = collection.collectionName; + } + execute(server, session, callback) { + const cmd = { count: this.collectionName }; + if (typeof this.options.maxTimeMS === 'number') { + cmd.maxTimeMS = this.options.maxTimeMS; + } + super.executeCommand(server, session, cmd, (err, response) => { + if (err) { + callback(err); + return; + } + callback(undefined, (response === null || response === void 0 ? void 0 : response.n) || 0); + }); + } +} +exports.EstimatedDocumentCountOperation = EstimatedDocumentCountOperation; +(0, operation_1.defineAspects)(EstimatedDocumentCountOperation, [ + operation_1.Aspect.READ_OPERATION, + operation_1.Aspect.RETRYABLE, + operation_1.Aspect.CURSOR_CREATING +]); +//# sourceMappingURL=estimated_document_count.js.map \ No newline at end of file diff --git a/node_modules/mongodb/lib/operations/estimated_document_count.js.map b/node_modules/mongodb/lib/operations/estimated_document_count.js.map new file mode 100644 index 000000000..ecf67db83 --- /dev/null +++ b/node_modules/mongodb/lib/operations/estimated_document_count.js.map @@ -0,0 +1 @@ +{"version":3,"file":"estimated_document_count.js","sourceRoot":"","sources":["../../src/operations/estimated_document_count.ts"],"names":[],"mappings":";;;AAKA,uCAAsE;AACtE,2CAAoD;AAYpD,gBAAgB;AAChB,MAAa,+BAAgC,SAAQ,0BAAwB;IAI3E,YAAY,UAAsB,EAAE,UAAyC,EAAE;QAC7E,KAAK,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;QAC3B,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,cAAc,GAAG,UAAU,CAAC,cAAc,CAAC;IAClD,CAAC;IAEQ,OAAO,CACd,MAAc,EACd,OAAkC,EAClC,QAA0B;QAE1B,MAAM,GAAG,GAAa,EAAE,KAAK,EAAE,IAAI,CAAC,cAAc,EAAE,CAAC;QAErD,IAAI,OAAO,IAAI,CAAC,OAAO,CAAC,SAAS,KAAK,QAAQ,EAAE;YAC9C,GAAG,CAAC,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC;SACxC;QAED,KAAK,CAAC,cAAc,CAAC,MAAM,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,GAAG,EAAE,QAAQ,EAAE,EAAE;YAC3D,IAAI,GAAG,EAAE;gBACP,QAAQ,CAAC,GAAG,CAAC,CAAC;gBACd,OAAO;aACR;YAED,QAAQ,CAAC,SAAS,EAAE,CAAA,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,CAAC,KAAI,CAAC,CAAC,CAAC;QACxC,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AA9BD,0EA8BC;AAED,IAAA,yBAAa,EAAC,+BAA+B,EAAE;IAC7C,kBAAM,CAAC,cAAc;IACrB,kBAAM,CAAC,SAAS;IAChB,kBAAM,CAAC,eAAe;CACvB,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/mongodb/lib/operations/eval.js b/node_modules/mongodb/lib/operations/eval.js new file mode 100644 index 000000000..7227ce458 --- /dev/null +++ b/node_modules/mongodb/lib/operations/eval.js @@ -0,0 +1,55 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.EvalOperation = void 0; +const bson_1 = require("../bson"); +const error_1 = require("../error"); +const read_preference_1 = require("../read_preference"); +const command_1 = require("./command"); +/** @internal */ +class EvalOperation extends command_1.CommandOperation { + constructor(db, code, parameters, options) { + super(db, options); + this.options = options !== null && options !== void 0 ? options : {}; + this.code = code; + this.parameters = parameters; + // force primary read preference + Object.defineProperty(this, 'readPreference', { + value: read_preference_1.ReadPreference.primary, + configurable: false, + writable: false + }); + } + execute(server, session, callback) { + let finalCode = this.code; + let finalParameters = []; + // If not a code object translate to one + if (!(finalCode && finalCode._bsontype === 'Code')) { + finalCode = new bson_1.Code(finalCode); + } + // Ensure the parameters are correct + if (this.parameters != null && typeof this.parameters !== 'function') { + finalParameters = Array.isArray(this.parameters) ? this.parameters : [this.parameters]; + } + // Create execution selector + const cmd = { $eval: finalCode, args: finalParameters }; + // Check if the nolock parameter is passed in + if (this.options.nolock) { + cmd.nolock = this.options.nolock; + } + // Execute the command + super.executeCommand(server, session, cmd, (err, result) => { + if (err) + return callback(err); + if (result && result.ok === 1) { + return callback(undefined, result.retval); + } + if (result) { + callback(new error_1.MongoServerError({ message: `eval failed: ${result.errmsg}` })); + return; + } + callback(err, result); + }); + } +} +exports.EvalOperation = EvalOperation; +//# sourceMappingURL=eval.js.map \ No newline at end of file diff --git a/node_modules/mongodb/lib/operations/eval.js.map b/node_modules/mongodb/lib/operations/eval.js.map new file mode 100644 index 000000000..de1692de4 --- /dev/null +++ b/node_modules/mongodb/lib/operations/eval.js.map @@ -0,0 +1 @@ +{"version":3,"file":"eval.js","sourceRoot":"","sources":["../../src/operations/eval.ts"],"names":[],"mappings":";;;AAAA,kCAAyC;AAGzC,oCAA4C;AAC5C,wDAAoD;AAIpD,uCAAsE;AAOtE,gBAAgB;AAChB,MAAa,aAAc,SAAQ,0BAA0B;IAK3D,YACE,EAAmB,EACnB,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sBAAsB;QACtB,KAAK,CAAC,cAAc,CAAC,MAAM,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,EAAE;YACzD,IAAI,GAAG;gBAAE,OAAO,QAAQ,CAAC,GAAG,CAAC,CAAC;YAC9B,IAAI,MAAM,IAAI,MAAM,CAAC,EAAE,KAAK,CAAC,EAAE;gBAC7B,OAAO,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC;aAC3C;YAED,IAAI,MAAM,EAAE;gBACV,QAAQ,CAAC,IAAI,wBAAgB,CAAC,EAAE,OAAO,EAAE,gBAAgB,MAAM,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,CAAC;gBAC7E,OAAO;aACR;YAED,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;QACxB,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AAjED,sCAiEC"} \ No newline at end of file diff --git a/node_modules/mongodb/lib/operations/execute_operation.js b/node_modules/mongodb/lib/operations/execute_operation.js new file mode 100644 index 000000000..5cd49f341 --- /dev/null +++ b/node_modules/mongodb/lib/operations/execute_operation.js @@ -0,0 +1,176 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.executeOperation = void 0; +const error_1 = require("../error"); +const read_preference_1 = require("../read_preference"); +const server_selection_1 = require("../sdam/server_selection"); +const utils_1 = require("../utils"); +const operation_1 = require("./operation"); +const MMAPv1_RETRY_WRITES_ERROR_CODE = error_1.MONGODB_ERROR_CODES.IllegalOperation; +const MMAPv1_RETRY_WRITES_ERROR_MESSAGE = 'This MongoDB deployment does not support retryable writes. Please add retryWrites=false to your connection string.'; +function executeOperation(client, operation, callback) { + if (!(operation instanceof operation_1.AbstractOperation)) { + // TODO(NODE-3483): Extend MongoRuntimeError + throw new error_1.MongoRuntimeError('This method requires a valid operation instance'); + } + return (0, utils_1.maybePromise)(callback, callback => { + const topology = client.topology; + if (topology == null) { + if (client.s.hasBeenClosed) { + return callback(new error_1.MongoNotConnectedError('Client must be connected before running operations')); + } + client.s.options[Symbol.for('@@mdb.skipPingOnConnect')] = true; + return client.connect(error => { + delete client.s.options[Symbol.for('@@mdb.skipPingOnConnect')]; + if (error) { + return callback(error); + } + return executeOperation(client, operation, callback); + }); + } + if (topology.shouldCheckForSessionSupport()) { + return topology.selectServer(read_preference_1.ReadPreference.primaryPreferred, {}, err => { + if (err) + return callback(err); + executeOperation(client, operation, callback); + }); + } + // The driver sessions spec mandates that we implicitly create sessions for operations + // that are not explicitly provided with a session. + let session = operation.session; + let owner; + if (topology.hasSessionSupport()) { + if (session == null) { + owner = Symbol(); + session = topology.startSession({ owner, explicit: false }); + } + else if (session.hasEnded) { + return callback(new error_1.MongoExpiredSessionError('Use of expired sessions is not permitted')); + } + else if (session.snapshotEnabled && !topology.capabilities.supportsSnapshotReads) { + return callback(new error_1.MongoCompatibilityError('Snapshot reads require MongoDB 5.0 or later')); + } + } + else if (session) { + // If the user passed an explicit session and we are still, after server selection, + // trying to run against a topology that doesn't support sessions we error out. + return callback(new error_1.MongoCompatibilityError('Current topology does not support sessions')); + } + try { + executeWithServerSelection(topology, session, operation, (error, result) => { + if ((session === null || session === void 0 ? void 0 : session.owner) != null && session.owner === owner) { + return session.endSession(endSessionError => callback(endSessionError !== null && endSessionError !== void 0 ? endSessionError : error, result)); + } + callback(error, result); + }); + } + catch (error) { + if ((session === null || session === void 0 ? void 0 : session.owner) != null && session.owner === owner) { + session.endSession(); + } + throw error; + } + }); +} +exports.executeOperation = executeOperation; +function executeWithServerSelection(topology, session, operation, callback) { + var _a, _b; + const readPreference = (_a = operation.readPreference) !== null && _a !== void 0 ? _a : read_preference_1.ReadPreference.primary; + const inTransaction = !!(session === null || session === void 0 ? void 0 : session.inTransaction()); + if (inTransaction && !readPreference.equals(read_preference_1.ReadPreference.primary)) { + return callback(new error_1.MongoTransactionError(`Read preference in a transaction must be primary, not: ${readPreference.mode}`)); + } + if ((session === null || session === void 0 ? void 0 : session.isPinned) && session.transaction.isCommitted && !operation.bypassPinningCheck) { + session.unpin(); + } + let selector; + if (operation.hasAspect(operation_1.Aspect.CURSOR_ITERATING)) { + // Get more operations must always select the same server, but run through + // server selection to potentially force monitor checks if the server is + // in an unknown state. + selector = (0, server_selection_1.sameServerSelector)((_b = operation.server) === null || _b === void 0 ? void 0 : _b.description); + } + else if (operation.trySecondaryWrite) { + // If operation should try to write to secondary use the custom server selector + // otherwise provide the read preference. + selector = (0, server_selection_1.secondaryWritableServerSelector)(topology.commonWireVersion, readPreference); + } + else { + selector = readPreference; + } + const serverSelectionOptions = { session }; + function retryOperation(originalError) { + const isWriteOperation = operation.hasAspect(operation_1.Aspect.WRITE_OPERATION); + const isReadOperation = operation.hasAspect(operation_1.Aspect.READ_OPERATION); + if (isWriteOperation && originalError.code === MMAPv1_RETRY_WRITES_ERROR_CODE) { + return callback(new error_1.MongoServerError({ + message: MMAPv1_RETRY_WRITES_ERROR_MESSAGE, + errmsg: MMAPv1_RETRY_WRITES_ERROR_MESSAGE, + originalError + })); + } + if (isWriteOperation && !(0, error_1.isRetryableWriteError)(originalError)) { + return callback(originalError); + } + if (isReadOperation && !(0, error_1.isRetryableReadError)(originalError)) { + return callback(originalError); + } + if (originalError instanceof error_1.MongoNetworkError && + (session === null || session === void 0 ? void 0 : session.isPinned) && + !session.inTransaction() && + operation.hasAspect(operation_1.Aspect.CURSOR_CREATING)) { + // If we have a cursor and the initial command fails with a network error, + // we can retry it on another connection. So we need to check it back in, clear the + // pool for the service id, and retry again. + session.unpin({ force: true, forceClear: true }); + } + // select a new server, and attempt to retry the operation + topology.selectServer(selector, serverSelectionOptions, (error, server) => { + if (!error && isWriteOperation && !(0, utils_1.supportsRetryableWrites)(server)) { + return callback(new error_1.MongoUnexpectedServerResponseError('Selected server does not support retryable writes')); + } + if (error || !server) { + return callback(error !== null && error !== void 0 ? error : new error_1.MongoUnexpectedServerResponseError('Server selection failed without error')); + } + operation.execute(server, session, callback); + }); + } + if (readPreference && + !readPreference.equals(read_preference_1.ReadPreference.primary) && + (session === null || session === void 0 ? void 0 : session.inTransaction())) { + callback(new error_1.MongoTransactionError(`Read preference in a transaction must be primary, not: ${readPreference.mode}`)); + return; + } + // select a server, and execute the operation against it + topology.selectServer(selector, serverSelectionOptions, (error, server) => { + if (error || !server) { + return callback(error); + } + if (session && operation.hasAspect(operation_1.Aspect.RETRYABLE)) { + const willRetryRead = topology.s.options.retryReads && !inTransaction && operation.canRetryRead; + const willRetryWrite = topology.s.options.retryWrites && + !inTransaction && + (0, utils_1.supportsRetryableWrites)(server) && + operation.canRetryWrite; + const hasReadAspect = operation.hasAspect(operation_1.Aspect.READ_OPERATION); + const hasWriteAspect = operation.hasAspect(operation_1.Aspect.WRITE_OPERATION); + if ((hasReadAspect && willRetryRead) || (hasWriteAspect && willRetryWrite)) { + if (hasWriteAspect && willRetryWrite) { + operation.options.willRetryWrite = true; + session.incrementTransactionNumber(); + } + return operation.execute(server, session, (error, result) => { + if (error instanceof error_1.MongoError) { + return retryOperation(error); + } + else if (error) { + return callback(error); + } + callback(undefined, result); + }); + } + } + return operation.execute(server, session, callback); + }); +} +//# sourceMappingURL=execute_operation.js.map \ No newline at end of file diff --git a/node_modules/mongodb/lib/operations/execute_operation.js.map b/node_modules/mongodb/lib/operations/execute_operation.js.map new file mode 100644 index 000000000..caad823d2 --- /dev/null +++ b/node_modules/mongodb/lib/operations/execute_operation.js.map @@ -0,0 +1 @@ +{"version":3,"file":"execute_operation.js","sourceRoot":"","sources":["../../src/operations/execute_operation.ts"],"names":[],"mappings":";;;AACA,oCAakB;AAElB,wDAAoD;AAEpD,+DAIkC;AAGlC,oCAA2E;AAC3E,2CAAwD;AAExD,MAAM,8BAA8B,GAAG,2BAAmB,CAAC,gBAAgB,CAAC;AAC5E,MAAM,iCAAiC,GACrC,oHAAoH,CAAC;AA2CvH,SAAgB,gBAAgB,CAG9B,MAAmB,EAAE,SAAY,EAAE,QAA4B;IAC/D,IAAI,CAAC,CAAC,S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,CAAC,CAAC;YAEnE,IAAI,CAAC,aAAa,IAAI,aAAa,CAAC,IAAI,CAAC,cAAc,IAAI,cAAc,CAAC,EAAE;gBAC1E,IAAI,cAAc,IAAI,cAAc,EAAE;oBACpC,SAAS,CAAC,OAAO,CAAC,cAAc,GAAG,IAAI,CAAC;oBACxC,OAAO,CAAC,0BAA0B,EAAE,CAAC;iBACtC;gBAED,OAAO,SAAS,CAAC,OAAO,CAAC,MAAM,EAAE,OAAO,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE;oBAC1D,IAAI,KAAK,YAAY,kBAAU,EAAE;wBAC/B,OAAO,cAAc,CAAC,KAAK,CAAC,CAAC;qBAC9B;yBAAM,IAAI,KAAK,EAAE;wBAChB,OAAO,QAAQ,CAAC,KAAK,CAAC,CAAC;qBACxB;oBACD,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;gBAC9B,CAAC,CAAC,CAAC;aACJ;SACF;QAED,OAAO,SAAS,CAAC,OAAO,CAAC,MAAM,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;IACtD,CAAC,CAAC,CAAC;AACL,CAAC"} \ No newline at end of file diff --git a/node_modules/mongodb/lib/operations/find.js b/node_modules/mongodb/lib/operations/find.js new file mode 100644 index 000000000..f961909f3 --- /dev/null +++ b/node_modules/mongodb/lib/operations/find.js @@ -0,0 +1,162 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.FindOperation = void 0; +const error_1 = require("../error"); +const read_concern_1 = require("../read_concern"); +const sort_1 = require("../sort"); +const utils_1 = require("../utils"); +const command_1 = require("./command"); +const operation_1 = require("./operation"); +const SUPPORTS_WRITE_CONCERN_AND_COLLATION = 5; +/** @internal */ +class FindOperation extends command_1.CommandOperation { + constructor(collection, ns, filter = {}, options = {}) { + super(collection, options); + this.options = options; + this.ns = ns; + if (typeof filter !== 'object' || Array.isArray(filter)) { + throw new error_1.MongoInvalidArgumentError('Query filter must be a plain object or ObjectId'); + } + // If the filter is a buffer, validate that is a valid BSON document + if (Buffer.isBuffer(filter)) { + const objectSize = filter[0] | (filter[1] << 8) | (filter[2] << 16) | (filter[3] << 24); + if (objectSize !== filter.length) { + throw new error_1.MongoInvalidArgumentError(`Query filter raw message size does not match message header size [${filter.length}] != [${objectSize}]`); + } + } + // special case passing in an ObjectId as a filter + this.filter = filter != null && filter._bsontype === 'ObjectID' ? { _id: filter } : filter; + } + execute(server, session, callback) { + this.server = server; + const serverWireVersion = (0, utils_1.maxWireVersion)(server); + const options = this.options; + if (options.allowDiskUse != null && serverWireVersion < 4) { + callback(new error_1.MongoCompatibilityError('Option "allowDiskUse" is not supported on MongoDB < 3.2')); + return; + } + if (options.collation && serverWireVersion < SUPPORTS_WRITE_CONCERN_AND_COLLATION) { + callback(new error_1.MongoCompatibilityError(`Server ${server.name}, which reports wire version ${serverWireVersion}, does not support collation`)); + return; + } + let findCommand = makeFindCommand(this.ns, this.filter, options); + if (this.explain) { + findCommand = (0, utils_1.decorateWithExplain)(findCommand, this.explain); + } + server.command(this.ns, findCommand, { + ...this.options, + ...this.bsonOptions, + documentsReturnedIn: 'firstBatch', + session + }, callback); + } +} +exports.FindOperation = FindOperation; +function makeFindCommand(ns, filter, options) { + const findCommand = { + find: ns.collection, + filter + }; + if (options.sort) { + findCommand.sort = (0, sort_1.formatSort)(options.sort); + } + if (options.projection) { + let projection = options.projection; + if (projection && Array.isArray(projection)) { + projection = projection.length + ? projection.reduce((result, field) => { + result[field] = 1; + return result; + }, {}) + : { _id: 1 }; + } + findCommand.projection = projection; + } + if (options.hint) { + findCommand.hint = (0, utils_1.normalizeHintField)(options.hint); + } + if (typeof options.skip === 'number') { + findCommand.skip = options.skip; + } + if (typeof options.limit === 'number') { + if (options.limit < 0) { + findCommand.limit = -options.limit; + findCommand.singleBatch = true; + } + else { + findCommand.limit = options.limit; + } + } + if (typeof options.batchSize === 'number') { + if (options.batchSize < 0) { + if (options.limit && + options.limit !== 0 && + Math.abs(options.batchSize) < Math.abs(options.limit)) { + findCommand.limit = -options.batchSize; + } + findCommand.singleBatch = true; + } + else { + findCommand.batchSize = options.batchSize; + } + } + if (typeof options.singleBatch === 'boolean') { + findCommand.singleBatch = options.singleBatch; + } + // we check for undefined specifically here to allow falsy values + // eslint-disable-next-line no-restricted-syntax + if (options.comment !== undefined) { + findCommand.comment = options.comment; + } + if (typeof options.maxTimeMS === 'number') { + findCommand.maxTimeMS = options.maxTimeMS; + } + const readConcern = read_concern_1.ReadConcern.fromOptions(options); + if (readConcern) { + findCommand.readConcern = readConcern.toJSON(); + } + if (options.max) { + findCommand.max = options.max; + } + if (options.min) { + findCommand.min = options.min; + } + if (typeof options.returnKey === 'boolean') { + findCommand.returnKey = options.returnKey; + } + if (typeof options.showRecordId === 'boolean') { + findCommand.showRecordId = options.showRecordId; + } + if (typeof options.tailable === 'boolean') { + findCommand.tailable = options.tailable; + } + if (typeof options.timeout === 'boolean') { + findCommand.noCursorTimeout = !options.timeout; + } + else if (typeof options.noCursorTimeout === 'boolean') { + findCommand.noCursorTimeout = options.noCursorTimeout; + } + if (typeof options.awaitData === 'boolean') { + findCommand.awaitData = options.awaitData; + } + if (typeof options.allowPartialResults === 'boolean') { + findCommand.allowPartialResults = options.allowPartialResults; + } + if (options.collation) { + findCommand.collation = options.collation; + } + if (typeof options.allowDiskUse === 'boolean') { + findCommand.allowDiskUse = options.allowDiskUse; + } + if (options.let) { + findCommand.let = options.let; + } + return findCommand; +} +(0, operation_1.defineAspects)(FindOperation, [ + operation_1.Aspect.READ_OPERATION, + operation_1.Aspect.RETRYABLE, + operation_1.Aspect.EXPLAINABLE, + operation_1.Aspect.CURSOR_CREATING +]); +//# sourceMappingURL=find.js.map \ No newline at end of file diff --git a/node_modules/mongodb/lib/operations/find.js.map b/node_modules/mongodb/lib/operations/find.js.map new file mode 100644 index 000000000..d8b587edc --- /dev/null +++ b/node_modules/mongodb/lib/operations/find.js.map @@ -0,0 +1 @@ +{"version":3,"file":"find.js","sourceRoot":"","sources":["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,OAAO,CAAC,QAAQ,CAAC;KACzC;IAED,IAAI,OAAO,OAAO,CAAC,OAAO,KAAK,SAAS,EAAE;QACxC,WAAW,CAAC,eAAe,GAAG,CAAC,OAAO,CAAC,OAAO,CAAC;KAChD;SAAM,IAAI,OAAO,OAAO,CAAC,eAAe,KAAK,SAAS,EAAE;QACvD,WAAW,CAAC,eAAe,GAAG,OAAO,CAAC,eAAe,CAAC;KACvD;IAED,IAAI,OAAO,OAAO,CAAC,SAAS,KAAK,SAAS,EAAE;QAC1C,WAAW,CAAC,SAAS,GAAG,OAAO,CAAC,SAAS,CAAC;KAC3C;IAED,IAAI,OAAO,OAAO,CAAC,mBAAmB,KAAK,SAAS,EAAE;QACpD,WAAW,CAAC,mBAAmB,GAAG,OAAO,CAAC,mBAAmB,CAAC;KAC/D;IAED,IAAI,OAAO,CAAC,SAAS,EAAE;QACrB,WAAW,CAAC,SAAS,GAAG,OAAO,CAAC,SAAS,CAAC;KAC3C;IAED,IAAI,OAAO,OAAO,CAAC,YAAY,KAAK,SAAS,EAAE;QAC7C,WAAW,CAAC,YAAY,GAAG,OAAO,CAAC,YAAY,CAAC;KACjD;IAED,IAAI,OAAO,CAAC,GAAG,EAAE;QACf,WAAW,CAAC,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC;KAC/B;IAED,OAAO,WAAW,CAAC;AACrB,CAAC;AAED,IAAA,yBAAa,EAAC,aAAa,EAAE;IAC3B,kBAAM,CAAC,cAAc;IACrB,kBAAM,CAAC,SAAS;IAChB,kBAAM,CAAC,WAAW;IAClB,kBAAM,CAAC,eAAe;CACvB,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/mongodb/lib/operations/find_and_modify.js b/node_modules/mongodb/lib/operations/find_and_modify.js new file mode 100644 index 000000000..525bdc692 --- /dev/null +++ b/node_modules/mongodb/lib/operations/find_and_modify.js @@ -0,0 +1,156 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.FindOneAndUpdateOperation = exports.FindOneAndReplaceOperation = exports.FindOneAndDeleteOperation = exports.ReturnDocument = void 0; +const error_1 = require("../error"); +const read_preference_1 = require("../read_preference"); +const sort_1 = require("../sort"); +const utils_1 = require("../utils"); +const command_1 = require("./command"); +const operation_1 = require("./operation"); +/** @public */ +exports.ReturnDocument = Object.freeze({ + BEFORE: 'before', + AFTER: 'after' +}); +function configureFindAndModifyCmdBaseUpdateOpts(cmdBase, options) { + cmdBase.new = options.returnDocument === exports.ReturnDocument.AFTER; + cmdBase.upsert = options.upsert === true; + if (options.bypassDocumentValidation === true) { + cmdBase.bypassDocumentValidation = options.bypassDocumentValidation; + } + return cmdBase; +} +/** @internal */ +class FindAndModifyOperation extends command_1.CommandOperation { + constructor(collection, query, options) { + super(collection, options); + this.options = options !== null && options !== void 0 ? options : {}; + this.cmdBase = { + remove: false, + new: false, + upsert: false + }; + const sort = (0, sort_1.formatSort)(options.sort); + if (sort) { + this.cmdBase.sort = sort; + } + if (options.projection) { + this.cmdBase.fields = options.projection; + } + if (options.maxTimeMS) { + this.cmdBase.maxTimeMS = options.maxTimeMS; + } + // Decorate the findAndModify command with the write Concern + if (options.writeConcern) { + this.cmdBase.writeConcern = options.writeConcern; + } + if (options.let) { + this.cmdBase.let = options.let; + } + // we check for undefined specifically here to allow falsy values + // eslint-disable-next-line no-restricted-syntax + if (options.comment !== undefined) { + this.cmdBase.comment = options.comment; + } + // force primary read preference + this.readPreference = read_preference_1.ReadPreference.primary; + this.collection = collection; + this.query = query; + } + execute(server, session, callback) { + var _a; + const coll = this.collection; + const query = this.query; + const options = { ...this.options, ...this.bsonOptions }; + // Create findAndModify command object + const cmd = { + findAndModify: coll.collectionName, + query: query, + ...this.cmdBase + }; + // Have we specified collation + try { + (0, utils_1.decorateWithCollation)(cmd, coll, options); + } + catch (err) { + return callback(err); + } + if (options.hint) { + // TODO: once this method becomes a CommandOperation we will have the server + // in place to check. + const unacknowledgedWrite = ((_a = this.writeConcern) === null || _a === void 0 ? void 0 : _a.w) === 0; + if (unacknowledgedWrite || (0, utils_1.maxWireVersion)(server) < 8) { + callback(new error_1.MongoCompatibilityError('The current topology does not support a hint on findAndModify commands')); + return; + } + cmd.hint = options.hint; + } + if (this.explain && (0, utils_1.maxWireVersion)(server) < 4) { + callback(new error_1.MongoCompatibilityError(`Server ${server.name} does not support explain on findAndModify`)); + return; + } + // Execute the command + super.executeCommand(server, session, cmd, (err, result) => { + if (err) + return callback(err); + return callback(undefined, result); + }); + } +} +/** @internal */ +class FindOneAndDeleteOperation extends FindAndModifyOperation { + constructor(collection, filter, options) { + // Basic validation + if (filter == null || typeof filter !== 'object') { + throw new error_1.MongoInvalidArgumentError('Argument "filter" must be an object'); + } + super(collection, filter, options); + this.cmdBase.remove = true; + } +} +exports.FindOneAndDeleteOperation = FindOneAndDeleteOperation; +/** @internal */ +class FindOneAndReplaceOperation extends FindAndModifyOperation { + constructor(collection, filter, replacement, options) { + if (filter == null || typeof filter !== 'object') { + throw new error_1.MongoInvalidArgumentError('Argument "filter" must be an object'); + } + if (replacement == null || typeof replacement !== 'object') { + throw new error_1.MongoInvalidArgumentError('Argument "replacement" must be an object'); + } + if ((0, utils_1.hasAtomicOperators)(replacement)) { + throw new error_1.MongoInvalidArgumentError('Replacement document must not contain atomic operators'); + } + super(collection, filter, options); + this.cmdBase.update = replacement; + configureFindAndModifyCmdBaseUpdateOpts(this.cmdBase, options); + } +} +exports.FindOneAndReplaceOperation = FindOneAndReplaceOperation; +/** @internal */ +class FindOneAndUpdateOperation extends FindAndModifyOperation { + constructor(collection, filter, update, options) { + if (filter == null || typeof filter !== 'object') { + throw new error_1.MongoInvalidArgumentError('Argument "filter" must be an object'); + } + if (update == null || typeof update !== 'object') { + throw new error_1.MongoInvalidArgumentError('Argument "update" must be an object'); + } + if (!(0, utils_1.hasAtomicOperators)(update)) { + throw new error_1.MongoInvalidArgumentError('Update document requires atomic operators'); + } + super(collection, filter, options); + this.cmdBase.update = update; + configureFindAndModifyCmdBaseUpdateOpts(this.cmdBase, options); + if (options.arrayFilters) { + this.cmdBase.arrayFilters = options.arrayFilters; + } + } +} +exports.FindOneAndUpdateOperation = FindOneAndUpdateOperation; +(0, operation_1.defineAspects)(FindAndModifyOperation, [ + operation_1.Aspect.WRITE_OPERATION, + operation_1.Aspect.RETRYABLE, + operation_1.Aspect.EXPLAINABLE +]); +//# sourceMappingURL=find_and_modify.js.map \ No newline at end of file diff --git a/node_modules/mongodb/lib/operations/find_and_modify.js.map b/node_modules/mongodb/lib/operations/find_and_modify.js.map new file mode 100644 index 000000000..2d6262aff --- /dev/null +++ b/node_modules/mongodb/lib/operations/find_and_modify.js.map @@ -0,0 +1 @@ +{"version":3,"file":"find_and_modify.js","sourceRoot":"","sources":["../../src/operations/find_and_modify.ts"],"names":[],"mappings":";;;AAEA,oCAA8E;AAC9E,wDAAoD;AAGpD,kCAAuD;AACvD,oCAA+F;AAE/F,uCAAsE;AACtE,2CAAoD;AAEpD,cAAc;AACD,QAAA,cAAc,GAAG,MAAM,CAAC,MAAM,CAAC;IAC1C,MAAM,EAAE,QAAQ;IAChB,KAAK,EAAE,OAAO;CACN,CAAC,CAAC;AA+EZ,SAAS,uCAAuC,CAC9C,OAA6B,EAC7B,OAA2D;IAE3D,OAAO,CAAC,GAAG,GAAG,OAAO,CAAC,cAAc,KAAK,sBAAc,CAAC,KAAK,CAAC;IAC9D,OAAO,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,KAAK,IAAI,CAAC;IAEzC,IAAI,OAAO,CAAC,wBAAwB,KAAK,IAAI,EAAE;QAC7C,OAAO,CAAC,wBAAwB,GAAG,OAAO,CAAC,wBAAwB,CAAC;KACrE;IACD,OAAO,OAAO,CAAC;AACjB,CAAC;AAED,gBAAgB;AAChB,MAAM,sBAAuB,SAAQ,0BAA0B;IAO7D,YACE,UAAsB,EACtB,KAAe,EACf,OAAqF;QAErF,KAAK,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;QAC3B,IAAI,CAAC,OAAO,GAAG,OAAO,aAAP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AE;YAChD,MAAM,IAAI,iCAAyB,CAAC,qCAAqC,CAAC,CAAC;SAC5E;QAED,IAAI,MAAM,IAAI,IAAI,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE;YAChD,MAAM,IAAI,iCAAyB,CAAC,qCAAqC,CAAC,CAAC;SAC5E;QAED,IAAI,CAAC,IAAA,0BAAkB,EAAC,MAAM,CAAC,EAAE;YAC/B,MAAM,IAAI,iCAAyB,CAAC,2CAA2C,CAAC,CAAC;SAClF;QAED,KAAK,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;QACnC,IAAI,CAAC,OAAO,CAAC,MAAM,GAAG,MAAM,CAAC;QAC7B,uCAAuC,CAAC,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QAE/D,IAAI,OAAO,CAAC,YAAY,EAAE;YACxB,IAAI,CAAC,OAAO,CAAC,YAAY,GAAG,OAAO,CAAC,YAAY,CAAC;SAClD;IACH,CAAC;CACF;AA3BD,8DA2BC;AAED,IAAA,yBAAa,EAAC,sBAAsB,EAAE;IACpC,kBAAM,CAAC,eAAe;IACtB,kBAAM,CAAC,SAAS;IAChB,kBAAM,CAAC,WAAW;CACnB,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/mongodb/lib/operations/get_more.js b/node_modules/mongodb/lib/operations/get_more.js new file mode 100644 index 000000000..c1a8bf636 --- /dev/null +++ b/node_modules/mongodb/lib/operations/get_more.js @@ -0,0 +1,33 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.GetMoreOperation = void 0; +const error_1 = require("../error"); +const utils_1 = require("../utils"); +const operation_1 = require("./operation"); +/** @internal */ +class GetMoreOperation extends operation_1.AbstractOperation { + constructor(ns, cursorId, server, options = {}) { + super(options); + this.options = options; + // comment on getMore is only supported for server versions 4.4 and above + if ((0, utils_1.maxWireVersion)(server) < 9) { + delete this.options.comment; + } + this.ns = ns; + this.cursorId = cursorId; + this.server = server; + } + /** + * Although there is a server already associated with the get more operation, the signature + * for execute passes a server so we will just use that one. + */ + execute(server, session, callback) { + if (server !== this.server) { + return callback(new error_1.MongoRuntimeError('Getmore must run on the same server operation began on')); + } + server.getMore(this.ns, this.cursorId, this.options, callback); + } +} +exports.GetMoreOperation = GetMoreOperation; +(0, operation_1.defineAspects)(GetMoreOperation, [operation_1.Aspect.READ_OPERATION, operation_1.Aspect.CURSOR_ITERATING]); +//# sourceMappingURL=get_more.js.map \ No newline at end of file diff --git a/node_modules/mongodb/lib/operations/get_more.js.map b/node_modules/mongodb/lib/operations/get_more.js.map new file mode 100644 index 000000000..c9199200a --- /dev/null +++ b/node_modules/mongodb/lib/operations/get_more.js.map @@ -0,0 +1 @@ +{"version":3,"file":"get_more.js","sourceRoot":"","sources":["../../src/operations/get_more.ts"],"names":[],"mappings":";;;AACA,oCAA6C;AAG7C,oCAAsE;AACtE,2CAAyF;AAmBzF,gBAAgB;AAChB,MAAa,gBAAiB,SAAQ,6BAAiB;IAIrD,YAAY,EAAoB,EAAE,QAAc,EAAE,MAAc,EAAE,UAA0B,EAAE;QAC5F,KAAK,CAAC,OAAO,CAAC,CAAC;QAEf,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QAEvB,yEAAyE;QACzE,IAAI,IAAA,sBAAc,EAAC,MAAM,CAAC,GAAG,CAAC,EAAE;YAC9B,OAAO,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC;SAC7B;QAED,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC;QACb,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED;;;OAGG;IACM,OAAO,CACd,MAAc,EACd,OAAkC,EAClC,QAA4B;QAE5B,IAAI,MAAM,KAAK,IAAI,CAAC,MAAM,EAAE;YAC1B,OAAO,QAAQ,CACb,IAAI,yBAAiB,CAAC,wDAAwD,CAAC,CAChF,CAAC;SACH;QACD,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,EAAE,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;IACjE,CAAC;CACF;AAnCD,4CAmCC;AAED,IAAA,yBAAa,EAAC,gBAAgB,EAAE,CAAC,kBAAM,CAAC,cAAc,EAAE,kBAAM,CAAC,gBAAgB,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/mongodb/lib/operations/indexes.js b/node_modules/mongodb/lib/operations/indexes.js new file mode 100644 index 000000000..73f87d2bc --- /dev/null +++ b/node_modules/mongodb/lib/operations/indexes.js @@ -0,0 +1,296 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.IndexInformationOperation = exports.IndexExistsOperation = exports.ListIndexesCursor = exports.ListIndexesOperation = exports.DropIndexesOperation = exports.DropIndexOperation = exports.EnsureIndexOperation = exports.CreateIndexOperation = exports.CreateIndexesOperation = exports.IndexesOperation = void 0; +const abstract_cursor_1 = require("../cursor/abstract_cursor"); +const error_1 = require("../error"); +const read_preference_1 = require("../read_preference"); +const utils_1 = require("../utils"); +const command_1 = require("./command"); +const common_functions_1 = require("./common_functions"); +const execute_operation_1 = require("./execute_operation"); +const operation_1 = require("./operation"); +const VALID_INDEX_OPTIONS = new Set([ + 'background', + 'unique', + 'name', + 'partialFilterExpression', + 'sparse', + 'hidden', + 'expireAfterSeconds', + 'storageEngine', + 'collation', + 'version', + // text indexes + 'weights', + 'default_language', + 'language_override', + 'textIndexVersion', + // 2d-sphere indexes + '2dsphereIndexVersion', + // 2d indexes + 'bits', + 'min', + 'max', + // geoHaystack Indexes + 'bucketSize', + // wildcard indexes + 'wildcardProjection' +]); +function makeIndexSpec(indexSpec, options) { + const indexParameters = (0, utils_1.parseIndexOptions)(indexSpec); + // Generate the index name + const name = typeof options.name === 'string' ? options.name : indexParameters.name; + // Set up the index + const finalIndexSpec = { name, key: indexParameters.fieldHash }; + // merge valid index options into the index spec + for (const optionName in options) { + if (VALID_INDEX_OPTIONS.has(optionName)) { + finalIndexSpec[optionName] = options[optionName]; + } + } + return finalIndexSpec; +} +/** @internal */ +class IndexesOperation extends operation_1.AbstractOperation { + constructor(collection, options) { + super(options); + this.options = options; + this.collection = collection; + } + execute(server, session, callback) { + const coll = this.collection; + const options = this.options; + (0, common_functions_1.indexInformation)(coll.s.db, coll.collectionName, { full: true, ...options, readPreference: this.readPreference, session }, callback); + } +} +exports.IndexesOperation = IndexesOperation; +/** @internal */ +class CreateIndexesOperation extends command_1.CommandOperation { + constructor(parent, collectionName, indexes, options) { + super(parent, options); + this.options = options !== null && options !== void 0 ? options : {}; + this.collectionName = collectionName; + this.indexes = indexes; + } + execute(server, session, callback) { + const options = this.options; + const indexes = this.indexes; + const serverWireVersion = (0, utils_1.maxWireVersion)(server); + // Ensure we generate the correct name if the parameter is not set + for (let i = 0; i < indexes.length; i++) { + // Did the user pass in a collation, check if our write server supports it + if (indexes[i].collation && serverWireVersion < 5) { + callback(new error_1.MongoCompatibilityError(`Server ${server.name}, which reports wire version ${serverWireVersion}, ` + + 'does not support collation')); + return; + } + if (indexes[i].name == null) { + const keys = []; + for (const name in indexes[i].key) { + keys.push(`${name}_${indexes[i].key[name]}`); + } + // Set the name + indexes[i].name = keys.join('_'); + } + } + const cmd = { createIndexes: this.collectionName, indexes }; + if (options.commitQuorum != null) { + if (serverWireVersion < 9) { + callback(new error_1.MongoCompatibilityError('Option `commitQuorum` for `createIndexes` not supported on servers < 4.4')); + return; + } + cmd.commitQuorum = options.commitQuorum; + } + // collation is set on each index, it should not be defined at the root + this.options.collation = undefined; + super.executeCommand(server, session, cmd, err => { + if (err) { + callback(err); + return; + } + const indexNames = indexes.map(index => index.name || ''); + callback(undefined, indexNames); + }); + } +} +exports.CreateIndexesOperation = CreateIndexesOperation; +/** @internal */ +class CreateIndexOperation extends CreateIndexesOperation { + constructor(parent, collectionName, indexSpec, options) { + // createIndex can be called with a variety of styles: + // coll.createIndex('a'); + // coll.createIndex({ a: 1 }); + // coll.createIndex([['a', 1]]); + // createIndexes is always called with an array of index spec objects + super(parent, collectionName, [makeIndexSpec(indexSpec, options)], options); + } + execute(server, session, callback) { + super.execute(server, session, (err, indexNames) => { + if (err || !indexNames) + return callback(err); + return callback(undefined, indexNames[0]); + }); + } +} +exports.CreateIndexOperation = CreateIndexOperation; +/** @internal */ +class EnsureIndexOperation extends CreateIndexOperation { + constructor(db, collectionName, indexSpec, options) { + super(db, collectionName, indexSpec, options); + this.readPreference = read_preference_1.ReadPreference.primary; + this.db = db; + this.collectionName = collectionName; + } + execute(server, session, callback) { + const indexName = this.indexes[0].name; + const cursor = this.db.collection(this.collectionName).listIndexes({ session }); + cursor.toArray((err, indexes) => { + /// ignore "NamespaceNotFound" errors + if (err && err.code !== error_1.MONGODB_ERROR_CODES.NamespaceNotFound) { + return callback(err); + } + if (indexes) { + indexes = Array.isArray(indexes) ? indexes : [indexes]; + if (indexes.some(index => index.name === indexName)) { + callback(undefined, indexName); + return; + } + } + super.execute(server, session, callback); + }); + } +} +exports.EnsureIndexOperation = EnsureIndexOperation; +/** @internal */ +class DropIndexOperation extends command_1.CommandOperation { + constructor(collection, indexName, options) { + super(collection, options); + this.options = options !== null && options !== void 0 ? options : {}; + this.collection = collection; + this.indexName = indexName; + } + execute(server, session, callback) { + const cmd = { dropIndexes: this.collection.collectionName, index: this.indexName }; + super.executeCommand(server, session, cmd, callback); + } +} +exports.DropIndexOperation = DropIndexOperation; +/** @internal */ +class DropIndexesOperation extends DropIndexOperation { + constructor(collection, options) { + super(collection, '*', options); + } + execute(server, session, callback) { + super.execute(server, session, err => { + if (err) + return callback(err, false); + callback(undefined, true); + }); + } +} +exports.DropIndexesOperation = DropIndexesOperation; +/** @internal */ +class ListIndexesOperation extends command_1.CommandOperation { + constructor(collection, options) { + super(collection, options); + this.options = options !== null && options !== void 0 ? options : {}; + this.collectionNamespace = collection.s.namespace; + } + execute(server, session, callback) { + const serverWireVersion = (0, utils_1.maxWireVersion)(server); + const cursor = this.options.batchSize ? { batchSize: this.options.batchSize } : {}; + const command = { listIndexes: this.collectionNamespace.collection, cursor }; + // we check for undefined specifically here to allow falsy values + // eslint-disable-next-line no-restricted-syntax + if (serverWireVersion >= 9 && this.options.comment !== undefined) { + command.comment = this.options.comment; + } + super.executeCommand(server, session, command, callback); + } +} +exports.ListIndexesOperation = ListIndexesOperation; +/** @public */ +class ListIndexesCursor extends abstract_cursor_1.AbstractCursor { + constructor(collection, options) { + super(collection.s.db.s.client, collection.s.namespace, options); + this.parent = collection; + this.options = options; + } + clone() { + return new ListIndexesCursor(this.parent, { + ...this.options, + ...this.cursorOptions + }); + } + /** @internal */ + _initialize(session, callback) { + const operation = new ListIndexesOperation(this.parent, { + ...this.cursorOptions, + ...this.options, + session + }); + (0, execute_operation_1.executeOperation)(this.parent.s.db.s.client, operation, (err, response) => { + if (err || response == null) + return callback(err); + // TODO: NODE-2882 + callback(undefined, { server: operation.server, session, response }); + }); + } +} +exports.ListIndexesCursor = ListIndexesCursor; +/** @internal */ +class IndexExistsOperation extends operation_1.AbstractOperation { + constructor(collection, indexes, options) { + super(options); + this.options = options; + this.collection = collection; + this.indexes = indexes; + } + execute(server, session, callback) { + const coll = this.collection; + const indexes = this.indexes; + (0, common_functions_1.indexInformation)(coll.s.db, coll.collectionName, { ...this.options, readPreference: this.readPreference, session }, (err, indexInformation) => { + // If we have an error return + if (err != null) + return callback(err); + // Let's check for the index names + if (!Array.isArray(indexes)) + return callback(undefined, indexInformation[indexes] != null); + // Check in list of indexes + for (let i = 0; i < indexes.length; i++) { + if (indexInformation[indexes[i]] == null) { + return callback(undefined, false); + } + } + // All keys found return true + return callback(undefined, true); + }); + } +} +exports.IndexExistsOperation = IndexExistsOperation; +/** @internal */ +class IndexInformationOperation extends operation_1.AbstractOperation { + constructor(db, name, options) { + super(options); + this.options = options !== null && options !== void 0 ? options : {}; + this.db = db; + this.name = name; + } + execute(server, session, callback) { + const db = this.db; + const name = this.name; + (0, common_functions_1.indexInformation)(db, name, { ...this.options, readPreference: this.readPreference, session }, callback); + } +} +exports.IndexInformationOperation = IndexInformationOperation; +(0, operation_1.defineAspects)(ListIndexesOperation, [ + operation_1.Aspect.READ_OPERATION, + operation_1.Aspect.RETRYABLE, + operation_1.Aspect.CURSOR_CREATING +]); +(0, operation_1.defineAspects)(CreateIndexesOperation, [operation_1.Aspect.WRITE_OPERATION]); +(0, operation_1.defineAspects)(CreateIndexOperation, [operation_1.Aspect.WRITE_OPERATION]); +(0, operation_1.defineAspects)(EnsureIndexOperation, [operation_1.Aspect.WRITE_OPERATION]); +(0, operation_1.defineAspects)(DropIndexOperation, [operation_1.Aspect.WRITE_OPERATION]); +(0, operation_1.defineAspects)(DropIndexesOperation, [operation_1.Aspect.WRITE_OPERATION]); +//# sourceMappingURL=indexes.js.map \ No newline at end of file diff --git a/node_modules/mongodb/lib/operations/indexes.js.map b/node_modules/mongodb/lib/operations/indexes.js.map new file mode 100644 index 000000000..07dfd9074 --- /dev/null +++ b/node_modules/mongodb/lib/operations/indexes.js.map @@ -0,0 +1 @@ +{"version":3,"file":"indexes.js","sourceRoot":"","sources":["../../src/operations/indexes.ts"],"names":[],"mappings":";;;AAEA,+DAA2D;AAE3D,oCAA0F;AAE1F,wDAAoD;AAGpD,oCAAyF;AACzF,uCAKmB;AACnB,yDAA+E;AAC/E,2DAAwE;AACxE,2CAAuE;AAEvE,MAAM,mBAAmB,GAAG,IAAI,GAAG,CAAC;IAClC,YAAY;IACZ,QAAQ;IACR,MAAM;IACN,yBAAyB;IACzB,QAAQ;IACR,QAAQ;IACR,oBAAoB;IACpB,eAAe;IACf,WAAW;IACX,SAAS;IAET,eAAe;IACf,SAAS;IACT,kBAAkB;IAClB,mBAAmB;IACnB,kBAAkB;IAElB,oBAAoB;IACpB,sBAAsB;IAEtB,aAAa;IACb,MAAM;IACN,KAAK;IACL,KAAK;IAEL,sBAAsB;IACtB,YAAY;IAEZ,mBAAmB;IACnB,oBAAoB;CACrB,CAAC,CAAC;AAmFH,SAAS,aA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IACnB,CAAC;IAEQ,OAAO,CACd,MAAc,EACd,OAAkC,EAClC,QAA4B;QAE5B,MAAM,EAAE,GAAG,IAAI,CAAC,EAAE,CAAC;QACnB,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;QAEvB,IAAA,mCAAgB,EACd,EAAE,EACF,IAAI,EACJ,EAAE,GAAG,IAAI,CAAC,OAAO,EAAE,cAAc,EAAE,IAAI,CAAC,cAAc,EAAE,OAAO,EAAE,EACjE,QAAQ,CACT,CAAC;IACJ,CAAC;CACF;AA3BD,8DA2BC;AAED,IAAA,yBAAa,EAAC,oBAAoB,EAAE;IAClC,kBAAM,CAAC,cAAc;IACrB,kBAAM,CAAC,SAAS;IAChB,kBAAM,CAAC,eAAe;CACvB,CAAC,CAAC;AACH,IAAA,yBAAa,EAAC,sBAAsB,EAAE,CAAC,kBAAM,CAAC,eAAe,CAAC,CAAC,CAAC;AAChE,IAAA,yBAAa,EAAC,oBAAoB,EAAE,CAAC,kBAAM,CAAC,eAAe,CAAC,CAAC,CAAC;AAC9D,IAAA,yBAAa,EAAC,oBAAoB,EAAE,CAAC,kBAAM,CAAC,eAAe,CAAC,CAAC,CAAC;AAC9D,IAAA,yBAAa,EAAC,kBAAkB,EAAE,CAAC,kBAAM,CAAC,eAAe,CAAC,CAAC,CAAC;AAC5D,IAAA,yBAAa,EAAC,oBAAoB,EAAE,CAAC,kBAAM,CAAC,eAAe,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/mongodb/lib/operations/insert.js b/node_modules/mongodb/lib/operations/insert.js new file mode 100644 index 000000000..aa617b487 --- /dev/null +++ b/node_modules/mongodb/lib/operations/insert.js @@ -0,0 +1,99 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.InsertManyOperation = exports.InsertOneOperation = exports.InsertOperation = void 0; +const error_1 = require("../error"); +const write_concern_1 = require("../write_concern"); +const bulk_write_1 = require("./bulk_write"); +const command_1 = require("./command"); +const common_functions_1 = require("./common_functions"); +const operation_1 = require("./operation"); +/** @internal */ +class InsertOperation extends command_1.CommandOperation { + constructor(ns, documents, options) { + var _a; + super(undefined, options); + this.options = { ...options, checkKeys: (_a = options.checkKeys) !== null && _a !== void 0 ? _a : false }; + this.ns = ns; + this.documents = documents; + } + execute(server, session, callback) { + var _a; + const options = (_a = this.options) !== null && _a !== void 0 ? _a : {}; + const ordered = typeof options.ordered === 'boolean' ? options.ordered : true; + const command = { + insert: this.ns.collection, + documents: this.documents, + ordered + }; + if (typeof options.bypassDocumentValidation === 'boolean') { + command.bypassDocumentValidation = options.bypassDocumentValidation; + } + // we check for undefined specifically here to allow falsy values + // eslint-disable-next-line no-restricted-syntax + if (options.comment !== undefined) { + command.comment = options.comment; + } + super.executeCommand(server, session, command, callback); + } +} +exports.InsertOperation = InsertOperation; +class InsertOneOperation extends InsertOperation { + constructor(collection, doc, options) { + super(collection.s.namespace, (0, common_functions_1.prepareDocs)(collection, [doc], options), options); + } + execute(server, session, callback) { + super.execute(server, session, (err, res) => { + var _a, _b; + if (err || res == null) + return callback(err); + if (res.code) + return callback(new error_1.MongoServerError(res)); + if (res.writeErrors) { + // This should be a WriteError but we can't change it now because of error hierarchy + return callback(new error_1.MongoServerError(res.writeErrors[0])); + } + callback(undefined, { + acknowledged: (_b = ((_a = this.writeConcern) === null || _a === void 0 ? void 0 : _a.w) !== 0) !== null && _b !== void 0 ? _b : true, + insertedId: this.documents[0]._id + }); + }); + } +} +exports.InsertOneOperation = InsertOneOperation; +/** @internal */ +class InsertManyOperation extends operation_1.AbstractOperation { + constructor(collection, docs, options) { + super(options); + if (!Array.isArray(docs)) { + throw new error_1.MongoInvalidArgumentError('Argument "docs" must be an array of documents'); + } + this.options = options; + this.collection = collection; + this.docs = docs; + } + execute(server, session, callback) { + const coll = this.collection; + const options = { ...this.options, ...this.bsonOptions, readPreference: this.readPreference }; + const writeConcern = write_concern_1.WriteConcern.fromOptions(options); + const bulkWriteOperation = new bulk_write_1.BulkWriteOperation(coll, (0, common_functions_1.prepareDocs)(coll, this.docs, options).map(document => ({ insertOne: { document } })), options); + bulkWriteOperation.execute(server, session, (err, res) => { + var _a; + if (err || res == null) { + if (err && err.message === 'Operation must be an object with an operation key') { + err = new error_1.MongoInvalidArgumentError('Collection.insertMany() cannot be called with an array that has null/undefined values'); + } + return callback(err); + } + callback(undefined, { + acknowledged: (_a = (writeConcern === null || writeConcern === void 0 ? void 0 : writeConcern.w) !== 0) !== null && _a !== void 0 ? _a : true, + insertedCount: res.insertedCount, + insertedIds: res.insertedIds + }); + }); + } +} +exports.InsertManyOperation = InsertManyOperation; +(0, operation_1.defineAspects)(InsertOperation, [operation_1.Aspect.RETRYABLE, operation_1.Aspect.WRITE_OPERATION]); +(0, operation_1.defineAspects)(InsertOneOperation, [operation_1.Aspect.RETRYABLE, operation_1.Aspect.WRITE_OPERATION]); +(0, operation_1.defineAspects)(InsertManyOperation, [operation_1.Aspect.WRITE_OPERATION]); +//# sourceMappingURL=insert.js.map \ No newline at end of file diff --git a/node_modules/mongodb/lib/operations/insert.js.map b/node_modules/mongodb/lib/operations/insert.js.map new file mode 100644 index 000000000..67a93dde3 --- /dev/null +++ b/node_modules/mongodb/lib/operations/insert.js.map @@ -0,0 +1 @@ +{"version":3,"file":"insert.js","sourceRoot":"","sources":["../../src/operations/insert.ts"],"names":[],"mappings":";;;AAGA,oCAAuE;AAKvE,oDAAgD;AAChD,6CAAkD;AAClD,uCAAsE;AACtE,yDAAiD;AACjD,2CAAuE;AAEvE,gBAAgB;AAChB,MAAa,eAAgB,SAAQ,0BAA0B;IAI7D,YAAY,EAAoB,EAAE,SAAqB,EAAE,OAAyB;;QAChF,KAAK,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;QAC1B,IAAI,CAAC,OAAO,GAAG,EAAE,GAAG,OAAO,EAAE,SAAS,EAAE,MAAA,OAAO,CAAC,SAAS,mCAAI,KAAK,EAAE,CAAC;QACrE,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC;QACb,I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modules/mongodb/lib/operations/is_capped.js new file mode 100644 index 000000000..dd2917a6d --- /dev/null +++ b/node_modules/mongodb/lib/operations/is_capped.js @@ -0,0 +1,30 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.IsCappedOperation = void 0; +const error_1 = require("../error"); +const operation_1 = require("./operation"); +/** @internal */ +class IsCappedOperation extends operation_1.AbstractOperation { + constructor(collection, options) { + super(options); + this.options = options; + this.collection = collection; + } + execute(server, session, callback) { + const coll = this.collection; + coll.s.db + .listCollections({ name: coll.collectionName }, { ...this.options, nameOnly: false, readPreference: this.readPreference, session }) + .toArray((err, collections) => { + if (err || !collections) + return callback(err); + if (collections.length === 0) { + // TODO(NODE-3485) + return callback(new error_1.MongoAPIError(`collection ${coll.namespace} not found`)); + } + const collOptions = collections[0].options; + callback(undefined, !!(collOptions && collOptions.capped)); + }); + } +} +exports.IsCappedOperation = IsCappedOperation; +//# sourceMappingURL=is_capped.js.map \ No newline at end of file diff --git a/node_modules/mongodb/lib/operations/is_capped.js.map b/node_modules/mongodb/lib/operations/is_capped.js.map new file mode 100644 index 000000000..13a584207 --- /dev/null +++ b/node_modules/mongodb/lib/operations/is_capped.js.map @@ -0,0 +1 @@ +{"version":3,"file":"is_capped.js","sourceRoot":"","sources":["../../src/operations/is_capped.ts"],"names":[],"mappings":";;;AACA,oCAAyC;AAIzC,2CAAkE;AAElE,gBAAgB;AAChB,MAAa,iBAAkB,SAAQ,6BAA0B;IAI/D,YAAY,UAAsB,EAAE,OAAyB;QAC3D,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;IAC/B,CAAC;IAEQ,OAAO,CACd,MAAc,EACd,OAAkC,EAClC,QAA2B;QAE3B,MAAM,IAAI,GAAG,IAAI,CAAC,UAAU,CAAC;QAE7B,IAAI,CAAC,CAAC,CAAC,EAAE;aACN,eAAe,CACd,EAAE,IAAI,EAAE,IAAI,CAAC,cAAc,EAAE,EAC7B,EAAE,GAAG,IAAI,CAAC,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,cAAc,EAAE,IAAI,CAAC,cAAc,EAAE,OAAO,EAAE,CACnF;aACA,OAAO,CAAC,CAAC,GAAG,EAAE,WAAW,EAAE,EAAE;YAC5B,IAAI,GAAG,IAAI,CAAC,WAAW;gBAAE,OAAO,QAAQ,CAAC,GAAG,CAAC,CAAC;YAC9C,IAAI,WAAW,CAAC,MAAM,KAAK,CAAC,EAAE;gBAC5B,kBAAkB;gBAClB,OAAO,QAAQ,CAAC,IAAI,qBAAa,CAAC,cAAc,IAAI,CAAC,SAAS,YAAY,CAAC,CAAC,CAAC;aAC9E;YAED,MAAM,WAAW,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC;YAC3C,QAAQ,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC,WAAW,IAAI,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC;QAC7D,CAAC,CAAC,CAAC;IACP,CAAC;CACF;AAjCD,8CAiCC"} \ No newline at end of file diff --git a/node_modules/mongodb/lib/operations/list_collections.js b/node_modules/mongodb/lib/operations/list_collections.js new file mode 100644 index 000000000..12adf6fc0 --- /dev/null +++ b/node_modules/mongodb/lib/operations/list_collections.js @@ -0,0 +1,78 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ListCollectionsCursor = exports.ListCollectionsOperation = void 0; +const abstract_cursor_1 = require("../cursor/abstract_cursor"); +const utils_1 = require("../utils"); +const command_1 = require("./command"); +const execute_operation_1 = require("./execute_operation"); +const operation_1 = require("./operation"); +/** @internal */ +class ListCollectionsOperation extends command_1.CommandOperation { + constructor(db, filter, options) { + super(db, options); + this.options = options !== null && options !== void 0 ? options : {}; + this.db = db; + this.filter = filter; + this.nameOnly = !!this.options.nameOnly; + this.authorizedCollections = !!this.options.authorizedCollections; + if (typeof this.options.batchSize === 'number') { + this.batchSize = this.options.batchSize; + } + } + execute(server, session, callback) { + return super.executeCommand(server, session, this.generateCommand((0, utils_1.maxWireVersion)(server)), callback); + } + /* This is here for the purpose of unit testing the final command that gets sent. */ + generateCommand(wireVersion) { + const command = { + listCollections: 1, + filter: this.filter, + cursor: this.batchSize ? { batchSize: this.batchSize } : {}, + nameOnly: this.nameOnly, + authorizedCollections: this.authorizedCollections + }; + // we check for undefined specifically here to allow falsy values + // eslint-disable-next-line no-restricted-syntax + if (wireVersion >= 9 && this.options.comment !== undefined) { + command.comment = this.options.comment; + } + return command; + } +} +exports.ListCollectionsOperation = ListCollectionsOperation; +/** @public */ +class ListCollectionsCursor extends abstract_cursor_1.AbstractCursor { + constructor(db, filter, options) { + super(db.s.client, db.s.namespace, options); + this.parent = db; + this.filter = filter; + this.options = options; + } + clone() { + return new ListCollectionsCursor(this.parent, this.filter, { + ...this.options, + ...this.cursorOptions + }); + } + /** @internal */ + _initialize(session, callback) { + const operation = new ListCollectionsOperation(this.parent, this.filter, { + ...this.cursorOptions, + ...this.options, + session + }); + (0, execute_operation_1.executeOperation)(this.parent.s.client, operation, (err, response) => { + if (err || response == null) + return callback(err); + // TODO: NODE-2882 + callback(undefined, { server: operation.server, session, response }); + }); + } +} +exports.ListCollectionsCursor = ListCollectionsCursor; +(0, operation_1.defineAspects)(ListCollectionsOperation, [ + operation_1.Aspect.READ_OPERATION, + operation_1.Aspect.RETRYABLE, + operation_1.Aspect.CURSOR_CREATING +]); +//# sourceMappingURL=list_collections.js.map \ No newline at end of file diff --git a/node_modules/mongodb/lib/operations/list_collections.js.map b/node_modules/mongodb/lib/operations/list_collections.js.map new file mode 100644 index 000000000..12b01e8a6 --- /dev/null +++ b/node_modules/mongodb/lib/operations/list_collections.js.map @@ -0,0 +1 @@ +{"version":3,"file":"list_collections.js","sourceRoot":"","sources":["../../src/operations/list_collections.ts"],"names":[],"mappings":";;;AACA,+DAA2D;AAI3D,oCAAoD;AACpD,uCAAsE;AACtE,2DAAwE;AACxE,2CA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AO,EAAE,QAAQ,EAAE,CAAC,CAAC;QACvE,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AAtCD,sDAsCC;AAED,IAAA,yBAAa,EAAC,wBAAwB,EAAE;IACtC,kBAAM,CAAC,cAAc;IACrB,kBAAM,CAAC,SAAS;IAChB,kBAAM,CAAC,eAAe;CACvB,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/mongodb/lib/operations/list_databases.js b/node_modules/mongodb/lib/operations/list_databases.js new file mode 100644 index 000000000..967ab4e40 --- /dev/null +++ b/node_modules/mongodb/lib/operations/list_databases.js @@ -0,0 +1,35 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ListDatabasesOperation = void 0; +const utils_1 = require("../utils"); +const command_1 = require("./command"); +const operation_1 = require("./operation"); +/** @internal */ +class ListDatabasesOperation extends command_1.CommandOperation { + constructor(db, options) { + super(db, options); + this.options = options !== null && options !== void 0 ? options : {}; + this.ns = new utils_1.MongoDBNamespace('admin', '$cmd'); + } + execute(server, session, callback) { + const cmd = { listDatabases: 1 }; + if (this.options.nameOnly) { + cmd.nameOnly = Number(cmd.nameOnly); + } + if (this.options.filter) { + cmd.filter = this.options.filter; + } + if (typeof this.options.authorizedDatabases === 'boolean') { + cmd.authorizedDatabases = this.options.authorizedDatabases; + } + // we check for undefined specifically here to allow falsy values + // eslint-disable-next-line no-restricted-syntax + if ((0, utils_1.maxWireVersion)(server) >= 9 && this.options.comment !== undefined) { + cmd.comment = this.options.comment; + } + super.executeCommand(server, session, cmd, callback); + } +} +exports.ListDatabasesOperation = ListDatabasesOperation; +(0, operation_1.defineAspects)(ListDatabasesOperation, [operation_1.Aspect.READ_OPERATION, operation_1.Aspect.RETRYABLE]); +//# sourceMappingURL=list_databases.js.map \ No newline at end of file diff --git a/node_modules/mongodb/lib/operations/list_databases.js.map b/node_modules/mongodb/lib/operations/list_databases.js.map new file mode 100644 index 000000000..8ea522d41 --- /dev/null +++ b/node_modules/mongodb/lib/operations/list_datab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CAAC,CAAC;IACvD,CAAC;CACF;AAnCD,wDAmCC;AAED,IAAA,yBAAa,EAAC,sBAAsB,EAAE,CAAC,kBAAM,CAAC,cAAc,EAAE,kBAAM,CAAC,SAAS,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/mongodb/lib/operations/map_reduce.js b/node_modules/mongodb/lib/operations/map_reduce.js new file mode 100644 index 000000000..43f63a43f --- /dev/null +++ b/node_modules/mongodb/lib/operations/map_reduce.js @@ -0,0 +1,166 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.MapReduceOperation = void 0; +const bson_1 = require("../bson"); +const error_1 = require("../error"); +const read_preference_1 = require("../read_preference"); +const utils_1 = require("../utils"); +const command_1 = require("./command"); +const operation_1 = require("./operation"); +const exclusionList = [ + 'explain', + 'readPreference', + 'readConcern', + 'session', + 'bypassDocumentValidation', + 'writeConcern', + 'raw', + 'fieldsAsRaw', + 'promoteLongs', + 'promoteValues', + 'promoteBuffers', + 'bsonRegExp', + 'serializeFunctions', + 'ignoreUndefined', + 'enableUtf8Validation', + 'scope' // this option is reformatted thus exclude the original +]; +/** + * Run Map Reduce across a collection. Be aware that the inline option for out will return an array of results not a collection. + * @internal + */ +class MapReduceOperation extends command_1.CommandOperation { + /** + * Constructs a MapReduce operation. + * + * @param collection - Collection instance. + * @param map - The mapping function. + * @param reduce - The reduce function. + * @param options - Optional settings. See Collection.prototype.mapReduce for a list of options. + */ + constructor(collection, map, reduce, options) { + super(collection, options); + this.options = options !== null && options !== void 0 ? options : {}; + this.collection = collection; + this.map = map; + this.reduce = reduce; + } + execute(server, session, callback) { + const coll = this.collection; + const map = this.map; + const reduce = this.reduce; + let options = this.options; + const mapCommandHash = { + mapReduce: coll.collectionName, + map: map, + reduce: reduce + }; + if (options.scope) { + mapCommandHash.scope = processScope(options.scope); + } + // Add any other options passed in + for (const n in options) { + // Only include if not in exclusion list + if (exclusionList.indexOf(n) === -1) { + mapCommandHash[n] = options[n]; + } + } + options = Object.assign({}, options); + // If we have a read preference and inline is not set as output fail hard + if (this.readPreference.mode === read_preference_1.ReadPreferenceMode.primary && + options.out && + options.out.inline !== 1 && + options.out !== 'inline') { + // Force readPreference to primary + options.readPreference = read_preference_1.ReadPreference.primary; + // Decorate command with writeConcern if supported + (0, utils_1.applyWriteConcern)(mapCommandHash, { db: coll.s.db, collection: coll }, options); + } + else { + (0, utils_1.decorateWithReadConcern)(mapCommandHash, coll, options); + } + // Is bypassDocumentValidation specified + if (options.bypassDocumentValidation === true) { + mapCommandHash.bypassDocumentValidation = options.bypassDocumentValidation; + } + // Have we specified collation + try { + (0, utils_1.decorateWithCollation)(mapCommandHash, coll, options); + } + catch (err) { + return callback(err); + } + if (this.explain && (0, utils_1.maxWireVersion)(server) < 9) { + callback(new error_1.MongoCompatibilityError(`Server ${server.name} does not support explain on mapReduce`)); + return; + } + // Execute command + super.executeCommand(server, session, mapCommandHash, (err, result) => { + if (err) + return callback(err); + // Check if we have an error + if (1 !== result.ok || result.err || result.errmsg) { + return callback(new error_1.MongoServerError(result)); + } + // If an explain option was executed, don't process the server results + if (this.explain) + return callback(undefined, result); + // Create statistics value + const stats = {}; + if (result.timeMillis) + stats['processtime'] = result.timeMillis; + if (result.counts) + stats['counts'] = result.counts; + if (result.timing) + stats['timing'] = result.timing; + // invoked with inline? + if (result.results) { + // If we wish for no verbosity + if (options['verbose'] == null || !options['verbose']) { + return callback(undefined, result.results); + } + return callback(undefined, { results: result.results, stats: stats }); + } + // The returned collection + let collection = null; + // If we have an object it's a different db + if (result.result != null && typeof result.result === 'object') { + const doc = result.result; + // Return a collection from another db + collection = coll.s.db.s.client.db(doc.db, coll.s.db.s.options).collection(doc.collection); + } + else { + // Create a collection object that wraps the result collection + collection = coll.s.db.collection(result.result); + } + // If we wish for no verbosity + if (options['verbose'] == null || !options['verbose']) { + return callback(err, collection); + } + // Return stats as third set of values + callback(err, { collection, stats }); + }); + } +} +exports.MapReduceOperation = MapReduceOperation; +/** Functions that are passed as scope args must be converted to Code instances. */ +function processScope(scope) { + if (!(0, utils_1.isObject)(scope) || scope._bsontype === 'ObjectID') { + return scope; + } + const newScope = {}; + for (const key of Object.keys(scope)) { + if ('function' === typeof scope[key]) { + newScope[key] = new bson_1.Code(String(scope[key])); + } + else if (scope[key]._bsontype === 'Code') { + newScope[key] = scope[key]; + } + else { + newScope[key] = processScope(scope[key]); + } + } + return newScope; +} +(0, operation_1.defineAspects)(MapReduceOperation, [operation_1.Aspect.EXPLAINABLE]); +//# sourceMappingURL=map_reduce.js.map \ No newline at end of file diff --git a/node_modules/mongodb/lib/operations/map_reduce.js.map b/node_modules/mongodb/lib/operations/map_reduce.js.map new file mode 100644 index 000000000..0cab777c7 --- /dev/null +++ b/node_modules/mongodb/lib/operations/map_reduce.js.map @@ -0,0 +1 @@ +{"version":3,"file":"map_reduce.js","sourceRoot":"","sources":["../../src/operations/map_reduce.ts"],"names":[],"mappings":";;;AACA,kCAAyC;AAEzC,oCAAqE;AACrE,wDAAwE;AAIxE,oCAOkB;AAClB,uCAAsE;AACtE,2CAAoD;AAEpD,MAAM,aAAa,GAAG;IACpB,SAAS;IACT,gBAAgB;IAChB,aAAa;IACb,SAAS;IACT,0BAA0B;IAC1B,cAAc;IACd,KAAK;IACL,aAAa;IACb,cAAc;IACd,eAAe;IACf,gBAAgB;IAChB,YAAY;IACZ,oBAAoB;IACpB,iBAAiB;IACjB,sBAAsB;IACtB,OAAO,CAAC,uDAAuD;CAChE,CAAC;AA2CF;;;GAGG;AACH,MAAa,kBAAmB,SAAQ,0BAAuC;IAQ7E;;;;;;;OAOG;IACH,YACE,UAAsB,EACtB,GAAyB,EACzB,MAA+B,EAC/B,OAA0B;QAE1B,KAAK,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;QAE3B,IAAI,CAAC,OAAO,GAAG,OAAO,aAAP,OAAO,cAAP,OAAO,GAAI,EAAE,CAAC;QAC7B,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAA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E;gBACrD,OAAO,QAAQ,CAAC,GAAG,EAAE,UAAU,CAAC,CAAC;aAClC;YAED,sCAAsC;YACtC,QAAQ,CAAC,GAAG,EAAE,EAAE,UAAU,EAAE,KAAK,EAAE,CAAC,CAAC;QACvC,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AA/ID,gDA+IC;AAED,mFAAmF;AACnF,SAAS,YAAY,CAAC,KAA0B;IAC9C,IAAI,CAAC,IAAA,gBAAQ,EAAC,KAAK,CAAC,IAAK,KAAa,CAAC,SAAS,KAAK,UAAU,EAAE;QAC/D,OAAO,KAAK,CAAC;KACd;IAED,MAAM,QAAQ,GAAa,EAAE,CAAC;IAE9B,KAAK,MAAM,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE;QACpC,IAAI,UAAU,KAAK,OAAQ,KAAkB,CAAC,GAAG,CAAC,EAAE;YAClD,QAAQ,CAAC,GAAG,CAAC,GAAG,IAAI,WAAI,CAAC,MAAM,CAAE,KAAkB,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;SAC5D;aAAM,IAAK,KAAkB,CAAC,GAAG,CAAC,CAAC,SAAS,KAAK,MAAM,EAAE;YACxD,QAAQ,CAAC,GAAG,CAAC,GAAI,KAAkB,CAAC,GAAG,CAAC,CAAC;SAC1C;aAAM;YACL,QAAQ,CAAC,GAAG,CAAC,GAAG,YAAY,CAAE,KAAkB,CAAC,GAAG,CAAC,CAAC,CAAC;SACxD;KACF;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED,IAAA,yBAAa,EAAC,kBAAkB,EAAE,CAAC,kBAAM,CAAC,WAAW,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/mongodb/lib/operations/operation.js b/node_modules/mongodb/lib/operations/operation.js new file mode 100644 index 000000000..861753ab6 --- /dev/null +++ b/node_modules/mongodb/lib/operations/operation.js @@ -0,0 +1,67 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.defineAspects = exports.AbstractOperation = exports.Aspect = void 0; +const bson_1 = require("../bson"); +const read_preference_1 = require("../read_preference"); +exports.Aspect = { + READ_OPERATION: Symbol('READ_OPERATION'), + WRITE_OPERATION: Symbol('WRITE_OPERATION'), + RETRYABLE: Symbol('RETRYABLE'), + EXPLAINABLE: Symbol('EXPLAINABLE'), + SKIP_COLLATION: Symbol('SKIP_COLLATION'), + CURSOR_CREATING: Symbol('CURSOR_CREATING'), + CURSOR_ITERATING: Symbol('CURSOR_ITERATING') +}; +/** @internal */ +const kSession = Symbol('session'); +/** + * This class acts as a parent class for any operation and is responsible for setting this.options, + * as well as setting and getting a session. + * Additionally, this class implements `hasAspect`, which determines whether an operation has + * a specific aspect. + * @internal + */ +class AbstractOperation { + constructor(options = {}) { + var _a; + this.readPreference = this.hasAspect(exports.Aspect.WRITE_OPERATION) + ? read_preference_1.ReadPreference.primary + : (_a = read_preference_1.ReadPreference.fromOptions(options)) !== null && _a !== void 0 ? _a : read_preference_1.ReadPreference.primary; + // Pull the BSON serialize options from the already-resolved options + this.bsonOptions = (0, bson_1.resolveBSONOptions)(options); + this[kSession] = options.session != null ? options.session : undefined; + this.options = options; + this.bypassPinningCheck = !!options.bypassPinningCheck; + this.trySecondaryWrite = false; + } + hasAspect(aspect) { + const ctor = this.constructor; + if (ctor.aspects == null) { + return false; + } + return ctor.aspects.has(aspect); + } + get session() { + return this[kSession]; + } + get canRetryRead() { + return true; + } + get canRetryWrite() { + return true; + } +} +exports.AbstractOperation = AbstractOperation; +function defineAspects(operation, aspects) { + if (!Array.isArray(aspects) && !(aspects instanceof Set)) { + aspects = [aspects]; + } + aspects = new Set(aspects); + Object.defineProperty(operation, 'aspects', { + value: aspects, + writable: false + }); + return aspects; +} +exports.defineAspects = defineAspects; +//# sourceMappingURL=operation.js.map \ No newline at end of file diff --git a/node_modules/mongodb/lib/operations/operation.js.map b/node_modules/mongodb/lib/operations/operation.js.map new file mode 100644 index 000000000..785853841 --- /dev/null +++ b/node_modules/mongodb/lib/operations/operation.js.map @@ -0,0 +1 @@ +{"version":3,"file":"operation.js","sourceRoot":"","sources":["../../src/operations/operation.ts"],"names":[],"mappings":";;;AAAA,kCAA6E;AAC7E,wDAAwE;AAK3D,QAAA,MAAM,GAAG;IACpB,cAAc,EAAE,MAAM,CAAC,gBAAgB,CAAC;IACxC,eAAe,EAAE,MAAM,CAAC,iBAAiB,CAAC;IAC1C,SAAS,EAAE,MAAM,CAAC,WAAW,CAAC;IAC9B,WAAW,EAAE,MAAM,CAAC,aAAa,CAAC;IAClC,cAAc,EAAE,MAAM,CAAC,gBAAgB,CAAC;IACxC,eAAe,EAAE,MAAM,CAAC,iBAAiB,CAAC;IAC1C,gBAAgB,EAAE,MAAM,CAAC,kBAAkB,CAAC;CACpC,CAAC;AAuBX,gBAAgB;AAChB,MAAM,QAAQ,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC;AAEnC;;;;;;GAMG;AACH,MAAsB,iBAAiB;IAerC,YAAY,UAA4B,EAAE;;QACxC,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,SAAS,CAAC,cAAM,CAAC,eAAe,CAAC;YAC1D,CAAC,CAAC,gCAAc,CAAC,OAAO;YACxB,CAAC,CAAC,MAAA,gCAAc,CAAC,WAAW,CAAC,OAAO,CAAC,mCAAI,gCAAc,CAAC,OAAO,CAAC;QAElE,oEAAoE;QACpE,IAAI,CAAC,WAAW,GAAG,IAAA,yBAAkB,EAAC,OAAO,CAAC,CAAC;QAE/C,IAAI,CAAC,QAAQ,CAAC,GAAG,OAAO,CAAC,OAAO,IAAI,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC;QAEvE,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,kBAAkB,GAAG,CAAC,CAAC,OAAO,CAAC,kBAAkB,CAAC;QACvD,IAAI,CAAC,iBAAiB,GAAG,KAAK,CAAC;IACjC,CAAC;IAQD,SAAS,CAAC,MAAc;QACtB,MAAM,IAAI,GAAG,IAAI,CAAC,WAAmC,CAAC;QACtD,IAAI,IAAI,CAAC,OAAO,IAAI,IAAI,EAAE;YACxB,OAAO,KAAK,CAAC;SACd;QAED,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IAClC,CAAC;IAED,IAAI,OAAO;QACT,OAAO,IAAI,CAAC,QAAQ,CAAC,CAAC;IACxB,CAAC;IAED,IAAI,YAAY;QACd,OAAO,IAAI,CAAC;IACd,CAAC;IAED,IAAI,aAAa;QACf,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AAxDD,8CAwDC;AAED,SAAgB,aAAa,CAC3B,SAA+B,EAC/B,OAAwC;IAExC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,OAAO,YAAY,GAAG,CAAC,EAAE;QACxD,OAAO,GAAG,CAAC,OAAO,CAAC,CAAC;KACrB;IAED,OAAO,GAAG,IAAI,GAAG,CAAC,OAAO,CAAC,CAAC;IAC3B,MAAM,CAAC,cAAc,CAAC,SAAS,EAAE,SAAS,EAAE;QAC1C,KAAK,EAAE,OAAO;QACd,QAAQ,EAAE,KAAK;KAChB,CAAC,CAAC;IAEH,OAAO,OAAO,CAAC;AACjB,CAAC;AAfD,sCAeC"} \ No newline at end of file diff --git a/node_modules/mongodb/lib/operations/options_operation.js b/node_modules/mongodb/lib/operations/options_operation.js new file mode 100644 index 000000000..f07f104dc --- /dev/null +++ b/node_modules/mongodb/lib/operations/options_operation.js @@ -0,0 +1,29 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.OptionsOperation = void 0; +const error_1 = require("../error"); +const operation_1 = require("./operation"); +/** @internal */ +class OptionsOperation extends operation_1.AbstractOperation { + constructor(collection, options) { + super(options); + this.options = options; + this.collection = collection; + } + execute(server, session, callback) { + const coll = this.collection; + coll.s.db + .listCollections({ name: coll.collectionName }, { ...this.options, nameOnly: false, readPreference: this.readPreference, session }) + .toArray((err, collections) => { + if (err || !collections) + return callback(err); + if (collections.length === 0) { + // TODO(NODE-3485) + return callback(new error_1.MongoAPIError(`collection ${coll.namespace} not found`)); + } + callback(err, collections[0].options); + }); + } +} +exports.OptionsOperation = OptionsOperation; +//# sourceMappingURL=options_operation.js.map \ No newline at end of file diff --git a/node_modules/mongodb/lib/operations/options_operation.js.map b/node_modules/mongodb/lib/operations/options_operation.js.map new file mode 100644 index 000000000..9d6b05c00 --- /dev/null +++ b/node_modules/mongodb/lib/operations/options_operation.js.map @@ -0,0 +1 @@ +{"version":3,"file":"options_operation.js","sourceRoot":"","sources":["../../src/operations/options_operation.ts"],"names":[],"mappings":";;;AAEA,oCAAyC;AAIzC,2CAAkE;AAElE,gBAAgB;AAChB,MAAa,gBAAiB,SAAQ,6BAA2B;IAI/D,YAAY,UAAsB,EAAE,OAAyB;QAC3D,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;IAC/B,CAAC;IAEQ,OAAO,CACd,MAAc,EACd,OAAkC,EAClC,QAA4B;QAE5B,MAAM,IAAI,GAAG,IAAI,CAAC,UAAU,CAAC;QAE7B,IAAI,CAAC,CAAC,CAAC,EAAE;aACN,eAAe,CACd,EAAE,IAAI,EAAE,IAAI,CAAC,cAAc,EAAE,EAC7B,EAAE,GAAG,IAAI,CAAC,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,cAAc,EAAE,IAAI,CAAC,cAAc,EAAE,OAAO,EAAE,CACnF;aACA,OAAO,CAAC,CAAC,GAAG,EAAE,WAAW,EAAE,EAAE;YAC5B,IAAI,GAAG,IAAI,CAAC,WAAW;gBAAE,OAAO,QAAQ,CAAC,GAAG,CAAC,CAAC;YAC9C,IAAI,WAAW,CAAC,MAAM,KAAK,CAAC,EAAE;gBAC5B,kBAAkB;gBAClB,OAAO,QAAQ,CAAC,IAAI,qBAAa,CAAC,cAAc,IAAI,CAAC,SAAS,YAAY,CAAC,CAAC,CAAC;aAC9E;YAED,QAAQ,CAAC,GAAG,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;QACxC,CAAC,CAAC,CAAC;IACP,CAAC;CACF;AAhCD,4CAgCC"} \ No newline at end of file diff --git a/node_modules/mongodb/lib/operations/profiling_level.js b/node_modules/mongodb/lib/operations/profiling_level.js new file mode 100644 index 000000000..33802dfa2 --- /dev/null +++ b/node_modules/mongodb/lib/operations/profiling_level.js @@ -0,0 +1,33 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ProfilingLevelOperation = void 0; +const error_1 = require("../error"); +const command_1 = require("./command"); +/** @internal */ +class ProfilingLevelOperation extends command_1.CommandOperation { + constructor(db, options) { + super(db, options); + this.options = options; + } + execute(server, session, callback) { + super.executeCommand(server, session, { profile: -1 }, (err, doc) => { + if (err == null && doc.ok === 1) { + const was = doc.was; + if (was === 0) + return callback(undefined, 'off'); + if (was === 1) + return callback(undefined, 'slow_only'); + if (was === 2) + return callback(undefined, 'all'); + // TODO(NODE-3483) + return callback(new error_1.MongoRuntimeError(`Illegal profiling level value ${was}`)); + } + else { + // TODO(NODE-3483): Consider MongoUnexpectedServerResponseError + err != null ? callback(err) : callback(new error_1.MongoRuntimeError('Error with profile command')); + } + }); + } +} +exports.ProfilingLevelOperation = ProfilingLevelOperation; +//# sourceMappingURL=profiling_level.js.map \ No newline at end of file diff --git a/node_modules/mongodb/lib/operations/profiling_level.js.map b/node_modules/mongodb/lib/operations/profiling_level.js.map new file mode 100644 index 000000000..8630fdc00 --- /dev/null +++ b/node_modules/mongodb/lib/operations/profiling_level.js.map @@ -0,0 +1 @@ +{"version":3,"file":"profiling_level.js","sourceRoot":"","sources":["../../src/operations/profiling_level.ts"],"names":[],"mappings":";;;AACA,oCAA6C;AAI7C,uCAAsE;AAKtE,gBAAgB;AAChB,MAAa,uBAAwB,SAAQ,0BAAwB;IAGnE,YAAY,EAAM,EAAE,OAA8B;QAChD,KAAK,CAAC,EAAE,EAAE,OAAO,CAAC,CAAC;QACnB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;IAEQ,OAAO,CACd,MAAc,EACd,OAAkC,EAClC,QAA0B;QAE1B,KAAK,CAAC,cAAc,CAAC,MAAM,EAAE,OAAO,EAAE,EAAE,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE;YAClE,IAAI,GAAG,IAAI,IAAI,IAAI,GAAG,CAAC,EAAE,KAAK,CAAC,EAAE;gBAC/B,MAAM,GAAG,GAAG,GAAG,CAAC,GAAG,CAAC;gBACpB,IAAI,GAAG,KAAK,CAAC;oBAAE,OAAO,QAAQ,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC;gBACjD,IAAI,GAAG,KAAK,CAAC;oBAAE,OAAO,QAAQ,CAAC,SAAS,EAAE,WAAW,CAAC,CAAC;gBACvD,IAAI,GAAG,KAAK,CAAC;oBAAE,OAAO,QAAQ,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC;gBACjD,kBAAkB;gBAClB,OAAO,QAAQ,CAAC,IAAI,yBAAiB,CAAC,iCAAiC,GAAG,EAAE,CAAC,CAAC,CAAC;aAChF;iBAAM;gBACL,+DAA+D;gBAC/D,GAAG,IAAI,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,yBAAiB,CAAC,4BAA4B,CAAC,CAAC,CAAC;aAC7F;QACH,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AA3BD,0DA2BC"} \ No newline at end of file diff --git a/node_modules/mongodb/lib/operations/remove_user.js b/node_modules/mongodb/lib/operations/remove_user.js new file mode 100644 index 000000000..daab3ebff --- /dev/null +++ b/node_modules/mongodb/lib/operations/remove_user.js @@ -0,0 +1,21 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.RemoveUserOperation = void 0; +const command_1 = require("./command"); +const operation_1 = require("./operation"); +/** @internal */ +class RemoveUserOperation extends command_1.CommandOperation { + constructor(db, username, options) { + super(db, options); + this.options = options; + this.username = username; + } + execute(server, session, callback) { + super.executeCommand(server, session, { dropUser: this.username }, err => { + callback(err, err ? false : true); + }); + } +} +exports.RemoveUserOperation = RemoveUserOperation; +(0, operation_1.defineAspects)(RemoveUserOperation, [operation_1.Aspect.WRITE_OPERATION]); +//# sourceMappingURL=remove_user.js.map \ No newline at end of file diff --git a/node_modules/mongodb/lib/operations/remove_user.js.map b/node_modules/mongodb/lib/operations/remove_user.js.map new file mode 100644 index 000000000..d689529ab --- /dev/null +++ b/node_modules/mongodb/lib/operations/remove_user.js.map @@ -0,0 +1 @@ +{"version":3,"file":"remove_user.js","sourceRoot":"","sources":["../../src/operations/remove_user.ts"],"names":[],"mappings":";;;AAIA,uCAAsE;AACtE,2CAAoD;AAKpD,gBAAgB;AAChB,MAAa,mBAAoB,SAAQ,0BAAyB;IAIhE,YAAY,EAAM,EAAE,QAAgB,EAAE,OAA0B;QAC9D,KAAK,CAAC,EAAE,EAAE,OAAO,CAAC,CAAC;QACnB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC3B,CAAC;IAEQ,OAAO,CACd,MAAc,EACd,OAAkC,EAClC,QAA2B;QAE3B,KAAK,CAAC,cAAc,CAAC,MAAM,EAAE,OAAO,EAAE,EAAE,QAAQ,EAAE,IAAI,CAAC,QAAQ,EAAE,EAAE,GAAG,CAAC,EAAE;YACvE,QAAQ,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;QACpC,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AAnBD,kDAmBC;AAED,IAAA,yBAAa,EAAC,mBAAmB,EAAE,CAAC,kBAAM,CAAC,eAAe,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/mongodb/lib/operations/rename.js b/node_modules/mongodb/lib/operations/rename.js new file mode 100644 index 000000000..06ec124d2 --- /dev/null +++ b/node_modules/mongodb/lib/operations/rename.js @@ -0,0 +1,46 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.RenameOperation = void 0; +const collection_1 = require("../collection"); +const error_1 = require("../error"); +const utils_1 = require("../utils"); +const operation_1 = require("./operation"); +const run_command_1 = require("./run_command"); +/** @internal */ +class RenameOperation extends run_command_1.RunAdminCommandOperation { + constructor(collection, newName, options) { + // Check the collection name + (0, utils_1.checkCollectionName)(newName); + // Build the command + const renameCollection = collection.namespace; + const toCollection = collection.s.namespace.withCollection(newName).toString(); + const dropTarget = typeof options.dropTarget === 'boolean' ? options.dropTarget : false; + const cmd = { renameCollection: renameCollection, to: toCollection, dropTarget: dropTarget }; + super(collection, cmd, options); + this.options = options; + this.collection = collection; + this.newName = newName; + } + execute(server, session, callback) { + const coll = this.collection; + super.execute(server, session, (err, doc) => { + if (err) + return callback(err); + // We have an error + if (doc === null || doc === void 0 ? void 0 : doc.errmsg) { + return callback(new error_1.MongoServerError(doc)); + } + let newColl; + try { + newColl = new collection_1.Collection(coll.s.db, this.newName, coll.s.options); + } + catch (err) { + return callback(err); + } + return callback(undefined, newColl); + }); + } +} +exports.RenameOperation = RenameOperation; +(0, operation_1.defineAspects)(RenameOperation, [operation_1.Aspect.WRITE_OPERATION]); +//# sourceMappingURL=rename.js.map \ No newline at end of file diff --git a/node_modules/mongodb/lib/operations/rename.js.map b/node_modules/mongodb/lib/operations/rename.js.map new file mode 100644 index 000000000..03255d1cd --- /dev/null +++ b/node_modules/mongodb/lib/operations/rename.js.map @@ -0,0 +1 @@ +{"version":3,"file":"rename.js","sourceRoot":"","sources":["../../src/operations/rename.ts"],"names":[],"mappings":";;;AACA,8CAA2C;AAC3C,oCAA4C;AAG5C,oCAAyD;AAEzD,2CAAoD;AACpD,+CA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AO,GAAG,IAAI,uBAAU,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;aACnE;YAAC,OAAO,GAAG,EAAE;gBACZ,OAAO,QAAQ,CAAC,GAAG,CAAC,CAAC;aACtB;YAED,OAAO,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;QACtC,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AA7CD,0CA6CC;AAED,IAAA,yBAAa,EAAC,eAAe,EAAE,CAAC,kBAAM,CAAC,eAAe,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/mongodb/lib/operations/run_command.js b/node_modules/mongodb/lib/operations/run_command.js new file mode 100644 index 000000000..3ebab39a4 --- /dev/null +++ b/node_modules/mongodb/lib/operations/run_command.js @@ -0,0 +1,26 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.RunAdminCommandOperation = exports.RunCommandOperation = void 0; +const utils_1 = require("../utils"); +const command_1 = require("./command"); +/** @internal */ +class RunCommandOperation extends command_1.CommandOperation { + constructor(parent, command, options) { + super(parent, options); + this.options = options !== null && options !== void 0 ? options : {}; + this.command = command; + } + execute(server, session, callback) { + const command = this.command; + this.executeCommand(server, session, command, callback); + } +} +exports.RunCommandOperation = RunCommandOperation; +class RunAdminCommandOperation extends RunCommandOperation { + constructor(parent, command, options) { + super(parent, command, options); + this.ns = new utils_1.MongoDBNamespace('admin'); + } +} +exports.RunAdminCommandOperation = RunAdminCommandOperation; +//# sourceMappingURL=run_command.js.map \ No newline at end of file diff --git a/node_modules/mongodb/lib/operations/run_command.js.map b/node_modules/mongodb/lib/operations/run_command.js.map new file mode 100644 index 000000000..f698f3449 --- /dev/null +++ b/node_modules/mongodb/lib/operations/run_command.js.map @@ -0,0 +1 @@ +{"version":3,"file":"run_command.js","sourceRoot":"","sources":["../../src/operations/run_command.ts"],"names":[],"mappings":";;;AAGA,oCAAsD;AACtD,uCAAuF;AAKvF,gBAAgB;AAChB,MAAa,mBAAkC,SAAQ,0BAAmB;IAIxE,YAAY,MAAmC,EAAE,OAAiB,EAAE,OAA2B;QAC7F,KAAK,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QACvB,IAAI,CAAC,OAAO,GAAG,OAAO,aAAP,OAAO,cAAP,OAAO,GAAI,EAAE,CAAC;QAC7B,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;IAEQ,OAAO,CACd,MAAc,EACd,OAAkC,EAClC,QAAqB;QAErB,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC;QAC7B,IAAI,CAAC,cAAc,CAAC,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;IAC1D,CAAC;CACF;AAlBD,kDAkBC;AAED,MAAa,wBAAuC,SAAQ,mBAAsB;IAChF,YAAY,MAAmC,EAAE,OAAiB,EAAE,OAA2B;QAC7F,KAAK,CAAC,MAAM,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;QAChC,IAAI,CAAC,EAAE,GAAG,IAAI,wBAAgB,CAAC,OAAO,CAAC,CAAC;IAC1C,CAAC;CACF;AALD,4DAKC"} \ No newline at end of file diff --git a/node_modules/mongodb/lib/operations/set_profiling_level.js b/node_modules/mongodb/lib/operations/set_profiling_level.js new file mode 100644 index 000000000..4ff83297d --- /dev/null +++ b/node_modules/mongodb/lib/operations/set_profiling_level.js @@ -0,0 +1,51 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.SetProfilingLevelOperation = exports.ProfilingLevel = void 0; +const error_1 = require("../error"); +const utils_1 = require("../utils"); +const command_1 = require("./command"); +const levelValues = new Set(['off', 'slow_only', 'all']); +/** @public */ +exports.ProfilingLevel = Object.freeze({ + off: 'off', + slowOnly: 'slow_only', + all: 'all' +}); +/** @internal */ +class SetProfilingLevelOperation extends command_1.CommandOperation { + constructor(db, level, options) { + super(db, options); + this.options = options; + switch (level) { + case exports.ProfilingLevel.off: + this.profile = 0; + break; + case exports.ProfilingLevel.slowOnly: + this.profile = 1; + break; + case exports.ProfilingLevel.all: + this.profile = 2; + break; + default: + this.profile = 0; + break; + } + this.level = level; + } + execute(server, session, callback) { + const level = this.level; + if (!levelValues.has(level)) { + return callback(new error_1.MongoInvalidArgumentError(`Profiling level must be one of "${(0, utils_1.enumToString)(exports.ProfilingLevel)}"`)); + } + // TODO(NODE-3483): Determine error to put here + super.executeCommand(server, session, { profile: this.profile }, (err, doc) => { + if (err == null && doc.ok === 1) + return callback(undefined, level); + return err != null + ? callback(err) + : callback(new error_1.MongoRuntimeError('Error with profile command')); + }); + } +} +exports.SetProfilingLevelOperation = SetProfilingLevelOperation; +//# sourceMappingURL=set_profiling_level.js.map \ No newline at end of file diff --git a/node_modules/mongodb/lib/operations/set_profiling_level.js.map b/node_modules/mongodb/lib/operations/set_profiling_level.js.map new file mode 100644 index 000000000..4928b6165 --- /dev/null +++ b/node_modules/mongodb/lib/operations/set_profiling_level.js.map @@ -0,0 +1 @@ +{"version":3,"file":"set_profiling_level.js","sourceRoot":"","sources":["../../src/operations/set_profiling_level.ts"],"names":[],"mappings":";;;AACA,oCAAwE;AAIxE,oCAAwC;AACxC,uCAAsE;AAEtE,MAAM,WAAW,GAAG,IAAI,GAAG,CAAC,CAAC,KAAK,EAAE,WAAW,EAAE,KAAK,CAAC,CAAC,CAAC;AAEzD,cAAc;AACD,QAAA,cAAc,GAAG,MAAM,CAAC,MAAM,CAAC;IAC1C,GAAG,EAAE,KAAK;IACV,QAAQ,EAAE,WAAW;IACrB,GAAG,EAAE,KAAK;CACF,CAAC,CAAC;AAQZ,gBAAgB;AAChB,MAAa,0BAA2B,SAAQ,0BAAgC;IAK9E,YAAY,EAAM,EAAE,KAAqB,EAAE,OAAiC;QAC1E,KAAK,CAAC,EAAE,EAAE,OAAO,CAAC,CAAC;QACnB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,QAAQ,KAAK,EAAE;YACb,KAAK,sBAAc,CAAC,GAAG;gBACrB,IAAI,CAAC,OAAO,GAAG,CAAC,CAAC;gBACjB,MAAM;YACR,KAAK,sBAAc,CAAC,QAAQ;gBAC1B,IAAI,CAAC,OAAO,GAAG,CAAC,CAAC;gBACjB,MAAM;YACR,KAAK,sBAAc,CAAC,GAAG;gBACrB,IAAI,CAAC,OAAO,GAAG,CAAC,CAAC;gBACjB,MAAM;YACR;gBACE,IAAI,CAAC,OAAO,GAAG,CAAC,CAAC;gBACjB,MAAM;SACT;QAED,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACrB,CAAC;IAEQ,OAAO,CACd,MAAc,EACd,OAAkC,EAClC,QAAkC;QAElC,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;QAEzB,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE;YAC3B,OAAO,QAAQ,CACb,IAAI,iCAAyB,CAC3B,mCAAmC,IAAA,oBAAY,EAAC,sBAAc,CAAC,GAAG,CACnE,CACF,CAAC;SACH;QAED,+CAA+C;QAC/C,KAAK,CAAC,cAAc,CAAC,MAAM,EAAE,OAAO,EAAE,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE;YAC5E,IAAI,GAAG,IAAI,IAAI,IAAI,GAAG,CAAC,EAAE,KAAK,CAAC;gBAAE,OAAO,QAAQ,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC;YACnE,OAAO,GAAG,IAAI,IAAI;gBAChB,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC;gBACf,CAAC,CAAC,QAAQ,CAAC,IAAI,yBAAiB,CAAC,4BAA4B,CAAC,CAAC,CAAC;QACpE,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AAjDD,gEAiDC"} \ No newline at end of file diff --git a/node_modules/mongodb/lib/operations/stats.js b/node_modules/mongodb/lib/operations/stats.js new file mode 100644 index 000000000..21b736dfc --- /dev/null +++ b/node_modules/mongodb/lib/operations/stats.js @@ -0,0 +1,48 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.DbStatsOperation = exports.CollStatsOperation = void 0; +const command_1 = require("./command"); +const operation_1 = require("./operation"); +/** + * Get all the collection statistics. + * @internal + */ +class CollStatsOperation extends command_1.CommandOperation { + /** + * Construct a Stats operation. + * + * @param collection - Collection instance + * @param options - Optional settings. See Collection.prototype.stats for a list of options. + */ + constructor(collection, options) { + super(collection, options); + this.options = options !== null && options !== void 0 ? options : {}; + this.collectionName = collection.collectionName; + } + execute(server, session, callback) { + const command = { collStats: this.collectionName }; + if (this.options.scale != null) { + command.scale = this.options.scale; + } + super.executeCommand(server, session, command, callback); + } +} +exports.CollStatsOperation = CollStatsOperation; +/** @internal */ +class DbStatsOperation extends command_1.CommandOperation { + constructor(db, options) { + super(db, options); + this.options = options; + } + execute(server, session, callback) { + const command = { dbStats: true }; + if (this.options.scale != null) { + command.scale = this.options.scale; + } + super.executeCommand(server, session, command, callback); + } +} +exports.DbStatsOperation = DbStatsOperation; +(0, operation_1.defineAspects)(CollStatsOperation, [operation_1.Aspect.READ_OPERATION]); +(0, operation_1.defineAspects)(DbStatsOperation, [operation_1.Aspect.READ_OPERATION]); +//# sourceMappingURL=stats.js.map \ No newline at end of file diff --git a/node_modules/mongodb/lib/operations/stats.js.map b/node_modules/mongodb/lib/operations/stats.js.map new file mode 100644 index 000000000..aca364553 --- /dev/null +++ b/node_modules/mongodb/lib/operations/stats.js.map @@ -0,0 +1 @@ +{"version":3,"file":"stats.js","sourceRoot":"","sources":["../../src/operations/stats.ts"],"names":[],"mappings":";;;AAMA,uCAAsE;AACtE,2CAAoD;AAQpD;;;GAGG;AACH,MAAa,kBAAmB,SAAQ,0BAA0B;IAIhE;;;;;OAKG;IACH,YAAY,UAAsB,EAAE,OAA0B;QAC5D,KAAK,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;QAC3B,IAA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newline at end of file diff --git a/node_modules/mongodb/lib/operations/update.js b/node_modules/mongodb/lib/operations/update.js new file mode 100644 index 000000000..03c825ec7 --- /dev/null +++ b/node_modules/mongodb/lib/operations/update.js @@ -0,0 +1,200 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.makeUpdateStatement = exports.ReplaceOneOperation = exports.UpdateManyOperation = exports.UpdateOneOperation = exports.UpdateOperation = void 0; +const error_1 = require("../error"); +const utils_1 = require("../utils"); +const command_1 = require("./command"); +const operation_1 = require("./operation"); +/** @internal */ +class UpdateOperation extends command_1.CommandOperation { + constructor(ns, statements, options) { + super(undefined, options); + this.options = options; + this.ns = ns; + this.statements = statements; + } + get canRetryWrite() { + if (super.canRetryWrite === false) { + return false; + } + return this.statements.every(op => op.multi == null || op.multi === false); + } + execute(server, session, callback) { + var _a; + const options = (_a = this.options) !== null && _a !== void 0 ? _a : {}; + const ordered = typeof options.ordered === 'boolean' ? options.ordered : true; + const command = { + update: this.ns.collection, + updates: this.statements, + ordered + }; + if (typeof options.bypassDocumentValidation === 'boolean') { + command.bypassDocumentValidation = options.bypassDocumentValidation; + } + if (options.let) { + command.let = options.let; + } + // we check for undefined specifically here to allow falsy values + // eslint-disable-next-line no-restricted-syntax + if (options.comment !== undefined) { + command.comment = options.comment; + } + const statementWithCollation = this.statements.find(statement => !!statement.collation); + if ((0, utils_1.collationNotSupported)(server, options) || + (statementWithCollation && (0, utils_1.collationNotSupported)(server, statementWithCollation))) { + callback(new error_1.MongoCompatibilityError(`Server ${server.name} does not support collation`)); + return; + } + const unacknowledgedWrite = this.writeConcern && this.writeConcern.w === 0; + if (unacknowledgedWrite || (0, utils_1.maxWireVersion)(server) < 5) { + if (this.statements.find((o) => o.hint)) { + callback(new error_1.MongoCompatibilityError(`Servers < 3.4 do not support hint on update`)); + return; + } + } + if (this.explain && (0, utils_1.maxWireVersion)(server) < 3) { + callback(new error_1.MongoCompatibilityError(`Server ${server.name} does not support explain on update`)); + return; + } + if (this.statements.some(statement => !!statement.arrayFilters) && (0, utils_1.maxWireVersion)(server) < 6) { + callback(new error_1.MongoCompatibilityError('Option "arrayFilters" is only supported on MongoDB 3.6+')); + return; + } + super.executeCommand(server, session, command, callback); + } +} +exports.UpdateOperation = UpdateOperation; +/** @internal */ +class UpdateOneOperation extends UpdateOperation { + constructor(collection, filter, update, options) { + super(collection.s.namespace, [makeUpdateStatement(filter, update, { ...options, multi: false })], options); + if (!(0, utils_1.hasAtomicOperators)(update)) { + throw new error_1.MongoInvalidArgumentError('Update document requires atomic operators'); + } + } + execute(server, session, callback) { + super.execute(server, session, (err, res) => { + var _a, _b; + if (err || !res) + return callback(err); + if (this.explain != null) + return callback(undefined, res); + if (res.code) + return callback(new error_1.MongoServerError(res)); + if (res.writeErrors) + return callback(new error_1.MongoServerError(res.writeErrors[0])); + callback(undefined, { + acknowledged: (_b = ((_a = this.writeConcern) === null || _a === void 0 ? void 0 : _a.w) !== 0) !== null && _b !== void 0 ? _b : true, + modifiedCount: res.nModified != null ? res.nModified : res.n, + upsertedId: Array.isArray(res.upserted) && res.upserted.length > 0 ? res.upserted[0]._id : null, + upsertedCount: Array.isArray(res.upserted) && res.upserted.length ? res.upserted.length : 0, + matchedCount: Array.isArray(res.upserted) && res.upserted.length > 0 ? 0 : res.n + }); + }); + } +} +exports.UpdateOneOperation = UpdateOneOperation; +/** @internal */ +class UpdateManyOperation extends UpdateOperation { + constructor(collection, filter, update, options) { + super(collection.s.namespace, [makeUpdateStatement(filter, update, { ...options, multi: true })], options); + if (!(0, utils_1.hasAtomicOperators)(update)) { + throw new error_1.MongoInvalidArgumentError('Update document requires atomic operators'); + } + } + execute(server, session, callback) { + super.execute(server, session, (err, res) => { + var _a, _b; + if (err || !res) + return callback(err); + if (this.explain != null) + return callback(undefined, res); + if (res.code) + return callback(new error_1.MongoServerError(res)); + if (res.writeErrors) + return callback(new error_1.MongoServerError(res.writeErrors[0])); + callback(undefined, { + acknowledged: (_b = ((_a = this.writeConcern) === null || _a === void 0 ? void 0 : _a.w) !== 0) !== null && _b !== void 0 ? _b : true, + modifiedCount: res.nModified != null ? res.nModified : res.n, + upsertedId: Array.isArray(res.upserted) && res.upserted.length > 0 ? res.upserted[0]._id : null, + upsertedCount: Array.isArray(res.upserted) && res.upserted.length ? res.upserted.length : 0, + matchedCount: Array.isArray(res.upserted) && res.upserted.length > 0 ? 0 : res.n + }); + }); + } +} +exports.UpdateManyOperation = UpdateManyOperation; +/** @internal */ +class ReplaceOneOperation extends UpdateOperation { + constructor(collection, filter, replacement, options) { + super(collection.s.namespace, [makeUpdateStatement(filter, replacement, { ...options, multi: false })], options); + if ((0, utils_1.hasAtomicOperators)(replacement)) { + throw new error_1.MongoInvalidArgumentError('Replacement document must not contain atomic operators'); + } + } + execute(server, session, callback) { + super.execute(server, session, (err, res) => { + var _a, _b; + if (err || !res) + return callback(err); + if (this.explain != null) + return callback(undefined, res); + if (res.code) + return callback(new error_1.MongoServerError(res)); + if (res.writeErrors) + return callback(new error_1.MongoServerError(res.writeErrors[0])); + callback(undefined, { + acknowledged: (_b = ((_a = this.writeConcern) === null || _a === void 0 ? void 0 : _a.w) !== 0) !== null && _b !== void 0 ? _b : true, + modifiedCount: res.nModified != null ? res.nModified : res.n, + upsertedId: Array.isArray(res.upserted) && res.upserted.length > 0 ? res.upserted[0]._id : null, + upsertedCount: Array.isArray(res.upserted) && res.upserted.length ? res.upserted.length : 0, + matchedCount: Array.isArray(res.upserted) && res.upserted.length > 0 ? 0 : res.n + }); + }); + } +} +exports.ReplaceOneOperation = ReplaceOneOperation; +function makeUpdateStatement(filter, update, options) { + if (filter == null || typeof filter !== 'object') { + throw new error_1.MongoInvalidArgumentError('Selector must be a valid JavaScript object'); + } + if (update == null || typeof update !== 'object') { + throw new error_1.MongoInvalidArgumentError('Document must be a valid JavaScript object'); + } + const op = { q: filter, u: update }; + if (typeof options.upsert === 'boolean') { + op.upsert = options.upsert; + } + if (options.multi) { + op.multi = options.multi; + } + if (options.hint) { + op.hint = options.hint; + } + if (options.arrayFilters) { + op.arrayFilters = options.arrayFilters; + } + if (options.collation) { + op.collation = options.collation; + } + return op; +} +exports.makeUpdateStatement = makeUpdateStatement; +(0, operation_1.defineAspects)(UpdateOperation, [operation_1.Aspect.RETRYABLE, operation_1.Aspect.WRITE_OPERATION, operation_1.Aspect.SKIP_COLLATION]); +(0, operation_1.defineAspects)(UpdateOneOperation, [ + operation_1.Aspect.RETRYABLE, + operation_1.Aspect.WRITE_OPERATION, + operation_1.Aspect.EXPLAINABLE, + operation_1.Aspect.SKIP_COLLATION +]); +(0, operation_1.defineAspects)(UpdateManyOperation, [ + operation_1.Aspect.WRITE_OPERATION, + operation_1.Aspect.EXPLAINABLE, + operation_1.Aspect.SKIP_COLLATION +]); +(0, operation_1.defineAspects)(ReplaceOneOperation, [ + operation_1.Aspect.RETRYABLE, + operation_1.Aspect.WRITE_OPERATION, + operation_1.Aspect.SKIP_COLLATION +]); +//# sourceMappingURL=update.js.map \ No newline at end of file diff --git a/node_modules/mongodb/lib/operations/update.js.map b/node_modules/mongodb/lib/operations/update.js.map new file mode 100644 index 000000000..bc10fed98 --- /dev/null +++ b/node_modules/mongodb/lib/operations/update.js.map @@ -0,0 +1 @@ +{"version":3,"file":"update.js","sourceRoot":"","sources":["../../src/operations/update.ts"],"names":[],"mappings":";;;AAEA,oCAAgG;AAGhG,oCAMkB;AAClB,uCAAwF;AACxF,2CAA0D;AAkD1D,gBAAgB;AAChB,MAAa,eAAgB,SAAQ,0BAA0B;IAI7D,YACE,EAAoB,EACpB,UAA6B,EAC7B,OAA8C;QAE9C,KAAK,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;QAC1B,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC;QAEb,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;IAC/B,CAAC;IAED,IAAa,aAAa;QACxB,IAAI,KAAK,CAAC,aAAa,KAAK,KAAK,EAAE;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AE;QACrB,EAAE,CAAC,SAAS,GAAG,OAAO,CAAC,SAAS,CAAC;KAClC;IAED,OAAO,EAAE,CAAC;AACZ,CAAC;AAnCD,kDAmCC;AAED,IAAA,yBAAa,EAAC,eAAe,EAAE,CAAC,kBAAM,CAAC,SAAS,EAAE,kBAAM,CAAC,eAAe,EAAE,kBAAM,CAAC,cAAc,CAAC,CAAC,CAAC;AAClG,IAAA,yBAAa,EAAC,kBAAkB,EAAE;IAChC,kBAAM,CAAC,SAAS;IAChB,kBAAM,CAAC,eAAe;IACtB,kBAAM,CAAC,WAAW;IAClB,kBAAM,CAAC,cAAc;CACtB,CAAC,CAAC;AACH,IAAA,yBAAa,EAAC,mBAAmB,EAAE;IACjC,kBAAM,CAAC,eAAe;IACtB,kBAAM,CAAC,WAAW;IAClB,kBAAM,CAAC,cAAc;CACtB,CAAC,CAAC;AACH,IAAA,yBAAa,EAAC,mBAAmB,EAAE;IACjC,kBAAM,CAAC,SAAS;IAChB,kBAAM,CAAC,eAAe;IACtB,kBAAM,CAAC,cAAc;CACtB,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/mongodb/lib/operations/validate_collection.js b/node_modules/mongodb/lib/operations/validate_collection.js new file mode 100644 index 000000000..1a7c978ec --- /dev/null +++ b/node_modules/mongodb/lib/operations/validate_collection.js @@ -0,0 +1,41 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ValidateCollectionOperation = void 0; +const error_1 = require("../error"); +const command_1 = require("./command"); +/** @internal */ +class ValidateCollectionOperation extends command_1.CommandOperation { + constructor(admin, collectionName, options) { + // Decorate command with extra options + const command = { validate: collectionName }; + const keys = Object.keys(options); + for (let i = 0; i < keys.length; i++) { + if (Object.prototype.hasOwnProperty.call(options, keys[i]) && keys[i] !== 'session') { + command[keys[i]] = options[keys[i]]; + } + } + super(admin.s.db, options); + this.options = options; + this.command = command; + this.collectionName = collectionName; + } + execute(server, session, callback) { + const collectionName = this.collectionName; + super.executeCommand(server, session, this.command, (err, doc) => { + if (err != null) + return callback(err); + // TODO(NODE-3483): Replace these with MongoUnexpectedServerResponseError + if (doc.ok === 0) + return callback(new error_1.MongoRuntimeError('Error with validate command')); + if (doc.result != null && typeof doc.result !== 'string') + return callback(new error_1.MongoRuntimeError('Error with validation data')); + if (doc.result != null && doc.result.match(/exception|corrupt/) != null) + return callback(new error_1.MongoRuntimeError(`Invalid collection ${collectionName}`)); + if (doc.valid != null && !doc.valid) + return callback(new error_1.MongoRuntimeError(`Invalid collection ${collectionName}`)); + return callback(undefined, doc); + }); + } +} +exports.ValidateCollectionOperation = ValidateCollectionOperation; +//# sourceMappingURL=validate_collection.js.map \ No newline at end of file diff --git a/node_modules/mongodb/lib/operations/validate_collection.js.map b/node_modules/mongodb/lib/operations/validate_collection.js.map new file mode 100644 index 000000000..9d72c4185 --- /dev/null +++ b/node_modules/mongodb/lib/operations/validate_collection.js.map @@ -0,0 +1 @@ +{"version":3,"file":"validate_collection.js","sourceRoot":"","sources":["../../src/operations/validate_collection.ts"],"names":[],"mappings":";;;AAEA,oCAA6C;AAI7C,uCAAsE;AAQtE,gBAAgB;AAChB,MAAa,2BAA4B,SAAQ,0BAA0B;IAKzE,YAAY,KAAY,EAAE,cAAsB,EAAE,OAAkC;QAClF,sCAAsC;QACtC,MAAM,OAAO,GAAa,EAAE,QAAQ,EAAE,cAAc,EAAE,CAAC;QACvD,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAClC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;YACpC,IAAI,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,KAAK,SAAS,EAAE;gBACnF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,GAAI,OAAoB,CAAC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AAG,CAAC,CAAC;QAClC,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AA3CD,kEA2CC"} \ No newline at end of file diff --git a/node_modules/mongodb/lib/promise_provider.js b/node_modules/mongodb/lib/promise_provider.js new file mode 100644 index 000000000..e76480a29 --- /dev/null +++ b/node_modules/mongodb/lib/promise_provider.js @@ -0,0 +1,36 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.PromiseProvider = void 0; +const error_1 = require("./error"); +/** @internal */ +const kPromise = Symbol('promise'); +const store = { + [kPromise]: undefined +}; +/** + * Global promise store allowing user-provided promises + * @public + */ +class PromiseProvider { + /** Validates the passed in promise library */ + static validate(lib) { + if (typeof lib !== 'function') + throw new error_1.MongoInvalidArgumentError(`Promise must be a function, got ${lib}`); + return !!lib; + } + /** Sets the promise library */ + static set(lib) { + if (!PromiseProvider.validate(lib)) { + // validate + return; + } + store[kPromise] = lib; + } + /** Get the stored promise library, or resolves passed in */ + static get() { + return store[kPromise]; + } +} +exports.PromiseProvider = PromiseProvider; +PromiseProvider.set(global.Promise); +//# sourceMappingURL=promise_provider.js.map \ No newline at end of file diff --git a/node_modules/mongodb/lib/promise_provider.js.map b/node_modules/mongodb/lib/promise_provider.js.map new file mode 100644 index 000000000..703bee2c9 --- /dev/null +++ b/node_modules/mongodb/lib/promise_provider.js.map @@ -0,0 +1 @@ +{"version":3,"file":"promise_provider.js","sourceRoot":"","sources":["../src/promise_provider.ts"],"names":[],"mappings":";;;AAAA,mCAAoD;AAEpD,gBAAgB;AAChB,MAAM,QAAQ,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC;AAMnC,MAAM,KAAK,GAAiB;IAC1B,CAAC,QAAQ,CAAC,EAAE,SAAS;CACtB,CAAC;AAEF;;;GAGG;AACH,MAAa,eAAe;IAC1B,8CAA8C;IAC9C,MAAM,CAAC,QAAQ,CAAC,GAAY;QAC1B,IAAI,OAAO,GAAG,KAAK,UAAU;YAC3B,MAAM,IAAI,iCAAyB,CAAC,mCAAmC,GAAG,EAAE,CAAC,CAAC;QAChF,OAAO,CAAC,CAAC,GAAG,CAAC;IACf,CAAC;IAED,+BAA+B;IAC/B,MAAM,CAAC,GAAG,CAAC,GAAuB;QAChC,IAAI,CAAC,eAAe,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;YAClC,WAAW;YACX,OAAO;SACR;QACD,KAAK,CAAC,QAAQ,CAAC,GAAG,GAAG,CAAC;IACxB,CAAC;IAED,4DAA4D;IAC5D,MAAM,CAAC,GAAG;QACR,OAAO,KAAK,CAAC,QAAQ,CAAuB,CAAC;IAC/C,CAAC;CACF;AArBD,0CAqBC;AAED,eAAe,CAAC,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC"} \ No newline at end of file diff --git a/node_modules/mongodb/lib/read_concern.js b/node_modules/mongodb/lib/read_concern.js new file mode 100644 index 000000000..9b1e067a9 --- /dev/null +++ b/node_modules/mongodb/lib/read_concern.js @@ -0,0 +1,74 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ReadConcern = exports.ReadConcernLevel = void 0; +/** @public */ +exports.ReadConcernLevel = Object.freeze({ + local: 'local', + majority: 'majority', + linearizable: 'linearizable', + available: 'available', + snapshot: 'snapshot' +}); +/** + * The MongoDB ReadConcern, which allows for control of the consistency and isolation properties + * of the data read from replica sets and replica set shards. + * @public + * + * @see https://docs.mongodb.com/manual/reference/read-concern/index.html + */ +class ReadConcern { + /** Constructs a ReadConcern from the read concern level.*/ + constructor(level) { + var _a; + /** + * A spec test exists that allows level to be any string. + * "invalid readConcern with out stage" + * @see ./test/spec/crud/v2/aggregate-out-readConcern.json + * @see https://github.com/mongodb/specifications/blob/master/source/read-write-concern/read-write-concern.rst#unknown-levels-and-additional-options-for-string-based-readconcerns + */ + this.level = (_a = exports.ReadConcernLevel[level]) !== null && _a !== void 0 ? _a : level; + } + /** + * Construct a ReadConcern given an options object. + * + * @param options - The options object from which to extract the write concern. + */ + static fromOptions(options) { + if (options == null) { + return; + } + if (options.readConcern) { + const { readConcern } = options; + if (readConcern instanceof ReadConcern) { + return readConcern; + } + else if (typeof readConcern === 'string') { + return new ReadConcern(readConcern); + } + else if ('level' in readConcern && readConcern.level) { + return new ReadConcern(readConcern.level); + } + } + if (options.level) { + return new ReadConcern(options.level); + } + return; + } + static get MAJORITY() { + return exports.ReadConcernLevel.majority; + } + static get AVAILABLE() { + return exports.ReadConcernLevel.available; + } + static get LINEARIZABLE() { + return exports.ReadConcernLevel.linearizable; + } + static get SNAPSHOT() { + return exports.ReadConcernLevel.snapshot; + } + toJSON() { + return { level: this.level }; + } +} +exports.ReadConcern = ReadConcern; +//# sourceMappingURL=read_concern.js.map \ No newline at end of file diff --git a/node_modules/mongodb/lib/read_concern.js.map b/node_modules/mongodb/lib/read_concern.js.map new file mode 100644 index 000000000..3f74a96e6 --- /dev/null +++ b/node_modules/mongodb/lib/read_concern.js.map @@ -0,0 +1 @@ +{"version":3,"file":"read_concern.js","sourceRoot":"","sources":["../src/read_concern.ts"],"names":[],"mappings":";;;AAEA,cAAc;AACD,QAAA,gBAAgB,GAAG,MAAM,CAAC,MAAM,CAAC;IAC5C,KAAK,EAAE,OAAO;IACd,QAAQ,EAAE,UAAU;IACpB,YAAY,EAAE,cAAc;IAC5B,SAAS,EAAE,WAAW;IACtB,QAAQ,EAAE,UAAU;CACZ,CAAC,CAAC;AAQZ;;;;;;GAMG;AACH,MAAa,WAAW;IAGtB,2DAA2D;IAC3D,YAAY,KAAuB;;QACjC;;;;;WAKG;QACH,IAAI,CAAC,KAAK,GAAG,MAAA,wBAAgB,CAAC,KAAK,CAAC,mCAAI,KAAK,CAAC;IAChD,CAAC;IAED;;;;OAIG;IACH,MAAM,CAAC,WAAW,CAAC,OAGlB;QACC,IAAI,OAAO,IAAI,IAAI,EAAE;YACnB,OAAO;SACR;QAED,IAAI,OAAO,CAAC,WAAW,EAAE;YACvB,MAAM,EAAE,WAAW,EAAE,GAAG,OAAO,CAAC;YAChC,IAAI,WAAW,YAAY,WAAW,EAAE;gBACtC,OAAO,WAAW,CAAC;aACpB;iBAAM,IAAI,OAAO,WAAW,KAAK,QAAQ,EAAE;gBAC1C,OAAO,IAAI,WAAW,CAAC,WAAW,CAAC,CAAC;aACrC;iBAAM,IAAI,OAAO,IAAI,WAAW,IAAI,WAAW,CAAC,KAAK,EAAE;gBACtD,OAAO,IAAI,WAAW,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;aAC3C;SACF;QAED,IAAI,OAAO,CAAC,KAAK,EAAE;YACjB,OAAO,IAAI,WAAW,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;SACvC;QACD,OAAO;IACT,CAAC;IAED,MAAM,KAAK,QAAQ;QACjB,OAAO,wBAAgB,CAAC,QAAQ,CAAC;IACnC,CAAC;IAED,MAAM,KAAK,SAAS;QAClB,OAAO,wBAAgB,CAAC,SAAS,CAAC;IACpC,CAAC;IAED,MAAM,KAAK,YAAY;QACrB,OAAO,wBAAgB,CAAC,YAAY,CAAC;IACvC,CAAC;IAED,MAAM,KAAK,QAAQ;QACjB,OAAO,wBAAgB,CAAC,QAAQ,CAAC;IACnC,CAAC;IAED,MAAM;QACJ,OAAO,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,CAAC;IAC/B,CAAC;CACF;AA/DD,kCA+DC"} \ No newline at end of file diff --git a/node_modules/mongodb/lib/read_preference.js b/node_modules/mongodb/lib/read_preference.js new file mode 100644 index 000000000..6df80eff8 --- /dev/null +++ b/node_modules/mongodb/lib/read_preference.js @@ -0,0 +1,204 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ReadPreference = exports.ReadPreferenceMode = void 0; +const error_1 = require("./error"); +/** @public */ +exports.ReadPreferenceMode = Object.freeze({ + primary: 'primary', + primaryPreferred: 'primaryPreferred', + secondary: 'secondary', + secondaryPreferred: 'secondaryPreferred', + nearest: 'nearest' +}); +/** + * The **ReadPreference** class is a class that represents a MongoDB ReadPreference and is + * used to construct connections. + * @public + * + * @see https://docs.mongodb.com/manual/core/read-preference/ + */ +class ReadPreference { + /** + * @param mode - A string describing the read preference mode (primary|primaryPreferred|secondary|secondaryPreferred|nearest) + * @param tags - A tag set used to target reads to members with the specified tag(s). tagSet is not available if using read preference mode primary. + * @param options - Additional read preference options + */ + constructor(mode, tags, options) { + if (!ReadPreference.isValid(mode)) { + throw new error_1.MongoInvalidArgumentError(`Invalid read preference mode ${JSON.stringify(mode)}`); + } + if (options == null && typeof tags === 'object' && !Array.isArray(tags)) { + options = tags; + tags = undefined; + } + else if (tags && !Array.isArray(tags)) { + throw new error_1.MongoInvalidArgumentError('ReadPreference tags must be an array'); + } + this.mode = mode; + this.tags = tags; + this.hedge = options === null || options === void 0 ? void 0 : options.hedge; + this.maxStalenessSeconds = undefined; + this.minWireVersion = undefined; + options = options !== null && options !== void 0 ? options : {}; + if (options.maxStalenessSeconds != null) { + if (options.maxStalenessSeconds <= 0) { + throw new error_1.MongoInvalidArgumentError('maxStalenessSeconds must be a positive integer'); + } + this.maxStalenessSeconds = options.maxStalenessSeconds; + // NOTE: The minimum required wire version is 5 for this read preference. If the existing + // topology has a lower value then a MongoError will be thrown during server selection. + this.minWireVersion = 5; + } + if (this.mode === ReadPreference.PRIMARY) { + if (this.tags && Array.isArray(this.tags) && this.tags.length > 0) { + throw new error_1.MongoInvalidArgumentError('Primary read preference cannot be combined with tags'); + } + if (this.maxStalenessSeconds) { + throw new error_1.MongoInvalidArgumentError('Primary read preference cannot be combined with maxStalenessSeconds'); + } + if (this.hedge) { + throw new error_1.MongoInvalidArgumentError('Primary read preference cannot be combined with hedge'); + } + } + } + // Support the deprecated `preference` property introduced in the porcelain layer + get preference() { + return this.mode; + } + static fromString(mode) { + return new ReadPreference(mode); + } + /** + * Construct a ReadPreference given an options object. + * + * @param options - The options object from which to extract the read preference. + */ + static fromOptions(options) { + var _a, _b, _c; + if (!options) + return; + const readPreference = (_a = options.readPreference) !== null && _a !== void 0 ? _a : (_b = options.session) === null || _b === void 0 ? void 0 : _b.transaction.options.readPreference; + const readPreferenceTags = options.readPreferenceTags; + if (readPreference == null) { + return; + } + if (typeof readPreference === 'string') { + return new ReadPreference(readPreference, readPreferenceTags, { + maxStalenessSeconds: options.maxStalenessSeconds, + hedge: options.hedge + }); + } + else if (!(readPreference instanceof ReadPreference) && typeof readPreference === 'object') { + const mode = readPreference.mode || readPreference.preference; + if (mode && typeof mode === 'string') { + return new ReadPreference(mode, (_c = readPreference.tags) !== null && _c !== void 0 ? _c : readPreferenceTags, { + maxStalenessSeconds: readPreference.maxStalenessSeconds, + hedge: options.hedge + }); + } + } + if (readPreferenceTags) { + readPreference.tags = readPreferenceTags; + } + return readPreference; + } + /** + * Replaces options.readPreference with a ReadPreference instance + */ + static translate(options) { + if (options.readPreference == null) + return options; + const r = options.readPreference; + if (typeof r === 'string') { + options.readPreference = new ReadPreference(r); + } + else if (r && !(r instanceof ReadPreference) && typeof r === 'object') { + const mode = r.mode || r.preference; + if (mode && typeof mode === 'string') { + options.readPreference = new ReadPreference(mode, r.tags, { + maxStalenessSeconds: r.maxStalenessSeconds + }); + } + } + else if (!(r instanceof ReadPreference)) { + throw new error_1.MongoInvalidArgumentError(`Invalid read preference: ${r}`); + } + return options; + } + /** + * Validate if a mode is legal + * + * @param mode - The string representing the read preference mode. + */ + static isValid(mode) { + const VALID_MODES = new Set([ + ReadPreference.PRIMARY, + ReadPreference.PRIMARY_PREFERRED, + ReadPreference.SECONDARY, + ReadPreference.SECONDARY_PREFERRED, + ReadPreference.NEAREST, + null + ]); + return VALID_MODES.has(mode); + } + /** + * Validate if a mode is legal + * + * @param mode - The string representing the read preference mode. + */ + isValid(mode) { + return ReadPreference.isValid(typeof mode === 'string' ? mode : this.mode); + } + /** + * Indicates that this readPreference needs the "secondaryOk" bit when sent over the wire + * @deprecated Use secondaryOk instead + * @see https://docs.mongodb.com/manual/reference/mongodb-wire-protocol/#op-query + */ + slaveOk() { + return this.secondaryOk(); + } + /** + * Indicates that this readPreference needs the "SecondaryOk" bit when sent over the wire + * @see https://docs.mongodb.com/manual/reference/mongodb-wire-protocol/#op-query + */ + secondaryOk() { + const NEEDS_SECONDARYOK = new Set([ + ReadPreference.PRIMARY_PREFERRED, + ReadPreference.SECONDARY, + ReadPreference.SECONDARY_PREFERRED, + ReadPreference.NEAREST + ]); + return NEEDS_SECONDARYOK.has(this.mode); + } + /** + * Check if the two ReadPreferences are equivalent + * + * @param readPreference - The read preference with which to check equality + */ + equals(readPreference) { + return readPreference.mode === this.mode; + } + /** Return JSON representation */ + toJSON() { + const readPreference = { mode: this.mode }; + if (Array.isArray(this.tags)) + readPreference.tags = this.tags; + if (this.maxStalenessSeconds) + readPreference.maxStalenessSeconds = this.maxStalenessSeconds; + if (this.hedge) + readPreference.hedge = this.hedge; + return readPreference; + } +} +exports.ReadPreference = ReadPreference; +ReadPreference.PRIMARY = exports.ReadPreferenceMode.primary; +ReadPreference.PRIMARY_PREFERRED = exports.ReadPreferenceMode.primaryPreferred; +ReadPreference.SECONDARY = exports.ReadPreferenceMode.secondary; +ReadPreference.SECONDARY_PREFERRED = exports.ReadPreferenceMode.secondaryPreferred; +ReadPreference.NEAREST = exports.ReadPreferenceMode.nearest; +ReadPreference.primary = new ReadPreference(exports.ReadPreferenceMode.primary); +ReadPreference.primaryPreferred = new ReadPreference(exports.ReadPreferenceMode.primaryPreferred); +ReadPreference.secondary = new ReadPreference(exports.ReadPreferenceMode.secondary); +ReadPreference.secondaryPreferred = new ReadPreference(exports.ReadPreferenceMode.secondaryPreferred); +ReadPreference.nearest = new ReadPreference(exports.ReadPreferenceMode.nearest); +//# sourceMappingURL=read_preference.js.map \ No newline at end of file diff --git a/node_modules/mongodb/lib/read_preference.js.map b/node_modules/mongodb/lib/read_preference.js.map new file mode 100644 index 000000000..a67ad7af5 --- /dev/null +++ b/node_modules/mongodb/lib/read_preference.js.map @@ -0,0 +1 @@ +{"version":3,"file":"read_preference.js","sourceRoot":"","sources":["../src/read_preference.ts"],"names":[],"mappings":";;;AACA,mCAAoD;AAOpD,cAAc;AACD,QAAA,kBAAkB,GAAG,MAAM,CAAC,MAAM,CAAC;IAC9C,OAAO,EAAE,SAAS;IAClB,gBAAgB,EAAE,kBAAkB;IACpC,SAAS,EAAE,WAAW;IACtB,kBAAkB,EAAE,oBAAoB;IACxC,OAAO,EAAE,SAAS;CACV,CAAC,CAAC;AAsCZ;;;;;;GAMG;AACH,MAAa,cAAc;IAmBzB;;;;OAIG;IACH,YAAY,IAAwB,EAAE,IAAe,EAAE,OAA+B;QACpF,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE;YACjC,MAAM,IAAI,iCAAyB,CAAC,gCAAgC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;SAC7F;QACD,IAAI,OAAO,IAAI,IAAI,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE;YACvE,OAAO,GAAG,IAAI,CAAC;YACf,IAAI,GAAG,SAAS,CAAC;SAClB;aAAM,IAAI,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE;YACvC,MAAM,IAAI,iCAAyB,CAAC,sCAAsC,CAAC,CAAC;SAC7E;QAED,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,KAAK,GAAG,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,KAAK,CAAC;QAC5B,IAAI,CAAC,mBAAmB,GAAG,SAAS,CAAC;QACrC,IAAI,CAAC,c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mongodb/lib/sdam/common.js b/node_modules/mongodb/lib/sdam/common.js new file mode 100644 index 000000000..3a6929e6a --- /dev/null +++ b/node_modules/mongodb/lib/sdam/common.js @@ -0,0 +1,55 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports._advanceClusterTime = exports.drainTimerQueue = exports.ServerType = exports.TopologyType = exports.STATE_CONNECTED = exports.STATE_CONNECTING = exports.STATE_CLOSED = exports.STATE_CLOSING = void 0; +// shared state names +exports.STATE_CLOSING = 'closing'; +exports.STATE_CLOSED = 'closed'; +exports.STATE_CONNECTING = 'connecting'; +exports.STATE_CONNECTED = 'connected'; +/** + * An enumeration of topology types we know about + * @public + */ +exports.TopologyType = Object.freeze({ + Single: 'Single', + ReplicaSetNoPrimary: 'ReplicaSetNoPrimary', + ReplicaSetWithPrimary: 'ReplicaSetWithPrimary', + Sharded: 'Sharded', + Unknown: 'Unknown', + LoadBalanced: 'LoadBalanced' +}); +/** + * An enumeration of server types we know about + * @public + */ +exports.ServerType = Object.freeze({ + Standalone: 'Standalone', + Mongos: 'Mongos', + PossiblePrimary: 'PossiblePrimary', + RSPrimary: 'RSPrimary', + RSSecondary: 'RSSecondary', + RSArbiter: 'RSArbiter', + RSOther: 'RSOther', + RSGhost: 'RSGhost', + Unknown: 'Unknown', + LoadBalancer: 'LoadBalancer' +}); +/** @internal */ +function drainTimerQueue(queue) { + queue.forEach(clearTimeout); + queue.clear(); +} +exports.drainTimerQueue = drainTimerQueue; +/** Shared function to determine clusterTime for a given topology or session */ +function _advanceClusterTime(entity, $clusterTime) { + if (entity.clusterTime == null) { + entity.clusterTime = $clusterTime; + } + else { + if ($clusterTime.clusterTime.greaterThan(entity.clusterTime.clusterTime)) { + entity.clusterTime = $clusterTime; + } + } +} +exports._advanceClusterTime = _advanceClusterTime; +//# sourceMappingURL=common.js.map \ No newline at end of file diff --git a/node_modules/mongodb/lib/sdam/common.js.map b/node_modules/mongodb/lib/sdam/common.js.map new file mode 100644 index 000000000..8771ed460 --- /dev/null +++ b/node_modules/mongodb/lib/sdam/common.js.map @@ -0,0 +1 @@ +{"version":3,"file":"common.js","sourceRoot":"","sources":["../../src/sdam/common.ts"],"names":[],"mappings":";;;AAIA,qBAAqB;AACR,QAAA,aAAa,GAAG,SAAS,CAAC;AAC1B,QAAA,YAAY,GAAG,QAAQ,CAAC;AACxB,QAAA,gBAAgB,GAAG,YAAY,CAAC;AAChC,QAAA,eAAe,GAAG,WAAW,CAAC;AAE3C;;;GAGG;AACU,QAAA,YAAY,GAAG,MAAM,CAAC,MAAM,CAAC;IACxC,MAAM,EAAE,QAAQ;IAChB,mBAAmB,EAAE,qBAAqB;IAC1C,qBAAqB,EAAE,uBAAuB;IAC9C,OAAO,EAAE,SAAS;IAClB,OAAO,EAAE,SAAS;IAClB,YAAY,EAAE,cAAc;CACpB,CAAC,CAAC;AAKZ;;;GAGG;AACU,QAAA,UAAU,GAAG,MAAM,CAAC,MAAM,CAAC;IACtC,UAAU,EAAE,YAAY;IACxB,MAAM,EAAE,QAAQ;IAChB,eAAe,EAAE,iBAAiB;IAClC,SAAS,EAAE,WAAW;IACtB,WAAW,EAAE,aAAa;IAC1B,SAAS,EAAE,WAAW;IACtB,OAAO,EAAE,SAAS;IAClB,OAAO,EAAE,SAAS;IAClB,OAAO,EAAE,SAAS;IAClB,YAAY,EAAE,cAAc;CACpB,CAAC,CAAC;AAQZ,gBAAgB;AAChB,SAAgB,eAAe,CAAC,KAAiB;IAC/C,KAAK,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC;IAC5B,KAAK,CAAC,KAAK,EAAE,CAAC;AAChB,CAAC;AAHD,0CAGC;AAWD,+EAA+E;AAC/E,SAAgB,mBAAmB,CACjC,MAAgC,EAChC,YAAyB;IAEzB,IAAI,MAAM,CAAC,WAAW,IAAI,IAAI,EAAE;QAC9B,MAAM,CAAC,WAAW,GAAG,YAAY,CAAC;KACnC;SAAM;QACL,IAAI,YAAY,CAAC,WAAW,CAAC,WAAW,CAAC,MAAM,CAAC,WAAW,CAAC,WAAW,CAAC,EAAE;YACxE,MAAM,CAAC,WAAW,GAAG,YAAY,CAAC;SACnC;KACF;AACH,CAAC;AAXD,kDAWC"} \ No newline at end of file diff --git a/node_modules/mongodb/lib/sdam/events.js b/node_modules/mongodb/lib/sdam/events.js new file mode 100644 index 000000000..9943108b1 --- /dev/null +++ b/node_modules/mongodb/lib/sdam/events.js @@ -0,0 +1,125 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ServerHeartbeatFailedEvent = exports.ServerHeartbeatSucceededEvent = exports.ServerHeartbeatStartedEvent = exports.TopologyClosedEvent = exports.TopologyOpeningEvent = exports.TopologyDescriptionChangedEvent = exports.ServerClosedEvent = exports.ServerOpeningEvent = exports.ServerDescriptionChangedEvent = void 0; +/** + * Emitted when server description changes, but does NOT include changes to the RTT. + * @public + * @category Event + */ +class ServerDescriptionChangedEvent { + /** @internal */ + constructor(topologyId, address, previousDescription, newDescription) { + this.topologyId = topologyId; + this.address = address; + this.previousDescription = previousDescription; + this.newDescription = newDescription; + } +} +exports.ServerDescriptionChangedEvent = ServerDescriptionChangedEvent; +/** + * Emitted when server is initialized. + * @public + * @category Event + */ +class ServerOpeningEvent { + /** @internal */ + constructor(topologyId, address) { + this.topologyId = topologyId; + this.address = address; + } +} +exports.ServerOpeningEvent = ServerOpeningEvent; +/** + * Emitted when server is closed. + * @public + * @category Event + */ +class ServerClosedEvent { + /** @internal */ + constructor(topologyId, address) { + this.topologyId = topologyId; + this.address = address; + } +} +exports.ServerClosedEvent = ServerClosedEvent; +/** + * Emitted when topology description changes. + * @public + * @category Event + */ +class TopologyDescriptionChangedEvent { + /** @internal */ + constructor(topologyId, previousDescription, newDescription) { + this.topologyId = topologyId; + this.previousDescription = previousDescription; + this.newDescription = newDescription; + } +} +exports.TopologyDescriptionChangedEvent = TopologyDescriptionChangedEvent; +/** + * Emitted when topology is initialized. + * @public + * @category Event + */ +class TopologyOpeningEvent { + /** @internal */ + constructor(topologyId) { + this.topologyId = topologyId; + } +} +exports.TopologyOpeningEvent = TopologyOpeningEvent; +/** + * Emitted when topology is closed. + * @public + * @category Event + */ +class TopologyClosedEvent { + /** @internal */ + constructor(topologyId) { + this.topologyId = topologyId; + } +} +exports.TopologyClosedEvent = TopologyClosedEvent; +/** + * Emitted when the server monitor’s hello command is started - immediately before + * the hello command is serialized into raw BSON and written to the socket. + * + * @public + * @category Event + */ +class ServerHeartbeatStartedEvent { + /** @internal */ + constructor(connectionId) { + this.connectionId = connectionId; + } +} +exports.ServerHeartbeatStartedEvent = ServerHeartbeatStartedEvent; +/** + * Emitted when the server monitor’s hello succeeds. + * @public + * @category Event + */ +class ServerHeartbeatSucceededEvent { + /** @internal */ + constructor(connectionId, duration, reply) { + this.connectionId = connectionId; + this.duration = duration; + this.reply = reply !== null && reply !== void 0 ? reply : {}; + } +} +exports.ServerHeartbeatSucceededEvent = ServerHeartbeatSucceededEvent; +/** + * Emitted when the server monitor’s hello fails, either with an “ok: 0” or a socket exception. + * @public + * @category Event + */ +class ServerHeartbeatFailedEvent { + /** @internal */ + constructor(connectionId, duration, failure) { + this.connectionId = connectionId; + this.duration = duration; + this.failure = failure; + } +} +exports.ServerHeartbeatFailedEvent = ServerHeartbeatFailedEvent; +//# sourceMappingURL=events.js.map \ No newline at end of file diff --git a/node_modules/mongodb/lib/sdam/events.js.map b/node_modules/mongodb/lib/sdam/events.js.map new file mode 100644 index 000000000..734a42575 --- /dev/null +++ b/node_modules/mongodb/lib/sdam/events.js.map @@ -0,0 +1 @@ +{"version":3,"file":"events.js","sourceRoot":"","sources":["../../src/sdam/events.ts"],"names":[],"mappings":";;;AAIA;;;;GAIG;AACH,MAAa,6BAA6B;IAUxC,gBAAgB;IAChB,YACE,UAAkB,EAClB,OAAe,EACf,mBAAsC,EACtC,cAAiC;QAEjC,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC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BAAgB;IAChB,YAAY,YAAoB,EAAE,QAAgB,EAAE,KAAsB;QACxE,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;QACjC,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,KAAK,GAAG,KAAK,aAAL,KAAK,cAAL,KAAK,GAAI,EAAE,CAAC;IAC3B,CAAC;CACF;AAdD,sEAcC;AAED;;;;GAIG;AACH,MAAa,0BAA0B;IAQrC,gBAAgB;IAChB,YAAY,YAAoB,EAAE,QAAgB,EAAE,OAAc;QAChE,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;QACjC,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;CACF;AAdD,gEAcC"} \ No newline at end of file diff --git a/node_modules/mongodb/lib/sdam/monitor.js b/node_modules/mongodb/lib/sdam/monitor.js new file mode 100644 index 000000000..1149c7961 --- /dev/null +++ b/node_modules/mongodb/lib/sdam/monitor.js @@ -0,0 +1,326 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.RTTPinger = exports.Monitor = void 0; +const timers_1 = require("timers"); +const bson_1 = require("../bson"); +const connect_1 = require("../cmap/connect"); +const connection_1 = require("../cmap/connection"); +const constants_1 = require("../constants"); +const error_1 = require("../error"); +const mongo_types_1 = require("../mongo_types"); +const utils_1 = require("../utils"); +const common_1 = require("./common"); +const events_1 = require("./events"); +const server_1 = require("./server"); +/** @internal */ +const kServer = Symbol('server'); +/** @internal */ +const kMonitorId = Symbol('monitorId'); +/** @internal */ +const kConnection = Symbol('connection'); +/** @internal */ +const kCancellationToken = Symbol('cancellationToken'); +/** @internal */ +const kRTTPinger = Symbol('rttPinger'); +/** @internal */ +const kRoundTripTime = Symbol('roundTripTime'); +const STATE_IDLE = 'idle'; +const STATE_MONITORING = 'monitoring'; +const stateTransition = (0, utils_1.makeStateMachine)({ + [common_1.STATE_CLOSING]: [common_1.STATE_CLOSING, STATE_IDLE, common_1.STATE_CLOSED], + [common_1.STATE_CLOSED]: [common_1.STATE_CLOSED, STATE_MONITORING], + [STATE_IDLE]: [STATE_IDLE, STATE_MONITORING, common_1.STATE_CLOSING], + [STATE_MONITORING]: [STATE_MONITORING, STATE_IDLE, common_1.STATE_CLOSING] +}); +const INVALID_REQUEST_CHECK_STATES = new Set([common_1.STATE_CLOSING, common_1.STATE_CLOSED, STATE_MONITORING]); +function isInCloseState(monitor) { + return monitor.s.state === common_1.STATE_CLOSED || monitor.s.state === common_1.STATE_CLOSING; +} +/** @internal */ +class Monitor extends mongo_types_1.TypedEventEmitter { + constructor(server, options) { + var _a, _b, _c; + super(); + this[kServer] = server; + this[kConnection] = undefined; + this[kCancellationToken] = new mongo_types_1.CancellationToken(); + this[kCancellationToken].setMaxListeners(Infinity); + this[kMonitorId] = undefined; + this.s = { + state: common_1.STATE_CLOSED + }; + this.address = server.description.address; + this.options = Object.freeze({ + connectTimeoutMS: (_a = options.connectTimeoutMS) !== null && _a !== void 0 ? _a : 10000, + heartbeatFrequencyMS: (_b = options.heartbeatFrequencyMS) !== null && _b !== void 0 ? _b : 10000, + minHeartbeatFrequencyMS: (_c = options.minHeartbeatFrequencyMS) !== null && _c !== void 0 ? _c : 500 + }); + const cancellationToken = this[kCancellationToken]; + // TODO: refactor this to pull it directly from the pool, requires new ConnectionPool integration + const connectOptions = Object.assign({ + id: '', + generation: server.s.pool.generation, + connectionType: connection_1.Connection, + cancellationToken, + hostAddress: server.description.hostAddress + }, options, + // force BSON serialization options + { + raw: false, + promoteLongs: true, + promoteValues: true, + promoteBuffers: true + }); + // ensure no authentication is used for monitoring + delete connectOptions.credentials; + if (connectOptions.autoEncrypter) { + delete connectOptions.autoEncrypter; + } + this.connectOptions = Object.freeze(connectOptions); + } + get connection() { + return this[kConnection]; + } + connect() { + if (this.s.state !== common_1.STATE_CLOSED) { + return; + } + // start + const heartbeatFrequencyMS = this.options.heartbeatFrequencyMS; + const minHeartbeatFrequencyMS = this.options.minHeartbeatFrequencyMS; + this[kMonitorId] = (0, utils_1.makeInterruptibleAsyncInterval)(monitorServer(this), { + interval: heartbeatFrequencyMS, + minInterval: minHeartbeatFrequencyMS, + immediate: true + }); + } + requestCheck() { + var _a; + if (INVALID_REQUEST_CHECK_STATES.has(this.s.state)) { + return; + } + (_a = this[kMonitorId]) === null || _a === void 0 ? void 0 : _a.wake(); + } + reset() { + const topologyVersion = this[kServer].description.topologyVersion; + if (isInCloseState(this) || topologyVersion == null) { + return; + } + stateTransition(this, common_1.STATE_CLOSING); + resetMonitorState(this); + // restart monitor + stateTransition(this, STATE_IDLE); + // restart monitoring + const heartbeatFrequencyMS = this.options.heartbeatFrequencyMS; + const minHeartbeatFrequencyMS = this.options.minHeartbeatFrequencyMS; + this[kMonitorId] = (0, utils_1.makeInterruptibleAsyncInterval)(monitorServer(this), { + interval: heartbeatFrequencyMS, + minInterval: minHeartbeatFrequencyMS + }); + } + close() { + if (isInCloseState(this)) { + return; + } + stateTransition(this, common_1.STATE_CLOSING); + resetMonitorState(this); + // close monitor + this.emit('close'); + stateTransition(this, common_1.STATE_CLOSED); + } +} +exports.Monitor = Monitor; +function resetMonitorState(monitor) { + var _a, _b, _c; + (_a = monitor[kMonitorId]) === null || _a === void 0 ? void 0 : _a.stop(); + monitor[kMonitorId] = undefined; + (_b = monitor[kRTTPinger]) === null || _b === void 0 ? void 0 : _b.close(); + monitor[kRTTPinger] = undefined; + monitor[kCancellationToken].emit('cancel'); + (_c = monitor[kConnection]) === null || _c === void 0 ? void 0 : _c.destroy({ force: true }); + monitor[kConnection] = undefined; +} +function checkServer(monitor, callback) { + let start = (0, utils_1.now)(); + monitor.emit(server_1.Server.SERVER_HEARTBEAT_STARTED, new events_1.ServerHeartbeatStartedEvent(monitor.address)); + function failureHandler(err) { + var _a; + (_a = monitor[kConnection]) === null || _a === void 0 ? void 0 : _a.destroy({ force: true }); + monitor[kConnection] = undefined; + monitor.emit(server_1.Server.SERVER_HEARTBEAT_FAILED, new events_1.ServerHeartbeatFailedEvent(monitor.address, (0, utils_1.calculateDurationInMs)(start), err)); + monitor.emit('resetServer', err); + monitor.emit('resetConnectionPool'); + callback(err); + } + const connection = monitor[kConnection]; + if (connection && !connection.closed) { + const { serverApi, helloOk } = connection; + const connectTimeoutMS = monitor.options.connectTimeoutMS; + const maxAwaitTimeMS = monitor.options.heartbeatFrequencyMS; + const topologyVersion = monitor[kServer].description.topologyVersion; + const isAwaitable = topologyVersion != null; + const cmd = { + [(serverApi === null || serverApi === void 0 ? void 0 : serverApi.version) || helloOk ? 'hello' : constants_1.LEGACY_HELLO_COMMAND]: true, + ...(isAwaitable && topologyVersion + ? { maxAwaitTimeMS, topologyVersion: makeTopologyVersion(topologyVersion) } + : {}) + }; + const options = isAwaitable + ? { + socketTimeoutMS: connectTimeoutMS ? connectTimeoutMS + maxAwaitTimeMS : 0, + exhaustAllowed: true + } + : { socketTimeoutMS: connectTimeoutMS }; + if (isAwaitable && monitor[kRTTPinger] == null) { + monitor[kRTTPinger] = new RTTPinger(monitor[kCancellationToken], Object.assign({ heartbeatFrequencyMS: monitor.options.heartbeatFrequencyMS }, monitor.connectOptions)); + } + connection.command((0, utils_1.ns)('admin.$cmd'), cmd, options, (err, hello) => { + var _a; + if (err) { + return failureHandler(err); + } + if (!('isWritablePrimary' in hello)) { + // Provide hello-style response document. + hello.isWritablePrimary = hello[constants_1.LEGACY_HELLO_COMMAND]; + } + const rttPinger = monitor[kRTTPinger]; + const duration = isAwaitable && rttPinger ? rttPinger.roundTripTime : (0, utils_1.calculateDurationInMs)(start); + monitor.emit(server_1.Server.SERVER_HEARTBEAT_SUCCEEDED, new events_1.ServerHeartbeatSucceededEvent(monitor.address, duration, hello)); + // if we are using the streaming protocol then we immediately issue another `started` + // event, otherwise the "check" is complete and return to the main monitor loop + if (isAwaitable && hello.topologyVersion) { + monitor.emit(server_1.Server.SERVER_HEARTBEAT_STARTED, new events_1.ServerHeartbeatStartedEvent(monitor.address)); + start = (0, utils_1.now)(); + } + else { + (_a = monitor[kRTTPinger]) === null || _a === void 0 ? void 0 : _a.close(); + monitor[kRTTPinger] = undefined; + callback(undefined, hello); + } + }); + return; + } + // connecting does an implicit `hello` + (0, connect_1.connect)(monitor.connectOptions, (err, conn) => { + if (err) { + monitor[kConnection] = undefined; + // we already reset the connection pool on network errors in all cases + if (!(err instanceof error_1.MongoNetworkError)) { + monitor.emit('resetConnectionPool'); + } + failureHandler(err); + return; + } + if (conn) { + // Tell the connection that we are using the streaming protocol so that the + // connection's message stream will only read the last hello on the buffer. + conn.isMonitoringConnection = true; + if (isInCloseState(monitor)) { + conn.destroy({ force: true }); + return; + } + monitor[kConnection] = conn; + monitor.emit(server_1.Server.SERVER_HEARTBEAT_SUCCEEDED, new events_1.ServerHeartbeatSucceededEvent(monitor.address, (0, utils_1.calculateDurationInMs)(start), conn.hello)); + callback(undefined, conn.hello); + } + }); +} +function monitorServer(monitor) { + return (callback) => { + stateTransition(monitor, STATE_MONITORING); + function done() { + if (!isInCloseState(monitor)) { + stateTransition(monitor, STATE_IDLE); + } + callback(); + } + checkServer(monitor, (err, hello) => { + if (err) { + // otherwise an error occurred on initial discovery, also bail + if (monitor[kServer].description.type === common_1.ServerType.Unknown) { + monitor.emit('resetServer', err); + return done(); + } + } + // if the check indicates streaming is supported, immediately reschedule monitoring + if (hello && hello.topologyVersion) { + (0, timers_1.setTimeout)(() => { + var _a; + if (!isInCloseState(monitor)) { + (_a = monitor[kMonitorId]) === null || _a === void 0 ? void 0 : _a.wake(); + } + }, 0); + } + done(); + }); + }; +} +function makeTopologyVersion(tv) { + return { + processId: tv.processId, + // tests mock counter as just number, but in a real situation counter should always be a Long + counter: bson_1.Long.isLong(tv.counter) ? tv.counter : bson_1.Long.fromNumber(tv.counter) + }; +} +/** @internal */ +class RTTPinger { + constructor(cancellationToken, options) { + this[kConnection] = undefined; + this[kCancellationToken] = cancellationToken; + this[kRoundTripTime] = 0; + this.closed = false; + const heartbeatFrequencyMS = options.heartbeatFrequencyMS; + this[kMonitorId] = (0, timers_1.setTimeout)(() => measureRoundTripTime(this, options), heartbeatFrequencyMS); + } + get roundTripTime() { + return this[kRoundTripTime]; + } + close() { + var _a; + this.closed = true; + clearTimeout(this[kMonitorId]); + (_a = this[kConnection]) === null || _a === void 0 ? void 0 : _a.destroy({ force: true }); + this[kConnection] = undefined; + } +} +exports.RTTPinger = RTTPinger; +function measureRoundTripTime(rttPinger, options) { + const start = (0, utils_1.now)(); + options.cancellationToken = rttPinger[kCancellationToken]; + const heartbeatFrequencyMS = options.heartbeatFrequencyMS; + if (rttPinger.closed) { + return; + } + function measureAndReschedule(conn) { + if (rttPinger.closed) { + conn === null || conn === void 0 ? void 0 : conn.destroy({ force: true }); + return; + } + if (rttPinger[kConnection] == null) { + rttPinger[kConnection] = conn; + } + rttPinger[kRoundTripTime] = (0, utils_1.calculateDurationInMs)(start); + rttPinger[kMonitorId] = (0, timers_1.setTimeout)(() => measureRoundTripTime(rttPinger, options), heartbeatFrequencyMS); + } + const connection = rttPinger[kConnection]; + if (connection == null) { + (0, connect_1.connect)(options, (err, conn) => { + if (err) { + rttPinger[kConnection] = undefined; + rttPinger[kRoundTripTime] = 0; + return; + } + measureAndReschedule(conn); + }); + return; + } + connection.command((0, utils_1.ns)('admin.$cmd'), { [constants_1.LEGACY_HELLO_COMMAND]: 1 }, undefined, err => { + if (err) { + rttPinger[kConnection] = undefined; + rttPinger[kRoundTripTime] = 0; + return; + } + measureAndReschedule(); + }); +} +//# sourceMappingURL=monitor.js.map \ No newline at end of file diff --git a/node_modules/mongodb/lib/sdam/monitor.js.map b/node_modules/mongodb/lib/sdam/monitor.js.map new file mode 100644 index 000000000..f2ef5a83e --- /dev/null +++ b/node_modules/mongodb/lib/sdam/monitor.js.map @@ -0,0 +1 @@ +{"version":3,"file":"monitor.js","sourceRoot":"","sources":["../../src/sdam/monitor.ts"],"names":[],"mappings":";;;AAAA,mCAAoC;AAEpC,kCAAyC;AACzC,6C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CAAC;AACL,CAAC"} \ No newline at end of file diff --git a/node_modules/mongodb/lib/sdam/server.js b/node_modules/mongodb/lib/sdam/server.js new file mode 100644 index 000000000..70e4ec376 --- /dev/null +++ b/node_modules/mongodb/lib/sdam/server.js @@ -0,0 +1,396 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Server = void 0; +const connection_1 = require("../cmap/connection"); +const connection_pool_1 = require("../cmap/connection_pool"); +const constants_1 = require("../constants"); +const error_1 = require("../error"); +const logger_1 = require("../logger"); +const mongo_types_1 = require("../mongo_types"); +const transactions_1 = require("../transactions"); +const utils_1 = require("../utils"); +const common_1 = require("./common"); +const monitor_1 = require("./monitor"); +const server_description_1 = require("./server_description"); +const stateTransition = (0, utils_1.makeStateMachine)({ + [common_1.STATE_CLOSED]: [common_1.STATE_CLOSED, common_1.STATE_CONNECTING], + [common_1.STATE_CONNECTING]: [common_1.STATE_CONNECTING, common_1.STATE_CLOSING, common_1.STATE_CONNECTED, common_1.STATE_CLOSED], + [common_1.STATE_CONNECTED]: [common_1.STATE_CONNECTED, common_1.STATE_CLOSING, common_1.STATE_CLOSED], + [common_1.STATE_CLOSING]: [common_1.STATE_CLOSING, common_1.STATE_CLOSED] +}); +/** @internal */ +const kMonitor = Symbol('monitor'); +/** @internal */ +class Server extends mongo_types_1.TypedEventEmitter { + /** + * Create a server + */ + constructor(topology, description, options) { + super(); + this.serverApi = options.serverApi; + const poolOptions = { hostAddress: description.hostAddress, ...options }; + this.s = { + description, + options, + logger: new logger_1.Logger('Server'), + state: common_1.STATE_CLOSED, + topology, + pool: new connection_pool_1.ConnectionPool(poolOptions), + operationCount: 0 + }; + for (const event of [...constants_1.CMAP_EVENTS, ...constants_1.APM_EVENTS]) { + this.s.pool.on(event, (e) => this.emit(event, e)); + } + this.s.pool.on(connection_1.Connection.CLUSTER_TIME_RECEIVED, (clusterTime) => { + this.clusterTime = clusterTime; + }); + if (this.loadBalanced) { + this[kMonitor] = null; + // monitoring is disabled in load balancing mode + return; + } + // create the monitor + // TODO(NODE-4144): Remove new variable for type narrowing + const monitor = new monitor_1.Monitor(this, this.s.options); + this[kMonitor] = monitor; + for (const event of constants_1.HEARTBEAT_EVENTS) { + monitor.on(event, (e) => this.emit(event, e)); + } + monitor.on('resetConnectionPool', () => { + this.s.pool.clear(); + }); + monitor.on('resetServer', (error) => markServerUnknown(this, error)); + monitor.on(Server.SERVER_HEARTBEAT_SUCCEEDED, (event) => { + this.emit(Server.DESCRIPTION_RECEIVED, new server_description_1.ServerDescription(this.description.hostAddress, event.reply, { + roundTripTime: calculateRoundTripTime(this.description.roundTripTime, event.duration) + })); + if (this.s.state === common_1.STATE_CONNECTING) { + stateTransition(this, common_1.STATE_CONNECTED); + this.emit(Server.CONNECT, this); + } + }); + } + get clusterTime() { + return this.s.topology.clusterTime; + } + set clusterTime(clusterTime) { + this.s.topology.clusterTime = clusterTime; + } + get description() { + return this.s.description; + } + get name() { + return this.s.description.address; + } + get autoEncrypter() { + if (this.s.options && this.s.options.autoEncrypter) { + return this.s.options.autoEncrypter; + } + return; + } + get loadBalanced() { + return this.s.topology.description.type === common_1.TopologyType.LoadBalanced; + } + /** + * Initiate server connect + */ + connect() { + var _a; + if (this.s.state !== common_1.STATE_CLOSED) { + return; + } + stateTransition(this, common_1.STATE_CONNECTING); + // If in load balancer mode we automatically set the server to + // a load balancer. It never transitions out of this state and + // has no monitor. + if (!this.loadBalanced) { + (_a = this[kMonitor]) === null || _a === void 0 ? void 0 : _a.connect(); + } + else { + stateTransition(this, common_1.STATE_CONNECTED); + this.emit(Server.CONNECT, this); + } + } + /** Destroy the server connection */ + destroy(options, callback) { + var _a; + if (typeof options === 'function') + (callback = options), (options = {}); + options = Object.assign({}, { force: false }, options); + if (this.s.state === common_1.STATE_CLOSED) { + if (typeof callback === 'function') { + callback(); + } + return; + } + stateTransition(this, common_1.STATE_CLOSING); + if (!this.loadBalanced) { + (_a = this[kMonitor]) === null || _a === void 0 ? void 0 : _a.close(); + } + this.s.pool.close(options, err => { + stateTransition(this, common_1.STATE_CLOSED); + this.emit('closed'); + if (typeof callback === 'function') { + callback(err); + } + }); + } + /** + * Immediately schedule monitoring of this server. If there already an attempt being made + * this will be a no-op. + */ + requestCheck() { + var _a; + if (!this.loadBalanced) { + (_a = this[kMonitor]) === null || _a === void 0 ? void 0 : _a.requestCheck(); + } + } + /** + * Execute a command + * @internal + */ + command(ns, cmd, options, callback) { + if (callback == null) { + throw new error_1.MongoInvalidArgumentError('Callback must be provided'); + } + if (ns.db == null || typeof ns === 'string') { + throw new error_1.MongoInvalidArgumentError('Namespace must not be a string'); + } + if (this.s.state === common_1.STATE_CLOSING || this.s.state === common_1.STATE_CLOSED) { + callback(new error_1.MongoServerClosedError()); + return; + } + // Clone the options + const finalOptions = Object.assign({}, options, { wireProtocolCommand: false }); + // There are cases where we need to flag the read preference not to get sent in + // the command, such as pre-5.0 servers attempting to perform an aggregate write + // with a non-primary read preference. In this case the effective read preference + // (primary) is not the same as the provided and must be removed completely. + if (finalOptions.omitReadPreference) { + delete finalOptions.readPreference; + } + // error if collation not supported + if ((0, utils_1.collationNotSupported)(this, cmd)) { + callback(new error_1.MongoCompatibilityError(`Server ${this.name} does not support collation`)); + return; + } + const session = finalOptions.session; + const conn = session === null || session === void 0 ? void 0 : session.pinnedConnection; + // NOTE: This is a hack! We can't retrieve the connections used for executing an operation + // (and prevent them from being checked back in) at the point of operation execution. + // This should be considered as part of the work for NODE-2882 + // NOTE: + // When incrementing operation count, it's important that we increment it before we + // attempt to check out a connection from the pool. This ensures that operations that + // are waiting for a connection are included in the operation count. Load balanced + // mode will only ever have a single server, so the operation count doesn't matter. + // Incrementing the operation count above the logic to handle load balanced mode would + // require special logic to decrement it again, or would double increment (the load + // balanced code makes a recursive call). Instead, we increment the count after this + // check. + if (this.loadBalanced && session && conn == null && isPinnableCommand(cmd, session)) { + this.s.pool.checkOut((err, checkedOut) => { + if (err || checkedOut == null) { + if (callback) + return callback(err); + return; + } + session.pin(checkedOut); + this.command(ns, cmd, finalOptions, callback); + }); + return; + } + this.s.operationCount += 1; + this.s.pool.withConnection(conn, (err, conn, cb) => { + if (err || !conn) { + this.s.operationCount -= 1; + markServerUnknown(this, err); + return cb(err); + } + conn.command(ns, cmd, finalOptions, makeOperationHandler(this, conn, cmd, finalOptions, (error, response) => { + this.s.operationCount -= 1; + cb(error, response); + })); + }, callback); + } + /** + * Execute a `getMore` against the server + * @internal + */ + getMore(ns, cursorId, options, callback) { + var _a; + if (this.s.state === common_1.STATE_CLOSING || this.s.state === common_1.STATE_CLOSED) { + callback(new error_1.MongoServerClosedError()); + return; + } + this.s.operationCount += 1; + this.s.pool.withConnection((_a = options.session) === null || _a === void 0 ? void 0 : _a.pinnedConnection, (err, conn, cb) => { + if (err || !conn) { + this.s.operationCount -= 1; + markServerUnknown(this, err); + return cb(err); + } + conn.getMore(ns, cursorId, options, makeOperationHandler(this, conn, {}, options, (error, response) => { + this.s.operationCount -= 1; + cb(error, response); + })); + }, callback); + } + /** + * Execute a `killCursors` command against the server + * @internal + */ + killCursors(ns, cursorIds, options, callback) { + var _a; + if (this.s.state === common_1.STATE_CLOSING || this.s.state === common_1.STATE_CLOSED) { + if (typeof callback === 'function') { + callback(new error_1.MongoServerClosedError()); + } + return; + } + this.s.operationCount += 1; + this.s.pool.withConnection((_a = options.session) === null || _a === void 0 ? void 0 : _a.pinnedConnection, (err, conn, cb) => { + if (err || !conn) { + this.s.operationCount -= 1; + markServerUnknown(this, err); + return cb(err); + } + conn.killCursors(ns, cursorIds, options, makeOperationHandler(this, conn, {}, undefined, (error, response) => { + this.s.operationCount -= 1; + cb(error, response); + })); + }, callback); + } +} +exports.Server = Server; +/** @event */ +Server.SERVER_HEARTBEAT_STARTED = constants_1.SERVER_HEARTBEAT_STARTED; +/** @event */ +Server.SERVER_HEARTBEAT_SUCCEEDED = constants_1.SERVER_HEARTBEAT_SUCCEEDED; +/** @event */ +Server.SERVER_HEARTBEAT_FAILED = constants_1.SERVER_HEARTBEAT_FAILED; +/** @event */ +Server.CONNECT = constants_1.CONNECT; +/** @event */ +Server.DESCRIPTION_RECEIVED = constants_1.DESCRIPTION_RECEIVED; +/** @event */ +Server.CLOSED = constants_1.CLOSED; +/** @event */ +Server.ENDED = constants_1.ENDED; +function calculateRoundTripTime(oldRtt, duration) { + if (oldRtt === -1) { + return duration; + } + const alpha = 0.2; + return alpha * duration + (1 - alpha) * oldRtt; +} +function markServerUnknown(server, error) { + var _a; + // Load balancer servers can never be marked unknown. + if (server.loadBalanced) { + return; + } + if (error instanceof error_1.MongoNetworkError && !(error instanceof error_1.MongoNetworkTimeoutError)) { + (_a = server[kMonitor]) === null || _a === void 0 ? void 0 : _a.reset(); + } + server.emit(Server.DESCRIPTION_RECEIVED, new server_description_1.ServerDescription(server.description.hostAddress, undefined, { + error, + topologyVersion: error && error.topologyVersion ? error.topologyVersion : server.description.topologyVersion + })); +} +function isPinnableCommand(cmd, session) { + if (session) { + return (session.inTransaction() || + 'aggregate' in cmd || + 'find' in cmd || + 'getMore' in cmd || + 'listCollections' in cmd || + 'listIndexes' in cmd); + } + return false; +} +function connectionIsStale(pool, connection) { + if (connection.serviceId) { + return (connection.generation !== pool.serviceGenerations.get(connection.serviceId.toHexString())); + } + return connection.generation !== pool.generation; +} +function shouldHandleStateChangeError(server, err) { + const etv = err.topologyVersion; + const stv = server.description.topologyVersion; + return (0, server_description_1.compareTopologyVersion)(stv, etv) < 0; +} +function inActiveTransaction(session, cmd) { + return session && session.inTransaction() && !(0, transactions_1.isTransactionCommand)(cmd); +} +/** this checks the retryWrites option passed down from the client options, it + * does not check if the server supports retryable writes */ +function isRetryableWritesEnabled(topology) { + return topology.s.options.retryWrites !== false; +} +function makeOperationHandler(server, connection, cmd, options, callback) { + const session = options === null || options === void 0 ? void 0 : options.session; + return function handleOperationResult(error, result) { + if (result != null) { + return callback(undefined, result); + } + if (!error) { + return callback(new error_1.MongoUnexpectedServerResponseError('Empty response with no error')); + } + if (!(error instanceof error_1.MongoError)) { + // Node.js or some other error we have not special handling for + return callback(error); + } + if (connectionIsStale(server.s.pool, connection)) { + return callback(error); + } + if (error instanceof error_1.MongoNetworkError) { + if (session && !session.hasEnded && session.serverSession) { + session.serverSession.isDirty = true; + } + // inActiveTransaction check handles commit and abort. + if (inActiveTransaction(session, cmd) && + !error.hasErrorLabel(error_1.MongoErrorLabel.TransientTransactionError)) { + error.addErrorLabel(error_1.MongoErrorLabel.TransientTransactionError); + } + if ((isRetryableWritesEnabled(server.s.topology) || (0, transactions_1.isTransactionCommand)(cmd)) && + (0, utils_1.supportsRetryableWrites)(server) && + !inActiveTransaction(session, cmd)) { + error.addErrorLabel(error_1.MongoErrorLabel.RetryableWriteError); + } + if (!(error instanceof error_1.MongoNetworkTimeoutError) || (0, error_1.isNetworkErrorBeforeHandshake)(error)) { + // In load balanced mode we never mark the server as unknown and always + // clear for the specific service id. + server.s.pool.clear(connection.serviceId); + if (!server.loadBalanced) { + markServerUnknown(server, error); + } + } + } + else { + if ((isRetryableWritesEnabled(server.s.topology) || (0, transactions_1.isTransactionCommand)(cmd)) && + (0, error_1.needsRetryableWriteLabel)(error, (0, utils_1.maxWireVersion)(server)) && + !inActiveTransaction(session, cmd)) { + error.addErrorLabel(error_1.MongoErrorLabel.RetryableWriteError); + } + if ((0, error_1.isSDAMUnrecoverableError)(error)) { + if (shouldHandleStateChangeError(server, error)) { + if ((0, utils_1.maxWireVersion)(server) <= 7 || (0, error_1.isNodeShuttingDownError)(error)) { + server.s.pool.clear(connection.serviceId); + } + if (!server.loadBalanced) { + markServerUnknown(server, error); + process.nextTick(() => server.requestCheck()); + } + } + } + } + if (session && + session.isPinned && + error.hasErrorLabel(error_1.MongoErrorLabel.TransientTransactionError)) { + session.unpin({ force: true }); + } + return callback(error); + }; +} +//# sourceMappingURL=server.js.map \ No newline at end of file diff --git a/node_modules/mongodb/lib/sdam/server.js.map b/node_modules/mongodb/lib/sdam/server.js.map new file mode 100644 index 000000000..ea6340f6b --- /dev/null +++ b/node_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AAC,wBAAwB,CAAC,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,IAAA,mCAAoB,EAAC,GAAG,CAAC,CAAC;gBAC1E,IAAA,gCAAwB,EAAC,KAAK,EAAE,IAAA,sBAAc,EAAC,MAAM,CAAC,CAAC;gBACvD,CAAC,mBAAmB,CAAC,OAAO,EAAE,GAAG,CAAC,EAClC;gBACA,KAAK,CAAC,aAAa,CAAC,uBAAe,CAAC,mBAAmB,CAAC,CAAC;aAC1D;YAED,IAAI,IAAA,gCAAwB,EAAC,KAAK,CAAC,EAAE;gBACnC,IAAI,4BAA4B,CAAC,MAAM,EAAE,KAAK,CAAC,EAAE;oBAC/C,IAAI,IAAA,sBAAc,EAAC,MAAM,CAAC,IAAI,CAAC,IAAI,IAAA,+BAAuB,EAAC,KAAK,CAAC,EAAE;wBACjE,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;qBAC3C;oBAED,IAAI,CAAC,MAAM,CAAC,YAAY,EAAE;wBACxB,iBAAiB,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;wBACjC,OAAO,CAAC,QAAQ,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,YAAY,EAAE,CAAC,CAAC;qBAC/C;iBACF;aACF;SACF;QAED,IACE,OAAO;YACP,OAAO,CAAC,QAAQ;YAChB,KAAK,CAAC,aAAa,CAAC,uBAAe,CAAC,yBAAyB,CAAC,EAC9D;YACA,OAAO,CAAC,KAAK,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;SAChC;QAED,OAAO,QAAQ,CAAC,KAAK,CAAC,CAAC;IACzB,CAAC,CAAC;AACJ,CAAC"} \ No newline at end of file diff --git a/node_modules/mongodb/lib/sdam/server_description.js b/node_modules/mongodb/lib/sdam/server_description.js new file mode 100644 index 000000000..fc3e3e5b3 --- /dev/null +++ b/node_modules/mongodb/lib/sdam/server_description.js @@ -0,0 +1,197 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.compareTopologyVersion = exports.parseServerType = exports.ServerDescription = void 0; +const bson_1 = require("../bson"); +const utils_1 = require("../utils"); +const common_1 = require("./common"); +const WRITABLE_SERVER_TYPES = new Set([ + common_1.ServerType.RSPrimary, + common_1.ServerType.Standalone, + common_1.ServerType.Mongos, + common_1.ServerType.LoadBalancer +]); +const DATA_BEARING_SERVER_TYPES = new Set([ + common_1.ServerType.RSPrimary, + common_1.ServerType.RSSecondary, + common_1.ServerType.Mongos, + common_1.ServerType.Standalone, + common_1.ServerType.LoadBalancer +]); +/** + * The client's view of a single server, based on the most recent hello outcome. + * + * Internal type, not meant to be directly instantiated + * @public + */ +class ServerDescription { + /** + * Create a ServerDescription + * @internal + * + * @param address - The address of the server + * @param hello - An optional hello response for this server + */ + constructor(address, hello, options) { + var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m; + if (typeof address === 'string') { + this._hostAddress = new utils_1.HostAddress(address); + this.address = this._hostAddress.toString(); + } + else { + this._hostAddress = address; + this.address = this._hostAddress.toString(); + } + this.type = parseServerType(hello, options); + this.hosts = (_b = (_a = hello === null || hello === void 0 ? void 0 : hello.hosts) === null || _a === void 0 ? void 0 : _a.map((host) => host.toLowerCase())) !== null && _b !== void 0 ? _b : []; + this.passives = (_d = (_c = hello === null || hello === void 0 ? void 0 : hello.passives) === null || _c === void 0 ? void 0 : _c.map((host) => host.toLowerCase())) !== null && _d !== void 0 ? _d : []; + this.arbiters = (_f = (_e = hello === null || hello === void 0 ? void 0 : hello.arbiters) === null || _e === void 0 ? void 0 : _e.map((host) => host.toLowerCase())) !== null && _f !== void 0 ? _f : []; + this.tags = (_g = hello === null || hello === void 0 ? void 0 : hello.tags) !== null && _g !== void 0 ? _g : {}; + this.minWireVersion = (_h = hello === null || hello === void 0 ? void 0 : hello.minWireVersion) !== null && _h !== void 0 ? _h : 0; + this.maxWireVersion = (_j = hello === null || hello === void 0 ? void 0 : hello.maxWireVersion) !== null && _j !== void 0 ? _j : 0; + this.roundTripTime = (_k = options === null || options === void 0 ? void 0 : options.roundTripTime) !== null && _k !== void 0 ? _k : -1; + this.lastUpdateTime = (0, utils_1.now)(); + this.lastWriteDate = (_m = (_l = hello === null || hello === void 0 ? void 0 : hello.lastWrite) === null || _l === void 0 ? void 0 : _l.lastWriteDate) !== null && _m !== void 0 ? _m : 0; + if (options === null || options === void 0 ? void 0 : options.topologyVersion) { + this.topologyVersion = options.topologyVersion; + } + else if (hello === null || hello === void 0 ? void 0 : hello.topologyVersion) { + this.topologyVersion = hello.topologyVersion; + } + if (options === null || options === void 0 ? void 0 : options.error) { + this.error = options.error; + } + if (hello === null || hello === void 0 ? void 0 : hello.primary) { + this.primary = hello.primary; + } + if (hello === null || hello === void 0 ? void 0 : hello.me) { + this.me = hello.me.toLowerCase(); + } + if (hello === null || hello === void 0 ? void 0 : hello.setName) { + this.setName = hello.setName; + } + if (hello === null || hello === void 0 ? void 0 : hello.setVersion) { + this.setVersion = hello.setVersion; + } + if (hello === null || hello === void 0 ? void 0 : hello.electionId) { + this.electionId = hello.electionId; + } + if (hello === null || hello === void 0 ? void 0 : hello.logicalSessionTimeoutMinutes) { + this.logicalSessionTimeoutMinutes = hello.logicalSessionTimeoutMinutes; + } + if (hello === null || hello === void 0 ? void 0 : hello.$clusterTime) { + this.$clusterTime = hello.$clusterTime; + } + } + get hostAddress() { + if (this._hostAddress) + return this._hostAddress; + else + return new utils_1.HostAddress(this.address); + } + get allHosts() { + return this.hosts.concat(this.arbiters).concat(this.passives); + } + /** Is this server available for reads*/ + get isReadable() { + return this.type === common_1.ServerType.RSSecondary || this.isWritable; + } + /** Is this server data bearing */ + get isDataBearing() { + return DATA_BEARING_SERVER_TYPES.has(this.type); + } + /** Is this server available for writes */ + get isWritable() { + return WRITABLE_SERVER_TYPES.has(this.type); + } + get host() { + const chopLength = `:${this.port}`.length; + return this.address.slice(0, -chopLength); + } + get port() { + const port = this.address.split(':').pop(); + return port ? Number.parseInt(port, 10) : 27017; + } + /** + * Determines if another `ServerDescription` is equal to this one per the rules defined + * in the {@link https://github.com/mongodb/specifications/blob/master/source/server-discovery-and-monitoring/server-discovery-and-monitoring.rst#serverdescription|SDAM spec} + */ + equals(other) { + const topologyVersionsEqual = this.topologyVersion === other.topologyVersion || + compareTopologyVersion(this.topologyVersion, other.topologyVersion) === 0; + const electionIdsEqual = this.electionId && other.electionId + ? other.electionId && this.electionId.equals(other.electionId) + : this.electionId === other.electionId; + return (other != null && + (0, utils_1.errorStrictEqual)(this.error, other.error) && + this.type === other.type && + this.minWireVersion === other.minWireVersion && + (0, utils_1.arrayStrictEqual)(this.hosts, other.hosts) && + tagsStrictEqual(this.tags, other.tags) && + this.setName === other.setName && + this.setVersion === other.setVersion && + electionIdsEqual && + this.primary === other.primary && + this.logicalSessionTimeoutMinutes === other.logicalSessionTimeoutMinutes && + topologyVersionsEqual); + } +} +exports.ServerDescription = ServerDescription; +// Parses a `hello` message and determines the server type +function parseServerType(hello, options) { + if (options === null || options === void 0 ? void 0 : options.loadBalanced) { + return common_1.ServerType.LoadBalancer; + } + if (!hello || !hello.ok) { + return common_1.ServerType.Unknown; + } + if (hello.isreplicaset) { + return common_1.ServerType.RSGhost; + } + if (hello.msg && hello.msg === 'isdbgrid') { + return common_1.ServerType.Mongos; + } + if (hello.setName) { + if (hello.hidden) { + return common_1.ServerType.RSOther; + } + else if (hello.isWritablePrimary) { + return common_1.ServerType.RSPrimary; + } + else if (hello.secondary) { + return common_1.ServerType.RSSecondary; + } + else if (hello.arbiterOnly) { + return common_1.ServerType.RSArbiter; + } + else { + return common_1.ServerType.RSOther; + } + } + return common_1.ServerType.Standalone; +} +exports.parseServerType = parseServerType; +function tagsStrictEqual(tags, tags2) { + const tagsKeys = Object.keys(tags); + const tags2Keys = Object.keys(tags2); + return (tagsKeys.length === tags2Keys.length && + tagsKeys.every((key) => tags2[key] === tags[key])); +} +/** + * Compares two topology versions. + * + * @returns A negative number if `lhs` is older than `rhs`; positive if `lhs` is newer than `rhs`; 0 if they are equivalent. + */ +function compareTopologyVersion(lhs, rhs) { + if (lhs == null || rhs == null) { + return -1; + } + if (lhs.processId.equals(rhs.processId)) { + // tests mock counter as just number, but in a real situation counter should always be a Long + const lhsCounter = bson_1.Long.isLong(lhs.counter) ? lhs.counter : bson_1.Long.fromNumber(lhs.counter); + const rhsCounter = bson_1.Long.isLong(rhs.counter) ? lhs.counter : bson_1.Long.fromNumber(rhs.counter); + return lhsCounter.compare(rhsCounter); + } + return -1; +} +exports.compareTopologyVersion = compareTopologyVersion; +//# sourceMappingURL=server_description.js.map \ No newline at end of file diff --git a/node_modules/mongodb/lib/sdam/server_description.js.map b/node_modules/mongodb/lib/sdam/server_description.js.map new file mode 100644 index 000000000..d81da31ae --- /dev/null +++ b/node_modules/mongodb/lib/sdam/server_description.js.map @@ -0,0 +1 @@ +{"version":3,"file":"server_description.js","sourceRoot":"","sources":["../../src/sdam/server_description.ts"],"names":[],"mappings":";;;AAAA,kCAAmD;AAEnD,oCAAgF;AAEhF,qCAAsC;AAEtC,MAAM,qBAAqB,GAAG,IAAI,GAAG,CAAa;IAChD,mBAAU,CAAC,SAAS;IACpB,mBAAU,CAAC,UAAU;IACrB,mBAAU,CAAC,MAAM;IACjB,mBAAU,CAAC,YAAY;CACxB,CAAC,CAAC;AAEH,MAAM,yBAAyB,GAAG,IAAI,GAAG,CAAa;IACpD,mBAAU,CAAC,SAAS;IACpB,mBAAU,CAAC,WAAW;IACtB,mBAAU,CAAC,MAAM;IACjB,mBAAU,CAAC,UAAU;IACrB,mBAAU,CAAC,YAAY;CACxB,CAAC,CAAC;AA0BH;;;;;GAKG;AACH,MAAa,iBAAiB;IA2B5B;;;;;;OAMG;IACH,YAAY,OAA6B,EAAE,KAAgB,EAAE,OAAkC;;QAC7F,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE;YAC/B,IAAI,CAAC,YAAY,GAAG,IAAI,mBAAW,CAAC,OAAO,CAAC,CAAC;Y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,sBAAsB,CAAC,GAAqB,EAAE,GAAqB;IACjF,IAAI,GAAG,IAAI,IAAI,IAAI,GAAG,IAAI,IAAI,EAAE;QAC9B,OAAO,CAAC,CAAC,CAAC;KACX;IAED,IAAI,GAAG,CAAC,SAAS,CAAC,MAAM,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE;QACvC,6FAA6F;QAC7F,MAAM,UAAU,GAAG,WAAI,CAAC,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,WAAI,CAAC,UAAU,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;QACzF,MAAM,UAAU,GAAG,WAAI,CAAC,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,WAAI,CAAC,UAAU,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;QACzF,OAAO,UAAU,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;KACvC;IAED,OAAO,CAAC,CAAC,CAAC;AACZ,CAAC;AAbD,wDAaC"} \ No newline at end of file diff --git a/node_modules/mongodb/lib/sdam/server_selection.js b/node_modules/mongodb/lib/sdam/server_selection.js new file mode 100644 index 000000000..1d3c878ec --- /dev/null +++ b/node_modules/mongodb/lib/sdam/server_selection.js @@ -0,0 +1,228 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.readPreferenceServerSelector = exports.secondaryWritableServerSelector = exports.sameServerSelector = exports.writableServerSelector = exports.MIN_SECONDARY_WRITE_WIRE_VERSION = void 0; +const error_1 = require("../error"); +const read_preference_1 = require("../read_preference"); +const common_1 = require("./common"); +// max staleness constants +const IDLE_WRITE_PERIOD = 10000; +const SMALLEST_MAX_STALENESS_SECONDS = 90; +// Minimum version to try writes on secondaries. +exports.MIN_SECONDARY_WRITE_WIRE_VERSION = 13; +/** + * Returns a server selector that selects for writable servers + */ +function writableServerSelector() { + return (topologyDescription, servers) => latencyWindowReducer(topologyDescription, servers.filter((s) => s.isWritable)); +} +exports.writableServerSelector = writableServerSelector; +/** + * The purpose of this selector is to select the same server, only + * if it is in a state that it can have commands sent to it. + */ +function sameServerSelector(description) { + return (topologyDescription, servers) => { + if (!description) + return []; + // Filter the servers to match the provided description only if + // the type is not unknown. + return servers.filter(sd => { + return sd.address === description.address && sd.type !== common_1.ServerType.Unknown; + }); + }; +} +exports.sameServerSelector = sameServerSelector; +/** + * Returns a server selector that uses a read preference to select a + * server potentially for a write on a secondary. + */ +function secondaryWritableServerSelector(wireVersion, readPreference) { + // If server version < 5.0, read preference always primary. + // If server version >= 5.0... + // - If read preference is supplied, use that. + // - If no read preference is supplied, use primary. + if (!readPreference || + !wireVersion || + (wireVersion && wireVersion < exports.MIN_SECONDARY_WRITE_WIRE_VERSION)) { + return readPreferenceServerSelector(read_preference_1.ReadPreference.primary); + } + return readPreferenceServerSelector(readPreference); +} +exports.secondaryWritableServerSelector = secondaryWritableServerSelector; +/** + * Reduces the passed in array of servers by the rules of the "Max Staleness" specification + * found here: https://github.com/mongodb/specifications/blob/master/source/max-staleness/max-staleness.rst + * + * @param readPreference - The read preference providing max staleness guidance + * @param topologyDescription - The topology description + * @param servers - The list of server descriptions to be reduced + * @returns The list of servers that satisfy the requirements of max staleness + */ +function maxStalenessReducer(readPreference, topologyDescription, servers) { + if (readPreference.maxStalenessSeconds == null || readPreference.maxStalenessSeconds < 0) { + return servers; + } + const maxStaleness = readPreference.maxStalenessSeconds; + const maxStalenessVariance = (topologyDescription.heartbeatFrequencyMS + IDLE_WRITE_PERIOD) / 1000; + if (maxStaleness < maxStalenessVariance) { + throw new error_1.MongoInvalidArgumentError(`Option "maxStalenessSeconds" must be at least ${maxStalenessVariance} seconds`); + } + if (maxStaleness < SMALLEST_MAX_STALENESS_SECONDS) { + throw new error_1.MongoInvalidArgumentError(`Option "maxStalenessSeconds" must be at least ${SMALLEST_MAX_STALENESS_SECONDS} seconds`); + } + if (topologyDescription.type === common_1.TopologyType.ReplicaSetWithPrimary) { + const primary = Array.from(topologyDescription.servers.values()).filter(primaryFilter)[0]; + return servers.reduce((result, server) => { + var _a; + const stalenessMS = server.lastUpdateTime - + server.lastWriteDate - + (primary.lastUpdateTime - primary.lastWriteDate) + + topologyDescription.heartbeatFrequencyMS; + const staleness = stalenessMS / 1000; + const maxStalenessSeconds = (_a = readPreference.maxStalenessSeconds) !== null && _a !== void 0 ? _a : 0; + if (staleness <= maxStalenessSeconds) { + result.push(server); + } + return result; + }, []); + } + if (topologyDescription.type === common_1.TopologyType.ReplicaSetNoPrimary) { + if (servers.length === 0) { + return servers; + } + const sMax = servers.reduce((max, s) => s.lastWriteDate > max.lastWriteDate ? s : max); + return servers.reduce((result, server) => { + var _a; + const stalenessMS = sMax.lastWriteDate - server.lastWriteDate + topologyDescription.heartbeatFrequencyMS; + const staleness = stalenessMS / 1000; + const maxStalenessSeconds = (_a = readPreference.maxStalenessSeconds) !== null && _a !== void 0 ? _a : 0; + if (staleness <= maxStalenessSeconds) { + result.push(server); + } + return result; + }, []); + } + return servers; +} +/** + * Determines whether a server's tags match a given set of tags + * + * @param tagSet - The requested tag set to match + * @param serverTags - The server's tags + */ +function tagSetMatch(tagSet, serverTags) { + const keys = Object.keys(tagSet); + const serverTagKeys = Object.keys(serverTags); + for (let i = 0; i < keys.length; ++i) { + const key = keys[i]; + if (serverTagKeys.indexOf(key) === -1 || serverTags[key] !== tagSet[key]) { + return false; + } + } + return true; +} +/** + * Reduces a set of server descriptions based on tags requested by the read preference + * + * @param readPreference - The read preference providing the requested tags + * @param servers - The list of server descriptions to reduce + * @returns The list of servers matching the requested tags + */ +function tagSetReducer(readPreference, servers) { + if (readPreference.tags == null || + (Array.isArray(readPreference.tags) && readPreference.tags.length === 0)) { + return servers; + } + for (let i = 0; i < readPreference.tags.length; ++i) { + const tagSet = readPreference.tags[i]; + const serversMatchingTagset = servers.reduce((matched, server) => { + if (tagSetMatch(tagSet, server.tags)) + matched.push(server); + return matched; + }, []); + if (serversMatchingTagset.length) { + return serversMatchingTagset; + } + } + return []; +} +/** + * Reduces a list of servers to ensure they fall within an acceptable latency window. This is + * further specified in the "Server Selection" specification, found here: + * https://github.com/mongodb/specifications/blob/master/source/server-selection/server-selection.rst + * + * @param topologyDescription - The topology description + * @param servers - The list of servers to reduce + * @returns The servers which fall within an acceptable latency window + */ +function latencyWindowReducer(topologyDescription, servers) { + const low = servers.reduce((min, server) => min === -1 ? server.roundTripTime : Math.min(server.roundTripTime, min), -1); + const high = low + topologyDescription.localThresholdMS; + return servers.reduce((result, server) => { + if (server.roundTripTime <= high && server.roundTripTime >= low) + result.push(server); + return result; + }, []); +} +// filters +function primaryFilter(server) { + return server.type === common_1.ServerType.RSPrimary; +} +function secondaryFilter(server) { + return server.type === common_1.ServerType.RSSecondary; +} +function nearestFilter(server) { + return server.type === common_1.ServerType.RSSecondary || server.type === common_1.ServerType.RSPrimary; +} +function knownFilter(server) { + return server.type !== common_1.ServerType.Unknown; +} +function loadBalancerFilter(server) { + return server.type === common_1.ServerType.LoadBalancer; +} +/** + * Returns a function which selects servers based on a provided read preference + * + * @param readPreference - The read preference to select with + */ +function readPreferenceServerSelector(readPreference) { + if (!readPreference.isValid()) { + throw new error_1.MongoInvalidArgumentError('Invalid read preference specified'); + } + return (topologyDescription, servers) => { + const commonWireVersion = topologyDescription.commonWireVersion; + if (commonWireVersion && + readPreference.minWireVersion && + readPreference.minWireVersion > commonWireVersion) { + throw new error_1.MongoCompatibilityError(`Minimum wire version '${readPreference.minWireVersion}' required, but found '${commonWireVersion}'`); + } + if (topologyDescription.type === common_1.TopologyType.LoadBalanced) { + return servers.filter(loadBalancerFilter); + } + if (topologyDescription.type === common_1.TopologyType.Unknown) { + return []; + } + if (topologyDescription.type === common_1.TopologyType.Single || + topologyDescription.type === common_1.TopologyType.Sharded) { + return latencyWindowReducer(topologyDescription, servers.filter(knownFilter)); + } + const mode = readPreference.mode; + if (mode === read_preference_1.ReadPreference.PRIMARY) { + return servers.filter(primaryFilter); + } + if (mode === read_preference_1.ReadPreference.PRIMARY_PREFERRED) { + const result = servers.filter(primaryFilter); + if (result.length) { + return result; + } + } + const filter = mode === read_preference_1.ReadPreference.NEAREST ? nearestFilter : secondaryFilter; + const selectedServers = latencyWindowReducer(topologyDescription, tagSetReducer(readPreference, maxStalenessReducer(readPreference, topologyDescription, servers.filter(filter)))); + if (mode === read_preference_1.ReadPreference.SECONDARY_PREFERRED && selectedServers.length === 0) { + return servers.filter(primaryFilter); + } + return selectedServers; + }; +} +exports.readPreferenceServerSelector = readPreferenceServerSelector; +//# sourceMappingURL=server_selection.js.map \ No newline at end of file diff --git a/node_modules/mongodb/lib/sdam/server_selection.js.map b/node_modules/mongodb/lib/sdam/server_selection.js.map new file mode 100644 index 000000000..f8a94927b --- /dev/null +++ b/node_modules/mongodb/lib/sdam/server_selection.js.map @@ -0,0 +1 @@ +{"version":3,"file":"server_selection.js","sourceRoot":"","sources":["../../src/sdam/server_selection.ts"],"names":[],"mappings":";;;AAAA,oCAA8E;AAC9E,wDAAoD;AACpD,qCAAoD;AAIpD,0BAA0B;AAC1B,MAAM,iBAAiB,GAAG,KAAK,CAAC;AAChC,MAAM,8BAA8B,GAAG,EAAE,CAAC;AAE1C,iDAAiD;AACpC,QAAA,gCAAgC,GAAG,EAAE,CAAC;AAQnD;;GAEG;AACH,SAAgB,sBAAsB;IACpC,OAAO,CACL,mBAAwC,EACxC,OAA4B,EACP,EAAE,CACvB,oBAAoB,CAClB,mBAAmB,EACnB,OAAO,CAAC,MAAM,CAAC,CAAC,CAAoB,EAAE,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC,CACvD,CAAC;AACN,CAAC;AATD,wDASC;AAED;;;GAGG;AACH,SAAgB,kBAAkB,CAAC,WAA+B;IAChE,OAAO,CACL,mBAAwC,EACxC,OAA4B,EACP,EAAE;QACvB,IAAI,CAAC,WAAW;YAAE,OAAO,EAAE,CAAC;QAC5B,+DAA+D;QAC/D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C,WAAW,CAAC,CAAC,CAAC;SAC/E;QAED,MAAM,IAAI,GAAG,cAAc,CAAC,IAAI,CAAC;QACjC,IAAI,IAAI,KAAK,gCAAc,CAAC,OAAO,EAAE;YACnC,OAAO,OAAO,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC;SACtC;QAED,IAAI,IAAI,KAAK,gCAAc,CAAC,iBAAiB,EAAE;YAC7C,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC;YAC7C,IAAI,MAAM,CAAC,MAAM,EAAE;gBACjB,OAAO,MAAM,CAAC;aACf;SACF;QAED,MAAM,MAAM,GAAG,IAAI,KAAK,gCAAc,CAAC,OAAO,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,eAAe,CAAC;QACjF,MAAM,eAAe,GAAG,oBAAoB,CAC1C,mBAAmB,EACnB,aAAa,CACX,cAAc,EACd,mBAAmB,CAAC,cAAc,EAAE,mBAAmB,EAAE,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CACjF,CACF,CAAC;QAEF,IAAI,IAAI,KAAK,gCAAc,CAAC,mBAAmB,IAAI,eAAe,CAAC,MAAM,KAAK,CAAC,EAAE;YAC/E,OAAO,OAAO,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC;SACtC;QAED,OAAO,eAAe,CAAC;IACzB,CAAC,CAAC;AACJ,CAAC;AA9DD,oEA8DC"} \ No newline at end of file diff --git a/node_modules/mongodb/lib/sdam/srv_polling.js b/node_modules/mongodb/lib/sdam/srv_polling.js new file mode 100644 index 000000000..e8ced70f5 --- /dev/null +++ b/node_modules/mongodb/lib/sdam/srv_polling.js @@ -0,0 +1,122 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.SrvPoller = exports.SrvPollingEvent = void 0; +const dns = require("dns"); +const timers_1 = require("timers"); +const error_1 = require("../error"); +const logger_1 = require("../logger"); +const mongo_types_1 = require("../mongo_types"); +const utils_1 = require("../utils"); +/** + * Determines whether a provided address matches the provided parent domain in order + * to avoid certain attack vectors. + * + * @param srvAddress - The address to check against a domain + * @param parentDomain - The domain to check the provided address against + * @returns Whether the provided address matches the parent domain + */ +function matchesParentDomain(srvAddress, parentDomain) { + const regex = /^.*?\./; + const srv = `.${srvAddress.replace(regex, '')}`; + const parent = `.${parentDomain.replace(regex, '')}`; + return srv.endsWith(parent); +} +/** + * @internal + * @category Event + */ +class SrvPollingEvent { + constructor(srvRecords) { + this.srvRecords = srvRecords; + } + hostnames() { + return new Set(this.srvRecords.map(r => utils_1.HostAddress.fromSrvRecord(r).toString())); + } +} +exports.SrvPollingEvent = SrvPollingEvent; +/** @internal */ +class SrvPoller extends mongo_types_1.TypedEventEmitter { + constructor(options) { + var _a, _b, _c; + super(); + if (!options || !options.srvHost) { + throw new error_1.MongoRuntimeError('Options for SrvPoller must exist and include srvHost'); + } + this.srvHost = options.srvHost; + this.srvMaxHosts = (_a = options.srvMaxHosts) !== null && _a !== void 0 ? _a : 0; + this.srvServiceName = (_b = options.srvServiceName) !== null && _b !== void 0 ? _b : 'mongodb'; + this.rescanSrvIntervalMS = 60000; + this.heartbeatFrequencyMS = (_c = options.heartbeatFrequencyMS) !== null && _c !== void 0 ? _c : 10000; + this.logger = new logger_1.Logger('srvPoller', options); + this.haMode = false; + this.generation = 0; + this._timeout = undefined; + } + get srvAddress() { + return `_${this.srvServiceName}._tcp.${this.srvHost}`; + } + get intervalMS() { + return this.haMode ? this.heartbeatFrequencyMS : this.rescanSrvIntervalMS; + } + start() { + if (!this._timeout) { + this.schedule(); + } + } + stop() { + if (this._timeout) { + clearTimeout(this._timeout); + this.generation += 1; + this._timeout = undefined; + } + } + schedule() { + if (this._timeout) { + clearTimeout(this._timeout); + } + this._timeout = (0, timers_1.setTimeout)(() => this._poll(), this.intervalMS); + } + success(srvRecords) { + this.haMode = false; + this.schedule(); + this.emit(SrvPoller.SRV_RECORD_DISCOVERY, new SrvPollingEvent(srvRecords)); + } + failure(message, obj) { + this.logger.warn(message, obj); + this.haMode = true; + this.schedule(); + } + parentDomainMismatch(srvRecord) { + this.logger.warn(`parent domain mismatch on SRV record (${srvRecord.name}:${srvRecord.port})`, srvRecord); + } + _poll() { + const generation = this.generation; + dns.resolveSrv(this.srvAddress, (err, srvRecords) => { + if (generation !== this.generation) { + return; + } + if (err) { + this.failure('DNS error', err); + return; + } + const finalAddresses = []; + for (const record of srvRecords) { + if (matchesParentDomain(record.name, this.srvHost)) { + finalAddresses.push(record); + } + else { + this.parentDomainMismatch(record); + } + } + if (!finalAddresses.length) { + this.failure('No valid addresses found at host'); + return; + } + this.success(finalAddresses); + }); + } +} +exports.SrvPoller = SrvPoller; +/** @event */ +SrvPoller.SRV_RECORD_DISCOVERY = 'srvRecordDiscovery'; +//# sourceMappingURL=srv_polling.js.map \ No newline at end of file diff --git a/node_modules/mongodb/lib/sdam/srv_polling.js.map b/node_modules/mongodb/lib/sdam/srv_polling.js.map new file mode 100644 index 000000000..18e86f585 --- /dev/null +++ b/node_modules/mongodb/lib/sdam/srv_polling.js.map @@ -0,0 +1 @@ +{"version":3,"file":"srv_polling.js","sourceRoot":"","sources":["../../src/sdam/srv_polling.ts"],"names":[],"mappings":";;;AAAA,2BAA2B;AAC3B,mCAAoC;AAEpC,oCAA6C;AAC7C,sCAAkD;AAClD,gDAAmD;AACnD,oCAAuC;AAEvC;;;;;;;GAOG;AACH,SAAS,mBAAmB,CAAC,UAAkB,EAAE,YAAoB;IACnE,MAAM,KAAK,GAAG,QAAQ,CAAC;IACvB,MAAM,GAAG,GAAG,IAAI,UAAU,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,EAAE,CAAC;IAChD,MAAM,MAAM,GAAG,IAAI,YAAY,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,EAAE,CAAC;IACrD,OAAO,GAAG,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;AAC9B,CAAC;AAED;;;GAGG;AACH,MAAa,eAAe;IAE1B,YAAY,U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G,CAAC,UAAU,CAAC,IAAI,CAAC,UAAU,EAAE,CAAC,GAAG,EAAE,UAAU,EAAE,EAAE;YAClD,IAAI,UAAU,KAAK,IAAI,CAAC,UAAU,EAAE;gBAClC,OAAO;aACR;YAED,IAAI,GAAG,EAAE;gBACP,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE,GAAG,CAAC,CAAC;gBAC/B,OAAO;aACR;YAED,MAAM,cAAc,GAAoB,EAAE,CAAC;YAC3C,KAAK,MAAM,MAAM,IAAI,UAAU,EAAE;gBAC/B,IAAI,mBAAmB,CAAC,MAAM,CAAC,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,EAAE;oBAClD,cAAc,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;iBAC7B;qBAAM;oBACL,IAAI,CAAC,oBAAoB,CAAC,MAAM,CAAC,CAAC;iBACnC;aACF;YAED,IAAI,CAAC,cAAc,CAAC,MAAM,EAAE;gBAC1B,IAAI,CAAC,OAAO,CAAC,kCAAkC,CAAC,CAAC;gBACjD,OAAO;aACR;YAED,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC;QAC/B,CAAC,CAAC,CAAC;IACL,CAAC;;AA/GH,8BAgHC;AArGC,aAAa;AACG,8BAAoB,GAAG,oBAA6B,CAAC"} \ No newline at end of file diff --git a/node_modules/mongodb/lib/sdam/topology.js b/node_modules/mongodb/lib/sdam/topology.js new file mode 100644 index 000000000..26e1677eb --- /dev/null +++ b/node_modules/mongodb/lib/sdam/topology.js @@ -0,0 +1,684 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ServerCapabilities = exports.Topology = void 0; +const Denque = require("denque"); +const timers_1 = require("timers"); +const bson_1 = require("../bson"); +const connection_string_1 = require("../connection_string"); +const constants_1 = require("../constants"); +const error_1 = require("../error"); +const mongo_types_1 = require("../mongo_types"); +const read_preference_1 = require("../read_preference"); +const sessions_1 = require("../sessions"); +const utils_1 = require("../utils"); +const common_1 = require("./common"); +const events_1 = require("./events"); +const server_1 = require("./server"); +const server_description_1 = require("./server_description"); +const server_selection_1 = require("./server_selection"); +const srv_polling_1 = require("./srv_polling"); +const topology_description_1 = require("./topology_description"); +// Global state +let globalTopologyCounter = 0; +const stateTransition = (0, utils_1.makeStateMachine)({ + [common_1.STATE_CLOSED]: [common_1.STATE_CLOSED, common_1.STATE_CONNECTING], + [common_1.STATE_CONNECTING]: [common_1.STATE_CONNECTING, common_1.STATE_CLOSING, common_1.STATE_CONNECTED, common_1.STATE_CLOSED], + [common_1.STATE_CONNECTED]: [common_1.STATE_CONNECTED, common_1.STATE_CLOSING, common_1.STATE_CLOSED], + [common_1.STATE_CLOSING]: [common_1.STATE_CLOSING, common_1.STATE_CLOSED] +}); +/** @internal */ +const kCancelled = Symbol('cancelled'); +/** @internal */ +const kWaitQueue = Symbol('waitQueue'); +/** + * A container of server instances representing a connection to a MongoDB topology. + * @internal + */ +class Topology extends mongo_types_1.TypedEventEmitter { + /** + * @param seedlist - a list of HostAddress instances to connect to + */ + constructor(seeds, options) { + var _a; + super(); + // Legacy CSFLE support + this.bson = Object.create(null); + this.bson.serialize = bson_1.serialize; + this.bson.deserialize = bson_1.deserialize; + // Options should only be undefined in tests, MongoClient will always have defined options + options = options !== null && options !== void 0 ? options : { + hosts: [utils_1.HostAddress.fromString('localhost:27017')], + ...Object.fromEntries(connection_string_1.DEFAULT_OPTIONS.entries()), + ...Object.fromEntries(connection_string_1.FEATURE_FLAGS.entries()) + }; + if (typeof seeds === 'string') { + seeds = [utils_1.HostAddress.fromString(seeds)]; + } + else if (!Array.isArray(seeds)) { + seeds = [seeds]; + } + const seedlist = []; + for (const seed of seeds) { + if (typeof seed === 'string') { + seedlist.push(utils_1.HostAddress.fromString(seed)); + } + else if (seed instanceof utils_1.HostAddress) { + seedlist.push(seed); + } + else { + // FIXME(NODE-3483): May need to be a MongoParseError + throw new error_1.MongoRuntimeError(`Topology cannot be constructed from ${JSON.stringify(seed)}`); + } + } + const topologyType = topologyTypeFromOptions(options); + const topologyId = globalTopologyCounter++; + const selectedHosts = options.srvMaxHosts == null || + options.srvMaxHosts === 0 || + options.srvMaxHosts >= seedlist.length + ? seedlist + : (0, utils_1.shuffle)(seedlist, options.srvMaxHosts); + const serverDescriptions = new Map(); + for (const hostAddress of selectedHosts) { + serverDescriptions.set(hostAddress.toString(), new server_description_1.ServerDescription(hostAddress)); + } + this[kWaitQueue] = new Denque(); + this.s = { + // the id of this topology + id: topologyId, + // passed in options + options, + // initial seedlist of servers to connect to + seedlist, + // initial state + state: common_1.STATE_CLOSED, + // the topology description + description: new topology_description_1.TopologyDescription(topologyType, serverDescriptions, options.replicaSet, undefined, undefined, undefined, options), + serverSelectionTimeoutMS: options.serverSelectionTimeoutMS, + heartbeatFrequencyMS: options.heartbeatFrequencyMS, + minHeartbeatFrequencyMS: options.minHeartbeatFrequencyMS, + // a map of server instances to normalized addresses + servers: new Map(), + // Server Session Pool + sessionPool: new sessions_1.ServerSessionPool(this), + // Active client sessions + sessions: new Set(), + credentials: options === null || options === void 0 ? void 0 : options.credentials, + clusterTime: undefined, + // timer management + connectionTimers: new Set(), + detectShardedTopology: ev => this.detectShardedTopology(ev), + detectSrvRecords: ev => this.detectSrvRecords(ev) + }; + if (options.srvHost && !options.loadBalanced) { + this.s.srvPoller = + (_a = options.srvPoller) !== null && _a !== void 0 ? _a : new srv_polling_1.SrvPoller({ + heartbeatFrequencyMS: this.s.heartbeatFrequencyMS, + srvHost: options.srvHost, + srvMaxHosts: options.srvMaxHosts, + srvServiceName: options.srvServiceName + }); + this.on(Topology.TOPOLOGY_DESCRIPTION_CHANGED, this.s.detectShardedTopology); + } + } + detectShardedTopology(event) { + var _a, _b, _c; + const previousType = event.previousDescription.type; + const newType = event.newDescription.type; + const transitionToSharded = previousType !== common_1.TopologyType.Sharded && newType === common_1.TopologyType.Sharded; + const srvListeners = (_a = this.s.srvPoller) === null || _a === void 0 ? void 0 : _a.listeners(srv_polling_1.SrvPoller.SRV_RECORD_DISCOVERY); + const listeningToSrvPolling = !!(srvListeners === null || srvListeners === void 0 ? void 0 : srvListeners.includes(this.s.detectSrvRecords)); + if (transitionToSharded && !listeningToSrvPolling) { + (_b = this.s.srvPoller) === null || _b === void 0 ? void 0 : _b.on(srv_polling_1.SrvPoller.SRV_RECORD_DISCOVERY, this.s.detectSrvRecords); + (_c = this.s.srvPoller) === null || _c === void 0 ? void 0 : _c.start(); + } + } + detectSrvRecords(ev) { + const previousTopologyDescription = this.s.description; + this.s.description = this.s.description.updateFromSrvPollingEvent(ev, this.s.options.srvMaxHosts); + if (this.s.description === previousTopologyDescription) { + // Nothing changed, so return + return; + } + updateServers(this); + this.emit(Topology.TOPOLOGY_DESCRIPTION_CHANGED, new events_1.TopologyDescriptionChangedEvent(this.s.id, previousTopologyDescription, this.s.description)); + } + /** + * @returns A `TopologyDescription` for this topology + */ + get description() { + return this.s.description; + } + get loadBalanced() { + return this.s.options.loadBalanced; + } + get capabilities() { + return new ServerCapabilities(this.lastHello()); + } + /** Initiate server connect */ + connect(options, callback) { + var _a; + if (typeof options === 'function') + (callback = options), (options = {}); + options = options !== null && options !== void 0 ? options : {}; + if (this.s.state === common_1.STATE_CONNECTED) { + if (typeof callback === 'function') { + callback(); + } + return; + } + stateTransition(this, common_1.STATE_CONNECTING); + // emit SDAM monitoring events + this.emit(Topology.TOPOLOGY_OPENING, new events_1.TopologyOpeningEvent(this.s.id)); + // emit an event for the topology change + this.emit(Topology.TOPOLOGY_DESCRIPTION_CHANGED, new events_1.TopologyDescriptionChangedEvent(this.s.id, new topology_description_1.TopologyDescription(common_1.TopologyType.Unknown), // initial is always Unknown + this.s.description)); + // connect all known servers, then attempt server selection to connect + const serverDescriptions = Array.from(this.s.description.servers.values()); + this.s.servers = new Map(serverDescriptions.map(serverDescription => [ + serverDescription.address, + createAndConnectServer(this, serverDescription) + ])); + // In load balancer mode we need to fake a server description getting + // emitted from the monitor, since the monitor doesn't exist. + if (this.s.options.loadBalanced) { + for (const description of serverDescriptions) { + const newDescription = new server_description_1.ServerDescription(description.hostAddress, undefined, { + loadBalanced: this.s.options.loadBalanced + }); + this.serverUpdateHandler(newDescription); + } + } + const readPreference = (_a = options.readPreference) !== null && _a !== void 0 ? _a : read_preference_1.ReadPreference.primary; + this.selectServer((0, server_selection_1.readPreferenceServerSelector)(readPreference), options, (err, server) => { + if (err) { + this.close(); + typeof callback === 'function' ? callback(err) : this.emit(Topology.ERROR, err); + return; + } + // TODO: NODE-2471 + const skipPingOnConnect = this.s.options[Symbol.for('@@mdb.skipPingOnConnect')] === true; + if (!skipPingOnConnect && server && this.s.credentials) { + server.command((0, utils_1.ns)('admin.$cmd'), { ping: 1 }, {}, err => { + if (err) { + typeof callback === 'function' ? callback(err) : this.emit(Topology.ERROR, err); + return; + } + stateTransition(this, common_1.STATE_CONNECTED); + this.emit(Topology.OPEN, this); + this.emit(Topology.CONNECT, this); + if (typeof callback === 'function') + callback(undefined, this); + }); + return; + } + stateTransition(this, common_1.STATE_CONNECTED); + this.emit(Topology.OPEN, this); + this.emit(Topology.CONNECT, this); + if (typeof callback === 'function') + callback(undefined, this); + }); + } + /** Close this topology */ + close(options, callback) { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof options === 'boolean') { + options = { force: options }; + } + options = options !== null && options !== void 0 ? options : {}; + if (this.s.state === common_1.STATE_CLOSED || this.s.state === common_1.STATE_CLOSING) { + if (typeof callback === 'function') { + callback(); + } + return; + } + stateTransition(this, common_1.STATE_CLOSING); + drainWaitQueue(this[kWaitQueue], new error_1.MongoTopologyClosedError()); + (0, common_1.drainTimerQueue)(this.s.connectionTimers); + if (this.s.srvPoller) { + this.s.srvPoller.stop(); + this.s.srvPoller.removeListener(srv_polling_1.SrvPoller.SRV_RECORD_DISCOVERY, this.s.detectSrvRecords); + } + this.removeListener(Topology.TOPOLOGY_DESCRIPTION_CHANGED, this.s.detectShardedTopology); + (0, utils_1.eachAsync)(Array.from(this.s.sessions.values()), (session, cb) => session.endSession(cb), () => { + this.s.sessionPool.endAllPooledSessions(() => { + (0, utils_1.eachAsync)(Array.from(this.s.servers.values()), (server, cb) => destroyServer(server, this, options, cb), err => { + this.s.servers.clear(); + // emit an event for close + this.emit(Topology.TOPOLOGY_CLOSED, new events_1.TopologyClosedEvent(this.s.id)); + stateTransition(this, common_1.STATE_CLOSED); + if (typeof callback === 'function') { + callback(err); + } + }); + }); + }); + } + /** + * Selects a server according to the selection predicate provided + * + * @param selector - An optional selector to select servers by, defaults to a random selection within a latency window + * @param options - Optional settings related to server selection + * @param callback - The callback used to indicate success or failure + * @returns An instance of a `Server` meeting the criteria of the predicate provided + */ + selectServer(selector, options, callback) { + let serverSelector; + if (typeof selector !== 'function') { + if (typeof selector === 'string') { + serverSelector = (0, server_selection_1.readPreferenceServerSelector)(read_preference_1.ReadPreference.fromString(selector)); + } + else { + let readPreference; + if (selector instanceof read_preference_1.ReadPreference) { + readPreference = selector; + } + else { + read_preference_1.ReadPreference.translate(options); + readPreference = options.readPreference || read_preference_1.ReadPreference.primary; + } + serverSelector = (0, server_selection_1.readPreferenceServerSelector)(readPreference); + } + } + else { + serverSelector = selector; + } + options = Object.assign({}, { serverSelectionTimeoutMS: this.s.serverSelectionTimeoutMS }, options); + const isSharded = this.description.type === common_1.TopologyType.Sharded; + const session = options.session; + const transaction = session && session.transaction; + if (isSharded && transaction && transaction.server) { + callback(undefined, transaction.server); + return; + } + const waitQueueMember = { + serverSelector, + transaction, + callback + }; + const serverSelectionTimeoutMS = options.serverSelectionTimeoutMS; + if (serverSelectionTimeoutMS) { + waitQueueMember.timer = (0, timers_1.setTimeout)(() => { + waitQueueMember[kCancelled] = true; + waitQueueMember.timer = undefined; + const timeoutError = new error_1.MongoServerSelectionError(`Server selection timed out after ${serverSelectionTimeoutMS} ms`, this.description); + waitQueueMember.callback(timeoutError); + }, serverSelectionTimeoutMS); + } + this[kWaitQueue].push(waitQueueMember); + processWaitQueue(this); + } + // Sessions related methods + /** + * @returns Whether the topology should initiate selection to determine session support + */ + shouldCheckForSessionSupport() { + if (this.description.type === common_1.TopologyType.Single) { + return !this.description.hasKnownServers; + } + return !this.description.hasDataBearingServers; + } + /** + * @returns Whether sessions are supported on the current topology + */ + hasSessionSupport() { + return this.loadBalanced || this.description.logicalSessionTimeoutMinutes != null; + } + /** Start a logical session */ + startSession(options, clientOptions) { + const session = new sessions_1.ClientSession(this.client, this.s.sessionPool, options, clientOptions); + session.once('ended', () => { + this.s.sessions.delete(session); + }); + this.s.sessions.add(session); + return session; + } + /** Send endSessions command(s) with the given session ids */ + endSessions(sessions, callback) { + if (!Array.isArray(sessions)) { + sessions = [sessions]; + } + this.selectServer((0, server_selection_1.readPreferenceServerSelector)(read_preference_1.ReadPreference.primaryPreferred), {}, (err, server) => { + if (err || !server) { + if (typeof callback === 'function') + callback(err); + return; + } + server.command((0, utils_1.ns)('admin.$cmd'), { endSessions: sessions }, { noResponse: true }, (err, result) => { + if (typeof callback === 'function') + callback(err, result); + }); + }); + } + /** + * Update the internal TopologyDescription with a ServerDescription + * + * @param serverDescription - The server to update in the internal list of server descriptions + */ + serverUpdateHandler(serverDescription) { + if (!this.s.description.hasServer(serverDescription.address)) { + return; + } + // ignore this server update if its from an outdated topologyVersion + if (isStaleServerDescription(this.s.description, serverDescription)) { + return; + } + // these will be used for monitoring events later + const previousTopologyDescription = this.s.description; + const previousServerDescription = this.s.description.servers.get(serverDescription.address); + if (!previousServerDescription) { + return; + } + // Driver Sessions Spec: "Whenever a driver receives a cluster time from + // a server it MUST compare it to the current highest seen cluster time + // for the deployment. If the new cluster time is higher than the + // highest seen cluster time it MUST become the new highest seen cluster + // time. Two cluster times are compared using only the BsonTimestamp + // value of the clusterTime embedded field." + const clusterTime = serverDescription.$clusterTime; + if (clusterTime) { + (0, common_1._advanceClusterTime)(this, clusterTime); + } + // If we already know all the information contained in this updated description, then + // we don't need to emit SDAM events, but still need to update the description, in order + // to keep client-tracked attributes like last update time and round trip time up to date + const equalDescriptions = previousServerDescription && previousServerDescription.equals(serverDescription); + // first update the TopologyDescription + this.s.description = this.s.description.update(serverDescription); + if (this.s.description.compatibilityError) { + this.emit(Topology.ERROR, new error_1.MongoCompatibilityError(this.s.description.compatibilityError)); + return; + } + // emit monitoring events for this change + if (!equalDescriptions) { + const newDescription = this.s.description.servers.get(serverDescription.address); + if (newDescription) { + this.emit(Topology.SERVER_DESCRIPTION_CHANGED, new events_1.ServerDescriptionChangedEvent(this.s.id, serverDescription.address, previousServerDescription, newDescription)); + } + } + // update server list from updated descriptions + updateServers(this, serverDescription); + // attempt to resolve any outstanding server selection attempts + if (this[kWaitQueue].length > 0) { + processWaitQueue(this); + } + if (!equalDescriptions) { + this.emit(Topology.TOPOLOGY_DESCRIPTION_CHANGED, new events_1.TopologyDescriptionChangedEvent(this.s.id, previousTopologyDescription, this.s.description)); + } + } + auth(credentials, callback) { + if (typeof credentials === 'function') + (callback = credentials), (credentials = undefined); + if (typeof callback === 'function') + callback(undefined, true); + } + get clientMetadata() { + return this.s.options.metadata; + } + isConnected() { + return this.s.state === common_1.STATE_CONNECTED; + } + isDestroyed() { + return this.s.state === common_1.STATE_CLOSED; + } + /** + * @deprecated This function is deprecated and will be removed in the next major version. + */ + unref() { + (0, utils_1.emitWarning)('`unref` is a noop and will be removed in the next major version'); + } + // NOTE: There are many places in code where we explicitly check the last hello + // to do feature support detection. This should be done any other way, but for + // now we will just return the first hello seen, which should suffice. + lastHello() { + const serverDescriptions = Array.from(this.description.servers.values()); + if (serverDescriptions.length === 0) + return {}; + const sd = serverDescriptions.filter((sd) => sd.type !== common_1.ServerType.Unknown)[0]; + const result = sd || { maxWireVersion: this.description.commonWireVersion }; + return result; + } + get commonWireVersion() { + return this.description.commonWireVersion; + } + get logicalSessionTimeoutMinutes() { + return this.description.logicalSessionTimeoutMinutes; + } + get clusterTime() { + return this.s.clusterTime; + } + set clusterTime(clusterTime) { + this.s.clusterTime = clusterTime; + } +} +exports.Topology = Topology; +/** @event */ +Topology.SERVER_OPENING = constants_1.SERVER_OPENING; +/** @event */ +Topology.SERVER_CLOSED = constants_1.SERVER_CLOSED; +/** @event */ +Topology.SERVER_DESCRIPTION_CHANGED = constants_1.SERVER_DESCRIPTION_CHANGED; +/** @event */ +Topology.TOPOLOGY_OPENING = constants_1.TOPOLOGY_OPENING; +/** @event */ +Topology.TOPOLOGY_CLOSED = constants_1.TOPOLOGY_CLOSED; +/** @event */ +Topology.TOPOLOGY_DESCRIPTION_CHANGED = constants_1.TOPOLOGY_DESCRIPTION_CHANGED; +/** @event */ +Topology.ERROR = constants_1.ERROR; +/** @event */ +Topology.OPEN = constants_1.OPEN; +/** @event */ +Topology.CONNECT = constants_1.CONNECT; +/** @event */ +Topology.CLOSE = constants_1.CLOSE; +/** @event */ +Topology.TIMEOUT = constants_1.TIMEOUT; +/** Destroys a server, and removes all event listeners from the instance */ +function destroyServer(server, topology, options, callback) { + options = options !== null && options !== void 0 ? options : {}; + for (const event of constants_1.LOCAL_SERVER_EVENTS) { + server.removeAllListeners(event); + } + server.destroy(options, () => { + topology.emit(Topology.SERVER_CLOSED, new events_1.ServerClosedEvent(topology.s.id, server.description.address)); + for (const event of constants_1.SERVER_RELAY_EVENTS) { + server.removeAllListeners(event); + } + if (typeof callback === 'function') { + callback(); + } + }); +} +/** Predicts the TopologyType from options */ +function topologyTypeFromOptions(options) { + if (options === null || options === void 0 ? void 0 : options.directConnection) { + return common_1.TopologyType.Single; + } + if (options === null || options === void 0 ? void 0 : options.replicaSet) { + return common_1.TopologyType.ReplicaSetNoPrimary; + } + if (options === null || options === void 0 ? void 0 : options.loadBalanced) { + return common_1.TopologyType.LoadBalanced; + } + return common_1.TopologyType.Unknown; +} +/** + * Creates new server instances and attempts to connect them + * + * @param topology - The topology that this server belongs to + * @param serverDescription - The description for the server to initialize and connect to + */ +function createAndConnectServer(topology, serverDescription) { + topology.emit(Topology.SERVER_OPENING, new events_1.ServerOpeningEvent(topology.s.id, serverDescription.address)); + const server = new server_1.Server(topology, serverDescription, topology.s.options); + for (const event of constants_1.SERVER_RELAY_EVENTS) { + server.on(event, (e) => topology.emit(event, e)); + } + server.on(server_1.Server.DESCRIPTION_RECEIVED, description => topology.serverUpdateHandler(description)); + server.connect(); + return server; +} +/** + * @param topology - Topology to update. + * @param incomingServerDescription - New server description. + */ +function updateServers(topology, incomingServerDescription) { + // update the internal server's description + if (incomingServerDescription && topology.s.servers.has(incomingServerDescription.address)) { + const server = topology.s.servers.get(incomingServerDescription.address); + if (server) { + server.s.description = incomingServerDescription; + } + } + // add new servers for all descriptions we currently don't know about locally + for (const serverDescription of topology.description.servers.values()) { + if (!topology.s.servers.has(serverDescription.address)) { + const server = createAndConnectServer(topology, serverDescription); + topology.s.servers.set(serverDescription.address, server); + } + } + // for all servers no longer known, remove their descriptions and destroy their instances + for (const entry of topology.s.servers) { + const serverAddress = entry[0]; + if (topology.description.hasServer(serverAddress)) { + continue; + } + if (!topology.s.servers.has(serverAddress)) { + continue; + } + const server = topology.s.servers.get(serverAddress); + topology.s.servers.delete(serverAddress); + // prepare server for garbage collection + if (server) { + destroyServer(server, topology); + } + } +} +function drainWaitQueue(queue, err) { + while (queue.length) { + const waitQueueMember = queue.shift(); + if (!waitQueueMember) { + continue; + } + if (waitQueueMember.timer) { + clearTimeout(waitQueueMember.timer); + } + if (!waitQueueMember[kCancelled]) { + waitQueueMember.callback(err); + } + } +} +function processWaitQueue(topology) { + if (topology.s.state === common_1.STATE_CLOSED) { + drainWaitQueue(topology[kWaitQueue], new error_1.MongoTopologyClosedError()); + return; + } + const isSharded = topology.description.type === common_1.TopologyType.Sharded; + const serverDescriptions = Array.from(topology.description.servers.values()); + const membersToProcess = topology[kWaitQueue].length; + for (let i = 0; i < membersToProcess; ++i) { + const waitQueueMember = topology[kWaitQueue].shift(); + if (!waitQueueMember) { + continue; + } + if (waitQueueMember[kCancelled]) { + continue; + } + let selectedDescriptions; + try { + const serverSelector = waitQueueMember.serverSelector; + selectedDescriptions = serverSelector + ? serverSelector(topology.description, serverDescriptions) + : serverDescriptions; + } + catch (e) { + if (waitQueueMember.timer) { + clearTimeout(waitQueueMember.timer); + } + waitQueueMember.callback(e); + continue; + } + let selectedServer; + if (selectedDescriptions.length === 0) { + topology[kWaitQueue].push(waitQueueMember); + continue; + } + else if (selectedDescriptions.length === 1) { + selectedServer = topology.s.servers.get(selectedDescriptions[0].address); + } + else { + // don't shuffle the array if there are only two elements + const descriptions = selectedDescriptions.length === 2 ? selectedDescriptions : (0, utils_1.shuffle)(selectedDescriptions, 2); + const server1 = topology.s.servers.get(descriptions[0].address); + const server2 = topology.s.servers.get(descriptions[1].address); + selectedServer = + server1 && server2 && server1.s.operationCount < server2.s.operationCount + ? server1 + : server2; + } + if (!selectedServer) { + waitQueueMember.callback(new error_1.MongoServerSelectionError('server selection returned a server description but the server was not found in the topology', topology.description)); + return; + } + const transaction = waitQueueMember.transaction; + if (isSharded && transaction && transaction.isActive && selectedServer) { + transaction.pinServer(selectedServer); + } + if (waitQueueMember.timer) { + clearTimeout(waitQueueMember.timer); + } + waitQueueMember.callback(undefined, selectedServer); + } + if (topology[kWaitQueue].length > 0) { + // ensure all server monitors attempt monitoring soon + for (const [, server] of topology.s.servers) { + process.nextTick(function scheduleServerCheck() { + return server.requestCheck(); + }); + } + } +} +function isStaleServerDescription(topologyDescription, incomingServerDescription) { + const currentServerDescription = topologyDescription.servers.get(incomingServerDescription.address); + const currentTopologyVersion = currentServerDescription === null || currentServerDescription === void 0 ? void 0 : currentServerDescription.topologyVersion; + return ((0, server_description_1.compareTopologyVersion)(currentTopologyVersion, incomingServerDescription.topologyVersion) > 0); +} +/** @public */ +class ServerCapabilities { + constructor(hello) { + this.minWireVersion = hello.minWireVersion || 0; + this.maxWireVersion = hello.maxWireVersion || 0; + } + get hasAggregationCursor() { + return this.maxWireVersion >= 1; + } + get hasWriteCommands() { + return this.maxWireVersion >= 2; + } + get hasTextSearch() { + return this.minWireVersion >= 0; + } + get hasAuthCommands() { + return this.maxWireVersion >= 1; + } + get hasListCollectionsCommand() { + return this.maxWireVersion >= 3; + } + get hasListIndexesCommand() { + return this.maxWireVersion >= 3; + } + get supportsSnapshotReads() { + return this.maxWireVersion >= 13; + } + get commandsTakeWriteConcern() { + return this.maxWireVersion >= 5; + } + get commandsTakeCollation() { + return this.maxWireVersion >= 5; + } +} +exports.ServerCapabilities = ServerCapabilities; +//# sourceMappingURL=topology.js.map \ No newline at end of file diff --git a/node_modules/mongodb/lib/sdam/topology.js.map b/node_modules/mongodb/lib/sdam/topology.js.map new file mode 100644 index 000000000..8f1088c8a --- /dev/null +++ b/node_modules/mongodb/lib/sdam/topology.js.map @@ -0,0 +1 @@ +{"version":3,"file":"topology.js","sourceRoot":"","sources":["../../src/sdam/topology.ts"],"names":[],"mappings":";;;AAAA,iCAAkC;AAClC,mCAAoC;AAGpC,kCAAiD;AAIjD,4DAAsE;AACtE,4CAcsB;AACtB,oCAMkB;AAElB,gDAAmD;AACnD,wDAAwE;AACxE,0CAKqB;AAErB,oCAUkB;AAClB,qCAWkB;AAClB,qCAOkB;AAClB,qCAA+D;AAC/D,6DAAiF;AACjF,yDAAkF;AAClF,+CAA2D;AAC3D,iEAA6D;AAE7D,eAAe;AACf,IAAI,qBAAqB,GAAG,CAAC,CAAC;AAE9B,MAAM,eAAe,GAAG,IAAA,wBAAgB,EAAC;IACvC,CAAC,qBAAY,CAAC,EAAE,CAAC,qBAAY,EAAE,yBAAgB,CAAC;IAChD,CAAC,yBAAgB,CAAC,EAAE,CAAC,yBAAgB,EAAE,sBAAa,EAAE,wBAAe,EAAE,qBAAY,CAAC;IACpF,CAAC,wBAAe,CAAC,EAAE,CAAC,wBAAe,EAAE,sBAAa,EAAE,qBAAY,CAAC;IACjE,CAAC,sBAAa,CAAC,EAAE,CAAC,sBAAa,EAAE,qBAAY,CAAC;CAC/C,CAAC,CAAC;AAEH,gBAAgB;AAChB,MAAM,UAAU,GAAG,MAAM,CAAC,WAAW,CAAC,CAAC;AACvC,gBAAgB;AAChB,MAAM,UAAU,GAAG,MAAM,CAAC,WAA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QAC3B,OAAO,IAAI,CAAC,cAAc,IAAI,CAAC,CAAC;IAClC,CAAC;IAED,IAAI,qBAAqB;QACvB,OAAO,IAAI,CAAC,cAAc,IAAI,CAAC,CAAC;IAClC,CAAC;IAED,IAAI,qBAAqB;QACvB,OAAO,IAAI,CAAC,cAAc,IAAI,EAAE,CAAC;IACnC,CAAC;IAED,IAAI,wBAAwB;QAC1B,OAAO,IAAI,CAAC,cAAc,IAAI,CAAC,CAAC;IAClC,CAAC;IAED,IAAI,qBAAqB;QACvB,OAAO,IAAI,CAAC,cAAc,IAAI,CAAC,CAAC;IAClC,CAAC;CACF;AA3CD,gDA2CC"} \ No newline at end of file diff --git a/node_modules/mongodb/lib/sdam/topology_description.js b/node_modules/mongodb/lib/sdam/topology_description.js new file mode 100644 index 000000000..b6c4fd076 --- /dev/null +++ b/node_modules/mongodb/lib/sdam/topology_description.js @@ -0,0 +1,358 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.TopologyDescription = void 0; +const WIRE_CONSTANTS = require("../cmap/wire_protocol/constants"); +const error_1 = require("../error"); +const utils_1 = require("../utils"); +const common_1 = require("./common"); +const server_description_1 = require("./server_description"); +// constants related to compatibility checks +const MIN_SUPPORTED_SERVER_VERSION = WIRE_CONSTANTS.MIN_SUPPORTED_SERVER_VERSION; +const MAX_SUPPORTED_SERVER_VERSION = WIRE_CONSTANTS.MAX_SUPPORTED_SERVER_VERSION; +const MIN_SUPPORTED_WIRE_VERSION = WIRE_CONSTANTS.MIN_SUPPORTED_WIRE_VERSION; +const MAX_SUPPORTED_WIRE_VERSION = WIRE_CONSTANTS.MAX_SUPPORTED_WIRE_VERSION; +const MONGOS_OR_UNKNOWN = new Set([common_1.ServerType.Mongos, common_1.ServerType.Unknown]); +const MONGOS_OR_STANDALONE = new Set([common_1.ServerType.Mongos, common_1.ServerType.Standalone]); +const NON_PRIMARY_RS_MEMBERS = new Set([ + common_1.ServerType.RSSecondary, + common_1.ServerType.RSArbiter, + common_1.ServerType.RSOther +]); +/** + * Representation of a deployment of servers + * @public + */ +class TopologyDescription { + /** + * Create a TopologyDescription + */ + constructor(topologyType, serverDescriptions, setName, maxSetVersion, maxElectionId, commonWireVersion, options) { + var _a, _b; + options = options !== null && options !== void 0 ? options : {}; + this.type = topologyType !== null && topologyType !== void 0 ? topologyType : common_1.TopologyType.Unknown; + this.servers = serverDescriptions !== null && serverDescriptions !== void 0 ? serverDescriptions : new Map(); + this.stale = false; + this.compatible = true; + this.heartbeatFrequencyMS = (_a = options.heartbeatFrequencyMS) !== null && _a !== void 0 ? _a : 0; + this.localThresholdMS = (_b = options.localThresholdMS) !== null && _b !== void 0 ? _b : 15; + if (setName) { + this.setName = setName; + } + if (maxSetVersion) { + this.maxSetVersion = maxSetVersion; + } + if (maxElectionId) { + this.maxElectionId = maxElectionId; + } + if (commonWireVersion) { + this.commonWireVersion = commonWireVersion; + } + // determine server compatibility + for (const serverDescription of this.servers.values()) { + // Load balancer mode is always compatible. + if (serverDescription.type === common_1.ServerType.Unknown || + serverDescription.type === common_1.ServerType.LoadBalancer) { + continue; + } + if (serverDescription.minWireVersion > MAX_SUPPORTED_WIRE_VERSION) { + this.compatible = false; + this.compatibilityError = `Server at ${serverDescription.address} requires wire version ${serverDescription.minWireVersion}, but this version of the driver only supports up to ${MAX_SUPPORTED_WIRE_VERSION} (MongoDB ${MAX_SUPPORTED_SERVER_VERSION})`; + } + if (serverDescription.maxWireVersion < MIN_SUPPORTED_WIRE_VERSION) { + this.compatible = false; + this.compatibilityError = `Server at ${serverDescription.address} reports wire version ${serverDescription.maxWireVersion}, but this version of the driver requires at least ${MIN_SUPPORTED_WIRE_VERSION} (MongoDB ${MIN_SUPPORTED_SERVER_VERSION}).`; + break; + } + } + // Whenever a client updates the TopologyDescription from a hello response, it MUST set + // TopologyDescription.logicalSessionTimeoutMinutes to the smallest logicalSessionTimeoutMinutes + // value among ServerDescriptions of all data-bearing server types. If any have a null + // logicalSessionTimeoutMinutes, then TopologyDescription.logicalSessionTimeoutMinutes MUST be + // set to null. + this.logicalSessionTimeoutMinutes = undefined; + for (const [, server] of this.servers) { + if (server.isReadable) { + if (server.logicalSessionTimeoutMinutes == null) { + // If any of the servers have a null logicalSessionsTimeout, then the whole topology does + this.logicalSessionTimeoutMinutes = undefined; + break; + } + if (this.logicalSessionTimeoutMinutes == null) { + // First server with a non null logicalSessionsTimeout + this.logicalSessionTimeoutMinutes = server.logicalSessionTimeoutMinutes; + continue; + } + // Always select the smaller of the: + // current server logicalSessionsTimeout and the topologies logicalSessionsTimeout + this.logicalSessionTimeoutMinutes = Math.min(this.logicalSessionTimeoutMinutes, server.logicalSessionTimeoutMinutes); + } + } + } + /** + * Returns a new TopologyDescription based on the SrvPollingEvent + * @internal + */ + updateFromSrvPollingEvent(ev, srvMaxHosts = 0) { + /** The SRV addresses defines the set of addresses we should be using */ + const incomingHostnames = ev.hostnames(); + const currentHostnames = new Set(this.servers.keys()); + const hostnamesToAdd = new Set(incomingHostnames); + const hostnamesToRemove = new Set(); + for (const hostname of currentHostnames) { + // filter hostnamesToAdd (made from incomingHostnames) down to what is *not* present in currentHostnames + hostnamesToAdd.delete(hostname); + if (!incomingHostnames.has(hostname)) { + // If the SRV Records no longer include this hostname + // we have to stop using it + hostnamesToRemove.add(hostname); + } + } + if (hostnamesToAdd.size === 0 && hostnamesToRemove.size === 0) { + // No new hosts to add and none to remove + return this; + } + const serverDescriptions = new Map(this.servers); + for (const removedHost of hostnamesToRemove) { + serverDescriptions.delete(removedHost); + } + if (hostnamesToAdd.size > 0) { + if (srvMaxHosts === 0) { + // Add all! + for (const hostToAdd of hostnamesToAdd) { + serverDescriptions.set(hostToAdd, new server_description_1.ServerDescription(hostToAdd)); + } + } + else if (serverDescriptions.size < srvMaxHosts) { + // Add only the amount needed to get us back to srvMaxHosts + const selectedHosts = (0, utils_1.shuffle)(hostnamesToAdd, srvMaxHosts - serverDescriptions.size); + for (const selectedHostToAdd of selectedHosts) { + serverDescriptions.set(selectedHostToAdd, new server_description_1.ServerDescription(selectedHostToAdd)); + } + } + } + return new TopologyDescription(this.type, serverDescriptions, this.setName, this.maxSetVersion, this.maxElectionId, this.commonWireVersion, { heartbeatFrequencyMS: this.heartbeatFrequencyMS, localThresholdMS: this.localThresholdMS }); + } + /** + * Returns a copy of this description updated with a given ServerDescription + * @internal + */ + update(serverDescription) { + const address = serverDescription.address; + // potentially mutated values + let { type: topologyType, setName, maxSetVersion, maxElectionId, commonWireVersion } = this; + if (serverDescription.setName && setName && serverDescription.setName !== setName) { + // TODO(NODE-4159): servers with an incorrect setName should be removed not marked Unknown + serverDescription = new server_description_1.ServerDescription(address, undefined); + } + const serverType = serverDescription.type; + const serverDescriptions = new Map(this.servers); + // update common wire version + if (serverDescription.maxWireVersion !== 0) { + if (commonWireVersion == null) { + commonWireVersion = serverDescription.maxWireVersion; + } + else { + commonWireVersion = Math.min(commonWireVersion, serverDescription.maxWireVersion); + } + } + // update the actual server description + serverDescriptions.set(address, serverDescription); + if (topologyType === common_1.TopologyType.Single) { + // once we are defined as single, that never changes + return new TopologyDescription(common_1.TopologyType.Single, serverDescriptions, setName, maxSetVersion, maxElectionId, commonWireVersion, { heartbeatFrequencyMS: this.heartbeatFrequencyMS, localThresholdMS: this.localThresholdMS }); + } + if (topologyType === common_1.TopologyType.Unknown) { + if (serverType === common_1.ServerType.Standalone && this.servers.size !== 1) { + serverDescriptions.delete(address); + } + else { + topologyType = topologyTypeForServerType(serverType); + } + } + if (topologyType === common_1.TopologyType.Sharded) { + if (!MONGOS_OR_UNKNOWN.has(serverType)) { + serverDescriptions.delete(address); + } + } + if (topologyType === common_1.TopologyType.ReplicaSetNoPrimary) { + if (MONGOS_OR_STANDALONE.has(serverType)) { + serverDescriptions.delete(address); + } + if (serverType === common_1.ServerType.RSPrimary) { + const result = updateRsFromPrimary(serverDescriptions, serverDescription, setName, maxSetVersion, maxElectionId); + topologyType = result[0]; + setName = result[1]; + maxSetVersion = result[2]; + maxElectionId = result[3]; + } + else if (NON_PRIMARY_RS_MEMBERS.has(serverType)) { + const result = updateRsNoPrimaryFromMember(serverDescriptions, serverDescription, setName); + topologyType = result[0]; + setName = result[1]; + } + } + if (topologyType === common_1.TopologyType.ReplicaSetWithPrimary) { + if (MONGOS_OR_STANDALONE.has(serverType)) { + serverDescriptions.delete(address); + topologyType = checkHasPrimary(serverDescriptions); + } + else if (serverType === common_1.ServerType.RSPrimary) { + const result = updateRsFromPrimary(serverDescriptions, serverDescription, setName, maxSetVersion, maxElectionId); + topologyType = result[0]; + setName = result[1]; + maxSetVersion = result[2]; + maxElectionId = result[3]; + } + else if (NON_PRIMARY_RS_MEMBERS.has(serverType)) { + topologyType = updateRsWithPrimaryFromMember(serverDescriptions, serverDescription, setName); + } + else { + topologyType = checkHasPrimary(serverDescriptions); + } + } + return new TopologyDescription(topologyType, serverDescriptions, setName, maxSetVersion, maxElectionId, commonWireVersion, { heartbeatFrequencyMS: this.heartbeatFrequencyMS, localThresholdMS: this.localThresholdMS }); + } + get error() { + const descriptionsWithError = Array.from(this.servers.values()).filter((sd) => sd.error); + if (descriptionsWithError.length > 0) { + return descriptionsWithError[0].error; + } + return; + } + /** + * Determines if the topology description has any known servers + */ + get hasKnownServers() { + return Array.from(this.servers.values()).some((sd) => sd.type !== common_1.ServerType.Unknown); + } + /** + * Determines if this topology description has a data-bearing server available. + */ + get hasDataBearingServers() { + return Array.from(this.servers.values()).some((sd) => sd.isDataBearing); + } + /** + * Determines if the topology has a definition for the provided address + * @internal + */ + hasServer(address) { + return this.servers.has(address); + } +} +exports.TopologyDescription = TopologyDescription; +function topologyTypeForServerType(serverType) { + switch (serverType) { + case common_1.ServerType.Standalone: + return common_1.TopologyType.Single; + case common_1.ServerType.Mongos: + return common_1.TopologyType.Sharded; + case common_1.ServerType.RSPrimary: + return common_1.TopologyType.ReplicaSetWithPrimary; + case common_1.ServerType.RSOther: + case common_1.ServerType.RSSecondary: + return common_1.TopologyType.ReplicaSetNoPrimary; + default: + return common_1.TopologyType.Unknown; + } +} +// TODO: improve these docs when ObjectId is properly typed +function compareObjectId(oid1, oid2) { + if (oid1 == null) { + return -1; + } + if (oid2 == null) { + return 1; + } + if (oid1.id instanceof Buffer && oid2.id instanceof Buffer) { + const oid1Buffer = oid1.id; + const oid2Buffer = oid2.id; + return oid1Buffer.compare(oid2Buffer); + } + const oid1String = oid1.toString(); + const oid2String = oid2.toString(); + return oid1String.localeCompare(oid2String); +} +function updateRsFromPrimary(serverDescriptions, serverDescription, setName, maxSetVersion, maxElectionId) { + setName = setName || serverDescription.setName; + if (setName !== serverDescription.setName) { + serverDescriptions.delete(serverDescription.address); + return [checkHasPrimary(serverDescriptions), setName, maxSetVersion, maxElectionId]; + } + const electionId = serverDescription.electionId ? serverDescription.electionId : null; + if (serverDescription.setVersion && electionId) { + if (maxSetVersion && maxElectionId) { + if (maxSetVersion > serverDescription.setVersion || + compareObjectId(maxElectionId, electionId) > 0) { + // this primary is stale, we must remove it + serverDescriptions.set(serverDescription.address, new server_description_1.ServerDescription(serverDescription.address)); + return [checkHasPrimary(serverDescriptions), setName, maxSetVersion, maxElectionId]; + } + } + maxElectionId = serverDescription.electionId; + } + if (serverDescription.setVersion != null && + (maxSetVersion == null || serverDescription.setVersion > maxSetVersion)) { + maxSetVersion = serverDescription.setVersion; + } + // We've heard from the primary. Is it the same primary as before? + for (const [address, server] of serverDescriptions) { + if (server.type === common_1.ServerType.RSPrimary && server.address !== serverDescription.address) { + // Reset old primary's type to Unknown. + serverDescriptions.set(address, new server_description_1.ServerDescription(server.address)); + // There can only be one primary + break; + } + } + // Discover new hosts from this primary's response. + serverDescription.allHosts.forEach((address) => { + if (!serverDescriptions.has(address)) { + serverDescriptions.set(address, new server_description_1.ServerDescription(address)); + } + }); + // Remove hosts not in the response. + const currentAddresses = Array.from(serverDescriptions.keys()); + const responseAddresses = serverDescription.allHosts; + currentAddresses + .filter((addr) => responseAddresses.indexOf(addr) === -1) + .forEach((address) => { + serverDescriptions.delete(address); + }); + return [checkHasPrimary(serverDescriptions), setName, maxSetVersion, maxElectionId]; +} +function updateRsWithPrimaryFromMember(serverDescriptions, serverDescription, setName) { + if (setName == null) { + // TODO(NODE-3483): should be an appropriate runtime error + throw new error_1.MongoRuntimeError('Argument "setName" is required if connected to a replica set'); + } + if (setName !== serverDescription.setName || + (serverDescription.me && serverDescription.address !== serverDescription.me)) { + serverDescriptions.delete(serverDescription.address); + } + return checkHasPrimary(serverDescriptions); +} +function updateRsNoPrimaryFromMember(serverDescriptions, serverDescription, setName) { + const topologyType = common_1.TopologyType.ReplicaSetNoPrimary; + setName = setName || serverDescription.setName; + if (setName !== serverDescription.setName) { + serverDescriptions.delete(serverDescription.address); + return [topologyType, setName]; + } + serverDescription.allHosts.forEach((address) => { + if (!serverDescriptions.has(address)) { + serverDescriptions.set(address, new server_description_1.ServerDescription(address)); + } + }); + if (serverDescription.me && serverDescription.address !== serverDescription.me) { + serverDescriptions.delete(serverDescription.address); + } + return [topologyType, setName]; +} +function checkHasPrimary(serverDescriptions) { + for (const serverDescription of serverDescriptions.values()) { + if (serverDescription.type === common_1.ServerType.RSPrimary) { + return common_1.TopologyType.ReplicaSetWithPrimary; + } + } + return common_1.TopologyType.ReplicaSetNoPrimary; +} +//# sourceMappingURL=topology_description.js.map \ No newline at end of file diff --git a/node_modules/mongodb/lib/sdam/topology_description.js.map b/node_modules/mongodb/lib/sdam/topology_description.js.map new file mode 100644 index 000000000..e32dd37a2 --- /dev/null +++ b/node_modules/mongodb/lib/sdam/topology_description.js.map @@ -0,0 +1 @@ +{"version":3,"file":"topology_description.js","sourceRoot":"","sources":["../../src/sdam/topology_description.ts"],"names":[],"mappings":";;;AACA,kEAAkE;AAClE,oCAAyD;AACzD,oCAAmC;AACnC,qCAAoD;AACpD,6DAAyD;AAGzD,4CAA4C;AAC5C,MAAM,4BAA4B,GAAG,cAAc,CAAC,4BAA4B,CAAC;AACjF,MAAM,4BAA4B,GAAG,cAAc,CAAC,4BAA4B,CAAC;AACjF,MAAM,0BAA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AU,CAAC,SAAS,EAAE;YACnD,OAAO,qBAAY,CAAC,qBAAqB,CAAC;SAC3C;KACF;IAED,OAAO,qBAAY,CAAC,mBAAmB,CAAC;AAC1C,CAAC"} \ No newline at end of file diff --git a/node_modules/mongodb/lib/sessions.js b/node_modules/mongodb/lib/sessions.js new file mode 100644 index 000000000..480034871 --- /dev/null +++ b/node_modules/mongodb/lib/sessions.js @@ -0,0 +1,748 @@ +"use strict"; +var _a; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.updateSessionFromResponse = exports.applySession = exports.ServerSessionPool = exports.ServerSession = exports.maybeClearPinnedConnection = exports.ClientSession = void 0; +const bson_1 = require("./bson"); +const metrics_1 = require("./cmap/metrics"); +const shared_1 = require("./cmap/wire_protocol/shared"); +const constants_1 = require("./constants"); +const error_1 = require("./error"); +const mongo_types_1 = require("./mongo_types"); +const execute_operation_1 = require("./operations/execute_operation"); +const run_command_1 = require("./operations/run_command"); +const promise_provider_1 = require("./promise_provider"); +const read_concern_1 = require("./read_concern"); +const read_preference_1 = require("./read_preference"); +const common_1 = require("./sdam/common"); +const transactions_1 = require("./transactions"); +const utils_1 = require("./utils"); +const minWireVersionForShardedTransactions = 8; +/** @internal */ +const kServerSession = Symbol('serverSession'); +/** @internal */ +const kSnapshotTime = Symbol('snapshotTime'); +/** @internal */ +const kSnapshotEnabled = Symbol('snapshotEnabled'); +/** @internal */ +const kPinnedConnection = Symbol('pinnedConnection'); +/** @internal Accumulates total number of increments to add to txnNumber when applying session to command */ +const kTxnNumberIncrement = Symbol('txnNumberIncrement'); +/** + * A class representing a client session on the server + * + * NOTE: not meant to be instantiated directly. + * @public + */ +class ClientSession extends mongo_types_1.TypedEventEmitter { + /** + * Create a client session. + * @internal + * @param client - The current client + * @param sessionPool - The server session pool (Internal Class) + * @param options - Optional settings + * @param clientOptions - Optional settings provided when creating a MongoClient + */ + constructor(client, sessionPool, options, clientOptions) { + super(); + /** @internal */ + this[_a] = false; + if (client == null) { + // TODO(NODE-3483) + throw new error_1.MongoRuntimeError('ClientSession requires a MongoClient'); + } + if (sessionPool == null || !(sessionPool instanceof ServerSessionPool)) { + // TODO(NODE-3483) + throw new error_1.MongoRuntimeError('ClientSession requires a ServerSessionPool'); + } + options = options !== null && options !== void 0 ? options : {}; + if (options.snapshot === true) { + this[kSnapshotEnabled] = true; + if (options.causalConsistency === true) { + throw new error_1.MongoInvalidArgumentError('Properties "causalConsistency" and "snapshot" are mutually exclusive'); + } + } + this.client = client; + this.sessionPool = sessionPool; + this.hasEnded = false; + this.clientOptions = clientOptions; + this.explicit = !!options.explicit; + this[kServerSession] = this.explicit ? this.sessionPool.acquire() : null; + this[kTxnNumberIncrement] = 0; + this.supports = { + causalConsistency: options.snapshot !== true && options.causalConsistency !== false + }; + this.clusterTime = options.initialClusterTime; + this.operationTime = undefined; + this.owner = options.owner; + this.defaultTransactionOptions = Object.assign({}, options.defaultTransactionOptions); + this.transaction = new transactions_1.Transaction(); + } + /** The server id associated with this session */ + get id() { + var _b; + return (_b = this[kServerSession]) === null || _b === void 0 ? void 0 : _b.id; + } + get serverSession() { + let serverSession = this[kServerSession]; + if (serverSession == null) { + if (this.explicit) { + throw new error_1.MongoRuntimeError('Unexpected null serverSession for an explicit session'); + } + if (this.hasEnded) { + throw new error_1.MongoRuntimeError('Unexpected null serverSession for an ended implicit session'); + } + serverSession = this.sessionPool.acquire(); + this[kServerSession] = serverSession; + } + return serverSession; + } + /** Whether or not this session is configured for snapshot reads */ + get snapshotEnabled() { + return this[kSnapshotEnabled]; + } + get loadBalanced() { + var _b; + return ((_b = this.client.topology) === null || _b === void 0 ? void 0 : _b.description.type) === common_1.TopologyType.LoadBalanced; + } + /** @internal */ + get pinnedConnection() { + return this[kPinnedConnection]; + } + /** @internal */ + pin(conn) { + if (this[kPinnedConnection]) { + throw TypeError('Cannot pin multiple connections to the same session'); + } + this[kPinnedConnection] = conn; + conn.emit(constants_1.PINNED, this.inTransaction() ? metrics_1.ConnectionPoolMetrics.TXN : metrics_1.ConnectionPoolMetrics.CURSOR); + } + /** @internal */ + unpin(options) { + if (this.loadBalanced) { + return maybeClearPinnedConnection(this, options); + } + this.transaction.unpinServer(); + } + get isPinned() { + return this.loadBalanced ? !!this[kPinnedConnection] : this.transaction.isPinned; + } + endSession(options, callback) { + if (typeof options === 'function') + (callback = options), (options = {}); + const finalOptions = { force: true, ...options }; + return (0, utils_1.maybePromise)(callback, done => { + if (this.hasEnded) { + maybeClearPinnedConnection(this, finalOptions); + return done(); + } + const completeEndSession = () => { + maybeClearPinnedConnection(this, finalOptions); + const serverSession = this[kServerSession]; + if (serverSession != null) { + // release the server session back to the pool + this.sessionPool.release(serverSession); + // Make sure a new serverSession never makes it on to the ClientSession + Object.defineProperty(this, kServerSession, { + value: ServerSession.clone(serverSession) + }); + } + // mark the session as ended, and emit a signal + this.hasEnded = true; + this.emit('ended', this); + // spec indicates that we should ignore all errors for `endSessions` + done(); + }; + if (this.inTransaction()) { + // If we've reached endSession and the transaction is still active + // by default we abort it + this.abortTransaction(err => { + if (err) + return done(err); + completeEndSession(); + }); + return; + } + completeEndSession(); + }); + } + /** + * Advances the operationTime for a ClientSession. + * + * @param operationTime - the `BSON.Timestamp` of the operation type it is desired to advance to + */ + advanceOperationTime(operationTime) { + if (this.operationTime == null) { + this.operationTime = operationTime; + return; + } + if (operationTime.greaterThan(this.operationTime)) { + this.operationTime = operationTime; + } + } + /** + * Advances the clusterTime for a ClientSession to the provided clusterTime of another ClientSession + * + * @param clusterTime - the $clusterTime returned by the server from another session in the form of a document containing the `BSON.Timestamp` clusterTime and signature + */ + advanceClusterTime(clusterTime) { + var _b, _c; + if (!clusterTime || typeof clusterTime !== 'object') { + throw new error_1.MongoInvalidArgumentError('input cluster time must be an object'); + } + if (!clusterTime.clusterTime || clusterTime.clusterTime._bsontype !== 'Timestamp') { + throw new error_1.MongoInvalidArgumentError('input cluster time "clusterTime" property must be a valid BSON Timestamp'); + } + if (!clusterTime.signature || + ((_b = clusterTime.signature.hash) === null || _b === void 0 ? void 0 : _b._bsontype) !== 'Binary' || + (typeof clusterTime.signature.keyId !== 'number' && + ((_c = clusterTime.signature.keyId) === null || _c === void 0 ? void 0 : _c._bsontype) !== 'Long') // apparently we decode the key to number? + ) { + throw new error_1.MongoInvalidArgumentError('input cluster time must have a valid "signature" property with BSON Binary hash and BSON Long keyId'); + } + (0, common_1._advanceClusterTime)(this, clusterTime); + } + /** + * Used to determine if this session equals another + * + * @param session - The session to compare to + */ + equals(session) { + if (!(session instanceof ClientSession)) { + return false; + } + if (this.id == null || session.id == null) { + return false; + } + return this.id.id.buffer.equals(session.id.id.buffer); + } + /** + * Increment the transaction number on the internal ServerSession + * + * @privateRemarks + * This helper increments a value stored on the client session that will be + * added to the serverSession's txnNumber upon applying it to a command. + * This is because the serverSession is lazily acquired after a connection is obtained + */ + incrementTransactionNumber() { + this[kTxnNumberIncrement] += 1; + } + /** @returns whether this session is currently in a transaction or not */ + inTransaction() { + return this.transaction.isActive; + } + /** + * Starts a new transaction with the given options. + * + * @param options - Options for the transaction + */ + startTransaction(options) { + var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l; + if (this[kSnapshotEnabled]) { + throw new error_1.MongoCompatibilityError('Transactions are not allowed with snapshot sessions'); + } + if (this.inTransaction()) { + throw new error_1.MongoTransactionError('Transaction already in progress'); + } + if (this.isPinned && this.transaction.isCommitted) { + this.unpin(); + } + const topologyMaxWireVersion = (0, utils_1.maxWireVersion)(this.client.topology); + if ((0, shared_1.isSharded)(this.client.topology) && + topologyMaxWireVersion != null && + topologyMaxWireVersion < minWireVersionForShardedTransactions) { + throw new error_1.MongoCompatibilityError('Transactions are not supported on sharded clusters in MongoDB < 4.2.'); + } + // increment txnNumber + this.incrementTransactionNumber(); + // create transaction state + this.transaction = new transactions_1.Transaction({ + readConcern: (_c = (_b = options === null || options === void 0 ? void 0 : options.readConcern) !== null && _b !== void 0 ? _b : this.defaultTransactionOptions.readConcern) !== null && _c !== void 0 ? _c : (_d = this.clientOptions) === null || _d === void 0 ? void 0 : _d.readConcern, + writeConcern: (_f = (_e = options === null || options === void 0 ? void 0 : options.writeConcern) !== null && _e !== void 0 ? _e : this.defaultTransactionOptions.writeConcern) !== null && _f !== void 0 ? _f : (_g = this.clientOptions) === null || _g === void 0 ? void 0 : _g.writeConcern, + readPreference: (_j = (_h = options === null || options === void 0 ? void 0 : options.readPreference) !== null && _h !== void 0 ? _h : this.defaultTransactionOptions.readPreference) !== null && _j !== void 0 ? _j : (_k = this.clientOptions) === null || _k === void 0 ? void 0 : _k.readPreference, + maxCommitTimeMS: (_l = options === null || options === void 0 ? void 0 : options.maxCommitTimeMS) !== null && _l !== void 0 ? _l : this.defaultTransactionOptions.maxCommitTimeMS + }); + this.transaction.transition(transactions_1.TxnState.STARTING_TRANSACTION); + } + commitTransaction(callback) { + return (0, utils_1.maybePromise)(callback, cb => endTransaction(this, 'commitTransaction', cb)); + } + abortTransaction(callback) { + return (0, utils_1.maybePromise)(callback, cb => endTransaction(this, 'abortTransaction', cb)); + } + /** + * This is here to ensure that ClientSession is never serialized to BSON. + */ + toBSON() { + throw new error_1.MongoRuntimeError('ClientSession cannot be serialized to BSON.'); + } + /** + * Runs a provided callback within a transaction, retrying either the commitTransaction operation + * or entire transaction as needed (and when the error permits) to better ensure that + * the transaction can complete successfully. + * + * **IMPORTANT:** This method requires the user to return a Promise, and `await` all operations. + * Any callbacks that do not return a Promise will result in undefined behavior. + * + * @remarks + * This function: + * - Will return the command response from the final commitTransaction if every operation is successful (can be used as a truthy object) + * - Will return `undefined` if the transaction is explicitly aborted with `await session.abortTransaction()` + * - Will throw if one of the operations throws or `throw` statement is used inside the `withTransaction` callback + * + * Checkout a descriptive example here: + * @see https://www.mongodb.com/developer/quickstart/node-transactions/ + * + * @param fn - callback to run within a transaction + * @param options - optional settings for the transaction + * @returns A raw command response or undefined + */ + withTransaction(fn, options) { + const startTime = (0, utils_1.now)(); + return attemptTransaction(this, startTime, fn, options); + } +} +exports.ClientSession = ClientSession; +_a = kSnapshotEnabled; +const MAX_WITH_TRANSACTION_TIMEOUT = 120000; +const NON_DETERMINISTIC_WRITE_CONCERN_ERRORS = new Set([ + 'CannotSatisfyWriteConcern', + 'UnknownReplWriteConcern', + 'UnsatisfiableWriteConcern' +]); +function hasNotTimedOut(startTime, max) { + return (0, utils_1.calculateDurationInMs)(startTime) < max; +} +function isUnknownTransactionCommitResult(err) { + const isNonDeterministicWriteConcernError = err instanceof error_1.MongoServerError && + err.codeName && + NON_DETERMINISTIC_WRITE_CONCERN_ERRORS.has(err.codeName); + return (isMaxTimeMSExpiredError(err) || + (!isNonDeterministicWriteConcernError && + err.code !== error_1.MONGODB_ERROR_CODES.UnsatisfiableWriteConcern && + err.code !== error_1.MONGODB_ERROR_CODES.UnknownReplWriteConcern)); +} +function maybeClearPinnedConnection(session, options) { + // unpin a connection if it has been pinned + const conn = session[kPinnedConnection]; + const error = options === null || options === void 0 ? void 0 : options.error; + if (session.inTransaction() && + error && + error instanceof error_1.MongoError && + error.hasErrorLabel(error_1.MongoErrorLabel.TransientTransactionError)) { + return; + } + const topology = session.client.topology; + // NOTE: the spec talks about what to do on a network error only, but the tests seem to + // to validate that we don't unpin on _all_ errors? + if (conn && topology != null) { + const servers = Array.from(topology.s.servers.values()); + const loadBalancer = servers[0]; + if ((options === null || options === void 0 ? void 0 : options.error) == null || (options === null || options === void 0 ? void 0 : options.force)) { + loadBalancer.s.pool.checkIn(conn); + conn.emit(constants_1.UNPINNED, session.transaction.state !== transactions_1.TxnState.NO_TRANSACTION + ? metrics_1.ConnectionPoolMetrics.TXN + : metrics_1.ConnectionPoolMetrics.CURSOR); + if (options === null || options === void 0 ? void 0 : options.forceClear) { + loadBalancer.s.pool.clear(conn.serviceId); + } + } + session[kPinnedConnection] = undefined; + } +} +exports.maybeClearPinnedConnection = maybeClearPinnedConnection; +function isMaxTimeMSExpiredError(err) { + if (err == null || !(err instanceof error_1.MongoServerError)) { + return false; + } + return (err.code === error_1.MONGODB_ERROR_CODES.MaxTimeMSExpired || + (err.writeConcernError && err.writeConcernError.code === error_1.MONGODB_ERROR_CODES.MaxTimeMSExpired)); +} +function attemptTransactionCommit(session, startTime, fn, options) { + return session.commitTransaction().catch((err) => { + if (err instanceof error_1.MongoError && + hasNotTimedOut(startTime, MAX_WITH_TRANSACTION_TIMEOUT) && + !isMaxTimeMSExpiredError(err)) { + if (err.hasErrorLabel(error_1.MongoErrorLabel.UnknownTransactionCommitResult)) { + return attemptTransactionCommit(session, startTime, fn, options); + } + if (err.hasErrorLabel(error_1.MongoErrorLabel.TransientTransactionError)) { + return attemptTransaction(session, startTime, fn, options); + } + } + throw err; + }); +} +const USER_EXPLICIT_TXN_END_STATES = new Set([ + transactions_1.TxnState.NO_TRANSACTION, + transactions_1.TxnState.TRANSACTION_COMMITTED, + transactions_1.TxnState.TRANSACTION_ABORTED +]); +function userExplicitlyEndedTransaction(session) { + return USER_EXPLICIT_TXN_END_STATES.has(session.transaction.state); +} +function attemptTransaction(session, startTime, fn, options) { + const Promise = promise_provider_1.PromiseProvider.get(); + session.startTransaction(options); + let promise; + try { + promise = fn(session); + } + catch (err) { + promise = Promise.reject(err); + } + if (!(0, utils_1.isPromiseLike)(promise)) { + session.abortTransaction(); + throw new error_1.MongoInvalidArgumentError('Function provided to `withTransaction` must return a Promise'); + } + return promise.then(() => { + if (userExplicitlyEndedTransaction(session)) { + return; + } + return attemptTransactionCommit(session, startTime, fn, options); + }, err => { + function maybeRetryOrThrow(err) { + if (err instanceof error_1.MongoError && + err.hasErrorLabel(error_1.MongoErrorLabel.TransientTransactionError) && + hasNotTimedOut(startTime, MAX_WITH_TRANSACTION_TIMEOUT)) { + return attemptTransaction(session, startTime, fn, options); + } + if (isMaxTimeMSExpiredError(err)) { + err.addErrorLabel(error_1.MongoErrorLabel.UnknownTransactionCommitResult); + } + throw err; + } + if (session.inTransaction()) { + return session.abortTransaction().then(() => maybeRetryOrThrow(err)); + } + return maybeRetryOrThrow(err); + }); +} +function endTransaction(session, commandName, callback) { + // handle any initial problematic cases + const txnState = session.transaction.state; + if (txnState === transactions_1.TxnState.NO_TRANSACTION) { + callback(new error_1.MongoTransactionError('No transaction started')); + return; + } + if (commandName === 'commitTransaction') { + if (txnState === transactions_1.TxnState.STARTING_TRANSACTION || + txnState === transactions_1.TxnState.TRANSACTION_COMMITTED_EMPTY) { + // the transaction was never started, we can safely exit here + session.transaction.transition(transactions_1.TxnState.TRANSACTION_COMMITTED_EMPTY); + callback(); + return; + } + if (txnState === transactions_1.TxnState.TRANSACTION_ABORTED) { + callback(new error_1.MongoTransactionError('Cannot call commitTransaction after calling abortTransaction')); + return; + } + } + else { + if (txnState === transactions_1.TxnState.STARTING_TRANSACTION) { + // the transaction was never started, we can safely exit here + session.transaction.transition(transactions_1.TxnState.TRANSACTION_ABORTED); + callback(); + return; + } + if (txnState === transactions_1.TxnState.TRANSACTION_ABORTED) { + callback(new error_1.MongoTransactionError('Cannot call abortTransaction twice')); + return; + } + if (txnState === transactions_1.TxnState.TRANSACTION_COMMITTED || + txnState === transactions_1.TxnState.TRANSACTION_COMMITTED_EMPTY) { + callback(new error_1.MongoTransactionError('Cannot call abortTransaction after calling commitTransaction')); + return; + } + } + // construct and send the command + const command = { [commandName]: 1 }; + // apply a writeConcern if specified + let writeConcern; + if (session.transaction.options.writeConcern) { + writeConcern = Object.assign({}, session.transaction.options.writeConcern); + } + else if (session.clientOptions && session.clientOptions.writeConcern) { + writeConcern = { w: session.clientOptions.writeConcern.w }; + } + if (txnState === transactions_1.TxnState.TRANSACTION_COMMITTED) { + writeConcern = Object.assign({ wtimeout: 10000 }, writeConcern, { w: 'majority' }); + } + if (writeConcern) { + Object.assign(command, { writeConcern }); + } + if (commandName === 'commitTransaction' && session.transaction.options.maxTimeMS) { + Object.assign(command, { maxTimeMS: session.transaction.options.maxTimeMS }); + } + function commandHandler(error, result) { + if (commandName !== 'commitTransaction') { + session.transaction.transition(transactions_1.TxnState.TRANSACTION_ABORTED); + if (session.loadBalanced) { + maybeClearPinnedConnection(session, { force: false }); + } + // The spec indicates that we should ignore all errors on `abortTransaction` + return callback(); + } + session.transaction.transition(transactions_1.TxnState.TRANSACTION_COMMITTED); + if (error instanceof error_1.MongoError) { + if (error.hasErrorLabel(error_1.MongoErrorLabel.RetryableWriteError) || + error instanceof error_1.MongoWriteConcernError || + isMaxTimeMSExpiredError(error)) { + if (isUnknownTransactionCommitResult(error)) { + error.addErrorLabel(error_1.MongoErrorLabel.UnknownTransactionCommitResult); + // per txns spec, must unpin session in this case + session.unpin({ error }); + } + } + else if (error.hasErrorLabel(error_1.MongoErrorLabel.TransientTransactionError)) { + session.unpin({ error }); + } + } + callback(error, result); + } + if (session.transaction.recoveryToken) { + command.recoveryToken = session.transaction.recoveryToken; + } + // send the command + (0, execute_operation_1.executeOperation)(session.client, new run_command_1.RunAdminCommandOperation(undefined, command, { + session, + readPreference: read_preference_1.ReadPreference.primary, + bypassPinningCheck: true + }), (error, result) => { + if (command.abortTransaction) { + // always unpin on abort regardless of command outcome + session.unpin(); + } + if (error instanceof error_1.MongoError && error.hasErrorLabel(error_1.MongoErrorLabel.RetryableWriteError)) { + // SPEC-1185: apply majority write concern when retrying commitTransaction + if (command.commitTransaction) { + // per txns spec, must unpin session in this case + session.unpin({ force: true }); + command.writeConcern = Object.assign({ wtimeout: 10000 }, command.writeConcern, { + w: 'majority' + }); + } + return (0, execute_operation_1.executeOperation)(session.client, new run_command_1.RunAdminCommandOperation(undefined, command, { + session, + readPreference: read_preference_1.ReadPreference.primary, + bypassPinningCheck: true + }), commandHandler); + } + commandHandler(error, result); + }); +} +/** + * Reflects the existence of a session on the server. Can be reused by the session pool. + * WARNING: not meant to be instantiated directly. For internal use only. + * @public + */ +class ServerSession { + /** @internal */ + constructor() { + this.id = { id: new bson_1.Binary((0, utils_1.uuidV4)(), bson_1.Binary.SUBTYPE_UUID) }; + this.lastUse = (0, utils_1.now)(); + this.txnNumber = 0; + this.isDirty = false; + } + /** + * Determines if the server session has timed out. + * + * @param sessionTimeoutMinutes - The server's "logicalSessionTimeoutMinutes" + */ + hasTimedOut(sessionTimeoutMinutes) { + // Take the difference of the lastUse timestamp and now, which will result in a value in + // milliseconds, and then convert milliseconds to minutes to compare to `sessionTimeoutMinutes` + const idleTimeMinutes = Math.round((((0, utils_1.calculateDurationInMs)(this.lastUse) % 86400000) % 3600000) / 60000); + return idleTimeMinutes > sessionTimeoutMinutes - 1; + } + /** + * @internal + * Cloning meant to keep a readable reference to the server session data + * after ClientSession has ended + */ + static clone(serverSession) { + const arrayBuffer = new ArrayBuffer(16); + const idBytes = Buffer.from(arrayBuffer); + idBytes.set(serverSession.id.id.buffer); + const id = new bson_1.Binary(idBytes, serverSession.id.id.sub_type); + // Manual prototype construction to avoid modifying the constructor of this class + return Object.setPrototypeOf({ + id: { id }, + lastUse: serverSession.lastUse, + txnNumber: serverSession.txnNumber, + isDirty: serverSession.isDirty + }, ServerSession.prototype); + } +} +exports.ServerSession = ServerSession; +/** + * Maintains a pool of Server Sessions. + * For internal use only + * @internal + */ +class ServerSessionPool { + constructor(topology) { + if (topology == null) { + throw new error_1.MongoRuntimeError('ServerSessionPool requires a topology'); + } + this.topology = topology; + this.sessions = []; + } + /** Ends all sessions in the session pool */ + endAllPooledSessions(callback) { + if (this.sessions.length) { + this.topology.endSessions(this.sessions.map((session) => session.id), () => { + this.sessions = []; + if (typeof callback === 'function') { + callback(); + } + }); + return; + } + if (typeof callback === 'function') { + callback(); + } + } + /** + * Acquire a Server Session from the pool. + * Iterates through each session in the pool, removing any stale sessions + * along the way. The first non-stale session found is removed from the + * pool and returned. If no non-stale session is found, a new ServerSession is created. + */ + acquire() { + const sessionTimeoutMinutes = this.topology.logicalSessionTimeoutMinutes || 10; + while (this.sessions.length) { + const session = this.sessions.shift(); + if (session && (this.topology.loadBalanced || !session.hasTimedOut(sessionTimeoutMinutes))) { + return session; + } + } + return new ServerSession(); + } + /** + * Release a session to the session pool + * Adds the session back to the session pool if the session has not timed out yet. + * This method also removes any stale sessions from the pool. + * + * @param session - The session to release to the pool + */ + release(session) { + const sessionTimeoutMinutes = this.topology.logicalSessionTimeoutMinutes; + if (this.topology.loadBalanced && !sessionTimeoutMinutes) { + this.sessions.unshift(session); + } + if (!sessionTimeoutMinutes) { + return; + } + while (this.sessions.length) { + const pooledSession = this.sessions[this.sessions.length - 1]; + if (pooledSession.hasTimedOut(sessionTimeoutMinutes)) { + this.sessions.pop(); + } + else { + break; + } + } + if (!session.hasTimedOut(sessionTimeoutMinutes)) { + if (session.isDirty) { + return; + } + // otherwise, readd this session to the session pool + this.sessions.unshift(session); + } + } +} +exports.ServerSessionPool = ServerSessionPool; +/** + * Optionally decorate a command with sessions specific keys + * + * @param session - the session tracking transaction state + * @param command - the command to decorate + * @param options - Optional settings passed to calling operation + * + * @internal + */ +function applySession(session, command, options) { + var _b, _c; + if (session.hasEnded) { + return new error_1.MongoExpiredSessionError(); + } + // May acquire serverSession here + const serverSession = session.serverSession; + if (serverSession == null) { + return new error_1.MongoRuntimeError('Unable to acquire server session'); + } + if (((_b = options.writeConcern) === null || _b === void 0 ? void 0 : _b.w) === 0) { + if (session && session.explicit) { + // Error if user provided an explicit session to an unacknowledged write (SPEC-1019) + return new error_1.MongoAPIError('Cannot have explicit session with unacknowledged writes'); + } + return; + } + // mark the last use of this session, and apply the `lsid` + serverSession.lastUse = (0, utils_1.now)(); + command.lsid = serverSession.id; + const inTxnOrTxnCommand = session.inTransaction() || (0, transactions_1.isTransactionCommand)(command); + const isRetryableWrite = !!options.willRetryWrite; + if (isRetryableWrite || inTxnOrTxnCommand) { + serverSession.txnNumber += session[kTxnNumberIncrement]; + session[kTxnNumberIncrement] = 0; + command.txnNumber = bson_1.Long.fromNumber(serverSession.txnNumber); + } + if (!inTxnOrTxnCommand) { + if (session.transaction.state !== transactions_1.TxnState.NO_TRANSACTION) { + session.transaction.transition(transactions_1.TxnState.NO_TRANSACTION); + } + if (session.supports.causalConsistency && + session.operationTime && + (0, utils_1.commandSupportsReadConcern)(command, options)) { + command.readConcern = command.readConcern || {}; + Object.assign(command.readConcern, { afterClusterTime: session.operationTime }); + } + else if (session[kSnapshotEnabled]) { + command.readConcern = command.readConcern || { level: read_concern_1.ReadConcernLevel.snapshot }; + if (session[kSnapshotTime] != null) { + Object.assign(command.readConcern, { atClusterTime: session[kSnapshotTime] }); + } + } + return; + } + // now attempt to apply transaction-specific sessions data + // `autocommit` must always be false to differentiate from retryable writes + command.autocommit = false; + if (session.transaction.state === transactions_1.TxnState.STARTING_TRANSACTION) { + session.transaction.transition(transactions_1.TxnState.TRANSACTION_IN_PROGRESS); + command.startTransaction = true; + const readConcern = session.transaction.options.readConcern || ((_c = session === null || session === void 0 ? void 0 : session.clientOptions) === null || _c === void 0 ? void 0 : _c.readConcern); + if (readConcern) { + command.readConcern = readConcern; + } + if (session.supports.causalConsistency && session.operationTime) { + command.readConcern = command.readConcern || {}; + Object.assign(command.readConcern, { afterClusterTime: session.operationTime }); + } + } + return; +} +exports.applySession = applySession; +function updateSessionFromResponse(session, document) { + var _b; + if (document.$clusterTime) { + (0, common_1._advanceClusterTime)(session, document.$clusterTime); + } + if (document.operationTime && session && session.supports.causalConsistency) { + session.advanceOperationTime(document.operationTime); + } + if (document.recoveryToken && session && session.inTransaction()) { + session.transaction._recoveryToken = document.recoveryToken; + } + if ((session === null || session === void 0 ? void 0 : session[kSnapshotEnabled]) && session[kSnapshotTime] == null) { + // find and aggregate commands return atClusterTime on the cursor + // distinct includes it in the response body + const atClusterTime = ((_b = document.cursor) === null || _b === void 0 ? void 0 : _b.atClusterTime) || document.atClusterTime; + if (atClusterTime) { + session[kSnapshotTime] = atClusterTime; + } + } +} +exports.updateSessionFromResponse = updateSessionFromResponse; +//# sourceMappingURL=sessions.js.map \ No newline at end of file diff --git a/node_modules/mongodb/lib/sessions.js.map b/node_modules/mongodb/lib/sessions.js.map new file mode 100644 index 000000000..46068711a --- /dev/null +++ b/node_modules/mongodb/lib/sessions.js.map @@ -0,0 +1 @@ +{"version":3,"file":"sessions.js","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.js new file mode 100644 index 000000000..c04b6b54c --- /dev/null +++ b/node_modules/mongodb/lib/sort.js @@ -0,0 +1,97 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.formatSort = void 0; +const error_1 = require("./error"); +/** @internal */ +function prepareDirection(direction = 1) { + const value = `${direction}`.toLowerCase(); + if (isMeta(direction)) + return direction; + switch (value) { + case 'ascending': + case 'asc': + case '1': + return 1; + case 'descending': + case 'desc': + case '-1': + return -1; + default: + throw new error_1.MongoInvalidArgumentError(`Invalid sort direction: ${JSON.stringify(direction)}`); + } +} +/** @internal */ +function isMeta(t) { + return typeof t === 'object' && t != null && '$meta' in t && typeof t.$meta === 'string'; +} +/** @internal */ +function isPair(t) { + if (Array.isArray(t) && t.length === 2) { + try { + prepareDirection(t[1]); + return true; + } + catch (e) { + return false; + } + } + return false; +} +function isDeep(t) { + return Array.isArray(t) && Array.isArray(t[0]); +} +function isMap(t) { + return t instanceof Map && t.size > 0; +} +/** @internal */ +function pairToMap(v) { + return new Map([[`${v[0]}`, prepareDirection([v[1]])]]); +} +/** @internal */ +function deepToMap(t) { + const sortEntries = t.map(([k, v]) => [`${k}`, prepareDirection(v)]); + return new Map(sortEntries); +} +/** @internal */ +function stringsToMap(t) { + const sortEntries = t.map(key => [`${key}`, 1]); + return new Map(sortEntries); +} +/** @internal */ +function objectToMap(t) { + const sortEntries = Object.entries(t).map(([k, v]) => [ + `${k}`, + prepareDirection(v) + ]); + return new Map(sortEntries); +} +/** @internal */ +function mapToMap(t) { + const sortEntries = Array.from(t).map(([k, v]) => [ + `${k}`, + prepareDirection(v) + ]); + return new Map(sortEntries); +} +/** converts a Sort type into a type that is valid for the server (SortForCmd) */ +function formatSort(sort, direction) { + if (sort == null) + return undefined; + if (typeof sort === 'string') + return new Map([[sort, prepareDirection(direction)]]); + if (typeof sort !== 'object') { + throw new error_1.MongoInvalidArgumentError(`Invalid sort format: ${JSON.stringify(sort)} Sort must be a valid object`); + } + if (!Array.isArray(sort)) { + return isMap(sort) ? mapToMap(sort) : Object.keys(sort).length ? objectToMap(sort) : undefined; + } + if (!sort.length) + return undefined; + if (isDeep(sort)) + return deepToMap(sort); + if (isPair(sort)) + return pairToMap(sort); + return stringsToMap(sort); +} +exports.formatSort = formatSort; +//# sourceMappingURL=sort.js.map \ No newline at end of file diff --git a/node_modules/mongodb/lib/sort.js.map b/node_modules/mongodb/lib/sort.js.map new file mode 100644 index 000000000..4072af4c8 --- /dev/null +++ b/node_modules/mongodb/lib/sort.js.map @@ -0,0 +1 @@ +{"version":3,"file":"sort.js","sourceRoot":"","sources":["../src/sort.ts"],"names":[],"mappings":";;;AAAA,mCAAoD;AAiCpD,gBAAgB;AAChB,SAAS,gBAAgB,CAAC,YAAiB,CAAC;IAC1C,MAAM,KAAK,GAAG,GAAG,SAAS,EAAE,CAAC,WAAW,EAAE,CAAC;IAC3C,IAAI,MAAM,CAAC,SAAS,CAAC;QAAE,OAAO,SAAS,CAAC;IACxC,QAAQ,KAAK,EAAE;QACb,KAAK,WAAW,CAAC;QACjB,KAAK,KAAK,CAAC;QACX,KAAK,GAAG;YACN,OAAO,CAAC,CAAC;QACX,KAAK,YAAY,CAAC;QAClB,KAAK,MAAM,CAAC;QACZ,KAAK,IAAI;YACP,OAAO,CAAC,CAAC,CAAC;QACZ;YACE,MAAM,IAAI,iCAAyB,CAAC,2BAA2B,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC;KAC/F;AACH,CAAC;AAED,gBAAgB;AAChB,SAAS,MAAM,CAAC,CAAgB;IAC9B,OAAO,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,IAAI,IAAI,IAAI,OAAO,IAAI,CAAC,IAAI,OAAO,CAAC,CAAC,KAAK,KAAK,QAAQ,CAAC;AAC3F,CAAC;AAED,gBAAgB;AAChB,SAAS,MAAM,CAAC,CAAO;IACrB,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,KAAK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AAW,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;KAChG;IACD,IAAI,CAAC,IAAI,CAAC,MAAM;QAAE,OAAO,SAAS,CAAC;IACnC,IAAI,MAAM,CAAC,IAAI,CAAC;QAAE,OAAO,SAAS,CAAC,IAAI,CAAC,CAAC;IACzC,IAAI,MAAM,CAAC,IAAI,CAAC;QAAE,OAAO,SAAS,CAAC,IAAI,CAAC,CAAC;IACzC,OAAO,YAAY,CAAC,IAAI,CAAC,CAAC;AAC5B,CAAC;AAlBD,gCAkBC"} \ No newline at end of file diff --git a/node_modules/mongodb/lib/transactions.js b/node_modules/mongodb/lib/transactions.js new file mode 100644 index 000000000..4982eb449 --- /dev/null +++ b/node_modules/mongodb/lib/transactions.js @@ -0,0 +1,138 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.isTransactionCommand = exports.Transaction = exports.TxnState = void 0; +const error_1 = require("./error"); +const read_concern_1 = require("./read_concern"); +const read_preference_1 = require("./read_preference"); +const write_concern_1 = require("./write_concern"); +/** @internal */ +exports.TxnState = Object.freeze({ + NO_TRANSACTION: 'NO_TRANSACTION', + STARTING_TRANSACTION: 'STARTING_TRANSACTION', + TRANSACTION_IN_PROGRESS: 'TRANSACTION_IN_PROGRESS', + TRANSACTION_COMMITTED: 'TRANSACTION_COMMITTED', + TRANSACTION_COMMITTED_EMPTY: 'TRANSACTION_COMMITTED_EMPTY', + TRANSACTION_ABORTED: 'TRANSACTION_ABORTED' +}); +const stateMachine = { + [exports.TxnState.NO_TRANSACTION]: [exports.TxnState.NO_TRANSACTION, exports.TxnState.STARTING_TRANSACTION], + [exports.TxnState.STARTING_TRANSACTION]: [ + exports.TxnState.TRANSACTION_IN_PROGRESS, + exports.TxnState.TRANSACTION_COMMITTED, + exports.TxnState.TRANSACTION_COMMITTED_EMPTY, + exports.TxnState.TRANSACTION_ABORTED + ], + [exports.TxnState.TRANSACTION_IN_PROGRESS]: [ + exports.TxnState.TRANSACTION_IN_PROGRESS, + exports.TxnState.TRANSACTION_COMMITTED, + exports.TxnState.TRANSACTION_ABORTED + ], + [exports.TxnState.TRANSACTION_COMMITTED]: [ + exports.TxnState.TRANSACTION_COMMITTED, + exports.TxnState.TRANSACTION_COMMITTED_EMPTY, + exports.TxnState.STARTING_TRANSACTION, + exports.TxnState.NO_TRANSACTION + ], + [exports.TxnState.TRANSACTION_ABORTED]: [exports.TxnState.STARTING_TRANSACTION, exports.TxnState.NO_TRANSACTION], + [exports.TxnState.TRANSACTION_COMMITTED_EMPTY]: [ + exports.TxnState.TRANSACTION_COMMITTED_EMPTY, + exports.TxnState.NO_TRANSACTION + ] +}; +const ACTIVE_STATES = new Set([ + exports.TxnState.STARTING_TRANSACTION, + exports.TxnState.TRANSACTION_IN_PROGRESS +]); +const COMMITTED_STATES = new Set([ + exports.TxnState.TRANSACTION_COMMITTED, + exports.TxnState.TRANSACTION_COMMITTED_EMPTY, + exports.TxnState.TRANSACTION_ABORTED +]); +/** + * @public + * A class maintaining state related to a server transaction. Internal Only + */ +class Transaction { + /** Create a transaction @internal */ + constructor(options) { + options = options !== null && options !== void 0 ? options : {}; + this.state = exports.TxnState.NO_TRANSACTION; + this.options = {}; + const writeConcern = write_concern_1.WriteConcern.fromOptions(options); + if (writeConcern) { + if (writeConcern.w === 0) { + throw new error_1.MongoTransactionError('Transactions do not support unacknowledged write concern'); + } + this.options.writeConcern = writeConcern; + } + if (options.readConcern) { + this.options.readConcern = read_concern_1.ReadConcern.fromOptions(options); + } + if (options.readPreference) { + this.options.readPreference = read_preference_1.ReadPreference.fromOptions(options); + } + if (options.maxCommitTimeMS) { + this.options.maxTimeMS = options.maxCommitTimeMS; + } + // TODO: This isn't technically necessary + this._pinnedServer = undefined; + this._recoveryToken = undefined; + } + /** @internal */ + get server() { + return this._pinnedServer; + } + get recoveryToken() { + return this._recoveryToken; + } + get isPinned() { + return !!this.server; + } + /** @returns Whether the transaction has started */ + get isStarting() { + return this.state === exports.TxnState.STARTING_TRANSACTION; + } + /** + * @returns Whether this session is presently in a transaction + */ + get isActive() { + return ACTIVE_STATES.has(this.state); + } + get isCommitted() { + return COMMITTED_STATES.has(this.state); + } + /** + * Transition the transaction in the state machine + * @internal + * @param nextState - The new state to transition to + */ + transition(nextState) { + const nextStates = stateMachine[this.state]; + if (nextStates && nextStates.includes(nextState)) { + this.state = nextState; + if (this.state === exports.TxnState.NO_TRANSACTION || + this.state === exports.TxnState.STARTING_TRANSACTION || + this.state === exports.TxnState.TRANSACTION_ABORTED) { + this.unpinServer(); + } + return; + } + throw new error_1.MongoRuntimeError(`Attempted illegal state transition from [${this.state}] to [${nextState}]`); + } + /** @internal */ + pinServer(server) { + if (this.isActive) { + this._pinnedServer = server; + } + } + /** @internal */ + unpinServer() { + this._pinnedServer = undefined; + } +} +exports.Transaction = Transaction; +function isTransactionCommand(command) { + return !!(command.commitTransaction || command.abortTransaction); +} +exports.isTransactionCommand = isTransactionCommand; +//# sourceMappingURL=transactions.js.map \ No newline at end of file diff --git a/node_modules/mongodb/lib/transactions.js.map b/node_modules/mongodb/lib/transactions.js.map new file mode 100644 index 000000000..5e261e908 --- /dev/null +++ b/node_modules/mongodb/lib/transactions.js.map @@ -0,0 +1 @@ +{"version":3,"file":"transactions.js","sourceRoot":"","sources":["../src/transactions.ts"],"names":[],"mappings":";;;AACA,mCAAmE;AAEnE,iDAA8D;AAC9D,uDAAmD;AAEnD,mDAA+C;AAE/C,gBAAgB;AACH,QAAA,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC;IACpC,cAAc,EAAE,gBAAgB;IAChC,oBAAoB,EAAE,sBAAsB;IAC5C,uBAAuB,EAAE,yBAAyB;IAClD,qBAAqB,EAAE,uBAAuB;IAC9C,2BAA2B,EAAE,6BAA6B;IAC1D,mBAAmB,EAAE,qBAAqB;CAClC,CAAC,CAAC;AAKZ,MAAM,YAAY,GAAwC;IACxD,CAAC,gBAAQ,CAAC,cAAc,CAAC,EAAE,CAAC,gBAAQ,CAAC,cA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,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC1C,CAAC;IACD;;;;OAIG;IACH,UAAU,CAAC,SAAmB;QAC5B,MAAM,UAAU,GAAG,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAC5C,IAAI,UAAU,IAAI,UAAU,CAAC,QAAQ,CAAC,SAAS,CAAC,EAAE;YAChD,IAAI,CAAC,KAAK,GAAG,SAAS,CAAC;YACvB,IACE,IAAI,CAAC,KAAK,KAAK,gBAAQ,CAAC,cAAc;gBACtC,IAAI,CAAC,KAAK,KAAK,gBAAQ,CAAC,oBAAoB;gBAC5C,IAAI,CAAC,KAAK,KAAK,gBAAQ,CAAC,mBAAmB,EAC3C;gBACA,IAAI,CAAC,WAAW,EAAE,CAAC;aACpB;YACD,OAAO;SACR;QAED,MAAM,IAAI,yBAAiB,CACzB,4CAA4C,IAAI,CAAC,KAAK,SAAS,SAAS,GAAG,CAC5E,CAAC;IACJ,CAAC;IAED,gBAAgB;IAChB,SAAS,CAAC,MAAc;QACtB,IAAI,IAAI,CAAC,QAAQ,EAAE;YACjB,IAAI,CAAC,aAAa,GAAG,MAAM,CAAC;SAC7B;IACH,CAAC;IAED,gBAAgB;IAChB,WAAW;QACT,IAAI,CAAC,aAAa,GAAG,SAAS,CAAC;IACjC,CAAC;CACF;AAxGD,kCAwGC;AAED,SAAgB,oBAAoB,CAAC,OAAiB;IACpD,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,iBAAiB,IAAI,OAAO,CAAC,gBAAgB,CAAC,CAAC;AACnE,CAAC;AAFD,oDAEC"} \ No newline at end of file diff --git a/node_modules/mongodb/lib/utils.js b/node_modules/mongodb/lib/utils.js new file mode 100644 index 000000000..be36600fc --- /dev/null +++ b/node_modules/mongodb/lib/utils.js @@ -0,0 +1,1113 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.shuffle = exports.parsePackageVersion = exports.supportsRetryableWrites = exports.enumToString = exports.emitWarningOnce = exports.emitWarning = exports.MONGODB_WARNING_CODE = exports.DEFAULT_PK_FACTORY = exports.HostAddress = exports.BufferPool = exports.deepCopy = exports.isRecord = exports.setDifference = exports.isHello = exports.isSuperset = exports.resolveOptions = exports.hasAtomicOperators = exports.makeInterruptibleAsyncInterval = exports.calculateDurationInMs = exports.now = exports.makeClientMetadata = exports.makeStateMachine = exports.errorStrictEqual = exports.arrayStrictEqual = exports.eachAsyncSeries = exports.eachAsync = exports.collationNotSupported = exports.maxWireVersion = exports.uuidV4 = exports.databaseNamespace = exports.maybePromise = exports.makeCounter = exports.MongoDBNamespace = exports.ns = exports.deprecateOptions = exports.defaultMsgHandler = exports.getTopology = exports.decorateWithExplain = exports.decorateWithReadConcern = exports.decorateWithCollation = exports.isPromiseLike = exports.applyWriteConcern = exports.applyRetryableWrites = exports.filterOptions = exports.mergeOptions = exports.isObject = exports.parseIndexOptions = exports.normalizeHintField = exports.checkCollectionName = exports.MAX_JS_INT = void 0; +exports.commandSupportsReadConcern = void 0; +const crypto = require("crypto"); +const os = require("os"); +const timers_1 = require("timers"); +const url_1 = require("url"); +const bson_1 = require("./bson"); +const constants_1 = require("./cmap/wire_protocol/constants"); +const constants_2 = require("./constants"); +const error_1 = require("./error"); +const promise_provider_1 = require("./promise_provider"); +const read_concern_1 = require("./read_concern"); +const read_preference_1 = require("./read_preference"); +const common_1 = require("./sdam/common"); +const write_concern_1 = require("./write_concern"); +exports.MAX_JS_INT = Number.MAX_SAFE_INTEGER + 1; +/** + * Throws if collectionName is not a valid mongodb collection namespace. + * @internal + */ +function checkCollectionName(collectionName) { + if ('string' !== typeof collectionName) { + throw new error_1.MongoInvalidArgumentError('Collection name must be a String'); + } + if (!collectionName || collectionName.indexOf('..') !== -1) { + throw new error_1.MongoInvalidArgumentError('Collection names cannot be empty'); + } + if (collectionName.indexOf('$') !== -1 && + collectionName.match(/((^\$cmd)|(oplog\.\$main))/) == null) { + // TODO(NODE-3483): Use MongoNamespace static method + throw new error_1.MongoInvalidArgumentError("Collection names must not contain '$'"); + } + if (collectionName.match(/^\.|\.$/) != null) { + // TODO(NODE-3483): Use MongoNamespace static method + throw new error_1.MongoInvalidArgumentError("Collection names must not start or end with '.'"); + } + // Validate that we are not passing 0x00 in the collection name + if (collectionName.indexOf('\x00') !== -1) { + // TODO(NODE-3483): Use MongoNamespace static method + throw new error_1.MongoInvalidArgumentError('Collection names cannot contain a null character'); + } +} +exports.checkCollectionName = checkCollectionName; +/** + * Ensure Hint field is in a shape we expect: + * - object of index names mapping to 1 or -1 + * - just an index name + * @internal + */ +function normalizeHintField(hint) { + let finalHint = undefined; + if (typeof hint === 'string') { + finalHint = hint; + } + else if (Array.isArray(hint)) { + finalHint = {}; + hint.forEach(param => { + finalHint[param] = 1; + }); + } + else if (hint != null && typeof hint === 'object') { + finalHint = {}; + for (const name in hint) { + finalHint[name] = hint[name]; + } + } + return finalHint; +} +exports.normalizeHintField = normalizeHintField; +/** + * Create an index specifier based on + * @internal + */ +function parseIndexOptions(indexSpec) { + const fieldHash = {}; + const indexes = []; + let keys; + // Get all the fields accordingly + if ('string' === typeof indexSpec) { + // 'type' + indexes.push(indexSpec + '_' + 1); + fieldHash[indexSpec] = 1; + } + else if (Array.isArray(indexSpec)) { + indexSpec.forEach((f) => { + if ('string' === typeof f) { + // [{location:'2d'}, 'type'] + indexes.push(f + '_' + 1); + fieldHash[f] = 1; + } + else if (Array.isArray(f)) { + // [['location', '2d'],['type', 1]] + indexes.push(f[0] + '_' + (f[1] || 1)); + fieldHash[f[0]] = f[1] || 1; + } + else if (isObject(f)) { + // [{location:'2d'}, {type:1}] + keys = Object.keys(f); + keys.forEach(k => { + indexes.push(k + '_' + f[k]); + fieldHash[k] = f[k]; + }); + } + else { + // undefined (ignore) + } + }); + } + else if (isObject(indexSpec)) { + // {location:'2d', type:1} + keys = Object.keys(indexSpec); + Object.entries(indexSpec).forEach(([key, value]) => { + indexes.push(key + '_' + value); + fieldHash[key] = value; + }); + } + return { + name: indexes.join('_'), + keys: keys, + fieldHash: fieldHash + }; +} +exports.parseIndexOptions = parseIndexOptions; +/** + * Checks if arg is an Object: + * - **NOTE**: the check is based on the `[Symbol.toStringTag]() === 'Object'` + * @internal + */ +// eslint-disable-next-line @typescript-eslint/ban-types +function isObject(arg) { + return '[object Object]' === Object.prototype.toString.call(arg); +} +exports.isObject = isObject; +/** @internal */ +function mergeOptions(target, source) { + return { ...target, ...source }; +} +exports.mergeOptions = mergeOptions; +/** @internal */ +function filterOptions(options, names) { + const filterOptions = {}; + for (const name in options) { + if (names.includes(name)) { + filterOptions[name] = options[name]; + } + } + // Filtered options + return filterOptions; +} +exports.filterOptions = filterOptions; +/** + * Applies retryWrites: true to a command if retryWrites is set on the command's database. + * @internal + * + * @param target - The target command to which we will apply retryWrites. + * @param db - The database from which we can inherit a retryWrites value. + */ +function applyRetryableWrites(target, db) { + var _a; + if (db && ((_a = db.s.options) === null || _a === void 0 ? void 0 : _a.retryWrites)) { + target.retryWrites = true; + } + return target; +} +exports.applyRetryableWrites = applyRetryableWrites; +/** + * Applies a write concern to a command based on well defined inheritance rules, optionally + * detecting support for the write concern in the first place. + * @internal + * + * @param target - the target command we will be applying the write concern to + * @param sources - sources where we can inherit default write concerns from + * @param options - optional settings passed into a command for write concern overrides + */ +function applyWriteConcern(target, sources, options) { + options = options !== null && options !== void 0 ? options : {}; + const db = sources.db; + const coll = sources.collection; + if (options.session && options.session.inTransaction()) { + // writeConcern is not allowed within a multi-statement transaction + if (target.writeConcern) { + delete target.writeConcern; + } + return target; + } + const writeConcern = write_concern_1.WriteConcern.fromOptions(options); + if (writeConcern) { + return Object.assign(target, { writeConcern }); + } + if (coll && coll.writeConcern) { + return Object.assign(target, { writeConcern: Object.assign({}, coll.writeConcern) }); + } + if (db && db.writeConcern) { + return Object.assign(target, { writeConcern: Object.assign({}, db.writeConcern) }); + } + return target; +} +exports.applyWriteConcern = applyWriteConcern; +/** + * Checks if a given value is a Promise + * + * @typeParam T - The result type of maybePromise + * @param maybePromise - An object that could be a promise + * @returns true if the provided value is a Promise + */ +function isPromiseLike(maybePromise) { + return !!maybePromise && typeof maybePromise.then === 'function'; +} +exports.isPromiseLike = isPromiseLike; +/** + * Applies collation to a given command. + * @internal + * + * @param command - the command on which to apply collation + * @param target - target of command + * @param options - options containing collation settings + */ +function decorateWithCollation(command, target, options) { + const capabilities = getTopology(target).capabilities; + if (options.collation && typeof options.collation === 'object') { + if (capabilities && capabilities.commandsTakeCollation) { + command.collation = options.collation; + } + else { + throw new error_1.MongoCompatibilityError(`Current topology does not support collation`); + } + } +} +exports.decorateWithCollation = decorateWithCollation; +/** + * Applies a read concern to a given command. + * @internal + * + * @param command - the command on which to apply the read concern + * @param coll - the parent collection of the operation calling this method + */ +function decorateWithReadConcern(command, coll, options) { + if (options && options.session && options.session.inTransaction()) { + return; + } + const readConcern = Object.assign({}, command.readConcern || {}); + if (coll.s.readConcern) { + Object.assign(readConcern, coll.s.readConcern); + } + if (Object.keys(readConcern).length > 0) { + Object.assign(command, { readConcern: readConcern }); + } +} +exports.decorateWithReadConcern = decorateWithReadConcern; +/** + * Applies an explain to a given command. + * @internal + * + * @param command - the command on which to apply the explain + * @param options - the options containing the explain verbosity + */ +function decorateWithExplain(command, explain) { + if (command.explain) { + return command; + } + return { explain: command, verbosity: explain.verbosity }; +} +exports.decorateWithExplain = decorateWithExplain; +/** + * A helper function to get the topology from a given provider. Throws + * if the topology cannot be found. + * @throws MongoNotConnectedError + * @internal + */ +function getTopology(provider) { + // MongoClient or ClientSession or AbstractCursor + if ('topology' in provider && provider.topology) { + return provider.topology; + } + else if ('s' in provider && 'client' in provider.s && provider.s.client.topology) { + return provider.s.client.topology; + } + else if ('s' in provider && 'db' in provider.s && provider.s.db.s.client.topology) { + return provider.s.db.s.client.topology; + } + throw new error_1.MongoNotConnectedError('MongoClient must be connected to perform this operation'); +} +exports.getTopology = getTopology; +/** + * Default message handler for generating deprecation warnings. + * @internal + * + * @param name - function name + * @param option - option name + * @returns warning message + */ +function defaultMsgHandler(name, option) { + return `${name} option [${option}] is deprecated and will be removed in a later version.`; +} +exports.defaultMsgHandler = defaultMsgHandler; +/** + * Deprecates a given function's options. + * @internal + * + * @param this - the bound class if this is a method + * @param config - configuration for deprecation + * @param fn - the target function of deprecation + * @returns modified function that warns once per deprecated option, and executes original function + */ +function deprecateOptions(config, fn) { + if (process.noDeprecation === true) { + return fn; + } + const msgHandler = config.msgHandler ? config.msgHandler : defaultMsgHandler; + const optionsWarned = new Set(); + function deprecated(...args) { + const options = args[config.optionsIndex]; + // ensure options is a valid, non-empty object, otherwise short-circuit + if (!isObject(options) || Object.keys(options).length === 0) { + return fn.bind(this)(...args); // call the function, no change + } + // interrupt the function call with a warning + for (const deprecatedOption of config.deprecatedOptions) { + if (deprecatedOption in options && !optionsWarned.has(deprecatedOption)) { + optionsWarned.add(deprecatedOption); + const msg = msgHandler(config.name, deprecatedOption); + emitWarning(msg); + if (this && 'getLogger' in this) { + const logger = this.getLogger(); + if (logger) { + logger.warn(msg); + } + } + } + } + return fn.bind(this)(...args); + } + // These lines copied from https://github.com/nodejs/node/blob/25e5ae41688676a5fd29b2e2e7602168eee4ceb5/lib/internal/util.js#L73-L80 + // The wrapper will keep the same prototype as fn to maintain prototype chain + Object.setPrototypeOf(deprecated, fn); + if (fn.prototype) { + // Setting this (rather than using Object.setPrototype, as above) ensures + // that calling the unwrapped constructor gives an instanceof the wrapped + // constructor. + deprecated.prototype = fn.prototype; + } + return deprecated; +} +exports.deprecateOptions = deprecateOptions; +/** @internal */ +function ns(ns) { + return MongoDBNamespace.fromString(ns); +} +exports.ns = ns; +/** @public */ +class MongoDBNamespace { + /** + * Create a namespace object + * + * @param db - database name + * @param collection - collection name + */ + constructor(db, collection) { + this.db = db; + this.collection = collection; + } + toString() { + return this.collection ? `${this.db}.${this.collection}` : this.db; + } + withCollection(collection) { + return new MongoDBNamespace(this.db, collection); + } + static fromString(namespace) { + if (!namespace) { + // TODO(NODE-3483): Replace with MongoNamespaceError + throw new error_1.MongoRuntimeError(`Cannot parse namespace from "${namespace}"`); + } + const [db, ...collection] = namespace.split('.'); + return new MongoDBNamespace(db, collection.join('.')); + } +} +exports.MongoDBNamespace = MongoDBNamespace; +/** @internal */ +function* makeCounter(seed = 0) { + let count = seed; + while (true) { + const newCount = count; + count += 1; + yield newCount; + } +} +exports.makeCounter = makeCounter; +/** + * Helper function for either accepting a callback, or returning a promise + * @internal + * + * @param callback - The last function argument in exposed method, controls if a Promise is returned + * @param wrapper - A function that wraps the callback + * @returns Returns void if a callback is supplied, else returns a Promise. + */ +function maybePromise(callback, wrapper) { + const Promise = promise_provider_1.PromiseProvider.get(); + let result; + if (typeof callback !== 'function') { + result = new Promise((resolve, reject) => { + callback = (err, res) => { + if (err) + return reject(err); + resolve(res); + }; + }); + } + wrapper((err, res) => { + if (err != null) { + try { + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + callback(err); + } + catch (error) { + process.nextTick(() => { + throw error; + }); + } + return; + } + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + callback(err, res); + }); + return result; +} +exports.maybePromise = maybePromise; +/** @internal */ +function databaseNamespace(ns) { + return ns.split('.')[0]; +} +exports.databaseNamespace = databaseNamespace; +/** + * Synchronously Generate a UUIDv4 + * @internal + */ +function uuidV4() { + const result = crypto.randomBytes(16); + result[6] = (result[6] & 0x0f) | 0x40; + result[8] = (result[8] & 0x3f) | 0x80; + return result; +} +exports.uuidV4 = uuidV4; +/** + * A helper function for determining `maxWireVersion` between legacy and new topology instances + * @internal + */ +function maxWireVersion(topologyOrServer) { + if (topologyOrServer) { + if (topologyOrServer.loadBalanced) { + // Since we do not have a monitor, we assume the load balanced server is always + // pointed at the latest mongodb version. There is a risk that for on-prem + // deployments that don't upgrade immediately that this could alert to the + // application that a feature is avaiable that is actually not. + return constants_1.MAX_SUPPORTED_WIRE_VERSION; + } + if (topologyOrServer.hello) { + return topologyOrServer.hello.maxWireVersion; + } + if ('lastHello' in topologyOrServer && typeof topologyOrServer.lastHello === 'function') { + const lastHello = topologyOrServer.lastHello(); + if (lastHello) { + return lastHello.maxWireVersion; + } + } + if (topologyOrServer.description && + 'maxWireVersion' in topologyOrServer.description && + topologyOrServer.description.maxWireVersion != null) { + return topologyOrServer.description.maxWireVersion; + } + } + return 0; +} +exports.maxWireVersion = maxWireVersion; +/** + * Checks that collation is supported by server. + * @internal + * + * @param server - to check against + * @param cmd - object where collation may be specified + */ +function collationNotSupported(server, cmd) { + return cmd && cmd.collation && maxWireVersion(server) < 5; +} +exports.collationNotSupported = collationNotSupported; +/** + * Applies the function `eachFn` to each item in `arr`, in parallel. + * @internal + * + * @param arr - An array of items to asynchronously iterate over + * @param eachFn - A function to call on each item of the array. The callback signature is `(item, callback)`, where the callback indicates iteration is complete. + * @param callback - The callback called after every item has been iterated + */ +function eachAsync(arr, eachFn, callback) { + arr = arr || []; + let idx = 0; + let awaiting = 0; + for (idx = 0; idx < arr.length; ++idx) { + awaiting++; + eachFn(arr[idx], eachCallback); + } + if (awaiting === 0) { + callback(); + return; + } + function eachCallback(err) { + awaiting--; + if (err) { + callback(err); + return; + } + if (idx === arr.length && awaiting <= 0) { + callback(); + } + } +} +exports.eachAsync = eachAsync; +/** @internal */ +function eachAsyncSeries(arr, eachFn, callback) { + arr = arr || []; + let idx = 0; + let awaiting = arr.length; + if (awaiting === 0) { + callback(); + return; + } + function eachCallback(err) { + idx++; + awaiting--; + if (err) { + callback(err); + return; + } + if (idx === arr.length && awaiting <= 0) { + callback(); + return; + } + eachFn(arr[idx], eachCallback); + } + eachFn(arr[idx], eachCallback); +} +exports.eachAsyncSeries = eachAsyncSeries; +/** @internal */ +function arrayStrictEqual(arr, arr2) { + if (!Array.isArray(arr) || !Array.isArray(arr2)) { + return false; + } + return arr.length === arr2.length && arr.every((elt, idx) => elt === arr2[idx]); +} +exports.arrayStrictEqual = arrayStrictEqual; +/** @internal */ +function errorStrictEqual(lhs, rhs) { + if (lhs === rhs) { + return true; + } + if (!lhs || !rhs) { + return lhs === rhs; + } + if ((lhs == null && rhs != null) || (lhs != null && rhs == null)) { + return false; + } + if (lhs.constructor.name !== rhs.constructor.name) { + return false; + } + if (lhs.message !== rhs.message) { + return false; + } + return true; +} +exports.errorStrictEqual = errorStrictEqual; +/** @internal */ +function makeStateMachine(stateTable) { + return function stateTransition(target, newState) { + const legalStates = stateTable[target.s.state]; + if (legalStates && legalStates.indexOf(newState) < 0) { + throw new error_1.MongoRuntimeError(`illegal state transition from [${target.s.state}] => [${newState}], allowed: [${legalStates}]`); + } + target.emit('stateChanged', target.s.state, newState); + target.s.state = newState; + }; +} +exports.makeStateMachine = makeStateMachine; +// eslint-disable-next-line @typescript-eslint/no-var-requires +const NODE_DRIVER_VERSION = require('../package.json').version; +function makeClientMetadata(options) { + options = options !== null && options !== void 0 ? options : {}; + const metadata = { + driver: { + name: 'nodejs', + version: NODE_DRIVER_VERSION + }, + os: { + type: os.type(), + name: process.platform, + architecture: process.arch, + version: os.release() + }, + platform: `Node.js ${process.version}, ${os.endianness()} (unified)` + }; + // support optionally provided wrapping driver info + if (options.driverInfo) { + if (options.driverInfo.name) { + metadata.driver.name = `${metadata.driver.name}|${options.driverInfo.name}`; + } + if (options.driverInfo.version) { + metadata.version = `${metadata.driver.version}|${options.driverInfo.version}`; + } + if (options.driverInfo.platform) { + metadata.platform = `${metadata.platform}|${options.driverInfo.platform}`; + } + } + if (options.appName) { + // MongoDB requires the appName not exceed a byte length of 128 + const buffer = Buffer.from(options.appName); + metadata.application = { + name: buffer.byteLength > 128 ? buffer.slice(0, 128).toString('utf8') : options.appName + }; + } + return metadata; +} +exports.makeClientMetadata = makeClientMetadata; +/** @internal */ +function now() { + const hrtime = process.hrtime(); + return Math.floor(hrtime[0] * 1000 + hrtime[1] / 1000000); +} +exports.now = now; +/** @internal */ +function calculateDurationInMs(started) { + if (typeof started !== 'number') { + throw new error_1.MongoInvalidArgumentError('Numeric value required to calculate duration'); + } + const elapsed = now() - started; + return elapsed < 0 ? 0 : elapsed; +} +exports.calculateDurationInMs = calculateDurationInMs; +/** + * Creates an interval timer which is able to be woken up sooner than + * the interval. The timer will also debounce multiple calls to wake + * ensuring that the function is only ever called once within a minimum + * interval window. + * @internal + * + * @param fn - An async function to run on an interval, must accept a `callback` as its only parameter + */ +function makeInterruptibleAsyncInterval(fn, options) { + let timerId; + let lastCallTime; + let cannotBeExpedited = false; + let stopped = false; + options = options !== null && options !== void 0 ? options : {}; + const interval = options.interval || 1000; + const minInterval = options.minInterval || 500; + const immediate = typeof options.immediate === 'boolean' ? options.immediate : false; + const clock = typeof options.clock === 'function' ? options.clock : now; + function wake() { + const currentTime = clock(); + const nextScheduledCallTime = lastCallTime + interval; + const timeUntilNextCall = nextScheduledCallTime - currentTime; + // For the streaming protocol: there is nothing obviously stopping this + // interval from being woken up again while we are waiting "infinitely" + // for `fn` to be called again`. Since the function effectively + // never completes, the `timeUntilNextCall` will continue to grow + // negatively unbounded, so it will never trigger a reschedule here. + // This is possible in virtualized environments like AWS Lambda where our + // clock is unreliable. In these cases the timer is "running" but never + // actually completes, so we want to execute immediately and then attempt + // to reschedule. + if (timeUntilNextCall < 0) { + executeAndReschedule(); + return; + } + // debounce multiple calls to wake within the `minInterval` + if (cannotBeExpedited) { + return; + } + // reschedule a call as soon as possible, ensuring the call never happens + // faster than the `minInterval` + if (timeUntilNextCall > minInterval) { + reschedule(minInterval); + cannotBeExpedited = true; + } + } + function stop() { + stopped = true; + if (timerId) { + clearTimeout(timerId); + timerId = undefined; + } + lastCallTime = 0; + cannotBeExpedited = false; + } + function reschedule(ms) { + if (stopped) + return; + if (timerId) { + clearTimeout(timerId); + } + timerId = (0, timers_1.setTimeout)(executeAndReschedule, ms || interval); + } + function executeAndReschedule() { + cannotBeExpedited = false; + lastCallTime = clock(); + fn(err => { + if (err) + throw err; + reschedule(interval); + }); + } + if (immediate) { + executeAndReschedule(); + } + else { + lastCallTime = clock(); + reschedule(undefined); + } + return { wake, stop }; +} +exports.makeInterruptibleAsyncInterval = makeInterruptibleAsyncInterval; +/** @internal */ +function hasAtomicOperators(doc) { + if (Array.isArray(doc)) { + for (const document of doc) { + if (hasAtomicOperators(document)) { + return true; + } + } + return false; + } + const keys = Object.keys(doc); + return keys.length > 0 && keys[0][0] === '$'; +} +exports.hasAtomicOperators = hasAtomicOperators; +/** + * Merge inherited properties from parent into options, prioritizing values from options, + * then values from parent. + * @internal + */ +function resolveOptions(parent, options) { + var _a, _b, _c; + const result = Object.assign({}, options, (0, bson_1.resolveBSONOptions)(options, parent)); + // Users cannot pass a readConcern/writeConcern to operations in a transaction + const session = options === null || options === void 0 ? void 0 : options.session; + if (!(session === null || session === void 0 ? void 0 : session.inTransaction())) { + const readConcern = (_a = read_concern_1.ReadConcern.fromOptions(options)) !== null && _a !== void 0 ? _a : parent === null || parent === void 0 ? void 0 : parent.readConcern; + if (readConcern) { + result.readConcern = readConcern; + } + const writeConcern = (_b = write_concern_1.WriteConcern.fromOptions(options)) !== null && _b !== void 0 ? _b : parent === null || parent === void 0 ? void 0 : parent.writeConcern; + if (writeConcern) { + result.writeConcern = writeConcern; + } + } + const readPreference = (_c = read_preference_1.ReadPreference.fromOptions(options)) !== null && _c !== void 0 ? _c : parent === null || parent === void 0 ? void 0 : parent.readPreference; + if (readPreference) { + result.readPreference = readPreference; + } + return result; +} +exports.resolveOptions = resolveOptions; +function isSuperset(set, subset) { + set = Array.isArray(set) ? new Set(set) : set; + subset = Array.isArray(subset) ? new Set(subset) : subset; + for (const elem of subset) { + if (!set.has(elem)) { + return false; + } + } + return true; +} +exports.isSuperset = isSuperset; +/** + * Checks if the document is a Hello request + * @internal + */ +function isHello(doc) { + return doc[constants_2.LEGACY_HELLO_COMMAND] || doc.hello ? true : false; +} +exports.isHello = isHello; +/** Returns the items that are uniquely in setA */ +function setDifference(setA, setB) { + const difference = new Set(setA); + for (const elem of setB) { + difference.delete(elem); + } + return difference; +} +exports.setDifference = setDifference; +function isRecord(value, requiredKeys = undefined) { + const toString = Object.prototype.toString; + const hasOwnProperty = Object.prototype.hasOwnProperty; + const isObject = (v) => toString.call(v) === '[object Object]'; + if (!isObject(value)) { + return false; + } + const ctor = value.constructor; + if (ctor && ctor.prototype) { + if (!isObject(ctor.prototype)) { + return false; + } + // Check to see if some method exists from the Object exists + if (!hasOwnProperty.call(ctor.prototype, 'isPrototypeOf')) { + return false; + } + } + if (requiredKeys) { + const keys = Object.keys(value); + return isSuperset(keys, requiredKeys); + } + return true; +} +exports.isRecord = isRecord; +/** + * Make a deep copy of an object + * + * NOTE: This is not meant to be the perfect implementation of a deep copy, + * but instead something that is good enough for the purposes of + * command monitoring. + */ +function deepCopy(value) { + if (value == null) { + return value; + } + else if (Array.isArray(value)) { + return value.map(item => deepCopy(item)); + } + else if (isRecord(value)) { + const res = {}; + for (const key in value) { + res[key] = deepCopy(value[key]); + } + return res; + } + const ctor = value.constructor; + if (ctor) { + switch (ctor.name.toLowerCase()) { + case 'date': + return new ctor(Number(value)); + case 'map': + return new Map(value); + case 'set': + return new Set(value); + case 'buffer': + return Buffer.from(value); + } + } + return value; +} +exports.deepCopy = deepCopy; +/** @internal */ +const kBuffers = Symbol('buffers'); +/** @internal */ +const kLength = Symbol('length'); +/** + * A pool of Buffers which allow you to read them as if they were one + * @internal + */ +class BufferPool { + constructor() { + this[kBuffers] = []; + this[kLength] = 0; + } + get length() { + return this[kLength]; + } + /** Adds a buffer to the internal buffer pool list */ + append(buffer) { + this[kBuffers].push(buffer); + this[kLength] += buffer.length; + } + /** Returns the requested number of bytes without consuming them */ + peek(size) { + return this.read(size, false); + } + /** Reads the requested number of bytes, optionally consuming them */ + read(size, consume = true) { + if (typeof size !== 'number' || size < 0) { + throw new error_1.MongoInvalidArgumentError('Argument "size" must be a non-negative number'); + } + if (size > this[kLength]) { + return Buffer.alloc(0); + } + let result; + // read the whole buffer + if (size === this.length) { + result = Buffer.concat(this[kBuffers]); + if (consume) { + this[kBuffers] = []; + this[kLength] = 0; + } + } + // size is within first buffer, no need to concat + else if (size <= this[kBuffers][0].length) { + result = this[kBuffers][0].slice(0, size); + if (consume) { + this[kBuffers][0] = this[kBuffers][0].slice(size); + this[kLength] -= size; + } + } + // size is beyond first buffer, need to track and copy + else { + result = Buffer.allocUnsafe(size); + let idx; + let offset = 0; + let bytesToCopy = size; + for (idx = 0; idx < this[kBuffers].length; ++idx) { + let bytesCopied; + if (bytesToCopy > this[kBuffers][idx].length) { + bytesCopied = this[kBuffers][idx].copy(result, offset, 0); + offset += bytesCopied; + } + else { + bytesCopied = this[kBuffers][idx].copy(result, offset, 0, bytesToCopy); + if (consume) { + this[kBuffers][idx] = this[kBuffers][idx].slice(bytesCopied); + } + offset += bytesCopied; + break; + } + bytesToCopy -= bytesCopied; + } + // compact the internal buffer array + if (consume) { + this[kBuffers] = this[kBuffers].slice(idx); + this[kLength] -= size; + } + } + return result; + } +} +exports.BufferPool = BufferPool; +/** @public */ +class HostAddress { + constructor(hostString) { + const escapedHost = hostString.split(' ').join('%20'); // escape spaces, for socket path hosts + const { hostname, port } = new url_1.URL(`mongodb://${escapedHost}`); + if (hostname.endsWith('.sock')) { + // heuristically determine if we're working with a domain socket + this.socketPath = decodeURIComponent(hostname); + } + else if (typeof hostname === 'string') { + this.isIPv6 = false; + let normalized = decodeURIComponent(hostname).toLowerCase(); + if (normalized.startsWith('[') && normalized.endsWith(']')) { + this.isIPv6 = true; + normalized = normalized.substring(1, hostname.length - 1); + } + this.host = normalized.toLowerCase(); + if (typeof port === 'number') { + this.port = port; + } + else if (typeof port === 'string' && port !== '') { + this.port = Number.parseInt(port, 10); + } + else { + this.port = 27017; + } + if (this.port === 0) { + throw new error_1.MongoParseError('Invalid port (zero) with hostname'); + } + } + else { + throw new error_1.MongoInvalidArgumentError('Either socketPath or host must be defined.'); + } + Object.freeze(this); + } + [Symbol.for('nodejs.util.inspect.custom')]() { + return this.inspect(); + } + inspect() { + return `new HostAddress('${this.toString(true)}')`; + } + /** + * @param ipv6Brackets - optionally request ipv6 bracket notation required for connection strings + */ + toString(ipv6Brackets = false) { + if (typeof this.host === 'string') { + if (this.isIPv6 && ipv6Brackets) { + return `[${this.host}]:${this.port}`; + } + return `${this.host}:${this.port}`; + } + return `${this.socketPath}`; + } + static fromString(s) { + return new HostAddress(s); + } + static fromHostPort(host, port) { + if (host.includes(':')) { + host = `[${host}]`; // IPv6 address + } + return HostAddress.fromString(`${host}:${port}`); + } + static fromSrvRecord({ name, port }) { + return HostAddress.fromHostPort(name, port); + } +} +exports.HostAddress = HostAddress; +exports.DEFAULT_PK_FACTORY = { + // We prefer not to rely on ObjectId having a createPk method + createPk() { + return new bson_1.ObjectId(); + } +}; +/** + * When the driver used emitWarning the code will be equal to this. + * @public + * + * @example + * ```js + * process.on('warning', (warning) => { + * if (warning.code === MONGODB_WARNING_CODE) console.error('Ah an important warning! :)') + * }) + * ``` + */ +exports.MONGODB_WARNING_CODE = 'MONGODB DRIVER'; +/** @internal */ +function emitWarning(message) { + return process.emitWarning(message, { code: exports.MONGODB_WARNING_CODE }); +} +exports.emitWarning = emitWarning; +const emittedWarnings = new Set(); +/** + * Will emit a warning once for the duration of the application. + * Uses the message to identify if it has already been emitted + * so using string interpolation can cause multiple emits + * @internal + */ +function emitWarningOnce(message) { + if (!emittedWarnings.has(message)) { + emittedWarnings.add(message); + return emitWarning(message); + } +} +exports.emitWarningOnce = emitWarningOnce; +/** + * Takes a JS object and joins the values into a string separated by ', ' + */ +function enumToString(en) { + return Object.values(en).join(', '); +} +exports.enumToString = enumToString; +/** + * Determine if a server supports retryable writes. + * + * @internal + */ +function supportsRetryableWrites(server) { + if (!server) { + return false; + } + if (server.loadBalanced) { + // Loadbalanced topologies will always support retry writes + return true; + } + if (server.description.logicalSessionTimeoutMinutes != null) { + // that supports sessions + if (server.description.type !== common_1.ServerType.Standalone) { + // and that is not a standalone + return true; + } + } + return false; +} +exports.supportsRetryableWrites = supportsRetryableWrites; +function parsePackageVersion({ version }) { + const [major, minor, patch] = version.split('.').map((n) => Number.parseInt(n, 10)); + return { major, minor, patch }; +} +exports.parsePackageVersion = parsePackageVersion; +/** + * Fisher–Yates Shuffle + * + * Reference: https://bost.ocks.org/mike/shuffle/ + * @param sequence - items to be shuffled + * @param limit - Defaults to `0`. If nonzero shuffle will slice the randomized array e.g, `.slice(0, limit)` otherwise will return the entire randomized array. + */ +function shuffle(sequence, limit = 0) { + const items = Array.from(sequence); // shallow copy in order to never shuffle the input + if (limit > items.length) { + throw new error_1.MongoRuntimeError('Limit must be less than the number of items'); + } + let remainingItemsToShuffle = items.length; + const lowerBound = limit % items.length === 0 ? 1 : items.length - limit; + while (remainingItemsToShuffle > lowerBound) { + // Pick a remaining element + const randomIndex = Math.floor(Math.random() * remainingItemsToShuffle); + remainingItemsToShuffle -= 1; + // And swap it with the current element + const swapHold = items[remainingItemsToShuffle]; + items[remainingItemsToShuffle] = items[randomIndex]; + items[randomIndex] = swapHold; + } + return limit % items.length === 0 ? items : items.slice(lowerBound); +} +exports.shuffle = shuffle; +// TODO: this should be codified in command construction +// @see https://github.com/mongodb/specifications/blob/master/source/read-write-concern/read-write-concern.rst#read-concern +function commandSupportsReadConcern(command, options) { + if (command.aggregate || command.count || command.distinct || command.find || command.geoNear) { + return true; + } + if (command.mapReduce && + options && + options.out && + (options.out.inline === 1 || options.out === 'inline')) { + return true; + } + return false; +} +exports.commandSupportsReadConcern = commandSupportsReadConcern; +//# sourceMappingURL=utils.js.map \ No newline at end of file diff --git a/node_modules/mongodb/lib/utils.js.map b/node_modules/mongodb/lib/utils.js.map new file mode 100644 index 000000000..9fc6fae83 --- /dev/null +++ b/node_modules/mongodb/lib/utils.js.map @@ -0,0 +1 @@ +{"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":";;;;AAAA,iCAAiC;AAEjC,yBAAyB;AACzB,mCAAoC;AACpC,6BAA0B;AAE1B,iCAAgE;AAEhE,8DAA4E;AAE5E,2CAAmD;AAInD,mCAOiB;AAMjB,yDAAqD;AACrD,iDAA6C;AAC7C,uDAAmD;AACnD,0CAA2C;AA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AC;QACpD,KAAK,CAAC,WAAW,CAAC,GAAG,QAAQ,CAAC;KAC/B;IAED,OAAO,KAAK,GAAG,KAAK,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;AACtE,CAAC;AArBD,0BAqBC;AAED,wDAAwD;AACxD,2HAA2H;AAC3H,SAAgB,0BAA0B,CAAC,OAAiB,EAAE,OAAkB;IAC9E,IAAI,OAAO,CAAC,SAAS,IAAI,OAAO,CAAC,KAAK,IAAI,OAAO,CAAC,QAAQ,IAAI,OAAO,CAAC,IAAI,IAAI,OAAO,CAAC,OAAO,EAAE;QAC7F,OAAO,IAAI,CAAC;KACb;IAED,IACE,OAAO,CAAC,SAAS;QACjB,OAAO;QACP,OAAO,CAAC,GAAG;QACX,CAAC,OAAO,CAAC,GAAG,CAAC,MAAM,KAAK,CAAC,IAAI,OAAO,CAAC,GAAG,KAAK,QAAQ,CAAC,EACtD;QACA,OAAO,IAAI,CAAC;KACb;IAED,OAAO,KAAK,CAAC;AACf,CAAC;AAfD,gEAeC"} \ No newline at end of file diff --git a/node_modules/mongodb/lib/write_concern.js b/node_modules/mongodb/lib/write_concern.js new file mode 100644 index 000000000..4816b00eb --- /dev/null +++ b/node_modules/mongodb/lib/write_concern.js @@ -0,0 +1,71 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.WriteConcern = exports.WRITE_CONCERN_KEYS = void 0; +exports.WRITE_CONCERN_KEYS = ['w', 'wtimeout', 'j', 'journal', 'fsync']; +/** + * A MongoDB WriteConcern, which describes the level of acknowledgement + * requested from MongoDB for write operations. + * @public + * + * @see https://docs.mongodb.com/manual/reference/write-concern/ + */ +class WriteConcern { + /** + * Constructs a WriteConcern from the write concern properties. + * @param w - request acknowledgment that the write operation has propagated to a specified number of mongod instances or to mongod instances with specified tags. + * @param wtimeout - specify a time limit to prevent write operations from blocking indefinitely + * @param j - request acknowledgment that the write operation has been written to the on-disk journal + * @param fsync - equivalent to the j option + */ + constructor(w, wtimeout, j, fsync) { + if (w != null) { + if (!Number.isNaN(Number(w))) { + this.w = Number(w); + } + else { + this.w = w; + } + } + if (wtimeout != null) { + this.wtimeout = wtimeout; + } + if (j != null) { + this.j = j; + } + if (fsync != null) { + this.fsync = fsync; + } + } + /** Construct a WriteConcern given an options object. */ + static fromOptions(options, inherit) { + if (options == null) + return undefined; + inherit = inherit !== null && inherit !== void 0 ? inherit : {}; + let opts; + if (typeof options === 'string' || typeof options === 'number') { + opts = { w: options }; + } + else if (options instanceof WriteConcern) { + opts = options; + } + else { + opts = options.writeConcern; + } + const parentOpts = inherit instanceof WriteConcern ? inherit : inherit.writeConcern; + const { w = undefined, wtimeout = undefined, j = undefined, fsync = undefined, journal = undefined, wtimeoutMS = undefined } = { + ...parentOpts, + ...opts + }; + if (w != null || + wtimeout != null || + wtimeoutMS != null || + j != null || + journal != null || + fsync != null) { + return new WriteConcern(w, wtimeout !== null && wtimeout !== void 0 ? wtimeout : wtimeoutMS, j !== null && j !== void 0 ? j : journal, fsync); + } + return undefined; + } +} +exports.WriteConcern = WriteConcern; +//# sourceMappingURL=write_concern.js.map \ No newline at end of file diff --git a/node_modules/mongodb/lib/write_concern.js.map b/node_modules/mongodb/lib/write_concern.js.map new file mode 100644 index 000000000..c2e21b7e1 --- /dev/null +++ b/node_modules/mongodb/lib/write_concern.js.map @@ -0,0 +1 @@ +{"version":3,"file":"write_concern.js","sourceRoot":"","sources":["../src/write_concern.ts"],"names":[],"mappings":";;;AA2Ba,QAAA,kBAAkB,GAAG,CAAC,GAAG,EAAE,UAAU,EAAE,GAAG,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC;AAE7E;;;;;;GAMG;AACH,MAAa,YAAY;IAUvB;;;;;;OAMG;IACH,YAAY,CAAK,EAAE,QAAiB,EAAE,CAAW,EAAE,KAAmB;QACpE,IAAI,CAAC,IAAI,IAAI,EAAE;YACb,IAAI,CA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,IAAI;SACR,CAAC;QACF,IACE,CAAC,IAAI,IAAI;YACT,QAAQ,IAAI,IAAI;YAChB,UAAU,IAAI,IAAI;YAClB,CAAC,IAAI,IAAI;YACT,OAAO,IAAI,IAAI;YACf,KAAK,IAAI,IAAI,EACb;YACA,OAAO,IAAI,YAAY,CAAC,CAAC,EAAE,QAAQ,aAAR,QAAQ,cAAR,QAAQ,GAAI,UAAU,EAAE,CAAC,aAAD,CAAC,cAAD,CAAC,GAAI,OAAO,EAAE,KAAK,CAAC,CAAC;SACzE;QACD,OAAO,SAAS,CAAC;IACnB,CAAC;CACF;AA7ED,oCA6EC"} \ No newline at end of file diff --git a/node_modules/mongodb/mongodb.d.ts b/node_modules/mongodb/mongodb.d.ts new file mode 100644 index 000000000..b7dcca1a8 --- /dev/null +++ b/node_modules/mongodb/mongodb.d.ts @@ -0,0 +1,6651 @@ +/// + +import { Binary } from 'bson'; +import { BSONRegExp } from 'bson'; +import { BSONSymbol } from 'bson'; +import { Code } from 'bson'; +import type { ConnectionOptions as ConnectionOptions_2 } from 'tls'; +import { DBRef } from 'bson'; +import { Decimal128 } from 'bson'; +import Denque = require('denque'); +import type { deserialize as deserialize_2 } from 'bson'; +import type { DeserializeOptions } from 'bson'; +import * as dns from 'dns'; +import { Document } from 'bson'; +import { Double } from 'bson'; +import { Duplex } from 'stream'; +import { DuplexOptions } from 'stream'; +import { EventEmitter } from 'events'; +import { Int32 } from 'bson'; +import { Long } from 'bson'; +import { Map as Map_2 } from 'bson'; +import { MaxKey } from 'bson'; +import { MinKey } from 'bson'; +import { ObjectId } from 'bson'; +import type { ObjectIdLike } from 'bson'; +import { Readable } from 'stream'; +import type { serialize as serialize_2 } from 'bson'; +import type { SerializeOptions } from 'bson'; +import type { Socket } from 'net'; +import type { SrvRecord } from 'dns'; +import type { TcpNetConnectOpts } from 'net'; +import { Timestamp } from 'bson'; +import type { TLSSocket } from 'tls'; +import type { TLSSocketOptions } from 'tls'; +import { Writable } from 'stream'; + +/** @public */ +export declare abstract class AbstractCursor extends TypedEventEmitter { + /* Excluded from this release type: [kId] */ + /* Excluded from this release type: [kSession] */ + /* Excluded from this release type: [kServer] */ + /* Excluded from this release type: [kNamespace] */ + /* Excluded from this release type: [kDocuments] */ + /* Excluded from this release type: [kClient] */ + /* Excluded from this release type: [kTransform] */ + /* Excluded from this release type: [kInitialized] */ + /* Excluded from this release type: [kClosed] */ + /* Excluded from this release type: [kKilled] */ + /* Excluded from this release type: [kOptions] */ + /** @event */ + static readonly CLOSE: "close"; + /* Excluded from this release type: __constructor */ + get id(): Long | undefined; + /* Excluded from this release type: client */ + /* Excluded from this release type: server */ + get namespace(): MongoDBNamespace; + get readPreference(): ReadPreference; + get readConcern(): ReadConcern | undefined; + /* Excluded from this release type: session */ + /* Excluded from this release type: session */ + /* Excluded from this release type: cursorOptions */ + get closed(): boolean; + get killed(): boolean; + get loadBalanced(): boolean; + /** Returns current buffered documents length */ + bufferedCount(): number; + /** Returns current buffered documents */ + readBufferedDocuments(number?: number): TSchema[]; + [Symbol.asyncIterator](): AsyncIterator; + stream(options?: CursorStreamOptions): Readable & AsyncIterable; + hasNext(): Promise; + hasNext(callback: Callback): void; + /** Get the next available document from the cursor, returns null if no more documents are available. */ + next(): Promise; + next(callback: Callback): void; + next(callback?: Callback): Promise | void; + /** + * Try to get the next available document from the cursor or `null` if an empty batch is returned + */ + tryNext(): Promise; + tryNext(callback: Callback): void; + /** + * Iterates over all the documents for this cursor using the iterator, callback pattern. + * + * @param iterator - The iteration callback. + * @param callback - The end callback. + */ + forEach(iterator: (doc: TSchema) => boolean | void): Promise; + forEach(iterator: (doc: TSchema) => boolean | void, callback: Callback): void; + close(): Promise; + close(callback: Callback): void; + /** + * @deprecated options argument is deprecated + */ + close(options: CursorCloseOptions): Promise; + /** + * @deprecated options argument is deprecated + */ + close(options: CursorCloseOptions, callback: Callback): void; + /** + * Returns an array of documents. The caller is responsible for making sure that there + * is enough memory to store the results. Note that the array only contains partial + * results when this cursor had been previously accessed. In that case, + * cursor.rewind() can be used to reset the cursor. + * + * @param callback - The result callback. + */ + toArray(): Promise; + toArray(callback: Callback): void; + /** + * Add a cursor flag to the cursor + * + * @param flag - The flag to set, must be one of following ['tailable', 'oplogReplay', 'noCursorTimeout', 'awaitData', 'partial' -. + * @param value - The flag boolean value. + */ + addCursorFlag(flag: CursorFlag, value: boolean): this; + /** + * Map all documents using the provided function + * If there is a transform set on the cursor, that will be called first and the result passed to + * this function's transform. + * + * @remarks + * **Note for Typescript Users:** adding a transform changes the return type of the iteration of this cursor, + * it **does not** return a new instance of a cursor. This means when calling map, + * you should always assign the result to a new variable in order to get a correctly typed cursor variable. + * Take note of the following example: + * + * @example + * ```typescript + * const cursor: FindCursor = coll.find(); + * const mappedCursor: FindCursor = cursor.map(doc => Object.keys(doc).length); + * const keyCounts: number[] = await mappedCursor.toArray(); // cursor.toArray() still returns Document[] + * ``` + * @param transform - The mapping transformation method. + */ + map(transform: (doc: TSchema) => T): AbstractCursor; + /** + * Set the ReadPreference for the cursor. + * + * @param readPreference - The new read preference for the cursor. + */ + withReadPreference(readPreference: ReadPreferenceLike): this; + /** + * Set the ReadPreference for the cursor. + * + * @param readPreference - The new read preference for the cursor. + */ + withReadConcern(readConcern: ReadConcernLike): this; + /** + * Set a maxTimeMS on the cursor query, allowing for hard timeout limits on queries (Only supported on MongoDB 2.6 or higher) + * + * @param value - Number of milliseconds to wait before aborting the query. + */ + maxTimeMS(value: number): this; + /** + * Set the batch size for the cursor. + * + * @param value - The number of documents to return per batch. See {@link https://docs.mongodb.com/manual/reference/command/find/|find command documentation}. + */ + batchSize(value: number): this; + /** + * Rewind this cursor to its uninitialized state. Any options that are present on the cursor will + * remain in effect. Iterating this cursor will cause new queries to be sent to the server, even + * if the resultant data has already been retrieved by this cursor. + */ + rewind(): void; + /** + * Returns a new uninitialized copy of this cursor, with options matching those that have been set on the current instance + */ + abstract clone(): AbstractCursor; + /* Excluded from this release type: _initialize */ + /* Excluded from this release type: _getMore */ + /* Excluded from this release type: [kInit] */ +} + +/** @public */ +export declare type AbstractCursorEvents = { + [AbstractCursor.CLOSE](): void; +}; + +/** @public */ +export declare interface AbstractCursorOptions extends BSONSerializeOptions { + session?: ClientSession; + readPreference?: ReadPreferenceLike; + readConcern?: ReadConcernLike; + batchSize?: number; + maxTimeMS?: number; + /** + * Comment to apply to the operation. + * + * In server versions pre-4.4, 'comment' must be string. A server + * error will be thrown if any other type is provided. + * + * In server versions 4.4 and above, 'comment' can be any valid BSON type. + */ + comment?: unknown; + tailable?: boolean; + awaitData?: boolean; + noCursorTimeout?: boolean; +} + +/* Excluded from this release type: AbstractOperation */ + +/** @public */ +export declare type AcceptedFields = { + readonly [key in KeysOfAType]?: AssignableType; +}; + +/** @public */ +export declare type AddToSetOperators = { + $each?: Array>; +}; + +/** @public */ +export declare interface AddUserOptions extends CommandOperationOptions { + /** @deprecated Please use db.command('createUser', ...) instead for this option */ + digestPassword?: null; + /** Roles associated with the created user */ + roles?: string | string[] | RoleSpecification | RoleSpecification[]; + /** Custom data associated with the user (only Mongodb 2.6 or higher) */ + customData?: Document; +} + +/** + * The **Admin** class is an internal class that allows convenient access to + * the admin functionality and commands for MongoDB. + * + * **ADMIN Cannot directly be instantiated** + * @public + * + * @example + * ```js + * const MongoClient = require('mongodb').MongoClient; + * const test = require('assert'); + * // Connection url + * const url = 'mongodb://localhost:27017'; + * // Database Name + * const dbName = 'test'; + * + * // Connect using MongoClient + * MongoClient.connect(url, function(err, client) { + * // Use the admin database for the operation + * const adminDb = client.db(dbName).admin(); + * + * // List all the available databases + * adminDb.listDatabases(function(err, dbs) { + * expect(err).to.not.exist; + * test.ok(dbs.databases.length > 0); + * client.close(); + * }); + * }); + * ``` + */ +export declare class Admin { + /* Excluded from this release type: s */ + /* Excluded from this release type: __constructor */ + /** + * Execute a command + * + * @param command - The command to execute + * @param options - Optional settings for the command + * @param callback - An optional callback, a Promise will be returned if none is provided + */ + command(command: Document): Promise; + command(command: Document, callback: Callback): void; + command(command: Document, options: RunCommandOptions): Promise; + command(command: Document, options: RunCommandOptions, callback: Callback): void; + /** + * Retrieve the server build information + * + * @param options - Optional settings for the command + * @param callback - An optional callback, a Promise will be returned if none is provided + */ + buildInfo(): Promise; + buildInfo(callback: Callback): void; + buildInfo(options: CommandOperationOptions): Promise; + buildInfo(options: CommandOperationOptions, callback: Callback): void; + /** + * Retrieve the server build information + * + * @param options - Optional settings for the command + * @param callback - An optional callback, a Promise will be returned if none is provided + */ + serverInfo(): Promise; + serverInfo(callback: Callback): void; + serverInfo(options: CommandOperationOptions): Promise; + serverInfo(options: CommandOperationOptions, callback: Callback): void; + /** + * Retrieve this db's server status. + * + * @param options - Optional settings for the command + * @param callback - An optional callback, a Promise will be returned if none is provided + */ + serverStatus(): Promise; + serverStatus(callback: Callback): void; + serverStatus(options: CommandOperationOptions): Promise; + serverStatus(options: CommandOperationOptions, callback: Callback): void; + /** + * Ping the MongoDB server and retrieve results + * + * @param options - Optional settings for the command + * @param callback - An optional callback, a Promise will be returned if none is provided + */ + ping(): Promise; + ping(callback: Callback): void; + ping(options: CommandOperationOptions): Promise; + ping(options: CommandOperationOptions, callback: Callback): void; + /** + * Add a user to the database + * + * @param username - The username for the new user + * @param password - An optional password for the new user + * @param options - Optional settings for the command + * @param callback - An optional callback, a Promise will be returned if none is provided + */ + addUser(username: string): Promise; + addUser(username: string, callback: Callback): void; + addUser(username: string, password: string): Promise; + addUser(username: string, password: string, callback: Callback): void; + addUser(username: string, options: AddUserOptions): Promise; + addUser(username: string, options: AddUserOptions, callback: Callback): void; + addUser(username: string, password: string, options: AddUserOptions): Promise; + addUser(username: string, password: string, options: AddUserOptions, callback: Callback): void; + /** + * Remove a user from a database + * + * @param username - The username to remove + * @param options - Optional settings for the command + * @param callback - An optional callback, a Promise will be returned if none is provided + */ + removeUser(username: string): Promise; + removeUser(username: string, callback: Callback): void; + removeUser(username: string, options: RemoveUserOptions): Promise; + removeUser(username: string, options: RemoveUserOptions, callback: Callback): void; + /** + * Validate an existing collection + * + * @param collectionName - The name of the collection to validate. + * @param options - Optional settings for the command + * @param callback - An optional callback, a Promise will be returned if none is provided + */ + validateCollection(collectionName: string): Promise; + validateCollection(collectionName: string, callback: Callback): void; + validateCollection(collectionName: string, options: ValidateCollectionOptions): Promise; + validateCollection(collectionName: string, options: ValidateCollectionOptions, callback: Callback): void; + /** + * List the available databases + * + * @param options - Optional settings for the command + * @param callback - An optional callback, a Promise will be returned if none is provided + */ + listDatabases(): Promise; + listDatabases(callback: Callback): void; + listDatabases(options: ListDatabasesOptions): Promise; + listDatabases(options: ListDatabasesOptions, callback: Callback): void; + /** + * Get ReplicaSet status + * + * @param options - Optional settings for the command + * @param callback - An optional callback, a Promise will be returned if none is provided + */ + replSetGetStatus(): Promise; + replSetGetStatus(callback: Callback): void; + replSetGetStatus(options: CommandOperationOptions): Promise; + replSetGetStatus(options: CommandOperationOptions, callback: Callback): void; +} + +/* Excluded from this release type: AdminPrivate */ + +/* Excluded from this release type: AggregateOperation */ + +/** @public */ +export declare interface AggregateOptions extends CommandOperationOptions { + /** allowDiskUse lets the server know if it can use disk to store temporary results for the aggregation (requires mongodb 2.6 \>). */ + allowDiskUse?: boolean; + /** The number of documents to return per batch. See [aggregation documentation](https://docs.mongodb.com/manual/reference/command/aggregate). */ + batchSize?: number; + /** Allow driver to bypass schema validation in MongoDB 3.2 or higher. */ + bypassDocumentValidation?: boolean; + /** Return the query as cursor, on 2.6 \> it returns as a real cursor on pre 2.6 it returns as an emulated cursor. */ + cursor?: Document; + /** specifies a cumulative time limit in milliseconds for processing operations on the cursor. MongoDB interrupts the operation at the earliest following interrupt point. */ + maxTimeMS?: number; + /** The maximum amount of time for the server to wait on new documents to satisfy a tailable cursor query. */ + maxAwaitTimeMS?: number; + /** Specify collation. */ + collation?: CollationOptions; + /** Add an index selection hint to an aggregation command */ + hint?: Hint; + /** Map of parameter names and values that can be accessed using $$var (requires MongoDB 5.0). */ + let?: Document; + out?: string; +} + +/** + * The **AggregationCursor** class is an internal class that embodies an aggregation cursor on MongoDB + * allowing for iteration over the results returned from the underlying query. It supports + * one by one document iteration, conversion to an array or can be iterated as a Node 4.X + * or higher stream + * @public + */ +export declare class AggregationCursor extends AbstractCursor { + /* Excluded from this release type: [kPipeline] */ + /* Excluded from this release type: [kOptions] */ + /* Excluded from this release type: __constructor */ + get pipeline(): Document[]; + clone(): AggregationCursor; + map(transform: (doc: TSchema) => T): AggregationCursor; + /* Excluded from this release type: _initialize */ + /** Execute the explain for the cursor */ + explain(): Promise; + explain(callback: Callback): void; + explain(verbosity: ExplainVerbosityLike): Promise; + /** Add a group stage to the aggregation pipeline */ + group($group: Document): AggregationCursor; + /** Add a limit stage to the aggregation pipeline */ + limit($limit: number): this; + /** Add a match stage to the aggregation pipeline */ + match($match: Document): this; + /** Add an out stage to the aggregation pipeline */ + out($out: { + db: string; + coll: string; + } | string): this; + /** + * Add a project stage to the aggregation pipeline + * + * @remarks + * In order to strictly type this function you must provide an interface + * that represents the effect of your projection on the result documents. + * + * By default chaining a projection to your cursor changes the returned type to the generic {@link Document} type. + * You should specify a parameterized type to have assertions on your final results. + * + * @example + * ```typescript + * // Best way + * const docs: AggregationCursor<{ a: number }> = cursor.project<{ a: number }>({ _id: 0, a: true }); + * // Flexible way + * const docs: AggregationCursor = cursor.project({ _id: 0, a: true }); + * ``` + * + * @remarks + * In order to strictly type this function you must provide an interface + * that represents the effect of your projection on the result documents. + * + * **Note for Typescript Users:** adding a transform changes the return type of the iteration of this cursor, + * it **does not** return a new instance of a cursor. This means when calling project, + * you should always assign the result to a new variable in order to get a correctly typed cursor variable. + * Take note of the following example: + * + * @example + * ```typescript + * const cursor: AggregationCursor<{ a: number; b: string }> = coll.aggregate([]); + * const projectCursor = cursor.project<{ a: number }>({ _id: 0, a: true }); + * const aPropOnlyArray: {a: number}[] = await projectCursor.toArray(); + * + * // or always use chaining and save the final cursor + * + * const cursor = coll.aggregate().project<{ a: string }>({ + * _id: 0, + * a: { $convert: { input: '$a', to: 'string' } + * }}); + * ``` + */ + project($project: Document): AggregationCursor; + /** Add a lookup stage to the aggregation pipeline */ + lookup($lookup: Document): this; + /** Add a redact stage to the aggregation pipeline */ + redact($redact: Document): this; + /** Add a skip stage to the aggregation pipeline */ + skip($skip: number): this; + /** Add a sort stage to the aggregation pipeline */ + sort($sort: Sort): this; + /** Add a unwind stage to the aggregation pipeline */ + unwind($unwind: Document | string): this; + /** @deprecated Add a geoNear stage to the aggregation pipeline */ + geoNear($geoNear: Document): this; +} + +/** @public */ +export declare interface AggregationCursorOptions extends AbstractCursorOptions, AggregateOptions { +} + +/** + * It is possible to search using alternative types in mongodb e.g. + * string types can be searched using a regex in mongo + * array types can be searched using their element type + * @public + */ +export declare type AlternativeType = T extends ReadonlyArray ? T | RegExpOrString : RegExpOrString; + +/** @public */ +export declare type AnyBulkWriteOperation = { + insertOne: InsertOneModel; +} | { + replaceOne: ReplaceOneModel; +} | { + updateOne: UpdateOneModel; +} | { + updateMany: UpdateManyModel; +} | { + deleteOne: DeleteOneModel; +} | { + deleteMany: DeleteManyModel; +}; + +/** @public */ +export declare type AnyError = MongoError | Error; + +/** @public */ +export declare type ArrayOperator = { + $each?: Array>; + $slice?: number; + $position?: number; + $sort?: Sort; +}; + +/** @public */ +export declare interface Auth { + /** The username for auth */ + username?: string; + /** The password for auth */ + password?: string; +} + +/** @public */ +export declare const AuthMechanism: Readonly<{ + readonly MONGODB_AWS: "MONGODB-AWS"; + readonly MONGODB_CR: "MONGODB-CR"; + readonly MONGODB_DEFAULT: "DEFAULT"; + readonly MONGODB_GSSAPI: "GSSAPI"; + readonly MONGODB_PLAIN: "PLAIN"; + readonly MONGODB_SCRAM_SHA1: "SCRAM-SHA-1"; + readonly MONGODB_SCRAM_SHA256: "SCRAM-SHA-256"; + readonly MONGODB_X509: "MONGODB-X509"; +}>; + +/** @public */ +export declare type AuthMechanism = typeof AuthMechanism[keyof typeof AuthMechanism]; + +/** @public */ +export declare interface AuthMechanismProperties extends Document { + SERVICE_HOST?: string; + SERVICE_NAME?: string; + SERVICE_REALM?: string; + CANONICALIZE_HOST_NAME?: GSSAPICanonicalizationValue; + AWS_SESSION_TOKEN?: string; +} + +/** @public */ +export declare interface AutoEncrypter { + new (client: MongoClient, options: AutoEncryptionOptions): AutoEncrypter; + init(cb: Callback): void; + teardown(force: boolean, callback: Callback): void; + encrypt(ns: string, cmd: Document, options: any, callback: Callback): void; + decrypt(cmd: Document, options: any, callback: Callback): void; + /** @experimental */ + readonly cryptSharedLibVersionInfo: { + version: bigint; + versionStr: string; + } | null; +} + +/** @public */ +export declare const AutoEncryptionLoggerLevel: Readonly<{ + readonly FatalError: 0; + readonly Error: 1; + readonly Warning: 2; + readonly Info: 3; + readonly Trace: 4; +}>; + +/** @public */ +export declare type AutoEncryptionLoggerLevel = typeof AutoEncryptionLoggerLevel[keyof typeof AutoEncryptionLoggerLevel]; + +/** @public */ +export declare interface AutoEncryptionOptions { + /* Excluded from this release type: bson */ + /* Excluded from this release type: metadataClient */ + /** A `MongoClient` used to fetch keys from a key vault */ + keyVaultClient?: MongoClient; + /** The namespace where keys are stored in the key vault */ + keyVaultNamespace?: string; + /** Configuration options that are used by specific KMS providers during key generation, encryption, and decryption. */ + kmsProviders?: { + /** Configuration options for using 'aws' as your KMS provider */ + aws?: { + /** The access key used for the AWS KMS provider */ + accessKeyId: string; + /** The secret access key used for the AWS KMS provider */ + secretAccessKey: string; + /** + * An optional AWS session token that will be used as the + * X-Amz-Security-Token header for AWS requests. + */ + sessionToken?: string; + }; + /** Configuration options for using 'local' as your KMS provider */ + local?: { + /** + * The master key used to encrypt/decrypt data keys. + * A 96-byte long Buffer or base64 encoded string. + */ + key: Buffer | string; + }; + /** Configuration options for using 'azure' as your KMS provider */ + azure?: { + /** The tenant ID identifies the organization for the account */ + tenantId: string; + /** The client ID to authenticate a registered application */ + clientId: string; + /** The client secret to authenticate a registered application */ + clientSecret: string; + /** + * If present, a host with optional port. E.g. "example.com" or "example.com:443". + * This is optional, and only needed if customer is using a non-commercial Azure instance + * (e.g. a government or China account, which use different URLs). + * Defaults to "login.microsoftonline.com" + */ + identityPlatformEndpoint?: string | undefined; + }; + /** Configuration options for using 'gcp' as your KMS provider */ + gcp?: { + /** The service account email to authenticate */ + email: string; + /** A PKCS#8 encrypted key. This can either be a base64 string or a binary representation */ + privateKey: string | Buffer; + /** + * If present, a host with optional port. E.g. "example.com" or "example.com:443". + * Defaults to "oauth2.googleapis.com" + */ + endpoint?: string | undefined; + }; + /** + * Configuration options for using 'kmip' as your KMS provider + */ + kmip?: { + /** + * The output endpoint string. + * The endpoint consists of a hostname and port separated by a colon. + * E.g. "example.com:123". A port is always present. + */ + endpoint?: string; + }; + }; + /** + * A map of namespaces to a local JSON schema for encryption + * + * **NOTE**: Supplying options.schemaMap provides more security than relying on JSON Schemas obtained from the server. + * It protects against a malicious server advertising a false JSON Schema, which could trick the client into sending decrypted data that should be encrypted. + * Schemas supplied in the schemaMap only apply to configuring automatic encryption for client side encryption. + * Other validation rules in the JSON schema will not be enforced by the driver and will result in an error. + */ + schemaMap?: Document; + /** @experimental */ + encryptedFieldsMap?: Document; + /** Allows the user to bypass auto encryption, maintaining implicit decryption */ + bypassAutoEncryption?: boolean; + /** @experimental */ + bypassQueryAnalysis?: boolean; + options?: { + /** An optional hook to catch logging messages from the underlying encryption engine */ + logger?: (level: AutoEncryptionLoggerLevel, message: string) => void; + }; + extraOptions?: { + /** + * A local process the driver communicates with to determine how to encrypt values in a command. + * Defaults to "mongodb://%2Fvar%2Fmongocryptd.sock" if domain sockets are available or "mongodb://localhost:27020" otherwise + */ + mongocryptdURI?: string; + /** If true, autoEncryption will not attempt to spawn a mongocryptd before connecting */ + mongocryptdBypassSpawn?: boolean; + /** The path to the mongocryptd executable on the system */ + mongocryptdSpawnPath?: string; + /** Command line arguments to use when auto-spawning a mongocryptd */ + mongocryptdSpawnArgs?: string[]; + /** + * Full path to a MongoDB Crypt shared library to be used (instead of mongocryptd). + * + * This needs to be the path to the file itself, not a directory. + * It can be an absolute or relative path. If the path is relative and + * its first component is `$ORIGIN`, it will be replaced by the directory + * containing the mongodb-client-encryption native addon file. Otherwise, + * the path will be interpreted relative to the current working directory. + * + * Currently, loading different MongoDB Crypt shared library files from different + * MongoClients in the same process is not supported. + * + * If this option is provided and no MongoDB Crypt shared library could be loaded + * from the specified location, creating the MongoClient will fail. + * + * If this option is not provided and `cryptSharedLibRequired` is not specified, + * the AutoEncrypter will attempt to spawn and/or use mongocryptd according + * to the mongocryptd-specific `extraOptions` options. + * + * Specifying a path prevents mongocryptd from being used as a fallback. + * + * @experimental Requires the MongoDB Crypt shared library, available in MongoDB 6.0 or higher. + */ + cryptSharedLibPath?: string; + /** + * If specified, never use mongocryptd and instead fail when the MongoDB Crypt + * shared library could not be loaded. + * + * This is always true when `cryptSharedLibPath` is specified. + * + * @experimental Requires the MongoDB Crypt shared library, available in MongoDB 6.0 or higher. + */ + cryptSharedLibRequired?: boolean; + /* Excluded from this release type: cryptSharedLibSearchPaths */ + }; + proxyOptions?: ProxyOptions; + /** The TLS options to use connecting to the KMS provider */ + tlsOptions?: { + aws?: AutoEncryptionTlsOptions; + local?: AutoEncryptionTlsOptions; + azure?: AutoEncryptionTlsOptions; + gcp?: AutoEncryptionTlsOptions; + kmip?: AutoEncryptionTlsOptions; + }; +} + +/** @public */ +export declare interface AutoEncryptionTlsOptions { + /** + * Specifies the location of a local .pem file that contains + * either the client's TLS/SSL certificate and key or only the + * client's TLS/SSL key when tlsCertificateFile is used to + * provide the certificate. + */ + tlsCertificateKeyFile?: string; + /** + * Specifies the password to de-crypt the tlsCertificateKeyFile. + */ + tlsCertificateKeyFilePassword?: string; + /** + * Specifies the location of a local .pem file that contains the + * root certificate chain from the Certificate Authority. + * This file is used to validate the certificate presented by the + * KMS provider. + */ + tlsCAFile?: string; +} + +/** + * Keeps the state of a unordered batch so we can rewrite the results + * correctly after command execution + * + * @public + */ +export declare class Batch { + originalZeroIndex: number; + currentIndex: number; + originalIndexes: number[]; + batchType: BatchType; + operations: T[]; + size: number; + sizeBytes: number; + constructor(batchType: BatchType, originalZeroIndex: number); +} + +/** @public */ +export declare const BatchType: Readonly<{ + readonly INSERT: 1; + readonly UPDATE: 2; + readonly DELETE: 3; +}>; + +/** @public */ +export declare type BatchType = typeof BatchType[keyof typeof BatchType]; + +export { Binary } + +/* Excluded from this release type: BinMsg */ + +/** @public */ +export declare type BitwiseFilter = number /** numeric bit mask */ | Binary /** BinData bit mask */ | ReadonlyArray; + +export { BSONRegExp } + +/** + * BSON Serialization options. + * @public + */ +export declare interface BSONSerializeOptions extends Omit, Omit { + /** Return BSON filled buffers from operations */ + raw?: boolean; + /** Enable utf8 validation when deserializing BSON documents. Defaults to true. */ + enableUtf8Validation?: boolean; +} + +export { BSONSymbol } + +/** @public */ +export declare const BSONType: Readonly<{ + readonly double: 1; + readonly string: 2; + readonly object: 3; + readonly array: 4; + readonly binData: 5; + readonly undefined: 6; + readonly objectId: 7; + readonly bool: 8; + readonly date: 9; + readonly null: 10; + readonly regex: 11; + readonly dbPointer: 12; + readonly javascript: 13; + readonly symbol: 14; + readonly javascriptWithScope: 15; + readonly int: 16; + readonly timestamp: 17; + readonly long: 18; + readonly decimal: 19; + readonly minKey: -1; + readonly maxKey: 127; +}>; + +/** @public */ +export declare type BSONType = typeof BSONType[keyof typeof BSONType]; + +/** @public */ +export declare type BSONTypeAlias = keyof typeof BSONType; + +/* Excluded from this release type: BufferPool */ + +/** @public */ +export declare abstract class BulkOperationBase { + isOrdered: boolean; + /* Excluded from this release type: s */ + operationId?: number; + /* Excluded from this release type: __constructor */ + /** + * Add a single insert document to the bulk operation + * + * @example + * ```js + * const bulkOp = collection.initializeOrderedBulkOp(); + * + * // Adds three inserts to the bulkOp. + * bulkOp + * .insert({ a: 1 }) + * .insert({ b: 2 }) + * .insert({ c: 3 }); + * await bulkOp.execute(); + * ``` + */ + insert(document: Document): BulkOperationBase; + /** + * Builds a find operation for an update/updateOne/delete/deleteOne/replaceOne. + * Returns a builder object used to complete the definition of the operation. + * + * @example + * ```js + * const bulkOp = collection.initializeOrderedBulkOp(); + * + * // Add an updateOne to the bulkOp + * bulkOp.find({ a: 1 }).updateOne({ $set: { b: 2 } }); + * + * // Add an updateMany to the bulkOp + * bulkOp.find({ c: 3 }).update({ $set: { d: 4 } }); + * + * // Add an upsert + * bulkOp.find({ e: 5 }).upsert().updateOne({ $set: { f: 6 } }); + * + * // Add a deletion + * bulkOp.find({ g: 7 }).deleteOne(); + * + * // Add a multi deletion + * bulkOp.find({ h: 8 }).delete(); + * + * // Add a replaceOne + * bulkOp.find({ i: 9 }).replaceOne({writeConcern: { j: 10 }}); + * + * // Update using a pipeline (requires Mongodb 4.2 or higher) + * bulk.find({ k: 11, y: { $exists: true }, z: { $exists: true } }).updateOne([ + * { $set: { total: { $sum: [ '$y', '$z' ] } } } + * ]); + * + * // All of the ops will now be executed + * await bulkOp.execute(); + * ``` + */ + find(selector: Document): FindOperators; + /** Specifies a raw operation to perform in the bulk write. */ + raw(op: AnyBulkWriteOperation): this; + get bsonOptions(): BSONSerializeOptions; + get writeConcern(): WriteConcern | undefined; + get batches(): Batch[]; + execute(options?: BulkWriteOptions): Promise; + execute(callback: Callback): void; + execute(options: BulkWriteOptions | undefined, callback: Callback): void; + execute(options?: BulkWriteOptions | Callback, callback?: Callback): Promise | void; + /* Excluded from this release type: handleWriteError */ + abstract addToOperationsList(batchType: BatchType, document: Document | UpdateStatement | DeleteStatement): this; +} + +/* Excluded from this release type: BulkOperationPrivate */ + +/** @public */ +export declare interface BulkResult { + ok: number; + writeErrors: WriteError[]; + writeConcernErrors: WriteConcernError[]; + insertedIds: Document[]; + nInserted: number; + nUpserted: number; + nMatched: number; + nModified: number; + nRemoved: number; + upserted: Document[]; + opTime?: Document; +} + +/** @public */ +export declare interface BulkWriteOperationError { + index: number; + code: number; + errmsg: string; + errInfo: Document; + op: Document | UpdateStatement | DeleteStatement; +} + +/** @public */ +export declare interface BulkWriteOptions extends CommandOperationOptions { + /** Allow driver to bypass schema validation in MongoDB 3.2 or higher. */ + bypassDocumentValidation?: boolean; + /** If true, when an insert fails, don't execute the remaining writes. If false, continue with remaining inserts when one fails. */ + ordered?: boolean; + /** @deprecated use `ordered` instead */ + keepGoing?: boolean; + /** Force server to assign _id values instead of driver. */ + forceServerObjectId?: boolean; + /** Map of parameter names and values that can be accessed using $$var (requires MongoDB 5.0). */ + let?: Document; +} + +/** + * @public + * The result of a bulk write. + */ +export declare class BulkWriteResult { + result: BulkResult; + /* Excluded from this release type: __constructor */ + /** Number of documents inserted. */ + get insertedCount(): number; + /** Number of documents matched for update. */ + get matchedCount(): number; + /** Number of documents modified. */ + get modifiedCount(): number; + /** Number of documents deleted. */ + get deletedCount(): number; + /** Number of documents upserted. */ + get upsertedCount(): number; + /** Upserted document generated Id's, hash key is the index of the originating operation */ + get upsertedIds(): { + [key: number]: any; + }; + /** Inserted document generated Id's, hash key is the index of the originating operation */ + get insertedIds(): { + [key: number]: any; + }; + /** Evaluates to true if the bulk operation correctly executes */ + get ok(): number; + /** The number of inserted documents */ + get nInserted(): number; + /** Number of upserted documents */ + get nUpserted(): number; + /** Number of matched documents */ + get nMatched(): number; + /** Number of documents updated physically on disk */ + get nModified(): number; + /** Number of removed documents */ + get nRemoved(): number; + /** Returns an array of all inserted ids */ + getInsertedIds(): Document[]; + /** Returns an array of all upserted ids */ + getUpsertedIds(): Document[]; + /** Returns the upserted id at the given index */ + getUpsertedIdAt(index: number): Document | undefined; + /** Returns raw internal result */ + getRawResponse(): Document; + /** Returns true if the bulk operation contains a write error */ + hasWriteErrors(): boolean; + /** Returns the number of write errors off the bulk operation */ + getWriteErrorCount(): number; + /** Returns a specific write error object */ + getWriteErrorAt(index: number): WriteError | undefined; + /** Retrieve all write errors */ + getWriteErrors(): WriteError[]; + /** Retrieve lastOp if available */ + getLastOp(): Document | undefined; + /** Retrieve the write concern error if one exists */ + getWriteConcernError(): WriteConcernError | undefined; + toJSON(): BulkResult; + toString(): string; + isOk(): boolean; +} + +/** + * MongoDB Driver style callback + * @public + */ +export declare type Callback = (error?: AnyError, result?: T) => void; + +/** @public */ +export declare class CancellationToken extends TypedEventEmitter<{ + cancel(): void; +}> { +} + +/** + * Creates a new Change Stream instance. Normally created using {@link Collection#watch|Collection.watch()}. + * @public + */ +export declare class ChangeStream> extends TypedEventEmitter> { + pipeline: Document[]; + options: ChangeStreamOptions; + parent: MongoClient | Db | Collection; + namespace: MongoDBNamespace; + type: symbol; + /* Excluded from this release type: cursor */ + streamOptions?: CursorStreamOptions; + /* Excluded from this release type: [kResumeQueue] */ + /* Excluded from this release type: [kCursorStream] */ + /* Excluded from this release type: [kClosed] */ + /* Excluded from this release type: [kMode] */ + /** @event */ + static readonly RESPONSE: "response"; + /** @event */ + static readonly MORE: "more"; + /** @event */ + static readonly INIT: "init"; + /** @event */ + static readonly CLOSE: "close"; + /** + * Fired for each new matching change in the specified namespace. Attaching a `change` + * event listener to a Change Stream will switch the stream into flowing mode. Data will + * then be passed as soon as it is available. + * @event + */ + static readonly CHANGE: "change"; + /** @event */ + static readonly END: "end"; + /** @event */ + static readonly ERROR: "error"; + /** + * Emitted each time the change stream stores a new resume token. + * @event + */ + static readonly RESUME_TOKEN_CHANGED: "resumeTokenChanged"; + /* Excluded from this release type: __constructor */ + /* Excluded from this release type: cursorStream */ + /** The cached resume token that is used to resume after the most recently returned change. */ + get resumeToken(): ResumeToken; + /** Check if there is any document still available in the Change Stream */ + hasNext(): Promise; + hasNext(callback: Callback): void; + /** Get the next available document from the Change Stream. */ + next(): Promise; + next(callback: Callback): void; + /** Is the cursor closed */ + get closed(): boolean; + /** Close the Change Stream */ + close(callback?: Callback): Promise | void; + /** + * Return a modified Readable stream including a possible transform method. + * @throws MongoDriverError if this.cursor is undefined + */ + stream(options?: CursorStreamOptions): Readable & AsyncIterable; + /** + * Try to get the next available document from the Change Stream's cursor or `null` if an empty batch is returned + */ + tryNext(): Promise; + tryNext(callback: Callback): void; + /* Excluded from this release type: _setIsEmitter */ + /* Excluded from this release type: _setIsIterator */ + /* Excluded from this release type: _createChangeStreamCursor */ + /* Excluded from this release type: _waitForTopologyConnected */ + /* Excluded from this release type: _closeWithError */ + /* Excluded from this release type: _streamEvents */ + /* Excluded from this release type: _endStream */ + /* Excluded from this release type: _processNewChange */ + /* Excluded from this release type: _processError */ + /* Excluded from this release type: _getCursor */ + /* Excluded from this release type: _processResumeQueue */ +} + +/* Excluded from this release type: ChangeStreamAggregateRawResult */ + +/** + * Only present when the `showExpandedEvents` flag is enabled. + * @public + * @see https://www.mongodb.com/docs/manual/reference/change-events/ + */ +export declare interface ChangeStreamCollModDocument extends ChangeStreamDocumentCommon, ChangeStreamDocumentCollectionUUID { + /** Describes the type of operation represented in this change notification */ + operationType: 'modify'; +} + +/** + * @public + * @see https://www.mongodb.com/docs/manual/reference/change-events/ + */ +export declare interface ChangeStreamCreateDocument extends ChangeStreamDocumentCommon, ChangeStreamDocumentCollectionUUID { + /** Describes the type of operation represented in this change notification */ + operationType: 'create'; +} + +/** + * Only present when the `showExpandedEvents` flag is enabled. + * @public + * @see https://www.mongodb.com/docs/manual/reference/change-events/ + */ +export declare interface ChangeStreamCreateIndexDocument extends ChangeStreamDocumentCommon, ChangeStreamDocumentCollectionUUID, ChangeStreamDocumentOperationDescription { + /** Describes the type of operation represented in this change notification */ + operationType: 'createIndexes'; +} + +/* Excluded from this release type: ChangeStreamCursor */ + +/* Excluded from this release type: ChangeStreamCursorOptions */ + +/** + * @public + * @see https://www.mongodb.com/docs/manual/reference/change-events/#delete-event + */ +export declare interface ChangeStreamDeleteDocument extends ChangeStreamDocumentCommon, ChangeStreamDocumentKey, ChangeStreamDocumentCollectionUUID { + /** Describes the type of operation represented in this change notification */ + operationType: 'delete'; + /** Namespace the delete event occured on */ + ns: ChangeStreamNameSpace; + /** + * Contains the pre-image of the modified or deleted document if the + * pre-image is available for the change event and either 'required' or + * 'whenAvailable' was specified for the 'fullDocumentBeforeChange' option + * when creating the change stream. If 'whenAvailable' was specified but the + * pre-image is unavailable, this will be explicitly set to null. + */ + fullDocumentBeforeChange?: TSchema; +} + +/** @public */ +export declare type ChangeStreamDocument = ChangeStreamInsertDocument | ChangeStreamUpdateDocument | ChangeStreamReplaceDocument | ChangeStreamDeleteDocument | ChangeStreamDropDocument | ChangeStreamRenameDocument | ChangeStreamDropDatabaseDocument | ChangeStreamInvalidateDocument | ChangeStreamCreateIndexDocument | ChangeStreamCreateDocument | ChangeStreamCollModDocument | ChangeStreamDropIndexDocument | ChangeStreamShardCollectionDocument | ChangeStreamReshardCollectionDocument | ChangeStreamRefineCollectionShardKeyDocument; + +/** @public */ +export declare interface ChangeStreamDocumentCollectionUUID { + /** + * The UUID (Binary subtype 4) of the collection that the operation was performed on. + * + * Only present when the `showExpandedEvents` flag is enabled. + * + * **NOTE:** collectionUUID will be converted to a NodeJS Buffer if the promoteBuffers + * flag is enabled. + * + * @since 6.1.0 + */ + collectionUUID: Binary; +} + +/** @public */ +export declare interface ChangeStreamDocumentCommon { + /** + * The id functions as an opaque token for use when resuming an interrupted + * change stream. + */ + _id: ResumeToken; + /** + * The timestamp from the oplog entry associated with the event. + * For events that happened as part of a multi-document transaction, the associated change stream + * notifications will have the same clusterTime value, namely the time when the transaction was committed. + * On a sharded cluster, events that occur on different shards can have the same clusterTime but be + * associated with different transactions or even not be associated with any transaction. + * To identify events for a single transaction, you can use the combination of lsid and txnNumber in the change stream event document. + */ + clusterTime?: Timestamp; + /** + * The transaction number. + * Only present if the operation is part of a multi-document transaction. + * + * **NOTE:** txnNumber can be a Long if promoteLongs is set to false + */ + txnNumber?: number; + /** + * The identifier for the session associated with the transaction. + * Only present if the operation is part of a multi-document transaction. + */ + lsid?: ServerSessionId; +} + +/** @public */ +export declare interface ChangeStreamDocumentKey { + /** + * For unsharded collections this contains a single field `_id`. + * For sharded collections, this will contain all the components of the shard key + */ + documentKey: { + _id: InferIdType; + [shardKey: string]: any; + }; +} + +/** @public */ +export declare interface ChangeStreamDocumentOperationDescription { + /** + * An description of the operation. + * + * Only present when the `showExpandedEvents` flag is enabled. + * + * @since 6.1.0 + */ + operationDescription?: Document; +} + +/** + * @public + * @see https://www.mongodb.com/docs/manual/reference/change-events/#dropdatabase-event + */ +export declare interface ChangeStreamDropDatabaseDocument extends ChangeStreamDocumentCommon { + /** Describes the type of operation represented in this change notification */ + operationType: 'dropDatabase'; + /** The database dropped */ + ns: { + db: string; + }; +} + +/** + * @public + * @see https://www.mongodb.com/docs/manual/reference/change-events/#drop-event + */ +export declare interface ChangeStreamDropDocument extends ChangeStreamDocumentCommon, ChangeStreamDocumentCollectionUUID { + /** Describes the type of operation represented in this change notification */ + operationType: 'drop'; + /** Namespace the drop event occured on */ + ns: ChangeStreamNameSpace; +} + +/** + * Only present when the `showExpandedEvents` flag is enabled. + * @public + * @see https://www.mongodb.com/docs/manual/reference/change-events/ + */ +export declare interface ChangeStreamDropIndexDocument extends ChangeStreamDocumentCommon, ChangeStreamDocumentCollectionUUID, ChangeStreamDocumentOperationDescription { + /** Describes the type of operation represented in this change notification */ + operationType: 'dropIndexes'; +} + +/** @public */ +export declare type ChangeStreamEvents> = { + resumeTokenChanged(token: ResumeToken): void; + init(response: any): void; + more(response?: any): void; + response(): void; + end(): void; + error(error: Error): void; + change(change: TChange): void; +} & AbstractCursorEvents; + +/** + * @public + * @see https://www.mongodb.com/docs/manual/reference/change-events/#insert-event + */ +export declare interface ChangeStreamInsertDocument extends ChangeStreamDocumentCommon, ChangeStreamDocumentKey, ChangeStreamDocumentCollectionUUID { + /** Describes the type of operation represented in this change notification */ + operationType: 'insert'; + /** This key will contain the document being inserted */ + fullDocument: TSchema; + /** Namespace the insert event occured on */ + ns: ChangeStreamNameSpace; +} + +/** + * @public + * @see https://www.mongodb.com/docs/manual/reference/change-events/#invalidate-event + */ +export declare interface ChangeStreamInvalidateDocument extends ChangeStreamDocumentCommon { + /** Describes the type of operation represented in this change notification */ + operationType: 'invalidate'; +} + +/** @public */ +export declare interface ChangeStreamNameSpace { + db: string; + coll: string; +} + +/** + * Options that can be passed to a ChangeStream. Note that startAfter, resumeAfter, and startAtOperationTime are all mutually exclusive, and the server will error if more than one is specified. + * @public + */ +export declare interface ChangeStreamOptions extends AggregateOptions { + /** + * Allowed values: 'updateLookup', 'whenAvailable', 'required'. + * + * When set to 'updateLookup', the change notification for partial updates + * will include both a delta describing the changes to the document as well + * as a copy of the entire document that was changed from some time after + * the change occurred. + * + * When set to 'whenAvailable', configures the change stream to return the + * post-image of the modified document for replace and update change events + * if the post-image for this event is available. + * + * When set to 'required', the same behavior as 'whenAvailable' except that + * an error is raised if the post-image is not available. + */ + fullDocument?: string; + /** + * Allowed values: 'whenAvailable', 'required', 'off'. + * + * The default is to not send a value, which is equivalent to 'off'. + * + * When set to 'whenAvailable', configures the change stream to return the + * pre-image of the modified document for replace, update, and delete change + * events if it is available. + * + * When set to 'required', the same behavior as 'whenAvailable' except that + * an error is raised if the pre-image is not available. + */ + fullDocumentBeforeChange?: string; + /** The maximum amount of time for the server to wait on new documents to satisfy a change stream query. */ + maxAwaitTimeMS?: number; + /** + * Allows you to start a changeStream after a specified event. + * @see https://docs.mongodb.com/manual/changeStreams/#resumeafter-for-change-streams + */ + resumeAfter?: ResumeToken; + /** + * Similar to resumeAfter, but will allow you to start after an invalidated event. + * @see https://docs.mongodb.com/manual/changeStreams/#startafter-for-change-streams + */ + startAfter?: ResumeToken; + /** Will start the changeStream after the specified operationTime. */ + startAtOperationTime?: OperationTime; + /** + * The number of documents to return per batch. + * @see https://docs.mongodb.com/manual/reference/command/aggregate + */ + batchSize?: number; + /** + * When enabled, configures the change stream to include extra change events. + * + * - createIndexes + * - dropIndexes + * - modify + * - create + * - shardCollection + * - reshardCollection + * - refineCollectionShardKey + */ + showExpandedEvents?: boolean; +} + +/** + * @public + * @see https://www.mongodb.com/docs/manual/reference/change-events/ + */ +export declare interface ChangeStreamRefineCollectionShardKeyDocument extends ChangeStreamDocumentCommon, ChangeStreamDocumentCollectionUUID, ChangeStreamDocumentOperationDescription { + /** Describes the type of operation represented in this change notification */ + operationType: 'refineCollectionShardKey'; +} + +/** + * @public + * @see https://www.mongodb.com/docs/manual/reference/change-events/#rename-event + */ +export declare interface ChangeStreamRenameDocument extends ChangeStreamDocumentCommon, ChangeStreamDocumentCollectionUUID { + /** Describes the type of operation represented in this change notification */ + operationType: 'rename'; + /** The new name for the `ns.coll` collection */ + to: { + db: string; + coll: string; + }; + /** The "from" namespace that the rename occured on */ + ns: ChangeStreamNameSpace; +} + +/** + * @public + * @see https://www.mongodb.com/docs/manual/reference/change-events/#replace-event + */ +export declare interface ChangeStreamReplaceDocument extends ChangeStreamDocumentCommon, ChangeStreamDocumentKey { + /** Describes the type of operation represented in this change notification */ + operationType: 'replace'; + /** The fullDocument of a replace event represents the document after the insert of the replacement document */ + fullDocument: TSchema; + /** Namespace the replace event occured on */ + ns: ChangeStreamNameSpace; + /** + * Contains the pre-image of the modified or deleted document if the + * pre-image is available for the change event and either 'required' or + * 'whenAvailable' was specified for the 'fullDocumentBeforeChange' option + * when creating the change stream. If 'whenAvailable' was specified but the + * pre-image is unavailable, this will be explicitly set to null. + */ + fullDocumentBeforeChange?: TSchema; +} + +/** + * @public + * @see https://www.mongodb.com/docs/manual/reference/change-events/ + */ +export declare interface ChangeStreamReshardCollectionDocument extends ChangeStreamDocumentCommon, ChangeStreamDocumentCollectionUUID, ChangeStreamDocumentOperationDescription { + /** Describes the type of operation represented in this change notification */ + operationType: 'reshardCollection'; +} + +/** + * @public + * @see https://www.mongodb.com/docs/manual/reference/change-events/ + */ +export declare interface ChangeStreamShardCollectionDocument extends ChangeStreamDocumentCommon, ChangeStreamDocumentCollectionUUID, ChangeStreamDocumentOperationDescription { + /** Describes the type of operation represented in this change notification */ + operationType: 'shardCollection'; +} + +/** + * @public + * @see https://www.mongodb.com/docs/manual/reference/change-events/#update-event + */ +export declare interface ChangeStreamUpdateDocument extends ChangeStreamDocumentCommon, ChangeStreamDocumentKey, ChangeStreamDocumentCollectionUUID { + /** Describes the type of operation represented in this change notification */ + operationType: 'update'; + /** + * This is only set if `fullDocument` is set to `'updateLookup'` + * Contains the point-in-time post-image of the modified document if the + * post-image is available and either 'required' or 'whenAvailable' was + * specified for the 'fullDocument' option when creating the change stream. + */ + fullDocument?: TSchema; + /** Contains a description of updated and removed fields in this operation */ + updateDescription: UpdateDescription; + /** Namespace the update event occured on */ + ns: ChangeStreamNameSpace; + /** + * Contains the pre-image of the modified or deleted document if the + * pre-image is available for the change event and either 'required' or + * 'whenAvailable' was specified for the 'fullDocumentBeforeChange' option + * when creating the change stream. If 'whenAvailable' was specified but the + * pre-image is unavailable, this will be explicitly set to null. + */ + fullDocumentBeforeChange?: TSchema; +} + +/** @public */ +export declare interface ClientMetadata { + driver: { + name: string; + version: string; + }; + os: { + type: string; + name: NodeJS.Platform; + architecture: string; + version: string; + }; + platform: string; + version?: string; + application?: { + name: string; + }; +} + +/** @public */ +export declare interface ClientMetadataOptions { + driverInfo?: { + name?: string; + version?: string; + platform?: string; + }; + appName?: string; +} + +/** + * A class representing a client session on the server + * + * NOTE: not meant to be instantiated directly. + * @public + */ +export declare class ClientSession extends TypedEventEmitter { + /* Excluded from this release type: client */ + /* Excluded from this release type: sessionPool */ + hasEnded: boolean; + clientOptions?: MongoOptions; + supports: { + causalConsistency: boolean; + }; + clusterTime?: ClusterTime; + operationTime?: Timestamp; + explicit: boolean; + /* Excluded from this release type: owner */ + defaultTransactionOptions: TransactionOptions; + transaction: Transaction; + /* Excluded from this release type: [kServerSession] */ + /* Excluded from this release type: [kSnapshotTime] */ + /* Excluded from this release type: [kSnapshotEnabled] */ + /* Excluded from this release type: [kPinnedConnection] */ + /* Excluded from this release type: [kTxnNumberIncrement] */ + /* Excluded from this release type: __constructor */ + /** The server id associated with this session */ + get id(): ServerSessionId | undefined; + get serverSession(): ServerSession; + /** Whether or not this session is configured for snapshot reads */ + get snapshotEnabled(): boolean; + get loadBalanced(): boolean; + /* Excluded from this release type: pinnedConnection */ + /* Excluded from this release type: pin */ + /* Excluded from this release type: unpin */ + get isPinned(): boolean; + /** + * Ends this session on the server + * + * @param options - Optional settings. Currently reserved for future use + * @param callback - Optional callback for completion of this operation + */ + endSession(): Promise; + endSession(callback: Callback): void; + endSession(options: EndSessionOptions): Promise; + endSession(options: EndSessionOptions, callback: Callback): void; + /** + * Advances the operationTime for a ClientSession. + * + * @param operationTime - the `BSON.Timestamp` of the operation type it is desired to advance to + */ + advanceOperationTime(operationTime: Timestamp): void; + /** + * Advances the clusterTime for a ClientSession to the provided clusterTime of another ClientSession + * + * @param clusterTime - the $clusterTime returned by the server from another session in the form of a document containing the `BSON.Timestamp` clusterTime and signature + */ + advanceClusterTime(clusterTime: ClusterTime): void; + /** + * Used to determine if this session equals another + * + * @param session - The session to compare to + */ + equals(session: ClientSession): boolean; + /** + * Increment the transaction number on the internal ServerSession + * + * @privateRemarks + * This helper increments a value stored on the client session that will be + * added to the serverSession's txnNumber upon applying it to a command. + * This is because the serverSession is lazily acquired after a connection is obtained + */ + incrementTransactionNumber(): void; + /** @returns whether this session is currently in a transaction or not */ + inTransaction(): boolean; + /** + * Starts a new transaction with the given options. + * + * @param options - Options for the transaction + */ + startTransaction(options?: TransactionOptions): void; + /** + * Commits the currently active transaction in this session. + * + * @param callback - An optional callback, a Promise will be returned if none is provided + */ + commitTransaction(): Promise; + commitTransaction(callback: Callback): void; + /** + * Aborts the currently active transaction in this session. + * + * @param callback - An optional callback, a Promise will be returned if none is provided + */ + abortTransaction(): Promise; + abortTransaction(callback: Callback): void; + /** + * This is here to ensure that ClientSession is never serialized to BSON. + */ + toBSON(): never; + /** + * Runs a provided callback within a transaction, retrying either the commitTransaction operation + * or entire transaction as needed (and when the error permits) to better ensure that + * the transaction can complete successfully. + * + * **IMPORTANT:** This method requires the user to return a Promise, and `await` all operations. + * Any callbacks that do not return a Promise will result in undefined behavior. + * + * @remarks + * This function: + * - Will return the command response from the final commitTransaction if every operation is successful (can be used as a truthy object) + * - Will return `undefined` if the transaction is explicitly aborted with `await session.abortTransaction()` + * - Will throw if one of the operations throws or `throw` statement is used inside the `withTransaction` callback + * + * Checkout a descriptive example here: + * @see https://www.mongodb.com/developer/quickstart/node-transactions/ + * + * @param fn - callback to run within a transaction + * @param options - optional settings for the transaction + * @returns A raw command response or undefined + */ + withTransaction(fn: WithTransactionCallback, options?: TransactionOptions): Promise; +} + +/** @public */ +export declare type ClientSessionEvents = { + ended(session: ClientSession): void; +}; + +/** @public */ +export declare interface ClientSessionOptions { + /** Whether causal consistency should be enabled on this session */ + causalConsistency?: boolean; + /** Whether all read operations should be read from the same snapshot for this session (NOTE: not compatible with `causalConsistency=true`) */ + snapshot?: boolean; + /** The default TransactionOptions to use for transactions started on this session. */ + defaultTransactionOptions?: TransactionOptions; + /* Excluded from this release type: owner */ + /* Excluded from this release type: explicit */ + /* Excluded from this release type: initialClusterTime */ +} + +/** @public */ +export declare interface CloseOptions { + force?: boolean; +} + +/** @public + * Configuration options for clustered collections + * TODO: NODE-4230 replace with normal manual link once it is on there. + * @see https://www.mongodb.com/docs/v5.3/core/clustered-collections/ + */ +export declare interface ClusteredCollectionOptions extends Document { + name?: string; + key: Document; + unique: boolean; +} + +/** @public */ +export declare interface ClusterTime { + clusterTime: Timestamp; + signature: { + hash: Binary; + keyId: Long; + }; +} + +export { Code } + +/** @public */ +export declare interface CollationOptions { + locale: string; + caseLevel?: boolean; + caseFirst?: string; + strength?: number; + numericOrdering?: boolean; + alternate?: string; + maxVariable?: string; + backwards?: boolean; + normalization?: boolean; +} + +/** + * The **Collection** class is an internal class that embodies a MongoDB collection + * allowing for insert/update/remove/find and other command operation on that MongoDB collection. + * + * **COLLECTION Cannot directly be instantiated** + * @public + * + * @example + * ```js + * const MongoClient = require('mongodb').MongoClient; + * const test = require('assert'); + * // Connection url + * const url = 'mongodb://localhost:27017'; + * // Database Name + * const dbName = 'test'; + * // Connect using MongoClient + * MongoClient.connect(url, function(err, client) { + * // Create a collection we want to drop later + * const col = client.db(dbName).collection('createIndexExample1'); + * // Show that duplicate records got dropped + * col.find({}).toArray(function(err, items) { + * expect(err).to.not.exist; + * test.equal(4, items.length); + * client.close(); + * }); + * }); + * ``` + */ +export declare class Collection { + /* Excluded from this release type: s */ + /* Excluded from this release type: __constructor */ + /** + * The name of the database this collection belongs to + */ + get dbName(): string; + /** + * The name of this collection + */ + get collectionName(): string; + /** + * The namespace of this collection, in the format `${this.dbName}.${this.collectionName}` + */ + get namespace(): string; + /** + * The current readConcern of the collection. If not explicitly defined for + * this collection, will be inherited from the parent DB + */ + get readConcern(): ReadConcern | undefined; + /** + * The current readPreference of the collection. If not explicitly defined for + * this collection, will be inherited from the parent DB + */ + get readPreference(): ReadPreference | undefined; + get bsonOptions(): BSONSerializeOptions; + /** + * The current writeConcern of the collection. If not explicitly defined for + * this collection, will be inherited from the parent DB + */ + get writeConcern(): WriteConcern | undefined; + /** The current index hint for the collection */ + get hint(): Hint | undefined; + set hint(v: Hint | undefined); + /** + * Inserts a single document into MongoDB. If documents passed in do not contain the **_id** field, + * one will be added to each of the documents missing it by the driver, mutating the document. This behavior + * can be overridden by setting the **forceServerObjectId** flag. + * + * @param doc - The document to insert + * @param options - Optional settings for the command + * @param callback - An optional callback, a Promise will be returned if none is provided + */ + insertOne(doc: OptionalUnlessRequiredId): Promise>; + insertOne(doc: OptionalUnlessRequiredId, callback: Callback>): void; + insertOne(doc: OptionalUnlessRequiredId, options: InsertOneOptions): Promise>; + insertOne(doc: OptionalUnlessRequiredId, options: InsertOneOptions, callback: Callback>): void; + /** + * Inserts an array of documents into MongoDB. If documents passed in do not contain the **_id** field, + * one will be added to each of the documents missing it by the driver, mutating the document. This behavior + * can be overridden by setting the **forceServerObjectId** flag. + * + * @param docs - The documents to insert + * @param options - Optional settings for the command + * @param callback - An optional callback, a Promise will be returned if none is provided + */ + insertMany(docs: OptionalUnlessRequiredId[]): Promise>; + insertMany(docs: OptionalUnlessRequiredId[], callback: Callback>): void; + insertMany(docs: OptionalUnlessRequiredId[], options: BulkWriteOptions): Promise>; + insertMany(docs: OptionalUnlessRequiredId[], options: BulkWriteOptions, callback: Callback>): void; + /** + * Perform a bulkWrite operation without a fluent API + * + * Legal operation types are + * + * ```js + * { insertOne: { document: { a: 1 } } } + * + * { updateOne: { filter: {a:2}, update: {$set: {a:2}}, upsert:true } } + * + * { updateMany: { filter: {a:2}, update: {$set: {a:2}}, upsert:true } } + * + * { updateMany: { filter: {}, update: {$set: {"a.$[i].x": 5}}, arrayFilters: [{ "i.x": 5 }]} } + * + * { deleteOne: { filter: {c:1} } } + * + * { deleteMany: { filter: {c:1} } } + * + * { replaceOne: { filter: {c:3}, replacement: {c:4}, upsert:true} } + *``` + * Please note that raw operations are no longer accepted as of driver version 4.0. + * + * If documents passed in do not contain the **_id** field, + * one will be added to each of the documents missing it by the driver, mutating the document. This behavior + * can be overridden by setting the **forceServerObjectId** flag. + * + * @param operations - Bulk operations to perform + * @param options - Optional settings for the command + * @param callback - An optional callback, a Promise will be returned if none is provided + * @throws MongoDriverError if operations is not an array + */ + bulkWrite(operations: AnyBulkWriteOperation[]): Promise; + bulkWrite(operations: AnyBulkWriteOperation[], callback: Callback): void; + bulkWrite(operations: AnyBulkWriteOperation[], options: BulkWriteOptions): Promise; + bulkWrite(operations: AnyBulkWriteOperation[], options: BulkWriteOptions, callback: Callback): void; + /** + * Update a single document in a collection + * + * @param filter - The filter used to select the document to update + * @param update - The update operations to be applied to the document + * @param options - Optional settings for the command + * @param callback - An optional callback, a Promise will be returned if none is provided + */ + updateOne(filter: Filter, update: UpdateFilter | Partial): Promise; + updateOne(filter: Filter, update: UpdateFilter | Partial, callback: Callback): void; + updateOne(filter: Filter, update: UpdateFilter | Partial, options: UpdateOptions): Promise; + updateOne(filter: Filter, update: UpdateFilter | Partial, options: UpdateOptions, callback: Callback): void; + /** + * Replace a document in a collection with another document + * + * @param filter - The filter used to select the document to replace + * @param replacement - The Document that replaces the matching document + * @param options - Optional settings for the command + * @param callback - An optional callback, a Promise will be returned if none is provided + */ + replaceOne(filter: Filter, replacement: WithoutId): Promise; + replaceOne(filter: Filter, replacement: WithoutId, callback: Callback): void; + replaceOne(filter: Filter, replacement: WithoutId, options: ReplaceOptions): Promise; + replaceOne(filter: Filter, replacement: WithoutId, options: ReplaceOptions, callback: Callback): void; + /** + * Update multiple documents in a collection + * + * @param filter - The filter used to select the documents to update + * @param update - The update operations to be applied to the documents + * @param options - Optional settings for the command + * @param callback - An optional callback, a Promise will be returned if none is provided + */ + updateMany(filter: Filter, update: UpdateFilter): Promise; + updateMany(filter: Filter, update: UpdateFilter, callback: Callback): void; + updateMany(filter: Filter, update: UpdateFilter, options: UpdateOptions): Promise; + updateMany(filter: Filter, update: UpdateFilter, options: UpdateOptions, callback: Callback): void; + /** + * Delete a document from a collection + * + * @param filter - The filter used to select the document to remove + * @param options - Optional settings for the command + * @param callback - An optional callback, a Promise will be returned if none is provided + */ + deleteOne(filter: Filter): Promise; + deleteOne(filter: Filter, callback: Callback): void; + deleteOne(filter: Filter, options: DeleteOptions): Promise; + deleteOne(filter: Filter, options: DeleteOptions, callback?: Callback): void; + /** + * Delete multiple documents from a collection + * + * @param filter - The filter used to select the documents to remove + * @param options - Optional settings for the command + * @param callback - An optional callback, a Promise will be returned if none is provided + */ + deleteMany(filter: Filter): Promise; + deleteMany(filter: Filter, callback: Callback): void; + deleteMany(filter: Filter, options: DeleteOptions): Promise; + deleteMany(filter: Filter, options: DeleteOptions, callback: Callback): void; + /** + * Rename the collection. + * + * @remarks + * This operation does not inherit options from the Db or MongoClient. + * + * @param newName - New name of of the collection. + * @param options - Optional settings for the command + * @param callback - An optional callback, a Promise will be returned if none is provided + */ + rename(newName: string): Promise; + rename(newName: string, callback: Callback): void; + rename(newName: string, options: RenameOptions): Promise; + rename(newName: string, options: RenameOptions, callback: Callback): void; + /** + * Drop the collection from the database, removing it permanently. New accesses will create a new collection. + * + * @param options - Optional settings for the command + * @param callback - An optional callback, a Promise will be returned if none is provided + */ + drop(): Promise; + drop(callback: Callback): void; + drop(options: DropCollectionOptions): Promise; + drop(options: DropCollectionOptions, callback: Callback): void; + /** + * Fetches the first document that matches the filter + * + * @param filter - Query for find Operation + * @param options - Optional settings for the command + * @param callback - An optional callback, a Promise will be returned if none is provided + */ + findOne(): Promise | null>; + findOne(callback: Callback | null>): void; + findOne(filter: Filter): Promise | null>; + findOne(filter: Filter, callback: Callback | null>): void; + findOne(filter: Filter, options: FindOptions): Promise | null>; + findOne(filter: Filter, options: FindOptions, callback: Callback | null>): void; + findOne(): Promise; + findOne(callback: Callback): void; + findOne(filter: Filter): Promise; + findOne(filter: Filter, options?: FindOptions): Promise; + findOne(filter: Filter, options?: FindOptions, callback?: Callback): void; + /** + * Creates a cursor for a filter that can be used to iterate over results from MongoDB + * + * @param filter - The filter predicate. If unspecified, then all documents in the collection will match the predicate + */ + find(): FindCursor>; + find(filter: Filter, options?: FindOptions): FindCursor>; + find(filter: Filter, options?: FindOptions): FindCursor; + /** + * Returns the options of the collection. + * + * @param options - Optional settings for the command + * @param callback - An optional callback, a Promise will be returned if none is provided + */ + options(): Promise; + options(callback: Callback): void; + options(options: OperationOptions): Promise; + options(options: OperationOptions, callback: Callback): void; + /** + * Returns if the collection is a capped collection + * + * @param options - Optional settings for the command + * @param callback - An optional callback, a Promise will be returned if none is provided + */ + isCapped(): Promise; + isCapped(callback: Callback): void; + isCapped(options: OperationOptions): Promise; + isCapped(options: OperationOptions, callback: Callback): void; + /** + * Creates an index on the db and collection collection. + * + * @param indexSpec - The field name or index specification to create an index for + * @param options - Optional settings for the command + * @param callback - An optional callback, a Promise will be returned if none is provided + * + * @example + * ```js + * const collection = client.db('foo').collection('bar'); + * + * await collection.createIndex({ a: 1, b: -1 }); + * + * // Alternate syntax for { c: 1, d: -1 } that ensures order of indexes + * await collection.createIndex([ [c, 1], [d, -1] ]); + * + * // Equivalent to { e: 1 } + * await collection.createIndex('e'); + * + * // Equivalent to { f: 1, g: 1 } + * await collection.createIndex(['f', 'g']) + * + * // Equivalent to { h: 1, i: -1 } + * await collection.createIndex([ { h: 1 }, { i: -1 } ]); + * + * // Equivalent to { j: 1, k: -1, l: 2d } + * await collection.createIndex(['j', ['k', -1], { l: '2d' }]) + * ``` + */ + createIndex(indexSpec: IndexSpecification): Promise; + createIndex(indexSpec: IndexSpecification, callback: Callback): void; + createIndex(indexSpec: IndexSpecification, options: CreateIndexesOptions): Promise; + createIndex(indexSpec: IndexSpecification, options: CreateIndexesOptions, callback: Callback): void; + /** + * Creates multiple indexes in the collection, this method is only supported for + * MongoDB 2.6 or higher. Earlier version of MongoDB will throw a command not supported + * error. + * + * **Note**: Unlike {@link Collection#createIndex| createIndex}, this function takes in raw index specifications. + * Index specifications are defined {@link http://docs.mongodb.org/manual/reference/command/createIndexes/| here}. + * + * @param indexSpecs - An array of index specifications to be created + * @param options - Optional settings for the command + * @param callback - An optional callback, a Promise will be returned if none is provided + * + * @example + * ```js + * const collection = client.db('foo').collection('bar'); + * await collection.createIndexes([ + * // Simple index on field fizz + * { + * key: { fizz: 1 }, + * } + * // wildcard index + * { + * key: { '$**': 1 } + * }, + * // named index on darmok and jalad + * { + * key: { darmok: 1, jalad: -1 } + * name: 'tanagra' + * } + * ]); + * ``` + */ + createIndexes(indexSpecs: IndexDescription[]): Promise; + createIndexes(indexSpecs: IndexDescription[], callback: Callback): void; + createIndexes(indexSpecs: IndexDescription[], options: CreateIndexesOptions): Promise; + createIndexes(indexSpecs: IndexDescription[], options: CreateIndexesOptions, callback: Callback): void; + /** + * Drops an index from this collection. + * + * @param indexName - Name of the index to drop. + * @param options - Optional settings for the command + * @param callback - An optional callback, a Promise will be returned if none is provided + */ + dropIndex(indexName: string): Promise; + dropIndex(indexName: string, callback: Callback): void; + dropIndex(indexName: string, options: DropIndexesOptions): Promise; + dropIndex(indexName: string, options: DropIndexesOptions, callback: Callback): void; + /** + * Drops all indexes from this collection. + * + * @param options - Optional settings for the command + * @param callback - An optional callback, a Promise will be returned if none is provided + */ + dropIndexes(): Promise; + dropIndexes(callback: Callback): void; + dropIndexes(options: DropIndexesOptions): Promise; + dropIndexes(options: DropIndexesOptions, callback: Callback): void; + /** + * Get the list of all indexes information for the collection. + * + * @param options - Optional settings for the command + */ + listIndexes(options?: ListIndexesOptions): ListIndexesCursor; + /** + * Checks if one or more indexes exist on the collection, fails on first non-existing index + * + * @param indexes - One or more index names to check. + * @param options - Optional settings for the command + * @param callback - An optional callback, a Promise will be returned if none is provided + */ + indexExists(indexes: string | string[]): Promise; + indexExists(indexes: string | string[], callback: Callback): void; + indexExists(indexes: string | string[], options: IndexInformationOptions): Promise; + indexExists(indexes: string | string[], options: IndexInformationOptions, callback: Callback): void; + /** + * Retrieves this collections index info. + * + * @param options - Optional settings for the command + * @param callback - An optional callback, a Promise will be returned if none is provided + */ + indexInformation(): Promise; + indexInformation(callback: Callback): void; + indexInformation(options: IndexInformationOptions): Promise; + indexInformation(options: IndexInformationOptions, callback: Callback): void; + /** + * Gets an estimate of the count of documents in a collection using collection metadata. + * This will always run a count command on all server versions. + * + * due to an oversight in versions 5.0.0-5.0.8 of MongoDB, the count command, + * which estimatedDocumentCount uses in its implementation, was not included in v1 of + * the Stable API, and so users of the Stable API with estimatedDocumentCount are + * recommended to upgrade their server version to 5.0.9+ or set apiStrict: false to avoid + * encountering errors. + * + * @see {@link https://www.mongodb.com/docs/manual/reference/command/count/#behavior|Count: Behavior} + * @param options - Optional settings for the command + * @param callback - An optional callback, a Promise will be returned if none is provided + */ + estimatedDocumentCount(): Promise; + estimatedDocumentCount(callback: Callback): void; + estimatedDocumentCount(options: EstimatedDocumentCountOptions): Promise; + estimatedDocumentCount(options: EstimatedDocumentCountOptions, callback: Callback): void; + /** + * Gets the number of documents matching the filter. + * For a fast count of the total documents in a collection see {@link Collection#estimatedDocumentCount| estimatedDocumentCount}. + * **Note**: When migrating from {@link Collection#count| count} to {@link Collection#countDocuments| countDocuments} + * the following query operators must be replaced: + * + * | Operator | Replacement | + * | -------- | ----------- | + * | `$where` | [`$expr`][1] | + * | `$near` | [`$geoWithin`][2] with [`$center`][3] | + * | `$nearSphere` | [`$geoWithin`][2] with [`$centerSphere`][4] | + * + * [1]: https://docs.mongodb.com/manual/reference/operator/query/expr/ + * [2]: https://docs.mongodb.com/manual/reference/operator/query/geoWithin/ + * [3]: https://docs.mongodb.com/manual/reference/operator/query/center/#op._S_center + * [4]: https://docs.mongodb.com/manual/reference/operator/query/centerSphere/#op._S_centerSphere + * + * @param filter - The filter for the count + * @param options - Optional settings for the command + * @param callback - An optional callback, a Promise will be returned if none is provided + * + * @see https://docs.mongodb.com/manual/reference/operator/query/expr/ + * @see https://docs.mongodb.com/manual/reference/operator/query/geoWithin/ + * @see https://docs.mongodb.com/manual/reference/operator/query/center/#op._S_center + * @see https://docs.mongodb.com/manual/reference/operator/query/centerSphere/#op._S_centerSphere + */ + countDocuments(): Promise; + countDocuments(callback: Callback): void; + countDocuments(filter: Filter): Promise; + countDocuments(callback: Callback): void; + countDocuments(filter: Filter, options: CountDocumentsOptions): Promise; + countDocuments(filter: Filter, options: CountDocumentsOptions, callback: Callback): void; + countDocuments(filter: Filter, callback: Callback): void; + /** + * The distinct command returns a list of distinct values for the given key across a collection. + * + * @param key - Field of the document to find distinct values for + * @param filter - The filter for filtering the set of documents to which we apply the distinct filter. + * @param options - Optional settings for the command + * @param callback - An optional callback, a Promise will be returned if none is provided + */ + distinct>(key: Key): Promise[Key]>>>; + distinct>(key: Key, callback: Callback[Key]>>>): void; + distinct>(key: Key, filter: Filter): Promise[Key]>>>; + distinct>(key: Key, filter: Filter, callback: Callback[Key]>>>): void; + distinct>(key: Key, filter: Filter, options: DistinctOptions): Promise[Key]>>>; + distinct>(key: Key, filter: Filter, options: DistinctOptions, callback: Callback[Key]>>>): void; + distinct(key: string): Promise; + distinct(key: string, callback: Callback): void; + distinct(key: string, filter: Filter): Promise; + distinct(key: string, filter: Filter, callback: Callback): void; + distinct(key: string, filter: Filter, options: DistinctOptions): Promise; + distinct(key: string, filter: Filter, options: DistinctOptions, callback: Callback): void; + /** + * Retrieve all the indexes on the collection. + * + * @param options - Optional settings for the command + * @param callback - An optional callback, a Promise will be returned if none is provided + */ + indexes(): Promise; + indexes(callback: Callback): void; + indexes(options: IndexInformationOptions): Promise; + indexes(options: IndexInformationOptions, callback: Callback): void; + /** + * Get all the collection statistics. + * + * @param options - Optional settings for the command + * @param callback - An optional callback, a Promise will be returned if none is provided + */ + stats(): Promise; + stats(callback: Callback): void; + stats(options: CollStatsOptions): Promise; + stats(options: CollStatsOptions, callback: Callback): void; + /** + * Find a document and delete it in one atomic operation. Requires a write lock for the duration of the operation. + * + * @param filter - The filter used to select the document to remove + * @param options - Optional settings for the command + * @param callback - An optional callback, a Promise will be returned if none is provided + */ + findOneAndDelete(filter: Filter): Promise>; + findOneAndDelete(filter: Filter, options: FindOneAndDeleteOptions): Promise>; + findOneAndDelete(filter: Filter, callback: Callback>): void; + findOneAndDelete(filter: Filter, options: FindOneAndDeleteOptions, callback: Callback>): void; + /** + * Find a document and replace it in one atomic operation. Requires a write lock for the duration of the operation. + * + * @param filter - The filter used to select the document to replace + * @param replacement - The Document that replaces the matching document + * @param options - Optional settings for the command + * @param callback - An optional callback, a Promise will be returned if none is provided + */ + findOneAndReplace(filter: Filter, replacement: WithoutId): Promise>; + findOneAndReplace(filter: Filter, replacement: WithoutId, callback: Callback>): void; + findOneAndReplace(filter: Filter, replacement: WithoutId, options: FindOneAndReplaceOptions): Promise>; + findOneAndReplace(filter: Filter, replacement: WithoutId, options: FindOneAndReplaceOptions, callback: Callback>): void; + /** + * Find a document and update it in one atomic operation. Requires a write lock for the duration of the operation. + * + * @param filter - The filter used to select the document to update + * @param update - Update operations to be performed on the document + * @param options - Optional settings for the command + * @param callback - An optional callback, a Promise will be returned if none is provided + */ + findOneAndUpdate(filter: Filter, update: UpdateFilter): Promise>; + findOneAndUpdate(filter: Filter, update: UpdateFilter, callback: Callback>): void; + findOneAndUpdate(filter: Filter, update: UpdateFilter, options: FindOneAndUpdateOptions): Promise>; + findOneAndUpdate(filter: Filter, update: UpdateFilter, options: FindOneAndUpdateOptions, callback: Callback>): void; + /** + * Execute an aggregation framework pipeline against the collection, needs MongoDB \>= 2.2 + * + * @param pipeline - An array of aggregation pipelines to execute + * @param options - Optional settings for the command + */ + aggregate(pipeline?: Document[], options?: AggregateOptions): AggregationCursor; + /** + * Create a new Change Stream, watching for new changes (insertions, updates, replacements, deletions, and invalidations) in this collection. + * + * @remarks + * watch() accepts two generic arguments for distinct usecases: + * - The first is to override the schema that may be defined for this specific collection + * - The second is to override the shape of the change stream document entirely, if it is not provided the type will default to ChangeStreamDocument of the first argument + * @example + * By just providing the first argument I can type the change to be `ChangeStreamDocument<{ _id: number }>` + * ```ts + * collection.watch<{ _id: number }>() + * .on('change', change => console.log(change._id.toFixed(4))); + * ``` + * + * @example + * Passing a second argument provides a way to reflect the type changes caused by an advanced pipeline. + * Here, we are using a pipeline to have MongoDB filter for insert changes only and add a comment. + * No need start from scratch on the ChangeStreamInsertDocument type! + * By using an intersection we can save time and ensure defaults remain the same type! + * ```ts + * collection + * .watch & { comment: string }>([ + * { $addFields: { comment: 'big changes' } }, + * { $match: { operationType: 'insert' } } + * ]) + * .on('change', change => { + * change.comment.startsWith('big'); + * change.operationType === 'insert'; + * // No need to narrow in code because the generics did that for us! + * expectType(change.fullDocument); + * }); + * ``` + * + * @param pipeline - An array of {@link https://docs.mongodb.com/manual/reference/operator/aggregation-pipeline/|aggregation pipeline stages} through which to pass change stream documents. This allows for filtering (using $match) and manipulating the change stream documents. + * @param options - Optional settings for the command + * @typeParam TLocal - Type of the data being detected by the change stream + * @typeParam TChange - Type of the whole change stream document emitted + */ + watch>(pipeline?: Document[], options?: ChangeStreamOptions): ChangeStream; + /** + * Run Map Reduce across a collection. Be aware that the inline option for out will return an array of results not a collection. + * + * @deprecated collection.mapReduce is deprecated. Use the aggregation pipeline instead. Visit https://docs.mongodb.com/manual/reference/map-reduce-to-aggregation-pipeline for more information on how to translate map-reduce operations to the aggregation pipeline. + * @param map - The mapping function. + * @param reduce - The reduce function. + * @param options - Optional settings for the command + * @param callback - An optional callback, a Promise will be returned if none is provided + */ + mapReduce(map: string | MapFunction, reduce: string | ReduceFunction): Promise; + mapReduce(map: string | MapFunction, reduce: string | ReduceFunction, callback: Callback): void; + mapReduce(map: string | MapFunction, reduce: string | ReduceFunction, options: MapReduceOptions): Promise; + mapReduce(map: string | MapFunction, reduce: string | ReduceFunction, options: MapReduceOptions, callback: Callback): void; + /** Initiate an Out of order batch write operation. All operations will be buffered into insert/update/remove commands executed out of order. */ + initializeUnorderedBulkOp(options?: BulkWriteOptions): UnorderedBulkOperation; + /** Initiate an In order bulk write operation. Operations will be serially executed in the order they are added, creating a new operation for each switch in types. */ + initializeOrderedBulkOp(options?: BulkWriteOptions): OrderedBulkOperation; + /** Get the db scoped logger */ + getLogger(): Logger; + get logger(): Logger; + /** + * Inserts a single document or a an array of documents into MongoDB. If documents passed in do not contain the **_id** field, + * one will be added to each of the documents missing it by the driver, mutating the document. This behavior + * can be overridden by setting the **forceServerObjectId** flag. + * + * @deprecated Use insertOne, insertMany or bulkWrite instead. + * @param docs - The documents to insert + * @param options - Optional settings for the command + * @param callback - An optional callback, a Promise will be returned if none is provided + */ + insert(docs: OptionalUnlessRequiredId[], options: BulkWriteOptions, callback: Callback>): Promise> | void; + /** + * Updates documents. + * + * @deprecated use updateOne, updateMany or bulkWrite + * @param selector - The selector for the update operation. + * @param update - The update operations to be applied to the documents + * @param options - Optional settings for the command + * @param callback - An optional callback, a Promise will be returned if none is provided + */ + update(selector: Filter, update: UpdateFilter, options: UpdateOptions, callback: Callback): Promise | void; + /** + * Remove documents. + * + * @deprecated use deleteOne, deleteMany or bulkWrite + * @param selector - The selector for the update operation. + * @param options - Optional settings for the command + * @param callback - An optional callback, a Promise will be returned if none is provided + */ + remove(selector: Filter, options: DeleteOptions, callback: Callback): Promise | void; + /** + * An estimated count of matching documents in the db to a filter. + * + * **NOTE:** This method has been deprecated, since it does not provide an accurate count of the documents + * in a collection. To obtain an accurate count of documents in the collection, use {@link Collection#countDocuments| countDocuments}. + * To obtain an estimated count of all documents in the collection, use {@link Collection#estimatedDocumentCount| estimatedDocumentCount}. + * + * @deprecated use {@link Collection#countDocuments| countDocuments} or {@link Collection#estimatedDocumentCount| estimatedDocumentCount} instead + * + * @param filter - The filter for the count. + * @param options - Optional settings for the command + * @param callback - An optional callback, a Promise will be returned if none is provided + */ + count(): Promise; + count(callback: Callback): void; + count(filter: Filter): Promise; + count(filter: Filter, callback: Callback): void; + count(filter: Filter, options: CountOptions): Promise; + count(filter: Filter, options: CountOptions, callback: Callback): Promise | void; +} + +/** @public */ +export declare interface CollectionInfo extends Document { + name: string; + type?: string; + options?: Document; + info?: { + readOnly?: false; + uuid?: Binary; + }; + idIndex?: Document; +} + +/** @public */ +export declare interface CollectionOptions extends BSONSerializeOptions, WriteConcernOptions, LoggerOptions { + /** + * @deprecated Use readPreference instead + */ + slaveOk?: boolean; + /** Specify a read concern for the collection. (only MongoDB 3.2 or higher supported) */ + readConcern?: ReadConcernLike; + /** The preferred read preference (ReadPreference.PRIMARY, ReadPreference.PRIMARY_PREFERRED, ReadPreference.SECONDARY, ReadPreference.SECONDARY_PREFERRED, ReadPreference.NEAREST). */ + readPreference?: ReadPreferenceLike; +} + +/* Excluded from this release type: CollectionPrivate */ + +/** + * @public + * @see https://docs.mongodb.org/manual/reference/command/collStats/ + */ +export declare interface CollStats extends Document { + /** Namespace */ + ns: string; + /** Number of documents */ + count: number; + /** Collection size in bytes */ + size: number; + /** Average object size in bytes */ + avgObjSize: number; + /** (Pre)allocated space for the collection in bytes */ + storageSize: number; + /** Number of extents (contiguously allocated chunks of datafile space) */ + numExtents: number; + /** Number of indexes */ + nindexes: number; + /** Size of the most recently created extent in bytes */ + lastExtentSize: number; + /** Padding can speed up updates if documents grow */ + paddingFactor: number; + /** A number that indicates the user-set flags on the collection. userFlags only appears when using the mmapv1 storage engine */ + userFlags?: number; + /** Total index size in bytes */ + totalIndexSize: number; + /** Size of specific indexes in bytes */ + indexSizes: { + _id_: number; + [index: string]: number; + }; + /** `true` if the collection is capped */ + capped: boolean; + /** The maximum number of documents that may be present in a capped collection */ + max: number; + /** The maximum size of a capped collection */ + maxSize: number; + /** This document contains data reported directly by the WiredTiger engine and other data for internal diagnostic use */ + wiredTiger?: WiredTigerData; + /** The fields in this document are the names of the indexes, while the values themselves are documents that contain statistics for the index provided by the storage engine */ + indexDetails?: any; + ok: number; + /** The amount of storage available for reuse. The scale argument affects this value. */ + freeStorageSize?: number; + /** An array that contains the names of the indexes that are currently being built on the collection */ + indexBuilds?: number; + /** The sum of the storageSize and totalIndexSize. The scale argument affects this value */ + totalSize: number; + /** The scale value used by the command. */ + scaleFactor: number; +} + +/** @public */ +export declare interface CollStatsOptions extends CommandOperationOptions { + /** Divide the returned sizes by scale value. */ + scale?: number; +} + +/** + * An event indicating the failure of a given command + * @public + * @category Event + */ +export declare class CommandFailedEvent { + address: string; + connectionId?: string | number; + requestId: number; + duration: number; + commandName: string; + failure: Error; + serviceId?: ObjectId; + /* Excluded from this release type: __constructor */ + get hasServiceId(): boolean; +} + +/* Excluded from this release type: CommandOperation */ + +/** @public */ +export declare interface CommandOperationOptions extends OperationOptions, WriteConcernOptions, ExplainOptions { + /** @deprecated This option does nothing */ + fullResponse?: boolean; + /** Specify a read concern and level for the collection. (only MongoDB 3.2 or higher supported) */ + readConcern?: ReadConcernLike; + /** Collation */ + collation?: CollationOptions; + maxTimeMS?: number; + /** + * Comment to apply to the operation. + * + * In server versions pre-4.4, 'comment' must be string. A server + * error will be thrown if any other type is provided. + * + * In server versions 4.4 and above, 'comment' can be any valid BSON type. + */ + comment?: unknown; + /** Should retry failed writes */ + retryWrites?: boolean; + dbName?: string; + authdb?: string; + noResponse?: boolean; +} + +/* Excluded from this release type: CommandOptions */ + +/** + * An event indicating the start of a given + * @public + * @category Event + */ +export declare class CommandStartedEvent { + commandObj?: Document; + requestId: number; + databaseName: string; + commandName: string; + command: Document; + address: string; + connectionId?: string | number; + serviceId?: ObjectId; + /* Excluded from this release type: __constructor */ + get hasServiceId(): boolean; +} + +/** + * An event indicating the success of a given command + * @public + * @category Event + */ +export declare class CommandSucceededEvent { + address: string; + connectionId?: string | number; + requestId: number; + duration: number; + commandName: string; + reply: unknown; + serviceId?: ObjectId; + /* Excluded from this release type: __constructor */ + get hasServiceId(): boolean; +} + +/** @public */ +export declare type CommonEvents = 'newListener' | 'removeListener'; + +/** @public */ +export declare const Compressor: Readonly<{ + readonly none: 0; + readonly snappy: 1; + readonly zlib: 2; + readonly zstd: 3; +}>; + +/** @public */ +export declare type Compressor = typeof Compressor[CompressorName]; + +/** @public */ +export declare type CompressorName = keyof typeof Compressor; + +/** @public */ +export declare type Condition = AlternativeType | FilterOperators>; + +/* Excluded from this release type: Connection */ + +/** + * An event published when a connection is checked into the connection pool + * @public + * @category Event + */ +export declare class ConnectionCheckedInEvent extends ConnectionPoolMonitoringEvent { + /** The id of the connection */ + connectionId: number | ''; + /* Excluded from this release type: __constructor */ +} + +/** + * An event published when a connection is checked out of the connection pool + * @public + * @category Event + */ +export declare class ConnectionCheckedOutEvent extends ConnectionPoolMonitoringEvent { + /** The id of the connection */ + connectionId: number | ''; + /* Excluded from this release type: __constructor */ +} + +/** + * An event published when a request to check a connection out fails + * @public + * @category Event + */ +export declare class ConnectionCheckOutFailedEvent extends ConnectionPoolMonitoringEvent { + /** The reason the attempt to check out failed */ + reason: AnyError | string; + /* Excluded from this release type: __constructor */ +} + +/** + * An event published when a request to check a connection out begins + * @public + * @category Event + */ +export declare class ConnectionCheckOutStartedEvent extends ConnectionPoolMonitoringEvent { + /* Excluded from this release type: __constructor */ +} + +/** + * An event published when a connection is closed + * @public + * @category Event + */ +export declare class ConnectionClosedEvent extends ConnectionPoolMonitoringEvent { + /** The id of the connection */ + connectionId: number | ''; + /** The reason the connection was closed */ + reason: string; + serviceId?: ObjectId; + /* Excluded from this release type: __constructor */ +} + +/** + * An event published when a connection pool creates a new connection + * @public + * @category Event + */ +export declare class ConnectionCreatedEvent extends ConnectionPoolMonitoringEvent { + /** A monotonically increasing, per-pool id for the newly created connection */ + connectionId: number | ''; + /* Excluded from this release type: __constructor */ +} + +/** @public */ +export declare type ConnectionEvents = { + commandStarted(event: CommandStartedEvent): void; + commandSucceeded(event: CommandSucceededEvent): void; + commandFailed(event: CommandFailedEvent): void; + clusterTimeReceived(clusterTime: Document): void; + close(): void; + message(message: any): void; + pinned(pinType: string): void; + unpinned(pinType: string): void; +}; + +/** @public */ +export declare interface ConnectionOptions extends SupportedNodeConnectionOptions, StreamDescriptionOptions, ProxyOptions { + id: number | ''; + generation: number; + hostAddress: HostAddress; + autoEncrypter?: AutoEncrypter; + serverApi?: ServerApi; + monitorCommands: boolean; + /* Excluded from this release type: connectionType */ + credentials?: MongoCredentials; + connectTimeoutMS?: number; + tls: boolean; + keepAlive?: boolean; + keepAliveInitialDelay?: number; + noDelay?: boolean; + socketTimeoutMS?: number; + cancellationToken?: CancellationToken; + metadata: ClientMetadata; +} + +/* Excluded from this release type: ConnectionPool */ + +/** + * An event published when a connection pool is cleared + * @public + * @category Event + */ +export declare class ConnectionPoolClearedEvent extends ConnectionPoolMonitoringEvent { + /* Excluded from this release type: serviceId */ + /* Excluded from this release type: __constructor */ +} + +/** + * An event published when a connection pool is closed + * @public + * @category Event + */ +export declare class ConnectionPoolClosedEvent extends ConnectionPoolMonitoringEvent { + /* Excluded from this release type: __constructor */ +} + +/** + * An event published when a connection pool is created + * @public + * @category Event + */ +export declare class ConnectionPoolCreatedEvent extends ConnectionPoolMonitoringEvent { + /** The options used to create this connection pool */ + options?: ConnectionPoolOptions; + /* Excluded from this release type: __constructor */ +} + +/** @public */ +export declare type ConnectionPoolEvents = { + connectionPoolCreated(event: ConnectionPoolCreatedEvent): void; + connectionPoolClosed(event: ConnectionPoolClosedEvent): void; + connectionPoolCleared(event: ConnectionPoolClearedEvent): void; + connectionCreated(event: ConnectionCreatedEvent): void; + connectionReady(event: ConnectionReadyEvent): void; + connectionClosed(event: ConnectionClosedEvent): void; + connectionCheckOutStarted(event: ConnectionCheckOutStartedEvent): void; + connectionCheckOutFailed(event: ConnectionCheckOutFailedEvent): void; + connectionCheckedOut(event: ConnectionCheckedOutEvent): void; + connectionCheckedIn(event: ConnectionCheckedInEvent): void; +} & Omit; + +/* Excluded from this release type: ConnectionPoolMetrics */ + +/** + * The base export class for all monitoring events published from the connection pool + * @public + * @category Event + */ +export declare class ConnectionPoolMonitoringEvent { + /** A timestamp when the event was created */ + time: Date; + /** The address (host/port pair) of the pool */ + address: string; + /* Excluded from this release type: __constructor */ +} + +/** @public */ +export declare interface ConnectionPoolOptions extends Omit { + /** The maximum number of connections that may be associated with a pool at a given time. This includes in use and available connections. */ + maxPoolSize: number; + /** The minimum number of connections that MUST exist at any moment in a single connection pool. */ + minPoolSize: number; + /** The maximum number of connections that may be in the process of being established concurrently by the connection pool. */ + maxConnecting: number; + /** The maximum amount of time a connection should remain idle in the connection pool before being marked idle. */ + maxIdleTimeMS: number; + /** The maximum amount of time operation execution should wait for a connection to become available. The default is 0 which means there is no limit. */ + waitQueueTimeoutMS: number; + /** If we are in load balancer mode. */ + loadBalanced: boolean; +} + +/** + * An event published when a connection is ready for use + * @public + * @category Event + */ +export declare class ConnectionReadyEvent extends ConnectionPoolMonitoringEvent { + /** The id of the connection */ + connectionId: number | ''; + /* Excluded from this release type: __constructor */ +} + +/** @public */ +export declare interface ConnectOptions { + readPreference?: ReadPreference; +} + +/** @public */ +export declare interface CountDocumentsOptions extends AggregateOptions { + /** The number of documents to skip. */ + skip?: number; + /** The maximum amounts to count before aborting. */ + limit?: number; +} + +/** @public */ +export declare interface CountOptions extends CommandOperationOptions { + /** The number of documents to skip. */ + skip?: number; + /** The maximum amounts to count before aborting. */ + limit?: number; + /** Number of milliseconds to wait before aborting the query. */ + maxTimeMS?: number; + /** An index name hint for the query. */ + hint?: string | Document; +} + +/** @public */ +export declare interface CreateCollectionOptions extends CommandOperationOptions { + /** Returns an error if the collection does not exist */ + strict?: boolean; + /** Create a capped collection */ + capped?: boolean; + /** @deprecated Create an index on the _id field of the document, True by default on MongoDB 2.6 - 3.0 */ + autoIndexId?: boolean; + /** The size of the capped collection in bytes */ + size?: number; + /** The maximum number of documents in the capped collection */ + max?: number; + /** Available for the MMAPv1 storage engine only to set the usePowerOf2Sizes and the noPadding flag */ + flags?: number; + /** Allows users to specify configuration to the storage engine on a per-collection basis when creating a collection on MongoDB 3.0 or higher */ + storageEngine?: Document; + /** Allows users to specify validation rules or expressions for the collection. For more information, see Document Validation on MongoDB 3.2 or higher */ + validator?: Document; + /** Determines how strictly MongoDB applies the validation rules to existing documents during an update on MongoDB 3.2 or higher */ + validationLevel?: string; + /** Determines whether to error on invalid documents or just warn about the violations but allow invalid documents to be inserted on MongoDB 3.2 or higher */ + validationAction?: string; + /** Allows users to specify a default configuration for indexes when creating a collection on MongoDB 3.2 or higher */ + indexOptionDefaults?: Document; + /** The name of the source collection or view from which to create the view. The name is not the full namespace of the collection or view; i.e. does not include the database name and implies the same database as the view to create on MongoDB 3.4 or higher */ + viewOn?: string; + /** An array that consists of the aggregation pipeline stage. Creates the view by applying the specified pipeline to the viewOn collection or view on MongoDB 3.4 or higher */ + pipeline?: Document[]; + /** A primary key factory function for generation of custom _id keys. */ + pkFactory?: PkFactory; + /** A document specifying configuration options for timeseries collections. */ + timeseries?: TimeSeriesCollectionOptions; + /** A document specifying configuration options for clustered collections. For MongoDB 5.3 and above. */ + clusteredIndex?: ClusteredCollectionOptions; + /** The number of seconds after which a document in a timeseries or clustered collection expires. */ + expireAfterSeconds?: number; + /** @experimental */ + encryptedFields?: Document; + /** + * If set, enables pre-update and post-update document events to be included for any + * change streams that listen on this collection. + */ + changeStreamPreAndPostImages?: { + enabled: boolean; + }; +} + +/** @public */ +export declare interface CreateIndexesOptions extends CommandOperationOptions { + /** Creates the index in the background, yielding whenever possible. */ + background?: boolean; + /** Creates an unique index. */ + unique?: boolean; + /** Override the autogenerated index name (useful if the resulting name is larger than 128 bytes) */ + name?: string; + /** Creates a partial index based on the given filter object (MongoDB 3.2 or higher) */ + partialFilterExpression?: Document; + /** Creates a sparse index. */ + sparse?: boolean; + /** Allows you to expire data on indexes applied to a data (MongoDB 2.2 or higher) */ + expireAfterSeconds?: number; + /** Allows users to configure the storage engine on a per-index basis when creating an index. (MongoDB 3.0 or higher) */ + storageEngine?: Document; + /** (MongoDB 4.4. or higher) Specifies how many data-bearing members of a replica set, including the primary, must complete the index builds successfully before the primary marks the indexes as ready. This option accepts the same values for the "w" field in a write concern plus "votingMembers", which indicates all voting data-bearing nodes. */ + commitQuorum?: number | string; + /** Specifies the index version number, either 0 or 1. */ + version?: number; + weights?: Document; + default_language?: string; + language_override?: string; + textIndexVersion?: number; + '2dsphereIndexVersion'?: number; + bits?: number; + /** For geospatial indexes set the lower bound for the co-ordinates. */ + min?: number; + /** For geospatial indexes set the high bound for the co-ordinates. */ + max?: number; + bucketSize?: number; + wildcardProjection?: Document; + /** Specifies that the index should exist on the target collection but should not be used by the query planner when executing operations. (MongoDB 4.4 or higher) */ + hidden?: boolean; +} + +/** @public */ +export declare const CURSOR_FLAGS: readonly ["tailable", "oplogReplay", "noCursorTimeout", "awaitData", "exhaust", "partial"]; + +/** @public + * @deprecated This interface is deprecated */ +export declare interface CursorCloseOptions { + /** Bypass calling killCursors when closing the cursor. */ + /** @deprecated the skipKillCursors option is deprecated */ + skipKillCursors?: boolean; +} + +/** @public */ +export declare type CursorFlag = typeof CURSOR_FLAGS[number]; + +/** @public */ +export declare interface CursorStreamOptions { + /** A transformation method applied to each document emitted by the stream */ + transform?(doc: Document): Document; +} + +/** + * The **Db** class is a class that represents a MongoDB Database. + * @public + * + * @example + * ```js + * const { MongoClient } = require('mongodb'); + * // Connection url + * const url = 'mongodb://localhost:27017'; + * // Database Name + * const dbName = 'test'; + * // Connect using MongoClient + * MongoClient.connect(url, function(err, client) { + * // Select the database by name + * const testDb = client.db(dbName); + * client.close(); + * }); + * ``` + */ +export declare class Db { + /* Excluded from this release type: s */ + static SYSTEM_NAMESPACE_COLLECTION: string; + static SYSTEM_INDEX_COLLECTION: string; + static SYSTEM_PROFILE_COLLECTION: string; + static SYSTEM_USER_COLLECTION: string; + static SYSTEM_COMMAND_COLLECTION: string; + static SYSTEM_JS_COLLECTION: string; + /** + * Creates a new Db instance + * + * @param client - The MongoClient for the database. + * @param databaseName - The name of the database this instance represents. + * @param options - Optional settings for Db construction + */ + constructor(client: MongoClient, databaseName: string, options?: DbOptions); + get databaseName(): string; + get options(): DbOptions | undefined; + /** + * slaveOk specified + * @deprecated Use secondaryOk instead + */ + get slaveOk(): boolean; + /** + * Check if a secondary can be used (because the read preference is *not* set to primary) + */ + get secondaryOk(): boolean; + get readConcern(): ReadConcern | undefined; + /** + * The current readPreference of the Db. If not explicitly defined for + * this Db, will be inherited from the parent MongoClient + */ + get readPreference(): ReadPreference; + get bsonOptions(): BSONSerializeOptions; + get writeConcern(): WriteConcern | undefined; + get namespace(): string; + /** + * Create a new collection on a server with the specified options. Use this to create capped collections. + * More information about command options available at https://docs.mongodb.com/manual/reference/command/create/ + * + * @param name - The name of the collection to create + * @param options - Optional settings for the command + * @param callback - An optional callback, a Promise will be returned if none is provided + */ + createCollection(name: string, options?: CreateCollectionOptions): Promise>; + createCollection(name: string, callback: Callback>): void; + createCollection(name: string, options: CreateCollectionOptions | undefined, callback: Callback>): void; + /** + * Execute a command + * + * @remarks + * This command does not inherit options from the MongoClient. + * + * @param command - The command to run + * @param options - Optional settings for the command + * @param callback - An optional callback, a Promise will be returned if none is provided + */ + command(command: Document): Promise; + command(command: Document, callback: Callback): void; + command(command: Document, options: RunCommandOptions): Promise; + command(command: Document, options: RunCommandOptions, callback: Callback): void; + /** + * Execute an aggregation framework pipeline against the database, needs MongoDB \>= 3.6 + * + * @param pipeline - An array of aggregation stages to be executed + * @param options - Optional settings for the command + */ + aggregate(pipeline?: Document[], options?: AggregateOptions): AggregationCursor; + /** Return the Admin db instance */ + admin(): Admin; + /** + * Returns a reference to a MongoDB Collection. If it does not exist it will be created implicitly. + * + * @param name - the collection name we wish to access. + * @returns return the new Collection instance + */ + collection(name: string, options?: CollectionOptions): Collection; + /** + * Get all the db statistics. + * + * @param options - Optional settings for the command + * @param callback - An optional callback, a Promise will be returned if none is provided + */ + stats(): Promise; + stats(callback: Callback): void; + stats(options: DbStatsOptions): Promise; + stats(options: DbStatsOptions, callback: Callback): void; + /** + * List all collections of this database with optional filter + * + * @param filter - Query to filter collections by + * @param options - Optional settings for the command + */ + listCollections(filter: Document, options: Exclude & { + nameOnly: true; + }): ListCollectionsCursor>; + listCollections(filter: Document, options: Exclude & { + nameOnly: false; + }): ListCollectionsCursor; + listCollections | CollectionInfo = Pick | CollectionInfo>(filter?: Document, options?: ListCollectionsOptions): ListCollectionsCursor; + /** + * Rename a collection. + * + * @remarks + * This operation does not inherit options from the MongoClient. + * + * @param fromCollection - Name of current collection to rename + * @param toCollection - New name of of the collection + * @param options - Optional settings for the command + * @param callback - An optional callback, a Promise will be returned if none is provided + */ + renameCollection(fromCollection: string, toCollection: string): Promise>; + renameCollection(fromCollection: string, toCollection: string, callback: Callback>): void; + renameCollection(fromCollection: string, toCollection: string, options: RenameOptions): Promise>; + renameCollection(fromCollection: string, toCollection: string, options: RenameOptions, callback: Callback>): void; + /** + * Drop a collection from the database, removing it permanently. New accesses will create a new collection. + * + * @param name - Name of collection to drop + * @param options - Optional settings for the command + * @param callback - An optional callback, a Promise will be returned if none is provided + */ + dropCollection(name: string): Promise; + dropCollection(name: string, callback: Callback): void; + dropCollection(name: string, options: DropCollectionOptions): Promise; + dropCollection(name: string, options: DropCollectionOptions, callback: Callback): void; + /** + * Drop a database, removing it permanently from the server. + * + * @param options - Optional settings for the command + * @param callback - An optional callback, a Promise will be returned if none is provided + */ + dropDatabase(): Promise; + dropDatabase(callback: Callback): void; + dropDatabase(options: DropDatabaseOptions): Promise; + dropDatabase(options: DropDatabaseOptions, callback: Callback): void; + /** + * Fetch all collections for the current db. + * + * @param options - Optional settings for the command + * @param callback - An optional callback, a Promise will be returned if none is provided + */ + collections(): Promise; + collections(callback: Callback): void; + collections(options: ListCollectionsOptions): Promise; + collections(options: ListCollectionsOptions, callback: Callback): void; + /** + * Creates an index on the db and collection. + * + * @param name - Name of the collection to create the index on. + * @param indexSpec - Specify the field to index, or an index specification + * @param options - Optional settings for the command + * @param callback - An optional callback, a Promise will be returned if none is provided + */ + createIndex(name: string, indexSpec: IndexSpecification): Promise; + createIndex(name: string, indexSpec: IndexSpecification, callback?: Callback): void; + createIndex(name: string, indexSpec: IndexSpecification, options: CreateIndexesOptions): Promise; + createIndex(name: string, indexSpec: IndexSpecification, options: CreateIndexesOptions, callback: Callback): void; + /** + * Add a user to the database + * + * @param username - The username for the new user + * @param password - An optional password for the new user + * @param options - Optional settings for the command + * @param callback - An optional callback, a Promise will be returned if none is provided + */ + addUser(username: string): Promise; + addUser(username: string, callback: Callback): void; + addUser(username: string, password: string): Promise; + addUser(username: string, password: string, callback: Callback): void; + addUser(username: string, options: AddUserOptions): Promise; + addUser(username: string, options: AddUserOptions, callback: Callback): void; + addUser(username: string, password: string, options: AddUserOptions): Promise; + addUser(username: string, password: string, options: AddUserOptions, callback: Callback): void; + /** + * Remove a user from a database + * + * @param username - The username to remove + * @param options - Optional settings for the command + * @param callback - An optional callback, a Promise will be returned if none is provided + */ + removeUser(username: string): Promise; + removeUser(username: string, callback: Callback): void; + removeUser(username: string, options: RemoveUserOptions): Promise; + removeUser(username: string, options: RemoveUserOptions, callback: Callback): void; + /** + * Set the current profiling level of MongoDB + * + * @param level - The new profiling level (off, slow_only, all). + * @param options - Optional settings for the command + * @param callback - An optional callback, a Promise will be returned if none is provided + */ + setProfilingLevel(level: ProfilingLevel): Promise; + setProfilingLevel(level: ProfilingLevel, callback: Callback): void; + setProfilingLevel(level: ProfilingLevel, options: SetProfilingLevelOptions): Promise; + setProfilingLevel(level: ProfilingLevel, options: SetProfilingLevelOptions, callback: Callback): void; + /** + * Retrieve the current profiling Level for MongoDB + * + * @param options - Optional settings for the command + * @param callback - An optional callback, a Promise will be returned if none is provided + */ + profilingLevel(): Promise; + profilingLevel(callback: Callback): void; + profilingLevel(options: ProfilingLevelOptions): Promise; + profilingLevel(options: ProfilingLevelOptions, callback: Callback): void; + /** + * Retrieves this collections index info. + * + * @param name - The name of the collection. + * @param options - Optional settings for the command + * @param callback - An optional callback, a Promise will be returned if none is provided + */ + indexInformation(name: string): Promise; + indexInformation(name: string, callback: Callback): void; + indexInformation(name: string, options: IndexInformationOptions): Promise; + indexInformation(name: string, options: IndexInformationOptions, callback: Callback): void; + /** + * Unref all sockets + * @deprecated This function is deprecated and will be removed in the next major version. + */ + unref(): void; + /** + * Create a new Change Stream, watching for new changes (insertions, updates, + * replacements, deletions, and invalidations) in this database. Will ignore all + * changes to system collections. + * + * @remarks + * watch() accepts two generic arguments for distinct usecases: + * - The first is to provide the schema that may be defined for all the collections within this database + * - The second is to override the shape of the change stream document entirely, if it is not provided the type will default to ChangeStreamDocument of the first argument + * + * @param pipeline - An array of {@link https://docs.mongodb.com/manual/reference/operator/aggregation-pipeline/|aggregation pipeline stages} through which to pass change stream documents. This allows for filtering (using $match) and manipulating the change stream documents. + * @param options - Optional settings for the command + * @typeParam TSchema - Type of the data being detected by the change stream + * @typeParam TChange - Type of the whole change stream document emitted + */ + watch>(pipeline?: Document[], options?: ChangeStreamOptions): ChangeStream; + /** Return the db logger */ + getLogger(): Logger; + get logger(): Logger; +} + +/* Excluded from this release type: DB_AGGREGATE_COLLECTION */ + +/** @public */ +export declare interface DbOptions extends BSONSerializeOptions, WriteConcernOptions, LoggerOptions { + /** If the database authentication is dependent on another databaseName. */ + authSource?: string; + /** Force server to assign _id values instead of driver. */ + forceServerObjectId?: boolean; + /** The preferred read preference (ReadPreference.PRIMARY, ReadPreference.PRIMARY_PREFERRED, ReadPreference.SECONDARY, ReadPreference.SECONDARY_PREFERRED, ReadPreference.NEAREST). */ + readPreference?: ReadPreferenceLike; + /** A primary key factory object for generation of custom _id keys. */ + pkFactory?: PkFactory; + /** Specify a read concern for the collection. (only MongoDB 3.2 or higher supported) */ + readConcern?: ReadConcern; + /** Should retry failed writes */ + retryWrites?: boolean; +} + +/* Excluded from this release type: DbPrivate */ +export { DBRef } + +/** @public */ +export declare interface DbStatsOptions extends CommandOperationOptions { + /** Divide the returned sizes by scale value. */ + scale?: number; +} + +export { Decimal128 } + +/** @public */ +export declare interface DeleteManyModel { + /** The filter to limit the deleted documents. */ + filter: Filter; + /** Specifies a collation. */ + collation?: CollationOptions; + /** The index to use. If specified, then the query system will only consider plans using the hinted index. */ + hint?: Hint; +} + +/** @public */ +export declare interface DeleteOneModel { + /** The filter to limit the deleted documents. */ + filter: Filter; + /** Specifies a collation. */ + collation?: CollationOptions; + /** The index to use. If specified, then the query system will only consider plans using the hinted index. */ + hint?: Hint; +} + +/** @public */ +export declare interface DeleteOptions extends CommandOperationOptions, WriteConcernOptions { + /** If true, when an insert fails, don't execute the remaining writes. If false, continue with remaining inserts when one fails. */ + ordered?: boolean; + /** Specifies the collation to use for the operation */ + collation?: CollationOptions; + /** Specify that the update query should only consider plans using the hinted index */ + hint?: string | Document; + /** Map of parameter names and values that can be accessed using $$var (requires MongoDB 5.0). */ + let?: Document; + /** @deprecated use `removeOne` or `removeMany` to implicitly specify the limit */ + single?: boolean; +} + +/** @public */ +export declare interface DeleteResult { + /** Indicates whether this write result was acknowledged. If not, then all other members of this result will be undefined. */ + acknowledged: boolean; + /** The number of documents that were deleted */ + deletedCount: number; +} + +/** @public */ +export declare interface DeleteStatement { + /** The query that matches documents to delete. */ + q: Document; + /** The number of matching documents to delete. */ + limit: number; + /** Specifies the collation to use for the operation. */ + collation?: CollationOptions; + /** A document or string that specifies the index to use to support the query predicate. */ + hint?: Hint; +} + +/* Excluded from this release type: deserialize */ + +/** @public */ +export declare interface DestroyOptions { + /** Force the destruction. */ + force?: boolean; +} + +/** @public */ +export declare type DistinctOptions = CommandOperationOptions; + +export { Document } + +export { Double } + +/** @public */ +export declare interface DriverInfo { + name?: string; + version?: string; + platform?: string; +} + +/** @public */ +export declare interface DropCollectionOptions extends CommandOperationOptions { + /** @experimental */ + encryptedFields?: Document; +} + +/** @public */ +export declare type DropDatabaseOptions = CommandOperationOptions; + +/** @public */ +export declare type DropIndexesOptions = CommandOperationOptions; + +/* Excluded from this release type: Encrypter */ + +/* Excluded from this release type: EncrypterOptions */ + +/** @public */ +export declare interface EndSessionOptions { + /* Excluded from this release type: error */ + force?: boolean; + forceClear?: boolean; +} + +/** TypeScript Omit (Exclude to be specific) does not work for objects with an "any" indexed type, and breaks discriminated unions @public */ +export declare type EnhancedOmit = string extends keyof TRecordOrUnion ? TRecordOrUnion : TRecordOrUnion extends any ? Pick> : never; + +/** @public */ +export declare interface ErrorDescription extends Document { + message?: string; + errmsg?: string; + $err?: string; + errorLabels?: string[]; + errInfo?: Document; +} + +/** @public */ +export declare interface EstimatedDocumentCountOptions extends CommandOperationOptions { + /** + * The maximum amount of time to allow the operation to run. + * + * This option is sent only if the caller explicitly provides a value. The default is to not send a value. + */ + maxTimeMS?: number; +} + +/** @public */ +export declare interface EvalOptions extends CommandOperationOptions { + nolock?: boolean; +} + +/** @public */ +export declare type EventEmitterWithState = { + /* Excluded from this release type: stateChanged */ +}; + +/** + * Event description type + * @public + */ +export declare type EventsDescription = Record; + +/* Excluded from this release type: ExecutionResult */ + +/* Excluded from this release type: Explain */ + +/** @public */ +export declare interface ExplainOptions { + /** Specifies the verbosity mode for the explain output. */ + explain?: ExplainVerbosityLike; +} + +/** @public */ +export declare const ExplainVerbosity: Readonly<{ + readonly queryPlanner: "queryPlanner"; + readonly queryPlannerExtended: "queryPlannerExtended"; + readonly executionStats: "executionStats"; + readonly allPlansExecution: "allPlansExecution"; +}>; + +/** @public */ +export declare type ExplainVerbosity = string; + +/** + * For backwards compatibility, true is interpreted as "allPlansExecution" + * and false as "queryPlanner". Prior to server version 3.6, aggregate() + * ignores the verbosity parameter and executes in "queryPlanner". + * @public + */ +export declare type ExplainVerbosityLike = ExplainVerbosity | boolean; + +/** A MongoDB filter can be some portion of the schema or a set of operators @public */ +export declare type Filter = Partial | ({ + [Property in Join>, '.'>]?: Condition, Property>>; +} & RootFilterOperators>); + +/** @public */ +export declare type FilterOperations = T extends Record ? { + [key in keyof T]?: FilterOperators; +} : FilterOperators; + +/** @public */ +export declare interface FilterOperators extends NonObjectIdLikeDocument { + $eq?: TValue; + $gt?: TValue; + $gte?: TValue; + $in?: ReadonlyArray; + $lt?: TValue; + $lte?: TValue; + $ne?: TValue; + $nin?: ReadonlyArray; + $not?: TValue extends string ? FilterOperators | RegExp : FilterOperators; + /** + * When `true`, `$exists` matches the documents that contain the field, + * including documents where the field value is null. + */ + $exists?: boolean; + $type?: BSONType | BSONTypeAlias; + $expr?: Record; + $jsonSchema?: Record; + $mod?: TValue extends number ? [number, number] : never; + $regex?: TValue extends string ? RegExp | BSONRegExp | string : never; + $options?: TValue extends string ? string : never; + $geoIntersects?: { + $geometry: Document; + }; + $geoWithin?: Document; + $near?: Document; + $nearSphere?: Document; + $maxDistance?: number; + $all?: ReadonlyArray; + $elemMatch?: Document; + $size?: TValue extends ReadonlyArray ? number : never; + $bitsAllClear?: BitwiseFilter; + $bitsAllSet?: BitwiseFilter; + $bitsAnyClear?: BitwiseFilter; + $bitsAnySet?: BitwiseFilter; + $rand?: Record; +} + +/** @public */ +export declare type FinalizeFunction = (key: TKey, reducedValue: TValue) => TValue; + +/** @public */ +export declare class FindCursor extends AbstractCursor { + /* Excluded from this release type: [kFilter] */ + /* Excluded from this release type: [kNumReturned] */ + /* Excluded from this release type: [kBuiltOptions] */ + /* Excluded from this release type: __constructor */ + clone(): FindCursor; + map(transform: (doc: TSchema) => T): FindCursor; + /* Excluded from this release type: _initialize */ + /* Excluded from this release type: _getMore */ + /** + * Get the count of documents for this cursor + * @deprecated Use `collection.estimatedDocumentCount` or `collection.countDocuments` instead + */ + count(): Promise; + /** @deprecated Use `collection.estimatedDocumentCount` or `collection.countDocuments` instead */ + count(callback: Callback): void; + /** @deprecated Use `collection.estimatedDocumentCount` or `collection.countDocuments` instead */ + count(options: CountOptions): Promise; + /** @deprecated Use `collection.estimatedDocumentCount` or `collection.countDocuments` instead */ + count(options: CountOptions, callback: Callback): void; + /** Execute the explain for the cursor */ + explain(): Promise; + explain(callback: Callback): void; + explain(verbosity?: ExplainVerbosityLike): Promise; + /** Set the cursor query */ + filter(filter: Document): this; + /** + * Set the cursor hint + * + * @param hint - If specified, then the query system will only consider plans using the hinted index. + */ + hint(hint: Hint): this; + /** + * Set the cursor min + * + * @param min - Specify a $min value to specify the inclusive lower bound for a specific index in order to constrain the results of find(). The $min specifies the lower bound for all keys of a specific index in order. + */ + min(min: Document): this; + /** + * Set the cursor max + * + * @param max - Specify a $max value to specify the exclusive upper bound for a specific index in order to constrain the results of find(). The $max specifies the upper bound for all keys of a specific index in order. + */ + max(max: Document): this; + /** + * Set the cursor returnKey. + * If set to true, modifies the cursor to only return the index field or fields for the results of the query, rather than documents. + * If set to true and the query does not use an index to perform the read operation, the returned documents will not contain any fields. + * + * @param value - the returnKey value. + */ + returnKey(value: boolean): this; + /** + * Modifies the output of a query by adding a field $recordId to matching documents. $recordId is the internal key which uniquely identifies a document in a collection. + * + * @param value - The $showDiskLoc option has now been deprecated and replaced with the showRecordId field. $showDiskLoc will still be accepted for OP_QUERY stye find. + */ + showRecordId(value: boolean): this; + /** + * Add a query modifier to the cursor query + * + * @param name - The query modifier (must start with $, such as $orderby etc) + * @param value - The modifier value. + */ + addQueryModifier(name: string, value: string | boolean | number | Document): this; + /** + * Add a comment to the cursor query allowing for tracking the comment in the log. + * + * @param value - The comment attached to this query. + */ + comment(value: string): this; + /** + * Set a maxAwaitTimeMS on a tailing cursor query to allow to customize the timeout value for the option awaitData (Only supported on MongoDB 3.2 or higher, ignored otherwise) + * + * @param value - Number of milliseconds to wait before aborting the tailed query. + */ + maxAwaitTimeMS(value: number): this; + /** + * Set a maxTimeMS on the cursor query, allowing for hard timeout limits on queries (Only supported on MongoDB 2.6 or higher) + * + * @param value - Number of milliseconds to wait before aborting the query. + */ + maxTimeMS(value: number): this; + /** + * Add a project stage to the aggregation pipeline + * + * @remarks + * In order to strictly type this function you must provide an interface + * that represents the effect of your projection on the result documents. + * + * By default chaining a projection to your cursor changes the returned type to the generic + * {@link Document} type. + * You should specify a parameterized type to have assertions on your final results. + * + * @example + * ```typescript + * // Best way + * const docs: FindCursor<{ a: number }> = cursor.project<{ a: number }>({ _id: 0, a: true }); + * // Flexible way + * const docs: FindCursor = cursor.project({ _id: 0, a: true }); + * ``` + * + * @remarks + * + * **Note for Typescript Users:** adding a transform changes the return type of the iteration of this cursor, + * it **does not** return a new instance of a cursor. This means when calling project, + * you should always assign the result to a new variable in order to get a correctly typed cursor variable. + * Take note of the following example: + * + * @example + * ```typescript + * const cursor: FindCursor<{ a: number; b: string }> = coll.find(); + * const projectCursor = cursor.project<{ a: number }>({ _id: 0, a: true }); + * const aPropOnlyArray: {a: number}[] = await projectCursor.toArray(); + * + * // or always use chaining and save the final cursor + * + * const cursor = coll.find().project<{ a: string }>({ + * _id: 0, + * a: { $convert: { input: '$a', to: 'string' } + * }}); + * ``` + */ + project(value: Document): FindCursor; + /** + * Sets the sort order of the cursor query. + * + * @param sort - The key or keys set for the sort. + * @param direction - The direction of the sorting (1 or -1). + */ + sort(sort: Sort | string, direction?: SortDirection): this; + /** + * Allows disk use for blocking sort operations exceeding 100MB memory. (MongoDB 3.2 or higher) + * + * @remarks + * {@link https://docs.mongodb.com/manual/reference/command/find/#find-cmd-allowdiskuse | find command allowDiskUse documentation} + */ + allowDiskUse(allow?: boolean): this; + /** + * Set the collation options for the cursor. + * + * @param value - The cursor collation options (MongoDB 3.4 or higher) settings for update operation (see 3.4 documentation for available fields). + */ + collation(value: CollationOptions): this; + /** + * Set the limit for the cursor. + * + * @param value - The limit for the cursor query. + */ + limit(value: number): this; + /** + * Set the skip for the cursor. + * + * @param value - The skip for the cursor query. + */ + skip(value: number): this; +} + +/** @public */ +export declare interface FindOneAndDeleteOptions extends CommandOperationOptions { + /** An optional hint for query optimization. See the {@link https://docs.mongodb.com/manual/reference/command/update/#update-command-hint|update command} reference for more information.*/ + hint?: Document; + /** Limits the fields to return for all matching documents. */ + projection?: Document; + /** Determines which document the operation modifies if the query selects multiple documents. */ + sort?: Sort; + /** Map of parameter names and values that can be accessed using $$var (requires MongoDB 5.0). */ + let?: Document; +} + +/** @public */ +export declare interface FindOneAndReplaceOptions extends CommandOperationOptions { + /** Allow driver to bypass schema validation in MongoDB 3.2 or higher. */ + bypassDocumentValidation?: boolean; + /** An optional hint for query optimization. See the {@link https://docs.mongodb.com/manual/reference/command/update/#update-command-hint|update command} reference for more information.*/ + hint?: Document; + /** Limits the fields to return for all matching documents. */ + projection?: Document; + /** When set to 'after', returns the updated document rather than the original. The default is 'before'. */ + returnDocument?: ReturnDocument; + /** Determines which document the operation modifies if the query selects multiple documents. */ + sort?: Sort; + /** Upsert the document if it does not exist. */ + upsert?: boolean; + /** Map of parameter names and values that can be accessed using $$var (requires MongoDB 5.0). */ + let?: Document; +} + +/** @public */ +export declare interface FindOneAndUpdateOptions extends CommandOperationOptions { + /** Optional list of array filters referenced in filtered positional operators */ + arrayFilters?: Document[]; + /** Allow driver to bypass schema validation in MongoDB 3.2 or higher. */ + bypassDocumentValidation?: boolean; + /** An optional hint for query optimization. See the {@link https://docs.mongodb.com/manual/reference/command/update/#update-command-hint|update command} reference for more information.*/ + hint?: Document; + /** Limits the fields to return for all matching documents. */ + projection?: Document; + /** When set to 'after', returns the updated document rather than the original. The default is 'before'. */ + returnDocument?: ReturnDocument; + /** Determines which document the operation modifies if the query selects multiple documents. */ + sort?: Sort; + /** Upsert the document if it does not exist. */ + upsert?: boolean; + /** Map of parameter names and values that can be accessed using $$var (requires MongoDB 5.0). */ + let?: Document; +} + +/** + * A builder object that is returned from {@link BulkOperationBase#find}. + * Is used to build a write operation that involves a query filter. + * + * @public + */ +export declare class FindOperators { + bulkOperation: BulkOperationBase; + /* Excluded from this release type: __constructor */ + /** Add a multiple update operation to the bulk operation */ + update(updateDocument: Document): BulkOperationBase; + /** Add a single update operation to the bulk operation */ + updateOne(updateDocument: Document): BulkOperationBase; + /** Add a replace one operation to the bulk operation */ + replaceOne(replacement: Document): BulkOperationBase; + /** Add a delete one operation to the bulk operation */ + deleteOne(): BulkOperationBase; + /** Add a delete many operation to the bulk operation */ + delete(): BulkOperationBase; + /** Upsert modifier for update bulk operation, noting that this operation is an upsert. */ + upsert(): this; + /** Specifies the collation for the query condition. */ + collation(collation: CollationOptions): this; + /** Specifies arrayFilters for UpdateOne or UpdateMany bulk operations. */ + arrayFilters(arrayFilters: Document[]): this; +} + +/** + * @public + * @typeParam TSchema - Unused schema definition, deprecated usage, only specify `FindOptions` with no generic + */ +export declare interface FindOptions extends CommandOperationOptions { + /** Sets the limit of documents returned in the query. */ + limit?: number; + /** Set to sort the documents coming back from the query. Array of indexes, `[['a', 1]]` etc. */ + sort?: Sort; + /** The fields to return in the query. Object of fields to either include or exclude (one of, not both), `{'a':1, 'b': 1}` **or** `{'a': 0, 'b': 0}` */ + projection?: Document; + /** Set to skip N documents ahead in your query (useful for pagination). */ + skip?: number; + /** Tell the query to use specific indexes in the query. Object of indexes to use, `{'_id':1}` */ + hint?: Hint; + /** Specify if the cursor can timeout. */ + timeout?: boolean; + /** Specify if the cursor is tailable. */ + tailable?: boolean; + /** Specify if the cursor is a tailable-await cursor. Requires `tailable` to be true */ + awaitData?: boolean; + /** Set the batchSize for the getMoreCommand when iterating over the query results. */ + batchSize?: number; + /** If true, returns only the index keys in the resulting documents. */ + returnKey?: boolean; + /** The inclusive lower bound for a specific index */ + min?: Document; + /** The exclusive upper bound for a specific index */ + max?: Document; + /** Number of milliseconds to wait before aborting the query. */ + maxTimeMS?: number; + /** The maximum amount of time for the server to wait on new documents to satisfy a tailable cursor query. Requires `tailable` and `awaitData` to be true */ + maxAwaitTimeMS?: number; + /** The server normally times out idle cursors after an inactivity period (10 minutes) to prevent excess memory use. Set this option to prevent that. */ + noCursorTimeout?: boolean; + /** Specify collation (MongoDB 3.4 or higher) settings for update operation (see 3.4 documentation for available fields). */ + collation?: CollationOptions; + /** Allows disk use for blocking sort operations exceeding 100MB memory. (MongoDB 3.2 or higher) */ + allowDiskUse?: boolean; + /** Determines whether to close the cursor after the first batch. Defaults to false. */ + singleBatch?: boolean; + /** For queries against a sharded collection, allows the command (or subsequent getMore commands) to return partial results, rather than an error, if one or more queried shards are unavailable. */ + allowPartialResults?: boolean; + /** Determines whether to return the record identifier for each document. If true, adds a field $recordId to the returned documents. */ + showRecordId?: boolean; + /** Map of parameter names and values that can be accessed using $$var (requires MongoDB 5.0). */ + let?: Document; +} + +/** @public */ +export declare type Flatten = Type extends ReadonlyArray ? Item : Type; + +/** @public */ +export declare type GenericListener = (...args: any[]) => void; + +/* Excluded from this release type: GetMore */ + +/* Excluded from this release type: GetMoreOptions */ + +/** + * Constructor for a streaming GridFS interface + * @public + */ +export declare class GridFSBucket extends TypedEventEmitter { + /* Excluded from this release type: s */ + /** + * When the first call to openUploadStream is made, the upload stream will + * check to see if it needs to create the proper indexes on the chunks and + * files collections. This event is fired either when 1) it determines that + * no index creation is necessary, 2) when it successfully creates the + * necessary indexes. + * @event + */ + static readonly INDEX: "index"; + constructor(db: Db, options?: GridFSBucketOptions); + /** + * Returns a writable stream (GridFSBucketWriteStream) for writing + * buffers to GridFS. The stream's 'id' property contains the resulting + * file's id. + * + * @param filename - The value of the 'filename' key in the files doc + * @param options - Optional settings. + */ + openUploadStream(filename: string, options?: GridFSBucketWriteStreamOptions): GridFSBucketWriteStream; + /** + * Returns a writable stream (GridFSBucketWriteStream) for writing + * buffers to GridFS for a custom file id. The stream's 'id' property contains the resulting + * file's id. + */ + openUploadStreamWithId(id: ObjectId, filename: string, options?: GridFSBucketWriteStreamOptions): GridFSBucketWriteStream; + /** Returns a readable stream (GridFSBucketReadStream) for streaming file data from GridFS. */ + openDownloadStream(id: ObjectId, options?: GridFSBucketReadStreamOptions): GridFSBucketReadStream; + /** + * Deletes a file with the given id + * + * @param id - The id of the file doc + */ + delete(id: ObjectId): Promise; + delete(id: ObjectId, callback: Callback): void; + /** Convenience wrapper around find on the files collection */ + find(filter?: Filter, options?: FindOptions): FindCursor; + /** + * Returns a readable stream (GridFSBucketReadStream) for streaming the + * file with the given name from GridFS. If there are multiple files with + * the same name, this will stream the most recent file with the given name + * (as determined by the `uploadDate` field). You can set the `revision` + * option to change this behavior. + */ + openDownloadStreamByName(filename: string, options?: GridFSBucketReadStreamOptionsWithRevision): GridFSBucketReadStream; + /** + * Renames the file with the given _id to the given string + * + * @param id - the id of the file to rename + * @param filename - new name for the file + */ + rename(id: ObjectId, filename: string): Promise; + rename(id: ObjectId, filename: string, callback: Callback): void; + /** Removes this bucket's files collection, followed by its chunks collection. */ + drop(): Promise; + drop(callback: Callback): void; + /** Get the Db scoped logger. */ + getLogger(): Logger; +} + +/** @public */ +export declare type GridFSBucketEvents = { + index(): void; +}; + +/** @public */ +export declare interface GridFSBucketOptions extends WriteConcernOptions { + /** The 'files' and 'chunks' collections will be prefixed with the bucket name followed by a dot. */ + bucketName?: string; + /** Number of bytes stored in each chunk. Defaults to 255KB */ + chunkSizeBytes?: number; + /** Read preference to be passed to read operations */ + readPreference?: ReadPreference; +} + +/* Excluded from this release type: GridFSBucketPrivate */ + +/** + * A readable stream that enables you to read buffers from GridFS. + * + * Do not instantiate this class directly. Use `openDownloadStream()` instead. + * @public + */ +export declare class GridFSBucketReadStream extends Readable implements NodeJS.ReadableStream { + /* Excluded from this release type: s */ + /** + * An error occurred + * @event + */ + static readonly ERROR: "error"; + /** + * Fires when the stream loaded the file document corresponding to the provided id. + * @event + */ + static readonly FILE: "file"; + /** + * Emitted when a chunk of data is available to be consumed. + * @event + */ + static readonly DATA: "data"; + /** + * Fired when the stream is exhausted (no more data events). + * @event + */ + static readonly END: "end"; + /** + * Fired when the stream is exhausted and the underlying cursor is killed + * @event + */ + static readonly CLOSE: "close"; + /* Excluded from this release type: __constructor */ + /* Excluded from this release type: _read */ + /** + * Sets the 0-based offset in bytes to start streaming from. Throws + * an error if this stream has entered flowing mode + * (e.g. if you've already called `on('data')`) + * + * @param start - 0-based offset in bytes to start streaming from + */ + start(start?: number): this; + /** + * Sets the 0-based offset in bytes to start streaming from. Throws + * an error if this stream has entered flowing mode + * (e.g. if you've already called `on('data')`) + * + * @param end - Offset in bytes to stop reading at + */ + end(end?: number): this; + /** + * Marks this stream as aborted (will never push another `data` event) + * and kills the underlying cursor. Will emit the 'end' event, and then + * the 'close' event once the cursor is successfully killed. + * + * @param callback - called when the cursor is successfully closed or an error occurred. + */ + abort(callback?: Callback): void; +} + +/** @public */ +export declare interface GridFSBucketReadStreamOptions { + sort?: Sort; + skip?: number; + /** 0-based offset in bytes to start streaming from */ + start?: number; + /** 0-based offset in bytes to stop streaming before */ + end?: number; +} + +/** @public */ +export declare interface GridFSBucketReadStreamOptionsWithRevision extends GridFSBucketReadStreamOptions { + /** The revision number relative to the oldest file with the given filename. 0 + * gets you the oldest file, 1 gets you the 2nd oldest, -1 gets you the + * newest. */ + revision?: number; +} + +/* Excluded from this release type: GridFSBucketReadStreamPrivate */ + +/** + * A writable stream that enables you to write buffers to GridFS. + * + * Do not instantiate this class directly. Use `openUploadStream()` instead. + * @public + */ +export declare class GridFSBucketWriteStream extends Writable implements NodeJS.WritableStream { + bucket: GridFSBucket; + chunks: Collection; + filename: string; + files: Collection; + options: GridFSBucketWriteStreamOptions; + done: boolean; + id: ObjectId; + chunkSizeBytes: number; + bufToStore: Buffer; + length: number; + n: number; + pos: number; + state: { + streamEnd: boolean; + outstandingRequests: number; + errored: boolean; + aborted: boolean; + }; + writeConcern?: WriteConcern; + /** @event */ + static readonly CLOSE = "close"; + /** @event */ + static readonly ERROR = "error"; + /** + * `end()` was called and the write stream successfully wrote the file metadata and all the chunks to MongoDB. + * @event + */ + static readonly FINISH = "finish"; + /* Excluded from this release type: __constructor */ + /** + * Write a buffer to the stream. + * + * @param chunk - Buffer to write + * @param encodingOrCallback - Optional encoding for the buffer + * @param callback - Function to call when the chunk was added to the buffer, or if the entire chunk was persisted to MongoDB if this chunk caused a flush. + * @returns False if this write required flushing a chunk to MongoDB. True otherwise. + */ + write(chunk: Buffer | string): boolean; + write(chunk: Buffer | string, callback: Callback): boolean; + write(chunk: Buffer | string, encoding: BufferEncoding | undefined): boolean; + write(chunk: Buffer | string, encoding: BufferEncoding | undefined, callback: Callback): boolean; + /** + * Places this write stream into an aborted state (all future writes fail) + * and deletes all chunks that have already been written. + * + * @param callback - called when chunks are successfully removed or error occurred + */ + abort(): Promise; + abort(callback: Callback): void; + /** + * Tells the stream that no more data will be coming in. The stream will + * persist the remaining data to MongoDB, write the files document, and + * then emit a 'finish' event. + * + * @param chunk - Buffer to write + * @param encoding - Optional encoding for the buffer + * @param callback - Function to call when all files and chunks have been persisted to MongoDB + */ + end(): this; + end(chunk: Buffer): this; + end(callback: Callback): this; + end(chunk: Buffer, callback: Callback): this; + end(chunk: Buffer, encoding: BufferEncoding): this; + end(chunk: Buffer, encoding: BufferEncoding | undefined, callback: Callback): this; +} + +/** @public */ +export declare interface GridFSBucketWriteStreamOptions extends WriteConcernOptions { + /** Overwrite this bucket's chunkSizeBytes for this file */ + chunkSizeBytes?: number; + /** Custom file id for the GridFS file. */ + id?: ObjectId; + /** Object to store in the file document's `metadata` field */ + metadata?: Document; + /** String to store in the file document's `contentType` field */ + contentType?: string; + /** Array of strings to store in the file document's `aliases` field */ + aliases?: string[]; +} + +/** @public */ +export declare interface GridFSChunk { + _id: ObjectId; + files_id: ObjectId; + n: number; + data: Buffer | Uint8Array; +} + +/** @public */ +export declare interface GridFSFile { + _id: ObjectId; + length: number; + chunkSize: number; + filename: string; + contentType?: string; + aliases?: string[]; + metadata?: Document; + uploadDate: Date; +} + +/** @public */ +export declare const GSSAPICanonicalizationValue: Readonly<{ + readonly on: true; + readonly off: false; + readonly none: "none"; + readonly forward: "forward"; + readonly forwardAndReverse: "forwardAndReverse"; +}>; + +/** @public */ +export declare type GSSAPICanonicalizationValue = typeof GSSAPICanonicalizationValue[keyof typeof GSSAPICanonicalizationValue]; + +/** @public */ +export declare interface HedgeOptions { + /** Explicitly enable or disable hedged reads. */ + enabled?: boolean; +} + +/** @public */ +export declare type Hint = string | Document; + +/** @public */ +export declare class HostAddress { + host: string | undefined; + port: number | undefined; + socketPath: string | undefined; + isIPv6: boolean | undefined; + constructor(hostString: string); + inspect(): string; + /** + * @param ipv6Brackets - optionally request ipv6 bracket notation required for connection strings + */ + toString(ipv6Brackets?: boolean): string; + static fromString(s: string): HostAddress; + static fromHostPort(host: string, port: number): HostAddress; + static fromSrvRecord({ name, port }: SrvRecord): HostAddress; +} + +/** @public */ +export declare interface IndexDescription extends Pick { + collation?: CollationOptions; + name?: string; + key: Document; +} + +/** @public */ +export declare type IndexDirection = -1 | 1 | '2d' | '2dsphere' | 'text' | 'geoHaystack' | number; + +/** @public */ +export declare interface IndexInformationOptions { + full?: boolean; + readPreference?: ReadPreference; + session?: ClientSession; +} + +/** @public */ +export declare type IndexSpecification = OneOrMore; + +/** Given an object shaped type, return the type of the _id field or default to ObjectId @public */ +export declare type InferIdType = TSchema extends { + _id: infer IdType; +} ? Record extends IdType ? never : IdType : TSchema extends { + _id?: infer IdType; +} ? unknown extends IdType ? ObjectId : IdType : ObjectId; + +/** @public */ +export declare interface InsertManyResult { + /** Indicates whether this write result was acknowledged. If not, then all other members of this result will be undefined */ + acknowledged: boolean; + /** The number of inserted documents for this operations */ + insertedCount: number; + /** Map of the index of the inserted document to the id of the inserted document */ + insertedIds: { + [key: number]: InferIdType; + }; +} + +/** @public */ +export declare interface InsertOneModel { + /** The document to insert. */ + document: OptionalId; +} + +/** @public */ +export declare interface InsertOneOptions extends CommandOperationOptions { + /** Allow driver to bypass schema validation in MongoDB 3.2 or higher. */ + bypassDocumentValidation?: boolean; + /** Force server to assign _id values instead of driver. */ + forceServerObjectId?: boolean; +} + +/** @public */ +export declare interface InsertOneResult { + /** Indicates whether this write result was acknowledged. If not, then all other members of this result will be undefined */ + acknowledged: boolean; + /** The identifier that was inserted. If the server generated the identifier, this value will be null as the driver does not have access to that data */ + insertedId: InferIdType; +} + +export { Int32 } + +/** @public */ +export declare type IntegerType = number | Int32 | Long; + +/* Excluded from this release type: InternalAbstractCursorOptions */ + +/* Excluded from this release type: InterruptibleAsyncInterval */ + +/** @public */ +export declare type IsAny = true extends false & Type ? ResultIfAny : ResultIfNotAny; + +/** + * Helper types for dot-notation filter attributes + */ +/** @public */ +export declare type Join = T extends [] ? '' : T extends [string | number] ? `${T[0]}` : T extends [string | number, ...infer R] ? `${T[0]}${D}${Join}` : string; + +/* Excluded from this release type: kBeforeHandshake */ + +/* Excluded from this release type: kBuffer */ + +/* Excluded from this release type: kBuffers */ + +/* Excluded from this release type: kBuiltOptions */ + +/* Excluded from this release type: kCancellationToken */ + +/* Excluded from this release type: kCancellationToken_2 */ + +/* Excluded from this release type: kCancelled */ + +/* Excluded from this release type: kCancelled_2 */ + +/* Excluded from this release type: kCheckedOut */ + +/* Excluded from this release type: kClient */ + +/* Excluded from this release type: kClosed */ + +/* Excluded from this release type: kClosed_2 */ + +/* Excluded from this release type: kClusterTime */ + +/* Excluded from this release type: kConnection */ + +/* Excluded from this release type: kConnectionCounter */ + +/* Excluded from this release type: kConnections */ + +/* Excluded from this release type: kCursorStream */ + +/* Excluded from this release type: kDelayedTimeoutId */ + +/* Excluded from this release type: kDescription */ + +/* Excluded from this release type: kDocuments */ + +/* Excluded from this release type: kErrorLabels */ + +/** @public */ +export declare type KeysOfAType = { + [key in keyof TSchema]: NonNullable extends Type ? key : never; +}[keyof TSchema]; + +/** @public */ +export declare type KeysOfOtherType = { + [key in keyof TSchema]: NonNullable extends Type ? never : key; +}[keyof TSchema]; + +/* Excluded from this release type: kFilter */ + +/* Excluded from this release type: kFullResult */ + +/* Excluded from this release type: kGeneration */ + +/* Excluded from this release type: kGeneration_2 */ + +/* Excluded from this release type: kHello */ + +/* Excluded from this release type: kId */ + +/* Excluded from this release type: KillCursor */ + +/* Excluded from this release type: kInit */ + +/* Excluded from this release type: kInitialized */ + +/* Excluded from this release type: kInternalClient */ + +/* Excluded from this release type: kKilled */ + +/* Excluded from this release type: kLastUseTime */ + +/* Excluded from this release type: kLength */ + +/* Excluded from this release type: kLogger */ + +/* Excluded from this release type: kMessageStream */ + +/* Excluded from this release type: kMetrics */ + +/* Excluded from this release type: kMinPoolSizeTimer */ + +/* Excluded from this release type: kMode */ + +/* Excluded from this release type: kMonitor */ + +/* Excluded from this release type: kMonitorId */ + +/* Excluded from this release type: kNamespace */ + +/* Excluded from this release type: kNumReturned */ + +/* Excluded from this release type: kOptions */ + +/* Excluded from this release type: kOptions_2 */ + +/* Excluded from this release type: kOptions_3 */ + +/* Excluded from this release type: kPending */ + +/* Excluded from this release type: kPinnedConnection */ + +/* Excluded from this release type: kPipeline */ + +/* Excluded from this release type: kProcessingWaitQueue */ + +/* Excluded from this release type: kQueue */ + +/* Excluded from this release type: kResumeQueue */ + +/* Excluded from this release type: kRoundTripTime */ + +/* Excluded from this release type: kRTTPinger */ + +/* Excluded from this release type: kServer */ + +/* Excluded from this release type: kServer_2 */ + +/* Excluded from this release type: kServerError */ + +/* Excluded from this release type: kServerSession */ + +/* Excluded from this release type: kServiceGenerations */ + +/* Excluded from this release type: kSession */ + +/* Excluded from this release type: kSession_2 */ + +/* Excluded from this release type: kSnapshotEnabled */ + +/* Excluded from this release type: kSnapshotTime */ + +/* Excluded from this release type: kStream */ + +/* Excluded from this release type: kTransform */ + +/* Excluded from this release type: kTxnNumberIncrement */ + +/* Excluded from this release type: kWaitQueue */ + +/* Excluded from this release type: kWaitQueue_2 */ + +/** @public */ +export declare const LEGAL_TCP_SOCKET_OPTIONS: readonly ["family", "hints", "localAddress", "localPort", "lookup"]; + +/** @public */ +export declare const LEGAL_TLS_SOCKET_OPTIONS: readonly ["ALPNProtocols", "ca", "cert", "checkServerIdentity", "ciphers", "crl", "ecdhCurve", "key", "minDHSize", "passphrase", "pfx", "rejectUnauthorized", "secureContext", "secureProtocol", "servername", "session"]; + +/** @public */ +export declare class ListCollectionsCursor | CollectionInfo = Pick | CollectionInfo> extends AbstractCursor { + parent: Db; + filter: Document; + options?: ListCollectionsOptions; + constructor(db: Db, filter: Document, options?: ListCollectionsOptions); + clone(): ListCollectionsCursor; + /* Excluded from this release type: _initialize */ +} + +/** @public */ +export declare interface ListCollectionsOptions extends CommandOperationOptions { + /** Since 4.0: If true, will only return the collection name in the response, and will omit additional info */ + nameOnly?: boolean; + /** Since 4.0: If true and nameOnly is true, allows a user without the required privilege (i.e. listCollections action on the database) to run the command when access control is enforced. */ + authorizedCollections?: boolean; + /** The batchSize for the returned command cursor or if pre 2.8 the systems batch collection */ + batchSize?: number; +} + +/** @public */ +export declare interface ListDatabasesOptions extends CommandOperationOptions { + /** A query predicate that determines which databases are listed */ + filter?: Document; + /** A flag to indicate whether the command should return just the database names, or return both database names and size information */ + nameOnly?: boolean; + /** A flag that determines which databases are returned based on the user privileges when access control is enabled */ + authorizedDatabases?: boolean; +} + +/** @public */ +export declare interface ListDatabasesResult { + databases: ({ + name: string; + sizeOnDisk?: number; + empty?: boolean; + } & Document)[]; + totalSize?: number; + totalSizeMb?: number; + ok: 1 | 0; +} + +/** @public */ +export declare class ListIndexesCursor extends AbstractCursor { + parent: Collection; + options?: ListIndexesOptions; + constructor(collection: Collection, options?: ListIndexesOptions); + clone(): ListIndexesCursor; + /* Excluded from this release type: _initialize */ +} + +/** @public */ +export declare interface ListIndexesOptions extends CommandOperationOptions { + /** The batchSize for the returned command cursor or if pre 2.8 the systems batch collection */ + batchSize?: number; +} + +/** + * @public + */ +export declare class Logger { + className: string; + /** + * Creates a new Logger instance + * + * @param className - The Class name associated with the logging instance + * @param options - Optional logging settings + */ + constructor(className: string, options?: LoggerOptions); + /** + * Log a message at the debug level + * + * @param message - The message to log + * @param object - Additional meta data to log + */ + debug(message: string, object?: unknown): void; + /** + * Log a message at the warn level + * + * @param message - The message to log + * @param object - Additional meta data to log + */ + warn(message: string, object?: unknown): void; + /** + * Log a message at the info level + * + * @param message - The message to log + * @param object - Additional meta data to log + */ + info(message: string, object?: unknown): void; + /** + * Log a message at the error level + * + * @param message - The message to log + * @param object - Additional meta data to log + */ + error(message: string, object?: unknown): void; + /** Is the logger set at info level */ + isInfo(): boolean; + /** Is the logger set at error level */ + isError(): boolean; + /** Is the logger set at error level */ + isWarn(): boolean; + /** Is the logger set at debug level */ + isDebug(): boolean; + /** Resets the logger to default settings, error and no filtered classes */ + static reset(): void; + /** Get the current logger function */ + static currentLogger(): LoggerFunction; + /** + * Set the current logger function + * + * @param logger - Custom logging function + */ + static setCurrentLogger(logger: LoggerFunction): void; + /** + * Filter log messages for a particular class + * + * @param type - The type of filter (currently only class) + * @param values - The filters to apply + */ + static filter(type: string, values: string[]): void; + /** + * Set the current log level + * + * @param newLevel - Set current log level (debug, warn, info, error) + */ + static setLevel(newLevel: LoggerLevel): void; +} + +/** @public */ +export declare type LoggerFunction = (message?: any, ...optionalParams: any[]) => void; + +/** @public */ +export declare const LoggerLevel: Readonly<{ + readonly ERROR: "error"; + readonly WARN: "warn"; + readonly INFO: "info"; + readonly DEBUG: "debug"; + readonly error: "error"; + readonly warn: "warn"; + readonly info: "info"; + readonly debug: "debug"; +}>; + +/** @public */ +export declare type LoggerLevel = typeof LoggerLevel[keyof typeof LoggerLevel]; + +/** @public */ +export declare interface LoggerOptions { + logger?: LoggerFunction; + loggerLevel?: LoggerLevel; +} + +export { Long } + +export { Map_2 as Map } + +/** @public */ +export declare type MapFunction = (this: TSchema) => void; + +/** @public */ +export declare interface MapReduceOptions extends CommandOperationOptions { + /** Sets the output target for the map reduce job. */ + out?: 'inline' | { + inline: 1; + } | { + replace: string; + } | { + merge: string; + } | { + reduce: string; + }; + /** Query filter object. */ + query?: Document; + /** Sorts the input objects using this key. Useful for optimization, like sorting by the emit key for fewer reduces. */ + sort?: Sort; + /** Number of objects to return from collection. */ + limit?: number; + /** Keep temporary data. */ + keeptemp?: boolean; + /** Finalize function. */ + finalize?: FinalizeFunction | string; + /** Can pass in variables that can be access from map/reduce/finalize. */ + scope?: Document; + /** It is possible to make the execution stay in JS. Provided in MongoDB \> 2.0.X. */ + jsMode?: boolean; + /** Provide statistics on job execution time. */ + verbose?: boolean; + /** Allow driver to bypass schema validation in MongoDB 3.2 or higher. */ + bypassDocumentValidation?: boolean; +} + +/** @public */ +export declare type MatchKeysAndValues = Readonly> & Record; + +export { MaxKey } + +/* Excluded from this release type: MessageHeader */ + +/* Excluded from this release type: MessageStream */ + +/* Excluded from this release type: MessageStreamOptions */ +export { MinKey } + +/** @public */ +export declare interface ModifyResult { + value: WithId | null; + lastErrorObject?: Document; + ok: 0 | 1; +} + +/** @public */ +export declare const MONGO_CLIENT_EVENTS: readonly ["connectionPoolCreated", "connectionPoolClosed", "connectionCreated", "connectionReady", "connectionClosed", "connectionCheckOutStarted", "connectionCheckOutFailed", "connectionCheckedOut", "connectionCheckedIn", "connectionPoolCleared", "commandStarted", "commandSucceeded", "commandFailed", "serverOpening", "serverClosed", "serverDescriptionChanged", "topologyOpening", "topologyClosed", "topologyDescriptionChanged", "error", "timeout", "close", "serverHeartbeatStarted", "serverHeartbeatSucceeded", "serverHeartbeatFailed"]; + +/** + * An error generated when the driver API is used incorrectly + * + * @privateRemarks + * Should **never** be directly instantiated + * + * @public + * @category Error + */ +export declare class MongoAPIError extends MongoDriverError { + constructor(message: string); + get name(): string; +} + +/** + * A error generated when the user attempts to authenticate + * via AWS, but fails + * + * @public + * @category Error + */ +export declare class MongoAWSError extends MongoRuntimeError { + constructor(message: string); + get name(): string; +} + +/** + * An error generated when a batch command is re-executed after one of the commands in the batch + * has failed + * + * @public + * @category Error + */ +export declare class MongoBatchReExecutionError extends MongoAPIError { + constructor(message?: string); + get name(): string; +} + +/** + * An error indicating an unsuccessful Bulk Write + * @public + * @category Error + */ +export declare class MongoBulkWriteError extends MongoServerError { + result: BulkWriteResult; + writeErrors: OneOrMore; + err?: WriteConcernError; + /** Creates a new MongoBulkWriteError */ + constructor(error: { + message: string; + code: number; + writeErrors?: WriteError[]; + } | WriteConcernError | AnyError, result: BulkWriteResult); + get name(): string; + /** Number of documents inserted. */ + get insertedCount(): number; + /** Number of documents matched for update. */ + get matchedCount(): number; + /** Number of documents modified. */ + get modifiedCount(): number; + /** Number of documents deleted. */ + get deletedCount(): number; + /** Number of documents upserted. */ + get upsertedCount(): number; + /** Inserted document generated Id's, hash key is the index of the originating operation */ + get insertedIds(): { + [key: number]: any; + }; + /** Upserted document generated Id's, hash key is the index of the originating operation */ + get upsertedIds(): { + [key: number]: any; + }; +} + +/** + * An error generated when a ChangeStream operation fails to execute. + * + * @public + * @category Error + */ +export declare class MongoChangeStreamError extends MongoRuntimeError { + constructor(message: string); + get name(): string; +} + +/** + * The **MongoClient** class is a class that allows for making Connections to MongoDB. + * @public + * + * @remarks + * The programmatically provided options take precedent over the URI options. + * + * @example + * ```js + * // Connect using a MongoClient instance + * const MongoClient = require('mongodb').MongoClient; + * const test = require('assert'); + * // Connection url + * const url = 'mongodb://localhost:27017'; + * // Database Name + * const dbName = 'test'; + * // Connect using MongoClient + * const mongoClient = new MongoClient(url); + * mongoClient.connect(function(err, client) { + * const db = client.db(dbName); + * client.close(); + * }); + * ``` + * + * @example + * ```js + * // Connect using the MongoClient.connect static method + * const MongoClient = require('mongodb').MongoClient; + * const test = require('assert'); + * // Connection url + * const url = 'mongodb://localhost:27017'; + * // Database Name + * const dbName = 'test'; + * // Connect using MongoClient + * MongoClient.connect(url, function(err, client) { + * const db = client.db(dbName); + * client.close(); + * }); + * ``` + */ +export declare class MongoClient extends TypedEventEmitter { + /* Excluded from this release type: s */ + /* Excluded from this release type: topology */ + /* Excluded from this release type: [kOptions] */ + constructor(url: string, options?: MongoClientOptions); + get options(): Readonly; + get serverApi(): Readonly; + /* Excluded from this release type: monitorCommands */ + /* Excluded from this release type: monitorCommands */ + get autoEncrypter(): AutoEncrypter | undefined; + get readConcern(): ReadConcern | undefined; + get writeConcern(): WriteConcern | undefined; + get readPreference(): ReadPreference; + get bsonOptions(): BSONSerializeOptions; + get logger(): Logger; + /** + * Connect to MongoDB using a url + * + * @see docs.mongodb.org/manual/reference/connection-string/ + */ + connect(): Promise; + connect(callback: Callback): void; + /** + * Close the db and its underlying connections + * + * @param force - Force close, emitting no events + * @param callback - An optional callback, a Promise will be returned if none is provided + */ + close(): Promise; + close(callback: Callback): void; + close(force: boolean): Promise; + close(force: boolean, callback: Callback): void; + /** + * Create a new Db instance sharing the current socket connections. + * + * @param dbName - The name of the database we want to use. If not provided, use database name from connection string. + * @param options - Optional settings for Db construction + */ + db(dbName?: string, options?: DbOptions): Db; + /** + * Connect to MongoDB using a url + * + * @remarks + * The programmatically provided options take precedent over the URI options. + * + * @see https://docs.mongodb.org/manual/reference/connection-string/ + */ + static connect(url: string): Promise; + static connect(url: string, callback: Callback): void; + static connect(url: string, options: MongoClientOptions): Promise; + static connect(url: string, options: MongoClientOptions, callback: Callback): void; + /** Starts a new session on the server */ + startSession(): ClientSession; + startSession(options: ClientSessionOptions): ClientSession; + /** + * Runs a given operation with an implicitly created session. The lifetime of the session + * will be handled without the need for user interaction. + * + * NOTE: presently the operation MUST return a Promise (either explicit or implicitly as an async function) + * + * @param options - Optional settings for the command + * @param callback - An callback to execute with an implicitly created session + */ + withSession(callback: WithSessionCallback): Promise; + withSession(options: ClientSessionOptions, callback: WithSessionCallback): Promise; + /** + * Create a new Change Stream, watching for new changes (insertions, updates, + * replacements, deletions, and invalidations) in this cluster. Will ignore all + * changes to system collections, as well as the local, admin, and config databases. + * + * @remarks + * watch() accepts two generic arguments for distinct usecases: + * - The first is to provide the schema that may be defined for all the data within the current cluster + * - The second is to override the shape of the change stream document entirely, if it is not provided the type will default to ChangeStreamDocument of the first argument + * + * @param pipeline - An array of {@link https://docs.mongodb.com/manual/reference/operator/aggregation-pipeline/|aggregation pipeline stages} through which to pass change stream documents. This allows for filtering (using $match) and manipulating the change stream documents. + * @param options - Optional settings for the command + * @typeParam TSchema - Type of the data being detected by the change stream + * @typeParam TChange - Type of the whole change stream document emitted + */ + watch>(pipeline?: Document[], options?: ChangeStreamOptions): ChangeStream; + /** Return the mongo client logger */ + getLogger(): Logger; +} + +/** @public */ +export declare type MongoClientEvents = Pick & { + open(mongoClient: MongoClient): void; +}; + +/** + * Describes all possible URI query options for the mongo client + * @public + * @see https://docs.mongodb.com/manual/reference/connection-string + */ +export declare interface MongoClientOptions extends BSONSerializeOptions, SupportedNodeConnectionOptions { + /** Specifies the name of the replica set, if the mongod is a member of a replica set. */ + replicaSet?: string; + /** Enables or disables TLS/SSL for the connection. */ + tls?: boolean; + /** A boolean to enable or disables TLS/SSL for the connection. (The ssl option is equivalent to the tls option.) */ + ssl?: boolean; + /** Specifies the location of a local TLS Certificate */ + tlsCertificateFile?: string; + /** Specifies the location of a local .pem file that contains either the client's TLS/SSL certificate and key or only the client's TLS/SSL key when tlsCertificateFile is used to provide the certificate. */ + tlsCertificateKeyFile?: string; + /** Specifies the password to de-crypt the tlsCertificateKeyFile. */ + tlsCertificateKeyFilePassword?: string; + /** Specifies the location of a local .pem file that contains the root certificate chain from the Certificate Authority. This file is used to validate the certificate presented by the mongod/mongos instance. */ + tlsCAFile?: string; + /** Bypasses validation of the certificates presented by the mongod/mongos instance */ + tlsAllowInvalidCertificates?: boolean; + /** Disables hostname validation of the certificate presented by the mongod/mongos instance. */ + tlsAllowInvalidHostnames?: boolean; + /** Disables various certificate validations. */ + tlsInsecure?: boolean; + /** The time in milliseconds to attempt a connection before timing out. */ + connectTimeoutMS?: number; + /** The time in milliseconds to attempt a send or receive on a socket before the attempt times out. */ + socketTimeoutMS?: number; + /** An array or comma-delimited string of compressors to enable network compression for communication between this client and a mongod/mongos instance. */ + compressors?: CompressorName[] | string; + /** An integer that specifies the compression level if using zlib for network compression. */ + zlibCompressionLevel?: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | undefined; + /** The maximum number of hosts to connect to when using an srv connection string, a setting of `0` means unlimited hosts */ + srvMaxHosts?: number; + /** + * Modifies the srv URI to look like: + * + * `_{srvServiceName}._tcp.{hostname}.{domainname}` + * + * Querying this DNS URI is expected to respond with SRV records + */ + srvServiceName?: string; + /** The maximum number of connections in the connection pool. */ + maxPoolSize?: number; + /** The minimum number of connections in the connection pool. */ + minPoolSize?: number; + /** The maximum number of connections that may be in the process of being established concurrently by the connection pool. */ + maxConnecting?: number; + /** The maximum number of milliseconds that a connection can remain idle in the pool before being removed and closed. */ + maxIdleTimeMS?: number; + /** The maximum time in milliseconds that a thread can wait for a connection to become available. */ + waitQueueTimeoutMS?: number; + /** Specify a read concern for the collection (only MongoDB 3.2 or higher supported) */ + readConcern?: ReadConcernLike; + /** The level of isolation */ + readConcernLevel?: ReadConcernLevel; + /** Specifies the read preferences for this connection */ + readPreference?: ReadPreferenceMode | ReadPreference; + /** Specifies, in seconds, how stale a secondary can be before the client stops using it for read operations. */ + maxStalenessSeconds?: number; + /** Specifies the tags document as a comma-separated list of colon-separated key-value pairs. */ + readPreferenceTags?: TagSet[]; + /** The auth settings for when connection to server. */ + auth?: Auth; + /** Specify the database name associated with the user’s credentials. */ + authSource?: string; + /** Specify the authentication mechanism that MongoDB will use to authenticate the connection. */ + authMechanism?: AuthMechanism; + /** Specify properties for the specified authMechanism as a comma-separated list of colon-separated key-value pairs. */ + authMechanismProperties?: AuthMechanismProperties; + /** The size (in milliseconds) of the latency window for selecting among multiple suitable MongoDB instances. */ + localThresholdMS?: number; + /** Specifies how long (in milliseconds) to block for server selection before throwing an exception. */ + serverSelectionTimeoutMS?: number; + /** heartbeatFrequencyMS controls when the driver checks the state of the MongoDB deployment. Specify the interval (in milliseconds) between checks, counted from the end of the previous check until the beginning of the next one. */ + heartbeatFrequencyMS?: number; + /** Sets the minimum heartbeat frequency. In the event that the driver has to frequently re-check a server's availability, it will wait at least this long since the previous check to avoid wasted effort. */ + minHeartbeatFrequencyMS?: number; + /** The name of the application that created this MongoClient instance. MongoDB 3.4 and newer will print this value in the server log upon establishing each connection. It is also recorded in the slow query log and profile collections */ + appName?: string; + /** Enables retryable reads. */ + retryReads?: boolean; + /** Enable retryable writes. */ + retryWrites?: boolean; + /** Allow a driver to force a Single topology type with a connection string containing one host */ + directConnection?: boolean; + /** Instruct the driver it is connecting to a load balancer fronting a mongos like service */ + loadBalanced?: boolean; + /** The write concern w value */ + w?: W; + /** The write concern timeout */ + wtimeoutMS?: number; + /** The journal write concern */ + journal?: boolean; + /** Validate mongod server certificate against Certificate Authority */ + sslValidate?: boolean; + /** SSL Certificate file path. */ + sslCA?: string; + /** SSL Certificate file path. */ + sslCert?: string; + /** SSL Key file file path. */ + sslKey?: string; + /** SSL Certificate pass phrase. */ + sslPass?: string; + /** SSL Certificate revocation list file path. */ + sslCRL?: string; + /** TCP Connection no delay */ + noDelay?: boolean; + /** TCP Connection keep alive enabled */ + keepAlive?: boolean; + /** The number of milliseconds to wait before initiating keepAlive on the TCP socket */ + keepAliveInitialDelay?: number; + /** Force server to assign `_id` values instead of driver */ + forceServerObjectId?: boolean; + /** Return document results as raw BSON buffers */ + raw?: boolean; + /** A primary key factory function for generation of custom `_id` keys */ + pkFactory?: PkFactory; + /** A Promise library class the application wishes to use such as Bluebird, must be ES6 compatible */ + promiseLibrary?: any; + /** The logging level */ + loggerLevel?: LoggerLevel; + /** Custom logger object */ + logger?: Logger; + /** Enable command monitoring for this client */ + monitorCommands?: boolean; + /** Server API version */ + serverApi?: ServerApi | ServerApiVersion; + /** + * Optionally enable client side auto encryption + * + * @remarks + * Automatic encryption is an enterprise only feature that only applies to operations on a collection. Automatic encryption is not supported for operations on a database or view, and operations that are not bypassed will result in error + * (see [libmongocrypt: Auto Encryption Allow-List](https://github.com/mongodb/specifications/blob/master/source/client-side-encryption/client-side-encryption.rst#libmongocrypt-auto-encryption-allow-list)). To bypass automatic encryption for all operations, set bypassAutoEncryption=true in AutoEncryptionOpts. + * + * Automatic encryption requires the authenticated user to have the [listCollections privilege action](https://docs.mongodb.com/manual/reference/command/listCollections/#dbcmd.listCollections). + * + * If a MongoClient with a limited connection pool size (i.e a non-zero maxPoolSize) is configured with AutoEncryptionOptions, a separate internal MongoClient is created if any of the following are true: + * - AutoEncryptionOptions.keyVaultClient is not passed. + * - AutoEncryptionOptions.bypassAutomaticEncryption is false. + * + * If an internal MongoClient is created, it is configured with the same options as the parent MongoClient except minPoolSize is set to 0 and AutoEncryptionOptions is omitted. + */ + autoEncryption?: AutoEncryptionOptions; + /** Allows a wrapping driver to amend the client metadata generated by the driver to include information about the wrapping driver */ + driverInfo?: DriverInfo; + /** Configures a Socks5 proxy host used for creating TCP connections. */ + proxyHost?: string; + /** Configures a Socks5 proxy port used for creating TCP connections. */ + proxyPort?: number; + /** Configures a Socks5 proxy username when the proxy in proxyHost requires username/password authentication. */ + proxyUsername?: string; + /** Configures a Socks5 proxy password when the proxy in proxyHost requires username/password authentication. */ + proxyPassword?: string; + /* Excluded from this release type: srvPoller */ + /* Excluded from this release type: connectionType */ + /* Excluded from this release type: __index */ +} + +/* Excluded from this release type: MongoClientPrivate */ + +/** + * An error generated when a feature that is not enabled or allowed for the current server + * configuration is used + * + * + * @public + * @category Error + */ +export declare class MongoCompatibilityError extends MongoAPIError { + constructor(message: string); + get name(): string; +} + +/** + * A representation of the credentials used by MongoDB + * @public + */ +export declare class MongoCredentials { + /** The username used for authentication */ + readonly username: string; + /** The password used for authentication */ + readonly password: string; + /** The database that the user should authenticate against */ + readonly source: string; + /** The method used to authenticate */ + readonly mechanism: AuthMechanism; + /** Special properties used by some types of auth mechanisms */ + readonly mechanismProperties: AuthMechanismProperties; + constructor(options: MongoCredentialsOptions); + /** Determines if two MongoCredentials objects are equivalent */ + equals(other: MongoCredentials): boolean; + /** + * If the authentication mechanism is set to "default", resolves the authMechanism + * based on the server version and server supported sasl mechanisms. + * + * @param hello - A hello response from the server + */ + resolveAuthMechanism(hello?: Document): MongoCredentials; + validate(): void; + static merge(creds: MongoCredentials | undefined, options: Partial): MongoCredentials; +} + +/** @public */ +export declare interface MongoCredentialsOptions { + username: string; + password: string; + source: string; + db?: string; + mechanism?: AuthMechanism; + mechanismProperties: AuthMechanismProperties; +} + +/** + * An error thrown when an attempt is made to read from a cursor that has been exhausted + * + * @public + * @category Error + */ +export declare class MongoCursorExhaustedError extends MongoAPIError { + constructor(message?: string); + get name(): string; +} + +/** + * An error thrown when the user attempts to add options to a cursor that has already been + * initialized + * + * @public + * @category Error + */ +export declare class MongoCursorInUseError extends MongoAPIError { + constructor(message?: string); + get name(): string; +} + +/** @public */ +export declare class MongoDBNamespace { + db: string; + collection?: string; + /** + * Create a namespace object + * + * @param db - database name + * @param collection - collection name + */ + constructor(db: string, collection?: string); + toString(): string; + withCollection(collection: string): MongoDBNamespace; + static fromString(namespace?: string): MongoDBNamespace; +} + +/** + * An error generated when the driver fails to decompress + * data received from the server. + * + * @public + * @category Error + */ +export declare class MongoDecompressionError extends MongoRuntimeError { + constructor(message: string); + get name(): string; +} + +/** + * An error generated by the driver + * + * @public + * @category Error + */ +export declare class MongoDriverError extends MongoError { + constructor(message: string); + get name(): string; +} + +/** + * @public + * @category Error + * + * @privateRemarks + * CSFLE has a dependency on this error, it uses the constructor with a string argument + */ +export declare class MongoError extends Error { + /* Excluded from this release type: [kErrorLabels] */ + /** + * This is a number in MongoServerError and a string in MongoDriverError + * @privateRemarks + * Define the type override on the subclasses when we can use the override keyword + */ + code?: number | string; + topologyVersion?: TopologyVersion; + constructor(message: string | Error); + get name(): string; + /** Legacy name for server error responses */ + get errmsg(): string; + /** + * Checks the error to see if it has an error label + * + * @param label - The error label to check for + * @returns returns true if the error has the provided error label + */ + hasErrorLabel(label: string): boolean; + addErrorLabel(label: string): void; + get errorLabels(): string[]; +} + +/** @public */ +export declare const MongoErrorLabel: Readonly<{ + readonly RetryableWriteError: "RetryableWriteError"; + readonly TransientTransactionError: "TransientTransactionError"; + readonly UnknownTransactionCommitResult: "UnknownTransactionCommitResult"; + readonly ResumableChangeStreamError: "ResumableChangeStreamError"; + readonly HandshakeError: "HandshakeError"; +}>; + +/** @public */ +export declare type MongoErrorLabel = typeof MongoErrorLabel[keyof typeof MongoErrorLabel]; + +/** + * An error generated when the user attempts to operate + * on a session that has expired or has been closed. + * + * @public + * @category Error + */ +export declare class MongoExpiredSessionError extends MongoAPIError { + constructor(message?: string); + get name(): string; +} + +/** + * An error generated when a malformed or invalid chunk is + * encountered when reading from a GridFSStream. + * + * @public + * @category Error + */ +export declare class MongoGridFSChunkError extends MongoRuntimeError { + constructor(message: string); + get name(): string; +} + +/** An error generated when a GridFSStream operation fails to execute. + * + * @public + * @category Error + */ +export declare class MongoGridFSStreamError extends MongoRuntimeError { + constructor(message: string); + get name(): string; +} + +/** + * An error generated when the user supplies malformed or unexpected arguments + * or when a required argument or field is not provided. + * + * + * @public + * @category Error + */ +export declare class MongoInvalidArgumentError extends MongoAPIError { + constructor(message: string); + get name(): string; +} + +/** + * A error generated when the user attempts to authenticate + * via Kerberos, but fails to connect to the Kerberos client. + * + * @public + * @category Error + */ +export declare class MongoKerberosError extends MongoRuntimeError { + constructor(message: string); + get name(): string; +} + +/** + * An error generated when the user fails to provide authentication credentials before attempting + * to connect to a mongo server instance. + * + * + * @public + * @category Error + */ +export declare class MongoMissingCredentialsError extends MongoAPIError { + constructor(message: string); + get name(): string; +} + +/** + * An error generated when a required module or dependency is not present in the local environment + * + * @public + * @category Error + */ +export declare class MongoMissingDependencyError extends MongoAPIError { + constructor(message: string); + get name(): string; +} + +/** + * An error indicating an issue with the network, including TCP errors and timeouts. + * @public + * @category Error + */ +export declare class MongoNetworkError extends MongoError { + /* Excluded from this release type: [kBeforeHandshake] */ + constructor(message: string | Error, options?: MongoNetworkErrorOptions); + get name(): string; +} + +/** @public */ +export declare interface MongoNetworkErrorOptions { + /** Indicates the timeout happened before a connection handshake completed */ + beforeHandshake: boolean; +} + +/** + * An error indicating a network timeout occurred + * @public + * @category Error + * + * @privateRemarks + * CSFLE has a dependency on this error with an instanceof check + */ +export declare class MongoNetworkTimeoutError extends MongoNetworkError { + constructor(message: string, options?: MongoNetworkErrorOptions); + get name(): string; +} + +/** + * An error thrown when the user attempts to operate on a database or collection through a MongoClient + * that has not yet successfully called the "connect" method + * + * @public + * @category Error + */ +export declare class MongoNotConnectedError extends MongoAPIError { + constructor(message: string); + get name(): string; +} + +/** + * Mongo Client Options + * @public + */ +export declare interface MongoOptions extends Required>, SupportedNodeConnectionOptions { + hosts: HostAddress[]; + srvHost?: string; + credentials?: MongoCredentials; + readPreference: ReadPreference; + readConcern: ReadConcern; + loadBalanced: boolean; + serverApi: ServerApi; + compressors: CompressorName[]; + writeConcern: WriteConcern; + dbName: string; + metadata: ClientMetadata; + autoEncrypter?: AutoEncrypter; + proxyHost?: string; + proxyPort?: number; + proxyUsername?: string; + proxyPassword?: string; + /* Excluded from this release type: connectionType */ + /* Excluded from this release type: encrypter */ + /* Excluded from this release type: userSpecifiedAuthSource */ + /* Excluded from this release type: userSpecifiedReplicaSet */ + /** + * # NOTE ABOUT TLS Options + * + * If set TLS enabled, equivalent to setting the ssl option. + * + * ### Additional options: + * + * | nodejs option | MongoDB equivalent | type | + * |:---------------------|--------------------------------------------------------- |:---------------------------------------| + * | `ca` | `sslCA`, `tlsCAFile` | `string \| Buffer \| Buffer[]` | + * | `crl` | `sslCRL` | `string \| Buffer \| Buffer[]` | + * | `cert` | `sslCert`, `tlsCertificateFile`, `tlsCertificateKeyFile` | `string \| Buffer \| Buffer[]` | + * | `key` | `sslKey`, `tlsCertificateKeyFile` | `string \| Buffer \| KeyObject[]` | + * | `passphrase` | `sslPass`, `tlsCertificateKeyFilePassword` | `string` | + * | `rejectUnauthorized` | `sslValidate` | `boolean` | + * + */ + tls: boolean; + /* Excluded from this release type: __index */ +} + +/** + * An error used when attempting to parse a value (like a connection string) + * @public + * @category Error + */ +export declare class MongoParseError extends MongoDriverError { + constructor(message: string); + get name(): string; +} + +/** + * An error generated when the driver encounters unexpected input + * or reaches an unexpected/invalid internal state + * + * @privateRemarks + * Should **never** be directly instantiated. + * + * @public + * @category Error + */ +export declare class MongoRuntimeError extends MongoDriverError { + constructor(message: string); + get name(): string; +} + +/** + * An error generated when an attempt is made to operate + * on a closed/closing server. + * + * @public + * @category Error + */ +export declare class MongoServerClosedError extends MongoAPIError { + constructor(message?: string); + get name(): string; +} + +/** + * An error coming from the mongo server + * + * @public + * @category Error + */ +export declare class MongoServerError extends MongoError { + codeName?: string; + writeConcernError?: Document; + errInfo?: Document; + ok?: number; + [key: string]: any; + constructor(message: ErrorDescription); + get name(): string; +} + +/** + * An error signifying a client-side server selection error + * @public + * @category Error + */ +export declare class MongoServerSelectionError extends MongoSystemError { + constructor(message: string, reason: TopologyDescription); + get name(): string; +} + +/** + * An error signifying a general system issue + * @public + * @category Error + */ +export declare class MongoSystemError extends MongoError { + /** An optional reason context, such as an error saved during flow of monitoring and selecting servers */ + reason?: TopologyDescription; + constructor(message: string, reason: TopologyDescription); + get name(): string; +} + +/** + * An error thrown when the user calls a function or method not supported on a tailable cursor + * + * @public + * @category Error + */ +export declare class MongoTailableCursorError extends MongoAPIError { + constructor(message?: string); + get name(): string; +} + +/** + * An error generated when an attempt is made to operate on a + * dropped, or otherwise unavailable, database. + * + * @public + * @category Error + */ +export declare class MongoTopologyClosedError extends MongoAPIError { + constructor(message?: string); + get name(): string; +} + +/** + * An error generated when the user makes a mistake in the usage of transactions. + * (e.g. attempting to commit a transaction with a readPreference other than primary) + * + * @public + * @category Error + */ +export declare class MongoTransactionError extends MongoAPIError { + constructor(message: string); + get name(): string; +} + +/** + * An error generated when a **parsable** unexpected response comes from the server. + * This is generally an error where the driver in a state expecting a certain behavior to occur in + * the next message from MongoDB but it receives something else. + * This error **does not** represent an issue with wire message formatting. + * + * #### Example + * When an operation fails, it is the driver's job to retry it. It must perform serverSelection + * again to make sure that it attempts the operation against a server in a good state. If server + * selection returns a server that does not support retryable operations, this error is used. + * This scenario is unlikely as retryable support would also have been determined on the first attempt + * but it is possible the state change could report a selectable server that does not support retries. + * + * @public + * @category Error + */ +export declare class MongoUnexpectedServerResponseError extends MongoRuntimeError { + constructor(message: string); + get name(): string; +} + +/** + * An error thrown when the server reports a writeConcernError + * @public + * @category Error + */ +export declare class MongoWriteConcernError extends MongoServerError { + /** The result document (provided if ok: 1) */ + result?: Document; + constructor(message: ErrorDescription, result?: Document); + get name(): string; +} + +/* Excluded from this release type: Monitor */ + +/** @public */ +export declare type MonitorEvents = { + serverHeartbeatStarted(event: ServerHeartbeatStartedEvent): void; + serverHeartbeatSucceeded(event: ServerHeartbeatSucceededEvent): void; + serverHeartbeatFailed(event: ServerHeartbeatFailedEvent): void; + resetServer(error?: Error): void; + resetConnectionPool(): void; + close(): void; +} & EventEmitterWithState; + +/** @public */ +export declare interface MonitorOptions extends Omit { + connectTimeoutMS: number; + heartbeatFrequencyMS: number; + minHeartbeatFrequencyMS: number; +} + +/* Excluded from this release type: MonitorPrivate */ + +/* Excluded from this release type: Msg */ + +/** + * @public + * returns tuple of strings (keys to be joined on '.') that represent every path into a schema + * https://docs.mongodb.com/manual/tutorial/query-embedded-documents/ + */ +export declare type NestedPaths = Type extends string | number | boolean | Date | RegExp | Buffer | Uint8Array | ((...args: any[]) => any) | { + _bsontype: string; +} ? [] : Type extends ReadonlyArray ? [] | [number, ...NestedPaths] : Type extends Map ? [string] : Type extends object ? { + [Key in Extract]: Type[Key] extends Type ? [Key] : Type extends Type[Key] ? [Key] : Type[Key] extends ReadonlyArray ? Type extends ArrayType ? [Key] : ArrayType extends Type ? [Key] : [ + Key, + ...NestedPaths + ] : [ + Key, + ...NestedPaths + ]; +}[Extract] : []; + +/** + * @public + * A type that extends Document but forbids anything that "looks like" an object id. + */ +export declare type NonObjectIdLikeDocument = { + [key in keyof ObjectIdLike]?: never; +} & Document; + +/** It avoids using fields with not acceptable types @public */ +export declare type NotAcceptedFields = { + readonly [key in KeysOfOtherType]?: never; +}; + +/** @public */ +export declare type NumericType = IntegerType | Decimal128 | Double; + +/** + * @public + * @deprecated Please use `ObjectId` + */ +export declare const ObjectID: typeof ObjectId; + +export { ObjectId } + +/** @public */ +export declare type OneOrMore = T | ReadonlyArray; + +/** @public */ +export declare type OnlyFieldsOfType = IsAny, AcceptedFields & NotAcceptedFields & Record>; + +/* Excluded from this release type: OperationDescription */ + +/** @public */ +export declare interface OperationOptions extends BSONSerializeOptions { + /** Specify ClientSession for this command */ + session?: ClientSession; + willRetryWrite?: boolean; + /** The preferred read preference (ReadPreference.primary, ReadPreference.primary_preferred, ReadPreference.secondary, ReadPreference.secondary_preferred, ReadPreference.nearest). */ + readPreference?: ReadPreferenceLike; + /* Excluded from this release type: bypassPinningCheck */ + omitReadPreference?: boolean; +} + +/* Excluded from this release type: OperationParent */ + +/** + * Represents a specific point in time on a server. Can be retrieved by using `db.command()` + * @public + * @see https://docs.mongodb.com/manual/reference/method/db.runCommand/#response + */ +export declare type OperationTime = Timestamp; + +/* Excluded from this release type: OpGetMoreOptions */ + +/* Excluded from this release type: OpMsgOptions */ + +/* Excluded from this release type: OpQueryOptions */ + +/* Excluded from this release type: OpResponseOptions */ + +/** + * Add an optional _id field to an object shaped type + * @public + */ +export declare type OptionalId = EnhancedOmit & { + _id?: InferIdType; +}; + +/** + * Adds an optional _id field to an object shaped type, unless the _id field is requried on that type. + * In the case _id is required, this method continues to require_id. + * + * @public + * + * @privateRemarks + * `ObjectId extends TSchema['_id']` is a confusing ordering at first glance. Rather than ask + * `TSchema['_id'] extends ObjectId` which translated to "Is the _id property ObjectId?" + * we instead ask "Does ObjectId look like (have the same shape) as the _id?" + */ +export declare type OptionalUnlessRequiredId = TSchema extends { + _id: any; +} ? TSchema : OptionalId; + +/** @public */ +export declare class OrderedBulkOperation extends BulkOperationBase { + constructor(collection: Collection, options: BulkWriteOptions); + addToOperationsList(batchType: BatchType, document: Document | UpdateStatement | DeleteStatement): this; +} + +/** @public */ +export declare interface PipeOptions { + end?: boolean; +} + +/** @public */ +export declare interface PkFactory { + createPk(): any; +} + +/** @public */ +export declare const ProfilingLevel: Readonly<{ + readonly off: "off"; + readonly slowOnly: "slow_only"; + readonly all: "all"; +}>; + +/** @public */ +export declare type ProfilingLevel = typeof ProfilingLevel[keyof typeof ProfilingLevel]; + +/** @public */ +export declare type ProfilingLevelOptions = CommandOperationOptions; + +/** + * @public + * Projection is flexible to permit the wide array of aggregation operators + * @deprecated since v4.1.0: Since projections support all aggregation operations we have no plans to narrow this type further + */ +export declare type Projection = Document; + +/** + * @public + * @deprecated since v4.1.0: Since projections support all aggregation operations we have no plans to narrow this type further + */ +export declare type ProjectionOperators = Document; + +/** + * Global promise store allowing user-provided promises + * @public + */ +declare class Promise_2 { + /** Validates the passed in promise library */ + static validate(lib: unknown): lib is PromiseConstructor; + /** Sets the promise library */ + static set(lib: PromiseConstructor): void; + /** Get the stored promise library, or resolves passed in */ + static get(): PromiseConstructor; +} +export { Promise_2 as Promise } + +/** @public */ +export declare type PropertyType = string extends Property ? unknown : Property extends keyof Type ? Type[Property] : Property extends `${number}` ? Type extends ReadonlyArray ? ArrayType : unknown : Property extends `${infer Key}.${infer Rest}` ? Key extends `${number}` ? Type extends ReadonlyArray ? PropertyType : unknown : Key extends keyof Type ? Type[Key] extends Map ? MapType : PropertyType : unknown : unknown; + +/** @public */ +export declare interface ProxyOptions { + proxyHost?: string; + proxyPort?: number; + proxyUsername?: string; + proxyPassword?: string; +} + +/** @public */ +export declare type PullAllOperator = ({ + readonly [key in KeysOfAType>]?: TSchema[key]; +} & NotAcceptedFields>) & { + readonly [key: string]: ReadonlyArray; +}; + +/** @public */ +export declare type PullOperator = ({ + readonly [key in KeysOfAType>]?: Partial> | FilterOperations>; +} & NotAcceptedFields>) & { + readonly [key: string]: FilterOperators | any; +}; + +/** @public */ +export declare type PushOperator = ({ + readonly [key in KeysOfAType>]?: Flatten | ArrayOperator>>; +} & NotAcceptedFields>) & { + readonly [key: string]: ArrayOperator | any; +}; + +/* Excluded from this release type: Query */ + +/* Excluded from this release type: QueryOptions */ + +/** + * The MongoDB ReadConcern, which allows for control of the consistency and isolation properties + * of the data read from replica sets and replica set shards. + * @public + * + * @see https://docs.mongodb.com/manual/reference/read-concern/index.html + */ +export declare class ReadConcern { + level: ReadConcernLevel | string; + /** Constructs a ReadConcern from the read concern level.*/ + constructor(level: ReadConcernLevel); + /** + * Construct a ReadConcern given an options object. + * + * @param options - The options object from which to extract the write concern. + */ + static fromOptions(options?: { + readConcern?: ReadConcernLike; + level?: ReadConcernLevel; + }): ReadConcern | undefined; + static get MAJORITY(): 'majority'; + static get AVAILABLE(): 'available'; + static get LINEARIZABLE(): 'linearizable'; + static get SNAPSHOT(): 'snapshot'; + toJSON(): Document; +} + +/** @public */ +export declare const ReadConcernLevel: Readonly<{ + readonly local: "local"; + readonly majority: "majority"; + readonly linearizable: "linearizable"; + readonly available: "available"; + readonly snapshot: "snapshot"; +}>; + +/** @public */ +export declare type ReadConcernLevel = typeof ReadConcernLevel[keyof typeof ReadConcernLevel]; + +/** @public */ +export declare type ReadConcernLike = ReadConcern | { + level: ReadConcernLevel; +} | ReadConcernLevel; + +/** + * The **ReadPreference** class is a class that represents a MongoDB ReadPreference and is + * used to construct connections. + * @public + * + * @see https://docs.mongodb.com/manual/core/read-preference/ + */ +export declare class ReadPreference { + mode: ReadPreferenceMode; + tags?: TagSet[]; + hedge?: HedgeOptions; + maxStalenessSeconds?: number; + minWireVersion?: number; + static PRIMARY: "primary"; + static PRIMARY_PREFERRED: "primaryPreferred"; + static SECONDARY: "secondary"; + static SECONDARY_PREFERRED: "secondaryPreferred"; + static NEAREST: "nearest"; + static primary: ReadPreference; + static primaryPreferred: ReadPreference; + static secondary: ReadPreference; + static secondaryPreferred: ReadPreference; + static nearest: ReadPreference; + /** + * @param mode - A string describing the read preference mode (primary|primaryPreferred|secondary|secondaryPreferred|nearest) + * @param tags - A tag set used to target reads to members with the specified tag(s). tagSet is not available if using read preference mode primary. + * @param options - Additional read preference options + */ + constructor(mode: ReadPreferenceMode, tags?: TagSet[], options?: ReadPreferenceOptions); + get preference(): ReadPreferenceMode; + static fromString(mode: string): ReadPreference; + /** + * Construct a ReadPreference given an options object. + * + * @param options - The options object from which to extract the read preference. + */ + static fromOptions(options?: ReadPreferenceFromOptions): ReadPreference | undefined; + /** + * Replaces options.readPreference with a ReadPreference instance + */ + static translate(options: ReadPreferenceLikeOptions): ReadPreferenceLikeOptions; + /** + * Validate if a mode is legal + * + * @param mode - The string representing the read preference mode. + */ + static isValid(mode: string): boolean; + /** + * Validate if a mode is legal + * + * @param mode - The string representing the read preference mode. + */ + isValid(mode?: string): boolean; + /** + * Indicates that this readPreference needs the "secondaryOk" bit when sent over the wire + * @deprecated Use secondaryOk instead + * @see https://docs.mongodb.com/manual/reference/mongodb-wire-protocol/#op-query + */ + slaveOk(): boolean; + /** + * Indicates that this readPreference needs the "SecondaryOk" bit when sent over the wire + * @see https://docs.mongodb.com/manual/reference/mongodb-wire-protocol/#op-query + */ + secondaryOk(): boolean; + /** + * Check if the two ReadPreferences are equivalent + * + * @param readPreference - The read preference with which to check equality + */ + equals(readPreference: ReadPreference): boolean; + /** Return JSON representation */ + toJSON(): Document; +} + +/** @public */ +export declare interface ReadPreferenceFromOptions extends ReadPreferenceLikeOptions { + session?: ClientSession; + readPreferenceTags?: TagSet[]; + hedge?: HedgeOptions; +} + +/** @public */ +export declare type ReadPreferenceLike = ReadPreference | ReadPreferenceMode; + +/** @public */ +export declare interface ReadPreferenceLikeOptions extends ReadPreferenceOptions { + readPreference?: ReadPreferenceLike | { + mode?: ReadPreferenceMode; + preference?: ReadPreferenceMode; + tags?: TagSet[]; + maxStalenessSeconds?: number; + }; +} + +/** @public */ +export declare const ReadPreferenceMode: Readonly<{ + readonly primary: "primary"; + readonly primaryPreferred: "primaryPreferred"; + readonly secondary: "secondary"; + readonly secondaryPreferred: "secondaryPreferred"; + readonly nearest: "nearest"; +}>; + +/** @public */ +export declare type ReadPreferenceMode = typeof ReadPreferenceMode[keyof typeof ReadPreferenceMode]; + +/** @public */ +export declare interface ReadPreferenceOptions { + /** Max secondary read staleness in seconds, Minimum value is 90 seconds.*/ + maxStalenessSeconds?: number; + /** Server mode in which the same query is dispatched in parallel to multiple replica set members. */ + hedge?: HedgeOptions; +} + +/** @public */ +export declare type ReduceFunction = (key: TKey, values: TValue[]) => TValue; + +/** @public */ +export declare type RegExpOrString = T extends string ? BSONRegExp | RegExp | T : T; + +/** @public */ +export declare type RemoveUserOptions = CommandOperationOptions; + +/** @public */ +export declare interface RenameOptions extends CommandOperationOptions { + /** Drop the target name collection if it previously exists. */ + dropTarget?: boolean; + /** Unclear */ + new_collection?: boolean; +} + +/** @public */ +export declare interface ReplaceOneModel { + /** The filter to limit the replaced document. */ + filter: Filter; + /** The document with which to replace the matched document. */ + replacement: WithoutId; + /** Specifies a collation. */ + collation?: CollationOptions; + /** The index to use. If specified, then the query system will only consider plans using the hinted index. */ + hint?: Hint; + /** When true, creates a new document if no document matches the query. */ + upsert?: boolean; +} + +/** @public */ +export declare interface ReplaceOptions extends CommandOperationOptions { + /** If true, allows the write to opt-out of document level validation */ + bypassDocumentValidation?: boolean; + /** Specifies a collation */ + collation?: CollationOptions; + /** Specify that the update query should only consider plans using the hinted index */ + hint?: string | Document; + /** When true, creates a new document if no document matches the query */ + upsert?: boolean; + /** Map of parameter names and values that can be accessed using $$var (requires MongoDB 5.0). */ + let?: Document; +} + +/* Excluded from this release type: Response */ + +/** + * @public + * @deprecated Please use the ChangeStreamCursorOptions type instead. + */ +export declare interface ResumeOptions { + startAtOperationTime?: Timestamp; + batchSize?: number; + maxAwaitTimeMS?: number; + collation?: CollationOptions; + readPreference?: ReadPreference; + resumeAfter?: ResumeToken; + startAfter?: ResumeToken; + fullDocument?: string; +} + +/** + * Represents the logical starting point for a new ChangeStream or resuming a ChangeStream on the server. + * @see https://www.mongodb.com/docs/manual/changeStreams/#std-label-change-stream-resume + * @public + */ +export declare type ResumeToken = unknown; + +/** @public */ +export declare const ReturnDocument: Readonly<{ + readonly BEFORE: "before"; + readonly AFTER: "after"; +}>; + +/** @public */ +export declare type ReturnDocument = typeof ReturnDocument[keyof typeof ReturnDocument]; + +/** @public */ +export declare interface RoleSpecification { + /** + * A role grants privileges to perform sets of actions on defined resources. + * A given role applies to the database on which it is defined and can grant access down to a collection level of granularity. + */ + role: string; + /** The database this user's role should effect. */ + db: string; +} + +/** @public */ +export declare interface RootFilterOperators extends Document { + $and?: Filter[]; + $nor?: Filter[]; + $or?: Filter[]; + $text?: { + $search: string; + $language?: string; + $caseSensitive?: boolean; + $diacriticSensitive?: boolean; + }; + $where?: string | ((this: TSchema) => boolean); + $comment?: string | Document; +} + +/* Excluded from this release type: RTTPinger */ + +/* Excluded from this release type: RTTPingerOptions */ + +/** @public */ +export declare type RunCommandOptions = CommandOperationOptions; + +/** @public */ +export declare type SchemaMember = { + [P in keyof T]?: V; +} | { + [key: string]: V; +}; + +/** @public */ +export declare interface SelectServerOptions { + readPreference?: ReadPreferenceLike; + /** How long to block for server selection before throwing an error */ + serverSelectionTimeoutMS?: number; + session?: ClientSession; +} + +/* Excluded from this release type: serialize */ + +/* Excluded from this release type: Server */ + +/** @public */ +export declare interface ServerApi { + version: ServerApiVersion; + strict?: boolean; + deprecationErrors?: boolean; +} + +/** @public */ +export declare const ServerApiVersion: Readonly<{ + readonly v1: "1"; +}>; + +/** @public */ +export declare type ServerApiVersion = typeof ServerApiVersion[keyof typeof ServerApiVersion]; + +/** @public */ +export declare class ServerCapabilities { + maxWireVersion: number; + minWireVersion: number; + constructor(hello: Document); + get hasAggregationCursor(): boolean; + get hasWriteCommands(): boolean; + get hasTextSearch(): boolean; + get hasAuthCommands(): boolean; + get hasListCollectionsCommand(): boolean; + get hasListIndexesCommand(): boolean; + get supportsSnapshotReads(): boolean; + get commandsTakeWriteConcern(): boolean; + get commandsTakeCollation(): boolean; +} + +/** + * Emitted when server is closed. + * @public + * @category Event + */ +export declare class ServerClosedEvent { + /** A unique identifier for the topology */ + topologyId: number; + /** The address (host/port pair) of the server */ + address: string; + /* Excluded from this release type: __constructor */ +} + +/** + * The client's view of a single server, based on the most recent hello outcome. + * + * Internal type, not meant to be directly instantiated + * @public + */ +export declare class ServerDescription { + private _hostAddress; + address: string; + type: ServerType; + hosts: string[]; + passives: string[]; + arbiters: string[]; + tags: TagSet; + error?: MongoError; + topologyVersion?: TopologyVersion; + minWireVersion: number; + maxWireVersion: number; + roundTripTime: number; + lastUpdateTime: number; + lastWriteDate: number; + me?: string; + primary?: string; + setName?: string; + setVersion?: number; + electionId?: ObjectId; + logicalSessionTimeoutMinutes?: number; + $clusterTime?: ClusterTime; + /* Excluded from this release type: __constructor */ + get hostAddress(): HostAddress; + get allHosts(): string[]; + /** Is this server available for reads*/ + get isReadable(): boolean; + /** Is this server data bearing */ + get isDataBearing(): boolean; + /** Is this server available for writes */ + get isWritable(): boolean; + get host(): string; + get port(): number; + /** + * Determines if another `ServerDescription` is equal to this one per the rules defined + * in the {@link https://github.com/mongodb/specifications/blob/master/source/server-discovery-and-monitoring/server-discovery-and-monitoring.rst#serverdescription|SDAM spec} + */ + equals(other: ServerDescription): boolean; +} + +/** + * Emitted when server description changes, but does NOT include changes to the RTT. + * @public + * @category Event + */ +export declare class ServerDescriptionChangedEvent { + /** A unique identifier for the topology */ + topologyId: number; + /** The address (host/port pair) of the server */ + address: string; + /** The previous server description */ + previousDescription: ServerDescription; + /** The new server description */ + newDescription: ServerDescription; + /* Excluded from this release type: __constructor */ +} + +/* Excluded from this release type: ServerDescriptionOptions */ + +/** @public */ +export declare type ServerEvents = { + serverHeartbeatStarted(event: ServerHeartbeatStartedEvent): void; + serverHeartbeatSucceeded(event: ServerHeartbeatSucceededEvent): void; + serverHeartbeatFailed(event: ServerHeartbeatFailedEvent): void; + /* Excluded from this release type: connect */ + descriptionReceived(description: ServerDescription): void; + closed(): void; + ended(): void; +} & ConnectionPoolEvents & EventEmitterWithState; + +/** + * Emitted when the server monitor’s hello fails, either with an “ok: 0” or a socket exception. + * @public + * @category Event + */ +export declare class ServerHeartbeatFailedEvent { + /** The connection id for the command */ + connectionId: string; + /** The execution time of the event in ms */ + duration: number; + /** The command failure */ + failure: Error; + /* Excluded from this release type: __constructor */ +} + +/** + * Emitted when the server monitor’s hello command is started - immediately before + * the hello command is serialized into raw BSON and written to the socket. + * + * @public + * @category Event + */ +export declare class ServerHeartbeatStartedEvent { + /** The connection id for the command */ + connectionId: string; + /* Excluded from this release type: __constructor */ +} + +/** + * Emitted when the server monitor’s hello succeeds. + * @public + * @category Event + */ +export declare class ServerHeartbeatSucceededEvent { + /** The connection id for the command */ + connectionId: string; + /** The execution time of the event in ms */ + duration: number; + /** The command reply */ + reply: Document; + /* Excluded from this release type: __constructor */ +} + +/** + * Emitted when server is initialized. + * @public + * @category Event + */ +export declare class ServerOpeningEvent { + /** A unique identifier for the topology */ + topologyId: number; + /** The address (host/port pair) of the server */ + address: string; + /* Excluded from this release type: __constructor */ +} + +/** @public */ +export declare type ServerOptions = Omit & MonitorOptions; + +/* Excluded from this release type: ServerPrivate */ + +/* Excluded from this release type: ServerSelectionCallback */ + +/* Excluded from this release type: ServerSelectionRequest */ + +/** @public */ +export declare type ServerSelector = (topologyDescription: TopologyDescription, servers: ServerDescription[]) => ServerDescription[]; + +/** + * Reflects the existence of a session on the server. Can be reused by the session pool. + * WARNING: not meant to be instantiated directly. For internal use only. + * @public + */ +export declare class ServerSession { + id: ServerSessionId; + lastUse: number; + txnNumber: number; + isDirty: boolean; + /* Excluded from this release type: __constructor */ + /** + * Determines if the server session has timed out. + * + * @param sessionTimeoutMinutes - The server's "logicalSessionTimeoutMinutes" + */ + hasTimedOut(sessionTimeoutMinutes: number): boolean; + /* Excluded from this release type: clone */ +} + +/** @public */ +export declare type ServerSessionId = { + id: Binary; +}; + +/* Excluded from this release type: ServerSessionPool */ + +/** + * An enumeration of server types we know about + * @public + */ +export declare const ServerType: Readonly<{ + readonly Standalone: "Standalone"; + readonly Mongos: "Mongos"; + readonly PossiblePrimary: "PossiblePrimary"; + readonly RSPrimary: "RSPrimary"; + readonly RSSecondary: "RSSecondary"; + readonly RSArbiter: "RSArbiter"; + readonly RSOther: "RSOther"; + readonly RSGhost: "RSGhost"; + readonly Unknown: "Unknown"; + readonly LoadBalancer: "LoadBalancer"; +}>; + +/** @public */ +export declare type ServerType = typeof ServerType[keyof typeof ServerType]; + +/** @public */ +export declare type SetFields = ({ + readonly [key in KeysOfAType | undefined>]?: OptionalId> | AddToSetOperators>>>; +} & NotAcceptedFields | undefined>) & { + readonly [key: string]: AddToSetOperators | any; +}; + +/** @public */ +export declare type SetProfilingLevelOptions = CommandOperationOptions; + +/** @public */ +export declare type Sort = string | Exclude | string[] | { + [key: string]: SortDirection; +} | Map | [string, SortDirection][] | [string, SortDirection]; + +/** @public */ +export declare type SortDirection = 1 | -1 | 'asc' | 'desc' | 'ascending' | 'descending' | { + $meta: string; +}; + +/* Excluded from this release type: SortDirectionForCmd */ + +/* Excluded from this release type: SortForCmd */ + +/* Excluded from this release type: SrvPoller */ + +/* Excluded from this release type: SrvPollerEvents */ + +/* Excluded from this release type: SrvPollerOptions */ + +/* Excluded from this release type: SrvPollingEvent */ + +/** @public */ +export declare type Stream = Socket | TLSSocket; + +/** @public */ +export declare class StreamDescription { + address: string; + type: string; + minWireVersion?: number; + maxWireVersion?: number; + maxBsonObjectSize: number; + maxMessageSizeBytes: number; + maxWriteBatchSize: number; + compressors: CompressorName[]; + compressor?: CompressorName; + logicalSessionTimeoutMinutes?: number; + loadBalanced: boolean; + __nodejs_mock_server__?: boolean; + zlibCompressionLevel?: number; + constructor(address: string, options?: StreamDescriptionOptions); + receiveResponse(response: Document | null): void; +} + +/** @public */ +export declare interface StreamDescriptionOptions { + compressors?: CompressorName[]; + logicalSessionTimeoutMinutes?: number; + loadBalanced: boolean; +} + +/** @public */ +export declare type SupportedNodeConnectionOptions = SupportedTLSConnectionOptions & SupportedTLSSocketOptions & SupportedSocketOptions; + +/** @public */ +export declare type SupportedSocketOptions = Pick; + +/** @public */ +export declare type SupportedTLSConnectionOptions = Pick>; + +/** @public */ +export declare type SupportedTLSSocketOptions = Pick>; + +/** @public */ +export declare type TagSet = { + [key: string]: string; +}; + +/* Excluded from this release type: TimerQueue */ + +/** @public + * Configuration options for timeseries collections + * @see https://docs.mongodb.com/manual/core/timeseries-collections/ + */ +export declare interface TimeSeriesCollectionOptions extends Document { + timeField: string; + metaField?: string; + granularity?: 'seconds' | 'minutes' | 'hours' | string; +} + +export { Timestamp } + +/* Excluded from this release type: Topology */ + +/** + * Emitted when topology is closed. + * @public + * @category Event + */ +export declare class TopologyClosedEvent { + /** A unique identifier for the topology */ + topologyId: number; + /* Excluded from this release type: __constructor */ +} + +/** + * Representation of a deployment of servers + * @public + */ +export declare class TopologyDescription { + type: TopologyType; + setName?: string; + maxSetVersion?: number; + maxElectionId?: ObjectId; + servers: Map; + stale: boolean; + compatible: boolean; + compatibilityError?: string; + logicalSessionTimeoutMinutes?: number; + heartbeatFrequencyMS: number; + localThresholdMS: number; + commonWireVersion?: number; + /** + * Create a TopologyDescription + */ + constructor(topologyType: TopologyType, serverDescriptions?: Map, setName?: string, maxSetVersion?: number, maxElectionId?: ObjectId, commonWireVersion?: number, options?: TopologyDescriptionOptions); + /* Excluded from this release type: updateFromSrvPollingEvent */ + /* Excluded from this release type: update */ + get error(): MongoError | undefined; + /** + * Determines if the topology description has any known servers + */ + get hasKnownServers(): boolean; + /** + * Determines if this topology description has a data-bearing server available. + */ + get hasDataBearingServers(): boolean; + /* Excluded from this release type: hasServer */ +} + +/** + * Emitted when topology description changes. + * @public + * @category Event + */ +export declare class TopologyDescriptionChangedEvent { + /** A unique identifier for the topology */ + topologyId: number; + /** The old topology description */ + previousDescription: TopologyDescription; + /** The new topology description */ + newDescription: TopologyDescription; + /* Excluded from this release type: __constructor */ +} + +/** @public */ +export declare interface TopologyDescriptionOptions { + heartbeatFrequencyMS?: number; + localThresholdMS?: number; +} + +/** @public */ +export declare type TopologyEvents = { + /* Excluded from this release type: connect */ + serverOpening(event: ServerOpeningEvent): void; + serverClosed(event: ServerClosedEvent): void; + serverDescriptionChanged(event: ServerDescriptionChangedEvent): void; + topologyClosed(event: TopologyClosedEvent): void; + topologyOpening(event: TopologyOpeningEvent): void; + topologyDescriptionChanged(event: TopologyDescriptionChangedEvent): void; + error(error: Error): void; + /* Excluded from this release type: open */ + close(): void; + timeout(): void; +} & Omit & ConnectionPoolEvents & ConnectionEvents & EventEmitterWithState; + +/** + * Emitted when topology is initialized. + * @public + * @category Event + */ +export declare class TopologyOpeningEvent { + /** A unique identifier for the topology */ + topologyId: number; + /* Excluded from this release type: __constructor */ +} + +/** @public */ +export declare interface TopologyOptions extends BSONSerializeOptions, ServerOptions { + srvMaxHosts: number; + srvServiceName: string; + hosts: HostAddress[]; + retryWrites: boolean; + retryReads: boolean; + /** How long to block for server selection before throwing an error */ + serverSelectionTimeoutMS: number; + /** The name of the replica set to connect to */ + replicaSet?: string; + srvHost?: string; + /* Excluded from this release type: srvPoller */ + /** Indicates that a client should directly connect to a node without attempting to discover its topology type */ + directConnection: boolean; + loadBalanced: boolean; + metadata: ClientMetadata; + /** MongoDB server API version */ + serverApi?: ServerApi; + /* Excluded from this release type: __index */ +} + +/* Excluded from this release type: TopologyPrivate */ + +/** + * An enumeration of topology types we know about + * @public + */ +export declare const TopologyType: Readonly<{ + readonly Single: "Single"; + readonly ReplicaSetNoPrimary: "ReplicaSetNoPrimary"; + readonly ReplicaSetWithPrimary: "ReplicaSetWithPrimary"; + readonly Sharded: "Sharded"; + readonly Unknown: "Unknown"; + readonly LoadBalanced: "LoadBalanced"; +}>; + +/** @public */ +export declare type TopologyType = typeof TopologyType[keyof typeof TopologyType]; + +/** @public */ +export declare interface TopologyVersion { + processId: ObjectId; + counter: Long; +} + +/** + * @public + * A class maintaining state related to a server transaction. Internal Only + */ +export declare class Transaction { + /* Excluded from this release type: state */ + options: TransactionOptions; + /* Excluded from this release type: _pinnedServer */ + /* Excluded from this release type: _recoveryToken */ + /* Excluded from this release type: __constructor */ + /* Excluded from this release type: server */ + get recoveryToken(): Document | undefined; + get isPinned(): boolean; + /** @returns Whether the transaction has started */ + get isStarting(): boolean; + /** + * @returns Whether this session is presently in a transaction + */ + get isActive(): boolean; + get isCommitted(): boolean; + /* Excluded from this release type: transition */ + /* Excluded from this release type: pinServer */ + /* Excluded from this release type: unpinServer */ +} + +/** + * Configuration options for a transaction. + * @public + */ +export declare interface TransactionOptions extends CommandOperationOptions { + /** A default read concern for commands in this transaction */ + readConcern?: ReadConcernLike; + /** A default writeConcern for commands in this transaction */ + writeConcern?: WriteConcern; + /** A default read preference for commands in this transaction */ + readPreference?: ReadPreference; + /** Specifies the maximum amount of time to allow a commit action on a transaction to run in milliseconds */ + maxCommitTimeMS?: number; +} + +/* Excluded from this release type: TxnState */ + +/** + * Typescript type safe event emitter + * @public + */ +export declare interface TypedEventEmitter extends EventEmitter { + addListener(event: EventKey, listener: Events[EventKey]): this; + addListener(event: CommonEvents, listener: (eventName: string | symbol, listener: GenericListener) => void): this; + addListener(event: string | symbol, listener: GenericListener): this; + on(event: EventKey, listener: Events[EventKey]): this; + on(event: CommonEvents, listener: (eventName: string | symbol, listener: GenericListener) => void): this; + on(event: string | symbol, listener: GenericListener): this; + once(event: EventKey, listener: Events[EventKey]): this; + once(event: CommonEvents, listener: (eventName: string | symbol, listener: GenericListener) => void): this; + once(event: string | symbol, listener: GenericListener): this; + removeListener(event: EventKey, listener: Events[EventKey]): this; + removeListener(event: CommonEvents, listener: (eventName: string | symbol, listener: GenericListener) => void): this; + removeListener(event: string | symbol, listener: GenericListener): this; + off(event: EventKey, listener: Events[EventKey]): this; + off(event: CommonEvents, listener: (eventName: string | symbol, listener: GenericListener) => void): this; + off(event: string | symbol, listener: GenericListener): this; + removeAllListeners(event?: EventKey | CommonEvents | symbol | string): this; + listeners(event: EventKey | CommonEvents | symbol | string): Events[EventKey][]; + rawListeners(event: EventKey | CommonEvents | symbol | string): Events[EventKey][]; + emit(event: EventKey | symbol, ...args: Parameters): boolean; + listenerCount(type: EventKey | CommonEvents | symbol | string): number; + prependListener(event: EventKey, listener: Events[EventKey]): this; + prependListener(event: CommonEvents, listener: (eventName: string | symbol, listener: GenericListener) => void): this; + prependListener(event: string | symbol, listener: GenericListener): this; + prependOnceListener(event: EventKey, listener: Events[EventKey]): this; + prependOnceListener(event: CommonEvents, listener: (eventName: string | symbol, listener: GenericListener) => void): this; + prependOnceListener(event: string | symbol, listener: GenericListener): this; + eventNames(): string[]; + getMaxListeners(): number; + setMaxListeners(n: number): this; +} + +/** + * Typescript type safe event emitter + * @public + */ +export declare class TypedEventEmitter extends EventEmitter { +} + +/** @public */ +export declare class UnorderedBulkOperation extends BulkOperationBase { + constructor(collection: Collection, options: BulkWriteOptions); + handleWriteError(callback: Callback, writeResult: BulkWriteResult): boolean; + addToOperationsList(batchType: BatchType, document: Document | UpdateStatement | DeleteStatement): this; +} + +/** @public */ +export declare interface UpdateDescription { + /** + * A document containing key:value pairs of names of the fields that were + * changed, and the new value for those fields. + */ + updatedFields?: Partial; + /** + * An array of field names that were removed from the document. + */ + removedFields?: string[]; + /** + * An array of documents which record array truncations performed with pipeline-based updates using one or more of the following stages: + * - $addFields + * - $set + * - $replaceRoot + * - $replaceWith + */ + truncatedArrays?: Array<{ + /** The name of the truncated field. */ + field: string; + /** The number of elements in the truncated array. */ + newSize: number; + }>; +} + +/** @public */ +export declare type UpdateFilter = { + $currentDate?: OnlyFieldsOfType; + $inc?: OnlyFieldsOfType; + $min?: MatchKeysAndValues; + $max?: MatchKeysAndValues; + $mul?: OnlyFieldsOfType; + $rename?: Record; + $set?: MatchKeysAndValues; + $setOnInsert?: MatchKeysAndValues; + $unset?: OnlyFieldsOfType; + $addToSet?: SetFields; + $pop?: OnlyFieldsOfType, 1 | -1>; + $pull?: PullOperator; + $push?: PushOperator; + $pullAll?: PullAllOperator; + $bit?: OnlyFieldsOfType; +} & Document; + +/** @public */ +export declare interface UpdateManyModel { + /** The filter to limit the updated documents. */ + filter: Filter; + /** A document or pipeline containing update operators. */ + update: UpdateFilter | UpdateFilter[]; + /** A set of filters specifying to which array elements an update should apply. */ + arrayFilters?: Document[]; + /** Specifies a collation. */ + collation?: CollationOptions; + /** The index to use. If specified, then the query system will only consider plans using the hinted index. */ + hint?: Hint; + /** When true, creates a new document if no document matches the query. */ + upsert?: boolean; +} + +/** @public */ +export declare interface UpdateOneModel { + /** The filter to limit the updated documents. */ + filter: Filter; + /** A document or pipeline containing update operators. */ + update: UpdateFilter | UpdateFilter[]; + /** A set of filters specifying to which array elements an update should apply. */ + arrayFilters?: Document[]; + /** Specifies a collation. */ + collation?: CollationOptions; + /** The index to use. If specified, then the query system will only consider plans using the hinted index. */ + hint?: Hint; + /** When true, creates a new document if no document matches the query. */ + upsert?: boolean; +} + +/** @public */ +export declare interface UpdateOptions extends CommandOperationOptions { + /** A set of filters specifying to which array elements an update should apply */ + arrayFilters?: Document[]; + /** If true, allows the write to opt-out of document level validation */ + bypassDocumentValidation?: boolean; + /** Specifies a collation */ + collation?: CollationOptions; + /** Specify that the update query should only consider plans using the hinted index */ + hint?: string | Document; + /** When true, creates a new document if no document matches the query */ + upsert?: boolean; + /** Map of parameter names and values that can be accessed using $$var (requires MongoDB 5.0). */ + let?: Document; +} + +/** @public */ +export declare interface UpdateResult { + /** Indicates whether this write result was acknowledged. If not, then all other members of this result will be undefined */ + acknowledged: boolean; + /** The number of documents that matched the filter */ + matchedCount: number; + /** The number of documents that were modified */ + modifiedCount: number; + /** The number of documents that were upserted */ + upsertedCount: number; + /** The identifier of the inserted document if an upsert took place */ + upsertedId: ObjectId; +} + +/** @public */ +export declare interface UpdateStatement { + /** The query that matches documents to update. */ + q: Document; + /** The modifications to apply. */ + u: Document | Document[]; + /** If true, perform an insert if no documents match the query. */ + upsert?: boolean; + /** If true, updates all documents that meet the query criteria. */ + multi?: boolean; + /** Specifies the collation to use for the operation. */ + collation?: CollationOptions; + /** An array of filter documents that determines which array elements to modify for an update operation on an array field. */ + arrayFilters?: Document[]; + /** A document or string that specifies the index to use to support the query predicate. */ + hint?: Hint; +} + +/** @public */ +export declare interface ValidateCollectionOptions extends CommandOperationOptions { + /** Validates a collection in the background, without interrupting read or write traffic (only in MongoDB 4.4+) */ + background?: boolean; +} + +/** @public */ +export declare type W = number | 'majority'; + +/* Excluded from this release type: WaitQueueMember */ + +/** @public */ +export declare interface WiredTigerData extends Document { + LSM: { + 'bloom filter false positives': number; + 'bloom filter hits': number; + 'bloom filter misses': number; + 'bloom filter pages evicted from cache': number; + 'bloom filter pages read into cache': number; + 'bloom filters in the LSM tree': number; + 'chunks in the LSM tree': number; + 'highest merge generation in the LSM tree': number; + 'queries that could have benefited from a Bloom filter that did not exist': number; + 'sleep for LSM checkpoint throttle': number; + 'sleep for LSM merge throttle': number; + 'total size of bloom filters': number; + } & Document; + 'block-manager': { + 'allocations requiring file extension': number; + 'blocks allocated': number; + 'blocks freed': number; + 'checkpoint size': number; + 'file allocation unit size': number; + 'file bytes available for reuse': number; + 'file magic number': number; + 'file major version number': number; + 'file size in bytes': number; + 'minor version number': number; + }; + btree: { + 'btree checkpoint generation': number; + 'column-store fixed-size leaf pages': number; + 'column-store internal pages': number; + 'column-store variable-size RLE encoded values': number; + 'column-store variable-size deleted values': number; + 'column-store variable-size leaf pages': number; + 'fixed-record size': number; + 'maximum internal page key size': number; + 'maximum internal page size': number; + 'maximum leaf page key size': number; + 'maximum leaf page size': number; + 'maximum leaf page value size': number; + 'maximum tree depth': number; + 'number of key/value pairs': number; + 'overflow pages': number; + 'pages rewritten by compaction': number; + 'row-store internal pages': number; + 'row-store leaf pages': number; + } & Document; + cache: { + 'bytes currently in the cache': number; + 'bytes read into cache': number; + 'bytes written from cache': number; + 'checkpoint blocked page eviction': number; + 'data source pages selected for eviction unable to be evicted': number; + 'hazard pointer blocked page eviction': number; + 'in-memory page passed criteria to be split': number; + 'in-memory page splits': number; + 'internal pages evicted': number; + 'internal pages split during eviction': number; + 'leaf pages split during eviction': number; + 'modified pages evicted': number; + 'overflow pages read into cache': number; + 'overflow values cached in memory': number; + 'page split during eviction deepened the tree': number; + 'page written requiring lookaside records': number; + 'pages read into cache': number; + 'pages read into cache requiring lookaside entries': number; + 'pages requested from the cache': number; + 'pages written from cache': number; + 'pages written requiring in-memory restoration': number; + 'tracked dirty bytes in the cache': number; + 'unmodified pages evicted': number; + } & Document; + cache_walk: { + 'Average difference between current eviction generation when the page was last considered': number; + 'Average on-disk page image size seen': number; + 'Clean pages currently in cache': number; + 'Current eviction generation': number; + 'Dirty pages currently in cache': number; + 'Entries in the root page': number; + 'Internal pages currently in cache': number; + 'Leaf pages currently in cache': number; + 'Maximum difference between current eviction generation when the page was last considered': number; + 'Maximum page size seen': number; + 'Minimum on-disk page image size seen': number; + 'On-disk page image sizes smaller than a single allocation unit': number; + 'Pages created in memory and never written': number; + 'Pages currently queued for eviction': number; + 'Pages that could not be queued for eviction': number; + 'Refs skipped during cache traversal': number; + 'Size of the root page': number; + 'Total number of pages currently in cache': number; + } & Document; + compression: { + 'compressed pages read': number; + 'compressed pages written': number; + 'page written failed to compress': number; + 'page written was too small to compress': number; + 'raw compression call failed, additional data available': number; + 'raw compression call failed, no additional data available': number; + 'raw compression call succeeded': number; + } & Document; + cursor: { + 'bulk-loaded cursor-insert calls': number; + 'create calls': number; + 'cursor-insert key and value bytes inserted': number; + 'cursor-remove key bytes removed': number; + 'cursor-update value bytes updated': number; + 'insert calls': number; + 'next calls': number; + 'prev calls': number; + 'remove calls': number; + 'reset calls': number; + 'restarted searches': number; + 'search calls': number; + 'search near calls': number; + 'truncate calls': number; + 'update calls': number; + }; + reconciliation: { + 'dictionary matches': number; + 'fast-path pages deleted': number; + 'internal page key bytes discarded using suffix compression': number; + 'internal page multi-block writes': number; + 'internal-page overflow keys': number; + 'leaf page key bytes discarded using prefix compression': number; + 'leaf page multi-block writes': number; + 'leaf-page overflow keys': number; + 'maximum blocks required for a page': number; + 'overflow values written': number; + 'page checksum matches': number; + 'page reconciliation calls': number; + 'page reconciliation calls for eviction': number; + 'pages deleted': number; + } & Document; +} + +/* Excluded from this release type: WithConnectionCallback */ + +/** Add an _id field to an object shaped type @public */ +export declare type WithId = EnhancedOmit & { + _id: InferIdType; +}; + +/** Remove the _id field from an object shaped type @public */ +export declare type WithoutId = Omit; + +/** @public */ +export declare type WithSessionCallback = (session: ClientSession) => Promise; + +/** @public */ +export declare type WithTransactionCallback = (session: ClientSession) => Promise; + +/** + * A MongoDB WriteConcern, which describes the level of acknowledgement + * requested from MongoDB for write operations. + * @public + * + * @see https://docs.mongodb.com/manual/reference/write-concern/ + */ +export declare class WriteConcern { + /** request acknowledgment that the write operation has propagated to a specified number of mongod instances or to mongod instances with specified tags. */ + w?: W; + /** specify a time limit to prevent write operations from blocking indefinitely */ + wtimeout?: number; + /** request acknowledgment that the write operation has been written to the on-disk journal */ + j?: boolean; + /** equivalent to the j option */ + fsync?: boolean | 1; + /** + * Constructs a WriteConcern from the write concern properties. + * @param w - request acknowledgment that the write operation has propagated to a specified number of mongod instances or to mongod instances with specified tags. + * @param wtimeout - specify a time limit to prevent write operations from blocking indefinitely + * @param j - request acknowledgment that the write operation has been written to the on-disk journal + * @param fsync - equivalent to the j option + */ + constructor(w?: W, wtimeout?: number, j?: boolean, fsync?: boolean | 1); + /** Construct a WriteConcern given an options object. */ + static fromOptions(options?: WriteConcernOptions | WriteConcern | W, inherit?: WriteConcernOptions | WriteConcern): WriteConcern | undefined; +} + +/** + * An error representing a failure by the server to apply the requested write concern to the bulk operation. + * @public + * @category Error + */ +export declare class WriteConcernError { + /* Excluded from this release type: [kServerError] */ + constructor(error: WriteConcernErrorData); + /** Write concern error code. */ + get code(): number | undefined; + /** Write concern error message. */ + get errmsg(): string | undefined; + /** Write concern error info. */ + get errInfo(): Document | undefined; + /** @deprecated The `err` prop that contained a MongoServerError has been deprecated. */ + get err(): WriteConcernErrorData; + toJSON(): WriteConcernErrorData; + toString(): string; +} + +/** @public */ +export declare interface WriteConcernErrorData { + code: number; + errmsg: string; + errInfo?: Document; +} + +/** @public */ +export declare interface WriteConcernOptions { + /** Write Concern as an object */ + writeConcern?: WriteConcern | WriteConcernSettings; +} + +/** @public */ +export declare interface WriteConcernSettings { + /** The write concern */ + w?: W; + /** The write concern timeout */ + wtimeoutMS?: number; + /** The journal write concern */ + journal?: boolean; + /** The journal write concern */ + j?: boolean; + /** The write concern timeout */ + wtimeout?: number; + /** The file sync write concern */ + fsync?: boolean | 1; +} + +/** + * An error that occurred during a BulkWrite on the server. + * @public + * @category Error + */ +export declare class WriteError { + err: BulkWriteOperationError; + constructor(err: BulkWriteOperationError); + /** WriteError code. */ + get code(): number; + /** WriteError original bulk operation index. */ + get index(): number; + /** WriteError message. */ + get errmsg(): string | undefined; + /** WriteError details. */ + get errInfo(): Document | undefined; + /** Returns the underlying operation that caused the error */ + getOperation(): Document; + toJSON(): { + code: number; + index: number; + errmsg?: string; + op: Document; + }; + toString(): string; +} + +/* Excluded from this release type: WriteProtocolMessageType */ + +export { } diff --git a/node_modules/mongodb/package.json b/node_modules/mongodb/package.json new file mode 100644 index 000000000..754a6cd94 --- /dev/null +++ b/node_modules/mongodb/package.json @@ -0,0 +1,135 @@ +{ + "name": "mongodb", + "version": "4.7.0", + "description": "The official MongoDB driver for Node.js", + "main": "lib/index.js", + "files": [ + "lib", + "src", + "etc/prepare.js", + "mongodb.d.ts", + "tsconfig.json" + ], + "types": "mongodb.d.ts", + "repository": { + "type": "git", + "url": "git@github.com:mongodb/node-mongodb-native.git" + }, + "keywords": [ + "mongodb", + "driver", + "official" + ], + "author": { + "name": "The MongoDB NodeJS Team", + "email": "dbx-node@mongodb.com" + }, + "dependencies": { + "bson": "^4.6.3", + "denque": "^2.0.1", + "mongodb-connection-string-url": "^2.5.2", + "socks": "^2.6.2" + }, + "devDependencies": { + "@iarna/toml": "^2.2.5", + "@istanbuljs/nyc-config-typescript": "^1.0.2", + "@microsoft/api-extractor": "^7.24.1", + "@microsoft/tsdoc-config": "^0.16.1", + "@mongodb-js/zstd": "^1.0.0", + "@types/chai": "^4.3.0", + "@types/chai-subset": "^1.3.3", + "@types/express": "^4.17.13", + "@types/kerberos": "^1.1.1", + "@types/mocha": "^9.1.0", + "@types/node": "^17.0.23", + "@types/saslprep": "^1.0.1", + "@types/semver": "^7.3.9", + "@types/sinon": "^10.0.11", + "@types/sinon-chai": "^3.2.8", + "@types/whatwg-url": "^8.2.1", + "@typescript-eslint/eslint-plugin": "^5.26.0", + "@typescript-eslint/parser": "^5.26.0", + "bluebird": "^3.7.2", + "chai": "^4.3.6", + "chai-subset": "^1.6.0", + "chalk": "^4.1.2", + "eslint": "^8.12.0", + "eslint-config-prettier": "^8.5.0", + "eslint-plugin-import": "^2.25.4", + "eslint-plugin-prettier": "^4.0.0", + "eslint-plugin-simple-import-sort": "^7.0.0", + "eslint-plugin-tsdoc": "^0.2.16", + "express": "^4.17.3", + "js-yaml": "^4.1.0", + "mocha": "^9.2.2", + "mocha-sinon": "^2.1.2", + "nyc": "^15.1.0", + "prettier": "^2.6.1", + "rimraf": "^3.0.2", + "semver": "^7.3.5", + "sinon": "^13.0.1", + "sinon-chai": "^3.7.0", + "source-map-support": "^0.5.21", + "standard-version": "^9.3.2", + "ts-node": "^10.8.0", + "tsd": "^0.20.0", + "typescript": "^4.7.2", + "typescript-cached-transpile": "^0.0.6", + "xml2js": "^0.4.23", + "yargs": "^17.4.0" + }, + "license": "Apache-2.0", + "engines": { + "node": ">=12.9.0" + }, + "bugs": { + "url": "https://jira.mongodb.org/projects/NODE/issues/" + }, + "homepage": "https://github.com/mongodb/node-mongodb-native", + "optionalDependencies": { + "saslprep": "^1.0.3" + }, + "scripts": { + "build:evergreen": "node .evergreen/generate_evergreen_tasks.js", + "build:ts": "node ./node_modules/typescript/bin/tsc", + "build:dts": "npm run build:ts && api-extractor run && rimraf 'lib/**/*.d.ts*'", + "build:docs": "./etc/docs/build.ts", + "build:typedoc": "typedoc", + "check:bench": "node test/benchmarks/driverBench", + "check:coverage": "nyc npm run test:all", + "check:integration-coverage": "nyc npm run check:test", + "check:lint": "npm run build:dts && npm run check:dts && npm run check:eslint && npm run check:tsd", + "check:eslint": "eslint -v && eslint --max-warnings=0 --ext '.js,.ts' src test", + "check:tsd": "tsd --version && tsd", + "check:dts": "node ./node_modules/typescript/bin/tsc --noEmit mongodb.d.ts && tsd", + "check:test": "mocha --config test/mocha_mongodb.json test/integration", + "check:unit": "mocha test/unit", + "check:ts": "node ./node_modules/typescript/bin/tsc -v && node ./node_modules/typescript/bin/tsc --noEmit", + "check:atlas": "mocha --config test/manual/mocharc.json test/manual/atlas_connectivity.test.js", + "check:adl": "mocha --config test/mocha_mongodb.json test/manual/atlas-data-lake-testing", + "check:aws": "mocha --config test/mocha_mongodb.json test/integration/auth/mongodb_aws.test.js", + "check:ocsp": "mocha --config test/manual/mocharc.json test/manual/ocsp_support.test.js", + "check:kerberos": "mocha --config test/manual/mocharc.json test/manual/kerberos.test.js", + "check:tls": "mocha --config test/manual/mocharc.json test/manual/tls_support.test.js", + "check:ldap": "mocha --config test/manual/mocharc.json test/manual/ldap.test.js", + "check:socks5": "mocha --config test/manual/mocharc.json test/manual/socks5.test.ts", + "check:csfle": "mocha --config test/mocha_mongodb.json test/integration/client-side-encryption", + "check:snappy": "mocha test/unit/assorted/snappy.test.js", + "fix:eslint": "npm run check:eslint -- --fix", + "prepare": "node etc/prepare.js", + "preview:docs": "ts-node etc/docs/preview.ts", + "release": "standard-version -a -i HISTORY.md", + "test": "npm run check:lint && npm run test:all", + "test:all": "npm run check:unit && npm run check:test", + "update:docs": "npm run build:docs -- --yes" + }, + "tsd": { + "directory": "test/types", + "compilerOptions": { + "strict": true, + "target": "esnext", + "module": "commonjs", + "moduleResolution": "node" + } + } +} diff --git a/node_modules/mongodb/src/admin.ts b/node_modules/mongodb/src/admin.ts new file mode 100644 index 000000000..303af58a7 --- /dev/null +++ b/node_modules/mongodb/src/admin.ts @@ -0,0 +1,314 @@ +import type { Document } from './bson'; +import type { Db } from './db'; +import { AddUserOperation, AddUserOptions } from './operations/add_user'; +import type { CommandOperationOptions } from './operations/command'; +import { executeOperation } from './operations/execute_operation'; +import { + ListDatabasesOperation, + ListDatabasesOptions, + ListDatabasesResult +} from './operations/list_databases'; +import { RemoveUserOperation, RemoveUserOptions } from './operations/remove_user'; +import { RunCommandOperation, RunCommandOptions } from './operations/run_command'; +import { + ValidateCollectionOperation, + ValidateCollectionOptions +} from './operations/validate_collection'; +import type { Callback } from './utils'; + +/** @internal */ +export interface AdminPrivate { + db: Db; +} + +/** + * The **Admin** class is an internal class that allows convenient access to + * the admin functionality and commands for MongoDB. + * + * **ADMIN Cannot directly be instantiated** + * @public + * + * @example + * ```js + * const MongoClient = require('mongodb').MongoClient; + * const test = require('assert'); + * // Connection url + * const url = 'mongodb://localhost:27017'; + * // Database Name + * const dbName = 'test'; + * + * // Connect using MongoClient + * MongoClient.connect(url, function(err, client) { + * // Use the admin database for the operation + * const adminDb = client.db(dbName).admin(); + * + * // List all the available databases + * adminDb.listDatabases(function(err, dbs) { + * expect(err).to.not.exist; + * test.ok(dbs.databases.length > 0); + * client.close(); + * }); + * }); + * ``` + */ +export class Admin { + /** @internal */ + s: AdminPrivate; + + /** + * Create a new Admin instance + * @internal + */ + constructor(db: Db) { + this.s = { db }; + } + + /** + * Execute a command + * + * @param command - The command to execute + * @param options - Optional settings for the command + * @param callback - An optional callback, a Promise will be returned if none is provided + */ + command(command: Document): Promise; + command(command: Document, callback: Callback): void; + command(command: Document, options: RunCommandOptions): Promise; + command(command: Document, options: RunCommandOptions, callback: Callback): void; + command( + command: Document, + options?: RunCommandOptions | Callback, + callback?: Callback + ): Promise | void { + if (typeof options === 'function') (callback = options), (options = {}); + options = Object.assign({ dbName: 'admin' }, options); + + return executeOperation( + this.s.db.s.client, + new RunCommandOperation(this.s.db, command, options), + callback + ); + } + + /** + * Retrieve the server build information + * + * @param options - Optional settings for the command + * @param callback - An optional callback, a Promise will be returned if none is provided + */ + buildInfo(): Promise; + buildInfo(callback: Callback): void; + buildInfo(options: CommandOperationOptions): Promise; + buildInfo(options: CommandOperationOptions, callback: Callback): void; + buildInfo( + options?: CommandOperationOptions | Callback, + callback?: Callback + ): Promise | void { + if (typeof options === 'function') (callback = options), (options = {}); + options = options ?? {}; + return this.command({ buildinfo: 1 }, options, callback as Callback); + } + + /** + * Retrieve the server build information + * + * @param options - Optional settings for the command + * @param callback - An optional callback, a Promise will be returned if none is provided + */ + serverInfo(): Promise; + serverInfo(callback: Callback): void; + serverInfo(options: CommandOperationOptions): Promise; + serverInfo(options: CommandOperationOptions, callback: Callback): void; + serverInfo( + options?: CommandOperationOptions | Callback, + callback?: Callback + ): Promise | void { + if (typeof options === 'function') (callback = options), (options = {}); + options = options ?? {}; + return this.command({ buildinfo: 1 }, options, callback as Callback); + } + + /** + * Retrieve this db's server status. + * + * @param options - Optional settings for the command + * @param callback - An optional callback, a Promise will be returned if none is provided + */ + serverStatus(): Promise; + serverStatus(callback: Callback): void; + serverStatus(options: CommandOperationOptions): Promise; + serverStatus(options: CommandOperationOptions, callback: Callback): void; + serverStatus( + options?: CommandOperationOptions | Callback, + callback?: Callback + ): Promise | void { + if (typeof options === 'function') (callback = options), (options = {}); + options = options ?? {}; + return this.command({ serverStatus: 1 }, options, callback as Callback); + } + + /** + * Ping the MongoDB server and retrieve results + * + * @param options - Optional settings for the command + * @param callback - An optional callback, a Promise will be returned if none is provided + */ + ping(): Promise; + ping(callback: Callback): void; + ping(options: CommandOperationOptions): Promise; + ping(options: CommandOperationOptions, callback: Callback): void; + ping( + options?: CommandOperationOptions | Callback, + callback?: Callback + ): Promise | void { + if (typeof options === 'function') (callback = options), (options = {}); + options = options ?? {}; + return this.command({ ping: 1 }, options, callback as Callback); + } + + /** + * Add a user to the database + * + * @param username - The username for the new user + * @param password - An optional password for the new user + * @param options - Optional settings for the command + * @param callback - An optional callback, a Promise will be returned if none is provided + */ + addUser(username: string): Promise; + addUser(username: string, callback: Callback): void; + addUser(username: string, password: string): Promise; + addUser(username: string, password: string, callback: Callback): void; + addUser(username: string, options: AddUserOptions): Promise; + addUser(username: string, options: AddUserOptions, callback: Callback): void; + addUser(username: string, password: string, options: AddUserOptions): Promise; + addUser( + username: string, + password: string, + options: AddUserOptions, + callback: Callback + ): void; + addUser( + username: string, + password?: string | AddUserOptions | Callback, + options?: AddUserOptions | Callback, + callback?: Callback + ): Promise | void { + if (typeof password === 'function') { + (callback = password), (password = undefined), (options = {}); + } else if (typeof password !== 'string') { + if (typeof options === 'function') { + (callback = options), (options = password), (password = undefined); + } else { + (options = password), (callback = undefined), (password = undefined); + } + } else { + if (typeof options === 'function') (callback = options), (options = {}); + } + + options = Object.assign({ dbName: 'admin' }, options); + + return executeOperation( + this.s.db.s.client, + new AddUserOperation(this.s.db, username, password, options), + callback + ); + } + + /** + * Remove a user from a database + * + * @param username - The username to remove + * @param options - Optional settings for the command + * @param callback - An optional callback, a Promise will be returned if none is provided + */ + removeUser(username: string): Promise; + removeUser(username: string, callback: Callback): void; + removeUser(username: string, options: RemoveUserOptions): Promise; + removeUser(username: string, options: RemoveUserOptions, callback: Callback): void; + removeUser( + username: string, + options?: RemoveUserOptions | Callback, + callback?: Callback + ): Promise | void { + if (typeof options === 'function') (callback = options), (options = {}); + options = Object.assign({ dbName: 'admin' }, options); + + return executeOperation( + this.s.db.s.client, + new RemoveUserOperation(this.s.db, username, options), + callback + ); + } + + /** + * Validate an existing collection + * + * @param collectionName - The name of the collection to validate. + * @param options - Optional settings for the command + * @param callback - An optional callback, a Promise will be returned if none is provided + */ + validateCollection(collectionName: string): Promise; + validateCollection(collectionName: string, callback: Callback): void; + validateCollection(collectionName: string, options: ValidateCollectionOptions): Promise; + validateCollection( + collectionName: string, + options: ValidateCollectionOptions, + callback: Callback + ): void; + validateCollection( + collectionName: string, + options?: ValidateCollectionOptions | Callback, + callback?: Callback + ): Promise | void { + if (typeof options === 'function') (callback = options), (options = {}); + options = options ?? {}; + + return executeOperation( + this.s.db.s.client, + new ValidateCollectionOperation(this, collectionName, options), + callback + ); + } + + /** + * List the available databases + * + * @param options - Optional settings for the command + * @param callback - An optional callback, a Promise will be returned if none is provided + */ + listDatabases(): Promise; + listDatabases(callback: Callback): void; + listDatabases(options: ListDatabasesOptions): Promise; + listDatabases(options: ListDatabasesOptions, callback: Callback): void; + listDatabases( + options?: ListDatabasesOptions | Callback, + callback?: Callback + ): Promise | void { + if (typeof options === 'function') (callback = options), (options = {}); + options = options ?? {}; + + return executeOperation( + this.s.db.s.client, + new ListDatabasesOperation(this.s.db, options), + callback + ); + } + + /** + * Get ReplicaSet status + * + * @param options - Optional settings for the command + * @param callback - An optional callback, a Promise will be returned if none is provided + */ + replSetGetStatus(): Promise; + replSetGetStatus(callback: Callback): void; + replSetGetStatus(options: CommandOperationOptions): Promise; + replSetGetStatus(options: CommandOperationOptions, callback: Callback): void; + replSetGetStatus( + options?: CommandOperationOptions | Callback, + callback?: Callback + ): Promise | void { + if (typeof options === 'function') (callback = options), (options = {}); + options = options ?? {}; + return this.command({ replSetGetStatus: 1 }, options, callback as Callback); + } +} diff --git a/node_modules/mongodb/src/bson.ts b/node_modules/mongodb/src/bson.ts new file mode 100644 index 000000000..42d9ab08d --- /dev/null +++ b/node_modules/mongodb/src/bson.ts @@ -0,0 +1,112 @@ +import type { + calculateObjectSize as calculateObjectSizeFn, + deserialize as deserializeFn, + DeserializeOptions, + serialize as serializeFn, + SerializeOptions +} from 'bson'; + +// eslint-disable-next-line @typescript-eslint/no-var-requires +let BSON = require('bson'); + +try { + // Ensure you always wrap an optional require in the try block NODE-3199 + BSON = require('bson-ext'); +} catch {} // eslint-disable-line + +/** @internal */ +export const deserialize = BSON.deserialize as typeof deserializeFn; +/** @internal */ +export const serialize = BSON.serialize as typeof serializeFn; +/** @internal */ +export const calculateObjectSize = BSON.calculateObjectSize as typeof calculateObjectSizeFn; + +export { + Binary, + BSONRegExp, + BSONSymbol, + Code, + DBRef, + Decimal128, + Document, + Double, + Int32, + Long, + Map, + MaxKey, + MinKey, + ObjectId, + Timestamp +} from 'bson'; + +/** + * BSON Serialization options. + * @public + */ +export interface BSONSerializeOptions + extends Omit, + Omit< + DeserializeOptions, + | 'evalFunctions' + | 'cacheFunctions' + | 'cacheFunctionsCrc32' + | 'allowObjectSmallerThanBufferSize' + | 'index' + | 'validation' + > { + /** Return BSON filled buffers from operations */ + raw?: boolean; + + /** Enable utf8 validation when deserializing BSON documents. Defaults to true. */ + enableUtf8Validation?: boolean; +} + +export function pluckBSONSerializeOptions(options: BSONSerializeOptions): BSONSerializeOptions { + const { + fieldsAsRaw, + promoteValues, + promoteBuffers, + promoteLongs, + serializeFunctions, + ignoreUndefined, + bsonRegExp, + raw, + enableUtf8Validation + } = options; + return { + fieldsAsRaw, + promoteValues, + promoteBuffers, + promoteLongs, + serializeFunctions, + ignoreUndefined, + bsonRegExp, + raw, + enableUtf8Validation + }; +} + +/** + * Merge the given BSONSerializeOptions, preferring options over the parent's options, and + * substituting defaults for values not set. + * + * @internal + */ +export function resolveBSONOptions( + options?: BSONSerializeOptions, + parent?: { bsonOptions?: BSONSerializeOptions } +): BSONSerializeOptions { + const parentOptions = parent?.bsonOptions; + return { + raw: options?.raw ?? parentOptions?.raw ?? false, + promoteLongs: options?.promoteLongs ?? parentOptions?.promoteLongs ?? true, + promoteValues: options?.promoteValues ?? parentOptions?.promoteValues ?? true, + promoteBuffers: options?.promoteBuffers ?? parentOptions?.promoteBuffers ?? false, + ignoreUndefined: options?.ignoreUndefined ?? parentOptions?.ignoreUndefined ?? false, + bsonRegExp: options?.bsonRegExp ?? parentOptions?.bsonRegExp ?? false, + serializeFunctions: options?.serializeFunctions ?? parentOptions?.serializeFunctions ?? false, + fieldsAsRaw: options?.fieldsAsRaw ?? parentOptions?.fieldsAsRaw ?? {}, + enableUtf8Validation: + options?.enableUtf8Validation ?? parentOptions?.enableUtf8Validation ?? true + }; +} diff --git a/node_modules/mongodb/src/bulk/common.ts b/node_modules/mongodb/src/bulk/common.ts new file mode 100644 index 000000000..41b69da65 --- /dev/null +++ b/node_modules/mongodb/src/bulk/common.ts @@ -0,0 +1,1383 @@ +import { + BSONSerializeOptions, + Document, + Long, + ObjectId, + resolveBSONOptions, + Timestamp +} from '../bson'; +import type { Collection } from '../collection'; +import { + AnyError, + MongoBatchReExecutionError, + MONGODB_ERROR_CODES, + MongoInvalidArgumentError, + MongoServerError, + MongoWriteConcernError +} from '../error'; +import type { Filter, OneOrMore, OptionalId, UpdateFilter, WithoutId } from '../mongo_types'; +import type { CollationOptions, CommandOperationOptions } from '../operations/command'; +import { DeleteOperation, DeleteStatement, makeDeleteStatement } from '../operations/delete'; +import { executeOperation } from '../operations/execute_operation'; +import { InsertOperation } from '../operations/insert'; +import { AbstractOperation, Hint } from '../operations/operation'; +import { makeUpdateStatement, UpdateOperation, UpdateStatement } from '../operations/update'; +import { PromiseProvider } from '../promise_provider'; +import type { Server } from '../sdam/server'; +import type { Topology } from '../sdam/topology'; +import type { ClientSession } from '../sessions'; +import { + applyRetryableWrites, + Callback, + getTopology, + hasAtomicOperators, + MongoDBNamespace, + resolveOptions +} from '../utils'; +import { WriteConcern } from '../write_concern'; + +/** @internal */ +const kServerError = Symbol('serverError'); + +/** @public */ +export const BatchType = Object.freeze({ + INSERT: 1, + UPDATE: 2, + DELETE: 3 +} as const); + +/** @public */ +export type BatchType = typeof BatchType[keyof typeof BatchType]; + +/** @public */ +export interface InsertOneModel { + /** The document to insert. */ + document: OptionalId; +} + +/** @public */ +export interface DeleteOneModel { + /** The filter to limit the deleted documents. */ + filter: Filter; + /** Specifies a collation. */ + collation?: CollationOptions; + /** The index to use. If specified, then the query system will only consider plans using the hinted index. */ + hint?: Hint; +} + +/** @public */ +export interface DeleteManyModel { + /** The filter to limit the deleted documents. */ + filter: Filter; + /** Specifies a collation. */ + collation?: CollationOptions; + /** The index to use. If specified, then the query system will only consider plans using the hinted index. */ + hint?: Hint; +} + +/** @public */ +export interface ReplaceOneModel { + /** The filter to limit the replaced document. */ + filter: Filter; + /** The document with which to replace the matched document. */ + replacement: WithoutId; + /** Specifies a collation. */ + collation?: CollationOptions; + /** The index to use. If specified, then the query system will only consider plans using the hinted index. */ + hint?: Hint; + /** When true, creates a new document if no document matches the query. */ + upsert?: boolean; +} + +/** @public */ +export interface UpdateOneModel { + /** The filter to limit the updated documents. */ + filter: Filter; + /** A document or pipeline containing update operators. */ + update: UpdateFilter | UpdateFilter[]; + /** A set of filters specifying to which array elements an update should apply. */ + arrayFilters?: Document[]; + /** Specifies a collation. */ + collation?: CollationOptions; + /** The index to use. If specified, then the query system will only consider plans using the hinted index. */ + hint?: Hint; + /** When true, creates a new document if no document matches the query. */ + upsert?: boolean; +} + +/** @public */ +export interface UpdateManyModel { + /** The filter to limit the updated documents. */ + filter: Filter; + /** A document or pipeline containing update operators. */ + update: UpdateFilter | UpdateFilter[]; + /** A set of filters specifying to which array elements an update should apply. */ + arrayFilters?: Document[]; + /** Specifies a collation. */ + collation?: CollationOptions; + /** The index to use. If specified, then the query system will only consider plans using the hinted index. */ + hint?: Hint; + /** When true, creates a new document if no document matches the query. */ + upsert?: boolean; +} + +/** @public */ +export type AnyBulkWriteOperation = + | { insertOne: InsertOneModel } + | { replaceOne: ReplaceOneModel } + | { updateOne: UpdateOneModel } + | { updateMany: UpdateManyModel } + | { deleteOne: DeleteOneModel } + | { deleteMany: DeleteManyModel }; + +/** @public */ +export interface BulkResult { + ok: number; + writeErrors: WriteError[]; + writeConcernErrors: WriteConcernError[]; + insertedIds: Document[]; + nInserted: number; + nUpserted: number; + nMatched: number; + nModified: number; + nRemoved: number; + upserted: Document[]; + opTime?: Document; +} + +/** + * Keeps the state of a unordered batch so we can rewrite the results + * correctly after command execution + * + * @public + */ +export class Batch { + originalZeroIndex: number; + currentIndex: number; + originalIndexes: number[]; + batchType: BatchType; + operations: T[]; + size: number; + sizeBytes: number; + + constructor(batchType: BatchType, originalZeroIndex: number) { + this.originalZeroIndex = originalZeroIndex; + this.currentIndex = 0; + this.originalIndexes = []; + this.batchType = batchType; + this.operations = []; + this.size = 0; + this.sizeBytes = 0; + } +} + +/** + * @public + * The result of a bulk write. + */ +export class BulkWriteResult { + result: BulkResult; + + /** + * Create a new BulkWriteResult instance + * @internal + */ + constructor(bulkResult: BulkResult) { + this.result = bulkResult; + } + + /** Number of documents inserted. */ + get insertedCount(): number { + return this.result.nInserted ?? 0; + } + /** Number of documents matched for update. */ + get matchedCount(): number { + return this.result.nMatched ?? 0; + } + /** Number of documents modified. */ + get modifiedCount(): number { + return this.result.nModified ?? 0; + } + /** Number of documents deleted. */ + get deletedCount(): number { + return this.result.nRemoved ?? 0; + } + /** Number of documents upserted. */ + get upsertedCount(): number { + return this.result.upserted.length ?? 0; + } + + /** Upserted document generated Id's, hash key is the index of the originating operation */ + get upsertedIds(): { [key: number]: any } { + const upserted: { [index: number]: any } = {}; + for (const doc of this.result.upserted ?? []) { + upserted[doc.index] = doc._id; + } + return upserted; + } + + /** Inserted document generated Id's, hash key is the index of the originating operation */ + get insertedIds(): { [key: number]: any } { + const inserted: { [index: number]: any } = {}; + for (const doc of this.result.insertedIds ?? []) { + inserted[doc.index] = doc._id; + } + return inserted; + } + + /** Evaluates to true if the bulk operation correctly executes */ + get ok(): number { + return this.result.ok; + } + + /** The number of inserted documents */ + get nInserted(): number { + return this.result.nInserted; + } + + /** Number of upserted documents */ + get nUpserted(): number { + return this.result.nUpserted; + } + + /** Number of matched documents */ + get nMatched(): number { + return this.result.nMatched; + } + + /** Number of documents updated physically on disk */ + get nModified(): number { + return this.result.nModified; + } + + /** Number of removed documents */ + get nRemoved(): number { + return this.result.nRemoved; + } + + /** Returns an array of all inserted ids */ + getInsertedIds(): Document[] { + return this.result.insertedIds; + } + + /** Returns an array of all upserted ids */ + getUpsertedIds(): Document[] { + return this.result.upserted; + } + + /** Returns the upserted id at the given index */ + getUpsertedIdAt(index: number): Document | undefined { + return this.result.upserted[index]; + } + + /** Returns raw internal result */ + getRawResponse(): Document { + return this.result; + } + + /** Returns true if the bulk operation contains a write error */ + hasWriteErrors(): boolean { + return this.result.writeErrors.length > 0; + } + + /** Returns the number of write errors off the bulk operation */ + getWriteErrorCount(): number { + return this.result.writeErrors.length; + } + + /** Returns a specific write error object */ + getWriteErrorAt(index: number): WriteError | undefined { + return index < this.result.writeErrors.length ? this.result.writeErrors[index] : undefined; + } + + /** Retrieve all write errors */ + getWriteErrors(): WriteError[] { + return this.result.writeErrors; + } + + /** Retrieve lastOp if available */ + getLastOp(): Document | undefined { + return this.result.opTime; + } + + /** Retrieve the write concern error if one exists */ + getWriteConcernError(): WriteConcernError | undefined { + if (this.result.writeConcernErrors.length === 0) { + return; + } else if (this.result.writeConcernErrors.length === 1) { + // Return the error + return this.result.writeConcernErrors[0]; + } else { + // Combine the errors + let errmsg = ''; + for (let i = 0; i < this.result.writeConcernErrors.length; i++) { + const err = this.result.writeConcernErrors[i]; + errmsg = errmsg + err.errmsg; + + // TODO: Something better + if (i === 0) errmsg = errmsg + ' and '; + } + + return new WriteConcernError({ errmsg, code: MONGODB_ERROR_CODES.WriteConcernFailed }); + } + } + + toJSON(): BulkResult { + return this.result; + } + + toString(): string { + return `BulkWriteResult(${this.toJSON()})`; + } + + isOk(): boolean { + return this.result.ok === 1; + } +} + +/** @public */ +export interface WriteConcernErrorData { + code: number; + errmsg: string; + errInfo?: Document; +} + +/** + * An error representing a failure by the server to apply the requested write concern to the bulk operation. + * @public + * @category Error + */ +export class WriteConcernError { + /** @internal */ + [kServerError]: WriteConcernErrorData; + + constructor(error: WriteConcernErrorData) { + this[kServerError] = error; + } + + /** Write concern error code. */ + get code(): number | undefined { + return this[kServerError].code; + } + + /** Write concern error message. */ + get errmsg(): string | undefined { + return this[kServerError].errmsg; + } + + /** Write concern error info. */ + get errInfo(): Document | undefined { + return this[kServerError].errInfo; + } + + /** @deprecated The `err` prop that contained a MongoServerError has been deprecated. */ + get err(): WriteConcernErrorData { + return this[kServerError]; + } + + toJSON(): WriteConcernErrorData { + return this[kServerError]; + } + + toString(): string { + return `WriteConcernError(${this.errmsg})`; + } +} + +/** @public */ +export interface BulkWriteOperationError { + index: number; + code: number; + errmsg: string; + errInfo: Document; + op: Document | UpdateStatement | DeleteStatement; +} + +/** + * An error that occurred during a BulkWrite on the server. + * @public + * @category Error + */ +export class WriteError { + err: BulkWriteOperationError; + + constructor(err: BulkWriteOperationError) { + this.err = err; + } + + /** WriteError code. */ + get code(): number { + return this.err.code; + } + + /** WriteError original bulk operation index. */ + get index(): number { + return this.err.index; + } + + /** WriteError message. */ + get errmsg(): string | undefined { + return this.err.errmsg; + } + + /** WriteError details. */ + get errInfo(): Document | undefined { + return this.err.errInfo; + } + + /** Returns the underlying operation that caused the error */ + getOperation(): Document { + return this.err.op; + } + + toJSON(): { code: number; index: number; errmsg?: string; op: Document } { + return { code: this.err.code, index: this.err.index, errmsg: this.err.errmsg, op: this.err.op }; + } + + toString(): string { + return `WriteError(${JSON.stringify(this.toJSON())})`; + } +} + +/** Converts the number to a Long or returns it. */ +function longOrConvert(value: number | Long | Timestamp): Long | Timestamp { + return typeof value === 'number' ? Long.fromNumber(value) : value; +} + +/** Merges results into shared data structure */ +export function mergeBatchResults( + batch: Batch, + bulkResult: BulkResult, + err?: AnyError, + result?: Document +): void { + // If we have an error set the result to be the err object + if (err) { + result = err; + } else if (result && result.result) { + result = result.result; + } + + if (result == null) { + return; + } + + // Do we have a top level error stop processing and return + if (result.ok === 0 && bulkResult.ok === 1) { + bulkResult.ok = 0; + + const writeError = { + index: 0, + code: result.code || 0, + errmsg: result.message, + errInfo: result.errInfo, + op: batch.operations[0] + }; + + bulkResult.writeErrors.push(new WriteError(writeError)); + return; + } else if (result.ok === 0 && bulkResult.ok === 0) { + return; + } + + // The server write command specification states that lastOp is an optional + // mongod only field that has a type of timestamp. Across various scarce specs + // where opTime is mentioned, it is an "opaque" object that can have a "ts" and + // "t" field with Timestamp and Long as their types respectively. + // The "lastOp" field of the bulk write result is never mentioned in the driver + // specifications or the bulk write spec, so we should probably just keep its + // value consistent since it seems to vary. + // See: https://github.com/mongodb/specifications/blob/master/source/driver-bulk-update.rst#results-object + if (result.opTime || result.lastOp) { + let opTime = result.lastOp || result.opTime; + + // If the opTime is a Timestamp, convert it to a consistent format to be + // able to compare easily. Converting to the object from a timestamp is + // much more straightforward than the other direction. + if (opTime._bsontype === 'Timestamp') { + opTime = { ts: opTime, t: Long.ZERO }; + } + + // If there's no lastOp, just set it. + if (!bulkResult.opTime) { + bulkResult.opTime = opTime; + } else { + // First compare the ts values and set if the opTimeTS value is greater. + const lastOpTS = longOrConvert(bulkResult.opTime.ts); + const opTimeTS = longOrConvert(opTime.ts); + if (opTimeTS.greaterThan(lastOpTS)) { + bulkResult.opTime = opTime; + } else if (opTimeTS.equals(lastOpTS)) { + // If the ts values are equal, then compare using the t values. + const lastOpT = longOrConvert(bulkResult.opTime.t); + const opTimeT = longOrConvert(opTime.t); + if (opTimeT.greaterThan(lastOpT)) { + bulkResult.opTime = opTime; + } + } + } + } + + // If we have an insert Batch type + if (isInsertBatch(batch) && result.n) { + bulkResult.nInserted = bulkResult.nInserted + result.n; + } + + // If we have an insert Batch type + if (isDeleteBatch(batch) && result.n) { + bulkResult.nRemoved = bulkResult.nRemoved + result.n; + } + + let nUpserted = 0; + + // We have an array of upserted values, we need to rewrite the indexes + if (Array.isArray(result.upserted)) { + nUpserted = result.upserted.length; + + for (let i = 0; i < result.upserted.length; i++) { + bulkResult.upserted.push({ + index: result.upserted[i].index + batch.originalZeroIndex, + _id: result.upserted[i]._id + }); + } + } else if (result.upserted) { + nUpserted = 1; + + bulkResult.upserted.push({ + index: batch.originalZeroIndex, + _id: result.upserted + }); + } + + // If we have an update Batch type + if (isUpdateBatch(batch) && result.n) { + const nModified = result.nModified; + bulkResult.nUpserted = bulkResult.nUpserted + nUpserted; + bulkResult.nMatched = bulkResult.nMatched + (result.n - nUpserted); + + if (typeof nModified === 'number') { + bulkResult.nModified = bulkResult.nModified + nModified; + } else { + bulkResult.nModified = 0; + } + } + + if (Array.isArray(result.writeErrors)) { + for (let i = 0; i < result.writeErrors.length; i++) { + const writeError = { + index: batch.originalIndexes[result.writeErrors[i].index], + code: result.writeErrors[i].code, + errmsg: result.writeErrors[i].errmsg, + errInfo: result.writeErrors[i].errInfo, + op: batch.operations[result.writeErrors[i].index] + }; + + bulkResult.writeErrors.push(new WriteError(writeError)); + } + } + + if (result.writeConcernError) { + bulkResult.writeConcernErrors.push(new WriteConcernError(result.writeConcernError)); + } +} + +function executeCommands( + bulkOperation: BulkOperationBase, + options: BulkWriteOptions, + callback: Callback +) { + if (bulkOperation.s.batches.length === 0) { + return callback(undefined, new BulkWriteResult(bulkOperation.s.bulkResult)); + } + + const batch = bulkOperation.s.batches.shift() as Batch; + + function resultHandler(err?: AnyError, result?: Document) { + // Error is a driver related error not a bulk op error, return early + if (err && 'message' in err && !(err instanceof MongoWriteConcernError)) { + return callback( + new MongoBulkWriteError(err, new BulkWriteResult(bulkOperation.s.bulkResult)) + ); + } + + if (err instanceof MongoWriteConcernError) { + return handleMongoWriteConcernError(batch, bulkOperation.s.bulkResult, err, callback); + } + + // Merge the results together + const writeResult = new BulkWriteResult(bulkOperation.s.bulkResult); + const mergeResult = mergeBatchResults(batch, bulkOperation.s.bulkResult, err, result); + if (mergeResult != null) { + return callback(undefined, writeResult); + } + + if (bulkOperation.handleWriteError(callback, writeResult)) return; + + // Execute the next command in line + executeCommands(bulkOperation, options, callback); + } + + const finalOptions = resolveOptions(bulkOperation, { + ...options, + ordered: bulkOperation.isOrdered + }); + + if (finalOptions.bypassDocumentValidation !== true) { + delete finalOptions.bypassDocumentValidation; + } + + // Set an operationIf if provided + if (bulkOperation.operationId) { + resultHandler.operationId = bulkOperation.operationId; + } + + // Is the bypassDocumentValidation options specific + if (bulkOperation.s.bypassDocumentValidation === true) { + finalOptions.bypassDocumentValidation = true; + } + + // Is the checkKeys option disabled + if (bulkOperation.s.checkKeys === false) { + finalOptions.checkKeys = false; + } + + if (finalOptions.retryWrites) { + if (isUpdateBatch(batch)) { + finalOptions.retryWrites = finalOptions.retryWrites && !batch.operations.some(op => op.multi); + } + + if (isDeleteBatch(batch)) { + finalOptions.retryWrites = + finalOptions.retryWrites && !batch.operations.some(op => op.limit === 0); + } + } + + try { + if (isInsertBatch(batch)) { + executeOperation( + bulkOperation.s.collection.s.db.s.client, + new InsertOperation(bulkOperation.s.namespace, batch.operations, finalOptions), + resultHandler + ); + } else if (isUpdateBatch(batch)) { + executeOperation( + bulkOperation.s.collection.s.db.s.client, + new UpdateOperation(bulkOperation.s.namespace, batch.operations, finalOptions), + resultHandler + ); + } else if (isDeleteBatch(batch)) { + executeOperation( + bulkOperation.s.collection.s.db.s.client, + new DeleteOperation(bulkOperation.s.namespace, batch.operations, finalOptions), + resultHandler + ); + } + } catch (err) { + // Force top level error + err.ok = 0; + // Merge top level error and return + mergeBatchResults(batch, bulkOperation.s.bulkResult, err, undefined); + callback(); + } +} + +function handleMongoWriteConcernError( + batch: Batch, + bulkResult: BulkResult, + err: MongoWriteConcernError, + callback: Callback +) { + mergeBatchResults(batch, bulkResult, undefined, err.result); + + callback( + new MongoBulkWriteError( + { + message: err.result?.writeConcernError.errmsg, + code: err.result?.writeConcernError.result + }, + new BulkWriteResult(bulkResult) + ) + ); +} + +/** + * An error indicating an unsuccessful Bulk Write + * @public + * @category Error + */ +export class MongoBulkWriteError extends MongoServerError { + result: BulkWriteResult; + writeErrors: OneOrMore = []; + err?: WriteConcernError; + + /** Creates a new MongoBulkWriteError */ + constructor( + error: + | { message: string; code: number; writeErrors?: WriteError[] } + | WriteConcernError + | AnyError, + result: BulkWriteResult + ) { + super(error); + + if (error instanceof WriteConcernError) this.err = error; + else if (!(error instanceof Error)) { + this.message = error.message; + this.code = error.code; + this.writeErrors = error.writeErrors ?? []; + } + + this.result = result; + Object.assign(this, error); + } + + override get name(): string { + return 'MongoBulkWriteError'; + } + + /** Number of documents inserted. */ + get insertedCount(): number { + return this.result.insertedCount; + } + /** Number of documents matched for update. */ + get matchedCount(): number { + return this.result.matchedCount; + } + /** Number of documents modified. */ + get modifiedCount(): number { + return this.result.modifiedCount; + } + /** Number of documents deleted. */ + get deletedCount(): number { + return this.result.deletedCount; + } + /** Number of documents upserted. */ + get upsertedCount(): number { + return this.result.upsertedCount; + } + /** Inserted document generated Id's, hash key is the index of the originating operation */ + get insertedIds(): { [key: number]: any } { + return this.result.insertedIds; + } + /** Upserted document generated Id's, hash key is the index of the originating operation */ + get upsertedIds(): { [key: number]: any } { + return this.result.upsertedIds; + } +} + +/** + * A builder object that is returned from {@link BulkOperationBase#find}. + * Is used to build a write operation that involves a query filter. + * + * @public + */ +export class FindOperators { + bulkOperation: BulkOperationBase; + + /** + * Creates a new FindOperators object. + * @internal + */ + constructor(bulkOperation: BulkOperationBase) { + this.bulkOperation = bulkOperation; + } + + /** Add a multiple update operation to the bulk operation */ + update(updateDocument: Document): BulkOperationBase { + const currentOp = buildCurrentOp(this.bulkOperation); + return this.bulkOperation.addToOperationsList( + BatchType.UPDATE, + makeUpdateStatement(currentOp.selector, updateDocument, { + ...currentOp, + multi: true + }) + ); + } + + /** Add a single update operation to the bulk operation */ + updateOne(updateDocument: Document): BulkOperationBase { + if (!hasAtomicOperators(updateDocument)) { + throw new MongoInvalidArgumentError('Update document requires atomic operators'); + } + + const currentOp = buildCurrentOp(this.bulkOperation); + return this.bulkOperation.addToOperationsList( + BatchType.UPDATE, + makeUpdateStatement(currentOp.selector, updateDocument, { ...currentOp, multi: false }) + ); + } + + /** Add a replace one operation to the bulk operation */ + replaceOne(replacement: Document): BulkOperationBase { + if (hasAtomicOperators(replacement)) { + throw new MongoInvalidArgumentError('Replacement document must not use atomic operators'); + } + + const currentOp = buildCurrentOp(this.bulkOperation); + return this.bulkOperation.addToOperationsList( + BatchType.UPDATE, + makeUpdateStatement(currentOp.selector, replacement, { ...currentOp, multi: false }) + ); + } + + /** Add a delete one operation to the bulk operation */ + deleteOne(): BulkOperationBase { + const currentOp = buildCurrentOp(this.bulkOperation); + return this.bulkOperation.addToOperationsList( + BatchType.DELETE, + makeDeleteStatement(currentOp.selector, { ...currentOp, limit: 1 }) + ); + } + + /** Add a delete many operation to the bulk operation */ + delete(): BulkOperationBase { + const currentOp = buildCurrentOp(this.bulkOperation); + return this.bulkOperation.addToOperationsList( + BatchType.DELETE, + makeDeleteStatement(currentOp.selector, { ...currentOp, limit: 0 }) + ); + } + + /** Upsert modifier for update bulk operation, noting that this operation is an upsert. */ + upsert(): this { + if (!this.bulkOperation.s.currentOp) { + this.bulkOperation.s.currentOp = {}; + } + + this.bulkOperation.s.currentOp.upsert = true; + return this; + } + + /** Specifies the collation for the query condition. */ + collation(collation: CollationOptions): this { + if (!this.bulkOperation.s.currentOp) { + this.bulkOperation.s.currentOp = {}; + } + + this.bulkOperation.s.currentOp.collation = collation; + return this; + } + + /** Specifies arrayFilters for UpdateOne or UpdateMany bulk operations. */ + arrayFilters(arrayFilters: Document[]): this { + if (!this.bulkOperation.s.currentOp) { + this.bulkOperation.s.currentOp = {}; + } + + this.bulkOperation.s.currentOp.arrayFilters = arrayFilters; + return this; + } +} + +/** @internal */ +export interface BulkOperationPrivate { + bulkResult: BulkResult; + currentBatch?: Batch; + currentIndex: number; + // ordered specific + currentBatchSize: number; + currentBatchSizeBytes: number; + // unordered specific + currentInsertBatch?: Batch; + currentUpdateBatch?: Batch; + currentRemoveBatch?: Batch; + batches: Batch[]; + // Write concern + writeConcern?: WriteConcern; + // Max batch size options + maxBsonObjectSize: number; + maxBatchSizeBytes: number; + maxWriteBatchSize: number; + maxKeySize: number; + // Namespace + namespace: MongoDBNamespace; + // Topology + topology: Topology; + // Options + options: BulkWriteOptions; + // BSON options + bsonOptions: BSONSerializeOptions; + // Document used to build a bulk operation + currentOp?: Document; + // Executed + executed: boolean; + // Collection + collection: Collection; + // Fundamental error + err?: AnyError; + // check keys + checkKeys: boolean; + bypassDocumentValidation?: boolean; +} + +/** @public */ +export interface BulkWriteOptions extends CommandOperationOptions { + /** Allow driver to bypass schema validation in MongoDB 3.2 or higher. */ + bypassDocumentValidation?: boolean; + /** If true, when an insert fails, don't execute the remaining writes. If false, continue with remaining inserts when one fails. */ + ordered?: boolean; + /** @deprecated use `ordered` instead */ + keepGoing?: boolean; + /** Force server to assign _id values instead of driver. */ + forceServerObjectId?: boolean; + /** Map of parameter names and values that can be accessed using $$var (requires MongoDB 5.0). */ + let?: Document; +} + +/** + * TODO(NODE-4063) + * BulkWrites merge complexity is implemented in executeCommands + * This provides a vehicle to treat bulkOperations like any other operation (hence "shim") + * We would like this logic to simply live inside the BulkWriteOperation class + * @internal + */ +class BulkWriteShimOperation extends AbstractOperation { + bulkOperation: BulkOperationBase; + constructor(bulkOperation: BulkOperationBase, options: BulkWriteOptions) { + super(options); + this.bulkOperation = bulkOperation; + } + + execute(server: Server, session: ClientSession | undefined, callback: Callback): void { + if (this.options.session == null) { + // An implicit session could have been created by 'executeOperation' + // So if we stick it on finalOptions here, each bulk operation + // will use this same session, it'll be passed in the same way + // an explicit session would be + this.options.session = session; + } + return executeCommands(this.bulkOperation, this.options, callback); + } +} + +/** @public */ +export abstract class BulkOperationBase { + isOrdered: boolean; + /** @internal */ + s: BulkOperationPrivate; + operationId?: number; + + /** + * Create a new OrderedBulkOperation or UnorderedBulkOperation instance + * @internal + */ + constructor(collection: Collection, options: BulkWriteOptions, isOrdered: boolean) { + // determine whether bulkOperation is ordered or unordered + this.isOrdered = isOrdered; + + const topology = getTopology(collection); + options = options == null ? {} : options; + // TODO Bring from driver information in hello + // Get the namespace for the write operations + const namespace = collection.s.namespace; + // Used to mark operation as executed + const executed = false; + + // Current item + const currentOp = undefined; + + // Set max byte size + const hello = topology.lastHello(); + + // If we have autoEncryption on, batch-splitting must be done on 2mb chunks, but single documents + // over 2mb are still allowed + const usingAutoEncryption = !!(topology.s.options && topology.s.options.autoEncrypter); + const maxBsonObjectSize = + hello && hello.maxBsonObjectSize ? hello.maxBsonObjectSize : 1024 * 1024 * 16; + const maxBatchSizeBytes = usingAutoEncryption ? 1024 * 1024 * 2 : maxBsonObjectSize; + const maxWriteBatchSize = hello && hello.maxWriteBatchSize ? hello.maxWriteBatchSize : 1000; + + // Calculates the largest possible size of an Array key, represented as a BSON string + // element. This calculation: + // 1 byte for BSON type + // # of bytes = length of (string representation of (maxWriteBatchSize - 1)) + // + 1 bytes for null terminator + const maxKeySize = (maxWriteBatchSize - 1).toString(10).length + 2; + + // Final options for retryable writes + let finalOptions = Object.assign({}, options); + finalOptions = applyRetryableWrites(finalOptions, collection.s.db); + + // Final results + const bulkResult: BulkResult = { + ok: 1, + writeErrors: [], + writeConcernErrors: [], + insertedIds: [], + nInserted: 0, + nUpserted: 0, + nMatched: 0, + nModified: 0, + nRemoved: 0, + upserted: [] + }; + + // Internal state + this.s = { + // Final result + bulkResult, + // Current batch state + currentBatch: undefined, + currentIndex: 0, + // ordered specific + currentBatchSize: 0, + currentBatchSizeBytes: 0, + // unordered specific + currentInsertBatch: undefined, + currentUpdateBatch: undefined, + currentRemoveBatch: undefined, + batches: [], + // Write concern + writeConcern: WriteConcern.fromOptions(options), + // Max batch size options + maxBsonObjectSize, + maxBatchSizeBytes, + maxWriteBatchSize, + maxKeySize, + // Namespace + namespace, + // Topology + topology, + // Options + options: finalOptions, + // BSON options + bsonOptions: resolveBSONOptions(options), + // Current operation + currentOp, + // Executed + executed, + // Collection + collection, + // Fundamental error + err: undefined, + // check keys + checkKeys: typeof options.checkKeys === 'boolean' ? options.checkKeys : false + }; + + // bypass Validation + if (options.bypassDocumentValidation === true) { + this.s.bypassDocumentValidation = true; + } + } + + /** + * Add a single insert document to the bulk operation + * + * @example + * ```js + * const bulkOp = collection.initializeOrderedBulkOp(); + * + * // Adds three inserts to the bulkOp. + * bulkOp + * .insert({ a: 1 }) + * .insert({ b: 2 }) + * .insert({ c: 3 }); + * await bulkOp.execute(); + * ``` + */ + insert(document: Document): BulkOperationBase { + if (document._id == null && !shouldForceServerObjectId(this)) { + document._id = new ObjectId(); + } + + return this.addToOperationsList(BatchType.INSERT, document); + } + + /** + * Builds a find operation for an update/updateOne/delete/deleteOne/replaceOne. + * Returns a builder object used to complete the definition of the operation. + * + * @example + * ```js + * const bulkOp = collection.initializeOrderedBulkOp(); + * + * // Add an updateOne to the bulkOp + * bulkOp.find({ a: 1 }).updateOne({ $set: { b: 2 } }); + * + * // Add an updateMany to the bulkOp + * bulkOp.find({ c: 3 }).update({ $set: { d: 4 } }); + * + * // Add an upsert + * bulkOp.find({ e: 5 }).upsert().updateOne({ $set: { f: 6 } }); + * + * // Add a deletion + * bulkOp.find({ g: 7 }).deleteOne(); + * + * // Add a multi deletion + * bulkOp.find({ h: 8 }).delete(); + * + * // Add a replaceOne + * bulkOp.find({ i: 9 }).replaceOne({writeConcern: { j: 10 }}); + * + * // Update using a pipeline (requires Mongodb 4.2 or higher) + * bulk.find({ k: 11, y: { $exists: true }, z: { $exists: true } }).updateOne([ + * { $set: { total: { $sum: [ '$y', '$z' ] } } } + * ]); + * + * // All of the ops will now be executed + * await bulkOp.execute(); + * ``` + */ + find(selector: Document): FindOperators { + if (!selector) { + throw new MongoInvalidArgumentError('Bulk find operation must specify a selector'); + } + + // Save a current selector + this.s.currentOp = { + selector: selector + }; + + return new FindOperators(this); + } + + /** Specifies a raw operation to perform in the bulk write. */ + raw(op: AnyBulkWriteOperation): this { + if (op == null || typeof op !== 'object') { + throw new MongoInvalidArgumentError('Operation must be an object with an operation key'); + } + if ('insertOne' in op) { + const forceServerObjectId = shouldForceServerObjectId(this); + if (op.insertOne && op.insertOne.document == null) { + // NOTE: provided for legacy support, but this is a malformed operation + if (forceServerObjectId !== true && (op.insertOne as Document)._id == null) { + (op.insertOne as Document)._id = new ObjectId(); + } + + return this.addToOperationsList(BatchType.INSERT, op.insertOne); + } + + if (forceServerObjectId !== true && op.insertOne.document._id == null) { + op.insertOne.document._id = new ObjectId(); + } + + return this.addToOperationsList(BatchType.INSERT, op.insertOne.document); + } + + if ('replaceOne' in op || 'updateOne' in op || 'updateMany' in op) { + if ('replaceOne' in op) { + if ('q' in op.replaceOne) { + throw new MongoInvalidArgumentError('Raw operations are not allowed'); + } + const updateStatement = makeUpdateStatement( + op.replaceOne.filter, + op.replaceOne.replacement, + { ...op.replaceOne, multi: false } + ); + if (hasAtomicOperators(updateStatement.u)) { + throw new MongoInvalidArgumentError('Replacement document must not use atomic operators'); + } + return this.addToOperationsList(BatchType.UPDATE, updateStatement); + } + + if ('updateOne' in op) { + if ('q' in op.updateOne) { + throw new MongoInvalidArgumentError('Raw operations are not allowed'); + } + const updateStatement = makeUpdateStatement(op.updateOne.filter, op.updateOne.update, { + ...op.updateOne, + multi: false + }); + if (!hasAtomicOperators(updateStatement.u)) { + throw new MongoInvalidArgumentError('Update document requires atomic operators'); + } + return this.addToOperationsList(BatchType.UPDATE, updateStatement); + } + + if ('updateMany' in op) { + if ('q' in op.updateMany) { + throw new MongoInvalidArgumentError('Raw operations are not allowed'); + } + const updateStatement = makeUpdateStatement(op.updateMany.filter, op.updateMany.update, { + ...op.updateMany, + multi: true + }); + if (!hasAtomicOperators(updateStatement.u)) { + throw new MongoInvalidArgumentError('Update document requires atomic operators'); + } + return this.addToOperationsList(BatchType.UPDATE, updateStatement); + } + } + + if ('deleteOne' in op) { + if ('q' in op.deleteOne) { + throw new MongoInvalidArgumentError('Raw operations are not allowed'); + } + return this.addToOperationsList( + BatchType.DELETE, + makeDeleteStatement(op.deleteOne.filter, { ...op.deleteOne, limit: 1 }) + ); + } + + if ('deleteMany' in op) { + if ('q' in op.deleteMany) { + throw new MongoInvalidArgumentError('Raw operations are not allowed'); + } + return this.addToOperationsList( + BatchType.DELETE, + makeDeleteStatement(op.deleteMany.filter, { ...op.deleteMany, limit: 0 }) + ); + } + + // otherwise an unknown operation was provided + throw new MongoInvalidArgumentError( + 'bulkWrite only supports insertOne, updateOne, updateMany, deleteOne, deleteMany' + ); + } + + get bsonOptions(): BSONSerializeOptions { + return this.s.bsonOptions; + } + + get writeConcern(): WriteConcern | undefined { + return this.s.writeConcern; + } + + get batches(): Batch[] { + const batches = [...this.s.batches]; + if (this.isOrdered) { + if (this.s.currentBatch) batches.push(this.s.currentBatch); + } else { + if (this.s.currentInsertBatch) batches.push(this.s.currentInsertBatch); + if (this.s.currentUpdateBatch) batches.push(this.s.currentUpdateBatch); + if (this.s.currentRemoveBatch) batches.push(this.s.currentRemoveBatch); + } + return batches; + } + + execute(options?: BulkWriteOptions): Promise; + execute(callback: Callback): void; + execute(options: BulkWriteOptions | undefined, callback: Callback): void; + execute( + options?: BulkWriteOptions | Callback, + callback?: Callback + ): Promise | void; + execute( + options?: BulkWriteOptions | Callback, + callback?: Callback + ): Promise | void { + if (typeof options === 'function') (callback = options), (options = {}); + options = options ?? {}; + + if (this.s.executed) { + return handleEarlyError(new MongoBatchReExecutionError(), callback); + } + + const writeConcern = WriteConcern.fromOptions(options); + if (writeConcern) { + this.s.writeConcern = writeConcern; + } + + // If we have current batch + if (this.isOrdered) { + if (this.s.currentBatch) this.s.batches.push(this.s.currentBatch); + } else { + if (this.s.currentInsertBatch) this.s.batches.push(this.s.currentInsertBatch); + if (this.s.currentUpdateBatch) this.s.batches.push(this.s.currentUpdateBatch); + if (this.s.currentRemoveBatch) this.s.batches.push(this.s.currentRemoveBatch); + } + // If we have no operations in the bulk raise an error + if (this.s.batches.length === 0) { + const emptyBatchError = new MongoInvalidArgumentError( + 'Invalid BulkOperation, Batch cannot be empty' + ); + return handleEarlyError(emptyBatchError, callback); + } + + this.s.executed = true; + const finalOptions = { ...this.s.options, ...options }; + const operation = new BulkWriteShimOperation(this, finalOptions); + + return executeOperation(this.s.collection.s.db.s.client, operation, callback); + } + + /** + * Handles the write error before executing commands + * @internal + */ + handleWriteError(callback: Callback, writeResult: BulkWriteResult): boolean { + if (this.s.bulkResult.writeErrors.length > 0) { + const msg = this.s.bulkResult.writeErrors[0].errmsg + ? this.s.bulkResult.writeErrors[0].errmsg + : 'write operation failed'; + + callback( + new MongoBulkWriteError( + { + message: msg, + code: this.s.bulkResult.writeErrors[0].code, + writeErrors: this.s.bulkResult.writeErrors + }, + writeResult + ) + ); + + return true; + } + + const writeConcernError = writeResult.getWriteConcernError(); + if (writeConcernError) { + callback(new MongoBulkWriteError(writeConcernError, writeResult)); + return true; + } + + return false; + } + + abstract addToOperationsList( + batchType: BatchType, + document: Document | UpdateStatement | DeleteStatement + ): this; +} + +Object.defineProperty(BulkOperationBase.prototype, 'length', { + enumerable: true, + get() { + return this.s.currentIndex; + } +}); + +/** helper function to assist with promiseOrCallback behavior */ +function handleEarlyError( + err?: AnyError, + callback?: Callback +): Promise | void { + const Promise = PromiseProvider.get(); + if (typeof callback === 'function') { + callback(err); + return; + } + + return Promise.reject(err); +} + +function shouldForceServerObjectId(bulkOperation: BulkOperationBase): boolean { + if (typeof bulkOperation.s.options.forceServerObjectId === 'boolean') { + return bulkOperation.s.options.forceServerObjectId; + } + + if (typeof bulkOperation.s.collection.s.db.options?.forceServerObjectId === 'boolean') { + return bulkOperation.s.collection.s.db.options?.forceServerObjectId; + } + + return false; +} + +function isInsertBatch(batch: Batch): boolean { + return batch.batchType === BatchType.INSERT; +} + +function isUpdateBatch(batch: Batch): batch is Batch { + return batch.batchType === BatchType.UPDATE; +} + +function isDeleteBatch(batch: Batch): batch is Batch { + return batch.batchType === BatchType.DELETE; +} + +function buildCurrentOp(bulkOp: BulkOperationBase): Document { + let { currentOp } = bulkOp.s; + bulkOp.s.currentOp = undefined; + if (!currentOp) currentOp = {}; + return currentOp; +} diff --git a/node_modules/mongodb/src/bulk/ordered.ts b/node_modules/mongodb/src/bulk/ordered.ts new file mode 100644 index 000000000..e0dbf9b7e --- /dev/null +++ b/node_modules/mongodb/src/bulk/ordered.ts @@ -0,0 +1,82 @@ +import type { Document } from '../bson'; +import * as BSON from '../bson'; +import type { Collection } from '../collection'; +import { MongoInvalidArgumentError } from '../error'; +import type { DeleteStatement } from '../operations/delete'; +import type { UpdateStatement } from '../operations/update'; +import { Batch, BatchType, BulkOperationBase, BulkWriteOptions } from './common'; + +/** @public */ +export class OrderedBulkOperation extends BulkOperationBase { + constructor(collection: Collection, options: BulkWriteOptions) { + super(collection, options, true); + } + + addToOperationsList( + batchType: BatchType, + document: Document | UpdateStatement | DeleteStatement + ): this { + // Get the bsonSize + const bsonSize = BSON.calculateObjectSize(document, { + checkKeys: false, + // Since we don't know what the user selected for BSON options here, + // err on the safe side, and check the size with ignoreUndefined: false. + ignoreUndefined: false + } as any); + + // Throw error if the doc is bigger than the max BSON size + if (bsonSize >= this.s.maxBsonObjectSize) + // TODO(NODE-3483): Change this to MongoBSONError + throw new MongoInvalidArgumentError( + `Document is larger than the maximum size ${this.s.maxBsonObjectSize}` + ); + + // Create a new batch object if we don't have a current one + if (this.s.currentBatch == null) { + this.s.currentBatch = new Batch(batchType, this.s.currentIndex); + } + + const maxKeySize = this.s.maxKeySize; + + // Check if we need to create a new batch + if ( + // New batch if we exceed the max batch op size + this.s.currentBatchSize + 1 >= this.s.maxWriteBatchSize || + // New batch if we exceed the maxBatchSizeBytes. Only matters if batch already has a doc, + // since we can't sent an empty batch + (this.s.currentBatchSize > 0 && + this.s.currentBatchSizeBytes + maxKeySize + bsonSize >= this.s.maxBatchSizeBytes) || + // New batch if the new op does not have the same op type as the current batch + this.s.currentBatch.batchType !== batchType + ) { + // Save the batch to the execution stack + this.s.batches.push(this.s.currentBatch); + + // Create a new batch + this.s.currentBatch = new Batch(batchType, this.s.currentIndex); + + // Reset the current size trackers + this.s.currentBatchSize = 0; + this.s.currentBatchSizeBytes = 0; + } + + if (batchType === BatchType.INSERT) { + this.s.bulkResult.insertedIds.push({ + index: this.s.currentIndex, + _id: (document as Document)._id + }); + } + + // We have an array of documents + if (Array.isArray(document)) { + throw new MongoInvalidArgumentError('Operation passed in cannot be an Array'); + } + + this.s.currentBatch.originalIndexes.push(this.s.currentIndex); + this.s.currentBatch.operations.push(document); + this.s.currentBatchSize += 1; + this.s.currentBatchSizeBytes += maxKeySize + bsonSize; + this.s.currentIndex += 1; + return this; + } +} diff --git a/node_modules/mongodb/src/bulk/unordered.ts b/node_modules/mongodb/src/bulk/unordered.ts new file mode 100644 index 000000000..b4227e8d0 --- /dev/null +++ b/node_modules/mongodb/src/bulk/unordered.ts @@ -0,0 +1,109 @@ +import type { Document } from '../bson'; +import * as BSON from '../bson'; +import type { Collection } from '../collection'; +import { MongoInvalidArgumentError } from '../error'; +import type { DeleteStatement } from '../operations/delete'; +import type { UpdateStatement } from '../operations/update'; +import type { Callback } from '../utils'; +import { Batch, BatchType, BulkOperationBase, BulkWriteOptions, BulkWriteResult } from './common'; + +/** @public */ +export class UnorderedBulkOperation extends BulkOperationBase { + constructor(collection: Collection, options: BulkWriteOptions) { + super(collection, options, false); + } + + override handleWriteError(callback: Callback, writeResult: BulkWriteResult): boolean { + if (this.s.batches.length) { + return false; + } + + return super.handleWriteError(callback, writeResult); + } + + addToOperationsList( + batchType: BatchType, + document: Document | UpdateStatement | DeleteStatement + ): this { + // Get the bsonSize + const bsonSize = BSON.calculateObjectSize(document, { + checkKeys: false, + + // Since we don't know what the user selected for BSON options here, + // err on the safe side, and check the size with ignoreUndefined: false. + ignoreUndefined: false + } as any); + + // Throw error if the doc is bigger than the max BSON size + if (bsonSize >= this.s.maxBsonObjectSize) { + // TODO(NODE-3483): Change this to MongoBSONError + throw new MongoInvalidArgumentError( + `Document is larger than the maximum size ${this.s.maxBsonObjectSize}` + ); + } + + // Holds the current batch + this.s.currentBatch = undefined; + // Get the right type of batch + if (batchType === BatchType.INSERT) { + this.s.currentBatch = this.s.currentInsertBatch; + } else if (batchType === BatchType.UPDATE) { + this.s.currentBatch = this.s.currentUpdateBatch; + } else if (batchType === BatchType.DELETE) { + this.s.currentBatch = this.s.currentRemoveBatch; + } + + const maxKeySize = this.s.maxKeySize; + + // Create a new batch object if we don't have a current one + if (this.s.currentBatch == null) { + this.s.currentBatch = new Batch(batchType, this.s.currentIndex); + } + + // Check if we need to create a new batch + if ( + // New batch if we exceed the max batch op size + this.s.currentBatch.size + 1 >= this.s.maxWriteBatchSize || + // New batch if we exceed the maxBatchSizeBytes. Only matters if batch already has a doc, + // since we can't sent an empty batch + (this.s.currentBatch.size > 0 && + this.s.currentBatch.sizeBytes + maxKeySize + bsonSize >= this.s.maxBatchSizeBytes) || + // New batch if the new op does not have the same op type as the current batch + this.s.currentBatch.batchType !== batchType + ) { + // Save the batch to the execution stack + this.s.batches.push(this.s.currentBatch); + + // Create a new batch + this.s.currentBatch = new Batch(batchType, this.s.currentIndex); + } + + // We have an array of documents + if (Array.isArray(document)) { + throw new MongoInvalidArgumentError('Operation passed in cannot be an Array'); + } + + this.s.currentBatch.operations.push(document); + this.s.currentBatch.originalIndexes.push(this.s.currentIndex); + this.s.currentIndex = this.s.currentIndex + 1; + + // Save back the current Batch to the right type + if (batchType === BatchType.INSERT) { + this.s.currentInsertBatch = this.s.currentBatch; + this.s.bulkResult.insertedIds.push({ + index: this.s.bulkResult.insertedIds.length, + _id: (document as Document)._id + }); + } else if (batchType === BatchType.UPDATE) { + this.s.currentUpdateBatch = this.s.currentBatch; + } else if (batchType === BatchType.DELETE) { + this.s.currentRemoveBatch = this.s.currentBatch; + } + + // Update current batch size + this.s.currentBatch.size += 1; + this.s.currentBatch.sizeBytes += maxKeySize + bsonSize; + + return this; + } +} diff --git a/node_modules/mongodb/src/change_stream.ts b/node_modules/mongodb/src/change_stream.ts new file mode 100644 index 000000000..e268097bd --- /dev/null +++ b/node_modules/mongodb/src/change_stream.ts @@ -0,0 +1,1167 @@ +import Denque = require('denque'); +import type { Readable } from 'stream'; +import { setTimeout } from 'timers'; + +import type { Binary, Document, Long, Timestamp } from './bson'; +import { Collection } from './collection'; +import { CHANGE, CLOSE, END, ERROR, INIT, MORE, RESPONSE, RESUME_TOKEN_CHANGED } from './constants'; +import { + AbstractCursor, + AbstractCursorEvents, + AbstractCursorOptions, + CursorStreamOptions +} from './cursor/abstract_cursor'; +import { Db } from './db'; +import { + AnyError, + isResumableError, + MongoAPIError, + MongoChangeStreamError, + MongoRuntimeError +} from './error'; +import { MongoClient } from './mongo_client'; +import { InferIdType, TODO_NODE_3286, TypedEventEmitter } from './mongo_types'; +import { AggregateOperation, AggregateOptions } from './operations/aggregate'; +import type { CollationOptions, OperationParent } from './operations/command'; +import { executeOperation, ExecutionResult } from './operations/execute_operation'; +import type { ReadPreference } from './read_preference'; +import type { Topology } from './sdam/topology'; +import type { ClientSession, ServerSessionId } from './sessions'; +import { + calculateDurationInMs, + Callback, + filterOptions, + getTopology, + maxWireVersion, + maybePromise, + MongoDBNamespace, + now +} from './utils'; + +/** @internal */ +const kResumeQueue = Symbol('resumeQueue'); +/** @internal */ +const kCursorStream = Symbol('cursorStream'); +/** @internal */ +const kClosed = Symbol('closed'); +/** @internal */ +const kMode = Symbol('mode'); + +const CHANGE_STREAM_OPTIONS = [ + 'resumeAfter', + 'startAfter', + 'startAtOperationTime', + 'fullDocument', + 'fullDocumentBeforeChange', + 'showExpandedEvents' +] as const; + +const CHANGE_DOMAIN_TYPES = { + COLLECTION: Symbol('Collection'), + DATABASE: Symbol('Database'), + CLUSTER: Symbol('Cluster') +}; + +interface TopologyWaitOptions { + start?: number; + timeout?: number; + readPreference?: ReadPreference; +} + +const SELECTION_TIMEOUT = 30000; + +const CHANGE_STREAM_EVENTS = [RESUME_TOKEN_CHANGED, END, CLOSE]; + +const NO_RESUME_TOKEN_ERROR = + 'A change stream document has been received that lacks a resume token (_id).'; +const NO_CURSOR_ERROR = 'ChangeStream has no cursor'; +const CHANGESTREAM_CLOSED_ERROR = 'ChangeStream is closed'; + +/** + * @public + * @deprecated Please use the ChangeStreamCursorOptions type instead. + */ +export interface ResumeOptions { + startAtOperationTime?: Timestamp; + batchSize?: number; + maxAwaitTimeMS?: number; + collation?: CollationOptions; + readPreference?: ReadPreference; + resumeAfter?: ResumeToken; + startAfter?: ResumeToken; + fullDocument?: string; +} + +/** + * Represents the logical starting point for a new ChangeStream or resuming a ChangeStream on the server. + * @see https://www.mongodb.com/docs/manual/changeStreams/#std-label-change-stream-resume + * @public + */ +export type ResumeToken = unknown; + +/** + * Represents a specific point in time on a server. Can be retrieved by using `db.command()` + * @public + * @see https://docs.mongodb.com/manual/reference/method/db.runCommand/#response + */ +export type OperationTime = Timestamp; + +/** @public */ +export interface PipeOptions { + end?: boolean; +} + +/** @internal */ +export type ChangeStreamAggregateRawResult = { + $clusterTime: { clusterTime: Timestamp }; + cursor: { + postBatchResumeToken: ResumeToken; + ns: string; + id: number | Long; + } & ({ firstBatch: TChange[] } | { nextBatch: TChange[] }); + ok: 1; + operationTime: Timestamp; +}; + +/** + * Options that can be passed to a ChangeStream. Note that startAfter, resumeAfter, and startAtOperationTime are all mutually exclusive, and the server will error if more than one is specified. + * @public + */ +export interface ChangeStreamOptions extends AggregateOptions { + /** + * Allowed values: 'updateLookup', 'whenAvailable', 'required'. + * + * When set to 'updateLookup', the change notification for partial updates + * will include both a delta describing the changes to the document as well + * as a copy of the entire document that was changed from some time after + * the change occurred. + * + * When set to 'whenAvailable', configures the change stream to return the + * post-image of the modified document for replace and update change events + * if the post-image for this event is available. + * + * When set to 'required', the same behavior as 'whenAvailable' except that + * an error is raised if the post-image is not available. + */ + fullDocument?: string; + + /** + * Allowed values: 'whenAvailable', 'required', 'off'. + * + * The default is to not send a value, which is equivalent to 'off'. + * + * When set to 'whenAvailable', configures the change stream to return the + * pre-image of the modified document for replace, update, and delete change + * events if it is available. + * + * When set to 'required', the same behavior as 'whenAvailable' except that + * an error is raised if the pre-image is not available. + */ + fullDocumentBeforeChange?: string; + /** The maximum amount of time for the server to wait on new documents to satisfy a change stream query. */ + maxAwaitTimeMS?: number; + /** + * Allows you to start a changeStream after a specified event. + * @see https://docs.mongodb.com/manual/changeStreams/#resumeafter-for-change-streams + */ + resumeAfter?: ResumeToken; + /** + * Similar to resumeAfter, but will allow you to start after an invalidated event. + * @see https://docs.mongodb.com/manual/changeStreams/#startafter-for-change-streams + */ + startAfter?: ResumeToken; + /** Will start the changeStream after the specified operationTime. */ + startAtOperationTime?: OperationTime; + /** + * The number of documents to return per batch. + * @see https://docs.mongodb.com/manual/reference/command/aggregate + */ + batchSize?: number; + + /** + * When enabled, configures the change stream to include extra change events. + * + * - createIndexes + * - dropIndexes + * - modify + * - create + * - shardCollection + * - reshardCollection + * - refineCollectionShardKey + */ + showExpandedEvents?: boolean; +} + +/** @public */ +export interface ChangeStreamNameSpace { + db: string; + coll: string; +} + +/** @public */ +export interface ChangeStreamDocumentKey { + /** + * For unsharded collections this contains a single field `_id`. + * For sharded collections, this will contain all the components of the shard key + */ + documentKey: { _id: InferIdType; [shardKey: string]: any }; +} + +/** @public */ +export interface ChangeStreamDocumentCommon { + /** + * The id functions as an opaque token for use when resuming an interrupted + * change stream. + */ + _id: ResumeToken; + /** + * The timestamp from the oplog entry associated with the event. + * For events that happened as part of a multi-document transaction, the associated change stream + * notifications will have the same clusterTime value, namely the time when the transaction was committed. + * On a sharded cluster, events that occur on different shards can have the same clusterTime but be + * associated with different transactions or even not be associated with any transaction. + * To identify events for a single transaction, you can use the combination of lsid and txnNumber in the change stream event document. + */ + clusterTime?: Timestamp; + + /** + * The transaction number. + * Only present if the operation is part of a multi-document transaction. + * + * **NOTE:** txnNumber can be a Long if promoteLongs is set to false + */ + txnNumber?: number; + + /** + * The identifier for the session associated with the transaction. + * Only present if the operation is part of a multi-document transaction. + */ + lsid?: ServerSessionId; +} + +/** @public */ +export interface ChangeStreamDocumentCollectionUUID { + /** + * The UUID (Binary subtype 4) of the collection that the operation was performed on. + * + * Only present when the `showExpandedEvents` flag is enabled. + * + * **NOTE:** collectionUUID will be converted to a NodeJS Buffer if the promoteBuffers + * flag is enabled. + * + * @since 6.1.0 + */ + collectionUUID: Binary; +} + +/** @public */ +export interface ChangeStreamDocumentOperationDescription { + /** + * An description of the operation. + * + * Only present when the `showExpandedEvents` flag is enabled. + * + * @since 6.1.0 + */ + operationDescription?: Document; +} + +/** + * @public + * @see https://www.mongodb.com/docs/manual/reference/change-events/#insert-event + */ +export interface ChangeStreamInsertDocument + extends ChangeStreamDocumentCommon, + ChangeStreamDocumentKey, + ChangeStreamDocumentCollectionUUID { + /** Describes the type of operation represented in this change notification */ + operationType: 'insert'; + /** This key will contain the document being inserted */ + fullDocument: TSchema; + /** Namespace the insert event occured on */ + ns: ChangeStreamNameSpace; +} + +/** + * @public + * @see https://www.mongodb.com/docs/manual/reference/change-events/#update-event + */ +export interface ChangeStreamUpdateDocument + extends ChangeStreamDocumentCommon, + ChangeStreamDocumentKey, + ChangeStreamDocumentCollectionUUID { + /** Describes the type of operation represented in this change notification */ + operationType: 'update'; + /** + * This is only set if `fullDocument` is set to `'updateLookup'` + * Contains the point-in-time post-image of the modified document if the + * post-image is available and either 'required' or 'whenAvailable' was + * specified for the 'fullDocument' option when creating the change stream. + */ + fullDocument?: TSchema; + /** Contains a description of updated and removed fields in this operation */ + updateDescription: UpdateDescription; + /** Namespace the update event occured on */ + ns: ChangeStreamNameSpace; + /** + * Contains the pre-image of the modified or deleted document if the + * pre-image is available for the change event and either 'required' or + * 'whenAvailable' was specified for the 'fullDocumentBeforeChange' option + * when creating the change stream. If 'whenAvailable' was specified but the + * pre-image is unavailable, this will be explicitly set to null. + */ + fullDocumentBeforeChange?: TSchema; +} + +/** + * @public + * @see https://www.mongodb.com/docs/manual/reference/change-events/#replace-event + */ +export interface ChangeStreamReplaceDocument + extends ChangeStreamDocumentCommon, + ChangeStreamDocumentKey { + /** Describes the type of operation represented in this change notification */ + operationType: 'replace'; + /** The fullDocument of a replace event represents the document after the insert of the replacement document */ + fullDocument: TSchema; + /** Namespace the replace event occured on */ + ns: ChangeStreamNameSpace; + /** + * Contains the pre-image of the modified or deleted document if the + * pre-image is available for the change event and either 'required' or + * 'whenAvailable' was specified for the 'fullDocumentBeforeChange' option + * when creating the change stream. If 'whenAvailable' was specified but the + * pre-image is unavailable, this will be explicitly set to null. + */ + fullDocumentBeforeChange?: TSchema; +} + +/** + * @public + * @see https://www.mongodb.com/docs/manual/reference/change-events/#delete-event + */ +export interface ChangeStreamDeleteDocument + extends ChangeStreamDocumentCommon, + ChangeStreamDocumentKey, + ChangeStreamDocumentCollectionUUID { + /** Describes the type of operation represented in this change notification */ + operationType: 'delete'; + /** Namespace the delete event occured on */ + ns: ChangeStreamNameSpace; + /** + * Contains the pre-image of the modified or deleted document if the + * pre-image is available for the change event and either 'required' or + * 'whenAvailable' was specified for the 'fullDocumentBeforeChange' option + * when creating the change stream. If 'whenAvailable' was specified but the + * pre-image is unavailable, this will be explicitly set to null. + */ + fullDocumentBeforeChange?: TSchema; +} + +/** + * @public + * @see https://www.mongodb.com/docs/manual/reference/change-events/#drop-event + */ +export interface ChangeStreamDropDocument + extends ChangeStreamDocumentCommon, + ChangeStreamDocumentCollectionUUID { + /** Describes the type of operation represented in this change notification */ + operationType: 'drop'; + /** Namespace the drop event occured on */ + ns: ChangeStreamNameSpace; +} + +/** + * @public + * @see https://www.mongodb.com/docs/manual/reference/change-events/#rename-event + */ +export interface ChangeStreamRenameDocument + extends ChangeStreamDocumentCommon, + ChangeStreamDocumentCollectionUUID { + /** Describes the type of operation represented in this change notification */ + operationType: 'rename'; + /** The new name for the `ns.coll` collection */ + to: { db: string; coll: string }; + /** The "from" namespace that the rename occured on */ + ns: ChangeStreamNameSpace; +} + +/** + * @public + * @see https://www.mongodb.com/docs/manual/reference/change-events/#dropdatabase-event + */ +export interface ChangeStreamDropDatabaseDocument extends ChangeStreamDocumentCommon { + /** Describes the type of operation represented in this change notification */ + operationType: 'dropDatabase'; + /** The database dropped */ + ns: { db: string }; +} + +/** + * @public + * @see https://www.mongodb.com/docs/manual/reference/change-events/#invalidate-event + */ +export interface ChangeStreamInvalidateDocument extends ChangeStreamDocumentCommon { + /** Describes the type of operation represented in this change notification */ + operationType: 'invalidate'; +} + +/** + * Only present when the `showExpandedEvents` flag is enabled. + * @public + * @see https://www.mongodb.com/docs/manual/reference/change-events/ + */ +export interface ChangeStreamCreateIndexDocument + extends ChangeStreamDocumentCommon, + ChangeStreamDocumentCollectionUUID, + ChangeStreamDocumentOperationDescription { + /** Describes the type of operation represented in this change notification */ + operationType: 'createIndexes'; +} + +/** + * Only present when the `showExpandedEvents` flag is enabled. + * @public + * @see https://www.mongodb.com/docs/manual/reference/change-events/ + */ +export interface ChangeStreamDropIndexDocument + extends ChangeStreamDocumentCommon, + ChangeStreamDocumentCollectionUUID, + ChangeStreamDocumentOperationDescription { + /** Describes the type of operation represented in this change notification */ + operationType: 'dropIndexes'; +} + +/** + * Only present when the `showExpandedEvents` flag is enabled. + * @public + * @see https://www.mongodb.com/docs/manual/reference/change-events/ + */ +export interface ChangeStreamCollModDocument + extends ChangeStreamDocumentCommon, + ChangeStreamDocumentCollectionUUID { + /** Describes the type of operation represented in this change notification */ + operationType: 'modify'; +} + +/** + * @public + * @see https://www.mongodb.com/docs/manual/reference/change-events/ + */ +export interface ChangeStreamCreateDocument + extends ChangeStreamDocumentCommon, + ChangeStreamDocumentCollectionUUID { + /** Describes the type of operation represented in this change notification */ + operationType: 'create'; +} + +/** + * @public + * @see https://www.mongodb.com/docs/manual/reference/change-events/ + */ +export interface ChangeStreamShardCollectionDocument + extends ChangeStreamDocumentCommon, + ChangeStreamDocumentCollectionUUID, + ChangeStreamDocumentOperationDescription { + /** Describes the type of operation represented in this change notification */ + operationType: 'shardCollection'; +} + +/** + * @public + * @see https://www.mongodb.com/docs/manual/reference/change-events/ + */ +export interface ChangeStreamReshardCollectionDocument + extends ChangeStreamDocumentCommon, + ChangeStreamDocumentCollectionUUID, + ChangeStreamDocumentOperationDescription { + /** Describes the type of operation represented in this change notification */ + operationType: 'reshardCollection'; +} + +/** + * @public + * @see https://www.mongodb.com/docs/manual/reference/change-events/ + */ +export interface ChangeStreamRefineCollectionShardKeyDocument + extends ChangeStreamDocumentCommon, + ChangeStreamDocumentCollectionUUID, + ChangeStreamDocumentOperationDescription { + /** Describes the type of operation represented in this change notification */ + operationType: 'refineCollectionShardKey'; +} + +/** @public */ +export type ChangeStreamDocument = + | ChangeStreamInsertDocument + | ChangeStreamUpdateDocument + | ChangeStreamReplaceDocument + | ChangeStreamDeleteDocument + | ChangeStreamDropDocument + | ChangeStreamRenameDocument + | ChangeStreamDropDatabaseDocument + | ChangeStreamInvalidateDocument + | ChangeStreamCreateIndexDocument + | ChangeStreamCreateDocument + | ChangeStreamCollModDocument + | ChangeStreamDropIndexDocument + | ChangeStreamShardCollectionDocument + | ChangeStreamReshardCollectionDocument + | ChangeStreamRefineCollectionShardKeyDocument; + +/** @public */ +export interface UpdateDescription { + /** + * A document containing key:value pairs of names of the fields that were + * changed, and the new value for those fields. + */ + updatedFields?: Partial; + + /** + * An array of field names that were removed from the document. + */ + removedFields?: string[]; + + /** + * An array of documents which record array truncations performed with pipeline-based updates using one or more of the following stages: + * - $addFields + * - $set + * - $replaceRoot + * - $replaceWith + */ + truncatedArrays?: Array<{ + /** The name of the truncated field. */ + field: string; + /** The number of elements in the truncated array. */ + newSize: number; + }>; +} + +/** @public */ +export type ChangeStreamEvents< + TSchema extends Document = Document, + TChange extends Document = ChangeStreamDocument +> = { + resumeTokenChanged(token: ResumeToken): void; + init(response: any): void; + more(response?: any): void; + response(): void; + end(): void; + error(error: Error): void; + change(change: TChange): void; +} & AbstractCursorEvents; + +/** + * Creates a new Change Stream instance. Normally created using {@link Collection#watch|Collection.watch()}. + * @public + */ +export class ChangeStream< + TSchema extends Document = Document, + TChange extends Document = ChangeStreamDocument +> extends TypedEventEmitter> { + pipeline: Document[]; + options: ChangeStreamOptions; + parent: MongoClient | Db | Collection; + namespace: MongoDBNamespace; + type: symbol; + /** @internal */ + cursor: ChangeStreamCursor | undefined; + streamOptions?: CursorStreamOptions; + /** @internal */ + [kResumeQueue]: Denque>>; + /** @internal */ + [kCursorStream]?: Readable & AsyncIterable; + /** @internal */ + [kClosed]: boolean; + /** @internal */ + [kMode]: false | 'iterator' | 'emitter'; + + /** @event */ + static readonly RESPONSE = RESPONSE; + /** @event */ + static readonly MORE = MORE; + /** @event */ + static readonly INIT = INIT; + /** @event */ + static readonly CLOSE = CLOSE; + /** + * Fired for each new matching change in the specified namespace. Attaching a `change` + * event listener to a Change Stream will switch the stream into flowing mode. Data will + * then be passed as soon as it is available. + * @event + */ + static readonly CHANGE = CHANGE; + /** @event */ + static readonly END = END; + /** @event */ + static readonly ERROR = ERROR; + /** + * Emitted each time the change stream stores a new resume token. + * @event + */ + static readonly RESUME_TOKEN_CHANGED = RESUME_TOKEN_CHANGED; + + /** + * @internal + * + * @param parent - The parent object that created this change stream + * @param pipeline - An array of {@link https://docs.mongodb.com/manual/reference/operator/aggregation-pipeline/|aggregation pipeline stages} through which to pass change stream documents + */ + constructor( + parent: OperationParent, + pipeline: Document[] = [], + options: ChangeStreamOptions = {} + ) { + super(); + + this.pipeline = pipeline; + this.options = options; + + if (parent instanceof Collection) { + this.type = CHANGE_DOMAIN_TYPES.COLLECTION; + } else if (parent instanceof Db) { + this.type = CHANGE_DOMAIN_TYPES.DATABASE; + } else if (parent instanceof MongoClient) { + this.type = CHANGE_DOMAIN_TYPES.CLUSTER; + } else { + throw new MongoChangeStreamError( + 'Parent provided to ChangeStream constructor must be an instance of Collection, Db, or MongoClient' + ); + } + + this.parent = parent; + this.namespace = parent.s.namespace; + if (!this.options.readPreference && parent.readPreference) { + this.options.readPreference = parent.readPreference; + } + + this[kResumeQueue] = new Denque(); + + // Create contained Change Stream cursor + this.cursor = this._createChangeStreamCursor(options); + + this[kClosed] = false; + this[kMode] = false; + + // Listen for any `change` listeners being added to ChangeStream + this.on('newListener', eventName => { + if (eventName === 'change' && this.cursor && this.listenerCount('change') === 0) { + this._streamEvents(this.cursor); + } + }); + + this.on('removeListener', eventName => { + if (eventName === 'change' && this.listenerCount('change') === 0 && this.cursor) { + this[kCursorStream]?.removeAllListeners('data'); + } + }); + } + + /** @internal */ + get cursorStream(): (Readable & AsyncIterable) | undefined { + return this[kCursorStream]; + } + + /** The cached resume token that is used to resume after the most recently returned change. */ + get resumeToken(): ResumeToken { + return this.cursor?.resumeToken; + } + + /** Check if there is any document still available in the Change Stream */ + hasNext(): Promise; + hasNext(callback: Callback): void; + hasNext(callback?: Callback): Promise | void { + this._setIsIterator(); + return maybePromise(callback, cb => { + this._getCursor((err, cursor) => { + if (err || !cursor) return cb(err); // failed to resume, raise an error + cursor.hasNext(cb); + }); + }); + } + + /** Get the next available document from the Change Stream. */ + next(): Promise; + next(callback: Callback): void; + next(callback?: Callback): Promise | void { + this._setIsIterator(); + return maybePromise(callback, cb => { + this._getCursor((err, cursor) => { + if (err || !cursor) return cb(err); // failed to resume, raise an error + cursor.next((error, change) => { + if (error) { + this[kResumeQueue].push(() => this.next(cb)); + this._processError(error, cb); + return; + } + this._processNewChange(change ?? null, cb); + }); + }); + }); + } + + /** Is the cursor closed */ + get closed(): boolean { + return this[kClosed] || (this.cursor?.closed ?? false); + } + + /** Close the Change Stream */ + close(callback?: Callback): Promise | void { + this[kClosed] = true; + + return maybePromise(callback, cb => { + if (!this.cursor) { + return cb(); + } + + const cursor = this.cursor; + return cursor.close(err => { + this._endStream(); + this.cursor = undefined; + return cb(err); + }); + }); + } + + /** + * Return a modified Readable stream including a possible transform method. + * @throws MongoDriverError if this.cursor is undefined + */ + stream(options?: CursorStreamOptions): Readable & AsyncIterable { + this.streamOptions = options; + if (!this.cursor) throw new MongoChangeStreamError(NO_CURSOR_ERROR); + return this.cursor.stream(options); + } + + /** + * Try to get the next available document from the Change Stream's cursor or `null` if an empty batch is returned + */ + tryNext(): Promise; + tryNext(callback: Callback): void; + tryNext(callback?: Callback): Promise | void { + this._setIsIterator(); + return maybePromise(callback, cb => { + this._getCursor((err, cursor) => { + if (err || !cursor) return cb(err); // failed to resume, raise an error + return cursor.tryNext(cb); + }); + }); + } + + /** @internal */ + private _setIsEmitter(): void { + if (this[kMode] === 'iterator') { + // TODO(NODE-3485): Replace with MongoChangeStreamModeError + throw new MongoAPIError( + 'ChangeStream cannot be used as an EventEmitter after being used as an iterator' + ); + } + this[kMode] = 'emitter'; + } + + /** @internal */ + private _setIsIterator(): void { + if (this[kMode] === 'emitter') { + // TODO(NODE-3485): Replace with MongoChangeStreamModeError + throw new MongoAPIError( + 'ChangeStream cannot be used as an iterator after being used as an EventEmitter' + ); + } + this[kMode] = 'iterator'; + } + + /** + * Create a new change stream cursor based on self's configuration + * @internal + */ + private _createChangeStreamCursor( + options: ChangeStreamOptions | ChangeStreamCursorOptions + ): ChangeStreamCursor { + const changeStreamStageOptions = filterOptions(options, CHANGE_STREAM_OPTIONS); + if (this.type === CHANGE_DOMAIN_TYPES.CLUSTER) { + changeStreamStageOptions.allChangesForCluster = true; + } + const pipeline = [{ $changeStream: changeStreamStageOptions }, ...this.pipeline]; + + const client: MongoClient | null = + this.type === CHANGE_DOMAIN_TYPES.CLUSTER + ? (this.parent as MongoClient) + : this.type === CHANGE_DOMAIN_TYPES.DATABASE + ? (this.parent as Db).s.client + : this.type === CHANGE_DOMAIN_TYPES.COLLECTION + ? (this.parent as Collection).s.db.s.client + : null; + + if (client == null) { + // This should never happen because of the assertion in the constructor + throw new MongoRuntimeError( + `Changestream type should only be one of cluster, database, collection. Found ${this.type.toString()}` + ); + } + + const changeStreamCursor = new ChangeStreamCursor( + client, + this.namespace, + pipeline, + options + ); + + for (const event of CHANGE_STREAM_EVENTS) { + changeStreamCursor.on(event, e => this.emit(event, e)); + } + + if (this.listenerCount(ChangeStream.CHANGE) > 0) { + this._streamEvents(changeStreamCursor); + } + + return changeStreamCursor; + } + + /** + * This method performs a basic server selection loop, satisfying the requirements of + * ChangeStream resumability until the new SDAM layer can be used. + * @internal + */ + private _waitForTopologyConnected( + topology: Topology, + options: TopologyWaitOptions, + callback: Callback + ) { + setTimeout(() => { + if (options && options.start == null) { + options.start = now(); + } + + const start = options.start || now(); + const timeout = options.timeout || SELECTION_TIMEOUT; + if (topology.isConnected()) { + return callback(); + } + + if (calculateDurationInMs(start) > timeout) { + // TODO(NODE-3497): Replace with MongoNetworkTimeoutError + return callback(new MongoRuntimeError('Timed out waiting for connection')); + } + + this._waitForTopologyConnected(topology, options, callback); + }, 500); // this is an arbitrary wait time to allow SDAM to transition + } + + /** @internal */ + private _closeWithError(error: AnyError, callback?: Callback): void { + if (!callback) { + this.emit(ChangeStream.ERROR, error); + } + + this.close(() => callback && callback(error)); + } + + /** @internal */ + private _streamEvents(cursor: ChangeStreamCursor): void { + this._setIsEmitter(); + const stream = this[kCursorStream] ?? cursor.stream(); + this[kCursorStream] = stream; + stream.on('data', change => this._processNewChange(change)); + stream.on('error', error => this._processError(error)); + } + + /** @internal */ + private _endStream(): void { + const cursorStream = this[kCursorStream]; + if (cursorStream) { + ['data', 'close', 'end', 'error'].forEach(event => cursorStream.removeAllListeners(event)); + cursorStream.destroy(); + } + + this[kCursorStream] = undefined; + } + + /** @internal */ + private _processNewChange(change: TChange | null, callback?: Callback) { + if (this[kClosed]) { + // TODO(NODE-3485): Replace with MongoChangeStreamClosedError + if (callback) callback(new MongoAPIError(CHANGESTREAM_CLOSED_ERROR)); + return; + } + + // a null change means the cursor has been notified, implicitly closing the change stream + if (change == null) { + // TODO(NODE-3485): Replace with MongoChangeStreamClosedError + return this._closeWithError(new MongoRuntimeError(CHANGESTREAM_CLOSED_ERROR), callback); + } + + if (change && !change._id) { + return this._closeWithError(new MongoChangeStreamError(NO_RESUME_TOKEN_ERROR), callback); + } + + // cache the resume token + this.cursor?.cacheResumeToken(change._id); + + // wipe the startAtOperationTime if there was one so that there won't be a conflict + // between resumeToken and startAtOperationTime if we need to reconnect the cursor + this.options.startAtOperationTime = undefined; + + // Return the change + if (!callback) return this.emit(ChangeStream.CHANGE, change); + return callback(undefined, change); + } + + /** @internal */ + private _processError(error: AnyError, callback?: Callback) { + const cursor = this.cursor; + + // If the change stream has been closed explicitly, do not process error. + if (this[kClosed]) { + // TODO(NODE-3485): Replace with MongoChangeStreamClosedError + if (callback) callback(new MongoAPIError(CHANGESTREAM_CLOSED_ERROR)); + return; + } + + // if the resume succeeds, continue with the new cursor + const resumeWithCursor = (newCursor: ChangeStreamCursor) => { + this.cursor = newCursor; + this._processResumeQueue(); + }; + + // otherwise, raise an error and close the change stream + const unresumableError = (err: AnyError) => { + if (!callback) { + this.emit(ChangeStream.ERROR, err); + } + + this.close(() => this._processResumeQueue(err)); + }; + + if (cursor && isResumableError(error, maxWireVersion(cursor.server))) { + this.cursor = undefined; + + // stop listening to all events from old cursor + this._endStream(); + + // close internal cursor, ignore errors + cursor.close(); + + const topology = getTopology(this.parent); + this._waitForTopologyConnected(topology, { readPreference: cursor.readPreference }, err => { + // if the topology can't reconnect, close the stream + if (err) return unresumableError(err); + + // create a new cursor, preserving the old cursor's options + const newCursor = this._createChangeStreamCursor(cursor.resumeOptions); + + // attempt to continue in emitter mode + if (!callback) return resumeWithCursor(newCursor); + + // attempt to continue in iterator mode + newCursor.hasNext(err => { + // if there's an error immediately after resuming, close the stream + if (err) return unresumableError(err); + resumeWithCursor(newCursor); + }); + }); + return; + } + + // if initial error wasn't resumable, raise an error and close the change stream + return this._closeWithError(error, callback); + } + + /** @internal */ + private _getCursor(callback: Callback>) { + if (this[kClosed]) { + // TODO(NODE-3485): Replace with MongoChangeStreamClosedError + callback(new MongoAPIError(CHANGESTREAM_CLOSED_ERROR)); + return; + } + + // if a cursor exists and it is open, return it + if (this.cursor) { + callback(undefined, this.cursor); + return; + } + + // no cursor, queue callback until topology reconnects + this[kResumeQueue].push(callback); + } + + /** + * Drain the resume queue when a new has become available + * @internal + * + * @param error - error getting a new cursor + */ + private _processResumeQueue(error?: Error) { + while (this[kResumeQueue].length) { + const request = this[kResumeQueue].pop(); + if (!request) break; // Should never occur but TS can't use the length check in the while condition + + if (!error) { + if (this[kClosed]) { + // TODO(NODE-3485): Replace with MongoChangeStreamClosedError + request(new MongoAPIError(CHANGESTREAM_CLOSED_ERROR)); + return; + } + if (!this.cursor) { + request(new MongoChangeStreamError(NO_CURSOR_ERROR)); + return; + } + } + request(error, this.cursor ?? undefined); + } + } +} + +/** @internal */ +export interface ChangeStreamCursorOptions extends AbstractCursorOptions { + startAtOperationTime?: OperationTime; + resumeAfter?: ResumeToken; + startAfter?: ResumeToken; + maxAwaitTimeMS?: number; + collation?: CollationOptions; + fullDocument?: string; +} + +/** @internal */ +export class ChangeStreamCursor< + TSchema extends Document = Document, + TChange extends Document = ChangeStreamDocument +> extends AbstractCursor { + _resumeToken: ResumeToken; + startAtOperationTime?: OperationTime; + hasReceived?: boolean; + resumeAfter: ResumeToken; + startAfter: ResumeToken; + options: ChangeStreamCursorOptions; + + postBatchResumeToken?: ResumeToken; + pipeline: Document[]; + + constructor( + client: MongoClient, + namespace: MongoDBNamespace, + pipeline: Document[] = [], + options: ChangeStreamCursorOptions = {} + ) { + super(client, namespace, options); + + this.pipeline = pipeline; + this.options = options; + this._resumeToken = null; + this.startAtOperationTime = options.startAtOperationTime; + + if (options.startAfter) { + this.resumeToken = options.startAfter; + } else if (options.resumeAfter) { + this.resumeToken = options.resumeAfter; + } + } + + set resumeToken(token: ResumeToken) { + this._resumeToken = token; + this.emit(ChangeStream.RESUME_TOKEN_CHANGED, token); + } + + get resumeToken(): ResumeToken { + return this._resumeToken; + } + + get resumeOptions(): ChangeStreamCursorOptions { + const options: ChangeStreamCursorOptions = { + ...this.options + }; + + for (const key of ['resumeAfter', 'startAfter', 'startAtOperationTime'] as const) { + delete options[key]; + } + + if (this.resumeToken != null) { + if (this.options.startAfter && !this.hasReceived) { + options.startAfter = this.resumeToken; + } else { + options.resumeAfter = this.resumeToken; + } + } else if (this.startAtOperationTime != null && maxWireVersion(this.server) >= 7) { + options.startAtOperationTime = this.startAtOperationTime; + } + + return options; + } + + cacheResumeToken(resumeToken: ResumeToken): void { + if (this.bufferedCount() === 0 && this.postBatchResumeToken) { + this.resumeToken = this.postBatchResumeToken; + } else { + this.resumeToken = resumeToken; + } + this.hasReceived = true; + } + + _processBatch(response: ChangeStreamAggregateRawResult): void { + const cursor = response.cursor; + if (cursor.postBatchResumeToken) { + this.postBatchResumeToken = response.cursor.postBatchResumeToken; + + const batch = + 'firstBatch' in response.cursor ? response.cursor.firstBatch : response.cursor.nextBatch; + if (batch.length === 0) { + this.resumeToken = cursor.postBatchResumeToken; + } + } + } + + clone(): AbstractCursor { + return new ChangeStreamCursor(this.client, this.namespace, this.pipeline, { + ...this.cursorOptions + }); + } + + _initialize(session: ClientSession, callback: Callback): void { + const aggregateOperation = new AggregateOperation(this.namespace, this.pipeline, { + ...this.cursorOptions, + ...this.options, + session + }); + + executeOperation>( + session.client, + aggregateOperation, + (err, response) => { + if (err || response == null) { + return callback(err); + } + + const server = aggregateOperation.server; + if ( + this.startAtOperationTime == null && + this.resumeAfter == null && + this.startAfter == null && + maxWireVersion(server) >= 7 + ) { + this.startAtOperationTime = response.operationTime; + } + + this._processBatch(response); + + this.emit(ChangeStream.INIT, response); + this.emit(ChangeStream.RESPONSE); + + // TODO: NODE-2882 + callback(undefined, { server, session, response }); + } + ); + } + + override _getMore(batchSize: number, callback: Callback): void { + super._getMore(batchSize, (err, response) => { + if (err) { + return callback(err); + } + + this._processBatch(response as TODO_NODE_3286 as ChangeStreamAggregateRawResult); + + this.emit(ChangeStream.MORE, response); + this.emit(ChangeStream.RESPONSE); + callback(err, response); + }); + } +} diff --git a/node_modules/mongodb/src/cmap/auth/auth_provider.ts b/node_modules/mongodb/src/cmap/auth/auth_provider.ts new file mode 100644 index 000000000..2a38abe9b --- /dev/null +++ b/node_modules/mongodb/src/cmap/auth/auth_provider.ts @@ -0,0 +1,60 @@ +import type { Document } from '../../bson'; +import { MongoRuntimeError } from '../../error'; +import type { Callback, ClientMetadataOptions } from '../../utils'; +import type { HandshakeDocument } from '../connect'; +import type { Connection, ConnectionOptions } from '../connection'; +import type { MongoCredentials } from './mongo_credentials'; + +export type AuthContextOptions = ConnectionOptions & ClientMetadataOptions; + +/** Context used during authentication */ +export class AuthContext { + /** The connection to authenticate */ + connection: Connection; + /** The credentials to use for authentication */ + credentials?: MongoCredentials; + /** The options passed to the `connect` method */ + options: AuthContextOptions; + + /** A response from an initial auth attempt, only some mechanisms use this (e.g, SCRAM) */ + response?: Document; + /** A random nonce generated for use in an authentication conversation */ + nonce?: Buffer; + + constructor( + connection: Connection, + credentials: MongoCredentials | undefined, + options: AuthContextOptions + ) { + this.connection = connection; + this.credentials = credentials; + this.options = options; + } +} + +export class AuthProvider { + /** + * Prepare the handshake document before the initial handshake. + * + * @param handshakeDoc - The document used for the initial handshake on a connection + * @param authContext - Context for authentication flow + */ + prepare( + handshakeDoc: HandshakeDocument, + authContext: AuthContext, + callback: Callback + ): void { + callback(undefined, handshakeDoc); + } + + /** + * Authenticate + * + * @param context - A shared context for authentication flow + * @param callback - The callback to return the result from the authentication + */ + auth(context: AuthContext, callback: Callback): void { + // TODO(NODE-3483): Replace this with MongoMethodOverrideError + callback(new MongoRuntimeError('`auth` method must be overridden by subclass')); + } +} diff --git a/node_modules/mongodb/src/cmap/auth/gssapi.ts b/node_modules/mongodb/src/cmap/auth/gssapi.ts new file mode 100644 index 000000000..689d6e951 --- /dev/null +++ b/node_modules/mongodb/src/cmap/auth/gssapi.ts @@ -0,0 +1,241 @@ +import * as dns from 'dns'; + +import type { Document } from '../../bson'; +import { Kerberos, KerberosClient } from '../../deps'; +import { + MongoError, + MongoInvalidArgumentError, + MongoMissingCredentialsError, + MongoMissingDependencyError, + MongoRuntimeError +} from '../../error'; +import { Callback, ns } from '../../utils'; +import { AuthContext, AuthProvider } from './auth_provider'; + +/** @public */ +export const GSSAPICanonicalizationValue = Object.freeze({ + on: true, + off: false, + none: 'none', + forward: 'forward', + forwardAndReverse: 'forwardAndReverse' +} as const); + +/** @public */ +export type GSSAPICanonicalizationValue = + typeof GSSAPICanonicalizationValue[keyof typeof GSSAPICanonicalizationValue]; + +type MechanismProperties = { + /** @deprecated use `CANONICALIZE_HOST_NAME` instead */ + gssapiCanonicalizeHostName?: boolean; + CANONICALIZE_HOST_NAME?: GSSAPICanonicalizationValue; + SERVICE_HOST?: string; + SERVICE_NAME?: string; + SERVICE_REALM?: string; +}; + +export class GSSAPI extends AuthProvider { + override auth(authContext: AuthContext, callback: Callback): void { + const { connection, credentials } = authContext; + if (credentials == null) + return callback( + new MongoMissingCredentialsError('Credentials required for GSSAPI authentication') + ); + const { username } = credentials; + function externalCommand( + command: Document, + cb: Callback<{ payload: string; conversationId: any }> + ) { + return connection.command(ns('$external.$cmd'), command, undefined, cb); + } + makeKerberosClient(authContext, (err, client) => { + if (err) return callback(err); + if (client == null) return callback(new MongoMissingDependencyError('GSSAPI client missing')); + client.step('', (err, payload) => { + if (err) return callback(err); + + externalCommand(saslStart(payload), (err, result) => { + if (err) return callback(err); + if (result == null) return callback(); + negotiate(client, 10, result.payload, (err, payload) => { + if (err) return callback(err); + + externalCommand(saslContinue(payload, result.conversationId), (err, result) => { + if (err) return callback(err); + if (result == null) return callback(); + finalize(client, username, result.payload, (err, payload) => { + if (err) return callback(err); + + externalCommand( + { + saslContinue: 1, + conversationId: result.conversationId, + payload + }, + (err, result) => { + if (err) return callback(err); + + callback(undefined, result); + } + ); + }); + }); + }); + }); + }); + }); + } +} + +function makeKerberosClient(authContext: AuthContext, callback: Callback): void { + const { hostAddress } = authContext.options; + const { credentials } = authContext; + if (!hostAddress || typeof hostAddress.host !== 'string' || !credentials) { + return callback( + new MongoInvalidArgumentError('Connection must have host and port and credentials defined.') + ); + } + + if ('kModuleError' in Kerberos) { + return callback(Kerberos['kModuleError']); + } + const { initializeClient } = Kerberos; + + const { username, password } = credentials; + const mechanismProperties = credentials.mechanismProperties as MechanismProperties; + + const serviceName = mechanismProperties.SERVICE_NAME ?? 'mongodb'; + + performGSSAPICanonicalizeHostName( + hostAddress.host, + mechanismProperties, + (err?: Error | MongoError, host?: string) => { + if (err) return callback(err); + + const initOptions = {}; + if (password != null) { + Object.assign(initOptions, { user: username, password: password }); + } + + const spnHost = mechanismProperties.SERVICE_HOST ?? host; + let spn = `${serviceName}${process.platform === 'win32' ? '/' : '@'}${spnHost}`; + if ('SERVICE_REALM' in mechanismProperties) { + spn = `${spn}@${mechanismProperties.SERVICE_REALM}`; + } + + initializeClient(spn, initOptions, (err: string, client: KerberosClient): void => { + // TODO(NODE-3483) + if (err) return callback(new MongoRuntimeError(err)); + callback(undefined, client); + }); + } + ); +} + +function saslStart(payload?: string): Document { + return { + saslStart: 1, + mechanism: 'GSSAPI', + payload, + autoAuthorize: 1 + }; +} + +function saslContinue(payload?: string, conversationId?: number): Document { + return { + saslContinue: 1, + conversationId, + payload + }; +} + +function negotiate( + client: KerberosClient, + retries: number, + payload: string, + callback: Callback +): void { + client.step(payload, (err, response) => { + // Retries exhausted, raise error + if (err && retries === 0) return callback(err); + + // Adjust number of retries and call step again + if (err) return negotiate(client, retries - 1, payload, callback); + + // Return the payload + callback(undefined, response || ''); + }); +} + +function finalize( + client: KerberosClient, + user: string, + payload: string, + callback: Callback +): void { + // GSS Client Unwrap + client.unwrap(payload, (err, response) => { + if (err) return callback(err); + + // Wrap the response + client.wrap(response || '', { user }, (err, wrapped) => { + if (err) return callback(err); + + // Return the payload + callback(undefined, wrapped); + }); + }); +} + +export function performGSSAPICanonicalizeHostName( + host: string, + mechanismProperties: MechanismProperties, + callback: Callback +): void { + const mode = mechanismProperties.CANONICALIZE_HOST_NAME; + if (!mode || mode === GSSAPICanonicalizationValue.none) { + return callback(undefined, host); + } + + // If forward and reverse or true + if ( + mode === GSSAPICanonicalizationValue.on || + mode === GSSAPICanonicalizationValue.forwardAndReverse + ) { + // Perform the lookup of the ip address. + dns.lookup(host, (error, address) => { + // No ip found, return the error. + if (error) return callback(error); + + // Perform a reverse ptr lookup on the ip address. + dns.resolvePtr(address, (err, results) => { + // This can error as ptr records may not exist for all ips. In this case + // fallback to a cname lookup as dns.lookup() does not return the + // cname. + if (err) { + return resolveCname(host, callback); + } + // If the ptr did not error but had no results, return the host. + callback(undefined, results.length > 0 ? results[0] : host); + }); + }); + } else { + // The case for forward is just to resolve the cname as dns.lookup() + // will not return it. + resolveCname(host, callback); + } +} + +export function resolveCname(host: string, callback: Callback): void { + // Attempt to resolve the host name + dns.resolveCname(host, (err, r) => { + if (err) return callback(undefined, host); + + // Get the first resolve host id + if (r.length > 0) { + return callback(undefined, r[0]); + } + + callback(undefined, host); + }); +} diff --git a/node_modules/mongodb/src/cmap/auth/mongo_credentials.ts b/node_modules/mongodb/src/cmap/auth/mongo_credentials.ts new file mode 100644 index 000000000..2c964c311 --- /dev/null +++ b/node_modules/mongodb/src/cmap/auth/mongo_credentials.ts @@ -0,0 +1,190 @@ +// Resolves the default auth mechanism according to +import type { Document } from '../../bson'; +import { MongoAPIError, MongoMissingCredentialsError } from '../../error'; +import { emitWarningOnce } from '../../utils'; +import { GSSAPICanonicalizationValue } from './gssapi'; +import { AUTH_MECHS_AUTH_SRC_EXTERNAL, AuthMechanism } from './providers'; + +// https://github.com/mongodb/specifications/blob/master/source/auth/auth.rst +function getDefaultAuthMechanism(hello?: Document): AuthMechanism { + if (hello) { + // If hello contains saslSupportedMechs, use scram-sha-256 + // if it is available, else scram-sha-1 + if (Array.isArray(hello.saslSupportedMechs)) { + return hello.saslSupportedMechs.includes(AuthMechanism.MONGODB_SCRAM_SHA256) + ? AuthMechanism.MONGODB_SCRAM_SHA256 + : AuthMechanism.MONGODB_SCRAM_SHA1; + } + + // Fallback to legacy selection method. If wire version >= 3, use scram-sha-1 + if (hello.maxWireVersion >= 3) { + return AuthMechanism.MONGODB_SCRAM_SHA1; + } + } + + // Default for wireprotocol < 3 + return AuthMechanism.MONGODB_CR; +} + +/** @public */ +export interface AuthMechanismProperties extends Document { + SERVICE_HOST?: string; + SERVICE_NAME?: string; + SERVICE_REALM?: string; + CANONICALIZE_HOST_NAME?: GSSAPICanonicalizationValue; + AWS_SESSION_TOKEN?: string; +} + +/** @public */ +export interface MongoCredentialsOptions { + username: string; + password: string; + source: string; + db?: string; + mechanism?: AuthMechanism; + mechanismProperties: AuthMechanismProperties; +} + +/** + * A representation of the credentials used by MongoDB + * @public + */ +export class MongoCredentials { + /** The username used for authentication */ + readonly username: string; + /** The password used for authentication */ + readonly password: string; + /** The database that the user should authenticate against */ + readonly source: string; + /** The method used to authenticate */ + readonly mechanism: AuthMechanism; + /** Special properties used by some types of auth mechanisms */ + readonly mechanismProperties: AuthMechanismProperties; + + constructor(options: MongoCredentialsOptions) { + this.username = options.username; + this.password = options.password; + this.source = options.source; + if (!this.source && options.db) { + this.source = options.db; + } + this.mechanism = options.mechanism || AuthMechanism.MONGODB_DEFAULT; + this.mechanismProperties = options.mechanismProperties || {}; + + if (this.mechanism.match(/MONGODB-AWS/i)) { + if (!this.username && process.env.AWS_ACCESS_KEY_ID) { + this.username = process.env.AWS_ACCESS_KEY_ID; + } + + if (!this.password && process.env.AWS_SECRET_ACCESS_KEY) { + this.password = process.env.AWS_SECRET_ACCESS_KEY; + } + + if ( + this.mechanismProperties.AWS_SESSION_TOKEN == null && + process.env.AWS_SESSION_TOKEN != null + ) { + this.mechanismProperties = { + ...this.mechanismProperties, + AWS_SESSION_TOKEN: process.env.AWS_SESSION_TOKEN + }; + } + } + + if ('gssapiCanonicalizeHostName' in this.mechanismProperties) { + emitWarningOnce( + 'gssapiCanonicalizeHostName is deprecated. Please use CANONICALIZE_HOST_NAME instead.' + ); + this.mechanismProperties.CANONICALIZE_HOST_NAME = + this.mechanismProperties.gssapiCanonicalizeHostName; + } + + Object.freeze(this.mechanismProperties); + Object.freeze(this); + } + + /** Determines if two MongoCredentials objects are equivalent */ + equals(other: MongoCredentials): boolean { + return ( + this.mechanism === other.mechanism && + this.username === other.username && + this.password === other.password && + this.source === other.source + ); + } + + /** + * If the authentication mechanism is set to "default", resolves the authMechanism + * based on the server version and server supported sasl mechanisms. + * + * @param hello - A hello response from the server + */ + resolveAuthMechanism(hello?: Document): MongoCredentials { + // If the mechanism is not "default", then it does not need to be resolved + if (this.mechanism.match(/DEFAULT/i)) { + return new MongoCredentials({ + username: this.username, + password: this.password, + source: this.source, + mechanism: getDefaultAuthMechanism(hello), + mechanismProperties: this.mechanismProperties + }); + } + + return this; + } + + validate(): void { + if ( + (this.mechanism === AuthMechanism.MONGODB_GSSAPI || + this.mechanism === AuthMechanism.MONGODB_CR || + this.mechanism === AuthMechanism.MONGODB_PLAIN || + this.mechanism === AuthMechanism.MONGODB_SCRAM_SHA1 || + this.mechanism === AuthMechanism.MONGODB_SCRAM_SHA256) && + !this.username + ) { + throw new MongoMissingCredentialsError(`Username required for mechanism '${this.mechanism}'`); + } + + if (AUTH_MECHS_AUTH_SRC_EXTERNAL.has(this.mechanism)) { + if (this.source != null && this.source !== '$external') { + // TODO(NODE-3485): Replace this with a MongoAuthValidationError + throw new MongoAPIError( + `Invalid source '${this.source}' for mechanism '${this.mechanism}' specified.` + ); + } + } + + if (this.mechanism === AuthMechanism.MONGODB_PLAIN && this.source == null) { + // TODO(NODE-3485): Replace this with a MongoAuthValidationError + throw new MongoAPIError('PLAIN Authentication Mechanism needs an auth source'); + } + + if (this.mechanism === AuthMechanism.MONGODB_X509 && this.password != null) { + if (this.password === '') { + Reflect.set(this, 'password', undefined); + return; + } + // TODO(NODE-3485): Replace this with a MongoAuthValidationError + throw new MongoAPIError(`Password not allowed for mechanism MONGODB-X509`); + } + + const canonicalization = this.mechanismProperties.CANONICALIZE_HOST_NAME ?? false; + if (!Object.values(GSSAPICanonicalizationValue).includes(canonicalization)) { + throw new MongoAPIError(`Invalid CANONICALIZE_HOST_NAME value: ${canonicalization}`); + } + } + + static merge( + creds: MongoCredentials | undefined, + options: Partial + ): MongoCredentials { + return new MongoCredentials({ + username: options.username ?? creds?.username ?? '', + password: options.password ?? creds?.password ?? '', + mechanism: options.mechanism ?? creds?.mechanism ?? AuthMechanism.MONGODB_DEFAULT, + mechanismProperties: options.mechanismProperties ?? creds?.mechanismProperties ?? {}, + source: options.source ?? options.db ?? creds?.source ?? 'admin' + }); + } +} diff --git a/node_modules/mongodb/src/cmap/auth/mongocr.ts b/node_modules/mongodb/src/cmap/auth/mongocr.ts new file mode 100644 index 000000000..232378f0d --- /dev/null +++ b/node_modules/mongodb/src/cmap/auth/mongocr.ts @@ -0,0 +1,47 @@ +import * as crypto from 'crypto'; + +import { MongoMissingCredentialsError } from '../../error'; +import { Callback, ns } from '../../utils'; +import { AuthContext, AuthProvider } from './auth_provider'; + +export class MongoCR extends AuthProvider { + override auth(authContext: AuthContext, callback: Callback): void { + const { connection, credentials } = authContext; + if (!credentials) { + return callback(new MongoMissingCredentialsError('AuthContext must provide credentials.')); + } + const username = credentials.username; + const password = credentials.password; + const source = credentials.source; + connection.command(ns(`${source}.$cmd`), { getnonce: 1 }, undefined, (err, r) => { + let nonce = null; + let key = null; + + // Get nonce + if (err == null) { + nonce = r.nonce; + + // Use node md5 generator + let md5 = crypto.createHash('md5'); + + // Generate keys used for authentication + md5.update(`${username}:mongo:${password}`, 'utf8'); + const hash_password = md5.digest('hex'); + + // Final key + md5 = crypto.createHash('md5'); + md5.update(nonce + username + hash_password, 'utf8'); + key = md5.digest('hex'); + } + + const authenticateCommand = { + authenticate: 1, + user: username, + nonce, + key + }; + + connection.command(ns(`${source}.$cmd`), authenticateCommand, undefined, callback); + }); + } +} diff --git a/node_modules/mongodb/src/cmap/auth/mongodb_aws.ts b/node_modules/mongodb/src/cmap/auth/mongodb_aws.ts new file mode 100644 index 000000000..3136dc879 --- /dev/null +++ b/node_modules/mongodb/src/cmap/auth/mongodb_aws.ts @@ -0,0 +1,293 @@ +import * as crypto from 'crypto'; +import * as http from 'http'; +import * as url from 'url'; + +import type { Binary, BSONSerializeOptions } from '../../bson'; +import * as BSON from '../../bson'; +import { aws4 } from '../../deps'; +import { + MongoAWSError, + MongoCompatibilityError, + MongoMissingCredentialsError, + MongoRuntimeError +} from '../../error'; +import { Callback, maxWireVersion, ns } from '../../utils'; +import { AuthContext, AuthProvider } from './auth_provider'; +import { MongoCredentials } from './mongo_credentials'; +import { AuthMechanism } from './providers'; + +const ASCII_N = 110; +const AWS_RELATIVE_URI = 'http://169.254.170.2'; +const AWS_EC2_URI = 'http://169.254.169.254'; +const AWS_EC2_PATH = '/latest/meta-data/iam/security-credentials'; +const bsonOptions: BSONSerializeOptions = { + promoteLongs: true, + promoteValues: true, + promoteBuffers: false, + bsonRegExp: false +}; + +interface AWSSaslContinuePayload { + a: string; + d: string; + t?: string; +} + +export class MongoDBAWS extends AuthProvider { + override auth(authContext: AuthContext, callback: Callback): void { + const { connection, credentials } = authContext; + if (!credentials) { + return callback(new MongoMissingCredentialsError('AuthContext must provide credentials.')); + } + + if ('kModuleError' in aws4) { + return callback(aws4['kModuleError']); + } + const { sign } = aws4; + + if (maxWireVersion(connection) < 9) { + callback( + new MongoCompatibilityError( + 'MONGODB-AWS authentication requires MongoDB version 4.4 or later' + ) + ); + return; + } + + if (!credentials.username) { + makeTempCredentials(credentials, (err, tempCredentials) => { + if (err || !tempCredentials) return callback(err); + + authContext.credentials = tempCredentials; + this.auth(authContext, callback); + }); + + return; + } + + const accessKeyId = credentials.username; + const secretAccessKey = credentials.password; + const sessionToken = credentials.mechanismProperties.AWS_SESSION_TOKEN; + + // If all three defined, include sessionToken, else include username and pass, else no credentials + const awsCredentials = + accessKeyId && secretAccessKey && sessionToken + ? { accessKeyId, secretAccessKey, sessionToken } + : accessKeyId && secretAccessKey + ? { accessKeyId, secretAccessKey } + : undefined; + + const db = credentials.source; + crypto.randomBytes(32, (err, nonce) => { + if (err) { + callback(err); + return; + } + + const saslStart = { + saslStart: 1, + mechanism: 'MONGODB-AWS', + payload: BSON.serialize({ r: nonce, p: ASCII_N }, bsonOptions) + }; + + connection.command(ns(`${db}.$cmd`), saslStart, undefined, (err, res) => { + if (err) return callback(err); + + const serverResponse = BSON.deserialize(res.payload.buffer, bsonOptions) as { + s: Binary; + h: string; + }; + const host = serverResponse.h; + const serverNonce = serverResponse.s.buffer; + if (serverNonce.length !== 64) { + callback( + // TODO(NODE-3483) + new MongoRuntimeError(`Invalid server nonce length ${serverNonce.length}, expected 64`) + ); + + return; + } + + if (serverNonce.compare(nonce, 0, nonce.length, 0, nonce.length) !== 0) { + // TODO(NODE-3483) + callback(new MongoRuntimeError('Server nonce does not begin with client nonce')); + return; + } + + if (host.length < 1 || host.length > 255 || host.indexOf('..') !== -1) { + // TODO(NODE-3483) + callback(new MongoRuntimeError(`Server returned an invalid host: "${host}"`)); + return; + } + + const body = 'Action=GetCallerIdentity&Version=2011-06-15'; + const options = sign( + { + method: 'POST', + host, + region: deriveRegion(serverResponse.h), + service: 'sts', + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + 'Content-Length': body.length, + 'X-MongoDB-Server-Nonce': serverNonce.toString('base64'), + 'X-MongoDB-GS2-CB-Flag': 'n' + }, + path: '/', + body + }, + awsCredentials + ); + + const payload: AWSSaslContinuePayload = { + a: options.headers.Authorization, + d: options.headers['X-Amz-Date'] + }; + if (sessionToken) { + payload.t = sessionToken; + } + + const saslContinue = { + saslContinue: 1, + conversationId: 1, + payload: BSON.serialize(payload, bsonOptions) + }; + + connection.command(ns(`${db}.$cmd`), saslContinue, undefined, callback); + }); + }); + } +} + +interface AWSTempCredentials { + AccessKeyId?: string; + SecretAccessKey?: string; + Token?: string; + RoleArn?: string; + Expiration?: Date; +} + +function makeTempCredentials(credentials: MongoCredentials, callback: Callback) { + function done(creds: AWSTempCredentials) { + if (!creds.AccessKeyId || !creds.SecretAccessKey || !creds.Token) { + callback( + new MongoMissingCredentialsError('Could not obtain temporary MONGODB-AWS credentials') + ); + return; + } + + callback( + undefined, + new MongoCredentials({ + username: creds.AccessKeyId, + password: creds.SecretAccessKey, + source: credentials.source, + mechanism: AuthMechanism.MONGODB_AWS, + mechanismProperties: { + AWS_SESSION_TOKEN: creds.Token + } + }) + ); + } + + // If the environment variable AWS_CONTAINER_CREDENTIALS_RELATIVE_URI + // is set then drivers MUST assume that it was set by an AWS ECS agent + if (process.env.AWS_CONTAINER_CREDENTIALS_RELATIVE_URI) { + request( + `${AWS_RELATIVE_URI}${process.env.AWS_CONTAINER_CREDENTIALS_RELATIVE_URI}`, + undefined, + (err, res) => { + if (err) return callback(err); + done(res); + } + ); + + return; + } + + // Otherwise assume we are on an EC2 instance + + // get a token + request( + `${AWS_EC2_URI}/latest/api/token`, + { method: 'PUT', json: false, headers: { 'X-aws-ec2-metadata-token-ttl-seconds': 30 } }, + (err, token) => { + if (err) return callback(err); + + // get role name + request( + `${AWS_EC2_URI}/${AWS_EC2_PATH}`, + { json: false, headers: { 'X-aws-ec2-metadata-token': token } }, + (err, roleName) => { + if (err) return callback(err); + + // get temp credentials + request( + `${AWS_EC2_URI}/${AWS_EC2_PATH}/${roleName}`, + { headers: { 'X-aws-ec2-metadata-token': token } }, + (err, creds) => { + if (err) return callback(err); + done(creds); + } + ); + } + ); + } + ); +} + +function deriveRegion(host: string) { + const parts = host.split('.'); + if (parts.length === 1 || parts[1] === 'amazonaws') { + return 'us-east-1'; + } + + return parts[1]; +} + +interface RequestOptions { + json?: boolean; + method?: string; + timeout?: number; + headers?: http.OutgoingHttpHeaders; +} + +function request(uri: string, _options: RequestOptions | undefined, callback: Callback) { + const options = Object.assign( + { + method: 'GET', + timeout: 10000, + json: true + }, + url.parse(uri), + _options + ); + + const req = http.request(options, res => { + res.setEncoding('utf8'); + + let data = ''; + res.on('data', d => (data += d)); + res.on('end', () => { + if (options.json === false) { + callback(undefined, data); + return; + } + + try { + const parsed = JSON.parse(data); + callback(undefined, parsed); + } catch (err) { + // TODO(NODE-3483) + callback(new MongoRuntimeError(`Invalid JSON response: "${data}"`)); + } + }); + }); + + req.on('timeout', () => { + req.destroy(new MongoAWSError(`AWS request to ${uri} timed out after ${options.timeout} ms`)); + }); + + req.on('error', err => callback(err)); + req.end(); +} diff --git a/node_modules/mongodb/src/cmap/auth/plain.ts b/node_modules/mongodb/src/cmap/auth/plain.ts new file mode 100644 index 000000000..94b19a52b --- /dev/null +++ b/node_modules/mongodb/src/cmap/auth/plain.ts @@ -0,0 +1,25 @@ +import { Binary } from '../../bson'; +import { MongoMissingCredentialsError } from '../../error'; +import { Callback, ns } from '../../utils'; +import { AuthContext, AuthProvider } from './auth_provider'; + +export class Plain extends AuthProvider { + override auth(authContext: AuthContext, callback: Callback): void { + const { connection, credentials } = authContext; + if (!credentials) { + return callback(new MongoMissingCredentialsError('AuthContext must provide credentials.')); + } + const username = credentials.username; + const password = credentials.password; + + const payload = new Binary(Buffer.from(`\x00${username}\x00${password}`)); + const command = { + saslStart: 1, + mechanism: 'PLAIN', + payload: payload, + autoAuthorize: 1 + }; + + connection.command(ns('$external.$cmd'), command, undefined, callback); + } +} diff --git a/node_modules/mongodb/src/cmap/auth/providers.ts b/node_modules/mongodb/src/cmap/auth/providers.ts new file mode 100644 index 000000000..9c7b1f4b8 --- /dev/null +++ b/node_modules/mongodb/src/cmap/auth/providers.ts @@ -0,0 +1,21 @@ +/** @public */ +export const AuthMechanism = Object.freeze({ + MONGODB_AWS: 'MONGODB-AWS', + MONGODB_CR: 'MONGODB-CR', + MONGODB_DEFAULT: 'DEFAULT', + MONGODB_GSSAPI: 'GSSAPI', + MONGODB_PLAIN: 'PLAIN', + MONGODB_SCRAM_SHA1: 'SCRAM-SHA-1', + MONGODB_SCRAM_SHA256: 'SCRAM-SHA-256', + MONGODB_X509: 'MONGODB-X509' +} as const); + +/** @public */ +export type AuthMechanism = typeof AuthMechanism[keyof typeof AuthMechanism]; + +/** @internal */ +export const AUTH_MECHS_AUTH_SRC_EXTERNAL = new Set([ + AuthMechanism.MONGODB_GSSAPI, + AuthMechanism.MONGODB_AWS, + AuthMechanism.MONGODB_X509 +]); diff --git a/node_modules/mongodb/src/cmap/auth/scram.ts b/node_modules/mongodb/src/cmap/auth/scram.ts new file mode 100644 index 000000000..7a339151f --- /dev/null +++ b/node_modules/mongodb/src/cmap/auth/scram.ts @@ -0,0 +1,384 @@ +import * as crypto from 'crypto'; + +import { Binary, Document } from '../../bson'; +import { saslprep } from '../../deps'; +import { + AnyError, + MongoInvalidArgumentError, + MongoMissingCredentialsError, + MongoRuntimeError, + MongoServerError +} from '../../error'; +import { Callback, emitWarning, ns } from '../../utils'; +import type { HandshakeDocument } from '../connect'; +import { AuthContext, AuthProvider } from './auth_provider'; +import type { MongoCredentials } from './mongo_credentials'; +import { AuthMechanism } from './providers'; + +type CryptoMethod = 'sha1' | 'sha256'; + +class ScramSHA extends AuthProvider { + cryptoMethod: CryptoMethod; + constructor(cryptoMethod: CryptoMethod) { + super(); + this.cryptoMethod = cryptoMethod || 'sha1'; + } + + override prepare(handshakeDoc: HandshakeDocument, authContext: AuthContext, callback: Callback) { + const cryptoMethod = this.cryptoMethod; + const credentials = authContext.credentials; + if (!credentials) { + return callback(new MongoMissingCredentialsError('AuthContext must provide credentials.')); + } + if (cryptoMethod === 'sha256' && saslprep == null) { + emitWarning('Warning: no saslprep library specified. Passwords will not be sanitized'); + } + + crypto.randomBytes(24, (err, nonce) => { + if (err) { + return callback(err); + } + + // store the nonce for later use + Object.assign(authContext, { nonce }); + + const request = Object.assign({}, handshakeDoc, { + speculativeAuthenticate: Object.assign(makeFirstMessage(cryptoMethod, credentials, nonce), { + db: credentials.source + }) + }); + + callback(undefined, request); + }); + } + + override auth(authContext: AuthContext, callback: Callback) { + const response = authContext.response; + if (response && response.speculativeAuthenticate) { + continueScramConversation( + this.cryptoMethod, + response.speculativeAuthenticate, + authContext, + callback + ); + + return; + } + + executeScram(this.cryptoMethod, authContext, callback); + } +} + +function cleanUsername(username: string) { + return username.replace('=', '=3D').replace(',', '=2C'); +} + +function clientFirstMessageBare(username: string, nonce: Buffer) { + // NOTE: This is done b/c Javascript uses UTF-16, but the server is hashing in UTF-8. + // Since the username is not sasl-prep-d, we need to do this here. + return Buffer.concat([ + Buffer.from('n=', 'utf8'), + Buffer.from(username, 'utf8'), + Buffer.from(',r=', 'utf8'), + Buffer.from(nonce.toString('base64'), 'utf8') + ]); +} + +function makeFirstMessage( + cryptoMethod: CryptoMethod, + credentials: MongoCredentials, + nonce: Buffer +) { + const username = cleanUsername(credentials.username); + const mechanism = + cryptoMethod === 'sha1' ? AuthMechanism.MONGODB_SCRAM_SHA1 : AuthMechanism.MONGODB_SCRAM_SHA256; + + // NOTE: This is done b/c Javascript uses UTF-16, but the server is hashing in UTF-8. + // Since the username is not sasl-prep-d, we need to do this here. + return { + saslStart: 1, + mechanism, + payload: new Binary( + Buffer.concat([Buffer.from('n,,', 'utf8'), clientFirstMessageBare(username, nonce)]) + ), + autoAuthorize: 1, + options: { skipEmptyExchange: true } + }; +} + +function executeScram(cryptoMethod: CryptoMethod, authContext: AuthContext, callback: Callback) { + const { connection, credentials } = authContext; + if (!credentials) { + return callback(new MongoMissingCredentialsError('AuthContext must provide credentials.')); + } + if (!authContext.nonce) { + return callback( + new MongoInvalidArgumentError('AuthContext must contain a valid nonce property') + ); + } + const nonce = authContext.nonce; + const db = credentials.source; + + const saslStartCmd = makeFirstMessage(cryptoMethod, credentials, nonce); + connection.command(ns(`${db}.$cmd`), saslStartCmd, undefined, (_err, result) => { + const err = resolveError(_err, result); + if (err) { + return callback(err); + } + + continueScramConversation(cryptoMethod, result, authContext, callback); + }); +} + +function continueScramConversation( + cryptoMethod: CryptoMethod, + response: Document, + authContext: AuthContext, + callback: Callback +) { + const connection = authContext.connection; + const credentials = authContext.credentials; + if (!credentials) { + return callback(new MongoMissingCredentialsError('AuthContext must provide credentials.')); + } + if (!authContext.nonce) { + return callback(new MongoInvalidArgumentError('Unable to continue SCRAM without valid nonce')); + } + const nonce = authContext.nonce; + + const db = credentials.source; + const username = cleanUsername(credentials.username); + const password = credentials.password; + + let processedPassword; + if (cryptoMethod === 'sha256') { + processedPassword = 'kModuleError' in saslprep ? password : saslprep(password); + } else { + try { + processedPassword = passwordDigest(username, password); + } catch (e) { + return callback(e); + } + } + + const payload = Buffer.isBuffer(response.payload) + ? new Binary(response.payload) + : response.payload; + const dict = parsePayload(payload.value()); + + const iterations = parseInt(dict.i, 10); + if (iterations && iterations < 4096) { + callback( + // TODO(NODE-3483) + new MongoRuntimeError(`Server returned an invalid iteration count ${iterations}`), + false + ); + return; + } + + const salt = dict.s; + const rnonce = dict.r; + if (rnonce.startsWith('nonce')) { + // TODO(NODE-3483) + callback(new MongoRuntimeError(`Server returned an invalid nonce: ${rnonce}`), false); + return; + } + + // Set up start of proof + const withoutProof = `c=biws,r=${rnonce}`; + const saltedPassword = HI( + processedPassword, + Buffer.from(salt, 'base64'), + iterations, + cryptoMethod + ); + + const clientKey = HMAC(cryptoMethod, saltedPassword, 'Client Key'); + const serverKey = HMAC(cryptoMethod, saltedPassword, 'Server Key'); + const storedKey = H(cryptoMethod, clientKey); + const authMessage = [clientFirstMessageBare(username, nonce), payload.value(), withoutProof].join( + ',' + ); + + const clientSignature = HMAC(cryptoMethod, storedKey, authMessage); + const clientProof = `p=${xor(clientKey, clientSignature)}`; + const clientFinal = [withoutProof, clientProof].join(','); + + const serverSignature = HMAC(cryptoMethod, serverKey, authMessage); + const saslContinueCmd = { + saslContinue: 1, + conversationId: response.conversationId, + payload: new Binary(Buffer.from(clientFinal)) + }; + + connection.command(ns(`${db}.$cmd`), saslContinueCmd, undefined, (_err, r) => { + const err = resolveError(_err, r); + if (err) { + return callback(err); + } + + const parsedResponse = parsePayload(r.payload.value()); + if (!compareDigest(Buffer.from(parsedResponse.v, 'base64'), serverSignature)) { + callback(new MongoRuntimeError('Server returned an invalid signature')); + return; + } + + if (!r || r.done !== false) { + return callback(err, r); + } + + const retrySaslContinueCmd = { + saslContinue: 1, + conversationId: r.conversationId, + payload: Buffer.alloc(0) + }; + + connection.command(ns(`${db}.$cmd`), retrySaslContinueCmd, undefined, callback); + }); +} + +function parsePayload(payload: string) { + const dict: Document = {}; + const parts = payload.split(','); + for (let i = 0; i < parts.length; i++) { + const valueParts = parts[i].split('='); + dict[valueParts[0]] = valueParts[1]; + } + + return dict; +} + +function passwordDigest(username: string, password: string) { + if (typeof username !== 'string') { + throw new MongoInvalidArgumentError('Username must be a string'); + } + + if (typeof password !== 'string') { + throw new MongoInvalidArgumentError('Password must be a string'); + } + + if (password.length === 0) { + throw new MongoInvalidArgumentError('Password cannot be empty'); + } + + let md5: crypto.Hash; + try { + md5 = crypto.createHash('md5'); + } catch (err) { + if (crypto.getFips()) { + // This error is (slightly) more helpful than what comes from OpenSSL directly, e.g. + // 'Error: error:060800C8:digital envelope routines:EVP_DigestInit_ex:disabled for FIPS' + throw new Error('Auth mechanism SCRAM-SHA-1 is not supported in FIPS mode'); + } + throw err; + } + md5.update(`${username}:mongo:${password}`, 'utf8'); + return md5.digest('hex'); +} + +// XOR two buffers +function xor(a: Buffer, b: Buffer) { + if (!Buffer.isBuffer(a)) { + a = Buffer.from(a); + } + + if (!Buffer.isBuffer(b)) { + b = Buffer.from(b); + } + + const length = Math.max(a.length, b.length); + const res = []; + + for (let i = 0; i < length; i += 1) { + res.push(a[i] ^ b[i]); + } + + return Buffer.from(res).toString('base64'); +} + +function H(method: CryptoMethod, text: Buffer) { + return crypto.createHash(method).update(text).digest(); +} + +function HMAC(method: CryptoMethod, key: Buffer, text: Buffer | string) { + return crypto.createHmac(method, key).update(text).digest(); +} + +interface HICache { + [key: string]: Buffer; +} + +let _hiCache: HICache = {}; +let _hiCacheCount = 0; +function _hiCachePurge() { + _hiCache = {}; + _hiCacheCount = 0; +} + +const hiLengthMap = { + sha256: 32, + sha1: 20 +}; + +function HI(data: string, salt: Buffer, iterations: number, cryptoMethod: CryptoMethod) { + // omit the work if already generated + const key = [data, salt.toString('base64'), iterations].join('_'); + if (_hiCache[key] != null) { + return _hiCache[key]; + } + + // generate the salt + const saltedData = crypto.pbkdf2Sync( + data, + salt, + iterations, + hiLengthMap[cryptoMethod], + cryptoMethod + ); + + // cache a copy to speed up the next lookup, but prevent unbounded cache growth + if (_hiCacheCount >= 200) { + _hiCachePurge(); + } + + _hiCache[key] = saltedData; + _hiCacheCount += 1; + return saltedData; +} + +function compareDigest(lhs: Buffer, rhs: Uint8Array) { + if (lhs.length !== rhs.length) { + return false; + } + + if (typeof crypto.timingSafeEqual === 'function') { + return crypto.timingSafeEqual(lhs, rhs); + } + + let result = 0; + for (let i = 0; i < lhs.length; i++) { + result |= lhs[i] ^ rhs[i]; + } + + return result === 0; +} + +function resolveError(err?: AnyError, result?: Document) { + if (err) return err; + if (result) { + if (result.$err || result.errmsg) return new MongoServerError(result); + } + return; +} + +export class ScramSHA1 extends ScramSHA { + constructor() { + super('sha1'); + } +} + +export class ScramSHA256 extends ScramSHA { + constructor() { + super('sha256'); + } +} diff --git a/node_modules/mongodb/src/cmap/auth/x509.ts b/node_modules/mongodb/src/cmap/auth/x509.ts new file mode 100644 index 000000000..a12e6f9d8 --- /dev/null +++ b/node_modules/mongodb/src/cmap/auth/x509.ts @@ -0,0 +1,53 @@ +import type { Document } from '../../bson'; +import { MongoMissingCredentialsError } from '../../error'; +import { Callback, ns } from '../../utils'; +import type { HandshakeDocument } from '../connect'; +import { AuthContext, AuthProvider } from './auth_provider'; +import type { MongoCredentials } from './mongo_credentials'; + +export class X509 extends AuthProvider { + override prepare( + handshakeDoc: HandshakeDocument, + authContext: AuthContext, + callback: Callback + ): void { + const { credentials } = authContext; + if (!credentials) { + return callback(new MongoMissingCredentialsError('AuthContext must provide credentials.')); + } + Object.assign(handshakeDoc, { + speculativeAuthenticate: x509AuthenticateCommand(credentials) + }); + + callback(undefined, handshakeDoc); + } + + override auth(authContext: AuthContext, callback: Callback): void { + const connection = authContext.connection; + const credentials = authContext.credentials; + if (!credentials) { + return callback(new MongoMissingCredentialsError('AuthContext must provide credentials.')); + } + const response = authContext.response; + + if (response && response.speculativeAuthenticate) { + return callback(); + } + + connection.command( + ns('$external.$cmd'), + x509AuthenticateCommand(credentials), + undefined, + callback + ); + } +} + +function x509AuthenticateCommand(credentials: MongoCredentials) { + const command: Document = { authenticate: 1, mechanism: 'MONGODB-X509' }; + if (credentials.username) { + command.user = credentials.username; + } + + return command; +} diff --git a/node_modules/mongodb/src/cmap/command_monitoring_events.ts b/node_modules/mongodb/src/cmap/command_monitoring_events.ts new file mode 100644 index 000000000..dcf05632e --- /dev/null +++ b/node_modules/mongodb/src/cmap/command_monitoring_events.ts @@ -0,0 +1,335 @@ +import type { Document, ObjectId } from '../bson'; +import { LEGACY_HELLO_COMMAND, LEGACY_HELLO_COMMAND_CAMEL_CASE } from '../constants'; +import { calculateDurationInMs, deepCopy } from '../utils'; +import { GetMore, KillCursor, Msg, WriteProtocolMessageType } from './commands'; +import type { Connection } from './connection'; + +/** + * An event indicating the start of a given + * @public + * @category Event + */ +export class CommandStartedEvent { + commandObj?: Document; + requestId: number; + databaseName: string; + commandName: string; + command: Document; + address: string; + connectionId?: string | number; + serviceId?: ObjectId; + + /** + * Create a started event + * + * @internal + * @param pool - the pool that originated the command + * @param command - the command + */ + constructor(connection: Connection, command: WriteProtocolMessageType) { + const cmd = extractCommand(command); + const commandName = extractCommandName(cmd); + const { address, connectionId, serviceId } = extractConnectionDetails(connection); + + // TODO: remove in major revision, this is not spec behavior + if (SENSITIVE_COMMANDS.has(commandName)) { + this.commandObj = {}; + this.commandObj[commandName] = true; + } + + this.address = address; + this.connectionId = connectionId; + this.serviceId = serviceId; + this.requestId = command.requestId; + this.databaseName = databaseName(command); + this.commandName = commandName; + this.command = maybeRedact(commandName, cmd, cmd); + } + + /* @internal */ + get hasServiceId(): boolean { + return !!this.serviceId; + } +} + +/** + * An event indicating the success of a given command + * @public + * @category Event + */ +export class CommandSucceededEvent { + address: string; + connectionId?: string | number; + requestId: number; + duration: number; + commandName: string; + reply: unknown; + serviceId?: ObjectId; + + /** + * Create a succeeded event + * + * @internal + * @param pool - the pool that originated the command + * @param command - the command + * @param reply - the reply for this command from the server + * @param started - a high resolution tuple timestamp of when the command was first sent, to calculate duration + */ + constructor( + connection: Connection, + command: WriteProtocolMessageType, + reply: Document | undefined, + started: number + ) { + const cmd = extractCommand(command); + const commandName = extractCommandName(cmd); + const { address, connectionId, serviceId } = extractConnectionDetails(connection); + + this.address = address; + this.connectionId = connectionId; + this.serviceId = serviceId; + this.requestId = command.requestId; + this.commandName = commandName; + this.duration = calculateDurationInMs(started); + this.reply = maybeRedact(commandName, cmd, extractReply(command, reply)); + } + + /* @internal */ + get hasServiceId(): boolean { + return !!this.serviceId; + } +} + +/** + * An event indicating the failure of a given command + * @public + * @category Event + */ +export class CommandFailedEvent { + address: string; + connectionId?: string | number; + requestId: number; + duration: number; + commandName: string; + failure: Error; + serviceId?: ObjectId; + + /** + * Create a failure event + * + * @internal + * @param pool - the pool that originated the command + * @param command - the command + * @param error - the generated error or a server error response + * @param started - a high resolution tuple timestamp of when the command was first sent, to calculate duration + */ + constructor( + connection: Connection, + command: WriteProtocolMessageType, + error: Error | Document, + started: number + ) { + const cmd = extractCommand(command); + const commandName = extractCommandName(cmd); + const { address, connectionId, serviceId } = extractConnectionDetails(connection); + + this.address = address; + this.connectionId = connectionId; + this.serviceId = serviceId; + + this.requestId = command.requestId; + this.commandName = commandName; + this.duration = calculateDurationInMs(started); + this.failure = maybeRedact(commandName, cmd, error) as Error; + } + + /* @internal */ + get hasServiceId(): boolean { + return !!this.serviceId; + } +} + +/** Commands that we want to redact because of the sensitive nature of their contents */ +const SENSITIVE_COMMANDS = new Set([ + 'authenticate', + 'saslStart', + 'saslContinue', + 'getnonce', + 'createUser', + 'updateUser', + 'copydbgetnonce', + 'copydbsaslstart', + 'copydb' +]); + +const HELLO_COMMANDS = new Set(['hello', LEGACY_HELLO_COMMAND, LEGACY_HELLO_COMMAND_CAMEL_CASE]); + +// helper methods +const extractCommandName = (commandDoc: Document) => Object.keys(commandDoc)[0]; +const namespace = (command: WriteProtocolMessageType) => command.ns; +const databaseName = (command: WriteProtocolMessageType) => command.ns.split('.')[0]; +const collectionName = (command: WriteProtocolMessageType) => command.ns.split('.')[1]; +const maybeRedact = (commandName: string, commandDoc: Document, result: Error | Document) => + SENSITIVE_COMMANDS.has(commandName) || + (HELLO_COMMANDS.has(commandName) && commandDoc.speculativeAuthenticate) + ? {} + : result; + +const LEGACY_FIND_QUERY_MAP: { [key: string]: string } = { + $query: 'filter', + $orderby: 'sort', + $hint: 'hint', + $comment: 'comment', + $maxScan: 'maxScan', + $max: 'max', + $min: 'min', + $returnKey: 'returnKey', + $showDiskLoc: 'showRecordId', + $maxTimeMS: 'maxTimeMS', + $snapshot: 'snapshot' +}; + +const LEGACY_FIND_OPTIONS_MAP = { + numberToSkip: 'skip', + numberToReturn: 'batchSize', + returnFieldSelector: 'projection' +} as const; + +const OP_QUERY_KEYS = [ + 'tailable', + 'oplogReplay', + 'noCursorTimeout', + 'awaitData', + 'partial', + 'exhaust' +] as const; + +/** Extract the actual command from the query, possibly up-converting if it's a legacy format */ +function extractCommand(command: WriteProtocolMessageType): Document { + if (command instanceof GetMore) { + return { + getMore: deepCopy(command.cursorId), + collection: collectionName(command), + batchSize: command.numberToReturn + }; + } + + if (command instanceof KillCursor) { + return { + killCursors: collectionName(command), + cursors: deepCopy(command.cursorIds) + }; + } + + if (command instanceof Msg) { + return deepCopy(command.command); + } + + if (command.query?.$query) { + let result: Document; + if (command.ns === 'admin.$cmd') { + // up-convert legacy command + result = Object.assign({}, command.query.$query); + } else { + // up-convert legacy find command + result = { find: collectionName(command) }; + Object.keys(LEGACY_FIND_QUERY_MAP).forEach(key => { + if (command.query[key] != null) { + result[LEGACY_FIND_QUERY_MAP[key]] = deepCopy(command.query[key]); + } + }); + } + + Object.keys(LEGACY_FIND_OPTIONS_MAP).forEach(key => { + const legacyKey = key as keyof typeof LEGACY_FIND_OPTIONS_MAP; + if (command[legacyKey] != null) { + result[LEGACY_FIND_OPTIONS_MAP[legacyKey]] = deepCopy(command[legacyKey]); + } + }); + + OP_QUERY_KEYS.forEach(key => { + const opKey = key as typeof OP_QUERY_KEYS[number]; + if (command[opKey]) { + result[opKey] = command[opKey]; + } + }); + + if (command.pre32Limit != null) { + result.limit = command.pre32Limit; + } + + if (command.query.$explain) { + return { explain: result }; + } + return result; + } + + const clonedQuery: Record = {}; + const clonedCommand: Record = {}; + if (command.query) { + for (const k in command.query) { + clonedQuery[k] = deepCopy(command.query[k]); + } + clonedCommand.query = clonedQuery; + } + + for (const k in command) { + if (k === 'query') continue; + clonedCommand[k] = deepCopy((command as unknown as Record)[k]); + } + return command.query ? clonedQuery : clonedCommand; +} + +function extractReply(command: WriteProtocolMessageType, reply?: Document) { + if (command instanceof KillCursor) { + return { + ok: 1, + cursorsUnknown: command.cursorIds + }; + } + + if (!reply) { + return reply; + } + + if (command instanceof GetMore) { + return { + ok: 1, + cursor: { + id: deepCopy(reply.cursorId), + ns: namespace(command), + nextBatch: deepCopy(reply.documents) + } + }; + } + + if (command instanceof Msg) { + return deepCopy(reply.result ? reply.result : reply); + } + + // is this a legacy find command? + if (command.query && command.query.$query != null) { + return { + ok: 1, + cursor: { + id: deepCopy(reply.cursorId), + ns: namespace(command), + firstBatch: deepCopy(reply.documents) + } + }; + } + + return deepCopy(reply.result ? reply.result : reply); +} + +function extractConnectionDetails(connection: Connection) { + let connectionId; + if ('id' in connection) { + connectionId = connection.id; + } + return { + address: connection.address, + serviceId: connection.serviceId, + connectionId + }; +} diff --git a/node_modules/mongodb/src/cmap/commands.ts b/node_modules/mongodb/src/cmap/commands.ts new file mode 100644 index 000000000..a49d18431 --- /dev/null +++ b/node_modules/mongodb/src/cmap/commands.ts @@ -0,0 +1,891 @@ +import type { BSONSerializeOptions, Document, Long } from '../bson'; +import * as BSON from '../bson'; +import { MongoInvalidArgumentError, MongoRuntimeError } from '../error'; +import { ReadPreference } from '../read_preference'; +import type { ClientSession } from '../sessions'; +import { databaseNamespace } from '../utils'; +import type { CommandOptions } from './connection'; +import { OP_GETMORE, OP_KILL_CURSORS, OP_MSG, OP_QUERY } from './wire_protocol/constants'; + +// Incrementing request id +let _requestId = 0; + +// Query flags +const OPTS_TAILABLE_CURSOR = 2; +const OPTS_SECONDARY = 4; +const OPTS_OPLOG_REPLAY = 8; +const OPTS_NO_CURSOR_TIMEOUT = 16; +const OPTS_AWAIT_DATA = 32; +const OPTS_EXHAUST = 64; +const OPTS_PARTIAL = 128; + +// Response flags +const CURSOR_NOT_FOUND = 1; +const QUERY_FAILURE = 2; +const SHARD_CONFIG_STALE = 4; +const AWAIT_CAPABLE = 8; + +/** @internal */ +export type WriteProtocolMessageType = Query | Msg | GetMore | KillCursor; + +/** @internal */ +export interface OpQueryOptions extends CommandOptions { + socketTimeoutMS?: number; + session?: ClientSession; + documentsReturnedIn?: string; + numberToSkip?: number; + numberToReturn?: number; + returnFieldSelector?: Document; + pre32Limit?: number; + serializeFunctions?: boolean; + ignoreUndefined?: boolean; + maxBsonSize?: number; + checkKeys?: boolean; + secondaryOk?: boolean; + + requestId?: number; + moreToCome?: boolean; + exhaustAllowed?: boolean; + readPreference?: ReadPreference; +} + +/************************************************************** + * QUERY + **************************************************************/ +/** @internal */ +export class Query { + ns: string; + query: Document; + numberToSkip: number; + numberToReturn: number; + returnFieldSelector?: Document; + requestId: number; + pre32Limit?: number; + serializeFunctions: boolean; + ignoreUndefined: boolean; + maxBsonSize: number; + checkKeys: boolean; + batchSize: number; + tailable: boolean; + secondaryOk: boolean; + oplogReplay: boolean; + noCursorTimeout: boolean; + awaitData: boolean; + exhaust: boolean; + partial: boolean; + documentsReturnedIn?: string; + + constructor(ns: string, query: Document, options: OpQueryOptions) { + // Basic options needed to be passed in + // TODO(NODE-3483): Replace with MongoCommandError + if (ns == null) throw new MongoRuntimeError('Namespace must be specified for query'); + // TODO(NODE-3483): Replace with MongoCommandError + if (query == null) throw new MongoRuntimeError('A query document must be specified for query'); + + // Validate that we are not passing 0x00 in the collection name + if (ns.indexOf('\x00') !== -1) { + // TODO(NODE-3483): Use MongoNamespace static method + throw new MongoRuntimeError('Namespace cannot contain a null character'); + } + + // Basic options + this.ns = ns; + this.query = query; + + // Additional options + this.numberToSkip = options.numberToSkip || 0; + this.numberToReturn = options.numberToReturn || 0; + this.returnFieldSelector = options.returnFieldSelector || undefined; + this.requestId = Query.getRequestId(); + + // special case for pre-3.2 find commands, delete ASAP + this.pre32Limit = options.pre32Limit; + + // Serialization option + this.serializeFunctions = + typeof options.serializeFunctions === 'boolean' ? options.serializeFunctions : false; + this.ignoreUndefined = + typeof options.ignoreUndefined === 'boolean' ? options.ignoreUndefined : false; + this.maxBsonSize = options.maxBsonSize || 1024 * 1024 * 16; + this.checkKeys = typeof options.checkKeys === 'boolean' ? options.checkKeys : false; + this.batchSize = this.numberToReturn; + + // Flags + this.tailable = false; + this.secondaryOk = typeof options.secondaryOk === 'boolean' ? options.secondaryOk : false; + this.oplogReplay = false; + this.noCursorTimeout = false; + this.awaitData = false; + this.exhaust = false; + this.partial = false; + } + + /** Assign next request Id. */ + incRequestId(): void { + this.requestId = _requestId++; + } + + /** Peek next request Id. */ + nextRequestId(): number { + return _requestId + 1; + } + + /** Increment then return next request Id. */ + static getRequestId(): number { + return ++_requestId; + } + + // Uses a single allocated buffer for the process, avoiding multiple memory allocations + toBin(): Buffer[] { + const buffers = []; + let projection = null; + + // Set up the flags + let flags = 0; + if (this.tailable) { + flags |= OPTS_TAILABLE_CURSOR; + } + + if (this.secondaryOk) { + flags |= OPTS_SECONDARY; + } + + if (this.oplogReplay) { + flags |= OPTS_OPLOG_REPLAY; + } + + if (this.noCursorTimeout) { + flags |= OPTS_NO_CURSOR_TIMEOUT; + } + + if (this.awaitData) { + flags |= OPTS_AWAIT_DATA; + } + + if (this.exhaust) { + flags |= OPTS_EXHAUST; + } + + if (this.partial) { + flags |= OPTS_PARTIAL; + } + + // If batchSize is different to this.numberToReturn + if (this.batchSize !== this.numberToReturn) this.numberToReturn = this.batchSize; + + // Allocate write protocol header buffer + const header = Buffer.alloc( + 4 * 4 + // Header + 4 + // Flags + Buffer.byteLength(this.ns) + + 1 + // namespace + 4 + // numberToSkip + 4 // numberToReturn + ); + + // Add header to buffers + buffers.push(header); + + // Serialize the query + const query = BSON.serialize(this.query, { + checkKeys: this.checkKeys, + serializeFunctions: this.serializeFunctions, + ignoreUndefined: this.ignoreUndefined + }); + + // Add query document + buffers.push(query); + + if (this.returnFieldSelector && Object.keys(this.returnFieldSelector).length > 0) { + // Serialize the projection document + projection = BSON.serialize(this.returnFieldSelector, { + checkKeys: this.checkKeys, + serializeFunctions: this.serializeFunctions, + ignoreUndefined: this.ignoreUndefined + }); + // Add projection document + buffers.push(projection); + } + + // Total message size + const totalLength = header.length + query.length + (projection ? projection.length : 0); + + // Set up the index + let index = 4; + + // Write total document length + header[3] = (totalLength >> 24) & 0xff; + header[2] = (totalLength >> 16) & 0xff; + header[1] = (totalLength >> 8) & 0xff; + header[0] = totalLength & 0xff; + + // Write header information requestId + header[index + 3] = (this.requestId >> 24) & 0xff; + header[index + 2] = (this.requestId >> 16) & 0xff; + header[index + 1] = (this.requestId >> 8) & 0xff; + header[index] = this.requestId & 0xff; + index = index + 4; + + // Write header information responseTo + header[index + 3] = (0 >> 24) & 0xff; + header[index + 2] = (0 >> 16) & 0xff; + header[index + 1] = (0 >> 8) & 0xff; + header[index] = 0 & 0xff; + index = index + 4; + + // Write header information OP_QUERY + header[index + 3] = (OP_QUERY >> 24) & 0xff; + header[index + 2] = (OP_QUERY >> 16) & 0xff; + header[index + 1] = (OP_QUERY >> 8) & 0xff; + header[index] = OP_QUERY & 0xff; + index = index + 4; + + // Write header information flags + header[index + 3] = (flags >> 24) & 0xff; + header[index + 2] = (flags >> 16) & 0xff; + header[index + 1] = (flags >> 8) & 0xff; + header[index] = flags & 0xff; + index = index + 4; + + // Write collection name + index = index + header.write(this.ns, index, 'utf8') + 1; + header[index - 1] = 0; + + // Write header information flags numberToSkip + header[index + 3] = (this.numberToSkip >> 24) & 0xff; + header[index + 2] = (this.numberToSkip >> 16) & 0xff; + header[index + 1] = (this.numberToSkip >> 8) & 0xff; + header[index] = this.numberToSkip & 0xff; + index = index + 4; + + // Write header information flags numberToReturn + header[index + 3] = (this.numberToReturn >> 24) & 0xff; + header[index + 2] = (this.numberToReturn >> 16) & 0xff; + header[index + 1] = (this.numberToReturn >> 8) & 0xff; + header[index] = this.numberToReturn & 0xff; + index = index + 4; + + // Return the buffers + return buffers; + } +} + +/** @internal */ +export interface OpGetMoreOptions { + numberToReturn?: number; +} + +/************************************************************** + * GETMORE + **************************************************************/ +/** @internal */ +export class GetMore { + numberToReturn: number; + requestId: number; + ns: string; + cursorId: Long; + + constructor(ns: string, cursorId: Long, opts: OpGetMoreOptions = {}) { + this.numberToReturn = opts.numberToReturn || 0; + this.requestId = _requestId++; + this.ns = ns; + this.cursorId = cursorId; + } + + // Uses a single allocated buffer for the process, avoiding multiple memory allocations + toBin(): Buffer[] { + const length = 4 + Buffer.byteLength(this.ns) + 1 + 4 + 8 + 4 * 4; + // Create command buffer + let index = 0; + // Allocate buffer + const _buffer = Buffer.alloc(length); + + // Write header information + // index = write32bit(index, _buffer, length); + _buffer[index + 3] = (length >> 24) & 0xff; + _buffer[index + 2] = (length >> 16) & 0xff; + _buffer[index + 1] = (length >> 8) & 0xff; + _buffer[index] = length & 0xff; + index = index + 4; + + // index = write32bit(index, _buffer, requestId); + _buffer[index + 3] = (this.requestId >> 24) & 0xff; + _buffer[index + 2] = (this.requestId >> 16) & 0xff; + _buffer[index + 1] = (this.requestId >> 8) & 0xff; + _buffer[index] = this.requestId & 0xff; + index = index + 4; + + // index = write32bit(index, _buffer, 0); + _buffer[index + 3] = (0 >> 24) & 0xff; + _buffer[index + 2] = (0 >> 16) & 0xff; + _buffer[index + 1] = (0 >> 8) & 0xff; + _buffer[index] = 0 & 0xff; + index = index + 4; + + // index = write32bit(index, _buffer, OP_GETMORE); + _buffer[index + 3] = (OP_GETMORE >> 24) & 0xff; + _buffer[index + 2] = (OP_GETMORE >> 16) & 0xff; + _buffer[index + 1] = (OP_GETMORE >> 8) & 0xff; + _buffer[index] = OP_GETMORE & 0xff; + index = index + 4; + + // index = write32bit(index, _buffer, 0); + _buffer[index + 3] = (0 >> 24) & 0xff; + _buffer[index + 2] = (0 >> 16) & 0xff; + _buffer[index + 1] = (0 >> 8) & 0xff; + _buffer[index] = 0 & 0xff; + index = index + 4; + + // Write collection name + index = index + _buffer.write(this.ns, index, 'utf8') + 1; + _buffer[index - 1] = 0; + + // Write batch size + // index = write32bit(index, _buffer, numberToReturn); + _buffer[index + 3] = (this.numberToReturn >> 24) & 0xff; + _buffer[index + 2] = (this.numberToReturn >> 16) & 0xff; + _buffer[index + 1] = (this.numberToReturn >> 8) & 0xff; + _buffer[index] = this.numberToReturn & 0xff; + index = index + 4; + + // Write cursor id + // index = write32bit(index, _buffer, cursorId.getLowBits()); + _buffer[index + 3] = (this.cursorId.getLowBits() >> 24) & 0xff; + _buffer[index + 2] = (this.cursorId.getLowBits() >> 16) & 0xff; + _buffer[index + 1] = (this.cursorId.getLowBits() >> 8) & 0xff; + _buffer[index] = this.cursorId.getLowBits() & 0xff; + index = index + 4; + + // index = write32bit(index, _buffer, cursorId.getHighBits()); + _buffer[index + 3] = (this.cursorId.getHighBits() >> 24) & 0xff; + _buffer[index + 2] = (this.cursorId.getHighBits() >> 16) & 0xff; + _buffer[index + 1] = (this.cursorId.getHighBits() >> 8) & 0xff; + _buffer[index] = this.cursorId.getHighBits() & 0xff; + index = index + 4; + + // Return buffer + return [_buffer]; + } +} + +/************************************************************** + * KILLCURSOR + **************************************************************/ +/** @internal */ +export class KillCursor { + ns: string; + requestId: number; + cursorIds: Long[]; + + constructor(ns: string, cursorIds: Long[]) { + this.ns = ns; + this.requestId = _requestId++; + this.cursorIds = cursorIds; + } + + // Uses a single allocated buffer for the process, avoiding multiple memory allocations + toBin(): Buffer[] { + const length = 4 + 4 + 4 * 4 + this.cursorIds.length * 8; + + // Create command buffer + let index = 0; + const _buffer = Buffer.alloc(length); + + // Write header information + // index = write32bit(index, _buffer, length); + _buffer[index + 3] = (length >> 24) & 0xff; + _buffer[index + 2] = (length >> 16) & 0xff; + _buffer[index + 1] = (length >> 8) & 0xff; + _buffer[index] = length & 0xff; + index = index + 4; + + // index = write32bit(index, _buffer, requestId); + _buffer[index + 3] = (this.requestId >> 24) & 0xff; + _buffer[index + 2] = (this.requestId >> 16) & 0xff; + _buffer[index + 1] = (this.requestId >> 8) & 0xff; + _buffer[index] = this.requestId & 0xff; + index = index + 4; + + // index = write32bit(index, _buffer, 0); + _buffer[index + 3] = (0 >> 24) & 0xff; + _buffer[index + 2] = (0 >> 16) & 0xff; + _buffer[index + 1] = (0 >> 8) & 0xff; + _buffer[index] = 0 & 0xff; + index = index + 4; + + // index = write32bit(index, _buffer, OP_KILL_CURSORS); + _buffer[index + 3] = (OP_KILL_CURSORS >> 24) & 0xff; + _buffer[index + 2] = (OP_KILL_CURSORS >> 16) & 0xff; + _buffer[index + 1] = (OP_KILL_CURSORS >> 8) & 0xff; + _buffer[index] = OP_KILL_CURSORS & 0xff; + index = index + 4; + + // index = write32bit(index, _buffer, 0); + _buffer[index + 3] = (0 >> 24) & 0xff; + _buffer[index + 2] = (0 >> 16) & 0xff; + _buffer[index + 1] = (0 >> 8) & 0xff; + _buffer[index] = 0 & 0xff; + index = index + 4; + + // Write batch size + // index = write32bit(index, _buffer, this.cursorIds.length); + _buffer[index + 3] = (this.cursorIds.length >> 24) & 0xff; + _buffer[index + 2] = (this.cursorIds.length >> 16) & 0xff; + _buffer[index + 1] = (this.cursorIds.length >> 8) & 0xff; + _buffer[index] = this.cursorIds.length & 0xff; + index = index + 4; + + // Write all the cursor ids into the array + for (let i = 0; i < this.cursorIds.length; i++) { + // Write cursor id + // index = write32bit(index, _buffer, cursorIds[i].getLowBits()); + _buffer[index + 3] = (this.cursorIds[i].getLowBits() >> 24) & 0xff; + _buffer[index + 2] = (this.cursorIds[i].getLowBits() >> 16) & 0xff; + _buffer[index + 1] = (this.cursorIds[i].getLowBits() >> 8) & 0xff; + _buffer[index] = this.cursorIds[i].getLowBits() & 0xff; + index = index + 4; + + // index = write32bit(index, _buffer, cursorIds[i].getHighBits()); + _buffer[index + 3] = (this.cursorIds[i].getHighBits() >> 24) & 0xff; + _buffer[index + 2] = (this.cursorIds[i].getHighBits() >> 16) & 0xff; + _buffer[index + 1] = (this.cursorIds[i].getHighBits() >> 8) & 0xff; + _buffer[index] = this.cursorIds[i].getHighBits() & 0xff; + index = index + 4; + } + + // Return buffer + return [_buffer]; + } +} + +/** @internal */ +export interface MessageHeader { + length: number; + requestId: number; + responseTo: number; + opCode: number; + fromCompressed?: boolean; +} + +/** @internal */ +export interface OpResponseOptions extends BSONSerializeOptions { + raw?: boolean; + documentsReturnedIn?: string | null; +} + +/** @internal */ +export class Response { + parsed: boolean; + raw: Buffer; + data: Buffer; + opts: OpResponseOptions; + length: number; + requestId: number; + responseTo: number; + opCode: number; + fromCompressed?: boolean; + responseFlags?: number; + cursorId?: Long; + startingFrom?: number; + numberReturned?: number; + documents: (Document | Buffer)[] = new Array(0); + cursorNotFound?: boolean; + queryFailure?: boolean; + shardConfigStale?: boolean; + awaitCapable?: boolean; + promoteLongs: boolean; + promoteValues: boolean; + promoteBuffers: boolean; + bsonRegExp?: boolean; + index?: number; + + constructor( + message: Buffer, + msgHeader: MessageHeader, + msgBody: Buffer, + opts?: OpResponseOptions + ) { + this.parsed = false; + this.raw = message; + this.data = msgBody; + this.opts = opts ?? { + promoteLongs: true, + promoteValues: true, + promoteBuffers: false, + bsonRegExp: false + }; + + // Read the message header + this.length = msgHeader.length; + this.requestId = msgHeader.requestId; + this.responseTo = msgHeader.responseTo; + this.opCode = msgHeader.opCode; + this.fromCompressed = msgHeader.fromCompressed; + + // Flag values + this.promoteLongs = typeof this.opts.promoteLongs === 'boolean' ? this.opts.promoteLongs : true; + this.promoteValues = + typeof this.opts.promoteValues === 'boolean' ? this.opts.promoteValues : true; + this.promoteBuffers = + typeof this.opts.promoteBuffers === 'boolean' ? this.opts.promoteBuffers : false; + this.bsonRegExp = typeof this.opts.bsonRegExp === 'boolean' ? this.opts.bsonRegExp : false; + } + + isParsed(): boolean { + return this.parsed; + } + + parse(options: OpResponseOptions): void { + // Don't parse again if not needed + if (this.parsed) return; + options = options ?? {}; + + // Allow the return of raw documents instead of parsing + const raw = options.raw || false; + const documentsReturnedIn = options.documentsReturnedIn || null; + const promoteLongs = options.promoteLongs ?? this.opts.promoteLongs; + const promoteValues = options.promoteValues ?? this.opts.promoteValues; + const promoteBuffers = options.promoteBuffers ?? this.opts.promoteBuffers; + const bsonRegExp = options.bsonRegExp ?? this.opts.bsonRegExp; + let bsonSize; + + // Set up the options + const _options: BSONSerializeOptions = { + promoteLongs, + promoteValues, + promoteBuffers, + bsonRegExp + }; + + // Position within OP_REPLY at which documents start + // (See https://docs.mongodb.com/manual/reference/mongodb-wire-protocol/#wire-op-reply) + this.index = 20; + + // Read the message body + this.responseFlags = this.data.readInt32LE(0); + this.cursorId = new BSON.Long(this.data.readInt32LE(4), this.data.readInt32LE(8)); + this.startingFrom = this.data.readInt32LE(12); + this.numberReturned = this.data.readInt32LE(16); + + // Preallocate document array + this.documents = new Array(this.numberReturned); + + this.cursorNotFound = (this.responseFlags & CURSOR_NOT_FOUND) !== 0; + this.queryFailure = (this.responseFlags & QUERY_FAILURE) !== 0; + this.shardConfigStale = (this.responseFlags & SHARD_CONFIG_STALE) !== 0; + this.awaitCapable = (this.responseFlags & AWAIT_CAPABLE) !== 0; + + // Parse Body + for (let i = 0; i < this.numberReturned; i++) { + bsonSize = + this.data[this.index] | + (this.data[this.index + 1] << 8) | + (this.data[this.index + 2] << 16) | + (this.data[this.index + 3] << 24); + + // If we have raw results specified slice the return document + if (raw) { + this.documents[i] = this.data.slice(this.index, this.index + bsonSize); + } else { + this.documents[i] = BSON.deserialize( + this.data.slice(this.index, this.index + bsonSize), + _options + ); + } + + // Adjust the index + this.index = this.index + bsonSize; + } + + if (this.documents.length === 1 && documentsReturnedIn != null && raw) { + const fieldsAsRaw: Document = {}; + fieldsAsRaw[documentsReturnedIn] = true; + _options.fieldsAsRaw = fieldsAsRaw; + + const doc = BSON.deserialize(this.documents[0] as Buffer, _options); + this.documents = [doc]; + } + + // Set parsed + this.parsed = true; + } +} + +// Implementation of OP_MSG spec: +// https://github.com/mongodb/specifications/blob/master/source/message/OP_MSG.rst +// +// struct Section { +// uint8 payloadType; +// union payload { +// document document; // payloadType == 0 +// struct sequence { // payloadType == 1 +// int32 size; +// cstring identifier; +// document* documents; +// }; +// }; +// }; + +// struct OP_MSG { +// struct MsgHeader { +// int32 messageLength; +// int32 requestID; +// int32 responseTo; +// int32 opCode = 2013; +// }; +// uint32 flagBits; +// Section+ sections; +// [uint32 checksum;] +// }; + +// Msg Flags +const OPTS_CHECKSUM_PRESENT = 1; +const OPTS_MORE_TO_COME = 2; +const OPTS_EXHAUST_ALLOWED = 1 << 16; + +/** @internal */ +export interface OpMsgOptions { + requestId: number; + serializeFunctions: boolean; + ignoreUndefined: boolean; + checkKeys: boolean; + maxBsonSize: number; + moreToCome: boolean; + exhaustAllowed: boolean; + readPreference: ReadPreference; +} + +/** @internal */ +export class Msg { + ns: string; + command: Document; + options: OpQueryOptions; + requestId: number; + serializeFunctions: boolean; + ignoreUndefined: boolean; + checkKeys: boolean; + maxBsonSize: number; + checksumPresent: boolean; + moreToCome: boolean; + exhaustAllowed: boolean; + + constructor(ns: string, command: Document, options: OpQueryOptions) { + // Basic options needed to be passed in + if (command == null) + throw new MongoInvalidArgumentError('Query document must be specified for query'); + + // Basic options + this.ns = ns; + this.command = command; + this.command.$db = databaseNamespace(ns); + + if (options.readPreference && options.readPreference.mode !== ReadPreference.PRIMARY) { + this.command.$readPreference = options.readPreference.toJSON(); + } + + // Ensure empty options + this.options = options ?? {}; + + // Additional options + this.requestId = options.requestId ? options.requestId : Msg.getRequestId(); + + // Serialization option + this.serializeFunctions = + typeof options.serializeFunctions === 'boolean' ? options.serializeFunctions : false; + this.ignoreUndefined = + typeof options.ignoreUndefined === 'boolean' ? options.ignoreUndefined : false; + this.checkKeys = typeof options.checkKeys === 'boolean' ? options.checkKeys : false; + this.maxBsonSize = options.maxBsonSize || 1024 * 1024 * 16; + + // flags + this.checksumPresent = false; + this.moreToCome = options.moreToCome || false; + this.exhaustAllowed = + typeof options.exhaustAllowed === 'boolean' ? options.exhaustAllowed : false; + } + + toBin(): Buffer[] { + const buffers: Buffer[] = []; + let flags = 0; + + if (this.checksumPresent) { + flags |= OPTS_CHECKSUM_PRESENT; + } + + if (this.moreToCome) { + flags |= OPTS_MORE_TO_COME; + } + + if (this.exhaustAllowed) { + flags |= OPTS_EXHAUST_ALLOWED; + } + + const header = Buffer.alloc( + 4 * 4 + // Header + 4 // Flags + ); + + buffers.push(header); + + let totalLength = header.length; + const command = this.command; + totalLength += this.makeDocumentSegment(buffers, command); + + header.writeInt32LE(totalLength, 0); // messageLength + header.writeInt32LE(this.requestId, 4); // requestID + header.writeInt32LE(0, 8); // responseTo + header.writeInt32LE(OP_MSG, 12); // opCode + header.writeUInt32LE(flags, 16); // flags + return buffers; + } + + makeDocumentSegment(buffers: Buffer[], document: Document): number { + const payloadTypeBuffer = Buffer.alloc(1); + payloadTypeBuffer[0] = 0; + + const documentBuffer = this.serializeBson(document); + buffers.push(payloadTypeBuffer); + buffers.push(documentBuffer); + + return payloadTypeBuffer.length + documentBuffer.length; + } + + serializeBson(document: Document): Buffer { + return BSON.serialize(document, { + checkKeys: this.checkKeys, + serializeFunctions: this.serializeFunctions, + ignoreUndefined: this.ignoreUndefined + }); + } + + static getRequestId(): number { + _requestId = (_requestId + 1) & 0x7fffffff; + return _requestId; + } +} + +/** @internal */ +export class BinMsg { + parsed: boolean; + raw: Buffer; + data: Buffer; + opts: OpResponseOptions; + length: number; + requestId: number; + responseTo: number; + opCode: number; + fromCompressed?: boolean; + responseFlags: number; + checksumPresent: boolean; + moreToCome: boolean; + exhaustAllowed: boolean; + promoteLongs: boolean; + promoteValues: boolean; + promoteBuffers: boolean; + bsonRegExp: boolean; + documents: (Document | Buffer)[]; + index?: number; + + constructor( + message: Buffer, + msgHeader: MessageHeader, + msgBody: Buffer, + opts?: OpResponseOptions + ) { + this.parsed = false; + this.raw = message; + this.data = msgBody; + this.opts = opts ?? { + promoteLongs: true, + promoteValues: true, + promoteBuffers: false, + bsonRegExp: false + }; + + // Read the message header + this.length = msgHeader.length; + this.requestId = msgHeader.requestId; + this.responseTo = msgHeader.responseTo; + this.opCode = msgHeader.opCode; + this.fromCompressed = msgHeader.fromCompressed; + + // Read response flags + this.responseFlags = msgBody.readInt32LE(0); + this.checksumPresent = (this.responseFlags & OPTS_CHECKSUM_PRESENT) !== 0; + this.moreToCome = (this.responseFlags & OPTS_MORE_TO_COME) !== 0; + this.exhaustAllowed = (this.responseFlags & OPTS_EXHAUST_ALLOWED) !== 0; + this.promoteLongs = typeof this.opts.promoteLongs === 'boolean' ? this.opts.promoteLongs : true; + this.promoteValues = + typeof this.opts.promoteValues === 'boolean' ? this.opts.promoteValues : true; + this.promoteBuffers = + typeof this.opts.promoteBuffers === 'boolean' ? this.opts.promoteBuffers : false; + this.bsonRegExp = typeof this.opts.bsonRegExp === 'boolean' ? this.opts.bsonRegExp : false; + + this.documents = []; + } + + isParsed(): boolean { + return this.parsed; + } + + parse(options: OpResponseOptions): void { + // Don't parse again if not needed + if (this.parsed) return; + options = options ?? {}; + + this.index = 4; + // Allow the return of raw documents instead of parsing + const raw = options.raw || false; + const documentsReturnedIn = options.documentsReturnedIn || null; + const promoteLongs = options.promoteLongs ?? this.opts.promoteLongs; + const promoteValues = options.promoteValues ?? this.opts.promoteValues; + const promoteBuffers = options.promoteBuffers ?? this.opts.promoteBuffers; + const bsonRegExp = options.bsonRegExp ?? this.opts.bsonRegExp; + const validation = this.parseBsonSerializationOptions(options); + + // Set up the options + const bsonOptions: BSONSerializeOptions = { + promoteLongs, + promoteValues, + promoteBuffers, + bsonRegExp, + validation + // Due to the strictness of the BSON libraries validation option we need this cast + } as BSONSerializeOptions & { validation: { utf8: { writeErrors: boolean } } }; + + while (this.index < this.data.length) { + const payloadType = this.data.readUInt8(this.index++); + if (payloadType === 0) { + const bsonSize = this.data.readUInt32LE(this.index); + const bin = this.data.slice(this.index, this.index + bsonSize); + this.documents.push(raw ? bin : BSON.deserialize(bin, bsonOptions)); + this.index += bsonSize; + } else if (payloadType === 1) { + // It was decided that no driver makes use of payload type 1 + + // TODO(NODE-3483): Replace with MongoDeprecationError + throw new MongoRuntimeError('OP_MSG Payload Type 1 detected unsupported protocol'); + } + } + + if (this.documents.length === 1 && documentsReturnedIn != null && raw) { + const fieldsAsRaw: Document = {}; + fieldsAsRaw[documentsReturnedIn] = true; + bsonOptions.fieldsAsRaw = fieldsAsRaw; + const doc = BSON.deserialize(this.documents[0] as Buffer, bsonOptions); + this.documents = [doc]; + } + + this.parsed = true; + } + + parseBsonSerializationOptions({ enableUtf8Validation }: BSONSerializeOptions): { + utf8: { writeErrors: false } | false; + } { + if (enableUtf8Validation === false) { + return { utf8: false }; + } + + return { utf8: { writeErrors: false } }; + } +} diff --git a/node_modules/mongodb/src/cmap/connect.ts b/node_modules/mongodb/src/cmap/connect.ts new file mode 100644 index 000000000..21556324a --- /dev/null +++ b/node_modules/mongodb/src/cmap/connect.ts @@ -0,0 +1,517 @@ +import type { Socket, SocketConnectOpts } from 'net'; +import * as net from 'net'; +import { SocksClient } from 'socks'; +import type { ConnectionOptions as TLSConnectionOpts, TLSSocket } from 'tls'; +import * as tls from 'tls'; + +import type { Document } from '../bson'; +import { Int32 } from '../bson'; +import { LEGACY_HELLO_COMMAND } from '../constants'; +import { + AnyError, + MongoCompatibilityError, + MongoError, + MongoErrorLabel, + MongoInvalidArgumentError, + MongoNetworkError, + MongoNetworkTimeoutError, + MongoRuntimeError, + MongoServerError, + needsRetryableWriteLabel +} from '../error'; +import { Callback, ClientMetadata, HostAddress, makeClientMetadata, ns } from '../utils'; +import { AuthContext, AuthProvider } from './auth/auth_provider'; +import { GSSAPI } from './auth/gssapi'; +import { MongoCR } from './auth/mongocr'; +import { MongoDBAWS } from './auth/mongodb_aws'; +import { Plain } from './auth/plain'; +import { AuthMechanism } from './auth/providers'; +import { ScramSHA1, ScramSHA256 } from './auth/scram'; +import { X509 } from './auth/x509'; +import { Connection, ConnectionOptions, CryptoConnection } from './connection'; +import { + MAX_SUPPORTED_SERVER_VERSION, + MAX_SUPPORTED_WIRE_VERSION, + MIN_SUPPORTED_SERVER_VERSION, + MIN_SUPPORTED_WIRE_VERSION +} from './wire_protocol/constants'; + +const AUTH_PROVIDERS = new Map([ + [AuthMechanism.MONGODB_AWS, new MongoDBAWS()], + [AuthMechanism.MONGODB_CR, new MongoCR()], + [AuthMechanism.MONGODB_GSSAPI, new GSSAPI()], + [AuthMechanism.MONGODB_PLAIN, new Plain()], + [AuthMechanism.MONGODB_SCRAM_SHA1, new ScramSHA1()], + [AuthMechanism.MONGODB_SCRAM_SHA256, new ScramSHA256()], + [AuthMechanism.MONGODB_X509, new X509()] +]); + +/** @public */ +export type Stream = Socket | TLSSocket; + +export function connect(options: ConnectionOptions, callback: Callback): void { + makeConnection({ ...options, existingSocket: undefined }, (err, socket) => { + if (err || !socket) { + return callback(err); + } + + let ConnectionType = options.connectionType ?? Connection; + if (options.autoEncrypter) { + ConnectionType = CryptoConnection; + } + performInitialHandshake(new ConnectionType(socket, options), options, callback); + }); +} + +function checkSupportedServer(hello: Document, options: ConnectionOptions) { + const serverVersionHighEnough = + hello && + (typeof hello.maxWireVersion === 'number' || hello.maxWireVersion instanceof Int32) && + hello.maxWireVersion >= MIN_SUPPORTED_WIRE_VERSION; + const serverVersionLowEnough = + hello && + (typeof hello.minWireVersion === 'number' || hello.minWireVersion instanceof Int32) && + hello.minWireVersion <= MAX_SUPPORTED_WIRE_VERSION; + + if (serverVersionHighEnough) { + if (serverVersionLowEnough) { + return null; + } + + const message = `Server at ${options.hostAddress} reports minimum wire version ${JSON.stringify( + hello.minWireVersion + )}, but this version of the Node.js Driver requires at most ${MAX_SUPPORTED_WIRE_VERSION} (MongoDB ${MAX_SUPPORTED_SERVER_VERSION})`; + return new MongoCompatibilityError(message); + } + + const message = `Server at ${options.hostAddress} reports maximum wire version ${ + JSON.stringify(hello.maxWireVersion) ?? 0 + }, but this version of the Node.js Driver requires at least ${MIN_SUPPORTED_WIRE_VERSION} (MongoDB ${MIN_SUPPORTED_SERVER_VERSION})`; + return new MongoCompatibilityError(message); +} + +function performInitialHandshake( + conn: Connection, + options: ConnectionOptions, + _callback: Callback +) { + const callback: Callback = function (err, ret) { + if (err && conn) { + conn.destroy(); + } + _callback(err, ret); + }; + + const credentials = options.credentials; + if (credentials) { + if ( + !(credentials.mechanism === AuthMechanism.MONGODB_DEFAULT) && + !AUTH_PROVIDERS.get(credentials.mechanism) + ) { + callback( + new MongoInvalidArgumentError(`AuthMechanism '${credentials.mechanism}' not supported`) + ); + return; + } + } + + const authContext = new AuthContext(conn, credentials, options); + prepareHandshakeDocument(authContext, (err, handshakeDoc) => { + if (err || !handshakeDoc) { + return callback(err); + } + + const handshakeOptions: Document = Object.assign({}, options); + if (typeof options.connectTimeoutMS === 'number') { + // The handshake technically is a monitoring check, so its socket timeout should be connectTimeoutMS + handshakeOptions.socketTimeoutMS = options.connectTimeoutMS; + } + + const start = new Date().getTime(); + conn.command(ns('admin.$cmd'), handshakeDoc, handshakeOptions, (err, response) => { + if (err) { + callback(err); + return; + } + + if (response?.ok === 0) { + callback(new MongoServerError(response)); + return; + } + + if (!('isWritablePrimary' in response)) { + // Provide hello-style response document. + response.isWritablePrimary = response[LEGACY_HELLO_COMMAND]; + } + + if (response.helloOk) { + conn.helloOk = true; + } + + const supportedServerErr = checkSupportedServer(response, options); + if (supportedServerErr) { + callback(supportedServerErr); + return; + } + + if (options.loadBalanced) { + if (!response.serviceId) { + return callback( + new MongoCompatibilityError( + 'Driver attempted to initialize in load balancing mode, ' + + 'but the server does not support this mode.' + ) + ); + } + } + + // NOTE: This is metadata attached to the connection while porting away from + // handshake being done in the `Server` class. Likely, it should be + // relocated, or at very least restructured. + conn.hello = response; + conn.lastHelloMS = new Date().getTime() - start; + + if (!response.arbiterOnly && credentials) { + // store the response on auth context + authContext.response = response; + + const resolvedCredentials = credentials.resolveAuthMechanism(response); + const provider = AUTH_PROVIDERS.get(resolvedCredentials.mechanism); + if (!provider) { + return callback( + new MongoInvalidArgumentError( + `No AuthProvider for ${resolvedCredentials.mechanism} defined.` + ) + ); + } + provider.auth(authContext, err => { + if (err) { + if (err instanceof MongoError) { + err.addErrorLabel(MongoErrorLabel.HandshakeError); + if (needsRetryableWriteLabel(err, response.maxWireVersion)) { + err.addErrorLabel(MongoErrorLabel.RetryableWriteError); + } + } + return callback(err); + } + callback(undefined, conn); + }); + + return; + } + + callback(undefined, conn); + }); + }); +} + +export interface HandshakeDocument extends Document { + /** + * @deprecated Use hello instead + */ + ismaster?: boolean; + hello?: boolean; + helloOk?: boolean; + client: ClientMetadata; + compression: string[]; + saslSupportedMechs?: string; + loadBalanced: boolean; +} + +function prepareHandshakeDocument(authContext: AuthContext, callback: Callback) { + const options = authContext.options; + const compressors = options.compressors ? options.compressors : []; + const { serverApi } = authContext.connection; + + const handshakeDoc: HandshakeDocument = { + [serverApi?.version ? 'hello' : LEGACY_HELLO_COMMAND]: true, + helloOk: true, + client: options.metadata || makeClientMetadata(options), + compression: compressors, + loadBalanced: options.loadBalanced + }; + + const credentials = authContext.credentials; + if (credentials) { + if (credentials.mechanism === AuthMechanism.MONGODB_DEFAULT && credentials.username) { + handshakeDoc.saslSupportedMechs = `${credentials.source}.${credentials.username}`; + + const provider = AUTH_PROVIDERS.get(AuthMechanism.MONGODB_SCRAM_SHA256); + if (!provider) { + // This auth mechanism is always present. + return callback( + new MongoInvalidArgumentError( + `No AuthProvider for ${AuthMechanism.MONGODB_SCRAM_SHA256} defined.` + ) + ); + } + return provider.prepare(handshakeDoc, authContext, callback); + } + const provider = AUTH_PROVIDERS.get(credentials.mechanism); + if (!provider) { + return callback( + new MongoInvalidArgumentError(`No AuthProvider for ${credentials.mechanism} defined.`) + ); + } + return provider.prepare(handshakeDoc, authContext, callback); + } + callback(undefined, handshakeDoc); +} + +/** @public */ +export const LEGAL_TLS_SOCKET_OPTIONS = [ + 'ALPNProtocols', + 'ca', + 'cert', + 'checkServerIdentity', + 'ciphers', + 'crl', + 'ecdhCurve', + 'key', + 'minDHSize', + 'passphrase', + 'pfx', + 'rejectUnauthorized', + 'secureContext', + 'secureProtocol', + 'servername', + 'session' +] as const; + +/** @public */ +export const LEGAL_TCP_SOCKET_OPTIONS = [ + 'family', + 'hints', + 'localAddress', + 'localPort', + 'lookup' +] as const; + +function parseConnectOptions(options: ConnectionOptions): SocketConnectOpts { + const hostAddress = options.hostAddress; + if (!hostAddress) throw new MongoInvalidArgumentError('Option "hostAddress" is required'); + + const result: Partial = {}; + for (const name of LEGAL_TCP_SOCKET_OPTIONS) { + if (options[name] != null) { + (result as Document)[name] = options[name]; + } + } + + if (typeof hostAddress.socketPath === 'string') { + result.path = hostAddress.socketPath; + return result as net.IpcNetConnectOpts; + } else if (typeof hostAddress.host === 'string') { + result.host = hostAddress.host; + result.port = hostAddress.port; + return result as net.TcpNetConnectOpts; + } else { + // This should never happen since we set up HostAddresses + // But if we don't throw here the socket could hang until timeout + // TODO(NODE-3483) + throw new MongoRuntimeError(`Unexpected HostAddress ${JSON.stringify(hostAddress)}`); + } +} + +type MakeConnectionOptions = ConnectionOptions & { existingSocket?: Stream }; + +function parseSslOptions(options: MakeConnectionOptions): TLSConnectionOpts { + const result: TLSConnectionOpts = parseConnectOptions(options); + // Merge in valid SSL options + for (const name of LEGAL_TLS_SOCKET_OPTIONS) { + if (options[name] != null) { + (result as Document)[name] = options[name]; + } + } + + if (options.existingSocket) { + result.socket = options.existingSocket; + } + + // Set default sni servername to be the same as host + if (result.servername == null && result.host && !net.isIP(result.host)) { + result.servername = result.host; + } + + return result; +} + +const SOCKET_ERROR_EVENT_LIST = ['error', 'close', 'timeout', 'parseError'] as const; +type ErrorHandlerEventName = typeof SOCKET_ERROR_EVENT_LIST[number] | 'cancel'; +const SOCKET_ERROR_EVENTS = new Set(SOCKET_ERROR_EVENT_LIST); + +function makeConnection(options: MakeConnectionOptions, _callback: Callback) { + const useTLS = options.tls ?? false; + const keepAlive = options.keepAlive ?? true; + const socketTimeoutMS = options.socketTimeoutMS ?? Reflect.get(options, 'socketTimeout') ?? 0; + const noDelay = options.noDelay ?? true; + const connectTimeoutMS = options.connectTimeoutMS ?? 30000; + const rejectUnauthorized = options.rejectUnauthorized ?? true; + const keepAliveInitialDelay = + ((options.keepAliveInitialDelay ?? 120000) > socketTimeoutMS + ? Math.round(socketTimeoutMS / 2) + : options.keepAliveInitialDelay) ?? 120000; + const existingSocket = options.existingSocket; + + let socket: Stream; + const callback: Callback = function (err, ret) { + if (err && socket) { + socket.destroy(); + } + + _callback(err, ret); + }; + + if (options.proxyHost != null) { + // Currently, only Socks5 is supported. + return makeSocks5Connection( + { + ...options, + connectTimeoutMS // Should always be present for Socks5 + }, + callback + ); + } + + if (useTLS) { + const tlsSocket = tls.connect(parseSslOptions(options)); + if (typeof tlsSocket.disableRenegotiation === 'function') { + tlsSocket.disableRenegotiation(); + } + socket = tlsSocket; + } else if (existingSocket) { + // In the TLS case, parseSslOptions() sets options.socket to existingSocket, + // so we only need to handle the non-TLS case here (where existingSocket + // gives us all we need out of the box). + socket = existingSocket; + } else { + socket = net.createConnection(parseConnectOptions(options)); + } + + socket.setKeepAlive(keepAlive, keepAliveInitialDelay); + socket.setTimeout(connectTimeoutMS); + socket.setNoDelay(noDelay); + + const connectEvent = useTLS ? 'secureConnect' : 'connect'; + let cancellationHandler: (err: Error) => void; + function errorHandler(eventName: ErrorHandlerEventName) { + return (err: Error) => { + SOCKET_ERROR_EVENTS.forEach(event => socket.removeAllListeners(event)); + if (cancellationHandler && options.cancellationToken) { + options.cancellationToken.removeListener('cancel', cancellationHandler); + } + + socket.removeListener(connectEvent, connectHandler); + callback(connectionFailureError(eventName, err)); + }; + } + + function connectHandler() { + SOCKET_ERROR_EVENTS.forEach(event => socket.removeAllListeners(event)); + if (cancellationHandler && options.cancellationToken) { + options.cancellationToken.removeListener('cancel', cancellationHandler); + } + + if ('authorizationError' in socket) { + if (socket.authorizationError && rejectUnauthorized) { + return callback(socket.authorizationError); + } + } + + socket.setTimeout(socketTimeoutMS); + callback(undefined, socket); + } + + SOCKET_ERROR_EVENTS.forEach(event => socket.once(event, errorHandler(event))); + if (options.cancellationToken) { + cancellationHandler = errorHandler('cancel'); + options.cancellationToken.once('cancel', cancellationHandler); + } + + if (existingSocket) { + process.nextTick(connectHandler); + } else { + socket.once(connectEvent, connectHandler); + } +} + +function makeSocks5Connection(options: MakeConnectionOptions, callback: Callback) { + const hostAddress = HostAddress.fromHostPort( + options.proxyHost ?? '', // proxyHost is guaranteed to set here + options.proxyPort ?? 1080 + ); + + // First, connect to the proxy server itself: + makeConnection( + { + ...options, + hostAddress, + tls: false, + proxyHost: undefined + }, + (err, rawSocket) => { + if (err) { + return callback(err); + } + + const destination = parseConnectOptions(options) as net.TcpNetConnectOpts; + if (typeof destination.host !== 'string' || typeof destination.port !== 'number') { + return callback( + new MongoInvalidArgumentError('Can only make Socks5 connections to TCP hosts') + ); + } + + // Then, establish the Socks5 proxy connection: + SocksClient.createConnection( + { + existing_socket: rawSocket, + timeout: options.connectTimeoutMS, + command: 'connect', + destination: { + host: destination.host, + port: destination.port + }, + proxy: { + // host and port are ignored because we pass existing_socket + host: 'iLoveJavaScript', + port: 0, + type: 5, + userId: options.proxyUsername || undefined, + password: options.proxyPassword || undefined + } + }, + (err: AnyError, info: { socket: Stream }) => { + if (err) { + return callback(connectionFailureError('error', err)); + } + + // Finally, now treat the resulting duplex stream as the + // socket over which we send and receive wire protocol messages: + makeConnection( + { + ...options, + existingSocket: info.socket, + proxyHost: undefined + }, + callback + ); + } + ); + } + ); +} + +function connectionFailureError(type: ErrorHandlerEventName, err: Error) { + switch (type) { + case 'error': + return new MongoNetworkError(err); + case 'timeout': + return new MongoNetworkTimeoutError('connection timed out'); + case 'close': + return new MongoNetworkError('connection closed'); + case 'cancel': + return new MongoNetworkError('connection establishment was cancelled'); + default: + return new MongoNetworkError('unknown network error'); + } +} diff --git a/node_modules/mongodb/src/cmap/connection.ts b/node_modules/mongodb/src/cmap/connection.ts new file mode 100644 index 000000000..4140cad63 --- /dev/null +++ b/node_modules/mongodb/src/cmap/connection.ts @@ -0,0 +1,864 @@ +import { setTimeout } from 'timers'; + +import { BSONSerializeOptions, Document, Long, ObjectId, pluckBSONSerializeOptions } from '../bson'; +import { + CLOSE, + CLUSTER_TIME_RECEIVED, + COMMAND_FAILED, + COMMAND_STARTED, + COMMAND_SUCCEEDED, + MESSAGE, + PINNED, + UNPINNED +} from '../constants'; +import type { AutoEncrypter } from '../deps'; +import { + MongoCompatibilityError, + MongoMissingDependencyError, + MongoNetworkError, + MongoNetworkTimeoutError, + MongoRuntimeError, + MongoServerError, + MongoWriteConcernError +} from '../error'; +import type { ServerApi, SupportedNodeConnectionOptions } from '../mongo_client'; +import { CancellationToken, TypedEventEmitter } from '../mongo_types'; +import type { ReadPreference, ReadPreferenceLike } from '../read_preference'; +import { applySession, ClientSession, updateSessionFromResponse } from '../sessions'; +import { + calculateDurationInMs, + Callback, + ClientMetadata, + HostAddress, + maxWireVersion, + MongoDBNamespace, + now, + uuidV4 +} from '../utils'; +import type { WriteConcern } from '../write_concern'; +import type { MongoCredentials } from './auth/mongo_credentials'; +import { + CommandFailedEvent, + CommandStartedEvent, + CommandSucceededEvent +} from './command_monitoring_events'; +import { + BinMsg, + GetMore, + KillCursor, + Msg, + Query, + Response, + WriteProtocolMessageType +} from './commands'; +import type { Stream } from './connect'; +import { MessageStream, OperationDescription } from './message_stream'; +import { StreamDescription, StreamDescriptionOptions } from './stream_description'; +import { applyCommonQueryOptions, getReadPreference, isSharded } from './wire_protocol/shared'; + +/** @internal */ +const kStream = Symbol('stream'); +/** @internal */ +const kQueue = Symbol('queue'); +/** @internal */ +const kMessageStream = Symbol('messageStream'); +/** @internal */ +const kGeneration = Symbol('generation'); +/** @internal */ +const kLastUseTime = Symbol('lastUseTime'); +/** @internal */ +const kClusterTime = Symbol('clusterTime'); +/** @internal */ +const kDescription = Symbol('description'); +/** @internal */ +const kHello = Symbol('hello'); +/** @internal */ +const kAutoEncrypter = Symbol('autoEncrypter'); +/** @internal */ +const kFullResult = Symbol('fullResult'); +/** @internal */ +const kDelayedTimeoutId = Symbol('delayedTimeoutId'); + +/** @internal */ +export interface QueryOptions extends BSONSerializeOptions { + readPreference: ReadPreference; + documentsReturnedIn?: string; + batchSize?: number; + limit?: number; + skip?: number; + projection?: Document; + tailable?: boolean; + awaitData?: boolean; + noCursorTimeout?: boolean; + /** @deprecated use `noCursorTimeout` instead */ + timeout?: boolean; + partial?: boolean; + oplogReplay?: boolean; +} + +/** @internal */ +export interface CommandOptions extends BSONSerializeOptions { + command?: boolean; + secondaryOk?: boolean; + /** Specify read preference if command supports it */ + readPreference?: ReadPreferenceLike; + raw?: boolean; + monitoring?: boolean; + [kFullResult]?: boolean; + socketTimeoutMS?: number; + /** Session to use for the operation */ + session?: ClientSession; + documentsReturnedIn?: string; + noResponse?: boolean; + omitReadPreference?: boolean; + + // TODO(NODE-2802): Currently the CommandOptions take a property willRetryWrite which is a hint + // from executeOperation that the txnNum should be applied to this command. + // Applying a session to a command should happen as part of command construction, + // most likely in the CommandOperation#executeCommand method, where we have access to + // the details we need to determine if a txnNum should also be applied. + willRetryWrite?: boolean; + + writeConcern?: WriteConcern; +} + +/** @internal */ +export interface GetMoreOptions extends CommandOptions { + batchSize?: number; + maxTimeMS?: number; + maxAwaitTimeMS?: number; + /** + * Comment to apply to the operation. + * + * In server versions pre-4.4, 'comment' must be string. A server + * error will be thrown if any other type is provided. + * + * In server versions 4.4 and above, 'comment' can be any valid BSON type. + */ + comment?: unknown; +} + +/** @public */ +export interface ProxyOptions { + proxyHost?: string; + proxyPort?: number; + proxyUsername?: string; + proxyPassword?: string; +} + +/** @public */ +export interface ConnectionOptions + extends SupportedNodeConnectionOptions, + StreamDescriptionOptions, + ProxyOptions { + // Internal creation info + id: number | ''; + generation: number; + hostAddress: HostAddress; + // Settings + autoEncrypter?: AutoEncrypter; + serverApi?: ServerApi; + monitorCommands: boolean; + /** @internal */ + connectionType?: typeof Connection; + credentials?: MongoCredentials; + connectTimeoutMS?: number; + tls: boolean; + keepAlive?: boolean; + keepAliveInitialDelay?: number; + noDelay?: boolean; + socketTimeoutMS?: number; + cancellationToken?: CancellationToken; + + metadata: ClientMetadata; +} + +/** @public */ +export interface DestroyOptions { + /** Force the destruction. */ + force?: boolean; +} + +/** @public */ +export type ConnectionEvents = { + commandStarted(event: CommandStartedEvent): void; + commandSucceeded(event: CommandSucceededEvent): void; + commandFailed(event: CommandFailedEvent): void; + clusterTimeReceived(clusterTime: Document): void; + close(): void; + message(message: any): void; + pinned(pinType: string): void; + unpinned(pinType: string): void; +}; + +/** @internal */ +export class Connection extends TypedEventEmitter { + id: number | ''; + address: string; + socketTimeoutMS: number; + monitorCommands: boolean; + closed: boolean; + destroyed: boolean; + lastHelloMS?: number; + serverApi?: ServerApi; + helloOk?: boolean; + + /**@internal */ + [kDelayedTimeoutId]: NodeJS.Timeout | null; + /** @internal */ + [kDescription]: StreamDescription; + /** @internal */ + [kGeneration]: number; + /** @internal */ + [kLastUseTime]: number; + /** @internal */ + [kQueue]: Map; + /** @internal */ + [kMessageStream]: MessageStream; + /** @internal */ + [kStream]: Stream; + /** @internal */ + [kHello]: Document | null; + /** @internal */ + [kClusterTime]: Document | null; + + /** @event */ + static readonly COMMAND_STARTED = COMMAND_STARTED; + /** @event */ + static readonly COMMAND_SUCCEEDED = COMMAND_SUCCEEDED; + /** @event */ + static readonly COMMAND_FAILED = COMMAND_FAILED; + /** @event */ + static readonly CLUSTER_TIME_RECEIVED = CLUSTER_TIME_RECEIVED; + /** @event */ + static readonly CLOSE = CLOSE; + /** @event */ + static readonly MESSAGE = MESSAGE; + /** @event */ + static readonly PINNED = PINNED; + /** @event */ + static readonly UNPINNED = UNPINNED; + + constructor(stream: Stream, options: ConnectionOptions) { + super(); + this.id = options.id; + this.address = streamIdentifier(stream, options); + this.socketTimeoutMS = options.socketTimeoutMS ?? 0; + this.monitorCommands = options.monitorCommands; + this.serverApi = options.serverApi; + this.closed = false; + this.destroyed = false; + this[kHello] = null; + this[kClusterTime] = null; + + this[kDescription] = new StreamDescription(this.address, options); + this[kGeneration] = options.generation; + this[kLastUseTime] = now(); + + // setup parser stream and message handling + this[kQueue] = new Map(); + this[kMessageStream] = new MessageStream({ + ...options, + maxBsonMessageSize: this.hello?.maxBsonMessageSize + }); + this[kStream] = stream; + + this[kDelayedTimeoutId] = null; + + this[kMessageStream].on('message', message => this.onMessage(message)); + this[kMessageStream].on('error', error => this.onError(error)); + this[kStream].on('close', () => this.onClose()); + this[kStream].on('timeout', () => this.onTimeout()); + this[kStream].on('error', () => { + /* ignore errors, listen to `close` instead */ + }); + + // hook the message stream up to the passed in stream + this[kStream].pipe(this[kMessageStream]); + this[kMessageStream].pipe(this[kStream]); + } + + get description(): StreamDescription { + return this[kDescription]; + } + + get hello(): Document | null { + return this[kHello]; + } + + // the `connect` method stores the result of the handshake hello on the connection + set hello(response: Document | null) { + this[kDescription].receiveResponse(response); + this[kDescription] = Object.freeze(this[kDescription]); + + // TODO: remove this, and only use the `StreamDescription` in the future + this[kHello] = response; + } + + // Set the whether the message stream is for a monitoring connection. + set isMonitoringConnection(value: boolean) { + this[kMessageStream].isMonitoringConnection = value; + } + + get isMonitoringConnection(): boolean { + return this[kMessageStream].isMonitoringConnection; + } + + get serviceId(): ObjectId | undefined { + return this.hello?.serviceId; + } + + get loadBalanced(): boolean { + return this.description.loadBalanced; + } + + get generation(): number { + return this[kGeneration] || 0; + } + + set generation(generation: number) { + this[kGeneration] = generation; + } + + get idleTime(): number { + return calculateDurationInMs(this[kLastUseTime]); + } + + get clusterTime(): Document | null { + return this[kClusterTime]; + } + + get stream(): Stream { + return this[kStream]; + } + + markAvailable(): void { + this[kLastUseTime] = now(); + } + + onError(error: Error) { + if (this.closed) { + return; + } + + this[kStream].destroy(error); + + this.closed = true; + + for (const op of this[kQueue].values()) { + op.cb(error); + } + + this[kQueue].clear(); + this.emit(Connection.CLOSE); + } + + onClose() { + if (this.closed) { + return; + } + + this.closed = true; + + const message = `connection ${this.id} to ${this.address} closed`; + for (const op of this[kQueue].values()) { + op.cb(new MongoNetworkError(message)); + } + + this[kQueue].clear(); + this.emit(Connection.CLOSE); + } + + onTimeout() { + if (this.closed) { + return; + } + + this[kDelayedTimeoutId] = setTimeout(() => { + this[kStream].destroy(); + + this.closed = true; + + const message = `connection ${this.id} to ${this.address} timed out`; + const beforeHandshake = this.hello == null; + for (const op of this[kQueue].values()) { + op.cb(new MongoNetworkTimeoutError(message, { beforeHandshake })); + } + + this[kQueue].clear(); + this.emit(Connection.CLOSE); + }, 1).unref(); // No need for this timer to hold the event loop open + } + + onMessage(message: BinMsg | Response) { + const delayedTimeoutId = this[kDelayedTimeoutId]; + if (delayedTimeoutId != null) { + clearTimeout(delayedTimeoutId); + this[kDelayedTimeoutId] = null; + } + + // always emit the message, in case we are streaming + this.emit('message', message); + const operationDescription = this[kQueue].get(message.responseTo); + if (!operationDescription) { + return; + } + + const callback = operationDescription.cb; + + // SERVER-45775: For exhaust responses we should be able to use the same requestId to + // track response, however the server currently synthetically produces remote requests + // making the `responseTo` change on each response + this[kQueue].delete(message.responseTo); + if ('moreToCome' in message && message.moreToCome) { + // requeue the callback for next synthetic request + this[kQueue].set(message.requestId, operationDescription); + } else if (operationDescription.socketTimeoutOverride) { + this[kStream].setTimeout(this.socketTimeoutMS); + } + + try { + // Pass in the entire description because it has BSON parsing options + message.parse(operationDescription); + } catch (err) { + // If this error is generated by our own code, it will already have the correct class applied + // if it is not, then it is coming from a catastrophic data parse failure or the BSON library + // in either case, it should not be wrapped + callback(err); + return; + } + + if (message.documents[0]) { + const document: Document = message.documents[0]; + const session = operationDescription.session; + if (session) { + updateSessionFromResponse(session, document); + } + + if (document.$clusterTime) { + this[kClusterTime] = document.$clusterTime; + this.emit(Connection.CLUSTER_TIME_RECEIVED, document.$clusterTime); + } + + if (operationDescription.command) { + if (document.writeConcernError) { + callback(new MongoWriteConcernError(document.writeConcernError, document)); + return; + } + + if (document.ok === 0 || document.$err || document.errmsg || document.code) { + callback(new MongoServerError(document)); + return; + } + } else { + // Pre 3.2 support + if (document.ok === 0 || document.$err || document.errmsg) { + callback(new MongoServerError(document)); + return; + } + } + } + + callback(undefined, operationDescription.fullResult ? message : message.documents[0]); + } + + destroy(options?: DestroyOptions, callback?: Callback): void { + if (typeof options === 'function') { + callback = options; + options = { force: false }; + } + + this.removeAllListeners(Connection.PINNED); + this.removeAllListeners(Connection.UNPINNED); + + options = Object.assign({ force: false }, options); + if (this[kStream] == null || this.destroyed) { + this.destroyed = true; + if (typeof callback === 'function') { + callback(); + } + + return; + } + + if (options.force) { + this[kStream].destroy(); + this.destroyed = true; + if (typeof callback === 'function') { + callback(); + } + + return; + } + + this[kStream].end(() => { + this.destroyed = true; + if (typeof callback === 'function') { + callback(); + } + }); + } + + command( + ns: MongoDBNamespace, + cmd: Document, + options: CommandOptions | undefined, + callback: Callback + ): void { + if (!(ns instanceof MongoDBNamespace)) { + // TODO(NODE-3483): Replace this with a MongoCommandError + throw new MongoRuntimeError('Must provide a MongoDBNamespace instance'); + } + + const readPreference = getReadPreference(cmd, options); + const shouldUseOpMsg = supportsOpMsg(this); + const session = options?.session; + + let clusterTime = this.clusterTime; + let finalCmd = Object.assign({}, cmd); + + if (this.serverApi) { + const { version, strict, deprecationErrors } = this.serverApi; + finalCmd.apiVersion = version; + if (strict != null) finalCmd.apiStrict = strict; + if (deprecationErrors != null) finalCmd.apiDeprecationErrors = deprecationErrors; + } + + if (hasSessionSupport(this) && session) { + if ( + session.clusterTime && + clusterTime && + session.clusterTime.clusterTime.greaterThan(clusterTime.clusterTime) + ) { + clusterTime = session.clusterTime; + } + + const err = applySession(session, finalCmd, options as CommandOptions); + if (err) { + return callback(err); + } + } + + // if we have a known cluster time, gossip it + if (clusterTime) { + finalCmd.$clusterTime = clusterTime; + } + + if (isSharded(this) && !shouldUseOpMsg && readPreference && readPreference.mode !== 'primary') { + finalCmd = { + $query: finalCmd, + $readPreference: readPreference.toJSON() + }; + } + + const commandOptions: Document = Object.assign( + { + command: true, + numberToSkip: 0, + numberToReturn: -1, + checkKeys: false, + // This value is not overridable + secondaryOk: readPreference.secondaryOk() + }, + options + ); + + const cmdNs = `${ns.db}.$cmd`; + const message = shouldUseOpMsg + ? new Msg(cmdNs, finalCmd, commandOptions) + : new Query(cmdNs, finalCmd, commandOptions); + + try { + write(this, message, commandOptions, callback); + } catch (err) { + callback(err); + } + } + + getMore( + ns: MongoDBNamespace, + cursorId: Long, + options: GetMoreOptions, + callback: Callback + ): void { + const fullResult = !!options[kFullResult]; + const wireVersion = maxWireVersion(this); + if (!cursorId) { + // TODO(NODE-3483): Replace this with a MongoCommandError + callback(new MongoRuntimeError('Invalid internal cursor state, no known cursor id')); + return; + } + + if (wireVersion < 4) { + const getMoreOp = new GetMore(ns.toString(), cursorId, { numberToReturn: options.batchSize }); + const queryOptions = applyCommonQueryOptions( + {}, + Object.assign(options, { ...pluckBSONSerializeOptions(options) }) + ); + + queryOptions[kFullResult] = true; + queryOptions.command = true; + write(this, getMoreOp, queryOptions, (err, response) => { + if (fullResult) return callback(err, response); + if (err) return callback(err); + callback(undefined, { cursor: { id: response.cursorId, nextBatch: response.documents } }); + }); + + return; + } + + const getMoreCmd: Document = { + getMore: cursorId, + collection: ns.collection + }; + + if (typeof options.batchSize === 'number') { + getMoreCmd.batchSize = Math.abs(options.batchSize); + } + + if (typeof options.maxAwaitTimeMS === 'number') { + getMoreCmd.maxTimeMS = options.maxAwaitTimeMS; + } + // we check for undefined specifically here to allow falsy values + // eslint-disable-next-line no-restricted-syntax + if (options.comment !== undefined) { + getMoreCmd.comment = options.comment; + } + + const commandOptions = Object.assign( + { + returnFieldSelector: null, + documentsReturnedIn: 'nextBatch' + }, + options + ); + + this.command(ns, getMoreCmd, commandOptions, callback); + } + + killCursors( + ns: MongoDBNamespace, + cursorIds: Long[], + options: CommandOptions, + callback: Callback + ): void { + if (!cursorIds || !Array.isArray(cursorIds)) { + // TODO(NODE-3483): Replace this with a MongoCommandError + throw new MongoRuntimeError(`Invalid list of cursor ids provided: ${cursorIds}`); + } + + if (maxWireVersion(this) < 4) { + try { + write( + this, + new KillCursor(ns.toString(), cursorIds), + { noResponse: true, ...options }, + callback + ); + } catch (err) { + callback(err); + } + + return; + } + + this.command( + ns, + { killCursors: ns.collection, cursors: cursorIds }, + { [kFullResult]: true, ...options }, + (err, response) => { + if (err || !response) return callback(err); + if (response.cursorNotFound) { + return callback(new MongoNetworkError('cursor killed or timed out'), null); + } + + if (!Array.isArray(response.documents) || response.documents.length === 0) { + return callback( + // TODO(NODE-3483) + new MongoRuntimeError( + `invalid killCursors result returned for cursor id ${cursorIds[0]}` + ) + ); + } + + callback(undefined, response.documents[0]); + } + ); + } +} + +/** @internal */ +export class CryptoConnection extends Connection { + /** @internal */ + [kAutoEncrypter]?: AutoEncrypter; + + constructor(stream: Stream, options: ConnectionOptions) { + super(stream, options); + this[kAutoEncrypter] = options.autoEncrypter; + } + + /** @internal @override */ + override command( + ns: MongoDBNamespace, + cmd: Document, + options: CommandOptions, + callback: Callback + ): void { + const autoEncrypter = this[kAutoEncrypter]; + if (!autoEncrypter) { + return callback(new MongoMissingDependencyError('No AutoEncrypter available for encryption')); + } + + const serverWireVersion = maxWireVersion(this); + if (serverWireVersion === 0) { + // This means the initial handshake hasn't happened yet + return super.command(ns, cmd, options, callback); + } + + if (serverWireVersion < 8) { + callback( + new MongoCompatibilityError('Auto-encryption requires a minimum MongoDB version of 4.2') + ); + return; + } + + autoEncrypter.encrypt(ns.toString(), cmd, options, (err, encrypted) => { + if (err || encrypted == null) { + callback(err, null); + return; + } + + super.command(ns, encrypted, options, (err, response) => { + if (err || response == null) { + callback(err, response); + return; + } + + autoEncrypter.decrypt(response, options, callback); + }); + }); + } +} + +/** @internal */ +export function hasSessionSupport(conn: Connection): boolean { + const description = conn.description; + return description.logicalSessionTimeoutMinutes != null || !!description.loadBalanced; +} + +function supportsOpMsg(conn: Connection) { + const description = conn.description; + if (description == null) { + return false; + } + + return maxWireVersion(conn) >= 6 && !description.__nodejs_mock_server__; +} + +function streamIdentifier(stream: Stream, options: ConnectionOptions): string { + if (options.proxyHost) { + // If proxy options are specified, the properties of `stream` itself + // will not accurately reflect what endpoint this is connected to. + return options.hostAddress.toString(); + } + + if (typeof stream.address === 'function') { + return `${stream.remoteAddress}:${stream.remotePort}`; + } + + return uuidV4().toString('hex'); +} + +function write( + conn: Connection, + command: WriteProtocolMessageType, + options: CommandOptions, + callback: Callback +) { + if (typeof options === 'function') { + callback = options; + } + + options = options ?? {}; + const operationDescription: OperationDescription = { + requestId: command.requestId, + cb: callback, + session: options.session, + fullResult: !!options[kFullResult], + noResponse: typeof options.noResponse === 'boolean' ? options.noResponse : false, + documentsReturnedIn: options.documentsReturnedIn, + command: !!options.command, + + // for BSON parsing + promoteLongs: typeof options.promoteLongs === 'boolean' ? options.promoteLongs : true, + promoteValues: typeof options.promoteValues === 'boolean' ? options.promoteValues : true, + promoteBuffers: typeof options.promoteBuffers === 'boolean' ? options.promoteBuffers : false, + bsonRegExp: typeof options.bsonRegExp === 'boolean' ? options.bsonRegExp : false, + enableUtf8Validation: + typeof options.enableUtf8Validation === 'boolean' ? options.enableUtf8Validation : true, + raw: typeof options.raw === 'boolean' ? options.raw : false, + started: 0 + }; + + if (conn[kDescription] && conn[kDescription].compressor) { + operationDescription.agreedCompressor = conn[kDescription].compressor; + + if (conn[kDescription].zlibCompressionLevel) { + operationDescription.zlibCompressionLevel = conn[kDescription].zlibCompressionLevel; + } + } + + if (typeof options.socketTimeoutMS === 'number') { + operationDescription.socketTimeoutOverride = true; + conn[kStream].setTimeout(options.socketTimeoutMS); + } + + // if command monitoring is enabled we need to modify the callback here + if (conn.monitorCommands) { + conn.emit(Connection.COMMAND_STARTED, new CommandStartedEvent(conn, command)); + + operationDescription.started = now(); + operationDescription.cb = (err, reply) => { + if (err) { + conn.emit( + Connection.COMMAND_FAILED, + new CommandFailedEvent(conn, command, err, operationDescription.started) + ); + } else { + if (reply && (reply.ok === 0 || reply.$err)) { + conn.emit( + Connection.COMMAND_FAILED, + new CommandFailedEvent(conn, command, reply, operationDescription.started) + ); + } else { + conn.emit( + Connection.COMMAND_SUCCEEDED, + new CommandSucceededEvent(conn, command, reply, operationDescription.started) + ); + } + } + + if (typeof callback === 'function') { + callback(err, reply); + } + }; + } + + if (!operationDescription.noResponse) { + conn[kQueue].set(operationDescription.requestId, operationDescription); + } + + try { + conn[kMessageStream].writeCommand(command, operationDescription); + } catch (e) { + if (!operationDescription.noResponse) { + conn[kQueue].delete(operationDescription.requestId); + operationDescription.cb(e); + return; + } + } + + if (operationDescription.noResponse) { + operationDescription.cb(); + } +} diff --git a/node_modules/mongodb/src/cmap/connection_pool.ts b/node_modules/mongodb/src/cmap/connection_pool.ts new file mode 100644 index 000000000..e8888ccc5 --- /dev/null +++ b/node_modules/mongodb/src/cmap/connection_pool.ts @@ -0,0 +1,708 @@ +import Denque = require('denque'); +import { setTimeout } from 'timers'; + +import type { ObjectId } from '../bson'; +import { + APM_EVENTS, + CONNECTION_CHECK_OUT_FAILED, + CONNECTION_CHECK_OUT_STARTED, + CONNECTION_CHECKED_IN, + CONNECTION_CHECKED_OUT, + CONNECTION_CLOSED, + CONNECTION_CREATED, + CONNECTION_POOL_CLEARED, + CONNECTION_POOL_CLOSED, + CONNECTION_POOL_CREATED, + CONNECTION_READY +} from '../constants'; +import { MongoError, MongoInvalidArgumentError, MongoRuntimeError } from '../error'; +import { Logger } from '../logger'; +import { CancellationToken, TypedEventEmitter } from '../mongo_types'; +import { Callback, eachAsync, makeCounter } from '../utils'; +import { connect } from './connect'; +import { Connection, ConnectionEvents, ConnectionOptions } from './connection'; +import { + ConnectionCheckedInEvent, + ConnectionCheckedOutEvent, + ConnectionCheckOutFailedEvent, + ConnectionCheckOutStartedEvent, + ConnectionClosedEvent, + ConnectionCreatedEvent, + ConnectionPoolClearedEvent, + ConnectionPoolClosedEvent, + ConnectionPoolCreatedEvent, + ConnectionReadyEvent +} from './connection_pool_events'; +import { PoolClosedError, WaitQueueTimeoutError } from './errors'; +import { ConnectionPoolMetrics } from './metrics'; + +/** @internal */ +const kLogger = Symbol('logger'); +/** @internal */ +const kConnections = Symbol('connections'); +/** @internal */ +const kPending = Symbol('pending'); +/** @internal */ +const kCheckedOut = Symbol('checkedOut'); +/** @internal */ +const kMinPoolSizeTimer = Symbol('minPoolSizeTimer'); +/** @internal */ +const kGeneration = Symbol('generation'); +/** @internal */ +const kServiceGenerations = Symbol('serviceGenerations'); +/** @internal */ +const kConnectionCounter = Symbol('connectionCounter'); +/** @internal */ +const kCancellationToken = Symbol('cancellationToken'); +/** @internal */ +const kWaitQueue = Symbol('waitQueue'); +/** @internal */ +const kCancelled = Symbol('cancelled'); +/** @internal */ +const kMetrics = Symbol('metrics'); +/** @internal */ +const kProcessingWaitQueue = Symbol('processingWaitQueue'); + +/** @public */ +export interface ConnectionPoolOptions extends Omit { + /** The maximum number of connections that may be associated with a pool at a given time. This includes in use and available connections. */ + maxPoolSize: number; + /** The minimum number of connections that MUST exist at any moment in a single connection pool. */ + minPoolSize: number; + /** The maximum number of connections that may be in the process of being established concurrently by the connection pool. */ + maxConnecting: number; + /** The maximum amount of time a connection should remain idle in the connection pool before being marked idle. */ + maxIdleTimeMS: number; + /** The maximum amount of time operation execution should wait for a connection to become available. The default is 0 which means there is no limit. */ + waitQueueTimeoutMS: number; + /** If we are in load balancer mode. */ + loadBalanced: boolean; +} + +/** @internal */ +export interface WaitQueueMember { + callback: Callback; + timer?: NodeJS.Timeout; + [kCancelled]?: boolean; +} + +/** @public */ +export interface CloseOptions { + force?: boolean; +} + +/** @public */ +export type ConnectionPoolEvents = { + connectionPoolCreated(event: ConnectionPoolCreatedEvent): void; + connectionPoolClosed(event: ConnectionPoolClosedEvent): void; + connectionPoolCleared(event: ConnectionPoolClearedEvent): void; + connectionCreated(event: ConnectionCreatedEvent): void; + connectionReady(event: ConnectionReadyEvent): void; + connectionClosed(event: ConnectionClosedEvent): void; + connectionCheckOutStarted(event: ConnectionCheckOutStartedEvent): void; + connectionCheckOutFailed(event: ConnectionCheckOutFailedEvent): void; + connectionCheckedOut(event: ConnectionCheckedOutEvent): void; + connectionCheckedIn(event: ConnectionCheckedInEvent): void; +} & Omit; + +/** + * A pool of connections which dynamically resizes, and emit events related to pool activity + * @internal + */ +export class ConnectionPool extends TypedEventEmitter { + closed: boolean; + options: Readonly; + /** @internal */ + [kLogger]: Logger; + /** @internal */ + [kConnections]: Denque; + /** @internal */ + [kPending]: number; + /** @internal */ + [kCheckedOut]: number; + /** @internal */ + [kMinPoolSizeTimer]?: NodeJS.Timeout; + /** + * An integer representing the SDAM generation of the pool + * @internal + */ + [kGeneration]: number; + /** A map of generations to service ids + * @internal + */ + [kServiceGenerations]: Map; + /** @internal */ + [kConnectionCounter]: Generator; + /** @internal */ + [kCancellationToken]: CancellationToken; + /** @internal */ + [kWaitQueue]: Denque; + /** @internal */ + [kMetrics]: ConnectionPoolMetrics; + /** @internal */ + [kProcessingWaitQueue]: boolean; + + /** + * Emitted when the connection pool is created. + * @event + */ + static readonly CONNECTION_POOL_CREATED = CONNECTION_POOL_CREATED; + /** + * Emitted once when the connection pool is closed + * @event + */ + static readonly CONNECTION_POOL_CLOSED = CONNECTION_POOL_CLOSED; + /** + * Emitted each time the connection pool is cleared and it's generation incremented + * @event + */ + static readonly CONNECTION_POOL_CLEARED = CONNECTION_POOL_CLEARED; + /** + * Emitted when a connection is created. + * @event + */ + static readonly CONNECTION_CREATED = CONNECTION_CREATED; + /** + * Emitted when a connection becomes established, and is ready to use + * @event + */ + static readonly CONNECTION_READY = CONNECTION_READY; + /** + * Emitted when a connection is closed + * @event + */ + static readonly CONNECTION_CLOSED = CONNECTION_CLOSED; + /** + * Emitted when an attempt to check out a connection begins + * @event + */ + static readonly CONNECTION_CHECK_OUT_STARTED = CONNECTION_CHECK_OUT_STARTED; + /** + * Emitted when an attempt to check out a connection fails + * @event + */ + static readonly CONNECTION_CHECK_OUT_FAILED = CONNECTION_CHECK_OUT_FAILED; + /** + * Emitted each time a connection is successfully checked out of the connection pool + * @event + */ + static readonly CONNECTION_CHECKED_OUT = CONNECTION_CHECKED_OUT; + /** + * Emitted each time a connection is successfully checked into the connection pool + * @event + */ + static readonly CONNECTION_CHECKED_IN = CONNECTION_CHECKED_IN; + + /** @internal */ + constructor(options: ConnectionPoolOptions) { + super(); + + this.closed = false; + this.options = Object.freeze({ + ...options, + connectionType: Connection, + maxPoolSize: options.maxPoolSize ?? 100, + minPoolSize: options.minPoolSize ?? 0, + maxConnecting: options.maxConnecting ?? 2, + maxIdleTimeMS: options.maxIdleTimeMS ?? 0, + waitQueueTimeoutMS: options.waitQueueTimeoutMS ?? 0, + autoEncrypter: options.autoEncrypter, + metadata: options.metadata + }); + + if (this.options.minPoolSize > this.options.maxPoolSize) { + throw new MongoInvalidArgumentError( + 'Connection pool minimum size must not be greater than maximum pool size' + ); + } + + this[kLogger] = new Logger('ConnectionPool'); + this[kConnections] = new Denque(); + this[kPending] = 0; + this[kCheckedOut] = 0; + this[kMinPoolSizeTimer] = undefined; + this[kGeneration] = 0; + this[kServiceGenerations] = new Map(); + this[kConnectionCounter] = makeCounter(1); + this[kCancellationToken] = new CancellationToken(); + this[kCancellationToken].setMaxListeners(Infinity); + this[kWaitQueue] = new Denque(); + this[kMetrics] = new ConnectionPoolMetrics(); + this[kProcessingWaitQueue] = false; + + process.nextTick(() => { + this.emit(ConnectionPool.CONNECTION_POOL_CREATED, new ConnectionPoolCreatedEvent(this)); + ensureMinPoolSize(this); + }); + } + + /** The address of the endpoint the pool is connected to */ + get address(): string { + return this.options.hostAddress.toString(); + } + + /** An integer representing the SDAM generation of the pool */ + get generation(): number { + return this[kGeneration]; + } + + /** An integer expressing how many total connections (available + pending + in use) the pool currently has */ + get totalConnectionCount(): number { + return ( + this.availableConnectionCount + this.pendingConnectionCount + this.currentCheckedOutCount + ); + } + + /** An integer expressing how many connections are currently available in the pool. */ + get availableConnectionCount(): number { + return this[kConnections].length; + } + + get pendingConnectionCount(): number { + return this[kPending]; + } + + get currentCheckedOutCount(): number { + return this[kCheckedOut]; + } + + get waitQueueSize(): number { + return this[kWaitQueue].length; + } + + get loadBalanced(): boolean { + return this.options.loadBalanced; + } + + get serviceGenerations(): Map { + return this[kServiceGenerations]; + } + + /** + * Get the metrics information for the pool when a wait queue timeout occurs. + */ + private waitQueueErrorMetrics(): string { + return this[kMetrics].info(this.options.maxPoolSize); + } + + /** + * Check a connection out of this pool. The connection will continue to be tracked, but no reference to it + * will be held by the pool. This means that if a connection is checked out it MUST be checked back in or + * explicitly destroyed by the new owner. + */ + checkOut(callback: Callback): void { + this.emit( + ConnectionPool.CONNECTION_CHECK_OUT_STARTED, + new ConnectionCheckOutStartedEvent(this) + ); + + if (this.closed) { + this.emit( + ConnectionPool.CONNECTION_CHECK_OUT_FAILED, + new ConnectionCheckOutFailedEvent(this, 'poolClosed') + ); + callback(new PoolClosedError(this)); + return; + } + + const waitQueueMember: WaitQueueMember = { callback }; + const waitQueueTimeoutMS = this.options.waitQueueTimeoutMS; + if (waitQueueTimeoutMS) { + waitQueueMember.timer = setTimeout(() => { + waitQueueMember[kCancelled] = true; + waitQueueMember.timer = undefined; + + this.emit( + ConnectionPool.CONNECTION_CHECK_OUT_FAILED, + new ConnectionCheckOutFailedEvent(this, 'timeout') + ); + waitQueueMember.callback( + new WaitQueueTimeoutError( + this.loadBalanced + ? this.waitQueueErrorMetrics() + : 'Timed out while checking out a connection from connection pool', + this.address + ) + ); + }, waitQueueTimeoutMS); + } + + this[kWaitQueue].push(waitQueueMember); + process.nextTick(processWaitQueue, this); + } + + /** + * Check a connection into the pool. + * + * @param connection - The connection to check in + */ + checkIn(connection: Connection): void { + const poolClosed = this.closed; + const stale = connectionIsStale(this, connection); + const willDestroy = !!(poolClosed || stale || connection.closed); + + if (!willDestroy) { + connection.markAvailable(); + this[kConnections].unshift(connection); + } + + this[kCheckedOut]--; + this.emit(ConnectionPool.CONNECTION_CHECKED_IN, new ConnectionCheckedInEvent(this, connection)); + + if (willDestroy) { + const reason = connection.closed ? 'error' : poolClosed ? 'poolClosed' : 'stale'; + destroyConnection(this, connection, reason); + } + + process.nextTick(processWaitQueue, this); + } + + /** + * Clear the pool + * + * Pool reset is handled by incrementing the pool's generation count. Any existing connection of a + * previous generation will eventually be pruned during subsequent checkouts. + */ + clear(serviceId?: ObjectId): void { + if (this.loadBalanced && serviceId) { + const sid = serviceId.toHexString(); + const generation = this.serviceGenerations.get(sid); + // Only need to worry if the generation exists, since it should + // always be there but typescript needs the check. + if (generation == null) { + // TODO(NODE-3483) + throw new MongoRuntimeError('Service generations are required in load balancer mode.'); + } else { + // Increment the generation for the service id. + this.serviceGenerations.set(sid, generation + 1); + } + } else { + this[kGeneration] += 1; + } + + this.emit('connectionPoolCleared', new ConnectionPoolClearedEvent(this, serviceId)); + } + + /** Close the pool */ + close(callback: Callback): void; + close(options: CloseOptions, callback: Callback): void; + close(_options?: CloseOptions | Callback, _cb?: Callback): void { + let options = _options as CloseOptions; + const callback = (_cb ?? _options) as Callback; + if (typeof options === 'function') { + options = {}; + } + + options = Object.assign({ force: false }, options); + if (this.closed) { + return callback(); + } + + // immediately cancel any in-flight connections + this[kCancellationToken].emit('cancel'); + + // drain the wait queue + while (this.waitQueueSize) { + const waitQueueMember = this[kWaitQueue].pop(); + if (waitQueueMember) { + if (waitQueueMember.timer) { + clearTimeout(waitQueueMember.timer); + } + if (!waitQueueMember[kCancelled]) { + // TODO(NODE-3483): Replace with MongoConnectionPoolClosedError + waitQueueMember.callback(new MongoRuntimeError('Connection pool closed')); + } + } + } + + // clear the min pool size timer + const minPoolSizeTimer = this[kMinPoolSizeTimer]; + if (minPoolSizeTimer) { + clearTimeout(minPoolSizeTimer); + } + + // end the connection counter + if (typeof this[kConnectionCounter].return === 'function') { + this[kConnectionCounter].return(undefined); + } + + // mark the pool as closed immediately + this.closed = true; + eachAsync( + this[kConnections].toArray(), + (conn, cb) => { + this.emit( + ConnectionPool.CONNECTION_CLOSED, + new ConnectionClosedEvent(this, conn, 'poolClosed') + ); + conn.destroy(options, cb); + }, + err => { + this[kConnections].clear(); + this.emit(ConnectionPool.CONNECTION_POOL_CLOSED, new ConnectionPoolClosedEvent(this)); + callback(err); + } + ); + } + + /** + * Runs a lambda with an implicitly checked out connection, checking that connection back in when the lambda + * has completed by calling back. + * + * NOTE: please note the required signature of `fn` + * + * @remarks When in load balancer mode, connections can be pinned to cursors or transactions. + * In these cases we pass the connection in to this method to ensure it is used and a new + * connection is not checked out. + * + * @param conn - A pinned connection for use in load balancing mode. + * @param fn - A function which operates on a managed connection + * @param callback - The original callback + */ + withConnection( + conn: Connection | undefined, + fn: WithConnectionCallback, + callback?: Callback + ): void { + if (conn) { + // use the provided connection, and do _not_ check it in after execution + fn(undefined, conn, (fnErr, result) => { + if (typeof callback === 'function') { + if (fnErr) { + callback(fnErr); + } else { + callback(undefined, result); + } + } + }); + + return; + } + + this.checkOut((err, conn) => { + // don't callback with `err` here, we might want to act upon it inside `fn` + fn(err as MongoError, conn, (fnErr, result) => { + if (typeof callback === 'function') { + if (fnErr) { + callback(fnErr); + } else { + callback(undefined, result); + } + } + + if (conn) { + this.checkIn(conn); + } + }); + }); + } +} + +function ensureMinPoolSize(pool: ConnectionPool) { + const minPoolSize = pool.options.minPoolSize; + if (pool.closed || minPoolSize === 0) { + return; + } + + if ( + pool.totalConnectionCount < minPoolSize && + pool.pendingConnectionCount < pool.options.maxConnecting + ) { + // NOTE: ensureMinPoolSize should not try to get all the pending + // connection permits because that potentially delays the availability of + // the connection to a checkout request + createConnection(pool, (err, connection) => { + pool[kPending]--; + if (!err && connection) { + pool[kConnections].push(connection); + process.nextTick(processWaitQueue, pool); + } + pool[kMinPoolSizeTimer] = setTimeout(() => ensureMinPoolSize(pool), 10); + }); + } else { + pool[kMinPoolSizeTimer] = setTimeout(() => ensureMinPoolSize(pool), 100); + } +} + +function connectionIsStale(pool: ConnectionPool, connection: Connection) { + const serviceId = connection.serviceId; + if (pool.loadBalanced && serviceId) { + const sid = serviceId.toHexString(); + const generation = pool.serviceGenerations.get(sid); + return connection.generation !== generation; + } + + return connection.generation !== pool[kGeneration]; +} + +function connectionIsIdle(pool: ConnectionPool, connection: Connection) { + return !!(pool.options.maxIdleTimeMS && connection.idleTime > pool.options.maxIdleTimeMS); +} + +function createConnection(pool: ConnectionPool, callback: Callback) { + const connectOptions: ConnectionOptions = { + ...pool.options, + id: pool[kConnectionCounter].next().value, + generation: pool[kGeneration], + cancellationToken: pool[kCancellationToken] + }; + + pool[kPending]++; + // This is our version of a "virtual" no-I/O connection as the spec requires + pool.emit( + ConnectionPool.CONNECTION_CREATED, + new ConnectionCreatedEvent(pool, { id: connectOptions.id }) + ); + + connect(connectOptions, (err, connection) => { + if (err || !connection) { + pool[kLogger].debug(`connection attempt failed with error [${JSON.stringify(err)}]`); + callback(err); + return; + } + + // The pool might have closed since we started trying to create a connection + if (pool.closed) { + pool[kPending]--; + connection.destroy({ force: true }); + return; + } + + // forward all events from the connection to the pool + for (const event of [...APM_EVENTS, Connection.CLUSTER_TIME_RECEIVED]) { + connection.on(event, (e: any) => pool.emit(event, e)); + } + + if (pool.loadBalanced) { + connection.on(Connection.PINNED, pinType => pool[kMetrics].markPinned(pinType)); + connection.on(Connection.UNPINNED, pinType => pool[kMetrics].markUnpinned(pinType)); + + const serviceId = connection.serviceId; + if (serviceId) { + let generation; + const sid = serviceId.toHexString(); + if ((generation = pool.serviceGenerations.get(sid))) { + connection.generation = generation; + } else { + pool.serviceGenerations.set(sid, 0); + connection.generation = 0; + } + } + } + + connection.markAvailable(); + pool.emit(ConnectionPool.CONNECTION_READY, new ConnectionReadyEvent(pool, connection)); + + callback(undefined, connection); + return; + }); +} + +function destroyConnection(pool: ConnectionPool, connection: Connection, reason: string) { + pool.emit(ConnectionPool.CONNECTION_CLOSED, new ConnectionClosedEvent(pool, connection, reason)); + + // destroy the connection + process.nextTick(() => connection.destroy()); +} + +function processWaitQueue(pool: ConnectionPool) { + if (pool.closed || pool[kProcessingWaitQueue]) { + return; + } + + pool[kProcessingWaitQueue] = true; + while (pool.waitQueueSize) { + const waitQueueMember = pool[kWaitQueue].peekFront(); + if (!waitQueueMember) { + pool[kWaitQueue].shift(); + continue; + } + + if (waitQueueMember[kCancelled]) { + pool[kWaitQueue].shift(); + continue; + } + + if (!pool.availableConnectionCount) { + break; + } + + const connection = pool[kConnections].shift(); + if (!connection) { + break; + } + + const isStale = connectionIsStale(pool, connection); + const isIdle = connectionIsIdle(pool, connection); + if (!isStale && !isIdle && !connection.closed) { + pool[kCheckedOut]++; + pool.emit( + ConnectionPool.CONNECTION_CHECKED_OUT, + new ConnectionCheckedOutEvent(pool, connection) + ); + if (waitQueueMember.timer) { + clearTimeout(waitQueueMember.timer); + } + + pool[kWaitQueue].shift(); + waitQueueMember.callback(undefined, connection); + } else { + const reason = connection.closed ? 'error' : isStale ? 'stale' : 'idle'; + destroyConnection(pool, connection, reason); + } + } + + const { maxPoolSize, maxConnecting } = pool.options; + while ( + pool.waitQueueSize > 0 && + pool.pendingConnectionCount < maxConnecting && + (maxPoolSize === 0 || pool.totalConnectionCount < maxPoolSize) + ) { + const waitQueueMember = pool[kWaitQueue].shift(); + if (!waitQueueMember || waitQueueMember[kCancelled]) { + continue; + } + createConnection(pool, (err, connection) => { + pool[kPending]--; + if (waitQueueMember[kCancelled]) { + if (!err && connection) { + pool[kConnections].push(connection); + } + } else { + if (err) { + pool.emit( + ConnectionPool.CONNECTION_CHECK_OUT_FAILED, + new ConnectionCheckOutFailedEvent(pool, err) + ); + } else if (connection) { + pool[kCheckedOut]++; + pool.emit( + ConnectionPool.CONNECTION_CHECKED_OUT, + new ConnectionCheckedOutEvent(pool, connection) + ); + } + + if (waitQueueMember.timer) { + clearTimeout(waitQueueMember.timer); + } + waitQueueMember.callback(err, connection); + } + process.nextTick(processWaitQueue, pool); + }); + } + pool[kProcessingWaitQueue] = false; +} + +/** + * A callback provided to `withConnection` + * @internal + * + * @param error - An error instance representing the error during the execution. + * @param connection - The managed connection which was checked out of the pool. + * @param callback - A function to call back after connection management is complete + */ +export type WithConnectionCallback = ( + error: MongoError | undefined, + connection: Connection | undefined, + callback: Callback +) => void; diff --git a/node_modules/mongodb/src/cmap/connection_pool_events.ts b/node_modules/mongodb/src/cmap/connection_pool_events.ts new file mode 100644 index 000000000..a98dc25d7 --- /dev/null +++ b/node_modules/mongodb/src/cmap/connection_pool_events.ts @@ -0,0 +1,179 @@ +import type { ObjectId } from '../bson'; +import type { AnyError } from '../error'; +import type { Connection } from './connection'; +import type { ConnectionPool, ConnectionPoolOptions } from './connection_pool'; + +/** + * The base export class for all monitoring events published from the connection pool + * @public + * @category Event + */ +export class ConnectionPoolMonitoringEvent { + /** A timestamp when the event was created */ + time: Date; + /** The address (host/port pair) of the pool */ + address: string; + + /** @internal */ + constructor(pool: ConnectionPool) { + this.time = new Date(); + this.address = pool.address; + } +} + +/** + * An event published when a connection pool is created + * @public + * @category Event + */ +export class ConnectionPoolCreatedEvent extends ConnectionPoolMonitoringEvent { + /** The options used to create this connection pool */ + options?: ConnectionPoolOptions; + + /** @internal */ + constructor(pool: ConnectionPool) { + super(pool); + this.options = pool.options; + } +} + +/** + * An event published when a connection pool is closed + * @public + * @category Event + */ +export class ConnectionPoolClosedEvent extends ConnectionPoolMonitoringEvent { + /** @internal */ + constructor(pool: ConnectionPool) { + super(pool); + } +} + +/** + * An event published when a connection pool creates a new connection + * @public + * @category Event + */ +export class ConnectionCreatedEvent extends ConnectionPoolMonitoringEvent { + /** A monotonically increasing, per-pool id for the newly created connection */ + connectionId: number | ''; + + /** @internal */ + constructor(pool: ConnectionPool, connection: { id: number | '' }) { + super(pool); + this.connectionId = connection.id; + } +} + +/** + * An event published when a connection is ready for use + * @public + * @category Event + */ +export class ConnectionReadyEvent extends ConnectionPoolMonitoringEvent { + /** The id of the connection */ + connectionId: number | ''; + + /** @internal */ + constructor(pool: ConnectionPool, connection: Connection) { + super(pool); + this.connectionId = connection.id; + } +} + +/** + * An event published when a connection is closed + * @public + * @category Event + */ +export class ConnectionClosedEvent extends ConnectionPoolMonitoringEvent { + /** The id of the connection */ + connectionId: number | ''; + /** The reason the connection was closed */ + reason: string; + serviceId?: ObjectId; + + /** @internal */ + constructor(pool: ConnectionPool, connection: Connection, reason: string) { + super(pool); + this.connectionId = connection.id; + this.reason = reason || 'unknown'; + this.serviceId = connection.serviceId; + } +} + +/** + * An event published when a request to check a connection out begins + * @public + * @category Event + */ +export class ConnectionCheckOutStartedEvent extends ConnectionPoolMonitoringEvent { + /** @internal */ + constructor(pool: ConnectionPool) { + super(pool); + } +} + +/** + * An event published when a request to check a connection out fails + * @public + * @category Event + */ +export class ConnectionCheckOutFailedEvent extends ConnectionPoolMonitoringEvent { + /** The reason the attempt to check out failed */ + reason: AnyError | string; + + /** @internal */ + constructor(pool: ConnectionPool, reason: AnyError | string) { + super(pool); + this.reason = reason; + } +} + +/** + * An event published when a connection is checked out of the connection pool + * @public + * @category Event + */ +export class ConnectionCheckedOutEvent extends ConnectionPoolMonitoringEvent { + /** The id of the connection */ + connectionId: number | ''; + + /** @internal */ + constructor(pool: ConnectionPool, connection: Connection) { + super(pool); + this.connectionId = connection.id; + } +} + +/** + * An event published when a connection is checked into the connection pool + * @public + * @category Event + */ +export class ConnectionCheckedInEvent extends ConnectionPoolMonitoringEvent { + /** The id of the connection */ + connectionId: number | ''; + + /** @internal */ + constructor(pool: ConnectionPool, connection: Connection) { + super(pool); + this.connectionId = connection.id; + } +} + +/** + * An event published when a connection pool is cleared + * @public + * @category Event + */ +export class ConnectionPoolClearedEvent extends ConnectionPoolMonitoringEvent { + /** @internal */ + serviceId?: ObjectId; + + /** @internal */ + constructor(pool: ConnectionPool, serviceId?: ObjectId) { + super(pool); + this.serviceId = serviceId; + } +} diff --git a/node_modules/mongodb/src/cmap/errors.ts b/node_modules/mongodb/src/cmap/errors.ts new file mode 100644 index 000000000..85e8dac79 --- /dev/null +++ b/node_modules/mongodb/src/cmap/errors.ts @@ -0,0 +1,38 @@ +import { MongoDriverError } from '../error'; +import type { ConnectionPool } from './connection_pool'; + +/** + * An error indicating a connection pool is closed + * @category Error + */ +export class PoolClosedError extends MongoDriverError { + /** The address of the connection pool */ + address: string; + + constructor(pool: ConnectionPool) { + super('Attempted to check out a connection from closed connection pool'); + this.address = pool.address; + } + + override get name(): string { + return 'MongoPoolClosedError'; + } +} + +/** + * An error thrown when a request to check out a connection times out + * @category Error + */ +export class WaitQueueTimeoutError extends MongoDriverError { + /** The address of the connection pool */ + address: string; + + constructor(message: string, address: string) { + super(message); + this.address = address; + } + + override get name(): string { + return 'MongoWaitQueueTimeoutError'; + } +} diff --git a/node_modules/mongodb/src/cmap/message_stream.ts b/node_modules/mongodb/src/cmap/message_stream.ts new file mode 100644 index 000000000..542e35cf7 --- /dev/null +++ b/node_modules/mongodb/src/cmap/message_stream.ts @@ -0,0 +1,243 @@ +import { Duplex, DuplexOptions } from 'stream'; + +import type { BSONSerializeOptions, Document } from '../bson'; +import { MongoDecompressionError, MongoParseError } from '../error'; +import type { ClientSession } from '../sessions'; +import { BufferPool, Callback } from '../utils'; +import { BinMsg, MessageHeader, Msg, Query, Response, WriteProtocolMessageType } from './commands'; +import { + compress, + Compressor, + CompressorName, + decompress, + uncompressibleCommands +} from './wire_protocol/compression'; +import { OP_COMPRESSED, OP_MSG } from './wire_protocol/constants'; + +const MESSAGE_HEADER_SIZE = 16; +const COMPRESSION_DETAILS_SIZE = 9; // originalOpcode + uncompressedSize, compressorID + +const kDefaultMaxBsonMessageSize = 1024 * 1024 * 16 * 4; +/** @internal */ +const kBuffer = Symbol('buffer'); + +/** @internal */ +export interface MessageStreamOptions extends DuplexOptions { + maxBsonMessageSize?: number; +} + +/** @internal */ +export interface OperationDescription extends BSONSerializeOptions { + started: number; + cb: Callback; + command: boolean; + documentsReturnedIn?: string; + fullResult: boolean; + noResponse: boolean; + raw: boolean; + requestId: number; + session?: ClientSession; + socketTimeoutOverride?: boolean; + agreedCompressor?: CompressorName; + zlibCompressionLevel?: number; + $clusterTime?: Document; +} + +/** + * A duplex stream that is capable of reading and writing raw wire protocol messages, with + * support for optional compression + * @internal + */ +export class MessageStream extends Duplex { + /** @internal */ + maxBsonMessageSize: number; + /** @internal */ + [kBuffer]: BufferPool; + /** @internal */ + isMonitoringConnection = false; + + constructor(options: MessageStreamOptions = {}) { + super(options); + this.maxBsonMessageSize = options.maxBsonMessageSize || kDefaultMaxBsonMessageSize; + this[kBuffer] = new BufferPool(); + } + + get buffer(): BufferPool { + return this[kBuffer]; + } + + override _write(chunk: Buffer, _: unknown, callback: Callback): void { + this[kBuffer].append(chunk); + processIncomingData(this, callback); + } + + override _read(/* size */): void { + // NOTE: This implementation is empty because we explicitly push data to be read + // when `writeMessage` is called. + return; + } + + writeCommand( + command: WriteProtocolMessageType, + operationDescription: OperationDescription + ): void { + // TODO: agreed compressor should live in `StreamDescription` + const compressorName: CompressorName = + operationDescription && operationDescription.agreedCompressor + ? operationDescription.agreedCompressor + : 'none'; + if (compressorName === 'none' || !canCompress(command)) { + const data = command.toBin(); + this.push(Array.isArray(data) ? Buffer.concat(data) : data); + return; + } + // otherwise, compress the message + const concatenatedOriginalCommandBuffer = Buffer.concat(command.toBin()); + const messageToBeCompressed = concatenatedOriginalCommandBuffer.slice(MESSAGE_HEADER_SIZE); + + // Extract information needed for OP_COMPRESSED from the uncompressed message + const originalCommandOpCode = concatenatedOriginalCommandBuffer.readInt32LE(12); + + // Compress the message body + compress({ options: operationDescription }, messageToBeCompressed, (err, compressedMessage) => { + if (err || !compressedMessage) { + operationDescription.cb(err); + return; + } + + // Create the msgHeader of OP_COMPRESSED + const msgHeader = Buffer.alloc(MESSAGE_HEADER_SIZE); + msgHeader.writeInt32LE( + MESSAGE_HEADER_SIZE + COMPRESSION_DETAILS_SIZE + compressedMessage.length, + 0 + ); // messageLength + msgHeader.writeInt32LE(command.requestId, 4); // requestID + msgHeader.writeInt32LE(0, 8); // responseTo (zero) + msgHeader.writeInt32LE(OP_COMPRESSED, 12); // opCode + + // Create the compression details of OP_COMPRESSED + const compressionDetails = Buffer.alloc(COMPRESSION_DETAILS_SIZE); + compressionDetails.writeInt32LE(originalCommandOpCode, 0); // originalOpcode + compressionDetails.writeInt32LE(messageToBeCompressed.length, 4); // Size of the uncompressed compressedMessage, excluding the MsgHeader + compressionDetails.writeUInt8(Compressor[compressorName], 8); // compressorID + this.push(Buffer.concat([msgHeader, compressionDetails, compressedMessage])); + }); + } +} + +// Return whether a command contains an uncompressible command term +// Will return true if command contains no uncompressible command terms +function canCompress(command: WriteProtocolMessageType) { + const commandDoc = command instanceof Msg ? command.command : (command as Query).query; + const commandName = Object.keys(commandDoc)[0]; + return !uncompressibleCommands.has(commandName); +} + +function processIncomingData(stream: MessageStream, callback: Callback) { + const buffer = stream[kBuffer]; + if (buffer.length < 4) { + callback(); + return; + } + + const sizeOfMessage = buffer.peek(4).readInt32LE(); + if (sizeOfMessage < 0) { + callback(new MongoParseError(`Invalid message size: ${sizeOfMessage}`)); + return; + } + + if (sizeOfMessage > stream.maxBsonMessageSize) { + callback( + new MongoParseError( + `Invalid message size: ${sizeOfMessage}, max allowed: ${stream.maxBsonMessageSize}` + ) + ); + return; + } + + if (sizeOfMessage > buffer.length) { + callback(); + return; + } + + const message = buffer.read(sizeOfMessage); + const messageHeader: MessageHeader = { + length: message.readInt32LE(0), + requestId: message.readInt32LE(4), + responseTo: message.readInt32LE(8), + opCode: message.readInt32LE(12) + }; + + const monitorHasAnotherHello = () => { + if (stream.isMonitoringConnection) { + // Can we read the next message size? + if (buffer.length >= 4) { + const sizeOfMessage = buffer.peek(4).readInt32LE(); + if (sizeOfMessage <= buffer.length) { + return true; + } + } + } + return false; + }; + + let ResponseType = messageHeader.opCode === OP_MSG ? BinMsg : Response; + if (messageHeader.opCode !== OP_COMPRESSED) { + const messageBody = message.slice(MESSAGE_HEADER_SIZE); + + // If we are a monitoring connection message stream and + // there is more in the buffer that can be read, skip processing since we + // want the last hello command response that is in the buffer. + if (monitorHasAnotherHello()) { + processIncomingData(stream, callback); + } else { + stream.emit('message', new ResponseType(message, messageHeader, messageBody)); + + if (buffer.length >= 4) { + processIncomingData(stream, callback); + } else { + callback(); + } + } + + return; + } + + messageHeader.fromCompressed = true; + messageHeader.opCode = message.readInt32LE(MESSAGE_HEADER_SIZE); + messageHeader.length = message.readInt32LE(MESSAGE_HEADER_SIZE + 4); + const compressorID: Compressor = message[MESSAGE_HEADER_SIZE + 8] as Compressor; + const compressedBuffer = message.slice(MESSAGE_HEADER_SIZE + 9); + + // recalculate based on wrapped opcode + ResponseType = messageHeader.opCode === OP_MSG ? BinMsg : Response; + decompress(compressorID, compressedBuffer, (err, messageBody) => { + if (err || !messageBody) { + callback(err); + return; + } + + if (messageBody.length !== messageHeader.length) { + callback( + new MongoDecompressionError('Message body and message header must be the same length') + ); + + return; + } + + // If we are a monitoring connection message stream and + // there is more in the buffer that can be read, skip processing since we + // want the last hello command response that is in the buffer. + if (monitorHasAnotherHello()) { + processIncomingData(stream, callback); + } else { + stream.emit('message', new ResponseType(message, messageHeader, messageBody)); + + if (buffer.length >= 4) { + processIncomingData(stream, callback); + } else { + callback(); + } + } + }); +} diff --git a/node_modules/mongodb/src/cmap/metrics.ts b/node_modules/mongodb/src/cmap/metrics.ts new file mode 100644 index 000000000..b825b5393 --- /dev/null +++ b/node_modules/mongodb/src/cmap/metrics.ts @@ -0,0 +1,58 @@ +/** @internal */ +export class ConnectionPoolMetrics { + static readonly TXN = 'txn' as const; + static readonly CURSOR = 'cursor' as const; + static readonly OTHER = 'other' as const; + + txnConnections = 0; + cursorConnections = 0; + otherConnections = 0; + + /** + * Mark a connection as pinned for a specific operation. + */ + markPinned(pinType: string): void { + if (pinType === ConnectionPoolMetrics.TXN) { + this.txnConnections += 1; + } else if (pinType === ConnectionPoolMetrics.CURSOR) { + this.cursorConnections += 1; + } else { + this.otherConnections += 1; + } + } + + /** + * Unmark a connection as pinned for an operation. + */ + markUnpinned(pinType: string): void { + if (pinType === ConnectionPoolMetrics.TXN) { + this.txnConnections -= 1; + } else if (pinType === ConnectionPoolMetrics.CURSOR) { + this.cursorConnections -= 1; + } else { + this.otherConnections -= 1; + } + } + + /** + * Return information about the cmap metrics as a string. + */ + info(maxPoolSize: number): string { + return ( + 'Timed out while checking out a connection from connection pool: ' + + `maxPoolSize: ${maxPoolSize}, ` + + `connections in use by cursors: ${this.cursorConnections}, ` + + `connections in use by transactions: ${this.txnConnections}, ` + + `connections in use by other operations: ${this.otherConnections}` + ); + } + + /** + * Reset the metrics to the initial values. + */ + reset(): void { + this.txnConnections = 0; + this.cursorConnections = 0; + this.otherConnections = 0; + } +} diff --git a/node_modules/mongodb/src/cmap/stream_description.ts b/node_modules/mongodb/src/cmap/stream_description.ts new file mode 100644 index 000000000..c5fbec0f4 --- /dev/null +++ b/node_modules/mongodb/src/cmap/stream_description.ts @@ -0,0 +1,76 @@ +import type { Document } from '../bson'; +import { ServerType } from '../sdam/common'; +import { parseServerType } from '../sdam/server_description'; +import type { CompressorName } from './wire_protocol/compression'; + +const RESPONSE_FIELDS = [ + 'minWireVersion', + 'maxWireVersion', + 'maxBsonObjectSize', + 'maxMessageSizeBytes', + 'maxWriteBatchSize', + 'logicalSessionTimeoutMinutes' +] as const; + +/** @public */ +export interface StreamDescriptionOptions { + compressors?: CompressorName[]; + logicalSessionTimeoutMinutes?: number; + loadBalanced: boolean; +} + +/** @public */ +export class StreamDescription { + address: string; + type: string; + minWireVersion?: number; + maxWireVersion?: number; + maxBsonObjectSize: number; + maxMessageSizeBytes: number; + maxWriteBatchSize: number; + compressors: CompressorName[]; + compressor?: CompressorName; + logicalSessionTimeoutMinutes?: number; + loadBalanced: boolean; + + __nodejs_mock_server__?: boolean; + + zlibCompressionLevel?: number; + + constructor(address: string, options?: StreamDescriptionOptions) { + this.address = address; + this.type = ServerType.Unknown; + this.minWireVersion = undefined; + this.maxWireVersion = undefined; + this.maxBsonObjectSize = 16777216; + this.maxMessageSizeBytes = 48000000; + this.maxWriteBatchSize = 100000; + this.logicalSessionTimeoutMinutes = options?.logicalSessionTimeoutMinutes; + this.loadBalanced = !!options?.loadBalanced; + this.compressors = + options && options.compressors && Array.isArray(options.compressors) + ? options.compressors + : []; + } + + receiveResponse(response: Document | null): void { + if (response == null) { + return; + } + this.type = parseServerType(response); + for (const field of RESPONSE_FIELDS) { + if (response[field] != null) { + this[field] = response[field]; + } + + // testing case + if ('__nodejs_mock_server__' in response) { + this.__nodejs_mock_server__ = response['__nodejs_mock_server__']; + } + } + + if (response.compression) { + this.compressor = this.compressors.filter(c => response.compression?.includes(c))[0]; + } + } +} diff --git a/node_modules/mongodb/src/cmap/wire_protocol/compression.ts b/node_modules/mongodb/src/cmap/wire_protocol/compression.ts new file mode 100644 index 000000000..9f98051fc --- /dev/null +++ b/node_modules/mongodb/src/cmap/wire_protocol/compression.ts @@ -0,0 +1,128 @@ +import * as zlib from 'zlib'; + +import { LEGACY_HELLO_COMMAND } from '../../constants'; +import { PKG_VERSION, Snappy, ZStandard } from '../../deps'; +import { MongoDecompressionError, MongoInvalidArgumentError } from '../../error'; +import type { Callback } from '../../utils'; +import type { OperationDescription } from '../message_stream'; + +/** @public */ +export const Compressor = Object.freeze({ + none: 0, + snappy: 1, + zlib: 2, + zstd: 3 +} as const); + +/** @public */ +export type Compressor = typeof Compressor[CompressorName]; + +/** @public */ +export type CompressorName = keyof typeof Compressor; + +export const uncompressibleCommands = new Set([ + LEGACY_HELLO_COMMAND, + 'saslStart', + 'saslContinue', + 'getnonce', + 'authenticate', + 'createUser', + 'updateUser', + 'copydbSaslStart', + 'copydbgetnonce', + 'copydb' +]); + +const MAX_COMPRESSOR_ID = 3; +const ZSTD_COMPRESSION_LEVEL = 3; + +// Facilitate compressing a message using an agreed compressor +export function compress( + self: { options: OperationDescription & zlib.ZlibOptions }, + dataToBeCompressed: Buffer, + callback: Callback +): void { + const zlibOptions = {} as zlib.ZlibOptions; + switch (self.options.agreedCompressor) { + case 'snappy': { + if ('kModuleError' in Snappy) { + return callback(Snappy['kModuleError']); + } + + if (Snappy[PKG_VERSION].major <= 6) { + Snappy.compress(dataToBeCompressed, callback); + } else { + Snappy.compress(dataToBeCompressed) + .then(buffer => callback(undefined, buffer)) + .catch(error => callback(error)); + } + break; + } + case 'zlib': + // Determine zlibCompressionLevel + if (self.options.zlibCompressionLevel) { + zlibOptions.level = self.options.zlibCompressionLevel; + } + zlib.deflate(dataToBeCompressed, zlibOptions, callback as zlib.CompressCallback); + break; + case 'zstd': + if ('kModuleError' in ZStandard) { + return callback(ZStandard['kModuleError']); + } + ZStandard.compress(dataToBeCompressed, ZSTD_COMPRESSION_LEVEL).then( + buffer => callback(undefined, buffer), + error => callback(error) + ); + break; + default: + throw new MongoInvalidArgumentError( + `Unknown compressor ${self.options.agreedCompressor} failed to compress` + ); + } +} + +// Decompress a message using the given compressor +export function decompress( + compressorID: Compressor, + compressedData: Buffer, + callback: Callback +): void { + if (compressorID < 0 || compressorID > MAX_COMPRESSOR_ID) { + throw new MongoDecompressionError( + `Server sent message compressed using an unsupported compressor. (Received compressor ID ${compressorID})` + ); + } + + switch (compressorID) { + case Compressor.snappy: { + if ('kModuleError' in Snappy) { + return callback(Snappy['kModuleError']); + } + + if (Snappy[PKG_VERSION].major <= 6) { + Snappy.uncompress(compressedData, { asBuffer: true }, callback); + } else { + Snappy.uncompress(compressedData, { asBuffer: true }) + .then(buffer => callback(undefined, buffer)) + .catch(error => callback(error)); + } + break; + } + case Compressor.zstd: { + if ('kModuleError' in ZStandard) { + return callback(ZStandard['kModuleError']); + } + + ZStandard.decompress(compressedData).then( + buffer => callback(undefined, buffer), + error => callback(error) + ); + break; + } + case Compressor.zlib: + zlib.inflate(compressedData, callback as zlib.CompressCallback); + break; + default: + callback(undefined, compressedData); + } +} diff --git a/node_modules/mongodb/src/cmap/wire_protocol/constants.ts b/node_modules/mongodb/src/cmap/wire_protocol/constants.ts new file mode 100644 index 000000000..4d515a5e5 --- /dev/null +++ b/node_modules/mongodb/src/cmap/wire_protocol/constants.ts @@ -0,0 +1,13 @@ +export const MIN_SUPPORTED_SERVER_VERSION = '3.6'; +export const MAX_SUPPORTED_SERVER_VERSION = '6.0'; +export const MIN_SUPPORTED_WIRE_VERSION = 6; +export const MAX_SUPPORTED_WIRE_VERSION = 17; +export const OP_REPLY = 1; +export const OP_UPDATE = 2001; +export const OP_INSERT = 2002; +export const OP_QUERY = 2004; +export const OP_GETMORE = 2005; +export const OP_DELETE = 2006; +export const OP_KILL_CURSORS = 2007; +export const OP_COMPRESSED = 2012; +export const OP_MSG = 2013; diff --git a/node_modules/mongodb/src/cmap/wire_protocol/shared.ts b/node_modules/mongodb/src/cmap/wire_protocol/shared.ts new file mode 100644 index 000000000..bc13ff6d8 --- /dev/null +++ b/node_modules/mongodb/src/cmap/wire_protocol/shared.ts @@ -0,0 +1,76 @@ +import type { Document } from '../../bson'; +import { MongoInvalidArgumentError } from '../../error'; +import type { ReadPreferenceLike } from '../../read_preference'; +import { ReadPreference } from '../../read_preference'; +import { ServerType } from '../../sdam/common'; +import type { Server } from '../../sdam/server'; +import type { ServerDescription } from '../../sdam/server_description'; +import type { Topology } from '../../sdam/topology'; +import { TopologyDescription } from '../../sdam/topology_description'; +import type { OpQueryOptions } from '../commands'; +import type { CommandOptions, Connection } from '../connection'; + +export interface ReadPreferenceOption { + readPreference?: ReadPreferenceLike; +} + +export function getReadPreference(cmd: Document, options?: ReadPreferenceOption): ReadPreference { + // Default to command version of the readPreference + let readPreference = cmd.readPreference || ReadPreference.primary; + // If we have an option readPreference override the command one + if (options?.readPreference) { + readPreference = options.readPreference; + } + + if (typeof readPreference === 'string') { + readPreference = ReadPreference.fromString(readPreference); + } + + if (!(readPreference instanceof ReadPreference)) { + throw new MongoInvalidArgumentError( + 'Option "readPreference" must be a ReadPreference instance' + ); + } + + return readPreference; +} + +export function applyCommonQueryOptions( + queryOptions: OpQueryOptions, + options: CommandOptions +): CommandOptions { + Object.assign(queryOptions, { + raw: typeof options.raw === 'boolean' ? options.raw : false, + promoteLongs: typeof options.promoteLongs === 'boolean' ? options.promoteLongs : true, + promoteValues: typeof options.promoteValues === 'boolean' ? options.promoteValues : true, + promoteBuffers: typeof options.promoteBuffers === 'boolean' ? options.promoteBuffers : false, + bsonRegExp: typeof options.bsonRegExp === 'boolean' ? options.bsonRegExp : false, + enableUtf8Validation: + typeof options.enableUtf8Validation === 'boolean' ? options.enableUtf8Validation : true + }); + + if (options.session) { + queryOptions.session = options.session; + } + + return queryOptions; +} + +export function isSharded(topologyOrServer?: Topology | Server | Connection): boolean { + if (topologyOrServer == null) { + return false; + } + + if (topologyOrServer.description && topologyOrServer.description.type === ServerType.Mongos) { + return true; + } + + // NOTE: This is incredibly inefficient, and should be removed once command construction + // happens based on `Server` not `Topology`. + if (topologyOrServer.description && topologyOrServer.description instanceof TopologyDescription) { + const servers: ServerDescription[] = Array.from(topologyOrServer.description.servers.values()); + return servers.some((server: ServerDescription) => server.type === ServerType.Mongos); + } + + return false; +} diff --git a/node_modules/mongodb/src/collection.ts b/node_modules/mongodb/src/collection.ts new file mode 100644 index 000000000..f89a9f2fc --- /dev/null +++ b/node_modules/mongodb/src/collection.ts @@ -0,0 +1,1686 @@ +import { BSONSerializeOptions, Document, resolveBSONOptions } from './bson'; +import type { AnyBulkWriteOperation, BulkWriteOptions, BulkWriteResult } from './bulk/common'; +import { OrderedBulkOperation } from './bulk/ordered'; +import { UnorderedBulkOperation } from './bulk/unordered'; +import { ChangeStream, ChangeStreamDocument, ChangeStreamOptions } from './change_stream'; +import { AggregationCursor } from './cursor/aggregation_cursor'; +import { FindCursor } from './cursor/find_cursor'; +import type { Db } from './db'; +import { MongoInvalidArgumentError } from './error'; +import type { Logger, LoggerOptions } from './logger'; +import type { PkFactory } from './mongo_client'; +import type { + Filter, + Flatten, + OptionalUnlessRequiredId, + TODO_NODE_3286, + UpdateFilter, + WithId, + WithoutId +} from './mongo_types'; +import type { AggregateOptions } from './operations/aggregate'; +import { BulkWriteOperation } from './operations/bulk_write'; +import type { IndexInformationOptions } from './operations/common_functions'; +import { CountOperation, CountOptions } from './operations/count'; +import { CountDocumentsOperation, CountDocumentsOptions } from './operations/count_documents'; +import { + DeleteManyOperation, + DeleteOneOperation, + DeleteOptions, + DeleteResult +} from './operations/delete'; +import { DistinctOperation, DistinctOptions } from './operations/distinct'; +import { DropCollectionOperation, DropCollectionOptions } from './operations/drop'; +import { + EstimatedDocumentCountOperation, + EstimatedDocumentCountOptions +} from './operations/estimated_document_count'; +import { executeOperation } from './operations/execute_operation'; +import type { FindOptions } from './operations/find'; +import { + FindOneAndDeleteOperation, + FindOneAndDeleteOptions, + FindOneAndReplaceOperation, + FindOneAndReplaceOptions, + FindOneAndUpdateOperation, + FindOneAndUpdateOptions +} from './operations/find_and_modify'; +import { + CreateIndexesOperation, + CreateIndexesOptions, + CreateIndexOperation, + DropIndexesOperation, + DropIndexesOptions, + DropIndexOperation, + IndexDescription, + IndexesOperation, + IndexExistsOperation, + IndexInformationOperation, + IndexSpecification, + ListIndexesCursor, + ListIndexesOptions +} from './operations/indexes'; +import { + InsertManyOperation, + InsertManyResult, + InsertOneOperation, + InsertOneOptions, + InsertOneResult +} from './operations/insert'; +import { IsCappedOperation } from './operations/is_capped'; +import { + MapFunction, + MapReduceOperation, + MapReduceOptions, + ReduceFunction +} from './operations/map_reduce'; +import type { Hint, OperationOptions } from './operations/operation'; +import { OptionsOperation } from './operations/options_operation'; +import { RenameOperation, RenameOptions } from './operations/rename'; +import { CollStats, CollStatsOperation, CollStatsOptions } from './operations/stats'; +import { + ReplaceOneOperation, + ReplaceOptions, + UpdateManyOperation, + UpdateOneOperation, + UpdateOptions, + UpdateResult +} from './operations/update'; +import { ReadConcern, ReadConcernLike } from './read_concern'; +import { ReadPreference, ReadPreferenceLike } from './read_preference'; +import { + Callback, + checkCollectionName, + DEFAULT_PK_FACTORY, + emitWarningOnce, + MongoDBNamespace, + normalizeHintField, + resolveOptions +} from './utils'; +import { WriteConcern, WriteConcernOptions } from './write_concern'; + +/** @public */ +export interface ModifyResult { + value: WithId | null; + lastErrorObject?: Document; + ok: 0 | 1; +} + +/** @public */ +export interface CollectionOptions + extends BSONSerializeOptions, + WriteConcernOptions, + LoggerOptions { + /** + * @deprecated Use readPreference instead + */ + slaveOk?: boolean; + /** Specify a read concern for the collection. (only MongoDB 3.2 or higher supported) */ + readConcern?: ReadConcernLike; + /** The preferred read preference (ReadPreference.PRIMARY, ReadPreference.PRIMARY_PREFERRED, ReadPreference.SECONDARY, ReadPreference.SECONDARY_PREFERRED, ReadPreference.NEAREST). */ + readPreference?: ReadPreferenceLike; +} + +/** @internal */ +export interface CollectionPrivate { + pkFactory: PkFactory; + db: Db; + options: any; + namespace: MongoDBNamespace; + readPreference?: ReadPreference; + bsonOptions: BSONSerializeOptions; + collectionHint?: Hint; + readConcern?: ReadConcern; + writeConcern?: WriteConcern; +} + +/** + * The **Collection** class is an internal class that embodies a MongoDB collection + * allowing for insert/update/remove/find and other command operation on that MongoDB collection. + * + * **COLLECTION Cannot directly be instantiated** + * @public + * + * @example + * ```js + * const MongoClient = require('mongodb').MongoClient; + * const test = require('assert'); + * // Connection url + * const url = 'mongodb://localhost:27017'; + * // Database Name + * const dbName = 'test'; + * // Connect using MongoClient + * MongoClient.connect(url, function(err, client) { + * // Create a collection we want to drop later + * const col = client.db(dbName).collection('createIndexExample1'); + * // Show that duplicate records got dropped + * col.find({}).toArray(function(err, items) { + * expect(err).to.not.exist; + * test.equal(4, items.length); + * client.close(); + * }); + * }); + * ``` + */ +export class Collection { + /** @internal */ + s: CollectionPrivate; + + /** + * Create a new Collection instance + * @internal + */ + constructor(db: Db, name: string, options?: CollectionOptions) { + checkCollectionName(name); + + // Internal state + this.s = { + db, + options, + namespace: new MongoDBNamespace(db.databaseName, name), + pkFactory: db.options?.pkFactory ?? DEFAULT_PK_FACTORY, + readPreference: ReadPreference.fromOptions(options), + bsonOptions: resolveBSONOptions(options, db), + readConcern: ReadConcern.fromOptions(options), + writeConcern: WriteConcern.fromOptions(options) + }; + } + + /** + * The name of the database this collection belongs to + */ + get dbName(): string { + return this.s.namespace.db; + } + + /** + * The name of this collection + */ + get collectionName(): string { + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + return this.s.namespace.collection!; + } + + /** + * The namespace of this collection, in the format `${this.dbName}.${this.collectionName}` + */ + get namespace(): string { + return this.s.namespace.toString(); + } + + /** + * The current readConcern of the collection. If not explicitly defined for + * this collection, will be inherited from the parent DB + */ + get readConcern(): ReadConcern | undefined { + if (this.s.readConcern == null) { + return this.s.db.readConcern; + } + return this.s.readConcern; + } + + /** + * The current readPreference of the collection. If not explicitly defined for + * this collection, will be inherited from the parent DB + */ + get readPreference(): ReadPreference | undefined { + if (this.s.readPreference == null) { + return this.s.db.readPreference; + } + + return this.s.readPreference; + } + + get bsonOptions(): BSONSerializeOptions { + return this.s.bsonOptions; + } + + /** + * The current writeConcern of the collection. If not explicitly defined for + * this collection, will be inherited from the parent DB + */ + get writeConcern(): WriteConcern | undefined { + if (this.s.writeConcern == null) { + return this.s.db.writeConcern; + } + return this.s.writeConcern; + } + + /** The current index hint for the collection */ + get hint(): Hint | undefined { + return this.s.collectionHint; + } + + set hint(v: Hint | undefined) { + this.s.collectionHint = normalizeHintField(v); + } + + /** + * Inserts a single document into MongoDB. If documents passed in do not contain the **_id** field, + * one will be added to each of the documents missing it by the driver, mutating the document. This behavior + * can be overridden by setting the **forceServerObjectId** flag. + * + * @param doc - The document to insert + * @param options - Optional settings for the command + * @param callback - An optional callback, a Promise will be returned if none is provided + */ + insertOne(doc: OptionalUnlessRequiredId): Promise>; + insertOne( + doc: OptionalUnlessRequiredId, + callback: Callback> + ): void; + insertOne( + doc: OptionalUnlessRequiredId, + options: InsertOneOptions + ): Promise>; + insertOne( + doc: OptionalUnlessRequiredId, + options: InsertOneOptions, + callback: Callback> + ): void; + insertOne( + doc: OptionalUnlessRequiredId, + options?: InsertOneOptions | Callback>, + callback?: Callback> + ): Promise> | void { + if (typeof options === 'function') { + callback = options; + options = {}; + } + + // CSFLE passes in { w: 'majority' } to ensure the lib works in both 3.x and 4.x + // we support that option style here only + if (options && Reflect.get(options, 'w')) { + options.writeConcern = WriteConcern.fromOptions(Reflect.get(options, 'w')); + } + + return executeOperation( + this.s.db.s.client, + new InsertOneOperation( + this as TODO_NODE_3286, + doc, + resolveOptions(this, options) + ) as TODO_NODE_3286, + callback + ); + } + + /** + * Inserts an array of documents into MongoDB. If documents passed in do not contain the **_id** field, + * one will be added to each of the documents missing it by the driver, mutating the document. This behavior + * can be overridden by setting the **forceServerObjectId** flag. + * + * @param docs - The documents to insert + * @param options - Optional settings for the command + * @param callback - An optional callback, a Promise will be returned if none is provided + */ + insertMany(docs: OptionalUnlessRequiredId[]): Promise>; + insertMany( + docs: OptionalUnlessRequiredId[], + callback: Callback> + ): void; + insertMany( + docs: OptionalUnlessRequiredId[], + options: BulkWriteOptions + ): Promise>; + insertMany( + docs: OptionalUnlessRequiredId[], + options: BulkWriteOptions, + callback: Callback> + ): void; + insertMany( + docs: OptionalUnlessRequiredId[], + options?: BulkWriteOptions | Callback>, + callback?: Callback> + ): Promise> | void { + if (typeof options === 'function') (callback = options), (options = {}); + options = options ? Object.assign({}, options) : { ordered: true }; + + return executeOperation( + this.s.db.s.client, + new InsertManyOperation( + this as TODO_NODE_3286, + docs, + resolveOptions(this, options) + ) as TODO_NODE_3286, + callback + ); + } + + /** + * Perform a bulkWrite operation without a fluent API + * + * Legal operation types are + * + * ```js + * { insertOne: { document: { a: 1 } } } + * + * { updateOne: { filter: {a:2}, update: {$set: {a:2}}, upsert:true } } + * + * { updateMany: { filter: {a:2}, update: {$set: {a:2}}, upsert:true } } + * + * { updateMany: { filter: {}, update: {$set: {"a.$[i].x": 5}}, arrayFilters: [{ "i.x": 5 }]} } + * + * { deleteOne: { filter: {c:1} } } + * + * { deleteMany: { filter: {c:1} } } + * + * { replaceOne: { filter: {c:3}, replacement: {c:4}, upsert:true} } + *``` + * Please note that raw operations are no longer accepted as of driver version 4.0. + * + * If documents passed in do not contain the **_id** field, + * one will be added to each of the documents missing it by the driver, mutating the document. This behavior + * can be overridden by setting the **forceServerObjectId** flag. + * + * @param operations - Bulk operations to perform + * @param options - Optional settings for the command + * @param callback - An optional callback, a Promise will be returned if none is provided + * @throws MongoDriverError if operations is not an array + */ + bulkWrite(operations: AnyBulkWriteOperation[]): Promise; + bulkWrite( + operations: AnyBulkWriteOperation[], + callback: Callback + ): void; + bulkWrite( + operations: AnyBulkWriteOperation[], + options: BulkWriteOptions + ): Promise; + bulkWrite( + operations: AnyBulkWriteOperation[], + options: BulkWriteOptions, + callback: Callback + ): void; + bulkWrite( + operations: AnyBulkWriteOperation[], + options?: BulkWriteOptions | Callback, + callback?: Callback + ): Promise | void { + if (typeof options === 'function') (callback = options), (options = {}); + options = options || { ordered: true }; + + if (!Array.isArray(operations)) { + throw new MongoInvalidArgumentError('Argument "operations" must be an array of documents'); + } + + return executeOperation( + this.s.db.s.client, + new BulkWriteOperation( + this as TODO_NODE_3286, + operations as TODO_NODE_3286, + resolveOptions(this, options) + ), + callback + ); + } + + /** + * Update a single document in a collection + * + * @param filter - The filter used to select the document to update + * @param update - The update operations to be applied to the document + * @param options - Optional settings for the command + * @param callback - An optional callback, a Promise will be returned if none is provided + */ + updateOne( + filter: Filter, + update: UpdateFilter | Partial + ): Promise; + updateOne( + filter: Filter, + update: UpdateFilter | Partial, + callback: Callback + ): void; + updateOne( + filter: Filter, + update: UpdateFilter | Partial, + options: UpdateOptions + ): Promise; + updateOne( + filter: Filter, + update: UpdateFilter | Partial, + options: UpdateOptions, + callback: Callback + ): void; + updateOne( + filter: Filter, + update: UpdateFilter | Partial, + options?: UpdateOptions | Callback, + callback?: Callback + ): Promise | void { + if (typeof options === 'function') (callback = options), (options = {}); + + return executeOperation( + this.s.db.s.client, + new UpdateOneOperation( + this as TODO_NODE_3286, + filter, + update, + resolveOptions(this, options) + ) as TODO_NODE_3286, + callback + ); + } + + /** + * Replace a document in a collection with another document + * + * @param filter - The filter used to select the document to replace + * @param replacement - The Document that replaces the matching document + * @param options - Optional settings for the command + * @param callback - An optional callback, a Promise will be returned if none is provided + */ + replaceOne( + filter: Filter, + replacement: WithoutId + ): Promise; + replaceOne( + filter: Filter, + replacement: WithoutId, + callback: Callback + ): void; + replaceOne( + filter: Filter, + replacement: WithoutId, + options: ReplaceOptions + ): Promise; + replaceOne( + filter: Filter, + replacement: WithoutId, + options: ReplaceOptions, + callback: Callback + ): void; + replaceOne( + filter: Filter, + replacement: WithoutId, + options?: ReplaceOptions | Callback, + callback?: Callback + ): Promise | void { + if (typeof options === 'function') (callback = options), (options = {}); + + return executeOperation( + this.s.db.s.client, + new ReplaceOneOperation( + this as TODO_NODE_3286, + filter, + replacement, + resolveOptions(this, options) + ), + callback + ); + } + + /** + * Update multiple documents in a collection + * + * @param filter - The filter used to select the documents to update + * @param update - The update operations to be applied to the documents + * @param options - Optional settings for the command + * @param callback - An optional callback, a Promise will be returned if none is provided + */ + updateMany( + filter: Filter, + update: UpdateFilter + ): Promise; + updateMany( + filter: Filter, + update: UpdateFilter, + callback: Callback + ): void; + updateMany( + filter: Filter, + update: UpdateFilter, + options: UpdateOptions + ): Promise; + updateMany( + filter: Filter, + update: UpdateFilter, + options: UpdateOptions, + callback: Callback + ): void; + updateMany( + filter: Filter, + update: UpdateFilter, + options?: UpdateOptions | Callback, + callback?: Callback + ): Promise | void { + if (typeof options === 'function') (callback = options), (options = {}); + + return executeOperation( + this.s.db.s.client, + new UpdateManyOperation( + this as TODO_NODE_3286, + filter, + update, + resolveOptions(this, options) + ), + callback + ); + } + + /** + * Delete a document from a collection + * + * @param filter - The filter used to select the document to remove + * @param options - Optional settings for the command + * @param callback - An optional callback, a Promise will be returned if none is provided + */ + deleteOne(filter: Filter): Promise; + deleteOne(filter: Filter, callback: Callback): void; + deleteOne(filter: Filter, options: DeleteOptions): Promise; + deleteOne( + filter: Filter, + options: DeleteOptions, + callback?: Callback + ): void; + deleteOne( + filter: Filter, + options?: DeleteOptions | Callback, + callback?: Callback + ): Promise | void { + if (typeof options === 'function') (callback = options), (options = {}); + + return executeOperation( + this.s.db.s.client, + new DeleteOneOperation(this as TODO_NODE_3286, filter, resolveOptions(this, options)), + callback + ); + } + + /** + * Delete multiple documents from a collection + * + * @param filter - The filter used to select the documents to remove + * @param options - Optional settings for the command + * @param callback - An optional callback, a Promise will be returned if none is provided + */ + deleteMany(filter: Filter): Promise; + deleteMany(filter: Filter, callback: Callback): void; + deleteMany(filter: Filter, options: DeleteOptions): Promise; + deleteMany( + filter: Filter, + options: DeleteOptions, + callback: Callback + ): void; + deleteMany( + filter: Filter, + options?: DeleteOptions | Callback, + callback?: Callback + ): Promise | void { + if (filter == null) { + filter = {}; + options = {}; + callback = undefined; + } else if (typeof filter === 'function') { + callback = filter as Callback; + filter = {}; + options = {}; + } else if (typeof options === 'function') { + callback = options; + options = {}; + } + + return executeOperation( + this.s.db.s.client, + new DeleteManyOperation(this as TODO_NODE_3286, filter, resolveOptions(this, options)), + callback + ); + } + + /** + * Rename the collection. + * + * @remarks + * This operation does not inherit options from the Db or MongoClient. + * + * @param newName - New name of of the collection. + * @param options - Optional settings for the command + * @param callback - An optional callback, a Promise will be returned if none is provided + */ + rename(newName: string): Promise; + rename(newName: string, callback: Callback): void; + rename(newName: string, options: RenameOptions): Promise; + rename(newName: string, options: RenameOptions, callback: Callback): void; + rename( + newName: string, + options?: RenameOptions | Callback, + callback?: Callback + ): Promise | void { + if (typeof options === 'function') (callback = options), (options = {}); + + // Intentionally, we do not inherit options from parent for this operation. + return executeOperation( + this.s.db.s.client, + new RenameOperation(this as TODO_NODE_3286, newName, { + ...options, + readPreference: ReadPreference.PRIMARY + }), + callback + ); + } + + /** + * Drop the collection from the database, removing it permanently. New accesses will create a new collection. + * + * @param options - Optional settings for the command + * @param callback - An optional callback, a Promise will be returned if none is provided + */ + drop(): Promise; + drop(callback: Callback): void; + drop(options: DropCollectionOptions): Promise; + drop(options: DropCollectionOptions, callback: Callback): void; + drop( + options?: DropCollectionOptions | Callback, + callback?: Callback + ): Promise | void { + if (typeof options === 'function') (callback = options), (options = {}); + options = options ?? {}; + + return executeOperation( + this.s.db.s.client, + new DropCollectionOperation(this.s.db, this.collectionName, options), + callback + ); + } + + /** + * Fetches the first document that matches the filter + * + * @param filter - Query for find Operation + * @param options - Optional settings for the command + * @param callback - An optional callback, a Promise will be returned if none is provided + */ + findOne(): Promise | null>; + findOne(callback: Callback | null>): void; + findOne(filter: Filter): Promise | null>; + findOne(filter: Filter, callback: Callback | null>): void; + findOne(filter: Filter, options: FindOptions): Promise | null>; + findOne( + filter: Filter, + options: FindOptions, + callback: Callback | null> + ): void; + + // allow an override of the schema. + findOne(): Promise; + findOne(callback: Callback): void; + findOne(filter: Filter): Promise; + findOne(filter: Filter, options?: FindOptions): Promise; + findOne( + filter: Filter, + options?: FindOptions, + callback?: Callback + ): void; + + findOne( + filter?: Filter | Callback | null>, + options?: FindOptions | Callback | null>, + callback?: Callback | null> + ): Promise | null> | void { + if (callback != null && typeof callback !== 'function') { + throw new MongoInvalidArgumentError( + 'Third parameter to `findOne()` must be a callback or undefined' + ); + } + + if (typeof filter === 'function') { + callback = filter as Callback | null>; + filter = {}; + options = {}; + } + if (typeof options === 'function') { + callback = options; + options = {}; + } + + const finalFilter = filter ?? {}; + const finalOptions = options ?? {}; + return this.find(finalFilter, finalOptions).limit(-1).batchSize(1).next(callback); + } + + /** + * Creates a cursor for a filter that can be used to iterate over results from MongoDB + * + * @param filter - The filter predicate. If unspecified, then all documents in the collection will match the predicate + */ + find(): FindCursor>; + find(filter: Filter, options?: FindOptions): FindCursor>; + find(filter: Filter, options?: FindOptions): FindCursor; + find(filter?: Filter, options?: FindOptions): FindCursor> { + if (arguments.length > 2) { + throw new MongoInvalidArgumentError( + 'Method "collection.find()" accepts at most two arguments' + ); + } + if (typeof options === 'function') { + throw new MongoInvalidArgumentError('Argument "options" must not be function'); + } + + return new FindCursor>( + this.s.db.s.client, + this.s.namespace, + filter, + resolveOptions(this as TODO_NODE_3286, options) + ); + } + + /** + * Returns the options of the collection. + * + * @param options - Optional settings for the command + * @param callback - An optional callback, a Promise will be returned if none is provided + */ + options(): Promise; + options(callback: Callback): void; + options(options: OperationOptions): Promise; + options(options: OperationOptions, callback: Callback): void; + options( + options?: OperationOptions | Callback, + callback?: Callback + ): Promise | void { + if (typeof options === 'function') (callback = options), (options = {}); + + return executeOperation( + this.s.db.s.client, + new OptionsOperation(this as TODO_NODE_3286, resolveOptions(this, options)), + callback + ); + } + + /** + * Returns if the collection is a capped collection + * + * @param options - Optional settings for the command + * @param callback - An optional callback, a Promise will be returned if none is provided + */ + isCapped(): Promise; + isCapped(callback: Callback): void; + isCapped(options: OperationOptions): Promise; + isCapped(options: OperationOptions, callback: Callback): void; + isCapped( + options?: OperationOptions | Callback, + callback?: Callback + ): Promise | void { + if (typeof options === 'function') (callback = options), (options = {}); + + return executeOperation( + this.s.db.s.client, + new IsCappedOperation(this as TODO_NODE_3286, resolveOptions(this, options)), + callback + ); + } + + /** + * Creates an index on the db and collection collection. + * + * @param indexSpec - The field name or index specification to create an index for + * @param options - Optional settings for the command + * @param callback - An optional callback, a Promise will be returned if none is provided + * + * @example + * ```js + * const collection = client.db('foo').collection('bar'); + * + * await collection.createIndex({ a: 1, b: -1 }); + * + * // Alternate syntax for { c: 1, d: -1 } that ensures order of indexes + * await collection.createIndex([ [c, 1], [d, -1] ]); + * + * // Equivalent to { e: 1 } + * await collection.createIndex('e'); + * + * // Equivalent to { f: 1, g: 1 } + * await collection.createIndex(['f', 'g']) + * + * // Equivalent to { h: 1, i: -1 } + * await collection.createIndex([ { h: 1 }, { i: -1 } ]); + * + * // Equivalent to { j: 1, k: -1, l: 2d } + * await collection.createIndex(['j', ['k', -1], { l: '2d' }]) + * ``` + */ + createIndex(indexSpec: IndexSpecification): Promise; + createIndex(indexSpec: IndexSpecification, callback: Callback): void; + createIndex(indexSpec: IndexSpecification, options: CreateIndexesOptions): Promise; + createIndex( + indexSpec: IndexSpecification, + options: CreateIndexesOptions, + callback: Callback + ): void; + createIndex( + indexSpec: IndexSpecification, + options?: CreateIndexesOptions | Callback, + callback?: Callback + ): Promise | void { + if (typeof options === 'function') (callback = options), (options = {}); + + return executeOperation( + this.s.db.s.client, + new CreateIndexOperation( + this as TODO_NODE_3286, + this.collectionName, + indexSpec, + resolveOptions(this, options) + ), + callback + ); + } + + /** + * Creates multiple indexes in the collection, this method is only supported for + * MongoDB 2.6 or higher. Earlier version of MongoDB will throw a command not supported + * error. + * + * **Note**: Unlike {@link Collection#createIndex| createIndex}, this function takes in raw index specifications. + * Index specifications are defined {@link http://docs.mongodb.org/manual/reference/command/createIndexes/| here}. + * + * @param indexSpecs - An array of index specifications to be created + * @param options - Optional settings for the command + * @param callback - An optional callback, a Promise will be returned if none is provided + * + * @example + * ```js + * const collection = client.db('foo').collection('bar'); + * await collection.createIndexes([ + * // Simple index on field fizz + * { + * key: { fizz: 1 }, + * } + * // wildcard index + * { + * key: { '$**': 1 } + * }, + * // named index on darmok and jalad + * { + * key: { darmok: 1, jalad: -1 } + * name: 'tanagra' + * } + * ]); + * ``` + */ + createIndexes(indexSpecs: IndexDescription[]): Promise; + createIndexes(indexSpecs: IndexDescription[], callback: Callback): void; + createIndexes(indexSpecs: IndexDescription[], options: CreateIndexesOptions): Promise; + createIndexes( + indexSpecs: IndexDescription[], + options: CreateIndexesOptions, + callback: Callback + ): void; + createIndexes( + indexSpecs: IndexDescription[], + options?: CreateIndexesOptions | Callback, + callback?: Callback + ): Promise | void { + if (typeof options === 'function') (callback = options), (options = {}); + options = options ? Object.assign({}, options) : {}; + if (typeof options.maxTimeMS !== 'number') delete options.maxTimeMS; + + return executeOperation( + this.s.db.s.client, + new CreateIndexesOperation( + this as TODO_NODE_3286, + this.collectionName, + indexSpecs, + resolveOptions(this, options) + ), + callback + ); + } + + /** + * Drops an index from this collection. + * + * @param indexName - Name of the index to drop. + * @param options - Optional settings for the command + * @param callback - An optional callback, a Promise will be returned if none is provided + */ + dropIndex(indexName: string): Promise; + dropIndex(indexName: string, callback: Callback): void; + dropIndex(indexName: string, options: DropIndexesOptions): Promise; + dropIndex(indexName: string, options: DropIndexesOptions, callback: Callback): void; + dropIndex( + indexName: string, + options?: DropIndexesOptions | Callback, + callback?: Callback + ): Promise | void { + if (typeof options === 'function') (callback = options), (options = {}); + options = resolveOptions(this, options); + + // Run only against primary + options.readPreference = ReadPreference.primary; + + return executeOperation( + this.s.db.s.client, + new DropIndexOperation(this as TODO_NODE_3286, indexName, options), + callback + ); + } + + /** + * Drops all indexes from this collection. + * + * @param options - Optional settings for the command + * @param callback - An optional callback, a Promise will be returned if none is provided + */ + dropIndexes(): Promise; + dropIndexes(callback: Callback): void; + dropIndexes(options: DropIndexesOptions): Promise; + dropIndexes(options: DropIndexesOptions, callback: Callback): void; + dropIndexes( + options?: DropIndexesOptions | Callback, + callback?: Callback + ): Promise | void { + if (typeof options === 'function') (callback = options), (options = {}); + + return executeOperation( + this.s.db.s.client, + new DropIndexesOperation(this as TODO_NODE_3286, resolveOptions(this, options)), + callback + ); + } + + /** + * Get the list of all indexes information for the collection. + * + * @param options - Optional settings for the command + */ + listIndexes(options?: ListIndexesOptions): ListIndexesCursor { + return new ListIndexesCursor(this as TODO_NODE_3286, resolveOptions(this, options)); + } + + /** + * Checks if one or more indexes exist on the collection, fails on first non-existing index + * + * @param indexes - One or more index names to check. + * @param options - Optional settings for the command + * @param callback - An optional callback, a Promise will be returned if none is provided + */ + indexExists(indexes: string | string[]): Promise; + indexExists(indexes: string | string[], callback: Callback): void; + indexExists(indexes: string | string[], options: IndexInformationOptions): Promise; + indexExists( + indexes: string | string[], + options: IndexInformationOptions, + callback: Callback + ): void; + indexExists( + indexes: string | string[], + options?: IndexInformationOptions | Callback, + callback?: Callback + ): Promise | void { + if (typeof options === 'function') (callback = options), (options = {}); + + return executeOperation( + this.s.db.s.client, + new IndexExistsOperation(this as TODO_NODE_3286, indexes, resolveOptions(this, options)), + callback + ); + } + + /** + * Retrieves this collections index info. + * + * @param options - Optional settings for the command + * @param callback - An optional callback, a Promise will be returned if none is provided + */ + indexInformation(): Promise; + indexInformation(callback: Callback): void; + indexInformation(options: IndexInformationOptions): Promise; + indexInformation(options: IndexInformationOptions, callback: Callback): void; + indexInformation( + options?: IndexInformationOptions | Callback, + callback?: Callback + ): Promise | void { + if (typeof options === 'function') (callback = options), (options = {}); + + return executeOperation( + this.s.db.s.client, + new IndexInformationOperation(this.s.db, this.collectionName, resolveOptions(this, options)), + callback + ); + } + + /** + * Gets an estimate of the count of documents in a collection using collection metadata. + * This will always run a count command on all server versions. + * + * due to an oversight in versions 5.0.0-5.0.8 of MongoDB, the count command, + * which estimatedDocumentCount uses in its implementation, was not included in v1 of + * the Stable API, and so users of the Stable API with estimatedDocumentCount are + * recommended to upgrade their server version to 5.0.9+ or set apiStrict: false to avoid + * encountering errors. + * + * @see {@link https://www.mongodb.com/docs/manual/reference/command/count/#behavior|Count: Behavior} + * @param options - Optional settings for the command + * @param callback - An optional callback, a Promise will be returned if none is provided + */ + estimatedDocumentCount(): Promise; + estimatedDocumentCount(callback: Callback): void; + estimatedDocumentCount(options: EstimatedDocumentCountOptions): Promise; + estimatedDocumentCount(options: EstimatedDocumentCountOptions, callback: Callback): void; + estimatedDocumentCount( + options?: EstimatedDocumentCountOptions | Callback, + callback?: Callback + ): Promise | void { + if (typeof options === 'function') (callback = options), (options = {}); + return executeOperation( + this.s.db.s.client, + new EstimatedDocumentCountOperation(this as TODO_NODE_3286, resolveOptions(this, options)), + callback + ); + } + + /** + * Gets the number of documents matching the filter. + * For a fast count of the total documents in a collection see {@link Collection#estimatedDocumentCount| estimatedDocumentCount}. + * **Note**: When migrating from {@link Collection#count| count} to {@link Collection#countDocuments| countDocuments} + * the following query operators must be replaced: + * + * | Operator | Replacement | + * | -------- | ----------- | + * | `$where` | [`$expr`][1] | + * | `$near` | [`$geoWithin`][2] with [`$center`][3] | + * | `$nearSphere` | [`$geoWithin`][2] with [`$centerSphere`][4] | + * + * [1]: https://docs.mongodb.com/manual/reference/operator/query/expr/ + * [2]: https://docs.mongodb.com/manual/reference/operator/query/geoWithin/ + * [3]: https://docs.mongodb.com/manual/reference/operator/query/center/#op._S_center + * [4]: https://docs.mongodb.com/manual/reference/operator/query/centerSphere/#op._S_centerSphere + * + * @param filter - The filter for the count + * @param options - Optional settings for the command + * @param callback - An optional callback, a Promise will be returned if none is provided + * + * @see https://docs.mongodb.com/manual/reference/operator/query/expr/ + * @see https://docs.mongodb.com/manual/reference/operator/query/geoWithin/ + * @see https://docs.mongodb.com/manual/reference/operator/query/center/#op._S_center + * @see https://docs.mongodb.com/manual/reference/operator/query/centerSphere/#op._S_centerSphere + */ + countDocuments(): Promise; + countDocuments(callback: Callback): void; + countDocuments(filter: Filter): Promise; + countDocuments(callback: Callback): void; + countDocuments(filter: Filter, options: CountDocumentsOptions): Promise; + countDocuments( + filter: Filter, + options: CountDocumentsOptions, + callback: Callback + ): void; + countDocuments(filter: Filter, callback: Callback): void; + countDocuments( + filter?: Document | CountDocumentsOptions | Callback, + options?: CountDocumentsOptions | Callback, + callback?: Callback + ): Promise | void { + if (filter == null) { + (filter = {}), (options = {}), (callback = undefined); + } else if (typeof filter === 'function') { + (callback = filter as Callback), (filter = {}), (options = {}); + } else { + if (arguments.length === 2) { + if (typeof options === 'function') (callback = options), (options = {}); + } + } + + filter ??= {}; + return executeOperation( + this.s.db.s.client, + new CountDocumentsOperation( + this as TODO_NODE_3286, + filter as Document, + resolveOptions(this, options as CountDocumentsOptions) + ), + callback + ); + } + + /** + * The distinct command returns a list of distinct values for the given key across a collection. + * + * @param key - Field of the document to find distinct values for + * @param filter - The filter for filtering the set of documents to which we apply the distinct filter. + * @param options - Optional settings for the command + * @param callback - An optional callback, a Promise will be returned if none is provided + */ + distinct>( + key: Key + ): Promise[Key]>>>; + distinct>( + key: Key, + callback: Callback[Key]>>> + ): void; + distinct>( + key: Key, + filter: Filter + ): Promise[Key]>>>; + distinct>( + key: Key, + filter: Filter, + callback: Callback[Key]>>> + ): void; + distinct>( + key: Key, + filter: Filter, + options: DistinctOptions + ): Promise[Key]>>>; + distinct>( + key: Key, + filter: Filter, + options: DistinctOptions, + callback: Callback[Key]>>> + ): void; + + // Embedded documents overload + distinct(key: string): Promise; + distinct(key: string, callback: Callback): void; + distinct(key: string, filter: Filter): Promise; + distinct(key: string, filter: Filter, callback: Callback): void; + distinct(key: string, filter: Filter, options: DistinctOptions): Promise; + distinct( + key: string, + filter: Filter, + options: DistinctOptions, + callback: Callback + ): void; + // Implementation + distinct>( + key: Key, + filter?: Filter | DistinctOptions | Callback, + options?: DistinctOptions | Callback, + callback?: Callback + ): Promise | void { + if (typeof filter === 'function') { + (callback = filter as Callback), (filter = {}), (options = {}); + } else { + if (arguments.length === 3 && typeof options === 'function') { + (callback = options), (options = {}); + } + } + + filter ??= {}; + return executeOperation( + this.s.db.s.client, + new DistinctOperation( + this as TODO_NODE_3286, + key as TODO_NODE_3286, + filter, + resolveOptions(this, options as DistinctOptions) + ), + callback + ); + } + + /** + * Retrieve all the indexes on the collection. + * + * @param options - Optional settings for the command + * @param callback - An optional callback, a Promise will be returned if none is provided + */ + indexes(): Promise; + indexes(callback: Callback): void; + indexes(options: IndexInformationOptions): Promise; + indexes(options: IndexInformationOptions, callback: Callback): void; + indexes( + options?: IndexInformationOptions | Callback, + callback?: Callback + ): Promise | void { + if (typeof options === 'function') (callback = options), (options = {}); + + return executeOperation( + this.s.db.s.client, + new IndexesOperation(this as TODO_NODE_3286, resolveOptions(this, options)), + callback + ); + } + + /** + * Get all the collection statistics. + * + * @param options - Optional settings for the command + * @param callback - An optional callback, a Promise will be returned if none is provided + */ + stats(): Promise; + stats(callback: Callback): void; + stats(options: CollStatsOptions): Promise; + stats(options: CollStatsOptions, callback: Callback): void; + stats( + options?: CollStatsOptions | Callback, + callback?: Callback + ): Promise | void { + if (typeof options === 'function') (callback = options), (options = {}); + options = options ?? {}; + + return executeOperation( + this.s.db.s.client, + new CollStatsOperation(this as TODO_NODE_3286, options), + callback + ); + } + + /** + * Find a document and delete it in one atomic operation. Requires a write lock for the duration of the operation. + * + * @param filter - The filter used to select the document to remove + * @param options - Optional settings for the command + * @param callback - An optional callback, a Promise will be returned if none is provided + */ + findOneAndDelete(filter: Filter): Promise>; + findOneAndDelete( + filter: Filter, + options: FindOneAndDeleteOptions + ): Promise>; + findOneAndDelete(filter: Filter, callback: Callback>): void; + findOneAndDelete( + filter: Filter, + options: FindOneAndDeleteOptions, + callback: Callback> + ): void; + findOneAndDelete( + filter: Filter, + options?: FindOneAndDeleteOptions | Callback>, + callback?: Callback> + ): Promise | void { + if (typeof options === 'function') (callback = options), (options = {}); + + return executeOperation( + this.s.db.s.client, + new FindOneAndDeleteOperation( + this as TODO_NODE_3286, + filter, + resolveOptions(this, options) + ) as TODO_NODE_3286, + callback + ); + } + + /** + * Find a document and replace it in one atomic operation. Requires a write lock for the duration of the operation. + * + * @param filter - The filter used to select the document to replace + * @param replacement - The Document that replaces the matching document + * @param options - Optional settings for the command + * @param callback - An optional callback, a Promise will be returned if none is provided + */ + findOneAndReplace( + filter: Filter, + replacement: WithoutId + ): Promise>; + findOneAndReplace( + filter: Filter, + replacement: WithoutId, + callback: Callback> + ): void; + findOneAndReplace( + filter: Filter, + replacement: WithoutId, + options: FindOneAndReplaceOptions + ): Promise>; + findOneAndReplace( + filter: Filter, + replacement: WithoutId, + options: FindOneAndReplaceOptions, + callback: Callback> + ): void; + findOneAndReplace( + filter: Filter, + replacement: WithoutId, + options?: FindOneAndReplaceOptions | Callback>, + callback?: Callback> + ): Promise> | void { + if (typeof options === 'function') (callback = options), (options = {}); + + return executeOperation( + this.s.db.s.client, + new FindOneAndReplaceOperation( + this as TODO_NODE_3286, + filter, + replacement, + resolveOptions(this, options) + ) as TODO_NODE_3286, + callback + ); + } + + /** + * Find a document and update it in one atomic operation. Requires a write lock for the duration of the operation. + * + * @param filter - The filter used to select the document to update + * @param update - Update operations to be performed on the document + * @param options - Optional settings for the command + * @param callback - An optional callback, a Promise will be returned if none is provided + */ + findOneAndUpdate( + filter: Filter, + update: UpdateFilter + ): Promise>; + findOneAndUpdate( + filter: Filter, + update: UpdateFilter, + callback: Callback> + ): void; + findOneAndUpdate( + filter: Filter, + update: UpdateFilter, + options: FindOneAndUpdateOptions + ): Promise>; + findOneAndUpdate( + filter: Filter, + update: UpdateFilter, + options: FindOneAndUpdateOptions, + callback: Callback> + ): void; + findOneAndUpdate( + filter: Filter, + update: UpdateFilter, + options?: FindOneAndUpdateOptions | Callback>, + callback?: Callback> + ): Promise> | void { + if (typeof options === 'function') (callback = options), (options = {}); + + return executeOperation( + this.s.db.s.client, + new FindOneAndUpdateOperation( + this as TODO_NODE_3286, + filter, + update, + resolveOptions(this, options) + ) as TODO_NODE_3286, + callback + ); + } + + /** + * Execute an aggregation framework pipeline against the collection, needs MongoDB \>= 2.2 + * + * @param pipeline - An array of aggregation pipelines to execute + * @param options - Optional settings for the command + */ + aggregate( + pipeline: Document[] = [], + options?: AggregateOptions + ): AggregationCursor { + if (arguments.length > 2) { + throw new MongoInvalidArgumentError( + 'Method "collection.aggregate()" accepts at most two arguments' + ); + } + if (!Array.isArray(pipeline)) { + throw new MongoInvalidArgumentError( + 'Argument "pipeline" must be an array of aggregation stages' + ); + } + if (typeof options === 'function') { + throw new MongoInvalidArgumentError('Argument "options" must not be function'); + } + + return new AggregationCursor( + this.s.db.s.client, + this.s.namespace, + pipeline, + resolveOptions(this, options) + ); + } + + /** + * Create a new Change Stream, watching for new changes (insertions, updates, replacements, deletions, and invalidations) in this collection. + * + * @remarks + * watch() accepts two generic arguments for distinct usecases: + * - The first is to override the schema that may be defined for this specific collection + * - The second is to override the shape of the change stream document entirely, if it is not provided the type will default to ChangeStreamDocument of the first argument + * @example + * By just providing the first argument I can type the change to be `ChangeStreamDocument<{ _id: number }>` + * ```ts + * collection.watch<{ _id: number }>() + * .on('change', change => console.log(change._id.toFixed(4))); + * ``` + * + * @example + * Passing a second argument provides a way to reflect the type changes caused by an advanced pipeline. + * Here, we are using a pipeline to have MongoDB filter for insert changes only and add a comment. + * No need start from scratch on the ChangeStreamInsertDocument type! + * By using an intersection we can save time and ensure defaults remain the same type! + * ```ts + * collection + * .watch & { comment: string }>([ + * { $addFields: { comment: 'big changes' } }, + * { $match: { operationType: 'insert' } } + * ]) + * .on('change', change => { + * change.comment.startsWith('big'); + * change.operationType === 'insert'; + * // No need to narrow in code because the generics did that for us! + * expectType(change.fullDocument); + * }); + * ``` + * + * @param pipeline - An array of {@link https://docs.mongodb.com/manual/reference/operator/aggregation-pipeline/|aggregation pipeline stages} through which to pass change stream documents. This allows for filtering (using $match) and manipulating the change stream documents. + * @param options - Optional settings for the command + * @typeParam TLocal - Type of the data being detected by the change stream + * @typeParam TChange - Type of the whole change stream document emitted + */ + watch>( + pipeline: Document[] = [], + options: ChangeStreamOptions = {} + ): ChangeStream { + // Allow optionally not specifying a pipeline + if (!Array.isArray(pipeline)) { + options = pipeline; + pipeline = []; + } + + return new ChangeStream(this, pipeline, resolveOptions(this, options)); + } + + /** + * Run Map Reduce across a collection. Be aware that the inline option for out will return an array of results not a collection. + * + * @deprecated collection.mapReduce is deprecated. Use the aggregation pipeline instead. Visit https://docs.mongodb.com/manual/reference/map-reduce-to-aggregation-pipeline for more information on how to translate map-reduce operations to the aggregation pipeline. + * @param map - The mapping function. + * @param reduce - The reduce function. + * @param options - Optional settings for the command + * @param callback - An optional callback, a Promise will be returned if none is provided + */ + mapReduce( + map: string | MapFunction, + reduce: string | ReduceFunction + ): Promise; + mapReduce( + map: string | MapFunction, + reduce: string | ReduceFunction, + callback: Callback + ): void; + mapReduce( + map: string | MapFunction, + reduce: string | ReduceFunction, + options: MapReduceOptions + ): Promise; + mapReduce( + map: string | MapFunction, + reduce: string | ReduceFunction, + options: MapReduceOptions, + callback: Callback + ): void; + mapReduce( + map: string | MapFunction, + reduce: string | ReduceFunction, + options?: MapReduceOptions | Callback, + callback?: Callback + ): Promise | void { + emitWarningOnce( + 'collection.mapReduce is deprecated. Use the aggregation pipeline instead. Visit https://docs.mongodb.com/manual/reference/map-reduce-to-aggregation-pipeline for more information on how to translate map-reduce operations to the aggregation pipeline.' + ); + if ('function' === typeof options) (callback = options), (options = {}); + // Out must always be defined (make sure we don't break weirdly on pre 1.8+ servers) + // TODO NODE-3339: Figure out if this is still necessary given we no longer officially support pre-1.8 + if (options?.out == null) { + throw new MongoInvalidArgumentError( + 'Option "out" must be defined, see mongodb docs for possible values' + ); + } + + if ('function' === typeof map) { + map = map.toString(); + } + + if ('function' === typeof reduce) { + reduce = reduce.toString(); + } + + if ('function' === typeof options.finalize) { + options.finalize = options.finalize.toString(); + } + + return executeOperation( + this.s.db.s.client, + new MapReduceOperation( + this as TODO_NODE_3286, + map, + reduce, + resolveOptions(this, options) as TODO_NODE_3286 + ), + callback + ); + } + + /** Initiate an Out of order batch write operation. All operations will be buffered into insert/update/remove commands executed out of order. */ + initializeUnorderedBulkOp(options?: BulkWriteOptions): UnorderedBulkOperation { + return new UnorderedBulkOperation(this as TODO_NODE_3286, resolveOptions(this, options)); + } + + /** Initiate an In order bulk write operation. Operations will be serially executed in the order they are added, creating a new operation for each switch in types. */ + initializeOrderedBulkOp(options?: BulkWriteOptions): OrderedBulkOperation { + return new OrderedBulkOperation(this as TODO_NODE_3286, resolveOptions(this, options)); + } + + /** Get the db scoped logger */ + getLogger(): Logger { + return this.s.db.s.logger; + } + + get logger(): Logger { + return this.s.db.s.logger; + } + + /** + * Inserts a single document or a an array of documents into MongoDB. If documents passed in do not contain the **_id** field, + * one will be added to each of the documents missing it by the driver, mutating the document. This behavior + * can be overridden by setting the **forceServerObjectId** flag. + * + * @deprecated Use insertOne, insertMany or bulkWrite instead. + * @param docs - The documents to insert + * @param options - Optional settings for the command + * @param callback - An optional callback, a Promise will be returned if none is provided + */ + insert( + docs: OptionalUnlessRequiredId[], + options: BulkWriteOptions, + callback: Callback> + ): Promise> | void { + emitWarningOnce( + 'collection.insert is deprecated. Use insertOne, insertMany or bulkWrite instead.' + ); + if (typeof options === 'function') (callback = options), (options = {}); + options = options || { ordered: false }; + docs = !Array.isArray(docs) ? [docs] : docs; + + if (options.keepGoing === true) { + options.ordered = false; + } + + return this.insertMany(docs, options, callback); + } + + /** + * Updates documents. + * + * @deprecated use updateOne, updateMany or bulkWrite + * @param selector - The selector for the update operation. + * @param update - The update operations to be applied to the documents + * @param options - Optional settings for the command + * @param callback - An optional callback, a Promise will be returned if none is provided + */ + update( + selector: Filter, + update: UpdateFilter, + options: UpdateOptions, + callback: Callback + ): Promise | void { + emitWarningOnce( + 'collection.update is deprecated. Use updateOne, updateMany, or bulkWrite instead.' + ); + if (typeof options === 'function') (callback = options), (options = {}); + options = options ?? {}; + + return this.updateMany(selector, update, options, callback); + } + + /** + * Remove documents. + * + * @deprecated use deleteOne, deleteMany or bulkWrite + * @param selector - The selector for the update operation. + * @param options - Optional settings for the command + * @param callback - An optional callback, a Promise will be returned if none is provided + */ + remove( + selector: Filter, + options: DeleteOptions, + callback: Callback + ): Promise | void { + emitWarningOnce( + 'collection.remove is deprecated. Use deleteOne, deleteMany, or bulkWrite instead.' + ); + if (typeof options === 'function') (callback = options), (options = {}); + options = options ?? {}; + + return this.deleteMany(selector, options, callback); + } + + /** + * An estimated count of matching documents in the db to a filter. + * + * **NOTE:** This method has been deprecated, since it does not provide an accurate count of the documents + * in a collection. To obtain an accurate count of documents in the collection, use {@link Collection#countDocuments| countDocuments}. + * To obtain an estimated count of all documents in the collection, use {@link Collection#estimatedDocumentCount| estimatedDocumentCount}. + * + * @deprecated use {@link Collection#countDocuments| countDocuments} or {@link Collection#estimatedDocumentCount| estimatedDocumentCount} instead + * + * @param filter - The filter for the count. + * @param options - Optional settings for the command + * @param callback - An optional callback, a Promise will be returned if none is provided + */ + count(): Promise; + count(callback: Callback): void; + count(filter: Filter): Promise; + count(filter: Filter, callback: Callback): void; + count(filter: Filter, options: CountOptions): Promise; + count( + filter: Filter, + options: CountOptions, + callback: Callback + ): Promise | void; + count( + filter?: Filter | CountOptions | Callback, + options?: CountOptions | Callback, + callback?: Callback + ): Promise | void { + if (typeof filter === 'function') { + (callback = filter as Callback), (filter = {}), (options = {}); + } else { + if (typeof options === 'function') (callback = options), (options = {}); + } + + filter ??= {}; + return executeOperation( + this.s.db.s.client, + new CountOperation( + MongoDBNamespace.fromString(this.namespace), + filter, + resolveOptions(this, options) + ), + callback + ); + } +} diff --git a/node_modules/mongodb/src/connection_string.ts b/node_modules/mongodb/src/connection_string.ts new file mode 100644 index 000000000..5b3d494a7 --- /dev/null +++ b/node_modules/mongodb/src/connection_string.ts @@ -0,0 +1,1267 @@ +import * as dns from 'dns'; +import * as fs from 'fs'; +import ConnectionString from 'mongodb-connection-string-url'; +import { URLSearchParams } from 'url'; + +import type { Document } from './bson'; +import { MongoCredentials } from './cmap/auth/mongo_credentials'; +import { AUTH_MECHS_AUTH_SRC_EXTERNAL, AuthMechanism } from './cmap/auth/providers'; +import { Compressor, CompressorName } from './cmap/wire_protocol/compression'; +import { Encrypter } from './encrypter'; +import { MongoAPIError, MongoInvalidArgumentError, MongoParseError } from './error'; +import { Logger, LoggerLevel } from './logger'; +import { + DriverInfo, + MongoClient, + MongoClientOptions, + MongoOptions, + PkFactory, + ServerApi, + ServerApiVersion +} from './mongo_client'; +import { PromiseProvider } from './promise_provider'; +import { ReadConcern, ReadConcernLevel } from './read_concern'; +import { ReadPreference, ReadPreferenceMode } from './read_preference'; +import type { TagSet } from './sdam/server_description'; +import { + AnyOptions, + Callback, + DEFAULT_PK_FACTORY, + emitWarning, + emitWarningOnce, + HostAddress, + isRecord, + makeClientMetadata, + setDifference +} from './utils'; +import { W, WriteConcern } from './write_concern'; + +const VALID_TXT_RECORDS = ['authSource', 'replicaSet', 'loadBalanced']; + +const LB_SINGLE_HOST_ERROR = 'loadBalanced option only supported with a single host in the URI'; +const LB_REPLICA_SET_ERROR = 'loadBalanced option not supported with a replicaSet option'; +const LB_DIRECT_CONNECTION_ERROR = + 'loadBalanced option not supported when directConnection is provided'; + +/** + * Determines whether a provided address matches the provided parent domain in order + * to avoid certain attack vectors. + * + * @param srvAddress - The address to check against a domain + * @param parentDomain - The domain to check the provided address against + * @returns Whether the provided address matches the parent domain + */ +function matchesParentDomain(srvAddress: string, parentDomain: string): boolean { + const regex = /^.*?\./; + const srv = `.${srvAddress.replace(regex, '')}`; + const parent = `.${parentDomain.replace(regex, '')}`; + return srv.endsWith(parent); +} + +/** + * Lookup a `mongodb+srv` connection string, combine the parts and reparse it as a normal + * connection string. + * + * @param uri - The connection string to parse + * @param options - Optional user provided connection string options + */ +export function resolveSRVRecord(options: MongoOptions, callback: Callback): void { + if (typeof options.srvHost !== 'string') { + return callback(new MongoAPIError('Option "srvHost" must not be empty')); + } + + if (options.srvHost.split('.').length < 3) { + // TODO(NODE-3484): Replace with MongoConnectionStringError + return callback(new MongoAPIError('URI must include hostname, domain name, and tld')); + } + + // Resolve the SRV record and use the result as the list of hosts to connect to. + const lookupAddress = options.srvHost; + dns.resolveSrv(`_${options.srvServiceName}._tcp.${lookupAddress}`, (err, addresses) => { + if (err) return callback(err); + + if (addresses.length === 0) { + return callback(new MongoAPIError('No addresses found at host')); + } + + for (const { name } of addresses) { + if (!matchesParentDomain(name, lookupAddress)) { + return callback(new MongoAPIError('Server record does not share hostname with parent URI')); + } + } + + const hostAddresses = addresses.map(r => + HostAddress.fromString(`${r.name}:${r.port ?? 27017}`) + ); + + const lbError = validateLoadBalancedOptions(hostAddresses, options, true); + if (lbError) { + return callback(lbError); + } + + // Resolve TXT record and add options from there if they exist. + dns.resolveTxt(lookupAddress, (err, record) => { + if (err) { + if (err.code !== 'ENODATA' && err.code !== 'ENOTFOUND') { + return callback(err); + } + } else { + if (record.length > 1) { + return callback(new MongoParseError('Multiple text records not allowed')); + } + + const txtRecordOptions = new URLSearchParams(record[0].join('')); + const txtRecordOptionKeys = [...txtRecordOptions.keys()]; + if (txtRecordOptionKeys.some(key => !VALID_TXT_RECORDS.includes(key))) { + return callback( + new MongoParseError(`Text record may only set any of: ${VALID_TXT_RECORDS.join(', ')}`) + ); + } + + if (VALID_TXT_RECORDS.some(option => txtRecordOptions.get(option) === '')) { + return callback(new MongoParseError('Cannot have empty URI params in DNS TXT Record')); + } + + const source = txtRecordOptions.get('authSource') ?? undefined; + const replicaSet = txtRecordOptions.get('replicaSet') ?? undefined; + const loadBalanced = txtRecordOptions.get('loadBalanced') ?? undefined; + + if ( + !options.userSpecifiedAuthSource && + source && + options.credentials && + !AUTH_MECHS_AUTH_SRC_EXTERNAL.has(options.credentials.mechanism) + ) { + options.credentials = MongoCredentials.merge(options.credentials, { source }); + } + + if (!options.userSpecifiedReplicaSet && replicaSet) { + options.replicaSet = replicaSet; + } + + if (loadBalanced === 'true') { + options.loadBalanced = true; + } + + if (options.replicaSet && options.srvMaxHosts > 0) { + return callback(new MongoParseError('Cannot combine replicaSet option with srvMaxHosts')); + } + + const lbError = validateLoadBalancedOptions(hostAddresses, options, true); + if (lbError) { + return callback(lbError); + } + } + + callback(undefined, hostAddresses); + }); + }); +} + +/** + * Checks if TLS options are valid + * + * @param options - The options used for options parsing + * @throws MongoParseError if TLS options are invalid + */ +export function checkTLSOptions(options: AnyOptions): void { + if (!options) return; + const check = (a: string, b: string) => { + if (Reflect.has(options, a) && Reflect.has(options, b)) { + throw new MongoParseError(`The '${a}' option cannot be used with '${b}'`); + } + }; + check('tlsInsecure', 'tlsAllowInvalidCertificates'); + check('tlsInsecure', 'tlsAllowInvalidHostnames'); + check('tlsInsecure', 'tlsDisableCertificateRevocationCheck'); + check('tlsInsecure', 'tlsDisableOCSPEndpointCheck'); + check('tlsAllowInvalidCertificates', 'tlsDisableCertificateRevocationCheck'); + check('tlsAllowInvalidCertificates', 'tlsDisableOCSPEndpointCheck'); + check('tlsDisableCertificateRevocationCheck', 'tlsDisableOCSPEndpointCheck'); +} + +const TRUTHS = new Set(['true', 't', '1', 'y', 'yes']); +const FALSEHOODS = new Set(['false', 'f', '0', 'n', 'no', '-1']); +function getBoolean(name: string, value: unknown): boolean { + if (typeof value === 'boolean') return value; + const valueString = String(value).toLowerCase(); + if (TRUTHS.has(valueString)) { + if (valueString !== 'true') { + emitWarningOnce( + `deprecated value for ${name} : ${valueString} - please update to ${name} : true instead` + ); + } + return true; + } + if (FALSEHOODS.has(valueString)) { + if (valueString !== 'false') { + emitWarningOnce( + `deprecated value for ${name} : ${valueString} - please update to ${name} : false instead` + ); + } + return false; + } + throw new MongoParseError(`Expected ${name} to be stringified boolean value, got: ${value}`); +} + +function getInt(name: string, value: unknown): number { + if (typeof value === 'number') return Math.trunc(value); + const parsedValue = Number.parseInt(String(value), 10); + if (!Number.isNaN(parsedValue)) return parsedValue; + throw new MongoParseError(`Expected ${name} to be stringified int value, got: ${value}`); +} + +function getUint(name: string, value: unknown): number { + const parsedValue = getInt(name, value); + if (parsedValue < 0) { + throw new MongoParseError(`${name} can only be a positive int value, got: ${value}`); + } + return parsedValue; +} + +function* entriesFromString(value: string): Generator<[string, string]> { + const keyValuePairs = value.split(','); + for (const keyValue of keyValuePairs) { + const [key, value] = keyValue.split(':'); + if (value == null) { + throw new MongoParseError('Cannot have undefined values in key value pairs'); + } + + yield [key, value]; + } +} + +class CaseInsensitiveMap extends Map { + constructor(entries: Array<[string, any]> = []) { + super(entries.map(([k, v]) => [k.toLowerCase(), v])); + } + override has(k: string) { + return super.has(k.toLowerCase()); + } + override get(k: string) { + return super.get(k.toLowerCase()); + } + override set(k: string, v: any) { + return super.set(k.toLowerCase(), v); + } + override delete(k: string): boolean { + return super.delete(k.toLowerCase()); + } +} + +export function parseOptions( + uri: string, + mongoClient: MongoClient | MongoClientOptions | undefined = undefined, + options: MongoClientOptions = {} +): MongoOptions { + if (mongoClient != null && !(mongoClient instanceof MongoClient)) { + options = mongoClient; + mongoClient = undefined; + } + + const url = new ConnectionString(uri); + const { hosts, isSRV } = url; + + const mongoOptions = Object.create(null); + + // Feature flags + for (const flag of Object.getOwnPropertySymbols(options)) { + if (FEATURE_FLAGS.has(flag)) { + mongoOptions[flag] = options[flag]; + } + } + + mongoOptions.hosts = isSRV ? [] : hosts.map(HostAddress.fromString); + + const urlOptions = new CaseInsensitiveMap(); + + if (url.pathname !== '/' && url.pathname !== '') { + const dbName = decodeURIComponent( + url.pathname[0] === '/' ? url.pathname.slice(1) : url.pathname + ); + if (dbName) { + urlOptions.set('dbName', [dbName]); + } + } + + if (url.username !== '') { + const auth: Document = { + username: decodeURIComponent(url.username) + }; + + if (typeof url.password === 'string') { + auth.password = decodeURIComponent(url.password); + } + + urlOptions.set('auth', [auth]); + } + + for (const key of url.searchParams.keys()) { + const values = [...url.searchParams.getAll(key)]; + + if (values.includes('')) { + throw new MongoAPIError('URI cannot contain options with no value'); + } + + if (!urlOptions.has(key)) { + urlOptions.set(key, values); + } + } + + const objectOptions = new CaseInsensitiveMap( + Object.entries(options).filter(([, v]) => v != null) + ); + + // Validate options that can only be provided by one of uri or object + + if (urlOptions.has('serverApi')) { + throw new MongoParseError( + 'URI cannot contain `serverApi`, it can only be passed to the client' + ); + } + + if (objectOptions.has('loadBalanced')) { + throw new MongoParseError('loadBalanced is only a valid option in the URI'); + } + + // All option collection + + const allOptions = new CaseInsensitiveMap(); + + const allKeys = new Set([ + ...urlOptions.keys(), + ...objectOptions.keys(), + ...DEFAULT_OPTIONS.keys() + ]); + + for (const key of allKeys) { + const values = []; + const objectOptionValue = objectOptions.get(key); + if (objectOptionValue != null) { + values.push(objectOptionValue); + } + const urlValue = urlOptions.get(key); + if (urlValue != null) { + values.push(...urlValue); + } + const defaultOptionsValue = DEFAULT_OPTIONS.get(key); + if (defaultOptionsValue != null) { + values.push(defaultOptionsValue); + } + allOptions.set(key, values); + } + + if (allOptions.has('tlsCertificateKeyFile') && !allOptions.has('tlsCertificateFile')) { + allOptions.set('tlsCertificateFile', allOptions.get('tlsCertificateKeyFile')); + } + + if (allOptions.has('tls') || allOptions.has('ssl')) { + const tlsAndSslOpts = (allOptions.get('tls') || []) + .concat(allOptions.get('ssl') || []) + .map(getBoolean.bind(null, 'tls/ssl')); + if (new Set(tlsAndSslOpts).size !== 1) { + throw new MongoParseError('All values of tls/ssl must be the same.'); + } + } + + const unsupportedOptions = setDifference( + allKeys, + Array.from(Object.keys(OPTIONS)).map(s => s.toLowerCase()) + ); + if (unsupportedOptions.size !== 0) { + const optionWord = unsupportedOptions.size > 1 ? 'options' : 'option'; + const isOrAre = unsupportedOptions.size > 1 ? 'are' : 'is'; + throw new MongoParseError( + `${optionWord} ${Array.from(unsupportedOptions).join(', ')} ${isOrAre} not supported` + ); + } + + // Option parsing and setting + + for (const [key, descriptor] of Object.entries(OPTIONS)) { + const values = allOptions.get(key); + if (!values || values.length === 0) continue; + setOption(mongoOptions, key, descriptor, values); + } + + if (mongoOptions.credentials) { + const isGssapi = mongoOptions.credentials.mechanism === AuthMechanism.MONGODB_GSSAPI; + const isX509 = mongoOptions.credentials.mechanism === AuthMechanism.MONGODB_X509; + const isAws = mongoOptions.credentials.mechanism === AuthMechanism.MONGODB_AWS; + if ( + (isGssapi || isX509) && + allOptions.has('authSource') && + mongoOptions.credentials.source !== '$external' + ) { + // If authSource was explicitly given and its incorrect, we error + throw new MongoParseError( + `${mongoOptions.credentials} can only have authSource set to '$external'` + ); + } + + if (!(isGssapi || isX509 || isAws) && mongoOptions.dbName && !allOptions.has('authSource')) { + // inherit the dbName unless GSSAPI or X509, then silently ignore dbName + // and there was no specific authSource given + mongoOptions.credentials = MongoCredentials.merge(mongoOptions.credentials, { + source: mongoOptions.dbName + }); + } + + mongoOptions.credentials.validate(); + + // Check if the only auth related option provided was authSource, if so we can remove credentials + if ( + mongoOptions.credentials.password === '' && + mongoOptions.credentials.username === '' && + mongoOptions.credentials.mechanism === AuthMechanism.MONGODB_DEFAULT && + Object.keys(mongoOptions.credentials.mechanismProperties).length === 0 + ) { + delete mongoOptions.credentials; + } + } + + if (!mongoOptions.dbName) { + // dbName default is applied here because of the credential validation above + mongoOptions.dbName = 'test'; + } + + checkTLSOptions(mongoOptions); + + if (options.promiseLibrary) PromiseProvider.set(options.promiseLibrary); + + const lbError = validateLoadBalancedOptions(hosts, mongoOptions, isSRV); + if (lbError) { + throw lbError; + } + if (mongoClient && mongoOptions.autoEncryption) { + Encrypter.checkForMongoCrypt(); + mongoOptions.encrypter = new Encrypter(mongoClient, uri, options); + mongoOptions.autoEncrypter = mongoOptions.encrypter.autoEncrypter; + } + + // Potential SRV Overrides and SRV connection string validations + + mongoOptions.userSpecifiedAuthSource = + objectOptions.has('authSource') || urlOptions.has('authSource'); + mongoOptions.userSpecifiedReplicaSet = + objectOptions.has('replicaSet') || urlOptions.has('replicaSet'); + + if (isSRV) { + // SRV Record is resolved upon connecting + mongoOptions.srvHost = hosts[0]; + + if (mongoOptions.directConnection) { + throw new MongoAPIError('SRV URI does not support directConnection'); + } + + if (mongoOptions.srvMaxHosts > 0 && typeof mongoOptions.replicaSet === 'string') { + throw new MongoParseError('Cannot use srvMaxHosts option with replicaSet'); + } + + // SRV turns on TLS by default, but users can override and turn it off + const noUserSpecifiedTLS = !objectOptions.has('tls') && !urlOptions.has('tls'); + const noUserSpecifiedSSL = !objectOptions.has('ssl') && !urlOptions.has('ssl'); + if (noUserSpecifiedTLS && noUserSpecifiedSSL) { + mongoOptions.tls = true; + } + } else { + const userSpecifiedSrvOptions = + urlOptions.has('srvMaxHosts') || + objectOptions.has('srvMaxHosts') || + urlOptions.has('srvServiceName') || + objectOptions.has('srvServiceName'); + + if (userSpecifiedSrvOptions) { + throw new MongoParseError( + 'Cannot use srvMaxHosts or srvServiceName with a non-srv connection string' + ); + } + } + + if (mongoOptions.directConnection && mongoOptions.hosts.length !== 1) { + throw new MongoParseError('directConnection option requires exactly one host'); + } + + if ( + !mongoOptions.proxyHost && + (mongoOptions.proxyPort || mongoOptions.proxyUsername || mongoOptions.proxyPassword) + ) { + throw new MongoParseError('Must specify proxyHost if other proxy options are passed'); + } + + if ( + (mongoOptions.proxyUsername && !mongoOptions.proxyPassword) || + (!mongoOptions.proxyUsername && mongoOptions.proxyPassword) + ) { + throw new MongoParseError('Can only specify both of proxy username/password or neither'); + } + + const proxyOptions = ['proxyHost', 'proxyPort', 'proxyUsername', 'proxyPassword'].map( + key => urlOptions.get(key) ?? [] + ); + + if (proxyOptions.some(options => options.length > 1)) { + throw new MongoParseError( + 'Proxy options cannot be specified multiple times in the connection string' + ); + } + + return mongoOptions; +} + +function validateLoadBalancedOptions( + hosts: HostAddress[] | string[], + mongoOptions: MongoOptions, + isSrv: boolean +): MongoParseError | undefined { + if (mongoOptions.loadBalanced) { + if (hosts.length > 1) { + return new MongoParseError(LB_SINGLE_HOST_ERROR); + } + if (mongoOptions.replicaSet) { + return new MongoParseError(LB_REPLICA_SET_ERROR); + } + if (mongoOptions.directConnection) { + return new MongoParseError(LB_DIRECT_CONNECTION_ERROR); + } + + if (isSrv && mongoOptions.srvMaxHosts > 0) { + return new MongoParseError('Cannot limit srv hosts with loadBalanced enabled'); + } + } + return; +} + +function setOption( + mongoOptions: any, + key: string, + descriptor: OptionDescriptor, + values: unknown[] +) { + const { target, type, transform, deprecated } = descriptor; + const name = target ?? key; + + if (deprecated) { + const deprecatedMsg = typeof deprecated === 'string' ? `: ${deprecated}` : ''; + emitWarning(`${key} is a deprecated option${deprecatedMsg}`); + } + + switch (type) { + case 'boolean': + mongoOptions[name] = getBoolean(name, values[0]); + break; + case 'int': + mongoOptions[name] = getInt(name, values[0]); + break; + case 'uint': + mongoOptions[name] = getUint(name, values[0]); + break; + case 'string': + if (values[0] == null) { + break; + } + mongoOptions[name] = String(values[0]); + break; + case 'record': + if (!isRecord(values[0])) { + throw new MongoParseError(`${name} must be an object`); + } + mongoOptions[name] = values[0]; + break; + case 'any': + mongoOptions[name] = values[0]; + break; + default: { + if (!transform) { + throw new MongoParseError('Descriptors missing a type must define a transform'); + } + const transformValue = transform({ name, options: mongoOptions, values }); + mongoOptions[name] = transformValue; + break; + } + } +} + +interface OptionDescriptor { + target?: string; + type?: 'boolean' | 'int' | 'uint' | 'record' | 'string' | 'any'; + default?: any; + + deprecated?: boolean | string; + /** + * @param name - the original option name + * @param options - the options so far for resolution + * @param values - the possible values in precedence order + */ + transform?: (args: { name: string; options: MongoOptions; values: unknown[] }) => unknown; +} + +export const OPTIONS = { + appName: { + target: 'metadata', + transform({ options, values: [value] }): DriverInfo { + return makeClientMetadata({ ...options.driverInfo, appName: String(value) }); + } + }, + auth: { + target: 'credentials', + transform({ name, options, values: [value] }): MongoCredentials { + if (!isRecord(value, ['username', 'password'] as const)) { + throw new MongoParseError( + `${name} must be an object with 'username' and 'password' properties` + ); + } + return MongoCredentials.merge(options.credentials, { + username: value.username, + password: value.password + }); + } + }, + authMechanism: { + target: 'credentials', + transform({ options, values: [value] }): MongoCredentials { + const mechanisms = Object.values(AuthMechanism); + const [mechanism] = mechanisms.filter(m => m.match(RegExp(String.raw`\b${value}\b`, 'i'))); + if (!mechanism) { + throw new MongoParseError(`authMechanism one of ${mechanisms}, got ${value}`); + } + let source = options.credentials?.source; + if ( + mechanism === AuthMechanism.MONGODB_PLAIN || + AUTH_MECHS_AUTH_SRC_EXTERNAL.has(mechanism) + ) { + // some mechanisms have '$external' as the Auth Source + source = '$external'; + } + + let password = options.credentials?.password; + if (mechanism === AuthMechanism.MONGODB_X509 && password === '') { + password = undefined; + } + return MongoCredentials.merge(options.credentials, { + mechanism, + source, + password + }); + } + }, + authMechanismProperties: { + target: 'credentials', + transform({ options, values: [optionValue] }): MongoCredentials { + if (typeof optionValue === 'string') { + const mechanismProperties = Object.create(null); + + for (const [key, value] of entriesFromString(optionValue)) { + try { + mechanismProperties[key] = getBoolean(key, value); + } catch { + mechanismProperties[key] = value; + } + } + + return MongoCredentials.merge(options.credentials, { + mechanismProperties + }); + } + if (!isRecord(optionValue)) { + throw new MongoParseError('AuthMechanismProperties must be an object'); + } + return MongoCredentials.merge(options.credentials, { mechanismProperties: optionValue }); + } + }, + authSource: { + target: 'credentials', + transform({ options, values: [value] }): MongoCredentials { + const source = String(value); + return MongoCredentials.merge(options.credentials, { source }); + } + }, + autoEncryption: { + type: 'record' + }, + bsonRegExp: { + type: 'boolean' + }, + serverApi: { + target: 'serverApi', + transform({ values: [version] }): ServerApi { + const serverApiToValidate = + typeof version === 'string' ? ({ version } as ServerApi) : (version as ServerApi); + const versionToValidate = serverApiToValidate && serverApiToValidate.version; + if (!versionToValidate) { + throw new MongoParseError( + `Invalid \`serverApi\` property; must specify a version from the following enum: ["${Object.values( + ServerApiVersion + ).join('", "')}"]` + ); + } + if (!Object.values(ServerApiVersion).some(v => v === versionToValidate)) { + throw new MongoParseError( + `Invalid server API version=${versionToValidate}; must be in the following enum: ["${Object.values( + ServerApiVersion + ).join('", "')}"]` + ); + } + return serverApiToValidate; + } + }, + checkKeys: { + type: 'boolean' + }, + compressors: { + default: 'none', + target: 'compressors', + transform({ values }) { + const compressionList = new Set(); + for (const compVal of values as (CompressorName[] | string)[]) { + const compValArray = typeof compVal === 'string' ? compVal.split(',') : compVal; + if (!Array.isArray(compValArray)) { + throw new MongoInvalidArgumentError( + 'compressors must be an array or a comma-delimited list of strings' + ); + } + for (const c of compValArray) { + if (Object.keys(Compressor).includes(String(c))) { + compressionList.add(String(c)); + } else { + throw new MongoInvalidArgumentError( + `${c} is not a valid compression mechanism. Must be one of: ${Object.keys( + Compressor + )}.` + ); + } + } + } + return [...compressionList]; + } + }, + connectTimeoutMS: { + default: 30000, + type: 'uint' + }, + dbName: { + type: 'string' + }, + directConnection: { + default: false, + type: 'boolean' + }, + driverInfo: { + target: 'metadata', + default: makeClientMetadata(), + transform({ options, values: [value] }) { + if (!isRecord(value)) throw new MongoParseError('DriverInfo must be an object'); + return makeClientMetadata({ + driverInfo: value, + appName: options.metadata?.application?.name + }); + } + }, + enableUtf8Validation: { type: 'boolean', default: true }, + family: { + transform({ name, values: [value] }): 4 | 6 { + const transformValue = getInt(name, value); + if (transformValue === 4 || transformValue === 6) { + return transformValue; + } + throw new MongoParseError(`Option 'family' must be 4 or 6 got ${transformValue}.`); + } + }, + fieldsAsRaw: { + type: 'record' + }, + forceServerObjectId: { + default: false, + type: 'boolean' + }, + fsync: { + deprecated: 'Please use journal instead', + target: 'writeConcern', + transform({ name, options, values: [value] }): WriteConcern { + const wc = WriteConcern.fromOptions({ + writeConcern: { + ...options.writeConcern, + fsync: getBoolean(name, value) + } + }); + if (!wc) throw new MongoParseError(`Unable to make a writeConcern from fsync=${value}`); + return wc; + } + } as OptionDescriptor, + heartbeatFrequencyMS: { + default: 10000, + type: 'uint' + }, + ignoreUndefined: { + type: 'boolean' + }, + j: { + deprecated: 'Please use journal instead', + target: 'writeConcern', + transform({ name, options, values: [value] }): WriteConcern { + const wc = WriteConcern.fromOptions({ + writeConcern: { + ...options.writeConcern, + journal: getBoolean(name, value) + } + }); + if (!wc) throw new MongoParseError(`Unable to make a writeConcern from journal=${value}`); + return wc; + } + } as OptionDescriptor, + journal: { + target: 'writeConcern', + transform({ name, options, values: [value] }): WriteConcern { + const wc = WriteConcern.fromOptions({ + writeConcern: { + ...options.writeConcern, + journal: getBoolean(name, value) + } + }); + if (!wc) throw new MongoParseError(`Unable to make a writeConcern from journal=${value}`); + return wc; + } + }, + keepAlive: { + default: true, + type: 'boolean' + }, + keepAliveInitialDelay: { + default: 120000, + type: 'uint' + }, + loadBalanced: { + default: false, + type: 'boolean' + }, + localThresholdMS: { + default: 15, + type: 'uint' + }, + logger: { + default: new Logger('MongoClient'), + transform({ values: [value] }) { + if (value instanceof Logger) { + return value; + } + emitWarning('Alternative loggers might not be supported'); + // TODO: make Logger an interface that others can implement, make usage consistent in driver + // DRIVERS-1204 + return; + } + }, + loggerLevel: { + target: 'logger', + transform({ values: [value] }) { + return new Logger('MongoClient', { loggerLevel: value as LoggerLevel }); + } + }, + maxConnecting: { + default: 2, + transform({ name, values: [value] }): number { + const maxConnecting = getUint(name, value); + if (maxConnecting === 0) { + throw new MongoInvalidArgumentError('maxConnecting must be > 0 if specified'); + } + return maxConnecting; + } + }, + maxIdleTimeMS: { + default: 0, + type: 'uint' + }, + maxPoolSize: { + default: 100, + type: 'uint' + }, + maxStalenessSeconds: { + target: 'readPreference', + transform({ name, options, values: [value] }) { + const maxStalenessSeconds = getUint(name, value); + if (options.readPreference) { + return ReadPreference.fromOptions({ + readPreference: { ...options.readPreference, maxStalenessSeconds } + }); + } else { + return new ReadPreference('secondary', undefined, { maxStalenessSeconds }); + } + } + }, + minInternalBufferSize: { + type: 'uint' + }, + minPoolSize: { + default: 0, + type: 'uint' + }, + minHeartbeatFrequencyMS: { + default: 500, + type: 'uint' + }, + monitorCommands: { + default: false, + type: 'boolean' + }, + name: { + target: 'driverInfo', + transform({ values: [value], options }) { + return { ...options.driverInfo, name: String(value) }; + } + } as OptionDescriptor, + noDelay: { + default: true, + type: 'boolean' + }, + pkFactory: { + default: DEFAULT_PK_FACTORY, + transform({ values: [value] }): PkFactory { + if (isRecord(value, ['createPk'] as const) && typeof value.createPk === 'function') { + return value as PkFactory; + } + throw new MongoParseError( + `Option pkFactory must be an object with a createPk function, got ${value}` + ); + } + }, + promiseLibrary: { + deprecated: true, + type: 'any' + }, + promoteBuffers: { + type: 'boolean' + }, + promoteLongs: { + type: 'boolean' + }, + promoteValues: { + type: 'boolean' + }, + proxyHost: { + type: 'string' + }, + proxyPassword: { + type: 'string' + }, + proxyPort: { + type: 'uint' + }, + proxyUsername: { + type: 'string' + }, + raw: { + default: false, + type: 'boolean' + }, + readConcern: { + transform({ values: [value], options }) { + if (value instanceof ReadConcern || isRecord(value, ['level'] as const)) { + return ReadConcern.fromOptions({ ...options.readConcern, ...value } as any); + } + throw new MongoParseError(`ReadConcern must be an object, got ${JSON.stringify(value)}`); + } + }, + readConcernLevel: { + target: 'readConcern', + transform({ values: [level], options }) { + return ReadConcern.fromOptions({ + ...options.readConcern, + level: level as ReadConcernLevel + }); + } + }, + readPreference: { + default: ReadPreference.primary, + transform({ values: [value], options }) { + if (value instanceof ReadPreference) { + return ReadPreference.fromOptions({ + readPreference: { ...options.readPreference, ...value }, + ...value + } as any); + } + if (isRecord(value, ['mode'] as const)) { + const rp = ReadPreference.fromOptions({ + readPreference: { ...options.readPreference, ...value }, + ...value + } as any); + if (rp) return rp; + else throw new MongoParseError(`Cannot make read preference from ${JSON.stringify(value)}`); + } + if (typeof value === 'string') { + const rpOpts = { + hedge: options.readPreference?.hedge, + maxStalenessSeconds: options.readPreference?.maxStalenessSeconds + }; + return new ReadPreference( + value as ReadPreferenceMode, + options.readPreference?.tags, + rpOpts + ); + } + throw new MongoParseError(`Unknown ReadPreference value: ${value}`); + } + }, + readPreferenceTags: { + target: 'readPreference', + transform({ + values, + options + }: { + values: Array[]>; + options: MongoClientOptions; + }) { + const tags: Array> = Array.isArray(values[0]) + ? values[0] + : (values as Array); + const readPreferenceTags = []; + for (const tag of tags) { + const readPreferenceTag: TagSet = Object.create(null); + if (typeof tag === 'string') { + for (const [k, v] of entriesFromString(tag)) { + readPreferenceTag[k] = v; + } + } + if (isRecord(tag)) { + for (const [k, v] of Object.entries(tag)) { + readPreferenceTag[k] = v; + } + } + readPreferenceTags.push(readPreferenceTag); + } + return ReadPreference.fromOptions({ + readPreference: options.readPreference, + readPreferenceTags + }); + } + }, + replicaSet: { + type: 'string' + }, + retryReads: { + default: true, + type: 'boolean' + }, + retryWrites: { + default: true, + type: 'boolean' + }, + serializeFunctions: { + type: 'boolean' + }, + serverSelectionTimeoutMS: { + default: 30000, + type: 'uint' + }, + servername: { + type: 'string' + }, + socketTimeoutMS: { + default: 0, + type: 'uint' + }, + srvMaxHosts: { + type: 'uint', + default: 0 + }, + srvServiceName: { + type: 'string', + default: 'mongodb' + }, + ssl: { + target: 'tls', + type: 'boolean' + }, + sslCA: { + target: 'ca', + transform({ values: [value] }) { + return fs.readFileSync(String(value), { encoding: 'ascii' }); + } + }, + sslCRL: { + target: 'crl', + transform({ values: [value] }) { + return fs.readFileSync(String(value), { encoding: 'ascii' }); + } + }, + sslCert: { + target: 'cert', + transform({ values: [value] }) { + return fs.readFileSync(String(value), { encoding: 'ascii' }); + } + }, + sslKey: { + target: 'key', + transform({ values: [value] }) { + return fs.readFileSync(String(value), { encoding: 'ascii' }); + } + }, + sslPass: { + deprecated: true, + target: 'passphrase', + type: 'string' + }, + sslValidate: { + target: 'rejectUnauthorized', + type: 'boolean' + }, + tls: { + type: 'boolean' + }, + tlsAllowInvalidCertificates: { + target: 'rejectUnauthorized', + transform({ name, values: [value] }) { + // allowInvalidCertificates is the inverse of rejectUnauthorized + return !getBoolean(name, value); + } + }, + tlsAllowInvalidHostnames: { + target: 'checkServerIdentity', + transform({ name, values: [value] }) { + // tlsAllowInvalidHostnames means setting the checkServerIdentity function to a noop + return getBoolean(name, value) ? () => undefined : undefined; + } + }, + tlsCAFile: { + target: 'ca', + transform({ values: [value] }) { + return fs.readFileSync(String(value), { encoding: 'ascii' }); + } + }, + tlsCertificateFile: { + target: 'cert', + transform({ values: [value] }) { + return fs.readFileSync(String(value), { encoding: 'ascii' }); + } + }, + tlsCertificateKeyFile: { + target: 'key', + transform({ values: [value] }) { + return fs.readFileSync(String(value), { encoding: 'ascii' }); + } + }, + tlsCertificateKeyFilePassword: { + target: 'passphrase', + type: 'any' + }, + tlsInsecure: { + transform({ name, options, values: [value] }) { + const tlsInsecure = getBoolean(name, value); + if (tlsInsecure) { + options.checkServerIdentity = () => undefined; + options.rejectUnauthorized = false; + } else { + options.checkServerIdentity = options.tlsAllowInvalidHostnames + ? () => undefined + : undefined; + options.rejectUnauthorized = options.tlsAllowInvalidCertificates ? false : true; + } + return tlsInsecure; + } + }, + w: { + target: 'writeConcern', + transform({ values: [value], options }) { + return WriteConcern.fromOptions({ writeConcern: { ...options.writeConcern, w: value as W } }); + } + }, + waitQueueTimeoutMS: { + default: 0, + type: 'uint' + }, + writeConcern: { + target: 'writeConcern', + transform({ values: [value], options }) { + if (isRecord(value) || value instanceof WriteConcern) { + return WriteConcern.fromOptions({ + writeConcern: { + ...options.writeConcern, + ...value + } + }); + } else if (value === 'majority' || typeof value === 'number') { + return WriteConcern.fromOptions({ + writeConcern: { + ...options.writeConcern, + w: value + } + }); + } + + throw new MongoParseError(`Invalid WriteConcern cannot parse: ${JSON.stringify(value)}`); + } + } as OptionDescriptor, + wtimeout: { + deprecated: 'Please use wtimeoutMS instead', + target: 'writeConcern', + transform({ values: [value], options }) { + const wc = WriteConcern.fromOptions({ + writeConcern: { + ...options.writeConcern, + wtimeout: getUint('wtimeout', value) + } + }); + if (wc) return wc; + throw new MongoParseError(`Cannot make WriteConcern from wtimeout`); + } + } as OptionDescriptor, + wtimeoutMS: { + target: 'writeConcern', + transform({ values: [value], options }) { + const wc = WriteConcern.fromOptions({ + writeConcern: { + ...options.writeConcern, + wtimeoutMS: getUint('wtimeoutMS', value) + } + }); + if (wc) return wc; + throw new MongoParseError(`Cannot make WriteConcern from wtimeout`); + } + }, + zlibCompressionLevel: { + default: 0, + type: 'int' + }, + // Custom types for modifying core behavior + connectionType: { type: 'any' }, + srvPoller: { type: 'any' }, + // Accepted NodeJS Options + minDHSize: { type: 'any' }, + pskCallback: { type: 'any' }, + secureContext: { type: 'any' }, + enableTrace: { type: 'any' }, + requestCert: { type: 'any' }, + rejectUnauthorized: { type: 'any' }, + checkServerIdentity: { type: 'any' }, + ALPNProtocols: { type: 'any' }, + SNICallback: { type: 'any' }, + session: { type: 'any' }, + requestOCSP: { type: 'any' }, + localAddress: { type: 'any' }, + localPort: { type: 'any' }, + hints: { type: 'any' }, + lookup: { type: 'any' }, + ca: { type: 'any' }, + cert: { type: 'any' }, + ciphers: { type: 'any' }, + crl: { type: 'any' }, + ecdhCurve: { type: 'any' }, + key: { type: 'any' }, + passphrase: { type: 'any' }, + pfx: { type: 'any' }, + secureProtocol: { type: 'any' }, + index: { type: 'any' }, + // Legacy Options, these are unused but left here to avoid errors with CSFLE lib + useNewUrlParser: { type: 'boolean' } as OptionDescriptor, + useUnifiedTopology: { type: 'boolean' } as OptionDescriptor +} as Record; + +export const DEFAULT_OPTIONS = new CaseInsensitiveMap( + Object.entries(OPTIONS) + .filter(([, descriptor]) => descriptor.default != null) + .map(([k, d]) => [k, d.default]) +); + +/** + * Set of permitted feature flags + * @internal + */ +export const FEATURE_FLAGS = new Set([Symbol.for('@@mdb.skipPingOnConnect')]); diff --git a/node_modules/mongodb/src/constants.ts b/node_modules/mongodb/src/constants.ts new file mode 100644 index 000000000..2326e8d2c --- /dev/null +++ b/node_modules/mongodb/src/constants.ts @@ -0,0 +1,134 @@ +export const SYSTEM_NAMESPACE_COLLECTION = 'system.namespaces'; +export const SYSTEM_INDEX_COLLECTION = 'system.indexes'; +export const SYSTEM_PROFILE_COLLECTION = 'system.profile'; +export const SYSTEM_USER_COLLECTION = 'system.users'; +export const SYSTEM_COMMAND_COLLECTION = '$cmd'; +export const SYSTEM_JS_COLLECTION = 'system.js'; + +// events +export const ERROR = 'error' as const; +export const TIMEOUT = 'timeout' as const; +export const CLOSE = 'close' as const; +export const OPEN = 'open' as const; +export const CONNECT = 'connect' as const; +export const CLOSED = 'closed' as const; +export const ENDED = 'ended' as const; +export const MESSAGE = 'message' as const; +export const PINNED = 'pinned' as const; +export const UNPINNED = 'unpinned' as const; +export const DESCRIPTION_RECEIVED = 'descriptionReceived'; +export const SERVER_OPENING = 'serverOpening' as const; +export const SERVER_CLOSED = 'serverClosed' as const; +export const SERVER_DESCRIPTION_CHANGED = 'serverDescriptionChanged' as const; +export const TOPOLOGY_OPENING = 'topologyOpening' as const; +export const TOPOLOGY_CLOSED = 'topologyClosed' as const; +export const TOPOLOGY_DESCRIPTION_CHANGED = 'topologyDescriptionChanged' as const; +export const CONNECTION_POOL_CREATED = 'connectionPoolCreated' as const; +export const CONNECTION_POOL_CLOSED = 'connectionPoolClosed' as const; +export const CONNECTION_POOL_CLEARED = 'connectionPoolCleared' as const; +export const CONNECTION_CREATED = 'connectionCreated' as const; +export const CONNECTION_READY = 'connectionReady' as const; +export const CONNECTION_CLOSED = 'connectionClosed' as const; +export const CONNECTION_CHECK_OUT_STARTED = 'connectionCheckOutStarted' as const; +export const CONNECTION_CHECK_OUT_FAILED = 'connectionCheckOutFailed' as const; +export const CONNECTION_CHECKED_OUT = 'connectionCheckedOut' as const; +export const CONNECTION_CHECKED_IN = 'connectionCheckedIn' as const; +export const CLUSTER_TIME_RECEIVED = 'clusterTimeReceived' as const; +export const COMMAND_STARTED = 'commandStarted' as const; +export const COMMAND_SUCCEEDED = 'commandSucceeded' as const; +export const COMMAND_FAILED = 'commandFailed' as const; +export const SERVER_HEARTBEAT_STARTED = 'serverHeartbeatStarted' as const; +export const SERVER_HEARTBEAT_SUCCEEDED = 'serverHeartbeatSucceeded' as const; +export const SERVER_HEARTBEAT_FAILED = 'serverHeartbeatFailed' as const; +export const RESPONSE = 'response' as const; +export const MORE = 'more' as const; +export const INIT = 'init' as const; +export const CHANGE = 'change' as const; +export const END = 'end' as const; +export const RESUME_TOKEN_CHANGED = 'resumeTokenChanged' as const; + +/** @public */ +export const HEARTBEAT_EVENTS = Object.freeze([ + SERVER_HEARTBEAT_STARTED, + SERVER_HEARTBEAT_SUCCEEDED, + SERVER_HEARTBEAT_FAILED +] as const); + +/** @public */ +export const CMAP_EVENTS = Object.freeze([ + CONNECTION_POOL_CREATED, + CONNECTION_POOL_CLOSED, + CONNECTION_CREATED, + CONNECTION_READY, + CONNECTION_CLOSED, + CONNECTION_CHECK_OUT_STARTED, + CONNECTION_CHECK_OUT_FAILED, + CONNECTION_CHECKED_OUT, + CONNECTION_CHECKED_IN, + CONNECTION_POOL_CLEARED +] as const); + +/** @public */ +export const TOPOLOGY_EVENTS = Object.freeze([ + SERVER_OPENING, + SERVER_CLOSED, + SERVER_DESCRIPTION_CHANGED, + TOPOLOGY_OPENING, + TOPOLOGY_CLOSED, + TOPOLOGY_DESCRIPTION_CHANGED, + ERROR, + TIMEOUT, + CLOSE +] as const); + +/** @public */ +export const APM_EVENTS = Object.freeze([ + COMMAND_STARTED, + COMMAND_SUCCEEDED, + COMMAND_FAILED +] as const); + +/** + * All events that we relay to the `Topology` + * @internal + */ +export const SERVER_RELAY_EVENTS = Object.freeze([ + SERVER_HEARTBEAT_STARTED, + SERVER_HEARTBEAT_SUCCEEDED, + SERVER_HEARTBEAT_FAILED, + COMMAND_STARTED, + COMMAND_SUCCEEDED, + COMMAND_FAILED, + ...CMAP_EVENTS +] as const); + +/** + * All events we listen to from `Server` instances, but do not forward to the client + * @internal + */ +export const LOCAL_SERVER_EVENTS = Object.freeze([ + CONNECT, + DESCRIPTION_RECEIVED, + CLOSED, + ENDED +] as const); + +/** @public */ +export const MONGO_CLIENT_EVENTS = Object.freeze([ + ...CMAP_EVENTS, + ...APM_EVENTS, + ...TOPOLOGY_EVENTS, + ...HEARTBEAT_EVENTS +] as const); + +/** + * @internal + * The legacy hello command that was deprecated in MongoDB 5.0. + */ +export const LEGACY_HELLO_COMMAND = 'ismaster'; + +/** + * @internal + * The legacy hello command that was deprecated in MongoDB 5.0. + */ +export const LEGACY_HELLO_COMMAND_CAMEL_CASE = 'isMaster'; diff --git a/node_modules/mongodb/src/cursor/abstract_cursor.ts b/node_modules/mongodb/src/cursor/abstract_cursor.ts new file mode 100644 index 000000000..851f1d5f0 --- /dev/null +++ b/node_modules/mongodb/src/cursor/abstract_cursor.ts @@ -0,0 +1,920 @@ +import { Readable, Transform } from 'stream'; + +import { BSONSerializeOptions, Document, Long, pluckBSONSerializeOptions } from '../bson'; +import { + AnyError, + MongoCursorExhaustedError, + MongoCursorInUseError, + MongoInvalidArgumentError, + MongoNetworkError, + MongoRuntimeError, + MongoTailableCursorError +} from '../error'; +import type { MongoClient } from '../mongo_client'; +import { TODO_NODE_3286, TypedEventEmitter } from '../mongo_types'; +import { executeOperation, ExecutionResult } from '../operations/execute_operation'; +import { GetMoreOperation } from '../operations/get_more'; +import { ReadConcern, ReadConcernLike } from '../read_concern'; +import { ReadPreference, ReadPreferenceLike } from '../read_preference'; +import type { Server } from '../sdam/server'; +import { ClientSession, maybeClearPinnedConnection } from '../sessions'; +import { Callback, maybePromise, MongoDBNamespace, ns } from '../utils'; + +/** @internal */ +const kId = Symbol('id'); +/** @internal */ +const kDocuments = Symbol('documents'); +/** @internal */ +const kServer = Symbol('server'); +/** @internal */ +const kNamespace = Symbol('namespace'); +/** @internal */ +const kClient = Symbol('client'); +/** @internal */ +const kSession = Symbol('session'); +/** @internal */ +const kOptions = Symbol('options'); +/** @internal */ +const kTransform = Symbol('transform'); +/** @internal */ +const kInitialized = Symbol('initialized'); +/** @internal */ +const kClosed = Symbol('closed'); +/** @internal */ +const kKilled = Symbol('killed'); +/** @internal */ +const kInit = Symbol('kInit'); + +/** @public */ +export const CURSOR_FLAGS = [ + 'tailable', + 'oplogReplay', + 'noCursorTimeout', + 'awaitData', + 'exhaust', + 'partial' +] as const; + +/** @public + * @deprecated This interface is deprecated */ +export interface CursorCloseOptions { + /** Bypass calling killCursors when closing the cursor. */ + /** @deprecated the skipKillCursors option is deprecated */ + skipKillCursors?: boolean; +} + +/** @public */ +export interface CursorStreamOptions { + /** A transformation method applied to each document emitted by the stream */ + transform?(doc: Document): Document; +} + +/** @public */ +export type CursorFlag = typeof CURSOR_FLAGS[number]; + +/** @public */ +export interface AbstractCursorOptions extends BSONSerializeOptions { + session?: ClientSession; + readPreference?: ReadPreferenceLike; + readConcern?: ReadConcernLike; + batchSize?: number; + maxTimeMS?: number; + /** + * Comment to apply to the operation. + * + * In server versions pre-4.4, 'comment' must be string. A server + * error will be thrown if any other type is provided. + * + * In server versions 4.4 and above, 'comment' can be any valid BSON type. + */ + comment?: unknown; + tailable?: boolean; + awaitData?: boolean; + noCursorTimeout?: boolean; +} + +/** @internal */ +export type InternalAbstractCursorOptions = Omit & { + // resolved + readPreference: ReadPreference; + readConcern?: ReadConcern; + + // cursor flags, some are deprecated + oplogReplay?: boolean; + exhaust?: boolean; + partial?: boolean; +}; + +/** @public */ +export type AbstractCursorEvents = { + [AbstractCursor.CLOSE](): void; +}; + +/** @public */ +export abstract class AbstractCursor< + TSchema = any, + CursorEvents extends AbstractCursorEvents = AbstractCursorEvents +> extends TypedEventEmitter { + /** @internal */ + [kId]?: Long; + /** @internal */ + [kSession]?: ClientSession; + /** @internal */ + [kServer]?: Server; + /** @internal */ + [kNamespace]: MongoDBNamespace; + /** @internal */ + [kDocuments]: TSchema[]; + /** @internal */ + [kClient]: MongoClient; + /** @internal */ + [kTransform]?: (doc: TSchema) => any; + /** @internal */ + [kInitialized]: boolean; + /** @internal */ + [kClosed]: boolean; + /** @internal */ + [kKilled]: boolean; + /** @internal */ + [kOptions]: InternalAbstractCursorOptions; + + /** @event */ + static readonly CLOSE = 'close' as const; + + /** @internal */ + constructor( + client: MongoClient, + namespace: MongoDBNamespace, + options: AbstractCursorOptions = {} + ) { + super(); + + if (!client.s.isMongoClient) { + throw new MongoRuntimeError('Cursor must be constructed with MongoClient'); + } + this[kClient] = client; + this[kNamespace] = namespace; + this[kDocuments] = []; // TODO: https://github.com/microsoft/TypeScript/issues/36230 + this[kInitialized] = false; + this[kClosed] = false; + this[kKilled] = false; + this[kOptions] = { + readPreference: + options.readPreference && options.readPreference instanceof ReadPreference + ? options.readPreference + : ReadPreference.primary, + ...pluckBSONSerializeOptions(options) + }; + + const readConcern = ReadConcern.fromOptions(options); + if (readConcern) { + this[kOptions].readConcern = readConcern; + } + + if (typeof options.batchSize === 'number') { + this[kOptions].batchSize = options.batchSize; + } + + // we check for undefined specifically here to allow falsy values + // eslint-disable-next-line no-restricted-syntax + if (options.comment !== undefined) { + this[kOptions].comment = options.comment; + } + + if (typeof options.maxTimeMS === 'number') { + this[kOptions].maxTimeMS = options.maxTimeMS; + } + + if (options.session instanceof ClientSession) { + this[kSession] = options.session; + } + } + + get id(): Long | undefined { + return this[kId]; + } + + /** @internal */ + get client(): MongoClient { + return this[kClient]; + } + + /** @internal */ + get server(): Server | undefined { + return this[kServer]; + } + + get namespace(): MongoDBNamespace { + return this[kNamespace]; + } + + get readPreference(): ReadPreference { + return this[kOptions].readPreference; + } + + get readConcern(): ReadConcern | undefined { + return this[kOptions].readConcern; + } + + /** @internal */ + get session(): ClientSession | undefined { + return this[kSession]; + } + + set session(clientSession: ClientSession | undefined) { + this[kSession] = clientSession; + } + + /** @internal */ + get cursorOptions(): InternalAbstractCursorOptions { + return this[kOptions]; + } + + get closed(): boolean { + return this[kClosed]; + } + + get killed(): boolean { + return this[kKilled]; + } + + get loadBalanced(): boolean { + return !!this[kClient].topology?.loadBalanced; + } + + /** Returns current buffered documents length */ + bufferedCount(): number { + return this[kDocuments].length; + } + + /** Returns current buffered documents */ + readBufferedDocuments(number?: number): TSchema[] { + return this[kDocuments].splice(0, number ?? this[kDocuments].length); + } + + [Symbol.asyncIterator](): AsyncIterator { + return { + next: () => + this.next().then(value => + value != null ? { value, done: false } : { value: undefined, done: true } + ) + }; + } + + stream(options?: CursorStreamOptions): Readable & AsyncIterable { + if (options?.transform) { + const transform = options.transform; + const readable = makeCursorStream(this); + + return readable.pipe( + new Transform({ + objectMode: true, + highWaterMark: 1, + transform(chunk, _, callback) { + try { + const transformed = transform(chunk); + callback(undefined, transformed); + } catch (err) { + callback(err); + } + } + }) + ); + } + + return makeCursorStream(this); + } + + hasNext(): Promise; + hasNext(callback: Callback): void; + hasNext(callback?: Callback): Promise | void { + return maybePromise(callback, done => { + if (this[kId] === Long.ZERO) { + return done(undefined, false); + } + + if (this[kDocuments].length) { + return done(undefined, true); + } + + next(this, true, (err, doc) => { + if (err) return done(err); + + if (doc) { + this[kDocuments].unshift(doc); + done(undefined, true); + return; + } + + done(undefined, false); + }); + }); + } + + /** Get the next available document from the cursor, returns null if no more documents are available. */ + next(): Promise; + next(callback: Callback): void; + next(callback?: Callback): Promise | void; + next(callback?: Callback): Promise | void { + return maybePromise(callback, done => { + if (this[kId] === Long.ZERO) { + return done(new MongoCursorExhaustedError()); + } + + next(this, true, done); + }); + } + + /** + * Try to get the next available document from the cursor or `null` if an empty batch is returned + */ + tryNext(): Promise; + tryNext(callback: Callback): void; + tryNext(callback?: Callback): Promise | void { + return maybePromise(callback, done => { + if (this[kId] === Long.ZERO) { + return done(new MongoCursorExhaustedError()); + } + + next(this, false, done); + }); + } + + /** + * Iterates over all the documents for this cursor using the iterator, callback pattern. + * + * @param iterator - The iteration callback. + * @param callback - The end callback. + */ + forEach(iterator: (doc: TSchema) => boolean | void): Promise; + forEach(iterator: (doc: TSchema) => boolean | void, callback: Callback): void; + forEach( + iterator: (doc: TSchema) => boolean | void, + callback?: Callback + ): Promise | void { + if (typeof iterator !== 'function') { + throw new MongoInvalidArgumentError('Argument "iterator" must be a function'); + } + return maybePromise(callback, done => { + const transform = this[kTransform]; + const fetchDocs = () => { + next(this, true, (err, doc) => { + if (err || doc == null) return done(err); + let result; + // NOTE: no need to transform because `next` will do this automatically + try { + result = iterator(doc); // TODO(NODE-3283): Improve transform typing + } catch (error) { + return done(error); + } + + if (result === false) return done(); + + // these do need to be transformed since they are copying the rest of the batch + const internalDocs = this[kDocuments].splice(0, this[kDocuments].length); + for (let i = 0; i < internalDocs.length; ++i) { + try { + result = iterator( + (transform ? transform(internalDocs[i]) : internalDocs[i]) as TSchema // TODO(NODE-3283): Improve transform typing + ); + } catch (error) { + return done(error); + } + if (result === false) return done(); + } + + fetchDocs(); + }); + }; + + fetchDocs(); + }); + } + + close(): Promise; + close(callback: Callback): void; + /** + * @deprecated options argument is deprecated + */ + close(options: CursorCloseOptions): Promise; + /** + * @deprecated options argument is deprecated + */ + close(options: CursorCloseOptions, callback: Callback): void; + close(options?: CursorCloseOptions | Callback, callback?: Callback): Promise | void { + if (typeof options === 'function') (callback = options), (options = {}); + options = options ?? {}; + + const needsToEmitClosed = !this[kClosed]; + this[kClosed] = true; + + return maybePromise(callback, done => cleanupCursor(this, { needsToEmitClosed }, done)); + } + + /** + * Returns an array of documents. The caller is responsible for making sure that there + * is enough memory to store the results. Note that the array only contains partial + * results when this cursor had been previously accessed. In that case, + * cursor.rewind() can be used to reset the cursor. + * + * @param callback - The result callback. + */ + toArray(): Promise; + toArray(callback: Callback): void; + toArray(callback?: Callback): Promise | void { + return maybePromise(callback, done => { + const docs: TSchema[] = []; + const transform = this[kTransform]; + const fetchDocs = () => { + // NOTE: if we add a `nextBatch` then we should use it here + next(this, true, (err, doc) => { + if (err) return done(err); + if (doc == null) return done(undefined, docs); + + // NOTE: no need to transform because `next` will do this automatically + docs.push(doc); + + // these do need to be transformed since they are copying the rest of the batch + const internalDocs = ( + transform + ? this[kDocuments].splice(0, this[kDocuments].length).map(transform) + : this[kDocuments].splice(0, this[kDocuments].length) + ) as TSchema[]; // TODO(NODE-3283): Improve transform typing + + if (internalDocs) { + docs.push(...internalDocs); + } + + fetchDocs(); + }); + }; + + fetchDocs(); + }); + } + + /** + * Add a cursor flag to the cursor + * + * @param flag - The flag to set, must be one of following ['tailable', 'oplogReplay', 'noCursorTimeout', 'awaitData', 'partial' -. + * @param value - The flag boolean value. + */ + addCursorFlag(flag: CursorFlag, value: boolean): this { + assertUninitialized(this); + if (!CURSOR_FLAGS.includes(flag)) { + throw new MongoInvalidArgumentError(`Flag ${flag} is not one of ${CURSOR_FLAGS}`); + } + + if (typeof value !== 'boolean') { + throw new MongoInvalidArgumentError(`Flag ${flag} must be a boolean value`); + } + + this[kOptions][flag] = value; + return this; + } + + /** + * Map all documents using the provided function + * If there is a transform set on the cursor, that will be called first and the result passed to + * this function's transform. + * + * @remarks + * **Note for Typescript Users:** adding a transform changes the return type of the iteration of this cursor, + * it **does not** return a new instance of a cursor. This means when calling map, + * you should always assign the result to a new variable in order to get a correctly typed cursor variable. + * Take note of the following example: + * + * @example + * ```typescript + * const cursor: FindCursor = coll.find(); + * const mappedCursor: FindCursor = cursor.map(doc => Object.keys(doc).length); + * const keyCounts: number[] = await mappedCursor.toArray(); // cursor.toArray() still returns Document[] + * ``` + * @param transform - The mapping transformation method. + */ + map(transform: (doc: TSchema) => T): AbstractCursor { + assertUninitialized(this); + const oldTransform = this[kTransform] as (doc: TSchema) => TSchema; // TODO(NODE-3283): Improve transform typing + if (oldTransform) { + this[kTransform] = doc => { + return transform(oldTransform(doc)); + }; + } else { + this[kTransform] = transform; + } + + return this as unknown as AbstractCursor; + } + + /** + * Set the ReadPreference for the cursor. + * + * @param readPreference - The new read preference for the cursor. + */ + withReadPreference(readPreference: ReadPreferenceLike): this { + assertUninitialized(this); + if (readPreference instanceof ReadPreference) { + this[kOptions].readPreference = readPreference; + } else if (typeof readPreference === 'string') { + this[kOptions].readPreference = ReadPreference.fromString(readPreference); + } else { + throw new MongoInvalidArgumentError(`Invalid read preference: ${readPreference}`); + } + + return this; + } + + /** + * Set the ReadPreference for the cursor. + * + * @param readPreference - The new read preference for the cursor. + */ + withReadConcern(readConcern: ReadConcernLike): this { + assertUninitialized(this); + const resolvedReadConcern = ReadConcern.fromOptions({ readConcern }); + if (resolvedReadConcern) { + this[kOptions].readConcern = resolvedReadConcern; + } + + return this; + } + + /** + * Set a maxTimeMS on the cursor query, allowing for hard timeout limits on queries (Only supported on MongoDB 2.6 or higher) + * + * @param value - Number of milliseconds to wait before aborting the query. + */ + maxTimeMS(value: number): this { + assertUninitialized(this); + if (typeof value !== 'number') { + throw new MongoInvalidArgumentError('Argument for maxTimeMS must be a number'); + } + + this[kOptions].maxTimeMS = value; + return this; + } + + /** + * Set the batch size for the cursor. + * + * @param value - The number of documents to return per batch. See {@link https://docs.mongodb.com/manual/reference/command/find/|find command documentation}. + */ + batchSize(value: number): this { + assertUninitialized(this); + if (this[kOptions].tailable) { + throw new MongoTailableCursorError('Tailable cursor does not support batchSize'); + } + + if (typeof value !== 'number') { + throw new MongoInvalidArgumentError('Operation "batchSize" requires an integer'); + } + + this[kOptions].batchSize = value; + return this; + } + + /** + * Rewind this cursor to its uninitialized state. Any options that are present on the cursor will + * remain in effect. Iterating this cursor will cause new queries to be sent to the server, even + * if the resultant data has already been retrieved by this cursor. + */ + rewind(): void { + if (!this[kInitialized]) { + return; + } + + this[kId] = undefined; + this[kDocuments] = []; + this[kClosed] = false; + this[kKilled] = false; + this[kInitialized] = false; + + const session = this[kSession]; + if (session) { + // We only want to end this session if we created it, and it hasn't ended yet + if (session.explicit === false && !session.hasEnded) { + session.endSession(); + } + + this[kSession] = undefined; + } + } + + /** + * Returns a new uninitialized copy of this cursor, with options matching those that have been set on the current instance + */ + abstract clone(): AbstractCursor; + + /** @internal */ + abstract _initialize( + session: ClientSession | undefined, + callback: Callback + ): void; + + /** @internal */ + _getMore(batchSize: number, callback: Callback): void { + const cursorId = this[kId]; + const cursorNs = this[kNamespace]; + const server = this[kServer]; + + if (cursorId == null) { + callback(new MongoRuntimeError('Unable to iterate cursor with no id')); + return; + } + + if (server == null) { + callback(new MongoRuntimeError('Unable to iterate cursor without selected server')); + return; + } + + const getMoreOperation = new GetMoreOperation(cursorNs, cursorId, server, { + ...this[kOptions], + session: this[kSession], + batchSize + }); + + executeOperation(this[kClient], getMoreOperation, callback); + } + + /** + * @internal + * + * This function is exposed for the unified test runner's createChangeStream + * operation. We cannot refactor to use the abstract _initialize method without + * a significant refactor. + */ + [kInit](callback: Callback): void { + if (this[kSession] == null) { + if (this[kClient].topology?.shouldCheckForSessionSupport()) { + return this[kClient].topology?.selectServer(ReadPreference.primaryPreferred, {}, err => { + if (err) return callback(err); + return this[kInit](callback); + }); + } else if (this[kClient].topology?.hasSessionSupport()) { + this[kSession] = this[kClient].topology?.startSession({ owner: this, explicit: false }); + } + } + + this._initialize(this[kSession], (err, state) => { + if (state) { + const response = state.response; + this[kServer] = state.server; + this[kSession] = state.session; + + if (response.cursor) { + this[kId] = + typeof response.cursor.id === 'number' + ? Long.fromNumber(response.cursor.id) + : response.cursor.id; + + if (response.cursor.ns) { + this[kNamespace] = ns(response.cursor.ns); + } + + this[kDocuments] = response.cursor.firstBatch; + } + + // When server responses return without a cursor document, we close this cursor + // and return the raw server response. This is often the case for explain commands + // for example + if (this[kId] == null) { + this[kId] = Long.ZERO; + // TODO(NODE-3286): ExecutionResult needs to accept a generic parameter + this[kDocuments] = [state.response as TODO_NODE_3286]; + } + } + + // the cursor is now initialized, even if an error occurred or it is dead + this[kInitialized] = true; + + if (err || cursorIsDead(this)) { + return cleanupCursor(this, { error: err }, () => callback(err, nextDocument(this))); + } + + callback(); + }); + } +} + +function nextDocument(cursor: AbstractCursor): T | null { + if (cursor[kDocuments] == null || !cursor[kDocuments].length) { + return null; + } + + const doc = cursor[kDocuments].shift(); + if (doc) { + const transform = cursor[kTransform]; + if (transform) { + return transform(doc) as T; + } + + return doc; + } + + return null; +} + +function next(cursor: AbstractCursor, blocking: boolean, callback: Callback): void { + const cursorId = cursor[kId]; + if (cursor.closed) { + return callback(undefined, null); + } + + if (cursor[kDocuments] && cursor[kDocuments].length) { + callback(undefined, nextDocument(cursor)); + return; + } + + if (cursorId == null) { + // All cursors must operate within a session, one must be made implicitly if not explicitly provided + cursor[kInit]((err, value) => { + if (err) return callback(err); + if (value) { + return callback(undefined, value); + } + return next(cursor, blocking, callback); + }); + + return; + } + + if (cursorIsDead(cursor)) { + return cleanupCursor(cursor, undefined, () => callback(undefined, null)); + } + + // otherwise need to call getMore + const batchSize = cursor[kOptions].batchSize || 1000; + cursor._getMore(batchSize, (err, response) => { + if (response) { + const cursorId = + typeof response.cursor.id === 'number' + ? Long.fromNumber(response.cursor.id) + : response.cursor.id; + + cursor[kDocuments] = response.cursor.nextBatch; + cursor[kId] = cursorId; + } + + if (err || cursorIsDead(cursor)) { + return cleanupCursor(cursor, { error: err }, () => callback(err, nextDocument(cursor))); + } + + if (cursor[kDocuments].length === 0 && blocking === false) { + return callback(undefined, null); + } + + next(cursor, blocking, callback); + }); +} + +function cursorIsDead(cursor: AbstractCursor): boolean { + const cursorId = cursor[kId]; + return !!cursorId && cursorId.isZero(); +} + +function cleanupCursor( + cursor: AbstractCursor, + options: { error?: AnyError | undefined; needsToEmitClosed?: boolean } | undefined, + callback: Callback +): void { + const cursorId = cursor[kId]; + const cursorNs = cursor[kNamespace]; + const server = cursor[kServer]; + const session = cursor[kSession]; + const error = options?.error; + const needsToEmitClosed = options?.needsToEmitClosed ?? cursor[kDocuments].length === 0; + + if (error) { + if (cursor.loadBalanced && error instanceof MongoNetworkError) { + return completeCleanup(); + } + } + + if (cursorId == null || server == null || cursorId.isZero() || cursorNs == null) { + if (needsToEmitClosed) { + cursor[kClosed] = true; + cursor[kId] = Long.ZERO; + cursor.emit(AbstractCursor.CLOSE); + } + + if (session) { + if (session.owner === cursor) { + return session.endSession({ error }, callback); + } + + if (!session.inTransaction()) { + maybeClearPinnedConnection(session, { error }); + } + } + + return callback(); + } + + function completeCleanup() { + if (session) { + if (session.owner === cursor) { + return session.endSession({ error }, () => { + cursor.emit(AbstractCursor.CLOSE); + callback(); + }); + } + + if (!session.inTransaction()) { + maybeClearPinnedConnection(session, { error }); + } + } + + cursor.emit(AbstractCursor.CLOSE); + return callback(); + } + + cursor[kKilled] = true; + server.killCursors( + cursorNs, + [cursorId], + { ...pluckBSONSerializeOptions(cursor[kOptions]), session }, + () => completeCleanup() + ); +} + +/** @internal */ +export function assertUninitialized(cursor: AbstractCursor): void { + if (cursor[kInitialized]) { + throw new MongoCursorInUseError(); + } +} + +function makeCursorStream(cursor: AbstractCursor) { + const readable = new Readable({ + objectMode: true, + autoDestroy: false, + highWaterMark: 1 + }); + + let initialized = false; + let reading = false; + let needToClose = true; // NOTE: we must close the cursor if we never read from it, use `_construct` in future node versions + + readable._read = function () { + if (initialized === false) { + needToClose = false; + initialized = true; + } + + if (!reading) { + reading = true; + readNext(); + } + }; + + readable._destroy = function (error, cb) { + if (needToClose) { + cursor.close(err => process.nextTick(cb, err || error)); + } else { + cb(error); + } + }; + + function readNext() { + needToClose = false; + next(cursor, true, (err, result) => { + needToClose = err ? !cursor.closed : result != null; + + if (err) { + // NOTE: This is questionable, but we have a test backing the behavior. It seems the + // desired behavior is that a stream ends cleanly when a user explicitly closes + // a client during iteration. Alternatively, we could do the "right" thing and + // propagate the error message by removing this special case. + if (err.message.match(/server is closed/)) { + cursor.close(); + return readable.push(null); + } + + // NOTE: This is also perhaps questionable. The rationale here is that these errors tend + // to be "operation interrupted", where a cursor has been closed but there is an + // active getMore in-flight. This used to check if the cursor was killed but once + // that changed to happen in cleanup legitimate errors would not destroy the + // stream. There are change streams test specifically test these cases. + if (err.message.match(/interrupted/)) { + return readable.push(null); + } + + return readable.destroy(err); + } + + if (result == null) { + readable.push(null); + } else if (readable.destroyed) { + cursor.close(); + } else { + if (readable.push(result)) { + return readNext(); + } + + reading = false; + } + }); + } + + return readable; +} diff --git a/node_modules/mongodb/src/cursor/aggregation_cursor.ts b/node_modules/mongodb/src/cursor/aggregation_cursor.ts new file mode 100644 index 000000000..350696ee4 --- /dev/null +++ b/node_modules/mongodb/src/cursor/aggregation_cursor.ts @@ -0,0 +1,219 @@ +import type { Document } from '../bson'; +import type { ExplainVerbosityLike } from '../explain'; +import type { MongoClient } from '../mongo_client'; +import { AggregateOperation, AggregateOptions } from '../operations/aggregate'; +import { executeOperation, ExecutionResult } from '../operations/execute_operation'; +import type { ClientSession } from '../sessions'; +import type { Sort } from '../sort'; +import type { Callback, MongoDBNamespace } from '../utils'; +import { mergeOptions } from '../utils'; +import type { AbstractCursorOptions } from './abstract_cursor'; +import { AbstractCursor, assertUninitialized } from './abstract_cursor'; + +/** @public */ +export interface AggregationCursorOptions extends AbstractCursorOptions, AggregateOptions {} + +/** @internal */ +const kPipeline = Symbol('pipeline'); +/** @internal */ +const kOptions = Symbol('options'); + +/** + * The **AggregationCursor** class is an internal class that embodies an aggregation cursor on MongoDB + * allowing for iteration over the results returned from the underlying query. It supports + * one by one document iteration, conversion to an array or can be iterated as a Node 4.X + * or higher stream + * @public + */ +export class AggregationCursor extends AbstractCursor { + /** @internal */ + [kPipeline]: Document[]; + /** @internal */ + [kOptions]: AggregateOptions; + + /** @internal */ + constructor( + client: MongoClient, + namespace: MongoDBNamespace, + pipeline: Document[] = [], + options: AggregateOptions = {} + ) { + super(client, namespace, options); + + this[kPipeline] = pipeline; + this[kOptions] = options; + } + + get pipeline(): Document[] { + return this[kPipeline]; + } + + clone(): AggregationCursor { + const clonedOptions = mergeOptions({}, this[kOptions]); + delete clonedOptions.session; + return new AggregationCursor(this.client, this.namespace, this[kPipeline], { + ...clonedOptions + }); + } + + override map(transform: (doc: TSchema) => T): AggregationCursor { + return super.map(transform) as AggregationCursor; + } + + /** @internal */ + _initialize(session: ClientSession, callback: Callback): void { + const aggregateOperation = new AggregateOperation(this.namespace, this[kPipeline], { + ...this[kOptions], + ...this.cursorOptions, + session + }); + + executeOperation(this.client, aggregateOperation, (err, response) => { + if (err || response == null) return callback(err); + + // TODO: NODE-2882 + callback(undefined, { server: aggregateOperation.server, session, response }); + }); + } + + /** Execute the explain for the cursor */ + explain(): Promise; + explain(callback: Callback): void; + explain(verbosity: ExplainVerbosityLike): Promise; + explain( + verbosity?: ExplainVerbosityLike | Callback, + callback?: Callback + ): Promise | void { + if (typeof verbosity === 'function') (callback = verbosity), (verbosity = true); + if (verbosity == null) verbosity = true; + + return executeOperation( + this.client, + new AggregateOperation(this.namespace, this[kPipeline], { + ...this[kOptions], // NOTE: order matters here, we may need to refine this + ...this.cursorOptions, + explain: verbosity + }), + callback + ); + } + + /** Add a group stage to the aggregation pipeline */ + group($group: Document): AggregationCursor; + group($group: Document): this { + assertUninitialized(this); + this[kPipeline].push({ $group }); + return this; + } + + /** Add a limit stage to the aggregation pipeline */ + limit($limit: number): this { + assertUninitialized(this); + this[kPipeline].push({ $limit }); + return this; + } + + /** Add a match stage to the aggregation pipeline */ + match($match: Document): this { + assertUninitialized(this); + this[kPipeline].push({ $match }); + return this; + } + + /** Add an out stage to the aggregation pipeline */ + out($out: { db: string; coll: string } | string): this { + assertUninitialized(this); + this[kPipeline].push({ $out }); + return this; + } + + /** + * Add a project stage to the aggregation pipeline + * + * @remarks + * In order to strictly type this function you must provide an interface + * that represents the effect of your projection on the result documents. + * + * By default chaining a projection to your cursor changes the returned type to the generic {@link Document} type. + * You should specify a parameterized type to have assertions on your final results. + * + * @example + * ```typescript + * // Best way + * const docs: AggregationCursor<{ a: number }> = cursor.project<{ a: number }>({ _id: 0, a: true }); + * // Flexible way + * const docs: AggregationCursor = cursor.project({ _id: 0, a: true }); + * ``` + * + * @remarks + * In order to strictly type this function you must provide an interface + * that represents the effect of your projection on the result documents. + * + * **Note for Typescript Users:** adding a transform changes the return type of the iteration of this cursor, + * it **does not** return a new instance of a cursor. This means when calling project, + * you should always assign the result to a new variable in order to get a correctly typed cursor variable. + * Take note of the following example: + * + * @example + * ```typescript + * const cursor: AggregationCursor<{ a: number; b: string }> = coll.aggregate([]); + * const projectCursor = cursor.project<{ a: number }>({ _id: 0, a: true }); + * const aPropOnlyArray: {a: number}[] = await projectCursor.toArray(); + * + * // or always use chaining and save the final cursor + * + * const cursor = coll.aggregate().project<{ a: string }>({ + * _id: 0, + * a: { $convert: { input: '$a', to: 'string' } + * }}); + * ``` + */ + project($project: Document): AggregationCursor { + assertUninitialized(this); + this[kPipeline].push({ $project }); + return this as unknown as AggregationCursor; + } + + /** Add a lookup stage to the aggregation pipeline */ + lookup($lookup: Document): this { + assertUninitialized(this); + this[kPipeline].push({ $lookup }); + return this; + } + + /** Add a redact stage to the aggregation pipeline */ + redact($redact: Document): this { + assertUninitialized(this); + this[kPipeline].push({ $redact }); + return this; + } + + /** Add a skip stage to the aggregation pipeline */ + skip($skip: number): this { + assertUninitialized(this); + this[kPipeline].push({ $skip }); + return this; + } + + /** Add a sort stage to the aggregation pipeline */ + sort($sort: Sort): this { + assertUninitialized(this); + this[kPipeline].push({ $sort }); + return this; + } + + /** Add a unwind stage to the aggregation pipeline */ + unwind($unwind: Document | string): this { + assertUninitialized(this); + this[kPipeline].push({ $unwind }); + return this; + } + + // deprecated methods + /** @deprecated Add a geoNear stage to the aggregation pipeline */ + geoNear($geoNear: Document): this { + assertUninitialized(this); + this[kPipeline].push({ $geoNear }); + return this; + } +} diff --git a/node_modules/mongodb/src/cursor/find_cursor.ts b/node_modules/mongodb/src/cursor/find_cursor.ts new file mode 100644 index 000000000..8034bfd7c --- /dev/null +++ b/node_modules/mongodb/src/cursor/find_cursor.ts @@ -0,0 +1,480 @@ +import type { Document } from '../bson'; +import { MongoInvalidArgumentError, MongoTailableCursorError } from '../error'; +import type { ExplainVerbosityLike } from '../explain'; +import type { MongoClient } from '../mongo_client'; +import type { CollationOptions } from '../operations/command'; +import { CountOperation, CountOptions } from '../operations/count'; +import { executeOperation, ExecutionResult } from '../operations/execute_operation'; +import { FindOperation, FindOptions } from '../operations/find'; +import type { Hint } from '../operations/operation'; +import type { ClientSession } from '../sessions'; +import { formatSort, Sort, SortDirection } from '../sort'; +import { Callback, emitWarningOnce, mergeOptions, MongoDBNamespace } from '../utils'; +import { AbstractCursor, assertUninitialized } from './abstract_cursor'; + +/** @internal */ +const kFilter = Symbol('filter'); +/** @internal */ +const kNumReturned = Symbol('numReturned'); +/** @internal */ +const kBuiltOptions = Symbol('builtOptions'); + +/** @public Flags allowed for cursor */ +export const FLAGS = [ + 'tailable', + 'oplogReplay', + 'noCursorTimeout', + 'awaitData', + 'exhaust', + 'partial' +] as const; + +/** @public */ +export class FindCursor extends AbstractCursor { + /** @internal */ + [kFilter]: Document; + /** @internal */ + [kNumReturned]?: number; + /** @internal */ + [kBuiltOptions]: FindOptions; + + /** @internal */ + constructor( + client: MongoClient, + namespace: MongoDBNamespace, + filter: Document | undefined, + options: FindOptions = {} + ) { + super(client, namespace, options); + + this[kFilter] = filter || {}; + this[kBuiltOptions] = options; + + if (options.sort != null) { + this[kBuiltOptions].sort = formatSort(options.sort); + } + } + + clone(): FindCursor { + const clonedOptions = mergeOptions({}, this[kBuiltOptions]); + delete clonedOptions.session; + return new FindCursor(this.client, this.namespace, this[kFilter], { + ...clonedOptions + }); + } + + override map(transform: (doc: TSchema) => T): FindCursor { + return super.map(transform) as FindCursor; + } + + /** @internal */ + _initialize(session: ClientSession, callback: Callback): void { + const findOperation = new FindOperation(undefined, this.namespace, this[kFilter], { + ...this[kBuiltOptions], // NOTE: order matters here, we may need to refine this + ...this.cursorOptions, + session + }); + + executeOperation(this.client, findOperation, (err, response) => { + if (err || response == null) return callback(err); + + // TODO: We only need this for legacy queries that do not support `limit`, maybe + // the value should only be saved in those cases. + if (response.cursor) { + this[kNumReturned] = response.cursor.firstBatch.length; + } else { + this[kNumReturned] = response.documents ? response.documents.length : 0; + } + + // TODO: NODE-2882 + callback(undefined, { server: findOperation.server, session, response }); + }); + } + + /** @internal */ + override _getMore(batchSize: number, callback: Callback): void { + // NOTE: this is to support client provided limits in pre-command servers + const numReturned = this[kNumReturned]; + if (numReturned) { + const limit = this[kBuiltOptions].limit; + batchSize = + limit && limit > 0 && numReturned + batchSize > limit ? limit - numReturned : batchSize; + + if (batchSize <= 0) { + return this.close(callback); + } + } + + super._getMore(batchSize, (err, response) => { + if (err) return callback(err); + + // TODO: wrap this in some logic to prevent it from happening if we don't need this support + if (response) { + this[kNumReturned] = this[kNumReturned] + response.cursor.nextBatch.length; + } + + callback(undefined, response); + }); + } + + /** + * Get the count of documents for this cursor + * @deprecated Use `collection.estimatedDocumentCount` or `collection.countDocuments` instead + */ + count(): Promise; + /** @deprecated Use `collection.estimatedDocumentCount` or `collection.countDocuments` instead */ + count(callback: Callback): void; + /** @deprecated Use `collection.estimatedDocumentCount` or `collection.countDocuments` instead */ + count(options: CountOptions): Promise; + /** @deprecated Use `collection.estimatedDocumentCount` or `collection.countDocuments` instead */ + count(options: CountOptions, callback: Callback): void; + count( + options?: CountOptions | Callback, + callback?: Callback + ): Promise | void { + emitWarningOnce( + 'cursor.count is deprecated and will be removed in the next major version, please use `collection.estimatedDocumentCount` or `collection.countDocuments` instead ' + ); + if (typeof options === 'boolean') { + throw new MongoInvalidArgumentError('Invalid first parameter to count'); + } + + if (typeof options === 'function') (callback = options), (options = {}); + options = options ?? {}; + + return executeOperation( + this.client, + new CountOperation(this.namespace, this[kFilter], { + ...this[kBuiltOptions], // NOTE: order matters here, we may need to refine this + ...this.cursorOptions, + ...options + }), + callback + ); + } + + /** Execute the explain for the cursor */ + explain(): Promise; + explain(callback: Callback): void; + explain(verbosity?: ExplainVerbosityLike): Promise; + explain( + verbosity?: ExplainVerbosityLike | Callback, + callback?: Callback + ): Promise | void { + if (typeof verbosity === 'function') (callback = verbosity), (verbosity = true); + if (verbosity == null) verbosity = true; + + return executeOperation( + this.client, + new FindOperation(undefined, this.namespace, this[kFilter], { + ...this[kBuiltOptions], // NOTE: order matters here, we may need to refine this + ...this.cursorOptions, + explain: verbosity + }), + callback + ); + } + + /** Set the cursor query */ + filter(filter: Document): this { + assertUninitialized(this); + this[kFilter] = filter; + return this; + } + + /** + * Set the cursor hint + * + * @param hint - If specified, then the query system will only consider plans using the hinted index. + */ + hint(hint: Hint): this { + assertUninitialized(this); + this[kBuiltOptions].hint = hint; + return this; + } + + /** + * Set the cursor min + * + * @param min - Specify a $min value to specify the inclusive lower bound for a specific index in order to constrain the results of find(). The $min specifies the lower bound for all keys of a specific index in order. + */ + min(min: Document): this { + assertUninitialized(this); + this[kBuiltOptions].min = min; + return this; + } + + /** + * Set the cursor max + * + * @param max - Specify a $max value to specify the exclusive upper bound for a specific index in order to constrain the results of find(). The $max specifies the upper bound for all keys of a specific index in order. + */ + max(max: Document): this { + assertUninitialized(this); + this[kBuiltOptions].max = max; + return this; + } + + /** + * Set the cursor returnKey. + * If set to true, modifies the cursor to only return the index field or fields for the results of the query, rather than documents. + * If set to true and the query does not use an index to perform the read operation, the returned documents will not contain any fields. + * + * @param value - the returnKey value. + */ + returnKey(value: boolean): this { + assertUninitialized(this); + this[kBuiltOptions].returnKey = value; + return this; + } + + /** + * Modifies the output of a query by adding a field $recordId to matching documents. $recordId is the internal key which uniquely identifies a document in a collection. + * + * @param value - The $showDiskLoc option has now been deprecated and replaced with the showRecordId field. $showDiskLoc will still be accepted for OP_QUERY stye find. + */ + showRecordId(value: boolean): this { + assertUninitialized(this); + this[kBuiltOptions].showRecordId = value; + return this; + } + + /** + * Add a query modifier to the cursor query + * + * @param name - The query modifier (must start with $, such as $orderby etc) + * @param value - The modifier value. + */ + addQueryModifier(name: string, value: string | boolean | number | Document): this { + assertUninitialized(this); + if (name[0] !== '$') { + throw new MongoInvalidArgumentError(`${name} is not a valid query modifier`); + } + + // Strip of the $ + const field = name.substr(1); + + // NOTE: consider some TS magic for this + switch (field) { + case 'comment': + this[kBuiltOptions].comment = value as string | Document; + break; + + case 'explain': + this[kBuiltOptions].explain = value as boolean; + break; + + case 'hint': + this[kBuiltOptions].hint = value as string | Document; + break; + + case 'max': + this[kBuiltOptions].max = value as Document; + break; + + case 'maxTimeMS': + this[kBuiltOptions].maxTimeMS = value as number; + break; + + case 'min': + this[kBuiltOptions].min = value as Document; + break; + + case 'orderby': + this[kBuiltOptions].sort = formatSort(value as string | Document); + break; + + case 'query': + this[kFilter] = value as Document; + break; + + case 'returnKey': + this[kBuiltOptions].returnKey = value as boolean; + break; + + case 'showDiskLoc': + this[kBuiltOptions].showRecordId = value as boolean; + break; + + default: + throw new MongoInvalidArgumentError(`Invalid query modifier: ${name}`); + } + + return this; + } + + /** + * Add a comment to the cursor query allowing for tracking the comment in the log. + * + * @param value - The comment attached to this query. + */ + comment(value: string): this { + assertUninitialized(this); + this[kBuiltOptions].comment = value; + return this; + } + + /** + * Set a maxAwaitTimeMS on a tailing cursor query to allow to customize the timeout value for the option awaitData (Only supported on MongoDB 3.2 or higher, ignored otherwise) + * + * @param value - Number of milliseconds to wait before aborting the tailed query. + */ + maxAwaitTimeMS(value: number): this { + assertUninitialized(this); + if (typeof value !== 'number') { + throw new MongoInvalidArgumentError('Argument for maxAwaitTimeMS must be a number'); + } + + this[kBuiltOptions].maxAwaitTimeMS = value; + return this; + } + + /** + * Set a maxTimeMS on the cursor query, allowing for hard timeout limits on queries (Only supported on MongoDB 2.6 or higher) + * + * @param value - Number of milliseconds to wait before aborting the query. + */ + override maxTimeMS(value: number): this { + assertUninitialized(this); + if (typeof value !== 'number') { + throw new MongoInvalidArgumentError('Argument for maxTimeMS must be a number'); + } + + this[kBuiltOptions].maxTimeMS = value; + return this; + } + + /** + * Add a project stage to the aggregation pipeline + * + * @remarks + * In order to strictly type this function you must provide an interface + * that represents the effect of your projection on the result documents. + * + * By default chaining a projection to your cursor changes the returned type to the generic + * {@link Document} type. + * You should specify a parameterized type to have assertions on your final results. + * + * @example + * ```typescript + * // Best way + * const docs: FindCursor<{ a: number }> = cursor.project<{ a: number }>({ _id: 0, a: true }); + * // Flexible way + * const docs: FindCursor = cursor.project({ _id: 0, a: true }); + * ``` + * + * @remarks + * + * **Note for Typescript Users:** adding a transform changes the return type of the iteration of this cursor, + * it **does not** return a new instance of a cursor. This means when calling project, + * you should always assign the result to a new variable in order to get a correctly typed cursor variable. + * Take note of the following example: + * + * @example + * ```typescript + * const cursor: FindCursor<{ a: number; b: string }> = coll.find(); + * const projectCursor = cursor.project<{ a: number }>({ _id: 0, a: true }); + * const aPropOnlyArray: {a: number}[] = await projectCursor.toArray(); + * + * // or always use chaining and save the final cursor + * + * const cursor = coll.find().project<{ a: string }>({ + * _id: 0, + * a: { $convert: { input: '$a', to: 'string' } + * }}); + * ``` + */ + project(value: Document): FindCursor { + assertUninitialized(this); + this[kBuiltOptions].projection = value; + return this as unknown as FindCursor; + } + + /** + * Sets the sort order of the cursor query. + * + * @param sort - The key or keys set for the sort. + * @param direction - The direction of the sorting (1 or -1). + */ + sort(sort: Sort | string, direction?: SortDirection): this { + assertUninitialized(this); + if (this[kBuiltOptions].tailable) { + throw new MongoTailableCursorError('Tailable cursor does not support sorting'); + } + + this[kBuiltOptions].sort = formatSort(sort, direction); + return this; + } + + /** + * Allows disk use for blocking sort operations exceeding 100MB memory. (MongoDB 3.2 or higher) + * + * @remarks + * {@link https://docs.mongodb.com/manual/reference/command/find/#find-cmd-allowdiskuse | find command allowDiskUse documentation} + */ + allowDiskUse(allow = true): this { + assertUninitialized(this); + + if (!this[kBuiltOptions].sort) { + throw new MongoInvalidArgumentError('Option "allowDiskUse" requires a sort specification'); + } + + // As of 6.0 the default is true. This allows users to get back to the old behaviour. + if (!allow) { + this[kBuiltOptions].allowDiskUse = false; + return this; + } + + this[kBuiltOptions].allowDiskUse = true; + return this; + } + + /** + * Set the collation options for the cursor. + * + * @param value - The cursor collation options (MongoDB 3.4 or higher) settings for update operation (see 3.4 documentation for available fields). + */ + collation(value: CollationOptions): this { + assertUninitialized(this); + this[kBuiltOptions].collation = value; + return this; + } + + /** + * Set the limit for the cursor. + * + * @param value - The limit for the cursor query. + */ + limit(value: number): this { + assertUninitialized(this); + if (this[kBuiltOptions].tailable) { + throw new MongoTailableCursorError('Tailable cursor does not support limit'); + } + + if (typeof value !== 'number') { + throw new MongoInvalidArgumentError('Operation "limit" requires an integer'); + } + + this[kBuiltOptions].limit = value; + return this; + } + + /** + * Set the skip for the cursor. + * + * @param value - The skip for the cursor query. + */ + skip(value: number): this { + assertUninitialized(this); + if (this[kBuiltOptions].tailable) { + throw new MongoTailableCursorError('Tailable cursor does not support skip'); + } + + if (typeof value !== 'number') { + throw new MongoInvalidArgumentError('Operation "skip" requires an integer'); + } + + this[kBuiltOptions].skip = value; + return this; + } +} diff --git a/node_modules/mongodb/src/db.ts b/node_modules/mongodb/src/db.ts new file mode 100644 index 000000000..3f6a1f0f1 --- /dev/null +++ b/node_modules/mongodb/src/db.ts @@ -0,0 +1,773 @@ +import { Admin } from './admin'; +import { BSONSerializeOptions, Document, resolveBSONOptions } from './bson'; +import { ChangeStream, ChangeStreamDocument, ChangeStreamOptions } from './change_stream'; +import { Collection, CollectionOptions } from './collection'; +import * as CONSTANTS from './constants'; +import { AggregationCursor } from './cursor/aggregation_cursor'; +import { MongoAPIError, MongoInvalidArgumentError } from './error'; +import { Logger, LoggerOptions } from './logger'; +import type { MongoClient, PkFactory } from './mongo_client'; +import type { TODO_NODE_3286 } from './mongo_types'; +import { AddUserOperation, AddUserOptions } from './operations/add_user'; +import type { AggregateOptions } from './operations/aggregate'; +import { CollectionsOperation } from './operations/collections'; +import type { IndexInformationOptions } from './operations/common_functions'; +import { CreateCollectionOperation, CreateCollectionOptions } from './operations/create_collection'; +import { + DropCollectionOperation, + DropCollectionOptions, + DropDatabaseOperation, + DropDatabaseOptions +} from './operations/drop'; +import { executeOperation } from './operations/execute_operation'; +import { + CreateIndexesOptions, + CreateIndexOperation, + IndexInformationOperation, + IndexSpecification +} from './operations/indexes'; +import { + CollectionInfo, + ListCollectionsCursor, + ListCollectionsOptions +} from './operations/list_collections'; +import { ProfilingLevelOperation, ProfilingLevelOptions } from './operations/profiling_level'; +import { RemoveUserOperation, RemoveUserOptions } from './operations/remove_user'; +import { RenameOperation, RenameOptions } from './operations/rename'; +import { RunCommandOperation, RunCommandOptions } from './operations/run_command'; +import { + ProfilingLevel, + SetProfilingLevelOperation, + SetProfilingLevelOptions +} from './operations/set_profiling_level'; +import { DbStatsOperation, DbStatsOptions } from './operations/stats'; +import { ReadConcern } from './read_concern'; +import { ReadPreference, ReadPreferenceLike } from './read_preference'; +import { + Callback, + DEFAULT_PK_FACTORY, + filterOptions, + getTopology, + MongoDBNamespace, + resolveOptions +} from './utils'; +import { WriteConcern, WriteConcernOptions } from './write_concern'; + +// Allowed parameters +const DB_OPTIONS_ALLOW_LIST = [ + 'writeConcern', + 'readPreference', + 'readPreferenceTags', + 'native_parser', + 'forceServerObjectId', + 'pkFactory', + 'serializeFunctions', + 'raw', + 'authSource', + 'ignoreUndefined', + 'readConcern', + 'retryMiliSeconds', + 'numberOfRetries', + 'loggerLevel', + 'logger', + 'promoteBuffers', + 'promoteLongs', + 'bsonRegExp', + 'enableUtf8Validation', + 'promoteValues', + 'compression', + 'retryWrites' +]; + +/** @internal */ +export interface DbPrivate { + client: MongoClient; + options?: DbOptions; + logger: Logger; + readPreference?: ReadPreference; + pkFactory: PkFactory; + readConcern?: ReadConcern; + bsonOptions: BSONSerializeOptions; + writeConcern?: WriteConcern; + namespace: MongoDBNamespace; +} + +/** @public */ +export interface DbOptions extends BSONSerializeOptions, WriteConcernOptions, LoggerOptions { + /** If the database authentication is dependent on another databaseName. */ + authSource?: string; + /** Force server to assign _id values instead of driver. */ + forceServerObjectId?: boolean; + /** The preferred read preference (ReadPreference.PRIMARY, ReadPreference.PRIMARY_PREFERRED, ReadPreference.SECONDARY, ReadPreference.SECONDARY_PREFERRED, ReadPreference.NEAREST). */ + readPreference?: ReadPreferenceLike; + /** A primary key factory object for generation of custom _id keys. */ + pkFactory?: PkFactory; + /** Specify a read concern for the collection. (only MongoDB 3.2 or higher supported) */ + readConcern?: ReadConcern; + /** Should retry failed writes */ + retryWrites?: boolean; +} + +/** + * The **Db** class is a class that represents a MongoDB Database. + * @public + * + * @example + * ```js + * const { MongoClient } = require('mongodb'); + * // Connection url + * const url = 'mongodb://localhost:27017'; + * // Database Name + * const dbName = 'test'; + * // Connect using MongoClient + * MongoClient.connect(url, function(err, client) { + * // Select the database by name + * const testDb = client.db(dbName); + * client.close(); + * }); + * ``` + */ +export class Db { + /** @internal */ + s: DbPrivate; + + public static SYSTEM_NAMESPACE_COLLECTION = CONSTANTS.SYSTEM_NAMESPACE_COLLECTION; + public static SYSTEM_INDEX_COLLECTION = CONSTANTS.SYSTEM_INDEX_COLLECTION; + public static SYSTEM_PROFILE_COLLECTION = CONSTANTS.SYSTEM_PROFILE_COLLECTION; + public static SYSTEM_USER_COLLECTION = CONSTANTS.SYSTEM_USER_COLLECTION; + public static SYSTEM_COMMAND_COLLECTION = CONSTANTS.SYSTEM_COMMAND_COLLECTION; + public static SYSTEM_JS_COLLECTION = CONSTANTS.SYSTEM_JS_COLLECTION; + + /** + * Creates a new Db instance + * + * @param client - The MongoClient for the database. + * @param databaseName - The name of the database this instance represents. + * @param options - Optional settings for Db construction + */ + constructor(client: MongoClient, databaseName: string, options?: DbOptions) { + options = options ?? {}; + + // Filter the options + options = filterOptions(options, DB_OPTIONS_ALLOW_LIST); + + // Ensure we have a valid db name + validateDatabaseName(databaseName); + + // Internal state of the db object + this.s = { + // Client + client, + // Options + options, + // Logger instance + logger: new Logger('Db', options), + // Unpack read preference + readPreference: ReadPreference.fromOptions(options), + // Merge bson options + bsonOptions: resolveBSONOptions(options, client), + // Set up the primary key factory or fallback to ObjectId + pkFactory: options?.pkFactory ?? DEFAULT_PK_FACTORY, + // ReadConcern + readConcern: ReadConcern.fromOptions(options), + writeConcern: WriteConcern.fromOptions(options), + // Namespace + namespace: new MongoDBNamespace(databaseName) + }; + } + + get databaseName(): string { + return this.s.namespace.db; + } + + // Options + get options(): DbOptions | undefined { + return this.s.options; + } + + /** + * slaveOk specified + * @deprecated Use secondaryOk instead + */ + get slaveOk(): boolean { + return this.secondaryOk; + } + + /** + * Check if a secondary can be used (because the read preference is *not* set to primary) + */ + get secondaryOk(): boolean { + return this.s.readPreference?.preference !== 'primary' || false; + } + + get readConcern(): ReadConcern | undefined { + return this.s.readConcern; + } + + /** + * The current readPreference of the Db. If not explicitly defined for + * this Db, will be inherited from the parent MongoClient + */ + get readPreference(): ReadPreference { + if (this.s.readPreference == null) { + return this.s.client.readPreference; + } + + return this.s.readPreference; + } + + get bsonOptions(): BSONSerializeOptions { + return this.s.bsonOptions; + } + + // get the write Concern + get writeConcern(): WriteConcern | undefined { + return this.s.writeConcern; + } + + get namespace(): string { + return this.s.namespace.toString(); + } + + /** + * Create a new collection on a server with the specified options. Use this to create capped collections. + * More information about command options available at https://docs.mongodb.com/manual/reference/command/create/ + * + * @param name - The name of the collection to create + * @param options - Optional settings for the command + * @param callback - An optional callback, a Promise will be returned if none is provided + */ + createCollection( + name: string, + options?: CreateCollectionOptions + ): Promise>; + createCollection( + name: string, + callback: Callback> + ): void; + createCollection( + name: string, + options: CreateCollectionOptions | undefined, + callback: Callback> + ): void; + createCollection( + name: string, + options?: CreateCollectionOptions | Callback, + callback?: Callback + ): Promise> | void { + if (typeof options === 'function') (callback = options), (options = {}); + + return executeOperation( + this.s.client, + new CreateCollectionOperation(this, name, resolveOptions(this, options)) as TODO_NODE_3286, + callback + ) as TODO_NODE_3286; + } + + /** + * Execute a command + * + * @remarks + * This command does not inherit options from the MongoClient. + * + * @param command - The command to run + * @param options - Optional settings for the command + * @param callback - An optional callback, a Promise will be returned if none is provided + */ + command(command: Document): Promise; + command(command: Document, callback: Callback): void; + command(command: Document, options: RunCommandOptions): Promise; + command(command: Document, options: RunCommandOptions, callback: Callback): void; + command( + command: Document, + options?: RunCommandOptions | Callback, + callback?: Callback + ): Promise | void { + if (typeof options === 'function') (callback = options), (options = {}); + + // Intentionally, we do not inherit options from parent for this operation. + return executeOperation( + this.s.client, + new RunCommandOperation(this, command, options ?? {}), + callback + ); + } + + /** + * Execute an aggregation framework pipeline against the database, needs MongoDB \>= 3.6 + * + * @param pipeline - An array of aggregation stages to be executed + * @param options - Optional settings for the command + */ + aggregate( + pipeline: Document[] = [], + options?: AggregateOptions + ): AggregationCursor { + if (arguments.length > 2) { + throw new MongoInvalidArgumentError('Method "db.aggregate()" accepts at most two arguments'); + } + if (typeof pipeline === 'function') { + throw new MongoInvalidArgumentError('Argument "pipeline" must not be function'); + } + if (typeof options === 'function') { + throw new MongoInvalidArgumentError('Argument "options" must not be function'); + } + + return new AggregationCursor( + this.s.client, + this.s.namespace, + pipeline, + resolveOptions(this, options) + ); + } + + /** Return the Admin db instance */ + admin(): Admin { + return new Admin(this); + } + + /** + * Returns a reference to a MongoDB Collection. If it does not exist it will be created implicitly. + * + * @param name - the collection name we wish to access. + * @returns return the new Collection instance + */ + collection( + name: string, + options: CollectionOptions = {} + ): Collection { + if (typeof options === 'function') { + throw new MongoInvalidArgumentError('The callback form of this helper has been removed.'); + } + const finalOptions = resolveOptions(this, options); + return new Collection(this, name, finalOptions); + } + + /** + * Get all the db statistics. + * + * @param options - Optional settings for the command + * @param callback - An optional callback, a Promise will be returned if none is provided + */ + stats(): Promise; + stats(callback: Callback): void; + stats(options: DbStatsOptions): Promise; + stats(options: DbStatsOptions, callback: Callback): void; + stats( + options?: DbStatsOptions | Callback, + callback?: Callback + ): Promise | void { + if (typeof options === 'function') (callback = options), (options = {}); + return executeOperation( + this.s.client, + new DbStatsOperation(this, resolveOptions(this, options)), + callback + ); + } + + /** + * List all collections of this database with optional filter + * + * @param filter - Query to filter collections by + * @param options - Optional settings for the command + */ + listCollections( + filter: Document, + options: Exclude & { nameOnly: true } + ): ListCollectionsCursor>; + listCollections( + filter: Document, + options: Exclude & { nameOnly: false } + ): ListCollectionsCursor; + listCollections< + T extends Pick | CollectionInfo = + | Pick + | CollectionInfo + >(filter?: Document, options?: ListCollectionsOptions): ListCollectionsCursor; + listCollections< + T extends Pick | CollectionInfo = + | Pick + | CollectionInfo + >(filter: Document = {}, options: ListCollectionsOptions = {}): ListCollectionsCursor { + return new ListCollectionsCursor(this, filter, resolveOptions(this, options)); + } + + /** + * Rename a collection. + * + * @remarks + * This operation does not inherit options from the MongoClient. + * + * @param fromCollection - Name of current collection to rename + * @param toCollection - New name of of the collection + * @param options - Optional settings for the command + * @param callback - An optional callback, a Promise will be returned if none is provided + */ + renameCollection( + fromCollection: string, + toCollection: string + ): Promise>; + renameCollection( + fromCollection: string, + toCollection: string, + callback: Callback> + ): void; + renameCollection( + fromCollection: string, + toCollection: string, + options: RenameOptions + ): Promise>; + renameCollection( + fromCollection: string, + toCollection: string, + options: RenameOptions, + callback: Callback> + ): void; + renameCollection( + fromCollection: string, + toCollection: string, + options?: RenameOptions | Callback>, + callback?: Callback> + ): Promise> | void { + if (typeof options === 'function') (callback = options), (options = {}); + + // Intentionally, we do not inherit options from parent for this operation. + options = { ...options, readPreference: ReadPreference.PRIMARY }; + + // Add return new collection + options.new_collection = true; + + return executeOperation( + this.s.client, + new RenameOperation( + this.collection(fromCollection) as TODO_NODE_3286, + toCollection, + options + ) as TODO_NODE_3286, + callback + ); + } + + /** + * Drop a collection from the database, removing it permanently. New accesses will create a new collection. + * + * @param name - Name of collection to drop + * @param options - Optional settings for the command + * @param callback - An optional callback, a Promise will be returned if none is provided + */ + dropCollection(name: string): Promise; + dropCollection(name: string, callback: Callback): void; + dropCollection(name: string, options: DropCollectionOptions): Promise; + dropCollection(name: string, options: DropCollectionOptions, callback: Callback): void; + dropCollection( + name: string, + options?: DropCollectionOptions | Callback, + callback?: Callback + ): Promise | void { + if (typeof options === 'function') (callback = options), (options = {}); + + return executeOperation( + this.s.client, + new DropCollectionOperation(this, name, resolveOptions(this, options)), + callback + ); + } + + /** + * Drop a database, removing it permanently from the server. + * + * @param options - Optional settings for the command + * @param callback - An optional callback, a Promise will be returned if none is provided + */ + dropDatabase(): Promise; + dropDatabase(callback: Callback): void; + dropDatabase(options: DropDatabaseOptions): Promise; + dropDatabase(options: DropDatabaseOptions, callback: Callback): void; + dropDatabase( + options?: DropDatabaseOptions | Callback, + callback?: Callback + ): Promise | void { + if (typeof options === 'function') (callback = options), (options = {}); + + return executeOperation( + this.s.client, + new DropDatabaseOperation(this, resolveOptions(this, options)), + callback + ); + } + + /** + * Fetch all collections for the current db. + * + * @param options - Optional settings for the command + * @param callback - An optional callback, a Promise will be returned if none is provided + */ + collections(): Promise; + collections(callback: Callback): void; + collections(options: ListCollectionsOptions): Promise; + collections(options: ListCollectionsOptions, callback: Callback): void; + collections( + options?: ListCollectionsOptions | Callback, + callback?: Callback + ): Promise | void { + if (typeof options === 'function') (callback = options), (options = {}); + + return executeOperation( + this.s.client, + new CollectionsOperation(this, resolveOptions(this, options)), + callback + ); + } + + /** + * Creates an index on the db and collection. + * + * @param name - Name of the collection to create the index on. + * @param indexSpec - Specify the field to index, or an index specification + * @param options - Optional settings for the command + * @param callback - An optional callback, a Promise will be returned if none is provided + */ + createIndex(name: string, indexSpec: IndexSpecification): Promise; + createIndex(name: string, indexSpec: IndexSpecification, callback?: Callback): void; + createIndex( + name: string, + indexSpec: IndexSpecification, + options: CreateIndexesOptions + ): Promise; + createIndex( + name: string, + indexSpec: IndexSpecification, + options: CreateIndexesOptions, + callback: Callback + ): void; + createIndex( + name: string, + indexSpec: IndexSpecification, + options?: CreateIndexesOptions | Callback, + callback?: Callback + ): Promise | void { + if (typeof options === 'function') (callback = options), (options = {}); + + return executeOperation( + this.s.client, + new CreateIndexOperation(this, name, indexSpec, resolveOptions(this, options)), + callback + ); + } + + /** + * Add a user to the database + * + * @param username - The username for the new user + * @param password - An optional password for the new user + * @param options - Optional settings for the command + * @param callback - An optional callback, a Promise will be returned if none is provided + */ + addUser(username: string): Promise; + addUser(username: string, callback: Callback): void; + addUser(username: string, password: string): Promise; + addUser(username: string, password: string, callback: Callback): void; + addUser(username: string, options: AddUserOptions): Promise; + addUser(username: string, options: AddUserOptions, callback: Callback): void; + addUser(username: string, password: string, options: AddUserOptions): Promise; + addUser( + username: string, + password: string, + options: AddUserOptions, + callback: Callback + ): void; + addUser( + username: string, + password?: string | AddUserOptions | Callback, + options?: AddUserOptions | Callback, + callback?: Callback + ): Promise | void { + if (typeof password === 'function') { + (callback = password), (password = undefined), (options = {}); + } else if (typeof password !== 'string') { + if (typeof options === 'function') { + (callback = options), (options = password), (password = undefined); + } else { + (options = password), (callback = undefined), (password = undefined); + } + } else { + if (typeof options === 'function') (callback = options), (options = {}); + } + + return executeOperation( + this.s.client, + new AddUserOperation(this, username, password, resolveOptions(this, options)), + callback + ); + } + + /** + * Remove a user from a database + * + * @param username - The username to remove + * @param options - Optional settings for the command + * @param callback - An optional callback, a Promise will be returned if none is provided + */ + removeUser(username: string): Promise; + removeUser(username: string, callback: Callback): void; + removeUser(username: string, options: RemoveUserOptions): Promise; + removeUser(username: string, options: RemoveUserOptions, callback: Callback): void; + removeUser( + username: string, + options?: RemoveUserOptions | Callback, + callback?: Callback + ): Promise | void { + if (typeof options === 'function') (callback = options), (options = {}); + + return executeOperation( + this.s.client, + new RemoveUserOperation(this, username, resolveOptions(this, options)), + callback + ); + } + + /** + * Set the current profiling level of MongoDB + * + * @param level - The new profiling level (off, slow_only, all). + * @param options - Optional settings for the command + * @param callback - An optional callback, a Promise will be returned if none is provided + */ + setProfilingLevel(level: ProfilingLevel): Promise; + setProfilingLevel(level: ProfilingLevel, callback: Callback): void; + setProfilingLevel( + level: ProfilingLevel, + options: SetProfilingLevelOptions + ): Promise; + setProfilingLevel( + level: ProfilingLevel, + options: SetProfilingLevelOptions, + callback: Callback + ): void; + setProfilingLevel( + level: ProfilingLevel, + options?: SetProfilingLevelOptions | Callback, + callback?: Callback + ): Promise | void { + if (typeof options === 'function') (callback = options), (options = {}); + + return executeOperation( + this.s.client, + new SetProfilingLevelOperation(this, level, resolveOptions(this, options)), + callback + ); + } + + /** + * Retrieve the current profiling Level for MongoDB + * + * @param options - Optional settings for the command + * @param callback - An optional callback, a Promise will be returned if none is provided + */ + profilingLevel(): Promise; + profilingLevel(callback: Callback): void; + profilingLevel(options: ProfilingLevelOptions): Promise; + profilingLevel(options: ProfilingLevelOptions, callback: Callback): void; + profilingLevel( + options?: ProfilingLevelOptions | Callback, + callback?: Callback + ): Promise | void { + if (typeof options === 'function') (callback = options), (options = {}); + + return executeOperation( + this.s.client, + new ProfilingLevelOperation(this, resolveOptions(this, options)), + callback + ); + } + + /** + * Retrieves this collections index info. + * + * @param name - The name of the collection. + * @param options - Optional settings for the command + * @param callback - An optional callback, a Promise will be returned if none is provided + */ + indexInformation(name: string): Promise; + indexInformation(name: string, callback: Callback): void; + indexInformation(name: string, options: IndexInformationOptions): Promise; + indexInformation( + name: string, + options: IndexInformationOptions, + callback: Callback + ): void; + indexInformation( + name: string, + options?: IndexInformationOptions | Callback, + callback?: Callback + ): Promise | void { + if (typeof options === 'function') (callback = options), (options = {}); + + return executeOperation( + this.s.client, + new IndexInformationOperation(this, name, resolveOptions(this, options)), + callback + ); + } + + /** + * Unref all sockets + * @deprecated This function is deprecated and will be removed in the next major version. + */ + unref(): void { + getTopology(this).unref(); + } + + /** + * Create a new Change Stream, watching for new changes (insertions, updates, + * replacements, deletions, and invalidations) in this database. Will ignore all + * changes to system collections. + * + * @remarks + * watch() accepts two generic arguments for distinct usecases: + * - The first is to provide the schema that may be defined for all the collections within this database + * - The second is to override the shape of the change stream document entirely, if it is not provided the type will default to ChangeStreamDocument of the first argument + * + * @param pipeline - An array of {@link https://docs.mongodb.com/manual/reference/operator/aggregation-pipeline/|aggregation pipeline stages} through which to pass change stream documents. This allows for filtering (using $match) and manipulating the change stream documents. + * @param options - Optional settings for the command + * @typeParam TSchema - Type of the data being detected by the change stream + * @typeParam TChange - Type of the whole change stream document emitted + */ + watch< + TSchema extends Document = Document, + TChange extends Document = ChangeStreamDocument + >(pipeline: Document[] = [], options: ChangeStreamOptions = {}): ChangeStream { + // Allow optionally not specifying a pipeline + if (!Array.isArray(pipeline)) { + options = pipeline; + pipeline = []; + } + + return new ChangeStream(this, pipeline, resolveOptions(this, options)); + } + + /** Return the db logger */ + getLogger(): Logger { + return this.s.logger; + } + + get logger(): Logger { + return this.s.logger; + } +} + +// TODO(NODE-3484): Refactor into MongoDBNamespace +// Validate the database name +function validateDatabaseName(databaseName: string) { + if (typeof databaseName !== 'string') + throw new MongoInvalidArgumentError('Database name must be a string'); + if (databaseName.length === 0) + throw new MongoInvalidArgumentError('Database name cannot be the empty string'); + if (databaseName === '$external') return; + + const invalidChars = [' ', '.', '$', '/', '\\']; + for (let i = 0; i < invalidChars.length; i++) { + if (databaseName.indexOf(invalidChars[i]) !== -1) + throw new MongoAPIError(`database names cannot contain the character '${invalidChars[i]}'`); + } +} diff --git a/node_modules/mongodb/src/deps.ts b/node_modules/mongodb/src/deps.ts new file mode 100644 index 000000000..1c3ab68eb --- /dev/null +++ b/node_modules/mongodb/src/deps.ts @@ -0,0 +1,387 @@ +/* eslint-disable @typescript-eslint/no-var-requires */ +import type { deserialize, Document, serialize } from './bson'; +import type { ProxyOptions } from './cmap/connection'; +import { MongoMissingDependencyError } from './error'; +import type { MongoClient } from './mongo_client'; +import { Callback, parsePackageVersion } from './utils'; + +export const PKG_VERSION = Symbol('kPkgVersion'); + +function makeErrorModule(error: any) { + const props = error ? { kModuleError: error } : {}; + return new Proxy(props, { + get: (_: any, key: any) => { + if (key === 'kModuleError') { + return error; + } + throw error; + }, + set: () => { + throw error; + } + }); +} + +export let Kerberos: typeof import('kerberos') | { kModuleError: MongoMissingDependencyError } = + makeErrorModule( + new MongoMissingDependencyError( + 'Optional module `kerberos` not found. Please install it to enable kerberos authentication' + ) + ); + +try { + // Ensure you always wrap an optional require in the try block NODE-3199 + Kerberos = require('kerberos'); +} catch {} // eslint-disable-line + +export interface KerberosClient { + step: (challenge: string, callback?: Callback) => Promise | void; + wrap: ( + challenge: string, + options?: { user: string }, + callback?: Callback + ) => Promise | void; + unwrap: (challenge: string, callback?: Callback) => Promise | void; +} + +type ZStandardLib = { + /** + * Compress using zstd. + * @param buf - Buffer to be compressed. + */ + compress(buf: Buffer, level?: number): Promise; + + /** + * Decompress using zstd. + */ + decompress(buf: Buffer): Promise; +}; + +export let ZStandard: ZStandardLib | { kModuleError: MongoMissingDependencyError } = + makeErrorModule( + new MongoMissingDependencyError( + 'Optional module `@mongodb-js/zstd` not found. Please install it to enable zstd compression' + ) + ); + +try { + ZStandard = require('@mongodb-js/zstd'); +} catch {} // eslint-disable-line + +type SnappyLib = { + [PKG_VERSION]: { major: number; minor: number; patch: number }; + + /** + * - Snappy 6.x takes a callback and returns void + * - Snappy 7.x returns a promise + * + * In order to support both we must check the return value of the function + * @param buf - Buffer to be compressed + * @param callback - ONLY USED IN SNAPPY 6.x + */ + compress(buf: Buffer): Promise; + compress(buf: Buffer, callback: (error?: Error, buffer?: Buffer) => void): Promise | void; + compress( + buf: Buffer, + callback?: (error?: Error, buffer?: Buffer) => void + ): Promise | void; + + /** + * - Snappy 6.x takes a callback and returns void + * - Snappy 7.x returns a promise + * + * In order to support both we must check the return value of the function + * @param buf - Buffer to be compressed + * @param callback - ONLY USED IN SNAPPY 6.x + */ + uncompress(buf: Buffer, opt: { asBuffer: true }): Promise; + uncompress( + buf: Buffer, + opt: { asBuffer: true }, + callback: (error?: Error, buffer?: Buffer) => void + ): Promise | void; + uncompress( + buf: Buffer, + opt: { asBuffer: true }, + callback?: (error?: Error, buffer?: Buffer) => void + ): Promise | void; +}; + +export let Snappy: SnappyLib | { kModuleError: MongoMissingDependencyError } = makeErrorModule( + new MongoMissingDependencyError( + 'Optional module `snappy` not found. Please install it to enable snappy compression' + ) +); + +try { + // Ensure you always wrap an optional require in the try block NODE-3199 + Snappy = require('snappy'); + try { + (Snappy as any)[PKG_VERSION] = parsePackageVersion(require('snappy/package.json')); + } catch {} // eslint-disable-line +} catch {} // eslint-disable-line + +export let saslprep: typeof import('saslprep') | { kModuleError: MongoMissingDependencyError } = + makeErrorModule( + new MongoMissingDependencyError( + 'Optional module `saslprep` not found.' + + ' Please install it to enable Stringprep Profile for User Names and Passwords' + ) + ); + +try { + // Ensure you always wrap an optional require in the try block NODE-3199 + saslprep = require('saslprep'); +} catch {} // eslint-disable-line + +interface AWS4 { + /** + * Created these inline types to better assert future usage of this API + * @param options - options for request + * @param credentials - AWS credential details, sessionToken should be omitted entirely if its false-y + */ + sign( + options: { + path: '/'; + body: string; + host: string; + method: 'POST'; + headers: { + 'Content-Type': 'application/x-www-form-urlencoded'; + 'Content-Length': number; + 'X-MongoDB-Server-Nonce': string; + 'X-MongoDB-GS2-CB-Flag': 'n'; + }; + service: string; + region: string; + }, + credentials: + | { + accessKeyId: string; + secretAccessKey: string; + sessionToken: string; + } + | { + accessKeyId: string; + secretAccessKey: string; + } + | undefined + ): { + headers: { + Authorization: string; + 'X-Amz-Date': string; + }; + }; +} + +export let aws4: AWS4 | { kModuleError: MongoMissingDependencyError } = makeErrorModule( + new MongoMissingDependencyError( + 'Optional module `aws4` not found. Please install it to enable AWS authentication' + ) +); + +try { + // Ensure you always wrap an optional require in the try block NODE-3199 + aws4 = require('aws4'); +} catch {} // eslint-disable-line + +/** @public */ +export const AutoEncryptionLoggerLevel = Object.freeze({ + FatalError: 0, + Error: 1, + Warning: 2, + Info: 3, + Trace: 4 +} as const); + +/** @public */ +export type AutoEncryptionLoggerLevel = + typeof AutoEncryptionLoggerLevel[keyof typeof AutoEncryptionLoggerLevel]; + +/** @public */ +export interface AutoEncryptionTlsOptions { + /** + * Specifies the location of a local .pem file that contains + * either the client's TLS/SSL certificate and key or only the + * client's TLS/SSL key when tlsCertificateFile is used to + * provide the certificate. + */ + tlsCertificateKeyFile?: string; + /** + * Specifies the password to de-crypt the tlsCertificateKeyFile. + */ + tlsCertificateKeyFilePassword?: string; + /** + * Specifies the location of a local .pem file that contains the + * root certificate chain from the Certificate Authority. + * This file is used to validate the certificate presented by the + * KMS provider. + */ + tlsCAFile?: string; +} + +/** @public */ +export interface AutoEncryptionOptions { + /** @internal */ + bson?: { serialize: typeof serialize; deserialize: typeof deserialize }; + /** @internal client for metadata lookups */ + metadataClient?: MongoClient; + /** A `MongoClient` used to fetch keys from a key vault */ + keyVaultClient?: MongoClient; + /** The namespace where keys are stored in the key vault */ + keyVaultNamespace?: string; + /** Configuration options that are used by specific KMS providers during key generation, encryption, and decryption. */ + kmsProviders?: { + /** Configuration options for using 'aws' as your KMS provider */ + aws?: { + /** The access key used for the AWS KMS provider */ + accessKeyId: string; + /** The secret access key used for the AWS KMS provider */ + secretAccessKey: string; + /** + * An optional AWS session token that will be used as the + * X-Amz-Security-Token header for AWS requests. + */ + sessionToken?: string; + }; + /** Configuration options for using 'local' as your KMS provider */ + local?: { + /** + * The master key used to encrypt/decrypt data keys. + * A 96-byte long Buffer or base64 encoded string. + */ + key: Buffer | string; + }; + /** Configuration options for using 'azure' as your KMS provider */ + azure?: { + /** The tenant ID identifies the organization for the account */ + tenantId: string; + /** The client ID to authenticate a registered application */ + clientId: string; + /** The client secret to authenticate a registered application */ + clientSecret: string; + /** + * If present, a host with optional port. E.g. "example.com" or "example.com:443". + * This is optional, and only needed if customer is using a non-commercial Azure instance + * (e.g. a government or China account, which use different URLs). + * Defaults to "login.microsoftonline.com" + */ + identityPlatformEndpoint?: string | undefined; + }; + /** Configuration options for using 'gcp' as your KMS provider */ + gcp?: { + /** The service account email to authenticate */ + email: string; + /** A PKCS#8 encrypted key. This can either be a base64 string or a binary representation */ + privateKey: string | Buffer; + /** + * If present, a host with optional port. E.g. "example.com" or "example.com:443". + * Defaults to "oauth2.googleapis.com" + */ + endpoint?: string | undefined; + }; + /** + * Configuration options for using 'kmip' as your KMS provider + */ + kmip?: { + /** + * The output endpoint string. + * The endpoint consists of a hostname and port separated by a colon. + * E.g. "example.com:123". A port is always present. + */ + endpoint?: string; + }; + }; + /** + * A map of namespaces to a local JSON schema for encryption + * + * **NOTE**: Supplying options.schemaMap provides more security than relying on JSON Schemas obtained from the server. + * It protects against a malicious server advertising a false JSON Schema, which could trick the client into sending decrypted data that should be encrypted. + * Schemas supplied in the schemaMap only apply to configuring automatic encryption for client side encryption. + * Other validation rules in the JSON schema will not be enforced by the driver and will result in an error. + */ + schemaMap?: Document; + /** @experimental */ + encryptedFieldsMap?: Document; + /** Allows the user to bypass auto encryption, maintaining implicit decryption */ + bypassAutoEncryption?: boolean; + /** @experimental */ + bypassQueryAnalysis?: boolean; + options?: { + /** An optional hook to catch logging messages from the underlying encryption engine */ + logger?: (level: AutoEncryptionLoggerLevel, message: string) => void; + }; + extraOptions?: { + /** + * A local process the driver communicates with to determine how to encrypt values in a command. + * Defaults to "mongodb://%2Fvar%2Fmongocryptd.sock" if domain sockets are available or "mongodb://localhost:27020" otherwise + */ + mongocryptdURI?: string; + /** If true, autoEncryption will not attempt to spawn a mongocryptd before connecting */ + mongocryptdBypassSpawn?: boolean; + /** The path to the mongocryptd executable on the system */ + mongocryptdSpawnPath?: string; + /** Command line arguments to use when auto-spawning a mongocryptd */ + mongocryptdSpawnArgs?: string[]; + /** + * Full path to a MongoDB Crypt shared library to be used (instead of mongocryptd). + * + * This needs to be the path to the file itself, not a directory. + * It can be an absolute or relative path. If the path is relative and + * its first component is `$ORIGIN`, it will be replaced by the directory + * containing the mongodb-client-encryption native addon file. Otherwise, + * the path will be interpreted relative to the current working directory. + * + * Currently, loading different MongoDB Crypt shared library files from different + * MongoClients in the same process is not supported. + * + * If this option is provided and no MongoDB Crypt shared library could be loaded + * from the specified location, creating the MongoClient will fail. + * + * If this option is not provided and `cryptSharedLibRequired` is not specified, + * the AutoEncrypter will attempt to spawn and/or use mongocryptd according + * to the mongocryptd-specific `extraOptions` options. + * + * Specifying a path prevents mongocryptd from being used as a fallback. + * + * @experimental Requires the MongoDB Crypt shared library, available in MongoDB 6.0 or higher. + */ + cryptSharedLibPath?: string; + /** + * If specified, never use mongocryptd and instead fail when the MongoDB Crypt + * shared library could not be loaded. + * + * This is always true when `cryptSharedLibPath` is specified. + * + * @experimental Requires the MongoDB Crypt shared library, available in MongoDB 6.0 or higher. + */ + cryptSharedLibRequired?: boolean; + /** + * Search paths for a MongoDB Crypt shared library to be used (instead of mongocryptd) + * Only for driver testing! + * @internal + */ + cryptSharedLibSearchPaths?: string[]; + }; + proxyOptions?: ProxyOptions; + /** The TLS options to use connecting to the KMS provider */ + tlsOptions?: { + aws?: AutoEncryptionTlsOptions; + local?: AutoEncryptionTlsOptions; + azure?: AutoEncryptionTlsOptions; + gcp?: AutoEncryptionTlsOptions; + kmip?: AutoEncryptionTlsOptions; + }; +} + +/** @public */ +export interface AutoEncrypter { + // eslint-disable-next-line @typescript-eslint/no-misused-new + new (client: MongoClient, options: AutoEncryptionOptions): AutoEncrypter; + init(cb: Callback): void; + teardown(force: boolean, callback: Callback): void; + encrypt(ns: string, cmd: Document, options: any, callback: Callback): void; + decrypt(cmd: Document, options: any, callback: Callback): void; + /** @experimental */ + readonly cryptSharedLibVersionInfo: { version: bigint; versionStr: string } | null; +} diff --git a/node_modules/mongodb/src/encrypter.ts b/node_modules/mongodb/src/encrypter.ts new file mode 100644 index 000000000..de654ef12 --- /dev/null +++ b/node_modules/mongodb/src/encrypter.ts @@ -0,0 +1,145 @@ +/* eslint-disable @typescript-eslint/no-var-requires */ +import { deserialize, serialize } from './bson'; +import { MONGO_CLIENT_EVENTS } from './constants'; +import type { AutoEncrypter, AutoEncryptionOptions } from './deps'; +import { MongoInvalidArgumentError, MongoMissingDependencyError } from './error'; +import { MongoClient, MongoClientOptions } from './mongo_client'; +import type { Callback } from './utils'; + +let AutoEncrypterClass: AutoEncrypter; + +/** @internal */ +const kInternalClient = Symbol('internalClient'); + +/** @internal */ +export interface EncrypterOptions { + autoEncryption: AutoEncryptionOptions; + maxPoolSize?: number; +} + +/** @internal */ +export class Encrypter { + [kInternalClient]: MongoClient | null; + bypassAutoEncryption: boolean; + needsConnecting: boolean; + autoEncrypter: AutoEncrypter; + + constructor(client: MongoClient, uri: string, options: MongoClientOptions) { + if (typeof options.autoEncryption !== 'object') { + throw new MongoInvalidArgumentError('Option "autoEncryption" must be specified'); + } + // initialize to null, if we call getInternalClient, we may set this it is important to not overwrite those function calls. + this[kInternalClient] = null; + + this.bypassAutoEncryption = !!options.autoEncryption.bypassAutoEncryption; + this.needsConnecting = false; + + if (options.maxPoolSize === 0 && options.autoEncryption.keyVaultClient == null) { + options.autoEncryption.keyVaultClient = client; + } else if (options.autoEncryption.keyVaultClient == null) { + options.autoEncryption.keyVaultClient = this.getInternalClient(client, uri, options); + } + + if (this.bypassAutoEncryption) { + options.autoEncryption.metadataClient = undefined; + } else if (options.maxPoolSize === 0) { + options.autoEncryption.metadataClient = client; + } else { + options.autoEncryption.metadataClient = this.getInternalClient(client, uri, options); + } + + if (options.proxyHost) { + options.autoEncryption.proxyOptions = { + proxyHost: options.proxyHost, + proxyPort: options.proxyPort, + proxyUsername: options.proxyUsername, + proxyPassword: options.proxyPassword + }; + } + + options.autoEncryption.bson = Object.create(null); + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + options.autoEncryption.bson!.serialize = serialize; + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + options.autoEncryption.bson!.deserialize = deserialize; + + this.autoEncrypter = new AutoEncrypterClass(client, options.autoEncryption); + } + + getInternalClient(client: MongoClient, uri: string, options: MongoClientOptions): MongoClient { + // TODO(NODE-4144): Remove new variable for type narrowing + let internalClient = this[kInternalClient]; + if (internalClient == null) { + const clonedOptions: MongoClientOptions = {}; + + for (const key of [ + ...Object.getOwnPropertyNames(options), + ...Object.getOwnPropertySymbols(options) + ] as string[]) { + if (['autoEncryption', 'minPoolSize', 'servers', 'caseTranslate', 'dbName'].includes(key)) + continue; + Reflect.set(clonedOptions, key, Reflect.get(options, key)); + } + + clonedOptions.minPoolSize = 0; + + internalClient = new MongoClient(uri, clonedOptions); + this[kInternalClient] = internalClient; + + for (const eventName of MONGO_CLIENT_EVENTS) { + for (const listener of client.listeners(eventName)) { + internalClient.on(eventName, listener); + } + } + + client.on('newListener', (eventName, listener) => { + internalClient?.on(eventName, listener); + }); + + this.needsConnecting = true; + } + return internalClient; + } + + connectInternalClient(callback: Callback): void { + // TODO(NODE-4144): Remove new variable for type narrowing + const internalClient = this[kInternalClient]; + if (this.needsConnecting && internalClient != null) { + this.needsConnecting = false; + return internalClient.connect(callback); + } + + return callback(); + } + + close(client: MongoClient, force: boolean, callback: Callback): void { + this.autoEncrypter.teardown(!!force, e => { + const internalClient = this[kInternalClient]; + if (internalClient != null && client !== internalClient) { + return internalClient.close(force, callback); + } + callback(e); + }); + } + + static checkForMongoCrypt(): void { + let mongodbClientEncryption = undefined; + // Ensure you always wrap an optional require in the try block NODE-3199 + try { + // Note (NODE-4254): This is to get around the circular dependency between + // mongodb-client-encryption and the driver in the test scenarios. + if (process.env.MONGODB_CLIENT_ENCRYPTION_OVERRIDE) { + mongodbClientEncryption = require(process.env.MONGODB_CLIENT_ENCRYPTION_OVERRIDE); + } else { + mongodbClientEncryption = require('mongodb-client-encryption'); + } + } catch (err) { + throw new MongoMissingDependencyError( + 'Auto-encryption requested, but the module is not installed. ' + + 'Please add `mongodb-client-encryption` as a dependency of your project' + ); + } + + AutoEncrypterClass = mongodbClientEncryption.extension(require('../lib/index')).AutoEncrypter; + } +} diff --git a/node_modules/mongodb/src/error.ts b/node_modules/mongodb/src/error.ts new file mode 100644 index 000000000..7a788b923 --- /dev/null +++ b/node_modules/mongodb/src/error.ts @@ -0,0 +1,924 @@ +import type { Document } from './bson'; +import type { TopologyVersion } from './sdam/server_description'; +import type { TopologyDescription } from './sdam/topology_description'; + +/** @public */ +export type AnyError = MongoError | Error; + +/** @internal */ +const kErrorLabels = Symbol('errorLabels'); + +/** + * @internal + * The legacy error message from the server that indicates the node is not a writable primary + * https://github.com/mongodb/specifications/blob/b07c26dc40d04ac20349f989db531c9845fdd755/source/server-discovery-and-monitoring/server-discovery-and-monitoring.rst#not-writable-primary-and-node-is-recovering + */ +export const LEGACY_NOT_WRITABLE_PRIMARY_ERROR_MESSAGE = new RegExp('not master', 'i'); + +/** + * @internal + * The legacy error message from the server that indicates the node is not a primary or secondary + * https://github.com/mongodb/specifications/blob/b07c26dc40d04ac20349f989db531c9845fdd755/source/server-discovery-and-monitoring/server-discovery-and-monitoring.rst#not-writable-primary-and-node-is-recovering + */ +export const LEGACY_NOT_PRIMARY_OR_SECONDARY_ERROR_MESSAGE = new RegExp( + 'not master or secondary', + 'i' +); + +/** + * @internal + * The error message from the server that indicates the node is recovering + * https://github.com/mongodb/specifications/blob/b07c26dc40d04ac20349f989db531c9845fdd755/source/server-discovery-and-monitoring/server-discovery-and-monitoring.rst#not-writable-primary-and-node-is-recovering + */ +export const NODE_IS_RECOVERING_ERROR_MESSAGE = new RegExp('node is recovering', 'i'); + +/** @internal MongoDB Error Codes */ +export const MONGODB_ERROR_CODES = Object.freeze({ + HostUnreachable: 6, + HostNotFound: 7, + NetworkTimeout: 89, + ShutdownInProgress: 91, + PrimarySteppedDown: 189, + ExceededTimeLimit: 262, + SocketException: 9001, + NotWritablePrimary: 10107, + InterruptedAtShutdown: 11600, + InterruptedDueToReplStateChange: 11602, + NotPrimaryNoSecondaryOk: 13435, + NotPrimaryOrSecondary: 13436, + StaleShardVersion: 63, + StaleEpoch: 150, + StaleConfig: 13388, + RetryChangeStream: 234, + FailedToSatisfyReadPreference: 133, + CursorNotFound: 43, + LegacyNotPrimary: 10058, + WriteConcernFailed: 64, + NamespaceNotFound: 26, + IllegalOperation: 20, + MaxTimeMSExpired: 50, + UnknownReplWriteConcern: 79, + UnsatisfiableWriteConcern: 100 +} as const); + +// From spec@https://github.com/mongodb/specifications/blob/f93d78191f3db2898a59013a7ed5650352ef6da8/source/change-streams/change-streams.rst#resumable-error +export const GET_MORE_RESUMABLE_CODES = new Set([ + MONGODB_ERROR_CODES.HostUnreachable, + MONGODB_ERROR_CODES.HostNotFound, + MONGODB_ERROR_CODES.NetworkTimeout, + MONGODB_ERROR_CODES.ShutdownInProgress, + MONGODB_ERROR_CODES.PrimarySteppedDown, + MONGODB_ERROR_CODES.ExceededTimeLimit, + MONGODB_ERROR_CODES.SocketException, + MONGODB_ERROR_CODES.NotWritablePrimary, + MONGODB_ERROR_CODES.InterruptedAtShutdown, + MONGODB_ERROR_CODES.InterruptedDueToReplStateChange, + MONGODB_ERROR_CODES.NotPrimaryNoSecondaryOk, + MONGODB_ERROR_CODES.NotPrimaryOrSecondary, + MONGODB_ERROR_CODES.StaleShardVersion, + MONGODB_ERROR_CODES.StaleEpoch, + MONGODB_ERROR_CODES.StaleConfig, + MONGODB_ERROR_CODES.RetryChangeStream, + MONGODB_ERROR_CODES.FailedToSatisfyReadPreference, + MONGODB_ERROR_CODES.CursorNotFound +]); + +/** @public */ +export const MongoErrorLabel = Object.freeze({ + RetryableWriteError: 'RetryableWriteError', + TransientTransactionError: 'TransientTransactionError', + UnknownTransactionCommitResult: 'UnknownTransactionCommitResult', + ResumableChangeStreamError: 'ResumableChangeStreamError', + HandshakeError: 'HandshakeError' +} as const); + +/** @public */ +export type MongoErrorLabel = typeof MongoErrorLabel[keyof typeof MongoErrorLabel]; + +/** @public */ +export interface ErrorDescription extends Document { + message?: string; + errmsg?: string; + $err?: string; + errorLabels?: string[]; + errInfo?: Document; +} + +/** + * @public + * @category Error + * + * @privateRemarks + * CSFLE has a dependency on this error, it uses the constructor with a string argument + */ +export class MongoError extends Error { + /** @internal */ + [kErrorLabels]: Set; + /** + * This is a number in MongoServerError and a string in MongoDriverError + * @privateRemarks + * Define the type override on the subclasses when we can use the override keyword + */ + code?: number | string; + topologyVersion?: TopologyVersion; + + constructor(message: string | Error) { + if (message instanceof Error) { + super(message.message); + } else { + super(message); + } + this[kErrorLabels] = new Set(); + } + + override get name(): string { + return 'MongoError'; + } + + /** Legacy name for server error responses */ + get errmsg(): string { + return this.message; + } + + /** + * Checks the error to see if it has an error label + * + * @param label - The error label to check for + * @returns returns true if the error has the provided error label + */ + hasErrorLabel(label: string): boolean { + return this[kErrorLabels].has(label); + } + + addErrorLabel(label: string): void { + this[kErrorLabels].add(label); + } + + get errorLabels(): string[] { + return Array.from(this[kErrorLabels]); + } +} + +/** + * An error coming from the mongo server + * + * @public + * @category Error + */ +export class MongoServerError extends MongoError { + codeName?: string; + writeConcernError?: Document; + errInfo?: Document; + ok?: number; + [key: string]: any; + + constructor(message: ErrorDescription) { + super(message.message || message.errmsg || message.$err || 'n/a'); + if (message.errorLabels) { + this[kErrorLabels] = new Set(message.errorLabels); + } + + for (const name in message) { + if (name !== 'errorLabels' && name !== 'errmsg' && name !== 'message') + this[name] = message[name]; + } + } + + override get name(): string { + return 'MongoServerError'; + } +} + +/** + * An error generated by the driver + * + * @public + * @category Error + */ +export class MongoDriverError extends MongoError { + constructor(message: string) { + super(message); + } + + override get name(): string { + return 'MongoDriverError'; + } +} + +/** + * An error generated when the driver API is used incorrectly + * + * @privateRemarks + * Should **never** be directly instantiated + * + * @public + * @category Error + */ + +export class MongoAPIError extends MongoDriverError { + constructor(message: string) { + super(message); + } + + override get name(): string { + return 'MongoAPIError'; + } +} + +/** + * An error generated when the driver encounters unexpected input + * or reaches an unexpected/invalid internal state + * + * @privateRemarks + * Should **never** be directly instantiated. + * + * @public + * @category Error + */ +export class MongoRuntimeError extends MongoDriverError { + constructor(message: string) { + super(message); + } + + override get name(): string { + return 'MongoRuntimeError'; + } +} + +/** + * An error generated when a batch command is re-executed after one of the commands in the batch + * has failed + * + * @public + * @category Error + */ +export class MongoBatchReExecutionError extends MongoAPIError { + constructor(message = 'This batch has already been executed, create new batch to execute') { + super(message); + } + + override get name(): string { + return 'MongoBatchReExecutionError'; + } +} + +/** + * An error generated when the driver fails to decompress + * data received from the server. + * + * @public + * @category Error + */ +export class MongoDecompressionError extends MongoRuntimeError { + constructor(message: string) { + super(message); + } + + override get name(): string { + return 'MongoDecompressionError'; + } +} + +/** + * An error thrown when the user attempts to operate on a database or collection through a MongoClient + * that has not yet successfully called the "connect" method + * + * @public + * @category Error + */ +export class MongoNotConnectedError extends MongoAPIError { + constructor(message: string) { + super(message); + } + + override get name(): string { + return 'MongoNotConnectedError'; + } +} + +/** + * An error generated when the user makes a mistake in the usage of transactions. + * (e.g. attempting to commit a transaction with a readPreference other than primary) + * + * @public + * @category Error + */ +export class MongoTransactionError extends MongoAPIError { + constructor(message: string) { + super(message); + } + + override get name(): string { + return 'MongoTransactionError'; + } +} + +/** + * An error generated when the user attempts to operate + * on a session that has expired or has been closed. + * + * @public + * @category Error + */ +export class MongoExpiredSessionError extends MongoAPIError { + constructor(message = 'Cannot use a session that has ended') { + super(message); + } + + override get name(): string { + return 'MongoExpiredSessionError'; + } +} + +/** + * A error generated when the user attempts to authenticate + * via Kerberos, but fails to connect to the Kerberos client. + * + * @public + * @category Error + */ +export class MongoKerberosError extends MongoRuntimeError { + constructor(message: string) { + super(message); + } + + override get name(): string { + return 'MongoKerberosError'; + } +} + +/** + * A error generated when the user attempts to authenticate + * via AWS, but fails + * + * @public + * @category Error + */ +export class MongoAWSError extends MongoRuntimeError { + constructor(message: string) { + super(message); + } + + override get name(): string { + return 'MongoAWSError'; + } +} + +/** + * An error generated when a ChangeStream operation fails to execute. + * + * @public + * @category Error + */ +export class MongoChangeStreamError extends MongoRuntimeError { + constructor(message: string) { + super(message); + } + + override get name(): string { + return 'MongoChangeStreamError'; + } +} + +/** + * An error thrown when the user calls a function or method not supported on a tailable cursor + * + * @public + * @category Error + */ +export class MongoTailableCursorError extends MongoAPIError { + constructor(message = 'Tailable cursor does not support this operation') { + super(message); + } + + override get name(): string { + return 'MongoTailableCursorError'; + } +} + +/** An error generated when a GridFSStream operation fails to execute. + * + * @public + * @category Error + */ +export class MongoGridFSStreamError extends MongoRuntimeError { + constructor(message: string) { + super(message); + } + + override get name(): string { + return 'MongoGridFSStreamError'; + } +} + +/** + * An error generated when a malformed or invalid chunk is + * encountered when reading from a GridFSStream. + * + * @public + * @category Error + */ +export class MongoGridFSChunkError extends MongoRuntimeError { + constructor(message: string) { + super(message); + } + + override get name(): string { + return 'MongoGridFSChunkError'; + } +} + +/** + * An error generated when a **parsable** unexpected response comes from the server. + * This is generally an error where the driver in a state expecting a certain behavior to occur in + * the next message from MongoDB but it receives something else. + * This error **does not** represent an issue with wire message formatting. + * + * #### Example + * When an operation fails, it is the driver's job to retry it. It must perform serverSelection + * again to make sure that it attempts the operation against a server in a good state. If server + * selection returns a server that does not support retryable operations, this error is used. + * This scenario is unlikely as retryable support would also have been determined on the first attempt + * but it is possible the state change could report a selectable server that does not support retries. + * + * @public + * @category Error + */ +export class MongoUnexpectedServerResponseError extends MongoRuntimeError { + constructor(message: string) { + super(message); + } + + override get name(): string { + return 'MongoUnexpectedServerResponseError'; + } +} + +/** + * An error thrown when the user attempts to add options to a cursor that has already been + * initialized + * + * @public + * @category Error + */ +export class MongoCursorInUseError extends MongoAPIError { + constructor(message = 'Cursor is already initialized') { + super(message); + } + + override get name(): string { + return 'MongoCursorInUseError'; + } +} + +/** + * An error generated when an attempt is made to operate + * on a closed/closing server. + * + * @public + * @category Error + */ +export class MongoServerClosedError extends MongoAPIError { + constructor(message = 'Server is closed') { + super(message); + } + + override get name(): string { + return 'MongoServerClosedError'; + } +} + +/** + * An error thrown when an attempt is made to read from a cursor that has been exhausted + * + * @public + * @category Error + */ +export class MongoCursorExhaustedError extends MongoAPIError { + constructor(message?: string) { + super(message || 'Cursor is exhausted'); + } + + override get name(): string { + return 'MongoCursorExhaustedError'; + } +} + +/** + * An error generated when an attempt is made to operate on a + * dropped, or otherwise unavailable, database. + * + * @public + * @category Error + */ +export class MongoTopologyClosedError extends MongoAPIError { + constructor(message = 'Topology is closed') { + super(message); + } + + override get name(): string { + return 'MongoTopologyClosedError'; + } +} + +/** @internal */ +const kBeforeHandshake = Symbol('beforeHandshake'); +export function isNetworkErrorBeforeHandshake(err: MongoNetworkError): boolean { + return err[kBeforeHandshake] === true; +} + +/** @public */ +export interface MongoNetworkErrorOptions { + /** Indicates the timeout happened before a connection handshake completed */ + beforeHandshake: boolean; +} + +/** + * An error indicating an issue with the network, including TCP errors and timeouts. + * @public + * @category Error + */ +export class MongoNetworkError extends MongoError { + /** @internal */ + [kBeforeHandshake]?: boolean; + + constructor(message: string | Error, options?: MongoNetworkErrorOptions) { + super(message); + + if (options && typeof options.beforeHandshake === 'boolean') { + this[kBeforeHandshake] = options.beforeHandshake; + } + } + + override get name(): string { + return 'MongoNetworkError'; + } +} + +/** + * An error indicating a network timeout occurred + * @public + * @category Error + * + * @privateRemarks + * CSFLE has a dependency on this error with an instanceof check + */ +export class MongoNetworkTimeoutError extends MongoNetworkError { + constructor(message: string, options?: MongoNetworkErrorOptions) { + super(message, options); + } + + override get name(): string { + return 'MongoNetworkTimeoutError'; + } +} + +/** + * An error used when attempting to parse a value (like a connection string) + * @public + * @category Error + */ +export class MongoParseError extends MongoDriverError { + constructor(message: string) { + super(message); + } + + override get name(): string { + return 'MongoParseError'; + } +} + +/** + * An error generated when the user supplies malformed or unexpected arguments + * or when a required argument or field is not provided. + * + * + * @public + * @category Error + */ +export class MongoInvalidArgumentError extends MongoAPIError { + constructor(message: string) { + super(message); + } + + override get name(): string { + return 'MongoInvalidArgumentError'; + } +} + +/** + * An error generated when a feature that is not enabled or allowed for the current server + * configuration is used + * + * + * @public + * @category Error + */ +export class MongoCompatibilityError extends MongoAPIError { + constructor(message: string) { + super(message); + } + + override get name(): string { + return 'MongoCompatibilityError'; + } +} + +/** + * An error generated when the user fails to provide authentication credentials before attempting + * to connect to a mongo server instance. + * + * + * @public + * @category Error + */ +export class MongoMissingCredentialsError extends MongoAPIError { + constructor(message: string) { + super(message); + } + + override get name(): string { + return 'MongoMissingCredentialsError'; + } +} + +/** + * An error generated when a required module or dependency is not present in the local environment + * + * @public + * @category Error + */ +export class MongoMissingDependencyError extends MongoAPIError { + constructor(message: string) { + super(message); + } + + override get name(): string { + return 'MongoMissingDependencyError'; + } +} +/** + * An error signifying a general system issue + * @public + * @category Error + */ +export class MongoSystemError extends MongoError { + /** An optional reason context, such as an error saved during flow of monitoring and selecting servers */ + reason?: TopologyDescription; + + constructor(message: string, reason: TopologyDescription) { + if (reason && reason.error) { + super(reason.error.message || reason.error); + } else { + super(message); + } + + if (reason) { + this.reason = reason; + } + + this.code = reason.error?.code; + } + + override get name(): string { + return 'MongoSystemError'; + } +} + +/** + * An error signifying a client-side server selection error + * @public + * @category Error + */ +export class MongoServerSelectionError extends MongoSystemError { + constructor(message: string, reason: TopologyDescription) { + super(message, reason); + } + + override get name(): string { + return 'MongoServerSelectionError'; + } +} + +function makeWriteConcernResultObject(input: any) { + const output = Object.assign({}, input); + + if (output.ok === 0) { + output.ok = 1; + delete output.errmsg; + delete output.code; + delete output.codeName; + } + + return output; +} + +/** + * An error thrown when the server reports a writeConcernError + * @public + * @category Error + */ +export class MongoWriteConcernError extends MongoServerError { + /** The result document (provided if ok: 1) */ + result?: Document; + + constructor(message: ErrorDescription, result?: Document) { + if (result && Array.isArray(result.errorLabels)) { + message.errorLabels = result.errorLabels; + } + + super(message); + this.errInfo = message.errInfo; + + if (result != null) { + this.result = makeWriteConcernResultObject(result); + } + } + + override get name(): string { + return 'MongoWriteConcernError'; + } +} + +// https://github.com/mongodb/specifications/blob/master/source/retryable-reads/retryable-reads.rst#retryable-error +const RETRYABLE_READ_ERROR_CODES = new Set([ + MONGODB_ERROR_CODES.HostUnreachable, + MONGODB_ERROR_CODES.HostNotFound, + MONGODB_ERROR_CODES.NetworkTimeout, + MONGODB_ERROR_CODES.ShutdownInProgress, + MONGODB_ERROR_CODES.PrimarySteppedDown, + MONGODB_ERROR_CODES.SocketException, + MONGODB_ERROR_CODES.NotWritablePrimary, + MONGODB_ERROR_CODES.InterruptedAtShutdown, + MONGODB_ERROR_CODES.InterruptedDueToReplStateChange, + MONGODB_ERROR_CODES.NotPrimaryNoSecondaryOk, + MONGODB_ERROR_CODES.NotPrimaryOrSecondary +]); + +// see: https://github.com/mongodb/specifications/blob/master/source/retryable-writes/retryable-writes.rst#terms +const RETRYABLE_WRITE_ERROR_CODES = new Set([ + ...RETRYABLE_READ_ERROR_CODES, + MONGODB_ERROR_CODES.ExceededTimeLimit +]); + +export function needsRetryableWriteLabel(error: Error, maxWireVersion: number): boolean { + // pre-4.4 server, then the driver adds an error label for every valid case + // execute operation will only inspect the label, code/message logic is handled here + if (error instanceof MongoNetworkError) { + return true; + } + + if (error instanceof MongoError) { + if ( + (maxWireVersion >= 9 || error.hasErrorLabel(MongoErrorLabel.RetryableWriteError)) && + !error.hasErrorLabel(MongoErrorLabel.HandshakeError) + ) { + // If we already have the error label no need to add it again. 4.4+ servers add the label. + // In the case where we have a handshake error, need to fall down to the logic checking + // the codes. + return false; + } + } + + if (error instanceof MongoWriteConcernError) { + return RETRYABLE_WRITE_ERROR_CODES.has(error.result?.code ?? error.code ?? 0); + } + + if (error instanceof MongoError && typeof error.code === 'number') { + return RETRYABLE_WRITE_ERROR_CODES.has(error.code); + } + + const isNotWritablePrimaryError = LEGACY_NOT_WRITABLE_PRIMARY_ERROR_MESSAGE.test(error.message); + if (isNotWritablePrimaryError) { + return true; + } + + const isNodeIsRecoveringError = NODE_IS_RECOVERING_ERROR_MESSAGE.test(error.message); + if (isNodeIsRecoveringError) { + return true; + } + + return false; +} + +export function isRetryableWriteError(error: MongoError): boolean { + return error.hasErrorLabel(MongoErrorLabel.RetryableWriteError); +} + +/** Determines whether an error is something the driver should attempt to retry */ +export function isRetryableReadError(error: MongoError): boolean { + const hasRetryableErrorCode = + typeof error.code === 'number' ? RETRYABLE_READ_ERROR_CODES.has(error.code) : false; + if (hasRetryableErrorCode) { + return true; + } + + if (error instanceof MongoNetworkError) { + return true; + } + + const isNotWritablePrimaryError = LEGACY_NOT_WRITABLE_PRIMARY_ERROR_MESSAGE.test(error.message); + if (isNotWritablePrimaryError) { + return true; + } + + const isNodeIsRecoveringError = NODE_IS_RECOVERING_ERROR_MESSAGE.test(error.message); + if (isNodeIsRecoveringError) { + return true; + } + + return false; +} + +const SDAM_RECOVERING_CODES = new Set([ + MONGODB_ERROR_CODES.ShutdownInProgress, + MONGODB_ERROR_CODES.PrimarySteppedDown, + MONGODB_ERROR_CODES.InterruptedAtShutdown, + MONGODB_ERROR_CODES.InterruptedDueToReplStateChange, + MONGODB_ERROR_CODES.NotPrimaryOrSecondary +]); + +const SDAM_NOT_PRIMARY_CODES = new Set([ + MONGODB_ERROR_CODES.NotWritablePrimary, + MONGODB_ERROR_CODES.NotPrimaryNoSecondaryOk, + MONGODB_ERROR_CODES.LegacyNotPrimary +]); + +const SDAM_NODE_SHUTTING_DOWN_ERROR_CODES = new Set([ + MONGODB_ERROR_CODES.InterruptedAtShutdown, + MONGODB_ERROR_CODES.ShutdownInProgress +]); + +function isRecoveringError(err: MongoError) { + if (typeof err.code === 'number') { + // If any error code exists, we ignore the error.message + return SDAM_RECOVERING_CODES.has(err.code); + } + + return ( + LEGACY_NOT_PRIMARY_OR_SECONDARY_ERROR_MESSAGE.test(err.message) || + NODE_IS_RECOVERING_ERROR_MESSAGE.test(err.message) + ); +} + +function isNotWritablePrimaryError(err: MongoError) { + if (typeof err.code === 'number') { + // If any error code exists, we ignore the error.message + return SDAM_NOT_PRIMARY_CODES.has(err.code); + } + + if (isRecoveringError(err)) { + return false; + } + + return LEGACY_NOT_WRITABLE_PRIMARY_ERROR_MESSAGE.test(err.message); +} + +export function isNodeShuttingDownError(err: MongoError): boolean { + return !!(typeof err.code === 'number' && SDAM_NODE_SHUTTING_DOWN_ERROR_CODES.has(err.code)); +} + +/** + * Determines whether SDAM can recover from a given error. If it cannot + * then the pool will be cleared, and server state will completely reset + * locally. + * + * @see https://github.com/mongodb/specifications/blob/master/source/server-discovery-and-monitoring/server-discovery-and-monitoring.rst#not-master-and-node-is-recovering + */ +export function isSDAMUnrecoverableError(error: MongoError): boolean { + // NOTE: null check is here for a strictly pre-CMAP world, a timeout or + // close event are considered unrecoverable + if (error instanceof MongoParseError || error == null) { + return true; + } + + return isRecoveringError(error) || isNotWritablePrimaryError(error); +} + +export function isNetworkTimeoutError(err: MongoError): err is MongoNetworkError { + return !!(err instanceof MongoNetworkError && err.message.match(/timed out/)); +} + +export function isResumableError(error?: Error, wireVersion?: number): boolean { + if (error == null || !(error instanceof MongoError)) { + return false; + } + + if (error instanceof MongoNetworkError) { + return true; + } + + if (wireVersion != null && wireVersion >= 9) { + // DRIVERS-1308: For 4.4 drivers running against 4.4 servers, drivers will add a special case to treat the CursorNotFound error code as resumable + if (error.code === MONGODB_ERROR_CODES.CursorNotFound) { + return true; + } + return error.hasErrorLabel(MongoErrorLabel.ResumableChangeStreamError); + } + + if (typeof error.code === 'number') { + return GET_MORE_RESUMABLE_CODES.has(error.code); + } + + return false; +} diff --git a/node_modules/mongodb/src/explain.ts b/node_modules/mongodb/src/explain.ts new file mode 100644 index 000000000..0d08e694a --- /dev/null +++ b/node_modules/mongodb/src/explain.ts @@ -0,0 +1,52 @@ +import { MongoInvalidArgumentError } from './error'; + +/** @public */ +export const ExplainVerbosity = Object.freeze({ + queryPlanner: 'queryPlanner', + queryPlannerExtended: 'queryPlannerExtended', + executionStats: 'executionStats', + allPlansExecution: 'allPlansExecution' +} as const); + +/** @public */ +export type ExplainVerbosity = string; + +/** + * For backwards compatibility, true is interpreted as "allPlansExecution" + * and false as "queryPlanner". Prior to server version 3.6, aggregate() + * ignores the verbosity parameter and executes in "queryPlanner". + * @public + */ +export type ExplainVerbosityLike = ExplainVerbosity | boolean; + +/** @public */ +export interface ExplainOptions { + /** Specifies the verbosity mode for the explain output. */ + explain?: ExplainVerbosityLike; +} + +/** @internal */ +export class Explain { + verbosity: ExplainVerbosity; + + constructor(verbosity: ExplainVerbosityLike) { + if (typeof verbosity === 'boolean') { + this.verbosity = verbosity + ? ExplainVerbosity.allPlansExecution + : ExplainVerbosity.queryPlanner; + } else { + this.verbosity = verbosity; + } + } + + static fromOptions(options?: ExplainOptions): Explain | undefined { + if (options?.explain == null) return; + + const explain = options.explain; + if (typeof explain === 'boolean' || typeof explain === 'string') { + return new Explain(explain); + } + + throw new MongoInvalidArgumentError('Field "explain" must be a string or a boolean'); + } +} diff --git a/node_modules/mongodb/src/gridfs/download.ts b/node_modules/mongodb/src/gridfs/download.ts new file mode 100644 index 000000000..a13cdac39 --- /dev/null +++ b/node_modules/mongodb/src/gridfs/download.ts @@ -0,0 +1,458 @@ +import { Readable } from 'stream'; + +import type { Document, ObjectId } from '../bson'; +import type { Collection } from '../collection'; +import type { FindCursor } from '../cursor/find_cursor'; +import { + MongoGridFSChunkError, + MongoGridFSStreamError, + MongoInvalidArgumentError, + MongoRuntimeError +} from '../error'; +import type { FindOptions } from '../operations/find'; +import type { ReadPreference } from '../read_preference'; +import type { Sort } from '../sort'; +import type { Callback } from '../utils'; +import type { GridFSChunk } from './upload'; + +/** @public */ +export interface GridFSBucketReadStreamOptions { + sort?: Sort; + skip?: number; + /** 0-based offset in bytes to start streaming from */ + start?: number; + /** 0-based offset in bytes to stop streaming before */ + end?: number; +} + +/** @public */ +export interface GridFSBucketReadStreamOptionsWithRevision extends GridFSBucketReadStreamOptions { + /** The revision number relative to the oldest file with the given filename. 0 + * gets you the oldest file, 1 gets you the 2nd oldest, -1 gets you the + * newest. */ + revision?: number; +} + +/** @public */ +export interface GridFSFile { + _id: ObjectId; + length: number; + chunkSize: number; + filename: string; + contentType?: string; + aliases?: string[]; + metadata?: Document; + uploadDate: Date; +} + +/** @internal */ +export interface GridFSBucketReadStreamPrivate { + bytesRead: number; + bytesToTrim: number; + bytesToSkip: number; + chunks: Collection; + cursor?: FindCursor; + expected: number; + files: Collection; + filter: Document; + init: boolean; + expectedEnd: number; + file?: GridFSFile; + options: { + sort?: Sort; + skip?: number; + start: number; + end: number; + }; + readPreference?: ReadPreference; +} + +/** + * A readable stream that enables you to read buffers from GridFS. + * + * Do not instantiate this class directly. Use `openDownloadStream()` instead. + * @public + */ +export class GridFSBucketReadStream extends Readable implements NodeJS.ReadableStream { + /** @internal */ + s: GridFSBucketReadStreamPrivate; + + /** + * An error occurred + * @event + */ + static readonly ERROR = 'error' as const; + /** + * Fires when the stream loaded the file document corresponding to the provided id. + * @event + */ + static readonly FILE = 'file' as const; + /** + * Emitted when a chunk of data is available to be consumed. + * @event + */ + static readonly DATA = 'data' as const; + /** + * Fired when the stream is exhausted (no more data events). + * @event + */ + static readonly END = 'end' as const; + /** + * Fired when the stream is exhausted and the underlying cursor is killed + * @event + */ + static readonly CLOSE = 'close' as const; + + /** @internal + * @param chunks - Handle for chunks collection + * @param files - Handle for files collection + * @param readPreference - The read preference to use + * @param filter - The filter to use to find the file document + */ + constructor( + chunks: Collection, + files: Collection, + readPreference: ReadPreference | undefined, + filter: Document, + options?: GridFSBucketReadStreamOptions + ) { + super(); + this.s = { + bytesToTrim: 0, + bytesToSkip: 0, + bytesRead: 0, + chunks, + expected: 0, + files, + filter, + init: false, + expectedEnd: 0, + options: { + start: 0, + end: 0, + ...options + }, + readPreference + }; + } + + /** + * Reads from the cursor and pushes to the stream. + * Private Impl, do not call directly + * @internal + */ + override _read(): void { + if (this.destroyed) return; + waitForFile(this, () => doRead(this)); + } + + /** + * Sets the 0-based offset in bytes to start streaming from. Throws + * an error if this stream has entered flowing mode + * (e.g. if you've already called `on('data')`) + * + * @param start - 0-based offset in bytes to start streaming from + */ + start(start = 0): this { + throwIfInitialized(this); + this.s.options.start = start; + return this; + } + + /** + * Sets the 0-based offset in bytes to start streaming from. Throws + * an error if this stream has entered flowing mode + * (e.g. if you've already called `on('data')`) + * + * @param end - Offset in bytes to stop reading at + */ + end(end = 0): this { + throwIfInitialized(this); + this.s.options.end = end; + return this; + } + + /** + * Marks this stream as aborted (will never push another `data` event) + * and kills the underlying cursor. Will emit the 'end' event, and then + * the 'close' event once the cursor is successfully killed. + * + * @param callback - called when the cursor is successfully closed or an error occurred. + */ + abort(callback?: Callback): void { + this.push(null); + this.destroyed = true; + if (this.s.cursor) { + this.s.cursor.close(error => { + this.emit(GridFSBucketReadStream.CLOSE); + callback && callback(error); + }); + } else { + if (!this.s.init) { + // If not initialized, fire close event because we will never + // get a cursor + this.emit(GridFSBucketReadStream.CLOSE); + } + callback && callback(); + } + } +} + +function throwIfInitialized(stream: GridFSBucketReadStream): void { + if (stream.s.init) { + throw new MongoGridFSStreamError('Options cannot be changed after the stream is initialized'); + } +} + +function doRead(stream: GridFSBucketReadStream): void { + if (stream.destroyed) return; + if (!stream.s.cursor) return; + if (!stream.s.file) return; + + stream.s.cursor.next((error, doc) => { + if (stream.destroyed) { + return; + } + if (error) { + stream.emit(GridFSBucketReadStream.ERROR, error); + return; + } + if (!doc) { + stream.push(null); + + process.nextTick(() => { + if (!stream.s.cursor) return; + stream.s.cursor.close(error => { + if (error) { + stream.emit(GridFSBucketReadStream.ERROR, error); + return; + } + + stream.emit(GridFSBucketReadStream.CLOSE); + }); + }); + + return; + } + + if (!stream.s.file) return; + + const bytesRemaining = stream.s.file.length - stream.s.bytesRead; + const expectedN = stream.s.expected++; + const expectedLength = Math.min(stream.s.file.chunkSize, bytesRemaining); + if (doc.n > expectedN) { + return stream.emit( + GridFSBucketReadStream.ERROR, + new MongoGridFSChunkError( + `ChunkIsMissing: Got unexpected n: ${doc.n}, expected: ${expectedN}` + ) + ); + } + + if (doc.n < expectedN) { + return stream.emit( + GridFSBucketReadStream.ERROR, + new MongoGridFSChunkError(`ExtraChunk: Got unexpected n: ${doc.n}, expected: ${expectedN}`) + ); + } + + let buf = Buffer.isBuffer(doc.data) ? doc.data : doc.data.buffer; + + if (buf.byteLength !== expectedLength) { + if (bytesRemaining <= 0) { + return stream.emit( + GridFSBucketReadStream.ERROR, + new MongoGridFSChunkError( + `ExtraChunk: Got unexpected n: ${doc.n}, expected file length ${stream.s.file.length} bytes but already read ${stream.s.bytesRead} bytes` + ) + ); + } + + return stream.emit( + GridFSBucketReadStream.ERROR, + new MongoGridFSChunkError( + `ChunkIsWrongSize: Got unexpected length: ${buf.byteLength}, expected: ${expectedLength}` + ) + ); + } + + stream.s.bytesRead += buf.byteLength; + + if (buf.byteLength === 0) { + return stream.push(null); + } + + let sliceStart = null; + let sliceEnd = null; + + if (stream.s.bytesToSkip != null) { + sliceStart = stream.s.bytesToSkip; + stream.s.bytesToSkip = 0; + } + + const atEndOfStream = expectedN === stream.s.expectedEnd - 1; + const bytesLeftToRead = stream.s.options.end - stream.s.bytesToSkip; + if (atEndOfStream && stream.s.bytesToTrim != null) { + sliceEnd = stream.s.file.chunkSize - stream.s.bytesToTrim; + } else if (stream.s.options.end && bytesLeftToRead < doc.data.byteLength) { + sliceEnd = bytesLeftToRead; + } + + if (sliceStart != null || sliceEnd != null) { + buf = buf.slice(sliceStart || 0, sliceEnd || buf.byteLength); + } + + stream.push(buf); + return; + }); +} + +function init(stream: GridFSBucketReadStream): void { + const findOneOptions: FindOptions = {}; + if (stream.s.readPreference) { + findOneOptions.readPreference = stream.s.readPreference; + } + if (stream.s.options && stream.s.options.sort) { + findOneOptions.sort = stream.s.options.sort; + } + if (stream.s.options && stream.s.options.skip) { + findOneOptions.skip = stream.s.options.skip; + } + + stream.s.files.findOne(stream.s.filter, findOneOptions, (error, doc) => { + if (error) { + return stream.emit(GridFSBucketReadStream.ERROR, error); + } + + if (!doc) { + const identifier = stream.s.filter._id + ? stream.s.filter._id.toString() + : stream.s.filter.filename; + const errmsg = `FileNotFound: file ${identifier} was not found`; + // TODO(NODE-3483) + const err = new MongoRuntimeError(errmsg); + err.code = 'ENOENT'; // TODO: NODE-3338 set property as part of constructor + return stream.emit(GridFSBucketReadStream.ERROR, err); + } + + // If document is empty, kill the stream immediately and don't + // execute any reads + if (doc.length <= 0) { + stream.push(null); + return; + } + + if (stream.destroyed) { + // If user destroys the stream before we have a cursor, wait + // until the query is done to say we're 'closed' because we can't + // cancel a query. + stream.emit(GridFSBucketReadStream.CLOSE); + return; + } + + try { + stream.s.bytesToSkip = handleStartOption(stream, doc, stream.s.options); + } catch (error) { + return stream.emit(GridFSBucketReadStream.ERROR, error); + } + + const filter: Document = { files_id: doc._id }; + + // Currently (MongoDB 3.4.4) skip function does not support the index, + // it needs to retrieve all the documents first and then skip them. (CS-25811) + // As work around we use $gte on the "n" field. + if (stream.s.options && stream.s.options.start != null) { + const skip = Math.floor(stream.s.options.start / doc.chunkSize); + if (skip > 0) { + filter['n'] = { $gte: skip }; + } + } + stream.s.cursor = stream.s.chunks.find(filter).sort({ n: 1 }); + + if (stream.s.readPreference) { + stream.s.cursor.withReadPreference(stream.s.readPreference); + } + + stream.s.expectedEnd = Math.ceil(doc.length / doc.chunkSize); + stream.s.file = doc as GridFSFile; + + try { + stream.s.bytesToTrim = handleEndOption(stream, doc, stream.s.cursor, stream.s.options); + } catch (error) { + return stream.emit(GridFSBucketReadStream.ERROR, error); + } + + stream.emit(GridFSBucketReadStream.FILE, doc); + return; + }); +} + +function waitForFile(stream: GridFSBucketReadStream, callback: Callback): void { + if (stream.s.file) { + return callback(); + } + + if (!stream.s.init) { + init(stream); + stream.s.init = true; + } + + stream.once('file', () => { + callback(); + }); +} + +function handleStartOption( + stream: GridFSBucketReadStream, + doc: Document, + options: GridFSBucketReadStreamOptions +): number { + if (options && options.start != null) { + if (options.start > doc.length) { + throw new MongoInvalidArgumentError( + `Stream start (${options.start}) must not be more than the length of the file (${doc.length})` + ); + } + if (options.start < 0) { + throw new MongoInvalidArgumentError(`Stream start (${options.start}) must not be negative`); + } + if (options.end != null && options.end < options.start) { + throw new MongoInvalidArgumentError( + `Stream start (${options.start}) must not be greater than stream end (${options.end})` + ); + } + + stream.s.bytesRead = Math.floor(options.start / doc.chunkSize) * doc.chunkSize; + stream.s.expected = Math.floor(options.start / doc.chunkSize); + + return options.start - stream.s.bytesRead; + } + throw new MongoInvalidArgumentError('Start option must be defined'); +} + +function handleEndOption( + stream: GridFSBucketReadStream, + doc: Document, + cursor: FindCursor, + options: GridFSBucketReadStreamOptions +) { + if (options && options.end != null) { + if (options.end > doc.length) { + throw new MongoInvalidArgumentError( + `Stream end (${options.end}) must not be more than the length of the file (${doc.length})` + ); + } + if (options.start == null || options.start < 0) { + throw new MongoInvalidArgumentError(`Stream end (${options.end}) must not be negative`); + } + + const start = options.start != null ? Math.floor(options.start / doc.chunkSize) : 0; + + cursor.limit(Math.ceil(options.end / doc.chunkSize) - start); + + stream.s.expectedEnd = Math.ceil(options.end / doc.chunkSize); + + return Math.ceil(options.end / doc.chunkSize) * doc.chunkSize - options.end; + } + throw new MongoInvalidArgumentError('End option must be defined'); +} diff --git a/node_modules/mongodb/src/gridfs/index.ts b/node_modules/mongodb/src/gridfs/index.ts new file mode 100644 index 000000000..a2a1c3dcc --- /dev/null +++ b/node_modules/mongodb/src/gridfs/index.ts @@ -0,0 +1,257 @@ +import type { ObjectId } from '../bson'; +import type { Collection } from '../collection'; +import type { FindCursor } from '../cursor/find_cursor'; +import type { Db } from '../db'; +import { MongoRuntimeError } from '../error'; +import type { Logger } from '../logger'; +import { Filter, TypedEventEmitter } from '../mongo_types'; +import type { ReadPreference } from '../read_preference'; +import type { Sort } from '../sort'; +import { Callback, maybePromise } from '../utils'; +import { WriteConcern, WriteConcernOptions } from '../write_concern'; +import type { FindOptions } from './../operations/find'; +import { + GridFSBucketReadStream, + GridFSBucketReadStreamOptions, + GridFSBucketReadStreamOptionsWithRevision, + GridFSFile +} from './download'; +import { GridFSBucketWriteStream, GridFSBucketWriteStreamOptions, GridFSChunk } from './upload'; + +const DEFAULT_GRIDFS_BUCKET_OPTIONS: { + bucketName: string; + chunkSizeBytes: number; +} = { + bucketName: 'fs', + chunkSizeBytes: 255 * 1024 +}; + +/** @public */ +export interface GridFSBucketOptions extends WriteConcernOptions { + /** The 'files' and 'chunks' collections will be prefixed with the bucket name followed by a dot. */ + bucketName?: string; + /** Number of bytes stored in each chunk. Defaults to 255KB */ + chunkSizeBytes?: number; + /** Read preference to be passed to read operations */ + readPreference?: ReadPreference; +} + +/** @internal */ +export interface GridFSBucketPrivate { + db: Db; + options: { + bucketName: string; + chunkSizeBytes: number; + readPreference?: ReadPreference; + writeConcern: WriteConcern | undefined; + }; + _chunksCollection: Collection; + _filesCollection: Collection; + checkedIndexes: boolean; + calledOpenUploadStream: boolean; +} + +/** @public */ +export type GridFSBucketEvents = { + index(): void; +}; + +/** + * Constructor for a streaming GridFS interface + * @public + */ +export class GridFSBucket extends TypedEventEmitter { + /** @internal */ + s: GridFSBucketPrivate; + + /** + * When the first call to openUploadStream is made, the upload stream will + * check to see if it needs to create the proper indexes on the chunks and + * files collections. This event is fired either when 1) it determines that + * no index creation is necessary, 2) when it successfully creates the + * necessary indexes. + * @event + */ + static readonly INDEX = 'index' as const; + + constructor(db: Db, options?: GridFSBucketOptions) { + super(); + this.setMaxListeners(0); + const privateOptions = { + ...DEFAULT_GRIDFS_BUCKET_OPTIONS, + ...options, + writeConcern: WriteConcern.fromOptions(options) + }; + this.s = { + db, + options: privateOptions, + _chunksCollection: db.collection(privateOptions.bucketName + '.chunks'), + _filesCollection: db.collection(privateOptions.bucketName + '.files'), + checkedIndexes: false, + calledOpenUploadStream: false + }; + } + + /** + * Returns a writable stream (GridFSBucketWriteStream) for writing + * buffers to GridFS. The stream's 'id' property contains the resulting + * file's id. + * + * @param filename - The value of the 'filename' key in the files doc + * @param options - Optional settings. + */ + + openUploadStream( + filename: string, + options?: GridFSBucketWriteStreamOptions + ): GridFSBucketWriteStream { + return new GridFSBucketWriteStream(this, filename, options); + } + + /** + * Returns a writable stream (GridFSBucketWriteStream) for writing + * buffers to GridFS for a custom file id. The stream's 'id' property contains the resulting + * file's id. + */ + openUploadStreamWithId( + id: ObjectId, + filename: string, + options?: GridFSBucketWriteStreamOptions + ): GridFSBucketWriteStream { + return new GridFSBucketWriteStream(this, filename, { ...options, id }); + } + + /** Returns a readable stream (GridFSBucketReadStream) for streaming file data from GridFS. */ + openDownloadStream( + id: ObjectId, + options?: GridFSBucketReadStreamOptions + ): GridFSBucketReadStream { + return new GridFSBucketReadStream( + this.s._chunksCollection, + this.s._filesCollection, + this.s.options.readPreference, + { _id: id }, + options + ); + } + + /** + * Deletes a file with the given id + * + * @param id - The id of the file doc + */ + delete(id: ObjectId): Promise; + delete(id: ObjectId, callback: Callback): void; + delete(id: ObjectId, callback?: Callback): Promise | void { + return maybePromise(callback, callback => { + return this.s._filesCollection.deleteOne({ _id: id }, (error, res) => { + if (error) { + return callback(error); + } + + return this.s._chunksCollection.deleteMany({ files_id: id }, error => { + if (error) { + return callback(error); + } + + // Delete orphaned chunks before returning FileNotFound + if (!res?.deletedCount) { + // TODO(NODE-3483): Replace with more appropriate error + // Consider creating new error MongoGridFSFileNotFoundError + return callback(new MongoRuntimeError(`File not found for id ${id}`)); + } + + return callback(); + }); + }); + }); + } + + /** Convenience wrapper around find on the files collection */ + find(filter?: Filter, options?: FindOptions): FindCursor { + filter ??= {}; + options = options ?? {}; + return this.s._filesCollection.find(filter, options); + } + + /** + * Returns a readable stream (GridFSBucketReadStream) for streaming the + * file with the given name from GridFS. If there are multiple files with + * the same name, this will stream the most recent file with the given name + * (as determined by the `uploadDate` field). You can set the `revision` + * option to change this behavior. + */ + openDownloadStreamByName( + filename: string, + options?: GridFSBucketReadStreamOptionsWithRevision + ): GridFSBucketReadStream { + let sort: Sort = { uploadDate: -1 }; + let skip = undefined; + if (options && options.revision != null) { + if (options.revision >= 0) { + sort = { uploadDate: 1 }; + skip = options.revision; + } else { + skip = -options.revision - 1; + } + } + return new GridFSBucketReadStream( + this.s._chunksCollection, + this.s._filesCollection, + this.s.options.readPreference, + { filename }, + { ...options, sort, skip } + ); + } + + /** + * Renames the file with the given _id to the given string + * + * @param id - the id of the file to rename + * @param filename - new name for the file + */ + rename(id: ObjectId, filename: string): Promise; + rename(id: ObjectId, filename: string, callback: Callback): void; + rename(id: ObjectId, filename: string, callback?: Callback): Promise | void { + return maybePromise(callback, callback => { + const filter = { _id: id }; + const update = { $set: { filename } }; + return this.s._filesCollection.updateOne(filter, update, (error?, res?) => { + if (error) { + return callback(error); + } + + if (!res?.matchedCount) { + return callback(new MongoRuntimeError(`File with id ${id} not found`)); + } + + return callback(); + }); + }); + } + + /** Removes this bucket's files collection, followed by its chunks collection. */ + drop(): Promise; + drop(callback: Callback): void; + drop(callback?: Callback): Promise | void { + return maybePromise(callback, callback => { + return this.s._filesCollection.drop(error => { + if (error) { + return callback(error); + } + return this.s._chunksCollection.drop(error => { + if (error) { + return callback(error); + } + + return callback(); + }); + }); + }); + } + + /** Get the Db scoped logger. */ + getLogger(): Logger { + return this.s.db.s.logger; + } +} diff --git a/node_modules/mongodb/src/gridfs/upload.ts b/node_modules/mongodb/src/gridfs/upload.ts new file mode 100644 index 000000000..ae0d67899 --- /dev/null +++ b/node_modules/mongodb/src/gridfs/upload.ts @@ -0,0 +1,566 @@ +import { Writable } from 'stream'; + +import type { Document } from '../bson'; +import { ObjectId } from '../bson'; +import type { Collection } from '../collection'; +import { AnyError, MongoAPIError, MONGODB_ERROR_CODES, MongoError } from '../error'; +import { Callback, maybePromise } from '../utils'; +import type { WriteConcernOptions } from '../write_concern'; +import { WriteConcern } from './../write_concern'; +import type { GridFSFile } from './download'; +import type { GridFSBucket } from './index'; + +/** @public */ +export interface GridFSChunk { + _id: ObjectId; + files_id: ObjectId; + n: number; + data: Buffer | Uint8Array; +} + +/** @public */ +export interface GridFSBucketWriteStreamOptions extends WriteConcernOptions { + /** Overwrite this bucket's chunkSizeBytes for this file */ + chunkSizeBytes?: number; + /** Custom file id for the GridFS file. */ + id?: ObjectId; + /** Object to store in the file document's `metadata` field */ + metadata?: Document; + /** String to store in the file document's `contentType` field */ + contentType?: string; + /** Array of strings to store in the file document's `aliases` field */ + aliases?: string[]; +} + +/** + * A writable stream that enables you to write buffers to GridFS. + * + * Do not instantiate this class directly. Use `openUploadStream()` instead. + * @public + */ +export class GridFSBucketWriteStream extends Writable implements NodeJS.WritableStream { + bucket: GridFSBucket; + chunks: Collection; + filename: string; + files: Collection; + options: GridFSBucketWriteStreamOptions; + done: boolean; + id: ObjectId; + chunkSizeBytes: number; + bufToStore: Buffer; + length: number; + n: number; + pos: number; + state: { + streamEnd: boolean; + outstandingRequests: number; + errored: boolean; + aborted: boolean; + }; + writeConcern?: WriteConcern; + + /** @event */ + static readonly CLOSE = 'close'; + /** @event */ + static readonly ERROR = 'error'; + /** + * `end()` was called and the write stream successfully wrote the file metadata and all the chunks to MongoDB. + * @event + */ + static readonly FINISH = 'finish'; + + /** @internal + * @param bucket - Handle for this stream's corresponding bucket + * @param filename - The value of the 'filename' key in the files doc + * @param options - Optional settings. + */ + constructor(bucket: GridFSBucket, filename: string, options?: GridFSBucketWriteStreamOptions) { + super(); + + options = options ?? {}; + this.bucket = bucket; + this.chunks = bucket.s._chunksCollection; + this.filename = filename; + this.files = bucket.s._filesCollection; + this.options = options; + this.writeConcern = WriteConcern.fromOptions(options) || bucket.s.options.writeConcern; + // Signals the write is all done + this.done = false; + + this.id = options.id ? options.id : new ObjectId(); + // properly inherit the default chunksize from parent + this.chunkSizeBytes = options.chunkSizeBytes || this.bucket.s.options.chunkSizeBytes; + this.bufToStore = Buffer.alloc(this.chunkSizeBytes); + this.length = 0; + this.n = 0; + this.pos = 0; + this.state = { + streamEnd: false, + outstandingRequests: 0, + errored: false, + aborted: false + }; + + if (!this.bucket.s.calledOpenUploadStream) { + this.bucket.s.calledOpenUploadStream = true; + + checkIndexes(this, () => { + this.bucket.s.checkedIndexes = true; + this.bucket.emit('index'); + }); + } + } + + /** + * Write a buffer to the stream. + * + * @param chunk - Buffer to write + * @param encodingOrCallback - Optional encoding for the buffer + * @param callback - Function to call when the chunk was added to the buffer, or if the entire chunk was persisted to MongoDB if this chunk caused a flush. + * @returns False if this write required flushing a chunk to MongoDB. True otherwise. + */ + override write(chunk: Buffer | string): boolean; + override write(chunk: Buffer | string, callback: Callback): boolean; + override write(chunk: Buffer | string, encoding: BufferEncoding | undefined): boolean; + override write( + chunk: Buffer | string, + encoding: BufferEncoding | undefined, + callback: Callback + ): boolean; + override write( + chunk: Buffer | string, + encodingOrCallback?: Callback | BufferEncoding, + callback?: Callback + ): boolean { + const encoding = typeof encodingOrCallback === 'function' ? undefined : encodingOrCallback; + callback = typeof encodingOrCallback === 'function' ? encodingOrCallback : callback; + return waitForIndexes(this, () => doWrite(this, chunk, encoding, callback)); + } + + // TODO(NODE-3405): Refactor this with maybePromise and MongoStreamClosedError + /** + * Places this write stream into an aborted state (all future writes fail) + * and deletes all chunks that have already been written. + * + * @param callback - called when chunks are successfully removed or error occurred + */ + abort(): Promise; + abort(callback: Callback): void; + abort(callback?: Callback): Promise | void { + return maybePromise(callback, callback => { + if (this.state.streamEnd) { + // TODO(NODE-3485): Replace with MongoGridFSStreamClosed + return callback(new MongoAPIError('Cannot abort a stream that has already completed')); + } + + if (this.state.aborted) { + // TODO(NODE-3485): Replace with MongoGridFSStreamClosed + return callback(new MongoAPIError('Cannot call abort() on a stream twice')); + } + + this.state.aborted = true; + this.chunks.deleteMany({ files_id: this.id }, error => callback(error)); + }); + } + + /** + * Tells the stream that no more data will be coming in. The stream will + * persist the remaining data to MongoDB, write the files document, and + * then emit a 'finish' event. + * + * @param chunk - Buffer to write + * @param encoding - Optional encoding for the buffer + * @param callback - Function to call when all files and chunks have been persisted to MongoDB + */ + override end(): this; + override end(chunk: Buffer): this; + override end(callback: Callback): this; + override end(chunk: Buffer, callback: Callback): this; + override end(chunk: Buffer, encoding: BufferEncoding): this; + override end( + chunk: Buffer, + encoding: BufferEncoding | undefined, + callback: Callback + ): this; + override end( + chunkOrCallback?: Buffer | Callback, + encodingOrCallback?: BufferEncoding | Callback, + callback?: Callback + ): this { + const chunk = typeof chunkOrCallback === 'function' ? undefined : chunkOrCallback; + const encoding = typeof encodingOrCallback === 'function' ? undefined : encodingOrCallback; + callback = + typeof chunkOrCallback === 'function' + ? chunkOrCallback + : typeof encodingOrCallback === 'function' + ? encodingOrCallback + : callback; + + if (this.state.streamEnd || checkAborted(this, callback)) return this; + + this.state.streamEnd = true; + + if (callback) { + this.once(GridFSBucketWriteStream.FINISH, (result: GridFSFile) => { + if (callback) callback(undefined, result); + }); + } + + if (!chunk) { + waitForIndexes(this, () => !!writeRemnant(this)); + return this; + } + + this.write(chunk, encoding, () => { + writeRemnant(this); + }); + + return this; + } +} + +function __handleError( + stream: GridFSBucketWriteStream, + error: AnyError, + callback?: Callback +): void { + if (stream.state.errored) { + return; + } + stream.state.errored = true; + if (callback) { + return callback(error); + } + stream.emit(GridFSBucketWriteStream.ERROR, error); +} + +function createChunkDoc(filesId: ObjectId, n: number, data: Buffer): GridFSChunk { + return { + _id: new ObjectId(), + files_id: filesId, + n, + data + }; +} + +function checkChunksIndex(stream: GridFSBucketWriteStream, callback: Callback): void { + stream.chunks.listIndexes().toArray((error?: AnyError, indexes?: Document[]) => { + let index: { files_id: number; n: number }; + if (error) { + // Collection doesn't exist so create index + if (error instanceof MongoError && error.code === MONGODB_ERROR_CODES.NamespaceNotFound) { + index = { files_id: 1, n: 1 }; + stream.chunks.createIndex(index, { background: false, unique: true }, error => { + if (error) { + return callback(error); + } + + callback(); + }); + return; + } + return callback(error); + } + + let hasChunksIndex = false; + if (indexes) { + indexes.forEach((index: Document) => { + if (index.key) { + const keys = Object.keys(index.key); + if (keys.length === 2 && index.key.files_id === 1 && index.key.n === 1) { + hasChunksIndex = true; + } + } + }); + } + + if (hasChunksIndex) { + callback(); + } else { + index = { files_id: 1, n: 1 }; + const writeConcernOptions = getWriteOptions(stream); + + stream.chunks.createIndex( + index, + { + ...writeConcernOptions, + background: true, + unique: true + }, + callback + ); + } + }); +} + +function checkDone(stream: GridFSBucketWriteStream, callback?: Callback): boolean { + if (stream.done) return true; + if (stream.state.streamEnd && stream.state.outstandingRequests === 0 && !stream.state.errored) { + // Set done so we do not trigger duplicate createFilesDoc + stream.done = true; + // Create a new files doc + const filesDoc = createFilesDoc( + stream.id, + stream.length, + stream.chunkSizeBytes, + stream.filename, + stream.options.contentType, + stream.options.aliases, + stream.options.metadata + ); + + if (checkAborted(stream, callback)) { + return false; + } + + stream.files.insertOne(filesDoc, getWriteOptions(stream), (error?: AnyError) => { + if (error) { + return __handleError(stream, error, callback); + } + stream.emit(GridFSBucketWriteStream.FINISH, filesDoc); + stream.emit(GridFSBucketWriteStream.CLOSE); + }); + + return true; + } + + return false; +} + +function checkIndexes(stream: GridFSBucketWriteStream, callback: Callback): void { + stream.files.findOne({}, { projection: { _id: 1 } }, (error, doc) => { + if (error) { + return callback(error); + } + if (doc) { + return callback(); + } + + stream.files.listIndexes().toArray((error?: AnyError, indexes?: Document) => { + let index: { filename: number; uploadDate: number }; + if (error) { + // Collection doesn't exist so create index + if (error instanceof MongoError && error.code === MONGODB_ERROR_CODES.NamespaceNotFound) { + index = { filename: 1, uploadDate: 1 }; + stream.files.createIndex(index, { background: false }, (error?: AnyError) => { + if (error) { + return callback(error); + } + + checkChunksIndex(stream, callback); + }); + return; + } + return callback(error); + } + + let hasFileIndex = false; + if (indexes) { + indexes.forEach((index: Document) => { + const keys = Object.keys(index.key); + if (keys.length === 2 && index.key.filename === 1 && index.key.uploadDate === 1) { + hasFileIndex = true; + } + }); + } + + if (hasFileIndex) { + checkChunksIndex(stream, callback); + } else { + index = { filename: 1, uploadDate: 1 }; + + const writeConcernOptions = getWriteOptions(stream); + + stream.files.createIndex( + index, + { + ...writeConcernOptions, + background: false + }, + (error?: AnyError) => { + if (error) { + return callback(error); + } + + checkChunksIndex(stream, callback); + } + ); + } + }); + }); +} + +function createFilesDoc( + _id: ObjectId, + length: number, + chunkSize: number, + filename: string, + contentType?: string, + aliases?: string[], + metadata?: Document +): GridFSFile { + const ret: GridFSFile = { + _id, + length, + chunkSize, + uploadDate: new Date(), + filename + }; + + if (contentType) { + ret.contentType = contentType; + } + + if (aliases) { + ret.aliases = aliases; + } + + if (metadata) { + ret.metadata = metadata; + } + + return ret; +} + +function doWrite( + stream: GridFSBucketWriteStream, + chunk: Buffer | string, + encoding?: BufferEncoding, + callback?: Callback +): boolean { + if (checkAborted(stream, callback)) { + return false; + } + + const inputBuf = Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk, encoding); + + stream.length += inputBuf.length; + + // Input is small enough to fit in our buffer + if (stream.pos + inputBuf.length < stream.chunkSizeBytes) { + inputBuf.copy(stream.bufToStore, stream.pos); + stream.pos += inputBuf.length; + + callback && callback(); + + // Note that we reverse the typical semantics of write's return value + // to be compatible with node's `.pipe()` function. + // True means client can keep writing. + return true; + } + + // Otherwise, buffer is too big for current chunk, so we need to flush + // to MongoDB. + let inputBufRemaining = inputBuf.length; + let spaceRemaining: number = stream.chunkSizeBytes - stream.pos; + let numToCopy = Math.min(spaceRemaining, inputBuf.length); + let outstandingRequests = 0; + while (inputBufRemaining > 0) { + const inputBufPos = inputBuf.length - inputBufRemaining; + inputBuf.copy(stream.bufToStore, stream.pos, inputBufPos, inputBufPos + numToCopy); + stream.pos += numToCopy; + spaceRemaining -= numToCopy; + let doc: GridFSChunk; + if (spaceRemaining === 0) { + doc = createChunkDoc(stream.id, stream.n, Buffer.from(stream.bufToStore)); + ++stream.state.outstandingRequests; + ++outstandingRequests; + + if (checkAborted(stream, callback)) { + return false; + } + + stream.chunks.insertOne(doc, getWriteOptions(stream), (error?: AnyError) => { + if (error) { + return __handleError(stream, error); + } + --stream.state.outstandingRequests; + --outstandingRequests; + + if (!outstandingRequests) { + stream.emit('drain', doc); + callback && callback(); + checkDone(stream); + } + }); + + spaceRemaining = stream.chunkSizeBytes; + stream.pos = 0; + ++stream.n; + } + inputBufRemaining -= numToCopy; + numToCopy = Math.min(spaceRemaining, inputBufRemaining); + } + + // Note that we reverse the typical semantics of write's return value + // to be compatible with node's `.pipe()` function. + // False means the client should wait for the 'drain' event. + return false; +} + +function getWriteOptions(stream: GridFSBucketWriteStream): WriteConcernOptions { + const obj: WriteConcernOptions = {}; + if (stream.writeConcern) { + obj.writeConcern = { + w: stream.writeConcern.w, + wtimeout: stream.writeConcern.wtimeout, + j: stream.writeConcern.j + }; + } + return obj; +} + +function waitForIndexes( + stream: GridFSBucketWriteStream, + callback: (res: boolean) => boolean +): boolean { + if (stream.bucket.s.checkedIndexes) { + return callback(false); + } + + stream.bucket.once('index', () => { + callback(true); + }); + + return true; +} + +function writeRemnant(stream: GridFSBucketWriteStream, callback?: Callback): boolean { + // Buffer is empty, so don't bother to insert + if (stream.pos === 0) { + return checkDone(stream, callback); + } + + ++stream.state.outstandingRequests; + + // Create a new buffer to make sure the buffer isn't bigger than it needs + // to be. + const remnant = Buffer.alloc(stream.pos); + stream.bufToStore.copy(remnant, 0, 0, stream.pos); + const doc = createChunkDoc(stream.id, stream.n, remnant); + + // If the stream was aborted, do not write remnant + if (checkAborted(stream, callback)) { + return false; + } + + stream.chunks.insertOne(doc, getWriteOptions(stream), (error?: AnyError) => { + if (error) { + return __handleError(stream, error); + } + --stream.state.outstandingRequests; + checkDone(stream); + }); + return true; +} + +function checkAborted(stream: GridFSBucketWriteStream, callback?: Callback): boolean { + if (stream.state.aborted) { + if (typeof callback === 'function') { + // TODO(NODE-3485): Replace with MongoGridFSStreamClosedError + callback(new MongoAPIError('Stream has been aborted')); + } + return true; + } + return false; +} diff --git a/node_modules/mongodb/src/index.ts b/node_modules/mongodb/src/index.ts new file mode 100644 index 000000000..410af2ee8 --- /dev/null +++ b/node_modules/mongodb/src/index.ts @@ -0,0 +1,472 @@ +import { Admin } from './admin'; +import { ObjectId } from './bson'; +import { Collection } from './collection'; +import { AbstractCursor } from './cursor/abstract_cursor'; +import { AggregationCursor } from './cursor/aggregation_cursor'; +import { FindCursor } from './cursor/find_cursor'; +import { Db } from './db'; +import { GridFSBucket } from './gridfs'; +import { Logger } from './logger'; +import { MongoClient } from './mongo_client'; +import { CancellationToken } from './mongo_types'; +import { ListIndexesCursor } from './operations/indexes'; +import { ListCollectionsCursor } from './operations/list_collections'; +import { PromiseProvider } from './promise_provider'; + +export { + Binary, + BSONRegExp, + BSONSymbol, + Code, + DBRef, + Decimal128, + Double, + Int32, + Long, + Map, + MaxKey, + MinKey, + ObjectId, + Timestamp +} from './bson'; +/** + * @public + * @deprecated Please use `ObjectId` + */ +export const ObjectID = ObjectId; + +export { AnyBulkWriteOperation, BulkWriteOptions, MongoBulkWriteError } from './bulk/common'; +export { + MongoAPIError, + MongoAWSError, + MongoBatchReExecutionError, + MongoChangeStreamError, + MongoCompatibilityError, + MongoCursorExhaustedError, + MongoCursorInUseError, + MongoDecompressionError, + MongoDriverError, + MongoError, + MongoExpiredSessionError, + MongoGridFSChunkError, + MongoGridFSStreamError, + MongoInvalidArgumentError, + MongoKerberosError, + MongoMissingCredentialsError, + MongoMissingDependencyError, + MongoNetworkError, + MongoNetworkTimeoutError, + MongoNotConnectedError, + MongoParseError, + MongoRuntimeError, + MongoServerClosedError, + MongoServerError, + MongoServerSelectionError, + MongoSystemError, + MongoTailableCursorError, + MongoTopologyClosedError, + MongoTransactionError, + MongoUnexpectedServerResponseError, + MongoWriteConcernError +} from './error'; +export { + AbstractCursor, + // Actual driver classes exported + Admin, + AggregationCursor, + CancellationToken, + Collection, + Db, + FindCursor, + GridFSBucket, + ListCollectionsCursor, + ListIndexesCursor, + Logger, + MongoClient, + // Utils + PromiseProvider as Promise +}; + +// enums +export { BatchType } from './bulk/common'; +export { GSSAPICanonicalizationValue } from './cmap/auth/gssapi'; +export { AuthMechanism } from './cmap/auth/providers'; +export { Compressor } from './cmap/wire_protocol/compression'; +export { CURSOR_FLAGS } from './cursor/abstract_cursor'; +export { AutoEncryptionLoggerLevel } from './deps'; +export { MongoErrorLabel } from './error'; +export { ExplainVerbosity } from './explain'; +export { LoggerLevel } from './logger'; +export { ServerApiVersion } from './mongo_client'; +export { BSONType } from './mongo_types'; +export { ReturnDocument } from './operations/find_and_modify'; +export { ProfilingLevel } from './operations/set_profiling_level'; +export { ReadConcernLevel } from './read_concern'; +export { ReadPreferenceMode } from './read_preference'; +export { ServerType, TopologyType } from './sdam/common'; + +// Helper classes +export { ReadConcern } from './read_concern'; +export { ReadPreference } from './read_preference'; +export { WriteConcern } from './write_concern'; + +// events +export { + CommandFailedEvent, + CommandStartedEvent, + CommandSucceededEvent +} from './cmap/command_monitoring_events'; +export { + ConnectionCheckedInEvent, + ConnectionCheckedOutEvent, + ConnectionCheckOutFailedEvent, + ConnectionCheckOutStartedEvent, + ConnectionClosedEvent, + ConnectionCreatedEvent, + ConnectionPoolClearedEvent, + ConnectionPoolClosedEvent, + ConnectionPoolCreatedEvent, + ConnectionPoolMonitoringEvent, + ConnectionReadyEvent +} from './cmap/connection_pool_events'; +export { + ServerClosedEvent, + ServerDescriptionChangedEvent, + ServerHeartbeatFailedEvent, + ServerHeartbeatStartedEvent, + ServerHeartbeatSucceededEvent, + ServerOpeningEvent, + TopologyClosedEvent, + TopologyDescriptionChangedEvent, + TopologyOpeningEvent +} from './sdam/events'; +export { SrvPollingEvent } from './sdam/srv_polling'; + +// type only exports below, these are removed from emitted JS +export type { AdminPrivate } from './admin'; +export type { BSONSerializeOptions, Document } from './bson'; +export type { deserialize, serialize } from './bson'; +export type { + BulkResult, + BulkWriteOperationError, + BulkWriteResult, + DeleteManyModel, + DeleteOneModel, + InsertOneModel, + ReplaceOneModel, + UpdateManyModel, + UpdateOneModel, + WriteConcernError, + WriteError +} from './bulk/common'; +export type { + Batch, + BulkOperationBase, + BulkOperationPrivate, + FindOperators, + WriteConcernErrorData +} from './bulk/common'; +export type { OrderedBulkOperation } from './bulk/ordered'; +export type { UnorderedBulkOperation } from './bulk/unordered'; +export type { + ChangeStream, + ChangeStreamAggregateRawResult, + ChangeStreamCollModDocument, + ChangeStreamCreateDocument, + ChangeStreamCreateIndexDocument, + ChangeStreamCursor, + ChangeStreamCursorOptions, + ChangeStreamDeleteDocument, + ChangeStreamDocument, + ChangeStreamDocumentCollectionUUID, + ChangeStreamDocumentCommon, + ChangeStreamDocumentKey, + ChangeStreamDocumentOperationDescription, + ChangeStreamDropDatabaseDocument, + ChangeStreamDropDocument, + ChangeStreamDropIndexDocument, + ChangeStreamEvents, + ChangeStreamInsertDocument, + ChangeStreamInvalidateDocument, + ChangeStreamNameSpace, + ChangeStreamOptions, + ChangeStreamRefineCollectionShardKeyDocument, + ChangeStreamRenameDocument, + ChangeStreamReplaceDocument, + ChangeStreamReshardCollectionDocument, + ChangeStreamShardCollectionDocument, + ChangeStreamUpdateDocument, + OperationTime, + PipeOptions, + ResumeOptions, + ResumeToken, + UpdateDescription +} from './change_stream'; +export type { + AuthMechanismProperties, + MongoCredentials, + MongoCredentialsOptions +} from './cmap/auth/mongo_credentials'; +export type { + BinMsg, + GetMore, + KillCursor, + MessageHeader, + Msg, + OpGetMoreOptions, + OpMsgOptions, + OpQueryOptions, + OpResponseOptions, + Query, + Response, + WriteProtocolMessageType +} from './cmap/commands'; +export type { LEGAL_TCP_SOCKET_OPTIONS, LEGAL_TLS_SOCKET_OPTIONS, Stream } from './cmap/connect'; +export type { + CommandOptions, + Connection, + ConnectionEvents, + ConnectionOptions, + DestroyOptions, + GetMoreOptions, + ProxyOptions, + QueryOptions +} from './cmap/connection'; +export type { + CloseOptions, + ConnectionPool, + ConnectionPoolEvents, + ConnectionPoolOptions, + WaitQueueMember, + WithConnectionCallback +} from './cmap/connection_pool'; +export type { + MessageStream, + MessageStreamOptions, + OperationDescription +} from './cmap/message_stream'; +export type { ConnectionPoolMetrics } from './cmap/metrics'; +export type { StreamDescription, StreamDescriptionOptions } from './cmap/stream_description'; +export type { CompressorName } from './cmap/wire_protocol/compression'; +export type { CollectionOptions, CollectionPrivate, ModifyResult } from './collection'; +export type { MONGO_CLIENT_EVENTS } from './constants'; +export type { + AbstractCursorEvents, + AbstractCursorOptions, + CursorCloseOptions, + CursorFlag, + CursorStreamOptions +} from './cursor/abstract_cursor'; +export type { InternalAbstractCursorOptions } from './cursor/abstract_cursor'; +export type { AggregationCursorOptions } from './cursor/aggregation_cursor'; +export type { DbOptions, DbPrivate } from './db'; +export type { AutoEncrypter, AutoEncryptionOptions, AutoEncryptionTlsOptions } from './deps'; +export type { Encrypter, EncrypterOptions } from './encrypter'; +export type { AnyError, ErrorDescription, MongoNetworkErrorOptions } from './error'; +export type { Explain, ExplainOptions, ExplainVerbosityLike } from './explain'; +export type { + GridFSBucketReadStream, + GridFSBucketReadStreamOptions, + GridFSBucketReadStreamOptionsWithRevision, + GridFSBucketReadStreamPrivate, + GridFSFile +} from './gridfs/download'; +export type { GridFSBucketEvents, GridFSBucketOptions, GridFSBucketPrivate } from './gridfs/index'; +export type { + GridFSBucketWriteStream, + GridFSBucketWriteStreamOptions, + GridFSChunk +} from './gridfs/upload'; +export type { LoggerFunction, LoggerOptions } from './logger'; +export type { + Auth, + DriverInfo, + MongoClientEvents, + MongoClientOptions, + MongoClientPrivate, + MongoOptions, + PkFactory, + ServerApi, + SupportedNodeConnectionOptions, + SupportedSocketOptions, + SupportedTLSConnectionOptions, + SupportedTLSSocketOptions, + WithSessionCallback +} from './mongo_client'; +export type { + CommonEvents, + EventsDescription, + GenericListener, + TypedEventEmitter +} from './mongo_types'; +export type { + AcceptedFields, + AddToSetOperators, + AlternativeType, + ArrayOperator, + BitwiseFilter, + BSONTypeAlias, + Condition, + EnhancedOmit, + Filter, + FilterOperations, + FilterOperators, + Flatten, + InferIdType, + IntegerType, + IsAny, + Join, + KeysOfAType, + KeysOfOtherType, + MatchKeysAndValues, + NestedPaths, + NonObjectIdLikeDocument, + NotAcceptedFields, + NumericType, + OneOrMore, + OnlyFieldsOfType, + OptionalId, + OptionalUnlessRequiredId, + Projection, + ProjectionOperators, + PropertyType, + PullAllOperator, + PullOperator, + PushOperator, + RegExpOrString, + RootFilterOperators, + SchemaMember, + SetFields, + UpdateFilter, + WithId, + WithoutId +} from './mongo_types'; +export type { AddUserOptions, RoleSpecification } from './operations/add_user'; +export type { + AggregateOperation, + AggregateOptions, + DB_AGGREGATE_COLLECTION +} from './operations/aggregate'; +export type { + CollationOptions, + CommandOperation, + CommandOperationOptions, + OperationParent +} from './operations/command'; +export type { IndexInformationOptions } from './operations/common_functions'; +export type { CountOptions } from './operations/count'; +export type { CountDocumentsOptions } from './operations/count_documents'; +export type { + ClusteredCollectionOptions, + CreateCollectionOptions, + TimeSeriesCollectionOptions +} from './operations/create_collection'; +export type { DeleteOptions, DeleteResult, DeleteStatement } from './operations/delete'; +export type { DistinctOptions } from './operations/distinct'; +export type { DropCollectionOptions, DropDatabaseOptions } from './operations/drop'; +export type { EstimatedDocumentCountOptions } from './operations/estimated_document_count'; +export type { EvalOptions } from './operations/eval'; +export type { ExecutionResult } from './operations/execute_operation'; +export type { FindOptions } from './operations/find'; +export type { + FindOneAndDeleteOptions, + FindOneAndReplaceOptions, + FindOneAndUpdateOptions +} from './operations/find_and_modify'; +export type { + CreateIndexesOptions, + DropIndexesOptions, + IndexDescription, + IndexDirection, + IndexSpecification, + ListIndexesOptions +} from './operations/indexes'; +export type { InsertManyResult, InsertOneOptions, InsertOneResult } from './operations/insert'; +export type { CollectionInfo, ListCollectionsOptions } from './operations/list_collections'; +export type { ListDatabasesOptions, ListDatabasesResult } from './operations/list_databases'; +export type { + FinalizeFunction, + MapFunction, + MapReduceOptions, + ReduceFunction +} from './operations/map_reduce'; +export type { AbstractOperation, Hint, OperationOptions } from './operations/operation'; +export type { ProfilingLevelOptions } from './operations/profiling_level'; +export type { RemoveUserOptions } from './operations/remove_user'; +export type { RenameOptions } from './operations/rename'; +export type { RunCommandOptions } from './operations/run_command'; +export type { SetProfilingLevelOptions } from './operations/set_profiling_level'; +export type { + CollStats, + CollStatsOptions, + DbStatsOptions, + WiredTigerData +} from './operations/stats'; +export type { + ReplaceOptions, + UpdateOptions, + UpdateResult, + UpdateStatement +} from './operations/update'; +export type { ValidateCollectionOptions } from './operations/validate_collection'; +export type { ReadConcernLike } from './read_concern'; +export type { + HedgeOptions, + ReadPreferenceFromOptions, + ReadPreferenceLike, + ReadPreferenceLikeOptions, + ReadPreferenceOptions +} from './read_preference'; +export type { ClusterTime, TimerQueue } from './sdam/common'; +export type { + Monitor, + MonitorEvents, + MonitorOptions, + MonitorPrivate, + RTTPinger, + RTTPingerOptions +} from './sdam/monitor'; +export type { Server, ServerEvents, ServerOptions, ServerPrivate } from './sdam/server'; +export type { + ServerDescription, + ServerDescriptionOptions, + TagSet, + TopologyVersion +} from './sdam/server_description'; +export type { ServerSelector } from './sdam/server_selection'; +export type { SrvPoller, SrvPollerEvents, SrvPollerOptions } from './sdam/srv_polling'; +export type { + ConnectOptions, + SelectServerOptions, + ServerCapabilities, + ServerSelectionCallback, + ServerSelectionRequest, + Topology, + TopologyEvents, + TopologyOptions, + TopologyPrivate +} from './sdam/topology'; +export type { TopologyDescription, TopologyDescriptionOptions } from './sdam/topology_description'; +export type { + ClientSession, + ClientSessionEvents, + ClientSessionOptions, + EndSessionOptions, + ServerSession, + ServerSessionId, + ServerSessionPool, + WithTransactionCallback +} from './sessions'; +export type { Sort, SortDirection, SortDirectionForCmd, SortForCmd } from './sort'; +export type { Transaction, TransactionOptions, TxnState } from './transactions'; +export type { + BufferPool, + Callback, + ClientMetadata, + ClientMetadataOptions, + EventEmitterWithState, + HostAddress, + InterruptibleAsyncInterval, + MongoDBNamespace +} from './utils'; +export type { W, WriteConcernOptions, WriteConcernSettings } from './write_concern'; diff --git a/node_modules/mongodb/src/logger.ts b/node_modules/mongodb/src/logger.ts new file mode 100644 index 000000000..22609c868 --- /dev/null +++ b/node_modules/mongodb/src/logger.ts @@ -0,0 +1,265 @@ +import { format } from 'util'; + +import { MongoInvalidArgumentError } from './error'; +import { enumToString } from './utils'; + +// Filters for classes +const classFilters: any = {}; +let filteredClasses: any = {}; +let level: LoggerLevel; + +// Save the process id +const pid = process.pid; + +// current logger +// eslint-disable-next-line no-console +let currentLogger: LoggerFunction = console.warn; + +/** @public */ +export const LoggerLevel = Object.freeze({ + ERROR: 'error', + WARN: 'warn', + INFO: 'info', + DEBUG: 'debug', + error: 'error', + warn: 'warn', + info: 'info', + debug: 'debug' +} as const); + +/** @public */ +export type LoggerLevel = typeof LoggerLevel[keyof typeof LoggerLevel]; + +/** @public */ +export type LoggerFunction = (message?: any, ...optionalParams: any[]) => void; + +/** @public */ +export interface LoggerOptions { + logger?: LoggerFunction; + loggerLevel?: LoggerLevel; +} + +/** + * @public + */ +export class Logger { + className: string; + + /** + * Creates a new Logger instance + * + * @param className - The Class name associated with the logging instance + * @param options - Optional logging settings + */ + constructor(className: string, options?: LoggerOptions) { + options = options ?? {}; + + // Current reference + this.className = className; + + // Current logger + if (!(options.logger instanceof Logger) && typeof options.logger === 'function') { + currentLogger = options.logger; + } + + // Set level of logging, default is error + if (options.loggerLevel) { + level = options.loggerLevel || LoggerLevel.ERROR; + } + + // Add all class names + if (filteredClasses[this.className] == null) { + classFilters[this.className] = true; + } + } + + /** + * Log a message at the debug level + * + * @param message - The message to log + * @param object - Additional meta data to log + */ + debug(message: string, object?: unknown): void { + if ( + this.isDebug() && + ((Object.keys(filteredClasses).length > 0 && filteredClasses[this.className]) || + (Object.keys(filteredClasses).length === 0 && classFilters[this.className])) + ) { + const dateTime = new Date().getTime(); + const msg = format('[%s-%s:%s] %s %s', 'DEBUG', this.className, pid, dateTime, message); + const state = { + type: LoggerLevel.DEBUG, + message, + className: this.className, + pid, + date: dateTime + } as any; + + if (object) state.meta = object; + currentLogger(msg, state); + } + } + + /** + * Log a message at the warn level + * + * @param message - The message to log + * @param object - Additional meta data to log + */ + warn(message: string, object?: unknown): void { + if ( + this.isWarn() && + ((Object.keys(filteredClasses).length > 0 && filteredClasses[this.className]) || + (Object.keys(filteredClasses).length === 0 && classFilters[this.className])) + ) { + const dateTime = new Date().getTime(); + const msg = format('[%s-%s:%s] %s %s', 'WARN', this.className, pid, dateTime, message); + const state = { + type: LoggerLevel.WARN, + message, + className: this.className, + pid, + date: dateTime + } as any; + + if (object) state.meta = object; + currentLogger(msg, state); + } + } + + /** + * Log a message at the info level + * + * @param message - The message to log + * @param object - Additional meta data to log + */ + info(message: string, object?: unknown): void { + if ( + this.isInfo() && + ((Object.keys(filteredClasses).length > 0 && filteredClasses[this.className]) || + (Object.keys(filteredClasses).length === 0 && classFilters[this.className])) + ) { + const dateTime = new Date().getTime(); + const msg = format('[%s-%s:%s] %s %s', 'INFO', this.className, pid, dateTime, message); + const state = { + type: LoggerLevel.INFO, + message, + className: this.className, + pid, + date: dateTime + } as any; + + if (object) state.meta = object; + currentLogger(msg, state); + } + } + + /** + * Log a message at the error level + * + * @param message - The message to log + * @param object - Additional meta data to log + */ + error(message: string, object?: unknown): void { + if ( + this.isError() && + ((Object.keys(filteredClasses).length > 0 && filteredClasses[this.className]) || + (Object.keys(filteredClasses).length === 0 && classFilters[this.className])) + ) { + const dateTime = new Date().getTime(); + const msg = format('[%s-%s:%s] %s %s', 'ERROR', this.className, pid, dateTime, message); + const state = { + type: LoggerLevel.ERROR, + message, + className: this.className, + pid, + date: dateTime + } as any; + + if (object) state.meta = object; + currentLogger(msg, state); + } + } + + /** Is the logger set at info level */ + isInfo(): boolean { + return level === LoggerLevel.INFO || level === LoggerLevel.DEBUG; + } + + /** Is the logger set at error level */ + isError(): boolean { + return level === LoggerLevel.ERROR || level === LoggerLevel.INFO || level === LoggerLevel.DEBUG; + } + + /** Is the logger set at error level */ + isWarn(): boolean { + return ( + level === LoggerLevel.ERROR || + level === LoggerLevel.WARN || + level === LoggerLevel.INFO || + level === LoggerLevel.DEBUG + ); + } + + /** Is the logger set at debug level */ + isDebug(): boolean { + return level === LoggerLevel.DEBUG; + } + + /** Resets the logger to default settings, error and no filtered classes */ + static reset(): void { + level = LoggerLevel.ERROR; + filteredClasses = {}; + } + + /** Get the current logger function */ + static currentLogger(): LoggerFunction { + return currentLogger; + } + + /** + * Set the current logger function + * + * @param logger - Custom logging function + */ + static setCurrentLogger(logger: LoggerFunction): void { + if (typeof logger !== 'function') { + throw new MongoInvalidArgumentError('Current logger must be a function'); + } + + currentLogger = logger; + } + + /** + * Filter log messages for a particular class + * + * @param type - The type of filter (currently only class) + * @param values - The filters to apply + */ + static filter(type: string, values: string[]): void { + if (type === 'class' && Array.isArray(values)) { + filteredClasses = {}; + values.forEach(x => (filteredClasses[x] = true)); + } + } + + /** + * Set the current log level + * + * @param newLevel - Set current log level (debug, warn, info, error) + */ + static setLevel(newLevel: LoggerLevel): void { + if ( + newLevel !== LoggerLevel.INFO && + newLevel !== LoggerLevel.ERROR && + newLevel !== LoggerLevel.DEBUG && + newLevel !== LoggerLevel.WARN + ) { + throw new MongoInvalidArgumentError( + `Argument "newLevel" should be one of ${enumToString(LoggerLevel)}` + ); + } + + level = newLevel; + } +} diff --git a/node_modules/mongodb/src/mongo_client.ts b/node_modules/mongodb/src/mongo_client.ts new file mode 100644 index 000000000..068142e2c --- /dev/null +++ b/node_modules/mongodb/src/mongo_client.ts @@ -0,0 +1,728 @@ +import type { TcpNetConnectOpts } from 'net'; +import type { ConnectionOptions as TLSConnectionOptions, TLSSocketOptions } from 'tls'; + +import { BSONSerializeOptions, Document, resolveBSONOptions } from './bson'; +import { ChangeStream, ChangeStreamDocument, ChangeStreamOptions } from './change_stream'; +import type { AuthMechanismProperties, MongoCredentials } from './cmap/auth/mongo_credentials'; +import type { AuthMechanism } from './cmap/auth/providers'; +import type { LEGAL_TCP_SOCKET_OPTIONS, LEGAL_TLS_SOCKET_OPTIONS } from './cmap/connect'; +import type { Connection } from './cmap/connection'; +import type { CompressorName } from './cmap/wire_protocol/compression'; +import { parseOptions } from './connection_string'; +import type { MONGO_CLIENT_EVENTS } from './constants'; +import { Db, DbOptions } from './db'; +import type { AutoEncrypter, AutoEncryptionOptions } from './deps'; +import type { Encrypter } from './encrypter'; +import { MongoInvalidArgumentError, MongoNotConnectedError } from './error'; +import type { Logger, LoggerLevel } from './logger'; +import { TypedEventEmitter } from './mongo_types'; +import { connect } from './operations/connect'; +import { PromiseProvider } from './promise_provider'; +import type { ReadConcern, ReadConcernLevel, ReadConcernLike } from './read_concern'; +import type { ReadPreference, ReadPreferenceMode } from './read_preference'; +import type { TagSet } from './sdam/server_description'; +import type { SrvPoller } from './sdam/srv_polling'; +import type { Topology, TopologyEvents } from './sdam/topology'; +import type { ClientSession, ClientSessionOptions } from './sessions'; +import { + Callback, + ClientMetadata, + HostAddress, + maybePromise, + MongoDBNamespace, + ns, + resolveOptions +} from './utils'; +import type { W, WriteConcern } from './write_concern'; + +/** @public */ +export const ServerApiVersion = Object.freeze({ + v1: '1' +} as const); + +/** @public */ +export type ServerApiVersion = typeof ServerApiVersion[keyof typeof ServerApiVersion]; + +/** @public */ +export interface ServerApi { + version: ServerApiVersion; + strict?: boolean; + deprecationErrors?: boolean; +} + +/** @public */ +export interface DriverInfo { + name?: string; + version?: string; + platform?: string; +} + +/** @public */ +export interface Auth { + /** The username for auth */ + username?: string; + /** The password for auth */ + password?: string; +} + +/** @public */ +export interface PkFactory { + createPk(): any; // TODO: when js-bson is typed, function should return some BSON type +} + +/** @public */ +export type SupportedTLSConnectionOptions = Pick< + TLSConnectionOptions, + Extract +>; + +/** @public */ +export type SupportedTLSSocketOptions = Pick< + TLSSocketOptions, + Extract +>; + +/** @public */ +export type SupportedSocketOptions = Pick< + TcpNetConnectOpts, + typeof LEGAL_TCP_SOCKET_OPTIONS[number] +>; + +/** @public */ +export type SupportedNodeConnectionOptions = SupportedTLSConnectionOptions & + SupportedTLSSocketOptions & + SupportedSocketOptions; + +/** + * Describes all possible URI query options for the mongo client + * @public + * @see https://docs.mongodb.com/manual/reference/connection-string + */ +export interface MongoClientOptions extends BSONSerializeOptions, SupportedNodeConnectionOptions { + /** Specifies the name of the replica set, if the mongod is a member of a replica set. */ + replicaSet?: string; + /** Enables or disables TLS/SSL for the connection. */ + tls?: boolean; + /** A boolean to enable or disables TLS/SSL for the connection. (The ssl option is equivalent to the tls option.) */ + ssl?: boolean; + /** Specifies the location of a local TLS Certificate */ + tlsCertificateFile?: string; + /** Specifies the location of a local .pem file that contains either the client's TLS/SSL certificate and key or only the client's TLS/SSL key when tlsCertificateFile is used to provide the certificate. */ + tlsCertificateKeyFile?: string; + /** Specifies the password to de-crypt the tlsCertificateKeyFile. */ + tlsCertificateKeyFilePassword?: string; + /** Specifies the location of a local .pem file that contains the root certificate chain from the Certificate Authority. This file is used to validate the certificate presented by the mongod/mongos instance. */ + tlsCAFile?: string; + /** Bypasses validation of the certificates presented by the mongod/mongos instance */ + tlsAllowInvalidCertificates?: boolean; + /** Disables hostname validation of the certificate presented by the mongod/mongos instance. */ + tlsAllowInvalidHostnames?: boolean; + /** Disables various certificate validations. */ + tlsInsecure?: boolean; + /** The time in milliseconds to attempt a connection before timing out. */ + connectTimeoutMS?: number; + /** The time in milliseconds to attempt a send or receive on a socket before the attempt times out. */ + socketTimeoutMS?: number; + /** An array or comma-delimited string of compressors to enable network compression for communication between this client and a mongod/mongos instance. */ + compressors?: CompressorName[] | string; + /** An integer that specifies the compression level if using zlib for network compression. */ + zlibCompressionLevel?: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | undefined; + /** The maximum number of hosts to connect to when using an srv connection string, a setting of `0` means unlimited hosts */ + srvMaxHosts?: number; + /** + * Modifies the srv URI to look like: + * + * `_{srvServiceName}._tcp.{hostname}.{domainname}` + * + * Querying this DNS URI is expected to respond with SRV records + */ + srvServiceName?: string; + /** The maximum number of connections in the connection pool. */ + maxPoolSize?: number; + /** The minimum number of connections in the connection pool. */ + minPoolSize?: number; + /** The maximum number of connections that may be in the process of being established concurrently by the connection pool. */ + maxConnecting?: number; + /** The maximum number of milliseconds that a connection can remain idle in the pool before being removed and closed. */ + maxIdleTimeMS?: number; + /** The maximum time in milliseconds that a thread can wait for a connection to become available. */ + waitQueueTimeoutMS?: number; + /** Specify a read concern for the collection (only MongoDB 3.2 or higher supported) */ + readConcern?: ReadConcernLike; + /** The level of isolation */ + readConcernLevel?: ReadConcernLevel; + /** Specifies the read preferences for this connection */ + readPreference?: ReadPreferenceMode | ReadPreference; + /** Specifies, in seconds, how stale a secondary can be before the client stops using it for read operations. */ + maxStalenessSeconds?: number; + /** Specifies the tags document as a comma-separated list of colon-separated key-value pairs. */ + readPreferenceTags?: TagSet[]; + /** The auth settings for when connection to server. */ + auth?: Auth; + /** Specify the database name associated with the user’s credentials. */ + authSource?: string; + /** Specify the authentication mechanism that MongoDB will use to authenticate the connection. */ + authMechanism?: AuthMechanism; + /** Specify properties for the specified authMechanism as a comma-separated list of colon-separated key-value pairs. */ + authMechanismProperties?: AuthMechanismProperties; + /** The size (in milliseconds) of the latency window for selecting among multiple suitable MongoDB instances. */ + localThresholdMS?: number; + /** Specifies how long (in milliseconds) to block for server selection before throwing an exception. */ + serverSelectionTimeoutMS?: number; + /** heartbeatFrequencyMS controls when the driver checks the state of the MongoDB deployment. Specify the interval (in milliseconds) between checks, counted from the end of the previous check until the beginning of the next one. */ + heartbeatFrequencyMS?: number; + /** Sets the minimum heartbeat frequency. In the event that the driver has to frequently re-check a server's availability, it will wait at least this long since the previous check to avoid wasted effort. */ + minHeartbeatFrequencyMS?: number; + /** The name of the application that created this MongoClient instance. MongoDB 3.4 and newer will print this value in the server log upon establishing each connection. It is also recorded in the slow query log and profile collections */ + appName?: string; + /** Enables retryable reads. */ + retryReads?: boolean; + /** Enable retryable writes. */ + retryWrites?: boolean; + /** Allow a driver to force a Single topology type with a connection string containing one host */ + directConnection?: boolean; + /** Instruct the driver it is connecting to a load balancer fronting a mongos like service */ + loadBalanced?: boolean; + + /** The write concern w value */ + w?: W; + /** The write concern timeout */ + wtimeoutMS?: number; + /** The journal write concern */ + journal?: boolean; + + /** Validate mongod server certificate against Certificate Authority */ + sslValidate?: boolean; + /** SSL Certificate file path. */ + sslCA?: string; + /** SSL Certificate file path. */ + sslCert?: string; + /** SSL Key file file path. */ + sslKey?: string; + /** SSL Certificate pass phrase. */ + sslPass?: string; + /** SSL Certificate revocation list file path. */ + sslCRL?: string; + /** TCP Connection no delay */ + noDelay?: boolean; + /** TCP Connection keep alive enabled */ + keepAlive?: boolean; + /** The number of milliseconds to wait before initiating keepAlive on the TCP socket */ + keepAliveInitialDelay?: number; + /** Force server to assign `_id` values instead of driver */ + forceServerObjectId?: boolean; + /** Return document results as raw BSON buffers */ + raw?: boolean; + /** A primary key factory function for generation of custom `_id` keys */ + pkFactory?: PkFactory; + /** A Promise library class the application wishes to use such as Bluebird, must be ES6 compatible */ + promiseLibrary?: any; + /** The logging level */ + loggerLevel?: LoggerLevel; + /** Custom logger object */ + logger?: Logger; + /** Enable command monitoring for this client */ + monitorCommands?: boolean; + /** Server API version */ + serverApi?: ServerApi | ServerApiVersion; + /** + * Optionally enable client side auto encryption + * + * @remarks + * Automatic encryption is an enterprise only feature that only applies to operations on a collection. Automatic encryption is not supported for operations on a database or view, and operations that are not bypassed will result in error + * (see [libmongocrypt: Auto Encryption Allow-List](https://github.com/mongodb/specifications/blob/master/source/client-side-encryption/client-side-encryption.rst#libmongocrypt-auto-encryption-allow-list)). To bypass automatic encryption for all operations, set bypassAutoEncryption=true in AutoEncryptionOpts. + * + * Automatic encryption requires the authenticated user to have the [listCollections privilege action](https://docs.mongodb.com/manual/reference/command/listCollections/#dbcmd.listCollections). + * + * If a MongoClient with a limited connection pool size (i.e a non-zero maxPoolSize) is configured with AutoEncryptionOptions, a separate internal MongoClient is created if any of the following are true: + * - AutoEncryptionOptions.keyVaultClient is not passed. + * - AutoEncryptionOptions.bypassAutomaticEncryption is false. + * + * If an internal MongoClient is created, it is configured with the same options as the parent MongoClient except minPoolSize is set to 0 and AutoEncryptionOptions is omitted. + */ + autoEncryption?: AutoEncryptionOptions; + /** Allows a wrapping driver to amend the client metadata generated by the driver to include information about the wrapping driver */ + driverInfo?: DriverInfo; + /** Configures a Socks5 proxy host used for creating TCP connections. */ + proxyHost?: string; + /** Configures a Socks5 proxy port used for creating TCP connections. */ + proxyPort?: number; + /** Configures a Socks5 proxy username when the proxy in proxyHost requires username/password authentication. */ + proxyUsername?: string; + /** Configures a Socks5 proxy password when the proxy in proxyHost requires username/password authentication. */ + proxyPassword?: string; + + /** @internal */ + srvPoller?: SrvPoller; + /** @internal */ + connectionType?: typeof Connection; + + /** @internal */ + [featureFlag: symbol]: any; +} + +/** @public */ +export type WithSessionCallback = (session: ClientSession) => Promise; + +/** @internal */ +export interface MongoClientPrivate { + url: string; + sessions: Set; + bsonOptions: BSONSerializeOptions; + namespace: MongoDBNamespace; + hasBeenClosed: boolean; + readonly options: MongoOptions; + readonly readConcern?: ReadConcern; + readonly writeConcern?: WriteConcern; + readonly readPreference: ReadPreference; + readonly logger: Logger; + readonly isMongoClient: true; +} + +/** @public */ +export type MongoClientEvents = Pick & { + // In previous versions the open event emitted a topology, in an effort to no longer + // expose internals but continue to expose this useful event API, it now emits a mongoClient + open(mongoClient: MongoClient): void; +}; + +/** @internal */ +const kOptions = Symbol('options'); + +/** + * The **MongoClient** class is a class that allows for making Connections to MongoDB. + * @public + * + * @remarks + * The programmatically provided options take precedent over the URI options. + * + * @example + * ```js + * // Connect using a MongoClient instance + * const MongoClient = require('mongodb').MongoClient; + * const test = require('assert'); + * // Connection url + * const url = 'mongodb://localhost:27017'; + * // Database Name + * const dbName = 'test'; + * // Connect using MongoClient + * const mongoClient = new MongoClient(url); + * mongoClient.connect(function(err, client) { + * const db = client.db(dbName); + * client.close(); + * }); + * ``` + * + * @example + * ```js + * // Connect using the MongoClient.connect static method + * const MongoClient = require('mongodb').MongoClient; + * const test = require('assert'); + * // Connection url + * const url = 'mongodb://localhost:27017'; + * // Database Name + * const dbName = 'test'; + * // Connect using MongoClient + * MongoClient.connect(url, function(err, client) { + * const db = client.db(dbName); + * client.close(); + * }); + * ``` + */ +export class MongoClient extends TypedEventEmitter { + /** @internal */ + s: MongoClientPrivate; + /** @internal */ + topology?: Topology; + + /** + * The consolidate, parsed, transformed and merged options. + * @internal + */ + [kOptions]: MongoOptions; + + constructor(url: string, options?: MongoClientOptions) { + super(); + + this[kOptions] = parseOptions(url, this, options); + + // eslint-disable-next-line @typescript-eslint/no-this-alias + const client = this; + + // The internal state + this.s = { + url, + sessions: new Set(), + bsonOptions: resolveBSONOptions(this[kOptions]), + namespace: ns('admin'), + hasBeenClosed: false, + + get options() { + return client[kOptions]; + }, + get readConcern() { + return client[kOptions].readConcern; + }, + get writeConcern() { + return client[kOptions].writeConcern; + }, + get readPreference() { + return client[kOptions].readPreference; + }, + get logger() { + return client[kOptions].logger; + }, + get isMongoClient(): true { + return true; + } + }; + } + + get options(): Readonly { + return Object.freeze({ ...this[kOptions] }); + } + + get serverApi(): Readonly { + return this[kOptions].serverApi && Object.freeze({ ...this[kOptions].serverApi }); + } + /** + * Intended for APM use only + * @internal + */ + get monitorCommands(): boolean { + return this[kOptions].monitorCommands; + } + set monitorCommands(value: boolean) { + this[kOptions].monitorCommands = value; + } + + get autoEncrypter(): AutoEncrypter | undefined { + return this[kOptions].autoEncrypter; + } + + get readConcern(): ReadConcern | undefined { + return this.s.readConcern; + } + + get writeConcern(): WriteConcern | undefined { + return this.s.writeConcern; + } + + get readPreference(): ReadPreference { + return this.s.readPreference; + } + + get bsonOptions(): BSONSerializeOptions { + return this.s.bsonOptions; + } + + get logger(): Logger { + return this.s.logger; + } + + /** + * Connect to MongoDB using a url + * + * @see docs.mongodb.org/manual/reference/connection-string/ + */ + connect(): Promise; + connect(callback: Callback): void; + connect(callback?: Callback): Promise | void { + if (callback && typeof callback !== 'function') { + throw new MongoInvalidArgumentError('Method `connect` only accepts a callback'); + } + + return maybePromise(callback, cb => { + connect(this, this[kOptions], err => { + if (err) return cb(err); + cb(undefined, this); + }); + }); + } + + /** + * Close the db and its underlying connections + * + * @param force - Force close, emitting no events + * @param callback - An optional callback, a Promise will be returned if none is provided + */ + close(): Promise; + close(callback: Callback): void; + close(force: boolean): Promise; + close(force: boolean, callback: Callback): void; + close( + forceOrCallback?: boolean | Callback, + callback?: Callback + ): Promise | void { + // There's no way to set hasBeenClosed back to false + Object.defineProperty(this.s, 'hasBeenClosed', { + value: true, + enumerable: true, + configurable: false, + writable: false + }); + + if (typeof forceOrCallback === 'function') { + callback = forceOrCallback; + } + + const force = typeof forceOrCallback === 'boolean' ? forceOrCallback : false; + + return maybePromise(callback, callback => { + if (this.topology == null) { + return callback(); + } + + // clear out references to old topology + const topology = this.topology; + this.topology = undefined; + + topology.close({ force }, error => { + if (error) return callback(error); + const { encrypter } = this[kOptions]; + if (encrypter) { + return encrypter.close(this, force, error => { + callback(error); + }); + } + callback(); + }); + }); + } + + /** + * Create a new Db instance sharing the current socket connections. + * + * @param dbName - The name of the database we want to use. If not provided, use database name from connection string. + * @param options - Optional settings for Db construction + */ + db(dbName?: string, options?: DbOptions): Db { + options = options ?? {}; + + // Default to db from connection string if not provided + if (!dbName) { + dbName = this.options.dbName; + } + + // Copy the options and add out internal override of the not shared flag + const finalOptions = Object.assign({}, this[kOptions], options); + + // Return the db object + const db = new Db(this, dbName, finalOptions); + + // Return the database + return db; + } + + /** + * Connect to MongoDB using a url + * + * @remarks + * The programmatically provided options take precedent over the URI options. + * + * @see https://docs.mongodb.org/manual/reference/connection-string/ + */ + static connect(url: string): Promise; + static connect(url: string, callback: Callback): void; + static connect(url: string, options: MongoClientOptions): Promise; + static connect(url: string, options: MongoClientOptions, callback: Callback): void; + static connect( + url: string, + options?: MongoClientOptions | Callback, + callback?: Callback + ): Promise | void { + if (typeof options === 'function') (callback = options), (options = {}); + options = options ?? {}; + + try { + // Create client + const mongoClient = new MongoClient(url, options); + // Execute the connect method + if (callback) { + return mongoClient.connect(callback); + } else { + return mongoClient.connect(); + } + } catch (error) { + if (callback) return callback(error); + else return PromiseProvider.get().reject(error); + } + } + + /** Starts a new session on the server */ + startSession(): ClientSession; + startSession(options: ClientSessionOptions): ClientSession; + startSession(options?: ClientSessionOptions): ClientSession { + options = Object.assign({ explicit: true }, options); + if (!this.topology) { + throw new MongoNotConnectedError('MongoClient must be connected to start a session'); + } + + return this.topology.startSession(options, this.s.options); + } + + /** + * Runs a given operation with an implicitly created session. The lifetime of the session + * will be handled without the need for user interaction. + * + * NOTE: presently the operation MUST return a Promise (either explicit or implicitly as an async function) + * + * @param options - Optional settings for the command + * @param callback - An callback to execute with an implicitly created session + */ + withSession(callback: WithSessionCallback): Promise; + withSession(options: ClientSessionOptions, callback: WithSessionCallback): Promise; + withSession( + optionsOrOperation?: ClientSessionOptions | WithSessionCallback, + callback?: WithSessionCallback + ): Promise { + const options = { + // Always define an owner + owner: Symbol(), + // If it's an object inherit the options + ...(typeof optionsOrOperation === 'object' ? optionsOrOperation : {}) + }; + + const withSessionCallback = + typeof optionsOrOperation === 'function' ? optionsOrOperation : callback; + + if (withSessionCallback == null) { + throw new MongoInvalidArgumentError('Missing required callback parameter'); + } + + const session = this.startSession(options); + const Promise = PromiseProvider.get(); + + return Promise.resolve() + .then(() => withSessionCallback(session)) + .then(() => { + // Do not return the result of callback + }) + .finally(() => session.endSession()); + } + + /** + * Create a new Change Stream, watching for new changes (insertions, updates, + * replacements, deletions, and invalidations) in this cluster. Will ignore all + * changes to system collections, as well as the local, admin, and config databases. + * + * @remarks + * watch() accepts two generic arguments for distinct usecases: + * - The first is to provide the schema that may be defined for all the data within the current cluster + * - The second is to override the shape of the change stream document entirely, if it is not provided the type will default to ChangeStreamDocument of the first argument + * + * @param pipeline - An array of {@link https://docs.mongodb.com/manual/reference/operator/aggregation-pipeline/|aggregation pipeline stages} through which to pass change stream documents. This allows for filtering (using $match) and manipulating the change stream documents. + * @param options - Optional settings for the command + * @typeParam TSchema - Type of the data being detected by the change stream + * @typeParam TChange - Type of the whole change stream document emitted + */ + watch< + TSchema extends Document = Document, + TChange extends Document = ChangeStreamDocument + >(pipeline: Document[] = [], options: ChangeStreamOptions = {}): ChangeStream { + // Allow optionally not specifying a pipeline + if (!Array.isArray(pipeline)) { + options = pipeline; + pipeline = []; + } + + return new ChangeStream(this, pipeline, resolveOptions(this, options)); + } + + /** Return the mongo client logger */ + getLogger(): Logger { + return this.s.logger; + } +} + +/** + * Mongo Client Options + * @public + */ +export interface MongoOptions + extends Required< + Pick< + MongoClientOptions, + | 'autoEncryption' + | 'connectTimeoutMS' + | 'directConnection' + | 'driverInfo' + | 'forceServerObjectId' + | 'minHeartbeatFrequencyMS' + | 'heartbeatFrequencyMS' + | 'keepAlive' + | 'keepAliveInitialDelay' + | 'localThresholdMS' + | 'logger' + | 'maxConnecting' + | 'maxIdleTimeMS' + | 'maxPoolSize' + | 'minPoolSize' + | 'monitorCommands' + | 'noDelay' + | 'pkFactory' + | 'promiseLibrary' + | 'raw' + | 'replicaSet' + | 'retryReads' + | 'retryWrites' + | 'serverSelectionTimeoutMS' + | 'socketTimeoutMS' + | 'srvMaxHosts' + | 'srvServiceName' + | 'tlsAllowInvalidCertificates' + | 'tlsAllowInvalidHostnames' + | 'tlsInsecure' + | 'waitQueueTimeoutMS' + | 'zlibCompressionLevel' + > + >, + SupportedNodeConnectionOptions { + hosts: HostAddress[]; + srvHost?: string; + credentials?: MongoCredentials; + readPreference: ReadPreference; + readConcern: ReadConcern; + loadBalanced: boolean; + serverApi: ServerApi; + compressors: CompressorName[]; + writeConcern: WriteConcern; + dbName: string; + metadata: ClientMetadata; + autoEncrypter?: AutoEncrypter; + proxyHost?: string; + proxyPort?: number; + proxyUsername?: string; + proxyPassword?: string; + /** @internal */ + connectionType?: typeof Connection; + + /** @internal */ + encrypter: Encrypter; + /** @internal */ + userSpecifiedAuthSource: boolean; + /** @internal */ + userSpecifiedReplicaSet: boolean; + + /** + * # NOTE ABOUT TLS Options + * + * If set TLS enabled, equivalent to setting the ssl option. + * + * ### Additional options: + * + * | nodejs option | MongoDB equivalent | type | + * |:---------------------|--------------------------------------------------------- |:---------------------------------------| + * | `ca` | `sslCA`, `tlsCAFile` | `string \| Buffer \| Buffer[]` | + * | `crl` | `sslCRL` | `string \| Buffer \| Buffer[]` | + * | `cert` | `sslCert`, `tlsCertificateFile`, `tlsCertificateKeyFile` | `string \| Buffer \| Buffer[]` | + * | `key` | `sslKey`, `tlsCertificateKeyFile` | `string \| Buffer \| KeyObject[]` | + * | `passphrase` | `sslPass`, `tlsCertificateKeyFilePassword` | `string` | + * | `rejectUnauthorized` | `sslValidate` | `boolean` | + * + */ + tls: boolean; + + /** @internal */ + [featureFlag: symbol]: any; +} diff --git a/node_modules/mongodb/src/mongo_types.ts b/node_modules/mongodb/src/mongo_types.ts new file mode 100644 index 000000000..fbbb2a475 --- /dev/null +++ b/node_modules/mongodb/src/mongo_types.ts @@ -0,0 +1,522 @@ +import type { ObjectIdLike } from 'bson'; +import { EventEmitter } from 'events'; + +import type { + Binary, + BSONRegExp, + Decimal128, + Document, + Double, + Int32, + Long, + ObjectId, + Timestamp +} from './bson'; +import type { Sort } from './sort'; + +/** @internal */ +export type TODO_NODE_3286 = any; + +/** Given an object shaped type, return the type of the _id field or default to ObjectId @public */ +export type InferIdType = TSchema extends { _id: infer IdType } + ? // user has defined a type for _id + Record extends IdType + ? never // explicitly forbid empty objects as the type of _id + : IdType + : TSchema extends { _id?: infer IdType } + ? // optional _id defined - return ObjectId | IdType + unknown extends IdType + ? ObjectId // infer the _id type as ObjectId if the type of _id is unknown + : IdType + : ObjectId; // user has not defined _id on schema + +/** Add an _id field to an object shaped type @public */ +export type WithId = EnhancedOmit & { _id: InferIdType }; + +/** + * Add an optional _id field to an object shaped type + * @public + */ +export type OptionalId = EnhancedOmit & { _id?: InferIdType }; + +/** + * Adds an optional _id field to an object shaped type, unless the _id field is requried on that type. + * In the case _id is required, this method continues to require_id. + * + * @public + * + * @privateRemarks + * `ObjectId extends TSchema['_id']` is a confusing ordering at first glance. Rather than ask + * `TSchema['_id'] extends ObjectId` which translated to "Is the _id property ObjectId?" + * we instead ask "Does ObjectId look like (have the same shape) as the _id?" + */ +export type OptionalUnlessRequiredId = TSchema extends { _id: any } + ? TSchema + : OptionalId; + +/** TypeScript Omit (Exclude to be specific) does not work for objects with an "any" indexed type, and breaks discriminated unions @public */ +export type EnhancedOmit = string extends keyof TRecordOrUnion + ? TRecordOrUnion // TRecordOrUnion has indexed type e.g. { _id: string; [k: string]: any; } or it is "any" + : TRecordOrUnion extends any + ? Pick> // discriminated unions + : never; + +/** Remove the _id field from an object shaped type @public */ +export type WithoutId = Omit; + +/** A MongoDB filter can be some portion of the schema or a set of operators @public */ +export type Filter = + | Partial + | ({ + [Property in Join>, '.'>]?: Condition< + PropertyType, Property> + >; + } & RootFilterOperators>); + +/** @public */ +export type Condition = AlternativeType | FilterOperators>; + +/** + * It is possible to search using alternative types in mongodb e.g. + * string types can be searched using a regex in mongo + * array types can be searched using their element type + * @public + */ +export type AlternativeType = T extends ReadonlyArray + ? T | RegExpOrString + : RegExpOrString; + +/** @public */ +export type RegExpOrString = T extends string ? BSONRegExp | RegExp | T : T; + +/** @public */ +export interface RootFilterOperators extends Document { + $and?: Filter[]; + $nor?: Filter[]; + $or?: Filter[]; + $text?: { + $search: string; + $language?: string; + $caseSensitive?: boolean; + $diacriticSensitive?: boolean; + }; + $where?: string | ((this: TSchema) => boolean); + $comment?: string | Document; +} + +/** + * @public + * A type that extends Document but forbids anything that "looks like" an object id. + */ +export type NonObjectIdLikeDocument = { + [key in keyof ObjectIdLike]?: never; +} & Document; + +/** @public */ +export interface FilterOperators extends NonObjectIdLikeDocument { + // Comparison + $eq?: TValue; + $gt?: TValue; + $gte?: TValue; + $in?: ReadonlyArray; + $lt?: TValue; + $lte?: TValue; + $ne?: TValue; + $nin?: ReadonlyArray; + // Logical + $not?: TValue extends string ? FilterOperators | RegExp : FilterOperators; + // Element + /** + * When `true`, `$exists` matches the documents that contain the field, + * including documents where the field value is null. + */ + $exists?: boolean; + $type?: BSONType | BSONTypeAlias; + // Evaluation + $expr?: Record; + $jsonSchema?: Record; + $mod?: TValue extends number ? [number, number] : never; + $regex?: TValue extends string ? RegExp | BSONRegExp | string : never; + $options?: TValue extends string ? string : never; + // Geospatial + $geoIntersects?: { $geometry: Document }; + $geoWithin?: Document; + $near?: Document; + $nearSphere?: Document; + $maxDistance?: number; + // Array + $all?: ReadonlyArray; + $elemMatch?: Document; + $size?: TValue extends ReadonlyArray ? number : never; + // Bitwise + $bitsAllClear?: BitwiseFilter; + $bitsAllSet?: BitwiseFilter; + $bitsAnyClear?: BitwiseFilter; + $bitsAnySet?: BitwiseFilter; + $rand?: Record; +} + +/** @public */ +export type BitwiseFilter = + | number /** numeric bit mask */ + | Binary /** BinData bit mask */ + | ReadonlyArray; /** `[ , , ... ]` */ + +/** @public */ +export const BSONType = Object.freeze({ + double: 1, + string: 2, + object: 3, + array: 4, + binData: 5, + undefined: 6, + objectId: 7, + bool: 8, + date: 9, + null: 10, + regex: 11, + dbPointer: 12, + javascript: 13, + symbol: 14, + javascriptWithScope: 15, + int: 16, + timestamp: 17, + long: 18, + decimal: 19, + minKey: -1, + maxKey: 127 +} as const); + +/** @public */ +export type BSONType = typeof BSONType[keyof typeof BSONType]; +/** @public */ +export type BSONTypeAlias = keyof typeof BSONType; + +/** + * @public + * Projection is flexible to permit the wide array of aggregation operators + * @deprecated since v4.1.0: Since projections support all aggregation operations we have no plans to narrow this type further + */ +// eslint-disable-next-line @typescript-eslint/no-unused-vars +export type Projection = Document; + +/** + * @public + * @deprecated since v4.1.0: Since projections support all aggregation operations we have no plans to narrow this type further + */ +export type ProjectionOperators = Document; + +/** @public */ +export type IsAny = true extends false & Type + ? ResultIfAny + : ResultIfNotAny; + +/** @public */ +export type Flatten = Type extends ReadonlyArray ? Item : Type; + +/** @public */ +export type SchemaMember = { [P in keyof T]?: V } | { [key: string]: V }; + +/** @public */ +export type IntegerType = number | Int32 | Long; + +/** @public */ +export type NumericType = IntegerType | Decimal128 | Double; + +/** @public */ +export type FilterOperations = T extends Record + ? { [key in keyof T]?: FilterOperators } + : FilterOperators; + +/** @public */ +export type KeysOfAType = { + [key in keyof TSchema]: NonNullable extends Type ? key : never; +}[keyof TSchema]; + +/** @public */ +export type KeysOfOtherType = { + [key in keyof TSchema]: NonNullable extends Type ? never : key; +}[keyof TSchema]; + +/** @public */ +export type AcceptedFields = { + readonly [key in KeysOfAType]?: AssignableType; +}; + +/** It avoids using fields with not acceptable types @public */ +export type NotAcceptedFields = { + readonly [key in KeysOfOtherType]?: never; +}; + +/** @public */ +export type OnlyFieldsOfType = IsAny< + TSchema[keyof TSchema], + Record, + AcceptedFields & + NotAcceptedFields & + Record +>; + +/** @public */ +export type MatchKeysAndValues = Readonly> & Record; + +/** @public */ +export type AddToSetOperators = { + $each?: Array>; +}; + +/** @public */ +export type ArrayOperator = { + $each?: Array>; + $slice?: number; + $position?: number; + $sort?: Sort; +}; + +/** @public */ +export type SetFields = ({ + readonly [key in KeysOfAType | undefined>]?: + | OptionalId> + | AddToSetOperators>>>; +} & NotAcceptedFields | undefined>) & { + readonly [key: string]: AddToSetOperators | any; +}; + +/** @public */ +export type PushOperator = ({ + readonly [key in KeysOfAType>]?: + | Flatten + | ArrayOperator>>; +} & NotAcceptedFields>) & { + readonly [key: string]: ArrayOperator | any; +}; + +/** @public */ +export type PullOperator = ({ + readonly [key in KeysOfAType>]?: + | Partial> + | FilterOperations>; +} & NotAcceptedFields>) & { + readonly [key: string]: FilterOperators | any; +}; + +/** @public */ +export type PullAllOperator = ({ + readonly [key in KeysOfAType>]?: TSchema[key]; +} & NotAcceptedFields>) & { + readonly [key: string]: ReadonlyArray; +}; + +/** @public */ +export type UpdateFilter = { + $currentDate?: OnlyFieldsOfType< + TSchema, + Date | Timestamp, + true | { $type: 'date' | 'timestamp' } + >; + $inc?: OnlyFieldsOfType; + $min?: MatchKeysAndValues; + $max?: MatchKeysAndValues; + $mul?: OnlyFieldsOfType; + $rename?: Record; + $set?: MatchKeysAndValues; + $setOnInsert?: MatchKeysAndValues; + $unset?: OnlyFieldsOfType; + $addToSet?: SetFields; + $pop?: OnlyFieldsOfType, 1 | -1>; + $pull?: PullOperator; + $push?: PushOperator; + $pullAll?: PullAllOperator; + $bit?: OnlyFieldsOfType< + TSchema, + NumericType | undefined, + { and: IntegerType } | { or: IntegerType } | { xor: IntegerType } + >; +} & Document; + +/** @public */ +export type Nullable = AnyType | null | undefined; + +/** @public */ +export type OneOrMore = T | ReadonlyArray; + +/** @public */ +export type GenericListener = (...args: any[]) => void; + +/** + * Event description type + * @public + */ +export type EventsDescription = Record; + +/** @public */ +export type CommonEvents = 'newListener' | 'removeListener'; + +/** + * Typescript type safe event emitter + * @public + */ +export declare interface TypedEventEmitter extends EventEmitter { + addListener(event: EventKey, listener: Events[EventKey]): this; + addListener( + event: CommonEvents, + listener: (eventName: string | symbol, listener: GenericListener) => void + ): this; + addListener(event: string | symbol, listener: GenericListener): this; + + on(event: EventKey, listener: Events[EventKey]): this; + on( + event: CommonEvents, + listener: (eventName: string | symbol, listener: GenericListener) => void + ): this; + on(event: string | symbol, listener: GenericListener): this; + + once(event: EventKey, listener: Events[EventKey]): this; + once( + event: CommonEvents, + listener: (eventName: string | symbol, listener: GenericListener) => void + ): this; + once(event: string | symbol, listener: GenericListener): this; + + removeListener(event: EventKey, listener: Events[EventKey]): this; + removeListener( + event: CommonEvents, + listener: (eventName: string | symbol, listener: GenericListener) => void + ): this; + removeListener(event: string | symbol, listener: GenericListener): this; + + off(event: EventKey, listener: Events[EventKey]): this; + off( + event: CommonEvents, + listener: (eventName: string | symbol, listener: GenericListener) => void + ): this; + off(event: string | symbol, listener: GenericListener): this; + + removeAllListeners( + event?: EventKey | CommonEvents | symbol | string + ): this; + + listeners( + event: EventKey | CommonEvents | symbol | string + ): Events[EventKey][]; + + rawListeners( + event: EventKey | CommonEvents | symbol | string + ): Events[EventKey][]; + + emit( + event: EventKey | symbol, + ...args: Parameters + ): boolean; + + listenerCount( + type: EventKey | CommonEvents | symbol | string + ): number; + + prependListener(event: EventKey, listener: Events[EventKey]): this; + prependListener( + event: CommonEvents, + listener: (eventName: string | symbol, listener: GenericListener) => void + ): this; + prependListener(event: string | symbol, listener: GenericListener): this; + + prependOnceListener( + event: EventKey, + listener: Events[EventKey] + ): this; + prependOnceListener( + event: CommonEvents, + listener: (eventName: string | symbol, listener: GenericListener) => void + ): this; + prependOnceListener(event: string | symbol, listener: GenericListener): this; + + eventNames(): string[]; + getMaxListeners(): number; + setMaxListeners(n: number): this; +} + +/** + * Typescript type safe event emitter + * @public + */ +// eslint-disable-next-line @typescript-eslint/no-unused-vars +export class TypedEventEmitter extends EventEmitter {} + +/** @public */ +export class CancellationToken extends TypedEventEmitter<{ cancel(): void }> {} + +/** + * Helper types for dot-notation filter attributes + */ + +/** @public */ +export type Join = T extends [] + ? '' + : T extends [string | number] + ? `${T[0]}` + : T extends [string | number, ...infer R] + ? `${T[0]}${D}${Join}` + : string; + +/** @public */ +export type PropertyType = string extends Property + ? unknown + : Property extends keyof Type + ? Type[Property] + : Property extends `${number}` + ? Type extends ReadonlyArray + ? ArrayType + : unknown + : Property extends `${infer Key}.${infer Rest}` + ? Key extends `${number}` + ? Type extends ReadonlyArray + ? PropertyType + : unknown + : Key extends keyof Type + ? Type[Key] extends Map + ? MapType + : PropertyType + : unknown + : unknown; + +/** + * @public + * returns tuple of strings (keys to be joined on '.') that represent every path into a schema + * https://docs.mongodb.com/manual/tutorial/query-embedded-documents/ + */ +export type NestedPaths = Type extends + | string + | number + | boolean + | Date + | RegExp + | Buffer + | Uint8Array + | ((...args: any[]) => any) + | { _bsontype: string } + ? [] + : Type extends ReadonlyArray + ? [] | [number, ...NestedPaths] + : Type extends Map + ? [string] + : // eslint-disable-next-line @typescript-eslint/ban-types + Type extends object + ? { + [Key in Extract]: Type[Key] extends Type // type of value extends the parent + ? [Key] + : // for a recursive union type, the child will never extend the parent type. + // but the parent will still extend the child + Type extends Type[Key] + ? [Key] + : Type[Key] extends ReadonlyArray // handling recursive types with arrays + ? Type extends ArrayType // is the type of the parent the same as the type of the array? + ? [Key] // yes, it's a recursive array type + : // for unions, the child type extends the parent + ArrayType extends Type + ? [Key] // we have a recursive array union + : // child is an array, but it's not a recursive array + [Key, ...NestedPaths] + : // child is not structured the same as the parent + [Key, ...NestedPaths]; + }[Extract] + : []; diff --git a/node_modules/mongodb/src/operations/add_user.ts b/node_modules/mongodb/src/operations/add_user.ts new file mode 100644 index 000000000..3d0c08e79 --- /dev/null +++ b/node_modules/mongodb/src/operations/add_user.ts @@ -0,0 +1,118 @@ +import * as crypto from 'crypto'; + +import type { Document } from '../bson'; +import type { Db } from '../db'; +import { MongoInvalidArgumentError } from '../error'; +import type { Server } from '../sdam/server'; +import type { ClientSession } from '../sessions'; +import { Callback, emitWarningOnce, getTopology } from '../utils'; +import { CommandOperation, CommandOperationOptions } from './command'; +import { Aspect, defineAspects } from './operation'; + +/** @public */ +export interface RoleSpecification { + /** + * A role grants privileges to perform sets of actions on defined resources. + * A given role applies to the database on which it is defined and can grant access down to a collection level of granularity. + */ + role: string; + /** The database this user's role should effect. */ + db: string; +} + +/** @public */ +export interface AddUserOptions extends CommandOperationOptions { + /** @deprecated Please use db.command('createUser', ...) instead for this option */ + digestPassword?: null; + /** Roles associated with the created user */ + roles?: string | string[] | RoleSpecification | RoleSpecification[]; + /** Custom data associated with the user (only Mongodb 2.6 or higher) */ + customData?: Document; +} + +/** @internal */ +export class AddUserOperation extends CommandOperation { + override options: AddUserOptions; + db: Db; + username: string; + password?: string; + + constructor(db: Db, username: string, password: string | undefined, options?: AddUserOptions) { + super(db, options); + + this.db = db; + this.username = username; + this.password = password; + this.options = options ?? {}; + } + + override execute( + server: Server, + session: ClientSession | undefined, + callback: Callback + ): void { + const db = this.db; + const username = this.username; + const password = this.password; + const options = this.options; + + // Error out if digestPassword set + if (options.digestPassword != null) { + return callback( + new MongoInvalidArgumentError( + 'Option "digestPassword" not supported via addUser, use db.command(...) instead' + ) + ); + } + + let roles; + if (!options.roles || (Array.isArray(options.roles) && options.roles.length === 0)) { + emitWarningOnce( + 'Creating a user without roles is deprecated. Defaults to "root" if db is "admin" or "dbOwner" otherwise' + ); + if (db.databaseName.toLowerCase() === 'admin') { + roles = ['root']; + } else { + roles = ['dbOwner']; + } + } else { + roles = Array.isArray(options.roles) ? options.roles : [options.roles]; + } + + let topology; + try { + topology = getTopology(db); + } catch (error) { + return callback(error); + } + + const digestPassword = topology.lastHello().maxWireVersion >= 7; + + let userPassword = password; + + if (!digestPassword) { + // Use node md5 generator + const md5 = crypto.createHash('md5'); + // Generate keys used for authentication + md5.update(`${username}:mongo:${password}`); + userPassword = md5.digest('hex'); + } + + // Build the command to execute + const command: Document = { + createUser: username, + customData: options.customData || {}, + roles: roles, + digestPassword + }; + + // No password + if (typeof password === 'string') { + command.pwd = userPassword; + } + + super.executeCommand(server, session, command, callback); + } +} + +defineAspects(AddUserOperation, [Aspect.WRITE_OPERATION]); diff --git a/node_modules/mongodb/src/operations/aggregate.ts b/node_modules/mongodb/src/operations/aggregate.ts new file mode 100644 index 000000000..1acc6ac62 --- /dev/null +++ b/node_modules/mongodb/src/operations/aggregate.ts @@ -0,0 +1,144 @@ +import type { Document } from '../bson'; +import { MongoInvalidArgumentError } from '../error'; +import type { Server } from '../sdam/server'; +import type { ClientSession } from '../sessions'; +import { Callback, maxWireVersion, MongoDBNamespace } from '../utils'; +import { CollationOptions, CommandOperation, CommandOperationOptions } from './command'; +import { Aspect, defineAspects, Hint } from './operation'; + +/** @internal */ +export const DB_AGGREGATE_COLLECTION = 1 as const; +const MIN_WIRE_VERSION_$OUT_READ_CONCERN_SUPPORT = 8 as const; + +/** @public */ +export interface AggregateOptions extends CommandOperationOptions { + /** allowDiskUse lets the server know if it can use disk to store temporary results for the aggregation (requires mongodb 2.6 \>). */ + allowDiskUse?: boolean; + /** The number of documents to return per batch. See [aggregation documentation](https://docs.mongodb.com/manual/reference/command/aggregate). */ + batchSize?: number; + /** Allow driver to bypass schema validation in MongoDB 3.2 or higher. */ + bypassDocumentValidation?: boolean; + /** Return the query as cursor, on 2.6 \> it returns as a real cursor on pre 2.6 it returns as an emulated cursor. */ + cursor?: Document; + /** specifies a cumulative time limit in milliseconds for processing operations on the cursor. MongoDB interrupts the operation at the earliest following interrupt point. */ + maxTimeMS?: number; + /** The maximum amount of time for the server to wait on new documents to satisfy a tailable cursor query. */ + maxAwaitTimeMS?: number; + /** Specify collation. */ + collation?: CollationOptions; + /** Add an index selection hint to an aggregation command */ + hint?: Hint; + /** Map of parameter names and values that can be accessed using $$var (requires MongoDB 5.0). */ + let?: Document; + + out?: string; +} + +/** @internal */ +export class AggregateOperation extends CommandOperation { + override options: AggregateOptions; + target: string | typeof DB_AGGREGATE_COLLECTION; + pipeline: Document[]; + hasWriteStage: boolean; + + constructor(ns: MongoDBNamespace, pipeline: Document[], options?: AggregateOptions) { + super(undefined, { ...options, dbName: ns.db }); + + this.options = options ?? {}; + + // Covers when ns.collection is null, undefined or the empty string, use DB_AGGREGATE_COLLECTION + this.target = ns.collection || DB_AGGREGATE_COLLECTION; + + this.pipeline = pipeline; + + // determine if we have a write stage, override read preference if so + this.hasWriteStage = false; + if (typeof options?.out === 'string') { + this.pipeline = this.pipeline.concat({ $out: options.out }); + this.hasWriteStage = true; + } else if (pipeline.length > 0) { + const finalStage = pipeline[pipeline.length - 1]; + if (finalStage.$out || finalStage.$merge) { + this.hasWriteStage = true; + } + } + + if (this.hasWriteStage) { + this.trySecondaryWrite = true; + } + + if (this.explain && this.writeConcern) { + throw new MongoInvalidArgumentError( + 'Option "explain" cannot be used on an aggregate call with writeConcern' + ); + } + + if (options?.cursor != null && typeof options.cursor !== 'object') { + throw new MongoInvalidArgumentError('Cursor options must be an object'); + } + } + + override get canRetryRead(): boolean { + return !this.hasWriteStage; + } + + addToPipeline(stage: Document): void { + this.pipeline.push(stage); + } + + override execute( + server: Server, + session: ClientSession | undefined, + callback: Callback + ): void { + const options: AggregateOptions = this.options; + const serverWireVersion = maxWireVersion(server); + const command: Document = { aggregate: this.target, pipeline: this.pipeline }; + + if (this.hasWriteStage && serverWireVersion < MIN_WIRE_VERSION_$OUT_READ_CONCERN_SUPPORT) { + this.readConcern = undefined; + } + + if (serverWireVersion >= 5) { + if (this.hasWriteStage && this.writeConcern) { + Object.assign(command, { writeConcern: this.writeConcern }); + } + } + + if (options.bypassDocumentValidation === true) { + command.bypassDocumentValidation = options.bypassDocumentValidation; + } + + if (typeof options.allowDiskUse === 'boolean') { + command.allowDiskUse = options.allowDiskUse; + } + + if (options.hint) { + command.hint = options.hint; + } + + if (options.let) { + command.let = options.let; + } + + // we check for undefined specifically here to allow falsy values + // eslint-disable-next-line no-restricted-syntax + if (options.comment !== undefined) { + command.comment = options.comment; + } + + command.cursor = options.cursor || {}; + if (options.batchSize && !this.hasWriteStage) { + command.cursor.batchSize = options.batchSize; + } + + super.executeCommand(server, session, command, callback); + } +} + +defineAspects(AggregateOperation, [ + Aspect.READ_OPERATION, + Aspect.RETRYABLE, + Aspect.EXPLAINABLE, + Aspect.CURSOR_CREATING +]); diff --git a/node_modules/mongodb/src/operations/bulk_write.ts b/node_modules/mongodb/src/operations/bulk_write.ts new file mode 100644 index 000000000..627dc709a --- /dev/null +++ b/node_modules/mongodb/src/operations/bulk_write.ts @@ -0,0 +1,67 @@ +import type { + AnyBulkWriteOperation, + BulkOperationBase, + BulkWriteOptions, + BulkWriteResult +} from '../bulk/common'; +import type { Collection } from '../collection'; +import type { Server } from '../sdam/server'; +import type { ClientSession } from '../sessions'; +import type { Callback } from '../utils'; +import { AbstractOperation, Aspect, defineAspects } from './operation'; + +/** @internal */ +export class BulkWriteOperation extends AbstractOperation { + override options: BulkWriteOptions; + collection: Collection; + operations: AnyBulkWriteOperation[]; + + constructor( + collection: Collection, + operations: AnyBulkWriteOperation[], + options: BulkWriteOptions + ) { + super(options); + this.options = options; + this.collection = collection; + this.operations = operations; + } + + override execute( + server: Server, + session: ClientSession | undefined, + callback: Callback + ): void { + const coll = this.collection; + const operations = this.operations; + const options = { ...this.options, ...this.bsonOptions, readPreference: this.readPreference }; + + // Create the bulk operation + const bulk: BulkOperationBase = + options.ordered === false + ? coll.initializeUnorderedBulkOp(options) + : coll.initializeOrderedBulkOp(options); + + // for each op go through and add to the bulk + try { + for (let i = 0; i < operations.length; i++) { + bulk.raw(operations[i]); + } + } catch (err) { + return callback(err); + } + + // Execute the bulk + bulk.execute({ ...options, session }, (err, r) => { + // We have connection level error + if (!r && err) { + return callback(err); + } + + // Return the results + callback(undefined, r); + }); + } +} + +defineAspects(BulkWriteOperation, [Aspect.WRITE_OPERATION]); diff --git a/node_modules/mongodb/src/operations/collections.ts b/node_modules/mongodb/src/operations/collections.ts new file mode 100644 index 000000000..8b314865a --- /dev/null +++ b/node_modules/mongodb/src/operations/collections.ts @@ -0,0 +1,48 @@ +import { Collection } from '../collection'; +import type { Db } from '../db'; +import type { Server } from '../sdam/server'; +import type { ClientSession } from '../sessions'; +import type { Callback } from '../utils'; +import { AbstractOperation, OperationOptions } from './operation'; + +export interface CollectionsOptions extends OperationOptions { + nameOnly?: boolean; +} + +/** @internal */ +export class CollectionsOperation extends AbstractOperation { + override options: CollectionsOptions; + db: Db; + + constructor(db: Db, options: CollectionsOptions) { + super(options); + this.options = options; + this.db = db; + } + + override execute( + server: Server, + session: ClientSession | undefined, + callback: Callback + ): void { + const db = this.db; + + // Let's get the collection names + db.listCollections( + {}, + { ...this.options, nameOnly: true, readPreference: this.readPreference, session } + ).toArray((err, documents) => { + if (err || !documents) return callback(err); + // Filter collections removing any illegal ones + documents = documents.filter(doc => doc.name.indexOf('$') === -1); + + // Return the collection objects + callback( + undefined, + documents.map(d => { + return new Collection(db, d.name, db.s.options); + }) + ); + }); + } +} diff --git a/node_modules/mongodb/src/operations/command.ts b/node_modules/mongodb/src/operations/command.ts new file mode 100644 index 000000000..57186ab42 --- /dev/null +++ b/node_modules/mongodb/src/operations/command.ts @@ -0,0 +1,193 @@ +import type { BSONSerializeOptions, Document } from '../bson'; +import { MongoCompatibilityError, MongoInvalidArgumentError } from '../error'; +import { Explain, ExplainOptions } from '../explain'; +import type { Logger } from '../logger'; +import { ReadConcern } from '../read_concern'; +import type { ReadPreference } from '../read_preference'; +import type { Server } from '../sdam/server'; +import { MIN_SECONDARY_WRITE_WIRE_VERSION } from '../sdam/server_selection'; +import type { ClientSession } from '../sessions'; +import { + Callback, + commandSupportsReadConcern, + decorateWithExplain, + maxWireVersion, + MongoDBNamespace +} from '../utils'; +import { WriteConcern, WriteConcernOptions } from '../write_concern'; +import type { ReadConcernLike } from './../read_concern'; +import { AbstractOperation, Aspect, OperationOptions } from './operation'; + +const SUPPORTS_WRITE_CONCERN_AND_COLLATION = 5; + +/** @public */ +export interface CollationOptions { + locale: string; + caseLevel?: boolean; + caseFirst?: string; + strength?: number; + numericOrdering?: boolean; + alternate?: string; + maxVariable?: string; + backwards?: boolean; + normalization?: boolean; +} + +/** @public */ +export interface CommandOperationOptions + extends OperationOptions, + WriteConcernOptions, + ExplainOptions { + /** @deprecated This option does nothing */ + fullResponse?: boolean; + /** Specify a read concern and level for the collection. (only MongoDB 3.2 or higher supported) */ + readConcern?: ReadConcernLike; + /** Collation */ + collation?: CollationOptions; + maxTimeMS?: number; + /** + * Comment to apply to the operation. + * + * In server versions pre-4.4, 'comment' must be string. A server + * error will be thrown if any other type is provided. + * + * In server versions 4.4 and above, 'comment' can be any valid BSON type. + */ + comment?: unknown; + /** Should retry failed writes */ + retryWrites?: boolean; + + // Admin command overrides. + dbName?: string; + authdb?: string; + noResponse?: boolean; +} + +/** @internal */ +export interface OperationParent { + s: { namespace: MongoDBNamespace }; + readConcern?: ReadConcern; + writeConcern?: WriteConcern; + readPreference?: ReadPreference; + logger?: Logger; + bsonOptions?: BSONSerializeOptions; +} + +/** @internal */ +export abstract class CommandOperation extends AbstractOperation { + override options: CommandOperationOptions; + readConcern?: ReadConcern; + writeConcern?: WriteConcern; + explain?: Explain; + logger?: Logger; + + constructor(parent?: OperationParent, options?: CommandOperationOptions) { + super(options); + this.options = options ?? {}; + + // NOTE: this was explicitly added for the add/remove user operations, it's likely + // something we'd want to reconsider. Perhaps those commands can use `Admin` + // as a parent? + const dbNameOverride = options?.dbName || options?.authdb; + if (dbNameOverride) { + this.ns = new MongoDBNamespace(dbNameOverride, '$cmd'); + } else { + this.ns = parent + ? parent.s.namespace.withCollection('$cmd') + : new MongoDBNamespace('admin', '$cmd'); + } + + this.readConcern = ReadConcern.fromOptions(options); + this.writeConcern = WriteConcern.fromOptions(options); + + // TODO(NODE-2056): make logger another "inheritable" property + if (parent && parent.logger) { + this.logger = parent.logger; + } + + if (this.hasAspect(Aspect.EXPLAINABLE)) { + this.explain = Explain.fromOptions(options); + } else if (options?.explain != null) { + throw new MongoInvalidArgumentError(`Option "explain" is not supported on this command`); + } + } + + override get canRetryWrite(): boolean { + if (this.hasAspect(Aspect.EXPLAINABLE)) { + return this.explain == null; + } + return true; + } + + abstract override execute( + server: Server, + session: ClientSession | undefined, + callback: Callback + ): void; + + executeCommand( + server: Server, + session: ClientSession | undefined, + cmd: Document, + callback: Callback + ): void { + // TODO: consider making this a non-enumerable property + this.server = server; + + const options = { + ...this.options, + ...this.bsonOptions, + readPreference: this.readPreference, + session + }; + + const serverWireVersion = maxWireVersion(server); + const inTransaction = this.session && this.session.inTransaction(); + + if (this.readConcern && commandSupportsReadConcern(cmd) && !inTransaction) { + Object.assign(cmd, { readConcern: this.readConcern }); + } + + if (this.trySecondaryWrite && serverWireVersion < MIN_SECONDARY_WRITE_WIRE_VERSION) { + options.omitReadPreference = true; + } + + if (options.collation && serverWireVersion < SUPPORTS_WRITE_CONCERN_AND_COLLATION) { + callback( + new MongoCompatibilityError( + `Server ${server.name}, which reports wire version ${serverWireVersion}, does not support collation` + ) + ); + return; + } + + if (this.writeConcern && this.hasAspect(Aspect.WRITE_OPERATION) && !inTransaction) { + Object.assign(cmd, { writeConcern: this.writeConcern }); + } + + if (serverWireVersion >= SUPPORTS_WRITE_CONCERN_AND_COLLATION) { + if ( + options.collation && + typeof options.collation === 'object' && + !this.hasAspect(Aspect.SKIP_COLLATION) + ) { + Object.assign(cmd, { collation: options.collation }); + } + } + + if (typeof options.maxTimeMS === 'number') { + cmd.maxTimeMS = options.maxTimeMS; + } + + if (this.hasAspect(Aspect.EXPLAINABLE) && this.explain) { + if (serverWireVersion < 6 && cmd.aggregate) { + // Prior to 3.6, with aggregate, verbosity is ignored, and we must pass in "explain: true" + cmd.explain = true; + } else { + cmd = decorateWithExplain(cmd, this.explain); + } + } + + server.command(this.ns, cmd, options, callback); + } +} diff --git a/node_modules/mongodb/src/operations/common_functions.ts b/node_modules/mongodb/src/operations/common_functions.ts new file mode 100644 index 000000000..928e00fd0 --- /dev/null +++ b/node_modules/mongodb/src/operations/common_functions.ts @@ -0,0 +1,102 @@ +import type { Document } from '../bson'; +import type { Collection } from '../collection'; +import type { Db } from '../db'; +import { MongoTopologyClosedError } from '../error'; +import type { ReadPreference } from '../read_preference'; +import type { ClientSession } from '../sessions'; +import { Callback, getTopology } from '../utils'; + +/** @public */ +export interface IndexInformationOptions { + full?: boolean; + readPreference?: ReadPreference; + session?: ClientSession; +} +/** + * Retrieves this collections index info. + * + * @param db - The Db instance on which to retrieve the index info. + * @param name - The name of the collection. + */ +export function indexInformation(db: Db, name: string, callback: Callback): void; +export function indexInformation( + db: Db, + name: string, + options: IndexInformationOptions, + callback?: Callback +): void; +export function indexInformation( + db: Db, + name: string, + _optionsOrCallback: IndexInformationOptions | Callback, + _callback?: Callback +): void { + let options = _optionsOrCallback as IndexInformationOptions; + let callback = _callback as Callback; + if ('function' === typeof _optionsOrCallback) { + callback = _optionsOrCallback as Callback; + options = {}; + } + // If we specified full information + const full = options.full == null ? false : options.full; + + let topology; + try { + topology = getTopology(db); + } catch (error) { + return callback(error); + } + + // Did the user destroy the topology + if (topology.isDestroyed()) return callback(new MongoTopologyClosedError()); + // Process all the results from the index command and collection + function processResults(indexes: any) { + // Contains all the information + const info: any = {}; + // Process all the indexes + for (let i = 0; i < indexes.length; i++) { + const index = indexes[i]; + // Let's unpack the object + info[index.name] = []; + for (const name in index.key) { + info[index.name].push([name, index.key[name]]); + } + } + + return info; + } + + // Get the list of indexes of the specified collection + db.collection(name) + .listIndexes(options) + .toArray((err, indexes) => { + if (err) return callback(err); + if (!Array.isArray(indexes)) return callback(undefined, []); + if (full) return callback(undefined, indexes); + callback(undefined, processResults(indexes)); + }); +} + +export function prepareDocs( + coll: Collection, + docs: Document[], + options: { forceServerObjectId?: boolean } +): Document[] { + const forceServerObjectId = + typeof options.forceServerObjectId === 'boolean' + ? options.forceServerObjectId + : coll.s.db.options?.forceServerObjectId; + + // no need to modify the docs if server sets the ObjectId + if (forceServerObjectId === true) { + return docs; + } + + return docs.map(doc => { + if (doc._id == null) { + doc._id = coll.s.pkFactory.createPk(); + } + + return doc; + }); +} diff --git a/node_modules/mongodb/src/operations/connect.ts b/node_modules/mongodb/src/operations/connect.ts new file mode 100644 index 000000000..a71e95867 --- /dev/null +++ b/node_modules/mongodb/src/operations/connect.ts @@ -0,0 +1,107 @@ +import { resolveSRVRecord } from '../connection_string'; +import { MONGO_CLIENT_EVENTS } from '../constants'; +import { MongoInvalidArgumentError, MongoRuntimeError } from '../error'; +import type { MongoClient, MongoOptions } from '../mongo_client'; +import { Topology } from '../sdam/topology'; +import type { Callback } from '../utils'; + +export function connect( + mongoClient: MongoClient, + options: MongoOptions, + callback: Callback +): void { + if (!callback) { + throw new MongoInvalidArgumentError('Callback function must be provided'); + } + + // If a connection already been established, we can terminate early + if (mongoClient.topology && mongoClient.topology.isConnected()) { + return callback(undefined, mongoClient); + } + + const logger = mongoClient.logger; + const connectCallback: Callback = err => { + const warningMessage = + 'seed list contains no mongos proxies, replicaset connections requires ' + + 'the parameter replicaSet to be supplied in the URI or options object, ' + + 'mongodb://server:port/db?replicaSet=name'; + if (err && err.message === 'no mongos proxies found in seed list') { + if (logger.isWarn()) { + logger.warn(warningMessage); + } + + // Return a more specific error message for MongoClient.connect + // TODO(NODE-3483) + return callback(new MongoRuntimeError(warningMessage)); + } + + callback(err, mongoClient); + }; + + if (typeof options.srvHost === 'string') { + return resolveSRVRecord(options, (err, hosts) => { + if (err || !hosts) return callback(err); + for (const [index, host] of hosts.entries()) { + options.hosts[index] = host; + } + + return createTopology(mongoClient, options, connectCallback); + }); + } + + return createTopology(mongoClient, options, connectCallback); +} + +function createTopology( + mongoClient: MongoClient, + options: MongoOptions, + callback: Callback +) { + // Create the topology + const topology = new Topology(options.hosts, options); + // Events can be emitted before initialization is complete so we have to + // save the reference to the topology on the client ASAP if the event handlers need to access it + mongoClient.topology = topology; + topology.client = mongoClient; + + topology.once(Topology.OPEN, () => mongoClient.emit('open', mongoClient)); + + for (const event of MONGO_CLIENT_EVENTS) { + topology.on(event, (...args: any[]) => mongoClient.emit(event, ...(args as any))); + } + + // initialize CSFLE if requested + if (mongoClient.autoEncrypter) { + mongoClient.autoEncrypter.init(err => { + if (err) { + return callback(err); + } + + topology.connect(options, err => { + if (err) { + topology.close({ force: true }); + return callback(err); + } + + options.encrypter.connectInternalClient(error => { + if (error) return callback(error); + + callback(undefined, topology); + }); + }); + }); + + return; + } + + // otherwise connect normally + topology.connect(options, err => { + if (err) { + topology.close({ force: true }); + return callback(err); + } + + callback(undefined, topology); + return; + }); +} diff --git a/node_modules/mongodb/src/operations/count.ts b/node_modules/mongodb/src/operations/count.ts new file mode 100644 index 000000000..8d94b84ea --- /dev/null +++ b/node_modules/mongodb/src/operations/count.ts @@ -0,0 +1,68 @@ +import type { Document } from '../bson'; +import type { Collection } from '../collection'; +import type { Server } from '../sdam/server'; +import type { ClientSession } from '../sessions'; +import type { Callback, MongoDBNamespace } from '../utils'; +import { CommandOperation, CommandOperationOptions } from './command'; +import { Aspect, defineAspects } from './operation'; + +/** @public */ +export interface CountOptions extends CommandOperationOptions { + /** The number of documents to skip. */ + skip?: number; + /** The maximum amounts to count before aborting. */ + limit?: number; + /** Number of milliseconds to wait before aborting the query. */ + maxTimeMS?: number; + /** An index name hint for the query. */ + hint?: string | Document; +} + +/** @internal */ +export class CountOperation extends CommandOperation { + override options: CountOptions; + collectionName?: string; + query: Document; + + constructor(namespace: MongoDBNamespace, filter: Document, options: CountOptions) { + super({ s: { namespace: namespace } } as unknown as Collection, options); + + this.options = options; + this.collectionName = namespace.collection; + this.query = filter; + } + + override execute( + server: Server, + session: ClientSession | undefined, + callback: Callback + ): void { + const options = this.options; + const cmd: Document = { + count: this.collectionName, + query: this.query + }; + + if (typeof options.limit === 'number') { + cmd.limit = options.limit; + } + + if (typeof options.skip === 'number') { + cmd.skip = options.skip; + } + + if (options.hint != null) { + cmd.hint = options.hint; + } + + if (typeof options.maxTimeMS === 'number') { + cmd.maxTimeMS = options.maxTimeMS; + } + + super.executeCommand(server, session, cmd, (err, result) => { + callback(err, result ? result.n : 0); + }); + } +} + +defineAspects(CountOperation, [Aspect.READ_OPERATION, Aspect.RETRYABLE]); diff --git a/node_modules/mongodb/src/operations/count_documents.ts b/node_modules/mongodb/src/operations/count_documents.ts new file mode 100644 index 000000000..c781329f2 --- /dev/null +++ b/node_modules/mongodb/src/operations/count_documents.ts @@ -0,0 +1,57 @@ +import type { Document } from '../bson'; +import type { Collection } from '../collection'; +import type { Server } from '../sdam/server'; +import type { ClientSession } from '../sessions'; +import type { Callback } from '../utils'; +import { AggregateOperation, AggregateOptions } from './aggregate'; + +/** @public */ +export interface CountDocumentsOptions extends AggregateOptions { + /** The number of documents to skip. */ + skip?: number; + /** The maximum amounts to count before aborting. */ + limit?: number; +} + +/** @internal */ +export class CountDocumentsOperation extends AggregateOperation { + constructor(collection: Collection, query: Document, options: CountDocumentsOptions) { + const pipeline = []; + pipeline.push({ $match: query }); + + if (typeof options.skip === 'number') { + pipeline.push({ $skip: options.skip }); + } + + if (typeof options.limit === 'number') { + pipeline.push({ $limit: options.limit }); + } + + pipeline.push({ $group: { _id: 1, n: { $sum: 1 } } }); + + super(collection.s.namespace, pipeline, options); + } + + override execute( + server: Server, + session: ClientSession | undefined, + callback: Callback + ): void { + super.execute(server, session, (err, result) => { + if (err || !result) { + callback(err); + return; + } + + // NOTE: We're avoiding creating a cursor here to reduce the callstack. + const response = result as unknown as Document; + if (response.cursor == null || response.cursor.firstBatch == null) { + callback(undefined, 0); + return; + } + + const docs = response.cursor.firstBatch; + callback(undefined, docs.length ? docs[0].n : 0); + }); + } +} diff --git a/node_modules/mongodb/src/operations/create_collection.ts b/node_modules/mongodb/src/operations/create_collection.ts new file mode 100644 index 000000000..c3f094437 --- /dev/null +++ b/node_modules/mongodb/src/operations/create_collection.ts @@ -0,0 +1,201 @@ +import type { Document } from '../bson'; +import { Collection } from '../collection'; +import type { Db } from '../db'; +import type { PkFactory } from '../mongo_client'; +import type { Server } from '../sdam/server'; +import type { ClientSession } from '../sessions'; +import type { Callback } from '../utils'; +import { CommandOperation, CommandOperationOptions } from './command'; +import { CreateIndexOperation } from './indexes'; +import { Aspect, defineAspects } from './operation'; + +const ILLEGAL_COMMAND_FIELDS = new Set([ + 'w', + 'wtimeout', + 'j', + 'fsync', + 'autoIndexId', + 'pkFactory', + 'raw', + 'readPreference', + 'session', + 'readConcern', + 'writeConcern', + 'raw', + 'fieldsAsRaw', + 'promoteLongs', + 'promoteValues', + 'promoteBuffers', + 'bsonRegExp', + 'serializeFunctions', + 'ignoreUndefined', + 'enableUtf8Validation' +]); + +/** @public + * Configuration options for timeseries collections + * @see https://docs.mongodb.com/manual/core/timeseries-collections/ + */ +export interface TimeSeriesCollectionOptions extends Document { + timeField: string; + metaField?: string; + granularity?: 'seconds' | 'minutes' | 'hours' | string; +} + +/** @public + * Configuration options for clustered collections + * TODO: NODE-4230 replace with normal manual link once it is on there. + * @see https://www.mongodb.com/docs/v5.3/core/clustered-collections/ + */ +export interface ClusteredCollectionOptions extends Document { + name?: string; + key: Document; + unique: boolean; +} + +/** @public */ +export interface CreateCollectionOptions extends CommandOperationOptions { + /** Returns an error if the collection does not exist */ + strict?: boolean; + /** Create a capped collection */ + capped?: boolean; + /** @deprecated Create an index on the _id field of the document, True by default on MongoDB 2.6 - 3.0 */ + autoIndexId?: boolean; + /** The size of the capped collection in bytes */ + size?: number; + /** The maximum number of documents in the capped collection */ + max?: number; + /** Available for the MMAPv1 storage engine only to set the usePowerOf2Sizes and the noPadding flag */ + flags?: number; + /** Allows users to specify configuration to the storage engine on a per-collection basis when creating a collection on MongoDB 3.0 or higher */ + storageEngine?: Document; + /** Allows users to specify validation rules or expressions for the collection. For more information, see Document Validation on MongoDB 3.2 or higher */ + validator?: Document; + /** Determines how strictly MongoDB applies the validation rules to existing documents during an update on MongoDB 3.2 or higher */ + validationLevel?: string; + /** Determines whether to error on invalid documents or just warn about the violations but allow invalid documents to be inserted on MongoDB 3.2 or higher */ + validationAction?: string; + /** Allows users to specify a default configuration for indexes when creating a collection on MongoDB 3.2 or higher */ + indexOptionDefaults?: Document; + /** The name of the source collection or view from which to create the view. The name is not the full namespace of the collection or view; i.e. does not include the database name and implies the same database as the view to create on MongoDB 3.4 or higher */ + viewOn?: string; + /** An array that consists of the aggregation pipeline stage. Creates the view by applying the specified pipeline to the viewOn collection or view on MongoDB 3.4 or higher */ + pipeline?: Document[]; + /** A primary key factory function for generation of custom _id keys. */ + pkFactory?: PkFactory; + /** A document specifying configuration options for timeseries collections. */ + timeseries?: TimeSeriesCollectionOptions; + /** A document specifying configuration options for clustered collections. For MongoDB 5.3 and above. */ + clusteredIndex?: ClusteredCollectionOptions; + /** The number of seconds after which a document in a timeseries or clustered collection expires. */ + expireAfterSeconds?: number; + /** @experimental */ + encryptedFields?: Document; + /** + * If set, enables pre-update and post-update document events to be included for any + * change streams that listen on this collection. + */ + changeStreamPreAndPostImages?: { enabled: boolean }; +} + +/** @internal */ +export class CreateCollectionOperation extends CommandOperation { + override options: CreateCollectionOptions; + db: Db; + name: string; + + constructor(db: Db, name: string, options: CreateCollectionOptions = {}) { + super(db, options); + + this.options = options; + this.db = db; + this.name = name; + } + + override execute( + server: Server, + session: ClientSession | undefined, + callback: Callback + ): void { + (async () => { + const db = this.db; + const name = this.name; + const options = this.options; + + const encryptedFields: Document | undefined = + options.encryptedFields ?? + db.s.client.options.autoEncryption?.encryptedFieldsMap?.[`${db.databaseName}.${name}`]; + + if (encryptedFields) { + // Create auxilliary collections for queryable encryption support. + const escCollection = encryptedFields.escCollection ?? `enxcol_.${name}.esc`; + const eccCollection = encryptedFields.eccCollection ?? `enxcol_.${name}.ecc`; + const ecocCollection = encryptedFields.ecocCollection ?? `enxcol_.${name}.ecoc`; + + for (const collectionName of [escCollection, eccCollection, ecocCollection]) { + const createOp = new CreateCollectionOperation(db, collectionName, { + clusteredIndex: { + key: { _id: 1 }, + unique: true + } + }); + await createOp.executeWithoutEncryptedFieldsCheck(server, session); + } + + if (!options.encryptedFields) { + this.options = { ...this.options, encryptedFields }; + } + } + + const coll = await this.executeWithoutEncryptedFieldsCheck(server, session); + + if (encryptedFields) { + // Create the required index for queryable encryption support. + const createIndexOp = new CreateIndexOperation(db, name, { __safeContent__: 1 }, {}); + await new Promise((resolve, reject) => { + createIndexOp.execute(server, session, err => (err ? reject(err) : resolve())); + }); + } + + return coll; + })().then( + coll => callback(undefined, coll), + err => callback(err) + ); + } + + private executeWithoutEncryptedFieldsCheck( + server: Server, + session: ClientSession | undefined + ): Promise { + return new Promise((resolve, reject) => { + const db = this.db; + const name = this.name; + const options = this.options; + + const done: Callback = err => { + if (err) { + return reject(err); + } + + resolve(new Collection(db, name, options)); + }; + + const cmd: Document = { create: name }; + for (const n in options) { + if ( + (options as any)[n] != null && + typeof (options as any)[n] !== 'function' && + !ILLEGAL_COMMAND_FIELDS.has(n) + ) { + cmd[n] = (options as any)[n]; + } + } + + // otherwise just execute the command + super.executeCommand(server, session, cmd, done); + }); + } +} + +defineAspects(CreateCollectionOperation, [Aspect.WRITE_OPERATION]); diff --git a/node_modules/mongodb/src/operations/delete.ts b/node_modules/mongodb/src/operations/delete.ts new file mode 100644 index 000000000..ccdfd1c80 --- /dev/null +++ b/node_modules/mongodb/src/operations/delete.ts @@ -0,0 +1,194 @@ +import type { Document } from '../bson'; +import type { Collection } from '../collection'; +import { MongoCompatibilityError, MongoServerError } from '../error'; +import type { Server } from '../sdam/server'; +import type { ClientSession } from '../sessions'; +import { Callback, collationNotSupported, maxWireVersion, MongoDBNamespace } from '../utils'; +import type { WriteConcernOptions } from '../write_concern'; +import { CollationOptions, CommandOperation, CommandOperationOptions } from './command'; +import { Aspect, defineAspects, Hint } from './operation'; + +/** @public */ +export interface DeleteOptions extends CommandOperationOptions, WriteConcernOptions { + /** If true, when an insert fails, don't execute the remaining writes. If false, continue with remaining inserts when one fails. */ + ordered?: boolean; + /** Specifies the collation to use for the operation */ + collation?: CollationOptions; + /** Specify that the update query should only consider plans using the hinted index */ + hint?: string | Document; + /** Map of parameter names and values that can be accessed using $$var (requires MongoDB 5.0). */ + let?: Document; + + /** @deprecated use `removeOne` or `removeMany` to implicitly specify the limit */ + single?: boolean; +} + +/** @public */ +export interface DeleteResult { + /** Indicates whether this write result was acknowledged. If not, then all other members of this result will be undefined. */ + acknowledged: boolean; + /** The number of documents that were deleted */ + deletedCount: number; +} + +/** @public */ +export interface DeleteStatement { + /** The query that matches documents to delete. */ + q: Document; + /** The number of matching documents to delete. */ + limit: number; + /** Specifies the collation to use for the operation. */ + collation?: CollationOptions; + /** A document or string that specifies the index to use to support the query predicate. */ + hint?: Hint; +} + +/** @internal */ +export class DeleteOperation extends CommandOperation { + override options: DeleteOptions; + statements: DeleteStatement[]; + + constructor(ns: MongoDBNamespace, statements: DeleteStatement[], options: DeleteOptions) { + super(undefined, options); + this.options = options; + this.ns = ns; + this.statements = statements; + } + + override get canRetryWrite(): boolean { + if (super.canRetryWrite === false) { + return false; + } + + return this.statements.every(op => (op.limit != null ? op.limit > 0 : true)); + } + + override execute(server: Server, session: ClientSession | undefined, callback: Callback): void { + const options = this.options ?? {}; + const ordered = typeof options.ordered === 'boolean' ? options.ordered : true; + const command: Document = { + delete: this.ns.collection, + deletes: this.statements, + ordered + }; + + if (options.let) { + command.let = options.let; + } + + // we check for undefined specifically here to allow falsy values + // eslint-disable-next-line no-restricted-syntax + if (options.comment !== undefined) { + command.comment = options.comment; + } + + if (options.explain != null && maxWireVersion(server) < 3) { + return callback + ? callback( + new MongoCompatibilityError(`Server ${server.name} does not support explain on delete`) + ) + : undefined; + } + + const unacknowledgedWrite = this.writeConcern && this.writeConcern.w === 0; + if (unacknowledgedWrite || maxWireVersion(server) < 5) { + if (this.statements.find((o: Document) => o.hint)) { + callback(new MongoCompatibilityError(`Servers < 3.4 do not support hint on delete`)); + return; + } + } + + const statementWithCollation = this.statements.find(statement => !!statement.collation); + if (statementWithCollation && collationNotSupported(server, statementWithCollation)) { + callback(new MongoCompatibilityError(`Server ${server.name} does not support collation`)); + return; + } + + super.executeCommand(server, session, command, callback); + } +} + +export class DeleteOneOperation extends DeleteOperation { + constructor(collection: Collection, filter: Document, options: DeleteOptions) { + super(collection.s.namespace, [makeDeleteStatement(filter, { ...options, limit: 1 })], options); + } + + override execute( + server: Server, + session: ClientSession | undefined, + callback: Callback + ): void { + super.execute(server, session, (err, res) => { + if (err || res == null) return callback(err); + if (res.code) return callback(new MongoServerError(res)); + if (res.writeErrors) return callback(new MongoServerError(res.writeErrors[0])); + if (this.explain) return callback(undefined, res); + + callback(undefined, { + acknowledged: this.writeConcern?.w !== 0 ?? true, + deletedCount: res.n + }); + }); + } +} + +export class DeleteManyOperation extends DeleteOperation { + constructor(collection: Collection, filter: Document, options: DeleteOptions) { + super(collection.s.namespace, [makeDeleteStatement(filter, options)], options); + } + + override execute( + server: Server, + session: ClientSession | undefined, + callback: Callback + ): void { + super.execute(server, session, (err, res) => { + if (err || res == null) return callback(err); + if (res.code) return callback(new MongoServerError(res)); + if (res.writeErrors) return callback(new MongoServerError(res.writeErrors[0])); + if (this.explain) return callback(undefined, res); + + callback(undefined, { + acknowledged: this.writeConcern?.w !== 0 ?? true, + deletedCount: res.n + }); + }); + } +} + +export function makeDeleteStatement( + filter: Document, + options: DeleteOptions & { limit?: number } +): DeleteStatement { + const op: DeleteStatement = { + q: filter, + limit: typeof options.limit === 'number' ? options.limit : 0 + }; + + if (options.single === true) { + op.limit = 1; + } + + if (options.collation) { + op.collation = options.collation; + } + + if (options.hint) { + op.hint = options.hint; + } + + return op; +} + +defineAspects(DeleteOperation, [Aspect.RETRYABLE, Aspect.WRITE_OPERATION]); +defineAspects(DeleteOneOperation, [ + Aspect.RETRYABLE, + Aspect.WRITE_OPERATION, + Aspect.EXPLAINABLE, + Aspect.SKIP_COLLATION +]); +defineAspects(DeleteManyOperation, [ + Aspect.WRITE_OPERATION, + Aspect.EXPLAINABLE, + Aspect.SKIP_COLLATION +]); diff --git a/node_modules/mongodb/src/operations/distinct.ts b/node_modules/mongodb/src/operations/distinct.ts new file mode 100644 index 000000000..d006d3113 --- /dev/null +++ b/node_modules/mongodb/src/operations/distinct.ts @@ -0,0 +1,92 @@ +import type { Document } from '../bson'; +import type { Collection } from '../collection'; +import { MongoCompatibilityError } from '../error'; +import type { Server } from '../sdam/server'; +import type { ClientSession } from '../sessions'; +import { Callback, decorateWithCollation, decorateWithReadConcern, maxWireVersion } from '../utils'; +import { CommandOperation, CommandOperationOptions } from './command'; +import { Aspect, defineAspects } from './operation'; + +/** @public */ +export type DistinctOptions = CommandOperationOptions; + +/** + * Return a list of distinct values for the given key across a collection. + * @internal + */ +export class DistinctOperation extends CommandOperation { + override options: DistinctOptions; + collection: Collection; + /** Field of the document to find distinct values for. */ + key: string; + /** The query for filtering the set of documents to which we apply the distinct filter. */ + query: Document; + + /** + * Construct a Distinct operation. + * + * @param collection - Collection instance. + * @param key - Field of the document to find distinct values for. + * @param query - The query for filtering the set of documents to which we apply the distinct filter. + * @param options - Optional settings. See Collection.prototype.distinct for a list of options. + */ + constructor(collection: Collection, key: string, query: Document, options?: DistinctOptions) { + super(collection, options); + + this.options = options ?? {}; + this.collection = collection; + this.key = key; + this.query = query; + } + + override execute( + server: Server, + session: ClientSession | undefined, + callback: Callback + ): void { + const coll = this.collection; + const key = this.key; + const query = this.query; + const options = this.options; + + // Distinct command + const cmd: Document = { + distinct: coll.collectionName, + key: key, + query: query + }; + + // Add maxTimeMS if defined + if (typeof options.maxTimeMS === 'number') { + cmd.maxTimeMS = options.maxTimeMS; + } + + // Do we have a readConcern specified + decorateWithReadConcern(cmd, coll, options); + + // Have we specified collation + try { + decorateWithCollation(cmd, coll, options); + } catch (err) { + return callback(err); + } + + if (this.explain && maxWireVersion(server) < 4) { + callback( + new MongoCompatibilityError(`Server ${server.name} does not support explain on distinct`) + ); + return; + } + + super.executeCommand(server, session, cmd, (err, result) => { + if (err) { + callback(err); + return; + } + + callback(undefined, this.explain ? result : result.values); + }); + } +} + +defineAspects(DistinctOperation, [Aspect.READ_OPERATION, Aspect.RETRYABLE, Aspect.EXPLAINABLE]); diff --git a/node_modules/mongodb/src/operations/drop.ts b/node_modules/mongodb/src/operations/drop.ts new file mode 100644 index 000000000..00f78e543 --- /dev/null +++ b/node_modules/mongodb/src/operations/drop.ts @@ -0,0 +1,120 @@ +import type { Document } from '../bson'; +import type { Db } from '../db'; +import { MONGODB_ERROR_CODES, MongoServerError } from '../error'; +import type { Server } from '../sdam/server'; +import type { ClientSession } from '../sessions'; +import type { Callback } from '../utils'; +import { CommandOperation, CommandOperationOptions } from './command'; +import { Aspect, defineAspects } from './operation'; + +/** @public */ +export interface DropCollectionOptions extends CommandOperationOptions { + /** @experimental */ + encryptedFields?: Document; +} + +/** @internal */ +export class DropCollectionOperation extends CommandOperation { + override options: DropCollectionOptions; + db: Db; + name: string; + + constructor(db: Db, name: string, options: DropCollectionOptions = {}) { + super(db, options); + this.db = db; + this.options = options; + this.name = name; + } + + override execute( + server: Server, + session: ClientSession | undefined, + callback: Callback + ): void { + (async () => { + const db = this.db; + const options = this.options; + const name = this.name; + + const encryptedFieldsMap = db.s.client.options.autoEncryption?.encryptedFieldsMap; + let encryptedFields: Document | undefined = + options.encryptedFields ?? encryptedFieldsMap?.[`${db.databaseName}.${name}`]; + + if (!encryptedFields && encryptedFieldsMap) { + // If the MongoClient was configued with an encryptedFieldsMap, + // and no encryptedFields config was available in it or explicitly + // passed as an argument, the spec tells us to look one up using + // listCollections(). + const listCollectionsResult = await db + .listCollections({ name }, { nameOnly: false }) + .toArray(); + encryptedFields = listCollectionsResult?.[0]?.options?.encryptedFields; + } + + if (encryptedFields) { + const escCollection = encryptedFields.escCollection || `enxcol_.${name}.esc`; + const eccCollection = encryptedFields.eccCollection || `enxcol_.${name}.ecc`; + const ecocCollection = encryptedFields.ecocCollection || `enxcol_.${name}.ecoc`; + + for (const collectionName of [escCollection, eccCollection, ecocCollection]) { + // Drop auxilliary collections, ignoring potential NamespaceNotFound errors. + const dropOp = new DropCollectionOperation(db, collectionName); + try { + await dropOp.executeWithoutEncryptedFieldsCheck(server, session); + } catch (err) { + if ( + !(err instanceof MongoServerError) || + err.code !== MONGODB_ERROR_CODES.NamespaceNotFound + ) { + throw err; + } + } + } + } + + return await this.executeWithoutEncryptedFieldsCheck(server, session); + })().then( + result => callback(undefined, result), + err => callback(err) + ); + } + + private executeWithoutEncryptedFieldsCheck( + server: Server, + session: ClientSession | undefined + ): Promise { + return new Promise((resolve, reject) => { + super.executeCommand(server, session, { drop: this.name }, (err, result) => { + if (err) return reject(err); + resolve(!!result.ok); + }); + }); + } +} + +/** @public */ +export type DropDatabaseOptions = CommandOperationOptions; + +/** @internal */ +export class DropDatabaseOperation extends CommandOperation { + override options: DropDatabaseOptions; + + constructor(db: Db, options: DropDatabaseOptions) { + super(db, options); + this.options = options; + } + override execute( + server: Server, + session: ClientSession | undefined, + callback: Callback + ): void { + super.executeCommand(server, session, { dropDatabase: 1 }, (err, result) => { + if (err) return callback(err); + if (result.ok) return callback(undefined, true); + callback(undefined, false); + }); + } +} + +defineAspects(DropCollectionOperation, [Aspect.WRITE_OPERATION]); +defineAspects(DropDatabaseOperation, [Aspect.WRITE_OPERATION]); diff --git a/node_modules/mongodb/src/operations/estimated_document_count.ts b/node_modules/mongodb/src/operations/estimated_document_count.ts new file mode 100644 index 000000000..d96ca4475 --- /dev/null +++ b/node_modules/mongodb/src/operations/estimated_document_count.ts @@ -0,0 +1,56 @@ +import type { Document } from '../bson'; +import type { Collection } from '../collection'; +import type { Server } from '../sdam/server'; +import type { ClientSession } from '../sessions'; +import type { Callback } from '../utils'; +import { CommandOperation, CommandOperationOptions } from './command'; +import { Aspect, defineAspects } from './operation'; + +/** @public */ +export interface EstimatedDocumentCountOptions extends CommandOperationOptions { + /** + * The maximum amount of time to allow the operation to run. + * + * This option is sent only if the caller explicitly provides a value. The default is to not send a value. + */ + maxTimeMS?: number; +} + +/** @internal */ +export class EstimatedDocumentCountOperation extends CommandOperation { + override options: EstimatedDocumentCountOptions; + collectionName: string; + + constructor(collection: Collection, options: EstimatedDocumentCountOptions = {}) { + super(collection, options); + this.options = options; + this.collectionName = collection.collectionName; + } + + override execute( + server: Server, + session: ClientSession | undefined, + callback: Callback + ): void { + const cmd: Document = { count: this.collectionName }; + + if (typeof this.options.maxTimeMS === 'number') { + cmd.maxTimeMS = this.options.maxTimeMS; + } + + super.executeCommand(server, session, cmd, (err, response) => { + if (err) { + callback(err); + return; + } + + callback(undefined, response?.n || 0); + }); + } +} + +defineAspects(EstimatedDocumentCountOperation, [ + Aspect.READ_OPERATION, + Aspect.RETRYABLE, + Aspect.CURSOR_CREATING +]); diff --git a/node_modules/mongodb/src/operations/eval.ts b/node_modules/mongodb/src/operations/eval.ts new file mode 100644 index 000000000..3c34c59d9 --- /dev/null +++ b/node_modules/mongodb/src/operations/eval.ts @@ -0,0 +1,82 @@ +import { Code, Document } from '../bson'; +import type { Collection } from '../collection'; +import type { Db } from '../db'; +import { MongoServerError } from '../error'; +import { ReadPreference } from '../read_preference'; +import type { Server } from '../sdam/server'; +import type { ClientSession } from '../sessions'; +import type { Callback } from '../utils'; +import { CommandOperation, CommandOperationOptions } from './command'; + +/** @public */ +export interface EvalOptions extends CommandOperationOptions { + nolock?: boolean; +} + +/** @internal */ +export class EvalOperation extends CommandOperation { + override options: EvalOptions; + code: Code; + parameters?: Document | Document[]; + + constructor( + db: Db | Collection, + code: Code, + parameters?: Document | Document[], + options?: EvalOptions + ) { + super(db, options); + + this.options = options ?? {}; + this.code = code; + this.parameters = parameters; + // force primary read preference + Object.defineProperty(this, 'readPreference', { + value: ReadPreference.primary, + configurable: false, + writable: false + }); + } + + override execute( + server: Server, + session: ClientSession | undefined, + callback: Callback + ): void { + let finalCode = this.code; + let finalParameters: Document[] = []; + + // If not a code object translate to one + if (!(finalCode && (finalCode as unknown as { _bsontype: string })._bsontype === 'Code')) { + finalCode = new Code(finalCode as never); + } + + // Ensure the parameters are correct + if (this.parameters != null && typeof this.parameters !== 'function') { + finalParameters = Array.isArray(this.parameters) ? this.parameters : [this.parameters]; + } + + // Create execution selector + const cmd: Document = { $eval: finalCode, args: finalParameters }; + + // Check if the nolock parameter is passed in + if (this.options.nolock) { + cmd.nolock = this.options.nolock; + } + + // Execute the command + super.executeCommand(server, session, cmd, (err, result) => { + if (err) return callback(err); + if (result && result.ok === 1) { + return callback(undefined, result.retval); + } + + if (result) { + callback(new MongoServerError({ message: `eval failed: ${result.errmsg}` })); + return; + } + + callback(err, result); + }); + } +} diff --git a/node_modules/mongodb/src/operations/execute_operation.ts b/node_modules/mongodb/src/operations/execute_operation.ts new file mode 100644 index 000000000..17674e548 --- /dev/null +++ b/node_modules/mongodb/src/operations/execute_operation.ts @@ -0,0 +1,289 @@ +import type { Document } from '../bson'; +import { + isRetryableReadError, + isRetryableWriteError, + MongoCompatibilityError, + MONGODB_ERROR_CODES, + MongoError, + MongoExpiredSessionError, + MongoNetworkError, + MongoNotConnectedError, + MongoRuntimeError, + MongoServerError, + MongoTransactionError, + MongoUnexpectedServerResponseError +} from '../error'; +import type { MongoClient } from '../mongo_client'; +import { ReadPreference } from '../read_preference'; +import type { Server } from '../sdam/server'; +import { + sameServerSelector, + secondaryWritableServerSelector, + ServerSelector +} from '../sdam/server_selection'; +import type { Topology } from '../sdam/topology'; +import type { ClientSession } from '../sessions'; +import { Callback, maybePromise, supportsRetryableWrites } from '../utils'; +import { AbstractOperation, Aspect } from './operation'; + +const MMAPv1_RETRY_WRITES_ERROR_CODE = MONGODB_ERROR_CODES.IllegalOperation; +const MMAPv1_RETRY_WRITES_ERROR_MESSAGE = + 'This MongoDB deployment does not support retryable writes. Please add retryWrites=false to your connection string.'; + +type ResultTypeFromOperation = TOperation extends AbstractOperation + ? K + : never; + +/** @internal */ +export interface ExecutionResult { + /** The server selected for the operation */ + server: Server; + /** The session used for this operation, may be implicitly created */ + session?: ClientSession; + /** The raw server response for the operation */ + response: Document; +} + +/** + * Executes the given operation with provided arguments. + * @internal + * + * @remarks + * This method reduces large amounts of duplication in the entire codebase by providing + * a single point for determining whether callbacks or promises should be used. Additionally + * it allows for a single point of entry to provide features such as implicit sessions, which + * are required by the Driver Sessions specification in the event that a ClientSession is + * not provided + * + * @param topology - The topology to execute this operation on + * @param operation - The operation to execute + * @param callback - The command result callback + */ +export function executeOperation< + T extends AbstractOperation, + TResult = ResultTypeFromOperation +>(client: MongoClient, operation: T): Promise; +export function executeOperation< + T extends AbstractOperation, + TResult = ResultTypeFromOperation +>(client: MongoClient, operation: T, callback: Callback): void; +export function executeOperation< + T extends AbstractOperation, + TResult = ResultTypeFromOperation +>(client: MongoClient, operation: T, callback?: Callback): Promise | void; +export function executeOperation< + T extends AbstractOperation, + TResult = ResultTypeFromOperation +>(client: MongoClient, operation: T, callback?: Callback): Promise | void { + if (!(operation instanceof AbstractOperation)) { + // TODO(NODE-3483): Extend MongoRuntimeError + throw new MongoRuntimeError('This method requires a valid operation instance'); + } + + return maybePromise(callback, callback => { + const topology = client.topology; + + if (topology == null) { + if (client.s.hasBeenClosed) { + return callback( + new MongoNotConnectedError('Client must be connected before running operations') + ); + } + client.s.options[Symbol.for('@@mdb.skipPingOnConnect')] = true; + return client.connect(error => { + delete client.s.options[Symbol.for('@@mdb.skipPingOnConnect')]; + if (error) { + return callback(error); + } + return executeOperation(client, operation, callback); + }); + } + + if (topology.shouldCheckForSessionSupport()) { + return topology.selectServer(ReadPreference.primaryPreferred, {}, err => { + if (err) return callback(err); + + executeOperation(client, operation, callback); + }); + } + + // The driver sessions spec mandates that we implicitly create sessions for operations + // that are not explicitly provided with a session. + let session = operation.session; + let owner: symbol | undefined; + if (topology.hasSessionSupport()) { + if (session == null) { + owner = Symbol(); + session = topology.startSession({ owner, explicit: false }); + } else if (session.hasEnded) { + return callback(new MongoExpiredSessionError('Use of expired sessions is not permitted')); + } else if (session.snapshotEnabled && !topology.capabilities.supportsSnapshotReads) { + return callback(new MongoCompatibilityError('Snapshot reads require MongoDB 5.0 or later')); + } + } else if (session) { + // If the user passed an explicit session and we are still, after server selection, + // trying to run against a topology that doesn't support sessions we error out. + return callback(new MongoCompatibilityError('Current topology does not support sessions')); + } + + try { + executeWithServerSelection(topology, session, operation, (error, result) => { + if (session?.owner != null && session.owner === owner) { + return session.endSession(endSessionError => callback(endSessionError ?? error, result)); + } + + callback(error, result); + }); + } catch (error) { + if (session?.owner != null && session.owner === owner) { + session.endSession(); + } + throw error; + } + }); +} + +function executeWithServerSelection( + topology: Topology, + session: ClientSession | undefined, + operation: AbstractOperation, + callback: Callback +) { + const readPreference = operation.readPreference ?? ReadPreference.primary; + const inTransaction = !!session?.inTransaction(); + + if (inTransaction && !readPreference.equals(ReadPreference.primary)) { + return callback( + new MongoTransactionError( + `Read preference in a transaction must be primary, not: ${readPreference.mode}` + ) + ); + } + + if (session?.isPinned && session.transaction.isCommitted && !operation.bypassPinningCheck) { + session.unpin(); + } + + let selector: ReadPreference | ServerSelector; + + if (operation.hasAspect(Aspect.CURSOR_ITERATING)) { + // Get more operations must always select the same server, but run through + // server selection to potentially force monitor checks if the server is + // in an unknown state. + selector = sameServerSelector(operation.server?.description); + } else if (operation.trySecondaryWrite) { + // If operation should try to write to secondary use the custom server selector + // otherwise provide the read preference. + selector = secondaryWritableServerSelector(topology.commonWireVersion, readPreference); + } else { + selector = readPreference; + } + + const serverSelectionOptions = { session }; + function retryOperation(originalError: MongoError) { + const isWriteOperation = operation.hasAspect(Aspect.WRITE_OPERATION); + const isReadOperation = operation.hasAspect(Aspect.READ_OPERATION); + + if (isWriteOperation && originalError.code === MMAPv1_RETRY_WRITES_ERROR_CODE) { + return callback( + new MongoServerError({ + message: MMAPv1_RETRY_WRITES_ERROR_MESSAGE, + errmsg: MMAPv1_RETRY_WRITES_ERROR_MESSAGE, + originalError + }) + ); + } + + if (isWriteOperation && !isRetryableWriteError(originalError)) { + return callback(originalError); + } + + if (isReadOperation && !isRetryableReadError(originalError)) { + return callback(originalError); + } + + if ( + originalError instanceof MongoNetworkError && + session?.isPinned && + !session.inTransaction() && + operation.hasAspect(Aspect.CURSOR_CREATING) + ) { + // If we have a cursor and the initial command fails with a network error, + // we can retry it on another connection. So we need to check it back in, clear the + // pool for the service id, and retry again. + session.unpin({ force: true, forceClear: true }); + } + + // select a new server, and attempt to retry the operation + topology.selectServer(selector, serverSelectionOptions, (error?: Error, server?: Server) => { + if (!error && isWriteOperation && !supportsRetryableWrites(server)) { + return callback( + new MongoUnexpectedServerResponseError( + 'Selected server does not support retryable writes' + ) + ); + } + + if (error || !server) { + return callback( + error ?? new MongoUnexpectedServerResponseError('Server selection failed without error') + ); + } + + operation.execute(server, session, callback); + }); + } + + if ( + readPreference && + !readPreference.equals(ReadPreference.primary) && + session?.inTransaction() + ) { + callback( + new MongoTransactionError( + `Read preference in a transaction must be primary, not: ${readPreference.mode}` + ) + ); + + return; + } + + // select a server, and execute the operation against it + topology.selectServer(selector, serverSelectionOptions, (error, server) => { + if (error || !server) { + return callback(error); + } + + if (session && operation.hasAspect(Aspect.RETRYABLE)) { + const willRetryRead = + topology.s.options.retryReads && !inTransaction && operation.canRetryRead; + + const willRetryWrite = + topology.s.options.retryWrites && + !inTransaction && + supportsRetryableWrites(server) && + operation.canRetryWrite; + + const hasReadAspect = operation.hasAspect(Aspect.READ_OPERATION); + const hasWriteAspect = operation.hasAspect(Aspect.WRITE_OPERATION); + + if ((hasReadAspect && willRetryRead) || (hasWriteAspect && willRetryWrite)) { + if (hasWriteAspect && willRetryWrite) { + operation.options.willRetryWrite = true; + session.incrementTransactionNumber(); + } + + return operation.execute(server, session, (error, result) => { + if (error instanceof MongoError) { + return retryOperation(error); + } else if (error) { + return callback(error); + } + callback(undefined, result); + }); + } + } + + return operation.execute(server, session, callback); + }); +} diff --git a/node_modules/mongodb/src/operations/find.ts b/node_modules/mongodb/src/operations/find.ts new file mode 100644 index 000000000..c52aa2cd9 --- /dev/null +++ b/node_modules/mongodb/src/operations/find.ts @@ -0,0 +1,279 @@ +import type { Document } from '../bson'; +import type { Collection } from '../collection'; +import { MongoCompatibilityError, MongoInvalidArgumentError } from '../error'; +import { ReadConcern } from '../read_concern'; +import type { Server } from '../sdam/server'; +import type { ClientSession } from '../sessions'; +import { formatSort, Sort } from '../sort'; +import { + Callback, + decorateWithExplain, + maxWireVersion, + MongoDBNamespace, + normalizeHintField +} from '../utils'; +import { CollationOptions, CommandOperation, CommandOperationOptions } from './command'; +import { Aspect, defineAspects, Hint } from './operation'; + +/** + * @public + * @typeParam TSchema - Unused schema definition, deprecated usage, only specify `FindOptions` with no generic + */ +// eslint-disable-next-line @typescript-eslint/no-unused-vars +export interface FindOptions extends CommandOperationOptions { + /** Sets the limit of documents returned in the query. */ + limit?: number; + /** Set to sort the documents coming back from the query. Array of indexes, `[['a', 1]]` etc. */ + sort?: Sort; + /** The fields to return in the query. Object of fields to either include or exclude (one of, not both), `{'a':1, 'b': 1}` **or** `{'a': 0, 'b': 0}` */ + projection?: Document; + /** Set to skip N documents ahead in your query (useful for pagination). */ + skip?: number; + /** Tell the query to use specific indexes in the query. Object of indexes to use, `{'_id':1}` */ + hint?: Hint; + /** Specify if the cursor can timeout. */ + timeout?: boolean; + /** Specify if the cursor is tailable. */ + tailable?: boolean; + /** Specify if the cursor is a tailable-await cursor. Requires `tailable` to be true */ + awaitData?: boolean; + /** Set the batchSize for the getMoreCommand when iterating over the query results. */ + batchSize?: number; + /** If true, returns only the index keys in the resulting documents. */ + returnKey?: boolean; + /** The inclusive lower bound for a specific index */ + min?: Document; + /** The exclusive upper bound for a specific index */ + max?: Document; + /** Number of milliseconds to wait before aborting the query. */ + maxTimeMS?: number; + /** The maximum amount of time for the server to wait on new documents to satisfy a tailable cursor query. Requires `tailable` and `awaitData` to be true */ + maxAwaitTimeMS?: number; + /** The server normally times out idle cursors after an inactivity period (10 minutes) to prevent excess memory use. Set this option to prevent that. */ + noCursorTimeout?: boolean; + /** Specify collation (MongoDB 3.4 or higher) settings for update operation (see 3.4 documentation for available fields). */ + collation?: CollationOptions; + /** Allows disk use for blocking sort operations exceeding 100MB memory. (MongoDB 3.2 or higher) */ + allowDiskUse?: boolean; + /** Determines whether to close the cursor after the first batch. Defaults to false. */ + singleBatch?: boolean; + /** For queries against a sharded collection, allows the command (or subsequent getMore commands) to return partial results, rather than an error, if one or more queried shards are unavailable. */ + allowPartialResults?: boolean; + /** Determines whether to return the record identifier for each document. If true, adds a field $recordId to the returned documents. */ + showRecordId?: boolean; + /** Map of parameter names and values that can be accessed using $$var (requires MongoDB 5.0). */ + let?: Document; +} + +const SUPPORTS_WRITE_CONCERN_AND_COLLATION = 5; + +/** @internal */ +export class FindOperation extends CommandOperation { + override options: FindOptions; + filter: Document; + + constructor( + collection: Collection | undefined, + ns: MongoDBNamespace, + filter: Document = {}, + options: FindOptions = {} + ) { + super(collection, options); + + this.options = options; + this.ns = ns; + + if (typeof filter !== 'object' || Array.isArray(filter)) { + throw new MongoInvalidArgumentError('Query filter must be a plain object or ObjectId'); + } + + // If the filter is a buffer, validate that is a valid BSON document + if (Buffer.isBuffer(filter)) { + const objectSize = filter[0] | (filter[1] << 8) | (filter[2] << 16) | (filter[3] << 24); + if (objectSize !== filter.length) { + throw new MongoInvalidArgumentError( + `Query filter raw message size does not match message header size [${filter.length}] != [${objectSize}]` + ); + } + } + + // special case passing in an ObjectId as a filter + this.filter = filter != null && filter._bsontype === 'ObjectID' ? { _id: filter } : filter; + } + + override execute( + server: Server, + session: ClientSession | undefined, + callback: Callback + ): void { + this.server = server; + + const serverWireVersion = maxWireVersion(server); + const options = this.options; + if (options.allowDiskUse != null && serverWireVersion < 4) { + callback( + new MongoCompatibilityError('Option "allowDiskUse" is not supported on MongoDB < 3.2') + ); + return; + } + + if (options.collation && serverWireVersion < SUPPORTS_WRITE_CONCERN_AND_COLLATION) { + callback( + new MongoCompatibilityError( + `Server ${server.name}, which reports wire version ${serverWireVersion}, does not support collation` + ) + ); + + return; + } + + let findCommand = makeFindCommand(this.ns, this.filter, options); + if (this.explain) { + findCommand = decorateWithExplain(findCommand, this.explain); + } + + server.command( + this.ns, + findCommand, + { + ...this.options, + ...this.bsonOptions, + documentsReturnedIn: 'firstBatch', + session + }, + callback + ); + } +} + +function makeFindCommand(ns: MongoDBNamespace, filter: Document, options: FindOptions): Document { + const findCommand: Document = { + find: ns.collection, + filter + }; + + if (options.sort) { + findCommand.sort = formatSort(options.sort); + } + + if (options.projection) { + let projection = options.projection; + if (projection && Array.isArray(projection)) { + projection = projection.length + ? projection.reduce((result, field) => { + result[field] = 1; + return result; + }, {}) + : { _id: 1 }; + } + + findCommand.projection = projection; + } + + if (options.hint) { + findCommand.hint = normalizeHintField(options.hint); + } + + if (typeof options.skip === 'number') { + findCommand.skip = options.skip; + } + + if (typeof options.limit === 'number') { + if (options.limit < 0) { + findCommand.limit = -options.limit; + findCommand.singleBatch = true; + } else { + findCommand.limit = options.limit; + } + } + + if (typeof options.batchSize === 'number') { + if (options.batchSize < 0) { + if ( + options.limit && + options.limit !== 0 && + Math.abs(options.batchSize) < Math.abs(options.limit) + ) { + findCommand.limit = -options.batchSize; + } + + findCommand.singleBatch = true; + } else { + findCommand.batchSize = options.batchSize; + } + } + + if (typeof options.singleBatch === 'boolean') { + findCommand.singleBatch = options.singleBatch; + } + + // we check for undefined specifically here to allow falsy values + // eslint-disable-next-line no-restricted-syntax + if (options.comment !== undefined) { + findCommand.comment = options.comment; + } + + if (typeof options.maxTimeMS === 'number') { + findCommand.maxTimeMS = options.maxTimeMS; + } + + const readConcern = ReadConcern.fromOptions(options); + if (readConcern) { + findCommand.readConcern = readConcern.toJSON(); + } + + if (options.max) { + findCommand.max = options.max; + } + + if (options.min) { + findCommand.min = options.min; + } + + if (typeof options.returnKey === 'boolean') { + findCommand.returnKey = options.returnKey; + } + + if (typeof options.showRecordId === 'boolean') { + findCommand.showRecordId = options.showRecordId; + } + + if (typeof options.tailable === 'boolean') { + findCommand.tailable = options.tailable; + } + + if (typeof options.timeout === 'boolean') { + findCommand.noCursorTimeout = !options.timeout; + } else if (typeof options.noCursorTimeout === 'boolean') { + findCommand.noCursorTimeout = options.noCursorTimeout; + } + + if (typeof options.awaitData === 'boolean') { + findCommand.awaitData = options.awaitData; + } + + if (typeof options.allowPartialResults === 'boolean') { + findCommand.allowPartialResults = options.allowPartialResults; + } + + if (options.collation) { + findCommand.collation = options.collation; + } + + if (typeof options.allowDiskUse === 'boolean') { + findCommand.allowDiskUse = options.allowDiskUse; + } + + if (options.let) { + findCommand.let = options.let; + } + + return findCommand; +} + +defineAspects(FindOperation, [ + Aspect.READ_OPERATION, + Aspect.RETRYABLE, + Aspect.EXPLAINABLE, + Aspect.CURSOR_CREATING +]); diff --git a/node_modules/mongodb/src/operations/find_and_modify.ts b/node_modules/mongodb/src/operations/find_and_modify.ts new file mode 100644 index 000000000..12d7ba504 --- /dev/null +++ b/node_modules/mongodb/src/operations/find_and_modify.ts @@ -0,0 +1,295 @@ +import type { Document } from '../bson'; +import type { Collection } from '../collection'; +import { MongoCompatibilityError, MongoInvalidArgumentError } from '../error'; +import { ReadPreference } from '../read_preference'; +import type { Server } from '../sdam/server'; +import type { ClientSession } from '../sessions'; +import { formatSort, Sort, SortForCmd } from '../sort'; +import { Callback, decorateWithCollation, hasAtomicOperators, maxWireVersion } from '../utils'; +import type { WriteConcern, WriteConcernSettings } from '../write_concern'; +import { CommandOperation, CommandOperationOptions } from './command'; +import { Aspect, defineAspects } from './operation'; + +/** @public */ +export const ReturnDocument = Object.freeze({ + BEFORE: 'before', + AFTER: 'after' +} as const); + +/** @public */ +export type ReturnDocument = typeof ReturnDocument[keyof typeof ReturnDocument]; + +/** @public */ +export interface FindOneAndDeleteOptions extends CommandOperationOptions { + /** An optional hint for query optimization. See the {@link https://docs.mongodb.com/manual/reference/command/update/#update-command-hint|update command} reference for more information.*/ + hint?: Document; + /** Limits the fields to return for all matching documents. */ + projection?: Document; + /** Determines which document the operation modifies if the query selects multiple documents. */ + sort?: Sort; + /** Map of parameter names and values that can be accessed using $$var (requires MongoDB 5.0). */ + let?: Document; +} + +/** @public */ +export interface FindOneAndReplaceOptions extends CommandOperationOptions { + /** Allow driver to bypass schema validation in MongoDB 3.2 or higher. */ + bypassDocumentValidation?: boolean; + /** An optional hint for query optimization. See the {@link https://docs.mongodb.com/manual/reference/command/update/#update-command-hint|update command} reference for more information.*/ + hint?: Document; + /** Limits the fields to return for all matching documents. */ + projection?: Document; + /** When set to 'after', returns the updated document rather than the original. The default is 'before'. */ + returnDocument?: ReturnDocument; + /** Determines which document the operation modifies if the query selects multiple documents. */ + sort?: Sort; + /** Upsert the document if it does not exist. */ + upsert?: boolean; + /** Map of parameter names and values that can be accessed using $$var (requires MongoDB 5.0). */ + let?: Document; +} + +/** @public */ +export interface FindOneAndUpdateOptions extends CommandOperationOptions { + /** Optional list of array filters referenced in filtered positional operators */ + arrayFilters?: Document[]; + /** Allow driver to bypass schema validation in MongoDB 3.2 or higher. */ + bypassDocumentValidation?: boolean; + /** An optional hint for query optimization. See the {@link https://docs.mongodb.com/manual/reference/command/update/#update-command-hint|update command} reference for more information.*/ + hint?: Document; + /** Limits the fields to return for all matching documents. */ + projection?: Document; + /** When set to 'after', returns the updated document rather than the original. The default is 'before'. */ + returnDocument?: ReturnDocument; + /** Determines which document the operation modifies if the query selects multiple documents. */ + sort?: Sort; + /** Upsert the document if it does not exist. */ + upsert?: boolean; + /** Map of parameter names and values that can be accessed using $$var (requires MongoDB 5.0). */ + let?: Document; +} + +/** @internal */ +interface FindAndModifyCmdBase { + remove: boolean; + new: boolean; + upsert: boolean; + update?: Document; + sort?: SortForCmd; + fields?: Document; + bypassDocumentValidation?: boolean; + arrayFilters?: Document[]; + maxTimeMS?: number; + let?: Document; + writeConcern?: WriteConcern | WriteConcernSettings; + /** + * Comment to apply to the operation. + * + * In server versions pre-4.4, 'comment' must be string. A server + * error will be thrown if any other type is provided. + * + * In server versions 4.4 and above, 'comment' can be any valid BSON type. + */ + comment?: unknown; +} + +function configureFindAndModifyCmdBaseUpdateOpts( + cmdBase: FindAndModifyCmdBase, + options: FindOneAndReplaceOptions | FindOneAndUpdateOptions +): FindAndModifyCmdBase { + cmdBase.new = options.returnDocument === ReturnDocument.AFTER; + cmdBase.upsert = options.upsert === true; + + if (options.bypassDocumentValidation === true) { + cmdBase.bypassDocumentValidation = options.bypassDocumentValidation; + } + return cmdBase; +} + +/** @internal */ +class FindAndModifyOperation extends CommandOperation { + override options: FindOneAndReplaceOptions | FindOneAndUpdateOptions | FindOneAndDeleteOptions; + cmdBase: FindAndModifyCmdBase; + collection: Collection; + query: Document; + doc?: Document; + + constructor( + collection: Collection, + query: Document, + options: FindOneAndReplaceOptions | FindOneAndUpdateOptions | FindOneAndDeleteOptions + ) { + super(collection, options); + this.options = options ?? {}; + this.cmdBase = { + remove: false, + new: false, + upsert: false + }; + + const sort = formatSort(options.sort); + if (sort) { + this.cmdBase.sort = sort; + } + + if (options.projection) { + this.cmdBase.fields = options.projection; + } + + if (options.maxTimeMS) { + this.cmdBase.maxTimeMS = options.maxTimeMS; + } + + // Decorate the findAndModify command with the write Concern + if (options.writeConcern) { + this.cmdBase.writeConcern = options.writeConcern; + } + + if (options.let) { + this.cmdBase.let = options.let; + } + + // we check for undefined specifically here to allow falsy values + // eslint-disable-next-line no-restricted-syntax + if (options.comment !== undefined) { + this.cmdBase.comment = options.comment; + } + + // force primary read preference + this.readPreference = ReadPreference.primary; + + this.collection = collection; + this.query = query; + } + + override execute( + server: Server, + session: ClientSession | undefined, + callback: Callback + ): void { + const coll = this.collection; + const query = this.query; + const options = { ...this.options, ...this.bsonOptions }; + + // Create findAndModify command object + const cmd: Document = { + findAndModify: coll.collectionName, + query: query, + ...this.cmdBase + }; + + // Have we specified collation + try { + decorateWithCollation(cmd, coll, options); + } catch (err) { + return callback(err); + } + + if (options.hint) { + // TODO: once this method becomes a CommandOperation we will have the server + // in place to check. + const unacknowledgedWrite = this.writeConcern?.w === 0; + if (unacknowledgedWrite || maxWireVersion(server) < 8) { + callback( + new MongoCompatibilityError( + 'The current topology does not support a hint on findAndModify commands' + ) + ); + + return; + } + + cmd.hint = options.hint; + } + + if (this.explain && maxWireVersion(server) < 4) { + callback( + new MongoCompatibilityError( + `Server ${server.name} does not support explain on findAndModify` + ) + ); + return; + } + + // Execute the command + super.executeCommand(server, session, cmd, (err, result) => { + if (err) return callback(err); + return callback(undefined, result); + }); + } +} + +/** @internal */ +export class FindOneAndDeleteOperation extends FindAndModifyOperation { + constructor(collection: Collection, filter: Document, options: FindOneAndDeleteOptions) { + // Basic validation + if (filter == null || typeof filter !== 'object') { + throw new MongoInvalidArgumentError('Argument "filter" must be an object'); + } + + super(collection, filter, options); + this.cmdBase.remove = true; + } +} + +/** @internal */ +export class FindOneAndReplaceOperation extends FindAndModifyOperation { + constructor( + collection: Collection, + filter: Document, + replacement: Document, + options: FindOneAndReplaceOptions + ) { + if (filter == null || typeof filter !== 'object') { + throw new MongoInvalidArgumentError('Argument "filter" must be an object'); + } + + if (replacement == null || typeof replacement !== 'object') { + throw new MongoInvalidArgumentError('Argument "replacement" must be an object'); + } + + if (hasAtomicOperators(replacement)) { + throw new MongoInvalidArgumentError('Replacement document must not contain atomic operators'); + } + + super(collection, filter, options); + this.cmdBase.update = replacement; + configureFindAndModifyCmdBaseUpdateOpts(this.cmdBase, options); + } +} + +/** @internal */ +export class FindOneAndUpdateOperation extends FindAndModifyOperation { + constructor( + collection: Collection, + filter: Document, + update: Document, + options: FindOneAndUpdateOptions + ) { + if (filter == null || typeof filter !== 'object') { + throw new MongoInvalidArgumentError('Argument "filter" must be an object'); + } + + if (update == null || typeof update !== 'object') { + throw new MongoInvalidArgumentError('Argument "update" must be an object'); + } + + if (!hasAtomicOperators(update)) { + throw new MongoInvalidArgumentError('Update document requires atomic operators'); + } + + super(collection, filter, options); + this.cmdBase.update = update; + configureFindAndModifyCmdBaseUpdateOpts(this.cmdBase, options); + + if (options.arrayFilters) { + this.cmdBase.arrayFilters = options.arrayFilters; + } + } +} + +defineAspects(FindAndModifyOperation, [ + Aspect.WRITE_OPERATION, + Aspect.RETRYABLE, + Aspect.EXPLAINABLE +]); diff --git a/node_modules/mongodb/src/operations/get_more.ts b/node_modules/mongodb/src/operations/get_more.ts new file mode 100644 index 000000000..51fe9cf4b --- /dev/null +++ b/node_modules/mongodb/src/operations/get_more.ts @@ -0,0 +1,63 @@ +import type { Document, Long } from '../bson'; +import { MongoRuntimeError } from '../error'; +import type { Server } from '../sdam/server'; +import type { ClientSession } from '../sessions'; +import { Callback, maxWireVersion, MongoDBNamespace } from '../utils'; +import { AbstractOperation, Aspect, defineAspects, OperationOptions } from './operation'; + +/** + * @public + */ +// eslint-disable-next-line @typescript-eslint/no-unused-vars +export interface GetMoreOptions extends OperationOptions { + /** Set the batchSize for the getMoreCommand when iterating over the query results. */ + batchSize?: number; + /** + * Comment to apply to the operation. + * + * getMore only supports 'comment' in server versions 4.4 and above. + */ + comment?: unknown; + /** Number of milliseconds to wait before aborting the query. */ + maxTimeMS?: number; +} + +/** @internal */ +export class GetMoreOperation extends AbstractOperation { + cursorId: Long; + override options: GetMoreOptions; + + constructor(ns: MongoDBNamespace, cursorId: Long, server: Server, options: GetMoreOptions = {}) { + super(options); + + this.options = options; + + // comment on getMore is only supported for server versions 4.4 and above + if (maxWireVersion(server) < 9) { + delete this.options.comment; + } + + this.ns = ns; + this.cursorId = cursorId; + this.server = server; + } + + /** + * Although there is a server already associated with the get more operation, the signature + * for execute passes a server so we will just use that one. + */ + override execute( + server: Server, + session: ClientSession | undefined, + callback: Callback + ): void { + if (server !== this.server) { + return callback( + new MongoRuntimeError('Getmore must run on the same server operation began on') + ); + } + server.getMore(this.ns, this.cursorId, this.options, callback); + } +} + +defineAspects(GetMoreOperation, [Aspect.READ_OPERATION, Aspect.CURSOR_ITERATING]); diff --git a/node_modules/mongodb/src/operations/indexes.ts b/node_modules/mongodb/src/operations/indexes.ts new file mode 100644 index 000000000..af27bbcb1 --- /dev/null +++ b/node_modules/mongodb/src/operations/indexes.ts @@ -0,0 +1,537 @@ +import type { Document } from '../bson'; +import type { Collection } from '../collection'; +import { AbstractCursor } from '../cursor/abstract_cursor'; +import type { Db } from '../db'; +import { MongoCompatibilityError, MONGODB_ERROR_CODES, MongoServerError } from '../error'; +import type { OneOrMore } from '../mongo_types'; +import { ReadPreference } from '../read_preference'; +import type { Server } from '../sdam/server'; +import type { ClientSession } from '../sessions'; +import { Callback, maxWireVersion, MongoDBNamespace, parseIndexOptions } from '../utils'; +import { + CollationOptions, + CommandOperation, + CommandOperationOptions, + OperationParent +} from './command'; +import { indexInformation, IndexInformationOptions } from './common_functions'; +import { executeOperation, ExecutionResult } from './execute_operation'; +import { AbstractOperation, Aspect, defineAspects } from './operation'; + +const VALID_INDEX_OPTIONS = new Set([ + 'background', + 'unique', + 'name', + 'partialFilterExpression', + 'sparse', + 'hidden', + 'expireAfterSeconds', + 'storageEngine', + 'collation', + 'version', + + // text indexes + 'weights', + 'default_language', + 'language_override', + 'textIndexVersion', + + // 2d-sphere indexes + '2dsphereIndexVersion', + + // 2d indexes + 'bits', + 'min', + 'max', + + // geoHaystack Indexes + 'bucketSize', + + // wildcard indexes + 'wildcardProjection' +]); + +/** @public */ +export type IndexDirection = -1 | 1 | '2d' | '2dsphere' | 'text' | 'geoHaystack' | number; + +/** @public */ +export type IndexSpecification = OneOrMore< + | string + | [string, IndexDirection] + | { [key: string]: IndexDirection } + | [string, IndexDirection][] + | { [key: string]: IndexDirection }[] +>; + +/** @public */ +export interface IndexDescription + extends Pick< + CreateIndexesOptions, + | 'background' + | 'unique' + | 'partialFilterExpression' + | 'sparse' + | 'hidden' + | 'expireAfterSeconds' + | 'storageEngine' + | 'version' + | 'weights' + | 'default_language' + | 'language_override' + | 'textIndexVersion' + | '2dsphereIndexVersion' + | 'bits' + | 'min' + | 'max' + | 'bucketSize' + | 'wildcardProjection' + > { + collation?: CollationOptions; + name?: string; + key: Document; +} + +/** @public */ +export interface CreateIndexesOptions extends CommandOperationOptions { + /** Creates the index in the background, yielding whenever possible. */ + background?: boolean; + /** Creates an unique index. */ + unique?: boolean; + /** Override the autogenerated index name (useful if the resulting name is larger than 128 bytes) */ + name?: string; + /** Creates a partial index based on the given filter object (MongoDB 3.2 or higher) */ + partialFilterExpression?: Document; + /** Creates a sparse index. */ + sparse?: boolean; + /** Allows you to expire data on indexes applied to a data (MongoDB 2.2 or higher) */ + expireAfterSeconds?: number; + /** Allows users to configure the storage engine on a per-index basis when creating an index. (MongoDB 3.0 or higher) */ + storageEngine?: Document; + /** (MongoDB 4.4. or higher) Specifies how many data-bearing members of a replica set, including the primary, must complete the index builds successfully before the primary marks the indexes as ready. This option accepts the same values for the "w" field in a write concern plus "votingMembers", which indicates all voting data-bearing nodes. */ + commitQuorum?: number | string; + /** Specifies the index version number, either 0 or 1. */ + version?: number; + // text indexes + weights?: Document; + default_language?: string; + language_override?: string; + textIndexVersion?: number; + // 2d-sphere indexes + '2dsphereIndexVersion'?: number; + // 2d indexes + bits?: number; + /** For geospatial indexes set the lower bound for the co-ordinates. */ + min?: number; + /** For geospatial indexes set the high bound for the co-ordinates. */ + max?: number; + // geoHaystack Indexes + bucketSize?: number; + // wildcard indexes + wildcardProjection?: Document; + /** Specifies that the index should exist on the target collection but should not be used by the query planner when executing operations. (MongoDB 4.4 or higher) */ + hidden?: boolean; +} + +function makeIndexSpec(indexSpec: IndexSpecification, options: any): IndexDescription { + const indexParameters = parseIndexOptions(indexSpec); + + // Generate the index name + const name = typeof options.name === 'string' ? options.name : indexParameters.name; + + // Set up the index + const finalIndexSpec: Document = { name, key: indexParameters.fieldHash }; + + // merge valid index options into the index spec + for (const optionName in options) { + if (VALID_INDEX_OPTIONS.has(optionName)) { + finalIndexSpec[optionName] = options[optionName]; + } + } + + return finalIndexSpec as IndexDescription; +} + +/** @internal */ +export class IndexesOperation extends AbstractOperation { + override options: IndexInformationOptions; + collection: Collection; + + constructor(collection: Collection, options: IndexInformationOptions) { + super(options); + this.options = options; + this.collection = collection; + } + + override execute( + server: Server, + session: ClientSession | undefined, + callback: Callback + ): void { + const coll = this.collection; + const options = this.options; + + indexInformation( + coll.s.db, + coll.collectionName, + { full: true, ...options, readPreference: this.readPreference, session }, + callback + ); + } +} + +/** @internal */ +export class CreateIndexesOperation< + T extends string | string[] = string[] +> extends CommandOperation { + override options: CreateIndexesOptions; + collectionName: string; + indexes: IndexDescription[]; + + constructor( + parent: OperationParent, + collectionName: string, + indexes: IndexDescription[], + options?: CreateIndexesOptions + ) { + super(parent, options); + + this.options = options ?? {}; + this.collectionName = collectionName; + + this.indexes = indexes; + } + + override execute( + server: Server, + session: ClientSession | undefined, + callback: Callback + ): void { + const options = this.options; + const indexes = this.indexes; + + const serverWireVersion = maxWireVersion(server); + + // Ensure we generate the correct name if the parameter is not set + for (let i = 0; i < indexes.length; i++) { + // Did the user pass in a collation, check if our write server supports it + if (indexes[i].collation && serverWireVersion < 5) { + callback( + new MongoCompatibilityError( + `Server ${server.name}, which reports wire version ${serverWireVersion}, ` + + 'does not support collation' + ) + ); + return; + } + + if (indexes[i].name == null) { + const keys = []; + + for (const name in indexes[i].key) { + keys.push(`${name}_${indexes[i].key[name]}`); + } + + // Set the name + indexes[i].name = keys.join('_'); + } + } + + const cmd: Document = { createIndexes: this.collectionName, indexes }; + + if (options.commitQuorum != null) { + if (serverWireVersion < 9) { + callback( + new MongoCompatibilityError( + 'Option `commitQuorum` for `createIndexes` not supported on servers < 4.4' + ) + ); + return; + } + cmd.commitQuorum = options.commitQuorum; + } + + // collation is set on each index, it should not be defined at the root + this.options.collation = undefined; + + super.executeCommand(server, session, cmd, err => { + if (err) { + callback(err); + return; + } + + const indexNames = indexes.map(index => index.name || ''); + callback(undefined, indexNames as T); + }); + } +} + +/** @internal */ +export class CreateIndexOperation extends CreateIndexesOperation { + constructor( + parent: OperationParent, + collectionName: string, + indexSpec: IndexSpecification, + options?: CreateIndexesOptions + ) { + // createIndex can be called with a variety of styles: + // coll.createIndex('a'); + // coll.createIndex({ a: 1 }); + // coll.createIndex([['a', 1]]); + // createIndexes is always called with an array of index spec objects + + super(parent, collectionName, [makeIndexSpec(indexSpec, options)], options); + } + override execute( + server: Server, + session: ClientSession | undefined, + callback: Callback + ): void { + super.execute(server, session, (err, indexNames) => { + if (err || !indexNames) return callback(err); + return callback(undefined, indexNames[0]); + }); + } +} + +/** @internal */ +export class EnsureIndexOperation extends CreateIndexOperation { + db: Db; + + constructor( + db: Db, + collectionName: string, + indexSpec: IndexSpecification, + options?: CreateIndexesOptions + ) { + super(db, collectionName, indexSpec, options); + + this.readPreference = ReadPreference.primary; + this.db = db; + this.collectionName = collectionName; + } + + override execute(server: Server, session: ClientSession | undefined, callback: Callback): void { + const indexName = this.indexes[0].name; + const cursor = this.db.collection(this.collectionName).listIndexes({ session }); + cursor.toArray((err, indexes) => { + /// ignore "NamespaceNotFound" errors + if (err && (err as MongoServerError).code !== MONGODB_ERROR_CODES.NamespaceNotFound) { + return callback(err); + } + + if (indexes) { + indexes = Array.isArray(indexes) ? indexes : [indexes]; + if (indexes.some(index => index.name === indexName)) { + callback(undefined, indexName); + return; + } + } + + super.execute(server, session, callback); + }); + } +} + +/** @public */ +export type DropIndexesOptions = CommandOperationOptions; + +/** @internal */ +export class DropIndexOperation extends CommandOperation { + override options: DropIndexesOptions; + collection: Collection; + indexName: string; + + constructor(collection: Collection, indexName: string, options?: DropIndexesOptions) { + super(collection, options); + + this.options = options ?? {}; + this.collection = collection; + this.indexName = indexName; + } + + override execute( + server: Server, + session: ClientSession | undefined, + callback: Callback + ): void { + const cmd = { dropIndexes: this.collection.collectionName, index: this.indexName }; + super.executeCommand(server, session, cmd, callback); + } +} + +/** @internal */ +export class DropIndexesOperation extends DropIndexOperation { + constructor(collection: Collection, options: DropIndexesOptions) { + super(collection, '*', options); + } + + override execute(server: Server, session: ClientSession | undefined, callback: Callback): void { + super.execute(server, session, err => { + if (err) return callback(err, false); + callback(undefined, true); + }); + } +} + +/** @public */ +export interface ListIndexesOptions extends CommandOperationOptions { + /** The batchSize for the returned command cursor or if pre 2.8 the systems batch collection */ + batchSize?: number; +} + +/** @internal */ +export class ListIndexesOperation extends CommandOperation { + override options: ListIndexesOptions; + collectionNamespace: MongoDBNamespace; + + constructor(collection: Collection, options?: ListIndexesOptions) { + super(collection, options); + + this.options = options ?? {}; + this.collectionNamespace = collection.s.namespace; + } + + override execute( + server: Server, + session: ClientSession | undefined, + callback: Callback + ): void { + const serverWireVersion = maxWireVersion(server); + + const cursor = this.options.batchSize ? { batchSize: this.options.batchSize } : {}; + + const command: Document = { listIndexes: this.collectionNamespace.collection, cursor }; + + // we check for undefined specifically here to allow falsy values + // eslint-disable-next-line no-restricted-syntax + if (serverWireVersion >= 9 && this.options.comment !== undefined) { + command.comment = this.options.comment; + } + + super.executeCommand(server, session, command, callback); + } +} + +/** @public */ +export class ListIndexesCursor extends AbstractCursor { + parent: Collection; + options?: ListIndexesOptions; + + constructor(collection: Collection, options?: ListIndexesOptions) { + super(collection.s.db.s.client, collection.s.namespace, options); + this.parent = collection; + this.options = options; + } + + clone(): ListIndexesCursor { + return new ListIndexesCursor(this.parent, { + ...this.options, + ...this.cursorOptions + }); + } + + /** @internal */ + _initialize(session: ClientSession | undefined, callback: Callback): void { + const operation = new ListIndexesOperation(this.parent, { + ...this.cursorOptions, + ...this.options, + session + }); + + executeOperation(this.parent.s.db.s.client, operation, (err, response) => { + if (err || response == null) return callback(err); + + // TODO: NODE-2882 + callback(undefined, { server: operation.server, session, response }); + }); + } +} + +/** @internal */ +export class IndexExistsOperation extends AbstractOperation { + override options: IndexInformationOptions; + collection: Collection; + indexes: string | string[]; + + constructor( + collection: Collection, + indexes: string | string[], + options: IndexInformationOptions + ) { + super(options); + this.options = options; + this.collection = collection; + this.indexes = indexes; + } + + override execute( + server: Server, + session: ClientSession | undefined, + callback: Callback + ): void { + const coll = this.collection; + const indexes = this.indexes; + + indexInformation( + coll.s.db, + coll.collectionName, + { ...this.options, readPreference: this.readPreference, session }, + (err, indexInformation) => { + // If we have an error return + if (err != null) return callback(err); + // Let's check for the index names + if (!Array.isArray(indexes)) return callback(undefined, indexInformation[indexes] != null); + // Check in list of indexes + for (let i = 0; i < indexes.length; i++) { + if (indexInformation[indexes[i]] == null) { + return callback(undefined, false); + } + } + + // All keys found return true + return callback(undefined, true); + } + ); + } +} + +/** @internal */ +export class IndexInformationOperation extends AbstractOperation { + override options: IndexInformationOptions; + db: Db; + name: string; + + constructor(db: Db, name: string, options?: IndexInformationOptions) { + super(options); + this.options = options ?? {}; + this.db = db; + this.name = name; + } + + override execute( + server: Server, + session: ClientSession | undefined, + callback: Callback + ): void { + const db = this.db; + const name = this.name; + + indexInformation( + db, + name, + { ...this.options, readPreference: this.readPreference, session }, + callback + ); + } +} + +defineAspects(ListIndexesOperation, [ + Aspect.READ_OPERATION, + Aspect.RETRYABLE, + Aspect.CURSOR_CREATING +]); +defineAspects(CreateIndexesOperation, [Aspect.WRITE_OPERATION]); +defineAspects(CreateIndexOperation, [Aspect.WRITE_OPERATION]); +defineAspects(EnsureIndexOperation, [Aspect.WRITE_OPERATION]); +defineAspects(DropIndexOperation, [Aspect.WRITE_OPERATION]); +defineAspects(DropIndexesOperation, [Aspect.WRITE_OPERATION]); diff --git a/node_modules/mongodb/src/operations/insert.ts b/node_modules/mongodb/src/operations/insert.ts new file mode 100644 index 000000000..6475a5cfe --- /dev/null +++ b/node_modules/mongodb/src/operations/insert.ts @@ -0,0 +1,158 @@ +import type { Document } from '../bson'; +import type { BulkWriteOptions } from '../bulk/common'; +import type { Collection } from '../collection'; +import { MongoInvalidArgumentError, MongoServerError } from '../error'; +import type { InferIdType } from '../mongo_types'; +import type { Server } from '../sdam/server'; +import type { ClientSession } from '../sessions'; +import type { Callback, MongoDBNamespace } from '../utils'; +import { WriteConcern } from '../write_concern'; +import { BulkWriteOperation } from './bulk_write'; +import { CommandOperation, CommandOperationOptions } from './command'; +import { prepareDocs } from './common_functions'; +import { AbstractOperation, Aspect, defineAspects } from './operation'; + +/** @internal */ +export class InsertOperation extends CommandOperation { + override options: BulkWriteOptions; + documents: Document[]; + + constructor(ns: MongoDBNamespace, documents: Document[], options: BulkWriteOptions) { + super(undefined, options); + this.options = { ...options, checkKeys: options.checkKeys ?? false }; + this.ns = ns; + this.documents = documents; + } + + override execute( + server: Server, + session: ClientSession | undefined, + callback: Callback + ): void { + const options = this.options ?? {}; + const ordered = typeof options.ordered === 'boolean' ? options.ordered : true; + const command: Document = { + insert: this.ns.collection, + documents: this.documents, + ordered + }; + + if (typeof options.bypassDocumentValidation === 'boolean') { + command.bypassDocumentValidation = options.bypassDocumentValidation; + } + + // we check for undefined specifically here to allow falsy values + // eslint-disable-next-line no-restricted-syntax + if (options.comment !== undefined) { + command.comment = options.comment; + } + + super.executeCommand(server, session, command, callback); + } +} + +/** @public */ +export interface InsertOneOptions extends CommandOperationOptions { + /** Allow driver to bypass schema validation in MongoDB 3.2 or higher. */ + bypassDocumentValidation?: boolean; + /** Force server to assign _id values instead of driver. */ + forceServerObjectId?: boolean; +} + +/** @public */ +export interface InsertOneResult { + /** Indicates whether this write result was acknowledged. If not, then all other members of this result will be undefined */ + acknowledged: boolean; + /** The identifier that was inserted. If the server generated the identifier, this value will be null as the driver does not have access to that data */ + insertedId: InferIdType; +} + +export class InsertOneOperation extends InsertOperation { + constructor(collection: Collection, doc: Document, options: InsertOneOptions) { + super(collection.s.namespace, prepareDocs(collection, [doc], options), options); + } + + override execute( + server: Server, + session: ClientSession | undefined, + callback: Callback + ): void { + super.execute(server, session, (err, res) => { + if (err || res == null) return callback(err); + if (res.code) return callback(new MongoServerError(res)); + if (res.writeErrors) { + // This should be a WriteError but we can't change it now because of error hierarchy + return callback(new MongoServerError(res.writeErrors[0])); + } + + callback(undefined, { + acknowledged: this.writeConcern?.w !== 0 ?? true, + insertedId: this.documents[0]._id + }); + }); + } +} + +/** @public */ +export interface InsertManyResult { + /** Indicates whether this write result was acknowledged. If not, then all other members of this result will be undefined */ + acknowledged: boolean; + /** The number of inserted documents for this operations */ + insertedCount: number; + /** Map of the index of the inserted document to the id of the inserted document */ + insertedIds: { [key: number]: InferIdType }; +} + +/** @internal */ +export class InsertManyOperation extends AbstractOperation { + override options: BulkWriteOptions; + collection: Collection; + docs: Document[]; + + constructor(collection: Collection, docs: Document[], options: BulkWriteOptions) { + super(options); + + if (!Array.isArray(docs)) { + throw new MongoInvalidArgumentError('Argument "docs" must be an array of documents'); + } + + this.options = options; + this.collection = collection; + this.docs = docs; + } + + override execute( + server: Server, + session: ClientSession | undefined, + callback: Callback + ): void { + const coll = this.collection; + const options = { ...this.options, ...this.bsonOptions, readPreference: this.readPreference }; + const writeConcern = WriteConcern.fromOptions(options); + const bulkWriteOperation = new BulkWriteOperation( + coll, + prepareDocs(coll, this.docs, options).map(document => ({ insertOne: { document } })), + options + ); + + bulkWriteOperation.execute(server, session, (err, res) => { + if (err || res == null) { + if (err && err.message === 'Operation must be an object with an operation key') { + err = new MongoInvalidArgumentError( + 'Collection.insertMany() cannot be called with an array that has null/undefined values' + ); + } + return callback(err); + } + callback(undefined, { + acknowledged: writeConcern?.w !== 0 ?? true, + insertedCount: res.insertedCount, + insertedIds: res.insertedIds + }); + }); + } +} + +defineAspects(InsertOperation, [Aspect.RETRYABLE, Aspect.WRITE_OPERATION]); +defineAspects(InsertOneOperation, [Aspect.RETRYABLE, Aspect.WRITE_OPERATION]); +defineAspects(InsertManyOperation, [Aspect.WRITE_OPERATION]); diff --git a/node_modules/mongodb/src/operations/is_capped.ts b/node_modules/mongodb/src/operations/is_capped.ts new file mode 100644 index 000000000..938c72f41 --- /dev/null +++ b/node_modules/mongodb/src/operations/is_capped.ts @@ -0,0 +1,42 @@ +import type { Collection } from '../collection'; +import { MongoAPIError } from '../error'; +import type { Server } from '../sdam/server'; +import type { ClientSession } from '../sessions'; +import type { Callback } from '../utils'; +import { AbstractOperation, OperationOptions } from './operation'; + +/** @internal */ +export class IsCappedOperation extends AbstractOperation { + override options: OperationOptions; + collection: Collection; + + constructor(collection: Collection, options: OperationOptions) { + super(options); + this.options = options; + this.collection = collection; + } + + override execute( + server: Server, + session: ClientSession | undefined, + callback: Callback + ): void { + const coll = this.collection; + + coll.s.db + .listCollections( + { name: coll.collectionName }, + { ...this.options, nameOnly: false, readPreference: this.readPreference, session } + ) + .toArray((err, collections) => { + if (err || !collections) return callback(err); + if (collections.length === 0) { + // TODO(NODE-3485) + return callback(new MongoAPIError(`collection ${coll.namespace} not found`)); + } + + const collOptions = collections[0].options; + callback(undefined, !!(collOptions && collOptions.capped)); + }); + } +} diff --git a/node_modules/mongodb/src/operations/list_collections.ts b/node_modules/mongodb/src/operations/list_collections.ts new file mode 100644 index 000000000..507b2c0b4 --- /dev/null +++ b/node_modules/mongodb/src/operations/list_collections.ts @@ -0,0 +1,134 @@ +import type { Binary, Document } from '../bson'; +import { AbstractCursor } from '../cursor/abstract_cursor'; +import type { Db } from '../db'; +import type { Server } from '../sdam/server'; +import type { ClientSession } from '../sessions'; +import { Callback, maxWireVersion } from '../utils'; +import { CommandOperation, CommandOperationOptions } from './command'; +import { executeOperation, ExecutionResult } from './execute_operation'; +import { Aspect, defineAspects } from './operation'; + +/** @public */ +export interface ListCollectionsOptions extends CommandOperationOptions { + /** Since 4.0: If true, will only return the collection name in the response, and will omit additional info */ + nameOnly?: boolean; + /** Since 4.0: If true and nameOnly is true, allows a user without the required privilege (i.e. listCollections action on the database) to run the command when access control is enforced. */ + authorizedCollections?: boolean; + /** The batchSize for the returned command cursor or if pre 2.8 the systems batch collection */ + batchSize?: number; +} + +/** @internal */ +export class ListCollectionsOperation extends CommandOperation { + override options: ListCollectionsOptions; + db: Db; + filter: Document; + nameOnly: boolean; + authorizedCollections: boolean; + batchSize?: number; + + constructor(db: Db, filter: Document, options?: ListCollectionsOptions) { + super(db, options); + + this.options = options ?? {}; + this.db = db; + this.filter = filter; + this.nameOnly = !!this.options.nameOnly; + this.authorizedCollections = !!this.options.authorizedCollections; + + if (typeof this.options.batchSize === 'number') { + this.batchSize = this.options.batchSize; + } + } + + override execute( + server: Server, + session: ClientSession | undefined, + callback: Callback + ): void { + return super.executeCommand( + server, + session, + this.generateCommand(maxWireVersion(server)), + callback + ); + } + + /* This is here for the purpose of unit testing the final command that gets sent. */ + generateCommand(wireVersion: number): Document { + const command: Document = { + listCollections: 1, + filter: this.filter, + cursor: this.batchSize ? { batchSize: this.batchSize } : {}, + nameOnly: this.nameOnly, + authorizedCollections: this.authorizedCollections + }; + + // we check for undefined specifically here to allow falsy values + // eslint-disable-next-line no-restricted-syntax + if (wireVersion >= 9 && this.options.comment !== undefined) { + command.comment = this.options.comment; + } + + return command; + } +} + +/** @public */ +export interface CollectionInfo extends Document { + name: string; + type?: string; + options?: Document; + info?: { + readOnly?: false; + uuid?: Binary; + }; + idIndex?: Document; +} + +/** @public */ +export class ListCollectionsCursor< + T extends Pick | CollectionInfo = + | Pick + | CollectionInfo +> extends AbstractCursor { + parent: Db; + filter: Document; + options?: ListCollectionsOptions; + + constructor(db: Db, filter: Document, options?: ListCollectionsOptions) { + super(db.s.client, db.s.namespace, options); + this.parent = db; + this.filter = filter; + this.options = options; + } + + clone(): ListCollectionsCursor { + return new ListCollectionsCursor(this.parent, this.filter, { + ...this.options, + ...this.cursorOptions + }); + } + + /** @internal */ + _initialize(session: ClientSession | undefined, callback: Callback): void { + const operation = new ListCollectionsOperation(this.parent, this.filter, { + ...this.cursorOptions, + ...this.options, + session + }); + + executeOperation(this.parent.s.client, operation, (err, response) => { + if (err || response == null) return callback(err); + + // TODO: NODE-2882 + callback(undefined, { server: operation.server, session, response }); + }); + } +} + +defineAspects(ListCollectionsOperation, [ + Aspect.READ_OPERATION, + Aspect.RETRYABLE, + Aspect.CURSOR_CREATING +]); diff --git a/node_modules/mongodb/src/operations/list_databases.ts b/node_modules/mongodb/src/operations/list_databases.ts new file mode 100644 index 000000000..537c95290 --- /dev/null +++ b/node_modules/mongodb/src/operations/list_databases.ts @@ -0,0 +1,65 @@ +import type { Document } from '../bson'; +import type { Db } from '../db'; +import type { Server } from '../sdam/server'; +import type { ClientSession } from '../sessions'; +import { Callback, maxWireVersion, MongoDBNamespace } from '../utils'; +import { CommandOperation, CommandOperationOptions } from './command'; +import { Aspect, defineAspects } from './operation'; + +/** @public */ +export interface ListDatabasesResult { + databases: ({ name: string; sizeOnDisk?: number; empty?: boolean } & Document)[]; + totalSize?: number; + totalSizeMb?: number; + ok: 1 | 0; +} + +/** @public */ +export interface ListDatabasesOptions extends CommandOperationOptions { + /** A query predicate that determines which databases are listed */ + filter?: Document; + /** A flag to indicate whether the command should return just the database names, or return both database names and size information */ + nameOnly?: boolean; + /** A flag that determines which databases are returned based on the user privileges when access control is enabled */ + authorizedDatabases?: boolean; +} + +/** @internal */ +export class ListDatabasesOperation extends CommandOperation { + override options: ListDatabasesOptions; + + constructor(db: Db, options?: ListDatabasesOptions) { + super(db, options); + this.options = options ?? {}; + this.ns = new MongoDBNamespace('admin', '$cmd'); + } + + override execute( + server: Server, + session: ClientSession | undefined, + callback: Callback + ): void { + const cmd: Document = { listDatabases: 1 }; + if (this.options.nameOnly) { + cmd.nameOnly = Number(cmd.nameOnly); + } + + if (this.options.filter) { + cmd.filter = this.options.filter; + } + + if (typeof this.options.authorizedDatabases === 'boolean') { + cmd.authorizedDatabases = this.options.authorizedDatabases; + } + + // we check for undefined specifically here to allow falsy values + // eslint-disable-next-line no-restricted-syntax + if (maxWireVersion(server) >= 9 && this.options.comment !== undefined) { + cmd.comment = this.options.comment; + } + + super.executeCommand(server, session, cmd, callback); + } +} + +defineAspects(ListDatabasesOperation, [Aspect.READ_OPERATION, Aspect.RETRYABLE]); diff --git a/node_modules/mongodb/src/operations/map_reduce.ts b/node_modules/mongodb/src/operations/map_reduce.ts new file mode 100644 index 000000000..f3134f45a --- /dev/null +++ b/node_modules/mongodb/src/operations/map_reduce.ts @@ -0,0 +1,250 @@ +import type { ObjectId } from '../bson'; +import { Code, Document } from '../bson'; +import type { Collection } from '../collection'; +import { MongoCompatibilityError, MongoServerError } from '../error'; +import { ReadPreference, ReadPreferenceMode } from '../read_preference'; +import type { Server } from '../sdam/server'; +import type { ClientSession } from '../sessions'; +import type { Sort } from '../sort'; +import { + applyWriteConcern, + Callback, + decorateWithCollation, + decorateWithReadConcern, + isObject, + maxWireVersion +} from '../utils'; +import { CommandOperation, CommandOperationOptions } from './command'; +import { Aspect, defineAspects } from './operation'; + +const exclusionList = [ + 'explain', + 'readPreference', + 'readConcern', + 'session', + 'bypassDocumentValidation', + 'writeConcern', + 'raw', + 'fieldsAsRaw', + 'promoteLongs', + 'promoteValues', + 'promoteBuffers', + 'bsonRegExp', + 'serializeFunctions', + 'ignoreUndefined', + 'enableUtf8Validation', + 'scope' // this option is reformatted thus exclude the original +]; + +/** @public */ +export type MapFunction = (this: TSchema) => void; +/** @public */ +export type ReduceFunction = (key: TKey, values: TValue[]) => TValue; +/** @public */ +export type FinalizeFunction = ( + key: TKey, + reducedValue: TValue +) => TValue; + +/** @public */ +export interface MapReduceOptions + extends CommandOperationOptions { + /** Sets the output target for the map reduce job. */ + out?: 'inline' | { inline: 1 } | { replace: string } | { merge: string } | { reduce: string }; + /** Query filter object. */ + query?: Document; + /** Sorts the input objects using this key. Useful for optimization, like sorting by the emit key for fewer reduces. */ + sort?: Sort; + /** Number of objects to return from collection. */ + limit?: number; + /** Keep temporary data. */ + keeptemp?: boolean; + /** Finalize function. */ + finalize?: FinalizeFunction | string; + /** Can pass in variables that can be access from map/reduce/finalize. */ + scope?: Document; + /** It is possible to make the execution stay in JS. Provided in MongoDB \> 2.0.X. */ + jsMode?: boolean; + /** Provide statistics on job execution time. */ + verbose?: boolean; + /** Allow driver to bypass schema validation in MongoDB 3.2 or higher. */ + bypassDocumentValidation?: boolean; +} + +interface MapReduceStats { + processtime?: number; + counts?: number; + timing?: number; +} + +/** + * Run Map Reduce across a collection. Be aware that the inline option for out will return an array of results not a collection. + * @internal + */ +export class MapReduceOperation extends CommandOperation { + override options: MapReduceOptions; + collection: Collection; + /** The mapping function. */ + map: MapFunction | string; + /** The reduce function. */ + reduce: ReduceFunction | string; + + /** + * Constructs a MapReduce operation. + * + * @param collection - Collection instance. + * @param map - The mapping function. + * @param reduce - The reduce function. + * @param options - Optional settings. See Collection.prototype.mapReduce for a list of options. + */ + constructor( + collection: Collection, + map: MapFunction | string, + reduce: ReduceFunction | string, + options?: MapReduceOptions + ) { + super(collection, options); + + this.options = options ?? {}; + this.collection = collection; + this.map = map; + this.reduce = reduce; + } + + override execute( + server: Server, + session: ClientSession | undefined, + callback: Callback + ): void { + const coll = this.collection; + const map = this.map; + const reduce = this.reduce; + let options = this.options; + + const mapCommandHash: Document = { + mapReduce: coll.collectionName, + map: map, + reduce: reduce + }; + + if (options.scope) { + mapCommandHash.scope = processScope(options.scope); + } + + // Add any other options passed in + for (const n in options) { + // Only include if not in exclusion list + if (exclusionList.indexOf(n) === -1) { + mapCommandHash[n] = (options as any)[n]; + } + } + + options = Object.assign({}, options); + + // If we have a read preference and inline is not set as output fail hard + if ( + this.readPreference.mode === ReadPreferenceMode.primary && + options.out && + (options.out as any).inline !== 1 && + options.out !== 'inline' + ) { + // Force readPreference to primary + options.readPreference = ReadPreference.primary; + // Decorate command with writeConcern if supported + applyWriteConcern(mapCommandHash, { db: coll.s.db, collection: coll }, options); + } else { + decorateWithReadConcern(mapCommandHash, coll, options); + } + + // Is bypassDocumentValidation specified + if (options.bypassDocumentValidation === true) { + mapCommandHash.bypassDocumentValidation = options.bypassDocumentValidation; + } + + // Have we specified collation + try { + decorateWithCollation(mapCommandHash, coll, options); + } catch (err) { + return callback(err); + } + + if (this.explain && maxWireVersion(server) < 9) { + callback( + new MongoCompatibilityError(`Server ${server.name} does not support explain on mapReduce`) + ); + return; + } + + // Execute command + super.executeCommand(server, session, mapCommandHash, (err, result) => { + if (err) return callback(err); + // Check if we have an error + if (1 !== result.ok || result.err || result.errmsg) { + return callback(new MongoServerError(result)); + } + + // If an explain option was executed, don't process the server results + if (this.explain) return callback(undefined, result); + + // Create statistics value + const stats: MapReduceStats = {}; + if (result.timeMillis) stats['processtime'] = result.timeMillis; + if (result.counts) stats['counts'] = result.counts; + if (result.timing) stats['timing'] = result.timing; + + // invoked with inline? + if (result.results) { + // If we wish for no verbosity + if (options['verbose'] == null || !options['verbose']) { + return callback(undefined, result.results); + } + + return callback(undefined, { results: result.results, stats: stats }); + } + + // The returned collection + let collection = null; + + // If we have an object it's a different db + if (result.result != null && typeof result.result === 'object') { + const doc = result.result; + // Return a collection from another db + collection = coll.s.db.s.client.db(doc.db, coll.s.db.s.options).collection(doc.collection); + } else { + // Create a collection object that wraps the result collection + collection = coll.s.db.collection(result.result); + } + + // If we wish for no verbosity + if (options['verbose'] == null || !options['verbose']) { + return callback(err, collection); + } + + // Return stats as third set of values + callback(err, { collection, stats }); + }); + } +} + +/** Functions that are passed as scope args must be converted to Code instances. */ +function processScope(scope: Document | ObjectId) { + if (!isObject(scope) || (scope as any)._bsontype === 'ObjectID') { + return scope; + } + + const newScope: Document = {}; + + for (const key of Object.keys(scope)) { + if ('function' === typeof (scope as Document)[key]) { + newScope[key] = new Code(String((scope as Document)[key])); + } else if ((scope as Document)[key]._bsontype === 'Code') { + newScope[key] = (scope as Document)[key]; + } else { + newScope[key] = processScope((scope as Document)[key]); + } + } + + return newScope; +} + +defineAspects(MapReduceOperation, [Aspect.EXPLAINABLE]); diff --git a/node_modules/mongodb/src/operations/operation.ts b/node_modules/mongodb/src/operations/operation.ts new file mode 100644 index 000000000..e21a87585 --- /dev/null +++ b/node_modules/mongodb/src/operations/operation.ts @@ -0,0 +1,121 @@ +import { BSONSerializeOptions, Document, resolveBSONOptions } from '../bson'; +import { ReadPreference, ReadPreferenceLike } from '../read_preference'; +import type { Server } from '../sdam/server'; +import type { ClientSession } from '../sessions'; +import type { Callback, MongoDBNamespace } from '../utils'; + +export const Aspect = { + READ_OPERATION: Symbol('READ_OPERATION'), + WRITE_OPERATION: Symbol('WRITE_OPERATION'), + RETRYABLE: Symbol('RETRYABLE'), + EXPLAINABLE: Symbol('EXPLAINABLE'), + SKIP_COLLATION: Symbol('SKIP_COLLATION'), + CURSOR_CREATING: Symbol('CURSOR_CREATING'), + CURSOR_ITERATING: Symbol('CURSOR_ITERATING') +} as const; + +/** @public */ +export type Hint = string | Document; + +export interface OperationConstructor extends Function { + aspects?: Set; +} + +/** @public */ +export interface OperationOptions extends BSONSerializeOptions { + /** Specify ClientSession for this command */ + session?: ClientSession; + willRetryWrite?: boolean; + + /** The preferred read preference (ReadPreference.primary, ReadPreference.primary_preferred, ReadPreference.secondary, ReadPreference.secondary_preferred, ReadPreference.nearest). */ + readPreference?: ReadPreferenceLike; + + /** @internal Hints to `executeOperation` that this operation should not unpin on an ended transaction */ + bypassPinningCheck?: boolean; + omitReadPreference?: boolean; +} + +/** @internal */ +const kSession = Symbol('session'); + +/** + * This class acts as a parent class for any operation and is responsible for setting this.options, + * as well as setting and getting a session. + * Additionally, this class implements `hasAspect`, which determines whether an operation has + * a specific aspect. + * @internal + */ +export abstract class AbstractOperation { + ns!: MongoDBNamespace; + cmd!: Document; + readPreference: ReadPreference; + server!: Server; + bypassPinningCheck: boolean; + trySecondaryWrite: boolean; + + // BSON serialization options + bsonOptions?: BSONSerializeOptions; + + options: OperationOptions; + + [kSession]: ClientSession | undefined; + + constructor(options: OperationOptions = {}) { + this.readPreference = this.hasAspect(Aspect.WRITE_OPERATION) + ? ReadPreference.primary + : ReadPreference.fromOptions(options) ?? ReadPreference.primary; + + // Pull the BSON serialize options from the already-resolved options + this.bsonOptions = resolveBSONOptions(options); + + this[kSession] = options.session != null ? options.session : undefined; + + this.options = options; + this.bypassPinningCheck = !!options.bypassPinningCheck; + this.trySecondaryWrite = false; + } + + abstract execute( + server: Server, + session: ClientSession | undefined, + callback: Callback + ): void; + + hasAspect(aspect: symbol): boolean { + const ctor = this.constructor as OperationConstructor; + if (ctor.aspects == null) { + return false; + } + + return ctor.aspects.has(aspect); + } + + get session(): ClientSession | undefined { + return this[kSession]; + } + + get canRetryRead(): boolean { + return true; + } + + get canRetryWrite(): boolean { + return true; + } +} + +export function defineAspects( + operation: OperationConstructor, + aspects: symbol | symbol[] | Set +): Set { + if (!Array.isArray(aspects) && !(aspects instanceof Set)) { + aspects = [aspects]; + } + + aspects = new Set(aspects); + Object.defineProperty(operation, 'aspects', { + value: aspects, + writable: false + }); + + return aspects; +} diff --git a/node_modules/mongodb/src/operations/options_operation.ts b/node_modules/mongodb/src/operations/options_operation.ts new file mode 100644 index 000000000..27853d34e --- /dev/null +++ b/node_modules/mongodb/src/operations/options_operation.ts @@ -0,0 +1,42 @@ +import type { Document } from '../bson'; +import type { Collection } from '../collection'; +import { MongoAPIError } from '../error'; +import type { Server } from '../sdam/server'; +import type { ClientSession } from '../sessions'; +import type { Callback } from '../utils'; +import { AbstractOperation, OperationOptions } from './operation'; + +/** @internal */ +export class OptionsOperation extends AbstractOperation { + override options: OperationOptions; + collection: Collection; + + constructor(collection: Collection, options: OperationOptions) { + super(options); + this.options = options; + this.collection = collection; + } + + override execute( + server: Server, + session: ClientSession | undefined, + callback: Callback + ): void { + const coll = this.collection; + + coll.s.db + .listCollections( + { name: coll.collectionName }, + { ...this.options, nameOnly: false, readPreference: this.readPreference, session } + ) + .toArray((err, collections) => { + if (err || !collections) return callback(err); + if (collections.length === 0) { + // TODO(NODE-3485) + return callback(new MongoAPIError(`collection ${coll.namespace} not found`)); + } + + callback(err, collections[0].options); + }); + } +} diff --git a/node_modules/mongodb/src/operations/profiling_level.ts b/node_modules/mongodb/src/operations/profiling_level.ts new file mode 100644 index 000000000..defe6b0d5 --- /dev/null +++ b/node_modules/mongodb/src/operations/profiling_level.ts @@ -0,0 +1,39 @@ +import type { Db } from '../db'; +import { MongoRuntimeError } from '../error'; +import type { Server } from '../sdam/server'; +import type { ClientSession } from '../sessions'; +import type { Callback } from '../utils'; +import { CommandOperation, CommandOperationOptions } from './command'; + +/** @public */ +export type ProfilingLevelOptions = CommandOperationOptions; + +/** @internal */ +export class ProfilingLevelOperation extends CommandOperation { + override options: ProfilingLevelOptions; + + constructor(db: Db, options: ProfilingLevelOptions) { + super(db, options); + this.options = options; + } + + override execute( + server: Server, + session: ClientSession | undefined, + callback: Callback + ): void { + super.executeCommand(server, session, { profile: -1 }, (err, doc) => { + if (err == null && doc.ok === 1) { + const was = doc.was; + if (was === 0) return callback(undefined, 'off'); + if (was === 1) return callback(undefined, 'slow_only'); + if (was === 2) return callback(undefined, 'all'); + // TODO(NODE-3483) + return callback(new MongoRuntimeError(`Illegal profiling level value ${was}`)); + } else { + // TODO(NODE-3483): Consider MongoUnexpectedServerResponseError + err != null ? callback(err) : callback(new MongoRuntimeError('Error with profile command')); + } + }); + } +} diff --git a/node_modules/mongodb/src/operations/remove_user.ts b/node_modules/mongodb/src/operations/remove_user.ts new file mode 100644 index 000000000..f32c19c24 --- /dev/null +++ b/node_modules/mongodb/src/operations/remove_user.ts @@ -0,0 +1,33 @@ +import type { Db } from '../db'; +import type { Server } from '../sdam/server'; +import type { ClientSession } from '../sessions'; +import type { Callback } from '../utils'; +import { CommandOperation, CommandOperationOptions } from './command'; +import { Aspect, defineAspects } from './operation'; + +/** @public */ +export type RemoveUserOptions = CommandOperationOptions; + +/** @internal */ +export class RemoveUserOperation extends CommandOperation { + override options: RemoveUserOptions; + username: string; + + constructor(db: Db, username: string, options: RemoveUserOptions) { + super(db, options); + this.options = options; + this.username = username; + } + + override execute( + server: Server, + session: ClientSession | undefined, + callback: Callback + ): void { + super.executeCommand(server, session, { dropUser: this.username }, err => { + callback(err, err ? false : true); + }); + } +} + +defineAspects(RemoveUserOperation, [Aspect.WRITE_OPERATION]); diff --git a/node_modules/mongodb/src/operations/rename.ts b/node_modules/mongodb/src/operations/rename.ts new file mode 100644 index 000000000..02e27a5bf --- /dev/null +++ b/node_modules/mongodb/src/operations/rename.ts @@ -0,0 +1,67 @@ +import type { Document } from '../bson'; +import { Collection } from '../collection'; +import { MongoServerError } from '../error'; +import type { Server } from '../sdam/server'; +import type { ClientSession } from '../sessions'; +import { Callback, checkCollectionName } from '../utils'; +import type { CommandOperationOptions } from './command'; +import { Aspect, defineAspects } from './operation'; +import { RunAdminCommandOperation } from './run_command'; + +/** @public */ +export interface RenameOptions extends CommandOperationOptions { + /** Drop the target name collection if it previously exists. */ + dropTarget?: boolean; + /** Unclear */ + new_collection?: boolean; +} + +/** @internal */ +export class RenameOperation extends RunAdminCommandOperation { + override options: RenameOptions; + collection: Collection; + newName: string; + + constructor(collection: Collection, newName: string, options: RenameOptions) { + // Check the collection name + checkCollectionName(newName); + + // Build the command + const renameCollection = collection.namespace; + const toCollection = collection.s.namespace.withCollection(newName).toString(); + const dropTarget = typeof options.dropTarget === 'boolean' ? options.dropTarget : false; + const cmd = { renameCollection: renameCollection, to: toCollection, dropTarget: dropTarget }; + + super(collection, cmd, options); + this.options = options; + this.collection = collection; + this.newName = newName; + } + + override execute( + server: Server, + session: ClientSession | undefined, + callback: Callback + ): void { + const coll = this.collection; + + super.execute(server, session, (err, doc) => { + if (err) return callback(err); + // We have an error + if (doc?.errmsg) { + return callback(new MongoServerError(doc)); + } + + let newColl: Collection; + try { + newColl = new Collection(coll.s.db, this.newName, coll.s.options); + } catch (err) { + return callback(err); + } + + return callback(undefined, newColl); + }); + } +} + +defineAspects(RenameOperation, [Aspect.WRITE_OPERATION]); diff --git a/node_modules/mongodb/src/operations/run_command.ts b/node_modules/mongodb/src/operations/run_command.ts new file mode 100644 index 000000000..b92237a9a --- /dev/null +++ b/node_modules/mongodb/src/operations/run_command.ts @@ -0,0 +1,36 @@ +import type { Document } from '../bson'; +import type { Server } from '../sdam/server'; +import type { ClientSession } from '../sessions'; +import { Callback, MongoDBNamespace } from '../utils'; +import { CommandOperation, CommandOperationOptions, OperationParent } from './command'; + +/** @public */ +export type RunCommandOptions = CommandOperationOptions; + +/** @internal */ +export class RunCommandOperation extends CommandOperation { + override options: RunCommandOptions; + command: Document; + + constructor(parent: OperationParent | undefined, command: Document, options?: RunCommandOptions) { + super(parent, options); + this.options = options ?? {}; + this.command = command; + } + + override execute( + server: Server, + session: ClientSession | undefined, + callback: Callback + ): void { + const command = this.command; + this.executeCommand(server, session, command, callback); + } +} + +export class RunAdminCommandOperation extends RunCommandOperation { + constructor(parent: OperationParent | undefined, command: Document, options?: RunCommandOptions) { + super(parent, command, options); + this.ns = new MongoDBNamespace('admin'); + } +} diff --git a/node_modules/mongodb/src/operations/set_profiling_level.ts b/node_modules/mongodb/src/operations/set_profiling_level.ts new file mode 100644 index 000000000..6fc8502dc --- /dev/null +++ b/node_modules/mongodb/src/operations/set_profiling_level.ts @@ -0,0 +1,74 @@ +import type { Db } from '../db'; +import { MongoInvalidArgumentError, MongoRuntimeError } from '../error'; +import type { Server } from '../sdam/server'; +import type { ClientSession } from '../sessions'; +import type { Callback } from '../utils'; +import { enumToString } from '../utils'; +import { CommandOperation, CommandOperationOptions } from './command'; + +const levelValues = new Set(['off', 'slow_only', 'all']); + +/** @public */ +export const ProfilingLevel = Object.freeze({ + off: 'off', + slowOnly: 'slow_only', + all: 'all' +} as const); + +/** @public */ +export type ProfilingLevel = typeof ProfilingLevel[keyof typeof ProfilingLevel]; + +/** @public */ +export type SetProfilingLevelOptions = CommandOperationOptions; + +/** @internal */ +export class SetProfilingLevelOperation extends CommandOperation { + override options: SetProfilingLevelOptions; + level: ProfilingLevel; + profile: 0 | 1 | 2; + + constructor(db: Db, level: ProfilingLevel, options: SetProfilingLevelOptions) { + super(db, options); + this.options = options; + switch (level) { + case ProfilingLevel.off: + this.profile = 0; + break; + case ProfilingLevel.slowOnly: + this.profile = 1; + break; + case ProfilingLevel.all: + this.profile = 2; + break; + default: + this.profile = 0; + break; + } + + this.level = level; + } + + override execute( + server: Server, + session: ClientSession | undefined, + callback: Callback + ): void { + const level = this.level; + + if (!levelValues.has(level)) { + return callback( + new MongoInvalidArgumentError( + `Profiling level must be one of "${enumToString(ProfilingLevel)}"` + ) + ); + } + + // TODO(NODE-3483): Determine error to put here + super.executeCommand(server, session, { profile: this.profile }, (err, doc) => { + if (err == null && doc.ok === 1) return callback(undefined, level); + return err != null + ? callback(err) + : callback(new MongoRuntimeError('Error with profile command')); + }); + } +} diff --git a/node_modules/mongodb/src/operations/stats.ts b/node_modules/mongodb/src/operations/stats.ts new file mode 100644 index 000000000..b63a70de3 --- /dev/null +++ b/node_modules/mongodb/src/operations/stats.ts @@ -0,0 +1,271 @@ +import type { Document } from '../bson'; +import type { Collection } from '../collection'; +import type { Db } from '../db'; +import type { Server } from '../sdam/server'; +import type { ClientSession } from '../sessions'; +import type { Callback } from '../utils'; +import { CommandOperation, CommandOperationOptions } from './command'; +import { Aspect, defineAspects } from './operation'; + +/** @public */ +export interface CollStatsOptions extends CommandOperationOptions { + /** Divide the returned sizes by scale value. */ + scale?: number; +} + +/** + * Get all the collection statistics. + * @internal + */ +export class CollStatsOperation extends CommandOperation { + override options: CollStatsOptions; + collectionName: string; + + /** + * Construct a Stats operation. + * + * @param collection - Collection instance + * @param options - Optional settings. See Collection.prototype.stats for a list of options. + */ + constructor(collection: Collection, options?: CollStatsOptions) { + super(collection, options); + this.options = options ?? {}; + this.collectionName = collection.collectionName; + } + + override execute( + server: Server, + session: ClientSession | undefined, + callback: Callback + ): void { + const command: Document = { collStats: this.collectionName }; + if (this.options.scale != null) { + command.scale = this.options.scale; + } + + super.executeCommand(server, session, command, callback); + } +} + +/** @public */ +export interface DbStatsOptions extends CommandOperationOptions { + /** Divide the returned sizes by scale value. */ + scale?: number; +} + +/** @internal */ +export class DbStatsOperation extends CommandOperation { + override options: DbStatsOptions; + + constructor(db: Db, options: DbStatsOptions) { + super(db, options); + this.options = options; + } + + override execute( + server: Server, + session: ClientSession | undefined, + callback: Callback + ): void { + const command: Document = { dbStats: true }; + if (this.options.scale != null) { + command.scale = this.options.scale; + } + + super.executeCommand(server, session, command, callback); + } +} + +/** + * @public + * @see https://docs.mongodb.org/manual/reference/command/collStats/ + */ +export interface CollStats extends Document { + /** Namespace */ + ns: string; + /** Number of documents */ + count: number; + /** Collection size in bytes */ + size: number; + /** Average object size in bytes */ + avgObjSize: number; + /** (Pre)allocated space for the collection in bytes */ + storageSize: number; + /** Number of extents (contiguously allocated chunks of datafile space) */ + numExtents: number; + /** Number of indexes */ + nindexes: number; + /** Size of the most recently created extent in bytes */ + lastExtentSize: number; + /** Padding can speed up updates if documents grow */ + paddingFactor: number; + /** A number that indicates the user-set flags on the collection. userFlags only appears when using the mmapv1 storage engine */ + userFlags?: number; + /** Total index size in bytes */ + totalIndexSize: number; + /** Size of specific indexes in bytes */ + indexSizes: { + _id_: number; + [index: string]: number; + }; + /** `true` if the collection is capped */ + capped: boolean; + /** The maximum number of documents that may be present in a capped collection */ + max: number; + /** The maximum size of a capped collection */ + maxSize: number; + /** This document contains data reported directly by the WiredTiger engine and other data for internal diagnostic use */ + wiredTiger?: WiredTigerData; + /** The fields in this document are the names of the indexes, while the values themselves are documents that contain statistics for the index provided by the storage engine */ + indexDetails?: any; + ok: number; + + /** The amount of storage available for reuse. The scale argument affects this value. */ + freeStorageSize?: number; + /** An array that contains the names of the indexes that are currently being built on the collection */ + indexBuilds?: number; + /** The sum of the storageSize and totalIndexSize. The scale argument affects this value */ + totalSize: number; + /** The scale value used by the command. */ + scaleFactor: number; +} + +/** @public */ +export interface WiredTigerData extends Document { + LSM: { + 'bloom filter false positives': number; + 'bloom filter hits': number; + 'bloom filter misses': number; + 'bloom filter pages evicted from cache': number; + 'bloom filter pages read into cache': number; + 'bloom filters in the LSM tree': number; + 'chunks in the LSM tree': number; + 'highest merge generation in the LSM tree': number; + 'queries that could have benefited from a Bloom filter that did not exist': number; + 'sleep for LSM checkpoint throttle': number; + 'sleep for LSM merge throttle': number; + 'total size of bloom filters': number; + } & Document; + 'block-manager': { + 'allocations requiring file extension': number; + 'blocks allocated': number; + 'blocks freed': number; + 'checkpoint size': number; + 'file allocation unit size': number; + 'file bytes available for reuse': number; + 'file magic number': number; + 'file major version number': number; + 'file size in bytes': number; + 'minor version number': number; + }; + btree: { + 'btree checkpoint generation': number; + 'column-store fixed-size leaf pages': number; + 'column-store internal pages': number; + 'column-store variable-size RLE encoded values': number; + 'column-store variable-size deleted values': number; + 'column-store variable-size leaf pages': number; + 'fixed-record size': number; + 'maximum internal page key size': number; + 'maximum internal page size': number; + 'maximum leaf page key size': number; + 'maximum leaf page size': number; + 'maximum leaf page value size': number; + 'maximum tree depth': number; + 'number of key/value pairs': number; + 'overflow pages': number; + 'pages rewritten by compaction': number; + 'row-store internal pages': number; + 'row-store leaf pages': number; + } & Document; + cache: { + 'bytes currently in the cache': number; + 'bytes read into cache': number; + 'bytes written from cache': number; + 'checkpoint blocked page eviction': number; + 'data source pages selected for eviction unable to be evicted': number; + 'hazard pointer blocked page eviction': number; + 'in-memory page passed criteria to be split': number; + 'in-memory page splits': number; + 'internal pages evicted': number; + 'internal pages split during eviction': number; + 'leaf pages split during eviction': number; + 'modified pages evicted': number; + 'overflow pages read into cache': number; + 'overflow values cached in memory': number; + 'page split during eviction deepened the tree': number; + 'page written requiring lookaside records': number; + 'pages read into cache': number; + 'pages read into cache requiring lookaside entries': number; + 'pages requested from the cache': number; + 'pages written from cache': number; + 'pages written requiring in-memory restoration': number; + 'tracked dirty bytes in the cache': number; + 'unmodified pages evicted': number; + } & Document; + cache_walk: { + 'Average difference between current eviction generation when the page was last considered': number; + 'Average on-disk page image size seen': number; + 'Clean pages currently in cache': number; + 'Current eviction generation': number; + 'Dirty pages currently in cache': number; + 'Entries in the root page': number; + 'Internal pages currently in cache': number; + 'Leaf pages currently in cache': number; + 'Maximum difference between current eviction generation when the page was last considered': number; + 'Maximum page size seen': number; + 'Minimum on-disk page image size seen': number; + 'On-disk page image sizes smaller than a single allocation unit': number; + 'Pages created in memory and never written': number; + 'Pages currently queued for eviction': number; + 'Pages that could not be queued for eviction': number; + 'Refs skipped during cache traversal': number; + 'Size of the root page': number; + 'Total number of pages currently in cache': number; + } & Document; + compression: { + 'compressed pages read': number; + 'compressed pages written': number; + 'page written failed to compress': number; + 'page written was too small to compress': number; + 'raw compression call failed, additional data available': number; + 'raw compression call failed, no additional data available': number; + 'raw compression call succeeded': number; + } & Document; + cursor: { + 'bulk-loaded cursor-insert calls': number; + 'create calls': number; + 'cursor-insert key and value bytes inserted': number; + 'cursor-remove key bytes removed': number; + 'cursor-update value bytes updated': number; + 'insert calls': number; + 'next calls': number; + 'prev calls': number; + 'remove calls': number; + 'reset calls': number; + 'restarted searches': number; + 'search calls': number; + 'search near calls': number; + 'truncate calls': number; + 'update calls': number; + }; + reconciliation: { + 'dictionary matches': number; + 'fast-path pages deleted': number; + 'internal page key bytes discarded using suffix compression': number; + 'internal page multi-block writes': number; + 'internal-page overflow keys': number; + 'leaf page key bytes discarded using prefix compression': number; + 'leaf page multi-block writes': number; + 'leaf-page overflow keys': number; + 'maximum blocks required for a page': number; + 'overflow values written': number; + 'page checksum matches': number; + 'page reconciliation calls': number; + 'page reconciliation calls for eviction': number; + 'pages deleted': number; + } & Document; +} + +defineAspects(CollStatsOperation, [Aspect.READ_OPERATION]); +defineAspects(DbStatsOperation, [Aspect.READ_OPERATION]); diff --git a/node_modules/mongodb/src/operations/update.ts b/node_modules/mongodb/src/operations/update.ts new file mode 100644 index 000000000..a389878a1 --- /dev/null +++ b/node_modules/mongodb/src/operations/update.ts @@ -0,0 +1,334 @@ +import type { Document, ObjectId } from '../bson'; +import type { Collection } from '../collection'; +import { MongoCompatibilityError, MongoInvalidArgumentError, MongoServerError } from '../error'; +import type { Server } from '../sdam/server'; +import type { ClientSession } from '../sessions'; +import { + Callback, + collationNotSupported, + hasAtomicOperators, + maxWireVersion, + MongoDBNamespace +} from '../utils'; +import { CollationOptions, CommandOperation, CommandOperationOptions } from './command'; +import { Aspect, defineAspects, Hint } from './operation'; + +/** @public */ +export interface UpdateOptions extends CommandOperationOptions { + /** A set of filters specifying to which array elements an update should apply */ + arrayFilters?: Document[]; + /** If true, allows the write to opt-out of document level validation */ + bypassDocumentValidation?: boolean; + /** Specifies a collation */ + collation?: CollationOptions; + /** Specify that the update query should only consider plans using the hinted index */ + hint?: string | Document; + /** When true, creates a new document if no document matches the query */ + upsert?: boolean; + /** Map of parameter names and values that can be accessed using $$var (requires MongoDB 5.0). */ + let?: Document; +} + +/** @public */ +export interface UpdateResult { + /** Indicates whether this write result was acknowledged. If not, then all other members of this result will be undefined */ + acknowledged: boolean; + /** The number of documents that matched the filter */ + matchedCount: number; + /** The number of documents that were modified */ + modifiedCount: number; + /** The number of documents that were upserted */ + upsertedCount: number; + /** The identifier of the inserted document if an upsert took place */ + upsertedId: ObjectId; +} + +/** @public */ +export interface UpdateStatement { + /** The query that matches documents to update. */ + q: Document; + /** The modifications to apply. */ + u: Document | Document[]; + /** If true, perform an insert if no documents match the query. */ + upsert?: boolean; + /** If true, updates all documents that meet the query criteria. */ + multi?: boolean; + /** Specifies the collation to use for the operation. */ + collation?: CollationOptions; + /** An array of filter documents that determines which array elements to modify for an update operation on an array field. */ + arrayFilters?: Document[]; + /** A document or string that specifies the index to use to support the query predicate. */ + hint?: Hint; +} + +/** @internal */ +export class UpdateOperation extends CommandOperation { + override options: UpdateOptions & { ordered?: boolean }; + statements: UpdateStatement[]; + + constructor( + ns: MongoDBNamespace, + statements: UpdateStatement[], + options: UpdateOptions & { ordered?: boolean } + ) { + super(undefined, options); + this.options = options; + this.ns = ns; + + this.statements = statements; + } + + override get canRetryWrite(): boolean { + if (super.canRetryWrite === false) { + return false; + } + + return this.statements.every(op => op.multi == null || op.multi === false); + } + + override execute( + server: Server, + session: ClientSession | undefined, + callback: Callback + ): void { + const options = this.options ?? {}; + const ordered = typeof options.ordered === 'boolean' ? options.ordered : true; + const command: Document = { + update: this.ns.collection, + updates: this.statements, + ordered + }; + + if (typeof options.bypassDocumentValidation === 'boolean') { + command.bypassDocumentValidation = options.bypassDocumentValidation; + } + + if (options.let) { + command.let = options.let; + } + + // we check for undefined specifically here to allow falsy values + // eslint-disable-next-line no-restricted-syntax + if (options.comment !== undefined) { + command.comment = options.comment; + } + + const statementWithCollation = this.statements.find(statement => !!statement.collation); + if ( + collationNotSupported(server, options) || + (statementWithCollation && collationNotSupported(server, statementWithCollation)) + ) { + callback(new MongoCompatibilityError(`Server ${server.name} does not support collation`)); + return; + } + + const unacknowledgedWrite = this.writeConcern && this.writeConcern.w === 0; + if (unacknowledgedWrite || maxWireVersion(server) < 5) { + if (this.statements.find((o: Document) => o.hint)) { + callback(new MongoCompatibilityError(`Servers < 3.4 do not support hint on update`)); + return; + } + } + + if (this.explain && maxWireVersion(server) < 3) { + callback( + new MongoCompatibilityError(`Server ${server.name} does not support explain on update`) + ); + return; + } + + if (this.statements.some(statement => !!statement.arrayFilters) && maxWireVersion(server) < 6) { + callback( + new MongoCompatibilityError('Option "arrayFilters" is only supported on MongoDB 3.6+') + ); + return; + } + + super.executeCommand(server, session, command, callback); + } +} + +/** @internal */ +export class UpdateOneOperation extends UpdateOperation { + constructor(collection: Collection, filter: Document, update: Document, options: UpdateOptions) { + super( + collection.s.namespace, + [makeUpdateStatement(filter, update, { ...options, multi: false })], + options + ); + + if (!hasAtomicOperators(update)) { + throw new MongoInvalidArgumentError('Update document requires atomic operators'); + } + } + + override execute( + server: Server, + session: ClientSession | undefined, + callback: Callback + ): void { + super.execute(server, session, (err, res) => { + if (err || !res) return callback(err); + if (this.explain != null) return callback(undefined, res); + if (res.code) return callback(new MongoServerError(res)); + if (res.writeErrors) return callback(new MongoServerError(res.writeErrors[0])); + + callback(undefined, { + acknowledged: this.writeConcern?.w !== 0 ?? true, + modifiedCount: res.nModified != null ? res.nModified : res.n, + upsertedId: + Array.isArray(res.upserted) && res.upserted.length > 0 ? res.upserted[0]._id : null, + upsertedCount: Array.isArray(res.upserted) && res.upserted.length ? res.upserted.length : 0, + matchedCount: Array.isArray(res.upserted) && res.upserted.length > 0 ? 0 : res.n + }); + }); + } +} + +/** @internal */ +export class UpdateManyOperation extends UpdateOperation { + constructor(collection: Collection, filter: Document, update: Document, options: UpdateOptions) { + super( + collection.s.namespace, + [makeUpdateStatement(filter, update, { ...options, multi: true })], + options + ); + + if (!hasAtomicOperators(update)) { + throw new MongoInvalidArgumentError('Update document requires atomic operators'); + } + } + + override execute( + server: Server, + session: ClientSession | undefined, + callback: Callback + ): void { + super.execute(server, session, (err, res) => { + if (err || !res) return callback(err); + if (this.explain != null) return callback(undefined, res); + if (res.code) return callback(new MongoServerError(res)); + if (res.writeErrors) return callback(new MongoServerError(res.writeErrors[0])); + + callback(undefined, { + acknowledged: this.writeConcern?.w !== 0 ?? true, + modifiedCount: res.nModified != null ? res.nModified : res.n, + upsertedId: + Array.isArray(res.upserted) && res.upserted.length > 0 ? res.upserted[0]._id : null, + upsertedCount: Array.isArray(res.upserted) && res.upserted.length ? res.upserted.length : 0, + matchedCount: Array.isArray(res.upserted) && res.upserted.length > 0 ? 0 : res.n + }); + }); + } +} + +/** @public */ +export interface ReplaceOptions extends CommandOperationOptions { + /** If true, allows the write to opt-out of document level validation */ + bypassDocumentValidation?: boolean; + /** Specifies a collation */ + collation?: CollationOptions; + /** Specify that the update query should only consider plans using the hinted index */ + hint?: string | Document; + /** When true, creates a new document if no document matches the query */ + upsert?: boolean; + /** Map of parameter names and values that can be accessed using $$var (requires MongoDB 5.0). */ + let?: Document; +} + +/** @internal */ +export class ReplaceOneOperation extends UpdateOperation { + constructor( + collection: Collection, + filter: Document, + replacement: Document, + options: ReplaceOptions + ) { + super( + collection.s.namespace, + [makeUpdateStatement(filter, replacement, { ...options, multi: false })], + options + ); + + if (hasAtomicOperators(replacement)) { + throw new MongoInvalidArgumentError('Replacement document must not contain atomic operators'); + } + } + + override execute( + server: Server, + session: ClientSession | undefined, + callback: Callback + ): void { + super.execute(server, session, (err, res) => { + if (err || !res) return callback(err); + if (this.explain != null) return callback(undefined, res); + if (res.code) return callback(new MongoServerError(res)); + if (res.writeErrors) return callback(new MongoServerError(res.writeErrors[0])); + + callback(undefined, { + acknowledged: this.writeConcern?.w !== 0 ?? true, + modifiedCount: res.nModified != null ? res.nModified : res.n, + upsertedId: + Array.isArray(res.upserted) && res.upserted.length > 0 ? res.upserted[0]._id : null, + upsertedCount: Array.isArray(res.upserted) && res.upserted.length ? res.upserted.length : 0, + matchedCount: Array.isArray(res.upserted) && res.upserted.length > 0 ? 0 : res.n + }); + }); + } +} + +export function makeUpdateStatement( + filter: Document, + update: Document, + options: UpdateOptions & { multi?: boolean } +): UpdateStatement { + if (filter == null || typeof filter !== 'object') { + throw new MongoInvalidArgumentError('Selector must be a valid JavaScript object'); + } + + if (update == null || typeof update !== 'object') { + throw new MongoInvalidArgumentError('Document must be a valid JavaScript object'); + } + + const op: UpdateStatement = { q: filter, u: update }; + if (typeof options.upsert === 'boolean') { + op.upsert = options.upsert; + } + + if (options.multi) { + op.multi = options.multi; + } + + if (options.hint) { + op.hint = options.hint; + } + + if (options.arrayFilters) { + op.arrayFilters = options.arrayFilters; + } + + if (options.collation) { + op.collation = options.collation; + } + + return op; +} + +defineAspects(UpdateOperation, [Aspect.RETRYABLE, Aspect.WRITE_OPERATION, Aspect.SKIP_COLLATION]); +defineAspects(UpdateOneOperation, [ + Aspect.RETRYABLE, + Aspect.WRITE_OPERATION, + Aspect.EXPLAINABLE, + Aspect.SKIP_COLLATION +]); +defineAspects(UpdateManyOperation, [ + Aspect.WRITE_OPERATION, + Aspect.EXPLAINABLE, + Aspect.SKIP_COLLATION +]); +defineAspects(ReplaceOneOperation, [ + Aspect.RETRYABLE, + Aspect.WRITE_OPERATION, + Aspect.SKIP_COLLATION +]); diff --git a/node_modules/mongodb/src/operations/validate_collection.ts b/node_modules/mongodb/src/operations/validate_collection.ts new file mode 100644 index 000000000..ba6c85fad --- /dev/null +++ b/node_modules/mongodb/src/operations/validate_collection.ts @@ -0,0 +1,59 @@ +import type { Admin } from '../admin'; +import type { Document } from '../bson'; +import { MongoRuntimeError } from '../error'; +import type { Server } from '../sdam/server'; +import type { ClientSession } from '../sessions'; +import type { Callback } from '../utils'; +import { CommandOperation, CommandOperationOptions } from './command'; + +/** @public */ +export interface ValidateCollectionOptions extends CommandOperationOptions { + /** Validates a collection in the background, without interrupting read or write traffic (only in MongoDB 4.4+) */ + background?: boolean; +} + +/** @internal */ +export class ValidateCollectionOperation extends CommandOperation { + override options: ValidateCollectionOptions; + collectionName: string; + command: Document; + + constructor(admin: Admin, collectionName: string, options: ValidateCollectionOptions) { + // Decorate command with extra options + const command: Document = { validate: collectionName }; + const keys = Object.keys(options); + for (let i = 0; i < keys.length; i++) { + if (Object.prototype.hasOwnProperty.call(options, keys[i]) && keys[i] !== 'session') { + command[keys[i]] = (options as Document)[keys[i]]; + } + } + + super(admin.s.db, options); + this.options = options; + this.command = command; + this.collectionName = collectionName; + } + + override execute( + server: Server, + session: ClientSession | undefined, + callback: Callback + ): void { + const collectionName = this.collectionName; + + super.executeCommand(server, session, this.command, (err, doc) => { + if (err != null) return callback(err); + + // TODO(NODE-3483): Replace these with MongoUnexpectedServerResponseError + if (doc.ok === 0) return callback(new MongoRuntimeError('Error with validate command')); + if (doc.result != null && typeof doc.result !== 'string') + return callback(new MongoRuntimeError('Error with validation data')); + if (doc.result != null && doc.result.match(/exception|corrupt/) != null) + return callback(new MongoRuntimeError(`Invalid collection ${collectionName}`)); + if (doc.valid != null && !doc.valid) + return callback(new MongoRuntimeError(`Invalid collection ${collectionName}`)); + + return callback(undefined, doc); + }); + } +} diff --git a/node_modules/mongodb/src/promise_provider.ts b/node_modules/mongodb/src/promise_provider.ts new file mode 100644 index 000000000..a6aeb548e --- /dev/null +++ b/node_modules/mongodb/src/promise_provider.ts @@ -0,0 +1,41 @@ +import { MongoInvalidArgumentError } from './error'; + +/** @internal */ +const kPromise = Symbol('promise'); + +interface PromiseStore { + [kPromise]?: PromiseConstructor; +} + +const store: PromiseStore = { + [kPromise]: undefined +}; + +/** + * Global promise store allowing user-provided promises + * @public + */ +export class PromiseProvider { + /** Validates the passed in promise library */ + static validate(lib: unknown): lib is PromiseConstructor { + if (typeof lib !== 'function') + throw new MongoInvalidArgumentError(`Promise must be a function, got ${lib}`); + return !!lib; + } + + /** Sets the promise library */ + static set(lib: PromiseConstructor): void { + if (!PromiseProvider.validate(lib)) { + // validate + return; + } + store[kPromise] = lib; + } + + /** Get the stored promise library, or resolves passed in */ + static get(): PromiseConstructor { + return store[kPromise] as PromiseConstructor; + } +} + +PromiseProvider.set(global.Promise); diff --git a/node_modules/mongodb/src/read_concern.ts b/node_modules/mongodb/src/read_concern.ts new file mode 100644 index 000000000..09e39be56 --- /dev/null +++ b/node_modules/mongodb/src/read_concern.ts @@ -0,0 +1,88 @@ +import type { Document } from './bson'; + +/** @public */ +export const ReadConcernLevel = Object.freeze({ + local: 'local', + majority: 'majority', + linearizable: 'linearizable', + available: 'available', + snapshot: 'snapshot' +} as const); + +/** @public */ +export type ReadConcernLevel = typeof ReadConcernLevel[keyof typeof ReadConcernLevel]; + +/** @public */ +export type ReadConcernLike = ReadConcern | { level: ReadConcernLevel } | ReadConcernLevel; + +/** + * The MongoDB ReadConcern, which allows for control of the consistency and isolation properties + * of the data read from replica sets and replica set shards. + * @public + * + * @see https://docs.mongodb.com/manual/reference/read-concern/index.html + */ +export class ReadConcern { + level: ReadConcernLevel | string; + + /** Constructs a ReadConcern from the read concern level.*/ + constructor(level: ReadConcernLevel) { + /** + * A spec test exists that allows level to be any string. + * "invalid readConcern with out stage" + * @see ./test/spec/crud/v2/aggregate-out-readConcern.json + * @see https://github.com/mongodb/specifications/blob/master/source/read-write-concern/read-write-concern.rst#unknown-levels-and-additional-options-for-string-based-readconcerns + */ + this.level = ReadConcernLevel[level] ?? level; + } + + /** + * Construct a ReadConcern given an options object. + * + * @param options - The options object from which to extract the write concern. + */ + static fromOptions(options?: { + readConcern?: ReadConcernLike; + level?: ReadConcernLevel; + }): ReadConcern | undefined { + if (options == null) { + return; + } + + if (options.readConcern) { + const { readConcern } = options; + if (readConcern instanceof ReadConcern) { + return readConcern; + } else if (typeof readConcern === 'string') { + return new ReadConcern(readConcern); + } else if ('level' in readConcern && readConcern.level) { + return new ReadConcern(readConcern.level); + } + } + + if (options.level) { + return new ReadConcern(options.level); + } + return; + } + + static get MAJORITY(): 'majority' { + return ReadConcernLevel.majority; + } + + static get AVAILABLE(): 'available' { + return ReadConcernLevel.available; + } + + static get LINEARIZABLE(): 'linearizable' { + return ReadConcernLevel.linearizable; + } + + static get SNAPSHOT(): 'snapshot' { + return ReadConcernLevel.snapshot; + } + + toJSON(): Document { + return { level: this.level }; + } +} diff --git a/node_modules/mongodb/src/read_preference.ts b/node_modules/mongodb/src/read_preference.ts new file mode 100644 index 000000000..554bf2341 --- /dev/null +++ b/node_modules/mongodb/src/read_preference.ts @@ -0,0 +1,275 @@ +import type { Document } from './bson'; +import { MongoInvalidArgumentError } from './error'; +import type { TagSet } from './sdam/server_description'; +import type { ClientSession } from './sessions'; + +/** @public */ +export type ReadPreferenceLike = ReadPreference | ReadPreferenceMode; + +/** @public */ +export const ReadPreferenceMode = Object.freeze({ + primary: 'primary', + primaryPreferred: 'primaryPreferred', + secondary: 'secondary', + secondaryPreferred: 'secondaryPreferred', + nearest: 'nearest' +} as const); + +/** @public */ +export type ReadPreferenceMode = typeof ReadPreferenceMode[keyof typeof ReadPreferenceMode]; + +/** @public */ +export interface HedgeOptions { + /** Explicitly enable or disable hedged reads. */ + enabled?: boolean; +} + +/** @public */ +export interface ReadPreferenceOptions { + /** Max secondary read staleness in seconds, Minimum value is 90 seconds.*/ + maxStalenessSeconds?: number; + /** Server mode in which the same query is dispatched in parallel to multiple replica set members. */ + hedge?: HedgeOptions; +} + +/** @public */ +export interface ReadPreferenceLikeOptions extends ReadPreferenceOptions { + readPreference?: + | ReadPreferenceLike + | { + mode?: ReadPreferenceMode; + preference?: ReadPreferenceMode; + tags?: TagSet[]; + maxStalenessSeconds?: number; + }; +} + +/** @public */ +export interface ReadPreferenceFromOptions extends ReadPreferenceLikeOptions { + session?: ClientSession; + readPreferenceTags?: TagSet[]; + hedge?: HedgeOptions; +} + +/** + * The **ReadPreference** class is a class that represents a MongoDB ReadPreference and is + * used to construct connections. + * @public + * + * @see https://docs.mongodb.com/manual/core/read-preference/ + */ +export class ReadPreference { + mode: ReadPreferenceMode; + tags?: TagSet[]; + hedge?: HedgeOptions; + maxStalenessSeconds?: number; + minWireVersion?: number; + + public static PRIMARY = ReadPreferenceMode.primary; + public static PRIMARY_PREFERRED = ReadPreferenceMode.primaryPreferred; + public static SECONDARY = ReadPreferenceMode.secondary; + public static SECONDARY_PREFERRED = ReadPreferenceMode.secondaryPreferred; + public static NEAREST = ReadPreferenceMode.nearest; + + public static primary = new ReadPreference(ReadPreferenceMode.primary); + public static primaryPreferred = new ReadPreference(ReadPreferenceMode.primaryPreferred); + public static secondary = new ReadPreference(ReadPreferenceMode.secondary); + public static secondaryPreferred = new ReadPreference(ReadPreferenceMode.secondaryPreferred); + public static nearest = new ReadPreference(ReadPreferenceMode.nearest); + + /** + * @param mode - A string describing the read preference mode (primary|primaryPreferred|secondary|secondaryPreferred|nearest) + * @param tags - A tag set used to target reads to members with the specified tag(s). tagSet is not available if using read preference mode primary. + * @param options - Additional read preference options + */ + constructor(mode: ReadPreferenceMode, tags?: TagSet[], options?: ReadPreferenceOptions) { + if (!ReadPreference.isValid(mode)) { + throw new MongoInvalidArgumentError(`Invalid read preference mode ${JSON.stringify(mode)}`); + } + if (options == null && typeof tags === 'object' && !Array.isArray(tags)) { + options = tags; + tags = undefined; + } else if (tags && !Array.isArray(tags)) { + throw new MongoInvalidArgumentError('ReadPreference tags must be an array'); + } + + this.mode = mode; + this.tags = tags; + this.hedge = options?.hedge; + this.maxStalenessSeconds = undefined; + this.minWireVersion = undefined; + + options = options ?? {}; + if (options.maxStalenessSeconds != null) { + if (options.maxStalenessSeconds <= 0) { + throw new MongoInvalidArgumentError('maxStalenessSeconds must be a positive integer'); + } + + this.maxStalenessSeconds = options.maxStalenessSeconds; + + // NOTE: The minimum required wire version is 5 for this read preference. If the existing + // topology has a lower value then a MongoError will be thrown during server selection. + this.minWireVersion = 5; + } + + if (this.mode === ReadPreference.PRIMARY) { + if (this.tags && Array.isArray(this.tags) && this.tags.length > 0) { + throw new MongoInvalidArgumentError('Primary read preference cannot be combined with tags'); + } + + if (this.maxStalenessSeconds) { + throw new MongoInvalidArgumentError( + 'Primary read preference cannot be combined with maxStalenessSeconds' + ); + } + + if (this.hedge) { + throw new MongoInvalidArgumentError( + 'Primary read preference cannot be combined with hedge' + ); + } + } + } + + // Support the deprecated `preference` property introduced in the porcelain layer + get preference(): ReadPreferenceMode { + return this.mode; + } + + static fromString(mode: string): ReadPreference { + return new ReadPreference(mode as ReadPreferenceMode); + } + + /** + * Construct a ReadPreference given an options object. + * + * @param options - The options object from which to extract the read preference. + */ + static fromOptions(options?: ReadPreferenceFromOptions): ReadPreference | undefined { + if (!options) return; + const readPreference = + options.readPreference ?? options.session?.transaction.options.readPreference; + const readPreferenceTags = options.readPreferenceTags; + + if (readPreference == null) { + return; + } + + if (typeof readPreference === 'string') { + return new ReadPreference(readPreference as ReadPreferenceMode, readPreferenceTags, { + maxStalenessSeconds: options.maxStalenessSeconds, + hedge: options.hedge + }); + } else if (!(readPreference instanceof ReadPreference) && typeof readPreference === 'object') { + const mode = readPreference.mode || readPreference.preference; + if (mode && typeof mode === 'string') { + return new ReadPreference( + mode as ReadPreferenceMode, + readPreference.tags ?? readPreferenceTags, + { + maxStalenessSeconds: readPreference.maxStalenessSeconds, + hedge: options.hedge + } + ); + } + } + + if (readPreferenceTags) { + readPreference.tags = readPreferenceTags; + } + + return readPreference as ReadPreference; + } + + /** + * Replaces options.readPreference with a ReadPreference instance + */ + static translate(options: ReadPreferenceLikeOptions): ReadPreferenceLikeOptions { + if (options.readPreference == null) return options; + const r = options.readPreference; + + if (typeof r === 'string') { + options.readPreference = new ReadPreference(r as ReadPreferenceMode); + } else if (r && !(r instanceof ReadPreference) && typeof r === 'object') { + const mode = r.mode || r.preference; + if (mode && typeof mode === 'string') { + options.readPreference = new ReadPreference(mode as ReadPreferenceMode, r.tags, { + maxStalenessSeconds: r.maxStalenessSeconds + }); + } + } else if (!(r instanceof ReadPreference)) { + throw new MongoInvalidArgumentError(`Invalid read preference: ${r}`); + } + + return options; + } + + /** + * Validate if a mode is legal + * + * @param mode - The string representing the read preference mode. + */ + static isValid(mode: string): boolean { + const VALID_MODES = new Set([ + ReadPreference.PRIMARY, + ReadPreference.PRIMARY_PREFERRED, + ReadPreference.SECONDARY, + ReadPreference.SECONDARY_PREFERRED, + ReadPreference.NEAREST, + null + ]); + + return VALID_MODES.has(mode as ReadPreferenceMode); + } + + /** + * Validate if a mode is legal + * + * @param mode - The string representing the read preference mode. + */ + isValid(mode?: string): boolean { + return ReadPreference.isValid(typeof mode === 'string' ? mode : this.mode); + } + + /** + * Indicates that this readPreference needs the "secondaryOk" bit when sent over the wire + * @deprecated Use secondaryOk instead + * @see https://docs.mongodb.com/manual/reference/mongodb-wire-protocol/#op-query + */ + slaveOk(): boolean { + return this.secondaryOk(); + } + + /** + * Indicates that this readPreference needs the "SecondaryOk" bit when sent over the wire + * @see https://docs.mongodb.com/manual/reference/mongodb-wire-protocol/#op-query + */ + secondaryOk(): boolean { + const NEEDS_SECONDARYOK = new Set([ + ReadPreference.PRIMARY_PREFERRED, + ReadPreference.SECONDARY, + ReadPreference.SECONDARY_PREFERRED, + ReadPreference.NEAREST + ]); + + return NEEDS_SECONDARYOK.has(this.mode); + } + + /** + * Check if the two ReadPreferences are equivalent + * + * @param readPreference - The read preference with which to check equality + */ + equals(readPreference: ReadPreference): boolean { + return readPreference.mode === this.mode; + } + + /** Return JSON representation */ + toJSON(): Document { + const readPreference = { mode: this.mode } as Document; + if (Array.isArray(this.tags)) readPreference.tags = this.tags; + if (this.maxStalenessSeconds) readPreference.maxStalenessSeconds = this.maxStalenessSeconds; + if (this.hedge) readPreference.hedge = this.hedge; + return readPreference; + } +} diff --git a/node_modules/mongodb/src/sdam/common.ts b/node_modules/mongodb/src/sdam/common.ts new file mode 100644 index 000000000..6738ad9eb --- /dev/null +++ b/node_modules/mongodb/src/sdam/common.ts @@ -0,0 +1,77 @@ +import type { Binary, Long, Timestamp } from '../bson'; +import type { ClientSession } from '../sessions'; +import type { Topology } from './topology'; + +// shared state names +export const STATE_CLOSING = 'closing'; +export const STATE_CLOSED = 'closed'; +export const STATE_CONNECTING = 'connecting'; +export const STATE_CONNECTED = 'connected'; + +/** + * An enumeration of topology types we know about + * @public + */ +export const TopologyType = Object.freeze({ + Single: 'Single', + ReplicaSetNoPrimary: 'ReplicaSetNoPrimary', + ReplicaSetWithPrimary: 'ReplicaSetWithPrimary', + Sharded: 'Sharded', + Unknown: 'Unknown', + LoadBalanced: 'LoadBalanced' +} as const); + +/** @public */ +export type TopologyType = typeof TopologyType[keyof typeof TopologyType]; + +/** + * An enumeration of server types we know about + * @public + */ +export const ServerType = Object.freeze({ + Standalone: 'Standalone', + Mongos: 'Mongos', + PossiblePrimary: 'PossiblePrimary', + RSPrimary: 'RSPrimary', + RSSecondary: 'RSSecondary', + RSArbiter: 'RSArbiter', + RSOther: 'RSOther', + RSGhost: 'RSGhost', + Unknown: 'Unknown', + LoadBalancer: 'LoadBalancer' +} as const); + +/** @public */ +export type ServerType = typeof ServerType[keyof typeof ServerType]; + +/** @internal */ +export type TimerQueue = Set; + +/** @internal */ +export function drainTimerQueue(queue: TimerQueue): void { + queue.forEach(clearTimeout); + queue.clear(); +} + +/** @public */ +export interface ClusterTime { + clusterTime: Timestamp; + signature: { + hash: Binary; + keyId: Long; + }; +} + +/** Shared function to determine clusterTime for a given topology or session */ +export function _advanceClusterTime( + entity: Topology | ClientSession, + $clusterTime: ClusterTime +): void { + if (entity.clusterTime == null) { + entity.clusterTime = $clusterTime; + } else { + if ($clusterTime.clusterTime.greaterThan(entity.clusterTime.clusterTime)) { + entity.clusterTime = $clusterTime; + } + } +} diff --git a/node_modules/mongodb/src/sdam/events.ts b/node_modules/mongodb/src/sdam/events.ts new file mode 100644 index 000000000..c55eb0957 --- /dev/null +++ b/node_modules/mongodb/src/sdam/events.ts @@ -0,0 +1,182 @@ +import type { Document } from '../bson'; +import type { ServerDescription } from './server_description'; +import type { TopologyDescription } from './topology_description'; + +/** + * Emitted when server description changes, but does NOT include changes to the RTT. + * @public + * @category Event + */ +export class ServerDescriptionChangedEvent { + /** A unique identifier for the topology */ + topologyId: number; + /** The address (host/port pair) of the server */ + address: string; + /** The previous server description */ + previousDescription: ServerDescription; + /** The new server description */ + newDescription: ServerDescription; + + /** @internal */ + constructor( + topologyId: number, + address: string, + previousDescription: ServerDescription, + newDescription: ServerDescription + ) { + this.topologyId = topologyId; + this.address = address; + this.previousDescription = previousDescription; + this.newDescription = newDescription; + } +} + +/** + * Emitted when server is initialized. + * @public + * @category Event + */ +export class ServerOpeningEvent { + /** A unique identifier for the topology */ + topologyId: number; + /** The address (host/port pair) of the server */ + address: string; + + /** @internal */ + constructor(topologyId: number, address: string) { + this.topologyId = topologyId; + this.address = address; + } +} + +/** + * Emitted when server is closed. + * @public + * @category Event + */ +export class ServerClosedEvent { + /** A unique identifier for the topology */ + topologyId: number; + /** The address (host/port pair) of the server */ + address: string; + + /** @internal */ + constructor(topologyId: number, address: string) { + this.topologyId = topologyId; + this.address = address; + } +} + +/** + * Emitted when topology description changes. + * @public + * @category Event + */ +export class TopologyDescriptionChangedEvent { + /** A unique identifier for the topology */ + topologyId: number; + /** The old topology description */ + previousDescription: TopologyDescription; + /** The new topology description */ + newDescription: TopologyDescription; + + /** @internal */ + constructor( + topologyId: number, + previousDescription: TopologyDescription, + newDescription: TopologyDescription + ) { + this.topologyId = topologyId; + this.previousDescription = previousDescription; + this.newDescription = newDescription; + } +} + +/** + * Emitted when topology is initialized. + * @public + * @category Event + */ +export class TopologyOpeningEvent { + /** A unique identifier for the topology */ + topologyId: number; + + /** @internal */ + constructor(topologyId: number) { + this.topologyId = topologyId; + } +} + +/** + * Emitted when topology is closed. + * @public + * @category Event + */ +export class TopologyClosedEvent { + /** A unique identifier for the topology */ + topologyId: number; + + /** @internal */ + constructor(topologyId: number) { + this.topologyId = topologyId; + } +} + +/** + * Emitted when the server monitor’s hello command is started - immediately before + * the hello command is serialized into raw BSON and written to the socket. + * + * @public + * @category Event + */ +export class ServerHeartbeatStartedEvent { + /** The connection id for the command */ + connectionId: string; + + /** @internal */ + constructor(connectionId: string) { + this.connectionId = connectionId; + } +} + +/** + * Emitted when the server monitor’s hello succeeds. + * @public + * @category Event + */ +export class ServerHeartbeatSucceededEvent { + /** The connection id for the command */ + connectionId: string; + /** The execution time of the event in ms */ + duration: number; + /** The command reply */ + reply: Document; + + /** @internal */ + constructor(connectionId: string, duration: number, reply: Document | null) { + this.connectionId = connectionId; + this.duration = duration; + this.reply = reply ?? {}; + } +} + +/** + * Emitted when the server monitor’s hello fails, either with an “ok: 0” or a socket exception. + * @public + * @category Event + */ +export class ServerHeartbeatFailedEvent { + /** The connection id for the command */ + connectionId: string; + /** The execution time of the event in ms */ + duration: number; + /** The command failure */ + failure: Error; + + /** @internal */ + constructor(connectionId: string, duration: number, failure: Error) { + this.connectionId = connectionId; + this.duration = duration; + this.failure = failure; + } +} diff --git a/node_modules/mongodb/src/sdam/monitor.ts b/node_modules/mongodb/src/sdam/monitor.ts new file mode 100644 index 000000000..cd1bc092f --- /dev/null +++ b/node_modules/mongodb/src/sdam/monitor.ts @@ -0,0 +1,471 @@ +import { setTimeout } from 'timers'; + +import { Document, Long } from '../bson'; +import { connect } from '../cmap/connect'; +import { Connection, ConnectionOptions } from '../cmap/connection'; +import { LEGACY_HELLO_COMMAND } from '../constants'; +import { MongoNetworkError } from '../error'; +import { CancellationToken, TypedEventEmitter } from '../mongo_types'; +import type { Callback, InterruptibleAsyncInterval } from '../utils'; +import { + calculateDurationInMs, + EventEmitterWithState, + makeInterruptibleAsyncInterval, + makeStateMachine, + now, + ns +} from '../utils'; +import { ServerType, STATE_CLOSED, STATE_CLOSING } from './common'; +import { + ServerHeartbeatFailedEvent, + ServerHeartbeatStartedEvent, + ServerHeartbeatSucceededEvent +} from './events'; +import { Server } from './server'; +import type { TopologyVersion } from './server_description'; + +/** @internal */ +const kServer = Symbol('server'); +/** @internal */ +const kMonitorId = Symbol('monitorId'); +/** @internal */ +const kConnection = Symbol('connection'); +/** @internal */ +const kCancellationToken = Symbol('cancellationToken'); +/** @internal */ +const kRTTPinger = Symbol('rttPinger'); +/** @internal */ +const kRoundTripTime = Symbol('roundTripTime'); + +const STATE_IDLE = 'idle'; +const STATE_MONITORING = 'monitoring'; +const stateTransition = makeStateMachine({ + [STATE_CLOSING]: [STATE_CLOSING, STATE_IDLE, STATE_CLOSED], + [STATE_CLOSED]: [STATE_CLOSED, STATE_MONITORING], + [STATE_IDLE]: [STATE_IDLE, STATE_MONITORING, STATE_CLOSING], + [STATE_MONITORING]: [STATE_MONITORING, STATE_IDLE, STATE_CLOSING] +}); + +const INVALID_REQUEST_CHECK_STATES = new Set([STATE_CLOSING, STATE_CLOSED, STATE_MONITORING]); +function isInCloseState(monitor: Monitor) { + return monitor.s.state === STATE_CLOSED || monitor.s.state === STATE_CLOSING; +} + +/** @internal */ +export interface MonitorPrivate { + state: string; +} + +/** @public */ +export interface MonitorOptions + extends Omit { + connectTimeoutMS: number; + heartbeatFrequencyMS: number; + minHeartbeatFrequencyMS: number; +} + +/** @public */ +export type MonitorEvents = { + serverHeartbeatStarted(event: ServerHeartbeatStartedEvent): void; + serverHeartbeatSucceeded(event: ServerHeartbeatSucceededEvent): void; + serverHeartbeatFailed(event: ServerHeartbeatFailedEvent): void; + resetServer(error?: Error): void; + resetConnectionPool(): void; + close(): void; +} & EventEmitterWithState; + +/** @internal */ +export class Monitor extends TypedEventEmitter { + /** @internal */ + s: MonitorPrivate; + address: string; + options: Readonly< + Pick + >; + connectOptions: ConnectionOptions; + [kServer]: Server; + [kConnection]?: Connection; + [kCancellationToken]: CancellationToken; + /** @internal */ + [kMonitorId]?: InterruptibleAsyncInterval; + [kRTTPinger]?: RTTPinger; + + get connection(): Connection | undefined { + return this[kConnection]; + } + + constructor(server: Server, options: MonitorOptions) { + super(); + + this[kServer] = server; + this[kConnection] = undefined; + this[kCancellationToken] = new CancellationToken(); + this[kCancellationToken].setMaxListeners(Infinity); + this[kMonitorId] = undefined; + this.s = { + state: STATE_CLOSED + }; + + this.address = server.description.address; + this.options = Object.freeze({ + connectTimeoutMS: options.connectTimeoutMS ?? 10000, + heartbeatFrequencyMS: options.heartbeatFrequencyMS ?? 10000, + minHeartbeatFrequencyMS: options.minHeartbeatFrequencyMS ?? 500 + }); + + const cancellationToken = this[kCancellationToken]; + // TODO: refactor this to pull it directly from the pool, requires new ConnectionPool integration + const connectOptions = Object.assign( + { + id: '' as const, + generation: server.s.pool.generation, + connectionType: Connection, + cancellationToken, + hostAddress: server.description.hostAddress + }, + options, + // force BSON serialization options + { + raw: false, + promoteLongs: true, + promoteValues: true, + promoteBuffers: true + } + ); + + // ensure no authentication is used for monitoring + delete connectOptions.credentials; + if (connectOptions.autoEncrypter) { + delete connectOptions.autoEncrypter; + } + + this.connectOptions = Object.freeze(connectOptions); + } + + connect(): void { + if (this.s.state !== STATE_CLOSED) { + return; + } + + // start + const heartbeatFrequencyMS = this.options.heartbeatFrequencyMS; + const minHeartbeatFrequencyMS = this.options.minHeartbeatFrequencyMS; + this[kMonitorId] = makeInterruptibleAsyncInterval(monitorServer(this), { + interval: heartbeatFrequencyMS, + minInterval: minHeartbeatFrequencyMS, + immediate: true + }); + } + + requestCheck(): void { + if (INVALID_REQUEST_CHECK_STATES.has(this.s.state)) { + return; + } + + this[kMonitorId]?.wake(); + } + + reset(): void { + const topologyVersion = this[kServer].description.topologyVersion; + if (isInCloseState(this) || topologyVersion == null) { + return; + } + + stateTransition(this, STATE_CLOSING); + resetMonitorState(this); + + // restart monitor + stateTransition(this, STATE_IDLE); + + // restart monitoring + const heartbeatFrequencyMS = this.options.heartbeatFrequencyMS; + const minHeartbeatFrequencyMS = this.options.minHeartbeatFrequencyMS; + this[kMonitorId] = makeInterruptibleAsyncInterval(monitorServer(this), { + interval: heartbeatFrequencyMS, + minInterval: minHeartbeatFrequencyMS + }); + } + + close(): void { + if (isInCloseState(this)) { + return; + } + + stateTransition(this, STATE_CLOSING); + resetMonitorState(this); + + // close monitor + this.emit('close'); + stateTransition(this, STATE_CLOSED); + } +} + +function resetMonitorState(monitor: Monitor) { + monitor[kMonitorId]?.stop(); + monitor[kMonitorId] = undefined; + + monitor[kRTTPinger]?.close(); + monitor[kRTTPinger] = undefined; + + monitor[kCancellationToken].emit('cancel'); + + monitor[kConnection]?.destroy({ force: true }); + monitor[kConnection] = undefined; +} + +function checkServer(monitor: Monitor, callback: Callback) { + let start = now(); + monitor.emit(Server.SERVER_HEARTBEAT_STARTED, new ServerHeartbeatStartedEvent(monitor.address)); + + function failureHandler(err: Error) { + monitor[kConnection]?.destroy({ force: true }); + monitor[kConnection] = undefined; + + monitor.emit( + Server.SERVER_HEARTBEAT_FAILED, + new ServerHeartbeatFailedEvent(monitor.address, calculateDurationInMs(start), err) + ); + + monitor.emit('resetServer', err); + monitor.emit('resetConnectionPool'); + callback(err); + } + + const connection = monitor[kConnection]; + if (connection && !connection.closed) { + const { serverApi, helloOk } = connection; + const connectTimeoutMS = monitor.options.connectTimeoutMS; + const maxAwaitTimeMS = monitor.options.heartbeatFrequencyMS; + const topologyVersion = monitor[kServer].description.topologyVersion; + const isAwaitable = topologyVersion != null; + + const cmd = { + [serverApi?.version || helloOk ? 'hello' : LEGACY_HELLO_COMMAND]: true, + ...(isAwaitable && topologyVersion + ? { maxAwaitTimeMS, topologyVersion: makeTopologyVersion(topologyVersion) } + : {}) + }; + + const options = isAwaitable + ? { + socketTimeoutMS: connectTimeoutMS ? connectTimeoutMS + maxAwaitTimeMS : 0, + exhaustAllowed: true + } + : { socketTimeoutMS: connectTimeoutMS }; + + if (isAwaitable && monitor[kRTTPinger] == null) { + monitor[kRTTPinger] = new RTTPinger( + monitor[kCancellationToken], + Object.assign( + { heartbeatFrequencyMS: monitor.options.heartbeatFrequencyMS }, + monitor.connectOptions + ) + ); + } + + connection.command(ns('admin.$cmd'), cmd, options, (err, hello) => { + if (err) { + return failureHandler(err); + } + + if (!('isWritablePrimary' in hello)) { + // Provide hello-style response document. + hello.isWritablePrimary = hello[LEGACY_HELLO_COMMAND]; + } + + const rttPinger = monitor[kRTTPinger]; + const duration = + isAwaitable && rttPinger ? rttPinger.roundTripTime : calculateDurationInMs(start); + + monitor.emit( + Server.SERVER_HEARTBEAT_SUCCEEDED, + new ServerHeartbeatSucceededEvent(monitor.address, duration, hello) + ); + + // if we are using the streaming protocol then we immediately issue another `started` + // event, otherwise the "check" is complete and return to the main monitor loop + if (isAwaitable && hello.topologyVersion) { + monitor.emit( + Server.SERVER_HEARTBEAT_STARTED, + new ServerHeartbeatStartedEvent(monitor.address) + ); + start = now(); + } else { + monitor[kRTTPinger]?.close(); + monitor[kRTTPinger] = undefined; + + callback(undefined, hello); + } + }); + + return; + } + + // connecting does an implicit `hello` + connect(monitor.connectOptions, (err, conn) => { + if (err) { + monitor[kConnection] = undefined; + + // we already reset the connection pool on network errors in all cases + if (!(err instanceof MongoNetworkError)) { + monitor.emit('resetConnectionPool'); + } + + failureHandler(err); + return; + } + + if (conn) { + // Tell the connection that we are using the streaming protocol so that the + // connection's message stream will only read the last hello on the buffer. + conn.isMonitoringConnection = true; + + if (isInCloseState(monitor)) { + conn.destroy({ force: true }); + return; + } + + monitor[kConnection] = conn; + monitor.emit( + Server.SERVER_HEARTBEAT_SUCCEEDED, + new ServerHeartbeatSucceededEvent(monitor.address, calculateDurationInMs(start), conn.hello) + ); + + callback(undefined, conn.hello); + } + }); +} + +function monitorServer(monitor: Monitor) { + return (callback: Callback) => { + stateTransition(monitor, STATE_MONITORING); + function done() { + if (!isInCloseState(monitor)) { + stateTransition(monitor, STATE_IDLE); + } + + callback(); + } + + checkServer(monitor, (err, hello) => { + if (err) { + // otherwise an error occurred on initial discovery, also bail + if (monitor[kServer].description.type === ServerType.Unknown) { + monitor.emit('resetServer', err); + return done(); + } + } + + // if the check indicates streaming is supported, immediately reschedule monitoring + if (hello && hello.topologyVersion) { + setTimeout(() => { + if (!isInCloseState(monitor)) { + monitor[kMonitorId]?.wake(); + } + }, 0); + } + + done(); + }); + }; +} + +function makeTopologyVersion(tv: TopologyVersion) { + return { + processId: tv.processId, + // tests mock counter as just number, but in a real situation counter should always be a Long + counter: Long.isLong(tv.counter) ? tv.counter : Long.fromNumber(tv.counter) + }; +} + +/** @internal */ +export interface RTTPingerOptions extends ConnectionOptions { + heartbeatFrequencyMS: number; +} + +/** @internal */ +export class RTTPinger { + /** @internal */ + [kConnection]?: Connection; + /** @internal */ + [kCancellationToken]: CancellationToken; + /** @internal */ + [kRoundTripTime]: number; + /** @internal */ + [kMonitorId]: NodeJS.Timeout; + closed: boolean; + + constructor(cancellationToken: CancellationToken, options: RTTPingerOptions) { + this[kConnection] = undefined; + this[kCancellationToken] = cancellationToken; + this[kRoundTripTime] = 0; + this.closed = false; + + const heartbeatFrequencyMS = options.heartbeatFrequencyMS; + this[kMonitorId] = setTimeout(() => measureRoundTripTime(this, options), heartbeatFrequencyMS); + } + + get roundTripTime(): number { + return this[kRoundTripTime]; + } + + close(): void { + this.closed = true; + clearTimeout(this[kMonitorId]); + + this[kConnection]?.destroy({ force: true }); + this[kConnection] = undefined; + } +} + +function measureRoundTripTime(rttPinger: RTTPinger, options: RTTPingerOptions) { + const start = now(); + options.cancellationToken = rttPinger[kCancellationToken]; + const heartbeatFrequencyMS = options.heartbeatFrequencyMS; + + if (rttPinger.closed) { + return; + } + + function measureAndReschedule(conn?: Connection) { + if (rttPinger.closed) { + conn?.destroy({ force: true }); + return; + } + + if (rttPinger[kConnection] == null) { + rttPinger[kConnection] = conn; + } + + rttPinger[kRoundTripTime] = calculateDurationInMs(start); + rttPinger[kMonitorId] = setTimeout( + () => measureRoundTripTime(rttPinger, options), + heartbeatFrequencyMS + ); + } + + const connection = rttPinger[kConnection]; + if (connection == null) { + connect(options, (err, conn) => { + if (err) { + rttPinger[kConnection] = undefined; + rttPinger[kRoundTripTime] = 0; + return; + } + + measureAndReschedule(conn); + }); + + return; + } + + connection.command(ns('admin.$cmd'), { [LEGACY_HELLO_COMMAND]: 1 }, undefined, err => { + if (err) { + rttPinger[kConnection] = undefined; + rttPinger[kRoundTripTime] = 0; + return; + } + + measureAndReschedule(); + }); +} diff --git a/node_modules/mongodb/src/sdam/server.ts b/node_modules/mongodb/src/sdam/server.ts new file mode 100644 index 000000000..93c7be92a --- /dev/null +++ b/node_modules/mongodb/src/sdam/server.ts @@ -0,0 +1,620 @@ +import type { Document, Long } from '../bson'; +import { CommandOptions, Connection, DestroyOptions, GetMoreOptions } from '../cmap/connection'; +import { + ConnectionPool, + ConnectionPoolEvents, + ConnectionPoolOptions +} from '../cmap/connection_pool'; +import { + APM_EVENTS, + CLOSED, + CMAP_EVENTS, + CONNECT, + DESCRIPTION_RECEIVED, + ENDED, + HEARTBEAT_EVENTS, + SERVER_HEARTBEAT_FAILED, + SERVER_HEARTBEAT_STARTED, + SERVER_HEARTBEAT_SUCCEEDED +} from '../constants'; +import type { AutoEncrypter } from '../deps'; +import { + isNetworkErrorBeforeHandshake, + isNodeShuttingDownError, + isSDAMUnrecoverableError, + MongoCompatibilityError, + MongoError, + MongoErrorLabel, + MongoInvalidArgumentError, + MongoNetworkError, + MongoNetworkTimeoutError, + MongoServerClosedError, + MongoUnexpectedServerResponseError, + needsRetryableWriteLabel +} from '../error'; +import { Logger } from '../logger'; +import type { ServerApi } from '../mongo_client'; +import { TypedEventEmitter } from '../mongo_types'; +import type { ClientSession } from '../sessions'; +import { isTransactionCommand } from '../transactions'; +import { + Callback, + collationNotSupported, + EventEmitterWithState, + makeStateMachine, + maxWireVersion, + MongoDBNamespace, + supportsRetryableWrites +} from '../utils'; +import { + ClusterTime, + STATE_CLOSED, + STATE_CLOSING, + STATE_CONNECTED, + STATE_CONNECTING, + TopologyType +} from './common'; +import type { + ServerHeartbeatFailedEvent, + ServerHeartbeatStartedEvent, + ServerHeartbeatSucceededEvent +} from './events'; +import { Monitor, MonitorOptions } from './monitor'; +import { compareTopologyVersion, ServerDescription } from './server_description'; +import type { Topology } from './topology'; + +const stateTransition = makeStateMachine({ + [STATE_CLOSED]: [STATE_CLOSED, STATE_CONNECTING], + [STATE_CONNECTING]: [STATE_CONNECTING, STATE_CLOSING, STATE_CONNECTED, STATE_CLOSED], + [STATE_CONNECTED]: [STATE_CONNECTED, STATE_CLOSING, STATE_CLOSED], + [STATE_CLOSING]: [STATE_CLOSING, STATE_CLOSED] +}); + +/** @internal */ +const kMonitor = Symbol('monitor'); + +/** @public */ +export type ServerOptions = Omit & + MonitorOptions; + +/** @internal */ +export interface ServerPrivate { + /** The server description for this server */ + description: ServerDescription; + /** A copy of the options used to construct this instance */ + options: ServerOptions; + /** A logger instance */ + logger: Logger; + /** The current state of the Server */ + state: string; + /** The topology this server is a part of */ + topology: Topology; + /** A connection pool for this server */ + pool: ConnectionPool; + /** MongoDB server API version */ + serverApi?: ServerApi; + /** A count of the operations currently running against the server. */ + operationCount: number; +} + +/** @public */ +export type ServerEvents = { + serverHeartbeatStarted(event: ServerHeartbeatStartedEvent): void; + serverHeartbeatSucceeded(event: ServerHeartbeatSucceededEvent): void; + serverHeartbeatFailed(event: ServerHeartbeatFailedEvent): void; + /** Top level MongoClient doesn't emit this so it is marked: @internal */ + connect(server: Server): void; + descriptionReceived(description: ServerDescription): void; + closed(): void; + ended(): void; +} & ConnectionPoolEvents & + EventEmitterWithState; + +/** @internal */ +export class Server extends TypedEventEmitter { + /** @internal */ + s: ServerPrivate; + serverApi?: ServerApi; + hello?: Document; + [kMonitor]: Monitor | null; + + /** @event */ + static readonly SERVER_HEARTBEAT_STARTED = SERVER_HEARTBEAT_STARTED; + /** @event */ + static readonly SERVER_HEARTBEAT_SUCCEEDED = SERVER_HEARTBEAT_SUCCEEDED; + /** @event */ + static readonly SERVER_HEARTBEAT_FAILED = SERVER_HEARTBEAT_FAILED; + /** @event */ + static readonly CONNECT = CONNECT; + /** @event */ + static readonly DESCRIPTION_RECEIVED = DESCRIPTION_RECEIVED; + /** @event */ + static readonly CLOSED = CLOSED; + /** @event */ + static readonly ENDED = ENDED; + + /** + * Create a server + */ + constructor(topology: Topology, description: ServerDescription, options: ServerOptions) { + super(); + + this.serverApi = options.serverApi; + + const poolOptions = { hostAddress: description.hostAddress, ...options }; + + this.s = { + description, + options, + logger: new Logger('Server'), + state: STATE_CLOSED, + topology, + pool: new ConnectionPool(poolOptions), + operationCount: 0 + }; + + for (const event of [...CMAP_EVENTS, ...APM_EVENTS]) { + this.s.pool.on(event, (e: any) => this.emit(event, e)); + } + + this.s.pool.on(Connection.CLUSTER_TIME_RECEIVED, (clusterTime: ClusterTime) => { + this.clusterTime = clusterTime; + }); + + if (this.loadBalanced) { + this[kMonitor] = null; + // monitoring is disabled in load balancing mode + return; + } + + // create the monitor + // TODO(NODE-4144): Remove new variable for type narrowing + const monitor = new Monitor(this, this.s.options); + this[kMonitor] = monitor; + + for (const event of HEARTBEAT_EVENTS) { + monitor.on(event, (e: any) => this.emit(event, e)); + } + + monitor.on('resetConnectionPool', () => { + this.s.pool.clear(); + }); + + monitor.on('resetServer', (error: MongoError) => markServerUnknown(this, error)); + monitor.on(Server.SERVER_HEARTBEAT_SUCCEEDED, (event: ServerHeartbeatSucceededEvent) => { + this.emit( + Server.DESCRIPTION_RECEIVED, + new ServerDescription(this.description.hostAddress, event.reply, { + roundTripTime: calculateRoundTripTime(this.description.roundTripTime, event.duration) + }) + ); + + if (this.s.state === STATE_CONNECTING) { + stateTransition(this, STATE_CONNECTED); + this.emit(Server.CONNECT, this); + } + }); + } + + get clusterTime(): ClusterTime | undefined { + return this.s.topology.clusterTime; + } + + set clusterTime(clusterTime: ClusterTime | undefined) { + this.s.topology.clusterTime = clusterTime; + } + + get description(): ServerDescription { + return this.s.description; + } + + get name(): string { + return this.s.description.address; + } + + get autoEncrypter(): AutoEncrypter | undefined { + if (this.s.options && this.s.options.autoEncrypter) { + return this.s.options.autoEncrypter; + } + return; + } + + get loadBalanced(): boolean { + return this.s.topology.description.type === TopologyType.LoadBalanced; + } + + /** + * Initiate server connect + */ + connect(): void { + if (this.s.state !== STATE_CLOSED) { + return; + } + + stateTransition(this, STATE_CONNECTING); + + // If in load balancer mode we automatically set the server to + // a load balancer. It never transitions out of this state and + // has no monitor. + if (!this.loadBalanced) { + this[kMonitor]?.connect(); + } else { + stateTransition(this, STATE_CONNECTED); + this.emit(Server.CONNECT, this); + } + } + + /** Destroy the server connection */ + destroy(options?: DestroyOptions, callback?: Callback): void { + if (typeof options === 'function') (callback = options), (options = {}); + options = Object.assign({}, { force: false }, options); + + if (this.s.state === STATE_CLOSED) { + if (typeof callback === 'function') { + callback(); + } + + return; + } + + stateTransition(this, STATE_CLOSING); + + if (!this.loadBalanced) { + this[kMonitor]?.close(); + } + + this.s.pool.close(options, err => { + stateTransition(this, STATE_CLOSED); + this.emit('closed'); + if (typeof callback === 'function') { + callback(err); + } + }); + } + + /** + * Immediately schedule monitoring of this server. If there already an attempt being made + * this will be a no-op. + */ + requestCheck(): void { + if (!this.loadBalanced) { + this[kMonitor]?.requestCheck(); + } + } + + /** + * Execute a command + * @internal + */ + command( + ns: MongoDBNamespace, + cmd: Document, + options: CommandOptions, + callback: Callback + ): void { + if (callback == null) { + throw new MongoInvalidArgumentError('Callback must be provided'); + } + + if (ns.db == null || typeof ns === 'string') { + throw new MongoInvalidArgumentError('Namespace must not be a string'); + } + + if (this.s.state === STATE_CLOSING || this.s.state === STATE_CLOSED) { + callback(new MongoServerClosedError()); + return; + } + + // Clone the options + const finalOptions = Object.assign({}, options, { wireProtocolCommand: false }); + + // There are cases where we need to flag the read preference not to get sent in + // the command, such as pre-5.0 servers attempting to perform an aggregate write + // with a non-primary read preference. In this case the effective read preference + // (primary) is not the same as the provided and must be removed completely. + if (finalOptions.omitReadPreference) { + delete finalOptions.readPreference; + } + + // error if collation not supported + if (collationNotSupported(this, cmd)) { + callback(new MongoCompatibilityError(`Server ${this.name} does not support collation`)); + return; + } + + const session = finalOptions.session; + const conn = session?.pinnedConnection; + + // NOTE: This is a hack! We can't retrieve the connections used for executing an operation + // (and prevent them from being checked back in) at the point of operation execution. + // This should be considered as part of the work for NODE-2882 + // NOTE: + // When incrementing operation count, it's important that we increment it before we + // attempt to check out a connection from the pool. This ensures that operations that + // are waiting for a connection are included in the operation count. Load balanced + // mode will only ever have a single server, so the operation count doesn't matter. + // Incrementing the operation count above the logic to handle load balanced mode would + // require special logic to decrement it again, or would double increment (the load + // balanced code makes a recursive call). Instead, we increment the count after this + // check. + if (this.loadBalanced && session && conn == null && isPinnableCommand(cmd, session)) { + this.s.pool.checkOut((err, checkedOut) => { + if (err || checkedOut == null) { + if (callback) return callback(err); + return; + } + + session.pin(checkedOut); + this.command(ns, cmd, finalOptions, callback); + }); + return; + } + + this.s.operationCount += 1; + + this.s.pool.withConnection( + conn, + (err, conn, cb) => { + if (err || !conn) { + this.s.operationCount -= 1; + markServerUnknown(this, err); + return cb(err); + } + + conn.command( + ns, + cmd, + finalOptions, + makeOperationHandler(this, conn, cmd, finalOptions, (error, response) => { + this.s.operationCount -= 1; + cb(error, response); + }) + ); + }, + callback + ); + } + + /** + * Execute a `getMore` against the server + * @internal + */ + getMore( + ns: MongoDBNamespace, + cursorId: Long, + options: GetMoreOptions, + callback: Callback + ): void { + if (this.s.state === STATE_CLOSING || this.s.state === STATE_CLOSED) { + callback(new MongoServerClosedError()); + return; + } + + this.s.operationCount += 1; + + this.s.pool.withConnection( + options.session?.pinnedConnection, + (err, conn, cb) => { + if (err || !conn) { + this.s.operationCount -= 1; + markServerUnknown(this, err); + return cb(err); + } + + conn.getMore( + ns, + cursorId, + options, + makeOperationHandler(this, conn, {}, options, (error, response) => { + this.s.operationCount -= 1; + cb(error, response); + }) + ); + }, + callback + ); + } + + /** + * Execute a `killCursors` command against the server + * @internal + */ + killCursors( + ns: MongoDBNamespace, + cursorIds: Long[], + options: CommandOptions, + callback?: Callback + ): void { + if (this.s.state === STATE_CLOSING || this.s.state === STATE_CLOSED) { + if (typeof callback === 'function') { + callback(new MongoServerClosedError()); + } + + return; + } + + this.s.operationCount += 1; + this.s.pool.withConnection( + options.session?.pinnedConnection, + (err, conn, cb) => { + if (err || !conn) { + this.s.operationCount -= 1; + markServerUnknown(this, err); + return cb(err); + } + + conn.killCursors( + ns, + cursorIds, + options, + makeOperationHandler(this, conn, {}, undefined, (error, response) => { + this.s.operationCount -= 1; + cb(error, response); + }) + ); + }, + callback + ); + } +} + +function calculateRoundTripTime(oldRtt: number, duration: number): number { + if (oldRtt === -1) { + return duration; + } + + const alpha = 0.2; + return alpha * duration + (1 - alpha) * oldRtt; +} + +function markServerUnknown(server: Server, error?: MongoError) { + // Load balancer servers can never be marked unknown. + if (server.loadBalanced) { + return; + } + + if (error instanceof MongoNetworkError && !(error instanceof MongoNetworkTimeoutError)) { + server[kMonitor]?.reset(); + } + + server.emit( + Server.DESCRIPTION_RECEIVED, + new ServerDescription(server.description.hostAddress, undefined, { + error, + topologyVersion: + error && error.topologyVersion ? error.topologyVersion : server.description.topologyVersion + }) + ); +} + +function isPinnableCommand(cmd: Document, session?: ClientSession): boolean { + if (session) { + return ( + session.inTransaction() || + 'aggregate' in cmd || + 'find' in cmd || + 'getMore' in cmd || + 'listCollections' in cmd || + 'listIndexes' in cmd + ); + } + + return false; +} + +function connectionIsStale(pool: ConnectionPool, connection: Connection) { + if (connection.serviceId) { + return ( + connection.generation !== pool.serviceGenerations.get(connection.serviceId.toHexString()) + ); + } + + return connection.generation !== pool.generation; +} + +function shouldHandleStateChangeError(server: Server, err: MongoError) { + const etv = err.topologyVersion; + const stv = server.description.topologyVersion; + return compareTopologyVersion(stv, etv) < 0; +} + +function inActiveTransaction(session: ClientSession | undefined, cmd: Document) { + return session && session.inTransaction() && !isTransactionCommand(cmd); +} + +/** this checks the retryWrites option passed down from the client options, it + * does not check if the server supports retryable writes */ +function isRetryableWritesEnabled(topology: Topology) { + return topology.s.options.retryWrites !== false; +} + +function makeOperationHandler( + server: Server, + connection: Connection, + cmd: Document, + options: CommandOptions | GetMoreOptions | undefined, + callback: Callback +): Callback { + const session = options?.session; + return function handleOperationResult(error, result) { + if (result != null) { + return callback(undefined, result); + } + + if (!error) { + return callback(new MongoUnexpectedServerResponseError('Empty response with no error')); + } + + if (!(error instanceof MongoError)) { + // Node.js or some other error we have not special handling for + return callback(error); + } + + if (connectionIsStale(server.s.pool, connection)) { + return callback(error); + } + + if (error instanceof MongoNetworkError) { + if (session && !session.hasEnded && session.serverSession) { + session.serverSession.isDirty = true; + } + + // inActiveTransaction check handles commit and abort. + if ( + inActiveTransaction(session, cmd) && + !error.hasErrorLabel(MongoErrorLabel.TransientTransactionError) + ) { + error.addErrorLabel(MongoErrorLabel.TransientTransactionError); + } + + if ( + (isRetryableWritesEnabled(server.s.topology) || isTransactionCommand(cmd)) && + supportsRetryableWrites(server) && + !inActiveTransaction(session, cmd) + ) { + error.addErrorLabel(MongoErrorLabel.RetryableWriteError); + } + + if (!(error instanceof MongoNetworkTimeoutError) || isNetworkErrorBeforeHandshake(error)) { + // In load balanced mode we never mark the server as unknown and always + // clear for the specific service id. + + server.s.pool.clear(connection.serviceId); + if (!server.loadBalanced) { + markServerUnknown(server, error); + } + } + } else { + if ( + (isRetryableWritesEnabled(server.s.topology) || isTransactionCommand(cmd)) && + needsRetryableWriteLabel(error, maxWireVersion(server)) && + !inActiveTransaction(session, cmd) + ) { + error.addErrorLabel(MongoErrorLabel.RetryableWriteError); + } + + if (isSDAMUnrecoverableError(error)) { + if (shouldHandleStateChangeError(server, error)) { + if (maxWireVersion(server) <= 7 || isNodeShuttingDownError(error)) { + server.s.pool.clear(connection.serviceId); + } + + if (!server.loadBalanced) { + markServerUnknown(server, error); + process.nextTick(() => server.requestCheck()); + } + } + } + } + + if ( + session && + session.isPinned && + error.hasErrorLabel(MongoErrorLabel.TransientTransactionError) + ) { + session.unpin({ force: true }); + } + + return callback(error); + }; +} diff --git a/node_modules/mongodb/src/sdam/server_description.ts b/node_modules/mongodb/src/sdam/server_description.ts new file mode 100644 index 000000000..5082c7cb3 --- /dev/null +++ b/node_modules/mongodb/src/sdam/server_description.ts @@ -0,0 +1,272 @@ +import { Document, Long, ObjectId } from '../bson'; +import type { MongoError } from '../error'; +import { arrayStrictEqual, errorStrictEqual, HostAddress, now } from '../utils'; +import type { ClusterTime } from './common'; +import { ServerType } from './common'; + +const WRITABLE_SERVER_TYPES = new Set([ + ServerType.RSPrimary, + ServerType.Standalone, + ServerType.Mongos, + ServerType.LoadBalancer +]); + +const DATA_BEARING_SERVER_TYPES = new Set([ + ServerType.RSPrimary, + ServerType.RSSecondary, + ServerType.Mongos, + ServerType.Standalone, + ServerType.LoadBalancer +]); + +/** @public */ +export interface TopologyVersion { + processId: ObjectId; + counter: Long; +} + +/** @public */ +export type TagSet = { [key: string]: string }; + +/** @internal */ +export interface ServerDescriptionOptions { + /** An Error used for better reporting debugging */ + error?: MongoError; + + /** The round trip time to ping this server (in ms) */ + roundTripTime?: number; + + /** The topologyVersion */ + topologyVersion?: TopologyVersion; + + /** If the client is in load balancing mode. */ + loadBalanced?: boolean; +} + +/** + * The client's view of a single server, based on the most recent hello outcome. + * + * Internal type, not meant to be directly instantiated + * @public + */ +export class ServerDescription { + private _hostAddress: HostAddress; + address: string; + type: ServerType; + hosts: string[]; + passives: string[]; + arbiters: string[]; + tags: TagSet; + + error?: MongoError; + topologyVersion?: TopologyVersion; + minWireVersion: number; + maxWireVersion: number; + roundTripTime: number; + lastUpdateTime: number; + lastWriteDate: number; + + me?: string; + primary?: string; + setName?: string; + setVersion?: number; + electionId?: ObjectId; + logicalSessionTimeoutMinutes?: number; + + // NOTE: does this belong here? It seems we should gossip the cluster time at the CMAP level + $clusterTime?: ClusterTime; + + /** + * Create a ServerDescription + * @internal + * + * @param address - The address of the server + * @param hello - An optional hello response for this server + */ + constructor(address: HostAddress | string, hello?: Document, options?: ServerDescriptionOptions) { + if (typeof address === 'string') { + this._hostAddress = new HostAddress(address); + this.address = this._hostAddress.toString(); + } else { + this._hostAddress = address; + this.address = this._hostAddress.toString(); + } + this.type = parseServerType(hello, options); + this.hosts = hello?.hosts?.map((host: string) => host.toLowerCase()) ?? []; + this.passives = hello?.passives?.map((host: string) => host.toLowerCase()) ?? []; + this.arbiters = hello?.arbiters?.map((host: string) => host.toLowerCase()) ?? []; + this.tags = hello?.tags ?? {}; + this.minWireVersion = hello?.minWireVersion ?? 0; + this.maxWireVersion = hello?.maxWireVersion ?? 0; + this.roundTripTime = options?.roundTripTime ?? -1; + this.lastUpdateTime = now(); + this.lastWriteDate = hello?.lastWrite?.lastWriteDate ?? 0; + + if (options?.topologyVersion) { + this.topologyVersion = options.topologyVersion; + } else if (hello?.topologyVersion) { + this.topologyVersion = hello.topologyVersion; + } + + if (options?.error) { + this.error = options.error; + } + + if (hello?.primary) { + this.primary = hello.primary; + } + + if (hello?.me) { + this.me = hello.me.toLowerCase(); + } + + if (hello?.setName) { + this.setName = hello.setName; + } + + if (hello?.setVersion) { + this.setVersion = hello.setVersion; + } + + if (hello?.electionId) { + this.electionId = hello.electionId; + } + + if (hello?.logicalSessionTimeoutMinutes) { + this.logicalSessionTimeoutMinutes = hello.logicalSessionTimeoutMinutes; + } + + if (hello?.$clusterTime) { + this.$clusterTime = hello.$clusterTime; + } + } + + get hostAddress(): HostAddress { + if (this._hostAddress) return this._hostAddress; + else return new HostAddress(this.address); + } + + get allHosts(): string[] { + return this.hosts.concat(this.arbiters).concat(this.passives); + } + + /** Is this server available for reads*/ + get isReadable(): boolean { + return this.type === ServerType.RSSecondary || this.isWritable; + } + + /** Is this server data bearing */ + get isDataBearing(): boolean { + return DATA_BEARING_SERVER_TYPES.has(this.type); + } + + /** Is this server available for writes */ + get isWritable(): boolean { + return WRITABLE_SERVER_TYPES.has(this.type); + } + + get host(): string { + const chopLength = `:${this.port}`.length; + return this.address.slice(0, -chopLength); + } + + get port(): number { + const port = this.address.split(':').pop(); + return port ? Number.parseInt(port, 10) : 27017; + } + + /** + * Determines if another `ServerDescription` is equal to this one per the rules defined + * in the {@link https://github.com/mongodb/specifications/blob/master/source/server-discovery-and-monitoring/server-discovery-and-monitoring.rst#serverdescription|SDAM spec} + */ + equals(other: ServerDescription): boolean { + const topologyVersionsEqual = + this.topologyVersion === other.topologyVersion || + compareTopologyVersion(this.topologyVersion, other.topologyVersion) === 0; + + const electionIdsEqual: boolean = + this.electionId && other.electionId + ? other.electionId && this.electionId.equals(other.electionId) + : this.electionId === other.electionId; + + return ( + other != null && + errorStrictEqual(this.error, other.error) && + this.type === other.type && + this.minWireVersion === other.minWireVersion && + arrayStrictEqual(this.hosts, other.hosts) && + tagsStrictEqual(this.tags, other.tags) && + this.setName === other.setName && + this.setVersion === other.setVersion && + electionIdsEqual && + this.primary === other.primary && + this.logicalSessionTimeoutMinutes === other.logicalSessionTimeoutMinutes && + topologyVersionsEqual + ); + } +} + +// Parses a `hello` message and determines the server type +export function parseServerType(hello?: Document, options?: ServerDescriptionOptions): ServerType { + if (options?.loadBalanced) { + return ServerType.LoadBalancer; + } + + if (!hello || !hello.ok) { + return ServerType.Unknown; + } + + if (hello.isreplicaset) { + return ServerType.RSGhost; + } + + if (hello.msg && hello.msg === 'isdbgrid') { + return ServerType.Mongos; + } + + if (hello.setName) { + if (hello.hidden) { + return ServerType.RSOther; + } else if (hello.isWritablePrimary) { + return ServerType.RSPrimary; + } else if (hello.secondary) { + return ServerType.RSSecondary; + } else if (hello.arbiterOnly) { + return ServerType.RSArbiter; + } else { + return ServerType.RSOther; + } + } + + return ServerType.Standalone; +} + +function tagsStrictEqual(tags: TagSet, tags2: TagSet): boolean { + const tagsKeys = Object.keys(tags); + const tags2Keys = Object.keys(tags2); + + return ( + tagsKeys.length === tags2Keys.length && + tagsKeys.every((key: string) => tags2[key] === tags[key]) + ); +} + +/** + * Compares two topology versions. + * + * @returns A negative number if `lhs` is older than `rhs`; positive if `lhs` is newer than `rhs`; 0 if they are equivalent. + */ +export function compareTopologyVersion(lhs?: TopologyVersion, rhs?: TopologyVersion): number { + if (lhs == null || rhs == null) { + return -1; + } + + if (lhs.processId.equals(rhs.processId)) { + // tests mock counter as just number, but in a real situation counter should always be a Long + const lhsCounter = Long.isLong(lhs.counter) ? lhs.counter : Long.fromNumber(lhs.counter); + const rhsCounter = Long.isLong(rhs.counter) ? lhs.counter : Long.fromNumber(rhs.counter); + return lhsCounter.compare(rhsCounter); + } + + return -1; +} diff --git a/node_modules/mongodb/src/sdam/server_selection.ts b/node_modules/mongodb/src/sdam/server_selection.ts new file mode 100644 index 000000000..74bbd8918 --- /dev/null +++ b/node_modules/mongodb/src/sdam/server_selection.ts @@ -0,0 +1,324 @@ +import { MongoCompatibilityError, MongoInvalidArgumentError } from '../error'; +import { ReadPreference } from '../read_preference'; +import { ServerType, TopologyType } from './common'; +import type { ServerDescription, TagSet } from './server_description'; +import type { TopologyDescription } from './topology_description'; + +// max staleness constants +const IDLE_WRITE_PERIOD = 10000; +const SMALLEST_MAX_STALENESS_SECONDS = 90; + +// Minimum version to try writes on secondaries. +export const MIN_SECONDARY_WRITE_WIRE_VERSION = 13; + +/** @public */ +export type ServerSelector = ( + topologyDescription: TopologyDescription, + servers: ServerDescription[] +) => ServerDescription[]; + +/** + * Returns a server selector that selects for writable servers + */ +export function writableServerSelector(): ServerSelector { + return ( + topologyDescription: TopologyDescription, + servers: ServerDescription[] + ): ServerDescription[] => + latencyWindowReducer( + topologyDescription, + servers.filter((s: ServerDescription) => s.isWritable) + ); +} + +/** + * The purpose of this selector is to select the same server, only + * if it is in a state that it can have commands sent to it. + */ +export function sameServerSelector(description?: ServerDescription): ServerSelector { + return ( + topologyDescription: TopologyDescription, + servers: ServerDescription[] + ): ServerDescription[] => { + if (!description) return []; + // Filter the servers to match the provided description only if + // the type is not unknown. + return servers.filter(sd => { + return sd.address === description.address && sd.type !== ServerType.Unknown; + }); + }; +} + +/** + * Returns a server selector that uses a read preference to select a + * server potentially for a write on a secondary. + */ +export function secondaryWritableServerSelector( + wireVersion?: number, + readPreference?: ReadPreference +): ServerSelector { + // If server version < 5.0, read preference always primary. + // If server version >= 5.0... + // - If read preference is supplied, use that. + // - If no read preference is supplied, use primary. + if ( + !readPreference || + !wireVersion || + (wireVersion && wireVersion < MIN_SECONDARY_WRITE_WIRE_VERSION) + ) { + return readPreferenceServerSelector(ReadPreference.primary); + } + return readPreferenceServerSelector(readPreference); +} + +/** + * Reduces the passed in array of servers by the rules of the "Max Staleness" specification + * found here: https://github.com/mongodb/specifications/blob/master/source/max-staleness/max-staleness.rst + * + * @param readPreference - The read preference providing max staleness guidance + * @param topologyDescription - The topology description + * @param servers - The list of server descriptions to be reduced + * @returns The list of servers that satisfy the requirements of max staleness + */ +function maxStalenessReducer( + readPreference: ReadPreference, + topologyDescription: TopologyDescription, + servers: ServerDescription[] +): ServerDescription[] { + if (readPreference.maxStalenessSeconds == null || readPreference.maxStalenessSeconds < 0) { + return servers; + } + + const maxStaleness = readPreference.maxStalenessSeconds; + const maxStalenessVariance = + (topologyDescription.heartbeatFrequencyMS + IDLE_WRITE_PERIOD) / 1000; + if (maxStaleness < maxStalenessVariance) { + throw new MongoInvalidArgumentError( + `Option "maxStalenessSeconds" must be at least ${maxStalenessVariance} seconds` + ); + } + + if (maxStaleness < SMALLEST_MAX_STALENESS_SECONDS) { + throw new MongoInvalidArgumentError( + `Option "maxStalenessSeconds" must be at least ${SMALLEST_MAX_STALENESS_SECONDS} seconds` + ); + } + + if (topologyDescription.type === TopologyType.ReplicaSetWithPrimary) { + const primary: ServerDescription = Array.from(topologyDescription.servers.values()).filter( + primaryFilter + )[0]; + + return servers.reduce((result: ServerDescription[], server: ServerDescription) => { + const stalenessMS = + server.lastUpdateTime - + server.lastWriteDate - + (primary.lastUpdateTime - primary.lastWriteDate) + + topologyDescription.heartbeatFrequencyMS; + + const staleness = stalenessMS / 1000; + const maxStalenessSeconds = readPreference.maxStalenessSeconds ?? 0; + if (staleness <= maxStalenessSeconds) { + result.push(server); + } + + return result; + }, []); + } + + if (topologyDescription.type === TopologyType.ReplicaSetNoPrimary) { + if (servers.length === 0) { + return servers; + } + + const sMax = servers.reduce((max: ServerDescription, s: ServerDescription) => + s.lastWriteDate > max.lastWriteDate ? s : max + ); + + return servers.reduce((result: ServerDescription[], server: ServerDescription) => { + const stalenessMS = + sMax.lastWriteDate - server.lastWriteDate + topologyDescription.heartbeatFrequencyMS; + + const staleness = stalenessMS / 1000; + const maxStalenessSeconds = readPreference.maxStalenessSeconds ?? 0; + if (staleness <= maxStalenessSeconds) { + result.push(server); + } + + return result; + }, []); + } + + return servers; +} + +/** + * Determines whether a server's tags match a given set of tags + * + * @param tagSet - The requested tag set to match + * @param serverTags - The server's tags + */ +function tagSetMatch(tagSet: TagSet, serverTags: TagSet) { + const keys = Object.keys(tagSet); + const serverTagKeys = Object.keys(serverTags); + for (let i = 0; i < keys.length; ++i) { + const key = keys[i]; + if (serverTagKeys.indexOf(key) === -1 || serverTags[key] !== tagSet[key]) { + return false; + } + } + + return true; +} + +/** + * Reduces a set of server descriptions based on tags requested by the read preference + * + * @param readPreference - The read preference providing the requested tags + * @param servers - The list of server descriptions to reduce + * @returns The list of servers matching the requested tags + */ +function tagSetReducer( + readPreference: ReadPreference, + servers: ServerDescription[] +): ServerDescription[] { + if ( + readPreference.tags == null || + (Array.isArray(readPreference.tags) && readPreference.tags.length === 0) + ) { + return servers; + } + + for (let i = 0; i < readPreference.tags.length; ++i) { + const tagSet = readPreference.tags[i]; + const serversMatchingTagset = servers.reduce( + (matched: ServerDescription[], server: ServerDescription) => { + if (tagSetMatch(tagSet, server.tags)) matched.push(server); + return matched; + }, + [] + ); + + if (serversMatchingTagset.length) { + return serversMatchingTagset; + } + } + + return []; +} + +/** + * Reduces a list of servers to ensure they fall within an acceptable latency window. This is + * further specified in the "Server Selection" specification, found here: + * https://github.com/mongodb/specifications/blob/master/source/server-selection/server-selection.rst + * + * @param topologyDescription - The topology description + * @param servers - The list of servers to reduce + * @returns The servers which fall within an acceptable latency window + */ +function latencyWindowReducer( + topologyDescription: TopologyDescription, + servers: ServerDescription[] +): ServerDescription[] { + const low = servers.reduce( + (min: number, server: ServerDescription) => + min === -1 ? server.roundTripTime : Math.min(server.roundTripTime, min), + -1 + ); + + const high = low + topologyDescription.localThresholdMS; + return servers.reduce((result: ServerDescription[], server: ServerDescription) => { + if (server.roundTripTime <= high && server.roundTripTime >= low) result.push(server); + return result; + }, []); +} + +// filters +function primaryFilter(server: ServerDescription): boolean { + return server.type === ServerType.RSPrimary; +} + +function secondaryFilter(server: ServerDescription): boolean { + return server.type === ServerType.RSSecondary; +} + +function nearestFilter(server: ServerDescription): boolean { + return server.type === ServerType.RSSecondary || server.type === ServerType.RSPrimary; +} + +function knownFilter(server: ServerDescription): boolean { + return server.type !== ServerType.Unknown; +} + +function loadBalancerFilter(server: ServerDescription): boolean { + return server.type === ServerType.LoadBalancer; +} + +/** + * Returns a function which selects servers based on a provided read preference + * + * @param readPreference - The read preference to select with + */ +export function readPreferenceServerSelector(readPreference: ReadPreference): ServerSelector { + if (!readPreference.isValid()) { + throw new MongoInvalidArgumentError('Invalid read preference specified'); + } + + return ( + topologyDescription: TopologyDescription, + servers: ServerDescription[] + ): ServerDescription[] => { + const commonWireVersion = topologyDescription.commonWireVersion; + if ( + commonWireVersion && + readPreference.minWireVersion && + readPreference.minWireVersion > commonWireVersion + ) { + throw new MongoCompatibilityError( + `Minimum wire version '${readPreference.minWireVersion}' required, but found '${commonWireVersion}'` + ); + } + + if (topologyDescription.type === TopologyType.LoadBalanced) { + return servers.filter(loadBalancerFilter); + } + + if (topologyDescription.type === TopologyType.Unknown) { + return []; + } + + if ( + topologyDescription.type === TopologyType.Single || + topologyDescription.type === TopologyType.Sharded + ) { + return latencyWindowReducer(topologyDescription, servers.filter(knownFilter)); + } + + const mode = readPreference.mode; + if (mode === ReadPreference.PRIMARY) { + return servers.filter(primaryFilter); + } + + if (mode === ReadPreference.PRIMARY_PREFERRED) { + const result = servers.filter(primaryFilter); + if (result.length) { + return result; + } + } + + const filter = mode === ReadPreference.NEAREST ? nearestFilter : secondaryFilter; + const selectedServers = latencyWindowReducer( + topologyDescription, + tagSetReducer( + readPreference, + maxStalenessReducer(readPreference, topologyDescription, servers.filter(filter)) + ) + ); + + if (mode === ReadPreference.SECONDARY_PREFERRED && selectedServers.length === 0) { + return servers.filter(primaryFilter); + } + + return selectedServers; + }; +} diff --git a/node_modules/mongodb/src/sdam/srv_polling.ts b/node_modules/mongodb/src/sdam/srv_polling.ts new file mode 100644 index 000000000..71ee20a47 --- /dev/null +++ b/node_modules/mongodb/src/sdam/srv_polling.ts @@ -0,0 +1,165 @@ +import * as dns from 'dns'; +import { setTimeout } from 'timers'; + +import { MongoRuntimeError } from '../error'; +import { Logger, LoggerOptions } from '../logger'; +import { TypedEventEmitter } from '../mongo_types'; +import { HostAddress } from '../utils'; + +/** + * Determines whether a provided address matches the provided parent domain in order + * to avoid certain attack vectors. + * + * @param srvAddress - The address to check against a domain + * @param parentDomain - The domain to check the provided address against + * @returns Whether the provided address matches the parent domain + */ +function matchesParentDomain(srvAddress: string, parentDomain: string): boolean { + const regex = /^.*?\./; + const srv = `.${srvAddress.replace(regex, '')}`; + const parent = `.${parentDomain.replace(regex, '')}`; + return srv.endsWith(parent); +} + +/** + * @internal + * @category Event + */ +export class SrvPollingEvent { + srvRecords: dns.SrvRecord[]; + constructor(srvRecords: dns.SrvRecord[]) { + this.srvRecords = srvRecords; + } + + hostnames(): Set { + return new Set(this.srvRecords.map(r => HostAddress.fromSrvRecord(r).toString())); + } +} + +/** @internal */ +export interface SrvPollerOptions extends LoggerOptions { + srvServiceName: string; + srvMaxHosts: number; + srvHost: string; + heartbeatFrequencyMS: number; +} + +/** @internal */ +export type SrvPollerEvents = { + srvRecordDiscovery(event: SrvPollingEvent): void; +}; + +/** @internal */ +export class SrvPoller extends TypedEventEmitter { + srvHost: string; + rescanSrvIntervalMS: number; + heartbeatFrequencyMS: number; + logger: Logger; + haMode: boolean; + generation: number; + srvMaxHosts: number; + srvServiceName: string; + _timeout?: NodeJS.Timeout; + + /** @event */ + static readonly SRV_RECORD_DISCOVERY = 'srvRecordDiscovery' as const; + + constructor(options: SrvPollerOptions) { + super(); + + if (!options || !options.srvHost) { + throw new MongoRuntimeError('Options for SrvPoller must exist and include srvHost'); + } + + this.srvHost = options.srvHost; + this.srvMaxHosts = options.srvMaxHosts ?? 0; + this.srvServiceName = options.srvServiceName ?? 'mongodb'; + this.rescanSrvIntervalMS = 60000; + this.heartbeatFrequencyMS = options.heartbeatFrequencyMS ?? 10000; + this.logger = new Logger('srvPoller', options); + + this.haMode = false; + this.generation = 0; + + this._timeout = undefined; + } + + get srvAddress(): string { + return `_${this.srvServiceName}._tcp.${this.srvHost}`; + } + + get intervalMS(): number { + return this.haMode ? this.heartbeatFrequencyMS : this.rescanSrvIntervalMS; + } + + start(): void { + if (!this._timeout) { + this.schedule(); + } + } + + stop(): void { + if (this._timeout) { + clearTimeout(this._timeout); + this.generation += 1; + this._timeout = undefined; + } + } + + schedule(): void { + if (this._timeout) { + clearTimeout(this._timeout); + } + + this._timeout = setTimeout(() => this._poll(), this.intervalMS); + } + + success(srvRecords: dns.SrvRecord[]): void { + this.haMode = false; + this.schedule(); + this.emit(SrvPoller.SRV_RECORD_DISCOVERY, new SrvPollingEvent(srvRecords)); + } + + failure(message: string, obj?: NodeJS.ErrnoException): void { + this.logger.warn(message, obj); + this.haMode = true; + this.schedule(); + } + + parentDomainMismatch(srvRecord: dns.SrvRecord): void { + this.logger.warn( + `parent domain mismatch on SRV record (${srvRecord.name}:${srvRecord.port})`, + srvRecord + ); + } + + _poll(): void { + const generation = this.generation; + dns.resolveSrv(this.srvAddress, (err, srvRecords) => { + if (generation !== this.generation) { + return; + } + + if (err) { + this.failure('DNS error', err); + return; + } + + const finalAddresses: dns.SrvRecord[] = []; + for (const record of srvRecords) { + if (matchesParentDomain(record.name, this.srvHost)) { + finalAddresses.push(record); + } else { + this.parentDomainMismatch(record); + } + } + + if (!finalAddresses.length) { + this.failure('No valid addresses found at host'); + return; + } + + this.success(finalAddresses); + }); + } +} diff --git a/node_modules/mongodb/src/sdam/topology.ts b/node_modules/mongodb/src/sdam/topology.ts new file mode 100644 index 000000000..c489385c2 --- /dev/null +++ b/node_modules/mongodb/src/sdam/topology.ts @@ -0,0 +1,1073 @@ +import Denque = require('denque'); +import { setTimeout } from 'timers'; + +import type { BSONSerializeOptions, Document } from '../bson'; +import { deserialize, serialize } from '../bson'; +import type { MongoCredentials } from '../cmap/auth/mongo_credentials'; +import type { ConnectionEvents, DestroyOptions } from '../cmap/connection'; +import type { CloseOptions, ConnectionPoolEvents } from '../cmap/connection_pool'; +import { DEFAULT_OPTIONS, FEATURE_FLAGS } from '../connection_string'; +import { + CLOSE, + CONNECT, + ERROR, + LOCAL_SERVER_EVENTS, + OPEN, + SERVER_CLOSED, + SERVER_DESCRIPTION_CHANGED, + SERVER_OPENING, + SERVER_RELAY_EVENTS, + TIMEOUT, + TOPOLOGY_CLOSED, + TOPOLOGY_DESCRIPTION_CHANGED, + TOPOLOGY_OPENING +} from '../constants'; +import { + MongoCompatibilityError, + MongoDriverError, + MongoRuntimeError, + MongoServerSelectionError, + MongoTopologyClosedError +} from '../error'; +import type { MongoClient, MongoOptions, ServerApi } from '../mongo_client'; +import { TypedEventEmitter } from '../mongo_types'; +import { ReadPreference, ReadPreferenceLike } from '../read_preference'; +import { + ClientSession, + ClientSessionOptions, + ServerSessionId, + ServerSessionPool +} from '../sessions'; +import type { Transaction } from '../transactions'; +import { + Callback, + ClientMetadata, + eachAsync, + emitWarning, + EventEmitterWithState, + HostAddress, + makeStateMachine, + ns, + shuffle +} from '../utils'; +import { + _advanceClusterTime, + ClusterTime, + drainTimerQueue, + ServerType, + STATE_CLOSED, + STATE_CLOSING, + STATE_CONNECTED, + STATE_CONNECTING, + TimerQueue, + TopologyType +} from './common'; +import { + ServerClosedEvent, + ServerDescriptionChangedEvent, + ServerOpeningEvent, + TopologyClosedEvent, + TopologyDescriptionChangedEvent, + TopologyOpeningEvent +} from './events'; +import { Server, ServerEvents, ServerOptions } from './server'; +import { compareTopologyVersion, ServerDescription } from './server_description'; +import { readPreferenceServerSelector, ServerSelector } from './server_selection'; +import { SrvPoller, SrvPollingEvent } from './srv_polling'; +import { TopologyDescription } from './topology_description'; + +// Global state +let globalTopologyCounter = 0; + +const stateTransition = makeStateMachine({ + [STATE_CLOSED]: [STATE_CLOSED, STATE_CONNECTING], + [STATE_CONNECTING]: [STATE_CONNECTING, STATE_CLOSING, STATE_CONNECTED, STATE_CLOSED], + [STATE_CONNECTED]: [STATE_CONNECTED, STATE_CLOSING, STATE_CLOSED], + [STATE_CLOSING]: [STATE_CLOSING, STATE_CLOSED] +}); + +/** @internal */ +const kCancelled = Symbol('cancelled'); +/** @internal */ +const kWaitQueue = Symbol('waitQueue'); + +/** @internal */ +export type ServerSelectionCallback = Callback; + +/** @internal */ +export interface ServerSelectionRequest { + serverSelector: ServerSelector; + transaction?: Transaction; + callback: ServerSelectionCallback; + timer?: NodeJS.Timeout; + [kCancelled]?: boolean; +} + +/** @internal */ +export interface TopologyPrivate { + /** the id of this topology */ + id: number; + /** passed in options */ + options: TopologyOptions; + /** initial seedlist of servers to connect to */ + seedlist: HostAddress[]; + /** initial state */ + state: string; + /** the topology description */ + description: TopologyDescription; + serverSelectionTimeoutMS: number; + heartbeatFrequencyMS: number; + minHeartbeatFrequencyMS: number; + /** A map of server instances to normalized addresses */ + servers: Map; + /** Server Session Pool */ + sessionPool: ServerSessionPool; + /** Active client sessions */ + sessions: Set; + credentials?: MongoCredentials; + clusterTime?: ClusterTime; + /** timers created for the initial connect to a server */ + connectionTimers: TimerQueue; + + /** related to srv polling */ + srvPoller?: SrvPoller; + detectShardedTopology: (event: TopologyDescriptionChangedEvent) => void; + detectSrvRecords: (event: SrvPollingEvent) => void; +} + +/** @public */ +export interface TopologyOptions extends BSONSerializeOptions, ServerOptions { + srvMaxHosts: number; + srvServiceName: string; + hosts: HostAddress[]; + retryWrites: boolean; + retryReads: boolean; + /** How long to block for server selection before throwing an error */ + serverSelectionTimeoutMS: number; + /** The name of the replica set to connect to */ + replicaSet?: string; + srvHost?: string; + /** @internal */ + srvPoller?: SrvPoller; + /** Indicates that a client should directly connect to a node without attempting to discover its topology type */ + directConnection: boolean; + loadBalanced: boolean; + metadata: ClientMetadata; + /** MongoDB server API version */ + serverApi?: ServerApi; + /** @internal */ + [featureFlag: symbol]: any; +} + +/** @public */ +export interface ConnectOptions { + readPreference?: ReadPreference; +} + +/** @public */ +export interface SelectServerOptions { + readPreference?: ReadPreferenceLike; + /** How long to block for server selection before throwing an error */ + serverSelectionTimeoutMS?: number; + session?: ClientSession; +} + +/** @public */ +export type TopologyEvents = { + /** Top level MongoClient doesn't emit this so it is marked: @internal */ + connect(topology: Topology): void; + serverOpening(event: ServerOpeningEvent): void; + serverClosed(event: ServerClosedEvent): void; + serverDescriptionChanged(event: ServerDescriptionChangedEvent): void; + topologyClosed(event: TopologyClosedEvent): void; + topologyOpening(event: TopologyOpeningEvent): void; + topologyDescriptionChanged(event: TopologyDescriptionChangedEvent): void; + error(error: Error): void; + /** @internal */ + open(topology: Topology): void; + close(): void; + timeout(): void; +} & Omit & + ConnectionPoolEvents & + ConnectionEvents & + EventEmitterWithState; +/** + * A container of server instances representing a connection to a MongoDB topology. + * @internal + */ +export class Topology extends TypedEventEmitter { + /** @internal */ + s: TopologyPrivate; + /** @internal */ + [kWaitQueue]: Denque; + /** @internal */ + hello?: Document; + /** @internal */ + _type?: string; + + client!: MongoClient; + + /** @event */ + static readonly SERVER_OPENING = SERVER_OPENING; + /** @event */ + static readonly SERVER_CLOSED = SERVER_CLOSED; + /** @event */ + static readonly SERVER_DESCRIPTION_CHANGED = SERVER_DESCRIPTION_CHANGED; + /** @event */ + static readonly TOPOLOGY_OPENING = TOPOLOGY_OPENING; + /** @event */ + static readonly TOPOLOGY_CLOSED = TOPOLOGY_CLOSED; + /** @event */ + static readonly TOPOLOGY_DESCRIPTION_CHANGED = TOPOLOGY_DESCRIPTION_CHANGED; + /** @event */ + static readonly ERROR = ERROR; + /** @event */ + static readonly OPEN = OPEN; + /** @event */ + static readonly CONNECT = CONNECT; + /** @event */ + static readonly CLOSE = CLOSE; + /** @event */ + static readonly TIMEOUT = TIMEOUT; + + /** + * @internal + * + * @privateRemarks + * mongodb-client-encryption's class ClientEncryption falls back to finding the bson lib + * defined on client.topology.bson, in order to maintain compatibility with any version + * of mongodb-client-encryption we keep a reference to serialize and deserialize here. + */ + bson: { serialize: typeof serialize; deserialize: typeof deserialize }; + + /** + * @param seedlist - a list of HostAddress instances to connect to + */ + constructor(seeds: string | string[] | HostAddress | HostAddress[], options: TopologyOptions) { + super(); + + // Legacy CSFLE support + this.bson = Object.create(null); + this.bson.serialize = serialize; + this.bson.deserialize = deserialize; + + // Options should only be undefined in tests, MongoClient will always have defined options + options = options ?? { + hosts: [HostAddress.fromString('localhost:27017')], + ...Object.fromEntries(DEFAULT_OPTIONS.entries()), + ...Object.fromEntries(FEATURE_FLAGS.entries()) + }; + + if (typeof seeds === 'string') { + seeds = [HostAddress.fromString(seeds)]; + } else if (!Array.isArray(seeds)) { + seeds = [seeds]; + } + + const seedlist: HostAddress[] = []; + for (const seed of seeds) { + if (typeof seed === 'string') { + seedlist.push(HostAddress.fromString(seed)); + } else if (seed instanceof HostAddress) { + seedlist.push(seed); + } else { + // FIXME(NODE-3483): May need to be a MongoParseError + throw new MongoRuntimeError(`Topology cannot be constructed from ${JSON.stringify(seed)}`); + } + } + + const topologyType = topologyTypeFromOptions(options); + const topologyId = globalTopologyCounter++; + + const selectedHosts = + options.srvMaxHosts == null || + options.srvMaxHosts === 0 || + options.srvMaxHosts >= seedlist.length + ? seedlist + : shuffle(seedlist, options.srvMaxHosts); + + const serverDescriptions = new Map(); + for (const hostAddress of selectedHosts) { + serverDescriptions.set(hostAddress.toString(), new ServerDescription(hostAddress)); + } + + this[kWaitQueue] = new Denque(); + this.s = { + // the id of this topology + id: topologyId, + // passed in options + options, + // initial seedlist of servers to connect to + seedlist, + // initial state + state: STATE_CLOSED, + // the topology description + description: new TopologyDescription( + topologyType, + serverDescriptions, + options.replicaSet, + undefined, + undefined, + undefined, + options + ), + serverSelectionTimeoutMS: options.serverSelectionTimeoutMS, + heartbeatFrequencyMS: options.heartbeatFrequencyMS, + minHeartbeatFrequencyMS: options.minHeartbeatFrequencyMS, + // a map of server instances to normalized addresses + servers: new Map(), + // Server Session Pool + sessionPool: new ServerSessionPool(this), + // Active client sessions + sessions: new Set(), + credentials: options?.credentials, + clusterTime: undefined, + + // timer management + connectionTimers: new Set(), + detectShardedTopology: ev => this.detectShardedTopology(ev), + detectSrvRecords: ev => this.detectSrvRecords(ev) + }; + + if (options.srvHost && !options.loadBalanced) { + this.s.srvPoller = + options.srvPoller ?? + new SrvPoller({ + heartbeatFrequencyMS: this.s.heartbeatFrequencyMS, + srvHost: options.srvHost, + srvMaxHosts: options.srvMaxHosts, + srvServiceName: options.srvServiceName + }); + + this.on(Topology.TOPOLOGY_DESCRIPTION_CHANGED, this.s.detectShardedTopology); + } + } + + private detectShardedTopology(event: TopologyDescriptionChangedEvent) { + const previousType = event.previousDescription.type; + const newType = event.newDescription.type; + + const transitionToSharded = + previousType !== TopologyType.Sharded && newType === TopologyType.Sharded; + const srvListeners = this.s.srvPoller?.listeners(SrvPoller.SRV_RECORD_DISCOVERY); + const listeningToSrvPolling = !!srvListeners?.includes(this.s.detectSrvRecords); + + if (transitionToSharded && !listeningToSrvPolling) { + this.s.srvPoller?.on(SrvPoller.SRV_RECORD_DISCOVERY, this.s.detectSrvRecords); + this.s.srvPoller?.start(); + } + } + + private detectSrvRecords(ev: SrvPollingEvent) { + const previousTopologyDescription = this.s.description; + this.s.description = this.s.description.updateFromSrvPollingEvent( + ev, + this.s.options.srvMaxHosts + ); + if (this.s.description === previousTopologyDescription) { + // Nothing changed, so return + return; + } + + updateServers(this); + + this.emit( + Topology.TOPOLOGY_DESCRIPTION_CHANGED, + new TopologyDescriptionChangedEvent( + this.s.id, + previousTopologyDescription, + this.s.description + ) + ); + } + + /** + * @returns A `TopologyDescription` for this topology + */ + get description(): TopologyDescription { + return this.s.description; + } + + get loadBalanced(): boolean { + return this.s.options.loadBalanced; + } + + get capabilities(): ServerCapabilities { + return new ServerCapabilities(this.lastHello()); + } + + /** Initiate server connect */ + connect(options?: ConnectOptions, callback?: Callback): void { + if (typeof options === 'function') (callback = options), (options = {}); + options = options ?? {}; + if (this.s.state === STATE_CONNECTED) { + if (typeof callback === 'function') { + callback(); + } + + return; + } + + stateTransition(this, STATE_CONNECTING); + + // emit SDAM monitoring events + this.emit(Topology.TOPOLOGY_OPENING, new TopologyOpeningEvent(this.s.id)); + + // emit an event for the topology change + this.emit( + Topology.TOPOLOGY_DESCRIPTION_CHANGED, + new TopologyDescriptionChangedEvent( + this.s.id, + new TopologyDescription(TopologyType.Unknown), // initial is always Unknown + this.s.description + ) + ); + + // connect all known servers, then attempt server selection to connect + const serverDescriptions = Array.from(this.s.description.servers.values()); + this.s.servers = new Map( + serverDescriptions.map(serverDescription => [ + serverDescription.address, + createAndConnectServer(this, serverDescription) + ]) + ); + + // In load balancer mode we need to fake a server description getting + // emitted from the monitor, since the monitor doesn't exist. + if (this.s.options.loadBalanced) { + for (const description of serverDescriptions) { + const newDescription = new ServerDescription(description.hostAddress, undefined, { + loadBalanced: this.s.options.loadBalanced + }); + this.serverUpdateHandler(newDescription); + } + } + + const readPreference = options.readPreference ?? ReadPreference.primary; + this.selectServer(readPreferenceServerSelector(readPreference), options, (err, server) => { + if (err) { + this.close(); + + typeof callback === 'function' ? callback(err) : this.emit(Topology.ERROR, err); + return; + } + + // TODO: NODE-2471 + const skipPingOnConnect = this.s.options[Symbol.for('@@mdb.skipPingOnConnect')] === true; + if (!skipPingOnConnect && server && this.s.credentials) { + server.command(ns('admin.$cmd'), { ping: 1 }, {}, err => { + if (err) { + typeof callback === 'function' ? callback(err) : this.emit(Topology.ERROR, err); + return; + } + + stateTransition(this, STATE_CONNECTED); + this.emit(Topology.OPEN, this); + this.emit(Topology.CONNECT, this); + + if (typeof callback === 'function') callback(undefined, this); + }); + + return; + } + + stateTransition(this, STATE_CONNECTED); + this.emit(Topology.OPEN, this); + this.emit(Topology.CONNECT, this); + + if (typeof callback === 'function') callback(undefined, this); + }); + } + + /** Close this topology */ + close(options?: CloseOptions, callback?: Callback): void { + if (typeof options === 'function') { + callback = options; + options = {}; + } + + if (typeof options === 'boolean') { + options = { force: options }; + } + + options = options ?? {}; + if (this.s.state === STATE_CLOSED || this.s.state === STATE_CLOSING) { + if (typeof callback === 'function') { + callback(); + } + + return; + } + + stateTransition(this, STATE_CLOSING); + + drainWaitQueue(this[kWaitQueue], new MongoTopologyClosedError()); + drainTimerQueue(this.s.connectionTimers); + + if (this.s.srvPoller) { + this.s.srvPoller.stop(); + this.s.srvPoller.removeListener(SrvPoller.SRV_RECORD_DISCOVERY, this.s.detectSrvRecords); + } + + this.removeListener(Topology.TOPOLOGY_DESCRIPTION_CHANGED, this.s.detectShardedTopology); + + eachAsync( + Array.from(this.s.sessions.values()), + (session, cb) => session.endSession(cb), + () => { + this.s.sessionPool.endAllPooledSessions(() => { + eachAsync( + Array.from(this.s.servers.values()), + (server, cb) => destroyServer(server, this, options, cb), + err => { + this.s.servers.clear(); + + // emit an event for close + this.emit(Topology.TOPOLOGY_CLOSED, new TopologyClosedEvent(this.s.id)); + + stateTransition(this, STATE_CLOSED); + + if (typeof callback === 'function') { + callback(err); + } + } + ); + }); + } + ); + } + + /** + * Selects a server according to the selection predicate provided + * + * @param selector - An optional selector to select servers by, defaults to a random selection within a latency window + * @param options - Optional settings related to server selection + * @param callback - The callback used to indicate success or failure + * @returns An instance of a `Server` meeting the criteria of the predicate provided + */ + selectServer( + selector: string | ReadPreference | ServerSelector, + options: SelectServerOptions, + callback: Callback + ): void { + let serverSelector; + if (typeof selector !== 'function') { + if (typeof selector === 'string') { + serverSelector = readPreferenceServerSelector(ReadPreference.fromString(selector)); + } else { + let readPreference; + if (selector instanceof ReadPreference) { + readPreference = selector; + } else { + ReadPreference.translate(options); + readPreference = options.readPreference || ReadPreference.primary; + } + + serverSelector = readPreferenceServerSelector(readPreference as ReadPreference); + } + } else { + serverSelector = selector; + } + + options = Object.assign( + {}, + { serverSelectionTimeoutMS: this.s.serverSelectionTimeoutMS }, + options + ); + + const isSharded = this.description.type === TopologyType.Sharded; + const session = options.session; + const transaction = session && session.transaction; + + if (isSharded && transaction && transaction.server) { + callback(undefined, transaction.server); + return; + } + + const waitQueueMember: ServerSelectionRequest = { + serverSelector, + transaction, + callback + }; + + const serverSelectionTimeoutMS = options.serverSelectionTimeoutMS; + if (serverSelectionTimeoutMS) { + waitQueueMember.timer = setTimeout(() => { + waitQueueMember[kCancelled] = true; + waitQueueMember.timer = undefined; + const timeoutError = new MongoServerSelectionError( + `Server selection timed out after ${serverSelectionTimeoutMS} ms`, + this.description + ); + + waitQueueMember.callback(timeoutError); + }, serverSelectionTimeoutMS); + } + + this[kWaitQueue].push(waitQueueMember); + processWaitQueue(this); + } + + // Sessions related methods + + /** + * @returns Whether the topology should initiate selection to determine session support + */ + shouldCheckForSessionSupport(): boolean { + if (this.description.type === TopologyType.Single) { + return !this.description.hasKnownServers; + } + + return !this.description.hasDataBearingServers; + } + + /** + * @returns Whether sessions are supported on the current topology + */ + hasSessionSupport(): boolean { + return this.loadBalanced || this.description.logicalSessionTimeoutMinutes != null; + } + + /** Start a logical session */ + startSession(options: ClientSessionOptions, clientOptions?: MongoOptions): ClientSession { + const session = new ClientSession(this.client, this.s.sessionPool, options, clientOptions); + session.once('ended', () => { + this.s.sessions.delete(session); + }); + + this.s.sessions.add(session); + return session; + } + + /** Send endSessions command(s) with the given session ids */ + endSessions(sessions: ServerSessionId[], callback?: Callback): void { + if (!Array.isArray(sessions)) { + sessions = [sessions]; + } + + this.selectServer( + readPreferenceServerSelector(ReadPreference.primaryPreferred), + {}, + (err, server) => { + if (err || !server) { + if (typeof callback === 'function') callback(err); + return; + } + + server.command( + ns('admin.$cmd'), + { endSessions: sessions }, + { noResponse: true }, + (err, result) => { + if (typeof callback === 'function') callback(err, result); + } + ); + } + ); + } + + /** + * Update the internal TopologyDescription with a ServerDescription + * + * @param serverDescription - The server to update in the internal list of server descriptions + */ + serverUpdateHandler(serverDescription: ServerDescription): void { + if (!this.s.description.hasServer(serverDescription.address)) { + return; + } + + // ignore this server update if its from an outdated topologyVersion + if (isStaleServerDescription(this.s.description, serverDescription)) { + return; + } + + // these will be used for monitoring events later + const previousTopologyDescription = this.s.description; + const previousServerDescription = this.s.description.servers.get(serverDescription.address); + if (!previousServerDescription) { + return; + } + + // Driver Sessions Spec: "Whenever a driver receives a cluster time from + // a server it MUST compare it to the current highest seen cluster time + // for the deployment. If the new cluster time is higher than the + // highest seen cluster time it MUST become the new highest seen cluster + // time. Two cluster times are compared using only the BsonTimestamp + // value of the clusterTime embedded field." + const clusterTime = serverDescription.$clusterTime; + if (clusterTime) { + _advanceClusterTime(this, clusterTime); + } + + // If we already know all the information contained in this updated description, then + // we don't need to emit SDAM events, but still need to update the description, in order + // to keep client-tracked attributes like last update time and round trip time up to date + const equalDescriptions = + previousServerDescription && previousServerDescription.equals(serverDescription); + + // first update the TopologyDescription + this.s.description = this.s.description.update(serverDescription); + if (this.s.description.compatibilityError) { + this.emit(Topology.ERROR, new MongoCompatibilityError(this.s.description.compatibilityError)); + return; + } + + // emit monitoring events for this change + if (!equalDescriptions) { + const newDescription = this.s.description.servers.get(serverDescription.address); + if (newDescription) { + this.emit( + Topology.SERVER_DESCRIPTION_CHANGED, + new ServerDescriptionChangedEvent( + this.s.id, + serverDescription.address, + previousServerDescription, + newDescription + ) + ); + } + } + + // update server list from updated descriptions + updateServers(this, serverDescription); + + // attempt to resolve any outstanding server selection attempts + if (this[kWaitQueue].length > 0) { + processWaitQueue(this); + } + + if (!equalDescriptions) { + this.emit( + Topology.TOPOLOGY_DESCRIPTION_CHANGED, + new TopologyDescriptionChangedEvent( + this.s.id, + previousTopologyDescription, + this.s.description + ) + ); + } + } + + auth(credentials?: MongoCredentials, callback?: Callback): void { + if (typeof credentials === 'function') (callback = credentials), (credentials = undefined); + if (typeof callback === 'function') callback(undefined, true); + } + + get clientMetadata(): ClientMetadata { + return this.s.options.metadata; + } + + isConnected(): boolean { + return this.s.state === STATE_CONNECTED; + } + + isDestroyed(): boolean { + return this.s.state === STATE_CLOSED; + } + + /** + * @deprecated This function is deprecated and will be removed in the next major version. + */ + unref(): void { + emitWarning('`unref` is a noop and will be removed in the next major version'); + } + + // NOTE: There are many places in code where we explicitly check the last hello + // to do feature support detection. This should be done any other way, but for + // now we will just return the first hello seen, which should suffice. + lastHello(): Document { + const serverDescriptions = Array.from(this.description.servers.values()); + if (serverDescriptions.length === 0) return {}; + const sd = serverDescriptions.filter( + (sd: ServerDescription) => sd.type !== ServerType.Unknown + )[0]; + + const result = sd || { maxWireVersion: this.description.commonWireVersion }; + return result; + } + + get commonWireVersion(): number | undefined { + return this.description.commonWireVersion; + } + + get logicalSessionTimeoutMinutes(): number | undefined { + return this.description.logicalSessionTimeoutMinutes; + } + + get clusterTime(): ClusterTime | undefined { + return this.s.clusterTime; + } + + set clusterTime(clusterTime: ClusterTime | undefined) { + this.s.clusterTime = clusterTime; + } +} + +/** Destroys a server, and removes all event listeners from the instance */ +function destroyServer( + server: Server, + topology: Topology, + options?: DestroyOptions, + callback?: Callback +) { + options = options ?? {}; + for (const event of LOCAL_SERVER_EVENTS) { + server.removeAllListeners(event); + } + + server.destroy(options, () => { + topology.emit( + Topology.SERVER_CLOSED, + new ServerClosedEvent(topology.s.id, server.description.address) + ); + + for (const event of SERVER_RELAY_EVENTS) { + server.removeAllListeners(event); + } + if (typeof callback === 'function') { + callback(); + } + }); +} + +/** Predicts the TopologyType from options */ +function topologyTypeFromOptions(options?: TopologyOptions) { + if (options?.directConnection) { + return TopologyType.Single; + } + + if (options?.replicaSet) { + return TopologyType.ReplicaSetNoPrimary; + } + + if (options?.loadBalanced) { + return TopologyType.LoadBalanced; + } + + return TopologyType.Unknown; +} + +/** + * Creates new server instances and attempts to connect them + * + * @param topology - The topology that this server belongs to + * @param serverDescription - The description for the server to initialize and connect to + */ +function createAndConnectServer(topology: Topology, serverDescription: ServerDescription) { + topology.emit( + Topology.SERVER_OPENING, + new ServerOpeningEvent(topology.s.id, serverDescription.address) + ); + + const server = new Server(topology, serverDescription, topology.s.options); + for (const event of SERVER_RELAY_EVENTS) { + server.on(event, (e: any) => topology.emit(event, e)); + } + + server.on(Server.DESCRIPTION_RECEIVED, description => topology.serverUpdateHandler(description)); + + server.connect(); + return server; +} + +/** + * @param topology - Topology to update. + * @param incomingServerDescription - New server description. + */ +function updateServers(topology: Topology, incomingServerDescription?: ServerDescription) { + // update the internal server's description + if (incomingServerDescription && topology.s.servers.has(incomingServerDescription.address)) { + const server = topology.s.servers.get(incomingServerDescription.address); + if (server) { + server.s.description = incomingServerDescription; + } + } + + // add new servers for all descriptions we currently don't know about locally + for (const serverDescription of topology.description.servers.values()) { + if (!topology.s.servers.has(serverDescription.address)) { + const server = createAndConnectServer(topology, serverDescription); + topology.s.servers.set(serverDescription.address, server); + } + } + + // for all servers no longer known, remove their descriptions and destroy their instances + for (const entry of topology.s.servers) { + const serverAddress = entry[0]; + if (topology.description.hasServer(serverAddress)) { + continue; + } + + if (!topology.s.servers.has(serverAddress)) { + continue; + } + + const server = topology.s.servers.get(serverAddress); + topology.s.servers.delete(serverAddress); + + // prepare server for garbage collection + if (server) { + destroyServer(server, topology); + } + } +} + +function drainWaitQueue(queue: Denque, err?: MongoDriverError) { + while (queue.length) { + const waitQueueMember = queue.shift(); + if (!waitQueueMember) { + continue; + } + + if (waitQueueMember.timer) { + clearTimeout(waitQueueMember.timer); + } + + if (!waitQueueMember[kCancelled]) { + waitQueueMember.callback(err); + } + } +} + +function processWaitQueue(topology: Topology) { + if (topology.s.state === STATE_CLOSED) { + drainWaitQueue(topology[kWaitQueue], new MongoTopologyClosedError()); + return; + } + + const isSharded = topology.description.type === TopologyType.Sharded; + const serverDescriptions = Array.from(topology.description.servers.values()); + const membersToProcess = topology[kWaitQueue].length; + for (let i = 0; i < membersToProcess; ++i) { + const waitQueueMember = topology[kWaitQueue].shift(); + if (!waitQueueMember) { + continue; + } + + if (waitQueueMember[kCancelled]) { + continue; + } + + let selectedDescriptions; + try { + const serverSelector = waitQueueMember.serverSelector; + selectedDescriptions = serverSelector + ? serverSelector(topology.description, serverDescriptions) + : serverDescriptions; + } catch (e) { + if (waitQueueMember.timer) { + clearTimeout(waitQueueMember.timer); + } + + waitQueueMember.callback(e); + continue; + } + + let selectedServer; + if (selectedDescriptions.length === 0) { + topology[kWaitQueue].push(waitQueueMember); + continue; + } else if (selectedDescriptions.length === 1) { + selectedServer = topology.s.servers.get(selectedDescriptions[0].address); + } else { + // don't shuffle the array if there are only two elements + const descriptions = + selectedDescriptions.length === 2 ? selectedDescriptions : shuffle(selectedDescriptions, 2); + const server1 = topology.s.servers.get(descriptions[0].address); + const server2 = topology.s.servers.get(descriptions[1].address); + + selectedServer = + server1 && server2 && server1.s.operationCount < server2.s.operationCount + ? server1 + : server2; + } + + if (!selectedServer) { + waitQueueMember.callback( + new MongoServerSelectionError( + 'server selection returned a server description but the server was not found in the topology', + topology.description + ) + ); + return; + } + const transaction = waitQueueMember.transaction; + if (isSharded && transaction && transaction.isActive && selectedServer) { + transaction.pinServer(selectedServer); + } + + if (waitQueueMember.timer) { + clearTimeout(waitQueueMember.timer); + } + + waitQueueMember.callback(undefined, selectedServer); + } + + if (topology[kWaitQueue].length > 0) { + // ensure all server monitors attempt monitoring soon + for (const [, server] of topology.s.servers) { + process.nextTick(function scheduleServerCheck() { + return server.requestCheck(); + }); + } + } +} + +function isStaleServerDescription( + topologyDescription: TopologyDescription, + incomingServerDescription: ServerDescription +) { + const currentServerDescription = topologyDescription.servers.get( + incomingServerDescription.address + ); + const currentTopologyVersion = currentServerDescription?.topologyVersion; + return ( + compareTopologyVersion(currentTopologyVersion, incomingServerDescription.topologyVersion) > 0 + ); +} + +/** @public */ +export class ServerCapabilities { + maxWireVersion: number; + minWireVersion: number; + + constructor(hello: Document) { + this.minWireVersion = hello.minWireVersion || 0; + this.maxWireVersion = hello.maxWireVersion || 0; + } + + get hasAggregationCursor(): boolean { + return this.maxWireVersion >= 1; + } + + get hasWriteCommands(): boolean { + return this.maxWireVersion >= 2; + } + get hasTextSearch(): boolean { + return this.minWireVersion >= 0; + } + + get hasAuthCommands(): boolean { + return this.maxWireVersion >= 1; + } + + get hasListCollectionsCommand(): boolean { + return this.maxWireVersion >= 3; + } + + get hasListIndexesCommand(): boolean { + return this.maxWireVersion >= 3; + } + + get supportsSnapshotReads(): boolean { + return this.maxWireVersion >= 13; + } + + get commandsTakeWriteConcern(): boolean { + return this.maxWireVersion >= 5; + } + + get commandsTakeCollation(): boolean { + return this.maxWireVersion >= 5; + } +} diff --git a/node_modules/mongodb/src/sdam/topology_description.ts b/node_modules/mongodb/src/sdam/topology_description.ts new file mode 100644 index 000000000..34db44f0e --- /dev/null +++ b/node_modules/mongodb/src/sdam/topology_description.ts @@ -0,0 +1,510 @@ +import type { Document, ObjectId } from '../bson'; +import * as WIRE_CONSTANTS from '../cmap/wire_protocol/constants'; +import { MongoError, MongoRuntimeError } from '../error'; +import { shuffle } from '../utils'; +import { ServerType, TopologyType } from './common'; +import { ServerDescription } from './server_description'; +import type { SrvPollingEvent } from './srv_polling'; + +// constants related to compatibility checks +const MIN_SUPPORTED_SERVER_VERSION = WIRE_CONSTANTS.MIN_SUPPORTED_SERVER_VERSION; +const MAX_SUPPORTED_SERVER_VERSION = WIRE_CONSTANTS.MAX_SUPPORTED_SERVER_VERSION; +const MIN_SUPPORTED_WIRE_VERSION = WIRE_CONSTANTS.MIN_SUPPORTED_WIRE_VERSION; +const MAX_SUPPORTED_WIRE_VERSION = WIRE_CONSTANTS.MAX_SUPPORTED_WIRE_VERSION; + +const MONGOS_OR_UNKNOWN = new Set([ServerType.Mongos, ServerType.Unknown]); +const MONGOS_OR_STANDALONE = new Set([ServerType.Mongos, ServerType.Standalone]); +const NON_PRIMARY_RS_MEMBERS = new Set([ + ServerType.RSSecondary, + ServerType.RSArbiter, + ServerType.RSOther +]); + +/** @public */ +export interface TopologyDescriptionOptions { + heartbeatFrequencyMS?: number; + localThresholdMS?: number; +} + +/** + * Representation of a deployment of servers + * @public + */ +export class TopologyDescription { + type: TopologyType; + setName?: string; + maxSetVersion?: number; + maxElectionId?: ObjectId; + servers: Map; + stale: boolean; + compatible: boolean; + compatibilityError?: string; + logicalSessionTimeoutMinutes?: number; + heartbeatFrequencyMS: number; + localThresholdMS: number; + commonWireVersion?: number; + + /** + * Create a TopologyDescription + */ + constructor( + topologyType: TopologyType, + serverDescriptions?: Map, + setName?: string, + maxSetVersion?: number, + maxElectionId?: ObjectId, + commonWireVersion?: number, + options?: TopologyDescriptionOptions + ) { + options = options ?? {}; + + this.type = topologyType ?? TopologyType.Unknown; + this.servers = serverDescriptions ?? new Map(); + this.stale = false; + this.compatible = true; + this.heartbeatFrequencyMS = options.heartbeatFrequencyMS ?? 0; + this.localThresholdMS = options.localThresholdMS ?? 15; + + if (setName) { + this.setName = setName; + } + + if (maxSetVersion) { + this.maxSetVersion = maxSetVersion; + } + + if (maxElectionId) { + this.maxElectionId = maxElectionId; + } + + if (commonWireVersion) { + this.commonWireVersion = commonWireVersion; + } + + // determine server compatibility + for (const serverDescription of this.servers.values()) { + // Load balancer mode is always compatible. + if ( + serverDescription.type === ServerType.Unknown || + serverDescription.type === ServerType.LoadBalancer + ) { + continue; + } + + if (serverDescription.minWireVersion > MAX_SUPPORTED_WIRE_VERSION) { + this.compatible = false; + this.compatibilityError = `Server at ${serverDescription.address} requires wire version ${serverDescription.minWireVersion}, but this version of the driver only supports up to ${MAX_SUPPORTED_WIRE_VERSION} (MongoDB ${MAX_SUPPORTED_SERVER_VERSION})`; + } + + if (serverDescription.maxWireVersion < MIN_SUPPORTED_WIRE_VERSION) { + this.compatible = false; + this.compatibilityError = `Server at ${serverDescription.address} reports wire version ${serverDescription.maxWireVersion}, but this version of the driver requires at least ${MIN_SUPPORTED_WIRE_VERSION} (MongoDB ${MIN_SUPPORTED_SERVER_VERSION}).`; + break; + } + } + + // Whenever a client updates the TopologyDescription from a hello response, it MUST set + // TopologyDescription.logicalSessionTimeoutMinutes to the smallest logicalSessionTimeoutMinutes + // value among ServerDescriptions of all data-bearing server types. If any have a null + // logicalSessionTimeoutMinutes, then TopologyDescription.logicalSessionTimeoutMinutes MUST be + // set to null. + this.logicalSessionTimeoutMinutes = undefined; + for (const [, server] of this.servers) { + if (server.isReadable) { + if (server.logicalSessionTimeoutMinutes == null) { + // If any of the servers have a null logicalSessionsTimeout, then the whole topology does + this.logicalSessionTimeoutMinutes = undefined; + break; + } + + if (this.logicalSessionTimeoutMinutes == null) { + // First server with a non null logicalSessionsTimeout + this.logicalSessionTimeoutMinutes = server.logicalSessionTimeoutMinutes; + continue; + } + + // Always select the smaller of the: + // current server logicalSessionsTimeout and the topologies logicalSessionsTimeout + this.logicalSessionTimeoutMinutes = Math.min( + this.logicalSessionTimeoutMinutes, + server.logicalSessionTimeoutMinutes + ); + } + } + } + + /** + * Returns a new TopologyDescription based on the SrvPollingEvent + * @internal + */ + updateFromSrvPollingEvent(ev: SrvPollingEvent, srvMaxHosts = 0): TopologyDescription { + /** The SRV addresses defines the set of addresses we should be using */ + const incomingHostnames = ev.hostnames(); + const currentHostnames = new Set(this.servers.keys()); + + const hostnamesToAdd = new Set(incomingHostnames); + const hostnamesToRemove = new Set(); + for (const hostname of currentHostnames) { + // filter hostnamesToAdd (made from incomingHostnames) down to what is *not* present in currentHostnames + hostnamesToAdd.delete(hostname); + if (!incomingHostnames.has(hostname)) { + // If the SRV Records no longer include this hostname + // we have to stop using it + hostnamesToRemove.add(hostname); + } + } + + if (hostnamesToAdd.size === 0 && hostnamesToRemove.size === 0) { + // No new hosts to add and none to remove + return this; + } + + const serverDescriptions = new Map(this.servers); + for (const removedHost of hostnamesToRemove) { + serverDescriptions.delete(removedHost); + } + + if (hostnamesToAdd.size > 0) { + if (srvMaxHosts === 0) { + // Add all! + for (const hostToAdd of hostnamesToAdd) { + serverDescriptions.set(hostToAdd, new ServerDescription(hostToAdd)); + } + } else if (serverDescriptions.size < srvMaxHosts) { + // Add only the amount needed to get us back to srvMaxHosts + const selectedHosts = shuffle(hostnamesToAdd, srvMaxHosts - serverDescriptions.size); + for (const selectedHostToAdd of selectedHosts) { + serverDescriptions.set(selectedHostToAdd, new ServerDescription(selectedHostToAdd)); + } + } + } + + return new TopologyDescription( + this.type, + serverDescriptions, + this.setName, + this.maxSetVersion, + this.maxElectionId, + this.commonWireVersion, + { heartbeatFrequencyMS: this.heartbeatFrequencyMS, localThresholdMS: this.localThresholdMS } + ); + } + + /** + * Returns a copy of this description updated with a given ServerDescription + * @internal + */ + update(serverDescription: ServerDescription): TopologyDescription { + const address = serverDescription.address; + + // potentially mutated values + let { type: topologyType, setName, maxSetVersion, maxElectionId, commonWireVersion } = this; + + if (serverDescription.setName && setName && serverDescription.setName !== setName) { + // TODO(NODE-4159): servers with an incorrect setName should be removed not marked Unknown + serverDescription = new ServerDescription(address, undefined); + } + + const serverType = serverDescription.type; + const serverDescriptions = new Map(this.servers); + + // update common wire version + if (serverDescription.maxWireVersion !== 0) { + if (commonWireVersion == null) { + commonWireVersion = serverDescription.maxWireVersion; + } else { + commonWireVersion = Math.min(commonWireVersion, serverDescription.maxWireVersion); + } + } + + // update the actual server description + serverDescriptions.set(address, serverDescription); + + if (topologyType === TopologyType.Single) { + // once we are defined as single, that never changes + return new TopologyDescription( + TopologyType.Single, + serverDescriptions, + setName, + maxSetVersion, + maxElectionId, + commonWireVersion, + { heartbeatFrequencyMS: this.heartbeatFrequencyMS, localThresholdMS: this.localThresholdMS } + ); + } + + if (topologyType === TopologyType.Unknown) { + if (serverType === ServerType.Standalone && this.servers.size !== 1) { + serverDescriptions.delete(address); + } else { + topologyType = topologyTypeForServerType(serverType); + } + } + + if (topologyType === TopologyType.Sharded) { + if (!MONGOS_OR_UNKNOWN.has(serverType)) { + serverDescriptions.delete(address); + } + } + + if (topologyType === TopologyType.ReplicaSetNoPrimary) { + if (MONGOS_OR_STANDALONE.has(serverType)) { + serverDescriptions.delete(address); + } + + if (serverType === ServerType.RSPrimary) { + const result = updateRsFromPrimary( + serverDescriptions, + serverDescription, + setName, + maxSetVersion, + maxElectionId + ); + + topologyType = result[0]; + setName = result[1]; + maxSetVersion = result[2]; + maxElectionId = result[3]; + } else if (NON_PRIMARY_RS_MEMBERS.has(serverType)) { + const result = updateRsNoPrimaryFromMember(serverDescriptions, serverDescription, setName); + topologyType = result[0]; + setName = result[1]; + } + } + + if (topologyType === TopologyType.ReplicaSetWithPrimary) { + if (MONGOS_OR_STANDALONE.has(serverType)) { + serverDescriptions.delete(address); + topologyType = checkHasPrimary(serverDescriptions); + } else if (serverType === ServerType.RSPrimary) { + const result = updateRsFromPrimary( + serverDescriptions, + serverDescription, + setName, + maxSetVersion, + maxElectionId + ); + + topologyType = result[0]; + setName = result[1]; + maxSetVersion = result[2]; + maxElectionId = result[3]; + } else if (NON_PRIMARY_RS_MEMBERS.has(serverType)) { + topologyType = updateRsWithPrimaryFromMember( + serverDescriptions, + serverDescription, + setName + ); + } else { + topologyType = checkHasPrimary(serverDescriptions); + } + } + + return new TopologyDescription( + topologyType, + serverDescriptions, + setName, + maxSetVersion, + maxElectionId, + commonWireVersion, + { heartbeatFrequencyMS: this.heartbeatFrequencyMS, localThresholdMS: this.localThresholdMS } + ); + } + + get error(): MongoError | undefined { + const descriptionsWithError = Array.from(this.servers.values()).filter( + (sd: ServerDescription) => sd.error + ); + + if (descriptionsWithError.length > 0) { + return descriptionsWithError[0].error; + } + return; + } + + /** + * Determines if the topology description has any known servers + */ + get hasKnownServers(): boolean { + return Array.from(this.servers.values()).some( + (sd: ServerDescription) => sd.type !== ServerType.Unknown + ); + } + + /** + * Determines if this topology description has a data-bearing server available. + */ + get hasDataBearingServers(): boolean { + return Array.from(this.servers.values()).some((sd: ServerDescription) => sd.isDataBearing); + } + + /** + * Determines if the topology has a definition for the provided address + * @internal + */ + hasServer(address: string): boolean { + return this.servers.has(address); + } +} + +function topologyTypeForServerType(serverType: ServerType): TopologyType { + switch (serverType) { + case ServerType.Standalone: + return TopologyType.Single; + case ServerType.Mongos: + return TopologyType.Sharded; + case ServerType.RSPrimary: + return TopologyType.ReplicaSetWithPrimary; + case ServerType.RSOther: + case ServerType.RSSecondary: + return TopologyType.ReplicaSetNoPrimary; + default: + return TopologyType.Unknown; + } +} + +// TODO: improve these docs when ObjectId is properly typed +function compareObjectId(oid1: Document, oid2: Document): number { + if (oid1 == null) { + return -1; + } + + if (oid2 == null) { + return 1; + } + + if (oid1.id instanceof Buffer && oid2.id instanceof Buffer) { + const oid1Buffer = oid1.id; + const oid2Buffer = oid2.id; + return oid1Buffer.compare(oid2Buffer); + } + + const oid1String = oid1.toString(); + const oid2String = oid2.toString(); + return oid1String.localeCompare(oid2String); +} + +function updateRsFromPrimary( + serverDescriptions: Map, + serverDescription: ServerDescription, + setName?: string, + maxSetVersion?: number, + maxElectionId?: ObjectId +): [TopologyType, string?, number?, ObjectId?] { + setName = setName || serverDescription.setName; + if (setName !== serverDescription.setName) { + serverDescriptions.delete(serverDescription.address); + return [checkHasPrimary(serverDescriptions), setName, maxSetVersion, maxElectionId]; + } + + const electionId = serverDescription.electionId ? serverDescription.electionId : null; + if (serverDescription.setVersion && electionId) { + if (maxSetVersion && maxElectionId) { + if ( + maxSetVersion > serverDescription.setVersion || + compareObjectId(maxElectionId, electionId) > 0 + ) { + // this primary is stale, we must remove it + serverDescriptions.set( + serverDescription.address, + new ServerDescription(serverDescription.address) + ); + + return [checkHasPrimary(serverDescriptions), setName, maxSetVersion, maxElectionId]; + } + } + + maxElectionId = serverDescription.electionId; + } + + if ( + serverDescription.setVersion != null && + (maxSetVersion == null || serverDescription.setVersion > maxSetVersion) + ) { + maxSetVersion = serverDescription.setVersion; + } + + // We've heard from the primary. Is it the same primary as before? + for (const [address, server] of serverDescriptions) { + if (server.type === ServerType.RSPrimary && server.address !== serverDescription.address) { + // Reset old primary's type to Unknown. + serverDescriptions.set(address, new ServerDescription(server.address)); + + // There can only be one primary + break; + } + } + + // Discover new hosts from this primary's response. + serverDescription.allHosts.forEach((address: string) => { + if (!serverDescriptions.has(address)) { + serverDescriptions.set(address, new ServerDescription(address)); + } + }); + + // Remove hosts not in the response. + const currentAddresses = Array.from(serverDescriptions.keys()); + const responseAddresses = serverDescription.allHosts; + currentAddresses + .filter((addr: string) => responseAddresses.indexOf(addr) === -1) + .forEach((address: string) => { + serverDescriptions.delete(address); + }); + + return [checkHasPrimary(serverDescriptions), setName, maxSetVersion, maxElectionId]; +} + +function updateRsWithPrimaryFromMember( + serverDescriptions: Map, + serverDescription: ServerDescription, + setName?: string +): TopologyType { + if (setName == null) { + // TODO(NODE-3483): should be an appropriate runtime error + throw new MongoRuntimeError('Argument "setName" is required if connected to a replica set'); + } + + if ( + setName !== serverDescription.setName || + (serverDescription.me && serverDescription.address !== serverDescription.me) + ) { + serverDescriptions.delete(serverDescription.address); + } + + return checkHasPrimary(serverDescriptions); +} + +function updateRsNoPrimaryFromMember( + serverDescriptions: Map, + serverDescription: ServerDescription, + setName?: string +): [TopologyType, string?] { + const topologyType = TopologyType.ReplicaSetNoPrimary; + setName = setName || serverDescription.setName; + if (setName !== serverDescription.setName) { + serverDescriptions.delete(serverDescription.address); + return [topologyType, setName]; + } + + serverDescription.allHosts.forEach((address: string) => { + if (!serverDescriptions.has(address)) { + serverDescriptions.set(address, new ServerDescription(address)); + } + }); + + if (serverDescription.me && serverDescription.address !== serverDescription.me) { + serverDescriptions.delete(serverDescription.address); + } + + return [topologyType, setName]; +} + +function checkHasPrimary(serverDescriptions: Map): TopologyType { + for (const serverDescription of serverDescriptions.values()) { + if (serverDescription.type === ServerType.RSPrimary) { + return TopologyType.ReplicaSetWithPrimary; + } + } + + return TopologyType.ReplicaSetNoPrimary; +} diff --git a/node_modules/mongodb/src/sessions.ts b/node_modules/mongodb/src/sessions.ts new file mode 100644 index 000000000..36f261323 --- /dev/null +++ b/node_modules/mongodb/src/sessions.ts @@ -0,0 +1,1082 @@ +import { Binary, Document, Long, Timestamp } from './bson'; +import type { CommandOptions, Connection } from './cmap/connection'; +import { ConnectionPoolMetrics } from './cmap/metrics'; +import { isSharded } from './cmap/wire_protocol/shared'; +import { PINNED, UNPINNED } from './constants'; +import type { AbstractCursor } from './cursor/abstract_cursor'; +import { + AnyError, + MongoAPIError, + MongoCompatibilityError, + MONGODB_ERROR_CODES, + MongoDriverError, + MongoError, + MongoErrorLabel, + MongoExpiredSessionError, + MongoInvalidArgumentError, + MongoRuntimeError, + MongoServerError, + MongoTransactionError, + MongoWriteConcernError +} from './error'; +import type { MongoClient, MongoOptions } from './mongo_client'; +import { TypedEventEmitter } from './mongo_types'; +import { executeOperation } from './operations/execute_operation'; +import { RunAdminCommandOperation } from './operations/run_command'; +import { PromiseProvider } from './promise_provider'; +import { ReadConcernLevel } from './read_concern'; +import { ReadPreference } from './read_preference'; +import { _advanceClusterTime, ClusterTime, TopologyType } from './sdam/common'; +import type { Topology } from './sdam/topology'; +import { isTransactionCommand, Transaction, TransactionOptions, TxnState } from './transactions'; +import { + calculateDurationInMs, + Callback, + commandSupportsReadConcern, + isPromiseLike, + maxWireVersion, + maybePromise, + now, + uuidV4 +} from './utils'; + +const minWireVersionForShardedTransactions = 8; + +/** @public */ +export interface ClientSessionOptions { + /** Whether causal consistency should be enabled on this session */ + causalConsistency?: boolean; + /** Whether all read operations should be read from the same snapshot for this session (NOTE: not compatible with `causalConsistency=true`) */ + snapshot?: boolean; + /** The default TransactionOptions to use for transactions started on this session. */ + defaultTransactionOptions?: TransactionOptions; + + /** @internal */ + owner?: symbol | AbstractCursor; + /** @internal */ + explicit?: boolean; + /** @internal */ + initialClusterTime?: ClusterTime; +} + +/** @public */ +export type WithTransactionCallback = (session: ClientSession) => Promise; + +/** @public */ +export type ClientSessionEvents = { + ended(session: ClientSession): void; +}; + +/** @internal */ +const kServerSession = Symbol('serverSession'); +/** @internal */ +const kSnapshotTime = Symbol('snapshotTime'); +/** @internal */ +const kSnapshotEnabled = Symbol('snapshotEnabled'); +/** @internal */ +const kPinnedConnection = Symbol('pinnedConnection'); +/** @internal Accumulates total number of increments to add to txnNumber when applying session to command */ +const kTxnNumberIncrement = Symbol('txnNumberIncrement'); + +/** @public */ +export interface EndSessionOptions { + /** + * An optional error which caused the call to end this session + * @internal + */ + error?: AnyError; + force?: boolean; + forceClear?: boolean; +} + +/** + * A class representing a client session on the server + * + * NOTE: not meant to be instantiated directly. + * @public + */ +export class ClientSession extends TypedEventEmitter { + /** @internal */ + client: MongoClient; + /** @internal */ + sessionPool: ServerSessionPool; + hasEnded: boolean; + clientOptions?: MongoOptions; + supports: { causalConsistency: boolean }; + clusterTime?: ClusterTime; + operationTime?: Timestamp; + explicit: boolean; + /** @internal */ + owner?: symbol | AbstractCursor; + defaultTransactionOptions: TransactionOptions; + transaction: Transaction; + /** @internal */ + [kServerSession]: ServerSession | null; + /** @internal */ + [kSnapshotTime]?: Timestamp; + /** @internal */ + [kSnapshotEnabled] = false; + /** @internal */ + [kPinnedConnection]?: Connection; + /** @internal */ + [kTxnNumberIncrement]: number; + + /** + * Create a client session. + * @internal + * @param client - The current client + * @param sessionPool - The server session pool (Internal Class) + * @param options - Optional settings + * @param clientOptions - Optional settings provided when creating a MongoClient + */ + constructor( + client: MongoClient, + sessionPool: ServerSessionPool, + options: ClientSessionOptions, + clientOptions?: MongoOptions + ) { + super(); + + if (client == null) { + // TODO(NODE-3483) + throw new MongoRuntimeError('ClientSession requires a MongoClient'); + } + + if (sessionPool == null || !(sessionPool instanceof ServerSessionPool)) { + // TODO(NODE-3483) + throw new MongoRuntimeError('ClientSession requires a ServerSessionPool'); + } + + options = options ?? {}; + + if (options.snapshot === true) { + this[kSnapshotEnabled] = true; + if (options.causalConsistency === true) { + throw new MongoInvalidArgumentError( + 'Properties "causalConsistency" and "snapshot" are mutually exclusive' + ); + } + } + + this.client = client; + this.sessionPool = sessionPool; + this.hasEnded = false; + this.clientOptions = clientOptions; + + this.explicit = !!options.explicit; + this[kServerSession] = this.explicit ? this.sessionPool.acquire() : null; + this[kTxnNumberIncrement] = 0; + + this.supports = { + causalConsistency: options.snapshot !== true && options.causalConsistency !== false + }; + + this.clusterTime = options.initialClusterTime; + + this.operationTime = undefined; + this.owner = options.owner; + this.defaultTransactionOptions = Object.assign({}, options.defaultTransactionOptions); + this.transaction = new Transaction(); + } + + /** The server id associated with this session */ + get id(): ServerSessionId | undefined { + return this[kServerSession]?.id; + } + + get serverSession(): ServerSession { + let serverSession = this[kServerSession]; + if (serverSession == null) { + if (this.explicit) { + throw new MongoRuntimeError('Unexpected null serverSession for an explicit session'); + } + if (this.hasEnded) { + throw new MongoRuntimeError('Unexpected null serverSession for an ended implicit session'); + } + serverSession = this.sessionPool.acquire(); + this[kServerSession] = serverSession; + } + return serverSession; + } + + /** Whether or not this session is configured for snapshot reads */ + get snapshotEnabled(): boolean { + return this[kSnapshotEnabled]; + } + + get loadBalanced(): boolean { + return this.client.topology?.description.type === TopologyType.LoadBalanced; + } + + /** @internal */ + get pinnedConnection(): Connection | undefined { + return this[kPinnedConnection]; + } + + /** @internal */ + pin(conn: Connection): void { + if (this[kPinnedConnection]) { + throw TypeError('Cannot pin multiple connections to the same session'); + } + + this[kPinnedConnection] = conn; + conn.emit( + PINNED, + this.inTransaction() ? ConnectionPoolMetrics.TXN : ConnectionPoolMetrics.CURSOR + ); + } + + /** @internal */ + unpin(options?: { force?: boolean; forceClear?: boolean; error?: AnyError }): void { + if (this.loadBalanced) { + return maybeClearPinnedConnection(this, options); + } + + this.transaction.unpinServer(); + } + + get isPinned(): boolean { + return this.loadBalanced ? !!this[kPinnedConnection] : this.transaction.isPinned; + } + + /** + * Ends this session on the server + * + * @param options - Optional settings. Currently reserved for future use + * @param callback - Optional callback for completion of this operation + */ + endSession(): Promise; + endSession(callback: Callback): void; + endSession(options: EndSessionOptions): Promise; + endSession(options: EndSessionOptions, callback: Callback): void; + endSession( + options?: EndSessionOptions | Callback, + callback?: Callback + ): void | Promise { + if (typeof options === 'function') (callback = options), (options = {}); + const finalOptions = { force: true, ...options }; + + return maybePromise(callback, done => { + if (this.hasEnded) { + maybeClearPinnedConnection(this, finalOptions); + return done(); + } + + const completeEndSession = () => { + maybeClearPinnedConnection(this, finalOptions); + + const serverSession = this[kServerSession]; + if (serverSession != null) { + // release the server session back to the pool + this.sessionPool.release(serverSession); + // Make sure a new serverSession never makes it on to the ClientSession + Object.defineProperty(this, kServerSession, { + value: ServerSession.clone(serverSession) + }); + } + + // mark the session as ended, and emit a signal + this.hasEnded = true; + this.emit('ended', this); + + // spec indicates that we should ignore all errors for `endSessions` + done(); + }; + + if (this.inTransaction()) { + // If we've reached endSession and the transaction is still active + // by default we abort it + this.abortTransaction(err => { + if (err) return done(err); + completeEndSession(); + }); + + return; + } + + completeEndSession(); + }); + } + + /** + * Advances the operationTime for a ClientSession. + * + * @param operationTime - the `BSON.Timestamp` of the operation type it is desired to advance to + */ + advanceOperationTime(operationTime: Timestamp): void { + if (this.operationTime == null) { + this.operationTime = operationTime; + return; + } + + if (operationTime.greaterThan(this.operationTime)) { + this.operationTime = operationTime; + } + } + + /** + * Advances the clusterTime for a ClientSession to the provided clusterTime of another ClientSession + * + * @param clusterTime - the $clusterTime returned by the server from another session in the form of a document containing the `BSON.Timestamp` clusterTime and signature + */ + advanceClusterTime(clusterTime: ClusterTime): void { + if (!clusterTime || typeof clusterTime !== 'object') { + throw new MongoInvalidArgumentError('input cluster time must be an object'); + } + if (!clusterTime.clusterTime || clusterTime.clusterTime._bsontype !== 'Timestamp') { + throw new MongoInvalidArgumentError( + 'input cluster time "clusterTime" property must be a valid BSON Timestamp' + ); + } + if ( + !clusterTime.signature || + clusterTime.signature.hash?._bsontype !== 'Binary' || + (typeof clusterTime.signature.keyId !== 'number' && + clusterTime.signature.keyId?._bsontype !== 'Long') // apparently we decode the key to number? + ) { + throw new MongoInvalidArgumentError( + 'input cluster time must have a valid "signature" property with BSON Binary hash and BSON Long keyId' + ); + } + + _advanceClusterTime(this, clusterTime); + } + + /** + * Used to determine if this session equals another + * + * @param session - The session to compare to + */ + equals(session: ClientSession): boolean { + if (!(session instanceof ClientSession)) { + return false; + } + + if (this.id == null || session.id == null) { + return false; + } + + return this.id.id.buffer.equals(session.id.id.buffer); + } + + /** + * Increment the transaction number on the internal ServerSession + * + * @privateRemarks + * This helper increments a value stored on the client session that will be + * added to the serverSession's txnNumber upon applying it to a command. + * This is because the serverSession is lazily acquired after a connection is obtained + */ + incrementTransactionNumber(): void { + this[kTxnNumberIncrement] += 1; + } + + /** @returns whether this session is currently in a transaction or not */ + inTransaction(): boolean { + return this.transaction.isActive; + } + + /** + * Starts a new transaction with the given options. + * + * @param options - Options for the transaction + */ + startTransaction(options?: TransactionOptions): void { + if (this[kSnapshotEnabled]) { + throw new MongoCompatibilityError('Transactions are not allowed with snapshot sessions'); + } + + if (this.inTransaction()) { + throw new MongoTransactionError('Transaction already in progress'); + } + + if (this.isPinned && this.transaction.isCommitted) { + this.unpin(); + } + + const topologyMaxWireVersion = maxWireVersion(this.client.topology); + if ( + isSharded(this.client.topology) && + topologyMaxWireVersion != null && + topologyMaxWireVersion < minWireVersionForShardedTransactions + ) { + throw new MongoCompatibilityError( + 'Transactions are not supported on sharded clusters in MongoDB < 4.2.' + ); + } + + // increment txnNumber + this.incrementTransactionNumber(); + // create transaction state + this.transaction = new Transaction({ + readConcern: + options?.readConcern ?? + this.defaultTransactionOptions.readConcern ?? + this.clientOptions?.readConcern, + writeConcern: + options?.writeConcern ?? + this.defaultTransactionOptions.writeConcern ?? + this.clientOptions?.writeConcern, + readPreference: + options?.readPreference ?? + this.defaultTransactionOptions.readPreference ?? + this.clientOptions?.readPreference, + maxCommitTimeMS: options?.maxCommitTimeMS ?? this.defaultTransactionOptions.maxCommitTimeMS + }); + + this.transaction.transition(TxnState.STARTING_TRANSACTION); + } + + /** + * Commits the currently active transaction in this session. + * + * @param callback - An optional callback, a Promise will be returned if none is provided + */ + commitTransaction(): Promise; + commitTransaction(callback: Callback): void; + commitTransaction(callback?: Callback): Promise | void { + return maybePromise(callback, cb => endTransaction(this, 'commitTransaction', cb)); + } + + /** + * Aborts the currently active transaction in this session. + * + * @param callback - An optional callback, a Promise will be returned if none is provided + */ + abortTransaction(): Promise; + abortTransaction(callback: Callback): void; + abortTransaction(callback?: Callback): Promise | void { + return maybePromise(callback, cb => endTransaction(this, 'abortTransaction', cb)); + } + + /** + * This is here to ensure that ClientSession is never serialized to BSON. + */ + toBSON(): never { + throw new MongoRuntimeError('ClientSession cannot be serialized to BSON.'); + } + + /** + * Runs a provided callback within a transaction, retrying either the commitTransaction operation + * or entire transaction as needed (and when the error permits) to better ensure that + * the transaction can complete successfully. + * + * **IMPORTANT:** This method requires the user to return a Promise, and `await` all operations. + * Any callbacks that do not return a Promise will result in undefined behavior. + * + * @remarks + * This function: + * - Will return the command response from the final commitTransaction if every operation is successful (can be used as a truthy object) + * - Will return `undefined` if the transaction is explicitly aborted with `await session.abortTransaction()` + * - Will throw if one of the operations throws or `throw` statement is used inside the `withTransaction` callback + * + * Checkout a descriptive example here: + * @see https://www.mongodb.com/developer/quickstart/node-transactions/ + * + * @param fn - callback to run within a transaction + * @param options - optional settings for the transaction + * @returns A raw command response or undefined + */ + withTransaction( + fn: WithTransactionCallback, + options?: TransactionOptions + ): Promise { + const startTime = now(); + return attemptTransaction(this, startTime, fn, options); + } +} + +const MAX_WITH_TRANSACTION_TIMEOUT = 120000; +const NON_DETERMINISTIC_WRITE_CONCERN_ERRORS = new Set([ + 'CannotSatisfyWriteConcern', + 'UnknownReplWriteConcern', + 'UnsatisfiableWriteConcern' +]); + +function hasNotTimedOut(startTime: number, max: number) { + return calculateDurationInMs(startTime) < max; +} + +function isUnknownTransactionCommitResult(err: MongoError) { + const isNonDeterministicWriteConcernError = + err instanceof MongoServerError && + err.codeName && + NON_DETERMINISTIC_WRITE_CONCERN_ERRORS.has(err.codeName); + + return ( + isMaxTimeMSExpiredError(err) || + (!isNonDeterministicWriteConcernError && + err.code !== MONGODB_ERROR_CODES.UnsatisfiableWriteConcern && + err.code !== MONGODB_ERROR_CODES.UnknownReplWriteConcern) + ); +} + +export function maybeClearPinnedConnection( + session: ClientSession, + options?: EndSessionOptions +): void { + // unpin a connection if it has been pinned + const conn = session[kPinnedConnection]; + const error = options?.error; + + if ( + session.inTransaction() && + error && + error instanceof MongoError && + error.hasErrorLabel(MongoErrorLabel.TransientTransactionError) + ) { + return; + } + + const topology = session.client.topology; + // NOTE: the spec talks about what to do on a network error only, but the tests seem to + // to validate that we don't unpin on _all_ errors? + if (conn && topology != null) { + const servers = Array.from(topology.s.servers.values()); + const loadBalancer = servers[0]; + + if (options?.error == null || options?.force) { + loadBalancer.s.pool.checkIn(conn); + conn.emit( + UNPINNED, + session.transaction.state !== TxnState.NO_TRANSACTION + ? ConnectionPoolMetrics.TXN + : ConnectionPoolMetrics.CURSOR + ); + + if (options?.forceClear) { + loadBalancer.s.pool.clear(conn.serviceId); + } + } + + session[kPinnedConnection] = undefined; + } +} + +function isMaxTimeMSExpiredError(err: MongoError) { + if (err == null || !(err instanceof MongoServerError)) { + return false; + } + + return ( + err.code === MONGODB_ERROR_CODES.MaxTimeMSExpired || + (err.writeConcernError && err.writeConcernError.code === MONGODB_ERROR_CODES.MaxTimeMSExpired) + ); +} + +function attemptTransactionCommit( + session: ClientSession, + startTime: number, + fn: WithTransactionCallback, + options?: TransactionOptions +): Promise { + return session.commitTransaction().catch((err: MongoError) => { + if ( + err instanceof MongoError && + hasNotTimedOut(startTime, MAX_WITH_TRANSACTION_TIMEOUT) && + !isMaxTimeMSExpiredError(err) + ) { + if (err.hasErrorLabel(MongoErrorLabel.UnknownTransactionCommitResult)) { + return attemptTransactionCommit(session, startTime, fn, options); + } + + if (err.hasErrorLabel(MongoErrorLabel.TransientTransactionError)) { + return attemptTransaction(session, startTime, fn, options); + } + } + + throw err; + }); +} + +const USER_EXPLICIT_TXN_END_STATES = new Set([ + TxnState.NO_TRANSACTION, + TxnState.TRANSACTION_COMMITTED, + TxnState.TRANSACTION_ABORTED +]); + +function userExplicitlyEndedTransaction(session: ClientSession) { + return USER_EXPLICIT_TXN_END_STATES.has(session.transaction.state); +} + +function attemptTransaction( + session: ClientSession, + startTime: number, + fn: WithTransactionCallback, + options?: TransactionOptions +): Promise { + const Promise = PromiseProvider.get(); + session.startTransaction(options); + + let promise; + try { + promise = fn(session); + } catch (err) { + promise = Promise.reject(err); + } + + if (!isPromiseLike(promise)) { + session.abortTransaction(); + throw new MongoInvalidArgumentError( + 'Function provided to `withTransaction` must return a Promise' + ); + } + + return promise.then( + () => { + if (userExplicitlyEndedTransaction(session)) { + return; + } + + return attemptTransactionCommit(session, startTime, fn, options); + }, + err => { + function maybeRetryOrThrow(err: MongoError): Promise { + if ( + err instanceof MongoError && + err.hasErrorLabel(MongoErrorLabel.TransientTransactionError) && + hasNotTimedOut(startTime, MAX_WITH_TRANSACTION_TIMEOUT) + ) { + return attemptTransaction(session, startTime, fn, options); + } + + if (isMaxTimeMSExpiredError(err)) { + err.addErrorLabel(MongoErrorLabel.UnknownTransactionCommitResult); + } + + throw err; + } + + if (session.inTransaction()) { + return session.abortTransaction().then(() => maybeRetryOrThrow(err)); + } + + return maybeRetryOrThrow(err); + } + ); +} + +function endTransaction( + session: ClientSession, + commandName: 'abortTransaction' | 'commitTransaction', + callback: Callback +) { + // handle any initial problematic cases + const txnState = session.transaction.state; + + if (txnState === TxnState.NO_TRANSACTION) { + callback(new MongoTransactionError('No transaction started')); + return; + } + + if (commandName === 'commitTransaction') { + if ( + txnState === TxnState.STARTING_TRANSACTION || + txnState === TxnState.TRANSACTION_COMMITTED_EMPTY + ) { + // the transaction was never started, we can safely exit here + session.transaction.transition(TxnState.TRANSACTION_COMMITTED_EMPTY); + callback(); + return; + } + + if (txnState === TxnState.TRANSACTION_ABORTED) { + callback( + new MongoTransactionError('Cannot call commitTransaction after calling abortTransaction') + ); + return; + } + } else { + if (txnState === TxnState.STARTING_TRANSACTION) { + // the transaction was never started, we can safely exit here + session.transaction.transition(TxnState.TRANSACTION_ABORTED); + callback(); + return; + } + + if (txnState === TxnState.TRANSACTION_ABORTED) { + callback(new MongoTransactionError('Cannot call abortTransaction twice')); + return; + } + + if ( + txnState === TxnState.TRANSACTION_COMMITTED || + txnState === TxnState.TRANSACTION_COMMITTED_EMPTY + ) { + callback( + new MongoTransactionError('Cannot call abortTransaction after calling commitTransaction') + ); + return; + } + } + + // construct and send the command + const command: Document = { [commandName]: 1 }; + + // apply a writeConcern if specified + let writeConcern; + if (session.transaction.options.writeConcern) { + writeConcern = Object.assign({}, session.transaction.options.writeConcern); + } else if (session.clientOptions && session.clientOptions.writeConcern) { + writeConcern = { w: session.clientOptions.writeConcern.w }; + } + + if (txnState === TxnState.TRANSACTION_COMMITTED) { + writeConcern = Object.assign({ wtimeout: 10000 }, writeConcern, { w: 'majority' }); + } + + if (writeConcern) { + Object.assign(command, { writeConcern }); + } + + if (commandName === 'commitTransaction' && session.transaction.options.maxTimeMS) { + Object.assign(command, { maxTimeMS: session.transaction.options.maxTimeMS }); + } + + function commandHandler(error?: Error, result?: Document) { + if (commandName !== 'commitTransaction') { + session.transaction.transition(TxnState.TRANSACTION_ABORTED); + if (session.loadBalanced) { + maybeClearPinnedConnection(session, { force: false }); + } + + // The spec indicates that we should ignore all errors on `abortTransaction` + return callback(); + } + + session.transaction.transition(TxnState.TRANSACTION_COMMITTED); + if (error instanceof MongoError) { + if ( + error.hasErrorLabel(MongoErrorLabel.RetryableWriteError) || + error instanceof MongoWriteConcernError || + isMaxTimeMSExpiredError(error) + ) { + if (isUnknownTransactionCommitResult(error)) { + error.addErrorLabel(MongoErrorLabel.UnknownTransactionCommitResult); + + // per txns spec, must unpin session in this case + session.unpin({ error }); + } + } else if (error.hasErrorLabel(MongoErrorLabel.TransientTransactionError)) { + session.unpin({ error }); + } + } + + callback(error, result); + } + + if (session.transaction.recoveryToken) { + command.recoveryToken = session.transaction.recoveryToken; + } + + // send the command + executeOperation( + session.client, + new RunAdminCommandOperation(undefined, command, { + session, + readPreference: ReadPreference.primary, + bypassPinningCheck: true + }), + (error, result) => { + if (command.abortTransaction) { + // always unpin on abort regardless of command outcome + session.unpin(); + } + + if (error instanceof MongoError && error.hasErrorLabel(MongoErrorLabel.RetryableWriteError)) { + // SPEC-1185: apply majority write concern when retrying commitTransaction + if (command.commitTransaction) { + // per txns spec, must unpin session in this case + session.unpin({ force: true }); + + command.writeConcern = Object.assign({ wtimeout: 10000 }, command.writeConcern, { + w: 'majority' + }); + } + + return executeOperation( + session.client, + new RunAdminCommandOperation(undefined, command, { + session, + readPreference: ReadPreference.primary, + bypassPinningCheck: true + }), + commandHandler + ); + } + + commandHandler(error, result); + } + ); +} + +/** @public */ +export type ServerSessionId = { id: Binary }; + +/** + * Reflects the existence of a session on the server. Can be reused by the session pool. + * WARNING: not meant to be instantiated directly. For internal use only. + * @public + */ +export class ServerSession { + id: ServerSessionId; + lastUse: number; + txnNumber: number; + isDirty: boolean; + + /** @internal */ + constructor() { + this.id = { id: new Binary(uuidV4(), Binary.SUBTYPE_UUID) }; + this.lastUse = now(); + this.txnNumber = 0; + this.isDirty = false; + } + + /** + * Determines if the server session has timed out. + * + * @param sessionTimeoutMinutes - The server's "logicalSessionTimeoutMinutes" + */ + hasTimedOut(sessionTimeoutMinutes: number): boolean { + // Take the difference of the lastUse timestamp and now, which will result in a value in + // milliseconds, and then convert milliseconds to minutes to compare to `sessionTimeoutMinutes` + const idleTimeMinutes = Math.round( + ((calculateDurationInMs(this.lastUse) % 86400000) % 3600000) / 60000 + ); + + return idleTimeMinutes > sessionTimeoutMinutes - 1; + } + + /** + * @internal + * Cloning meant to keep a readable reference to the server session data + * after ClientSession has ended + */ + static clone(serverSession: ServerSession): Readonly { + const arrayBuffer = new ArrayBuffer(16); + const idBytes = Buffer.from(arrayBuffer); + idBytes.set(serverSession.id.id.buffer); + + const id = new Binary(idBytes, serverSession.id.id.sub_type); + + // Manual prototype construction to avoid modifying the constructor of this class + return Object.setPrototypeOf( + { + id: { id }, + lastUse: serverSession.lastUse, + txnNumber: serverSession.txnNumber, + isDirty: serverSession.isDirty + }, + ServerSession.prototype + ); + } +} + +/** + * Maintains a pool of Server Sessions. + * For internal use only + * @internal + */ +export class ServerSessionPool { + topology: Topology; + sessions: ServerSession[]; + + constructor(topology: Topology) { + if (topology == null) { + throw new MongoRuntimeError('ServerSessionPool requires a topology'); + } + + this.topology = topology; + this.sessions = []; + } + + /** Ends all sessions in the session pool */ + endAllPooledSessions(callback?: Callback): void { + if (this.sessions.length) { + this.topology.endSessions( + this.sessions.map((session: ServerSession) => session.id), + () => { + this.sessions = []; + if (typeof callback === 'function') { + callback(); + } + } + ); + + return; + } + + if (typeof callback === 'function') { + callback(); + } + } + + /** + * Acquire a Server Session from the pool. + * Iterates through each session in the pool, removing any stale sessions + * along the way. The first non-stale session found is removed from the + * pool and returned. If no non-stale session is found, a new ServerSession is created. + */ + acquire(): ServerSession { + const sessionTimeoutMinutes = this.topology.logicalSessionTimeoutMinutes || 10; + + while (this.sessions.length) { + const session = this.sessions.shift(); + if (session && (this.topology.loadBalanced || !session.hasTimedOut(sessionTimeoutMinutes))) { + return session; + } + } + + return new ServerSession(); + } + + /** + * Release a session to the session pool + * Adds the session back to the session pool if the session has not timed out yet. + * This method also removes any stale sessions from the pool. + * + * @param session - The session to release to the pool + */ + release(session: ServerSession): void { + const sessionTimeoutMinutes = this.topology.logicalSessionTimeoutMinutes; + + if (this.topology.loadBalanced && !sessionTimeoutMinutes) { + this.sessions.unshift(session); + } + + if (!sessionTimeoutMinutes) { + return; + } + + while (this.sessions.length) { + const pooledSession = this.sessions[this.sessions.length - 1]; + if (pooledSession.hasTimedOut(sessionTimeoutMinutes)) { + this.sessions.pop(); + } else { + break; + } + } + + if (!session.hasTimedOut(sessionTimeoutMinutes)) { + if (session.isDirty) { + return; + } + + // otherwise, readd this session to the session pool + this.sessions.unshift(session); + } + } +} + +/** + * Optionally decorate a command with sessions specific keys + * + * @param session - the session tracking transaction state + * @param command - the command to decorate + * @param options - Optional settings passed to calling operation + * + * @internal + */ +export function applySession( + session: ClientSession, + command: Document, + options: CommandOptions +): MongoDriverError | undefined { + if (session.hasEnded) { + return new MongoExpiredSessionError(); + } + + // May acquire serverSession here + const serverSession = session.serverSession; + if (serverSession == null) { + return new MongoRuntimeError('Unable to acquire server session'); + } + + if (options.writeConcern?.w === 0) { + if (session && session.explicit) { + // Error if user provided an explicit session to an unacknowledged write (SPEC-1019) + return new MongoAPIError('Cannot have explicit session with unacknowledged writes'); + } + return; + } + + // mark the last use of this session, and apply the `lsid` + serverSession.lastUse = now(); + command.lsid = serverSession.id; + + const inTxnOrTxnCommand = session.inTransaction() || isTransactionCommand(command); + const isRetryableWrite = !!options.willRetryWrite; + + if (isRetryableWrite || inTxnOrTxnCommand) { + serverSession.txnNumber += session[kTxnNumberIncrement]; + session[kTxnNumberIncrement] = 0; + command.txnNumber = Long.fromNumber(serverSession.txnNumber); + } + + if (!inTxnOrTxnCommand) { + if (session.transaction.state !== TxnState.NO_TRANSACTION) { + session.transaction.transition(TxnState.NO_TRANSACTION); + } + + if ( + session.supports.causalConsistency && + session.operationTime && + commandSupportsReadConcern(command, options) + ) { + command.readConcern = command.readConcern || {}; + Object.assign(command.readConcern, { afterClusterTime: session.operationTime }); + } else if (session[kSnapshotEnabled]) { + command.readConcern = command.readConcern || { level: ReadConcernLevel.snapshot }; + if (session[kSnapshotTime] != null) { + Object.assign(command.readConcern, { atClusterTime: session[kSnapshotTime] }); + } + } + + return; + } + + // now attempt to apply transaction-specific sessions data + + // `autocommit` must always be false to differentiate from retryable writes + command.autocommit = false; + + if (session.transaction.state === TxnState.STARTING_TRANSACTION) { + session.transaction.transition(TxnState.TRANSACTION_IN_PROGRESS); + command.startTransaction = true; + + const readConcern = + session.transaction.options.readConcern || session?.clientOptions?.readConcern; + if (readConcern) { + command.readConcern = readConcern; + } + + if (session.supports.causalConsistency && session.operationTime) { + command.readConcern = command.readConcern || {}; + Object.assign(command.readConcern, { afterClusterTime: session.operationTime }); + } + } + return; +} + +export function updateSessionFromResponse(session: ClientSession, document: Document): void { + if (document.$clusterTime) { + _advanceClusterTime(session, document.$clusterTime); + } + + if (document.operationTime && session && session.supports.causalConsistency) { + session.advanceOperationTime(document.operationTime); + } + + if (document.recoveryToken && session && session.inTransaction()) { + session.transaction._recoveryToken = document.recoveryToken; + } + + if (session?.[kSnapshotEnabled] && session[kSnapshotTime] == null) { + // find and aggregate commands return atClusterTime on the cursor + // distinct includes it in the response body + const atClusterTime = document.cursor?.atClusterTime || document.atClusterTime; + if (atClusterTime) { + session[kSnapshotTime] = atClusterTime; + } + } +} diff --git a/node_modules/mongodb/src/sort.ts b/node_modules/mongodb/src/sort.ts new file mode 100644 index 000000000..6b766b545 --- /dev/null +++ b/node_modules/mongodb/src/sort.ts @@ -0,0 +1,132 @@ +import { MongoInvalidArgumentError } from './error'; + +/** @public */ +export type SortDirection = + | 1 + | -1 + | 'asc' + | 'desc' + | 'ascending' + | 'descending' + | { $meta: string }; + +/** @public */ +export type Sort = + | string + | Exclude + | string[] + | { [key: string]: SortDirection } + | Map + | [string, SortDirection][] + | [string, SortDirection]; + +/** Below stricter types were created for sort that correspond with type that the cmd takes */ + +/** @internal */ +export type SortDirectionForCmd = 1 | -1 | { $meta: string }; + +/** @internal */ +export type SortForCmd = Map; + +/** @internal */ +type SortPairForCmd = [string, SortDirectionForCmd]; + +/** @internal */ +function prepareDirection(direction: any = 1): SortDirectionForCmd { + const value = `${direction}`.toLowerCase(); + if (isMeta(direction)) return direction; + switch (value) { + case 'ascending': + case 'asc': + case '1': + return 1; + case 'descending': + case 'desc': + case '-1': + return -1; + default: + throw new MongoInvalidArgumentError(`Invalid sort direction: ${JSON.stringify(direction)}`); + } +} + +/** @internal */ +function isMeta(t: SortDirection): t is { $meta: string } { + return typeof t === 'object' && t != null && '$meta' in t && typeof t.$meta === 'string'; +} + +/** @internal */ +function isPair(t: Sort): t is [string, SortDirection] { + if (Array.isArray(t) && t.length === 2) { + try { + prepareDirection(t[1]); + return true; + } catch (e) { + return false; + } + } + return false; +} + +function isDeep(t: Sort): t is [string, SortDirection][] { + return Array.isArray(t) && Array.isArray(t[0]); +} + +function isMap(t: Sort): t is Map { + return t instanceof Map && t.size > 0; +} + +/** @internal */ +function pairToMap(v: [string, SortDirection]): SortForCmd { + return new Map([[`${v[0]}`, prepareDirection([v[1]])]]); +} + +/** @internal */ +function deepToMap(t: [string, SortDirection][]): SortForCmd { + const sortEntries: SortPairForCmd[] = t.map(([k, v]) => [`${k}`, prepareDirection(v)]); + return new Map(sortEntries); +} + +/** @internal */ +function stringsToMap(t: string[]): SortForCmd { + const sortEntries: SortPairForCmd[] = t.map(key => [`${key}`, 1]); + return new Map(sortEntries); +} + +/** @internal */ +function objectToMap(t: { [key: string]: SortDirection }): SortForCmd { + const sortEntries: SortPairForCmd[] = Object.entries(t).map(([k, v]) => [ + `${k}`, + prepareDirection(v) + ]); + return new Map(sortEntries); +} + +/** @internal */ +function mapToMap(t: Map): SortForCmd { + const sortEntries: SortPairForCmd[] = Array.from(t).map(([k, v]) => [ + `${k}`, + prepareDirection(v) + ]); + return new Map(sortEntries); +} + +/** converts a Sort type into a type that is valid for the server (SortForCmd) */ +export function formatSort( + sort: Sort | undefined, + direction?: SortDirection +): SortForCmd | undefined { + if (sort == null) return undefined; + if (typeof sort === 'string') return new Map([[sort, prepareDirection(direction)]]); + if (typeof sort !== 'object') { + throw new MongoInvalidArgumentError( + `Invalid sort format: ${JSON.stringify(sort)} Sort must be a valid object` + ); + } + if (!Array.isArray(sort)) { + return isMap(sort) ? mapToMap(sort) : Object.keys(sort).length ? objectToMap(sort) : undefined; + } + if (!sort.length) return undefined; + if (isDeep(sort)) return deepToMap(sort); + if (isPair(sort)) return pairToMap(sort); + return stringsToMap(sort); +} diff --git a/node_modules/mongodb/src/transactions.ts b/node_modules/mongodb/src/transactions.ts new file mode 100644 index 000000000..34d84403c --- /dev/null +++ b/node_modules/mongodb/src/transactions.ts @@ -0,0 +1,187 @@ +import type { Document } from './bson'; +import { MongoRuntimeError, MongoTransactionError } from './error'; +import type { CommandOperationOptions } from './operations/command'; +import { ReadConcern, ReadConcernLike } from './read_concern'; +import { ReadPreference } from './read_preference'; +import type { Server } from './sdam/server'; +import { WriteConcern } from './write_concern'; + +/** @internal */ +export const TxnState = Object.freeze({ + NO_TRANSACTION: 'NO_TRANSACTION', + STARTING_TRANSACTION: 'STARTING_TRANSACTION', + TRANSACTION_IN_PROGRESS: 'TRANSACTION_IN_PROGRESS', + TRANSACTION_COMMITTED: 'TRANSACTION_COMMITTED', + TRANSACTION_COMMITTED_EMPTY: 'TRANSACTION_COMMITTED_EMPTY', + TRANSACTION_ABORTED: 'TRANSACTION_ABORTED' +} as const); + +/** @internal */ +export type TxnState = typeof TxnState[keyof typeof TxnState]; + +const stateMachine: { [state in TxnState]: TxnState[] } = { + [TxnState.NO_TRANSACTION]: [TxnState.NO_TRANSACTION, TxnState.STARTING_TRANSACTION], + [TxnState.STARTING_TRANSACTION]: [ + TxnState.TRANSACTION_IN_PROGRESS, + TxnState.TRANSACTION_COMMITTED, + TxnState.TRANSACTION_COMMITTED_EMPTY, + TxnState.TRANSACTION_ABORTED + ], + [TxnState.TRANSACTION_IN_PROGRESS]: [ + TxnState.TRANSACTION_IN_PROGRESS, + TxnState.TRANSACTION_COMMITTED, + TxnState.TRANSACTION_ABORTED + ], + [TxnState.TRANSACTION_COMMITTED]: [ + TxnState.TRANSACTION_COMMITTED, + TxnState.TRANSACTION_COMMITTED_EMPTY, + TxnState.STARTING_TRANSACTION, + TxnState.NO_TRANSACTION + ], + [TxnState.TRANSACTION_ABORTED]: [TxnState.STARTING_TRANSACTION, TxnState.NO_TRANSACTION], + [TxnState.TRANSACTION_COMMITTED_EMPTY]: [ + TxnState.TRANSACTION_COMMITTED_EMPTY, + TxnState.NO_TRANSACTION + ] +}; + +const ACTIVE_STATES: Set = new Set([ + TxnState.STARTING_TRANSACTION, + TxnState.TRANSACTION_IN_PROGRESS +]); + +const COMMITTED_STATES: Set = new Set([ + TxnState.TRANSACTION_COMMITTED, + TxnState.TRANSACTION_COMMITTED_EMPTY, + TxnState.TRANSACTION_ABORTED +]); + +/** + * Configuration options for a transaction. + * @public + */ +export interface TransactionOptions extends CommandOperationOptions { + // TODO(NODE-3344): These options use the proper class forms of these settings, it should accept the basic enum values too + /** A default read concern for commands in this transaction */ + readConcern?: ReadConcernLike; + /** A default writeConcern for commands in this transaction */ + writeConcern?: WriteConcern; + /** A default read preference for commands in this transaction */ + readPreference?: ReadPreference; + /** Specifies the maximum amount of time to allow a commit action on a transaction to run in milliseconds */ + maxCommitTimeMS?: number; +} + +/** + * @public + * A class maintaining state related to a server transaction. Internal Only + */ +export class Transaction { + /** @internal */ + state: TxnState; + options: TransactionOptions; + /** @internal */ + _pinnedServer?: Server; + /** @internal */ + _recoveryToken?: Document; + + /** Create a transaction @internal */ + constructor(options?: TransactionOptions) { + options = options ?? {}; + this.state = TxnState.NO_TRANSACTION; + this.options = {}; + + const writeConcern = WriteConcern.fromOptions(options); + if (writeConcern) { + if (writeConcern.w === 0) { + throw new MongoTransactionError('Transactions do not support unacknowledged write concern'); + } + + this.options.writeConcern = writeConcern; + } + + if (options.readConcern) { + this.options.readConcern = ReadConcern.fromOptions(options); + } + + if (options.readPreference) { + this.options.readPreference = ReadPreference.fromOptions(options); + } + + if (options.maxCommitTimeMS) { + this.options.maxTimeMS = options.maxCommitTimeMS; + } + + // TODO: This isn't technically necessary + this._pinnedServer = undefined; + this._recoveryToken = undefined; + } + + /** @internal */ + get server(): Server | undefined { + return this._pinnedServer; + } + + get recoveryToken(): Document | undefined { + return this._recoveryToken; + } + + get isPinned(): boolean { + return !!this.server; + } + + /** @returns Whether the transaction has started */ + get isStarting(): boolean { + return this.state === TxnState.STARTING_TRANSACTION; + } + + /** + * @returns Whether this session is presently in a transaction + */ + get isActive(): boolean { + return ACTIVE_STATES.has(this.state); + } + + get isCommitted(): boolean { + return COMMITTED_STATES.has(this.state); + } + /** + * Transition the transaction in the state machine + * @internal + * @param nextState - The new state to transition to + */ + transition(nextState: TxnState): void { + const nextStates = stateMachine[this.state]; + if (nextStates && nextStates.includes(nextState)) { + this.state = nextState; + if ( + this.state === TxnState.NO_TRANSACTION || + this.state === TxnState.STARTING_TRANSACTION || + this.state === TxnState.TRANSACTION_ABORTED + ) { + this.unpinServer(); + } + return; + } + + throw new MongoRuntimeError( + `Attempted illegal state transition from [${this.state}] to [${nextState}]` + ); + } + + /** @internal */ + pinServer(server: Server): void { + if (this.isActive) { + this._pinnedServer = server; + } + } + + /** @internal */ + unpinServer(): void { + this._pinnedServer = undefined; + } +} + +export function isTransactionCommand(command: Document): boolean { + return !!(command.commitTransaction || command.abortTransaction); +} diff --git a/node_modules/mongodb/src/utils.ts b/node_modules/mongodb/src/utils.ts new file mode 100644 index 000000000..a21ef49c9 --- /dev/null +++ b/node_modules/mongodb/src/utils.ts @@ -0,0 +1,1408 @@ +import * as crypto from 'crypto'; +import type { SrvRecord } from 'dns'; +import * as os from 'os'; +import { setTimeout } from 'timers'; +import { URL } from 'url'; + +import { Document, ObjectId, resolveBSONOptions } from './bson'; +import type { Connection } from './cmap/connection'; +import { MAX_SUPPORTED_WIRE_VERSION } from './cmap/wire_protocol/constants'; +import type { Collection } from './collection'; +import { LEGACY_HELLO_COMMAND } from './constants'; +import type { AbstractCursor } from './cursor/abstract_cursor'; +import type { FindCursor } from './cursor/find_cursor'; +import type { Db } from './db'; +import { + AnyError, + MongoCompatibilityError, + MongoInvalidArgumentError, + MongoNotConnectedError, + MongoParseError, + MongoRuntimeError +} from './error'; +import type { Explain } from './explain'; +import type { MongoClient } from './mongo_client'; +import type { CommandOperationOptions, OperationParent } from './operations/command'; +import type { IndexDirection, IndexSpecification } from './operations/indexes'; +import type { Hint, OperationOptions } from './operations/operation'; +import { PromiseProvider } from './promise_provider'; +import { ReadConcern } from './read_concern'; +import { ReadPreference } from './read_preference'; +import { ServerType } from './sdam/common'; +import type { Server } from './sdam/server'; +import type { Topology } from './sdam/topology'; +import type { ClientSession } from './sessions'; +import { W, WriteConcern, WriteConcernOptions } from './write_concern'; + +/** + * MongoDB Driver style callback + * @public + */ +export type Callback = (error?: AnyError, result?: T) => void; + +export const MAX_JS_INT = Number.MAX_SAFE_INTEGER + 1; + +export type AnyOptions = Document; + +/** + * Throws if collectionName is not a valid mongodb collection namespace. + * @internal + */ +export function checkCollectionName(collectionName: string): void { + if ('string' !== typeof collectionName) { + throw new MongoInvalidArgumentError('Collection name must be a String'); + } + + if (!collectionName || collectionName.indexOf('..') !== -1) { + throw new MongoInvalidArgumentError('Collection names cannot be empty'); + } + + if ( + collectionName.indexOf('$') !== -1 && + collectionName.match(/((^\$cmd)|(oplog\.\$main))/) == null + ) { + // TODO(NODE-3483): Use MongoNamespace static method + throw new MongoInvalidArgumentError("Collection names must not contain '$'"); + } + + if (collectionName.match(/^\.|\.$/) != null) { + // TODO(NODE-3483): Use MongoNamespace static method + throw new MongoInvalidArgumentError("Collection names must not start or end with '.'"); + } + + // Validate that we are not passing 0x00 in the collection name + if (collectionName.indexOf('\x00') !== -1) { + // TODO(NODE-3483): Use MongoNamespace static method + throw new MongoInvalidArgumentError('Collection names cannot contain a null character'); + } +} + +/** + * Ensure Hint field is in a shape we expect: + * - object of index names mapping to 1 or -1 + * - just an index name + * @internal + */ +export function normalizeHintField(hint?: Hint): Hint | undefined { + let finalHint = undefined; + + if (typeof hint === 'string') { + finalHint = hint; + } else if (Array.isArray(hint)) { + finalHint = {}; + + hint.forEach(param => { + finalHint[param] = 1; + }); + } else if (hint != null && typeof hint === 'object') { + finalHint = {} as Document; + for (const name in hint) { + finalHint[name] = hint[name]; + } + } + + return finalHint; +} + +interface IndexOptions { + name: string; + keys?: string[]; + fieldHash: Document; +} + +/** + * Create an index specifier based on + * @internal + */ +export function parseIndexOptions(indexSpec: IndexSpecification): IndexOptions { + const fieldHash: { [key: string]: IndexDirection } = {}; + const indexes = []; + let keys; + + // Get all the fields accordingly + if ('string' === typeof indexSpec) { + // 'type' + indexes.push(indexSpec + '_' + 1); + fieldHash[indexSpec] = 1; + } else if (Array.isArray(indexSpec)) { + indexSpec.forEach((f: any) => { + if ('string' === typeof f) { + // [{location:'2d'}, 'type'] + indexes.push(f + '_' + 1); + fieldHash[f] = 1; + } else if (Array.isArray(f)) { + // [['location', '2d'],['type', 1]] + indexes.push(f[0] + '_' + (f[1] || 1)); + fieldHash[f[0]] = f[1] || 1; + } else if (isObject(f)) { + // [{location:'2d'}, {type:1}] + keys = Object.keys(f); + keys.forEach(k => { + indexes.push(k + '_' + (f as AnyOptions)[k]); + fieldHash[k] = (f as AnyOptions)[k]; + }); + } else { + // undefined (ignore) + } + }); + } else if (isObject(indexSpec)) { + // {location:'2d', type:1} + keys = Object.keys(indexSpec); + Object.entries(indexSpec).forEach(([key, value]) => { + indexes.push(key + '_' + value); + fieldHash[key] = value; + }); + } + + return { + name: indexes.join('_'), + keys: keys, + fieldHash: fieldHash + }; +} + +/** + * Checks if arg is an Object: + * - **NOTE**: the check is based on the `[Symbol.toStringTag]() === 'Object'` + * @internal + */ +// eslint-disable-next-line @typescript-eslint/ban-types +export function isObject(arg: unknown): arg is object { + return '[object Object]' === Object.prototype.toString.call(arg); +} + +/** @internal */ +export function mergeOptions(target: T, source: S): T & S { + return { ...target, ...source }; +} + +/** @internal */ +export function filterOptions(options: AnyOptions, names: ReadonlyArray): AnyOptions { + const filterOptions: AnyOptions = {}; + + for (const name in options) { + if (names.includes(name)) { + filterOptions[name] = options[name]; + } + } + + // Filtered options + return filterOptions; +} + +interface HasRetryableWrites { + retryWrites?: boolean; +} +/** + * Applies retryWrites: true to a command if retryWrites is set on the command's database. + * @internal + * + * @param target - The target command to which we will apply retryWrites. + * @param db - The database from which we can inherit a retryWrites value. + */ +export function applyRetryableWrites(target: T, db?: Db): T { + if (db && db.s.options?.retryWrites) { + target.retryWrites = true; + } + + return target; +} + +interface HasWriteConcern { + writeConcern?: WriteConcernOptions | WriteConcern | W; +} +/** + * Applies a write concern to a command based on well defined inheritance rules, optionally + * detecting support for the write concern in the first place. + * @internal + * + * @param target - the target command we will be applying the write concern to + * @param sources - sources where we can inherit default write concerns from + * @param options - optional settings passed into a command for write concern overrides + */ +export function applyWriteConcern( + target: T, + sources: { db?: Db; collection?: Collection }, + options?: OperationOptions & WriteConcernOptions +): T { + options = options ?? {}; + const db = sources.db; + const coll = sources.collection; + + if (options.session && options.session.inTransaction()) { + // writeConcern is not allowed within a multi-statement transaction + if (target.writeConcern) { + delete target.writeConcern; + } + + return target; + } + + const writeConcern = WriteConcern.fromOptions(options); + if (writeConcern) { + return Object.assign(target, { writeConcern }); + } + + if (coll && coll.writeConcern) { + return Object.assign(target, { writeConcern: Object.assign({}, coll.writeConcern) }); + } + + if (db && db.writeConcern) { + return Object.assign(target, { writeConcern: Object.assign({}, db.writeConcern) }); + } + + return target; +} + +/** + * Checks if a given value is a Promise + * + * @typeParam T - The result type of maybePromise + * @param maybePromise - An object that could be a promise + * @returns true if the provided value is a Promise + */ +export function isPromiseLike( + maybePromise?: PromiseLike | void +): maybePromise is Promise { + return !!maybePromise && typeof maybePromise.then === 'function'; +} + +/** + * Applies collation to a given command. + * @internal + * + * @param command - the command on which to apply collation + * @param target - target of command + * @param options - options containing collation settings + */ +export function decorateWithCollation( + command: Document, + target: MongoClient | Db | Collection, + options: AnyOptions +): void { + const capabilities = getTopology(target).capabilities; + if (options.collation && typeof options.collation === 'object') { + if (capabilities && capabilities.commandsTakeCollation) { + command.collation = options.collation; + } else { + throw new MongoCompatibilityError(`Current topology does not support collation`); + } + } +} + +/** + * Applies a read concern to a given command. + * @internal + * + * @param command - the command on which to apply the read concern + * @param coll - the parent collection of the operation calling this method + */ +export function decorateWithReadConcern( + command: Document, + coll: { s: { readConcern?: ReadConcern } }, + options?: OperationOptions +): void { + if (options && options.session && options.session.inTransaction()) { + return; + } + const readConcern = Object.assign({}, command.readConcern || {}); + if (coll.s.readConcern) { + Object.assign(readConcern, coll.s.readConcern); + } + + if (Object.keys(readConcern).length > 0) { + Object.assign(command, { readConcern: readConcern }); + } +} + +/** + * Applies an explain to a given command. + * @internal + * + * @param command - the command on which to apply the explain + * @param options - the options containing the explain verbosity + */ +export function decorateWithExplain(command: Document, explain: Explain): Document { + if (command.explain) { + return command; + } + + return { explain: command, verbosity: explain.verbosity }; +} + +/** + * @internal + */ +export type TopologyProvider = + | MongoClient + | ClientSession + | FindCursor + | AbstractCursor + | Collection + | Db; + +/** + * A helper function to get the topology from a given provider. Throws + * if the topology cannot be found. + * @throws MongoNotConnectedError + * @internal + */ +export function getTopology(provider: TopologyProvider): Topology { + // MongoClient or ClientSession or AbstractCursor + if ('topology' in provider && provider.topology) { + return provider.topology; + } else if ('s' in provider && 'client' in provider.s && provider.s.client.topology) { + return provider.s.client.topology; + } else if ('s' in provider && 'db' in provider.s && provider.s.db.s.client.topology) { + return provider.s.db.s.client.topology; + } + + throw new MongoNotConnectedError('MongoClient must be connected to perform this operation'); +} + +/** + * Default message handler for generating deprecation warnings. + * @internal + * + * @param name - function name + * @param option - option name + * @returns warning message + */ +export function defaultMsgHandler(name: string, option: string): string { + return `${name} option [${option}] is deprecated and will be removed in a later version.`; +} + +export interface DeprecateOptionsConfig { + /** function name */ + name: string; + /** options to deprecate */ + deprecatedOptions: string[]; + /** index of options object in function arguments array */ + optionsIndex: number; + /** optional custom message handler to generate warnings */ + msgHandler?(name: string, option: string): string; +} + +/** + * Deprecates a given function's options. + * @internal + * + * @param this - the bound class if this is a method + * @param config - configuration for deprecation + * @param fn - the target function of deprecation + * @returns modified function that warns once per deprecated option, and executes original function + */ +export function deprecateOptions( + this: unknown, + config: DeprecateOptionsConfig, + fn: (...args: any[]) => any +): any { + if ((process as any).noDeprecation === true) { + return fn; + } + + const msgHandler = config.msgHandler ? config.msgHandler : defaultMsgHandler; + + const optionsWarned = new Set(); + function deprecated(this: any, ...args: any[]) { + const options = args[config.optionsIndex] as AnyOptions; + + // ensure options is a valid, non-empty object, otherwise short-circuit + if (!isObject(options) || Object.keys(options).length === 0) { + return fn.bind(this)(...args); // call the function, no change + } + + // interrupt the function call with a warning + for (const deprecatedOption of config.deprecatedOptions) { + if (deprecatedOption in options && !optionsWarned.has(deprecatedOption)) { + optionsWarned.add(deprecatedOption); + const msg = msgHandler(config.name, deprecatedOption); + emitWarning(msg); + if (this && 'getLogger' in this) { + const logger = this.getLogger(); + if (logger) { + logger.warn(msg); + } + } + } + } + + return fn.bind(this)(...args); + } + + // These lines copied from https://github.com/nodejs/node/blob/25e5ae41688676a5fd29b2e2e7602168eee4ceb5/lib/internal/util.js#L73-L80 + // The wrapper will keep the same prototype as fn to maintain prototype chain + Object.setPrototypeOf(deprecated, fn); + if (fn.prototype) { + // Setting this (rather than using Object.setPrototype, as above) ensures + // that calling the unwrapped constructor gives an instanceof the wrapped + // constructor. + deprecated.prototype = fn.prototype; + } + + return deprecated; +} + +/** @internal */ +export function ns(ns: string): MongoDBNamespace { + return MongoDBNamespace.fromString(ns); +} + +/** @public */ +export class MongoDBNamespace { + db: string; + collection?: string; + /** + * Create a namespace object + * + * @param db - database name + * @param collection - collection name + */ + constructor(db: string, collection?: string) { + this.db = db; + this.collection = collection; + } + + toString(): string { + return this.collection ? `${this.db}.${this.collection}` : this.db; + } + + withCollection(collection: string): MongoDBNamespace { + return new MongoDBNamespace(this.db, collection); + } + + static fromString(namespace?: string): MongoDBNamespace { + if (!namespace) { + // TODO(NODE-3483): Replace with MongoNamespaceError + throw new MongoRuntimeError(`Cannot parse namespace from "${namespace}"`); + } + + const [db, ...collection] = namespace.split('.'); + return new MongoDBNamespace(db, collection.join('.')); + } +} + +/** @internal */ +export function* makeCounter(seed = 0): Generator { + let count = seed; + while (true) { + const newCount = count; + count += 1; + yield newCount; + } +} + +/** + * Helper function for either accepting a callback, or returning a promise + * @internal + * + * @param callback - The last function argument in exposed method, controls if a Promise is returned + * @param wrapper - A function that wraps the callback + * @returns Returns void if a callback is supplied, else returns a Promise. + */ +export function maybePromise( + callback: Callback | undefined, + wrapper: (fn: Callback) => void +): Promise | void { + const Promise = PromiseProvider.get(); + let result: Promise | void; + if (typeof callback !== 'function') { + result = new Promise((resolve, reject) => { + callback = (err, res) => { + if (err) return reject(err); + resolve(res); + }; + }); + } + + wrapper((err, res) => { + if (err != null) { + try { + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + callback!(err); + } catch (error) { + process.nextTick(() => { + throw error; + }); + } + + return; + } + + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + callback!(err, res); + }); + + return result; +} + +/** @internal */ +export function databaseNamespace(ns: string): string { + return ns.split('.')[0]; +} + +/** + * Synchronously Generate a UUIDv4 + * @internal + */ +export function uuidV4(): Buffer { + const result = crypto.randomBytes(16); + result[6] = (result[6] & 0x0f) | 0x40; + result[8] = (result[8] & 0x3f) | 0x80; + return result; +} + +/** + * A helper function for determining `maxWireVersion` between legacy and new topology instances + * @internal + */ +export function maxWireVersion(topologyOrServer?: Connection | Topology | Server): number { + if (topologyOrServer) { + if (topologyOrServer.loadBalanced) { + // Since we do not have a monitor, we assume the load balanced server is always + // pointed at the latest mongodb version. There is a risk that for on-prem + // deployments that don't upgrade immediately that this could alert to the + // application that a feature is avaiable that is actually not. + return MAX_SUPPORTED_WIRE_VERSION; + } + if (topologyOrServer.hello) { + return topologyOrServer.hello.maxWireVersion; + } + + if ('lastHello' in topologyOrServer && typeof topologyOrServer.lastHello === 'function') { + const lastHello = topologyOrServer.lastHello(); + if (lastHello) { + return lastHello.maxWireVersion; + } + } + + if ( + topologyOrServer.description && + 'maxWireVersion' in topologyOrServer.description && + topologyOrServer.description.maxWireVersion != null + ) { + return topologyOrServer.description.maxWireVersion; + } + } + + return 0; +} + +/** + * Checks that collation is supported by server. + * @internal + * + * @param server - to check against + * @param cmd - object where collation may be specified + */ +export function collationNotSupported(server: Server, cmd: Document): boolean { + return cmd && cmd.collation && maxWireVersion(server) < 5; +} + +/** + * Applies the function `eachFn` to each item in `arr`, in parallel. + * @internal + * + * @param arr - An array of items to asynchronously iterate over + * @param eachFn - A function to call on each item of the array. The callback signature is `(item, callback)`, where the callback indicates iteration is complete. + * @param callback - The callback called after every item has been iterated + */ +export function eachAsync( + arr: T[], + eachFn: (item: T, callback: (err?: AnyError) => void) => void, + callback: Callback +): void { + arr = arr || []; + + let idx = 0; + let awaiting = 0; + for (idx = 0; idx < arr.length; ++idx) { + awaiting++; + eachFn(arr[idx], eachCallback); + } + + if (awaiting === 0) { + callback(); + return; + } + + function eachCallback(err?: AnyError) { + awaiting--; + if (err) { + callback(err); + return; + } + + if (idx === arr.length && awaiting <= 0) { + callback(); + } + } +} + +/** @internal */ +export function eachAsyncSeries( + arr: T[], + eachFn: (item: T, callback: (err?: AnyError) => void) => void, + callback: Callback +): void { + arr = arr || []; + + let idx = 0; + let awaiting = arr.length; + if (awaiting === 0) { + callback(); + return; + } + + function eachCallback(err?: AnyError) { + idx++; + awaiting--; + if (err) { + callback(err); + return; + } + + if (idx === arr.length && awaiting <= 0) { + callback(); + return; + } + + eachFn(arr[idx], eachCallback); + } + + eachFn(arr[idx], eachCallback); +} + +/** @internal */ +export function arrayStrictEqual(arr: unknown[], arr2: unknown[]): boolean { + if (!Array.isArray(arr) || !Array.isArray(arr2)) { + return false; + } + + return arr.length === arr2.length && arr.every((elt, idx) => elt === arr2[idx]); +} + +/** @internal */ +export function errorStrictEqual(lhs?: AnyError, rhs?: AnyError): boolean { + if (lhs === rhs) { + return true; + } + + if (!lhs || !rhs) { + return lhs === rhs; + } + + if ((lhs == null && rhs != null) || (lhs != null && rhs == null)) { + return false; + } + + if (lhs.constructor.name !== rhs.constructor.name) { + return false; + } + + if (lhs.message !== rhs.message) { + return false; + } + + return true; +} + +interface StateTable { + [key: string]: string[]; +} +interface ObjectWithState { + s: { state: string }; + emit(event: 'stateChanged', state: string, newState: string): void; +} +interface StateTransitionFunction { + (target: ObjectWithState, newState: string): void; +} + +/** @public */ +export type EventEmitterWithState = { + /** @internal */ + stateChanged(previous: string, current: string): void; +}; + +/** @internal */ +export function makeStateMachine(stateTable: StateTable): StateTransitionFunction { + return function stateTransition(target, newState) { + const legalStates = stateTable[target.s.state]; + if (legalStates && legalStates.indexOf(newState) < 0) { + throw new MongoRuntimeError( + `illegal state transition from [${target.s.state}] => [${newState}], allowed: [${legalStates}]` + ); + } + + target.emit('stateChanged', target.s.state, newState); + target.s.state = newState; + }; +} + +/** @public */ +export interface ClientMetadata { + driver: { + name: string; + version: string; + }; + os: { + type: string; + name: NodeJS.Platform; + architecture: string; + version: string; + }; + platform: string; + version?: string; + application?: { + name: string; + }; +} + +/** @public */ +export interface ClientMetadataOptions { + driverInfo?: { + name?: string; + version?: string; + platform?: string; + }; + appName?: string; +} + +// eslint-disable-next-line @typescript-eslint/no-var-requires +const NODE_DRIVER_VERSION = require('../package.json').version; + +export function makeClientMetadata(options?: ClientMetadataOptions): ClientMetadata { + options = options ?? {}; + + const metadata: ClientMetadata = { + driver: { + name: 'nodejs', + version: NODE_DRIVER_VERSION + }, + os: { + type: os.type(), + name: process.platform, + architecture: process.arch, + version: os.release() + }, + platform: `Node.js ${process.version}, ${os.endianness()} (unified)` + }; + + // support optionally provided wrapping driver info + if (options.driverInfo) { + if (options.driverInfo.name) { + metadata.driver.name = `${metadata.driver.name}|${options.driverInfo.name}`; + } + + if (options.driverInfo.version) { + metadata.version = `${metadata.driver.version}|${options.driverInfo.version}`; + } + + if (options.driverInfo.platform) { + metadata.platform = `${metadata.platform}|${options.driverInfo.platform}`; + } + } + + if (options.appName) { + // MongoDB requires the appName not exceed a byte length of 128 + const buffer = Buffer.from(options.appName); + metadata.application = { + name: buffer.byteLength > 128 ? buffer.slice(0, 128).toString('utf8') : options.appName + }; + } + + return metadata; +} + +/** @internal */ +export function now(): number { + const hrtime = process.hrtime(); + return Math.floor(hrtime[0] * 1000 + hrtime[1] / 1000000); +} + +/** @internal */ +export function calculateDurationInMs(started: number): number { + if (typeof started !== 'number') { + throw new MongoInvalidArgumentError('Numeric value required to calculate duration'); + } + + const elapsed = now() - started; + return elapsed < 0 ? 0 : elapsed; +} + +export interface InterruptibleAsyncIntervalOptions { + /** The interval to execute a method on */ + interval: number; + /** A minimum interval that must elapse before the method is called */ + minInterval: number; + /** Whether the method should be called immediately when the interval is started */ + immediate: boolean; + + /** + * Only used for testing unreliable timer environments + * @internal + */ + clock: () => number; +} + +/** @internal */ +export interface InterruptibleAsyncInterval { + wake(): void; + stop(): void; +} + +/** + * Creates an interval timer which is able to be woken up sooner than + * the interval. The timer will also debounce multiple calls to wake + * ensuring that the function is only ever called once within a minimum + * interval window. + * @internal + * + * @param fn - An async function to run on an interval, must accept a `callback` as its only parameter + */ +export function makeInterruptibleAsyncInterval( + fn: (callback: Callback) => void, + options?: Partial +): InterruptibleAsyncInterval { + let timerId: NodeJS.Timeout | undefined; + let lastCallTime: number; + let cannotBeExpedited = false; + let stopped = false; + + options = options ?? {}; + const interval = options.interval || 1000; + const minInterval = options.minInterval || 500; + const immediate = typeof options.immediate === 'boolean' ? options.immediate : false; + const clock = typeof options.clock === 'function' ? options.clock : now; + + function wake() { + const currentTime = clock(); + const nextScheduledCallTime = lastCallTime + interval; + const timeUntilNextCall = nextScheduledCallTime - currentTime; + + // For the streaming protocol: there is nothing obviously stopping this + // interval from being woken up again while we are waiting "infinitely" + // for `fn` to be called again`. Since the function effectively + // never completes, the `timeUntilNextCall` will continue to grow + // negatively unbounded, so it will never trigger a reschedule here. + + // This is possible in virtualized environments like AWS Lambda where our + // clock is unreliable. In these cases the timer is "running" but never + // actually completes, so we want to execute immediately and then attempt + // to reschedule. + if (timeUntilNextCall < 0) { + executeAndReschedule(); + return; + } + + // debounce multiple calls to wake within the `minInterval` + if (cannotBeExpedited) { + return; + } + + // reschedule a call as soon as possible, ensuring the call never happens + // faster than the `minInterval` + if (timeUntilNextCall > minInterval) { + reschedule(minInterval); + cannotBeExpedited = true; + } + } + + function stop() { + stopped = true; + if (timerId) { + clearTimeout(timerId); + timerId = undefined; + } + + lastCallTime = 0; + cannotBeExpedited = false; + } + + function reschedule(ms?: number) { + if (stopped) return; + if (timerId) { + clearTimeout(timerId); + } + + timerId = setTimeout(executeAndReschedule, ms || interval); + } + + function executeAndReschedule() { + cannotBeExpedited = false; + lastCallTime = clock(); + + fn(err => { + if (err) throw err; + reschedule(interval); + }); + } + + if (immediate) { + executeAndReschedule(); + } else { + lastCallTime = clock(); + reschedule(undefined); + } + + return { wake, stop }; +} + +/** @internal */ +export function hasAtomicOperators(doc: Document | Document[]): boolean { + if (Array.isArray(doc)) { + for (const document of doc) { + if (hasAtomicOperators(document)) { + return true; + } + } + return false; + } + + const keys = Object.keys(doc); + return keys.length > 0 && keys[0][0] === '$'; +} + +/** + * Merge inherited properties from parent into options, prioritizing values from options, + * then values from parent. + * @internal + */ +export function resolveOptions( + parent: OperationParent | undefined, + options?: T +): T { + const result: T = Object.assign({}, options, resolveBSONOptions(options, parent)); + + // Users cannot pass a readConcern/writeConcern to operations in a transaction + const session = options?.session; + if (!session?.inTransaction()) { + const readConcern = ReadConcern.fromOptions(options) ?? parent?.readConcern; + if (readConcern) { + result.readConcern = readConcern; + } + + const writeConcern = WriteConcern.fromOptions(options) ?? parent?.writeConcern; + if (writeConcern) { + result.writeConcern = writeConcern; + } + } + + const readPreference = ReadPreference.fromOptions(options) ?? parent?.readPreference; + if (readPreference) { + result.readPreference = readPreference; + } + + return result; +} + +export function isSuperset(set: Set | any[], subset: Set | any[]): boolean { + set = Array.isArray(set) ? new Set(set) : set; + subset = Array.isArray(subset) ? new Set(subset) : subset; + for (const elem of subset) { + if (!set.has(elem)) { + return false; + } + } + return true; +} + +/** + * Checks if the document is a Hello request + * @internal + */ +export function isHello(doc: Document): boolean { + return doc[LEGACY_HELLO_COMMAND] || doc.hello ? true : false; +} + +/** Returns the items that are uniquely in setA */ +export function setDifference(setA: Iterable, setB: Iterable): Set { + const difference = new Set(setA); + for (const elem of setB) { + difference.delete(elem); + } + return difference; +} + +export function isRecord( + value: unknown, + requiredKeys: T +): value is Record; +export function isRecord(value: unknown): value is Record; +export function isRecord( + value: unknown, + requiredKeys: string[] | undefined = undefined +): value is Record { + const toString = Object.prototype.toString; + const hasOwnProperty = Object.prototype.hasOwnProperty; + const isObject = (v: unknown) => toString.call(v) === '[object Object]'; + if (!isObject(value)) { + return false; + } + + const ctor = (value as any).constructor; + if (ctor && ctor.prototype) { + if (!isObject(ctor.prototype)) { + return false; + } + + // Check to see if some method exists from the Object exists + if (!hasOwnProperty.call(ctor.prototype, 'isPrototypeOf')) { + return false; + } + } + + if (requiredKeys) { + const keys = Object.keys(value as Record); + return isSuperset(keys, requiredKeys); + } + + return true; +} + +/** + * Make a deep copy of an object + * + * NOTE: This is not meant to be the perfect implementation of a deep copy, + * but instead something that is good enough for the purposes of + * command monitoring. + */ +export function deepCopy(value: T): T { + if (value == null) { + return value; + } else if (Array.isArray(value)) { + return value.map(item => deepCopy(item)) as unknown as T; + } else if (isRecord(value)) { + const res = {} as any; + for (const key in value) { + res[key] = deepCopy(value[key]); + } + return res; + } + + const ctor = (value as any).constructor; + if (ctor) { + switch (ctor.name.toLowerCase()) { + case 'date': + return new ctor(Number(value)); + case 'map': + return new Map(value as any) as unknown as T; + case 'set': + return new Set(value as any) as unknown as T; + case 'buffer': + return Buffer.from(value as unknown as Buffer) as unknown as T; + } + } + + return value; +} + +/** @internal */ +const kBuffers = Symbol('buffers'); +/** @internal */ +const kLength = Symbol('length'); + +/** + * A pool of Buffers which allow you to read them as if they were one + * @internal + */ +export class BufferPool { + [kBuffers]: Buffer[]; + [kLength]: number; + + constructor() { + this[kBuffers] = []; + this[kLength] = 0; + } + + get length(): number { + return this[kLength]; + } + + /** Adds a buffer to the internal buffer pool list */ + append(buffer: Buffer): void { + this[kBuffers].push(buffer); + this[kLength] += buffer.length; + } + + /** Returns the requested number of bytes without consuming them */ + peek(size: number): Buffer { + return this.read(size, false); + } + + /** Reads the requested number of bytes, optionally consuming them */ + read(size: number, consume = true): Buffer { + if (typeof size !== 'number' || size < 0) { + throw new MongoInvalidArgumentError('Argument "size" must be a non-negative number'); + } + + if (size > this[kLength]) { + return Buffer.alloc(0); + } + + let result: Buffer; + + // read the whole buffer + if (size === this.length) { + result = Buffer.concat(this[kBuffers]); + + if (consume) { + this[kBuffers] = []; + this[kLength] = 0; + } + } + + // size is within first buffer, no need to concat + else if (size <= this[kBuffers][0].length) { + result = this[kBuffers][0].slice(0, size); + if (consume) { + this[kBuffers][0] = this[kBuffers][0].slice(size); + this[kLength] -= size; + } + } + + // size is beyond first buffer, need to track and copy + else { + result = Buffer.allocUnsafe(size); + + let idx; + let offset = 0; + let bytesToCopy = size; + for (idx = 0; idx < this[kBuffers].length; ++idx) { + let bytesCopied; + if (bytesToCopy > this[kBuffers][idx].length) { + bytesCopied = this[kBuffers][idx].copy(result, offset, 0); + offset += bytesCopied; + } else { + bytesCopied = this[kBuffers][idx].copy(result, offset, 0, bytesToCopy); + if (consume) { + this[kBuffers][idx] = this[kBuffers][idx].slice(bytesCopied); + } + offset += bytesCopied; + break; + } + + bytesToCopy -= bytesCopied; + } + + // compact the internal buffer array + if (consume) { + this[kBuffers] = this[kBuffers].slice(idx); + this[kLength] -= size; + } + } + + return result; + } +} + +/** @public */ +export class HostAddress { + host; + port; + // Driver only works with unix socket path to connect + // SDAM operates only on tcp addresses + socketPath; + isIPv6; + + constructor(hostString: string) { + const escapedHost = hostString.split(' ').join('%20'); // escape spaces, for socket path hosts + const { hostname, port } = new URL(`mongodb://${escapedHost}`); + + if (hostname.endsWith('.sock')) { + // heuristically determine if we're working with a domain socket + this.socketPath = decodeURIComponent(hostname); + } else if (typeof hostname === 'string') { + this.isIPv6 = false; + + let normalized = decodeURIComponent(hostname).toLowerCase(); + if (normalized.startsWith('[') && normalized.endsWith(']')) { + this.isIPv6 = true; + normalized = normalized.substring(1, hostname.length - 1); + } + + this.host = normalized.toLowerCase(); + + if (typeof port === 'number') { + this.port = port; + } else if (typeof port === 'string' && port !== '') { + this.port = Number.parseInt(port, 10); + } else { + this.port = 27017; + } + + if (this.port === 0) { + throw new MongoParseError('Invalid port (zero) with hostname'); + } + } else { + throw new MongoInvalidArgumentError('Either socketPath or host must be defined.'); + } + Object.freeze(this); + } + + [Symbol.for('nodejs.util.inspect.custom')](): string { + return this.inspect(); + } + + inspect(): string { + return `new HostAddress('${this.toString(true)}')`; + } + + /** + * @param ipv6Brackets - optionally request ipv6 bracket notation required for connection strings + */ + toString(ipv6Brackets = false): string { + if (typeof this.host === 'string') { + if (this.isIPv6 && ipv6Brackets) { + return `[${this.host}]:${this.port}`; + } + return `${this.host}:${this.port}`; + } + return `${this.socketPath}`; + } + + static fromString(s: string): HostAddress { + return new HostAddress(s); + } + + static fromHostPort(host: string, port: number): HostAddress { + if (host.includes(':')) { + host = `[${host}]`; // IPv6 address + } + return HostAddress.fromString(`${host}:${port}`); + } + + static fromSrvRecord({ name, port }: SrvRecord): HostAddress { + return HostAddress.fromHostPort(name, port); + } +} + +export const DEFAULT_PK_FACTORY = { + // We prefer not to rely on ObjectId having a createPk method + createPk(): ObjectId { + return new ObjectId(); + } +}; + +/** + * When the driver used emitWarning the code will be equal to this. + * @public + * + * @example + * ```js + * process.on('warning', (warning) => { + * if (warning.code === MONGODB_WARNING_CODE) console.error('Ah an important warning! :)') + * }) + * ``` + */ +export const MONGODB_WARNING_CODE = 'MONGODB DRIVER' as const; + +/** @internal */ +export function emitWarning(message: string): void { + return process.emitWarning(message, { code: MONGODB_WARNING_CODE } as any); +} + +const emittedWarnings = new Set(); +/** + * Will emit a warning once for the duration of the application. + * Uses the message to identify if it has already been emitted + * so using string interpolation can cause multiple emits + * @internal + */ +export function emitWarningOnce(message: string): void { + if (!emittedWarnings.has(message)) { + emittedWarnings.add(message); + return emitWarning(message); + } +} + +/** + * Takes a JS object and joins the values into a string separated by ', ' + */ +export function enumToString(en: Record): string { + return Object.values(en).join(', '); +} + +/** + * Determine if a server supports retryable writes. + * + * @internal + */ +export function supportsRetryableWrites(server?: Server): boolean { + if (!server) { + return false; + } + + if (server.loadBalanced) { + // Loadbalanced topologies will always support retry writes + return true; + } + + if (server.description.logicalSessionTimeoutMinutes != null) { + // that supports sessions + if (server.description.type !== ServerType.Standalone) { + // and that is not a standalone + return true; + } + } + + return false; +} + +export function parsePackageVersion({ version }: { version: string }): { + major: number; + minor: number; + patch: number; +} { + const [major, minor, patch] = version.split('.').map((n: string) => Number.parseInt(n, 10)); + return { major, minor, patch }; +} + +/** + * Fisher–Yates Shuffle + * + * Reference: https://bost.ocks.org/mike/shuffle/ + * @param sequence - items to be shuffled + * @param limit - Defaults to `0`. If nonzero shuffle will slice the randomized array e.g, `.slice(0, limit)` otherwise will return the entire randomized array. + */ +export function shuffle(sequence: Iterable, limit = 0): Array { + const items = Array.from(sequence); // shallow copy in order to never shuffle the input + + if (limit > items.length) { + throw new MongoRuntimeError('Limit must be less than the number of items'); + } + + let remainingItemsToShuffle = items.length; + const lowerBound = limit % items.length === 0 ? 1 : items.length - limit; + while (remainingItemsToShuffle > lowerBound) { + // Pick a remaining element + const randomIndex = Math.floor(Math.random() * remainingItemsToShuffle); + remainingItemsToShuffle -= 1; + + // And swap it with the current element + const swapHold = items[remainingItemsToShuffle]; + items[remainingItemsToShuffle] = items[randomIndex]; + items[randomIndex] = swapHold; + } + + return limit % items.length === 0 ? items : items.slice(lowerBound); +} + +// TODO: this should be codified in command construction +// @see https://github.com/mongodb/specifications/blob/master/source/read-write-concern/read-write-concern.rst#read-concern +export function commandSupportsReadConcern(command: Document, options?: Document): boolean { + if (command.aggregate || command.count || command.distinct || command.find || command.geoNear) { + return true; + } + + if ( + command.mapReduce && + options && + options.out && + (options.out.inline === 1 || options.out === 'inline') + ) { + return true; + } + + return false; +} diff --git a/node_modules/mongodb/src/write_concern.ts b/node_modules/mongodb/src/write_concern.ts new file mode 100644 index 000000000..ebc77ebf6 --- /dev/null +++ b/node_modules/mongodb/src/write_concern.ts @@ -0,0 +1,114 @@ +/** @public */ +export type W = number | 'majority'; + +/** @public */ +export interface WriteConcernOptions { + /** Write Concern as an object */ + writeConcern?: WriteConcern | WriteConcernSettings; +} + +/** @public */ +export interface WriteConcernSettings { + /** The write concern */ + w?: W; + /** The write concern timeout */ + wtimeoutMS?: number; + /** The journal write concern */ + journal?: boolean; + + // legacy options + /** The journal write concern */ + j?: boolean; + /** The write concern timeout */ + wtimeout?: number; + /** The file sync write concern */ + fsync?: boolean | 1; +} + +export const WRITE_CONCERN_KEYS = ['w', 'wtimeout', 'j', 'journal', 'fsync']; + +/** + * A MongoDB WriteConcern, which describes the level of acknowledgement + * requested from MongoDB for write operations. + * @public + * + * @see https://docs.mongodb.com/manual/reference/write-concern/ + */ +export class WriteConcern { + /** request acknowledgment that the write operation has propagated to a specified number of mongod instances or to mongod instances with specified tags. */ + w?: W; + /** specify a time limit to prevent write operations from blocking indefinitely */ + wtimeout?: number; + /** request acknowledgment that the write operation has been written to the on-disk journal */ + j?: boolean; + /** equivalent to the j option */ + fsync?: boolean | 1; + + /** + * Constructs a WriteConcern from the write concern properties. + * @param w - request acknowledgment that the write operation has propagated to a specified number of mongod instances or to mongod instances with specified tags. + * @param wtimeout - specify a time limit to prevent write operations from blocking indefinitely + * @param j - request acknowledgment that the write operation has been written to the on-disk journal + * @param fsync - equivalent to the j option + */ + constructor(w?: W, wtimeout?: number, j?: boolean, fsync?: boolean | 1) { + if (w != null) { + if (!Number.isNaN(Number(w))) { + this.w = Number(w); + } else { + this.w = w; + } + } + if (wtimeout != null) { + this.wtimeout = wtimeout; + } + if (j != null) { + this.j = j; + } + if (fsync != null) { + this.fsync = fsync; + } + } + + /** Construct a WriteConcern given an options object. */ + static fromOptions( + options?: WriteConcernOptions | WriteConcern | W, + inherit?: WriteConcernOptions | WriteConcern + ): WriteConcern | undefined { + if (options == null) return undefined; + inherit = inherit ?? {}; + let opts: WriteConcernSettings | WriteConcern | undefined; + if (typeof options === 'string' || typeof options === 'number') { + opts = { w: options }; + } else if (options instanceof WriteConcern) { + opts = options; + } else { + opts = options.writeConcern; + } + const parentOpts: WriteConcern | WriteConcernSettings | undefined = + inherit instanceof WriteConcern ? inherit : inherit.writeConcern; + + const { + w = undefined, + wtimeout = undefined, + j = undefined, + fsync = undefined, + journal = undefined, + wtimeoutMS = undefined + } = { + ...parentOpts, + ...opts + }; + if ( + w != null || + wtimeout != null || + wtimeoutMS != null || + j != null || + journal != null || + fsync != null + ) { + return new WriteConcern(w, wtimeout ?? wtimeoutMS, j ?? journal, fsync); + } + return undefined; + } +} diff --git a/node_modules/mongodb/tsconfig.json b/node_modules/mongodb/tsconfig.json new file mode 100644 index 000000000..a2724c494 --- /dev/null +++ b/node_modules/mongodb/tsconfig.json @@ -0,0 +1,40 @@ +{ + "compilerOptions": { + "allowJs": false, + "checkJs": false, + "strict": true, + "alwaysStrict": true, + "target": "ES2019", + "module": "commonJS", + "moduleResolution": "node", + "skipLibCheck": true, + "lib": ["es2020"], + // We don't make use of tslib helpers, all syntax used is supported by target engine + "importHelpers": false, + "noEmitHelpers": true, + // Never emit error filled code + "noEmitOnError": true, + "outDir": "lib", + "importsNotUsedAsValues": "error", + // We want the sourcemaps in a separate file + "inlineSourceMap": false, + "sourceMap": true, + // API-Extractor uses declaration maps to report problems in source, no need to distribute + "declaration": true, + "declarationMap": true, + // we include sources in the release + "inlineSources": false, + // Prevents web types from being suggested by vscode. + "types": ["node"], + "forceConsistentCasingInFileNames": true, + "noImplicitOverride": true, + "noImplicitReturns": true, + // TODO(NODE-3659): Enable useUnknownInCatchVariables and add type assertions or remove unnecessary catch blocks + "useUnknownInCatchVariables": false + }, + "ts-node": { + "transpileOnly": true, + "compiler": "typescript-cached-transpile" + }, + "include": ["src/**/*"] +} diff --git a/node_modules/mongoose/.eslintrc.json b/node_modules/mongoose/.eslintrc.json new file mode 100644 index 000000000..9112fbee2 --- /dev/null +++ b/node_modules/mongoose/.eslintrc.json @@ -0,0 +1,190 @@ +{ + "extends": [ + "eslint:recommended" + ], + "ignorePatterns": [ + "docs", + "tools", + "dist", + "website.js", + "test/files/*", + "benchmarks" + ], + "overrides": [ + { + "files": [ + "**/*.{ts,tsx}" + ], + "extends": [ + "plugin:@typescript-eslint/eslint-recommended", + "plugin:@typescript-eslint/recommended" + ], + "plugins": [ + "@typescript-eslint" + ], + "rules": { + "@typescript-eslint/triple-slash-reference": "off", + "spaced-comment": [ + "error", + "always", + { + "block": { + "markers": [ + "!" + ], + "balanced": true + }, + "markers": [ + "/" + ] + } + ], + "@typescript-eslint/no-explicit-any": "off", + "@typescript-eslint/ban-types": "off", + "@typescript-eslint/no-unused-vars": "off", + "@typescript-eslint/explicit-module-boundary-types": "off", + "@typescript-eslint/indent": [ + "error", + 2, + { + "SwitchCase": 1 + } + ], + "@typescript-eslint/prefer-optional-chain": "error", + "@typescript-eslint/brace-style": "error", + "@typescript-eslint/no-dupe-class-members": "error", + "@typescript-eslint/no-redeclare": "error", + "@typescript-eslint/type-annotation-spacing": "error", + "@typescript-eslint/object-curly-spacing": [ + "error", + "always" + ], + "@typescript-eslint/semi": "error", + "@typescript-eslint/space-before-function-paren": [ + "error", + "never" + ], + "@typescript-eslint/space-infix-ops": "off" + } + } + ], + "plugins": [ + "mocha-no-only" + ], + "parserOptions": { + "ecmaVersion": 2020 + }, + "env": { + "node": true, + "es6": true + }, + "rules": { + "comma-style": "error", + "indent": [ + "error", + 2, + { + "SwitchCase": 1, + "VariableDeclarator": 2 + } + ], + "keyword-spacing": "error", + "no-whitespace-before-property": "error", + "no-buffer-constructor": "warn", + "no-console": "off", + "no-constant-condition": "off", + "no-multi-spaces": "error", + "func-call-spacing": "error", + "no-trailing-spaces": "error", + "no-undef": "error", + "no-unneeded-ternary": "error", + "no-const-assign": "error", + "no-useless-rename": "error", + "no-dupe-keys": "error", + "space-in-parens": [ + "error", + "never" + ], + "spaced-comment": [ + "error", + "always", + { + "block": { + "markers": [ + "!" + ], + "balanced": true + } + } + ], + "key-spacing": [ + "error", + { + "beforeColon": false, + "afterColon": true + } + ], + "comma-spacing": [ + "error", + { + "before": false, + "after": true + } + ], + "array-bracket-spacing": 1, + "arrow-spacing": [ + "error", + { + "before": true, + "after": true + } + ], + "object-curly-spacing": [ + "error", + "always" + ], + "comma-dangle": [ + "error", + "never" + ], + "no-unreachable": "error", + "quotes": [ + "error", + "single" + ], + "quote-props": [ + "error", + "as-needed" + ], + "semi": "error", + "no-extra-semi": "error", + "semi-spacing": "error", + "no-spaced-func": "error", + "no-throw-literal": "error", + "space-before-blocks": "error", + "space-before-function-paren": [ + "error", + "never" + ], + "space-infix-ops": "error", + "space-unary-ops": "error", + "no-var": "warn", + "prefer-const": "warn", + "strict": [ + "error", + "global" + ], + "no-restricted-globals": [ + "error", + { + "name": "context", + "message": "Don't use Mocha's global context" + } + ], + "no-prototype-builtins": "off", + "mocha-no-only/mocha-no-only": [ + "error" + ], + "no-empty": "off" + } +} \ No newline at end of file diff --git a/node_modules/mongoose/LICENSE.md b/node_modules/mongoose/LICENSE.md new file mode 100644 index 000000000..54b4a4c6c --- /dev/null +++ b/node_modules/mongoose/LICENSE.md @@ -0,0 +1,22 @@ +# MIT License + +Copyright (c) 2010-2013 LearnBoost +Copyright (c) 2013-2021 Automattic + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/mongoose/README.md b/node_modules/mongoose/README.md new file mode 100644 index 000000000..60da3ccde --- /dev/null +++ b/node_modules/mongoose/README.md @@ -0,0 +1,366 @@ +# Mongoose + +Mongoose is a [MongoDB](https://www.mongodb.org/) object modeling tool designed to work in an asynchronous environment. Mongoose supports both promises and callbacks. + +[![Slack Status](https://img.shields.io/badge/slack-mongoosejsteam-34D058.svg?logo=slack )](https://mongoosejsteam.slack.com) +[![Build Status](https://github.com/Automattic/mongoose/workflows/Test/badge.svg)](https://github.com/Automattic/mongoose) +[![NPM version](https://badge.fury.io/js/mongoose.svg)](http://badge.fury.io/js/mongoose) + +[![npm](https://nodei.co/npm/mongoose.png)](https://www.npmjs.com/package/mongoose) + +## Documentation + +The official documentation website is [mongoosejs.com](http://mongoosejs.com/). + +Mongoose 6.0.0 was released on August 24, 2021. You can find more details on [backwards breaking changes in 6.0.0 on our docs site](https://mongoosejs.com/docs/migrating_to_6.html). + +## Support + + - [Stack Overflow](http://stackoverflow.com/questions/tagged/mongoose) + - [Bug Reports](https://github.com/Automattic/mongoose/issues/) + - [Mongoose Slack Channel](http://slack.mongoosejs.io/) + - [Help Forum](http://groups.google.com/group/mongoose-orm) + - [MongoDB Support](https://docs.mongodb.org/manual/support/) + +## Plugins + +Check out the [plugins search site](http://plugins.mongoosejs.io/) to see hundreds of related modules from the community. Next, learn how to write your own plugin from the [docs](http://mongoosejs.com/docs/plugins.html) or [this blog post](http://thecodebarbarian.com/2015/03/06/guide-to-mongoose-plugins). + +## Contributors + +Pull requests are always welcome! Please base pull requests against the `master` +branch and follow the [contributing guide](https://github.com/Automattic/mongoose/blob/master/CONTRIBUTING.md). + +If your pull requests makes documentation changes, please do **not** +modify any `.html` files. The `.html` files are compiled code, so please make +your changes in `docs/*.pug`, `lib/*.js`, or `test/docs/*.js`. + +View all 400+ [contributors](https://github.com/Automattic/mongoose/graphs/contributors). + +## Installation + +First install [Node.js](http://nodejs.org/) and [MongoDB](https://www.mongodb.org/downloads). Then: + +```sh +$ npm install mongoose +``` + +## Importing + +```javascript +// Using Node.js `require()` +const mongoose = require('mongoose'); + +// Using ES6 imports +import mongoose from 'mongoose'; +``` + +## Mongoose for Enterprise + +Available as part of the Tidelift Subscription + +The maintainers of mongoose and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/npm-mongoose?utm_source=npm-mongoose&utm_medium=referral&utm_campaign=enterprise&utm_term=repo) + +## Overview + +### Connecting to MongoDB + +First, we need to define a connection. If your app uses only one database, you should use `mongoose.connect`. If you need to create additional connections, use `mongoose.createConnection`. + +Both `connect` and `createConnection` take a `mongodb://` URI, or the parameters `host, database, port, options`. + +```js +await mongoose.connect('mongodb://localhost/my_database'); +``` + +Once connected, the `open` event is fired on the `Connection` instance. If you're using `mongoose.connect`, the `Connection` is `mongoose.connection`. Otherwise, `mongoose.createConnection` return value is a `Connection`. + +**Note:** _If the local connection fails then try using 127.0.0.1 instead of localhost. Sometimes issues may arise when the local hostname has been changed._ + +**Important!** Mongoose buffers all the commands until it's connected to the database. This means that you don't have to wait until it connects to MongoDB in order to define models, run queries, etc. + +### Defining a Model + +Models are defined through the `Schema` interface. + +```js +const Schema = mongoose.Schema; +const ObjectId = Schema.ObjectId; + +const BlogPost = new Schema({ + author: ObjectId, + title: String, + body: String, +  date: Date +}); +``` + +Aside from defining the structure of your documents and the types of data you're storing, a Schema handles the definition of: + +* [Validators](http://mongoosejs.com/docs/validation.html) (async and sync) +* [Defaults](http://mongoosejs.com/docs/api.html#schematype_SchemaType-default) +* [Getters](http://mongoosejs.com/docs/api.html#schematype_SchemaType-get) +* [Setters](http://mongoosejs.com/docs/api.html#schematype_SchemaType-set) +* [Indexes](http://mongoosejs.com/docs/guide.html#indexes) +* [Middleware](http://mongoosejs.com/docs/middleware.html) +* [Methods](http://mongoosejs.com/docs/guide.html#methods) definition +* [Statics](http://mongoosejs.com/docs/guide.html#statics) definition +* [Plugins](http://mongoosejs.com/docs/plugins.html) +* [pseudo-JOINs](http://mongoosejs.com/docs/populate.html) + +The following example shows some of these features: + +```js +const Comment = new Schema({ + name: { type: String, default: 'hahaha' }, + age: { type: Number, min: 18, index: true }, + bio: { type: String, match: /[a-z]/ }, + date: { type: Date, default: Date.now }, + buff: Buffer +}); + +// a setter +Comment.path('name').set(function (v) { + return capitalize(v); +}); + +// middleware +Comment.pre('save', function (next) { + notify(this.get('email')); + next(); +}); +``` + +Take a look at the example in [`examples/schema/schema.js`](https://github.com/Automattic/mongoose/blob/master/examples/schema/schema.js) for an end-to-end example of a typical setup. + +### Accessing a Model + +Once we define a model through `mongoose.model('ModelName', mySchema)`, we can access it through the same function + +```js +const MyModel = mongoose.model('ModelName'); +``` + +Or just do it all at once + +```js +const MyModel = mongoose.model('ModelName', mySchema); +``` + +The first argument is the _singular_ name of the collection your model is for. **Mongoose automatically looks for the _plural_ version of your model name.** For example, if you use + +```js +const MyModel = mongoose.model('Ticket', mySchema); +``` + +Then `MyModel` will use the __tickets__ collection, not the __ticket__ collection. For more details read the [model docs](https://mongoosejs.com/docs/api/mongoose.html#mongoose_Mongoose-model). + +Once we have our model, we can then instantiate it, and save it: + +```js +const instance = new MyModel(); +instance.my.key = 'hello'; +instance.save(function (err) { + // +}); +``` + +Or we can find documents from the same collection + +```js +MyModel.find({}, function (err, docs) { + // docs.forEach +}); +``` + +You can also `findOne`, `findById`, `update`, etc. + +```js +const instance = await MyModel.findOne({ ... }); +console.log(instance.my.key); // 'hello' +``` + +For more details check out [the docs](http://mongoosejs.com/docs/queries.html). + +**Important!** If you opened a separate connection using `mongoose.createConnection()` but attempt to access the model through `mongoose.model('ModelName')` it will not work as expected since it is not hooked up to an active db connection. In this case access your model through the connection you created: + +```js +const conn = mongoose.createConnection('your connection string'); +const MyModel = conn.model('ModelName', schema); +const m = new MyModel; +m.save(); // works +``` + +vs + +```js +const conn = mongoose.createConnection('your connection string'); +const MyModel = mongoose.model('ModelName', schema); +const m = new MyModel; +m.save(); // does not work b/c the default connection object was never connected +``` + +### Embedded Documents + +In the first example snippet, we defined a key in the Schema that looks like: + +``` +comments: [Comment] +``` + +Where `Comment` is a `Schema` we created. This means that creating embedded documents is as simple as: + +```js +// retrieve my model +const BlogPost = mongoose.model('BlogPost'); + +// create a blog post +const post = new BlogPost(); + +// create a comment +post.comments.push({ title: 'My comment' }); + +post.save(function (err) { + if (!err) console.log('Success!'); +}); +``` + +The same goes for removing them: + +```js +BlogPost.findById(myId, function (err, post) { + if (!err) { + post.comments[0].remove(); + post.save(function (err) { + // do something + }); + } +}); +``` + +Embedded documents enjoy all the same features as your models. Defaults, validators, middleware. Whenever an error occurs, it's bubbled to the `save()` error callback, so error handling is a snap! + + +### Middleware + +See the [docs](http://mongoosejs.com/docs/middleware.html) page. + +#### Intercepting and mutating method arguments + +You can intercept method arguments via middleware. + +For example, this would allow you to broadcast changes about your Documents every time someone `set`s a path in your Document to a new value: + +```js +schema.pre('set', function (next, path, val, typel) { + // `this` is the current Document + this.emit('set', path, val); + + // Pass control to the next pre + next(); +}); +``` + +Moreover, you can mutate the incoming `method` arguments so that subsequent middleware see different values for those arguments. To do so, just pass the new values to `next`: + +```js +.pre(method, function firstPre (next, methodArg1, methodArg2) { + // Mutate methodArg1 + next("altered-" + methodArg1.toString(), methodArg2); +}); + +// pre declaration is chainable +.pre(method, function secondPre (next, methodArg1, methodArg2) { + console.log(methodArg1); + // => 'altered-originalValOfMethodArg1' + + console.log(methodArg2); + // => 'originalValOfMethodArg2' + + // Passing no arguments to `next` automatically passes along the current argument values + // i.e., the following `next()` is equivalent to `next(methodArg1, methodArg2)` + // and also equivalent to, with the example method arg + // values, `next('altered-originalValOfMethodArg1', 'originalValOfMethodArg2')` + next(); +}); +``` + +#### Schema gotcha + +`type`, when used in a schema has special meaning within Mongoose. If your schema requires using `type` as a nested property you must use object notation: + +```js +new Schema({ + broken: { type: Boolean }, + asset: { + name: String, + type: String // uh oh, it broke. asset will be interpreted as String + } +}); + +new Schema({ + works: { type: Boolean }, + asset: { + name: String, + type: { type: String } // works. asset is an object with a type property + } +}); +``` + +### Driver Access + +Mongoose is built on top of the [official MongoDB Node.js driver](https://github.com/mongodb/node-mongodb-native). Each mongoose model keeps a reference to a [native MongoDB driver collection](http://mongodb.github.io/node-mongodb-native/2.1/api/Collection.html). The collection object can be accessed using `YourModel.collection`. However, using the collection object directly bypasses all mongoose features, including hooks, validation, etc. The one +notable exception that `YourModel.collection` still buffers +commands. As such, `YourModel.collection.find()` will **not** +return a cursor. + +## API Docs + +Find the API docs [here](http://mongoosejs.com/docs/api.html), generated using [dox](https://github.com/tj/dox) +and [acquit](https://github.com/vkarpov15/acquit). + +## Related Projects + +#### MongoDB Runners + +- [run-rs](https://www.npmjs.com/package/run-rs) +- [mongodb-memory-server](https://www.npmjs.com/package/mongodb-memory-server) +- [mongodb-topology-manager](https://www.npmjs.com/package/mongodb-topology-manager) + +#### Unofficial CLIs + +- [mongoosejs-cli](https://www.npmjs.com/package/mongoosejs-cli) + +#### Data Seeding + +- [dookie](https://www.npmjs.com/package/dookie) +- [seedgoose](https://www.npmjs.com/package/seedgoose) +- [mongoose-data-seed](https://www.npmjs.com/package/mongoose-data-seed) + +#### Express Session Stores + +- [connect-mongodb-session](https://www.npmjs.com/package/connect-mongodb-session) +- [connect-mongo](https://www.npmjs.com/package/connect-mongo) + +## License + +Copyright (c) 2010 LearnBoost <dev@learnboost.com> + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/mongoose/SECURITY.md b/node_modules/mongoose/SECURITY.md new file mode 100644 index 000000000..41b89d834 --- /dev/null +++ b/node_modules/mongoose/SECURITY.md @@ -0,0 +1 @@ +Please follow the instructions on [Tidelift's security page](https://tidelift.com/docs/security) to report a security issue. diff --git a/node_modules/mongoose/browser.js b/node_modules/mongoose/browser.js new file mode 100644 index 000000000..4cf822804 --- /dev/null +++ b/node_modules/mongoose/browser.js @@ -0,0 +1,8 @@ +/** + * Export lib/mongoose + * + */ + +'use strict'; + +module.exports = require('./lib/browser'); diff --git a/node_modules/mongoose/build-browser.js b/node_modules/mongoose/build-browser.js new file mode 100644 index 000000000..6f4aa1681 --- /dev/null +++ b/node_modules/mongoose/build-browser.js @@ -0,0 +1,18 @@ +'use strict'; + +const config = require('./webpack.config.js'); +const webpack = require('webpack'); + +const compiler = webpack(config); + +console.log('Starting browser build...'); +compiler.run((err, stats) => { + if (err) { + console.err(stats.toString()); + console.err('Browser build unsuccessful.'); + process.exit(1); + } + console.log(stats.toString()); + console.log('Browser build successful.'); + process.exit(0); +}); diff --git a/node_modules/mongoose/dist/browser.umd.js b/node_modules/mongoose/dist/browser.umd.js new file mode 100644 index 000000000..e01c4f48b --- /dev/null +++ b/node_modules/mongoose/dist/browser.umd.js @@ -0,0 +1,2 @@ +/*! For license information please see browser.umd.js.LICENSE.txt */ +!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.mongoose=e():t.mongoose=e()}("undefined"!=typeof self?self:this,(()=>(()=>{var t={5507:(t,e,r)=>{"use strict";t.exports=r(1735)},1735:(t,e,r)=>{"use strict";var n=r(365).Buffer;function i(t){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i(t)}function o(t,e){return o=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},o(t,e)}function a(t,e){if(e&&("object"===i(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function s(t){return s=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},s(t)}r(9906).set(r(6333));var c=r(4304),u=r(6755);c.setBrowser(!0),Object.defineProperty(e,"Promise",{get:function(){return u.get()},set:function(t){u.set(t)}}),e.PromiseProvider=u,e.Error=r(4888),e.Schema=r(5506),e.Types=r(8941),e.VirtualType=r(459),e.SchemaType=r(4289),e.utils=r(6872),e.Document=c(),e.model=function(t,r){var n=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&o(t,e)}(u,t);var e,n,i,c=(n=u,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=s(n);if(i){var r=s(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return a(this,t)});function u(t,e){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,u),c.call(this,t,r,e)}return e=u,Object.defineProperty(e,"prototype",{writable:!1}),e}(e.Document);return n.modelName=t,n},"undefined"!=typeof window&&(window.mongoose=t.exports,window.Buffer=n)},3434:(t,e,r)=>{"use strict";var n=r(8727),i=r(9620).EventEmitter,o=r(4888),a=r(5506),s=r(6079),c=o.ValidationError,u=r(8859),f=r(5721);function l(t,e,r,i,c){if(!(this instanceof l))return new l(t,e,r,i,c);if(f(e)&&!e.instanceOfSchema&&(e=new a(e)),e=this.schema||e,!this.schema&&e.options._id&&void 0===(t=t||{})._id&&(t._id=new s),!e)throw new o.MissingSchemaError;for(var h in this.$__setSchema(e),n.call(this,t,r,i,c),u(this,e,{decorateDoc:!0}),e.methods)this[h]=e.methods[h];for(var p in e.statics)this[p]=e.statics[p]}l.prototype=Object.create(n.prototype),l.prototype.constructor=l,l.events=new i,l.$emitter=new i,["on","once","emit","listeners","removeListener","setMaxListeners","removeAllListeners","addListener"].forEach((function(t){l[t]=function(){return l.$emitter[t].apply(l.$emitter,arguments)}})),l.ValidationError=c,t.exports=l},6787:(t,e,r)=>{"use strict";function n(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return i(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?i(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,c=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return s=t.done,t},e:function(t){c=!0,a=t},f:function(){try{s||null==r.return||r.return()}finally{if(c)throw a}}}}function i(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r{"use strict";var n=r(1795);t.exports=function(e,r){if(t.exports.convertToTrue.has(e))return!0;if(t.exports.convertToFalse.has(e))return!1;if(null==e)return e;throw new n("boolean",e,r)},t.exports.convertToTrue=new Set([!0,"true",1,"1","yes"]),t.exports.convertToFalse=new Set([!1,"false",0,"0","no"])},195:(t,e,r)=>{"use strict";var n=r(9373);t.exports=function(t){return null==t||""===t?null:t instanceof Date?(n.ok(!isNaN(t.valueOf())),t):(n.ok("boolean"!=typeof t),e=t instanceof Number||"number"==typeof t?new Date(t):"string"==typeof t&&!isNaN(Number(t))&&(Number(t)>=275761||Number(t)<-271820)?new Date(Number(t)):"function"==typeof t.valueOf?new Date(t.valueOf()):new Date(t),isNaN(e.valueOf())?void n.ok(!1):e);var e}},6209:(t,e,r)=>{"use strict";var n=r(365).Buffer;function i(t){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i(t)}var o=r(5003),a=r(9373);t.exports=function(t){return null==t?t:"object"===i(t)&&"string"==typeof t.$numberDecimal?o.fromString(t.$numberDecimal):t instanceof o?t:"string"==typeof t?o.fromString(t):n.isBuffer(t)?new o(t):"number"==typeof t?o.fromString(String(t)):"function"==typeof t.valueOf&&"string"==typeof t.valueOf()?o.fromString(t.valueOf()):void a.ok(!1)}},3065:(t,e,r)=>{"use strict";var n=r(9373);t.exports=function(t){return null==t?t:""===t?null:("string"!=typeof t&&"boolean"!=typeof t||(t=Number(t)),n.ok(!isNaN(t)),t instanceof Number?t.valueOf():"number"==typeof t?t:Array.isArray(t)||"function"!=typeof t.valueOf?t.toString&&!Array.isArray(t)&&t.toString()==Number(t)?Number(t):void n.ok(!1):Number(t.valueOf()))}},4731:(t,e,r)=>{"use strict";var n=r(1563),i=r(9906).get().ObjectId;t.exports=function(t){if(null==t)return t;if(n(t,"ObjectID"))return t;if(t._id){if(n(t._id,"ObjectID"))return t._id;if(t._id.toString instanceof Function)return new i(t._id.toString())}return t.toString instanceof Function?new i(t.toString()):new i(t)}},2417:(t,e,r)=>{"use strict";var n=r(1795);t.exports=function(t,e){if(null==t)return t;if(t._id&&"string"==typeof t._id)return t._id;if(t.toString&&t.toString!==Object.prototype.toString&&!Array.isArray(t))return t.toString();throw new n("string",t,e)}},8727:(t,e,r)=>{"use strict";function n(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function i(t){for(var e=1;e=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,c=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){c=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(c)throw o}}}}function s(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r{"use strict";var n=r(8727),i=r(3434),o=!1;t.exports=function(){return o?i:n},t.exports.setBrowser=function(t){o=t}},9906:t=>{"use strict";var e=null;t.exports.get=function(){return e},t.exports.set=function(t){e=t}},5427:t=>{"use strict";t.exports=function(){}},655:(t,e,r)=>{"use strict";var n=r(3873).Kb;t.exports=n},4267:(t,e,r)=>{"use strict";t.exports=r(3873).Decimal128},6333:(t,e,r)=>{"use strict";e.Binary=r(655),e.Collection=function(){throw new Error("Cannot create a collection from browser library")},e.getConnection=function(){return function(){throw new Error("Cannot create a connection from browser library")}},e.Decimal128=r(4267),e.ObjectId=r(7906),e.ReadPreference=r(5427)},7906:(t,e,r)=>{"use strict";var n=r(3873).t4;Object.defineProperty(n.prototype,"_id",{enumerable:!1,configurable:!0,get:function(){return this}}),t.exports=n},1795:(t,e,r)=>{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){for(var r=0;r0){var c=h(e),u=p(e),b=d(o),m=y(null,t,c,r,b,u,n);(a=f.call(this,m)).init(t,e,r,n,o)}else a=f.call(this,y());return s(a)}return e=l,(r=[{key:"toJSON",value:function(){return{stringValue:this.stringValue,valueType:this.valueType,kind:this.kind,value:this.value,path:this.path,reason:this.reason,name:this.name,message:this.message}}},{key:"init",value:function(t,e,r,n,i){this.stringValue=h(e),this.messageFormat=d(i),this.kind=t,this.value=e,this.path=r,this.reason=n,this.valueType=p(e)}},{key:"copy",value:function(t){this.messageFormat=t.messageFormat,this.stringValue=t.stringValue,this.kind=t.kind,this.value=t.value,this.path=t.path,this.reason=t.reason,this.message=t.message,this.valueType=t.valueType}},{key:"setModel",value:function(t){this.model=t,this.message=y(t,this.kind,this.stringValue,this.path,this.messageFormat,this.valueType)}}])&&o(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),l}(u);function h(t){var e=f.inspect(t);return(e=e.replace(/^'|'$/g,'"')).startsWith('"')||(e='"'+e+'"'),e}function p(t){if(null==t)return""+t;var e=n(t);return"object"!==e||"function"!=typeof t.constructor?e:t.constructor.name}function d(t){var e=t&&t.options&&t.options.cast||null;if("string"==typeof e)return e}function y(t,e,r,n,i,o,a){if(null!=i){var s=i.replace("{KIND}",e).replace("{VALUE}",r).replace("{PATH}",n);return null!=t&&(s=s.replace("{MODEL}",t.modelName)),s}var c="Cast to "+e+" failed for value "+r+(o?" (type "+o+")":"")+' at path "'+n+'"';return null!=t&&(c+=' for model "'+t.modelName+'"'),null!=a&&"function"==typeof a.constructor&&"AssertionError"!==a.constructor.name&&"Error"!==a.constructor.name&&(c+=' because of "'+a.constructor.name+'"'),c}Object.defineProperty(l.prototype,"name",{value:"CastError"}),t.exports=l},6067:(t,e,r)=>{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function i(t,e){return i=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},i(t,e)}function o(t,e){if(e&&("object"===n(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function a(t){return a=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},a(t)}var s=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&i(t,e)}(c,t);var e,r,n,s=(r=c,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=a(r);if(n){var i=a(this).constructor;t=Reflect.construct(e,arguments,i)}else t=e.apply(this,arguments);return o(this,t)});function c(t){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,c);var e="For your own good, using `document.save()` to update an array which was selected using an $elemMatch projection OR populated using skip, limit, query conditions, or exclusion of the _id field when the operation results in a $pop or $set of the entire array is not supported. The following path(s) would have been modified unsafely:\n "+t.join("\n ")+"\nUse Model.update() to update these arrays instead.";return s.call(this,e)}return e=c,Object.defineProperty(e,"prototype",{writable:!1}),e}(r(4888));Object.defineProperty(s.prototype,"name",{value:"DivergentArrayError"}),t.exports=s},4888:(t,e,r)=>{"use strict";var n=r(5202);t.exports=n,n.messages=r(983),n.Messages=n.messages,n.DocumentNotFoundError=r(3640),n.CastError=r(1795),n.ValidationError=r(122),n.ValidatorError=r(2037),n.VersionError=r(8809),n.ParallelSaveError=r(5007),n.OverwriteModelError=r(5676),n.MissingSchemaError=r(1511),n.MongooseServerSelectionError=r(1870),n.DivergentArrayError=r(6067),n.StrictModeError=r(3328)},983:(t,e)=>{"use strict";var r=t.exports={};r.DocumentNotFoundError=null,r.general={},r.general.default="Validator failed for path `{PATH}` with value `{VALUE}`",r.general.required="Path `{PATH}` is required.",r.Number={},r.Number.min="Path `{PATH}` ({VALUE}) is less than minimum allowed value ({MIN}).",r.Number.max="Path `{PATH}` ({VALUE}) is more than maximum allowed value ({MAX}).",r.Number.enum="`{VALUE}` is not a valid enum value for path `{PATH}`.",r.Date={},r.Date.min="Path `{PATH}` ({VALUE}) is before minimum allowed value ({MIN}).",r.Date.max="Path `{PATH}` ({VALUE}) is after maximum allowed value ({MAX}).",r.String={},r.String.enum="`{VALUE}` is not a valid enum value for path `{PATH}`.",r.String.match="Path `{PATH}` is invalid ({VALUE}).",r.String.minlength="Path `{PATH}` (`{VALUE}`) is shorter than the minimum allowed length ({MINLENGTH}).",r.String.maxlength="Path `{PATH}` (`{VALUE}`) is longer than the maximum allowed length ({MAXLENGTH})."},1511:(t,e,r)=>{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function i(t,e){return i=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},i(t,e)}function o(t,e){if(e&&("object"===n(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function a(t){return a=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},a(t)}var s=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&i(t,e)}(c,t);var e,r,n,s=(r=c,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=a(r);if(n){var i=a(this).constructor;t=Reflect.construct(e,arguments,i)}else t=e.apply(this,arguments);return o(this,t)});function c(t){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,c);var e="Schema hasn't been registered for model \""+t+'".\nUse mongoose.model(name, schema)';return s.call(this,e)}return e=c,Object.defineProperty(e,"prototype",{writable:!1}),e}(r(4888));Object.defineProperty(s.prototype,"name",{value:"MissingSchemaError"}),t.exports=s},5202:t=>{"use strict";function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},e(t)}function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function n(t,r){if(r&&("object"===e(r)||"function"==typeof r))return r;if(void 0!==r)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function i(t){var e="function"==typeof Map?new Map:void 0;return i=function(t){if(null===t||(r=t,-1===Function.toString.call(r).indexOf("[native code]")))return t;var r;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,n)}function n(){return o(t,arguments,c(this).constructor)}return n.prototype=Object.create(t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),s(n,t)},i(t)}function o(t,e,r){return o=a()?Reflect.construct.bind():function(t,e,r){var n=[null];n.push.apply(n,e);var i=new(Function.bind.apply(t,n));return r&&s(i,r.prototype),i},o.apply(null,arguments)}function a(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}function s(t,e){return s=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},s(t,e)}function c(t){return c=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},c(t)}var u=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&s(t,e)}(f,t);var e,i,o,u=(e=f,i=a(),function(){var t,r=c(e);if(i){var o=c(this).constructor;t=Reflect.construct(r,arguments,o)}else t=r.apply(this,arguments);return n(this,t)});function f(){return r(this,f),u.apply(this,arguments)}return o=f,Object.defineProperty(o,"prototype",{writable:!1}),o}(i(Error));Object.defineProperty(u.prototype,"name",{value:"MongooseError"}),t.exports=u},3640:(t,e,r)=>{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function i(t,e){return i=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},i(t,e)}function o(t,e){if(e&&("object"===n(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function a(t){return a=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},a(t)}var s=r(4888),c=r(161),u=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&i(t,e)}(f,t);var e,r,n,u=(r=f,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=a(r);if(n){var i=a(this).constructor;t=Reflect.construct(e,arguments,i)}else t=e.apply(this,arguments);return o(this,t)});function f(t,e,r,n){var i,o;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,f);var a=s.messages;return o=null!=a.DocumentNotFoundError?"function"==typeof a.DocumentNotFoundError?a.DocumentNotFoundError(t,e):a.DocumentNotFoundError:'No document found for query "'+c.inspect(t)+'" on model "'+e+'"',(i=u.call(this,o)).result=n,i.numAffected=r,i.filter=t,i.query=t,i}return e=f,Object.defineProperty(e,"prototype",{writable:!1}),e}(s);Object.defineProperty(u.prototype,"name",{value:"DocumentNotFoundError"}),t.exports=u},4107:(t,e,r)=>{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function i(t,e){return i=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},i(t,e)}function o(t,e){if(e&&("object"===n(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function a(t){return a=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},a(t)}var s=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&i(t,e)}(c,t);var e,r,n,s=(r=c,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=a(r);if(n){var i=a(this).constructor;t=Reflect.construct(e,arguments,i)}else t=e.apply(this,arguments);return o(this,t)});function c(t,e){var r;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,c);var n=Array.isArray(e)?"array":"primitive value";return(r=s.call(this,"Tried to set nested object field `"+t+"` to ".concat(n," `")+e+"`")).path=t,r}return e=c,Object.defineProperty(e,"prototype",{writable:!1}),e}(r(4888));Object.defineProperty(s.prototype,"name",{value:"ObjectExpectedError"}),t.exports=s},900:(t,e,r)=>{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function i(t,e){return i=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},i(t,e)}function o(t,e){if(e&&("object"===n(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function a(t){return a=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},a(t)}var s=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&i(t,e)}(c,t);var e,r,n,s=(r=c,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=a(r);if(n){var i=a(this).constructor;t=Reflect.construct(e,arguments,i)}else t=e.apply(this,arguments);return o(this,t)});function c(t,e,r){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,c),s.call(this,'Parameter "'+e+'" to '+r+"() must be an object, got "+t.toString())}return e=c,Object.defineProperty(e,"prototype",{writable:!1}),e}(r(4888));Object.defineProperty(s.prototype,"name",{value:"ObjectParameterError"}),t.exports=s},5676:(t,e,r)=>{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function i(t,e){return i=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},i(t,e)}function o(t,e){if(e&&("object"===n(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function a(t){return a=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},a(t)}var s=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&i(t,e)}(c,t);var e,r,n,s=(r=c,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=a(r);if(n){var i=a(this).constructor;t=Reflect.construct(e,arguments,i)}else t=e.apply(this,arguments);return o(this,t)});function c(t){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,c),s.call(this,"Cannot overwrite `"+t+"` model once compiled.")}return e=c,Object.defineProperty(e,"prototype",{writable:!1}),e}(r(4888));Object.defineProperty(s.prototype,"name",{value:"OverwriteModelError"}),t.exports=s},5007:(t,e,r)=>{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function i(t,e){return i=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},i(t,e)}function o(t,e){if(e&&("object"===n(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function a(t){return a=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},a(t)}var s=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&i(t,e)}(c,t);var e,r,n,s=(r=c,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=a(r);if(n){var i=a(this).constructor;t=Reflect.construct(e,arguments,i)}else t=e.apply(this,arguments);return o(this,t)});function c(t){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,c),s.call(this,"Can't save() the same doc multiple times in parallel. Document: "+t._id)}return e=c,Object.defineProperty(e,"prototype",{writable:!1}),e}(r(4888));Object.defineProperty(s.prototype,"name",{value:"ParallelSaveError"}),t.exports=s},7962:(t,e,r)=>{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function i(t,e){return i=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},i(t,e)}function o(t,e){if(e&&("object"===n(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function a(t){return a=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},a(t)}var s=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&i(t,e)}(c,t);var e,r,n,s=(r=c,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=a(r);if(n){var i=a(this).constructor;t=Reflect.construct(e,arguments,i)}else t=e.apply(this,arguments);return o(this,t)});function c(t){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,c),s.call(this,"Can't validate() the same doc multiple times in parallel. Document: "+t._id)}return e=c,Object.defineProperty(e,"prototype",{writable:!1}),e}(r(5202));Object.defineProperty(s.prototype,"name",{value:"ParallelValidateError"}),t.exports=s},1870:(t,e,r)=>{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){for(var r=0;r{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function i(t,e){return i=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},i(t,e)}function o(t,e){if(e&&("object"===n(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function a(t){return a=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},a(t)}var s=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&i(t,e)}(c,t);var e,r,n,s=(r=c,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=a(r);if(n){var i=a(this).constructor;t=Reflect.construct(e,arguments,i)}else t=e.apply(this,arguments);return o(this,t)});function c(t,e,r){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,c),e=e||"Field `"+t+"` is not in schema and strict mode is set to throw.",(n=s.call(this,e)).isImmutableError=!!r,n.path=t,n}return e=c,Object.defineProperty(e,"prototype",{writable:!1}),e}(r(4888));Object.defineProperty(s.prototype,"name",{value:"StrictModeError"}),t.exports=s},122:(t,e,r)=>{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function i(t,e){for(var r=0;r{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function i(t,e){for(var r=0;r{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function i(t,e){return i=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},i(t,e)}function o(t,e){if(e&&("object"===n(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function a(t){return a=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},a(t)}var s=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&i(t,e)}(c,t);var e,r,n,s=(r=c,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=a(r);if(n){var i=a(this).constructor;t=Reflect.construct(e,arguments,i)}else t=e.apply(this,arguments);return o(this,t)});function c(t,e,r){var n;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,c);var i=r.join(", ");return(n=s.call(this,'No matching document found for id "'+t._id+'" version '+e+' modifiedPaths "'+i+'"')).version=e,n.modifiedPaths=r,n}return e=c,Object.defineProperty(e,"prototype",{writable:!1}),e}(r(4888));Object.defineProperty(s.prototype,"name",{value:"VersionError"}),t.exports=s},6069:t=>{"use strict";t.exports=function t(e){if(!Array.isArray(e))return{min:0,max:0,containsNonArrayItem:!0};if(0===e.length)return{min:1,max:1,containsNonArrayItem:!1};if(1===e.length&&!Array.isArray(e[0]))return{min:1,max:1,containsNonArrayItem:!1};for(var r=t(e[0]),n=1;nr.max&&(r.max=i.max),r.containsNonArrayItem=r.containsNonArrayItem||i.containsNonArrayItem}return r.min=r.min+1,r.max=r.max+1,r}},1973:(t,e,r)=>{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}var i=r(5003),o=r(6079),a=r(2862),s=r(6584),c=r(6749),u=r(1563),f=r(5721),l=r(8770),h=r(3636).trustedSymbol,p=r(6872);function d(t,e,r){if(null==t)return t;if(Array.isArray(t))return function(t,e){var r=0,n=t.length,i=new Array(n);for(r=0;r{"use strict";var n=r(365).Buffer;function i(t){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i(t)}var o=r(9906).get().Binary,a=r(1563),s=r(6584);function c(t){return t&&"object"===i(t)&&!(t instanceof Date)&&!a(t,"ObjectID")&&(!Array.isArray(t)||0!==t.length)&&!(t instanceof n)&&!a(t,"Decimal128")&&!(t instanceof o)}e.x=function t(e,r,i,o){var a,u=(a=e&&s(e)&&!n.isBuffer(e)?Object.keys(e.toObject({transform:!1,virtuals:!1})||{}):Object.keys(e||{})).length,f={};r=r?r+".":"";for(var l=0;l{"use strict";var n=r(1563);t.exports=function(t,e){return"string"==typeof t&&"string"==typeof e||"number"==typeof t&&"number"==typeof e?t===e:!(!n(t,"ObjectID")||!n(e,"ObjectID"))&&t.toString()===e.toString()}},4531:t=>{"use strict";t.exports=function(t,e,r,n,i){var o=Object.keys(t).reduce((function(t,r){return t||r.startsWith(e+".")}),!1),a=e+"."+r.options.discriminatorKey;o||1!==i.length||i[0]!==a||n.splice(n.indexOf(a),1)}},8413:(t,e,r)=>{"use strict";var n=r(7291);t.exports=function(t,e){var r=t.schema.options.discriminatorKey;if(null!=e&&t.discriminators&&null!=e[r])if(t.discriminators[e[r]])t=t.discriminators[e[r]];else{var i=n(t.discriminators,e[r]);i&&(t=i)}return t}},7291:(t,e,r)=>{"use strict";var n=r(2794);t.exports=function(t,e){if(null==t)return null;for(var r=0,i=Object.keys(t);r{"use strict";var n=r(2794);t.exports=function(t,e){if(null==t||null==t.discriminators)return null;for(var r=0,i=Object.keys(t.discriminators);r{"use strict";t.exports=function(t,e,r){var n=(r=r||{}).skipDocArrays,i=0;if(!t)return i;for(var o=0,a=Object.keys(t.$__.activePaths.states.modify);o{"use strict";var n,i=r(8770).documentSchemaSymbol,o=r(4962).h,a=r(6872),s=r(8770).getSymbol,c=r(8770).scopeSymbol,u=a.isPOJO;function f(t,e,i,o){n=n||r(8727);for(var a=o.typeKey,s=0,c=Object.keys(t);s0&&(!h[a]||"type"===a&&u(h.type)&&h.type.type)?h:null,prototype:e,prefix:i,options:o})}}function l(t){var e=t.prop,u=t.subprops,l=t.prototype,h=t.prefix,p=t.options;n=n||r(8727);var d=(h?h+".":"")+e;h=h||"",u?Object.defineProperty(l,e,{enumerable:!0,configurable:!0,get:function(){var t,e,r=this;if(this.$__.getters||(this.$__.getters={}),!this.$__.getters[d]){var o=Object.create(n.prototype,(t=this,e={},Object.getOwnPropertyNames(t).forEach((function(r){-1===["isNew","$__","$errors","errors","_doc","$locals","$op","__parentArray","__index","$isDocumentArrayElement"].indexOf(r)||(e[r]=Object.getOwnPropertyDescriptor(t,r),e[r].enumerable=!1)})),e));h||(o.$__[c]=this),o.$__.nestedPath=d,Object.defineProperty(o,"schema",{enumerable:!1,configurable:!0,writable:!1,value:l.schema}),Object.defineProperty(o,"$__schema",{enumerable:!1,configurable:!0,writable:!1,value:l.schema}),Object.defineProperty(o,i,{enumerable:!1,configurable:!0,writable:!1,value:l.schema}),Object.defineProperty(o,"toObject",{enumerable:!1,configurable:!0,writable:!1,value:function(){return a.clone(r.get(d,null,{virtuals:this&&this.schema&&this.schema.options&&this.schema.options.toObject&&this.schema.options.toObject.virtuals||null}))}}),Object.defineProperty(o,"$__get",{enumerable:!1,configurable:!0,writable:!1,value:function(){return r.get(d,null,{virtuals:this&&this.schema&&this.schema.options&&this.schema.options.toObject&&this.schema.options.toObject.virtuals||null})}}),Object.defineProperty(o,"toJSON",{enumerable:!1,configurable:!0,writable:!1,value:function(){return r.get(d,null,{virtuals:this&&this.schema&&this.schema.options&&this.schema.options.toJSON&&this.schema.options.toJSON.virtuals||null})}}),Object.defineProperty(o,"$__isNested",{enumerable:!1,configurable:!0,writable:!1,value:!0});var s=Object.freeze({minimize:!0,virtuals:!1,getters:!1,transform:!1});Object.defineProperty(o,"$isEmpty",{enumerable:!1,configurable:!0,writable:!1,value:function(){return 0===Object.keys(this.get(d,null,s)||{}).length}}),Object.defineProperty(o,"$__parent",{enumerable:!1,configurable:!0,writable:!1,value:this}),f(u,o,d,p),this.$__.getters[d]=o}return this.$__.getters[d]},set:function(t){null!=t&&t.$__isNested?t=t.$__get():t instanceof n&&!t.$__isNested&&(t=t.$toObject(o)),(this.$__[c]||this).$set(d,t)}}):Object.defineProperty(l,e,{enumerable:!0,configurable:!0,get:function(){return this[s].call(this.$__[c]||this,d)},set:function(t){this.$set.call(this.$__[c]||this,d,t)}})}e.M=f,e.c=l},111:(t,e,r)=>{"use strict";var n=r(9981),i=r(2392);t.exports=function t(e,r,o){for(var a=(o=o||{}).typeOnly,s=-1===r.indexOf(".")?[r]:r.split("."),c=null,u="adhocOrUndefined",f=i(e.schema,e.get(e.schema.options.discriminatorKey))||e.schema,l=0;l{"use strict";function n(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function i(t){for(var e=1;e{"use strict";function e(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,c=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return s=t.done,t},e:function(t){c=!0,a=t},f:function(){try{s||null==n.return||n.return()}finally{if(c)throw a}}}}(o);try{for(h.s();!(u=h.n()).done;){var p=u.value;if(null==l)return i;if(!a&&null!=l[f])return l[f];l=r(l,p),a||(f=f.substr(p.length+1))}}catch(t){h.e(t)}finally{h.f()}return null==l?i:l}},1981:t=>{"use strict";t.exports=function(t){if(null!=t&&"function"==typeof t.constructor)return t.constructor.name}},6749:t=>{"use strict";var e=/^function\s*([^\s(]+)/;t.exports=function(t){return t.name||(t.toString().trim().match(e)||[])[1]}},1490:t=>{"use strict";var e=void 0!=={env:{}}&&"function"==typeof{env:{}}.nextTick?{env:{}}.nextTick.bind({env:{}}):function(t){return setTimeout(t,0)};t.exports=function(t){return e(t)}},1605:t=>{"use strict";t.exports=function(t,e){var r=t.discriminatorMapping&&t.discriminatorMapping.value;if(r&&!("sparse"in e)){var n=t.options.discriminatorKey;e.partialFilterExpression=e.partialFilterExpression||{},e.partialFilterExpression[n]=r}return e}},8857:t=>{"use strict";function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},e(t)}function r(){r=function(){return t};var t={},n=Object.prototype,i=n.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",s=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,r){return t[e]=r}}function f(t,e,r,n){var i=e&&e.prototype instanceof p?e:p,o=Object.create(i.prototype),a=new E(n||[]);return o._invoke=function(t,e,r){var n="suspendedStart";return function(i,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===i)throw o;return{value:void 0,done:!0}}for(r.method=i,r.arg=o;;){var a=r.delegate;if(a){var s=S(a,r);if(s){if(s===h)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var c=l(t,e,r);if("normal"===c.type){if(n=r.done?"completed":"suspendedYield",c.arg===h)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n="completed",r.method="throw",r.arg=c.arg)}}}(t,r,a),o}function l(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=f;var h={};function p(){}function d(){}function y(){}var b={};u(b,a,(function(){return this}));var m=Object.getPrototypeOf,v=m&&m(m(j([])));v&&v!==n&&i.call(v,a)&&(b=v);var g=y.prototype=p.prototype=Object.create(b);function _(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,r){function n(o,a,s,c){var u=l(t[o],t,a);if("throw"!==u.type){var f=u.arg,h=f.value;return h&&"object"==e(h)&&i.call(h,"__await")?r.resolve(h.__await).then((function(t){n("next",t,s,c)}),(function(t){n("throw",t,s,c)})):r.resolve(h).then((function(t){f.value=t,s(f)}),(function(t){return n("throw",t,s,c)}))}c(u.arg)}var o;this._invoke=function(t,e){function i(){return new r((function(r,i){n(t,e,r,i)}))}return o=o?o.then(i,i):i()}}function S(t,e){var r=t.iterator[e.method];if(void 0===r){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,S(t,e),"throw"===e.method))return h;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return h}var n=l(r,t.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,h;var i=n.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,h):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,h)}function O(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function A(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function E(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(O,this),this.reset(!0)}function j(t){if(t){var e=t[a];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,n=function e(){for(;++r=0;--n){var o=this.tryEntries[n],a=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var s=i.call(o,"catchLoc"),c=i.call(o,"finallyLoc");if(s&&c){if(this.prev=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&i.call(n,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),A(r),h}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;A(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:j(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),h}},t}function n(t,e,r,n,i,o,a){try{var s=t[o](a),c=s.value}catch(t){return void r(t)}s.done?e(c):Promise.resolve(c).then(n,i)}function i(t){return function(){var e=this,r=arguments;return new Promise((function(i,o){var a=t.apply(e,r);function s(t){n(a,i,o,s,c,"next",t)}function c(t){n(a,i,o,s,c,"throw",t)}s(void 0)}))}}var o=null;try{o=Object.getPrototypeOf(i(r().mark((function t(){return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:case"end":return t.stop()}}),t)}))))}catch(t){}t.exports=null==o?function(){return!1}:function(t){return"function"==typeof t&&Object.getPrototypeOf(t)===o}},1563:t=>{"use strict";function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},e(t)}t.exports=function(t,r){return"object"===e(t)&&null!==t&&t._bsontype===r}},6584:(t,e,r)=>{"use strict";var n=r(7339).isMongooseArray;t.exports=function(t){return null!=t&&(n(t)||null!=t.$__||t.isMongooseBuffer||t.$isMongooseMap)}},5721:(t,e,r)=>{"use strict";var n=r(365).Buffer;t.exports=function(t){return n.isBuffer(t)||"[object Object]"===Object.prototype.toString.call(t)}},5543:t=>{"use strict";function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},e(t)}t.exports=function(t){return!!t&&("object"===e(t)||"function"==typeof t)&&"function"==typeof t.then}},9130:t=>{"use strict";function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},e(t)}t.exports=function(t){for(var r=Object.keys(t),n=!0,i=0,o=r.length;i{"use strict";var n=r(8107),i=r(8486);function o(t,e,r){var a={useErrorHandlers:!0,numCallbackParams:1,nullResultByDefault:!0,contextParameter:!0},s=(r=r||{}).decorateDoc?t:t.prototype;t.$appliedHooks=!0;for(var c=0,u=Object.keys(e.paths);c{"use strict";function n(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return i(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?i(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,c=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return s=t.done,t},e:function(t){c=!0,a=t},f:function(){try{s||null==r.return||r.return()}finally{if(c)throw a}}}}function i(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}var i=r(5202),o=r(2736),a=r(161);t.exports=function t(e){if(null!=e&&"object"===n(e)&&!Array.isArray(e)&&!e.$__)for(var r=0,s=Object.keys(e);r{"use strict";var e=/\./g;t.exports=function(t){if(-1===t.indexOf("."))return[t];for(var r=t.split(e),n=r.length,i=new Array(n),o="",a=0;a{"use strict";function n(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,c=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return s=t.done,t},e:function(t){c=!0,a=t},f:function(){try{s||null==r.return||r.return()}finally{if(c)throw a}}}}(a);try{for(u.s();!(o=u.n()).done;){var f=o.value;i.has(f)||(null==c[f]&&(c[f]={}),c=c[f])}}catch(t){u.e(t)}finally{u.f()}i.has(s)||(c[s]=r)}else{if(i.has(e))return;t[e]=r}}},5837:(t,e,r)=>{"use strict";function n(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,c=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return s=t.done,t},e:function(t){c=!0,a=t},f:function(){try{s||null==r.return||r.return()}finally{if(c)throw a}}}}(e);try{for(a.s();!(r=a.n()).done;){var s=r.value;if(!s.isVirtual)for(var c=s.path.split("."),u=0;u{"use strict";var n=r(5202),i=r(161);t.exports=function(t,e){if("string"!=typeof t&&"function"!=typeof t)throw new n('Invalid ref at path "'+e+'". Got '+i.inspect(t,{depth:0}))}},7427:t=>{"use strict";t.exports=function(t){for(var e={},r=0,n=Object.keys(t);r{"use strict";function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},e(t)}t.exports=function(t){return null==t||"object"!==e(t)||!("$meta"in t)&&!("$slice"in t)}},9098:(t,e,r)=>{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}var i=r(2183);t.exports=function t(e){if(null==e)return null;var r=Object.keys(e),o=r.length,a=null;if(1===o&&"_id"===r[0])a=!e._id;else for(;o--;){var s=r[o];if("_id"!==s&&i(e[s])){a=null!=e[s]&&"object"===n(e[s])?t(e[s]):!e[s];break}}return a}},8486:(t,e,r)=>{"use strict";var n=r(6755),i=r(1490),o=Symbol("mongoose:emitted");t.exports=function(t,e,r,a){return"function"==typeof t?e((function(e){if(null==e)t.apply(this,arguments);else{null!=r&&null!=r.listeners&&r.listeners("error").length>0&&!e[o]&&(e[o]=!0,r.emit("error",e));try{t(e)}catch(e){return i((function(){throw e}))}}})):new(a=a||n.get())((function(t,n){e((function(e,i){return null!=e?(null!=r&&null!=r.listeners&&r.listeners("error").length>0&&!e[o]&&(e[o]=!0,r.emit("error",e)),n(e)):arguments.length>2?t(Array.prototype.slice.call(arguments,1)):void t(i)}))}))}},5130:(t,e,r)=>{"use strict";t.exports=i;var n=r(9853);function i(t,e){var r={useErrorHandlers:!0,numCallbackParams:1,nullResultByDefault:!0},n=e.hooks.filter((function(t){var e=function(t){var e={};return t.hasOwnProperty("query")&&(e.query=t.query),t.hasOwnProperty("document")&&(e.document=t.document),e}(t);return"updateOne"===t.name?null==e.query||!!e.query:"deleteOne"===t.name?!!e.query||0===Object.keys(e).length:"validate"===t.name||"remove"===t.name?!!e.query:null==t.query&&null==t.document||!!t.query}));t.prototype._execUpdate=n.createWrapper("update",t.prototype._execUpdate,null,r),t.prototype.__distinct=n.createWrapper("distinct",t.prototype.__distinct,null,r),t.prototype.validate=n.createWrapper("validate",t.prototype.validate,null,r),i.middlewareFunctions.filter((function(t){return"update"!==t&&"distinct"!==t&&"validate"!==t})).forEach((function(e){t.prototype["_".concat(e)]=n.createWrapper(e,t.prototype["_".concat(e)],null,r)}))}i.middlewareFunctions=n.concat(["validate"])},9739:(t,e,r)=>{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}var i=r(1795),o=r(3328),a=r(3065),s=new Set(["$and","$or"]),c=new Set(["$cmp","$eq","$lt","$lte","$gt","$gte"]),u=new Set(["$multiply","$divide","$log","$mod","$trunc","$avg","$max","$min","$stdDevPop","$stdDevSamp","$sum"]),f=new Set(["$abs","$exp","$ceil","$floor","$ln","$log10","$round","$sqrt","$sin","$cos","$tan","$asin","$acos","$atan","$atan2","$asinh","$acosh","$atanh","$sinh","$cosh","$tanh","$degreesToRadians","$radiansToDegrees"]),l=new Set(["$arrayElemAt","$first","$last"]),h=new Set(["$year","$month","$week","$dayOfMonth","$dayOfYear","$hour","$minute","$second","$isoDayOfWeek","$isoWeekYear","$isoWeek","$millisecond"]),p=new Set(["$not"]);function d(t,e,r){if(v(t))return t;null!=t.$cond?Array.isArray(t.$cond)?t.$cond=t.$cond.map((function(t){return d(t,e,r)})):(t.$cond.if=d(t.$cond.if,e,r),t.$cond.then=d(t.$cond.then,e,r),t.$cond.else=d(t.$cond.else,e,r)):null!=t.$ifNull?t.$ifNull.map((function(t){return d(t,e,r)})):null!=t.$switch&&(t.branches.map((function(t){return d(t,e,r)})),t.default=d(t.default,e,r));for(var n=0,i=Object.keys(t);n{"use strict";var e=new Set(["$ref","$id","$db"]);t.exports=function(t){return"$"===t[0]&&!e.has(t)}},3636:(t,e)=>{"use strict";function r(t){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(t)}var n=Symbol("mongoose#trustedSymbol");e.trustedSymbol=n,e.trusted=function(t){return null==t||"object"!==r(t)||(t[n]=!0),t}},9853:t=>{"use strict";t.exports=Object.freeze(["count","countDocuments","distinct","estimatedDocumentCount","find","findOne","findOneAndReplace","findOneAndUpdate","replaceOne","update","updateMany","updateOne","deleteMany","deleteOne","findOneAndDelete","findOneAndRemove","remove"])},4133:t=>{"use strict";t.exports=function(t){var e={_id:{auto:!0}};e._id[t.options.typeKey]="ObjectId",t.add(e)}},7658:t=>{"use strict";t.exports=function(t){return t.replace(/\.\$(\[[^\]]*\])?(?=\.)/g,".0").replace(/\.\$(\[[^\]]*\])?$/g,".0")}},5379:(t,e,r)=>{"use strict";var n=r(9981),i=r(5721),o=r(1605);t.exports=function(t){var e=[],r=new WeakMap,a=t.constructor.indexTypes,s=new Map;return function t(c,u,f){if(!r.has(c)){r.set(c,!0),u=u||"";for(var l=0,h=Object.keys(c.paths);l{"use strict";function n(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return i(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?i(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,c=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return s=t.done,t},e:function(t){c=!0,a=t},f:function(){try{s||null==r.return||r.return()}finally{if(c)throw a}}}}function i(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r1){i=new Set;var c,u=n(a);try{for(u.s();!(c=u.n()).done;){var f=c.value;s.has(f)&&i.add(f)}}catch(t){u.e(t)}finally{u.f()}var l,h=n(s);try{for(h.s();!(l=h.n()).done;){var p=l.value;i.has(p)||i.add(p)}}catch(t){h.e(t)}finally{h.f()}i=Array.from(i)}else i=Array.from(s);return i}},9691:(t,e,r)=>{"use strict";var n=r(4133);t.exports=function(t,e){return null==e||null==e._id||(t=t.clone(),e._id?t.paths._id||(n(t),t.options._id=!0):(t.remove("_id"),t.options._id=!1)),t}},6370:t=>{"use strict";t.exports=function(t,e){return null==t?null:"boolean"==typeof t?e:"boolean"==typeof t[e]?t[e]?e:null:e in t?t[e]:e}},1879:t=>{"use strict";function e(){return null!=this._id?String(this._id):null}t.exports=function(t){return!t.paths.id&&t.paths._id&&t.options.id?(t.virtual("id").get(e),t):t}},4913:t=>{"use strict";t.exports=function(t,e,r){for(var n={},i=0,o=Object.keys(e.tree);i{"use strict";var n=r(3328);t.exports=function(t){var e,r;t.$immutable?(t.$immutableSetter=(e=t.path,r=t.options.immutable,function(t,i,o,a){if(null==this||null==this.$__)return t;if(this.isNew)return t;if(a&&a.overwriteImmutable)return t;if(!("function"==typeof r?r.call(this,this):r))return t;var s=null!=this.$__.priorDoc?this.$__.priorDoc.$__getValue(e):this.$__getValue(e);if("throw"===this.$__.strictMode&&t!==s)throw new n(e,"Path `"+e+"` is immutable and strict mode is set to throw.",!0);return s}),t.set(t.$immutableSetter)):t.$immutableSetter&&(t.setters=t.setters.filter((function(e){return e!==t.$immutableSetter})),delete t.$immutableSetter)}},2862:t=>{"use strict";t.exports=new Set(["__proto__","constructor","prototype"])},8770:(t,e)=>{"use strict";e.arrayAtomicsBackupSymbol=Symbol("mongoose#Array#atomicsBackup"),e.arrayAtomicsSymbol=Symbol("mongoose#Array#_atomics"),e.arrayParentSymbol=Symbol("mongoose#Array#_parent"),e.arrayPathSymbol=Symbol("mongoose#Array#_path"),e.arraySchemaSymbol=Symbol("mongoose#Array#_schema"),e.documentArrayParent=Symbol("mongoose:documentArrayParent"),e.documentIsSelected=Symbol("mongoose#Document#isSelected"),e.documentIsModified=Symbol("mongoose#Document#isModified"),e.documentModifiedPaths=Symbol("mongoose#Document#modifiedPaths"),e.documentSchemaSymbol=Symbol("mongoose#Document#schema"),e.getSymbol=Symbol("mongoose#Document#get"),e.modelSymbol=Symbol("mongoose#Model"),e.objectIdSymbol=Symbol("mongoose#ObjectId"),e.populateModelSymbol=Symbol("mongoose.PopulateOptions#Model"),e.schemaTypeSymbol=Symbol("mongoose#schemaType"),e.sessionNewDocuments=Symbol("mongoose:ClientSession#newDocuments"),e.scopeSymbol=Symbol("mongoose#Document#scope"),e.validatorErrorSymbol=Symbol("mongoose:validatorError")},3767:(t,e,r)=>{"use strict";function n(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var i=r(4843),o=r(6434),a=r(9981),s=r(6370),c=r(8107);t.exports=function(t,e){var r=t.childSchemas.find((function(t){return!!t.schema.options.timestamps}));if(e||r){var u,f=s(e,"createdAt"),l=s(e,"updatedAt"),h=null!=e&&e.hasOwnProperty("currentTime")?e.currentTime:null,p={};t.$timestamps={createdAt:f,updatedAt:l},l&&!t.paths[l]&&(p[l]=Date),f&&!t.paths[f]&&(p[f]=(n(u={},t.options.typeKey||"type",Date),n(u,"immutable",!0),u)),t.add(p),t.pre("save",(function(t){var e=a(this,"$__.saveOptions.timestamps");if(!1===e)return t();var r=null!=e&&!1===e.updatedAt,n=null!=e&&!1===e.createdAt,i=null!=h?h():this.ownerDocument().constructor.base.now();if(!n&&(this.isNew||this.$isSubdocument)&&f&&!this.$__getValue(f)&&this.$__isSelected(f)&&this.$set(f,i,void 0,{overwriteImmutable:!0}),!r&&l&&(this.isNew||this.$isModified())){var o=i;this.isNew&&null!=f&&(o=this.$__getValue(f)),this.$set(l,o)}t()})),t.methods.initializeTimestamps=function(){var t=null!=h?h():this.constructor.base.now();return f&&!this.get(f)&&this.$set(f,t),l&&!this.get(l)&&this.$set(l,t),this},y[c.builtInMiddleware]=!0;var d={query:!0,model:!1};t.pre("findOneAndReplace",d,y),t.pre("findOneAndUpdate",d,y),t.pre("replaceOne",d,y),t.pre("update",d,y),t.pre("updateOne",d,y),t.pre("updateMany",d,y)}function y(t){var e=null!=h?h():this.model.base.now();"findOneAndReplace"===this.op&&null==this.getUpdate()&&this.setUpdate({}),o(e,f,l,this.getUpdate(),this.options,this.schema),i(e,this.getUpdate(),this.model.schema),t()}}},5285:(t,e,r)=>{"use strict";var n=r(1981);t.exports=function(t){if("TopologyDescription"!==n(t))return!1;var e=Array.from(t.servers.values());return e.length>0&&e.every((function(t){return"Unknown"===t.type}))}},2082:(t,e,r)=>{"use strict";var n=r(1981);t.exports=function(t){if("TopologyDescription"!==n(t))return!1;var e=Array.from(t.servers.keys());if(0===e.length)return!1;for(var r=0,i=e.length;r{"use strict";var n=r(1981);t.exports=function(t){if("TopologyDescription"!==n(t))return!1;var e=Array.from(t.servers.values());return e.length>0&&e.every((function(t){return t.error&&-1!==t.error.message.indexOf("Client network socket disconnected before secure TLS connection was established")}))}},4843:(t,e,r)=>{"use strict";function n(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return i(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?i(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,c=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return s=t.done,t},e:function(t){c=!0,a=t},f:function(){try{s||null==r.return||r.return()}finally{if(c)throw a}}}}function i(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r0;--h){var p=t.path(l.slice(0,h).join("."));null!=p&&(p.$isMongooseDocumentArray||p.$isSingleNested)&&f.push({parentPath:e.split(".").slice(0,h).join("."),parentSchemaType:p})}if(Array.isArray(r[e])&&u.$isMongooseDocumentArray)!function(t,e,r){var n=e.schema.options.timestamps;if(n)for(var i=t.length,o=a(n,"createdAt"),c=a(n,"updatedAt"),u=0;u0){var d,y=n(f);try{for(y.s();!(d=y.n()).done;){var b=d.value,m=b.parentPath,v=b.parentSchemaType,g=v.schema.options.timestamps,_=a(g,"updatedAt");if(g&&null!=_)if(v.$isSingleNested)r[m+"."+_]=i;else if(v.$isMongooseDocumentArray){var w=e.substring(m.length+1);if(/^\d+$/.test(w)){r[m+"."+w][_]=i;continue}var S=w.indexOf(".");r[m+"."+(w=-1!==S?w.substring(0,S):w)+"."+_]=i}}}catch(t){y.e(t)}finally{y.f()}}else if(null!=u.schema&&u.schema!=t&&r[e]){var O=u.schema.options.timestamps,A=a(O,"createdAt"),E=a(O,"updatedAt");if(!O)return;null!=E&&(r[e][E]=i),null!=A&&(r[e][A]=i)}}}t.exports=s},6434:(t,e,r)=>{"use strict";var n=r(9981);t.exports=function(t,e,r,i,o){var a=i,s=a,c=n(o,"overwrite",!1),u=n(o,"timestamps",!0);if(!u||null==a)return i;var f,l,h,p=null!=u&&!1===u.createdAt,d=null!=u&&!1===u.updatedAt;if(c)return i&&i.$set&&(i=i.$set,a.$set={},s=a.$set),d||!r||i[r]||(s[r]=t),p||!e||i[e]||(s[e]=t),a;if(i=i||{},Array.isArray(a))return a.push({$set:(f={},l=r,h=t,l in f?Object.defineProperty(f,l,{value:h,enumerable:!0,configurable:!0,writable:!0}):f[l]=h,f)}),a;if(a.$set=a.$set||{},!d&&r&&(!i.$currentDate||!i.$currentDate[r])){var y=!1;if(-1!==r.indexOf("."))for(var b=r.split("."),m=1;m{"use strict";var n=r(489).ctor("require","modify","init","default","ignore");function i(){this.activePaths=new n}t.exports=i,i.prototype.fullPath=void 0,i.prototype.strictMode=void 0,i.prototype.selected=void 0,i.prototype.shardval=void 0,i.prototype.saveError=void 0,i.prototype.validationError=void 0,i.prototype.adhocPaths=void 0,i.prototype.removing=void 0,i.prototype.inserting=void 0,i.prototype.saving=void 0,i.prototype.version=void 0,i.prototype._id=void 0,i.prototype.ownerDocument=void 0,i.prototype.populate=void 0,i.prototype.populated=void 0,i.prototype.wasPopulated=!1,i.prototype.scope=void 0,i.prototype.session=null,i.prototype.pathsToScopes=null,i.prototype.cachedRequired=null},4962:(t,e)=>{"use strict";e.h={transform:!1,virtuals:!1,getters:!1,_skipDepopulateTopLevel:!0,depopulate:!0,flattenDecimals:!1,useProjection:!1}},4034:(t,e,r)=>{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function i(t,e){for(var r=0;r{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){return o=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},o(t,e)}function a(t,e){if(e&&("object"===n(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function s(t){return s=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},s(t)}var c=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&o(t,e)}(u,t);var e,r,n,c=(r=u,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=s(r);if(n){var i=s(this).constructor;t=Reflect.construct(e,arguments,i)}else t=e.apply(this,arguments);return a(this,t)});function u(){return i(this,u),c.apply(this,arguments)}return e=u,Object.defineProperty(e,"prototype",{writable:!1}),e}(r(1764)),u=r(3439);Object.defineProperty(c.prototype,"enum",u),Object.defineProperty(c.prototype,"of",u),t.exports=c},9586:(t,e,r)=>{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){return o=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},o(t,e)}function a(t,e){if(e&&("object"===n(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function s(t){return s=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},s(t)}var c=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&o(t,e)}(u,t);var e,r,n,c=(r=u,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=s(r);if(n){var i=s(this).constructor;t=Reflect.construct(e,arguments,i)}else t=e.apply(this,arguments);return a(this,t)});function u(){return i(this,u),c.apply(this,arguments)}return e=u,Object.defineProperty(e,"prototype",{writable:!1}),e}(r(1764)),u=r(3439);Object.defineProperty(c.prototype,"subtype",u),t.exports=c},2869:(t,e,r)=>{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){return o=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},o(t,e)}function a(t,e){if(e&&("object"===n(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function s(t){return s=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},s(t)}var c=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&o(t,e)}(u,t);var e,r,n,c=(r=u,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=s(r);if(n){var i=s(this).constructor;t=Reflect.construct(e,arguments,i)}else t=e.apply(this,arguments);return a(this,t)});function u(){return i(this,u),c.apply(this,arguments)}return e=u,Object.defineProperty(e,"prototype",{writable:!1}),e}(r(1764)),u=r(3439);Object.defineProperty(c.prototype,"min",u),Object.defineProperty(c.prototype,"max",u),Object.defineProperty(c.prototype,"expires",u),t.exports=c},887:(t,e,r)=>{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){return o=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},o(t,e)}function a(t,e){if(e&&("object"===n(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function s(t){return s=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},s(t)}var c=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&o(t,e)}(u,t);var e,r,n,c=(r=u,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=s(r);if(n){var i=s(this).constructor;t=Reflect.construct(e,arguments,i)}else t=e.apply(this,arguments);return a(this,t)});function u(){return i(this,u),c.apply(this,arguments)}return e=u,Object.defineProperty(e,"prototype",{writable:!1}),e}(r(1764)),u=r(3439);Object.defineProperty(c.prototype,"excludeIndexes",u),Object.defineProperty(c.prototype,"_id",u),t.exports=c},8227:(t,e,r)=>{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){return o=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},o(t,e)}function a(t,e){if(e&&("object"===n(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function s(t){return s=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},s(t)}var c=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&o(t,e)}(u,t);var e,r,n,c=(r=u,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=s(r);if(n){var i=s(this).constructor;t=Reflect.construct(e,arguments,i)}else t=e.apply(this,arguments);return a(this,t)});function u(){return i(this,u),c.apply(this,arguments)}return e=u,Object.defineProperty(e,"prototype",{writable:!1}),e}(r(1764)),u=r(3439);Object.defineProperty(c.prototype,"of",u),t.exports=c},8491:(t,e,r)=>{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){return o=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},o(t,e)}function a(t,e){if(e&&("object"===n(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function s(t){return s=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},s(t)}var c=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&o(t,e)}(u,t);var e,r,n,c=(r=u,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=s(r);if(n){var i=s(this).constructor;t=Reflect.construct(e,arguments,i)}else t=e.apply(this,arguments);return a(this,t)});function u(){return i(this,u),c.apply(this,arguments)}return e=u,Object.defineProperty(e,"prototype",{writable:!1}),e}(r(1764)),u=r(3439);Object.defineProperty(c.prototype,"min",u),Object.defineProperty(c.prototype,"max",u),Object.defineProperty(c.prototype,"enum",u),Object.defineProperty(c.prototype,"populate",u),t.exports=c},8172:(t,e,r)=>{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){return o=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},o(t,e)}function a(t,e){if(e&&("object"===n(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function s(t){return s=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},s(t)}var c=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&o(t,e)}(u,t);var e,r,n,c=(r=u,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=s(r);if(n){var i=s(this).constructor;t=Reflect.construct(e,arguments,i)}else t=e.apply(this,arguments);return a(this,t)});function u(){return i(this,u),c.apply(this,arguments)}return e=u,Object.defineProperty(e,"prototype",{writable:!1}),e}(r(1764)),u=r(3439);Object.defineProperty(c.prototype,"auto",u),Object.defineProperty(c.prototype,"populate",u),t.exports=c},3209:(t,e,r)=>{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){return o=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},o(t,e)}function a(t,e){if(e&&("object"===n(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function s(t){return s=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},s(t)}var c=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&o(t,e)}(u,t);var e,r,n,c=(r=u,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=s(r);if(n){var i=s(this).constructor;t=Reflect.construct(e,arguments,i)}else t=e.apply(this,arguments);return a(this,t)});function u(){return i(this,u),c.apply(this,arguments)}return e=u,Object.defineProperty(e,"prototype",{writable:!1}),e}(r(1764)),u=r(3439);Object.defineProperty(c.prototype,"enum",u),Object.defineProperty(c.prototype,"match",u),Object.defineProperty(c.prototype,"lowercase",u),Object.defineProperty(c.prototype,"trim",u),Object.defineProperty(c.prototype,"uppercase",u),Object.defineProperty(c.prototype,"minLength",u),Object.defineProperty(c.prototype,"minlength",u),Object.defineProperty(c.prototype,"maxLength",u),Object.defineProperty(c.prototype,"maxlength",u),Object.defineProperty(c.prototype,"populate",u),t.exports=c},5446:(t,e,r)=>{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){return o=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},o(t,e)}function a(t,e){if(e&&("object"===n(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function s(t){return s=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},s(t)}var c=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&o(t,e)}(u,t);var e,r,n,c=(r=u,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=s(r);if(n){var i=s(this).constructor;t=Reflect.construct(e,arguments,i)}else t=e.apply(this,arguments);return a(this,t)});function u(){return i(this,u),c.apply(this,arguments)}return e=u,Object.defineProperty(e,"prototype",{writable:!1}),e}(r(1764)),u=r(3439);Object.defineProperty(c.prototype,"_id",u),t.exports=c},1764:(t,e,r)=>{"use strict";function n(t,e){for(var r=0;r{"use strict";function n(t,e){for(var r=0;r{"use strict";t.exports=Object.freeze({enumerable:!0,configurable:!0,writable:!0,value:void 0})},6755:(t,e,r)=>{"use strict";var n=r(9373),i=r(5417),o={_promise:null,get:function(){return o._promise},set:function(t){n.ok("function"==typeof t,"mongoose.Promise must be a function, got ".concat(t)),o._promise=t,i.Promise=t}};o.set(r.g.Promise),t.exports=o},2888:(t,e,r)=>{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function i(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return o(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?o(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,c=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return s=t.done,t},e:function(t){c=!0,a=t},f:function(){try{s||null==r.return||r.return()}finally{if(c)throw a}}}}function o(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r1&&!~o.indexOf(i)&&(t[i]=1));for(var f=i.split("."),p="",d=0;d{"use strict";var n=r(365).Buffer;function i(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function o(t){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o(t)}function a(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return s(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?s(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,c=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){c=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(c)throw o}}}}function s(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r0){e&&(this.nested[e.substring(0,e.length-1)]=!0);var l=new I(f),h=Object.assign({},u,{type:l});this.path(e+s,h)}else if(e&&(this.nested[e.substring(0,e.length-1)]=!0),this.path(e+s,u),null!=u&&!u.instanceOfSchema&&E.isPOJO(u.discriminators)){var d=this.path(e+s);for(var b in u.discriminators)d.discriminator(b,u.discriminators[b])}}else if(e&&(this.nested[e.substring(0,e.length-1)]=!0),this.path(e+s,u),null!=u[0]&&!u[0].instanceOfSchema&&E.isPOJO(u[0].discriminators)){var v=this.path(e+s);for(var g in u[0].discriminators)v.discriminator(g,u[0].discriminators[g])}else if(null!=u[0]&&u[0].instanceOfSchema&&E.isPOJO(u[0]._applyDiscriminators)){var _=u[0]._applyDiscriminators||[],S=this.path(e+s);for(var O in _)S.discriminator(O,_[O])}else if(null!=u&&u.instanceOfSchema&&E.isPOJO(u._applyDiscriminators)){var A=u._applyDiscriminators||[],j=this.path(e+s);for(var $ in A)j.discriminator($,A[$])}}}var x=Object.keys(t).map((function(t){return e?e+t:t}));return function(t,e){var r,n=a(e=e||Object.keys(t.paths));try{for(n.s();!(r=n.n()).done;){var i=r.value,o=m(t.paths[i],"options");if(null!=o){var s=t.paths[i].path,c=o.alias;if(c){if("string"!=typeof c)throw new Error("Invalid value for alias option on "+s+", got "+c);t.aliases[c]=s,t.virtual(c).get(function(t){return function(){return"function"==typeof this.get?this.get(t):this[t]}}(s)).set(function(t){return function(e){return this.$set(t,e)}}(s))}}}}catch(t){n.e(t)}finally{n.f()}}(this,x),this},I.prototype.removeIndex=function(t){if(arguments.length>1)throw new Error("removeIndex() takes only 1 argument");if("object"!==o(t)&&"string"!=typeof t)throw new Error("removeIndex() may only take either an object or a string as an argument");if("object"===o(t))for(var e=this._indexes.length-1;e>=0;--e)$.isDeepStrictEqual(this._indexes[e][0],t)&&this._indexes.splice(e,1);else for(var r=this._indexes.length-1;r>=0;--r)null!=this._indexes[r][1]&&this._indexes[r][1].name===t&&this._indexes.splice(r,1);return this},I.prototype.clearIndexes=function(){return this._indexes.length=0,this},I.reserved=Object.create(null),I.prototype.reserved=I.reserved;var B=I.reserved;function T(t){return/\.\d+/.test(t)?t.replace(/\.\d+\./g,".$.").replace(/\.\d+$/,".$"):t}function N(t,e){if(0===t.mapPaths.length)return null;var r,n=a(t.mapPaths);try{for(n.s();!(r=n.n()).done;){var i=r.value.path;if(new RegExp("^"+i.replace(/\.\$\*/g,"\\.[^.]+")+"$").test(e))return t.paths[i]}}catch(t){n.e(t)}finally{n.f()}return null}function D(t,e){var r=e.split(/\.(\d+)\.|\.(\d+)$/).filter(Boolean);if(r.length<2)return t.paths.hasOwnProperty(r[0])?t.paths[r[0]]:"adhocOrUndefined";var n=t.path(r[0]),i=!1;if(!n)return"adhocOrUndefined";for(var o=r.length-1,a=1;a0?".":"")+b,p[b]||(this.nested[d]=!0,p[b]={}),"object"!==o(p[b])){var m="Cannot set nested path `"+t+"`. Parent path `"+d+"` already set to type "+p[b].name+".";throw new Error(m)}p=p[b]}}catch(t){y.e(t)}finally{y.f()}p[l]=E.clone(e),this.paths[t]=this.interpretAsType(t,e,this.options);var v=this.paths[t];if(v.$isSchemaMap){var g=t+".$*";this.paths[g]=v.$__schemaType,this.mapPaths.push(this.paths[g])}if(v.$isSingleNested){for(var _=0,w=Object.keys(v.schema.paths);_0&&!E.hasUserDefinedProperty(n.of,t.options.typeKey)?i({},t.options.typeKey,new I(n.of)):E.isPOJO(n.of)?Object.assign({},n.of):i({},t.options.typeKey,n.of))[t.options.typeKey]&&s[t.options.typeKey].instanceOfSchema&&s[t.options.typeKey].eachPath((function(t,e){if(!0===e.options.select||!1===e.options.select)throw new l('Cannot use schema-level projections (`select: true` or `select: false`) within maps at path "'+r+"."+t+'"')})),E.hasUserDefinedProperty(n,"ref")&&(s.ref=n.ref)),e.$__schemaType=t.interpretAsType(a,s,o)}(this,v,t,e,r),v},I.prototype.eachPath=function(t){for(var e=Object.keys(this.paths),r=e.length,n=0;n0?t+"."+e[r]:e[r],this.paths.hasOwnProperty(t)&&this.paths[t]instanceof c.Mixed)return this.paths[t];return null},I.prototype.setupTimestamp=function(t){return A(this,t)},I.prototype.queue=function(t,e){return this.callQueue.push([t,e]),this},I.prototype.pre=function(t){if(t instanceof RegExp){var e,r=Array.prototype.slice.call(arguments,1),n=a(k);try{for(n.s();!(e=n.n()).done;){var i=e.value;t.test(i)&&this.pre.apply(this,[i].concat(r))}}catch(t){n.e(t)}finally{n.f()}return this}if(Array.isArray(t)){var o,s=Array.prototype.slice.call(arguments,1),c=a(t);try{for(c.s();!(o=c.n()).done;){var u=o.value;this.pre.apply(this,[u].concat(s))}}catch(t){c.e(t)}finally{c.f()}return this}return this.s.hooks.pre.apply(this.s.hooks,arguments),this},I.prototype.post=function(t){if(t instanceof RegExp){var e,r=Array.prototype.slice.call(arguments,1),n=a(k);try{for(n.s();!(e=n.n()).done;){var i=e.value;t.test(i)&&this.post.apply(this,[i].concat(r))}}catch(t){n.e(t)}finally{n.f()}return this}if(Array.isArray(t)){var o,s=Array.prototype.slice.call(arguments,1),c=a(t);try{for(c.s();!(o=c.n()).done;){var u=o.value;this.post.apply(this,[u].concat(s))}}catch(t){c.e(t)}finally{c.f()}return this}return this.s.hooks.post.apply(this.s.hooks,arguments),this},I.prototype.plugin=function(t,e){if("function"!=typeof t)throw new Error('First param to `schema.plugin()` must be a function, got "'+o(t)+'"');if(e&&e.deduplicate){var r,n=a(this.plugins);try{for(n.s();!(r=n.n()).done;)if(r.value.fn===t)return this}catch(t){n.e(t)}finally{n.f()}}return this.plugins.push({fn:t,opts:e}),t(this,e),this},I.prototype.method=function(t,e,r){if("string"!=typeof t)for(var n in t)this.methods[n]=t[n],this.methodOptions[n]=E.clone(r);else this.methods[t]=e,this.methodOptions[t]=E.clone(r);return this},I.prototype.static=function(t,e){if("string"!=typeof t)for(var r in t)this.statics[r]=t[r];else this.statics[t]=e;return this},I.prototype.index=function(t,e){return t||(t={}),e||(e={}),e.expires&&E.expires(e),this._indexes.push([t,e]),this},I.prototype.set=function(t,e,r){if(1===arguments.length)return this.options[t];switch(t){case"read":this.options[t]=O(e,r),this._userProvidedOptions[t]=this.options[t];break;case"timestamps":this.setupTimestamp(e),this.options[t]=e,this._userProvidedOptions[t]=this.options[t];break;case"_id":this.options[t]=e,this._userProvidedOptions[t]=this.options[t],e&&!this.paths._id?b(this):!e&&null!=this.paths._id&&this.paths._id.auto&&this.remove("_id");break;default:this.options[t]=e,this._userProvidedOptions[t]=this.options[t]}return this},I.prototype.get=function(t){return this.options[t]};var C="2d 2dsphere hashed text".split(" ");function U(t,e){var r,n=e.split("."),i=n.pop(),o=t.tree,s=a(n);try{for(s.s();!(r=s.n()).done;)o=o[r.value]}catch(t){s.e(t)}finally{s.f()}delete o[i]}function L(t){return t.startsWith("$[")&&t.endsWith("]")}Object.defineProperty(I,"indexTypes",{get:function(){return C},set:function(){throw new Error("Cannot overwrite Schema.indexTypes")}}),I.prototype.indexes=function(){return g(this)},I.prototype.virtual=function(t,e){if(t instanceof y||"VirtualType"===v(t))return this.virtual(t.path,t.options);if(e=new d(e),E.hasUserDefinedProperty(e,["ref","refPath"])){if(null==e.localField)throw new Error("Reference virtuals require `localField` option");if(null==e.foreignField)throw new Error("Reference virtuals require `foreignField` option");this.pre("init",(function(r){if(S.has(t,r)){var n=S.get(t,r);this.$$populatedVirtuals||(this.$$populatedVirtuals={}),e.justOne||e.count?this.$$populatedVirtuals[t]=Array.isArray(n)?n[0]:n:this.$$populatedVirtuals[t]=Array.isArray(n)?n:null==n?[]:[n],S.unset(t,r)}}));var r=this.virtual(t);r.options=e,r.set((function(r){this.$$populatedVirtuals||(this.$$populatedVirtuals={}),e.justOne||e.count?(this.$$populatedVirtuals[t]=Array.isArray(r)?r[0]:r,"object"!==o(this.$$populatedVirtuals[t])&&(this.$$populatedVirtuals[t]=e.count?r:null)):(this.$$populatedVirtuals[t]=Array.isArray(r)?r:null==r?[]:[r],this.$$populatedVirtuals[t]=this.$$populatedVirtuals[t].filter((function(t){return t&&"object"===o(t)})))})),"function"==typeof e.get&&r.get(e.get);for(var n=t.split("."),i=n[0],a=0;a=e.length?i:a+1>=e.length?i.$__schemaType:t(e.slice(a+1),i.$__schemaType.schema);return i.$fullPath=r.join("."),i}}(n,this)},I.prototype._getPathType=function(t){return this.path(t)?"real":function t(e,r){for(var n,i,o=e.length+1;o--;){if(i=e.slice(0,o).join("."),n=r.path(i))return n.caster?n.caster instanceof c.Mixed?{schema:n,pathType:"mixed"}:o!==e.length&&n.schema?"$"===e[o]||L(e[o])?o===e.length-1?{schema:n,pathType:"nested"}:t(e.slice(o+1),n.schema):t(e.slice(o),n.schema):{schema:n,pathType:n.$isSingleNested?"nested":"array"}:{schema:n,pathType:"real"};if(o===e.length&&r.nested[i])return{schema:r,pathType:"nested"}}return{schema:n||r,pathType:"undefined"}}(t.split("."),this)},I.prototype._preCompile=function(){_(this)},t.exports=e=I,I.Types=c=r(5251),e.ObjectId=c.ObjectId},3617:(t,e,r)=>{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}var i,o=r(1795),a=r(9620).EventEmitter,s=r(4107),c=r(5446),u=r(4289),f=r(8702),l=r(1521).W,h=r(9181),p=r(5008),d=r(8413),y=r(9691),b=r(4962).h,m=r(6872);function v(t,e,r){t=y(t,r),this.caster=g(t),this.caster.path=e,this.caster.prototype.$basePath=e,this.schema=t,this.$isSingleNested=!0,u.call(this,e,r,"Embedded")}function g(t,e){i||(i=r(2591));var n=function(t,e,r){this.$__parent=r,i.apply(this,arguments),null!=r&&this.$session(r.$session())};t._preCompile();var o=null!=e?e.prototype:i.prototype;for(var s in(n.prototype=Object.create(o)).$__setSchema(t),n.prototype.constructor=n,n.schema=t,n.$isSingleNested=!0,n.events=new a,n.prototype.toBSON=function(){return this.toObject(b)},t.methods)n.prototype[s]=t.methods[s];for(var c in t.statics)n[c]=t.statics[c];for(var u in a.prototype)n[u]=a.prototype[u];return n}t.exports=v,v.prototype=Object.create(u.prototype),v.prototype.constructor=v,v.prototype.OptionsConstructor=c,v.prototype.$conditionalHandlers.$geoWithin=function(t){return{$geometry:this.castForQuery(t.$geometry)}},v.prototype.$conditionalHandlers.$near=v.prototype.$conditionalHandlers.$nearSphere=p.cast$near,v.prototype.$conditionalHandlers.$within=v.prototype.$conditionalHandlers.$geoWithin=p.cast$within,v.prototype.$conditionalHandlers.$geoIntersects=p.cast$geoIntersects,v.prototype.$conditionalHandlers.$minDistance=l,v.prototype.$conditionalHandlers.$maxDistance=l,v.prototype.$conditionalHandlers.$exists=f,v.prototype.cast=function(t,e,r,i,o){if(t&&t.$isSingleNested&&t.parent===e)return t;if(null!=t&&("object"!==n(t)||Array.isArray(t)))throw new s(this.path,t);var a,c=d(this.caster,t),u=e&&e.$__&&e.$__.selected||{},f=this.path,l=Object.keys(u).reduce((function(t,e){return e.startsWith(f+".")&&((t=t||{})[e.substring(f.length+1)]=u[e]),t}),null);return o=Object.assign({},o,{priorDoc:i}),r?((a=new c(void 0,l,e)).$init(t),a):0===Object.keys(t).length?new c({},l,e,void 0,o):new c(t,l,e,void 0,o)},v.prototype.castForQuery=function(t,e,r){var n;if(2===arguments.length){if(!(n=this.$conditionalHandlers[t]))throw new Error("Can't use "+t);return n.call(this,e)}if(null==(e=t))return e;this.options.runSetters&&(e=this._applySetters(e));var i=d(this.caster,e),a=null!=r&&null!=r.strict?r.strict:void 0;try{e=new i(e,a)}catch(t){if(!(t instanceof o))throw new o("Embedded",e,this.path,t,this);throw t}return e},v.prototype.doValidate=function(t,e,r,n){var i=d(this.caster,t);if(!t||t instanceof i||(t=new i(t,null,null!=r&&null!=r.$__?r:null)),n&&n.skipSchemaValidators)return t?t.validate(e):e(null);u.prototype.doValidate.call(this,t,(function(r){return r?e(r):t?void t.validate(e):e(null)}),r,n)},v.prototype.doValidateSync=function(t,e,r){if(!r||!r.skipSchemaValidators){var n=u.prototype.doValidateSync.call(this,t,e);if(n)return n}if(t)return t.validateSync()},v.prototype.discriminator=function(t,e,r){r=r||{};var n=m.isPOJO(r)?r.value:r,i="boolean"!=typeof r.clone||r.clone;return e.instanceOfSchema&&i&&(e=e.clone()),e=h(this.caster,t,e,n),this.caster.discriminators[t]=g(e,this.caster),this.caster.discriminators[t]},v.defaultOptions={},v.set=u.set,v.prototype.clone=function(){var t=Object.assign({},this.options),e=new this.constructor(this.schema,this.path,t);return e.validators=this.validators.slice(),void 0!==this.requiredValidator&&(e.requiredValidator=this.requiredValidator),e.caster.discriminators=Object.assign({},this.caster.discriminators),e}},94:(t,e,r)=>{"use strict";function n(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,c=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return s=t.done,t},e:function(t){c=!0,a=t},f:function(){try{s||null==r.return||r.return()}finally{if(c)throw a}}}}(e);try{for(o.s();!(r=o.n()).done;){var a=r.value;i.push(d(this.casterConstructor.schema,a))}}catch(t){o.e(t)}finally{o.f()}return i}}A.$all=function(t){return Array.isArray(t)||(t=[t]),t=t.map((function(t){if(!m.isObject(t))return t;if(null!=t.$elemMatch)return{$elemMatch:d(this.casterConstructor.schema,t.$elemMatch)};var e={};return e[this.path]=t,d(this.casterConstructor.schema,e)[this.path]}),this),this.castForQuery(t)},A.$options=String,A.$elemMatch=function(t){for(var e=Object.keys(t),r=e.length,n=0;n{"use strict";var n=r(1795),i=r(4289),o=r(6670),a=r(6872);function s(t,e){i.call(this,t,e,"Boolean")}s.schemaName="Boolean",s.defaultOptions={},s.prototype=Object.create(i.prototype),s.prototype.constructor=s,s._cast=o,s.set=i.set,s.cast=function(t){return 0===arguments.length||(!1===t&&(t=this._defaultCaster),this._cast=t),this._cast},s._defaultCaster=function(t){if(null!=t&&"boolean"!=typeof t)throw new Error;return t},s._checkRequired=function(t){return!0===t||!1===t},s.checkRequired=i.checkRequired,s.prototype.checkRequired=function(t){return this.constructor._checkRequired(t)},Object.defineProperty(s,"convertToTrue",{get:function(){return o.convertToTrue},set:function(t){o.convertToTrue=t}}),Object.defineProperty(s,"convertToFalse",{get:function(){return o.convertToFalse},set:function(t){o.convertToFalse=t}}),s.prototype.cast=function(t){var e;e="function"==typeof this._castFunction?this._castFunction:"function"==typeof this.constructor.cast?this.constructor.cast():s.cast();try{return e(t)}catch(e){throw new n("Boolean",t,this.path,e,this)}},s.$conditionalHandlers=a.options(i.prototype.$conditionalHandlers,{}),s.prototype.castForQuery=function(t,e){var r;return 2===arguments.length?(r=s.$conditionalHandlers[t])?r.call(this,e):this._castForQuery(e):this._castForQuery(t)},s.prototype._castNullish=function(t){if(void 0===t)return t;var e="function"==typeof this.constructor.cast?this.constructor.cast():s.cast();return null==e?t:!(e.convertToFalse instanceof Set&&e.convertToFalse.has(t))&&(!!(e.convertToTrue instanceof Set&&e.convertToTrue.has(t))||t)},t.exports=s},8800:(t,e,r)=>{"use strict";var n=r(365).Buffer;function i(t){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i(t)}var o=r(4051),a=r(9586),s=r(4289),c=r(4282),u=r(6872),f=o.Binary,l=s.CastError;function h(t,e){s.call(this,t,e,"Buffer")}function p(t){return this.castForQuery(t)}h.schemaName="Buffer",h.defaultOptions={},h.prototype=Object.create(s.prototype),h.prototype.constructor=h,h.prototype.OptionsConstructor=a,h._checkRequired=function(t){return!(!t||!t.length)},h.set=s.set,h.checkRequired=s.checkRequired,h.prototype.checkRequired=function(t,e){return s._isRef(this,t,e,!0)?!!t:this.constructor._checkRequired(t)},h.prototype.cast=function(t,e,r){var a;if(s._isRef(this,t,e,r)){if(t&&t.isMongooseBuffer)return t;if(n.isBuffer(t))return t&&t.isMongooseBuffer||(t=new o(t,[this.path,e]),null!=this.options.subtype&&(t._subtype=this.options.subtype)),t;if(t instanceof f){if(a=new o(t.value(!0),[this.path,e]),"number"!=typeof t.sub_type)throw new l("Buffer",t,this.path,null,this);return a._subtype=t.sub_type,a}if(null==t||u.isNonBuiltinObject(t))return this._castRef(t,e,r)}if(t&&t._id&&(t=t._id),t&&t.isMongooseBuffer)return t;if(n.isBuffer(t))return t&&t.isMongooseBuffer||(t=new o(t,[this.path,e]),null!=this.options.subtype&&(t._subtype=this.options.subtype)),t;if(t instanceof f){if(a=new o(t.value(!0),[this.path,e]),"number"!=typeof t.sub_type)throw new l("Buffer",t,this.path,null,this);return a._subtype=t.sub_type,a}if(null===t)return t;var c=i(t);if("string"===c||"number"===c||Array.isArray(t)||"object"===c&&"Buffer"===t.type&&Array.isArray(t.data))return"number"===c&&(t=[t]),a=new o(t,[this.path,e]),null!=this.options.subtype&&(a._subtype=this.options.subtype),a;throw new l("Buffer",t,this.path,null,this)},h.prototype.subtype=function(t){return this.options.subtype=t,this},h.prototype.$conditionalHandlers=u.options(s.prototype.$conditionalHandlers,{$bitsAllClear:c,$bitsAnyClear:c,$bitsAllSet:c,$bitsAnySet:c,$gt:p,$gte:p,$lt:p,$lte:p}),h.prototype.castForQuery=function(t,e){var r;if(2===arguments.length){if(!(r=this.$conditionalHandlers[t]))throw new Error("Can't use "+t+" with Buffer.");return r.call(this,e)}e=t;var n=this._castForQuery(e);return n?n.toObject({transform:!1,virtuals:!1}):n},t.exports=h},6535:(t,e,r)=>{"use strict";var n=r(4888),i=r(2869),o=r(4289),a=r(195),s=r(1981),c=r(6872),u=o.CastError;function f(t,e){o.call(this,t,e,"Date")}function l(t){return this.cast(t)}f.schemaName="Date",f.defaultOptions={},f.prototype=Object.create(o.prototype),f.prototype.constructor=f,f.prototype.OptionsConstructor=i,f._cast=a,f.set=o.set,f.cast=function(t){return 0===arguments.length||(!1===t&&(t=this._defaultCaster),this._cast=t),this._cast},f._defaultCaster=function(t){if(null!=t&&!(t instanceof Date))throw new Error;return t},f.prototype.expires=function(t){return"Object"!==s(this._index)&&(this._index={}),this._index.expires=t,c.expires(this._index),this},f._checkRequired=function(t){return t instanceof Date},f.checkRequired=o.checkRequired,f.prototype.checkRequired=function(t,e){return o._isRef(this,t,e,!0)?!!t:("function"==typeof this.constructor.checkRequired?this.constructor.checkRequired():f.checkRequired())(t)},f.prototype.min=function(t,e){if(this.minValidator&&(this.validators=this.validators.filter((function(t){return t.validator!==this.minValidator}),this)),t){var r=e||n.messages.Date.min;"string"==typeof r&&(r=r.replace(/{MIN}/,t===Date.now?"Date.now()":t.toString()));var i=this;this.validators.push({validator:this.minValidator=function(e){var r=t;"function"==typeof t&&t!==Date.now&&(r=r.call(this));var n=r===Date.now?r():i.cast(r);return null===e||e.valueOf()>=n.valueOf()},message:r,type:"min",min:t})}return this},f.prototype.max=function(t,e){if(this.maxValidator&&(this.validators=this.validators.filter((function(t){return t.validator!==this.maxValidator}),this)),t){var r=e||n.messages.Date.max;"string"==typeof r&&(r=r.replace(/{MAX}/,t===Date.now?"Date.now()":t.toString()));var i=this;this.validators.push({validator:this.maxValidator=function(e){var r=t;"function"==typeof r&&r!==Date.now&&(r=r.call(this));var n=r===Date.now?r():i.cast(r);return null===e||e.valueOf()<=n.valueOf()},message:r,type:"max",max:t})}return this},f.prototype.cast=function(t){var e;e="function"==typeof this._castFunction?this._castFunction:"function"==typeof this.constructor.cast?this.constructor.cast():f.cast();try{return e(t)}catch(e){throw new u("date",t,this.path,e,this)}},f.prototype.$conditionalHandlers=c.options(o.prototype.$conditionalHandlers,{$gt:l,$gte:l,$lt:l,$lte:l}),f.prototype.castForQuery=function(t,e){if(2!==arguments.length)return this._castForQuery(t);var r=this.$conditionalHandlers[t];if(!r)throw new Error("Can't use "+t+" with Date.");return r.call(this,e)},t.exports=f},6621:(t,e,r)=>{"use strict";var n=r(4289),i=n.CastError,o=r(6209),a=r(6872),s=r(1563);function c(t,e){n.call(this,t,e,"Decimal128")}function u(t){return this.cast(t)}c.schemaName="Decimal128",c.defaultOptions={},c.prototype=Object.create(n.prototype),c.prototype.constructor=c,c._cast=o,c.set=n.set,c.cast=function(t){return 0===arguments.length||(!1===t&&(t=this._defaultCaster),this._cast=t),this._cast},c._defaultCaster=function(t){if(null!=t&&!s(t,"Decimal128"))throw new Error;return t},c._checkRequired=function(t){return s(t,"Decimal128")},c.checkRequired=n.checkRequired,c.prototype.checkRequired=function(t,e){return n._isRef(this,t,e,!0)?!!t:("function"==typeof this.constructor.checkRequired?this.constructor.checkRequired():c.checkRequired())(t)},c.prototype.cast=function(t,e,r){if(n._isRef(this,t,e,r))return s(t,"Decimal128")?t:this._castRef(t,e,r);var o;o="function"==typeof this._castFunction?this._castFunction:"function"==typeof this.constructor.cast?this.constructor.cast():c.cast();try{return o(t)}catch(e){throw new i("Decimal128",t,this.path,e,this)}},c.prototype.$conditionalHandlers=a.options(n.prototype.$conditionalHandlers,{$gt:u,$gte:u,$lt:u,$lte:u}),t.exports=c},4504:(t,e,r)=>{"use strict";var n,i,o=r(94),a=r(1795),s=r(9620).EventEmitter,c=r(887),u=r(4289),f=r(9181),l=r(9691),h=r(719),p=r(6872),d=r(8413),y=r(8770).arrayAtomicsSymbol,b=r(8770).arrayPathSymbol,m=r(8770).documentArrayParent;function v(t,e,r,n){null!=n&&null!=n._id?e=l(e,n):null!=r&&null!=r._id&&(e=l(e,r));var i=g(e,r);i.prototype.$basePath=t,o.call(this,t,i,r),this.schema=e,this.schemaOptions=n||{},this.$isMongooseDocumentArray=!0,this.Constructor=i,i.base=e.base;var a=this.defaultValue;"defaultValue"in this&&void 0===a||this.default((function(){var t=a.call(this);return null==t||Array.isArray(t)||(t=[t]),t}));var s=this;this.$embeddedSchemaType=new u(t+".$",{required:this&&this.schemaOptions&&this.schemaOptions.required||!1}),this.$embeddedSchemaType.cast=function(t,e,r){return s.cast(t,e,r)[0]},this.$embeddedSchemaType.$isMongooseDocumentArrayElement=!0,this.$embeddedSchemaType.caster=this.Constructor,this.$embeddedSchemaType.schema=this.schema}function g(t,e,n){function o(t,e){i.apply(this,arguments),null!=e&&null!=e.getArrayParent()&&this.$session(e.getArrayParent().$session())}i||(i=r(1568)),t._preCompile();var a=null!=n?n.prototype:i.prototype;for(var c in o.prototype=Object.create(a),o.prototype.$__setSchema(t),o.schema=t,o.prototype.constructor=o,o.$isArraySubdocument=!0,o.events=new s,t.methods)o.prototype[c]=t.methods[c];for(var u in t.statics)o[u]=t.statics[u];for(var f in s.prototype)o[f]=s.prototype[f];return o.options=e,o}v.schemaName="DocumentArray",v.options={castNonArrays:!0},v.prototype=Object.create(o.prototype),v.prototype.constructor=v,v.prototype.OptionsConstructor=c,v.prototype.discriminator=function(t,e,r){"function"==typeof t&&(t=p.getFunctionName(t)),r=r||{};var n=p.isPOJO(r)?r.value:r,i="boolean"!=typeof r.clone||r.clone;e.instanceOfSchema&&i&&(e=e.clone());var o=g(e=f(this.casterConstructor,t,e,n),null,this.casterConstructor);o.baseCasterConstructor=this.casterConstructor;try{Object.defineProperty(o,"name",{value:t})}catch(t){}return this.casterConstructor.discriminators[t]=o,this.casterConstructor.discriminators[t]},v.prototype.doValidate=function(t,e,o,a){n||(n=r(6077));var s=this;try{u.prototype.doValidate.call(this,t,(function(r){if(r)return e(r);var c,u=t&&t.length;if(!u)return e();if(a&&a.updateValidator)return e();function f(t){null!=t&&(c=t),--u||e(c)}p.isMongooseDocumentArray(t)||(t=new n(t,s.path,o));for(var l=0,h=u;l{"use strict";e.String=r(6542),e.Number=r(1751),e.Boolean=r(6470),e.DocumentArray=r(4504),e.Subdocument=r(3617),e.Array=r(94),e.Buffer=r(8800),e.Date=r(6535),e.ObjectId=r(7116),e.Mixed=r(3861),e.Decimal128=e.Decimal=r(6621),e.Map=r(71),e.Oid=e.ObjectId,e.Object=e.Mixed,e.Bool=e.Boolean,e.ObjectID=e.ObjectId},71:(t,e,r)=>{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function i(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,c=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return s=t.done,t},e:function(t){c=!0,a=t},f:function(){try{s||null==r.return||r.return()}finally{if(c)throw a}}}}(t.keys());try{for(c.s();!(s=c.n()).done;){var u=s.value,f=t.get(u);f=null==f?a.$__schemaType._castNullish(f):a.$__schemaType.cast(f,e,!0,null,{path:o+"."+u}),a.$init(u,f)}}catch(t){c.e(t)}finally{c.f()}}else for(var h=0,p=Object.keys(t);h{"use strict";var n=r(4289),i=r(8107),o=r(5721),a=r(6872);function s(t,e){if(e&&e.default){var r=e.default;Array.isArray(r)&&0===r.length?e.default=Array:!e.shared&&o(r)&&0===Object.keys(r).length&&(e.default=function(){return{}})}n.call(this,t,e,"Mixed"),this[i.schemaMixedSymbol]=!0}s.schemaName="Mixed",s.defaultOptions={},s.prototype=Object.create(n.prototype),s.prototype.constructor=s,s.get=n.get,s.set=n.set,s.prototype.cast=function(t){return t instanceof Error?a.errorToPOJO(t):t},s.prototype.castForQuery=function(t,e){return 2===arguments.length?e:t},t.exports=s},1751:(t,e,r)=>{"use strict";var n=r(4888),i=r(8491),o=r(4289),a=r(3065),s=r(4282),c=r(6872),u=o.CastError;function f(t,e){o.call(this,t,e,"Number")}function l(t){return this.cast(t)}f.get=o.get,f.set=o.set,f._cast=a,f.cast=function(t){return 0===arguments.length||(!1===t&&(t=this._defaultCaster),this._cast=t),this._cast},f._defaultCaster=function(t){if("number"!=typeof t)throw new Error;return t},f.schemaName="Number",f.defaultOptions={},f.prototype=Object.create(o.prototype),f.prototype.constructor=f,f.prototype.OptionsConstructor=i,f._checkRequired=function(t){return"number"==typeof t||t instanceof Number},f.checkRequired=o.checkRequired,f.prototype.checkRequired=function(t,e){return o._isRef(this,t,e,!0)?!!t:("function"==typeof this.constructor.checkRequired?this.constructor.checkRequired():f.checkRequired())(t)},f.prototype.min=function(t,e){if(this.minValidator&&(this.validators=this.validators.filter((function(t){return t.validator!==this.minValidator}),this)),null!=t){var r=e||n.messages.Number.min;r=r.replace(/{MIN}/,t),this.validators.push({validator:this.minValidator=function(e){return null==e||e>=t},message:r,type:"min",min:t})}return this},f.prototype.max=function(t,e){if(this.maxValidator&&(this.validators=this.validators.filter((function(t){return t.validator!==this.maxValidator}),this)),null!=t){var r=e||n.messages.Number.max;r=r.replace(/{MAX}/,t),this.validators.push({validator:this.maxValidator=function(e){return null==e||e<=t},message:r,type:"max",max:t})}return this},f.prototype.enum=function(t,e){if(this.enumValidator&&(this.validators=this.validators.filter((function(t){return t.validator!==this.enumValidator}),this)),!Array.isArray(t)){var r=c.isPOJO(t)&&null!=t.values;r?(e=t.message,t=t.values):"number"==typeof t&&(t=Array.prototype.slice.call(arguments),e=null),c.isPOJO(t)&&(t=Object.values(t)),e=e||n.messages.Number.enum}return e=null==e?n.messages.Number.enum:e,this.enumValidator=function(e){return null==e||-1!==t.indexOf(e)},this.validators.push({validator:this.enumValidator,message:e,type:"enum",enumValues:t}),this},f.prototype.cast=function(t,e,r){if("number"!=typeof t&&o._isRef(this,t,e,r)&&(null==t||c.isNonBuiltinObject(t)))return this._castRef(t,e,r);var n,i=t&&void 0!==t._id?t._id:t;n="function"==typeof this._castFunction?this._castFunction:"function"==typeof this.constructor.cast?this.constructor.cast():f.cast();try{return n(i)}catch(t){throw new u("Number",i,this.path,t,this)}},f.prototype.$conditionalHandlers=c.options(o.prototype.$conditionalHandlers,{$bitsAllClear:s,$bitsAnyClear:s,$bitsAllSet:s,$bitsAnySet:s,$gt:l,$gte:l,$lt:l,$lte:l,$mod:function(t){var e=this;return Array.isArray(t)?t.map((function(t){return e.cast(t)})):[this.cast(t)]}}),f.prototype.castForQuery=function(t,e){var r;if(2===arguments.length){if(!(r=this.$conditionalHandlers[t]))throw new u("number",e,this.path,null,this);return r.call(this,e)}return this._castForQuery(t)},t.exports=f},7116:(t,e,r)=>{"use strict";var n,i=r(8172),o=r(4289),a=r(4731),s=r(1981),c=r(6079),u=r(1563),f=r(6872),l=o.CastError;function h(t,e){var r="string"==typeof t&&24===t.length&&/^[a-f0-9]+$/i.test(t),n=e&&e.suppressWarning;!r&&void 0!==t||n||f.warn("mongoose: To create a new ObjectId please try `Mongoose.Types.ObjectId` instead of using `Mongoose.Schema.ObjectId`. Set the `suppressWarning` option if you're trying to create a hex char path in your schema."),o.call(this,t,e,"ObjectID")}function p(t){return this.cast(t)}function d(){return new c}function y(t){return n||(n=r(8727)),this instanceof n&&void 0===t?new c:t}h.schemaName="ObjectId",h.defaultOptions={},h.prototype=Object.create(o.prototype),h.prototype.constructor=h,h.prototype.OptionsConstructor=i,h.get=o.get,h.set=o.set,h.prototype.auto=function(t){return t&&(this.default(d),this.set(y)),this},h._checkRequired=function(t){return u(t,"ObjectID")},h._cast=a,h.cast=function(t){return 0===arguments.length||(!1===t&&(t=this._defaultCaster),this._cast=t),this._cast},h._defaultCaster=function(t){if(!u(t,"ObjectID"))throw new Error(t+" is not an instance of ObjectId");return t},h.checkRequired=o.checkRequired,h.prototype.checkRequired=function(t,e){return o._isRef(this,t,e,!0)?!!t:("function"==typeof this.constructor.checkRequired?this.constructor.checkRequired():h.checkRequired())(t)},h.prototype.cast=function(t,e,r){if(!u(t,"ObjectID")&&o._isRef(this,t,e,r)){if("objectid"===(s(t)||"").toLowerCase())return new c(t.toHexString());if(null==t||f.isNonBuiltinObject(t))return this._castRef(t,e,r)}var n;n="function"==typeof this._castFunction?this._castFunction:"function"==typeof this.constructor.cast?this.constructor.cast():h.cast();try{return n(t)}catch(e){throw new l("ObjectId",t,this.path,e,this)}},h.prototype.$conditionalHandlers=f.options(o.prototype.$conditionalHandlers,{$gt:p,$gte:p,$lt:p,$lte:p}),d.$runBeforeSetters=!0,t.exports=h},4282:(t,e,r)=>{"use strict";var n=r(365).Buffer,i=r(1795);function o(t,e){var r=Number(e);if(isNaN(r))throw new i("number",e,t);return r}t.exports=function(t){var e=this;return Array.isArray(t)?t.map((function(t){return o(e.path,t)})):n.isBuffer(t)?t:o(e.path,t)}},8702:(t,e,r)=>{"use strict";var n=r(6670);t.exports=function(t){var e=null!=this?this.path:null;return n(t,e)}},5008:(t,e,r)=>{"use strict";var n=r(1521).i,i=r(1521).W;function o(t,e){switch(t.$geometry.type){case"Polygon":case"LineString":case"Point":n(t.$geometry.coordinates,e)}return a(e,t),t}function a(t,e){e.$maxDistance&&(e.$maxDistance=i.call(t,e.$maxDistance)),e.$minDistance&&(e.$minDistance=i.call(t,e.$minDistance))}e.cast$geoIntersects=function(t){if(t.$geometry)return o(t,this),t},e.cast$near=function(t){var e=r(94);if(Array.isArray(t))return n(t,this),t;if(a(this,t),t&&t.$geometry)return o(t,this);if(!Array.isArray(t))throw new TypeError("$near must be either an array or an object with a $geometry property");return e.prototype.castForQuery.call(this,t)},e.cast$within=function(t){var e=this;if(a(this,t),t.$box||t.$polygon){var r=t.$box?"$box":"$polygon";t[r].forEach((function(t){if(!Array.isArray(t))throw new TypeError("Invalid $within $box argument. Expected an array, received "+t);t.forEach((function(r,n){t[n]=i.call(e,r)}))}))}else if(t.$center||t.$centerSphere){var n=t.$center?"$center":"$centerSphere";t[n].forEach((function(r,o){Array.isArray(r)?r.forEach((function(t,n){r[n]=i.call(e,t)})):t[n][o]=i.call(e,r)}))}else t.$geometry&&o(t,this);return t}},1521:(t,e,r)=>{"use strict";var n=r(1751);function i(t){return n.cast()(t)}e.W=i,e.i=function t(e,r){e.forEach((function(n,o){Array.isArray(n)?t(n,r):e[o]=i.call(r,n)}))}},6495:(t,e,r)=>{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}var i=r(1795),o=r(6670),a=r(2417);t.exports=function(t,e){if(null==t||"object"!==n(t))throw new i("$text",t,e);return null!=t.$search&&(t.$search=a(t.$search,e+".$search")),null!=t.$language&&(t.$language=a(t.$language,e+".$language")),null!=t.$caseSensitive&&(t.$caseSensitive=o(t.$caseSensitive,e+".$castSensitive")),null!=t.$diacriticSensitive&&(t.$diacriticSensitive=o(t.$diacriticSensitive,e+".$diacriticSensitive")),t}},3053:t=>{"use strict";t.exports=function(t){if(Array.isArray(t)){if(!t.every((function(t){return"number"==typeof t||"string"==typeof t})))throw new Error("$type array values must be strings or numbers");return t}if("number"!=typeof t&&"string"!=typeof t)throw new Error("$type parameter must be number, string, or array of numbers and strings");return t}},6542:(t,e,r)=>{"use strict";function n(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return i(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?i(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,c=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return s=t.done,t},e:function(t){c=!0,a=t},f:function(){try{s||null==r.return||r.return()}finally{if(c)throw a}}}}function i(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r0&&!t?this:this.set((function(t){return"string"!=typeof t&&(t=e.cast(t)),t?t.toLowerCase():t}))},h.prototype.uppercase=function(t){var e=this;return arguments.length>0&&!t?this:this.set((function(t){return"string"!=typeof t&&(t=e.cast(t)),t?t.toUpperCase():t}))},h.prototype.trim=function(t){var e=this;return arguments.length>0&&!t?this:this.set((function(t){return"string"!=typeof t&&(t=e.cast(t)),t?t.trim():t}))},h.prototype.minlength=function(t,e){if(this.minlengthValidator&&(this.validators=this.validators.filter((function(t){return t.validator!==this.minlengthValidator}),this)),null!=t){var r=e||a.messages.String.minlength;r=r.replace(/{MINLENGTH}/,t),this.validators.push({validator:this.minlengthValidator=function(e){return null===e||e.length>=t},message:r,type:"minlength",minlength:t})}return this},h.prototype.minLength=h.prototype.minlength,h.prototype.maxlength=function(t,e){if(this.maxlengthValidator&&(this.validators=this.validators.filter((function(t){return t.validator!==this.maxlengthValidator}),this)),null!=t){var r=e||a.messages.String.maxlength;r=r.replace(/{MAXLENGTH}/,t),this.validators.push({validator:this.maxlengthValidator=function(e){return null===e||e.length<=t},message:r,type:"maxlength",maxlength:t})}return this},h.prototype.maxLength=h.prototype.maxlength,h.prototype.match=function(t,e){var r=e||a.messages.String.match;return this.validators.push({validator:function(e){return!!t&&(t.lastIndex=0,null==e||""===e||t.test(e))},message:r,type:"regexp",regexp:t}),this},h.prototype.checkRequired=function(t,e){return o._isRef(this,t,e,!0)?!!t:("function"==typeof this.constructor.checkRequired?this.constructor.checkRequired():h.checkRequired())(t)},h.prototype.cast=function(t,e,r){if("string"!=typeof t&&o._isRef(this,t,e,r))return this._castRef(t,e,r);var n;n="function"==typeof this._castFunction?this._castFunction:"function"==typeof this.constructor.cast?this.constructor.cast():h.cast();try{return n(t)}catch(e){throw new l("string",t,this.path,null,this)}};var y=u.options(o.prototype.$conditionalHandlers,{$all:function(t){var e=this;return Array.isArray(t)?t.map((function(t){return e.castForQuery(t)})):[this.castForQuery(t)]},$gt:p,$gte:p,$lt:p,$lte:p,$options:d,$regex:function(t){return"[object RegExp]"===Object.prototype.toString.call(t)?t:d.call(this,t)},$not:p});Object.defineProperty(h.prototype,"$conditionalHandlers",{configurable:!1,enumerable:!1,writable:!1,value:Object.freeze(y)}),h.prototype.castForQuery=function(t,e){var r;if(2===arguments.length){if(!(r=this.$conditionalHandlers[t]))throw new Error("Can't use "+t+" with String.");return r.call(this,e)}return e=t,"[object RegExp]"===Object.prototype.toString.call(e)||f(e,"BSONRegExp")?e:this._castForQuery(e)},t.exports=h},8107:(t,e)=>{"use strict";e.schemaMixedSymbol=Symbol.for("mongoose:schema_mixed"),e.builtInMiddleware=Symbol.for("mongoose:built-in-middleware")},4289:(t,e,r)=>{"use strict";var n=r(365).Buffer;function i(t){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i(t)}var o=r(4888),a=r(1764),s=r(8702),c=r(3053),u=r(8828),f=r(8857),l=r(9130),h=r(1490),p=r(8770).schemaTypeSymbol,d=r(6872),y=r(8770).validatorErrorSymbol,b=r(8770).documentIsModified,m=r(8770).populateModelSymbol,v=o.CastError,g=o.ValidatorError,_={_skipMarkModified:!0};function w(t,e,r){this[p]=!0,this.path=t,this.instance=r,this.validators=[],this.getters=this.constructor.hasOwnProperty("getters")?this.constructor.getters.slice():[],this.setters=[],this.splitPath(),e=e||{};for(var n=this.constructor.defaultOptions||{},o=0,s=Object.keys(n);o1&&(this.defaultValue=Array.prototype.slice.call(arguments)),this.defaultValue},w.prototype.index=function(t){return this._index=t,d.expires(this._index),this},w.prototype.unique=function(t){if(!1===this._index){if(!t)return;throw new Error('Path "'+this.path+'" may not have `index` set to false and `unique` set to true')}return this.options.hasOwnProperty("index")||!1!==t?(null==this._index||!0===this._index?this._index={}:"string"==typeof this._index&&(this._index={type:this._index}),this._index.unique=t,this):this},w.prototype.text=function(t){if(!1===this._index){if(!t)return;throw new Error('Path "'+this.path+'" may not have `index` set to false and `text` set to true')}return this.options.hasOwnProperty("index")||!1!==t?(null===this._index||void 0===this._index||"boolean"==typeof this._index?this._index={}:"string"==typeof this._index&&(this._index={type:this._index}),this._index.text=t,this):this},w.prototype.sparse=function(t){if(!1===this._index){if(!t)return;throw new Error('Path "'+this.path+'" may not have `index` set to false and `sparse` set to true')}return this.options.hasOwnProperty("index")||!1!==t?(null==this._index||"boolean"==typeof this._index?this._index={}:"string"==typeof this._index&&(this._index={type:this._index}),this._index.sparse=t,this):this},w.prototype.immutable=function(t){return this.$immutable=t,u(this),this},w.prototype.transform=function(t){return this.options.transform=t,this},w.prototype.set=function(t){if("function"!=typeof t)throw new TypeError("A setter must be a function.");return this.setters.push(t),this},w.prototype.get=function(t){if("function"!=typeof t)throw new TypeError("A getter must be a function.");return this.getters.push(t),this},w.prototype.validate=function(t,e,r){var n,a,s,c;if("function"==typeof t||t&&"RegExp"===d.getFunctionName(t.constructor))return"function"==typeof e?(n={validator:t,message:e}).type=r||"user defined":e instanceof Object&&!r?((n=l(e)?Object.assign({},e):d.clone(e)).message||(n.message=n.msg),n.validator=t,n.type=n.type||"user defined"):(null==e&&(e=o.messages.general.default),r||(r="user defined"),n={message:e,type:r,validator:t}),this.validators.push(n),this;for(a=0,s=arguments.length;a0&&null==t)return this.validators=this.validators.filter((function(t){return t.validator!==this.requiredValidator}),this),this.isRequired=!1,delete this.originalRequiredValue,this;if("object"===i(t)&&(e=(r=t).message||e,t=t.isRequired),!1===t)return this.validators=this.validators.filter((function(t){return t.validator!==this.requiredValidator}),this),this.isRequired=!1,delete this.originalRequiredValue,this;var n=this;this.isRequired=!0,this.requiredValidator=function(e){var r=this&&this.$__&&this.$__.cachedRequired;if(null!=r&&!this.$__isSelected(n.path)&&!this[b](n.path))return!0;if(null!=r&&n.path in r){var i=!r[n.path]||n.checkRequired(e,this);return delete r[n.path],i}return"function"==typeof t&&!t.apply(this)||n.checkRequired(e,this)},this.originalRequiredValue=t,"string"==typeof t&&(e=t,t=void 0);var a=e||o.messages.general.required;return this.validators.unshift(Object.assign({},r,{validator:this.requiredValidator,message:a,type:"required"})),this},w.prototype.ref=function(t){return this.options.ref=t,this},w.prototype.getDefault=function(t,e){var r;if(null!=(r="function"==typeof this.defaultValue?this.defaultValue===Date.now||this.defaultValue===Array||"objectid"===this.defaultValue.name.toLowerCase()?this.defaultValue.call(t):this.defaultValue.call(t,t):this.defaultValue)){"object"!==i(r)||this.options&&this.options.shared||(r=d.clone(r));var n=this.applySetters(r,t,e,void 0,_);return n&&!Array.isArray(n)&&n.$isSingleNested&&(n.$__parent=t),n}return r},w.prototype._applySetters=function(t,e,r,n,i){var o=t;if(r)return o;for(var a=this.setters,s=a.length-1;s>=0;s--)o=a[s].call(e,o,n,this,i);return o},w.prototype._castNullish=function(t){return t},w.prototype.applySetters=function(t,e,r,n,i){var o=this._applySetters(t,e,r,n,i);return null==o?this._castNullish(o):o=this.cast(o,e,r,n,i)},w.prototype.applyGetters=function(t,e){var r=t,n=this.getters,i=n.length;if(0===i)return r;for(var o=0;o{"use strict";r(6872);var n=t.exports=function(){};n.ctor=function(){var t=Array.prototype.slice.call(arguments),e=function(){n.apply(this,arguments),this.paths={},this.states={},this.stateNames=t;for(var e,r=t.length;r--;)e=t[r],this.states[e]={}};return e.prototype=new n,t.forEach((function(t){e.prototype[t]=function(e){this._changeState(e,t)}})),e},n.prototype._changeState=function(t,e){var r=this.states[this.paths[t]];r&&delete r[t],this.paths[t]=e,this.states[e][t]=!0},n.prototype.clear=function(t){for(var e,r=Object.keys(this.states[t]),n=r.length;n--;)e=r[n],delete this.states[t][e],delete this.paths[e]},n.prototype.some=function(){var t=this,e=arguments.length?arguments:this.stateNames;return Array.prototype.some.call(e,(function(e){return Object.keys(t.states[e]).length}))},n.prototype._iter=function(t){return function(){var e=Array.prototype.slice.call(arguments),r=e.pop();e.length||(e=this.stateNames);var n=this,i=e.reduce((function(t,e){return t.concat(Object.keys(n.states[e]))}),[]);return i[t]((function(t,e,n){return r(t,e,n)}))}},n.prototype.forEach=function(){return this.forEach=this._iter("forEach"),this.forEach.apply(this,arguments)},n.prototype.map=function(){return this.map=this._iter("map"),this.map.apply(this,arguments)}},1568:(t,e,r)=>{"use strict";var n=r(9620).EventEmitter,i=r(2591),o=r(6872),a=r(8770).documentArrayParent;function s(t,e,r,n,s){o.isMongooseDocumentArray(e)?(this.__parentArray=e,this[a]=e.$parent()):(this.__parentArray=void 0,this[a]=void 0),this.$setIndex(s),this.$__parent=this[a],i.call(this,t,n,this[a],r,{isNew:!0})}for(var c in s.prototype=Object.create(i.prototype),s.prototype.constructor=s,Object.defineProperty(s.prototype,"$isSingleNested",{configurable:!1,writable:!1,value:!1}),Object.defineProperty(s.prototype,"$isDocumentArrayElement",{configurable:!1,writable:!1,value:!0}),n.prototype)s[c]=n.prototype[c];s.prototype.$setIndex=function(t){if(this.__index=t,null!=this.$__&&null!=this.$__.validationError)for(var e=0,r=Object.keys(this.$__.validationError.errors);e{"use strict";function n(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var i=r(8075),o=r(9261),a=r(8727),s=r(8770).arrayAtomicsSymbol,c=r(8770).arrayAtomicsBackupSymbol,u=r(8770).arrayParentSymbol,f=r(8770).arrayPathSymbol,l=r(8770).arraySchemaSymbol,h=Array.prototype.push,p=/^\d+$/;t.exports=function(t,e,r){var d,y=[],b=(n(d={},s,{}),n(d,c,void 0),n(d,f,e),n(d,l,void 0),n(d,u,void 0),d);if(Array.isArray(t)&&(t[f]===e&&t[u]===r&&(b[s]=Object.assign({},t[s])),t.forEach((function(t){h.call(y,t)}))),b[f]=e,b.__array=y,r&&r instanceof a)for(b[u]=r,b[l]=r.schema.path(e);null!=b[l]&&b[l].$isMongooseArray&&!b[l].$isMongooseDocumentArray;)b[l]=b[l].casterConstructor;var m=new Proxy(y,{get:function(t,e){return"isMongooseArray"===e||"isMongooseArrayProxy"===e||"isMongooseDocumentArray"===e||"isMongooseDocumentArrayProxy"===e||(b.hasOwnProperty(e)?b[e]:o.hasOwnProperty(e)?o[e]:i.hasOwnProperty(e)?i[e]:y[e])},set:function(t,e,r){return"string"==typeof e&&p.test(e)?o.set.call(m,e,r,!1):b.hasOwnProperty(e)?b[e]=r:y[e]=r,!0}});return m}},1255:(t,e)=>{"use strict";e.isMongooseDocumentArray=function(t){return Array.isArray(t)&&t.isMongooseDocumentArray}},9261:(t,e,r)=>{"use strict";var n=r(365).Buffer;function i(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return o(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?o(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,c=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return s=t.done,t},e:function(t){c=!0,a=t},f:function(){try{s||null==r.return||r.return()}finally{if(c)throw a}}}}function o(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r{"use strict";function n(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var i=r(8727),o=r(8075),a=r(8770).arrayAtomicsSymbol,s=r(8770).arrayAtomicsBackupSymbol,c=r(8770).arrayParentSymbol,u=r(8770).arrayPathSymbol,f=r(8770).arraySchemaSymbol,l=Array.prototype.push,h=/^\d+$/;t.exports=function(t,e,r,p){var d,y;if(Array.isArray(t)){var b=t.length;if(0===b)y=new Array;else if(1===b)(y=new Array(1))[0]=t[0];else if(b<1e4)y=new Array,l.apply(y,t);else{y=new Array;for(var m=0;m{"use strict";e.isMongooseArray=function(t){return Array.isArray(t)&&t.isMongooseArray}},8075:(t,e,r)=>{"use strict";var n=r(365).Buffer;function i(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r0&&this._registerAtomic("$set",this),this},push:function(){var t=arguments,e=t,r=null!=t[0]&&f.hasUserDefinedProperty(t[0],"$each"),n=f.isMongooseArray(this)?this.__array:this;if(r&&(e=t[0],t=t[0].$each),null==this[y])return v.apply(this,t);_(this,t);var i,o=this[p];t=[].map.call(t,this._mapCast,this),t=this[y].applySetters(t,o,void 0,void 0,{skipDocumentArrayCast:!0});var a=this[h];if(this._markModified(),r){if(e.$each=t,0!==(a.$push&&a.$push.$each&&a.$push.$each.length||0)&&a.$push.$position!=e.$position)throw new s("Cannot call `Array#push()` multiple times with different `$position`");null!=e.$position?([].splice.apply(n,[e.$position,0].concat(t)),i=this.length):i=[].push.apply(n,t)}else{if(0!==(a.$push&&a.$push.$each&&a.$push.$each.length||0)&&null!=a.$push.$position)throw new s("Cannot call `Array#push()` multiple times with different `$position`");e=t,i=[].push.apply(n,t)}return this._registerAtomic("$push",e),i},remove:function(){return this.pull.apply(this,arguments)},set:function(t,e,r){var n=this.__array;if(r)return n[t]=e,this;var i=g._cast.call(this,e,t);return g._markModified.call(this,t),n[t]=i,this},shift:function(){var t=f.isMongooseArray(this)?this.__array:this;this._markModified();var e=[].shift.call(t);return this._registerAtomic("$set",this),e},sort:function(){var t=f.isMongooseArray(this)?this.__array:this,e=[].sort.apply(t,arguments);return this._registerAtomic("$set",this),e},splice:function(){var t,e=f.isMongooseArray(this)?this.__array:this;if(_(this,Array.prototype.slice.call(arguments,2)),arguments.length){var r;if(null==this[y])r=arguments;else{r=[];for(var n=0;n=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,c=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return s=t.done,t},e:function(t){c=!0,a=t},f:function(){try{s||null==r.return||r.return()}finally{if(c)throw a}}}}(t);try{for(n.s();!(r=n.n()).done;){var a=r.value;if(null==a)return!1;var s=a.constructor;if(!(a instanceof o)||s.modelName!==e&&s.baseModelName!==e)return!1}}catch(t){n.e(t)}finally{n.f()}return!0}(e,s)&&t[p].$populated(t[d],[],(r={},n=b,a=e[0].constructor,n in r?Object.defineProperty(r,n,{value:a,enumerable:!0,configurable:!0,writable:!0}):r[n]=a,r))}for(var w=function(){var t=O[S];if(null==Array.prototype[t])return"continue";g[t]=function(){var e=f.isMongooseArray(this)?this.__array:this,r=[].concat(e);return r[t].apply(r,arguments)}},S=0,O=["filter","flat","flatMap","map","slice"];S{"use strict";var n=r(365).Buffer,i=r(9906).get().Binary,o=r(6872);function a(t,e,r){var i,s,u,f,l=t;return null==t&&(l=0),Array.isArray(e)?(s=e[0],u=e[1]):i=e,f="number"==typeof l||l instanceof Number?n.alloc(l):n.from(l,i,r),o.decorate(f,a.mixin),f.isMongooseBuffer=!0,f[a.pathSymbol]=s,f[c]=u,f._subtype=0,f}var s=Symbol.for("mongoose#Buffer#_path"),c=Symbol.for("mongoose#Buffer#_parent");a.pathSymbol=s,a.mixin={_subtype:void 0,_markModified:function(){var t=this[c];return t&&t.markModified(this[a.pathSymbol]),this},write:function(){var t=n.prototype.write.apply(this,arguments);return t>0&&this._markModified(),t},copy:function(t){var e=n.prototype.copy.apply(this,arguments);return t&&t.isMongooseBuffer&&t._markModified(),e}},"writeUInt8 writeUInt16 writeUInt32 writeInt8 writeInt16 writeInt32 writeFloat writeDouble fill utf8Write binaryWrite asciiWrite set writeUInt16LE writeUInt16BE writeUInt32LE writeUInt32BE writeInt16LE writeInt16BE writeInt32LE writeInt32BE writeFloatLE writeFloatBE writeDoubleLE writeDoubleBE".split(" ").forEach((function(t){n.prototype[t]&&(a.mixin[t]=function(){var e=n.prototype[t].apply(this,arguments);return this._markModified(),e})})),a.mixin.toObject=function(t){var e="number"==typeof t?t:this._subtype||0;return new i(n.from(this),e)},a.mixin.$toObject=a.mixin.toObject,a.mixin.toBSON=function(){return new i(this,this._subtype||0)},a.mixin.equals=function(t){if(!n.isBuffer(t))return!1;if(this.length!==t.length)return!1;for(var e=0;e{"use strict";t.exports=r(9906).get().Decimal128},8941:(t,e,r)=>{"use strict";e.Array=r(1362),e.Buffer=r(4051),e.Document=e.Embedded=r(1568),e.DocumentArray=r(6077),e.Decimal128=r(5003),e.ObjectId=r(6079),e.Map=r(3828),e.Subdocument=r(2591)},3828:(t,e,r)=>{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function i(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return o(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?o(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,c=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return s=t.done,t},e:function(t){c=!0,a=t},f:function(){try{s||null==r.return||r.return()}finally{if(c)throw a}}}}function o(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r{"use strict";var n=r(9906).get().ObjectId,i=r(8770).objectIdSymbol;Object.defineProperty(n.prototype,"_id",{enumerable:!1,configurable:!0,get:function(){return this}}),n.prototype.hasOwnProperty("valueOf")||(n.prototype.valueOf=function(){return this.toString()}),n.prototype[i]=!0,t.exports=n},2591:(t,e,r)=>{"use strict";var n=r(8727),i=r(1490),o=r(4962).h,a=r(8486),s=r(161),c=r(6872);function u(t,e,r,i,o){if(null!=r){var a={isNew:r.isNew};"defaults"in r.$__&&(a.defaults=r.$__.defaults),o=Object.assign(a,o)}null!=o&&null!=o.path&&(this.$basePath=o.path),n.call(this,t,e,i,o),delete this.$__.priorDoc}t.exports=u,u.prototype=Object.create(n.prototype),Object.defineProperty(u.prototype,"$isSubdocument",{configurable:!1,writable:!1,value:!0}),Object.defineProperty(u.prototype,"$isSingleNested",{configurable:!1,writable:!1,value:!0}),u.prototype.toBSON=function(){return this.toObject(o)},u.prototype.save=function(t,e){var r=this;return"function"==typeof t&&(e=t,t={}),(t=t||{}).suppressWarning||c.warn("mongoose: calling `save()` on a subdoc does **not** save the document to MongoDB, it only runs save middleware. Use `subdoc.save({ suppressWarning: true })` to hide this warning if you're sure this behavior is right for your app."),a(e,(function(t){r.$__save(t)}))},u.prototype.$__fullPath=function(t){return this.$__.fullPath||this.ownerDocument(),t?this.$__.fullPath+"."+t:this.$__.fullPath},u.prototype.$__pathRelativeToParent=function(t){return null==t?this.$basePath:[this.$basePath,t].join(".")},u.prototype.$__save=function(t){var e=this;return i((function(){return t(null,e)}))},u.prototype.$isValid=function(t){var e=this.$parent(),r=this.$__pathRelativeToParent(t);return null!=e&&null!=r?e.$isValid(r):n.prototype.$isValid.call(this,t)},u.prototype.markModified=function(t){n.prototype.markModified.call(this,t);var e=this.$parent(),r=this.$__pathRelativeToParent(t);if(null!=e&&null!=r){var i=this.$__pathRelativeToParent().replace(/\.$/,"");e.isDirectModified(i)||this.isNew||this.$__parent.markModified(r,this)}},u.prototype.isModified=function(t,e){var r=this,i=this.$parent();return null!=i?(Array.isArray(t)||"string"==typeof t?t=(t=Array.isArray(t)?t:t.split(" ")).map((function(t){return r.$__pathRelativeToParent(t)})).filter((function(t){return null!=t})):t||(t=this.$__pathRelativeToParent()),i.$isModified(t,e)):n.prototype.isModified.call(this,t,e)},u.prototype.$markValid=function(t){n.prototype.$markValid.call(this,t);var e=this.$parent(),r=this.$__pathRelativeToParent(t);null!=e&&null!=r&&e.$markValid(r)},u.prototype.invalidate=function(t,e,r){n.prototype.invalidate.call(this,t,e,r);var i=this.$parent(),o=this.$__pathRelativeToParent(t);if(null!=i&&null!=o)i.invalidate(o,e,r);else if("cast"===e.kind||"CastError"===e.name||null==o)throw e;return this.ownerDocument().$__.validationError},u.prototype.$ignore=function(t){n.prototype.$ignore.call(this,t);var e=this.$parent(),r=this.$__pathRelativeToParent(t);null!=e&&null!=r&&e.$ignore(r)},u.prototype.ownerDocument=function(){if(this.$__.ownerDocument)return this.$__.ownerDocument;for(var t=this,e=[],r=new Set([t]);"function"==typeof t.$__pathRelativeToParent;){e.unshift(t.$__pathRelativeToParent(void 0,!0));var n=t.$parent();if(null==n)break;if(t=n,r.has(t))throw new Error("Infinite subdocument loop: subdoc with _id "+t._id+" is a parent of itself");r.add(t)}return this.$__.fullPath=e.join("."),this.$__.ownerDocument=t,this.$__.ownerDocument},u.prototype.$__fullPathWithIndexes=function(){for(var t=this,e=[],r=new Set([t]);"function"==typeof t.$__pathRelativeToParent;){e.unshift(t.$__pathRelativeToParent(void 0,!1));var n=t.$parent();if(null==n)break;if(t=n,r.has(t))throw new Error("Infinite subdocument loop: subdoc with _id "+t._id+" is a parent of itself");r.add(t)}return e.join(".")},u.prototype.parent=function(){return this.$__parent},u.prototype.$parent=u.prototype.parent,u.prototype.$__remove=function(t){if(null!=t)return t(null,this)},u.prototype.$__removeFromParent=function(){this.$__parent.set(this.$basePath,null)},u.prototype.remove=function(t,e){return"function"==typeof t&&(e=t,t=null),function(t){var e=t.ownerDocument();function r(){e.$removeListener("save",r),e.$removeListener("remove",r),t.emit("remove",t),t.constructor.emit("remove",t),e=t=null}e.$on("save",r),e.$on("remove",r)}(this),t&&t.noop||this.$__removeFromParent(),this.$__remove(e)},u.prototype.populate=function(){throw new Error('Mongoose does not support calling populate() on nested docs. Instead of `doc.nested.populate("path")`, use `doc.populate("nested.path")`')},u.prototype.inspect=function(){return this.toObject({transform:!1,virtuals:!1,flattenDecimals:!1})},s.inspect.custom&&(u.prototype[s.inspect.custom]=u.prototype.inspect)},6872:(t,e,r)=>{"use strict";var n=r(365).Buffer;function i(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return o(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?o(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,c=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return s=t.done,t},e:function(t){c=!0,a=t},f:function(){try{s||null==r.return||r.return()}finally{if(c)throw a}}}}function o(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r=0;l--)if(c[l]!==u[l])return!1;for(var h=0,p=c;h0)return t[t.length-1]},e.clone=h,e.promiseOrCallback=_,e.cloneArrays=function(t){return Array.isArray(t)?t.map((function(t){return e.cloneArrays(t)})):t},e.omit=function(t,e){if(null==e)return Object.assign({},t);Array.isArray(e)||(e=[e]);var r,n=Object.assign({},t),o=i(e);try{for(o.s();!(r=o.n()).done;)delete n[r.value]}catch(t){o.e(t)}finally{o.f()}return n},e.options=function(t,e){var r,n=Object.keys(t),i=n.length;for(e=e||{};i--;)(r=n[i])in e||(e[r]=t[r]);return e},e.merge=function t(r,n,i,o){i=i||{};var a,s=Object.keys(n),c=0,u=s.length;n[O]&&(r[O]=n[O]),o=o||"";for(var l=i.omitNested||{};c=0&&t<=$:"string"==typeof t&&!!/^\d+$/.test(t)&&(t=+t)>=0&&t<=$},e.array.unique=function(t){var e,r=new Set,n=new Set,o=[],a=i(t);try{for(a.s();!(e=a.n()).done;){var s=e.value;if("number"==typeof s||"string"==typeof s||null==s){if(r.has(s))continue;o.push(s),r.add(s)}else if(m(s,"ObjectID")){if(n.has(s.toString()))continue;o.push(s),n.add(s.toString())}else o.push(s)}}catch(t){a.e(t)}finally{a.f()}return o},e.buffer={},e.buffer.areEqual=function(t,e){if(!n.isBuffer(t))return!1;if(!n.isBuffer(e))return!1;if(t.length!==e.length)return!1;for(var r=0,i=t.length;r{"use strict";function n(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return i(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?i(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,c=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return s=t.done,t},e:function(t){c=!0,a=t},f:function(){try{s||null==r.return||r.return()}finally{if(c)throw a}}}}function i(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r0||this.setters.length>0)){var t="$"+this.path;this.getters.push((function(){return this[t]})),this.setters.push((function(e){this[t]=e}))}},a.prototype.clone=function(){var t=new a(this.options,this.path);return t.getters=[].concat(this.getters),t.setters=[].concat(this.setters),t},a.prototype.get=function(t){return this.getters.push(t),this},a.prototype.set=function(t){return this.setters.push(t),this},a.prototype.applyGetters=function(t,e){o.hasUserDefinedProperty(this.options,["ref","refPath"])&&e.$$populatedVirtuals&&e.$$populatedVirtuals.hasOwnProperty(this.path)&&(t=e.$$populatedVirtuals[this.path]);var r,i=t,a=n(this.getters);try{for(a.s();!(r=a.n()).done;)i=r.value.call(e,i,this,e)}catch(t){a.e(t)}finally{a.f()}return i},a.prototype.applySetters=function(t,e){var r,i=t,o=n(this.setters);try{for(o.s();!(r=o.n()).done;)i=r.value.call(e,i,this,e)}catch(t){o.e(t)}finally{o.f()}return i},t.exports=a},7406:(t,e,r)=>{"use strict";var n=e;n.bignum=r(6781),n.define=r(8721).define,n.base=r(6002),n.constants=r(4319),n.decoders=r(4049),n.encoders=r(6860)},8721:(t,e,r)=>{"use strict";var n=r(6860),i=r(4049),o=r(376);function a(t,e){this.name=t,this.body=e,this.decoders={},this.encoders={}}e.define=function(t,e){return new a(t,e)},a.prototype._createNamed=function(t){var e=this.name;function r(t){this._initNamed(t,e)}return o(r,t),r.prototype._initNamed=function(e,r){t.call(this,e,r)},new r(this)},a.prototype._getDecoder=function(t){return t=t||"der",this.decoders.hasOwnProperty(t)||(this.decoders[t]=this._createNamed(i[t])),this.decoders[t]},a.prototype.decode=function(t,e,r){return this._getDecoder(e).decode(t,r)},a.prototype._getEncoder=function(t){return t=t||"der",this.encoders.hasOwnProperty(t)||(this.encoders[t]=this._createNamed(n[t])),this.encoders[t]},a.prototype.encode=function(t,e,r){return this._getEncoder(e).encode(t,r)}},4989:(t,e,r)=>{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}var i=r(376),o=r(1269).b,a=r(8723).Buffer;function s(t,e){o.call(this,e),a.isBuffer(t)?(this.base=t,this.offset=0,this.length=t.length):this.error("Input not Buffer")}function c(t,e){if(Array.isArray(t))this.length=0,this.value=t.map((function(t){return c.isEncoderBuffer(t)||(t=new c(t,e)),this.length+=t.length,t}),this);else if("number"==typeof t){if(!(0<=t&&t<=255))return e.error("non-byte EncoderBuffer value");this.value=t,this.length=1}else if("string"==typeof t)this.value=t,this.length=a.byteLength(t);else{if(!a.isBuffer(t))return e.error("Unsupported type: "+n(t));this.value=t,this.length=t.length}}i(s,o),e.C=s,s.isDecoderBuffer=function(t){return t instanceof s||"object"===n(t)&&a.isBuffer(t.base)&&"DecoderBuffer"===t.constructor.name&&"number"==typeof t.offset&&"number"==typeof t.length&&"function"==typeof t.save&&"function"==typeof t.restore&&"function"==typeof t.isEmpty&&"function"==typeof t.readUInt8&&"function"==typeof t.skip&&"function"==typeof t.raw},s.prototype.save=function(){return{offset:this.offset,reporter:o.prototype.save.call(this)}},s.prototype.restore=function(t){var e=new s(this.base);return e.offset=t.offset,e.length=this.offset,this.offset=t.offset,o.prototype.restore.call(this,t.reporter),e},s.prototype.isEmpty=function(){return this.offset===this.length},s.prototype.readUInt8=function(t){return this.offset+1<=this.length?this.base.readUInt8(this.offset++,!0):this.error(t||"DecoderBuffer overrun")},s.prototype.skip=function(t,e){if(!(this.offset+t<=this.length))return this.error(e||"DecoderBuffer overrun");var r=new s(this.base);return r._reporterState=this._reporterState,r.offset=this.offset,r.length=this.offset+t,this.offset+=t,r},s.prototype.raw=function(t){return this.base.slice(t?t.offset:this.offset,this.length)},e.R=c,c.isEncoderBuffer=function(t){return t instanceof c||"object"===n(t)&&"EncoderBuffer"===t.constructor.name&&"number"==typeof t.length&&"function"==typeof t.join},c.prototype.join=function(t,e){return t||(t=a.alloc(this.length)),e||(e=0),0===this.length||(Array.isArray(this.value)?this.value.forEach((function(r){r.join(t,e),e+=r.length})):("number"==typeof this.value?t[e]=this.value:"string"==typeof this.value?t.write(this.value,e):a.isBuffer(this.value)&&this.value.copy(t,e),e+=this.length)),t}},6002:(t,e,r)=>{"use strict";var n=e;n.Reporter=r(1269).b,n.DecoderBuffer=r(4989).C,n.EncoderBuffer=r(4989).R,n.Node=r(3304)},3304:(t,e,r)=>{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}var i=r(1269).b,o=r(4989).R,a=r(4989).C,s=r(1130),c=["seq","seqof","set","setof","objid","bool","gentime","utctime","null_","enum","int","objDesc","bitstr","bmpstr","charstr","genstr","graphstr","ia5str","iso646str","numstr","octstr","printstr","t61str","unistr","utf8str","videostr"],u=["key","obj","use","optional","explicit","implicit","def","choice","any","contains"].concat(c);function f(t,e,r){var n={};this._baseState=n,n.name=r,n.enc=t,n.parent=e||null,n.children=null,n.tag=null,n.args=null,n.reverseArgs=null,n.choice=null,n.optional=!1,n.any=!1,n.obj=!1,n.use=null,n.useDecoder=null,n.key=null,n.default=null,n.explicit=null,n.implicit=null,n.contains=null,n.parent||(n.children=[],this._wrap())}t.exports=f;var l=["enc","parent","children","tag","args","reverseArgs","choice","optional","any","obj","use","alteredUse","key","default","explicit","implicit","contains"];f.prototype.clone=function(){var t=this._baseState,e={};l.forEach((function(r){e[r]=t[r]}));var r=new this.constructor(e.parent);return r._baseState=e,r},f.prototype._wrap=function(){var t=this._baseState;u.forEach((function(e){this[e]=function(){var r=new this.constructor(this);return t.children.push(r),r[e].apply(r,arguments)}}),this)},f.prototype._init=function(t){var e=this._baseState;s(null===e.parent),t.call(this),e.children=e.children.filter((function(t){return t._baseState.parent===this}),this),s.equal(e.children.length,1,"Root node can have only one child")},f.prototype._useArgs=function(t){var e=this._baseState,r=t.filter((function(t){return t instanceof this.constructor}),this);t=t.filter((function(t){return!(t instanceof this.constructor)}),this),0!==r.length&&(s(null===e.children),e.children=r,r.forEach((function(t){t._baseState.parent=this}),this)),0!==t.length&&(s(null===e.args),e.args=t,e.reverseArgs=t.map((function(t){if("object"!==n(t)||t.constructor!==Object)return t;var e={};return Object.keys(t).forEach((function(r){r==(0|r)&&(r|=0);var n=t[r];e[n]=r})),e})))},["_peekTag","_decodeTag","_use","_decodeStr","_decodeObjid","_decodeTime","_decodeNull","_decodeInt","_decodeBool","_decodeList","_encodeComposite","_encodeStr","_encodeObjid","_encodeTime","_encodeNull","_encodeInt","_encodeBool"].forEach((function(t){f.prototype[t]=function(){var e=this._baseState;throw new Error(t+" not implemented for encoding: "+e.enc)}})),c.forEach((function(t){f.prototype[t]=function(){var e=this._baseState,r=Array.prototype.slice.call(arguments);return s(null===e.tag),e.tag=t,this._useArgs(r),this}})),f.prototype.use=function(t){s(t);var e=this._baseState;return s(null===e.use),e.use=t,this},f.prototype.optional=function(){return this._baseState.optional=!0,this},f.prototype.def=function(t){var e=this._baseState;return s(null===e.default),e.default=t,e.optional=!0,this},f.prototype.explicit=function(t){var e=this._baseState;return s(null===e.explicit&&null===e.implicit),e.explicit=t,this},f.prototype.implicit=function(t){var e=this._baseState;return s(null===e.explicit&&null===e.implicit),e.implicit=t,this},f.prototype.obj=function(){var t=this._baseState,e=Array.prototype.slice.call(arguments);return t.obj=!0,0!==e.length&&this._useArgs(e),this},f.prototype.key=function(t){var e=this._baseState;return s(null===e.key),e.key=t,this},f.prototype.any=function(){return this._baseState.any=!0,this},f.prototype.choice=function(t){var e=this._baseState;return s(null===e.choice),e.choice=t,this._useArgs(Object.keys(t).map((function(e){return t[e]}))),this},f.prototype.contains=function(t){var e=this._baseState;return s(null===e.use),e.contains=t,this},f.prototype._decode=function(t,e){var r=this._baseState;if(null===r.parent)return t.wrapResult(r.children[0]._decode(t,e));var n,i=r.default,o=!0,s=null;if(null!==r.key&&(s=t.enterKey(r.key)),r.optional){var c=null;if(null!==r.explicit?c=r.explicit:null!==r.implicit?c=r.implicit:null!==r.tag&&(c=r.tag),null!==c||r.any){if(o=this._peekTag(t,c,r.any),t.isError(o))return o}else{var u=t.save();try{null===r.choice?this._decodeGeneric(r.tag,t,e):this._decodeChoice(t,e),o=!0}catch(t){o=!1}t.restore(u)}}if(r.obj&&o&&(n=t.enterObject()),o){if(null!==r.explicit){var f=this._decodeTag(t,r.explicit);if(t.isError(f))return f;t=f}var l=t.offset;if(null===r.use&&null===r.choice){var h;r.any&&(h=t.save());var p=this._decodeTag(t,null!==r.implicit?r.implicit:r.tag,r.any);if(t.isError(p))return p;r.any?i=t.raw(h):t=p}if(e&&e.track&&null!==r.tag&&e.track(t.path(),l,t.length,"tagged"),e&&e.track&&null!==r.tag&&e.track(t.path(),t.offset,t.length,"content"),r.any||(i=null===r.choice?this._decodeGeneric(r.tag,t,e):this._decodeChoice(t,e)),t.isError(i))return i;if(r.any||null!==r.choice||null===r.children||r.children.forEach((function(r){r._decode(t,e)})),r.contains&&("octstr"===r.tag||"bitstr"===r.tag)){var d=new a(i);i=this._getUse(r.contains,t._reporterState.obj)._decode(d,e)}}return r.obj&&o&&(i=t.leaveObject(n)),null===r.key||null===i&&!0!==o?null!==s&&t.exitKey(s):t.leaveKey(s,r.key,i),i},f.prototype._decodeGeneric=function(t,e,r){var n=this._baseState;return"seq"===t||"set"===t?null:"seqof"===t||"setof"===t?this._decodeList(e,t,n.args[0],r):/str$/.test(t)?this._decodeStr(e,t,r):"objid"===t&&n.args?this._decodeObjid(e,n.args[0],n.args[1],r):"objid"===t?this._decodeObjid(e,null,null,r):"gentime"===t||"utctime"===t?this._decodeTime(e,t,r):"null_"===t?this._decodeNull(e,r):"bool"===t?this._decodeBool(e,r):"objDesc"===t?this._decodeStr(e,t,r):"int"===t||"enum"===t?this._decodeInt(e,n.args&&n.args[0],r):null!==n.use?this._getUse(n.use,e._reporterState.obj)._decode(e,r):e.error("unknown tag: "+t)},f.prototype._getUse=function(t,e){var r=this._baseState;return r.useDecoder=this._use(t,e),s(null===r.useDecoder._baseState.parent),r.useDecoder=r.useDecoder._baseState.children[0],r.implicit!==r.useDecoder._baseState.implicit&&(r.useDecoder=r.useDecoder.clone(),r.useDecoder._baseState.implicit=r.implicit),r.useDecoder},f.prototype._decodeChoice=function(t,e){var r=this._baseState,n=null,i=!1;return Object.keys(r.choice).some((function(o){var a=t.save(),s=r.choice[o];try{var c=s._decode(t,e);if(t.isError(c))return!1;n={type:o,value:c},i=!0}catch(e){return t.restore(a),!1}return!0}),this),i?n:t.error("Choice not matched")},f.prototype._createEncoderBuffer=function(t){return new o(t,this.reporter)},f.prototype._encode=function(t,e,r){var n=this._baseState;if(null===n.default||n.default!==t){var i=this._encodeValue(t,e,r);if(void 0!==i&&!this._skipDefault(i,e,r))return i}},f.prototype._encodeValue=function(t,e,r){var o=this._baseState;if(null===o.parent)return o.children[0]._encode(t,e||new i);var a=null;if(this.reporter=e,o.optional&&void 0===t){if(null===o.default)return;t=o.default}var s=null,c=!1;if(o.any)a=this._createEncoderBuffer(t);else if(o.choice)a=this._encodeChoice(t,e);else if(o.contains)s=this._getUse(o.contains,r)._encode(t,e),c=!0;else if(o.children)s=o.children.map((function(r){if("null_"===r._baseState.tag)return r._encode(null,e,t);if(null===r._baseState.key)return e.error("Child should have a key");var i=e.enterKey(r._baseState.key);if("object"!==n(t))return e.error("Child expected, but input is not object");var o=r._encode(t[r._baseState.key],e,t);return e.leaveKey(i),o}),this).filter((function(t){return t})),s=this._createEncoderBuffer(s);else if("seqof"===o.tag||"setof"===o.tag){if(!o.args||1!==o.args.length)return e.error("Too many args for : "+o.tag);if(!Array.isArray(t))return e.error("seqof/setof, but data is not Array");var u=this.clone();u._baseState.implicit=null,s=this._createEncoderBuffer(t.map((function(r){var n=this._baseState;return this._getUse(n.args[0],t)._encode(r,e)}),u))}else null!==o.use?a=this._getUse(o.use,r)._encode(t,e):(s=this._encodePrimitive(o.tag,t),c=!0);if(!o.any&&null===o.choice){var f=null!==o.implicit?o.implicit:o.tag,l=null===o.implicit?"universal":"context";null===f?null===o.use&&e.error("Tag could be omitted only for .use()"):null===o.use&&(a=this._encodeComposite(f,c,l,s))}return null!==o.explicit&&(a=this._encodeComposite(o.explicit,!1,"context",a)),a},f.prototype._encodeChoice=function(t,e){var r=this._baseState,n=r.choice[t.type];return n||s(!1,t.type+" not found in "+JSON.stringify(Object.keys(r.choice))),n._encode(t.value,e)},f.prototype._encodePrimitive=function(t,e){var r=this._baseState;if(/str$/.test(t))return this._encodeStr(e,t);if("objid"===t&&r.args)return this._encodeObjid(e,r.reverseArgs[0],r.args[1]);if("objid"===t)return this._encodeObjid(e,null,null);if("gentime"===t||"utctime"===t)return this._encodeTime(e,t);if("null_"===t)return this._encodeNull();if("int"===t||"enum"===t)return this._encodeInt(e,r.args&&r.reverseArgs[0]);if("bool"===t)return this._encodeBool(e);if("objDesc"===t)return this._encodeStr(e,t);throw new Error("Unsupported tag: "+t)},f.prototype._isNumstr=function(t){return/^[0-9 ]*$/.test(t)},f.prototype._isPrintstr=function(t){return/^[A-Za-z0-9 '()+,-./:=?]*$/.test(t)}},1269:(t,e,r)=>{"use strict";var n=r(376);function i(t){this._reporterState={obj:null,path:[],options:t||{},errors:[]}}function o(t,e){this.path=t,this.rethrow(e)}e.b=i,i.prototype.isError=function(t){return t instanceof o},i.prototype.save=function(){var t=this._reporterState;return{obj:t.obj,pathLen:t.path.length}},i.prototype.restore=function(t){var e=this._reporterState;e.obj=t.obj,e.path=e.path.slice(0,t.pathLen)},i.prototype.enterKey=function(t){return this._reporterState.path.push(t)},i.prototype.exitKey=function(t){var e=this._reporterState;e.path=e.path.slice(0,t-1)},i.prototype.leaveKey=function(t,e,r){var n=this._reporterState;this.exitKey(t),null!==n.obj&&(n.obj[e]=r)},i.prototype.path=function(){return this._reporterState.path.join("/")},i.prototype.enterObject=function(){var t=this._reporterState,e=t.obj;return t.obj={},e},i.prototype.leaveObject=function(t){var e=this._reporterState,r=e.obj;return e.obj=t,r},i.prototype.error=function(t){var e,r=this._reporterState,n=t instanceof o;if(e=n?t:new o(r.path.map((function(t){return"["+JSON.stringify(t)+"]"})).join(""),t.message||t,t.stack),!r.options.partial)throw e;return n||r.errors.push(e),e},i.prototype.wrapResult=function(t){var e=this._reporterState;return e.options.partial?{result:this.isError(t)?null:t,errors:e.errors}:t},n(o,Error),o.prototype.rethrow=function(t){if(this.message=t+" at: "+(this.path||"(shallow)"),Error.captureStackTrace&&Error.captureStackTrace(this,o),!this.stack)try{throw new Error(this.message)}catch(t){this.stack=t.stack}return this}},2007:(t,e)=>{"use strict";function r(t){var e={};return Object.keys(t).forEach((function(r){(0|r)==r&&(r|=0);var n=t[r];e[n]=r})),e}e.tagClass={0:"universal",1:"application",2:"context",3:"private"},e.tagClassByName=r(e.tagClass),e.tag={0:"end",1:"bool",2:"int",3:"bitstr",4:"octstr",5:"null_",6:"objid",7:"objDesc",8:"external",9:"real",10:"enum",11:"embed",12:"utf8str",13:"relativeOid",16:"seq",17:"set",18:"numstr",19:"printstr",20:"t61str",21:"videostr",22:"ia5str",23:"utctime",24:"gentime",25:"graphstr",26:"iso646str",27:"genstr",28:"unistr",29:"charstr",30:"bmpstr"},e.tagByName=r(e.tag)},4319:(t,e,r)=>{"use strict";var n=e;n._reverse=function(t){var e={};return Object.keys(t).forEach((function(r){(0|r)==r&&(r|=0);var n=t[r];e[n]=r})),e},n.der=r(2007)},4201:(t,e,r)=>{"use strict";var n=r(376),i=r(6781),o=r(4989).C,a=r(3304),s=r(2007);function c(t){this.enc="der",this.name=t.name,this.entity=t,this.tree=new u,this.tree._init(t.body)}function u(t){a.call(this,"der",t)}function f(t,e){var r=t.readUInt8(e);if(t.isError(r))return r;var n=s.tagClass[r>>6],i=0==(32&r);if(31==(31&r)){var o=r;for(r=0;128==(128&o);){if(o=t.readUInt8(e),t.isError(o))return o;r<<=7,r|=127&o}}else r&=31;return{cls:n,primitive:i,tag:r,tagStr:s.tag[r]}}function l(t,e,r){var n=t.readUInt8(r);if(t.isError(n))return n;if(!e&&128===n)return null;if(0==(128&n))return n;var i=127&n;if(i>4)return t.error("length octect is too long");n=0;for(var o=0;o{"use strict";var n=e;n.der=r(4201),n.pem=r(618)},618:(t,e,r)=>{"use strict";var n=r(376),i=r(8723).Buffer,o=r(4201);function a(t){o.call(this,t),this.enc="pem"}n(a,o),t.exports=a,a.prototype.decode=function(t,e){for(var r=t.toString().split(/[\r\n]+/g),n=e.label.toUpperCase(),a=/^-----(BEGIN|END) ([^-]+)-----$/,s=-1,c=-1,u=0;u{"use strict";var n=r(376),i=r(8723).Buffer,o=r(3304),a=r(2007);function s(t){this.enc="der",this.name=t.name,this.entity=t,this.tree=new c,this.tree._init(t.body)}function c(t){o.call(this,"der",t)}function u(t){return t<10?"0"+t:t}t.exports=s,s.prototype.encode=function(t,e){return this.tree._encode(t,e).join()},n(c,o),c.prototype._encodeComposite=function(t,e,r,n){var o=function(t,e,r,n){var i;if("seqof"===t?t="seq":"setof"===t&&(t="set"),a.tagByName.hasOwnProperty(t))i=a.tagByName[t];else{if("number"!=typeof t||(0|t)!==t)return n.error("Unknown tag: "+t);i=t}return i>=31?n.error("Multi-octet tag encoding unsupported"):(e||(i|=32),i|a.tagClassByName[r||"universal"]<<6)}(t,e,r,this.reporter);if(n.length<128){var s=i.alloc(2);return s[0]=o,s[1]=n.length,this._createEncoderBuffer([s,n])}for(var c=1,u=n.length;u>=256;u>>=8)c++;var f=i.alloc(2+c);f[0]=o,f[1]=128|c;for(var l=1+c,h=n.length;h>0;l--,h>>=8)f[l]=255&h;return this._createEncoderBuffer([f,n])},c.prototype._encodeStr=function(t,e){if("bitstr"===e)return this._createEncoderBuffer([0|t.unused,t.data]);if("bmpstr"===e){for(var r=i.alloc(2*t.length),n=0;n=40)return this.reporter.error("Second objid identifier OOB");t.splice(0,2,40*t[0]+t[1])}for(var a=0,s=0;s=128;c>>=7)a++}for(var u=i.alloc(a),f=u.length-1,l=t.length-1;l>=0;l--){var h=t[l];for(u[f--]=127&h;(h>>=7)>0;)u[f--]=128|127&h}return this._createEncoderBuffer(u)},c.prototype._encodeTime=function(t,e){var r,n=new Date(t);return"gentime"===e?r=[u(n.getUTCFullYear()),u(n.getUTCMonth()+1),u(n.getUTCDate()),u(n.getUTCHours()),u(n.getUTCMinutes()),u(n.getUTCSeconds()),"Z"].join(""):"utctime"===e?r=[u(n.getUTCFullYear()%100),u(n.getUTCMonth()+1),u(n.getUTCDate()),u(n.getUTCHours()),u(n.getUTCMinutes()),u(n.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+e+" time is not supported yet"),this._encodeStr(r,"octstr")},c.prototype._encodeNull=function(){return this._createEncoderBuffer("")},c.prototype._encodeInt=function(t,e){if("string"==typeof t){if(!e)return this.reporter.error("String int or enum given, but no values map");if(!e.hasOwnProperty(t))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(t));t=e[t]}if("number"!=typeof t&&!i.isBuffer(t)){var r=t.toArray();!t.sign&&128&r[0]&&r.unshift(0),t=i.from(r)}if(i.isBuffer(t)){var n=t.length;0===t.length&&n++;var o=i.alloc(n);return t.copy(o),0===t.length&&(o[0]=0),this._createEncoderBuffer(o)}if(t<128)return this._createEncoderBuffer(t);if(t<256)return this._createEncoderBuffer([0,t]);for(var a=1,s=t;s>=256;s>>=8)a++;for(var c=new Array(a),u=c.length-1;u>=0;u--)c[u]=255&t,t>>=8;return 128&c[0]&&c.unshift(0),this._createEncoderBuffer(i.from(c))},c.prototype._encodeBool=function(t){return this._createEncoderBuffer(t?255:0)},c.prototype._use=function(t,e){return"function"==typeof t&&(t=t(e)),t._getEncoder("der").tree},c.prototype._skipDefault=function(t,e,r){var n,i=this._baseState;if(null===i.default)return!1;var o=t.join();if(void 0===i.defaultBuffer&&(i.defaultBuffer=this._encodeValue(i.default,e,r).join()),o.length!==i.defaultBuffer.length)return!1;for(n=0;n{"use strict";var n=e;n.der=r(1889),n.pem=r(1610)},1610:(t,e,r)=>{"use strict";var n=r(376),i=r(1889);function o(t){i.call(this,t),this.enc="pem"}n(o,i),t.exports=o,o.prototype.encode=function(t,e){for(var r=i.prototype.encode.call(this,t).toString("base64"),n=["-----BEGIN "+e.label+"-----"],o=0;o{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function i(t){return i="function"==typeof Symbol&&"symbol"===n(Symbol.iterator)?function(t){return n(t)}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":n(t)},i(t)}var o,a,s=r(9978).codes,c=s.ERR_AMBIGUOUS_ARGUMENT,u=s.ERR_INVALID_ARG_TYPE,f=s.ERR_INVALID_ARG_VALUE,l=s.ERR_INVALID_RETURN_VALUE,h=s.ERR_MISSING_ARGS,p=r(1935),d=r(161).inspect,y=r(161).types,b=y.isPromise,m=y.isRegExp,v=Object.assign?Object.assign:r(8028).assign,g=Object.is?Object.is:r(4710);function _(){var t=r(9015);o=t.isDeepEqual,a=t.isDeepStrictEqual}new Map;var w=!1,S=t.exports=j,O={};function A(t){if(t.message instanceof Error)throw t.message;throw new p(t)}function E(t,e,r,n){if(!r){var i=!1;if(0===e)i=!0,n="No value argument passed to `assert.ok()`";else if(n instanceof Error)throw n;var o=new p({actual:r,expected:!0,message:n,operator:"==",stackStartFn:t});throw o.generatedMessage=i,o}}function j(){for(var t=arguments.length,e=new Array(t),r=0;r1?r-1:0),i=1;i1?r-1:0),i=1;i1?r-1:0),i=1;i1?r-1:0),i=1;i{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function i(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function o(t,e){for(var r=0;rt.length)&&(r=t.length),t.substring(r-e.length,r)===e}var m="",v="",g="",_="",w={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"};function S(t){var e=Object.keys(t),r=Object.create(Object.getPrototypeOf(t));return e.forEach((function(e){r[e]=t[e]})),Object.defineProperty(r,"message",{value:t.message}),r}function O(t){return d(t,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}var A=function(t){function e(t){var r;if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),"object"!==p(t)||null===t)throw new y("options","Object",t);var n=t.message,i=t.operator,o=t.stackStartFn,c=t.actual,u=t.expected,f=Error.stackTraceLimit;if(Error.stackTraceLimit=0,null!=n)r=a(this,h(e).call(this,String(n)));else if({env:{}}.stderr&&{env:{}}.stderr.isTTY&&({env:{}}.stderr&&{env:{}}.stderr.getColorDepth&&1!=={env:{}}.stderr.getColorDepth()?(m="",v="",_="",g=""):(m="",v="",_="",g="")),"object"===p(c)&&null!==c&&"object"===p(u)&&null!==u&&"stack"in c&&c instanceof Error&&"stack"in u&&u instanceof Error&&(c=S(c),u=S(u)),"deepStrictEqual"===i||"strictEqual"===i)r=a(this,h(e).call(this,function(t,e,r){var n="",i="",o=0,a="",s=!1,c=O(t),u=c.split("\n"),f=O(e).split("\n"),l=0,h="";if("strictEqual"===r&&"object"===p(t)&&"object"===p(e)&&null!==t&&null!==e&&(r="strictEqualObject"),1===u.length&&1===f.length&&u[0]!==f[0]){var d=u[0].length+f[0].length;if(d<=10){if(!("object"===p(t)&&null!==t||"object"===p(e)&&null!==e||0===t&&0===e))return"".concat(w[r],"\n\n")+"".concat(u[0]," !== ").concat(f[0],"\n")}else if("strictEqualObject"!==r&&d<({env:{}}.stderr&&{env:{}}.stderr.isTTY?{env:{}}.stderr.columns:80)){for(;u[0][l]===f[0][l];)l++;l>2&&(h="\n ".concat(function(t,e){if(e=Math.floor(e),0==t.length||0==e)return"";var r=t.length*e;for(e=Math.floor(Math.log(e)/Math.log(2));e;)t+=t,e--;return t+t.substring(0,r-t.length)}(" ",l),"^"),l=0)}}for(var y=u[u.length-1],S=f[f.length-1];y===S&&(l++<2?a="\n ".concat(y).concat(a):n=y,u.pop(),f.pop(),0!==u.length&&0!==f.length);)y=u[u.length-1],S=f[f.length-1];var A=Math.max(u.length,f.length);if(0===A){var E=c.split("\n");if(E.length>30)for(E[26]="".concat(m,"...").concat(_);E.length>27;)E.pop();return"".concat(w.notIdentical,"\n\n").concat(E.join("\n"),"\n")}l>3&&(a="\n".concat(m,"...").concat(_).concat(a),s=!0),""!==n&&(a="\n ".concat(n).concat(a),n="");var j=0,$=w[r]+"\n".concat(v,"+ actual").concat(_," ").concat(g,"- expected").concat(_),x=" ".concat(m,"...").concat(_," Lines skipped");for(l=0;l1&&l>2&&(P>4?(i+="\n".concat(m,"...").concat(_),s=!0):P>3&&(i+="\n ".concat(f[l-2]),j++),i+="\n ".concat(f[l-1]),j++),o=l,n+="\n".concat(g,"-").concat(_," ").concat(f[l]),j++;else if(f.length1&&l>2&&(P>4?(i+="\n".concat(m,"...").concat(_),s=!0):P>3&&(i+="\n ".concat(u[l-2]),j++),i+="\n ".concat(u[l-1]),j++),o=l,i+="\n".concat(v,"+").concat(_," ").concat(u[l]),j++;else{var k=f[l],M=u[l],R=M!==k&&(!b(M,",")||M.slice(0,-1)!==k);R&&b(k,",")&&k.slice(0,-1)===M&&(R=!1,M+=","),R?(P>1&&l>2&&(P>4?(i+="\n".concat(m,"...").concat(_),s=!0):P>3&&(i+="\n ".concat(u[l-2]),j++),i+="\n ".concat(u[l-1]),j++),o=l,i+="\n".concat(v,"+").concat(_," ").concat(M),n+="\n".concat(g,"-").concat(_," ").concat(k),j+=2):(i+=n,n="",1!==P&&0!==l||(i+="\n ".concat(M),j++))}if(j>20&&l30)for(d[26]="".concat(m,"...").concat(_);d.length>27;)d.pop();r=1===d.length?a(this,h(e).call(this,"".concat(l," ").concat(d[0]))):a(this,h(e).call(this,"".concat(l,"\n\n").concat(d.join("\n"),"\n")))}else{var A=O(c),E="",j=w[i];"notDeepEqual"===i||"notEqual"===i?(A="".concat(w[i],"\n\n").concat(A)).length>1024&&(A="".concat(A.slice(0,1021),"...")):(E="".concat(O(u)),A.length>512&&(A="".concat(A.slice(0,509),"...")),E.length>512&&(E="".concat(E.slice(0,509),"...")),"deepEqual"===i||"equal"===i?A="".concat(j,"\n\n").concat(A,"\n\nshould equal\n\n"):E=" ".concat(i," ").concat(E)),r=a(this,h(e).call(this,"".concat(A).concat(E)))}return Error.stackTraceLimit=f,r.generatedMessage=!n,Object.defineProperty(s(r),"name",{value:"AssertionError [ERR_ASSERTION]",enumerable:!1,writable:!0,configurable:!0}),r.code="ERR_ASSERTION",r.actual=c,r.expected=u,r.operator=i,Error.captureStackTrace&&Error.captureStackTrace(s(r),o),r.stack,r.name="AssertionError",a(r)}var r,n;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&l(t,e)}(e,t),r=e,n=[{key:"toString",value:function(){return"".concat(this.name," [").concat(this.code,"]: ").concat(this.message)}},{key:d.custom,value:function(t,e){return d(this,function(t){for(var e=1;e{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function i(t){return i="function"==typeof Symbol&&"symbol"===n(Symbol.iterator)?function(t){return n(t)}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":n(t)},i(t)}function o(t){return o=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},o(t)}function a(t,e){return a=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},a(t,e)}var s,c,u={};function f(t,e,r){r||(r=Error);var n=function(r){function n(r,a,s){var c;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,n),c=function(t,e){return!e||"object"!==i(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}(this,o(n).call(this,function(t,r,n){return"string"==typeof e?e:e(t,r,n)}(r,a,s))),c.code=t,c}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&a(t,e)}(n,r),n}(r);u[t]=n}function l(t,e){if(Array.isArray(t)){var r=t.length;return t=t.map((function(t){return String(t)})),r>2?"one of ".concat(e," ").concat(t.slice(0,r-1).join(", "),", or ")+t[r-1]:2===r?"one of ".concat(e," ").concat(t[0]," or ").concat(t[1]):"of ".concat(e," ").concat(t[0])}return"of ".concat(e," ").concat(String(t))}f("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),f("ERR_INVALID_ARG_TYPE",(function(t,e,n){var o,a,c,u,f;if(void 0===s&&(s=r(9373)),s("string"==typeof t,"'name' must be a string"),"string"==typeof e&&(a="not ",e.substr(0,a.length)===a)?(o="must not be",e=e.replace(/^not /,"")):o="must be",function(t,e,r){return(void 0===r||r>t.length)&&(r=t.length),t.substring(r-e.length,r)===e}(t," argument"))c="The ".concat(t," ").concat(o," ").concat(l(e,"type"));else{var h=("number"!=typeof f&&(f=0),f+".".length>(u=t).length||-1===u.indexOf(".",f)?"argument":"property");c='The "'.concat(t,'" ').concat(h," ").concat(o," ").concat(l(e,"type"))}return c+". Received type ".concat(i(n))}),TypeError),f("ERR_INVALID_ARG_VALUE",(function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"is invalid";void 0===c&&(c=r(161));var i=c.inspect(e);return i.length>128&&(i="".concat(i.slice(0,128),"...")),"The argument '".concat(t,"' ").concat(n,". Received ").concat(i)}),TypeError,RangeError),f("ERR_INVALID_RETURN_VALUE",(function(t,e,r){var n;return n=r&&r.constructor&&r.constructor.name?"instance of ".concat(r.constructor.name):"type ".concat(i(r)),"Expected ".concat(t,' to be returned from the "').concat(e,'"')+" function but got ".concat(n,".")}),TypeError),f("ERR_MISSING_ARGS",(function(){for(var t=arguments.length,e=new Array(t),n=0;n0,"At least one arg needs to be specified");var i="The ",o=e.length;switch(e=e.map((function(t){return'"'.concat(t,'"')})),o){case 1:i+="".concat(e[0]," argument");break;case 2:i+="".concat(e[0]," and ").concat(e[1]," arguments");break;default:i+=e.slice(0,o-1).join(", "),i+=", and ".concat(e[o-1]," arguments")}return"".concat(i," must be specified")}),TypeError),t.exports.codes=u},9015:(t,e,r)=>{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function i(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=[],n=!0,i=!1,o=void 0;try{for(var a,s=t[Symbol.iterator]();!(n=(a=s.next()).done)&&(r.push(a.value),!e||r.length!==e);n=!0);}catch(t){i=!0,o=t}finally{try{n||null==s.return||s.return()}finally{if(i)throw o}}return r}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function o(t){return o="function"==typeof Symbol&&"symbol"===n(Symbol.iterator)?function(t){return n(t)}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":n(t)},o(t)}var a=void 0!==/a/g.flags,s=function(t){var e=[];return t.forEach((function(t){return e.push(t)})),e},c=function(t){var e=[];return t.forEach((function(t,r){return e.push([r,t])})),e},u=Object.is?Object.is:r(4710),f=Object.getOwnPropertySymbols?Object.getOwnPropertySymbols:function(){return[]},l=Number.isNaN?Number.isNaN:r(2191);function h(t){return t.call.bind(t)}var p=h(Object.prototype.hasOwnProperty),d=h(Object.prototype.propertyIsEnumerable),y=h(Object.prototype.toString),b=r(161).types,m=b.isAnyArrayBuffer,v=b.isArrayBufferView,g=b.isDate,_=b.isMap,w=b.isRegExp,S=b.isSet,O=b.isNativeError,A=b.isBoxedPrimitive,E=b.isNumberObject,j=b.isStringObject,$=b.isBooleanObject,x=b.isBigIntObject,P=b.isSymbolObject,k=b.isFloat32Array,M=b.isFloat64Array;function R(t){if(0===t.length||t.length>10)return!0;for(var e=0;e57)return!0}return 10===t.length&&t>=Math.pow(2,32)}function I(t){return Object.keys(t).filter(R).concat(f(t).filter(Object.prototype.propertyIsEnumerable.bind(t)))}function B(t,e){if(t===e)return 0;for(var r=t.length,n=e.length,i=0,o=Math.min(r,n);i{"use strict";e.byteLength=function(t){var e=c(t),r=e[0],n=e[1];return 3*(r+n)/4-n},e.toByteArray=function(t){var e,r,o=c(t),a=o[0],s=o[1],u=new i(function(t,e,r){return 3*(e+r)/4-r}(0,a,s)),f=0,l=s>0?a-4:a;for(r=0;r>16&255,u[f++]=e>>8&255,u[f++]=255&e;return 2===s&&(e=n[t.charCodeAt(r)]<<2|n[t.charCodeAt(r+1)]>>4,u[f++]=255&e),1===s&&(e=n[t.charCodeAt(r)]<<10|n[t.charCodeAt(r+1)]<<4|n[t.charCodeAt(r+2)]>>2,u[f++]=e>>8&255,u[f++]=255&e),u},e.fromByteArray=function(t){for(var e,n=t.length,i=n%3,o=[],a=16383,s=0,c=n-i;sc?c:s+a));return 1===i?(e=t[n-1],o.push(r[e>>2]+r[e<<4&63]+"==")):2===i&&(e=(t[n-2]<<8)+t[n-1],o.push(r[e>>10]+r[e>>4&63]+r[e<<2&63]+"=")),o.join("")};for(var r=[],n=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,s=o.length;a0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function u(t,e,n){for(var i,o,a=[],s=e;s>18&63]+r[o>>12&63]+r[o>>6&63]+r[63&o]);return a.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},6781:function(t,e,r){function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}!function(t,e){"use strict";function i(t,e){if(!t)throw new Error(e||"Assertion failed")}function o(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function a(t,e,r){if(a.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(r=e,e=10),this._init(t||0,e||10,r||"be"))}var s;"object"===n(t)?t.exports=a:e.BN=a,a.BN=a,a.wordSize=26;try{s="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:r(6601).Buffer}catch(t){}function c(t,e){var r=t.charCodeAt(e);return r>=48&&r<=57?r-48:r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:void i(!1,"Invalid character in "+t)}function u(t,e,r){var n=c(t,r);return r-1>=e&&(n|=c(t,r-1)<<4),n}function f(t,e,r,n){for(var o=0,a=0,s=Math.min(t.length,r),c=e;c=49?u-49+10:u>=17?u-17+10:u,i(u>=0&&a0?t:e},a.min=function(t,e){return t.cmp(e)<0?t:e},a.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"===n(t))return this._initArray(t,e,r);"hex"===e&&(e=16),i(e===(0|e)&&e>=2&&e<=36);var o=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&(o++,this.negative=1),o=0;n-=3)a=t[n]|t[n-1]<<8|t[n-2]<<16,this.words[o]|=a<>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);else if("le"===r)for(n=0,o=0;n>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);return this._strip()},a.prototype._parseHex=function(t,e,r){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var n=0;n=e;n-=2)i=u(t,e,n)<=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;else for(n=(t.length-e)%2==0?e+1:e;n=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;this._strip()},a.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=e)n++;n--,i=i/e|0;for(var o=t.length-r,a=o%n,s=Math.min(o,o-a)+r,c=0,u=r;u1&&0===this.words[this.length-1];)this.length--;return this._normSign()},a.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{a.prototype[Symbol.for("nodejs.util.inspect.custom")]=h}catch(t){a.prototype.inspect=h}else a.prototype.inspect=h;function h(){return(this.red?""}var p=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],d=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],y=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function b(t,e,r){r.negative=e.negative^t.negative;var n=t.length+e.length|0;r.length=n,n=n-1|0;var i=0|t.words[0],o=0|e.words[0],a=i*o,s=67108863&a,c=a/67108864|0;r.words[0]=s;for(var u=1;u>>26,l=67108863&c,h=Math.min(u,e.length-1),p=Math.max(0,u-t.length+1);p<=h;p++){var d=u-p|0;f+=(a=(i=0|t.words[d])*(o=0|e.words[p])+l)/67108864|0,l=67108863&a}r.words[u]=0|l,c=0|f}return 0!==c?r.words[u]=0|c:r.length--,r._strip()}a.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var n=0,o=0,a=0;a>>24-n&16777215,(n+=2)>=26&&(n-=26,a--),r=0!==o||a!==this.length-1?p[6-c.length]+c+r:c+r}for(0!==o&&(r=o.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var u=d[t],f=y[t];r="";var l=this.clone();for(l.negative=0;!l.isZero();){var h=l.modrn(f).toString(t);r=(l=l.idivn(f)).isZero()?h+r:p[u-h.length]+h+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}i(!1,"Base should be between 2 and 36")},a.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},a.prototype.toJSON=function(){return this.toString(16,2)},s&&(a.prototype.toBuffer=function(t,e){return this.toArrayLike(s,t,e)}),a.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},a.prototype.toArrayLike=function(t,e,r){this._strip();var n=this.byteLength(),o=r||Math.max(1,n);i(n<=o,"byte array longer than desired length"),i(o>0,"Requested array length <= 0");var a=function(t,e){return t.allocUnsafe?t.allocUnsafe(e):new t(e)}(t,o);return this["_toArrayLike"+("le"===e?"LE":"BE")](a,n),a},a.prototype._toArrayLikeLE=function(t,e){for(var r=0,n=0,i=0,o=0;i>8&255),r>16&255),6===o?(r>24&255),n=0,o=0):(n=a>>>24,o+=2)}if(r=0&&(t[r--]=a>>8&255),r>=0&&(t[r--]=a>>16&255),6===o?(r>=0&&(t[r--]=a>>24&255),n=0,o=0):(n=a>>>24,o+=2)}if(r>=0)for(t[r--]=n;r>=0;)t[r--]=0},Math.clz32?a.prototype._countBits=function(t){return 32-Math.clz32(t)}:a.prototype._countBits=function(t){var e=t,r=0;return e>=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},a.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0==(8191&e)&&(r+=13,e>>>=13),0==(127&e)&&(r+=7,e>>>=7),0==(15&e)&&(r+=4,e>>>=4),0==(3&e)&&(r+=2,e>>>=2),0==(1&e)&&r++,r},a.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},a.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},a.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},a.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;rt.length?this.clone().iand(t):t.clone().iand(this)},a.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},a.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var n=0;nt.length?this.clone().ixor(t):t.clone().ixor(this)},a.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},a.prototype.inotn=function(t){i("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var n=0;n0&&(this.words[n]=~this.words[n]&67108863>>26-r),this._strip()},a.prototype.notn=function(t){return this.clone().inotn(t)},a.prototype.setn=function(t,e){i("number"==typeof t&&t>=0);var r=t/26|0,n=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<t.length?(r=this,n=t):(r=t,n=this);for(var i=0,o=0;o>>26;for(;0!==i&&o>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;ot.length?this.clone().iadd(t):t.clone().iadd(this)},a.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,n,i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=t):(r=t,n=this);for(var o=0,a=0;a>26,this.words[a]=67108863&e;for(;0!==o&&a>26,this.words[a]=67108863&e;if(0===o&&a>>13,p=0|a[1],d=8191&p,y=p>>>13,b=0|a[2],m=8191&b,v=b>>>13,g=0|a[3],_=8191&g,w=g>>>13,S=0|a[4],O=8191&S,A=S>>>13,E=0|a[5],j=8191&E,$=E>>>13,x=0|a[6],P=8191&x,k=x>>>13,M=0|a[7],R=8191&M,I=M>>>13,B=0|a[8],T=8191&B,N=B>>>13,D=0|a[9],C=8191&D,U=D>>>13,L=0|s[0],q=8191&L,F=L>>>13,V=0|s[1],z=8191&V,K=V>>>13,W=0|s[2],H=8191&W,J=W>>>13,G=0|s[3],Y=8191&G,Q=G>>>13,X=0|s[4],Z=8191&X,tt=X>>>13,et=0|s[5],rt=8191&et,nt=et>>>13,it=0|s[6],ot=8191&it,at=it>>>13,st=0|s[7],ct=8191&st,ut=st>>>13,ft=0|s[8],lt=8191&ft,ht=ft>>>13,pt=0|s[9],dt=8191&pt,yt=pt>>>13;r.negative=t.negative^e.negative,r.length=19;var bt=(u+(n=Math.imul(l,q))|0)+((8191&(i=(i=Math.imul(l,F))+Math.imul(h,q)|0))<<13)|0;u=((o=Math.imul(h,F))+(i>>>13)|0)+(bt>>>26)|0,bt&=67108863,n=Math.imul(d,q),i=(i=Math.imul(d,F))+Math.imul(y,q)|0,o=Math.imul(y,F);var mt=(u+(n=n+Math.imul(l,z)|0)|0)+((8191&(i=(i=i+Math.imul(l,K)|0)+Math.imul(h,z)|0))<<13)|0;u=((o=o+Math.imul(h,K)|0)+(i>>>13)|0)+(mt>>>26)|0,mt&=67108863,n=Math.imul(m,q),i=(i=Math.imul(m,F))+Math.imul(v,q)|0,o=Math.imul(v,F),n=n+Math.imul(d,z)|0,i=(i=i+Math.imul(d,K)|0)+Math.imul(y,z)|0,o=o+Math.imul(y,K)|0;var vt=(u+(n=n+Math.imul(l,H)|0)|0)+((8191&(i=(i=i+Math.imul(l,J)|0)+Math.imul(h,H)|0))<<13)|0;u=((o=o+Math.imul(h,J)|0)+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(_,q),i=(i=Math.imul(_,F))+Math.imul(w,q)|0,o=Math.imul(w,F),n=n+Math.imul(m,z)|0,i=(i=i+Math.imul(m,K)|0)+Math.imul(v,z)|0,o=o+Math.imul(v,K)|0,n=n+Math.imul(d,H)|0,i=(i=i+Math.imul(d,J)|0)+Math.imul(y,H)|0,o=o+Math.imul(y,J)|0;var gt=(u+(n=n+Math.imul(l,Y)|0)|0)+((8191&(i=(i=i+Math.imul(l,Q)|0)+Math.imul(h,Y)|0))<<13)|0;u=((o=o+Math.imul(h,Q)|0)+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,n=Math.imul(O,q),i=(i=Math.imul(O,F))+Math.imul(A,q)|0,o=Math.imul(A,F),n=n+Math.imul(_,z)|0,i=(i=i+Math.imul(_,K)|0)+Math.imul(w,z)|0,o=o+Math.imul(w,K)|0,n=n+Math.imul(m,H)|0,i=(i=i+Math.imul(m,J)|0)+Math.imul(v,H)|0,o=o+Math.imul(v,J)|0,n=n+Math.imul(d,Y)|0,i=(i=i+Math.imul(d,Q)|0)+Math.imul(y,Y)|0,o=o+Math.imul(y,Q)|0;var _t=(u+(n=n+Math.imul(l,Z)|0)|0)+((8191&(i=(i=i+Math.imul(l,tt)|0)+Math.imul(h,Z)|0))<<13)|0;u=((o=o+Math.imul(h,tt)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(j,q),i=(i=Math.imul(j,F))+Math.imul($,q)|0,o=Math.imul($,F),n=n+Math.imul(O,z)|0,i=(i=i+Math.imul(O,K)|0)+Math.imul(A,z)|0,o=o+Math.imul(A,K)|0,n=n+Math.imul(_,H)|0,i=(i=i+Math.imul(_,J)|0)+Math.imul(w,H)|0,o=o+Math.imul(w,J)|0,n=n+Math.imul(m,Y)|0,i=(i=i+Math.imul(m,Q)|0)+Math.imul(v,Y)|0,o=o+Math.imul(v,Q)|0,n=n+Math.imul(d,Z)|0,i=(i=i+Math.imul(d,tt)|0)+Math.imul(y,Z)|0,o=o+Math.imul(y,tt)|0;var wt=(u+(n=n+Math.imul(l,rt)|0)|0)+((8191&(i=(i=i+Math.imul(l,nt)|0)+Math.imul(h,rt)|0))<<13)|0;u=((o=o+Math.imul(h,nt)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(P,q),i=(i=Math.imul(P,F))+Math.imul(k,q)|0,o=Math.imul(k,F),n=n+Math.imul(j,z)|0,i=(i=i+Math.imul(j,K)|0)+Math.imul($,z)|0,o=o+Math.imul($,K)|0,n=n+Math.imul(O,H)|0,i=(i=i+Math.imul(O,J)|0)+Math.imul(A,H)|0,o=o+Math.imul(A,J)|0,n=n+Math.imul(_,Y)|0,i=(i=i+Math.imul(_,Q)|0)+Math.imul(w,Y)|0,o=o+Math.imul(w,Q)|0,n=n+Math.imul(m,Z)|0,i=(i=i+Math.imul(m,tt)|0)+Math.imul(v,Z)|0,o=o+Math.imul(v,tt)|0,n=n+Math.imul(d,rt)|0,i=(i=i+Math.imul(d,nt)|0)+Math.imul(y,rt)|0,o=o+Math.imul(y,nt)|0;var St=(u+(n=n+Math.imul(l,ot)|0)|0)+((8191&(i=(i=i+Math.imul(l,at)|0)+Math.imul(h,ot)|0))<<13)|0;u=((o=o+Math.imul(h,at)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(R,q),i=(i=Math.imul(R,F))+Math.imul(I,q)|0,o=Math.imul(I,F),n=n+Math.imul(P,z)|0,i=(i=i+Math.imul(P,K)|0)+Math.imul(k,z)|0,o=o+Math.imul(k,K)|0,n=n+Math.imul(j,H)|0,i=(i=i+Math.imul(j,J)|0)+Math.imul($,H)|0,o=o+Math.imul($,J)|0,n=n+Math.imul(O,Y)|0,i=(i=i+Math.imul(O,Q)|0)+Math.imul(A,Y)|0,o=o+Math.imul(A,Q)|0,n=n+Math.imul(_,Z)|0,i=(i=i+Math.imul(_,tt)|0)+Math.imul(w,Z)|0,o=o+Math.imul(w,tt)|0,n=n+Math.imul(m,rt)|0,i=(i=i+Math.imul(m,nt)|0)+Math.imul(v,rt)|0,o=o+Math.imul(v,nt)|0,n=n+Math.imul(d,ot)|0,i=(i=i+Math.imul(d,at)|0)+Math.imul(y,ot)|0,o=o+Math.imul(y,at)|0;var Ot=(u+(n=n+Math.imul(l,ct)|0)|0)+((8191&(i=(i=i+Math.imul(l,ut)|0)+Math.imul(h,ct)|0))<<13)|0;u=((o=o+Math.imul(h,ut)|0)+(i>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,n=Math.imul(T,q),i=(i=Math.imul(T,F))+Math.imul(N,q)|0,o=Math.imul(N,F),n=n+Math.imul(R,z)|0,i=(i=i+Math.imul(R,K)|0)+Math.imul(I,z)|0,o=o+Math.imul(I,K)|0,n=n+Math.imul(P,H)|0,i=(i=i+Math.imul(P,J)|0)+Math.imul(k,H)|0,o=o+Math.imul(k,J)|0,n=n+Math.imul(j,Y)|0,i=(i=i+Math.imul(j,Q)|0)+Math.imul($,Y)|0,o=o+Math.imul($,Q)|0,n=n+Math.imul(O,Z)|0,i=(i=i+Math.imul(O,tt)|0)+Math.imul(A,Z)|0,o=o+Math.imul(A,tt)|0,n=n+Math.imul(_,rt)|0,i=(i=i+Math.imul(_,nt)|0)+Math.imul(w,rt)|0,o=o+Math.imul(w,nt)|0,n=n+Math.imul(m,ot)|0,i=(i=i+Math.imul(m,at)|0)+Math.imul(v,ot)|0,o=o+Math.imul(v,at)|0,n=n+Math.imul(d,ct)|0,i=(i=i+Math.imul(d,ut)|0)+Math.imul(y,ct)|0,o=o+Math.imul(y,ut)|0;var At=(u+(n=n+Math.imul(l,lt)|0)|0)+((8191&(i=(i=i+Math.imul(l,ht)|0)+Math.imul(h,lt)|0))<<13)|0;u=((o=o+Math.imul(h,ht)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(C,q),i=(i=Math.imul(C,F))+Math.imul(U,q)|0,o=Math.imul(U,F),n=n+Math.imul(T,z)|0,i=(i=i+Math.imul(T,K)|0)+Math.imul(N,z)|0,o=o+Math.imul(N,K)|0,n=n+Math.imul(R,H)|0,i=(i=i+Math.imul(R,J)|0)+Math.imul(I,H)|0,o=o+Math.imul(I,J)|0,n=n+Math.imul(P,Y)|0,i=(i=i+Math.imul(P,Q)|0)+Math.imul(k,Y)|0,o=o+Math.imul(k,Q)|0,n=n+Math.imul(j,Z)|0,i=(i=i+Math.imul(j,tt)|0)+Math.imul($,Z)|0,o=o+Math.imul($,tt)|0,n=n+Math.imul(O,rt)|0,i=(i=i+Math.imul(O,nt)|0)+Math.imul(A,rt)|0,o=o+Math.imul(A,nt)|0,n=n+Math.imul(_,ot)|0,i=(i=i+Math.imul(_,at)|0)+Math.imul(w,ot)|0,o=o+Math.imul(w,at)|0,n=n+Math.imul(m,ct)|0,i=(i=i+Math.imul(m,ut)|0)+Math.imul(v,ct)|0,o=o+Math.imul(v,ut)|0,n=n+Math.imul(d,lt)|0,i=(i=i+Math.imul(d,ht)|0)+Math.imul(y,lt)|0,o=o+Math.imul(y,ht)|0;var Et=(u+(n=n+Math.imul(l,dt)|0)|0)+((8191&(i=(i=i+Math.imul(l,yt)|0)+Math.imul(h,dt)|0))<<13)|0;u=((o=o+Math.imul(h,yt)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(C,z),i=(i=Math.imul(C,K))+Math.imul(U,z)|0,o=Math.imul(U,K),n=n+Math.imul(T,H)|0,i=(i=i+Math.imul(T,J)|0)+Math.imul(N,H)|0,o=o+Math.imul(N,J)|0,n=n+Math.imul(R,Y)|0,i=(i=i+Math.imul(R,Q)|0)+Math.imul(I,Y)|0,o=o+Math.imul(I,Q)|0,n=n+Math.imul(P,Z)|0,i=(i=i+Math.imul(P,tt)|0)+Math.imul(k,Z)|0,o=o+Math.imul(k,tt)|0,n=n+Math.imul(j,rt)|0,i=(i=i+Math.imul(j,nt)|0)+Math.imul($,rt)|0,o=o+Math.imul($,nt)|0,n=n+Math.imul(O,ot)|0,i=(i=i+Math.imul(O,at)|0)+Math.imul(A,ot)|0,o=o+Math.imul(A,at)|0,n=n+Math.imul(_,ct)|0,i=(i=i+Math.imul(_,ut)|0)+Math.imul(w,ct)|0,o=o+Math.imul(w,ut)|0,n=n+Math.imul(m,lt)|0,i=(i=i+Math.imul(m,ht)|0)+Math.imul(v,lt)|0,o=o+Math.imul(v,ht)|0;var jt=(u+(n=n+Math.imul(d,dt)|0)|0)+((8191&(i=(i=i+Math.imul(d,yt)|0)+Math.imul(y,dt)|0))<<13)|0;u=((o=o+Math.imul(y,yt)|0)+(i>>>13)|0)+(jt>>>26)|0,jt&=67108863,n=Math.imul(C,H),i=(i=Math.imul(C,J))+Math.imul(U,H)|0,o=Math.imul(U,J),n=n+Math.imul(T,Y)|0,i=(i=i+Math.imul(T,Q)|0)+Math.imul(N,Y)|0,o=o+Math.imul(N,Q)|0,n=n+Math.imul(R,Z)|0,i=(i=i+Math.imul(R,tt)|0)+Math.imul(I,Z)|0,o=o+Math.imul(I,tt)|0,n=n+Math.imul(P,rt)|0,i=(i=i+Math.imul(P,nt)|0)+Math.imul(k,rt)|0,o=o+Math.imul(k,nt)|0,n=n+Math.imul(j,ot)|0,i=(i=i+Math.imul(j,at)|0)+Math.imul($,ot)|0,o=o+Math.imul($,at)|0,n=n+Math.imul(O,ct)|0,i=(i=i+Math.imul(O,ut)|0)+Math.imul(A,ct)|0,o=o+Math.imul(A,ut)|0,n=n+Math.imul(_,lt)|0,i=(i=i+Math.imul(_,ht)|0)+Math.imul(w,lt)|0,o=o+Math.imul(w,ht)|0;var $t=(u+(n=n+Math.imul(m,dt)|0)|0)+((8191&(i=(i=i+Math.imul(m,yt)|0)+Math.imul(v,dt)|0))<<13)|0;u=((o=o+Math.imul(v,yt)|0)+(i>>>13)|0)+($t>>>26)|0,$t&=67108863,n=Math.imul(C,Y),i=(i=Math.imul(C,Q))+Math.imul(U,Y)|0,o=Math.imul(U,Q),n=n+Math.imul(T,Z)|0,i=(i=i+Math.imul(T,tt)|0)+Math.imul(N,Z)|0,o=o+Math.imul(N,tt)|0,n=n+Math.imul(R,rt)|0,i=(i=i+Math.imul(R,nt)|0)+Math.imul(I,rt)|0,o=o+Math.imul(I,nt)|0,n=n+Math.imul(P,ot)|0,i=(i=i+Math.imul(P,at)|0)+Math.imul(k,ot)|0,o=o+Math.imul(k,at)|0,n=n+Math.imul(j,ct)|0,i=(i=i+Math.imul(j,ut)|0)+Math.imul($,ct)|0,o=o+Math.imul($,ut)|0,n=n+Math.imul(O,lt)|0,i=(i=i+Math.imul(O,ht)|0)+Math.imul(A,lt)|0,o=o+Math.imul(A,ht)|0;var xt=(u+(n=n+Math.imul(_,dt)|0)|0)+((8191&(i=(i=i+Math.imul(_,yt)|0)+Math.imul(w,dt)|0))<<13)|0;u=((o=o+Math.imul(w,yt)|0)+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,n=Math.imul(C,Z),i=(i=Math.imul(C,tt))+Math.imul(U,Z)|0,o=Math.imul(U,tt),n=n+Math.imul(T,rt)|0,i=(i=i+Math.imul(T,nt)|0)+Math.imul(N,rt)|0,o=o+Math.imul(N,nt)|0,n=n+Math.imul(R,ot)|0,i=(i=i+Math.imul(R,at)|0)+Math.imul(I,ot)|0,o=o+Math.imul(I,at)|0,n=n+Math.imul(P,ct)|0,i=(i=i+Math.imul(P,ut)|0)+Math.imul(k,ct)|0,o=o+Math.imul(k,ut)|0,n=n+Math.imul(j,lt)|0,i=(i=i+Math.imul(j,ht)|0)+Math.imul($,lt)|0,o=o+Math.imul($,ht)|0;var Pt=(u+(n=n+Math.imul(O,dt)|0)|0)+((8191&(i=(i=i+Math.imul(O,yt)|0)+Math.imul(A,dt)|0))<<13)|0;u=((o=o+Math.imul(A,yt)|0)+(i>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,n=Math.imul(C,rt),i=(i=Math.imul(C,nt))+Math.imul(U,rt)|0,o=Math.imul(U,nt),n=n+Math.imul(T,ot)|0,i=(i=i+Math.imul(T,at)|0)+Math.imul(N,ot)|0,o=o+Math.imul(N,at)|0,n=n+Math.imul(R,ct)|0,i=(i=i+Math.imul(R,ut)|0)+Math.imul(I,ct)|0,o=o+Math.imul(I,ut)|0,n=n+Math.imul(P,lt)|0,i=(i=i+Math.imul(P,ht)|0)+Math.imul(k,lt)|0,o=o+Math.imul(k,ht)|0;var kt=(u+(n=n+Math.imul(j,dt)|0)|0)+((8191&(i=(i=i+Math.imul(j,yt)|0)+Math.imul($,dt)|0))<<13)|0;u=((o=o+Math.imul($,yt)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,n=Math.imul(C,ot),i=(i=Math.imul(C,at))+Math.imul(U,ot)|0,o=Math.imul(U,at),n=n+Math.imul(T,ct)|0,i=(i=i+Math.imul(T,ut)|0)+Math.imul(N,ct)|0,o=o+Math.imul(N,ut)|0,n=n+Math.imul(R,lt)|0,i=(i=i+Math.imul(R,ht)|0)+Math.imul(I,lt)|0,o=o+Math.imul(I,ht)|0;var Mt=(u+(n=n+Math.imul(P,dt)|0)|0)+((8191&(i=(i=i+Math.imul(P,yt)|0)+Math.imul(k,dt)|0))<<13)|0;u=((o=o+Math.imul(k,yt)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(C,ct),i=(i=Math.imul(C,ut))+Math.imul(U,ct)|0,o=Math.imul(U,ut),n=n+Math.imul(T,lt)|0,i=(i=i+Math.imul(T,ht)|0)+Math.imul(N,lt)|0,o=o+Math.imul(N,ht)|0;var Rt=(u+(n=n+Math.imul(R,dt)|0)|0)+((8191&(i=(i=i+Math.imul(R,yt)|0)+Math.imul(I,dt)|0))<<13)|0;u=((o=o+Math.imul(I,yt)|0)+(i>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,n=Math.imul(C,lt),i=(i=Math.imul(C,ht))+Math.imul(U,lt)|0,o=Math.imul(U,ht);var It=(u+(n=n+Math.imul(T,dt)|0)|0)+((8191&(i=(i=i+Math.imul(T,yt)|0)+Math.imul(N,dt)|0))<<13)|0;u=((o=o+Math.imul(N,yt)|0)+(i>>>13)|0)+(It>>>26)|0,It&=67108863;var Bt=(u+(n=Math.imul(C,dt))|0)+((8191&(i=(i=Math.imul(C,yt))+Math.imul(U,dt)|0))<<13)|0;return u=((o=Math.imul(U,yt))+(i>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,c[0]=bt,c[1]=mt,c[2]=vt,c[3]=gt,c[4]=_t,c[5]=wt,c[6]=St,c[7]=Ot,c[8]=At,c[9]=Et,c[10]=jt,c[11]=$t,c[12]=xt,c[13]=Pt,c[14]=kt,c[15]=Mt,c[16]=Rt,c[17]=It,c[18]=Bt,0!==u&&(c[19]=u,r.length++),r};function v(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var n=0,i=0,o=0;o>>26)|0)>>>26,a&=67108863}r.words[o]=s,n=a,a=i}return 0!==n?r.words[o]=n:r.length--,r._strip()}function g(t,e,r){return v(t,e,r)}function _(t,e){this.x=t,this.y=e}Math.imul||(m=b),a.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?m(this,t,e):r<63?b(this,t,e):r<1024?v(this,t,e):g(this,t,e)},_.prototype.makeRBT=function(t){for(var e=new Array(t),r=a.prototype._countBits(t)-1,n=0;n>=1;return n},_.prototype.permute=function(t,e,r,n,i,o){for(var a=0;a>>=1)i++;return 1<>>=13,r[2*a+1]=8191&o,o>>>=13;for(a=2*e;a>=26,r+=o/67108864|0,r+=a>>>26,this.words[n]=67108863&a}return 0!==r&&(this.words[n]=r,this.length++),e?this.ineg():this},a.prototype.muln=function(t){return this.clone().imuln(t)},a.prototype.sqr=function(){return this.mul(this)},a.prototype.isqr=function(){return this.imul(this.clone())},a.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r>>i&1}return e}(t);if(0===e.length)return new a(1);for(var r=this,n=0;n=0);var e,r=t%26,n=(t-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var a=0;for(e=0;e>>26-r}a&&(this.words[e]=a,this.length++)}if(0!==n){for(e=this.length-1;e>=0;e--)this.words[e+n]=this.words[e];for(e=0;e=0),n=e?(e-e%26)/26:0;var o=t%26,a=Math.min((t-o)/26,this.length),s=67108863^67108863>>>o<a)for(this.length-=a,u=0;u=0&&(0!==f||u>=n);u--){var l=0|this.words[u];this.words[u]=f<<26-o|l>>>o,f=l&s}return c&&0!==f&&(c.words[c.length++]=f),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},a.prototype.ishrn=function(t,e,r){return i(0===this.negative),this.iushrn(t,e,r)},a.prototype.shln=function(t){return this.clone().ishln(t)},a.prototype.ushln=function(t){return this.clone().iushln(t)},a.prototype.shrn=function(t){return this.clone().ishrn(t)},a.prototype.ushrn=function(t){return this.clone().iushrn(t)},a.prototype.testn=function(t){i("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,n=1<=0);var e=t%26,r=(t-e)/26;if(i(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var n=67108863^67108863>>>e<=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},a.prototype.isubn=function(t){if(i("number"==typeof t),i(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e>26)-(c/67108864|0),this.words[n+r]=67108863&o}for(;n>26,this.words[n+r]=67108863&o;if(0===s)return this._strip();for(i(-1===s),s=0,n=0;n>26,this.words[n]=67108863&o;return this.negative=1,this._strip()},a.prototype._wordDiv=function(t,e){var r=(this.length,t.length),n=this.clone(),i=t,o=0|i.words[i.length-1];0!=(r=26-this._countBits(o))&&(i=i.ushln(r),n.iushln(r),o=0|i.words[i.length-1]);var s,c=n.length-i.length;if("mod"!==e){(s=new a(null)).length=c+1,s.words=new Array(s.length);for(var u=0;u=0;l--){var h=67108864*(0|n.words[i.length+l])+(0|n.words[i.length+l-1]);for(h=Math.min(h/o|0,67108863),n._ishlnsubmul(i,h,l);0!==n.negative;)h--,n.negative=0,n._ishlnsubmul(i,1,l),n.isZero()||(n.negative^=1);s&&(s.words[l]=h)}return s&&s._strip(),n._strip(),"div"!==e&&0!==r&&n.iushrn(r),{div:s||null,mod:n}},a.prototype.divmod=function(t,e,r){return i(!t.isZero()),this.isZero()?{div:new a(0),mod:new a(0)}:0!==this.negative&&0===t.negative?(s=this.neg().divmod(t,e),"mod"!==e&&(n=s.div.neg()),"div"!==e&&(o=s.mod.neg(),r&&0!==o.negative&&o.iadd(t)),{div:n,mod:o}):0===this.negative&&0!==t.negative?(s=this.divmod(t.neg(),e),"mod"!==e&&(n=s.div.neg()),{div:n,mod:s.mod}):0!=(this.negative&t.negative)?(s=this.neg().divmod(t.neg(),e),"div"!==e&&(o=s.mod.neg(),r&&0!==o.negative&&o.isub(t)),{div:s.div,mod:o}):t.length>this.length||this.cmp(t)<0?{div:new a(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new a(this.modrn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new a(this.modrn(t.words[0]))}:this._wordDiv(t,e);var n,o,s},a.prototype.div=function(t){return this.divmod(t,"div",!1).div},a.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},a.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},a.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,n=t.ushrn(1),i=t.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},a.prototype.modrn=function(t){var e=t<0;e&&(t=-t),i(t<=67108863);for(var r=(1<<26)%t,n=0,o=this.length-1;o>=0;o--)n=(r*n+(0|this.words[o]))%t;return e?-n:n},a.prototype.modn=function(t){return this.modrn(t)},a.prototype.idivn=function(t){var e=t<0;e&&(t=-t),i(t<=67108863);for(var r=0,n=this.length-1;n>=0;n--){var o=(0|this.words[n])+67108864*r;this.words[n]=o/t|0,r=o%t}return this._strip(),e?this.ineg():this},a.prototype.divn=function(t){return this.clone().idivn(t)},a.prototype.egcd=function(t){i(0===t.negative),i(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n=new a(1),o=new a(0),s=new a(0),c=new a(1),u=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++u;for(var f=r.clone(),l=e.clone();!e.isZero();){for(var h=0,p=1;0==(e.words[0]&p)&&h<26;++h,p<<=1);if(h>0)for(e.iushrn(h);h-- >0;)(n.isOdd()||o.isOdd())&&(n.iadd(f),o.isub(l)),n.iushrn(1),o.iushrn(1);for(var d=0,y=1;0==(r.words[0]&y)&&d<26;++d,y<<=1);if(d>0)for(r.iushrn(d);d-- >0;)(s.isOdd()||c.isOdd())&&(s.iadd(f),c.isub(l)),s.iushrn(1),c.iushrn(1);e.cmp(r)>=0?(e.isub(r),n.isub(s),o.isub(c)):(r.isub(e),s.isub(n),c.isub(o))}return{a:s,b:c,gcd:r.iushln(u)}},a.prototype._invmp=function(t){i(0===t.negative),i(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n,o=new a(1),s=new a(0),c=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var u=0,f=1;0==(e.words[0]&f)&&u<26;++u,f<<=1);if(u>0)for(e.iushrn(u);u-- >0;)o.isOdd()&&o.iadd(c),o.iushrn(1);for(var l=0,h=1;0==(r.words[0]&h)&&l<26;++l,h<<=1);if(l>0)for(r.iushrn(l);l-- >0;)s.isOdd()&&s.iadd(c),s.iushrn(1);e.cmp(r)>=0?(e.isub(r),o.isub(s)):(r.isub(e),s.isub(o))}return(n=0===e.cmpn(1)?o:s).cmpn(0)<0&&n.iadd(t),n},a.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var n=0;e.isEven()&&r.isEven();n++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=e.cmp(r);if(i<0){var o=e;e=r,r=o}else if(0===i||0===r.cmpn(1))break;e.isub(r)}return r.iushln(n)},a.prototype.invm=function(t){return this.egcd(t).a.umod(t)},a.prototype.isEven=function(){return 0==(1&this.words[0])},a.prototype.isOdd=function(){return 1==(1&this.words[0])},a.prototype.andln=function(t){return this.words[0]&t},a.prototype.bincn=function(t){i("number"==typeof t);var e=t%26,r=(t-e)/26,n=1<>>26,s&=67108863,this.words[a]=s}return 0!==o&&(this.words[a]=o,this.length++),this},a.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},a.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this._strip(),this.length>1)e=1;else{r&&(t=-t),i(t<=67108863,"Number is too big");var n=0|this.words[0];e=n===t?0:nt.length)return 1;if(this.length=0;r--){var n=0|this.words[r],i=0|t.words[r];if(n!==i){ni&&(e=1);break}}return e},a.prototype.gtn=function(t){return 1===this.cmpn(t)},a.prototype.gt=function(t){return 1===this.cmp(t)},a.prototype.gten=function(t){return this.cmpn(t)>=0},a.prototype.gte=function(t){return this.cmp(t)>=0},a.prototype.ltn=function(t){return-1===this.cmpn(t)},a.prototype.lt=function(t){return-1===this.cmp(t)},a.prototype.lten=function(t){return this.cmpn(t)<=0},a.prototype.lte=function(t){return this.cmp(t)<=0},a.prototype.eqn=function(t){return 0===this.cmpn(t)},a.prototype.eq=function(t){return 0===this.cmp(t)},a.red=function(t){return new $(t)},a.prototype.toRed=function(t){return i(!this.red,"Already a number in reduction context"),i(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},a.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},a.prototype._forceRed=function(t){return this.red=t,this},a.prototype.forceRed=function(t){return i(!this.red,"Already a number in reduction context"),this._forceRed(t)},a.prototype.redAdd=function(t){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},a.prototype.redIAdd=function(t){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},a.prototype.redSub=function(t){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},a.prototype.redISub=function(t){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},a.prototype.redShl=function(t){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},a.prototype.redMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},a.prototype.redIMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},a.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},a.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},a.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},a.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},a.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},a.prototype.redPow=function(t){return i(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var w={k256:null,p224:null,p192:null,p25519:null};function S(t,e){this.name=t,this.p=new a(e,16),this.n=this.p.bitLength(),this.k=new a(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function O(){S.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function A(){S.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function E(){S.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function j(){S.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function $(t){if("string"==typeof t){var e=a._prime(t);this.m=e.p,this.prime=e}else i(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function x(t){$.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new a(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}S.prototype._tmp=function(){var t=new a(null);return t.words=new Array(Math.ceil(this.n/13)),t},S.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var n=e0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},S.prototype.split=function(t,e){t.iushrn(this.n,0,e)},S.prototype.imulK=function(t){return t.imul(this.k)},o(O,S),O.prototype.split=function(t,e){for(var r=4194303,n=Math.min(t.length,9),i=0;i>>22,o=a}o>>>=22,t.words[i-10]=o,0===o&&t.length>10?t.length-=10:t.length-=9},O.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r>>=26,t.words[r]=i,e=n}return 0!==e&&(t.words[t.length++]=e),t},a._prime=function(t){if(w[t])return w[t];var e;if("k256"===t)e=new O;else if("p224"===t)e=new A;else if("p192"===t)e=new E;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new j}return w[t]=e,e},$.prototype._verify1=function(t){i(0===t.negative,"red works only with positives"),i(t.red,"red works only with red numbers")},$.prototype._verify2=function(t,e){i(0==(t.negative|e.negative),"red works only with positives"),i(t.red&&t.red===e.red,"red works only with red numbers")},$.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):(l(t,t.umod(this.m)._forceRed(this)),t)},$.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},$.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},$.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},$.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},$.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},$.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},$.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},$.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},$.prototype.isqr=function(t){return this.imul(t,t.clone())},$.prototype.sqr=function(t){return this.mul(t,t)},$.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(i(e%2==1),3===e){var r=this.m.add(new a(1)).iushrn(2);return this.pow(t,r)}for(var n=this.m.subn(1),o=0;!n.isZero()&&0===n.andln(1);)o++,n.iushrn(1);i(!n.isZero());var s=new a(1).toRed(this),c=s.redNeg(),u=this.m.subn(1).iushrn(1),f=this.m.bitLength();for(f=new a(2*f*f).toRed(this);0!==this.pow(f,u).cmp(c);)f.redIAdd(c);for(var l=this.pow(f,n),h=this.pow(t,n.addn(1).iushrn(1)),p=this.pow(t,n),d=o;0!==p.cmp(s);){for(var y=p,b=0;0!==y.cmp(s);b++)y=y.redSqr();i(b=0;n--){for(var u=e.words[n],f=c-1;f>=0;f--){var l=u>>f&1;i!==r[0]&&(i=this.sqr(i)),0!==l||0!==o?(o<<=1,o|=l,(4==++s||0===n&&0===f)&&(i=this.mul(i,r[o]),s=0,o=0)):s=0}c=26}return i},$.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},$.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},a.mont=function(t){return new x(t)},o(x,$),x.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},x.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},x.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},x.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new a(0)._forceRed(this);var r=t.mul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},x.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t=r.nmd(t),this)},7179:(t,e,r)=>{function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}var i;function o(t){this.rand=t}if(t.exports=function(t){return i||(i=new o(null)),i.generate(t)},t.exports.Rand=o,o.prototype.generate=function(t){return this._rand(t)},o.prototype._rand=function(t){if(this.rand.getBytes)return this.rand.getBytes(t);for(var e=new Uint8Array(t),r=0;r{var n=r(9047).Buffer;function i(t){n.isBuffer(t)||(t=n.from(t));for(var e=t.length/4|0,r=new Array(e),i=0;i>>24]^f[d>>>16&255]^l[y>>>8&255]^h[255&b]^e[m++],a=u[d>>>24]^f[y>>>16&255]^l[b>>>8&255]^h[255&p]^e[m++],s=u[y>>>24]^f[b>>>16&255]^l[p>>>8&255]^h[255&d]^e[m++],c=u[b>>>24]^f[p>>>16&255]^l[d>>>8&255]^h[255&y]^e[m++],p=o,d=a,y=s,b=c;return o=(n[p>>>24]<<24|n[d>>>16&255]<<16|n[y>>>8&255]<<8|n[255&b])^e[m++],a=(n[d>>>24]<<24|n[y>>>16&255]<<16|n[b>>>8&255]<<8|n[255&p])^e[m++],s=(n[y>>>24]<<24|n[b>>>16&255]<<16|n[p>>>8&255]<<8|n[255&d])^e[m++],c=(n[b>>>24]<<24|n[p>>>16&255]<<16|n[d>>>8&255]<<8|n[255&y])^e[m++],[o>>>=0,a>>>=0,s>>>=0,c>>>=0]}var s=[0,1,2,4,8,16,32,64,128,27,54],c=function(){for(var t=new Array(256),e=0;e<256;e++)t[e]=e<128?e<<1:e<<1^283;for(var r=[],n=[],i=[[],[],[],[]],o=[[],[],[],[]],a=0,s=0,c=0;c<256;++c){var u=s^s<<1^s<<2^s<<3^s<<4;u=u>>>8^255&u^99,r[a]=u,n[u]=a;var f=t[a],l=t[f],h=t[l],p=257*t[u]^16843008*u;i[0][a]=p<<24|p>>>8,i[1][a]=p<<16|p>>>16,i[2][a]=p<<8|p>>>24,i[3][a]=p,p=16843009*h^65537*l^257*f^16843008*a,o[0][u]=p<<24|p>>>8,o[1][u]=p<<16|p>>>16,o[2][u]=p<<8|p>>>24,o[3][u]=p,0===a?a=s=1:(a=f^t[t[t[h^f]]],s^=t[t[s]])}return{SBOX:r,INV_SBOX:n,SUB_MIX:i,INV_SUB_MIX:o}}();function u(t){this._key=i(t),this._reset()}u.blockSize=16,u.keySize=32,u.prototype.blockSize=u.blockSize,u.prototype.keySize=u.keySize,u.prototype._reset=function(){for(var t=this._key,e=t.length,r=e+6,n=4*(r+1),i=[],o=0;o>>24,a=c.SBOX[a>>>24]<<24|c.SBOX[a>>>16&255]<<16|c.SBOX[a>>>8&255]<<8|c.SBOX[255&a],a^=s[o/e|0]<<24):e>6&&o%e==4&&(a=c.SBOX[a>>>24]<<24|c.SBOX[a>>>16&255]<<16|c.SBOX[a>>>8&255]<<8|c.SBOX[255&a]),i[o]=i[o-e]^a}for(var u=[],f=0;f>>24]]^c.INV_SUB_MIX[1][c.SBOX[h>>>16&255]]^c.INV_SUB_MIX[2][c.SBOX[h>>>8&255]]^c.INV_SUB_MIX[3][c.SBOX[255&h]]}this._nRounds=r,this._keySchedule=i,this._invKeySchedule=u},u.prototype.encryptBlockRaw=function(t){return a(t=i(t),this._keySchedule,c.SUB_MIX,c.SBOX,this._nRounds)},u.prototype.encryptBlock=function(t){var e=this.encryptBlockRaw(t),r=n.allocUnsafe(16);return r.writeUInt32BE(e[0],0),r.writeUInt32BE(e[1],4),r.writeUInt32BE(e[2],8),r.writeUInt32BE(e[3],12),r},u.prototype.decryptBlock=function(t){var e=(t=i(t))[1];t[1]=t[3],t[3]=e;var r=a(t,this._invKeySchedule,c.INV_SUB_MIX,c.INV_SBOX,this._nRounds),o=n.allocUnsafe(16);return o.writeUInt32BE(r[0],0),o.writeUInt32BE(r[3],4),o.writeUInt32BE(r[2],8),o.writeUInt32BE(r[1],12),o},u.prototype.scrub=function(){o(this._keySchedule),o(this._invKeySchedule),o(this._key)},t.exports.AES=u},3499:(t,e,r)=>{var n=r(7463),i=r(9047).Buffer,o=r(8842),a=r(376),s=r(1225),c=r(5176),u=r(4001);function f(t,e,r,a){o.call(this);var c=i.alloc(4,0);this._cipher=new n.AES(e);var f=this._cipher.encryptBlock(c);this._ghash=new s(f),r=function(t,e,r){if(12===e.length)return t._finID=i.concat([e,i.from([0,0,0,1])]),i.concat([e,i.from([0,0,0,2])]);var n=new s(r),o=e.length,a=o%16;n.update(e),a&&(a=16-a,n.update(i.alloc(a,0))),n.update(i.alloc(8,0));var c=8*o,f=i.alloc(8);f.writeUIntBE(c,0,8),n.update(f),t._finID=n.state;var l=i.from(t._finID);return u(l),l}(this,r,f),this._prev=i.from(r),this._cache=i.allocUnsafe(0),this._secCache=i.allocUnsafe(0),this._decrypt=a,this._alen=0,this._len=0,this._mode=t,this._authTag=null,this._called=!1}a(f,o),f.prototype._update=function(t){if(!this._called&&this._alen){var e=16-this._alen%16;e<16&&(e=i.alloc(e,0),this._ghash.update(e))}this._called=!0;var r=this._mode.encrypt(this,t);return this._decrypt?this._ghash.update(t):this._ghash.update(r),this._len+=t.length,r},f.prototype._final=function(){if(this._decrypt&&!this._authTag)throw new Error("Unsupported state or unable to authenticate data");var t=c(this._ghash.final(8*this._alen,8*this._len),this._cipher.encryptBlock(this._finID));if(this._decrypt&&function(t,e){var r=0;t.length!==e.length&&r++;for(var n=Math.min(t.length,e.length),i=0;i{var n=r(8613),i=r(7909),o=r(4946);e.createCipher=e.Cipher=n.createCipher,e.createCipheriv=e.Cipheriv=n.createCipheriv,e.createDecipher=e.Decipher=i.createDecipher,e.createDecipheriv=e.Decipheriv=i.createDecipheriv,e.listCiphers=e.getCiphers=function(){return Object.keys(o)}},7909:(t,e,r)=>{var n=r(3499),i=r(9047).Buffer,o=r(6572),a=r(7188),s=r(8842),c=r(7463),u=r(1248);function f(t,e,r){s.call(this),this._cache=new l,this._last=void 0,this._cipher=new c.AES(e),this._prev=i.from(r),this._mode=t,this._autopadding=!0}function l(){this.cache=i.allocUnsafe(0)}function h(t,e,r){var s=o[t.toLowerCase()];if(!s)throw new TypeError("invalid suite type");if("string"==typeof r&&(r=i.from(r)),"GCM"!==s.mode&&r.length!==s.iv)throw new TypeError("invalid iv length "+r.length);if("string"==typeof e&&(e=i.from(e)),e.length!==s.key/8)throw new TypeError("invalid key length "+e.length);return"stream"===s.type?new a(s.module,e,r,!0):"auth"===s.type?new n(s.module,e,r,!0):new f(s.module,e,r)}r(376)(f,s),f.prototype._update=function(t){var e,r;this._cache.add(t);for(var n=[];e=this._cache.get(this._autopadding);)r=this._mode.decrypt(this,e),n.push(r);return i.concat(n)},f.prototype._final=function(){var t=this._cache.flush();if(this._autopadding)return function(t){var e=t[15];if(e<1||e>16)throw new Error("unable to decrypt data");for(var r=-1;++r16)return e=this.cache.slice(0,16),this.cache=this.cache.slice(16),e}else if(this.cache.length>=16)return e=this.cache.slice(0,16),this.cache=this.cache.slice(16),e;return null},l.prototype.flush=function(){if(this.cache.length)return this.cache},e.createDecipher=function(t,e){var r=o[t.toLowerCase()];if(!r)throw new TypeError("invalid suite type");var n=u(e,!1,r.key,r.iv);return h(t,n.key,n.iv)},e.createDecipheriv=h},8613:(t,e,r)=>{var n=r(6572),i=r(3499),o=r(9047).Buffer,a=r(7188),s=r(8842),c=r(7463),u=r(1248);function f(t,e,r){s.call(this),this._cache=new h,this._cipher=new c.AES(e),this._prev=o.from(r),this._mode=t,this._autopadding=!0}r(376)(f,s),f.prototype._update=function(t){var e,r;this._cache.add(t);for(var n=[];e=this._cache.get();)r=this._mode.encrypt(this,e),n.push(r);return o.concat(n)};var l=o.alloc(16,16);function h(){this.cache=o.allocUnsafe(0)}function p(t,e,r){var s=n[t.toLowerCase()];if(!s)throw new TypeError("invalid suite type");if("string"==typeof e&&(e=o.from(e)),e.length!==s.key/8)throw new TypeError("invalid key length "+e.length);if("string"==typeof r&&(r=o.from(r)),"GCM"!==s.mode&&r.length!==s.iv)throw new TypeError("invalid iv length "+r.length);return"stream"===s.type?new a(s.module,e,r):"auth"===s.type?new i(s.module,e,r):new f(s.module,e,r)}f.prototype._final=function(){var t=this._cache.flush();if(this._autopadding)return t=this._mode.encrypt(this,t),this._cipher.scrub(),t;if(!t.equals(l))throw this._cipher.scrub(),new Error("data not multiple of block length")},f.prototype.setAutoPadding=function(t){return this._autopadding=!!t,this},h.prototype.add=function(t){this.cache=o.concat([this.cache,t])},h.prototype.get=function(){if(this.cache.length>15){var t=this.cache.slice(0,16);return this.cache=this.cache.slice(16),t}return null},h.prototype.flush=function(){for(var t=16-this.cache.length,e=o.allocUnsafe(t),r=-1;++r{var n=r(9047).Buffer,i=n.alloc(16,0);function o(t){var e=n.allocUnsafe(16);return e.writeUInt32BE(t[0]>>>0,0),e.writeUInt32BE(t[1]>>>0,4),e.writeUInt32BE(t[2]>>>0,8),e.writeUInt32BE(t[3]>>>0,12),e}function a(t){this.h=t,this.state=n.alloc(16,0),this.cache=n.allocUnsafe(0)}a.prototype.ghash=function(t){for(var e=-1;++e0;e--)n[e]=n[e]>>>1|(1&n[e-1])<<31;n[0]=n[0]>>>1,r&&(n[0]=n[0]^225<<24)}this.state=o(i)},a.prototype.update=function(t){var e;for(this.cache=n.concat([this.cache,t]);this.cache.length>=16;)e=this.cache.slice(0,16),this.cache=this.cache.slice(16),this.ghash(e)},a.prototype.final=function(t,e){return this.cache.length&&this.ghash(n.concat([this.cache,i],16)),this.ghash(o([0,t,0,e])),this.state},t.exports=a},4001:t=>{t.exports=function(t){for(var e,r=t.length;r--;){if(255!==(e=t.readUInt8(r))){e++,t.writeUInt8(e,r);break}t.writeUInt8(0,r)}}},9628:(t,e,r)=>{var n=r(5176);e.encrypt=function(t,e){var r=n(e,t._prev);return t._prev=t._cipher.encryptBlock(r),t._prev},e.decrypt=function(t,e){var r=t._prev;t._prev=e;var i=t._cipher.decryptBlock(e);return n(i,r)}},6674:(t,e,r)=>{var n=r(9047).Buffer,i=r(5176);function o(t,e,r){var o=e.length,a=i(e,t._cache);return t._cache=t._cache.slice(o),t._prev=n.concat([t._prev,r?e:a]),a}e.encrypt=function(t,e,r){for(var i,a=n.allocUnsafe(0);e.length;){if(0===t._cache.length&&(t._cache=t._cipher.encryptBlock(t._prev),t._prev=n.allocUnsafe(0)),!(t._cache.length<=e.length)){a=n.concat([a,o(t,e,r)]);break}i=t._cache.length,a=n.concat([a,o(t,e.slice(0,i),r)]),e=e.slice(i)}return a}},9971:(t,e,r)=>{var n=r(9047).Buffer;function i(t,e,r){for(var n,i,a=-1,s=0;++a<8;)n=e&1<<7-a?128:0,s+=(128&(i=t._cipher.encryptBlock(t._prev)[0]^n))>>a%8,t._prev=o(t._prev,r?n:i);return s}function o(t,e){var r=t.length,i=-1,o=n.allocUnsafe(t.length);for(t=n.concat([t,n.from([e])]);++i>7;return o}e.encrypt=function(t,e,r){for(var o=e.length,a=n.allocUnsafe(o),s=-1;++s{var n=r(9047).Buffer;function i(t,e,r){var i=t._cipher.encryptBlock(t._prev)[0]^e;return t._prev=n.concat([t._prev.slice(1),n.from([r?e:i])]),i}e.encrypt=function(t,e,r){for(var o=e.length,a=n.allocUnsafe(o),s=-1;++s{var n=r(5176),i=r(9047).Buffer,o=r(4001);function a(t){var e=t._cipher.encryptBlockRaw(t._prev);return o(t._prev),e}e.encrypt=function(t,e){var r=Math.ceil(e.length/16),o=t._cache.length;t._cache=i.concat([t._cache,i.allocUnsafe(16*r)]);for(var s=0;s{e.encrypt=function(t,e){return t._cipher.encryptBlock(e)},e.decrypt=function(t,e){return t._cipher.decryptBlock(e)}},6572:(t,e,r)=>{var n={ECB:r(8972),CBC:r(9628),CFB:r(6674),CFB8:r(8194),CFB1:r(9971),OFB:r(2343),CTR:r(8871),GCM:r(8871)},i=r(4946);for(var o in i)i[o].module=n[i[o].mode];t.exports=i},2343:(t,e,r)=>{var n=r(365).Buffer,i=r(5176);function o(t){return t._prev=t._cipher.encryptBlock(t._prev),t._prev}e.encrypt=function(t,e){for(;t._cache.length{var n=r(7463),i=r(9047).Buffer,o=r(8842);function a(t,e,r,a){o.call(this),this._cipher=new n.AES(e),this._prev=i.from(r),this._cache=i.allocUnsafe(0),this._secCache=i.allocUnsafe(0),this._decrypt=a,this._mode=t}r(376)(a,o),a.prototype._update=function(t){return this._mode.encrypt(this,t,this._decrypt)},a.prototype._final=function(){this._cipher.scrub()},t.exports=a},5972:(t,e,r)=>{var n=r(7729),i=r(4881),o=r(6572),a=r(3519),s=r(1248);function c(t,e,r){if(t=t.toLowerCase(),o[t])return i.createCipheriv(t,e,r);if(a[t])return new n({key:e,iv:r,mode:t});throw new TypeError("invalid suite type")}function u(t,e,r){if(t=t.toLowerCase(),o[t])return i.createDecipheriv(t,e,r);if(a[t])return new n({key:e,iv:r,mode:t,decrypt:!0});throw new TypeError("invalid suite type")}e.createCipher=e.Cipher=function(t,e){var r,n;if(t=t.toLowerCase(),o[t])r=o[t].key,n=o[t].iv;else{if(!a[t])throw new TypeError("invalid suite type");r=8*a[t].key,n=a[t].iv}var i=s(e,!1,r,n);return c(t,i.key,i.iv)},e.createCipheriv=e.Cipheriv=c,e.createDecipher=e.Decipher=function(t,e){var r,n;if(t=t.toLowerCase(),o[t])r=o[t].key,n=o[t].iv;else{if(!a[t])throw new TypeError("invalid suite type");r=8*a[t].key,n=a[t].iv}var i=s(e,!1,r,n);return u(t,i.key,i.iv)},e.createDecipheriv=e.Decipheriv=u,e.listCiphers=e.getCiphers=function(){return Object.keys(a).concat(i.getCiphers())}},7729:(t,e,r)=>{var n=r(8842),i=r(167),o=r(376),a=r(9047).Buffer,s={"des-ede3-cbc":i.CBC.instantiate(i.EDE),"des-ede3":i.EDE,"des-ede-cbc":i.CBC.instantiate(i.EDE),"des-ede":i.EDE,"des-cbc":i.CBC.instantiate(i.DES),"des-ecb":i.DES};function c(t){n.call(this);var e,r=t.mode.toLowerCase(),i=s[r];e=t.decrypt?"decrypt":"encrypt";var o=t.key;a.isBuffer(o)||(o=a.from(o)),"des-ede"!==r&&"des-ede-cbc"!==r||(o=a.concat([o,o.slice(0,8)]));var c=t.iv;a.isBuffer(c)||(c=a.from(c)),this._des=i.create({key:o,iv:c,type:e})}s.des=s["des-cbc"],s.des3=s["des-ede3-cbc"],t.exports=c,o(c,n),c.prototype._update=function(t){return a.from(this._des.update(t))},c.prototype._final=function(){return a.from(this._des.final())}},3519:(t,e)=>{e["des-ecb"]={key:8,iv:0},e["des-cbc"]=e.des={key:8,iv:8},e["des-ede3-cbc"]=e.des3={key:24,iv:8},e["des-ede3"]={key:24,iv:0},e["des-ede-cbc"]={key:16,iv:8},e["des-ede"]={key:16,iv:0}},4364:(t,e,r)=>{var n=r(365).Buffer,i=r(6781),o=r(5760);function a(t){var e,r=t.modulus.byteLength();do{e=new i(o(r))}while(e.cmp(t.modulus)>=0||!e.umod(t.prime1)||!e.umod(t.prime2));return e}function s(t,e){var r=function(t){var e=a(t);return{blinder:e.toRed(i.mont(t.modulus)).redPow(new i(t.publicExponent)).fromRed(),unblinder:e.invm(t.modulus)}}(e),o=e.modulus.byteLength(),s=new i(t).mul(r.blinder).umod(e.modulus),c=s.toRed(i.mont(e.prime1)),u=s.toRed(i.mont(e.prime2)),f=e.coefficient,l=e.prime1,h=e.prime2,p=c.redPow(e.exponent1).fromRed(),d=u.redPow(e.exponent2).fromRed(),y=p.isub(d).imul(f).umod(l).imul(h);return d.iadd(y).imul(r.unblinder).umod(e.modulus).toArrayLike(n,"be",o)}s.getr=a,t.exports=s},3363:(t,e,r)=>{t.exports=r(5207)},1022:(t,e,r)=>{var n=r(3173).Buffer,i=r(8339),o=r(8237),a=r(376),s=r(1437),c=r(1113),u=r(5207);function f(t){o.Writable.call(this);var e=u[t];if(!e)throw new Error("Unknown message digest");this._hashType=e.hash,this._hash=i(e.hash),this._tag=e.id,this._signType=e.sign}function l(t){o.Writable.call(this);var e=u[t];if(!e)throw new Error("Unknown message digest");this._hash=i(e.hash),this._tag=e.id,this._signType=e.sign}function h(t){return new f(t)}function p(t){return new l(t)}Object.keys(u).forEach((function(t){u[t].id=n.from(u[t].id,"hex"),u[t.toLowerCase()]=u[t]})),a(f,o.Writable),f.prototype._write=function(t,e,r){this._hash.update(t),r()},f.prototype.update=function(t,e){return"string"==typeof t&&(t=n.from(t,e)),this._hash.update(t),this},f.prototype.sign=function(t,e){this.end();var r=this._hash.digest(),n=s(r,t,this._hashType,this._signType,this._tag);return e?n.toString(e):n},a(l,o.Writable),l.prototype._write=function(t,e,r){this._hash.update(t),r()},l.prototype.update=function(t,e){return"string"==typeof t&&(t=n.from(t,e)),this._hash.update(t),this},l.prototype.verify=function(t,e,r){"string"==typeof e&&(e=n.from(e,r)),this.end();var i=this._hash.digest();return c(e,i,t,this._signType,this._tag)},t.exports={Sign:h,Verify:p,createSign:h,createVerify:p}},1437:(t,e,r)=>{var n=r(3173).Buffer,i=r(8736),o=r(4364),a=r(8333).ec,s=r(6781),c=r(2914),u=r(1308);function f(t,e,r,o){if((t=n.from(t.toArray())).length0&&r.ishrn(n),r}function h(t,e,r){var o,a;do{for(o=n.alloc(0);8*o.length{var n=r(3173).Buffer,i=r(6781),o=r(8333).ec,a=r(2914),s=r(1308);function c(t,e){if(t.cmpn(0)<=0)throw new Error("invalid sig");if(t.cmp(e)>=e)throw new Error("invalid sig")}t.exports=function(t,e,r,u,f){var l=a(r);if("ec"===l.type){if("ecdsa"!==u&&"ecdsa/rsa"!==u)throw new Error("wrong public key type");return function(t,e,r){var n=s[r.data.algorithm.curve.join(".")];if(!n)throw new Error("unknown curve "+r.data.algorithm.curve.join("."));var i=new o(n),a=r.data.subjectPrivateKey.data;return i.verify(e,t,a)}(t,e,l)}if("dsa"===l.type){if("dsa"!==u)throw new Error("wrong public key type");return function(t,e,r){var n=r.data.p,o=r.data.q,s=r.data.g,u=r.data.pub_key,f=a.signature.decode(t,"der"),l=f.s,h=f.r;c(l,o),c(h,o);var p=i.mont(n),d=l.invm(o);return 0===s.toRed(p).redPow(new i(e).mul(d).mod(o)).fromRed().mul(u.toRed(p).redPow(h.mul(d).mod(o)).fromRed()).mod(n).mod(o).cmp(h)}(t,e,l)}if("rsa"!==u&&"ecdsa/rsa"!==u)throw new Error("wrong public key type");e=n.concat([f,e]);for(var h=l.modulus.byteLength(),p=[1],d=0;e.length+p.length+2{var n=r(365),i=n.Buffer;function o(t,e){for(var r in t)e[r]=t[r]}function a(t,e,r){return i(t,e,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?t.exports=n:(o(n,e),e.Buffer=a),a.prototype=Object.create(i.prototype),o(i,a),a.from=function(t,e,r){if("number"==typeof t)throw new TypeError("Argument must not be a number");return i(t,e,r)},a.alloc=function(t,e,r){if("number"!=typeof t)throw new TypeError("Argument must be a number");var n=i(t);return void 0!==e?"string"==typeof r?n.fill(e,r):n.fill(e):n.fill(0),n},a.allocUnsafe=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return i(t)},a.allocUnsafeSlow=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return n.SlowBuffer(t)}},3873:(t,e,r)=>{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}r.d(e,{Decimal128:()=>it,Kb:()=>N,t4:()=>ht});for(var i=[],o=[],a="undefined"!=typeof Uint8Array?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",c=0,u=s.length;c0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function l(t,e,r){for(var n,o,a=[],s=e;s>18&63]+i[o>>12&63]+i[o>>6&63]+i[63&o]);return a.join("")}o["-".charCodeAt(0)]=62,o["_".charCodeAt(0)]=63;var h=function(t){var e,r,n=f(t),i=n[0],s=n[1],c=new a(function(t,e,r){return 3*(e+r)/4-r}(0,i,s)),u=0,l=s>0?i-4:i;for(r=0;r>16&255,c[u++]=e>>8&255,c[u++]=255&e;return 2===s&&(e=o[t.charCodeAt(r)]<<2|o[t.charCodeAt(r+1)]>>4,c[u++]=255&e),1===s&&(e=o[t.charCodeAt(r)]<<10|o[t.charCodeAt(r+1)]<<4|o[t.charCodeAt(r+2)]>>2,c[u++]=e>>8&255,c[u++]=255&e),c},p=function(t){for(var e,r=t.length,n=r%3,o=[],a=16383,s=0,c=r-n;sc?c:s+a));return 1===n?(e=t[r-1],o.push(i[e>>2]+i[e<<4&63]+"==")):2===n&&(e=(t[r-2]<<8)+t[r-1],o.push(i[e>>10]+i[e>>4&63]+i[e<<2&63]+"=")),o.join("")},d=function(t,e,r,n,i){var o,a,s=8*i-n-1,c=(1<>1,f=-7,l=r?i-1:0,h=r?-1:1,p=t[e+l];for(l+=h,o=p&(1<<-f)-1,p>>=-f,f+=s;f>0;o=256*o+t[e+l],l+=h,f-=8);for(a=o&(1<<-f)-1,o>>=-f,f+=n;f>0;a=256*a+t[e+l],l+=h,f-=8);if(0===o)o=1-u;else{if(o===c)return a?NaN:1/0*(p?-1:1);a+=Math.pow(2,n),o-=u}return(p?-1:1)*a*Math.pow(2,o-n)},y=function(t,e,r,n,i,o){var a,s,c,u=8*o-i-1,f=(1<>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:o-1,d=n?1:-1,y=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,a=f):(a=Math.floor(Math.log(e)/Math.LN2),e*(c=Math.pow(2,-a))<1&&(a--,c*=2),(e+=a+l>=1?h/c:h*Math.pow(2,1-l))*c>=2&&(a++,c/=2),a+l>=f?(s=0,a=f):a+l>=1?(s=(e*c-1)*Math.pow(2,i),a+=l):(s=e*Math.pow(2,l-1)*Math.pow(2,i),a=0));i>=8;t[r+p]=255&s,p+=d,s/=256,i-=8);for(a=a<0;t[r+p]=255&a,p+=d,a/=256,u-=8);t[r+p-d]|=128*y},b=function(t,e){return function(t,e){var r="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=o,e.SlowBuffer=function(t){return+t!=t&&(t=0),o.alloc(+t)},e.INSPECT_MAX_BYTES=50;var n=2147483647;function i(t){if(t>n)throw new RangeError('The value "'+t+'" is invalid for option "size"');var e=new Uint8Array(t);return Object.setPrototypeOf(e,o.prototype),e}function o(t,e,r){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return c(t)}return a(t,e,r)}function a(t,e,r){if("string"==typeof t)return function(t,e){if("string"==typeof e&&""!==e||(e="utf8"),!o.isEncoding(e))throw new TypeError("Unknown encoding: "+e);var r=0|b(t,e),n=i(r),a=n.write(t,e);return a!==r&&(n=n.slice(0,a)),n}(t,e);if(ArrayBuffer.isView(t))return function(t){if(F(t,Uint8Array)){var e=new Uint8Array(t);return f(e.buffer,e.byteOffset,e.byteLength)}return u(t)}(t);if(null==t)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+babelHelpers.typeof(t));if(F(t,ArrayBuffer)||t&&F(t.buffer,ArrayBuffer))return f(t,e,r);if("undefined"!=typeof SharedArrayBuffer&&(F(t,SharedArrayBuffer)||t&&F(t.buffer,SharedArrayBuffer)))return f(t,e,r);if("number"==typeof t)throw new TypeError('The "value" argument must not be of type number. Received type number');var n=t.valueOf&&t.valueOf();if(null!=n&&n!==t)return o.from(n,e,r);var a=function(t){if(o.isBuffer(t)){var e=0|l(t.length),r=i(e);return 0===r.length||t.copy(r,0,0,e),r}return void 0!==t.length?"number"!=typeof t.length||V(t.length)?i(0):u(t):"Buffer"===t.type&&Array.isArray(t.data)?u(t.data):void 0}(t);if(a)return a;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return o.from(t[Symbol.toPrimitive]("string"),e,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+babelHelpers.typeof(t))}function s(t){if("number"!=typeof t)throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function c(t){return s(t),i(t<0?0:0|l(t))}function u(t){for(var e=t.length<0?0:0|l(t.length),r=i(e),n=0;n=n)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+n.toString(16)+" bytes");return 0|t}function b(t,e){if(o.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||F(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+babelHelpers.typeof(t));var r=t.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;for(var i=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return U(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return L(t).length;default:if(i)return n?-1:U(t).length;e=(""+e).toLowerCase(),i=!0}}function m(t,e,r){var n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return M(this,e,r);case"utf8":case"utf-8":return $(this,e,r);case"ascii":return P(this,e,r);case"latin1":case"binary":return k(this,e,r);case"base64":return j(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return R(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function v(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function g(t,e,r,n,i){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),V(r=+r)&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof e&&(e=o.from(e,n)),o.isBuffer(e))return 0===e.length?-1:_(t,e,r,n,i);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):_(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function _(t,e,r,n,i){var o,a=1,s=t.length,c=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;a=2,s/=2,c/=2,r/=2}function u(t,e){return 1===a?t[e]:t.readUInt16BE(e*a)}if(i){var f=-1;for(o=r;os&&(r=s-c),o=r;o>=0;o--){for(var l=!0,h=0;hi&&(n=i):n=i;var o=e.length;n>o/2&&(n=o/2);for(var a=0;a>8,i=r%256,o.push(i),o.push(n);return o}(e,t.length-r),t,r,n)}function j(t,e,r){return 0===e&&r===t.length?p(t):p(t.slice(e,r))}function $(t,e,r){r=Math.min(t.length,r);for(var n=[],i=e;i239?4:u>223?3:u>191?2:1;if(i+l<=r)switch(l){case 1:u<128&&(f=u);break;case 2:128==(192&(o=t[i+1]))&&(c=(31&u)<<6|63&o)>127&&(f=c);break;case 3:o=t[i+1],a=t[i+2],128==(192&o)&&128==(192&a)&&(c=(15&u)<<12|(63&o)<<6|63&a)>2047&&(c<55296||c>57343)&&(f=c);break;case 4:o=t[i+1],a=t[i+2],s=t[i+3],128==(192&o)&&128==(192&a)&&128==(192&s)&&(c=(15&u)<<18|(63&o)<<12|(63&a)<<6|63&s)>65535&&c<1114112&&(f=c)}null===f?(f=65533,l=1):f>65535&&(f-=65536,n.push(f>>>10&1023|55296),f=56320|1023&f),n.push(f),i+=l}return function(t){var e=t.length;if(e<=x)return String.fromCharCode.apply(String,t);for(var r="",n=0;nn.length?o.from(a).copy(n,i):Uint8Array.prototype.set.call(n,a,i);else{if(!o.isBuffer(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(n,i)}i+=a.length}return n},o.byteLength=b,o.prototype._isBuffer=!0,o.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;er&&(t+=" ... "),""},r&&(o.prototype[r]=o.prototype.inspect),o.prototype.compare=function(t,e,r,n,i){if(F(t,Uint8Array)&&(t=o.from(t,t.offset,t.byteLength)),!o.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+babelHelpers.typeof(t));if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),e<0||r>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&e>=r)return 0;if(n>=i)return-1;if(e>=r)return 1;if(this===t)return 0;for(var a=(i>>>=0)-(n>>>=0),s=(r>>>=0)-(e>>>=0),c=Math.min(a,s),u=this.slice(n,i),f=t.slice(e,r),l=0;l>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-e;if((void 0===r||r>i)&&(r=i),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return w(this,t,e,r);case"utf8":case"utf-8":return S(this,t,e,r);case"ascii":case"latin1":case"binary":return O(this,t,e,r);case"base64":return A(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E(this,t,e,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},o.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var x=4096;function P(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;in)&&(r=n);for(var i="",o=e;or)throw new RangeError("Trying to access beyond buffer length")}function B(t,e,r,n,i,a){if(!o.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||et.length)throw new RangeError("Index out of range")}function T(t,e,r,n,i,o){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function N(t,e,r,n,i){return e=+e,r>>>=0,i||T(t,0,r,4),y(t,e,r,n,23,4),r+4}function D(t,e,r,n,i){return e=+e,r>>>=0,i||T(t,0,r,8),y(t,e,r,n,52,8),r+8}o.prototype.slice=function(t,e){var r=this.length;(t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e>>=0,e>>>=0,r||I(t,e,this.length);for(var n=this[t],i=1,o=0;++o>>=0,e>>>=0,r||I(t,e,this.length);for(var n=this[t+--e],i=1;e>0&&(i*=256);)n+=this[t+--e]*i;return n},o.prototype.readUint8=o.prototype.readUInt8=function(t,e){return t>>>=0,e||I(t,1,this.length),this[t]},o.prototype.readUint16LE=o.prototype.readUInt16LE=function(t,e){return t>>>=0,e||I(t,2,this.length),this[t]|this[t+1]<<8},o.prototype.readUint16BE=o.prototype.readUInt16BE=function(t,e){return t>>>=0,e||I(t,2,this.length),this[t]<<8|this[t+1]},o.prototype.readUint32LE=o.prototype.readUInt32LE=function(t,e){return t>>>=0,e||I(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},o.prototype.readUint32BE=o.prototype.readUInt32BE=function(t,e){return t>>>=0,e||I(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},o.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||I(t,e,this.length);for(var n=this[t],i=1,o=0;++o=(i*=128)&&(n-=Math.pow(2,8*e)),n},o.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||I(t,e,this.length);for(var n=e,i=1,o=this[t+--n];n>0&&(i*=256);)o+=this[t+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*e)),o},o.prototype.readInt8=function(t,e){return t>>>=0,e||I(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},o.prototype.readInt16LE=function(t,e){t>>>=0,e||I(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},o.prototype.readInt16BE=function(t,e){t>>>=0,e||I(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},o.prototype.readInt32LE=function(t,e){return t>>>=0,e||I(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},o.prototype.readInt32BE=function(t,e){return t>>>=0,e||I(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},o.prototype.readFloatLE=function(t,e){return t>>>=0,e||I(t,4,this.length),d(this,t,!0,23,4)},o.prototype.readFloatBE=function(t,e){return t>>>=0,e||I(t,4,this.length),d(this,t,!1,23,4)},o.prototype.readDoubleLE=function(t,e){return t>>>=0,e||I(t,8,this.length),d(this,t,!0,52,8)},o.prototype.readDoubleBE=function(t,e){return t>>>=0,e||I(t,8,this.length),d(this,t,!1,52,8)},o.prototype.writeUintLE=o.prototype.writeUIntLE=function(t,e,r,n){t=+t,e>>>=0,r>>>=0,n||B(this,t,e,r,Math.pow(2,8*r)-1,0);var i=1,o=0;for(this[e]=255&t;++o>>=0,r>>>=0,n||B(this,t,e,r,Math.pow(2,8*r)-1,0);var i=r-1,o=1;for(this[e+i]=255&t;--i>=0&&(o*=256);)this[e+i]=t/o&255;return e+r},o.prototype.writeUint8=o.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||B(this,t,e,1,255,0),this[e]=255&t,e+1},o.prototype.writeUint16LE=o.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||B(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},o.prototype.writeUint16BE=o.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||B(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},o.prototype.writeUint32LE=o.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||B(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},o.prototype.writeUint32BE=o.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||B(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},o.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var i=Math.pow(2,8*r-1);B(this,t,e,r,i-1,-i)}var o=0,a=1,s=0;for(this[e]=255&t;++o>0)-s&255;return e+r},o.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var i=Math.pow(2,8*r-1);B(this,t,e,r,i-1,-i)}var o=r-1,a=1,s=0;for(this[e+o]=255&t;--o>=0&&(a*=256);)t<0&&0===s&&0!==this[e+o+1]&&(s=1),this[e+o]=(t/a>>0)-s&255;return e+r},o.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||B(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},o.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||B(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},o.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||B(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},o.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||B(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},o.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||B(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},o.prototype.writeFloatLE=function(t,e,r){return N(this,t,e,!0,r)},o.prototype.writeFloatBE=function(t,e,r){return N(this,t,e,!1,r)},o.prototype.writeDoubleLE=function(t,e,r){return D(this,t,e,!0,r)},o.prototype.writeDoubleBE=function(t,e,r){return D(this,t,e,!1,r)},o.prototype.copy=function(t,e,r,n){if(!o.isBuffer(t))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(a=e;a55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(a+1===n){(e-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function L(t){return h(function(t){if((t=(t=t.split("=")[0]).trim().replace(C,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function q(t,e,r,n){for(var i=0;i=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function F(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function V(t){return t!=t}var z=function(){for(var t="0123456789abcdef",e=new Array(256),r=0;r<16;++r)for(var n=16*r,i=0;i<16;++i)e[n+i]=t[r]+t[i];return e}()}(e={exports:{}},e.exports),e.exports}(),m=b.Buffer;b.SlowBuffer,b.INSPECT_MAX_BYTES,b.kMaxLength;var v=function(t,e){return v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},v(t,e)};function g(t,e){function r(){this.constructor=t}v(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}var _=function(t){function e(r){var n=t.call(this,r)||this;return Object.setPrototypeOf(n,e.prototype),n}return g(e,t),Object.defineProperty(e.prototype,"name",{get:function(){return"BSONError"},enumerable:!1,configurable:!0}),e}(Error),w=function(t){function e(r){var n=t.call(this,r)||this;return Object.setPrototypeOf(n,e.prototype),n}return g(e,t),Object.defineProperty(e.prototype,"name",{get:function(){return"BSONTypeError"},enumerable:!1,configurable:!0}),e}(TypeError);function S(t){return t&&t.Math==Math&&t}function O(){return S("object"===("undefined"==typeof globalThis?"undefined":n(globalThis))&&globalThis)||S("object"===("undefined"==typeof window?"undefined":n(window))&&window)||S("object"===("undefined"==typeof self?"undefined":n(self))&&self)||S("object"===(void 0===r.g?"undefined":n(r.g))&&r.g)||Function("return this")()}var A=function(t){var e,r="object"===n((e=O()).navigator)&&"ReactNative"===e.navigator.product?"BSON: For React Native please polyfill crypto.getRandomValues, e.g. using: https://www.npmjs.com/package/react-native-get-random-values.":"BSON: No cryptographic implementation for random bytes present, falling back to a less secure implementation.";console.warn(r);for(var i=m.alloc(t),o=0;o");this.sub_type=null!=r?r:t.BSON_BINARY_SUBTYPE_DEFAULT,null==e?(this.buffer=m.alloc(t.BUFFER_SIZE),this.position=0):("string"==typeof e?this.buffer=m.from(e,"binary"):Array.isArray(e)?this.buffer=m.from(e):this.buffer=P(e),this.position=this.buffer.byteLength)}return t.prototype.put=function(e){if("string"==typeof e&&1!==e.length)throw new w("only accepts single character String");if("number"!=typeof e&&1!==e.length)throw new w("only accepts single character Uint8Array or Array");var r;if((r="string"==typeof e?e.charCodeAt(0):"number"==typeof e?e:e[0])<0||r>255)throw new w("only accepts number in a valid unsigned byte range 0-255");if(this.buffer.length>this.position)this.buffer[this.position++]=r;else{var n=m.alloc(t.BUFFER_SIZE+this.buffer.length);this.buffer.copy(n,0,0,this.buffer.length),this.buffer=n,this.buffer[this.position++]=r}},t.prototype.write=function(t,e){if(e="number"==typeof e?e:this.position,this.buffer.lengththis.position?e+t.length:this.position):"string"==typeof t&&(this.buffer.write(t,e,t.length,"binary"),this.position=e+t.length>this.position?e+t.length:this.position)},t.prototype.read=function(t,e){return e=e&&e>0?e:this.position,this.buffer.slice(t,t+e)},t.prototype.value=function(t){return(t=!!t)&&this.buffer.length===this.position?this.buffer:t?this.buffer.slice(0,this.position):this.buffer.toString("binary",0,this.position)},t.prototype.length=function(){return this.position},t.prototype.toJSON=function(){return this.buffer.toString("base64")},t.prototype.toString=function(t){return this.buffer.toString(t)},t.prototype.toExtendedJSON=function(t){t=t||{};var e=this.buffer.toString("base64"),r=Number(this.sub_type).toString(16);return t.legacy?{$binary:e,$type:1===r.length?"0"+r:r}:{$binary:{base64:e,subType:1===r.length?"0"+r:r}}},t.prototype.toUUID=function(){if(this.sub_type===t.SUBTYPE_UUID)return new T(this.buffer.slice(0,this.position));throw new _('Binary sub_type "'+this.sub_type+'" is not supported for converting to UUID. Only "'+t.SUBTYPE_UUID+'" is currently supported.')},t.fromExtendedJSON=function(e,r){var n,i;if(r=r||{},"$binary"in e?r.legacy&&"string"==typeof e.$binary&&"$type"in e?(i=e.$type?parseInt(e.$type,16):0,n=m.from(e.$binary,"base64")):"string"!=typeof e.$binary&&(i=e.$binary.subType?parseInt(e.$binary.subType,16):0,n=m.from(e.$binary.base64,"base64")):"$uuid"in e&&(i=4,n=R(e.$uuid)),!n)throw new w("Unexpected Binary Extended JSON format "+JSON.stringify(e));return new t(n,i)},t.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},t.prototype.inspect=function(){return'new Binary(Buffer.from("'+this.value(!0).toString("hex")+'", "hex"), '+this.sub_type+")"},t.BSON_BINARY_SUBTYPE_DEFAULT=0,t.BUFFER_SIZE=256,t.SUBTYPE_DEFAULT=0,t.SUBTYPE_FUNCTION=1,t.SUBTYPE_BYTE_ARRAY=2,t.SUBTYPE_UUID_OLD=3,t.SUBTYPE_UUID=4,t.SUBTYPE_MD5=5,t.SUBTYPE_ENCRYPTED=6,t.SUBTYPE_COLUMN=7,t.SUBTYPE_USER_DEFINED=128,t}();Object.defineProperty(N.prototype,"_bsontype",{value:"Binary"});var D=function(){function t(e,r){if(!(this instanceof t))return new t(e,r);this.code=e,this.scope=r}return t.prototype.toJSON=function(){return{code:this.code,scope:this.scope}},t.prototype.toExtendedJSON=function(){return this.scope?{$code:this.code,$scope:this.scope}:{$code:this.code}},t.fromExtendedJSON=function(e){return new t(e.$code,e.$scope)},t.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},t.prototype.inspect=function(){var t=this.toJSON();return'new Code("'+t.code+'"'+(t.scope?", "+JSON.stringify(t.scope):"")+")"},t}();Object.defineProperty(D.prototype,"_bsontype",{value:"Code"});var C=function(){function t(e,r,n,i){if(!(this instanceof t))return new t(e,r,n,i);var o=e.split(".");2===o.length&&(n=o.shift(),e=o.shift()),this.collection=e,this.oid=r,this.db=n,this.fields=i||{}}return Object.defineProperty(t.prototype,"namespace",{get:function(){return this.collection},set:function(t){this.collection=t},enumerable:!1,configurable:!0}),t.prototype.toJSON=function(){var t=Object.assign({$ref:this.collection,$id:this.oid},this.fields);return null!=this.db&&(t.$db=this.db),t},t.prototype.toExtendedJSON=function(t){t=t||{};var e={$ref:this.collection,$id:this.oid};return t.legacy?e:(this.db&&(e.$db=this.db),e=Object.assign(e,this.fields))},t.fromExtendedJSON=function(e){var r=Object.assign({},e);return delete r.$ref,delete r.$id,delete r.$db,new t(e.$ref,e.$id,e.$db,r)},t.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},t.prototype.inspect=function(){var t=void 0===this.oid||void 0===this.oid.toString?this.oid:this.oid.toString();return'new DBRef("'+this.namespace+'", new ObjectId("'+t+'")'+(this.db?', "'+this.db+'"':"")+")"},t}();Object.defineProperty(C.prototype,"_bsontype",{value:"DBRef"});var U=void 0;try{U=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch(t){}var L=4294967296,q=0x10000000000000000,F=q/2,V={},z={},K=function(){function t(e,r,n){if(void 0===e&&(e=0),!(this instanceof t))return new t(e,r,n);"bigint"==typeof e?Object.assign(this,t.fromBigInt(e,!!r)):"string"==typeof e?Object.assign(this,t.fromString(e,!!r)):(this.low=0|e,this.high=0|r,this.unsigned=!!n),Object.defineProperty(this,"__isLong__",{value:!0,configurable:!1,writable:!1,enumerable:!1})}return t.fromBits=function(e,r,n){return new t(e,r,n)},t.fromInt=function(e,r){var n,i,o;return r?(o=0<=(e>>>=0)&&e<256)&&(i=z[e])?i:(n=t.fromBits(e,(0|e)<0?-1:0,!0),o&&(z[e]=n),n):(o=-128<=(e|=0)&&e<128)&&(i=V[e])?i:(n=t.fromBits(e,e<0?-1:0,!1),o&&(V[e]=n),n)},t.fromNumber=function(e,r){if(isNaN(e))return r?t.UZERO:t.ZERO;if(r){if(e<0)return t.UZERO;if(e>=q)return t.MAX_UNSIGNED_VALUE}else{if(e<=-F)return t.MIN_VALUE;if(e+1>=F)return t.MAX_VALUE}return e<0?t.fromNumber(-e,r).neg():t.fromBits(e%L|0,e/L|0,r)},t.fromBigInt=function(e,r){return t.fromString(e.toString(),r)},t.fromString=function(e,r,n){if(0===e.length)throw Error("empty string");if("NaN"===e||"Infinity"===e||"+Infinity"===e||"-Infinity"===e)return t.ZERO;if("number"==typeof r?(n=r,r=!1):r=!!r,(n=n||10)<2||360)throw Error("interior hyphen");if(0===i)return t.fromString(e.substring(1),r,n).neg();for(var o=t.fromNumber(Math.pow(n,8)),a=t.ZERO,s=0;s>>16,n=65535&this.high,i=this.low>>>16,o=65535&this.low,a=e.high>>>16,s=65535&e.high,c=e.low>>>16,u=0,f=0,l=0,h=0;return l+=(h+=o+(65535&e.low))>>>16,h&=65535,f+=(l+=i+c)>>>16,l&=65535,u+=(f+=n+s)>>>16,f&=65535,u+=r+a,u&=65535,t.fromBits(l<<16|h,u<<16|f,this.unsigned)},t.prototype.and=function(e){return t.isLong(e)||(e=t.fromValue(e)),t.fromBits(this.low&e.low,this.high&e.high,this.unsigned)},t.prototype.compare=function(e){if(t.isLong(e)||(e=t.fromValue(e)),this.eq(e))return 0;var r=this.isNegative(),n=e.isNegative();return r&&!n?-1:!r&&n?1:this.unsigned?e.high>>>0>this.high>>>0||e.high===this.high&&e.low>>>0>this.low>>>0?-1:1:this.sub(e).isNegative()?-1:1},t.prototype.comp=function(t){return this.compare(t)},t.prototype.divide=function(e){if(t.isLong(e)||(e=t.fromValue(e)),e.isZero())throw Error("division by zero");if(U){if(!this.unsigned&&-2147483648===this.high&&-1===e.low&&-1===e.high)return this;var r=(this.unsigned?U.div_u:U.div_s)(this.low,this.high,e.low,e.high);return t.fromBits(r,U.get_high(),this.unsigned)}if(this.isZero())return this.unsigned?t.UZERO:t.ZERO;var n,i,o;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return t.UZERO;if(e.gt(this.shru(1)))return t.UONE;o=t.UZERO}else{if(this.eq(t.MIN_VALUE))return e.eq(t.ONE)||e.eq(t.NEG_ONE)?t.MIN_VALUE:e.eq(t.MIN_VALUE)?t.ONE:(n=this.shr(1).div(e).shl(1)).eq(t.ZERO)?e.isNegative()?t.ONE:t.NEG_ONE:(i=this.sub(e.mul(n)),o=n.add(i.div(e)));if(e.eq(t.MIN_VALUE))return this.unsigned?t.UZERO:t.ZERO;if(this.isNegative())return e.isNegative()?this.neg().div(e.neg()):this.neg().div(e).neg();if(e.isNegative())return this.div(e.neg()).neg();o=t.ZERO}for(i=this;i.gte(e);){n=Math.max(1,Math.floor(i.toNumber()/e.toNumber()));for(var a=Math.ceil(Math.log(n)/Math.LN2),s=a<=48?1:Math.pow(2,a-48),c=t.fromNumber(n),u=c.mul(e);u.isNegative()||u.gt(i);)n-=s,u=(c=t.fromNumber(n,this.unsigned)).mul(e);c.isZero()&&(c=t.ONE),o=o.add(c),i=i.sub(u)}return o},t.prototype.div=function(t){return this.divide(t)},t.prototype.equals=function(e){return t.isLong(e)||(e=t.fromValue(e)),(this.unsigned===e.unsigned||this.high>>>31!=1||e.high>>>31!=1)&&this.high===e.high&&this.low===e.low},t.prototype.eq=function(t){return this.equals(t)},t.prototype.getHighBits=function(){return this.high},t.prototype.getHighBitsUnsigned=function(){return this.high>>>0},t.prototype.getLowBits=function(){return this.low},t.prototype.getLowBitsUnsigned=function(){return this.low>>>0},t.prototype.getNumBitsAbs=function(){if(this.isNegative())return this.eq(t.MIN_VALUE)?64:this.neg().getNumBitsAbs();var e,r=0!==this.high?this.high:this.low;for(e=31;e>0&&0==(r&1<0},t.prototype.gt=function(t){return this.greaterThan(t)},t.prototype.greaterThanOrEqual=function(t){return this.comp(t)>=0},t.prototype.gte=function(t){return this.greaterThanOrEqual(t)},t.prototype.ge=function(t){return this.greaterThanOrEqual(t)},t.prototype.isEven=function(){return 0==(1&this.low)},t.prototype.isNegative=function(){return!this.unsigned&&this.high<0},t.prototype.isOdd=function(){return 1==(1&this.low)},t.prototype.isPositive=function(){return this.unsigned||this.high>=0},t.prototype.isZero=function(){return 0===this.high&&0===this.low},t.prototype.lessThan=function(t){return this.comp(t)<0},t.prototype.lt=function(t){return this.lessThan(t)},t.prototype.lessThanOrEqual=function(t){return this.comp(t)<=0},t.prototype.lte=function(t){return this.lessThanOrEqual(t)},t.prototype.modulo=function(e){if(t.isLong(e)||(e=t.fromValue(e)),U){var r=(this.unsigned?U.rem_u:U.rem_s)(this.low,this.high,e.low,e.high);return t.fromBits(r,U.get_high(),this.unsigned)}return this.sub(this.div(e).mul(e))},t.prototype.mod=function(t){return this.modulo(t)},t.prototype.rem=function(t){return this.modulo(t)},t.prototype.multiply=function(e){if(this.isZero())return t.ZERO;if(t.isLong(e)||(e=t.fromValue(e)),U){var r=U.mul(this.low,this.high,e.low,e.high);return t.fromBits(r,U.get_high(),this.unsigned)}if(e.isZero())return t.ZERO;if(this.eq(t.MIN_VALUE))return e.isOdd()?t.MIN_VALUE:t.ZERO;if(e.eq(t.MIN_VALUE))return this.isOdd()?t.MIN_VALUE:t.ZERO;if(this.isNegative())return e.isNegative()?this.neg().mul(e.neg()):this.neg().mul(e).neg();if(e.isNegative())return this.mul(e.neg()).neg();if(this.lt(t.TWO_PWR_24)&&e.lt(t.TWO_PWR_24))return t.fromNumber(this.toNumber()*e.toNumber(),this.unsigned);var n=this.high>>>16,i=65535&this.high,o=this.low>>>16,a=65535&this.low,s=e.high>>>16,c=65535&e.high,u=e.low>>>16,f=65535&e.low,l=0,h=0,p=0,d=0;return p+=(d+=a*f)>>>16,d&=65535,h+=(p+=o*f)>>>16,p&=65535,h+=(p+=a*u)>>>16,p&=65535,l+=(h+=i*f)>>>16,h&=65535,l+=(h+=o*u)>>>16,h&=65535,l+=(h+=a*c)>>>16,h&=65535,l+=n*f+i*u+o*c+a*s,l&=65535,t.fromBits(p<<16|d,l<<16|h,this.unsigned)},t.prototype.mul=function(t){return this.multiply(t)},t.prototype.negate=function(){return!this.unsigned&&this.eq(t.MIN_VALUE)?t.MIN_VALUE:this.not().add(t.ONE)},t.prototype.neg=function(){return this.negate()},t.prototype.not=function(){return t.fromBits(~this.low,~this.high,this.unsigned)},t.prototype.notEquals=function(t){return!this.equals(t)},t.prototype.neq=function(t){return this.notEquals(t)},t.prototype.ne=function(t){return this.notEquals(t)},t.prototype.or=function(e){return t.isLong(e)||(e=t.fromValue(e)),t.fromBits(this.low|e.low,this.high|e.high,this.unsigned)},t.prototype.shiftLeft=function(e){return t.isLong(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?t.fromBits(this.low<>>32-e,this.unsigned):t.fromBits(0,this.low<>>e|this.high<<32-e,this.high>>e,this.unsigned):t.fromBits(this.high>>e-32,this.high>=0?0:-1,this.unsigned)},t.prototype.shr=function(t){return this.shiftRight(t)},t.prototype.shiftRightUnsigned=function(e){if(t.isLong(e)&&(e=e.toInt()),0==(e&=63))return this;var r=this.high;if(e<32){var n=this.low;return t.fromBits(n>>>e|r<<32-e,r>>>e,this.unsigned)}return 32===e?t.fromBits(r,0,this.unsigned):t.fromBits(r>>>e-32,0,this.unsigned)},t.prototype.shr_u=function(t){return this.shiftRightUnsigned(t)},t.prototype.shru=function(t){return this.shiftRightUnsigned(t)},t.prototype.subtract=function(e){return t.isLong(e)||(e=t.fromValue(e)),this.add(e.neg())},t.prototype.sub=function(t){return this.subtract(t)},t.prototype.toInt=function(){return this.unsigned?this.low>>>0:this.low},t.prototype.toNumber=function(){return this.unsigned?(this.high>>>0)*L+(this.low>>>0):this.high*L+(this.low>>>0)},t.prototype.toBigInt=function(){return BigInt(this.toString())},t.prototype.toBytes=function(t){return t?this.toBytesLE():this.toBytesBE()},t.prototype.toBytesLE=function(){var t=this.high,e=this.low;return[255&e,e>>>8&255,e>>>16&255,e>>>24,255&t,t>>>8&255,t>>>16&255,t>>>24]},t.prototype.toBytesBE=function(){var t=this.high,e=this.low;return[t>>>24,t>>>16&255,t>>>8&255,255&t,e>>>24,e>>>16&255,e>>>8&255,255&e]},t.prototype.toSigned=function(){return this.unsigned?t.fromBits(this.low,this.high,!1):this},t.prototype.toString=function(e){if((e=e||10)<2||36>>0).toString(e);if((a=c).isZero())return u+s;for(;u.length<6;)u="0"+u;s=""+u+s}},t.prototype.toUnsigned=function(){return this.unsigned?this:t.fromBits(this.low,this.high,!0)},t.prototype.xor=function(e){return t.isLong(e)||(e=t.fromValue(e)),t.fromBits(this.low^e.low,this.high^e.high,this.unsigned)},t.prototype.eqz=function(){return this.isZero()},t.prototype.le=function(t){return this.lessThanOrEqual(t)},t.prototype.toExtendedJSON=function(t){return t&&t.relaxed?this.toNumber():{$numberLong:this.toString()}},t.fromExtendedJSON=function(e,r){var n=t.fromString(e.$numberLong);return r&&r.relaxed?n.toNumber():n},t.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},t.prototype.inspect=function(){return'new Long("'+this.toString()+'"'+(this.unsigned?", true":"")+")"},t.TWO_PWR_24=t.fromInt(16777216),t.MAX_UNSIGNED_VALUE=t.fromBits(-1,-1,!0),t.ZERO=t.fromInt(0),t.UZERO=t.fromInt(0,!0),t.ONE=t.fromInt(1),t.UONE=t.fromInt(1,!0),t.NEG_ONE=t.fromInt(-1),t.MAX_VALUE=t.fromBits(-1,2147483647,!1),t.MIN_VALUE=t.fromBits(0,-2147483648,!1),t}();Object.defineProperty(K.prototype,"__isLong__",{value:!0}),Object.defineProperty(K.prototype,"_bsontype",{value:"Long"});var W=/^(\+|-)?(\d+|(\d*\.\d*))?(E|e)?([-+])?(\d+)?$/,H=/^(\+|-)?(Infinity|inf)$/i,J=/^(\+|-)?NaN$/i,G=6111,Y=-6176,Q=[124,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0].reverse(),X=[248,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0].reverse(),Z=[120,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0].reverse(),tt=/^([-+])?(\d+)?$/;function et(t){return!isNaN(parseInt(t,10))}function rt(t){var e=K.fromNumber(1e9),r=K.fromNumber(0);if(!(t.parts[0]||t.parts[1]||t.parts[2]||t.parts[3]))return{quotient:t,rem:r};for(var n=0;n<=3;n++)r=(r=r.shiftLeft(32)).add(new K(t.parts[n],0)),t.parts[n]=r.div(e).low,r=r.modulo(e);return{quotient:t,rem:r}}function nt(t,e){throw new w('"'+t+'" is not a valid Decimal128 string - '+e)}var it=function(){function t(e){if(!(this instanceof t))return new t(e);if("string"==typeof e)this.bytes=t.fromString(e).bytes;else{if(!j(e))throw new w("Decimal128 must take a Buffer or string");if(16!==e.byteLength)throw new w("Decimal128 must take a Buffer of 16 bytes");this.bytes=e}}return t.fromString=function(e){var r,n=!1,i=!1,o=!1,a=0,s=0,c=0,u=0,f=0,l=[0],h=0,p=0,d=0,y=0,b=0,v=0,g=new K(0,0),_=new K(0,0),S=0;if(e.length>=7e3)throw new w(e+" not a valid Decimal128 string");var O=e.match(W),A=e.match(H),E=e.match(J);if(!O&&!A&&!E||0===e.length)throw new w(e+" not a valid Decimal128 string");if(O){var j=O[2],$=O[4],x=O[5],P=O[6];$&&void 0===P&&nt(e,"missing exponent power"),$&&void 0===j&&nt(e,"missing exponent base"),void 0===$&&(x||P)&&nt(e,"missing e before exponent")}if("+"!==e[S]&&"-"!==e[S]||(n="-"===e[S++]),!et(e[S])&&"."!==e[S]){if("i"===e[S]||"I"===e[S])return new t(m.from(n?X:Z));if("N"===e[S])return new t(m.from(Q))}for(;et(e[S])||"."===e[S];)"."!==e[S]?(h<34&&("0"!==e[S]||o)&&(o||(f=s),o=!0,l[p++]=parseInt(e[S],10),h+=1),o&&(c+=1),i&&(u+=1),s+=1,S+=1):(i&&nt(e,"contains multiple periods"),i=!0,S+=1);if(i&&!s)throw new w(e+" not a valid Decimal128 string");if("e"===e[S]||"E"===e[S]){var k=e.substr(++S).match(tt);if(!k||!k[2])return new t(m.from(Q));b=parseInt(k[0],10),S+=k[0].length}if(e[S])return new t(m.from(Q));if(d=0,h){if(y=h-1,1!==(a=c))for(;0===l[f+a-1];)a-=1}else d=0,y=0,l[0]=0,c=1,h=1,a=0;for(b<=u&&u-b>16384?b=Y:b-=u;b>G;){if((y+=1)-d>34){if(l.join("").match(/^0+$/)){b=G;break}nt(e,"overflow")}b-=1}for(;b=5&&(I=1,5===R))for(I=l[y]%2==1?1:0,v=f+y+2;v=0;B--)if(++l[B]>9&&(l[B]=0,0===B)){if(!(b>>0)<(C=N.high>>>0)||D===C&&T.low>>>0>>0)&&(U.high=U.high.add(K.fromNumber(1))),r=b+6176;var L={low:K.fromNumber(0),high:K.fromNumber(0)};U.high.shiftRightUnsigned(49).and(K.fromNumber(1)).equals(K.fromNumber(1))?(L.high=L.high.or(K.fromNumber(3).shiftLeft(61)),L.high=L.high.or(K.fromNumber(r).and(K.fromNumber(16383).shiftLeft(47))),L.high=L.high.or(U.high.and(K.fromNumber(0x7fffffffffff)))):(L.high=L.high.or(K.fromNumber(16383&r).shiftLeft(49)),L.high=L.high.or(U.high.and(K.fromNumber(562949953421311)))),L.low=U.low,n&&(L.high=L.high.or(K.fromString("9223372036854775808")));var q=m.alloc(16);return S=0,q[S++]=255&L.low.low,q[S++]=L.low.low>>8&255,q[S++]=L.low.low>>16&255,q[S++]=L.low.low>>24&255,q[S++]=255&L.low.high,q[S++]=L.low.high>>8&255,q[S++]=L.low.high>>16&255,q[S++]=L.low.high>>24&255,q[S++]=255&L.high.low,q[S++]=L.high.low>>8&255,q[S++]=L.high.low>>16&255,q[S++]=L.high.low>>24&255,q[S++]=255&L.high.high,q[S++]=L.high.high>>8&255,q[S++]=L.high.high>>16&255,q[S++]=L.high.high>>24&255,new t(q)},t.prototype.toString=function(){for(var t,e=0,r=new Array(36),n=0;n>26&31;if(b>>3==3){if(30===b)return f.join("")+"Infinity";if(31===b)return"NaN";t=y>>15&16383,i=8+(y>>14&1)}else i=y>>14&7,t=y>>17&16383;var m=t-6176;if(u.parts[0]=(16383&y)+((15&i)<<14),u.parts[1]=d,u.parts[2]=p,u.parts[3]=h,0===u.parts[0]&&0===u.parts[1]&&0===u.parts[2]&&0===u.parts[3])c=!0;else for(a=3;a>=0;a--){var v=0,g=rt(u);if(u=g.quotient,v=g.rem.low)for(o=8;o>=0;o--)r[9*a+o]=v%10,v=Math.floor(v/10)}if(c)e=1,r[s]=0;else for(e=36;!r[s];)e-=1,s+=1;var _=e-1+m;if(_>=34||_<=-7||m>0){if(e>34)return f.push("0"),m>0?f.push("E+"+m):m<0&&f.push("E"+m),f.join("");for(f.push(""+r[s++]),(e-=1)&&f.push("."),n=0;n0?f.push("+"+_):f.push(""+_)}else if(m>=0)for(n=0;n0)for(n=0;n=13&&(e=this.value.toExponential(13).toUpperCase()):e=this.value.toString(),{$numberDouble:e});var e},t.fromExtendedJSON=function(e,r){var n=parseFloat(e.$numberDouble);return r&&r.relaxed?n:new t(n)},t.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},t.prototype.inspect=function(){return"new Double("+this.toExtendedJSON().$numberDouble+")"},t}();Object.defineProperty(ot.prototype,"_bsontype",{value:"Double"});var at=function(){function t(e){if(!(this instanceof t))return new t(e);e instanceof Number&&(e=e.valueOf()),this.value=0|+e}return t.prototype.valueOf=function(){return this.value},t.prototype.toString=function(t){return this.value.toString(t)},t.prototype.toJSON=function(){return this.value},t.prototype.toExtendedJSON=function(t){return t&&(t.relaxed||t.legacy)?this.value:{$numberInt:this.value.toString()}},t.fromExtendedJSON=function(e,r){return r&&r.relaxed?parseInt(e.$numberInt,10):new t(e.$numberInt)},t.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},t.prototype.inspect=function(){return"new Int32("+this.valueOf()+")"},t}();Object.defineProperty(at.prototype,"_bsontype",{value:"Int32"});var st=function(){function t(){if(!(this instanceof t))return new t}return t.prototype.toExtendedJSON=function(){return{$maxKey:1}},t.fromExtendedJSON=function(){return new t},t.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},t.prototype.inspect=function(){return"new MaxKey()"},t}();Object.defineProperty(st.prototype,"_bsontype",{value:"MaxKey"});var ct=function(){function t(){if(!(this instanceof t))return new t}return t.prototype.toExtendedJSON=function(){return{$minKey:1}},t.fromExtendedJSON=function(){return new t},t.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},t.prototype.inspect=function(){return"new MinKey()"},t}();Object.defineProperty(ct.prototype,"_bsontype",{value:"MinKey"});var ut=new RegExp("^[0-9a-fA-F]{24}$"),ft=null,lt=Symbol("id"),ht=function(){function t(e){if(!(this instanceof t))return new t(e);var r;if("object"===n(e)&&e&&"id"in e){if("string"!=typeof e.id&&!ArrayBuffer.isView(e.id))throw new w("Argument passed in must have an id that is of type string or Buffer");r="toHexString"in e&&"function"==typeof e.toHexString?m.from(e.toHexString(),"hex"):e.id}else r=e;if(null==r||"number"==typeof r)this[lt]=t.generate("number"==typeof r?r:void 0);else if(ArrayBuffer.isView(r)&&12===r.byteLength)this[lt]=r instanceof m?r:P(r);else{if("string"!=typeof r)throw new w("Argument passed in does not match the accepted types");if(12===r.length){var i=m.from(r);if(12!==i.byteLength)throw new w("Argument passed in must be a string of 12 bytes");this[lt]=i}else{if(24!==r.length||!ut.test(r))throw new w("Argument passed in must be a string of 12 bytes or a string of 24 hex characters or an integer");this[lt]=m.from(r,"hex")}}t.cacheHexString&&(this.__id=this.id.toString("hex"))}return Object.defineProperty(t.prototype,"id",{get:function(){return this[lt]},set:function(e){this[lt]=e,t.cacheHexString&&(this.__id=e.toString("hex"))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"generationTime",{get:function(){return this.id.readInt32BE(0)},set:function(t){this.id.writeUInt32BE(t,0)},enumerable:!1,configurable:!0}),t.prototype.toHexString=function(){if(t.cacheHexString&&this.__id)return this.__id;var e=this.id.toString("hex");return t.cacheHexString&&!this.__id&&(this.__id=e),e},t.getInc=function(){return t.index=(t.index+1)%16777215},t.generate=function(e){"number"!=typeof e&&(e=Math.floor(Date.now()/1e3));var r=t.getInc(),n=m.alloc(12);return n.writeUInt32BE(e,0),null===ft&&(ft=E(5)),n[4]=ft[0],n[5]=ft[1],n[6]=ft[2],n[7]=ft[3],n[8]=ft[4],n[11]=255&r,n[10]=r>>8&255,n[9]=r>>16&255,n},t.prototype.toString=function(t){return t?this.id.toString(t):this.toHexString()},t.prototype.toJSON=function(){return this.toHexString()},t.prototype.equals=function(e){if(null==e)return!1;if(e instanceof t)return this[lt][11]===e[lt][11]&&this[lt].equals(e[lt]);if("string"==typeof e&&t.isValid(e)&&12===e.length&&j(this.id))return e===m.prototype.toString.call(this.id,"latin1");if("string"==typeof e&&t.isValid(e)&&24===e.length)return e.toLowerCase()===this.toHexString();if("string"==typeof e&&t.isValid(e)&&12===e.length)return m.from(e).equals(this.id);if("object"===n(e)&&"toHexString"in e&&"function"==typeof e.toHexString){var r=e.toHexString(),i=this.toHexString().toLowerCase();return"string"==typeof r&&r.toLowerCase()===i}return!1},t.prototype.getTimestamp=function(){var t=new Date,e=this.id.readUInt32BE(0);return t.setTime(1e3*Math.floor(e)),t},t.createPk=function(){return new t},t.createFromTime=function(e){var r=m.from([0,0,0,0,0,0,0,0,0,0,0,0]);return r.writeUInt32BE(e,0),new t(r)},t.createFromHexString=function(e){if(void 0===e||null!=e&&24!==e.length)throw new w("Argument passed in must be a single String of 12 bytes or a string of 24 hex characters");return new t(m.from(e,"hex"))},t.isValid=function(e){if(null==e)return!1;try{return new t(e),!0}catch(t){return!1}},t.prototype.toExtendedJSON=function(){return this.toHexString?{$oid:this.toHexString()}:{$oid:this.toString("hex")}},t.fromExtendedJSON=function(e){return new t(e.$oid)},t.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},t.prototype.inspect=function(){return'new ObjectId("'+this.toHexString()+'")'},t.index=Math.floor(16777215*Math.random()),t}();Object.defineProperty(ht.prototype,"generate",{value:x((function(t){return ht.generate(t)}),"Please use the static `ObjectId.generate(time)` instead")}),Object.defineProperty(ht.prototype,"getInc",{value:x((function(){return ht.getInc()}),"Please use the static `ObjectId.getInc()` instead")}),Object.defineProperty(ht.prototype,"get_inc",{value:x((function(){return ht.getInc()}),"Please use the static `ObjectId.getInc()` instead")}),Object.defineProperty(ht,"get_inc",{value:x((function(){return ht.getInc()}),"Please use the static `ObjectId.getInc()` instead")}),Object.defineProperty(ht.prototype,"_bsontype",{value:"ObjectID"});var pt=function(){function t(e,r){if(!(this instanceof t))return new t(e,r);if(this.pattern=e,this.options=(null!=r?r:"").split("").sort().join(""),-1!==this.pattern.indexOf("\0"))throw new _("BSON Regex patterns cannot contain null bytes, found: "+JSON.stringify(this.pattern));if(-1!==this.options.indexOf("\0"))throw new _("BSON Regex options cannot contain null bytes, found: "+JSON.stringify(this.options));for(var n=0;n>>0,i:this.low>>>0}}},e.fromExtendedJSON=function(t){return new e(t.$timestamp)},e.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},e.prototype.inspect=function(){return"new Timestamp({ t: "+this.getHighBits()+", i: "+this.getLowBits()+" })"},e.MAX_VALUE=K.MAX_UNSIGNED_VALUE,e}(K);var bt=2147483647,mt=-2147483648,vt=0x8000000000000000,gt=-0x8000000000000000,_t={$oid:ht,$binary:N,$uuid:N,$symbol:dt,$numberInt:at,$numberDecimal:it,$numberDouble:ot,$numberLong:K,$minKey:ct,$maxKey:st,$regex:pt,$regularExpression:pt,$timestamp:yt};function wt(t,e){if(void 0===e&&(e={}),"number"==typeof t){if(e.relaxed||e.legacy)return t;if(Math.floor(t)===t){if(t>=mt&&t<=bt)return new at(t);if(t>=gt&&t<=vt)return K.fromNumber(t)}return new ot(t)}if(null==t||"object"!==n(t))return t;if(t.$undefined)return null;for(var r=Object.keys(t).filter((function(e){return e.startsWith("$")&&null!=t[e]})),i=0;i "})).join(""),a=i[r],s=" -> "+i.slice(r+1,i.length-1).map((function(t){return t+" -> "})).join(""),c=i[i.length-1],u=" ".repeat(o.length+a.length/2),f="-".repeat(s.length+(a.length+c.length)/2-1);throw new w("Converting circular structure to EJSON:\n "+o+a+s+c+"\n "+u+"\\"+f+"/")}e.seenObjects[e.seenObjects.length-1].obj=t}if(Array.isArray(t))return function(t,e){return t.map((function(t,r){e.seenObjects.push({propertyName:"index "+r,obj:null});try{return Ot(t,e)}finally{e.seenObjects.pop()}}))}(t,e);if(void 0===t)return null;if(t instanceof Date||$(p=t)&&"[object Date]"===Object.prototype.toString.call(p)){var l=t.getTime(),h=l>-1&&l<2534023188e5;return e.legacy?e.relaxed&&h?{$date:t.getTime()}:{$date:St(t)}:e.relaxed&&h?{$date:St(t)}:{$date:{$numberLong:t.getTime().toString()}}}var p;if(!("number"!=typeof t||e.relaxed&&isFinite(t))){if(Math.floor(t)===t){var d=t>=gt&&t<=vt;if(t>=mt&&t<=bt)return{$numberInt:t.toString()};if(d)return{$numberLong:t.toString()}}return{$numberDouble:t.toString()}}if(t instanceof RegExp||function(t){return"[object RegExp]"===Object.prototype.toString.call(t)}(t)){var y=t.flags;if(void 0===y){var b=t.toString().match(/[gimuy]*$/);b&&(y=b[0])}return new pt(t.source,y).toExtendedJSON(e)}return null!=t&&"object"===n(t)?function(t,e){if(null==t||"object"!==n(t))throw new _("not an object instance");var r=t._bsontype;if(void 0===r){var i={};for(var o in t){e.seenObjects.push({propertyName:o,obj:null});try{i[o]=Ot(t[o],e)}finally{e.seenObjects.pop()}}return i}if(function(t){return $(t)&&Reflect.has(t,"_bsontype")&&"string"==typeof t._bsontype}(t)){var a=t;if("function"!=typeof a.toExtendedJSON){var s=Et[t._bsontype];if(!s)throw new w("Unrecognized or invalid _bsontype: "+t._bsontype);a=s(a)}return"Code"===r&&a.scope?a=new D(a.code,Ot(a.scope,e)):"DBRef"===r&&a.oid&&(a=new C(Ot(a.collection,e),Ot(a.oid,e),Ot(a.db,e),Ot(a.fields,e))),a.toExtendedJSON(e)}throw new _("_bsontype must be a string, but was: "+n(r))}(t,e):t}var At,Et={Binary:function(t){return new N(t.value(),t.sub_type)},Code:function(t){return new D(t.code,t.scope)},DBRef:function(t){return new C(t.collection||t.namespace,t.oid,t.db,t.fields)},Decimal128:function(t){return new it(t.bytes)},Double:function(t){return new ot(t.value)},Int32:function(t){return new at(t.value)},Long:function(t){return K.fromBits(null!=t.low?t.low:t.low_,null!=t.low?t.high:t.high_,null!=t.low?t.unsigned:t.unsigned_)},MaxKey:function(){return new st},MinKey:function(){return new ct},ObjectID:function(t){return new ht(t)},ObjectId:function(t){return new ht(t)},BSONRegExp:function(t){return new pt(t.pattern,t.options)},Symbol:function(t){return new dt(t.value)},Timestamp:function(t){return yt.fromBits(t.low,t.high)}};!function(t){function e(t,e){var r=Object.assign({},{relaxed:!0,legacy:!1},e);return"boolean"==typeof r.relaxed&&(r.strict=!r.relaxed),"boolean"==typeof r.strict&&(r.relaxed=!r.strict),JSON.parse(t,(function(t,e){if(-1!==t.indexOf("\0"))throw new _("BSON Document field names cannot contain null bytes, found: "+JSON.stringify(t));return wt(e,r)}))}function r(t,e,r,i){null!=r&&"object"===n(r)&&(i=r,r=0),null==e||"object"!==n(e)||Array.isArray(e)||(i=e,e=void 0,r=0);var o=Ot(t,Object.assign({relaxed:!0,legacy:!1},i,{seenObjects:[{propertyName:"(root)",obj:null}]}));return JSON.stringify(o,e,r)}t.parse=e,t.stringify=r,t.serialize=function(t,e){return e=e||{},JSON.parse(r(t,e))},t.deserialize=function(t,r){return r=r||{},e(JSON.stringify(t),r)}}(At||(At={}));var jt=O();jt.Map?jt.Map:function(){function t(t){void 0===t&&(t=[]),this._keys=[],this._values={};for(var e=0;e{var n=r(365).Buffer;t.exports=function(t,e){for(var r=Math.min(t.length,e.length),i=new n(r),o=0;o{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}var i=r(7943),o=r(8405),a="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=u,e.SlowBuffer=function(t){return+t!=t&&(t=0),u.alloc(+t)},e.INSPECT_MAX_BYTES=50;var s=2147483647;function c(t){if(t>s)throw new RangeError('The value "'+t+'" is invalid for option "size"');var e=new Uint8Array(t);return Object.setPrototypeOf(e,u.prototype),e}function u(t,e,r){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return h(t)}return f(t,e,r)}function f(t,e,r){if("string"==typeof t)return function(t,e){if("string"==typeof e&&""!==e||(e="utf8"),!u.isEncoding(e))throw new TypeError("Unknown encoding: "+e);var r=0|b(t,e),n=c(r),i=n.write(t,e);return i!==r&&(n=n.slice(0,i)),n}(t,e);if(ArrayBuffer.isView(t))return function(t){if(F(t,Uint8Array)){var e=new Uint8Array(t);return d(e.buffer,e.byteOffset,e.byteLength)}return p(t)}(t);if(null==t)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+n(t));if(F(t,ArrayBuffer)||t&&F(t.buffer,ArrayBuffer))return d(t,e,r);if("undefined"!=typeof SharedArrayBuffer&&(F(t,SharedArrayBuffer)||t&&F(t.buffer,SharedArrayBuffer)))return d(t,e,r);if("number"==typeof t)throw new TypeError('The "value" argument must not be of type number. Received type number');var i=t.valueOf&&t.valueOf();if(null!=i&&i!==t)return u.from(i,e,r);var o=function(t){if(u.isBuffer(t)){var e=0|y(t.length),r=c(e);return 0===r.length||t.copy(r,0,0,e),r}return void 0!==t.length?"number"!=typeof t.length||V(t.length)?c(0):p(t):"Buffer"===t.type&&Array.isArray(t.data)?p(t.data):void 0}(t);if(o)return o;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return u.from(t[Symbol.toPrimitive]("string"),e,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+n(t))}function l(t){if("number"!=typeof t)throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function h(t){return l(t),c(t<0?0:0|y(t))}function p(t){for(var e=t.length<0?0:0|y(t.length),r=c(e),n=0;n=s)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s.toString(16)+" bytes");return 0|t}function b(t,e){if(u.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||F(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+n(t));var r=t.length,i=arguments.length>2&&!0===arguments[2];if(!i&&0===r)return 0;for(var o=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return U(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return L(t).length;default:if(o)return i?-1:U(t).length;e=(""+e).toLowerCase(),o=!0}}function m(t,e,r){var n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return M(this,e,r);case"utf8":case"utf-8":return $(this,e,r);case"ascii":return P(this,e,r);case"latin1":case"binary":return k(this,e,r);case"base64":return j(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return R(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function v(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function g(t,e,r,n,i){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),V(r=+r)&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof e&&(e=u.from(e,n)),u.isBuffer(e))return 0===e.length?-1:_(t,e,r,n,i);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):_(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function _(t,e,r,n,i){var o,a=1,s=t.length,c=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;a=2,s/=2,c/=2,r/=2}function u(t,e){return 1===a?t[e]:t.readUInt16BE(e*a)}if(i){var f=-1;for(o=r;os&&(r=s-c),o=r;o>=0;o--){for(var l=!0,h=0;hi&&(n=i):n=i;var o=e.length;n>o/2&&(n=o/2);for(var a=0;a>8,i=r%256,o.push(i),o.push(n);return o}(e,t.length-r),t,r,n)}function j(t,e,r){return 0===e&&r===t.length?i.fromByteArray(t):i.fromByteArray(t.slice(e,r))}function $(t,e,r){r=Math.min(t.length,r);for(var n=[],i=e;i239?4:u>223?3:u>191?2:1;if(i+l<=r)switch(l){case 1:u<128&&(f=u);break;case 2:128==(192&(o=t[i+1]))&&(c=(31&u)<<6|63&o)>127&&(f=c);break;case 3:o=t[i+1],a=t[i+2],128==(192&o)&&128==(192&a)&&(c=(15&u)<<12|(63&o)<<6|63&a)>2047&&(c<55296||c>57343)&&(f=c);break;case 4:o=t[i+1],a=t[i+2],s=t[i+3],128==(192&o)&&128==(192&a)&&128==(192&s)&&(c=(15&u)<<18|(63&o)<<12|(63&a)<<6|63&s)>65535&&c<1114112&&(f=c)}null===f?(f=65533,l=1):f>65535&&(f-=65536,n.push(f>>>10&1023|55296),f=56320|1023&f),n.push(f),i+=l}return function(t){var e=t.length;if(e<=x)return String.fromCharCode.apply(String,t);for(var r="",n=0;nn.length?u.from(o).copy(n,i):Uint8Array.prototype.set.call(n,o,i);else{if(!u.isBuffer(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(n,i)}i+=o.length}return n},u.byteLength=b,u.prototype._isBuffer=!0,u.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;er&&(t+=" ... "),""},a&&(u.prototype[a]=u.prototype.inspect),u.prototype.compare=function(t,e,r,i,o){if(F(t,Uint8Array)&&(t=u.from(t,t.offset,t.byteLength)),!u.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+n(t));if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===i&&(i=0),void 0===o&&(o=this.length),e<0||r>t.length||i<0||o>this.length)throw new RangeError("out of range index");if(i>=o&&e>=r)return 0;if(i>=o)return-1;if(e>=r)return 1;if(this===t)return 0;for(var a=(o>>>=0)-(i>>>=0),s=(r>>>=0)-(e>>>=0),c=Math.min(a,s),f=this.slice(i,o),l=t.slice(e,r),h=0;h>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-e;if((void 0===r||r>i)&&(r=i),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return w(this,t,e,r);case"utf8":case"utf-8":return S(this,t,e,r);case"ascii":case"latin1":case"binary":return O(this,t,e,r);case"base64":return A(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E(this,t,e,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var x=4096;function P(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;in)&&(r=n);for(var i="",o=e;or)throw new RangeError("Trying to access beyond buffer length")}function B(t,e,r,n,i,o){if(!u.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||et.length)throw new RangeError("Index out of range")}function T(t,e,r,n,i,o){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function N(t,e,r,n,i){return e=+e,r>>>=0,i||T(t,0,r,4),o.write(t,e,r,n,23,4),r+4}function D(t,e,r,n,i){return e=+e,r>>>=0,i||T(t,0,r,8),o.write(t,e,r,n,52,8),r+8}u.prototype.slice=function(t,e){var r=this.length;(t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e>>=0,e>>>=0,r||I(t,e,this.length);for(var n=this[t],i=1,o=0;++o>>=0,e>>>=0,r||I(t,e,this.length);for(var n=this[t+--e],i=1;e>0&&(i*=256);)n+=this[t+--e]*i;return n},u.prototype.readUint8=u.prototype.readUInt8=function(t,e){return t>>>=0,e||I(t,1,this.length),this[t]},u.prototype.readUint16LE=u.prototype.readUInt16LE=function(t,e){return t>>>=0,e||I(t,2,this.length),this[t]|this[t+1]<<8},u.prototype.readUint16BE=u.prototype.readUInt16BE=function(t,e){return t>>>=0,e||I(t,2,this.length),this[t]<<8|this[t+1]},u.prototype.readUint32LE=u.prototype.readUInt32LE=function(t,e){return t>>>=0,e||I(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},u.prototype.readUint32BE=u.prototype.readUInt32BE=function(t,e){return t>>>=0,e||I(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},u.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||I(t,e,this.length);for(var n=this[t],i=1,o=0;++o=(i*=128)&&(n-=Math.pow(2,8*e)),n},u.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||I(t,e,this.length);for(var n=e,i=1,o=this[t+--n];n>0&&(i*=256);)o+=this[t+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*e)),o},u.prototype.readInt8=function(t,e){return t>>>=0,e||I(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},u.prototype.readInt16LE=function(t,e){t>>>=0,e||I(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt16BE=function(t,e){t>>>=0,e||I(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt32LE=function(t,e){return t>>>=0,e||I(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},u.prototype.readInt32BE=function(t,e){return t>>>=0,e||I(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},u.prototype.readFloatLE=function(t,e){return t>>>=0,e||I(t,4,this.length),o.read(this,t,!0,23,4)},u.prototype.readFloatBE=function(t,e){return t>>>=0,e||I(t,4,this.length),o.read(this,t,!1,23,4)},u.prototype.readDoubleLE=function(t,e){return t>>>=0,e||I(t,8,this.length),o.read(this,t,!0,52,8)},u.prototype.readDoubleBE=function(t,e){return t>>>=0,e||I(t,8,this.length),o.read(this,t,!1,52,8)},u.prototype.writeUintLE=u.prototype.writeUIntLE=function(t,e,r,n){t=+t,e>>>=0,r>>>=0,n||B(this,t,e,r,Math.pow(2,8*r)-1,0);var i=1,o=0;for(this[e]=255&t;++o>>=0,r>>>=0,n||B(this,t,e,r,Math.pow(2,8*r)-1,0);var i=r-1,o=1;for(this[e+i]=255&t;--i>=0&&(o*=256);)this[e+i]=t/o&255;return e+r},u.prototype.writeUint8=u.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||B(this,t,e,1,255,0),this[e]=255&t,e+1},u.prototype.writeUint16LE=u.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||B(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},u.prototype.writeUint16BE=u.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||B(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},u.prototype.writeUint32LE=u.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||B(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},u.prototype.writeUint32BE=u.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||B(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},u.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var i=Math.pow(2,8*r-1);B(this,t,e,r,i-1,-i)}var o=0,a=1,s=0;for(this[e]=255&t;++o>0)-s&255;return e+r},u.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var i=Math.pow(2,8*r-1);B(this,t,e,r,i-1,-i)}var o=r-1,a=1,s=0;for(this[e+o]=255&t;--o>=0&&(a*=256);)t<0&&0===s&&0!==this[e+o+1]&&(s=1),this[e+o]=(t/a>>0)-s&255;return e+r},u.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||B(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},u.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||B(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},u.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||B(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},u.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||B(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},u.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||B(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},u.prototype.writeFloatLE=function(t,e,r){return N(this,t,e,!0,r)},u.prototype.writeFloatBE=function(t,e,r){return N(this,t,e,!1,r)},u.prototype.writeDoubleLE=function(t,e,r){return D(this,t,e,!0,r)},u.prototype.writeDoubleBE=function(t,e,r){return D(this,t,e,!1,r)},u.prototype.copy=function(t,e,r,n){if(!u.isBuffer(t))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(o=e;o55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(a+1===n){(e-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function L(t){return i.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(C,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function q(t,e,r,n){for(var i=0;i=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function F(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function V(t){return t!=t}var z=function(){for(var t="0123456789abcdef",e=new Array(256),r=0;r<16;++r)for(var n=16*r,i=0;i<16;++i)e[n+i]=t[r]+t[i];return e}()},8780:(t,e,r)=>{"use strict";var n=r(6893),i=r(3862),o=i(n("String.prototype.indexOf"));t.exports=function(t,e){var r=n(t,!!e);return"function"==typeof r&&o(t,".prototype.")>-1?i(r):r}},3862:(t,e,r)=>{"use strict";var n=r(5246),i=r(6893),o=i("%Function.prototype.apply%"),a=i("%Function.prototype.call%"),s=i("%Reflect.apply%",!0)||n.call(a,o),c=i("%Object.getOwnPropertyDescriptor%",!0),u=i("%Object.defineProperty%",!0),f=i("%Math.max%");if(u)try{u({},"a",{value:1})}catch(t){u=null}t.exports=function(t){var e=s(n,a,arguments);if(c&&u){var r=c(e,"length");r.configurable&&u(e,"length",{value:1+f(0,t.length-(arguments.length-1))})}return e};var l=function(){return s(n,o,arguments)};u?u(t.exports,"apply",{value:l}):t.exports.apply=l},8842:(t,e,r)=>{var n=r(9047).Buffer,i=r(4723).Transform,o=r(113).s;function a(t){i.call(this),this.hashMode="string"==typeof t,this.hashMode?this[t]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}r(376)(a,i),a.prototype.update=function(t,e,r){"string"==typeof t&&(t=n.from(t,e));var i=this._update(t);return this.hashMode?this:(r&&(i=this._toString(i,r)),i)},a.prototype.setAutoPadding=function(){},a.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")},a.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")},a.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")},a.prototype._transform=function(t,e,r){var n;try{this.hashMode?this._update(t):this.push(this._update(t))}catch(t){n=t}finally{r(n)}},a.prototype._flush=function(t){var e;try{this.push(this.__final())}catch(t){e=t}t(e)},a.prototype._finalOrDigest=function(t){var e=this.__final()||n.alloc(0);return t&&(e=this._toString(e,t,!0)),e},a.prototype._toString=function(t,e,r){if(this._decoder||(this._decoder=new o(e),this._encoding=e),this._encoding!==e)throw new Error("can't switch encodings");var n=this._decoder.write(t);return r&&(n+=this._decoder.end()),n},t.exports=a},4637:(t,e,r)=>{var n=r(365).Buffer,i=r(8333),o=r(6781);t.exports=function(t){return new s(t)};var a={secp256k1:{name:"secp256k1",byteLength:32},secp224r1:{name:"p224",byteLength:28},prime256v1:{name:"p256",byteLength:32},prime192v1:{name:"p192",byteLength:24},ed25519:{name:"ed25519",byteLength:32},secp384r1:{name:"p384",byteLength:48},secp521r1:{name:"p521",byteLength:66}};function s(t){this.curveType=a[t],this.curveType||(this.curveType={name:t}),this.curve=new i.ec(this.curveType.name),this.keys=void 0}function c(t,e,r){Array.isArray(t)||(t=t.toArray());var i=new n(t);if(r&&i.length{"use strict";var n=r(376),i=r(722),o=r(8100),a=r(1806),s=r(8842);function c(t){s.call(this,"digest"),this._hash=t}n(c,s),c.prototype._update=function(t){this._hash.update(t)},c.prototype._final=function(){return this._hash.digest()},t.exports=function(t){return"md5"===(t=t.toLowerCase())?new i:"rmd160"===t||"ripemd160"===t?new o:new c(a(t))}},3277:(t,e,r)=>{var n=r(722);t.exports=function(t){return(new n).update(t).digest()}},8736:(t,e,r)=>{"use strict";var n=r(376),i=r(2912),o=r(8842),a=r(9047).Buffer,s=r(3277),c=r(8100),u=r(1806),f=a.alloc(128);function l(t,e){o.call(this,"digest"),"string"==typeof e&&(e=a.from(e));var r="sha512"===t||"sha384"===t?128:64;this._alg=t,this._key=e,e.length>r?e=("rmd160"===t?new c:u(t)).update(e).digest():e.length{"use strict";var n=r(376),i=r(9047).Buffer,o=r(8842),a=i.alloc(128),s=64;function c(t,e){o.call(this,"digest"),"string"==typeof e&&(e=i.from(e)),this._alg=t,this._key=e,e.length>s?e=t(e):e.length{"use strict";e.O6=r(5760),r(8339),r(8736);var n=r(3363),i=Object.keys(n),o=(["sha1","sha224","sha256","sha384","sha512","md5","rmd160"].concat(i),r(9379));o.pbkdf2,o.pbkdf2Sync;var a=r(5972);a.Cipher,a.createCipher,a.Cipheriv,a.createCipheriv,a.Decipher,a.createDecipher,a.Decipheriv,a.createDecipheriv,a.getCiphers,a.listCiphers;var s=r(1822);s.DiffieHellmanGroup,s.createDiffieHellmanGroup,s.getDiffieHellman,s.createDiffieHellman,s.DiffieHellman;var c=r(1022);c.createSign,c.Sign,c.createVerify,c.Verify,r(4637);var u=r(2368);u.publicEncrypt,u.privateEncrypt,u.publicDecrypt,u.privateDecrypt;var f=r(9301);f.randomFill,f.randomFillSync},5509:t=>{function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},e(t)}var r=1e3,n=60*r,i=60*n,o=24*i;function a(t,e,r,n){var i=e>=1.5*r;return Math.round(t/r)+" "+n+(i?"s":"")}t.exports=function(t,s){s=s||{};var c,u,f=e(t);if("string"===f&&t.length>0)return function(t){if(!((t=String(t)).length>100)){var e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(t);if(e){var a=parseFloat(e[1]);switch((e[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*a;case"weeks":case"week":case"w":return 6048e5*a;case"days":case"day":case"d":return a*o;case"hours":case"hour":case"hrs":case"hr":case"h":return a*i;case"minutes":case"minute":case"mins":case"min":case"m":return a*n;case"seconds":case"second":case"secs":case"sec":case"s":return a*r;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return a;default:return}}}}(t);if("number"===f&&isFinite(t))return s.long?(c=t,(u=Math.abs(c))>=o?a(c,u,o,"day"):u>=i?a(c,u,i,"hour"):u>=n?a(c,u,n,"minute"):u>=r?a(c,u,r,"second"):c+" ms"):function(t){var e=Math.abs(t);return e>=o?Math.round(t/o)+"d":e>=i?Math.round(t/i)+"h":e>=n?Math.round(t/n)+"m":e>=r?Math.round(t/r)+"s":t+"ms"}(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))}},8801:(t,e,r)=>{var n;e.formatArgs=function(e){if(e[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+e[0]+(this.useColors?"%c ":" ")+"+"+t.exports.humanize(this.diff),this.useColors){var r="color: "+this.color;e.splice(1,0,r,"color: inherit");var n=0,i=0;e[0].replace(/%[a-zA-Z%]/g,(function(t){"%%"!==t&&(n++,"%c"===t&&(i=n))})),e.splice(i,0,r)}},e.save=function(t){try{t?e.storage.setItem("debug",t):e.storage.removeItem("debug")}catch(t){}},e.load=function(){var t;try{t=e.storage.getItem("debug")}catch(t){}return!t&&void 0!=={env:{}}&&"env"in{env:{}}&&(t={}.DEBUG),t},e.useColors=function(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type&&!window.process.__nwjs)||("undefined"==typeof navigator||!navigator.userAgent||!navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))},e.storage=function(){try{return localStorage}catch(t){}}(),e.destroy=(n=!1,function(){n||(n=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}),e.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],e.log=console.debug||console.log||function(){},t.exports=r(5331)(e),t.exports.formatters.j=function(t){try{return JSON.stringify(t)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}}},5331:(t,e,r)=>{function n(t){return function(t){if(Array.isArray(t))return i(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return i(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?i(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}var i=r(3818),o="function"==typeof Symbol&&"symbol"===n(Symbol("foo")),a=Object.prototype.toString,s=Array.prototype.concat,c=Object.defineProperty,u=r(2579)(),f=c&&u,l=function(t,e,r,n){var i;(!(e in t)||"function"==typeof(i=n)&&"[object Function]"===a.call(i)&&n())&&(f?c(t,e,{configurable:!0,enumerable:!1,value:r,writable:!0}):t[e]=r)},h=function(t,e){var r=arguments.length>2?arguments[2]:{},n=i(e);o&&(n=s.call(n,Object.getOwnPropertySymbols(e)));for(var a=0;a{"use strict";e.utils=r(5061),e.Cipher=r(7499),e.DES=r(9484),e.CBC=r(8254),e.EDE=r(5573)},8254:(t,e,r)=>{"use strict";var n=r(1130),i=r(376),o={};function a(t){n.equal(t.length,8,"Invalid IV length"),this.iv=new Array(8);for(var e=0;e{"use strict";var n=r(1130);function i(t){this.options=t,this.type=this.options.type,this.blockSize=8,this._init(),this.buffer=new Array(this.blockSize),this.bufferOff=0}t.exports=i,i.prototype._init=function(){},i.prototype.update=function(t){return 0===t.length?[]:"decrypt"===this.type?this._updateDecrypt(t):this._updateEncrypt(t)},i.prototype._buffer=function(t,e){for(var r=Math.min(this.buffer.length-this.bufferOff,t.length-e),n=0;n0;n--)e+=this._buffer(t,e),r+=this._flushBuffer(i,r);return e+=this._buffer(t,e),i},i.prototype.final=function(t){var e,r;return t&&(e=this.update(t)),r="encrypt"===this.type?this._finalEncrypt():this._finalDecrypt(),e?e.concat(r):r},i.prototype._pad=function(t,e){if(0===e)return!1;for(;e{"use strict";var n=r(1130),i=r(376),o=r(5061),a=r(7499);function s(){this.tmp=new Array(2),this.keys=null}function c(t){a.call(this,t);var e=new s;this._desState=e,this.deriveKeys(e,t.key)}i(c,a),t.exports=c,c.create=function(t){return new c(t)};var u=[1,1,2,2,2,2,2,2,1,2,2,2,2,2,2,1];c.prototype.deriveKeys=function(t,e){t.keys=new Array(32),n.equal(e.length,this.blockSize,"Invalid key length");var r=o.readUInt32BE(e,0),i=o.readUInt32BE(e,4);o.pc1(r,i,t.tmp,0),r=t.tmp[0],i=t.tmp[1];for(var a=0;a>>1];r=o.r28shl(r,s),i=o.r28shl(i,s),o.pc2(r,i,t.keys,a)}},c.prototype._update=function(t,e,r,n){var i=this._desState,a=o.readUInt32BE(t,e),s=o.readUInt32BE(t,e+4);o.ip(a,s,i.tmp,0),a=i.tmp[0],s=i.tmp[1],"encrypt"===this.type?this._encrypt(i,a,s,i.tmp,0):this._decrypt(i,a,s,i.tmp,0),a=i.tmp[0],s=i.tmp[1],o.writeUInt32BE(r,a,n),o.writeUInt32BE(r,s,n+4)},c.prototype._pad=function(t,e){for(var r=t.length-e,n=e;n>>0,a=h}o.rip(s,a,n,i)},c.prototype._decrypt=function(t,e,r,n,i){for(var a=r,s=e,c=t.keys.length-2;c>=0;c-=2){var u=t.keys[c],f=t.keys[c+1];o.expand(a,t.tmp,0),u^=t.tmp[0],f^=t.tmp[1];var l=o.substitute(u,f),h=a;a=(s^o.permute(l))>>>0,s=h}o.rip(a,s,n,i)}},5573:(t,e,r)=>{"use strict";var n=r(1130),i=r(376),o=r(7499),a=r(9484);function s(t,e){n.equal(e.length,24,"Invalid key length");var r=e.slice(0,8),i=e.slice(8,16),o=e.slice(16,24);this.ciphers="encrypt"===t?[a.create({type:"encrypt",key:r}),a.create({type:"decrypt",key:i}),a.create({type:"encrypt",key:o})]:[a.create({type:"decrypt",key:o}),a.create({type:"encrypt",key:i}),a.create({type:"decrypt",key:r})]}function c(t){o.call(this,t);var e=new s(this.type,this.options.key);this._edeState=e}i(c,o),t.exports=c,c.create=function(t){return new c(t)},c.prototype._update=function(t,e,r,n){var i=this._edeState;i.ciphers[0]._update(t,e,r,n),i.ciphers[1]._update(r,n,r,n),i.ciphers[2]._update(r,n,r,n)},c.prototype._pad=a.prototype._pad,c.prototype._unpad=a.prototype._unpad},5061:(t,e)=>{"use strict";e.readUInt32BE=function(t,e){return(t[0+e]<<24|t[1+e]<<16|t[2+e]<<8|t[3+e])>>>0},e.writeUInt32BE=function(t,e,r){t[0+r]=e>>>24,t[1+r]=e>>>16&255,t[2+r]=e>>>8&255,t[3+r]=255&e},e.ip=function(t,e,r,n){for(var i=0,o=0,a=6;a>=0;a-=2){for(var s=0;s<=24;s+=8)i<<=1,i|=e>>>s+a&1;for(s=0;s<=24;s+=8)i<<=1,i|=t>>>s+a&1}for(a=6;a>=0;a-=2){for(s=1;s<=25;s+=8)o<<=1,o|=e>>>s+a&1;for(s=1;s<=25;s+=8)o<<=1,o|=t>>>s+a&1}r[n+0]=i>>>0,r[n+1]=o>>>0},e.rip=function(t,e,r,n){for(var i=0,o=0,a=0;a<4;a++)for(var s=24;s>=0;s-=8)i<<=1,i|=e>>>s+a&1,i<<=1,i|=t>>>s+a&1;for(a=4;a<8;a++)for(s=24;s>=0;s-=8)o<<=1,o|=e>>>s+a&1,o<<=1,o|=t>>>s+a&1;r[n+0]=i>>>0,r[n+1]=o>>>0},e.pc1=function(t,e,r,n){for(var i=0,o=0,a=7;a>=5;a--){for(var s=0;s<=24;s+=8)i<<=1,i|=e>>s+a&1;for(s=0;s<=24;s+=8)i<<=1,i|=t>>s+a&1}for(s=0;s<=24;s+=8)i<<=1,i|=e>>s+a&1;for(a=1;a<=3;a++){for(s=0;s<=24;s+=8)o<<=1,o|=e>>s+a&1;for(s=0;s<=24;s+=8)o<<=1,o|=t>>s+a&1}for(s=0;s<=24;s+=8)o<<=1,o|=t>>s+a&1;r[n+0]=i>>>0,r[n+1]=o>>>0},e.r28shl=function(t,e){return t<>>28-e};var r=[14,11,17,4,27,23,25,0,13,22,7,18,5,9,16,24,2,20,12,21,1,8,15,26,15,4,25,19,9,1,26,16,5,11,23,8,12,7,17,0,22,3,10,14,6,20,27,24];e.pc2=function(t,e,n,i){for(var o=0,a=0,s=r.length>>>1,c=0;c>>r[c]&1;for(c=s;c>>r[c]&1;n[i+0]=o>>>0,n[i+1]=a>>>0},e.expand=function(t,e,r){var n=0,i=0;n=(1&t)<<5|t>>>27;for(var o=23;o>=15;o-=4)n<<=6,n|=t>>>o&63;for(o=11;o>=3;o-=4)i|=t>>>o&63,i<<=6;i|=(31&t)<<1|t>>>31,e[r+0]=n>>>0,e[r+1]=i>>>0};var n=[14,0,4,15,13,7,1,4,2,14,15,2,11,13,8,1,3,10,10,6,6,12,12,11,5,9,9,5,0,3,7,8,4,15,1,12,14,8,8,2,13,4,6,9,2,1,11,7,15,5,12,11,9,3,7,14,3,10,10,0,5,6,0,13,15,3,1,13,8,4,14,7,6,15,11,2,3,8,4,14,9,12,7,0,2,1,13,10,12,6,0,9,5,11,10,5,0,13,14,8,7,10,11,1,10,3,4,15,13,4,1,2,5,11,8,6,12,7,6,12,9,0,3,5,2,14,15,9,10,13,0,7,9,0,14,9,6,3,3,4,15,6,5,10,1,2,13,8,12,5,7,14,11,12,4,11,2,15,8,1,13,1,6,10,4,13,9,0,8,6,15,9,3,8,0,7,11,4,1,15,2,14,12,3,5,11,10,5,14,2,7,12,7,13,13,8,14,11,3,5,0,6,6,15,9,0,10,3,1,4,2,7,8,2,5,12,11,1,12,10,4,14,15,9,10,3,6,15,9,0,0,6,12,10,11,1,7,13,13,8,15,9,1,4,3,5,14,11,5,12,2,7,8,2,4,14,2,14,12,11,4,2,1,12,7,4,10,7,11,13,6,1,8,5,5,0,3,15,15,10,13,3,0,9,14,8,9,6,4,11,2,8,1,12,11,7,10,1,13,14,7,2,8,13,15,6,9,15,12,0,5,9,6,10,3,4,0,5,14,3,12,10,1,15,10,4,15,2,9,7,2,12,6,9,8,5,0,6,13,1,3,13,4,14,14,0,7,11,5,3,11,8,9,4,14,3,15,2,5,12,2,9,8,5,12,15,3,10,7,11,0,14,4,1,10,7,1,6,13,0,11,8,6,13,4,13,11,0,2,11,14,7,15,4,0,9,8,1,13,10,3,14,12,3,9,5,7,12,5,2,10,15,6,8,1,6,1,6,4,11,11,13,13,8,12,1,3,4,7,10,14,7,10,9,15,5,6,0,8,15,0,14,5,2,9,3,2,12,13,1,2,15,8,13,4,8,6,10,15,3,11,7,1,4,10,12,9,5,3,6,14,11,5,0,0,14,12,9,7,2,7,2,11,1,4,14,1,7,9,4,12,10,14,8,2,13,0,15,6,12,10,9,13,0,15,3,3,5,5,6,8,11];e.substitute=function(t,e){for(var r=0,i=0;i<4;i++)r<<=4,r|=n[64*i+(t>>>18-6*i&63)];for(i=0;i<4;i++)r<<=4,r|=n[256+64*i+(e>>>18-6*i&63)];return r>>>0};var i=[16,25,12,11,3,20,4,15,31,17,9,6,27,14,1,22,30,24,8,18,0,5,29,23,13,19,2,26,10,21,28,7];e.permute=function(t){for(var e=0,r=0;r>>i[r]&1;return e>>>0},e.padSplit=function(t,e,r){for(var n=t.toString(2);n.length{var n=r(365).Buffer,i=r(2227),o=r(9799),a=r(6951),s={binary:!0,hex:!0,base64:!0};e.DiffieHellmanGroup=e.createDiffieHellmanGroup=e.getDiffieHellman=function(t){var e=new n(o[t].prime,"hex"),r=new n(o[t].gen,"hex");return new a(e,r)},e.createDiffieHellman=e.DiffieHellman=function t(e,r,o,c){return n.isBuffer(r)||void 0===s[r]?t(e,"binary",r,o):(r=r||"binary",c=c||"binary",o=o||new n([2]),n.isBuffer(o)||(o=new n(o,c)),"number"==typeof e?new a(i(e,o),o,!0):(n.isBuffer(e)||(e=new n(e,r)),new a(e,o,!0)))}},6951:(t,e,r)=>{var n=r(365).Buffer,i=r(6781),o=new(r(9318)),a=new i(24),s=new i(11),c=new i(10),u=new i(3),f=new i(7),l=r(2227),h=r(5760);function p(t,e){return e=e||"utf8",n.isBuffer(t)||(t=new n(t,e)),this._pub=new i(t),this}function d(t,e){return e=e||"utf8",n.isBuffer(t)||(t=new n(t,e)),this._priv=new i(t),this}t.exports=b;var y={};function b(t,e,r){this.setGenerator(e),this.__prime=new i(t),this._prime=i.mont(this.__prime),this._primeLen=t.length,this._pub=void 0,this._priv=void 0,this._primeCode=void 0,r?(this.setPublicKey=p,this.setPrivateKey=d):this._primeCode=8}function m(t,e){var r=new n(t.toArray());return e?r.toString(e):r}Object.defineProperty(b.prototype,"verifyError",{enumerable:!0,get:function(){return"number"!=typeof this._primeCode&&(this._primeCode=function(t,e){var r=e.toString("hex"),n=[r,t.toString(16)].join("_");if(n in y)return y[n];var i,h=0;if(t.isEven()||!l.simpleSieve||!l.fermatTest(t)||!o.test(t))return h+=1,h+="02"===r||"05"===r?8:4,y[n]=h,h;switch(o.test(t.shrn(1))||(h+=2),r){case"02":t.mod(a).cmp(s)&&(h+=8);break;case"05":(i=t.mod(c)).cmp(u)&&i.cmp(f)&&(h+=8);break;default:h+=4}return y[n]=h,h}(this.__prime,this.__gen)),this._primeCode}}),b.prototype.generateKeys=function(){return this._priv||(this._priv=new i(h(this._primeLen))),this._pub=this._gen.toRed(this._prime).redPow(this._priv).fromRed(),this.getPublicKey()},b.prototype.computeSecret=function(t){var e=(t=(t=new i(t)).toRed(this._prime)).redPow(this._priv).fromRed(),r=new n(e.toArray()),o=this.getPrime();if(r.length{var n=r(5760);t.exports=v,v.simpleSieve=b,v.fermatTest=m;var i=r(6781),o=new i(24),a=new(r(9318)),s=new i(1),c=new i(2),u=new i(5),f=(new i(16),new i(8),new i(10)),l=new i(3),h=(new i(7),new i(11)),p=new i(4),d=(new i(12),null);function y(){if(null!==d)return d;var t=[];t[0]=2;for(var e=1,r=3;r<1048576;r+=2){for(var n=Math.ceil(Math.sqrt(r)),i=0;it;)r.ishrn(1);if(r.isEven()&&r.iadd(s),r.testn(1)||r.iadd(c),e.cmp(c)){if(!e.cmp(u))for(;r.mod(f).cmp(l);)r.iadd(p)}else for(;r.mod(o).cmp(h);)r.iadd(p);if(b(d=r.shrn(1))&&b(r)&&m(d)&&m(r)&&a.test(d)&&a.test(r))return r}}},8333:(t,e,r)=>{"use strict";var n=e;n.version=r(8597).i8,n.utils=r(7891),n.rand=r(7179),n.curve=r(4720),n.curves=r(1478),n.ec=r(5806),n.eddsa=r(8318)},9952:(t,e,r)=>{"use strict";var n=r(6781),i=r(7891),o=i.getNAF,a=i.getJSF,s=i.assert;function c(t,e){this.type=t,this.p=new n(e.p,16),this.red=e.prime?n.red(e.prime):n.mont(this.p),this.zero=new n(0).toRed(this.red),this.one=new n(1).toRed(this.red),this.two=new n(2).toRed(this.red),this.n=e.n&&new n(e.n,16),this.g=e.g&&this.pointFromJSON(e.g,e.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function u(t,e){this.curve=t,this.type=e,this.precomputed=null}t.exports=c,c.prototype.point=function(){throw new Error("Not implemented")},c.prototype.validate=function(){throw new Error("Not implemented")},c.prototype._fixedNafMul=function(t,e){s(t.precomputed);var r=t._getDoubles(),n=o(e,1,this._bitLength),i=(1<=a;f--)c=(c<<1)+n[f];u.push(c)}for(var l=this.jpoint(null,null,null),h=this.jpoint(null,null,null),p=i;p>0;p--){for(a=0;a=0;u--){for(var f=0;u>=0&&0===a[u];u--)f++;if(u>=0&&f++,c=c.dblp(f),u<0)break;var l=a[u];s(0!==l),c="affine"===t.type?l>0?c.mixedAdd(i[l-1>>1]):c.mixedAdd(i[-l-1>>1].neg()):l>0?c.add(i[l-1>>1]):c.add(i[-l-1>>1].neg())}return"affine"===t.type?c.toP():c},c.prototype._wnafMulAdd=function(t,e,r,n,i){var s,c,u,f=this._wnafT1,l=this._wnafT2,h=this._wnafT3,p=0;for(s=0;s=1;s-=2){var y=s-1,b=s;if(1===f[y]&&1===f[b]){var m=[e[y],null,null,e[b]];0===e[y].y.cmp(e[b].y)?(m[1]=e[y].add(e[b]),m[2]=e[y].toJ().mixedAdd(e[b].neg())):0===e[y].y.cmp(e[b].y.redNeg())?(m[1]=e[y].toJ().mixedAdd(e[b]),m[2]=e[y].add(e[b].neg())):(m[1]=e[y].toJ().mixedAdd(e[b]),m[2]=e[y].toJ().mixedAdd(e[b].neg()));var v=[-3,-1,-5,-7,0,7,5,1,3],g=a(r[y],r[b]);for(p=Math.max(g[0].length,p),h[y]=new Array(p),h[b]=new Array(p),c=0;c=0;s--){for(var A=0;s>=0;){var E=!0;for(c=0;c=0&&A++,S=S.dblp(A),s<0)break;for(c=0;c0?u=l[c][j-1>>1]:j<0&&(u=l[c][-j-1>>1].neg()),S="affine"===u.type?S.mixedAdd(u):S.add(u))}}for(s=0;s=Math.ceil((t.bitLength()+1)/e.step)},u.prototype._getDoubles=function(t,e){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],n=this,i=0;i{"use strict";var n=r(7891),i=r(6781),o=r(376),a=r(9952),s=n.assert;function c(t){this.twisted=1!=(0|t.a),this.mOneA=this.twisted&&-1==(0|t.a),this.extended=this.mOneA,a.call(this,"edwards",t),this.a=new i(t.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new i(t.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new i(t.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),s(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=1==(0|t.c)}function u(t,e,r,n,o){a.BasePoint.call(this,t,"projective"),null===e&&null===r&&null===n?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new i(e,16),this.y=new i(r,16),this.z=n?new i(n,16):this.curve.one,this.t=o&&new i(o,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}o(c,a),t.exports=c,c.prototype._mulA=function(t){return this.mOneA?t.redNeg():this.a.redMul(t)},c.prototype._mulC=function(t){return this.oneC?t:this.c.redMul(t)},c.prototype.jpoint=function(t,e,r,n){return this.point(t,e,r,n)},c.prototype.pointFromX=function(t,e){(t=new i(t,16)).red||(t=t.toRed(this.red));var r=t.redSqr(),n=this.c2.redSub(this.a.redMul(r)),o=this.one.redSub(this.c2.redMul(this.d).redMul(r)),a=n.redMul(o.redInvm()),s=a.redSqrt();if(0!==s.redSqr().redSub(a).cmp(this.zero))throw new Error("invalid point");var c=s.fromRed().isOdd();return(e&&!c||!e&&c)&&(s=s.redNeg()),this.point(t,s)},c.prototype.pointFromY=function(t,e){(t=new i(t,16)).red||(t=t.toRed(this.red));var r=t.redSqr(),n=r.redSub(this.c2),o=r.redMul(this.d).redMul(this.c2).redSub(this.a),a=n.redMul(o.redInvm());if(0===a.cmp(this.zero)){if(e)throw new Error("invalid point");return this.point(this.zero,t)}var s=a.redSqrt();if(0!==s.redSqr().redSub(a).cmp(this.zero))throw new Error("invalid point");return s.fromRed().isOdd()!==e&&(s=s.redNeg()),this.point(s,t)},c.prototype.validate=function(t){if(t.isInfinity())return!0;t.normalize();var e=t.x.redSqr(),r=t.y.redSqr(),n=e.redMul(this.a).redAdd(r),i=this.c2.redMul(this.one.redAdd(this.d.redMul(e).redMul(r)));return 0===n.cmp(i)},o(u,a.BasePoint),c.prototype.pointFromJSON=function(t){return u.fromJSON(this,t)},c.prototype.point=function(t,e,r,n){return new u(this,t,e,r,n)},u.fromJSON=function(t,e){return new u(t,e[0],e[1],e[2])},u.prototype.inspect=function(){return this.isInfinity()?"":""},u.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},u.prototype._extDbl=function(){var t=this.x.redSqr(),e=this.y.redSqr(),r=this.z.redSqr();r=r.redIAdd(r);var n=this.curve._mulA(t),i=this.x.redAdd(this.y).redSqr().redISub(t).redISub(e),o=n.redAdd(e),a=o.redSub(r),s=n.redSub(e),c=i.redMul(a),u=o.redMul(s),f=i.redMul(s),l=a.redMul(o);return this.curve.point(c,u,l,f)},u.prototype._projDbl=function(){var t,e,r,n,i,o,a=this.x.redAdd(this.y).redSqr(),s=this.x.redSqr(),c=this.y.redSqr();if(this.curve.twisted){var u=(n=this.curve._mulA(s)).redAdd(c);this.zOne?(t=a.redSub(s).redSub(c).redMul(u.redSub(this.curve.two)),e=u.redMul(n.redSub(c)),r=u.redSqr().redSub(u).redSub(u)):(i=this.z.redSqr(),o=u.redSub(i).redISub(i),t=a.redSub(s).redISub(c).redMul(o),e=u.redMul(n.redSub(c)),r=u.redMul(o))}else n=s.redAdd(c),i=this.curve._mulC(this.z).redSqr(),o=n.redSub(i).redSub(i),t=this.curve._mulC(a.redISub(n)).redMul(o),e=this.curve._mulC(n).redMul(s.redISub(c)),r=n.redMul(o);return this.curve.point(t,e,r)},u.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},u.prototype._extAdd=function(t){var e=this.y.redSub(this.x).redMul(t.y.redSub(t.x)),r=this.y.redAdd(this.x).redMul(t.y.redAdd(t.x)),n=this.t.redMul(this.curve.dd).redMul(t.t),i=this.z.redMul(t.z.redAdd(t.z)),o=r.redSub(e),a=i.redSub(n),s=i.redAdd(n),c=r.redAdd(e),u=o.redMul(a),f=s.redMul(c),l=o.redMul(c),h=a.redMul(s);return this.curve.point(u,f,h,l)},u.prototype._projAdd=function(t){var e,r,n=this.z.redMul(t.z),i=n.redSqr(),o=this.x.redMul(t.x),a=this.y.redMul(t.y),s=this.curve.d.redMul(o).redMul(a),c=i.redSub(s),u=i.redAdd(s),f=this.x.redAdd(this.y).redMul(t.x.redAdd(t.y)).redISub(o).redISub(a),l=n.redMul(c).redMul(f);return this.curve.twisted?(e=n.redMul(u).redMul(a.redSub(this.curve._mulA(o))),r=c.redMul(u)):(e=n.redMul(u).redMul(a.redSub(o)),r=this.curve._mulC(c).redMul(u)),this.curve.point(l,e,r)},u.prototype.add=function(t){return this.isInfinity()?t:t.isInfinity()?this:this.curve.extended?this._extAdd(t):this._projAdd(t)},u.prototype.mul=function(t){return this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve._wnafMul(this,t)},u.prototype.mulAdd=function(t,e,r){return this.curve._wnafMulAdd(1,[this,e],[t,r],2,!1)},u.prototype.jmulAdd=function(t,e,r){return this.curve._wnafMulAdd(1,[this,e],[t,r],2,!0)},u.prototype.normalize=function(){if(this.zOne)return this;var t=this.z.redInvm();return this.x=this.x.redMul(t),this.y=this.y.redMul(t),this.t&&(this.t=this.t.redMul(t)),this.z=this.curve.one,this.zOne=!0,this},u.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},u.prototype.getX=function(){return this.normalize(),this.x.fromRed()},u.prototype.getY=function(){return this.normalize(),this.y.fromRed()},u.prototype.eq=function(t){return this===t||0===this.getX().cmp(t.getX())&&0===this.getY().cmp(t.getY())},u.prototype.eqXToP=function(t){var e=t.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(e))return!0;for(var r=t.clone(),n=this.curve.redN.redMul(this.z);;){if(r.iadd(this.curve.n),r.cmp(this.curve.p)>=0)return!1;if(e.redIAdd(n),0===this.x.cmp(e))return!0}},u.prototype.toP=u.prototype.normalize,u.prototype.mixedAdd=u.prototype.add},4720:(t,e,r)=>{"use strict";var n=e;n.base=r(9952),n.short=r(1585),n.mont=r(6773),n.edwards=r(5970)},6773:(t,e,r)=>{"use strict";var n=r(6781),i=r(376),o=r(9952),a=r(7891);function s(t){o.call(this,"mont",t),this.a=new n(t.a,16).toRed(this.red),this.b=new n(t.b,16).toRed(this.red),this.i4=new n(4).toRed(this.red).redInvm(),this.two=new n(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function c(t,e,r){o.BasePoint.call(this,t,"projective"),null===e&&null===r?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new n(e,16),this.z=new n(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}i(s,o),t.exports=s,s.prototype.validate=function(t){var e=t.normalize().x,r=e.redSqr(),n=r.redMul(e).redAdd(r.redMul(this.a)).redAdd(e);return 0===n.redSqrt().redSqr().cmp(n)},i(c,o.BasePoint),s.prototype.decodePoint=function(t,e){return this.point(a.toArray(t,e),1)},s.prototype.point=function(t,e){return new c(this,t,e)},s.prototype.pointFromJSON=function(t){return c.fromJSON(this,t)},c.prototype.precompute=function(){},c.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},c.fromJSON=function(t,e){return new c(t,e[0],e[1]||t.one)},c.prototype.inspect=function(){return this.isInfinity()?"":""},c.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},c.prototype.dbl=function(){var t=this.x.redAdd(this.z).redSqr(),e=this.x.redSub(this.z).redSqr(),r=t.redSub(e),n=t.redMul(e),i=r.redMul(e.redAdd(this.curve.a24.redMul(r)));return this.curve.point(n,i)},c.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},c.prototype.diffAdd=function(t,e){var r=this.x.redAdd(this.z),n=this.x.redSub(this.z),i=t.x.redAdd(t.z),o=t.x.redSub(t.z).redMul(r),a=i.redMul(n),s=e.z.redMul(o.redAdd(a).redSqr()),c=e.x.redMul(o.redISub(a).redSqr());return this.curve.point(s,c)},c.prototype.mul=function(t){for(var e=t.clone(),r=this,n=this.curve.point(null,null),i=[];0!==e.cmpn(0);e.iushrn(1))i.push(e.andln(1));for(var o=i.length-1;o>=0;o--)0===i[o]?(r=r.diffAdd(n,this),n=n.dbl()):(n=r.diffAdd(n,this),r=r.dbl());return n},c.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},c.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},c.prototype.eq=function(t){return 0===this.getX().cmp(t.getX())},c.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},c.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},1585:(t,e,r)=>{"use strict";var n=r(7891),i=r(6781),o=r(376),a=r(9952),s=n.assert;function c(t){a.call(this,"short",t),this.a=new i(t.a,16).toRed(this.red),this.b=new i(t.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(t),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function u(t,e,r,n){a.BasePoint.call(this,t,"affine"),null===e&&null===r?(this.x=null,this.y=null,this.inf=!0):(this.x=new i(e,16),this.y=new i(r,16),n&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}function f(t,e,r,n){a.BasePoint.call(this,t,"jacobian"),null===e&&null===r&&null===n?(this.x=this.curve.one,this.y=this.curve.one,this.z=new i(0)):(this.x=new i(e,16),this.y=new i(r,16),this.z=new i(n,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}o(c,a),t.exports=c,c.prototype._getEndomorphism=function(t){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var e,r;if(t.beta)e=new i(t.beta,16).toRed(this.red);else{var n=this._getEndoRoots(this.p);e=(e=n[0].cmp(n[1])<0?n[0]:n[1]).toRed(this.red)}if(t.lambda)r=new i(t.lambda,16);else{var o=this._getEndoRoots(this.n);0===this.g.mul(o[0]).x.cmp(this.g.x.redMul(e))?r=o[0]:(r=o[1],s(0===this.g.mul(r).x.cmp(this.g.x.redMul(e))))}return{beta:e,lambda:r,basis:t.basis?t.basis.map((function(t){return{a:new i(t.a,16),b:new i(t.b,16)}})):this._getEndoBasis(r)}}},c.prototype._getEndoRoots=function(t){var e=t===this.p?this.red:i.mont(t),r=new i(2).toRed(e).redInvm(),n=r.redNeg(),o=new i(3).toRed(e).redNeg().redSqrt().redMul(r);return[n.redAdd(o).fromRed(),n.redSub(o).fromRed()]},c.prototype._getEndoBasis=function(t){for(var e,r,n,o,a,s,c,u,f,l=this.n.ushrn(Math.floor(this.n.bitLength()/2)),h=t,p=this.n.clone(),d=new i(1),y=new i(0),b=new i(0),m=new i(1),v=0;0!==h.cmpn(0);){var g=p.div(h);u=p.sub(g.mul(h)),f=b.sub(g.mul(d));var _=m.sub(g.mul(y));if(!n&&u.cmp(l)<0)e=c.neg(),r=d,n=u.neg(),o=f;else if(n&&2==++v)break;c=u,p=h,h=u,b=d,d=f,m=y,y=_}a=u.neg(),s=f;var w=n.sqr().add(o.sqr());return a.sqr().add(s.sqr()).cmp(w)>=0&&(a=e,s=r),n.negative&&(n=n.neg(),o=o.neg()),a.negative&&(a=a.neg(),s=s.neg()),[{a:n,b:o},{a,b:s}]},c.prototype._endoSplit=function(t){var e=this.endo.basis,r=e[0],n=e[1],i=n.b.mul(t).divRound(this.n),o=r.b.neg().mul(t).divRound(this.n),a=i.mul(r.a),s=o.mul(n.a),c=i.mul(r.b),u=o.mul(n.b);return{k1:t.sub(a).sub(s),k2:c.add(u).neg()}},c.prototype.pointFromX=function(t,e){(t=new i(t,16)).red||(t=t.toRed(this.red));var r=t.redSqr().redMul(t).redIAdd(t.redMul(this.a)).redIAdd(this.b),n=r.redSqrt();if(0!==n.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point");var o=n.fromRed().isOdd();return(e&&!o||!e&&o)&&(n=n.redNeg()),this.point(t,n)},c.prototype.validate=function(t){if(t.inf)return!0;var e=t.x,r=t.y,n=this.a.redMul(e),i=e.redSqr().redMul(e).redIAdd(n).redIAdd(this.b);return 0===r.redSqr().redISub(i).cmpn(0)},c.prototype._endoWnafMulAdd=function(t,e,r){for(var n=this._endoWnafT1,i=this._endoWnafT2,o=0;o":""},u.prototype.isInfinity=function(){return this.inf},u.prototype.add=function(t){if(this.inf)return t;if(t.inf)return this;if(this.eq(t))return this.dbl();if(this.neg().eq(t))return this.curve.point(null,null);if(0===this.x.cmp(t.x))return this.curve.point(null,null);var e=this.y.redSub(t.y);0!==e.cmpn(0)&&(e=e.redMul(this.x.redSub(t.x).redInvm()));var r=e.redSqr().redISub(this.x).redISub(t.x),n=e.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,n)},u.prototype.dbl=function(){if(this.inf)return this;var t=this.y.redAdd(this.y);if(0===t.cmpn(0))return this.curve.point(null,null);var e=this.curve.a,r=this.x.redSqr(),n=t.redInvm(),i=r.redAdd(r).redIAdd(r).redIAdd(e).redMul(n),o=i.redSqr().redISub(this.x.redAdd(this.x)),a=i.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,a)},u.prototype.getX=function(){return this.x.fromRed()},u.prototype.getY=function(){return this.y.fromRed()},u.prototype.mul=function(t){return t=new i(t,16),this.isInfinity()?this:this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve.endo?this.curve._endoWnafMulAdd([this],[t]):this.curve._wnafMul(this,t)},u.prototype.mulAdd=function(t,e,r){var n=[this,e],i=[t,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i):this.curve._wnafMulAdd(1,n,i,2)},u.prototype.jmulAdd=function(t,e,r){var n=[this,e],i=[t,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i,!0):this.curve._wnafMulAdd(1,n,i,2,!0)},u.prototype.eq=function(t){return this===t||this.inf===t.inf&&(this.inf||0===this.x.cmp(t.x)&&0===this.y.cmp(t.y))},u.prototype.neg=function(t){if(this.inf)return this;var e=this.curve.point(this.x,this.y.redNeg());if(t&&this.precomputed){var r=this.precomputed,n=function(t){return t.neg()};e.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(n)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(n)}}}return e},u.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},o(f,a.BasePoint),c.prototype.jpoint=function(t,e,r){return new f(this,t,e,r)},f.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var t=this.z.redInvm(),e=t.redSqr(),r=this.x.redMul(e),n=this.y.redMul(e).redMul(t);return this.curve.point(r,n)},f.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},f.prototype.add=function(t){if(this.isInfinity())return t;if(t.isInfinity())return this;var e=t.z.redSqr(),r=this.z.redSqr(),n=this.x.redMul(e),i=t.x.redMul(r),o=this.y.redMul(e.redMul(t.z)),a=t.y.redMul(r.redMul(this.z)),s=n.redSub(i),c=o.redSub(a);if(0===s.cmpn(0))return 0!==c.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=s.redSqr(),f=u.redMul(s),l=n.redMul(u),h=c.redSqr().redIAdd(f).redISub(l).redISub(l),p=c.redMul(l.redISub(h)).redISub(o.redMul(f)),d=this.z.redMul(t.z).redMul(s);return this.curve.jpoint(h,p,d)},f.prototype.mixedAdd=function(t){if(this.isInfinity())return t.toJ();if(t.isInfinity())return this;var e=this.z.redSqr(),r=this.x,n=t.x.redMul(e),i=this.y,o=t.y.redMul(e).redMul(this.z),a=r.redSub(n),s=i.redSub(o);if(0===a.cmpn(0))return 0!==s.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=a.redSqr(),u=c.redMul(a),f=r.redMul(c),l=s.redSqr().redIAdd(u).redISub(f).redISub(f),h=s.redMul(f.redISub(l)).redISub(i.redMul(u)),p=this.z.redMul(a);return this.curve.jpoint(l,h,p)},f.prototype.dblp=function(t){if(0===t)return this;if(this.isInfinity())return this;if(!t)return this.dbl();var e;if(this.curve.zeroA||this.curve.threeA){var r=this;for(e=0;e=0)return!1;if(r.redIAdd(i),0===this.x.cmp(r))return!0}},f.prototype.inspect=function(){return this.isInfinity()?"":""},f.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},1478:(t,e,r)=>{"use strict";var n,i=e,o=r(3192),a=r(4720),s=r(7891).assert;function c(t){"short"===t.type?this.curve=new a.short(t):"edwards"===t.type?this.curve=new a.edwards(t):this.curve=new a.mont(t),this.g=this.curve.g,this.n=this.curve.n,this.hash=t.hash,s(this.g.validate(),"Invalid curve"),s(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function u(t,e){Object.defineProperty(i,t,{configurable:!0,enumerable:!0,get:function(){var r=new c(e);return Object.defineProperty(i,t,{configurable:!0,enumerable:!0,value:r}),r}})}i.PresetCurve=c,u("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:o.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),u("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:o.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),u("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:o.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),u("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:o.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),u("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:o.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),u("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:o.sha256,gRed:!1,g:["9"]}),u("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:o.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{n=r(8948)}catch(t){n=void 0}u("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:o.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",n]})},5806:(t,e,r)=>{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}var i=r(6781),o=r(9742),a=r(7891),s=r(1478),c=r(7179),u=a.assert,f=r(3598),l=r(5206);function h(t){if(!(this instanceof h))return new h(t);"string"==typeof t&&(u(Object.prototype.hasOwnProperty.call(s,t),"Unknown curve "+t),t=s[t]),t instanceof s.PresetCurve&&(t={curve:t}),this.curve=t.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=t.curve.g,this.g.precompute(t.curve.n.bitLength()+1),this.hash=t.hash||t.curve.hash}t.exports=h,h.prototype.keyPair=function(t){return new f(this,t)},h.prototype.keyFromPrivate=function(t,e){return f.fromPrivate(this,t,e)},h.prototype.keyFromPublic=function(t,e){return f.fromPublic(this,t,e)},h.prototype.genKeyPair=function(t){t||(t={});for(var e=new o({hash:this.hash,pers:t.pers,persEnc:t.persEnc||"utf8",entropy:t.entropy||c(this.hash.hmacStrength),entropyEnc:t.entropy&&t.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),n=this.n.sub(new i(2));;){var a=new i(e.generate(r));if(!(a.cmp(n)>0))return a.iaddn(1),this.keyFromPrivate(a)}},h.prototype._truncateToN=function(t,e){var r=8*t.byteLength()-this.n.bitLength();return r>0&&(t=t.ushrn(r)),!e&&t.cmp(this.n)>=0?t.sub(this.n):t},h.prototype.sign=function(t,e,r,a){"object"===n(r)&&(a=r,r=null),a||(a={}),e=this.keyFromPrivate(e,r),t=this._truncateToN(new i(t,16));for(var s=this.n.byteLength(),c=e.getPrivate().toArray("be",s),u=t.toArray("be",s),f=new o({hash:this.hash,entropy:c,nonce:u,pers:a.pers,persEnc:a.persEnc||"utf8"}),h=this.n.sub(new i(1)),p=0;;p++){var d=a.k?a.k(p):new i(f.generate(this.n.byteLength()));if(!((d=this._truncateToN(d,!0)).cmpn(1)<=0||d.cmp(h)>=0)){var y=this.g.mul(d);if(!y.isInfinity()){var b=y.getX(),m=b.umod(this.n);if(0!==m.cmpn(0)){var v=d.invm(this.n).mul(m.mul(e.getPrivate()).iadd(t));if(0!==(v=v.umod(this.n)).cmpn(0)){var g=(y.getY().isOdd()?1:0)|(0!==b.cmp(m)?2:0);return a.canonical&&v.cmp(this.nh)>0&&(v=this.n.sub(v),g^=1),new l({r:m,s:v,recoveryParam:g})}}}}}},h.prototype.verify=function(t,e,r,n){t=this._truncateToN(new i(t,16)),r=this.keyFromPublic(r,n);var o=(e=new l(e,"hex")).r,a=e.s;if(o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;if(a.cmpn(1)<0||a.cmp(this.n)>=0)return!1;var s,c=a.invm(this.n),u=c.mul(t).umod(this.n),f=c.mul(o).umod(this.n);return this.curve._maxwellTrick?!(s=this.g.jmulAdd(u,r.getPublic(),f)).isInfinity()&&s.eqXToP(o):!(s=this.g.mulAdd(u,r.getPublic(),f)).isInfinity()&&0===s.getX().umod(this.n).cmp(o)},h.prototype.recoverPubKey=function(t,e,r,n){u((3&r)===r,"The recovery param is more than two bits"),e=new l(e,n);var o=this.n,a=new i(t),s=e.r,c=e.s,f=1&r,h=r>>1;if(s.cmp(this.curve.p.umod(this.curve.n))>=0&&h)throw new Error("Unable to find sencond key candinate");s=h?this.curve.pointFromX(s.add(this.curve.n),f):this.curve.pointFromX(s,f);var p=e.r.invm(o),d=o.sub(a).mul(p).umod(o),y=c.mul(p).umod(o);return this.g.mulAdd(d,s,y)},h.prototype.getKeyRecoveryParam=function(t,e,r,n){if(null!==(e=new l(e,n)).recoveryParam)return e.recoveryParam;for(var i=0;i<4;i++){var o;try{o=this.recoverPubKey(t,e,i)}catch(t){continue}if(o.eq(r))return i}throw new Error("Unable to find valid recovery factor")}},3598:(t,e,r)=>{"use strict";var n=r(6781),i=r(7891).assert;function o(t,e){this.ec=t,this.priv=null,this.pub=null,e.priv&&this._importPrivate(e.priv,e.privEnc),e.pub&&this._importPublic(e.pub,e.pubEnc)}t.exports=o,o.fromPublic=function(t,e,r){return e instanceof o?e:new o(t,{pub:e,pubEnc:r})},o.fromPrivate=function(t,e,r){return e instanceof o?e:new o(t,{priv:e,privEnc:r})},o.prototype.validate=function(){var t=this.getPublic();return t.isInfinity()?{result:!1,reason:"Invalid public key"}:t.validate()?t.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},o.prototype.getPublic=function(t,e){return"string"==typeof t&&(e=t,t=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),e?this.pub.encode(e,t):this.pub},o.prototype.getPrivate=function(t){return"hex"===t?this.priv.toString(16,2):this.priv},o.prototype._importPrivate=function(t,e){this.priv=new n(t,e||16),this.priv=this.priv.umod(this.ec.curve.n)},o.prototype._importPublic=function(t,e){if(t.x||t.y)return"mont"===this.ec.curve.type?i(t.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||i(t.x&&t.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(t.x,t.y));this.pub=this.ec.curve.decodePoint(t,e)},o.prototype.derive=function(t){return t.validate()||i(t.validate(),"public point not validated"),t.mul(this.priv).getX()},o.prototype.sign=function(t,e,r){return this.ec.sign(t,this,e,r)},o.prototype.verify=function(t,e){return this.ec.verify(t,e,this)},o.prototype.inspect=function(){return""}},5206:(t,e,r)=>{"use strict";var n=r(6781),i=r(7891),o=i.assert;function a(t,e){if(t instanceof a)return t;this._importDER(t,e)||(o(t.r&&t.s,"Signature without r or s"),this.r=new n(t.r,16),this.s=new n(t.s,16),void 0===t.recoveryParam?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}function s(){this.place=0}function c(t,e){var r=t[e.place++];if(!(128&r))return r;var n=15&r;if(0===n||n>4)return!1;for(var i=0,o=0,a=e.place;o>>=0;return!(i<=127)&&(e.place=a,i)}function u(t){for(var e=0,r=t.length-1;!t[e]&&!(128&t[e+1])&&e>>3);for(t.push(128|r);--r;)t.push(e>>>(r<<3)&255);t.push(e)}}t.exports=a,a.prototype._importDER=function(t,e){t=i.toArray(t,e);var r=new s;if(48!==t[r.place++])return!1;var o=c(t,r);if(!1===o)return!1;if(o+r.place!==t.length)return!1;if(2!==t[r.place++])return!1;var a=c(t,r);if(!1===a)return!1;var u=t.slice(r.place,a+r.place);if(r.place+=a,2!==t[r.place++])return!1;var f=c(t,r);if(!1===f)return!1;if(t.length!==f+r.place)return!1;var l=t.slice(r.place,f+r.place);if(0===u[0]){if(!(128&u[1]))return!1;u=u.slice(1)}if(0===l[0]){if(!(128&l[1]))return!1;l=l.slice(1)}return this.r=new n(u),this.s=new n(l),this.recoveryParam=null,!0},a.prototype.toDER=function(t){var e=this.r.toArray(),r=this.s.toArray();for(128&e[0]&&(e=[0].concat(e)),128&r[0]&&(r=[0].concat(r)),e=u(e),r=u(r);!(r[0]||128&r[1]);)r=r.slice(1);var n=[2];f(n,e.length),(n=n.concat(e)).push(2),f(n,r.length);var o=n.concat(r),a=[48];return f(a,o.length),a=a.concat(o),i.encode(a,t)}},8318:(t,e,r)=>{"use strict";var n=r(3192),i=r(1478),o=r(7891),a=o.assert,s=o.parseBytes,c=r(9371),u=r(2214);function f(t){if(a("ed25519"===t,"only tested with ed25519 so far"),!(this instanceof f))return new f(t);t=i[t].curve,this.curve=t,this.g=t.g,this.g.precompute(t.n.bitLength()+1),this.pointClass=t.point().constructor,this.encodingLength=Math.ceil(t.n.bitLength()/8),this.hash=n.sha512}t.exports=f,f.prototype.sign=function(t,e){t=s(t);var r=this.keyFromSecret(e),n=this.hashInt(r.messagePrefix(),t),i=this.g.mul(n),o=this.encodePoint(i),a=this.hashInt(o,r.pubBytes(),t).mul(r.priv()),c=n.add(a).umod(this.curve.n);return this.makeSignature({R:i,S:c,Rencoded:o})},f.prototype.verify=function(t,e,r){t=s(t),e=this.makeSignature(e);var n=this.keyFromPublic(r),i=this.hashInt(e.Rencoded(),n.pubBytes(),t),o=this.g.mul(e.S());return e.R().add(n.pub().mul(i)).eq(o)},f.prototype.hashInt=function(){for(var t=this.hash(),e=0;e{"use strict";var n=r(7891),i=n.assert,o=n.parseBytes,a=n.cachedProperty;function s(t,e){this.eddsa=t,this._secret=o(e.secret),t.isPoint(e.pub)?this._pub=e.pub:this._pubBytes=o(e.pub)}s.fromPublic=function(t,e){return e instanceof s?e:new s(t,{pub:e})},s.fromSecret=function(t,e){return e instanceof s?e:new s(t,{secret:e})},s.prototype.secret=function(){return this._secret},a(s,"pubBytes",(function(){return this.eddsa.encodePoint(this.pub())})),a(s,"pub",(function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())})),a(s,"privBytes",(function(){var t=this.eddsa,e=this.hash(),r=t.encodingLength-1,n=e.slice(0,t.encodingLength);return n[0]&=248,n[r]&=127,n[r]|=64,n})),a(s,"priv",(function(){return this.eddsa.decodeInt(this.privBytes())})),a(s,"hash",(function(){return this.eddsa.hash().update(this.secret()).digest()})),a(s,"messagePrefix",(function(){return this.hash().slice(this.eddsa.encodingLength)})),s.prototype.sign=function(t){return i(this._secret,"KeyPair can only verify"),this.eddsa.sign(t,this)},s.prototype.verify=function(t,e){return this.eddsa.verify(t,e,this)},s.prototype.getSecret=function(t){return i(this._secret,"KeyPair is public only"),n.encode(this.secret(),t)},s.prototype.getPublic=function(t){return n.encode(this.pubBytes(),t)},t.exports=s},2214:(t,e,r)=>{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}var i=r(6781),o=r(7891),a=o.assert,s=o.cachedProperty,c=o.parseBytes;function u(t,e){this.eddsa=t,"object"!==n(e)&&(e=c(e)),Array.isArray(e)&&(e={R:e.slice(0,t.encodingLength),S:e.slice(t.encodingLength)}),a(e.R&&e.S,"Signature without R or S"),t.isPoint(e.R)&&(this._R=e.R),e.S instanceof i&&(this._S=e.S),this._Rencoded=Array.isArray(e.R)?e.R:e.Rencoded,this._Sencoded=Array.isArray(e.S)?e.S:e.Sencoded}s(u,"S",(function(){return this.eddsa.decodeInt(this.Sencoded())})),s(u,"R",(function(){return this.eddsa.decodePoint(this.Rencoded())})),s(u,"Rencoded",(function(){return this.eddsa.encodePoint(this.R())})),s(u,"Sencoded",(function(){return this.eddsa.encodeInt(this.S())})),u.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},u.prototype.toHex=function(){return o.encode(this.toBytes(),"hex").toUpperCase()},t.exports=u},8948:t=>{t.exports={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}}},7891:(t,e,r)=>{"use strict";var n=e,i=r(6781),o=r(1130),a=r(5522);n.assert=o,n.toArray=a.toArray,n.zero2=a.zero2,n.toHex=a.toHex,n.encode=a.encode,n.getNAF=function(t,e,r){var n=new Array(Math.max(t.bitLength(),r)+1);n.fill(0);for(var i=1<(i>>1)-1?(i>>1)-c:c,o.isubn(s)):s=0,n[a]=s,o.iushrn(1)}return n},n.getJSF=function(t,e){var r=[[],[]];t=t.clone(),e=e.clone();for(var n,i=0,o=0;t.cmpn(-i)>0||e.cmpn(-o)>0;){var a,s,c=t.andln(3)+i&3,u=e.andln(3)+o&3;3===c&&(c=-1),3===u&&(u=-1),a=0==(1&c)?0:3!=(n=t.andln(7)+i&7)&&5!==n||2!==u?c:-c,r[0].push(a),s=0==(1&u)?0:3!=(n=e.andln(7)+o&7)&&5!==n||2!==c?u:-u,r[1].push(s),2*i===a+1&&(i=1-i),2*o===s+1&&(o=1-o),t.iushrn(1),e.iushrn(1)}return r},n.cachedProperty=function(t,e,r){var n="_"+e;t.prototype[e]=function(){return void 0!==this[n]?this[n]:this[n]=r.call(this)}},n.parseBytes=function(t){return"string"==typeof t?n.toArray(t,"hex"):t},n.intFromLE=function(t){return new i(t,"hex","le")}},8028:t=>{"use strict";function e(t,e){if(null==t)throw new TypeError("Cannot convert first argument to object");for(var r=Object(t),n=1;n{"use strict";function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},e(t)}var r,n="object"===("undefined"==typeof Reflect?"undefined":e(Reflect))?Reflect:null,i=n&&"function"==typeof n.apply?n.apply:function(t,e,r){return Function.prototype.apply.call(t,e,r)};r=n&&"function"==typeof n.ownKeys?n.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var o=Number.isNaN||function(t){return t!=t};function a(){a.init.call(this)}t.exports=a,t.exports.once=function(t,e){return new Promise((function(r,n){function i(r){t.removeListener(e,o),n(r)}function o(){"function"==typeof t.removeListener&&t.removeListener("error",i),r([].slice.call(arguments))}b(t,e,o,{once:!0}),"error"!==e&&function(t,e,r){"function"==typeof t.on&&b(t,"error",e,{once:!0})}(t,i)}))},a.EventEmitter=a,a.prototype._events=void 0,a.prototype._eventsCount=0,a.prototype._maxListeners=void 0;var s=10;function c(t){if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+e(t))}function u(t){return void 0===t._maxListeners?a.defaultMaxListeners:t._maxListeners}function f(t,e,r,n){var i,o,a,s;if(c(r),void 0===(o=t._events)?(o=t._events=Object.create(null),t._eventsCount=0):(void 0!==o.newListener&&(t.emit("newListener",e,r.listener?r.listener:r),o=t._events),a=o[e]),void 0===a)a=o[e]=r,++t._eventsCount;else if("function"==typeof a?a=o[e]=n?[r,a]:[a,r]:n?a.unshift(r):a.push(r),(i=u(t))>0&&a.length>i&&!a.warned){a.warned=!0;var f=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");f.name="MaxListenersExceededWarning",f.emitter=t,f.type=e,f.count=a.length,s=f,console&&console.warn&&console.warn(s)}return t}function l(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function h(t,e,r){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},i=l.bind(n);return i.listener=r,n.wrapFn=i,i}function p(t,e,r){var n=t._events;if(void 0===n)return[];var i=n[e];return void 0===i?[]:"function"==typeof i?r?[i.listener||i]:[i]:r?function(t){for(var e=new Array(t.length),r=0;r0&&(a=e[0]),a instanceof Error)throw a;var s=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw s.context=a,s}var c=o[t];if(void 0===c)return!1;if("function"==typeof c)i(c,this,e);else{var u=c.length,f=y(c,u);for(r=0;r=0;o--)if(r[o]===e||r[o].listener===e){a=r[o].listener,i=o;break}if(i<0)return this;0===i?r.shift():function(t,e){for(;e+1=0;n--)this.removeListener(t,e[n]);return this},a.prototype.listeners=function(t){return p(this,t,!0)},a.prototype.rawListeners=function(t){return p(this,t,!1)},a.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):d.call(t,e)},a.prototype.listenerCount=d,a.prototype.eventNames=function(){return this._eventsCount>0?r(this._events):[]}},1248:(t,e,r)=>{var n=r(9047).Buffer,i=r(722);t.exports=function(t,e,r,o){if(n.isBuffer(t)||(t=n.from(t,"binary")),e&&(n.isBuffer(e)||(e=n.from(e,"binary")),8!==e.length))throw new RangeError("salt should be Buffer with 8 byte length");for(var a=r/8,s=n.alloc(a),c=n.alloc(o||0),u=n.alloc(0);a>0||o>0;){var f=new i;f.update(u),f.update(t),e&&f.update(e),u=f.digest();var l=0;if(a>0){var h=s.length-a;l=Math.min(a,u.length),u.copy(s,h,0,l),a-=l}if(l0){var p=c.length-o,d=Math.min(o,u.length-l);u.copy(c,p,l,l+d),o-=d}}return u.fill(0),{key:s,iv:c}}},5337:(t,e,r)=>{"use strict";var n=r(8625),i=Object.prototype.toString,o=Object.prototype.hasOwnProperty,a=function(t,e,r){for(var n=0,i=t.length;n=3&&(o=r),"[object Array]"===i.call(t)?a(t,e,o):"string"==typeof t?s(t,e,o):c(t,e,o)}},5929:t=>{"use strict";var e="Function.prototype.bind called on incompatible ",r=Array.prototype.slice,n=Object.prototype.toString,i="[object Function]";t.exports=function(t){var o=this;if("function"!=typeof o||n.call(o)!==i)throw new TypeError(e+o);for(var a,s=r.call(arguments,1),c=function(){if(this instanceof a){var e=o.apply(this,s.concat(r.call(arguments)));return Object(e)===e?e:this}return o.apply(t,s.concat(r.call(arguments)))},u=Math.max(0,o.length-s.length),f=[],l=0;l{"use strict";var n=r(5929);t.exports=Function.prototype.bind||n},6893:(t,e,r)=>{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}var i,o=SyntaxError,a=Function,s=TypeError,c=function(t){try{return a('"use strict"; return ('+t+").constructor;")()}catch(t){}},u=Object.getOwnPropertyDescriptor;if(u)try{u({},"")}catch(t){u=null}var f=function(){throw new s},l=u?function(){try{return f}catch(t){try{return u(arguments,"callee").get}catch(t){return f}}}():f,h=r(5990)(),p=Object.getPrototypeOf||function(t){return t.__proto__},d={},y="undefined"==typeof Uint8Array?i:p(Uint8Array),b={"%AggregateError%":"undefined"==typeof AggregateError?i:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?i:ArrayBuffer,"%ArrayIteratorPrototype%":h?p([][Symbol.iterator]()):i,"%AsyncFromSyncIteratorPrototype%":i,"%AsyncFunction%":d,"%AsyncGenerator%":d,"%AsyncGeneratorFunction%":d,"%AsyncIteratorPrototype%":d,"%Atomics%":"undefined"==typeof Atomics?i:Atomics,"%BigInt%":"undefined"==typeof BigInt?i:BigInt,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?i:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":"undefined"==typeof Float32Array?i:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?i:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?i:FinalizationRegistry,"%Function%":a,"%GeneratorFunction%":d,"%Int8Array%":"undefined"==typeof Int8Array?i:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?i:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?i:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":h?p(p([][Symbol.iterator]())):i,"%JSON%":"object"===("undefined"==typeof JSON?"undefined":n(JSON))?JSON:i,"%Map%":"undefined"==typeof Map?i:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&h?p((new Map)[Symbol.iterator]()):i,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?i:Promise,"%Proxy%":"undefined"==typeof Proxy?i:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":"undefined"==typeof Reflect?i:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?i:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&h?p((new Set)[Symbol.iterator]()):i,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?i:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":h?p(""[Symbol.iterator]()):i,"%Symbol%":h?Symbol:i,"%SyntaxError%":o,"%ThrowTypeError%":l,"%TypedArray%":y,"%TypeError%":s,"%Uint8Array%":"undefined"==typeof Uint8Array?i:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?i:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?i:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?i:Uint32Array,"%URIError%":URIError,"%WeakMap%":"undefined"==typeof WeakMap?i:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?i:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?i:WeakSet},m=function t(e){var r;if("%AsyncFunction%"===e)r=c("async function () {}");else if("%GeneratorFunction%"===e)r=c("function* () {}");else if("%AsyncGeneratorFunction%"===e)r=c("async function* () {}");else if("%AsyncGenerator%"===e){var n=t("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if("%AsyncIteratorPrototype%"===e){var i=t("%AsyncGenerator%");i&&(r=p(i.prototype))}return b[e]=r,r},v={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},g=r(5246),_=r(7751),w=g.call(Function.call,Array.prototype.concat),S=g.call(Function.apply,Array.prototype.splice),O=g.call(Function.call,String.prototype.replace),A=g.call(Function.call,String.prototype.slice),E=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,j=/\\(\\)?/g,$=function(t){var e=A(t,0,1),r=A(t,-1);if("%"===e&&"%"!==r)throw new o("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==e)throw new o("invalid intrinsic syntax, expected opening `%`");var n=[];return O(t,E,(function(t,e,r,i){n[n.length]=r?O(i,j,"$1"):e||t})),n},x=function(t,e){var r,n=t;if(_(v,n)&&(n="%"+(r=v[n])[0]+"%"),_(b,n)){var i=b[n];if(i===d&&(i=m(n)),void 0===i&&!e)throw new s("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:r,name:n,value:i}}throw new o("intrinsic "+t+" does not exist!")};t.exports=function(t,e){if("string"!=typeof t||0===t.length)throw new s("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof e)throw new s('"allowMissing" argument must be a boolean');var r=$(t),n=r.length>0?r[0]:"",i=x("%"+n+"%",e),a=i.name,c=i.value,f=!1,l=i.alias;l&&(n=l[0],S(r,w([0,1],l)));for(var h=1,p=!0;h=r.length){var v=u(c,d);c=(p=!!v)&&"get"in v&&!("originalValue"in v.get)?v.get:c[d]}else p=_(c,d),c=c[d];p&&!f&&(b[a]=c)}}return c}},2579:(t,e,r)=>{"use strict";var n=r(6893)("%Object.defineProperty%",!0),i=function(){if(n)try{return n({},"a",{value:1}),!0}catch(t){return!1}return!1};i.hasArrayLengthDefineBug=function(){if(!i())return null;try{return 1!==n([],"length",{value:1}).length}catch(t){return!0}},t.exports=i},5990:(t,e,r)=>{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}var i="undefined"!=typeof Symbol&&Symbol,o=r(3031);t.exports=function(){return"function"==typeof i&&"function"==typeof Symbol&&"symbol"===n(i("foo"))&&"symbol"===n(Symbol("bar"))&&o()}},3031:t=>{"use strict";function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},e(t)}t.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"===e(Symbol.iterator))return!0;var t={},r=Symbol("test"),n=Object(r);if("string"==typeof r)return!1;if("[object Symbol]"!==Object.prototype.toString.call(r))return!1;if("[object Symbol]"!==Object.prototype.toString.call(n))return!1;for(r in t[r]=42,t)return!1;if("function"==typeof Object.keys&&0!==Object.keys(t).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(t).length)return!1;var i=Object.getOwnPropertySymbols(t);if(1!==i.length||i[0]!==r)return!1;if(!Object.prototype.propertyIsEnumerable.call(t,r))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var o=Object.getOwnPropertyDescriptor(t,r);if(42!==o.value||!0!==o.enumerable)return!1}return!0}},5994:(t,e,r)=>{"use strict";var n=r(3031);t.exports=function(){return n()&&!!Symbol.toStringTag}},7751:(t,e,r)=>{"use strict";var n=r(5246);t.exports=n.call(Function.call,Object.prototype.hasOwnProperty)},5125:(t,e,r)=>{"use strict";var n=r(1066).Buffer,i=r(8237).Transform;function o(t){i.call(this),this._block=n.allocUnsafe(t),this._blockSize=t,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}r(376)(o,i),o.prototype._transform=function(t,e,r){var n=null;try{this.update(t,e)}catch(t){n=t}r(n)},o.prototype._flush=function(t){var e=null;try{this.push(this.digest())}catch(t){e=t}t(e)},o.prototype.update=function(t,e){if(function(t,e){if(!n.isBuffer(t)&&"string"!=typeof t)throw new TypeError("Data must be a string or a buffer")}(t),this._finalized)throw new Error("Digest already called");n.isBuffer(t)||(t=n.from(t,e));for(var r=this._block,i=0;this._blockOffset+t.length-i>=this._blockSize;){for(var o=this._blockOffset;o0;++a)this._length[a]+=s,(s=this._length[a]/4294967296|0)>0&&(this._length[a]-=4294967296*s);return this},o.prototype._update=function(){throw new Error("_update is not implemented")},o.prototype.digest=function(t){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var e=this._digest();void 0!==t&&(e=e.toString(t)),this._block.fill(0),this._blockOffset=0;for(var r=0;r<4;++r)this._length[r]=0;return e},o.prototype._digest=function(){throw new Error("_digest is not implemented")},t.exports=o},1066:(t,e,r)=>{var n=r(365),i=n.Buffer;function o(t,e){for(var r in t)e[r]=t[r]}function a(t,e,r){return i(t,e,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?t.exports=n:(o(n,e),e.Buffer=a),a.prototype=Object.create(i.prototype),o(i,a),a.from=function(t,e,r){if("number"==typeof t)throw new TypeError("Argument must not be a number");return i(t,e,r)},a.alloc=function(t,e,r){if("number"!=typeof t)throw new TypeError("Argument must be a number");var n=i(t);return void 0!==e?"string"==typeof r?n.fill(e,r):n.fill(e):n.fill(0),n},a.allocUnsafe=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return i(t)},a.allocUnsafeSlow=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return n.SlowBuffer(t)}},3192:(t,e,r)=>{var n=e;n.utils=r(8244),n.common=r(5386),n.sha=r(2507),n.ripemd=r(9993),n.hmac=r(8534),n.sha1=n.sha.sha1,n.sha256=n.sha.sha256,n.sha224=n.sha.sha224,n.sha384=n.sha.sha384,n.sha512=n.sha.sha512,n.ripemd160=n.ripemd.ripemd160},5386:(t,e,r)=>{"use strict";var n=r(8244),i=r(1130);function o(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}e.BlockHash=o,o.prototype.update=function(t,e){if(t=n.toArray(t,e),this.pending?this.pending=this.pending.concat(t):this.pending=t,this.pendingTotal+=t.length,this.pending.length>=this._delta8){var r=(t=this.pending).length%this._delta8;this.pending=t.slice(t.length-r,t.length),0===this.pending.length&&(this.pending=null),t=n.join32(t,0,t.length-r,this.endian);for(var i=0;i>>24&255,n[i++]=t>>>16&255,n[i++]=t>>>8&255,n[i++]=255&t}else for(n[i++]=255&t,n[i++]=t>>>8&255,n[i++]=t>>>16&255,n[i++]=t>>>24&255,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,o=8;o{"use strict";var n=r(8244),i=r(1130);function o(t,e,r){if(!(this instanceof o))return new o(t,e,r);this.Hash=t,this.blockSize=t.blockSize/8,this.outSize=t.outSize/8,this.inner=null,this.outer=null,this._init(n.toArray(e,r))}t.exports=o,o.prototype._init=function(t){t.length>this.blockSize&&(t=(new this.Hash).update(t).digest()),i(t.length<=this.blockSize);for(var e=t.length;e{"use strict";var n=r(8244),i=r(5386),o=n.rotl32,a=n.sum32,s=n.sum32_3,c=n.sum32_4,u=i.BlockHash;function f(){if(!(this instanceof f))return new f;u.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}function l(t,e,r,n){return t<=15?e^r^n:t<=31?e&r|~e&n:t<=47?(e|~r)^n:t<=63?e&n|r&~n:e^(r|~n)}function h(t){return t<=15?0:t<=31?1518500249:t<=47?1859775393:t<=63?2400959708:2840853838}function p(t){return t<=15?1352829926:t<=31?1548603684:t<=47?1836072691:t<=63?2053994217:0}n.inherits(f,u),e.ripemd160=f,f.blockSize=512,f.outSize=160,f.hmacStrength=192,f.padLength=64,f.prototype._update=function(t,e){for(var r=this.h[0],n=this.h[1],i=this.h[2],u=this.h[3],f=this.h[4],v=r,g=n,_=i,w=u,S=f,O=0;O<80;O++){var A=a(o(c(r,l(O,n,i,u),t[d[O]+e],h(O)),b[O]),f);r=f,f=u,u=o(i,10),i=n,n=A,A=a(o(c(v,l(79-O,g,_,w),t[y[O]+e],p(O)),m[O]),S),v=S,S=w,w=o(_,10),_=g,g=A}A=s(this.h[1],i,w),this.h[1]=s(this.h[2],u,S),this.h[2]=s(this.h[3],f,v),this.h[3]=s(this.h[4],r,g),this.h[4]=s(this.h[0],n,_),this.h[0]=A},f.prototype._digest=function(t){return"hex"===t?n.toHex32(this.h,"little"):n.split32(this.h,"little")};var d=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],y=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],b=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],m=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]},2507:(t,e,r)=>{"use strict";e.sha1=r(9382),e.sha224=r(5123),e.sha256=r(4032),e.sha384=r(1364),e.sha512=r(2161)},9382:(t,e,r)=>{"use strict";var n=r(8244),i=r(5386),o=r(8355),a=n.rotl32,s=n.sum32,c=n.sum32_5,u=o.ft_1,f=i.BlockHash,l=[1518500249,1859775393,2400959708,3395469782];function h(){if(!(this instanceof h))return new h;f.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}n.inherits(h,f),t.exports=h,h.blockSize=512,h.outSize=160,h.hmacStrength=80,h.padLength=64,h.prototype._update=function(t,e){for(var r=this.W,n=0;n<16;n++)r[n]=t[e+n];for(;n{"use strict";var n=r(8244),i=r(4032);function o(){if(!(this instanceof o))return new o;i.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}n.inherits(o,i),t.exports=o,o.blockSize=512,o.outSize=224,o.hmacStrength=192,o.padLength=64,o.prototype._digest=function(t){return"hex"===t?n.toHex32(this.h.slice(0,7),"big"):n.split32(this.h.slice(0,7),"big")}},4032:(t,e,r)=>{"use strict";var n=r(8244),i=r(5386),o=r(8355),a=r(1130),s=n.sum32,c=n.sum32_4,u=n.sum32_5,f=o.ch32,l=o.maj32,h=o.s0_256,p=o.s1_256,d=o.g0_256,y=o.g1_256,b=i.BlockHash,m=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function v(){if(!(this instanceof v))return new v;b.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=m,this.W=new Array(64)}n.inherits(v,b),t.exports=v,v.blockSize=512,v.outSize=256,v.hmacStrength=192,v.padLength=64,v.prototype._update=function(t,e){for(var r=this.W,n=0;n<16;n++)r[n]=t[e+n];for(;n{"use strict";var n=r(8244),i=r(2161);function o(){if(!(this instanceof o))return new o;i.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}n.inherits(o,i),t.exports=o,o.blockSize=1024,o.outSize=384,o.hmacStrength=192,o.padLength=128,o.prototype._digest=function(t){return"hex"===t?n.toHex32(this.h.slice(0,12),"big"):n.split32(this.h.slice(0,12),"big")}},2161:(t,e,r)=>{"use strict";var n=r(8244),i=r(5386),o=r(1130),a=n.rotr64_hi,s=n.rotr64_lo,c=n.shr64_hi,u=n.shr64_lo,f=n.sum64,l=n.sum64_hi,h=n.sum64_lo,p=n.sum64_4_hi,d=n.sum64_4_lo,y=n.sum64_5_hi,b=n.sum64_5_lo,m=i.BlockHash,v=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function g(){if(!(this instanceof g))return new g;m.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=v,this.W=new Array(160)}function _(t,e,r,n,i){var o=t&r^~t&i;return o<0&&(o+=4294967296),o}function w(t,e,r,n,i,o){var a=e&n^~e&o;return a<0&&(a+=4294967296),a}function S(t,e,r,n,i){var o=t&r^t&i^r&i;return o<0&&(o+=4294967296),o}function O(t,e,r,n,i,o){var a=e&n^e&o^n&o;return a<0&&(a+=4294967296),a}function A(t,e){var r=a(t,e,28)^a(e,t,2)^a(e,t,7);return r<0&&(r+=4294967296),r}function E(t,e){var r=s(t,e,28)^s(e,t,2)^s(e,t,7);return r<0&&(r+=4294967296),r}function j(t,e){var r=s(t,e,14)^s(t,e,18)^s(e,t,9);return r<0&&(r+=4294967296),r}function $(t,e){var r=a(t,e,1)^a(t,e,8)^c(t,e,7);return r<0&&(r+=4294967296),r}function x(t,e){var r=s(t,e,1)^s(t,e,8)^u(t,e,7);return r<0&&(r+=4294967296),r}function P(t,e){var r=s(t,e,19)^s(e,t,29)^u(t,e,6);return r<0&&(r+=4294967296),r}n.inherits(g,m),t.exports=g,g.blockSize=1024,g.outSize=512,g.hmacStrength=192,g.padLength=128,g.prototype._prepareBlock=function(t,e){for(var r=this.W,n=0;n<32;n++)r[n]=t[e+n];for(;n{"use strict";var n=r(8244).rotr32;function i(t,e,r){return t&e^~t&r}function o(t,e,r){return t&e^t&r^e&r}function a(t,e,r){return t^e^r}e.ft_1=function(t,e,r,n){return 0===t?i(e,r,n):1===t||3===t?a(e,r,n):2===t?o(e,r,n):void 0},e.ch32=i,e.maj32=o,e.p32=a,e.s0_256=function(t){return n(t,2)^n(t,13)^n(t,22)},e.s1_256=function(t){return n(t,6)^n(t,11)^n(t,25)},e.g0_256=function(t){return n(t,7)^n(t,18)^t>>>3},e.g1_256=function(t){return n(t,17)^n(t,19)^t>>>10}},8244:(t,e,r)=>{"use strict";var n=r(1130),i=r(376);function o(t,e){return 55296==(64512&t.charCodeAt(e))&&!(e<0||e+1>=t.length)&&56320==(64512&t.charCodeAt(e+1))}function a(t){return(t>>>24|t>>>8&65280|t<<8&16711680|(255&t)<<24)>>>0}function s(t){return 1===t.length?"0"+t:t}function c(t){return 7===t.length?"0"+t:6===t.length?"00"+t:5===t.length?"000"+t:4===t.length?"0000"+t:3===t.length?"00000"+t:2===t.length?"000000"+t:1===t.length?"0000000"+t:t}e.inherits=i,e.toArray=function(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var r=[];if("string"==typeof t)if(e){if("hex"===e)for((t=t.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(t="0"+t),i=0;i>6|192,r[n++]=63&a|128):o(t,i)?(a=65536+((1023&a)<<10)+(1023&t.charCodeAt(++i)),r[n++]=a>>18|240,r[n++]=a>>12&63|128,r[n++]=a>>6&63|128,r[n++]=63&a|128):(r[n++]=a>>12|224,r[n++]=a>>6&63|128,r[n++]=63&a|128)}else for(i=0;i>>0}return a},e.split32=function(t,e){for(var r=new Array(4*t.length),n=0,i=0;n>>24,r[i+1]=o>>>16&255,r[i+2]=o>>>8&255,r[i+3]=255&o):(r[i+3]=o>>>24,r[i+2]=o>>>16&255,r[i+1]=o>>>8&255,r[i]=255&o)}return r},e.rotr32=function(t,e){return t>>>e|t<<32-e},e.rotl32=function(t,e){return t<>>32-e},e.sum32=function(t,e){return t+e>>>0},e.sum32_3=function(t,e,r){return t+e+r>>>0},e.sum32_4=function(t,e,r,n){return t+e+r+n>>>0},e.sum32_5=function(t,e,r,n,i){return t+e+r+n+i>>>0},e.sum64=function(t,e,r,n){var i=t[e],o=n+t[e+1]>>>0,a=(o>>0,t[e+1]=o},e.sum64_hi=function(t,e,r,n){return(e+n>>>0>>0},e.sum64_lo=function(t,e,r,n){return e+n>>>0},e.sum64_4_hi=function(t,e,r,n,i,o,a,s){var c=0,u=e;return c+=(u=u+n>>>0)>>0)>>0)>>0},e.sum64_4_lo=function(t,e,r,n,i,o,a,s){return e+n+o+s>>>0},e.sum64_5_hi=function(t,e,r,n,i,o,a,s,c,u){var f=0,l=e;return f+=(l=l+n>>>0)>>0)>>0)>>0)>>0},e.sum64_5_lo=function(t,e,r,n,i,o,a,s,c,u){return e+n+o+s+u>>>0},e.rotr64_hi=function(t,e,r){return(e<<32-r|t>>>r)>>>0},e.rotr64_lo=function(t,e,r){return(t<<32-r|e>>>r)>>>0},e.shr64_hi=function(t,e,r){return t>>>r},e.shr64_lo=function(t,e,r){return(t<<32-r|e>>>r)>>>0}},9742:(t,e,r)=>{"use strict";var n=r(3192),i=r(5522),o=r(1130);function a(t){if(!(this instanceof a))return new a(t);this.hash=t.hash,this.predResist=!!t.predResist,this.outLen=this.hash.outSize,this.minEntropy=t.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var e=i.toArray(t.entropy,t.entropyEnc||"hex"),r=i.toArray(t.nonce,t.nonceEnc||"hex"),n=i.toArray(t.pers,t.persEnc||"hex");o(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,r,n)}t.exports=a,a.prototype._init=function(t,e,r){var n=t.concat(e).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var i=0;i=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(t.concat(r||[])),this._reseed=1},a.prototype.generate=function(t,e,r,n){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof e&&(n=r,r=e,e=null),r&&(r=i.toArray(r,n||"hex"),this._update(r));for(var o=[];o.length{e.read=function(t,e,r,n,i){var o,a,s=8*i-n-1,c=(1<>1,f=-7,l=r?i-1:0,h=r?-1:1,p=t[e+l];for(l+=h,o=p&(1<<-f)-1,p>>=-f,f+=s;f>0;o=256*o+t[e+l],l+=h,f-=8);for(a=o&(1<<-f)-1,o>>=-f,f+=n;f>0;a=256*a+t[e+l],l+=h,f-=8);if(0===o)o=1-u;else{if(o===c)return a?NaN:1/0*(p?-1:1);a+=Math.pow(2,n),o-=u}return(p?-1:1)*a*Math.pow(2,o-n)},e.write=function(t,e,r,n,i,o){var a,s,c,u=8*o-i-1,f=(1<>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:o-1,d=n?1:-1,y=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,a=f):(a=Math.floor(Math.log(e)/Math.LN2),e*(c=Math.pow(2,-a))<1&&(a--,c*=2),(e+=a+l>=1?h/c:h*Math.pow(2,1-l))*c>=2&&(a++,c/=2),a+l>=f?(s=0,a=f):a+l>=1?(s=(e*c-1)*Math.pow(2,i),a+=l):(s=e*Math.pow(2,l-1)*Math.pow(2,i),a=0));i>=8;t[r+p]=255&s,p+=d,s/=256,i-=8);for(a=a<0;t[r+p]=255&a,p+=d,a/=256,u-=8);t[r+p-d]|=128*y}},376:t=>{"function"==typeof Object.create?t.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(t,e){if(e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}}},2755:(t,e,r)=>{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}var i=r(5994)(),o=r(8780)("Object.prototype.toString"),a=function(t){return!(i&&t&&"object"===n(t)&&Symbol.toStringTag in t)&&"[object Arguments]"===o(t)},s=function(t){return!!a(t)||null!==t&&"object"===n(t)&&"number"==typeof t.length&&t.length>=0&&"[object Array]"!==o(t)&&"[object Function]"===o(t.callee)},c=function(){return a(arguments)}();a.isLegacyArguments=s,t.exports=c?a:s},8625:t=>{"use strict";function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},e(t)}var r,n,i=Function.prototype.toString,o="object"===("undefined"==typeof Reflect?"undefined":e(Reflect))&&null!==Reflect&&Reflect.apply;if("function"==typeof o&&"function"==typeof Object.defineProperty)try{r=Object.defineProperty({},"length",{get:function(){throw n}}),n={},o((function(){throw 42}),null,r)}catch(t){t!==n&&(o=null)}else o=null;var a=/^\s*class\b/,s=function(t){try{var e=i.call(t);return a.test(e)}catch(t){return!1}},c=Object.prototype.toString,u="function"==typeof Symbol&&!!Symbol.toStringTag,f="object"===("undefined"==typeof document?"undefined":e(document))&&void 0===document.all&&void 0!==document.all?document.all:{};t.exports=o?function(t){if(t===f)return!0;if(!t)return!1;if("function"!=typeof t&&"object"!==e(t))return!1;if("function"==typeof t&&!t.prototype)return!0;try{o(t,null,r)}catch(t){if(t!==n)return!1}return!s(t)}:function(t){if(t===f)return!0;if(!t)return!1;if("function"!=typeof t&&"object"!==e(t))return!1;if("function"==typeof t&&!t.prototype)return!0;if(u)return function(t){try{return!s(t)&&(i.call(t),!0)}catch(t){return!1}}(t);if(s(t))return!1;var r=c.call(t);return"[object Function]"===r||"[object GeneratorFunction]"===r}},6738:(t,e,r)=>{"use strict";var n,i=Object.prototype.toString,o=Function.prototype.toString,a=/^\s*(?:function)?\*/,s=r(5994)(),c=Object.getPrototypeOf;t.exports=function(t){if("function"!=typeof t)return!1;if(a.test(o.call(t)))return!0;if(!s)return"[object GeneratorFunction]"===i.call(t);if(!c)return!1;if(void 0===n){var e=function(){if(!s)return!1;try{return Function("return function*() {}")()}catch(t){}}();n=!!e&&c(e)}return c(t)===n}},2703:t=>{"use strict";t.exports=function(t){return t!=t}},2191:(t,e,r)=>{"use strict";var n=r(3862),i=r(7921),o=r(2703),a=r(4828),s=r(2568),c=n(a(),Number);i(c,{getPolyfill:a,implementation:o,shim:s}),t.exports=c},4828:(t,e,r)=>{"use strict";var n=r(2703);t.exports=function(){return Number.isNaN&&Number.isNaN(NaN)&&!Number.isNaN("a")?Number.isNaN:n}},2568:(t,e,r)=>{"use strict";var n=r(7921),i=r(4828);t.exports=function(){var t=i();return n(Number,{isNaN:t},{isNaN:function(){return Number.isNaN!==t}}),t}},7913:(t,e,r)=>{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}var i=r(5337),o=r(6461),a=r(8780),s=a("Object.prototype.toString"),c=r(5994)(),u="undefined"==typeof globalThis?r.g:globalThis,f=o(),l=a("Array.prototype.indexOf",!0)||function(t,e){for(var r=0;r-1}return!!d&&function(t){var e=!1;return i(p,(function(r,n){if(!e)try{e=r.call(t)===n}catch(t){}})),e}(t)}},3138:t=>{"use strict";function e(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return r(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var i=0,o=function(){};return{s:o,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,c=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return s=t.done,t},e:function(t){c=!0,a=t},f:function(){try{s||null==n.return||n.return()}finally{if(c)throw a}}}}function r(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r=o)){var r=i[l];if(r.isAsync){var f=[c(b),c((function(t){if(t){if(p)return;return p=!0,n(t)}if(0==--h&&l>=o)return n(null)}))];a(r.fn,e,f,f[0])}else if(r.fn.length>0){f=[c(b)];for(var y=arguments.length>=2?arguments:[null].concat(d),m=1;m=o)return h>0?void 0:u((function(){n(null)}));t()}}}};function b(t){if(t){if(p)return;return p=!0,n(t)}if(++l>=o)return h>0?void 0:n(null);y.apply(e,arguments)}y.apply(null,[null].concat(r))},i.prototype.execPreSync=function(t,e,r){for(var n=this._pres.get(t)||[],i=n.length,o=0;o=f)return i.call(null,h);t()}));a(n,e,[h].concat(d).concat([b]),b)}else{if(++l>=f)return i.call(null,h);t()}else{var m=c((function(e){return e?(h=e,t()):++l>=f?i.apply(null,[null].concat(r)):void t()}));if(n.length===u+2)return++l>=f?i.apply(null,[null].concat(r)):t();if(n.length===u+1)a(n,e,d.concat([m]),m);else{var v,g;try{g=n.apply(e,d)}catch(t){v=t,h=t}if(s(g))return g.then((function(){return m()}),(function(t){return m(t)}));if(++l>=f)return i.apply(null,[v].concat(r));t()}}};p()},i.prototype.execPostSync=function(t,e,r){for(var n=this._posts.get(t)||[],i=n.length,o=0;o0?n[n.length-1]:null,c=Array.from(n);"function"==typeof a&&c.pop();var u=this,f=(i=i||{}).checkForPromise;this.execPre(t,r,n,(function(n){if(n){for(var l=i.numCallbackParams||0,h=i.contextParameter?[r]:[],p=h.length;p{"use strict";var n=r(376),i=r(5125),o=r(9047).Buffer,a=new Array(16);function s(){i.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878}function c(t,e){return t<>>32-e}function u(t,e,r,n,i,o,a){return c(t+(e&r|~e&n)+i+o|0,a)+e|0}function f(t,e,r,n,i,o,a){return c(t+(e&n|r&~n)+i+o|0,a)+e|0}function l(t,e,r,n,i,o,a){return c(t+(e^r^n)+i+o|0,a)+e|0}function h(t,e,r,n,i,o,a){return c(t+(r^(e|~n))+i+o|0,a)+e|0}n(s,i),s.prototype._update=function(){for(var t=a,e=0;e<16;++e)t[e]=this._block.readInt32LE(4*e);var r=this._a,n=this._b,i=this._c,o=this._d;r=u(r,n,i,o,t[0],3614090360,7),o=u(o,r,n,i,t[1],3905402710,12),i=u(i,o,r,n,t[2],606105819,17),n=u(n,i,o,r,t[3],3250441966,22),r=u(r,n,i,o,t[4],4118548399,7),o=u(o,r,n,i,t[5],1200080426,12),i=u(i,o,r,n,t[6],2821735955,17),n=u(n,i,o,r,t[7],4249261313,22),r=u(r,n,i,o,t[8],1770035416,7),o=u(o,r,n,i,t[9],2336552879,12),i=u(i,o,r,n,t[10],4294925233,17),n=u(n,i,o,r,t[11],2304563134,22),r=u(r,n,i,o,t[12],1804603682,7),o=u(o,r,n,i,t[13],4254626195,12),i=u(i,o,r,n,t[14],2792965006,17),r=f(r,n=u(n,i,o,r,t[15],1236535329,22),i,o,t[1],4129170786,5),o=f(o,r,n,i,t[6],3225465664,9),i=f(i,o,r,n,t[11],643717713,14),n=f(n,i,o,r,t[0],3921069994,20),r=f(r,n,i,o,t[5],3593408605,5),o=f(o,r,n,i,t[10],38016083,9),i=f(i,o,r,n,t[15],3634488961,14),n=f(n,i,o,r,t[4],3889429448,20),r=f(r,n,i,o,t[9],568446438,5),o=f(o,r,n,i,t[14],3275163606,9),i=f(i,o,r,n,t[3],4107603335,14),n=f(n,i,o,r,t[8],1163531501,20),r=f(r,n,i,o,t[13],2850285829,5),o=f(o,r,n,i,t[2],4243563512,9),i=f(i,o,r,n,t[7],1735328473,14),r=l(r,n=f(n,i,o,r,t[12],2368359562,20),i,o,t[5],4294588738,4),o=l(o,r,n,i,t[8],2272392833,11),i=l(i,o,r,n,t[11],1839030562,16),n=l(n,i,o,r,t[14],4259657740,23),r=l(r,n,i,o,t[1],2763975236,4),o=l(o,r,n,i,t[4],1272893353,11),i=l(i,o,r,n,t[7],4139469664,16),n=l(n,i,o,r,t[10],3200236656,23),r=l(r,n,i,o,t[13],681279174,4),o=l(o,r,n,i,t[0],3936430074,11),i=l(i,o,r,n,t[3],3572445317,16),n=l(n,i,o,r,t[6],76029189,23),r=l(r,n,i,o,t[9],3654602809,4),o=l(o,r,n,i,t[12],3873151461,11),i=l(i,o,r,n,t[15],530742520,16),r=h(r,n=l(n,i,o,r,t[2],3299628645,23),i,o,t[0],4096336452,6),o=h(o,r,n,i,t[7],1126891415,10),i=h(i,o,r,n,t[14],2878612391,15),n=h(n,i,o,r,t[5],4237533241,21),r=h(r,n,i,o,t[12],1700485571,6),o=h(o,r,n,i,t[3],2399980690,10),i=h(i,o,r,n,t[10],4293915773,15),n=h(n,i,o,r,t[1],2240044497,21),r=h(r,n,i,o,t[8],1873313359,6),o=h(o,r,n,i,t[15],4264355552,10),i=h(i,o,r,n,t[6],2734768916,15),n=h(n,i,o,r,t[13],1309151649,21),r=h(r,n,i,o,t[4],4149444226,6),o=h(o,r,n,i,t[11],3174756917,10),i=h(i,o,r,n,t[2],718787259,15),n=h(n,i,o,r,t[9],3951481745,21),this._a=this._a+r|0,this._b=this._b+n|0,this._c=this._c+i|0,this._d=this._d+o|0},s.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var t=o.allocUnsafe(16);return t.writeInt32LE(this._a,0),t.writeInt32LE(this._b,4),t.writeInt32LE(this._c,8),t.writeInt32LE(this._d,12),t},t.exports=s},9318:(t,e,r)=>{var n=r(6781),i=r(7179);function o(t){this.rand=t||new i.Rand}t.exports=o,o.create=function(t){return new o(t)},o.prototype._randbelow=function(t){var e=t.bitLength(),r=Math.ceil(e/8);do{var i=new n(this.rand.generate(r))}while(i.cmp(t)>=0);return i},o.prototype._randrange=function(t,e){var r=e.sub(t);return t.add(this._randbelow(r))},o.prototype.test=function(t,e,r){var i=t.bitLength(),o=n.mont(t),a=new n(1).toRed(o);e||(e=Math.max(1,i/48|0));for(var s=t.subn(1),c=0;!s.testn(c);c++);for(var u=t.shrn(c),f=s.toRed(o);e>0;e--){var l=this._randrange(new n(2),s);r&&r(l);var h=l.toRed(o).redPow(u);if(0!==h.cmp(a)&&0!==h.cmp(f)){for(var p=1;p0;e--){var f=this._randrange(new n(2),a),l=t.gcd(f);if(0!==l.cmpn(1))return l;var h=f.toRed(i).redPow(c);if(0!==h.cmp(o)&&0!==h.cmp(u)){for(var p=1;p{function e(t,e){if(!t)throw new Error(e||"Assertion failed")}t.exports=e,e.equal=function(t,e,r){if(t!=e)throw new Error(r||"Assertion failed: "+t+" != "+e)}},5522:(t,e)=>{"use strict";var r=e;function n(t){return 1===t.length?"0"+t:t}function i(t){for(var e="",r=0;r>8,a=255&i;o?r.push(o,a):r.push(a)}return r},r.zero2=n,r.toHex=i,r.encode=function(t,e){return"hex"===e?i(t):t}},3564:(t,e,r)=>{"use strict";t.exports=r(8424)},8424:(t,e,r)=>{function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}var i=r(7355),o=["__proto__","constructor","prototype"];function a(t,e,r,n,i,o){for(var s,c=0;c{"use strict";t.exports=function(t){for(var e=[],r="",n="DEFAULT",i=0;i{"use strict";var r=["find","findOne","update","updateMany","updateOne","replaceOne","remove","count","distinct","findOneAndDelete","findOneAndUpdate","aggregate","findCursor","deleteOne","deleteMany"];function n(){}for(var i=0,o=r.length;i{"use strict";var n=r(3669);if("unknown"==n.type)throw new Error("Unknown environment");t.exports=n.isNode?r(1186):(n.isMongo,r(3231))},1186:(t,e,r)=>{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function i(t,e){for(var r=0;r{"use strict";t=r.nmd(t);var n=r(365).Buffer;function i(t){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i(t)}e.isNode=void 0!=={env:{}}&&"object"==i(t)&&"object"==(void 0===r.g?"undefined":i(r.g))&&"function"==typeof n&&{env:{}}.argv,e.isMongo=!e.isNode&&"function"==typeof printjson&&"function"==typeof ObjectId&&"function"==typeof rs&&"function"==typeof sh,e.isBrowser=!e.isNode&&!e.isMongo&&"undefined"!=typeof window,e.type=e.isNode?"node":e.isMongo?"mongo":e.isBrowser?"browser":"unknown"},5417:(t,e,r)=>{"use strict";function n(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r");t.sort.set(r,n)}))}function y(t,e,r,n,i,o,a){return t.op=e,u.canMerge(r)&&t.merge(r),n&&t._mergeUpdate(n),s.isObject(i)&&t.setOptions(i),o||a?!t._update||!t.options.overwrite&&0===s.keys(t._update).length?(a&&s.soon(a.bind(null,null,0)),t):(i=t._optionsForExec(),a||(i.safe=!1),r=t._conditions,n=t._updateForExec(),c("update",t._collection.collectionName,r,n,i),a=t._wrapCallback(e,a,{conditions:r,doc:n,options:i}),t._collection[e](r,n,i,s.tick(a)),t):t}["limit","skip","maxScan","batchSize","comment"].forEach((function(t){u.prototype[t]=function(e){return this._validate(t),this.options[t]=e,this}})),u.prototype.maxTime=u.prototype.maxTimeMS=function(t){return this._validate("maxTime"),this.options.maxTimeMS=t,this},u.prototype.snapshot=function(){return this._validate("snapshot"),this.options.snapshot=!arguments.length||!!arguments[0],this},u.prototype.hint=function(){if(0===arguments.length)return this;this._validate("hint");var t=arguments[0];if(s.isObject(t)){var e=this.options.hint||(this.options.hint={});for(var r in t)e[r]=t[r];return this}if("string"==typeof t)return this.options.hint=t,this;throw new TypeError("Invalid hint. "+t)},u.prototype.j=function(t){return this.options.j=t,this},u.prototype.slaveOk=function(t){return this.options.slaveOk=!arguments.length||!!t,this},u.prototype.read=u.prototype.setReadPreference=function(t){return arguments.length>1&&!u.prototype.read.deprecationWarningIssued&&(console.error("Deprecation warning: 'tags' argument is not supported anymore in Query.read() method. Please use mongodb.ReadPreference object instead."),u.prototype.read.deprecationWarningIssued=!0),this.options.readPreference=s.readPref(t),this},u.prototype.readConcern=u.prototype.r=function(t){return this.options.readConcern=s.readConcern(t),this},u.prototype.tailable=function(){return this._validate("tailable"),this.options.tailable=!arguments.length||!!arguments[0],this},u.prototype.writeConcern=u.prototype.w=function(t){return"object"===i(t)?(void 0!==t.j&&(this.options.j=t.j),void 0!==t.w&&(this.options.w=t.w),void 0!==t.wtimeout&&(this.options.wtimeout=t.wtimeout)):this.options.w="m"===t?"majority":t,this},u.prototype.wtimeout=u.prototype.wTimeout=function(t){return this.options.wtimeout=t,this},u.prototype.merge=function(t){if(!t)return this;if(!u.canMerge(t))throw new TypeError("Invalid argument. Expected instanceof mquery or plain object");return t instanceof u?(t._conditions&&s.merge(this._conditions,t._conditions),t._fields&&(this._fields||(this._fields={}),s.merge(this._fields,t._fields)),t.options&&(this.options||(this.options={}),s.merge(this.options,t.options)),t._update&&(this._update||(this._update={}),s.mergeClone(this._update,t._update)),t._distinct&&(this._distinct=t._distinct),this):(s.merge(this._conditions,t),this)},u.prototype.find=function(t,e){if(this.op="find","function"==typeof t?(e=t,t=void 0):u.canMerge(t)&&this.merge(t),!e)return this;var r=this._conditions,n=this._optionsForExec();return this.$useProjection?n.projection=this._fieldsForExec():n.fields=this._fieldsForExec(),c("find",this._collection.collectionName,r,n),e=this._wrapCallback("find",e,{conditions:r,options:n}),this._collection.find(r,n,s.tick(e)),this},u.prototype.cursor=function(t){if(this.op){if("find"!==this.op)throw new TypeError(".cursor only support .find method")}else this.find(t);var e=this._conditions,r=this._optionsForExec();return this.$useProjection?r.projection=this._fieldsForExec():r.fields=this._fieldsForExec(),c("findCursor",this._collection.collectionName,e,r),this._collection.findCursor(e,r)},u.prototype.findOne=function(t,e){if(this.op="findOne","function"==typeof t?(e=t,t=void 0):u.canMerge(t)&&this.merge(t),!e)return this;var r=this._conditions,n=this._optionsForExec();return this.$useProjection?n.projection=this._fieldsForExec():n.fields=this._fieldsForExec(),c("findOne",this._collection.collectionName,r,n),e=this._wrapCallback("findOne",e,{conditions:r,options:n}),this._collection.findOne(r,n,s.tick(e)),this},u.prototype.count=function(t,e){if(this.op="count",this._validate(),"function"==typeof t?(e=t,t=void 0):u.canMerge(t)&&this.merge(t),!e)return this;var r=this._conditions,n=this._optionsForExec();return c("count",this._collection.collectionName,r,n),e=this._wrapCallback("count",e,{conditions:r,options:n}),this._collection.count(r,n,s.tick(e)),this},u.prototype.distinct=function(t,e,r){if(this.op="distinct",this._validate(),!r){switch(i(e)){case"function":r=e,"string"==typeof t&&(e=t,t=void 0);break;case"undefined":case"string":break;default:throw new TypeError("Invalid `field` argument. Must be string or function")}switch(i(t)){case"function":r=t,t=e=void 0;break;case"string":e=t,t=void 0}}if("string"==typeof e&&(this._distinct=e),u.canMerge(t)&&this.merge(t),!r)return this;if(!this._distinct)throw new Error("No value for `distinct` has been declared");var n=this._conditions,o=this._optionsForExec();return c("distinct",this._collection.collectionName,n,o),r=this._wrapCallback("distinct",r,{conditions:n,options:o}),this._collection.distinct(this._distinct,n,o,s.tick(r)),this},u.prototype.update=function(t,e,r,n){var o;switch(arguments.length){case 3:"function"==typeof r&&(n=r,r=void 0);break;case 2:"function"==typeof e&&(n=e,e=t,t=void 0);break;case 1:switch(i(t)){case"function":n=t,t=r=e=void 0;break;case"boolean":o=t,t=void 0;break;default:e=t,t=r=void 0}}return y(this,"update",t,e,r,o,n)},u.prototype.updateMany=function(t,e,r,n){var o;switch(arguments.length){case 3:"function"==typeof r&&(n=r,r=void 0);break;case 2:"function"==typeof e&&(n=e,e=t,t=void 0);break;case 1:switch(i(t)){case"function":n=t,t=r=e=void 0;break;case"boolean":o=t,t=void 0;break;default:e=t,t=r=void 0}}return y(this,"updateMany",t,e,r,o,n)},u.prototype.updateOne=function(t,e,r,n){var o;switch(arguments.length){case 3:"function"==typeof r&&(n=r,r=void 0);break;case 2:"function"==typeof e&&(n=e,e=t,t=void 0);break;case 1:switch(i(t)){case"function":n=t,t=r=e=void 0;break;case"boolean":o=t,t=void 0;break;default:e=t,t=r=void 0}}return y(this,"updateOne",t,e,r,o,n)},u.prototype.replaceOne=function(t,e,r,n){var o;switch(arguments.length){case 3:"function"==typeof r&&(n=r,r=void 0);break;case 2:"function"==typeof e&&(n=e,e=t,t=void 0);break;case 1:switch(i(t)){case"function":n=t,t=r=e=void 0;break;case"boolean":o=t,t=void 0;break;default:e=t,t=r=void 0}}return this.setOptions({overwrite:!0}),y(this,"replaceOne",t,e,r,o,n)},u.prototype.remove=function(t,e){var r;if(this.op="remove","function"==typeof t?(e=t,t=void 0):u.canMerge(t)?this.merge(t):!0===t&&(r=t,t=void 0),!r&&!e)return this;var n=this._optionsForExec();e||(n.safe=!1);var i=this._conditions;return c("remove",this._collection.collectionName,i,n),e=this._wrapCallback("remove",e,{conditions:i,options:n}),this._collection.remove(i,n,s.tick(e)),this},u.prototype.deleteOne=function(t,e){var r;if(this.op="deleteOne","function"==typeof t?(e=t,t=void 0):u.canMerge(t)?this.merge(t):!0===t&&(r=t,t=void 0),!r&&!e)return this;var n=this._optionsForExec();e||(n.safe=!1),delete n.justOne;var i=this._conditions;return c("deleteOne",this._collection.collectionName,i,n),e=this._wrapCallback("deleteOne",e,{conditions:i,options:n}),this._collection.deleteOne(i,n,s.tick(e)),this},u.prototype.deleteMany=function(t,e){var r;if(this.op="deleteMany","function"==typeof t?(e=t,t=void 0):u.canMerge(t)?this.merge(t):!0===t&&(r=t,t=void 0),!r&&!e)return this;var n=this._optionsForExec();e||(n.safe=!1),delete n.justOne;var i=this._conditions;return c("deleteOne",this._collection.collectionName,i,n),e=this._wrapCallback("deleteOne",e,{conditions:i,options:n}),this._collection.deleteMany(i,n,s.tick(e)),this},u.prototype.findOneAndUpdate=function(t,e,r,n){switch(this.op="findOneAndUpdate",this._validate(),arguments.length){case 3:"function"==typeof r&&(n=r,r={});break;case 2:"function"==typeof e&&(n=e,e=t,t=void 0),r=void 0;break;case 1:"function"==typeof t?(n=t,t=r=e=void 0):(e=t,t=r=void 0)}if(u.canMerge(t)&&this.merge(t),e&&this._mergeUpdate(e),r&&this.setOptions(r),!n)return this;var i=this._conditions,o=this._updateForExec();return r=this._optionsForExec(),this._collection.findOneAndUpdate(i,o,r,s.tick(n))},u.prototype.findOneAndRemove=u.prototype.findOneAndDelete=function(t,e,r){if(this.op="findOneAndRemove",this._validate(),"function"==typeof e?(r=e,e=void 0):"function"==typeof t&&(r=t,t=void 0),u.canMerge(t)&&this.merge(t),e&&this.setOptions(e),!r)return this;e=this._optionsForExec();var n=this._conditions;return this._collection.findOneAndDelete(n,e,s.tick(r))},u.prototype._wrapCallback=function(t,e,r){var n=this._traceFunction||u.traceFunction;if(n){r.collectionName=this._collection.collectionName;var i=n&&n.call(null,t,r,this),o=(new Date).getTime();return function(t,r){if(i){var n=(new Date).getTime()-o;i.call(null,t,r,n)}e&&e.apply(null,arguments)}}return e},u.prototype.setTraceFunction=function(t){return this._traceFunction=t,this},u.prototype.exec=function(t,e){switch(i(t)){case"function":e=t,t=null;break;case"string":this.op=t}o.ok(this.op,"Missing query type: (find, update, etc)"),"update"!=this.op&&"remove"!=this.op||e||(e=!0);var r=this;if("function"!=typeof e)return new u.Promise((function(t,e){r[r.op]((function(r,n){r?e(r):t(n),t=e=null}))}));this[this.op](e)},u.prototype.thunk=function(){var t=this;return function(e){t.exec(e)}},u.prototype.then=function(t,e){var r=this;return new u.Promise((function(t,e){r.exec((function(r,n){r?e(r):t(n),t=e=null}))})).then(t,e)},u.prototype.cursor=function(){if("find"!=this.op)throw new Error("cursor() is only available for find");var t=this._conditions,e=this._optionsForExec();return this.$useProjection?e.projection=this._fieldsForExec():e.fields=this._fieldsForExec(),c("cursor",this._collection.collectionName,t,e),this._collection.findCursor(t,e)},u.prototype.selected=function(){return!!(this._fields&&Object.keys(this._fields).length>0)},u.prototype.selectedInclusively=function(){if(!this._fields)return!1;var t=Object.keys(this._fields);if(0===t.length)return!1;for(var e=0;e=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,c=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return s=t.done,t},e:function(t){c=!0,a=t},f:function(){try{s||null==r.return||r.return()}finally{if(c)throw a}}}}(r);try{for(o.s();!(t=o.n()).done;){var a=t.value;this.options.overwrite?i[a]=e[a]:"$"!==a[0]?(i.$set||(e.$set?i.$set=e.$set:i.$set={}),i.$set[a]=e[a],~r.indexOf("$set")||r.push("$set")):"$set"===a&&i.$set||(i[a]=e[a])}}catch(t){o.e(t)}finally{o.f()}return this._compiledUpdate=i,i},u.prototype._ensurePath=function(t){if(!this._path)throw new Error(t+"() must be used after where() when called with these arguments")},u.permissions=r(6477),u._isPermitted=function(t,e){var r=u.permissions[e];return!r||!0!==r[t]},u.prototype._validate=function(t){var e,r;if(void 0===t){if("function"!=typeof(r=u.permissions[this.op]))return!0;e=r(this)}else u._isPermitted(t,this.op)||(e=t);if(e)throw new Error(e+" cannot be used with "+this.op)},u.canMerge=function(t){return t instanceof u||s.isObject(t)},u.setGlobalTraceFunction=function(t){u.traceFunction=t},u.utils=s,u.env=r(3669),u.Collection=r(8514),u.BaseCollection=r(3231),u.Promise=Promise,t.exports=u},6477:(t,e)=>{"use strict";var r=e;r.distinct=function(t){return t._fields&&Object.keys(t._fields).length>0?"field selection and slice":(Object.keys(r.distinct).every((function(r){return!t.options[r]||(e=r,!1)})),e);var e},r.distinct.select=r.distinct.slice=r.distinct.sort=r.distinct.limit=r.distinct.skip=r.distinct.batchSize=r.distinct.maxScan=r.distinct.snapshot=r.distinct.hint=r.distinct.tailable=!0,r.findOneAndUpdate=r.findOneAndRemove=function(t){var e;return Object.keys(r.findOneAndUpdate).every((function(r){return!t.options[r]||(e=r,!1)})),e},r.findOneAndUpdate.limit=r.findOneAndUpdate.skip=r.findOneAndUpdate.batchSize=r.findOneAndUpdate.maxScan=r.findOneAndUpdate.snapshot=r.findOneAndUpdate.tailable=!0,r.count=function(t){return t._fields&&Object.keys(t._fields).length>0?"field selection and slice":(Object.keys(r.count).every((function(r){return!t.options[r]||(e=r,!1)})),e);var e},r.count.slice=r.count.batchSize=r.count.maxScan=r.count.snapshot=r.count.tailable=!0},728:(t,e,r)=>{"use strict";var n=r(365).Buffer,i=["__proto__","constructor","prototype"],o=e.clone=function t(r,i){if(null==r)return r;if(Array.isArray(r))return e.cloneArray(r,i);if(r.constructor){if(/ObjectI[dD]$/.test(r.constructor.name))return"function"==typeof r.clone?r.clone():new r.constructor(r.id);if("ReadPreference"===r.constructor.name)return new r.constructor(r.mode,t(r.tags,i));if("Binary"==r._bsontype&&r.buffer&&r.value)return"function"==typeof r.clone?r.clone():new r.constructor(r.value(!0),r.sub_type);if("Date"===r.constructor.name||"Function"===r.constructor.name)return new r.constructor(+r);if("RegExp"===r.constructor.name)return new RegExp(r);if("Buffer"===r.constructor.name)return n.from(r)}return s(r)?e.cloneObject(r,i):r.valueOf?r.valueOf():void 0};e.cloneObject=function(t,e){var r,n=e&&e.minimize,a={},s=Object.keys(t),c=s.length,u=!1,f="",l=0;for(l=0;l1)throw new Error("Adding properties is not supported");function e(){}return e.prototype=t,new e},e.inherits=function(t,r){t.prototype=e.create(r.prototype),t.prototype.constructor=t};var c=e.soon="function"==typeof setImmediate?setImmediate:{env:{}}.nextTick;e.isArgumentsObject=function(t){return"[object Arguments]"===Object.prototype.toString.call(t)}},2068:t=>{function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},e(t)}var r=1e3,n=60*r,i=60*n,o=24*i;function a(t,e,r,n){var i=e>=1.5*r;return Math.round(t/r)+" "+n+(i?"s":"")}t.exports=function(t,s){s=s||{};var c,u,f=e(t);if("string"===f&&t.length>0)return function(t){if(!((t=String(t)).length>100)){var e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(t);if(e){var a=parseFloat(e[1]);switch((e[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*a;case"weeks":case"week":case"w":return 6048e5*a;case"days":case"day":case"d":return a*o;case"hours":case"hour":case"hrs":case"hr":case"h":return a*i;case"minutes":case"minute":case"mins":case"min":case"m":return a*n;case"seconds":case"second":case"secs":case"sec":case"s":return a*r;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return a;default:return}}}}(t);if("number"===f&&isFinite(t))return s.long?(c=t,(u=Math.abs(c))>=o?a(c,u,o,"day"):u>=i?a(c,u,i,"hour"):u>=n?a(c,u,n,"minute"):u>=r?a(c,u,r,"second"):c+" ms"):function(t){var e=Math.abs(t);return e>=o?Math.round(t/o)+"d":e>=i?Math.round(t/i)+"h":e>=n?Math.round(t/n)+"m":e>=r?Math.round(t/r)+"s":t+"ms"}(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))}},692:t=>{"use strict";var e=function(t){return t!=t};t.exports=function(t,r){return 0===t&&0===r?1/t==1/r:t===r||!(!e(t)||!e(r))}},4710:(t,e,r)=>{"use strict";var n=r(7921),i=r(3862),o=r(692),a=r(9292),s=r(9228),c=i(a(),Object);n(c,{getPolyfill:a,implementation:o,shim:s}),t.exports=c},9292:(t,e,r)=>{"use strict";var n=r(692);t.exports=function(){return"function"==typeof Object.is?Object.is:n}},9228:(t,e,r)=>{"use strict";var n=r(9292),i=r(7921);t.exports=function(){var t=n();return i(Object,{is:t},{is:function(){return Object.is!==t}}),t}},6164:(t,e,r)=>{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}var i;if(!Object.keys){var o=Object.prototype.hasOwnProperty,a=Object.prototype.toString,s=r(5184),c=Object.prototype.propertyIsEnumerable,u=!c.call({toString:null},"toString"),f=c.call((function(){}),"prototype"),l=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],h=function(t){var e=t.constructor;return e&&e.prototype===t},p={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},d=function(){if("undefined"==typeof window)return!1;for(var t in window)try{if(!p["$"+t]&&o.call(window,t)&&null!==window[t]&&"object"===n(window[t]))try{h(window[t])}catch(t){return!0}}catch(t){return!0}return!1}();i=function(t){var e=null!==t&&"object"===n(t),r="[object Function]"===a.call(t),i=s(t),c=e&&"[object String]"===a.call(t),p=[];if(!e&&!r&&!i)throw new TypeError("Object.keys called on a non-object");var y=f&&r;if(c&&t.length>0&&!o.call(t,0))for(var b=0;b0)for(var m=0;m{"use strict";var n=Array.prototype.slice,i=r(5184),o=Object.keys,a=o?function(t){return o(t)}:r(6164),s=Object.keys;a.shim=function(){if(Object.keys){var t=function(){var t=Object.keys(arguments);return t&&t.length===arguments.length}(1,2);t||(Object.keys=function(t){return i(t)?s(n.call(t)):s(t)})}else Object.keys=a;return Object.keys||a},t.exports=a},5184:t=>{"use strict";function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},e(t)}var r=Object.prototype.toString;t.exports=function(t){var n=r.call(t),i="[object Arguments]"===n;return i||(i="[object Array]"!==n&&null!==t&&"object"===e(t)&&"number"==typeof t.length&&t.length>=0&&"[object Function]"===r.call(t.callee)),i}},7061:(t,e,r)=>{"use strict";var n=r(7406);e.certificate=r(458);var i=n.define("RSAPrivateKey",(function(){this.seq().obj(this.key("version").int(),this.key("modulus").int(),this.key("publicExponent").int(),this.key("privateExponent").int(),this.key("prime1").int(),this.key("prime2").int(),this.key("exponent1").int(),this.key("exponent2").int(),this.key("coefficient").int())}));e.RSAPrivateKey=i;var o=n.define("RSAPublicKey",(function(){this.seq().obj(this.key("modulus").int(),this.key("publicExponent").int())}));e.RSAPublicKey=o;var a=n.define("SubjectPublicKeyInfo",(function(){this.seq().obj(this.key("algorithm").use(s),this.key("subjectPublicKey").bitstr())}));e.PublicKey=a;var s=n.define("AlgorithmIdentifier",(function(){this.seq().obj(this.key("algorithm").objid(),this.key("none").null_().optional(),this.key("curve").objid().optional(),this.key("params").seq().obj(this.key("p").int(),this.key("q").int(),this.key("g").int()).optional())})),c=n.define("PrivateKeyInfo",(function(){this.seq().obj(this.key("version").int(),this.key("algorithm").use(s),this.key("subjectPrivateKey").octstr())}));e.PrivateKey=c;var u=n.define("EncryptedPrivateKeyInfo",(function(){this.seq().obj(this.key("algorithm").seq().obj(this.key("id").objid(),this.key("decrypt").seq().obj(this.key("kde").seq().obj(this.key("id").objid(),this.key("kdeparams").seq().obj(this.key("salt").octstr(),this.key("iters").int())),this.key("cipher").seq().obj(this.key("algo").objid(),this.key("iv").octstr()))),this.key("subjectPrivateKey").octstr())}));e.EncryptedPrivateKey=u;var f=n.define("DSAPrivateKey",(function(){this.seq().obj(this.key("version").int(),this.key("p").int(),this.key("q").int(),this.key("g").int(),this.key("pub_key").int(),this.key("priv_key").int())}));e.DSAPrivateKey=f,e.DSAparam=n.define("DSAparam",(function(){this.int()}));var l=n.define("ECPrivateKey",(function(){this.seq().obj(this.key("version").int(),this.key("privateKey").octstr(),this.key("parameters").optional().explicit(0).use(h),this.key("publicKey").optional().explicit(1).bitstr())}));e.ECPrivateKey=l;var h=n.define("ECParameters",(function(){this.choice({namedCurve:this.objid()})}));e.signature=n.define("signature",(function(){this.seq().obj(this.key("r").int(),this.key("s").int())}))},458:(t,e,r)=>{"use strict";var n=r(7406),i=n.define("Time",(function(){this.choice({utcTime:this.utctime(),generalTime:this.gentime()})})),o=n.define("AttributeTypeValue",(function(){this.seq().obj(this.key("type").objid(),this.key("value").any())})),a=n.define("AlgorithmIdentifier",(function(){this.seq().obj(this.key("algorithm").objid(),this.key("parameters").optional(),this.key("curve").objid().optional())})),s=n.define("SubjectPublicKeyInfo",(function(){this.seq().obj(this.key("algorithm").use(a),this.key("subjectPublicKey").bitstr())})),c=n.define("RelativeDistinguishedName",(function(){this.setof(o)})),u=n.define("RDNSequence",(function(){this.seqof(c)})),f=n.define("Name",(function(){this.choice({rdnSequence:this.use(u)})})),l=n.define("Validity",(function(){this.seq().obj(this.key("notBefore").use(i),this.key("notAfter").use(i))})),h=n.define("Extension",(function(){this.seq().obj(this.key("extnID").objid(),this.key("critical").bool().def(!1),this.key("extnValue").octstr())})),p=n.define("TBSCertificate",(function(){this.seq().obj(this.key("version").explicit(0).int().optional(),this.key("serialNumber").int(),this.key("signature").use(a),this.key("issuer").use(f),this.key("validity").use(l),this.key("subject").use(f),this.key("subjectPublicKeyInfo").use(s),this.key("issuerUniqueID").implicit(1).bitstr().optional(),this.key("subjectUniqueID").implicit(2).bitstr().optional(),this.key("extensions").explicit(3).seqof(h).optional())})),d=n.define("X509Certificate",(function(){this.seq().obj(this.key("tbsCertificate").use(p),this.key("signatureAlgorithm").use(a),this.key("signatureValue").bitstr())}));t.exports=d},1120:(t,e,r)=>{var n=/Proc-Type: 4,ENCRYPTED[\n\r]+DEK-Info: AES-((?:128)|(?:192)|(?:256))-CBC,([0-9A-H]+)[\n\r]+([0-9A-z\n\r+/=]+)[\n\r]+/m,i=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----/m,o=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----([0-9A-z\n\r+/=]+)-----END \1-----$/m,a=r(1248),s=r(4881),c=r(9047).Buffer;t.exports=function(t,e){var r,u=t.toString(),f=u.match(n);if(f){var l="aes"+f[1],h=c.from(f[2],"hex"),p=c.from(f[3].replace(/[\r\n]/g,""),"base64"),d=a(e,h.slice(0,8),parseInt(f[1],10)).key,y=[],b=s.createDecipheriv(l,d,h);y.push(b.update(p)),y.push(b.final()),r=c.concat(y)}else{var m=u.match(o);r=c.from(m[2].replace(/[\r\n]/g,""),"base64")}return{tag:u.match(i)[1],data:r}}},2914:(t,e,r)=>{function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}var i=r(7061),o=r(2562),a=r(1120),s=r(4881),c=r(9379),u=r(9047).Buffer;function f(t){var e;"object"!==n(t)||u.isBuffer(t)||(e=t.passphrase,t=t.key),"string"==typeof t&&(t=u.from(t));var r,f,l=a(t,e),h=l.tag,p=l.data;switch(h){case"CERTIFICATE":f=i.certificate.decode(p,"der").tbsCertificate.subjectPublicKeyInfo;case"PUBLIC KEY":switch(f||(f=i.PublicKey.decode(p,"der")),r=f.algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return i.RSAPublicKey.decode(f.subjectPublicKey.data,"der");case"1.2.840.10045.2.1":return f.subjectPrivateKey=f.subjectPublicKey,{type:"ec",data:f};case"1.2.840.10040.4.1":return f.algorithm.params.pub_key=i.DSAparam.decode(f.subjectPublicKey.data,"der"),{type:"dsa",data:f.algorithm.params};default:throw new Error("unknown key id "+r)}case"ENCRYPTED PRIVATE KEY":p=function(t,e){var r=t.algorithm.decrypt.kde.kdeparams.salt,n=parseInt(t.algorithm.decrypt.kde.kdeparams.iters.toString(),10),i=o[t.algorithm.decrypt.cipher.algo.join(".")],a=t.algorithm.decrypt.cipher.iv,f=t.subjectPrivateKey,l=parseInt(i.split("-")[1],10)/8,h=c.pbkdf2Sync(e,r,n,l,"sha1"),p=s.createDecipheriv(i,h,a),d=[];return d.push(p.update(f)),d.push(p.final()),u.concat(d)}(p=i.EncryptedPrivateKey.decode(p,"der"),e);case"PRIVATE KEY":switch(r=(f=i.PrivateKey.decode(p,"der")).algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return i.RSAPrivateKey.decode(f.subjectPrivateKey,"der");case"1.2.840.10045.2.1":return{curve:f.algorithm.curve,privateKey:i.ECPrivateKey.decode(f.subjectPrivateKey,"der").privateKey};case"1.2.840.10040.4.1":return f.algorithm.params.priv_key=i.DSAparam.decode(f.subjectPrivateKey,"der"),{type:"dsa",params:f.algorithm.params};default:throw new Error("unknown key id "+r)}case"RSA PUBLIC KEY":return i.RSAPublicKey.decode(p,"der");case"RSA PRIVATE KEY":return i.RSAPrivateKey.decode(p,"der");case"DSA PRIVATE KEY":return{type:"dsa",params:i.DSAPrivateKey.decode(p,"der")};case"EC PRIVATE KEY":return{curve:(p=i.ECPrivateKey.decode(p,"der")).parameters.value,privateKey:p.privateKey};default:throw new Error("unknown key type "+h)}}t.exports=f,f.signature=i.signature},9379:(t,e,r)=>{e.pbkdf2=r(8099),e.pbkdf2Sync=r(3180)},8099:(t,e,r)=>{var n,i,o=r(9047).Buffer,a=r(2042),s=r(8994),c=r(3180),u=r(7238),f=r.g.crypto&&r.g.crypto.subtle,l={sha:"SHA-1","sha-1":"SHA-1",sha1:"SHA-1",sha256:"SHA-256","sha-256":"SHA-256",sha384:"SHA-384","sha-384":"SHA-384","sha-512":"SHA-512",sha512:"SHA-512"},h=[];function p(){return i||(i=r.g.process&&r.g.process.nextTick?r.g.process.nextTick:r.g.queueMicrotask?r.g.queueMicrotask:r.g.setImmediate?r.g.setImmediate:r.g.setTimeout)}function d(t,e,r,n,i){return f.importKey("raw",t,{name:"PBKDF2"},!1,["deriveBits"]).then((function(t){return f.deriveBits({name:"PBKDF2",salt:e,iterations:r,hash:{name:i}},t,n<<3)})).then((function(t){return o.from(t)}))}t.exports=function(t,e,i,y,b,m){"function"==typeof b&&(m=b,b=void 0);var v=l[(b=b||"sha1").toLowerCase()];if(v&&"function"==typeof r.g.Promise){if(a(i,y),t=u(t,s,"Password"),e=u(e,s,"Salt"),"function"!=typeof m)throw new Error("No callback provided to pbkdf2");!function(t,e){t.then((function(t){p()((function(){e(null,t)}))}),(function(t){p()((function(){e(t)}))}))}(function(t){if(r.g.process&&!r.g.process.browser)return Promise.resolve(!1);if(!f||!f.importKey||!f.deriveBits)return Promise.resolve(!1);if(void 0!==h[t])return h[t];var e=d(n=n||o.alloc(8),n,10,128,t).then((function(){return!0})).catch((function(){return!1}));return h[t]=e,e}(v).then((function(r){return r?d(t,e,i,y,v):c(t,e,i,y,b)})),m)}else p()((function(){var r;try{r=c(t,e,i,y,b)}catch(t){return m(t)}m(null,r)}))}},8994:(t,e,r)=>{var n;n=r.g.process&&r.g.process.browser?"utf-8":r.g.process&&r.g.process.version?parseInt({env:{}}.version.split(".")[0].slice(1),10)>=6?"utf-8":"binary":"utf-8",t.exports=n},2042:t=>{var e=Math.pow(2,30)-1;t.exports=function(t,r){if("number"!=typeof t)throw new TypeError("Iterations not a number");if(t<0)throw new TypeError("Bad iterations");if("number"!=typeof r)throw new TypeError("Key length not a number");if(r<0||r>e||r!=r)throw new TypeError("Bad key length")}},3180:(t,e,r)=>{var n=r(3277),i=r(8100),o=r(1806),a=r(9047).Buffer,s=r(2042),c=r(8994),u=r(7238),f=a.alloc(128),l={md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,rmd160:20,ripemd160:20};function h(t,e,r){var s=function(t){return"rmd160"===t||"ripemd160"===t?function(t){return(new i).update(t).digest()}:"md5"===t?n:function(e){return o(t).update(e).digest()}}(t),c="sha512"===t||"sha384"===t?128:64;e.length>c?e=s(e):e.length{var n=r(9047).Buffer;t.exports=function(t,e,r){if(n.isBuffer(t))return t;if("string"==typeof t)return n.from(t,e);if(ArrayBuffer.isView(t))return n.from(t.buffer);throw new TypeError(r+" must be a string, a Buffer, a typed array or a DataView")}},2368:(t,e,r)=>{e.publicEncrypt=r(2385),e.privateDecrypt=r(8752),e.privateEncrypt=function(t,r){return e.publicEncrypt(t,r,!0)},e.publicDecrypt=function(t,r){return e.privateDecrypt(t,r,!0)}},4075:(t,e,r)=>{var n=r(8339),i=r(9047).Buffer;function o(t){var e=i.allocUnsafe(4);return e.writeUInt32BE(t,0),e}t.exports=function(t,e){for(var r,a=i.alloc(0),s=0;a.length{var n=r(2914),i=r(4075),o=r(782),a=r(6781),s=r(4364),c=r(8339),u=r(1675),f=r(9047).Buffer;t.exports=function(t,e,r){var l;l=t.padding?t.padding:r?1:4;var h,p=n(t),d=p.modulus.byteLength();if(e.length>d||new a(e).cmp(p.modulus)>=0)throw new Error("decryption error");h=r?u(new a(e),p):s(e,p);var y=f.alloc(d-h.length);if(h=f.concat([y,h],d),4===l)return function(t,e){var r=t.modulus.byteLength(),n=c("sha1").update(f.alloc(0)).digest(),a=n.length;if(0!==e[0])throw new Error("decryption error");var s=e.slice(1,a+1),u=e.slice(a+1),l=o(s,i(u,a)),h=o(u,i(l,r-a-1));if(function(t,e){t=f.from(t),e=f.from(e);var r=0,n=t.length;t.length!==e.length&&(r++,n=Math.min(t.length,e.length));for(var i=-1;++i=e.length){o++;break}var a=e.slice(2,i-1);if(("0002"!==n.toString("hex")&&!r||"0001"!==n.toString("hex")&&r)&&o++,a.length<8&&o++,o)throw new Error("decryption error");return e.slice(i)}(0,h,r);if(3===l)return h;throw new Error("unknown padding")}},2385:(t,e,r)=>{var n=r(2914),i=r(5760),o=r(8339),a=r(4075),s=r(782),c=r(6781),u=r(1675),f=r(4364),l=r(9047).Buffer;t.exports=function(t,e,r){var h;h=t.padding?t.padding:r?1:4;var p,d=n(t);if(4===h)p=function(t,e){var r=t.modulus.byteLength(),n=e.length,u=o("sha1").update(l.alloc(0)).digest(),f=u.length,h=2*f;if(n>r-h-2)throw new Error("message too long");var p=l.alloc(r-n-h-2),d=r-f-1,y=i(f),b=s(l.concat([u,p,l.alloc(1,1),e],d),a(y,d)),m=s(y,a(b,f));return new c(l.concat([l.alloc(1),m,b],r))}(d,e);else if(1===h)p=function(t,e,r){var n,o=e.length,a=t.modulus.byteLength();if(o>a-11)throw new Error("message too long");return n=r?l.alloc(a-o-3,255):function(t){for(var e,r=l.allocUnsafe(t),n=0,o=i(2*t),a=0;n=0)throw new Error("data too long for modulus")}return r?f(p,d):u(p,d)}},1675:(t,e,r)=>{var n=r(6781),i=r(9047).Buffer;t.exports=function(t,e){return i.from(t.toRed(n.mont(e.modulus)).redPow(new n(e.publicExponent)).fromRed().toArray())}},782:t=>{t.exports=function(t,e){for(var r=t.length,n=-1;++n{"use strict";var n=65536,i=r(9047).Buffer,o=r.g.crypto||r.g.msCrypto;o&&o.getRandomValues?t.exports=function(t,e){if(t>4294967295)throw new RangeError("requested too many random bytes");var r=i.allocUnsafe(t);if(t>0)if(t>n)for(var a=0;a{"use strict";function n(){throw new Error("secure random number generation not supported by this browser\nuse chrome, FireFox or Internet Explorer 11")}var i=r(9047),o=r(5760),a=i.Buffer,s=i.kMaxLength,c=r.g.crypto||r.g.msCrypto,u=Math.pow(2,32)-1;function f(t,e){if("number"!=typeof t||t!=t)throw new TypeError("offset must be a number");if(t>u||t<0)throw new TypeError("offset must be a uint32");if(t>s||t>e)throw new RangeError("offset out of range")}function l(t,e,r){if("number"!=typeof t||t!=t)throw new TypeError("size must be a number");if(t>u||t<0)throw new TypeError("size must be a uint32");if(t+e>r||t>s)throw new RangeError("buffer too small")}function h(t,e,r,n){if({env:{}}.browser){var i=t.buffer,a=new Uint8Array(i,e,r);return c.getRandomValues(a),n?void{env:{}}.nextTick((function(){n(null,t)})):t}if(!n)return o(r).copy(t,e),t;o(r,(function(r,i){if(r)return n(r);i.copy(t,e),n(null,t)}))}c&&c.getRandomValues||!{env:{}}.browser?(e.randomFill=function(t,e,n,i){if(!(a.isBuffer(t)||t instanceof r.g.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');if("function"==typeof e)i=e,e=0,n=t.length;else if("function"==typeof n)i=n,n=t.length-e;else if("function"!=typeof i)throw new TypeError('"cb" argument must be a function');return f(e,t.length),l(n,e,t.length),h(t,e,n,i)},e.randomFillSync=function(t,e,n){if(void 0===e&&(e=0),!(a.isBuffer(t)||t instanceof r.g.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');return f(e,t.length),void 0===n&&(n=t.length-e),l(n,e,t.length),h(t,e,n)}):(e.randomFill=n,e.randomFillSync=n)},5613:t=>{"use strict";function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},e(t)}var r={};function n(t,e,n){n||(n=Error);var i=function(t){var r,n;function i(r,n,i){return t.call(this,function(t,r,n){return"string"==typeof e?e:e(t,r,n)}(r,n,i))||this}return n=t,(r=i).prototype=Object.create(n.prototype),r.prototype.constructor=r,r.__proto__=n,i}(n);i.prototype.name=n.name,i.prototype.code=t,r[t]=i}function i(t,e){if(Array.isArray(t)){var r=t.length;return t=t.map((function(t){return String(t)})),r>2?"one of ".concat(e," ").concat(t.slice(0,r-1).join(", "),", or ")+t[r-1]:2===r?"one of ".concat(e," ").concat(t[0]," or ").concat(t[1]):"of ".concat(e," ").concat(t[0])}return"of ".concat(e," ").concat(String(t))}n("ERR_INVALID_OPT_VALUE",(function(t,e){return'The value "'+e+'" is invalid for option "'+t+'"'}),TypeError),n("ERR_INVALID_ARG_TYPE",(function(t,r,n){var o,a,s,c,u;if("string"==typeof r&&(a="not ",r.substr(0,a.length)===a)?(o="must not be",r=r.replace(/^not /,"")):o="must be",function(t,e,r){return(void 0===r||r>t.length)&&(r=t.length),t.substring(r-e.length,r)===e}(t," argument"))s="The ".concat(t," ").concat(o," ").concat(i(r,"type"));else{var f=("number"!=typeof u&&(u=0),u+".".length>(c=t).length||-1===c.indexOf(".",u)?"argument":"property");s='The "'.concat(t,'" ').concat(f," ").concat(o," ").concat(i(r,"type"))}return s+". Received type ".concat(e(n))}),TypeError),n("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),n("ERR_METHOD_NOT_IMPLEMENTED",(function(t){return"The "+t+" method is not implemented"})),n("ERR_STREAM_PREMATURE_CLOSE","Premature close"),n("ERR_STREAM_DESTROYED",(function(t){return"Cannot call "+t+" after a stream was destroyed"})),n("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),n("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),n("ERR_STREAM_WRITE_AFTER_END","write after end"),n("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),n("ERR_UNKNOWN_ENCODING",(function(t){return"Unknown encoding: "+t}),TypeError),n("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),t.exports.q=r},4611:(t,e,r)=>{"use strict";var n=Object.keys||function(t){var e=[];for(var r in t)e.push(r);return e};t.exports=u;var i=r(6751),o=r(679);r(376)(u,i);for(var a=n(o.prototype),s=0;s{"use strict";t.exports=i;var n=r(4951);function i(t){if(!(this instanceof i))return new i(t);n.call(this,t)}r(376)(i,n),i.prototype._transform=function(t,e,r){r(null,t)}},6751:(t,e,r)=>{"use strict";var n;t.exports=A,A.ReadableState=O,r(9620).EventEmitter;var i,o=function(t,e){return t.listeners(e).length},a=r(6054),s=r(365).Buffer,c=r.g.Uint8Array||function(){},u=r(4616);i=u&&u.debuglog?u.debuglog("stream"):function(){};var f,l,h,p=r(1843),d=r(4798),y=r(6876).getHighWaterMark,b=r(5613).q,m=b.ERR_INVALID_ARG_TYPE,v=b.ERR_STREAM_PUSH_AFTER_EOF,g=b.ERR_METHOD_NOT_IMPLEMENTED,_=b.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;r(376)(A,a);var w=d.errorOrDestroy,S=["error","close","destroy","pause","resume"];function O(t,e,i){n=n||r(4611),t=t||{},"boolean"!=typeof i&&(i=e instanceof n),this.objectMode=!!t.objectMode,i&&(this.objectMode=this.objectMode||!!t.readableObjectMode),this.highWaterMark=y(this,t,"readableHighWaterMark",i),this.buffer=new p,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==t.emitClose,this.autoDestroy=!!t.autoDestroy,this.destroyed=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(f||(f=r(113).s),this.decoder=new f(t.encoding),this.encoding=t.encoding)}function A(t){if(n=n||r(4611),!(this instanceof A))return new A(t);var e=this instanceof n;this._readableState=new O(t,this,e),this.readable=!0,t&&("function"==typeof t.read&&(this._read=t.read),"function"==typeof t.destroy&&(this._destroy=t.destroy)),a.call(this)}function E(t,e,r,n,o){i("readableAddChunk",e);var a,u=t._readableState;if(null===e)u.reading=!1,function(t,e){if(i("onEofChunk"),!e.ended){if(e.decoder){var r=e.decoder.end();r&&r.length&&(e.buffer.push(r),e.length+=e.objectMode?1:r.length)}e.ended=!0,e.sync?P(t):(e.needReadable=!1,e.emittedReadable||(e.emittedReadable=!0,k(t)))}}(t,u);else if(o||(a=function(t,e){var r,n;return n=e,s.isBuffer(n)||n instanceof c||"string"==typeof e||void 0===e||t.objectMode||(r=new m("chunk",["string","Buffer","Uint8Array"],e)),r}(u,e)),a)w(t,a);else if(u.objectMode||e&&e.length>0)if("string"==typeof e||u.objectMode||Object.getPrototypeOf(e)===s.prototype||(e=function(t){return s.from(t)}(e)),n)u.endEmitted?w(t,new _):j(t,u,e,!0);else if(u.ended)w(t,new v);else{if(u.destroyed)return!1;u.reading=!1,u.decoder&&!r?(e=u.decoder.write(e),u.objectMode||0!==e.length?j(t,u,e,!1):M(t,u)):j(t,u,e,!1)}else n||(u.reading=!1,M(t,u));return!u.ended&&(u.lengthe.highWaterMark&&(e.highWaterMark=function(t){return t>=$?t=$:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}function P(t){var e=t._readableState;i("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(i("emitReadable",e.flowing),e.emittedReadable=!0,{env:{}}.nextTick(k,t))}function k(t){var e=t._readableState;i("emitReadable_",e.destroyed,e.length,e.ended),e.destroyed||!e.length&&!e.ended||(t.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,N(t)}function M(t,e){e.readingMore||(e.readingMore=!0,{env:{}}.nextTick(R,t,e))}function R(t,e){for(;!e.reading&&!e.ended&&(e.length0,e.resumeScheduled&&!e.paused?e.flowing=!0:t.listenerCount("data")>0&&t.resume()}function B(t){i("readable nexttick read 0"),t.read(0)}function T(t,e){i("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),N(t),e.flowing&&!e.reading&&t.read(0)}function N(t){var e=t._readableState;for(i("flow",e.flowing);e.flowing&&null!==t.read(););}function D(t,e){return 0===e.length?null:(e.objectMode?r=e.buffer.shift():!t||t>=e.length?(r=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.first():e.buffer.concat(e.length),e.buffer.clear()):r=e.buffer.consume(t,e.decoder),r);var r}function C(t){var e=t._readableState;i("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,{env:{}}.nextTick(U,e,t))}function U(t,e){if(i("endReadableNT",t.endEmitted,t.length),!t.endEmitted&&0===t.length&&(t.endEmitted=!0,e.readable=!1,e.emit("end"),t.autoDestroy)){var r=e._writableState;(!r||r.autoDestroy&&r.finished)&&e.destroy()}}function L(t,e){for(var r=0,n=t.length;r=e.highWaterMark:e.length>0)||e.ended))return i("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?C(this):P(this),null;if(0===(t=x(t,e))&&e.ended)return 0===e.length&&C(this),null;var n,o=e.needReadable;return i("need readable",o),(0===e.length||e.length-t0?D(t,e):null)?(e.needReadable=e.length<=e.highWaterMark,t=0):(e.length-=t,e.awaitDrain=0),0===e.length&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&C(this)),null!==n&&this.emit("data",n),n},A.prototype._read=function(t){w(this,new g("_read()"))},A.prototype.pipe=function(t,e){var r=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=t;break;case 1:n.pipes=[n.pipes,t];break;default:n.pipes.push(t)}n.pipesCount+=1,i("pipe count=%d opts=%j",n.pipesCount,e);var a=e&&!1===e.end||t==={env:{}}.stdout||t==={env:{}}.stderr?d:s;function s(){i("onend"),t.end()}n.endEmitted?{env:{}}.nextTick(a):r.once("end",a),t.on("unpipe",(function e(o,a){i("onunpipe"),o===r&&a&&!1===a.hasUnpiped&&(a.hasUnpiped=!0,i("cleanup"),t.removeListener("close",h),t.removeListener("finish",p),t.removeListener("drain",c),t.removeListener("error",l),t.removeListener("unpipe",e),r.removeListener("end",s),r.removeListener("end",d),r.removeListener("data",f),u=!0,!n.awaitDrain||t._writableState&&!t._writableState.needDrain||c())}));var c=function(t){return function(){var e=t._readableState;i("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&o(t,"data")&&(e.flowing=!0,N(t))}}(r);t.on("drain",c);var u=!1;function f(e){i("ondata");var o=t.write(e);i("dest.write",o),!1===o&&((1===n.pipesCount&&n.pipes===t||n.pipesCount>1&&-1!==L(n.pipes,t))&&!u&&(i("false write response, pause",n.awaitDrain),n.awaitDrain++),r.pause())}function l(e){i("onerror",e),d(),t.removeListener("error",l),0===o(t,"error")&&w(t,e)}function h(){t.removeListener("finish",p),d()}function p(){i("onfinish"),t.removeListener("close",h),d()}function d(){i("unpipe"),r.unpipe(t)}return r.on("data",f),function(t,e,r){if("function"==typeof t.prependListener)return t.prependListener(e,r);t._events&&t._events.error?Array.isArray(t._events.error)?t._events.error.unshift(r):t._events.error=[r,t._events.error]:t.on(e,r)}(t,"error",l),t.once("close",h),t.once("finish",p),t.emit("pipe",r),n.flowing||(i("pipe resume"),r.resume()),t},A.prototype.unpipe=function(t){var e=this._readableState,r={hasUnpiped:!1};if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes||(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,r)),this;if(!t){var n=e.pipes,i=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var o=0;o0,!1!==n.flowing&&this.resume()):"readable"===t&&(n.endEmitted||n.readableListening||(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,i("on readable",n.length,n.reading),n.length?P(this):n.reading||{env:{}}.nextTick(B,this))),r},A.prototype.addListener=A.prototype.on,A.prototype.removeListener=function(t,e){var r=a.prototype.removeListener.call(this,t,e);return"readable"===t&&{env:{}}.nextTick(I,this),r},A.prototype.removeAllListeners=function(t){var e=a.prototype.removeAllListeners.apply(this,arguments);return"readable"!==t&&void 0!==t||{env:{}}.nextTick(I,this),e},A.prototype.resume=function(){var t=this._readableState;return t.flowing||(i("resume"),t.flowing=!t.readableListening,function(t,e){e.resumeScheduled||(e.resumeScheduled=!0,{env:{}}.nextTick(T,t,e))}(this,t)),t.paused=!1,this},A.prototype.pause=function(){return i("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(i("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},A.prototype.wrap=function(t){var e=this,r=this._readableState,n=!1;for(var o in t.on("end",(function(){if(i("wrapped end"),r.decoder&&!r.ended){var t=r.decoder.end();t&&t.length&&e.push(t)}e.push(null)})),t.on("data",(function(o){i("wrapped data"),r.decoder&&(o=r.decoder.write(o)),r.objectMode&&null==o||(r.objectMode||o&&o.length)&&(e.push(o)||(n=!0,t.pause()))})),t)void 0===this[o]&&"function"==typeof t[o]&&(this[o]=function(e){return function(){return t[e].apply(t,arguments)}}(o));for(var a=0;a{"use strict";t.exports=f;var n=r(5613).q,i=n.ERR_METHOD_NOT_IMPLEMENTED,o=n.ERR_MULTIPLE_CALLBACK,a=n.ERR_TRANSFORM_ALREADY_TRANSFORMING,s=n.ERR_TRANSFORM_WITH_LENGTH_0,c=r(4611);function u(t,e){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(null===n)return this.emit("error",new o);r.writechunk=null,r.writecb=null,null!=e&&this.push(e),n(t);var i=this._readableState;i.reading=!1,(i.needReadable||i.length{"use strict";function n(t){var e=this;this.next=null,this.entry=null,this.finish=function(){!function(t,e,r){var n=t.entry;for(t.entry=null;n;){var i=n.callback;e.pendingcb--,i(undefined),n=n.next}e.corkedRequestsFree.next=t}(e,t)}}var i;t.exports=A,A.WritableState=O;var o,a={deprecate:r(8016)},s=r(6054),c=r(365).Buffer,u=r.g.Uint8Array||function(){},f=r(4798),l=r(6876).getHighWaterMark,h=r(5613).q,p=h.ERR_INVALID_ARG_TYPE,d=h.ERR_METHOD_NOT_IMPLEMENTED,y=h.ERR_MULTIPLE_CALLBACK,b=h.ERR_STREAM_CANNOT_PIPE,m=h.ERR_STREAM_DESTROYED,v=h.ERR_STREAM_NULL_VALUES,g=h.ERR_STREAM_WRITE_AFTER_END,_=h.ERR_UNKNOWN_ENCODING,w=f.errorOrDestroy;function S(){}function O(t,e,o){i=i||r(4611),t=t||{},"boolean"!=typeof o&&(o=e instanceof i),this.objectMode=!!t.objectMode,o&&(this.objectMode=this.objectMode||!!t.writableObjectMode),this.highWaterMark=l(this,t,"writableHighWaterMark",o),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var a=!1===t.decodeStrings;this.decodeStrings=!a,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(t){!function(t,e){var r=t._writableState,n=r.sync,i=r.writecb;if("function"!=typeof i)throw new y;if(function(t){t.writing=!1,t.writecb=null,t.length-=t.writelen,t.writelen=0}(r),e)!function(t,e,r,n,i){--e.pendingcb,r?({env:{}}.nextTick(i,n),{env:{}}.nextTick(k,t,e),t._writableState.errorEmitted=!0,w(t,n)):(i(n),t._writableState.errorEmitted=!0,w(t,n),k(t,e))}(t,r,n,e,i);else{var o=x(r)||t.destroyed;o||r.corked||r.bufferProcessing||!r.bufferedRequest||$(t,r),n?{env:{}}.nextTick(j,t,r,o,i):j(t,r,o,i)}}(e,t)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==t.emitClose,this.autoDestroy=!!t.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new n(this)}function A(t){var e=this instanceof(i=i||r(4611));if(!e&&!o.call(A,this))return new A(t);this._writableState=new O(t,this,e),this.writable=!0,t&&("function"==typeof t.write&&(this._write=t.write),"function"==typeof t.writev&&(this._writev=t.writev),"function"==typeof t.destroy&&(this._destroy=t.destroy),"function"==typeof t.final&&(this._final=t.final)),s.call(this)}function E(t,e,r,n,i,o,a){e.writelen=n,e.writecb=a,e.writing=!0,e.sync=!0,e.destroyed?e.onwrite(new m("write")):r?t._writev(i,e.onwrite):t._write(i,o,e.onwrite),e.sync=!1}function j(t,e,r,n){r||function(t,e){0===e.length&&e.needDrain&&(e.needDrain=!1,t.emit("drain"))}(t,e),e.pendingcb--,n(),k(t,e)}function $(t,e){e.bufferProcessing=!0;var r=e.bufferedRequest;if(t._writev&&r&&r.next){var i=e.bufferedRequestCount,o=new Array(i),a=e.corkedRequestsFree;a.entry=r;for(var s=0,c=!0;r;)o[s]=r,r.isBuf||(c=!1),r=r.next,s+=1;o.allBuffers=c,E(t,e,!0,e.length,o,"",a.finish),e.pendingcb++,e.lastBufferedRequest=null,a.next?(e.corkedRequestsFree=a.next,a.next=null):e.corkedRequestsFree=new n(e),e.bufferedRequestCount=0}else{for(;r;){var u=r.chunk,f=r.encoding,l=r.callback;if(E(t,e,!1,e.objectMode?1:u.length,u,f,l),r=r.next,e.bufferedRequestCount--,e.writing)break}null===r&&(e.lastBufferedRequest=null)}e.bufferedRequest=r,e.bufferProcessing=!1}function x(t){return t.ending&&0===t.length&&null===t.bufferedRequest&&!t.finished&&!t.writing}function P(t,e){t._final((function(r){e.pendingcb--,r&&w(t,r),e.prefinished=!0,t.emit("prefinish"),k(t,e)}))}function k(t,e){var r=x(e);if(r&&(function(t,e){e.prefinished||e.finalCalled||("function"!=typeof t._final||e.destroyed?(e.prefinished=!0,t.emit("prefinish")):(e.pendingcb++,e.finalCalled=!0,{env:{}}.nextTick(P,t,e)))}(t,e),0===e.pendingcb&&(e.finished=!0,t.emit("finish"),e.autoDestroy))){var n=t._readableState;(!n||n.autoDestroy&&n.endEmitted)&&t.destroy()}return r}r(376)(A,s),O.prototype.getBuffer=function(){for(var t=this.bufferedRequest,e=[];t;)e.push(t),t=t.next;return e},function(){try{Object.defineProperty(O.prototype,"buffer",{get:a.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(t){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(o=Function.prototype[Symbol.hasInstance],Object.defineProperty(A,Symbol.hasInstance,{value:function(t){return!!o.call(this,t)||this===A&&t&&t._writableState instanceof O}})):o=function(t){return t instanceof this},A.prototype.pipe=function(){w(this,new b)},A.prototype.write=function(t,e,r){var n,i=this._writableState,o=!1,a=!i.objectMode&&(n=t,c.isBuffer(n)||n instanceof u);return a&&!c.isBuffer(t)&&(t=function(t){return c.from(t)}(t)),"function"==typeof e&&(r=e,e=null),a?e="buffer":e||(e=i.defaultEncoding),"function"!=typeof r&&(r=S),i.ending?function(t,e){var r=new g;w(t,r),{env:{}}.nextTick(e,r)}(this,r):(a||function(t,e,r,n){var i;return null===r?i=new v:"string"==typeof r||e.objectMode||(i=new p("chunk",["string","Buffer"],r)),!i||(w(t,i),{env:{}}.nextTick(n,i),!1)}(this,i,t,r))&&(i.pendingcb++,o=function(t,e,r,n,i,o){if(!r){var a=function(t,e,r){return t.objectMode||!1===t.decodeStrings||"string"!=typeof e||(e=c.from(e,r)),e}(e,n,i);n!==a&&(r=!0,i="buffer",n=a)}var s=e.objectMode?1:n.length;e.length+=s;var u=e.length-1))throw new _(t);return this._writableState.defaultEncoding=t,this},Object.defineProperty(A.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(A.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),A.prototype._write=function(t,e,r){r(new d("_write()"))},A.prototype._writev=null,A.prototype.end=function(t,e,r){var n=this._writableState;return"function"==typeof t?(r=t,t=null,e=null):"function"==typeof e&&(r=e,e=null),null!=t&&this.write(t,e),n.corked&&(n.corked=1,this.uncork()),n.ending||function(t,e,r){e.ending=!0,k(t,e),r&&(e.finished?{env:{}}.nextTick(r):t.once("finish",r)),e.ended=!0,t.writable=!1}(this,n,r),this},Object.defineProperty(A.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(A.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}}),A.prototype.destroy=f.destroy,A.prototype._undestroy=f.undestroy,A.prototype._destroy=function(t,e){e(t)}},7673:(t,e,r)=>{"use strict";var n;function i(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var o=r(8820),a=Symbol("lastResolve"),s=Symbol("lastReject"),c=Symbol("error"),u=Symbol("ended"),f=Symbol("lastPromise"),l=Symbol("handlePromise"),h=Symbol("stream");function p(t,e){return{value:t,done:e}}function d(t){var e=t[a];if(null!==e){var r=t[h].read();null!==r&&(t[f]=null,t[a]=null,t[s]=null,e(p(r,!1)))}}function y(t){({env:{}}).nextTick(d,t)}var b=Object.getPrototypeOf((function(){})),m=Object.setPrototypeOf((i(n={get stream(){return this[h]},next:function(){var t=this,e=this[c];if(null!==e)return Promise.reject(e);if(this[u])return Promise.resolve(p(void 0,!0));if(this[h].destroyed)return new Promise((function(e,r){({env:{}}).nextTick((function(){t[c]?r(t[c]):e(p(void 0,!0))}))}));var r,n=this[f];if(n)r=new Promise(function(t,e){return function(r,n){t.then((function(){e[u]?r(p(void 0,!0)):e[l](r,n)}),n)}}(n,this));else{var i=this[h].read();if(null!==i)return Promise.resolve(p(i,!1));r=new Promise(this[l])}return this[f]=r,r}},Symbol.asyncIterator,(function(){return this})),i(n,"return",(function(){var t=this;return new Promise((function(e,r){t[h].destroy(null,(function(t){t?r(t):e(p(void 0,!0))}))}))})),n),b);t.exports=function(t){var e,r=Object.create(m,(i(e={},h,{value:t,writable:!0}),i(e,a,{value:null,writable:!0}),i(e,s,{value:null,writable:!0}),i(e,c,{value:null,writable:!0}),i(e,u,{value:t._readableState.endEmitted,writable:!0}),i(e,l,{value:function(t,e){var n=r[h].read();n?(r[f]=null,r[a]=null,r[s]=null,t(p(n,!1))):(r[a]=t,r[s]=e)},writable:!0}),e));return r[f]=null,o(t,(function(t){if(t&&"ERR_STREAM_PREMATURE_CLOSE"!==t.code){var e=r[s];return null!==e&&(r[f]=null,r[a]=null,r[s]=null,e(t)),void(r[c]=t)}var n=r[a];null!==n&&(r[f]=null,r[a]=null,r[s]=null,n(p(void 0,!0))),r[u]=!0})),t.on("readable",y.bind(null,r)),r}},1843:(t,e,r)=>{"use strict";function n(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function i(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function o(t,e){for(var r=0;r0?this.tail.next=e:this.head=e,this.tail=e,++this.length}},{key:"unshift",value:function(t){var e={data:t,next:this.head};0===this.length&&(this.tail=e),this.head=e,++this.length}},{key:"shift",value:function(){if(0!==this.length){var t=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,t}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(t){if(0===this.length)return"";for(var e=this.head,r=""+e.data;e=e.next;)r+=t+e.data;return r}},{key:"concat",value:function(t){if(0===this.length)return a.alloc(0);for(var e,r,n,i=a.allocUnsafe(t>>>0),o=this.head,s=0;o;)e=o.data,r=i,n=s,a.prototype.copy.call(e,r,n),s+=o.data.length,o=o.next;return i}},{key:"consume",value:function(t,e){var r;return ti.length?i.length:t;if(o===i.length?n+=i:n+=i.slice(0,t),0==(t-=o)){o===i.length?(++r,e.next?this.head=e.next:this.head=this.tail=null):(this.head=e,e.data=i.slice(o));break}++r}return this.length-=r,n}},{key:"_getBuffer",value:function(t){var e=a.allocUnsafe(t),r=this.head,n=1;for(r.data.copy(e),t-=r.data.length;r=r.next;){var i=r.data,o=t>i.length?i.length:t;if(i.copy(e,e.length-t,0,o),0==(t-=o)){o===i.length?(++n,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=i.slice(o));break}++n}return this.length-=n,e}},{key:c,value:function(t,e){return s(this,function(t){for(var e=1;e{"use strict";function e(t,e){n(t,e),r(t)}function r(t){t._writableState&&!t._writableState.emitClose||t._readableState&&!t._readableState.emitClose||t.emit("close")}function n(t,e){t.emit("error",e)}t.exports={destroy:function(t,i){var o=this,a=this._readableState&&this._readableState.destroyed,s=this._writableState&&this._writableState.destroyed;return a||s?(i?i(t):t&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,{env:{}}.nextTick(n,this,t)):{env:{}}.nextTick(n,this,t)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,(function(t){!i&&t?o._writableState?o._writableState.errorEmitted?{env:{}}.nextTick(r,o):(o._writableState.errorEmitted=!0,{env:{}}.nextTick(e,o,t)):{env:{}}.nextTick(e,o,t):i?({env:{}}.nextTick(r,o),i(t)):{env:{}}.nextTick(r,o)})),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(t,e){var r=t._readableState,n=t._writableState;r&&r.autoDestroy||n&&n.autoDestroy?t.destroy(e):t.emit("error",e)}}},8820:(t,e,r)=>{"use strict";var n=r(5613).q.ERR_STREAM_PREMATURE_CLOSE;function i(){}t.exports=function t(e,r,o){if("function"==typeof r)return t(e,null,r);r||(r={}),o=function(t){var e=!1;return function(){if(!e){e=!0;for(var r=arguments.length,n=new Array(r),i=0;i{t.exports=function(){throw new Error("Readable.from is not available in the browser")}},8751:(t,e,r)=>{"use strict";var n,i=r(5613).q,o=i.ERR_MISSING_ARGS,a=i.ERR_STREAM_DESTROYED;function s(t){if(t)throw t}function c(t,e,i,o){o=function(t){var e=!1;return function(){e||(e=!0,t.apply(void 0,arguments))}}(o);var s=!1;t.on("close",(function(){s=!0})),void 0===n&&(n=r(8820)),n(t,{readable:e,writable:i},(function(t){if(t)return o(t);s=!0,o()}));var c=!1;return function(e){if(!s&&!c)return c=!0,function(t){return t.setHeader&&"function"==typeof t.abort}(t)?t.abort():"function"==typeof t.destroy?t.destroy():void o(e||new a("pipe"))}}function u(t){t()}function f(t,e){return t.pipe(e)}function l(t){return t.length?"function"!=typeof t[t.length-1]?s:t.pop():s}t.exports=function(){for(var t=arguments.length,e=new Array(t),r=0;r0,(function(t){n||(n=t),t&&a.forEach(u),o||(a.forEach(u),i(n))}))}));return e.reduce(f)}},6876:(t,e,r)=>{"use strict";var n=r(5613).q.ERR_INVALID_OPT_VALUE;t.exports={getHighWaterMark:function(t,e,r,i){var o=function(t,e,r){return null!=t.highWaterMark?t.highWaterMark:e?t[r]:null}(e,i,r);if(null!=o){if(!isFinite(o)||Math.floor(o)!==o||o<0)throw new n(i?r:"highWaterMark",o);return Math.floor(o)}return t.objectMode?16:16384}}},6054:(t,e,r)=>{t.exports=r(9620).EventEmitter},8237:(t,e,r)=>{(e=t.exports=r(6751)).Stream=e,e.Readable=e,e.Writable=r(679),e.Duplex=r(4611),e.Transform=r(4951),e.PassThrough=r(3684),e.finished=r(8820),e.pipeline=r(8751)},8100:(t,e,r)=>{"use strict";var n=r(365).Buffer,i=r(376),o=r(5125),a=new Array(16),s=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],c=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],u=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],f=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11],l=[0,1518500249,1859775393,2400959708,2840853838],h=[1352829926,1548603684,1836072691,2053994217,0];function p(){o.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520}function d(t,e){return t<>>32-e}function y(t,e,r,n,i,o,a,s){return d(t+(e^r^n)+o+a|0,s)+i|0}function b(t,e,r,n,i,o,a,s){return d(t+(e&r|~e&n)+o+a|0,s)+i|0}function m(t,e,r,n,i,o,a,s){return d(t+((e|~r)^n)+o+a|0,s)+i|0}function v(t,e,r,n,i,o,a,s){return d(t+(e&n|r&~n)+o+a|0,s)+i|0}function g(t,e,r,n,i,o,a,s){return d(t+(e^(r|~n))+o+a|0,s)+i|0}i(p,o),p.prototype._update=function(){for(var t=a,e=0;e<16;++e)t[e]=this._block.readInt32LE(4*e);for(var r=0|this._a,n=0|this._b,i=0|this._c,o=0|this._d,p=0|this._e,_=0|this._a,w=0|this._b,S=0|this._c,O=0|this._d,A=0|this._e,E=0;E<80;E+=1){var j,$;E<16?(j=y(r,n,i,o,p,t[s[E]],l[0],u[E]),$=g(_,w,S,O,A,t[c[E]],h[0],f[E])):E<32?(j=b(r,n,i,o,p,t[s[E]],l[1],u[E]),$=v(_,w,S,O,A,t[c[E]],h[1],f[E])):E<48?(j=m(r,n,i,o,p,t[s[E]],l[2],u[E]),$=m(_,w,S,O,A,t[c[E]],h[2],f[E])):E<64?(j=v(r,n,i,o,p,t[s[E]],l[3],u[E]),$=b(_,w,S,O,A,t[c[E]],h[3],f[E])):(j=g(r,n,i,o,p,t[s[E]],l[4],u[E]),$=y(_,w,S,O,A,t[c[E]],h[4],f[E])),r=p,p=o,o=d(i,10),i=n,n=j,_=A,A=O,O=d(S,10),S=w,w=$}var x=this._b+i+O|0;this._b=this._c+o+A|0,this._c=this._d+p+_|0,this._d=this._e+r+w|0,this._e=this._a+n+S|0,this._a=x},p.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var t=n.alloc?n.alloc(20):new n(20);return t.writeInt32LE(this._a,0),t.writeInt32LE(this._b,4),t.writeInt32LE(this._c,8),t.writeInt32LE(this._d,12),t.writeInt32LE(this._e,16),t},t.exports=p},9047:(t,e,r)=>{var n=r(365),i=n.Buffer;function o(t,e){for(var r in t)e[r]=t[r]}function a(t,e,r){return i(t,e,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?t.exports=n:(o(n,e),e.Buffer=a),o(i,a),a.from=function(t,e,r){if("number"==typeof t)throw new TypeError("Argument must not be a number");return i(t,e,r)},a.alloc=function(t,e,r){if("number"!=typeof t)throw new TypeError("Argument must be a number");var n=i(t);return void 0!==e?"string"==typeof r?n.fill(e,r):n.fill(e):n.fill(0),n},a.allocUnsafe=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return i(t)},a.allocUnsafeSlow=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return n.SlowBuffer(t)}},8723:(t,e,r)=>{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}var i,o=r(365),a=o.Buffer,s={};for(i in o)o.hasOwnProperty(i)&&"SlowBuffer"!==i&&"Buffer"!==i&&(s[i]=o[i]);var c=s.Buffer={};for(i in a)a.hasOwnProperty(i)&&"allocUnsafe"!==i&&"allocUnsafeSlow"!==i&&(c[i]=a[i]);if(s.Buffer.prototype=a.prototype,c.from&&c.from!==Uint8Array.from||(c.from=function(t,e,r){if("number"==typeof t)throw new TypeError('The "value" argument must not be of type number. Received type '+n(t));if(t&&void 0===t.length)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+n(t));return a(t,e,r)}),c.alloc||(c.alloc=function(t,e,r){if("number"!=typeof t)throw new TypeError('The "size" argument must be of type number. Received type '+n(t));if(t<0||t>=2*(1<<30))throw new RangeError('The value "'+t+'" is invalid for option "size"');var i=a(t);return e&&0!==e.length?"string"==typeof r?i.fill(e,r):i.fill(e):i.fill(0),i}),!s.kStringMaxLength)try{s.kStringMaxLength={env:{}}.binding("buffer").kStringMaxLength}catch(t){}s.constants||(s.constants={MAX_LENGTH:s.kMaxLength},s.kStringMaxLength&&(s.constants.MAX_STRING_LENGTH=s.kStringMaxLength)),t.exports=s},2159:(t,e,r)=>{var n=r(9047).Buffer;function i(t,e){this._block=n.alloc(t),this._finalSize=e,this._blockSize=t,this._len=0}i.prototype.update=function(t,e){"string"==typeof t&&(e=e||"utf8",t=n.from(t,e));for(var r=this._block,i=this._blockSize,o=t.length,a=this._len,s=0;s=this._finalSize&&(this._update(this._block),this._block.fill(0));var r=8*this._len;if(r<=4294967295)this._block.writeUInt32BE(r,this._blockSize-4);else{var n=(4294967295&r)>>>0,i=(r-n)/4294967296;this._block.writeUInt32BE(i,this._blockSize-8),this._block.writeUInt32BE(n,this._blockSize-4)}this._update(this._block);var o=this._hash();return t?o.toString(t):o},i.prototype._update=function(){throw new Error("_update must be implemented by subclass")},t.exports=i},1806:(t,e,r)=>{var n=t.exports=function(t){t=t.toLowerCase();var e=n[t];if(!e)throw new Error(t+" is not supported (we accept pull requests)");return new e};n.sha=r(9675),n.sha1=r(2950),n.sha224=r(8881),n.sha256=r(9642),n.sha384=r(8220),n.sha512=r(6859)},9675:(t,e,r)=>{var n=r(376),i=r(2159),o=r(9047).Buffer,a=[1518500249,1859775393,-1894007588,-899497514],s=new Array(80);function c(){this.init(),this._w=s,i.call(this,64,56)}function u(t){return t<<30|t>>>2}function f(t,e,r,n){return 0===t?e&r|~e&n:2===t?e&r|e&n|r&n:e^r^n}n(c,i),c.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},c.prototype._update=function(t){for(var e,r=this._w,n=0|this._a,i=0|this._b,o=0|this._c,s=0|this._d,c=0|this._e,l=0;l<16;++l)r[l]=t.readInt32BE(4*l);for(;l<80;++l)r[l]=r[l-3]^r[l-8]^r[l-14]^r[l-16];for(var h=0;h<80;++h){var p=~~(h/20),d=0|((e=n)<<5|e>>>27)+f(p,i,o,s)+c+r[h]+a[p];c=s,s=o,o=u(i),i=n,n=d}this._a=n+this._a|0,this._b=i+this._b|0,this._c=o+this._c|0,this._d=s+this._d|0,this._e=c+this._e|0},c.prototype._hash=function(){var t=o.allocUnsafe(20);return t.writeInt32BE(0|this._a,0),t.writeInt32BE(0|this._b,4),t.writeInt32BE(0|this._c,8),t.writeInt32BE(0|this._d,12),t.writeInt32BE(0|this._e,16),t},t.exports=c},2950:(t,e,r)=>{var n=r(376),i=r(2159),o=r(9047).Buffer,a=[1518500249,1859775393,-1894007588,-899497514],s=new Array(80);function c(){this.init(),this._w=s,i.call(this,64,56)}function u(t){return t<<5|t>>>27}function f(t){return t<<30|t>>>2}function l(t,e,r,n){return 0===t?e&r|~e&n:2===t?e&r|e&n|r&n:e^r^n}n(c,i),c.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},c.prototype._update=function(t){for(var e,r=this._w,n=0|this._a,i=0|this._b,o=0|this._c,s=0|this._d,c=0|this._e,h=0;h<16;++h)r[h]=t.readInt32BE(4*h);for(;h<80;++h)r[h]=(e=r[h-3]^r[h-8]^r[h-14]^r[h-16])<<1|e>>>31;for(var p=0;p<80;++p){var d=~~(p/20),y=u(n)+l(d,i,o,s)+c+r[p]+a[d]|0;c=s,s=o,o=f(i),i=n,n=y}this._a=n+this._a|0,this._b=i+this._b|0,this._c=o+this._c|0,this._d=s+this._d|0,this._e=c+this._e|0},c.prototype._hash=function(){var t=o.allocUnsafe(20);return t.writeInt32BE(0|this._a,0),t.writeInt32BE(0|this._b,4),t.writeInt32BE(0|this._c,8),t.writeInt32BE(0|this._d,12),t.writeInt32BE(0|this._e,16),t},t.exports=c},8881:(t,e,r)=>{var n=r(376),i=r(9642),o=r(2159),a=r(9047).Buffer,s=new Array(64);function c(){this.init(),this._w=s,o.call(this,64,56)}n(c,i),c.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this},c.prototype._hash=function(){var t=a.allocUnsafe(28);return t.writeInt32BE(this._a,0),t.writeInt32BE(this._b,4),t.writeInt32BE(this._c,8),t.writeInt32BE(this._d,12),t.writeInt32BE(this._e,16),t.writeInt32BE(this._f,20),t.writeInt32BE(this._g,24),t},t.exports=c},9642:(t,e,r)=>{var n=r(376),i=r(2159),o=r(9047).Buffer,a=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],s=new Array(64);function c(){this.init(),this._w=s,i.call(this,64,56)}function u(t,e,r){return r^t&(e^r)}function f(t,e,r){return t&e|r&(t|e)}function l(t){return(t>>>2|t<<30)^(t>>>13|t<<19)^(t>>>22|t<<10)}function h(t){return(t>>>6|t<<26)^(t>>>11|t<<21)^(t>>>25|t<<7)}function p(t){return(t>>>7|t<<25)^(t>>>18|t<<14)^t>>>3}n(c,i),c.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this},c.prototype._update=function(t){for(var e,r=this._w,n=0|this._a,i=0|this._b,o=0|this._c,s=0|this._d,c=0|this._e,d=0|this._f,y=0|this._g,b=0|this._h,m=0;m<16;++m)r[m]=t.readInt32BE(4*m);for(;m<64;++m)r[m]=0|(((e=r[m-2])>>>17|e<<15)^(e>>>19|e<<13)^e>>>10)+r[m-7]+p(r[m-15])+r[m-16];for(var v=0;v<64;++v){var g=b+h(c)+u(c,d,y)+a[v]+r[v]|0,_=l(n)+f(n,i,o)|0;b=y,y=d,d=c,c=s+g|0,s=o,o=i,i=n,n=g+_|0}this._a=n+this._a|0,this._b=i+this._b|0,this._c=o+this._c|0,this._d=s+this._d|0,this._e=c+this._e|0,this._f=d+this._f|0,this._g=y+this._g|0,this._h=b+this._h|0},c.prototype._hash=function(){var t=o.allocUnsafe(32);return t.writeInt32BE(this._a,0),t.writeInt32BE(this._b,4),t.writeInt32BE(this._c,8),t.writeInt32BE(this._d,12),t.writeInt32BE(this._e,16),t.writeInt32BE(this._f,20),t.writeInt32BE(this._g,24),t.writeInt32BE(this._h,28),t},t.exports=c},8220:(t,e,r)=>{var n=r(376),i=r(6859),o=r(2159),a=r(9047).Buffer,s=new Array(160);function c(){this.init(),this._w=s,o.call(this,128,112)}n(c,i),c.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this},c.prototype._hash=function(){var t=a.allocUnsafe(48);function e(e,r,n){t.writeInt32BE(e,n),t.writeInt32BE(r,n+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),t},t.exports=c},6859:(t,e,r)=>{var n=r(376),i=r(2159),o=r(9047).Buffer,a=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],s=new Array(160);function c(){this.init(),this._w=s,i.call(this,128,112)}function u(t,e,r){return r^t&(e^r)}function f(t,e,r){return t&e|r&(t|e)}function l(t,e){return(t>>>28|e<<4)^(e>>>2|t<<30)^(e>>>7|t<<25)}function h(t,e){return(t>>>14|e<<18)^(t>>>18|e<<14)^(e>>>9|t<<23)}function p(t,e){return(t>>>1|e<<31)^(t>>>8|e<<24)^t>>>7}function d(t,e){return(t>>>1|e<<31)^(t>>>8|e<<24)^(t>>>7|e<<25)}function y(t,e){return(t>>>19|e<<13)^(e>>>29|t<<3)^t>>>6}function b(t,e){return(t>>>19|e<<13)^(e>>>29|t<<3)^(t>>>6|e<<26)}function m(t,e){return t>>>0>>0?1:0}n(c,i),c.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this},c.prototype._update=function(t){for(var e=this._w,r=0|this._ah,n=0|this._bh,i=0|this._ch,o=0|this._dh,s=0|this._eh,c=0|this._fh,v=0|this._gh,g=0|this._hh,_=0|this._al,w=0|this._bl,S=0|this._cl,O=0|this._dl,A=0|this._el,E=0|this._fl,j=0|this._gl,$=0|this._hl,x=0;x<32;x+=2)e[x]=t.readInt32BE(4*x),e[x+1]=t.readInt32BE(4*x+4);for(;x<160;x+=2){var P=e[x-30],k=e[x-30+1],M=p(P,k),R=d(k,P),I=y(P=e[x-4],k=e[x-4+1]),B=b(k,P),T=e[x-14],N=e[x-14+1],D=e[x-32],C=e[x-32+1],U=R+N|0,L=M+T+m(U,R)|0;L=(L=L+I+m(U=U+B|0,B)|0)+D+m(U=U+C|0,C)|0,e[x]=L,e[x+1]=U}for(var q=0;q<160;q+=2){L=e[q],U=e[q+1];var F=f(r,n,i),V=f(_,w,S),z=l(r,_),K=l(_,r),W=h(s,A),H=h(A,s),J=a[q],G=a[q+1],Y=u(s,c,v),Q=u(A,E,j),X=$+H|0,Z=g+W+m(X,$)|0;Z=(Z=(Z=Z+Y+m(X=X+Q|0,Q)|0)+J+m(X=X+G|0,G)|0)+L+m(X=X+U|0,U)|0;var tt=K+V|0,et=z+F+m(tt,K)|0;g=v,$=j,v=c,j=E,c=s,E=A,s=o+Z+m(A=O+X|0,O)|0,o=i,O=S,i=n,S=w,n=r,w=_,r=Z+et+m(_=X+tt|0,X)|0}this._al=this._al+_|0,this._bl=this._bl+w|0,this._cl=this._cl+S|0,this._dl=this._dl+O|0,this._el=this._el+A|0,this._fl=this._fl+E|0,this._gl=this._gl+j|0,this._hl=this._hl+$|0,this._ah=this._ah+r+m(this._al,_)|0,this._bh=this._bh+n+m(this._bl,w)|0,this._ch=this._ch+i+m(this._cl,S)|0,this._dh=this._dh+o+m(this._dl,O)|0,this._eh=this._eh+s+m(this._el,A)|0,this._fh=this._fh+c+m(this._fl,E)|0,this._gh=this._gh+v+m(this._gl,j)|0,this._hh=this._hh+g+m(this._hl,$)|0},c.prototype._hash=function(){var t=o.allocUnsafe(64);function e(e,r,n){t.writeInt32BE(e,n),t.writeInt32BE(r,n+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),e(this._gh,this._gl,48),e(this._hh,this._hl,56),t},t.exports=c},4723:(t,e,r)=>{t.exports=i;var n=r(9620).EventEmitter;function i(){n.call(this)}r(376)(i,n),i.Readable=r(6751),i.Writable=r(679),i.Duplex=r(4611),i.Transform=r(4951),i.PassThrough=r(3684),i.finished=r(8820),i.pipeline=r(8751),i.Stream=i,i.prototype.pipe=function(t,e){var r=this;function i(e){t.writable&&!1===t.write(e)&&r.pause&&r.pause()}function o(){r.readable&&r.resume&&r.resume()}r.on("data",i),t.on("drain",o),t._isStdio||e&&!1===e.end||(r.on("end",s),r.on("close",c));var a=!1;function s(){a||(a=!0,t.end())}function c(){a||(a=!0,"function"==typeof t.destroy&&t.destroy())}function u(t){if(f(),0===n.listenerCount(this,"error"))throw t}function f(){r.removeListener("data",i),t.removeListener("drain",o),r.removeListener("end",s),r.removeListener("close",c),r.removeListener("error",u),t.removeListener("error",u),r.removeListener("end",f),r.removeListener("close",f),t.removeListener("close",f)}return r.on("error",u),t.on("error",u),r.on("end",f),r.on("close",f),t.on("close",f),t.emit("pipe",r),t}},113:(t,e,r)=>{"use strict";var n=r(4368).Buffer,i=n.isEncoding||function(t){switch((t=""+t)&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function o(t){var e;switch(this.encoding=function(t){var e=function(t){if(!t)return"utf8";for(var e;;)switch(t){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}(t);if("string"!=typeof e&&(n.isEncoding===i||!i(t)))throw new Error("Unknown encoding: "+t);return e||t}(t),this.encoding){case"utf16le":this.text=c,this.end=u,e=4;break;case"utf8":this.fillLast=s,e=4;break;case"base64":this.text=f,this.end=l,e=3;break;default:return this.write=h,void(this.end=p)}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(e)}function a(t){return t<=127?0:t>>5==6?2:t>>4==14?3:t>>3==30?4:t>>6==2?-1:-2}function s(t){var e=this.lastTotal-this.lastNeed,r=function(t,e,r){if(128!=(192&e[0]))return t.lastNeed=0,"�";if(t.lastNeed>1&&e.length>1){if(128!=(192&e[1]))return t.lastNeed=1,"�";if(t.lastNeed>2&&e.length>2&&128!=(192&e[2]))return t.lastNeed=2,"�"}}(this,t);return void 0!==r?r:this.lastNeed<=t.length?(t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(t.copy(this.lastChar,e,0,t.length),void(this.lastNeed-=t.length))}function c(t,e){if((t.length-e)%2==0){var r=t.toString("utf16le",e);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function u(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,r)}return e}function f(t,e){var r=(t.length-e)%3;return 0===r?t.toString("base64",e):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-r))}function l(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function h(t){return t.toString(this.encoding)}function p(t){return t&&t.length?this.write(t):""}e.s=o,o.prototype.write=function(t){if(0===t.length)return"";var e,r;if(this.lastNeed){if(void 0===(e=this.fillLast(t)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r=0?(i>0&&(t.lastNeed=i-1),i):--n=0?(i>0&&(t.lastNeed=i-2),i):--n=0?(i>0&&(2===i?i=0:t.lastNeed=i-3),i):0}(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=r;var n=t.length-(r-this.lastNeed);return t.copy(this.lastChar,0,n),t.toString("utf8",e,n)},o.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length}},4368:(t,e,r)=>{var n=r(365),i=n.Buffer;function o(t,e){for(var r in t)e[r]=t[r]}function a(t,e,r){return i(t,e,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?t.exports=n:(o(n,e),e.Buffer=a),a.prototype=Object.create(i.prototype),o(i,a),a.from=function(t,e,r){if("number"==typeof t)throw new TypeError("Argument must not be a number");return i(t,e,r)},a.alloc=function(t,e,r){if("number"!=typeof t)throw new TypeError("Argument must be a number");var n=i(t);return void 0!==e?"string"==typeof r?n.fill(e,r):n.fill(e):n.fill(0),n},a.allocUnsafe=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return i(t)},a.allocUnsafeSlow=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return n.SlowBuffer(t)}},8016:(t,e,r)=>{function n(t){try{if(!r.g.localStorage)return!1}catch(t){return!1}var e=r.g.localStorage[t];return null!=e&&"true"===String(e).toLowerCase()}t.exports=function(t,e){if(n("noDeprecation"))return t;var r=!1;return function(){if(!r){if(n("throwDeprecation"))throw new Error(e);n("traceDeprecation")?console.trace(e):console.warn(e),r=!0}return t.apply(this,arguments)}}},8538:t=>{function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},e(t)}t.exports=function(t){return t&&"object"===e(t)&&"function"==typeof t.copy&&"function"==typeof t.fill&&"function"==typeof t.readUInt8}},9957:(t,e,r)=>{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}var i=r(2755),o=r(6738),a=r(1482),s=r(7913);function c(t){return t.call.bind(t)}var u="undefined"!=typeof BigInt,f="undefined"!=typeof Symbol,l=c(Object.prototype.toString),h=c(Number.prototype.valueOf),p=c(String.prototype.valueOf),d=c(Boolean.prototype.valueOf);if(u)var y=c(BigInt.prototype.valueOf);if(f)var b=c(Symbol.prototype.valueOf);function m(t,e){if("object"!==n(t))return!1;try{return e(t),!0}catch(t){return!1}}function v(t){return"[object Map]"===l(t)}function g(t){return"[object Set]"===l(t)}function _(t){return"[object WeakMap]"===l(t)}function w(t){return"[object WeakSet]"===l(t)}function S(t){return"[object ArrayBuffer]"===l(t)}function O(t){return"undefined"!=typeof ArrayBuffer&&(S.working?S(t):t instanceof ArrayBuffer)}function A(t){return"[object DataView]"===l(t)}function E(t){return"undefined"!=typeof DataView&&(A.working?A(t):t instanceof DataView)}e.isArgumentsObject=i,e.isGeneratorFunction=o,e.isTypedArray=s,e.isPromise=function(t){return"undefined"!=typeof Promise&&t instanceof Promise||null!==t&&"object"===n(t)&&"function"==typeof t.then&&"function"==typeof t.catch},e.isArrayBufferView=function(t){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):s(t)||E(t)},e.isUint8Array=function(t){return"Uint8Array"===a(t)},e.isUint8ClampedArray=function(t){return"Uint8ClampedArray"===a(t)},e.isUint16Array=function(t){return"Uint16Array"===a(t)},e.isUint32Array=function(t){return"Uint32Array"===a(t)},e.isInt8Array=function(t){return"Int8Array"===a(t)},e.isInt16Array=function(t){return"Int16Array"===a(t)},e.isInt32Array=function(t){return"Int32Array"===a(t)},e.isFloat32Array=function(t){return"Float32Array"===a(t)},e.isFloat64Array=function(t){return"Float64Array"===a(t)},e.isBigInt64Array=function(t){return"BigInt64Array"===a(t)},e.isBigUint64Array=function(t){return"BigUint64Array"===a(t)},v.working="undefined"!=typeof Map&&v(new Map),e.isMap=function(t){return"undefined"!=typeof Map&&(v.working?v(t):t instanceof Map)},g.working="undefined"!=typeof Set&&g(new Set),e.isSet=function(t){return"undefined"!=typeof Set&&(g.working?g(t):t instanceof Set)},_.working="undefined"!=typeof WeakMap&&_(new WeakMap),e.isWeakMap=function(t){return"undefined"!=typeof WeakMap&&(_.working?_(t):t instanceof WeakMap)},w.working="undefined"!=typeof WeakSet&&w(new WeakSet),e.isWeakSet=function(t){return w(t)},S.working="undefined"!=typeof ArrayBuffer&&S(new ArrayBuffer),e.isArrayBuffer=O,A.working="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView&&A(new DataView(new ArrayBuffer(1),0,1)),e.isDataView=E;var j="undefined"!=typeof SharedArrayBuffer?SharedArrayBuffer:void 0;function $(t){return"[object SharedArrayBuffer]"===l(t)}function x(t){return void 0!==j&&(void 0===$.working&&($.working=$(new j)),$.working?$(t):t instanceof j)}function P(t){return m(t,h)}function k(t){return m(t,p)}function M(t){return m(t,d)}function R(t){return u&&m(t,y)}function I(t){return f&&m(t,b)}e.isSharedArrayBuffer=x,e.isAsyncFunction=function(t){return"[object AsyncFunction]"===l(t)},e.isMapIterator=function(t){return"[object Map Iterator]"===l(t)},e.isSetIterator=function(t){return"[object Set Iterator]"===l(t)},e.isGeneratorObject=function(t){return"[object Generator]"===l(t)},e.isWebAssemblyCompiledModule=function(t){return"[object WebAssembly.Module]"===l(t)},e.isNumberObject=P,e.isStringObject=k,e.isBooleanObject=M,e.isBigIntObject=R,e.isSymbolObject=I,e.isBoxedPrimitive=function(t){return P(t)||k(t)||M(t)||R(t)||I(t)},e.isAnyArrayBuffer=function(t){return"undefined"!=typeof Uint8Array&&(O(t)||x(t))},["isProxy","isExternal","isModuleNamespaceObject"].forEach((function(t){Object.defineProperty(e,t,{enumerable:!1,value:function(){throw new Error(t+" is not supported in userland")}})}))},161:(t,e,r)=>{function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}var i=Object.getOwnPropertyDescriptors||function(t){for(var e=Object.keys(t),r={},n=0;n=i)return t;switch(t){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(t){return"[Circular]"}default:return t}})),s=n[r];r=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),b(r)?n.showHidden=r:r&&e._extend(n,r),_(n.showHidden)&&(n.showHidden=!1),_(n.depth)&&(n.depth=2),_(n.colors)&&(n.colors=!1),_(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=f),h(n,t,n.depth)}function f(t,e){var r=u.styles[e];return r?"["+u.colors[r][0]+"m"+t+"["+u.colors[r][1]+"m":t}function l(t,e){return t}function h(t,r,n){if(t.customInspect&&r&&E(r.inspect)&&r.inspect!==e.inspect&&(!r.constructor||r.constructor.prototype!==r)){var i=r.inspect(n,t);return g(i)||(i=h(t,i,n)),i}var o=function(t,e){if(_(e))return t.stylize("undefined","undefined");if(g(e)){var r="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(r,"string")}return v(e)?t.stylize(""+e,"number"):b(e)?t.stylize(""+e,"boolean"):m(e)?t.stylize("null","null"):void 0}(t,r);if(o)return o;var a=Object.keys(r),s=function(t){var e={};return t.forEach((function(t,r){e[t]=!0})),e}(a);if(t.showHidden&&(a=Object.getOwnPropertyNames(r)),A(r)&&(a.indexOf("message")>=0||a.indexOf("description")>=0))return p(r);if(0===a.length){if(E(r)){var c=r.name?": "+r.name:"";return t.stylize("[Function"+c+"]","special")}if(w(r))return t.stylize(RegExp.prototype.toString.call(r),"regexp");if(O(r))return t.stylize(Date.prototype.toString.call(r),"date");if(A(r))return p(r)}var u,f="",l=!1,S=["{","}"];return y(r)&&(l=!0,S=["[","]"]),E(r)&&(f=" [Function"+(r.name?": "+r.name:"")+"]"),w(r)&&(f=" "+RegExp.prototype.toString.call(r)),O(r)&&(f=" "+Date.prototype.toUTCString.call(r)),A(r)&&(f=" "+p(r)),0!==a.length||l&&0!=r.length?n<0?w(r)?t.stylize(RegExp.prototype.toString.call(r),"regexp"):t.stylize("[Object]","special"):(t.seen.push(r),u=l?function(t,e,r,n,i){for(var o=[],a=0,s=e.length;a60?r[0]+(""===e?"":e+"\n ")+" "+t.join(",\n ")+" "+r[1]:r[0]+e+" "+t.join(", ")+" "+r[1]}(u,f,S)):S[0]+f+S[1]}function p(t){return"["+Error.prototype.toString.call(t)+"]"}function d(t,e,r,n,i,o){var a,s,c;if((c=Object.getOwnPropertyDescriptor(e,i)||{value:e[i]}).get?s=c.set?t.stylize("[Getter/Setter]","special"):t.stylize("[Getter]","special"):c.set&&(s=t.stylize("[Setter]","special")),k(n,i)||(a="["+i+"]"),s||(t.seen.indexOf(c.value)<0?(s=m(r)?h(t,c.value,null):h(t,c.value,r-1)).indexOf("\n")>-1&&(s=o?s.split("\n").map((function(t){return" "+t})).join("\n").substr(2):"\n"+s.split("\n").map((function(t){return" "+t})).join("\n")):s=t.stylize("[Circular]","special")),_(a)){if(o&&i.match(/^\d+$/))return s;(a=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(a=a.substr(1,a.length-2),a=t.stylize(a,"name")):(a=a.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),a=t.stylize(a,"string"))}return a+": "+s}function y(t){return Array.isArray(t)}function b(t){return"boolean"==typeof t}function m(t){return null===t}function v(t){return"number"==typeof t}function g(t){return"string"==typeof t}function _(t){return void 0===t}function w(t){return S(t)&&"[object RegExp]"===j(t)}function S(t){return"object"===n(t)&&null!==t}function O(t){return S(t)&&"[object Date]"===j(t)}function A(t){return S(t)&&("[object Error]"===j(t)||t instanceof Error)}function E(t){return"function"==typeof t}function j(t){return Object.prototype.toString.call(t)}function $(t){return t<10?"0"+t.toString(10):t.toString(10)}e.debuglog=function(t){if(t=t.toUpperCase(),!a[t])if(s.test(t)){var r={env:{}}.pid;a[t]=function(){var n=e.format.apply(e,arguments);console.error("%s %d: %s",t,r,n)}}else a[t]=function(){};return a[t]},e.inspect=u,u.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},u.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},e.types=r(9957),e.isArray=y,e.isBoolean=b,e.isNull=m,e.isNullOrUndefined=function(t){return null==t},e.isNumber=v,e.isString=g,e.isSymbol=function(t){return"symbol"===n(t)},e.isUndefined=_,e.isRegExp=w,e.types.isRegExp=w,e.isObject=S,e.isDate=O,e.types.isDate=O,e.isError=A,e.types.isNativeError=A,e.isFunction=E,e.isPrimitive=function(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"===n(t)||void 0===t},e.isBuffer=r(8538);var x=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function P(){var t=new Date,e=[$(t.getHours()),$(t.getMinutes()),$(t.getSeconds())].join(":");return[t.getDate(),x[t.getMonth()],e].join(" ")}function k(t,e){return Object.prototype.hasOwnProperty.call(t,e)}e.log=function(){console.log("%s - %s",P(),e.format.apply(e,arguments))},e.inherits=r(376),e._extend=function(t,e){if(!e||!S(e))return t;for(var r=Object.keys(e),n=r.length;n--;)t[r[n]]=e[r[n]];return t};var M="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function R(t,e){if(!t){var r=new Error("Promise was rejected with a falsy value");r.reason=t,t=r}return e(t)}e.promisify=function(t){if("function"!=typeof t)throw new TypeError('The "original" argument must be of type Function');if(M&&t[M]){var e;if("function"!=typeof(e=t[M]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(e,M,{value:e,enumerable:!1,writable:!1,configurable:!0}),e}function e(){for(var e,r,n=new Promise((function(t,n){e=t,r=n})),i=[],o=0;o{"use strict";var n=r(5337),i=r(6461),o=r(8780),a=o("Object.prototype.toString"),s=r(5994)(),c="undefined"==typeof globalThis?r.g:globalThis,u=i(),f=o("String.prototype.slice"),l={},h=r(3999),p=Object.getPrototypeOf;s&&h&&p&&n(u,(function(t){if("function"==typeof c[t]){var e=new c[t];if(Symbol.toStringTag in e){var r=p(e),n=h(r,Symbol.toStringTag);if(!n){var i=p(r);n=h(i,Symbol.toStringTag)}l[t]=n.get}}}));var d=r(7913);t.exports=function(t){return!!d(t)&&(s&&Symbol.toStringTag in t?function(t){var e=!1;return n(l,(function(r,n){if(!e)try{var i=r.call(t);i===n&&(e=i)}catch(t){}})),e}(t):f(a(t),8,-1))}},6601:()=>{},9214:()=>{},2361:()=>{},4616:()=>{},6461:(t,e,r)=>{"use strict";var n=["BigInt64Array","BigUint64Array","Float32Array","Float64Array","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Uint8Array","Uint8ClampedArray"],i="undefined"==typeof globalThis?r.g:globalThis;t.exports=function(){for(var t=[],e=0;e{"use strict";var n=r(6893)("%Object.getOwnPropertyDescriptor%",!0);if(n)try{n([],"length")}catch(t){n=null}t.exports=n},4946:t=>{"use strict";t.exports=JSON.parse('{"aes-128-ecb":{"cipher":"AES","key":128,"iv":0,"mode":"ECB","type":"block"},"aes-192-ecb":{"cipher":"AES","key":192,"iv":0,"mode":"ECB","type":"block"},"aes-256-ecb":{"cipher":"AES","key":256,"iv":0,"mode":"ECB","type":"block"},"aes-128-cbc":{"cipher":"AES","key":128,"iv":16,"mode":"CBC","type":"block"},"aes-192-cbc":{"cipher":"AES","key":192,"iv":16,"mode":"CBC","type":"block"},"aes-256-cbc":{"cipher":"AES","key":256,"iv":16,"mode":"CBC","type":"block"},"aes128":{"cipher":"AES","key":128,"iv":16,"mode":"CBC","type":"block"},"aes192":{"cipher":"AES","key":192,"iv":16,"mode":"CBC","type":"block"},"aes256":{"cipher":"AES","key":256,"iv":16,"mode":"CBC","type":"block"},"aes-128-cfb":{"cipher":"AES","key":128,"iv":16,"mode":"CFB","type":"stream"},"aes-192-cfb":{"cipher":"AES","key":192,"iv":16,"mode":"CFB","type":"stream"},"aes-256-cfb":{"cipher":"AES","key":256,"iv":16,"mode":"CFB","type":"stream"},"aes-128-cfb8":{"cipher":"AES","key":128,"iv":16,"mode":"CFB8","type":"stream"},"aes-192-cfb8":{"cipher":"AES","key":192,"iv":16,"mode":"CFB8","type":"stream"},"aes-256-cfb8":{"cipher":"AES","key":256,"iv":16,"mode":"CFB8","type":"stream"},"aes-128-cfb1":{"cipher":"AES","key":128,"iv":16,"mode":"CFB1","type":"stream"},"aes-192-cfb1":{"cipher":"AES","key":192,"iv":16,"mode":"CFB1","type":"stream"},"aes-256-cfb1":{"cipher":"AES","key":256,"iv":16,"mode":"CFB1","type":"stream"},"aes-128-ofb":{"cipher":"AES","key":128,"iv":16,"mode":"OFB","type":"stream"},"aes-192-ofb":{"cipher":"AES","key":192,"iv":16,"mode":"OFB","type":"stream"},"aes-256-ofb":{"cipher":"AES","key":256,"iv":16,"mode":"OFB","type":"stream"},"aes-128-ctr":{"cipher":"AES","key":128,"iv":16,"mode":"CTR","type":"stream"},"aes-192-ctr":{"cipher":"AES","key":192,"iv":16,"mode":"CTR","type":"stream"},"aes-256-ctr":{"cipher":"AES","key":256,"iv":16,"mode":"CTR","type":"stream"},"aes-128-gcm":{"cipher":"AES","key":128,"iv":12,"mode":"GCM","type":"auth"},"aes-192-gcm":{"cipher":"AES","key":192,"iv":12,"mode":"GCM","type":"auth"},"aes-256-gcm":{"cipher":"AES","key":256,"iv":12,"mode":"GCM","type":"auth"}}')},5207:t=>{"use strict";t.exports=JSON.parse('{"sha224WithRSAEncryption":{"sign":"rsa","hash":"sha224","id":"302d300d06096086480165030402040500041c"},"RSA-SHA224":{"sign":"ecdsa/rsa","hash":"sha224","id":"302d300d06096086480165030402040500041c"},"sha256WithRSAEncryption":{"sign":"rsa","hash":"sha256","id":"3031300d060960864801650304020105000420"},"RSA-SHA256":{"sign":"ecdsa/rsa","hash":"sha256","id":"3031300d060960864801650304020105000420"},"sha384WithRSAEncryption":{"sign":"rsa","hash":"sha384","id":"3041300d060960864801650304020205000430"},"RSA-SHA384":{"sign":"ecdsa/rsa","hash":"sha384","id":"3041300d060960864801650304020205000430"},"sha512WithRSAEncryption":{"sign":"rsa","hash":"sha512","id":"3051300d060960864801650304020305000440"},"RSA-SHA512":{"sign":"ecdsa/rsa","hash":"sha512","id":"3051300d060960864801650304020305000440"},"RSA-SHA1":{"sign":"rsa","hash":"sha1","id":"3021300906052b0e03021a05000414"},"ecdsa-with-SHA1":{"sign":"ecdsa","hash":"sha1","id":""},"sha256":{"sign":"ecdsa","hash":"sha256","id":""},"sha224":{"sign":"ecdsa","hash":"sha224","id":""},"sha384":{"sign":"ecdsa","hash":"sha384","id":""},"sha512":{"sign":"ecdsa","hash":"sha512","id":""},"DSA-SHA":{"sign":"dsa","hash":"sha1","id":""},"DSA-SHA1":{"sign":"dsa","hash":"sha1","id":""},"DSA":{"sign":"dsa","hash":"sha1","id":""},"DSA-WITH-SHA224":{"sign":"dsa","hash":"sha224","id":""},"DSA-SHA224":{"sign":"dsa","hash":"sha224","id":""},"DSA-WITH-SHA256":{"sign":"dsa","hash":"sha256","id":""},"DSA-SHA256":{"sign":"dsa","hash":"sha256","id":""},"DSA-WITH-SHA384":{"sign":"dsa","hash":"sha384","id":""},"DSA-SHA384":{"sign":"dsa","hash":"sha384","id":""},"DSA-WITH-SHA512":{"sign":"dsa","hash":"sha512","id":""},"DSA-SHA512":{"sign":"dsa","hash":"sha512","id":""},"DSA-RIPEMD160":{"sign":"dsa","hash":"rmd160","id":""},"ripemd160WithRSA":{"sign":"rsa","hash":"rmd160","id":"3021300906052b2403020105000414"},"RSA-RIPEMD160":{"sign":"rsa","hash":"rmd160","id":"3021300906052b2403020105000414"},"md5WithRSAEncryption":{"sign":"rsa","hash":"md5","id":"3020300c06082a864886f70d020505000410"},"RSA-MD5":{"sign":"rsa","hash":"md5","id":"3020300c06082a864886f70d020505000410"}}')},1308:t=>{"use strict";t.exports=JSON.parse('{"1.3.132.0.10":"secp256k1","1.3.132.0.33":"p224","1.2.840.10045.3.1.1":"p192","1.2.840.10045.3.1.7":"p256","1.3.132.0.34":"p384","1.3.132.0.35":"p521"}')},9799:t=>{"use strict";t.exports=JSON.parse('{"modp1":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a63a3620ffffffffffffffff"},"modp2":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece65381ffffffffffffffff"},"modp5":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca237327ffffffffffffffff"},"modp14":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aacaa68ffffffffffffffff"},"modp15":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a93ad2caffffffffffffffff"},"modp16":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c934063199ffffffffffffffff"},"modp17":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dcc4024ffffffffffffffff"},"modp18":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dbe115974a3926f12fee5e438777cb6a932df8cd8bec4d073b931ba3bc832b68d9dd300741fa7bf8afc47ed2576f6936ba424663aab639c5ae4f5683423b4742bf1c978238f16cbe39d652de3fdb8befc848ad922222e04a4037c0713eb57a81a23f0c73473fc646cea306b4bcbc8862f8385ddfa9d4b7fa2c087e879683303ed5bdd3a062b3cf5b3a278a66d2a13f83f44f82ddf310ee074ab6a364597e899a0255dc164f31cc50846851df9ab48195ded7ea1b1d510bd7ee74d73faf36bc31ecfa268359046f4eb879f924009438b481c6cd7889a002ed5ee382bc9190da6fc026e479558e4475677e9aa9e3050e2765694dfc81f56e880b96e7160c980dd98edd3dfffffffffffffffff"}}')},8597:t=>{"use strict";t.exports={i8:"6.5.4"}},2562:t=>{"use strict";t.exports=JSON.parse('{"2.16.840.1.101.3.4.1.1":"aes-128-ecb","2.16.840.1.101.3.4.1.2":"aes-128-cbc","2.16.840.1.101.3.4.1.3":"aes-128-ofb","2.16.840.1.101.3.4.1.4":"aes-128-cfb","2.16.840.1.101.3.4.1.21":"aes-192-ecb","2.16.840.1.101.3.4.1.22":"aes-192-cbc","2.16.840.1.101.3.4.1.23":"aes-192-ofb","2.16.840.1.101.3.4.1.24":"aes-192-cfb","2.16.840.1.101.3.4.1.41":"aes-256-ecb","2.16.840.1.101.3.4.1.42":"aes-256-cbc","2.16.840.1.101.3.4.1.43":"aes-256-ofb","2.16.840.1.101.3.4.1.44":"aes-256-cfb"}')}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var o=e[n]={id:n,loaded:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.loaded=!0,o.exports}return r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.nmd=t=>(t.paths=[],t.children||(t.children=[]),t),r(5507)})())); \ No newline at end of file diff --git a/node_modules/mongoose/index.js b/node_modules/mongoose/index.js new file mode 100644 index 000000000..1abb17725 --- /dev/null +++ b/node_modules/mongoose/index.js @@ -0,0 +1,13 @@ + +/** + * Export lib/mongoose + * + */ + +'use strict'; + +const mongoose = require('./lib/'); + +module.exports = mongoose; +module.exports.default = mongoose; +module.exports.mongoose = mongoose; diff --git a/node_modules/mongoose/lgtm.yml b/node_modules/mongoose/lgtm.yml new file mode 100644 index 000000000..d486db70b --- /dev/null +++ b/node_modules/mongoose/lgtm.yml @@ -0,0 +1,12 @@ +path_classifiers: + src: + - lib + types: + - types + test: + - test + docs: + - docs +queries: + - exclude: "*" + - include: lib \ No newline at end of file diff --git a/node_modules/mongoose/lib/aggregate.js b/node_modules/mongoose/lib/aggregate.js new file mode 100644 index 000000000..9add2c7f3 --- /dev/null +++ b/node_modules/mongoose/lib/aggregate.js @@ -0,0 +1,1118 @@ +'use strict'; + +/*! + * Module dependencies + */ + +const AggregationCursor = require('./cursor/AggregationCursor'); +const Query = require('./query'); +const { applyGlobalMaxTimeMS, applyGlobalDiskUse } = require('./helpers/query/applyGlobalOption'); +const getConstructorName = require('./helpers/getConstructorName'); +const prepareDiscriminatorPipeline = require('./helpers/aggregate/prepareDiscriminatorPipeline'); +const promiseOrCallback = require('./helpers/promiseOrCallback'); +const stringifyFunctionOperators = require('./helpers/aggregate/stringifyFunctionOperators'); +const utils = require('./utils'); +const read = Query.prototype.read; +const readConcern = Query.prototype.readConcern; + +const validRedactStringValues = new Set(['$$DESCEND', '$$PRUNE', '$$KEEP']); + +/** + * Aggregate constructor used for building aggregation pipelines. Do not + * instantiate this class directly, use [Model.aggregate()](/docs/api.html#model_Model.aggregate) instead. + * + * #### Example: + * + * const aggregate = Model.aggregate([ + * { $project: { a: 1, b: 1 } }, + * { $skip: 5 } + * ]); + * + * Model. + * aggregate([{ $match: { age: { $gte: 21 }}}]). + * unwind('tags'). + * exec(callback); + * + * #### Note: + * + * - The documents returned are plain javascript objects, not mongoose documents (since any shape of document can be returned). + * - Mongoose does **not** cast pipeline stages. The below will **not** work unless `_id` is a string in the database + * + * ```javascript + * new Aggregate([{ $match: { _id: '00000000000000000000000a' } }]); + * // Do this instead to cast to an ObjectId + * new Aggregate([{ $match: { _id: new mongoose.Types.ObjectId('00000000000000000000000a') } }]); + * ``` + * + * @see MongoDB https://docs.mongodb.org/manual/applications/aggregation/ + * @see driver https://mongodb.github.com/node-mongodb-native/api-generated/collection.html#aggregate + * @param {Array} [pipeline] aggregation pipeline as an array of objects + * @param {Model} [model] the model to use with this aggregate. + * @api public + */ + +function Aggregate(pipeline, model) { + this._pipeline = []; + this._model = model; + this.options = {}; + + if (arguments.length === 1 && Array.isArray(pipeline)) { + this.append.apply(this, pipeline); + } +} + +/** + * Contains options passed down to the [aggregate command](https://docs.mongodb.com/manual/reference/command/aggregate/). + * Supported options are: + * + * - [`allowDiskUse`](./api.html#aggregate_Aggregate-allowDiskUse) + * - `bypassDocumentValidation` + * - [`collation`](./api.html#aggregate_Aggregate-collation) + * - `comment` + * - [`cursor`](./api.html#aggregate_Aggregate-cursor) + * - [`explain`](./api.html#aggregate_Aggregate-explain) + * - `fieldsAsRaw` + * - hint + * - let + * - `maxTimeMS` + * - `raw` + * - `readConcern` + * - `readPreference` + * - [`session`](./api.html#aggregate_Aggregate-session) + * - `writeConcern` + * + * @property options + * @memberOf Aggregate + * @api public + */ + +Aggregate.prototype.options; + +/** + * Get/set the model that this aggregation will execute on. + * + * #### Example: + * const aggregate = MyModel.aggregate([{ $match: { answer: 42 } }]); + * aggregate.model() === MyModel; // true + * + * // Change the model. There's rarely any reason to do this. + * aggregate.model(SomeOtherModel); + * aggregate.model() === SomeOtherModel; // true + * + * @param {Model} [model] set the model associated with this aggregate. + * @return {Model} + * @api public + */ + +Aggregate.prototype.model = function(model) { + if (arguments.length === 0) { + return this._model; + } + + this._model = model; + if (model.schema != null) { + if (this.options.readPreference == null && + model.schema.options.read != null) { + this.options.readPreference = model.schema.options.read; + } + if (this.options.collation == null && + model.schema.options.collation != null) { + this.options.collation = model.schema.options.collation; + } + } + + return model; +}; + +/** + * Appends new operators to this aggregate pipeline + * + * #### Examples: + * + * aggregate.append({ $project: { field: 1 }}, { $limit: 2 }); + * + * // or pass an array + * const pipeline = [{ $match: { daw: 'Logic Audio X' }} ]; + * aggregate.append(pipeline); + * + * @param {Object} ops operator(s) to append + * @return {Aggregate} + * @api public + */ + +Aggregate.prototype.append = function() { + const args = (arguments.length === 1 && Array.isArray(arguments[0])) + ? arguments[0] + : [...arguments]; + + if (!args.every(isOperator)) { + throw new Error('Arguments must be aggregate pipeline operators'); + } + + this._pipeline = this._pipeline.concat(args); + + return this; +}; + +/** + * Appends a new $addFields operator to this aggregate pipeline. + * Requires MongoDB v3.4+ to work + * + * #### Examples: + * + * // adding new fields based on existing fields + * aggregate.addFields({ + * newField: '$b.nested' + * , plusTen: { $add: ['$val', 10]} + * , sub: { + * name: '$a' + * } + * }) + * + * // etc + * aggregate.addFields({ salary_k: { $divide: [ "$salary", 1000 ] } }); + * + * @param {Object} arg field specification + * @see $addFields https://docs.mongodb.com/manual/reference/operator/aggregation/addFields/ + * @return {Aggregate} + * @api public + */ +Aggregate.prototype.addFields = function(arg) { + if (typeof arg !== 'object' || arg === null || Array.isArray(arg)) { + throw new Error('Invalid addFields() argument. Must be an object'); + } + return this.append({ $addFields: Object.assign({}, arg) }); +}; + +/** + * Appends a new $project operator to this aggregate pipeline. + * + * Mongoose query [selection syntax](#query_Query-select) is also supported. + * + * #### Examples: + * + * // include a, include b, exclude _id + * aggregate.project("a b -_id"); + * + * // or you may use object notation, useful when + * // you have keys already prefixed with a "-" + * aggregate.project({a: 1, b: 1, _id: 0}); + * + * // reshaping documents + * aggregate.project({ + * newField: '$b.nested' + * , plusTen: { $add: ['$val', 10]} + * , sub: { + * name: '$a' + * } + * }) + * + * // etc + * aggregate.project({ salary_k: { $divide: [ "$salary", 1000 ] } }); + * + * @param {Object|String} arg field specification + * @see projection https://docs.mongodb.org/manual/reference/aggregation/project/ + * @return {Aggregate} + * @api public + */ + +Aggregate.prototype.project = function(arg) { + const fields = {}; + + if (typeof arg === 'object' && !Array.isArray(arg)) { + Object.keys(arg).forEach(function(field) { + fields[field] = arg[field]; + }); + } else if (arguments.length === 1 && typeof arg === 'string') { + arg.split(/\s+/).forEach(function(field) { + if (!field) { + return; + } + const include = field[0] === '-' ? 0 : 1; + if (include === 0) { + field = field.substring(1); + } + fields[field] = include; + }); + } else { + throw new Error('Invalid project() argument. Must be string or object'); + } + + return this.append({ $project: fields }); +}; + +/** + * Appends a new custom $group operator to this aggregate pipeline. + * + * #### Examples: + * + * aggregate.group({ _id: "$department" }); + * + * @see $group https://docs.mongodb.org/manual/reference/aggregation/group/ + * @method group + * @memberOf Aggregate + * @instance + * @param {Object} arg $group operator contents + * @return {Aggregate} + * @api public + */ + +/** + * Appends a new custom $match operator to this aggregate pipeline. + * + * #### Examples: + * + * aggregate.match({ department: { $in: [ "sales", "engineering" ] } }); + * + * @see $match https://docs.mongodb.org/manual/reference/aggregation/match/ + * @method match + * @memberOf Aggregate + * @instance + * @param {Object} arg $match operator contents + * @return {Aggregate} + * @api public + */ + +/** + * Appends a new $skip operator to this aggregate pipeline. + * + * #### Examples: + * + * aggregate.skip(10); + * + * @see $skip https://docs.mongodb.org/manual/reference/aggregation/skip/ + * @method skip + * @memberOf Aggregate + * @instance + * @param {Number} num number of records to skip before next stage + * @return {Aggregate} + * @api public + */ + +/** + * Appends a new $limit operator to this aggregate pipeline. + * + * #### Examples: + * + * aggregate.limit(10); + * + * @see $limit https://docs.mongodb.org/manual/reference/aggregation/limit/ + * @method limit + * @memberOf Aggregate + * @instance + * @param {Number} num maximum number of records to pass to the next stage + * @return {Aggregate} + * @api public + */ + +/** + * Appends a new $geoNear operator to this aggregate pipeline. + * + * #### Note: + * + * **MUST** be used as the first operator in the pipeline. + * + * #### Examples: + * + * aggregate.near({ + * near: [40.724, -73.997], + * distanceField: "dist.calculated", // required + * maxDistance: 0.008, + * query: { type: "public" }, + * includeLocs: "dist.location", + * uniqueDocs: true, + * num: 5 + * }); + * + * @see $geoNear https://docs.mongodb.org/manual/reference/aggregation/geoNear/ + * @method near + * @memberOf Aggregate + * @instance + * @param {Object} arg + * @return {Aggregate} + * @api public + */ + +Aggregate.prototype.near = function(arg) { + const op = {}; + op.$geoNear = arg; + return this.append(op); +}; + +/*! + * define methods + */ + +'group match skip limit out'.split(' ').forEach(function($operator) { + Aggregate.prototype[$operator] = function(arg) { + const op = {}; + op['$' + $operator] = arg; + return this.append(op); + }; +}); + +/** + * Appends new custom $unwind operator(s) to this aggregate pipeline. + * + * Note that the `$unwind` operator requires the path name to start with '$'. + * Mongoose will prepend '$' if the specified field doesn't start '$'. + * + * #### Examples: + * + * aggregate.unwind("tags"); + * aggregate.unwind("a", "b", "c"); + * aggregate.unwind({ path: '$tags', preserveNullAndEmptyArrays: true }); + * + * @see $unwind https://docs.mongodb.org/manual/reference/aggregation/unwind/ + * @param {String|Object} fields the field(s) to unwind, either as field names or as [objects with options](https://docs.mongodb.com/manual/reference/operator/aggregation/unwind/#document-operand-with-options). If passing a string, prefixing the field name with '$' is optional. If passing an object, `path` must start with '$'. + * @return {Aggregate} + * @api public + */ + +Aggregate.prototype.unwind = function() { + const args = [...arguments]; + + const res = []; + for (const arg of args) { + if (arg && typeof arg === 'object') { + res.push({ $unwind: arg }); + } else if (typeof arg === 'string') { + res.push({ + $unwind: (arg[0] === '$') ? arg : '$' + arg + }); + } else { + throw new Error('Invalid arg "' + arg + '" to unwind(), ' + + 'must be string or object'); + } + } + + return this.append.apply(this, res); +}; + +/** + * Appends a new $replaceRoot operator to this aggregate pipeline. + * + * Note that the `$replaceRoot` operator requires field strings to start with '$'. + * If you are passing in a string Mongoose will prepend '$' if the specified field doesn't start '$'. + * If you are passing in an object the strings in your expression will not be altered. + * + * #### Examples: + * + * aggregate.replaceRoot("user"); + * + * aggregate.replaceRoot({ x: { $concat: ['$this', '$that'] } }); + * + * @see $replaceRoot https://docs.mongodb.org/manual/reference/operator/aggregation/replaceRoot + * @param {String|Object} newRoot the field or document which will become the new root document + * @return {Aggregate} + * @api public + */ + +Aggregate.prototype.replaceRoot = function(newRoot) { + let ret; + + if (typeof newRoot === 'string') { + ret = newRoot.startsWith('$') ? newRoot : '$' + newRoot; + } else { + ret = newRoot; + } + + return this.append({ + $replaceRoot: { + newRoot: ret + } + }); +}; + +/** + * Appends a new $count operator to this aggregate pipeline. + * + * #### Examples: + * + * aggregate.count("userCount"); + * + * @see $count https://docs.mongodb.org/manual/reference/operator/aggregation/count + * @param {String} fieldName The name of the output field which has the count as its value. It must be a non-empty string, must not start with $ and must not contain the . character. + * @return {Aggregate} + * @api public + */ + +Aggregate.prototype.count = function(fieldName) { + return this.append({ $count: fieldName }); +}; + +/** + * Appends a new $sortByCount operator to this aggregate pipeline. Accepts either a string field name + * or a pipeline object. + * + * Note that the `$sortByCount` operator requires the new root to start with '$'. + * Mongoose will prepend '$' if the specified field name doesn't start with '$'. + * + * #### Examples: + * + * aggregate.sortByCount('users'); + * aggregate.sortByCount({ $mergeObjects: [ "$employee", "$business" ] }) + * + * @see $sortByCount https://docs.mongodb.com/manual/reference/operator/aggregation/sortByCount/ + * @param {Object|String} arg + * @return {Aggregate} this + * @api public + */ + +Aggregate.prototype.sortByCount = function(arg) { + if (arg && typeof arg === 'object') { + return this.append({ $sortByCount: arg }); + } else if (typeof arg === 'string') { + return this.append({ + $sortByCount: (arg[0] === '$') ? arg : '$' + arg + }); + } else { + throw new TypeError('Invalid arg "' + arg + '" to sortByCount(), ' + + 'must be string or object'); + } +}; + +/** + * Appends new custom $lookup operator to this aggregate pipeline. + * + * #### Examples: + * + * aggregate.lookup({ from: 'users', localField: 'userId', foreignField: '_id', as: 'users' }); + * + * @see $lookup https://docs.mongodb.org/manual/reference/operator/aggregation/lookup/#pipe._S_lookup + * @param {Object} options to $lookup as described in the above link + * @return {Aggregate}* @api public + */ + +Aggregate.prototype.lookup = function(options) { + return this.append({ $lookup: options }); +}; + +/** + * Appends new custom $graphLookup operator(s) to this aggregate pipeline, performing a recursive search on a collection. + * + * Note that graphLookup can only consume at most 100MB of memory, and does not allow disk use even if `{ allowDiskUse: true }` is specified. + * + * #### Examples: + * // Suppose we have a collection of courses, where a document might look like `{ _id: 0, name: 'Calculus', prerequisite: 'Trigonometry'}` and `{ _id: 0, name: 'Trigonometry', prerequisite: 'Algebra' }` + * aggregate.graphLookup({ from: 'courses', startWith: '$prerequisite', connectFromField: 'prerequisite', connectToField: 'name', as: 'prerequisites', maxDepth: 3 }) // this will recursively search the 'courses' collection up to 3 prerequisites + * + * @see $graphLookup https://docs.mongodb.com/manual/reference/operator/aggregation/graphLookup/#pipe._S_graphLookup + * @param {Object} options to $graphLookup as described in the above link + * @return {Aggregate} + * @api public + */ + +Aggregate.prototype.graphLookup = function(options) { + const cloneOptions = {}; + if (options) { + if (!utils.isObject(options)) { + throw new TypeError('Invalid graphLookup() argument. Must be an object.'); + } + + utils.mergeClone(cloneOptions, options); + const startWith = cloneOptions.startWith; + + if (startWith && typeof startWith === 'string') { + cloneOptions.startWith = cloneOptions.startWith.startsWith('$') ? + cloneOptions.startWith : + '$' + cloneOptions.startWith; + } + + } + return this.append({ $graphLookup: cloneOptions }); +}; + +/** + * Appends new custom $sample operator to this aggregate pipeline. + * + * #### Examples: + * + * aggregate.sample(3); // Add a pipeline that picks 3 random documents + * + * @see $sample https://docs.mongodb.org/manual/reference/operator/aggregation/sample/#pipe._S_sample + * @param {Number} size number of random documents to pick + * @return {Aggregate} + * @api public + */ + +Aggregate.prototype.sample = function(size) { + return this.append({ $sample: { size: size } }); +}; + +/** + * Appends a new $sort operator to this aggregate pipeline. + * + * If an object is passed, values allowed are `asc`, `desc`, `ascending`, `descending`, `1`, and `-1`. + * + * If a string is passed, it must be a space delimited list of path names. The sort order of each path is ascending unless the path name is prefixed with `-` which will be treated as descending. + * + * #### Examples: + * + * // these are equivalent + * aggregate.sort({ field: 'asc', test: -1 }); + * aggregate.sort('field -test'); + * + * @see $sort https://docs.mongodb.org/manual/reference/aggregation/sort/ + * @param {Object|String} arg + * @return {Aggregate} this + * @api public + */ + +Aggregate.prototype.sort = function(arg) { + // TODO refactor to reuse the query builder logic + + const sort = {}; + + if (getConstructorName(arg) === 'Object') { + const desc = ['desc', 'descending', -1]; + Object.keys(arg).forEach(function(field) { + // If sorting by text score, skip coercing into 1/-1 + if (arg[field] instanceof Object && arg[field].$meta) { + sort[field] = arg[field]; + return; + } + sort[field] = desc.indexOf(arg[field]) === -1 ? 1 : -1; + }); + } else if (arguments.length === 1 && typeof arg === 'string') { + arg.split(/\s+/).forEach(function(field) { + if (!field) { + return; + } + const ascend = field[0] === '-' ? -1 : 1; + if (ascend === -1) { + field = field.substring(1); + } + sort[field] = ascend; + }); + } else { + throw new TypeError('Invalid sort() argument. Must be a string or object.'); + } + + return this.append({ $sort: sort }); +}; + +/** + * Appends new $unionWith operator to this aggregate pipeline. + * + * #### Examples: + * + * aggregate.unionWith({ coll: 'users', pipeline: [ { $match: { _id: 1 } } ] }); + * + * @see $unionWith https://docs.mongodb.com/manual/reference/operator/aggregation/unionWith + * @param {Object} options to $unionWith query as described in the above link + * @return {Aggregate}* @api public + */ + +Aggregate.prototype.unionWith = function(options) { + return this.append({ $unionWith: options }); +}; + + +/** + * Sets the readPreference option for the aggregation query. + * + * #### Example: + * + * await Model.aggregate(pipeline).read('primaryPreferred'); + * + * @param {String} pref one of the listed preference options or their aliases + * @param {Array} [tags] optional tags for this query + * @return {Aggregate} this + * @api public + * @see mongodb https://docs.mongodb.org/manual/applications/replication/#read-preference + * @see driver https://mongodb.github.com/node-mongodb-native/driver-articles/anintroductionto1_1and2_2.html#read-preferences + */ + +Aggregate.prototype.read = function(pref, tags) { + read.call(this, pref, tags); + return this; +}; + +/** + * Sets the readConcern level for the aggregation query. + * + * #### Example: + * + * await Model.aggregate(pipeline).readConcern('majority'); + * + * @param {String} level one of the listed read concern level or their aliases + * @see mongodb https://docs.mongodb.com/manual/reference/read-concern/ + * @return {Aggregate} this + * @api public + */ + +Aggregate.prototype.readConcern = function(level) { + readConcern.call(this, level); + return this; +}; + +/** + * Appends a new $redact operator to this aggregate pipeline. + * + * If 3 arguments are supplied, Mongoose will wrap them with if-then-else of $cond operator respectively + * If `thenExpr` or `elseExpr` is string, make sure it starts with $$, like `$$DESCEND`, `$$PRUNE` or `$$KEEP`. + * + * #### Example: + * + * await Model.aggregate(pipeline).redact({ + * $cond: { + * if: { $eq: [ '$level', 5 ] }, + * then: '$$PRUNE', + * else: '$$DESCEND' + * } + * }); + * + * // $redact often comes with $cond operator, you can also use the following syntax provided by mongoose + * await Model.aggregate(pipeline).redact({ $eq: [ '$level', 5 ] }, '$$PRUNE', '$$DESCEND'); + * + * @param {Object} expression redact options or conditional expression + * @param {String|Object} [thenExpr] true case for the condition + * @param {String|Object} [elseExpr] false case for the condition + * @return {Aggregate} this + * @see $redact https://docs.mongodb.com/manual/reference/operator/aggregation/redact/ + * @api public + */ + +Aggregate.prototype.redact = function(expression, thenExpr, elseExpr) { + if (arguments.length === 3) { + if ((typeof thenExpr === 'string' && !validRedactStringValues.has(thenExpr)) || + (typeof elseExpr === 'string' && !validRedactStringValues.has(elseExpr))) { + throw new Error('If thenExpr or elseExpr is string, it must be either $$DESCEND, $$PRUNE or $$KEEP'); + } + + expression = { + $cond: { + if: expression, + then: thenExpr, + else: elseExpr + } + }; + } else if (arguments.length !== 1) { + throw new TypeError('Invalid arguments'); + } + + return this.append({ $redact: expression }); +}; + +/** + * Execute the aggregation with explain + * + * #### Example: + * + * Model.aggregate(..).explain(callback) + * + * @param {String} verbosity + * @param {Function} callback + * @return {Promise} + */ + +Aggregate.prototype.explain = function(verbosity, callback) { + const model = this._model; + if (typeof verbosity === 'function') { + callback = verbosity; + verbosity = null; + } + + return promiseOrCallback(callback, cb => { + if (!this._pipeline.length) { + const err = new Error('Aggregate has empty pipeline'); + return cb(err); + } + + prepareDiscriminatorPipeline(this._pipeline, this._model.schema); + + model.hooks.execPre('aggregate', this, error => { + if (error) { + const _opts = { error: error }; + return model.hooks.execPost('aggregate', this, [null], _opts, error => { + cb(error); + }); + } + + model.collection.aggregate(this._pipeline, this.options, (error, cursor) => { + if (error != null) { + const _opts = { error: error }; + return model.hooks.execPost('aggregate', this, [null], _opts, error => { + cb(error); + }); + } + if (verbosity != null) { + cursor.explain(verbosity, (error, result) => { + const _opts = { error: error }; + return model.hooks.execPost('aggregate', this, [result], _opts, error => { + if (error) { + return cb(error); + } + return cb(null, result); + }); + }); + } else { + cursor.explain((error, result) => { + const _opts = { error: error }; + return model.hooks.execPost('aggregate', this, [result], _opts, error => { + if (error) { + return cb(error); + } + return cb(null, result); + }); + }); + } + }); + }); + }, model.events); +}; + +/** + * Sets the allowDiskUse option for the aggregation query (ignored for < 2.6.0) + * + * #### Example: + * + * await Model.aggregate([{ $match: { foo: 'bar' } }]).allowDiskUse(true); + * + * @param {Boolean} value Should tell server it can use hard drive to store data during aggregation. + * @see mongodb https://docs.mongodb.org/manual/reference/command/aggregate/ + */ + +Aggregate.prototype.allowDiskUse = function(value) { + this.options.allowDiskUse = value; + return this; +}; + +/** + * Sets the hint option for the aggregation query (ignored for < 3.6.0) + * + * #### Example: + * + * Model.aggregate(..).hint({ qty: 1, category: 1 }).exec(callback) + * + * @param {Object|String} value a hint object or the index name + * @see mongodb https://docs.mongodb.org/manual/reference/command/aggregate/ + */ + +Aggregate.prototype.hint = function(value) { + this.options.hint = value; + return this; +}; + +/** + * Sets the session for this aggregation. Useful for [transactions](/docs/transactions.html). + * + * #### Example: + * + * const session = await Model.startSession(); + * await Model.aggregate(..).session(session); + * + * @param {ClientSession} session + * @see mongodb https://docs.mongodb.org/manual/reference/command/aggregate/ + */ + +Aggregate.prototype.session = function(session) { + if (session == null) { + delete this.options.session; + } else { + this.options.session = session; + } + return this; +}; + +/** + * Lets you set arbitrary options, for middleware or plugins. + * + * #### Example: + * + * const agg = Model.aggregate(..).option({ allowDiskUse: true }); // Set the `allowDiskUse` option + * agg.options; // `{ allowDiskUse: true }` + * + * @param {Object} options keys to merge into current options + * @param [options.maxTimeMS] number limits the time this aggregation will run, see [MongoDB docs on `maxTimeMS`](https://docs.mongodb.com/manual/reference/operator/meta/maxTimeMS/) + * @param [options.allowDiskUse] boolean if true, the MongoDB server will use the hard drive to store data during this aggregation + * @param [options.collation] object see [`Aggregate.prototype.collation()`](./docs/api.html#aggregate_Aggregate-collation) + * @param [options.session] ClientSession see [`Aggregate.prototype.session()`](./docs/api.html#aggregate_Aggregate-session) + * @see mongodb https://docs.mongodb.org/manual/reference/command/aggregate/ + * @return {Aggregate} this + * @api public + */ + +Aggregate.prototype.option = function(value) { + for (const key in value) { + this.options[key] = value[key]; + } + return this; +}; + +/** + * Sets the `cursor` option and executes this aggregation, returning an aggregation cursor. + * Cursors are useful if you want to process the results of the aggregation one-at-a-time + * because the aggregation result is too big to fit into memory. + * + * #### Example: + * + * const cursor = Model.aggregate(..).cursor({ batchSize: 1000 }); + * cursor.eachAsync(function(doc, i) { + * // use doc + * }); + * + * @param {Object} options + * @param {Number} options.batchSize set the cursor batch size + * @param {Boolean} [options.useMongooseAggCursor] use experimental mongoose-specific aggregation cursor (for `eachAsync()` and other query cursor semantics) + * @return {AggregationCursor} cursor representing this aggregation + * @api public + * @see mongodb https://mongodb.github.io/node-mongodb-native/2.0/api/AggregationCursor.html + */ + +Aggregate.prototype.cursor = function(options) { + this.options.cursor = options || {}; + return new AggregationCursor(this); // return this; +}; + +/** + * Adds a collation + * + * #### Example: + * + * const res = await Model.aggregate(pipeline).collation({ locale: 'en_US', strength: 1 }); + * + * @param {Object} collation options + * @return {Aggregate} this + * @api public + * @see mongodb https://mongodb.github.io/node-mongodb-native/2.2/api/Collection.html#aggregate + */ + +Aggregate.prototype.collation = function(collation) { + this.options.collation = collation; + return this; +}; + +/** + * Combines multiple aggregation pipelines. + * + * #### Example: + * + * const res = await Model.aggregate().facet({ + * books: [{ groupBy: '$author' }], + * price: [{ $bucketAuto: { groupBy: '$price', buckets: 2 } }] + * }); + * + * // Output: { books: [...], price: [{...}, {...}] } + * + * @param {Object} facet options + * @return {Aggregate} this + * @see $facet https://docs.mongodb.com/v3.4/reference/operator/aggregation/facet/ + * @api public + */ + +Aggregate.prototype.facet = function(options) { + return this.append({ $facet: options }); +}; + +/** + * Helper for [Atlas Text Search](https://docs.atlas.mongodb.com/reference/atlas-search/tutorial/)'s + * `$search` stage. + * + * #### Example: + * + * const res = await Model.aggregate(). + * search({ + * text: { + * query: 'baseball', + * path: 'plot' + * } + * }); + * + * // Output: [{ plot: '...', title: '...' }] + * + * @param {Object} $search options + * @return {Aggregate} this + * @see $search https://docs.atlas.mongodb.com/reference/atlas-search/tutorial/ + * @api public + */ + +Aggregate.prototype.search = function(options) { + return this.append({ $search: options }); +}; + +/** + * Returns the current pipeline + * + * #### Example: + * + * MyModel.aggregate().match({ test: 1 }).pipeline(); // [{ $match: { test: 1 } }] + * + * @return {Array} + * @api public + */ + + +Aggregate.prototype.pipeline = function() { + return this._pipeline; +}; + +/** + * Executes the aggregate pipeline on the currently bound Model. + * + * #### Example: + * + * aggregate.exec(callback); + * + * // Because a promise is returned, the `callback` is optional. + * const promise = aggregate.exec(); + * promise.then(..); + * + * @see Promise #promise_Promise + * @param {Function} [callback] + * @return {Promise} + * @api public + */ + +Aggregate.prototype.exec = function(callback) { + if (!this._model) { + throw new Error('Aggregate not bound to any Model'); + } + const model = this._model; + const collection = this._model.collection; + + applyGlobalMaxTimeMS(this.options, model); + applyGlobalDiskUse(this.options, model); + + if (this.options && this.options.cursor) { + return new AggregationCursor(this); + } + + return promiseOrCallback(callback, cb => { + prepareDiscriminatorPipeline(this._pipeline, this._model.schema); + stringifyFunctionOperators(this._pipeline); + + model.hooks.execPre('aggregate', this, error => { + if (error) { + const _opts = { error: error }; + return model.hooks.execPost('aggregate', this, [null], _opts, error => { + cb(error); + }); + } + if (!this._pipeline.length) { + return cb(new Error('Aggregate has empty pipeline')); + } + + const options = utils.clone(this.options || {}); + + collection.aggregate(this._pipeline, options, (err, cursor) => { + if (err != null) { + return cb(err); + } + + cursor.toArray((error, result) => { + const _opts = { error: error }; + model.hooks.execPost('aggregate', this, [result], _opts, (error, result) => { + if (error) { + return cb(error); + } + + cb(null, result); + }); + }); + }); + }); + }, model.events); +}; + +/** + * Provides promise for aggregate. + * + * #### Example: + * + * Model.aggregate(..).then(successCallback, errorCallback); + * + * @see Promise #promise_Promise + * @param {Function} [resolve] successCallback + * @param {Function} [reject] errorCallback + * @return {Promise} + */ +Aggregate.prototype.then = function(resolve, reject) { + return this.exec().then(resolve, reject); +}; + +/** + * Executes the query returning a `Promise` which will be + * resolved with either the doc(s) or rejected with the error. + * Like [`.then()`](#query_Query-then), but only takes a rejection handler. + * + * @param {Function} [reject] + * @return {Promise} + * @api public + */ + +Aggregate.prototype.catch = function(reject) { + return this.exec().then(null, reject); +}; + +/** + * Returns an asyncIterator for use with [`for/await/of` loops](https://thecodebarbarian.com/getting-started-with-async-iterators-in-node-js + * You do not need to call this function explicitly, the JavaScript runtime + * will call it for you. + * + * #### Example + * + * const agg = Model.aggregate([{ $match: { age: { $gte: 25 } } }]); + * for await (const doc of agg) { + * console.log(doc.name); + * } + * + * Node.js 10.x supports async iterators natively without any flags. You can + * enable async iterators in Node.js 8.x using the [`--harmony_async_iteration` flag](https://github.com/tc39/proposal-async-iteration/issues/117#issuecomment-346695187). + * + * **Note:** This function is not set if `Symbol.asyncIterator` is undefined. If + * `Symbol.asyncIterator` is undefined, that means your Node.js version does not + * support async iterators. + * + * @method Symbol.asyncIterator + * @memberOf Aggregate + * @instance + * @api public + */ + +if (Symbol.asyncIterator != null) { + Aggregate.prototype[Symbol.asyncIterator] = function() { + return this.cursor({ useMongooseAggCursor: true }). + transformNull(). + _transformForAsyncIterator(); + }; +} + +/*! + * Helpers + */ + +/** + * Checks whether an object is likely a pipeline operator + * + * @param {Object} obj object to check + * @return {Boolean} + * @api private + */ + +function isOperator(obj) { + if (typeof obj !== 'object' || obj === null) { + return false; + } + + const k = Object.keys(obj); + + return k.length === 1 && k[0][0] === '$'; +} + +/*! + * Adds the appropriate `$match` pipeline step to the top of an aggregate's + * pipeline, should it's model is a non-root discriminator type. This is + * analogous to the `prepareDiscriminatorCriteria` function in `lib/query.js`. + * + * @param {Aggregate} aggregate Aggregate to prepare + */ + +Aggregate._prepareDiscriminatorPipeline = prepareDiscriminatorPipeline; + +/*! + * Exports + */ + +module.exports = Aggregate; diff --git a/node_modules/mongoose/lib/browser.js b/node_modules/mongoose/lib/browser.js new file mode 100644 index 000000000..7b4aa518f --- /dev/null +++ b/node_modules/mongoose/lib/browser.js @@ -0,0 +1,158 @@ +/* eslint-env browser */ + +'use strict'; + +require('./driver').set(require('./drivers/browser')); + +const DocumentProvider = require('./document_provider.js'); +const PromiseProvider = require('./promise_provider'); + +DocumentProvider.setBrowser(true); + +/** + * The Mongoose [Promise](#promise_Promise) constructor. + * + * @method Promise + * @api public + */ + +Object.defineProperty(exports, 'Promise', { + get: function() { + return PromiseProvider.get(); + }, + set: function(lib) { + PromiseProvider.set(lib); + } +}); + +/** + * Storage layer for mongoose promises + * + * @method PromiseProvider + * @api public + */ + +exports.PromiseProvider = PromiseProvider; + +/** + * The [MongooseError](#error_MongooseError) constructor. + * + * @method Error + * @api public + */ + +exports.Error = require('./error/index'); + +/** + * The Mongoose [Schema](#schema_Schema) constructor + * + * #### Example: + * + * const mongoose = require('mongoose'); + * const Schema = mongoose.Schema; + * const CatSchema = new Schema(..); + * + * @method Schema + * @api public + */ + +exports.Schema = require('./schema'); + +/** + * The various Mongoose Types. + * + * #### Example: + * + * const mongoose = require('mongoose'); + * const array = mongoose.Types.Array; + * + * #### Types: + * + * - [Array](/docs/schematypes.html#arrays) + * - [Buffer](/docs/schematypes.html#buffers) + * - [Embedded](/docs/schematypes.html#schemas) + * - [DocumentArray](/docs/api/documentarraypath.html) + * - [Decimal128](/docs/api.html#mongoose_Mongoose-Decimal128) + * - [ObjectId](/docs/schematypes.html#objectids) + * - [Map](/docs/schematypes.html#maps) + * - [Subdocument](/docs/schematypes.html#schemas) + * + * Using this exposed access to the `ObjectId` type, we can construct ids on demand. + * + * const ObjectId = mongoose.Types.ObjectId; + * const id1 = new ObjectId; + * + * @property Types + * @api public + */ +exports.Types = require('./types'); + +/** + * The Mongoose [VirtualType](#virtualtype_VirtualType) constructor + * + * @method VirtualType + * @api public + */ +exports.VirtualType = require('./virtualtype'); + +/** + * The various Mongoose SchemaTypes. + * + * #### Note: + * + * _Alias of mongoose.Schema.Types for backwards compatibility._ + * + * @property SchemaTypes + * @see Schema.SchemaTypes #schema_Schema.Types + * @api public + */ + +exports.SchemaType = require('./schematype.js'); + +/** + * Internal utils + * + * @property utils + * @api private + */ + +exports.utils = require('./utils.js'); + +/** + * The Mongoose browser [Document](/api/document.html) constructor. + * + * @method Document + * @api public + */ +exports.Document = DocumentProvider(); + +/** + * Return a new browser model. In the browser, a model is just + * a simplified document with a schema - it does **not** have + * functions like `findOne()`, etc. + * + * @method model + * @api public + * @param {String} name + * @param {Schema} schema + * @return Class + */ +exports.model = function(name, schema) { + class Model extends exports.Document { + constructor(obj, fields) { + super(obj, schema, fields); + } + } + Model.modelName = name; + + return Model; +}; + +/*! + * Module exports. + */ + +if (typeof window !== 'undefined') { + window.mongoose = module.exports; + window.Buffer = Buffer; +} diff --git a/node_modules/mongoose/lib/browserDocument.js b/node_modules/mongoose/lib/browserDocument.js new file mode 100644 index 000000000..eacc2e1e6 --- /dev/null +++ b/node_modules/mongoose/lib/browserDocument.js @@ -0,0 +1,101 @@ +/*! + * Module dependencies. + */ + +'use strict'; + +const NodeJSDocument = require('./document'); +const EventEmitter = require('events').EventEmitter; +const MongooseError = require('./error/index'); +const Schema = require('./schema'); +const ObjectId = require('./types/objectid'); +const ValidationError = MongooseError.ValidationError; +const applyHooks = require('./helpers/model/applyHooks'); +const isObject = require('./helpers/isObject'); + +/** + * Document constructor. + * + * @param {Object} obj the values to set + * @param {Object} schema + * @param {Object} [fields] optional object containing the fields which were selected in the query returning this document and any populated paths data + * @param {Boolean} [skipId] bool, should we auto create an ObjectId _id + * @inherits NodeJS EventEmitter https://nodejs.org/api/events.html#events_class_events_eventemitter + * @event `init`: Emitted on a document after it has was retrieved from the db and fully hydrated by Mongoose. + * @event `save`: Emitted when the document is successfully saved + * @api private + */ + +function Document(obj, schema, fields, skipId, skipInit) { + if (!(this instanceof Document)) { + return new Document(obj, schema, fields, skipId, skipInit); + } + + if (isObject(schema) && !schema.instanceOfSchema) { + schema = new Schema(schema); + } + + // When creating EmbeddedDocument, it already has the schema and he doesn't need the _id + schema = this.schema || schema; + + // Generate ObjectId if it is missing, but it requires a scheme + if (!this.schema && schema.options._id) { + obj = obj || {}; + + if (obj._id === undefined) { + obj._id = new ObjectId(); + } + } + + if (!schema) { + throw new MongooseError.MissingSchemaError(); + } + + this.$__setSchema(schema); + + NodeJSDocument.call(this, obj, fields, skipId, skipInit); + + applyHooks(this, schema, { decorateDoc: true }); + + // apply methods + for (const m in schema.methods) { + this[m] = schema.methods[m]; + } + // apply statics + for (const s in schema.statics) { + this[s] = schema.statics[s]; + } +} + +/*! + * Inherit from the NodeJS document + */ + +Document.prototype = Object.create(NodeJSDocument.prototype); +Document.prototype.constructor = Document; + +/*! + * ignore + */ + +Document.events = new EventEmitter(); + +/*! + * Browser doc exposes the event emitter API + */ + +Document.$emitter = new EventEmitter(); + +['on', 'once', 'emit', 'listeners', 'removeListener', 'setMaxListeners', + 'removeAllListeners', 'addListener'].forEach(function(emitterFn) { + Document[emitterFn] = function() { + return Document.$emitter[emitterFn].apply(Document.$emitter, arguments); + }; +}); + +/*! + * Module exports. + */ + +Document.ValidationError = ValidationError; +module.exports = exports = Document; diff --git a/node_modules/mongoose/lib/cast.js b/node_modules/mongoose/lib/cast.js new file mode 100644 index 000000000..2a20d8272 --- /dev/null +++ b/node_modules/mongoose/lib/cast.js @@ -0,0 +1,377 @@ +'use strict'; + +/*! + * Module dependencies. + */ + +const CastError = require('./error/cast'); +const StrictModeError = require('./error/strict'); +const Types = require('./schema/index'); +const cast$expr = require('./helpers/query/cast$expr'); +const castTextSearch = require('./schema/operators/text'); +const get = require('./helpers/get'); +const getConstructorName = require('./helpers/getConstructorName'); +const getSchemaDiscriminatorByValue = require('./helpers/discriminator/getSchemaDiscriminatorByValue'); +const isOperator = require('./helpers/query/isOperator'); +const util = require('util'); +const isObject = require('./helpers/isObject'); +const isMongooseObject = require('./helpers/isMongooseObject'); + +const ALLOWED_GEOWITHIN_GEOJSON_TYPES = ['Polygon', 'MultiPolygon']; + +/** + * Handles internal casting for query filters. + * + * @param {Schema} schema + * @param {Object} obj Object to cast + * @param {Object} options the query options + * @param {Query} context passed to setters + * @api private + */ +module.exports = function cast(schema, obj, options, context) { + if (Array.isArray(obj)) { + throw new Error('Query filter must be an object, got an array ', util.inspect(obj)); + } + + if (obj == null) { + return obj; + } + + if (schema != null && schema.discriminators != null && obj[schema.options.discriminatorKey] != null) { + schema = getSchemaDiscriminatorByValue(schema, obj[schema.options.discriminatorKey]) || schema; + } + + const paths = Object.keys(obj); + let i = paths.length; + let _keys; + let any$conditionals; + let schematype; + let nested; + let path; + let type; + let val; + + options = options || {}; + + while (i--) { + path = paths[i]; + val = obj[path]; + + if (path === '$or' || path === '$nor' || path === '$and') { + if (!Array.isArray(val)) { + throw new CastError('Array', val, path); + } + for (let k = 0; k < val.length; ++k) { + if (val[k] == null || typeof val[k] !== 'object') { + throw new CastError('Object', val[k], path + '.' + k); + } + val[k] = cast(schema, val[k], options, context); + } + } else if (path === '$where') { + type = typeof val; + + if (type !== 'string' && type !== 'function') { + throw new Error('Must have a string or function for $where'); + } + + if (type === 'function') { + obj[path] = val.toString(); + } + + continue; + } else if (path === '$expr') { + val = cast$expr(val, schema); + continue; + } else if (path === '$elemMatch') { + val = cast(schema, val, options, context); + } else if (path === '$text') { + val = castTextSearch(val, path); + } else { + if (!schema) { + // no casting for Mixed types + continue; + } + + schematype = schema.path(path); + + // Check for embedded discriminator paths + if (!schematype) { + const split = path.split('.'); + let j = split.length; + while (j--) { + const pathFirstHalf = split.slice(0, j).join('.'); + const pathLastHalf = split.slice(j).join('.'); + const _schematype = schema.path(pathFirstHalf); + const discriminatorKey = _schematype && + _schematype.schema && + _schematype.schema.options && + _schematype.schema.options.discriminatorKey; + + // gh-6027: if we haven't found the schematype but this path is + // underneath an embedded discriminator and the embedded discriminator + // key is in the query, use the embedded discriminator schema + if (_schematype != null && + (_schematype.schema && _schematype.schema.discriminators) != null && + discriminatorKey != null && + pathLastHalf !== discriminatorKey) { + const discriminatorVal = get(obj, pathFirstHalf + '.' + discriminatorKey); + if (discriminatorVal != null) { + schematype = _schematype.schema.discriminators[discriminatorVal]. + path(pathLastHalf); + } + } + } + } + + if (!schematype) { + // Handle potential embedded array queries + const split = path.split('.'); + let j = split.length; + let pathFirstHalf; + let pathLastHalf; + let remainingConds; + + // Find the part of the var path that is a path of the Schema + while (j--) { + pathFirstHalf = split.slice(0, j).join('.'); + schematype = schema.path(pathFirstHalf); + if (schematype) { + break; + } + } + + // If a substring of the input path resolves to an actual real path... + if (schematype) { + // Apply the casting; similar code for $elemMatch in schema/array.js + if (schematype.caster && schematype.caster.schema) { + remainingConds = {}; + pathLastHalf = split.slice(j).join('.'); + remainingConds[pathLastHalf] = val; + + const ret = cast(schematype.caster.schema, remainingConds, options, context)[pathLastHalf]; + if (ret === void 0) { + delete obj[path]; + } else { + obj[path] = ret; + } + } else { + obj[path] = val; + } + continue; + } + + if (isObject(val)) { + // handle geo schemas that use object notation + // { loc: { long: Number, lat: Number } + + let geo = ''; + if (val.$near) { + geo = '$near'; + } else if (val.$nearSphere) { + geo = '$nearSphere'; + } else if (val.$within) { + geo = '$within'; + } else if (val.$geoIntersects) { + geo = '$geoIntersects'; + } else if (val.$geoWithin) { + geo = '$geoWithin'; + } + + if (geo) { + const numbertype = new Types.Number('__QueryCasting__'); + let value = val[geo]; + + if (val.$maxDistance != null) { + val.$maxDistance = numbertype.castForQueryWrapper({ + val: val.$maxDistance, + context: context + }); + } + if (val.$minDistance != null) { + val.$minDistance = numbertype.castForQueryWrapper({ + val: val.$minDistance, + context: context + }); + } + + if (geo === '$within') { + const withinType = value.$center + || value.$centerSphere + || value.$box + || value.$polygon; + + if (!withinType) { + throw new Error('Bad $within parameter: ' + JSON.stringify(val)); + } + + value = withinType; + } else if (geo === '$near' && + typeof value.type === 'string' && Array.isArray(value.coordinates)) { + // geojson; cast the coordinates + value = value.coordinates; + } else if ((geo === '$near' || geo === '$nearSphere' || geo === '$geoIntersects') && + value.$geometry && typeof value.$geometry.type === 'string' && + Array.isArray(value.$geometry.coordinates)) { + if (value.$maxDistance != null) { + value.$maxDistance = numbertype.castForQueryWrapper({ + val: value.$maxDistance, + context: context + }); + } + if (value.$minDistance != null) { + value.$minDistance = numbertype.castForQueryWrapper({ + val: value.$minDistance, + context: context + }); + } + if (isMongooseObject(value.$geometry)) { + value.$geometry = value.$geometry.toObject({ + transform: false, + virtuals: false + }); + } + value = value.$geometry.coordinates; + } else if (geo === '$geoWithin') { + if (value.$geometry) { + if (isMongooseObject(value.$geometry)) { + value.$geometry = value.$geometry.toObject({ virtuals: false }); + } + const geoWithinType = value.$geometry.type; + if (ALLOWED_GEOWITHIN_GEOJSON_TYPES.indexOf(geoWithinType) === -1) { + throw new Error('Invalid geoJSON type for $geoWithin "' + + geoWithinType + '", must be "Polygon" or "MultiPolygon"'); + } + value = value.$geometry.coordinates; + } else { + value = value.$box || value.$polygon || value.$center || + value.$centerSphere; + if (isMongooseObject(value)) { + value = value.toObject({ virtuals: false }); + } + } + } + + _cast(value, numbertype, context); + continue; + } + } + + if (schema.nested[path]) { + continue; + } + + const strict = 'strict' in options ? options.strict : schema.options.strict; + const strictQuery = 'strictQuery' in options ? + options.strictQuery : + 'strict' in options ? + options.strict : + 'strict' in schema._userProvidedOptions ? schema._userProvidedOptions.strict : + schema.options.strictQuery; + if (options.upsert && strict) { + if (strict === 'throw') { + throw new StrictModeError(path); + } + throw new StrictModeError(path, 'Path "' + path + '" is not in ' + + 'schema, strict mode is `true`, and upsert is `true`.'); + } if (strictQuery === 'throw') { + throw new StrictModeError(path, 'Path "' + path + '" is not in ' + + 'schema and strictQuery is \'throw\'.'); + } else if (strictQuery) { + delete obj[path]; + } + } else if (val == null) { + continue; + } else if (getConstructorName(val) === 'Object') { + any$conditionals = Object.keys(val).some(isOperator); + + if (!any$conditionals) { + obj[path] = schematype.castForQueryWrapper({ + val: val, + context: context + }); + } else { + const ks = Object.keys(val); + let $cond; + + let k = ks.length; + + while (k--) { + $cond = ks[k]; + nested = val[$cond]; + + if ($cond === '$not') { + if (nested && schematype) { + _keys = Object.keys(nested); + if (_keys.length && isOperator(_keys[0])) { + for (const key in nested) { + nested[key] = schematype.castForQueryWrapper({ + $conditional: key, + val: nested[key], + context: context + }); + } + } else { + val[$cond] = schematype.castForQueryWrapper({ + $conditional: $cond, + val: nested, + context: context + }); + } + continue; + } + } else { + val[$cond] = schematype.castForQueryWrapper({ + $conditional: $cond, + val: nested, + context: context + }); + } + } + } + } else if (Array.isArray(val) && ['Buffer', 'Array'].indexOf(schematype.instance) === -1) { + const casted = []; + const valuesArray = val; + + for (const _val of valuesArray) { + casted.push(schematype.castForQueryWrapper({ + val: _val, + context: context + })); + } + + obj[path] = { $in: casted }; + } else { + obj[path] = schematype.castForQueryWrapper({ + val: val, + context: context + }); + } + } + } + + return obj; +}; + +function _cast(val, numbertype, context) { + if (Array.isArray(val)) { + val.forEach(function(item, i) { + if (Array.isArray(item) || isObject(item)) { + return _cast(item, numbertype, context); + } + val[i] = numbertype.castForQueryWrapper({ val: item, context: context }); + }); + } else { + const nearKeys = Object.keys(val); + let nearLen = nearKeys.length; + while (nearLen--) { + const nkey = nearKeys[nearLen]; + const item = val[nkey]; + if (Array.isArray(item) || isObject(item)) { + _cast(item, numbertype, context); + val[nkey] = item; + } else { + val[nkey] = numbertype.castForQuery({ val: item, context: context }); + } + } + } +} \ No newline at end of file diff --git a/node_modules/mongoose/lib/cast/boolean.js b/node_modules/mongoose/lib/cast/boolean.js new file mode 100644 index 000000000..92551d41e --- /dev/null +++ b/node_modules/mongoose/lib/cast/boolean.js @@ -0,0 +1,32 @@ +'use strict'; + +const CastError = require('../error/cast'); + +/*! + * Given a value, cast it to a boolean, or throw a `CastError` if the value + * cannot be casted. `null` and `undefined` are considered valid. + * + * @param {Any} value + * @param {String} [path] optional the path to set on the CastError + * @return {Boolean|null|undefined} + * @throws {CastError} if `value` is not one of the allowed values + * @api private + */ + +module.exports = function castBoolean(value, path) { + if (module.exports.convertToTrue.has(value)) { + return true; + } + if (module.exports.convertToFalse.has(value)) { + return false; + } + + if (value == null) { + return value; + } + + throw new CastError('boolean', value, path); +}; + +module.exports.convertToTrue = new Set([true, 'true', 1, '1', 'yes']); +module.exports.convertToFalse = new Set([false, 'false', 0, '0', 'no']); diff --git a/node_modules/mongoose/lib/cast/date.js b/node_modules/mongoose/lib/cast/date.js new file mode 100644 index 000000000..ac17006df --- /dev/null +++ b/node_modules/mongoose/lib/cast/date.js @@ -0,0 +1,41 @@ +'use strict'; + +const assert = require('assert'); + +module.exports = function castDate(value) { + // Support empty string because of empty form values. Originally introduced + // in https://github.com/Automattic/mongoose/commit/efc72a1898fc3c33a319d915b8c5463a22938dfe + if (value == null || value === '') { + return null; + } + + if (value instanceof Date) { + assert.ok(!isNaN(value.valueOf())); + + return value; + } + + let date; + + assert.ok(typeof value !== 'boolean'); + + if (value instanceof Number || typeof value === 'number') { + date = new Date(value); + } else if (typeof value === 'string' && !isNaN(Number(value)) && (Number(value) >= 275761 || Number(value) < -271820)) { + // string representation of milliseconds take this path + date = new Date(Number(value)); + } else if (typeof value.valueOf === 'function') { + // support for moment.js. This is also the path strings will take because + // strings have a `valueOf()` + date = new Date(value.valueOf()); + } else { + // fallback + date = new Date(value); + } + + if (!isNaN(date.valueOf())) { + return date; + } + + assert.ok(false); +}; \ No newline at end of file diff --git a/node_modules/mongoose/lib/cast/decimal128.js b/node_modules/mongoose/lib/cast/decimal128.js new file mode 100644 index 000000000..bfb1578c4 --- /dev/null +++ b/node_modules/mongoose/lib/cast/decimal128.js @@ -0,0 +1,36 @@ +'use strict'; + +const Decimal128Type = require('../types/decimal128'); +const assert = require('assert'); + +module.exports = function castDecimal128(value) { + if (value == null) { + return value; + } + + if (typeof value === 'object' && typeof value.$numberDecimal === 'string') { + return Decimal128Type.fromString(value.$numberDecimal); + } + + if (value instanceof Decimal128Type) { + return value; + } + + if (typeof value === 'string') { + return Decimal128Type.fromString(value); + } + + if (Buffer.isBuffer(value)) { + return new Decimal128Type(value); + } + + if (typeof value === 'number') { + return Decimal128Type.fromString(String(value)); + } + + if (typeof value.valueOf === 'function' && typeof value.valueOf() === 'string') { + return Decimal128Type.fromString(value.valueOf()); + } + + assert.ok(false); +}; \ No newline at end of file diff --git a/node_modules/mongoose/lib/cast/number.js b/node_modules/mongoose/lib/cast/number.js new file mode 100644 index 000000000..c96782a38 --- /dev/null +++ b/node_modules/mongoose/lib/cast/number.js @@ -0,0 +1,42 @@ +'use strict'; + +const assert = require('assert'); + +/*! + * Given a value, cast it to a number, or throw an `Error` if the value + * cannot be casted. `null` and `undefined` are considered valid. + * + * @param {Any} value + * @return {Number} + * @throws {Error} if `value` is not one of the allowed values + * @api private + */ + +module.exports = function castNumber(val) { + if (val == null) { + return val; + } + if (val === '') { + return null; + } + + if (typeof val === 'string' || typeof val === 'boolean') { + val = Number(val); + } + + assert.ok(!isNaN(val)); + if (val instanceof Number) { + return val.valueOf(); + } + if (typeof val === 'number') { + return val; + } + if (!Array.isArray(val) && typeof val.valueOf === 'function') { + return Number(val.valueOf()); + } + if (val.toString && !Array.isArray(val) && val.toString() == Number(val)) { + return Number(val); + } + + assert.ok(false); +}; diff --git a/node_modules/mongoose/lib/cast/objectid.js b/node_modules/mongoose/lib/cast/objectid.js new file mode 100644 index 000000000..67985c94e --- /dev/null +++ b/node_modules/mongoose/lib/cast/objectid.js @@ -0,0 +1,29 @@ +'use strict'; + +const isBsonType = require('../helpers/isBsonType'); +const ObjectId = require('../driver').get().ObjectId; + +module.exports = function castObjectId(value) { + if (value == null) { + return value; + } + + if (isBsonType(value, 'ObjectID')) { + return value; + } + + if (value._id) { + if (isBsonType(value._id, 'ObjectID')) { + return value._id; + } + if (value._id.toString instanceof Function) { + return new ObjectId(value._id.toString()); + } + } + + if (value.toString instanceof Function) { + return new ObjectId(value.toString()); + } + + return new ObjectId(value); +}; \ No newline at end of file diff --git a/node_modules/mongoose/lib/cast/string.js b/node_modules/mongoose/lib/cast/string.js new file mode 100644 index 000000000..4d89f8e2b --- /dev/null +++ b/node_modules/mongoose/lib/cast/string.js @@ -0,0 +1,37 @@ +'use strict'; + +const CastError = require('../error/cast'); + +/*! + * Given a value, cast it to a string, or throw a `CastError` if the value + * cannot be casted. `null` and `undefined` are considered valid. + * + * @param {Any} value + * @param {String} [path] optional the path to set on the CastError + * @return {string|null|undefined} + * @throws {CastError} + * @api private + */ + +module.exports = function castString(value, path) { + // If null or undefined + if (value == null) { + return value; + } + + // handle documents being passed + if (value._id && typeof value._id === 'string') { + return value._id; + } + + // Re: gh-647 and gh-3030, we're ok with casting using `toString()` + // **unless** its the default Object.toString, because "[object Object]" + // doesn't really qualify as useful data + if (value.toString && + value.toString !== Object.prototype.toString && + !Array.isArray(value)) { + return value.toString(); + } + + throw new CastError('string', value, path); +}; diff --git a/node_modules/mongoose/lib/collection.js b/node_modules/mongoose/lib/collection.js new file mode 100644 index 000000000..9a78615bd --- /dev/null +++ b/node_modules/mongoose/lib/collection.js @@ -0,0 +1,311 @@ +'use strict'; + +/*! + * Module dependencies. + */ + +const EventEmitter = require('events').EventEmitter; +const STATES = require('./connectionstate'); +const immediate = require('./helpers/immediate'); + +/** + * Abstract Collection constructor + * + * This is the base class that drivers inherit from and implement. + * + * @param {String} name name of the collection + * @param {Connection} conn A MongooseConnection instance + * @param {Object} opts optional collection options + * @api public + */ + +function Collection(name, conn, opts) { + if (opts === void 0) { + opts = {}; + } + + this.opts = opts; + this.name = name; + this.collectionName = name; + this.conn = conn; + this.queue = []; + this.buffer = true; + this.emitter = new EventEmitter(); + + if (STATES.connected === this.conn.readyState) { + this.onOpen(); + } +} + +/** + * The collection name + * + * @api public + * @property name + */ + +Collection.prototype.name; + +/** + * The collection name + * + * @api public + * @property collectionName + */ + +Collection.prototype.collectionName; + +/** + * The Connection instance + * + * @api public + * @property conn + */ + +Collection.prototype.conn; + +/** + * Called when the database connects + * + * @api private + */ + +Collection.prototype.onOpen = function() { + this.buffer = false; + immediate(() => this.doQueue()); +}; + +/** + * Called when the database disconnects + * + * @api private + */ + +Collection.prototype.onClose = function() {}; + +/** + * Queues a method for later execution when its + * database connection opens. + * + * @param {String} name name of the method to queue + * @param {Array} args arguments to pass to the method when executed + * @api private + */ + +Collection.prototype.addQueue = function(name, args) { + this.queue.push([name, args]); + return this; +}; + +/** + * Removes a queued method + * + * @param {String} name name of the method to queue + * @param {Array} args arguments to pass to the method when executed + * @api private + */ + +Collection.prototype.removeQueue = function(name, args) { + const index = this.queue.findIndex(v => v[0] === name && v[1] === args); + if (index === -1) { + return false; + } + this.queue.splice(index, 1); + return true; +}; + +/** + * Executes all queued methods and clears the queue. + * + * @api private + */ + +Collection.prototype.doQueue = function() { + for (const method of this.queue) { + if (typeof method[0] === 'function') { + method[0].apply(this, method[1]); + } else { + this[method[0]].apply(this, method[1]); + } + } + this.queue = []; + const _this = this; + immediate(function() { + _this.emitter.emit('queue'); + }); + return this; +}; + +/** + * Abstract method that drivers must implement. + */ + +Collection.prototype.ensureIndex = function() { + throw new Error('Collection#ensureIndex unimplemented by driver'); +}; + +/** + * Abstract method that drivers must implement. + */ + +Collection.prototype.createIndex = function() { + throw new Error('Collection#createIndex unimplemented by driver'); +}; + +/** + * Abstract method that drivers must implement. + */ + +Collection.prototype.findAndModify = function() { + throw new Error('Collection#findAndModify unimplemented by driver'); +}; + +/** + * Abstract method that drivers must implement. + */ + +Collection.prototype.findOneAndUpdate = function() { + throw new Error('Collection#findOneAndUpdate unimplemented by driver'); +}; + +/** + * Abstract method that drivers must implement. + */ + +Collection.prototype.findOneAndDelete = function() { + throw new Error('Collection#findOneAndDelete unimplemented by driver'); +}; + +/** + * Abstract method that drivers must implement. + */ + +Collection.prototype.findOneAndReplace = function() { + throw new Error('Collection#findOneAndReplace unimplemented by driver'); +}; + +/** + * Abstract method that drivers must implement. + */ + +Collection.prototype.findOne = function() { + throw new Error('Collection#findOne unimplemented by driver'); +}; + +/** + * Abstract method that drivers must implement. + */ + +Collection.prototype.find = function() { + throw new Error('Collection#find unimplemented by driver'); +}; + +/** + * Abstract method that drivers must implement. + */ + +Collection.prototype.insert = function() { + throw new Error('Collection#insert unimplemented by driver'); +}; + +/** + * Abstract method that drivers must implement. + */ + +Collection.prototype.insertOne = function() { + throw new Error('Collection#insertOne unimplemented by driver'); +}; + +/** + * Abstract method that drivers must implement. + */ + +Collection.prototype.insertMany = function() { + throw new Error('Collection#insertMany unimplemented by driver'); +}; + +/** + * Abstract method that drivers must implement. + */ + +Collection.prototype.save = function() { + throw new Error('Collection#save unimplemented by driver'); +}; + +/** + * Abstract method that drivers must implement. + */ + +Collection.prototype.update = function() { + throw new Error('Collection#update unimplemented by driver'); +}; + +/** + * Abstract method that drivers must implement. + */ + +Collection.prototype.getIndexes = function() { + throw new Error('Collection#getIndexes unimplemented by driver'); +}; + +/** + * Abstract method that drivers must implement. + */ + +Collection.prototype.mapReduce = function() { + throw new Error('Collection#mapReduce unimplemented by driver'); +}; + +/** + * Abstract method that drivers must implement. + */ + +Collection.prototype.watch = function() { + throw new Error('Collection#watch unimplemented by driver'); +}; + +/*! + * ignore + */ + +Collection.prototype._shouldBufferCommands = function _shouldBufferCommands() { + const opts = this.opts; + + if (opts.bufferCommands != null) { + return opts.bufferCommands; + } + if (opts && opts.schemaUserProvidedOptions != null && opts.schemaUserProvidedOptions.bufferCommands != null) { + return opts.schemaUserProvidedOptions.bufferCommands; + } + + return this.conn._shouldBufferCommands(); +}; + +/*! + * ignore + */ + +Collection.prototype._getBufferTimeoutMS = function _getBufferTimeoutMS() { + const conn = this.conn; + const opts = this.opts; + + if (opts.bufferTimeoutMS != null) { + return opts.bufferTimeoutMS; + } + if (opts && opts.schemaUserProvidedOptions != null && opts.schemaUserProvidedOptions.bufferTimeoutMS != null) { + return opts.schemaUserProvidedOptions.bufferTimeoutMS; + } + if (conn.config.bufferTimeoutMS != null) { + return conn.config.bufferTimeoutMS; + } + if (conn.base != null && conn.base.get('bufferTimeoutMS') != null) { + return conn.base.get('bufferTimeoutMS'); + } + return 10000; +}; + +/*! + * Module exports. + */ + +module.exports = Collection; diff --git a/node_modules/mongoose/lib/connection.js b/node_modules/mongoose/lib/connection.js new file mode 100644 index 000000000..310482ce0 --- /dev/null +++ b/node_modules/mongoose/lib/connection.js @@ -0,0 +1,1506 @@ +'use strict'; + +/*! + * Module dependencies. + */ + +const ChangeStream = require('./cursor/ChangeStream'); +const EventEmitter = require('events').EventEmitter; +const Schema = require('./schema'); +const STATES = require('./connectionstate'); +const MongooseError = require('./error/index'); +const DisconnectedError = require('./error/disconnected'); +const SyncIndexesError = require('./error/syncIndexes'); +const PromiseProvider = require('./promise_provider'); +const ServerSelectionError = require('./error/serverSelection'); +const applyPlugins = require('./helpers/schema/applyPlugins'); +const driver = require('./driver'); +const promiseOrCallback = require('./helpers/promiseOrCallback'); +const get = require('./helpers/get'); +const immediate = require('./helpers/immediate'); +const mongodb = require('mongodb'); +const pkg = require('../package.json'); +const utils = require('./utils'); +const processConnectionOptions = require('./helpers/processConnectionOptions'); + +const arrayAtomicsSymbol = require('./helpers/symbols').arrayAtomicsSymbol; +const sessionNewDocuments = require('./helpers/symbols').sessionNewDocuments; + +/*! + * A list of authentication mechanisms that don't require a password for authentication. + * This is used by the authMechanismDoesNotRequirePassword method. + * + * @api private + */ +const noPasswordAuthMechanisms = [ + 'MONGODB-X509' +]; + +/** + * Connection constructor + * + * For practical reasons, a Connection equals a Db. + * + * @param {Mongoose} base a mongoose instance + * @inherits NodeJS EventEmitter https://nodejs.org/api/events.html#events_class_events_eventemitter + * @event `connecting`: Emitted when `connection.openUri()` is executed on this connection. + * @event `connected`: Emitted when this connection successfully connects to the db. May be emitted _multiple_ times in `reconnected` scenarios. + * @event `open`: Emitted after we `connected` and `onOpen` is executed on all of this connection's models. + * @event `disconnecting`: Emitted when `connection.close()` was executed. + * @event `disconnected`: Emitted after getting disconnected from the db. + * @event `close`: Emitted after we `disconnected` and `onClose` executed on all of this connection's models. + * @event `reconnected`: Emitted after we `connected` and subsequently `disconnected`, followed by successfully another successful connection. + * @event `error`: Emitted when an error occurs on this connection. + * @event `fullsetup`: Emitted after the driver has connected to primary and all secondaries if specified in the connection string. + * @api public + */ + +function Connection(base) { + this.base = base; + this.collections = {}; + this.models = {}; + this.config = {}; + this.replica = false; + this.options = null; + this.otherDbs = []; // FIXME: To be replaced with relatedDbs + this.relatedDbs = {}; // Hashmap of other dbs that share underlying connection + this.states = STATES; + this._readyState = STATES.disconnected; + this._closeCalled = false; + this._hasOpened = false; + this.plugins = []; + if (typeof base === 'undefined' || !base.connections.length) { + this.id = 0; + } else { + this.id = base.connections.length; + } + this._queue = []; +} + +/*! + * Inherit from EventEmitter + */ + +Connection.prototype.__proto__ = EventEmitter.prototype; + +/** + * Connection ready state + * + * - 0 = disconnected + * - 1 = connected + * - 2 = connecting + * - 3 = disconnecting + * + * Each state change emits its associated event name. + * + * #### Example + * + * conn.on('connected', callback); + * conn.on('disconnected', callback); + * + * @property readyState + * @memberOf Connection + * @instance + * @api public + */ + +Object.defineProperty(Connection.prototype, 'readyState', { + get: function() { + return this._readyState; + }, + set: function(val) { + if (!(val in STATES)) { + throw new Error('Invalid connection state: ' + val); + } + + if (this._readyState !== val) { + this._readyState = val; + // [legacy] loop over the otherDbs on this connection and change their state + for (const db of this.otherDbs) { + db.readyState = val; + } + + if (STATES.connected === val) { + this._hasOpened = true; + } + + this.emit(STATES[val]); + } + } +}); + +/** + * Gets the value of the option `key`. Equivalent to `conn.options[key]` + * + * #### Example: + * + * conn.get('test'); // returns the 'test' value + * + * @param {String} key + * @method get + * @api public + */ + +Connection.prototype.get = function(key) { + if (this.config.hasOwnProperty(key)) { + return this.config[key]; + } + + return get(this.options, key); +}; + +/** + * Sets the value of the option `key`. Equivalent to `conn.options[key] = val` + * + * Supported options include: + * + * - `maxTimeMS`: Set [`maxTimeMS`](/docs/api.html#query_Query-maxTimeMS) for all queries on this connection. + * + * #### Example: + * + * conn.set('test', 'foo'); + * conn.get('test'); // 'foo' + * conn.options.test; // 'foo' + * + * @param {String} key + * @param {Any} val + * @method set + * @api public + */ + +Connection.prototype.set = function(key, val) { + if (this.config.hasOwnProperty(key)) { + this.config[key] = val; + return val; + } + + this.options = this.options || {}; + this.options[key] = val; + return val; +}; + +/** + * A hash of the collections associated with this connection + * + * @property collections + * @memberOf Connection + * @instance + * @api public + */ + +Connection.prototype.collections; + +/** + * The name of the database this connection points to. + * + * #### Example + * + * mongoose.createConnection('mongodb://localhost:27017/mydb').name; // "mydb" + * + * @property name + * @memberOf Connection + * @instance + * @api public + */ + +Connection.prototype.name; + +/** + * A [POJO](https://masteringjs.io/tutorials/fundamentals/pojo) containing + * a map from model names to models. Contains all models that have been + * added to this connection using [`Connection#model()`](/docs/api/connection.html#connection_Connection-model). + * + * #### Example + * + * const conn = mongoose.createConnection(); + * const Test = conn.model('Test', mongoose.Schema({ name: String })); + * + * Object.keys(conn.models).length; // 1 + * conn.models.Test === Test; // true + * + * @property models + * @memberOf Connection + * @instance + * @api public + */ + +Connection.prototype.models; + +/** + * A number identifier for this connection. Used for debugging when + * you have [multiple connections](/docs/connections.html#multiple_connections). + * + * #### Example + * + * // The default connection has `id = 0` + * mongoose.connection.id; // 0 + * + * // If you create a new connection, Mongoose increments id + * const conn = mongoose.createConnection(); + * conn.id; // 1 + * + * @property id + * @memberOf Connection + * @instance + * @api public + */ + +Connection.prototype.id; + +/** + * The plugins that will be applied to all models created on this connection. + * + * #### Example: + * + * const db = mongoose.createConnection('mongodb://localhost:27017/mydb'); + * db.plugin(() => console.log('Applied')); + * db.plugins.length; // 1 + * + * db.model('Test', new Schema({})); // Prints "Applied" + * + * @property plugins + * @memberOf Connection + * @instance + * @api public + */ + +Object.defineProperty(Connection.prototype, 'plugins', { + configurable: false, + enumerable: true, + writable: true +}); + +/** + * The host name portion of the URI. If multiple hosts, such as a replica set, + * this will contain the first host name in the URI + * + * #### Example + * + * mongoose.createConnection('mongodb://localhost:27017/mydb').host; // "localhost" + * + * @property host + * @memberOf Connection + * @instance + * @api public + */ + +Object.defineProperty(Connection.prototype, 'host', { + configurable: true, + enumerable: true, + writable: true +}); + +/** + * The port portion of the URI. If multiple hosts, such as a replica set, + * this will contain the port from the first host name in the URI. + * + * #### Example + * + * mongoose.createConnection('mongodb://localhost:27017/mydb').port; // 27017 + * + * @property port + * @memberOf Connection + * @instance + * @api public + */ + +Object.defineProperty(Connection.prototype, 'port', { + configurable: true, + enumerable: true, + writable: true +}); + +/** + * The username specified in the URI + * + * #### Example + * + * mongoose.createConnection('mongodb://val:psw@localhost:27017/mydb').user; // "val" + * + * @property user + * @memberOf Connection + * @instance + * @api public + */ + +Object.defineProperty(Connection.prototype, 'user', { + configurable: true, + enumerable: true, + writable: true +}); + +/** + * The password specified in the URI + * + * #### Example + * + * mongoose.createConnection('mongodb://val:psw@localhost:27017/mydb').pass; // "psw" + * + * @property pass + * @memberOf Connection + * @instance + * @api public + */ + +Object.defineProperty(Connection.prototype, 'pass', { + configurable: true, + enumerable: true, + writable: true +}); + +/** + * The mongodb.Db instance, set when the connection is opened + * + * @property db + * @memberOf Connection + * @instance + * @api public + */ + +Connection.prototype.db; + +/** + * The MongoClient instance this connection uses to talk to MongoDB. Mongoose automatically sets this property + * when the connection is opened. + * + * @property client + * @memberOf Connection + * @instance + * @api public + */ + +Connection.prototype.client; + +/** + * A hash of the global options that are associated with this connection + * + * @property config + * @memberOf Connection + * @instance + * @api public + */ + +Connection.prototype.config; + +/** + * Helper for `createCollection()`. Will explicitly create the given collection + * with specified options. Used to create [capped collections](https://docs.mongodb.com/manual/core/capped-collections/) + * and [views](https://docs.mongodb.com/manual/core/views/) from mongoose. + * + * Options are passed down without modification to the [MongoDB driver's `createCollection()` function](https://mongodb.github.io/node-mongodb-native/2.2/api/Db.html#createCollection) + * + * @method createCollection + * @param {string} collection The collection to create + * @param {Object} [options] see [MongoDB driver docs](https://mongodb.github.io/node-mongodb-native/2.2/api/Db.html#createCollection) + * @param {Function} [callback] + * @return {Promise} + * @api public + */ + +Connection.prototype.createCollection = _wrapConnHelper(function createCollection(collection, options, cb) { + if (typeof options === 'function') { + cb = options; + options = {}; + } + this.db.createCollection(collection, options, cb); +}); + +/** + * _Requires MongoDB >= 3.6.0._ Starts a [MongoDB session](https://docs.mongodb.com/manual/release-notes/3.6/#client-sessions) + * for benefits like causal consistency, [retryable writes](https://docs.mongodb.com/manual/core/retryable-writes/), + * and [transactions](https://thecodebarbarian.com/a-node-js-perspective-on-mongodb-4-transactions.html). + * + * #### Example: + * + * const session = await conn.startSession(); + * let doc = await Person.findOne({ name: 'Ned Stark' }, null, { session }); + * await doc.remove(); + * // `doc` will always be null, even if reading from a replica set + * // secondary. Without causal consistency, it is possible to + * // get a doc back from the below query if the query reads from a + * // secondary that is experiencing replication lag. + * doc = await Person.findOne({ name: 'Ned Stark' }, null, { session, readPreference: 'secondary' }); + * + * + * @method startSession + * @param {Object} [options] see the [mongodb driver options](https://mongodb.github.io/node-mongodb-native/3.0/api/MongoClient.html#startSession) + * @param {Boolean} [options.causalConsistency=true] set to false to disable causal consistency + * @param {Function} [callback] + * @return {Promise} promise that resolves to a MongoDB driver `ClientSession` + * @api public + */ + +Connection.prototype.startSession = _wrapConnHelper(function startSession(options, cb) { + if (typeof options === 'function') { + cb = options; + options = null; + } + const session = this.client.startSession(options); + cb(null, session); +}); + +/** + * _Requires MongoDB >= 3.6.0._ Executes the wrapped async function + * in a transaction. Mongoose will commit the transaction if the + * async function executes successfully and attempt to retry if + * there was a retriable error. + * + * Calls the MongoDB driver's [`session.withTransaction()`](https://mongodb.github.io/node-mongodb-native/3.5/api/ClientSession.html#withTransaction), + * but also handles resetting Mongoose document state as shown below. + * + * #### Example: + * + * const doc = new Person({ name: 'Will Riker' }); + * await db.transaction(async function setRank(session) { + * doc.rank = 'Captain'; + * await doc.save({ session }); + * doc.isNew; // false + * + * // Throw an error to abort the transaction + * throw new Error('Oops!'); + * },{ readPreference: 'primary' }).catch(() => {}); + * + * // true, `transaction()` reset the document's state because the + * // transaction was aborted. + * doc.isNew; + * + * @method transaction + * @param {Function} fn Function to execute in a transaction + * @param {mongodb.TransactionOptions} [options] Optional settings for the transaction + * @return {Promise} promise that is fulfilled if Mongoose successfully committed the transaction, or rejects if the transaction was aborted or if Mongoose failed to commit the transaction. If fulfilled, the promise resolves to a MongoDB command result. + * @api public + */ + +Connection.prototype.transaction = function transaction(fn, options) { + return this.startSession().then(session => { + session[sessionNewDocuments] = new Map(); + return session.withTransaction(() => fn(session), options). + then(res => { + delete session[sessionNewDocuments]; + return res; + }). + catch(err => { + // If transaction was aborted, we need to reset newly + // inserted documents' `isNew`. + for (const doc of session[sessionNewDocuments].keys()) { + const state = session[sessionNewDocuments].get(doc); + if (state.hasOwnProperty('isNew')) { + doc.$isNew = state.$isNew; + } + if (state.hasOwnProperty('versionKey')) { + doc.set(doc.schema.options.versionKey, state.versionKey); + } + + for (const path of state.modifiedPaths) { + doc.$__.activePaths.paths[path] = 'modify'; + doc.$__.activePaths.states.modify[path] = true; + } + + for (const path of state.atomics.keys()) { + const val = doc.$__getValue(path); + if (val == null) { + continue; + } + val[arrayAtomicsSymbol] = state.atomics.get(path); + } + } + delete session[sessionNewDocuments]; + throw err; + }) + .finally(() => { + session.endSession() + .catch(() => {}); + }); + }); +}; + +/** + * Helper for `dropCollection()`. Will delete the given collection, including + * all documents and indexes. + * + * @method dropCollection + * @param {string} collection The collection to delete + * @param {Function} [callback] + * @return {Promise} + * @api public + */ + +Connection.prototype.dropCollection = _wrapConnHelper(function dropCollection(collection, cb) { + this.db.dropCollection(collection, cb); +}); + +/** + * Helper for `dropDatabase()`. Deletes the given database, including all + * collections, documents, and indexes. + * + * #### Example: + * + * const conn = mongoose.createConnection('mongodb://localhost:27017/mydb'); + * // Deletes the entire 'mydb' database + * await conn.dropDatabase(); + * + * @method dropDatabase + * @param {Function} [callback] + * @return {Promise} + * @api public + */ + +Connection.prototype.dropDatabase = _wrapConnHelper(function dropDatabase(cb) { + // If `dropDatabase()` is called, this model's collection will not be + // init-ed. It is sufficiently common to call `dropDatabase()` after + // `mongoose.connect()` but before creating models that we want to + // support this. See gh-6796 + for (const name of Object.keys(this.models)) { + delete this.models[name].$init; + } + this.db.dropDatabase(cb); +}); + +/*! + * ignore + */ + +function _wrapConnHelper(fn) { + return function() { + const cb = arguments.length > 0 ? arguments[arguments.length - 1] : null; + const argsWithoutCb = typeof cb === 'function' ? + Array.prototype.slice.call(arguments, 0, arguments.length - 1) : + Array.prototype.slice.call(arguments); + const disconnectedError = new DisconnectedError(this.id, fn.name); + + return promiseOrCallback(cb, cb => { + immediate(() => { + if ((this.readyState === STATES.connecting || this.readyState === STATES.disconnected) && this._shouldBufferCommands()) { + this._queue.push({ fn: fn, ctx: this, args: argsWithoutCb.concat([cb]) }); + } else if (this.readyState === STATES.disconnected && this.db == null) { + cb(disconnectedError); + } else { + try { + fn.apply(this, argsWithoutCb.concat([cb])); + } catch (err) { + return cb(err); + } + } + }); + }); + }; +} + +/*! + * ignore + */ + +Connection.prototype._shouldBufferCommands = function _shouldBufferCommands() { + if (this.config.bufferCommands != null) { + return this.config.bufferCommands; + } + if (this.base.get('bufferCommands') != null) { + return this.base.get('bufferCommands'); + } + return true; +}; + +/** + * error + * + * Graceful error handling, passes error to callback + * if available, else emits error on the connection. + * + * @param {Error} err + * @param {Function} callback optional + * @api private + */ + +Connection.prototype.error = function(err, callback) { + if (callback) { + callback(err); + return null; + } + if (this.listeners('error').length > 0) { + this.emit('error', err); + } + return Promise.reject(err); +}; + +/** + * Called when the connection is opened + * + * @api private + */ + +Connection.prototype.onOpen = function() { + this.readyState = STATES.connected; + + for (const d of this._queue) { + d.fn.apply(d.ctx, d.args); + } + this._queue = []; + + // avoid having the collection subscribe to our event emitter + // to prevent 0.3 warning + for (const i in this.collections) { + if (utils.object.hasOwnProperty(this.collections, i)) { + this.collections[i].onOpen(); + } + } + + this.emit('open'); +}; + +/** + * Opens the connection with a URI using `MongoClient.connect()`. + * + * @param {String} uri The URI to connect with. + * @param {Object} [options] Passed on to https://mongodb.github.io/node-mongodb-native/2.2/api/MongoClient.html#connect + * @param {Boolean} [options.bufferCommands=true] Mongoose specific option. Set to false to [disable buffering](https://mongoosejs.com/docs/faq.html#callback_never_executes) on all models associated with this connection. + * @param {Number} [options.bufferTimeoutMS=10000] Mongoose specific option. If `bufferCommands` is true, Mongoose will throw an error after `bufferTimeoutMS` if the operation is still buffered. + * @param {String} [options.dbName] The name of the database we want to use. If not provided, use database name from connection string. + * @param {String} [options.user] username for authentication, equivalent to `options.auth.user`. Maintained for backwards compatibility. + * @param {String} [options.pass] password for authentication, equivalent to `options.auth.password`. Maintained for backwards compatibility. + * @param {Number} [options.maxPoolSize=100] The maximum number of sockets the MongoDB driver will keep open for this connection. Keep in mind that MongoDB only allows one operation per socket at a time, so you may want to increase this if you find you have a few slow queries that are blocking faster queries from proceeding. See [Slow Trains in MongoDB and Node.js](https://thecodebarbarian.com/slow-trains-in-mongodb-and-nodejs). + * @param {Number} [options.minPoolSize=0] The minimum number of sockets the MongoDB driver will keep open for this connection. Keep in mind that MongoDB only allows one operation per socket at a time, so you may want to increase this if you find you have a few slow queries that are blocking faster queries from proceeding. See [Slow Trains in MongoDB and Node.js](https://thecodebarbarian.com/slow-trains-in-mongodb-and-nodejs). + * @param {Number} [options.serverSelectionTimeoutMS] If `useUnifiedTopology = true`, the MongoDB driver will try to find a server to send any given operation to, and keep retrying for `serverSelectionTimeoutMS` milliseconds before erroring out. If not set, the MongoDB driver defaults to using `30000` (30 seconds). + * @param {Number} [options.heartbeatFrequencyMS] If `useUnifiedTopology = true`, the MongoDB driver sends a heartbeat every `heartbeatFrequencyMS` to check on the status of the connection. A heartbeat is subject to `serverSelectionTimeoutMS`, so the MongoDB driver will retry failed heartbeats for up to 30 seconds by default. Mongoose only emits a `'disconnected'` event after a heartbeat has failed, so you may want to decrease this setting to reduce the time between when your server goes down and when Mongoose emits `'disconnected'`. We recommend you do **not** set this setting below 1000, too many heartbeats can lead to performance degradation. + * @param {Boolean} [options.autoIndex=true] Mongoose-specific option. Set to false to disable automatic index creation for all models associated with this connection. + * @param {Class} [options.promiseLibrary] Sets the [underlying driver's promise library](https://mongodb.github.io/node-mongodb-native/3.1/api/MongoClient.html). + * @param {Number} [options.connectTimeoutMS=30000] How long the MongoDB driver will wait before killing a socket due to inactivity _during initial connection_. Defaults to 30000. This option is passed transparently to [Node.js' `socket#setTimeout()` function](https://nodejs.org/api/net.html#net_socket_settimeout_timeout_callback). + * @param {Number} [options.socketTimeoutMS=30000] How long the MongoDB driver will wait before killing a socket due to inactivity _after initial connection_. A socket may be inactive because of either no activity or a long-running operation. This is set to `30000` by default, you should set this to 2-3x your longest running operation if you expect some of your database operations to run longer than 20 seconds. This option is passed to [Node.js `socket#setTimeout()` function](https://nodejs.org/api/net.html#net_socket_settimeout_timeout_callback) after the MongoDB driver successfully completes. + * @param {Number} [options.family=0] Passed transparently to [Node.js' `dns.lookup()`](https://nodejs.org/api/dns.html#dns_dns_lookup_hostname_options_callback) function. May be either `0, `4`, or `6`. `4` means use IPv4 only, `6` means use IPv6 only, `0` means try both. + * @param {Boolean} [options.autoCreate=false] Set to `true` to make Mongoose automatically call `createCollection()` on every model created on this connection. + * @param {Function} [callback] + * @returns {Connection} this + * @api public + */ + +Connection.prototype.openUri = function(uri, options, callback) { + if (typeof options === 'function') { + callback = options; + options = null; + } + + if (['string', 'number'].indexOf(typeof options) !== -1) { + throw new MongooseError('Mongoose 5.x no longer supports ' + + '`mongoose.connect(host, dbname, port)` or ' + + '`mongoose.createConnection(host, dbname, port)`. See ' + + 'https://mongoosejs.com/docs/connections.html for supported connection syntax'); + } + + if (typeof uri !== 'string') { + throw new MongooseError('The `uri` parameter to `openUri()` must be a ' + + `string, got "${typeof uri}". Make sure the first parameter to ` + + '`mongoose.connect()` or `mongoose.createConnection()` is a string.'); + } + + if (callback != null && typeof callback !== 'function') { + throw new MongooseError('3rd parameter to `mongoose.connect()` or ' + + '`mongoose.createConnection()` must be a function, got "' + + typeof callback + '"'); + } + + if (this._destroyCalled) { + const error = 'Connection has been closed and destroyed, and cannot be used for re-opening the connection. ' + + 'Please create a new connection with `mongoose.createConnection()` or `mongoose.connect()`.'; + if (typeof callback === 'function') { + callback(error); + return; + } + else { + throw new MongooseError(error); + } + } + + if (this.readyState === STATES.connecting || this.readyState === STATES.connected) { + if (this._connectionString !== uri) { + throw new MongooseError('Can\'t call `openUri()` on an active connection with ' + + 'different connection strings. Make sure you aren\'t calling `mongoose.connect()` ' + + 'multiple times. See: https://mongoosejs.com/docs/connections.html#multiple_connections'); + } + + if (typeof callback === 'function') { + this.$initialConnection = this.$initialConnection.then( + () => callback(null, this), + err => callback(err) + ); + } + return this; + } + + this._connectionString = uri; + this.readyState = STATES.connecting; + this._closeCalled = false; + + const Promise = PromiseProvider.get(); + const _this = this; + + options = processConnectionOptions(uri, options); + + if (options) { + options = utils.clone(options); + + const autoIndex = options.config && options.config.autoIndex != null ? + options.config.autoIndex : + options.autoIndex; + if (autoIndex != null) { + this.config.autoIndex = autoIndex !== false; + delete options.config; + delete options.autoIndex; + } + + if ('autoCreate' in options) { + this.config.autoCreate = !!options.autoCreate; + delete options.autoCreate; + } + + if ('sanitizeFilter' in options) { + this.config.sanitizeFilter = options.sanitizeFilter; + delete options.sanitizeFilter; + } + + // Backwards compat + if (options.user || options.pass) { + options.auth = options.auth || {}; + options.auth.username = options.user; + options.auth.password = options.pass; + + this.user = options.user; + this.pass = options.pass; + } + delete options.user; + delete options.pass; + + if (options.bufferCommands != null) { + this.config.bufferCommands = options.bufferCommands; + delete options.bufferCommands; + } + } else { + options = {}; + } + + this._connectionOptions = options; + const dbName = options.dbName; + if (dbName != null) { + this.$dbName = dbName; + } + delete options.dbName; + + if (!utils.hasUserDefinedProperty(options, 'driverInfo')) { + options.driverInfo = { + name: 'Mongoose', + version: pkg.version + }; + } + + const promise = new Promise((resolve, reject) => { + let client; + try { + client = new mongodb.MongoClient(uri, options); + } catch (error) { + _this.readyState = STATES.disconnected; + return reject(error); + } + _this.client = client; + + client.setMaxListeners(0); + client.connect((error) => { + if (error) { + return reject(error); + } + + _setClient(_this, client, options, dbName); + + for (const db of this.otherDbs) { + _setClient(db, client, {}, db.name); + } + + resolve(_this); + }); + }); + + const serverSelectionError = new ServerSelectionError(); + this.$initialConnection = promise. + then(() => this). + catch(err => { + this.readyState = STATES.disconnected; + if (err != null && err.name === 'MongoServerSelectionError') { + err = serverSelectionError.assimilateError(err); + } + + if (this.listeners('error').length > 0) { + immediate(() => this.emit('error', err)); + } + throw err; + }); + + if (callback != null) { + this.$initialConnection = this.$initialConnection.then( + () => { callback(null, this); return this; }, + err => callback(err) + ); + } + + return this.$initialConnection; +}; + +/*! + * ignore + */ + +function _setClient(conn, client, options, dbName) { + const db = dbName != null ? client.db(dbName) : client.db(); + conn.db = db; + conn.client = client; + conn.host = client && + client.s && + client.s.options && + client.s.options.hosts && + client.s.options.hosts[0] && + client.s.options.hosts[0].host || void 0; + conn.port = client && + client.s && + client.s.options && + client.s.options.hosts && + client.s.options.hosts[0] && + client.s.options.hosts[0].port || void 0; + conn.name = dbName != null ? dbName : client && client.s && client.s.options && client.s.options.dbName || void 0; + conn._closeCalled = client._closeCalled; + + const _handleReconnect = () => { + // If we aren't disconnected, we assume this reconnect is due to a + // socket timeout. If there's no activity on a socket for + // `socketTimeoutMS`, the driver will attempt to reconnect and emit + // this event. + if (conn.readyState !== STATES.connected) { + conn.readyState = STATES.connected; + conn.emit('reconnect'); + conn.emit('reconnected'); + conn.onOpen(); + } + }; + + const type = client && + client.topology && + client.topology.description && + client.topology.description.type || ''; + + if (type === 'Single') { + client.on('serverDescriptionChanged', ev => { + const newDescription = ev.newDescription; + if (newDescription.type === 'Unknown') { + conn.readyState = STATES.disconnected; + } else { + _handleReconnect(); + } + }); + } else if (type.startsWith('ReplicaSet')) { + client.on('topologyDescriptionChanged', ev => { + // Emit disconnected if we've lost connectivity to the primary + const description = ev.newDescription; + if (conn.readyState === STATES.connected && description.type !== 'ReplicaSetWithPrimary') { + // Implicitly emits 'disconnected' + conn.readyState = STATES.disconnected; + } else if (conn.readyState === STATES.disconnected && description.type === 'ReplicaSetWithPrimary') { + _handleReconnect(); + } + }); + } + + conn.onOpen(); + + for (const i in conn.collections) { + if (utils.object.hasOwnProperty(conn.collections, i)) { + conn.collections[i].onOpen(); + } + } +} + +Connection.prototype.destroy = function(force, callback) { + if (typeof force === 'function') { + callback = force; + force = false; + } + + if (force != null && typeof force === 'object') { + this.$wasForceClosed = !!force.force; + } else { + this.$wasForceClosed = !!force; + } + + return promiseOrCallback(callback, cb => { + this._close(force, true, cb); + }); +}; + +/** + * Closes the connection + * + * @param {Boolean} [force] optional + * @param {Function} [callback] optional + * @return {Promise} + * @api public + */ + +Connection.prototype.close = function(force, callback) { + if (typeof force === 'function') { + callback = force; + force = false; + } + + if (force != null && typeof force === 'object') { + this.$wasForceClosed = !!force.force; + } else { + this.$wasForceClosed = !!force; + } + + return promiseOrCallback(callback, cb => { + this._close(force, false, cb); + }); +}; + +/** + * Handles closing the connection + * + * @param {Boolean} force + * @param {Boolean} destroy + * @param {Function} callback + * @api private + */ +Connection.prototype._close = function(force, destroy, callback) { + const _this = this; + const closeCalled = this._closeCalled; + this._closeCalled = true; + this._destroyCalled = destroy; + if (this.client != null) { + this.client._closeCalled = true; + this.client._destroyCalled = destroy; + } + + const conn = this; + switch (this.readyState) { + case STATES.disconnected: + if (destroy && this.base.connections.indexOf(conn) !== -1) { + this.base.connections.splice(this.base.connections.indexOf(conn), 1); + } + if (closeCalled) { + callback(); + } else { + this.doClose(force, function(err) { + if (err) { + return callback(err); + } + _this.onClose(force); + callback(null); + }); + } + break; + + case STATES.connected: + this.readyState = STATES.disconnecting; + this.doClose(force, function(err) { + if (err) { + return callback(err); + } + if (destroy && _this.base.connections.indexOf(conn) !== -1) { + _this.base.connections.splice(_this.base.connections.indexOf(conn), 1); + } + _this.onClose(force); + callback(null); + }); + + break; + case STATES.connecting: + this.once('open', function() { + destroy ? _this.destroy(force, callback) : _this.close(force, callback); + }); + break; + + case STATES.disconnecting: + this.once('close', function() { + if (destroy && _this.base.connections.indexOf(conn) !== -1) { + _this.base.connections.splice(_this.base.connections.indexOf(conn), 1); + } + callback(); + }); + break; + } + + return this; +}; + +/** + * Called when the connection closes + * + * @api private + */ + +Connection.prototype.onClose = function(force) { + this.readyState = STATES.disconnected; + + // avoid having the collection subscribe to our event emitter + // to prevent 0.3 warning + for (const i in this.collections) { + if (utils.object.hasOwnProperty(this.collections, i)) { + this.collections[i].onClose(force); + } + } + + this.emit('close', force); + + for (const db of this.otherDbs) { + this._destroyCalled ? db.destroy({ force: force, skipCloseClient: true }) : db.close({ force: force, skipCloseClient: true }); + } +}; + +/** + * Retrieves a collection, creating it if not cached. + * + * Not typically needed by applications. Just talk to your collection through your model. + * + * @param {String} name of the collection + * @param {Object} [options] optional collection options + * @return {Collection} collection instance + * @api public + */ + +Connection.prototype.collection = function(name, options) { + const defaultOptions = { + autoIndex: this.config.autoIndex != null ? this.config.autoIndex : this.base.options.autoIndex, + autoCreate: this.config.autoCreate != null ? this.config.autoCreate : this.base.options.autoCreate + }; + options = Object.assign({}, defaultOptions, options ? utils.clone(options) : {}); + options.$wasForceClosed = this.$wasForceClosed; + const Collection = this.base && this.base.__driver && this.base.__driver.Collection || driver.get().Collection; + if (!(name in this.collections)) { + this.collections[name] = new Collection(name, this, options); + } + return this.collections[name]; +}; + +/** + * Declares a plugin executed on all schemas you pass to `conn.model()` + * + * Equivalent to calling `.plugin(fn)` on each schema you create. + * + * #### Example: + * const db = mongoose.createConnection('mongodb://localhost:27017/mydb'); + * db.plugin(() => console.log('Applied')); + * db.plugins.length; // 1 + * + * db.model('Test', new Schema({})); // Prints "Applied" + * + * @param {Function} fn plugin callback + * @param {Object} [opts] optional options + * @return {Connection} this + * @see plugins ./plugins.html + * @api public + */ + +Connection.prototype.plugin = function(fn, opts) { + this.plugins.push([fn, opts]); + return this; +}; + +/** + * Defines or retrieves a model. + * + * const mongoose = require('mongoose'); + * const db = mongoose.createConnection(..); + * db.model('Venue', new Schema(..)); + * const Ticket = db.model('Ticket', new Schema(..)); + * const Venue = db.model('Venue'); + * + * _When no `collection` argument is passed, Mongoose produces a collection name by passing the model `name` to the [utils.toCollectionName](#utils_exports.toCollectionName) method. This method pluralizes the name. If you don't like this behavior, either pass a collection name or set your schemas collection name option._ + * + * #### Example: + * + * const schema = new Schema({ name: String }, { collection: 'actor' }); + * + * // or + * + * schema.set('collection', 'actor'); + * + * // or + * + * const collectionName = 'actor' + * const M = conn.model('Actor', schema, collectionName) + * + * @param {String|Function} name the model name or class extending Model + * @param {Schema} [schema] a schema. necessary when defining a model + * @param {String} [collection] name of mongodb collection (optional) if not given it will be induced from model name + * @param {Object} [options] + * @param {Boolean} [options.overwriteModels=false] If true, overwrite existing models with the same name to avoid `OverwriteModelError` + * @see Mongoose#model #index_Mongoose-model + * @return {Model} The compiled model + * @api public + */ + +Connection.prototype.model = function(name, schema, collection, options) { + if (!(this instanceof Connection)) { + throw new MongooseError('`connection.model()` should not be run with ' + + '`new`. If you are doing `new db.model(foo)(bar)`, use ' + + '`db.model(foo)(bar)` instead'); + } + + let fn; + if (typeof name === 'function') { + fn = name; + name = fn.name; + } + + // collection name discovery + if (typeof schema === 'string') { + collection = schema; + schema = false; + } + + if (utils.isObject(schema)) { + if (!schema.instanceOfSchema) { + schema = new Schema(schema); + } else if (!(schema instanceof this.base.Schema)) { + schema = schema._clone(this.base.Schema); + } + } + if (schema && !schema.instanceOfSchema) { + throw new Error('The 2nd parameter to `mongoose.model()` should be a ' + + 'schema or a POJO'); + } + + const defaultOptions = { cache: false, overwriteModels: this.base.options.overwriteModels }; + const opts = Object.assign(defaultOptions, options, { connection: this }); + if (this.models[name] && !collection && opts.overwriteModels !== true) { + // model exists but we are not subclassing with custom collection + if (schema && schema.instanceOfSchema && schema !== this.models[name].schema) { + throw new MongooseError.OverwriteModelError(name); + } + return this.models[name]; + } + + let model; + + if (schema && schema.instanceOfSchema) { + applyPlugins(schema, this.plugins, null, '$connectionPluginsApplied'); + + // compile a model + model = this.base._model(fn || name, schema, collection, opts); + + // only the first model with this name is cached to allow + // for one-offs with custom collection names etc. + if (!this.models[name]) { + this.models[name] = model; + } + + // Errors handled internally, so safe to ignore error + model.init(function $modelInitNoop() {}); + + return model; + } + + if (this.models[name] && collection) { + // subclassing current model with alternate collection + model = this.models[name]; + schema = model.prototype.schema; + const sub = model.__subclass(this, schema, collection); + // do not cache the sub model + return sub; + } + + if (!model) { + throw new MongooseError.MissingSchemaError(name); + } + + if (this === model.prototype.db + && (!collection || collection === model.collection.name)) { + // model already uses this connection. + + // only the first model with this name is cached to allow + // for one-offs with custom collection names etc. + if (!this.models[name]) { + this.models[name] = model; + } + + return model; + } + this.models[name] = model.__subclass(this, schema, collection); + return this.models[name]; +}; + +/** + * Removes the model named `name` from this connection, if it exists. You can + * use this function to clean up any models you created in your tests to + * prevent OverwriteModelErrors. + * + * #### Example: + * + * conn.model('User', new Schema({ name: String })); + * console.log(conn.model('User')); // Model object + * conn.deleteModel('User'); + * console.log(conn.model('User')); // undefined + * + * // Usually useful in a Mocha `afterEach()` hook + * afterEach(function() { + * conn.deleteModel(/.+/); // Delete every model + * }); + * + * @api public + * @param {String|RegExp} name if string, the name of the model to remove. If regexp, removes all models whose name matches the regexp. + * @return {Connection} this + */ + +Connection.prototype.deleteModel = function(name) { + if (typeof name === 'string') { + const model = this.model(name); + if (model == null) { + return this; + } + const collectionName = model.collection.name; + delete this.models[name]; + delete this.collections[collectionName]; + + this.emit('deleteModel', model); + } else if (name instanceof RegExp) { + const pattern = name; + const names = this.modelNames(); + for (const name of names) { + if (pattern.test(name)) { + this.deleteModel(name); + } + } + } else { + throw new Error('First parameter to `deleteModel()` must be a string ' + + 'or regexp, got "' + name + '"'); + } + + return this; +}; + +/** + * Watches the entire underlying database for changes. Similar to + * [`Model.watch()`](/docs/api/model.html#model_Model.watch). + * + * This function does **not** trigger any middleware. In particular, it + * does **not** trigger aggregate middleware. + * + * The ChangeStream object is an event emitter that emits the following events: + * + * - 'change': A change occurred, see below example + * - 'error': An unrecoverable error occurred. In particular, change streams currently error out if they lose connection to the replica set primary. Follow [this GitHub issue](https://github.com/Automattic/mongoose/issues/6799) for updates. + * - 'end': Emitted if the underlying stream is closed + * - 'close': Emitted if the underlying stream is closed + * + * #### Example: + * + * const User = conn.model('User', new Schema({ name: String })); + * + * const changeStream = conn.watch().on('change', data => console.log(data)); + * + * // Triggers a 'change' event on the change stream. + * await User.create({ name: 'test' }); + * + * @api public + * @param {Array} [pipeline] + * @param {Object} [options] passed without changes to [the MongoDB driver's `Db#watch()` function](https://mongodb.github.io/node-mongodb-native/3.4/api/Db.html#watch) + * @return {ChangeStream} mongoose-specific change stream wrapper, inherits from EventEmitter + */ + +Connection.prototype.watch = function(pipeline, options) { + const disconnectedError = new DisconnectedError(this.id, 'watch'); + + const changeStreamThunk = cb => { + immediate(() => { + if (this.readyState === STATES.connecting) { + this.once('open', function() { + const driverChangeStream = this.db.watch(pipeline, options); + cb(null, driverChangeStream); + }); + } else if (this.readyState === STATES.disconnected && this.db == null) { + cb(disconnectedError); + } else { + const driverChangeStream = this.db.watch(pipeline, options); + cb(null, driverChangeStream); + } + }); + }; + + const changeStream = new ChangeStream(changeStreamThunk, pipeline, options); + return changeStream; +}; + +/** + * Returns a promise that resolves when this connection + * successfully connects to MongoDB, or rejects if this connection failed + * to connect. + * + * #### Example: + * const conn = await mongoose.createConnection('mongodb://localhost:27017/test'). + * asPromise(); + * conn.readyState; // 1, means Mongoose is connected + * + * @api public + * @return {Promise} + */ + +Connection.prototype.asPromise = function asPromise() { + return this.$initialConnection; +}; + +/** + * Returns an array of model names created on this connection. + * @api public + * @return {Array} + */ + +Connection.prototype.modelNames = function() { + return Object.keys(this.models); +}; + +/** + * @brief Returns if the connection requires authentication after it is opened. Generally if a + * username and password are both provided than authentication is needed, but in some cases a + * password is not required. + * @api private + * @return {Boolean} true if the connection should be authenticated after it is opened, otherwise false. + */ +Connection.prototype.shouldAuthenticate = function() { + return this.user != null && + (this.pass != null || this.authMechanismDoesNotRequirePassword()); +}; + +/** + * @brief Returns a boolean value that specifies if the current authentication mechanism needs a + * password to authenticate according to the auth objects passed into the openUri methods. + * @api private + * @return {Boolean} true if the authentication mechanism specified in the options object requires + * a password, otherwise false. + */ +Connection.prototype.authMechanismDoesNotRequirePassword = function() { + if (this.options && this.options.auth) { + return noPasswordAuthMechanisms.indexOf(this.options.auth.authMechanism) >= 0; + } + return true; +}; + +/** + * @brief Returns a boolean value that specifies if the provided objects object provides enough + * data to authenticate with. Generally this is true if the username and password are both specified + * but in some authentication methods, a password is not required for authentication so only a username + * is required. + * @param {Object} [options] the options object passed into the openUri methods. + * @api private + * @return {Boolean} true if the provided options object provides enough data to authenticate with, + * otherwise false. + */ +Connection.prototype.optionsProvideAuthenticationData = function(options) { + return (options) && + (options.user) && + ((options.pass) || this.authMechanismDoesNotRequirePassword()); +}; + +/** + * Returns the [MongoDB driver `MongoClient`](https://mongodb.github.io/node-mongodb-native/3.5/api/MongoClient.html) instance + * that this connection uses to talk to MongoDB. + * + * #### Example: + * const conn = await mongoose.createConnection('mongodb://localhost:27017/test'). + * asPromise(); + * + * conn.getClient(); // MongoClient { ... } + * + * @api public + * @return {MongoClient} + */ + +Connection.prototype.getClient = function getClient() { + return this.client; +}; + +/** + * Set the [MongoDB driver `MongoClient`](https://mongodb.github.io/node-mongodb-native/3.5/api/MongoClient.html) instance + * that this connection uses to talk to MongoDB. This is useful if you already have a MongoClient instance, and want to + * reuse it. + * + * #### Example: + * const client = await mongodb.MongoClient.connect('mongodb://localhost:27017/test'); + * + * const conn = mongoose.createConnection().setClient(client); + * + * conn.getClient(); // MongoClient { ... } + * conn.readyState; // 1, means 'CONNECTED' + * + * @api public + * @return {Connection} this + */ + +Connection.prototype.setClient = function setClient(client) { + if (!(client instanceof mongodb.MongoClient)) { + throw new MongooseError('Must call `setClient()` with an instance of MongoClient'); + } + if (this.readyState !== STATES.disconnected) { + throw new MongooseError('Cannot call `setClient()` on a connection that is already connected.'); + } + if (client.topology == null) { + throw new MongooseError('Cannot call `setClient()` with a MongoClient that you have not called `connect()` on yet.'); + } + + this._connectionString = client.s.url; + _setClient(this, client, {}, client.s.options.dbName); + + return this; +}; + +/** + * + * Syncs all the indexes for the models registered with this connection. + * + * @param {Object} options + * @param {Boolean} options.continueOnError `false` by default. If set to `true`, mongoose will not throw an error if one model syncing failed, and will return an object where the keys are the names of the models, and the values are the results/errors for each model. + * @returns + */ +Connection.prototype.syncIndexes = async function syncIndexes(options = {}) { + const result = {}; + const errorsMap = { }; + + const { continueOnError } = options; + delete options.continueOnError; + + for (const model of Object.values(this.models)) { + try { + result[model.modelName] = await model.syncIndexes(options); + } catch (err) { + if (!continueOnError) { + errorsMap[model.modelName] = err; + break; + } else { + result[model.modelName] = err; + } + } + } + + if (!continueOnError && Object.keys(errorsMap).length) { + const message = Object.entries(errorsMap).map(([modelName, err]) => `${modelName}: ${err.message}`).join(', '); + const syncIndexesError = new SyncIndexesError(message, errorsMap); + throw syncIndexesError; + } + + return result; +}; + +/** + * Switches to a different database using the same connection pool. + * + * Returns a new connection object, with the new db. + * + * @method useDb + * @memberOf Connection + * @param {String} name The database name + * @param {Object} [options] + * @param {Boolean} [options.useCache=false] If true, cache results so calling `useDb()` multiple times with the same name only creates 1 connection object. + * @param {Boolean} [options.noListener=false] If true, the connection object will not make the db listen to events on the original connection. See [issue #9961](https://github.com/Automattic/mongoose/issues/9961). + * @return {Connection} New Connection Object + * @api public + */ + +/*! + * Module exports. + */ + +Connection.STATES = STATES; +module.exports = Connection; diff --git a/node_modules/mongoose/lib/connectionstate.js b/node_modules/mongoose/lib/connectionstate.js new file mode 100644 index 000000000..920f45bee --- /dev/null +++ b/node_modules/mongoose/lib/connectionstate.js @@ -0,0 +1,26 @@ + +/*! + * Connection states + */ + +'use strict'; + +const STATES = module.exports = exports = Object.create(null); + +const disconnected = 'disconnected'; +const connected = 'connected'; +const connecting = 'connecting'; +const disconnecting = 'disconnecting'; +const uninitialized = 'uninitialized'; + +STATES[0] = disconnected; +STATES[1] = connected; +STATES[2] = connecting; +STATES[3] = disconnecting; +STATES[99] = uninitialized; + +STATES[disconnected] = 0; +STATES[connected] = 1; +STATES[connecting] = 2; +STATES[disconnecting] = 3; +STATES[uninitialized] = 99; diff --git a/node_modules/mongoose/lib/cursor/AggregationCursor.js b/node_modules/mongoose/lib/cursor/AggregationCursor.js new file mode 100644 index 000000000..02cafc81e --- /dev/null +++ b/node_modules/mongoose/lib/cursor/AggregationCursor.js @@ -0,0 +1,368 @@ +/*! + * Module dependencies. + */ + +'use strict'; + +const MongooseError = require('../error/mongooseError'); +const Readable = require('stream').Readable; +const promiseOrCallback = require('../helpers/promiseOrCallback'); +const eachAsync = require('../helpers/cursor/eachAsync'); +const immediate = require('../helpers/immediate'); +const util = require('util'); + +/** + * An AggregationCursor is a concurrency primitive for processing aggregation + * results one document at a time. It is analogous to QueryCursor. + * + * An AggregationCursor fulfills the Node.js streams3 API, + * in addition to several other mechanisms for loading documents from MongoDB + * one at a time. + * + * Creating an AggregationCursor executes the model's pre aggregate hooks, + * but **not** the model's post aggregate hooks. + * + * Unless you're an advanced user, do **not** instantiate this class directly. + * Use [`Aggregate#cursor()`](/docs/api.html#aggregate_Aggregate-cursor) instead. + * + * @param {Aggregate} agg + * @inherits Readable + * @event `cursor`: Emitted when the cursor is created + * @event `error`: Emitted when an error occurred + * @event `data`: Emitted when the stream is flowing and the next doc is ready + * @event `end`: Emitted when the stream is exhausted + * @api public + */ + +function AggregationCursor(agg) { + // set autoDestroy=true because on node 12 it's by default false + // gh-10902 need autoDestroy to destroy correctly and emit 'close' event + Readable.call(this, { autoDestroy: true, objectMode: true }); + + this.cursor = null; + this.agg = agg; + this._transforms = []; + const model = agg._model; + delete agg.options.cursor.useMongooseAggCursor; + this._mongooseOptions = {}; + + _init(model, this, agg); +} + +util.inherits(AggregationCursor, Readable); + +/*! + * ignore + */ + +function _init(model, c, agg) { + if (!model.collection.buffer) { + model.hooks.execPre('aggregate', agg, function() { + c.cursor = model.collection.aggregate(agg._pipeline, agg.options || {}); + c.emit('cursor', c.cursor); + }); + } else { + model.collection.emitter.once('queue', function() { + model.hooks.execPre('aggregate', agg, function() { + c.cursor = model.collection.aggregate(agg._pipeline, agg.options || {}); + c.emit('cursor', c.cursor); + }); + }); + } +} + +/*! + * Necessary to satisfy the Readable API + */ + +AggregationCursor.prototype._read = function() { + const _this = this; + _next(this, function(error, doc) { + if (error) { + return _this.emit('error', error); + } + if (!doc) { + _this.push(null); + _this.cursor.close(function(error) { + if (error) { + return _this.emit('error', error); + } + }); + return; + } + _this.push(doc); + }); +}; + +if (Symbol.asyncIterator != null) { + const msg = 'Mongoose does not support using async iterators with an ' + + 'existing aggregation cursor. See https://bit.ly/mongoose-async-iterate-aggregation'; + + AggregationCursor.prototype[Symbol.asyncIterator] = function() { + throw new MongooseError(msg); + }; +} + +/** + * Registers a transform function which subsequently maps documents retrieved + * via the streams interface or `.next()` + * + * #### Example + * + * // Map documents returned by `data` events + * Thing. + * find({ name: /^hello/ }). + * cursor(). + * map(function (doc) { + * doc.foo = "bar"; + * return doc; + * }) + * on('data', function(doc) { console.log(doc.foo); }); + * + * // Or map documents returned by `.next()` + * const cursor = Thing.find({ name: /^hello/ }). + * cursor(). + * map(function (doc) { + * doc.foo = "bar"; + * return doc; + * }); + * cursor.next(function(error, doc) { + * console.log(doc.foo); + * }); + * + * @param {Function} fn + * @return {AggregationCursor} + * @api public + * @method map + */ + +Object.defineProperty(AggregationCursor.prototype, 'map', { + value: function(fn) { + this._transforms.push(fn); + return this; + }, + enumerable: true, + configurable: true, + writable: true +}); + +/*! + * Marks this cursor as errored + */ + +AggregationCursor.prototype._markError = function(error) { + this._error = error; + return this; +}; + +/** + * Marks this cursor as closed. Will stop streaming and subsequent calls to + * `next()` will error. + * + * @param {Function} callback + * @return {Promise} + * @api public + * @method close + * @emits close + * @see MongoDB driver cursor#close https://mongodb.github.io/node-mongodb-native/2.1/api/Cursor.html#close + */ + +AggregationCursor.prototype.close = function(callback) { + return promiseOrCallback(callback, cb => { + this.cursor.close(error => { + if (error) { + cb(error); + return this.listeners('error').length > 0 && this.emit('error', error); + } + this.emit('close'); + cb(null); + }); + }); +}; + +/** + * Get the next document from this cursor. Will return `null` when there are + * no documents left. + * + * @param {Function} callback + * @return {Promise} + * @api public + * @method next + */ + +AggregationCursor.prototype.next = function(callback) { + return promiseOrCallback(callback, cb => { + _next(this, cb); + }); +}; + +/** + * Execute `fn` for every document in the cursor. If `fn` returns a promise, + * will wait for the promise to resolve before iterating on to the next one. + * Returns a promise that resolves when done. + * + * @param {Function} fn + * @param {Object} [options] + * @param {Number} [options.parallel] the number of promises to execute in parallel. Defaults to 1. + * @param {Function} [callback] executed when all docs have been processed + * @return {Promise} + * @api public + * @method eachAsync + */ + +AggregationCursor.prototype.eachAsync = function(fn, opts, callback) { + const _this = this; + if (typeof opts === 'function') { + callback = opts; + opts = {}; + } + opts = opts || {}; + + return eachAsync(function(cb) { return _next(_this, cb); }, fn, opts, callback); +}; + +/** + * Returns an asyncIterator for use with [`for/await/of` loops](https://thecodebarbarian.com/getting-started-with-async-iterators-in-node-js + * You do not need to call this function explicitly, the JavaScript runtime + * will call it for you. + * + * #### Example + * + * // Async iterator without explicitly calling `cursor()`. Mongoose still + * // creates an AggregationCursor instance internally. + * const agg = Model.aggregate([{ $match: { age: { $gte: 25 } } }]); + * for await (const doc of agg) { + * console.log(doc.name); + * } + * + * // You can also use an AggregationCursor instance for async iteration + * const cursor = Model.aggregate([{ $match: { age: { $gte: 25 } } }]).cursor(); + * for await (const doc of cursor) { + * console.log(doc.name); + * } + * + * Node.js 10.x supports async iterators natively without any flags. You can + * enable async iterators in Node.js 8.x using the [`--harmony_async_iteration` flag](https://github.com/tc39/proposal-async-iteration/issues/117#issuecomment-346695187). + * + * **Note:** This function is not set if `Symbol.asyncIterator` is undefined. If + * `Symbol.asyncIterator` is undefined, that means your Node.js version does not + * support async iterators. + * + * @method Symbol.asyncIterator + * @memberOf AggregationCursor + * @instance + * @api public + */ + +if (Symbol.asyncIterator != null) { + AggregationCursor.prototype[Symbol.asyncIterator] = function() { + return this.transformNull()._transformForAsyncIterator(); + }; +} + +/*! + * ignore + */ + +AggregationCursor.prototype._transformForAsyncIterator = function() { + if (this._transforms.indexOf(_transformForAsyncIterator) === -1) { + this.map(_transformForAsyncIterator); + } + return this; +}; + +/*! + * ignore + */ + +AggregationCursor.prototype.transformNull = function(val) { + if (arguments.length === 0) { + val = true; + } + this._mongooseOptions.transformNull = val; + return this; +}; + +/*! + * ignore + */ + +function _transformForAsyncIterator(doc) { + return doc == null ? { done: true } : { value: doc, done: false }; +} + +/** + * Adds a [cursor flag](https://mongodb.github.io/node-mongodb-native/2.2/api/Cursor.html#addCursorFlag). + * Useful for setting the `noCursorTimeout` and `tailable` flags. + * + * @param {String} flag + * @param {Boolean} value + * @return {AggregationCursor} this + * @api public + * @method addCursorFlag + */ + +AggregationCursor.prototype.addCursorFlag = function(flag, value) { + const _this = this; + _waitForCursor(this, function() { + _this.cursor.addCursorFlag(flag, value); + }); + return this; +}; + +/*! + * ignore + */ + +function _waitForCursor(ctx, cb) { + if (ctx.cursor) { + return cb(); + } + ctx.once('cursor', function() { + cb(); + }); +} + +/*! + * Get the next doc from the underlying cursor and mongooseify it + * (populate, etc.) + */ + +function _next(ctx, cb) { + let callback = cb; + if (ctx._transforms.length) { + callback = function(err, doc) { + if (err || (doc === null && !ctx._mongooseOptions.transformNull)) { + return cb(err, doc); + } + cb(err, ctx._transforms.reduce(function(doc, fn) { + return fn(doc); + }, doc)); + }; + } + + if (ctx._error) { + return immediate(function() { + callback(ctx._error); + }); + } + + if (ctx.cursor) { + return ctx.cursor.next(function(error, doc) { + if (error) { + return callback(error); + } + if (!doc) { + return callback(null, null); + } + + callback(null, doc); + }); + } else { + ctx.once('cursor', function() { + _next(ctx, cb); + }); + } +} + +module.exports = AggregationCursor; diff --git a/node_modules/mongoose/lib/cursor/ChangeStream.js b/node_modules/mongoose/lib/cursor/ChangeStream.js new file mode 100644 index 000000000..15dbcadcb --- /dev/null +++ b/node_modules/mongoose/lib/cursor/ChangeStream.js @@ -0,0 +1,101 @@ +'use strict'; + +/*! + * Module dependencies. + */ + +const EventEmitter = require('events').EventEmitter; + +/*! + * ignore + */ + +class ChangeStream extends EventEmitter { + constructor(changeStreamThunk, pipeline, options) { + super(); + + this.driverChangeStream = null; + this.closed = false; + this.bindedEvents = false; + this.pipeline = pipeline; + this.options = options; + + // This wrapper is necessary because of buffering. + changeStreamThunk((err, driverChangeStream) => { + if (err != null) { + this.emit('error', err); + return; + } + + this.driverChangeStream = driverChangeStream; + this.emit('ready'); + }); + } + + _bindEvents() { + if (this.bindedEvents) { + return; + } + + this.bindedEvents = true; + + if (this.driverChangeStream == null) { + this.once('ready', () => { + this.driverChangeStream.on('close', () => { + this.closed = true; + }); + + ['close', 'change', 'end', 'error'].forEach(ev => { + this.driverChangeStream.on(ev, data => this.emit(ev, data)); + }); + }); + + return; + } + + this.driverChangeStream.on('close', () => { + this.closed = true; + }); + + ['close', 'change', 'end', 'error'].forEach(ev => { + this.driverChangeStream.on(ev, data => { + this.emit(ev, data); + }); + }); + } + + hasNext(cb) { + return this.driverChangeStream.hasNext(cb); + } + + next(cb) { + return this.driverChangeStream.next(cb); + } + + on(event, handler) { + this._bindEvents(); + return super.on(event, handler); + } + + once(event, handler) { + this._bindEvents(); + return super.once(event, handler); + } + + _queue(cb) { + this.once('ready', () => cb()); + } + + close() { + this.closed = true; + if (this.driverChangeStream) { + this.driverChangeStream.close(); + } + } +} + +/*! + * ignore + */ + +module.exports = ChangeStream; diff --git a/node_modules/mongoose/lib/cursor/QueryCursor.js b/node_modules/mongoose/lib/cursor/QueryCursor.js new file mode 100644 index 000000000..54001d0f4 --- /dev/null +++ b/node_modules/mongoose/lib/cursor/QueryCursor.js @@ -0,0 +1,507 @@ +/*! + * Module dependencies. + */ + +'use strict'; + +const Readable = require('stream').Readable; +const promiseOrCallback = require('../helpers/promiseOrCallback'); +const eachAsync = require('../helpers/cursor/eachAsync'); +const helpers = require('../queryhelpers'); +const immediate = require('../helpers/immediate'); +const util = require('util'); + +/** + * A QueryCursor is a concurrency primitive for processing query results + * one document at a time. A QueryCursor fulfills the Node.js streams3 API, + * in addition to several other mechanisms for loading documents from MongoDB + * one at a time. + * + * QueryCursors execute the model's pre `find` hooks before loading any documents + * from MongoDB, and the model's post `find` hooks after loading each document. + * + * Unless you're an advanced user, do **not** instantiate this class directly. + * Use [`Query#cursor()`](/docs/api.html#query_Query-cursor) instead. + * + * @param {Query} query + * @param {Object} options query options passed to `.find()` + * @inherits Readable + * @event `cursor`: Emitted when the cursor is created + * @event `error`: Emitted when an error occurred + * @event `data`: Emitted when the stream is flowing and the next doc is ready + * @event `end`: Emitted when the stream is exhausted + * @api public + */ + +function QueryCursor(query, options) { + // set autoDestroy=true because on node 12 it's by default false + // gh-10902 need autoDestroy to destroy correctly and emit 'close' event + Readable.call(this, { autoDestroy: true, objectMode: true }); + + this.cursor = null; + this.query = query; + const _this = this; + const model = query.model; + this._mongooseOptions = {}; + this._transforms = []; + this.model = model; + this.options = options || {}; + + model.hooks.execPre('find', query, (err) => { + if (err != null) { + _this._markError(err); + _this.listeners('error').length > 0 && _this.emit('error', err); + return; + } + this._transforms = this._transforms.concat(query._transforms.slice()); + if (this.options.transform) { + this._transforms.push(options.transform); + } + // Re: gh-8039, you need to set the `cursor.batchSize` option, top-level + // `batchSize` option doesn't work. + if (this.options.batchSize) { + this.options.cursor = options.cursor || {}; + this.options.cursor.batchSize = options.batchSize; + + // Max out the number of documents we'll populate in parallel at 5000. + this.options._populateBatchSize = Math.min(this.options.batchSize, 5000); + } + model.collection.find(query._conditions, this.options, (err, cursor) => { + if (err != null) { + _this._markError(err); + _this.listeners('error').length > 0 && _this.emit('error', _this._error); + return; + } + + if (_this._error) { + cursor.close(function() {}); + _this.listeners('error').length > 0 && _this.emit('error', _this._error); + } + _this.cursor = cursor; + _this.emit('cursor', cursor); + }); + }); +} + +util.inherits(QueryCursor, Readable); + +/*! + * Necessary to satisfy the Readable API + */ + +QueryCursor.prototype._read = function() { + const _this = this; + _next(this, function(error, doc) { + if (error) { + return _this.emit('error', error); + } + if (!doc) { + _this.push(null); + _this.cursor.close(function(error) { + if (error) { + return _this.emit('error', error); + } + }); + return; + } + _this.push(doc); + }); +}; + +/** + * Registers a transform function which subsequently maps documents retrieved + * via the streams interface or `.next()` + * + * #### Example + * + * // Map documents returned by `data` events + * Thing. + * find({ name: /^hello/ }). + * cursor(). + * map(function (doc) { + * doc.foo = "bar"; + * return doc; + * }) + * on('data', function(doc) { console.log(doc.foo); }); + * + * // Or map documents returned by `.next()` + * const cursor = Thing.find({ name: /^hello/ }). + * cursor(). + * map(function (doc) { + * doc.foo = "bar"; + * return doc; + * }); + * cursor.next(function(error, doc) { + * console.log(doc.foo); + * }); + * + * @param {Function} fn + * @return {QueryCursor} + * @api public + * @method map + */ + +Object.defineProperty(QueryCursor.prototype, 'map', { + value: function(fn) { + this._transforms.push(fn); + return this; + }, + enumerable: true, + configurable: true, + writable: true +}); + +/*! + * Marks this cursor as errored + */ + +QueryCursor.prototype._markError = function(error) { + this._error = error; + return this; +}; + +/** + * Marks this cursor as closed. Will stop streaming and subsequent calls to + * `next()` will error. + * + * @param {Function} callback + * @return {Promise} + * @api public + * @method close + * @emits close + * @see MongoDB driver cursor#close https://mongodb.github.io/node-mongodb-native/2.1/api/Cursor.html#close + */ + +QueryCursor.prototype.close = function(callback) { + return promiseOrCallback(callback, cb => { + this.cursor.close(error => { + if (error) { + cb(error); + return this.listeners('error').length > 0 && this.emit('error', error); + } + this.emit('close'); + cb(null); + }); + }, this.model.events); +}; + +/** + * Get the next document from this cursor. Will return `null` when there are + * no documents left. + * + * @param {Function} callback + * @return {Promise} + * @api public + * @method next + */ + +QueryCursor.prototype.next = function(callback) { + return promiseOrCallback(callback, cb => { + _next(this, function(error, doc) { + if (error) { + return cb(error); + } + cb(null, doc); + }); + }, this.model.events); +}; + +/** + * Execute `fn` for every document in the cursor. If `fn` returns a promise, + * will wait for the promise to resolve before iterating on to the next one. + * Returns a promise that resolves when done. + * + * #### Example + * + * // Iterate over documents asynchronously + * Thing. + * find({ name: /^hello/ }). + * cursor(). + * eachAsync(async function (doc, i) { + * doc.foo = doc.bar + i; + * await doc.save(); + * }) + * + * @param {Function} fn + * @param {Object} [options] + * @param {Number} [options.parallel] the number of promises to execute in parallel. Defaults to 1. + * @param {Number} [options.batchSize] if set, will call `fn()` with arrays of documents with length at most `batchSize` + * @param {Boolean} [options.continueOnError=false] if true, `eachAsync()` iterates through all docs even if `fn` throws an error. If false, `eachAsync()` throws an error immediately if the given function `fn()` throws an error. + * @param {Function} [callback] executed when all docs have been processed + * @return {Promise} + * @api public + * @method eachAsync + */ + +QueryCursor.prototype.eachAsync = function(fn, opts, callback) { + const _this = this; + if (typeof opts === 'function') { + callback = opts; + opts = {}; + } + opts = opts || {}; + + return eachAsync(function(cb) { return _next(_this, cb); }, fn, opts, callback); +}; + +/** + * The `options` passed in to the `QueryCursor` constructor. + * + * @api public + * @property options + */ + +QueryCursor.prototype.options; + +/** + * Adds a [cursor flag](https://mongodb.github.io/node-mongodb-native/2.2/api/Cursor.html#addCursorFlag). + * Useful for setting the `noCursorTimeout` and `tailable` flags. + * + * @param {String} flag + * @param {Boolean} value + * @return {AggregationCursor} this + * @api public + * @method addCursorFlag + */ + +QueryCursor.prototype.addCursorFlag = function(flag, value) { + const _this = this; + _waitForCursor(this, function() { + _this.cursor.addCursorFlag(flag, value); + }); + return this; +}; + +/*! + * ignore + */ + +QueryCursor.prototype.transformNull = function(val) { + if (arguments.length === 0) { + val = true; + } + this._mongooseOptions.transformNull = val; + return this; +}; + +/*! + * ignore + */ + +QueryCursor.prototype._transformForAsyncIterator = function() { + if (this._transforms.indexOf(_transformForAsyncIterator) === -1) { + this.map(_transformForAsyncIterator); + } + return this; +}; + +/** + * Returns an asyncIterator for use with [`for/await/of` loops](https://thecodebarbarian.com/getting-started-with-async-iterators-in-node-js). + * You do not need to call this function explicitly, the JavaScript runtime + * will call it for you. + * + * #### Example + * + * // Works without using `cursor()` + * for await (const doc of Model.find([{ $sort: { name: 1 } }])) { + * console.log(doc.name); + * } + * + * // Can also use `cursor()` + * for await (const doc of Model.find([{ $sort: { name: 1 } }]).cursor()) { + * console.log(doc.name); + * } + * + * Node.js 10.x supports async iterators natively without any flags. You can + * enable async iterators in Node.js 8.x using the [`--harmony_async_iteration` flag](https://github.com/tc39/proposal-async-iteration/issues/117#issuecomment-346695187). + * + * **Note:** This function is not if `Symbol.asyncIterator` is undefined. If + * `Symbol.asyncIterator` is undefined, that means your Node.js version does not + * support async iterators. + * + * @method Symbol.asyncIterator + * @memberOf Query + * @instance + * @api public + */ + +if (Symbol.asyncIterator != null) { + QueryCursor.prototype[Symbol.asyncIterator] = function() { + return this.transformNull()._transformForAsyncIterator(); + }; +} + +/*! + * ignore + */ + +function _transformForAsyncIterator(doc) { + return doc == null ? { done: true } : { value: doc, done: false }; +} + +/*! + * Get the next doc from the underlying cursor and mongooseify it + * (populate, etc.) + */ + +function _next(ctx, cb) { + let callback = cb; + if (ctx._transforms.length) { + callback = function(err, doc) { + if (err || (doc === null && !ctx._mongooseOptions.transformNull)) { + return cb(err, doc); + } + cb(err, ctx._transforms.reduce(function(doc, fn) { + return fn.call(ctx, doc); + }, doc)); + }; + } + + if (ctx._error) { + return immediate(function() { + callback(ctx._error); + }); + } + + if (ctx.cursor) { + if (ctx.query._mongooseOptions.populate && !ctx._pop) { + ctx._pop = helpers.preparePopulationOptionsMQ(ctx.query, + ctx.query._mongooseOptions); + ctx._pop.__noPromise = true; + } + if (ctx.query._mongooseOptions.populate && ctx.options._populateBatchSize > 1) { + if (ctx._batchDocs && ctx._batchDocs.length) { + // Return a cached populated doc + return _nextDoc(ctx, ctx._batchDocs.shift(), ctx._pop, callback); + } else if (ctx._batchExhausted) { + // Internal cursor reported no more docs. Act the same here + return callback(null, null); + } else { + // Request as many docs as batchSize, to populate them also in batch + ctx._batchDocs = []; + return ctx.cursor.next(_onNext.bind({ ctx, callback })); + } + } else { + return ctx.cursor.next(function(error, doc) { + if (error) { + return callback(error); + } + if (!doc) { + return callback(null, null); + } + + if (!ctx.query._mongooseOptions.populate) { + return _nextDoc(ctx, doc, null, callback); + } + + ctx.query.model.populate(doc, ctx._pop, function(err, doc) { + if (err) { + return callback(err); + } + return _nextDoc(ctx, doc, ctx._pop, callback); + }); + }); + } + } else { + ctx.once('error', cb); + + ctx.once('cursor', function(cursor) { + ctx.removeListener('error', cb); + if (cursor == null) { + return; + } + _next(ctx, cb); + }); + } +} + +/*! + * ignore + */ + +function _onNext(error, doc) { + if (error) { + return this.callback(error); + } + if (!doc) { + this.ctx._batchExhausted = true; + return _populateBatch.call(this); + } + + this.ctx._batchDocs.push(doc); + + if (this.ctx._batchDocs.length < this.ctx.options._populateBatchSize) { + // If both `batchSize` and `_populateBatchSize` are huge, calling `next()` repeatedly may + // cause a stack overflow. So make sure we clear the stack regularly. + if (this.ctx._batchDocs.length > 0 && this.ctx._batchDocs.length % 1000 === 0) { + return immediate(() => this.ctx.cursor.next(_onNext.bind(this))); + } + this.ctx.cursor.next(_onNext.bind(this)); + } else { + _populateBatch.call(this); + } +} + +/*! + * ignore + */ + +function _populateBatch() { + if (!this.ctx._batchDocs.length) { + return this.callback(null, null); + } + const _this = this; + this.ctx.query.model.populate(this.ctx._batchDocs, this.ctx._pop, function(err) { + if (err) { + return _this.callback(err); + } + + _nextDoc(_this.ctx, _this.ctx._batchDocs.shift(), _this.ctx._pop, _this.callback); + }); +} + +/*! + * ignore + */ + +function _nextDoc(ctx, doc, pop, callback) { + if (ctx.query._mongooseOptions.lean) { + return ctx.model.hooks.execPost('find', ctx.query, [[doc]], err => { + if (err != null) { + return callback(err); + } + callback(null, doc); + }); + } + + const { model, _fields, _userProvidedFields, options } = ctx.query; + helpers.createModelAndInit(model, doc, _fields, _userProvidedFields, options, pop, (err, doc) => { + if (err != null) { + return callback(err); + } + ctx.model.hooks.execPost('find', ctx.query, [[doc]], err => { + if (err != null) { + return callback(err); + } + callback(null, doc); + }); + }); +} + +/*! + * ignore + */ + +function _waitForCursor(ctx, cb) { + if (ctx.cursor) { + return cb(); + } + ctx.once('cursor', function(cursor) { + if (cursor == null) { + return; + } + cb(); + }); +} + +module.exports = QueryCursor; diff --git a/node_modules/mongoose/lib/document.js b/node_modules/mongoose/lib/document.js new file mode 100644 index 000000000..773d76f90 --- /dev/null +++ b/node_modules/mongoose/lib/document.js @@ -0,0 +1,4494 @@ +'use strict'; + +/*! + * Module dependencies. + */ + +const EventEmitter = require('events').EventEmitter; +const InternalCache = require('./internal'); +const MongooseError = require('./error/index'); +const MixedSchema = require('./schema/mixed'); +const ObjectExpectedError = require('./error/objectExpected'); +const ObjectParameterError = require('./error/objectParameter'); +const ParallelValidateError = require('./error/parallelValidate'); +const Schema = require('./schema'); +const StrictModeError = require('./error/strict'); +const ValidationError = require('./error/validation'); +const ValidatorError = require('./error/validator'); +const VirtualType = require('./virtualtype'); +const $__hasIncludedChildren = require('./helpers/projection/hasIncludedChildren'); +const promiseOrCallback = require('./helpers/promiseOrCallback'); +const cleanModifiedSubpaths = require('./helpers/document/cleanModifiedSubpaths'); +const compile = require('./helpers/document/compile').compile; +const defineKey = require('./helpers/document/compile').defineKey; +const flatten = require('./helpers/common').flatten; +const flattenObjectWithDottedPaths = require('./helpers/path/flattenObjectWithDottedPaths'); +const get = require('./helpers/get'); +const getEmbeddedDiscriminatorPath = require('./helpers/document/getEmbeddedDiscriminatorPath'); +const getKeysInSchemaOrder = require('./helpers/schema/getKeysInSchemaOrder'); +const handleSpreadDoc = require('./helpers/document/handleSpreadDoc'); +const immediate = require('./helpers/immediate'); +const isDefiningProjection = require('./helpers/projection/isDefiningProjection'); +const isExclusive = require('./helpers/projection/isExclusive'); +const inspect = require('util').inspect; +const internalToObjectOptions = require('./options').internalToObjectOptions; +const markArraySubdocsPopulated = require('./helpers/populate/markArraySubdocsPopulated'); +const mpath = require('mpath'); +const queryhelpers = require('./queryhelpers'); +const utils = require('./utils'); +const isPromise = require('./helpers/isPromise'); + +const clone = utils.clone; +const deepEqual = utils.deepEqual; +const isMongooseObject = utils.isMongooseObject; + +const arrayAtomicsBackupSymbol = require('./helpers/symbols').arrayAtomicsBackupSymbol; +const arrayAtomicsSymbol = require('./helpers/symbols').arrayAtomicsSymbol; +const documentArrayParent = require('./helpers/symbols').documentArrayParent; +const documentIsModified = require('./helpers/symbols').documentIsModified; +const documentModifiedPaths = require('./helpers/symbols').documentModifiedPaths; +const documentSchemaSymbol = require('./helpers/symbols').documentSchemaSymbol; +const getSymbol = require('./helpers/symbols').getSymbol; +const populateModelSymbol = require('./helpers/symbols').populateModelSymbol; +const scopeSymbol = require('./helpers/symbols').scopeSymbol; +const schemaMixedSymbol = require('./schema/symbols').schemaMixedSymbol; +const parentPaths = require('./helpers/path/parentPaths'); + +let DocumentArray; +let MongooseArray; +let Embedded; + +const specialProperties = utils.specialProperties; + +/** + * The core Mongoose document constructor. You should not call this directly, + * the Mongoose [Model constructor](./api.html#Model) calls this for you. + * + * @param {Object} obj the values to set + * @param {Object} [fields] optional object containing the fields which were selected in the query returning this document and any populated paths data + * @param {Object} [options] various configuration options for the document + * @param {Boolean} [options.defaults=true] if `false`, skip applying default values to this document. + * @inherits NodeJS EventEmitter https://nodejs.org/api/events.html#events_class_events_eventemitter + * @event `init`: Emitted on a document after it has been retrieved from the db and fully hydrated by Mongoose. + * @event `save`: Emitted when the document is successfully saved + * @api private + */ + +function Document(obj, fields, skipId, options) { + if (typeof skipId === 'object' && skipId != null) { + options = skipId; + skipId = options.skipId; + } + options = Object.assign({}, options); + + // Support `browserDocument.js` syntax + if (this.$__schema == null) { + const _schema = utils.isObject(fields) && !fields.instanceOfSchema ? + new Schema(fields) : + fields; + this.$__setSchema(_schema); + fields = skipId; + skipId = options; + options = arguments[4] || {}; + } + + this.$__ = new InternalCache(); + this.$isNew = 'isNew' in options ? options.isNew : true; + + if (options.priorDoc != null) { + this.$__.priorDoc = options.priorDoc; + } + + if (skipId) { + this.$__.skipId = skipId; + } + + if (obj != null && typeof obj !== 'object') { + throw new ObjectParameterError(obj, 'obj', 'Document'); + } + + let defaults = true; + if (options.defaults !== undefined) { + this.$__.defaults = options.defaults; + defaults = options.defaults; + } + + const schema = this.$__schema; + + if (typeof fields === 'boolean' || fields === 'throw') { + this.$__.strictMode = fields; + fields = undefined; + } else { + this.$__.strictMode = schema.options.strict; + if (fields != null) { + this.$__.selected = fields; + } + } + + const requiredPaths = schema.requiredPaths(true); + for (const path of requiredPaths) { + this.$__.activePaths.require(path); + } + + let exclude = null; + + // determine if this doc is a result of a query with + // excluded fields + if (utils.isPOJO(fields)) { + exclude = isExclusive(fields); + this.$__.fields = fields; + this.$__.exclude = exclude; + } + + const hasIncludedChildren = exclude === false && fields ? + $__hasIncludedChildren(fields) : + null; + + if (this._doc == null) { + this.$__buildDoc(obj, fields, skipId, exclude, hasIncludedChildren, false); + + // By default, defaults get applied **before** setting initial values + // Re: gh-6155 + if (defaults) { + $__applyDefaults(this, fields, exclude, hasIncludedChildren, true, null); + } + } + if (obj) { + // Skip set hooks + if (this.$__original_set) { + this.$__original_set(obj, undefined, true, options); + } else { + this.$set(obj, undefined, true, options); + } + + if (obj instanceof Document) { + this.$isNew = obj.$isNew; + } + } + + // Function defaults get applied **after** setting initial values so they + // see the full doc rather than an empty one, unless they opt out. + // Re: gh-3781, gh-6155 + if (options.willInit && defaults) { + if (options.skipDefaults) { + this.$__.skipDefaults = options.skipDefaults; + } + } else if (defaults) { + $__applyDefaults(this, fields, exclude, hasIncludedChildren, false, options.skipDefaults); + } + + if (!this.$__.strictMode && obj) { + const _this = this; + const keys = Object.keys(this._doc); + + keys.forEach(function(key) { + // Avoid methods, virtuals, existing fields, and `$` keys. The latter is to avoid overwriting + // Mongoose internals. + if (!(key in schema.tree) && !(key in schema.methods) && !(key in schema.virtuals) && !key.startsWith('$')) { + defineKey({ prop: key, subprops: null, prototype: _this }); + } + }); + } + + applyQueue(this); +} + +Object.defineProperty(Document.prototype, 'isNew', { + get: function() { + return this.$isNew; + }, + set: function(value) { + this.$isNew = value; + } +}); + +Object.defineProperty(Document.prototype, 'errors', { + get: function() { + return this.$errors; + }, + set: function(value) { + this.$errors = value; + } +}); +/*! + * Document exposes the NodeJS event emitter API, so you can use + * `on`, `once`, etc. + */ +utils.each( + ['on', 'once', 'emit', 'listeners', 'removeListener', 'setMaxListeners', + 'removeAllListeners', 'addListener'], + function(emitterFn) { + Document.prototype[emitterFn] = function() { + // Delay creating emitter until necessary because emitters take up a lot of memory, + // especially for subdocuments. + if (!this.$__.emitter) { + if (emitterFn === 'emit') { + return; + } + this.$__.emitter = new EventEmitter(); + this.$__.emitter.setMaxListeners(0); + } + return this.$__.emitter[emitterFn].apply(this.$__.emitter, arguments); + }; + Document.prototype[`$${emitterFn}`] = Document.prototype[emitterFn]; + }); + +Document.prototype.constructor = Document; + +for (const i in EventEmitter.prototype) { + Document[i] = EventEmitter.prototype[i]; +} + +/** + * The document's internal schema. + * + * @api private + * @property schema + * @memberOf Document + * @instance + */ + +Document.prototype.$__schema; + +/** + * The document's schema. + * + * @api public + * @property schema + * @memberOf Document + * @instance + */ + +Document.prototype.schema; + +/** + * Empty object that you can use for storing properties on the document. This + * is handy for passing data to middleware without conflicting with Mongoose + * internals. + * + * #### Example: + * + * schema.pre('save', function() { + * // Mongoose will set `isNew` to `false` if `save()` succeeds + * this.$locals.wasNew = this.isNew; + * }); + * + * schema.post('save', function() { + * // Prints true if `isNew` was set before `save()` + * console.log(this.$locals.wasNew); + * }); + * + * @api public + * @property $locals + * @memberOf Document + * @instance + */ + +Object.defineProperty(Document.prototype, '$locals', { + configurable: false, + enumerable: false, + get: function() { + if (this.$__.locals == null) { + this.$__.locals = {}; + } + return this.$__.locals; + }, + set: function(v) { + this.$__.locals = v; + } +}); + + +/** + * Boolean flag specifying if the document is new. + * + * @api public + * @property $isNew + * @memberOf Document + * @instance + */ + +Document.prototype.$isNew; + +/** + * Boolean flag specifying if the document is new. + * + * @api public + * @property isNew + * @memberOf Document + * @instance + */ + +Document.prototype.isNew; + +/** + * Set this property to add additional query filters when Mongoose saves this document and `isNew` is false. + * + * #### Example: + * + * // Make sure `save()` never updates a soft deleted document. + * schema.pre('save', function() { + * this.$where = { isDeleted: false }; + * }); + * + * @api public + * @property $where + * @memberOf Document + * @instance + */ + +Object.defineProperty(Document.prototype, '$where', { + configurable: false, + enumerable: false, + writable: true +}); + +/** + * The string version of this documents _id. + * + * #### Note: + * + * This getter exists on all documents by default. The getter can be disabled by setting the `id` [option](/docs/guide.html#id) of its `Schema` to false at construction time. + * + * new Schema({ name: String }, { id: false }); + * + * @api public + * @see Schema options /docs/guide.html#options + * @property id + * @memberOf Document + * @instance + */ + +Document.prototype.id; + +/** + * Hash containing current validation $errors. + * + * @api public + * @property $errors + * @memberOf Document + * @instance + */ + +Document.prototype.$errors; + +/** + * Hash containing current validation errors. + * + * @api public + * @property errors + * @memberOf Document + * @instance + */ + +Document.prototype.errors; + +/** + * A string containing the current operation that Mongoose is executing + * on this document. May be `null`, `'save'`, `'validate'`, or `'remove'`. + * + * #### Example: + * + * const doc = new Model({ name: 'test' }); + * doc.$op; // null + * + * const promise = doc.save(); + * doc.$op; // 'save' + * + * await promise; + * doc.$op; // null + * + * @api public + * @property $op + * @memberOf Document + * @instance + */ + +Object.defineProperty(Document.prototype, '$op', { + get: function() { + return this.$__.op || null; + }, + set: function(value) { + this.$__.op = value; + } +}); + +/*! + * ignore + */ + +function $__applyDefaults(doc, fields, exclude, hasIncludedChildren, isBeforeSetters, pathsToSkip) { + const paths = Object.keys(doc.$__schema.paths); + const plen = paths.length; + + for (let i = 0; i < plen; ++i) { + let def; + let curPath = ''; + const p = paths[i]; + + if (p === '_id' && doc.$__.skipId) { + continue; + } + + const type = doc.$__schema.paths[p]; + const path = type.splitPath(); + const len = path.length; + let included = false; + let doc_ = doc._doc; + for (let j = 0; j < len; ++j) { + if (doc_ == null) { + break; + } + + const piece = path[j]; + curPath += (!curPath.length ? '' : '.') + piece; + + if (exclude === true) { + if (curPath in fields) { + break; + } + } else if (exclude === false && fields && !included) { + const hasSubpaths = type.$isSingleNested || type.$isMongooseDocumentArray; + if (curPath in fields || (hasSubpaths && hasIncludedChildren != null && hasIncludedChildren[curPath])) { + included = true; + } else if (hasIncludedChildren != null && !hasIncludedChildren[curPath]) { + break; + } + } + + if (j === len - 1) { + if (doc_[piece] !== void 0) { + break; + } + + if (typeof type.defaultValue === 'function') { + if (!type.defaultValue.$runBeforeSetters && isBeforeSetters) { + break; + } + if (type.defaultValue.$runBeforeSetters && !isBeforeSetters) { + break; + } + } else if (!isBeforeSetters) { + // Non-function defaults should always run **before** setters + continue; + } + + if (pathsToSkip && pathsToSkip[curPath]) { + break; + } + + if (fields && exclude !== null) { + if (exclude === true) { + // apply defaults to all non-excluded fields + if (p in fields) { + continue; + } + + try { + def = type.getDefault(doc, false); + } catch (err) { + doc.invalidate(p, err); + break; + } + + if (typeof def !== 'undefined') { + doc_[piece] = def; + doc.$__.activePaths.default(p); + } + } else if (included) { + // selected field + try { + def = type.getDefault(doc, false); + } catch (err) { + doc.invalidate(p, err); + break; + } + + if (typeof def !== 'undefined') { + doc_[piece] = def; + doc.$__.activePaths.default(p); + } + } + } else { + try { + def = type.getDefault(doc, false); + } catch (err) { + doc.invalidate(p, err); + break; + } + + if (typeof def !== 'undefined') { + doc_[piece] = def; + doc.$__.activePaths.default(p); + } + } + } else { + doc_ = doc_[piece]; + } + } + } +} + +/*! + * ignore + */ + +function $applyDefaultsToNested(val, path, doc) { + if (val == null) { + return; + } + + flattenObjectWithDottedPaths(val); + + const paths = Object.keys(doc.$__schema.paths); + const plen = paths.length; + + const pathPieces = path.indexOf('.') === -1 ? [path] : path.split('.'); + + for (let i = 0; i < plen; ++i) { + let curPath = ''; + const p = paths[i]; + + if (!p.startsWith(path + '.')) { + continue; + } + + const type = doc.$__schema.paths[p]; + const pieces = type.splitPath().slice(pathPieces.length); + const len = pieces.length; + + if (type.defaultValue === void 0) { + continue; + } + + let cur = val; + + for (let j = 0; j < len; ++j) { + if (cur == null) { + break; + } + + const piece = pieces[j]; + + if (j === len - 1) { + if (cur[piece] !== void 0) { + break; + } + + try { + const def = type.getDefault(doc, false); + if (def !== void 0) { + cur[piece] = def; + } + } catch (err) { + doc.invalidate(path + '.' + curPath, err); + break; + } + + break; + } + + curPath += (!curPath.length ? '' : '.') + piece; + + cur[piece] = cur[piece] || {}; + cur = cur[piece]; + } + } +} + +/** + * Builds the default doc structure + * + * @param {Object} obj + * @param {Object} [fields] + * @param {Boolean} [skipId] + * @api private + * @method $__buildDoc + * @memberOf Document + * @instance + */ + +Document.prototype.$__buildDoc = function(obj, fields, skipId, exclude, hasIncludedChildren) { + const doc = {}; + + const paths = Object.keys(this.$__schema.paths). + // Don't build up any paths that are underneath a map, we don't know + // what the keys will be + filter(p => !p.includes('$*')); + const plen = paths.length; + let ii = 0; + + for (; ii < plen; ++ii) { + const p = paths[ii]; + + if (p === '_id') { + if (skipId) { + continue; + } + if (obj && '_id' in obj) { + continue; + } + } + + const path = this.$__schema.paths[p].splitPath(); + const len = path.length; + const last = len - 1; + let curPath = ''; + let doc_ = doc; + let included = false; + + for (let i = 0; i < len; ++i) { + const piece = path[i]; + + if (!curPath.length) { + curPath = piece; + } else { + curPath += '.' + piece; + } + + // support excluding intermediary levels + if (exclude === true) { + if (curPath in fields) { + break; + } + } else if (exclude === false && fields && !included) { + if (curPath in fields) { + included = true; + } else if (!hasIncludedChildren[curPath]) { + break; + } + } + + if (i < last) { + doc_ = doc_[piece] || (doc_[piece] = {}); + } + } + } + + this._doc = doc; +}; + +/*! + * Converts to POJO when you use the document for querying + */ + +Document.prototype.toBSON = function() { + return this.toObject(internalToObjectOptions); +}; + +/** + * Initializes the document without setters or marking anything modified. + * + * Called internally after a document is returned from mongodb. Normally, + * you do **not** need to call this function on your own. + * + * This function triggers `init` [middleware](/docs/middleware.html). + * Note that `init` hooks are [synchronous](/docs/middleware.html#synchronous). + * + * @param {Object} doc document returned by mongo + * @api public + * @memberOf Document + * @instance + */ + +Document.prototype.init = function(doc, opts, fn) { + if (typeof opts === 'function') { + fn = opts; + opts = null; + } + + this.$__init(doc, opts); + + if (fn) { + fn(null, this); + } + + return this; +}; + +Document.prototype.$init = function() { + return this.constructor.prototype.init.apply(this, arguments); +}; + +Document.prototype.$__init = function(doc, opts) { + this.$isNew = false; + opts = opts || {}; + + // handle docs with populated paths + // If doc._id is not null or undefined + if (doc._id != null && opts.populated && opts.populated.length) { + const id = String(doc._id); + for (const item of opts.populated) { + if (item.isVirtual) { + this.$populated(item.path, utils.getValue(item.path, doc), item); + } else { + this.$populated(item.path, item._docs[id], item); + } + + if (item._childDocs == null) { + continue; + } + for (const child of item._childDocs) { + if (child == null || child.$__ == null) { + continue; + } + child.$__.parent = this; + } + item._childDocs = []; + } + } + + init(this, doc, this._doc, opts); + + markArraySubdocsPopulated(this, opts.populated); + + this.$emit('init', this); + this.constructor.emit('init', this); + + const hasIncludedChildren = this.$__.exclude === false && this.$__.fields ? + $__hasIncludedChildren(this.$__.fields) : + null; + $__applyDefaults(this, this.$__.fields, this.$__.exclude, hasIncludedChildren, false, this.$__.skipDefaults); + + return this; +}; + +/*! + * Init helper. + * + * @param {Object} self document instance + * @param {Object} obj raw mongodb doc + * @param {Object} doc object we are initializing + * @api private + */ + +function init(self, obj, doc, opts, prefix) { + prefix = prefix || ''; + + const keys = Object.keys(obj); + const len = keys.length; + let schemaType; + let path; + let i; + let index = 0; + const strict = self.$__.strictMode; + const docSchema = self.$__schema; + + while (index < len) { + _init(index++); + } + + function _init(index) { + i = keys[index]; + path = prefix + i; + schemaType = docSchema.path(path); + + // Should still work if not a model-level discriminator, but should not be + // necessary. This is *only* to catch the case where we queried using the + // base model and the discriminated model has a projection + if (docSchema.$isRootDiscriminator && !self.$__isSelected(path)) { + return; + } + + if (!schemaType && utils.isPOJO(obj[i])) { + // assume nested object + if (!doc[i]) { + doc[i] = {}; + if (!strict && !(i in docSchema.tree) && !(i in docSchema.methods) && !(i in docSchema.virtuals)) { + self[i] = doc[i]; + } + } + init(self, obj[i], doc[i], opts, path + '.'); + } else if (!schemaType) { + doc[i] = obj[i]; + if (!strict && !prefix) { + self[i] = obj[i]; + } + } else { + // Retain order when overwriting defaults + if (doc.hasOwnProperty(i) && obj[i] !== void 0) { + delete doc[i]; + } + if (obj[i] === null) { + doc[i] = schemaType._castNullish(null); + } else if (obj[i] !== undefined) { + const wasPopulated = obj[i].$__ == null ? null : obj[i].$__.wasPopulated; + + if (schemaType && !wasPopulated) { + try { + doc[i] = schemaType.cast(obj[i], self, true); + } catch (e) { + self.invalidate(e.path, new ValidatorError({ + path: e.path, + message: e.message, + type: 'cast', + value: e.value, + reason: e + })); + } + } else { + doc[i] = obj[i]; + } + } + // mark as hydrated + if (!self.$isModified(path)) { + self.$__.activePaths.init(path); + } + } + } +} + +/** + * Sends an update command with this document `_id` as the query selector. + * + * #### Example: + * + * weirdCar.update({$inc: {wheels:1}}, { w: 1 }, callback); + * + * #### Valid options: + * + * - same as in [Model.update](#model_Model.update) + * + * @see Model.update #model_Model.update + * @param {Object} doc + * @param {Object} options + * @param {Function} callback + * @return {Query} + * @api public + * @memberOf Document + * @instance + */ + +Document.prototype.update = function update() { + const args = [...arguments]; + args.unshift({ _id: this._id }); + const query = this.constructor.update.apply(this.constructor, args); + + if (this.$session() != null) { + if (!('session' in query.options)) { + query.options.session = this.$session(); + } + } + + return query; +}; + +/** + * Sends an updateOne command with this document `_id` as the query selector. + * + * #### Example: + * + * weirdCar.updateOne({$inc: {wheels:1}}, { w: 1 }, callback); + * + * #### Valid options: + * + * - same as in [Model.updateOne](#model_Model.updateOne) + * + * @see Model.updateOne #model_Model.updateOne + * @param {Object} doc + * @param {Object} [options] optional see [`Query.prototype.setOptions()`](https://mongoosejs.com/docs/api.html#query_Query-setOptions) + * @param {Object} [options.lean] if truthy, mongoose will return the document as a plain JavaScript object rather than a mongoose document. See [`Query.lean()`](/docs/api.html#query_Query-lean) and the [Mongoose lean tutorial](/docs/tutorials/lean.html). + * @param {Boolean|String} [options.strict] overwrites the schema's [strict mode option](https://mongoosejs.com/docs/guide.html#strict) + * @param {Boolean} [options.timestamps=null] If set to `false` and [schema-level timestamps](/docs/guide.html#timestamps) are enabled, skip timestamps for this update. Note that this allows you to overwrite timestamps. Does nothing if schema-level timestamps are not set. + * @param {Function} callback + * @return {Query} + * @api public + * @memberOf Document + * @instance + */ + +Document.prototype.updateOne = function updateOne(doc, options, callback) { + const query = this.constructor.updateOne({ _id: this._id }, doc, options); + query.pre(cb => { + this.constructor._middleware.execPre('updateOne', this, [this], cb); + }); + query.post(cb => { + this.constructor._middleware.execPost('updateOne', this, [this], {}, cb); + }); + + if (this.$session() != null) { + if (!('session' in query.options)) { + query.options.session = this.$session(); + } + } + + if (callback != null) { + return query.exec(callback); + } + + return query; +}; + +/** + * Sends a replaceOne command with this document `_id` as the query selector. + * + * #### Valid options: + * + * - same as in [Model.replaceOne](https://mongoosejs.com/docs/api/model.html#model_Model.replaceOne) + * + * @see Model.replaceOne #model_Model.replaceOne + * @param {Object} doc + * @param {Object} options + * @param {Function} callback + * @return {Query} + * @api public + * @memberOf Document + * @instance + */ + +Document.prototype.replaceOne = function replaceOne() { + const args = [...arguments]; + args.unshift({ _id: this._id }); + return this.constructor.replaceOne.apply(this.constructor, args); +}; + +/** + * Getter/setter around the session associated with this document. Used to + * automatically set `session` if you `save()` a doc that you got from a + * query with an associated session. + * + * #### Example: + * + * const session = MyModel.startSession(); + * const doc = await MyModel.findOne().session(session); + * doc.$session() === session; // true + * doc.$session(null); + * doc.$session() === null; // true + * + * If this is a top-level document, setting the session propagates to all child + * docs. + * + * @param {ClientSession} [session] overwrite the current session + * @return {ClientSession} + * @method $session + * @api public + * @memberOf Document + */ + +Document.prototype.$session = function $session(session) { + if (arguments.length === 0) { + if (this.$__.session != null && this.$__.session.hasEnded) { + this.$__.session = null; + return null; + } + return this.$__.session; + } + + if (session != null && session.hasEnded) { + throw new MongooseError('Cannot set a document\'s session to a session that has ended. Make sure you haven\'t ' + + 'called `endSession()` on the session you are passing to `$session()`.'); + } + + if (session == null && this.$__.session == null) { + return; + } + + this.$__.session = session; + + if (!this.$isSubdocument) { + const subdocs = this.$getAllSubdocs(); + for (const child of subdocs) { + child.$session(session); + } + } + + return session; +}; + +/** + * Overwrite all values in this document with the values of `obj`, except + * for immutable properties. Behaves similarly to `set()`, except for it + * unsets all properties that aren't in `obj`. + * + * @param {Object} obj the object to overwrite this document with + * @method overwrite + * @name overwrite + * @memberOf Document + * @instance + * @api public + */ + +Document.prototype.overwrite = function overwrite(obj) { + const keys = Array.from(new Set(Object.keys(this._doc).concat(Object.keys(obj)))); + + for (const key of keys) { + if (key === '_id') { + continue; + } + // Explicitly skip version key + if (this.$__schema.options.versionKey && key === this.$__schema.options.versionKey) { + continue; + } + if (this.$__schema.options.discriminatorKey && key === this.$__schema.options.discriminatorKey) { + continue; + } + this.$set(key, obj[key]); + } + + return this; +}; + +/** + * Alias for `set()`, used internally to avoid conflicts + * + * @param {String|Object} path path or object of key/vals to set + * @param {Any} val the value to set + * @param {Schema|String|Number|Buffer|*} [type] optionally specify a type for "on-the-fly" attributes + * @param {Object} [options] optionally specify options that modify the behavior of the set + * @method $set + * @name $set + * @memberOf Document + * @instance + * @api public + */ + +Document.prototype.$set = function $set(path, val, type, options) { + if (utils.isPOJO(type)) { + options = type; + type = undefined; + } + + const merge = options && options.merge; + const adhoc = type && type !== true; + const constructing = type === true; + let adhocs; + let keys; + let i = 0; + let pathtype; + let key; + let prefix; + + const strict = options && 'strict' in options + ? options.strict + : this.$__.strictMode; + + if (adhoc) { + adhocs = this.$__.adhocPaths || (this.$__.adhocPaths = {}); + adhocs[path] = this.$__schema.interpretAsType(path, type, this.$__schema.options); + } + + if (path == null) { + [path, val] = [val, path]; + } else if (typeof path !== 'string') { + // new Document({ key: val }) + if (path instanceof Document) { + if (path.$__isNested) { + path = path.toObject(); + } else { + path = path._doc; + } + } + if (path == null) { + [path, val] = [val, path]; + } + + prefix = val ? val + '.' : ''; + keys = getKeysInSchemaOrder(this.$__schema, path); + + const len = keys.length; + + // `_skipMinimizeTopLevel` is because we may have deleted the top-level + // nested key to ensure key order. + const _skipMinimizeTopLevel = options && options._skipMinimizeTopLevel || false; + if (len === 0 && _skipMinimizeTopLevel) { + delete options._skipMinimizeTopLevel; + if (val) { + this.$set(val, {}); + } + return this; + } + + for (let i = 0; i < len; ++i) { + key = keys[i]; + const pathName = prefix + key; + pathtype = this.$__schema.pathType(pathName); + const valForKey = path[key]; + + // On initial set, delete any nested keys if we're going to overwrite + // them to ensure we keep the user's key order. + if (type === true && + !prefix && + valForKey != null && + pathtype === 'nested' && + this._doc[key] != null) { + delete this._doc[key]; + // Make sure we set `{}` back even if we minimize re: gh-8565 + options = Object.assign({}, options, { _skipMinimizeTopLevel: true }); + } else { + // Make sure we set `{_skipMinimizeTopLevel: false}` if don't have overwrite: gh-10441 + options = Object.assign({}, options, { _skipMinimizeTopLevel: false }); + } + + if (utils.isNonBuiltinObject(valForKey) && pathtype === 'nested') { + $applyDefaultsToNested(path[key], prefix + key, this); + this.$set(prefix + key, path[key], constructing, Object.assign({}, options, { _skipMarkModified: true })); + continue; + } else if (strict) { + // Don't overwrite defaults with undefined keys (gh-3981) (gh-9039) + if (constructing && path[key] === void 0 && + this.$get(pathName) !== void 0) { + continue; + } + + if (pathtype === 'adhocOrUndefined') { + pathtype = getEmbeddedDiscriminatorPath(this, pathName, { typeOnly: true }); + } + + if (pathtype === 'real' || pathtype === 'virtual') { + const p = path[key]; + this.$set(prefix + key, p, constructing, options); + } else if (pathtype === 'nested' && path[key] instanceof Document) { + this.$set(prefix + key, + path[key].toObject({ transform: false }), constructing, options); + } else if (strict === 'throw') { + if (pathtype === 'nested') { + throw new ObjectExpectedError(key, path[key]); + } else { + throw new StrictModeError(key); + } + } + } else if (path[key] !== void 0) { + this.$set(prefix + key, path[key], constructing, options); + } + } + + // Ensure all properties are in correct order + const orderedDoc = {}; + const orderedKeys = Object.keys(this.$__schema.tree); + for (let i = 0, len = orderedKeys.length; i < len; ++i) { + (key = orderedKeys[i]) && + (this._doc.hasOwnProperty(key)) && + (orderedDoc[key] = undefined); + } + this._doc = Object.assign(orderedDoc, this._doc); + + return this; + } + + let pathType = this.$__schema.pathType(path); + if (pathType === 'adhocOrUndefined') { + pathType = getEmbeddedDiscriminatorPath(this, path, { typeOnly: true }); + } + + // Assume this is a Mongoose document that was copied into a POJO using + // `Object.assign()` or `{...doc}` + val = handleSpreadDoc(val); + + // if this doc is being constructed we should not trigger getters + const priorVal = (() => { + if (this.$__.priorDoc != null) { + return this.$__.priorDoc.$__getValue(path); + } + if (constructing) { + return void 0; + } + return this.$__getValue(path); + })(); + + if (pathType === 'nested' && val) { + if (typeof val === 'object' && val != null) { + if (val.$__ != null) { + val = val.toObject(internalToObjectOptions); + } + if (val == null) { + this.invalidate(path, new MongooseError.CastError('Object', val, path)); + return this; + } + const hasInitialVal = this.$__.savedState != null && this.$__.savedState.hasOwnProperty(path); + if (this.$__.savedState != null && !this.$isNew && !this.$__.savedState.hasOwnProperty(path)) { + const initialVal = this.$__getValue(path); + this.$__.savedState[path] = initialVal; + + const keys = Object.keys(initialVal || {}); + for (const key of keys) { + this.$__.savedState[path + '.' + key] = initialVal[key]; + } + } + + if (!merge) { + this.$__setValue(path, null); + cleanModifiedSubpaths(this, path); + } else { + return this.$set(val, path, constructing); + } + + const keys = getKeysInSchemaOrder(this.$__schema, val, path); + + this.$__setValue(path, {}); + for (const key of keys) { + this.$set(path + '.' + key, val[key], constructing, options); + } + if (priorVal != null && utils.deepEqual(hasInitialVal ? this.$__.savedState[path] : priorVal, val)) { + this.unmarkModified(path); + } else { + this.markModified(path); + } + return this; + } + this.invalidate(path, new MongooseError.CastError('Object', val, path)); + return this; + } + + let schema; + const parts = path.indexOf('.') === -1 ? [path] : path.split('.'); + + // Might need to change path for top-level alias + if (typeof this.$__schema.aliases[parts[0]] === 'string') { + parts[0] = this.$__schema.aliases[parts[0]]; + } + + if (pathType === 'adhocOrUndefined' && strict) { + // check for roots that are Mixed types + let mixed; + + for (i = 0; i < parts.length; ++i) { + const subpath = parts.slice(0, i + 1).join('.'); + + // If path is underneath a virtual, bypass everything and just set it. + if (i + 1 < parts.length && this.$__schema.pathType(subpath) === 'virtual') { + mpath.set(path, val, this); + return this; + } + + schema = this.$__schema.path(subpath); + if (schema == null) { + continue; + } + + if (schema instanceof MixedSchema) { + // allow changes to sub paths of mixed types + mixed = true; + break; + } + } + + if (schema == null) { + // Check for embedded discriminators + schema = getEmbeddedDiscriminatorPath(this, path); + } + + if (!mixed && !schema) { + if (strict === 'throw') { + throw new StrictModeError(path); + } + return this; + } + } else if (pathType === 'virtual') { + schema = this.$__schema.virtualpath(path); + schema.applySetters(val, this); + return this; + } else { + schema = this.$__path(path); + } + + // gh-4578, if setting a deeply nested path that doesn't exist yet, create it + let cur = this._doc; + let curPath = ''; + for (i = 0; i < parts.length - 1; ++i) { + cur = cur[parts[i]]; + curPath += (curPath.length !== 0 ? '.' : '') + parts[i]; + if (!cur) { + this.$set(curPath, {}); + // Hack re: gh-5800. If nested field is not selected, it probably exists + // so `MongoServerError: cannot use the part (nested of nested.num) to + // traverse the element ({nested: null})` is not likely. If user gets + // that error, its their fault for now. We should reconsider disallowing + // modifying not selected paths for 6.x + if (!this.$__isSelected(curPath)) { + this.unmarkModified(curPath); + } + cur = this.$__getValue(curPath); + } + } + + let pathToMark; + + // When using the $set operator the path to the field must already exist. + // Else mongodb throws: "LEFT_SUBFIELD only supports Object" + + if (parts.length <= 1) { + pathToMark = path; + } else { + const len = parts.length; + for (i = 0; i < len; ++i) { + const subpath = parts.slice(0, i + 1).join('.'); + if (this.$get(subpath, null, { getters: false }) === null) { + pathToMark = subpath; + break; + } + } + + if (!pathToMark) { + pathToMark = path; + } + } + + if (!schema) { + this.$__set(pathToMark, path, options, constructing, parts, schema, val, priorVal); + + if (pathType === 'nested' && val == null) { + cleanModifiedSubpaths(this, path); + } + return this; + } + + // If overwriting a subdocument path, make sure to clear out + // any errors _before_ setting, so new errors that happen + // get persisted. Re: #9080 + if (schema.$isSingleNested || schema.$isMongooseArray) { + _markValidSubpaths(this, path); + } + + if (val != null && merge && schema.$isSingleNested) { + if (val instanceof Document) { + val = val.toObject({ virtuals: false, transform: false }); + } + const keys = Object.keys(val); + for (const key of keys) { + this.$set(path + '.' + key, val[key], constructing, options); + } + + return this; + } + + let shouldSet = true; + try { + // If the user is trying to set a ref path to a document with + // the correct model name, treat it as populated + const refMatches = (() => { + if (schema.options == null) { + return false; + } + if (!(val instanceof Document)) { + return false; + } + const model = val.constructor; + + // Check ref + const ref = schema.options.ref; + if (ref != null && (ref === model.modelName || ref === model.baseModelName)) { + return true; + } + + // Check refPath + const refPath = schema.options.refPath; + if (refPath == null) { + return false; + } + const modelName = val.get(refPath); + return modelName === model.modelName || modelName === model.baseModelName; + })(); + + let didPopulate = false; + if (refMatches && val instanceof Document && (!val.$__.wasPopulated || utils.deepEqual(val.$__.wasPopulated.value, val._id))) { + const unpopulatedValue = (schema && schema.$isSingleNested) ? schema.cast(val, this) : val._id; + this.$populated(path, unpopulatedValue, { [populateModelSymbol]: val.constructor }); + val.$__.wasPopulated = { value: unpopulatedValue }; + didPopulate = true; + } + + let popOpts; + const typeKey = this.$__schema.options.typeKey; + if (schema.options && + Array.isArray(schema.options[typeKey]) && + schema.options[typeKey].length && + schema.options[typeKey][0].ref && + _isManuallyPopulatedArray(val, schema.options[typeKey][0].ref)) { + popOpts = { [populateModelSymbol]: val[0].constructor }; + this.$populated(path, val.map(function(v) { return v._id; }), popOpts); + + for (const doc of val) { + doc.$__.wasPopulated = { value: doc._id }; + } + didPopulate = true; + } + + if (this.$__schema.singleNestedPaths[path] == null && (!refMatches || !schema.$isSingleNested || !val.$__)) { + // If this path is underneath a single nested schema, we'll call the setter + // later in `$__set()` because we don't take `_doc` when we iterate through + // a single nested doc. That's to make sure we get the correct context. + // Otherwise we would double-call the setter, see gh-7196. + val = schema.applySetters(val, this, false, priorVal, options); + } + + if (Array.isArray(val) && + !Array.isArray(schema) && + schema.$isMongooseDocumentArray && + val.length !== 0 && + val[0] != null && + val[0].$__ != null && + val[0].$__.populated != null) { + const populatedPaths = Object.keys(val[0].$__.populated); + for (const populatedPath of populatedPaths) { + this.$populated(path + '.' + populatedPath, + val.map(v => v.$populated(populatedPath)), + val[0].$__.populated[populatedPath].options); + } + didPopulate = true; + } + + if (!didPopulate && this.$__.populated) { + // If this array partially contains populated documents, convert them + // all to ObjectIds re: #8443 + if (Array.isArray(val) && this.$__.populated[path]) { + for (let i = 0; i < val.length; ++i) { + if (val[i] instanceof Document) { + val.set(i, val[i]._id, true); + } + } + } + delete this.$__.populated[path]; + } + + if (val != null && schema.$isSingleNested) { + _checkImmutableSubpaths(val, schema, priorVal); + } + + this.$markValid(path); + } catch (e) { + if (e instanceof MongooseError.StrictModeError && e.isImmutableError) { + this.invalidate(path, e); + } else if (e instanceof MongooseError.CastError) { + this.invalidate(e.path, e); + if (e.$originalErrorPath) { + this.invalidate(path, + new MongooseError.CastError(schema.instance, val, path, e.$originalErrorPath)); + } + } else { + this.invalidate(path, + new MongooseError.CastError(schema.instance, val, path, e)); + } + shouldSet = false; + } + + if (shouldSet) { + let savedState = null; + let savedStatePath = null; + if (!constructing) { + const doc = this.$isSubdocument ? this.ownerDocument() : this; + savedState = doc.$__.savedState; + savedStatePath = this.$isSubdocument ? this.$__.fullPath + '.' + path : path; + if (savedState != null) { + const firstDot = savedStatePath.indexOf('.'); + const topLevelPath = firstDot === -1 ? savedStatePath : savedStatePath.slice(0, firstDot); + if (!savedState.hasOwnProperty(topLevelPath)) { + savedState[topLevelPath] = utils.clone(doc.$__getValue(topLevelPath)); + } + } + } + + this.$__set(pathToMark, path, options, constructing, parts, schema, val, priorVal); + + if (savedState != null && savedState.hasOwnProperty(savedStatePath) && utils.deepEqual(val, savedState[savedStatePath])) { + this.unmarkModified(path); + } + } + + if (schema.$isSingleNested && (this.isDirectModified(path) || val == null)) { + cleanModifiedSubpaths(this, path); + } + + return this; +}; + +/*! + * ignore + */ + +function _isManuallyPopulatedArray(val, ref) { + if (!Array.isArray(val)) { + return false; + } + if (val.length === 0) { + return false; + } + + for (const el of val) { + if (!(el instanceof Document)) { + return false; + } + const modelName = el.constructor.modelName; + if (modelName == null) { + return false; + } + if (el.constructor.modelName != ref && el.constructor.baseModelName != ref) { + return false; + } + } + + return true; +} + +/** + * Sets the value of a path, or many paths. + * + * #### Example: + * + * // path, value + * doc.set(path, value) + * + * // object + * doc.set({ + * path : value + * , path2 : { + * path : value + * } + * }) + * + * // on-the-fly cast to number + * doc.set(path, value, Number) + * + * // on-the-fly cast to string + * doc.set(path, value, String) + * + * // changing strict mode behavior + * doc.set(path, value, { strict: false }); + * + * @param {String|Object} path path or object of key/vals to set + * @param {Any} val the value to set + * @param {Schema|String|Number|Buffer|*} [type] optionally specify a type for "on-the-fly" attributes + * @param {Object} [options] optionally specify options that modify the behavior of the set + * @api public + * @method set + * @memberOf Document + * @instance + */ + +Document.prototype.set = Document.prototype.$set; + +/** + * Determine if we should mark this change as modified. + * + * @return {Boolean} + * @api private + * @method $__shouldModify + * @memberOf Document + * @instance + */ + +Document.prototype.$__shouldModify = function(pathToMark, path, options, constructing, parts, schema, val, priorVal) { + if (options && options._skipMarkModified) { + return false; + } + if (this.$isNew) { + return true; + } + + // Re: the note about gh-7196, `val` is the raw value without casting or + // setters if the full path is under a single nested subdoc because we don't + // want to double run setters. So don't set it as modified. See gh-7264. + if (this.$__schema.singleNestedPaths[path] != null) { + return false; + } + + if (val === void 0 && !this.$__isSelected(path)) { + // when a path is not selected in a query, its initial + // value will be undefined. + return true; + } + + if (val === void 0 && path in this.$__.activePaths.states.default) { + // we're just unsetting the default value which was never saved + return false; + } + + // gh-3992: if setting a populated field to a doc, don't mark modified + // if they have the same _id + if (this.$populated(path) && + val instanceof Document && + deepEqual(val._id, priorVal)) { + return false; + } + + if (!deepEqual(val, priorVal || utils.getValue(path, this))) { + return true; + } + + if (!constructing && + val !== null && + val !== undefined && + path in this.$__.activePaths.states.default && + deepEqual(val, schema.getDefault(this, constructing))) { + // a path with a default was $unset on the server + // and the user is setting it to the same value again + return true; + } + return false; +}; + +/** + * Handles the actual setting of the value and marking the path modified if appropriate. + * + * @api private + * @method $__set + * @memberOf Document + * @instance + */ + +Document.prototype.$__set = function(pathToMark, path, options, constructing, parts, schema, val, priorVal) { + Embedded = Embedded || require('./types/ArraySubdocument'); + + const shouldModify = this.$__shouldModify(pathToMark, path, options, constructing, parts, + schema, val, priorVal); + + if (shouldModify) { + this.markModified(pathToMark); + + // handle directly setting arrays (gh-1126) + MongooseArray || (MongooseArray = require('./types/array')); + if (val && utils.isMongooseArray(val)) { + val._registerAtomic('$set', val); + + // Update embedded document parent references (gh-5189) + if (utils.isMongooseDocumentArray(val)) { + val.forEach(function(item) { + item && item.__parentArray && (item.__parentArray = val); + }); + } + } + } else if (Array.isArray(val) && Array.isArray(priorVal) && utils.isMongooseArray(val) && utils.isMongooseArray(priorVal)) { + val[arrayAtomicsSymbol] = priorVal[arrayAtomicsSymbol]; + val[arrayAtomicsBackupSymbol] = priorVal[arrayAtomicsBackupSymbol]; + if (utils.isMongooseDocumentArray(val)) { + val.forEach(doc => { doc.isNew = false; }); + } + } + + let obj = this._doc; + let i = 0; + const l = parts.length; + let cur = ''; + + for (; i < l; i++) { + const next = i + 1; + const last = next === l; + cur += (cur ? '.' + parts[i] : parts[i]); + if (specialProperties.has(parts[i])) { + return; + } + + if (last) { + if (obj instanceof Map) { + obj.set(parts[i], val); + } else { + obj[parts[i]] = val; + } + } else { + if (utils.isPOJO(obj[parts[i]])) { + obj = obj[parts[i]]; + } else if (obj[parts[i]] && obj[parts[i]] instanceof Embedded) { + obj = obj[parts[i]]; + } else if (obj[parts[i]] && !Array.isArray(obj[parts[i]]) && obj[parts[i]].$isSingleNested) { + obj = obj[parts[i]]; + } else if (obj[parts[i]] && Array.isArray(obj[parts[i]])) { + obj = obj[parts[i]]; + } else { + obj[parts[i]] = obj[parts[i]] || {}; + obj = obj[parts[i]]; + } + } + } +}; + +/** + * Gets a raw value from a path (no getters) + * + * @param {String} path + * @api private + */ + +Document.prototype.$__getValue = function(path) { + return utils.getValue(path, this._doc); +}; + +/** + * Sets a raw value for a path (no casting, setters, transformations) + * + * @param {String} path + * @param {Object} value + * @api private + */ + +Document.prototype.$__setValue = function(path, val) { + utils.setValue(path, val, this._doc); + return this; +}; + +/** + * Returns the value of a path. + * + * #### Example + * + * // path + * doc.get('age') // 47 + * + * // dynamic casting to a string + * doc.get('age', String) // "47" + * + * @param {String} path + * @param {Schema|String|Number|Buffer|*} [type] optionally specify a type for on-the-fly attributes + * @param {Object} [options] + * @param {Boolean} [options.virtuals=false] Apply virtuals before getting this path + * @param {Boolean} [options.getters=true] If false, skip applying getters and just get the raw value + * @api public + */ + +Document.prototype.get = function(path, type, options) { + let adhoc; + options = options || {}; + if (type) { + adhoc = this.$__schema.interpretAsType(path, type, this.$__schema.options); + } + + let schema = this.$__path(path); + if (schema == null) { + schema = this.$__schema.virtualpath(path); + } + if (schema instanceof MixedSchema) { + const virtual = this.$__schema.virtualpath(path); + if (virtual != null) { + schema = virtual; + } + } + const pieces = path.indexOf('.') === -1 ? [path] : path.split('.'); + let obj = this._doc; + + if (schema instanceof VirtualType) { + return schema.applyGetters(void 0, this); + } + + // Might need to change path for top-level alias + if (typeof this.$__schema.aliases[pieces[0]] === 'string') { + pieces[0] = this.$__schema.aliases[pieces[0]]; + } + + for (let i = 0, l = pieces.length; i < l; i++) { + if (obj && obj._doc) { + obj = obj._doc; + } + + if (obj == null) { + obj = void 0; + } else if (obj instanceof Map) { + obj = obj.get(pieces[i], { getters: false }); + } else if (i === l - 1) { + obj = utils.getValue(pieces[i], obj); + } else { + obj = obj[pieces[i]]; + } + } + + if (adhoc) { + obj = adhoc.cast(obj); + } + + if (schema != null && options.getters !== false) { + obj = schema.applyGetters(obj, this); + } else if (this.$__schema.nested[path] && options.virtuals) { + // Might need to apply virtuals if this is a nested path + return applyVirtuals(this, utils.clone(obj) || {}, { path: path }); + } + + return obj; +}; + +/*! + * ignore + */ + +Document.prototype[getSymbol] = Document.prototype.get; +Document.prototype.$get = Document.prototype.get; +/** + * Returns the schematype for the given `path`. + * + * @param {String} path + * @api private + * @method $__path + * @memberOf Document + * @instance + */ + +Document.prototype.$__path = function(path) { + const adhocs = this.$__.adhocPaths; + const adhocType = adhocs && adhocs.hasOwnProperty(path) ? adhocs[path] : null; + + if (adhocType) { + return adhocType; + } + return this.$__schema.path(path); +}; + +/** + * Marks the path as having pending changes to write to the db. + * + * _Very helpful when using [Mixed](https://mongoosejs.com/docs/schematypes.html#mixed) types._ + * + * #### Example: + * + * doc.mixed.type = 'changed'; + * doc.markModified('mixed.type'); + * doc.save() // changes to mixed.type are now persisted + * + * @param {String} path the path to mark modified + * @param {Document} [scope] the scope to run validators with + * @api public + */ + +Document.prototype.markModified = function(path, scope) { + this.$__.activePaths.modify(path); + if (scope != null && !this.$isSubdocument) { + this.$__.pathsToScopes = this.$__pathsToScopes || {}; + this.$__.pathsToScopes[path] = scope; + } +}; + +/** + * Clears the modified state on the specified path. + * + * #### Example: + * + * doc.foo = 'bar'; + * doc.unmarkModified('foo'); + * doc.save(); // changes to foo will not be persisted + * + * @param {String} path the path to unmark modified + * @api public + */ + +Document.prototype.unmarkModified = function(path) { + this.$__.activePaths.init(path); + if (this.$__.pathsToScopes != null) { + delete this.$__.pathsToScopes[path]; + } +}; + +/** + * Don't run validation on this path or persist changes to this path. + * + * #### Example: + * + * doc.foo = null; + * doc.$ignore('foo'); + * doc.save(); // changes to foo will not be persisted and validators won't be run + * + * @memberOf Document + * @instance + * @method $ignore + * @param {String} path the path to ignore + * @api public + */ + +Document.prototype.$ignore = function(path) { + this.$__.activePaths.ignore(path); +}; + +/** + * Returns the list of paths that have been directly modified. A direct + * modified path is a path that you explicitly set, whether via `doc.foo = 'bar'`, + * `Object.assign(doc, { foo: 'bar' })`, or `doc.set('foo', 'bar')`. + * + * A path `a` may be in `modifiedPaths()` but not in `directModifiedPaths()` + * because a child of `a` was directly modified. + * + * #### Example + * const schema = new Schema({ foo: String, nested: { bar: String } }); + * const Model = mongoose.model('Test', schema); + * await Model.create({ foo: 'original', nested: { bar: 'original' } }); + * + * const doc = await Model.findOne(); + * doc.nested.bar = 'modified'; + * doc.directModifiedPaths(); // ['nested.bar'] + * doc.modifiedPaths(); // ['nested', 'nested.bar'] + * + * @return {Array} + * @api public + */ + +Document.prototype.directModifiedPaths = function() { + return Object.keys(this.$__.activePaths.states.modify); +}; + +/** + * Returns true if the given path is nullish or only contains empty objects. + * Useful for determining whether this subdoc will get stripped out by the + * [minimize option](/docs/guide.html#minimize). + * + * #### Example: + * const schema = new Schema({ nested: { foo: String } }); + * const Model = mongoose.model('Test', schema); + * const doc = new Model({}); + * doc.$isEmpty('nested'); // true + * doc.nested.$isEmpty(); // true + * + * doc.nested.foo = 'bar'; + * doc.$isEmpty('nested'); // false + * doc.nested.$isEmpty(); // false + * + * @memberOf Document + * @instance + * @api public + * @method $isEmpty + * @return {Boolean} + */ + +Document.prototype.$isEmpty = function(path) { + const isEmptyOptions = { + minimize: true, + virtuals: false, + getters: false, + transform: false + }; + + if (arguments.length !== 0) { + const v = this.$get(path); + if (v == null) { + return true; + } + if (typeof v !== 'object') { + return false; + } + if (utils.isPOJO(v)) { + return _isEmpty(v); + } + return Object.keys(v.toObject(isEmptyOptions)).length === 0; + } + + return Object.keys(this.toObject(isEmptyOptions)).length === 0; +}; + +function _isEmpty(v) { + if (v == null) { + return true; + } + if (typeof v !== 'object' || Array.isArray(v)) { + return false; + } + for (const key of Object.keys(v)) { + if (!_isEmpty(v[key])) { + return false; + } + } + return true; +} + +/** + * Returns the list of paths that have been modified. + * + * @param {Object} [options] + * @param {Boolean} [options.includeChildren=false] if true, returns children of modified paths as well. For example, if false, the list of modified paths for `doc.colors = { primary: 'blue' };` will **not** contain `colors.primary`. If true, `modifiedPaths()` will return an array that contains `colors.primary`. + * @return {Array} + * @api public + */ + +Document.prototype.modifiedPaths = function(options) { + options = options || {}; + + const directModifiedPaths = Object.keys(this.$__.activePaths.states.modify); + const result = new Set(); + + let i = 0; + let j = 0; + const len = directModifiedPaths.length; + + for (i = 0; i < len; ++i) { + const path = directModifiedPaths[i]; + const parts = parentPaths(path); + const pLen = parts.length; + + for (j = 0; j < pLen; ++j) { + result.add(parts[j]); + } + + if (!options.includeChildren) { + continue; + } + + let ii = 0; + let cur = this.$get(path); + if (typeof cur === 'object' && cur !== null) { + if (cur._doc) { + cur = cur._doc; + } + const len = cur.length; + if (Array.isArray(cur)) { + for (ii = 0; ii < len; ++ii) { + const subPath = path + '.' + ii; + if (!result.has(subPath)) { + result.add(subPath); + if (cur[ii] != null && cur[ii].$__) { + const modified = cur[ii].modifiedPaths(); + let iii = 0; + const iiiLen = modified.length; + for (iii = 0; iii < iiiLen; ++iii) { + result.add(subPath + '.' + modified[iii]); + } + } + } + } + } else { + const keys = Object.keys(cur); + let ii = 0; + const len = keys.length; + for (ii = 0; ii < len; ++ii) { + result.add(path + '.' + keys[ii]); + } + } + } + } + return Array.from(result); +}; + +Document.prototype[documentModifiedPaths] = Document.prototype.modifiedPaths; + +/** + * Returns true if any of the given paths is modified, else false. If no arguments, returns `true` if any path + * in this document is modified. + * + * If `path` is given, checks if a path or any full path containing `path` as part of its path chain has been modified. + * + * #### Example + * + * doc.set('documents.0.title', 'changed'); + * doc.isModified() // true + * doc.isModified('documents') // true + * doc.isModified('documents.0.title') // true + * doc.isModified('documents otherProp') // true + * doc.isDirectModified('documents') // false + * + * @param {String} [path] optional + * @return {Boolean} + * @api public + */ + +Document.prototype.isModified = function(paths, modifiedPaths) { + if (paths) { + const directModifiedPaths = Object.keys(this.$__.activePaths.states.modify); + if (directModifiedPaths.length === 0) { + return false; + } + + if (!Array.isArray(paths)) { + paths = paths.indexOf(' ') === -1 ? [paths] : paths.split(' '); + } + const modified = modifiedPaths || this[documentModifiedPaths](); + const isModifiedChild = paths.some(function(path) { + return !!~modified.indexOf(path); + }); + + return isModifiedChild || paths.some(function(path) { + return directModifiedPaths.some(function(mod) { + return mod === path || path.startsWith(mod + '.'); + }); + }); + } + + return this.$__.activePaths.some('modify'); +}; + +Document.prototype.$isModified = Document.prototype.isModified; + +Document.prototype[documentIsModified] = Document.prototype.isModified; + +/** + * Checks if a path is set to its default. + * + * #### Example + * + * MyModel = mongoose.model('test', { name: { type: String, default: 'Val '} }); + * const m = new MyModel(); + * m.$isDefault('name'); // true + * + * @memberOf Document + * @instance + * @method $isDefault + * @param {String} [path] + * @return {Boolean} + * @api public + */ + +Document.prototype.$isDefault = function(path) { + if (path == null) { + return this.$__.activePaths.some('default'); + } + + if (typeof path === 'string' && path.indexOf(' ') === -1) { + return this.$__.activePaths.states.default.hasOwnProperty(path); + } + + let paths = path; + if (!Array.isArray(paths)) { + paths = paths.split(' '); + } + + return paths.some(path => this.$__.activePaths.states.default.hasOwnProperty(path)); +}; + +/** + * Getter/setter, determines whether the document was removed or not. + * + * #### Example: + * const product = await product.remove(); + * product.$isDeleted(); // true + * product.remove(); // no-op, doesn't send anything to the db + * + * product.$isDeleted(false); + * product.$isDeleted(); // false + * product.remove(); // will execute a remove against the db + * + * + * @param {Boolean} [val] optional, overrides whether mongoose thinks the doc is deleted + * @return {Boolean} whether mongoose thinks this doc is deleted. + * @method $isDeleted + * @memberOf Document + * @instance + * @api public + */ + +Document.prototype.$isDeleted = function(val) { + if (arguments.length === 0) { + return !!this.$__.isDeleted; + } + + this.$__.isDeleted = !!val; + return this; +}; + +/** + * Returns true if `path` was directly set and modified, else false. + * + * #### Example + * + * doc.set('documents.0.title', 'changed'); + * doc.isDirectModified('documents.0.title') // true + * doc.isDirectModified('documents') // false + * + * @param {String|Array} path + * @return {Boolean} + * @api public + */ + +Document.prototype.isDirectModified = function(path) { + if (path == null) { + return this.$__.activePaths.some('modify'); + } + + if (typeof path === 'string' && path.indexOf(' ') === -1) { + return this.$__.activePaths.states.modify.hasOwnProperty(path); + } + + let paths = path; + if (!Array.isArray(paths)) { + paths = paths.split(' '); + } + + return paths.some(path => this.$__.activePaths.states.modify.hasOwnProperty(path)); +}; + +/** + * Checks if `path` is in the `init` state, that is, it was set by `Document#init()` and not modified since. + * + * @param {String} path + * @return {Boolean} + * @api public + */ + +Document.prototype.isInit = function(path) { + if (path == null) { + return this.$__.activePaths.some('init'); + } + + if (typeof path === 'string' && path.indexOf(' ') === -1) { + return this.$__.activePaths.states.init.hasOwnProperty(path); + } + + let paths = path; + if (!Array.isArray(paths)) { + paths = paths.split(' '); + } + + return paths.some(path => this.$__.activePaths.states.init.hasOwnProperty(path)); +}; + +/** + * Checks if `path` was selected in the source query which initialized this document. + * + * #### Example + * + * const doc = await Thing.findOne().select('name'); + * doc.isSelected('name') // true + * doc.isSelected('age') // false + * + * @param {String|Array} path + * @return {Boolean} + * @api public + */ + +Document.prototype.isSelected = function isSelected(path) { + if (this.$__.selected == null) { + return true; + } + if (!path) { + return false; + } + if (path === '_id') { + return this.$__.selected._id !== 0; + } + + if (path.indexOf(' ') !== -1) { + path = path.split(' '); + } + if (Array.isArray(path)) { + return path.some(p => this.$__isSelected(p)); + } + + const paths = Object.keys(this.$__.selected); + let inclusive = null; + + if (paths.length === 1 && paths[0] === '_id') { + // only _id was selected. + return this.$__.selected._id === 0; + } + + for (const cur of paths) { + if (cur === '_id') { + continue; + } + if (!isDefiningProjection(this.$__.selected[cur])) { + continue; + } + inclusive = !!this.$__.selected[cur]; + break; + } + + if (inclusive === null) { + return true; + } + + if (path in this.$__.selected) { + return inclusive; + } + + const pathDot = path + '.'; + + for (const cur of paths) { + if (cur === '_id') { + continue; + } + + if (cur.startsWith(pathDot)) { + return inclusive || cur !== pathDot; + } + + if (pathDot.startsWith(cur + '.')) { + return inclusive; + } + } + + return !inclusive; +}; + +Document.prototype.$__isSelected = Document.prototype.isSelected; + +/** + * Checks if `path` was explicitly selected. If no projection, always returns + * true. + * + * #### Example + * + * Thing.findOne().select('nested.name').exec(function (err, doc) { + * doc.isDirectSelected('nested.name') // true + * doc.isDirectSelected('nested.otherName') // false + * doc.isDirectSelected('nested') // false + * }) + * + * @param {String} path + * @return {Boolean} + * @api public + */ + +Document.prototype.isDirectSelected = function isDirectSelected(path) { + if (this.$__.selected == null) { + return true; + } + + if (path === '_id') { + return this.$__.selected._id !== 0; + } + + if (path.indexOf(' ') !== -1) { + path = path.split(' '); + } + if (Array.isArray(path)) { + return path.some(p => this.isDirectSelected(p)); + } + + const paths = Object.keys(this.$__.selected); + let inclusive = null; + + if (paths.length === 1 && paths[0] === '_id') { + // only _id was selected. + return this.$__.selected._id === 0; + } + + for (const cur of paths) { + if (cur === '_id') { + continue; + } + if (!isDefiningProjection(this.$__.selected[cur])) { + continue; + } + inclusive = !!this.$__.selected[cur]; + break; + } + + if (inclusive === null) { + return true; + } + + if (this.$__.selected.hasOwnProperty(path)) { + return inclusive; + } + + return !inclusive; +}; + +/** + * Executes registered validation rules for this document. + * + * #### Note: + * + * This method is called `pre` save and if a validation rule is violated, [save](#model_Model-save) is aborted and the error is returned to your `callback`. + * + * #### Example: + * + * doc.validate(function (err) { + * if (err) handleError(err); + * else // validation passed + * }); + * + * @param {Array|String} [pathsToValidate] list of paths to validate. If set, Mongoose will validate only the modified paths that are in the given list. + * @param {Object} [options] internal options + * @param {Boolean} [options.validateModifiedOnly=false] if `true` mongoose validates only modified paths. + * @param {Array|string} [options.pathsToSkip] list of paths to skip. If set, Mongoose will validate every modified path that is not in this list. + * @param {Function} [callback] optional callback called after validation completes, passing an error if one occurred + * @return {Promise} Promise + * @api public + */ + +Document.prototype.validate = function(pathsToValidate, options, callback) { + let parallelValidate; + this.$op = 'validate'; + + if (this.$isSubdocument != null) { + // Skip parallel validate check for subdocuments + } else if (this.$__.validating) { + parallelValidate = new ParallelValidateError(this, { + parentStack: options && options.parentStack, + conflictStack: this.$__.validating.stack + }); + } else { + this.$__.validating = new ParallelValidateError(this, { parentStack: options && options.parentStack }); + } + + if (arguments.length === 1) { + if (typeof arguments[0] === 'object' && !Array.isArray(arguments[0])) { + options = arguments[0]; + callback = null; + pathsToValidate = null; + } else if (typeof arguments[0] === 'function') { + callback = arguments[0]; + options = null; + pathsToValidate = null; + } + } else if (typeof pathsToValidate === 'function') { + callback = pathsToValidate; + options = null; + pathsToValidate = null; + } else if (typeof options === 'function') { + callback = options; + options = pathsToValidate; + pathsToValidate = null; + } + if (options && typeof options.pathsToSkip === 'string') { + const isOnePathOnly = options.pathsToSkip.indexOf(' ') === -1; + options.pathsToSkip = isOnePathOnly ? [options.pathsToSkip] : options.pathsToSkip.split(' '); + } + + return promiseOrCallback(callback, cb => { + if (parallelValidate != null) { + return cb(parallelValidate); + } + + this.$__validate(pathsToValidate, options, (error) => { + this.$op = null; + this.$__.validating = null; + cb(error); + }); + }, this.constructor.events); +}; + +Document.prototype.$validate = Document.prototype.validate; + +/*! + * ignore + */ + +function _evaluateRequiredFunctions(doc) { + const requiredFields = Object.keys(doc.$__.activePaths.states.require); + let i = 0; + const len = requiredFields.length; + for (i = 0; i < len; ++i) { + const path = requiredFields[i]; + + const p = doc.$__schema.path(path); + + if (p != null && typeof p.originalRequiredValue === 'function') { + doc.$__.cachedRequired = doc.$__.cachedRequired || {}; + try { + doc.$__.cachedRequired[path] = p.originalRequiredValue.call(doc, doc); + } catch (err) { + doc.invalidate(path, err); + } + } + } +} + +/*! + * ignore + */ + +function _getPathsToValidate(doc) { + const skipSchemaValidators = {}; + + _evaluateRequiredFunctions(doc); + // only validate required fields when necessary + let paths = new Set(Object.keys(doc.$__.activePaths.states.require).filter(function(path) { + if (!doc.$__isSelected(path) && !doc.$isModified(path)) { + return false; + } + if (doc.$__.cachedRequired != null && path in doc.$__.cachedRequired) { + return doc.$__.cachedRequired[path]; + } + return true; + })); + + Object.keys(doc.$__.activePaths.states.init).forEach(addToPaths); + Object.keys(doc.$__.activePaths.states.modify).forEach(addToPaths); + Object.keys(doc.$__.activePaths.states.default).forEach(addToPaths); + function addToPaths(p) { paths.add(p); } + + const subdocs = doc.$getAllSubdocs(); + const modifiedPaths = doc.modifiedPaths(); + for (const subdoc of subdocs) { + if (subdoc.$basePath) { + // Remove child paths for now, because we'll be validating the whole + // subdoc + const fullPathToSubdoc = subdoc.$__fullPathWithIndexes(); + + for (const p of paths) { + if (p == null || p.startsWith(fullPathToSubdoc + '.')) { + paths.delete(p); + } + } + + if (doc.$isModified(fullPathToSubdoc, modifiedPaths) && + !doc.isDirectModified(fullPathToSubdoc) && + !doc.$isDefault(fullPathToSubdoc)) { + paths.add(fullPathToSubdoc); + + skipSchemaValidators[fullPathToSubdoc] = true; + } + } + } + + for (const path of paths) { + const _pathType = doc.$__schema.path(path); + if (!_pathType) { + continue; + } + + if (_pathType.$isMongooseDocumentArray) { + for (const p of paths) { + if (p == null || p.startsWith(_pathType.path + '.')) { + paths.delete(p); + } + } + } + + // Optimization: if primitive path with no validators, or array of primitives + // with no validators, skip validating this path entirely. + if (!_pathType.caster && _pathType.validators.length === 0) { + paths.delete(path); + } else if (_pathType.$isMongooseArray && + !_pathType.$isMongooseDocumentArray && // Skip document arrays... + !_pathType.$embeddedSchemaType.$isMongooseArray && // and arrays of arrays + _pathType.validators.length === 0 && // and arrays with top-level validators + _pathType.$embeddedSchemaType.validators.length === 0) { + paths.delete(path); + } + } + + // from here on we're not removing items from paths + + // gh-661: if a whole array is modified, make sure to run validation on all + // the children as well + for (const path of paths) { + const _pathType = doc.$__schema.path(path); + if (!_pathType) { + continue; + } + + if (!_pathType.$isMongooseArray || + // To avoid potential performance issues, skip doc arrays whose children + // are not required. `getPositionalPathType()` may be slow, so avoid + // it unless we have a case of #6364 + (!Array.isArray(_pathType) && + _pathType.$isMongooseDocumentArray && + !(_pathType && _pathType.schemaOptions && _pathType.schemaOptions.required))) { + continue; + } + + // gh-11380: optimization. If the array isn't a document array and there's no validators + // on the array type, there's no need to run validation on the individual array elements. + if (_pathType.$isMongooseArray && + !_pathType.$isMongooseDocumentArray && // Skip document arrays... + !_pathType.$embeddedSchemaType.$isMongooseArray && // and arrays of arrays + _pathType.$embeddedSchemaType.validators.length === 0) { + continue; + } + + const val = doc.$__getValue(path); + _pushNestedArrayPaths(val, paths, path); + } + + function _pushNestedArrayPaths(val, paths, path) { + if (val != null) { + const numElements = val.length; + for (let j = 0; j < numElements; ++j) { + if (Array.isArray(val[j])) { + _pushNestedArrayPaths(val[j], paths, path + '.' + j); + } else { + paths.add(path + '.' + j); + } + } + } + } + + const flattenOptions = { skipArrays: true }; + for (const pathToCheck of paths) { + if (doc.$__schema.nested[pathToCheck]) { + let _v = doc.$__getValue(pathToCheck); + if (isMongooseObject(_v)) { + _v = _v.toObject({ transform: false }); + } + const flat = flatten(_v, pathToCheck, flattenOptions, doc.$__schema); + Object.keys(flat).forEach(addToPaths); + } + } + + for (const path of paths) { + // Single nested paths (paths embedded under single nested subdocs) will + // be validated on their own when we call `validate()` on the subdoc itself. + // Re: gh-8468 + if (doc.$__schema.singleNestedPaths.hasOwnProperty(path)) { + paths.delete(path); + continue; + } + const _pathType = doc.$__schema.path(path); + if (!_pathType || !_pathType.$isSchemaMap) { + continue; + } + + const val = doc.$__getValue(path); + if (val == null) { + continue; + } + for (const key of val.keys()) { + paths.add(path + '.' + key); + } + } + + paths = Array.from(paths); + return [paths, skipSchemaValidators]; +} + +/*! + * ignore + */ + +Document.prototype.$__validate = function(pathsToValidate, options, callback) { + if (typeof pathsToValidate === 'function') { + callback = pathsToValidate; + options = null; + pathsToValidate = null; + } else if (typeof options === 'function') { + callback = options; + options = null; + } + + const hasValidateModifiedOnlyOption = options && + (typeof options === 'object') && + ('validateModifiedOnly' in options); + + const pathsToSkip = (options && options.pathsToSkip) || null; + + let shouldValidateModifiedOnly; + if (hasValidateModifiedOnlyOption) { + shouldValidateModifiedOnly = !!options.validateModifiedOnly; + } else { + shouldValidateModifiedOnly = this.$__schema.options.validateModifiedOnly; + } + + const _this = this; + const _complete = () => { + let validationError = this.$__.validationError; + this.$__.validationError = null; + this.$__.validating = null; + + if (shouldValidateModifiedOnly && validationError != null) { + // Remove any validation errors that aren't from modified paths + const errors = Object.keys(validationError.errors); + for (const errPath of errors) { + if (!this.$isModified(errPath)) { + delete validationError.errors[errPath]; + } + } + if (Object.keys(validationError.errors).length === 0) { + validationError = void 0; + } + } + + this.$__.cachedRequired = {}; + this.$emit('validate', _this); + this.constructor.emit('validate', _this); + + if (validationError) { + for (const key in validationError.errors) { + // Make sure cast errors persist + if (!this[documentArrayParent] && + validationError.errors[key] instanceof MongooseError.CastError) { + this.invalidate(key, validationError.errors[key]); + } + } + + return validationError; + } + }; + + // only validate required fields when necessary + const pathDetails = _getPathsToValidate(this); + let paths = shouldValidateModifiedOnly ? + pathDetails[0].filter((path) => this.$isModified(path)) : + pathDetails[0]; + const skipSchemaValidators = pathDetails[1]; + if (typeof pathsToValidate === 'string') { + pathsToValidate = pathsToValidate.split(' '); + } + if (Array.isArray(pathsToValidate)) { + paths = _handlePathsToValidate(paths, pathsToValidate); + } else if (pathsToSkip) { + paths = _handlePathsToSkip(paths, pathsToSkip); + } + + if (paths.length === 0) { + return immediate(function() { + const error = _complete(); + if (error) { + return _this.$__schema.s.hooks.execPost('validate:error', _this, [_this], { error: error }, function(error) { + callback(error); + }); + } + callback(null, _this); + }); + } + + const validated = {}; + let total = 0; + + for (const path of paths) { + validatePath(path); + } + + function validatePath(path) { + if (path == null || validated[path]) { + return; + } + + validated[path] = true; + total++; + + immediate(function() { + const schemaType = _this.$__schema.path(path); + + if (!schemaType) { + return --total || complete(); + } + + // If user marked as invalid or there was a cast error, don't validate + if (!_this.$isValid(path)) { + --total || complete(); + return; + } + + // If setting a path under a mixed path, avoid using the mixed path validator (gh-10141) + if (schemaType[schemaMixedSymbol] != null && path !== schemaType.path) { + return --total || complete(); + } + + let val = _this.$__getValue(path); + + // If you `populate()` and get back a null value, required validators + // shouldn't fail (gh-8018). We should always fall back to the populated + // value. + let pop; + if ((pop = _this.$populated(path))) { + val = pop; + } else if (val != null && val.$__ != null && val.$__.wasPopulated) { + // Array paths, like `somearray.1`, do not show up as populated with `$populated()`, + // so in that case pull out the document's id + val = val._id; + } + const scope = _this.$__.pathsToScopes != null && path in _this.$__.pathsToScopes ? + _this.$__.pathsToScopes[path] : + _this; + + const doValidateOptions = { + skipSchemaValidators: skipSchemaValidators[path], + path: path, + validateModifiedOnly: shouldValidateModifiedOnly + }; + + schemaType.doValidate(val, function(err) { + if (err) { + const isSubdoc = schemaType.$isSingleNested || + schemaType.$isArraySubdocument || + schemaType.$isMongooseDocumentArray; + if (isSubdoc && err instanceof ValidationError) { + return --total || complete(); + } + _this.invalidate(path, err, undefined, true); + } + --total || complete(); + }, scope, doValidateOptions); + }); + } + + function complete() { + const error = _complete(); + if (error) { + return _this.$__schema.s.hooks.execPost('validate:error', _this, [_this], { error: error }, function(error) { + callback(error); + }); + } + callback(null, _this); + } + +}; + +/*! + * ignore + */ + +function _handlePathsToValidate(paths, pathsToValidate) { + const _pathsToValidate = new Set(pathsToValidate); + const parentPaths = new Map([]); + for (const path of pathsToValidate) { + if (path.indexOf('.') === -1) { + continue; + } + const pieces = path.split('.'); + let cur = pieces[0]; + for (let i = 1; i < pieces.length; ++i) { + // Since we skip subpaths under single nested subdocs to + // avoid double validation, we need to add back the + // single nested subpath if the user asked for it (gh-8626) + parentPaths.set(cur, path); + cur = cur + '.' + pieces[i]; + } + } + + const ret = []; + for (const path of paths) { + if (_pathsToValidate.has(path)) { + ret.push(path); + } else if (parentPaths.has(path)) { + ret.push(parentPaths.get(path)); + } + } + return ret; +} + +/*! + * ignore + */ +function _handlePathsToSkip(paths, pathsToSkip) { + pathsToSkip = new Set(pathsToSkip); + paths = paths.filter(p => !pathsToSkip.has(p)); + return paths; +} + +/** + * Executes registered validation rules (skipping asynchronous validators) for this document. + * + * #### Note: + * + * This method is useful if you need synchronous validation. + * + * #### Example: + * + * const err = doc.validateSync(); + * if (err) { + * handleError(err); + * } else { + * // validation passed + * } + * + * @param {Array|string} pathsToValidate only validate the given paths + * @param {Object} [options] options for validation + * @param {Boolean} [options.validateModifiedOnly=false] If `true`, Mongoose will only validate modified paths, as opposed to modified paths and `required` paths. + * @param {Array|string} [options.pathsToSkip] list of paths to skip. If set, Mongoose will validate every modified path that is not in this list. + * @return {ValidationError|undefined} ValidationError if there are errors during validation, or undefined if there is no error. + * @api public + */ + +Document.prototype.validateSync = function(pathsToValidate, options) { + const _this = this; + + if (arguments.length === 1 && typeof arguments[0] === 'object' && !Array.isArray(arguments[0])) { + options = arguments[0]; + pathsToValidate = null; + } + + const hasValidateModifiedOnlyOption = options && + (typeof options === 'object') && + ('validateModifiedOnly' in options); + + let shouldValidateModifiedOnly; + if (hasValidateModifiedOnlyOption) { + shouldValidateModifiedOnly = !!options.validateModifiedOnly; + } else { + shouldValidateModifiedOnly = this.$__schema.options.validateModifiedOnly; + } + + let pathsToSkip = options && options.pathsToSkip; + + if (typeof pathsToValidate === 'string') { + const isOnePathOnly = pathsToValidate.indexOf(' ') === -1; + pathsToValidate = isOnePathOnly ? [pathsToValidate] : pathsToValidate.split(' '); + } else if (typeof pathsToSkip === 'string' && pathsToSkip.indexOf(' ') !== -1) { + pathsToSkip = pathsToSkip.split(' '); + } + + // only validate required fields when necessary + const pathDetails = _getPathsToValidate(this); + let paths = shouldValidateModifiedOnly ? + pathDetails[0].filter((path) => this.$isModified(path)) : + pathDetails[0]; + const skipSchemaValidators = pathDetails[1]; + + if (Array.isArray(pathsToValidate)) { + paths = _handlePathsToValidate(paths, pathsToValidate); + } else if (Array.isArray(pathsToSkip)) { + paths = _handlePathsToSkip(paths, pathsToSkip); + } + const validating = {}; + + for (let i = 0, len = paths.length; i < len; ++i) { + const path = paths[i]; + + if (validating[path]) { + continue; + } + + validating[path] = true; + + const p = _this.$__schema.path(path); + if (!p) { + continue; + } + if (!_this.$isValid(path)) { + continue; + } + + const val = _this.$__getValue(path); + const err = p.doValidateSync(val, _this, { + skipSchemaValidators: skipSchemaValidators[path], + path: path, + validateModifiedOnly: shouldValidateModifiedOnly + }); + if (err) { + const isSubdoc = p.$isSingleNested || + p.$isArraySubdocument || + p.$isMongooseDocumentArray; + if (isSubdoc && err instanceof ValidationError) { + continue; + } + _this.invalidate(path, err, undefined, true); + } + } + + const err = _this.$__.validationError; + _this.$__.validationError = undefined; + _this.$emit('validate', _this); + _this.constructor.emit('validate', _this); + + if (err) { + for (const key in err.errors) { + // Make sure cast errors persist + if (err.errors[key] instanceof MongooseError.CastError) { + _this.invalidate(key, err.errors[key]); + } + } + } + + return err; +}; + +/** + * Marks a path as invalid, causing validation to fail. + * + * The `errorMsg` argument will become the message of the `ValidationError`. + * + * The `value` argument (if passed) will be available through the `ValidationError.value` property. + * + * doc.invalidate('size', 'must be less than 20', 14); + + * doc.validate(function (err) { + * console.log(err) + * // prints + * { message: 'Validation failed', + * name: 'ValidationError', + * errors: + * { size: + * { message: 'must be less than 20', + * name: 'ValidatorError', + * path: 'size', + * type: 'user defined', + * value: 14 } } } + * }) + * + * @param {String} path the field to invalidate. For array elements, use the `array.i.field` syntax, where `i` is the 0-based index in the array. + * @param {String|Error} errorMsg the error which states the reason `path` was invalid + * @param {Object|String|Number|any} value optional invalid value + * @param {String} [kind] optional `kind` property for the error + * @return {ValidationError} the current ValidationError, with all currently invalidated paths + * @api public + */ + +Document.prototype.invalidate = function(path, err, val, kind) { + if (!this.$__.validationError) { + this.$__.validationError = new ValidationError(this); + } + + if (this.$__.validationError.errors[path]) { + return; + } + + if (!err || typeof err === 'string') { + err = new ValidatorError({ + path: path, + message: err, + type: kind || 'user defined', + value: val + }); + } + + if (this.$__.validationError === err) { + return this.$__.validationError; + } + + this.$__.validationError.addError(path, err); + return this.$__.validationError; +}; + +/** + * Marks a path as valid, removing existing validation errors. + * + * @param {String} path the field to mark as valid + * @api public + * @memberOf Document + * @instance + * @method $markValid + */ + +Document.prototype.$markValid = function(path) { + if (!this.$__.validationError || !this.$__.validationError.errors[path]) { + return; + } + + delete this.$__.validationError.errors[path]; + if (Object.keys(this.$__.validationError.errors).length === 0) { + this.$__.validationError = null; + } +}; + +/*! + * ignore + */ + +function _markValidSubpaths(doc, path) { + if (!doc.$__.validationError) { + return; + } + + const keys = Object.keys(doc.$__.validationError.errors); + for (const key of keys) { + if (key.startsWith(path + '.')) { + delete doc.$__.validationError.errors[key]; + } + } + if (Object.keys(doc.$__.validationError.errors).length === 0) { + doc.$__.validationError = null; + } +} + +/*! + * ignore + */ + +function _checkImmutableSubpaths(subdoc, schematype, priorVal) { + const schema = schematype.schema; + if (schema == null) { + return; + } + + for (const key of Object.keys(schema.paths)) { + const path = schema.paths[key]; + if (path.$immutableSetter == null) { + continue; + } + const oldVal = priorVal == null ? void 0 : priorVal.$__getValue(key); + // Calling immutableSetter with `oldVal` even though it expects `newVal` + // is intentional. That's because `$immutableSetter` compares its param + // to the current value. + path.$immutableSetter.call(subdoc, oldVal); + } +} + +/** + * Saves this document by inserting a new document into the database if [document.isNew](/docs/api.html#document_Document-isNew) is `true`, + * or sends an [updateOne](/docs/api.html#document_Document-updateOne) operation **only** with the modifications to the database, it does not replace the whole document in the latter case. + * + * #### Example: + * + * product.sold = Date.now(); + * product = await product.save(); + * + * If save is successful, the returned promise will fulfill with the document + * saved. + * + * #### Example: + * + * const newProduct = await product.save(); + * newProduct === product; // true + * + * @param {Object} [options] options optional options + * @param {Session} [options.session=null] the [session](https://docs.mongodb.com/manual/reference/server-sessions/) associated with this save operation. If not specified, defaults to the [document's associated session](api.html#document_Document-$session). + * @param {Object} [options.safe] (DEPRECATED) overrides [schema's safe option](https://mongoosejs.com//docs/guide.html#safe). Use the `w` option instead. + * @param {Boolean} [options.validateBeforeSave] set to false to save without validating. + * @param {Boolean} [options.validateModifiedOnly=false] If `true`, Mongoose will only validate modified paths, as opposed to modified paths and `required` paths. + * @param {Number|String} [options.w] set the [write concern](https://docs.mongodb.com/manual/reference/write-concern/#w-option). Overrides the [schema-level `writeConcern` option](/docs/guide.html#writeConcern) + * @param {Boolean} [options.j] set to true for MongoDB to wait until this `save()` has been [journaled before resolving the returned promise](https://docs.mongodb.com/manual/reference/write-concern/#j-option). Overrides the [schema-level `writeConcern` option](/docs/guide.html#writeConcern) + * @param {Number} [options.wtimeout] sets a [timeout for the write concern](https://docs.mongodb.com/manual/reference/write-concern/#wtimeout). Overrides the [schema-level `writeConcern` option](/docs/guide.html#writeConcern). + * @param {Boolean} [options.checkKeys=true] the MongoDB driver prevents you from saving keys that start with '$' or contain '.' by default. Set this option to `false` to skip that check. See [restrictions on field names](https://docs.mongodb.com/manual/reference/limits/#Restrictions-on-Field-Names) + * @param {Boolean} [options.timestamps=true] if `false` and [timestamps](./guide.html#timestamps) are enabled, skip timestamps for this `save()`. + * @param {Function} [fn] optional callback + * @method save + * @memberOf Document + * @instance + * @throws {DocumentNotFoundError} if this [save updates an existing document](api.html#document_Document-isNew) but the document doesn't exist in the database. For example, you will get this error if the document is [deleted between when you retrieved the document and when you saved it](documents.html#updating). + * @return {Promise|undefined} Returns undefined if used with callback or a Promise otherwise. + * @api public + * @see middleware https://mongoosejs.com/docs/middleware.html + */ + +/** + * Checks if a path is invalid + * + * @param {String|Array} path the field to check + * @method $isValid + * @memberOf Document + * @instance + * @api private + */ + +Document.prototype.$isValid = function(path) { + if (this.$__.validationError == null || Object.keys(this.$__.validationError.errors).length === 0) { + return true; + } + if (path == null) { + return false; + } + + if (path.indexOf(' ') !== -1) { + path = path.split(' '); + } + if (Array.isArray(path)) { + return path.some(p => this.$__.validationError.errors[p] == null); + } + + return this.$__.validationError.errors[path] == null; +}; + +/** + * Resets the internal modified state of this document. + * + * @api private + * @return {Document} + * @method $__reset + * @memberOf Document + * @instance + */ + +Document.prototype.$__reset = function reset() { + let _this = this; + + // Skip for subdocuments + const subdocs = this.$parent() === this ? this.$getAllSubdocs() : []; + const resetArrays = new Set(); + for (const subdoc of subdocs) { + const fullPathWithIndexes = subdoc.$__fullPathWithIndexes(); + if (this.isModified(fullPathWithIndexes) || isParentInit(fullPathWithIndexes)) { + subdoc.$__reset(); + if (subdoc.$isDocumentArrayElement) { + if (!resetArrays.has(subdoc.parentArray())) { + const array = subdoc.parentArray(); + this.$__.activePaths.clearPath(fullPathWithIndexes.replace(/\.\d+$/, '').slice(-subdoc.$basePath - 1)); + array[arrayAtomicsBackupSymbol] = array[arrayAtomicsSymbol]; + array[arrayAtomicsSymbol] = {}; + + resetArrays.add(array); + } + } else { + if (subdoc.$parent() === this) { + this.$__.activePaths.clearPath(subdoc.$basePath); + } else if (subdoc.$parent() != null && subdoc.$parent().$isSubdocument) { + // If map path underneath subdocument, may end up with a case where + // map path is modified but parent still needs to be reset. See gh-10295 + subdoc.$parent().$__reset(); + } + } + } + } + + function isParentInit(path) { + path = path.indexOf('.') === -1 ? [path] : path.split('.'); + let cur = ''; + for (let i = 0; i < path.length; ++i) { + cur += (cur.length ? '.' : '') + path[i]; + if (_this.$__.activePaths[cur] === 'init') { + return true; + } + } + + return false; + } + + // clear atomics + this.$__dirty().forEach(function(dirt) { + const type = dirt.value; + + if (type && type[arrayAtomicsSymbol]) { + type[arrayAtomicsBackupSymbol] = type[arrayAtomicsSymbol]; + type[arrayAtomicsSymbol] = {}; + } + }); + + this.$__.backup = {}; + this.$__.backup.activePaths = { + modify: Object.assign({}, this.$__.activePaths.states.modify), + default: Object.assign({}, this.$__.activePaths.states.default) + }; + this.$__.backup.validationError = this.$__.validationError; + this.$__.backup.errors = this.$errors; + + // Clear 'dirty' cache + this.$__.activePaths.clear('modify'); + this.$__.activePaths.clear('default'); + this.$__.validationError = undefined; + this.$errors = undefined; + _this = this; + this.$__schema.requiredPaths().forEach(function(path) { + _this.$__.activePaths.require(path); + }); + + return this; +}; + +/*! + * ignore + */ + +Document.prototype.$__undoReset = function $__undoReset() { + if (this.$__.backup == null || this.$__.backup.activePaths == null) { + return; + } + + this.$__.activePaths.states.modify = this.$__.backup.activePaths.modify; + this.$__.activePaths.states.default = this.$__.backup.activePaths.default; + + this.$__.validationError = this.$__.backup.validationError; + this.$errors = this.$__.backup.errors; + + for (const dirt of this.$__dirty()) { + const type = dirt.value; + + if (type && type[arrayAtomicsSymbol] && type[arrayAtomicsBackupSymbol]) { + type[arrayAtomicsSymbol] = type[arrayAtomicsBackupSymbol]; + } + } + + for (const subdoc of this.$getAllSubdocs()) { + subdoc.$__undoReset(); + } +}; + +/** + * Returns this documents dirty paths / vals. + * + * @api private + * @method $__dirty + * @memberOf Document + * @instance + */ + +Document.prototype.$__dirty = function() { + const _this = this; + let all = this.$__.activePaths.map('modify', function(path) { + return { + path: path, + value: _this.$__getValue(path), + schema: _this.$__path(path) + }; + }); + // gh-2558: if we had to set a default and the value is not undefined, + // we have to save as well + all = all.concat(this.$__.activePaths.map('default', function(path) { + if (path === '_id' || _this.$__getValue(path) == null) { + return; + } + return { + path: path, + value: _this.$__getValue(path), + schema: _this.$__path(path) + }; + })); + + const allPaths = new Map(all.filter((el) => el != null).map((el) => [el.path, el.value])); + // Ignore "foo.a" if "foo" is dirty already. + const minimal = []; + + all.forEach(function(item) { + if (!item) { + return; + } + + let top = null; + + const array = parentPaths(item.path); + for (let i = 0; i < array.length - 1; i++) { + if (allPaths.has(array[i])) { + top = allPaths.get(array[i]); + break; + } + } + if (top == null) { + minimal.push(item); + } else if (top != null && + top[arrayAtomicsSymbol] != null && + top.hasAtomics()) { + // special case for top level MongooseArrays + // the `top` array itself and a sub path of `top` are being set. + // the only way to honor all of both modifications is through a $set + // of entire array. + top[arrayAtomicsSymbol] = {}; + top[arrayAtomicsSymbol].$set = top; + } + }); + return minimal; +}; + +/** + * Assigns/compiles `schema` into this documents prototype. + * + * @param {Schema} schema + * @api private + * @method $__setSchema + * @memberOf Document + * @instance + */ + +Document.prototype.$__setSchema = function(schema) { + compile(schema.tree, this, undefined, schema.options); + + // Apply default getters if virtual doesn't have any (gh-6262) + for (const key of Object.keys(schema.virtuals)) { + schema.virtuals[key]._applyDefaultGetters(); + } + if (schema.path('schema') == null) { + this.schema = schema; + } + this.$__schema = schema; + this[documentSchemaSymbol] = schema; +}; + + +/** + * Get active path that were changed and are arrays + * + * @api private + * @method $__getArrayPathsToValidate + * @memberOf Document + * @instance + */ + +Document.prototype.$__getArrayPathsToValidate = function() { + DocumentArray || (DocumentArray = require('./types/DocumentArray')); + + // validate all document arrays. + return this.$__.activePaths + .map('init', 'modify', function(i) { + return this.$__getValue(i); + }.bind(this)) + .filter(function(val) { + return val && Array.isArray(val) && utils.isMongooseDocumentArray(val) && val.length; + }).reduce(function(seed, array) { + return seed.concat(array); + }, []) + .filter(function(doc) { + return doc; + }); +}; + + +/** + * Get all subdocs (by bfs) + * + * @api public + * @method $getAllSubdocs + * @memberOf Document + * @instance + */ + +Document.prototype.$getAllSubdocs = function() { + DocumentArray || (DocumentArray = require('./types/DocumentArray')); + Embedded = Embedded || require('./types/ArraySubdocument'); + + function docReducer(doc, seed, path) { + let val = doc; + let isNested = false; + if (path) { + if (doc instanceof Document && doc[documentSchemaSymbol].paths[path]) { + val = doc._doc[path]; + } else if (doc instanceof Document && doc[documentSchemaSymbol].nested[path]) { + val = doc._doc[path]; + isNested = true; + } else { + val = doc[path]; + } + } + if (val instanceof Embedded) { + seed.push(val); + } else if (val instanceof Map) { + seed = Array.from(val.keys()).reduce(function(seed, path) { + return docReducer(val.get(path), seed, null); + }, seed); + } else if (val && !Array.isArray(val) && val.$isSingleNested) { + seed = Object.keys(val._doc).reduce(function(seed, path) { + return docReducer(val, seed, path); + }, seed); + seed.push(val); + } else if (val && utils.isMongooseDocumentArray(val)) { + val.forEach(function _docReduce(doc) { + if (!doc || !doc._doc) { + return; + } + seed = Object.keys(doc._doc).reduce(function(seed, path) { + return docReducer(doc._doc, seed, path); + }, seed); + if (doc instanceof Embedded) { + seed.push(doc); + } + }); + } else if (isNested && val != null) { + for (const path of Object.keys(val)) { + docReducer(val, seed, path); + } + } + return seed; + } + + const subDocs = []; + for (const path of Object.keys(this._doc)) { + docReducer(this, subDocs, path); + } + + return subDocs; +}; + +/*! + * Runs queued functions + */ + +function applyQueue(doc) { + const q = doc.$__schema && doc.$__schema.callQueue; + if (!q.length) { + return; + } + + for (const pair of q) { + if (pair[0] !== 'pre' && pair[0] !== 'post' && pair[0] !== 'on') { + doc[pair[0]].apply(doc, pair[1]); + } + } +} + +/*! + * ignore + */ + +Document.prototype.$__handleReject = function handleReject(err) { + // emit on the Model if listening + if (this.$listeners('error').length) { + this.$emit('error', err); + } else if (this.constructor.listeners && this.constructor.listeners('error').length) { + this.constructor.emit('error', err); + } +}; + +/** + * Internal helper for toObject() and toJSON() that doesn't manipulate options + * + * @api private + * @method $toObject + * @memberOf Document + * @instance + */ + +Document.prototype.$toObject = function(options, json) { + let defaultOptions = { + transform: true, + flattenDecimals: true + }; + + const path = json ? 'toJSON' : 'toObject'; + const baseOptions = this.constructor && + this.constructor.base && + this.constructor.base.options && + get(this.constructor.base.options, path) || {}; + const schemaOptions = this.$__schema && this.$__schema.options || {}; + // merge base default options with Schema's set default options if available. + // `clone` is necessary here because `utils.options` directly modifies the second input. + defaultOptions = utils.options(defaultOptions, clone(baseOptions)); + defaultOptions = utils.options(defaultOptions, clone(schemaOptions[path] || {})); + + // If options do not exist or is not an object, set it to empty object + options = utils.isPOJO(options) ? { ...options } : {}; + options._calledWithOptions = options._calledWithOptions || { ...options }; + + let _minimize; + if (options._calledWithOptions.minimize != null) { + _minimize = options.minimize; + } else if (defaultOptions.minimize != null) { + _minimize = defaultOptions.minimize; + } else { + _minimize = schemaOptions.minimize; + } + + let flattenMaps; + if (options._calledWithOptions.flattenMaps != null) { + flattenMaps = options.flattenMaps; + } else if (defaultOptions.flattenMaps != null) { + flattenMaps = defaultOptions.flattenMaps; + } else { + flattenMaps = schemaOptions.flattenMaps; + } + + // The original options that will be passed to `clone()`. Important because + // `clone()` will recursively call `$toObject()` on embedded docs, so we + // need the original options the user passed in, plus `_isNested` and + // `_parentOptions` for checking whether we need to depopulate. + const cloneOptions = Object.assign({}, options, { + _isNested: true, + json: json, + minimize: _minimize, + flattenMaps: flattenMaps, + _seen: (options && options._seen) || new Map() + }); + + if (utils.hasUserDefinedProperty(options, 'getters')) { + cloneOptions.getters = options.getters; + } + if (utils.hasUserDefinedProperty(options, 'virtuals')) { + cloneOptions.virtuals = options.virtuals; + } + + const depopulate = options.depopulate || + (options._parentOptions && options._parentOptions.depopulate || false); + // _isNested will only be true if this is not the top level document, we + // should never depopulate the top-level document + if (depopulate && options._isNested && this.$__.wasPopulated) { + return clone(this.$__.wasPopulated.value || this._id, cloneOptions); + } + + // merge default options with input options. + options = utils.options(defaultOptions, options); + options._isNested = true; + options.json = json; + options.minimize = _minimize; + + cloneOptions._parentOptions = options; + cloneOptions._skipSingleNestedGetters = true; + + const gettersOptions = Object.assign({}, cloneOptions); + gettersOptions._skipSingleNestedGetters = false; + + // remember the root transform function + // to save it from being overwritten by sub-transform functions + const originalTransform = options.transform; + + let ret = clone(this._doc, cloneOptions) || {}; + + if (options.getters) { + applyGetters(this, ret, gettersOptions); + + if (options.minimize) { + ret = minimize(ret) || {}; + } + } + + if (options.virtuals || (options.getters && options.virtuals !== false)) { + applyVirtuals(this, ret, gettersOptions, options); + } + + if (options.versionKey === false && this.$__schema.options.versionKey) { + delete ret[this.$__schema.options.versionKey]; + } + + let transform = options.transform; + + // In the case where a subdocument has its own transform function, we need to + // check and see if the parent has a transform (options.transform) and if the + // child schema has a transform (this.schema.options.toObject) In this case, + // we need to adjust options.transform to be the child schema's transform and + // not the parent schema's + if (transform) { + applySchemaTypeTransforms(this, ret); + } + + if (options.useProjection) { + omitDeselectedFields(this, ret); + } + + if (transform === true || (schemaOptions.toObject && transform)) { + const opts = options.json ? schemaOptions.toJSON : schemaOptions.toObject; + + if (opts) { + transform = (typeof options.transform === 'function' ? options.transform : opts.transform); + } + } else { + options.transform = originalTransform; + } + + if (typeof transform === 'function') { + const xformed = transform(this, ret, options); + if (typeof xformed !== 'undefined') { + ret = xformed; + } + } + + return ret; +}; + +/** + * Converts this document into a plain-old JavaScript object ([POJO](https://masteringjs.io/tutorials/fundamentals/pojo)). + * + * Buffers are converted to instances of [mongodb.Binary](https://mongodb.github.com/node-mongodb-native/api-bson-generated/binary.html) for proper storage. + * + * #### Options: + * + * - `getters` apply all getters (path and virtual getters), defaults to false + * - `aliases` apply all aliases if `virtuals=true`, defaults to true + * - `virtuals` apply virtual getters (can override `getters` option), defaults to false + * - `minimize` remove empty objects, defaults to true + * - `transform` a transform function to apply to the resulting document before returning + * - `depopulate` depopulate any populated paths, replacing them with their original refs, defaults to false + * - `versionKey` whether to include the version key, defaults to true + * - `flattenMaps` convert Maps to POJOs. Useful if you want to JSON.stringify() the result of toObject(), defaults to false + * - `useProjection` set to `true` to omit fields that are excluded in this document's projection. Unless you specified a projection, this will omit any field that has `select: false` in the schema. + * + * #### Getters/Virtuals + * + * Example of only applying path getters + * + * doc.toObject({ getters: true, virtuals: false }) + * + * Example of only applying virtual getters + * + * doc.toObject({ virtuals: true }) + * + * Example of applying both path and virtual getters + * + * doc.toObject({ getters: true }) + * + * To apply these options to every document of your schema by default, set your [schemas](#schema_Schema) `toObject` option to the same argument. + * + * schema.set('toObject', { virtuals: true }) + * + * #### Transform + * + * We may need to perform a transformation of the resulting object based on some criteria, say to remove some sensitive information or return a custom object. In this case we set the optional `transform` function. + * + * Transform functions receive three arguments + * + * function (doc, ret, options) {} + * + * - `doc` The mongoose document which is being converted + * - `ret` The plain object representation which has been converted + * - `options` The options in use (either schema options or the options passed inline) + * + * #### Example + * + * // specify the transform schema option + * if (!schema.options.toObject) schema.options.toObject = {}; + * schema.options.toObject.transform = function (doc, ret, options) { + * // remove the _id of every document before returning the result + * delete ret._id; + * return ret; + * } + * + * // without the transformation in the schema + * doc.toObject(); // { _id: 'anId', name: 'Wreck-it Ralph' } + * + * // with the transformation + * doc.toObject(); // { name: 'Wreck-it Ralph' } + * + * With transformations we can do a lot more than remove properties. We can even return completely new customized objects: + * + * if (!schema.options.toObject) schema.options.toObject = {}; + * schema.options.toObject.transform = function (doc, ret, options) { + * return { movie: ret.name } + * } + * + * // without the transformation in the schema + * doc.toObject(); // { _id: 'anId', name: 'Wreck-it Ralph' } + * + * // with the transformation + * doc.toObject(); // { movie: 'Wreck-it Ralph' } + * + * _Note: if a transform function returns `undefined`, the return value will be ignored._ + * + * Transformations may also be applied inline, overridding any transform set in the options: + * + * function xform (doc, ret, options) { + * return { inline: ret.name, custom: true } + * } + * + * // pass the transform as an inline option + * doc.toObject({ transform: xform }); // { inline: 'Wreck-it Ralph', custom: true } + * + * If you want to skip transformations, use `transform: false`: + * + * schema.options.toObject.hide = '_id'; + * schema.options.toObject.transform = function (doc, ret, options) { + * if (options.hide) { + * options.hide.split(' ').forEach(function (prop) { + * delete ret[prop]; + * }); + * } + * return ret; + * } + * + * const doc = new Doc({ _id: 'anId', secret: 47, name: 'Wreck-it Ralph' }); + * doc.toObject(); // { secret: 47, name: 'Wreck-it Ralph' } + * doc.toObject({ hide: 'secret _id', transform: false });// { _id: 'anId', secret: 47, name: 'Wreck-it Ralph' } + * doc.toObject({ hide: 'secret _id', transform: true }); // { name: 'Wreck-it Ralph' } + * + * If you pass a transform in `toObject()` options, Mongoose will apply the transform + * to [subdocuments](/docs/subdocs.html) in addition to the top-level document. + * Similarly, `transform: false` skips transforms for all subdocuments. + * Note that this behavior is different for transforms defined in the schema: + * if you define a transform in `schema.options.toObject.transform`, that transform + * will **not** apply to subdocuments. + * + * const memberSchema = new Schema({ name: String, email: String }); + * const groupSchema = new Schema({ members: [memberSchema], name: String, email }); + * const Group = mongoose.model('Group', groupSchema); + * + * const doc = new Group({ + * name: 'Engineering', + * email: 'dev@mongoosejs.io', + * members: [{ name: 'Val', email: 'val@mongoosejs.io' }] + * }); + * + * // Removes `email` from both top-level document **and** array elements + * // { name: 'Engineering', members: [{ name: 'Val' }] } + * doc.toObject({ transform: (doc, ret) => { delete ret.email; return ret; } }); + * + * Transforms, like all of these options, are also available for `toJSON`. See [this guide to `JSON.stringify()`](https://thecodebarbarian.com/the-80-20-guide-to-json-stringify-in-javascript.html) to learn why `toJSON()` and `toObject()` are separate functions. + * + * See [schema options](/docs/guide.html#toObject) for some more details. + * + * _During save, no custom options are applied to the document before being sent to the database._ + * + * @param {Object} [options] + * @param {Boolean} [options.getters=false] if true, apply all getters, including virtuals + * @param {Boolean} [options.virtuals=false] if true, apply virtuals, including aliases. Use `{ getters: true, virtuals: false }` to just apply getters, not virtuals + * @param {Boolean} [options.aliases=true] if `options.virtuals = true`, you can set `options.aliases = false` to skip applying aliases. This option is a no-op if `options.virtuals = false`. + * @param {Boolean} [options.minimize=true] if true, omit any empty objects from the output + * @param {Function|null} [options.transform=null] if set, mongoose will call this function to allow you to transform the returned object + * @param {Boolean} [options.depopulate=false] if true, replace any conventionally populated paths with the original id in the output. Has no affect on virtual populated paths. + * @param {Boolean} [options.versionKey=true] if false, exclude the version key (`__v` by default) from the output + * @param {Boolean} [options.flattenMaps=false] if true, convert Maps to POJOs. Useful if you want to `JSON.stringify()` the result of `toObject()`. + * @param {Boolean} [options.useProjection=false] - If true, omits fields that are excluded in this document's projection. Unless you specified a projection, this will omit any field that has `select: false` in the schema. + * @return {Object} js object + * @see mongodb.Binary https://mongodb.github.com/node-mongodb-native/api-bson-generated/binary.html + * @api public + * @memberOf Document + * @instance + */ + +Document.prototype.toObject = function(options) { + return this.$toObject(options); +}; + +/*! + * Minimizes an object, removing undefined values and empty objects + * + * @param {Object} object to minimize + * @return {Object} + */ + +function minimize(obj) { + const keys = Object.keys(obj); + let i = keys.length; + let hasKeys; + let key; + let val; + + while (i--) { + key = keys[i]; + val = obj[key]; + + if (utils.isPOJO(val)) { + obj[key] = minimize(val); + } + + if (undefined === obj[key]) { + delete obj[key]; + continue; + } + + hasKeys = true; + } + + return hasKeys + ? obj + : undefined; +} + +/*! + * Applies virtuals properties to `json`. + */ + +function applyVirtuals(self, json, options, toObjectOptions) { + const schema = self.$__schema; + const paths = Object.keys(schema.virtuals); + let i = paths.length; + const numPaths = i; + let path; + let assignPath; + let cur = self._doc; + let v; + const aliases = typeof (toObjectOptions && toObjectOptions.aliases) === 'boolean' + ? toObjectOptions.aliases + : true; + + let virtualsToApply = null; + if (Array.isArray(options.virtuals)) { + virtualsToApply = new Set(options.virtuals); + } + else if (options.virtuals && options.virtuals.pathsToSkip) { + virtualsToApply = new Set(paths); + for (let i = 0; i < options.virtuals.pathsToSkip.length; i++) { + if (virtualsToApply.has(options.virtuals.pathsToSkip[i])) { + virtualsToApply.delete(options.virtuals.pathsToSkip[i]); + } + } + } + + if (!cur) { + return json; + } + + options = options || {}; + for (i = 0; i < numPaths; ++i) { + path = paths[i]; + + if (virtualsToApply != null && !virtualsToApply.has(path)) { + continue; + } + + // Allow skipping aliases with `toObject({ virtuals: true, aliases: false })` + if (!aliases && schema.aliases.hasOwnProperty(path)) { + continue; + } + + // We may be applying virtuals to a nested object, for example if calling + // `doc.nestedProp.toJSON()`. If so, the path we assign to, `assignPath`, + // will be a trailing substring of the `path`. + assignPath = path; + if (options.path != null) { + if (!path.startsWith(options.path + '.')) { + continue; + } + assignPath = path.substring(options.path.length + 1); + } + const parts = assignPath.split('.'); + v = clone(self.get(path), options); + if (v === void 0) { + continue; + } + const plen = parts.length; + cur = json; + for (let j = 0; j < plen - 1; ++j) { + cur[parts[j]] = cur[parts[j]] || {}; + cur = cur[parts[j]]; + } + cur[parts[plen - 1]] = v; + } + + return json; +} + + +/*! + * Applies virtuals properties to `json`. + * + * @param {Document} self + * @param {Object} json + * @return {Object} `json` + */ + +function applyGetters(self, json, options) { + const schema = self.$__schema; + const paths = Object.keys(schema.paths); + let i = paths.length; + let path; + let cur = self._doc; + let v; + + if (!cur) { + return json; + } + + while (i--) { + path = paths[i]; + + const parts = path.split('.'); + const plen = parts.length; + const last = plen - 1; + let branch = json; + let part; + cur = self._doc; + + if (!self.$__isSelected(path)) { + continue; + } + + for (let ii = 0; ii < plen; ++ii) { + part = parts[ii]; + v = cur[part]; + if (ii === last) { + const val = self.$get(path); + branch[part] = clone(val, options); + } else if (v == null) { + if (part in cur) { + branch[part] = v; + } + break; + } else { + branch = branch[part] || (branch[part] = {}); + } + cur = v; + } + } + + return json; +} + +/*! + * Applies schema type transforms to `json`. + * + * @param {Document} self + * @param {Object} json + * @return {Object} `json` + */ + +function applySchemaTypeTransforms(self, json) { + const schema = self.$__schema; + const paths = Object.keys(schema.paths || {}); + const cur = self._doc; + + if (!cur) { + return json; + } + + for (const path of paths) { + const schematype = schema.paths[path]; + if (typeof schematype.options.transform === 'function') { + const val = self.$get(path); + if (val === undefined) { + continue; + } + const transformedValue = schematype.options.transform.call(self, val); + throwErrorIfPromise(path, transformedValue); + utils.setValue(path, transformedValue, json); + } else if (schematype.$embeddedSchemaType != null && + typeof schematype.$embeddedSchemaType.options.transform === 'function') { + const val = self.$get(path); + if (val === undefined) { + continue; + } + const vals = [].concat(val); + const transform = schematype.$embeddedSchemaType.options.transform; + for (let i = 0; i < vals.length; ++i) { + const transformedValue = transform.call(self, vals[i]); + vals[i] = transformedValue; + throwErrorIfPromise(path, transformedValue); + } + + json[path] = vals; + } + } + + return json; +} + +function throwErrorIfPromise(path, transformedValue) { + if (isPromise(transformedValue)) { + throw new Error('`transform` function must be synchronous, but the transform on path `' + path + '` returned a promise.'); + } +} + +/*! + * ignore + */ + +function omitDeselectedFields(self, json) { + const schema = self.$__schema; + const paths = Object.keys(schema.paths || {}); + const cur = self._doc; + + if (!cur) { + return json; + } + + let selected = self.$__.selected; + if (selected === void 0) { + selected = {}; + queryhelpers.applyPaths(selected, schema); + } + if (selected == null || Object.keys(selected).length === 0) { + return json; + } + + for (const path of paths) { + if (selected[path] != null && !selected[path]) { + delete json[path]; + } + } + + return json; +} + +/** + * The return value of this method is used in calls to [`JSON.stringify(doc)`](https://thecodebarbarian.com/the-80-20-guide-to-json-stringify-in-javascript#the-tojson-function). + * + * This method accepts the same options as [Document#toObject](#document_Document-toObject). To apply the options to every document of your schema by default, set your [schemas](#schema_Schema) `toJSON` option to the same argument. + * + * schema.set('toJSON', { virtuals: true }); + * + * There is one difference between `toJSON()` and `toObject()` options. + * When you call `toJSON()`, the [`flattenMaps` option](./document.html#document_Document-toObject) defaults to `true`, because `JSON.stringify()` doesn't convert maps to objects by default. + * When you call `toObject()`, the `flattenMaps` option is `false` by default. + * + * See [schema options](/docs/guide.html#toJSON) for more information on setting `toJSON` option defaults. + * + * @param {Object} options + * @param {Boolean} [options.flattenMaps=true] if true, convert Maps to [POJOs](https://masteringjs.io/tutorials/fundamentals/pojo). Useful if you want to `JSON.stringify()` the result. + * @return {Object} + * @see Document#toObject #document_Document-toObject + * @see JSON.stringify() in JavaScript https://thecodebarbarian.com/the-80-20-guide-to-json-stringify-in-javascript.html + * @api public + * @memberOf Document + * @instance + */ + +Document.prototype.toJSON = function(options) { + return this.$toObject(options, true); +}; + + +Document.prototype.ownerDocument = function() { + return this; +}; + + +/** + * If this document is a subdocument or populated document, returns the document's + * parent. Returns the original document if there is no parent. + * + * @api public + * @method parent + * @memberOf Document + * @instance + */ + +Document.prototype.parent = function() { + if (this.$isSubdocument || this.$__.wasPopulated) { + return this.$__.parent; + } + return this; +}; + +/** + * Alias for `parent()`. If this document is a subdocument or populated + * document, returns the document's parent. Returns `undefined` otherwise. + * + * @api public + * @method $parent + * @memberOf Document + * @instance + */ + +Document.prototype.$parent = Document.prototype.parent; + +/** + * Helper for console.log + * + * @api public + * @method inspect + * @memberOf Document + * @instance + */ + +Document.prototype.inspect = function(options) { + const isPOJO = utils.isPOJO(options); + let opts; + if (isPOJO) { + opts = options; + opts.minimize = false; + } + const ret = this.toObject(opts); + + if (ret == null) { + // If `toObject()` returns null, `this` is still an object, so if `inspect()` + // prints out null this can cause some serious confusion. See gh-7942. + return 'MongooseDocument { ' + ret + ' }'; + } + + return ret; +}; + +if (inspect.custom) { + /*! + * Avoid Node deprecation warning DEP0079 + */ + + Document.prototype[inspect.custom] = Document.prototype.inspect; +} + +/** + * Helper for console.log + * + * @api public + * @method toString + * @memberOf Document + * @instance + */ + +Document.prototype.toString = function() { + const ret = this.inspect(); + if (typeof ret === 'string') { + return ret; + } + return inspect(ret); +}; + +/** + * Returns true if this document is equal to another document. + * + * Documents are considered equal when they have matching `_id`s, unless neither + * document has an `_id`, in which case this function falls back to using + * `deepEqual()`. + * + * @param {Document} doc a document to compare + * @return {Boolean} + * @api public + * @memberOf Document + * @instance + */ + +Document.prototype.equals = function(doc) { + if (!doc) { + return false; + } + + const tid = this.$__getValue('_id'); + const docid = doc.$__ != null ? doc.$__getValue('_id') : doc; + if (!tid && !docid) { + return deepEqual(this, doc); + } + return tid && tid.equals + ? tid.equals(docid) + : tid === docid; +}; + +/** + * Populates paths on an existing document. + * + * #### Example: + * + * await doc.populate([ + * 'stories', + * { path: 'fans', sort: { name: -1 } } + * ]); + * doc.populated('stories'); // Array of ObjectIds + * doc.stories[0].title; // 'Casino Royale' + * doc.populated('fans'); // Array of ObjectIds + * + * await doc.populate('fans', '-email'); + * doc.fans[0].email // not populated + * + * await doc.populate('author fans', '-email'); + * doc.author.email // not populated + * doc.fans[0].email // not populated + * + * @param {String|Object|Array} path either the path to populate or an object specifying all parameters, or either an array of those + * @param {Object|String} [select] Field selection for the population query + * @param {Model} [model] The model you wish to use for population. If not specified, populate will look up the model by the name in the Schema's `ref` field. + * @param {Object} [match] Conditions for the population query + * @param {Object} [options] Options for the population query (sort, etc) + * @param {String} [options.path=null] The path to populate. + * @param {string|PopulateOptions} [options.populate=null] Recursively populate paths in the populated documents. See [deep populate docs](/docs/populate.html#deep-populate). + * @param {boolean} [options.retainNullValues=false] by default, Mongoose removes null and undefined values from populated arrays. Use this option to make `populate()` retain `null` and `undefined` array entries. + * @param {boolean} [options.getters=false] if true, Mongoose will call any getters defined on the `localField`. By default, Mongoose gets the raw value of `localField`. For example, you would need to set this option to `true` if you wanted to [add a `lowercase` getter to your `localField`](/docs/schematypes.html#schematype-options). + * @param {boolean} [options.clone=false] When you do `BlogPost.find().populate('author')`, blog posts with the same author will share 1 copy of an `author` doc. Enable this option to make Mongoose clone populated docs before assigning them. + * @param {Object|Function} [options.match=null] Add an additional filter to the populate query. Can be a filter object containing [MongoDB query syntax](https://docs.mongodb.com/manual/tutorial/query-documents/), or a function that returns a filter object. + * @param {Function} [options.transform=null] Function that Mongoose will call on every populated document that allows you to transform the populated document. + * @param {Object} [options.options=null] Additional options like `limit` and `lean`. + * @param {Function} [callback] Callback + * @see population ./populate.html + * @see Query#select #query_Query-select + * @see Model.populate #model_Model.populate + * @memberOf Document + * @instance + * @return {Promise|null} + * @api public + */ + +Document.prototype.populate = function populate() { + const pop = {}; + const args = [...arguments]; + let fn; + + if (args.length !== 0) { + if (typeof args[args.length - 1] === 'function') { + fn = args.pop(); + } + + // use hash to remove duplicate paths + const res = utils.populate.apply(null, args); + for (const populateOptions of res) { + pop[populateOptions.path] = populateOptions; + } + } + + const paths = utils.object.vals(pop); + let topLevelModel = this.constructor; + if (this.$__isNested) { + topLevelModel = this.$__[scopeSymbol].constructor; + const nestedPath = this.$__.nestedPath; + paths.forEach(function(populateOptions) { + populateOptions.path = nestedPath + '.' + populateOptions.path; + }); + } + + // Use `$session()` by default if the document has an associated session + // See gh-6754 + if (this.$session() != null) { + const session = this.$session(); + paths.forEach(path => { + if (path.options == null) { + path.options = { session: session }; + return; + } + if (!('session' in path.options)) { + path.options.session = session; + } + }); + } + + paths.forEach(p => { + p._localModel = topLevelModel; + }); + + return topLevelModel.populate(this, paths, fn); +}; + +/** + * Gets all populated documents associated with this document. + * + * @api public + * @return {Array} array of populated documents. Empty array if there are no populated documents associated with this document. + * @memberOf Document + * @method $getPopulatedDocs + * @instance + */ + +Document.prototype.$getPopulatedDocs = function $getPopulatedDocs() { + let keys = []; + if (this.$__.populated != null) { + keys = keys.concat(Object.keys(this.$__.populated)); + } + let result = []; + for (const key of keys) { + const value = this.$get(key); + if (Array.isArray(value)) { + result = result.concat(value); + } else if (value instanceof Document) { + result.push(value); + } + } + return result; +}; + +/** + * Gets _id(s) used during population of the given `path`. + * + * #### Example: + * + * const doc = await Model.findOne().populate('author'); + * + * console.log(doc.author.name); // Dr.Seuss + * console.log(doc.populated('author')); // '5144cf8050f071d979c118a7' + * + * If the path was not populated, returns `undefined`. + * + * @param {String} path + * @return {Array|ObjectId|Number|Buffer|String|undefined} + * @memberOf Document + * @instance + * @api public + */ + +Document.prototype.populated = function(path, val, options) { + // val and options are internal + if (val == null || val === true) { + if (!this.$__.populated) { + return undefined; + } + if (typeof path !== 'string') { + return undefined; + } + + // Map paths can be populated with either `path.$*` or just `path` + const _path = path.endsWith('.$*') ? path.replace(/\.\$\*$/, '') : path; + + const v = this.$__.populated[_path]; + if (v) { + return val === true ? v : v.value; + } + return undefined; + } + + this.$__.populated || (this.$__.populated = {}); + this.$__.populated[path] = { value: val, options: options }; + + // If this was a nested populate, make sure each populated doc knows + // about its populated children (gh-7685) + const pieces = path.split('.'); + for (let i = 0; i < pieces.length - 1; ++i) { + const subpath = pieces.slice(0, i + 1).join('.'); + const subdoc = this.$get(subpath); + if (subdoc != null && subdoc.$__ != null && this.$populated(subpath)) { + const rest = pieces.slice(i + 1).join('.'); + subdoc.$populated(rest, val, options); + // No need to continue because the above recursion should take care of + // marking the rest of the docs as populated + break; + } + } + + return val; +}; + +Document.prototype.$populated = Document.prototype.populated; + +/** + * Throws an error if a given path is not populated + * + * #### Example: + * + * const doc = await Model.findOne().populate('author'); + * + * doc.$assertPopulated('author'); // does not throw + * doc.$assertPopulated('other path'); // throws an error + * + * + * @param {String | Array} path + * @return {Document} this + * @memberOf Document + * @instance + * @api public + */ + +Document.prototype.$assertPopulated = function $assertPopulated(paths) { + if (Array.isArray(paths)) { + paths.forEach(path => this.$assertPopulated(path)); + return this; + } + + if (!this.$populated(paths)) { + throw new MongooseError(`Expected path "${paths}" to be populated`); + } + + return this; +}; + +/** + * Takes a populated field and returns it to its unpopulated state. + * + * #### Example: + * + * Model.findOne().populate('author').exec(function (err, doc) { + * console.log(doc.author.name); // Dr.Seuss + * console.log(doc.depopulate('author')); + * console.log(doc.author); // '5144cf8050f071d979c118a7' + * }) + * + * If the path was not provided, then all populated fields are returned to their unpopulated state. + * + * @param {String} path + * @return {Document} this + * @see Document.populate #document_Document-populate + * @api public + * @memberOf Document + * @instance + */ + +Document.prototype.depopulate = function(path) { + if (typeof path === 'string') { + path = path.indexOf(' ') === -1 ? [path] : path.split(' '); + } + + let populatedIds; + const virtualKeys = this.$$populatedVirtuals ? Object.keys(this.$$populatedVirtuals) : []; + const populated = this.$__ && this.$__.populated || {}; + + if (arguments.length === 0) { + // Depopulate all + for (const virtualKey of virtualKeys) { + delete this.$$populatedVirtuals[virtualKey]; + delete this._doc[virtualKey]; + delete populated[virtualKey]; + } + + const keys = Object.keys(populated); + + for (const key of keys) { + populatedIds = this.$populated(key); + if (!populatedIds) { + continue; + } + delete populated[key]; + utils.setValue(key, populatedIds, this._doc); + } + return this; + } + + for (const singlePath of path) { + populatedIds = this.$populated(singlePath); + delete populated[singlePath]; + + if (virtualKeys.indexOf(singlePath) !== -1) { + delete this.$$populatedVirtuals[singlePath]; + delete this._doc[singlePath]; + } else if (populatedIds) { + utils.setValue(singlePath, populatedIds, this._doc); + } + } + return this; +}; + + +/** + * Returns the full path to this document. + * + * @param {String} [path] + * @return {String} + * @api private + * @method $__fullPath + * @memberOf Document + * @instance + */ + +Document.prototype.$__fullPath = function(path) { + // overridden in SubDocuments + return path || ''; +}; + +/** + * Returns the changes that happened to the document + * in the format that will be sent to MongoDB. + * + * #### Example: + * + * const userSchema = new Schema({ + * name: String, + * age: Number, + * country: String + * }); + * const User = mongoose.model('User', userSchema); + * const user = await User.create({ + * name: 'Hafez', + * age: 25, + * country: 'Egypt' + * }); + * + * // returns an empty object, no changes happened yet + * user.getChanges(); // { } + * + * user.country = undefined; + * user.age = 26; + * + * user.getChanges(); // { $set: { age: 26 }, { $unset: { country: 1 } } } + * + * await user.save(); + * + * user.getChanges(); // { } + * + * Modifying the object that `getChanges()` returns does not affect the document's + * change tracking state. Even if you `delete user.getChanges().$set`, Mongoose + * will still send a `$set` to the server. + * + * @return {Object} + * @api public + * @method getChanges + * @memberOf Document + * @instance + */ + +Document.prototype.getChanges = function() { + const delta = this.$__delta(); + const changes = delta ? delta[1] : {}; + return changes; +}; + +/*! + * Module exports. + */ + +Document.ValidationError = ValidationError; +module.exports = exports = Document; diff --git a/node_modules/mongoose/lib/document_provider.js b/node_modules/mongoose/lib/document_provider.js new file mode 100644 index 000000000..1ace61f4f --- /dev/null +++ b/node_modules/mongoose/lib/document_provider.js @@ -0,0 +1,30 @@ +'use strict'; + +/* eslint-env browser */ + +/*! + * Module dependencies. + */ +const Document = require('./document.js'); +const BrowserDocument = require('./browserDocument.js'); + +let isBrowser = false; + +/** + * Returns the Document constructor for the current context + * + * @api private + */ +module.exports = function() { + if (isBrowser) { + return BrowserDocument; + } + return Document; +}; + +/*! + * ignore + */ +module.exports.setBrowser = function(flag) { + isBrowser = flag; +}; diff --git a/node_modules/mongoose/lib/driver.js b/node_modules/mongoose/lib/driver.js new file mode 100644 index 000000000..cf7ca3d7b --- /dev/null +++ b/node_modules/mongoose/lib/driver.js @@ -0,0 +1,15 @@ +'use strict'; + +/*! + * ignore + */ + +let driver = null; + +module.exports.get = function() { + return driver; +}; + +module.exports.set = function(v) { + driver = v; +}; diff --git a/node_modules/mongoose/lib/drivers/SPEC.md b/node_modules/mongoose/lib/drivers/SPEC.md new file mode 100644 index 000000000..64646931e --- /dev/null +++ b/node_modules/mongoose/lib/drivers/SPEC.md @@ -0,0 +1,4 @@ + +# Driver Spec + +TODO diff --git a/node_modules/mongoose/lib/drivers/browser/ReadPreference.js b/node_modules/mongoose/lib/drivers/browser/ReadPreference.js new file mode 100644 index 000000000..136357081 --- /dev/null +++ b/node_modules/mongoose/lib/drivers/browser/ReadPreference.js @@ -0,0 +1,7 @@ +/*! + * ignore + */ + +'use strict'; + +module.exports = function() {}; diff --git a/node_modules/mongoose/lib/drivers/browser/binary.js b/node_modules/mongoose/lib/drivers/browser/binary.js new file mode 100644 index 000000000..4658f7b9e --- /dev/null +++ b/node_modules/mongoose/lib/drivers/browser/binary.js @@ -0,0 +1,14 @@ + +/*! + * Module dependencies. + */ + +'use strict'; + +const Binary = require('bson').Binary; + +/*! + * Module exports. + */ + +module.exports = exports = Binary; diff --git a/node_modules/mongoose/lib/drivers/browser/decimal128.js b/node_modules/mongoose/lib/drivers/browser/decimal128.js new file mode 100644 index 000000000..5668182b3 --- /dev/null +++ b/node_modules/mongoose/lib/drivers/browser/decimal128.js @@ -0,0 +1,7 @@ +/*! + * ignore + */ + +'use strict'; + +module.exports = require('bson').Decimal128; diff --git a/node_modules/mongoose/lib/drivers/browser/index.js b/node_modules/mongoose/lib/drivers/browser/index.js new file mode 100644 index 000000000..bc4ac5f6b --- /dev/null +++ b/node_modules/mongoose/lib/drivers/browser/index.js @@ -0,0 +1,16 @@ +/*! + * Module exports. + */ + +'use strict'; + +exports.Binary = require('./binary'); +exports.Collection = function() { + throw new Error('Cannot create a collection from browser library'); +}; +exports.getConnection = () => function() { + throw new Error('Cannot create a connection from browser library'); +}; +exports.Decimal128 = require('./decimal128'); +exports.ObjectId = require('./objectid'); +exports.ReadPreference = require('./ReadPreference'); diff --git a/node_modules/mongoose/lib/drivers/browser/objectid.js b/node_modules/mongoose/lib/drivers/browser/objectid.js new file mode 100644 index 000000000..b1e603d71 --- /dev/null +++ b/node_modules/mongoose/lib/drivers/browser/objectid.js @@ -0,0 +1,28 @@ + +/*! + * [node-mongodb-native](https://github.com/mongodb/node-mongodb-native) ObjectId + * @constructor NodeMongoDbObjectId + * @see ObjectId + */ + +'use strict'; + +const ObjectId = require('bson').ObjectID; + +/*! + * Getter for convenience with populate, see gh-6115 + */ + +Object.defineProperty(ObjectId.prototype, '_id', { + enumerable: false, + configurable: true, + get: function() { + return this; + } +}); + +/*! + * ignore + */ + +module.exports = exports = ObjectId; diff --git a/node_modules/mongoose/lib/drivers/node-mongodb-native/ReadPreference.js b/node_modules/mongoose/lib/drivers/node-mongodb-native/ReadPreference.js new file mode 100644 index 000000000..024ee181a --- /dev/null +++ b/node_modules/mongoose/lib/drivers/node-mongodb-native/ReadPreference.js @@ -0,0 +1,47 @@ +/*! + * Module dependencies. + */ + +'use strict'; + +const mongodb = require('mongodb'); +const ReadPref = mongodb.ReadPreference; + +/*! + * Converts arguments to ReadPrefs the driver + * can understand. + * + * @param {String|Array} pref + * @param {Array} [tags] + */ + +module.exports = function readPref(pref, tags) { + if (Array.isArray(pref)) { + tags = pref[1]; + pref = pref[0]; + } + + if (pref instanceof ReadPref) { + return pref; + } + + switch (pref) { + case 'p': + pref = 'primary'; + break; + case 'pp': + pref = 'primaryPreferred'; + break; + case 's': + pref = 'secondary'; + break; + case 'sp': + pref = 'secondaryPreferred'; + break; + case 'n': + pref = 'nearest'; + break; + } + + return new ReadPref(pref, tags); +}; diff --git a/node_modules/mongoose/lib/drivers/node-mongodb-native/binary.js b/node_modules/mongoose/lib/drivers/node-mongodb-native/binary.js new file mode 100644 index 000000000..4e3c86f78 --- /dev/null +++ b/node_modules/mongoose/lib/drivers/node-mongodb-native/binary.js @@ -0,0 +1,10 @@ + +/*! + * Module dependencies. + */ + +'use strict'; + +const Binary = require('mongodb').Binary; + +module.exports = exports = Binary; diff --git a/node_modules/mongoose/lib/drivers/node-mongodb-native/collection.js b/node_modules/mongoose/lib/drivers/node-mongodb-native/collection.js new file mode 100644 index 000000000..b390fa1f3 --- /dev/null +++ b/node_modules/mongoose/lib/drivers/node-mongodb-native/collection.js @@ -0,0 +1,415 @@ +'use strict'; + +/*! + * Module dependencies. + */ + +const MongooseCollection = require('../../collection'); +const MongooseError = require('../../error/mongooseError'); +const Collection = require('mongodb').Collection; +const ObjectId = require('./objectid'); +const getConstructorName = require('../../helpers/getConstructorName'); +const stream = require('stream'); +const util = require('util'); + +/** + * A [node-mongodb-native](https://github.com/mongodb/node-mongodb-native) collection implementation. + * + * All methods methods from the [node-mongodb-native](https://github.com/mongodb/node-mongodb-native) driver are copied and wrapped in queue management. + * + * @inherits Collection + * @api private + */ + +function NativeCollection(name, conn, options) { + this.collection = null; + this.Promise = options.Promise || Promise; + this.modelName = options.modelName; + delete options.modelName; + this._closed = false; + MongooseCollection.apply(this, arguments); +} + +/*! + * Inherit from abstract Collection. + */ + +NativeCollection.prototype.__proto__ = MongooseCollection.prototype; + +/** + * Called when the connection opens. + * + * @api private + */ + +NativeCollection.prototype.onOpen = function() { + const _this = this; + + _this.collection = _this.conn.db.collection(_this.name); + MongooseCollection.prototype.onOpen.call(_this); + return _this.collection; +}; + +/** + * Called when the connection closes + * + * @api private + */ + +NativeCollection.prototype.onClose = function(force) { + MongooseCollection.prototype.onClose.call(this, force); +}; + +/*! + * ignore + */ + +const syncCollectionMethods = { watch: true, find: true, aggregate: true }; + +/*! + * Copy the collection methods and make them subject to queues + */ + +function iter(i) { + NativeCollection.prototype[i] = function() { + const collection = this.collection; + const args = Array.from(arguments); + const _this = this; + const debug = _this && + _this.conn && + _this.conn.base && + _this.conn.base.options && + _this.conn.base.options.debug; + const lastArg = arguments[arguments.length - 1]; + const opId = new ObjectId(); + + // If user force closed, queueing will hang forever. See #5664 + if (this.conn.$wasForceClosed) { + const error = new MongooseError('Connection was force closed'); + if (args.length > 0 && + typeof args[args.length - 1] === 'function') { + args[args.length - 1](error); + return; + } else { + throw error; + } + } + + let _args = args; + let callback = null; + if (this._shouldBufferCommands() && this.buffer) { + if (syncCollectionMethods[i] && typeof lastArg !== 'function') { + throw new Error('Collection method ' + i + ' is synchronous'); + } + + this.conn.emit('buffer', { + _id: opId, + modelName: _this.modelName, + collectionName: _this.name, + method: i, + args: args + }); + + let callback; + let _args = args; + let promise = null; + let timeout = null; + if (syncCollectionMethods[i]) { + this.addQueue(() => { + lastArg.call(this, null, this[i].apply(this, _args.slice(0, _args.length - 1))); + }, []); + } else if (typeof lastArg === 'function') { + callback = function collectionOperationCallback() { + if (timeout != null) { + clearTimeout(timeout); + } + return lastArg.apply(this, arguments); + }; + _args = args.slice(0, args.length - 1).concat([callback]); + } else { + promise = new this.Promise((resolve, reject) => { + callback = function collectionOperationCallback(err, res) { + if (timeout != null) { + clearTimeout(timeout); + } + if (err != null) { + return reject(err); + } + resolve(res); + }; + _args = args.concat([callback]); + this.addQueue(i, _args); + }); + } + + const bufferTimeoutMS = this._getBufferTimeoutMS(); + timeout = setTimeout(() => { + const removed = this.removeQueue(i, _args); + if (removed) { + const message = 'Operation `' + this.name + '.' + i + '()` buffering timed out after ' + + bufferTimeoutMS + 'ms'; + const err = new MongooseError(message); + this.conn.emit('buffer-end', { _id: opId, modelName: _this.modelName, collectionName: _this.name, method: i, error: err }); + callback(err); + } + }, bufferTimeoutMS); + + if (!syncCollectionMethods[i] && typeof lastArg === 'function') { + this.addQueue(i, _args); + return; + } + + return promise; + } else if (!syncCollectionMethods[i] && typeof lastArg === 'function') { + callback = function collectionOperationCallback(err, res) { + if (err != null) { + _this.conn.emit('operation-end', { _id: opId, modelName: _this.modelName, collectionName: _this.name, method: i, error: err }); + } else { + _this.conn.emit('operation-end', { _id: opId, modelName: _this.modelName, collectionName: _this.name, method: i, result: res }); + } + return lastArg.apply(this, arguments); + }; + _args = args.slice(0, args.length - 1).concat([callback]); + } + + if (debug) { + if (typeof debug === 'function') { + debug.apply(_this, + [_this.name, i].concat(args.slice(0, args.length - 1))); + } else if (debug instanceof stream.Writable) { + this.$printToStream(_this.name, i, args, debug); + } else { + const color = debug.color == null ? true : debug.color; + const shell = debug.shell == null ? false : debug.shell; + this.$print(_this.name, i, args, color, shell); + } + } + + this.conn.emit('operation-start', { _id: opId, modelName: _this.modelName, collectionName: this.name, method: i, params: _args }); + + try { + if (collection == null) { + const message = 'Cannot call `' + this.name + '.' + i + '()` before initial connection ' + + 'is complete if `bufferCommands = false`. Make sure you `await mongoose.connect()` if ' + + 'you have `bufferCommands = false`.'; + throw new MongooseError(message); + } + + if (syncCollectionMethods[i] && typeof lastArg === 'function') { + return lastArg.call(this, null, collection[i].apply(collection, _args.slice(0, _args.length - 1))); + } + + const ret = collection[i].apply(collection, _args); + if (ret != null && typeof ret.then === 'function') { + return ret.then( + res => { + this.conn.emit('operation-end', { _id: opId, modelName: this.modelName, collectionName: this.name, method: i, result: res }); + return res; + }, + err => { + this.conn.emit('operation-end', { _id: opId, modelName: this.modelName, collectionName: this.name, method: i, error: err }); + throw err; + } + ); + } + return ret; + } catch (error) { + // Collection operation may throw because of max bson size, catch it here + // See gh-3906 + if (typeof lastArg === 'function') { + return lastArg(error); + } else { + this.conn.emit('operation-end', { _id: opId, modelName: _this.modelName, collectionName: this.name, method: i, error: error }); + + throw error; + } + } + }; +} + +for (const key of Object.getOwnPropertyNames(Collection.prototype)) { + // Janky hack to work around gh-3005 until we can get rid of the mongoose + // collection abstraction + const descriptor = Object.getOwnPropertyDescriptor(Collection.prototype, key); + // Skip properties with getters because they may throw errors (gh-8528) + if (descriptor.get !== undefined) { + continue; + } + if (typeof Collection.prototype[key] !== 'function') { + continue; + } + + iter(key); +} + +/** + * Debug print helper + * + * @api public + * @method $print + */ + +NativeCollection.prototype.$print = function(name, i, args, color, shell) { + const moduleName = color ? '\x1B[0;36mMongoose:\x1B[0m ' : 'Mongoose: '; + const functionCall = [name, i].join('.'); + const _args = []; + for (let j = args.length - 1; j >= 0; --j) { + if (this.$format(args[j]) || _args.length) { + _args.unshift(this.$format(args[j], color, shell)); + } + } + const params = '(' + _args.join(', ') + ')'; + + console.info(moduleName + functionCall + params); +}; + +/** + * Debug print helper + * + * @api public + * @method $print + */ + +NativeCollection.prototype.$printToStream = function(name, i, args, stream) { + const functionCall = [name, i].join('.'); + const _args = []; + for (let j = args.length - 1; j >= 0; --j) { + if (this.$format(args[j]) || _args.length) { + _args.unshift(this.$format(args[j])); + } + } + const params = '(' + _args.join(', ') + ')'; + + stream.write(functionCall + params, 'utf8'); +}; + +/** + * Formatter for debug print args + * + * @api public + * @method $format + */ + +NativeCollection.prototype.$format = function(arg, color, shell) { + const type = typeof arg; + if (type === 'function' || type === 'undefined') return ''; + return format(arg, false, color, shell); +}; + +/*! + * Debug print helper + */ + +function inspectable(representation) { + const ret = { + inspect: function() { return representation; } + }; + if (util.inspect.custom) { + ret[util.inspect.custom] = ret.inspect; + } + return ret; +} +function map(o) { + return format(o, true); +} +function formatObjectId(x, key) { + x[key] = inspectable('ObjectId("' + x[key].toHexString() + '")'); +} +function formatDate(x, key, shell) { + if (shell) { + x[key] = inspectable('ISODate("' + x[key].toUTCString() + '")'); + } else { + x[key] = inspectable('new Date("' + x[key].toUTCString() + '")'); + } +} +function format(obj, sub, color, shell) { + if (obj && typeof obj.toBSON === 'function') { + obj = obj.toBSON(); + } + if (obj == null) { + return obj; + } + + const clone = require('../../helpers/clone'); + let x = clone(obj, { transform: false }); + const constructorName = getConstructorName(x); + + if (constructorName === 'Binary') { + x = 'BinData(' + x.sub_type + ', "' + x.toString('base64') + '")'; + } else if (constructorName === 'ObjectID') { + x = inspectable('ObjectId("' + x.toHexString() + '")'); + } else if (constructorName === 'Date') { + x = inspectable('new Date("' + x.toUTCString() + '")'); + } else if (constructorName === 'Object') { + const keys = Object.keys(x); + const numKeys = keys.length; + let key; + for (let i = 0; i < numKeys; ++i) { + key = keys[i]; + if (x[key]) { + let error; + if (typeof x[key].toBSON === 'function') { + try { + // `session.toBSON()` throws an error. This means we throw errors + // in debug mode when using transactions, see gh-6712. As a + // workaround, catch `toBSON()` errors, try to serialize without + // `toBSON()`, and rethrow if serialization still fails. + x[key] = x[key].toBSON(); + } catch (_error) { + error = _error; + } + } + const _constructorName = getConstructorName(x[key]); + if (_constructorName === 'Binary') { + x[key] = 'BinData(' + x[key].sub_type + ', "' + + x[key].buffer.toString('base64') + '")'; + } else if (_constructorName === 'Object') { + x[key] = format(x[key], true); + } else if (_constructorName === 'ObjectID') { + formatObjectId(x, key); + } else if (_constructorName === 'Date') { + formatDate(x, key, shell); + } else if (_constructorName === 'ClientSession') { + x[key] = inspectable('ClientSession("' + + ( + x[key] && + x[key].id && + x[key].id.id && + x[key].id.id.buffer || '' + ).toString('hex') + '")'); + } else if (Array.isArray(x[key])) { + x[key] = x[key].map(map); + } else if (error != null) { + // If there was an error with `toBSON()` and the object wasn't + // already converted to a string representation, rethrow it. + // Open to better ideas on how to handle this. + throw error; + } + } + } + } + if (sub) { + return x; + } + + return util. + inspect(x, false, 10, color). + replace(/\n/g, ''). + replace(/\s{2,}/g, ' '); +} + +/** + * Retrieves information about this collections indexes. + * + * @param {Function} callback + * @method getIndexes + * @api public + */ + +NativeCollection.prototype.getIndexes = NativeCollection.prototype.indexInformation; + +/*! + * Module exports. + */ + +module.exports = NativeCollection; diff --git a/node_modules/mongoose/lib/drivers/node-mongodb-native/connection.js b/node_modules/mongoose/lib/drivers/node-mongodb-native/connection.js new file mode 100644 index 000000000..1adad7cd8 --- /dev/null +++ b/node_modules/mongoose/lib/drivers/node-mongodb-native/connection.js @@ -0,0 +1,166 @@ +/*! + * Module dependencies. + */ + +'use strict'; + +const MongooseConnection = require('../../connection'); +const STATES = require('../../connectionstate'); +const immediate = require('../../helpers/immediate'); +const setTimeout = require('../../helpers/timers').setTimeout; + +/** + * A [node-mongodb-native](https://github.com/mongodb/node-mongodb-native) connection implementation. + * + * @inherits Connection + * @api private + */ + +function NativeConnection() { + MongooseConnection.apply(this, arguments); + this._listening = false; +} + +/** + * Expose the possible connection states. + * @api public + */ + +NativeConnection.STATES = STATES; + +/*! + * Inherits from Connection. + */ + +NativeConnection.prototype.__proto__ = MongooseConnection.prototype; + +/** + * Switches to a different database using the same connection pool. + * + * Returns a new connection object, with the new db. If you set the `useCache` + * option, `useDb()` will cache connections by `name`. + * + * **Note:** Calling `close()` on a `useDb()` connection will close the base connection as well. + * + * @param {String} name The database name + * @param {Object} [options] + * @param {Boolean} [options.useCache=false] If true, cache results so calling `useDb()` multiple times with the same name only creates 1 connection object. + * @param {Boolean} [options.noListener=false] If true, the new connection object won't listen to any events on the base connection. This is better for memory usage in cases where you're calling `useDb()` for every request. + * @return {Connection} New Connection Object + * @api public + */ + +NativeConnection.prototype.useDb = function(name, options) { + // Return immediately if cached + options = options || {}; + if (options.useCache && this.relatedDbs[name]) { + return this.relatedDbs[name]; + } + + // we have to manually copy all of the attributes... + const newConn = new this.constructor(); + newConn.name = name; + newConn.base = this.base; + newConn.collections = {}; + newConn.models = {}; + newConn.replica = this.replica; + newConn.config = Object.assign({}, this.config, newConn.config); + newConn.name = this.name; + newConn.options = this.options; + newConn._readyState = this._readyState; + newConn._closeCalled = this._closeCalled; + newConn._hasOpened = this._hasOpened; + newConn._listening = false; + newConn._parent = this; + + newConn.host = this.host; + newConn.port = this.port; + newConn.user = this.user; + newConn.pass = this.pass; + + // First, when we create another db object, we are not guaranteed to have a + // db object to work with. So, in the case where we have a db object and it + // is connected, we can just proceed with setting everything up. However, if + // we do not have a db or the state is not connected, then we need to wait on + // the 'open' event of the connection before doing the rest of the setup + // the 'connected' event is the first time we'll have access to the db object + + const _this = this; + + newConn.client = _this.client; + + if (this.db && this._readyState === STATES.connected) { + wireup(); + } else { + this.once('connected', wireup); + } + + function wireup() { + newConn.client = _this.client; + const _opts = {}; + if (options.hasOwnProperty('noListener')) { + _opts.noListener = options.noListener; + } + newConn.db = _this.client.db(name, _opts); + newConn.onOpen(); + } + + newConn.name = name; + + // push onto the otherDbs stack, this is used when state changes + if (options.noListener !== true) { + this.otherDbs.push(newConn); + } + newConn.otherDbs.push(this); + + // push onto the relatedDbs cache, this is used when state changes + if (options && options.useCache) { + this.relatedDbs[newConn.name] = newConn; + newConn.relatedDbs = this.relatedDbs; + } + + return newConn; +}; + +/** + * Closes the connection + * + * @param {Boolean} [force] + * @param {Function} [fn] + * @return {Connection} this + * @api private + */ + +NativeConnection.prototype.doClose = function(force, fn) { + if (this.client == null) { + immediate(() => fn()); + return this; + } + + let skipCloseClient = false; + if (force != null && typeof force === 'object') { + skipCloseClient = force.skipCloseClient; + force = force.force; + } + + if (skipCloseClient) { + immediate(() => fn()); + return this; + } + + this.client.close(force, (err, res) => { + // Defer because the driver will wait at least 1ms before finishing closing + // the pool, see https://github.com/mongodb-js/mongodb-core/blob/a8f8e4ce41936babc3b9112bf42d609779f03b39/lib/connection/pool.js#L1026-L1030. + // If there's queued operations, you may still get some background work + // after the callback is called. + setTimeout(() => fn(err, res), 1); + }); + return this; +}; + + +/*! + * Module exports. + */ + +module.exports = NativeConnection; diff --git a/node_modules/mongoose/lib/drivers/node-mongodb-native/decimal128.js b/node_modules/mongoose/lib/drivers/node-mongodb-native/decimal128.js new file mode 100644 index 000000000..c895f17fd --- /dev/null +++ b/node_modules/mongoose/lib/drivers/node-mongodb-native/decimal128.js @@ -0,0 +1,7 @@ +/*! + * ignore + */ + +'use strict'; + +module.exports = require('mongodb').Decimal128; diff --git a/node_modules/mongoose/lib/drivers/node-mongodb-native/index.js b/node_modules/mongoose/lib/drivers/node-mongodb-native/index.js new file mode 100644 index 000000000..2ed9eb0a5 --- /dev/null +++ b/node_modules/mongoose/lib/drivers/node-mongodb-native/index.js @@ -0,0 +1,12 @@ +/*! + * Module exports. + */ + +'use strict'; + +exports.Binary = require('./binary'); +exports.Collection = require('./collection'); +exports.Decimal128 = require('./decimal128'); +exports.ObjectId = require('./objectid'); +exports.ReadPreference = require('./ReadPreference'); +exports.getConnection = () => require('./connection'); \ No newline at end of file diff --git a/node_modules/mongoose/lib/drivers/node-mongodb-native/objectid.js b/node_modules/mongoose/lib/drivers/node-mongodb-native/objectid.js new file mode 100644 index 000000000..6f432b796 --- /dev/null +++ b/node_modules/mongoose/lib/drivers/node-mongodb-native/objectid.js @@ -0,0 +1,16 @@ + +/*! + * [node-mongodb-native](https://github.com/mongodb/node-mongodb-native) ObjectId + * @constructor NodeMongoDbObjectId + * @see ObjectId + */ + +'use strict'; + +const ObjectId = require('mongodb').ObjectId; + +/*! + * ignore + */ + +module.exports = exports = ObjectId; diff --git a/node_modules/mongoose/lib/error/browserMissingSchema.js b/node_modules/mongoose/lib/error/browserMissingSchema.js new file mode 100644 index 000000000..fe492d53c --- /dev/null +++ b/node_modules/mongoose/lib/error/browserMissingSchema.js @@ -0,0 +1,28 @@ +/*! + * Module dependencies. + */ + +'use strict'; + +const MongooseError = require('./'); + + +class MissingSchemaError extends MongooseError { + /*! + * MissingSchema Error constructor. + */ + constructor() { + super('Schema hasn\'t been registered for document.\n' + + 'Use mongoose.Document(name, schema)'); + } +} + +Object.defineProperty(MissingSchemaError.prototype, 'name', { + value: 'MongooseError' +}); + +/*! + * exports + */ + +module.exports = MissingSchemaError; diff --git a/node_modules/mongoose/lib/error/cast.js b/node_modules/mongoose/lib/error/cast.js new file mode 100644 index 000000000..d3eb0ec32 --- /dev/null +++ b/node_modules/mongoose/lib/error/cast.js @@ -0,0 +1,157 @@ +'use strict'; + +/*! + * Module dependencies. + */ + +const MongooseError = require('./mongooseError'); +const util = require('util'); + +/** + * Casting Error constructor. + * + * @param {String} type + * @param {String} value + * @inherits MongooseError + * @api private + */ + +class CastError extends MongooseError { + constructor(type, value, path, reason, schemaType) { + // If no args, assume we'll `init()` later. + if (arguments.length > 0) { + const stringValue = getStringValue(value); + const valueType = getValueType(value); + const messageFormat = getMessageFormat(schemaType); + const msg = formatMessage(null, type, stringValue, path, messageFormat, valueType, reason); + super(msg); + this.init(type, value, path, reason, schemaType); + } else { + super(formatMessage()); + } + } + + toJSON() { + return { + stringValue: this.stringValue, + valueType: this.valueType, + kind: this.kind, + value: this.value, + path: this.path, + reason: this.reason, + name: this.name, + message: this.message + }; + } + /*! + * ignore + */ + init(type, value, path, reason, schemaType) { + this.stringValue = getStringValue(value); + this.messageFormat = getMessageFormat(schemaType); + this.kind = type; + this.value = value; + this.path = path; + this.reason = reason; + this.valueType = getValueType(value); + } + + /*! + * ignore + * @param {Readonly} other + */ + copy(other) { + this.messageFormat = other.messageFormat; + this.stringValue = other.stringValue; + this.kind = other.kind; + this.value = other.value; + this.path = other.path; + this.reason = other.reason; + this.message = other.message; + this.valueType = other.valueType; + } + + /*! + * ignore + */ + setModel(model) { + this.model = model; + this.message = formatMessage(model, this.kind, this.stringValue, this.path, + this.messageFormat, this.valueType); + } +} + +Object.defineProperty(CastError.prototype, 'name', { + value: 'CastError' +}); + +function getStringValue(value) { + let stringValue = util.inspect(value); + stringValue = stringValue.replace(/^'|'$/g, '"'); + if (!stringValue.startsWith('"')) { + stringValue = '"' + stringValue + '"'; + } + return stringValue; +} + +function getValueType(value) { + if (value == null) { + return '' + value; + } + + const t = typeof value; + if (t !== 'object') { + return t; + } + if (typeof value.constructor !== 'function') { + return t; + } + return value.constructor.name; +} + +function getMessageFormat(schemaType) { + const messageFormat = schemaType && + schemaType.options && + schemaType.options.cast || null; + if (typeof messageFormat === 'string') { + return messageFormat; + } +} + +/*! + * ignore + */ + +function formatMessage(model, kind, stringValue, path, messageFormat, valueType, reason) { + if (messageFormat != null) { + let ret = messageFormat. + replace('{KIND}', kind). + replace('{VALUE}', stringValue). + replace('{PATH}', path); + if (model != null) { + ret = ret.replace('{MODEL}', model.modelName); + } + + return ret; + } else { + const valueTypeMsg = valueType ? ' (type ' + valueType + ')' : ''; + let ret = 'Cast to ' + kind + ' failed for value ' + + stringValue + valueTypeMsg + ' at path "' + path + '"'; + if (model != null) { + ret += ' for model "' + model.modelName + '"'; + } + if (reason != null && + typeof reason.constructor === 'function' && + reason.constructor.name !== 'AssertionError' && + reason.constructor.name !== 'Error') { + ret += ' because of "' + reason.constructor.name + '"'; + } + return ret; + } +} + +/*! + * exports + */ + +module.exports = CastError; diff --git a/node_modules/mongoose/lib/error/disconnected.js b/node_modules/mongoose/lib/error/disconnected.js new file mode 100644 index 000000000..9e8c6125c --- /dev/null +++ b/node_modules/mongoose/lib/error/disconnected.js @@ -0,0 +1,33 @@ +/*! + * Module dependencies. + */ + +'use strict'; + +const MongooseError = require('./'); + + +/** + * The connection failed to reconnect and will never successfully reconnect to + * MongoDB without manual intervention. + * @api private + */ +class DisconnectedError extends MongooseError { + /** + * @param {String} connectionString + */ + constructor(id, fnName) { + super('Connection ' + id + + ' was disconnected when calling `' + fnName + '()`'); + } +} + +Object.defineProperty(DisconnectedError.prototype, 'name', { + value: 'DisconnectedError' +}); + +/*! + * exports + */ + +module.exports = DisconnectedError; diff --git a/node_modules/mongoose/lib/error/divergentArray.js b/node_modules/mongoose/lib/error/divergentArray.js new file mode 100644 index 000000000..ed86caf17 --- /dev/null +++ b/node_modules/mongoose/lib/error/divergentArray.js @@ -0,0 +1,37 @@ + +/*! + * Module dependencies. + */ + +'use strict'; + +const MongooseError = require('./'); + +class DivergentArrayError extends MongooseError { + /*! + * DivergentArrayError constructor. + * @param {Array} paths + */ + constructor(paths) { + const msg = 'For your own good, using `document.save()` to update an array ' + + 'which was selected using an $elemMatch projection OR ' + + 'populated using skip, limit, query conditions, or exclusion of ' + + 'the _id field when the operation results in a $pop or $set of ' + + 'the entire array is not supported. The following ' + + 'path(s) would have been modified unsafely:\n' + + ' ' + paths.join('\n ') + '\n' + + 'Use Model.update() to update these arrays instead.'; + // TODO write up a docs page (FAQ) and link to it + super(msg); + } +} + +Object.defineProperty(DivergentArrayError.prototype, 'name', { + value: 'DivergentArrayError' +}); + +/*! + * exports + */ + +module.exports = DivergentArrayError; diff --git a/node_modules/mongoose/lib/error/eachAsyncMultiError.js b/node_modules/mongoose/lib/error/eachAsyncMultiError.js new file mode 100644 index 000000000..9c0402031 --- /dev/null +++ b/node_modules/mongoose/lib/error/eachAsyncMultiError.js @@ -0,0 +1,41 @@ +/*! + * Module dependencies. + */ + +'use strict'; + +const MongooseError = require('./'); + + +/** + * If `eachAsync()` is called with `continueOnError: true`, there can be + * multiple errors. This error class contains an `errors` property, which + * contains an array of all errors that occurred in `eachAsync()`. + * + * @api private + */ + +class EachAsyncMultiError extends MongooseError { + /** + * @param {String} connectionString + */ + constructor(errors) { + let preview = errors.map(e => e.message).join(', '); + if (preview.length > 50) { + preview = preview.slice(0, 50) + '...'; + } + super(`eachAsync() finished with ${errors.length} errors: ${preview}`); + + this.errors = errors; + } +} + +Object.defineProperty(EachAsyncMultiError.prototype, 'name', { + value: 'EachAsyncMultiError' +}); + +/*! + * exports + */ + +module.exports = EachAsyncMultiError; diff --git a/node_modules/mongoose/lib/error/index.js b/node_modules/mongoose/lib/error/index.js new file mode 100644 index 000000000..4f5b44673 --- /dev/null +++ b/node_modules/mongoose/lib/error/index.js @@ -0,0 +1,216 @@ +'use strict'; + +/** + * MongooseError constructor. MongooseError is the base class for all + * Mongoose-specific errors. + * + * #### Example: + * const Model = mongoose.model('Test', new mongoose.Schema({ answer: Number })); + * const doc = new Model({ answer: 'not a number' }); + * const err = doc.validateSync(); + * + * err instanceof mongoose.Error.ValidationError; // true + * + * @constructor Error + * @param {String} msg Error message + * @inherits Error https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Error + */ + +const MongooseError = require('./mongooseError'); + +/** + * The name of the error. The name uniquely identifies this Mongoose error. The + * possible values are: + * + * - `MongooseError`: general Mongoose error + * - `CastError`: Mongoose could not convert a value to the type defined in the schema path. May be in a `ValidationError` class' `errors` property. + * - `DisconnectedError`: This [connection](connections.html) timed out in trying to reconnect to MongoDB and will not successfully reconnect to MongoDB unless you explicitly reconnect. + * - `DivergentArrayError`: You attempted to `save()` an array that was modified after you loaded it with a `$elemMatch` or similar projection + * - `MissingSchemaError`: You tried to access a model with [`mongoose.model()`](api.html#mongoose_Mongoose-model) that was not defined + * - `DocumentNotFoundError`: The document you tried to [`save()`](api.html#document_Document-save) was not found + * - `ValidatorError`: error from an individual schema path's validator + * - `ValidationError`: error returned from [`validate()`](api.html#document_Document-validate) or [`validateSync()`](api.html#document_Document-validateSync). Contains zero or more `ValidatorError` instances in `.errors` property. + * - `MissingSchemaError`: You called `mongoose.Document()` without a schema + * - `ObjectExpectedError`: Thrown when you set a nested path to a non-object value with [strict mode set](guide.html#strict). + * - `ObjectParameterError`: Thrown when you pass a non-object value to a function which expects an object as a paramter + * - `OverwriteModelError`: Thrown when you call [`mongoose.model()`](api.html#mongoose_Mongoose-model) to re-define a model that was already defined. + * - `ParallelSaveError`: Thrown when you call [`save()`](api.html#model_Model-save) on a document when the same document instance is already saving. + * - `StrictModeError`: Thrown when you set a path that isn't the schema and [strict mode](guide.html#strict) is set to `throw`. + * - `VersionError`: Thrown when the [document is out of sync](guide.html#versionKey) + * + * @api public + * @property {String} name + * @memberOf Error + * @instance + */ + +/*! + * Module exports. + */ + +module.exports = exports = MongooseError; + +/** + * The default built-in validator error messages. + * + * @see Error.messages #error_messages_MongooseError-messages + * @api public + * @memberOf Error + * @static messages + */ + +MongooseError.messages = require('./messages'); + +// backward compat +MongooseError.Messages = MongooseError.messages; + +/** + * An instance of this error class will be returned when `save()` fails + * because the underlying + * document was not found. The constructor takes one parameter, the + * conditions that mongoose passed to `update()` when trying to update + * the document. + * + * @api public + * @memberOf Error + * @static DocumentNotFoundError + */ + +MongooseError.DocumentNotFoundError = require('./notFound'); + +/** + * An instance of this error class will be returned when mongoose failed to + * cast a value. + * + * @api public + * @memberOf Error + * @static CastError + */ + +MongooseError.CastError = require('./cast'); + +/** + * An instance of this error class will be returned when [validation](/docs/validation.html) failed. + * The `errors` property contains an object whose keys are the paths that failed and whose values are + * instances of CastError or ValidationError. + * + * @api public + * @memberOf Error + * @static ValidationError + */ + +MongooseError.ValidationError = require('./validation'); + +/** + * A `ValidationError` has a hash of `errors` that contain individual + * `ValidatorError` instances. + * + * #### Example: + * + * const schema = Schema({ name: { type: String, required: true } }); + * const Model = mongoose.model('Test', schema); + * const doc = new Model({}); + * + * // Top-level error is a ValidationError, **not** a ValidatorError + * const err = doc.validateSync(); + * err instanceof mongoose.Error.ValidationError; // true + * + * // A ValidationError `err` has 0 or more ValidatorErrors keyed by the + * // path in the `err.errors` property. + * err.errors['name'] instanceof mongoose.Error.ValidatorError; + * + * err.errors['name'].kind; // 'required' + * err.errors['name'].path; // 'name' + * err.errors['name'].value; // undefined + * + * Instances of `ValidatorError` have the following properties: + * + * - `kind`: The validator's `type`, like `'required'` or `'regexp'` + * - `path`: The path that failed validation + * - `value`: The value that failed validation + * + * @api public + * @memberOf Error + * @static ValidatorError + */ + +MongooseError.ValidatorError = require('./validator'); + +/** + * An instance of this error class will be returned when you call `save()` after + * the document in the database was changed in a potentially unsafe way. See + * the [`versionKey` option](/docs/guide.html#versionKey) for more information. + * + * @api public + * @memberOf Error + * @static VersionError + */ + +MongooseError.VersionError = require('./version'); + +/** + * An instance of this error class will be returned when you call `save()` multiple + * times on the same document in parallel. See the [FAQ](/docs/faq.html) for more + * information. + * + * @api public + * @memberOf Error + * @static ParallelSaveError + */ + +MongooseError.ParallelSaveError = require('./parallelSave'); + +/** + * Thrown when a model with the given name was already registered on the connection. + * See [the FAQ about `OverwriteModelError`](/docs/faq.html#overwrite-model-error). + * + * @api public + * @memberOf Error + * @static OverwriteModelError + */ + +MongooseError.OverwriteModelError = require('./overwriteModel'); + +/** + * Thrown when you try to access a model that has not been registered yet + * + * @api public + * @memberOf Error + * @static MissingSchemaError + */ + +MongooseError.MissingSchemaError = require('./missingSchema'); + +/** + * Thrown when the MongoDB Node driver can't connect to a valid server + * to send an operation to. + * + * @api public + * @memberOf Error + * @static MongooseServerSelectionError + */ + +MongooseError.MongooseServerSelectionError = require('./serverSelection'); + +/** + * An instance of this error will be returned if you used an array projection + * and then modified the array in an unsafe way. + * + * @api public + * @memberOf Error + * @static DivergentArrayError + */ + +MongooseError.DivergentArrayError = require('./divergentArray'); + +/** + * Thrown when your try to pass values to model contrtuctor that + * were not specified in schema or change immutable properties when + * `strict` mode is `"throw"` + * + * @api public + * @memberOf Error + * @static StrictModeError + */ + +MongooseError.StrictModeError = require('./strict'); diff --git a/node_modules/mongoose/lib/error/messages.js b/node_modules/mongoose/lib/error/messages.js new file mode 100644 index 000000000..ac0294a39 --- /dev/null +++ b/node_modules/mongoose/lib/error/messages.js @@ -0,0 +1,47 @@ + +/** + * The default built-in validator error messages. These may be customized. + * + * // customize within each schema or globally like so + * const mongoose = require('mongoose'); + * mongoose.Error.messages.String.enum = "Your custom message for {PATH}."; + * + * As you might have noticed, error messages support basic templating + * + * - `{PATH}` is replaced with the invalid document path + * - `{VALUE}` is replaced with the invalid value + * - `{TYPE}` is replaced with the validator type such as "regexp", "min", or "user defined" + * - `{MIN}` is replaced with the declared min value for the Number.min validator + * - `{MAX}` is replaced with the declared max value for the Number.max validator + * + * Click the "show code" link below to see all defaults. + * + * @static messages + * @receiver MongooseError + * @api public + */ + +'use strict'; + +const msg = module.exports = exports = {}; + +msg.DocumentNotFoundError = null; + +msg.general = {}; +msg.general.default = 'Validator failed for path `{PATH}` with value `{VALUE}`'; +msg.general.required = 'Path `{PATH}` is required.'; + +msg.Number = {}; +msg.Number.min = 'Path `{PATH}` ({VALUE}) is less than minimum allowed value ({MIN}).'; +msg.Number.max = 'Path `{PATH}` ({VALUE}) is more than maximum allowed value ({MAX}).'; +msg.Number.enum = '`{VALUE}` is not a valid enum value for path `{PATH}`.'; + +msg.Date = {}; +msg.Date.min = 'Path `{PATH}` ({VALUE}) is before minimum allowed value ({MIN}).'; +msg.Date.max = 'Path `{PATH}` ({VALUE}) is after maximum allowed value ({MAX}).'; + +msg.String = {}; +msg.String.enum = '`{VALUE}` is not a valid enum value for path `{PATH}`.'; +msg.String.match = 'Path `{PATH}` is invalid ({VALUE}).'; +msg.String.minlength = 'Path `{PATH}` (`{VALUE}`) is shorter than the minimum allowed length ({MINLENGTH}).'; +msg.String.maxlength = 'Path `{PATH}` (`{VALUE}`) is longer than the maximum allowed length ({MAXLENGTH}).'; diff --git a/node_modules/mongoose/lib/error/missingSchema.js b/node_modules/mongoose/lib/error/missingSchema.js new file mode 100644 index 000000000..ca306b7e6 --- /dev/null +++ b/node_modules/mongoose/lib/error/missingSchema.js @@ -0,0 +1,30 @@ + +/*! + * Module dependencies. + */ + +'use strict'; + +const MongooseError = require('./'); + +class MissingSchemaError extends MongooseError { + /*! + * MissingSchema Error constructor. + * @param {String} name + */ + constructor(name) { + const msg = 'Schema hasn\'t been registered for model "' + name + '".\n' + + 'Use mongoose.model(name, schema)'; + super(msg); + } +} + +Object.defineProperty(MissingSchemaError.prototype, 'name', { + value: 'MissingSchemaError' +}); + +/*! + * exports + */ + +module.exports = MissingSchemaError; diff --git a/node_modules/mongoose/lib/error/mongooseError.js b/node_modules/mongoose/lib/error/mongooseError.js new file mode 100644 index 000000000..5505105cb --- /dev/null +++ b/node_modules/mongoose/lib/error/mongooseError.js @@ -0,0 +1,13 @@ +'use strict'; + +/*! + * ignore + */ + +class MongooseError extends Error { } + +Object.defineProperty(MongooseError.prototype, 'name', { + value: 'MongooseError' +}); + +module.exports = MongooseError; diff --git a/node_modules/mongoose/lib/error/notFound.js b/node_modules/mongoose/lib/error/notFound.js new file mode 100644 index 000000000..0e8386b8a --- /dev/null +++ b/node_modules/mongoose/lib/error/notFound.js @@ -0,0 +1,44 @@ +'use strict'; + +/*! + * Module dependencies. + */ + +const MongooseError = require('./'); +const util = require('util'); + +class DocumentNotFoundError extends MongooseError { + /*! + * OverwriteModel Error constructor. + */ + constructor(filter, model, numAffected, result) { + let msg; + const messages = MongooseError.messages; + if (messages.DocumentNotFoundError != null) { + msg = typeof messages.DocumentNotFoundError === 'function' ? + messages.DocumentNotFoundError(filter, model) : + messages.DocumentNotFoundError; + } else { + msg = 'No document found for query "' + util.inspect(filter) + + '" on model "' + model + '"'; + } + + super(msg); + + this.result = result; + this.numAffected = numAffected; + this.filter = filter; + // Backwards compat + this.query = filter; + } +} + +Object.defineProperty(DocumentNotFoundError.prototype, 'name', { + value: 'DocumentNotFoundError' +}); + +/*! + * exports + */ + +module.exports = DocumentNotFoundError; diff --git a/node_modules/mongoose/lib/error/objectExpected.js b/node_modules/mongoose/lib/error/objectExpected.js new file mode 100644 index 000000000..6506f6065 --- /dev/null +++ b/node_modules/mongoose/lib/error/objectExpected.js @@ -0,0 +1,30 @@ +/*! + * Module dependencies. + */ + +'use strict'; + +const MongooseError = require('./'); + + +class ObjectExpectedError extends MongooseError { + /** + * Strict mode error constructor + * + * @param {string} type + * @param {string} value + * @api private + */ + constructor(path, val) { + const typeDescription = Array.isArray(val) ? 'array' : 'primitive value'; + super('Tried to set nested object field `' + path + + `\` to ${typeDescription} \`` + val + '`'); + this.path = path; + } +} + +Object.defineProperty(ObjectExpectedError.prototype, 'name', { + value: 'ObjectExpectedError' +}); + +module.exports = ObjectExpectedError; diff --git a/node_modules/mongoose/lib/error/objectParameter.js b/node_modules/mongoose/lib/error/objectParameter.js new file mode 100644 index 000000000..5881a481a --- /dev/null +++ b/node_modules/mongoose/lib/error/objectParameter.js @@ -0,0 +1,30 @@ +/*! + * Module dependencies. + */ + +'use strict'; + +const MongooseError = require('./'); + +class ObjectParameterError extends MongooseError { + /** + * Constructor for errors that happen when a parameter that's expected to be + * an object isn't an object + * + * @param {Any} value + * @param {String} paramName + * @param {String} fnName + * @api private + */ + constructor(value, paramName, fnName) { + super('Parameter "' + paramName + '" to ' + fnName + + '() must be an object, got ' + value.toString()); + } +} + + +Object.defineProperty(ObjectParameterError.prototype, 'name', { + value: 'ObjectParameterError' +}); + +module.exports = ObjectParameterError; diff --git a/node_modules/mongoose/lib/error/overwriteModel.js b/node_modules/mongoose/lib/error/overwriteModel.js new file mode 100644 index 000000000..d509e1955 --- /dev/null +++ b/node_modules/mongoose/lib/error/overwriteModel.js @@ -0,0 +1,29 @@ + +/*! + * Module dependencies. + */ + +'use strict'; + +const MongooseError = require('./'); + + +class OverwriteModelError extends MongooseError { + /*! + * OverwriteModel Error constructor. + * @param {String} name + */ + constructor(name) { + super('Cannot overwrite `' + name + '` model once compiled.'); + } +} + +Object.defineProperty(OverwriteModelError.prototype, 'name', { + value: 'OverwriteModelError' +}); + +/*! + * exports + */ + +module.exports = OverwriteModelError; diff --git a/node_modules/mongoose/lib/error/parallelSave.js b/node_modules/mongoose/lib/error/parallelSave.js new file mode 100644 index 000000000..e0628576d --- /dev/null +++ b/node_modules/mongoose/lib/error/parallelSave.js @@ -0,0 +1,30 @@ +'use strict'; + +/*! + * Module dependencies. + */ + +const MongooseError = require('./'); + +class ParallelSaveError extends MongooseError { + /** + * ParallelSave Error constructor. + * + * @param {Document} doc + * @api private + */ + constructor(doc) { + const msg = 'Can\'t save() the same doc multiple times in parallel. Document: '; + super(msg + doc._id); + } +} + +Object.defineProperty(ParallelSaveError.prototype, 'name', { + value: 'ParallelSaveError' +}); + +/*! + * exports + */ + +module.exports = ParallelSaveError; diff --git a/node_modules/mongoose/lib/error/parallelValidate.js b/node_modules/mongoose/lib/error/parallelValidate.js new file mode 100644 index 000000000..18697b6bc --- /dev/null +++ b/node_modules/mongoose/lib/error/parallelValidate.js @@ -0,0 +1,31 @@ +'use strict'; + +/*! + * Module dependencies. + */ + +const MongooseError = require('./mongooseError'); + + +class ParallelValidateError extends MongooseError { + /** + * ParallelValidate Error constructor. + * + * @param {Document} doc + * @api private + */ + constructor(doc) { + const msg = 'Can\'t validate() the same doc multiple times in parallel. Document: '; + super(msg + doc._id); + } +} + +Object.defineProperty(ParallelValidateError.prototype, 'name', { + value: 'ParallelValidateError' +}); + +/*! + * exports + */ + +module.exports = ParallelValidateError; \ No newline at end of file diff --git a/node_modules/mongoose/lib/error/serverSelection.js b/node_modules/mongoose/lib/error/serverSelection.js new file mode 100644 index 000000000..162e2fceb --- /dev/null +++ b/node_modules/mongoose/lib/error/serverSelection.js @@ -0,0 +1,61 @@ +/*! + * Module dependencies. + */ + +'use strict'; + +const MongooseError = require('./mongooseError'); +const allServersUnknown = require('../helpers/topology/allServersUnknown'); +const isAtlas = require('../helpers/topology/isAtlas'); +const isSSLError = require('../helpers/topology/isSSLError'); + +/*! + * ignore + */ + +const atlasMessage = 'Could not connect to any servers in your MongoDB Atlas cluster. ' + + 'One common reason is that you\'re trying to access the database from ' + + 'an IP that isn\'t whitelisted. Make sure your current IP address is on your Atlas ' + + 'cluster\'s IP whitelist: https://docs.atlas.mongodb.com/security-whitelist/'; + +const sslMessage = 'Mongoose is connecting with SSL enabled, but the server is ' + + 'not accepting SSL connections. Please ensure that the MongoDB server you are ' + + 'connecting to is configured to accept SSL connections. Learn more: ' + + 'https://mongoosejs.com/docs/tutorials/ssl.html'; + +class MongooseServerSelectionError extends MongooseError { + /** + * MongooseServerSelectionError constructor + * + * @api private + */ + assimilateError(err) { + const reason = err.reason; + // Special message for a case that is likely due to IP whitelisting issues. + const isAtlasWhitelistError = isAtlas(reason) && + allServersUnknown(reason) && + err.message.indexOf('bad auth') === -1 && + err.message.indexOf('Authentication failed') === -1; + + if (isAtlasWhitelistError) { + this.message = atlasMessage; + } else if (isSSLError(reason)) { + this.message = sslMessage; + } else { + this.message = err.message; + } + for (const key in err) { + if (key !== 'name') { + this[key] = err[key]; + } + } + + return this; + } +} + +Object.defineProperty(MongooseServerSelectionError.prototype, 'name', { + value: 'MongooseServerSelectionError' +}); + +module.exports = MongooseServerSelectionError; diff --git a/node_modules/mongoose/lib/error/strict.js b/node_modules/mongoose/lib/error/strict.js new file mode 100644 index 000000000..393ca6e1f --- /dev/null +++ b/node_modules/mongoose/lib/error/strict.js @@ -0,0 +1,33 @@ +/*! + * Module dependencies. + */ + +'use strict'; + +const MongooseError = require('./'); + + +class StrictModeError extends MongooseError { + /** + * Strict mode error constructor + * + * @param {String} path + * @param {String} [msg] + * @param {Boolean} [immutable] + * @inherits MongooseError + * @api private + */ + constructor(path, msg, immutable) { + msg = msg || 'Field `' + path + '` is not in schema and strict ' + + 'mode is set to throw.'; + super(msg); + this.isImmutableError = !!immutable; + this.path = path; + } +} + +Object.defineProperty(StrictModeError.prototype, 'name', { + value: 'StrictModeError' +}); + +module.exports = StrictModeError; diff --git a/node_modules/mongoose/lib/error/syncIndexes.js b/node_modules/mongoose/lib/error/syncIndexes.js new file mode 100644 index 000000000..54f345ba7 --- /dev/null +++ b/node_modules/mongoose/lib/error/syncIndexes.js @@ -0,0 +1,30 @@ +'use strict'; + +/*! + * Module dependencies. + */ + +const MongooseError = require('./mongooseError'); + +/** + * SyncIndexes Error constructor. + * + * @param {String} message + * @param {String} errorsMap + * @inherits MongooseError + * @api private + */ + +class SyncIndexesError extends MongooseError { + constructor(message, errorsMap) { + super(message); + this.errors = errorsMap; + } +} + +Object.defineProperty(SyncIndexesError.prototype, 'name', { + value: 'SyncIndexesError' +}); + + +module.exports = SyncIndexesError; diff --git a/node_modules/mongoose/lib/error/validation.js b/node_modules/mongoose/lib/error/validation.js new file mode 100644 index 000000000..5ca993a34 --- /dev/null +++ b/node_modules/mongoose/lib/error/validation.js @@ -0,0 +1,112 @@ +/*! + * Module requirements + */ + +'use strict'; + +const MongooseError = require('./mongooseError'); +const getConstructorName = require('../helpers/getConstructorName'); +const util = require('util'); + +class ValidationError extends MongooseError { + /** + * Document Validation Error + * + * @api private + * @param {Document} [instance] + * @inherits MongooseError + */ + constructor(instance) { + let _message; + if (getConstructorName(instance) === 'model') { + _message = instance.constructor.modelName + ' validation failed'; + } else { + _message = 'Validation failed'; + } + + super(_message); + + this.errors = {}; + this._message = _message; + + if (instance) { + instance.$errors = this.errors; + } + } + + /** + * Console.log helper + */ + toString() { + return this.name + ': ' + _generateMessage(this); + } + + /*! + * inspect helper + */ + inspect() { + return Object.assign(new Error(this.message), this); + } + + /*! + * add message + */ + addError(path, error) { + this.errors[path] = error; + this.message = this._message + ': ' + _generateMessage(this); + } +} + + +if (util.inspect.custom) { + /*! + * Avoid Node deprecation warning DEP0079 + */ + + ValidationError.prototype[util.inspect.custom] = ValidationError.prototype.inspect; +} + +/*! + * Helper for JSON.stringify + * Ensure `name` and `message` show up in toJSON output re: gh-9847 + */ +Object.defineProperty(ValidationError.prototype, 'toJSON', { + enumerable: false, + writable: false, + configurable: true, + value: function() { + return Object.assign({}, this, { name: this.name, message: this.message }); + } +}); + + +Object.defineProperty(ValidationError.prototype, 'name', { + value: 'ValidationError' +}); + +/*! + * ignore + */ + +function _generateMessage(err) { + const keys = Object.keys(err.errors || {}); + const len = keys.length; + const msgs = []; + let key; + + for (let i = 0; i < len; ++i) { + key = keys[i]; + if (err === err.errors[key]) { + continue; + } + msgs.push(key + ': ' + err.errors[key].message); + } + + return msgs.join(', '); +} + +/*! + * Module exports + */ + +module.exports = ValidationError; diff --git a/node_modules/mongoose/lib/error/validator.js b/node_modules/mongoose/lib/error/validator.js new file mode 100644 index 000000000..f880e2b58 --- /dev/null +++ b/node_modules/mongoose/lib/error/validator.js @@ -0,0 +1,94 @@ +/*! + * Module dependencies. + */ + +'use strict'; + +const MongooseError = require('./'); + + +class ValidatorError extends MongooseError { + /** + * Schema validator error + * + * @param {Object} properties + * @api private + */ + constructor(properties) { + let msg = properties.message; + if (!msg) { + msg = MongooseError.messages.general.default; + } + + const message = formatMessage(msg, properties); + super(message); + + properties = Object.assign({}, properties, { message: message }); + this.properties = properties; + this.kind = properties.type; + this.path = properties.path; + this.value = properties.value; + this.reason = properties.reason; + } + + /*! + * toString helper + * TODO remove? This defaults to `${this.name}: ${this.message}` + */ + toString() { + return this.message; + } + + /*! + * Ensure `name` and `message` show up in toJSON output re: gh-9296 + */ + + toJSON() { + return Object.assign({ name: this.name, message: this.message }, this); + } +} + + +Object.defineProperty(ValidatorError.prototype, 'name', { + value: 'ValidatorError' +}); + +/*! + * The object used to define this validator. Not enumerable to hide + * it from `require('util').inspect()` output re: gh-3925 + */ + +Object.defineProperty(ValidatorError.prototype, 'properties', { + enumerable: false, + writable: true, + value: null +}); + +// Exposed for testing +ValidatorError.prototype.formatMessage = formatMessage; + +/*! + * Formats error messages + */ + +function formatMessage(msg, properties) { + if (typeof msg === 'function') { + return msg(properties); + } + + const propertyNames = Object.keys(properties); + for (const propertyName of propertyNames) { + if (propertyName === 'message') { + continue; + } + msg = msg.replace('{' + propertyName.toUpperCase() + '}', properties[propertyName]); + } + + return msg; +} + +/*! + * exports + */ + +module.exports = ValidatorError; diff --git a/node_modules/mongoose/lib/error/version.js b/node_modules/mongoose/lib/error/version.js new file mode 100644 index 000000000..b357fb16c --- /dev/null +++ b/node_modules/mongoose/lib/error/version.js @@ -0,0 +1,36 @@ +'use strict'; + +/*! + * Module dependencies. + */ + +const MongooseError = require('./'); + +class VersionError extends MongooseError { + /** + * Version Error constructor. + * + * @param {Document} doc + * @param {Number} currentVersion + * @param {Array} modifiedPaths + * @api private + */ + constructor(doc, currentVersion, modifiedPaths) { + const modifiedPathsStr = modifiedPaths.join(', '); + super('No matching document found for id "' + doc._id + + '" version ' + currentVersion + ' modifiedPaths "' + modifiedPathsStr + '"'); + this.version = currentVersion; + this.modifiedPaths = modifiedPaths; + } +} + + +Object.defineProperty(VersionError.prototype, 'name', { + value: 'VersionError' +}); + +/*! + * exports + */ + +module.exports = VersionError; diff --git a/node_modules/mongoose/lib/helpers/aggregate/prepareDiscriminatorPipeline.js b/node_modules/mongoose/lib/helpers/aggregate/prepareDiscriminatorPipeline.js new file mode 100644 index 000000000..8c128bc1e --- /dev/null +++ b/node_modules/mongoose/lib/helpers/aggregate/prepareDiscriminatorPipeline.js @@ -0,0 +1,37 @@ +'use strict'; + +module.exports = function prepareDiscriminatorPipeline(pipeline, schema, prefix) { + const discriminatorMapping = schema && schema.discriminatorMapping; + prefix = prefix || ''; + + if (discriminatorMapping && !discriminatorMapping.isRoot) { + const originalPipeline = pipeline; + const filterKey = (prefix.length > 0 ? prefix + '.' : prefix) + discriminatorMapping.key; + const discriminatorValue = discriminatorMapping.value; + + // If the first pipeline stage is a match and it doesn't specify a `__t` + // key, add the discriminator key to it. This allows for potential + // aggregation query optimizations not to be disturbed by this feature. + if (originalPipeline[0] != null && originalPipeline[0].$match && !originalPipeline[0].$match[filterKey]) { + originalPipeline[0].$match[filterKey] = discriminatorValue; + // `originalPipeline` is a ref, so there's no need for + // aggregate._pipeline = originalPipeline + } else if (originalPipeline[0] != null && originalPipeline[0].$geoNear) { + originalPipeline[0].$geoNear.query = + originalPipeline[0].$geoNear.query || {}; + originalPipeline[0].$geoNear.query[filterKey] = discriminatorValue; + } else if (originalPipeline[0] != null && originalPipeline[0].$search) { + if (originalPipeline[1] && originalPipeline[1].$match != null) { + originalPipeline[1].$match[filterKey] = originalPipeline[1].$match[filterKey] || discriminatorValue; + } else { + const match = {}; + match[filterKey] = discriminatorValue; + originalPipeline.splice(1, 0, { $match: match }); + } + } else { + const match = {}; + match[filterKey] = discriminatorValue; + originalPipeline.unshift({ $match: match }); + } + } +}; \ No newline at end of file diff --git a/node_modules/mongoose/lib/helpers/aggregate/stringifyFunctionOperators.js b/node_modules/mongoose/lib/helpers/aggregate/stringifyFunctionOperators.js new file mode 100644 index 000000000..124418efd --- /dev/null +++ b/node_modules/mongoose/lib/helpers/aggregate/stringifyFunctionOperators.js @@ -0,0 +1,50 @@ +'use strict'; + +module.exports = function stringifyFunctionOperators(pipeline) { + if (!Array.isArray(pipeline)) { + return; + } + + for (const stage of pipeline) { + if (stage == null) { + continue; + } + + const canHaveAccumulator = stage.$group || stage.$bucket || stage.$bucketAuto; + if (canHaveAccumulator != null) { + for (const key of Object.keys(canHaveAccumulator)) { + handleAccumulator(canHaveAccumulator[key]); + } + } + + const stageType = Object.keys(stage)[0]; + if (stageType && typeof stage[stageType] === 'object') { + const stageOptions = stage[stageType]; + for (const key of Object.keys(stageOptions)) { + if (stageOptions[key] != null && + stageOptions[key].$function != null && + typeof stageOptions[key].$function.body === 'function') { + stageOptions[key].$function.body = stageOptions[key].$function.body.toString(); + } + } + } + + if (stage.$facet != null) { + for (const key of Object.keys(stage.$facet)) { + stringifyFunctionOperators(stage.$facet[key]); + } + } + } +}; + +function handleAccumulator(operator) { + if (operator == null || operator.$accumulator == null) { + return; + } + + for (const key of ['init', 'accumulate', 'merge', 'finalize']) { + if (typeof operator.$accumulator[key] === 'function') { + operator.$accumulator[key] = String(operator.$accumulator[key]); + } + } +} \ No newline at end of file diff --git a/node_modules/mongoose/lib/helpers/arrayDepth.js b/node_modules/mongoose/lib/helpers/arrayDepth.js new file mode 100644 index 000000000..e55de7ffb --- /dev/null +++ b/node_modules/mongoose/lib/helpers/arrayDepth.js @@ -0,0 +1,33 @@ +'use strict'; + +module.exports = arrayDepth; + +function arrayDepth(arr) { + if (!Array.isArray(arr)) { + return { min: 0, max: 0, containsNonArrayItem: true }; + } + if (arr.length === 0) { + return { min: 1, max: 1, containsNonArrayItem: false }; + } + if (arr.length === 1 && !Array.isArray(arr[0])) { + return { min: 1, max: 1, containsNonArrayItem: false }; + } + + const res = arrayDepth(arr[0]); + + for (let i = 1; i < arr.length; ++i) { + const _res = arrayDepth(arr[i]); + if (_res.min < res.min) { + res.min = _res.min; + } + if (_res.max > res.max) { + res.max = _res.max; + } + res.containsNonArrayItem = res.containsNonArrayItem || _res.containsNonArrayItem; + } + + res.min = res.min + 1; + res.max = res.max + 1; + + return res; +} \ No newline at end of file diff --git a/node_modules/mongoose/lib/helpers/clone.js b/node_modules/mongoose/lib/helpers/clone.js new file mode 100644 index 000000000..379a74abe --- /dev/null +++ b/node_modules/mongoose/lib/helpers/clone.js @@ -0,0 +1,177 @@ +'use strict'; + +const Decimal = require('../types/decimal128'); +const ObjectId = require('../types/objectid'); +const specialProperties = require('./specialProperties'); +const isMongooseObject = require('./isMongooseObject'); +const getFunctionName = require('./getFunctionName'); +const isBsonType = require('./isBsonType'); +const isObject = require('./isObject'); +const symbols = require('./symbols'); +const trustedSymbol = require('./query/trusted').trustedSymbol; +const utils = require('../utils'); + + +/*! + * Object clone with Mongoose natives support. + * + * If options.minimize is true, creates a minimal data object. Empty objects and undefined values will not be cloned. This makes the data payload sent to MongoDB as small as possible. + * + * Functions are never cloned. + * + * @param {Object} obj the object to clone + * @param {Object} options + * @param {Boolean} isArrayChild true if cloning immediately underneath an array. Special case for minimize. + * @return {Object} the cloned object + * @api private + */ + +function clone(obj, options, isArrayChild) { + if (obj == null) { + return obj; + } + + if (Array.isArray(obj)) { + return cloneArray(utils.isMongooseArray(obj) ? obj.__array : obj, options); + } + + if (isMongooseObject(obj)) { + // Single nested subdocs should apply getters later in `applyGetters()` + // when calling `toObject()`. See gh-7442, gh-8295 + if (options && options._skipSingleNestedGetters && obj.$isSingleNested) { + options = Object.assign({}, options, { getters: false }); + } + const isSingleNested = obj.$isSingleNested; + + if (utils.isPOJO(obj) && obj.$__ != null && obj._doc != null) { + return obj._doc; + } + + let ret; + if (options && options.json && typeof obj.toJSON === 'function') { + ret = obj.toJSON(options); + } else { + ret = obj.toObject(options); + } + + if (options && options.minimize && isSingleNested && Object.keys(ret).length === 0) { + return undefined; + } + + return ret; + } + + const objConstructor = obj.constructor; + + if (objConstructor) { + switch (getFunctionName(objConstructor)) { + case 'Object': + return cloneObject(obj, options, isArrayChild); + case 'Date': + return new objConstructor(+obj); + case 'RegExp': + return cloneRegExp(obj); + default: + // ignore + break; + } + } + + if (isBsonType(obj, 'ObjectID')) { + return new ObjectId(obj.id); + } + + if (isBsonType(obj, 'Decimal128')) { + if (options && options.flattenDecimals) { + return obj.toJSON(); + } + return Decimal.fromString(obj.toString()); + } + + // object created with Object.create(null) + if (!objConstructor && isObject(obj)) { + return cloneObject(obj, options, isArrayChild); + } + + if (typeof obj === 'object' && obj[symbols.schemaTypeSymbol]) { + return obj.clone(); + } + + // If we're cloning this object to go into a MongoDB command, + // and there's a `toBSON()` function, assume this object will be + // stored as a primitive in MongoDB and doesn't need to be cloned. + if (options && options.bson && typeof obj.toBSON === 'function') { + return obj; + } + + if (typeof obj.valueOf === 'function') { + return obj.valueOf(); + } + + return cloneObject(obj, options, isArrayChild); +} +module.exports = clone; + +/*! + * ignore + */ + +function cloneObject(obj, options, isArrayChild) { + const minimize = options && options.minimize; + const omitUndefined = options && options.omitUndefined; + const seen = options && options._seen; + const ret = {}; + let hasKeys; + + if (seen && seen.has(obj)) { + return seen.get(obj); + } else if (seen) { + seen.set(obj, ret); + } + if (trustedSymbol in obj) { + ret[trustedSymbol] = obj[trustedSymbol]; + } + + let i = 0; + let key = ''; + const keys = Object.keys(obj); + const len = keys.length; + + for (i = 0; i < len; ++i) { + if (specialProperties.has(key = keys[i])) { + continue; + } + + // Don't pass `isArrayChild` down + const val = clone(obj[key], options, false); + + if ((minimize === false || omitUndefined) && typeof val === 'undefined') { + delete ret[key]; + } else if (minimize !== true || (typeof val !== 'undefined')) { + hasKeys || (hasKeys = true); + ret[key] = val; + } + } + + return minimize && !isArrayChild ? hasKeys && ret : ret; +} + +function cloneArray(arr, options) { + let i = 0; + const len = arr.length; + const ret = new Array(len); + for (i = 0; i < len; ++i) { + ret[i] = clone(arr[i], options, true); + } + + return ret; +} + +function cloneRegExp(regexp) { + const ret = new RegExp(regexp.source, regexp.flags); + + if (ret.lastIndex !== regexp.lastIndex) { + ret.lastIndex = regexp.lastIndex; + } + return ret; +} diff --git a/node_modules/mongoose/lib/helpers/common.js b/node_modules/mongoose/lib/helpers/common.js new file mode 100644 index 000000000..c1433ce47 --- /dev/null +++ b/node_modules/mongoose/lib/helpers/common.js @@ -0,0 +1,106 @@ +'use strict'; + +/*! + * Module dependencies. + */ + +const Binary = require('../driver').get().Binary; +const isBsonType = require('./isBsonType'); +const isMongooseObject = require('./isMongooseObject'); + +exports.flatten = flatten; +exports.modifiedPaths = modifiedPaths; + +/*! + * ignore + */ + +function flatten(update, path, options, schema) { + let keys; + if (update && isMongooseObject(update) && !Buffer.isBuffer(update)) { + keys = Object.keys(update.toObject({ transform: false, virtuals: false }) || {}); + } else { + keys = Object.keys(update || {}); + } + + const numKeys = keys.length; + const result = {}; + path = path ? path + '.' : ''; + + for (let i = 0; i < numKeys; ++i) { + const key = keys[i]; + const val = update[key]; + result[path + key] = val; + + // Avoid going into mixed paths if schema is specified + const keySchema = schema && schema.path && schema.path(path + key); + const isNested = schema && schema.nested && schema.nested[path + key]; + if (keySchema && keySchema.instance === 'Mixed') continue; + + if (shouldFlatten(val)) { + if (options && options.skipArrays && Array.isArray(val)) { + continue; + } + const flat = flatten(val, path + key, options, schema); + for (const k in flat) { + result[k] = flat[k]; + } + if (Array.isArray(val)) { + result[path + key] = val; + } + } + + if (isNested) { + const paths = Object.keys(schema.paths); + for (const p of paths) { + if (p.startsWith(path + key + '.') && !result.hasOwnProperty(p)) { + result[p] = void 0; + } + } + } + } + + return result; +} + +/*! + * ignore + */ + +function modifiedPaths(update, path, result) { + const keys = Object.keys(update || {}); + const numKeys = keys.length; + result = result || {}; + path = path ? path + '.' : ''; + + for (let i = 0; i < numKeys; ++i) { + const key = keys[i]; + let val = update[key]; + + const _path = path + key; + result[_path] = true; + if (!Buffer.isBuffer(val) && isMongooseObject(val)) { + val = val.toObject({ transform: false, virtuals: false }); + } + if (shouldFlatten(val)) { + modifiedPaths(val, path + key, result); + } + } + + return result; +} + +/*! + * ignore + */ + +function shouldFlatten(val) { + return val && + typeof val === 'object' && + !(val instanceof Date) && + !isBsonType(val, 'ObjectID') && + (!Array.isArray(val) || val.length !== 0) && + !(val instanceof Buffer) && + !isBsonType(val, 'Decimal128') && + !(val instanceof Binary); +} diff --git a/node_modules/mongoose/lib/helpers/cursor/eachAsync.js b/node_modules/mongoose/lib/helpers/cursor/eachAsync.js new file mode 100644 index 000000000..21eb916e9 --- /dev/null +++ b/node_modules/mongoose/lib/helpers/cursor/eachAsync.js @@ -0,0 +1,192 @@ +'use strict'; + +/*! + * Module dependencies. + */ + +const EachAsyncMultiError = require('../../error/eachAsyncMultiError'); +const immediate = require('../immediate'); +const promiseOrCallback = require('../promiseOrCallback'); + +/** + * Execute `fn` for every document in the cursor. If `fn` returns a promise, + * will wait for the promise to resolve before iterating on to the next one. + * Returns a promise that resolves when done. + * + * @param {Function} next the thunk to call to get the next document + * @param {Function} fn + * @param {Object} options + * @param {Function} [callback] executed when all docs have been processed + * @return {Promise} + * @api public + * @method eachAsync + */ + +module.exports = function eachAsync(next, fn, options, callback) { + const parallel = options.parallel || 1; + const batchSize = options.batchSize; + const continueOnError = options.continueOnError; + const aggregatedErrors = []; + const enqueue = asyncQueue(); + + return promiseOrCallback(callback, cb => { + if (batchSize != null) { + if (typeof batchSize !== 'number') { + throw new TypeError('batchSize must be a number'); + } else if (!Number.isInteger(batchSize)) { + throw new TypeError('batchSize must be an integer'); + } else if (batchSize < 1) { + throw new TypeError('batchSize must be at least 1'); + } + } + + iterate(cb); + }); + + function iterate(finalCallback) { + let drained = false; + let handleResultsInProgress = 0; + let currentDocumentIndex = 0; + let documentsBatch = []; + + let error = null; + for (let i = 0; i < parallel; ++i) { + enqueue(fetch); + } + + function fetch(done) { + if (drained || error) { + return done(); + } + + next(function(err, doc) { + if (drained || error != null) { + return done(); + } + if (err != null) { + if (continueOnError) { + aggregatedErrors.push(err); + } else { + error = err; + finalCallback(err); + return done(); + } + } + if (doc == null) { + drained = true; + if (handleResultsInProgress <= 0) { + const finalErr = continueOnError ? + createEachAsyncMultiError(aggregatedErrors) : + error; + + finalCallback(finalErr); + } else if (batchSize && documentsBatch.length) { + handleNextResult(documentsBatch, currentDocumentIndex++, handleNextResultCallBack); + } + return done(); + } + + ++handleResultsInProgress; + + // Kick off the subsequent `next()` before handling the result, but + // make sure we know that we still have a result to handle re: #8422 + immediate(() => done()); + + if (batchSize) { + documentsBatch.push(doc); + } + + // If the current documents size is less than the provided patch size don't process the documents yet + if (batchSize && documentsBatch.length !== batchSize) { + immediate(() => enqueue(fetch)); + return; + } + + const docsToProcess = batchSize ? documentsBatch : doc; + + function handleNextResultCallBack(err) { + if (batchSize) { + handleResultsInProgress -= documentsBatch.length; + documentsBatch = []; + } else { + --handleResultsInProgress; + } + if (err != null) { + if (continueOnError) { + aggregatedErrors.push(err); + } else { + error = err; + return finalCallback(err); + } + } + if (drained && handleResultsInProgress <= 0) { + const finalErr = continueOnError ? + createEachAsyncMultiError(aggregatedErrors) : + error; + return finalCallback(finalErr); + } + + immediate(() => enqueue(fetch)); + } + + handleNextResult(docsToProcess, currentDocumentIndex++, handleNextResultCallBack); + }); + } + } + + function handleNextResult(doc, i, callback) { + let maybePromise; + try { + maybePromise = fn(doc, i); + } catch (err) { + return callback(err); + } + if (maybePromise && typeof maybePromise.then === 'function') { + maybePromise.then( + function() { callback(null); }, + function(error) { + callback(error || new Error('`eachAsync()` promise rejected without error')); + }); + } else { + callback(null); + } + } +}; + +// `next()` can only execute one at a time, so make sure we always execute +// `next()` in series, while still allowing multiple `fn()` instances to run +// in parallel. +function asyncQueue() { + const _queue = []; + let inProgress = null; + let id = 0; + + return function enqueue(fn) { + if ( + inProgress === null && + _queue.length === 0 + ) { + inProgress = id++; + return fn(_step); + } + _queue.push(fn); + }; + + function _step() { + if (_queue.length !== 0) { + inProgress = id++; + const fn = _queue.shift(); + fn(_step); + } else { + inProgress = null; + } + } +} + +function createEachAsyncMultiError(aggregatedErrors) { + if (aggregatedErrors.length === 0) { + return null; + } + + return new EachAsyncMultiError(aggregatedErrors); +} \ No newline at end of file diff --git a/node_modules/mongoose/lib/helpers/discriminator/areDiscriminatorValuesEqual.js b/node_modules/mongoose/lib/helpers/discriminator/areDiscriminatorValuesEqual.js new file mode 100644 index 000000000..52c7ee0eb --- /dev/null +++ b/node_modules/mongoose/lib/helpers/discriminator/areDiscriminatorValuesEqual.js @@ -0,0 +1,16 @@ +'use strict'; + +const isBsonType = require('../isBsonType'); + +module.exports = function areDiscriminatorValuesEqual(a, b) { + if (typeof a === 'string' && typeof b === 'string') { + return a === b; + } + if (typeof a === 'number' && typeof b === 'number') { + return a === b; + } + if (isBsonType(a, 'ObjectID') && isBsonType(b, 'ObjectID')) { + return a.toString() === b.toString(); + } + return false; +}; \ No newline at end of file diff --git a/node_modules/mongoose/lib/helpers/discriminator/checkEmbeddedDiscriminatorKeyProjection.js b/node_modules/mongoose/lib/helpers/discriminator/checkEmbeddedDiscriminatorKeyProjection.js new file mode 100644 index 000000000..755de88f1 --- /dev/null +++ b/node_modules/mongoose/lib/helpers/discriminator/checkEmbeddedDiscriminatorKeyProjection.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports = function checkEmbeddedDiscriminatorKeyProjection(userProjection, path, schema, selected, addedPaths) { + const userProjectedInPath = Object.keys(userProjection). + reduce((cur, key) => cur || key.startsWith(path + '.'), false); + const _discriminatorKey = path + '.' + schema.options.discriminatorKey; + if (!userProjectedInPath && + addedPaths.length === 1 && + addedPaths[0] === _discriminatorKey) { + selected.splice(selected.indexOf(_discriminatorKey), 1); + } +}; \ No newline at end of file diff --git a/node_modules/mongoose/lib/helpers/discriminator/getConstructor.js b/node_modules/mongoose/lib/helpers/discriminator/getConstructor.js new file mode 100644 index 000000000..728da3b25 --- /dev/null +++ b/node_modules/mongoose/lib/helpers/discriminator/getConstructor.js @@ -0,0 +1,25 @@ +'use strict'; + +const getDiscriminatorByValue = require('./getDiscriminatorByValue'); + +/*! + * Find the correct constructor, taking into account discriminators + */ + +module.exports = function getConstructor(Constructor, value) { + const discriminatorKey = Constructor.schema.options.discriminatorKey; + if (value != null && + Constructor.discriminators && + value[discriminatorKey] != null) { + if (Constructor.discriminators[value[discriminatorKey]]) { + Constructor = Constructor.discriminators[value[discriminatorKey]]; + } else { + const constructorByValue = getDiscriminatorByValue(Constructor.discriminators, value[discriminatorKey]); + if (constructorByValue) { + Constructor = constructorByValue; + } + } + } + + return Constructor; +}; \ No newline at end of file diff --git a/node_modules/mongoose/lib/helpers/discriminator/getDiscriminatorByValue.js b/node_modules/mongoose/lib/helpers/discriminator/getDiscriminatorByValue.js new file mode 100644 index 000000000..099aaefdd --- /dev/null +++ b/node_modules/mongoose/lib/helpers/discriminator/getDiscriminatorByValue.js @@ -0,0 +1,27 @@ +'use strict'; + +const areDiscriminatorValuesEqual = require('./areDiscriminatorValuesEqual'); + +/*! +* returns discriminator by discriminatorMapping.value +* +* @param {Model} model +* @param {string} value +*/ + +module.exports = function getDiscriminatorByValue(discriminators, value) { + if (discriminators == null) { + return null; + } + for (const name of Object.keys(discriminators)) { + const it = discriminators[name]; + if ( + it.schema && + it.schema.discriminatorMapping && + areDiscriminatorValuesEqual(it.schema.discriminatorMapping.value, value) + ) { + return it; + } + } + return null; +}; \ No newline at end of file diff --git a/node_modules/mongoose/lib/helpers/discriminator/getSchemaDiscriminatorByValue.js b/node_modules/mongoose/lib/helpers/discriminator/getSchemaDiscriminatorByValue.js new file mode 100644 index 000000000..b29fb6521 --- /dev/null +++ b/node_modules/mongoose/lib/helpers/discriminator/getSchemaDiscriminatorByValue.js @@ -0,0 +1,26 @@ +'use strict'; + +const areDiscriminatorValuesEqual = require('./areDiscriminatorValuesEqual'); + +/*! +* returns discriminator by discriminatorMapping.value +* +* @param {Schema} schema +* @param {string} value +*/ + +module.exports = function getSchemaDiscriminatorByValue(schema, value) { + if (schema == null || schema.discriminators == null) { + return null; + } + for (const key of Object.keys(schema.discriminators)) { + const discriminatorSchema = schema.discriminators[key]; + if (discriminatorSchema.discriminatorMapping == null) { + continue; + } + if (areDiscriminatorValuesEqual(discriminatorSchema.discriminatorMapping.value, value)) { + return discriminatorSchema; + } + } + return null; +}; \ No newline at end of file diff --git a/node_modules/mongoose/lib/helpers/document/cleanModifiedSubpaths.js b/node_modules/mongoose/lib/helpers/document/cleanModifiedSubpaths.js new file mode 100644 index 000000000..29bd18c3a --- /dev/null +++ b/node_modules/mongoose/lib/helpers/document/cleanModifiedSubpaths.js @@ -0,0 +1,35 @@ +'use strict'; + +/*! + * ignore + */ + +module.exports = function cleanModifiedSubpaths(doc, path, options) { + options = options || {}; + const skipDocArrays = options.skipDocArrays; + + let deleted = 0; + if (!doc) { + return deleted; + } + + for (const modifiedPath of Object.keys(doc.$__.activePaths.states.modify)) { + if (skipDocArrays) { + const schemaType = doc.$__schema.path(modifiedPath); + if (schemaType && schemaType.$isMongooseDocumentArray) { + continue; + } + } + if (modifiedPath.startsWith(path + '.')) { + delete doc.$__.activePaths.states.modify[modifiedPath]; + ++deleted; + + if (doc.$isSubdocument) { + const owner = doc.ownerDocument(); + const fullPath = doc.$__fullPath(modifiedPath); + delete owner.$__.activePaths.states.modify[fullPath]; + } + } + } + return deleted; +}; diff --git a/node_modules/mongoose/lib/helpers/document/compile.js b/node_modules/mongoose/lib/helpers/document/compile.js new file mode 100644 index 000000000..80a0de0b0 --- /dev/null +++ b/node_modules/mongoose/lib/helpers/document/compile.js @@ -0,0 +1,214 @@ +'use strict'; + +const documentSchemaSymbol = require('../../helpers/symbols').documentSchemaSymbol; +const internalToObjectOptions = require('../../options').internalToObjectOptions; +const utils = require('../../utils'); + +let Document; +const getSymbol = require('../../helpers/symbols').getSymbol; +const scopeSymbol = require('../../helpers/symbols').scopeSymbol; + +const isPOJO = utils.isPOJO; + +/*! + * exports + */ + +exports.compile = compile; +exports.defineKey = defineKey; + +/*! + * Compiles schemas. + */ + +function compile(tree, proto, prefix, options) { + Document = Document || require('../../document'); + const typeKey = options.typeKey; + + for (const key of Object.keys(tree)) { + const limb = tree[key]; + + const hasSubprops = isPOJO(limb) && + Object.keys(limb).length > 0 && + (!limb[typeKey] || (typeKey === 'type' && isPOJO(limb.type) && limb.type.type)); + const subprops = hasSubprops ? limb : null; + + defineKey({ prop: key, subprops: subprops, prototype: proto, prefix: prefix, options: options }); + } +} + +/*! + * Defines the accessor named prop on the incoming prototype. + */ + +function defineKey({ prop, subprops, prototype, prefix, options }) { + Document = Document || require('../../document'); + const path = (prefix ? prefix + '.' : '') + prop; + prefix = prefix || ''; + + if (subprops) { + Object.defineProperty(prototype, prop, { + enumerable: true, + configurable: true, + get: function() { + const _this = this; + if (!this.$__.getters) { + this.$__.getters = {}; + } + + if (!this.$__.getters[path]) { + const nested = Object.create(Document.prototype, getOwnPropertyDescriptors(this)); + + // save scope for nested getters/setters + if (!prefix) { + nested.$__[scopeSymbol] = this; + } + nested.$__.nestedPath = path; + + Object.defineProperty(nested, 'schema', { + enumerable: false, + configurable: true, + writable: false, + value: prototype.schema + }); + + Object.defineProperty(nested, '$__schema', { + enumerable: false, + configurable: true, + writable: false, + value: prototype.schema + }); + + Object.defineProperty(nested, documentSchemaSymbol, { + enumerable: false, + configurable: true, + writable: false, + value: prototype.schema + }); + + Object.defineProperty(nested, 'toObject', { + enumerable: false, + configurable: true, + writable: false, + value: function() { + return utils.clone(_this.get(path, null, { + virtuals: this && + this.schema && + this.schema.options && + this.schema.options.toObject && + this.schema.options.toObject.virtuals || null + })); + } + }); + + Object.defineProperty(nested, '$__get', { + enumerable: false, + configurable: true, + writable: false, + value: function() { + return _this.get(path, null, { + virtuals: this && this.schema && this.schema.options && this.schema.options.toObject && this.schema.options.toObject.virtuals || null + }); + } + }); + + Object.defineProperty(nested, 'toJSON', { + enumerable: false, + configurable: true, + writable: false, + value: function() { + return _this.get(path, null, { + virtuals: this && this.schema && this.schema.options && this.schema.options.toJSON && this.schema.options.toJSON.virtuals || null + }); + } + }); + + Object.defineProperty(nested, '$__isNested', { + enumerable: false, + configurable: true, + writable: false, + value: true + }); + + const _isEmptyOptions = Object.freeze({ + minimize: true, + virtuals: false, + getters: false, + transform: false + }); + Object.defineProperty(nested, '$isEmpty', { + enumerable: false, + configurable: true, + writable: false, + value: function() { + return Object.keys(this.get(path, null, _isEmptyOptions) || {}).length === 0; + } + }); + + Object.defineProperty(nested, '$__parent', { + enumerable: false, + configurable: true, + writable: false, + value: this + }); + + compile(subprops, nested, path, options); + this.$__.getters[path] = nested; + } + + return this.$__.getters[path]; + }, + set: function(v) { + if (v != null && v.$__isNested) { + // Convert top-level to POJO, but leave subdocs hydrated so `$set` + // can handle them. See gh-9293. + v = v.$__get(); + } else if (v instanceof Document && !v.$__isNested) { + v = v.$toObject(internalToObjectOptions); + } + const doc = this.$__[scopeSymbol] || this; + doc.$set(path, v); + } + }); + } else { + Object.defineProperty(prototype, prop, { + enumerable: true, + configurable: true, + get: function() { + return this[getSymbol].call(this.$__[scopeSymbol] || this, path); + }, + set: function(v) { + this.$set.call(this.$__[scopeSymbol] || this, path, v); + } + }); + } +} + +// gets descriptors for all properties of `object` +// makes all properties non-enumerable to match previous behavior to #2211 +function getOwnPropertyDescriptors(object) { + const result = {}; + + Object.getOwnPropertyNames(object).forEach(function(key) { + const skip = [ + 'isNew', + '$__', + '$errors', + 'errors', + '_doc', + '$locals', + '$op', + '__parentArray', + '__index', + '$isDocumentArrayElement' + ].indexOf(key) === -1; + if (skip) { + return; + } + + result[key] = Object.getOwnPropertyDescriptor(object, key); + result[key].enumerable = false; + }); + + return result; +} diff --git a/node_modules/mongoose/lib/helpers/document/getEmbeddedDiscriminatorPath.js b/node_modules/mongoose/lib/helpers/document/getEmbeddedDiscriminatorPath.js new file mode 100644 index 000000000..3f4d22a21 --- /dev/null +++ b/node_modules/mongoose/lib/helpers/document/getEmbeddedDiscriminatorPath.js @@ -0,0 +1,46 @@ +'use strict'; + +const get = require('../get'); +const getSchemaDiscriminatorByValue = require('../discriminator/getSchemaDiscriminatorByValue'); + +/*! + * Like `schema.path()`, except with a document, because impossible to + * determine path type without knowing the embedded discriminator key. + */ + +module.exports = function getEmbeddedDiscriminatorPath(doc, path, options) { + options = options || {}; + const typeOnly = options.typeOnly; + const parts = path.indexOf('.') === -1 ? [path] : path.split('.'); + let schemaType = null; + let type = 'adhocOrUndefined'; + + const schema = getSchemaDiscriminatorByValue(doc.schema, doc.get(doc.schema.options.discriminatorKey)) || doc.schema; + + for (let i = 0; i < parts.length; ++i) { + const subpath = parts.slice(0, i + 1).join('.'); + schemaType = schema.path(subpath); + if (schemaType == null) { + type = 'adhocOrUndefined'; + continue; + } + if (schemaType.instance === 'Mixed') { + return typeOnly ? 'real' : schemaType; + } + type = schema.pathType(subpath); + if ((schemaType.$isSingleNested || schemaType.$isMongooseDocumentArrayElement) && + schemaType.schema.discriminators != null) { + const discriminators = schemaType.schema.discriminators; + const discriminatorKey = doc.get(subpath + '.' + + get(schemaType, 'schema.options.discriminatorKey')); + if (discriminatorKey == null || discriminators[discriminatorKey] == null) { + continue; + } + const rest = parts.slice(i + 1).join('.'); + return getEmbeddedDiscriminatorPath(doc.get(subpath), rest, options); + } + } + + // Are we getting the whole schema or just the type, 'real', 'nested', etc. + return typeOnly ? type : schemaType; +}; diff --git a/node_modules/mongoose/lib/helpers/document/handleSpreadDoc.js b/node_modules/mongoose/lib/helpers/document/handleSpreadDoc.js new file mode 100644 index 000000000..63b928ee0 --- /dev/null +++ b/node_modules/mongoose/lib/helpers/document/handleSpreadDoc.js @@ -0,0 +1,35 @@ +'use strict'; + +const utils = require('../../utils'); + +const keysToSkip = new Set(['__index', '__parentArray', '_doc']); + +/** + * Using spread operator on a Mongoose document gives you a + * POJO that has a tendency to cause infinite recursion. So + * we use this function on `set()` to prevent that. + */ + +module.exports = function handleSpreadDoc(v, includeExtraKeys) { + if (utils.isPOJO(v) && v.$__ != null && v._doc != null) { + if (includeExtraKeys) { + const extraKeys = {}; + for (const key of Object.keys(v)) { + if (typeof key === 'symbol') { + continue; + } + if (key[0] === '$') { + continue; + } + if (keysToSkip.has(key)) { + continue; + } + extraKeys[key] = v[key]; + } + return { ...v._doc, ...extraKeys }; + } + return v._doc; + } + + return v; +}; \ No newline at end of file diff --git a/node_modules/mongoose/lib/helpers/each.js b/node_modules/mongoose/lib/helpers/each.js new file mode 100644 index 000000000..fe7006931 --- /dev/null +++ b/node_modules/mongoose/lib/helpers/each.js @@ -0,0 +1,25 @@ +'use strict'; + +module.exports = function each(arr, cb, done) { + if (arr.length === 0) { + return done(); + } + + let remaining = arr.length; + let err = null; + for (const v of arr) { + cb(v, function(_err) { + if (err != null) { + return; + } + if (_err != null) { + err = _err; + return done(err); + } + + if (--remaining <= 0) { + return done(); + } + }); + } +}; \ No newline at end of file diff --git a/node_modules/mongoose/lib/helpers/get.js b/node_modules/mongoose/lib/helpers/get.js new file mode 100644 index 000000000..dbab30601 --- /dev/null +++ b/node_modules/mongoose/lib/helpers/get.js @@ -0,0 +1,64 @@ +'use strict'; + +/*! + * Simplified lodash.get to work around the annoying null quirk. See: + * https://github.com/lodash/lodash/issues/3659 + */ + +module.exports = function get(obj, path, def) { + let parts; + let isPathArray = false; + if (typeof path === 'string') { + if (path.indexOf('.') === -1) { + const _v = getProperty(obj, path); + if (_v == null) { + return def; + } + return _v; + } + + parts = path.split('.'); + } else { + isPathArray = true; + parts = path; + + if (parts.length === 1) { + const _v = getProperty(obj, parts[0]); + if (_v == null) { + return def; + } + return _v; + } + } + let rest = path; + let cur = obj; + for (const part of parts) { + if (cur == null) { + return def; + } + + // `lib/cast.js` depends on being able to get dotted paths in updates, + // like `{ $set: { 'a.b': 42 } }` + if (!isPathArray && cur[rest] != null) { + return cur[rest]; + } + + cur = getProperty(cur, part); + + if (!isPathArray) { + rest = rest.substr(part.length + 1); + } + } + + return cur == null ? def : cur; +}; + +function getProperty(obj, prop) { + if (obj == null) { + return obj; + } + if (obj instanceof Map) { + return obj.get(prop); + } + return obj[prop]; +} \ No newline at end of file diff --git a/node_modules/mongoose/lib/helpers/getConstructorName.js b/node_modules/mongoose/lib/helpers/getConstructorName.js new file mode 100644 index 000000000..a4e192493 --- /dev/null +++ b/node_modules/mongoose/lib/helpers/getConstructorName.js @@ -0,0 +1,15 @@ +'use strict'; + +/*! + * If `val` is an object, returns constructor name, if possible. Otherwise returns undefined. + */ + +module.exports = function getConstructorName(val) { + if (val == null) { + return void 0; + } + if (typeof val.constructor !== 'function') { + return void 0; + } + return val.constructor.name; +}; \ No newline at end of file diff --git a/node_modules/mongoose/lib/helpers/getDefaultBulkwriteResult.js b/node_modules/mongoose/lib/helpers/getDefaultBulkwriteResult.js new file mode 100644 index 000000000..7d10f1748 --- /dev/null +++ b/node_modules/mongoose/lib/helpers/getDefaultBulkwriteResult.js @@ -0,0 +1,27 @@ +'use strict'; +function getDefaultBulkwriteResult() { + return { + result: { + ok: 1, + writeErrors: [], + writeConcernErrors: [], + insertedIds: [], + nInserted: 0, + nUpserted: 0, + nMatched: 0, + nModified: 0, + nRemoved: 0, + upserted: [] + }, + insertedCount: 0, + matchedCount: 0, + modifiedCount: 0, + deletedCount: 0, + upsertedCount: 0, + upsertedIds: {}, + insertedIds: {}, + n: 0 + }; +} + +module.exports = getDefaultBulkwriteResult; \ No newline at end of file diff --git a/node_modules/mongoose/lib/helpers/getFunctionName.js b/node_modules/mongoose/lib/helpers/getFunctionName.js new file mode 100644 index 000000000..d1f3a5a6a --- /dev/null +++ b/node_modules/mongoose/lib/helpers/getFunctionName.js @@ -0,0 +1,10 @@ +'use strict'; + +const functionNameRE = /^function\s*([^\s(]+)/; + +module.exports = function(fn) { + return ( + fn.name || + (fn.toString().trim().match(functionNameRE) || [])[1] + ); +}; diff --git a/node_modules/mongoose/lib/helpers/immediate.js b/node_modules/mongoose/lib/helpers/immediate.js new file mode 100644 index 000000000..73085f7d4 --- /dev/null +++ b/node_modules/mongoose/lib/helpers/immediate.js @@ -0,0 +1,16 @@ +/*! + * Centralize this so we can more easily work around issues with people + * stubbing out `process.nextTick()` in tests using sinon: + * https://github.com/sinonjs/lolex#automatically-incrementing-mocked-time + * See gh-6074 + */ + +'use strict'; + +const nextTick = typeof process !== 'undefined' && typeof process.nextTick === 'function' ? + process.nextTick.bind(process) : + cb => setTimeout(cb, 0); // Fallback for browser build + +module.exports = function immediate(cb) { + return nextTick(cb); +}; diff --git a/node_modules/mongoose/lib/helpers/indexes/applySchemaCollation.js b/node_modules/mongoose/lib/helpers/indexes/applySchemaCollation.js new file mode 100644 index 000000000..474d7fc23 --- /dev/null +++ b/node_modules/mongoose/lib/helpers/indexes/applySchemaCollation.js @@ -0,0 +1,13 @@ +'use strict'; + +const isTextIndex = require('./isTextIndex'); + +module.exports = function applySchemaCollation(indexKeys, indexOptions, schemaOptions) { + if (isTextIndex(indexKeys)) { + return; + } + + if (schemaOptions.hasOwnProperty('collation') && !indexOptions.hasOwnProperty('collation')) { + indexOptions.collation = schemaOptions.collation; + } +}; \ No newline at end of file diff --git a/node_modules/mongoose/lib/helpers/indexes/decorateDiscriminatorIndexOptions.js b/node_modules/mongoose/lib/helpers/indexes/decorateDiscriminatorIndexOptions.js new file mode 100644 index 000000000..6458c1ba6 --- /dev/null +++ b/node_modules/mongoose/lib/helpers/indexes/decorateDiscriminatorIndexOptions.js @@ -0,0 +1,14 @@ +'use strict'; + +module.exports = function decorateDiscriminatorIndexOptions(schema, indexOptions) { + // If the model is a discriminator and has an index, add a + // partialFilterExpression by default so the index will only apply + // to that discriminator. + const discriminatorName = schema.discriminatorMapping && schema.discriminatorMapping.value; + if (discriminatorName && !('sparse' in indexOptions)) { + const discriminatorKey = schema.options.discriminatorKey; + indexOptions.partialFilterExpression = indexOptions.partialFilterExpression || {}; + indexOptions.partialFilterExpression[discriminatorKey] = discriminatorName; + } + return indexOptions; +}; \ No newline at end of file diff --git a/node_modules/mongoose/lib/helpers/indexes/getRelatedIndexes.js b/node_modules/mongoose/lib/helpers/indexes/getRelatedIndexes.js new file mode 100644 index 000000000..42d5798c6 --- /dev/null +++ b/node_modules/mongoose/lib/helpers/indexes/getRelatedIndexes.js @@ -0,0 +1,59 @@ +'use strict'; + +function getRelatedSchemaIndexes(model, schemaIndexes) { + return getRelatedIndexes({ + baseModelName: model.baseModelName, + discriminatorMapping: model.schema.discriminatorMapping, + indexes: schemaIndexes, + indexesType: 'schema' + }); +} + +function getRelatedDBIndexes(model, dbIndexes) { + return getRelatedIndexes({ + baseModelName: model.baseModelName, + discriminatorMapping: model.schema.discriminatorMapping, + indexes: dbIndexes, + indexesType: 'db' + }); +} + +module.exports = { + getRelatedSchemaIndexes, + getRelatedDBIndexes +}; + +function getRelatedIndexes({ + baseModelName, + discriminatorMapping, + indexes, + indexesType +}) { + const discriminatorKey = discriminatorMapping && discriminatorMapping.key; + const discriminatorValue = discriminatorMapping && discriminatorMapping.value; + + if (!discriminatorKey) { + return indexes; + } + + const isChildDiscriminatorModel = Boolean(baseModelName); + if (isChildDiscriminatorModel) { + return indexes.filter(index => { + const partialFilterExpression = getPartialFilterExpression(index, indexesType); + return partialFilterExpression && partialFilterExpression[discriminatorKey] === discriminatorValue; + }); + } + + return indexes.filter(index => { + const partialFilterExpression = getPartialFilterExpression(index, indexesType); + return !partialFilterExpression || !partialFilterExpression[discriminatorKey]; + }); +} + +function getPartialFilterExpression(index, indexesType) { + if (indexesType === 'schema') { + const options = index[1]; + return options && options.partialFilterExpression; + } + return index.partialFilterExpression; +} diff --git a/node_modules/mongoose/lib/helpers/indexes/isDefaultIdIndex.js b/node_modules/mongoose/lib/helpers/indexes/isDefaultIdIndex.js new file mode 100644 index 000000000..c975dcfc3 --- /dev/null +++ b/node_modules/mongoose/lib/helpers/indexes/isDefaultIdIndex.js @@ -0,0 +1,18 @@ +'use strict'; + +const get = require('../get'); + +module.exports = function isDefaultIdIndex(index) { + if (Array.isArray(index)) { + // Mongoose syntax + const keys = Object.keys(index[0]); + return keys.length === 1 && keys[0] === '_id' && index[0]._id !== 'hashed'; + } + + if (typeof index !== 'object') { + return false; + } + + const key = get(index, 'key', {}); + return Object.keys(key).length === 1 && key.hasOwnProperty('_id'); +}; \ No newline at end of file diff --git a/node_modules/mongoose/lib/helpers/indexes/isIndexEqual.js b/node_modules/mongoose/lib/helpers/indexes/isIndexEqual.js new file mode 100644 index 000000000..12e5c3d08 --- /dev/null +++ b/node_modules/mongoose/lib/helpers/indexes/isIndexEqual.js @@ -0,0 +1,96 @@ +'use strict'; + +const get = require('../get'); +const utils = require('../../utils'); +/** + * Given a Mongoose index definition (key + options objects) and a MongoDB server + * index definition, determine if the two indexes are equal. + * + * @param {Object} key the Mongoose index spec + * @param {Object} options the Mongoose index definition's options + * @param {Object} dbIndex the index in MongoDB as returned by `listIndexes()` + * @api private + */ + +module.exports = function isIndexEqual(key, options, dbIndex) { + // Special case: text indexes have a special format in the db. For example, + // `{ name: 'text' }` becomes: + // { + // v: 2, + // key: { _fts: 'text', _ftsx: 1 }, + // name: 'name_text', + // ns: 'test.tests', + // background: true, + // weights: { name: 1 }, + // default_language: 'english', + // language_override: 'language', + // textIndexVersion: 3 + // } + if (dbIndex.textIndexVersion != null) { + delete dbIndex.key._fts; + delete dbIndex.key._ftsx; + const weights = { ...dbIndex.weights, ...dbIndex.key }; + if (Object.keys(weights).length !== Object.keys(key).length) { + return false; + } + for (const prop of Object.keys(weights)) { + if (!(prop in key)) { + return false; + } + const weight = weights[prop]; + if (weight !== get(options, 'weights.' + prop) && !(weight === 1 && get(options, 'weights.' + prop) == null)) { + return false; + } + } + + if (options['default_language'] !== dbIndex['default_language']) { + return dbIndex['default_language'] === 'english' && options['default_language'] == null; + } + + return true; + } + + const optionKeys = [ + 'unique', + 'partialFilterExpression', + 'sparse', + 'expireAfterSeconds', + 'collation' + ]; + for (const key of optionKeys) { + if (!(key in options) && !(key in dbIndex)) { + continue; + } + if (key === 'collation') { + if (options[key] == null || dbIndex[key] == null) { + return options[key] == null && dbIndex[key] == null; + } + const definedKeys = Object.keys(options.collation); + const schemaCollation = options.collation; + const dbCollation = dbIndex.collation; + for (const opt of definedKeys) { + if (get(schemaCollation, opt) !== get(dbCollation, opt)) { + return false; + } + } + } else if (!utils.deepEqual(options[key], dbIndex[key])) { + return false; + } + } + + const schemaIndexKeys = Object.keys(key); + const dbIndexKeys = Object.keys(dbIndex.key); + if (schemaIndexKeys.length !== dbIndexKeys.length) { + return false; + } + for (let i = 0; i < schemaIndexKeys.length; ++i) { + if (schemaIndexKeys[i] !== dbIndexKeys[i]) { + return false; + } + if (!utils.deepEqual(key[schemaIndexKeys[i]], dbIndex.key[dbIndexKeys[i]])) { + return false; + } + } + + return true; +}; diff --git a/node_modules/mongoose/lib/helpers/indexes/isTextIndex.js b/node_modules/mongoose/lib/helpers/indexes/isTextIndex.js new file mode 100644 index 000000000..cc5d80c59 --- /dev/null +++ b/node_modules/mongoose/lib/helpers/indexes/isTextIndex.js @@ -0,0 +1,16 @@ +'use strict'; + +/** + * Returns `true` if the given index options have a `text` option. + */ + +module.exports = function isTextIndex(indexKeys) { + let isTextIndex = false; + for (const key of Object.keys(indexKeys)) { + if (indexKeys[key] === 'text') { + isTextIndex = true; + } + } + + return isTextIndex; +}; \ No newline at end of file diff --git a/node_modules/mongoose/lib/helpers/isAsyncFunction.js b/node_modules/mongoose/lib/helpers/isAsyncFunction.js new file mode 100644 index 000000000..998705304 --- /dev/null +++ b/node_modules/mongoose/lib/helpers/isAsyncFunction.js @@ -0,0 +1,22 @@ +'use strict'; + +let asyncFunctionPrototype = null; +// try/catch for Babel compatibility, because Babel preset-env requires +// regenerator-runtime for async/await and we don't want to include that +// for a simple check. +try { + asyncFunctionPrototype = Object.getPrototypeOf(async function() {}); +} catch (err) {} + +if (asyncFunctionPrototype == null) { + module.exports = function isAsyncFunction() { + return false; + }; +} else { + module.exports = function isAsyncFunction(v) { + return ( + typeof v === 'function' && + Object.getPrototypeOf(v) === asyncFunctionPrototype + ); + }; +} diff --git a/node_modules/mongoose/lib/helpers/isBsonType.js b/node_modules/mongoose/lib/helpers/isBsonType.js new file mode 100644 index 000000000..54791cd02 --- /dev/null +++ b/node_modules/mongoose/lib/helpers/isBsonType.js @@ -0,0 +1,15 @@ +'use strict'; + +/*! + * Get the bson type, if it exists + */ + +function isBsonType(obj, typename) { + return ( + typeof obj === 'object' && + obj !== null && + obj._bsontype === typename + ); +} + +module.exports = isBsonType; diff --git a/node_modules/mongoose/lib/helpers/isMongooseObject.js b/node_modules/mongoose/lib/helpers/isMongooseObject.js new file mode 100644 index 000000000..d82866c6b --- /dev/null +++ b/node_modules/mongoose/lib/helpers/isMongooseObject.js @@ -0,0 +1,22 @@ +'use strict'; + +const isMongooseArray = require('../types/array/isMongooseArray').isMongooseArray; +/*! + * Returns if `v` is a mongoose object that has a `toObject()` method we can use. + * + * This is for compatibility with libs like Date.js which do foolish things to Natives. + * + * @param {any} v + * @api private + */ + +module.exports = function(v) { + return ( + v != null && ( + isMongooseArray(v) || // Array or Document Array + v.$__ != null || // Document + v.isMongooseBuffer || // Buffer + v.$isMongooseMap // Map + ) + ); +}; \ No newline at end of file diff --git a/node_modules/mongoose/lib/helpers/isObject.js b/node_modules/mongoose/lib/helpers/isObject.js new file mode 100644 index 000000000..436aa9c0f --- /dev/null +++ b/node_modules/mongoose/lib/helpers/isObject.js @@ -0,0 +1,16 @@ +'use strict'; + +/*! + * Determines if `arg` is an object. + * + * @param {Object|Array|String|Function|RegExp|any} arg + * @api private + * @return {Boolean} + */ + +module.exports = function(arg) { + return ( + Buffer.isBuffer(arg) || + Object.prototype.toString.call(arg) === '[object Object]' + ); +}; \ No newline at end of file diff --git a/node_modules/mongoose/lib/helpers/isPromise.js b/node_modules/mongoose/lib/helpers/isPromise.js new file mode 100644 index 000000000..d6db2608c --- /dev/null +++ b/node_modules/mongoose/lib/helpers/isPromise.js @@ -0,0 +1,6 @@ +'use strict'; +function isPromise(val) { + return !!val && (typeof val === 'object' || typeof val === 'function') && typeof val.then === 'function'; +} + +module.exports = isPromise; \ No newline at end of file diff --git a/node_modules/mongoose/lib/helpers/isSimpleValidator.js b/node_modules/mongoose/lib/helpers/isSimpleValidator.js new file mode 100644 index 000000000..dad6c31d6 --- /dev/null +++ b/node_modules/mongoose/lib/helpers/isSimpleValidator.js @@ -0,0 +1,22 @@ +'use strict'; + +/*! + * Determines if `arg` is a flat object. + * + * @param {Object|Array|String|Function|RegExp|any} arg + * @api private + * @return {Boolean} + */ + +module.exports = function isSimpleValidator(obj) { + const keys = Object.keys(obj); + let result = true; + for (let i = 0, len = keys.length; i < len; ++i) { + if (typeof obj[keys[i]] === 'object' && obj[keys[i]] !== null) { + result = false; + break; + } + } + + return result; +}; diff --git a/node_modules/mongoose/lib/helpers/model/applyHooks.js b/node_modules/mongoose/lib/helpers/model/applyHooks.js new file mode 100644 index 000000000..0498c75e6 --- /dev/null +++ b/node_modules/mongoose/lib/helpers/model/applyHooks.js @@ -0,0 +1,138 @@ +'use strict'; + +const symbols = require('../../schema/symbols'); +const promiseOrCallback = require('../promiseOrCallback'); + +/*! + * ignore + */ + +module.exports = applyHooks; + +/*! + * ignore + */ + +applyHooks.middlewareFunctions = [ + 'deleteOne', + 'save', + 'validate', + 'remove', + 'updateOne', + 'init' +]; + +/*! + * Register hooks for this model + * + * @param {Model} model + * @param {Schema} schema + */ + +function applyHooks(model, schema, options) { + options = options || {}; + + const kareemOptions = { + useErrorHandlers: true, + numCallbackParams: 1, + nullResultByDefault: true, + contextParameter: true + }; + const objToDecorate = options.decorateDoc ? model : model.prototype; + + model.$appliedHooks = true; + for (const key of Object.keys(schema.paths)) { + const type = schema.paths[key]; + let childModel = null; + if (type.$isSingleNested) { + childModel = type.caster; + } else if (type.$isMongooseDocumentArray) { + childModel = type.Constructor; + } else { + continue; + } + + if (childModel.$appliedHooks) { + continue; + } + + applyHooks(childModel, type.schema, options); + if (childModel.discriminators != null) { + const keys = Object.keys(childModel.discriminators); + for (const key of keys) { + applyHooks(childModel.discriminators[key], + childModel.discriminators[key].schema, options); + } + } + } + + // Built-in hooks rely on hooking internal functions in order to support + // promises and make it so that `doc.save.toString()` provides meaningful + // information. + + const middleware = schema.s.hooks. + filter(hook => { + if (hook.name === 'updateOne' || hook.name === 'deleteOne') { + return !!hook['document']; + } + if (hook.name === 'remove' || hook.name === 'init') { + return hook['document'] == null || !!hook['document']; + } + if (hook.query != null || hook.document != null) { + return hook.document !== false; + } + return true; + }). + filter(hook => { + // If user has overwritten the method, don't apply built-in middleware + if (schema.methods[hook.name]) { + return !hook.fn[symbols.builtInMiddleware]; + } + + return true; + }); + + model._middleware = middleware; + + objToDecorate.$__originalValidate = objToDecorate.$__originalValidate || objToDecorate.$__validate; + + for (const method of ['save', 'validate', 'remove', 'deleteOne']) { + const toWrap = method === 'validate' ? '$__originalValidate' : `$__${method}`; + const wrapped = middleware. + createWrapper(method, objToDecorate[toWrap], null, kareemOptions); + objToDecorate[`$__${method}`] = wrapped; + } + objToDecorate.$__init = middleware. + createWrapperSync('init', objToDecorate.$__init, null, kareemOptions); + + // Support hooks for custom methods + const customMethods = Object.keys(schema.methods); + const customMethodOptions = Object.assign({}, kareemOptions, { + // Only use `checkForPromise` for custom methods, because mongoose + // query thunks are not as consistent as I would like about returning + // a nullish value rather than the query. If a query thunk returns + // a query, `checkForPromise` causes infinite recursion + checkForPromise: true + }); + for (const method of customMethods) { + if (!middleware.hasHooks(method)) { + // Don't wrap if there are no hooks for the custom method to avoid + // surprises. Also, `createWrapper()` enforces consistent async, + // so wrapping a sync method would break it. + continue; + } + const originalMethod = objToDecorate[method]; + objToDecorate[method] = function() { + const args = Array.prototype.slice.call(arguments); + const cb = args.slice(-1).pop(); + const argsWithoutCallback = typeof cb === 'function' ? + args.slice(0, args.length - 1) : args; + return promiseOrCallback(cb, callback => { + return this[`$__${method}`].apply(this, + argsWithoutCallback.concat([callback])); + }, model.events); + }; + objToDecorate[`$__${method}`] = middleware. + createWrapper(method, originalMethod, null, customMethodOptions); + } +} \ No newline at end of file diff --git a/node_modules/mongoose/lib/helpers/model/applyMethods.js b/node_modules/mongoose/lib/helpers/model/applyMethods.js new file mode 100644 index 000000000..bd3718da3 --- /dev/null +++ b/node_modules/mongoose/lib/helpers/model/applyMethods.js @@ -0,0 +1,57 @@ +'use strict'; + +const get = require('../get'); +const utils = require('../../utils'); + +/*! + * Register methods for this model + * + * @param {Model} model + * @param {Schema} schema + */ + +module.exports = function applyMethods(model, schema) { + function apply(method, schema) { + Object.defineProperty(model.prototype, method, { + get: function() { + const h = {}; + for (const k in schema.methods[method]) { + h[k] = schema.methods[method][k].bind(this); + } + return h; + }, + configurable: true + }); + } + for (const method of Object.keys(schema.methods)) { + const fn = schema.methods[method]; + if (schema.tree.hasOwnProperty(method)) { + throw new Error('You have a method and a property in your schema both ' + + 'named "' + method + '"'); + } + if (schema.reserved[method] && + !get(schema, `methodOptions.${method}.suppressWarning`, false)) { + utils.warn(`mongoose: the method name "${method}" is used by mongoose ` + + 'internally, overwriting it may cause bugs. If you\'re sure you know ' + + 'what you\'re doing, you can suppress this error by using ' + + `\`schema.method('${method}', fn, { suppressWarning: true })\`.`); + } + if (typeof fn === 'function') { + model.prototype[method] = fn; + } else { + apply(method, schema); + } + } + + // Recursively call `applyMethods()` on child schemas + model.$appliedMethods = true; + for (const key of Object.keys(schema.paths)) { + const type = schema.paths[key]; + if (type.$isSingleNested && !type.caster.$appliedMethods) { + applyMethods(type.caster, type.schema); + } + if (type.$isMongooseDocumentArray && !type.Constructor.$appliedMethods) { + applyMethods(type.Constructor, type.schema); + } + } +}; diff --git a/node_modules/mongoose/lib/helpers/model/applyStaticHooks.js b/node_modules/mongoose/lib/helpers/model/applyStaticHooks.js new file mode 100644 index 000000000..219e28903 --- /dev/null +++ b/node_modules/mongoose/lib/helpers/model/applyStaticHooks.js @@ -0,0 +1,71 @@ +'use strict'; + +const middlewareFunctions = require('../query/applyQueryMiddleware').middlewareFunctions; +const promiseOrCallback = require('../promiseOrCallback'); + +module.exports = function applyStaticHooks(model, hooks, statics) { + const kareemOptions = { + useErrorHandlers: true, + numCallbackParams: 1 + }; + + hooks = hooks.filter(hook => { + // If the custom static overwrites an existing query middleware, don't apply + // middleware to it by default. This avoids a potential backwards breaking + // change with plugins like `mongoose-delete` that use statics to overwrite + // built-in Mongoose functions. + if (middlewareFunctions.indexOf(hook.name) !== -1) { + return !!hook.model; + } + return hook.model !== false; + }); + + model.$__insertMany = hooks.createWrapper('insertMany', + model.$__insertMany, model, kareemOptions); + + for (const key of Object.keys(statics)) { + if (hooks.hasHooks(key)) { + const original = model[key]; + + model[key] = function() { + const numArgs = arguments.length; + const lastArg = numArgs > 0 ? arguments[numArgs - 1] : null; + const cb = typeof lastArg === 'function' ? lastArg : null; + const args = Array.prototype.slice. + call(arguments, 0, cb == null ? numArgs : numArgs - 1); + // Special case: can't use `Kareem#wrap()` because it doesn't currently + // support wrapped functions that return a promise. + return promiseOrCallback(cb, callback => { + hooks.execPre(key, model, args, function(err) { + if (err != null) { + return callback(err); + } + + let postCalled = 0; + const ret = original.apply(model, args.concat(post)); + if (ret != null && typeof ret.then === 'function') { + ret.then(res => post(null, res), err => post(err)); + } + + function post(error, res) { + if (postCalled++ > 0) { + return; + } + + if (error != null) { + return callback(error); + } + + hooks.execPost(key, model, [res], function(error) { + if (error != null) { + return callback(error); + } + callback(null, res); + }); + } + }); + }, model.events); + }; + } + } +}; \ No newline at end of file diff --git a/node_modules/mongoose/lib/helpers/model/applyStatics.js b/node_modules/mongoose/lib/helpers/model/applyStatics.js new file mode 100644 index 000000000..3b9501e04 --- /dev/null +++ b/node_modules/mongoose/lib/helpers/model/applyStatics.js @@ -0,0 +1,12 @@ +'use strict'; + +/*! + * Register statics for this model + * @param {Model} model + * @param {Schema} schema + */ +module.exports = function applyStatics(model, schema) { + for (const i in schema.statics) { + model[i] = schema.statics[i]; + } +}; diff --git a/node_modules/mongoose/lib/helpers/model/castBulkWrite.js b/node_modules/mongoose/lib/helpers/model/castBulkWrite.js new file mode 100644 index 000000000..5b882b6d5 --- /dev/null +++ b/node_modules/mongoose/lib/helpers/model/castBulkWrite.js @@ -0,0 +1,235 @@ +'use strict'; + +const getDiscriminatorByValue = require('../../helpers/discriminator/getDiscriminatorByValue'); +const applyTimestampsToChildren = require('../update/applyTimestampsToChildren'); +const applyTimestampsToUpdate = require('../update/applyTimestampsToUpdate'); +const cast = require('../../cast'); +const castUpdate = require('../query/castUpdate'); +const setDefaultsOnInsert = require('../setDefaultsOnInsert'); + +/*! + * Given a model and a bulkWrite op, return a thunk that handles casting and + * validating the individual op. + */ + +module.exports = function castBulkWrite(originalModel, op, options) { + const now = originalModel.base.now(); + + if (op['insertOne']) { + return (callback) => { + const model = decideModelByObject(originalModel, op['insertOne']['document']); + + const doc = new model(op['insertOne']['document']); + if (model.schema.options.timestamps) { + doc.initializeTimestamps(); + } + if (options.session != null) { + doc.$session(options.session); + } + op['insertOne']['document'] = doc; + + if (options.skipValidation || op['insertOne'].skipValidation) { + callback(null); + return; + } + + op['insertOne']['document'].$validate({ __noPromise: true }, function(error) { + if (error) { + return callback(error, null); + } + callback(null); + }); + }; + } else if (op['updateOne']) { + return (callback) => { + try { + if (!op['updateOne']['filter']) { + throw new Error('Must provide a filter object.'); + } + if (!op['updateOne']['update']) { + throw new Error('Must provide an update object.'); + } + + const model = decideModelByObject(originalModel, op['updateOne']['filter']); + const schema = model.schema; + const strict = options.strict != null ? options.strict : model.schema.options.strict; + + _addDiscriminatorToObject(schema, op['updateOne']['filter']); + + if (model.schema.$timestamps != null && op['updateOne'].timestamps !== false) { + const createdAt = model.schema.$timestamps.createdAt; + const updatedAt = model.schema.$timestamps.updatedAt; + applyTimestampsToUpdate(now, createdAt, updatedAt, op['updateOne']['update'], {}); + } + + applyTimestampsToChildren(now, op['updateOne']['update'], model.schema); + + if (op['updateOne'].setDefaultsOnInsert !== false) { + setDefaultsOnInsert(op['updateOne']['filter'], model.schema, op['updateOne']['update'], { + setDefaultsOnInsert: true, + upsert: op['updateOne'].upsert + }); + } + + op['updateOne']['filter'] = cast(model.schema, op['updateOne']['filter'], { + strict: strict, + upsert: op['updateOne'].upsert + }); + + op['updateOne']['update'] = castUpdate(model.schema, op['updateOne']['update'], { + strict: strict, + overwrite: false, + upsert: op['updateOne'].upsert + }, model, op['updateOne']['filter']); + } catch (error) { + return callback(error, null); + } + + callback(null); + }; + } else if (op['updateMany']) { + return (callback) => { + try { + if (!op['updateMany']['filter']) { + throw new Error('Must provide a filter object.'); + } + if (!op['updateMany']['update']) { + throw new Error('Must provide an update object.'); + } + + const model = decideModelByObject(originalModel, op['updateMany']['filter']); + const schema = model.schema; + const strict = options.strict != null ? options.strict : model.schema.options.strict; + + if (op['updateMany'].setDefaultsOnInsert !== false) { + setDefaultsOnInsert(op['updateMany']['filter'], model.schema, op['updateMany']['update'], { + setDefaultsOnInsert: true, + upsert: op['updateMany'].upsert + }); + } + + if (model.schema.$timestamps != null && op['updateMany'].timestamps !== false) { + const createdAt = model.schema.$timestamps.createdAt; + const updatedAt = model.schema.$timestamps.updatedAt; + applyTimestampsToUpdate(now, createdAt, updatedAt, op['updateMany']['update'], {}); + } + + applyTimestampsToChildren(now, op['updateMany']['update'], model.schema); + + _addDiscriminatorToObject(schema, op['updateMany']['filter']); + + op['updateMany']['filter'] = cast(model.schema, op['updateMany']['filter'], { + strict: strict, + upsert: op['updateMany'].upsert + }); + + op['updateMany']['update'] = castUpdate(model.schema, op['updateMany']['update'], { + strict: strict, + overwrite: false, + upsert: op['updateMany'].upsert + }, model, op['updateMany']['filter']); + } catch (error) { + return callback(error, null); + } + + callback(null); + }; + } else if (op['replaceOne']) { + return (callback) => { + const model = decideModelByObject(originalModel, op['replaceOne']['filter']); + const schema = model.schema; + const strict = options.strict != null ? options.strict : model.schema.options.strict; + + _addDiscriminatorToObject(schema, op['replaceOne']['filter']); + try { + op['replaceOne']['filter'] = cast(model.schema, op['replaceOne']['filter'], { + strict: strict, + upsert: op['replaceOne'].upsert + }); + } catch (error) { + return callback(error, null); + } + + // set `skipId`, otherwise we get "_id field cannot be changed" + const doc = new model(op['replaceOne']['replacement'], strict, true); + if (model.schema.options.timestamps) { + doc.initializeTimestamps(); + } + if (options.session != null) { + doc.$session(options.session); + } + op['replaceOne']['replacement'] = doc; + + if (options.skipValidation || op['replaceOne'].skipValidation) { + op['replaceOne']['replacement'] = op['replaceOne']['replacement'].toBSON(); + callback(null); + return; + } + + op['replaceOne']['replacement'].$validate({ __noPromise: true }, function(error) { + if (error) { + return callback(error, null); + } + op['replaceOne']['replacement'] = op['replaceOne']['replacement'].toBSON(); + callback(null); + }); + }; + } else if (op['deleteOne']) { + return (callback) => { + const model = decideModelByObject(originalModel, op['deleteOne']['filter']); + const schema = model.schema; + + _addDiscriminatorToObject(schema, op['deleteOne']['filter']); + + try { + op['deleteOne']['filter'] = cast(model.schema, + op['deleteOne']['filter']); + } catch (error) { + return callback(error, null); + } + + callback(null); + }; + } else if (op['deleteMany']) { + return (callback) => { + const model = decideModelByObject(originalModel, op['deleteMany']['filter']); + const schema = model.schema; + + _addDiscriminatorToObject(schema, op['deleteMany']['filter']); + + try { + op['deleteMany']['filter'] = cast(model.schema, + op['deleteMany']['filter']); + } catch (error) { + return callback(error, null); + } + + callback(null); + }; + } else { + return (callback) => { + callback(new Error('Invalid op passed to `bulkWrite()`'), null); + }; + } +}; + +function _addDiscriminatorToObject(schema, obj) { + if (schema == null) { + return; + } + if (schema.discriminatorMapping && !schema.discriminatorMapping.isRoot) { + obj[schema.discriminatorMapping.key] = schema.discriminatorMapping.value; + } +} + +/*! + * gets discriminator model if discriminator key is present in object + */ + +function decideModelByObject(model, object) { + const discriminatorKey = model.schema.options.discriminatorKey; + if (object != null && object.hasOwnProperty(discriminatorKey)) { + model = getDiscriminatorByValue(model.discriminators, object[discriminatorKey]) || model; + } + return model; +} diff --git a/node_modules/mongoose/lib/helpers/model/discriminator.js b/node_modules/mongoose/lib/helpers/model/discriminator.js new file mode 100644 index 000000000..75a6a26e8 --- /dev/null +++ b/node_modules/mongoose/lib/helpers/model/discriminator.js @@ -0,0 +1,208 @@ +'use strict'; + +const Mixed = require('../../schema/mixed'); +const defineKey = require('../document/compile').defineKey; +const get = require('../get'); +const utils = require('../../utils'); + +const CUSTOMIZABLE_DISCRIMINATOR_OPTIONS = { + toJSON: true, + toObject: true, + _id: true, + id: true +}; + +/*! + * ignore + */ + +module.exports = function discriminator(model, name, schema, tiedValue, applyPlugins) { + if (!(schema && schema.instanceOfSchema)) { + throw new Error('You must pass a valid discriminator Schema'); + } + + if (model.schema.discriminatorMapping && + !model.schema.discriminatorMapping.isRoot) { + throw new Error('Discriminator "' + name + + '" can only be a discriminator of the root model'); + } + + if (applyPlugins) { + const applyPluginsToDiscriminators = get(model.base, + 'options.applyPluginsToDiscriminators', false); + // Even if `applyPluginsToDiscriminators` isn't set, we should still apply + // global plugins to schemas embedded in the discriminator schema (gh-7370) + model.base._applyPlugins(schema, { + skipTopLevel: !applyPluginsToDiscriminators + }); + } + + const key = model.schema.options.discriminatorKey; + + const existingPath = model.schema.path(key); + if (existingPath != null) { + if (!utils.hasUserDefinedProperty(existingPath.options, 'select')) { + existingPath.options.select = true; + } + existingPath.options.$skipDiscriminatorCheck = true; + } else { + const baseSchemaAddition = {}; + baseSchemaAddition[key] = { + default: void 0, + select: true, + $skipDiscriminatorCheck: true + }; + baseSchemaAddition[key][model.schema.options.typeKey] = String; + model.schema.add(baseSchemaAddition); + defineKey({ + prop: key, + prototype: model.prototype, + options: model.schema.options + }); + } + + if (schema.path(key) && schema.path(key).options.$skipDiscriminatorCheck !== true) { + throw new Error('Discriminator "' + name + + '" cannot have field with name "' + key + '"'); + } + + let value = name; + if ((typeof tiedValue === 'string' && tiedValue.length) || tiedValue != null) { + value = tiedValue; + } + + function merge(schema, baseSchema) { + // Retain original schema before merging base schema + schema._baseSchema = baseSchema; + if (baseSchema.paths._id && + baseSchema.paths._id.options && + !baseSchema.paths._id.options.auto) { + schema.remove('_id'); + } + + // Find conflicting paths: if something is a path in the base schema + // and a nested path in the child schema, overwrite the base schema path. + // See gh-6076 + const baseSchemaPaths = Object.keys(baseSchema.paths); + const conflictingPaths = []; + + for (const path of baseSchemaPaths) { + if (schema.nested[path]) { + conflictingPaths.push(path); + continue; + } + + if (path.indexOf('.') === -1) { + continue; + } + const sp = path.split('.').slice(0, -1); + let cur = ''; + for (const piece of sp) { + cur += (cur.length ? '.' : '') + piece; + if (schema.paths[cur] instanceof Mixed || + schema.singleNestedPaths[cur] instanceof Mixed) { + conflictingPaths.push(path); + } + } + } + + utils.merge(schema, baseSchema, { + isDiscriminatorSchemaMerge: true, + omit: { discriminators: true, base: true, _applyDiscriminators: true }, + omitNested: conflictingPaths.reduce((cur, path) => { + cur['tree.' + path] = true; + return cur; + }, {}) + }); + + // Clean up conflicting paths _after_ merging re: gh-6076 + for (const conflictingPath of conflictingPaths) { + delete schema.paths[conflictingPath]; + } + + // Rebuild schema models because schemas may have been merged re: #7884 + schema.childSchemas.forEach(obj => { + obj.model.prototype.$__setSchema(obj.schema); + }); + + const obj = {}; + obj[key] = { + default: value, + select: true, + set: function(newName) { + if (newName === value || (Array.isArray(value) && utils.deepEqual(newName, value))) { + return value; + } + throw new Error('Can\'t set discriminator key "' + key + '"'); + }, + $skipDiscriminatorCheck: true + }; + obj[key][schema.options.typeKey] = existingPath ? existingPath.options[schema.options.typeKey] : String; + schema.add(obj); + + schema.discriminatorMapping = { key: key, value: value, isRoot: false }; + + if (baseSchema.options.collection) { + schema.options.collection = baseSchema.options.collection; + } + + const toJSON = schema.options.toJSON; + const toObject = schema.options.toObject; + const _id = schema.options._id; + const id = schema.options.id; + + const keys = Object.keys(schema.options); + schema.options.discriminatorKey = baseSchema.options.discriminatorKey; + + for (const _key of keys) { + if (!CUSTOMIZABLE_DISCRIMINATOR_OPTIONS[_key]) { + // Special case: compiling a model sets `pluralization = true` by default. Avoid throwing an error + // for that case. See gh-9238 + if (_key === 'pluralization' && schema.options[_key] == true && baseSchema.options[_key] == null) { + continue; + } + + if (!utils.deepEqual(schema.options[_key], baseSchema.options[_key])) { + throw new Error('Can\'t customize discriminator option ' + _key + + ' (can only modify ' + + Object.keys(CUSTOMIZABLE_DISCRIMINATOR_OPTIONS).join(', ') + + ')'); + } + } + } + schema.options = utils.clone(baseSchema.options); + if (toJSON) schema.options.toJSON = toJSON; + if (toObject) schema.options.toObject = toObject; + if (typeof _id !== 'undefined') { + schema.options._id = _id; + } + schema.options.id = id; + schema.s.hooks = model.schema.s.hooks.merge(schema.s.hooks); + + schema.plugins = Array.prototype.slice.call(baseSchema.plugins); + schema.callQueue = baseSchema.callQueue.concat(schema.callQueue); + delete schema._requiredpaths; // reset just in case Schema#requiredPaths() was called on either schema + } + + // merges base schema into new discriminator schema and sets new type field. + merge(schema, model.schema); + + if (!model.discriminators) { + model.discriminators = {}; + } + + if (!model.schema.discriminatorMapping) { + model.schema.discriminatorMapping = { key: key, value: null, isRoot: true }; + } + if (!model.schema.discriminators) { + model.schema.discriminators = {}; + } + + model.schema.discriminators[name] = schema; + + if (model.discriminators[name] && !schema.options.overwriteModels) { + throw new Error('Discriminator with name "' + name + '" already exists'); + } + + return schema; +}; diff --git a/node_modules/mongoose/lib/helpers/once.js b/node_modules/mongoose/lib/helpers/once.js new file mode 100644 index 000000000..02675799c --- /dev/null +++ b/node_modules/mongoose/lib/helpers/once.js @@ -0,0 +1,12 @@ +'use strict'; + +module.exports = function once(fn) { + let called = false; + return function() { + if (called) { + return; + } + called = true; + return fn.apply(null, arguments); + }; +}; \ No newline at end of file diff --git a/node_modules/mongoose/lib/helpers/parallelLimit.js b/node_modules/mongoose/lib/helpers/parallelLimit.js new file mode 100644 index 000000000..9b07c028b --- /dev/null +++ b/node_modules/mongoose/lib/helpers/parallelLimit.js @@ -0,0 +1,55 @@ +'use strict'; + +module.exports = parallelLimit; + +/*! + * ignore + */ + +function parallelLimit(fns, limit, callback) { + let numInProgress = 0; + let numFinished = 0; + let error = null; + + if (limit <= 0) { + throw new Error('Limit must be positive'); + } + + if (fns.length === 0) { + return callback(null, []); + } + + for (let i = 0; i < fns.length && i < limit; ++i) { + _start(); + } + + function _start() { + fns[numFinished + numInProgress](_done(numFinished + numInProgress)); + ++numInProgress; + } + + const results = []; + + function _done(index) { + return (err, res) => { + --numInProgress; + ++numFinished; + + if (error != null) { + return; + } + if (err != null) { + error = err; + return callback(error); + } + + results[index] = res; + + if (numFinished === fns.length) { + return callback(null, results); + } else if (numFinished + numInProgress < fns.length) { + _start(); + } + }; + } +} diff --git a/node_modules/mongoose/lib/helpers/path/flattenObjectWithDottedPaths.js b/node_modules/mongoose/lib/helpers/path/flattenObjectWithDottedPaths.js new file mode 100644 index 000000000..72343bfad --- /dev/null +++ b/node_modules/mongoose/lib/helpers/path/flattenObjectWithDottedPaths.js @@ -0,0 +1,38 @@ +'use strict'; + +const MongooseError = require('../../error/mongooseError'); +const setDottedPath = require('../path/setDottedPath'); +const util = require('util'); + +/** + * Given an object that may contain dotted paths, flatten the paths out. + * For example: `flattenObjectWithDottedPaths({ a: { 'b.c': 42 } })` => `{ a: { b: { c: 42 } } }` + */ + +module.exports = function flattenObjectWithDottedPaths(obj) { + if (obj == null || typeof obj !== 'object' || Array.isArray(obj)) { + return; + } + // Avoid Mongoose docs + if (obj.$__) { + return; + } + const keys = Object.keys(obj); + for (const key of keys) { + const val = obj[key]; + if (key.indexOf('.') !== -1) { + try { + delete obj[key]; + setDottedPath(obj, key, val); + } catch (err) { + if (!(err instanceof TypeError)) { + throw err; + } + throw new MongooseError(`Conflicting dotted paths when setting document path, key: "${key}", value: ${util.inspect(val)}`); + } + continue; + } + + flattenObjectWithDottedPaths(obj[key]); + } +}; \ No newline at end of file diff --git a/node_modules/mongoose/lib/helpers/path/parentPaths.js b/node_modules/mongoose/lib/helpers/path/parentPaths.js new file mode 100644 index 000000000..24d1bc519 --- /dev/null +++ b/node_modules/mongoose/lib/helpers/path/parentPaths.js @@ -0,0 +1,18 @@ +'use strict'; + +const dotRE = /\./g; +module.exports = function parentPaths(path) { + if (path.indexOf('.') === -1) { + return [path]; + } + const pieces = path.split(dotRE); + const len = pieces.length; + const ret = new Array(len); + let cur = ''; + for (let i = 0; i < len; ++i) { + cur += (cur.length !== 0) ? '.' + pieces[i] : pieces[i]; + ret[i] = cur; + } + + return ret; +}; \ No newline at end of file diff --git a/node_modules/mongoose/lib/helpers/path/setDottedPath.js b/node_modules/mongoose/lib/helpers/path/setDottedPath.js new file mode 100644 index 000000000..c6544c655 --- /dev/null +++ b/node_modules/mongoose/lib/helpers/path/setDottedPath.js @@ -0,0 +1,33 @@ +'use strict'; + +const specialProperties = require('../specialProperties'); + + +module.exports = function setDottedPath(obj, path, val) { + if (path.indexOf('.') === -1) { + if (specialProperties.has(path)) { + return; + } + + obj[path] = val; + return; + } + const parts = path.split('.'); + + const last = parts.pop(); + let cur = obj; + for (const part of parts) { + if (specialProperties.has(part)) { + continue; + } + if (cur[part] == null) { + cur[part] = {}; + } + + cur = cur[part]; + } + + if (!specialProperties.has(last)) { + cur[last] = val; + } +}; \ No newline at end of file diff --git a/node_modules/mongoose/lib/helpers/pluralize.js b/node_modules/mongoose/lib/helpers/pluralize.js new file mode 100644 index 000000000..c56795017 --- /dev/null +++ b/node_modules/mongoose/lib/helpers/pluralize.js @@ -0,0 +1,94 @@ +'use strict'; + +module.exports = pluralize; + +/** + * Pluralization rules. + */ + +exports.pluralization = [ + [/(m)an$/gi, '$1en'], + [/(pe)rson$/gi, '$1ople'], + [/(child)$/gi, '$1ren'], + [/^(ox)$/gi, '$1en'], + [/(ax|test)is$/gi, '$1es'], + [/(octop|vir)us$/gi, '$1i'], + [/(alias|status)$/gi, '$1es'], + [/(bu)s$/gi, '$1ses'], + [/(buffal|tomat|potat)o$/gi, '$1oes'], + [/([ti])um$/gi, '$1a'], + [/sis$/gi, 'ses'], + [/(?:([^f])fe|([lr])f)$/gi, '$1$2ves'], + [/(hive)$/gi, '$1s'], + [/([^aeiouy]|qu)y$/gi, '$1ies'], + [/(x|ch|ss|sh)$/gi, '$1es'], + [/(matr|vert|ind)ix|ex$/gi, '$1ices'], + [/([m|l])ouse$/gi, '$1ice'], + [/(kn|w|l)ife$/gi, '$1ives'], + [/(quiz)$/gi, '$1zes'], + [/^goose$/i, 'geese'], + [/s$/gi, 's'], + [/([^a-z])$/, '$1'], + [/$/gi, 's'] +]; +const rules = exports.pluralization; + +/** + * Uncountable words. + * + * These words are applied while processing the argument to `toCollectionName`. + * @api public + */ + +exports.uncountables = [ + 'advice', + 'energy', + 'excretion', + 'digestion', + 'cooperation', + 'health', + 'justice', + 'labour', + 'machinery', + 'equipment', + 'information', + 'pollution', + 'sewage', + 'paper', + 'money', + 'species', + 'series', + 'rain', + 'rice', + 'fish', + 'sheep', + 'moose', + 'deer', + 'news', + 'expertise', + 'status', + 'media' +]; +const uncountables = exports.uncountables; + +/*! + * Pluralize function. + * + * @author TJ Holowaychuk (extracted from _ext.js_) + * @param {String} string to pluralize + * @api private + */ + +function pluralize(str) { + let found; + str = str.toLowerCase(); + if (!~uncountables.indexOf(str)) { + found = rules.filter(function(rule) { + return str.match(rule[0]); + }); + if (found[0]) { + return str.replace(found[0][0], found[0][1]); + } + } + return str; +} \ No newline at end of file diff --git a/node_modules/mongoose/lib/helpers/populate/SkipPopulateValue.js b/node_modules/mongoose/lib/helpers/populate/SkipPopulateValue.js new file mode 100644 index 000000000..5d46cfdd8 --- /dev/null +++ b/node_modules/mongoose/lib/helpers/populate/SkipPopulateValue.js @@ -0,0 +1,10 @@ +'use strict'; + +module.exports = function SkipPopulateValue(val) { + if (!(this instanceof SkipPopulateValue)) { + return new SkipPopulateValue(val); + } + + this.val = val; + return this; +}; \ No newline at end of file diff --git a/node_modules/mongoose/lib/helpers/populate/assignRawDocsToIdStructure.js b/node_modules/mongoose/lib/helpers/populate/assignRawDocsToIdStructure.js new file mode 100644 index 000000000..ea79808c1 --- /dev/null +++ b/node_modules/mongoose/lib/helpers/populate/assignRawDocsToIdStructure.js @@ -0,0 +1,109 @@ +'use strict'; + +const leanPopulateMap = require('./leanPopulateMap'); +const modelSymbol = require('../symbols').modelSymbol; +const utils = require('../../utils'); + +module.exports = assignRawDocsToIdStructure; + +/*! + * Assign `vals` returned by mongo query to the `rawIds` + * structure returned from utils.getVals() honoring + * query sort order if specified by user. + * + * This can be optimized. + * + * Rules: + * + * if the value of the path is not an array, use findOne rules, else find. + * for findOne the results are assigned directly to doc path (including null results). + * for find, if user specified sort order, results are assigned directly + * else documents are put back in original order of array if found in results + * + * @param {Array} rawIds + * @param {Array} vals + * @param {Boolean} sort + * @api private + */ + +function assignRawDocsToIdStructure(rawIds, resultDocs, resultOrder, options, recursed) { + // honor user specified sort order + const newOrder = []; + const sorting = options.sort && rawIds.length > 1; + const nullIfNotFound = options.$nullIfNotFound; + let doc; + let sid; + let id; + + if (utils.isMongooseArray(rawIds)) { + rawIds = rawIds.__array; + } + + let i = 0; + const len = rawIds.length; + for (i = 0; i < len; ++i) { + id = rawIds[i]; + + if (Array.isArray(id)) { + // handle [ [id0, id2], [id3] ] + assignRawDocsToIdStructure(id, resultDocs, resultOrder, options, true); + newOrder.push(id); + continue; + } + + if (id === null && !sorting) { + // keep nulls for findOne unless sorting, which always + // removes them (backward compat) + newOrder.push(id); + continue; + } + + sid = String(id); + + doc = resultDocs[sid]; + // If user wants separate copies of same doc, use this option + if (options.clone && doc != null) { + if (options.lean) { + const _model = leanPopulateMap.get(doc); + doc = utils.clone(doc); + leanPopulateMap.set(doc, _model); + } else { + doc = doc.constructor.hydrate(doc._doc); + } + } + + if (recursed) { + if (doc) { + if (sorting) { + const _resultOrder = resultOrder[sid]; + if (Array.isArray(_resultOrder) && Array.isArray(doc) && _resultOrder.length === doc.length) { + newOrder.push(doc); + } else { + newOrder[_resultOrder] = doc; + } + } else { + newOrder.push(doc); + } + } else if (id != null && id[modelSymbol] != null) { + newOrder.push(id); + } else { + newOrder.push(options.retainNullValues || nullIfNotFound ? null : id); + } + } else { + // apply findOne behavior - if document in results, assign, else assign null + newOrder[i] = doc || null; + } + } + + rawIds.length = 0; + if (newOrder.length) { + // reassign the documents based on corrected order + + // forEach skips over sparse entries in arrays so we + // can safely use this to our advantage dealing with sorted + // result sets too. + newOrder.forEach(function(doc, i) { + rawIds[i] = doc; + }); + } +} \ No newline at end of file diff --git a/node_modules/mongoose/lib/helpers/populate/assignVals.js b/node_modules/mongoose/lib/helpers/populate/assignVals.js new file mode 100644 index 000000000..a7b21a3a0 --- /dev/null +++ b/node_modules/mongoose/lib/helpers/populate/assignVals.js @@ -0,0 +1,323 @@ +'use strict'; + +const MongooseMap = require('../../types/map'); +const SkipPopulateValue = require('./SkipPopulateValue'); +const assignRawDocsToIdStructure = require('./assignRawDocsToIdStructure'); +const get = require('../get'); +const getVirtual = require('./getVirtual'); +const leanPopulateMap = require('./leanPopulateMap'); +const lookupLocalFields = require('./lookupLocalFields'); +const markArraySubdocsPopulated = require('./markArraySubdocsPopulated'); +const mpath = require('mpath'); +const sift = require('sift').default; +const utils = require('../../utils'); +const { populateModelSymbol } = require('../symbols'); + +module.exports = function assignVals(o) { + // Options that aren't explicitly listed in `populateOptions` + const userOptions = Object.assign({}, get(o, 'allOptions.options.options'), get(o, 'allOptions.options')); + // `o.options` contains options explicitly listed in `populateOptions`, like + // `match` and `limit`. + const populateOptions = Object.assign({}, o.options, userOptions, { + justOne: o.justOne + }); + populateOptions.$nullIfNotFound = o.isVirtual; + const populatedModel = o.populatedModel; + + const originalIds = [].concat(o.rawIds); + + // replace the original ids in our intermediate _ids structure + // with the documents found by query + o.allIds = [].concat(o.allIds); + assignRawDocsToIdStructure(o.rawIds, o.rawDocs, o.rawOrder, populateOptions); + + // now update the original documents being populated using the + // result structure that contains real documents. + const docs = o.docs; + const rawIds = o.rawIds; + const options = o.options; + const count = o.count && o.isVirtual; + let i; + + function setValue(val) { + if (count) { + return val; + } + if (val instanceof SkipPopulateValue) { + return val.val; + } + if (val === void 0) { + return val; + } + + const _allIds = o.allIds[i]; + + if (o.justOne === true && Array.isArray(val)) { + // Might be an embedded discriminator (re: gh-9244) with multiple models, so make sure to pick the right + // model before assigning. + const ret = []; + for (const doc of val) { + const _docPopulatedModel = leanPopulateMap.get(doc); + if (_docPopulatedModel == null || _docPopulatedModel === populatedModel) { + ret.push(doc); + } + } + // Since we don't want to have to create a new mongoosearray, make sure to + // modify the array in place + while (val.length > ret.length) { + Array.prototype.pop.apply(val, []); + } + for (let i = 0; i < ret.length; ++i) { + val[i] = ret[i]; + } + + return valueFilter(val[0], options, populateOptions, _allIds); + } else if (o.justOne === false && !Array.isArray(val)) { + return valueFilter([val], options, populateOptions, _allIds); + } + return valueFilter(val, options, populateOptions, _allIds); + } + + for (i = 0; i < docs.length; ++i) { + const _path = o.path.endsWith('.$*') ? o.path.slice(0, -3) : o.path; + const existingVal = mpath.get(_path, docs[i], lookupLocalFields); + if (existingVal == null && !getVirtual(o.originalModel.schema, _path)) { + continue; + } + + let valueToSet; + if (count) { + valueToSet = numDocs(rawIds[i]); + } else if (Array.isArray(o.match)) { + valueToSet = Array.isArray(rawIds[i]) ? + rawIds[i].filter(sift(o.match[i])) : + [rawIds[i]].filter(sift(o.match[i]))[0]; + } else { + valueToSet = rawIds[i]; + } + + // If we're populating a map, the existing value will be an object, so + // we need to transform again + const originalSchema = o.originalModel.schema; + const isDoc = get(docs[i], '$__', null) != null; + let isMap = isDoc ? + existingVal instanceof Map : + utils.isPOJO(existingVal); + // If we pass the first check, also make sure the local field's schematype + // is map (re: gh-6460) + isMap = isMap && get(originalSchema._getSchema(_path), '$isSchemaMap'); + if (!o.isVirtual && isMap) { + const _keys = existingVal instanceof Map ? + Array.from(existingVal.keys()) : + Object.keys(existingVal); + valueToSet = valueToSet.reduce((cur, v, i) => { + cur.set(_keys[i], v); + return cur; + }, new Map()); + } + + if (isDoc && Array.isArray(valueToSet)) { + for (const val of valueToSet) { + if (val != null && val.$__ != null) { + val.$__.parent = docs[i]; + } + } + } else if (isDoc && valueToSet != null && valueToSet.$__ != null) { + valueToSet.$__.parent = docs[i]; + } + + if (o.isVirtual && isDoc) { + docs[i].$populated(_path, o.justOne ? originalIds[0] : originalIds, o.allOptions); + // If virtual populate and doc is already init-ed, need to walk through + // the actual doc to set rather than setting `_doc` directly + if (Array.isArray(valueToSet)) { + valueToSet = valueToSet.map(v => v == null ? void 0 : v); + } + mpath.set(_path, valueToSet, docs[i], void 0, setValue, false); + continue; + } + + const parts = _path.split('.'); + let cur = docs[i]; + const curPath = parts[0]; + for (let j = 0; j < parts.length - 1; ++j) { + // If we get to an array with a dotted path, like `arr.foo`, don't set + // `foo` on the array. + if (Array.isArray(cur) && !utils.isArrayIndex(parts[j])) { + break; + } + + if (parts[j] === '$*') { + break; + } + + if (cur[parts[j]] == null) { + // If nothing to set, avoid creating an unnecessary array. Otherwise + // we'll end up with a single doc in the array with only defaults. + // See gh-8342, gh-8455 + const schematype = originalSchema._getSchema(curPath); + if (valueToSet == null && schematype != null && schematype.$isMongooseArray) { + break; + } + cur[parts[j]] = {}; + } + cur = cur[parts[j]]; + // If the property in MongoDB is a primitive, we won't be able to populate + // the nested path, so skip it. See gh-7545 + if (typeof cur !== 'object') { + break; + } + } + if (docs[i].$__) { + o.allOptions.options[populateModelSymbol] = o.allOptions.model; + docs[i].$populated(_path, o.unpopulatedValues[i], o.allOptions.options); + + if (valueToSet != null && valueToSet.$__ != null) { + valueToSet.$__.wasPopulated = { value: o.unpopulatedValues[i] }; + } + + if (valueToSet instanceof Map && !valueToSet.$isMongooseMap) { + valueToSet = new MongooseMap(valueToSet, _path, docs[i], docs[i].schema.path(_path).$__schemaType); + } + } + + // If lean, need to check that each individual virtual respects + // `justOne`, because you may have a populated virtual with `justOne` + // underneath an array. See gh-6867 + mpath.set(_path, valueToSet, docs[i], lookupLocalFields, setValue, false); + + if (docs[i].$__) { + markArraySubdocsPopulated(docs[i], [o.allOptions.options]); + } + } +}; + +function numDocs(v) { + if (Array.isArray(v)) { + // If setting underneath an array of populated subdocs, we may have an + // array of arrays. See gh-7573 + if (v.some(el => Array.isArray(el) || el === null)) { + return v.map(el => { + if (el == null) { + return 0; + } + if (Array.isArray(el)) { + return el.filter(el => el != null).length; + } + return 1; + }); + } + return v.filter(el => el != null).length; + } + return v == null ? 0 : 1; +} + +/*! + * 1) Apply backwards compatible find/findOne behavior to sub documents + * + * find logic: + * a) filter out non-documents + * b) remove _id from sub docs when user specified + * + * findOne + * a) if no doc found, set to null + * b) remove _id from sub docs when user specified + * + * 2) Remove _ids when specified by users query. + * + * background: + * _ids are left in the query even when user excludes them so + * that population mapping can occur. + */ + +function valueFilter(val, assignmentOpts, populateOptions, allIds) { + const userSpecifiedTransform = typeof populateOptions.transform === 'function'; + const transform = userSpecifiedTransform ? populateOptions.transform : noop; + if (Array.isArray(val)) { + // find logic + const ret = []; + const numValues = val.length; + for (let i = 0; i < numValues; ++i) { + let subdoc = val[i]; + const _allIds = Array.isArray(allIds) ? allIds[i] : allIds; + if (!isPopulatedObject(subdoc) && (!populateOptions.retainNullValues || subdoc != null) && !userSpecifiedTransform) { + continue; + } else if (userSpecifiedTransform) { + subdoc = transform(isPopulatedObject(subdoc) ? subdoc : null, _allIds); + } + maybeRemoveId(subdoc, assignmentOpts); + ret.push(subdoc); + if (assignmentOpts.originalLimit && + ret.length >= assignmentOpts.originalLimit) { + break; + } + } + + const rLen = ret.length; + // Since we don't want to have to create a new mongoosearray, make sure to + // modify the array in place + while (val.length > rLen) { + Array.prototype.pop.apply(val, []); + } + let i = 0; + if (utils.isMongooseArray(val)) { + for (i = 0; i < rLen; ++i) { + val.set(i, ret[i], true); + } + } else { + for (i = 0; i < rLen; ++i) { + val[i] = ret[i]; + } + } + return val; + } + + // findOne + if (isPopulatedObject(val) || utils.isPOJO(val)) { + maybeRemoveId(val, assignmentOpts); + return transform(val, allIds); + } + if (val instanceof Map) { + return val; + } + + if (populateOptions.justOne === false) { + return []; + } + + return val == null ? transform(val, allIds) : transform(null, allIds); +} + +/*! + * Remove _id from `subdoc` if user specified "lean" query option + */ + +function maybeRemoveId(subdoc, assignmentOpts) { + if (subdoc != null && assignmentOpts.excludeId) { + if (typeof subdoc.$__setValue === 'function') { + delete subdoc._doc._id; + } else { + delete subdoc._id; + } + } +} + +/*! + * Determine if `obj` is something we can set a populated path to. Can be a + * document, a lean document, or an array/map that contains docs. + */ + +function isPopulatedObject(obj) { + if (obj == null) { + return false; + } + + return Array.isArray(obj) || + obj.$isMongooseMap || + obj.$__ != null || + leanPopulateMap.has(obj); +} + +function noop(v) { + return v; +} \ No newline at end of file diff --git a/node_modules/mongoose/lib/helpers/populate/createPopulateQueryFilter.js b/node_modules/mongoose/lib/helpers/populate/createPopulateQueryFilter.js new file mode 100644 index 000000000..1f133b7d1 --- /dev/null +++ b/node_modules/mongoose/lib/helpers/populate/createPopulateQueryFilter.js @@ -0,0 +1,80 @@ +'use strict'; + +const SkipPopulateValue = require('./SkipPopulateValue'); +const parentPaths = require('../path/parentPaths'); +const { trusted } = require('../query/trusted'); + +module.exports = function createPopulateQueryFilter(ids, _match, _foreignField, model, skipInvalidIds) { + const match = _formatMatch(_match); + + if (_foreignField.size === 1) { + const foreignField = Array.from(_foreignField)[0]; + const foreignSchemaType = model.schema.path(foreignField); + if (foreignField !== '_id' || !match['_id']) { + ids = _filterInvalidIds(ids, foreignSchemaType, skipInvalidIds); + match[foreignField] = trusted({ $in: ids }); + } + + const _parentPaths = parentPaths(foreignField); + for (let i = 0; i < _parentPaths.length - 1; ++i) { + const cur = _parentPaths[i]; + if (match[cur] != null && match[cur].$elemMatch != null) { + match[cur].$elemMatch[foreignField.slice(cur.length + 1)] = trusted({ $in: ids }); + delete match[foreignField]; + break; + } + } + } else { + const $or = []; + if (Array.isArray(match.$or)) { + match.$and = [{ $or: match.$or }, { $or: $or }]; + delete match.$or; + } else { + match.$or = $or; + } + for (const foreignField of _foreignField) { + if (foreignField !== '_id' || !match['_id']) { + const foreignSchemaType = model.schema.path(foreignField); + ids = _filterInvalidIds(ids, foreignSchemaType, skipInvalidIds); + $or.push({ [foreignField]: { $in: ids } }); + } + } + } + + return match; +}; + +/*! + * Optionally filter out invalid ids that don't conform to foreign field's schema + * to avoid cast errors (gh-7706) + */ + +function _filterInvalidIds(ids, foreignSchemaType, skipInvalidIds) { + ids = ids.filter(v => !(v instanceof SkipPopulateValue)); + if (!skipInvalidIds) { + return ids; + } + return ids.filter(id => { + try { + foreignSchemaType.cast(id); + return true; + } catch (err) { + return false; + } + }); +} + +/*! + * Format `mod.match` given that it may be an array that we need to $or if + * the client has multiple docs with match functions + */ + +function _formatMatch(match) { + if (Array.isArray(match)) { + if (match.length > 1) { + return { $or: [].concat(match.map(m => Object.assign({}, m))) }; + } + return Object.assign({}, match[0]); + } + return Object.assign({}, match); +} \ No newline at end of file diff --git a/node_modules/mongoose/lib/helpers/populate/getModelsMapForPopulate.js b/node_modules/mongoose/lib/helpers/populate/getModelsMapForPopulate.js new file mode 100644 index 000000000..620ac254e --- /dev/null +++ b/node_modules/mongoose/lib/helpers/populate/getModelsMapForPopulate.js @@ -0,0 +1,729 @@ +'use strict'; + +const MongooseError = require('../../error/index'); +const SkipPopulateValue = require('./SkipPopulateValue'); +const get = require('../get'); +const getDiscriminatorByValue = require('../discriminator/getDiscriminatorByValue'); +const getConstructorName = require('../getConstructorName'); +const getSchemaTypes = require('./getSchemaTypes'); +const getVirtual = require('./getVirtual'); +const lookupLocalFields = require('./lookupLocalFields'); +const mpath = require('mpath'); +const modelNamesFromRefPath = require('./modelNamesFromRefPath'); +const utils = require('../../utils'); + +const modelSymbol = require('../symbols').modelSymbol; +const populateModelSymbol = require('../symbols').populateModelSymbol; +const schemaMixedSymbol = require('../../schema/symbols').schemaMixedSymbol; + +module.exports = function getModelsMapForPopulate(model, docs, options) { + let doc; + const len = docs.length; + const map = []; + const modelNameFromQuery = options.model && options.model.modelName || options.model; + let schema; + let refPath; + let modelNames; + const available = {}; + + const modelSchema = model.schema; + + // Populating a nested path should always be a no-op re: #9073. + // People shouldn't do this, but apparently they do. + if (options._localModel != null && options._localModel.schema.nested[options.path]) { + return []; + } + + const _virtualRes = getVirtual(model.schema, options.path); + const virtual = _virtualRes == null ? null : _virtualRes.virtual; + if (virtual != null) { + return _virtualPopulate(model, docs, options, _virtualRes); + } + + let allSchemaTypes = getSchemaTypes(model, modelSchema, null, options.path); + allSchemaTypes = Array.isArray(allSchemaTypes) ? allSchemaTypes : [allSchemaTypes].filter(v => v != null); + + if (allSchemaTypes.length === 0 && options.strictPopulate !== false && options._localModel != null) { + return new MongooseError('Cannot populate path `' + (options._fullPath || options.path) + + '` because it is not in your schema. Set the `strictPopulate` option ' + + 'to false to override.'); + } + + for (let i = 0; i < len; i++) { + doc = docs[i]; + let justOne = null; + + const docSchema = doc != null && doc.$__ != null ? doc.$__schema : modelSchema; + schema = getSchemaTypes(model, docSchema, doc, options.path); + + // Special case: populating a path that's a DocumentArray unless + // there's an explicit `ref` or `refPath` re: gh-8946 + if (schema != null && + schema.$isMongooseDocumentArray && + schema.options.ref == null && + schema.options.refPath == null) { + continue; + } + const isUnderneathDocArray = schema && schema.$isUnderneathDocArray; + if (isUnderneathDocArray && get(options, 'options.sort') != null) { + return new MongooseError('Cannot populate with `sort` on path ' + options.path + + ' because it is a subproperty of a document array'); + } + + modelNames = null; + let isRefPath = false; + let normalizedRefPath = null; + let schemaOptions = null; + let modelNamesInOrder = null; + + if (schema != null && schema.instance === 'Embedded') { + if (schema.options.ref) { + const data = { + localField: options.path + '._id', + foreignField: '_id', + justOne: true + }; + const res = _getModelNames(doc, schema, modelNameFromQuery, model); + + const unpopulatedValue = mpath.get(options.path, doc); + const id = mpath.get('_id', unpopulatedValue); + addModelNamesToMap(model, map, available, res.modelNames, options, data, id, doc, schemaOptions, unpopulatedValue); + } + // No-op if no `ref` set. See gh-11538 + continue; + } + + if (Array.isArray(schema)) { + const schemasArray = schema; + for (const _schema of schemasArray) { + let _modelNames; + let res; + try { + res = _getModelNames(doc, _schema, modelNameFromQuery, model); + _modelNames = res.modelNames; + isRefPath = isRefPath || res.isRefPath; + normalizedRefPath = normalizedRefPath || res.refPath; + justOne = res.justOne; + } catch (error) { + return error; + } + + if (isRefPath && !res.isRefPath) { + continue; + } + if (!_modelNames) { + continue; + } + modelNames = modelNames || []; + for (const modelName of _modelNames) { + if (modelNames.indexOf(modelName) === -1) { + modelNames.push(modelName); + } + } + } + } else { + try { + const res = _getModelNames(doc, schema, modelNameFromQuery, model); + modelNames = res.modelNames; + isRefPath = res.isRefPath; + normalizedRefPath = normalizedRefPath || res.refPath; + justOne = res.justOne; + schemaOptions = get(schema, 'options.populate', null); + // Dedupe, because `refPath` can return duplicates of the same model name, + // and that causes perf issues. + if (isRefPath) { + modelNamesInOrder = modelNames; + modelNames = Array.from(new Set(modelNames)); + } + } catch (error) { + return error; + } + + if (!modelNames) { + continue; + } + } + + const data = {}; + const localField = options.path; + const foreignField = '_id'; + + // `justOne = null` means we don't know from the schema whether the end + // result should be an array or a single doc. This can result from + // populating a POJO using `Model.populate()` + if ('justOne' in options && options.justOne !== void 0) { + justOne = options.justOne; + } else if (schema && !schema[schemaMixedSymbol]) { + // Skip Mixed types because we explicitly don't do casting on those. + if (options.path.endsWith('.' + schema.path) || options.path === schema.path) { + justOne = Array.isArray(schema) ? + schema.every(schema => !schema.$isMongooseArray) : + !schema.$isMongooseArray; + } + } + + if (!modelNames) { + continue; + } + + data.isVirtual = false; + data.justOne = justOne; + data.localField = localField; + data.foreignField = foreignField; + + // Get local fields + const ret = _getLocalFieldValues(doc, localField, model, options, null, schema); + + const id = String(utils.getValue(foreignField, doc)); + options._docs[id] = Array.isArray(ret) ? ret.slice() : ret; + + let match = get(options, 'match', null); + + const hasMatchFunction = typeof match === 'function'; + if (hasMatchFunction) { + match = match.call(doc, doc); + } + data.match = match; + data.hasMatchFunction = hasMatchFunction; + data.isRefPath = isRefPath; + data.modelNamesInOrder = modelNamesInOrder; + + if (isRefPath) { + const embeddedDiscriminatorModelNames = _findRefPathForDiscriminators(doc, + modelSchema, data, options, normalizedRefPath, ret); + + modelNames = embeddedDiscriminatorModelNames || modelNames; + } + + try { + addModelNamesToMap(model, map, available, modelNames, options, data, ret, doc, schemaOptions); + } catch (err) { + return err; + } + } + return map; + + function _getModelNames(doc, schema, modelNameFromQuery, model) { + let modelNames; + let isRefPath = false; + let justOne = null; + + if (schema && schema.instance === 'Array') { + schema = schema.caster; + } + if (schema && schema.$isSchemaMap) { + schema = schema.$__schemaType; + } + + const ref = schema && schema.options && schema.options.ref; + refPath = schema && schema.options && schema.options.refPath; + if (schema != null && + schema[schemaMixedSymbol] && + !ref && + !refPath && + !modelNameFromQuery) { + return { modelNames: null }; + } + + if (modelNameFromQuery) { + modelNames = [modelNameFromQuery]; // query options + } else if (refPath != null) { + if (typeof refPath === 'function') { + const subdocPath = options.path.slice(0, options.path.length - schema.path.length - 1); + const vals = mpath.get(subdocPath, doc, lookupLocalFields); + const subdocsBeingPopulated = Array.isArray(vals) ? + utils.array.flatten(vals) : + (vals ? [vals] : []); + + modelNames = new Set(); + for (const subdoc of subdocsBeingPopulated) { + refPath = refPath.call(subdoc, subdoc, options.path); + modelNamesFromRefPath(refPath, doc, options.path, modelSchema, options._queryProjection). + forEach(name => modelNames.add(name)); + } + modelNames = Array.from(modelNames); + } else { + modelNames = modelNamesFromRefPath(refPath, doc, options.path, modelSchema, options._queryProjection); + } + + isRefPath = true; + } else { + let ref; + let refPath; + let schemaForCurrentDoc; + let discriminatorValue; + let modelForCurrentDoc = model; + const discriminatorKey = model.schema.options.discriminatorKey; + + if (!schema && discriminatorKey && (discriminatorValue = utils.getValue(discriminatorKey, doc))) { + // `modelNameForFind` is the discriminator value, so we might need + // find the discriminated model name + const discriminatorModel = getDiscriminatorByValue(model.discriminators, discriminatorValue) || model; + if (discriminatorModel != null) { + modelForCurrentDoc = discriminatorModel; + } else { + try { + modelForCurrentDoc = _getModelFromConn(model.db, discriminatorValue); + } catch (error) { + return error; + } + } + + schemaForCurrentDoc = modelForCurrentDoc.schema._getSchema(options.path); + + if (schemaForCurrentDoc && schemaForCurrentDoc.caster) { + schemaForCurrentDoc = schemaForCurrentDoc.caster; + } + } else { + schemaForCurrentDoc = schema; + } + + if (schemaForCurrentDoc != null) { + justOne = !schemaForCurrentDoc.$isMongooseArray && !schemaForCurrentDoc._arrayPath; + } + + if ((ref = get(schemaForCurrentDoc, 'options.ref')) != null) { + if (schemaForCurrentDoc != null && + typeof ref === 'function' && + options.path.endsWith('.' + schemaForCurrentDoc.path)) { + // Ensure correct context for ref functions: subdoc, not top-level doc. See gh-8469 + modelNames = new Set(); + + const subdocPath = options.path.slice(0, options.path.length - schemaForCurrentDoc.path.length - 1); + const vals = mpath.get(subdocPath, doc, lookupLocalFields); + const subdocsBeingPopulated = Array.isArray(vals) ? + utils.array.flatten(vals) : + (vals ? [vals] : []); + for (const subdoc of subdocsBeingPopulated) { + modelNames.add(handleRefFunction(ref, subdoc)); + } + + if (subdocsBeingPopulated.length === 0) { + modelNames = [handleRefFunction(ref, doc)]; + } else { + modelNames = Array.from(modelNames); + } + } else { + ref = handleRefFunction(ref, doc); + modelNames = [ref]; + } + } else if ((schemaForCurrentDoc = get(schema, 'options.refPath')) != null) { + isRefPath = true; + if (typeof refPath === 'function') { + const subdocPath = options.path.slice(0, options.path.length - schemaForCurrentDoc.path.length - 1); + const vals = mpath.get(subdocPath, doc, lookupLocalFields); + const subdocsBeingPopulated = Array.isArray(vals) ? + utils.array.flatten(vals) : + (vals ? [vals] : []); + + modelNames = new Set(); + for (const subdoc of subdocsBeingPopulated) { + refPath = refPath.call(subdoc, subdoc, options.path); + modelNamesFromRefPath(refPath, doc, options.path, modelSchema, options._queryProjection). + forEach(name => modelNames.add(name)); + } + modelNames = Array.from(modelNames); + } else { + modelNames = modelNamesFromRefPath(refPath, doc, options.path, modelSchema, options._queryProjection); + } + } + } + + if (!modelNames) { + // `Model.populate()` on a POJO with no known local model. Default to using the `Model` + if (options._localModel == null) { + modelNames = [model.modelName]; + } else { + return { modelNames: modelNames, justOne: justOne, isRefPath: isRefPath, refPath: refPath }; + } + } + + if (!Array.isArray(modelNames)) { + modelNames = [modelNames]; + } + + return { modelNames: modelNames, justOne: justOne, isRefPath: isRefPath, refPath: refPath }; + } +}; + +/*! + * ignore + */ + +function _virtualPopulate(model, docs, options, _virtualRes) { + const map = []; + const available = {}; + const virtual = _virtualRes.virtual; + + for (const doc of docs) { + let modelNames = null; + const data = {}; + + // localField and foreignField + let localField; + const virtualPrefix = _virtualRes.nestedSchemaPath ? + _virtualRes.nestedSchemaPath + '.' : ''; + if (typeof virtual.options.localField === 'function') { + localField = virtualPrefix + virtual.options.localField.call(doc, doc); + } else if (Array.isArray(virtual.options.localField)) { + localField = virtual.options.localField.map(field => virtualPrefix + field); + } else { + localField = virtualPrefix + virtual.options.localField; + } + data.count = virtual.options.count; + + if (virtual.options.skip != null && !options.hasOwnProperty('skip')) { + options.skip = virtual.options.skip; + } + if (virtual.options.limit != null && !options.hasOwnProperty('limit')) { + options.limit = virtual.options.limit; + } + if (virtual.options.perDocumentLimit != null && !options.hasOwnProperty('perDocumentLimit')) { + options.perDocumentLimit = virtual.options.perDocumentLimit; + } + let foreignField = virtual.options.foreignField; + + if (!localField || !foreignField) { + return new MongooseError('If you are populating a virtual, you must set the ' + + 'localField and foreignField options'); + } + + if (typeof localField === 'function') { + localField = localField.call(doc, doc); + } + if (typeof foreignField === 'function') { + foreignField = foreignField.call(doc, doc); + } + + data.isRefPath = false; + + // `justOne = null` means we don't know from the schema whether the end + // result should be an array or a single doc. This can result from + // populating a POJO using `Model.populate()` + let justOne = null; + if ('justOne' in options && options.justOne !== void 0) { + justOne = options.justOne; + } + + if (virtual.options.refPath) { + modelNames = + modelNamesFromRefPath(virtual.options.refPath, doc, options.path); + justOne = !!virtual.options.justOne; + data.isRefPath = true; + } else if (virtual.options.ref) { + let normalizedRef; + if (typeof virtual.options.ref === 'function' && !virtual.options.ref[modelSymbol]) { + normalizedRef = virtual.options.ref.call(doc, doc); + } else { + normalizedRef = virtual.options.ref; + } + justOne = !!virtual.options.justOne; + // When referencing nested arrays, the ref should be an Array + // of modelNames. + if (Array.isArray(normalizedRef)) { + modelNames = normalizedRef; + } else { + modelNames = [normalizedRef]; + } + } + + data.isVirtual = true; + data.virtual = virtual; + data.justOne = justOne; + + // `match` + let match = get(options, 'match', null) || + get(data, 'virtual.options.match', null) || + get(data, 'virtual.options.options.match', null); + + let hasMatchFunction = typeof match === 'function'; + if (hasMatchFunction) { + match = match.call(doc, doc); + } + + if (Array.isArray(localField) && Array.isArray(foreignField) && localField.length === foreignField.length) { + match = Object.assign({}, match); + for (let i = 1; i < localField.length; ++i) { + match[foreignField[i]] = convertTo_id(mpath.get(localField[i], doc, lookupLocalFields), model.schema); + hasMatchFunction = true; + } + + localField = localField[0]; + foreignField = foreignField[0]; + } + + data.localField = localField; + data.foreignField = foreignField; + data.match = match; + data.hasMatchFunction = hasMatchFunction; + + // Get local fields + const ret = _getLocalFieldValues(doc, localField, model, options, virtual); + + try { + addModelNamesToMap(model, map, available, modelNames, options, data, ret, doc); + } catch (err) { + return err; + } + } + + return map; +} + +/*! + * ignore + */ + +function addModelNamesToMap(model, map, available, modelNames, options, data, ret, doc, schemaOptions, unpopulatedValue) { + // `PopulateOptions#connection`: if the model is passed as a string, the + // connection matters because different connections have different models. + const connection = options.connection != null ? options.connection : model.db; + + unpopulatedValue = unpopulatedValue === void 0 ? ret : unpopulatedValue; + if (Array.isArray(unpopulatedValue)) { + unpopulatedValue = utils.cloneArrays(unpopulatedValue); + } + + if (modelNames == null) { + return; + } + + let k = modelNames.length; + while (k--) { + const modelName = modelNames[k]; + if (modelName == null) { + continue; + } + + let Model; + if (options.model && options.model[modelSymbol]) { + Model = options.model; + } else if (modelName[modelSymbol]) { + Model = modelName; + } else { + try { + Model = _getModelFromConn(connection, modelName); + } catch (err) { + if (ret !== void 0) { + throw err; + } + Model = null; + } + } + + let ids = ret; + const flat = Array.isArray(ret) ? utils.array.flatten(ret) : []; + + const modelNamesForRefPath = data.modelNamesInOrder ? data.modelNamesInOrder : modelNames; + if (data.isRefPath && Array.isArray(ret) && flat.length === modelNamesForRefPath.length) { + ids = flat.filter((val, i) => modelNamesForRefPath[i] === modelName); + } + + const perDocumentLimit = options.perDocumentLimit == null ? + get(options, 'options.perDocumentLimit', null) : + options.perDocumentLimit; + + if (!available[modelName] || perDocumentLimit != null) { + const currentOptions = { + model: Model + }; + + if (data.isVirtual && get(data.virtual, 'options.options')) { + currentOptions.options = utils.clone(data.virtual.options.options); + } else if (schemaOptions != null) { + currentOptions.options = Object.assign({}, schemaOptions); + } + utils.merge(currentOptions, options); + + // Used internally for checking what model was used to populate this + // path. + options[populateModelSymbol] = Model; + + available[modelName] = { + model: Model, + options: currentOptions, + match: data.hasMatchFunction ? [data.match] : data.match, + docs: [doc], + ids: [ids], + allIds: [ret], + unpopulatedValues: [unpopulatedValue], + localField: new Set([data.localField]), + foreignField: new Set([data.foreignField]), + justOne: data.justOne, + isVirtual: data.isVirtual, + virtual: data.virtual, + count: data.count, + [populateModelSymbol]: Model + }; + map.push(available[modelName]); + } else { + available[modelName].localField.add(data.localField); + available[modelName].foreignField.add(data.foreignField); + available[modelName].docs.push(doc); + available[modelName].ids.push(ids); + available[modelName].allIds.push(ret); + available[modelName].unpopulatedValues.push(unpopulatedValue); + if (data.hasMatchFunction) { + available[modelName].match.push(data.match); + } + } + } +} + +function _getModelFromConn(conn, modelName) { + /* If this connection has a parent from `useDb()`, bubble up to parent's models */ + if (conn.models[modelName] == null && conn._parent != null) { + return _getModelFromConn(conn._parent, modelName); + } + + return conn.model(modelName); +} + +/*! + * ignore + */ + +function handleRefFunction(ref, doc) { + if (typeof ref === 'function' && !ref[modelSymbol]) { + return ref.call(doc, doc); + } + return ref; +} + +/*! + * ignore + */ + +function _getLocalFieldValues(doc, localField, model, options, virtual, schema) { + // Get Local fields + const localFieldPathType = model.schema._getPathType(localField); + const localFieldPath = localFieldPathType === 'real' ? + model.schema.path(localField) : + localFieldPathType.schema; + const localFieldGetters = localFieldPath && localFieldPath.getters ? + localFieldPath.getters : []; + + localField = localFieldPath != null && localFieldPath.instance === 'Embedded' ? localField + '._id' : localField; + + const _populateOptions = get(options, 'options', {}); + + const getters = 'getters' in _populateOptions ? + _populateOptions.getters : + get(virtual, 'options.getters', false); + if (localFieldGetters.length !== 0 && getters) { + const hydratedDoc = (doc.$__ != null) ? doc : model.hydrate(doc); + const localFieldValue = utils.getValue(localField, doc); + if (Array.isArray(localFieldValue)) { + const localFieldHydratedValue = utils.getValue(localField.split('.').slice(0, -1), hydratedDoc); + return localFieldValue.map((localFieldArrVal, localFieldArrIndex) => + localFieldPath.applyGetters(localFieldArrVal, localFieldHydratedValue[localFieldArrIndex])); + } else { + return localFieldPath.applyGetters(localFieldValue, hydratedDoc); + } + } else { + return convertTo_id(mpath.get(localField, doc, lookupLocalFields), schema); + } +} + +/*! + * Retrieve the _id of `val` if a Document or Array of Documents. + * + * @param {Array|Document|Any} val + * @return {Array|Document|Any} + */ + +function convertTo_id(val, schema) { + if (val != null && val.$__ != null) { + return val._id; + } + if (val != null && val._id != null && (schema == null || !schema.$isSchemaMap)) { + return val._id; + } + + if (Array.isArray(val)) { + const rawVal = val.__array != null ? val.__array : val; + for (let i = 0; i < rawVal.length; ++i) { + if (rawVal[i] != null && rawVal[i].$__ != null) { + rawVal[i] = rawVal[i]._id; + } + } + if (utils.isMongooseArray(val) && val.$schema()) { + return val.$schema()._castForPopulate(val, val.$parent()); + } + + return [].concat(val); + } + + // `populate('map')` may be an object if populating on a doc that hasn't + // been hydrated yet + if (getConstructorName(val) === 'Object' && + // The intent here is we should only flatten the object if we expect + // to get a Map in the end. Avoid doing this for mixed types. + (schema == null || schema[schemaMixedSymbol] == null)) { + const ret = []; + for (const key of Object.keys(val)) { + ret.push(val[key]); + } + return ret; + } + // If doc has already been hydrated, e.g. `doc.populate('map')` + // then `val` will already be a map + if (val instanceof Map) { + return Array.from(val.values()); + } + + return val; +} + +/*! + * ignore + */ + +function _findRefPathForDiscriminators(doc, modelSchema, data, options, normalizedRefPath, ret) { + // Re: gh-8452. Embedded discriminators may not have `refPath`, so clear + // out embedded discriminator docs that don't have a `refPath` on the + // populated path. + if (!data.isRefPath || normalizedRefPath == null) { + return; + } + + const pieces = normalizedRefPath.split('.'); + let cur = ''; + let modelNames = void 0; + for (let i = 0; i < pieces.length; ++i) { + const piece = pieces[i]; + cur = cur + (cur.length === 0 ? '' : '.') + piece; + const schematype = modelSchema.path(cur); + if (schematype != null && + schematype.$isMongooseArray && + schematype.caster.discriminators != null && + Object.keys(schematype.caster.discriminators).length !== 0) { + const subdocs = utils.getValue(cur, doc); + const remnant = options.path.substring(cur.length + 1); + const discriminatorKey = schematype.caster.schema.options.discriminatorKey; + modelNames = []; + for (const subdoc of subdocs) { + const discriminatorName = utils.getValue(discriminatorKey, subdoc); + const discriminator = schematype.caster.discriminators[discriminatorName]; + const discriminatorSchema = discriminator && discriminator.schema; + if (discriminatorSchema == null) { + continue; + } + const _path = discriminatorSchema.path(remnant); + if (_path == null || _path.options.refPath == null) { + const docValue = utils.getValue(data.localField.substring(cur.length + 1), subdoc); + ret.forEach((v, i) => { + if (v === docValue) { + ret[i] = SkipPopulateValue(v); + } + }); + continue; + } + const modelName = utils.getValue(pieces.slice(i + 1).join('.'), subdoc); + modelNames.push(modelName); + } + } + } + + return modelNames; +} \ No newline at end of file diff --git a/node_modules/mongoose/lib/helpers/populate/getSchemaTypes.js b/node_modules/mongoose/lib/helpers/populate/getSchemaTypes.js new file mode 100644 index 000000000..76c428653 --- /dev/null +++ b/node_modules/mongoose/lib/helpers/populate/getSchemaTypes.js @@ -0,0 +1,229 @@ +'use strict'; + +/*! + * ignore + */ + +const Mixed = require('../../schema/mixed'); +const get = require('../get'); +const getDiscriminatorByValue = require('../discriminator/getDiscriminatorByValue'); +const leanPopulateMap = require('./leanPopulateMap'); +const mpath = require('mpath'); + +const populateModelSymbol = require('../symbols').populateModelSymbol; + +/*! + * Given a model and its schema, find all possible schema types for `path`, + * including searching through discriminators. If `doc` is specified, will + * use the doc's values for discriminator keys when searching, otherwise + * will search all discriminators. + * + * @param {Schema} schema + * @param {Object} doc POJO + * @param {string} path + */ + +module.exports = function getSchemaTypes(model, schema, doc, path) { + const pathschema = schema.path(path); + const topLevelDoc = doc; + if (pathschema) { + return pathschema; + } + + const discriminatorKey = schema.discriminatorMapping && + schema.discriminatorMapping.key; + if (discriminatorKey && model != null) { + if (doc != null && doc[discriminatorKey] != null) { + const discriminator = getDiscriminatorByValue(model.discriminators, doc[discriminatorKey]); + schema = discriminator ? discriminator.schema : schema; + } else if (model.discriminators != null) { + return Object.keys(model.discriminators).reduce((arr, name) => { + const disc = model.discriminators[name]; + return arr.concat(getSchemaTypes(disc, disc.schema, null, path)); + }, []); + } + } + + function search(parts, schema, subdoc, nestedPath) { + let p = parts.length + 1; + let foundschema; + let trypath; + + while (p--) { + trypath = parts.slice(0, p).join('.'); + foundschema = schema.path(trypath); + if (foundschema == null) { + continue; + } + + if (foundschema.caster) { + // array of Mixed? + if (foundschema.caster instanceof Mixed) { + return foundschema.caster; + } + + let schemas = null; + if (foundschema.schema != null && foundschema.schema.discriminators != null) { + const discriminators = foundschema.schema.discriminators; + const discriminatorKeyPath = trypath + '.' + + foundschema.schema.options.discriminatorKey; + const keys = subdoc ? mpath.get(discriminatorKeyPath, subdoc) || [] : []; + schemas = Object.keys(discriminators). + reduce(function(cur, discriminator) { + const tiedValue = discriminators[discriminator].discriminatorMapping.value; + if (doc == null || keys.indexOf(discriminator) !== -1 || keys.indexOf(tiedValue) !== -1) { + cur.push(discriminators[discriminator]); + } + return cur; + }, []); + } + + // Now that we found the array, we need to check if there + // are remaining document paths to look up for casting. + // Also we need to handle array.$.path since schema.path + // doesn't work for that. + // If there is no foundschema.schema we are dealing with + // a path like array.$ + if (p !== parts.length && foundschema.schema) { + let ret; + if (parts[p] === '$') { + if (p + 1 === parts.length) { + // comments.$ + return foundschema; + } + // comments.$.comments.$.title + ret = search( + parts.slice(p + 1), + schema, + subdoc ? mpath.get(trypath, subdoc) : null, + nestedPath.concat(parts.slice(0, p)) + ); + if (ret) { + ret.$isUnderneathDocArray = ret.$isUnderneathDocArray || + !foundschema.schema.$isSingleNested; + } + return ret; + } + + if (schemas != null && schemas.length > 0) { + ret = []; + for (const schema of schemas) { + const _ret = search( + parts.slice(p), + schema, + subdoc ? mpath.get(trypath, subdoc) : null, + nestedPath.concat(parts.slice(0, p)) + ); + if (_ret != null) { + _ret.$isUnderneathDocArray = _ret.$isUnderneathDocArray || + !foundschema.schema.$isSingleNested; + if (_ret.$isUnderneathDocArray) { + ret.$isUnderneathDocArray = true; + } + ret.push(_ret); + } + } + return ret; + } else { + ret = search( + parts.slice(p), + foundschema.schema, + subdoc ? mpath.get(trypath, subdoc) : null, + nestedPath.concat(parts.slice(0, p)) + ); + + if (ret) { + ret.$isUnderneathDocArray = ret.$isUnderneathDocArray || + !foundschema.schema.$isSingleNested; + } + return ret; + } + } else if (p !== parts.length && + foundschema.$isMongooseArray && + foundschema.casterConstructor.$isMongooseArray) { + // Nested arrays. Drill down to the bottom of the nested array. + let type = foundschema; + while (type.$isMongooseArray && !type.$isMongooseDocumentArray) { + type = type.casterConstructor; + } + + const ret = search( + parts.slice(p), + type.schema, + null, + nestedPath.concat(parts.slice(0, p)) + ); + if (ret != null) { + return ret; + } + + if (type.schema.discriminators) { + const discriminatorPaths = []; + for (const discriminatorName of Object.keys(type.schema.discriminators)) { + const _schema = type.schema.discriminators[discriminatorName] || type.schema; + const ret = search(parts.slice(p), _schema, null, nestedPath.concat(parts.slice(0, p))); + if (ret != null) { + discriminatorPaths.push(ret); + } + } + if (discriminatorPaths.length > 0) { + return discriminatorPaths; + } + } + } + } + + const fullPath = nestedPath.concat([trypath]).join('.'); + if (topLevelDoc != null && topLevelDoc.$__ && topLevelDoc.$populated(fullPath) && p < parts.length) { + const model = doc.$__.populated[fullPath].options[populateModelSymbol]; + if (model != null) { + const ret = search( + parts.slice(p), + model.schema, + subdoc ? mpath.get(trypath, subdoc) : null, + nestedPath.concat(parts.slice(0, p)) + ); + + if (ret) { + ret.$isUnderneathDocArray = ret.$isUnderneathDocArray || + !model.schema.$isSingleNested; + } + return ret; + } + } + + const _val = get(topLevelDoc, trypath); + if (_val != null) { + const model = Array.isArray(_val) && _val.length > 0 ? + leanPopulateMap.get(_val[0]) : + leanPopulateMap.get(_val); + // Populated using lean, `leanPopulateMap` value is the foreign model + const schema = model != null ? model.schema : null; + if (schema != null) { + const ret = search( + parts.slice(p), + schema, + subdoc ? mpath.get(trypath, subdoc) : null, + nestedPath.concat(parts.slice(0, p)) + ); + + if (ret != null) { + ret.$isUnderneathDocArray = ret.$isUnderneathDocArray || + !schema.$isSingleNested; + return ret; + } + } + } + return foundschema; + } + } + // look for arrays + const parts = path.split('.'); + for (let i = 0; i < parts.length; ++i) { + if (parts[i] === '$') { + // Re: gh-5628, because `schema.path()` doesn't take $ into account. + parts[i] = '0'; + } + } + return search(parts, schema, doc, []); +}; diff --git a/node_modules/mongoose/lib/helpers/populate/getVirtual.js b/node_modules/mongoose/lib/helpers/populate/getVirtual.js new file mode 100644 index 000000000..fc1641d40 --- /dev/null +++ b/node_modules/mongoose/lib/helpers/populate/getVirtual.js @@ -0,0 +1,72 @@ +'use strict'; + +module.exports = getVirtual; + +/*! + * ignore + */ + +function getVirtual(schema, name) { + if (schema.virtuals[name]) { + return { virtual: schema.virtuals[name], path: void 0 }; + } + + const parts = name.split('.'); + let cur = ''; + let nestedSchemaPath = ''; + for (let i = 0; i < parts.length; ++i) { + cur += (cur.length > 0 ? '.' : '') + parts[i]; + if (schema.virtuals[cur]) { + if (i === parts.length - 1) { + return { virtual: schema.virtuals[cur], path: nestedSchemaPath }; + } + continue; + } + + if (schema.nested[cur]) { + continue; + } + + if (schema.paths[cur] && schema.paths[cur].schema) { + schema = schema.paths[cur].schema; + const rest = parts.slice(i + 1).join('.'); + + if (schema.virtuals[rest]) { + if (i === parts.length - 2) { + return { + virtual: schema.virtuals[rest], + nestedSchemaPath: [nestedSchemaPath, cur].filter(v => !!v).join('.') + }; + } + continue; + } + + if (i + 1 < parts.length && schema.discriminators) { + for (const key of Object.keys(schema.discriminators)) { + const res = getVirtual(schema.discriminators[key], rest); + if (res != null) { + const _path = [nestedSchemaPath, cur, res.nestedSchemaPath]. + filter(v => !!v).join('.'); + return { + virtual: res.virtual, + nestedSchemaPath: _path + }; + } + } + } + + nestedSchemaPath += (nestedSchemaPath.length > 0 ? '.' : '') + cur; + cur = ''; + continue; + } + + if (schema.discriminators) { + for (const discriminatorKey of Object.keys(schema.discriminators)) { + const virtualFromDiscriminator = getVirtual(schema.discriminators[discriminatorKey], name); + if (virtualFromDiscriminator) return virtualFromDiscriminator; + } + } + + return null; + } +} diff --git a/node_modules/mongoose/lib/helpers/populate/leanPopulateMap.js b/node_modules/mongoose/lib/helpers/populate/leanPopulateMap.js new file mode 100644 index 000000000..a333124fa --- /dev/null +++ b/node_modules/mongoose/lib/helpers/populate/leanPopulateMap.js @@ -0,0 +1,7 @@ +'use strict'; + +/*! + * ignore + */ + +module.exports = new WeakMap(); \ No newline at end of file diff --git a/node_modules/mongoose/lib/helpers/populate/lookupLocalFields.js b/node_modules/mongoose/lib/helpers/populate/lookupLocalFields.js new file mode 100644 index 000000000..be553ebf9 --- /dev/null +++ b/node_modules/mongoose/lib/helpers/populate/lookupLocalFields.js @@ -0,0 +1,40 @@ +'use strict'; + +module.exports = function lookupLocalFields(cur, path, val) { + if (cur == null) { + return cur; + } + + if (cur._doc != null) { + cur = cur._doc; + } + + if (arguments.length >= 3) { + if (typeof cur !== 'object') { + return void 0; + } + if (val === void 0) { + return void 0; + } + if (cur instanceof Map) { + cur.set(path, val); + } else { + cur[path] = val; + } + return val; + } + + + // Support populating paths under maps using `map.$*.subpath` + if (path === '$*') { + return cur instanceof Map ? + Array.from(cur.values()) : + Object.keys(cur).map(key => cur[key]); + } + + if (cur instanceof Map) { + return cur.get(path); + } + + return cur[path]; +}; \ No newline at end of file diff --git a/node_modules/mongoose/lib/helpers/populate/markArraySubdocsPopulated.js b/node_modules/mongoose/lib/helpers/populate/markArraySubdocsPopulated.js new file mode 100644 index 000000000..290ebbd64 --- /dev/null +++ b/node_modules/mongoose/lib/helpers/populate/markArraySubdocsPopulated.js @@ -0,0 +1,42 @@ +'use strict'; + +const utils = require('../../utils'); + +/*! + * If populating a path within a document array, make sure each + * subdoc within the array knows its subpaths are populated. + * + * #### Example: + * const doc = await Article.findOne().populate('comments.author'); + * doc.comments[0].populated('author'); // Should be set + */ + +module.exports = function markArraySubdocsPopulated(doc, populated) { + if (doc._id == null || populated == null || populated.length === 0) { + return; + } + + const id = String(doc._id); + for (const item of populated) { + if (item.isVirtual) { + continue; + } + const path = item.path; + const pieces = path.split('.'); + for (let i = 0; i < pieces.length - 1; ++i) { + const subpath = pieces.slice(0, i + 1).join('.'); + const rest = pieces.slice(i + 1).join('.'); + const val = doc.get(subpath); + if (val == null) { + continue; + } + + if (utils.isMongooseDocumentArray(val)) { + for (let j = 0; j < val.length; ++j) { + val[j].populated(rest, item._docs[id] == null ? void 0 : item._docs[id][j], item); + } + break; + } + } + } +}; \ No newline at end of file diff --git a/node_modules/mongoose/lib/helpers/populate/modelNamesFromRefPath.js b/node_modules/mongoose/lib/helpers/populate/modelNamesFromRefPath.js new file mode 100644 index 000000000..79f0bb6f1 --- /dev/null +++ b/node_modules/mongoose/lib/helpers/populate/modelNamesFromRefPath.js @@ -0,0 +1,68 @@ +'use strict'; + +const MongooseError = require('../../error/mongooseError'); +const isPathExcluded = require('../projection/isPathExcluded'); +const lookupLocalFields = require('./lookupLocalFields'); +const mpath = require('mpath'); +const util = require('util'); +const utils = require('../../utils'); + +const hasNumericPropRE = /(\.\d+$|\.\d+\.)/g; + +module.exports = function modelNamesFromRefPath(refPath, doc, populatedPath, modelSchema, queryProjection) { + if (refPath == null) { + return []; + } + + if (typeof refPath === 'string' && queryProjection != null && isPathExcluded(queryProjection, refPath)) { + throw new MongooseError('refPath `' + refPath + '` must not be excluded in projection, got ' + + util.inspect(queryProjection)); + } + + // If populated path has numerics, the end `refPath` should too. For example, + // if populating `a.0.b` instead of `a.b` and `b` has `refPath = a.c`, we + // should return `a.0.c` for the refPath. + + if (hasNumericPropRE.test(populatedPath)) { + const chunks = populatedPath.split(hasNumericPropRE); + + if (chunks[chunks.length - 1] === '') { + throw new Error('Can\'t populate individual element in an array'); + } + + let _refPath = ''; + let _remaining = refPath; + // 2nd, 4th, etc. will be numeric props. For example: `[ 'a', '.0.', 'b' ]` + for (let i = 0; i < chunks.length; i += 2) { + const chunk = chunks[i]; + if (_remaining.startsWith(chunk + '.')) { + _refPath += _remaining.substring(0, chunk.length) + chunks[i + 1]; + _remaining = _remaining.substring(chunk.length + 1); + } else if (i === chunks.length - 1) { + _refPath += _remaining; + _remaining = ''; + break; + } else { + throw new Error('Could not normalize ref path, chunk ' + chunk + ' not in populated path'); + } + } + + const refValue = mpath.get(_refPath, doc, lookupLocalFields); + let modelNames = Array.isArray(refValue) ? refValue : [refValue]; + modelNames = utils.array.flatten(modelNames); + return modelNames; + } + + const refValue = mpath.get(refPath, doc, lookupLocalFields); + + let modelNames; + if (modelSchema != null && modelSchema.virtuals.hasOwnProperty(refPath)) { + modelNames = [modelSchema.virtuals[refPath].applyGetters(void 0, doc)]; + } else { + modelNames = Array.isArray(refValue) ? refValue : [refValue]; + } + + modelNames = utils.array.flatten(modelNames); + + return modelNames; +}; \ No newline at end of file diff --git a/node_modules/mongoose/lib/helpers/populate/removeDeselectedForeignField.js b/node_modules/mongoose/lib/helpers/populate/removeDeselectedForeignField.js new file mode 100644 index 000000000..39b893a9d --- /dev/null +++ b/node_modules/mongoose/lib/helpers/populate/removeDeselectedForeignField.js @@ -0,0 +1,31 @@ +'use strict'; + +const get = require('../get'); +const mpath = require('mpath'); +const parseProjection = require('../projection/parseProjection'); + +/*! + * ignore + */ + +module.exports = function removeDeselectedForeignField(foreignFields, options, docs) { + const projection = parseProjection(get(options, 'select', null), true) || + parseProjection(get(options, 'options.select', null), true); + + if (projection == null) { + return; + } + for (const foreignField of foreignFields) { + if (!projection.hasOwnProperty('-' + foreignField)) { + continue; + } + + for (const val of docs) { + if (val.$__ != null) { + mpath.unset(foreignField, val._doc); + } else { + mpath.unset(foreignField, val); + } + } + } +}; \ No newline at end of file diff --git a/node_modules/mongoose/lib/helpers/populate/validateRef.js b/node_modules/mongoose/lib/helpers/populate/validateRef.js new file mode 100644 index 000000000..9dc2b6fc6 --- /dev/null +++ b/node_modules/mongoose/lib/helpers/populate/validateRef.js @@ -0,0 +1,19 @@ +'use strict'; + +const MongooseError = require('../../error/mongooseError'); +const util = require('util'); + +module.exports = validateRef; + +function validateRef(ref, path) { + if (typeof ref === 'string') { + return; + } + + if (typeof ref === 'function') { + return; + } + + throw new MongooseError('Invalid ref at path "' + path + '". Got ' + + util.inspect(ref, { depth: 0 })); +} \ No newline at end of file diff --git a/node_modules/mongoose/lib/helpers/printJestWarning.js b/node_modules/mongoose/lib/helpers/printJestWarning.js new file mode 100644 index 000000000..4f4e6c148 --- /dev/null +++ b/node_modules/mongoose/lib/helpers/printJestWarning.js @@ -0,0 +1,17 @@ +'use strict'; + +const utils = require('../utils'); + +if (typeof jest !== 'undefined' && typeof window !== 'undefined') { + utils.warn('Mongoose: looks like you\'re trying to test a Mongoose app ' + + 'with Jest\'s default jsdom test environment. Please make sure you read ' + + 'Mongoose\'s docs on configuring Jest to test Node.js apps: ' + + 'https://mongoosejs.com/docs/jest.html'); +} + +if (typeof jest !== 'undefined' && process.nextTick.toString().indexOf('nextTick') === -1) { + utils.warn('Mongoose: looks like you\'re trying to test a Mongoose app ' + + 'with Jest\'s mock timers enabled. Please make sure you read ' + + 'Mongoose\'s docs on configuring Jest to test Node.js apps: ' + + 'https://mongoosejs.com/docs/jest.html'); +} \ No newline at end of file diff --git a/node_modules/mongoose/lib/helpers/processConnectionOptions.js b/node_modules/mongoose/lib/helpers/processConnectionOptions.js new file mode 100644 index 000000000..214a00960 --- /dev/null +++ b/node_modules/mongoose/lib/helpers/processConnectionOptions.js @@ -0,0 +1,64 @@ +'use strict'; + +const clone = require('./clone'); +const MongooseError = require('../error/index'); + +function processConnectionOptions(uri, options) { + const opts = options ? options : {}; + const readPreference = opts.readPreference + ? opts.readPreference + : getUriReadPreference(uri); + + const resolvedOpts = (readPreference && readPreference !== 'primary') + ? resolveOptsConflicts(readPreference, opts) + : opts; + + return clone(resolvedOpts); +} + +function resolveOptsConflicts(pref, opts) { + // don't silently override user-provided indexing options + if (setsIndexOptions(opts) && setsSecondaryRead(pref)) { + throwReadPreferenceError(); + } + + // if user has not explicitly set any auto-indexing options, + // we can silently default them all to false + else { + return defaultIndexOptsToFalse(opts); + } +} + +function setsIndexOptions(opts) { + const configIdx = opts.config && opts.config.autoIndex; + const { autoCreate, autoIndex } = opts; + return !!(configIdx || autoCreate || autoIndex); +} + +function setsSecondaryRead(prefString) { + return !!(prefString === 'secondary' || prefString === 'secondaryPreferred'); +} + +function getUriReadPreference(connectionString) { + const exp = /(?:&|\?)readPreference=(\w+)(?:&|$)/; + const match = exp.exec(connectionString); + return match ? match[1] : null; +} + +function defaultIndexOptsToFalse(opts) { + opts.config = { autoIndex: false }; + opts.autoCreate = false; + opts.autoIndex = false; + return opts; +} + +function throwReadPreferenceError() { + throw new MongooseError( + 'MongoDB prohibits index creation on connections that read from ' + + 'non-primary replicas. Connections that set "readPreference" to "secondary" or ' + + '"secondaryPreferred" may not opt-in to the following connection options: ' + + 'autoCreate, autoIndex' + ); +} + +module.exports = processConnectionOptions; diff --git a/node_modules/mongoose/lib/helpers/projection/applyProjection.js b/node_modules/mongoose/lib/helpers/projection/applyProjection.js new file mode 100644 index 000000000..5a06d85a2 --- /dev/null +++ b/node_modules/mongoose/lib/helpers/projection/applyProjection.js @@ -0,0 +1,77 @@ +'use strict'; + +const hasIncludedChildren = require('./hasIncludedChildren'); +const isExclusive = require('./isExclusive'); +const isInclusive = require('./isInclusive'); +const isPOJO = require('../../utils').isPOJO; + +module.exports = function applyProjection(doc, projection, _hasIncludedChildren) { + if (projection == null) { + return doc; + } + if (doc == null) { + return doc; + } + + let exclude = null; + if (isInclusive(projection)) { + exclude = false; + } else if (isExclusive(projection)) { + exclude = true; + } + + if (exclude == null) { + return doc; + } else if (exclude) { + _hasIncludedChildren = _hasIncludedChildren || hasIncludedChildren(projection); + return applyExclusiveProjection(doc, projection, _hasIncludedChildren); + } else { + _hasIncludedChildren = _hasIncludedChildren || hasIncludedChildren(projection); + return applyInclusiveProjection(doc, projection, _hasIncludedChildren); + } +}; + +function applyExclusiveProjection(doc, projection, hasIncludedChildren, projectionLimb, prefix) { + if (doc == null || typeof doc !== 'object') { + return doc; + } + const ret = { ...doc }; + projectionLimb = prefix ? (projectionLimb || {}) : projection; + + for (const key of Object.keys(ret)) { + const fullPath = prefix ? prefix + '.' + key : key; + if (projection.hasOwnProperty(fullPath) || projectionLimb.hasOwnProperty(key)) { + if (isPOJO(projection[fullPath]) || isPOJO(projectionLimb[key])) { + ret[key] = applyExclusiveProjection(ret[key], projection, hasIncludedChildren, projectionLimb[key], fullPath); + } else { + delete ret[key]; + } + } else if (hasIncludedChildren[fullPath]) { + ret[key] = applyExclusiveProjection(ret[key], projection, hasIncludedChildren, projectionLimb[key], fullPath); + } + } + return ret; +} + +function applyInclusiveProjection(doc, projection, hasIncludedChildren, projectionLimb, prefix) { + if (doc == null || typeof doc !== 'object') { + return doc; + } + const ret = { ...doc }; + projectionLimb = prefix ? (projectionLimb || {}) : projection; + + for (const key of Object.keys(ret)) { + const fullPath = prefix ? prefix + '.' + key : key; + if (projection.hasOwnProperty(fullPath) || projectionLimb.hasOwnProperty(key)) { + if (isPOJO(projection[fullPath]) || isPOJO(projectionLimb[key])) { + ret[key] = applyInclusiveProjection(ret[key], projection, hasIncludedChildren, projectionLimb[key], fullPath); + } + continue; + } else if (hasIncludedChildren[fullPath]) { + ret[key] = applyInclusiveProjection(ret[key], projection, hasIncludedChildren, projectionLimb[key], fullPath); + } else { + delete ret[key]; + } + } + return ret; +} \ No newline at end of file diff --git a/node_modules/mongoose/lib/helpers/projection/hasIncludedChildren.js b/node_modules/mongoose/lib/helpers/projection/hasIncludedChildren.js new file mode 100644 index 000000000..a87348cba --- /dev/null +++ b/node_modules/mongoose/lib/helpers/projection/hasIncludedChildren.js @@ -0,0 +1,36 @@ +'use strict'; + +/*! + * Creates an object that precomputes whether a given path has child fields in + * the projection. + * + * #### Example: + * const res = hasIncludedChildren({ 'a.b.c': 0 }); + * res.a; // 1 + * res['a.b']; // 1 + * res['a.b.c']; // 1 + * res['a.c']; // undefined + */ + +module.exports = function hasIncludedChildren(fields) { + const hasIncludedChildren = {}; + const keys = Object.keys(fields); + + for (const key of keys) { + if (key.indexOf('.') === -1) { + hasIncludedChildren[key] = 1; + continue; + } + const parts = key.split('.'); + let c = parts[0]; + + for (let i = 0; i < parts.length; ++i) { + hasIncludedChildren[c] = 1; + if (i + 1 < parts.length) { + c = c + '.' + parts[i + 1]; + } + } + } + + return hasIncludedChildren; +}; \ No newline at end of file diff --git a/node_modules/mongoose/lib/helpers/projection/isDefiningProjection.js b/node_modules/mongoose/lib/helpers/projection/isDefiningProjection.js new file mode 100644 index 000000000..67dfb39fc --- /dev/null +++ b/node_modules/mongoose/lib/helpers/projection/isDefiningProjection.js @@ -0,0 +1,18 @@ +'use strict'; + +/*! + * ignore + */ + +module.exports = function isDefiningProjection(val) { + if (val == null) { + // `undefined` or `null` become exclusive projections + return true; + } + if (typeof val === 'object') { + // Only cases where a value does **not** define whether the whole projection + // is inclusive or exclusive are `$meta` and `$slice`. + return !('$meta' in val) && !('$slice' in val); + } + return true; +}; diff --git a/node_modules/mongoose/lib/helpers/projection/isExclusive.js b/node_modules/mongoose/lib/helpers/projection/isExclusive.js new file mode 100644 index 000000000..a232857d6 --- /dev/null +++ b/node_modules/mongoose/lib/helpers/projection/isExclusive.js @@ -0,0 +1,35 @@ +'use strict'; + +const isDefiningProjection = require('./isDefiningProjection'); + +/*! + * ignore + */ + +module.exports = function isExclusive(projection) { + if (projection == null) { + return null; + } + + const keys = Object.keys(projection); + let ki = keys.length; + let exclude = null; + + if (ki === 1 && keys[0] === '_id') { + exclude = !projection._id; + } else { + while (ki--) { + // Does this projection explicitly define inclusion/exclusion? + // Explicitly avoid `$meta` and `$slice` + const key = keys[ki]; + if (key !== '_id' && isDefiningProjection(projection[key])) { + exclude = (projection[key] != null && typeof projection[key] === 'object') ? + isExclusive(projection[key]) : + !projection[key]; + break; + } + } + } + + return exclude; +}; diff --git a/node_modules/mongoose/lib/helpers/projection/isInclusive.js b/node_modules/mongoose/lib/helpers/projection/isInclusive.js new file mode 100644 index 000000000..eebb412c4 --- /dev/null +++ b/node_modules/mongoose/lib/helpers/projection/isInclusive.js @@ -0,0 +1,38 @@ +'use strict'; + +const isDefiningProjection = require('./isDefiningProjection'); + +/*! + * ignore + */ + +module.exports = function isInclusive(projection) { + if (projection == null) { + return false; + } + + const props = Object.keys(projection); + const numProps = props.length; + if (numProps === 0) { + return false; + } + + for (let i = 0; i < numProps; ++i) { + const prop = props[i]; + // Plus paths can't define the projection (see gh-7050) + if (prop.startsWith('+')) { + continue; + } + // If field is truthy (1, true, etc.) and not an object, then this + // projection must be inclusive. If object, assume its $meta, $slice, etc. + if (isDefiningProjection(projection[prop]) && !!projection[prop]) { + if (projection[prop] != null && typeof projection[prop] === 'object') { + return isInclusive(projection[prop]); + } else { + return !!projection[prop]; + } + } + } + + return false; +}; diff --git a/node_modules/mongoose/lib/helpers/projection/isPathExcluded.js b/node_modules/mongoose/lib/helpers/projection/isPathExcluded.js new file mode 100644 index 000000000..fc2592cda --- /dev/null +++ b/node_modules/mongoose/lib/helpers/projection/isPathExcluded.js @@ -0,0 +1,35 @@ +'use strict'; + +const isDefiningProjection = require('./isDefiningProjection'); + +/*! + * Determines if `path` is excluded by `projection` + * + * @param {Object} projection + * @param {string} path + * @return {Boolean} + */ + +module.exports = function isPathExcluded(projection, path) { + if (path === '_id') { + return projection._id === 0; + } + + const paths = Object.keys(projection); + let type = null; + + for (const _path of paths) { + if (isDefiningProjection(projection[_path])) { + type = projection[path] === 1 ? 'inclusive' : 'exclusive'; + break; + } + } + + if (type === 'inclusive') { + return projection[path] !== 1; + } + if (type === 'exclusive') { + return projection[path] === 0; + } + return false; +}; diff --git a/node_modules/mongoose/lib/helpers/projection/isPathSelectedInclusive.js b/node_modules/mongoose/lib/helpers/projection/isPathSelectedInclusive.js new file mode 100644 index 000000000..8a05fc948 --- /dev/null +++ b/node_modules/mongoose/lib/helpers/projection/isPathSelectedInclusive.js @@ -0,0 +1,28 @@ +'use strict'; + +/*! + * ignore + */ + +module.exports = function isPathSelectedInclusive(fields, path) { + const chunks = path.split('.'); + let cur = ''; + let j; + let keys; + let numKeys; + for (let i = 0; i < chunks.length; ++i) { + cur += cur.length ? '.' : '' + chunks[i]; + if (fields[cur]) { + keys = Object.keys(fields); + numKeys = keys.length; + for (j = 0; j < numKeys; ++j) { + if (keys[i].indexOf(cur + '.') === 0 && keys[i].indexOf(path) !== 0) { + continue; + } + } + return true; + } + } + + return false; +}; diff --git a/node_modules/mongoose/lib/helpers/projection/isSubpath.js b/node_modules/mongoose/lib/helpers/projection/isSubpath.js new file mode 100644 index 000000000..4e870e9df --- /dev/null +++ b/node_modules/mongoose/lib/helpers/projection/isSubpath.js @@ -0,0 +1,13 @@ +'use strict'; + +/*! + * Determines if `path2` is a subpath of or equal to `path1` + * + * @param {string} path1 + * @param {string} path2 + * @return {Boolean} + */ + +module.exports = function isSubpath(path1, path2) { + return path1 === path2 || path2.startsWith(path1 + '.'); +}; diff --git a/node_modules/mongoose/lib/helpers/projection/parseProjection.js b/node_modules/mongoose/lib/helpers/projection/parseProjection.js new file mode 100644 index 000000000..d2a44b106 --- /dev/null +++ b/node_modules/mongoose/lib/helpers/projection/parseProjection.js @@ -0,0 +1,33 @@ +'use strict'; + +/** + * Convert a string or array into a projection object, retaining all + * `-` and `+` paths. + */ + +module.exports = function parseProjection(v, retainMinusPaths) { + const type = typeof v; + + if (type === 'string') { + v = v.split(/\s+/); + } + if (!Array.isArray(v) && Object.prototype.toString.call(v) !== '[object Arguments]') { + return v; + } + + const len = v.length; + const ret = {}; + for (let i = 0; i < len; ++i) { + let field = v[i]; + if (!field) { + continue; + } + const include = '-' == field[0] ? 0 : 1; + if (!retainMinusPaths && include === 0) { + field = field.substring(1); + } + ret[field] = include; + } + + return ret; +}; \ No newline at end of file diff --git a/node_modules/mongoose/lib/helpers/promiseOrCallback.js b/node_modules/mongoose/lib/helpers/promiseOrCallback.js new file mode 100644 index 000000000..69ba38530 --- /dev/null +++ b/node_modules/mongoose/lib/helpers/promiseOrCallback.js @@ -0,0 +1,46 @@ +'use strict'; + +const PromiseProvider = require('../promise_provider'); +const immediate = require('./immediate'); + +const emittedSymbol = Symbol('mongoose:emitted'); + +module.exports = function promiseOrCallback(callback, fn, ee, Promise) { + if (typeof callback === 'function') { + return fn(function(error) { + if (error != null) { + if (ee != null && ee.listeners != null && ee.listeners('error').length > 0 && !error[emittedSymbol]) { + error[emittedSymbol] = true; + ee.emit('error', error); + } + try { + callback(error); + } catch (error) { + return immediate(() => { + throw error; + }); + } + return; + } + callback.apply(this, arguments); + }); + } + + Promise = Promise || PromiseProvider.get(); + + return new Promise((resolve, reject) => { + fn(function(error, res) { + if (error != null) { + if (ee != null && ee.listeners != null && ee.listeners('error').length > 0 && !error[emittedSymbol]) { + error[emittedSymbol] = true; + ee.emit('error', error); + } + return reject(error); + } + if (arguments.length > 2) { + return resolve(Array.prototype.slice.call(arguments, 1)); + } + resolve(res); + }); + }); +}; diff --git a/node_modules/mongoose/lib/helpers/query/applyGlobalOption.js b/node_modules/mongoose/lib/helpers/query/applyGlobalOption.js new file mode 100644 index 000000000..e2983d8ac --- /dev/null +++ b/node_modules/mongoose/lib/helpers/query/applyGlobalOption.js @@ -0,0 +1,29 @@ +'use strict'; + +const utils = require('../../utils'); + +function applyGlobalMaxTimeMS(options, model) { + applyGlobalOption(options, model, 'maxTimeMS'); +} + +function applyGlobalDiskUse(options, model) { + applyGlobalOption(options, model, 'allowDiskUse'); +} + +module.exports = { + applyGlobalMaxTimeMS, + applyGlobalDiskUse +}; + + +function applyGlobalOption(options, model, optionName) { + if (utils.hasUserDefinedProperty(options, optionName)) { + return; + } + + if (utils.hasUserDefinedProperty(model.db.options, optionName)) { + options[optionName] = model.db.options[optionName]; + } else if (utils.hasUserDefinedProperty(model.base.options, optionName)) { + options[optionName] = model.base.options[optionName]; + } +} \ No newline at end of file diff --git a/node_modules/mongoose/lib/helpers/query/applyQueryMiddleware.js b/node_modules/mongoose/lib/helpers/query/applyQueryMiddleware.js new file mode 100644 index 000000000..99e096b19 --- /dev/null +++ b/node_modules/mongoose/lib/helpers/query/applyQueryMiddleware.js @@ -0,0 +1,78 @@ +'use strict'; + +/*! + * ignore + */ + +module.exports = applyQueryMiddleware; + +const validOps = require('./validOps'); + +/*! + * ignore + */ + +applyQueryMiddleware.middlewareFunctions = validOps.concat([ + 'validate' +]); + +/*! + * Apply query middleware + * + * @param {Query} query constructor + * @param {Model} model + */ + +function applyQueryMiddleware(Query, model) { + const kareemOptions = { + useErrorHandlers: true, + numCallbackParams: 1, + nullResultByDefault: true + }; + + const middleware = model.hooks.filter(hook => { + const contexts = _getContexts(hook); + if (hook.name === 'updateOne') { + return contexts.query == null || !!contexts.query; + } + if (hook.name === 'deleteOne') { + return !!contexts.query || Object.keys(contexts).length === 0; + } + if (hook.name === 'validate' || hook.name === 'remove') { + return !!contexts.query; + } + if (hook.query != null || hook.document != null) { + return !!hook.query; + } + return true; + }); + + // `update()` thunk has a different name because `_update` was already taken + Query.prototype._execUpdate = middleware.createWrapper('update', + Query.prototype._execUpdate, null, kareemOptions); + // `distinct()` thunk has a different name because `_distinct` was already taken + Query.prototype.__distinct = middleware.createWrapper('distinct', + Query.prototype.__distinct, null, kareemOptions); + + // `validate()` doesn't have a thunk because it doesn't execute a query. + Query.prototype.validate = middleware.createWrapper('validate', + Query.prototype.validate, null, kareemOptions); + + applyQueryMiddleware.middlewareFunctions. + filter(v => v !== 'update' && v !== 'distinct' && v !== 'validate'). + forEach(fn => { + Query.prototype[`_${fn}`] = middleware.createWrapper(fn, + Query.prototype[`_${fn}`], null, kareemOptions); + }); +} + +function _getContexts(hook) { + const ret = {}; + if (hook.hasOwnProperty('query')) { + ret.query = hook.query; + } + if (hook.hasOwnProperty('document')) { + ret.document = hook.document; + } + return ret; +} \ No newline at end of file diff --git a/node_modules/mongoose/lib/helpers/query/cast$expr.js b/node_modules/mongoose/lib/helpers/query/cast$expr.js new file mode 100644 index 000000000..759a0ffbe --- /dev/null +++ b/node_modules/mongoose/lib/helpers/query/cast$expr.js @@ -0,0 +1,282 @@ +'use strict'; + +const CastError = require('../../error/cast'); +const StrictModeError = require('../../error/strict'); +const castNumber = require('../../cast/number'); + +const booleanComparison = new Set(['$and', '$or']); +const comparisonOperator = new Set(['$cmp', '$eq', '$lt', '$lte', '$gt', '$gte']); +const arithmeticOperatorArray = new Set([ + // avoid casting '$add' or '$subtract', because expressions can be either number or date, + // and we don't have a good way of inferring which arguments should be numbers and which should + // be dates. + '$multiply', + '$divide', + '$log', + '$mod', + '$trunc', + '$avg', + '$max', + '$min', + '$stdDevPop', + '$stdDevSamp', + '$sum' +]); +const arithmeticOperatorNumber = new Set([ + '$abs', + '$exp', + '$ceil', + '$floor', + '$ln', + '$log10', + '$round', + '$sqrt', + '$sin', + '$cos', + '$tan', + '$asin', + '$acos', + '$atan', + '$atan2', + '$asinh', + '$acosh', + '$atanh', + '$sinh', + '$cosh', + '$tanh', + '$degreesToRadians', + '$radiansToDegrees' +]); +const arrayElementOperators = new Set([ + '$arrayElemAt', + '$first', + '$last' +]); +const dateOperators = new Set([ + '$year', + '$month', + '$week', + '$dayOfMonth', + '$dayOfYear', + '$hour', + '$minute', + '$second', + '$isoDayOfWeek', + '$isoWeekYear', + '$isoWeek', + '$millisecond' +]); +const expressionOperator = new Set(['$not']); + +module.exports = function cast$expr(val, schema, strictQuery) { + if (typeof val !== 'object' || val === null) { + throw new Error('`$expr` must be an object'); + } + + return _castExpression(val, schema, strictQuery); +}; + +function _castExpression(val, schema, strictQuery) { + if (isPath(val)) { + // Assume path + return val; + } + + if (val.$cond != null) { + if (Array.isArray(val.$cond)) { + val.$cond = val.$cond.map(expr => _castExpression(expr, schema, strictQuery)); + } else { + val.$cond.if = _castExpression(val.$cond.if, schema, strictQuery); + val.$cond.then = _castExpression(val.$cond.then, schema, strictQuery); + val.$cond.else = _castExpression(val.$cond.else, schema, strictQuery); + } + } else if (val.$ifNull != null) { + val.$ifNull.map(v => _castExpression(v, schema, strictQuery)); + } else if (val.$switch != null) { + val.branches.map(v => _castExpression(v, schema, strictQuery)); + val.default = _castExpression(val.default, schema, strictQuery); + } + + const keys = Object.keys(val); + for (const key of keys) { + if (booleanComparison.has(key)) { + val[key] = val[key].map(v => _castExpression(v, schema, strictQuery)); + } else if (comparisonOperator.has(key)) { + val[key] = castComparison(val[key], schema, strictQuery); + } else if (arithmeticOperatorArray.has(key)) { + val[key] = castArithmetic(val[key], schema, strictQuery); + } else if (arithmeticOperatorNumber.has(key)) { + val[key] = castNumberOperator(val[key], schema, strictQuery); + } else if (expressionOperator.has(key)) { + val[key] = _castExpression(val[key], schema, strictQuery); + } + } + + if (val.$in) { + val.$in = castIn(val.$in, schema, strictQuery); + } + if (val.$size) { + val.$size = castNumberOperator(val.$size, schema, strictQuery); + } + + _omitUndefined(val); + + return val; +} + +function _omitUndefined(val) { + const keys = Object.keys(val); + for (let i = 0, len = keys.length; i < len; ++i) { + (val[keys[i]] === void 0) && delete val[keys[i]]; + } +} + +// { $op: } +function castNumberOperator(val) { + if (!isLiteral(val)) { + return val; + } + + try { + return castNumber(val); + } catch (err) { + throw new CastError('Number', val); + } +} + +function castIn(val, schema, strictQuery) { + const path = val[1]; + if (!isPath(path)) { + return val; + } + const search = val[0]; + + const schematype = schema.path(path.slice(1)); + if (schematype === null) { + if (strictQuery === false) { + return val; + } else if (strictQuery === 'throw') { + throw new StrictModeError('$in'); + } + + return void 0; + } + + if (!schematype.$isMongooseArray) { + throw new Error('Path must be an array for $in'); + } + + return [ + schematype.$isMongooseDocumentArray ? schematype.$embeddedSchemaType.cast(search) : schematype.caster.cast(search), + path + ]; +} + +// { $op: [, ] } +function castArithmetic(val) { + if (!Array.isArray(val)) { + if (!isLiteral(val)) { + return val; + } + try { + return castNumber(val); + } catch (err) { + throw new CastError('Number', val); + } + } + + return val.map(v => { + if (!isLiteral(v)) { + return v; + } + try { + return castNumber(v); + } catch (err) { + throw new CastError('Number', v); + } + }); +} + +// { $op: [expression, expression] } +function castComparison(val, schema, strictQuery) { + if (!Array.isArray(val) || val.length !== 2) { + throw new Error('Comparison operator must be an array of length 2'); + } + + val[0] = _castExpression(val[0], schema, strictQuery); + const lhs = val[0]; + + if (isLiteral(val[1])) { + let path = null; + let schematype = null; + let caster = null; + if (isPath(lhs)) { + path = lhs.slice(1); + schematype = schema.path(path); + } else if (typeof lhs === 'object' && lhs != null) { + for (const key of Object.keys(lhs)) { + if (dateOperators.has(key) && isPath(lhs[key])) { + path = lhs[key].slice(1) + '.' + key; + caster = castNumber; + } else if (arrayElementOperators.has(key) && isPath(lhs[key])) { + path = lhs[key].slice(1) + '.' + key; + schematype = schema.path(lhs[key].slice(1)); + if (schematype != null) { + if (schematype.$isMongooseDocumentArray) { + schematype = schematype.$embeddedSchemaType; + } else if (schematype.$isMongooseArray) { + schematype = schematype.caster; + } + } + } + } + } + + const is$literal = typeof val[1] === 'object' && val[1] != null && val[1].$literal != null; + if (schematype != null) { + if (is$literal) { + val[1] = { $literal: schematype.cast(val[1].$literal) }; + } else { + val[1] = schematype.cast(val[1]); + } + } else if (caster != null) { + if (is$literal) { + try { + val[1] = { $literal: caster(val[1].$literal) }; + } catch (err) { + throw new CastError(caster.name.replace(/^cast/, ''), val[1], path + '.$literal'); + } + } else { + try { + val[1] = caster(val[1]); + } catch (err) { + throw new CastError(caster.name.replace(/^cast/, ''), val[1], path); + } + } + } else if (path != null && strictQuery === true) { + return void 0; + } else if (path != null && strictQuery === 'throw') { + throw new StrictModeError(path); + } + } else { + val[1] = _castExpression(val[1]); + } + + return val; +} + +function isPath(val) { + return typeof val === 'string' && val[0] === '$'; +} + +function isLiteral(val) { + if (typeof val === 'string' && val[0] === '$') { + return false; + } + if (typeof val === 'object' && val !== null && Object.keys(val).find(key => key[0] === '$')) { + // The `$literal` expression can make an object a literal + // https://docs.mongodb.com/manual/reference/operator/aggregation/literal/#mongodb-expression-exp.-literal + return val.$literal != null; + } + return true; +} \ No newline at end of file diff --git a/node_modules/mongoose/lib/helpers/query/castFilterPath.js b/node_modules/mongoose/lib/helpers/query/castFilterPath.js new file mode 100644 index 000000000..0343bee81 --- /dev/null +++ b/node_modules/mongoose/lib/helpers/query/castFilterPath.js @@ -0,0 +1,54 @@ +'use strict'; + +const isOperator = require('./isOperator'); + +module.exports = function castFilterPath(query, schematype, val) { + const ctx = query; + const any$conditionals = Object.keys(val).some(isOperator); + + if (!any$conditionals) { + return schematype.castForQueryWrapper({ + val: val, + context: ctx + }); + } + + const ks = Object.keys(val); + + let k = ks.length; + + while (k--) { + const $cond = ks[k]; + const nested = val[$cond]; + + if ($cond === '$not') { + if (nested && schematype && !schematype.caster) { + const _keys = Object.keys(nested); + if (_keys.length && isOperator(_keys[0])) { + for (const key of Object.keys(nested)) { + nested[key] = schematype.castForQueryWrapper({ + $conditional: key, + val: nested[key], + context: ctx + }); + } + } else { + val[$cond] = schematype.castForQueryWrapper({ + $conditional: $cond, + val: nested, + context: ctx + }); + } + continue; + } + } else { + val[$cond] = schematype.castForQueryWrapper({ + $conditional: $cond, + val: nested, + context: ctx + }); + } + } + + return val; +}; \ No newline at end of file diff --git a/node_modules/mongoose/lib/helpers/query/castUpdate.js b/node_modules/mongoose/lib/helpers/query/castUpdate.js new file mode 100644 index 000000000..9c4d29b65 --- /dev/null +++ b/node_modules/mongoose/lib/helpers/query/castUpdate.js @@ -0,0 +1,553 @@ +'use strict'; + +const CastError = require('../../error/cast'); +const MongooseError = require('../../error/mongooseError'); +const StrictModeError = require('../../error/strict'); +const ValidationError = require('../../error/validation'); +const castNumber = require('../../cast/number'); +const cast = require('../../cast'); +const getConstructorName = require('../getConstructorName'); +const getEmbeddedDiscriminatorPath = require('./getEmbeddedDiscriminatorPath'); +const handleImmutable = require('./handleImmutable'); +const moveImmutableProperties = require('../update/moveImmutableProperties'); +const schemaMixedSymbol = require('../../schema/symbols').schemaMixedSymbol; +const setDottedPath = require('../path/setDottedPath'); +const utils = require('../../utils'); + +/*! + * Casts an update op based on the given schema + * + * @param {Schema} schema + * @param {Object} obj + * @param {Object} options + * @param {Boolean} [options.overwrite] defaults to false + * @param {Boolean|String} [options.strict] defaults to true + * @param {Query} context passed to setters + * @return {Boolean} true iff the update is non-empty + */ +module.exports = function castUpdate(schema, obj, options, context, filter) { + if (obj == null) { + return undefined; + } + options = options || {}; + // Update pipeline + if (Array.isArray(obj)) { + const len = obj.length; + for (let i = 0; i < len; ++i) { + const ops = Object.keys(obj[i]); + for (const op of ops) { + obj[i][op] = castPipelineOperator(op, obj[i][op]); + } + } + return obj; + } + + if (schema.options.strict === 'throw' && obj.hasOwnProperty(schema.options.discriminatorKey)) { + throw new StrictModeError(schema.options.discriminatorKey); + } else if (!options.overwriteDiscriminatorKey) { + delete obj[schema.options.discriminatorKey]; + } + if (options.upsert && !options.overwrite) { + moveImmutableProperties(schema, obj, context); + } + + const ops = Object.keys(obj); + let i = ops.length; + const ret = {}; + let val; + let hasDollarKey = false; + const overwrite = options.overwrite; + + filter = filter || {}; + while (i--) { + const op = ops[i]; + // if overwrite is set, don't do any of the special $set stuff + if (op[0] !== '$' && !overwrite) { + // fix up $set sugar + if (!ret.$set) { + if (obj.$set) { + ret.$set = obj.$set; + } else { + ret.$set = {}; + } + } + ret.$set[op] = obj[op]; + ops.splice(i, 1); + if (!~ops.indexOf('$set')) ops.push('$set'); + } else if (op === '$set') { + if (!ret.$set) { + ret[op] = obj[op]; + } + } else { + ret[op] = obj[op]; + } + } + // cast each value + i = ops.length; + while (i--) { + const op = ops[i]; + val = ret[op]; + hasDollarKey = hasDollarKey || op.startsWith('$'); + + if (val && + typeof val === 'object' && + !Buffer.isBuffer(val) && + (!overwrite || hasDollarKey)) { + walkUpdatePath(schema, val, op, options, context, filter); + } else if (overwrite && ret && typeof ret === 'object') { + walkUpdatePath(schema, ret, '$set', options, context, filter); + } else { + const msg = 'Invalid atomic update value for ' + op + '. ' + + 'Expected an object, received ' + typeof val; + throw new Error(msg); + } + + if (op.startsWith('$') && utils.isEmptyObject(val)) { + delete ret[op]; + } + } + + if (Object.keys(ret).length === 0 && + options.upsert && + Object.keys(filter).length > 0) { + // Trick the driver into allowing empty upserts to work around + // https://github.com/mongodb/node-mongodb-native/pull/2490 + return { $setOnInsert: filter }; + } + return ret; +}; + +/*! + * ignore + */ + +function castPipelineOperator(op, val) { + if (op === '$unset') { + if (typeof val !== 'string' && (!Array.isArray(val) || val.find(v => typeof v !== 'string'))) { + throw new MongooseError('Invalid $unset in pipeline, must be ' + + ' a string or an array of strings'); + } + return val; + } + if (op === '$project') { + if (val == null || typeof val !== 'object') { + throw new MongooseError('Invalid $project in pipeline, must be an object'); + } + return val; + } + if (op === '$addFields' || op === '$set') { + if (val == null || typeof val !== 'object') { + throw new MongooseError('Invalid ' + op + ' in pipeline, must be an object'); + } + return val; + } else if (op === '$replaceRoot' || op === '$replaceWith') { + if (val == null || typeof val !== 'object') { + throw new MongooseError('Invalid ' + op + ' in pipeline, must be an object'); + } + return val; + } + + throw new MongooseError('Invalid update pipeline operator: "' + op + '"'); +} + +/*! + * Walk each path of obj and cast its values + * according to its schema. + * + * @param {Schema} schema + * @param {Object} obj - part of a query + * @param {String} op - the atomic operator ($pull, $set, etc) + * @param {Object} options + * @param {Boolean|String} [options.strict] + * @param {Query} context + * @param {String} pref - path prefix (internal only) + * @return {Bool} true if this path has keys to update + * @api private + */ + +function walkUpdatePath(schema, obj, op, options, context, filter, pref) { + const strict = options.strict; + const prefix = pref ? pref + '.' : ''; + const keys = Object.keys(obj); + let i = keys.length; + let hasKeys = false; + let schematype; + let key; + let val; + + let aggregatedError = null; + + const strictMode = strict != null ? strict : schema.options.strict; + + while (i--) { + key = keys[i]; + val = obj[key]; + + // `$pull` is special because we need to cast the RHS as a query, not as + // an update. + if (op === '$pull') { + schematype = schema._getSchema(prefix + key); + if (schematype != null && schematype.schema != null) { + obj[key] = cast(schematype.schema, obj[key], options, context); + hasKeys = true; + continue; + } + } + + if (schema.discriminatorMapping != null && key === schema.options.discriminatorKey && !options.overwriteDiscriminatorKey) { + if (strictMode === 'throw') { + const err = new Error('Can\'t modify discriminator key "' + key + '" on discriminator model'); + aggregatedError = _appendError(err, context, key, aggregatedError); + continue; + } else if (strictMode) { + delete obj[key]; + continue; + } + } + + if (getConstructorName(val) === 'Object') { + // watch for embedded doc schemas + schematype = schema._getSchema(prefix + key); + + if (schematype == null) { + const _res = getEmbeddedDiscriminatorPath(schema, obj, filter, prefix + key, options); + if (_res.schematype != null) { + schematype = _res.schematype; + } + } + + if (op !== '$setOnInsert' && + !options.overwrite && + handleImmutable(schematype, strict, obj, key, prefix + key, context)) { + continue; + } + + if (schematype && schematype.caster && op in castOps) { + // embedded doc schema + if ('$each' in val) { + hasKeys = true; + try { + obj[key] = { + $each: castUpdateVal(schematype, val.$each, op, key, context, prefix + key) + }; + } catch (error) { + aggregatedError = _appendError(error, context, key, aggregatedError); + } + + if (val.$slice != null) { + obj[key].$slice = val.$slice | 0; + } + + if (val.$sort) { + obj[key].$sort = val.$sort; + } + + if (val.$position != null) { + obj[key].$position = castNumber(val.$position); + } + } else { + if (schematype != null && schematype.$isSingleNested) { + const _strict = strict == null ? schematype.schema.options.strict : strict; + try { + obj[key] = schematype.castForQuery(val, context, { strict: _strict }); + } catch (error) { + aggregatedError = _appendError(error, context, key, aggregatedError); + } + } else { + try { + obj[key] = castUpdateVal(schematype, val, op, key, context, prefix + key); + } catch (error) { + aggregatedError = _appendError(error, context, key, aggregatedError); + } + } + + if (obj[key] === void 0) { + delete obj[key]; + continue; + } + + hasKeys = true; + } + } else if ((op === '$currentDate') || (op in castOps && schematype)) { + // $currentDate can take an object + try { + obj[key] = castUpdateVal(schematype, val, op, key, context, prefix + key); + } catch (error) { + aggregatedError = _appendError(error, context, key, aggregatedError); + } + + if (obj[key] === void 0) { + delete obj[key]; + continue; + } + + hasKeys = true; + } else { + const pathToCheck = (prefix + key); + const v = schema._getPathType(pathToCheck); + let _strict = strict; + if (v && v.schema && _strict == null) { + _strict = v.schema.options.strict; + } + + if (v.pathType === 'undefined') { + if (_strict === 'throw') { + throw new StrictModeError(pathToCheck); + } else if (_strict) { + delete obj[key]; + continue; + } + } + + // gh-2314 + // we should be able to set a schema-less field + // to an empty object literal + hasKeys |= walkUpdatePath(schema, val, op, options, context, filter, prefix + key) || + (utils.isObject(val) && Object.keys(val).length === 0); + } + } else { + const checkPath = (key === '$each' || key === '$or' || key === '$and' || key === '$in') ? + pref : prefix + key; + schematype = schema._getSchema(checkPath); + + // You can use `$setOnInsert` with immutable keys + if (op !== '$setOnInsert' && + !options.overwrite && + handleImmutable(schematype, strict, obj, key, prefix + key, context)) { + continue; + } + + let pathDetails = schema._getPathType(checkPath); + + // If no schema type, check for embedded discriminators because the + // filter or update may imply an embedded discriminator type. See #8378 + if (schematype == null) { + const _res = getEmbeddedDiscriminatorPath(schema, obj, filter, checkPath, options); + if (_res.schematype != null) { + schematype = _res.schematype; + pathDetails = _res.type; + } + } + + let isStrict = strict; + if (pathDetails && pathDetails.schema && strict == null) { + isStrict = pathDetails.schema.options.strict; + } + + const skip = isStrict && + !schematype && + !/real|nested/.test(pathDetails.pathType); + + if (skip) { + // Even if strict is `throw`, avoid throwing an error because of + // virtuals because of #6731 + if (isStrict === 'throw' && schema.virtuals[checkPath] == null) { + throw new StrictModeError(prefix + key); + } else { + delete obj[key]; + } + } else { + // gh-1845 temporary fix: ignore $rename. See gh-3027 for tracking + // improving this. + if (op === '$rename') { + hasKeys = true; + continue; + } + + try { + if (prefix.length === 0 || key.indexOf('.') === -1) { + obj[key] = castUpdateVal(schematype, val, op, key, context, prefix + key); + } else { + // Setting a nested dotted path that's in the schema. We don't allow paths with '.' in + // a schema, so replace the dotted path with a nested object to avoid ending up with + // dotted properties in the updated object. See (gh-10200) + setDottedPath(obj, key, castUpdateVal(schematype, val, op, key, context, prefix + key)); + delete obj[key]; + } + } catch (error) { + aggregatedError = _appendError(error, context, key, aggregatedError); + } + + if (Array.isArray(obj[key]) && (op === '$addToSet' || op === '$push') && key !== '$each') { + if (schematype && + schematype.caster && + !schematype.caster.$isMongooseArray && + !schematype.caster[schemaMixedSymbol]) { + obj[key] = { $each: obj[key] }; + } + } + + if (obj[key] === void 0) { + delete obj[key]; + continue; + } + + hasKeys = true; + } + } + } + + if (aggregatedError != null) { + throw aggregatedError; + } + + return hasKeys; +} + +/*! + * ignore + */ + +function _appendError(error, query, key, aggregatedError) { + if (typeof query !== 'object' || !query.options.multipleCastError) { + throw error; + } + aggregatedError = aggregatedError || new ValidationError(); + aggregatedError.addError(key, error); + return aggregatedError; +} + +/*! + * These operators should be cast to numbers instead + * of their path schema type. + */ + +const numberOps = { + $pop: 1, + $inc: 1 +}; + +/*! + * These ops require no casting because the RHS doesn't do anything. + */ + +const noCastOps = { + $unset: 1 +}; + +/*! + * These operators require casting docs + * to real Documents for Update operations. + */ + +const castOps = { + $push: 1, + $addToSet: 1, + $set: 1, + $setOnInsert: 1 +}; + +/*! + * ignore + */ + +const overwriteOps = { + $set: 1, + $setOnInsert: 1 +}; + +/*! + * Casts `val` according to `schema` and atomic `op`. + * + * @param {SchemaType} schema + * @param {Object} val + * @param {String} op - the atomic operator ($pull, $set, etc) + * @param {String} $conditional + * @param {Query} context + * @api private + */ + +function castUpdateVal(schema, val, op, $conditional, context, path) { + if (!schema) { + // non-existing schema path + if (op in numberOps) { + try { + return castNumber(val); + } catch (err) { + throw new CastError('number', val, path); + } + } + return val; + } + + // console.log('CastUpdateVal', path, op, val, schema); + + const cond = schema.caster && op in castOps && + (utils.isObject(val) || Array.isArray(val)); + if (cond && !overwriteOps[op]) { + // Cast values for ops that add data to MongoDB. + // Ensures embedded documents get ObjectIds etc. + let schemaArrayDepth = 0; + let cur = schema; + while (cur.$isMongooseArray) { + ++schemaArrayDepth; + cur = cur.caster; + } + let arrayDepth = 0; + let _val = val; + while (Array.isArray(_val)) { + ++arrayDepth; + _val = _val[0]; + } + + const additionalNesting = schemaArrayDepth - arrayDepth; + while (arrayDepth < schemaArrayDepth) { + val = [val]; + ++arrayDepth; + } + + let tmp = schema.applySetters(Array.isArray(val) ? val : [val], context); + + for (let i = 0; i < additionalNesting; ++i) { + tmp = tmp[0]; + } + return tmp; + } + + if (op in noCastOps) { + return val; + } + if (op in numberOps) { + // Null and undefined not allowed for $pop, $inc + if (val == null) { + throw new CastError('number', val, schema.path); + } + if (op === '$inc') { + // Support `$inc` with long, int32, etc. (gh-4283) + return schema.castForQueryWrapper({ + val: val, + context: context + }); + } + try { + return castNumber(val); + } catch (error) { + throw new CastError('number', val, schema.path); + } + } + if (op === '$currentDate') { + if (typeof val === 'object') { + return { $type: val.$type }; + } + return Boolean(val); + } + + if (/^\$/.test($conditional)) { + return schema.castForQueryWrapper({ + $conditional: $conditional, + val: val, + context: context + }); + } + + if (overwriteOps[op]) { + return schema.castForQueryWrapper({ + val: val, + context: context, + $skipQueryCastForUpdate: val != null && schema.$isMongooseArray && schema.$fullPath != null && !schema.$fullPath.match(/\d+$/), + $applySetters: schema[schemaMixedSymbol] != null + }); + } + + return schema.castForQueryWrapper({ val: val, context: context }); +} diff --git a/node_modules/mongoose/lib/helpers/query/completeMany.js b/node_modules/mongoose/lib/helpers/query/completeMany.js new file mode 100644 index 000000000..b52da432a --- /dev/null +++ b/node_modules/mongoose/lib/helpers/query/completeMany.js @@ -0,0 +1,51 @@ +'use strict'; + +const helpers = require('../../queryhelpers'); +const immediate = require('../immediate'); + +module.exports = completeMany; + +/*! + * Given a model and an array of docs, hydrates all the docs to be instances + * of the model. Used to initialize docs returned from the db from `find()` + * + * @param {Model} model + * @param {Array} docs + * @param {Object} fields the projection used, including `select` from schemas + * @param {Object} userProvidedFields the user-specified projection + * @param {Object} opts + * @param {Array} [opts.populated] + * @param {ClientSession} [opts.session] + * @param {Function} callback + */ + +function completeMany(model, docs, fields, userProvidedFields, opts, callback) { + const arr = []; + let count = docs.length; + const len = count; + let error = null; + + function init(_error) { + if (_error != null) { + error = error || _error; + } + if (error != null) { + --count || immediate(() => callback(error)); + return; + } + --count || immediate(() => callback(error, arr)); + } + + for (let i = 0; i < len; ++i) { + arr[i] = helpers.createModel(model, docs[i], fields, userProvidedFields); + try { + arr[i].$init(docs[i], opts, init); + } catch (error) { + init(error); + } + + if (opts.session != null) { + arr[i].$session(opts.session); + } + } +} diff --git a/node_modules/mongoose/lib/helpers/query/getEmbeddedDiscriminatorPath.js b/node_modules/mongoose/lib/helpers/query/getEmbeddedDiscriminatorPath.js new file mode 100644 index 000000000..2f3f39d97 --- /dev/null +++ b/node_modules/mongoose/lib/helpers/query/getEmbeddedDiscriminatorPath.js @@ -0,0 +1,84 @@ +'use strict'; + +const cleanPositionalOperators = require('../schema/cleanPositionalOperators'); +const get = require('../get'); +const getDiscriminatorByValue = require('../discriminator/getDiscriminatorByValue'); +const updatedPathsByArrayFilter = require('../update/updatedPathsByArrayFilter'); + +/*! + * Like `schema.path()`, except with a document, because impossible to + * determine path type without knowing the embedded discriminator key. + */ + +module.exports = function getEmbeddedDiscriminatorPath(schema, update, filter, path, options) { + const parts = path.split('.'); + let schematype = null; + let type = 'adhocOrUndefined'; + + filter = filter || {}; + update = update || {}; + const arrayFilters = options != null && Array.isArray(options.arrayFilters) ? + options.arrayFilters : []; + const updatedPathsByFilter = updatedPathsByArrayFilter(update); + + for (let i = 0; i < parts.length; ++i) { + const subpath = cleanPositionalOperators(parts.slice(0, i + 1).join('.')); + schematype = schema.path(subpath); + if (schematype == null) { + continue; + } + + type = schema.pathType(subpath); + if ((schematype.$isSingleNested || schematype.$isMongooseDocumentArrayElement) && + schematype.schema.discriminators != null) { + const key = get(schematype, 'schema.options.discriminatorKey'); + const discriminatorValuePath = subpath + '.' + key; + const discriminatorFilterPath = + discriminatorValuePath.replace(/\.\d+\./, '.'); + let discriminatorKey = null; + + if (discriminatorValuePath in filter) { + discriminatorKey = filter[discriminatorValuePath]; + } + if (discriminatorFilterPath in filter) { + discriminatorKey = filter[discriminatorFilterPath]; + } + + const wrapperPath = subpath.replace(/\.\d+$/, ''); + if (schematype.$isMongooseDocumentArrayElement && + get(filter[wrapperPath], '$elemMatch.' + key) != null) { + discriminatorKey = filter[wrapperPath].$elemMatch[key]; + } + + if (discriminatorValuePath in update) { + discriminatorKey = update[discriminatorValuePath]; + } + + for (const filterKey of Object.keys(updatedPathsByFilter)) { + const schemaKey = updatedPathsByFilter[filterKey] + '.' + key; + const arrayFilterKey = filterKey + '.' + key; + if (schemaKey === discriminatorFilterPath) { + const filter = arrayFilters.find(filter => filter.hasOwnProperty(arrayFilterKey)); + if (filter != null) { + discriminatorKey = filter[arrayFilterKey]; + } + } + } + + if (discriminatorKey == null) { + continue; + } + + const discriminatorSchema = getDiscriminatorByValue(schematype.caster.discriminators, discriminatorKey).schema; + + const rest = parts.slice(i + 1).join('.'); + schematype = discriminatorSchema.path(rest); + if (schematype != null) { + type = discriminatorSchema._getPathType(rest); + break; + } + } + } + + return { type: type, schematype: schematype }; +}; diff --git a/node_modules/mongoose/lib/helpers/query/handleImmutable.js b/node_modules/mongoose/lib/helpers/query/handleImmutable.js new file mode 100644 index 000000000..22adb3c50 --- /dev/null +++ b/node_modules/mongoose/lib/helpers/query/handleImmutable.js @@ -0,0 +1,28 @@ +'use strict'; + +const StrictModeError = require('../../error/strict'); + +module.exports = function handleImmutable(schematype, strict, obj, key, fullPath, ctx) { + if (schematype == null || !schematype.options || !schematype.options.immutable) { + return false; + } + let immutable = schematype.options.immutable; + + if (typeof immutable === 'function') { + immutable = immutable.call(ctx, ctx); + } + if (!immutable) { + return false; + } + + if (strict === false) { + return false; + } + if (strict === 'throw') { + throw new StrictModeError(null, + `Field ${fullPath} is immutable and strict = 'throw'`); + } + + delete obj[key]; + return true; +}; diff --git a/node_modules/mongoose/lib/helpers/query/hasDollarKeys.js b/node_modules/mongoose/lib/helpers/query/hasDollarKeys.js new file mode 100644 index 000000000..3e3b188c1 --- /dev/null +++ b/node_modules/mongoose/lib/helpers/query/hasDollarKeys.js @@ -0,0 +1,23 @@ +'use strict'; + +/*! + * ignore + */ + +module.exports = function hasDollarKeys(obj) { + + if (typeof obj !== 'object' || obj === null) { + return false; + } + + const keys = Object.keys(obj); + const len = keys.length; + + for (let i = 0; i < len; ++i) { + if (keys[i][0] === '$') { + return true; + } + } + + return false; +}; diff --git a/node_modules/mongoose/lib/helpers/query/isOperator.js b/node_modules/mongoose/lib/helpers/query/isOperator.js new file mode 100644 index 000000000..04488591a --- /dev/null +++ b/node_modules/mongoose/lib/helpers/query/isOperator.js @@ -0,0 +1,14 @@ +'use strict'; + +const specialKeys = new Set([ + '$ref', + '$id', + '$db' +]); + +module.exports = function isOperator(path) { + return ( + path[0] === '$' && + !specialKeys.has(path) + ); +}; diff --git a/node_modules/mongoose/lib/helpers/query/sanitizeFilter.js b/node_modules/mongoose/lib/helpers/query/sanitizeFilter.js new file mode 100644 index 000000000..4177a0c68 --- /dev/null +++ b/node_modules/mongoose/lib/helpers/query/sanitizeFilter.js @@ -0,0 +1,38 @@ +'use strict'; + +const hasDollarKeys = require('./hasDollarKeys'); +const { trustedSymbol } = require('./trusted'); + +module.exports = function sanitizeFilter(filter) { + if (filter == null || typeof filter !== 'object') { + return filter; + } + if (Array.isArray(filter)) { + for (const subfilter of filter) { + sanitizeFilter(subfilter); + } + return filter; + } + + const filterKeys = Object.keys(filter); + for (const key of filterKeys) { + const value = filter[key]; + if (value != null && value[trustedSymbol]) { + continue; + } + if (key === '$and' || key === '$or') { + sanitizeFilter(value); + continue; + } + + if (hasDollarKeys(value)) { + const keys = Object.keys(value); + if (keys.length === 1 && keys[0] === '$eq') { + continue; + } + filter[key] = { $eq: filter[key] }; + } + } + + return filter; +}; \ No newline at end of file diff --git a/node_modules/mongoose/lib/helpers/query/sanitizeProjection.js b/node_modules/mongoose/lib/helpers/query/sanitizeProjection.js new file mode 100644 index 000000000..dcb61fba9 --- /dev/null +++ b/node_modules/mongoose/lib/helpers/query/sanitizeProjection.js @@ -0,0 +1,14 @@ +'use strict'; + +module.exports = function sanitizeProjection(projection) { + if (projection == null) { + return; + } + + const keys = Object.keys(projection); + for (let i = 0; i < keys.length; ++i) { + if (typeof projection[keys[i]] === 'string') { + projection[keys[i]] = 1; + } + } +}; \ No newline at end of file diff --git a/node_modules/mongoose/lib/helpers/query/selectPopulatedFields.js b/node_modules/mongoose/lib/helpers/query/selectPopulatedFields.js new file mode 100644 index 000000000..92f1d87e0 --- /dev/null +++ b/node_modules/mongoose/lib/helpers/query/selectPopulatedFields.js @@ -0,0 +1,49 @@ +'use strict'; + +const isExclusive = require('../projection/isExclusive'); +const isInclusive = require('../projection/isInclusive'); + +/*! + * ignore + */ + +module.exports = function selectPopulatedFields(fields, userProvidedFields, populateOptions) { + if (populateOptions == null) { + return; + } + + const paths = Object.keys(populateOptions); + userProvidedFields = userProvidedFields || {}; + if (isInclusive(fields)) { + for (const path of paths) { + if (!isPathInFields(userProvidedFields, path)) { + fields[path] = 1; + } else if (userProvidedFields[path] === 0) { + delete fields[path]; + } + } + } else if (isExclusive(fields)) { + for (const path of paths) { + if (userProvidedFields[path] == null) { + delete fields[path]; + } + } + } +}; + +/*! + * ignore + */ + +function isPathInFields(userProvidedFields, path) { + const pieces = path.split('.'); + const len = pieces.length; + let cur = pieces[0]; + for (let i = 1; i < len; ++i) { + if (userProvidedFields[cur] != null || userProvidedFields[cur + '.$'] != null) { + return true; + } + cur += '.' + pieces[i]; + } + return userProvidedFields[cur] != null || userProvidedFields[cur + '.$'] != null; +} diff --git a/node_modules/mongoose/lib/helpers/query/trusted.js b/node_modules/mongoose/lib/helpers/query/trusted.js new file mode 100644 index 000000000..98c6054ad --- /dev/null +++ b/node_modules/mongoose/lib/helpers/query/trusted.js @@ -0,0 +1,13 @@ +'use strict'; + +const trustedSymbol = Symbol('mongoose#trustedSymbol'); + +exports.trustedSymbol = trustedSymbol; + +exports.trusted = function trusted(obj) { + if (obj == null || typeof obj !== 'object') { + return obj; + } + obj[trustedSymbol] = true; + return obj; +}; \ No newline at end of file diff --git a/node_modules/mongoose/lib/helpers/query/validOps.js b/node_modules/mongoose/lib/helpers/query/validOps.js new file mode 100644 index 000000000..c0ac397f2 --- /dev/null +++ b/node_modules/mongoose/lib/helpers/query/validOps.js @@ -0,0 +1,24 @@ +'use strict'; + +module.exports = Object.freeze([ + // Read + 'count', + 'countDocuments', + 'distinct', + 'estimatedDocumentCount', + 'find', + 'findOne', + // Update + 'findOneAndReplace', + 'findOneAndUpdate', + 'replaceOne', + 'update', + 'updateMany', + 'updateOne', + // Delete + 'deleteMany', + 'deleteOne', + 'findOneAndDelete', + 'findOneAndRemove', + 'remove' +]); \ No newline at end of file diff --git a/node_modules/mongoose/lib/helpers/query/wrapThunk.js b/node_modules/mongoose/lib/helpers/query/wrapThunk.js new file mode 100644 index 000000000..daa4681ef --- /dev/null +++ b/node_modules/mongoose/lib/helpers/query/wrapThunk.js @@ -0,0 +1,29 @@ +'use strict'; + +const MongooseError = require('../../error/mongooseError'); + +/*! + * A query thunk is the function responsible for sending the query to MongoDB, + * like `Query#_findOne()` or `Query#_execUpdate()`. The `Query#exec()` function + * calls a thunk. The term "thunk" here is the traditional Node.js definition: + * a function that takes exactly 1 parameter, a callback. + * + * This function defines common behavior for all query thunks. + */ + +module.exports = function wrapThunk(fn) { + return function _wrappedThunk(cb) { + if (this._executionStack != null) { + let str = this.toString(); + if (str.length > 60) { + str = str.slice(0, 60) + '...'; + } + const err = new MongooseError('Query was already executed: ' + str); + err.originalStack = this._executionStack.stack; + return cb(err); + } + this._executionStack = new Error(); + + fn.call(this, cb); + }; +}; \ No newline at end of file diff --git a/node_modules/mongoose/lib/helpers/schema/addAutoId.js b/node_modules/mongoose/lib/helpers/schema/addAutoId.js new file mode 100644 index 000000000..11a1f2302 --- /dev/null +++ b/node_modules/mongoose/lib/helpers/schema/addAutoId.js @@ -0,0 +1,7 @@ +'use strict'; + +module.exports = function addAutoId(schema) { + const _obj = { _id: { auto: true } }; + _obj._id[schema.options.typeKey] = 'ObjectId'; + schema.add(_obj); +}; \ No newline at end of file diff --git a/node_modules/mongoose/lib/helpers/schema/applyPlugins.js b/node_modules/mongoose/lib/helpers/schema/applyPlugins.js new file mode 100644 index 000000000..3d91cfd2c --- /dev/null +++ b/node_modules/mongoose/lib/helpers/schema/applyPlugins.js @@ -0,0 +1,55 @@ +'use strict'; + +module.exports = function applyPlugins(schema, plugins, options, cacheKey) { + if (schema[cacheKey]) { + return; + } + schema[cacheKey] = true; + + if (!options || !options.skipTopLevel) { + let pluginTags = null; + for (const plugin of plugins) { + const tags = plugin[1] == null ? null : plugin[1].tags; + if (!Array.isArray(tags)) { + schema.plugin(plugin[0], plugin[1]); + continue; + } + + pluginTags = pluginTags || new Set(schema.options.pluginTags || []); + if (!tags.find(tag => pluginTags.has(tag))) { + continue; + } + schema.plugin(plugin[0], plugin[1]); + } + } + + options = Object.assign({}, options); + delete options.skipTopLevel; + + if (options.applyPluginsToChildSchemas !== false) { + for (const path of Object.keys(schema.paths)) { + const type = schema.paths[path]; + if (type.schema != null) { + applyPlugins(type.schema, plugins, options, cacheKey); + + // Recompile schema because plugins may have changed it, see gh-7572 + type.caster.prototype.$__setSchema(type.schema); + } + } + } + + const discriminators = schema.discriminators; + if (discriminators == null) { + return; + } + + const applyPluginsToDiscriminators = options.applyPluginsToDiscriminators; + + const keys = Object.keys(discriminators); + for (const discriminatorKey of keys) { + const discriminatorSchema = discriminators[discriminatorKey]; + + applyPlugins(discriminatorSchema, plugins, + { skipTopLevel: !applyPluginsToDiscriminators }, cacheKey); + } +}; \ No newline at end of file diff --git a/node_modules/mongoose/lib/helpers/schema/applyWriteConcern.js b/node_modules/mongoose/lib/helpers/schema/applyWriteConcern.js new file mode 100644 index 000000000..4095bd94b --- /dev/null +++ b/node_modules/mongoose/lib/helpers/schema/applyWriteConcern.js @@ -0,0 +1,30 @@ +'use strict'; + +const get = require('../get'); + +module.exports = function applyWriteConcern(schema, options) { + const writeConcern = get(schema, 'options.writeConcern', {}); + if (Object.keys(writeConcern).length != 0) { + options.writeConcern = {}; + if (!('w' in options) && writeConcern.w != null) { + options.writeConcern.w = writeConcern.w; + } + if (!('j' in options) && writeConcern.j != null) { + options.writeConcern.j = writeConcern.j; + } + if (!('wtimeout' in options) && writeConcern.wtimeout != null) { + options.writeConcern.wtimeout = writeConcern.wtimeout; + } + } + else { + if (!('w' in options) && writeConcern.w != null) { + options.w = writeConcern.w; + } + if (!('j' in options) && writeConcern.j != null) { + options.j = writeConcern.j; + } + if (!('wtimeout' in options) && writeConcern.wtimeout != null) { + options.wtimeout = writeConcern.wtimeout; + } + } +}; diff --git a/node_modules/mongoose/lib/helpers/schema/cleanPositionalOperators.js b/node_modules/mongoose/lib/helpers/schema/cleanPositionalOperators.js new file mode 100644 index 000000000..905bb7882 --- /dev/null +++ b/node_modules/mongoose/lib/helpers/schema/cleanPositionalOperators.js @@ -0,0 +1,12 @@ +'use strict'; + +/** + * For consistency's sake, we replace positional operator `$` and array filters + * `$[]` and `$[foo]` with `0` when looking up schema paths. + */ + +module.exports = function cleanPositionalOperators(path) { + return path. + replace(/\.\$(\[[^\]]*\])?(?=\.)/g, '.0'). + replace(/\.\$(\[[^\]]*\])?$/g, '.0'); +}; \ No newline at end of file diff --git a/node_modules/mongoose/lib/helpers/schema/getIndexes.js b/node_modules/mongoose/lib/helpers/schema/getIndexes.js new file mode 100644 index 000000000..7433b8dcf --- /dev/null +++ b/node_modules/mongoose/lib/helpers/schema/getIndexes.js @@ -0,0 +1,159 @@ +'use strict'; + +const get = require('../get'); +const helperIsObject = require('../isObject'); +const decorateDiscriminatorIndexOptions = require('../indexes/decorateDiscriminatorIndexOptions'); + +/*! + * Gather all indexes defined in the schema, including single nested, + * document arrays, and embedded discriminators. + */ + +module.exports = function getIndexes(schema) { + let indexes = []; + const schemaStack = new WeakMap(); + const indexTypes = schema.constructor.indexTypes; + const indexByName = new Map(); + + collectIndexes(schema); + return indexes; + + function collectIndexes(schema, prefix, baseSchema) { + // Ignore infinitely nested schemas, if we've already seen this schema + // along this path there must be a cycle + if (schemaStack.has(schema)) { + return; + } + schemaStack.set(schema, true); + + prefix = prefix || ''; + const keys = Object.keys(schema.paths); + + for (const key of keys) { + const path = schema.paths[key]; + if (baseSchema != null && baseSchema.paths[key]) { + // If looking at an embedded discriminator schema, don't look at paths + // that the + continue; + } + + if (path.$isMongooseDocumentArray || path.$isSingleNested) { + if (get(path, 'options.excludeIndexes') !== true && + get(path, 'schemaOptions.excludeIndexes') !== true && + get(path, 'schema.options.excludeIndexes') !== true) { + collectIndexes(path.schema, prefix + key + '.'); + } + + if (path.schema.discriminators != null) { + const discriminators = path.schema.discriminators; + const discriminatorKeys = Object.keys(discriminators); + for (const discriminatorKey of discriminatorKeys) { + collectIndexes(discriminators[discriminatorKey], + prefix + key + '.', path.schema); + } + } + + // Retained to minimize risk of backwards breaking changes due to + // gh-6113 + if (path.$isMongooseDocumentArray) { + continue; + } + } + + const index = path._index || (path.caster && path.caster._index); + + if (index !== false && index !== null && index !== undefined) { + const field = {}; + const isObject = helperIsObject(index); + const options = isObject ? index : {}; + const type = typeof index === 'string' ? index : + isObject ? index.type : + false; + + if (type && indexTypes.indexOf(type) !== -1) { + field[prefix + key] = type; + } else if (options.text) { + field[prefix + key] = 'text'; + delete options.text; + } else { + const isDescendingIndex = Number(index) === -1; + field[prefix + key] = isDescendingIndex ? -1 : 1; + } + + delete options.type; + if (!('background' in options)) { + options.background = true; + } + if (schema.options.autoIndex != null) { + options._autoIndex = schema.options.autoIndex; + } + + const indexName = options && options.name; + + if (typeof indexName === 'string') { + if (indexByName.has(indexName)) { + Object.assign(indexByName.get(indexName), field); + } else { + indexes.push([field, options]); + indexByName.set(indexName, field); + } + } else { + indexes.push([field, options]); + indexByName.set(indexName, field); + } + } + } + + schemaStack.delete(schema); + + if (prefix) { + fixSubIndexPaths(schema, prefix); + } else { + schema._indexes.forEach(function(index) { + const options = index[1]; + if (!('background' in options)) { + options.background = true; + } + decorateDiscriminatorIndexOptions(schema, options); + }); + indexes = indexes.concat(schema._indexes); + } + } + + /*! + * Checks for indexes added to subdocs using Schema.index(). + * These indexes need their paths prefixed properly. + * + * schema._indexes = [ [indexObj, options], [indexObj, options] ..] + */ + + function fixSubIndexPaths(schema, prefix) { + const subindexes = schema._indexes; + const len = subindexes.length; + for (let i = 0; i < len; ++i) { + const indexObj = subindexes[i][0]; + const indexOptions = subindexes[i][1]; + const keys = Object.keys(indexObj); + const klen = keys.length; + const newindex = {}; + + // use forward iteration, order matters + for (let j = 0; j < klen; ++j) { + const key = keys[j]; + newindex[prefix + key] = indexObj[key]; + } + + const newIndexOptions = Object.assign({}, indexOptions); + if (indexOptions != null && indexOptions.partialFilterExpression != null) { + newIndexOptions.partialFilterExpression = {}; + const partialFilterExpression = indexOptions.partialFilterExpression; + for (const key of Object.keys(partialFilterExpression)) { + newIndexOptions.partialFilterExpression[prefix + key] = + partialFilterExpression[key]; + } + } + + indexes.push([newindex, newIndexOptions]); + } + } +}; diff --git a/node_modules/mongoose/lib/helpers/schema/getKeysInSchemaOrder.js b/node_modules/mongoose/lib/helpers/schema/getKeysInSchemaOrder.js new file mode 100644 index 000000000..f84a88f04 --- /dev/null +++ b/node_modules/mongoose/lib/helpers/schema/getKeysInSchemaOrder.js @@ -0,0 +1,28 @@ +'use strict'; + +const get = require('../get'); + +module.exports = function getKeysInSchemaOrder(schema, val, path) { + const schemaKeys = path != null ? Object.keys(get(schema.tree, path, {})) : Object.keys(schema.tree); + const valKeys = new Set(Object.keys(val)); + + let keys; + if (valKeys.size > 1) { + keys = new Set(); + for (const key of schemaKeys) { + if (valKeys.has(key)) { + keys.add(key); + } + } + for (const key of valKeys) { + if (!keys.has(key)) { + keys.add(key); + } + } + keys = Array.from(keys); + } else { + keys = Array.from(valKeys); + } + + return keys; +}; \ No newline at end of file diff --git a/node_modules/mongoose/lib/helpers/schema/getPath.js b/node_modules/mongoose/lib/helpers/schema/getPath.js new file mode 100644 index 000000000..d0f120224 --- /dev/null +++ b/node_modules/mongoose/lib/helpers/schema/getPath.js @@ -0,0 +1,37 @@ +'use strict'; + +/*! + * Behaves like `Schema#path()`, except for it also digs into arrays without + * needing to put `.0.`, so `getPath(schema, 'docArr.elProp')` works. + */ + +const numberRE = /^\d+$/; + +module.exports = function getPath(schema, path) { + let schematype = schema.path(path); + if (schematype != null) { + return schematype; + } + + const pieces = path.split('.'); + let cur = ''; + let isArray = false; + + for (const piece of pieces) { + if (isArray && numberRE.test(piece)) { + continue; + } + cur = cur.length === 0 ? piece : cur + '.' + piece; + + schematype = schema.path(cur); + if (schematype != null && schematype.schema) { + schema = schematype.schema; + cur = ''; + if (!isArray && schematype.$isMongooseDocumentArray) { + isArray = true; + } + } + } + + return schematype; +}; \ No newline at end of file diff --git a/node_modules/mongoose/lib/helpers/schema/handleIdOption.js b/node_modules/mongoose/lib/helpers/schema/handleIdOption.js new file mode 100644 index 000000000..569bf9f51 --- /dev/null +++ b/node_modules/mongoose/lib/helpers/schema/handleIdOption.js @@ -0,0 +1,20 @@ +'use strict'; + +const addAutoId = require('./addAutoId'); + +module.exports = function handleIdOption(schema, options) { + if (options == null || options._id == null) { + return schema; + } + + schema = schema.clone(); + if (!options._id) { + schema.remove('_id'); + schema.options._id = false; + } else if (!schema.paths['_id']) { + addAutoId(schema); + schema.options._id = true; + } + + return schema; +}; \ No newline at end of file diff --git a/node_modules/mongoose/lib/helpers/schema/handleTimestampOption.js b/node_modules/mongoose/lib/helpers/schema/handleTimestampOption.js new file mode 100644 index 000000000..1551b7c10 --- /dev/null +++ b/node_modules/mongoose/lib/helpers/schema/handleTimestampOption.js @@ -0,0 +1,24 @@ +'use strict'; + +module.exports = handleTimestampOption; + +/*! + * ignore + */ + +function handleTimestampOption(arg, prop) { + if (arg == null) { + return null; + } + + if (typeof arg === 'boolean') { + return prop; + } + if (typeof arg[prop] === 'boolean') { + return arg[prop] ? prop : null; + } + if (!(prop in arg)) { + return prop; + } + return arg[prop]; +} \ No newline at end of file diff --git a/node_modules/mongoose/lib/helpers/schema/idGetter.js b/node_modules/mongoose/lib/helpers/schema/idGetter.js new file mode 100644 index 000000000..5a0741773 --- /dev/null +++ b/node_modules/mongoose/lib/helpers/schema/idGetter.js @@ -0,0 +1,31 @@ +'use strict'; + +/*! + * ignore + */ + +module.exports = function addIdGetter(schema) { + // ensure the documents receive an id getter unless disabled + const autoIdGetter = !schema.paths['id'] && + schema.paths['_id'] && + schema.options.id; + if (!autoIdGetter) { + return schema; + } + + schema.virtual('id').get(idGetter); + + return schema; +}; + +/*! + * Returns this documents _id cast to a string. + */ + +function idGetter() { + if (this._id != null) { + return String(this._id); + } + + return null; +} diff --git a/node_modules/mongoose/lib/helpers/schema/merge.js b/node_modules/mongoose/lib/helpers/schema/merge.js new file mode 100644 index 000000000..edc5175ee --- /dev/null +++ b/node_modules/mongoose/lib/helpers/schema/merge.js @@ -0,0 +1,27 @@ +'use strict'; + +module.exports = function merge(s1, s2, skipConflictingPaths) { + const paths = Object.keys(s2.tree); + const pathsToAdd = {}; + for (const key of paths) { + if (skipConflictingPaths && (s1.paths[key] || s1.nested[key] || s1.singleNestedPaths[key])) { + continue; + } + pathsToAdd[key] = s2.tree[key]; + } + s1.add(pathsToAdd); + + s1.callQueue = s1.callQueue.concat(s2.callQueue); + s1.method(s2.methods); + s1.static(s2.statics); + + for (const query in s2.query) { + s1.query[query] = s2.query[query]; + } + + for (const virtual in s2.virtuals) { + s1.virtuals[virtual] = s2.virtuals[virtual].clone(); + } + + s1.s.hooks.merge(s2.s.hooks, false); +}; diff --git a/node_modules/mongoose/lib/helpers/schematype/handleImmutable.js b/node_modules/mongoose/lib/helpers/schematype/handleImmutable.js new file mode 100644 index 000000000..cc22c9149 --- /dev/null +++ b/node_modules/mongoose/lib/helpers/schematype/handleImmutable.js @@ -0,0 +1,50 @@ +'use strict'; + +const StrictModeError = require('../../error/strict'); + +/*! + * ignore + */ + +module.exports = function(schematype) { + if (schematype.$immutable) { + schematype.$immutableSetter = createImmutableSetter(schematype.path, + schematype.options.immutable); + schematype.set(schematype.$immutableSetter); + } else if (schematype.$immutableSetter) { + schematype.setters = schematype.setters. + filter(fn => fn !== schematype.$immutableSetter); + delete schematype.$immutableSetter; + } +}; + +function createImmutableSetter(path, immutable) { + return function immutableSetter(v, _priorVal, _doc, options) { + if (this == null || this.$__ == null) { + return v; + } + if (this.isNew) { + return v; + } + if (options && options.overwriteImmutable) { + return v; + } + + const _immutable = typeof immutable === 'function' ? + immutable.call(this, this) : + immutable; + if (!_immutable) { + return v; + } + + const _value = this.$__.priorDoc != null ? + this.$__.priorDoc.$__getValue(path) : + this.$__getValue(path); + if (this.$__.strictMode === 'throw' && v !== _value) { + throw new StrictModeError(path, 'Path `' + path + '` is immutable ' + + 'and strict mode is set to throw.', true); + } + + return _value; + }; +} diff --git a/node_modules/mongoose/lib/helpers/setDefaultsOnInsert.js b/node_modules/mongoose/lib/helpers/setDefaultsOnInsert.js new file mode 100644 index 000000000..50aec3950 --- /dev/null +++ b/node_modules/mongoose/lib/helpers/setDefaultsOnInsert.js @@ -0,0 +1,117 @@ +'use strict'; +const modifiedPaths = require('./common').modifiedPaths; +const get = require('./get'); + +/** + * Applies defaults to update and findOneAndUpdate operations. + * + * @param {Object} filter + * @param {Schema} schema + * @param {Object} castedDoc + * @param {Object} options + * @method setDefaultsOnInsert + * @api private + */ + +module.exports = function(filter, schema, castedDoc, options) { + options = options || {}; + + const shouldSetDefaultsOnInsert = + options.setDefaultsOnInsert != null ? + options.setDefaultsOnInsert : + schema.base.options.setDefaultsOnInsert; + + if (!options.upsert || shouldSetDefaultsOnInsert === false) { + return castedDoc; + } + + const keys = Object.keys(castedDoc || {}); + const updatedKeys = {}; + const updatedValues = {}; + const numKeys = keys.length; + const modified = {}; + + let hasDollarUpdate = false; + + for (let i = 0; i < numKeys; ++i) { + if (keys[i].startsWith('$')) { + modifiedPaths(castedDoc[keys[i]], '', modified); + hasDollarUpdate = true; + } + } + + if (!hasDollarUpdate) { + modifiedPaths(castedDoc, '', modified); + } + + const paths = Object.keys(filter); + const numPaths = paths.length; + for (let i = 0; i < numPaths; ++i) { + const path = paths[i]; + const condition = filter[path]; + if (condition && typeof condition === 'object') { + const conditionKeys = Object.keys(condition); + const numConditionKeys = conditionKeys.length; + let hasDollarKey = false; + for (let j = 0; j < numConditionKeys; ++j) { + if (conditionKeys[j].startsWith('$')) { + hasDollarKey = true; + break; + } + } + if (hasDollarKey) { + continue; + } + } + updatedKeys[path] = true; + modified[path] = true; + } + + if (options && options.overwrite && !hasDollarUpdate) { + // Defaults will be set later, since we're overwriting we'll cast + // the whole update to a document + return castedDoc; + } + + schema.eachPath(function(path, schemaType) { + // Skip single nested paths if underneath a map + if (schemaType.path === '_id' && schemaType.options.auto) { + return; + } + const def = schemaType.getDefault(null, true); + if (isModified(modified, path)) { + return; + } + if (typeof def === 'undefined') { + return; + } + if (schemaType.splitPath().includes('$*')) { + // Skip defaults underneath maps. We should never do `$setOnInsert` on a path with `$*` + return; + } + + castedDoc = castedDoc || {}; + castedDoc.$setOnInsert = castedDoc.$setOnInsert || {}; + if (get(castedDoc, path) == null) { + castedDoc.$setOnInsert[path] = def; + } + updatedValues[path] = def; + }); + + return castedDoc; +}; + +function isModified(modified, path) { + if (modified[path]) { + return true; + } + const sp = path.split('.'); + let cur = sp[0]; + for (let i = 1; i < sp.length; ++i) { + if (modified[cur]) { + return true; + } + cur += '.' + sp[i]; + } + return false; +} diff --git a/node_modules/mongoose/lib/helpers/specialProperties.js b/node_modules/mongoose/lib/helpers/specialProperties.js new file mode 100644 index 000000000..1e1aca50a --- /dev/null +++ b/node_modules/mongoose/lib/helpers/specialProperties.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = new Set(['__proto__', 'constructor', 'prototype']); \ No newline at end of file diff --git a/node_modules/mongoose/lib/helpers/symbols.js b/node_modules/mongoose/lib/helpers/symbols.js new file mode 100644 index 000000000..7e323e285 --- /dev/null +++ b/node_modules/mongoose/lib/helpers/symbols.js @@ -0,0 +1,20 @@ +'use strict'; + +exports.arrayAtomicsBackupSymbol = Symbol('mongoose#Array#atomicsBackup'); +exports.arrayAtomicsSymbol = Symbol('mongoose#Array#_atomics'); +exports.arrayParentSymbol = Symbol('mongoose#Array#_parent'); +exports.arrayPathSymbol = Symbol('mongoose#Array#_path'); +exports.arraySchemaSymbol = Symbol('mongoose#Array#_schema'); +exports.documentArrayParent = Symbol('mongoose:documentArrayParent'); +exports.documentIsSelected = Symbol('mongoose#Document#isSelected'); +exports.documentIsModified = Symbol('mongoose#Document#isModified'); +exports.documentModifiedPaths = Symbol('mongoose#Document#modifiedPaths'); +exports.documentSchemaSymbol = Symbol('mongoose#Document#schema'); +exports.getSymbol = Symbol('mongoose#Document#get'); +exports.modelSymbol = Symbol('mongoose#Model'); +exports.objectIdSymbol = Symbol('mongoose#ObjectId'); +exports.populateModelSymbol = Symbol('mongoose.PopulateOptions#Model'); +exports.schemaTypeSymbol = Symbol('mongoose#schemaType'); +exports.sessionNewDocuments = Symbol('mongoose:ClientSession#newDocuments'); +exports.scopeSymbol = Symbol('mongoose#Document#scope'); +exports.validatorErrorSymbol = Symbol('mongoose:validatorError'); \ No newline at end of file diff --git a/node_modules/mongoose/lib/helpers/timers.js b/node_modules/mongoose/lib/helpers/timers.js new file mode 100644 index 000000000..7bd09c741 --- /dev/null +++ b/node_modules/mongoose/lib/helpers/timers.js @@ -0,0 +1,3 @@ +'use strict'; + +exports.setTimeout = setTimeout; \ No newline at end of file diff --git a/node_modules/mongoose/lib/helpers/timestamps/setupTimestamps.js b/node_modules/mongoose/lib/helpers/timestamps/setupTimestamps.js new file mode 100644 index 000000000..7cd4514f0 --- /dev/null +++ b/node_modules/mongoose/lib/helpers/timestamps/setupTimestamps.js @@ -0,0 +1,105 @@ +'use strict'; + +const applyTimestampsToChildren = require('../update/applyTimestampsToChildren'); +const applyTimestampsToUpdate = require('../update/applyTimestampsToUpdate'); +const get = require('../get'); +const handleTimestampOption = require('../schema/handleTimestampOption'); +const symbols = require('../../schema/symbols'); + +module.exports = function setupTimestamps(schema, timestamps) { + const childHasTimestamp = schema.childSchemas.find(withTimestamp); + function withTimestamp(s) { + const ts = s.schema.options.timestamps; + return !!ts; + } + + if (!timestamps && !childHasTimestamp) { + return; + } + + const createdAt = handleTimestampOption(timestamps, 'createdAt'); + const updatedAt = handleTimestampOption(timestamps, 'updatedAt'); + const currentTime = timestamps != null && timestamps.hasOwnProperty('currentTime') ? + timestamps.currentTime : + null; + const schemaAdditions = {}; + + schema.$timestamps = { createdAt: createdAt, updatedAt: updatedAt }; + + if (updatedAt && !schema.paths[updatedAt]) { + schemaAdditions[updatedAt] = Date; + } + + if (createdAt && !schema.paths[createdAt]) { + const baseImmutableCreatedAt = schema.base.get('timestamps.createdAt.immutable'); + const immutable = baseImmutableCreatedAt != null ? baseImmutableCreatedAt : true; + schemaAdditions[createdAt] = { [schema.options.typeKey || 'type']: Date, immutable }; + } + + schema.add(schemaAdditions); + + schema.pre('save', function(next) { + const timestampOption = get(this, '$__.saveOptions.timestamps'); + if (timestampOption === false) { + return next(); + } + + const skipUpdatedAt = timestampOption != null && timestampOption.updatedAt === false; + const skipCreatedAt = timestampOption != null && timestampOption.createdAt === false; + + const defaultTimestamp = currentTime != null ? + currentTime() : + this.ownerDocument().constructor.base.now(); + + if (!skipCreatedAt && (this.isNew || this.$isSubdocument) && createdAt && !this.$__getValue(createdAt) && this.$__isSelected(createdAt)) { + this.$set(createdAt, defaultTimestamp, undefined, { overwriteImmutable: true }); + } + + if (!skipUpdatedAt && updatedAt && (this.isNew || this.$isModified())) { + let ts = defaultTimestamp; + if (this.isNew && createdAt != null) { + ts = this.$__getValue(createdAt); + } + this.$set(updatedAt, ts); + } + + next(); + }); + + schema.methods.initializeTimestamps = function() { + const ts = currentTime != null ? + currentTime() : + this.constructor.base.now(); + if (createdAt && !this.get(createdAt)) { + this.$set(createdAt, ts); + } + if (updatedAt && !this.get(updatedAt)) { + this.$set(updatedAt, ts); + } + return this; + }; + + _setTimestampsOnUpdate[symbols.builtInMiddleware] = true; + + const opts = { query: true, model: false }; + schema.pre('findOneAndReplace', opts, _setTimestampsOnUpdate); + schema.pre('findOneAndUpdate', opts, _setTimestampsOnUpdate); + schema.pre('replaceOne', opts, _setTimestampsOnUpdate); + schema.pre('update', opts, _setTimestampsOnUpdate); + schema.pre('updateOne', opts, _setTimestampsOnUpdate); + schema.pre('updateMany', opts, _setTimestampsOnUpdate); + + function _setTimestampsOnUpdate(next) { + const now = currentTime != null ? + currentTime() : + this.model.base.now(); + // Replacing with null update should still trigger timestamps + if (this.op === 'findOneAndReplace' && this.getUpdate() == null) { + this.setUpdate({}); + } + applyTimestampsToUpdate(now, createdAt, updatedAt, this.getUpdate(), + this.options, this.schema); + applyTimestampsToChildren(now, this.getUpdate(), this.model.schema); + next(); + } +}; \ No newline at end of file diff --git a/node_modules/mongoose/lib/helpers/topology/allServersUnknown.js b/node_modules/mongoose/lib/helpers/topology/allServersUnknown.js new file mode 100644 index 000000000..33d23ab3e --- /dev/null +++ b/node_modules/mongoose/lib/helpers/topology/allServersUnknown.js @@ -0,0 +1,12 @@ +'use strict'; + +const getConstructorName = require('../getConstructorName'); + +module.exports = function allServersUnknown(topologyDescription) { + if (getConstructorName(topologyDescription) !== 'TopologyDescription') { + return false; + } + + const servers = Array.from(topologyDescription.servers.values()); + return servers.length > 0 && servers.every(server => server.type === 'Unknown'); +}; \ No newline at end of file diff --git a/node_modules/mongoose/lib/helpers/topology/isAtlas.js b/node_modules/mongoose/lib/helpers/topology/isAtlas.js new file mode 100644 index 000000000..8d4ae23c8 --- /dev/null +++ b/node_modules/mongoose/lib/helpers/topology/isAtlas.js @@ -0,0 +1,26 @@ +'use strict'; + +const getConstructorName = require('../getConstructorName'); + +module.exports = function isAtlas(topologyDescription) { + if (getConstructorName(topologyDescription) !== 'TopologyDescription') { + return false; + } + + const hostnames = Array.from(topologyDescription.servers.keys()); + + if (hostnames.length === 0) { + return false; + } + + for (let i = 0, il = hostnames.length; i < il; ++i) { + const url = new URL(hostnames[i]); + if ( + url.hostname.endsWith('.mongodb.net') === false || + url.port !== '27017' + ) { + return false; + } + } + return true; +}; \ No newline at end of file diff --git a/node_modules/mongoose/lib/helpers/topology/isSSLError.js b/node_modules/mongoose/lib/helpers/topology/isSSLError.js new file mode 100644 index 000000000..d910fc834 --- /dev/null +++ b/node_modules/mongoose/lib/helpers/topology/isSSLError.js @@ -0,0 +1,16 @@ +'use strict'; + +const getConstructorName = require('../getConstructorName'); + +const nonSSLMessage = 'Client network socket disconnected before secure TLS ' + + 'connection was established'; + +module.exports = function isSSLError(topologyDescription) { + if (getConstructorName(topologyDescription) !== 'TopologyDescription') { + return false; + } + + const descriptions = Array.from(topologyDescription.servers.values()); + return descriptions.length > 0 && + descriptions.every(descr => descr.error && descr.error.message.indexOf(nonSSLMessage) !== -1); +}; \ No newline at end of file diff --git a/node_modules/mongoose/lib/helpers/update/applyTimestampsToChildren.js b/node_modules/mongoose/lib/helpers/update/applyTimestampsToChildren.js new file mode 100644 index 000000000..3e195c5a9 --- /dev/null +++ b/node_modules/mongoose/lib/helpers/update/applyTimestampsToChildren.js @@ -0,0 +1,189 @@ +'use strict'; + +const cleanPositionalOperators = require('../schema/cleanPositionalOperators'); +const handleTimestampOption = require('../schema/handleTimestampOption'); + +module.exports = applyTimestampsToChildren; + +/*! + * ignore + */ + +function applyTimestampsToChildren(now, update, schema) { + if (update == null) { + return; + } + + const keys = Object.keys(update); + const hasDollarKey = keys.some(key => key[0] === '$'); + + if (hasDollarKey) { + if (update.$push) { + _applyTimestampToUpdateOperator(update.$push); + } + if (update.$addToSet) { + _applyTimestampToUpdateOperator(update.$addToSet); + } + if (update.$set != null) { + const keys = Object.keys(update.$set); + for (const key of keys) { + applyTimestampsToUpdateKey(schema, key, update.$set, now); + } + } + if (update.$setOnInsert != null) { + const keys = Object.keys(update.$setOnInsert); + for (const key of keys) { + applyTimestampsToUpdateKey(schema, key, update.$setOnInsert, now); + } + } + } + + const updateKeys = Object.keys(update).filter(key => key[0] !== '$'); + for (const key of updateKeys) { + applyTimestampsToUpdateKey(schema, key, update, now); + } + + function _applyTimestampToUpdateOperator(op) { + for (const key of Object.keys(op)) { + const $path = schema.path(key.replace(/\.\$\./i, '.').replace(/.\$$/, '')); + if (op[key] && + $path && + $path.$isMongooseDocumentArray && + $path.schema.options.timestamps) { + const timestamps = $path.schema.options.timestamps; + const createdAt = handleTimestampOption(timestamps, 'createdAt'); + const updatedAt = handleTimestampOption(timestamps, 'updatedAt'); + if (op[key].$each) { + op[key].$each.forEach(function(subdoc) { + if (updatedAt != null) { + subdoc[updatedAt] = now; + } + if (createdAt != null) { + subdoc[createdAt] = now; + } + + applyTimestampsToChildren(now, subdoc, $path.schema); + }); + } else { + if (updatedAt != null) { + op[key][updatedAt] = now; + } + if (createdAt != null) { + op[key][createdAt] = now; + } + + applyTimestampsToChildren(now, op[key], $path.schema); + } + } + } + } +} + +function applyTimestampsToDocumentArray(arr, schematype, now) { + const timestamps = schematype.schema.options.timestamps; + + if (!timestamps) { + return; + } + + const len = arr.length; + + const createdAt = handleTimestampOption(timestamps, 'createdAt'); + const updatedAt = handleTimestampOption(timestamps, 'updatedAt'); + for (let i = 0; i < len; ++i) { + if (updatedAt != null) { + arr[i][updatedAt] = now; + } + if (createdAt != null) { + arr[i][createdAt] = now; + } + + applyTimestampsToChildren(now, arr[i], schematype.schema); + } +} + +function applyTimestampsToSingleNested(subdoc, schematype, now) { + const timestamps = schematype.schema.options.timestamps; + if (!timestamps) { + return; + } + + const createdAt = handleTimestampOption(timestamps, 'createdAt'); + const updatedAt = handleTimestampOption(timestamps, 'updatedAt'); + if (updatedAt != null) { + subdoc[updatedAt] = now; + } + if (createdAt != null) { + subdoc[createdAt] = now; + } + + applyTimestampsToChildren(now, subdoc, schematype.schema); +} + +function applyTimestampsToUpdateKey(schema, key, update, now) { + // Replace positional operator `$` and array filters `$[]` and `$[.*]` + const keyToSearch = cleanPositionalOperators(key); + const path = schema.path(keyToSearch); + if (!path) { + return; + } + + const parentSchemaTypes = []; + const pieces = keyToSearch.split('.'); + for (let i = pieces.length - 1; i > 0; --i) { + const s = schema.path(pieces.slice(0, i).join('.')); + if (s != null && + (s.$isMongooseDocumentArray || s.$isSingleNested)) { + parentSchemaTypes.push({ parentPath: key.split('.').slice(0, i).join('.'), parentSchemaType: s }); + } + } + + if (Array.isArray(update[key]) && path.$isMongooseDocumentArray) { + applyTimestampsToDocumentArray(update[key], path, now); + } else if (update[key] && path.$isSingleNested) { + applyTimestampsToSingleNested(update[key], path, now); + } else if (parentSchemaTypes.length > 0) { + for (const item of parentSchemaTypes) { + const parentPath = item.parentPath; + const parentSchemaType = item.parentSchemaType; + const timestamps = parentSchemaType.schema.options.timestamps; + const updatedAt = handleTimestampOption(timestamps, 'updatedAt'); + + if (!timestamps || updatedAt == null) { + continue; + } + + if (parentSchemaType.$isSingleNested) { + // Single nested is easy + update[parentPath + '.' + updatedAt] = now; + } else if (parentSchemaType.$isMongooseDocumentArray) { + let childPath = key.substring(parentPath.length + 1); + + if (/^\d+$/.test(childPath)) { + update[parentPath + '.' + childPath][updatedAt] = now; + continue; + } + + const firstDot = childPath.indexOf('.'); + childPath = firstDot !== -1 ? childPath.substring(0, firstDot) : childPath; + + update[parentPath + '.' + childPath + '.' + updatedAt] = now; + } + } + } else if (path.schema != null && path.schema != schema && update[key]) { + const timestamps = path.schema.options.timestamps; + const createdAt = handleTimestampOption(timestamps, 'createdAt'); + const updatedAt = handleTimestampOption(timestamps, 'updatedAt'); + + if (!timestamps) { + return; + } + + if (updatedAt != null) { + update[key][updatedAt] = now; + } + if (createdAt != null) { + update[key][createdAt] = now; + } + } +} \ No newline at end of file diff --git a/node_modules/mongoose/lib/helpers/update/applyTimestampsToUpdate.js b/node_modules/mongoose/lib/helpers/update/applyTimestampsToUpdate.js new file mode 100644 index 000000000..3c48f965b --- /dev/null +++ b/node_modules/mongoose/lib/helpers/update/applyTimestampsToUpdate.js @@ -0,0 +1,117 @@ +'use strict'; + +/*! + * ignore + */ + +const get = require('../get'); + +module.exports = applyTimestampsToUpdate; + +/*! + * ignore + */ + +function applyTimestampsToUpdate(now, createdAt, updatedAt, currentUpdate, options) { + const updates = currentUpdate; + let _updates = updates; + const overwrite = get(options, 'overwrite', false); + const timestamps = get(options, 'timestamps', true); + + // Support skipping timestamps at the query level, see gh-6980 + if (!timestamps || updates == null) { + return currentUpdate; + } + + const skipCreatedAt = timestamps != null && timestamps.createdAt === false; + const skipUpdatedAt = timestamps != null && timestamps.updatedAt === false; + + if (overwrite) { + if (currentUpdate && currentUpdate.$set) { + currentUpdate = currentUpdate.$set; + updates.$set = {}; + _updates = updates.$set; + } + if (!skipUpdatedAt && updatedAt && !currentUpdate[updatedAt]) { + _updates[updatedAt] = now; + } + if (!skipCreatedAt && createdAt && !currentUpdate[createdAt]) { + _updates[createdAt] = now; + } + return updates; + } + currentUpdate = currentUpdate || {}; + + if (Array.isArray(updates)) { + // Update with aggregation pipeline + updates.push({ $set: { [updatedAt]: now } }); + + return updates; + } + + updates.$set = updates.$set || {}; + if (!skipUpdatedAt && updatedAt && + (!currentUpdate.$currentDate || !currentUpdate.$currentDate[updatedAt])) { + let timestampSet = false; + if (updatedAt.indexOf('.') !== -1) { + const pieces = updatedAt.split('.'); + for (let i = 1; i < pieces.length; ++i) { + const remnant = pieces.slice(-i).join('.'); + const start = pieces.slice(0, -i).join('.'); + if (currentUpdate[start] != null) { + currentUpdate[start][remnant] = now; + timestampSet = true; + break; + } else if (currentUpdate.$set && currentUpdate.$set[start]) { + currentUpdate.$set[start][remnant] = now; + timestampSet = true; + break; + } + } + } + + if (!timestampSet) { + updates.$set[updatedAt] = now; + } + + if (updates.hasOwnProperty(updatedAt)) { + delete updates[updatedAt]; + } + } + + if (!skipCreatedAt && createdAt) { + if (currentUpdate[createdAt]) { + delete currentUpdate[createdAt]; + } + if (currentUpdate.$set && currentUpdate.$set[createdAt]) { + delete currentUpdate.$set[createdAt]; + } + let timestampSet = false; + if (createdAt.indexOf('.') !== -1) { + const pieces = createdAt.split('.'); + for (let i = 1; i < pieces.length; ++i) { + const remnant = pieces.slice(-i).join('.'); + const start = pieces.slice(0, -i).join('.'); + if (currentUpdate[start] != null) { + currentUpdate[start][remnant] = now; + timestampSet = true; + break; + } else if (currentUpdate.$set && currentUpdate.$set[start]) { + currentUpdate.$set[start][remnant] = now; + timestampSet = true; + break; + } + } + } + + if (!timestampSet) { + updates.$setOnInsert = updates.$setOnInsert || {}; + updates.$setOnInsert[createdAt] = now; + } + } + + if (Object.keys(updates.$set).length === 0) { + delete updates.$set; + } + return updates; +} diff --git a/node_modules/mongoose/lib/helpers/update/castArrayFilters.js b/node_modules/mongoose/lib/helpers/update/castArrayFilters.js new file mode 100644 index 000000000..7637f758b --- /dev/null +++ b/node_modules/mongoose/lib/helpers/update/castArrayFilters.js @@ -0,0 +1,83 @@ +'use strict'; + +const castFilterPath = require('../query/castFilterPath'); +const cleanPositionalOperators = require('../schema/cleanPositionalOperators'); +const getPath = require('../schema/getPath'); +const updatedPathsByArrayFilter = require('./updatedPathsByArrayFilter'); + +module.exports = function castArrayFilters(query) { + const arrayFilters = query.options.arrayFilters; + const update = query.getUpdate(); + const schema = query.schema; + const updatedPathsByFilter = updatedPathsByArrayFilter(update); + + let strictQuery = schema.options.strict; + if (query._mongooseOptions.strict != null) { + strictQuery = query._mongooseOptions.strict; + } + if (query.model && query.model.base.options.strictQuery != null) { + strictQuery = query.model.base.options.strictQuery; + } + if (schema._userProvidedOptions.strictQuery != null) { + strictQuery = schema._userProvidedOptions.strictQuery; + } + if (query._mongooseOptions.strictQuery != null) { + strictQuery = query._mongooseOptions.strictQuery; + } + + _castArrayFilters(arrayFilters, schema, strictQuery, updatedPathsByFilter, query); +}; + +function _castArrayFilters(arrayFilters, schema, strictQuery, updatedPathsByFilter, query) { + if (!Array.isArray(arrayFilters)) { + return; + } + + for (const filter of arrayFilters) { + if (filter == null) { + throw new Error(`Got null array filter in ${arrayFilters}`); + } + for (const key of Object.keys(filter)) { + if (key === '$and' || key === '$or') { + _castArrayFilters(filter[key], schema, strictQuery, updatedPathsByFilter, query); + continue; + } + if (filter[key] == null) { + continue; + } + if (updatedPathsByFilter[key] === null) { + continue; + } + if (Object.keys(updatedPathsByFilter).length === 0) { + continue; + } + const dot = key.indexOf('.'); + let filterPath = dot === -1 ? + updatedPathsByFilter[key] + '.0' : + updatedPathsByFilter[key.substring(0, dot)] + '.0' + key.substring(dot); + if (filterPath == null) { + throw new Error(`Filter path not found for ${key}`); + } + + // If there are multiple array filters in the path being updated, make sure + // to replace them so we can get the schema path. + filterPath = cleanPositionalOperators(filterPath); + const schematype = getPath(schema, filterPath); + if (schematype == null) { + if (!strictQuery) { + return; + } + // For now, treat `strictQuery = true` and `strictQuery = 'throw'` as + // equivalent for casting array filters. `strictQuery = true` doesn't + // quite work in this context because we never want to silently strip out + // array filters, even if the path isn't in the schema. + throw new Error(`Could not find path "${filterPath}" in schema`); + } + if (typeof filter[key] === 'object') { + filter[key] = castFilterPath(query, schematype, filter[key]); + } else { + filter[key] = schematype.castForQuery(filter[key]); + } + } + } +} \ No newline at end of file diff --git a/node_modules/mongoose/lib/helpers/update/modifiedPaths.js b/node_modules/mongoose/lib/helpers/update/modifiedPaths.js new file mode 100644 index 000000000..9cb567d5a --- /dev/null +++ b/node_modules/mongoose/lib/helpers/update/modifiedPaths.js @@ -0,0 +1,33 @@ +'use strict'; + +const _modifiedPaths = require('../common').modifiedPaths; + +/** + * Given an update document with potential update operators (`$set`, etc.) + * returns an object whose keys are the directly modified paths. + * + * If there are any top-level keys that don't start with `$`, we assume those + * will get wrapped in a `$set`. The Mongoose Query is responsible for wrapping + * top-level keys in `$set`. + * + * @param {Object} update + * @return {Object} modified + */ + +module.exports = function modifiedPaths(update) { + const keys = Object.keys(update); + const res = {}; + + const withoutDollarKeys = {}; + for (const key of keys) { + if (key.startsWith('$')) { + _modifiedPaths(update[key], '', res); + continue; + } + withoutDollarKeys[key] = update[key]; + } + + _modifiedPaths(withoutDollarKeys, '', res); + + return res; +}; diff --git a/node_modules/mongoose/lib/helpers/update/moveImmutableProperties.js b/node_modules/mongoose/lib/helpers/update/moveImmutableProperties.js new file mode 100644 index 000000000..8541c5bd2 --- /dev/null +++ b/node_modules/mongoose/lib/helpers/update/moveImmutableProperties.js @@ -0,0 +1,53 @@ +'use strict'; + +const get = require('../get'); + +/** + * Given an update, move all $set on immutable properties to $setOnInsert. + * This should only be called for upserts, because $setOnInsert bypasses the + * strictness check for immutable properties. + */ + +module.exports = function moveImmutableProperties(schema, update, ctx) { + if (update == null) { + return; + } + + const keys = Object.keys(update); + for (const key of keys) { + const isDollarKey = key.startsWith('$'); + + if (key === '$set') { + const updatedPaths = Object.keys(update[key]); + for (const path of updatedPaths) { + _walkUpdatePath(schema, update[key], path, update, ctx); + } + } else if (!isDollarKey) { + _walkUpdatePath(schema, update, key, update, ctx); + } + + } +}; + +function _walkUpdatePath(schema, op, path, update, ctx) { + const schematype = schema.path(path); + if (schematype == null) { + return; + } + + let immutable = get(schematype, 'options.immutable', null); + if (immutable == null) { + return; + } + if (typeof immutable === 'function') { + immutable = immutable.call(ctx, ctx); + } + + if (!immutable) { + return; + } + + update.$setOnInsert = update.$setOnInsert || {}; + update.$setOnInsert[path] = op[path]; + delete op[path]; +} \ No newline at end of file diff --git a/node_modules/mongoose/lib/helpers/update/removeUnusedArrayFilters.js b/node_modules/mongoose/lib/helpers/update/removeUnusedArrayFilters.js new file mode 100644 index 000000000..6a52f9166 --- /dev/null +++ b/node_modules/mongoose/lib/helpers/update/removeUnusedArrayFilters.js @@ -0,0 +1,32 @@ +'use strict'; + +/** + * MongoDB throws an error if there's unused array filters. That is, if `options.arrayFilters` defines + * a filter, but none of the `update` keys use it. This should be enough to filter out all unused array + * filters. + */ + +module.exports = function removeUnusedArrayFilters(update, arrayFilters) { + const updateKeys = Object.keys(update). + map(key => Object.keys(update[key])). + reduce((cur, arr) => cur.concat(arr), []); + return arrayFilters.filter(obj => { + return _checkSingleFilterKey(obj, updateKeys); + }); +}; + +function _checkSingleFilterKey(arrayFilter, updateKeys) { + const firstKey = Object.keys(arrayFilter)[0]; + + if (firstKey === '$and' || firstKey === '$or') { + if (!Array.isArray(arrayFilter[firstKey])) { + return false; + } + return arrayFilter[firstKey].find(filter => _checkSingleFilterKey(filter, updateKeys)) != null; + } + + const firstDot = firstKey.indexOf('.'); + const arrayFilterKey = firstDot === -1 ? firstKey : firstKey.slice(0, firstDot); + + return updateKeys.find(key => key.includes('$[' + arrayFilterKey + ']')) != null; +} \ No newline at end of file diff --git a/node_modules/mongoose/lib/helpers/update/updatedPathsByArrayFilter.js b/node_modules/mongoose/lib/helpers/update/updatedPathsByArrayFilter.js new file mode 100644 index 000000000..1084cc44b --- /dev/null +++ b/node_modules/mongoose/lib/helpers/update/updatedPathsByArrayFilter.js @@ -0,0 +1,27 @@ +'use strict'; + +const modifiedPaths = require('./modifiedPaths'); + +module.exports = function updatedPathsByArrayFilter(update) { + if (update == null) { + return {}; + } + const updatedPaths = modifiedPaths(update); + + return Object.keys(updatedPaths).reduce((cur, path) => { + const matches = path.match(/\$\[[^\]]+\]/g); + if (matches == null) { + return cur; + } + for (const match of matches) { + const firstMatch = path.indexOf(match); + if (firstMatch !== path.lastIndexOf(match)) { + throw new Error(`Path '${path}' contains the same array filter multiple times`); + } + cur[match.substring(2, match.length - 1)] = path. + substring(0, firstMatch - 1). + replace(/\$\[[^\]]+\]/g, '0'); + } + return cur; + }, {}); +}; \ No newline at end of file diff --git a/node_modules/mongoose/lib/helpers/updateValidators.js b/node_modules/mongoose/lib/helpers/updateValidators.js new file mode 100644 index 000000000..176eff26e --- /dev/null +++ b/node_modules/mongoose/lib/helpers/updateValidators.js @@ -0,0 +1,249 @@ +'use strict'; + +/*! + * Module dependencies. + */ + +const ValidationError = require('../error/validation'); +const cleanPositionalOperators = require('./schema/cleanPositionalOperators'); +const flatten = require('./common').flatten; +const modifiedPaths = require('./common').modifiedPaths; + +/** + * Applies validators and defaults to update and findOneAndUpdate operations, + * specifically passing a null doc as `this` to validators and defaults + * + * @param {Query} query + * @param {Schema} schema + * @param {Object} castedDoc + * @param {Object} options + * @method runValidatorsOnUpdate + * @api private + */ + +module.exports = function(query, schema, castedDoc, options, callback) { + const keys = Object.keys(castedDoc || {}); + let updatedKeys = {}; + let updatedValues = {}; + const isPull = {}; + const arrayAtomicUpdates = {}; + const numKeys = keys.length; + let hasDollarUpdate = false; + const modified = {}; + let currentUpdate; + let key; + let i; + + for (i = 0; i < numKeys; ++i) { + if (keys[i].startsWith('$')) { + hasDollarUpdate = true; + if (keys[i] === '$push' || keys[i] === '$addToSet') { + const _keys = Object.keys(castedDoc[keys[i]]); + for (let ii = 0; ii < _keys.length; ++ii) { + currentUpdate = castedDoc[keys[i]][_keys[ii]]; + if (currentUpdate && currentUpdate.$each) { + arrayAtomicUpdates[_keys[ii]] = (arrayAtomicUpdates[_keys[ii]] || []). + concat(currentUpdate.$each); + } else { + arrayAtomicUpdates[_keys[ii]] = (arrayAtomicUpdates[_keys[ii]] || []). + concat([currentUpdate]); + } + } + continue; + } + modifiedPaths(castedDoc[keys[i]], '', modified); + const flat = flatten(castedDoc[keys[i]], null, null, schema); + const paths = Object.keys(flat); + const numPaths = paths.length; + for (let j = 0; j < numPaths; ++j) { + const updatedPath = cleanPositionalOperators(paths[j]); + key = keys[i]; + // With `$pull` we might flatten `$in`. Skip stuff nested under `$in` + // for the rest of the logic, it will get handled later. + if (updatedPath.includes('$')) { + continue; + } + if (key === '$set' || key === '$setOnInsert' || + key === '$pull' || key === '$pullAll') { + updatedValues[updatedPath] = flat[paths[j]]; + isPull[updatedPath] = key === '$pull' || key === '$pullAll'; + } else if (key === '$unset') { + updatedValues[updatedPath] = undefined; + } + updatedKeys[updatedPath] = true; + } + } + } + + if (!hasDollarUpdate) { + modifiedPaths(castedDoc, '', modified); + updatedValues = flatten(castedDoc, null, null, schema); + updatedKeys = Object.keys(updatedValues); + } + + const updates = Object.keys(updatedValues); + const numUpdates = updates.length; + const validatorsToExecute = []; + const validationErrors = []; + + const alreadyValidated = []; + + const context = query; + function iter(i, v) { + const schemaPath = schema._getSchema(updates[i]); + if (schemaPath == null) { + return; + } + if (schemaPath.instance === 'Mixed' && schemaPath.path !== updates[i]) { + return; + } + + if (v && Array.isArray(v.$in)) { + v.$in.forEach((v, i) => { + validatorsToExecute.push(function(callback) { + schemaPath.doValidate( + v, + function(err) { + if (err) { + err.path = updates[i] + '.$in.' + i; + validationErrors.push(err); + } + callback(null); + }, + context, + { updateValidator: true }); + }); + }); + } else { + if (isPull[updates[i]] && + schemaPath.$isMongooseArray) { + return; + } + + if (schemaPath.$isMongooseDocumentArrayElement && v != null && v.$__ != null) { + alreadyValidated.push(updates[i]); + validatorsToExecute.push(function(callback) { + schemaPath.doValidate(v, function(err) { + if (err) { + if (err.errors) { + for (const key of Object.keys(err.errors)) { + const _err = err.errors[key]; + _err.path = updates[i] + '.' + key; + validationErrors.push(_err); + } + } else { + err.path = updates[i]; + validationErrors.push(err); + } + } + + return callback(null); + }, context, { updateValidator: true }); + }); + } else { + validatorsToExecute.push(function(callback) { + for (const path of alreadyValidated) { + if (updates[i].startsWith(path + '.')) { + return callback(null); + } + } + + schemaPath.doValidate(v, function(err) { + if (schemaPath.schema != null && + schemaPath.schema.options.storeSubdocValidationError === false && + err instanceof ValidationError) { + return callback(null); + } + + if (err) { + err.path = updates[i]; + validationErrors.push(err); + } + callback(null); + }, context, { updateValidator: true }); + }); + } + } + } + for (i = 0; i < numUpdates; ++i) { + iter(i, updatedValues[updates[i]]); + } + + const arrayUpdates = Object.keys(arrayAtomicUpdates); + for (const arrayUpdate of arrayUpdates) { + let schemaPath = schema._getSchema(arrayUpdate); + if (schemaPath && schemaPath.$isMongooseDocumentArray) { + validatorsToExecute.push(function(callback) { + schemaPath.doValidate( + arrayAtomicUpdates[arrayUpdate], + getValidationCallback(arrayUpdate, validationErrors, callback), + options && options.context === 'query' ? query : null); + }); + } else { + schemaPath = schema._getSchema(arrayUpdate + '.0'); + for (const atomicUpdate of arrayAtomicUpdates[arrayUpdate]) { + validatorsToExecute.push(function(callback) { + schemaPath.doValidate( + atomicUpdate, + getValidationCallback(arrayUpdate, validationErrors, callback), + options && options.context === 'query' ? query : null, + { updateValidator: true }); + }); + } + } + } + + if (callback != null) { + let numValidators = validatorsToExecute.length; + if (numValidators === 0) { + return _done(callback); + } + for (const validator of validatorsToExecute) { + validator(function() { + if (--numValidators <= 0) { + _done(callback); + } + }); + } + + return; + } + + return function(callback) { + let numValidators = validatorsToExecute.length; + if (numValidators === 0) { + return _done(callback); + } + for (const validator of validatorsToExecute) { + validator(function() { + if (--numValidators <= 0) { + _done(callback); + } + }); + } + }; + + function _done(callback) { + if (validationErrors.length) { + const err = new ValidationError(null); + + for (const validationError of validationErrors) { + err.addError(validationError.path, validationError); + } + + return callback(err); + } + callback(null); + } + + function getValidationCallback(arrayUpdate, validationErrors, callback) { + return function(err) { + if (err) { + err.path = arrayUpdate; + validationErrors.push(err); + } + callback(null); + }; + } +}; + diff --git a/node_modules/mongoose/lib/index.js b/node_modules/mongoose/lib/index.js new file mode 100644 index 000000000..10f9721c3 --- /dev/null +++ b/node_modules/mongoose/lib/index.js @@ -0,0 +1,1268 @@ +'use strict'; + +/*! + * Module dependencies. + */ + +require('./driver').set(require('./drivers/node-mongodb-native')); + +const Document = require('./document'); +const EventEmitter = require('events').EventEmitter; +const Kareem = require('kareem'); +const Schema = require('./schema'); +const SchemaType = require('./schematype'); +const SchemaTypes = require('./schema/index'); +const VirtualType = require('./virtualtype'); +const STATES = require('./connectionstate'); +const VALID_OPTIONS = require('./validoptions'); +const Types = require('./types'); +const Query = require('./query'); +const Model = require('./model'); +const applyPlugins = require('./helpers/schema/applyPlugins'); +const driver = require('./driver'); +const promiseOrCallback = require('./helpers/promiseOrCallback'); +const legacyPluralize = require('./helpers/pluralize'); +const utils = require('./utils'); +const pkg = require('../package.json'); +const cast = require('./cast'); +const removeSubdocs = require('./plugins/removeSubdocs'); +const saveSubdocs = require('./plugins/saveSubdocs'); +const trackTransaction = require('./plugins/trackTransaction'); +const validateBeforeSave = require('./plugins/validateBeforeSave'); + +const Aggregate = require('./aggregate'); +const PromiseProvider = require('./promise_provider'); +const shardingPlugin = require('./plugins/sharding'); +const trusted = require('./helpers/query/trusted').trusted; +const sanitizeFilter = require('./helpers/query/sanitizeFilter'); +const isBsonType = require('./helpers/isBsonType'); +const MongooseError = require('./error/mongooseError'); + +const defaultMongooseSymbol = Symbol.for('mongoose:default'); + +require('./helpers/printJestWarning'); + +const objectIdHexRegexp = /^[0-9A-Fa-f]{24}$/; + +/** + * Mongoose constructor. + * + * The exports object of the `mongoose` module is an instance of this class. + * Most apps will only use this one instance. + * + * #### Example: + * const mongoose = require('mongoose'); + * mongoose instanceof mongoose.Mongoose; // true + * + * // Create a new Mongoose instance with its own `connect()`, `set()`, `model()`, etc. + * const m = new mongoose.Mongoose(); + * + * @api public + * @param {Object} options see [`Mongoose#set()` docs](/docs/api/mongoose.html#mongoose_Mongoose-set) + */ +function Mongoose(options) { + this.connections = []; + this.models = {}; + this.events = new EventEmitter(); + this.__driver = driver.get(); + // default global options + this.options = Object.assign({ + pluralization: true, + autoIndex: true, + autoCreate: true + }, options); + const conn = this.createConnection(); // default connection + conn.models = this.models; + + if (this.options.pluralization) { + this._pluralize = legacyPluralize; + } + + // If a user creates their own Mongoose instance, give them a separate copy + // of the `Schema` constructor so they get separate custom types. (gh-6933) + if (!options || !options[defaultMongooseSymbol]) { + const _this = this; + this.Schema = function() { + this.base = _this; + return Schema.apply(this, arguments); + }; + this.Schema.prototype = Object.create(Schema.prototype); + + Object.assign(this.Schema, Schema); + this.Schema.base = this; + this.Schema.Types = Object.assign({}, Schema.Types); + } else { + // Hack to work around babel's strange behavior with + // `import mongoose, { Schema } from 'mongoose'`. Because `Schema` is not + // an own property of a Mongoose global, Schema will be undefined. See gh-5648 + for (const key of ['Schema', 'model']) { + this[key] = Mongoose.prototype[key]; + } + } + this.Schema.prototype.base = this; + + Object.defineProperty(this, 'plugins', { + configurable: false, + enumerable: true, + writable: false, + value: [ + [saveSubdocs, { deduplicate: true }], + [validateBeforeSave, { deduplicate: true }], + [shardingPlugin, { deduplicate: true }], + [removeSubdocs, { deduplicate: true }], + [trackTransaction, { deduplicate: true }] + ] + }); +} +Mongoose.prototype.cast = cast; +/** + * Expose connection states for user-land + * + * @memberOf Mongoose + * @property STATES + * @api public + */ +Mongoose.prototype.STATES = STATES; + +/** + * Expose connection states for user-land + * + * @memberOf Mongoose + * @property ConnectionStates + * @api public + */ +Mongoose.prototype.ConnectionStates = STATES; + +/** + * Object with `get()` and `set()` containing the underlying driver this Mongoose instance + * uses to communicate with the database. A driver is a Mongoose-specific interface that defines functions + * like `find()`. + * + * @deprecated + * @memberOf Mongoose + * @property driver + * @api public + */ + +Mongoose.prototype.driver = driver; + +/** + * Overwrites the current driver used by this Mongoose instance. A driver is a + * Mongoose-specific interface that defines functions like `find()`. + * + * @memberOf Mongoose + * @method setDriver + * @api public + */ + +Mongoose.prototype.setDriver = function setDriver(driver) { + const _mongoose = this instanceof Mongoose ? this : mongoose; + + if (_mongoose.__driver === driver) { + return _mongoose; + } + + const openConnection = _mongoose.connections && _mongoose.connections.find(conn => conn.readyState !== STATES.disconnected); + if (openConnection) { + const msg = 'Cannot modify Mongoose driver if a connection is already open. ' + + 'Call `mongoose.disconnect()` before modifying the driver'; + throw new MongooseError(msg); + } + _mongoose.__driver = driver; + + const Connection = driver.getConnection(); + _mongoose.connections = [new Connection(_mongoose)]; + + return _mongoose; +}; + +/** + * Sets mongoose options + * + * #### Example: + * + * mongoose.set('test', value) // sets the 'test' option to `value` + * + * mongoose.set('debug', true) // enable logging collection methods + arguments to the console/file + * + * mongoose.set('debug', function(collectionName, methodName, ...methodArgs) {}); // use custom function to log collection methods + arguments + * + * Currently supported options are: + * - 'applyPluginsToChildSchemas': `true` by default. Set to false to skip applying global plugins to child schemas + * - 'applyPluginsToDiscriminators': `false` by default. Set to true to apply global plugins to discriminator schemas. This typically isn't necessary because plugins are applied to the base schema and discriminators copy all middleware, methods, statics, and properties from the base schema. + * - 'autoCreate': Set to `true` to make Mongoose call [`Model.createCollection()`](/docs/api/model.html#model_Model.createCollection) automatically when you create a model with `mongoose.model()` or `conn.model()`. This is useful for testing transactions, change streams, and other features that require the collection to exist. + * - 'autoIndex': `true` by default. Set to false to disable automatic index creation for all models associated with this Mongoose instance. + * - 'debug': If `true`, prints the operations mongoose sends to MongoDB to the console. If a writable stream is passed, it will log to that stream, without colorization. If a callback function is passed, it will receive the collection name, the method name, then all arguments passed to the method. For example, if you wanted to replicate the default logging, you could output from the callback `Mongoose: ${collectionName}.${methodName}(${methodArgs.join(', ')})`. + * - 'returnOriginal': If `false`, changes the default `returnOriginal` option to `findOneAndUpdate()`, `findByIdAndUpdate`, and `findOneAndReplace()` to false. This is equivalent to setting the `new` option to `true` for `findOneAndX()` calls by default. Read our [`findOneAndUpdate()` tutorial](/docs/tutorials/findoneandupdate.html) for more information. + * - 'bufferCommands': enable/disable mongoose's buffering mechanism for all connections and models + * - 'cloneSchemas': `false` by default. Set to `true` to `clone()` all schemas before compiling into a model. + * - 'debug': If `true`, prints the operations mongoose sends to MongoDB to the console. If a writable stream is passed, it will log to that stream, without colorization. If a callback function is passed, it will receive the collection name, the method name, then all arugments passed to the method. For example, if you wanted to replicate the default logging, you could output from the callback `Mongoose: ${collectionName}.${methodName}(${methodArgs.join(', ')})`. + * - 'timestamps.createdAt.immutable': `true` by default. If `false`, it will change the `createdAt` field to be [`immutable: false`](https://mongoosejs.com/docs/api/schematype.html#schematype_SchemaType-immutable) which means you can update the `createdAt` + * - 'maxTimeMS': If set, attaches [maxTimeMS](https://docs.mongodb.com/manual/reference/operator/meta/maxTimeMS/) to every query + * - 'objectIdGetter': `true` by default. Mongoose adds a getter to MongoDB ObjectId's called `_id` that returns `this` for convenience with populate. Set this to false to remove the getter. + * - 'overwriteModels': Set to `true` to default to overwriting models with the same name when calling `mongoose.model()`, as opposed to throwing an `OverwriteModelError`. + * - 'returnOriginal': If `false`, changes the default `returnOriginal` option to `findOneAndUpdate()`, `findByIdAndUpdate`, and `findOneAndReplace()` to false. This is equivalent to setting the `new` option to `true` for `findOneAndX()` calls by default. Read our [`findOneAndUpdate()` tutorial](/docs/tutorials/findoneandupdate.html) for more information. + * - 'runValidators': `false` by default. Set to true to enable [update validators](/docs/validation.html#update-validators) for all validators by default. + * - 'selectPopulatedPaths': `true` by default. Set to false to opt out of Mongoose adding all fields that you `populate()` to your `select()`. The schema-level option `selectPopulatedPaths` overwrites this one. + * - 'strict': `true` by default, may be `false`, `true`, or `'throw'`. Sets the default strict mode for schemas. + * - 'strictQuery': same value as 'strict' by default (`true`), may be `false`, `true`, or `'throw'`. Sets the default [strictQuery](/docs/guide.html#strictQuery) mode for schemas. + * - 'toJSON': `{ transform: true, flattenDecimals: true }` by default. Overwrites default objects to [`toJSON()`](/docs/api.html#document_Document-toJSON), for determining how Mongoose documents get serialized by `JSON.stringify()` + * - 'toObject': `{ transform: true, flattenDecimals: true }` by default. Overwrites default objects to [`toObject()`](/docs/api.html#document_Document-toObject) + * + * @param {String} key + * @param {String|Function|Boolean} value + * @api public + */ + +Mongoose.prototype.set = function(key, value) { + const _mongoose = this instanceof Mongoose ? this : mongoose; + + if (VALID_OPTIONS.indexOf(key) === -1) { + throw new Error(`\`${key}\` is an invalid option.`); + } + + if (arguments.length === 1) { + return _mongoose.options[key]; + } + + _mongoose.options[key] = value; + + if (key === 'objectIdGetter') { + if (value) { + Object.defineProperty(mongoose.Types.ObjectId.prototype, '_id', { + enumerable: false, + configurable: true, + get: function() { + return this; + } + }); + } else { + delete mongoose.Types.ObjectId.prototype._id; + } + } + + return _mongoose; +}; + +/** + * Gets mongoose options + * + * #### Example: + * + * mongoose.get('test') // returns the 'test' value + * + * @param {String} key + * @method get + * @api public + */ + +Mongoose.prototype.get = Mongoose.prototype.set; + +/** + * Creates a Connection instance. + * + * Each `connection` instance maps to a single database. This method is helpful when managing multiple db connections. + * + * + * _Options passed take precedence over options included in connection strings._ + * + * #### Example: + * + * // with mongodb:// URI + * db = mongoose.createConnection('mongodb://user:pass@localhost:port/database'); + * + * // and options + * const opts = { db: { native_parser: true }} + * db = mongoose.createConnection('mongodb://user:pass@localhost:port/database', opts); + * + * // replica sets + * db = mongoose.createConnection('mongodb://user:pass@localhost:port,anotherhost:port,yetanother:port/database'); + * + * // and options + * const opts = { replset: { strategy: 'ping', rs_name: 'testSet' }} + * db = mongoose.createConnection('mongodb://user:pass@localhost:port,anotherhost:port,yetanother:port/database', opts); + * + * // and options + * const opts = { server: { auto_reconnect: false }, user: 'username', pass: 'mypassword' } + * db = mongoose.createConnection('localhost', 'database', port, opts) + * + * // initialize now, connect later + * db = mongoose.createConnection(); + * db.openUri('localhost', 'database', port, [opts]); + * + * @param {String} [uri] a mongodb:// URI + * @param {Object} [options] passed down to the [MongoDB driver's `connect()` function](https://mongodb.github.io/node-mongodb-native/3.0/api/MongoClient.html), except for 4 mongoose-specific options explained below. + * @param {Boolean} [options.bufferCommands=true] Mongoose specific option. Set to false to [disable buffering](https://mongoosejs.com/docs/faq.html#callback_never_executes) on all models associated with this connection. + * @param {String} [options.dbName] The name of the database you want to use. If not provided, Mongoose uses the database name from connection string. + * @param {String} [options.user] username for authentication, equivalent to `options.auth.user`. Maintained for backwards compatibility. + * @param {String} [options.pass] password for authentication, equivalent to `options.auth.password`. Maintained for backwards compatibility. + * @param {Boolean} [options.autoIndex=true] Mongoose-specific option. Set to false to disable automatic index creation for all models associated with this connection. + * @param {Class} [options.promiseLibrary] Sets the [underlying driver's promise library](https://mongodb.github.io/node-mongodb-native/3.1/api/MongoClient.html). + * @param {Number} [options.maxPoolSize=5] The maximum number of sockets the MongoDB driver will keep open for this connection. Keep in mind that MongoDB only allows one operation per socket at a time, so you may want to increase this if you find you have a few slow queries that are blocking faster queries from proceeding. See [Slow Trains in MongoDB and Node.js](https://thecodebarbarian.com/slow-trains-in-mongodb-and-nodejs). + * @param {Number} [options.minPoolSize=1] The minimum number of sockets the MongoDB driver will keep open for this connection. Keep in mind that MongoDB only allows one operation per socket at a time, so you may want to increase this if you find you have a few slow queries that are blocking faster queries from proceeding. See [Slow Trains in MongoDB and Node.js](https://thecodebarbarian.com/slow-trains-in-mongodb-and-nodejs). + * @param {Number} [options.connectTimeoutMS=30000] How long the MongoDB driver will wait before killing a socket due to inactivity _during initial connection_. Defaults to 30000. This option is passed transparently to [Node.js' `socket#setTimeout()` function](https://nodejs.org/api/net.html#net_socket_settimeout_timeout_callback). + * @param {Number} [options.socketTimeoutMS=30000] How long the MongoDB driver will wait before killing a socket due to inactivity _after initial connection_. A socket may be inactive because of either no activity or a long-running operation. This is set to `30000` by default, you should set this to 2-3x your longest running operation if you expect some of your database operations to run longer than 20 seconds. This option is passed to [Node.js `socket#setTimeout()` function](https://nodejs.org/api/net.html#net_socket_settimeout_timeout_callback) after the MongoDB driver successfully completes. + * @param {Number} [options.family=0] Passed transparently to [Node.js' `dns.lookup()`](https://nodejs.org/api/dns.html#dns_dns_lookup_hostname_options_callback) function. May be either `0`, `4`, or `6`. `4` means use IPv4 only, `6` means use IPv6 only, `0` means try both. + * @return {Connection} the created Connection object. Connections are not thenable, so you can't do `await mongoose.createConnection()`. To await use mongoose.createConnection(uri).asPromise() instead. + * @api public + */ + +Mongoose.prototype.createConnection = function(uri, options, callback) { + const _mongoose = this instanceof Mongoose ? this : mongoose; + + const Connection = _mongoose.__driver.getConnection(); + const conn = new Connection(_mongoose); + if (typeof options === 'function') { + callback = options; + options = null; + } + _mongoose.connections.push(conn); + _mongoose.events.emit('createConnection', conn); + + if (arguments.length > 0) { + conn.openUri(uri, options, callback); + } + + return conn; +}; + +/** + * Opens the default mongoose connection. + * + * #### Example: + * + * mongoose.connect('mongodb://user:pass@localhost:port/database'); + * + * // replica sets + * const uri = 'mongodb://user:pass@localhost:port,anotherhost:port,yetanother:port/mydatabase'; + * mongoose.connect(uri); + * + * // with options + * mongoose.connect(uri, options); + * + * // optional callback that gets fired when initial connection completed + * const uri = 'mongodb://nonexistent.domain:27000'; + * mongoose.connect(uri, function(error) { + * // if error is truthy, the initial connection failed. + * }) + * + * @param {String} uri(s) + * @param {Object} [options] passed down to the [MongoDB driver's `connect()` function](https://mongodb.github.io/node-mongodb-native/3.0/api/MongoClient.html), except for 4 mongoose-specific options explained below. + * @param {Boolean} [options.bufferCommands=true] Mongoose specific option. Set to false to [disable buffering](https://mongoosejs.com/docs/faq.html#callback_never_executes) on all models associated with this connection. + * @param {Number} [options.bufferTimeoutMS=10000] Mongoose specific option. If `bufferCommands` is true, Mongoose will throw an error after `bufferTimeoutMS` if the operation is still buffered. + * @param {String} [options.dbName] The name of the database we want to use. If not provided, use database name from connection string. + * @param {String} [options.user] username for authentication, equivalent to `options.auth.user`. Maintained for backwards compatibility. + * @param {String} [options.pass] password for authentication, equivalent to `options.auth.password`. Maintained for backwards compatibility. + * @param {Number} [options.maxPoolSize=100] The maximum number of sockets the MongoDB driver will keep open for this connection. Keep in mind that MongoDB only allows one operation per socket at a time, so you may want to increase this if you find you have a few slow queries that are blocking faster queries from proceeding. See [Slow Trains in MongoDB and Node.js](https://thecodebarbarian.com/slow-trains-in-mongodb-and-nodejs). + * @param {Number} [options.minPoolSize=0] The minimum number of sockets the MongoDB driver will keep open for this connection. + * @param {Number} [options.serverSelectionTimeoutMS] If `useUnifiedTopology = true`, the MongoDB driver will try to find a server to send any given operation to, and keep retrying for `serverSelectionTimeoutMS` milliseconds before erroring out. If not set, the MongoDB driver defaults to using `30000` (30 seconds). + * @param {Number} [options.heartbeatFrequencyMS] If `useUnifiedTopology = true`, the MongoDB driver sends a heartbeat every `heartbeatFrequencyMS` to check on the status of the connection. A heartbeat is subject to `serverSelectionTimeoutMS`, so the MongoDB driver will retry failed heartbeats for up to 30 seconds by default. Mongoose only emits a `'disconnected'` event after a heartbeat has failed, so you may want to decrease this setting to reduce the time between when your server goes down and when Mongoose emits `'disconnected'`. We recommend you do **not** set this setting below 1000, too many heartbeats can lead to performance degradation. + * @param {Boolean} [options.autoIndex=true] Mongoose-specific option. Set to false to disable automatic index creation for all models associated with this connection. + * @param {Class} [options.promiseLibrary] Sets the [underlying driver's promise library](https://mongodb.github.io/node-mongodb-native/3.1/api/MongoClient.html). + * @param {Number} [options.connectTimeoutMS=30000] How long the MongoDB driver will wait before killing a socket due to inactivity _during initial connection_. Defaults to 30000. This option is passed transparently to [Node.js' `socket#setTimeout()` function](https://nodejs.org/api/net.html#net_socket_settimeout_timeout_callback). + * @param {Number} [options.socketTimeoutMS=30000] How long the MongoDB driver will wait before killing a socket due to inactivity _after initial connection_. A socket may be inactive because of either no activity or a long-running operation. This is set to `30000` by default, you should set this to 2-3x your longest running operation if you expect some of your database operations to run longer than 20 seconds. This option is passed to [Node.js `socket#setTimeout()` function](https://nodejs.org/api/net.html#net_socket_settimeout_timeout_callback) after the MongoDB driver successfully completes. + * @param {Number} [options.family=0] Passed transparently to [Node.js' `dns.lookup()`](https://nodejs.org/api/dns.html#dns_dns_lookup_hostname_options_callback) function. May be either `0`, `4`, or `6`. `4` means use IPv4 only, `6` means use IPv6 only, `0` means try both. + * @param {Boolean} [options.autoCreate=false] Set to `true` to make Mongoose automatically call `createCollection()` on every model created on this connection. + * @param {Function} [callback] + * @see Mongoose#createConnection #index_Mongoose-createConnection + * @api public + * @return {Promise} resolves to `this` if connection succeeded + */ + +Mongoose.prototype.connect = function(uri, options, callback) { + const _mongoose = this instanceof Mongoose ? this : mongoose; + const conn = _mongoose.connection; + + return _mongoose._promiseOrCallback(callback, cb => { + conn.openUri(uri, options, err => { + if (err != null) { + return cb(err); + } + return cb(null, _mongoose); + }); + }); +}; + +/** + * Runs `.close()` on all connections in parallel. + * + * @param {Function} [callback] called after all connection close, or when first error occurred. + * @return {Promise} resolves when all connections are closed, or rejects with the first error that occurred. + * @api public + */ + +Mongoose.prototype.disconnect = function(callback) { + const _mongoose = this instanceof Mongoose ? this : mongoose; + + return _mongoose._promiseOrCallback(callback, cb => { + let remaining = _mongoose.connections.length; + if (remaining <= 0) { + return cb(null); + } + _mongoose.connections.forEach(conn => { + conn.close(function(error) { + if (error) { + return cb(error); + } + if (!--remaining) { + cb(null); + } + }); + }); + }); +}; + +/** + * _Requires MongoDB >= 3.6.0._ Starts a [MongoDB session](https://docs.mongodb.com/manual/release-notes/3.6/#client-sessions) + * for benefits like causal consistency, [retryable writes](https://docs.mongodb.com/manual/core/retryable-writes/), + * and [transactions](https://thecodebarbarian.com/a-node-js-perspective-on-mongodb-4-transactions.html). + * + * Calling `mongoose.startSession()` is equivalent to calling `mongoose.connection.startSession()`. + * Sessions are scoped to a connection, so calling `mongoose.startSession()` + * starts a session on the [default mongoose connection](/docs/api.html#mongoose_Mongoose-connection). + * + * @param {Object} [options] see the [mongodb driver options](https://mongodb.github.io/node-mongodb-native/3.0/api/MongoClient.html#startSession) + * @param {Boolean} [options.causalConsistency=true] set to false to disable causal consistency + * @param {Function} [callback] + * @return {Promise} promise that resolves to a MongoDB driver `ClientSession` + * @api public + */ + +Mongoose.prototype.startSession = function() { + const _mongoose = this instanceof Mongoose ? this : mongoose; + + return _mongoose.connection.startSession.apply(_mongoose.connection, arguments); +}; + +/** + * Getter/setter around function for pluralizing collection names. + * + * @param {Function|null} [fn] overwrites the function used to pluralize collection names + * @return {Function|null} the current function used to pluralize collection names, defaults to the legacy function from `mongoose-legacy-pluralize`. + * @api public + */ + +Mongoose.prototype.pluralize = function(fn) { + const _mongoose = this instanceof Mongoose ? this : mongoose; + + if (arguments.length > 0) { + _mongoose._pluralize = fn; + } + return _mongoose._pluralize; +}; + +/** + * Defines a model or retrieves it. + * + * Models defined on the `mongoose` instance are available to all connection + * created by the same `mongoose` instance. + * + * If you call `mongoose.model()` with twice the same name but a different schema, + * you will get an `OverwriteModelError`. If you call `mongoose.model()` with + * the same name and same schema, you'll get the same schema back. + * + * #### Example: + * + * const mongoose = require('mongoose'); + * + * // define an Actor model with this mongoose instance + * const schema = new Schema({ name: String }); + * mongoose.model('Actor', schema); + * + * // create a new connection + * const conn = mongoose.createConnection(..); + * + * // create Actor model + * const Actor = conn.model('Actor', schema); + * conn.model('Actor') === Actor; // true + * conn.model('Actor', schema) === Actor; // true, same schema + * conn.model('Actor', schema, 'actors') === Actor; // true, same schema and collection name + * + * // This throws an `OverwriteModelError` because the schema is different. + * conn.model('Actor', new Schema({ name: String })); + * + * _When no `collection` argument is passed, Mongoose uses the model name. If you don't like this behavior, either pass a collection name, use `mongoose.pluralize()`, or set your schemas collection name option._ + * + * #### Example: + * + * const schema = new Schema({ name: String }, { collection: 'actor' }); + * + * // or + * + * schema.set('collection', 'actor'); + * + * // or + * + * const collectionName = 'actor' + * const M = mongoose.model('Actor', schema, collectionName) + * + * @param {String|Function} name model name or class extending Model + * @param {Schema} [schema] the schema to use. + * @param {String} [collection] name (optional, inferred from model name) + * @return {Model} The model associated with `name`. Mongoose will create the model if it doesn't already exist. + * @api public + */ + +Mongoose.prototype.model = function(name, schema, collection, options) { + const _mongoose = this instanceof Mongoose ? this : mongoose; + + if (typeof schema === 'string') { + collection = schema; + schema = false; + } + + if (utils.isObject(schema) && !(schema instanceof Schema)) { + schema = new Schema(schema); + } + if (schema && !(schema instanceof Schema)) { + throw new Error('The 2nd parameter to `mongoose.model()` should be a ' + + 'schema or a POJO'); + } + + // handle internal options from connection.model() + options = options || {}; + + const originalSchema = schema; + if (schema) { + if (_mongoose.get('cloneSchemas')) { + schema = schema.clone(); + } + _mongoose._applyPlugins(schema); + } + + // connection.model() may be passing a different schema for + // an existing model name. in this case don't read from cache. + const overwriteModels = _mongoose.options.hasOwnProperty('overwriteModels') ? + _mongoose.options.overwriteModels : + options.overwriteModels; + if (_mongoose.models.hasOwnProperty(name) && options.cache !== false && overwriteModels !== true) { + if (originalSchema && + originalSchema.instanceOfSchema && + originalSchema !== _mongoose.models[name].schema) { + throw new _mongoose.Error.OverwriteModelError(name); + } + if (collection && collection !== _mongoose.models[name].collection.name) { + // subclass current model with alternate collection + const model = _mongoose.models[name]; + schema = model.prototype.schema; + const sub = model.__subclass(_mongoose.connection, schema, collection); + // do not cache the sub model + return sub; + } + return _mongoose.models[name]; + } + if (schema == null) { + throw new _mongoose.Error.MissingSchemaError(name); + } + + const model = _mongoose._model(name, schema, collection, options); + _mongoose.connection.models[name] = model; + _mongoose.models[name] = model; + + return model; +}; + +/*! + * ignore + */ + +Mongoose.prototype._model = function(name, schema, collection, options) { + const _mongoose = this instanceof Mongoose ? this : mongoose; + + let model; + if (typeof name === 'function') { + model = name; + name = model.name; + if (!(model.prototype instanceof Model)) { + throw new _mongoose.Error('The provided class ' + name + ' must extend Model'); + } + } + + if (schema) { + if (_mongoose.get('cloneSchemas')) { + schema = schema.clone(); + } + _mongoose._applyPlugins(schema); + } + + // Apply relevant "global" options to the schema + if (schema == null || !('pluralization' in schema.options)) { + schema.options.pluralization = _mongoose.options.pluralization; + } + + if (!collection) { + collection = schema.get('collection') || + utils.toCollectionName(name, _mongoose.pluralize()); + } + + const connection = options.connection || _mongoose.connection; + model = _mongoose.Model.compile(model || name, schema, collection, connection, _mongoose); + // Errors handled internally, so safe to ignore error + model.init(function $modelInitNoop() {}); + + connection.emit('model', model); + + if (schema._applyDiscriminators != null) { + for (const disc of Object.keys(schema._applyDiscriminators)) { + model.discriminator(disc, schema._applyDiscriminators[disc]); + } + } + + return model; +}; + +/** + * Removes the model named `name` from the default connection, if it exists. + * You can use this function to clean up any models you created in your tests to + * prevent OverwriteModelErrors. + * + * Equivalent to `mongoose.connection.deleteModel(name)`. + * + * #### Example: + * + * mongoose.model('User', new Schema({ name: String })); + * console.log(mongoose.model('User')); // Model object + * mongoose.deleteModel('User'); + * console.log(mongoose.model('User')); // undefined + * + * // Usually useful in a Mocha `afterEach()` hook + * afterEach(function() { + * mongoose.deleteModel(/.+/); // Delete every model + * }); + * + * @api public + * @param {String|RegExp} name if string, the name of the model to remove. If regexp, removes all models whose name matches the regexp. + * @return {Mongoose} this + */ + +Mongoose.prototype.deleteModel = function(name) { + const _mongoose = this instanceof Mongoose ? this : mongoose; + + _mongoose.connection.deleteModel(name); + delete _mongoose.models[name]; + return _mongoose; +}; + +/** + * Returns an array of model names created on this instance of Mongoose. + * + * #### Note: + * + * _Does not include names of models created using `connection.model()`._ + * + * @api public + * @return {Array} + */ + +Mongoose.prototype.modelNames = function() { + const _mongoose = this instanceof Mongoose ? this : mongoose; + + const names = Object.keys(_mongoose.models); + return names; +}; + +/** + * Applies global plugins to `schema`. + * + * @param {Schema} schema + * @api private + */ + +Mongoose.prototype._applyPlugins = function(schema, options) { + const _mongoose = this instanceof Mongoose ? this : mongoose; + + options = options || {}; + options.applyPluginsToDiscriminators = _mongoose.options && _mongoose.options.applyPluginsToDiscriminators || false; + options.applyPluginsToChildSchemas = typeof (_mongoose.options && _mongoose.options.applyPluginsToDiscriminators) === 'boolean' ? _mongoose.options.applyPluginsToDiscriminators : true; + applyPlugins(schema, _mongoose.plugins, options, '$globalPluginsApplied'); +}; + +/** + * Declares a global plugin executed on all Schemas. + * + * Equivalent to calling `.plugin(fn)` on each Schema you create. + * + * @param {Function} fn plugin callback + * @param {Object} [opts] optional options + * @return {Mongoose} this + * @see plugins ./plugins.html + * @api public + */ + +Mongoose.prototype.plugin = function(fn, opts) { + const _mongoose = this instanceof Mongoose ? this : mongoose; + + _mongoose.plugins.push([fn, opts]); + return _mongoose; +}; + +/** + * The Mongoose module's default connection. Equivalent to `mongoose.connections[0]`, see [`connections`](#mongoose_Mongoose-connections). + * + * #### Example: + * + * const mongoose = require('mongoose'); + * mongoose.connect(...); + * mongoose.connection.on('error', cb); + * + * This is the connection used by default for every model created using [mongoose.model](#index_Mongoose-model). + * + * To create a new connection, use [`createConnection()`](#mongoose_Mongoose-createConnection). + * + * @memberOf Mongoose + * @instance + * @property {Connection} connection + * @api public + */ + +Mongoose.prototype.__defineGetter__('connection', function() { + return this.connections[0]; +}); + +Mongoose.prototype.__defineSetter__('connection', function(v) { + if (v instanceof this.__driver.getConnection()) { + this.connections[0] = v; + this.models = v.models; + } +}); + +/** + * An array containing all [connections](connections.html) associated with this + * Mongoose instance. By default, there is 1 connection. Calling + * [`createConnection()`](#mongoose_Mongoose-createConnection) adds a connection + * to this array. + * + * #### Example: + * + * const mongoose = require('mongoose'); + * mongoose.connections.length; // 1, just the default connection + * mongoose.connections[0] === mongoose.connection; // true + * + * mongoose.createConnection('mongodb://localhost:27017/test'); + * mongoose.connections.length; // 2 + * + * @memberOf Mongoose + * @instance + * @property {Array} connections + * @api public + */ + +Mongoose.prototype.connections; + +/** + * The Mongoose Aggregate constructor + * + * @method Aggregate + * @api public + */ + +Mongoose.prototype.Aggregate = Aggregate; + +/** + * The Mongoose Collection constructor + * + * @method Collection + * @api public + */ + +Object.defineProperty(Mongoose.prototype, 'Collection', { + get: function() { + return this.__driver.Collection; + }, + set: function(Collection) { + this.__driver.Collection = Collection; + } +}); + +/** + * The Mongoose [Connection](#connection_Connection) constructor + * + * @memberOf Mongoose + * @instance + * @method Connection + * @api public + */ + +Object.defineProperty(Mongoose.prototype, 'Connection', { + get: function() { + return this.__driver.getConnection(); + }, + set: function(Connection) { + if (Connection === this.__driver.getConnection()) { + return; + } + + this.__driver.getConnection = () => Connection; + } +}); + +/** + * The Mongoose version + * + * #### Example + * + * console.log(mongoose.version); // '5.x.x' + * + * @property version + * @api public + */ + +Mongoose.prototype.version = pkg.version; + +/** + * The Mongoose constructor + * + * The exports of the mongoose module is an instance of this class. + * + * #### Example: + * + * const mongoose = require('mongoose'); + * const mongoose2 = new mongoose.Mongoose(); + * + * @method Mongoose + * @api public + */ + +Mongoose.prototype.Mongoose = Mongoose; + +/** + * The Mongoose [Schema](#schema_Schema) constructor + * + * #### Example: + * + * const mongoose = require('mongoose'); + * const Schema = mongoose.Schema; + * const CatSchema = new Schema(..); + * + * @method Schema + * @api public + */ + +Mongoose.prototype.Schema = Schema; + +/** + * The Mongoose [SchemaType](#schematype_SchemaType) constructor + * + * @method SchemaType + * @api public + */ + +Mongoose.prototype.SchemaType = SchemaType; + +/** + * The various Mongoose SchemaTypes. + * + * #### Note: + * + * _Alias of mongoose.Schema.Types for backwards compatibility._ + * + * @property SchemaTypes + * @see Schema.SchemaTypes #schema_Schema.Types + * @api public + */ + +Mongoose.prototype.SchemaTypes = Schema.Types; + +/** + * The Mongoose [VirtualType](#virtualtype_VirtualType) constructor + * + * @method VirtualType + * @api public + */ + +Mongoose.prototype.VirtualType = VirtualType; + +/** + * The various Mongoose Types. + * + * #### Example: + * + * const mongoose = require('mongoose'); + * const array = mongoose.Types.Array; + * + * #### Types: + * + * - [Array](/docs/schematypes.html#arrays) + * - [Buffer](/docs/schematypes.html#buffers) + * - [Embedded](/docs/schematypes.html#schemas) + * - [DocumentArray](/docs/api/documentarraypath.html) + * - [Decimal128](/docs/api.html#mongoose_Mongoose-Decimal128) + * - [ObjectId](/docs/schematypes.html#objectids) + * - [Map](/docs/schematypes.html#maps) + * - [Subdocument](/docs/schematypes.html#schemas) + * + * Using this exposed access to the `ObjectId` type, we can construct ids on demand. + * + * const ObjectId = mongoose.Types.ObjectId; + * const id1 = new ObjectId; + * + * @property Types + * @api public + */ + +Mongoose.prototype.Types = Types; + +/** + * The Mongoose [Query](#query_Query) constructor. + * + * @method Query + * @api public + */ + +Mongoose.prototype.Query = Query; + +/** + * The Mongoose [Promise](#promise_Promise) constructor. + * + * @memberOf Mongoose + * @instance + * @property Promise + * @api public + */ + +Object.defineProperty(Mongoose.prototype, 'Promise', { + get: function() { + return PromiseProvider.get(); + }, + set: function(lib) { + PromiseProvider.set(lib); + } +}); + +/** + * Storage layer for mongoose promises + * + * @method PromiseProvider + * @api public + */ + +Mongoose.prototype.PromiseProvider = PromiseProvider; + +/** + * The Mongoose [Model](#model_Model) constructor. + * + * @method Model + * @api public + */ + +Mongoose.prototype.Model = Model; + +/** + * The Mongoose [Document](/docs/api.html#Document) constructor. + * + * @method Document + * @api public + */ + +Mongoose.prototype.Document = Document; + +/** + * The Mongoose DocumentProvider constructor. Mongoose users should not have to + * use this directly + * + * @method DocumentProvider + * @api public + */ + +Mongoose.prototype.DocumentProvider = require('./document_provider'); + +/** + * The Mongoose ObjectId [SchemaType](/docs/schematypes.html). Used for + * declaring paths in your schema that should be + * [MongoDB ObjectIds](https://docs.mongodb.com/manual/reference/method/ObjectId/). + * Do not use this to create a new ObjectId instance, use `mongoose.Types.ObjectId` + * instead. + * + * #### Example: + * + * const childSchema = new Schema({ parentId: mongoose.ObjectId }); + * + * @property ObjectId + * @api public + */ + +Mongoose.prototype.ObjectId = SchemaTypes.ObjectId; + +/** + * Returns true if Mongoose can cast the given value to an ObjectId, or + * false otherwise. + * + * #### Example: + * + * mongoose.isValidObjectId(new mongoose.Types.ObjectId()); // true + * mongoose.isValidObjectId('0123456789ab'); // true + * mongoose.isValidObjectId(6); // true + * mongoose.isValidObjectId(new User({ name: 'test' })); // true + * + * mongoose.isValidObjectId({ test: 42 }); // false + * + * @method isValidObjectId + * @param {Any} v + * @returns {boolean} true if `v` is something Mongoose can coerce to an ObjectId + * @api public + */ + +Mongoose.prototype.isValidObjectId = function(v) { + const _mongoose = this instanceof Mongoose ? this : mongoose; + return _mongoose.Types.ObjectId.isValid(v); +}; + +/** + * Returns true if the given value is a Mongoose ObjectId (using `instanceof`) or if the + * given value is a 24 character hex string, which is the most commonly used string representation + * of an ObjectId. + * + * This function is similar to `isValidObjectId()`, but considerably more strict, because + * `isValidObjectId()` will return `true` for _any_ value that Mongoose can convert to an + * ObjectId. That includes Mongoose documents, any string of length 12, and any number. + * `isObjectIdOrHexString()` returns true only for `ObjectId` instances or 24 character hex + * strings, and will return false for numbers, documents, and strings of length 12. + * + * #### Example: + * + * mongoose.isObjectIdOrHexString(new mongoose.Types.ObjectId()); // true + * mongoose.isObjectIdOrHexString('62261a65d66c6be0a63c051f'); // true + * + * mongoose.isObjectIdOrHexString('0123456789ab'); // false + * mongoose.isObjectIdOrHexString(6); // false + * mongoose.isObjectIdOrHexString(new User({ name: 'test' })); // false + * mongoose.isObjectIdOrHexString({ test: 42 }); // false + * + * @method isObjectIdOrHexString + * @param {Any} v + * @returns {boolean} true if `v` is an ObjectId instance _or_ a 24 char hex string + * @api public + */ + +Mongoose.prototype.isObjectIdOrHexString = function(v) { + return isBsonType(v, 'ObjectID') || (typeof v === 'string' && objectIdHexRegexp.test(v)); +}; + +/** + * + * Syncs all the indexes for the models registered with this connection. + * + * @param {Object} options + * @param {Boolean} options.continueOnError `false` by default. If set to `true`, mongoose will not throw an error if one model syncing failed, and will return an object where the keys are the names of the models, and the values are the results/errors for each model. + * @returns + */ +Mongoose.prototype.syncIndexes = function(options) { + const _mongoose = this instanceof Mongoose ? this : mongoose; + return _mongoose.connection.syncIndexes(options); +}; + +/** + * The Mongoose Decimal128 [SchemaType](/docs/schematypes.html). Used for + * declaring paths in your schema that should be + * [128-bit decimal floating points](https://thecodebarbarian.com/a-nodejs-perspective-on-mongodb-34-decimal.html). + * Do not use this to create a new Decimal128 instance, use `mongoose.Types.Decimal128` + * instead. + * + * #### Example: + * + * const vehicleSchema = new Schema({ fuelLevel: mongoose.Decimal128 }); + * + * @property Decimal128 + * @api public + */ + +Mongoose.prototype.Decimal128 = SchemaTypes.Decimal128; + +/** + * The Mongoose Mixed [SchemaType](/docs/schematypes.html). Used for + * declaring paths in your schema that Mongoose's change tracking, casting, + * and validation should ignore. + * + * #### Example: + * + * const schema = new Schema({ arbitrary: mongoose.Mixed }); + * + * @property Mixed + * @api public + */ + +Mongoose.prototype.Mixed = SchemaTypes.Mixed; + +/** + * The Mongoose Date [SchemaType](/docs/schematypes.html). + * + * #### Example: + * + * const schema = new Schema({ test: Date }); + * schema.path('test') instanceof mongoose.Date; // true + * + * @property Date + * @api public + */ + +Mongoose.prototype.Date = SchemaTypes.Date; + +/** + * The Mongoose Number [SchemaType](/docs/schematypes.html). Used for + * declaring paths in your schema that Mongoose should cast to numbers. + * + * #### Example: + * + * const schema = new Schema({ num: mongoose.Number }); + * // Equivalent to: + * const schema = new Schema({ num: 'number' }); + * + * @property Number + * @api public + */ + +Mongoose.prototype.Number = SchemaTypes.Number; + +/** + * The [MongooseError](#error_MongooseError) constructor. + * + * @method Error + * @api public + */ + +Mongoose.prototype.Error = require('./error/index'); + +/** + * Mongoose uses this function to get the current time when setting + * [timestamps](/docs/guide.html#timestamps). You may stub out this function + * using a tool like [Sinon](https://www.npmjs.com/package/sinon) for testing. + * + * @method now + * @returns Date the current time + * @api public + */ + +Mongoose.prototype.now = function now() { return new Date(); }; + +/** + * The Mongoose CastError constructor + * + * @method CastError + * @param {String} type The name of the type + * @param {Any} value The value that failed to cast + * @param {String} path The path `a.b.c` in the doc where this cast error occurred + * @param {Error} [reason] The original error that was thrown + * @api public + */ + +Mongoose.prototype.CastError = require('./error/cast'); + +/** + * The constructor used for schematype options + * + * @method SchemaTypeOptions + * @api public + */ + +Mongoose.prototype.SchemaTypeOptions = require('./options/SchemaTypeOptions'); + +/** + * The [node-mongodb-native](https://github.com/mongodb/node-mongodb-native) driver Mongoose uses. + * + * @property mongo + * @api public + */ + +Mongoose.prototype.mongo = require('mongodb'); + +/** + * The [mquery](https://github.com/aheckmann/mquery) query builder Mongoose uses. + * + * @property mquery + * @api public + */ + +Mongoose.prototype.mquery = require('mquery'); + +/** + * Sanitizes query filters against [query selector injection attacks](https://thecodebarbarian.com/2014/09/04/defending-against-query-selector-injection-attacks.html) + * by wrapping any nested objects that have a property whose name starts with `$` in a `$eq`. + * + * ```javascript + * const obj = { username: 'val', pwd: { $ne: null } }; + * sanitizeFilter(obj); + * obj; // { username: 'val', pwd: { $eq: { $ne: null } } }); + * ``` + * + * @method sanitizeFilter + * @param {Object} filter + * @returns Object the sanitized object + * @api public + */ + +Mongoose.prototype.sanitizeFilter = sanitizeFilter; + +/** + * Tells `sanitizeFilter()` to skip the given object when filtering out potential [query selector injection attacks](https://thecodebarbarian.com/2014/09/04/defending-against-query-selector-injection-attacks.html). + * Use this method when you have a known query selector that you want to use. + * + * ```javascript + * const obj = { username: 'val', pwd: trusted({ $type: 'string', $eq: 'my secret' }) }; + * sanitizeFilter(obj); + * + * // Note that `sanitizeFilter()` did not add `$eq` around `$type`. + * obj; // { username: 'val', pwd: { $type: 'string', $eq: 'my secret' } }); + * ``` + * + * @method trusted + * @param {Object} obj + * @returns Object the passed in object + * @api public + */ + +Mongoose.prototype.trusted = trusted; + +/*! + * ignore + */ + +Mongoose.prototype._promiseOrCallback = function(callback, fn, ee) { + return promiseOrCallback(callback, fn, ee, this.Promise); +}; + +/** + * Use this function in `pre()` middleware to skip calling the wrapped function. + * + * ####Example: + * + * schema.pre('save', function() { + * // Will skip executing `save()`, but will execute post hooks as if + * // `save()` had executed with the result `{ matchedCount: 0 }` + * return mongoose.skipMiddlewareFunction({ matchedCount: 0 }); + * }); + * + * @method skipMiddlewareFunction + * @param {any} result + * @api public + */ + +Mongoose.prototype.skipMiddlewareFunction = Kareem.skipWrappedFunction; + +/** + * Use this function in `post()` middleware to replace the result + * + * ####Example: + * + * schema.post('find', function(res) { + * // Normally you have to modify `res` in place. But with + * // `overwriteMiddlewarResult()`, you can make `find()` return a + * // completely different value. + * return mongoose.overwriteMiddlewareResult(res.filter(doc => !doc.isDeleted)); + * }); + * + * @method overwriteMiddlewareResult + * @param {any} result + * @api public + */ + +Mongoose.prototype.overwriteMiddlewareResult = Kareem.overwriteResult; + +/*! + * The exports object is an instance of Mongoose. + * + * @api public + */ + +const mongoose = module.exports = exports = new Mongoose({ + [defaultMongooseSymbol]: true +}); diff --git a/node_modules/mongoose/lib/internal.js b/node_modules/mongoose/lib/internal.js new file mode 100644 index 000000000..a31714825 --- /dev/null +++ b/node_modules/mongoose/lib/internal.js @@ -0,0 +1,44 @@ +/*! + * Dependencies + */ + +'use strict'; + +const StateMachine = require('./statemachine'); +const ActiveRoster = StateMachine.ctor('require', 'modify', 'init', 'default', 'ignore'); + +module.exports = exports = InternalCache; + +function InternalCache() { + this.activePaths = new ActiveRoster(); +} + +InternalCache.prototype.fullPath = undefined; +InternalCache.prototype.strictMode = undefined; +InternalCache.prototype.selected = undefined; +InternalCache.prototype.shardval = undefined; +InternalCache.prototype.saveError = undefined; +InternalCache.prototype.validationError = undefined; +InternalCache.prototype.adhocPaths = undefined; +InternalCache.prototype.removing = undefined; +InternalCache.prototype.inserting = undefined; +InternalCache.prototype.saving = undefined; +InternalCache.prototype.version = undefined; +InternalCache.prototype._id = undefined; +InternalCache.prototype.ownerDocument = undefined; +InternalCache.prototype.populate = undefined; // what we want to populate in this doc +InternalCache.prototype.populated = undefined;// the _ids that have been populated + +/** + * If `false`, this document was not the result of population. + * If `true`, this document is a populated doc underneath another doc + * If an object, this document is a populated doc and the `value` property of the + * object contains the original depopulated value. + */ +InternalCache.prototype.wasPopulated = false; + +InternalCache.prototype.scope = undefined; + +InternalCache.prototype.session = null; +InternalCache.prototype.pathsToScopes = null; +InternalCache.prototype.cachedRequired = null; diff --git a/node_modules/mongoose/lib/model.js b/node_modules/mongoose/lib/model.js new file mode 100644 index 000000000..6d02eb8d4 --- /dev/null +++ b/node_modules/mongoose/lib/model.js @@ -0,0 +1,5051 @@ +'use strict'; + +/*! + * Module dependencies. + */ + +const Aggregate = require('./aggregate'); +const ChangeStream = require('./cursor/ChangeStream'); +const Document = require('./document'); +const DocumentNotFoundError = require('./error/notFound'); +const DivergentArrayError = require('./error/divergentArray'); +const EventEmitter = require('events').EventEmitter; +const MongooseBuffer = require('./types/buffer'); +const MongooseError = require('./error/index'); +const OverwriteModelError = require('./error/overwriteModel'); +const PromiseProvider = require('./promise_provider'); +const Query = require('./query'); +const RemoveOptions = require('./options/removeOptions'); +const SaveOptions = require('./options/saveOptions'); +const Schema = require('./schema'); +const ServerSelectionError = require('./error/serverSelection'); +const ValidationError = require('./error/validation'); +const VersionError = require('./error/version'); +const ParallelSaveError = require('./error/parallelSave'); +const applyQueryMiddleware = require('./helpers/query/applyQueryMiddleware'); +const applyHooks = require('./helpers/model/applyHooks'); +const applyMethods = require('./helpers/model/applyMethods'); +const applyProjection = require('./helpers/projection/applyProjection'); +const applySchemaCollation = require('./helpers/indexes/applySchemaCollation'); +const applyStaticHooks = require('./helpers/model/applyStaticHooks'); +const applyStatics = require('./helpers/model/applyStatics'); +const applyWriteConcern = require('./helpers/schema/applyWriteConcern'); +const assignVals = require('./helpers/populate/assignVals'); +const castBulkWrite = require('./helpers/model/castBulkWrite'); +const createPopulateQueryFilter = require('./helpers/populate/createPopulateQueryFilter'); +const getDefaultBulkwriteResult = require('./helpers/getDefaultBulkwriteResult'); +const discriminator = require('./helpers/model/discriminator'); +const each = require('./helpers/each'); +const get = require('./helpers/get'); +const getConstructorName = require('./helpers/getConstructorName'); +const getDiscriminatorByValue = require('./helpers/discriminator/getDiscriminatorByValue'); +const getModelsMapForPopulate = require('./helpers/populate/getModelsMapForPopulate'); +const immediate = require('./helpers/immediate'); +const internalToObjectOptions = require('./options').internalToObjectOptions; +const isDefaultIdIndex = require('./helpers/indexes/isDefaultIdIndex'); +const isIndexEqual = require('./helpers/indexes/isIndexEqual'); +const { + getRelatedDBIndexes, + getRelatedSchemaIndexes +} = require('./helpers/indexes/getRelatedIndexes'); +const decorateDiscriminatorIndexOptions = require('./helpers/indexes/decorateDiscriminatorIndexOptions'); +const isPathSelectedInclusive = require('./helpers/projection/isPathSelectedInclusive'); +const leanPopulateMap = require('./helpers/populate/leanPopulateMap'); +const modifiedPaths = require('./helpers/update/modifiedPaths'); +const parallelLimit = require('./helpers/parallelLimit'); +const prepareDiscriminatorPipeline = require('./helpers/aggregate/prepareDiscriminatorPipeline'); +const removeDeselectedForeignField = require('./helpers/populate/removeDeselectedForeignField'); +const setDottedPath = require('./helpers/path/setDottedPath'); +const util = require('util'); +const utils = require('./utils'); + +const VERSION_WHERE = 1; +const VERSION_INC = 2; +const VERSION_ALL = VERSION_WHERE | VERSION_INC; + +const arrayAtomicsSymbol = require('./helpers/symbols').arrayAtomicsSymbol; +const modelCollectionSymbol = Symbol('mongoose#Model#collection'); +const modelDbSymbol = Symbol('mongoose#Model#db'); +const modelSymbol = require('./helpers/symbols').modelSymbol; +const subclassedSymbol = Symbol('mongoose#Model#subclassed'); + +const saveToObjectOptions = Object.assign({}, internalToObjectOptions, { + bson: true +}); + +/** + * A Model is a class that's your primary tool for interacting with MongoDB. + * An instance of a Model is called a [Document](./api.html#Document). + * + * In Mongoose, the term "Model" refers to subclasses of the `mongoose.Model` + * class. You should not use the `mongoose.Model` class directly. The + * [`mongoose.model()`](./api.html#mongoose_Mongoose-model) and + * [`connection.model()`](./api.html#connection_Connection-model) functions + * create subclasses of `mongoose.Model` as shown below. + * + * #### Example: + * + * // `UserModel` is a "Model", a subclass of `mongoose.Model`. + * const UserModel = mongoose.model('User', new Schema({ name: String })); + * + * // You can use a Model to create new documents using `new`: + * const userDoc = new UserModel({ name: 'Foo' }); + * await userDoc.save(); + * + * // You also use a model to create queries: + * const userFromDb = await UserModel.findOne({ name: 'Foo' }); + * + * @param {Object} doc values for initial set + * @param [fields] optional object containing the fields that were selected in the query which returned this document. You do **not** need to set this parameter to ensure Mongoose handles your [query projection](./api.html#query_Query-select). + * @param {Boolean} [skipId=false] optional boolean. If true, mongoose doesn't add an `_id` field to the document. + * @inherits Document https://mongoosejs.com/docs/api/document.html + * @event `error`: If listening to this event, 'error' is emitted when a document was saved without passing a callback and an `error` occurred. If not listening, the event bubbles to the connection used to create this Model. + * @event `index`: Emitted after `Model#ensureIndexes` completes. If an error occurred it is passed with the event. + * @event `index-single-start`: Emitted when an individual index starts within `Model#ensureIndexes`. The fields and options being used to build the index are also passed with the event. + * @event `index-single-done`: Emitted when an individual index finishes within `Model#ensureIndexes`. If an error occurred it is passed with the event. The fields, options, and index name are also passed. + * @api public + */ + +function Model(doc, fields, skipId) { + if (fields instanceof Schema) { + throw new TypeError('2nd argument to `Model` must be a POJO or string, ' + + '**not** a schema. Make sure you\'re calling `mongoose.model()`, not ' + + '`mongoose.Model()`.'); + } + Document.call(this, doc, fields, skipId); +} + +/*! + * Inherits from Document. + * + * All Model.prototype features are available on + * top level (non-sub) documents. + */ + +Model.prototype.__proto__ = Document.prototype; +Model.prototype.$isMongooseModelPrototype = true; + +/** + * Connection the model uses. + * + * @api public + * @property db + * @memberOf Model + * @instance + */ + +Model.prototype.db; + +/** + * Collection the model uses. + * + * This property is read-only. Modifying this property is a no-op. + * + * @api public + * @property collection + * @memberOf Model + * @instance + */ + +Model.prototype.collection; + +/** + * Internal collection the model uses. + * + * This property is read-only. Modifying this property is a no-op. + * + * @api private + * @property collection + * @memberOf Model + * @instance + */ + + +Model.prototype.$__collection; + +/** + * The name of the model + * + * @api public + * @property modelName + * @memberOf Model + * @instance + */ + +Model.prototype.modelName; + +/** + * Additional properties to attach to the query when calling `save()` and + * `isNew` is false. + * + * @api public + * @property $where + * @memberOf Model + * @instance + */ + +Model.prototype.$where; + +/** + * If this is a discriminator model, `baseModelName` is the name of + * the base model. + * + * @api public + * @property baseModelName + * @memberOf Model + * @instance + */ + +Model.prototype.baseModelName; + +/** + * Event emitter that reports any errors that occurred. Useful for global error + * handling. + * + * #### Example: + * + * MyModel.events.on('error', err => console.log(err.message)); + * + * // Prints a 'CastError' because of the above handler + * await MyModel.findOne({ _id: 'Not a valid ObjectId' }).catch(noop); + * + * @api public + * @fires error whenever any query or model function errors + * @memberOf Model + * @static events + */ + +Model.events; + +/*! + * Compiled middleware for this model. Set in `applyHooks()`. + * + * @api private + * @property _middleware + * @memberOf Model + * @static + */ + +Model._middleware; + +/*! + * ignore + */ + +function _applyCustomWhere(doc, where) { + if (doc.$where == null) { + return; + } + for (const key of Object.keys(doc.$where)) { + where[key] = doc.$where[key]; + } +} + +/*! + * ignore + */ + +Model.prototype.$__handleSave = function(options, callback) { + const saveOptions = {}; + + applyWriteConcern(this.$__schema, options); + if (typeof options.writeConcern !== 'undefined') { + saveOptions.writeConcern = {}; + if ('w' in options.writeConcern) { + saveOptions.writeConcern.w = options.writeConcern.w; + } + if ('j' in options.writeConcern) { + saveOptions.writeConcern.j = options.writeConcern.j; + } + if ('wtimeout' in options.writeConcern) { + saveOptions.writeConcern.wtimeout = options.writeConcern.wtimeout; + } + } else { + if ('w' in options) { + saveOptions.w = options.w; + } + if ('j' in options) { + saveOptions.j = options.j; + } + if ('wtimeout' in options) { + saveOptions.wtimeout = options.wtimeout; + } + } + if ('checkKeys' in options) { + saveOptions.checkKeys = options.checkKeys; + } + if (!saveOptions.hasOwnProperty('session')) { + saveOptions.session = this.$session(); + } + + if (this.$isNew) { + // send entire doc + const obj = this.toObject(saveToObjectOptions); + if ((obj || {})._id === void 0) { + // documents must have an _id else mongoose won't know + // what to update later if more changes are made. the user + // wouldn't know what _id was generated by mongodb either + // nor would the ObjectId generated by mongodb necessarily + // match the schema definition. + immediate(function() { + callback(new MongooseError('document must have an _id before saving')); + }); + return; + } + + this.$__version(true, obj); + this[modelCollectionSymbol].insertOne(obj, saveOptions, (err, ret) => { + if (err) { + _setIsNew(this, true); + + callback(err, null); + return; + } + + callback(null, ret); + }); + + this.$__reset(); + _setIsNew(this, false); + // Make it possible to retry the insert + this.$__.inserting = true; + + return; + } + + // Make sure we don't treat it as a new object on error, + // since it already exists + this.$__.inserting = false; + + const delta = this.$__delta(); + if (delta) { + if (delta instanceof MongooseError) { + callback(delta); + return; + } + + const where = this.$__where(delta[0]); + if (where instanceof MongooseError) { + callback(where); + return; + } + + _applyCustomWhere(this, where); + this[modelCollectionSymbol].updateOne(where, delta[1], saveOptions, (err, ret) => { + if (err) { + this.$__undoReset(); + + callback(err); + return; + } + ret.$where = where; + callback(null, ret); + }); + } else { + const optionsWithCustomValues = Object.assign({}, options, saveOptions); + const where = this.$__where(); + const optimisticConcurrency = this.$__schema.options.optimisticConcurrency; + if (optimisticConcurrency) { + const key = this.$__schema.options.versionKey; + const val = this.$__getValue(key); + if (val != null) { + where[key] = val; + } + } + this.constructor.exists(where, optionsWithCustomValues) + .then(documentExists => { + const matchedCount = !documentExists ? 0 : 1; + callback(null, { $where: where, matchedCount }); + }) + .catch(callback); + return; + } + + // store the modified paths before the document is reset + this.$__.modifiedPaths = this.modifiedPaths(); + this.$__reset(); + + _setIsNew(this, false); +}; + +/*! + * ignore + */ + +Model.prototype.$__save = function(options, callback) { + this.$__handleSave(options, (error, result) => { + if (error) { + const hooks = this.$__schema.s.hooks; + return hooks.execPost('save:error', this, [this], { error: error }, (error) => { + callback(error, this); + }); + } + let numAffected = 0; + const writeConcern = options != null ? + options.writeConcern != null ? + options.writeConcern.w : + options.w : + 0; + if (writeConcern !== 0) { + // Skip checking if write succeeded if writeConcern is set to + // unacknowledged writes, because otherwise `numAffected` will always be 0 + if (result != null) { + if (Array.isArray(result)) { + numAffected = result.length; + } else if (result.matchedCount != null) { + numAffected = result.matchedCount; + } else { + numAffected = result; + } + } + + const versionBump = this.$__.version; + // was this an update that required a version bump? + if (versionBump && !this.$__.inserting) { + const doIncrement = VERSION_INC === (VERSION_INC & this.$__.version); + this.$__.version = undefined; + const key = this.$__schema.options.versionKey; + const version = this.$__getValue(key) || 0; + if (numAffected <= 0) { + // the update failed. pass an error back + this.$__undoReset(); + const err = this.$__.$versionError || + new VersionError(this, version, this.$__.modifiedPaths); + return callback(err); + } + + // increment version if was successful + if (doIncrement) { + this.$__setValue(key, version + 1); + } + } + if (result != null && numAffected <= 0) { + this.$__undoReset(); + error = new DocumentNotFoundError(result.$where, + this.constructor.modelName, numAffected, result); + const hooks = this.$__schema.s.hooks; + return hooks.execPost('save:error', this, [this], { error: error }, (error) => { + callback(error, this); + }); + } + } + this.$__.saving = undefined; + this.$__.savedState = {}; + this.$emit('save', this, numAffected); + this.constructor.emit('save', this, numAffected); + callback(null, this); + }); +}; + +/*! + * ignore + */ + +function generateVersionError(doc, modifiedPaths) { + const key = doc.$__schema.options.versionKey; + if (!key) { + return null; + } + const version = doc.$__getValue(key) || 0; + return new VersionError(doc, version, modifiedPaths); +} + +/** + * Saves this document by inserting a new document into the database if [document.isNew](/docs/api.html#document_Document-isNew) is `true`, + * or sends an [updateOne](/docs/api.html#document_Document-updateOne) operation with just the modified paths if `isNew` is `false`. + * + * #### Example: + * + * product.sold = Date.now(); + * product = await product.save(); + * + * If save is successful, the returned promise will fulfill with the document + * saved. + * + * #### Example: + * + * const newProduct = await product.save(); + * newProduct === product; // true + * + * @param {Object} [options] options optional options + * @param {Session} [options.session=null] the [session](https://docs.mongodb.com/manual/reference/server-sessions/) associated with this save operation. If not specified, defaults to the [document's associated session](api.html#document_Document-$session). + * @param {Object} [options.safe] (DEPRECATED) overrides [schema's safe option](https://mongoosejs.com//docs/guide.html#safe). Use the `w` option instead. + * @param {Boolean} [options.validateBeforeSave] set to false to save without validating. + * @param {Boolean} [options.validateModifiedOnly=false] if `true`, Mongoose will only validate modified paths, as opposed to modified paths and `required` paths. + * @param {Number|String} [options.w] set the [write concern](https://docs.mongodb.com/manual/reference/write-concern/#w-option). Overrides the [schema-level `writeConcern` option](/docs/guide.html#writeConcern) + * @param {Boolean} [options.j] set to true for MongoDB to wait until this `save()` has been [journaled before resolving the returned promise](https://docs.mongodb.com/manual/reference/write-concern/#j-option). Overrides the [schema-level `writeConcern` option](/docs/guide.html#writeConcern) + * @param {Number} [options.wtimeout] sets a [timeout for the write concern](https://docs.mongodb.com/manual/reference/write-concern/#wtimeout). Overrides the [schema-level `writeConcern` option](/docs/guide.html#writeConcern). + * @param {Boolean} [options.checkKeys=true] the MongoDB driver prevents you from saving keys that start with '$' or contain '.' by default. Set this option to `false` to skip that check. See [restrictions on field names](https://docs.mongodb.com/manual/reference/limits/#Restrictions-on-Field-Names) + * @param {Boolean} [options.timestamps=true] if `false` and [timestamps](./guide.html#timestamps) are enabled, skip timestamps for this `save()`. + * @param {Function} [fn] optional callback + * @throws {DocumentNotFoundError} if this [save updates an existing document](api.html#document_Document-isNew) but the document doesn't exist in the database. For example, you will get this error if the document is [deleted between when you retrieved the document and when you saved it](documents.html#updating). + * @return {Promise|undefined} Returns undefined if used with callback or a Promise otherwise. + * @api public + * @see middleware https://mongoosejs.com/docs/middleware.html + */ + +Model.prototype.save = function(options, fn) { + let parallelSave; + this.$op = 'save'; + + if (this.$__.saving) { + parallelSave = new ParallelSaveError(this); + } else { + this.$__.saving = new ParallelSaveError(this); + } + + if (typeof options === 'function') { + fn = options; + options = undefined; + } + + options = new SaveOptions(options); + if (options.hasOwnProperty('session')) { + this.$session(options.session); + } + this.$__.$versionError = generateVersionError(this, this.modifiedPaths()); + + fn = this.constructor.$handleCallbackError(fn); + return this.constructor.db.base._promiseOrCallback(fn, cb => { + cb = this.constructor.$wrapCallback(cb); + + if (parallelSave) { + this.$__handleReject(parallelSave); + return cb(parallelSave); + } + + this.$__.saveOptions = options; + + this.$__save(options, error => { + this.$__.saving = null; + this.$__.saveOptions = null; + this.$__.$versionError = null; + this.$op = null; + + if (error) { + this.$__handleReject(error); + return cb(error); + } + cb(null, this); + }); + }, this.constructor.events); +}; + +Model.prototype.$save = Model.prototype.save; + +/*! + * Determines whether versioning should be skipped for the given path + * + * @param {Document} self + * @param {String} path + * @return {Boolean} true if versioning should be skipped for the given path + */ +function shouldSkipVersioning(self, path) { + const skipVersioning = self.$__schema.options.skipVersioning; + if (!skipVersioning) return false; + + // Remove any array indexes from the path + path = path.replace(/\.\d+\./, '.'); + + return skipVersioning[path]; +} + +/*! + * Apply the operation to the delta (update) clause as + * well as track versioning for our where clause. + * + * @param {Document} self + * @param {Object} where + * @param {Object} delta + * @param {Object} data + * @param {Mixed} val + * @param {String} [operation] + */ + +function operand(self, where, delta, data, val, op) { + // delta + op || (op = '$set'); + if (!delta[op]) delta[op] = {}; + delta[op][data.path] = val; + // disabled versioning? + if (self.$__schema.options.versionKey === false) return; + + // path excluded from versioning? + if (shouldSkipVersioning(self, data.path)) return; + + // already marked for versioning? + if (VERSION_ALL === (VERSION_ALL & self.$__.version)) return; + + if (self.$__schema.options.optimisticConcurrency) { + return; + } + + switch (op) { + case '$set': + case '$unset': + case '$pop': + case '$pull': + case '$pullAll': + case '$push': + case '$addToSet': + break; + default: + // nothing to do + return; + } + + // ensure updates sent with positional notation are + // editing the correct array element. + // only increment the version if an array position changes. + // modifying elements of an array is ok if position does not change. + if (op === '$push' || op === '$addToSet' || op === '$pullAll' || op === '$pull') { + if (/\.\d+\.|\.\d+$/.test(data.path)) { + increment.call(self); + } else { + self.$__.version = VERSION_INC; + } + } else if (/^\$p/.test(op)) { + // potentially changing array positions + increment.call(self); + } else if (Array.isArray(val)) { + // $set an array + increment.call(self); + } else if (/\.\d+\.|\.\d+$/.test(data.path)) { + // now handling $set, $unset + // subpath of array + self.$__.version = VERSION_WHERE; + } +} + +/*! + * Compiles an update and where clause for a `val` with _atomics. + * + * @param {Document} self + * @param {Object} where + * @param {Object} delta + * @param {Object} data + * @param {Array} value + */ + +function handleAtomics(self, where, delta, data, value) { + if (delta.$set && delta.$set[data.path]) { + // $set has precedence over other atomics + return; + } + + if (typeof value.$__getAtomics === 'function') { + value.$__getAtomics().forEach(function(atomic) { + const op = atomic[0]; + const val = atomic[1]; + operand(self, where, delta, data, val, op); + }); + return; + } + + // legacy support for plugins + + const atomics = value[arrayAtomicsSymbol]; + const ops = Object.keys(atomics); + let i = ops.length; + let val; + let op; + + if (i === 0) { + // $set + + if (utils.isMongooseObject(value)) { + value = value.toObject({ depopulate: 1, _isNested: true }); + } else if (value.valueOf) { + value = value.valueOf(); + } + + return operand(self, where, delta, data, value); + } + + function iter(mem) { + return utils.isMongooseObject(mem) + ? mem.toObject({ depopulate: 1, _isNested: true }) + : mem; + } + + while (i--) { + op = ops[i]; + val = atomics[op]; + + if (utils.isMongooseObject(val)) { + val = val.toObject({ depopulate: true, transform: false, _isNested: true }); + } else if (Array.isArray(val)) { + val = val.map(iter); + } else if (val.valueOf) { + val = val.valueOf(); + } + + if (op === '$addToSet') { + val = { $each: val }; + } + + operand(self, where, delta, data, val, op); + } +} + +/** + * Produces a special query document of the modified properties used in updates. + * + * @api private + * @method $__delta + * @memberOf Model + * @instance + */ + +Model.prototype.$__delta = function() { + const dirty = this.$__dirty(); + + const optimisticConcurrency = this.$__schema.options.optimisticConcurrency; + if (optimisticConcurrency) { + this.$__.version = dirty.length ? VERSION_ALL : VERSION_WHERE; + } + + if (!dirty.length && VERSION_ALL !== this.$__.version) { + return; + } + const where = {}; + const delta = {}; + const len = dirty.length; + const divergent = []; + let d = 0; + + where._id = this._doc._id; + // If `_id` is an object, need to depopulate, but also need to be careful + // because `_id` can technically be null (see gh-6406) + if ((where && where._id && where._id.$__ || null) != null) { + where._id = where._id.toObject({ transform: false, depopulate: true }); + } + for (; d < len; ++d) { + const data = dirty[d]; + let value = data.value; + const match = checkDivergentArray(this, data.path, value); + if (match) { + divergent.push(match); + continue; + } + + const pop = this.$populated(data.path, true); + if (!pop && this.$__.selected) { + // If any array was selected using an $elemMatch projection, we alter the path and where clause + // NOTE: MongoDB only supports projected $elemMatch on top level array. + const pathSplit = data.path.split('.'); + const top = pathSplit[0]; + if (this.$__.selected[top] && this.$__.selected[top].$elemMatch) { + // If the selected array entry was modified + if (pathSplit.length > 1 && pathSplit[1] == 0 && typeof where[top] === 'undefined') { + where[top] = this.$__.selected[top]; + pathSplit[1] = '$'; + data.path = pathSplit.join('.'); + } + // if the selected array was modified in any other way throw an error + else { + divergent.push(data.path); + continue; + } + } + } + + if (divergent.length) continue; + if (value === undefined) { + operand(this, where, delta, data, 1, '$unset'); + } else if (value === null) { + operand(this, where, delta, data, null); + } else if (utils.isMongooseArray(value) && value.$path() && value[arrayAtomicsSymbol]) { + // arrays and other custom types (support plugins etc) + handleAtomics(this, where, delta, data, value); + } else if (value[MongooseBuffer.pathSymbol] && Buffer.isBuffer(value)) { + // MongooseBuffer + value = value.toObject(); + operand(this, where, delta, data, value); + } else { + value = utils.clone(value, { + depopulate: true, + transform: false, + virtuals: false, + getters: false, + omitUndefined: true, + _isNested: true + }); + operand(this, where, delta, data, value); + } + } + + if (divergent.length) { + return new DivergentArrayError(divergent); + } + + if (this.$__.version) { + this.$__version(where, delta); + } + return [where, delta]; +}; + +/*! + * Determine if array was populated with some form of filter and is now + * being updated in a manner which could overwrite data unintentionally. + * + * @see https://github.com/Automattic/mongoose/issues/1334 + * @param {Document} doc + * @param {String} path + * @return {String|undefined} + */ + +function checkDivergentArray(doc, path, array) { + // see if we populated this path + const pop = doc.$populated(path, true); + + if (!pop && doc.$__.selected) { + // If any array was selected using an $elemMatch projection, we deny the update. + // NOTE: MongoDB only supports projected $elemMatch on top level array. + const top = path.split('.')[0]; + if (doc.$__.selected[top + '.$']) { + return top; + } + } + + if (!(pop && utils.isMongooseArray(array))) return; + + // If the array was populated using options that prevented all + // documents from being returned (match, skip, limit) or they + // deselected the _id field, $pop and $set of the array are + // not safe operations. If _id was deselected, we do not know + // how to remove elements. $pop will pop off the _id from the end + // of the array in the db which is not guaranteed to be the + // same as the last element we have here. $set of the entire array + // would be similarly destructive as we never received all + // elements of the array and potentially would overwrite data. + const check = pop.options.match || + pop.options.options && utils.object.hasOwnProperty(pop.options.options, 'limit') || // 0 is not permitted + pop.options.options && pop.options.options.skip || // 0 is permitted + pop.options.select && // deselected _id? + (pop.options.select._id === 0 || + /\s?-_id\s?/.test(pop.options.select)); + + if (check) { + const atomics = array[arrayAtomicsSymbol]; + if (Object.keys(atomics).length === 0 || atomics.$set || atomics.$pop) { + return path; + } + } +} + +/** + * Appends versioning to the where and update clauses. + * + * @api private + * @method $__version + * @memberOf Model + * @instance + */ + +Model.prototype.$__version = function(where, delta) { + const key = this.$__schema.options.versionKey; + if (where === true) { + // this is an insert + if (key) { + setDottedPath(delta, key, 0); + this.$__setValue(key, 0); + } + return; + } + + if (key === false) { + return; + } + + // updates + + // only apply versioning if our versionKey was selected. else + // there is no way to select the correct version. we could fail + // fast here and force them to include the versionKey but + // thats a bit intrusive. can we do this automatically? + + if (!this.$__isSelected(key)) { + return; + } + + // $push $addToSet don't need the where clause set + if (VERSION_WHERE === (VERSION_WHERE & this.$__.version)) { + const value = this.$__getValue(key); + if (value != null) where[key] = value; + } + + if (VERSION_INC === (VERSION_INC & this.$__.version)) { + if (get(delta.$set, key, null) != null) { + // Version key is getting set, means we'll increment the doc's version + // after a successful save, so we should set the incremented version so + // future saves don't fail (gh-5779) + ++delta.$set[key]; + } else { + delta.$inc = delta.$inc || {}; + delta.$inc[key] = 1; + } + } +}; + +/** + * Signal that we desire an increment of this documents version. + * + * #### Example: + * + * Model.findById(id, function (err, doc) { + * doc.increment(); + * doc.save(function (err) { .. }) + * }) + * + * @see versionKeys https://mongoosejs.com/docs/guide.html#versionKey + * @api public + */ + +function increment() { + this.$__.version = VERSION_ALL; + return this; +} + +Model.prototype.increment = increment; + +/** + * Returns a query object + * + * @api private + * @method $__where + * @memberOf Model + * @instance + */ + +Model.prototype.$__where = function _where(where) { + where || (where = {}); + + if (!where._id) { + where._id = this._doc._id; + } + + if (this._doc._id === void 0) { + return new MongooseError('No _id found on document!'); + } + + return where; +}; + +/** + * Removes this document from the db. + * + * #### Example: + * product.remove(function (err, product) { + * if (err) return handleError(err); + * Product.findById(product._id, function (err, product) { + * console.log(product) // null + * }) + * }) + * + * + * As an extra measure of flow control, remove will return a Promise (bound to `fn` if passed) so it could be chained, or hooked to receive errors + * + * #### Example: + * product.remove().then(function (product) { + * ... + * }).catch(function (err) { + * assert.ok(err) + * }) + * + * @param {Object} [options] + * @param {Session} [options.session=null] the [session](https://docs.mongodb.com/manual/reference/server-sessions/) associated with this operation. If not specified, defaults to the [document's associated session](api.html#document_Document-$session). + * @param {function(err,product)} [fn] optional callback + * @return {Promise} Promise + * @api public + */ + +Model.prototype.remove = function remove(options, fn) { + if (typeof options === 'function') { + fn = options; + options = undefined; + } + + options = new RemoveOptions(options); + if (options.hasOwnProperty('session')) { + this.$session(options.session); + } + this.$op = 'remove'; + + fn = this.constructor.$handleCallbackError(fn); + + return this.constructor.db.base._promiseOrCallback(fn, cb => { + cb = this.constructor.$wrapCallback(cb); + this.$__remove(options, (err, res) => { + this.$op = null; + cb(err, res); + }); + }, this.constructor.events); +}; + +/*! + * Alias for remove + */ + +Model.prototype.$remove = Model.prototype.remove; +Model.prototype.delete = Model.prototype.remove; + +/** + * Removes this document from the db. Equivalent to `.remove()`. + * + * #### Example: + * product = await product.deleteOne(); + * await Product.findById(product._id); // null + * + * @param {function(err,product)} [fn] optional callback + * @return {Promise} Promise + * @api public + */ + +Model.prototype.deleteOne = function deleteOne(options, fn) { + if (typeof options === 'function') { + fn = options; + options = undefined; + } + + if (!options) { + options = {}; + } + + fn = this.constructor.$handleCallbackError(fn); + + return this.constructor.db.base._promiseOrCallback(fn, cb => { + cb = this.constructor.$wrapCallback(cb); + this.$__deleteOne(options, cb); + }, this.constructor.events); +}; + +/*! + * ignore + */ + +Model.prototype.$__remove = function $__remove(options, cb) { + if (this.$__.isDeleted) { + return immediate(() => cb(null, this)); + } + + const where = this.$__where(); + if (where instanceof MongooseError) { + return cb(where); + } + + _applyCustomWhere(this, where); + + const session = this.$session(); + if (!options.hasOwnProperty('session')) { + options.session = session; + } + + this[modelCollectionSymbol].deleteOne(where, options, err => { + if (!err) { + this.$__.isDeleted = true; + this.$emit('remove', this); + this.constructor.emit('remove', this); + return cb(null, this); + } + this.$__.isDeleted = false; + cb(err); + }); +}; + +/*! + * ignore + */ + +Model.prototype.$__deleteOne = Model.prototype.$__remove; + +/** + * Returns another Model instance. + * + * #### Example: + * + * const doc = new Tank; + * doc.model('User').findById(id, callback); + * + * @param {String} name model name + * @method model + * @api public + * @return {Model} + */ + +Model.prototype.model = function model(name) { + return this[modelDbSymbol].model(name); +}; + +/** + * Returns another Model instance. + * + * #### Example: + * + * const doc = new Tank; + * doc.model('User').findById(id, callback); + * + * @param {String} name model name + * @method $model + * @api public + * @return {Model} + */ + +Model.prototype.$model = function $model(name) { + return this[modelDbSymbol].model(name); +}; + +/** + * Returns a document with `_id` only if at least one document exists in the database that matches + * the given `filter`, and `null` otherwise. + * + * Under the hood, `MyModel.exists({ answer: 42 })` is equivalent to + * `MyModel.findOne({ answer: 42 }).select({ _id: 1 }).lean()` + * + * #### Example: + * await Character.deleteMany({}); + * await Character.create({ name: 'Jean-Luc Picard' }); + * + * await Character.exists({ name: /picard/i }); // { _id: ... } + * await Character.exists({ name: /riker/i }); // null + * + * This function triggers the following middleware. + * + * - `findOne()` + * + * @param {Object} filter + * @param {Object} [options] optional see [`Query.prototype.setOptions()`](https://mongoosejs.com/docs/api.html#query_Query-setOptions) + * @param {Function} [callback] callback + * @return {Query} + */ + +Model.exists = function exists(filter, options, callback) { + _checkContext(this, 'exists'); + if (typeof options === 'function') { + callback = options; + options = null; + } + + const query = this.findOne(filter). + select({ _id: 1 }). + lean(). + setOptions(options); + + if (typeof callback === 'function') { + return query.exec(callback); + } + + return query; +}; + +/** + * Adds a discriminator type. + * + * #### Example: + * + * function BaseSchema() { + * Schema.apply(this, arguments); + * + * this.add({ + * name: String, + * createdAt: Date + * }); + * } + * util.inherits(BaseSchema, Schema); + * + * const PersonSchema = new BaseSchema(); + * const BossSchema = new BaseSchema({ department: String }); + * + * const Person = mongoose.model('Person', PersonSchema); + * const Boss = Person.discriminator('Boss', BossSchema); + * new Boss().__t; // "Boss". `__t` is the default `discriminatorKey` + * + * const employeeSchema = new Schema({ boss: ObjectId }); + * const Employee = Person.discriminator('Employee', employeeSchema, 'staff'); + * new Employee().__t; // "staff" because of 3rd argument above + * + * @param {String} name discriminator model name + * @param {Schema} schema discriminator model schema + * @param {Object|String} [options] If string, same as `options.value`. + * @param {String} [options.value] the string stored in the `discriminatorKey` property. If not specified, Mongoose uses the `name` parameter. + * @param {Boolean} [options.clone=true] By default, `discriminator()` clones the given `schema`. Set to `false` to skip cloning. + * @param {Boolean} [options.overwriteModels=false] by default, Mongoose does not allow you to define a discriminator with the same name as another discriminator. Set this to allow overwriting discriminators with the same name. + * @return {Model} The newly created discriminator model + * @api public + */ + +Model.discriminator = function(name, schema, options) { + + let model; + if (typeof name === 'function') { + model = name; + name = utils.getFunctionName(model); + if (!(model.prototype instanceof Model)) { + throw new MongooseError('The provided class ' + name + ' must extend Model'); + } + } + + options = options || {}; + const value = utils.isPOJO(options) ? options.value : options; + const clone = typeof options.clone === 'boolean' ? options.clone : true; + + _checkContext(this, 'discriminator'); + + if (utils.isObject(schema) && !schema.instanceOfSchema) { + schema = new Schema(schema); + } + if (schema instanceof Schema && clone) { + schema = schema.clone(); + } + + schema = discriminator(this, name, schema, value, true); + if (this.db.models[name] && !schema.options.overwriteModels) { + throw new OverwriteModelError(name); + } + + schema.$isRootDiscriminator = true; + schema.$globalPluginsApplied = true; + + model = this.db.model(model || name, schema, this.$__collection.name); + this.discriminators[name] = model; + const d = this.discriminators[name]; + d.prototype.__proto__ = this.prototype; + Object.defineProperty(d, 'baseModelName', { + value: this.modelName, + configurable: true, + writable: false + }); + + // apply methods and statics + applyMethods(d, schema); + applyStatics(d, schema); + + if (this[subclassedSymbol] != null) { + for (const submodel of this[subclassedSymbol]) { + submodel.discriminators = submodel.discriminators || {}; + submodel.discriminators[name] = + model.__subclass(model.db, schema, submodel.collection.name); + } + } + + return d; +}; + +/*! + * Make sure `this` is a model + */ + +function _checkContext(ctx, fnName) { + // Check context, because it is easy to mistakenly type + // `new Model.discriminator()` and get an incomprehensible error + if (ctx == null || ctx === global) { + throw new MongooseError('`Model.' + fnName + '()` cannot run without a ' + + 'model as `this`. Make sure you are calling `MyModel.' + fnName + '()` ' + + 'where `MyModel` is a Mongoose model.'); + } else if (ctx[modelSymbol] == null) { + throw new MongooseError('`Model.' + fnName + '()` cannot run without a ' + + 'model as `this`. Make sure you are not calling ' + + '`new Model.' + fnName + '()`'); + } +} + +// Model (class) features + +/*! + * Give the constructor the ability to emit events. + */ + +for (const i in EventEmitter.prototype) { + Model[i] = EventEmitter.prototype[i]; +} + +/** + * This function is responsible for building [indexes](https://docs.mongodb.com/manual/indexes/), + * unless [`autoIndex`](https://mongoosejs.com/docs/guide.html#autoIndex) is turned off. + * + * Mongoose calls this function automatically when a model is created using + * [`mongoose.model()`](/docs/api.html#mongoose_Mongoose-model) or + * [`connection.model()`](/docs/api.html#connection_Connection-model), so you + * don't need to call it. This function is also idempotent, so you may call it + * to get back a promise that will resolve when your indexes are finished + * building as an alternative to [`MyModel.on('index')`](/docs/guide.html#indexes) + * + * #### Example: + * + * const eventSchema = new Schema({ thing: { type: 'string', unique: true }}) + * // This calls `Event.init()` implicitly, so you don't need to call + * // `Event.init()` on your own. + * const Event = mongoose.model('Event', eventSchema); + * + * Event.init().then(function(Event) { + * // You can also use `Event.on('index')` if you prefer event emitters + * // over promises. + * console.log('Indexes are done building!'); + * }); + * + * @api public + * @param {Function} [callback] + * @returns {Promise} + */ + +Model.init = function init(callback) { + _checkContext(this, 'init'); + + this.schema.emit('init', this); + + if (this.$init != null) { + if (callback) { + this.$init.then(() => callback(), err => callback(err)); + return null; + } + return this.$init; + } + + const Promise = PromiseProvider.get(); + const autoIndex = utils.getOption('autoIndex', + this.schema.options, this.db.config, this.db.base.options); + const autoCreate = utils.getOption('autoCreate', + this.schema.options, this.db.config, this.db.base.options); + + const _ensureIndexes = autoIndex ? + cb => this.ensureIndexes({ _automatic: true }, cb) : + cb => cb(); + const _createCollection = autoCreate ? + cb => this.createCollection({}, cb) : + cb => cb(); + + this.$init = new Promise((resolve, reject) => { + _createCollection(error => { + if (error) { + return reject(error); + } + _ensureIndexes(error => { + if (error) { + return reject(error); + } + resolve(this); + }); + }); + }); + + if (callback) { + this.$init.then(() => callback(), err => callback(err)); + this.$caught = true; + return null; + } else { + const _catch = this.$init.catch; + const _this = this; + this.$init.catch = function() { + this.$caught = true; + return _catch.apply(_this.$init, arguments); + }; + } + + return this.$init; +}; + + +/** + * Create the collection for this model. By default, if no indexes are specified, + * mongoose will not create the collection for the model until any documents are + * created. Use this method to create the collection explicitly. + * + * Note 1: You may need to call this before starting a transaction + * See https://docs.mongodb.com/manual/core/transactions/#transactions-and-operations + * + * Note 2: You don't have to call this if your schema contains index or unique field. + * In that case, just use `Model.init()` + * + * #### Example: + * + * const userSchema = new Schema({ name: String }) + * const User = mongoose.model('User', userSchema); + * + * User.createCollection().then(function(collection) { + * console.log('Collection is created!'); + * }); + * + * @api public + * @param {Object} [options] see [MongoDB driver docs](https://mongodb.github.io/node-mongodb-native/3.1/api/Db.html#createCollection) + * @param {Function} [callback] + * @returns {Promise} + */ + +Model.createCollection = function createCollection(options, callback) { + _checkContext(this, 'createCollection'); + + if (typeof options === 'string') { + throw new MongooseError('You can\'t specify a new collection name in Model.createCollection.' + + 'This is not like Connection.createCollection. Only options are accepted here.'); + } else if (typeof options === 'function') { + callback = options; + options = void 0; + } + + const schemaCollation = this && + this.schema && + this.schema.options && + this.schema.options.collation; + if (schemaCollation != null) { + options = Object.assign({ collation: schemaCollation }, options); + } + const capped = this && + this.schema && + this.schema.options && + this.schema.options.capped; + if (capped != null) { + if (typeof capped === 'number') { + options = Object.assign({ capped: true, size: capped }, options); + } else if (typeof capped === 'object') { + options = Object.assign({ capped: true }, capped, options); + } + } + const timeseries = this && + this.schema && + this.schema.options && + this.schema.options.timeseries; + if (timeseries != null) { + options = Object.assign({ timeseries }, options); + if (options.expireAfterSeconds != null) { + // do nothing + } else if (options.expires != null) { + utils.expires(options); + } else if (this.schema.options.expireAfterSeconds != null) { + options.expireAfterSeconds = this.schema.options.expireAfterSeconds; + } else if (this.schema.options.expires != null) { + options.expires = this.schema.options.expires; + utils.expires(options); + } + } + + callback = this.$handleCallbackError(callback); + + return this.db.base._promiseOrCallback(callback, cb => { + cb = this.$wrapCallback(cb); + + this.db.createCollection(this.$__collection.collectionName, options, utils.tick((err) => { + if (err != null && (err.name !== 'MongoServerError' || err.code !== 48)) { + return cb(err); + } + this.$__collection = this.db.collection(this.$__collection.collectionName, options); + cb(null, this.$__collection); + })); + }, this.events); +}; + +/** + * Makes the indexes in MongoDB match the indexes defined in this model's + * schema. This function will drop any indexes that are not defined in + * the model's schema except the `_id` index, and build any indexes that + * are in your schema but not in MongoDB. + * + * See the [introductory blog post](https://thecodebarbarian.com/whats-new-in-mongoose-5-2-syncindexes) + * for more information. + * + * #### Example: + * + * const schema = new Schema({ name: { type: String, unique: true } }); + * const Customer = mongoose.model('Customer', schema); + * await Customer.collection.createIndex({ age: 1 }); // Index is not in schema + * // Will drop the 'age' index and create an index on `name` + * await Customer.syncIndexes(); + * + * @param {Object} [options] options to pass to `ensureIndexes()` + * @param {Boolean} [options.background=null] if specified, overrides each index's `background` property + * @param {Function} [callback] optional callback + * @return {Promise|undefined} Returns `undefined` if callback is specified, returns a promise if no callback. + * @api public + */ + +Model.syncIndexes = function syncIndexes(options, callback) { + _checkContext(this, 'syncIndexes'); + + callback = this.$handleCallbackError(callback); + + return this.db.base._promiseOrCallback(callback, cb => { + cb = this.$wrapCallback(cb); + + this.createCollection(err => { + if (err != null && (err.name !== 'MongoServerError' || err.code !== 48)) { + return cb(err); + } + this.cleanIndexes((err, dropped) => { + if (err != null) { + return cb(err); + } + this.createIndexes(options, err => { + if (err != null) { + return cb(err); + } + cb(null, dropped); + }); + }); + }); + }, this.events); +}; + +/** + * Does a dry-run of Model.syncIndexes(), meaning that + * the result of this function would be the result of + * Model.syncIndexes(). + * + * @param {Object} [options] + * @param {Function} callback optional callback + * @returns {Promise} which contains an object, {toDrop, toCreate}, which + * are indexes that would be dropped in MongoDB and indexes that would be created in MongoDB. + */ + +Model.diffIndexes = function diffIndexes(options, callback) { + if (typeof options === 'function') { + callback = options; + options = null; + } + const toDrop = []; + const toCreate = []; + callback = this.$handleCallbackError(callback); + return this.db.base._promiseOrCallback(callback, cb => { + cb = this.$wrapCallback(cb); + this.listIndexes((err, dbIndexes) => { + if (dbIndexes === undefined) { + dbIndexes = []; + } + dbIndexes = getRelatedDBIndexes(this, dbIndexes); + const schemaIndexes = getRelatedSchemaIndexes(this, this.schema.indexes()); + + for (const dbIndex of dbIndexes) { + let found = false; + // Never try to drop `_id` index, MongoDB server doesn't allow it + if (isDefaultIdIndex(dbIndex)) { + continue; + } + + for (const [schemaIndexKeysObject, schemaIndexOptions] of schemaIndexes) { + const options = decorateDiscriminatorIndexOptions(this.schema, utils.clone(schemaIndexOptions)); + applySchemaCollation(schemaIndexKeysObject, options, this.schema.options); + + if (isIndexEqual(schemaIndexKeysObject, options, dbIndex)) { + found = true; + } + } + + if (!found) { + toDrop.push(dbIndex.name); + } + } + // Iterate through the indexes created on the schema and + // compare against the indexes in mongodb. + if (!options || options.toCreate !== false) { + for (const schemaIndex of schemaIndexes) { + let found = false; + const key = schemaIndex[0]; + const options = decorateDiscriminatorIndexOptions(this.schema, utils.clone(schemaIndex[1])); + for (const index of dbIndexes) { + if (isDefaultIdIndex(index)) { + continue; + } + if (isIndexEqual(key, options, index)) { + found = true; + } + } + if (!found) { + toCreate.push(key); + } + } + } + cb(null, { toDrop, toCreate }); + }); + }); +}; + +/** + * Deletes all indexes that aren't defined in this model's schema. Used by + * `syncIndexes()`. + * + * The returned promise resolves to a list of the dropped indexes' names as an array + * + * @param {Function} [callback] optional callback + * @return {Promise|undefined} Returns `undefined` if callback is specified, returns a promise if no callback. + * @api public + */ + +Model.cleanIndexes = function cleanIndexes(callback) { + _checkContext(this, 'cleanIndexes'); + + callback = this.$handleCallbackError(callback); + + return this.db.base._promiseOrCallback(callback, cb => { + const collection = this.$__collection; + + this.diffIndexes({ toCreate: false }, (err, res) => { + if (err != null) { + return cb(err); + } + + const toDrop = res.toDrop; + + if (toDrop.length === 0) { + return cb(null, []); + } + + dropIndexes(toDrop, cb); + }); + + function dropIndexes(toDrop, cb) { + let remaining = toDrop.length; + let error = false; + toDrop.forEach(indexName => { + collection.dropIndex(indexName, err => { + if (err != null) { + error = true; + return cb(err); + } + if (!error) { + --remaining || cb(null, toDrop); + } + }); + }); + } + }); +}; + +/** + * Lists the indexes currently defined in MongoDB. This may or may not be + * the same as the indexes defined in your schema depending on whether you + * use the [`autoIndex` option](/docs/guide.html#autoIndex) and if you + * build indexes manually. + * + * @param {Function} [cb] optional callback + * @return {Promise|undefined} Returns `undefined` if callback is specified, returns a promise if no callback. + * @api public + */ + +Model.listIndexes = function init(callback) { + _checkContext(this, 'listIndexes'); + + const _listIndexes = cb => { + this.$__collection.listIndexes().toArray(cb); + }; + + callback = this.$handleCallbackError(callback); + + return this.db.base._promiseOrCallback(callback, cb => { + cb = this.$wrapCallback(cb); + + // Buffering + if (this.$__collection.buffer) { + this.$__collection.addQueue(_listIndexes, [cb]); + } else { + _listIndexes(cb); + } + }, this.events); +}; + +/** + * Sends `createIndex` commands to mongo for each index declared in the schema. + * The `createIndex` commands are sent in series. + * + * #### Example: + * + * Event.ensureIndexes(function (err) { + * if (err) return handleError(err); + * }); + * + * After completion, an `index` event is emitted on this `Model` passing an error if one occurred. + * + * #### Example: + * + * const eventSchema = new Schema({ thing: { type: 'string', unique: true }}) + * const Event = mongoose.model('Event', eventSchema); + * + * Event.on('index', function (err) { + * if (err) console.error(err); // error occurred during index creation + * }) + * + * _NOTE: It is not recommended that you run this in production. Index creation may impact database performance depending on your load. Use with caution._ + * + * @param {Object} [options] internal options + * @param {Function} [cb] optional callback + * @return {Promise} + * @api public + */ + +Model.ensureIndexes = function ensureIndexes(options, callback) { + _checkContext(this, 'ensureIndexes'); + + if (typeof options === 'function') { + callback = options; + options = null; + } + + callback = this.$handleCallbackError(callback); + + return this.db.base._promiseOrCallback(callback, cb => { + cb = this.$wrapCallback(cb); + + _ensureIndexes(this, options || {}, error => { + if (error) { + return cb(error); + } + cb(null); + }); + }, this.events); +}; + +/** + * Similar to `ensureIndexes()`, except for it uses the [`createIndex`](https://mongodb.github.io/node-mongodb-native/2.2/api/Collection.html#createIndex) + * function. + * + * @param {Object} [options] internal options + * @param {Function} [cb] optional callback + * @return {Promise} + * @api public + */ + +Model.createIndexes = function createIndexes(options, callback) { + _checkContext(this, 'createIndexes'); + + if (typeof options === 'function') { + callback = options; + options = {}; + } + options = options || {}; + options.createIndex = true; + return this.ensureIndexes(options, callback); +}; + +/*! + * ignore + */ + +function _ensureIndexes(model, options, callback) { + const indexes = model.schema.indexes(); + let indexError; + + options = options || {}; + const done = function(err) { + if (err && !model.$caught) { + model.emit('error', err); + } + model.emit('index', err || indexError); + callback && callback(err || indexError); + }; + + for (const index of indexes) { + if (isDefaultIdIndex(index)) { + utils.warn('mongoose: Cannot specify a custom index on `_id` for ' + + 'model name "' + model.modelName + '", ' + + 'MongoDB does not allow overwriting the default `_id` index. See ' + + 'https://bit.ly/mongodb-id-index'); + } + } + + if (!indexes.length) { + immediate(function() { + done(); + }); + return; + } + // Indexes are created one-by-one to support how MongoDB < 2.4 deals + // with background indexes. + + const indexSingleDone = function(err, fields, options, name) { + model.emit('index-single-done', err, fields, options, name); + }; + const indexSingleStart = function(fields, options) { + model.emit('index-single-start', fields, options); + }; + + const baseSchema = model.schema._baseSchema; + const baseSchemaIndexes = baseSchema ? baseSchema.indexes() : []; + + immediate(function() { + // If buffering is off, do this manually. + if (options._automatic && !model.collection.collection) { + model.collection.addQueue(create, []); + } else { + create(); + } + }); + + + function create() { + if (options._automatic) { + if (model.schema.options.autoIndex === false || + (model.schema.options.autoIndex == null && model.db.config.autoIndex === false)) { + return done(); + } + } + + const index = indexes.shift(); + if (!index) { + return done(); + } + if (options._automatic && index[1]._autoIndex === false) { + return create(); + } + + if (baseSchemaIndexes.find(i => utils.deepEqual(i, index))) { + return create(); + } + + const indexFields = utils.clone(index[0]); + const indexOptions = utils.clone(index[1]); + + delete indexOptions._autoIndex; + decorateDiscriminatorIndexOptions(model.schema, indexOptions); + applyWriteConcern(model.schema, indexOptions); + applySchemaCollation(indexFields, indexOptions, model.schema.options); + + indexSingleStart(indexFields, options); + + if ('background' in options) { + indexOptions.background = options.background; + } + + model.collection.createIndex(indexFields, indexOptions, utils.tick(function(err, name) { + indexSingleDone(err, indexFields, indexOptions, name); + if (err) { + if (!indexError) { + indexError = err; + } + if (!model.$caught) { + model.emit('error', err); + } + } + create(); + })); + } +} + +/** + * Schema the model uses. + * + * @property schema + * @receiver Model + * @api public + * @memberOf Model + */ + +Model.schema; + +/*! + * Connection instance the model uses. + * + * @property db + * @api public + * @memberOf Model + */ + +Model.db; + +/*! + * Collection the model uses. + * + * @property collection + * @api public + * @memberOf Model + */ + +Model.collection; + +/** + * Internal collection the model uses. + * + * @property collection + * @api private + * @memberOf Model + */ +Model.$__collection; + +/** + * Base Mongoose instance the model uses. + * + * @property base + * @api public + * @memberOf Model + */ + +Model.base; + +/** + * Registered discriminators for this model. + * + * @property discriminators + * @api public + * @memberOf Model + */ + +Model.discriminators; + +/** + * Translate any aliases fields/conditions so the final query or document object is pure + * + * #### Example: + * + * Character + * .find(Character.translateAliases({ + * '名': 'Eddard Stark' // Alias for 'name' + * }) + * .exec(function(err, characters) {}) + * + * #### Note: + * Only translate arguments of object type anything else is returned raw + * + * @param {Object} fields fields/conditions that may contain aliased keys + * @return {Object} the translated 'pure' fields/conditions + */ +Model.translateAliases = function translateAliases(fields) { + _checkContext(this, 'translateAliases'); + + const translate = (key, value) => { + let alias; + const translated = []; + const fieldKeys = key.split('.'); + let currentSchema = this.schema; + for (const i in fieldKeys) { + const name = fieldKeys[i]; + if (currentSchema && currentSchema.aliases[name]) { + alias = currentSchema.aliases[name]; + // Alias found, + translated.push(alias); + } else { + alias = name; + // Alias not found, so treat as un-aliased key + translated.push(name); + } + + // Check if aliased path is a schema + if (currentSchema && currentSchema.paths[alias]) { + currentSchema = currentSchema.paths[alias].schema; + } + else + currentSchema = null; + } + + const translatedKey = translated.join('.'); + if (fields instanceof Map) + fields.set(translatedKey, value); + else + fields[translatedKey] = value; + + if (translatedKey !== key) { + // We'll be using the translated key instead + if (fields instanceof Map) { + // Delete from map + fields.delete(key); + } else { + // Delete from object + delete fields[key]; // We'll be using the translated key instead + } + } + return fields; + }; + + if (typeof fields === 'object') { + // Fields is an object (query conditions or document fields) + if (fields instanceof Map) { + // A Map was supplied + for (const field of new Map(fields)) { + fields = translate(field[0], field[1]); + } + } else { + // Infer a regular object was supplied + for (const key of Object.keys(fields)) { + fields = translate(key, fields[key]); + if (key[0] === '$') { + if (Array.isArray(fields[key])) { + for (const i in fields[key]) { + // Recursively translate nested queries + fields[key][i] = this.translateAliases(fields[key][i]); + } + } + } + } + } + + return fields; + } else { + // Don't know typeof fields + return fields; + } +}; + +/** + * Removes all documents that match `conditions` from the collection. + * To remove just the first document that matches `conditions`, set the `single` + * option to true. + * + * This method is deprecated. See [Deprecation Warnings](../deprecations.html#remove) for details. + * + * #### Example: + * + * const res = await Character.remove({ name: 'Eddard Stark' }); + * res.deletedCount; // Number of documents removed + * + * #### Note: + * + * This method sends a remove command directly to MongoDB, no Mongoose documents + * are involved. Because no Mongoose documents are involved, Mongoose does + * not execute [document middleware](/docs/middleware.html#types-of-middleware). + * + * @deprecated + * @param {Object} conditions + * @param {Object} [options] + * @param {Session} [options.session=null] the [session](https://docs.mongodb.com/manual/reference/server-sessions/) associated with this operation. + * @param {Function} [callback] + * @return {Query} + * @api public + */ + +Model.remove = function remove(conditions, options, callback) { + _checkContext(this, 'remove'); + + if (typeof conditions === 'function') { + callback = conditions; + conditions = {}; + options = null; + } else if (typeof options === 'function') { + callback = options; + options = null; + } + + // get the mongodb collection object + const mq = new this.Query({}, {}, this, this.$__collection); + mq.setOptions(options); + + callback = this.$handleCallbackError(callback); + + return mq.remove(conditions, callback); +}; + +/** + * Deletes the first document that matches `conditions` from the collection. + * It returns an object with the property `deletedCount` indicating how many documents were deleted. + * Behaves like `remove()`, but deletes at most one document regardless of the + * `single` option. + * + * #### Example: + * + * await Character.deleteOne({ name: 'Eddard Stark' }); // returns {deletedCount: 1} + * + * #### Note: + * + * This function triggers `deleteOne` query hooks. Read the + * [middleware docs](/docs/middleware.html#naming) to learn more. + * + * @param {Object} conditions + * @param {Object} [options] optional see [`Query.prototype.setOptions()`](https://mongoosejs.com/docs/api.html#query_Query-setOptions) + * @param {Function} [callback] + * @return {Query} + * @api public + */ + +Model.deleteOne = function deleteOne(conditions, options, callback) { + _checkContext(this, 'deleteOne'); + + if (typeof conditions === 'function') { + callback = conditions; + conditions = {}; + options = null; + } + else if (typeof options === 'function') { + callback = options; + options = null; + } + + const mq = new this.Query({}, {}, this, this.$__collection); + mq.setOptions(options); + + callback = this.$handleCallbackError(callback); + + return mq.deleteOne(conditions, callback); +}; + +/** + * Deletes all of the documents that match `conditions` from the collection. + * It returns an object with the property `deletedCount` containing the number of documents deleted. + * Behaves like `remove()`, but deletes all documents that match `conditions` + * regardless of the `single` option. + * + * #### Example: + * + * await Character.deleteMany({ name: /Stark/, age: { $gte: 18 } }); // returns {deletedCount: x} where x is the number of documents deleted. + * + * #### Note: + * + * This function triggers `deleteMany` query hooks. Read the + * [middleware docs](/docs/middleware.html#naming) to learn more. + * + * @param {Object} conditions + * @param {Object} [options] optional see [`Query.prototype.setOptions()`](https://mongoosejs.com/docs/api.html#query_Query-setOptions) + * @param {Function} [callback] + * @return {Query} + * @api public + */ + +Model.deleteMany = function deleteMany(conditions, options, callback) { + _checkContext(this, 'deleteMany'); + + if (typeof conditions === 'function') { + callback = conditions; + conditions = {}; + options = null; + } else if (typeof options === 'function') { + callback = options; + options = null; + } + + const mq = new this.Query({}, {}, this, this.$__collection); + mq.setOptions(options); + + callback = this.$handleCallbackError(callback); + + return mq.deleteMany(conditions, callback); +}; + +/** + * Finds documents. + * + * Mongoose casts the `filter` to match the model's schema before the command is sent. + * See our [query casting tutorial](/docs/tutorials/query_casting.html) for + * more information on how Mongoose casts `filter`. + * + * #### Examples: + * + * // find all documents + * await MyModel.find({}); + * + * // find all documents named john and at least 18 + * await MyModel.find({ name: 'john', age: { $gte: 18 } }).exec(); + * + * // executes, passing results to callback + * MyModel.find({ name: 'john', age: { $gte: 18 }}, function (err, docs) {}); + * + * // executes, name LIKE john and only selecting the "name" and "friends" fields + * await MyModel.find({ name: /john/i }, 'name friends').exec(); + * + * // passing options + * await MyModel.find({ name: /john/i }, null, { skip: 10 }).exec(); + * + * @param {Object|ObjectId} filter + * @param {Object|String|Array} [projection] optional fields to return, see [`Query.prototype.select()`](https://mongoosejs.com/docs/api.html#query_Query-select) + * @param {Object} [options] optional see [`Query.prototype.setOptions()`](https://mongoosejs.com/docs/api.html#query_Query-setOptions) + * @param {Function} [callback] + * @return {Query} + * @see field selection #query_Query-select + * @see query casting /docs/tutorials/query_casting.html + * @api public + */ + +Model.find = function find(conditions, projection, options, callback) { + _checkContext(this, 'find'); + + if (typeof conditions === 'function') { + callback = conditions; + conditions = {}; + projection = null; + options = null; + } else if (typeof projection === 'function') { + callback = projection; + projection = null; + options = null; + } else if (typeof options === 'function') { + callback = options; + options = null; + } + + const mq = new this.Query({}, {}, this, this.$__collection); + mq.select(projection); + mq.setOptions(options); + + callback = this.$handleCallbackError(callback); + + return mq.find(conditions, callback); +}; + +/** + * Finds a single document by its _id field. `findById(id)` is almost* + * equivalent to `findOne({ _id: id })`. If you want to query by a document's + * `_id`, use `findById()` instead of `findOne()`. + * + * The `id` is cast based on the Schema before sending the command. + * + * This function triggers the following middleware. + * + * - `findOne()` + * + * \* Except for how it treats `undefined`. If you use `findOne()`, you'll see + * that `findOne(undefined)` and `findOne({ _id: undefined })` are equivalent + * to `findOne({})` and return arbitrary documents. However, mongoose + * translates `findById(undefined)` into `findOne({ _id: null })`. + * + * #### Example: + * + * // Find the adventure with the given `id`, or `null` if not found + * await Adventure.findById(id).exec(); + * + * // using callback + * Adventure.findById(id, function (err, adventure) {}); + * + * // select only the adventures name and length + * await Adventure.findById(id, 'name length').exec(); + * + * @param {Any} id value of `_id` to query by + * @param {Object|String|Array} [projection] optional fields to return, see [`Query.prototype.select()`](#query_Query-select) + * @param {Object} [options] optional see [`Query.prototype.setOptions()`](https://mongoosejs.com/docs/api.html#query_Query-setOptions) + * @param {Function} [callback] + * @return {Query} + * @see field selection #query_Query-select + * @see lean queries /docs/tutorials/lean.html + * @see findById in Mongoose https://masteringjs.io/tutorials/mongoose/find-by-id + * @api public + */ + +Model.findById = function findById(id, projection, options, callback) { + _checkContext(this, 'findById'); + + if (typeof id === 'undefined') { + id = null; + } + + callback = this.$handleCallbackError(callback); + + return this.findOne({ _id: id }, projection, options, callback); +}; + +/** + * Finds one document. + * + * The `conditions` are cast to their respective SchemaTypes before the command is sent. + * + * *Note:* `conditions` is optional, and if `conditions` is null or undefined, + * mongoose will send an empty `findOne` command to MongoDB, which will return + * an arbitrary document. If you're querying by `_id`, use `findById()` instead. + * + * #### Example: + * + * // Find one adventure whose `country` is 'Croatia', otherwise `null` + * await Adventure.findOne({ country: 'Croatia' }).exec(); + * + * // using callback + * Adventure.findOne({ country: 'Croatia' }, function (err, adventure) {}); + * + * // select only the adventures name and length + * await Adventure.findOne({ country: 'Croatia' }, 'name length').exec(); + * + * @param {Object} [conditions] + * @param {Object|String|Array} [projection] optional fields to return, see [`Query.prototype.select()`](#query_Query-select) + * @param {Object} [options] optional see [`Query.prototype.setOptions()`](https://mongoosejs.com/docs/api.html#query_Query-setOptions) + * @param {Function} [callback] + * @return {Query} + * @see field selection #query_Query-select + * @see lean queries /docs/tutorials/lean.html + * @api public + */ + +Model.findOne = function findOne(conditions, projection, options, callback) { + _checkContext(this, 'findOne'); + if (typeof options === 'function') { + callback = options; + options = null; + } else if (typeof projection === 'function') { + callback = projection; + projection = null; + options = null; + } else if (typeof conditions === 'function') { + callback = conditions; + conditions = {}; + projection = null; + options = null; + } + + const mq = new this.Query({}, {}, this, this.$__collection); + mq.select(projection); + mq.setOptions(options); + + callback = this.$handleCallbackError(callback); + return mq.findOne(conditions, callback); +}; + +/** + * Estimates the number of documents in the MongoDB collection. Faster than + * using `countDocuments()` for large collections because + * `estimatedDocumentCount()` uses collection metadata rather than scanning + * the entire collection. + * + * #### Example: + * + * const numAdventures = await Adventure.estimatedDocumentCount(); + * + * @param {Object} [options] + * @param {Function} [callback] + * @return {Query} + * @api public + */ + +Model.estimatedDocumentCount = function estimatedDocumentCount(options, callback) { + _checkContext(this, 'estimatedDocumentCount'); + + const mq = new this.Query({}, {}, this, this.$__collection); + + callback = this.$handleCallbackError(callback); + + return mq.estimatedDocumentCount(options, callback); +}; + +/** + * Counts number of documents matching `filter` in a database collection. + * + * #### Example: + * + * Adventure.countDocuments({ type: 'jungle' }, function (err, count) { + * console.log('there are %d jungle adventures', count); + * }); + * + * If you want to count all documents in a large collection, + * use the [`estimatedDocumentCount()` function](/docs/api.html#model_Model.estimatedDocumentCount) + * instead. If you call `countDocuments({})`, MongoDB will always execute + * a full collection scan and **not** use any indexes. + * + * The `countDocuments()` function is similar to `count()`, but there are a + * [few operators that `countDocuments()` does not support](https://mongodb.github.io/node-mongodb-native/3.1/api/Collection.html#countDocuments). + * Below are the operators that `count()` supports but `countDocuments()` does not, + * and the suggested replacement: + * + * - `$where`: [`$expr`](https://docs.mongodb.com/manual/reference/operator/query/expr/) + * - `$near`: [`$geoWithin`](https://docs.mongodb.com/manual/reference/operator/query/geoWithin/) with [`$center`](https://docs.mongodb.com/manual/reference/operator/query/center/#op._S_center) + * - `$nearSphere`: [`$geoWithin`](https://docs.mongodb.com/manual/reference/operator/query/geoWithin/) with [`$centerSphere`](https://docs.mongodb.com/manual/reference/operator/query/centerSphere/#op._S_centerSphere) + * + * @param {Object} filter + * @param {Function} [callback] + * @return {Query} + * @api public + */ + +Model.countDocuments = function countDocuments(conditions, options, callback) { + _checkContext(this, 'countDocuments'); + + if (typeof conditions === 'function') { + callback = conditions; + conditions = {}; + } + if (typeof options === 'function') { + callback = options; + options = null; + } + + const mq = new this.Query({}, {}, this, this.$__collection); + if (options != null) { + mq.setOptions(options); + } + + callback = this.$handleCallbackError(callback); + + return mq.countDocuments(conditions, callback); +}; + +/** + * Counts number of documents that match `filter` in a database collection. + * + * This method is deprecated. If you want to count the number of documents in + * a collection, e.g. `count({})`, use the [`estimatedDocumentCount()` function](/docs/api.html#model_Model.estimatedDocumentCount) + * instead. Otherwise, use the [`countDocuments()`](/docs/api.html#model_Model.countDocuments) function instead. + * + * #### Example: + * + * const count = await Adventure.count({ type: 'jungle' }); + * console.log('there are %d jungle adventures', count); + * + * @deprecated + * @param {Object} filter + * @param {Function} [callback] + * @return {Query} + * @api public + */ + +Model.count = function count(conditions, callback) { + _checkContext(this, 'count'); + + if (typeof conditions === 'function') { + callback = conditions; + conditions = {}; + } + + const mq = new this.Query({}, {}, this, this.$__collection); + + callback = this.$handleCallbackError(callback); + + return mq.count(conditions, callback); +}; + +/** + * Creates a Query for a `distinct` operation. + * + * Passing a `callback` executes the query. + * + * #### Example + * + * Link.distinct('url', { clicks: {$gt: 100}}, function (err, result) { + * if (err) return handleError(err); + * + * assert(Array.isArray(result)); + * console.log('unique urls with more than 100 clicks', result); + * }) + * + * const query = Link.distinct('url'); + * query.exec(callback); + * + * @param {String} field + * @param {Object} [conditions] optional + * @param {Function} [callback] + * @return {Query} + * @api public + */ + +Model.distinct = function distinct(field, conditions, callback) { + _checkContext(this, 'distinct'); + + const mq = new this.Query({}, {}, this, this.$__collection); + + if (typeof conditions === 'function') { + callback = conditions; + conditions = {}; + } + callback = this.$handleCallbackError(callback); + + return mq.distinct(field, conditions, callback); +}; + +/** + * Creates a Query, applies the passed conditions, and returns the Query. + * + * For example, instead of writing: + * + * User.find({age: {$gte: 21, $lte: 65}}, callback); + * + * we can instead write: + * + * User.where('age').gte(21).lte(65).exec(callback); + * + * Since the Query class also supports `where` you can continue chaining + * + * User + * .where('age').gte(21).lte(65) + * .where('name', /^b/i) + * ... etc + * + * @param {String} path + * @param {Object} [val] optional value + * @return {Query} + * @api public + */ + +Model.where = function where(path, val) { + _checkContext(this, 'where'); + + void val; // eslint + const mq = new this.Query({}, {}, this, this.$__collection).find({}); + return mq.where.apply(mq, arguments); +}; + +/** + * Creates a `Query` and specifies a `$where` condition. + * + * Sometimes you need to query for things in mongodb using a JavaScript expression. You can do so via `find({ $where: javascript })`, or you can use the mongoose shortcut method $where via a Query chain or from your mongoose Model. + * + * Blog.$where('this.username.indexOf("val") !== -1').exec(function (err, docs) {}); + * + * @param {String|Function} argument is a javascript string or anonymous function + * @method $where + * @memberOf Model + * @return {Query} + * @see Query.$where #query_Query-%24where + * @api public + */ + +Model.$where = function $where() { + _checkContext(this, '$where'); + + const mq = new this.Query({}, {}, this, this.$__collection).find({}); + return mq.$where.apply(mq, arguments); +}; + +/** + * Issues a mongodb findAndModify update command. + * + * Finds a matching document, updates it according to the `update` arg, passing any `options`, and returns the found document (if any) to the callback. The query executes if `callback` is passed else a Query object is returned. + * + * #### Options: + * + * - `new`: bool - if true, return the modified document rather than the original. defaults to false (changed in 4.0) + * - `upsert`: bool - creates the object if it doesn't exist. defaults to false. + * - `overwrite`: bool - if true, replace the entire document. + * - `fields`: {Object|String} - Field selection. Equivalent to `.select(fields).findOneAndUpdate()` + * - `maxTimeMS`: puts a time limit on the query - requires mongodb >= 2.6.0 + * - `sort`: if multiple docs are found by the conditions, sets the sort order to choose which doc to update + * - `runValidators`: if true, runs [update validators](/docs/validation.html#update-validators) on this command. Update validators validate the update operation against the model's schema. + * - `setDefaultsOnInsert`: `true` by default. If `setDefaultsOnInsert` and `upsert` are true, mongoose will apply the [defaults](https://mongoosejs.com/docs/defaults.html) specified in the model's schema if a new document is created. + * - `rawResult`: if true, returns the [raw result from the MongoDB driver](https://mongodb.github.io/node-mongodb-native/4.3/interfaces/ModifyResult.html) + * - `strict`: overwrites the schema's [strict mode option](https://mongoosejs.com/docs/guide.html#strict) for this update + * + * #### Examples: + * + * A.findOneAndUpdate(conditions, update, options, callback) // executes + * A.findOneAndUpdate(conditions, update, options) // returns Query + * A.findOneAndUpdate(conditions, update, callback) // executes + * A.findOneAndUpdate(conditions, update) // returns Query + * A.findOneAndUpdate() // returns Query + * + * #### Note: + * + * All top level update keys which are not `atomic` operation names are treated as set operations: + * + * #### Example: + * + * const query = { name: 'borne' }; + * Model.findOneAndUpdate(query, { name: 'jason bourne' }, options, callback) + * + * // is sent as + * Model.findOneAndUpdate(query, { $set: { name: 'jason bourne' }}, options, callback) + * + * This helps prevent accidentally overwriting your document with `{ name: 'jason bourne' }`. + * + * #### Note: + * + * `findOneAndX` and `findByIdAndX` functions support limited validation that + * you can enable by setting the `runValidators` option. + * + * If you need full-fledged validation, use the traditional approach of first + * retrieving the document. + * + * const doc = await Model.findById(id); + * doc.name = 'jason bourne'; + * await doc.save(); + * + * @param {Object} [conditions] + * @param {Object} [update] + * @param {Object} [options] optional see [`Query.prototype.setOptions()`](https://mongoosejs.com/docs/api.html#query_Query-setOptions) + * @param {String} [options.returnDocument='before'] Has two possible values, `'before'` and `'after'`. By default, it will return the document before the update was applied. + * @param {Object} [options.lean] if truthy, mongoose will return the document as a plain JavaScript object rather than a mongoose document. See [`Query.lean()`](/docs/api.html#query_Query-lean) and [the Mongoose lean tutorial](/docs/tutorials/lean.html). + * @param {ClientSession} [options.session=null] The session associated with this query. See [transactions docs](/docs/transactions.html). + * @param {Boolean|String} [options.strict] overwrites the schema's [strict mode option](https://mongoosejs.com/docs/guide.html#strict) + * @param {Boolean} [options.timestamps=null] If set to `false` and [schema-level timestamps](/docs/guide.html#timestamps) are enabled, skip timestamps for this update. Note that this allows you to overwrite timestamps. Does nothing if schema-level timestamps are not set. + * @param {Boolean} [options.overwrite=false] By default, if you don't include any [update operators](https://docs.mongodb.com/manual/reference/operator/update/) in `update`, Mongoose will wrap `update` in `$set` for you. This prevents you from accidentally overwriting the document. This option tells Mongoose to skip adding `$set`. An alternative to this would be using [Model.findOneAndReplace(conditions, update, options, callback)](https://mongoosejs.com/docs/api/model.html#model_Model.findOneAndReplace). + * @param {Boolean} [options.upsert=false] if true, and no documents found, insert a new document + * @param {Object|String|Array} [options.projection=null] optional fields to return, see [`Query.prototype.select()`](#query_Query-select) + * @param {Function} [callback] + * @return {Query} + * @see Tutorial /docs/tutorials/findoneandupdate.html + * @see mongodb https://www.mongodb.org/display/DOCS/findAndModify+Command + * @api public + */ + +Model.findOneAndUpdate = function(conditions, update, options, callback) { + _checkContext(this, 'findOneAndUpdate'); + + if (typeof options === 'function') { + callback = options; + options = null; + } else if (arguments.length === 1) { + if (typeof conditions === 'function') { + const msg = 'Model.findOneAndUpdate(): First argument must not be a function.\n\n' + + ' ' + this.modelName + '.findOneAndUpdate(conditions, update, options, callback)\n' + + ' ' + this.modelName + '.findOneAndUpdate(conditions, update, options)\n' + + ' ' + this.modelName + '.findOneAndUpdate(conditions, update)\n' + + ' ' + this.modelName + '.findOneAndUpdate(update)\n' + + ' ' + this.modelName + '.findOneAndUpdate()\n'; + throw new TypeError(msg); + } + update = conditions; + conditions = undefined; + } + callback = this.$handleCallbackError(callback); + + let fields; + if (options) { + fields = options.fields || options.projection; + } + + update = utils.clone(update, { + depopulate: true, + _isNested: true + }); + + _decorateUpdateWithVersionKey(update, options, this.schema.options.versionKey); + + const mq = new this.Query({}, {}, this, this.$__collection); + mq.select(fields); + + return mq.findOneAndUpdate(conditions, update, options, callback); +}; + +/*! + * Decorate the update with a version key, if necessary + */ + +function _decorateUpdateWithVersionKey(update, options, versionKey) { + if (!versionKey || !(options && options.upsert || false)) { + return; + } + + const updatedPaths = modifiedPaths(update); + if (!updatedPaths[versionKey]) { + if (options.overwrite) { + update[versionKey] = 0; + } else { + if (!update.$setOnInsert) { + update.$setOnInsert = {}; + } + update.$setOnInsert[versionKey] = 0; + } + } +} + +/** + * Issues a mongodb findAndModify update command by a document's _id field. + * `findByIdAndUpdate(id, ...)` is equivalent to `findOneAndUpdate({ _id: id }, ...)`. + * + * Finds a matching document, updates it according to the `update` arg, + * passing any `options`, and returns the found document (if any) to the + * callback. The query executes if `callback` is passed. + * + * This function triggers the following middleware. + * + * - `findOneAndUpdate()` + * + * #### Options: + * + * - `new`: bool - true to return the modified document rather than the original. defaults to false + * - `upsert`: bool - creates the object if it doesn't exist. defaults to false. + * - `runValidators`: if true, runs [update validators](/docs/validation.html#update-validators) on this command. Update validators validate the update operation against the model's schema. + * - `setDefaultsOnInsert`: `true` by default. If `setDefaultsOnInsert` and `upsert` are true, mongoose will apply the [defaults](https://mongoosejs.com/docs/defaults.html) specified in the model's schema if a new document is created. + * - `sort`: if multiple docs are found by the conditions, sets the sort order to choose which doc to update + * - `select`: sets the document fields to return + * - `rawResult`: if true, returns the [raw result from the MongoDB driver](https://mongodb.github.io/node-mongodb-native/4.3/interfaces/ModifyResult.html) + * - `strict`: overwrites the schema's [strict mode option](https://mongoosejs.com/docs/guide.html#strict) for this update + * + * #### Examples: + * + * A.findByIdAndUpdate(id, update, options, callback) // executes + * A.findByIdAndUpdate(id, update, options) // returns Query + * A.findByIdAndUpdate(id, update, callback) // executes + * A.findByIdAndUpdate(id, update) // returns Query + * A.findByIdAndUpdate() // returns Query + * + * #### Note: + * + * All top level update keys which are not `atomic` operation names are treated as set operations: + * + * #### Example: + * + * Model.findByIdAndUpdate(id, { name: 'jason bourne' }, options, callback) + * + * // is sent as + * Model.findByIdAndUpdate(id, { $set: { name: 'jason bourne' }}, options, callback) + * + * This helps prevent accidentally overwriting your document with `{ name: 'jason bourne' }`. + * + * #### Note: + * + * `findOneAndX` and `findByIdAndX` functions support limited validation. You can + * enable validation by setting the `runValidators` option. + * + * If you need full-fledged validation, use the traditional approach of first + * retrieving the document. + * + * Model.findById(id, function (err, doc) { + * if (err) .. + * doc.name = 'jason bourne'; + * doc.save(callback); + * }); + * + * @param {Object|Number|String} id value of `_id` to query by + * @param {Object} [update] + * @param {Object} [options] optional see [`Query.prototype.setOptions()`](https://mongoosejs.com/docs/api.html#query_Query-setOptions) + * @param {String} [options.returnDocument='before'] Has two possible values, `'before'` and `'after'`. By default, it will return the document before the update was applied. + * @param {Object} [options.lean] if truthy, mongoose will return the document as a plain JavaScript object rather than a mongoose document. See [`Query.lean()`](/docs/api.html#query_Query-lean) and [the Mongoose lean tutorial](/docs/tutorials/lean.html). + * @param {ClientSession} [options.session=null] The session associated with this query. See [transactions docs](/docs/transactions.html). + * @param {Boolean|String} [options.strict] overwrites the schema's [strict mode option](https://mongoosejs.com/docs/guide.html#strict) + * @param {Boolean} [options.timestamps=null] If set to `false` and [schema-level timestamps](/docs/guide.html#timestamps) are enabled, skip timestamps for this update. Note that this allows you to overwrite timestamps. Does nothing if schema-level timestamps are not set. + * @param {Boolean} [options.overwrite=false] By default, if you don't include any [update operators](https://docs.mongodb.com/manual/reference/operator/update/) in `update`, Mongoose will wrap `update` in `$set` for you. This prevents you from accidentally overwriting the document. This option tells Mongoose to skip adding `$set`. An alternative to this would be using [Model.findOneAndReplace({ _id: id }, update, options, callback)](https://mongoosejs.com/docs/api/model.html#model_Model.findOneAndReplace). + * @param {Function} [callback] + * @return {Query} + * @see Model.findOneAndUpdate #model_Model.findOneAndUpdate + * @see mongodb https://www.mongodb.org/display/DOCS/findAndModify+Command + * @api public + */ + +Model.findByIdAndUpdate = function(id, update, options, callback) { + _checkContext(this, 'findByIdAndUpdate'); + + callback = this.$handleCallbackError(callback); + if (arguments.length === 1) { + if (typeof id === 'function') { + const msg = 'Model.findByIdAndUpdate(): First argument must not be a function.\n\n' + + ' ' + this.modelName + '.findByIdAndUpdate(id, callback)\n' + + ' ' + this.modelName + '.findByIdAndUpdate(id)\n' + + ' ' + this.modelName + '.findByIdAndUpdate()\n'; + throw new TypeError(msg); + } + return this.findOneAndUpdate({ _id: id }, undefined); + } + + // if a model is passed in instead of an id + if (id instanceof Document) { + id = id._id; + } + + return this.findOneAndUpdate.call(this, { _id: id }, update, options, callback); +}; + +/** + * Issue a MongoDB `findOneAndDelete()` command. + * + * Finds a matching document, removes it, and passes the found document + * (if any) to the callback. + * + * Executes the query if `callback` is passed. + * + * This function triggers the following middleware. + * + * - `findOneAndDelete()` + * + * This function differs slightly from `Model.findOneAndRemove()` in that + * `findOneAndRemove()` becomes a [MongoDB `findAndModify()` command](https://docs.mongodb.com/manual/reference/method/db.collection.findAndModify/), + * as opposed to a `findOneAndDelete()` command. For most mongoose use cases, + * this distinction is purely pedantic. You should use `findOneAndDelete()` + * unless you have a good reason not to. + * + * #### Options: + * + * - `sort`: if multiple docs are found by the conditions, sets the sort order to choose which doc to update + * - `maxTimeMS`: puts a time limit on the query - requires mongodb >= 2.6.0 + * - `select`: sets the document fields to return, ex. `{ projection: { _id: 0 } }` + * - `projection`: equivalent to `select` + * - `rawResult`: if true, returns the [raw result from the MongoDB driver](https://mongodb.github.io/node-mongodb-native/4.3/interfaces/ModifyResult.html) + * - `strict`: overwrites the schema's [strict mode option](https://mongoosejs.com/docs/guide.html#strict) for this update + * + * #### Examples: + * + * A.findOneAndDelete(conditions, options, callback) // executes + * A.findOneAndDelete(conditions, options) // return Query + * A.findOneAndDelete(conditions, callback) // executes + * A.findOneAndDelete(conditions) // returns Query + * A.findOneAndDelete() // returns Query + * + * `findOneAndX` and `findByIdAndX` functions support limited validation. You can + * enable validation by setting the `runValidators` option. + * + * If you need full-fledged validation, use the traditional approach of first + * retrieving the document. + * + * Model.findById(id, function (err, doc) { + * if (err) .. + * doc.name = 'jason bourne'; + * doc.save(callback); + * }); + * + * @param {Object} conditions + * @param {Object} [options] optional see [`Query.prototype.setOptions()`](https://mongoosejs.com/docs/api.html#query_Query-setOptions) + * @param {Boolean|String} [options.strict] overwrites the schema's [strict mode option](https://mongoosejs.com/docs/guide.html#strict) + * @param {Object|String|Array} [options.projection=null] optional fields to return, see [`Query.prototype.select()`](#query_Query-select) + * @param {ClientSession} [options.session=null] The session associated with this query. See [transactions docs](/docs/transactions.html). + * @param {Function} [callback] + * @return {Query} + * @api public + */ + +Model.findOneAndDelete = function(conditions, options, callback) { + _checkContext(this, 'findOneAndDelete'); + + if (arguments.length === 1 && typeof conditions === 'function') { + const msg = 'Model.findOneAndDelete(): First argument must not be a function.\n\n' + + ' ' + this.modelName + '.findOneAndDelete(conditions, callback)\n' + + ' ' + this.modelName + '.findOneAndDelete(conditions)\n' + + ' ' + this.modelName + '.findOneAndDelete()\n'; + throw new TypeError(msg); + } + + if (typeof options === 'function') { + callback = options; + options = undefined; + } + callback = this.$handleCallbackError(callback); + + let fields; + if (options) { + fields = options.select; + options.select = undefined; + } + + const mq = new this.Query({}, {}, this, this.$__collection); + mq.select(fields); + + return mq.findOneAndDelete(conditions, options, callback); +}; + +/** + * Issue a MongoDB `findOneAndDelete()` command by a document's _id field. + * In other words, `findByIdAndDelete(id)` is a shorthand for + * `findOneAndDelete({ _id: id })`. + * + * This function triggers the following middleware. + * + * - `findOneAndDelete()` + * + * @param {Object|Number|String} id value of `_id` to query by + * @param {Object} [options] optional see [`Query.prototype.setOptions()`](https://mongoosejs.com/docs/api.html#query_Query-setOptions) + * @param {Boolean|String} [options.strict] overwrites the schema's [strict mode option](https://mongoosejs.com/docs/guide.html#strict) + * @param {Function} [callback] + * @return {Query} + * @see Model.findOneAndRemove #model_Model.findOneAndRemove + * @see mongodb https://www.mongodb.org/display/DOCS/findAndModify+Command + */ + +Model.findByIdAndDelete = function(id, options, callback) { + _checkContext(this, 'findByIdAndDelete'); + + if (arguments.length === 1 && typeof id === 'function') { + const msg = 'Model.findByIdAndDelete(): First argument must not be a function.\n\n' + + ' ' + this.modelName + '.findByIdAndDelete(id, callback)\n' + + ' ' + this.modelName + '.findByIdAndDelete(id)\n' + + ' ' + this.modelName + '.findByIdAndDelete()\n'; + throw new TypeError(msg); + } + callback = this.$handleCallbackError(callback); + + return this.findOneAndDelete({ _id: id }, options, callback); +}; + +/** + * Issue a MongoDB `findOneAndReplace()` command. + * + * Finds a matching document, replaces it with the provided doc, and passes the + * returned doc to the callback. + * + * Executes the query if `callback` is passed. + * + * This function triggers the following query middleware. + * + * - `findOneAndReplace()` + * + * #### Options: + * + * - `sort`: if multiple docs are found by the conditions, sets the sort order to choose which doc to update + * - `maxTimeMS`: puts a time limit on the query - requires mongodb >= 2.6.0 + * - `select`: sets the document fields to return + * - `projection`: like select, it determines which fields to return, ex. `{ projection: { _id: 0 } }` + * - `rawResult`: if true, returns the [raw result from the MongoDB driver](https://mongodb.github.io/node-mongodb-native/4.3/interfaces/ModifyResult.html) + * - `strict`: overwrites the schema's [strict mode option](https://mongoosejs.com/docs/guide.html#strict) for this update + * + * #### Examples: + * + * A.findOneAndReplace(filter, replacement, options, callback) // executes + * A.findOneAndReplace(filter, replacement, options) // return Query + * A.findOneAndReplace(filter, replacement, callback) // executes + * A.findOneAndReplace(filter, replacement) // returns Query + * A.findOneAndReplace() // returns Query + * + * @param {Object} filter Replace the first document that matches this filter + * @param {Object} [replacement] Replace with this document + * @param {Object} [options] optional see [`Query.prototype.setOptions()`](https://mongoosejs.com/docs/api.html#query_Query-setOptions) + * @param {String} [options.returnDocument='before'] Has two possible values, `'before'` and `'after'`. By default, it will return the document before the update was applied. + * @param {Object} [options.lean] if truthy, mongoose will return the document as a plain JavaScript object rather than a mongoose document. See [`Query.lean()`](/docs/api.html#query_Query-lean) and [the Mongoose lean tutorial](/docs/tutorials/lean.html). + * @param {ClientSession} [options.session=null] The session associated with this query. See [transactions docs](/docs/transactions.html). + * @param {Boolean|String} [options.strict] overwrites the schema's [strict mode option](https://mongoosejs.com/docs/guide.html#strict) + * @param {Boolean} [options.timestamps=null] If set to `false` and [schema-level timestamps](/docs/guide.html#timestamps) are enabled, skip timestamps for this update. Note that this allows you to overwrite timestamps. Does nothing if schema-level timestamps are not set. + * @param {Object|String|Array} [options.projection=null] optional fields to return, see [`Query.prototype.select()`](#query_Query-select) + * @param {Function} [callback] + * @return {Query} + * @api public + */ + +Model.findOneAndReplace = function(filter, replacement, options, callback) { + _checkContext(this, 'findOneAndReplace'); + + if (arguments.length === 1 && typeof filter === 'function') { + const msg = 'Model.findOneAndReplace(): First argument must not be a function.\n\n' + + ' ' + this.modelName + '.findOneAndReplace(filter, replacement, options, callback)\n' + + ' ' + this.modelName + '.findOneAndReplace(filter, replacement, callback)\n' + + ' ' + this.modelName + '.findOneAndReplace(filter, replacement)\n' + + ' ' + this.modelName + '.findOneAndReplace(filter, callback)\n' + + ' ' + this.modelName + '.findOneAndReplace()\n'; + throw new TypeError(msg); + } + + if (arguments.length === 3 && typeof options === 'function') { + callback = options; + options = replacement; + replacement = void 0; + } + if (arguments.length === 2 && typeof replacement === 'function') { + callback = replacement; + replacement = void 0; + options = void 0; + } + callback = this.$handleCallbackError(callback); + + let fields; + if (options) { + fields = options.select; + options.select = undefined; + } + + const mq = new this.Query({}, {}, this, this.$__collection); + mq.select(fields); + + return mq.findOneAndReplace(filter, replacement, options, callback); +}; + +/** + * Issue a mongodb findAndModify remove command. + * + * Finds a matching document, removes it, passing the found document (if any) to the callback. + * + * Executes the query if `callback` is passed. + * + * This function triggers the following middleware. + * + * - `findOneAndRemove()` + * + * #### Options: + * + * - `sort`: if multiple docs are found by the conditions, sets the sort order to choose which doc to update + * - `maxTimeMS`: puts a time limit on the query - requires mongodb >= 2.6.0 + * - `select`: sets the document fields to return + * - `projection`: like select, it determines which fields to return, ex. `{ projection: { _id: 0 } }` + * - `rawResult`: if true, returns the [raw result from the MongoDB driver](https://mongodb.github.io/node-mongodb-native/4.3/interfaces/ModifyResult.html) + * - `strict`: overwrites the schema's [strict mode option](https://mongoosejs.com/docs/guide.html#strict) for this update + * + * #### Examples: + * + * A.findOneAndRemove(conditions, options, callback) // executes + * A.findOneAndRemove(conditions, options) // return Query + * A.findOneAndRemove(conditions, callback) // executes + * A.findOneAndRemove(conditions) // returns Query + * A.findOneAndRemove() // returns Query + * + * `findOneAndX` and `findByIdAndX` functions support limited validation. You can + * enable validation by setting the `runValidators` option. + * + * If you need full-fledged validation, use the traditional approach of first + * retrieving the document. + * + * Model.findById(id, function (err, doc) { + * if (err) .. + * doc.name = 'jason bourne'; + * doc.save(callback); + * }); + * + * @param {Object} conditions + * @param {Object} [options] optional see [`Query.prototype.setOptions()`](https://mongoosejs.com/docs/api.html#query_Query-setOptions) + * @param {ClientSession} [options.session=null] The session associated with this query. See [transactions docs](/docs/transactions.html). + * @param {Boolean|String} [options.strict] overwrites the schema's [strict mode option](https://mongoosejs.com/docs/guide.html#strict) + * @param {Object|String|Array} [options.projection=null] optional fields to return, see [`Query.prototype.select()`](#query_Query-select) + * @param {Function} [callback] + * @return {Query} + * @see mongodb https://www.mongodb.org/display/DOCS/findAndModify+Command + * @api public + */ + +Model.findOneAndRemove = function(conditions, options, callback) { + _checkContext(this, 'findOneAndRemove'); + + if (arguments.length === 1 && typeof conditions === 'function') { + const msg = 'Model.findOneAndRemove(): First argument must not be a function.\n\n' + + ' ' + this.modelName + '.findOneAndRemove(conditions, callback)\n' + + ' ' + this.modelName + '.findOneAndRemove(conditions)\n' + + ' ' + this.modelName + '.findOneAndRemove()\n'; + throw new TypeError(msg); + } + + if (typeof options === 'function') { + callback = options; + options = undefined; + } + callback = this.$handleCallbackError(callback); + + let fields; + if (options) { + fields = options.select; + options.select = undefined; + } + + const mq = new this.Query({}, {}, this, this.$__collection); + mq.select(fields); + + return mq.findOneAndRemove(conditions, options, callback); +}; + +/** + * Issue a mongodb findAndModify remove command by a document's _id field. `findByIdAndRemove(id, ...)` is equivalent to `findOneAndRemove({ _id: id }, ...)`. + * + * Finds a matching document, removes it, passing the found document (if any) to the callback. + * + * Executes the query if `callback` is passed. + * + * This function triggers the following middleware. + * + * - `findOneAndRemove()` + * + * #### Options: + * + * - `sort`: if multiple docs are found by the conditions, sets the sort order to choose which doc to update + * - `select`: sets the document fields to return + * - `rawResult`: if true, returns the [raw result from the MongoDB driver](https://mongodb.github.io/node-mongodb-native/4.3/interfaces/ModifyResult.html) + * - `strict`: overwrites the schema's [strict mode option](https://mongoosejs.com/docs/guide.html#strict) for this update + * + * #### Examples: + * + * A.findByIdAndRemove(id, options, callback) // executes + * A.findByIdAndRemove(id, options) // return Query + * A.findByIdAndRemove(id, callback) // executes + * A.findByIdAndRemove(id) // returns Query + * A.findByIdAndRemove() // returns Query + * + * @param {Object|Number|String} id value of `_id` to query by + * @param {Object} [options] optional see [`Query.prototype.setOptions()`](https://mongoosejs.com/docs/api.html#query_Query-setOptions) + * @param {Boolean|String} [options.strict] overwrites the schema's [strict mode option](https://mongoosejs.com/docs/guide.html#strict) + * @param {ClientSession} [options.session=null] The session associated with this query. See [transactions docs](/docs/transactions.html). + * @param {Object|String|Array} [options.projection=null] optional fields to return, see [`Query.prototype.select()`](#query_Query-select) + * @param {Function} [callback] + * @return {Query} + * @see Model.findOneAndRemove #model_Model.findOneAndRemove + * @see mongodb https://www.mongodb.org/display/DOCS/findAndModify+Command + */ + +Model.findByIdAndRemove = function(id, options, callback) { + _checkContext(this, 'findByIdAndRemove'); + + if (arguments.length === 1 && typeof id === 'function') { + const msg = 'Model.findByIdAndRemove(): First argument must not be a function.\n\n' + + ' ' + this.modelName + '.findByIdAndRemove(id, callback)\n' + + ' ' + this.modelName + '.findByIdAndRemove(id)\n' + + ' ' + this.modelName + '.findByIdAndRemove()\n'; + throw new TypeError(msg); + } + callback = this.$handleCallbackError(callback); + + return this.findOneAndRemove({ _id: id }, options, callback); +}; + +/** + * Shortcut for saving one or more documents to the database. + * `MyModel.create(docs)` does `new MyModel(doc).save()` for every doc in + * docs. + * + * This function triggers the following middleware. + * + * - `save()` + * + * #### Example: + * + * // Insert one new `Character` document + * await Character.create({ name: 'Jean-Luc Picard' }); + * + * // Insert multiple new `Character` documents + * await Character.create([{ name: 'Will Riker' }, { name: 'Geordi LaForge' }]); + * + * // Create a new character within a transaction. Note that you **must** + * // pass an array as the first parameter to `create()` if you want to + * // specify options. + * await Character.create([{ name: 'Jean-Luc Picard' }], { session }); + * + * @param {Array|Object} docs Documents to insert, as a spread or array + * @param {Object} [options] Options passed down to `save()`. To specify `options`, `docs` **must** be an array, not a spread. + * @param {Function} [callback] callback + * @return {Promise} + * @api public + */ + +Model.create = function create(doc, options, callback) { + _checkContext(this, 'create'); + + let args; + let cb; + const discriminatorKey = this.schema.options.discriminatorKey; + + if (Array.isArray(doc)) { + args = doc; + cb = typeof options === 'function' ? options : callback; + options = options != null && typeof options === 'object' ? options : {}; + } else { + const last = arguments[arguments.length - 1]; + options = {}; + // Handle falsy callbacks re: #5061 + if (typeof last === 'function' || (arguments.length > 1 && !last)) { + args = [...arguments]; + cb = args.pop(); + } else { + args = [...arguments]; + } + + if (args.length === 2 && + args[0] != null && + args[1] != null && + args[0].session == null && + getConstructorName(last.session) === 'ClientSession' && + !this.schema.path('session')) { + // Probably means the user is running into the common mistake of trying + // to use a spread to specify options, see gh-7535 + utils.warn('WARNING: to pass a `session` to `Model.create()` in ' + + 'Mongoose, you **must** pass an array as the first argument. See: ' + + 'https://mongoosejs.com/docs/api.html#model_Model.create'); + } + } + + return this.db.base._promiseOrCallback(cb, cb => { + cb = this.$wrapCallback(cb); + + if (args.length === 0) { + if (Array.isArray(doc)) { + return cb(null, []); + } else { + return cb(null); + } + } + + const toExecute = []; + let firstError; + args.forEach(doc => { + toExecute.push(callback => { + const Model = this.discriminators && doc[discriminatorKey] != null ? + this.discriminators[doc[discriminatorKey]] || getDiscriminatorByValue(this.discriminators, doc[discriminatorKey]) : + this; + if (Model == null) { + throw new MongooseError(`Discriminator "${doc[discriminatorKey]}" not ` + + `found for model "${this.modelName}"`); + } + let toSave = doc; + const callbackWrapper = (error, doc) => { + if (error) { + if (!firstError) { + firstError = error; + } + return callback(null, { error: error }); + } + callback(null, { doc: doc }); + }; + + if (!(toSave instanceof Model)) { + try { + toSave = new Model(toSave); + } catch (error) { + return callbackWrapper(error); + } + } + + toSave.$save(options, callbackWrapper); + }); + }); + + let numFns = toExecute.length; + if (numFns === 0) { + return cb(null, []); + } + const _done = (error, res) => { + const savedDocs = []; + const len = res.length; + for (let i = 0; i < len; ++i) { + if (res[i].doc) { + savedDocs.push(res[i].doc); + } + } + + if (firstError) { + return cb(firstError, savedDocs); + } + + if (Array.isArray(doc)) { + cb(null, savedDocs); + } else { + cb.apply(this, [null].concat(savedDocs)); + } + }; + + const _res = []; + toExecute.forEach((fn, i) => { + fn((err, res) => { + _res[i] = res; + if (--numFns <= 0) { + return _done(null, _res); + } + }); + }); + }, this.events); +}; + +/** + * _Requires a replica set running MongoDB >= 3.6.0._ Watches the + * underlying collection for changes using + * [MongoDB change streams](https://docs.mongodb.com/manual/changeStreams/). + * + * This function does **not** trigger any middleware. In particular, it + * does **not** trigger aggregate middleware. + * + * The ChangeStream object is an event emitter that emits the following events: + * + * - 'change': A change occurred, see below example + * - 'error': An unrecoverable error occurred. In particular, change streams currently error out if they lose connection to the replica set primary. Follow [this GitHub issue](https://github.com/Automattic/mongoose/issues/6799) for updates. + * - 'end': Emitted if the underlying stream is closed + * - 'close': Emitted if the underlying stream is closed + * + * #### Example: + * + * const doc = await Person.create({ name: 'Ned Stark' }); + * const changeStream = Person.watch().on('change', change => console.log(change)); + * // Will print from the above `console.log()`: + * // { _id: { _data: ... }, + * // operationType: 'delete', + * // ns: { db: 'mydb', coll: 'Person' }, + * // documentKey: { _id: 5a51b125c5500f5aa094c7bd } } + * await doc.remove(); + * + * @param {Array} [pipeline] + * @param {Object} [options] see the [mongodb driver options](https://mongodb.github.io/node-mongodb-native/3.0/api/Collection.html#watch) + * @return {ChangeStream} mongoose-specific change stream wrapper, inherits from EventEmitter + * @api public + */ + +Model.watch = function(pipeline, options) { + _checkContext(this, 'watch'); + + const changeStreamThunk = cb => { + pipeline = pipeline || []; + prepareDiscriminatorPipeline(pipeline, this.schema, 'fullDocument'); + if (this.$__collection.buffer) { + this.$__collection.addQueue(() => { + if (this.closed) { + return; + } + const driverChangeStream = this.$__collection.watch(pipeline, options); + cb(null, driverChangeStream); + }); + } else { + const driverChangeStream = this.$__collection.watch(pipeline, options); + cb(null, driverChangeStream); + } + }; + + return new ChangeStream(changeStreamThunk, pipeline, options); +}; + +/** + * _Requires MongoDB >= 3.6.0._ Starts a [MongoDB session](https://docs.mongodb.com/manual/release-notes/3.6/#client-sessions) + * for benefits like causal consistency, [retryable writes](https://docs.mongodb.com/manual/core/retryable-writes/), + * and [transactions](https://thecodebarbarian.com/a-node-js-perspective-on-mongodb-4-transactions.html). + * + * Calling `MyModel.startSession()` is equivalent to calling `MyModel.db.startSession()`. + * + * This function does not trigger any middleware. + * + * #### Example: + * + * const session = await Person.startSession(); + * let doc = await Person.findOne({ name: 'Ned Stark' }, null, { session }); + * await doc.remove(); + * // `doc` will always be null, even if reading from a replica set + * // secondary. Without causal consistency, it is possible to + * // get a doc back from the below query if the query reads from a + * // secondary that is experiencing replication lag. + * doc = await Person.findOne({ name: 'Ned Stark' }, null, { session, readPreference: 'secondary' }); + * + * @param {Object} [options] see the [mongodb driver options](https://mongodb.github.io/node-mongodb-native/3.0/api/MongoClient.html#startSession) + * @param {Boolean} [options.causalConsistency=true] set to false to disable causal consistency + * @param {Function} [callback] + * @return {Promise} promise that resolves to a MongoDB driver `ClientSession` + * @api public + */ + +Model.startSession = function() { + _checkContext(this, 'startSession'); + + return this.db.startSession.apply(this.db, arguments); +}; + +/** + * Shortcut for validating an array of documents and inserting them into + * MongoDB if they're all valid. This function is faster than `.create()` + * because it only sends one operation to the server, rather than one for each + * document. + * + * Mongoose always validates each document **before** sending `insertMany` + * to MongoDB. So if one document has a validation error, no documents will + * be saved, unless you set + * [the `ordered` option to false](https://docs.mongodb.com/manual/reference/method/db.collection.insertMany/#error-handling). + * + * This function does **not** trigger save middleware. + * + * This function triggers the following middleware. + * + * - `insertMany()` + * + * #### Example: + * + * const arr = [{ name: 'Star Wars' }, { name: 'The Empire Strikes Back' }]; + * Movies.insertMany(arr, function(error, docs) {}); + * + * @param {Array|Object|*} doc(s) + * @param {Object} [options] see the [mongodb driver options](https://mongodb.github.io/node-mongodb-native/2.2/api/Collection.html#insertMany) + * @param {Boolean} [options.ordered = true] if true, will fail fast on the first error encountered. If false, will insert all the documents it can and report errors later. An `insertMany()` with `ordered = false` is called an "unordered" `insertMany()`. + * @param {Boolean} [options.rawResult = false] if false, the returned promise resolves to the documents that passed mongoose document validation. If `true`, will return the [raw result from the MongoDB driver](https://mongodb.github.io/node-mongodb-native/2.2/api/Collection.html#~insertWriteOpCallback) with a `mongoose` property that contains `validationErrors` if this is an unordered `insertMany`. + * @param {Boolean} [options.lean = false] if `true`, skips hydrating and validating the documents. This option is useful if you need the extra performance, but Mongoose won't validate the documents before inserting. + * @param {Number} [options.limit = null] this limits the number of documents being processed (validation/casting) by mongoose in parallel, this does **NOT** send the documents in batches to MongoDB. Use this option if you're processing a large number of documents and your app is running out of memory. + * @param {String|Object|Array} [options.populate = null] populates the result documents. This option is a no-op if `rawResult` is set. + * @param {Function} [callback] callback + * @return {Promise} resolving to the raw result from the MongoDB driver if `options.rawResult` was `true`, or the documents that passed validation, otherwise + * @api public + */ + +Model.insertMany = function(arr, options, callback) { + _checkContext(this, 'insertMany'); + + if (typeof options === 'function') { + callback = options; + options = null; + } + return this.db.base._promiseOrCallback(callback, cb => { + this.$__insertMany(arr, options, cb); + }, this.events); +}; + +/*! + * ignore + */ + +Model.$__insertMany = function(arr, options, callback) { + const _this = this; + if (typeof options === 'function') { + callback = options; + options = null; + } + if (callback) { + callback = this.$handleCallbackError(callback); + callback = this.$wrapCallback(callback); + } + callback = callback || utils.noop; + options = options || {}; + const limit = options.limit || 1000; + const rawResult = !!options.rawResult; + const ordered = typeof options.ordered === 'boolean' ? options.ordered : true; + const lean = !!options.lean; + + if (!Array.isArray(arr)) { + arr = [arr]; + } + + const validationErrors = []; + const toExecute = arr.map(doc => + callback => { + if (!(doc instanceof _this)) { + try { + doc = new _this(doc); + } catch (err) { + return callback(err); + } + } + if (options.session != null) { + doc.$session(options.session); + } + // If option `lean` is set to true bypass validation + if (lean) { + // we have to execute callback at the nextTick to be compatible + // with parallelLimit, as `results` variable has TDZ issue if we + // execute the callback synchronously + return immediate(() => callback(null, doc)); + } + doc.$validate({ __noPromise: true }, function(error) { + if (error) { + // Option `ordered` signals that insert should be continued after reaching + // a failing insert. Therefore we delegate "null", meaning the validation + // failed. It's up to the next function to filter out all failed models + if (ordered === false) { + validationErrors.push(error); + return callback(null, null); + } + return callback(error); + } + callback(null, doc); + }); + }); + + parallelLimit(toExecute, limit, function(error, docs) { + if (error) { + callback(error, null); + return; + } + // We filter all failed pre-validations by removing nulls + const docAttributes = docs.filter(function(doc) { + return doc != null; + }); + // Quickly escape while there aren't any valid docAttributes + if (docAttributes.length === 0) { + if (rawResult) { + const res = { + mongoose: { + validationErrors: validationErrors + } + }; + return callback(null, res); + } + callback(null, []); + return; + } + const docObjects = docAttributes.map(function(doc) { + if (doc.$__schema.options.versionKey) { + doc[doc.$__schema.options.versionKey] = 0; + } + if (doc.initializeTimestamps) { + return doc.initializeTimestamps().toObject(internalToObjectOptions); + } + return doc.toObject(internalToObjectOptions); + }); + + _this.$__collection.insertMany(docObjects, options, function(error, res) { + if (error) { + // `writeErrors` is a property reported by the MongoDB driver, + // just not if there's only 1 error. + if (error.writeErrors == null && + (error.result && error.result.result && error.result.result.writeErrors) != null) { + error.writeErrors = error.result.result.writeErrors; + } + + // `insertedDocs` is a Mongoose-specific property + const erroredIndexes = new Set((error && error.writeErrors || []).map(err => err.index)); + + let firstErroredIndex = -1; + error.insertedDocs = docAttributes. + filter((doc, i) => { + const isErrored = erroredIndexes.has(i); + + if (ordered) { + if (firstErroredIndex > -1) { + return i < firstErroredIndex; + } + + if (isErrored) { + firstErroredIndex = i; + } + } + + return !isErrored; + }). + map(function setIsNewForInsertedDoc(doc) { + doc.$__reset(); + _setIsNew(doc, false); + return doc; + }); + + callback(error, null); + return; + } + + for (const attribute of docAttributes) { + attribute.$__reset(); + _setIsNew(attribute, false); + } + + if (rawResult) { + if (ordered === false) { + // Decorate with mongoose validation errors in case of unordered, + // because then still do `insertMany()` + res.mongoose = { + validationErrors: validationErrors + }; + } + return callback(null, res); + } + + if (options.populate != null) { + return _this.populate(docAttributes, options.populate, err => { + if (err != null) { + error.insertedDocs = docAttributes; + return callback(err); + } + + callback(null, docs); + }); + } + + callback(null, docAttributes); + }); + }); +}; + +/*! + * ignore + */ + +function _setIsNew(doc, val) { + doc.$isNew = val; + doc.$emit('isNew', val); + doc.constructor.emit('isNew', val); + + const subdocs = doc.$getAllSubdocs(); + for (const subdoc of subdocs) { + subdoc.$isNew = val; + subdoc.$emit('isNew', val); + } +} + +/** + * Sends multiple `insertOne`, `updateOne`, `updateMany`, `replaceOne`, + * `deleteOne`, and/or `deleteMany` operations to the MongoDB server in one + * command. This is faster than sending multiple independent operations (e.g. + * if you use `create()`) because with `bulkWrite()` there is only one round + * trip to MongoDB. + * + * Mongoose will perform casting on all operations you provide. + * + * This function does **not** trigger any middleware, neither `save()`, nor `update()`. + * If you need to trigger + * `save()` middleware for every document use [`create()`](https://mongoosejs.com/docs/api.html#model_Model.create) instead. + * + * #### Example: + * + * Character.bulkWrite([ + * { + * insertOne: { + * document: { + * name: 'Eddard Stark', + * title: 'Warden of the North' + * } + * } + * }, + * { + * updateOne: { + * filter: { name: 'Eddard Stark' }, + * // If you were using the MongoDB driver directly, you'd need to do + * // `update: { $set: { title: ... } }` but mongoose adds $set for + * // you. + * update: { title: 'Hand of the King' } + * } + * }, + * { + * deleteOne: { + * filter: { name: 'Eddard Stark' } + * } + * } + * ]).then(res => { + * // Prints "1 1 1" + * console.log(res.insertedCount, res.modifiedCount, res.deletedCount); + * }); + * + * The [supported operations](https://docs.mongodb.com/manual/reference/method/db.collection.bulkWrite/#db.collection.bulkWrite) are: + * + * - `insertOne` + * - `updateOne` + * - `updateMany` + * - `deleteOne` + * - `deleteMany` + * - `replaceOne` + * + * @param {Array} ops + * @param {Object} [ops.insertOne.document] The document to insert + * @param {Object} [opts.updateOne.filter] Update the first document that matches this filter + * @param {Object} [opts.updateOne.update] An object containing [update operators](https://docs.mongodb.com/manual/reference/operator/update/) + * @param {Boolean} [opts.updateOne.upsert=false] If true, insert a doc if none match + * @param {Boolean} [opts.updateOne.timestamps=true] If false, do not apply [timestamps](https://mongoosejs.com/docs/guide.html#timestamps) to the operation + * @param {Object} [opts.updateOne.collation] The [MongoDB collation](https://thecodebarbarian.com/a-nodejs-perspective-on-mongodb-34-collations) to use + * @param {Array} [opts.updateOne.arrayFilters] The [array filters](https://thecodebarbarian.com/a-nodejs-perspective-on-mongodb-36-array-filters.html) used in `update` + * @param {Object} [opts.updateMany.filter] Update all the documents that match this filter + * @param {Object} [opts.updateMany.update] An object containing [update operators](https://docs.mongodb.com/manual/reference/operator/update/) + * @param {Boolean} [opts.updateMany.upsert=false] If true, insert a doc if no documents match `filter` + * @param {Boolean} [opts.updateMany.timestamps=true] If false, do not apply [timestamps](https://mongoosejs.com/docs/guide.html#timestamps) to the operation + * @param {Object} [opts.updateMany.collation] The [MongoDB collation](https://thecodebarbarian.com/a-nodejs-perspective-on-mongodb-34-collations) to use + * @param {Array} [opts.updateMany.arrayFilters] The [array filters](https://thecodebarbarian.com/a-nodejs-perspective-on-mongodb-36-array-filters.html) used in `update` + * @param {Object} [opts.deleteOne.filter] Delete the first document that matches this filter + * @param {Object} [opts.deleteMany.filter] Delete all documents that match this filter + * @param {Object} [opts.replaceOne.filter] Replace the first document that matches this filter + * @param {Object} [opts.replaceOne.replacement] The replacement document + * @param {Boolean} [opts.replaceOne.upsert=false] If true, insert a doc if no documents match `filter` + * @param {Object} [options] + * @param {Boolean} [options.ordered=true] If true, execute writes in order and stop at the first error. If false, execute writes in parallel and continue until all writes have either succeeded or errored. + * @param {ClientSession} [options.session=null] The session associated with this bulk write. See [transactions docs](/docs/transactions.html). + * @param {String|number} [options.w=1] The [write concern](https://docs.mongodb.com/manual/reference/write-concern/). See [`Query#w()`](/docs/api.html#query_Query-w) for more information. + * @param {number} [options.wtimeout=null] The [write concern timeout](https://docs.mongodb.com/manual/reference/write-concern/#wtimeout). + * @param {Boolean} [options.j=true] If false, disable [journal acknowledgement](https://docs.mongodb.com/manual/reference/write-concern/#j-option) + * @param {Boolean} [options.skipValidation=false] Set to true to skip Mongoose schema validation on bulk write operations. Mongoose currently runs validation on `insertOne` and `replaceOne` operations by default. + * @param {Boolean} [options.bypassDocumentValidation=false] If true, disable [MongoDB server-side schema validation](https://docs.mongodb.com/manual/core/schema-validation/) for all writes in this bulk. + * @param {Boolean} [options.strict=null] Overwrites the [`strict` option](/docs/guide.html#strict) on schema. If false, allows filtering and writing fields not defined in the schema for all writes in this bulk. + * @param {Function} [callback] callback `function(error, bulkWriteOpResult) {}` + * @return {Promise} resolves to a [`BulkWriteOpResult`](https://mongodb.github.io/node-mongodb-native/3.1/api/Collection.html#~BulkWriteOpResult) if the operation succeeds + * @api public + */ + +Model.bulkWrite = function(ops, options, callback) { + _checkContext(this, 'bulkWrite'); + + if (typeof options === 'function') { + callback = options; + options = null; + } + options = options || {}; + + const validations = ops.map(op => castBulkWrite(this, op, options)); + + callback = this.$handleCallbackError(callback); + return this.db.base._promiseOrCallback(callback, cb => { + cb = this.$wrapCallback(cb); + each(validations, (fn, cb) => fn(cb), error => { + if (error) { + return cb(error); + } + + if (ops.length === 0) { + return cb(null, getDefaultBulkwriteResult()); + } + + this.$__collection.bulkWrite(ops, options, (error, res) => { + if (error) { + return cb(error); + } + + cb(null, res); + }); + }); + }, this.events); +}; + +/** + * takes an array of documents, gets the changes and inserts/updates documents in the database + * according to whether or not the document is new, or whether it has changes or not. + * + * `bulkSave` uses `bulkWrite` under the hood, so it's mostly useful when dealing with many documents (10K+) + * + * @param {[Document]} documents + * @param {Object} [options] options passed to the underlying `bulkWrite()` + * @param {ClientSession} [options.session=null] The session associated with this bulk write. See [transactions docs](/docs/transactions.html). + * @param {String|number} [options.w=1] The [write concern](https://docs.mongodb.com/manual/reference/write-concern/). See [`Query#w()`](/docs/api.html#query_Query-w) for more information. + * @param {number} [options.wtimeout=null] The [write concern timeout](https://docs.mongodb.com/manual/reference/write-concern/#wtimeout). + * @param {Boolean} [options.j=true] If false, disable [journal acknowledgement](https://docs.mongodb.com/manual/reference/write-concern/#j-option) + * + */ +Model.bulkSave = function(documents, options) { + const preSavePromises = documents.map(buildPreSavePromise); + + const writeOperations = this.buildBulkWriteOperations(documents, { skipValidation: true }); + + let bulkWriteResultPromise; + return Promise.all(preSavePromises) + .then(() => bulkWriteResultPromise = this.bulkWrite(writeOperations, options)) + .then(() => documents.map(buildSuccessfulWriteHandlerPromise)) + .then(() => bulkWriteResultPromise) + .catch((err) => { + if (!(err && err.writeErrors && err.writeErrors.length)) { + throw err; + } + return Promise.all( + documents.map((document) => { + const documentError = err.writeErrors.find(writeError => { + const writeErrorDocumentId = writeError.err.op._id || writeError.err.op.q._id; + return writeErrorDocumentId.toString() === document._id.toString(); + }); + + if (documentError == null) { + return buildSuccessfulWriteHandlerPromise(document); + } + }) + ).then(() => { + throw err; + }); + }); +}; + +function buildPreSavePromise(document) { + return new Promise((resolve, reject) => { + document.schema.s.hooks.execPre('save', document, (err) => { + if (err) { + reject(err); + return; + } + resolve(); + }); + }); +} + +function buildSuccessfulWriteHandlerPromise(document) { + return new Promise((resolve, reject) => { + handleSuccessfulWrite(document, resolve, reject); + }); +} + +function handleSuccessfulWrite(document, resolve, reject) { + if (document.$isNew) { + _setIsNew(document, false); + } + + document.$__reset(); + document.schema.s.hooks.execPost('save', document, {}, (err) => { + if (err) { + reject(err); + return; + } + resolve(); + }); +} + +/** + * + * @param {[Document]} documents The array of documents to build write operations of + * @param {Object} options + * @param {Boolean} options.skipValidation defaults to `false`, when set to true, building the write operations will bypass validating the documents. + * @returns + */ +Model.buildBulkWriteOperations = function buildBulkWriteOperations(documents, options) { + if (!Array.isArray(documents)) { + throw new Error(`bulkSave expects an array of documents to be passed, received \`${documents}\` instead`); + } + + setDefaultOptions(); + + const writeOperations = documents.reduce((accumulator, document, i) => { + if (!options.skipValidation) { + if (!(document instanceof Document)) { + throw new Error(`documents.${i} was not a mongoose document, documents must be an array of mongoose documents (instanceof mongoose.Document).`); + } + const validationError = document.validateSync(); + if (validationError) { + throw validationError; + } + } + + const isANewDocument = document.isNew; + if (isANewDocument) { + accumulator.push({ + insertOne: { document } + }); + + return accumulator; + } + + const delta = document.$__delta(); + const isDocumentWithChanges = delta != null && !utils.isEmptyObject(delta[0]); + + if (isDocumentWithChanges) { + const where = document.$__where(delta[0]); + const changes = delta[1]; + + _applyCustomWhere(document, where); + + document.$__version(where, delta); + + accumulator.push({ + updateOne: { + filter: where, + update: changes + } + }); + + return accumulator; + } + + return accumulator; + }, []); + + return writeOperations; + + + function setDefaultOptions() { + options = options || {}; + if (options.skipValidation == null) { + options.skipValidation = false; + } + } +}; + +/** + * Shortcut for creating a new Document from existing raw data, pre-saved in the DB. + * The document returned has no paths marked as modified initially. + * + * #### Example: + * + * // hydrate previous data into a Mongoose document + * const mongooseCandy = Candy.hydrate({ _id: '54108337212ffb6d459f854c', type: 'jelly bean' }); + * + * @param {Object} obj + * @param {Object|String|Array} [projection] optional projection containing which fields should be selected for this document + * @return {Document} document instance + * @api public + */ + +Model.hydrate = function(obj, projection) { + _checkContext(this, 'hydrate'); + + if (projection != null) { + if (obj != null && obj.$__ != null) { + obj = obj.toObject(internalToObjectOptions); + } + obj = applyProjection(obj, projection); + } + + const document = require('./queryhelpers').createModel(this, obj, projection); + document.$init(obj); + return document; +}; + +/** + * Updates one document in the database without returning it. + * + * This function triggers the following middleware. + * + * - `update()` + * + * This method is deprecated. See [Deprecation Warnings](../deprecations.html#update) for details. + * + * #### Examples: + * + * MyModel.update({ age: { $gt: 18 } }, { oldEnough: true }, fn); + * + * const res = await MyModel.update({ name: 'Tobi' }, { ferret: true }); + * res.n; // Number of documents that matched `{ name: 'Tobi' }` + * // Number of documents that were changed. If every doc matched already + * // had `ferret` set to `true`, `nModified` will be 0. + * res.nModified; + * + * #### Valid options: + * + * - `strict` (boolean): overrides the [schema-level `strict` option](/docs/guide.html#strict) for this update + * - `upsert` (boolean): whether to create the doc if it doesn't match (false) + * - `writeConcern` (object): sets the [write concern](https://docs.mongodb.com/manual/reference/write-concern/) for replica sets. Overrides the [schema-level write concern](/docs/guide.html#writeConcern) + * - `multi` (boolean): whether multiple documents should be updated (false) + * - `runValidators`: if true, runs [update validators](/docs/validation.html#update-validators) on this command. Update validators validate the update operation against the model's schema. + * - `setDefaultsOnInsert` (boolean): if this and `upsert` are true, mongoose will apply the [defaults](https://mongoosejs.com/docs/defaults.html) specified in the model's schema if a new document is created. This option only works on MongoDB >= 2.4 because it relies on [MongoDB's `$setOnInsert` operator](https://docs.mongodb.org/v2.4/reference/operator/update/setOnInsert/). + * - `timestamps` (boolean): If set to `false` and [schema-level timestamps](/docs/guide.html#timestamps) are enabled, skip timestamps for this update. Does nothing if schema-level timestamps are not set. + * - `overwrite` (boolean): disables update-only mode, allowing you to overwrite the doc (false) + * + * All `update` values are cast to their appropriate SchemaTypes before being sent. + * + * The `callback` function receives `(err, rawResponse)`. + * + * - `err` is the error if any occurred + * - `rawResponse` is the full response from Mongo + * + * #### Note: + * + * All top level keys which are not `atomic` operation names are treated as set operations: + * + * #### Example: + * + * const query = { name: 'borne' }; + * Model.update(query, { name: 'jason bourne' }, options, callback); + * + * // is sent as + * Model.update(query, { $set: { name: 'jason bourne' }}, options, function(err, res)); + * // if overwrite option is false. If overwrite is true, sent without the $set wrapper. + * + * This helps prevent accidentally overwriting all documents in your collection with `{ name: 'jason bourne' }`. + * + * #### Note: + * + * Be careful to not use an existing model instance for the update clause (this won't work and can cause weird behavior like infinite loops). Also, ensure that the update clause does not have an _id property, which causes Mongo to return a "Mod on _id not allowed" error. + * + * @deprecated + * @see strict https://mongoosejs.com/docs/guide.html#strict + * @see response https://docs.mongodb.org/v2.6/reference/command/update/#output + * @param {Object} filter + * @param {Object} doc + * @param {Object} [options] optional see [`Query.prototype.setOptions()`](/docs/api.html#query_Query-setOptions) + * @param {Boolean|String} [options.strict] overwrites the schema's [strict mode option](/docs/guide.html#strict) + * @param {Boolean} [options.upsert=false] if true, and no documents found, insert a new document + * @param {Object} [options.writeConcern=null] sets the [write concern](https://docs.mongodb.com/manual/reference/write-concern/) for replica sets. Overrides the [schema-level write concern](/docs/guide.html#writeConcern) + * @param {Boolean} [options.multi=false] whether multiple documents should be updated or just the first one that matches `filter`. + * @param {Boolean} [options.runValidators=false] if true, runs [update validators](/docs/validation.html#update-validators) on this command. Update validators validate the update operation against the model's schema. + * @param {Boolean} [options.setDefaultsOnInsert=false] `true` by default. If `setDefaultsOnInsert` and `upsert` are true, mongoose will apply the [defaults](https://mongoosejs.com/docs/defaults.html) specified in the model's schema if a new document is created. + * @param {Boolean} [options.timestamps=null] If set to `false` and [schema-level timestamps](/docs/guide.html#timestamps) are enabled, skip timestamps for this update. Does nothing if schema-level timestamps are not set. + * @param {Boolean} [options.overwrite=false] By default, if you don't include any [update operators](https://docs.mongodb.com/manual/reference/operator/update/) in `doc`, Mongoose will wrap `doc` in `$set` for you. This prevents you from accidentally overwriting the document. This option tells Mongoose to skip adding `$set`. + * @param {Function} [callback] params are (error, [updateWriteOpResult](https://mongodb.github.io/node-mongodb-native/3.6/api/Collection.html#~updateWriteOpResult)) + * @param {Function} [callback] + * @return {Query} + * @see MongoDB docs https://docs.mongodb.com/manual/reference/command/update/#update-command-output + * @see writeOpResult https://mongodb.github.io/node-mongodb-native/3.6/api/Collection.html#~updateWriteOpResult + * @see Query docs https://mongoosejs.com/docs/queries.html + * @api public + */ + +Model.update = function update(conditions, doc, options, callback) { + _checkContext(this, 'update'); + + return _update(this, 'update', conditions, doc, options, callback); +}; + +/** + * Same as `update()`, except MongoDB will update _all_ documents that match + * `filter` (as opposed to just the first one) regardless of the value of + * the `multi` option. + * + * **Note** updateMany will _not_ fire update middleware. Use `pre('updateMany')` + * and `post('updateMany')` instead. + * + * #### Example: + * const res = await Person.updateMany({ name: /Stark$/ }, { isDeleted: true }); + * res.matchedCount; // Number of documents matched + * res.modifiedCount; // Number of documents modified + * res.acknowledged; // Boolean indicating everything went smoothly. + * res.upsertedId; // null or an id containing a document that had to be upserted. + * res.upsertedCount; // Number indicating how many documents had to be upserted. Will either be 0 or 1. + * + * This function triggers the following middleware. + * + * - `updateMany()` + * + * @param {Object} filter + * @param {Object|Array} update + * @param {Object} [options] optional see [`Query.prototype.setOptions()`](https://mongoosejs.com/docs/api.html#query_Query-setOptions) + * @param {Boolean|String} [options.strict] overwrites the schema's [strict mode option](https://mongoosejs.com/docs/guide.html#strict) + * @param {Boolean} [options.upsert=false] if true, and no documents found, insert a new document + * @param {Object} [options.writeConcern=null] sets the [write concern](https://docs.mongodb.com/manual/reference/write-concern/) for replica sets. Overrides the [schema-level write concern](/docs/guide.html#writeConcern) + * @param {Boolean} [options.timestamps=null] If set to `false` and [schema-level timestamps](/docs/guide.html#timestamps) are enabled, skip timestamps for this update. Does nothing if schema-level timestamps are not set. + * @param {Function} [callback] `function(error, res) {}` where `res` has 5 properties: `modifiedCount`, `matchedCount`, `acknowledged`, `upsertedId`, and `upsertedCount`. + * @return {Query} + * @see Query docs https://mongoosejs.com/docs/queries.html + * @see MongoDB docs https://docs.mongodb.com/manual/reference/command/update/#update-command-output + * @see writeOpResult https://mongodb.github.io/node-mongodb-native/2.2/api/Collection.html#~WriteOpResult + * @api public + */ + +Model.updateMany = function updateMany(conditions, doc, options, callback) { + _checkContext(this, 'updateMany'); + + return _update(this, 'updateMany', conditions, doc, options, callback); +}; + +/** + * Same as `update()`, except it does not support the `multi` or `overwrite` + * options. + * + * - MongoDB will update _only_ the first document that matches `filter` regardless of the value of the `multi` option. + * - Use `replaceOne()` if you want to overwrite an entire document rather than using atomic operators like `$set`. + * + * #### Example: + * const res = await Person.updateOne({ name: 'Jean-Luc Picard' }, { ship: 'USS Enterprise' }); + * res.matchedCount; // Number of documents matched + * res.modifiedCount; // Number of documents modified + * res.acknowledged; // Boolean indicating everything went smoothly. + * res.upsertedId; // null or an id containing a document that had to be upserted. + * res.upsertedCount; // Number indicating how many documents had to be upserted. Will either be 0 or 1. + * + * This function triggers the following middleware. + * + * - `updateOne()` + * + * @param {Object} filter + * @param {Object|Array} update + * @param {Object} [options] optional see [`Query.prototype.setOptions()`](https://mongoosejs.com/docs/api.html#query_Query-setOptions) + * @param {Boolean|String} [options.strict] overwrites the schema's [strict mode option](https://mongoosejs.com/docs/guide.html#strict) + * @param {Boolean} [options.upsert=false] if true, and no documents found, insert a new document + * @param {Object} [options.writeConcern=null] sets the [write concern](https://docs.mongodb.com/manual/reference/write-concern/) for replica sets. Overrides the [schema-level write concern](/docs/guide.html#writeConcern) + * @param {Boolean} [options.timestamps=null] If set to `false` and [schema-level timestamps](/docs/guide.html#timestamps) are enabled, skip timestamps for this update. Note that this allows you to overwrite timestamps. Does nothing if schema-level timestamps are not set. + * @param {Function} [callback] params are (error, writeOpResult) + * @return {Query} + * @see Query docs https://mongoosejs.com/docs/queries.html + * @see MongoDB docs https://docs.mongodb.com/manual/reference/command/update/#update-command-output + * @see writeOpResult https://mongodb.github.io/node-mongodb-native/2.2/api/Collection.html#~WriteOpResult + * @api public + */ + +Model.updateOne = function updateOne(conditions, doc, options, callback) { + _checkContext(this, 'updateOne'); + + return _update(this, 'updateOne', conditions, doc, options, callback); +}; + +/** + * Same as `update()`, except MongoDB replace the existing document with the + * given document (no atomic operators like `$set`). + * + * #### Example: + * const res = await Person.replaceOne({ _id: 24601 }, { name: 'Jean Valjean' }); + * res.matchedCount; // Number of documents matched + * res.modifiedCount; // Number of documents modified + * res.acknowledged; // Boolean indicating everything went smoothly. + * res.upsertedId; // null or an id containing a document that had to be upserted. + * res.upsertedCount; // Number indicating how many documents had to be upserted. Will either be 0 or 1. + * + * This function triggers the following middleware. + * + * - `replaceOne()` + * + * @param {Object} filter + * @param {Object} doc + * @param {Object} [options] optional see [`Query.prototype.setOptions()`](https://mongoosejs.com/docs/api.html#query_Query-setOptions) + * @param {Boolean|String} [options.strict] overwrites the schema's [strict mode option](https://mongoosejs.com/docs/guide.html#strict) + * @param {Boolean} [options.upsert=false] if true, and no documents found, insert a new document + * @param {Object} [options.writeConcern=null] sets the [write concern](https://docs.mongodb.com/manual/reference/write-concern/) for replica sets. Overrides the [schema-level write concern](/docs/guide.html#writeConcern) + * @param {Boolean} [options.timestamps=null] If set to `false` and [schema-level timestamps](/docs/guide.html#timestamps) are enabled, skip timestamps for this update. Does nothing if schema-level timestamps are not set. + * @param {Function} [callback] `function(error, res) {}` where `res` has 3 properties: `n`, `nModified`, `ok`. + * @return {Query} + * @see Query docs https://mongoosejs.com/docs/queries.html + * @see writeOpResult https://mongodb.github.io/node-mongodb-native/2.2/api/Collection.html#~WriteOpResult + * @return {Query} + * @api public + */ + +Model.replaceOne = function replaceOne(conditions, doc, options, callback) { + _checkContext(this, 'replaceOne'); + + const versionKey = this && this.schema && this.schema.options && this.schema.options.versionKey || null; + if (versionKey && !doc[versionKey]) { + doc[versionKey] = 0; + } + + return _update(this, 'replaceOne', conditions, doc, options, callback); +}; + +/*! + * Common code for `updateOne()`, `updateMany()`, `replaceOne()`, and `update()` + * because they need to do the same thing + */ + +function _update(model, op, conditions, doc, options, callback) { + const mq = new model.Query({}, {}, model, model.collection); + callback = model.$handleCallbackError(callback); + // gh-2406 + // make local deep copy of conditions + if (conditions instanceof Document) { + conditions = conditions.toObject(); + } else { + conditions = utils.clone(conditions); + } + options = typeof options === 'function' ? options : utils.clone(options); + + const versionKey = model && + model.schema && + model.schema.options && + model.schema.options.versionKey || null; + _decorateUpdateWithVersionKey(doc, options, versionKey); + + return mq[op](conditions, doc, options, callback); +} + +/** + * Executes a mapReduce command. + * + * `o` is an object specifying all mapReduce options as well as the map and reduce functions. All options are delegated to the driver implementation. See [node-mongodb-native mapReduce() documentation](https://mongodb.github.io/node-mongodb-native/api-generated/collection.html#mapreduce) for more detail about options. + * + * This function does not trigger any middleware. + * + * #### Example: + * + * const o = {}; + * // `map()` and `reduce()` are run on the MongoDB server, not Node.js, + * // these functions are converted to strings + * o.map = function () { emit(this.name, 1) }; + * o.reduce = function (k, vals) { return vals.length }; + * User.mapReduce(o, function (err, results) { + * console.log(results) + * }) + * + * #### Other options: + * + * - `query` {Object} query filter object. + * - `sort` {Object} sort input objects using this key + * - `limit` {Number} max number of documents + * - `keeptemp` {Boolean, default:false} keep temporary data + * - `finalize` {Function} finalize function + * - `scope` {Object} scope variables exposed to map/reduce/finalize during execution + * - `jsMode` {Boolean, default:false} it is possible to make the execution stay in JS. Provided in MongoDB > 2.0.X + * - `verbose` {Boolean, default:false} provide statistics on job execution time. + * - `readPreference` {String} + * - `out*` {Object, default: {inline:1}} sets the output target for the map reduce job. + * + * #### * out options: + * + * - `{inline:1}` the results are returned in an array + * - `{replace: 'collectionName'}` add the results to collectionName: the results replace the collection + * - `{reduce: 'collectionName'}` add the results to collectionName: if dups are detected, uses the reducer / finalize functions + * - `{merge: 'collectionName'}` add the results to collectionName: if dups exist the new docs overwrite the old + * + * If `options.out` is set to `replace`, `merge`, or `reduce`, a Model instance is returned that can be used for further querying. Queries run against this model are all executed with the [`lean` option](/docs/tutorials/lean.html); meaning only the js object is returned and no Mongoose magic is applied (getters, setters, etc). + * + * #### Example: + * + * const o = {}; + * // You can also define `map()` and `reduce()` as strings if your + * // linter complains about `emit()` not being defined + * o.map = 'function () { emit(this.name, 1) }'; + * o.reduce = 'function (k, vals) { return vals.length }'; + * o.out = { replace: 'createdCollectionNameForResults' } + * o.verbose = true; + * + * User.mapReduce(o, function (err, model, stats) { + * console.log('map reduce took %d ms', stats.processtime) + * model.find().where('value').gt(10).exec(function (err, docs) { + * console.log(docs); + * }); + * }) + * + * // `mapReduce()` returns a promise. However, ES6 promises can only + * // resolve to exactly one value, + * o.resolveToObject = true; + * const promise = User.mapReduce(o); + * promise.then(function (res) { + * const model = res.model; + * const stats = res.stats; + * console.log('map reduce took %d ms', stats.processtime) + * return model.find().where('value').gt(10).exec(); + * }).then(function (docs) { + * console.log(docs); + * }).then(null, handleError).end() + * + * @param {Object} o an object specifying map-reduce options + * @param {Function} [callback] optional callback + * @see https://www.mongodb.org/display/DOCS/MapReduce + * @return {Promise} + * @api public + */ + +Model.mapReduce = function mapReduce(o, callback) { + _checkContext(this, 'mapReduce'); + + callback = this.$handleCallbackError(callback); + + return this.db.base._promiseOrCallback(callback, cb => { + cb = this.$wrapCallback(cb); + + if (!Model.mapReduce.schema) { + const opts = { _id: false, id: false, strict: false }; + Model.mapReduce.schema = new Schema({}, opts); + } + + if (!o.out) o.out = { inline: 1 }; + if (o.verbose !== false) o.verbose = true; + + o.map = String(o.map); + o.reduce = String(o.reduce); + + if (o.query) { + let q = new this.Query(o.query); + q.cast(this); + o.query = q._conditions; + q = undefined; + } + + this.$__collection.mapReduce(null, null, o, (err, res) => { + if (err) { + return cb(err); + } + if (res.collection) { + // returned a collection, convert to Model + const model = Model.compile('_mapreduce_' + res.collection.collectionName, + Model.mapReduce.schema, res.collection.collectionName, this.db, + this.base); + + model._mapreduce = true; + res.model = model; + + return cb(null, res); + } + + cb(null, res); + }); + }, this.events); +}; + +/** + * Performs [aggregations](https://docs.mongodb.org/manual/applications/aggregation/) on the models collection. + * + * If a `callback` is passed, the `aggregate` is executed and a `Promise` is returned. If a callback is not passed, the `aggregate` itself is returned. + * + * This function triggers the following middleware. + * + * - `aggregate()` + * + * #### Example: + * + * // Find the max balance of all accounts + * const res = await Users.aggregate([ + * { $group: { _id: null, maxBalance: { $max: '$balance' }}}, + * { $project: { _id: 0, maxBalance: 1 }} + * ]); + * + * console.log(res); // [ { maxBalance: 98000 } ] + * + * // Or use the aggregation pipeline builder. + * const res = await Users.aggregate(). + * group({ _id: null, maxBalance: { $max: '$balance' } }). + * project('-id maxBalance'). + * exec(); + * console.log(res); // [ { maxBalance: 98 } ] + * + * #### Note: + * + * - Mongoose does **not** cast aggregation pipelines to the model's schema because `$project` and `$group` operators allow redefining the "shape" of the documents at any stage of the pipeline, which may leave documents in an incompatible format. You can use the [mongoose-cast-aggregation plugin](https://github.com/AbdelrahmanHafez/mongoose-cast-aggregation) to enable minimal casting for aggregation pipelines. + * - The documents returned are plain javascript objects, not mongoose documents (since any shape of document can be returned). + * + * #### More About Aggregations: + * + * - [Mongoose `Aggregate`](/docs/api/aggregate.html) + * - [An Introduction to Mongoose Aggregate](https://masteringjs.io/tutorials/mongoose/aggregate) + * - [MongoDB Aggregation docs](https://docs.mongodb.org/manual/applications/aggregation/) + * + * @see Aggregate #aggregate_Aggregate + * @see MongoDB https://docs.mongodb.org/manual/applications/aggregation/ + * @param {Array} [pipeline] aggregation pipeline as an array of objects + * @param {Object} [options] aggregation options + * @param {Function} [callback] + * @return {Aggregate} + * @api public + */ + +Model.aggregate = function aggregate(pipeline, options, callback) { + _checkContext(this, 'aggregate'); + + if (arguments.length > 3 || (pipeline && pipeline.constructor && pipeline.constructor.name) === 'Object') { + throw new MongooseError('Mongoose 5.x disallows passing a spread of operators ' + + 'to `Model.aggregate()`. Instead of ' + + '`Model.aggregate({ $match }, { $skip })`, do ' + + '`Model.aggregate([{ $match }, { $skip }])`'); + } + + if (typeof pipeline === 'function') { + callback = pipeline; + pipeline = []; + } + + if (typeof options === 'function') { + callback = options; + options = null; + } + + const aggregate = new Aggregate(pipeline || []); + aggregate.model(this); + if (options != null) { + aggregate.option(options); + } + + if (typeof callback === 'undefined') { + return aggregate; + } + + callback = this.$handleCallbackError(callback); + callback = this.$wrapCallback(callback); + + aggregate.exec(callback); + return aggregate; +}; + +/** + * Casts and validates the given object against this model's schema, passing the + * given `context` to custom validators. + * + * #### Example: + * + * const Model = mongoose.model('Test', Schema({ + * name: { type: String, required: true }, + * age: { type: Number, required: true } + * }); + * + * try { + * await Model.validate({ name: null }, ['name']) + * } catch (err) { + * err instanceof mongoose.Error.ValidationError; // true + * Object.keys(err.errors); // ['name'] + * } + * + * @param {Object} obj + * @param {Array|String} pathsToValidate + * @param {Object} [context] + * @param {Function} [callback] + * @return {Promise|undefined} + * @api public + */ + +Model.validate = function validate(obj, pathsToValidate, context, callback) { + if ((arguments.length < 3) || (arguments.length === 3 && typeof arguments[2] === 'function')) { + // For convenience, if we're validating a document or an object, make `context` default to + // the model so users don't have to always pass `context`, re: gh-10132, gh-10346 + context = obj; + } + + return this.db.base._promiseOrCallback(callback, cb => { + const schema = this.schema; + let paths = Object.keys(schema.paths); + + if (pathsToValidate != null) { + const _pathsToValidate = typeof pathsToValidate === 'string' ? new Set(pathsToValidate.split(' ')) : new Set(pathsToValidate); + paths = paths.filter(p => { + const pieces = p.split('.'); + let cur = pieces[0]; + + for (const piece of pieces) { + if (_pathsToValidate.has(cur)) { + return true; + } + cur += '.' + piece; + } + + return _pathsToValidate.has(p); + }); + } + + for (const path of paths) { + const schemaType = schema.path(path); + if (!schemaType || !schemaType.$isMongooseArray || schemaType.$isMongooseDocumentArray) { + continue; + } + + const val = get(obj, path); + pushNestedArrayPaths(val, path); + } + + let remaining = paths.length; + let error = null; + + for (const path of paths) { + const schemaType = schema.path(path); + if (schemaType == null) { + _checkDone(); + continue; + } + + const pieces = path.split('.'); + let cur = obj; + for (let i = 0; i < pieces.length - 1; ++i) { + cur = cur[pieces[i]]; + } + + let val = get(obj, path, void 0); + + if (val != null) { + try { + val = schemaType.cast(val); + cur[pieces[pieces.length - 1]] = val; + } catch (err) { + error = error || new ValidationError(); + error.addError(path, err); + + _checkDone(); + continue; + } + } + + schemaType.doValidate(val, err => { + if (err) { + error = error || new ValidationError(); + if (err instanceof ValidationError) { + for (const _err of Object.keys(err.errors)) { + error.addError(`${path}.${err.errors[_err].path}`, _err); + } + } else { + error.addError(err.path, err); + } + } + _checkDone(); + }, context, { path: path }); + } + + function pushNestedArrayPaths(nestedArray, path) { + if (nestedArray == null) { + return; + } + + for (let i = 0; i < nestedArray.length; ++i) { + if (Array.isArray(nestedArray[i])) { + pushNestedArrayPaths(nestedArray[i], path + '.' + i); + } else { + paths.push(path + '.' + i); + } + } + } + + function _checkDone() { + if (--remaining <= 0) { + return cb(error); + } + } + }); +}; + +/** + * Populates document references. + * + * Changed in Mongoose 6: the model you call `populate()` on should be the + * "local field" model, **not** the "foreign field" model. + * + * #### Available top-level options: + * + * - path: space delimited path(s) to populate + * - select: optional fields to select + * - match: optional query conditions to match + * - model: optional name of the model to use for population + * - options: optional query options like sort, limit, etc + * - justOne: optional boolean, if true Mongoose will always set `path` to an array. Inferred from schema by default. + * - strictPopulate: optional boolean, set to `false` to allow populating paths that aren't in the schema. + * + * #### Examples: + * + * const Dog = mongoose.model('Dog', new Schema({ name: String, breed: String })); + * const Person = mongoose.model('Person', new Schema({ + * name: String, + * pet: { type: mongoose.ObjectId, ref: 'Dog' } + * })); + * + * const pets = await Pet.create([ + * { name: 'Daisy', breed: 'Beagle' }, + * { name: 'Einstein', breed: 'Catalan Sheepdog' } + * ]); + * + * // populate many plain objects + * const users = [ + * { name: 'John Wick', dog: pets[0]._id }, + * { name: 'Doc Brown', dog: pets[1]._id } + * ]; + * await User.populate(users, { path: 'dog', select: 'name' }); + * users[0].dog.name; // 'Daisy' + * users[0].dog.breed; // undefined because of `select` + * + * @param {Document|Array} docs Either a single document or array of documents to populate. + * @param {Object|String} options Either the paths to populate or an object specifying all parameters + * @param {string} [options.path=null] The path to populate. + * @param {string|PopulateOptions} [options.populate=null] Recursively populate paths in the populated documents. See [deep populate docs](/docs/populate.html#deep-populate). + * @param {boolean} [options.retainNullValues=false] By default, Mongoose removes null and undefined values from populated arrays. Use this option to make `populate()` retain `null` and `undefined` array entries. + * @param {boolean} [options.getters=false] If true, Mongoose will call any getters defined on the `localField`. By default, Mongoose gets the raw value of `localField`. For example, you would need to set this option to `true` if you wanted to [add a `lowercase` getter to your `localField`](/docs/schematypes.html#schematype-options). + * @param {boolean} [options.clone=false] When you do `BlogPost.find().populate('author')`, blog posts with the same author will share 1 copy of an `author` doc. Enable this option to make Mongoose clone populated docs before assigning them. + * @param {Object|Function} [options.match=null] Add an additional filter to the populate query. Can be a filter object containing [MongoDB query syntax](https://docs.mongodb.com/manual/tutorial/query-documents/), or a function that returns a filter object. + * @param {Boolean} [options.skipInvalidIds=false] By default, Mongoose throws a cast error if `localField` and `foreignField` schemas don't line up. If you enable this option, Mongoose will instead filter out any `localField` properties that cannot be casted to `foreignField`'s schema type. + * @param {Number} [options.perDocumentLimit=null] For legacy reasons, `limit` with `populate()` may give incorrect results because it only executes a single query for every document being populated. If you set `perDocumentLimit`, Mongoose will ensure correct `limit` per document by executing a separate query for each document to `populate()`. For example, `.find().populate({ path: 'test', perDocumentLimit: 2 })` will execute 2 additional queries if `.find()` returns 2 documents. + * @param {Boolean} [options.strictPopulate=true] Set to false to allow populating paths that aren't defined in the given model's schema. + * @param {Object} [options.options=null] Additional options like `limit` and `lean`. + * @param {Function} [options.transform=null] Function that Mongoose will call on every populated document that allows you to transform the populated document. + * @param {Function} [callback(err,doc)] Optional callback, executed upon completion. Receives `err` and the `doc(s)`. + * @return {Promise} + * @api public + */ + +Model.populate = function(docs, paths, callback) { + _checkContext(this, 'populate'); + + const _this = this; + + // normalized paths + paths = utils.populate(paths); + + // data that should persist across subPopulate calls + const cache = {}; + + callback = this.$handleCallbackError(callback); + return this.db.base._promiseOrCallback(callback, cb => { + cb = this.$wrapCallback(cb); + _populate(_this, docs, paths, cache, cb); + }, this.events); +}; + +/*! + * Populate helper + * + * @param {Model} model the model to use + * @param {Document|Array} docs Either a single document or array of documents to populate. + * @param {Object} paths + * @param {Function} [cb(err,doc)] Optional callback, executed upon completion. Receives `err` and the `doc(s)`. + * @return {Function} + * @api private + */ + +function _populate(model, docs, paths, cache, callback) { + let pending = paths.length; + if (paths.length === 0) { + return callback(null, docs); + } + // each path has its own query options and must be executed separately + for (const path of paths) { + populate(model, docs, path, next); + } + + function next(err) { + if (err) { + return callback(err, null); + } + if (--pending) { + return; + } + callback(null, docs); + } +} + +/*! + * Populates `docs` + */ +const excludeIdReg = /\s?-_id\s?/; +const excludeIdRegGlobal = /\s?-_id\s?/g; + +function populate(model, docs, options, callback) { + const populateOptions = { ...options }; + if (options.strictPopulate == null) { + if (options._localModel != null && options._localModel.schema._userProvidedOptions.strictPopulate != null) { + populateOptions.strictPopulate = options._localModel.schema._userProvidedOptions.strictPopulate; + } else if (options._localModel != null && model.base.options.strictPopulate != null) { + populateOptions.strictPopulate = model.base.options.strictPopulate; + } else if (model.base.options.strictPopulate != null) { + populateOptions.strictPopulate = model.base.options.strictPopulate; + } + } + + // normalize single / multiple docs passed + if (!Array.isArray(docs)) { + docs = [docs]; + } + if (docs.length === 0 || docs.every(utils.isNullOrUndefined)) { + return callback(); + } + + const modelsMap = getModelsMapForPopulate(model, docs, populateOptions); + if (modelsMap instanceof MongooseError) { + return immediate(function() { + callback(modelsMap); + }); + } + + const len = modelsMap.length; + let vals = []; + + function flatten(item) { + // no need to include undefined values in our query + return undefined !== item; + } + + let _remaining = len; + let hasOne = false; + const params = []; + for (let i = 0; i < len; ++i) { + const mod = modelsMap[i]; + let select = mod.options.select; + let ids = utils.array.flatten(mod.ids, flatten); + ids = utils.array.unique(ids); + + const assignmentOpts = {}; + assignmentOpts.sort = mod && + mod.options && + mod.options.options && + mod.options.options.sort || void 0; + assignmentOpts.excludeId = excludeIdReg.test(select) || (select && select._id === 0); + + if (ids.length === 0 || ids.every(utils.isNullOrUndefined)) { + // Ensure that we set to 0 or empty array even + // if we don't actually execute a query to make sure there's a value + // and we know this path was populated for future sets. See gh-7731, gh-8230 + --_remaining; + _assign(model, [], mod, assignmentOpts); + continue; + } + + hasOne = true; + const match = createPopulateQueryFilter(ids, mod.match, mod.foreignField, mod.model, mod.options.skipInvalidIds); + + if (assignmentOpts.excludeId) { + // override the exclusion from the query so we can use the _id + // for document matching during assignment. we'll delete the + // _id back off before returning the result. + if (typeof select === 'string') { + select = select.replace(excludeIdRegGlobal, ' '); + } else { + // preserve original select conditions by copying + select = utils.object.shallowCopy(select); + delete select._id; + } + } + + if (mod.options.options && mod.options.options.limit != null) { + assignmentOpts.originalLimit = mod.options.options.limit; + } else if (mod.options.limit != null) { + assignmentOpts.originalLimit = mod.options.limit; + } + params.push([mod, match, select, assignmentOpts, _next]); + } + if (!hasOne) { + // If models but no docs, skip further deep populate. + if (modelsMap.length !== 0) { + return callback(); + } + // If no models to populate but we have a nested populate, + // keep trying, re: gh-8946 + if (populateOptions.populate != null) { + const opts = utils.populate(populateOptions.populate).map(pop => Object.assign({}, pop, { + path: populateOptions.path + '.' + pop.path + })); + return model.populate(docs, opts, callback); + } + return callback(); + } + + for (const arr of params) { + _execPopulateQuery.apply(null, arr); + } + function _next(err, valsFromDb) { + if (err != null) { + return callback(err, null); + } + vals = vals.concat(valsFromDb); + if (--_remaining === 0) { + _done(); + } + } + + function _done() { + for (const arr of params) { + const mod = arr[0]; + const assignmentOpts = arr[3]; + for (const val of vals) { + mod.options._childDocs.push(val); + } + _assign(model, vals, mod, assignmentOpts); + } + + for (const arr of params) { + removeDeselectedForeignField(arr[0].foreignField, arr[0].options, vals); + } + callback(); + } +} + +/*! + * ignore + */ + +function _execPopulateQuery(mod, match, select, assignmentOpts, callback) { + const subPopulate = utils.clone(mod.options.populate); + const queryOptions = Object.assign({ + skip: mod.options.skip, + limit: mod.options.limit, + perDocumentLimit: mod.options.perDocumentLimit + }, mod.options.options); + + if (mod.count) { + delete queryOptions.skip; + } + + if (queryOptions.perDocumentLimit != null) { + queryOptions.limit = queryOptions.perDocumentLimit; + delete queryOptions.perDocumentLimit; + } else if (queryOptions.limit != null) { + queryOptions.limit = queryOptions.limit * mod.ids.length; + } + + const query = mod.model.find(match, select, queryOptions); + // If we're doing virtual populate and projection is inclusive and foreign + // field is not selected, automatically select it because mongoose needs it. + // If projection is exclusive and client explicitly unselected the foreign + // field, that's the client's fault. + for (const foreignField of mod.foreignField) { + if (foreignField !== '_id' && query.selectedInclusively() && + !isPathSelectedInclusive(query._fields, foreignField)) { + query.select(foreignField); + } + } + + // If using count, still need the `foreignField` so we can match counts + // to documents, otherwise we would need a separate `count()` for every doc. + if (mod.count) { + for (const foreignField of mod.foreignField) { + query.select(foreignField); + } + } + + // If we need to sub-populate, call populate recursively + if (subPopulate) { + // If subpopulating on a discriminator, skip check for non-existent + // paths. Because the discriminator may not have the path defined. + if (mod.model.baseModelName != null) { + if (Array.isArray(subPopulate)) { + subPopulate.forEach(pop => { pop.strictPopulate = false; }); + } else { + subPopulate.strictPopulate = false; + } + } + const basePath = mod.options._fullPath || mod.options.path; + + if (Array.isArray(subPopulate)) { + for (const pop of subPopulate) { + pop._fullPath = basePath + '.' + pop.path; + } + } else if (typeof subPopulate === 'object') { + subPopulate._fullPath = basePath + '.' + subPopulate.path; + } + + query.populate(subPopulate); + } + + query.exec((err, docs) => { + if (err != null) { + return callback(err); + } + + for (const val of docs) { + leanPopulateMap.set(val, mod.model); + } + callback(null, docs); + }); +} + +/*! + * ignore + */ + +function _assign(model, vals, mod, assignmentOpts) { + const options = mod.options; + const isVirtual = mod.isVirtual; + const justOne = mod.justOne; + let _val; + const lean = options && + options.options && + options.options.lean || false; + const len = vals.length; + const rawOrder = {}; + const rawDocs = {}; + let key; + let val; + + // Clone because `assignRawDocsToIdStructure` will mutate the array + const allIds = utils.clone(mod.allIds); + // optimization: + // record the document positions as returned by + // the query result. + for (let i = 0; i < len; i++) { + val = vals[i]; + if (val == null) { + continue; + } + + for (const foreignField of mod.foreignField) { + _val = utils.getValue(foreignField, val); + if (Array.isArray(_val)) { + _val = utils.array.unique(utils.array.flatten(_val)); + + for (let __val of _val) { + if (__val instanceof Document) { + __val = __val._id; + } + key = String(__val); + if (rawDocs[key]) { + if (Array.isArray(rawDocs[key])) { + rawDocs[key].push(val); + rawOrder[key].push(i); + } else { + rawDocs[key] = [rawDocs[key], val]; + rawOrder[key] = [rawOrder[key], i]; + } + } else { + if (isVirtual && !justOne) { + rawDocs[key] = [val]; + rawOrder[key] = [i]; + } else { + rawDocs[key] = val; + rawOrder[key] = i; + } + } + } + } else { + if (_val instanceof Document) { + _val = _val._id; + } + key = String(_val); + if (rawDocs[key]) { + if (Array.isArray(rawDocs[key])) { + rawDocs[key].push(val); + rawOrder[key].push(i); + } else if (isVirtual || + rawDocs[key].constructor !== val.constructor || + String(rawDocs[key]._id) !== String(val._id)) { + // May need to store multiple docs with the same id if there's multiple models + // if we have discriminators or a ref function. But avoid converting to an array + // if we have multiple queries on the same model because of `perDocumentLimit` re: gh-9906 + rawDocs[key] = [rawDocs[key], val]; + rawOrder[key] = [rawOrder[key], i]; + } + } else { + rawDocs[key] = val; + rawOrder[key] = i; + } + } + // flag each as result of population + if (!lean) { + val.$__.wasPopulated = val.$__.wasPopulated || true; + } + } + } + + assignVals({ + originalModel: model, + // If virtual, make sure to not mutate original field + rawIds: mod.isVirtual ? allIds : mod.allIds, + allIds: allIds, + unpopulatedValues: mod.unpopulatedValues, + foreignField: mod.foreignField, + rawDocs: rawDocs, + rawOrder: rawOrder, + docs: mod.docs, + path: options.path, + options: assignmentOpts, + justOne: mod.justOne, + isVirtual: mod.isVirtual, + allOptions: mod, + populatedModel: mod.model, + lean: lean, + virtual: mod.virtual, + count: mod.count, + match: mod.match + }); +} + +/*! + * Compiler utility. + * + * @param {String|Function} name model name or class extending Model + * @param {Schema} schema + * @param {String} collectionName + * @param {Connection} connection + * @param {Mongoose} base mongoose instance + */ + +Model.compile = function compile(name, schema, collectionName, connection, base) { + const versioningEnabled = schema.options.versionKey !== false; + + if (versioningEnabled && !schema.paths[schema.options.versionKey]) { + // add versioning to top level documents only + const o = {}; + o[schema.options.versionKey] = Number; + schema.add(o); + } + let model; + if (typeof name === 'function' && name.prototype instanceof Model) { + model = name; + name = model.name; + schema.loadClass(model, false); + model.prototype.$isMongooseModelPrototype = true; + } else { + // generate new class + model = function model(doc, fields, skipId) { + model.hooks.execPreSync('createModel', doc); + if (!(this instanceof model)) { + return new model(doc, fields, skipId); + } + const discriminatorKey = model.schema.options.discriminatorKey; + + if (model.discriminators == null || doc == null || doc[discriminatorKey] == null) { + Model.call(this, doc, fields, skipId); + return; + } + + // If discriminator key is set, use the discriminator instead (gh-7586) + const Discriminator = model.discriminators[doc[discriminatorKey]] || + getDiscriminatorByValue(model.discriminators, doc[discriminatorKey]); + if (Discriminator != null) { + return new Discriminator(doc, fields, skipId); + } + + // Otherwise, just use the top-level model + Model.call(this, doc, fields, skipId); + }; + } + + model.hooks = schema.s.hooks.clone(); + model.base = base; + model.modelName = name; + + if (!(model.prototype instanceof Model)) { + model.__proto__ = Model; + model.prototype.__proto__ = Model.prototype; + } + model.model = function model(name) { + return this.db.model(name); + }; + + model.db = connection; + model.prototype.db = connection; + model.prototype[modelDbSymbol] = connection; + model.discriminators = model.prototype.discriminators = undefined; + model[modelSymbol] = true; + model.events = new EventEmitter(); + + schema._preCompile(); + + model.prototype.$__setSchema(schema); + + const _userProvidedOptions = schema._userProvidedOptions || {}; + + const collectionOptions = { + schemaUserProvidedOptions: _userProvidedOptions, + capped: schema.options.capped, + Promise: model.base.Promise, + modelName: name + }; + if (schema.options.autoCreate !== void 0) { + collectionOptions.autoCreate = schema.options.autoCreate; + } + + model.prototype.collection = connection.collection( + collectionName, + collectionOptions + ); + + model.prototype.$collection = model.prototype.collection; + model.prototype[modelCollectionSymbol] = model.prototype.collection; + + // apply methods and statics + applyMethods(model, schema); + applyStatics(model, schema); + applyHooks(model, schema); + applyStaticHooks(model, schema.s.hooks, schema.statics); + + model.schema = model.prototype.$__schema; + model.collection = model.prototype.collection; + model.$__collection = model.collection; + + // Create custom query constructor + model.Query = function() { + Query.apply(this, arguments); + }; + model.Query.prototype = Object.create(Query.prototype); + model.Query.base = Query.base; + applyQueryMiddleware(model.Query, model); + applyQueryMethods(model, schema.query); + + return model; +}; + +/*! + * Register custom query methods for this model + * + * @param {Model} model + * @param {Schema} schema + */ + +function applyQueryMethods(model, methods) { + for (const i in methods) { + model.Query.prototype[i] = methods[i]; + } +} + +/*! + * Subclass this model with `conn`, `schema`, and `collection` settings. + * + * @param {Connection} conn + * @param {Schema} [schema] + * @param {String} [collection] + * @return {Model} + */ + +Model.__subclass = function subclass(conn, schema, collection) { + // subclass model using this connection and collection name + const _this = this; + + const Model = function Model(doc, fields, skipId) { + if (!(this instanceof Model)) { + return new Model(doc, fields, skipId); + } + _this.call(this, doc, fields, skipId); + }; + + Model.__proto__ = _this; + Model.prototype.__proto__ = _this.prototype; + Model.db = conn; + Model.prototype.db = conn; + Model.prototype[modelDbSymbol] = conn; + + _this[subclassedSymbol] = _this[subclassedSymbol] || []; + _this[subclassedSymbol].push(Model); + if (_this.discriminators != null) { + Model.discriminators = {}; + for (const key of Object.keys(_this.discriminators)) { + Model.discriminators[key] = _this.discriminators[key]. + __subclass(_this.db, _this.discriminators[key].schema, collection); + } + } + + const s = schema && typeof schema !== 'string' + ? schema + : _this.prototype.$__schema; + + const options = s.options || {}; + const _userProvidedOptions = s._userProvidedOptions || {}; + + if (!collection) { + collection = _this.prototype.$__schema.get('collection') || + utils.toCollectionName(_this.modelName, this.base.pluralize()); + } + + const collectionOptions = { + schemaUserProvidedOptions: _userProvidedOptions, + capped: s && options.capped + }; + + Model.prototype.collection = conn.collection(collection, collectionOptions); + Model.prototype.$collection = Model.prototype.collection; + Model.prototype[modelCollectionSymbol] = Model.prototype.collection; + Model.collection = Model.prototype.collection; + Model.$__collection = Model.collection; + // Errors handled internally, so ignore + Model.init(() => {}); + return Model; +}; + +Model.$handleCallbackError = function(callback) { + if (callback == null) { + return callback; + } + if (typeof callback !== 'function') { + throw new MongooseError('Callback must be a function, got ' + callback); + } + + const _this = this; + return function() { + immediate(() => { + try { + callback.apply(null, arguments); + } catch (error) { + _this.emit('error', error); + } + }); + }; +}; + +/*! + * ignore + */ + +Model.$wrapCallback = function(callback) { + const serverSelectionError = new ServerSelectionError(); + const _this = this; + + return function(err) { + if (err != null && err.name === 'MongoServerSelectionError') { + arguments[0] = serverSelectionError.assimilateError(err); + } + if (err != null && err.name === 'MongoNetworkTimeoutError' && err.message.endsWith('timed out')) { + _this.db.emit('timeout'); + } + + return callback.apply(null, arguments); + }; +}; + +/** + * Helper for console.log. Given a model named 'MyModel', returns the string + * `'Model { MyModel }'`. + * + * #### Example: + * + * const MyModel = mongoose.model('Test', Schema({ name: String })); + * MyModel.inspect(); // 'Model { Test }' + * console.log(MyModel); // Prints 'Model { Test }' + * + * @api public + */ + +Model.inspect = function() { + return `Model { ${this.modelName} }`; +}; + +if (util.inspect.custom) { + /*! + * Avoid Node deprecation warning DEP0079 + */ + + Model[util.inspect.custom] = Model.inspect; +} + +/*! + * Module exports. + */ + +module.exports = exports = Model; diff --git a/node_modules/mongoose/lib/options.js b/node_modules/mongoose/lib/options.js new file mode 100644 index 000000000..4826e59fd --- /dev/null +++ b/node_modules/mongoose/lib/options.js @@ -0,0 +1,15 @@ +'use strict'; + +/*! + * ignore + */ + +exports.internalToObjectOptions = { + transform: false, + virtuals: false, + getters: false, + _skipDepopulateTopLevel: true, + depopulate: true, + flattenDecimals: false, + useProjection: false +}; diff --git a/node_modules/mongoose/lib/options/PopulateOptions.js b/node_modules/mongoose/lib/options/PopulateOptions.js new file mode 100644 index 000000000..5b9819460 --- /dev/null +++ b/node_modules/mongoose/lib/options/PopulateOptions.js @@ -0,0 +1,36 @@ +'use strict'; + +const clone = require('../helpers/clone'); + +class PopulateOptions { + constructor(obj) { + this._docs = {}; + this._childDocs = []; + + if (obj == null) { + return; + } + obj = clone(obj); + Object.assign(this, obj); + if (typeof obj.subPopulate === 'object') { + this.populate = obj.subPopulate; + } + + + if (obj.perDocumentLimit != null && obj.limit != null) { + throw new Error('Can not use `limit` and `perDocumentLimit` at the same time. Path: `' + obj.path + '`.'); + } + } +} + +/** + * The connection used to look up models by name. If not specified, Mongoose + * will default to using the connection associated with the model in + * `PopulateOptions#model`. + * + * @memberOf PopulateOptions + * @property {Connection} connection + * @api public + */ + +module.exports = PopulateOptions; \ No newline at end of file diff --git a/node_modules/mongoose/lib/options/SchemaArrayOptions.js b/node_modules/mongoose/lib/options/SchemaArrayOptions.js new file mode 100644 index 000000000..25aabb920 --- /dev/null +++ b/node_modules/mongoose/lib/options/SchemaArrayOptions.js @@ -0,0 +1,59 @@ +'use strict'; + +const SchemaTypeOptions = require('./SchemaTypeOptions'); + +/** + * The options defined on an Array schematype. + * + * #### Example: + * + * const schema = new Schema({ tags: [String] }); + * schema.path('tags').options; // SchemaArrayOptions instance + * + * @api public + * @inherits SchemaTypeOptions + * @constructor SchemaArrayOptions + */ + +class SchemaArrayOptions extends SchemaTypeOptions {} + +const opts = require('./propertyOptions'); + +/** + * If this is an array of strings, an array of allowed values for this path. + * Throws an error if this array isn't an array of strings. + * + * @api public + * @property enum + * @memberOf SchemaArrayOptions + * @type Array + * @instance + */ + +Object.defineProperty(SchemaArrayOptions.prototype, 'enum', opts); + +/** + * If set, specifies the type of this array's values. Equivalent to setting + * `type` to an array whose first element is `of`. + * + * #### Example: + * + * // `arr` is an array of numbers. + * new Schema({ arr: [Number] }); + * // Equivalent way to define `arr` as an array of numbers + * new Schema({ arr: { type: Array, of: Number } }); + * + * @api public + * @property of + * @memberOf SchemaArrayOptions + * @type Function|String + * @instance + */ + +Object.defineProperty(SchemaArrayOptions.prototype, 'of', opts); + +/*! + * ignore + */ + +module.exports = SchemaArrayOptions; \ No newline at end of file diff --git a/node_modules/mongoose/lib/options/SchemaBufferOptions.js b/node_modules/mongoose/lib/options/SchemaBufferOptions.js new file mode 100644 index 000000000..62d0b9c14 --- /dev/null +++ b/node_modules/mongoose/lib/options/SchemaBufferOptions.js @@ -0,0 +1,38 @@ +'use strict'; + +const SchemaTypeOptions = require('./SchemaTypeOptions'); + +/** + * The options defined on a Buffer schematype. + * + * #### Example: + * + * const schema = new Schema({ bitmap: Buffer }); + * schema.path('bitmap').options; // SchemaBufferOptions instance + * + * @api public + * @inherits SchemaTypeOptions + * @constructor SchemaBufferOptions + */ + +class SchemaBufferOptions extends SchemaTypeOptions {} + +const opts = require('./propertyOptions'); + +/** + * Set the default subtype for this buffer. + * + * @api public + * @property subtype + * @memberOf SchemaBufferOptions + * @type Number + * @instance + */ + +Object.defineProperty(SchemaBufferOptions.prototype, 'subtype', opts); + +/*! + * ignore + */ + +module.exports = SchemaBufferOptions; \ No newline at end of file diff --git a/node_modules/mongoose/lib/options/SchemaDateOptions.js b/node_modules/mongoose/lib/options/SchemaDateOptions.js new file mode 100644 index 000000000..bd43a9290 --- /dev/null +++ b/node_modules/mongoose/lib/options/SchemaDateOptions.js @@ -0,0 +1,71 @@ +'use strict'; + +const SchemaTypeOptions = require('./SchemaTypeOptions'); + +/** + * The options defined on a Date schematype. + * + * #### Example: + * + * const schema = new Schema({ startedAt: Date }); + * schema.path('startedAt').options; // SchemaDateOptions instance + * + * @api public + * @inherits SchemaTypeOptions + * @constructor SchemaDateOptions + */ + +class SchemaDateOptions extends SchemaTypeOptions {} + +const opts = require('./propertyOptions'); + +/** + * If set, Mongoose adds a validator that checks that this path is after the + * given `min`. + * + * @api public + * @property min + * @memberOf SchemaDateOptions + * @type Date + * @instance + */ + +Object.defineProperty(SchemaDateOptions.prototype, 'min', opts); + +/** + * If set, Mongoose adds a validator that checks that this path is before the + * given `max`. + * + * @api public + * @property max + * @memberOf SchemaDateOptions + * @type Date + * @instance + */ + +Object.defineProperty(SchemaDateOptions.prototype, 'max', opts); + +/** + * If set, Mongoose creates a TTL index on this path. + * + * mongo TTL index `expireAfterSeconds` value will take 'expires' value expressed in seconds. + * + * #### Example: + * + * const schema = new Schema({ "expireAt": { type: Date, expires: 11 } }); + * // if 'expireAt' is set, then document expires at expireAt + 11 seconds + * + * @api public + * @property expires + * @memberOf SchemaDateOptions + * @type Date + * @instance + */ + +Object.defineProperty(SchemaDateOptions.prototype, 'expires', opts); + +/*! + * ignore + */ + +module.exports = SchemaDateOptions; diff --git a/node_modules/mongoose/lib/options/SchemaDocumentArrayOptions.js b/node_modules/mongoose/lib/options/SchemaDocumentArrayOptions.js new file mode 100644 index 000000000..910227a01 --- /dev/null +++ b/node_modules/mongoose/lib/options/SchemaDocumentArrayOptions.js @@ -0,0 +1,68 @@ +'use strict'; + +const SchemaTypeOptions = require('./SchemaTypeOptions'); + +/** + * The options defined on an Document Array schematype. + * + * #### Example: + * + * const schema = new Schema({ users: [{ name: string }] }); + * schema.path('users').options; // SchemaDocumentArrayOptions instance + * + * @api public + * @inherits SchemaTypeOptions + * @constructor SchemaDocumentOptions + */ + +class SchemaDocumentArrayOptions extends SchemaTypeOptions {} + +const opts = require('./propertyOptions'); + +/** + * If `true`, Mongoose will skip building any indexes defined in this array's schema. + * If not set, Mongoose will build all indexes defined in this array's schema. + * + * #### Example: + * + * const childSchema = Schema({ name: { type: String, index: true } }); + * // If `excludeIndexes` is `true`, Mongoose will skip building an index + * // on `arr.name`. Otherwise, Mongoose will build an index on `arr.name`. + * const parentSchema = Schema({ + * arr: { type: [childSchema], excludeIndexes: true } + * }); + * + * @api public + * @property excludeIndexes + * @memberOf SchemaDocumentArrayOptions + * @type Array + * @instance + */ + +Object.defineProperty(SchemaDocumentArrayOptions.prototype, 'excludeIndexes', opts); + +/** + * If set, overwrites the child schema's `_id` option. + * + * #### Example: + * + * const childSchema = Schema({ name: String }); + * const parentSchema = Schema({ + * child: { type: childSchema, _id: false } + * }); + * parentSchema.path('child').schema.options._id; // false + * + * @api public + * @property _id + * @memberOf SchemaDocumentArrayOptions + * @type Array + * @instance + */ + +Object.defineProperty(SchemaDocumentArrayOptions.prototype, '_id', opts); + +/*! + * ignore + */ + +module.exports = SchemaDocumentArrayOptions; \ No newline at end of file diff --git a/node_modules/mongoose/lib/options/SchemaMapOptions.js b/node_modules/mongoose/lib/options/SchemaMapOptions.js new file mode 100644 index 000000000..2ef4c79a6 --- /dev/null +++ b/node_modules/mongoose/lib/options/SchemaMapOptions.js @@ -0,0 +1,43 @@ +'use strict'; + +const SchemaTypeOptions = require('./SchemaTypeOptions'); + +/** + * The options defined on a Map schematype. + * + * #### Example: + * + * const schema = new Schema({ socialMediaHandles: { type: Map, of: String } }); + * schema.path('socialMediaHandles').options; // SchemaMapOptions instance + * + * @api public + * @inherits SchemaTypeOptions + * @constructor SchemaMapOptions + */ + +class SchemaMapOptions extends SchemaTypeOptions {} + +const opts = require('./propertyOptions'); + +/** + * If set, specifies the type of this map's values. Mongoose will cast + * this map's values to the given type. + * + * If not set, Mongoose will not cast the map's values. + * + * #### Example: + * + * // Mongoose will cast `socialMediaHandles` values to strings + * const schema = new Schema({ socialMediaHandles: { type: Map, of: String } }); + * schema.path('socialMediaHandles').options.of; // String + * + * @api public + * @property of + * @memberOf SchemaMapOptions + * @type Function|string + * @instance + */ + +Object.defineProperty(SchemaMapOptions.prototype, 'of', opts); + +module.exports = SchemaMapOptions; \ No newline at end of file diff --git a/node_modules/mongoose/lib/options/SchemaNumberOptions.js b/node_modules/mongoose/lib/options/SchemaNumberOptions.js new file mode 100644 index 000000000..dbeaf740d --- /dev/null +++ b/node_modules/mongoose/lib/options/SchemaNumberOptions.js @@ -0,0 +1,99 @@ +'use strict'; + +const SchemaTypeOptions = require('./SchemaTypeOptions'); + +/** + * The options defined on a Number schematype. + * + * #### Example: + * + * const schema = new Schema({ count: Number }); + * schema.path('count').options; // SchemaNumberOptions instance + * + * @api public + * @inherits SchemaTypeOptions + * @constructor SchemaNumberOptions + */ + +class SchemaNumberOptions extends SchemaTypeOptions {} + +const opts = require('./propertyOptions'); + +/** + * If set, Mongoose adds a validator that checks that this path is at least the + * given `min`. + * + * @api public + * @property min + * @memberOf SchemaNumberOptions + * @type Number + * @instance + */ + +Object.defineProperty(SchemaNumberOptions.prototype, 'min', opts); + +/** + * If set, Mongoose adds a validator that checks that this path is less than the + * given `max`. + * + * @api public + * @property max + * @memberOf SchemaNumberOptions + * @type Number + * @instance + */ + +Object.defineProperty(SchemaNumberOptions.prototype, 'max', opts); + +/** + * If set, Mongoose adds a validator that checks that this path is strictly + * equal to one of the given values. + * + * #### Example: + * const schema = new Schema({ + * favoritePrime: { + * type: Number, + * enum: [3, 5, 7] + * } + * }); + * schema.path('favoritePrime').options.enum; // [3, 5, 7] + * + * @api public + * @property enum + * @memberOf SchemaNumberOptions + * @type Array + * @instance + */ + +Object.defineProperty(SchemaNumberOptions.prototype, 'enum', opts); + +/** + * Sets default [populate options](/docs/populate.html#query-conditions). + * + * #### Example: + * const schema = new Schema({ + * child: { + * type: Number, + * ref: 'Child', + * populate: { select: 'name' } + * } + * }); + * const Parent = mongoose.model('Parent', schema); + * + * // Automatically adds `.select('name')` + * Parent.findOne().populate('child'); + * + * @api public + * @property populate + * @memberOf SchemaNumberOptions + * @type Object + * @instance + */ + +Object.defineProperty(SchemaNumberOptions.prototype, 'populate', opts); + +/*! + * ignore + */ + +module.exports = SchemaNumberOptions; \ No newline at end of file diff --git a/node_modules/mongoose/lib/options/SchemaObjectIdOptions.js b/node_modules/mongoose/lib/options/SchemaObjectIdOptions.js new file mode 100644 index 000000000..800aea0f4 --- /dev/null +++ b/node_modules/mongoose/lib/options/SchemaObjectIdOptions.js @@ -0,0 +1,63 @@ +'use strict'; + +const SchemaTypeOptions = require('./SchemaTypeOptions'); + +/** + * The options defined on an ObjectId schematype. + * + * #### Example: + * + * const schema = new Schema({ testId: mongoose.ObjectId }); + * schema.path('testId').options; // SchemaObjectIdOptions instance + * + * @api public + * @inherits SchemaTypeOptions + * @constructor SchemaObjectIdOptions + */ + +class SchemaObjectIdOptions extends SchemaTypeOptions {} + +const opts = require('./propertyOptions'); + +/** + * If truthy, uses Mongoose's default built-in ObjectId path. + * + * @api public + * @property auto + * @memberOf SchemaObjectIdOptions + * @type Boolean + * @instance + */ + +Object.defineProperty(SchemaObjectIdOptions.prototype, 'auto', opts); + +/** + * Sets default [populate options](/docs/populate.html#query-conditions). + * + * #### Example: + * const schema = new Schema({ + * child: { + * type: 'ObjectId', + * ref: 'Child', + * populate: { select: 'name' } + * } + * }); + * const Parent = mongoose.model('Parent', schema); + * + * // Automatically adds `.select('name')` + * Parent.findOne().populate('child'); + * + * @api public + * @property populate + * @memberOf SchemaObjectIdOptions + * @type Object + * @instance + */ + +Object.defineProperty(SchemaObjectIdOptions.prototype, 'populate', opts); + +/*! + * ignore + */ + +module.exports = SchemaObjectIdOptions; \ No newline at end of file diff --git a/node_modules/mongoose/lib/options/SchemaStringOptions.js b/node_modules/mongoose/lib/options/SchemaStringOptions.js new file mode 100644 index 000000000..aee4f6620 --- /dev/null +++ b/node_modules/mongoose/lib/options/SchemaStringOptions.js @@ -0,0 +1,138 @@ +'use strict'; + +const SchemaTypeOptions = require('./SchemaTypeOptions'); + +/** + * The options defined on a string schematype. + * + * #### Example: + * + * const schema = new Schema({ name: String }); + * schema.path('name').options; // SchemaStringOptions instance + * + * @api public + * @inherits SchemaTypeOptions + * @constructor SchemaStringOptions + */ + +class SchemaStringOptions extends SchemaTypeOptions {} + +const opts = require('./propertyOptions'); + +/** + * Array of allowed values for this path + * + * @api public + * @property enum + * @memberOf SchemaStringOptions + * @type Array + * @instance + */ + +Object.defineProperty(SchemaStringOptions.prototype, 'enum', opts); + +/** + * Attach a validator that succeeds if the data string matches the given regular + * expression, and fails otherwise. + * + * @api public + * @property match + * @memberOf SchemaStringOptions + * @type RegExp + * @instance + */ + +Object.defineProperty(SchemaStringOptions.prototype, 'match', opts); + +/** + * If truthy, Mongoose will add a custom setter that lowercases this string + * using JavaScript's built-in `String#toLowerCase()`. + * + * @api public + * @property lowercase + * @memberOf SchemaStringOptions + * @type Boolean + * @instance + */ + +Object.defineProperty(SchemaStringOptions.prototype, 'lowercase', opts); + +/** + * If truthy, Mongoose will add a custom setter that removes leading and trailing + * whitespace using [JavaScript's built-in `String#trim()`](https://masteringjs.io/tutorials/fundamentals/trim-string). + * + * @api public + * @property trim + * @memberOf SchemaStringOptions + * @type Boolean + * @instance + */ + +Object.defineProperty(SchemaStringOptions.prototype, 'trim', opts); + +/** + * If truthy, Mongoose will add a custom setter that uppercases this string + * using JavaScript's built-in [`String#toUpperCase()`](https://masteringjs.io/tutorials/fundamentals/uppercase). + * + * @api public + * @property uppercase + * @memberOf SchemaStringOptions + * @type Boolean + * @instance + */ + +Object.defineProperty(SchemaStringOptions.prototype, 'uppercase', opts); + +/** + * If set, Mongoose will add a custom validator that ensures the given + * string's `length` is at least the given number. + * + * Mongoose supports two different spellings for this option: `minLength` and `minlength`. + * `minLength` is the recommended way to specify this option, but Mongoose also supports + * `minlength` (lowercase "l"). + * + * @api public + * @property minLength + * @memberOf SchemaStringOptions + * @type Number + * @instance + */ + +Object.defineProperty(SchemaStringOptions.prototype, 'minLength', opts); +Object.defineProperty(SchemaStringOptions.prototype, 'minlength', opts); + +/** + * If set, Mongoose will add a custom validator that ensures the given + * string's `length` is at most the given number. + * + * Mongoose supports two different spellings for this option: `maxLength` and `maxlength`. + * `maxLength` is the recommended way to specify this option, but Mongoose also supports + * `maxlength` (lowercase "l"). + * + * @api public + * @property maxLength + * @memberOf SchemaStringOptions + * @type Number + * @instance + */ + +Object.defineProperty(SchemaStringOptions.prototype, 'maxLength', opts); +Object.defineProperty(SchemaStringOptions.prototype, 'maxlength', opts); + +/** + * Sets default [populate options](/docs/populate.html#query-conditions). + * + * @api public + * @property populate + * @memberOf SchemaStringOptions + * @type Object + * @instance + */ + +Object.defineProperty(SchemaStringOptions.prototype, 'populate', opts); + +/*! + * ignore + */ + +module.exports = SchemaStringOptions; diff --git a/node_modules/mongoose/lib/options/SchemaSubdocumentOptions.js b/node_modules/mongoose/lib/options/SchemaSubdocumentOptions.js new file mode 100644 index 000000000..9d177255b --- /dev/null +++ b/node_modules/mongoose/lib/options/SchemaSubdocumentOptions.js @@ -0,0 +1,42 @@ +'use strict'; + +const SchemaTypeOptions = require('./SchemaTypeOptions'); + +/** + * The options defined on a single nested schematype. + * + * #### Example: + * + * const schema = Schema({ child: Schema({ name: String }) }); + * schema.path('child').options; // SchemaSubdocumentOptions instance + * + * @api public + * @inherits SchemaTypeOptions + * @constructor SchemaSubdocumentOptions + */ + +class SchemaSubdocumentOptions extends SchemaTypeOptions {} + +const opts = require('./propertyOptions'); + +/** + * If set, overwrites the child schema's `_id` option. + * + * #### Example: + * + * const childSchema = Schema({ name: String }); + * const parentSchema = Schema({ + * child: { type: childSchema, _id: false } + * }); + * parentSchema.path('child').schema.options._id; // false + * + * @api public + * @property of + * @memberOf SchemaSubdocumentOptions + * @type Function|string + * @instance + */ + +Object.defineProperty(SchemaSubdocumentOptions.prototype, '_id', opts); + +module.exports = SchemaSubdocumentOptions; \ No newline at end of file diff --git a/node_modules/mongoose/lib/options/SchemaTypeOptions.js b/node_modules/mongoose/lib/options/SchemaTypeOptions.js new file mode 100644 index 000000000..22f08a09c --- /dev/null +++ b/node_modules/mongoose/lib/options/SchemaTypeOptions.js @@ -0,0 +1,244 @@ +'use strict'; + +const clone = require('../helpers/clone'); + +/** + * The options defined on a schematype. + * + * #### Example: + * + * const schema = new Schema({ name: String }); + * schema.path('name').options instanceof mongoose.SchemaTypeOptions; // true + * + * @api public + * @constructor SchemaTypeOptions + */ + +class SchemaTypeOptions { + constructor(obj) { + if (obj == null) { + return this; + } + Object.assign(this, clone(obj)); + } +} + +const opts = require('./propertyOptions'); + +/** + * The type to cast this path to. + * + * @api public + * @property type + * @memberOf SchemaTypeOptions + * @type Function|String|Object + * @instance + */ + +Object.defineProperty(SchemaTypeOptions.prototype, 'type', opts); + +/** + * Function or object describing how to validate this schematype. + * + * @api public + * @property validate + * @memberOf SchemaTypeOptions + * @type Function|Object + * @instance + */ + +Object.defineProperty(SchemaTypeOptions.prototype, 'validate', opts); + +/** + * Allows overriding casting logic for this individual path. If a string, the + * given string overwrites Mongoose's default cast error message. + * + * #### Example: + * + * const schema = new Schema({ + * num: { + * type: Number, + * cast: '{VALUE} is not a valid number' + * } + * }); + * + * // Throws 'CastError: "bad" is not a valid number' + * schema.path('num').cast('bad'); + * + * const Model = mongoose.model('Test', schema); + * const doc = new Model({ num: 'fail' }); + * const err = doc.validateSync(); + * + * err.errors['num']; // 'CastError: "fail" is not a valid number' + * + * @api public + * @property cast + * @memberOf SchemaTypeOptions + * @type String + * @instance + */ + +Object.defineProperty(SchemaTypeOptions.prototype, 'cast', opts); + +/** + * If true, attach a required validator to this path, which ensures this path + * cannot be set to a nullish value. If a function, Mongoose calls the + * function and only checks for nullish values if the function returns a truthy value. + * + * @api public + * @property required + * @memberOf SchemaTypeOptions + * @type Function|Boolean + * @instance + */ + +Object.defineProperty(SchemaTypeOptions.prototype, 'required', opts); + +/** + * The default value for this path. If a function, Mongoose executes the function + * and uses the return value as the default. + * + * @api public + * @property default + * @memberOf SchemaTypeOptions + * @type Function|Any + * @instance + */ + +Object.defineProperty(SchemaTypeOptions.prototype, 'default', opts); + +/** + * The model that `populate()` should use if populating this path. + * + * @api public + * @property ref + * @memberOf SchemaTypeOptions + * @type Function|String + * @instance + */ + +Object.defineProperty(SchemaTypeOptions.prototype, 'ref', opts); + +/** + * The path in the document that `populate()` should use to find the model + * to use. + * + * @api public + * @property ref + * @memberOf SchemaTypeOptions + * @type Function|String + * @instance + */ + +Object.defineProperty(SchemaTypeOptions.prototype, 'refPath', opts); + +/** + * Whether to include or exclude this path by default when loading documents + * using `find()`, `findOne()`, etc. + * + * @api public + * @property select + * @memberOf SchemaTypeOptions + * @type Boolean|Number + * @instance + */ + +Object.defineProperty(SchemaTypeOptions.prototype, 'select', opts); + +/** + * If [truthy](https://masteringjs.io/tutorials/fundamentals/truthy), Mongoose will + * build an index on this path when the model is compiled. + * + * @api public + * @property index + * @memberOf SchemaTypeOptions + * @type Boolean|Number|Object + * @instance + */ + +Object.defineProperty(SchemaTypeOptions.prototype, 'index', opts); + +/** + * If [truthy](https://masteringjs.io/tutorials/fundamentals/truthy), Mongoose + * will build a unique index on this path when the + * model is compiled. [The `unique` option is **not** a validator](/docs/validation.html#the-unique-option-is-not-a-validator). + * + * @api public + * @property unique + * @memberOf SchemaTypeOptions + * @type Boolean|Number + * @instance + */ + +Object.defineProperty(SchemaTypeOptions.prototype, 'unique', opts); + +/** + * If [truthy](https://masteringjs.io/tutorials/fundamentals/truthy), Mongoose will + * disallow changes to this path once the document + * is saved to the database for the first time. Read more about [immutability in Mongoose here](https://thecodebarbarian.com/whats-new-in-mongoose-5-6-immutable-properties.html). + * + * @api public + * @property immutable + * @memberOf SchemaTypeOptions + * @type Function|Boolean + * @instance + */ + +Object.defineProperty(SchemaTypeOptions.prototype, 'immutable', opts); + +/** + * If [truthy](https://masteringjs.io/tutorials/fundamentals/truthy), Mongoose will + * build a sparse index on this path. + * + * @api public + * @property sparse + * @memberOf SchemaTypeOptions + * @type Boolean|Number + * @instance + */ + +Object.defineProperty(SchemaTypeOptions.prototype, 'sparse', opts); + +/** + * If [truthy](https://masteringjs.io/tutorials/fundamentals/truthy), Mongoose + * will build a text index on this path. + * + * @api public + * @property text + * @memberOf SchemaTypeOptions + * @type Boolean|Number|Object + * @instance + */ + +Object.defineProperty(SchemaTypeOptions.prototype, 'text', opts); + +/** + * Define a transform function for this individual schema type. + * Only called when calling `toJSON()` or `toObject()`. + * + * #### Example: + * + * const schema = Schema({ + * myDate: { + * type: Date, + * transform: v => v.getFullYear() + * } + * }); + * const Model = mongoose.model('Test', schema); + * + * const doc = new Model({ myDate: new Date('2019/06/01') }); + * doc.myDate instanceof Date; // true + * + * const res = doc.toObject({ transform: true }); + * res.myDate; // 2019 + * + * @api public + * @property transform + * @memberOf SchemaTypeOptions + * @type Function + * @instance + */ + +Object.defineProperty(SchemaTypeOptions.prototype, 'transform', opts); + +module.exports = SchemaTypeOptions; \ No newline at end of file diff --git a/node_modules/mongoose/lib/options/VirtualOptions.js b/node_modules/mongoose/lib/options/VirtualOptions.js new file mode 100644 index 000000000..a26641459 --- /dev/null +++ b/node_modules/mongoose/lib/options/VirtualOptions.js @@ -0,0 +1,164 @@ +'use strict'; + +const opts = require('./propertyOptions'); + +class VirtualOptions { + constructor(obj) { + Object.assign(this, obj); + + if (obj != null && obj.options != null) { + this.options = Object.assign({}, obj.options); + } + } +} + +/** + * Marks this virtual as a populate virtual, and specifies the model to + * use for populate. + * + * @api public + * @property ref + * @memberOf VirtualOptions + * @type String|Model|Function + * @instance + */ + +Object.defineProperty(VirtualOptions.prototype, 'ref', opts); + +/** + * Marks this virtual as a populate virtual, and specifies the path that + * contains the name of the model to populate + * + * @api public + * @property refPath + * @memberOf VirtualOptions + * @type String|Function + * @instance + */ + +Object.defineProperty(VirtualOptions.prototype, 'refPath', opts); + +/** + * The name of the property in the local model to match to `foreignField` + * in the foreign model. + * + * @api public + * @property localField + * @memberOf VirtualOptions + * @type String|Function + * @instance + */ + +Object.defineProperty(VirtualOptions.prototype, 'localField', opts); + +/** + * The name of the property in the foreign model to match to `localField` + * in the local model. + * + * @api public + * @property foreignField + * @memberOf VirtualOptions + * @type String|Function + * @instance + */ + +Object.defineProperty(VirtualOptions.prototype, 'foreignField', opts); + +/** + * Whether to populate this virtual as a single document (true) or an + * array of documents (false). + * + * @api public + * @property justOne + * @memberOf VirtualOptions + * @type Boolean + * @instance + */ + +Object.defineProperty(VirtualOptions.prototype, 'justOne', opts); + +/** + * If true, populate just the number of documents where `localField` + * matches `foreignField`, as opposed to the documents themselves. + * + * If `count` is set, it overrides `justOne`. + * + * @api public + * @property count + * @memberOf VirtualOptions + * @type Boolean + * @instance + */ + +Object.defineProperty(VirtualOptions.prototype, 'count', opts); + +/** + * Add an additional filter to populate, in addition to `localField` + * matches `foreignField`. + * + * @api public + * @property match + * @memberOf VirtualOptions + * @type Object|Function + * @instance + */ + +Object.defineProperty(VirtualOptions.prototype, 'match', opts); + +/** + * Additional options to pass to the query used to `populate()`: + * + * - `sort` + * - `skip` + * - `limit` + * + * @api public + * @property options + * @memberOf VirtualOptions + * @type Object + * @instance + */ + +Object.defineProperty(VirtualOptions.prototype, 'options', opts); + +/** + * If true, add a `skip` to the query used to `populate()`. + * + * @api public + * @property skip + * @memberOf VirtualOptions + * @type Number + * @instance + */ + +Object.defineProperty(VirtualOptions.prototype, 'skip', opts); + +/** + * If true, add a `limit` to the query used to `populate()`. + * + * @api public + * @property limit + * @memberOf VirtualOptions + * @type Number + * @instance + */ + +Object.defineProperty(VirtualOptions.prototype, 'limit', opts); + +/** + * The `limit` option for `populate()` has [some unfortunate edge cases](/docs/populate.html#query-conditions) + * when working with multiple documents, like `.find().populate()`. The + * `perDocumentLimit` option makes `populate()` execute a separate query + * for each document returned from `find()` to ensure each document + * gets up to `perDocumentLimit` populated docs if possible. + * + * @api public + * @property perDocumentLimit + * @memberOf VirtualOptions + * @type Number + * @instance + */ + +Object.defineProperty(VirtualOptions.prototype, 'perDocumentLimit', opts); + +module.exports = VirtualOptions; \ No newline at end of file diff --git a/node_modules/mongoose/lib/options/propertyOptions.js b/node_modules/mongoose/lib/options/propertyOptions.js new file mode 100644 index 000000000..b7488a37e --- /dev/null +++ b/node_modules/mongoose/lib/options/propertyOptions.js @@ -0,0 +1,8 @@ +'use strict'; + +module.exports = Object.freeze({ + enumerable: true, + configurable: true, + writable: true, + value: void 0 +}); \ No newline at end of file diff --git a/node_modules/mongoose/lib/options/removeOptions.js b/node_modules/mongoose/lib/options/removeOptions.js new file mode 100644 index 000000000..0d9158645 --- /dev/null +++ b/node_modules/mongoose/lib/options/removeOptions.js @@ -0,0 +1,14 @@ +'use strict'; + +const clone = require('../helpers/clone'); + +class RemoveOptions { + constructor(obj) { + if (obj == null) { + return; + } + Object.assign(this, clone(obj)); + } +} + +module.exports = RemoveOptions; \ No newline at end of file diff --git a/node_modules/mongoose/lib/options/saveOptions.js b/node_modules/mongoose/lib/options/saveOptions.js new file mode 100644 index 000000000..22ef4375f --- /dev/null +++ b/node_modules/mongoose/lib/options/saveOptions.js @@ -0,0 +1,14 @@ +'use strict'; + +const clone = require('../helpers/clone'); + +class SaveOptions { + constructor(obj) { + if (obj == null) { + return; + } + Object.assign(this, clone(obj)); + } +} + +module.exports = SaveOptions; \ No newline at end of file diff --git a/node_modules/mongoose/lib/plugins/clearValidating.js b/node_modules/mongoose/lib/plugins/clearValidating.js new file mode 100644 index 000000000..cdd5f3f09 --- /dev/null +++ b/node_modules/mongoose/lib/plugins/clearValidating.js @@ -0,0 +1,28 @@ +'use strict'; + +/*! + * ignore + */ + +module.exports = function(schema) { + // `this.$__.validating` tracks whether there are multiple validations running + // in parallel. We need to clear `this.$__.validating` before post hooks for gh-8597 + const unshift = true; + schema.s.hooks.post('validate', false, function() { + if (this.$isSubdocument) { + return; + } + + this.$__.validating = null; + }, unshift); + + schema.s.hooks.post('validate', false, function(error, res, next) { + if (this.$isSubdocument) { + next(); + return; + } + + this.$__.validating = null; + next(); + }, unshift); +}; diff --git a/node_modules/mongoose/lib/plugins/removeSubdocs.js b/node_modules/mongoose/lib/plugins/removeSubdocs.js new file mode 100644 index 000000000..dde46d8f1 --- /dev/null +++ b/node_modules/mongoose/lib/plugins/removeSubdocs.js @@ -0,0 +1,31 @@ +'use strict'; + +const each = require('../helpers/each'); + +/*! + * ignore + */ + +module.exports = function(schema) { + const unshift = true; + schema.s.hooks.pre('remove', false, function(next) { + if (this.$isSubdocument) { + next(); + return; + } + + const _this = this; + const subdocs = this.$getAllSubdocs(); + + each(subdocs, function(subdoc, cb) { + subdoc.$__remove(cb); + }, function(error) { + if (error) { + return _this.$__schema.s.hooks.execPost('remove:error', _this, [_this], { error: error }, function(error) { + next(error); + }); + } + next(); + }); + }, null, unshift); +}; diff --git a/node_modules/mongoose/lib/plugins/saveSubdocs.js b/node_modules/mongoose/lib/plugins/saveSubdocs.js new file mode 100644 index 000000000..66ecba763 --- /dev/null +++ b/node_modules/mongoose/lib/plugins/saveSubdocs.js @@ -0,0 +1,66 @@ +'use strict'; + +const each = require('../helpers/each'); + +/*! + * ignore + */ + +module.exports = function(schema) { + const unshift = true; + schema.s.hooks.pre('save', false, function(next) { + if (this.$isSubdocument) { + next(); + return; + } + + const _this = this; + const subdocs = this.$getAllSubdocs(); + + if (!subdocs.length) { + next(); + return; + } + + each(subdocs, function(subdoc, cb) { + subdoc.$__schema.s.hooks.execPre('save', subdoc, function(err) { + cb(err); + }); + }, function(error) { + if (error) { + return _this.$__schema.s.hooks.execPost('save:error', _this, [_this], { error: error }, function(error) { + next(error); + }); + } + next(); + }); + }, null, unshift); + + schema.s.hooks.post('save', function(doc, next) { + if (this.$isSubdocument) { + next(); + return; + } + + const _this = this; + const subdocs = this.$getAllSubdocs(); + + if (!subdocs.length) { + next(); + return; + } + + each(subdocs, function(subdoc, cb) { + subdoc.$__schema.s.hooks.execPost('save', subdoc, [subdoc], function(err) { + cb(err); + }); + }, function(error) { + if (error) { + return _this.$__schema.s.hooks.execPost('save:error', _this, [_this], { error: error }, function(error) { + next(error); + }); + } + next(); + }); + }, null, unshift); +}; diff --git a/node_modules/mongoose/lib/plugins/sharding.js b/node_modules/mongoose/lib/plugins/sharding.js new file mode 100644 index 000000000..020ec06c6 --- /dev/null +++ b/node_modules/mongoose/lib/plugins/sharding.js @@ -0,0 +1,83 @@ +'use strict'; + +const objectIdSymbol = require('../helpers/symbols').objectIdSymbol; +const utils = require('../utils'); + +/*! + * ignore + */ + +module.exports = function shardingPlugin(schema) { + schema.post('init', function() { + storeShard.call(this); + return this; + }); + schema.pre('save', function(next) { + applyWhere.call(this); + next(); + }); + schema.pre('remove', function(next) { + applyWhere.call(this); + next(); + }); + schema.post('save', function() { + storeShard.call(this); + }); +}; + +/*! + * ignore + */ + +function applyWhere() { + let paths; + let len; + + if (this.$__.shardval) { + paths = Object.keys(this.$__.shardval); + len = paths.length; + + this.$where = this.$where || {}; + for (let i = 0; i < len; ++i) { + this.$where[paths[i]] = this.$__.shardval[paths[i]]; + } + } +} + +/*! + * ignore + */ + +module.exports.storeShard = storeShard; + +/*! + * ignore + */ + +function storeShard() { + // backwards compat + const key = this.$__schema.options.shardKey || this.$__schema.options.shardkey; + if (!utils.isPOJO(key)) { + return; + } + + const orig = this.$__.shardval = {}; + const paths = Object.keys(key); + const len = paths.length; + let val; + + for (let i = 0; i < len; ++i) { + val = this.$__getValue(paths[i]); + if (val == null) { + orig[paths[i]] = val; + } else if (utils.isMongooseObject(val)) { + orig[paths[i]] = val.toObject({ depopulate: true, _isNested: true }); + } else if (val instanceof Date || val[objectIdSymbol]) { + orig[paths[i]] = val; + } else if (typeof val.valueOf === 'function') { + orig[paths[i]] = val.valueOf(); + } else { + orig[paths[i]] = val; + } + } +} diff --git a/node_modules/mongoose/lib/plugins/trackTransaction.js b/node_modules/mongoose/lib/plugins/trackTransaction.js new file mode 100644 index 000000000..11444d16d --- /dev/null +++ b/node_modules/mongoose/lib/plugins/trackTransaction.js @@ -0,0 +1,92 @@ +'use strict'; + +const arrayAtomicsSymbol = require('../helpers/symbols').arrayAtomicsSymbol; +const sessionNewDocuments = require('../helpers/symbols').sessionNewDocuments; +const utils = require('../utils'); + +module.exports = function trackTransaction(schema) { + schema.pre('save', function() { + const session = this.$session(); + if (session == null) { + return; + } + if (session.transaction == null || session[sessionNewDocuments] == null) { + return; + } + + if (!session[sessionNewDocuments].has(this)) { + const initialState = {}; + if (this.isNew) { + initialState.isNew = true; + } + if (this.$__schema.options.versionKey) { + initialState.versionKey = this.get(this.$__schema.options.versionKey); + } + + initialState.modifiedPaths = new Set(Object.keys(this.$__.activePaths.states.modify)); + initialState.atomics = _getAtomics(this); + + session[sessionNewDocuments].set(this, initialState); + } else { + const state = session[sessionNewDocuments].get(this); + + for (const path of Object.keys(this.$__.activePaths.states.modify)) { + state.modifiedPaths.add(path); + } + state.atomics = _getAtomics(this, state.atomics); + } + }); +}; + +function _getAtomics(doc, previous) { + const pathToAtomics = new Map(); + previous = previous || new Map(); + + const pathsToCheck = Object.keys(doc.$__.activePaths.init).concat(Object.keys(doc.$__.activePaths.modify)); + + for (const path of pathsToCheck) { + const val = doc.$__getValue(path); + if (val != null && + Array.isArray(val) && + utils.isMongooseDocumentArray(val) && + val.length && + val[arrayAtomicsSymbol] != null && + Object.keys(val[arrayAtomicsSymbol]).length !== 0) { + const existing = previous.get(path) || {}; + pathToAtomics.set(path, mergeAtomics(existing, val[arrayAtomicsSymbol])); + } + } + + const dirty = doc.$__dirty(); + for (const dirt of dirty) { + const path = dirt.path; + + const val = dirt.value; + if (val != null && val[arrayAtomicsSymbol] != null && Object.keys(val[arrayAtomicsSymbol]).length !== 0) { + const existing = previous.get(path) || {}; + pathToAtomics.set(path, mergeAtomics(existing, val[arrayAtomicsSymbol])); + } + } + + return pathToAtomics; +} + +function mergeAtomics(destination, source) { + destination = destination || {}; + + if (source.$pullAll != null) { + destination.$pullAll = (destination.$pullAll || []).concat(source.$pullAll); + } + if (source.$push != null) { + destination.$push = destination.$push || {}; + destination.$push.$each = (destination.$push.$each || []).concat(source.$push.$each); + } + if (source.$addToSet != null) { + destination.$addToSet = (destination.$addToSet || []).concat(source.$addToSet); + } + if (source.$set != null) { + destination.$set = Object.assign(destination.$set || {}, source.$set); + } + + return destination; +} \ No newline at end of file diff --git a/node_modules/mongoose/lib/plugins/validateBeforeSave.js b/node_modules/mongoose/lib/plugins/validateBeforeSave.js new file mode 100644 index 000000000..fd058a552 --- /dev/null +++ b/node_modules/mongoose/lib/plugins/validateBeforeSave.js @@ -0,0 +1,45 @@ +'use strict'; + +/*! + * ignore + */ + +module.exports = function(schema) { + const unshift = true; + schema.pre('save', false, function validateBeforeSave(next, options) { + const _this = this; + // Nested docs have their own presave + if (this.$isSubdocument) { + return next(); + } + + const hasValidateBeforeSaveOption = options && + (typeof options === 'object') && + ('validateBeforeSave' in options); + + let shouldValidate; + if (hasValidateBeforeSaveOption) { + shouldValidate = !!options.validateBeforeSave; + } else { + shouldValidate = this.$__schema.options.validateBeforeSave; + } + + // Validate + if (shouldValidate) { + const hasValidateModifiedOnlyOption = options && + (typeof options === 'object') && + ('validateModifiedOnly' in options); + const validateOptions = hasValidateModifiedOnlyOption ? + { validateModifiedOnly: options.validateModifiedOnly } : + null; + this.$validate(validateOptions, function(error) { + return _this.$__schema.s.hooks.execPost('save:error', _this, [_this], { error: error }, function(error) { + _this.$op = 'save'; + next(error); + }); + }); + } else { + next(); + } + }, null, unshift); +}; diff --git a/node_modules/mongoose/lib/promise_provider.js b/node_modules/mongoose/lib/promise_provider.js new file mode 100644 index 000000000..3febf3687 --- /dev/null +++ b/node_modules/mongoose/lib/promise_provider.js @@ -0,0 +1,49 @@ +/*! + * ignore + */ + +'use strict'; + +const assert = require('assert'); +const mquery = require('mquery'); + +/** + * Helper for multiplexing promise implementations + * + * @api private + */ + +const store = { + _promise: null +}; + +/** + * Get the current promise constructor + * + * @api private + */ + +store.get = function() { + return store._promise; +}; + +/** + * Set the current promise constructor + * + * @api private + */ + +store.set = function(lib) { + assert.ok(typeof lib === 'function', + `mongoose.Promise must be a function, got ${lib}`); + store._promise = lib; + mquery.Promise = lib; +}; + +/*! + * Use native promises by default + */ + +store.set(global.Promise); + +module.exports = store; diff --git a/node_modules/mongoose/lib/query.js b/node_modules/mongoose/lib/query.js new file mode 100644 index 000000000..291c17fb7 --- /dev/null +++ b/node_modules/mongoose/lib/query.js @@ -0,0 +1,5822 @@ +'use strict'; + +/*! + * Module dependencies. + */ + +const CastError = require('./error/cast'); +const DocumentNotFoundError = require('./error/notFound'); +const Kareem = require('kareem'); +const MongooseError = require('./error/mongooseError'); +const ObjectParameterError = require('./error/objectParameter'); +const QueryCursor = require('./cursor/QueryCursor'); +const ReadPreference = require('./driver').get().ReadPreference; +const ValidationError = require('./error/validation'); +const { applyGlobalMaxTimeMS, applyGlobalDiskUse } = require('./helpers/query/applyGlobalOption'); +const applyWriteConcern = require('./helpers/schema/applyWriteConcern'); +const cast = require('./cast'); +const castArrayFilters = require('./helpers/update/castArrayFilters'); +const castNumber = require('./cast/number'); +const castUpdate = require('./helpers/query/castUpdate'); +const completeMany = require('./helpers/query/completeMany'); +const promiseOrCallback = require('./helpers/promiseOrCallback'); +const getDiscriminatorByValue = require('./helpers/discriminator/getDiscriminatorByValue'); +const hasDollarKeys = require('./helpers/query/hasDollarKeys'); +const helpers = require('./queryhelpers'); +const immediate = require('./helpers/immediate'); +const isExclusive = require('./helpers/projection/isExclusive'); +const isInclusive = require('./helpers/projection/isInclusive'); +const isSubpath = require('./helpers/projection/isSubpath'); +const mpath = require('mpath'); +const mquery = require('mquery'); +const parseProjection = require('./helpers/projection/parseProjection'); +const removeUnusedArrayFilters = require('./helpers/update/removeUnusedArrayFilters'); +const sanitizeFilter = require('./helpers/query/sanitizeFilter'); +const sanitizeProjection = require('./helpers/query/sanitizeProjection'); +const selectPopulatedFields = require('./helpers/query/selectPopulatedFields'); +const setDefaultsOnInsert = require('./helpers/setDefaultsOnInsert'); +const updateValidators = require('./helpers/updateValidators'); +const util = require('util'); +const utils = require('./utils'); +const validOps = require('./helpers/query/validOps'); +const wrapThunk = require('./helpers/query/wrapThunk'); + +const queryOptionMethods = new Set([ + 'allowDiskUse', + 'batchSize', + 'collation', + 'comment', + 'explain', + 'hint', + 'j', + 'lean', + 'limit', + 'maxScan', + 'maxTimeMS', + 'maxscan', + 'populate', + 'projection', + 'read', + 'select', + 'skip', + 'slice', + 'sort', + 'tailable', + 'w', + 'writeConcern', + 'wtimeout' +]); + +/** + * Query constructor used for building queries. You do not need + * to instantiate a `Query` directly. Instead use Model functions like + * [`Model.find()`](/docs/api.html#find_find). + * + * #### Example: + * + * const query = MyModel.find(); // `query` is an instance of `Query` + * query.setOptions({ lean : true }); + * query.collection(MyModel.collection); + * query.where('age').gte(21).exec(callback); + * + * // You can instantiate a query directly. There is no need to do + * // this unless you're an advanced user with a very good reason to. + * const query = new mongoose.Query(); + * + * @param {Object} [options] + * @param {Object} [model] + * @param {Object} [conditions] + * @param {Object} [collection] Mongoose collection + * @api public + */ + +function Query(conditions, options, model, collection) { + // this stuff is for dealing with custom queries created by #toConstructor + if (!this._mongooseOptions) { + this._mongooseOptions = {}; + } + options = options || {}; + + this._transforms = []; + this._hooks = new Kareem(); + this._executionStack = null; + + // this is the case where we have a CustomQuery, we need to check if we got + // options passed in, and if we did, merge them in + const keys = Object.keys(options); + for (const key of keys) { + this._mongooseOptions[key] = options[key]; + } + + if (collection) { + this.mongooseCollection = collection; + } + + if (model) { + this.model = model; + this.schema = model.schema; + } + + + // this is needed because map reduce returns a model that can be queried, but + // all of the queries on said model should be lean + if (this.model && this.model._mapreduce) { + this.lean(); + } + + // inherit mquery + mquery.call(this, null, options); + if (collection) { + this.collection(collection); + } + + if (conditions) { + this.find(conditions); + } + + this.options = this.options || {}; + + // For gh-6880. mquery still needs to support `fields` by default for old + // versions of MongoDB + this.$useProjection = true; + + const collation = this && + this.schema && + this.schema.options && + this.schema.options.collation || null; + if (collation != null) { + this.options.collation = collation; + } +} + +/*! + * inherit mquery + */ + +Query.prototype = new mquery(); +Query.prototype.constructor = Query; +Query.base = mquery.prototype; + +/** + * Flag to opt out of using `$geoWithin`. + * + * ```javascript + * mongoose.Query.use$geoWithin = false; + * ``` + * + * MongoDB 2.4 deprecated the use of `$within`, replacing it with `$geoWithin`. Mongoose uses `$geoWithin` by default (which is 100% backward compatible with `$within`). If you are running an older version of MongoDB, set this flag to `false` so your `within()` queries continue to work. + * + * @see https://docs.mongodb.org/manual/reference/operator/geoWithin/ + * @default true + * @property use$geoWithin + * @memberOf Query + * @receiver Query + * @api public + */ + +Query.use$geoWithin = mquery.use$geoWithin; + +/** + * Converts this query to a customized, reusable query constructor with all arguments and options retained. + * + * #### Example + * + * // Create a query for adventure movies and read from the primary + * // node in the replica-set unless it is down, in which case we'll + * // read from a secondary node. + * const query = Movie.find({ tags: 'adventure' }).read('primaryPreferred'); + * + * // create a custom Query constructor based off these settings + * const Adventure = query.toConstructor(); + * + * // Adventure is now a subclass of mongoose.Query and works the same way but with the + * // default query parameters and options set. + * Adventure().exec(callback) + * + * // further narrow down our query results while still using the previous settings + * Adventure().where({ name: /^Life/ }).exec(callback); + * + * // since Adventure is a stand-alone constructor we can also add our own + * // helper methods and getters without impacting global queries + * Adventure.prototype.startsWith = function (prefix) { + * this.where({ name: new RegExp('^' + prefix) }) + * return this; + * } + * Object.defineProperty(Adventure.prototype, 'highlyRated', { + * get: function () { + * this.where({ rating: { $gt: 4.5 }}); + * return this; + * } + * }) + * Adventure().highlyRated.startsWith('Life').exec(callback) + * + * @return {Query} subclass-of-Query + * @api public + */ + +Query.prototype.toConstructor = function toConstructor() { + const model = this.model; + const coll = this.mongooseCollection; + + const CustomQuery = function(criteria, options) { + if (!(this instanceof CustomQuery)) { + return new CustomQuery(criteria, options); + } + this._mongooseOptions = utils.clone(p._mongooseOptions); + Query.call(this, criteria, options || null, model, coll); + }; + + util.inherits(CustomQuery, model.Query); + + // set inherited defaults + const p = CustomQuery.prototype; + + p.options = {}; + + // Need to handle `sort()` separately because entries-style `sort()` syntax + // `sort([['prop1', 1]])` confuses mquery into losing the outer nested array. + // See gh-8159 + const options = Object.assign({}, this.options); + if (options.sort != null) { + p.sort(options.sort); + delete options.sort; + } + p.setOptions(options); + + p.op = this.op; + p._validateOp(); + p._conditions = utils.clone(this._conditions); + p._fields = utils.clone(this._fields); + p._update = utils.clone(this._update, { + flattenDecimals: false + }); + p._path = this._path; + p._distinct = this._distinct; + p._collection = this._collection; + p._mongooseOptions = this._mongooseOptions; + + return CustomQuery; +}; + +/** + * Make a copy of this query so you can re-execute it. + * + * #### Example: + * const q = Book.findOne({ title: 'Casino Royale' }); + * await q.exec(); + * await q.exec(); // Throws an error because you can't execute a query twice + * + * await q.clone().exec(); // Works + * + * @method clone + * @return {Query} copy + * @memberOf Query + * @instance + * @api public + */ + +Query.prototype.clone = function clone() { + const model = this.model; + const collection = this.mongooseCollection; + + const q = new this.constructor({}, {}, model, collection); + + // Need to handle `sort()` separately because entries-style `sort()` syntax + // `sort([['prop1', 1]])` confuses mquery into losing the outer nested array. + // See gh-8159 + const options = Object.assign({}, this.options); + if (options.sort != null) { + q.sort(options.sort); + delete options.sort; + } + q.setOptions(options); + + q.op = this.op; + q._validateOp(); + q._conditions = utils.clone(this._conditions); + q._fields = utils.clone(this._fields); + q._update = utils.clone(this._update, { + flattenDecimals: false + }); + q._path = this._path; + q._distinct = this._distinct; + q._collection = this._collection; + q._mongooseOptions = this._mongooseOptions; + + return q; +}; + +/** + * Specifies a javascript function or expression to pass to MongoDBs query system. + * + * #### Example + * + * query.$where('this.comments.length === 10 || this.name.length === 5') + * + * // or + * + * query.$where(function () { + * return this.comments.length === 10 || this.name.length === 5; + * }) + * + * #### Note: + * + * Only use `$where` when you have a condition that cannot be met using other MongoDB operators like `$lt`. + * **Be sure to read about all of [its caveats](https://docs.mongodb.org/manual/reference/operator/where/) before using.** + * + * @see $where https://docs.mongodb.org/manual/reference/operator/where/ + * @method $where + * @param {String|Function} js javascript string or function + * @return {Query} this + * @memberOf Query + * @instance + * @method $where + * @api public + */ + +/** + * Specifies a `path` for use with chaining. + * + * #### Example + * + * // instead of writing: + * User.find({age: {$gte: 21, $lte: 65}}, callback); + * + * // we can instead write: + * User.where('age').gte(21).lte(65); + * + * // passing query conditions is permitted + * User.find().where({ name: 'vonderful' }) + * + * // chaining + * User + * .where('age').gte(21).lte(65) + * .where('name', /^vonderful/i) + * .where('friends').slice(10) + * .exec(callback) + * + * @method where + * @memberOf Query + * @instance + * @param {String|Object} [path] + * @param {any} [val] + * @return {Query} this + * @api public + */ + +/** + * Specifies a `$slice` projection for an array. + * + * #### Example + * + * query.slice('comments', 5); + * query.slice('comments', -5); + * query.slice('comments', [10, 5]); + * query.where('comments').slice(5); + * query.where('comments').slice([-10, 5]); + * + * @method slice + * @memberOf Query + * @instance + * @param {String} [path] + * @param {Number} val number/range of elements to slice + * @return {Query} this + * @see mongodb https://www.mongodb.org/display/DOCS/Retrieving+a+Subset+of+Fields#RetrievingaSubsetofFields-RetrievingaSubrangeofArrayElements + * @see $slice https://docs.mongodb.org/manual/reference/projection/slice/#prj._S_slice + * @api public + */ + +Query.prototype.slice = function() { + if (arguments.length === 0) { + return this; + } + + this._validate('slice'); + + let path; + let val; + + if (arguments.length === 1) { + const arg = arguments[0]; + if (typeof arg === 'object' && !Array.isArray(arg)) { + const keys = Object.keys(arg); + const numKeys = keys.length; + for (let i = 0; i < numKeys; ++i) { + this.slice(keys[i], arg[keys[i]]); + } + return this; + } + this._ensurePath('slice'); + path = this._path; + val = arguments[0]; + } else if (arguments.length === 2) { + if ('number' === typeof arguments[0]) { + this._ensurePath('slice'); + path = this._path; + val = [arguments[0], arguments[1]]; + } else { + path = arguments[0]; + val = arguments[1]; + } + } else if (arguments.length === 3) { + path = arguments[0]; + val = [arguments[1], arguments[2]]; + } + + const p = {}; + p[path] = { $slice: val }; + this.select(p); + + return this; +}; + +/*! + * ignore + */ + +const validOpsSet = new Set(validOps); + +Query.prototype._validateOp = function() { + if (this.op != null && !validOpsSet.has(this.op)) { + this.error(new Error('Query has invalid `op`: "' + this.op + '"')); + } +}; + +/** + * Specifies the complementary comparison value for paths specified with `where()` + * + * #### Example + * + * User.where('age').equals(49); + * + * // is the same as + * + * User.where('age', 49); + * + * @method equals + * @memberOf Query + * @instance + * @param {Object} val + * @return {Query} this + * @api public + */ + +/** + * Specifies arguments for an `$or` condition. + * + * #### Example + * + * query.or([{ color: 'red' }, { status: 'emergency' }]); + * + * @see $or https://docs.mongodb.org/manual/reference/operator/or/ + * @method or + * @memberOf Query + * @instance + * @param {Array} array array of conditions + * @return {Query} this + * @api public + */ + +/** + * Specifies arguments for a `$nor` condition. + * + * #### Example + * + * query.nor([{ color: 'green' }, { status: 'ok' }]); + * + * @see $nor https://docs.mongodb.org/manual/reference/operator/nor/ + * @method nor + * @memberOf Query + * @instance + * @param {Array} array array of conditions + * @return {Query} this + * @api public + */ + +/** + * Specifies arguments for a `$and` condition. + * + * #### Example + * + * query.and([{ color: 'green' }, { status: 'ok' }]) + * + * @method and + * @memberOf Query + * @instance + * @see $and https://docs.mongodb.org/manual/reference/operator/and/ + * @param {Array} array array of conditions + * @return {Query} this + * @api public + */ + +/** + * Specifies a `$gt` query condition. + * + * When called with one argument, the most recent path passed to `where()` is used. + * + * #### Example + * + * Thing.find().where('age').gt(21); + * + * // or + * Thing.find().gt('age', 21); + * + * @method gt + * @memberOf Query + * @instance + * @param {String} [path] + * @param {Number} val + * @see $gt https://docs.mongodb.org/manual/reference/operator/gt/ + * @api public + */ + +/** + * Specifies a `$gte` query condition. + * + * When called with one argument, the most recent path passed to `where()` is used. + * + * @method gte + * @memberOf Query + * @instance + * @param {String} [path] + * @param {Number} val + * @see $gte https://docs.mongodb.org/manual/reference/operator/gte/ + * @api public + */ + +/** + * Specifies a `$lt` query condition. + * + * When called with one argument, the most recent path passed to `where()` is used. + * + * @method lt + * @memberOf Query + * @instance + * @param {String} [path] + * @param {Number} val + * @see $lt https://docs.mongodb.org/manual/reference/operator/lt/ + * @api public + */ + +/** + * Specifies a `$lte` query condition. + * + * When called with one argument, the most recent path passed to `where()` is used. + * + * @method lte + * @see $lte https://docs.mongodb.org/manual/reference/operator/lte/ + * @memberOf Query + * @instance + * @param {String} [path] + * @param {Number} val + * @api public + */ + +/** + * Specifies a `$ne` query condition. + * + * When called with one argument, the most recent path passed to `where()` is used. + * + * @see $ne https://docs.mongodb.org/manual/reference/operator/ne/ + * @method ne + * @memberOf Query + * @instance + * @param {String} [path] + * @param {any} val + * @api public + */ + +/** + * Specifies an `$in` query condition. + * + * When called with one argument, the most recent path passed to `where()` is used. + * + * @see $in https://docs.mongodb.org/manual/reference/operator/in/ + * @method in + * @memberOf Query + * @instance + * @param {String} [path] + * @param {Array} val + * @api public + */ + +/** + * Specifies an `$nin` query condition. + * + * When called with one argument, the most recent path passed to `where()` is used. + * + * @see $nin https://docs.mongodb.org/manual/reference/operator/nin/ + * @method nin + * @memberOf Query + * @instance + * @param {String} [path] + * @param {Array} val + * @api public + */ + +/** + * Specifies an `$all` query condition. + * + * When called with one argument, the most recent path passed to `where()` is used. + * + * #### Example: + * + * MyModel.find().where('pets').all(['dog', 'cat', 'ferret']); + * // Equivalent: + * MyModel.find().all('pets', ['dog', 'cat', 'ferret']); + * + * @see $all https://docs.mongodb.org/manual/reference/operator/all/ + * @method all + * @memberOf Query + * @instance + * @param {String} [path] + * @param {Array} val + * @api public + */ + +/** + * Specifies a `$size` query condition. + * + * When called with one argument, the most recent path passed to `where()` is used. + * + * #### Example + * + * const docs = await MyModel.where('tags').size(0).exec(); + * assert(Array.isArray(docs)); + * console.log('documents with 0 tags', docs); + * + * @see $size https://docs.mongodb.org/manual/reference/operator/size/ + * @method size + * @memberOf Query + * @instance + * @param {String} [path] + * @param {Number} val + * @api public + */ + +/** + * Specifies a `$regex` query condition. + * + * When called with one argument, the most recent path passed to `where()` is used. + * + * @see $regex https://docs.mongodb.org/manual/reference/operator/regex/ + * @method regex + * @memberOf Query + * @instance + * @param {String} [path] + * @param {String|RegExp} val + * @api public + */ + +/** + * Specifies a `maxDistance` query condition. + * + * When called with one argument, the most recent path passed to `where()` is used. + * + * @see $maxDistance https://docs.mongodb.org/manual/reference/operator/maxDistance/ + * @method maxDistance + * @memberOf Query + * @instance + * @param {String} [path] + * @param {Number} val + * @api public + */ + +/** + * Specifies a `$mod` condition, filters documents for documents whose + * `path` property is a number that is equal to `remainder` modulo `divisor`. + * + * #### Example + * + * // All find products whose inventory is odd + * Product.find().mod('inventory', [2, 1]); + * Product.find().where('inventory').mod([2, 1]); + * // This syntax is a little strange, but supported. + * Product.find().where('inventory').mod(2, 1); + * + * @method mod + * @memberOf Query + * @instance + * @param {String} [path] + * @param {Array} val must be of length 2, first element is `divisor`, 2nd element is `remainder`. + * @return {Query} this + * @see $mod https://docs.mongodb.org/manual/reference/operator/mod/ + * @api public + */ + +Query.prototype.mod = function() { + let val; + let path; + + if (arguments.length === 1) { + this._ensurePath('mod'); + val = arguments[0]; + path = this._path; + } else if (arguments.length === 2 && !Array.isArray(arguments[1])) { + this._ensurePath('mod'); + val = [arguments[0], arguments[1]]; + path = this._path; + } else if (arguments.length === 3) { + val = [arguments[1], arguments[2]]; + path = arguments[0]; + } else { + val = arguments[1]; + path = arguments[0]; + } + + const conds = this._conditions[path] || (this._conditions[path] = {}); + conds.$mod = val; + return this; +}; + +/** + * Specifies an `$exists` condition + * + * #### Example + * + * // { name: { $exists: true }} + * Thing.where('name').exists() + * Thing.where('name').exists(true) + * Thing.find().exists('name') + * + * // { name: { $exists: false }} + * Thing.where('name').exists(false); + * Thing.find().exists('name', false); + * + * @method exists + * @memberOf Query + * @instance + * @param {String} [path] + * @param {Boolean} val + * @return {Query} this + * @see $exists https://docs.mongodb.org/manual/reference/operator/exists/ + * @api public + */ + +/** + * Specifies an `$elemMatch` condition + * + * #### Example + * + * query.elemMatch('comment', { author: 'autobot', votes: {$gte: 5}}) + * + * query.where('comment').elemMatch({ author: 'autobot', votes: {$gte: 5}}) + * + * query.elemMatch('comment', function (elem) { + * elem.where('author').equals('autobot'); + * elem.where('votes').gte(5); + * }) + * + * query.where('comment').elemMatch(function (elem) { + * elem.where({ author: 'autobot' }); + * elem.where('votes').gte(5); + * }) + * + * @method elemMatch + * @memberOf Query + * @instance + * @param {String|Object|Function} path + * @param {Object|Function} filter + * @return {Query} this + * @see $elemMatch https://docs.mongodb.org/manual/reference/operator/elemMatch/ + * @api public + */ + +/** + * Defines a `$within` or `$geoWithin` argument for geo-spatial queries. + * + * #### Example + * + * query.where(path).within().box() + * query.where(path).within().circle() + * query.where(path).within().geometry() + * + * query.where('loc').within({ center: [50,50], radius: 10, unique: true, spherical: true }); + * query.where('loc').within({ box: [[40.73, -73.9], [40.7, -73.988]] }); + * query.where('loc').within({ polygon: [[],[],[],[]] }); + * + * query.where('loc').within([], [], []) // polygon + * query.where('loc').within([], []) // box + * query.where('loc').within({ type: 'LineString', coordinates: [...] }); // geometry + * + * **MUST** be used after `where()`. + * + * #### Note: + * + * As of Mongoose 3.7, `$geoWithin` is always used for queries. To change this behavior, see [Query.use$geoWithin](#query_Query-use%2524geoWithin). + * + * #### Note: + * + * In Mongoose 3.7, `within` changed from a getter to a function. If you need the old syntax, use [this](https://github.com/ebensing/mongoose-within). + * + * @method within + * @see $polygon https://docs.mongodb.org/manual/reference/operator/polygon/ + * @see $box https://docs.mongodb.org/manual/reference/operator/box/ + * @see $geometry https://docs.mongodb.org/manual/reference/operator/geometry/ + * @see $center https://docs.mongodb.org/manual/reference/operator/center/ + * @see $centerSphere https://docs.mongodb.org/manual/reference/operator/centerSphere/ + * @memberOf Query + * @instance + * @return {Query} this + * @api public + */ + +/** + * Specifies the maximum number of documents the query will return. + * + * #### Example + * + * query.limit(20); + * + * #### Note + * + * Cannot be used with `distinct()` + * + * @method limit + * @memberOf Query + * @instance + * @param {Number} val + * @api public + */ + +Query.prototype.limit = function limit(v) { + this._validate('limit'); + + if (typeof v === 'string') { + try { + v = castNumber(v); + } catch (err) { + throw new CastError('Number', v, 'limit'); + } + } + + this.options.limit = v; + return this; +}; + +/** + * Specifies the number of documents to skip. + * + * #### Example + * + * query.skip(100).limit(20); + * + * #### Note + * + * Cannot be used with `distinct()` + * + * @method skip + * @memberOf Query + * @instance + * @param {Number} val + * @see cursor.skip https://docs.mongodb.org/manual/reference/method/cursor.skip/ + * @api public + */ + +Query.prototype.skip = function skip(v) { + this._validate('skip'); + + if (typeof v === 'string') { + try { + v = castNumber(v); + } catch (err) { + throw new CastError('Number', v, 'skip'); + } + } + + this.options.skip = v; + return this; +}; + +/** + * Specifies the maxScan option. + * + * #### Example + * + * query.maxScan(100); + * + * #### Note + * + * Cannot be used with `distinct()` + * + * @method maxScan + * @memberOf Query + * @instance + * @param {Number} val + * @see maxScan https://docs.mongodb.org/manual/reference/operator/maxScan/ + * @api public + */ + +/** + * Specifies the batchSize option. + * + * #### Example + * + * query.batchSize(100) + * + * #### Note + * + * Cannot be used with `distinct()` + * + * @method batchSize + * @memberOf Query + * @instance + * @param {Number} val + * @see batchSize https://docs.mongodb.org/manual/reference/method/cursor.batchSize/ + * @api public + */ + +/** + * Specifies the `comment` option. + * + * #### Example + * + * query.comment('login query') + * + * #### Note + * + * Cannot be used with `distinct()` + * + * @method comment + * @memberOf Query + * @instance + * @param {String} val + * @see comment https://docs.mongodb.org/manual/reference/operator/comment/ + * @api public + */ + +/** + * Specifies this query as a `snapshot` query. + * + * #### Example + * + * query.snapshot(); // true + * query.snapshot(true); + * query.snapshot(false); + * + * #### Note + * + * Cannot be used with `distinct()` + * + * @method snapshot + * @memberOf Query + * @instance + * @see snapshot https://docs.mongodb.org/manual/reference/operator/snapshot/ + * @return {Query} this + * @api public + */ + +/** + * Sets query hints. + * + * #### Example + * + * query.hint({ indexA: 1, indexB: -1 }); + * + * #### Note + * + * Cannot be used with `distinct()` + * + * @method hint + * @memberOf Query + * @instance + * @param {Object} val a hint object + * @return {Query} this + * @see $hint https://docs.mongodb.org/manual/reference/operator/hint/ + * @api public + */ + +/** + * Get/set the current projection (AKA fields). Pass `null` to remove the + * current projection. + * + * Unlike `projection()`, the `select()` function modifies the current + * projection in place. This function overwrites the existing projection. + * + * #### Example: + * + * const q = Model.find(); + * q.projection(); // null + * + * q.select('a b'); + * q.projection(); // { a: 1, b: 1 } + * + * q.projection({ c: 1 }); + * q.projection(); // { c: 1 } + * + * q.projection(null); + * q.projection(); // null + * + * + * @method projection + * @memberOf Query + * @instance + * @param {Object|null} arg + * @return {Object} the current projection + * @api public + */ + +Query.prototype.projection = function(arg) { + if (arguments.length === 0) { + return this._fields; + } + + this._fields = {}; + this._userProvidedFields = {}; + this.select(arg); + return this._fields; +}; + +/** + * Specifies which document fields to include or exclude (also known as the query "projection") + * + * When using string syntax, prefixing a path with `-` will flag that path as excluded. When a path does not have the `-` prefix, it is included. Lastly, if a path is prefixed with `+`, it forces inclusion of the path, which is useful for paths excluded at the [schema level](/docs/api.html#schematype_SchemaType-select). + * + * A projection _must_ be either inclusive or exclusive. In other words, you must + * either list the fields to include (which excludes all others), or list the fields + * to exclude (which implies all other fields are included). The [`_id` field is the only exception because MongoDB includes it by default](https://docs.mongodb.com/manual/tutorial/project-fields-from-query-results/#suppress-id-field). + * + * #### Example + * + * // include a and b, exclude other fields + * query.select('a b'); + * // Equivalent syntaxes: + * query.select(['a', 'b']); + * query.select({ a: 1, b: 1 }); + * + * // exclude c and d, include other fields + * query.select('-c -d'); + * + * // Use `+` to override schema-level `select: false` without making the + * // projection inclusive. + * const schema = new Schema({ + * foo: { type: String, select: false }, + * bar: String + * }); + * // ... + * query.select('+foo'); // Override foo's `select: false` without excluding `bar` + * + * // or you may use object notation, useful when + * // you have keys already prefixed with a "-" + * query.select({ a: 1, b: 1 }); + * query.select({ c: 0, d: 0 }); + * + * Additional calls to select can override the previous selection: + * query.select({ a: 1, b: 1 }).select({ b: 0 }); // selection is now { a: 1 } + * query.select({ a: 0, b: 0 }).select({ b: 1 }); // selection is now { a: 0 } + * + * + * @method select + * @memberOf Query + * @instance + * @param {Object|String|Array} arg + * @return {Query} this + * @see SchemaType + * @api public + */ + +Query.prototype.select = function select() { + let arg = arguments[0]; + if (!arg) return this; + + if (arguments.length !== 1) { + throw new Error('Invalid select: select only takes 1 argument'); + } + + this._validate('select'); + + const fields = this._fields || (this._fields = {}); + const userProvidedFields = this._userProvidedFields || (this._userProvidedFields = {}); + let sanitizeProjection = undefined; + if (this.model != null && utils.hasUserDefinedProperty(this.model.db.options, 'sanitizeProjection')) { + sanitizeProjection = this.model.db.options.sanitizeProjection; + } else if (this.model != null && utils.hasUserDefinedProperty(this.model.base.options, 'sanitizeProjection')) { + sanitizeProjection = this.model.base.options.sanitizeProjection; + } else { + sanitizeProjection = this._mongooseOptions.sanitizeProjection; + } + + function sanitizeValue(value) { + return typeof value === 'string' && sanitizeProjection ? value = 1 : value; + } + + arg = parseProjection(arg); + + if (utils.isObject(arg)) { + if (this.selectedInclusively()) { + Object.entries(arg).forEach(([key, value]) => { + if (value) { + // Add the field to the projection + fields[key] = userProvidedFields[key] = sanitizeValue(value); + } else { + // Remove the field from the projection + Object.keys(userProvidedFields).forEach(field => { + if (isSubpath(key, field)) { + delete fields[field]; + delete userProvidedFields[field]; + } + }); + } + }); + } else if (this.selectedExclusively()) { + Object.entries(arg).forEach(([key, value]) => { + if (!value) { + // Add the field to the projection + fields[key] = userProvidedFields[key] = sanitizeValue(value); + } else { + // Remove the field from the projection + Object.keys(userProvidedFields).forEach(field => { + if (isSubpath(key, field)) { + delete fields[field]; + delete userProvidedFields[field]; + } + }); + } + }); + } else { + const keys = Object.keys(arg); + for (let i = 0; i < keys.length; ++i) { + const value = arg[keys[i]]; + fields[keys[i]] = sanitizeValue(value); + userProvidedFields[keys[i]] = sanitizeValue(value); + } + } + return this; + } + + throw new TypeError('Invalid select() argument. Must be string or object.'); +}; + +/** + * Determines the MongoDB nodes from which to read. + * + * #### Preferences: + * + * ``` + * primary - (default) Read from primary only. Operations will produce an error if primary is unavailable. Cannot be combined with tags. + * secondary Read from secondary if available, otherwise error. + * primaryPreferred Read from primary if available, otherwise a secondary. + * secondaryPreferred Read from a secondary if available, otherwise read from the primary. + * nearest All operations read from among the nearest candidates, but unlike other modes, this option will include both the primary and all secondaries in the random selection. + * ``` + * + * Aliases + * + * ``` + * p primary + * pp primaryPreferred + * s secondary + * sp secondaryPreferred + * n nearest + * ``` + * + * #### Example: + * + * new Query().read('primary') + * new Query().read('p') // same as primary + * + * new Query().read('primaryPreferred') + * new Query().read('pp') // same as primaryPreferred + * + * new Query().read('secondary') + * new Query().read('s') // same as secondary + * + * new Query().read('secondaryPreferred') + * new Query().read('sp') // same as secondaryPreferred + * + * new Query().read('nearest') + * new Query().read('n') // same as nearest + * + * // read from secondaries with matching tags + * new Query().read('s', [{ dc:'sf', s: 1 },{ dc:'ma', s: 2 }]) + * + * Read more about how to use read preferences [here](https://docs.mongodb.org/manual/applications/replication/#read-preference) and [here](https://mongodb.github.com/node-mongodb-native/driver-articles/anintroductionto1_1and2_2.html#read-preferences). + * + * @method read + * @memberOf Query + * @instance + * @param {String} pref one of the listed preference options or aliases + * @param {Array} [tags] optional tags for this query + * @see mongodb https://docs.mongodb.org/manual/applications/replication/#read-preference + * @see driver https://mongodb.github.com/node-mongodb-native/driver-articles/anintroductionto1_1and2_2.html#read-preferences + * @return {Query} this + * @api public + */ + +Query.prototype.read = function read(pref, tags) { + // first cast into a ReadPreference object to support tags + const read = new ReadPreference(pref, tags); + this.options.readPreference = read; + return this; +}; + +/*! + * ignore + */ + +Query.prototype.toString = function toString() { + if (this.op === 'count' || + this.op === 'countDocuments' || + this.op === 'find' || + this.op === 'findOne' || + this.op === 'deleteMany' || + this.op === 'deleteOne' || + this.op === 'findOneAndDelete' || + this.op === 'findOneAndRemove' || + this.op === 'remove') { + return `${this.model.modelName}.${this.op}(${util.inspect(this._conditions)})`; + } + if (this.op === 'distinct') { + return `${this.model.modelName}.distinct('${this._distinct}', ${util.inspect(this._conditions)})`; + } + if (this.op === 'findOneAndReplace' || + this.op === 'findOneAndUpdate' || + this.op === 'replaceOne' || + this.op === 'update' || + this.op === 'updateMany' || + this.op === 'updateOne') { + return `${this.model.modelName}.${this.op}(${util.inspect(this._conditions)}, ${util.inspect(this._update)})`; + } + + // 'estimatedDocumentCount' or any others + return `${this.model.modelName}.${this.op}()`; +}; + +/** + * Sets the [MongoDB session](https://docs.mongodb.com/manual/reference/server-sessions/) + * associated with this query. Sessions are how you mark a query as part of a + * [transaction](/docs/transactions.html). + * + * Calling `session(null)` removes the session from this query. + * + * #### Example: + * + * const s = await mongoose.startSession(); + * await mongoose.model('Person').findOne({ name: 'Axl Rose' }).session(s); + * + * @method session + * @memberOf Query + * @instance + * @param {ClientSession} [session] from `await conn.startSession()` + * @see Connection.prototype.startSession() /docs/api.html#connection_Connection-startSession + * @see mongoose.startSession() /docs/api.html#mongoose_Mongoose-startSession + * @return {Query} this + * @api public + */ + +Query.prototype.session = function session(v) { + if (v == null) { + delete this.options.session; + } + this.options.session = v; + return this; +}; + +/** + * Sets the 3 write concern parameters for this query: + * + * - `w`: Sets the specified number of `mongod` servers, or tag set of `mongod` servers, that must acknowledge this write before this write is considered successful. + * - `j`: Boolean, set to `true` to request acknowledgement that this operation has been persisted to MongoDB's on-disk journal. + * - `wtimeout`: If [`w > 1`](/docs/api.html#query_Query-w), the maximum amount of time to wait for this write to propagate through the replica set before this operation fails. The default is `0`, which means no timeout. + * + * This option is only valid for operations that write to the database: + * + * - `deleteOne()` + * - `deleteMany()` + * - `findOneAndDelete()` + * - `findOneAndReplace()` + * - `findOneAndUpdate()` + * - `remove()` + * - `update()` + * - `updateOne()` + * - `updateMany()` + * + * Defaults to the schema's [`writeConcern` option](/docs/guide.html#writeConcern) + * + * #### Example: + * + * // The 'majority' option means the `deleteOne()` promise won't resolve + * // until the `deleteOne()` has propagated to the majority of the replica set + * await mongoose.model('Person'). + * deleteOne({ name: 'Ned Stark' }). + * writeConcern({ w: 'majority' }); + * + * @method writeConcern + * @memberOf Query + * @instance + * @param {Object} writeConcern the write concern value to set + * @see mongodb https://mongodb.github.io/node-mongodb-native/3.1/api/global.html#WriteConcern + * @return {Query} this + * @api public + */ + +Query.prototype.writeConcern = function writeConcern(val) { + if (val == null) { + delete this.options.writeConcern; + return this; + } + this.options.writeConcern = val; + return this; +}; + +/** + * Sets the specified number of `mongod` servers, or tag set of `mongod` servers, + * that must acknowledge this write before this write is considered successful. + * This option is only valid for operations that write to the database: + * + * - `deleteOne()` + * - `deleteMany()` + * - `findOneAndDelete()` + * - `findOneAndReplace()` + * - `findOneAndUpdate()` + * - `remove()` + * - `update()` + * - `updateOne()` + * - `updateMany()` + * + * Defaults to the schema's [`writeConcern.w` option](/docs/guide.html#writeConcern) + * + * #### Example: + * + * // The 'majority' option means the `deleteOne()` promise won't resolve + * // until the `deleteOne()` has propagated to the majority of the replica set + * await mongoose.model('Person'). + * deleteOne({ name: 'Ned Stark' }). + * w('majority'); + * + * @method w + * @memberOf Query + * @instance + * @param {String|number} val 0 for fire-and-forget, 1 for acknowledged by one server, 'majority' for majority of the replica set, or [any of the more advanced options](https://docs.mongodb.com/manual/reference/write-concern/#w-option). + * @see mongodb https://docs.mongodb.com/manual/reference/write-concern/#w-option + * @return {Query} this + * @api public + */ + +Query.prototype.w = function w(val) { + if (val == null) { + delete this.options.w; + } + if (this.options.writeConcern != null) { + this.options.writeConcern.w = val; + } else { + this.options.w = val; + } + return this; +}; + +/** + * Requests acknowledgement that this operation has been persisted to MongoDB's + * on-disk journal. + * This option is only valid for operations that write to the database: + * + * - `deleteOne()` + * - `deleteMany()` + * - `findOneAndDelete()` + * - `findOneAndReplace()` + * - `findOneAndUpdate()` + * - `remove()` + * - `update()` + * - `updateOne()` + * - `updateMany()` + * + * Defaults to the schema's [`writeConcern.j` option](/docs/guide.html#writeConcern) + * + * #### Example: + * + * await mongoose.model('Person').deleteOne({ name: 'Ned Stark' }).j(true); + * + * @method j + * @memberOf Query + * @instance + * @param {boolean} val + * @see mongodb https://docs.mongodb.com/manual/reference/write-concern/#j-option + * @return {Query} this + * @api public + */ + +Query.prototype.j = function j(val) { + if (val == null) { + delete this.options.j; + } + if (this.options.writeConcern != null) { + this.options.writeConcern.j = val; + } else { + this.options.j = val; + } + return this; +}; + +/** + * If [`w > 1`](/docs/api.html#query_Query-w), the maximum amount of time to + * wait for this write to propagate through the replica set before this + * operation fails. The default is `0`, which means no timeout. + * + * This option is only valid for operations that write to the database: + * + * - `deleteOne()` + * - `deleteMany()` + * - `findOneAndDelete()` + * - `findOneAndReplace()` + * - `findOneAndUpdate()` + * - `remove()` + * - `update()` + * - `updateOne()` + * - `updateMany()` + * + * Defaults to the schema's [`writeConcern.wtimeout` option](/docs/guide.html#writeConcern) + * + * #### Example: + * + * // The `deleteOne()` promise won't resolve until this `deleteOne()` has + * // propagated to at least `w = 2` members of the replica set. If it takes + * // longer than 1 second, this `deleteOne()` will fail. + * await mongoose.model('Person'). + * deleteOne({ name: 'Ned Stark' }). + * w(2). + * wtimeout(1000); + * + * @method wtimeout + * @memberOf Query + * @instance + * @param {number} ms number of milliseconds to wait + * @see mongodb https://docs.mongodb.com/manual/reference/write-concern/#wtimeout + * @return {Query} this + * @api public + */ + +Query.prototype.wtimeout = function wtimeout(ms) { + if (ms == null) { + delete this.options.wtimeout; + } + if (this.options.writeConcern != null) { + this.options.writeConcern.wtimeout = ms; + } else { + this.options.wtimeout = ms; + } + return this; +}; + +/** + * Sets the readConcern option for the query. + * + * #### Example: + * + * new Query().readConcern('local') + * new Query().readConcern('l') // same as local + * + * new Query().readConcern('available') + * new Query().readConcern('a') // same as available + * + * new Query().readConcern('majority') + * new Query().readConcern('m') // same as majority + * + * new Query().readConcern('linearizable') + * new Query().readConcern('lz') // same as linearizable + * + * new Query().readConcern('snapshot') + * new Query().readConcern('s') // same as snapshot + * + * + * #### Read Concern Level: + * + * ``` + * local MongoDB 3.2+ The query returns from the instance with no guarantee guarantee that the data has been written to a majority of the replica set members (i.e. may be rolled back). + * available MongoDB 3.6+ The query returns from the instance with no guarantee guarantee that the data has been written to a majority of the replica set members (i.e. may be rolled back). + * majority MongoDB 3.2+ The query returns the data that has been acknowledged by a majority of the replica set members. The documents returned by the read operation are durable, even in the event of failure. + * linearizable MongoDB 3.4+ The query returns data that reflects all successful majority-acknowledged writes that completed prior to the start of the read operation. The query may wait for concurrently executing writes to propagate to a majority of replica set members before returning results. + * snapshot MongoDB 4.0+ Only available for operations within multi-document transactions. Upon transaction commit with write concern "majority", the transaction operations are guaranteed to have read from a snapshot of majority-committed data. + * ``` + * + * Aliases + * + * ``` + * l local + * a available + * m majority + * lz linearizable + * s snapshot + * ``` + * + * Read more about how to use read concern [here](https://docs.mongodb.com/manual/reference/read-concern/). + * + * @memberOf Query + * @method readConcern + * @param {String} level one of the listed read concern level or their aliases + * @see mongodb https://docs.mongodb.com/manual/reference/read-concern/ + * @return {Query} this + * @api public + */ + +/** + * Gets query options. + * + * #### Example: + * + * const query = new Query(); + * query.limit(10); + * query.setOptions({ maxTimeMS: 1000 }); + * query.getOptions(); // { limit: 10, maxTimeMS: 1000 } + * + * @return {Object} the options + * @api public + */ + +Query.prototype.getOptions = function() { + return this.options; +}; + +/** + * Sets query options. Some options only make sense for certain operations. + * + * #### Options: + * + * The following options are only for `find()`: + * + * - [tailable](https://www.mongodb.org/display/DOCS/Tailable+Cursors) + * - [sort](https://www.mongodb.org/display/DOCS/Advanced+Queries#AdvancedQueries-%7B%7Bsort(\)%7D%7D) + * - [limit](https://www.mongodb.org/display/DOCS/Advanced+Queries#AdvancedQueries-%7B%7Blimit%28%29%7D%7D) + * - [skip](https://www.mongodb.org/display/DOCS/Advanced+Queries#AdvancedQueries-%7B%7Bskip%28%29%7D%7D) + * - [allowDiskUse](https://docs.mongodb.com/manual/reference/method/cursor.allowDiskUse/) + * - [batchSize](https://www.mongodb.org/display/DOCS/Advanced+Queries#AdvancedQueries-%7B%7BbatchSize%28%29%7D%7D) + * - [readPreference](https://docs.mongodb.org/manual/applications/replication/#read-preference) + * - [hint](https://www.mongodb.org/display/DOCS/Advanced+Queries#AdvancedQueries-%24hint) + * - [comment](https://www.mongodb.org/display/DOCS/Advanced+Queries#AdvancedQueries-%24comment) + * - [snapshot](https://www.mongodb.org/display/DOCS/Advanced+Queries#AdvancedQueries-%7B%7Bsnapshot%28%29%7D%7D) + * - [maxscan](https://docs.mongodb.org/v3.2/reference/operator/meta/maxScan/#metaOp._S_maxScan) + * + * The following options are only for write operations: `update()`, `updateOne()`, `updateMany()`, `replaceOne()`, `findOneAndUpdate()`, and `findByIdAndUpdate()`: + * + * - [upsert](https://docs.mongodb.com/manual/reference/method/db.collection.update/) + * - [writeConcern](https://docs.mongodb.com/manual/reference/method/db.collection.update/) + * - [timestamps](https://mongoosejs.com/docs/guide.html#timestamps): If `timestamps` is set in the schema, set this option to `false` to skip timestamps for that particular update. Has no effect if `timestamps` is not enabled in the schema options. + * - overwriteDiscriminatorKey: allow setting the discriminator key in the update. Will use the correct discriminator schema if the update changes the discriminator key. + * + * The following options are only for `find()`, `findOne()`, `findById()`, `findOneAndUpdate()`, and `findByIdAndUpdate()`: + * + * - [lean](./api.html#query_Query-lean) + * - [populate](/docs/populate.html) + * - [projection](/docs/api/query.html#query_Query-projection) + * - sanitizeProjection + * + * The following options are only for all operations **except** `update()`, `updateOne()`, `updateMany()`, `remove()`, `deleteOne()`, and `deleteMany()`: + * + * - [maxTimeMS](https://docs.mongodb.com/manual/reference/operator/meta/maxTimeMS/) + * + * The following options are for `findOneAndUpdate()` and `findOneAndRemove()` + * + * - rawResult + * + * The following options are for all operations: + * + * - [strict](/docs/guide.html#strict) + * - [collation](https://docs.mongodb.com/manual/reference/collation/) + * - [session](https://docs.mongodb.com/manual/reference/server-sessions/) + * - [explain](https://docs.mongodb.com/manual/reference/method/cursor.explain/) + * + * @param {Object} options + * @return {Query} this + * @api public + */ + +Query.prototype.setOptions = function(options, overwrite) { + // overwrite is only for internal use + if (overwrite) { + // ensure that _mongooseOptions & options are two different objects + this._mongooseOptions = (options && utils.clone(options)) || {}; + this.options = options || {}; + + if ('populate' in options) { + this.populate(this._mongooseOptions); + } + return this; + } + if (options == null) { + return this; + } + if (typeof options !== 'object') { + throw new Error('Options must be an object, got "' + options + '"'); + } + + if (Array.isArray(options.populate)) { + const populate = options.populate; + delete options.populate; + const _numPopulate = populate.length; + for (let i = 0; i < _numPopulate; ++i) { + this.populate(populate[i]); + } + } + + if ('setDefaultsOnInsert' in options) { + this._mongooseOptions.setDefaultsOnInsert = options.setDefaultsOnInsert; + delete options.setDefaultsOnInsert; + } + if ('overwriteDiscriminatorKey' in options) { + this._mongooseOptions.overwriteDiscriminatorKey = options.overwriteDiscriminatorKey; + delete options.overwriteDiscriminatorKey; + } + if ('sanitizeProjection' in options) { + if (options.sanitizeProjection && !this._mongooseOptions.sanitizeProjection) { + sanitizeProjection(this._fields); + } + + this._mongooseOptions.sanitizeProjection = options.sanitizeProjection; + delete options.sanitizeProjection; + } + if ('sanitizeFilter' in options) { + this._mongooseOptions.sanitizeFilter = options.sanitizeFilter; + delete options.sanitizeFilter; + } + + if ('defaults' in options) { + this._mongooseOptions.defaults = options.defaults; + // deleting options.defaults will cause 7287 to fail + } + + if (typeof options.limit === 'string') { + try { + options.limit = castNumber(options.limit); + } catch (err) { + throw new CastError('Number', options.limit, 'limit'); + } + } + if (typeof options.skip === 'string') { + try { + options.skip = castNumber(options.skip); + } catch (err) { + throw new CastError('Number', options.skip, 'skip'); + } + } + + // set arbitrary options + for (const key of Object.keys(options)) { + if (queryOptionMethods.has(key)) { + const args = Array.isArray(options[key]) ? + options[key] : + [options[key]]; + this[key].apply(this, args); + } else { + this.options[key] = options[key]; + } + } + + return this; +}; + +/** + * Sets the [`explain` option](https://docs.mongodb.com/manual/reference/method/cursor.explain/), + * which makes this query return detailed execution stats instead of the actual + * query result. This method is useful for determining what index your queries + * use. + * + * Calling `query.explain(v)` is equivalent to `query.setOptions({ explain: v })` + * + * #### Example: + * + * const query = new Query(); + * const res = await query.find({ a: 1 }).explain('queryPlanner'); + * console.log(res); + * + * @param {String} [verbose] The verbosity mode. Either 'queryPlanner', 'executionStats', or 'allPlansExecution'. The default is 'queryPlanner' + * @return {Query} this + * @api public + */ + +Query.prototype.explain = function(verbose) { + if (arguments.length === 0) { + this.options.explain = true; + } else if (verbose === false) { + delete this.options.explain; + } else { + this.options.explain = verbose; + } + return this; +}; + +/** + * Sets the [`allowDiskUse` option](https://docs.mongodb.com/manual/reference/method/cursor.allowDiskUse/), + * which allows the MongoDB server to use more than 100 MB for this query's `sort()`. This option can + * let you work around `QueryExceededMemoryLimitNoDiskUseAllowed` errors from the MongoDB server. + * + * Note that this option requires MongoDB server >= 4.4. Setting this option is a no-op for MongoDB 4.2 + * and earlier. + * + * Calling `query.allowDiskUse(v)` is equivalent to `query.setOptions({ allowDiskUse: v })` + * + * #### Example: + * + * await query.find().sort({ name: 1 }).allowDiskUse(true); + * // Equivalent: + * await query.find().sort({ name: 1 }).allowDiskUse(); + * + * @param {Boolean} [v] Enable/disable `allowDiskUse`. If called with 0 arguments, sets `allowDiskUse: true` + * @return {Query} this + * @api public + */ + +Query.prototype.allowDiskUse = function(v) { + if (arguments.length === 0) { + this.options.allowDiskUse = true; + } else if (v === false) { + delete this.options.allowDiskUse; + } else { + this.options.allowDiskUse = v; + } + return this; +}; + +/** + * Sets the [maxTimeMS](https://docs.mongodb.com/manual/reference/method/cursor.maxTimeMS/) + * option. This will tell the MongoDB server to abort if the query or write op + * has been running for more than `ms` milliseconds. + * + * Calling `query.maxTimeMS(v)` is equivalent to `query.setOptions({ maxTimeMS: v })` + * + * #### Example: + * + * const query = new Query(); + * // Throws an error 'operation exceeded time limit' as long as there's + * // >= 1 doc in the queried collection + * const res = await query.find({ $where: 'sleep(1000) || true' }).maxTimeMS(100); + * + * @param {Number} [ms] The number of milliseconds + * @return {Query} this + * @api public + */ + +Query.prototype.maxTimeMS = function(ms) { + this.options.maxTimeMS = ms; + return this; +}; + +/** + * Returns the current query filter (also known as conditions) as a [POJO](https://masteringjs.io/tutorials/fundamentals/pojo). + * + * #### Example: + * + * const query = new Query(); + * query.find({ a: 1 }).where('b').gt(2); + * query.getFilter(); // { a: 1, b: { $gt: 2 } } + * + * @return {Object} current query filter + * @api public + */ + +Query.prototype.getFilter = function() { + return this._conditions; +}; + +/** + * Returns the current query filter. Equivalent to `getFilter()`. + * + * You should use `getFilter()` instead of `getQuery()` where possible. `getQuery()` + * will likely be deprecated in a future release. + * + * #### Example: + * + * const query = new Query(); + * query.find({ a: 1 }).where('b').gt(2); + * query.getQuery(); // { a: 1, b: { $gt: 2 } } + * + * @return {Object} current query filter + * @api public + */ + +Query.prototype.getQuery = function() { + return this._conditions; +}; + +/** + * Sets the query conditions to the provided JSON object. + * + * #### Example: + * + * const query = new Query(); + * query.find({ a: 1 }) + * query.setQuery({ a: 2 }); + * query.getQuery(); // { a: 2 } + * + * @param {Object} new query conditions + * @return {undefined} + * @api public + */ + +Query.prototype.setQuery = function(val) { + this._conditions = val; +}; + +/** + * Returns the current update operations as a JSON object. + * + * #### Example: + * + * const query = new Query(); + * query.update({}, { $set: { a: 5 } }); + * query.getUpdate(); // { $set: { a: 5 } } + * + * @return {Object} current update operations + * @api public + */ + +Query.prototype.getUpdate = function() { + return this._update; +}; + +/** + * Sets the current update operation to new value. + * + * #### Example: + * + * const query = new Query(); + * query.update({}, { $set: { a: 5 } }); + * query.setUpdate({ $set: { b: 6 } }); + * query.getUpdate(); // { $set: { b: 6 } } + * + * @param {Object} new update operation + * @return {undefined} + * @api public + */ + +Query.prototype.setUpdate = function(val) { + this._update = val; +}; + +/** + * Returns fields selection for this query. + * + * @method _fieldsForExec + * @return {Object} + * @api private + * @receiver Query + */ + +Query.prototype._fieldsForExec = function() { + return utils.clone(this._fields); +}; + + +/** + * Return an update document with corrected `$set` operations. + * + * @method _updateForExec + * @api private + * @receiver Query + */ + +Query.prototype._updateForExec = function() { + const update = utils.clone(this._update, { + transform: false, + depopulate: true + }); + const ops = Object.keys(update); + let i = ops.length; + const ret = {}; + + while (i--) { + const op = ops[i]; + + if (this.options.overwrite) { + ret[op] = update[op]; + continue; + } + + if ('$' !== op[0]) { + // fix up $set sugar + if (!ret.$set) { + if (update.$set) { + ret.$set = update.$set; + } else { + ret.$set = {}; + } + } + ret.$set[op] = update[op]; + ops.splice(i, 1); + if (!~ops.indexOf('$set')) ops.push('$set'); + } else if ('$set' === op) { + if (!ret.$set) { + ret[op] = update[op]; + } + } else { + ret[op] = update[op]; + } + } + + return ret; +}; + +/** + * Makes sure _path is set. + * + * @method _ensurePath + * @param {String} method + * @api private + * @receiver Query + */ + +/** + * Determines if `conds` can be merged using `mquery().merge()` + * + * @method canMerge + * @memberOf Query + * @instance + * @param {Object} conds + * @return {Boolean} + * @api private + */ + +/** + * Returns default options for this query. + * + * @param {Model} model + * @api private + */ + +Query.prototype._optionsForExec = function(model) { + const options = utils.clone(this.options); + delete options.populate; + model = model || this.model; + + if (!model) { + return options; + } + + // Apply schema-level `writeConcern` option + applyWriteConcern(model.schema, options); + + const readPreference = model && + model.schema && + model.schema.options && + model.schema.options.read; + if (!('readPreference' in options) && readPreference) { + options.readPreference = readPreference; + } + + if (options.upsert !== void 0) { + options.upsert = !!options.upsert; + } + if (options.writeConcern) { + if (options.j) { + options.writeConcern.j = options.j; + delete options.j; + } + if (options.w) { + options.writeConcern.w = options.w; + delete options.w; + } + if (options.wtimeout) { + options.writeConcern.wtimeout = options.wtimeout; + delete options.wtimeout; + } + } + return options; +}; + +/** + * Sets the lean option. + * + * Documents returned from queries with the `lean` option enabled are plain + * javascript objects, not [Mongoose Documents](/api/document.html). They have no + * `save` method, getters/setters, virtuals, or other Mongoose features. + * + * #### Example: + * + * new Query().lean() // true + * new Query().lean(true) + * new Query().lean(false) + * + * const docs = await Model.find().lean(); + * docs[0] instanceof mongoose.Document; // false + * + * [Lean is great for high-performance, read-only cases](/docs/tutorials/lean.html), + * especially when combined + * with [cursors](/docs/queries.html#streaming). + * + * If you need virtuals, getters/setters, or defaults with `lean()`, you need + * to use a plugin. See: + * + * - [mongoose-lean-virtuals](https://plugins.mongoosejs.io/plugins/lean-virtuals) + * - [mongoose-lean-getters](https://plugins.mongoosejs.io/plugins/lean-getters) + * - [mongoose-lean-defaults](https://www.npmjs.com/package/mongoose-lean-defaults) + * + * @param {Boolean|Object} bool defaults to true + * @return {Query} this + * @api public + */ + +Query.prototype.lean = function(v) { + this._mongooseOptions.lean = arguments.length ? v : true; + return this; +}; + +/** + * Adds a `$set` to this query's update without changing the operation. + * This is useful for query middleware so you can add an update regardless + * of whether you use `updateOne()`, `updateMany()`, `findOneAndUpdate()`, etc. + * + * #### Example: + * + * // Updates `{ $set: { updatedAt: new Date() } }` + * new Query().updateOne({}, {}).set('updatedAt', new Date()); + * new Query().updateMany({}, {}).set({ updatedAt: new Date() }); + * + * @param {String|Object} path path or object of key/value pairs to set + * @param {Any} [val] the value to set + * @return {Query} this + * @api public + */ + +Query.prototype.set = function(path, val) { + if (typeof path === 'object') { + const keys = Object.keys(path); + for (const key of keys) { + this.set(key, path[key]); + } + return this; + } + + this._update = this._update || {}; + this._update.$set = this._update.$set || {}; + this._update.$set[path] = val; + return this; +}; + +/** + * For update operations, returns the value of a path in the update's `$set`. + * Useful for writing getters/setters that can work with both update operations + * and `save()`. + * + * #### Example: + * + * const query = Model.updateOne({}, { $set: { name: 'Jean-Luc Picard' } }); + * query.get('name'); // 'Jean-Luc Picard' + * + * @param {String|Object} path path or object of key/value pairs to get + * @return {Query} this + * @api public + */ + +Query.prototype.get = function get(path) { + const update = this._update; + if (update == null) { + return void 0; + } + const $set = update.$set; + if ($set == null) { + return update[path]; + } + + if (utils.hasUserDefinedProperty(update, path)) { + return update[path]; + } + if (utils.hasUserDefinedProperty($set, path)) { + return $set[path]; + } + + return void 0; +}; + +/** + * Gets/sets the error flag on this query. If this flag is not null or + * undefined, the `exec()` promise will reject without executing. + * + * #### Example: + * + * Query().error(); // Get current error value + * Query().error(null); // Unset the current error + * Query().error(new Error('test')); // `exec()` will resolve with test + * Schema.pre('find', function() { + * if (!this.getQuery().userId) { + * this.error(new Error('Not allowed to query without setting userId')); + * } + * }); + * + * Note that query casting runs **after** hooks, so cast errors will override + * custom errors. + * + * #### Example: + * const TestSchema = new Schema({ num: Number }); + * const TestModel = db.model('Test', TestSchema); + * TestModel.find({ num: 'not a number' }).error(new Error('woops')).exec(function(error) { + * // `error` will be a cast error because `num` failed to cast + * }); + * + * @param {Error|null} err if set, `exec()` will fail fast before sending the query to MongoDB + * @return {Query} this + * @api public + */ + +Query.prototype.error = function error(err) { + if (arguments.length === 0) { + return this._error; + } + + this._error = err; + return this; +}; + +/*! + * ignore + */ + +Query.prototype._unsetCastError = function _unsetCastError() { + if (this._error != null && !(this._error instanceof CastError)) { + return; + } + return this.error(null); +}; + +/** + * Getter/setter around the current mongoose-specific options for this query + * Below are the current Mongoose-specific options. + * + * - `populate`: an array representing what paths will be populated. Should have one entry for each call to [`Query.prototype.populate()`](/docs/api.html#query_Query-populate) + * - `lean`: if truthy, Mongoose will not [hydrate](/docs/api.html#model_Model.hydrate) any documents that are returned from this query. See [`Query.prototype.lean()`](/docs/api.html#query_Query-lean) for more information. + * - `strict`: controls how Mongoose handles keys that aren't in the schema for updates. This option is `true` by default, which means Mongoose will silently strip any paths in the update that aren't in the schema. See the [`strict` mode docs](/docs/guide.html#strict) for more information. + * - `strictQuery`: controls how Mongoose handles keys that aren't in the schema for the query `filter`. This option is `false` by default for backwards compatibility, which means Mongoose will allow `Model.find({ foo: 'bar' })` even if `foo` is not in the schema. See the [`strictQuery` docs](/docs/guide.html#strictQuery) for more information. + * - `nearSphere`: use `$nearSphere` instead of `near()`. See the [`Query.prototype.nearSphere()` docs](/docs/api.html#query_Query-nearSphere) + * + * Mongoose maintains a separate object for internal options because + * Mongoose sends `Query.prototype.options` to the MongoDB server, and the + * above options are not relevant for the MongoDB server. + * + * @param {Object} options if specified, overwrites the current options + * @return {Object} the options + * @api public + */ + +Query.prototype.mongooseOptions = function(v) { + if (arguments.length > 0) { + this._mongooseOptions = v; + } + return this._mongooseOptions; +}; + +/*! + * ignore + */ + +Query.prototype._castConditions = function() { + let sanitizeFilterOpt = undefined; + if (this.model != null && utils.hasUserDefinedProperty(this.model.db.options, 'sanitizeFilter')) { + sanitizeFilterOpt = this.model.db.options.sanitizeFilter; + } else if (this.model != null && utils.hasUserDefinedProperty(this.model.base.options, 'sanitizeFilter')) { + sanitizeFilterOpt = this.model.base.options.sanitizeFilter; + } else { + sanitizeFilterOpt = this._mongooseOptions.sanitizeFilter; + } + + if (sanitizeFilterOpt) { + sanitizeFilter(this._conditions); + } + + try { + this.cast(this.model); + this._unsetCastError(); + } catch (err) { + this.error(err); + } +}; + +/*! + * ignore + */ + +function _castArrayFilters(query) { + try { + castArrayFilters(query); + } catch (err) { + query.error(err); + } +} + +/** + * Thunk around find() + * + * @param {Function} [callback] + * @return {Query} this + * @api private + */ +Query.prototype._find = wrapThunk(function(callback) { + this._castConditions(); + + if (this.error() != null) { + callback(this.error()); + return null; + } + + callback = _wrapThunkCallback(this, callback); + + this._applyPaths(); + this._fields = this._castFields(this._fields); + + const fields = this._fieldsForExec(); + const mongooseOptions = this._mongooseOptions; + const _this = this; + const userProvidedFields = _this._userProvidedFields || {}; + + applyGlobalMaxTimeMS(this.options, this.model); + applyGlobalDiskUse(this.options, this.model); + + // Separate options to pass down to `completeMany()` in case we need to + // set a session on the document + const completeManyOptions = Object.assign({}, { + session: this && this.options && this.options.session || null, + lean: mongooseOptions.lean || null + }); + + const cb = (err, docs) => { + if (err) { + return callback(err); + } + + if (docs.length === 0) { + return callback(null, docs); + } + if (this.options.explain) { + return callback(null, docs); + } + if (!mongooseOptions.populate) { + const versionKey = _this.schema.options.versionKey; + if (mongooseOptions.lean && mongooseOptions.lean.versionKey === false && versionKey) { + docs.forEach((doc) => { + if (versionKey in doc) { + delete doc[versionKey]; + } + }); + } + return mongooseOptions.lean ? + // call _completeManyLean here? + _completeManyLean(_this.model.schema, docs, null, completeManyOptions, callback) : + // callback(null, docs) : + completeMany(_this.model, docs, fields, userProvidedFields, completeManyOptions, callback); + } + + const pop = helpers.preparePopulationOptionsMQ(_this, mongooseOptions); + + if (mongooseOptions.lean) { + return _this.model.populate(docs, pop, callback); + } + + completeMany(_this.model, docs, fields, userProvidedFields, completeManyOptions, (err, docs) => { + if (err != null) { + return callback(err); + } + _this.model.populate(docs, pop, callback); + }); + }; + + const options = this._optionsForExec(); + options.projection = this._fieldsForExec(); + const filter = this._conditions; + + this._collection.collection.find(filter, options, (err, cursor) => { + if (err != null) { + return cb(err); + } + + if (options.explain) { + return cursor.explain(cb); + } + try { + return cursor.toArray(cb); + } catch (err) { + return cb(err); + } + }); +}); + +/** + * Find all documents that match `selector`. The result will be an array of documents. + * + * If there are too many documents in the result to fit in memory, use + * [`Query.prototype.cursor()`](api.html#query_Query-cursor) + * + * #### Example + * + * // Using async/await + * const arr = await Movie.find({ year: { $gte: 1980, $lte: 1989 } }); + * + * // Using callbacks + * Movie.find({ year: { $gte: 1980, $lte: 1989 } }, function(err, arr) {}); + * + * @param {Object|ObjectId} [filter] mongodb selector. If not specified, returns all documents. + * @param {Function} [callback] + * @return {Query} this + * @api public + */ + +Query.prototype.find = function(conditions, callback) { + this.op = 'find'; + + if (typeof conditions === 'function') { + callback = conditions; + conditions = {}; + } + + conditions = utils.toObject(conditions); + + if (mquery.canMerge(conditions)) { + this.merge(conditions); + + prepareDiscriminatorCriteria(this); + } else if (conditions != null) { + this.error(new ObjectParameterError(conditions, 'filter', 'find')); + } + + // if we don't have a callback, then just return the query object + if (!callback) { + return Query.base.find.call(this); + } + + this.exec(callback); + + return this; +}; + +/** + * Merges another Query or conditions object into this one. + * + * When a Query is passed, conditions, field selection and options are merged. + * + * @param {Query|Object} source + * @return {Query} this + */ + +Query.prototype.merge = function(source) { + if (!source) { + return this; + } + + const opts = { overwrite: true }; + + if (source instanceof Query) { + // if source has a feature, apply it to ourselves + + if (source._conditions) { + utils.merge(this._conditions, source._conditions, opts); + } + + if (source._fields) { + this._fields || (this._fields = {}); + utils.merge(this._fields, source._fields, opts); + } + + if (source.options) { + this.options || (this.options = {}); + utils.merge(this.options, source.options, opts); + } + + if (source._update) { + this._update || (this._update = {}); + utils.mergeClone(this._update, source._update); + } + + if (source._distinct) { + this._distinct = source._distinct; + } + + utils.merge(this._mongooseOptions, source._mongooseOptions); + + return this; + } + + // plain object + utils.merge(this._conditions, source, opts); + + return this; +}; + +/** + * Adds a collation to this op (MongoDB 3.4 and up) + * + * @param {Object} value + * @return {Query} this + * @see MongoDB docs https://docs.mongodb.com/manual/reference/method/cursor.collation/#cursor.collation + * @api public + */ + +Query.prototype.collation = function(value) { + if (this.options == null) { + this.options = {}; + } + this.options.collation = value; + return this; +}; + +/** + * Hydrate a single doc from `findOne()`, `findOneAndUpdate()`, etc. + * + * @api private + */ + +Query.prototype._completeOne = function(doc, res, callback) { + if (!doc && !this.options.rawResult) { + return callback(null, null); + } + + const model = this.model; + const projection = utils.clone(this._fields); + const userProvidedFields = this._userProvidedFields || {}; + // `populate`, `lean` + const mongooseOptions = this._mongooseOptions; + // `rawResult` + const options = this.options; + if (!options.lean && mongooseOptions.lean) { + options.lean = mongooseOptions.lean; + } + + if (options.explain) { + return callback(null, doc); + } + + if (!mongooseOptions.populate) { + const versionKey = this.schema.options.versionKey; + if (mongooseOptions.lean && mongooseOptions.lean.versionKey === false && versionKey) { + if (versionKey in doc) { + delete doc[versionKey]; + } + } + return mongooseOptions.lean ? + _completeOneLean(model.schema, doc, null, res, options, callback) : + completeOne(model, doc, res, options, projection, userProvidedFields, + null, callback); + } + + const pop = helpers.preparePopulationOptionsMQ(this, this._mongooseOptions); + if (mongooseOptions.lean) { + return model.populate(doc, pop, (err, doc) => { + if (err != null) { + return callback(err); + } + _completeOneLean(model.schema, doc, null, res, options, callback); + }); + } + + completeOne(model, doc, res, options, projection, userProvidedFields, [], (err, doc) => { + if (err != null) { + return callback(err); + } + model.populate(doc, pop, callback); + }); +}; + +/** + * Thunk around findOne() + * + * @param {Function} [callback] + * @see findOne https://docs.mongodb.org/manual/reference/method/db.collection.findOne/ + * @api private + */ + +Query.prototype._findOne = wrapThunk(function(callback) { + this._castConditions(); + + if (this.error()) { + callback(this.error()); + return null; + } + + this._applyPaths(); + this._fields = this._castFields(this._fields); + applyGlobalMaxTimeMS(this.options, this.model); + applyGlobalDiskUse(this.options, this.model); + + // don't pass in the conditions because we already merged them in + Query.base.findOne.call(this, {}, (err, doc) => { + if (err) { + callback(err); + return null; + } + + this._completeOne(doc, null, _wrapThunkCallback(this, callback)); + }); +}); + +/** + * Declares the query a findOne operation. When executed, the first found document is passed to the callback. + * + * Passing a `callback` executes the query. The result of the query is a single document. + * + * * *Note:* `conditions` is optional, and if `conditions` is null or undefined, + * mongoose will send an empty `findOne` command to MongoDB, which will return + * an arbitrary document. If you're querying by `_id`, use `Model.findById()` + * instead. + * + * This function triggers the following middleware. + * + * - `findOne()` + * + * #### Example + * + * const query = Kitten.where({ color: 'white' }); + * query.findOne(function (err, kitten) { + * if (err) return handleError(err); + * if (kitten) { + * // doc may be null if no document matched + * } + * }); + * + * @param {Object} [filter] mongodb selector + * @param {Object} [projection] optional fields to return + * @param {Object} [options] see [`setOptions()`](https://mongoosejs.com/docs/api.html#query_Query-setOptions) + * @param {Function} [callback] optional params are (error, document) + * @return {Query} this + * @see findOne https://docs.mongodb.org/manual/reference/method/db.collection.findOne/ + * @see Query.select #query_Query-select + * @api public + */ + +Query.prototype.findOne = function(conditions, projection, options, callback) { + this.op = 'findOne'; + this._validateOp(); + + if (typeof conditions === 'function') { + callback = conditions; + conditions = null; + projection = null; + options = null; + } else if (typeof projection === 'function') { + callback = projection; + options = null; + projection = null; + } else if (typeof options === 'function') { + callback = options; + options = null; + } + + // make sure we don't send in the whole Document to merge() + conditions = utils.toObject(conditions); + + if (options) { + this.setOptions(options); + } + + if (projection) { + this.select(projection); + } + + if (mquery.canMerge(conditions)) { + this.merge(conditions); + + prepareDiscriminatorCriteria(this); + } else if (conditions != null) { + this.error(new ObjectParameterError(conditions, 'filter', 'findOne')); + } + + if (!callback) { + // already merged in the conditions, don't need to send them in. + return Query.base.findOne.call(this); + } + + this.exec(callback); + return this; +}; + +/** + * Thunk around count() + * + * @param {Function} [callback] + * @see count https://docs.mongodb.org/manual/reference/method/db.collection.count/ + * @api private + */ + +Query.prototype._count = wrapThunk(function(callback) { + try { + this.cast(this.model); + } catch (err) { + this.error(err); + } + + if (this.error()) { + return callback(this.error()); + } + + applyGlobalMaxTimeMS(this.options, this.model); + applyGlobalDiskUse(this.options, this.model); + + const conds = this._conditions; + const options = this._optionsForExec(); + + this._collection.count(conds, options, utils.tick(callback)); +}); + +/** + * Thunk around countDocuments() + * + * @param {Function} [callback] + * @see countDocuments https://mongodb.github.io/node-mongodb-native/3.1/api/Collection.html#countDocuments + * @api private + */ + +Query.prototype._countDocuments = wrapThunk(function(callback) { + try { + this.cast(this.model); + } catch (err) { + this.error(err); + } + + if (this.error()) { + return callback(this.error()); + } + + applyGlobalMaxTimeMS(this.options, this.model); + applyGlobalDiskUse(this.options, this.model); + + const conds = this._conditions; + const options = this._optionsForExec(); + + this._collection.collection.countDocuments(conds, options, utils.tick(callback)); +}); + +/** + * Thunk around estimatedDocumentCount() + * + * @param {Function} [callback] + * @see estimatedDocumentCount https://mongodb.github.io/node-mongodb-native/3.1/api/Collection.html#estimatedDocumentCount + * @api private + */ + +Query.prototype._estimatedDocumentCount = wrapThunk(function(callback) { + if (this.error()) { + return callback(this.error()); + } + + const options = this._optionsForExec(); + + this._collection.collection.estimatedDocumentCount(options, utils.tick(callback)); +}); + +/** + * Specifies this query as a `count` query. + * + * This method is deprecated. If you want to count the number of documents in + * a collection, e.g. `count({})`, use the [`estimatedDocumentCount()` function](/docs/api.html#query_Query-estimatedDocumentCount) + * instead. Otherwise, use the [`countDocuments()`](/docs/api.html#query_Query-countDocuments) function instead. + * + * Passing a `callback` executes the query. + * + * This function triggers the following middleware. + * + * - `count()` + * + * #### Example: + * + * const countQuery = model.where({ 'color': 'black' }).count(); + * + * query.count({ color: 'black' }).count(callback) + * + * query.count({ color: 'black' }, callback) + * + * query.where('color', 'black').count(function (err, count) { + * if (err) return handleError(err); + * console.log('there are %d kittens', count); + * }) + * + * @deprecated + * @param {Object} [filter] count documents that match this object + * @param {Function} [callback] optional params are (error, count) + * @return {Query} this + * @see count https://docs.mongodb.org/manual/reference/method/db.collection.count/ + * @api public + */ + +Query.prototype.count = function(filter, callback) { + this.op = 'count'; + this._validateOp(); + if (typeof filter === 'function') { + callback = filter; + filter = undefined; + } + + filter = utils.toObject(filter); + + if (mquery.canMerge(filter)) { + this.merge(filter); + } + + if (!callback) { + return this; + } + + this.exec(callback); + + return this; +}; + +/** + * Specifies this query as a `estimatedDocumentCount()` query. Faster than + * using `countDocuments()` for large collections because + * `estimatedDocumentCount()` uses collection metadata rather than scanning + * the entire collection. + * + * `estimatedDocumentCount()` does **not** accept a filter. `Model.find({ foo: bar }).estimatedDocumentCount()` + * is equivalent to `Model.find().estimatedDocumentCount()` + * + * This function triggers the following middleware. + * + * - `estimatedDocumentCount()` + * + * #### Example: + * + * await Model.find().estimatedDocumentCount(); + * + * @param {Object} [options] passed transparently to the [MongoDB driver](https://mongodb.github.io/node-mongodb-native/3.1/api/Collection.html#estimatedDocumentCount) + * @param {Function} [callback] optional params are (error, count) + * @return {Query} this + * @see estimatedDocumentCount https://mongodb.github.io/node-mongodb-native/3.1/api/Collection.html#estimatedDocumentCount + * @api public + */ + +Query.prototype.estimatedDocumentCount = function(options, callback) { + this.op = 'estimatedDocumentCount'; + this._validateOp(); + if (typeof options === 'function') { + callback = options; + options = undefined; + } + + if (typeof options === 'object' && options != null) { + this.setOptions(options); + } + + if (!callback) { + return this; + } + + this.exec(callback); + + return this; +}; + +/** + * Specifies this query as a `countDocuments()` query. Behaves like `count()`, + * except it always does a full collection scan when passed an empty filter `{}`. + * + * There are also minor differences in how `countDocuments()` handles + * [`$where` and a couple geospatial operators](https://mongodb.github.io/node-mongodb-native/3.1/api/Collection.html#countDocuments). + * versus `count()`. + * + * Passing a `callback` executes the query. + * + * This function triggers the following middleware. + * + * - `countDocuments()` + * + * #### Example: + * + * const countQuery = model.where({ 'color': 'black' }).countDocuments(); + * + * query.countDocuments({ color: 'black' }).count(callback); + * + * query.countDocuments({ color: 'black' }, callback); + * + * query.where('color', 'black').countDocuments(function(err, count) { + * if (err) return handleError(err); + * console.log('there are %d kittens', count); + * }); + * + * The `countDocuments()` function is similar to `count()`, but there are a + * [few operators that `countDocuments()` does not support](https://mongodb.github.io/node-mongodb-native/3.1/api/Collection.html#countDocuments). + * Below are the operators that `count()` supports but `countDocuments()` does not, + * and the suggested replacement: + * + * - `$where`: [`$expr`](https://docs.mongodb.com/manual/reference/operator/query/expr/) + * - `$near`: [`$geoWithin`](https://docs.mongodb.com/manual/reference/operator/query/geoWithin/) with [`$center`](https://docs.mongodb.com/manual/reference/operator/query/center/#op._S_center) + * - `$nearSphere`: [`$geoWithin`](https://docs.mongodb.com/manual/reference/operator/query/geoWithin/) with [`$centerSphere`](https://docs.mongodb.com/manual/reference/operator/query/centerSphere/#op._S_centerSphere) + * + * @param {Object} [filter] mongodb selector + * @param {Object} [options] + * @param {Function} [callback] optional params are (error, count) + * @return {Query} this + * @see countDocuments https://mongodb.github.io/node-mongodb-native/3.1/api/Collection.html#countDocuments + * @api public + */ + +Query.prototype.countDocuments = function(conditions, options, callback) { + this.op = 'countDocuments'; + this._validateOp(); + if (typeof conditions === 'function') { + callback = conditions; + conditions = undefined; + options = undefined; + } + if (typeof options === 'function') { + callback = options; + options = undefined; + } + + conditions = utils.toObject(conditions); + + if (mquery.canMerge(conditions)) { + this.merge(conditions); + } + + if (typeof options === 'object' && options != null) { + this.setOptions(options); + } + + if (!callback) { + return this; + } + + this.exec(callback); + + return this; +}; + +/** + * Thunk around distinct() + * + * @param {Function} [callback] + * @see distinct https://docs.mongodb.org/manual/reference/method/db.collection.distinct/ + * @api private + */ + +Query.prototype.__distinct = wrapThunk(function __distinct(callback) { + this._castConditions(); + + if (this.error()) { + callback(this.error()); + return null; + } + + applyGlobalMaxTimeMS(this.options, this.model); + applyGlobalDiskUse(this.options, this.model); + + const options = this._optionsForExec(); + + // don't pass in the conditions because we already merged them in + this._collection.collection. + distinct(this._distinct, this._conditions, options, callback); +}); + +/** + * Declares or executes a distinct() operation. + * + * Passing a `callback` executes the query. + * + * This function does not trigger any middleware. + * + * #### Example + * + * distinct(field, conditions, callback) + * distinct(field, conditions) + * distinct(field, callback) + * distinct(field) + * distinct(callback) + * distinct() + * + * @param {String} [field] + * @param {Object|Query} [filter] + * @param {Function} [callback] optional params are (error, arr) + * @return {Query} this + * @see distinct https://docs.mongodb.org/manual/reference/method/db.collection.distinct/ + * @api public + */ + +Query.prototype.distinct = function(field, conditions, callback) { + this.op = 'distinct'; + this._validateOp(); + if (!callback) { + if (typeof conditions === 'function') { + callback = conditions; + conditions = undefined; + } else if (typeof field === 'function') { + callback = field; + field = undefined; + conditions = undefined; + } + } + + conditions = utils.toObject(conditions); + + if (mquery.canMerge(conditions)) { + this.merge(conditions); + + prepareDiscriminatorCriteria(this); + } else if (conditions != null) { + this.error(new ObjectParameterError(conditions, 'filter', 'distinct')); + } + + if (field != null) { + this._distinct = field; + } + + if (callback != null) { + this.exec(callback); + } + + return this; +}; + +/** + * Sets the sort order + * + * If an object is passed, values allowed are `asc`, `desc`, `ascending`, `descending`, `1`, and `-1`. + * + * If a string is passed, it must be a space delimited list of path names. The + * sort order of each path is ascending unless the path name is prefixed with `-` + * which will be treated as descending. + * + * #### Example + * + * // sort by "field" ascending and "test" descending + * query.sort({ field: 'asc', test: -1 }); + * + * // equivalent + * query.sort('field -test'); + * + * #### Note + * + * Cannot be used with `distinct()` + * + * @param {Object|String} arg + * @return {Query} this + * @see cursor.sort https://docs.mongodb.org/manual/reference/method/cursor.sort/ + * @api public + */ + +Query.prototype.sort = function(arg) { + if (arguments.length > 1) { + throw new Error('sort() only takes 1 Argument'); + } + + return Query.base.sort.call(this, arg); +}; + +/** + * Declare and/or execute this query as a remove() operation. `remove()` is + * deprecated, you should use [`deleteOne()`](#query_Query-deleteOne) + * or [`deleteMany()`](#query_Query-deleteMany) instead. + * + * This function does not trigger any middleware + * + * #### Example + * + * Character.remove({ name: /Stark/ }, callback); + * + * This function calls the MongoDB driver's [`Collection#remove()` function](https://mongodb.github.io/node-mongodb-native/3.1/api/Collection.html#remove). + * The returned [promise](https://mongoosejs.com/docs/queries.html) resolves to an + * object that contains 3 properties: + * + * - `ok`: `1` if no errors occurred + * - `deletedCount`: the number of documents deleted + * - `n`: the number of documents deleted. Equal to `deletedCount`. + * + * #### Example + * + * const res = await Character.remove({ name: /Stark/ }); + * // Number of docs deleted + * res.deletedCount; + * + * #### Note + * + * Calling `remove()` creates a [Mongoose query](./queries.html), and a query + * does not execute until you either pass a callback, call [`Query#then()`](#query_Query-then), + * or call [`Query#exec()`](#query_Query-exec). + * + * // not executed + * const query = Character.remove({ name: /Stark/ }); + * + * // executed + * Character.remove({ name: /Stark/ }, callback); + * Character.remove({ name: /Stark/ }).remove(callback); + * + * // executed without a callback + * Character.exec(); + * + * @param {Object|Query} [filter] mongodb selector + * @param {Function} [callback] optional params are (error, mongooseDeleteResult) + * @return {Query} this + * @deprecated + * @see deleteWriteOpResult https://mongodb.github.io/node-mongodb-native/3.1/api/Collection.html#~deleteWriteOpResult + * @see MongoDB driver remove https://mongodb.github.io/node-mongodb-native/3.1/api/Collection.html#remove + * @api public + */ + +Query.prototype.remove = function(filter, callback) { + this.op = 'remove'; + if (typeof filter === 'function') { + callback = filter; + filter = null; + } + + filter = utils.toObject(filter); + + if (mquery.canMerge(filter)) { + this.merge(filter); + + prepareDiscriminatorCriteria(this); + } else if (filter != null) { + this.error(new ObjectParameterError(filter, 'filter', 'remove')); + } + + if (!callback) { + return Query.base.remove.call(this); + } + + this.exec(callback); + return this; +}; + +/*! + * ignore + */ + +Query.prototype._remove = wrapThunk(function(callback) { + this._castConditions(); + + if (this.error() != null) { + callback(this.error()); + return this; + } + + callback = _wrapThunkCallback(this, callback); + + return Query.base.remove.call(this, callback); +}); + +/** + * Declare and/or execute this query as a `deleteOne()` operation. Works like + * remove, except it deletes at most one document regardless of the `single` + * option. + * + * This function triggers `deleteOne` middleware. + * + * #### Example + * + * await Character.deleteOne({ name: 'Eddard Stark' }); + * + * // Using callbacks: + * Character.deleteOne({ name: 'Eddard Stark' }, callback); + * + * This function calls the MongoDB driver's [`Collection#deleteOne()` function](https://mongodb.github.io/node-mongodb-native/3.1/api/Collection.html#deleteOne). + * The returned [promise](https://mongoosejs.com/docs/queries.html) resolves to an + * object that contains 3 properties: + * + * - `ok`: `1` if no errors occurred + * - `deletedCount`: the number of documents deleted + * - `n`: the number of documents deleted. Equal to `deletedCount`. + * + * #### Example + * + * const res = await Character.deleteOne({ name: 'Eddard Stark' }); + * // `1` if MongoDB deleted a doc, `0` if no docs matched the filter `{ name: ... }` + * res.deletedCount; + * + * @param {Object|Query} [filter] mongodb selector + * @param {Object} [options] optional see [`Query.prototype.setOptions()`](https://mongoosejs.com/docs/api.html#query_Query-setOptions) + * @param {Function} [callback] optional params are (error, mongooseDeleteResult) + * @return {Query} this + * @see deleteWriteOpResult https://mongodb.github.io/node-mongodb-native/3.1/api/Collection.html#~deleteWriteOpResult + * @see MongoDB Driver deleteOne https://mongodb.github.io/node-mongodb-native/3.1/api/Collection.html#deleteOne + * @api public + */ + +Query.prototype.deleteOne = function(filter, options, callback) { + this.op = 'deleteOne'; + if (typeof filter === 'function') { + callback = filter; + filter = null; + options = null; + } else if (typeof options === 'function') { + callback = options; + options = null; + } else { + this.setOptions(options); + } + + filter = utils.toObject(filter); + + if (mquery.canMerge(filter)) { + this.merge(filter); + + prepareDiscriminatorCriteria(this); + } else if (filter != null) { + this.error(new ObjectParameterError(filter, 'filter', 'deleteOne')); + } + + if (!callback) { + return Query.base.deleteOne.call(this); + } + + this.exec.call(this, callback); + + return this; +}; + +/*! + * Internal thunk for `deleteOne()` + */ + +Query.prototype._deleteOne = wrapThunk(function(callback) { + this._castConditions(); + + if (this.error() != null) { + callback(this.error()); + return this; + } + + callback = _wrapThunkCallback(this, callback); + + return Query.base.deleteOne.call(this, callback); +}); + +/** + * Declare and/or execute this query as a `deleteMany()` operation. Works like + * remove, except it deletes _every_ document that matches `filter` in the + * collection, regardless of the value of `single`. + * + * This function triggers `deleteMany` middleware. + * + * #### Example + * + * await Character.deleteMany({ name: /Stark/, age: { $gte: 18 } }); + * + * // Using callbacks: + * Character.deleteMany({ name: /Stark/, age: { $gte: 18 } }, callback); + * + * This function calls the MongoDB driver's [`Collection#deleteMany()` function](https://mongodb.github.io/node-mongodb-native/3.1/api/Collection.html#deleteMany). + * The returned [promise](https://mongoosejs.com/docs/queries.html) resolves to an + * object that contains 3 properties: + * + * - `ok`: `1` if no errors occurred + * - `deletedCount`: the number of documents deleted + * - `n`: the number of documents deleted. Equal to `deletedCount`. + * + * #### Example + * + * const res = await Character.deleteMany({ name: /Stark/, age: { $gte: 18 } }); + * // `0` if no docs matched the filter, number of docs deleted otherwise + * res.deletedCount; + * + * @param {Object|Query} [filter] mongodb selector + * @param {Object} [options] optional see [`Query.prototype.setOptions()`](https://mongoosejs.com/docs/api.html#query_Query-setOptions) + * @param {Function} [callback] optional params are (error, mongooseDeleteResult) + * @return {Query} this + * @see deleteWriteOpResult https://mongodb.github.io/node-mongodb-native/3.1/api/Collection.html#~deleteWriteOpResult + * @see MongoDB Driver deleteMany https://mongodb.github.io/node-mongodb-native/3.1/api/Collection.html#deleteMany + * @api public + */ + +Query.prototype.deleteMany = function(filter, options, callback) { + this.op = 'deleteMany'; + if (typeof filter === 'function') { + callback = filter; + filter = null; + options = null; + } else if (typeof options === 'function') { + callback = options; + options = null; + } else { + this.setOptions(options); + } + + filter = utils.toObject(filter); + + if (mquery.canMerge(filter)) { + this.merge(filter); + + prepareDiscriminatorCriteria(this); + } else if (filter != null) { + this.error(new ObjectParameterError(filter, 'filter', 'deleteMany')); + } + + if (!callback) { + return Query.base.deleteMany.call(this); + } + + this.exec.call(this, callback); + + return this; +}; + +/*! + * Internal thunk around `deleteMany()` + */ + +Query.prototype._deleteMany = wrapThunk(function(callback) { + this._castConditions(); + + if (this.error() != null) { + callback(this.error()); + return this; + } + + callback = _wrapThunkCallback(this, callback); + + return Query.base.deleteMany.call(this, callback); +}); + +/*! + * hydrates a document + * + * @param {Model} model + * @param {Document} doc + * @param {Object} res 3rd parameter to callback + * @param {Object} fields + * @param {Query} self + * @param {Array} [pop] array of paths used in population + * @param {Function} callback + */ + +function completeOne(model, doc, res, options, fields, userProvidedFields, pop, callback) { + if (options.rawResult && doc == null) { + _init(null); + return null; + } + + helpers.createModelAndInit(model, doc, fields, userProvidedFields, options, pop, _init); + + function _init(err, casted) { + if (err) { + return immediate(() => callback(err)); + } + + + if (options.rawResult) { + if (doc && casted) { + if (options.session != null) { + casted.$session(options.session); + } + res.value = casted; + } else { + res.value = null; + } + return immediate(() => callback(null, res)); + } + if (options.session != null) { + casted.$session(options.session); + } + immediate(() => callback(null, casted)); + } +} + +/*! + * If the model is a discriminator type and not root, then add the key & value to the criteria. + */ + +function prepareDiscriminatorCriteria(query) { + if (!query || !query.model || !query.model.schema) { + return; + } + + const schema = query.model.schema; + + if (schema && schema.discriminatorMapping && !schema.discriminatorMapping.isRoot) { + query._conditions[schema.discriminatorMapping.key] = schema.discriminatorMapping.value; + } +} + +/** + * Issues a mongodb [findAndModify](https://www.mongodb.org/display/DOCS/findAndModify+Command) update command. + * + * Finds a matching document, updates it according to the `update` arg, passing any `options`, and returns the found + * document (if any) to the callback. The query executes if + * `callback` is passed. + * + * This function triggers the following middleware. + * + * - `findOneAndUpdate()` + * + * #### Available options + * + * - `new`: bool - if true, return the modified document rather than the original. defaults to false (changed in 4.0) + * - `upsert`: bool - creates the object if it doesn't exist. defaults to false. + * - `fields`: {Object|String} - Field selection. Equivalent to `.select(fields).findOneAndUpdate()` + * - `sort`: if multiple docs are found by the conditions, sets the sort order to choose which doc to update + * - `maxTimeMS`: puts a time limit on the query - requires mongodb >= 2.6.0 + * - `runValidators`: if true, runs [update validators](/docs/validation.html#update-validators) on this command. Update validators validate the update operation against the model's schema. + * - `setDefaultsOnInsert`: `true` by default. If `setDefaultsOnInsert` and `upsert` are true, mongoose will apply the [defaults](https://mongoosejs.com/docs/defaults.html) specified in the model's schema if a new document is created. + * - `rawResult`: if true, returns the [raw result from the MongoDB driver](https://mongodb.github.io/node-mongodb-native/4.3/interfaces/ModifyResult.html) + * + * #### Callback Signature + * function(error, doc) { + * // error: any errors that occurred + * // doc: the document before updates are applied if `new: false`, or after updates if `new = true` + * } + * + * #### Examples + * + * query.findOneAndUpdate(conditions, update, options, callback) // executes + * query.findOneAndUpdate(conditions, update, options) // returns Query + * query.findOneAndUpdate(conditions, update, callback) // executes + * query.findOneAndUpdate(conditions, update) // returns Query + * query.findOneAndUpdate(update, callback) // returns Query + * query.findOneAndUpdate(update) // returns Query + * query.findOneAndUpdate(callback) // executes + * query.findOneAndUpdate() // returns Query + * + * @method findOneAndUpdate + * @memberOf Query + * @instance + * @param {Object|Query} [filter] + * @param {Object} [doc] + * @param {Object} [options] + * @param {Boolean} [options.rawResult] if true, returns the [raw result from the MongoDB driver](https://mongodb.github.io/node-mongodb-native/4.3/interfaces/ModifyResult.html) + * @param {Boolean|String} [options.strict] overwrites the schema's [strict mode option](https://mongoosejs.com/docs/guide.html#strict) + * @param {ClientSession} [options.session=null] The session associated with this query. See [transactions docs](/docs/transactions.html). + * @param {Boolean} [options.multipleCastError] by default, mongoose only returns the first error that occurred in casting the query. Turn on this option to aggregate all the cast errors. + * @param {Boolean} [options.new=false] By default, `findOneAndUpdate()` returns the document as it was **before** `update` was applied. If you set `new: true`, `findOneAndUpdate()` will instead give you the object after `update` was applied. + * @param {Object} [options.lean] if truthy, mongoose will return the document as a plain JavaScript object rather than a mongoose document. See [`Query.lean()`](/docs/api.html#query_Query-lean) and [the Mongoose lean tutorial](/docs/tutorials/lean.html). + * @param {ClientSession} [options.session=null] The session associated with this query. See [transactions docs](/docs/transactions.html). + * @param {Boolean|String} [options.strict] overwrites the schema's [strict mode option](https://mongoosejs.com/docs/guide.html#strict) + * @param {Boolean} [options.timestamps=null] If set to `false` and [schema-level timestamps](/docs/guide.html#timestamps) are enabled, skip timestamps for this update. Note that this allows you to overwrite timestamps. Does nothing if schema-level timestamps are not set. + * @param {Boolean} [options.returnOriginal=null] An alias for the `new` option. `returnOriginal: false` is equivalent to `new: true`. + * @param {Function} [callback] optional params are (error, doc), _unless_ `rawResult` is used, in which case params are (error, writeOpResult) + * @see Tutorial /docs/tutorials/findoneandupdate.html + * @see mongodb https://www.mongodb.org/display/DOCS/findAndModify+Command + * @see writeOpResult https://mongodb.github.io/node-mongodb-native/2.2/api/Collection.html#~WriteOpResult + * @return {Query} this + * @api public + */ + +Query.prototype.findOneAndUpdate = function(criteria, doc, options, callback) { + this.op = 'findOneAndUpdate'; + this._validateOp(); + this._validate(); + + switch (arguments.length) { + case 3: + if (typeof options === 'function') { + callback = options; + options = {}; + } + break; + case 2: + if (typeof doc === 'function') { + callback = doc; + doc = criteria; + criteria = undefined; + } + options = undefined; + break; + case 1: + if (typeof criteria === 'function') { + callback = criteria; + criteria = options = doc = undefined; + } else { + doc = criteria; + criteria = options = undefined; + } + } + + if (mquery.canMerge(criteria)) { + this.merge(criteria); + } + + // apply doc + if (doc) { + this._mergeUpdate(doc); + } + + options = options ? utils.clone(options) : {}; + + if (options.projection) { + this.select(options.projection); + delete options.projection; + } + if (options.fields) { + this.select(options.fields); + delete options.fields; + } + + const returnOriginal = this && + this.model && + this.model.base && + this.model.base.options && + this.model.base.options.returnOriginal; + if (options.new == null && options.returnDocument == null && options.returnOriginal == null && returnOriginal != null) { + options.returnOriginal = returnOriginal; + } + + this.setOptions(options); + + if (!callback) { + return this; + } + + this.exec(callback); + + return this; +}; + +/*! + * Thunk around findOneAndUpdate() + * + * @param {Function} [callback] + * @api private + */ + +Query.prototype._findOneAndUpdate = wrapThunk(function(callback) { + if (this.error() != null) { + return callback(this.error()); + } + + this._findAndModify('update', callback); +}); + +/** + * Issues a mongodb [findAndModify](https://www.mongodb.org/display/DOCS/findAndModify+Command) remove command. + * + * Finds a matching document, removes it, passing the found document (if any) to + * the callback. Executes if `callback` is passed. + * + * This function triggers the following middleware. + * + * - `findOneAndRemove()` + * + * #### Available options + * + * - `sort`: if multiple docs are found by the conditions, sets the sort order to choose which doc to update + * - `maxTimeMS`: puts a time limit on the query - requires mongodb >= 2.6.0 + * - `rawResult`: if true, resolves to the [raw result from the MongoDB driver](https://mongodb.github.io/node-mongodb-native/4.3/interfaces/ModifyResult.html) + * + * #### Callback Signature + * function(error, doc) { + * // error: any errors that occurred + * // doc: the document before updates are applied if `new: false`, or after updates if `new = true` + * } + * + * #### Examples + * + * A.where().findOneAndRemove(conditions, options, callback) // executes + * A.where().findOneAndRemove(conditions, options) // return Query + * A.where().findOneAndRemove(conditions, callback) // executes + * A.where().findOneAndRemove(conditions) // returns Query + * A.where().findOneAndRemove(callback) // executes + * A.where().findOneAndRemove() // returns Query + * + * @method findOneAndRemove + * @memberOf Query + * @instance + * @param {Object} [conditions] + * @param {Object} [options] + * @param {Boolean} [options.rawResult] if true, returns the [raw result from the MongoDB driver](https://mongodb.github.io/node-mongodb-native/4.3/interfaces/ModifyResult.html) + * @param {ClientSession} [options.session=null] The session associated with this query. See [transactions docs](/docs/transactions.html). + * @param {Boolean|String} [options.strict] overwrites the schema's [strict mode option](https://mongoosejs.com/docs/guide.html#strict) + * @param {Function} [callback] optional params are (error, document) + * @return {Query} this + * @see mongodb https://www.mongodb.org/display/DOCS/findAndModify+Command + * @api public + */ + +Query.prototype.findOneAndRemove = function(conditions, options, callback) { + this.op = 'findOneAndRemove'; + this._validateOp(); + this._validate(); + + switch (arguments.length) { + case 2: + if (typeof options === 'function') { + callback = options; + options = {}; + } + break; + case 1: + if (typeof conditions === 'function') { + callback = conditions; + conditions = undefined; + options = undefined; + } + break; + } + + if (mquery.canMerge(conditions)) { + this.merge(conditions); + } + + options && this.setOptions(options); + + if (!callback) { + return this; + } + + this.exec(callback); + + return this; +}; + +/** + * Issues a MongoDB [findOneAndDelete](https://docs.mongodb.com/manual/reference/method/db.collection.findOneAndDelete/) command. + * + * Finds a matching document, removes it, and passes the found document (if any) + * to the callback. Executes if `callback` is passed. + * + * This function triggers the following middleware. + * + * - `findOneAndDelete()` + * + * This function differs slightly from `Model.findOneAndRemove()` in that + * `findOneAndRemove()` becomes a [MongoDB `findAndModify()` command](https://docs.mongodb.com/manual/reference/method/db.collection.findAndModify/), + * as opposed to a `findOneAndDelete()` command. For most mongoose use cases, + * this distinction is purely pedantic. You should use `findOneAndDelete()` + * unless you have a good reason not to. + * + * #### Available options + * + * - `sort`: if multiple docs are found by the conditions, sets the sort order to choose which doc to update + * - `maxTimeMS`: puts a time limit on the query - requires mongodb >= 2.6.0 + * - `rawResult`: if true, resolves to the [raw result from the MongoDB driver](https://mongodb.github.io/node-mongodb-native/4.3/interfaces/ModifyResult.html) + * + * #### Callback Signature + * function(error, doc) { + * // error: any errors that occurred + * // doc: the document before updates are applied if `new: false`, or after updates if `new = true` + * } + * + * #### Examples + * + * A.where().findOneAndDelete(conditions, options, callback) // executes + * A.where().findOneAndDelete(conditions, options) // return Query + * A.where().findOneAndDelete(conditions, callback) // executes + * A.where().findOneAndDelete(conditions) // returns Query + * A.where().findOneAndDelete(callback) // executes + * A.where().findOneAndDelete() // returns Query + * + * @method findOneAndDelete + * @memberOf Query + * @param {Object} [conditions] + * @param {Object} [options] + * @param {Boolean} [options.rawResult] if true, returns the [raw result from the MongoDB driver](https://mongodb.github.io/node-mongodb-native/4.3/interfaces/ModifyResult.html) + * @param {ClientSession} [options.session=null] The session associated with this query. See [transactions docs](/docs/transactions.html). + * @param {Boolean|String} [options.strict] overwrites the schema's [strict mode option](https://mongoosejs.com/docs/guide.html#strict) + * @param {Function} [callback] optional params are (error, document) + * @return {Query} this + * @see mongodb https://www.mongodb.org/display/DOCS/findAndModify+Command + * @api public + */ + +Query.prototype.findOneAndDelete = function(conditions, options, callback) { + this.op = 'findOneAndDelete'; + this._validateOp(); + this._validate(); + + switch (arguments.length) { + case 2: + if (typeof options === 'function') { + callback = options; + options = {}; + } + break; + case 1: + if (typeof conditions === 'function') { + callback = conditions; + conditions = undefined; + options = undefined; + } + break; + } + + if (mquery.canMerge(conditions)) { + this.merge(conditions); + } + + options && this.setOptions(options); + + if (!callback) { + return this; + } + + this.exec(callback); + + return this; +}; + +/*! + * Thunk around findOneAndDelete() + * + * @param {Function} [callback] + * @return {Query} this + * @api private + */ +Query.prototype._findOneAndDelete = wrapThunk(function(callback) { + this._castConditions(); + + if (this.error() != null) { + callback(this.error()); + return null; + } + + const filter = this._conditions; + const options = this._optionsForExec(); + let fields = null; + + if (this._fields != null) { + options.projection = this._castFields(utils.clone(this._fields)); + fields = options.projection; + if (fields instanceof Error) { + callback(fields); + return null; + } + } + + this._collection.collection.findOneAndDelete(filter, options, _wrapThunkCallback(this, (err, res) => { + if (err) { + return callback(err); + } + + const doc = res.value; + + return this._completeOne(doc, res, callback); + })); +}); + +/** + * Issues a MongoDB [findOneAndReplace](https://docs.mongodb.com/manual/reference/method/db.collection.findOneAndReplace/) command. + * + * Finds a matching document, removes it, and passes the found document (if any) + * to the callback. Executes if `callback` is passed. + * + * This function triggers the following middleware. + * + * - `findOneAndReplace()` + * + * #### Available options + * + * - `sort`: if multiple docs are found by the conditions, sets the sort order to choose which doc to update + * - `maxTimeMS`: puts a time limit on the query - requires mongodb >= 2.6.0 + * - `rawResult`: if true, resolves to the [raw result from the MongoDB driver](https://mongodb.github.io/node-mongodb-native/4.3/interfaces/ModifyResult.html) + * + * #### Callback Signature + * function(error, doc) { + * // error: any errors that occurred + * // doc: the document before updates are applied if `new: false`, or after updates if `new = true` + * } + * + * #### Examples + * + * A.where().findOneAndReplace(filter, replacement, options, callback); // executes + * A.where().findOneAndReplace(filter, replacement, options); // return Query + * A.where().findOneAndReplace(filter, replacement, callback); // executes + * A.where().findOneAndReplace(filter); // returns Query + * A.where().findOneAndReplace(callback); // executes + * A.where().findOneAndReplace(); // returns Query + * + * @method findOneAndReplace + * @memberOf Query + * @param {Object} [filter] + * @param {Object} [replacement] + * @param {Object} [options] + * @param {Boolean} [options.rawResult] if true, returns the [raw result from the MongoDB driver](https://mongodb.github.io/node-mongodb-native/4.3/interfaces/ModifyResult.html) + * @param {ClientSession} [options.session=null] The session associated with this query. See [transactions docs](/docs/transactions.html). + * @param {Boolean|String} [options.strict] overwrites the schema's [strict mode option](https://mongoosejs.com/docs/guide.html#strict) + * @param {Boolean} [options.new=false] By default, `findOneAndUpdate()` returns the document as it was **before** `update` was applied. If you set `new: true`, `findOneAndUpdate()` will instead give you the object after `update` was applied. + * @param {Object} [options.lean] if truthy, mongoose will return the document as a plain JavaScript object rather than a mongoose document. See [`Query.lean()`](/docs/api.html#query_Query-lean) and [the Mongoose lean tutorial](/docs/tutorials/lean.html). + * @param {ClientSession} [options.session=null] The session associated with this query. See [transactions docs](/docs/transactions.html). + * @param {Boolean|String} [options.strict] overwrites the schema's [strict mode option](https://mongoosejs.com/docs/guide.html#strict) + * @param {Boolean} [options.timestamps=null] If set to `false` and [schema-level timestamps](/docs/guide.html#timestamps) are enabled, skip timestamps for this update. Note that this allows you to overwrite timestamps. Does nothing if schema-level timestamps are not set. + * @param {Boolean} [options.returnOriginal=null] An alias for the `new` option. `returnOriginal: false` is equivalent to `new: true`. + * @param {Function} [callback] optional params are (error, document) + * @return {Query} this + * @api public + */ + +Query.prototype.findOneAndReplace = function(filter, replacement, options, callback) { + this.op = 'findOneAndReplace'; + this._validateOp(); + this._validate(); + + switch (arguments.length) { + case 3: + if (typeof options === 'function') { + callback = options; + options = void 0; + } + break; + case 2: + if (typeof replacement === 'function') { + callback = replacement; + replacement = void 0; + } + break; + case 1: + if (typeof filter === 'function') { + callback = filter; + filter = void 0; + replacement = void 0; + options = void 0; + } + break; + } + + if (mquery.canMerge(filter)) { + this.merge(filter); + } + + if (replacement != null) { + if (hasDollarKeys(replacement)) { + throw new Error('The replacement document must not contain atomic operators.'); + } + this._mergeUpdate(replacement); + } + + options = options || {}; + + const returnOriginal = this && + this.model && + this.model.base && + this.model.base.options && + this.model.base.options.returnOriginal; + if (options.new == null && options.returnDocument == null && options.returnOriginal == null && returnOriginal != null) { + options.returnOriginal = returnOriginal; + } + this.setOptions(options); + this.setOptions({ overwrite: true }); + + if (!callback) { + return this; + } + + this.exec(callback); + + return this; +}; + +/*! + * Thunk around findOneAndReplace() + * + * @param {Function} [callback] + * @return {Query} this + * @api private + */ +Query.prototype._findOneAndReplace = wrapThunk(function(callback) { + this._castConditions(); + if (this.error() != null) { + callback(this.error()); + return null; + } + + const filter = this._conditions; + const options = this._optionsForExec(); + convertNewToReturnDocument(options); + let fields = null; + + this._applyPaths(); + if (this._fields != null) { + options.projection = this._castFields(utils.clone(this._fields)); + fields = options.projection; + if (fields instanceof Error) { + callback(fields); + return null; + } + } + + const runValidators = _getOption(this, 'runValidators', false); + if (runValidators === false) { + try { + this._update = this._castUpdate(this._update, true); + } catch (err) { + const validationError = new ValidationError(); + validationError.errors[err.path] = err; + callback(validationError); + return null; + } + + this._collection.collection.findOneAndReplace(filter, this._update || {}, options, _wrapThunkCallback(this, (err, res) => { + if (err) { + return callback(err); + } + + const doc = res.value; + + return this._completeOne(doc, res, callback); + })); + + return; + } + + + let castedDoc = new this.model(this._update, null, true); + this._update = castedDoc; + castedDoc.validate(err => { + if (err != null) { + return callback(err); + } + + if (castedDoc.toBSON) { + castedDoc = castedDoc.toBSON(); + } + + this._collection.collection.findOneAndReplace(filter, castedDoc, options, _wrapThunkCallback(this, (err, res) => { + if (err) { + return callback(err); + } + + const doc = res.value; + + return this._completeOne(doc, res, callback); + })); + }); +}); + +/*! + * Support the `new` option as an alternative to `returnOriginal` for backwards + * compat. + */ + +function convertNewToReturnDocument(options) { + if ('new' in options) { + options.returnDocument = options['new'] ? 'after' : 'before'; + delete options['new']; + } + if ('returnOriginal' in options) { + options.returnDocument = options['returnOriginal'] ? 'before' : 'after'; + delete options['returnOriginal']; + } + // Temporary since driver 4.0.0-beta does not support `returnDocument` + if (typeof options.returnDocument === 'string') { + options.returnOriginal = options.returnDocument === 'before'; + } +} + +/*! + * Thunk around findOneAndRemove() + * + * @param {Function} [callback] + * @return {Query} this + * @api private + */ +Query.prototype._findOneAndRemove = wrapThunk(function(callback) { + if (this.error() != null) { + callback(this.error()); + return; + } + + this._findAndModify('remove', callback); +}); + +/*! + * Get options from query opts, falling back to the base mongoose object. + */ + +function _getOption(query, option, def) { + const opts = query._optionsForExec(query.model); + + if (option in opts) { + return opts[option]; + } + if (option in query.model.base.options) { + return query.model.base.options[option]; + } + return def; +} + +/*! + * Override mquery.prototype._findAndModify to provide casting etc. + * + * @param {String} type - either "remove" or "update" + * @param {Function} callback + * @api private + */ + +Query.prototype._findAndModify = function(type, callback) { + if (typeof callback !== 'function') { + throw new Error('Expected callback in _findAndModify'); + } + + const model = this.model; + const schema = model.schema; + const _this = this; + let fields; + + const castedQuery = castQuery(this); + if (castedQuery instanceof Error) { + return callback(castedQuery); + } + + _castArrayFilters(this); + + const opts = this._optionsForExec(model); + + if ('strict' in opts) { + this._mongooseOptions.strict = opts.strict; + } + + const isOverwriting = this.options.overwrite && !hasDollarKeys(this._update); + if (isOverwriting) { + this._update = new this.model(this._update, null, true); + } + + if (type === 'remove') { + opts.remove = true; + } else { + if (!('new' in opts) && !('returnOriginal' in opts) && !('returnDocument' in opts)) { + opts.new = false; + } + if (!('upsert' in opts)) { + opts.upsert = false; + } + if (opts.upsert || opts['new']) { + opts.remove = false; + } + + if (!isOverwriting) { + try { + this._update = this._castUpdate(this._update, opts.overwrite); + } catch (err) { + return callback(err); + } + const _opts = Object.assign({}, opts, { + setDefaultsOnInsert: this._mongooseOptions.setDefaultsOnInsert + }); + this._update = setDefaultsOnInsert(this._conditions, schema, this._update, _opts); + if (!this._update || Object.keys(this._update).length === 0) { + if (opts.upsert) { + // still need to do the upsert to empty doc + const doc = utils.clone(castedQuery); + delete doc._id; + this._update = { $set: doc }; + } else { + this._executionStack = null; + this.findOne(callback); + return this; + } + } else if (this._update instanceof Error) { + return callback(this._update); + } else { + // In order to make MongoDB 2.6 happy (see + // https://jira.mongodb.org/browse/SERVER-12266 and related issues) + // if we have an actual update document but $set is empty, junk the $set. + if (this._update.$set && Object.keys(this._update.$set).length === 0) { + delete this._update.$set; + } + } + } + + if (Array.isArray(opts.arrayFilters)) { + opts.arrayFilters = removeUnusedArrayFilters(this._update, opts.arrayFilters); + } + } + + this._applyPaths(); + + if (this._fields) { + fields = utils.clone(this._fields); + opts.projection = this._castFields(fields); + if (opts.projection instanceof Error) { + return callback(opts.projection); + } + } + + if (opts.sort) convertSortToArray(opts); + + const cb = function(err, doc, res) { + if (err) { + return callback(err); + } + + _this._completeOne(doc, res, callback); + }; + + const runValidators = _getOption(this, 'runValidators', false); + + // Bypass mquery + const collection = _this._collection.collection; + convertNewToReturnDocument(opts); + + if (type === 'remove') { + collection.findOneAndDelete(castedQuery, opts, _wrapThunkCallback(_this, function(error, res) { + return cb(error, res ? res.value : res, res); + })); + + return this; + } + + // honors legacy overwrite option for backward compatibility + const updateMethod = isOverwriting ? 'findOneAndReplace' : 'findOneAndUpdate'; + + if (runValidators) { + this.validate(this._update, opts, isOverwriting, error => { + if (error) { + return callback(error); + } + if (this._update && this._update.toBSON) { + this._update = this._update.toBSON(); + } + + collection[updateMethod](castedQuery, this._update, opts, _wrapThunkCallback(_this, function(error, res) { + return cb(error, res ? res.value : res, res); + })); + }); + } else { + if (this._update && this._update.toBSON) { + this._update = this._update.toBSON(); + } + collection[updateMethod](castedQuery, this._update, opts, _wrapThunkCallback(_this, function(error, res) { + return cb(error, res ? res.value : res, res); + })); + } + + return this; +}; + +/*! + * ignore + */ + +function _completeOneLean(schema, doc, path, res, opts, callback) { + if (opts.lean && opts.lean.transform) { + for (let i = 0; i < schema.childSchemas.length; i++) { + const childPath = path ? path + '.' + schema.childSchemas[i].model.path : schema.childSchemas[i].model.path; + const _schema = schema.childSchemas[i].schema; + const obj = mpath.get(childPath, doc); + if (obj == null) { + continue; + } + if (Array.isArray(obj)) { + for (let i = 0; i < obj.length; i++) { + opts.lean.transform(obj[i]); + } + } else { + opts.lean.transform(obj); + } + _completeOneLean(_schema, obj, childPath, res, opts); + } + if (callback) { + return callback(null, doc); + } else { + return; + } + } + if (opts.rawResult) { + return callback(null, res); + } + return callback(null, doc); +} + +/*! + * ignore + */ + +function _completeManyLean(schema, docs, path, opts, callback) { + if (opts.lean && opts.lean.transform) { + for (let i = 0; i < schema.childSchemas.length; i++) { + const childPath = path ? path + '.' + schema.childSchemas[i].model.path : schema.childSchemas[i].model.path; + const _schema = schema.childSchemas[i].schema; + let doc = mpath.get(childPath, docs); + if (doc == null) { + continue; + } + doc = doc.flat(); + for (let i = 0; i < doc.length; i++) { + opts.lean.transform(doc[i]); + } + _completeManyLean(_schema, doc, childPath, opts); + } + } + + if (!callback) { + return; + } + return callback(null, docs); +} +/*! + * Override mquery.prototype._mergeUpdate to handle mongoose objects in + * updates. + * + * @param {Object} doc + * @api private + */ + +Query.prototype._mergeUpdate = function(doc) { + if (doc == null || (typeof doc === 'object' && Object.keys(doc).length === 0)) { + return; + } + + if (!this._update) { + this._update = Array.isArray(doc) ? [] : {}; + } + if (doc instanceof Query) { + if (Array.isArray(this._update)) { + throw new Error('Cannot mix array and object updates'); + } + if (doc._update) { + utils.mergeClone(this._update, doc._update); + } + } else if (Array.isArray(doc)) { + if (!Array.isArray(this._update)) { + throw new Error('Cannot mix array and object updates'); + } + this._update = this._update.concat(doc); + } else { + if (Array.isArray(this._update)) { + throw new Error('Cannot mix array and object updates'); + } + utils.mergeClone(this._update, doc); + } +}; + +/*! + * The mongodb driver 1.3.23 only supports the nested array sort + * syntax. We must convert it or sorting findAndModify will not work. + */ + +function convertSortToArray(opts) { + if (Array.isArray(opts.sort)) { + return; + } + if (!utils.isObject(opts.sort)) { + return; + } + + const sort = []; + + for (const key in opts.sort) { + if (utils.object.hasOwnProperty(opts.sort, key)) { + sort.push([key, opts.sort[key]]); + } + } + + opts.sort = sort; +} + +/*! + * ignore + */ + +function _updateThunk(op, callback) { + this._castConditions(); + + _castArrayFilters(this); + + if (this.error() != null) { + callback(this.error()); + return null; + } + + callback = _wrapThunkCallback(this, callback); + + const castedQuery = this._conditions; + const options = this._optionsForExec(this.model); + + this._update = utils.clone(this._update, options); + const isOverwriting = this.options.overwrite && !hasDollarKeys(this._update); + if (isOverwriting) { + if (op === 'updateOne' || op === 'updateMany') { + return callback(new MongooseError('The MongoDB server disallows ' + + 'overwriting documents using `' + op + '`. See: ' + + 'https://mongoosejs.com/docs/deprecations.html#update')); + } + this._update = new this.model(this._update, null, true); + } else { + try { + this._update = this._castUpdate(this._update, options.overwrite); + } catch (err) { + callback(err); + return null; + } + + if (this._update == null || Object.keys(this._update).length === 0) { + callback(null, { acknowledged: false }); + return null; + } + + const _opts = Object.assign({}, options, { + setDefaultsOnInsert: this._mongooseOptions.setDefaultsOnInsert + }); + this._update = setDefaultsOnInsert(this._conditions, this.model.schema, + this._update, _opts); + } + + if (Array.isArray(options.arrayFilters)) { + options.arrayFilters = removeUnusedArrayFilters(this._update, options.arrayFilters); + } + + const runValidators = _getOption(this, 'runValidators', false); + if (runValidators) { + this.validate(this._update, options, isOverwriting, err => { + if (err) { + return callback(err); + } + + if (this._update.toBSON) { + this._update = this._update.toBSON(); + } + this._collection[op](castedQuery, this._update, options, callback); + }); + return null; + } + + if (this._update.toBSON) { + this._update = this._update.toBSON(); + } + + this._collection[op](castedQuery, this._update, options, callback); + return null; +} + +/*! + * Mongoose calls this function internally to validate the query if + * `runValidators` is set + * + * @param {Object} castedDoc the update, after casting + * @param {Object} options the options from `_optionsForExec()` + * @param {Function} callback + * @api private + */ + +Query.prototype.validate = function validate(castedDoc, options, isOverwriting, callback) { + return promiseOrCallback(callback, cb => { + try { + if (isOverwriting) { + castedDoc.$validate(cb); + } else { + updateValidators(this, this.model.schema, castedDoc, options, cb); + } + } catch (err) { + immediate(function() { + cb(err); + }); + } + }); +}; + +/*! + * Internal thunk for .update() + * + * @param {Function} callback + * @see Model.update #model_Model.update + * @api private + */ +Query.prototype._execUpdate = wrapThunk(function(callback) { + return _updateThunk.call(this, 'update', callback); +}); + +/*! + * Internal thunk for .updateMany() + * + * @param {Function} callback + * @see Model.update #model_Model.update + * @api private + */ +Query.prototype._updateMany = wrapThunk(function(callback) { + return _updateThunk.call(this, 'updateMany', callback); +}); + +/*! + * Internal thunk for .updateOne() + * + * @param {Function} callback + * @see Model.update #model_Model.update + * @api private + */ +Query.prototype._updateOne = wrapThunk(function(callback) { + return _updateThunk.call(this, 'updateOne', callback); +}); + +/*! + * Internal thunk for .replaceOne() + * + * @param {Function} callback + * @see Model.replaceOne #model_Model.replaceOne + * @api private + */ +Query.prototype._replaceOne = wrapThunk(function(callback) { + return _updateThunk.call(this, 'replaceOne', callback); +}); + +/** + * Declare and/or execute this query as an update() operation. + * + * _All paths passed that are not [atomic](https://docs.mongodb.com/manual/tutorial/model-data-for-atomic-operations/#pattern) operations will become `$set` ops._ + * + * This function triggers the following middleware. + * + * - `update()` + * + * #### Example + * + * Model.where({ _id: id }).update({ title: 'words' }); + * + * // becomes + * + * Model.where({ _id: id }).update({ $set: { title: 'words' }}); + * + * #### Valid options: + * + * - `upsert` (boolean) whether to create the doc if it doesn't match (false) + * - `multi` (boolean) whether multiple documents should be updated (false) + * - `runValidators` (boolean) if true, runs [update validators](/docs/validation.html#update-validators) on this command. Update validators validate the update operation against the model's schema. + * - `setDefaultsOnInsert` (boolean) `true` by default. If `setDefaultsOnInsert` and `upsert` are true, mongoose will apply the [defaults](https://mongoosejs.com/docs/defaults.html) specified in the model's schema if a new document is created. + * - `strict` (boolean) overrides the `strict` option for this update + * - `read` + * - `writeConcern` + * + * #### Note + * + * Passing an empty object `{}` as the doc will result in a no-op. The update operation will be ignored and the callback executed without sending the command to MongoDB. + * + * #### Note + * + * The operation is only executed when a callback is passed. To force execution without a callback, we must first call update() and then execute it by using the `exec()` method. + * + * ```javascript + * const q = Model.where({ _id: id }); + * q.update({ $set: { name: 'bob' }}).update(); // not executed + * + * q.update({ $set: { name: 'bob' }}).exec(); // executed + * + * // keys that are not [atomic](https://docs.mongodb.com/manual/tutorial/model-data-for-atomic-operations/#pattern) ops become `$set`. + * // this executes the same command as the previous example. + * q.update({ name: 'bob' }).exec(); + * + * // multi updates + * Model.where() + * .update({ name: /^match/ }, { $set: { arr: [] }}, { multi: true }, callback) + * + * // more multi updates + * Model.where() + * .setOptions({ multi: true }) + * .update({ $set: { arr: [] }}, callback) + * + * // single update by default + * Model.where({ email: 'address@example.com' }) + * .update({ $inc: { counter: 1 }}, callback) + * ``` + * + * API summary + * + * ```javascript + * update(filter, doc, options, cb); // executes + * update(filter, doc, options); + * update(filter, doc, cb); // executes + * update(filter, doc); + * update(doc, cb); // executes + * update(doc); + * update(cb); // executes + * update(true); // executes + * update(); + * ``` + * + * @param {Object} [filter] + * @param {Object} [doc] the update command + * @param {Object} [options] + * @param {Boolean} [options.multipleCastError] by default, mongoose only returns the first error that occurred in casting the query. Turn on this option to aggregate all the cast errors. + * @param {Boolean|String} [options.strict] overwrites the schema's [strict mode option](https://mongoosejs.com/docs/guide.html#strict) + * @param {Boolean} [options.upsert=false] if true, and no documents found, insert a new document + * @param {Object} [options.writeConcern=null] sets the [write concern](https://docs.mongodb.com/manual/reference/write-concern/) for replica sets. Overrides the [schema-level write concern](/docs/guide.html#writeConcern) + * @param {Boolean} [options.timestamps=null] If set to `false` and [schema-level timestamps](/docs/guide.html#timestamps) are enabled, skip timestamps for this update. Does nothing if schema-level timestamps are not set. + * @param {Function} [callback] params are (error, writeOpResult) + * @return {Query} this + * @see Model.update #model_Model.update + * @see Query docs https://mongoosejs.com/docs/queries.html + * @see update https://docs.mongodb.org/manual/reference/method/db.collection.update/ + * @see writeOpResult https://mongodb.github.io/node-mongodb-native/2.2/api/Collection.html#~WriteOpResult + * @see MongoDB docs https://docs.mongodb.com/manual/reference/command/update/#update-command-output + * @api public + */ + +Query.prototype.update = function(conditions, doc, options, callback) { + if (typeof options === 'function') { + // .update(conditions, doc, callback) + callback = options; + options = null; + } else if (typeof doc === 'function') { + // .update(doc, callback); + callback = doc; + doc = conditions; + conditions = {}; + options = null; + } else if (typeof conditions === 'function') { + // .update(callback) + callback = conditions; + conditions = undefined; + doc = undefined; + options = undefined; + } else if (typeof conditions === 'object' && !doc && !options && !callback) { + // .update(doc) + doc = conditions; + conditions = undefined; + options = undefined; + callback = undefined; + } + + return _update(this, 'update', conditions, doc, options, callback); +}; + +/** + * Declare and/or execute this query as an updateMany() operation. Same as + * `update()`, except MongoDB will update _all_ documents that match + * `filter` (as opposed to just the first one) regardless of the value of + * the `multi` option. + * + * **Note** updateMany will _not_ fire update middleware. Use `pre('updateMany')` + * and `post('updateMany')` instead. + * + * #### Example: + * const res = await Person.updateMany({ name: /Stark$/ }, { isDeleted: true }); + * res.n; // Number of documents matched + * res.nModified; // Number of documents modified + * + * This function triggers the following middleware. + * + * - `updateMany()` + * + * @param {Object} [filter] + * @param {Object|Array} [update] the update command + * @param {Object} [options] + * @param {Boolean} [options.multipleCastError] by default, mongoose only returns the first error that occurred in casting the query. Turn on this option to aggregate all the cast errors. + * @param {Boolean|String} [options.strict] overwrites the schema's [strict mode option](https://mongoosejs.com/docs/guide.html#strict) + * @param {Boolean} [options.upsert=false] if true, and no documents found, insert a new document + * @param {Object} [options.writeConcern=null] sets the [write concern](https://docs.mongodb.com/manual/reference/write-concern/) for replica sets. Overrides the [schema-level write concern](/docs/guide.html#writeConcern) + * @param {Boolean} [options.timestamps=null] If set to `false` and [schema-level timestamps](/docs/guide.html#timestamps) are enabled, skip timestamps for this update. Does nothing if schema-level timestamps are not set. + * @param {Function} [callback] params are (error, writeOpResult) + * @return {Query} this + * @see Model.update #model_Model.update + * @see Query docs https://mongoosejs.com/docs/queries.html + * @see update https://docs.mongodb.org/manual/reference/method/db.collection.update/ + * @see writeOpResult https://mongodb.github.io/node-mongodb-native/2.2/api/Collection.html#~WriteOpResult + * @see MongoDB docs https://docs.mongodb.com/manual/reference/command/update/#update-command-output + * @api public + */ + +Query.prototype.updateMany = function(conditions, doc, options, callback) { + if (typeof options === 'function') { + // .update(conditions, doc, callback) + callback = options; + options = null; + } else if (typeof doc === 'function') { + // .update(doc, callback); + callback = doc; + doc = conditions; + conditions = {}; + options = null; + } else if (typeof conditions === 'function') { + // .update(callback) + callback = conditions; + conditions = undefined; + doc = undefined; + options = undefined; + } else if (typeof conditions === 'object' && !doc && !options && !callback) { + // .update(doc) + doc = conditions; + conditions = undefined; + options = undefined; + callback = undefined; + } + + return _update(this, 'updateMany', conditions, doc, options, callback); +}; + +/** + * Declare and/or execute this query as an updateOne() operation. Same as + * `update()`, except it does not support the `multi` option. + * + * - MongoDB will update _only_ the first document that matches `filter` regardless of the value of the `multi` option. + * - Use `replaceOne()` if you want to overwrite an entire document rather than using [atomic](https://docs.mongodb.com/manual/tutorial/model-data-for-atomic-operations/#pattern) operators like `$set`. + * + * **Note** updateOne will _not_ fire update middleware. Use `pre('updateOne')` + * and `post('updateOne')` instead. + * + * #### Example: + * const res = await Person.updateOne({ name: 'Jean-Luc Picard' }, { ship: 'USS Enterprise' }); + * res.n; // Number of documents matched + * res.nModified; // Number of documents modified + * + * This function triggers the following middleware. + * + * - `updateOne()` + * + * @param {Object} [filter] + * @param {Object|Array} [update] the update command + * @param {Object} [options] + * @param {Boolean} [options.multipleCastError] by default, mongoose only returns the first error that occurred in casting the query. Turn on this option to aggregate all the cast errors. + * @param {Boolean|String} [options.strict] overwrites the schema's [strict mode option](https://mongoosejs.com/docs/guide.html#strict) + * @param {Boolean} [options.upsert=false] if true, and no documents found, insert a new document + * @param {Object} [options.writeConcern=null] sets the [write concern](https://docs.mongodb.com/manual/reference/write-concern/) for replica sets. Overrides the [schema-level write concern](/docs/guide.html#writeConcern) + * @param {Boolean} [options.timestamps=null] If set to `false` and [schema-level timestamps](/docs/guide.html#timestamps) are enabled, skip timestamps for this update. Note that this allows you to overwrite timestamps. Does nothing if schema-level timestamps are not set. + * @param {Function} [callback] params are (error, writeOpResult) + * @return {Query} this + * @see Model.update #model_Model.update + * @see Query docs https://mongoosejs.com/docs/queries.html + * @see update https://docs.mongodb.org/manual/reference/method/db.collection.update/ + * @see writeOpResult https://mongodb.github.io/node-mongodb-native/2.2/api/Collection.html#~WriteOpResult + * @see MongoDB docs https://docs.mongodb.com/manual/reference/command/update/#update-command-output + * @api public + */ + +Query.prototype.updateOne = function(conditions, doc, options, callback) { + if (typeof options === 'function') { + // .update(conditions, doc, callback) + callback = options; + options = null; + } else if (typeof doc === 'function') { + // .update(doc, callback); + callback = doc; + doc = conditions; + conditions = {}; + options = null; + } else if (typeof conditions === 'function') { + // .update(callback) + callback = conditions; + conditions = undefined; + doc = undefined; + options = undefined; + } else if (typeof conditions === 'object' && !doc && !options && !callback) { + // .update(doc) + doc = conditions; + conditions = undefined; + options = undefined; + callback = undefined; + } + + return _update(this, 'updateOne', conditions, doc, options, callback); +}; + +/** + * Declare and/or execute this query as a replaceOne() operation. Same as + * `update()`, except MongoDB will replace the existing document and will + * not accept any [atomic](https://docs.mongodb.com/manual/tutorial/model-data-for-atomic-operations/#pattern) operators (`$set`, etc.) + * + * **Note** replaceOne will _not_ fire update middleware. Use `pre('replaceOne')` + * and `post('replaceOne')` instead. + * + * #### Example: + * const res = await Person.replaceOne({ _id: 24601 }, { name: 'Jean Valjean' }); + * res.n; // Number of documents matched + * res.nModified; // Number of documents modified + * + * This function triggers the following middleware. + * + * - `replaceOne()` + * + * @param {Object} [filter] + * @param {Object} [doc] the update command + * @param {Object} [options] + * @param {Boolean} [options.multipleCastError] by default, mongoose only returns the first error that occurred in casting the query. Turn on this option to aggregate all the cast errors. + * @param {Boolean|String} [options.strict] overwrites the schema's [strict mode option](https://mongoosejs.com/docs/guide.html#strict) + * @param {Boolean} [options.upsert=false] if true, and no documents found, insert a new document + * @param {Object} [options.writeConcern=null] sets the [write concern](https://docs.mongodb.com/manual/reference/write-concern/) for replica sets. Overrides the [schema-level write concern](/docs/guide.html#writeConcern) + * @param {Boolean} [options.timestamps=null] If set to `false` and [schema-level timestamps](/docs/guide.html#timestamps) are enabled, skip timestamps for this update. Does nothing if schema-level timestamps are not set. + * @param {Function} [callback] params are (error, writeOpResult) + * @return {Query} this + * @see Model.update #model_Model.update + * @see Query docs https://mongoosejs.com/docs/queries.html + * @see update https://docs.mongodb.org/manual/reference/method/db.collection.update/ + * @see writeOpResult https://mongodb.github.io/node-mongodb-native/2.2/api/Collection.html#~WriteOpResult + * @see MongoDB docs https://docs.mongodb.com/manual/reference/command/update/#update-command-output + * @api public + */ + +Query.prototype.replaceOne = function(conditions, doc, options, callback) { + if (typeof options === 'function') { + // .update(conditions, doc, callback) + callback = options; + options = null; + } else if (typeof doc === 'function') { + // .update(doc, callback); + callback = doc; + doc = conditions; + conditions = {}; + options = null; + } else if (typeof conditions === 'function') { + // .update(callback) + callback = conditions; + conditions = undefined; + doc = undefined; + options = undefined; + } else if (typeof conditions === 'object' && !doc && !options && !callback) { + // .update(doc) + doc = conditions; + conditions = undefined; + options = undefined; + callback = undefined; + } + + this.setOptions({ overwrite: true }); + return _update(this, 'replaceOne', conditions, doc, options, callback); +}; + +/*! + * Internal helper for update, updateMany, updateOne, replaceOne + */ + +function _update(query, op, filter, doc, options, callback) { + // make sure we don't send in the whole Document to merge() + query.op = op; + query._validateOp(); + filter = utils.toObject(filter); + doc = doc || {}; + + // strict is an option used in the update checking, make sure it gets set + if (options != null) { + if ('strict' in options) { + query._mongooseOptions.strict = options.strict; + } + } + + if (!(filter instanceof Query) && + filter != null && + filter.toString() !== '[object Object]') { + query.error(new ObjectParameterError(filter, 'filter', op)); + } else { + query.merge(filter); + } + + if (utils.isObject(options)) { + query.setOptions(options); + } + + query._mergeUpdate(doc); + + // Hooks + if (callback) { + query.exec(callback); + + return query; + } + + return Query.base[op].call(query, filter, void 0, options, callback); +} + +/** + * Runs a function `fn` and treats the return value of `fn` as the new value + * for the query to resolve to. + * + * Any functions you pass to `transform()` will run **after** any post hooks. + * + * #### Example: + * + * const res = await MyModel.findOne().transform(res => { + * // Sets a `loadedAt` property on the doc that tells you the time the + * // document was loaded. + * return res == null ? + * res : + * Object.assign(res, { loadedAt: new Date() }); + * }); + * + * @method transform + * @memberOf Query + * @instance + * @param {Function} fn function to run to transform the query result + * @return {Query} this + */ + +Query.prototype.transform = function(fn) { + this._transforms.push(fn); + return this; +}; + +/** + * Make this query throw an error if no documents match the given `filter`. + * This is handy for integrating with async/await, because `orFail()` saves you + * an extra `if` statement to check if no document was found. + * + * #### Example: + * + * // Throws if no doc returned + * await Model.findOne({ foo: 'bar' }).orFail(); + * + * // Throws if no document was updated. Note that `orFail()` will still + * // throw if the only document that matches is `{ foo: 'bar', name: 'test' }`, + * // because `orFail()` will throw if no document was _updated_, not + * // if no document was _found_. + * await Model.updateOne({ foo: 'bar' }, { name: 'test' }).orFail(); + * + * // Throws "No docs found!" error if no docs match `{ foo: 'bar' }` + * await Model.find({ foo: 'bar' }).orFail(new Error('No docs found!')); + * + * // Throws "Not found" error if no document was found + * await Model.findOneAndUpdate({ foo: 'bar' }, { name: 'test' }). + * orFail(() => Error('Not found')); + * + * @method orFail + * @memberOf Query + * @instance + * @param {Function|Error} [err] optional error to throw if no docs match `filter`. If not specified, `orFail()` will throw a `DocumentNotFoundError` + * @return {Query} this + */ + +Query.prototype.orFail = function(err) { + this.transform(res => { + switch (this.op) { + case 'find': + if (res.length === 0) { + throw _orFailError(err, this); + } + break; + case 'findOne': + if (res == null) { + throw _orFailError(err, this); + } + break; + case 'replaceOne': + case 'update': + case 'updateMany': + case 'updateOne': + if (res && res.modifiedCount === 0) { + throw _orFailError(err, this); + } + break; + case 'findOneAndDelete': + case 'findOneAndRemove': + if ((res && res.lastErrorObject && res.lastErrorObject.n) === 0) { + throw _orFailError(err, this); + } + break; + case 'findOneAndUpdate': + case 'findOneAndReplace': + if ((res && res.lastErrorObject && res.lastErrorObject.updatedExisting) === false) { + throw _orFailError(err, this); + } + break; + case 'deleteMany': + case 'deleteOne': + case 'remove': + if (res.deletedCount === 0) { + throw _orFailError(err, this); + } + break; + default: + break; + } + + return res; + }); + return this; +}; + +/*! + * Get the error to throw for `orFail()` + */ + +function _orFailError(err, query) { + if (typeof err === 'function') { + err = err.call(query); + } + + if (err == null) { + err = new DocumentNotFoundError(query.getQuery(), query.model.modelName); + } + + return err; +} + +/** + * Executes the query + * + * #### Examples: + * + * const promise = query.exec(); + * const promise = query.exec('update'); + * + * query.exec(callback); + * query.exec('find', callback); + * + * @param {String|Function} [operation] + * @param {Function} [callback] optional params depend on the function being called + * @return {Promise} + * @api public + */ + +Query.prototype.exec = function exec(op, callback) { + const _this = this; + // Ensure that `exec()` is the first thing that shows up in + // the stack when cast errors happen. + const castError = new CastError(); + + if (typeof op === 'function') { + callback = op; + op = null; + } else if (typeof op === 'string') { + this.op = op; + } + + if (this.op == null) { + throw new Error('Query must have `op` before executing'); + } + this._validateOp(); + + callback = this.model.$handleCallbackError(callback); + + return promiseOrCallback(callback, (cb) => { + cb = this.model.$wrapCallback(cb); + + if (!_this.op) { + cb(); + return; + } + + this._hooks.execPre('exec', this, [], (error) => { + if (error != null) { + return cb(_cleanCastErrorStack(castError, error)); + } + let thunk = '_' + this.op; + if (this.op === 'update') { + thunk = '_execUpdate'; + } else if (this.op === 'distinct') { + thunk = '__distinct'; + } + this[thunk].call(this, (error, res) => { + if (error) { + return cb(_cleanCastErrorStack(castError, error)); + } + + this._hooks.execPost('exec', this, [], {}, (error) => { + if (error) { + return cb(_cleanCastErrorStack(castError, error)); + } + + cb(null, res); + }); + }); + }); + }, this.model.events); +}; + +/*! + * ignore + */ + +function _cleanCastErrorStack(castError, error) { + if (error instanceof CastError) { + castError.copy(error); + return castError; + } + + return error; +} + +/*! + * ignore + */ + +function _wrapThunkCallback(query, cb) { + return function(error, res) { + if (error != null) { + return cb(error); + } + + for (const fn of query._transforms) { + try { + res = fn(res); + } catch (error) { + return cb(error); + } + } + + return cb(null, res); + }; +} + +/** + * Executes the query returning a `Promise` which will be + * resolved with either the doc(s) or rejected with the error. + * + * More about [`then()` in JavaScript](https://masteringjs.io/tutorials/fundamentals/then). + * + * @param {Function} [resolve] + * @param {Function} [reject] + * @return {Promise} + * @api public + */ + +Query.prototype.then = function(resolve, reject) { + return this.exec().then(resolve, reject); +}; + +/** + * Executes the query returning a `Promise` which will be + * resolved with either the doc(s) or rejected with the error. + * Like `.then()`, but only takes a rejection handler. + * + * More about [Promise `catch()` in JavaScript](https://masteringjs.io/tutorials/fundamentals/catch). + * + * @param {Function} [reject] + * @return {Promise} + * @api public + */ + +Query.prototype.catch = function(reject) { + return this.exec().then(null, reject); +}; + +/** + * Add pre [middleware](/docs/middleware.html) to this query instance. Doesn't affect + * other queries. + * + * #### Example: + * + * const q1 = Question.find({ answer: 42 }); + * q1.pre(function middleware() { + * console.log(this.getFilter()); + * }); + * await q1.exec(); // Prints "{ answer: 42 }" + * + * // Doesn't print anything, because `middleware()` is only + * // registered on `q1`. + * await Question.find({ answer: 42 }); + * + * @param {Function} fn + * @return {Promise} + * @api public + */ + +Query.prototype.pre = function(fn) { + this._hooks.pre('exec', fn); + return this; +}; + +/** + * Add post [middleware](/docs/middleware.html) to this query instance. Doesn't affect + * other queries. + * + * #### Example: + * + * const q1 = Question.find({ answer: 42 }); + * q1.post(function middleware() { + * console.log(this.getFilter()); + * }); + * await q1.exec(); // Prints "{ answer: 42 }" + * + * // Doesn't print anything, because `middleware()` is only + * // registered on `q1`. + * await Question.find({ answer: 42 }); + * + * @param {Function} fn + * @return {Promise} + * @api public + */ + +Query.prototype.post = function(fn) { + this._hooks.post('exec', fn); + return this; +}; + +/*! + * Casts obj for an update command. + * + * @param {Object} obj + * @return {Object} obj after casting its values + * @api private + */ + +Query.prototype._castUpdate = function _castUpdate(obj, overwrite) { + let schema = this.schema; + + const discriminatorKey = schema.options.discriminatorKey; + const baseSchema = schema._baseSchema ? schema._baseSchema : schema; + if (this._mongooseOptions.overwriteDiscriminatorKey && + obj[discriminatorKey] != null && + baseSchema.discriminators) { + const _schema = baseSchema.discriminators[obj[discriminatorKey]]; + if (_schema != null) { + schema = _schema; + } + } + + let upsert; + if ('upsert' in this.options) { + upsert = this.options.upsert; + } + + const filter = this._conditions; + if (schema != null && + utils.hasUserDefinedProperty(filter, schema.options.discriminatorKey) && + typeof filter[schema.options.discriminatorKey] !== 'object' && + schema.discriminators != null) { + const discriminatorValue = filter[schema.options.discriminatorKey]; + const byValue = getDiscriminatorByValue(this.model.discriminators, discriminatorValue); + schema = schema.discriminators[discriminatorValue] || + (byValue && byValue.schema) || + schema; + } + + return castUpdate(schema, obj, { + overwrite: overwrite, + strict: this._mongooseOptions.strict, + upsert: upsert, + arrayFilters: this.options.arrayFilters, + overwriteDiscriminatorKey: this._mongooseOptions.overwriteDiscriminatorKey + }, this, this._conditions); +}; + +/*! + * castQuery + * @api private + */ + +function castQuery(query) { + try { + return query.cast(query.model); + } catch (err) { + return err; + } +} + +/** + * Specifies paths which should be populated with other documents. + * + * #### Example: + * + * let book = await Book.findOne().populate('authors'); + * book.title; // 'Node.js in Action' + * book.authors[0].name; // 'TJ Holowaychuk' + * book.authors[1].name; // 'Nathan Rajlich' + * + * let books = await Book.find().populate({ + * path: 'authors', + * // `match` and `sort` apply to the Author model, + * // not the Book model. These options do not affect + * // which documents are in `books`, just the order and + * // contents of each book document's `authors`. + * match: { name: new RegExp('.*h.*', 'i') }, + * sort: { name: -1 } + * }); + * books[0].title; // 'Node.js in Action' + * // Each book's `authors` are sorted by name, descending. + * books[0].authors[0].name; // 'TJ Holowaychuk' + * books[0].authors[1].name; // 'Marc Harter' + * + * books[1].title; // 'Professional AngularJS' + * // Empty array, no authors' name has the letter 'h' + * books[1].authors; // [] + * + * Paths are populated after the query executes and a response is received. A + * separate query is then executed for each path specified for population. After + * a response for each query has also been returned, the results are passed to + * the callback. + * + * @param {Object|String|Array} path either the path(s) to populate or an object specifying all parameters + * @param {Object|String} [select] Field selection for the population query + * @param {Model} [model] The model you wish to use for population. If not specified, populate will look up the model by the name in the Schema's `ref` field. + * @param {Object} [match] Conditions for the population query + * @param {Object} [options] Options for the population query (sort, etc) + * @param {String} [options.path=null] The path to populate. + * @param {boolean} [options.retainNullValues=false] by default, Mongoose removes null and undefined values from populated arrays. Use this option to make `populate()` retain `null` and `undefined` array entries. + * @param {boolean} [options.getters=false] if true, Mongoose will call any getters defined on the `localField`. By default, Mongoose gets the raw value of `localField`. For example, you would need to set this option to `true` if you wanted to [add a `lowercase` getter to your `localField`](/docs/schematypes.html#schematype-options). + * @param {boolean} [options.clone=false] When you do `BlogPost.find().populate('author')`, blog posts with the same author will share 1 copy of an `author` doc. Enable this option to make Mongoose clone populated docs before assigning them. + * @param {Object|Function} [options.match=null] Add an additional filter to the populate query. Can be a filter object containing [MongoDB query syntax](https://docs.mongodb.com/manual/tutorial/query-documents/), or a function that returns a filter object. + * @param {Function} [options.transform=null] Function that Mongoose will call on every populated document that allows you to transform the populated document. + * @param {Object} [options.options=null] Additional options like `limit` and `lean`. + * @see population ./populate.html + * @see Query#select #query_Query-select + * @see Model.populate #model_Model.populate + * @return {Query} this + * @api public + */ + +Query.prototype.populate = function() { + // Bail when given no truthy arguments + if (!Array.from(arguments).some(Boolean)) { + return this; + } + + const res = utils.populate.apply(null, arguments); + + // Propagate readConcern and readPreference and lean from parent query, + // unless one already specified + if (this.options != null) { + const readConcern = this.options.readConcern; + const readPref = this.options.readPreference; + + for (const populateOptions of res) { + if (readConcern != null && (populateOptions && populateOptions.options && populateOptions.options.readConcern) == null) { + populateOptions.options = populateOptions.options || {}; + populateOptions.options.readConcern = readConcern; + } + if (readPref != null && (populateOptions && populateOptions.options && populateOptions.options.readPreference) == null) { + populateOptions.options = populateOptions.options || {}; + populateOptions.options.readPreference = readPref; + } + } + } + + const opts = this._mongooseOptions; + + if (opts.lean != null) { + const lean = opts.lean; + for (const populateOptions of res) { + if ((populateOptions && populateOptions.options && populateOptions.options.lean) == null) { + populateOptions.options = populateOptions.options || {}; + populateOptions.options.lean = lean; + } + } + } + + if (!utils.isObject(opts.populate)) { + opts.populate = {}; + } + + const pop = opts.populate; + + for (const populateOptions of res) { + const path = populateOptions.path; + if (pop[path] && pop[path].populate && populateOptions.populate) { + populateOptions.populate = pop[path].populate.concat(populateOptions.populate); + } + + pop[populateOptions.path] = populateOptions; + } + return this; +}; + +/** + * Gets a list of paths to be populated by this query + * + * #### Example: + * bookSchema.pre('findOne', function() { + * let keys = this.getPopulatedPaths(); // ['author'] + * }); + * ... + * Book.findOne({}).populate('author'); + * + * #### Example: + * // Deep populate + * const q = L1.find().populate({ + * path: 'level2', + * populate: { path: 'level3' } + * }); + * q.getPopulatedPaths(); // ['level2', 'level2.level3'] + * + * @return {Array} an array of strings representing populated paths + * @api public + */ + +Query.prototype.getPopulatedPaths = function getPopulatedPaths() { + const obj = this._mongooseOptions.populate || {}; + const ret = Object.keys(obj); + for (const path of Object.keys(obj)) { + const pop = obj[path]; + if (!Array.isArray(pop.populate)) { + continue; + } + _getPopulatedPaths(ret, pop.populate, path + '.'); + } + return ret; +}; + +/*! + * ignore + */ + +function _getPopulatedPaths(list, arr, prefix) { + for (const pop of arr) { + list.push(prefix + pop.path); + if (!Array.isArray(pop.populate)) { + continue; + } + _getPopulatedPaths(list, pop.populate, prefix + pop.path + '.'); + } +} + +/** + * Casts this query to the schema of `model` + * + * #### Note + * + * If `obj` is present, it is cast instead of this query. + * + * @param {Model} [model] the model to cast to. If not set, defaults to `this.model` + * @param {Object} [obj] + * @return {Object} + * @api public + */ + +Query.prototype.cast = function(model, obj) { + obj || (obj = this._conditions); + + model = model || this.model; + const discriminatorKey = model.schema.options.discriminatorKey; + if (obj != null && + obj.hasOwnProperty(discriminatorKey)) { + model = getDiscriminatorByValue(model.discriminators, obj[discriminatorKey]) || model; + } + + const opts = { upsert: this.options && this.options.upsert }; + if (this.options) { + if ('strict' in this.options) { + opts.strict = this.options.strict; + opts.strictQuery = opts.strict; + } + if ('strictQuery' in this.options) { + opts.strictQuery = this.options.strictQuery; + } + } + + try { + return cast(model.schema, obj, opts, this); + } catch (err) { + // CastError, assign model + if (typeof err.setModel === 'function') { + err.setModel(model); + } + throw err; + } +}; + +/** + * Casts selected field arguments for field selection with mongo 2.2 + * + * query.select({ ids: { $elemMatch: { $in: [hexString] }}) + * + * @param {Object} fields + * @see https://github.com/Automattic/mongoose/issues/1091 + * @see https://docs.mongodb.org/manual/reference/projection/elemMatch/ + * @api private + */ + +Query.prototype._castFields = function _castFields(fields) { + let selected, + elemMatchKeys, + keys, + key, + out, + i; + + if (fields) { + keys = Object.keys(fields); + elemMatchKeys = []; + i = keys.length; + + // collect $elemMatch args + while (i--) { + key = keys[i]; + if (fields[key].$elemMatch) { + selected || (selected = {}); + selected[key] = fields[key]; + elemMatchKeys.push(key); + } + } + } + + if (selected) { + // they passed $elemMatch, cast em + try { + out = this.cast(this.model, selected); + } catch (err) { + return err; + } + + // apply the casted field args + i = elemMatchKeys.length; + while (i--) { + key = elemMatchKeys[i]; + fields[key] = out[key]; + } + } + + return fields; +}; + +/** + * Applies schematype selected options to this query. + * @api private + */ + +Query.prototype._applyPaths = function applyPaths() { + this._fields = this._fields || {}; + helpers.applyPaths(this._fields, this.model.schema); + + let _selectPopulatedPaths = true; + + if ('selectPopulatedPaths' in this.model.base.options) { + _selectPopulatedPaths = this.model.base.options.selectPopulatedPaths; + } + if ('selectPopulatedPaths' in this.model.schema.options) { + _selectPopulatedPaths = this.model.schema.options.selectPopulatedPaths; + } + + if (_selectPopulatedPaths) { + selectPopulatedFields(this._fields, this._userProvidedFields, this._mongooseOptions.populate); + } +}; + +/** + * Returns a wrapper around a [mongodb driver cursor](https://mongodb.github.io/node-mongodb-native/2.1/api/Cursor.html). + * A QueryCursor exposes a Streams3 interface, as well as a `.next()` function. + * + * The `.cursor()` function triggers pre find hooks, but **not** post find hooks. + * + * #### Example + * + * // There are 2 ways to use a cursor. First, as a stream: + * Thing. + * find({ name: /^hello/ }). + * cursor(). + * on('data', function(doc) { console.log(doc); }). + * on('end', function() { console.log('Done!'); }); + * + * // Or you can use `.next()` to manually get the next doc in the stream. + * // `.next()` returns a promise, so you can use promises or callbacks. + * const cursor = Thing.find({ name: /^hello/ }).cursor(); + * cursor.next(function(error, doc) { + * console.log(doc); + * }); + * + * // Because `.next()` returns a promise, you can use co + * // to easily iterate through all documents without loading them + * // all into memory. + * const cursor = Thing.find({ name: /^hello/ }).cursor(); + * for (let doc = await cursor.next(); doc != null; doc = await cursor.next()) { + * console.log(doc); + * } + * + * #### Valid options + * + * - `transform`: optional function which accepts a mongoose document. The return value of the function will be emitted on `data` and returned by `.next()`. + * + * @return {QueryCursor} + * @param {Object} [options] + * @see QueryCursor + * @api public + */ + +Query.prototype.cursor = function cursor(opts) { + this._applyPaths(); + this._fields = this._castFields(this._fields); + this.setOptions({ projection: this._fieldsForExec() }); + if (opts) { + this.setOptions(opts); + } + + const options = Object.assign({}, this._optionsForExec(), { + projection: this.projection() + }); + try { + this.cast(this.model); + } catch (err) { + return (new QueryCursor(this, options))._markError(err); + } + + return new QueryCursor(this, options); +}; + +// the rest of these are basically to support older Mongoose syntax with mquery + +/** + * _DEPRECATED_ Alias of `maxScan` + * + * @deprecated + * @see maxScan #query_Query-maxScan + * @method maxscan + * @memberOf Query + * @instance + */ + +Query.prototype.maxscan = Query.base.maxScan; + +/** + * Sets the tailable option (for use with capped collections). + * + * #### Example + * + * query.tailable(); // true + * query.tailable(true); + * query.tailable(false); + * + * // Set both `tailable` and `awaitData` options + * query.tailable({ awaitData: true }); + * + * #### Note + * + * Cannot be used with `distinct()` + * + * @param {Boolean} bool defaults to true + * @param {Object} [opts] options to set + * @param {Boolean} [opts.awaitData] false by default. Set to true to keep the cursor open even if there's no data. + * @param {Number} [opts.maxAwaitTimeMS] the maximum amount of time for the server to wait on new documents to satisfy a tailable cursor query. Requires `tailable` and `awaitData` to be true + * @see tailable https://docs.mongodb.org/manual/tutorial/create-tailable-cursor/ + * @api public + */ + +Query.prototype.tailable = function(val, opts) { + // we need to support the tailable({ awaitData : true }) as well as the + // tailable(true, {awaitData :true}) syntax that mquery does not support + if (val != null && typeof val.constructor === 'function' && val.constructor.name === 'Object') { + opts = val; + val = true; + } + + if (val === undefined) { + val = true; + } + + if (opts && typeof opts === 'object') { + for (const key of Object.keys(opts)) { + if (key === 'awaitData' || key === 'awaitdata') { // backwards compat, see gh-10875 + // For backwards compatibility + this.options['awaitData'] = !!opts[key]; + } else { + this.options[key] = opts[key]; + } + } + } + + return Query.base.tailable.call(this, val); +}; + +/** + * Declares an intersects query for `geometry()`. + * + * #### Example + * + * query.where('path').intersects().geometry({ + * type: 'LineString', + * coordinates: [[180.0, 11.0], [180, 9.0]] + * }); + * + * query.where('path').intersects({ + * type: 'LineString', + * coordinates: [[180.0, 11.0], [180, 9.0]] + * }); + * + * #### Note: + * + * **MUST** be used after `where()`. + * + * #### Note: + * + * In Mongoose 3.7, `intersects` changed from a getter to a function. If you need the old syntax, use [this](https://github.com/ebensing/mongoose-within). + * + * @method intersects + * @memberOf Query + * @instance + * @param {Object} [arg] + * @return {Query} this + * @see $geometry https://docs.mongodb.org/manual/reference/operator/geometry/ + * @see geoIntersects https://docs.mongodb.org/manual/reference/operator/geoIntersects/ + * @api public + */ + +/** + * Specifies a `$geometry` condition + * + * #### Example + * + * const polyA = [[[ 10, 20 ], [ 10, 40 ], [ 30, 40 ], [ 30, 20 ]]] + * query.where('loc').within().geometry({ type: 'Polygon', coordinates: polyA }) + * + * // or + * const polyB = [[ 0, 0 ], [ 1, 1 ]] + * query.where('loc').within().geometry({ type: 'LineString', coordinates: polyB }) + * + * // or + * const polyC = [ 0, 0 ] + * query.where('loc').within().geometry({ type: 'Point', coordinates: polyC }) + * + * // or + * query.where('loc').intersects().geometry({ type: 'Point', coordinates: polyC }) + * + * The argument is assigned to the most recent path passed to `where()`. + * + * #### Note: + * + * `geometry()` **must** come after either `intersects()` or `within()`. + * + * The `object` argument must contain `type` and `coordinates` properties. + * - type {String} + * - coordinates {Array} + * + * @method geometry + * @memberOf Query + * @instance + * @param {Object} object Must contain a `type` property which is a String and a `coordinates` property which is an Array. See the examples. + * @return {Query} this + * @see $geometry https://docs.mongodb.org/manual/reference/operator/geometry/ + * @see https://docs.mongodb.org/manual/release-notes/2.4/#new-geospatial-indexes-with-geojson-and-improved-spherical-geometry + * @see https://www.mongodb.org/display/DOCS/Geospatial+Indexing + * @api public + */ + +/** + * Specifies a `$near` or `$nearSphere` condition + * + * These operators return documents sorted by distance. + * + * #### Example + * + * query.where('loc').near({ center: [10, 10] }); + * query.where('loc').near({ center: [10, 10], maxDistance: 5 }); + * query.where('loc').near({ center: [10, 10], maxDistance: 5, spherical: true }); + * query.near('loc', { center: [10, 10], maxDistance: 5 }); + * + * @method near + * @memberOf Query + * @instance + * @param {String} [path] + * @param {Object} val + * @return {Query} this + * @see $near https://docs.mongodb.org/manual/reference/operator/near/ + * @see $nearSphere https://docs.mongodb.org/manual/reference/operator/nearSphere/ + * @see $maxDistance https://docs.mongodb.org/manual/reference/operator/maxDistance/ + * @see https://www.mongodb.org/display/DOCS/Geospatial+Indexing + * @api public + */ + +/*! + * Overwriting mquery is needed to support a couple different near() forms found in older + * versions of mongoose + * near([1,1]) + * near(1,1) + * near(field, [1,2]) + * near(field, 1, 2) + * In addition to all of the normal forms supported by mquery + */ + +Query.prototype.near = function() { + const params = []; + const sphere = this._mongooseOptions.nearSphere; + + // TODO refactor + + if (arguments.length === 1) { + if (Array.isArray(arguments[0])) { + params.push({ center: arguments[0], spherical: sphere }); + } else if (typeof arguments[0] === 'string') { + // just passing a path + params.push(arguments[0]); + } else if (utils.isObject(arguments[0])) { + if (typeof arguments[0].spherical !== 'boolean') { + arguments[0].spherical = sphere; + } + params.push(arguments[0]); + } else { + throw new TypeError('invalid argument'); + } + } else if (arguments.length === 2) { + if (typeof arguments[0] === 'number' && typeof arguments[1] === 'number') { + params.push({ center: [arguments[0], arguments[1]], spherical: sphere }); + } else if (typeof arguments[0] === 'string' && Array.isArray(arguments[1])) { + params.push(arguments[0]); + params.push({ center: arguments[1], spherical: sphere }); + } else if (typeof arguments[0] === 'string' && utils.isObject(arguments[1])) { + params.push(arguments[0]); + if (typeof arguments[1].spherical !== 'boolean') { + arguments[1].spherical = sphere; + } + params.push(arguments[1]); + } else { + throw new TypeError('invalid argument'); + } + } else if (arguments.length === 3) { + if (typeof arguments[0] === 'string' && typeof arguments[1] === 'number' + && typeof arguments[2] === 'number') { + params.push(arguments[0]); + params.push({ center: [arguments[1], arguments[2]], spherical: sphere }); + } else { + throw new TypeError('invalid argument'); + } + } else { + throw new TypeError('invalid argument'); + } + + return Query.base.near.apply(this, params); +}; + +/** + * _DEPRECATED_ Specifies a `$nearSphere` condition + * + * #### Example + * + * query.where('loc').nearSphere({ center: [10, 10], maxDistance: 5 }); + * + * **Deprecated.** Use `query.near()` instead with the `spherical` option set to `true`. + * + * #### Example + * + * query.where('loc').near({ center: [10, 10], spherical: true }); + * + * @deprecated + * @see near() #query_Query-near + * @see $near https://docs.mongodb.org/manual/reference/operator/near/ + * @see $nearSphere https://docs.mongodb.org/manual/reference/operator/nearSphere/ + * @see $maxDistance https://docs.mongodb.org/manual/reference/operator/maxDistance/ + */ + +Query.prototype.nearSphere = function() { + this._mongooseOptions.nearSphere = true; + this.near.apply(this, arguments); + return this; +}; + +/** + * Returns an asyncIterator for use with [`for/await/of` loops](https://thecodebarbarian.com/getting-started-with-async-iterators-in-node-js) + * This function *only* works for `find()` queries. + * You do not need to call this function explicitly, the JavaScript runtime + * will call it for you. + * + * #### Example + * + * for await (const doc of Model.aggregate([{ $sort: { name: 1 } }])) { + * console.log(doc.name); + * } + * + * Node.js 10.x supports async iterators natively without any flags. You can + * enable async iterators in Node.js 8.x using the [`--harmony_async_iteration` flag](https://github.com/tc39/proposal-async-iteration/issues/117#issuecomment-346695187). + * + * **Note:** This function is not if `Symbol.asyncIterator` is undefined. If + * `Symbol.asyncIterator` is undefined, that means your Node.js version does not + * support async iterators. + * + * @method Symbol.asyncIterator + * @memberOf Query + * @instance + * @api public + */ + +if (Symbol.asyncIterator != null) { + Query.prototype[Symbol.asyncIterator] = function() { + return this.cursor().transformNull()._transformForAsyncIterator(); + }; +} + +/** + * Specifies a `$polygon` condition + * + * #### Example + * + * query.where('loc').within().polygon([10, 20], [13, 25], [7, 15]); + * query.polygon('loc', [10, 20], [13, 25], [7, 15]); + * + * @method polygon + * @memberOf Query + * @instance + * @param {String|Array} [path] + * @param {Array|Object} [coordinatePairs...] + * @return {Query} this + * @see $polygon https://docs.mongodb.org/manual/reference/operator/polygon/ + * @see https://www.mongodb.org/display/DOCS/Geospatial+Indexing + * @api public + */ + +/** + * Specifies a `$box` condition + * + * #### Example + * + * const lowerLeft = [40.73083, -73.99756] + * const upperRight= [40.741404, -73.988135] + * + * query.where('loc').within().box(lowerLeft, upperRight) + * query.box({ ll : lowerLeft, ur : upperRight }) + * + * @method box + * @memberOf Query + * @instance + * @see $box https://docs.mongodb.org/manual/reference/operator/box/ + * @see within() Query#within #query_Query-within + * @see https://www.mongodb.org/display/DOCS/Geospatial+Indexing + * @param {Object} val + * @param [Array] Upper Right Coords + * @return {Query} this + * @api public + */ + +/*! + * this is needed to support the mongoose syntax of: + * box(field, { ll : [x,y], ur : [x2,y2] }) + * box({ ll : [x,y], ur : [x2,y2] }) + */ + +Query.prototype.box = function(ll, ur) { + if (!Array.isArray(ll) && utils.isObject(ll)) { + ur = ll.ur; + ll = ll.ll; + } + return Query.base.box.call(this, ll, ur); +}; + +/** + * Specifies a `$center` or `$centerSphere` condition. + * + * #### Example + * + * const area = { center: [50, 50], radius: 10, unique: true } + * query.where('loc').within().circle(area) + * // alternatively + * query.circle('loc', area); + * + * // spherical calculations + * const area = { center: [50, 50], radius: 10, unique: true, spherical: true } + * query.where('loc').within().circle(area) + * // alternatively + * query.circle('loc', area); + * + * @method circle + * @memberOf Query + * @instance + * @param {String} [path] + * @param {Object} area + * @return {Query} this + * @see $center https://docs.mongodb.org/manual/reference/operator/center/ + * @see $centerSphere https://docs.mongodb.org/manual/reference/operator/centerSphere/ + * @see $geoWithin https://docs.mongodb.org/manual/reference/operator/geoWithin/ + * @see https://www.mongodb.org/display/DOCS/Geospatial+Indexing + * @api public + */ + +/** + * _DEPRECATED_ Alias for [circle](#query_Query-circle) + * + * **Deprecated.** Use [circle](#query_Query-circle) instead. + * + * @deprecated + * @method center + * @memberOf Query + * @instance + * @api public + */ + +Query.prototype.center = Query.base.circle; + +/** + * _DEPRECATED_ Specifies a `$centerSphere` condition + * + * **Deprecated.** Use [circle](#query_Query-circle) instead. + * + * #### Example + * + * const area = { center: [50, 50], radius: 10 }; + * query.where('loc').within().centerSphere(area); + * + * @deprecated + * @param {String} [path] + * @param {Object} val + * @return {Query} this + * @see https://www.mongodb.org/display/DOCS/Geospatial+Indexing + * @see $centerSphere https://docs.mongodb.org/manual/reference/operator/centerSphere/ + * @api public + */ + +Query.prototype.centerSphere = function() { + if (arguments[0] != null && typeof arguments[0].constructor === 'function' && arguments[0].constructor.name === 'Object') { + arguments[0].spherical = true; + } + + if (arguments[1] != null && typeof arguments[1].constructor === 'function' && arguments[1].constructor.name === 'Object') { + arguments[1].spherical = true; + } + + Query.base.circle.apply(this, arguments); +}; + +/** + * Determines if field selection has been made. + * + * @method selected + * @memberOf Query + * @instance + * @return {Boolean} + * @api public + */ + +/** + * Determines if inclusive field selection has been made. + * + * query.selectedInclusively(); // false + * query.select('name'); + * query.selectedInclusively(); // true + * + * @method selectedInclusively + * @memberOf Query + * @instance + * @return {Boolean} + * @api public + */ + +Query.prototype.selectedInclusively = function selectedInclusively() { + return isInclusive(this._fields); +}; + +/** + * Determines if exclusive field selection has been made. + * + * query.selectedExclusively(); // false + * query.select('-name'); + * query.selectedExclusively(); // true + * query.selectedInclusively(); // false + * + * @method selectedExclusively + * @memberOf Query + * @instance + * @return {Boolean} + * @api public + */ + +Query.prototype.selectedExclusively = function selectedExclusively() { + return isExclusive(this._fields); +}; + +/** + * The model this query is associated with. + * + * #### Example: + * + * const q = MyModel.find(); + * q.model === MyModel; // true + * + * @api public + * @property model + * @memberOf Query + * @instance + */ + +Query.prototype.model; + +/*! + * Export + */ + +module.exports = Query; diff --git a/node_modules/mongoose/lib/queryhelpers.js b/node_modules/mongoose/lib/queryhelpers.js new file mode 100644 index 000000000..3b2f4f6e1 --- /dev/null +++ b/node_modules/mongoose/lib/queryhelpers.js @@ -0,0 +1,338 @@ +'use strict'; + +/*! + * Module dependencies + */ + +const checkEmbeddedDiscriminatorKeyProjection = + require('./helpers/discriminator/checkEmbeddedDiscriminatorKeyProjection'); +const get = require('./helpers/get'); +const getDiscriminatorByValue = + require('./helpers/discriminator/getDiscriminatorByValue'); +const isDefiningProjection = require('./helpers/projection/isDefiningProjection'); +const clone = require('./helpers/clone'); + +/*! + * Prepare a set of path options for query population. + * + * @param {Query} query + * @param {Object} options + * @return {Array} + */ + +exports.preparePopulationOptions = function preparePopulationOptions(query, options) { + const _populate = query.options.populate; + const pop = Object.keys(_populate).reduce((vals, key) => vals.concat([_populate[key]]), []); + + // lean options should trickle through all queries + if (options.lean != null) { + pop + .filter(p => (p && p.options && p.options.lean) == null) + .forEach(makeLean(options.lean)); + } + + pop.forEach(opts => { + opts._localModel = query.model; + }); + + return pop; +}; + +/*! + * Prepare a set of path options for query population. This is the MongooseQuery + * version + * + * @param {Query} query + * @param {Object} options + * @return {Array} + */ + +exports.preparePopulationOptionsMQ = function preparePopulationOptionsMQ(query, options) { + const _populate = query._mongooseOptions.populate; + const pop = Object.keys(_populate).reduce((vals, key) => vals.concat([_populate[key]]), []); + + // lean options should trickle through all queries + if (options.lean != null) { + pop + .filter(p => (p && p.options && p.options.lean) == null) + .forEach(makeLean(options.lean)); + } + + const session = query && query.options && query.options.session || null; + if (session != null) { + pop.forEach(path => { + if (path.options == null) { + path.options = { session: session }; + return; + } + if (!('session' in path.options)) { + path.options.session = session; + } + }); + } + + const projection = query._fieldsForExec(); + pop.forEach(p => { + p._queryProjection = projection; + }); + pop.forEach(opts => { + opts._localModel = query.model; + }); + + return pop; +}; + +/*! + * If the document is a mapped discriminator type, it returns a model instance for that type, otherwise, + * it returns an instance of the given model. + * + * @param {Model} model + * @param {Object} doc + * @param {Object} fields + * + * @return {Document} + */ +exports.createModel = function createModel(model, doc, fields, userProvidedFields, options) { + model.hooks.execPreSync('createModel', doc); + const discriminatorMapping = model.schema ? + model.schema.discriminatorMapping : + null; + + const key = discriminatorMapping && discriminatorMapping.isRoot ? + discriminatorMapping.key : + null; + + const value = doc[key]; + if (key && value && model.discriminators) { + const discriminator = model.discriminators[value] || getDiscriminatorByValue(model.discriminators, value); + if (discriminator) { + const _fields = clone(userProvidedFields); + exports.applyPaths(_fields, discriminator.schema); + return new discriminator(undefined, _fields, true); + } + } + + const _opts = { + skipId: true, + isNew: false, + willInit: true + }; + if (options != null && 'defaults' in options) { + _opts.defaults = options.defaults; + } + return new model(undefined, fields, _opts); +}; + +/*! + * ignore + */ + +exports.createModelAndInit = function createModelAndInit(model, doc, fields, userProvidedFields, options, populatedIds, callback) { + const initOpts = populatedIds ? + { populated: populatedIds } : + undefined; + + const casted = exports.createModel(model, doc, fields, userProvidedFields, options); + try { + casted.$init(doc, initOpts, callback); + } catch (error) { + callback(error, casted); + } +}; + +/*! + * ignore + */ + +exports.applyPaths = function applyPaths(fields, schema) { + // determine if query is selecting or excluding fields + let exclude; + let keys; + let keyIndex; + + if (fields) { + keys = Object.keys(fields); + keyIndex = keys.length; + + while (keyIndex--) { + if (keys[keyIndex][0] === '+') { + continue; + } + const field = fields[keys[keyIndex]]; + // Skip `$meta` and `$slice` + if (!isDefiningProjection(field)) { + continue; + } + exclude = !field; + break; + } + } + + // if selecting, apply default schematype select:true fields + // if excluding, apply schematype select:false fields + + const selected = []; + const excluded = []; + const stack = []; + + analyzeSchema(schema); + + switch (exclude) { + case true: + for (const fieldName of excluded) { + fields[fieldName] = 0; + } + break; + case false: + if (schema && + schema.paths['_id'] && + schema.paths['_id'].options && + schema.paths['_id'].options.select === false) { + fields._id = 0; + } + + for (const fieldName of selected) { + fields[fieldName] = fields[fieldName] || 1; + } + break; + case undefined: + if (fields == null) { + break; + } + // Any leftover plus paths must in the schema, so delete them (gh-7017) + for (const key of Object.keys(fields || {})) { + if (key.startsWith('+')) { + delete fields[key]; + } + } + + // user didn't specify fields, implies returning all fields. + // only need to apply excluded fields and delete any plus paths + for (const fieldName of excluded) { + fields[fieldName] = 0; + } + break; + } + + function analyzeSchema(schema, prefix) { + prefix || (prefix = ''); + + // avoid recursion + if (stack.indexOf(schema) !== -1) { + return []; + } + stack.push(schema); + + const addedPaths = []; + schema.eachPath(function(path, type) { + if (prefix) path = prefix + '.' + path; + if (type.$isSchemaMap || path.endsWith('.$*')) { + return; + } + let addedPath = analyzePath(path, type); + // arrays + if (addedPath == null && !Array.isArray(type) && type.$isMongooseArray && !type.$isMongooseDocumentArray) { + addedPath = analyzePath(path, type.caster); + } + if (addedPath != null) { + addedPaths.push(addedPath); + } + + // nested schemas + if (type.schema) { + const _addedPaths = analyzeSchema(type.schema, path); + + // Special case: if discriminator key is the only field that would + // be projected in, remove it. + if (exclude === false) { + checkEmbeddedDiscriminatorKeyProjection(fields, path, type.schema, + selected, _addedPaths); + } + } + }); + stack.pop(); + return addedPaths; + } + + function analyzePath(path, type) { + const plusPath = '+' + path; + const hasPlusPath = fields && plusPath in fields; + if (hasPlusPath) { + // forced inclusion + delete fields[plusPath]; + } + + if (typeof type.selected !== 'boolean') { + return; + } + + // If set to 0, we're explicitly excluding the discriminator key. Can't do this for all fields, + // because we have tests that assert that using `-path` to exclude schema-level `select: true` + // fields counts as an exclusive projection. See gh-11546 + if (exclude && type.selected && path === schema.options.discriminatorKey && fields[path] != null && !fields[path]) { + delete fields[path]; + return; + } + + if (hasPlusPath) { + // forced inclusion + delete fields[plusPath]; + + // if there are other fields being included, add this one + // if no other included fields, leave this out (implied inclusion) + if (exclude === false && keys.length > 1 && !~keys.indexOf(path)) { + fields[path] = 1; + } + + return; + } + + // check for parent exclusions + const pieces = path.split('.'); + let cur = ''; + for (let i = 0; i < pieces.length; ++i) { + cur += cur.length ? '.' + pieces[i] : pieces[i]; + if (excluded.indexOf(cur) !== -1) { + return; + } + } + + // Special case: if user has included a parent path of a discriminator key, + // don't explicitly project in the discriminator key because that will + // project out everything else under the parent path + if (!exclude && (type && type.options && type.options.$skipDiscriminatorCheck || false)) { + let cur = ''; + for (let i = 0; i < pieces.length; ++i) { + cur += (cur.length === 0 ? '' : '.') + pieces[i]; + const projection = get(fields, cur, false) || get(fields, cur + '.$', false); + if (projection && typeof projection !== 'object') { + return; + } + } + } + + (type.selected ? selected : excluded).push(path); + return path; + } +}; + +/*! + * Set each path query option to lean + * + * @param {Object} option + */ + +function makeLean(val) { + return function(option) { + option.options || (option.options = {}); + + if (val != null && Array.isArray(val.virtuals)) { + val = Object.assign({}, val); + val.virtuals = val.virtuals. + filter(path => typeof path === 'string' && path.startsWith(option.path + '.')). + map(path => path.slice(option.path.length + 1)); + } + + option.options.lean = val; + }; +} diff --git a/node_modules/mongoose/lib/schema.js b/node_modules/mongoose/lib/schema.js new file mode 100644 index 000000000..b5d26e584 --- /dev/null +++ b/node_modules/mongoose/lib/schema.js @@ -0,0 +1,2418 @@ +'use strict'; + +/*! + * Module dependencies. + */ + +const EventEmitter = require('events').EventEmitter; +const Kareem = require('kareem'); +const MongooseError = require('./error/mongooseError'); +const SchemaType = require('./schematype'); +const SchemaTypeOptions = require('./options/SchemaTypeOptions'); +const VirtualOptions = require('./options/VirtualOptions'); +const VirtualType = require('./virtualtype'); +const addAutoId = require('./helpers/schema/addAutoId'); +const get = require('./helpers/get'); +const getConstructorName = require('./helpers/getConstructorName'); +const getIndexes = require('./helpers/schema/getIndexes'); +const idGetter = require('./helpers/schema/idGetter'); +const merge = require('./helpers/schema/merge'); +const mpath = require('mpath'); +const readPref = require('./driver').get().ReadPreference; +const setupTimestamps = require('./helpers/timestamps/setupTimestamps'); +const utils = require('./utils'); +const validateRef = require('./helpers/populate/validateRef'); +const util = require('util'); + +let MongooseTypes; + +const queryHooks = require('./helpers/query/applyQueryMiddleware'). + middlewareFunctions; +const documentHooks = require('./helpers/model/applyHooks').middlewareFunctions; +const hookNames = queryHooks.concat(documentHooks). + reduce((s, hook) => s.add(hook), new Set()); + +const isPOJO = utils.isPOJO; + +let id = 0; + +/** + * Schema constructor. + * + * #### Example: + * + * const child = new Schema({ name: String }); + * const schema = new Schema({ name: String, age: Number, children: [child] }); + * const Tree = mongoose.model('Tree', schema); + * + * // setting schema options + * new Schema({ name: String }, { _id: false, autoIndex: false }) + * + * #### Options: + * + * - [autoIndex](/docs/guide.html#autoIndex): bool - defaults to null (which means use the connection's autoIndex option) + * - [autoCreate](/docs/guide.html#autoCreate): bool - defaults to null (which means use the connection's autoCreate option) + * - [bufferCommands](/docs/guide.html#bufferCommands): bool - defaults to true + * - [bufferTimeoutMS](/docs/guide.html#bufferTimeoutMS): number - defaults to 10000 (10 seconds). If `bufferCommands` is enabled, the amount of time Mongoose will wait for connectivity to be restablished before erroring out. + * - [capped](/docs/guide.html#capped): bool | number | object - defaults to false + * - [collection](/docs/guide.html#collection): string - no default + * - [discriminatorKey](/docs/guide.html#discriminatorKey): string - defaults to `__t` + * - [id](/docs/guide.html#id): bool - defaults to true + * - [_id](/docs/guide.html#_id): bool - defaults to true + * - [minimize](/docs/guide.html#minimize): bool - controls [document#toObject](#document_Document-toObject) behavior when called manually - defaults to true + * - [read](/docs/guide.html#read): string + * - [writeConcern](/docs/guide.html#writeConcern): object - defaults to null, use to override [the MongoDB server's default write concern settings](https://docs.mongodb.com/manual/reference/write-concern/) + * - [shardKey](/docs/guide.html#shardKey): object - defaults to `null` + * - [strict](/docs/guide.html#strict): bool - defaults to true + * - [strictQuery](/docs/guide.html#strictQuery): bool - defaults to false + * - [toJSON](/docs/guide.html#toJSON) - object - no default + * - [toObject](/docs/guide.html#toObject) - object - no default + * - [typeKey](/docs/guide.html#typeKey) - string - defaults to 'type' + * - [validateBeforeSave](/docs/guide.html#validateBeforeSave) - bool - defaults to `true` + * - [versionKey](/docs/guide.html#versionKey): string or object - defaults to "__v" + * - [optimisticConcurrency](/docs/guide.html#optimisticConcurrency): bool - defaults to false. Set to true to enable [optimistic concurrency](https://thecodebarbarian.com/whats-new-in-mongoose-5-10-optimistic-concurrency.html). + * - [collation](/docs/guide.html#collation): object - defaults to null (which means use no collation) + * - [timeseries](/docs/guide.html#timeseries): object - defaults to null (which means this schema's collection won't be a timeseries collection) + * - [selectPopulatedPaths](/docs/guide.html#selectPopulatedPaths): boolean - defaults to `true` + * - [skipVersioning](/docs/guide.html#skipVersioning): object - paths to exclude from versioning + * - [timestamps](/docs/guide.html#timestamps): object or boolean - defaults to `false`. If true, Mongoose adds `createdAt` and `updatedAt` properties to your schema and manages those properties for you. + * - [pluginTags](/docs/guide.html#pluginTags): array of strings - defaults to `undefined`. If set and plugin called with `tags` option, will only apply that plugin to schemas with a matching tag. + * + * #### Options for Nested Schemas: + * - `excludeIndexes`: bool - defaults to `false`. If `true`, skip building indexes on this schema's paths. + * + * #### Note: + * + * _When nesting schemas, (`children` in the example above), always declare the child schema first before passing it into its parent._ + * + * @param {Object|Schema|Array} [definition] Can be one of: object describing schema paths, or schema to copy, or array of objects and schemas + * @param {Object} [options] + * @inherits NodeJS EventEmitter https://nodejs.org/api/events.html#events_class_events_eventemitter + * @event `init`: Emitted after the schema is compiled into a `Model`. + * @api public + */ + +function Schema(obj, options) { + if (!(this instanceof Schema)) { + return new Schema(obj, options); + } + + this.obj = obj; + this.paths = {}; + this.aliases = {}; + this.subpaths = {}; + this.virtuals = {}; + this.singleNestedPaths = {}; + this.nested = {}; + this.inherits = {}; + this.callQueue = []; + this._indexes = []; + this.methods = (options && options.methods) || {}; + this.methodOptions = {}; + this.statics = (options && options.statics) || {}; + this.tree = {}; + this.query = (options && options.query) || {}; + this.childSchemas = []; + this.plugins = []; + // For internal debugging. Do not use this to try to save a schema in MDB. + this.$id = ++id; + this.mapPaths = []; + + this.s = { + hooks: new Kareem() + }; + this.options = this.defaultOptions(options); + + // build paths + if (Array.isArray(obj)) { + for (const definition of obj) { + this.add(definition); + } + } else if (obj) { + this.add(obj); + } + + // check if _id's value is a subdocument (gh-2276) + const _idSubDoc = obj && obj._id && utils.isObject(obj._id); + + // ensure the documents get an auto _id unless disabled + const auto_id = !this.paths['_id'] && + (this.options._id) && !_idSubDoc; + + if (auto_id) { + addAutoId(this); + } + + this.setupTimestamp(this.options.timestamps); +} + +/*! + * Create virtual properties with alias field + */ +function aliasFields(schema, paths) { + paths = paths || Object.keys(schema.paths); + for (const path of paths) { + const options = get(schema.paths[path], 'options'); + if (options == null) { + continue; + } + + const prop = schema.paths[path].path; + const alias = options.alias; + + if (!alias) { + continue; + } + + if (typeof alias !== 'string') { + throw new Error('Invalid value for alias option on ' + prop + ', got ' + alias); + } + + schema.aliases[alias] = prop; + + schema. + virtual(alias). + get((function(p) { + return function() { + if (typeof this.get === 'function') { + return this.get(p); + } + return this[p]; + }; + })(prop)). + set((function(p) { + return function(v) { + return this.$set(p, v); + }; + })(prop)); + } +} + +/*! + * Inherit from EventEmitter. + */ +Schema.prototype = Object.create(EventEmitter.prototype); +Schema.prototype.constructor = Schema; +Schema.prototype.instanceOfSchema = true; + +/*! + * ignore + */ + +Object.defineProperty(Schema.prototype, '$schemaType', { + configurable: false, + enumerable: false, + writable: true +}); + +/** + * Array of child schemas (from document arrays and single nested subdocs) + * and their corresponding compiled models. Each element of the array is + * an object with 2 properties: `schema` and `model`. + * + * This property is typically only useful for plugin authors and advanced users. + * You do not need to interact with this property at all to use mongoose. + * + * @api public + * @property childSchemas + * @memberOf Schema + * @instance + */ + +Object.defineProperty(Schema.prototype, 'childSchemas', { + configurable: false, + enumerable: true, + writable: true +}); + +/** + * Object containing all virtuals defined on this schema. + * The objects' keys are the virtual paths and values are instances of `VirtualType`. + * + * This property is typically only useful for plugin authors and advanced users. + * You do not need to interact with this property at all to use mongoose. + * + * #### Example: + * const schema = new Schema({}); + * schema.virtual('answer').get(() => 42); + * + * console.log(schema.virtuals); // { answer: VirtualType { path: 'answer', ... } } + * console.log(schema.virtuals['answer'].getters[0].call()); // 42 + * + * @api public + * @property virtuals + * @memberOf Schema + * @instance + */ + +Object.defineProperty(Schema.prototype, 'virtuals', { + configurable: false, + enumerable: true, + writable: true +}); + +/** + * The original object passed to the schema constructor + * + * #### Example: + * + * const schema = new Schema({ a: String }).add({ b: String }); + * schema.obj; // { a: String } + * + * @api public + * @property obj + * @memberOf Schema + * @instance + */ + +Schema.prototype.obj; + +/** + * The paths defined on this schema. The keys are the top-level paths + * in this schema, and the values are instances of the SchemaType class. + * + * #### Example: + * const schema = new Schema({ name: String }, { _id: false }); + * schema.paths; // { name: SchemaString { ... } } + * + * schema.add({ age: Number }); + * schema.paths; // { name: SchemaString { ... }, age: SchemaNumber { ... } } + * + * @api public + * @property paths + * @memberOf Schema + * @instance + */ + +Schema.prototype.paths; + +/** + * Schema as a tree + * + * #### Example: + * { + * '_id' : ObjectId + * , 'nested' : { + * 'key' : String + * } + * } + * + * @api private + * @property tree + * @memberOf Schema + * @instance + */ + +Schema.prototype.tree; + +/** + * Returns a deep copy of the schema + * + * #### Example: + * + * const schema = new Schema({ name: String }); + * const clone = schema.clone(); + * clone === schema; // false + * clone.path('name'); // SchemaString { ... } + * + * @return {Schema} the cloned schema + * @api public + * @memberOf Schema + * @instance + */ + +Schema.prototype.clone = function() { + const s = this._clone(); + + // Bubble up `init` for backwards compat + s.on('init', v => this.emit('init', v)); + + return s; +}; + +/*! + * ignore + */ + +Schema.prototype._clone = function _clone(Constructor) { + Constructor = Constructor || (this.base == null ? Schema : this.base.Schema); + + const s = new Constructor({}, this._userProvidedOptions); + s.base = this.base; + s.obj = this.obj; + s.options = utils.clone(this.options); + s.callQueue = this.callQueue.map(function(f) { return f; }); + s.methods = utils.clone(this.methods); + s.methodOptions = utils.clone(this.methodOptions); + s.statics = utils.clone(this.statics); + s.query = utils.clone(this.query); + s.plugins = Array.prototype.slice.call(this.plugins); + s._indexes = utils.clone(this._indexes); + s.s.hooks = this.s.hooks.clone(); + + s.tree = utils.clone(this.tree); + s.paths = utils.clone(this.paths); + s.nested = utils.clone(this.nested); + s.subpaths = utils.clone(this.subpaths); + s.singleNestedPaths = utils.clone(this.singleNestedPaths); + s.childSchemas = gatherChildSchemas(s); + + s.virtuals = utils.clone(this.virtuals); + s.$globalPluginsApplied = this.$globalPluginsApplied; + s.$isRootDiscriminator = this.$isRootDiscriminator; + s.$implicitlyCreated = this.$implicitlyCreated; + s.$id = ++id; + s.$originalSchemaId = this.$id; + s.mapPaths = [].concat(this.mapPaths); + + if (this.discriminatorMapping != null) { + s.discriminatorMapping = Object.assign({}, this.discriminatorMapping); + } + if (this.discriminators != null) { + s.discriminators = Object.assign({}, this.discriminators); + } + if (this._applyDiscriminators != null) { + s._applyDiscriminators = Object.assign({}, this._applyDiscriminators); + } + + s.aliases = Object.assign({}, this.aliases); + + return s; +}; + +/** + * Returns a new schema that has the picked `paths` from this schema. + * + * This method is analagous to [Lodash's `pick()` function](https://lodash.com/docs/4.17.15#pick) for Mongoose schemas. + * + * #### Example: + * + * const schema = Schema({ name: String, age: Number }); + * // Creates a new schema with the same `name` path as `schema`, + * // but no `age` path. + * const newSchema = schema.pick(['name']); + * + * newSchema.path('name'); // SchemaString { ... } + * newSchema.path('age'); // undefined + * + * @param {Array} paths list of paths to pick + * @param {Object} [options] options to pass to the schema constructor. Defaults to `this.options` if not set. + * @return {Schema} + * @api public + */ + +Schema.prototype.pick = function(paths, options) { + const newSchema = new Schema({}, options || this.options); + if (!Array.isArray(paths)) { + throw new MongooseError('Schema#pick() only accepts an array argument, ' + + 'got "' + typeof paths + '"'); + } + + for (const path of paths) { + if (this.nested[path]) { + newSchema.add({ [path]: get(this.tree, path) }); + } else { + const schematype = this.path(path); + if (schematype == null) { + throw new MongooseError('Path `' + path + '` is not in the schema'); + } + newSchema.add({ [path]: schematype }); + } + } + + return newSchema; +}; + +/** + * Returns default options for this schema, merged with `options`. + * + * @param {Object} options + * @return {Object} + * @api private + */ + +Schema.prototype.defaultOptions = function(options) { + this._userProvidedOptions = options == null ? {} : utils.clone(options); + const baseOptions = this.base && this.base.options || {}; + + const strict = 'strict' in baseOptions ? baseOptions.strict : true; + options = utils.options({ + strict: strict, + strictQuery: 'strict' in this._userProvidedOptions ? + this._userProvidedOptions.strict : + 'strictQuery' in baseOptions ? + baseOptions.strictQuery : strict, + bufferCommands: true, + capped: false, // { size, max, autoIndexId } + versionKey: '__v', + optimisticConcurrency: false, + minimize: true, + autoIndex: null, + discriminatorKey: '__t', + shardKey: null, + read: null, + validateBeforeSave: true, + // the following are only applied at construction time + _id: true, + id: true, + typeKey: 'type' + }, utils.clone(options)); + + if (options.read) { + options.read = readPref(options.read); + } + + if (options.versionKey && typeof options.versionKey !== 'string') { + throw new MongooseError('`versionKey` must be falsy or string, got `' + (typeof options.versionKey) + '`'); + } + + if (options.optimisticConcurrency && !options.versionKey) { + throw new MongooseError('Must set `versionKey` if using `optimisticConcurrency`'); + } + + return options; +}; + +/** + * Inherit a Schema by applying a discriminator on an existing Schema. + * + * + * ####Example: + * + * const options = { discriminatorKey: 'kind' }; + * + * const eventSchema = new mongoose.Schema({ time: Date }, options); + * const Event = mongoose.model('Event', eventSchema); + * + * // ClickedLinkEvent is a special type of Event that has + * // a URL. + * const ClickedLinkEvent = Event.discriminator('ClickedLink', + * new mongoose.Schema({ url: String }, options)); + * + * // When you create a generic event, it can't have a URL field... + * const genericEvent = new Event({ time: Date.now(), url: 'google.com' }); + * assert.ok(!genericEvent.url); + * // But a ClickedLinkEvent can + * const clickedEvent = new ClickedLinkEvent({ time: Date.now(), url: 'google.com' }); + * assert.ok(clickedEvent.url); + * + * @param {String} name the name of the discriminator + * @param {Schema} schema the Schema of the discriminated Schema + * @return {Schema} the Schema instance + * @api public + */ + +Schema.prototype.discriminator = function(name, schema) { + this._applyDiscriminators = Object.assign(this._applyDiscriminators || {}, { [name]: schema }); + + return this; +}; + +/** + * Adds key path / schema type pairs to this schema. + * + * #### Example: + * + * const ToySchema = new Schema(); + * ToySchema.add({ name: 'string', color: 'string', price: 'number' }); + * + * const TurboManSchema = new Schema(); + * // You can also `add()` another schema and copy over all paths, virtuals, + * // getters, setters, indexes, methods, and statics. + * TurboManSchema.add(ToySchema).add({ year: Number }); + * + * @param {Object|Schema} obj plain object with paths to add, or another schema + * @param {String} [prefix] path to prefix the newly added paths with + * @return {Schema} the Schema instance + * @api public + */ + +Schema.prototype.add = function add(obj, prefix) { + if (obj instanceof Schema || (obj != null && obj.instanceOfSchema)) { + merge(this, obj); + + return this; + } + + // Special case: setting top-level `_id` to false should convert to disabling + // the `_id` option. This behavior never worked before 5.4.11 but numerous + // codebases use it (see gh-7516, gh-7512). + if (obj._id === false && prefix == null) { + this.options._id = false; + } + + prefix = prefix || ''; + // avoid prototype pollution + if (prefix === '__proto__.' || prefix === 'constructor.' || prefix === 'prototype.') { + return this; + } + + const keys = Object.keys(obj); + const typeKey = this.options.typeKey; + for (const key of keys) { + const fullPath = prefix + key; + const val = obj[key]; + + if (val == null) { + throw new TypeError('Invalid value for schema path `' + fullPath + + '`, got value "' + val + '"'); + } + // Retain `_id: false` but don't set it as a path, re: gh-8274. + if (key === '_id' && val === false) { + continue; + } + if (val instanceof VirtualType || (val.constructor && val.constructor.name || null) === 'VirtualType') { + this.virtual(val); + continue; + } + + if (Array.isArray(val) && val.length === 1 && val[0] == null) { + throw new TypeError('Invalid value for schema Array path `' + fullPath + + '`, got value "' + val[0] + '"'); + } + + if (!(isPOJO(val) || val instanceof SchemaTypeOptions)) { + // Special-case: Non-options definitely a path so leaf at this node + // Examples: Schema instances, SchemaType instances + if (prefix) { + this.nested[prefix.substring(0, prefix.length - 1)] = true; + } + this.path(prefix + key, val); + if (val[0] != null && !(val[0].instanceOfSchema) && utils.isPOJO(val[0].discriminators)) { + const schemaType = this.path(prefix + key); + for (const key in val[0].discriminators) { + schemaType.discriminator(key, val[0].discriminators[key]); + } + } else if (val[0] != null && val[0].instanceOfSchema && utils.isPOJO(val[0]._applyDiscriminators)) { + const applyDiscriminators = val[0]._applyDiscriminators || []; + const schemaType = this.path(prefix + key); + for (const disc in applyDiscriminators) { + schemaType.discriminator(disc, applyDiscriminators[disc]); + } + } + else if (val != null && val.instanceOfSchema && utils.isPOJO(val._applyDiscriminators)) { + const applyDiscriminators = val._applyDiscriminators || []; + const schemaType = this.path(prefix + key); + for (const disc in applyDiscriminators) { + schemaType.discriminator(disc, applyDiscriminators[disc]); + } + } + } else if (Object.keys(val).length < 1) { + // Special-case: {} always interpreted as Mixed path so leaf at this node + if (prefix) { + this.nested[prefix.substring(0, prefix.length - 1)] = true; + } + this.path(fullPath, val); // mixed type + } else if (!val[typeKey] || (typeKey === 'type' && isPOJO(val.type) && val.type.type)) { + // Special-case: POJO with no bona-fide type key - interpret as tree of deep paths so recurse + // nested object `{ last: { name: String } }`. Avoid functions with `.type` re: #10807 because + // NestJS sometimes adds `Date.type`. + this.nested[fullPath] = true; + this.add(val, fullPath + '.'); + } else { + // There IS a bona-fide type key that may also be a POJO + const _typeDef = val[typeKey]; + if (isPOJO(_typeDef) && Object.keys(_typeDef).length > 0) { + // If a POJO is the value of a type key, make it a subdocument + if (prefix) { + this.nested[prefix.substring(0, prefix.length - 1)] = true; + } + const _schema = new Schema(_typeDef); + const schemaWrappedPath = Object.assign({}, val, { type: _schema }); + this.path(prefix + key, schemaWrappedPath); + } else { + // Either the type is non-POJO or we interpret it as Mixed anyway + if (prefix) { + this.nested[prefix.substring(0, prefix.length - 1)] = true; + } + this.path(prefix + key, val); + if (val != null && !(val.instanceOfSchema) && utils.isPOJO(val.discriminators)) { + const schemaType = this.path(prefix + key); + for (const key in val.discriminators) { + schemaType.discriminator(key, val.discriminators[key]); + } + } + } + } + } + + const addedKeys = Object.keys(obj). + map(key => prefix ? prefix + key : key); + aliasFields(this, addedKeys); + return this; +}; + +/** + * Remove an index by name or index specification. + * + * removeIndex only removes indexes from your schema object. Does **not** affect the indexes + * in MongoDB. + * + * ####Example: + * + * const ToySchema = new Schema({ name: String, color: String, price: Number }); + * + * // Add a new index on { name, color } + * ToySchema.index({ name: 1, color: 1 }); + * + * // Remove index on { name, color } + * // Keep in mind that order matters! `removeIndex({ color: 1, name: 1 })` won't remove the index + * ToySchema.removeIndex({ name: 1, color: 1 }); + * + * // Add an index with a custom name + * ToySchema.index({ color: 1 }, { name: 'my custom index name' }); + * // Remove index by name + * ToySchema.removeIndex('my custom index name'); + * + * @param {Object|string} index name or index specification + * @return {Schema} the Schema instance + * @api public + */ + +Schema.prototype.removeIndex = function removeIndex(index) { + if (arguments.length > 1) { + throw new Error('removeIndex() takes only 1 argument'); + } + + if (typeof index !== 'object' && typeof index !== 'string') { + throw new Error('removeIndex() may only take either an object or a string as an argument'); + } + + if (typeof index === 'object') { + for (let i = this._indexes.length - 1; i >= 0; --i) { + if (util.isDeepStrictEqual(this._indexes[i][0], index)) { + this._indexes.splice(i, 1); + } + } + } else { + for (let i = this._indexes.length - 1; i >= 0; --i) { + if (this._indexes[i][1] != null && this._indexes[i][1].name === index) { + this._indexes.splice(i, 1); + } + } + } + + return this; +}; + +/** + * Remove all indexes from this schema. + * + * clearIndexes only removes indexes from your schema object. Does **not** affect the indexes + * in MongoDB. + * + * ####Example: + * + * const ToySchema = new Schema({ name: String, color: String, price: Number }); + * ToySchema.index({ name: 1 }); + * ToySchema.index({ color: 1 }); + * + * // Remove all indexes on this schema + * ToySchema.clearIndexes(); + * + * ToySchema.indexes(); // [] + * + * @return {Schema} the Schema instance + * @api public + */ + +Schema.prototype.clearIndexes = function clearIndexes() { + this._indexes.length = 0; + + return this; +}; + +/** + * Reserved document keys. + * + * Keys in this object are names that are warned in schema declarations + * because they have the potential to break Mongoose/ Mongoose plugins functionality. If you create a schema + * using `new Schema()` with one of these property names, Mongoose will log a warning. + * + * - _posts + * - _pres + * - collection + * - emit + * - errors + * - get + * - init + * - isModified + * - isNew + * - listeners + * - modelName + * - on + * - once + * - populated + * - prototype + * - remove + * - removeListener + * - save + * - schema + * - toObject + * - validate + * + * _NOTE:_ Use of these terms as method names is permitted, but play at your own risk, as they may be existing mongoose document methods you are stomping on. + * + * const schema = new Schema(..); + * schema.methods.init = function () {} // potentially breaking + */ + +Schema.reserved = Object.create(null); +Schema.prototype.reserved = Schema.reserved; + +const reserved = Schema.reserved; +// Core object +reserved['prototype'] = +// EventEmitter +reserved.emit = +reserved.listeners = +reserved.removeListener = + +// document properties and functions +reserved.collection = +reserved.errors = +reserved.get = +reserved.init = +reserved.isModified = +reserved.isNew = +reserved.populated = +reserved.remove = +reserved.save = +reserved.toObject = +reserved.validate = 1; +reserved.collection = 1; + +/** + * Gets/sets schema paths. + * + * Sets a path (if arity 2) + * Gets a path (if arity 1) + * + * #### Example + * + * schema.path('name') // returns a SchemaType + * schema.path('name', Number) // changes the schemaType of `name` to Number + * + * @param {String} path + * @param {Object} constructor + * @api public + */ + +Schema.prototype.path = function(path, obj) { + // Convert to '.$' to check subpaths re: gh-6405 + const cleanPath = _pathToPositionalSyntax(path); + if (obj === undefined) { + let schematype = _getPath(this, path, cleanPath); + if (schematype != null) { + return schematype; + } + + // Look for maps + const mapPath = getMapPath(this, path); + if (mapPath != null) { + return mapPath; + } + + // Look if a parent of this path is mixed + schematype = this.hasMixedParent(cleanPath); + if (schematype != null) { + return schematype; + } + + // subpaths? + return /\.\d+\.?.*$/.test(path) + ? getPositionalPath(this, path) + : undefined; + } + + // some path names conflict with document methods + const firstPieceOfPath = path.split('.')[0]; + if (reserved[firstPieceOfPath] && !this.options.supressReservedKeysWarning) { + const errorMessage = `\`${firstPieceOfPath}\` is a reserved schema pathname and may break some functionality. ` + + 'You are allowed to use it, but use at your own risk. ' + + 'To disable this warning pass `supressReservedKeysWarning` as a schema option.'; + + utils.warn(errorMessage); + } + + if (typeof obj === 'object' && utils.hasUserDefinedProperty(obj, 'ref')) { + validateRef(obj.ref, path); + } + + // update the tree + const subpaths = path.split(/\./); + const last = subpaths.pop(); + let branch = this.tree; + let fullPath = ''; + + for (const sub of subpaths) { + fullPath = fullPath += (fullPath.length > 0 ? '.' : '') + sub; + if (!branch[sub]) { + this.nested[fullPath] = true; + branch[sub] = {}; + } + if (typeof branch[sub] !== 'object') { + const msg = 'Cannot set nested path `' + path + '`. ' + + 'Parent path `' + + fullPath + + '` already set to type ' + branch[sub].name + + '.'; + throw new Error(msg); + } + branch = branch[sub]; + } + + branch[last] = utils.clone(obj); + + this.paths[path] = this.interpretAsType(path, obj, this.options); + const schemaType = this.paths[path]; + + if (schemaType.$isSchemaMap) { + // Maps can have arbitrary keys, so `$*` is internal shorthand for "any key" + // The '$' is to imply this path should never be stored in MongoDB so we + // can easily build a regexp out of this path, and '*' to imply "any key." + const mapPath = path + '.$*'; + + this.paths[mapPath] = schemaType.$__schemaType; + this.mapPaths.push(this.paths[mapPath]); + } + + if (schemaType.$isSingleNested) { + for (const key of Object.keys(schemaType.schema.paths)) { + this.singleNestedPaths[path + '.' + key] = schemaType.schema.paths[key]; + } + for (const key of Object.keys(schemaType.schema.singleNestedPaths)) { + this.singleNestedPaths[path + '.' + key] = + schemaType.schema.singleNestedPaths[key]; + } + for (const key of Object.keys(schemaType.schema.subpaths)) { + this.singleNestedPaths[path + '.' + key] = + schemaType.schema.subpaths[key]; + } + for (const key of Object.keys(schemaType.schema.nested)) { + this.singleNestedPaths[path + '.' + key] = 'nested'; + } + + Object.defineProperty(schemaType.schema, 'base', { + configurable: true, + enumerable: false, + writable: false, + value: this.base + }); + + schemaType.caster.base = this.base; + this.childSchemas.push({ + schema: schemaType.schema, + model: schemaType.caster + }); + } else if (schemaType.$isMongooseDocumentArray) { + Object.defineProperty(schemaType.schema, 'base', { + configurable: true, + enumerable: false, + writable: false, + value: this.base + }); + + schemaType.casterConstructor.base = this.base; + this.childSchemas.push({ + schema: schemaType.schema, + model: schemaType.casterConstructor + }); + } + + if (schemaType.$isMongooseArray && schemaType.caster instanceof SchemaType) { + let arrayPath = path; + let _schemaType = schemaType; + + const toAdd = []; + while (_schemaType.$isMongooseArray) { + arrayPath = arrayPath + '.$'; + + // Skip arrays of document arrays + if (_schemaType.$isMongooseDocumentArray) { + _schemaType.$embeddedSchemaType._arrayPath = arrayPath; + _schemaType.$embeddedSchemaType._arrayParentPath = path; + _schemaType = _schemaType.$embeddedSchemaType.clone(); + } else { + _schemaType.caster._arrayPath = arrayPath; + _schemaType.caster._arrayParentPath = path; + _schemaType = _schemaType.caster.clone(); + } + + _schemaType.path = arrayPath; + toAdd.push(_schemaType); + } + + for (const _schemaType of toAdd) { + this.subpaths[_schemaType.path] = _schemaType; + } + } + + if (schemaType.$isMongooseDocumentArray) { + for (const key of Object.keys(schemaType.schema.paths)) { + const _schemaType = schemaType.schema.paths[key]; + this.subpaths[path + '.' + key] = _schemaType; + if (typeof _schemaType === 'object' && _schemaType != null) { + _schemaType.$isUnderneathDocArray = true; + } + } + for (const key of Object.keys(schemaType.schema.subpaths)) { + const _schemaType = schemaType.schema.subpaths[key]; + this.subpaths[path + '.' + key] = _schemaType; + if (typeof _schemaType === 'object' && _schemaType != null) { + _schemaType.$isUnderneathDocArray = true; + } + } + for (const key of Object.keys(schemaType.schema.singleNestedPaths)) { + const _schemaType = schemaType.schema.singleNestedPaths[key]; + this.subpaths[path + '.' + key] = _schemaType; + if (typeof _schemaType === 'object' && _schemaType != null) { + _schemaType.$isUnderneathDocArray = true; + } + } + } + + return this; +}; + +/*! + * ignore + */ + +function gatherChildSchemas(schema) { + const childSchemas = []; + + for (const path of Object.keys(schema.paths)) { + const schematype = schema.paths[path]; + if (schematype.$isMongooseDocumentArray || schematype.$isSingleNested) { + childSchemas.push({ schema: schematype.schema, model: schematype.caster }); + } + } + + return childSchemas; +} + +/*! + * ignore + */ + +function _getPath(schema, path, cleanPath) { + if (schema.paths.hasOwnProperty(path)) { + return schema.paths[path]; + } + if (schema.subpaths.hasOwnProperty(cleanPath)) { + return schema.subpaths[cleanPath]; + } + if (schema.singleNestedPaths.hasOwnProperty(cleanPath) && typeof schema.singleNestedPaths[cleanPath] === 'object') { + return schema.singleNestedPaths[cleanPath]; + } + + return null; +} + +/*! + * ignore + */ + +function _pathToPositionalSyntax(path) { + if (!/\.\d+/.test(path)) { + return path; + } + return path.replace(/\.\d+\./g, '.$.').replace(/\.\d+$/, '.$'); +} + +/*! + * ignore + */ + +function getMapPath(schema, path) { + if (schema.mapPaths.length === 0) { + return null; + } + for (const val of schema.mapPaths) { + const _path = val.path; + const re = new RegExp('^' + _path.replace(/\.\$\*/g, '\\.[^.]+') + '$'); + if (re.test(path)) { + return schema.paths[_path]; + } + } + + return null; +} + +/** + * The Mongoose instance this schema is associated with + * + * @property base + * @api private + */ + +Object.defineProperty(Schema.prototype, 'base', { + configurable: true, + enumerable: false, + writable: true, + value: null +}); + +/** + * Converts type arguments into Mongoose Types. + * + * @param {String} path + * @param {Object} obj constructor + * @api private + */ + +Schema.prototype.interpretAsType = function(path, obj, options) { + if (obj instanceof SchemaType) { + if (obj.path === path) { + return obj; + } + const clone = obj.clone(); + clone.path = path; + return clone; + } + + // If this schema has an associated Mongoose object, use the Mongoose object's + // copy of SchemaTypes re: gh-7158 gh-6933 + const MongooseTypes = this.base != null ? this.base.Schema.Types : Schema.Types; + + if (!utils.isPOJO(obj) && !(obj instanceof SchemaTypeOptions)) { + const constructorName = utils.getFunctionName(obj.constructor); + if (constructorName !== 'Object') { + const oldObj = obj; + obj = {}; + obj[options.typeKey] = oldObj; + } + } + + // Get the type making sure to allow keys named "type" + // and default to mixed if not specified. + // { type: { type: String, default: 'freshcut' } } + let type = obj[options.typeKey] && (obj[options.typeKey] instanceof Function || options.typeKey !== 'type' || !obj.type.type) + ? obj[options.typeKey] + : {}; + let name; + + if (utils.isPOJO(type) || type === 'mixed') { + return new MongooseTypes.Mixed(path, obj); + } + + if (Array.isArray(type) || type === Array || type === 'array' || type === MongooseTypes.Array) { + // if it was specified through { type } look for `cast` + let cast = (type === Array || type === 'array') + ? obj.cast || obj.of + : type[0]; + + // new Schema({ path: [new Schema({ ... })] }) + if (cast && cast.instanceOfSchema) { + if (!(cast instanceof Schema)) { + throw new TypeError('Schema for array path `' + path + + '` is from a different copy of the Mongoose module. ' + + 'Please make sure you\'re using the same version ' + + 'of Mongoose everywhere with `npm list mongoose`. If you are still ' + + 'getting this error, please add `new Schema()` around the path: ' + + `${path}: new Schema(...)`); + } + return new MongooseTypes.DocumentArray(path, cast, obj); + } + if (cast && + cast[options.typeKey] && + cast[options.typeKey].instanceOfSchema) { + if (!(cast[options.typeKey] instanceof Schema)) { + throw new TypeError('Schema for array path `' + path + + '` is from a different copy of the Mongoose module. ' + + 'Please make sure you\'re using the same version ' + + 'of Mongoose everywhere with `npm list mongoose`. If you are still ' + + 'getting this error, please add `new Schema()` around the path: ' + + `${path}: new Schema(...)`); + } + return new MongooseTypes.DocumentArray(path, cast[options.typeKey], obj, cast); + } + + if (Array.isArray(cast)) { + return new MongooseTypes.Array(path, this.interpretAsType(path, cast, options), obj); + } + + // Handle both `new Schema({ arr: [{ subpath: String }] })` and `new Schema({ arr: [{ type: { subpath: string } }] })` + const castFromTypeKey = (cast != null && cast[options.typeKey] && (options.typeKey !== 'type' || !cast.type.type)) ? + cast[options.typeKey] : + cast; + if (typeof cast === 'string') { + cast = MongooseTypes[cast.charAt(0).toUpperCase() + cast.substring(1)]; + } else if (utils.isPOJO(castFromTypeKey)) { + if (Object.keys(castFromTypeKey).length) { + // The `minimize` and `typeKey` options propagate to child schemas + // declared inline, like `{ arr: [{ val: { $type: String } }] }`. + // See gh-3560 + const childSchemaOptions = { minimize: options.minimize }; + if (options.typeKey) { + childSchemaOptions.typeKey = options.typeKey; + } + // propagate 'strict' option to child schema + if (options.hasOwnProperty('strict')) { + childSchemaOptions.strict = options.strict; + } + + if (this._userProvidedOptions.hasOwnProperty('_id')) { + childSchemaOptions._id = this._userProvidedOptions._id; + } else if (Schema.Types.DocumentArray.defaultOptions._id != null) { + childSchemaOptions._id = Schema.Types.DocumentArray.defaultOptions._id; + } + const childSchema = new Schema(castFromTypeKey, childSchemaOptions); + childSchema.$implicitlyCreated = true; + return new MongooseTypes.DocumentArray(path, childSchema, obj); + } else { + // Special case: empty object becomes mixed + return new MongooseTypes.Array(path, MongooseTypes.Mixed, obj); + } + } + + if (cast) { + type = cast[options.typeKey] && (options.typeKey !== 'type' || !cast.type.type) + ? cast[options.typeKey] + : cast; + + if (Array.isArray(type)) { + return new MongooseTypes.Array(path, this.interpretAsType(path, type, options), obj); + } + + name = typeof type === 'string' + ? type + : type.schemaName || utils.getFunctionName(type); + + // For Jest 26+, see #10296 + if (name === 'ClockDate') { + name = 'Date'; + } + + if (name === void 0) { + throw new TypeError('Invalid schema configuration: ' + + `Could not determine the embedded type for array \`${path}\`. ` + + 'See https://mongoosejs.com/docs/guide.html#definition for more info on supported schema syntaxes.'); + } + if (!MongooseTypes.hasOwnProperty(name)) { + throw new TypeError('Invalid schema configuration: ' + + `\`${name}\` is not a valid type within the array \`${path}\`.` + + 'See https://bit.ly/mongoose-schematypes for a list of valid schema types.'); + } + } + + return new MongooseTypes.Array(path, cast || MongooseTypes.Mixed, obj, options); + } + + if (type && type.instanceOfSchema) { + + return new MongooseTypes.Subdocument(type, path, obj); + } + + if (Buffer.isBuffer(type)) { + name = 'Buffer'; + } else if (typeof type === 'function' || typeof type === 'object') { + name = type.schemaName || utils.getFunctionName(type); + } else { + name = type == null ? '' + type : type.toString(); + } + + if (name) { + name = name.charAt(0).toUpperCase() + name.substring(1); + } + // Special case re: gh-7049 because the bson `ObjectID` class' capitalization + // doesn't line up with Mongoose's. + if (name === 'ObjectID') { + name = 'ObjectId'; + } + // For Jest 26+, see #10296 + if (name === 'ClockDate') { + name = 'Date'; + } + + if (name === void 0) { + throw new TypeError(`Invalid schema configuration: \`${path}\` schematype definition is ` + + 'invalid. See ' + + 'https://mongoosejs.com/docs/guide.html#definition for more info on supported schema syntaxes.'); + } + if (MongooseTypes[name] == null) { + throw new TypeError(`Invalid schema configuration: \`${name}\` is not ` + + `a valid type at path \`${path}\`. See ` + + 'https://bit.ly/mongoose-schematypes for a list of valid schema types.'); + } + + const schemaType = new MongooseTypes[name](path, obj); + + if (schemaType.$isSchemaMap) { + createMapNestedSchemaType(this, schemaType, path, obj, options); + } + + return schemaType; +}; + +/*! + * ignore + */ + +function createMapNestedSchemaType(schema, schemaType, path, obj, options) { + const mapPath = path + '.$*'; + let _mapType = { type: {} }; + if (utils.hasUserDefinedProperty(obj, 'of')) { + const isInlineSchema = utils.isPOJO(obj.of) && + Object.keys(obj.of).length > 0 && + !utils.hasUserDefinedProperty(obj.of, schema.options.typeKey); + if (isInlineSchema) { + _mapType = { [schema.options.typeKey]: new Schema(obj.of) }; + } else if (utils.isPOJO(obj.of)) { + _mapType = Object.assign({}, obj.of); + } else { + _mapType = { [schema.options.typeKey]: obj.of }; + } + + if (_mapType[schema.options.typeKey] && _mapType[schema.options.typeKey].instanceOfSchema) { + const subdocumentSchema = _mapType[schema.options.typeKey]; + subdocumentSchema.eachPath((subpath, type) => { + if (type.options.select === true || type.options.select === false) { + throw new MongooseError('Cannot use schema-level projections (`select: true` or `select: false`) within maps at path "' + path + '.' + subpath + '"'); + } + }); + } + + if (utils.hasUserDefinedProperty(obj, 'ref')) { + _mapType.ref = obj.ref; + } + } + schemaType.$__schemaType = schema.interpretAsType(mapPath, _mapType, options); +} + +/** + * Iterates the schemas paths similar to Array#forEach. + * + * The callback is passed the pathname and the schemaType instance. + * + * #### Example: + * + * const userSchema = new Schema({ name: String, registeredAt: Date }); + * userSchema.eachPath((pathname, schematype) => { + * // Prints twice: + * // name SchemaString { ... } + * // registeredAt SchemaDate { ... } + * console.log(pathname, schematype); + * }); + * + * @param {Function} fn callback function + * @return {Schema} this + * @api public + */ + +Schema.prototype.eachPath = function(fn) { + const keys = Object.keys(this.paths); + const len = keys.length; + + for (let i = 0; i < len; ++i) { + fn(keys[i], this.paths[keys[i]]); + } + + return this; +}; + +/** + * Returns an Array of path strings that are required by this schema. + * + * #### Example: + * const s = new Schema({ + * name: { type: String, required: true }, + * age: { type: String, required: true }, + * notes: String + * }); + * s.requiredPaths(); // [ 'age', 'name' ] + * + * @api public + * @param {Boolean} invalidate refresh the cache + * @return {Array} + */ + +Schema.prototype.requiredPaths = function requiredPaths(invalidate) { + if (this._requiredpaths && !invalidate) { + return this._requiredpaths; + } + + const paths = Object.keys(this.paths); + let i = paths.length; + const ret = []; + + while (i--) { + const path = paths[i]; + if (this.paths[path].isRequired) { + ret.push(path); + } + } + this._requiredpaths = ret; + return this._requiredpaths; +}; + +/** + * Returns indexes from fields and schema-level indexes (cached). + * + * @api private + * @return {Array} + */ + +Schema.prototype.indexedPaths = function indexedPaths() { + if (this._indexedpaths) { + return this._indexedpaths; + } + this._indexedpaths = this.indexes(); + return this._indexedpaths; +}; + +/** + * Returns the pathType of `path` for this schema. + * + * Given a path, returns whether it is a real, virtual, nested, or ad-hoc/undefined path. + * + * #### Example: + * const s = new Schema({ name: String, nested: { foo: String } }); + * s.virtual('foo').get(() => 42); + * s.pathType('name'); // "real" + * s.pathType('nested'); // "nested" + * s.pathType('foo'); // "virtual" + * s.pathType('fail'); // "adhocOrUndefined" + * + * @param {String} path + * @return {String} + * @api public + */ + +Schema.prototype.pathType = function(path) { + // Convert to '.$' to check subpaths re: gh-6405 + const cleanPath = _pathToPositionalSyntax(path); + + if (this.paths.hasOwnProperty(path)) { + return 'real'; + } + if (this.virtuals.hasOwnProperty(path)) { + return 'virtual'; + } + if (this.nested.hasOwnProperty(path)) { + return 'nested'; + } + if (this.subpaths.hasOwnProperty(cleanPath) || this.subpaths.hasOwnProperty(path)) { + return 'real'; + } + + const singleNestedPath = this.singleNestedPaths.hasOwnProperty(cleanPath) || this.singleNestedPaths.hasOwnProperty(path); + if (singleNestedPath) { + return singleNestedPath === 'nested' ? 'nested' : 'real'; + } + + // Look for maps + const mapPath = getMapPath(this, path); + if (mapPath != null) { + return 'real'; + } + + if (/\.\d+\.|\.\d+$/.test(path)) { + return getPositionalPathType(this, path); + } + return 'adhocOrUndefined'; +}; + +/** + * Returns true iff this path is a child of a mixed schema. + * + * @param {String} path + * @return {Boolean} + * @api private + */ + +Schema.prototype.hasMixedParent = function(path) { + const subpaths = path.split(/\./g); + path = ''; + for (let i = 0; i < subpaths.length; ++i) { + path = i > 0 ? path + '.' + subpaths[i] : subpaths[i]; + if (this.paths.hasOwnProperty(path) && + this.paths[path] instanceof MongooseTypes.Mixed) { + return this.paths[path]; + } + } + + return null; +}; + +/** + * Setup updatedAt and createdAt timestamps to documents if enabled + * + * @param {Boolean|Object} timestamps timestamps options + * @api private + */ +Schema.prototype.setupTimestamp = function(timestamps) { + return setupTimestamps(this, timestamps); +}; + +/*! + * ignore. Deprecated re: #6405 + */ + +function getPositionalPathType(self, path) { + const subpaths = path.split(/\.(\d+)\.|\.(\d+)$/).filter(Boolean); + if (subpaths.length < 2) { + return self.paths.hasOwnProperty(subpaths[0]) ? + self.paths[subpaths[0]] : + 'adhocOrUndefined'; + } + + let val = self.path(subpaths[0]); + let isNested = false; + if (!val) { + return 'adhocOrUndefined'; + } + + const last = subpaths.length - 1; + + for (let i = 1; i < subpaths.length; ++i) { + isNested = false; + const subpath = subpaths[i]; + + if (i === last && val && !/\D/.test(subpath)) { + if (val.$isMongooseDocumentArray) { + val = val.$embeddedSchemaType; + } else if (val instanceof MongooseTypes.Array) { + // StringSchema, NumberSchema, etc + val = val.caster; + } else { + val = undefined; + } + break; + } + + // ignore if its just a position segment: path.0.subpath + if (!/\D/.test(subpath)) { + // Nested array + if (val instanceof MongooseTypes.Array && i !== last) { + val = val.caster; + } + continue; + } + + if (!(val && val.schema)) { + val = undefined; + break; + } + + const type = val.schema.pathType(subpath); + isNested = (type === 'nested'); + val = val.schema.path(subpath); + } + + self.subpaths[path] = val; + if (val) { + return 'real'; + } + if (isNested) { + return 'nested'; + } + return 'adhocOrUndefined'; +} + + +/*! + * ignore + */ + +function getPositionalPath(self, path) { + getPositionalPathType(self, path); + return self.subpaths[path]; +} + +/** + * Adds a method call to the queue. + * + * #### Example: + * + * schema.methods.print = function() { console.log(this); }; + * schema.queue('print', []); // Print the doc every one is instantiated + * + * const Model = mongoose.model('Test', schema); + * new Model({ name: 'test' }); // Prints '{"_id": ..., "name": "test" }' + * + * @param {String} name name of the document method to call later + * @param {Array} args arguments to pass to the method + * @api public + */ + +Schema.prototype.queue = function(name, args) { + this.callQueue.push([name, args]); + return this; +}; + +/** + * Defines a pre hook for the model. + * + * #### Example + * + * const toySchema = new Schema({ name: String, created: Date }); + * + * toySchema.pre('save', function(next) { + * if (!this.created) this.created = new Date; + * next(); + * }); + * + * toySchema.pre('validate', function(next) { + * if (this.name !== 'Woody') this.name = 'Woody'; + * next(); + * }); + * + * // Equivalent to calling `pre()` on `find`, `findOne`, `findOneAndUpdate`. + * toySchema.pre(/^find/, function(next) { + * console.log(this.getFilter()); + * }); + * + * // Equivalent to calling `pre()` on `updateOne`, `findOneAndUpdate`. + * toySchema.pre(['updateOne', 'findOneAndUpdate'], function(next) { + * console.log(this.getFilter()); + * }); + * + * toySchema.pre('deleteOne', function() { + * // Runs when you call `Toy.deleteOne()` + * }); + * + * toySchema.pre('deleteOne', { document: true }, function() { + * // Runs when you call `doc.deleteOne()` + * }); + * + * @param {String|RegExp} The method name or regular expression to match method name + * @param {Object} [options] + * @param {Boolean} [options.document] If `name` is a hook for both document and query middleware, set to `true` to run on document middleware. For example, set `options.document` to `true` to apply this hook to `Document#deleteOne()` rather than `Query#deleteOne()`. + * @param {Boolean} [options.query] If `name` is a hook for both document and query middleware, set to `true` to run on query middleware. + * @param {Function} callback + * @api public + */ + +Schema.prototype.pre = function(name) { + if (name instanceof RegExp) { + const remainingArgs = Array.prototype.slice.call(arguments, 1); + for (const fn of hookNames) { + if (name.test(fn)) { + this.pre.apply(this, [fn].concat(remainingArgs)); + } + } + return this; + } + if (Array.isArray(name)) { + const remainingArgs = Array.prototype.slice.call(arguments, 1); + for (const el of name) { + this.pre.apply(this, [el].concat(remainingArgs)); + } + return this; + } + this.s.hooks.pre.apply(this.s.hooks, arguments); + return this; +}; + +/** + * Defines a post hook for the document + * + * const schema = new Schema(..); + * schema.post('save', function (doc) { + * console.log('this fired after a document was saved'); + * }); + * + * schema.post('find', function(docs) { + * console.log('this fired after you ran a find query'); + * }); + * + * schema.post(/Many$/, function(res) { + * console.log('this fired after you ran `updateMany()` or `deleteMany()`'); + * }); + * + * const Model = mongoose.model('Model', schema); + * + * const m = new Model(..); + * m.save(function(err) { + * console.log('this fires after the `post` hook'); + * }); + * + * m.find(function(err, docs) { + * console.log('this fires after the post find hook'); + * }); + * + * @param {String|RegExp} The method name or regular expression to match method name + * @param {Object} [options] + * @param {Boolean} [options.document] If `name` is a hook for both document and query middleware, set to `true` to run on document middleware. + * @param {Boolean} [options.query] If `name` is a hook for both document and query middleware, set to `true` to run on query middleware. + * @param {Function} fn callback + * @see middleware https://mongoosejs.com/docs/middleware.html + * @see kareem https://npmjs.org/package/kareem + * @api public + */ + +Schema.prototype.post = function(name) { + if (name instanceof RegExp) { + const remainingArgs = Array.prototype.slice.call(arguments, 1); + for (const fn of hookNames) { + if (name.test(fn)) { + this.post.apply(this, [fn].concat(remainingArgs)); + } + } + return this; + } + if (Array.isArray(name)) { + const remainingArgs = Array.prototype.slice.call(arguments, 1); + for (const el of name) { + this.post.apply(this, [el].concat(remainingArgs)); + } + return this; + } + this.s.hooks.post.apply(this.s.hooks, arguments); + return this; +}; + +/** + * Registers a plugin for this schema. + * + * #### Example: + * + * const s = new Schema({ name: String }); + * s.plugin(schema => console.log(schema.path('name').path)); + * mongoose.model('Test', s); // Prints 'name' + * + * @param {Function} plugin callback + * @param {Object} [opts] + * @see plugins + * @api public + */ + +Schema.prototype.plugin = function(fn, opts) { + if (typeof fn !== 'function') { + throw new Error('First param to `schema.plugin()` must be a function, ' + + 'got "' + (typeof fn) + '"'); + } + + if (opts && opts.deduplicate) { + for (const plugin of this.plugins) { + if (plugin.fn === fn) { + return this; + } + } + } + this.plugins.push({ fn: fn, opts: opts }); + + fn(this, opts); + return this; +}; + +/** + * Adds an instance method to documents constructed from Models compiled from this schema. + * + * #### Example + * + * const schema = kittySchema = new Schema(..); + * + * schema.method('meow', function () { + * console.log('meeeeeoooooooooooow'); + * }) + * + * const Kitty = mongoose.model('Kitty', schema); + * + * const fizz = new Kitty; + * fizz.meow(); // meeeeeooooooooooooow + * + * If a hash of name/fn pairs is passed as the only argument, each name/fn pair will be added as methods. + * + * schema.method({ + * purr: function () {} + * , scratch: function () {} + * }); + * + * // later + * fizz.purr(); + * fizz.scratch(); + * + * NOTE: `Schema.method()` adds instance methods to the `Schema.methods` object. You can also add instance methods directly to the `Schema.methods` object as seen in the [guide](/docs/guide.html#methods) + * + * @param {String|Object} method name + * @param {Function} [fn] + * @api public + */ + +Schema.prototype.method = function(name, fn, options) { + if (typeof name !== 'string') { + for (const i in name) { + this.methods[i] = name[i]; + this.methodOptions[i] = utils.clone(options); + } + } else { + this.methods[name] = fn; + this.methodOptions[name] = utils.clone(options); + } + return this; +}; + +/** + * Adds static "class" methods to Models compiled from this schema. + * + * #### Example + * + * const schema = new Schema(..); + * // Equivalent to `schema.statics.findByName = function(name) {}`; + * schema.static('findByName', function(name) { + * return this.find({ name: name }); + * }); + * + * const Drink = mongoose.model('Drink', schema); + * await Drink.findByName('LaCroix'); + * + * If a hash of name/fn pairs is passed as the only argument, each name/fn pair will be added as statics. + * + * @param {String|Object} name + * @param {Function} [fn] + * @api public + * @see Statics /docs/guide.html#statics + */ + +Schema.prototype.static = function(name, fn) { + if (typeof name !== 'string') { + for (const i in name) { + this.statics[i] = name[i]; + } + } else { + this.statics[name] = fn; + } + return this; +}; + +/** + * Defines an index (most likely compound) for this schema. + * + * #### Example + * + * schema.index({ first: 1, last: -1 }) + * + * @param {Object} fields + * @param {Object} [options] Options to pass to [MongoDB driver's `createIndex()` function](https://mongodb.github.io/node-mongodb-native/2.0/api/Collection.html#createIndex) + * @param {String | number} [options.expires=null] Mongoose-specific syntactic sugar, uses [ms](https://www.npmjs.com/package/ms) to convert `expires` option into seconds for the `expireAfterSeconds` in the above link. + * @api public + */ + +Schema.prototype.index = function(fields, options) { + fields || (fields = {}); + options || (options = {}); + + if (options.expires) { + utils.expires(options); + } + + this._indexes.push([fields, options]); + return this; +}; + +/** + * Sets a schema option. + * + * #### Example + * + * schema.set('strict'); // 'true' by default + * schema.set('strict', false); // Sets 'strict' to false + * schema.set('strict'); // 'false' + * + * @param {String} key option name + * @param {Object} [value] if not passed, the current option value is returned + * @see Schema ./ + * @api public + */ + +Schema.prototype.set = function(key, value, _tags) { + if (arguments.length === 1) { + return this.options[key]; + } + + switch (key) { + case 'read': + this.options[key] = readPref(value, _tags); + this._userProvidedOptions[key] = this.options[key]; + break; + case 'timestamps': + this.setupTimestamp(value); + this.options[key] = value; + this._userProvidedOptions[key] = this.options[key]; + break; + case '_id': + this.options[key] = value; + this._userProvidedOptions[key] = this.options[key]; + + if (value && !this.paths['_id']) { + addAutoId(this); + } else if (!value && this.paths['_id'] != null && this.paths['_id'].auto) { + this.remove('_id'); + } + break; + default: + this.options[key] = value; + this._userProvidedOptions[key] = this.options[key]; + break; + } + + return this; +}; + +/** + * Gets a schema option. + * + * #### Example: + * + * schema.get('strict'); // true + * schema.set('strict', false); + * schema.get('strict'); // false + * + * @param {String} key option name + * @api public + * @return {Any} the option's value + */ + +Schema.prototype.get = function(key) { + return this.options[key]; +}; + +/** + * The allowed index types + * + * @receiver Schema + * @static indexTypes + * @api public + */ + +const indexTypes = '2d 2dsphere hashed text'.split(' '); + +Object.defineProperty(Schema, 'indexTypes', { + get: function() { + return indexTypes; + }, + set: function() { + throw new Error('Cannot overwrite Schema.indexTypes'); + } +}); + +/** + * Returns a list of indexes that this schema declares, via `schema.index()` or by `index: true` in a path's options. + * Indexes are expressed as an array `[spec, options]`. + * + * #### Example: + * + * const userSchema = new Schema({ + * email: { type: String, required: true, unique: true }, + * registeredAt: { type: Date, index: true } + * }); + * + * // [ [ { email: 1 }, { unique: true, background: true } ], + * // [ { registeredAt: 1 }, { background: true } ] ] + * userSchema.indexes(); + * + * [Plugins](/docs/plugins.html) can use the return value of this function to modify a schema's indexes. + * For example, the below plugin makes every index unique by default. + * + * function myPlugin(schema) { + * for (const index of schema.indexes()) { + * if (index[1].unique === undefined) { + * index[1].unique = true; + * } + * } + * } + * + * @api public + * @return {Array} list of indexes defined in the schema + */ + +Schema.prototype.indexes = function() { + return getIndexes(this); +}; + +/** + * Creates a virtual type with the given name. + * + * @param {String} name + * @param {Object} [options] + * @param {String|Model} [options.ref] model name or model instance. Marks this as a [populate virtual](/docs/populate.html#populate-virtuals). + * @param {String|Function} [options.localField] Required for populate virtuals. See [populate virtual docs](/docs/populate.html#populate-virtuals) for more information. + * @param {String|Function} [options.foreignField] Required for populate virtuals. See [populate virtual docs](/docs/populate.html#populate-virtuals) for more information. + * @param {Boolean|Function} [options.justOne=false] Only works with populate virtuals. If [truthy](https://masteringjs.io/tutorials/fundamentals/truthy), will be a single doc or `null`. Otherwise, the populate virtual will be an array. + * @param {Boolean} [options.count=false] Only works with populate virtuals. If [truthy](https://masteringjs.io/tutorials/fundamentals/truthy), this populate virtual will contain the number of documents rather than the documents themselves when you `populate()`. + * @param {Function|null} [options.get=null] Adds a [getter](/docs/tutorials/getters-setters.html) to this virtual to transform the populated doc. + * @return {VirtualType} + */ + +Schema.prototype.virtual = function(name, options) { + if (name instanceof VirtualType || getConstructorName(name) === 'VirtualType') { + return this.virtual(name.path, name.options); + } + + options = new VirtualOptions(options); + + if (utils.hasUserDefinedProperty(options, ['ref', 'refPath'])) { + if (options.localField == null) { + throw new Error('Reference virtuals require `localField` option'); + } + + if (options.foreignField == null) { + throw new Error('Reference virtuals require `foreignField` option'); + } + + this.pre('init', function(obj) { + if (mpath.has(name, obj)) { + const _v = mpath.get(name, obj); + if (!this.$$populatedVirtuals) { + this.$$populatedVirtuals = {}; + } + + if (options.justOne || options.count) { + this.$$populatedVirtuals[name] = Array.isArray(_v) ? + _v[0] : + _v; + } else { + this.$$populatedVirtuals[name] = Array.isArray(_v) ? + _v : + _v == null ? [] : [_v]; + } + + mpath.unset(name, obj); + } + }); + + const virtual = this.virtual(name); + virtual.options = options; + + virtual. + set(function(_v) { + if (!this.$$populatedVirtuals) { + this.$$populatedVirtuals = {}; + } + + if (options.justOne || options.count) { + this.$$populatedVirtuals[name] = Array.isArray(_v) ? + _v[0] : + _v; + + if (typeof this.$$populatedVirtuals[name] !== 'object') { + this.$$populatedVirtuals[name] = options.count ? _v : null; + } + } else { + this.$$populatedVirtuals[name] = Array.isArray(_v) ? + _v : + _v == null ? [] : [_v]; + + this.$$populatedVirtuals[name] = this.$$populatedVirtuals[name].filter(function(doc) { + return doc && typeof doc === 'object'; + }); + } + }); + + if (typeof options.get === 'function') { + virtual.get(options.get); + } + + // Workaround for gh-8198: if virtual is under document array, make a fake + // virtual. See gh-8210 + const parts = name.split('.'); + let cur = parts[0]; + for (let i = 0; i < parts.length - 1; ++i) { + if (this.paths[cur] != null && this.paths[cur].$isMongooseDocumentArray) { + const remnant = parts.slice(i + 1).join('.'); + this.paths[cur].schema.virtual(remnant, options); + break; + } + + cur += '.' + parts[i + 1]; + } + + return virtual; + } + + const virtuals = this.virtuals; + const parts = name.split('.'); + + if (this.pathType(name) === 'real') { + throw new Error('Virtual path "' + name + '"' + + ' conflicts with a real path in the schema'); + } + + virtuals[name] = parts.reduce(function(mem, part, i) { + mem[part] || (mem[part] = (i === parts.length - 1) + ? new VirtualType(options, name) + : {}); + return mem[part]; + }, this.tree); + + return virtuals[name]; +}; + +/** + * Returns the virtual type with the given `name`. + * + * @param {String} name + * @return {VirtualType} + */ + +Schema.prototype.virtualpath = function(name) { + return this.virtuals.hasOwnProperty(name) ? this.virtuals[name] : null; +}; + +/** + * Removes the given `path` (or [`paths`]). + * + * #### Example: + * + * const schema = new Schema({ name: String, age: Number }); + * schema.remove('name'); + * schema.path('name'); // Undefined + * schema.path('age'); // SchemaNumber { ... } + * + * @param {String|Array} path + * @return {Schema} the Schema instance + * @api public + */ +Schema.prototype.remove = function(path) { + if (typeof path === 'string') { + path = [path]; + } + if (Array.isArray(path)) { + path.forEach(function(name) { + if (this.path(name) == null && !this.nested[name]) { + return; + } + if (this.nested[name]) { + const allKeys = Object.keys(this.paths). + concat(Object.keys(this.nested)); + for (const path of allKeys) { + if (path.startsWith(name + '.')) { + delete this.paths[path]; + delete this.nested[path]; + _deletePath(this, path); + } + } + + delete this.nested[name]; + _deletePath(this, name); + return; + } + + delete this.paths[name]; + _deletePath(this, name); + }, this); + } + return this; +}; + +/*! + * ignore + */ + +function _deletePath(schema, name) { + const pieces = name.split('.'); + const last = pieces.pop(); + + let branch = schema.tree; + + for (const piece of pieces) { + branch = branch[piece]; + } + + delete branch[last]; +} + +/** + * Loads an ES6 class into a schema. Maps [setters](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/set) + [getters](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/get), [static methods](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes/static), + * and [instance methods](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes#Class_body_and_method_definitions) + * to schema [virtuals](/docs/guide.html#virtuals), + * [statics](/docs/guide.html#statics), and + * [methods](/docs/guide.html#methods). + * + * #### Example: + * + * ```javascript + * const md5 = require('md5'); + * const userSchema = new Schema({ email: String }); + * class UserClass { + * // `gravatarImage` becomes a virtual + * get gravatarImage() { + * const hash = md5(this.email.toLowerCase()); + * return `https://www.gravatar.com/avatar/${hash}`; + * } + * + * // `getProfileUrl()` becomes a document method + * getProfileUrl() { + * return `https://mysite.com/${this.email}`; + * } + * + * // `findByEmail()` becomes a static + * static findByEmail(email) { + * return this.findOne({ email }); + * } + * } + * + * // `schema` will now have a `gravatarImage` virtual, a `getProfileUrl()` method, + * // and a `findByEmail()` static + * userSchema.loadClass(UserClass); + * ``` + * + * @param {Function} model + * @param {Boolean} [virtualsOnly] if truthy, only pulls virtuals from the class, not methods or statics + */ +Schema.prototype.loadClass = function(model, virtualsOnly) { + if (model === Object.prototype || + model === Function.prototype || + model.prototype.hasOwnProperty('$isMongooseModelPrototype')) { + return this; + } + + this.loadClass(Object.getPrototypeOf(model), virtualsOnly); + + // Add static methods + if (!virtualsOnly) { + Object.getOwnPropertyNames(model).forEach(function(name) { + if (name.match(/^(length|name|prototype|constructor|__proto__)$/)) { + return; + } + const prop = Object.getOwnPropertyDescriptor(model, name); + if (prop.hasOwnProperty('value')) { + this.static(name, prop.value); + } + }, this); + } + + // Add methods and virtuals + Object.getOwnPropertyNames(model.prototype).forEach(function(name) { + if (name.match(/^(constructor)$/)) { + return; + } + const method = Object.getOwnPropertyDescriptor(model.prototype, name); + if (!virtualsOnly) { + if (typeof method.value === 'function') { + this.method(name, method.value); + } + } + if (typeof method.get === 'function') { + if (this.virtuals[name]) { + this.virtuals[name].getters = []; + } + this.virtual(name).get(method.get); + } + if (typeof method.set === 'function') { + if (this.virtuals[name]) { + this.virtuals[name].setters = []; + } + this.virtual(name).set(method.set); + } + }, this); + + return this; +}; + +/*! + * ignore + */ + +Schema.prototype._getSchema = function(path) { + const _this = this; + const pathschema = _this.path(path); + const resultPath = []; + + if (pathschema) { + pathschema.$fullPath = path; + return pathschema; + } + + function search(parts, schema) { + let p = parts.length + 1; + let foundschema; + let trypath; + + while (p--) { + trypath = parts.slice(0, p).join('.'); + foundschema = schema.path(trypath); + if (foundschema) { + resultPath.push(trypath); + + if (foundschema.caster) { + // array of Mixed? + if (foundschema.caster instanceof MongooseTypes.Mixed) { + foundschema.caster.$fullPath = resultPath.join('.'); + return foundschema.caster; + } + + // Now that we found the array, we need to check if there + // are remaining document paths to look up for casting. + // Also we need to handle array.$.path since schema.path + // doesn't work for that. + // If there is no foundschema.schema we are dealing with + // a path like array.$ + if (p !== parts.length) { + if (foundschema.schema) { + let ret; + if (parts[p] === '$' || isArrayFilter(parts[p])) { + if (p + 1 === parts.length) { + // comments.$ + return foundschema; + } + // comments.$.comments.$.title + ret = search(parts.slice(p + 1), foundschema.schema); + if (ret) { + ret.$isUnderneathDocArray = ret.$isUnderneathDocArray || + !foundschema.schema.$isSingleNested; + } + return ret; + } + // this is the last path of the selector + ret = search(parts.slice(p), foundschema.schema); + if (ret) { + ret.$isUnderneathDocArray = ret.$isUnderneathDocArray || + !foundschema.schema.$isSingleNested; + } + return ret; + } + } + } else if (foundschema.$isSchemaMap) { + if (p >= parts.length) { + return foundschema; + } + // Any path in the map will be an instance of the map's embedded schematype + if (p + 1 >= parts.length) { + return foundschema.$__schemaType; + } + const ret = search(parts.slice(p + 1), foundschema.$__schemaType.schema); + return ret; + } + + foundschema.$fullPath = resultPath.join('.'); + + return foundschema; + } + } + } + + // look for arrays + const parts = path.split('.'); + for (let i = 0; i < parts.length; ++i) { + if (parts[i] === '$' || isArrayFilter(parts[i])) { + // Re: gh-5628, because `schema.path()` doesn't take $ into account. + parts[i] = '0'; + } + } + return search(parts, _this); +}; + +/*! + * ignore + */ + +Schema.prototype._getPathType = function(path) { + const _this = this; + const pathschema = _this.path(path); + + if (pathschema) { + return 'real'; + } + + function search(parts, schema) { + let p = parts.length + 1, + foundschema, + trypath; + + while (p--) { + trypath = parts.slice(0, p).join('.'); + foundschema = schema.path(trypath); + if (foundschema) { + if (foundschema.caster) { + // array of Mixed? + if (foundschema.caster instanceof MongooseTypes.Mixed) { + return { schema: foundschema, pathType: 'mixed' }; + } + + // Now that we found the array, we need to check if there + // are remaining document paths to look up for casting. + // Also we need to handle array.$.path since schema.path + // doesn't work for that. + // If there is no foundschema.schema we are dealing with + // a path like array.$ + if (p !== parts.length && foundschema.schema) { + if (parts[p] === '$' || isArrayFilter(parts[p])) { + if (p === parts.length - 1) { + return { schema: foundschema, pathType: 'nested' }; + } + // comments.$.comments.$.title + return search(parts.slice(p + 1), foundschema.schema); + } + // this is the last path of the selector + return search(parts.slice(p), foundschema.schema); + } + return { + schema: foundschema, + pathType: foundschema.$isSingleNested ? 'nested' : 'array' + }; + } + return { schema: foundschema, pathType: 'real' }; + } else if (p === parts.length && schema.nested[trypath]) { + return { schema: schema, pathType: 'nested' }; + } + } + return { schema: foundschema || schema, pathType: 'undefined' }; + } + + // look for arrays + return search(path.split('.'), _this); +}; + +/*! + * ignore + */ + +function isArrayFilter(piece) { + return piece.startsWith('$[') && piece.endsWith(']'); +} + +/*! + * Called by `compile()` _right before_ compiling. Good for making any changes to + * the schema that should respect options set by plugins, like `id` + */ + +Schema.prototype._preCompile = function _preCompile() { + idGetter(this); +}; + +/*! + * Module exports. + */ + +module.exports = exports = Schema; + +// require down here because of reference issues + +/** + * The various built-in Mongoose Schema Types. + * + * #### Example: + * + * const mongoose = require('mongoose'); + * const ObjectId = mongoose.Schema.Types.ObjectId; + * + * #### Types: + * + * - [String](/docs/schematypes.html#strings) + * - [Number](/docs/schematypes.html#numbers) + * - [Boolean](/docs/schematypes.html#booleans) | Bool + * - [Array](/docs/schematypes.html#arrays) + * - [Buffer](/docs/schematypes.html#buffers) + * - [Date](/docs/schematypes.html#dates) + * - [ObjectId](/docs/schematypes.html#objectids) | Oid + * - [Mixed](/docs/schematypes.html#mixed) + * + * Using this exposed access to the `Mixed` SchemaType, we can use them in our schema. + * + * const Mixed = mongoose.Schema.Types.Mixed; + * new mongoose.Schema({ _user: Mixed }) + * + * @api public + */ + +Schema.Types = MongooseTypes = require('./schema/index'); + +/*! + * ignore + */ + +exports.ObjectId = MongooseTypes.ObjectId; diff --git a/node_modules/mongoose/lib/schema/SubdocumentPath.js b/node_modules/mongoose/lib/schema/SubdocumentPath.js new file mode 100644 index 000000000..94a8c5886 --- /dev/null +++ b/node_modules/mongoose/lib/schema/SubdocumentPath.js @@ -0,0 +1,350 @@ +'use strict'; + +/*! + * Module dependencies. + */ + +const CastError = require('../error/cast'); +const EventEmitter = require('events').EventEmitter; +const ObjectExpectedError = require('../error/objectExpected'); +const SchemaSubdocumentOptions = require('../options/SchemaSubdocumentOptions'); +const SchemaType = require('../schematype'); +const $exists = require('./operators/exists'); +const castToNumber = require('./operators/helpers').castToNumber; +const discriminator = require('../helpers/model/discriminator'); +const geospatial = require('./operators/geospatial'); +const getConstructor = require('../helpers/discriminator/getConstructor'); +const handleIdOption = require('../helpers/schema/handleIdOption'); +const internalToObjectOptions = require('../options').internalToObjectOptions; +const utils = require('../utils'); + +let Subdocument; + +module.exports = SubdocumentPath; + +/** + * Single nested subdocument SchemaType constructor. + * + * @param {Schema} schema + * @param {String} path + * @param {Object} options + * @inherits SchemaType + * @api public + */ + +function SubdocumentPath(schema, path, options) { + const schemaTypeIdOption = SubdocumentPath.defaultOptions && + SubdocumentPath.defaultOptions._id; + if (schemaTypeIdOption != null) { + options = options || {}; + options._id = schemaTypeIdOption; + } + + schema = handleIdOption(schema, options); + + this.caster = _createConstructor(schema); + this.caster.path = path; + this.caster.prototype.$basePath = path; + this.schema = schema; + this.$isSingleNested = true; + SchemaType.call(this, path, options, 'Embedded'); +} + +/*! + * ignore + */ + +SubdocumentPath.prototype = Object.create(SchemaType.prototype); +SubdocumentPath.prototype.constructor = SubdocumentPath; +SubdocumentPath.prototype.OptionsConstructor = SchemaSubdocumentOptions; + +/*! + * ignore + */ + +function _createConstructor(schema, baseClass) { + // lazy load + Subdocument || (Subdocument = require('../types/subdocument')); + + const _embedded = function SingleNested(value, path, parent) { + this.$__parent = parent; + Subdocument.apply(this, arguments); + + if (parent == null) { + return; + } + this.$session(parent.$session()); + }; + + schema._preCompile(); + + const proto = baseClass != null ? baseClass.prototype : Subdocument.prototype; + _embedded.prototype = Object.create(proto); + _embedded.prototype.$__setSchema(schema); + _embedded.prototype.constructor = _embedded; + _embedded.schema = schema; + _embedded.$isSingleNested = true; + _embedded.events = new EventEmitter(); + _embedded.prototype.toBSON = function() { + return this.toObject(internalToObjectOptions); + }; + + // apply methods + for (const i in schema.methods) { + _embedded.prototype[i] = schema.methods[i]; + } + + // apply statics + for (const i in schema.statics) { + _embedded[i] = schema.statics[i]; + } + + for (const i in EventEmitter.prototype) { + _embedded[i] = EventEmitter.prototype[i]; + } + + return _embedded; +} + +/*! + * Special case for when users use a common location schema to represent + * locations for use with $geoWithin. + * https://docs.mongodb.org/manual/reference/operator/query/geoWithin/ + * + * @param {Object} val + * @api private + */ + +SubdocumentPath.prototype.$conditionalHandlers.$geoWithin = function handle$geoWithin(val) { + return { $geometry: this.castForQuery(val.$geometry) }; +}; + +/*! + * ignore + */ + +SubdocumentPath.prototype.$conditionalHandlers.$near = +SubdocumentPath.prototype.$conditionalHandlers.$nearSphere = geospatial.cast$near; + +SubdocumentPath.prototype.$conditionalHandlers.$within = +SubdocumentPath.prototype.$conditionalHandlers.$geoWithin = geospatial.cast$within; + +SubdocumentPath.prototype.$conditionalHandlers.$geoIntersects = + geospatial.cast$geoIntersects; + +SubdocumentPath.prototype.$conditionalHandlers.$minDistance = castToNumber; +SubdocumentPath.prototype.$conditionalHandlers.$maxDistance = castToNumber; + +SubdocumentPath.prototype.$conditionalHandlers.$exists = $exists; + +/** + * Casts contents + * + * @param {Object} value + * @api private + */ + +SubdocumentPath.prototype.cast = function(val, doc, init, priorVal, options) { + if (val && val.$isSingleNested && val.parent === doc) { + return val; + } + + if (val != null && (typeof val !== 'object' || Array.isArray(val))) { + throw new ObjectExpectedError(this.path, val); + } + + const Constructor = getConstructor(this.caster, val); + + let subdoc; + + // Only pull relevant selected paths and pull out the base path + const parentSelected = doc && doc.$__ && doc.$__.selected || {}; + const path = this.path; + const selected = Object.keys(parentSelected).reduce((obj, key) => { + if (key.startsWith(path + '.')) { + obj = obj || {}; + obj[key.substring(path.length + 1)] = parentSelected[key]; + } + return obj; + }, null); + options = Object.assign({}, options, { priorDoc: priorVal }); + if (init) { + subdoc = new Constructor(void 0, selected, doc); + subdoc.$init(val); + } else { + if (Object.keys(val).length === 0) { + return new Constructor({}, selected, doc, undefined, options); + } + + return new Constructor(val, selected, doc, undefined, options); + } + + return subdoc; +}; + +/** + * Casts contents for query + * + * @param {string} [$conditional] optional query operator (like `$eq` or `$in`) + * @param {any} value + * @api private + */ + +SubdocumentPath.prototype.castForQuery = function($conditional, val, options) { + let handler; + if (arguments.length === 2) { + handler = this.$conditionalHandlers[$conditional]; + if (!handler) { + throw new Error('Can\'t use ' + $conditional); + } + return handler.call(this, val); + } + val = $conditional; + if (val == null) { + return val; + } + + if (this.options.runSetters) { + val = this._applySetters(val); + } + + const Constructor = getConstructor(this.caster, val); + const overrideStrict = options != null && options.strict != null ? + options.strict : + void 0; + + try { + val = new Constructor(val, overrideStrict); + } catch (error) { + // Make sure we always wrap in a CastError (gh-6803) + if (!(error instanceof CastError)) { + throw new CastError('Embedded', val, this.path, error, this); + } + throw error; + } + return val; +}; + +/** + * Async validation on this single nested doc. + * + * @api private + */ + +SubdocumentPath.prototype.doValidate = function(value, fn, scope, options) { + const Constructor = getConstructor(this.caster, value); + + if (value && !(value instanceof Constructor)) { + value = new Constructor(value, null, (scope != null && scope.$__ != null) ? scope : null); + } + + if (options && options.skipSchemaValidators) { + if (!value) { + return fn(null); + } + return value.validate(fn); + } + + SchemaType.prototype.doValidate.call(this, value, function(error) { + if (error) { + return fn(error); + } + if (!value) { + return fn(null); + } + + value.validate(fn); + }, scope, options); +}; + +/** + * Synchronously validate this single nested doc + * + * @api private + */ + +SubdocumentPath.prototype.doValidateSync = function(value, scope, options) { + if (!options || !options.skipSchemaValidators) { + const schemaTypeError = SchemaType.prototype.doValidateSync.call(this, value, scope); + if (schemaTypeError) { + return schemaTypeError; + } + } + if (!value) { + return; + } + return value.validateSync(); +}; + +/** + * Adds a discriminator to this single nested subdocument. + * + * #### Example: + * const shapeSchema = Schema({ name: String }, { discriminatorKey: 'kind' }); + * const schema = Schema({ shape: shapeSchema }); + * + * const singleNestedPath = parentSchema.path('shape'); + * singleNestedPath.discriminator('Circle', Schema({ radius: Number })); + * + * @param {String} name + * @param {Schema} schema fields to add to the schema for instances of this sub-class + * @param {Object|string} [options] If string, same as `options.value`. + * @param {String} [options.value] the string stored in the `discriminatorKey` property. If not specified, Mongoose uses the `name` parameter. + * @param {Boolean} [options.clone=true] By default, `discriminator()` clones the given `schema`. Set to `false` to skip cloning. + * @return {Function} the constructor Mongoose will use for creating instances of this discriminator model + * @see discriminators /docs/discriminators.html + * @api public + */ + +SubdocumentPath.prototype.discriminator = function(name, schema, options) { + options = options || {}; + const value = utils.isPOJO(options) ? options.value : options; + const clone = typeof options.clone === 'boolean' + ? options.clone + : true; + + if (schema.instanceOfSchema && clone) { + schema = schema.clone(); + } + + schema = discriminator(this.caster, name, schema, value); + + this.caster.discriminators[name] = _createConstructor(schema, this.caster); + + return this.caster.discriminators[name]; +}; + +/** + * Sets a default option for all SubdocumentPath instances. + * + * #### Example: + * + * // Make all numbers have option `min` equal to 0. + * mongoose.Schema.Embedded.set('required', true); + * + * @param {String} option - The option you'd like to set the value for + * @param {*} value - value for option + * @return {undefined} + * @function set + * @static + * @api public + */ + +SubdocumentPath.defaultOptions = {}; + +SubdocumentPath.set = SchemaType.set; + +/*! + * ignore + */ + +SubdocumentPath.prototype.clone = function() { + const options = Object.assign({}, this.options); + const schematype = new this.constructor(this.schema, this.path, options); + schematype.validators = this.validators.slice(); + if (this.requiredValidator !== undefined) { + schematype.requiredValidator = this.requiredValidator; + } + schematype.caster.discriminators = Object.assign({}, this.caster.discriminators); + return schematype; +}; diff --git a/node_modules/mongoose/lib/schema/array.js b/node_modules/mongoose/lib/schema/array.js new file mode 100644 index 000000000..73ec401ad --- /dev/null +++ b/node_modules/mongoose/lib/schema/array.js @@ -0,0 +1,662 @@ +'use strict'; + +/*! + * Module dependencies. + */ + +const $exists = require('./operators/exists'); +const $type = require('./operators/type'); +const MongooseError = require('../error/mongooseError'); +const SchemaArrayOptions = require('../options/SchemaArrayOptions'); +const SchemaType = require('../schematype'); +const CastError = SchemaType.CastError; +const Mixed = require('./mixed'); +const arrayDepth = require('../helpers/arrayDepth'); +const cast = require('../cast'); +const isOperator = require('../helpers/query/isOperator'); +const util = require('util'); +const utils = require('../utils'); +const castToNumber = require('./operators/helpers').castToNumber; +const geospatial = require('./operators/geospatial'); +const getDiscriminatorByValue = require('../helpers/discriminator/getDiscriminatorByValue'); + +let MongooseArray; +let EmbeddedDoc; + +const isNestedArraySymbol = Symbol('mongoose#isNestedArray'); +const emptyOpts = Object.freeze({}); + +/** + * Array SchemaType constructor + * + * @param {String} key + * @param {SchemaType} cast + * @param {Object} options + * @param {Object} schemaOptions + * @inherits SchemaType + * @api public + */ + +function SchemaArray(key, cast, options, schemaOptions) { + // lazy load + EmbeddedDoc || (EmbeddedDoc = require('../types').Embedded); + + let typeKey = 'type'; + if (schemaOptions && schemaOptions.typeKey) { + typeKey = schemaOptions.typeKey; + } + this.schemaOptions = schemaOptions; + + if (cast) { + let castOptions = {}; + + if (utils.isPOJO(cast)) { + if (cast[typeKey]) { + // support { type: Woot } + castOptions = utils.clone(cast); // do not alter user arguments + delete castOptions[typeKey]; + cast = cast[typeKey]; + } else { + cast = Mixed; + } + } + + if (options != null && options.ref != null && castOptions.ref == null) { + castOptions.ref = options.ref; + } + + if (cast === Object) { + cast = Mixed; + } + + // support { type: 'String' } + const name = typeof cast === 'string' + ? cast + : utils.getFunctionName(cast); + + const Types = require('./index.js'); + const caster = Types.hasOwnProperty(name) ? Types[name] : cast; + + this.casterConstructor = caster; + + if (this.casterConstructor instanceof SchemaArray) { + this.casterConstructor[isNestedArraySymbol] = true; + } + + if (typeof caster === 'function' && + !caster.$isArraySubdocument && + !caster.$isSchemaMap) { + const path = this.caster instanceof EmbeddedDoc ? null : key; + this.caster = new caster(path, castOptions); + } else { + this.caster = caster; + if (!(this.caster instanceof EmbeddedDoc)) { + this.caster.path = key; + } + } + + this.$embeddedSchemaType = this.caster; + } + + this.$isMongooseArray = true; + + SchemaType.call(this, key, options, 'Array'); + + let defaultArr; + let fn; + + if (this.defaultValue != null) { + defaultArr = this.defaultValue; + fn = typeof defaultArr === 'function'; + } + + if (!('defaultValue' in this) || this.defaultValue !== void 0) { + const defaultFn = function() { + // Leave it up to `cast()` to convert the array + return fn + ? defaultArr.call(this) + : defaultArr != null + ? [].concat(defaultArr) + : []; + }; + defaultFn.$runBeforeSetters = !fn; + this.default(defaultFn); + } +} + +/** + * This schema type's name, to defend against minifiers that mangle + * function names. + * + * @api public + */ +SchemaArray.schemaName = 'Array'; + + +/** + * Options for all arrays. + * + * - `castNonArrays`: `true` by default. If `false`, Mongoose will throw a CastError when a value isn't an array. If `true`, Mongoose will wrap the provided value in an array before casting. + * + * @static options + * @api public + */ + +SchemaArray.options = { castNonArrays: true }; + +/*! + * ignore + */ + +SchemaArray.defaultOptions = {}; + +/** + * Sets a default option for all Array instances. + * + * #### Example: + * + * // Make all Array instances have `required` of true by default. + * mongoose.Schema.Array.set('required', true); + * + * const User = mongoose.model('User', new Schema({ test: Array })); + * new User({ }).validateSync().errors.test.message; // Path `test` is required. + * + * @param {String} option - The option you'd like to set the value for + * @param {*} value - value for option + * @return {undefined} + * @function set + * @api public + */ +SchemaArray.set = SchemaType.set; + +/*! + * Inherits from SchemaType. + */ +SchemaArray.prototype = Object.create(SchemaType.prototype); +SchemaArray.prototype.constructor = SchemaArray; +SchemaArray.prototype.OptionsConstructor = SchemaArrayOptions; + +/*! + * ignore + */ + +SchemaArray._checkRequired = SchemaType.prototype.checkRequired; + +/** + * Override the function the required validator uses to check whether an array + * passes the `required` check. + * + * #### Example: + * + * // Require non-empty array to pass `required` check + * mongoose.Schema.Types.Array.checkRequired(v => Array.isArray(v) && v.length); + * + * const M = mongoose.model({ arr: { type: Array, required: true } }); + * new M({ arr: [] }).validateSync(); // `null`, validation fails! + * + * @param {Function} fn + * @return {Function} + * @function checkRequired + * @api public + */ + +SchemaArray.checkRequired = SchemaType.checkRequired; + +/** + * Check if the given value satisfies the `required` validator. + * + * @param {Any} value + * @param {Document} doc + * @return {Boolean} + * @api public + */ + +SchemaArray.prototype.checkRequired = function checkRequired(value, doc) { + if (SchemaType._isRef(this, value, doc, true)) { + return !!value; + } + + // `require('util').inherits()` does **not** copy static properties, and + // plugins like mongoose-float use `inherits()` for pre-ES6. + const _checkRequired = typeof this.constructor.checkRequired === 'function' ? + this.constructor.checkRequired() : + SchemaArray.checkRequired(); + + return _checkRequired(value); +}; + +/** + * Adds an enum validator if this is an array of strings or numbers. Equivalent to + * `SchemaString.prototype.enum()` or `SchemaNumber.prototype.enum()` + * + * @param {String|Object} [args...] enumeration values + * @return {SchemaArray} this + */ + +SchemaArray.prototype.enum = function() { + let arr = this; + while (true) { + const instance = arr && + arr.caster && + arr.caster.instance; + if (instance === 'Array') { + arr = arr.caster; + continue; + } + if (instance !== 'String' && instance !== 'Number') { + throw new Error('`enum` can only be set on an array of strings or numbers ' + + ', not ' + instance); + } + break; + } + + let enumArray = arguments; + if (!Array.isArray(arguments) && utils.isObject(arguments)) { + enumArray = utils.object.vals(enumArray); + } + + arr.caster.enum.apply(arr.caster, enumArray); + return this; +}; + +/** + * Overrides the getters application for the population special-case + * + * @param {Object} value + * @param {Object} scope + * @api private + */ + +SchemaArray.prototype.applyGetters = function(value, scope) { + if (scope != null && scope.$__ != null && scope.$populated(this.path)) { + // means the object id was populated + return value; + } + + const ret = SchemaType.prototype.applyGetters.call(this, value, scope); + if (Array.isArray(ret)) { + const rawValue = utils.isMongooseArray(ret) ? ret.__array : ret; + const len = rawValue.length; + for (let i = 0; i < len; ++i) { + rawValue[i] = this.caster.applyGetters(rawValue[i], scope); + } + } + return ret; +}; + +SchemaArray.prototype._applySetters = function(value, scope, init, priorVal) { + if (this.casterConstructor.$isMongooseArray && + SchemaArray.options.castNonArrays && + !this[isNestedArraySymbol]) { + // Check nesting levels and wrap in array if necessary + let depth = 0; + let arr = this; + while (arr != null && + arr.$isMongooseArray && + !arr.$isMongooseDocumentArray) { + ++depth; + arr = arr.casterConstructor; + } + + // No need to wrap empty arrays + if (value != null && value.length !== 0) { + const valueDepth = arrayDepth(value); + if (valueDepth.min === valueDepth.max && valueDepth.max < depth && valueDepth.containsNonArrayItem) { + for (let i = valueDepth.max; i < depth; ++i) { + value = [value]; + } + } + } + } + + return SchemaType.prototype._applySetters.call(this, value, scope, init, priorVal); +}; + +/** + * Casts values for set(). + * + * @param {Object} value + * @param {Document} doc document that triggers the casting + * @param {Boolean} init whether this is an initialization cast + * @api private + */ + +SchemaArray.prototype.cast = function(value, doc, init, prev, options) { + // lazy load + MongooseArray || (MongooseArray = require('../types').Array); + + let i; + let l; + + if (Array.isArray(value)) { + const len = value.length; + if (!len && doc) { + const indexes = doc.schema.indexedPaths(); + + const arrayPath = this.path; + for (i = 0, l = indexes.length; i < l; ++i) { + const pathIndex = indexes[i][0][arrayPath]; + if (pathIndex === '2dsphere' || pathIndex === '2d') { + return; + } + } + + // Special case: if this index is on the parent of what looks like + // GeoJSON, skip setting the default to empty array re: #1668, #3233 + const arrayGeojsonPath = this.path.endsWith('.coordinates') ? + this.path.substring(0, this.path.lastIndexOf('.')) : null; + if (arrayGeojsonPath != null) { + for (i = 0, l = indexes.length; i < l; ++i) { + const pathIndex = indexes[i][0][arrayGeojsonPath]; + if (pathIndex === '2dsphere') { + return; + } + } + } + } + + options = options || emptyOpts; + + let rawValue = utils.isMongooseArray(value) ? value.__array : value; + value = MongooseArray(rawValue, options.path || this._arrayPath || this.path, doc, this); + rawValue = value.__array; + + if (init && doc != null && doc.$__ != null && doc.$populated(this.path)) { + return value; + } + + const caster = this.caster; + const isMongooseArray = caster.$isMongooseArray; + if (caster && this.casterConstructor !== Mixed) { + try { + const len = rawValue.length; + for (i = 0; i < len; i++) { + const opts = {}; + // Perf: creating `arrayPath` is expensive for large arrays. + // We only need `arrayPath` if this is a nested array, so + // skip if possible. + if (isMongooseArray) { + if (options.arrayPath != null) { + opts.arrayPathIndex = i; + } else if (caster._arrayParentPath != null) { + opts.arrayPathIndex = i; + } + } + rawValue[i] = caster.applySetters(rawValue[i], doc, init, void 0, opts); + } + } catch (e) { + // rethrow + throw new CastError('[' + e.kind + ']', util.inspect(value), this.path + '.' + i, e, this); + } + } + + return value; + } + + if (init || SchemaArray.options.castNonArrays) { + // gh-2442: if we're loading this from the db and its not an array, mark + // the whole array as modified. + if (!!doc && !!init) { + doc.markModified(this.path); + } + return this.cast([value], doc, init); + } + + throw new CastError('Array', util.inspect(value), this.path, null, this); +}; + +/*! + * ignore + */ + +SchemaArray.prototype._castForPopulate = function _castForPopulate(value, doc) { + // lazy load + MongooseArray || (MongooseArray = require('../types').Array); + + if (Array.isArray(value)) { + let i; + const rawValue = value.__array ? value.__array : value; + const len = rawValue.length; + + const caster = this.caster; + if (caster && this.casterConstructor !== Mixed) { + try { + for (i = 0; i < len; i++) { + const opts = {}; + // Perf: creating `arrayPath` is expensive for large arrays. + // We only need `arrayPath` if this is a nested array, so + // skip if possible. + if (caster.$isMongooseArray && caster._arrayParentPath != null) { + opts.arrayPathIndex = i; + } + + rawValue[i] = caster.cast(rawValue[i], doc, false, void 0, opts); + } + } catch (e) { + // rethrow + throw new CastError('[' + e.kind + ']', util.inspect(value), this.path + '.' + i, e, this); + } + } + + return value; + } + + throw new CastError('Array', util.inspect(value), this.path, null, this); +}; + +SchemaArray.prototype.$toObject = SchemaArray.prototype.toObject; + +/*! + * Ignore + */ + +SchemaArray.prototype.discriminator = function(name, schema) { + let arr = this; + while (arr.$isMongooseArray && !arr.$isMongooseDocumentArray) { + arr = arr.casterConstructor; + if (arr == null || typeof arr === 'function') { + throw new MongooseError('You can only add an embedded discriminator on ' + + 'a document array, ' + this.path + ' is a plain array'); + } + } + return arr.discriminator(name, schema); +}; + +/*! + * ignore + */ + +SchemaArray.prototype.clone = function() { + const options = Object.assign({}, this.options); + const schematype = new this.constructor(this.path, this.caster, options, this.schemaOptions); + schematype.validators = this.validators.slice(); + if (this.requiredValidator !== undefined) { + schematype.requiredValidator = this.requiredValidator; + } + return schematype; +}; + +/** + * Casts values for queries. + * + * @param {String} $conditional + * @param {any} [value] + * @api private + */ + +SchemaArray.prototype.castForQuery = function($conditional, value) { + let handler; + let val; + + if (arguments.length === 2) { + handler = this.$conditionalHandlers[$conditional]; + + if (!handler) { + throw new Error('Can\'t use ' + $conditional + ' with Array.'); + } + + val = handler.call(this, value); + } else { + val = $conditional; + let Constructor = this.casterConstructor; + + if (val && + Constructor.discriminators && + Constructor.schema && + Constructor.schema.options && + Constructor.schema.options.discriminatorKey) { + if (typeof val[Constructor.schema.options.discriminatorKey] === 'string' && + Constructor.discriminators[val[Constructor.schema.options.discriminatorKey]]) { + Constructor = Constructor.discriminators[val[Constructor.schema.options.discriminatorKey]]; + } else { + const constructorByValue = getDiscriminatorByValue(Constructor.discriminators, val[Constructor.schema.options.discriminatorKey]); + if (constructorByValue) { + Constructor = constructorByValue; + } + } + } + + const proto = this.casterConstructor.prototype; + let method = proto && (proto.castForQuery || proto.cast); + if (!method && Constructor.castForQuery) { + method = Constructor.castForQuery; + } + const caster = this.caster; + + if (Array.isArray(val)) { + this.setters.reverse().forEach(setter => { + val = setter.call(this, val, this); + }); + val = val.map(function(v) { + if (utils.isObject(v) && v.$elemMatch) { + return v; + } + if (method) { + v = method.call(caster, v); + return v; + } + if (v != null) { + v = new Constructor(v); + return v; + } + return v; + }); + } else if (method) { + val = method.call(caster, val); + } else if (val != null) { + val = new Constructor(val); + } + } + + return val; +}; + +function cast$all(val) { + if (!Array.isArray(val)) { + val = [val]; + } + + val = val.map(function(v) { + if (!utils.isObject(v)) { + return v; + } + if (v.$elemMatch != null) { + return { $elemMatch: cast(this.casterConstructor.schema, v.$elemMatch) }; + } + + const o = {}; + o[this.path] = v; + return cast(this.casterConstructor.schema, o)[this.path]; + }, this); + + return this.castForQuery(val); +} + +function cast$elemMatch(val) { + const keys = Object.keys(val); + const numKeys = keys.length; + for (let i = 0; i < numKeys; ++i) { + const key = keys[i]; + const value = val[key]; + if (isOperator(key) && value != null) { + val[key] = this.castForQuery(key, value); + } + } + + // Is this an embedded discriminator and is the discriminator key set? + // If so, use the discriminator schema. See gh-7449 + const discriminatorKey = this && + this.casterConstructor && + this.casterConstructor.schema && + this.casterConstructor.schema.options && + this.casterConstructor.schema.options.discriminatorKey; + const discriminators = this && + this.casterConstructor && + this.casterConstructor.schema && + this.casterConstructor.schema.discriminators || {}; + if (discriminatorKey != null && + val[discriminatorKey] != null && + discriminators[val[discriminatorKey]] != null) { + return cast(discriminators[val[discriminatorKey]], val); + } + + return cast(this.casterConstructor.schema, val); +} + +const handle = SchemaArray.prototype.$conditionalHandlers = {}; + +handle.$all = cast$all; +handle.$options = String; +handle.$elemMatch = cast$elemMatch; +handle.$geoIntersects = geospatial.cast$geoIntersects; +handle.$or = createLogicalQueryOperatorHandler('$or'); +handle.$and = createLogicalQueryOperatorHandler('$and'); +handle.$nor = createLogicalQueryOperatorHandler('$nor'); + +function createLogicalQueryOperatorHandler(op) { + return function logicalQueryOperatorHandler(val) { + if (!Array.isArray(val)) { + throw new TypeError('conditional ' + op + ' requires an array'); + } + + const ret = []; + for (const obj of val) { + ret.push(cast(this.casterConstructor.schema, obj)); + } + + return ret; + }; +} + +handle.$near = +handle.$nearSphere = geospatial.cast$near; + +handle.$within = +handle.$geoWithin = geospatial.cast$within; + +handle.$size = +handle.$minDistance = +handle.$maxDistance = castToNumber; + +handle.$exists = $exists; +handle.$type = $type; + +handle.$eq = +handle.$gt = +handle.$gte = +handle.$lt = +handle.$lte = +handle.$ne = +handle.$not = +handle.$regex = SchemaArray.prototype.castForQuery; + +// `$in` is special because you can also include an empty array in the query +// like `$in: [1, []]`, see gh-5913 +handle.$nin = SchemaType.prototype.$conditionalHandlers.$nin; +handle.$in = SchemaType.prototype.$conditionalHandlers.$in; + +/*! + * Module exports. + */ + +module.exports = SchemaArray; diff --git a/node_modules/mongoose/lib/schema/boolean.js b/node_modules/mongoose/lib/schema/boolean.js new file mode 100644 index 000000000..df67452c0 --- /dev/null +++ b/node_modules/mongoose/lib/schema/boolean.js @@ -0,0 +1,267 @@ +'use strict'; + +/*! + * Module dependencies. + */ + +const CastError = require('../error/cast'); +const SchemaType = require('../schematype'); +const castBoolean = require('../cast/boolean'); +const utils = require('../utils'); + +/** + * Boolean SchemaType constructor. + * + * @param {String} path + * @param {Object} options + * @inherits SchemaType + * @api public + */ + +function SchemaBoolean(path, options) { + SchemaType.call(this, path, options, 'Boolean'); +} + +/** + * This schema type's name, to defend against minifiers that mangle + * function names. + * + * @api public + */ +SchemaBoolean.schemaName = 'Boolean'; + +SchemaBoolean.defaultOptions = {}; + +/*! + * Inherits from SchemaType. + */ +SchemaBoolean.prototype = Object.create(SchemaType.prototype); +SchemaBoolean.prototype.constructor = SchemaBoolean; + +/*! + * ignore + */ + +SchemaBoolean._cast = castBoolean; + +/** + * Sets a default option for all Boolean instances. + * + * #### Example: + * + * // Make all booleans have `default` of false. + * mongoose.Schema.Boolean.set('default', false); + * + * const Order = mongoose.model('Order', new Schema({ isPaid: Boolean })); + * new Order({ }).isPaid; // false + * + * @param {String} option - The option you'd like to set the value for + * @param {*} value - value for option + * @return {undefined} + * @function set + * @static + * @api public + */ + +SchemaBoolean.set = SchemaType.set; + +/** + * Get/set the function used to cast arbitrary values to booleans. + * + * #### Example: + * + * // Make Mongoose cast empty string '' to false. + * const original = mongoose.Schema.Boolean.cast(); + * mongoose.Schema.Boolean.cast(v => { + * if (v === '') { + * return false; + * } + * return original(v); + * }); + * + * // Or disable casting entirely + * mongoose.Schema.Boolean.cast(false); + * + * @param {Function} caster + * @return {Function} + * @function get + * @static + * @api public + */ + +SchemaBoolean.cast = function cast(caster) { + if (arguments.length === 0) { + return this._cast; + } + if (caster === false) { + caster = this._defaultCaster; + } + this._cast = caster; + + return this._cast; +}; + +/*! + * ignore + */ + +SchemaBoolean._defaultCaster = v => { + if (v != null && typeof v !== 'boolean') { + throw new Error(); + } + return v; +}; + +/*! + * ignore + */ + +SchemaBoolean._checkRequired = v => v === true || v === false; + +/** + * Override the function the required validator uses to check whether a boolean + * passes the `required` check. + * + * @param {Function} fn + * @return {Function} + * @function checkRequired + * @static + * @api public + */ + +SchemaBoolean.checkRequired = SchemaType.checkRequired; + +/** + * Check if the given value satisfies a required validator. For a boolean + * to satisfy a required validator, it must be strictly equal to true or to + * false. + * + * @param {Any} value + * @return {Boolean} + * @api public + */ + +SchemaBoolean.prototype.checkRequired = function(value) { + return this.constructor._checkRequired(value); +}; + +/** + * Configure which values get casted to `true`. + * + * #### Example: + * + * const M = mongoose.model('Test', new Schema({ b: Boolean })); + * new M({ b: 'affirmative' }).b; // undefined + * mongoose.Schema.Boolean.convertToTrue.add('affirmative'); + * new M({ b: 'affirmative' }).b; // true + * + * @property convertToTrue + * @type Set + * @api public + */ + +Object.defineProperty(SchemaBoolean, 'convertToTrue', { + get: () => castBoolean.convertToTrue, + set: v => { castBoolean.convertToTrue = v; } +}); + +/** + * Configure which values get casted to `false`. + * + * #### Example: + * + * const M = mongoose.model('Test', new Schema({ b: Boolean })); + * new M({ b: 'nay' }).b; // undefined + * mongoose.Schema.Types.Boolean.convertToFalse.add('nay'); + * new M({ b: 'nay' }).b; // false + * + * @property convertToFalse + * @type Set + * @api public + */ + +Object.defineProperty(SchemaBoolean, 'convertToFalse', { + get: () => castBoolean.convertToFalse, + set: v => { castBoolean.convertToFalse = v; } +}); + +/** + * Casts to boolean + * + * @param {Object} value + * @param {Object} model - this value is optional + * @api private + */ + +SchemaBoolean.prototype.cast = function(value) { + let castBoolean; + if (typeof this._castFunction === 'function') { + castBoolean = this._castFunction; + } else if (typeof this.constructor.cast === 'function') { + castBoolean = this.constructor.cast(); + } else { + castBoolean = SchemaBoolean.cast(); + } + + try { + return castBoolean(value); + } catch (error) { + throw new CastError('Boolean', value, this.path, error, this); + } +}; + +SchemaBoolean.$conditionalHandlers = + utils.options(SchemaType.prototype.$conditionalHandlers, {}); + +/** + * Casts contents for queries. + * + * @param {String} $conditional + * @param {any} val + * @api private + */ + +SchemaBoolean.prototype.castForQuery = function($conditional, val) { + let handler; + if (arguments.length === 2) { + handler = SchemaBoolean.$conditionalHandlers[$conditional]; + + if (handler) { + return handler.call(this, val); + } + + return this._castForQuery(val); + } + + return this._castForQuery($conditional); +}; + +/** + * + * @api private + */ + +SchemaBoolean.prototype._castNullish = function _castNullish(v) { + if (typeof v === 'undefined') { + return v; + } + const castBoolean = typeof this.constructor.cast === 'function' ? + this.constructor.cast() : + SchemaBoolean.cast(); + if (castBoolean == null) { + return v; + } + if (castBoolean.convertToFalse instanceof Set && castBoolean.convertToFalse.has(v)) { + return false; + } + if (castBoolean.convertToTrue instanceof Set && castBoolean.convertToTrue.has(v)) { + return true; + } + return v; +}; + +/*! + * Module exports. + */ + +module.exports = SchemaBoolean; diff --git a/node_modules/mongoose/lib/schema/buffer.js b/node_modules/mongoose/lib/schema/buffer.js new file mode 100644 index 000000000..5b7679e62 --- /dev/null +++ b/node_modules/mongoose/lib/schema/buffer.js @@ -0,0 +1,269 @@ +/*! + * Module dependencies. + */ + +'use strict'; + +const MongooseBuffer = require('../types/buffer'); +const SchemaBufferOptions = require('../options/SchemaBufferOptions'); +const SchemaType = require('../schematype'); +const handleBitwiseOperator = require('./operators/bitwise'); +const utils = require('../utils'); + +const Binary = MongooseBuffer.Binary; +const CastError = SchemaType.CastError; + +/** + * Buffer SchemaType constructor + * + * @param {String} key + * @param {Object} options + * @inherits SchemaType + * @api public + */ + +function SchemaBuffer(key, options) { + SchemaType.call(this, key, options, 'Buffer'); +} + +/** + * This schema type's name, to defend against minifiers that mangle + * function names. + * + * @api public + */ +SchemaBuffer.schemaName = 'Buffer'; + +SchemaBuffer.defaultOptions = {}; + +/*! + * Inherits from SchemaType. + */ +SchemaBuffer.prototype = Object.create(SchemaType.prototype); +SchemaBuffer.prototype.constructor = SchemaBuffer; +SchemaBuffer.prototype.OptionsConstructor = SchemaBufferOptions; + +/*! + * ignore + */ + +SchemaBuffer._checkRequired = v => !!(v && v.length); + +/** + * Sets a default option for all Buffer instances. + * + * #### Example: + * + * // Make all buffers have `required` of true by default. + * mongoose.Schema.Buffer.set('required', true); + * + * const User = mongoose.model('User', new Schema({ test: Buffer })); + * new User({ }).validateSync().errors.test.message; // Path `test` is required. + * + * @param {String} option - The option you'd like to set the value for + * @param {*} value - value for option + * @return {undefined} + * @function set + * @static + * @api public + */ + +SchemaBuffer.set = SchemaType.set; + +/** + * Override the function the required validator uses to check whether a string + * passes the `required` check. + * + * #### Example: + * + * // Allow empty strings to pass `required` check + * mongoose.Schema.Types.String.checkRequired(v => v != null); + * + * const M = mongoose.model({ buf: { type: Buffer, required: true } }); + * new M({ buf: Buffer.from('') }).validateSync(); // validation passes! + * + * @param {Function} fn + * @return {Function} + * @function checkRequired + * @static + * @api public + */ + +SchemaBuffer.checkRequired = SchemaType.checkRequired; + +/** + * Check if the given value satisfies a required validator. To satisfy a + * required validator, a buffer must not be null or undefined and have + * non-zero length. + * + * @param {Any} value + * @param {Document} doc + * @return {Boolean} + * @api public + */ + +SchemaBuffer.prototype.checkRequired = function(value, doc) { + if (SchemaType._isRef(this, value, doc, true)) { + return !!value; + } + return this.constructor._checkRequired(value); +}; + +/** + * Casts contents + * + * @param {Object} value + * @param {Document} doc document that triggers the casting + * @param {Boolean} init + * @api private + */ + +SchemaBuffer.prototype.cast = function(value, doc, init) { + let ret; + if (SchemaType._isRef(this, value, doc, init)) { + if (value && value.isMongooseBuffer) { + return value; + } + + if (Buffer.isBuffer(value)) { + if (!value || !value.isMongooseBuffer) { + value = new MongooseBuffer(value, [this.path, doc]); + if (this.options.subtype != null) { + value._subtype = this.options.subtype; + } + } + return value; + } + + if (value instanceof Binary) { + ret = new MongooseBuffer(value.value(true), [this.path, doc]); + if (typeof value.sub_type !== 'number') { + throw new CastError('Buffer', value, this.path, null, this); + } + ret._subtype = value.sub_type; + return ret; + } + + if (value == null || utils.isNonBuiltinObject(value)) { + return this._castRef(value, doc, init); + } + } + + // documents + if (value && value._id) { + value = value._id; + } + + if (value && value.isMongooseBuffer) { + return value; + } + + if (Buffer.isBuffer(value)) { + if (!value || !value.isMongooseBuffer) { + value = new MongooseBuffer(value, [this.path, doc]); + if (this.options.subtype != null) { + value._subtype = this.options.subtype; + } + } + return value; + } + + if (value instanceof Binary) { + ret = new MongooseBuffer(value.value(true), [this.path, doc]); + if (typeof value.sub_type !== 'number') { + throw new CastError('Buffer', value, this.path, null, this); + } + ret._subtype = value.sub_type; + return ret; + } + + if (value === null) { + return value; + } + + + const type = typeof value; + if ( + type === 'string' || type === 'number' || Array.isArray(value) || + (type === 'object' && value.type === 'Buffer' && Array.isArray(value.data)) // gh-6863 + ) { + if (type === 'number') { + value = [value]; + } + ret = new MongooseBuffer(value, [this.path, doc]); + if (this.options.subtype != null) { + ret._subtype = this.options.subtype; + } + return ret; + } + + throw new CastError('Buffer', value, this.path, null, this); +}; + +/** + * Sets the default [subtype](https://studio3t.com/whats-new/best-practices-uuid-mongodb/) + * for this buffer. You can find a [list of allowed subtypes here](https://api.mongodb.com/python/current/api/bson/binary.html). + * + * #### Example: + * + * const s = new Schema({ uuid: { type: Buffer, subtype: 4 }); + * const M = db.model('M', s); + * const m = new M({ uuid: 'test string' }); + * m.uuid._subtype; // 4 + * + * @param {Number} subtype the default subtype + * @return {SchemaType} this + * @api public + */ + +SchemaBuffer.prototype.subtype = function(subtype) { + this.options.subtype = subtype; + return this; +}; + +/*! + * ignore + */ +function handleSingle(val) { + return this.castForQuery(val); +} + +SchemaBuffer.prototype.$conditionalHandlers = + utils.options(SchemaType.prototype.$conditionalHandlers, { + $bitsAllClear: handleBitwiseOperator, + $bitsAnyClear: handleBitwiseOperator, + $bitsAllSet: handleBitwiseOperator, + $bitsAnySet: handleBitwiseOperator, + $gt: handleSingle, + $gte: handleSingle, + $lt: handleSingle, + $lte: handleSingle + }); + +/** + * Casts contents for queries. + * + * @param {String} $conditional + * @param {any} [value] + * @api private + */ + +SchemaBuffer.prototype.castForQuery = function($conditional, val) { + let handler; + if (arguments.length === 2) { + handler = this.$conditionalHandlers[$conditional]; + if (!handler) { + throw new Error('Can\'t use ' + $conditional + ' with Buffer.'); + } + return handler.call(this, val); + } + val = $conditional; + const casted = this._castForQuery(val); + return casted ? casted.toObject({ transform: false, virtuals: false }) : casted; +}; + +/*! + * Module exports. + */ + +module.exports = SchemaBuffer; diff --git a/node_modules/mongoose/lib/schema/date.js b/node_modules/mongoose/lib/schema/date.js new file mode 100644 index 000000000..02f00224b --- /dev/null +++ b/node_modules/mongoose/lib/schema/date.js @@ -0,0 +1,403 @@ +/*! + * Module requirements. + */ + +'use strict'; + +const MongooseError = require('../error/index'); +const SchemaDateOptions = require('../options/SchemaDateOptions'); +const SchemaType = require('../schematype'); +const castDate = require('../cast/date'); +const getConstructorName = require('../helpers/getConstructorName'); +const utils = require('../utils'); + +const CastError = SchemaType.CastError; + +/** + * Date SchemaType constructor. + * + * @param {String} key + * @param {Object} options + * @inherits SchemaType + * @api public + */ + +function SchemaDate(key, options) { + SchemaType.call(this, key, options, 'Date'); +} + +/** + * This schema type's name, to defend against minifiers that mangle + * function names. + * + * @api public + */ +SchemaDate.schemaName = 'Date'; + +SchemaDate.defaultOptions = {}; + +/*! + * Inherits from SchemaType. + */ +SchemaDate.prototype = Object.create(SchemaType.prototype); +SchemaDate.prototype.constructor = SchemaDate; +SchemaDate.prototype.OptionsConstructor = SchemaDateOptions; + +/*! + * ignore + */ + +SchemaDate._cast = castDate; + +/** + * Sets a default option for all Date instances. + * + * #### Example: + * + * // Make all dates have `required` of true by default. + * mongoose.Schema.Date.set('required', true); + * + * const User = mongoose.model('User', new Schema({ test: Date })); + * new User({ }).validateSync().errors.test.message; // Path `test` is required. + * + * @param {String} option - The option you'd like to set the value for + * @param {*} value - value for option + * @return {undefined} + * @function set + * @static + * @api public + */ + +SchemaDate.set = SchemaType.set; + +/** + * Get/set the function used to cast arbitrary values to dates. + * + * #### Example: + * + * // Mongoose converts empty string '' into `null` for date types. You + * // can create a custom caster to disable it. + * const original = mongoose.Schema.Types.Date.cast(); + * mongoose.Schema.Types.Date.cast(v => { + * assert.ok(v !== ''); + * return original(v); + * }); + * + * // Or disable casting entirely + * mongoose.Schema.Types.Date.cast(false); + * + * @param {Function} caster + * @return {Function} + * @function get + * @static + * @api public + */ + +SchemaDate.cast = function cast(caster) { + if (arguments.length === 0) { + return this._cast; + } + if (caster === false) { + caster = this._defaultCaster; + } + this._cast = caster; + + return this._cast; +}; + +/*! + * ignore + */ + +SchemaDate._defaultCaster = v => { + if (v != null && !(v instanceof Date)) { + throw new Error(); + } + return v; +}; + +/** + * Declares a TTL index (rounded to the nearest second) for _Date_ types only. + * + * This sets the `expireAfterSeconds` index option available in MongoDB >= 2.1.2. + * This index type is only compatible with Date types. + * + * #### Example: + * + * // expire in 24 hours + * new Schema({ createdAt: { type: Date, expires: 60*60*24 }}); + * + * `expires` utilizes the `ms` module from [guille](https://github.com/guille/) allowing us to use a friendlier syntax: + * + * #### Example: + * + * // expire in 24 hours + * new Schema({ createdAt: { type: Date, expires: '24h' }}); + * + * // expire in 1.5 hours + * new Schema({ createdAt: { type: Date, expires: '1.5h' }}); + * + * // expire in 7 days + * const schema = new Schema({ createdAt: Date }); + * schema.path('createdAt').expires('7d'); + * + * @param {Number|String} when + * @added 3.0.0 + * @return {SchemaType} this + * @api public + */ + +SchemaDate.prototype.expires = function(when) { + if (getConstructorName(this._index) !== 'Object') { + this._index = {}; + } + + this._index.expires = when; + utils.expires(this._index); + return this; +}; + +/*! + * ignore + */ + +SchemaDate._checkRequired = v => v instanceof Date; + +/** + * Override the function the required validator uses to check whether a string + * passes the `required` check. + * + * #### Example: + * + * // Allow empty strings to pass `required` check + * mongoose.Schema.Types.String.checkRequired(v => v != null); + * + * const M = mongoose.model({ str: { type: String, required: true } }); + * new M({ str: '' }).validateSync(); // `null`, validation passes! + * + * @param {Function} fn + * @return {Function} + * @function checkRequired + * @static + * @api public + */ + +SchemaDate.checkRequired = SchemaType.checkRequired; + +/** + * Check if the given value satisfies a required validator. To satisfy + * a required validator, the given value must be an instance of `Date`. + * + * @param {Any} value + * @param {Document} doc + * @return {Boolean} + * @api public + */ + +SchemaDate.prototype.checkRequired = function(value, doc) { + if (SchemaType._isRef(this, value, doc, true)) { + return !!value; + } + + // `require('util').inherits()` does **not** copy static properties, and + // plugins like mongoose-float use `inherits()` for pre-ES6. + const _checkRequired = typeof this.constructor.checkRequired === 'function' ? + this.constructor.checkRequired() : + SchemaDate.checkRequired(); + return _checkRequired(value); +}; + +/** + * Sets a minimum date validator. + * + * #### Example: + * + * const s = new Schema({ d: { type: Date, min: Date('1970-01-01') }) + * const M = db.model('M', s) + * const m = new M({ d: Date('1969-12-31') }) + * m.save(function (err) { + * console.error(err) // validator error + * m.d = Date('2014-12-08'); + * m.save() // success + * }) + * + * // custom error messages + * // We can also use the special {MIN} token which will be replaced with the invalid value + * const min = [Date('1970-01-01'), 'The value of path `{PATH}` ({VALUE}) is beneath the limit ({MIN}).']; + * const schema = new Schema({ d: { type: Date, min: min }) + * const M = mongoose.model('M', schema); + * const s= new M({ d: Date('1969-12-31') }); + * s.validate(function (err) { + * console.log(String(err)) // ValidationError: The value of path `d` (1969-12-31) is before the limit (1970-01-01). + * }) + * + * @param {Date} value minimum date + * @param {String} [message] optional custom error message + * @return {SchemaType} this + * @see Customized Error Messages #error_messages_MongooseError-messages + * @api public + */ + +SchemaDate.prototype.min = function(value, message) { + if (this.minValidator) { + this.validators = this.validators.filter(function(v) { + return v.validator !== this.minValidator; + }, this); + } + + if (value) { + let msg = message || MongooseError.messages.Date.min; + if (typeof msg === 'string') { + msg = msg.replace(/{MIN}/, (value === Date.now ? 'Date.now()' : value.toString())); + } + const _this = this; + this.validators.push({ + validator: this.minValidator = function(val) { + let _value = value; + if (typeof value === 'function' && value !== Date.now) { + _value = _value.call(this); + } + const min = (_value === Date.now ? _value() : _this.cast(_value)); + return val === null || val.valueOf() >= min.valueOf(); + }, + message: msg, + type: 'min', + min: value + }); + } + + return this; +}; + +/** + * Sets a maximum date validator. + * + * #### Example: + * + * const s = new Schema({ d: { type: Date, max: Date('2014-01-01') }) + * const M = db.model('M', s) + * const m = new M({ d: Date('2014-12-08') }) + * m.save(function (err) { + * console.error(err) // validator error + * m.d = Date('2013-12-31'); + * m.save() // success + * }) + * + * // custom error messages + * // We can also use the special {MAX} token which will be replaced with the invalid value + * const max = [Date('2014-01-01'), 'The value of path `{PATH}` ({VALUE}) exceeds the limit ({MAX}).']; + * const schema = new Schema({ d: { type: Date, max: max }) + * const M = mongoose.model('M', schema); + * const s= new M({ d: Date('2014-12-08') }); + * s.validate(function (err) { + * console.log(String(err)) // ValidationError: The value of path `d` (2014-12-08) exceeds the limit (2014-01-01). + * }) + * + * @param {Date} maximum date + * @param {String} [message] optional custom error message + * @return {SchemaType} this + * @see Customized Error Messages #error_messages_MongooseError-messages + * @api public + */ + +SchemaDate.prototype.max = function(value, message) { + if (this.maxValidator) { + this.validators = this.validators.filter(function(v) { + return v.validator !== this.maxValidator; + }, this); + } + + if (value) { + let msg = message || MongooseError.messages.Date.max; + if (typeof msg === 'string') { + msg = msg.replace(/{MAX}/, (value === Date.now ? 'Date.now()' : value.toString())); + } + const _this = this; + this.validators.push({ + validator: this.maxValidator = function(val) { + let _value = value; + if (typeof _value === 'function' && _value !== Date.now) { + _value = _value.call(this); + } + const max = (_value === Date.now ? _value() : _this.cast(_value)); + return val === null || val.valueOf() <= max.valueOf(); + }, + message: msg, + type: 'max', + max: value + }); + } + + return this; +}; + +/** + * Casts to date + * + * @param {Object} value to cast + * @api private + */ + +SchemaDate.prototype.cast = function(value) { + let castDate; + if (typeof this._castFunction === 'function') { + castDate = this._castFunction; + } else if (typeof this.constructor.cast === 'function') { + castDate = this.constructor.cast(); + } else { + castDate = SchemaDate.cast(); + } + + try { + return castDate(value); + } catch (error) { + throw new CastError('date', value, this.path, error, this); + } +}; + +/*! + * Date Query casting. + * + * @api private + */ + +function handleSingle(val) { + return this.cast(val); +} + +SchemaDate.prototype.$conditionalHandlers = + utils.options(SchemaType.prototype.$conditionalHandlers, { + $gt: handleSingle, + $gte: handleSingle, + $lt: handleSingle, + $lte: handleSingle + }); + + +/** + * Casts contents for queries. + * + * @param {String} $conditional + * @param {any} [value] + * @api private + */ + +SchemaDate.prototype.castForQuery = function($conditional, val) { + if (arguments.length !== 2) { + return this._castForQuery($conditional); + } + + const handler = this.$conditionalHandlers[$conditional]; + + if (!handler) { + throw new Error('Can\'t use ' + $conditional + ' with Date.'); + } + + return handler.call(this, val); +}; + +/*! + * Module exports. + */ + +module.exports = SchemaDate; diff --git a/node_modules/mongoose/lib/schema/decimal128.js b/node_modules/mongoose/lib/schema/decimal128.js new file mode 100644 index 000000000..3323df4e0 --- /dev/null +++ b/node_modules/mongoose/lib/schema/decimal128.js @@ -0,0 +1,210 @@ +/*! + * Module dependencies. + */ + +'use strict'; + +const SchemaType = require('../schematype'); +const CastError = SchemaType.CastError; +const castDecimal128 = require('../cast/decimal128'); +const utils = require('../utils'); +const isBsonType = require('../helpers/isBsonType'); + +/** + * Decimal128 SchemaType constructor. + * + * @param {String} key + * @param {Object} options + * @inherits SchemaType + * @api public + */ + +function Decimal128(key, options) { + SchemaType.call(this, key, options, 'Decimal128'); +} + +/** + * This schema type's name, to defend against minifiers that mangle + * function names. + * + * @api public + */ +Decimal128.schemaName = 'Decimal128'; + +Decimal128.defaultOptions = {}; + +/*! + * Inherits from SchemaType. + */ +Decimal128.prototype = Object.create(SchemaType.prototype); +Decimal128.prototype.constructor = Decimal128; + +/*! + * ignore + */ + +Decimal128._cast = castDecimal128; + +/** + * Sets a default option for all Decimal128 instances. + * + * #### Example: + * + * // Make all decimal 128s have `required` of true by default. + * mongoose.Schema.Decimal128.set('required', true); + * + * const User = mongoose.model('User', new Schema({ test: mongoose.Decimal128 })); + * new User({ }).validateSync().errors.test.message; // Path `test` is required. + * + * @param {String} option - The option you'd like to set the value for + * @param {*} value - value for option + * @return {undefined} + * @function set + * @static + * @api public + */ + +Decimal128.set = SchemaType.set; + +/** + * Get/set the function used to cast arbitrary values to decimals. + * + * #### Example: + * + * // Make Mongoose only refuse to cast numbers as decimal128 + * const original = mongoose.Schema.Types.Decimal128.cast(); + * mongoose.Decimal128.cast(v => { + * assert.ok(typeof v !== 'number'); + * return original(v); + * }); + * + * // Or disable casting entirely + * mongoose.Decimal128.cast(false); + * + * @param {Function} [caster] + * @return {Function} + * @function get + * @static + * @api public + */ + +Decimal128.cast = function cast(caster) { + if (arguments.length === 0) { + return this._cast; + } + if (caster === false) { + caster = this._defaultCaster; + } + this._cast = caster; + + return this._cast; +}; + +/*! + * ignore + */ + +Decimal128._defaultCaster = v => { + if (v != null && !isBsonType(v, 'Decimal128')) { + throw new Error(); + } + return v; +}; + +/*! + * ignore + */ + +Decimal128._checkRequired = v => isBsonType(v, 'Decimal128'); + +/** + * Override the function the required validator uses to check whether a string + * passes the `required` check. + * + * @param {Function} fn + * @return {Function} + * @function checkRequired + * @static + * @api public + */ + +Decimal128.checkRequired = SchemaType.checkRequired; + +/** + * Check if the given value satisfies a required validator. + * + * @param {Any} value + * @param {Document} doc + * @return {Boolean} + * @api public + */ + +Decimal128.prototype.checkRequired = function checkRequired(value, doc) { + if (SchemaType._isRef(this, value, doc, true)) { + return !!value; + } + + // `require('util').inherits()` does **not** copy static properties, and + // plugins like mongoose-float use `inherits()` for pre-ES6. + const _checkRequired = typeof this.constructor.checkRequired === 'function' ? + this.constructor.checkRequired() : + Decimal128.checkRequired(); + + return _checkRequired(value); +}; + +/** + * Casts to Decimal128 + * + * @param {Object} value + * @param {Object} doc + * @param {Boolean} init whether this is an initialization cast + * @api private + */ + +Decimal128.prototype.cast = function(value, doc, init) { + if (SchemaType._isRef(this, value, doc, init)) { + if (isBsonType(value, 'Decimal128')) { + return value; + } + + return this._castRef(value, doc, init); + } + + let castDecimal128; + if (typeof this._castFunction === 'function') { + castDecimal128 = this._castFunction; + } else if (typeof this.constructor.cast === 'function') { + castDecimal128 = this.constructor.cast(); + } else { + castDecimal128 = Decimal128.cast(); + } + + try { + return castDecimal128(value); + } catch (error) { + throw new CastError('Decimal128', value, this.path, error, this); + } +}; + +/*! + * ignore + */ + +function handleSingle(val) { + return this.cast(val); +} + +Decimal128.prototype.$conditionalHandlers = + utils.options(SchemaType.prototype.$conditionalHandlers, { + $gt: handleSingle, + $gte: handleSingle, + $lt: handleSingle, + $lte: handleSingle + }); + +/*! + * Module exports. + */ + +module.exports = Decimal128; diff --git a/node_modules/mongoose/lib/schema/documentarray.js b/node_modules/mongoose/lib/schema/documentarray.js new file mode 100644 index 000000000..4fd05fbe6 --- /dev/null +++ b/node_modules/mongoose/lib/schema/documentarray.js @@ -0,0 +1,599 @@ +'use strict'; + +/*! + * Module dependencies. + */ + +const ArrayType = require('./array'); +const CastError = require('../error/cast'); +const EventEmitter = require('events').EventEmitter; +const SchemaDocumentArrayOptions = + require('../options/SchemaDocumentArrayOptions'); +const SchemaType = require('../schematype'); +const SubdocumentPath = require('./SubdocumentPath'); +const discriminator = require('../helpers/model/discriminator'); +const handleIdOption = require('../helpers/schema/handleIdOption'); +const handleSpreadDoc = require('../helpers/document/handleSpreadDoc'); +const utils = require('../utils'); +const getConstructor = require('../helpers/discriminator/getConstructor'); + +const arrayAtomicsSymbol = require('../helpers/symbols').arrayAtomicsSymbol; +const arrayPathSymbol = require('../helpers/symbols').arrayPathSymbol; +const documentArrayParent = require('../helpers/symbols').documentArrayParent; + +let MongooseDocumentArray; +let Subdocument; + +/** + * SubdocsArray SchemaType constructor + * + * @param {String} key + * @param {Schema} schema + * @param {Object} options + * @param {Object} schemaOptions + * @inherits SchemaArray + * @api public + */ + +function DocumentArrayPath(key, schema, options, schemaOptions) { + if (schemaOptions != null && schemaOptions._id != null) { + schema = handleIdOption(schema, schemaOptions); + } else if (options != null && options._id != null) { + schema = handleIdOption(schema, options); + } + + const EmbeddedDocument = _createConstructor(schema, options); + EmbeddedDocument.prototype.$basePath = key; + + ArrayType.call(this, key, EmbeddedDocument, options); + + this.schema = schema; + this.schemaOptions = schemaOptions || {}; + this.$isMongooseDocumentArray = true; + this.Constructor = EmbeddedDocument; + + EmbeddedDocument.base = schema.base; + + const fn = this.defaultValue; + + if (!('defaultValue' in this) || fn !== void 0) { + this.default(function() { + let arr = fn.call(this); + if (arr != null && !Array.isArray(arr)) { + arr = [arr]; + } + // Leave it up to `cast()` to convert this to a documentarray + return arr; + }); + } + + const parentSchemaType = this; + this.$embeddedSchemaType = new SchemaType(key + '.$', { + required: this && + this.schemaOptions && + this.schemaOptions.required || false + }); + this.$embeddedSchemaType.cast = function(value, doc, init) { + return parentSchemaType.cast(value, doc, init)[0]; + }; + this.$embeddedSchemaType.doValidate = function(value, fn, scope, options) { + const Constructor = getConstructor(this.caster, value); + + if (value && !(value instanceof Constructor)) { + value = new Constructor(value, scope, null, null, options && options.index != null ? options.index : null); + } + + return SubdocumentPath.prototype.doValidate.call(this, value, fn, scope, options); + }; + this.$embeddedSchemaType.$isMongooseDocumentArrayElement = true; + this.$embeddedSchemaType.caster = this.Constructor; + this.$embeddedSchemaType.schema = this.schema; +} + +/** + * This schema type's name, to defend against minifiers that mangle + * function names. + * + * @api public + */ +DocumentArrayPath.schemaName = 'DocumentArray'; + +/** + * Options for all document arrays. + * + * - `castNonArrays`: `true` by default. If `false`, Mongoose will throw a CastError when a value isn't an array. If `true`, Mongoose will wrap the provided value in an array before casting. + * + * @api public + */ + +DocumentArrayPath.options = { castNonArrays: true }; + +/*! + * Inherits from ArrayType. + */ +DocumentArrayPath.prototype = Object.create(ArrayType.prototype); +DocumentArrayPath.prototype.constructor = DocumentArrayPath; +DocumentArrayPath.prototype.OptionsConstructor = SchemaDocumentArrayOptions; + +/*! + * Ignore + */ + +function _createConstructor(schema, options, baseClass) { + Subdocument || (Subdocument = require('../types/ArraySubdocument')); + + // compile an embedded document for this schema + function EmbeddedDocument(_value, parentArray) { + Subdocument.apply(this, arguments); + if (parentArray == null || parentArray.getArrayParent() == null) { + return; + } + this.$session(parentArray.getArrayParent().$session()); + } + + schema._preCompile(); + + const proto = baseClass != null ? baseClass.prototype : Subdocument.prototype; + EmbeddedDocument.prototype = Object.create(proto); + EmbeddedDocument.prototype.$__setSchema(schema); + EmbeddedDocument.schema = schema; + EmbeddedDocument.prototype.constructor = EmbeddedDocument; + EmbeddedDocument.$isArraySubdocument = true; + EmbeddedDocument.events = new EventEmitter(); + + // apply methods + for (const i in schema.methods) { + EmbeddedDocument.prototype[i] = schema.methods[i]; + } + + // apply statics + for (const i in schema.statics) { + EmbeddedDocument[i] = schema.statics[i]; + } + + for (const i in EventEmitter.prototype) { + EmbeddedDocument[i] = EventEmitter.prototype[i]; + } + + EmbeddedDocument.options = options; + + return EmbeddedDocument; +} + +/** + * Adds a discriminator to this document array. + * + * #### Example: + * const shapeSchema = Schema({ name: String }, { discriminatorKey: 'kind' }); + * const schema = Schema({ shapes: [shapeSchema] }); + * + * const docArrayPath = parentSchema.path('shapes'); + * docArrayPath.discriminator('Circle', Schema({ radius: Number })); + * + * @param {String} name + * @param {Schema} schema fields to add to the schema for instances of this sub-class + * @param {Object|string} [options] If string, same as `options.value`. + * @param {String} [options.value] the string stored in the `discriminatorKey` property. If not specified, Mongoose uses the `name` parameter. + * @param {Boolean} [options.clone=true] By default, `discriminator()` clones the given `schema`. Set to `false` to skip cloning. + * @see discriminators /docs/discriminators.html + * @return {Function} the constructor Mongoose will use for creating instances of this discriminator model + * @api public + */ + +DocumentArrayPath.prototype.discriminator = function(name, schema, options) { + if (typeof name === 'function') { + name = utils.getFunctionName(name); + } + + options = options || {}; + const tiedValue = utils.isPOJO(options) ? options.value : options; + const clone = typeof options.clone === 'boolean' ? options.clone : true; + + if (schema.instanceOfSchema && clone) { + schema = schema.clone(); + } + + schema = discriminator(this.casterConstructor, name, schema, tiedValue); + + const EmbeddedDocument = _createConstructor(schema, null, this.casterConstructor); + EmbeddedDocument.baseCasterConstructor = this.casterConstructor; + + try { + Object.defineProperty(EmbeddedDocument, 'name', { + value: name + }); + } catch (error) { + // Ignore error, only happens on old versions of node + } + + this.casterConstructor.discriminators[name] = EmbeddedDocument; + + return this.casterConstructor.discriminators[name]; +}; + +/** + * Performs local validations first, then validations on each embedded doc + * + * @api private + */ + +DocumentArrayPath.prototype.doValidate = function(array, fn, scope, options) { + // lazy load + MongooseDocumentArray || (MongooseDocumentArray = require('../types/DocumentArray')); + + const _this = this; + try { + SchemaType.prototype.doValidate.call(this, array, cb, scope); + } catch (err) { + return fn(err); + } + + function cb(err) { + if (err) { + return fn(err); + } + + let count = array && array.length; + let error; + + if (!count) { + return fn(); + } + if (options && options.updateValidator) { + return fn(); + } + if (!utils.isMongooseDocumentArray(array)) { + array = new MongooseDocumentArray(array, _this.path, scope); + } + + // handle sparse arrays, do not use array.forEach which does not + // iterate over sparse elements yet reports array.length including + // them :( + + function callback(err) { + if (err != null) { + error = err; + } + --count || fn(error); + } + + for (let i = 0, len = count; i < len; ++i) { + // sidestep sparse entries + let doc = array[i]; + if (doc == null) { + --count || fn(error); + continue; + } + + // If you set the array index directly, the doc might not yet be + // a full fledged mongoose subdoc, so make it into one. + if (!(doc instanceof Subdocument)) { + const Constructor = getConstructor(_this.casterConstructor, array[i]); + doc = array[i] = new Constructor(doc, array, undefined, undefined, i); + } + + if (options != null && options.validateModifiedOnly && !doc.$isModified()) { + --count || fn(error); + continue; + } + + doc.$__validate(callback); + } + } +}; + +/** + * Performs local validations first, then validations on each embedded doc. + * + * #### Note: + * + * This method ignores the asynchronous validators. + * + * @return {MongooseError|undefined} + * @api private + */ + +DocumentArrayPath.prototype.doValidateSync = function(array, scope, options) { + const schemaTypeError = SchemaType.prototype.doValidateSync.call(this, array, scope); + if (schemaTypeError != null) { + return schemaTypeError; + } + + const count = array && array.length; + let resultError = null; + + if (!count) { + return; + } + + // handle sparse arrays, do not use array.forEach which does not + // iterate over sparse elements yet reports array.length including + // them :( + + for (let i = 0, len = count; i < len; ++i) { + // sidestep sparse entries + let doc = array[i]; + if (!doc) { + continue; + } + + // If you set the array index directly, the doc might not yet be + // a full fledged mongoose subdoc, so make it into one. + if (!(doc instanceof Subdocument)) { + const Constructor = getConstructor(this.casterConstructor, array[i]); + doc = array[i] = new Constructor(doc, array, undefined, undefined, i); + } + + if (options != null && options.validateModifiedOnly && !doc.$isModified()) { + continue; + } + + const subdocValidateError = doc.validateSync(); + + if (subdocValidateError && resultError == null) { + resultError = subdocValidateError; + } + } + + return resultError; +}; + +/*! + * ignore + */ + +DocumentArrayPath.prototype.getDefault = function(scope) { + let ret = typeof this.defaultValue === 'function' + ? this.defaultValue.call(scope) + : this.defaultValue; + + if (ret == null) { + return ret; + } + + // lazy load + MongooseDocumentArray || (MongooseDocumentArray = require('../types/DocumentArray')); + + if (!Array.isArray(ret)) { + ret = [ret]; + } + + ret = new MongooseDocumentArray(ret, this.path, scope); + + for (let i = 0; i < ret.length; ++i) { + const Constructor = getConstructor(this.casterConstructor, ret[i]); + const _subdoc = new Constructor({}, ret, undefined, + undefined, i); + _subdoc.$init(ret[i]); + _subdoc.isNew = true; + + // Make sure all paths in the subdoc are set to `default` instead + // of `init` since we used `init`. + Object.assign(_subdoc.$__.activePaths.default, _subdoc.$__.activePaths.init); + _subdoc.$__.activePaths.init = {}; + + ret[i] = _subdoc; + } + + return ret; +}; + +const _toObjectOptions = Object.freeze({ transform: false, virtuals: false }); +const initDocumentOptions = Object.freeze({ skipId: true, willInit: true }); + +/** + * Casts contents + * + * @param {Object} value + * @param {Document} document that triggers the casting + * @api private + */ + +DocumentArrayPath.prototype.cast = function(value, doc, init, prev, options) { + // lazy load + MongooseDocumentArray || (MongooseDocumentArray = require('../types/DocumentArray')); + + // Skip casting if `value` is the same as the previous value, no need to cast. See gh-9266 + if (value != null && value[arrayPathSymbol] != null && value === prev) { + return value; + } + + let selected; + let subdoc; + + options = options || {}; + + if (!Array.isArray(value)) { + if (!init && !DocumentArrayPath.options.castNonArrays) { + throw new CastError('DocumentArray', value, this.path, null, this); + } + // gh-2442 mark whole array as modified if we're initializing a doc from + // the db and the path isn't an array in the document + if (!!doc && init) { + doc.markModified(this.path); + } + return this.cast([value], doc, init, prev, options); + } + + // We need to create a new array, otherwise change tracking will + // update the old doc (gh-4449) + if (!options.skipDocumentArrayCast || utils.isMongooseDocumentArray(value)) { + value = new MongooseDocumentArray(value, this.path, doc); + } + + if (prev != null) { + value[arrayAtomicsSymbol] = prev[arrayAtomicsSymbol] || {}; + } + + if (options.arrayPathIndex != null) { + value[arrayPathSymbol] = this.path + '.' + options.arrayPathIndex; + } + + const rawArray = utils.isMongooseDocumentArray(value) ? value.__array : value; + const len = rawArray.length; + + for (let i = 0; i < len; ++i) { + if (!rawArray[i]) { + continue; + } + + const Constructor = getConstructor(this.casterConstructor, rawArray[i]); + + // Check if the document has a different schema (re gh-3701) + if (rawArray[i].$__ != null && !(rawArray[i] instanceof Constructor)) { + const spreadDoc = handleSpreadDoc(rawArray[i], true); + if (rawArray[i] !== spreadDoc) { + rawArray[i] = spreadDoc; + } else { + rawArray[i] = rawArray[i].toObject({ + transform: false, + // Special case: if different model, but same schema, apply virtuals + // re: gh-7898 + virtuals: rawArray[i].schema === Constructor.schema + }); + } + } + + if (rawArray[i] instanceof Subdocument) { + if (rawArray[i][documentArrayParent] !== doc) { + if (init) { + const subdoc = new Constructor(null, value, initDocumentOptions, selected, i); + rawArray[i] = subdoc.$init(rawArray[i]); + } else { + const subdoc = new Constructor(rawArray[i], value, undefined, undefined, i); + rawArray[i] = subdoc; + } + } + // Might not have the correct index yet, so ensure it does. + if (rawArray[i].__index == null) { + rawArray[i].$setIndex(i); + } + } else if (rawArray[i] != null) { + if (init) { + if (doc) { + selected || (selected = scopePaths(this, doc.$__.selected, init)); + } else { + selected = true; + } + + subdoc = new Constructor(null, value, initDocumentOptions, selected, i); + rawArray[i] = subdoc.$init(rawArray[i]); + } else { + if (prev && typeof prev.id === 'function') { + subdoc = prev.id(rawArray[i]._id); + } + + if (prev && subdoc && utils.deepEqual(subdoc.toObject(_toObjectOptions), rawArray[i])) { + // handle resetting doc with existing id and same data + subdoc.set(rawArray[i]); + // if set() is hooked it will have no return value + // see gh-746 + rawArray[i] = subdoc; + } else { + try { + subdoc = new Constructor(rawArray[i], value, undefined, + undefined, i); + // if set() is hooked it will have no return value + // see gh-746 + rawArray[i] = subdoc; + } catch (error) { + throw new CastError('embedded', rawArray[i], + value[arrayPathSymbol], error, this); + } + } + } + } + } + + return value; +}; + +/*! + * ignore + */ + +DocumentArrayPath.prototype.clone = function() { + const options = Object.assign({}, this.options); + const schematype = new this.constructor(this.path, this.schema, options, this.schemaOptions); + schematype.validators = this.validators.slice(); + if (this.requiredValidator !== undefined) { + schematype.requiredValidator = this.requiredValidator; + } + schematype.Constructor.discriminators = Object.assign({}, + this.Constructor.discriminators); + return schematype; +}; + +/*! + * ignore + */ + +DocumentArrayPath.prototype.applyGetters = function(value, scope) { + return SchemaType.prototype.applyGetters.call(this, value, scope); +}; + +/*! + * Scopes paths selected in a query to this array. + * Necessary for proper default application of subdocument values. + * + * @param {DocumentArrayPath} array - the array to scope `fields` paths + * @param {Object|undefined} fields - the root fields selected in the query + * @param {Boolean|undefined} init - if we are being created part of a query result + */ + +function scopePaths(array, fields, init) { + if (!(init && fields)) { + return undefined; + } + + const path = array.path + '.'; + const keys = Object.keys(fields); + let i = keys.length; + const selected = {}; + let hasKeys; + let key; + let sub; + + while (i--) { + key = keys[i]; + if (key.startsWith(path)) { + sub = key.substring(path.length); + if (sub === '$') { + continue; + } + if (sub.startsWith('$.')) { + sub = sub.substring(2); + } + hasKeys || (hasKeys = true); + selected[sub] = fields[key]; + } + } + + return hasKeys && selected || undefined; +} + +/** + * Sets a default option for all DocumentArray instances. + * + * #### Example: + * + * // Make all numbers have option `min` equal to 0. + * mongoose.Schema.DocumentArray.set('_id', false); + * + * @param {String} option - The option you'd like to set the value for + * @param {*} value - value for option + * @return {undefined} + * @function set + * @static + * @api public + */ + +DocumentArrayPath.defaultOptions = {}; + +DocumentArrayPath.set = SchemaType.set; + +/*! + * Module exports. + */ + +module.exports = DocumentArrayPath; diff --git a/node_modules/mongoose/lib/schema/index.js b/node_modules/mongoose/lib/schema/index.js new file mode 100644 index 000000000..999bef7c6 --- /dev/null +++ b/node_modules/mongoose/lib/schema/index.js @@ -0,0 +1,37 @@ + +/*! + * Module exports. + */ + +'use strict'; + +exports.String = require('./string'); + +exports.Number = require('./number'); + +exports.Boolean = require('./boolean'); + +exports.DocumentArray = require('./documentarray'); + +exports.Subdocument = require('./SubdocumentPath'); + +exports.Array = require('./array'); + +exports.Buffer = require('./buffer'); + +exports.Date = require('./date'); + +exports.ObjectId = require('./objectid'); + +exports.Mixed = require('./mixed'); + +exports.Decimal128 = exports.Decimal = require('./decimal128'); + +exports.Map = require('./map'); + +// alias + +exports.Oid = exports.ObjectId; +exports.Object = exports.Mixed; +exports.Bool = exports.Boolean; +exports.ObjectID = exports.ObjectId; diff --git a/node_modules/mongoose/lib/schema/map.js b/node_modules/mongoose/lib/schema/map.js new file mode 100644 index 000000000..ce25a11f5 --- /dev/null +++ b/node_modules/mongoose/lib/schema/map.js @@ -0,0 +1,84 @@ +'use strict'; + +/*! + * ignore + */ + +const MongooseMap = require('../types/map'); +const SchemaMapOptions = require('../options/SchemaMapOptions'); +const SchemaType = require('../schematype'); +/*! + * ignore + */ + +class Map extends SchemaType { + constructor(key, options) { + super(key, options, 'Map'); + this.$isSchemaMap = true; + } + + set(option, value) { + return SchemaType.set(option, value); + } + + cast(val, doc, init) { + if (val instanceof MongooseMap) { + return val; + } + + const path = this.path; + + if (init) { + const map = new MongooseMap({}, path, doc, this.$__schemaType); + + if (val instanceof global.Map) { + for (const key of val.keys()) { + let _val = val.get(key); + if (_val == null) { + _val = map.$__schemaType._castNullish(_val); + } else { + _val = map.$__schemaType.cast(_val, doc, true, null, { path: path + '.' + key }); + } + map.$init(key, _val); + } + } else { + for (const key of Object.keys(val)) { + let _val = val[key]; + if (_val == null) { + _val = map.$__schemaType._castNullish(_val); + } else { + _val = map.$__schemaType.cast(_val, doc, true, null, { path: path + '.' + key }); + } + map.$init(key, _val); + } + } + + return map; + } + + return new MongooseMap(val, path, doc, this.$__schemaType); + } + + clone() { + const schematype = super.clone(); + + if (this.$__schemaType != null) { + schematype.$__schemaType = this.$__schemaType.clone(); + } + return schematype; + } +} + +/** + * This schema type's name, to defend against minifiers that mangle + * function names. + * + * @api public + */ +Map.schemaName = 'Map'; + +Map.prototype.OptionsConstructor = SchemaMapOptions; + +Map.defaultOptions = {}; + +module.exports = Map; diff --git a/node_modules/mongoose/lib/schema/mixed.js b/node_modules/mongoose/lib/schema/mixed.js new file mode 100644 index 000000000..4b236eec7 --- /dev/null +++ b/node_modules/mongoose/lib/schema/mixed.js @@ -0,0 +1,132 @@ +/*! + * Module dependencies. + */ + +'use strict'; + +const SchemaType = require('../schematype'); +const symbols = require('./symbols'); +const isObject = require('../helpers/isObject'); +const utils = require('../utils'); + +/** + * Mixed SchemaType constructor. + * + * @param {String} path + * @param {Object} options + * @inherits SchemaType + * @api public + */ + +function Mixed(path, options) { + if (options && options.default) { + const def = options.default; + if (Array.isArray(def) && def.length === 0) { + // make sure empty array defaults are handled + options.default = Array; + } else if (!options.shared && isObject(def) && Object.keys(def).length === 0) { + // prevent odd "shared" objects between documents + options.default = function() { + return {}; + }; + } + } + + SchemaType.call(this, path, options, 'Mixed'); + + this[symbols.schemaMixedSymbol] = true; +} + +/** + * This schema type's name, to defend against minifiers that mangle + * function names. + * + * @api public + */ +Mixed.schemaName = 'Mixed'; + +Mixed.defaultOptions = {}; + +/*! + * Inherits from SchemaType. + */ +Mixed.prototype = Object.create(SchemaType.prototype); +Mixed.prototype.constructor = Mixed; + +/** + * Attaches a getter for all Mixed paths. + * + * #### Example: + * + * // Hide the 'hidden' path + * mongoose.Schema.Mixed.get(v => Object.assign({}, v, { hidden: null })); + * + * const Model = mongoose.model('Test', new Schema({ test: {} })); + * new Model({ test: { hidden: 'Secret!' } }).test.hidden; // null + * + * @param {Function} getter + * @return {this} + * @function get + * @static + * @api public + */ + +Mixed.get = SchemaType.get; + +/** + * Sets a default option for all Mixed instances. + * + * #### Example: + * + * // Make all mixed instances have `required` of true by default. + * mongoose.Schema.Mixed.set('required', true); + * + * const User = mongoose.model('User', new Schema({ test: mongoose.Mixed })); + * new User({ }).validateSync().errors.test.message; // Path `test` is required. + * + * @param {String} option - The option you'd like to set the value for + * @param {*} value - value for option + * @return {undefined} + * @function set + * @static + * @api public + */ + +Mixed.set = SchemaType.set; + +/** + * Casts `val` for Mixed. + * + * _this is a no-op_ + * + * @param {Object} value to cast + * @api private + */ + +Mixed.prototype.cast = function(val) { + if (val instanceof Error) { + return utils.errorToPOJO(val); + } + return val; +}; + +/** + * Casts contents for queries. + * + * @param {String} $cond + * @param {any} [val] + * @api private + */ + +Mixed.prototype.castForQuery = function($cond, val) { + if (arguments.length === 2) { + return val; + } + return $cond; +}; + +/*! + * Module exports. + */ + +module.exports = Mixed; diff --git a/node_modules/mongoose/lib/schema/number.js b/node_modules/mongoose/lib/schema/number.js new file mode 100644 index 000000000..8abb26f43 --- /dev/null +++ b/node_modules/mongoose/lib/schema/number.js @@ -0,0 +1,438 @@ +'use strict'; + +/*! + * Module requirements. + */ + +const MongooseError = require('../error/index'); +const SchemaNumberOptions = require('../options/SchemaNumberOptions'); +const SchemaType = require('../schematype'); +const castNumber = require('../cast/number'); +const handleBitwiseOperator = require('./operators/bitwise'); +const utils = require('../utils'); + +const CastError = SchemaType.CastError; + +/** + * Number SchemaType constructor. + * + * @param {String} key + * @param {Object} options + * @inherits SchemaType + * @api public + */ + +function SchemaNumber(key, options) { + SchemaType.call(this, key, options, 'Number'); +} + +/** + * Attaches a getter for all Number instances. + * + * #### Example: + * + * // Make all numbers round down + * mongoose.Number.get(function(v) { return Math.floor(v); }); + * + * const Model = mongoose.model('Test', new Schema({ test: Number })); + * new Model({ test: 3.14 }).test; // 3 + * + * @param {Function} getter + * @return {this} + * @function get + * @static + * @api public + */ + +SchemaNumber.get = SchemaType.get; + +/** + * Sets a default option for all Number instances. + * + * #### Example: + * + * // Make all numbers have option `min` equal to 0. + * mongoose.Schema.Number.set('min', 0); + * + * const Order = mongoose.model('Order', new Schema({ amount: Number })); + * new Order({ amount: -10 }).validateSync().errors.amount.message; // Path `amount` must be larger than 0. + * + * @param {String} option - The option you'd like to set the value for + * @param {*} value - value for option + * @return {undefined} + * @function set + * @static + * @api public + */ + +SchemaNumber.set = SchemaType.set; + +/*! + * ignore + */ + +SchemaNumber._cast = castNumber; + +/** + * Get/set the function used to cast arbitrary values to numbers. + * + * #### Example: + * + * // Make Mongoose cast empty strings '' to 0 for paths declared as numbers + * const original = mongoose.Number.cast(); + * mongoose.Number.cast(v => { + * if (v === '') { return 0; } + * return original(v); + * }); + * + * // Or disable casting entirely + * mongoose.Number.cast(false); + * + * @param {Function} caster + * @return {Function} + * @function get + * @static + * @api public + */ + +SchemaNumber.cast = function cast(caster) { + if (arguments.length === 0) { + return this._cast; + } + if (caster === false) { + caster = this._defaultCaster; + } + this._cast = caster; + + return this._cast; +}; + +/*! + * ignore + */ + +SchemaNumber._defaultCaster = v => { + if (typeof v !== 'number') { + throw new Error(); + } + return v; +}; + +/** + * This schema type's name, to defend against minifiers that mangle + * function names. + * + * @api public + */ +SchemaNumber.schemaName = 'Number'; + +SchemaNumber.defaultOptions = {}; + +/*! + * Inherits from SchemaType. + */ +SchemaNumber.prototype = Object.create(SchemaType.prototype); +SchemaNumber.prototype.constructor = SchemaNumber; +SchemaNumber.prototype.OptionsConstructor = SchemaNumberOptions; + +/*! + * ignore + */ + +SchemaNumber._checkRequired = v => typeof v === 'number' || v instanceof Number; + +/** + * Override the function the required validator uses to check whether a string + * passes the `required` check. + * + * @param {Function} fn + * @return {Function} + * @function checkRequired + * @static + * @api public + */ + +SchemaNumber.checkRequired = SchemaType.checkRequired; + +/** + * Check if the given value satisfies a required validator. + * + * @param {Any} value + * @param {Document} doc + * @return {Boolean} + * @api public + */ + +SchemaNumber.prototype.checkRequired = function checkRequired(value, doc) { + if (SchemaType._isRef(this, value, doc, true)) { + return !!value; + } + + // `require('util').inherits()` does **not** copy static properties, and + // plugins like mongoose-float use `inherits()` for pre-ES6. + const _checkRequired = typeof this.constructor.checkRequired === 'function' ? + this.constructor.checkRequired() : + SchemaNumber.checkRequired(); + + return _checkRequired(value); +}; + +/** + * Sets a minimum number validator. + * + * #### Example: + * + * const s = new Schema({ n: { type: Number, min: 10 }) + * const M = db.model('M', s) + * const m = new M({ n: 9 }) + * m.save(function (err) { + * console.error(err) // validator error + * m.n = 10; + * m.save() // success + * }) + * + * // custom error messages + * // We can also use the special {MIN} token which will be replaced with the invalid value + * const min = [10, 'The value of path `{PATH}` ({VALUE}) is beneath the limit ({MIN}).']; + * const schema = new Schema({ n: { type: Number, min: min }) + * const M = mongoose.model('Measurement', schema); + * const s= new M({ n: 4 }); + * s.validate(function (err) { + * console.log(String(err)) // ValidationError: The value of path `n` (4) is beneath the limit (10). + * }) + * + * @param {Number} value minimum number + * @param {String} [message] optional custom error message + * @return {SchemaType} this + * @see Customized Error Messages #error_messages_MongooseError-messages + * @api public + */ + +SchemaNumber.prototype.min = function(value, message) { + if (this.minValidator) { + this.validators = this.validators.filter(function(v) { + return v.validator !== this.minValidator; + }, this); + } + + if (value !== null && value !== undefined) { + let msg = message || MongooseError.messages.Number.min; + msg = msg.replace(/{MIN}/, value); + this.validators.push({ + validator: this.minValidator = function(v) { + return v == null || v >= value; + }, + message: msg, + type: 'min', + min: value + }); + } + + return this; +}; + +/** + * Sets a maximum number validator. + * + * #### Example: + * + * const s = new Schema({ n: { type: Number, max: 10 }) + * const M = db.model('M', s) + * const m = new M({ n: 11 }) + * m.save(function (err) { + * console.error(err) // validator error + * m.n = 10; + * m.save() // success + * }) + * + * // custom error messages + * // We can also use the special {MAX} token which will be replaced with the invalid value + * const max = [10, 'The value of path `{PATH}` ({VALUE}) exceeds the limit ({MAX}).']; + * const schema = new Schema({ n: { type: Number, max: max }) + * const M = mongoose.model('Measurement', schema); + * const s= new M({ n: 4 }); + * s.validate(function (err) { + * console.log(String(err)) // ValidationError: The value of path `n` (4) exceeds the limit (10). + * }) + * + * @param {Number} maximum number + * @param {String} [message] optional custom error message + * @return {SchemaType} this + * @see Customized Error Messages #error_messages_MongooseError-messages + * @api public + */ + +SchemaNumber.prototype.max = function(value, message) { + if (this.maxValidator) { + this.validators = this.validators.filter(function(v) { + return v.validator !== this.maxValidator; + }, this); + } + + if (value !== null && value !== undefined) { + let msg = message || MongooseError.messages.Number.max; + msg = msg.replace(/{MAX}/, value); + this.validators.push({ + validator: this.maxValidator = function(v) { + return v == null || v <= value; + }, + message: msg, + type: 'max', + max: value + }); + } + + return this; +}; + +/** + * Sets a enum validator + * + * #### Example: + * + * const s = new Schema({ n: { type: Number, enum: [1, 2, 3] }); + * const M = db.model('M', s); + * + * const m = new M({ n: 4 }); + * await m.save(); // throws validation error + * + * m.n = 3; + * await m.save(); // succeeds + * + * @param {Array} values allowed values + * @param {String} [message] optional custom error message + * @return {SchemaType} this + * @see Customized Error Messages #error_messages_MongooseError-messages + * @api public + */ + +SchemaNumber.prototype.enum = function(values, message) { + if (this.enumValidator) { + this.validators = this.validators.filter(function(v) { + return v.validator !== this.enumValidator; + }, this); + } + + + if (!Array.isArray(values)) { + const isObjectSyntax = utils.isPOJO(values) && values.values != null; + if (isObjectSyntax) { + message = values.message; + values = values.values; + } else if (typeof values === 'number') { + values = Array.prototype.slice.call(arguments); + message = null; + } + + if (utils.isPOJO(values)) { + values = Object.values(values); + } + message = message || MongooseError.messages.Number.enum; + } + + message = message == null ? MongooseError.messages.Number.enum : message; + + this.enumValidator = v => v == null || values.indexOf(v) !== -1; + this.validators.push({ + validator: this.enumValidator, + message: message, + type: 'enum', + enumValues: values + }); + + return this; +}; + +/** + * Casts to number + * + * @param {Object} value value to cast + * @param {Document} doc document that triggers the casting + * @param {Boolean} init + * @api private + */ + +SchemaNumber.prototype.cast = function(value, doc, init) { + if (typeof value !== 'number' && SchemaType._isRef(this, value, doc, init)) { + if (value == null || utils.isNonBuiltinObject(value)) { + return this._castRef(value, doc, init); + } + } + + const val = value && typeof value._id !== 'undefined' ? + value._id : // documents + value; + + let castNumber; + if (typeof this._castFunction === 'function') { + castNumber = this._castFunction; + } else if (typeof this.constructor.cast === 'function') { + castNumber = this.constructor.cast(); + } else { + castNumber = SchemaNumber.cast(); + } + + try { + return castNumber(val); + } catch (err) { + throw new CastError('Number', val, this.path, err, this); + } +}; + +/*! + * ignore + */ + +function handleSingle(val) { + return this.cast(val); +} + +function handleArray(val) { + const _this = this; + if (!Array.isArray(val)) { + return [this.cast(val)]; + } + return val.map(function(m) { + return _this.cast(m); + }); +} + +SchemaNumber.prototype.$conditionalHandlers = + utils.options(SchemaType.prototype.$conditionalHandlers, { + $bitsAllClear: handleBitwiseOperator, + $bitsAnyClear: handleBitwiseOperator, + $bitsAllSet: handleBitwiseOperator, + $bitsAnySet: handleBitwiseOperator, + $gt: handleSingle, + $gte: handleSingle, + $lt: handleSingle, + $lte: handleSingle, + $mod: handleArray + }); + +/** + * Casts contents for queries. + * + * @param {String} $conditional + * @param {any} [value] + * @api private + */ + +SchemaNumber.prototype.castForQuery = function($conditional, val) { + let handler; + if (arguments.length === 2) { + handler = this.$conditionalHandlers[$conditional]; + if (!handler) { + throw new CastError('number', val, this.path, null, this); + } + return handler.call(this, val); + } + val = this._castForQuery($conditional); + return val; +}; + +/*! + * Module exports. + */ + +module.exports = SchemaNumber; diff --git a/node_modules/mongoose/lib/schema/objectid.js b/node_modules/mongoose/lib/schema/objectid.js new file mode 100644 index 000000000..09a11f716 --- /dev/null +++ b/node_modules/mongoose/lib/schema/objectid.js @@ -0,0 +1,295 @@ +/*! + * Module dependencies. + */ + +'use strict'; + +const SchemaObjectIdOptions = require('../options/SchemaObjectIdOptions'); +const SchemaType = require('../schematype'); +const castObjectId = require('../cast/objectid'); +const getConstructorName = require('../helpers/getConstructorName'); +const oid = require('../types/objectid'); +const isBsonType = require('../helpers/isBsonType'); +const utils = require('../utils'); + +const CastError = SchemaType.CastError; +let Document; + +/** + * ObjectId SchemaType constructor. + * + * @param {String} key + * @param {Object} options + * @inherits SchemaType + * @api public + */ + +function ObjectId(key, options) { + const isKeyHexStr = typeof key === 'string' && key.length === 24 && /^[a-f0-9]+$/i.test(key); + const suppressWarning = options && options.suppressWarning; + if ((isKeyHexStr || typeof key === 'undefined') && !suppressWarning) { + utils.warn('mongoose: To create a new ObjectId please try ' + + '`Mongoose.Types.ObjectId` instead of using ' + + '`Mongoose.Schema.ObjectId`. Set the `suppressWarning` option if ' + + 'you\'re trying to create a hex char path in your schema.'); + } + SchemaType.call(this, key, options, 'ObjectID'); +} + +/** + * This schema type's name, to defend against minifiers that mangle + * function names. + * + * @api public + */ +ObjectId.schemaName = 'ObjectId'; + +ObjectId.defaultOptions = {}; + +/*! + * Inherits from SchemaType. + */ +ObjectId.prototype = Object.create(SchemaType.prototype); +ObjectId.prototype.constructor = ObjectId; +ObjectId.prototype.OptionsConstructor = SchemaObjectIdOptions; + +/** + * Attaches a getter for all ObjectId instances + * + * #### Example: + * + * // Always convert to string when getting an ObjectId + * mongoose.ObjectId.get(v => v.toString()); + * + * const Model = mongoose.model('Test', new Schema({})); + * typeof (new Model({})._id); // 'string' + * + * @param {Function} getter + * @return {this} + * @function get + * @static + * @api public + */ + +ObjectId.get = SchemaType.get; + +/** + * Sets a default option for all ObjectId instances. + * + * #### Example: + * + * // Make all object ids have option `required` equal to true. + * mongoose.Schema.ObjectId.set('required', true); + * + * const Order = mongoose.model('Order', new Schema({ userId: ObjectId })); + * new Order({ }).validateSync().errors.userId.message; // Path `userId` is required. + * + * @param {String} option - The option you'd like to set the value for + * @param {*} value - value for option + * @return {undefined} + * @function set + * @static + * @api public + */ + +ObjectId.set = SchemaType.set; + +/** + * Adds an auto-generated ObjectId default if turnOn is true. + * @param {Boolean} turnOn auto generated ObjectId defaults + * @api public + * @return {SchemaType} this + */ + +ObjectId.prototype.auto = function(turnOn) { + if (turnOn) { + this.default(defaultId); + this.set(resetId); + } + + return this; +}; + +/*! + * ignore + */ + +ObjectId._checkRequired = v => isBsonType(v, 'ObjectID'); + +/*! + * ignore + */ + +ObjectId._cast = castObjectId; + +/** + * Get/set the function used to cast arbitrary values to objectids. + * + * #### Example: + * + * // Make Mongoose only try to cast length 24 strings. By default, any 12 + * // char string is a valid ObjectId. + * const original = mongoose.ObjectId.cast(); + * mongoose.ObjectId.cast(v => { + * assert.ok(typeof v !== 'string' || v.length === 24); + * return original(v); + * }); + * + * // Or disable casting entirely + * mongoose.ObjectId.cast(false); + * + * @param {Function} caster + * @return {Function} + * @function get + * @static + * @api public + */ + +ObjectId.cast = function cast(caster) { + if (arguments.length === 0) { + return this._cast; + } + if (caster === false) { + caster = this._defaultCaster; + } + this._cast = caster; + + return this._cast; +}; + +/*! + * ignore + */ + +ObjectId._defaultCaster = v => { + if (!(isBsonType(v, 'ObjectID'))) { + throw new Error(v + ' is not an instance of ObjectId'); + } + return v; +}; + +/** + * Override the function the required validator uses to check whether a string + * passes the `required` check. + * + * #### Example: + * + * // Allow empty strings to pass `required` check + * mongoose.Schema.Types.String.checkRequired(v => v != null); + * + * const M = mongoose.model({ str: { type: String, required: true } }); + * new M({ str: '' }).validateSync(); // `null`, validation passes! + * + * @param {Function} fn + * @return {Function} + * @function checkRequired + * @static + * @api public + */ + +ObjectId.checkRequired = SchemaType.checkRequired; + +/** + * Check if the given value satisfies a required validator. + * + * @param {Any} value + * @param {Document} doc + * @return {Boolean} + * @api public + */ + +ObjectId.prototype.checkRequired = function checkRequired(value, doc) { + if (SchemaType._isRef(this, value, doc, true)) { + return !!value; + } + + // `require('util').inherits()` does **not** copy static properties, and + // plugins like mongoose-float use `inherits()` for pre-ES6. + const _checkRequired = typeof this.constructor.checkRequired === 'function' ? + this.constructor.checkRequired() : + ObjectId.checkRequired(); + + return _checkRequired(value); +}; + +/** + * Casts to ObjectId + * + * @param {Object} value + * @param {Object} doc + * @param {Boolean} init whether this is an initialization cast + * @api private + */ + +ObjectId.prototype.cast = function(value, doc, init) { + if (!(isBsonType(value, 'ObjectID')) && SchemaType._isRef(this, value, doc, init)) { + // wait! we may need to cast this to a document + if ((getConstructorName(value) || '').toLowerCase() === 'objectid') { + return new oid(value.toHexString()); + } + + if (value == null || utils.isNonBuiltinObject(value)) { + return this._castRef(value, doc, init); + } + } + + let castObjectId; + if (typeof this._castFunction === 'function') { + castObjectId = this._castFunction; + } else if (typeof this.constructor.cast === 'function') { + castObjectId = this.constructor.cast(); + } else { + castObjectId = ObjectId.cast(); + } + + try { + return castObjectId(value); + } catch (error) { + throw new CastError('ObjectId', value, this.path, error, this); + } +}; + +/*! + * ignore + */ + +function handleSingle(val) { + return this.cast(val); +} + +ObjectId.prototype.$conditionalHandlers = + utils.options(SchemaType.prototype.$conditionalHandlers, { + $gt: handleSingle, + $gte: handleSingle, + $lt: handleSingle, + $lte: handleSingle + }); + +/*! + * ignore + */ + +function defaultId() { + return new oid(); +} + +defaultId.$runBeforeSetters = true; + +function resetId(v) { + Document || (Document = require('./../document')); + + if (this instanceof Document) { + if (v === void 0) { + const _v = new oid(); + return _v; + } + } + + return v; +} + +/*! + * Module exports. + */ + +module.exports = ObjectId; diff --git a/node_modules/mongoose/lib/schema/operators/bitwise.js b/node_modules/mongoose/lib/schema/operators/bitwise.js new file mode 100644 index 000000000..07e18cd0c --- /dev/null +++ b/node_modules/mongoose/lib/schema/operators/bitwise.js @@ -0,0 +1,38 @@ +/*! + * Module requirements. + */ + +'use strict'; + +const CastError = require('../../error/cast'); + +/*! + * ignore + */ + +function handleBitwiseOperator(val) { + const _this = this; + if (Array.isArray(val)) { + return val.map(function(v) { + return _castNumber(_this.path, v); + }); + } else if (Buffer.isBuffer(val)) { + return val; + } + // Assume trying to cast to number + return _castNumber(_this.path, val); +} + +/*! + * ignore + */ + +function _castNumber(path, num) { + const v = Number(num); + if (isNaN(v)) { + throw new CastError('number', num, path); + } + return v; +} + +module.exports = handleBitwiseOperator; diff --git a/node_modules/mongoose/lib/schema/operators/exists.js b/node_modules/mongoose/lib/schema/operators/exists.js new file mode 100644 index 000000000..916b4cbf6 --- /dev/null +++ b/node_modules/mongoose/lib/schema/operators/exists.js @@ -0,0 +1,12 @@ +'use strict'; + +const castBoolean = require('../../cast/boolean'); + +/*! + * ignore + */ + +module.exports = function(val) { + const path = this != null ? this.path : null; + return castBoolean(val, path); +}; diff --git a/node_modules/mongoose/lib/schema/operators/geospatial.js b/node_modules/mongoose/lib/schema/operators/geospatial.js new file mode 100644 index 000000000..80a605207 --- /dev/null +++ b/node_modules/mongoose/lib/schema/operators/geospatial.js @@ -0,0 +1,107 @@ +/*! + * Module requirements. + */ + +'use strict'; + +const castArraysOfNumbers = require('./helpers').castArraysOfNumbers; +const castToNumber = require('./helpers').castToNumber; + +/*! + * ignore + */ + +exports.cast$geoIntersects = cast$geoIntersects; +exports.cast$near = cast$near; +exports.cast$within = cast$within; + +function cast$near(val) { + const SchemaArray = require('../array'); + + if (Array.isArray(val)) { + castArraysOfNumbers(val, this); + return val; + } + + _castMinMaxDistance(this, val); + + if (val && val.$geometry) { + return cast$geometry(val, this); + } + + if (!Array.isArray(val)) { + throw new TypeError('$near must be either an array or an object ' + + 'with a $geometry property'); + } + + return SchemaArray.prototype.castForQuery.call(this, val); +} + +function cast$geometry(val, self) { + switch (val.$geometry.type) { + case 'Polygon': + case 'LineString': + case 'Point': + castArraysOfNumbers(val.$geometry.coordinates, self); + break; + default: + // ignore unknowns + break; + } + + _castMinMaxDistance(self, val); + + return val; +} + +function cast$within(val) { + _castMinMaxDistance(this, val); + + if (val.$box || val.$polygon) { + const type = val.$box ? '$box' : '$polygon'; + val[type].forEach(arr => { + if (!Array.isArray(arr)) { + const msg = 'Invalid $within $box argument. ' + + 'Expected an array, received ' + arr; + throw new TypeError(msg); + } + arr.forEach((v, i) => { + arr[i] = castToNumber.call(this, v); + }); + }); + } else if (val.$center || val.$centerSphere) { + const type = val.$center ? '$center' : '$centerSphere'; + val[type].forEach((item, i) => { + if (Array.isArray(item)) { + item.forEach((v, j) => { + item[j] = castToNumber.call(this, v); + }); + } else { + val[type][i] = castToNumber.call(this, item); + } + }); + } else if (val.$geometry) { + cast$geometry(val, this); + } + + return val; +} + +function cast$geoIntersects(val) { + const geo = val.$geometry; + if (!geo) { + return; + } + + cast$geometry(val, this); + return val; +} + +function _castMinMaxDistance(self, val) { + if (val.$maxDistance) { + val.$maxDistance = castToNumber.call(self, val.$maxDistance); + } + if (val.$minDistance) { + val.$minDistance = castToNumber.call(self, val.$minDistance); + } +} diff --git a/node_modules/mongoose/lib/schema/operators/helpers.js b/node_modules/mongoose/lib/schema/operators/helpers.js new file mode 100644 index 000000000..a17951cd7 --- /dev/null +++ b/node_modules/mongoose/lib/schema/operators/helpers.js @@ -0,0 +1,32 @@ +'use strict'; + +/*! + * Module requirements. + */ + +const SchemaNumber = require('../number'); + +/*! + * @ignore + */ + +exports.castToNumber = castToNumber; +exports.castArraysOfNumbers = castArraysOfNumbers; + +/*! + * @ignore + */ + +function castToNumber(val) { + return SchemaNumber.cast()(val); +} + +function castArraysOfNumbers(arr, self) { + arr.forEach(function(v, i) { + if (Array.isArray(v)) { + castArraysOfNumbers(v, self); + } else { + arr[i] = castToNumber.call(self, v); + } + }); +} diff --git a/node_modules/mongoose/lib/schema/operators/text.js b/node_modules/mongoose/lib/schema/operators/text.js new file mode 100644 index 000000000..4b959168d --- /dev/null +++ b/node_modules/mongoose/lib/schema/operators/text.js @@ -0,0 +1,39 @@ +'use strict'; + +const CastError = require('../../error/cast'); +const castBoolean = require('../../cast/boolean'); +const castString = require('../../cast/string'); + +/*! + * Casts val to an object suitable for `$text`. Throws an error if the object + * can't be casted. + * + * @param {Any} val value to cast + * @param {String} [path] path to associate with any errors that occured + * @return {Object} casted object + * @see https://docs.mongodb.com/manual/reference/operator/query/text/ + * @api private + */ + +module.exports = function(val, path) { + if (val == null || typeof val !== 'object') { + throw new CastError('$text', val, path); + } + + if (val.$search != null) { + val.$search = castString(val.$search, path + '.$search'); + } + if (val.$language != null) { + val.$language = castString(val.$language, path + '.$language'); + } + if (val.$caseSensitive != null) { + val.$caseSensitive = castBoolean(val.$caseSensitive, + path + '.$castSensitive'); + } + if (val.$diacriticSensitive != null) { + val.$diacriticSensitive = castBoolean(val.$diacriticSensitive, + path + '.$diacriticSensitive'); + } + + return val; +}; diff --git a/node_modules/mongoose/lib/schema/operators/type.js b/node_modules/mongoose/lib/schema/operators/type.js new file mode 100644 index 000000000..952c79007 --- /dev/null +++ b/node_modules/mongoose/lib/schema/operators/type.js @@ -0,0 +1,20 @@ +'use strict'; + +/*! + * ignore + */ + +module.exports = function(val) { + if (Array.isArray(val)) { + if (!val.every(v => typeof v === 'number' || typeof v === 'string')) { + throw new Error('$type array values must be strings or numbers'); + } + return val; + } + + if (typeof val !== 'number' && typeof val !== 'string') { + throw new Error('$type parameter must be number, string, or array of numbers and strings'); + } + + return val; +}; diff --git a/node_modules/mongoose/lib/schema/string.js b/node_modules/mongoose/lib/schema/string.js new file mode 100644 index 000000000..887565b40 --- /dev/null +++ b/node_modules/mongoose/lib/schema/string.js @@ -0,0 +1,691 @@ +'use strict'; + +/*! + * Module dependencies. + */ + +const SchemaType = require('../schematype'); +const MongooseError = require('../error/index'); +const SchemaStringOptions = require('../options/SchemaStringOptions'); +const castString = require('../cast/string'); +const utils = require('../utils'); +const isBsonType = require('../helpers/isBsonType'); + +const CastError = SchemaType.CastError; + +/** + * String SchemaType constructor. + * + * @param {String} key + * @param {Object} options + * @inherits SchemaType + * @api public + */ + +function SchemaString(key, options) { + this.enumValues = []; + this.regExp = null; + SchemaType.call(this, key, options, 'String'); +} + +/** + * This schema type's name, to defend against minifiers that mangle + * function names. + * + * @api public + */ +SchemaString.schemaName = 'String'; + +SchemaString.defaultOptions = {}; + +/*! + * Inherits from SchemaType. + */ +SchemaString.prototype = Object.create(SchemaType.prototype); +SchemaString.prototype.constructor = SchemaString; +Object.defineProperty(SchemaString.prototype, 'OptionsConstructor', { + configurable: false, + enumerable: false, + writable: false, + value: SchemaStringOptions +}); + +/*! + * ignore + */ + +SchemaString._cast = castString; + +/** + * Get/set the function used to cast arbitrary values to strings. + * + * #### Example: + * + * // Throw an error if you pass in an object. Normally, Mongoose allows + * // objects with custom `toString()` functions. + * const original = mongoose.Schema.Types.String.cast(); + * mongoose.Schema.Types.String.cast(v => { + * assert.ok(v == null || typeof v !== 'object'); + * return original(v); + * }); + * + * // Or disable casting entirely + * mongoose.Schema.Types.String.cast(false); + * + * @param {Function} caster + * @return {Function} + * @function get + * @static + * @api public + */ + +SchemaString.cast = function cast(caster) { + if (arguments.length === 0) { + return this._cast; + } + if (caster === false) { + caster = this._defaultCaster; + } + this._cast = caster; + + return this._cast; +}; + +/*! + * ignore + */ + +SchemaString._defaultCaster = v => { + if (v != null && typeof v !== 'string') { + throw new Error(); + } + return v; +}; + +/** + * Attaches a getter for all String instances. + * + * #### Example: + * + * // Make all numbers round down + * mongoose.Schema.String.get(v => v.toLowerCase()); + * + * const Model = mongoose.model('Test', new Schema({ test: String })); + * new Model({ test: 'FOO' }).test; // 'foo' + * + * @param {Function} getter + * @return {this} + * @function get + * @static + * @api public + */ + +SchemaString.get = SchemaType.get; + +/** + * Sets a default option for all String instances. + * + * #### Example: + * + * // Make all strings have option `trim` equal to true. + * mongoose.Schema.String.set('trim', true); + * + * const User = mongoose.model('User', new Schema({ name: String })); + * new User({ name: ' John Doe ' }).name; // 'John Doe' + * + * @param {String} option - The option you'd like to set the value for + * @param {*} value - value for option + * @return {undefined} + * @function set + * @static + * @api public + */ + +SchemaString.set = SchemaType.set; + +/*! + * ignore + */ + +SchemaString._checkRequired = v => (v instanceof String || typeof v === 'string') && v.length; + +/** + * Override the function the required validator uses to check whether a string + * passes the `required` check. + * + * #### Example: + * + * // Allow empty strings to pass `required` check + * mongoose.Schema.Types.String.checkRequired(v => v != null); + * + * const M = mongoose.model({ str: { type: String, required: true } }); + * new M({ str: '' }).validateSync(); // `null`, validation passes! + * + * @param {Function} fn + * @return {Function} + * @function checkRequired + * @static + * @api public + */ + +SchemaString.checkRequired = SchemaType.checkRequired; + +/** + * Adds an enum validator + * + * #### Example: + * + * const states = ['opening', 'open', 'closing', 'closed'] + * const s = new Schema({ state: { type: String, enum: states }}) + * const M = db.model('M', s) + * const m = new M({ state: 'invalid' }) + * m.save(function (err) { + * console.error(String(err)) // ValidationError: `invalid` is not a valid enum value for path `state`. + * m.state = 'open' + * m.save(callback) // success + * }) + * + * // or with custom error messages + * const enum = { + * values: ['opening', 'open', 'closing', 'closed'], + * message: 'enum validator failed for path `{PATH}` with value `{VALUE}`' + * } + * const s = new Schema({ state: { type: String, enum: enum }) + * const M = db.model('M', s) + * const m = new M({ state: 'invalid' }) + * m.save(function (err) { + * console.error(String(err)) // ValidationError: enum validator failed for path `state` with value `invalid` + * m.state = 'open' + * m.save(callback) // success + * }) + * + * @param {String|Object} [args...] enumeration values + * @return {SchemaType} this + * @see Customized Error Messages #error_messages_MongooseError-messages + * @api public + */ + +SchemaString.prototype.enum = function() { + if (this.enumValidator) { + this.validators = this.validators.filter(function(v) { + return v.validator !== this.enumValidator; + }, this); + this.enumValidator = false; + } + + if (arguments[0] === void 0 || arguments[0] === false) { + return this; + } + + let values; + let errorMessage; + + if (utils.isObject(arguments[0])) { + if (Array.isArray(arguments[0].values)) { + values = arguments[0].values; + errorMessage = arguments[0].message; + } else { + values = utils.object.vals(arguments[0]); + errorMessage = MongooseError.messages.String.enum; + } + } else { + values = arguments; + errorMessage = MongooseError.messages.String.enum; + } + + for (const value of values) { + if (value !== undefined) { + this.enumValues.push(this.cast(value)); + } + } + + const vals = this.enumValues; + this.enumValidator = function(v) { + return undefined === v || ~vals.indexOf(v); + }; + this.validators.push({ + validator: this.enumValidator, + message: errorMessage, + type: 'enum', + enumValues: vals + }); + + return this; +}; + +/** + * Adds a lowercase [setter](https://mongoosejs.com/docs/api.html#schematype_SchemaType-set). + * + * #### Example: + * + * const s = new Schema({ email: { type: String, lowercase: true }}) + * const M = db.model('M', s); + * const m = new M({ email: 'SomeEmail@example.COM' }); + * console.log(m.email) // someemail@example.com + * M.find({ email: 'SomeEmail@example.com' }); // Queries by 'someemail@example.com' + * + * Note that `lowercase` does **not** affect regular expression queries: + * + * #### Example: + * // Still queries for documents whose `email` matches the regular + * // expression /SomeEmail/. Mongoose does **not** convert the RegExp + * // to lowercase. + * M.find({ email: /SomeEmail/ }); + * + * @api public + * @return {SchemaType} this + */ + +SchemaString.prototype.lowercase = function(shouldApply) { + if (arguments.length > 0 && !shouldApply) { + return this; + } + return this.set(v => { + if (typeof v !== 'string') { + v = this.cast(v); + } + if (v) { + return v.toLowerCase(); + } + return v; + }); +}; + +/** + * Adds an uppercase [setter](https://mongoosejs.com/docs/api.html#schematype_SchemaType-set). + * + * #### Example: + * + * const s = new Schema({ caps: { type: String, uppercase: true }}) + * const M = db.model('M', s); + * const m = new M({ caps: 'an example' }); + * console.log(m.caps) // AN EXAMPLE + * M.find({ caps: 'an example' }) // Matches documents where caps = 'AN EXAMPLE' + * + * Note that `uppercase` does **not** affect regular expression queries: + * + * #### Example: + * // Mongoose does **not** convert the RegExp to uppercase. + * M.find({ email: /an example/ }); + * + * @api public + * @return {SchemaType} this + */ + +SchemaString.prototype.uppercase = function(shouldApply) { + if (arguments.length > 0 && !shouldApply) { + return this; + } + return this.set(v => { + if (typeof v !== 'string') { + v = this.cast(v); + } + if (v) { + return v.toUpperCase(); + } + return v; + }); +}; + +/** + * Adds a trim [setter](https://mongoosejs.com/docs/api.html#schematype_SchemaType-set). + * + * The string value will be [trimmed](https://masteringjs.io/tutorials/fundamentals/trim-string) when set. + * + * #### Example: + * + * const s = new Schema({ name: { type: String, trim: true }}); + * const M = db.model('M', s); + * const string = ' some name '; + * console.log(string.length); // 11 + * const m = new M({ name: string }); + * console.log(m.name.length); // 9 + * + * // Equivalent to `findOne({ name: string.trim() })` + * M.findOne({ name: string }); + * + * Note that `trim` does **not** affect regular expression queries: + * + * #### Example: + * // Mongoose does **not** trim whitespace from the RegExp. + * M.find({ name: / some name / }); + * + * @api public + * @return {SchemaType} this + */ + +SchemaString.prototype.trim = function(shouldTrim) { + if (arguments.length > 0 && !shouldTrim) { + return this; + } + return this.set(v => { + if (typeof v !== 'string') { + v = this.cast(v); + } + if (v) { + return v.trim(); + } + return v; + }); +}; + +/** + * Sets a minimum length validator. + * + * #### Example: + * + * const schema = new Schema({ postalCode: { type: String, minlength: 5 }) + * const Address = db.model('Address', schema) + * const address = new Address({ postalCode: '9512' }) + * address.save(function (err) { + * console.error(err) // validator error + * address.postalCode = '95125'; + * address.save() // success + * }) + * + * // custom error messages + * // We can also use the special {MINLENGTH} token which will be replaced with the minimum allowed length + * const minlength = [5, 'The value of path `{PATH}` (`{VALUE}`) is shorter than the minimum allowed length ({MINLENGTH}).']; + * const schema = new Schema({ postalCode: { type: String, minlength: minlength }) + * const Address = mongoose.model('Address', schema); + * const address = new Address({ postalCode: '9512' }); + * address.validate(function (err) { + * console.log(String(err)) // ValidationError: The value of path `postalCode` (`9512`) is shorter than the minimum length (5). + * }) + * + * @param {Number} value minimum string length + * @param {String} [message] optional custom error message + * @return {SchemaType} this + * @see Customized Error Messages #error_messages_MongooseError-messages + * @api public + */ + +SchemaString.prototype.minlength = function(value, message) { + if (this.minlengthValidator) { + this.validators = this.validators.filter(function(v) { + return v.validator !== this.minlengthValidator; + }, this); + } + + if (value !== null && value !== undefined) { + let msg = message || MongooseError.messages.String.minlength; + msg = msg.replace(/{MINLENGTH}/, value); + this.validators.push({ + validator: this.minlengthValidator = function(v) { + return v === null || v.length >= value; + }, + message: msg, + type: 'minlength', + minlength: value + }); + } + + return this; +}; + +SchemaString.prototype.minLength = SchemaString.prototype.minlength; + +/** + * Sets a maximum length validator. + * + * #### Example: + * + * const schema = new Schema({ postalCode: { type: String, maxlength: 9 }) + * const Address = db.model('Address', schema) + * const address = new Address({ postalCode: '9512512345' }) + * address.save(function (err) { + * console.error(err) // validator error + * address.postalCode = '95125'; + * address.save() // success + * }) + * + * // custom error messages + * // We can also use the special {MAXLENGTH} token which will be replaced with the maximum allowed length + * const maxlength = [9, 'The value of path `{PATH}` (`{VALUE}`) exceeds the maximum allowed length ({MAXLENGTH}).']; + * const schema = new Schema({ postalCode: { type: String, maxlength: maxlength }) + * const Address = mongoose.model('Address', schema); + * const address = new Address({ postalCode: '9512512345' }); + * address.validate(function (err) { + * console.log(String(err)) // ValidationError: The value of path `postalCode` (`9512512345`) exceeds the maximum allowed length (9). + * }) + * + * @param {Number} value maximum string length + * @param {String} [message] optional custom error message + * @return {SchemaType} this + * @see Customized Error Messages #error_messages_MongooseError-messages + * @api public + */ + +SchemaString.prototype.maxlength = function(value, message) { + if (this.maxlengthValidator) { + this.validators = this.validators.filter(function(v) { + return v.validator !== this.maxlengthValidator; + }, this); + } + + if (value !== null && value !== undefined) { + let msg = message || MongooseError.messages.String.maxlength; + msg = msg.replace(/{MAXLENGTH}/, value); + this.validators.push({ + validator: this.maxlengthValidator = function(v) { + return v === null || v.length <= value; + }, + message: msg, + type: 'maxlength', + maxlength: value + }); + } + + return this; +}; + +SchemaString.prototype.maxLength = SchemaString.prototype.maxlength; + +/** + * Sets a regexp validator. + * + * Any value that does not pass `regExp`.test(val) will fail validation. + * + * #### Example: + * + * const s = new Schema({ name: { type: String, match: /^a/ }}) + * const M = db.model('M', s) + * const m = new M({ name: 'I am invalid' }) + * m.validate(function (err) { + * console.error(String(err)) // "ValidationError: Path `name` is invalid (I am invalid)." + * m.name = 'apples' + * m.validate(function (err) { + * assert.ok(err) // success + * }) + * }) + * + * // using a custom error message + * const match = [ /\.html$/, "That file doesn't end in .html ({VALUE})" ]; + * const s = new Schema({ file: { type: String, match: match }}) + * const M = db.model('M', s); + * const m = new M({ file: 'invalid' }); + * m.validate(function (err) { + * console.log(String(err)) // "ValidationError: That file doesn't end in .html (invalid)" + * }) + * + * Empty strings, `undefined`, and `null` values always pass the match validator. If you require these values, enable the `required` validator also. + * + * const s = new Schema({ name: { type: String, match: /^a/, required: true }}) + * + * @param {RegExp} regExp regular expression to test against + * @param {String} [message] optional custom error message + * @return {SchemaType} this + * @see Customized Error Messages #error_messages_MongooseError-messages + * @api public + */ + +SchemaString.prototype.match = function match(regExp, message) { + // yes, we allow multiple match validators + + const msg = message || MongooseError.messages.String.match; + + const matchValidator = function(v) { + if (!regExp) { + return false; + } + + // In case RegExp happens to have `/g` flag set, we need to reset the + // `lastIndex`, otherwise `match` will intermittently fail. + regExp.lastIndex = 0; + + const ret = ((v != null && v !== '') + ? regExp.test(v) + : true); + return ret; + }; + + this.validators.push({ + validator: matchValidator, + message: msg, + type: 'regexp', + regexp: regExp + }); + return this; +}; + +/** + * Check if the given value satisfies the `required` validator. The value is + * considered valid if it is a string (that is, not `null` or `undefined`) and + * has positive length. The `required` validator **will** fail for empty + * strings. + * + * @param {Any} value + * @param {Document} doc + * @return {Boolean} + * @api public + */ + +SchemaString.prototype.checkRequired = function checkRequired(value, doc) { + if (SchemaType._isRef(this, value, doc, true)) { + return !!value; + } + + // `require('util').inherits()` does **not** copy static properties, and + // plugins like mongoose-float use `inherits()` for pre-ES6. + const _checkRequired = typeof this.constructor.checkRequired === 'function' ? + this.constructor.checkRequired() : + SchemaString.checkRequired(); + + return _checkRequired(value); +}; + +/** + * Casts to String + * + * @api private + */ + +SchemaString.prototype.cast = function(value, doc, init) { + if (typeof value !== 'string' && SchemaType._isRef(this, value, doc, init)) { + return this._castRef(value, doc, init); + } + + let castString; + if (typeof this._castFunction === 'function') { + castString = this._castFunction; + } else if (typeof this.constructor.cast === 'function') { + castString = this.constructor.cast(); + } else { + castString = SchemaString.cast(); + } + + try { + return castString(value); + } catch (error) { + throw new CastError('string', value, this.path, null, this); + } +}; + +/*! + * ignore + */ + +function handleSingle(val) { + return this.castForQuery(val); +} + +/*! + * ignore + */ + +function handleArray(val) { + const _this = this; + if (!Array.isArray(val)) { + return [this.castForQuery(val)]; + } + return val.map(function(m) { + return _this.castForQuery(m); + }); +} + +/*! + * ignore + */ + +function handleSingleNoSetters(val) { + if (val == null) { + return this._castNullish(val); + } + + return this.cast(val, this); +} + +const $conditionalHandlers = utils.options(SchemaType.prototype.$conditionalHandlers, { + $all: handleArray, + $gt: handleSingle, + $gte: handleSingle, + $lt: handleSingle, + $lte: handleSingle, + $options: handleSingleNoSetters, + $regex: function handle$regex(val) { + if (Object.prototype.toString.call(val) === '[object RegExp]') { + return val; + } + + return handleSingleNoSetters.call(this, val); + }, + $not: handleSingle +}); + +Object.defineProperty(SchemaString.prototype, '$conditionalHandlers', { + configurable: false, + enumerable: false, + writable: false, + value: Object.freeze($conditionalHandlers) +}); + +/** + * Casts contents for queries. + * + * @param {String} $conditional + * @param {any} [val] + * @api private + */ + +SchemaString.prototype.castForQuery = function($conditional, val) { + let handler; + if (arguments.length === 2) { + handler = this.$conditionalHandlers[$conditional]; + if (!handler) { + throw new Error('Can\'t use ' + $conditional + ' with String.'); + } + return handler.call(this, val); + } + val = $conditional; + if (Object.prototype.toString.call(val) === '[object RegExp]' || isBsonType(val, 'BSONRegExp')) { + return val; + } + + return this._castForQuery(val); +}; + +/*! + * Module exports. + */ + +module.exports = SchemaString; diff --git a/node_modules/mongoose/lib/schema/symbols.js b/node_modules/mongoose/lib/schema/symbols.js new file mode 100644 index 000000000..08d1d27ed --- /dev/null +++ b/node_modules/mongoose/lib/schema/symbols.js @@ -0,0 +1,5 @@ +'use strict'; + +exports.schemaMixedSymbol = Symbol.for('mongoose:schema_mixed'); + +exports.builtInMiddleware = Symbol.for('mongoose:built-in-middleware'); \ No newline at end of file diff --git a/node_modules/mongoose/lib/schematype.js b/node_modules/mongoose/lib/schematype.js new file mode 100644 index 000000000..53a687370 --- /dev/null +++ b/node_modules/mongoose/lib/schematype.js @@ -0,0 +1,1694 @@ +'use strict'; + +/*! + * Module dependencies. + */ + +const MongooseError = require('./error/index'); +const SchemaTypeOptions = require('./options/SchemaTypeOptions'); +const $exists = require('./schema/operators/exists'); +const $type = require('./schema/operators/type'); +const handleImmutable = require('./helpers/schematype/handleImmutable'); +const isAsyncFunction = require('./helpers/isAsyncFunction'); +const isSimpleValidator = require('./helpers/isSimpleValidator'); +const immediate = require('./helpers/immediate'); +const schemaTypeSymbol = require('./helpers/symbols').schemaTypeSymbol; +const utils = require('./utils'); +const validatorErrorSymbol = require('./helpers/symbols').validatorErrorSymbol; +const documentIsModified = require('./helpers/symbols').documentIsModified; + +const populateModelSymbol = require('./helpers/symbols').populateModelSymbol; + +const CastError = MongooseError.CastError; +const ValidatorError = MongooseError.ValidatorError; + +const setOptionsForDefaults = { _skipMarkModified: true }; + +/** + * SchemaType constructor. Do **not** instantiate `SchemaType` directly. + * Mongoose converts your schema paths into SchemaTypes automatically. + * + * #### Example: + * + * const schema = new Schema({ name: String }); + * schema.path('name') instanceof SchemaType; // true + * + * @param {String} path + * @param {SchemaTypeOptions} [options] See [SchemaTypeOptions docs](/docs/api/schematypeoptions.html) + * @param {String} [instance] + * @api public + */ + +function SchemaType(path, options, instance) { + this[schemaTypeSymbol] = true; + this.path = path; + this.instance = instance; + this.validators = []; + this.getters = this.constructor.hasOwnProperty('getters') ? + this.constructor.getters.slice() : + []; + this.setters = []; + + this.splitPath(); + + options = options || {}; + const defaultOptions = this.constructor.defaultOptions || {}; + const defaultOptionsKeys = Object.keys(defaultOptions); + + for (const option of defaultOptionsKeys) { + if (defaultOptions.hasOwnProperty(option) && !options.hasOwnProperty(option)) { + options[option] = defaultOptions[option]; + } + } + + if (options.select == null) { + delete options.select; + } + + const Options = this.OptionsConstructor || SchemaTypeOptions; + this.options = new Options(options); + this._index = null; + + + if (utils.hasUserDefinedProperty(this.options, 'immutable')) { + this.$immutable = this.options.immutable; + + handleImmutable(this); + } + + const keys = Object.keys(this.options); + for (const prop of keys) { + if (prop === 'cast') { + this.castFunction(this.options[prop]); + continue; + } + if (utils.hasUserDefinedProperty(this.options, prop) && typeof this[prop] === 'function') { + // { unique: true, index: true } + if (prop === 'index' && this._index) { + if (options.index === false) { + const index = this._index; + if (typeof index === 'object' && index != null) { + if (index.unique) { + throw new Error('Path "' + this.path + '" may not have `index` ' + + 'set to false and `unique` set to true'); + } + if (index.sparse) { + throw new Error('Path "' + this.path + '" may not have `index` ' + + 'set to false and `sparse` set to true'); + } + } + + this._index = false; + } + continue; + } + + const val = options[prop]; + // Special case so we don't screw up array defaults, see gh-5780 + if (prop === 'default') { + this.default(val); + continue; + } + + const opts = Array.isArray(val) ? val : [val]; + + this[prop].apply(this, opts); + } + } + + Object.defineProperty(this, '$$context', { + enumerable: false, + configurable: false, + writable: true, + value: null + }); +} + +/*! + * The class that Mongoose uses internally to instantiate this SchemaType's `options` property. + */ + +SchemaType.prototype.OptionsConstructor = SchemaTypeOptions; + +/** + * The path to this SchemaType in a Schema. + * + * #### Example: + * const schema = new Schema({ name: String }); + * schema.path('name').path; // 'name' + * + * @property path + * @api public + * @memberOf SchemaType + */ + +SchemaType.prototype.path; + +/** + * The validators that Mongoose should run to validate properties at this SchemaType's path. + * + * #### Example: + * const schema = new Schema({ name: { type: String, required: true } }); + * schema.path('name').validators.length; // 1, the `required` validator + * + * @property validators + * @api public + * @memberOf SchemaType + */ + +SchemaType.prototype.validators; + +/** + * True if this SchemaType has a required validator. False otherwise. + * + * #### Example: + * const schema = new Schema({ name: { type: String, required: true } }); + * schema.path('name').isRequired; // true + * + * schema.path('name').required(false); + * schema.path('name').isRequired; // false + * + * @property isRequired + * @api public + * @memberOf SchemaType + */ + +SchemaType.prototype.validators; + +/*! + * ignore + */ + +SchemaType.prototype.splitPath = function() { + if (this._presplitPath != null) { + return this._presplitPath; + } + if (this.path == null) { + return undefined; + } + + this._presplitPath = this.path.indexOf('.') === -1 ? [this.path] : this.path.split('.'); + return this._presplitPath; +}; + +/** + * Get/set the function used to cast arbitrary values to this type. + * + * #### Example: + * + * // Disallow `null` for numbers, and don't try to cast any values to + * // numbers, so even strings like '123' will cause a CastError. + * mongoose.Number.cast(function(v) { + * assert.ok(v === undefined || typeof v === 'number'); + * return v; + * }); + * + * @param {Function|false} caster Function that casts arbitrary values to this type, or throws an error if casting failed + * @return {Function} + * @static + * @receiver SchemaType + * @function cast + * @api public + */ + +SchemaType.cast = function cast(caster) { + if (arguments.length === 0) { + return this._cast; + } + if (caster === false) { + caster = v => v; + } + this._cast = caster; + + return this._cast; +}; + +/** + * Get/set the function used to cast arbitrary values to this particular schematype instance. + * Overrides `SchemaType.cast()`. + * + * #### Example: + * + * // Disallow `null` for numbers, and don't try to cast any values to + * // numbers, so even strings like '123' will cause a CastError. + * const number = new mongoose.Number('mypath', {}); + * number.cast(function(v) { + * assert.ok(v === undefined || typeof v === 'number'); + * return v; + * }); + * + * @param {Function|false} caster Function that casts arbitrary values to this type, or throws an error if casting failed + * @return {Function} + * @static + * @receiver SchemaType + * @function cast + * @api public + */ + +SchemaType.prototype.castFunction = function castFunction(caster) { + if (arguments.length === 0) { + return this._castFunction; + } + if (caster === false) { + caster = this.constructor._defaultCaster || (v => v); + } + this._castFunction = caster; + + return this._castFunction; +}; + +/** + * The function that Mongoose calls to cast arbitrary values to this SchemaType. + * + * @param {Object} value value to cast + * @param {Document} doc document that triggers the casting + * @param {Boolean} init + * @api public + */ + +SchemaType.prototype.cast = function cast() { + throw new Error('Base SchemaType class does not implement a `cast()` function'); +}; + +/** + * Sets a default option for this schema type. + * + * #### Example: + * + * // Make all strings be trimmed by default + * mongoose.SchemaTypes.String.set('trim', true); + * + * @param {String} option The name of the option you'd like to set (e.g. trim, lowercase, etc...) + * @param {*} value The value of the option you'd like to set. + * @return {void} + * @static + * @receiver SchemaType + * @function set + * @api public + */ + +SchemaType.set = function set(option, value) { + if (!this.hasOwnProperty('defaultOptions')) { + this.defaultOptions = Object.assign({}, this.defaultOptions); + } + this.defaultOptions[option] = value; +}; + +/** + * Attaches a getter for all instances of this schema type. + * + * #### Example: + * + * // Make all numbers round down + * mongoose.Number.get(function(v) { return Math.floor(v); }); + * + * @param {Function} getter + * @return {this} + * @static + * @receiver SchemaType + * @function get + * @api public + */ + +SchemaType.get = function(getter) { + this.getters = this.hasOwnProperty('getters') ? this.getters : []; + this.getters.push(getter); +}; + +/** + * Sets a default value for this SchemaType. + * + * #### Example: + * + * const schema = new Schema({ n: { type: Number, default: 10 }) + * const M = db.model('M', schema) + * const m = new M; + * console.log(m.n) // 10 + * + * Defaults can be either `functions` which return the value to use as the default or the literal value itself. Either way, the value will be cast based on its schema type before being set during document creation. + * + * #### Example: + * + * // values are cast: + * const schema = new Schema({ aNumber: { type: Number, default: 4.815162342 }}) + * const M = db.model('M', schema) + * const m = new M; + * console.log(m.aNumber) // 4.815162342 + * + * // default unique objects for Mixed types: + * const schema = new Schema({ mixed: Schema.Types.Mixed }); + * schema.path('mixed').default(function () { + * return {}; + * }); + * + * // if we don't use a function to return object literals for Mixed defaults, + * // each document will receive a reference to the same object literal creating + * // a "shared" object instance: + * const schema = new Schema({ mixed: Schema.Types.Mixed }); + * schema.path('mixed').default({}); + * const M = db.model('M', schema); + * const m1 = new M; + * m1.mixed.added = 1; + * console.log(m1.mixed); // { added: 1 } + * const m2 = new M; + * console.log(m2.mixed); // { added: 1 } + * + * @param {Function|any} val the default value + * @return {defaultValue} + * @api public + */ + +SchemaType.prototype.default = function(val) { + if (arguments.length === 1) { + if (val === void 0) { + this.defaultValue = void 0; + return void 0; + } + + if (val != null && val.instanceOfSchema) { + throw new MongooseError('Cannot set default value of path `' + this.path + + '` to a mongoose Schema instance.'); + } + + this.defaultValue = val; + return this.defaultValue; + } else if (arguments.length > 1) { + this.defaultValue = [...arguments]; + } + return this.defaultValue; +}; + +/** + * Declares the index options for this schematype. + * + * #### Example: + * + * const s = new Schema({ name: { type: String, index: true }) + * const s = new Schema({ loc: { type: [Number], index: 'hashed' }) + * const s = new Schema({ loc: { type: [Number], index: '2d', sparse: true }) + * const s = new Schema({ loc: { type: [Number], index: { type: '2dsphere', sparse: true }}) + * const s = new Schema({ date: { type: Date, index: { unique: true, expires: '1d' }}) + * s.path('my.path').index(true); + * s.path('my.date').index({ expires: 60 }); + * s.path('my.path').index({ unique: true, sparse: true }); + * + * #### Note: + * + * _Indexes are created [in the background](https://docs.mongodb.com/manual/core/index-creation/#index-creation-background) + * by default. If `background` is set to `false`, MongoDB will not execute any + * read/write operations you send until the index build. + * Specify `background: false` to override Mongoose's default._ + * + * @param {Object|Boolean|String} options + * @return {SchemaType} this + * @api public + */ + +SchemaType.prototype.index = function(options) { + this._index = options; + utils.expires(this._index); + return this; +}; + +/** + * Declares an unique index. + * + * #### Example: + * + * const s = new Schema({ name: { type: String, unique: true }}); + * s.path('name').index({ unique: true }); + * + * _NOTE: violating the constraint returns an `E11000` error from MongoDB when saving, not a Mongoose validation error._ + * + * @param {Boolean} bool + * @return {SchemaType} this + * @api public + */ + +SchemaType.prototype.unique = function(bool) { + if (this._index === false) { + if (!bool) { + return; + } + throw new Error('Path "' + this.path + '" may not have `index` set to ' + + 'false and `unique` set to true'); + } + + if (!this.options.hasOwnProperty('index') && bool === false) { + return this; + } + + if (this._index == null || this._index === true) { + this._index = {}; + } else if (typeof this._index === 'string') { + this._index = { type: this._index }; + } + + this._index.unique = bool; + return this; +}; + +/** + * Declares a full text index. + * + * ### Example: + * + * const s = new Schema({name : {type: String, text : true }) + * s.path('name').index({text : true}); + * @param {Boolean} bool + * @return {SchemaType} this + * @api public + */ + +SchemaType.prototype.text = function(bool) { + if (this._index === false) { + if (!bool) { + return; + } + throw new Error('Path "' + this.path + '" may not have `index` set to ' + + 'false and `text` set to true'); + } + + if (!this.options.hasOwnProperty('index') && bool === false) { + return this; + } + + if (this._index === null || this._index === undefined || + typeof this._index === 'boolean') { + this._index = {}; + } else if (typeof this._index === 'string') { + this._index = { type: this._index }; + } + + this._index.text = bool; + return this; +}; + +/** + * Declares a sparse index. + * + * #### Example: + * + * const s = new Schema({ name: { type: String, sparse: true } }); + * s.path('name').index({ sparse: true }); + * + * @param {Boolean} bool + * @return {SchemaType} this + * @api public + */ + +SchemaType.prototype.sparse = function(bool) { + if (this._index === false) { + if (!bool) { + return; + } + throw new Error('Path "' + this.path + '" may not have `index` set to ' + + 'false and `sparse` set to true'); + } + + if (!this.options.hasOwnProperty('index') && bool === false) { + return this; + } + + if (this._index == null || typeof this._index === 'boolean') { + this._index = {}; + } else if (typeof this._index === 'string') { + this._index = { type: this._index }; + } + + this._index.sparse = bool; + return this; +}; + +/** + * Defines this path as immutable. Mongoose prevents you from changing + * immutable paths unless the parent document has [`isNew: true`](/docs/api.html#document_Document-isNew). + * + * #### Example: + * + * const schema = new Schema({ + * name: { type: String, immutable: true }, + * age: Number + * }); + * const Model = mongoose.model('Test', schema); + * + * await Model.create({ name: 'test' }); + * const doc = await Model.findOne(); + * + * doc.isNew; // false + * doc.name = 'new name'; + * doc.name; // 'test', because `name` is immutable + * + * Mongoose also prevents changing immutable properties using `updateOne()` + * and `updateMany()` based on [strict mode](/docs/guide.html#strict). + * + * #### Example: + * + * // Mongoose will strip out the `name` update, because `name` is immutable + * Model.updateOne({}, { $set: { name: 'test2' }, $inc: { age: 1 } }); + * + * // If `strict` is set to 'throw', Mongoose will throw an error if you + * // update `name` + * const err = await Model.updateOne({}, { name: 'test2' }, { strict: 'throw' }). + * then(() => null, err => err); + * err.name; // StrictModeError + * + * // If `strict` is `false`, Mongoose allows updating `name` even though + * // the property is immutable. + * Model.updateOne({}, { name: 'test2' }, { strict: false }); + * + * @param {Boolean} bool + * @return {SchemaType} this + * @see isNew /docs/api.html#document_Document-isNew + * @api public + */ + +SchemaType.prototype.immutable = function(bool) { + this.$immutable = bool; + handleImmutable(this); + + return this; +}; + +/** + * Defines a custom function for transforming this path when converting a document to JSON. + * + * Mongoose calls this function with one parameter: the current `value` of the path. Mongoose + * then uses the return value in the JSON output. + * + * #### Example: + * + * const schema = new Schema({ + * date: { type: Date, transform: v => v.getFullYear() } + * }); + * const Model = mongoose.model('Test', schema); + * + * await Model.create({ date: new Date('2016-06-01') }); + * const doc = await Model.findOne(); + * + * doc.date instanceof Date; // true + * + * doc.toJSON().date; // 2016 as a number + * JSON.stringify(doc); // '{"_id":...,"date":2016}' + * + * @param {Function} fn + * @return {SchemaType} this + * @api public + */ + +SchemaType.prototype.transform = function(fn) { + this.options.transform = fn; + + return this; +}; + +/** + * Adds a setter to this schematype. + * + * #### Example: + * + * ```javascript + * function capitalize (val) { + * if (typeof val !== 'string') val = ''; + * return val.charAt(0).toUpperCase() + val.substring(1); + * } + * + * // defining within the schema + * const s = new Schema({ name: { type: String, set: capitalize }}); + * + * // or with the SchemaType + * const s = new Schema({ name: String }) + * s.path('name').set(capitalize); + * ``` + * + * Setters allow you to transform the data before it gets to the raw mongodb + * document or query. + * + * Suppose you are implementing user registration for a website. Users provide + * an email and password, which gets saved to mongodb. The email is a string + * that you will want to normalize to lower case, in order to avoid one email + * having more than one account -- e.g., otherwise, avenue@q.com can be registered for 2 accounts via avenue@q.com and AvEnUe@Q.CoM. + * + * You can set up email lower case normalization easily via a Mongoose setter. + * + * ```javascript + * function toLower(v) { + * return v.toLowerCase(); + * } + * + * const UserSchema = new Schema({ + * email: { type: String, set: toLower } + * }); + * + * const User = db.model('User', UserSchema); + * + * const user = new User({email: 'AVENUE@Q.COM'}); + * console.log(user.email); // 'avenue@q.com' + * + * // or + * const user = new User(); + * user.email = 'Avenue@Q.com'; + * console.log(user.email); // 'avenue@q.com' + * User.updateOne({ _id: _id }, { $set: { email: 'AVENUE@Q.COM' } }); // update to 'avenue@q.com' + * ``` + * + * As you can see above, setters allow you to transform the data before it + * stored in MongoDB, or before executing a query. + * + * _NOTE: we could have also just used the built-in `lowercase: true` SchemaType option instead of defining our own function._ + * + * ```javascript + * new Schema({ email: { type: String, lowercase: true }}) + * ``` + * + * Setters are also passed a second argument, the schematype on which the setter was defined. This allows for tailored behavior based on options passed in the schema. + * + * ```javascript + * function inspector (val, priorValue, schematype) { + * if (schematype.options.required) { + * return schematype.path + ' is required'; + * } else { + * return val; + * } + * } + * + * const VirusSchema = new Schema({ + * name: { type: String, required: true, set: inspector }, + * taxonomy: { type: String, set: inspector } + * }) + * + * const Virus = db.model('Virus', VirusSchema); + * const v = new Virus({ name: 'Parvoviridae', taxonomy: 'Parvovirinae' }); + * + * console.log(v.name); // name is required + * console.log(v.taxonomy); // Parvovirinae + * ``` + * + * You can also use setters to modify other properties on the document. If + * you're setting a property `name` on a document, the setter will run with + * `this` as the document. Be careful, in mongoose 5 setters will also run + * when querying by `name` with `this` as the query. + * + * ```javascript + * const nameSchema = new Schema({ name: String, keywords: [String] }); + * nameSchema.path('name').set(function(v) { + * // Need to check if `this` is a document, because in mongoose 5 + * // setters will also run on queries, in which case `this` will be a + * // mongoose query object. + * if (this instanceof Document && v != null) { + * this.keywords = v.split(' '); + * } + * return v; + * }); + * ``` + * + * @param {Function} fn + * @return {SchemaType} this + * @api public + */ + +SchemaType.prototype.set = function(fn) { + if (typeof fn !== 'function') { + throw new TypeError('A setter must be a function.'); + } + this.setters.push(fn); + return this; +}; + +/** + * Adds a getter to this schematype. + * + * #### Example: + * + * function dob (val) { + * if (!val) return val; + * return (val.getMonth() + 1) + "/" + val.getDate() + "/" + val.getFullYear(); + * } + * + * // defining within the schema + * const s = new Schema({ born: { type: Date, get: dob }) + * + * // or by retreiving its SchemaType + * const s = new Schema({ born: Date }) + * s.path('born').get(dob) + * + * Getters allow you to transform the representation of the data as it travels from the raw mongodb document to the value that you see. + * + * Suppose you are storing credit card numbers and you want to hide everything except the last 4 digits to the mongoose user. You can do so by defining a getter in the following way: + * + * function obfuscate (cc) { + * return '****-****-****-' + cc.slice(cc.length-4, cc.length); + * } + * + * const AccountSchema = new Schema({ + * creditCardNumber: { type: String, get: obfuscate } + * }); + * + * const Account = db.model('Account', AccountSchema); + * + * Account.findById(id, function (err, found) { + * console.log(found.creditCardNumber); // '****-****-****-1234' + * }); + * + * Getters are also passed a second argument, the schematype on which the getter was defined. This allows for tailored behavior based on options passed in the schema. + * + * function inspector (val, priorValue, schematype) { + * if (schematype.options.required) { + * return schematype.path + ' is required'; + * } else { + * return schematype.path + ' is not'; + * } + * } + * + * const VirusSchema = new Schema({ + * name: { type: String, required: true, get: inspector }, + * taxonomy: { type: String, get: inspector } + * }) + * + * const Virus = db.model('Virus', VirusSchema); + * + * Virus.findById(id, function (err, virus) { + * console.log(virus.name); // name is required + * console.log(virus.taxonomy); // taxonomy is not + * }) + * + * @param {Function} fn + * @return {SchemaType} this + * @api public + */ + +SchemaType.prototype.get = function(fn) { + if (typeof fn !== 'function') { + throw new TypeError('A getter must be a function.'); + } + this.getters.push(fn); + return this; +}; + +/** + * Adds validator(s) for this document path. + * + * Validators always receive the value to validate as their first argument and + * must return `Boolean`. Returning `false` or throwing an error means + * validation failed. + * + * The error message argument is optional. If not passed, the [default generic error message template](#error_messages_MongooseError-messages) will be used. + * + * #### Examples: + * + * // make sure every value is equal to "something" + * function validator (val) { + * return val === 'something'; + * } + * new Schema({ name: { type: String, validate: validator }}); + * + * // with a custom error message + * + * const custom = [validator, 'Uh oh, {PATH} does not equal "something".'] + * new Schema({ name: { type: String, validate: custom }}); + * + * // adding many validators at a time + * + * const many = [ + * { validator: validator, msg: 'uh oh' } + * , { validator: anotherValidator, msg: 'failed' } + * ] + * new Schema({ name: { type: String, validate: many }}); + * + * // or utilizing SchemaType methods directly: + * + * const schema = new Schema({ name: 'string' }); + * schema.path('name').validate(validator, 'validation of `{PATH}` failed with value `{VALUE}`'); + * + * #### Error message templates: + * + * From the examples above, you may have noticed that error messages support + * basic templating. There are a few other template keywords besides `{PATH}` + * and `{VALUE}` too. To find out more, details are available + * [here](#error_messages_MongooseError.messages). + * + * If Mongoose's built-in error message templating isn't enough, Mongoose + * supports setting the `message` property to a function. + * + * schema.path('name').validate({ + * validator: function(v) { return v.length > 5; }, + * // `errors['name']` will be "name must have length 5, got 'foo'" + * message: function(props) { + * return `${props.path} must have length 5, got '${props.value}'`; + * } + * }); + * + * To bypass Mongoose's error messages and just copy the error message that + * the validator throws, do this: + * + * schema.path('name').validate({ + * validator: function() { throw new Error('Oops!'); }, + * // `errors['name']` will be "Oops!" + * message: function(props) { return props.reason.message; } + * }); + * + * #### Asynchronous validation: + * + * Mongoose supports validators that return a promise. A validator that returns + * a promise is called an _async validator_. Async validators run in + * parallel, and `validate()` will wait until all async validators have settled. + * + * schema.path('name').validate({ + * validator: function (value) { + * return new Promise(function (resolve, reject) { + * resolve(false); // validation failed + * }); + * } + * }); + * + * You might use asynchronous validators to retreive other documents from the database to validate against or to meet other I/O bound validation needs. + * + * Validation occurs `pre('save')` or whenever you manually execute [document#validate](#document_Document-validate). + * + * If validation fails during `pre('save')` and no callback was passed to receive the error, an `error` event will be emitted on your Models associated db [connection](#connection_Connection), passing the validation error object along. + * + * const conn = mongoose.createConnection(..); + * conn.on('error', handleError); + * + * const Product = conn.model('Product', yourSchema); + * const dvd = new Product(..); + * dvd.save(); // emits error on the `conn` above + * + * If you want to handle these errors at the Model level, add an `error` + * listener to your Model as shown below. + * + * // registering an error listener on the Model lets us handle errors more locally + * Product.on('error', handleError); + * + * @param {RegExp|Function|Object} obj validator function, or hash describing options + * @param {Function} [obj.validator] validator function. If the validator function returns `undefined` or a truthy value, validation succeeds. If it returns [falsy](https://masteringjs.io/tutorials/fundamentals/falsy) (except `undefined`) or throws an error, validation fails. + * @param {String|Function} [obj.message] optional error message. If function, should return the error message as a string + * @param {Boolean} [obj.propsParameter=false] If true, Mongoose will pass the validator properties object (with the `validator` function, `message`, etc.) as the 2nd arg to the validator function. This is disabled by default because many validators [rely on positional args](https://github.com/chriso/validator.js#validators), so turning this on may cause unpredictable behavior in external validators. + * @param {String|Function} [errorMsg] optional error message. If function, should return the error message as a string + * @param {String} [type] optional validator type + * @return {SchemaType} this + * @api public + */ + +SchemaType.prototype.validate = function(obj, message, type) { + if (typeof obj === 'function' || obj && utils.getFunctionName(obj.constructor) === 'RegExp') { + let properties; + if (typeof message === 'function') { + properties = { validator: obj, message: message }; + properties.type = type || 'user defined'; + } else if (message instanceof Object && !type) { + properties = isSimpleValidator(message) ? Object.assign({}, message) : utils.clone(message); + if (!properties.message) { + properties.message = properties.msg; + } + properties.validator = obj; + properties.type = properties.type || 'user defined'; + } else { + if (message == null) { + message = MongooseError.messages.general.default; + } + if (!type) { + type = 'user defined'; + } + properties = { message: message, type: type, validator: obj }; + } + + this.validators.push(properties); + return this; + } + + let i; + let length; + let arg; + + for (i = 0, length = arguments.length; i < length; i++) { + arg = arguments[i]; + if (!utils.isPOJO(arg)) { + const msg = 'Invalid validator. Received (' + typeof arg + ') ' + + arg + + '. See https://mongoosejs.com/docs/api.html#schematype_SchemaType-validate'; + + throw new Error(msg); + } + this.validate(arg.validator, arg); + } + + return this; +}; + +/** + * Adds a required validator to this SchemaType. The validator gets added + * to the front of this SchemaType's validators array using `unshift()`. + * + * #### Example: + * + * const s = new Schema({ born: { type: Date, required: true }) + * + * // or with custom error message + * + * const s = new Schema({ born: { type: Date, required: '{PATH} is required!' }) + * + * // or with a function + * + * const s = new Schema({ + * userId: ObjectId, + * username: { + * type: String, + * required: function() { return this.userId != null; } + * } + * }) + * + * // or with a function and a custom message + * const s = new Schema({ + * userId: ObjectId, + * username: { + * type: String, + * required: [ + * function() { return this.userId != null; }, + * 'username is required if id is specified' + * ] + * } + * }) + * + * // or through the path API + * + * s.path('name').required(true); + * + * // with custom error messaging + * + * s.path('name').required(true, 'grrr :( '); + * + * // or make a path conditionally required based on a function + * const isOver18 = function() { return this.age >= 18; }; + * s.path('voterRegistrationId').required(isOver18); + * + * The required validator uses the SchemaType's `checkRequired` function to + * determine whether a given value satisfies the required validator. By default, + * a value satisfies the required validator if `val != null` (that is, if + * the value is not null nor undefined). However, most built-in mongoose schema + * types override the default `checkRequired` function: + * + * @param {Boolean|Function|Object} required enable/disable the validator, or function that returns required boolean, or options object + * @param {Boolean|Function} [options.isRequired] enable/disable the validator, or function that returns required boolean + * @param {Function} [options.ErrorConstructor] custom error constructor. The constructor receives 1 parameter, an object containing the validator properties. + * @param {String} [message] optional custom error message + * @return {SchemaType} this + * @see Customized Error Messages #error_messages_MongooseError-messages + * @see SchemaArray#checkRequired #schema_array_SchemaArray.checkRequired + * @see SchemaBoolean#checkRequired #schema_boolean_SchemaBoolean-checkRequired + * @see SchemaBuffer#checkRequired #schema_buffer_SchemaBuffer.schemaName + * @see SchemaNumber#checkRequired #schema_number_SchemaNumber-min + * @see SchemaObjectId#checkRequired #schema_objectid_ObjectId-auto + * @see SchemaString#checkRequired #schema_string_SchemaString-checkRequired + * @api public + */ + +SchemaType.prototype.required = function(required, message) { + let customOptions = {}; + + if (arguments.length > 0 && required == null) { + this.validators = this.validators.filter(function(v) { + return v.validator !== this.requiredValidator; + }, this); + + this.isRequired = false; + delete this.originalRequiredValue; + return this; + } + + if (typeof required === 'object') { + customOptions = required; + message = customOptions.message || message; + required = required.isRequired; + } + + if (required === false) { + this.validators = this.validators.filter(function(v) { + return v.validator !== this.requiredValidator; + }, this); + + this.isRequired = false; + delete this.originalRequiredValue; + return this; + } + + const _this = this; + this.isRequired = true; + + this.requiredValidator = function(v) { + const cachedRequired = this && this.$__ && this.$__.cachedRequired; + + // no validation when this path wasn't selected in the query. + if (cachedRequired != null && !this.$__isSelected(_this.path) && !this[documentIsModified](_this.path)) { + return true; + } + + // `$cachedRequired` gets set in `_evaluateRequiredFunctions()` so we + // don't call required functions multiple times in one validate call + // See gh-6801 + if (cachedRequired != null && _this.path in cachedRequired) { + const res = cachedRequired[_this.path] ? + _this.checkRequired(v, this) : + true; + delete cachedRequired[_this.path]; + return res; + } else if (typeof required === 'function') { + return required.apply(this) ? _this.checkRequired(v, this) : true; + } + + return _this.checkRequired(v, this); + }; + this.originalRequiredValue = required; + + if (typeof required === 'string') { + message = required; + required = undefined; + } + + const msg = message || MongooseError.messages.general.required; + this.validators.unshift(Object.assign({}, customOptions, { + validator: this.requiredValidator, + message: msg, + type: 'required' + })); + + return this; +}; + +/** + * Set the model that this path refers to. This is the option that [populate](https://mongoosejs.com/docs/populate.html) + * looks at to determine the foreign collection it should query. + * + * #### Example: + * const userSchema = new Schema({ name: String }); + * const User = mongoose.model('User', userSchema); + * + * const postSchema = new Schema({ user: mongoose.ObjectId }); + * postSchema.path('user').ref('User'); // Can set ref to a model name + * postSchema.path('user').ref(User); // Or a model class + * postSchema.path('user').ref(() => 'User'); // Or a function that returns the model name + * postSchema.path('user').ref(() => User); // Or a function that returns the model class + * + * // Or you can just declare the `ref` inline in your schema + * const postSchema2 = new Schema({ + * user: { type: mongoose.ObjectId, ref: User } + * }); + * + * @param {String|Model|Function} ref either a model name, a [Model](https://mongoosejs.com/docs/models.html), or a function that returns a model name or model. + * @return {SchemaType} this + * @api public + */ + +SchemaType.prototype.ref = function(ref) { + this.options.ref = ref; + return this; +}; + +/** + * Gets the default value + * + * @param {Object} scope the scope which callback are executed + * @param {Boolean} init + * @api private + */ + +SchemaType.prototype.getDefault = function(scope, init) { + let ret; + if (typeof this.defaultValue === 'function') { + if ( + this.defaultValue === Date.now || + this.defaultValue === Array || + this.defaultValue.name.toLowerCase() === 'objectid' + ) { + ret = this.defaultValue.call(scope); + } else { + ret = this.defaultValue.call(scope, scope); + } + } else { + ret = this.defaultValue; + } + + if (ret !== null && ret !== undefined) { + if (typeof ret === 'object' && (!this.options || !this.options.shared)) { + ret = utils.clone(ret); + } + + const casted = this.applySetters(ret, scope, init, undefined, setOptionsForDefaults); + if (casted && !Array.isArray(casted) && casted.$isSingleNested) { + casted.$__parent = scope; + } + return casted; + } + return ret; +}; + +/*! + * Applies setters without casting + * + * @api private + */ + +SchemaType.prototype._applySetters = function(value, scope, init, priorVal, options) { + let v = value; + if (init) { + return v; + } + const setters = this.setters; + + for (let i = setters.length - 1; i >= 0; i--) { + v = setters[i].call(scope, v, priorVal, this, options); + } + + return v; +}; + +/*! + * ignore + */ + +SchemaType.prototype._castNullish = function _castNullish(v) { + return v; +}; + +/** + * Applies setters + * + * @param {Object} value + * @param {Object} scope + * @param {Boolean} init + * @api private + */ + +SchemaType.prototype.applySetters = function(value, scope, init, priorVal, options) { + let v = this._applySetters(value, scope, init, priorVal, options); + if (v == null) { + return this._castNullish(v); + } + + // do not cast until all setters are applied #665 + v = this.cast(v, scope, init, priorVal, options); + + return v; +}; + +/** + * Applies getters to a value + * + * @param {Object} value + * @param {Object} scope + * @api private + */ + +SchemaType.prototype.applyGetters = function(value, scope) { + let v = value; + const getters = this.getters; + const len = getters.length; + + if (len === 0) { + return v; + } + + for (let i = 0; i < len; ++i) { + v = getters[i].call(scope, v, this); + } + + return v; +}; + +/** + * Sets default `select()` behavior for this path. + * + * Set to `true` if this path should always be included in the results, `false` if it should be excluded by default. This setting can be overridden at the query level. + * + * #### Example: + * + * T = db.model('T', new Schema({ x: { type: String, select: true }})); + * T.find(..); // field x will always be selected .. + * // .. unless overridden; + * T.find().select('-x').exec(callback); + * + * @param {Boolean} val + * @return {SchemaType} this + * @api public + */ + +SchemaType.prototype.select = function select(val) { + this.selected = !!val; + return this; +}; + +/** + * Performs a validation of `value` using the validators declared for this SchemaType. + * + * @param {any} value + * @param {Function} callback + * @param {Object} scope + * @api private + */ + +SchemaType.prototype.doValidate = function(value, fn, scope, options) { + let err = false; + const path = this.path; + + // Avoid non-object `validators` + const validators = this.validators. + filter(v => typeof v === 'object' && v !== null); + + let count = validators.length; + + if (!count) { + return fn(null); + } + + for (let i = 0, len = validators.length; i < len; ++i) { + if (err) { + break; + } + + const v = validators[i]; + const validator = v.validator; + let ok; + + const validatorProperties = isSimpleValidator(v) ? Object.assign({}, v) : utils.clone(v); + validatorProperties.path = options && options.path ? options.path : path; + validatorProperties.value = value; + + if (validator instanceof RegExp) { + validate(validator.test(value), validatorProperties); + continue; + } + + if (typeof validator !== 'function') { + continue; + } + + if (value === undefined && validator !== this.requiredValidator) { + validate(true, validatorProperties); + continue; + } + + try { + if (validatorProperties.propsParameter) { + ok = validator.call(scope, value, validatorProperties); + } else { + ok = validator.call(scope, value); + } + } catch (error) { + ok = false; + validatorProperties.reason = error; + if (error.message) { + validatorProperties.message = error.message; + } + } + + if (ok != null && typeof ok.then === 'function') { + ok.then( + function(ok) { validate(ok, validatorProperties); }, + function(error) { + validatorProperties.reason = error; + validatorProperties.message = error.message; + ok = false; + validate(ok, validatorProperties); + }); + } else { + validate(ok, validatorProperties); + } + } + + function validate(ok, validatorProperties) { + if (err) { + return; + } + if (ok === undefined || ok) { + if (--count <= 0) { + immediate(function() { + fn(null); + }); + } + } else { + const ErrorConstructor = validatorProperties.ErrorConstructor || ValidatorError; + err = new ErrorConstructor(validatorProperties); + err[validatorErrorSymbol] = true; + immediate(function() { + fn(err); + }); + } + } +}; + + +function _validate(ok, validatorProperties) { + if (ok !== undefined && !ok) { + const ErrorConstructor = validatorProperties.ErrorConstructor || ValidatorError; + const err = new ErrorConstructor(validatorProperties); + err[validatorErrorSymbol] = true; + return err; + } +} + +/** + * Performs a validation of `value` using the validators declared for this SchemaType. + * + * #### Note: + * + * This method ignores the asynchronous validators. + * + * @param {any} value + * @param {Object} scope + * @return {MongooseError|undefined} + * @api private + */ + +SchemaType.prototype.doValidateSync = function(value, scope, options) { + const path = this.path; + const count = this.validators.length; + + if (!count) { + return null; + } + + let validators = this.validators; + if (value === void 0) { + if (this.validators.length !== 0 && this.validators[0].type === 'required') { + validators = [this.validators[0]]; + } else { + return null; + } + } + + let err = null; + let i = 0; + const len = validators.length; + for (i = 0; i < len; ++i) { + + const v = validators[i]; + + if (v === null || typeof v !== 'object') { + continue; + } + + const validator = v.validator; + const validatorProperties = isSimpleValidator(v) ? Object.assign({}, v) : utils.clone(v); + validatorProperties.path = options && options.path ? options.path : path; + validatorProperties.value = value; + let ok = false; + + // Skip any explicit async validators. Validators that return a promise + // will still run, but won't trigger any errors. + if (isAsyncFunction(validator)) { + continue; + } + + if (validator instanceof RegExp) { + err = _validate(validator.test(value), validatorProperties); + continue; + } + + if (typeof validator !== 'function') { + continue; + } + + try { + if (validatorProperties.propsParameter) { + ok = validator.call(scope, value, validatorProperties); + } else { + ok = validator.call(scope, value); + } + } catch (error) { + ok = false; + validatorProperties.reason = error; + } + + // Skip any validators that return a promise, we can't handle those + // synchronously + if (ok != null && typeof ok.then === 'function') { + continue; + } + err = _validate(ok, validatorProperties); + if (err) { + break; + } + } + + return err; +}; + +/** + * Determines if value is a valid Reference. + * + * @param {SchemaType} self + * @param {Object} value + * @param {Document} doc + * @param {Boolean} init + * @return {Boolean} + * @api private + */ + +SchemaType._isRef = function(self, value, doc, init) { + // fast path + let ref = init && self.options && (self.options.ref || self.options.refPath); + + if (!ref && doc && doc.$__ != null) { + // checks for + // - this populated with adhoc model and no ref was set in schema OR + // - setting / pushing values after population + const path = doc.$__fullPath(self.path, true); + + const owner = doc.ownerDocument(); + ref = (path != null && owner.$populated(path)) || doc.$populated(self.path); + } + + if (ref) { + if (value == null) { + return true; + } + if (!Buffer.isBuffer(value) && // buffers are objects too + value._bsontype !== 'Binary' // raw binary value from the db + && utils.isObject(value) // might have deselected _id in population query + ) { + return true; + } + + return init; + } + + return false; +}; + +/*! + * ignore + */ + +SchemaType.prototype._castRef = function _castRef(value, doc, init) { + if (value == null) { + return value; + } + + if (value.$__ != null) { + value.$__.wasPopulated = value.$__.wasPopulated || true; + return value; + } + + // setting a populated path + if (Buffer.isBuffer(value) || !utils.isObject(value)) { + if (init) { + return value; + } + throw new CastError(this.instance, value, this.path, null, this); + } + + // Handle the case where user directly sets a populated + // path to a plain object; cast to the Model used in + // the population query. + const path = doc.$__fullPath(this.path, true); + const owner = doc.ownerDocument(); + const pop = owner.$populated(path, true); + let ret = value; + if (!doc.$__.populated || + !doc.$__.populated[path] || + !doc.$__.populated[path].options || + !doc.$__.populated[path].options.options || + !doc.$__.populated[path].options.options.lean) { + ret = new pop.options[populateModelSymbol](value); + ret.$__.wasPopulated = true; + } + + return ret; +}; + +/*! + * ignore + */ + +function handleSingle(val) { + return this.castForQuery(val); +} + +/*! + * ignore + */ + +function handleArray(val) { + const _this = this; + if (!Array.isArray(val)) { + return [this.castForQuery(val)]; + } + return val.map(function(m) { + return _this.castForQuery(m); + }); +} + +/*! + * Just like handleArray, except also allows `[]` because surprisingly + * `$in: [1, []]` works fine + */ + +function handle$in(val) { + const _this = this; + if (!Array.isArray(val)) { + return [this.castForQuery(val)]; + } + return val.map(function(m) { + if (Array.isArray(m) && m.length === 0) { + return m; + } + return _this.castForQuery(m); + }); +} + +/*! + * ignore + */ + +SchemaType.prototype.$conditionalHandlers = { + $all: handleArray, + $eq: handleSingle, + $in: handle$in, + $ne: handleSingle, + $nin: handle$in, + $exists: $exists, + $type: $type +}; + +/*! + * Wraps `castForQuery` to handle context + */ + +SchemaType.prototype.castForQueryWrapper = function(params) { + this.$$context = params.context; + if ('$conditional' in params) { + const ret = this.castForQuery(params.$conditional, params.val); + this.$$context = null; + return ret; + } + if (params.$skipQueryCastForUpdate || params.$applySetters) { + const ret = this._castForQuery(params.val); + this.$$context = null; + return ret; + } + + const ret = this.castForQuery(params.val); + this.$$context = null; + return ret; +}; + +/** + * Cast the given value with the given optional query operator. + * + * @param {String} [$conditional] query operator, like `$eq` or `$in` + * @param {any} val + * @api private + */ + +SchemaType.prototype.castForQuery = function($conditional, val) { + let handler; + if (arguments.length === 2) { + handler = this.$conditionalHandlers[$conditional]; + if (!handler) { + throw new Error('Can\'t use ' + $conditional); + } + return handler.call(this, val); + } + val = $conditional; + return this._castForQuery(val); +}; + +/*! + * Internal switch for runSetters + * + * @api private + */ + +SchemaType.prototype._castForQuery = function(val) { + return this.applySetters(val, this.$$context); +}; + +/** + * Override the function the required validator uses to check whether a value + * passes the `required` check. Override this on the individual SchemaType. + * + * #### Example: + * + * // Use this to allow empty strings to pass the `required` validator + * mongoose.Schema.Types.String.checkRequired(v => typeof v === 'string'); + * + * @param {Function} fn + * @return {Function} + * @static + * @receiver SchemaType + * @function checkRequired + * @api public + */ + +SchemaType.checkRequired = function(fn) { + if (arguments.length !== 0) { + this._checkRequired = fn; + } + + return this._checkRequired; +}; + +/** + * Default check for if this path satisfies the `required` validator. + * + * @param {any} val + * @api private + */ + +SchemaType.prototype.checkRequired = function(val) { + return val != null; +}; + +/*! + * ignore + */ + +SchemaType.prototype.clone = function() { + const options = Object.assign({}, this.options); + const schematype = new this.constructor(this.path, options, this.instance); + schematype.validators = this.validators.slice(); + if (this.requiredValidator !== undefined) schematype.requiredValidator = this.requiredValidator; + if (this.defaultValue !== undefined) schematype.defaultValue = this.defaultValue; + if (this.$immutable !== undefined && this.options.immutable === undefined) { + schematype.$immutable = this.$immutable; + + handleImmutable(schematype); + } + if (this._index !== undefined) schematype._index = this._index; + if (this.selected !== undefined) schematype.selected = this.selected; + if (this.isRequired !== undefined) schematype.isRequired = this.isRequired; + if (this.originalRequiredValue !== undefined) schematype.originalRequiredValue = this.originalRequiredValue; + schematype.getters = this.getters.slice(); + schematype.setters = this.setters.slice(); + return schematype; +}; + +/*! + * Module exports. + */ + +module.exports = exports = SchemaType; + +exports.CastError = CastError; + +exports.ValidatorError = ValidatorError; diff --git a/node_modules/mongoose/lib/statemachine.js b/node_modules/mongoose/lib/statemachine.js new file mode 100644 index 000000000..43da62812 --- /dev/null +++ b/node_modules/mongoose/lib/statemachine.js @@ -0,0 +1,192 @@ + +/*! + * Module dependencies. + */ + +'use strict'; + +const utils = require('./utils'); // eslint-disable-line no-unused-vars + +/*! + * StateMachine represents a minimal `interface` for the + * constructors it builds via StateMachine.ctor(...). + * + * @api private + */ + +const StateMachine = module.exports = exports = function StateMachine() { +}; + +/*! + * StateMachine.ctor('state1', 'state2', ...) + * A factory method for subclassing StateMachine. + * The arguments are a list of states. For each state, + * the constructor's prototype gets state transition + * methods named after each state. These transition methods + * place their path argument into the given state. + * + * @param {String} state + * @param {String} [state] + * @return {Function} subclass constructor + * @private + */ + +StateMachine.ctor = function() { + const states = [...arguments]; + + const ctor = function() { + StateMachine.apply(this, arguments); + this.paths = {}; + this.states = {}; + this.stateNames = states; + + let i = states.length, + state; + + while (i--) { + state = states[i]; + this.states[state] = {}; + } + }; + + ctor.prototype = new StateMachine(); + + states.forEach(function(state) { + // Changes the `path`'s state to `state`. + ctor.prototype[state] = function(path) { + this._changeState(path, state); + }; + }); + + return ctor; +}; + +/*! + * This function is wrapped by the state change functions: + * + * - `require(path)` + * - `modify(path)` + * - `init(path)` + * + * @api private + */ + +StateMachine.prototype._changeState = function _changeState(path, nextState) { + const prevBucket = this.states[this.paths[path]]; + if (prevBucket) delete prevBucket[path]; + + this.paths[path] = nextState; + this.states[nextState][path] = true; +}; + +/*! + * ignore + */ + +StateMachine.prototype.clear = function clear(state) { + const keys = Object.keys(this.states[state]); + let i = keys.length; + let path; + + while (i--) { + path = keys[i]; + delete this.states[state][path]; + delete this.paths[path]; + } +}; + +/*! + * ignore + */ + +StateMachine.prototype.clearPath = function clearPath(path) { + const state = this.paths[path]; + if (!state) { + return; + } + delete this.paths[path]; + delete this.states[state][path]; +}; + +/*! + * Checks to see if at least one path is in the states passed in via `arguments` + * e.g., this.some('required', 'inited') + * + * @param {String} state that we want to check for. + * @private + */ + +StateMachine.prototype.some = function some() { + const _this = this; + const what = arguments.length ? arguments : this.stateNames; + return Array.prototype.some.call(what, function(state) { + return Object.keys(_this.states[state]).length; + }); +}; + +/*! + * This function builds the functions that get assigned to `forEach` and `map`, + * since both of those methods share a lot of the same logic. + * + * @param {String} iterMethod is either 'forEach' or 'map' + * @return {Function} + * @api private + */ + +StateMachine.prototype._iter = function _iter(iterMethod) { + return function() { + let states = [...arguments]; + const callback = states.pop(); + + if (!states.length) states = this.stateNames; + + const _this = this; + + const paths = states.reduce(function(paths, state) { + return paths.concat(Object.keys(_this.states[state])); + }, []); + + return paths[iterMethod](function(path, i, paths) { + return callback(path, i, paths); + }); + }; +}; + +/*! + * Iterates over the paths that belong to one of the parameter states. + * + * The function profile can look like: + * this.forEach(state1, fn); // iterates over all paths in state1 + * this.forEach(state1, state2, fn); // iterates over all paths in state1 or state2 + * this.forEach(fn); // iterates over all paths in all states + * + * @param {String} [state] + * @param {String} [state] + * @param {Function} callback + * @private + */ + +StateMachine.prototype.forEach = function forEach() { + this.forEach = this._iter('forEach'); + return this.forEach.apply(this, arguments); +}; + +/*! + * Maps over the paths that belong to one of the parameter states. + * + * The function profile can look like: + * this.forEach(state1, fn); // iterates over all paths in state1 + * this.forEach(state1, state2, fn); // iterates over all paths in state1 or state2 + * this.forEach(fn); // iterates over all paths in all states + * + * @param {String} [state] + * @param {String} [state] + * @param {Function} callback + * @return {Array} + * @private + */ + +StateMachine.prototype.map = function map() { + this.map = this._iter('map'); + return this.map.apply(this, arguments); +}; diff --git a/node_modules/mongoose/lib/types/ArraySubdocument.js b/node_modules/mongoose/lib/types/ArraySubdocument.js new file mode 100644 index 000000000..b5118c9c9 --- /dev/null +++ b/node_modules/mongoose/lib/types/ArraySubdocument.js @@ -0,0 +1,179 @@ +/*! + * Module dependencies. + */ + +'use strict'; + +const EventEmitter = require('events').EventEmitter; +const Subdocument = require('./subdocument'); +const utils = require('../utils'); + +const documentArrayParent = require('../helpers/symbols').documentArrayParent; + +/*! + * A constructor. + * + * @param {Object} obj js object returned from the db + * @param {MongooseDocumentArray} parentArr the parent array of this document + * @param {Boolean} skipId + * @inherits Document + * @api private + */ + +function ArraySubdocument(obj, parentArr, skipId, fields, index) { + if (utils.isMongooseDocumentArray(parentArr)) { + this.__parentArray = parentArr; + this[documentArrayParent] = parentArr.$parent(); + } else { + this.__parentArray = undefined; + this[documentArrayParent] = undefined; + } + this.$setIndex(index); + this.$__parent = this[documentArrayParent]; + + Subdocument.call(this, obj, fields, this[documentArrayParent], skipId, { isNew: true }); +} + +/*! + * Inherit from Subdocument + */ +ArraySubdocument.prototype = Object.create(Subdocument.prototype); +ArraySubdocument.prototype.constructor = ArraySubdocument; + +Object.defineProperty(ArraySubdocument.prototype, '$isSingleNested', { + configurable: false, + writable: false, + value: false +}); + +Object.defineProperty(ArraySubdocument.prototype, '$isDocumentArrayElement', { + configurable: false, + writable: false, + value: true +}); + +for (const i in EventEmitter.prototype) { + ArraySubdocument[i] = EventEmitter.prototype[i]; +} + +/*! + * ignore + */ + +ArraySubdocument.prototype.$setIndex = function(index) { + this.__index = index; + + if (this.$__ != null && this.$__.validationError != null) { + const keys = Object.keys(this.$__.validationError.errors); + for (const key of keys) { + this.invalidate(key, this.$__.validationError.errors[key]); + } + } +}; + +/*! + * ignore + */ + +ArraySubdocument.prototype.populate = function() { + throw new Error('Mongoose does not support calling populate() on nested ' + + 'docs. Instead of `doc.arr[0].populate("path")`, use ' + + '`doc.populate("arr.0.path")`'); +}; + +/*! + * ignore + */ + +ArraySubdocument.prototype.$__removeFromParent = function() { + const _id = this._doc._id; + if (!_id) { + throw new Error('For your own good, Mongoose does not know ' + + 'how to remove an ArraySubdocument that has no _id'); + } + this.__parentArray.pull({ _id: _id }); +}; + +/** + * Returns the full path to this document. If optional `path` is passed, it is appended to the full path. + * + * @param {String} [path] + * @param {Boolean} [skipIndex] Skip adding the array index. For example `arr.foo` instead of `arr.0.foo`. + * @return {String} + * @api private + * @method $__fullPath + * @memberOf ArraySubdocument + * @instance + */ + +ArraySubdocument.prototype.$__fullPath = function(path, skipIndex) { + if (this.__index == null) { + return null; + } + if (!this.$__.fullPath) { + this.ownerDocument(); + } + + if (skipIndex) { + return path ? + this.$__.fullPath + '.' + path : + this.$__.fullPath; + } + + return path ? + this.$__.fullPath + '.' + this.__index + '.' + path : + this.$__.fullPath + '.' + this.__index; +}; + +/*! + * Given a path relative to this document, return the path relative + * to the top-level document. + */ + +ArraySubdocument.prototype.$__pathRelativeToParent = function(path, skipIndex) { + if (this.__index == null) { + return null; + } + if (skipIndex) { + return path == null ? this.__parentArray.$path() : this.__parentArray.$path() + '.' + path; + } + if (path == null) { + return this.__parentArray.$path() + '.' + this.__index; + } + return this.__parentArray.$path() + '.' + this.__index + '.' + path; +}; + +/*! + * Returns this sub-documents parent document. + */ + +ArraySubdocument.prototype.$parent = function() { + return this[documentArrayParent]; +}; + +/** + * Returns this subdocument's parent array. + * + * #### Example: + * + * const Test = mongoose.model('Test', new Schema({ + * docArr: [{ name: String }] + * })); + * const doc = new Test({ docArr: [{ name: 'test subdoc' }] }); + * + * doc.docArr[0].parentArray() === doc.docArr; // true + * + * @api public + * @method parentArray + * @returns DocumentArray + */ + +ArraySubdocument.prototype.parentArray = function() { + return this.__parentArray; +}; + +/*! + * Module exports. + */ + +module.exports = ArraySubdocument; diff --git a/node_modules/mongoose/lib/types/DocumentArray/index.js b/node_modules/mongoose/lib/types/DocumentArray/index.js new file mode 100644 index 000000000..4730a311a --- /dev/null +++ b/node_modules/mongoose/lib/types/DocumentArray/index.js @@ -0,0 +1,113 @@ +'use strict'; + +/*! + * Module dependencies. + */ + +const ArrayMethods = require('../array/methods'); +const DocumentArrayMethods = require('./methods'); +const Document = require('../../document'); + +const arrayAtomicsSymbol = require('../../helpers/symbols').arrayAtomicsSymbol; +const arrayAtomicsBackupSymbol = require('../../helpers/symbols').arrayAtomicsBackupSymbol; +const arrayParentSymbol = require('../../helpers/symbols').arrayParentSymbol; +const arrayPathSymbol = require('../../helpers/symbols').arrayPathSymbol; +const arraySchemaSymbol = require('../../helpers/symbols').arraySchemaSymbol; + +const _basePush = Array.prototype.push; +const numberRE = /^\d+$/; +/** + * DocumentArray constructor + * + * @param {Array} values + * @param {String} path the path to this array + * @param {Document} doc parent document + * @api private + * @return {MongooseDocumentArray} + * @inherits MongooseArray + * @see https://bit.ly/f6CnZU + */ + +function MongooseDocumentArray(values, path, doc) { + const __array = []; + + const internals = { + [arrayAtomicsSymbol]: {}, + [arrayAtomicsBackupSymbol]: void 0, + [arrayPathSymbol]: path, + [arraySchemaSymbol]: void 0, + [arrayParentSymbol]: void 0 + }; + + if (Array.isArray(values)) { + if (values[arrayPathSymbol] === path && + values[arrayParentSymbol] === doc) { + internals[arrayAtomicsSymbol] = Object.assign({}, values[arrayAtomicsSymbol]); + } + values.forEach(v => { + _basePush.call(__array, v); + }); + } + internals[arrayPathSymbol] = path; + internals.__array = __array; + + // Because doc comes from the context of another function, doc === global + // can happen if there was a null somewhere up the chain (see #3020 && #3034) + // RB Jun 17, 2015 updated to check for presence of expected paths instead + // to make more proof against unusual node environments + if (doc && doc instanceof Document) { + internals[arrayParentSymbol] = doc; + internals[arraySchemaSymbol] = doc.schema.path(path); + + // `schema.path()` doesn't drill into nested arrays properly yet, see + // gh-6398, gh-6602. This is a workaround because nested arrays are + // always plain non-document arrays, so once you get to a document array + // nesting is done. Matryoshka code. + while (internals[arraySchemaSymbol] != null && + internals[arraySchemaSymbol].$isMongooseArray && + !internals[arraySchemaSymbol].$isMongooseDocumentArray) { + internals[arraySchemaSymbol] = internals[arraySchemaSymbol].casterConstructor; + } + } + + const proxy = new Proxy(__array, { + get: function(target, prop) { + if (prop === 'isMongooseArray' || + prop === 'isMongooseArrayProxy' || + prop === 'isMongooseDocumentArray' || + prop === 'isMongooseDocumentArrayProxy') { + return true; + } + if (internals.hasOwnProperty(prop)) { + return internals[prop]; + } + if (DocumentArrayMethods.hasOwnProperty(prop)) { + return DocumentArrayMethods[prop]; + } + if (ArrayMethods.hasOwnProperty(prop)) { + return ArrayMethods[prop]; + } + + return __array[prop]; + }, + set: function(target, prop, value) { + if (typeof prop === 'string' && numberRE.test(prop)) { + DocumentArrayMethods.set.call(proxy, prop, value, false); + } else if (internals.hasOwnProperty(prop)) { + internals[prop] = value; + } else { + __array[prop] = value; + } + + return true; + } + }); + + return proxy; +} + +/*! + * Module exports. + */ + +module.exports = MongooseDocumentArray; diff --git a/node_modules/mongoose/lib/types/DocumentArray/isMongooseDocumentArray.js b/node_modules/mongoose/lib/types/DocumentArray/isMongooseDocumentArray.js new file mode 100644 index 000000000..6e6a16907 --- /dev/null +++ b/node_modules/mongoose/lib/types/DocumentArray/isMongooseDocumentArray.js @@ -0,0 +1,5 @@ +'use strict'; + +exports.isMongooseDocumentArray = function(mongooseDocumentArray) { + return Array.isArray(mongooseDocumentArray) && mongooseDocumentArray.isMongooseDocumentArray; +}; diff --git a/node_modules/mongoose/lib/types/DocumentArray/methods/index.js b/node_modules/mongoose/lib/types/DocumentArray/methods/index.js new file mode 100644 index 000000000..3a6a7c55d --- /dev/null +++ b/node_modules/mongoose/lib/types/DocumentArray/methods/index.js @@ -0,0 +1,379 @@ +'use strict'; + +const ArrayMethods = require('../../array/methods'); +const Document = require('../../../document'); +const castObjectId = require('../../../cast/objectid'); +const getDiscriminatorByValue = require('../../../helpers/discriminator/getDiscriminatorByValue'); +const internalToObjectOptions = require('../../../options').internalToObjectOptions; +const utils = require('../../../utils'); +const isBsonType = require('../../../helpers/isBsonType'); + +const arrayParentSymbol = require('../../../helpers/symbols').arrayParentSymbol; +const arrayPathSymbol = require('../../../helpers/symbols').arrayPathSymbol; +const arraySchemaSymbol = require('../../../helpers/symbols').arraySchemaSymbol; +const documentArrayParent = require('../../../helpers/symbols').documentArrayParent; + +const methods = { + /*! + * ignore + */ + + toBSON() { + return this.toObject(internalToObjectOptions); + }, + + /*! + * ignore + */ + + getArrayParent() { + return this[arrayParentSymbol]; + }, + + /** + * Overrides MongooseArray#cast + * + * @method _cast + * @api private + * @receiver MongooseDocumentArray + */ + + _cast(value, index) { + if (this[arraySchemaSymbol] == null) { + return value; + } + let Constructor = this[arraySchemaSymbol].casterConstructor; + const isInstance = Constructor.$isMongooseDocumentArray ? + utils.isMongooseDocumentArray(value) : + value instanceof Constructor; + if (isInstance || + // Hack re: #5001, see #5005 + (value && value.constructor && value.constructor.baseCasterConstructor === Constructor)) { + if (!(value[documentArrayParent] && value.__parentArray)) { + // value may have been created using array.create() + value[documentArrayParent] = this[arrayParentSymbol]; + value.__parentArray = this; + } + value.$setIndex(index); + return value; + } + + if (value === undefined || value === null) { + return null; + } + + // handle cast('string') or cast(ObjectId) etc. + // only objects are permitted so we can safely assume that + // non-objects are to be interpreted as _id + if (Buffer.isBuffer(value) || + isBsonType(value, 'ObjectID') || !utils.isObject(value)) { + value = { _id: value }; + } + + if (value && + Constructor.discriminators && + Constructor.schema && + Constructor.schema.options && + Constructor.schema.options.discriminatorKey) { + if (typeof value[Constructor.schema.options.discriminatorKey] === 'string' && + Constructor.discriminators[value[Constructor.schema.options.discriminatorKey]]) { + Constructor = Constructor.discriminators[value[Constructor.schema.options.discriminatorKey]]; + } else { + const constructorByValue = getDiscriminatorByValue(Constructor.discriminators, value[Constructor.schema.options.discriminatorKey]); + if (constructorByValue) { + Constructor = constructorByValue; + } + } + } + + if (Constructor.$isMongooseDocumentArray) { + return Constructor.cast(value, this, undefined, undefined, index); + } + const ret = new Constructor(value, this, undefined, undefined, index); + ret.isNew = true; + return ret; + }, + + /** + * Searches array items for the first document with a matching _id. + * + * #### Example: + * + * const embeddedDoc = m.array.id(some_id); + * + * @return {EmbeddedDocument|null} the subdocument or null if not found. + * @param {ObjectId|String|Number|Buffer} id + * @TODO cast to the _id based on schema for proper comparison + * @method id + * @api public + * @memberOf MongooseDocumentArray + */ + + id(id) { + let casted; + let sid; + let _id; + + try { + casted = castObjectId(id).toString(); + } catch (e) { + casted = null; + } + + for (const val of this) { + if (!val) { + continue; + } + + _id = val.get('_id'); + + if (_id === null || typeof _id === 'undefined') { + continue; + } else if (_id instanceof Document) { + sid || (sid = String(id)); + if (sid == _id._id) { + return val; + } + } else if (!isBsonType(id, 'ObjectID') && !isBsonType(_id, 'ObjectID')) { + if (id == _id || utils.deepEqual(id, _id)) { + return val; + } + } else if (casted == _id) { + return val; + } + } + + return null; + }, + + /** + * Returns a native js Array of plain js objects + * + * #### Note: + * + * _Each sub-document is converted to a plain object by calling its `#toObject` method._ + * + * @param {Object} [options] optional options to pass to each documents `toObject` method call during conversion + * @return {Array} + * @method toObject + * @api public + * @memberOf MongooseDocumentArray + */ + + toObject(options) { + // `[].concat` coerces the return value into a vanilla JS array, rather + // than a Mongoose array. + return [].concat(this.map(function(doc) { + if (doc == null) { + return null; + } + if (typeof doc.toObject !== 'function') { + return doc; + } + return doc.toObject(options); + })); + }, + + $toObject() { + return this.constructor.prototype.toObject.apply(this, arguments); + }, + + /** + * Wraps [`Array#push`](https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/push) with proper change tracking. + * + * @param {Object} [args...] + * @api public + * @method push + * @memberOf MongooseDocumentArray + */ + + push() { + const ret = ArrayMethods.push.apply(this, arguments); + + _updateParentPopulated(this); + + return ret; + }, + + /** + * Pulls items from the array atomically. + * + * @param {Object} [args...] + * @api public + * @method pull + * @memberOf MongooseDocumentArray + */ + + pull() { + const ret = ArrayMethods.pull.apply(this, arguments); + + _updateParentPopulated(this); + + return ret; + }, + + /*! + * Wraps [`Array#shift`](https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/unshift) with proper change tracking. + */ + + shift() { + const ret = ArrayMethods.shift.apply(this, arguments); + + _updateParentPopulated(this); + + return ret; + }, + + /*! + * Wraps [`Array#splice`](https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/splice) with proper change tracking and casting. + */ + + splice() { + const ret = ArrayMethods.splice.apply(this, arguments); + + _updateParentPopulated(this); + + return ret; + }, + + /** + * Helper for console.log + * + * @method inspect + * @api public + * @memberOf MongooseDocumentArray + */ + + inspect() { + return this.toObject(); + }, + + /** + * Creates a subdocument casted to this schema. + * + * This is the same subdocument constructor used for casting. + * + * @param {Object} obj the value to cast to this arrays SubDocument schema + * @method create + * @api public + * @memberOf MongooseDocumentArray + */ + + create(obj) { + let Constructor = this[arraySchemaSymbol].casterConstructor; + if (obj && + Constructor.discriminators && + Constructor.schema && + Constructor.schema.options && + Constructor.schema.options.discriminatorKey) { + if (typeof obj[Constructor.schema.options.discriminatorKey] === 'string' && + Constructor.discriminators[obj[Constructor.schema.options.discriminatorKey]]) { + Constructor = Constructor.discriminators[obj[Constructor.schema.options.discriminatorKey]]; + } else { + const constructorByValue = getDiscriminatorByValue(Constructor.discriminators, obj[Constructor.schema.options.discriminatorKey]); + if (constructorByValue) { + Constructor = constructorByValue; + } + } + } + + return new Constructor(obj, this); + }, + + /*! + * ignore + */ + + notify(event) { + const _this = this; + return function notify(val, _arr) { + _arr = _arr || _this; + let i = _arr.length; + while (i--) { + if (_arr[i] == null) { + continue; + } + switch (event) { + // only swap for save event for now, we may change this to all event types later + case 'save': + val = _this[i]; + break; + default: + // NO-OP + break; + } + + if (utils.isMongooseArray(_arr[i])) { + notify(val, _arr[i]); + } else if (_arr[i]) { + _arr[i].emit(event, val); + } + } + }; + }, + + set(i, val, skipModified) { + const arr = this.__array; + if (skipModified) { + arr[i] = val; + return this; + } + const value = methods._cast.call(this, val, i); + methods._markModified.call(this, i); + arr[i] = value; + return this; + }, + + _markModified(elem, embeddedPath) { + const parent = this[arrayParentSymbol]; + let dirtyPath; + + if (parent) { + dirtyPath = this[arrayPathSymbol]; + + if (arguments.length) { + if (embeddedPath != null) { + // an embedded doc bubbled up the change + const index = elem.__index; + dirtyPath = dirtyPath + '.' + index + '.' + embeddedPath; + } else { + // directly set an index + dirtyPath = dirtyPath + '.' + elem; + } + } + + if (dirtyPath != null && dirtyPath.endsWith('.$')) { + return this; + } + + parent.markModified(dirtyPath, arguments.length !== 0 ? elem : parent); + } + + return this; + } +}; + +module.exports = methods; + +/*! + * If this is a document array, each element may contain single + * populated paths, so we need to modify the top-level document's + * populated cache. See gh-8247, gh-8265. + */ + +function _updateParentPopulated(arr) { + const parent = arr[arrayParentSymbol]; + if (!parent || parent.$__.populated == null) return; + + const populatedPaths = Object.keys(parent.$__.populated). + filter(p => p.startsWith(arr[arrayPathSymbol] + '.')); + + for (const path of populatedPaths) { + const remnant = path.slice((arr[arrayPathSymbol] + '.').length); + if (!Array.isArray(parent.$__.populated[path].value)) { + continue; + } + + parent.$__.populated[path].value = arr.map(val => val.$populated(remnant)); + } +} \ No newline at end of file diff --git a/node_modules/mongoose/lib/types/array/index.js b/node_modules/mongoose/lib/types/array/index.js new file mode 100644 index 000000000..74a03fab4 --- /dev/null +++ b/node_modules/mongoose/lib/types/array/index.js @@ -0,0 +1,116 @@ +/*! + * Module dependencies. + */ + +'use strict'; + +const Document = require('../../document'); +const mongooseArrayMethods = require('./methods'); + +const arrayAtomicsSymbol = require('../../helpers/symbols').arrayAtomicsSymbol; +const arrayAtomicsBackupSymbol = require('../../helpers/symbols').arrayAtomicsBackupSymbol; +const arrayParentSymbol = require('../../helpers/symbols').arrayParentSymbol; +const arrayPathSymbol = require('../../helpers/symbols').arrayPathSymbol; +const arraySchemaSymbol = require('../../helpers/symbols').arraySchemaSymbol; + +/** + * Mongoose Array constructor. + * + * #### Note: + * + * _Values always have to be passed to the constructor to initialize, otherwise `MongooseArray#push` will mark the array as modified._ + * + * @param {Array} values + * @param {String} path + * @param {Document} doc parent document + * @api private + * @inherits Array + * @see https://bit.ly/f6CnZU + */ +const _basePush = Array.prototype.push; +const numberRE = /^\d+$/; + +function MongooseArray(values, path, doc, schematype) { + let __array; + + if (Array.isArray(values)) { + const len = values.length; + + // Perf optimizations for small arrays: much faster to use `...` than `for` + `push`, + // but large arrays may cause stack overflows. And for arrays of length 0/1, just + // modifying the array is faster. Seems small, but adds up when you have a document + // with thousands of nested arrays. + if (len === 0) { + __array = new Array(); + } else if (len === 1) { + __array = new Array(1); + __array[0] = values[0]; + } else if (len < 10000) { + __array = new Array(); + _basePush.apply(__array, values); + } else { + __array = new Array(); + for (let i = 0; i < len; ++i) { + _basePush.call(__array, values[i]); + } + } + } else { + __array = []; + } + + const internals = { + [arrayAtomicsSymbol]: {}, + [arrayAtomicsBackupSymbol]: void 0, + [arrayPathSymbol]: path, + [arraySchemaSymbol]: schematype, + [arrayParentSymbol]: void 0, + isMongooseArray: true, + isMongooseArrayProxy: true, + __array: __array + }; + + if (values && values[arrayAtomicsSymbol] != null) { + internals[arrayAtomicsSymbol] = values[arrayAtomicsSymbol]; + } + + // Because doc comes from the context of another function, doc === global + // can happen if there was a null somewhere up the chain (see #3020) + // RB Jun 17, 2015 updated to check for presence of expected paths instead + // to make more proof against unusual node environments + if (doc != null && doc instanceof Document) { + internals[arrayParentSymbol] = doc; + internals[arraySchemaSymbol] = schematype || doc.schema.path(path); + } + + const proxy = new Proxy(__array, { + get: function(target, prop) { + if (internals.hasOwnProperty(prop)) { + return internals[prop]; + } + if (mongooseArrayMethods.hasOwnProperty(prop)) { + return mongooseArrayMethods[prop]; + } + + return __array[prop]; + }, + set: function(target, prop, value) { + if (typeof prop === 'string' && numberRE.test(prop)) { + mongooseArrayMethods.set.call(proxy, prop, value, false); + } else if (internals.hasOwnProperty(prop)) { + internals[prop] = value; + } else { + __array[prop] = value; + } + + return true; + } + }); + + return proxy; +} + +/*! + * Module exports. + */ + +module.exports = exports = MongooseArray; diff --git a/node_modules/mongoose/lib/types/array/isMongooseArray.js b/node_modules/mongoose/lib/types/array/isMongooseArray.js new file mode 100644 index 000000000..89326136b --- /dev/null +++ b/node_modules/mongoose/lib/types/array/isMongooseArray.js @@ -0,0 +1,5 @@ +'use strict'; + +exports.isMongooseArray = function(mongooseArray) { + return Array.isArray(mongooseArray) && mongooseArray.isMongooseArray; +}; diff --git a/node_modules/mongoose/lib/types/array/methods/index.js b/node_modules/mongoose/lib/types/array/methods/index.js new file mode 100644 index 000000000..9de796d8a --- /dev/null +++ b/node_modules/mongoose/lib/types/array/methods/index.js @@ -0,0 +1,960 @@ +'use strict'; + +const Document = require('../../../document'); +const ArraySubdocument = require('../../ArraySubdocument'); +const MongooseError = require('../../../error/mongooseError'); +const cleanModifiedSubpaths = require('../../../helpers/document/cleanModifiedSubpaths'); +const internalToObjectOptions = require('../../../options').internalToObjectOptions; +const utils = require('../../../utils'); +const isBsonType = require('../../../helpers/isBsonType'); + +const arrayAtomicsSymbol = require('../../../helpers/symbols').arrayAtomicsSymbol; +const arrayParentSymbol = require('../../../helpers/symbols').arrayParentSymbol; +const arrayPathSymbol = require('../../../helpers/symbols').arrayPathSymbol; +const arraySchemaSymbol = require('../../../helpers/symbols').arraySchemaSymbol; +const populateModelSymbol = require('../../../helpers/symbols').populateModelSymbol; +const slicedSymbol = Symbol('mongoose#Array#sliced'); + +const _basePush = Array.prototype.push; + +/*! + * ignore + */ + +const methods = { + /** + * Depopulates stored atomic operation values as necessary for direct insertion to MongoDB. + * + * If no atomics exist, we return all array values after conversion. + * + * @return {Array} + * @method $__getAtomics + * @memberOf MongooseArray + * @instance + * @api private + */ + + $__getAtomics() { + const ret = []; + const keys = Object.keys(this[arrayAtomicsSymbol] || {}); + let i = keys.length; + + const opts = Object.assign({}, internalToObjectOptions, { _isNested: true }); + + if (i === 0) { + ret[0] = ['$set', this.toObject(opts)]; + return ret; + } + + while (i--) { + const op = keys[i]; + let val = this[arrayAtomicsSymbol][op]; + + // the atomic values which are arrays are not MongooseArrays. we + // need to convert their elements as if they were MongooseArrays + // to handle populated arrays versus DocumentArrays properly. + if (utils.isMongooseObject(val)) { + val = val.toObject(opts); + } else if (Array.isArray(val)) { + val = this.toObject.call(val, opts); + } else if (val != null && Array.isArray(val.$each)) { + val.$each = this.toObject.call(val.$each, opts); + } else if (val != null && typeof val.valueOf === 'function') { + val = val.valueOf(); + } + + if (op === '$addToSet') { + val = { $each: val }; + } + + ret.push([op, val]); + } + + return ret; + }, + + /*! + * ignore + */ + + $atomics() { + return this[arrayAtomicsSymbol]; + }, + + /*! + * ignore + */ + + $parent() { + return this[arrayParentSymbol]; + }, + + /*! + * ignore + */ + + $path() { + return this[arrayPathSymbol]; + }, + + /** + * Atomically shifts the array at most one time per document `save()`. + * + * #### Note: + * + * _Calling this multiple times on an array before saving sends the same command as calling it once._ + * _This update is implemented using the MongoDB [$pop](https://www.mongodb.org/display/DOCS/Updating/#Updating-%24pop) method which enforces this restriction._ + * + * doc.array = [1,2,3]; + * + * const shifted = doc.array.$shift(); + * console.log(shifted); // 1 + * console.log(doc.array); // [2,3] + * + * // no affect + * shifted = doc.array.$shift(); + * console.log(doc.array); // [2,3] + * + * doc.save(function (err) { + * if (err) return handleError(err); + * + * // we saved, now $shift works again + * shifted = doc.array.$shift(); + * console.log(shifted ); // 2 + * console.log(doc.array); // [3] + * }) + * + * @api public + * @memberOf MongooseArray + * @instance + * @method $shift + * @see mongodb https://www.mongodb.org/display/DOCS/Updating/#Updating-%24pop + */ + + $shift() { + this._registerAtomic('$pop', -1); + this._markModified(); + + // only allow shifting once + if (this._shifted) { + return; + } + this._shifted = true; + + return [].shift.call(this); + }, + + /** + * Pops the array atomically at most one time per document `save()`. + * + * #### NOTE: + * + * _Calling this multiple times on an array before saving sends the same command as calling it once._ + * _This update is implemented using the MongoDB [$pop](https://www.mongodb.org/display/DOCS/Updating/#Updating-%24pop) method which enforces this restriction._ + * + * doc.array = [1,2,3]; + * + * const popped = doc.array.$pop(); + * console.log(popped); // 3 + * console.log(doc.array); // [1,2] + * + * // no affect + * popped = doc.array.$pop(); + * console.log(doc.array); // [1,2] + * + * doc.save(function (err) { + * if (err) return handleError(err); + * + * // we saved, now $pop works again + * popped = doc.array.$pop(); + * console.log(popped); // 2 + * console.log(doc.array); // [1] + * }) + * + * @api public + * @method $pop + * @memberOf MongooseArray + * @instance + * @see mongodb https://www.mongodb.org/display/DOCS/Updating/#Updating-%24pop + * @method $pop + * @memberOf MongooseArray + */ + + $pop() { + this._registerAtomic('$pop', 1); + this._markModified(); + + // only allow popping once + if (this._popped) { + return; + } + this._popped = true; + + return [].pop.call(this); + }, + + /*! + * ignore + */ + + $schema() { + return this[arraySchemaSymbol]; + }, + + /** + * Casts a member based on this arrays schema. + * + * @param {any} value + * @return value the casted value + * @method _cast + * @api private + * @memberOf MongooseArray + */ + + _cast(value) { + let populated = false; + let Model; + + const parent = this[arrayParentSymbol]; + if (parent) { + populated = parent.$populated(this[arrayPathSymbol], true); + } + + if (populated && value !== null && value !== undefined) { + // cast to the populated Models schema + Model = populated.options[populateModelSymbol]; + + // only objects are permitted so we can safely assume that + // non-objects are to be interpreted as _id + if (Buffer.isBuffer(value) || + isBsonType(value, 'ObjectID') || !utils.isObject(value)) { + value = { _id: value }; + } + + // gh-2399 + // we should cast model only when it's not a discriminator + const isDisc = value.schema && value.schema.discriminatorMapping && + value.schema.discriminatorMapping.key !== undefined; + if (!isDisc) { + value = new Model(value); + } + return this[arraySchemaSymbol].caster.applySetters(value, parent, true); + } + + return this[arraySchemaSymbol].caster.applySetters(value, parent, false); + }, + + /** + * Internal helper for .map() + * + * @api private + * @return {Number} + * @method _mapCast + * @memberOf MongooseArray + */ + + _mapCast(val, index) { + return this._cast(val, this.length + index); + }, + + /** + * Marks this array as modified. + * + * If it bubbles up from an embedded document change, then it takes the following arguments (otherwise, takes 0 arguments) + * + * @param {ArraySubdocument} subdoc the embedded doc that invoked this method on the Array + * @param {String} embeddedPath the path which changed in the subdoc + * @method _markModified + * @api private + * @memberOf MongooseArray + */ + + _markModified(elem) { + const parent = this[arrayParentSymbol]; + let dirtyPath; + + if (parent) { + dirtyPath = this[arrayPathSymbol]; + + if (arguments.length) { + dirtyPath = dirtyPath + '.' + elem; + } + + if (dirtyPath != null && dirtyPath.endsWith('.$')) { + return this; + } + + parent.markModified(dirtyPath, arguments.length !== 0 ? elem : parent); + } + + return this; + }, + + /** + * Register an atomic operation with the parent. + * + * @param {Array} op operation + * @param {any} val + * @method _registerAtomic + * @api private + * @memberOf MongooseArray + */ + + _registerAtomic(op, val) { + if (this[slicedSymbol]) { + return; + } + if (op === '$set') { + // $set takes precedence over all other ops. + // mark entire array modified. + this[arrayAtomicsSymbol] = { $set: val }; + cleanModifiedSubpaths(this[arrayParentSymbol], this[arrayPathSymbol]); + this._markModified(); + return this; + } + + const atomics = this[arrayAtomicsSymbol]; + + // reset pop/shift after save + if (op === '$pop' && !('$pop' in atomics)) { + const _this = this; + this[arrayParentSymbol].once('save', function() { + _this._popped = _this._shifted = null; + }); + } + + // check for impossible $atomic combos (Mongo denies more than one + // $atomic op on a single path + if (atomics.$set || Object.keys(atomics).length && !(op in atomics)) { + // a different op was previously registered. + // save the entire thing. + this[arrayAtomicsSymbol] = { $set: this }; + return this; + } + + let selector; + + if (op === '$pullAll' || op === '$addToSet') { + atomics[op] || (atomics[op] = []); + atomics[op] = atomics[op].concat(val); + } else if (op === '$pullDocs') { + const pullOp = atomics['$pull'] || (atomics['$pull'] = {}); + if (val[0] instanceof ArraySubdocument) { + selector = pullOp['$or'] || (pullOp['$or'] = []); + Array.prototype.push.apply(selector, val.map(function(v) { + return v.toObject({ transform: false, virtuals: false }); + })); + } else { + selector = pullOp['_id'] || (pullOp['_id'] = { $in: [] }); + selector['$in'] = selector['$in'].concat(val); + } + } else if (op === '$push') { + atomics.$push = atomics.$push || { $each: [] }; + if (val != null && utils.hasUserDefinedProperty(val, '$each')) { + atomics.$push = val; + } else { + atomics.$push.$each = atomics.$push.$each.concat(val); + } + } else { + atomics[op] = val; + } + + return this; + }, + + /** + * Adds values to the array if not already present. + * + * #### Example: + * + * console.log(doc.array) // [2,3,4] + * const added = doc.array.addToSet(4,5); + * console.log(doc.array) // [2,3,4,5] + * console.log(added) // [5] + * + * @param {any} [args...] + * @return {Array} the values that were added + * @memberOf MongooseArray + * @api public + * @method addToSet + */ + + addToSet() { + _checkManualPopulation(this, arguments); + + let values = [].map.call(arguments, this._mapCast, this); + values = this[arraySchemaSymbol].applySetters(values, this[arrayParentSymbol]); + const added = []; + let type = ''; + if (values[0] instanceof ArraySubdocument) { + type = 'doc'; + } else if (values[0] instanceof Date) { + type = 'date'; + } + + const rawValues = utils.isMongooseArray(values) ? values.__array : this; + const rawArray = utils.isMongooseArray(this) ? this.__array : this; + + rawValues.forEach(function(v) { + let found; + const val = +v; + switch (type) { + case 'doc': + found = this.some(function(doc) { + return doc.equals(v); + }); + break; + case 'date': + found = this.some(function(d) { + return +d === val; + }); + break; + default: + found = ~this.indexOf(v); + } + + if (!found) { + this._markModified(); + rawArray.push(v); + this._registerAtomic('$addToSet', v); + [].push.call(added, v); + } + }, this); + + return added; + }, + + /** + * Returns the number of pending atomic operations to send to the db for this array. + * + * @api private + * @return {Number} + * @method hasAtomics + * @memberOf MongooseArray + */ + + hasAtomics() { + if (!utils.isPOJO(this[arrayAtomicsSymbol])) { + return 0; + } + + return Object.keys(this[arrayAtomicsSymbol]).length; + }, + + /** + * Return whether or not the `obj` is included in the array. + * + * @param {Object} obj the item to check + * @param {Number} fromIndex + * @return {Boolean} + * @api public + * @method includes + * @memberOf MongooseArray + */ + + includes(obj, fromIndex) { + const ret = this.indexOf(obj, fromIndex); + return ret !== -1; + }, + + /** + * Return the index of `obj` or `-1` if not found. + * + * @param {Object} obj the item to look for + * @param {Number} fromIndex + * @return {Number} + * @api public + * @method indexOf + * @memberOf MongooseArray + */ + + indexOf(obj, fromIndex) { + if (isBsonType(obj, 'ObjectID')) { + obj = obj.toString(); + } + + fromIndex = fromIndex == null ? 0 : fromIndex; + const len = this.length; + for (let i = fromIndex; i < len; ++i) { + if (obj == this[i]) { + return i; + } + } + return -1; + }, + + /** + * Helper for console.log + * + * @api public + * @method inspect + * @memberOf MongooseArray + */ + + inspect() { + return JSON.stringify(this); + }, + + /** + * Pushes items to the array non-atomically. + * + * #### Note: + * + * _marks the entire array as modified, which if saved, will store it as a `$set` operation, potentially overwritting any changes that happen between when you retrieved the object and when you save it._ + * + * @param {any} [args...] + * @api public + * @method nonAtomicPush + * @memberOf MongooseArray + */ + + nonAtomicPush() { + const values = [].map.call(arguments, this._mapCast, this); + this._markModified(); + const ret = [].push.apply(this, values); + this._registerAtomic('$set', this); + return ret; + }, + + /** + * Wraps [`Array#pop`](https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/pop) with proper change tracking. + * + * #### Note: + * + * _marks the entire array as modified which will pass the entire thing to $set potentially overwriting any changes that happen between when you retrieved the object and when you save it._ + * + * @see MongooseArray#$pop #types_array_MongooseArray-%24pop + * @api public + * @method pop + * @memberOf MongooseArray + */ + + pop() { + this._markModified(); + const ret = [].pop.call(this); + this._registerAtomic('$set', this); + return ret; + }, + + /** + * Pulls items from the array atomically. Equality is determined by casting + * the provided value to an embedded document and comparing using + * [the `Document.equals()` function.](/docs/api.html#document_Document-equals) + * + * #### Examples: + * + * doc.array.pull(ObjectId) + * doc.array.pull({ _id: 'someId' }) + * doc.array.pull(36) + * doc.array.pull('tag 1', 'tag 2') + * + * To remove a document from a subdocument array we may pass an object with a matching `_id`. + * + * doc.subdocs.push({ _id: 4815162342 }) + * doc.subdocs.pull({ _id: 4815162342 }) // removed + * + * Or we may passing the _id directly and let mongoose take care of it. + * + * doc.subdocs.push({ _id: 4815162342 }) + * doc.subdocs.pull(4815162342); // works + * + * The first pull call will result in a atomic operation on the database, if pull is called repeatedly without saving the document, a $set operation is used on the complete array instead, overwriting possible changes that happened on the database in the meantime. + * + * @param {any} [args...] + * @see mongodb https://www.mongodb.org/display/DOCS/Updating/#Updating-%24pull + * @api public + * @method pull + * @memberOf MongooseArray + */ + + pull() { + const values = [].map.call(arguments, this._cast, this); + const cur = this[arrayParentSymbol].get(this[arrayPathSymbol]); + let i = cur.length; + let mem; + this._markModified(); + + while (i--) { + mem = cur[i]; + if (mem instanceof Document) { + const some = values.some(function(v) { + return mem.equals(v); + }); + if (some) { + [].splice.call(cur, i, 1); + } + } else if (~cur.indexOf.call(values, mem)) { + [].splice.call(cur, i, 1); + } + } + + if (values[0] instanceof ArraySubdocument) { + this._registerAtomic('$pullDocs', values.map(function(v) { + return v.$__getValue('_id') || v; + })); + } else { + this._registerAtomic('$pullAll', values); + } + + + // Might have modified child paths and then pulled, like + // `doc.children[1].name = 'test';` followed by + // `doc.children.remove(doc.children[0]);`. In this case we fall back + // to a `$set` on the whole array. See #3511 + if (cleanModifiedSubpaths(this[arrayParentSymbol], this[arrayPathSymbol]) > 0) { + this._registerAtomic('$set', this); + } + + return this; + }, + + /** + * Wraps [`Array#push`](https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/push) with proper change tracking. + * + * #### Example: + * + * const schema = Schema({ nums: [Number] }); + * const Model = mongoose.model('Test', schema); + * + * const doc = await Model.create({ nums: [3, 4] }); + * doc.nums.push(5); // Add 5 to the end of the array + * await doc.save(); + * + * // You can also pass an object with `$each` as the + * // first parameter to use MongoDB's `$position` + * doc.nums.push({ + * $each: [1, 2], + * $position: 0 + * }); + * doc.nums; // [1, 2, 3, 4, 5] + * + * @param {Object} [args...] + * @api public + * @method push + * @memberOf MongooseArray + */ + + push() { + let values = arguments; + let atomic = values; + const isOverwrite = values[0] != null && + utils.hasUserDefinedProperty(values[0], '$each'); + const arr = utils.isMongooseArray(this) ? this.__array : this; + if (isOverwrite) { + atomic = values[0]; + values = values[0].$each; + } + + if (this[arraySchemaSymbol] == null) { + return _basePush.apply(this, values); + } + + _checkManualPopulation(this, values); + + const parent = this[arrayParentSymbol]; + values = [].map.call(values, this._mapCast, this); + values = this[arraySchemaSymbol].applySetters(values, parent, undefined, + undefined, { skipDocumentArrayCast: true }); + let ret; + const atomics = this[arrayAtomicsSymbol]; + this._markModified(); + if (isOverwrite) { + atomic.$each = values; + + if ((atomics.$push && atomics.$push.$each && atomics.$push.$each.length || 0) !== 0 && + atomics.$push.$position != atomic.$position) { + throw new MongooseError('Cannot call `Array#push()` multiple times ' + + 'with different `$position`'); + } + + if (atomic.$position != null) { + [].splice.apply(arr, [atomic.$position, 0].concat(values)); + ret = this.length; + } else { + ret = [].push.apply(arr, values); + } + } else { + if ((atomics.$push && atomics.$push.$each && atomics.$push.$each.length || 0) !== 0 && + atomics.$push.$position != null) { + throw new MongooseError('Cannot call `Array#push()` multiple times ' + + 'with different `$position`'); + } + atomic = values; + ret = [].push.apply(arr, values); + } + + this._registerAtomic('$push', atomic); + return ret; + }, + + /** + * Alias of [pull](#mongoosearray_MongooseArray-pull) + * + * @see MongooseArray#pull #types_array_MongooseArray-pull + * @see mongodb https://www.mongodb.org/display/DOCS/Updating/#Updating-%24pull + * @api public + * @memberOf MongooseArray + * @instance + * @method remove + */ + + remove() { + return this.pull.apply(this, arguments); + }, + + /** + * Sets the casted `val` at index `i` and marks the array modified. + * + * #### Example: + * + * // given documents based on the following + * const Doc = mongoose.model('Doc', new Schema({ array: [Number] })); + * + * const doc = new Doc({ array: [2,3,4] }) + * + * console.log(doc.array) // [2,3,4] + * + * doc.array.set(1,"5"); + * console.log(doc.array); // [2,5,4] // properly cast to number + * doc.save() // the change is saved + * + * // VS not using array#set + * doc.array[1] = "5"; + * console.log(doc.array); // [2,"5",4] // no casting + * doc.save() // change is not saved + * + * @return {Array} this + * @api public + * @method set + * @memberOf MongooseArray + */ + + set(i, val, skipModified) { + const arr = this.__array; + if (skipModified) { + arr[i] = val; + return this; + } + const value = methods._cast.call(this, val, i); + methods._markModified.call(this, i); + arr[i] = value; + return this; + }, + + /** + * Wraps [`Array#shift`](https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/unshift) with proper change tracking. + * + * #### Example: + * + * doc.array = [2,3]; + * const res = doc.array.shift(); + * console.log(res) // 2 + * console.log(doc.array) // [3] + * + * #### Note: + * + * _marks the entire array as modified, which if saved, will store it as a `$set` operation, potentially overwritting any changes that happen between when you retrieved the object and when you save it._ + * + * @api public + * @method shift + * @memberOf MongooseArray + */ + + shift() { + const arr = utils.isMongooseArray(this) ? this.__array : this; + this._markModified(); + const ret = [].shift.call(arr); + this._registerAtomic('$set', this); + return ret; + }, + + /** + * Wraps [`Array#sort`](https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/sort) with proper change tracking. + * + * #### Note: + * + * _marks the entire array as modified, which if saved, will store it as a `$set` operation, potentially overwritting any changes that happen between when you retrieved the object and when you save it._ + * + * @api public + * @method sort + * @memberOf MongooseArray + * @see https://masteringjs.io/tutorials/fundamentals/array-sort + */ + + sort() { + const arr = utils.isMongooseArray(this) ? this.__array : this; + const ret = [].sort.apply(arr, arguments); + this._registerAtomic('$set', this); + return ret; + }, + + /** + * Wraps [`Array#splice`](https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/splice) with proper change tracking and casting. + * + * #### Note: + * + * _marks the entire array as modified, which if saved, will store it as a `$set` operation, potentially overwritting any changes that happen between when you retrieved the object and when you save it._ + * + * @api public + * @method splice + * @memberOf MongooseArray + * @see https://masteringjs.io/tutorials/fundamentals/array-splice + */ + + splice() { + let ret; + const arr = utils.isMongooseArray(this) ? this.__array : this; + + _checkManualPopulation(this, Array.prototype.slice.call(arguments, 2)); + + if (arguments.length) { + let vals; + if (this[arraySchemaSymbol] == null) { + vals = arguments; + } else { + vals = []; + for (let i = 0; i < arguments.length; ++i) { + vals[i] = i < 2 ? + arguments[i] : + this._cast(arguments[i], arguments[0] + (i - 2)); + } + } + + ret = [].splice.apply(arr, vals); + this._registerAtomic('$set', this); + } + + return ret; + }, + + /*! + * ignore + */ + + toBSON() { + return this.toObject(internalToObjectOptions); + }, + + /** + * Returns a native js Array. + * + * @param {Object} options + * @return {Array} + * @api public + * @method toObject + * @memberOf MongooseArray + */ + + toObject(options) { + const arr = utils.isMongooseArray(this) ? this.__array : this; + if (options && options.depopulate) { + options = utils.clone(options); + options._isNested = true; + // Ensure return value is a vanilla array, because in Node.js 6+ `map()` + // is smart enough to use the inherited array's constructor. + return [].concat(arr).map(function(doc) { + return doc instanceof Document + ? doc.toObject(options) + : doc; + }); + } + + return [].concat(arr); + }, + + $toObject() { + return this.constructor.prototype.toObject.apply(this, arguments); + }, + /** + * Wraps [`Array#unshift`](https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/unshift) with proper change tracking. + * + * #### Note: + * + * _marks the entire array as modified, which if saved, will store it as a `$set` operation, potentially overwriting any changes that happen between when you retrieved the object and when you save it._ + * + * @api public + * @method unshift + * @memberOf MongooseArray + */ + + unshift() { + _checkManualPopulation(this, arguments); + + let values; + if (this[arraySchemaSymbol] == null) { + values = arguments; + } else { + values = [].map.call(arguments, this._cast, this); + values = this[arraySchemaSymbol].applySetters(values, this[arrayParentSymbol]); + } + + const arr = utils.isMongooseArray(this) ? this.__array : this; + this._markModified(); + [].unshift.apply(arr, values); + this._registerAtomic('$set', this); + return this.length; + } +}; + +/*! + * ignore + */ + +function _isAllSubdocs(docs, ref) { + if (!ref) { + return false; + } + + for (const arg of docs) { + if (arg == null) { + return false; + } + const model = arg.constructor; + if (!(arg instanceof Document) || + (model.modelName !== ref && model.baseModelName !== ref)) { + return false; + } + } + + return true; +} + +/*! + * ignore + */ + +function _checkManualPopulation(arr, docs) { + const ref = arr == null ? + null : + arr[arraySchemaSymbol] && arr[arraySchemaSymbol].caster && arr[arraySchemaSymbol].caster.options && arr[arraySchemaSymbol].caster.options.ref || null; + if (arr.length === 0 && + docs.length !== 0) { + if (_isAllSubdocs(docs, ref)) { + arr[arrayParentSymbol].$populated(arr[arrayPathSymbol], [], { + [populateModelSymbol]: docs[0].constructor + }); + } + } +} + +const returnVanillaArrayMethods = [ + 'filter', + 'flat', + 'flatMap', + 'map', + 'slice' +]; +for (const method of returnVanillaArrayMethods) { + if (Array.prototype[method] == null) { + continue; + } + + methods[method] = function() { + const _arr = utils.isMongooseArray(this) ? this.__array : this; + const arr = [].concat(_arr); + + return arr[method].apply(arr, arguments); + }; +} + +module.exports = methods; diff --git a/node_modules/mongoose/lib/types/buffer.js b/node_modules/mongoose/lib/types/buffer.js new file mode 100644 index 000000000..941bf9187 --- /dev/null +++ b/node_modules/mongoose/lib/types/buffer.js @@ -0,0 +1,273 @@ +/*! + * Module dependencies. + */ + +'use strict'; + +const Binary = require('../driver').get().Binary; +const utils = require('../utils'); + +/** + * Mongoose Buffer constructor. + * + * Values always have to be passed to the constructor to initialize. + * + * @param {Buffer} value + * @param {String} encode + * @param {Number} offset + * @api private + * @inherits Buffer + * @see https://bit.ly/f6CnZU + */ + +function MongooseBuffer(value, encode, offset) { + let val = value; + if (value == null) { + val = 0; + } + + let encoding; + let path; + let doc; + + if (Array.isArray(encode)) { + // internal casting + path = encode[0]; + doc = encode[1]; + } else { + encoding = encode; + } + + let buf; + if (typeof val === 'number' || val instanceof Number) { + buf = Buffer.alloc(val); + } else { // string, array or object { type: 'Buffer', data: [...] } + buf = Buffer.from(val, encoding, offset); + } + utils.decorate(buf, MongooseBuffer.mixin); + buf.isMongooseBuffer = true; + + // make sure these internal props don't show up in Object.keys() + buf[MongooseBuffer.pathSymbol] = path; + buf[parentSymbol] = doc; + + buf._subtype = 0; + return buf; +} + +const pathSymbol = Symbol.for('mongoose#Buffer#_path'); +const parentSymbol = Symbol.for('mongoose#Buffer#_parent'); +MongooseBuffer.pathSymbol = pathSymbol; + +/*! + * Inherit from Buffer. + */ + +MongooseBuffer.mixin = { + + /** + * Default subtype for the Binary representing this Buffer + * + * @api private + * @property _subtype + * @receiver MongooseBuffer + */ + + _subtype: undefined, + + /** + * Marks this buffer as modified. + * + * @api private + * @method _markModified + * @receiver MongooseBuffer + */ + + _markModified: function() { + const parent = this[parentSymbol]; + + if (parent) { + parent.markModified(this[MongooseBuffer.pathSymbol]); + } + return this; + }, + + /** + * Writes the buffer. + * + * @api public + * @method write + * @receiver MongooseBuffer + */ + + write: function() { + const written = Buffer.prototype.write.apply(this, arguments); + + if (written > 0) { + this._markModified(); + } + + return written; + }, + + /** + * Copies the buffer. + * + * #### Note: + * + * `Buffer#copy` does not mark `target` as modified so you must copy from a `MongooseBuffer` for it to work as expected. This is a work around since `copy` modifies the target, not this. + * + * @return {Number} The number of bytes copied. + * @param {Buffer} target + * @method copy + * @receiver MongooseBuffer + */ + + copy: function(target) { + const ret = Buffer.prototype.copy.apply(this, arguments); + + if (target && target.isMongooseBuffer) { + target._markModified(); + } + + return ret; + } +}; + +/*! + * Compile other Buffer methods marking this buffer as modified. + */ + +( +// node < 0.5 + ('writeUInt8 writeUInt16 writeUInt32 writeInt8 writeInt16 writeInt32 ' + + 'writeFloat writeDouble fill ' + + 'utf8Write binaryWrite asciiWrite set ' + + + // node >= 0.5 + 'writeUInt16LE writeUInt16BE writeUInt32LE writeUInt32BE ' + + 'writeInt16LE writeInt16BE writeInt32LE writeInt32BE ' + 'writeFloatLE writeFloatBE writeDoubleLE writeDoubleBE') +).split(' ').forEach(function(method) { + if (!Buffer.prototype[method]) { + return; + } + MongooseBuffer.mixin[method] = function() { + const ret = Buffer.prototype[method].apply(this, arguments); + this._markModified(); + return ret; + }; +}); + +/** + * Converts this buffer to its Binary type representation. + * + * ####SubTypes: + * + * const bson = require('bson') + * bson.BSON_BINARY_SUBTYPE_DEFAULT + * bson.BSON_BINARY_SUBTYPE_FUNCTION + * bson.BSON_BINARY_SUBTYPE_BYTE_ARRAY + * bson.BSON_BINARY_SUBTYPE_UUID + * bson.BSON_BINARY_SUBTYPE_MD5 + * bson.BSON_BINARY_SUBTYPE_USER_DEFINED + * + * doc.buffer.toObject(bson.BSON_BINARY_SUBTYPE_USER_DEFINED); + * + * @see https://bsonspec.org/#/specification + * @param {Hex} [subtype] + * @return {Binary} + * @api public + * @method toObject + * @receiver MongooseBuffer + */ + +MongooseBuffer.mixin.toObject = function(options) { + const subtype = typeof options === 'number' + ? options + : (this._subtype || 0); + return new Binary(Buffer.from(this), subtype); +}; + +MongooseBuffer.mixin.$toObject = MongooseBuffer.mixin.toObject; + +/** + * Converts this buffer for storage in MongoDB, including subtype + * + * @return {Binary} + * @api public + * @method toBSON + * @receiver MongooseBuffer + */ + +MongooseBuffer.mixin.toBSON = function() { + return new Binary(this, this._subtype || 0); +}; + +/** + * Determines if this buffer is equals to `other` buffer + * + * @param {Buffer} other + * @return {Boolean} + * @method equals + * @receiver MongooseBuffer + */ + +MongooseBuffer.mixin.equals = function(other) { + if (!Buffer.isBuffer(other)) { + return false; + } + + if (this.length !== other.length) { + return false; + } + + for (let i = 0; i < this.length; ++i) { + if (this[i] !== other[i]) { + return false; + } + } + + return true; +}; + +/** + * Sets the subtype option and marks the buffer modified. + * + * ####SubTypes: + * + * const bson = require('bson') + * bson.BSON_BINARY_SUBTYPE_DEFAULT + * bson.BSON_BINARY_SUBTYPE_FUNCTION + * bson.BSON_BINARY_SUBTYPE_BYTE_ARRAY + * bson.BSON_BINARY_SUBTYPE_UUID + * bson.BSON_BINARY_SUBTYPE_MD5 + * bson.BSON_BINARY_SUBTYPE_USER_DEFINED + * + * doc.buffer.subtype(bson.BSON_BINARY_SUBTYPE_UUID); + * + * @see https://bsonspec.org/#/specification + * @param {Hex} subtype + * @api public + * @method subtype + * @receiver MongooseBuffer + */ + +MongooseBuffer.mixin.subtype = function(subtype) { + if (typeof subtype !== 'number') { + throw new TypeError('Invalid subtype. Expected a number'); + } + + if (this._subtype !== subtype) { + this._markModified(); + } + + this._subtype = subtype; +}; + +/*! + * Module exports. + */ + +MongooseBuffer.Binary = Binary; + +module.exports = MongooseBuffer; diff --git a/node_modules/mongoose/lib/types/decimal128.js b/node_modules/mongoose/lib/types/decimal128.js new file mode 100644 index 000000000..1ac89650b --- /dev/null +++ b/node_modules/mongoose/lib/types/decimal128.js @@ -0,0 +1,13 @@ +/** + * ObjectId type constructor + * + * #### Example + * + * const id = new mongoose.Types.ObjectId; + * + * @constructor ObjectId + */ + +'use strict'; + +module.exports = require('../driver').get().Decimal128; diff --git a/node_modules/mongoose/lib/types/index.js b/node_modules/mongoose/lib/types/index.js new file mode 100644 index 000000000..fbfb89a55 --- /dev/null +++ b/node_modules/mongoose/lib/types/index.js @@ -0,0 +1,20 @@ + +/*! + * Module exports. + */ + +'use strict'; + +exports.Array = require('./array'); +exports.Buffer = require('./buffer'); + +exports.Document = // @deprecate +exports.Embedded = require('./ArraySubdocument'); + +exports.DocumentArray = require('./DocumentArray'); +exports.Decimal128 = require('./decimal128'); +exports.ObjectId = require('./objectid'); + +exports.Map = require('./map'); + +exports.Subdocument = require('./subdocument'); diff --git a/node_modules/mongoose/lib/types/map.js b/node_modules/mongoose/lib/types/map.js new file mode 100644 index 000000000..486c03f4e --- /dev/null +++ b/node_modules/mongoose/lib/types/map.js @@ -0,0 +1,247 @@ +'use strict'; + +const Mixed = require('../schema/mixed'); +const clone = require('../helpers/clone'); +const deepEqual = require('../utils').deepEqual; +const getConstructorName = require('../helpers/getConstructorName'); +const handleSpreadDoc = require('../helpers/document/handleSpreadDoc'); +const util = require('util'); +const specialProperties = require('../helpers/specialProperties'); +const isBsonType = require('../helpers/isBsonType'); + +const populateModelSymbol = require('../helpers/symbols').populateModelSymbol; + +/*! + * ignore + */ + +class MongooseMap extends Map { + constructor(v, path, doc, schemaType) { + if (getConstructorName(v) === 'Object') { + v = Object.keys(v).reduce((arr, key) => arr.concat([[key, v[key]]]), []); + } + super(v); + this.$__parent = doc != null && doc.$__ != null ? doc : null; + this.$__path = path; + this.$__schemaType = schemaType == null ? new Mixed(path) : schemaType; + + this.$__runDeferred(); + } + + $init(key, value) { + checkValidKey(key); + + super.set(key, value); + + if (value != null && value.$isSingleNested) { + value.$basePath = this.$__path + '.' + key; + } + } + + $__set(key, value) { + super.set(key, value); + } + + get(key, options) { + if (isBsonType(key, 'ObjectID')) { + key = key.toString(); + } + + options = options || {}; + if (options.getters === false) { + return super.get(key); + } + return this.$__schemaType.applyGetters(super.get(key), this.$__parent); + } + + set(key, value) { + if (isBsonType(key, 'ObjectID')) { + key = key.toString(); + } + + checkValidKey(key); + value = handleSpreadDoc(value); + + // Weird, but because you can't assign to `this` before calling `super()` + // you can't get access to `$__schemaType` to cast in the initial call to + // `set()` from the `super()` constructor. + + if (this.$__schemaType == null) { + this.$__deferred = this.$__deferred || []; + this.$__deferred.push({ key: key, value: value }); + return; + } + + const fullPath = this.$__path + '.' + key; + const populated = this.$__parent != null && this.$__parent.$__ ? + this.$__parent.$populated(fullPath) || this.$__parent.$populated(this.$__path) : + null; + const priorVal = this.get(key); + + if (populated != null) { + if (value.$__ == null) { + value = new populated.options[populateModelSymbol](value); + } + value.$__.wasPopulated = { value: populated.value }; + } else { + try { + value = this.$__schemaType. + applySetters(value, this.$__parent, false, this.get(key), { path: fullPath }); + } catch (error) { + if (this.$__parent != null && this.$__parent.$__ != null) { + this.$__parent.invalidate(fullPath, error); + return; + } + throw error; + } + } + + super.set(key, value); + + if (value != null && value.$isSingleNested) { + value.$basePath = this.$__path + '.' + key; + } + + const parent = this.$__parent; + if (parent != null && parent.$__ != null && !deepEqual(value, priorVal)) { + parent.markModified(this.$__path + '.' + key); + } + } + + clear() { + super.clear(); + const parent = this.$__parent; + if (parent != null) { + parent.markModified(this.$__path); + } + } + + delete(key) { + if (isBsonType(key, 'ObjectID')) { + key = key.toString(); + } + + this.set(key, undefined); + super.delete(key); + } + + toBSON() { + return new Map(this); + } + + toObject(options) { + if (options && options.flattenMaps) { + const ret = {}; + const keys = this.keys(); + for (const key of keys) { + ret[key] = clone(this.get(key), options); + } + return ret; + } + + return new Map(this); + } + + $toObject() { + return this.constructor.prototype.toObject.apply(this, arguments); + } + + toJSON(options) { + if (typeof (options && options.flattenMaps) === 'boolean' ? options.flattenMaps : true) { + const ret = {}; + const keys = this.keys(); + for (const key of keys) { + ret[key] = clone(this.get(key), options); + } + return ret; + } + + return new Map(this); + } + + inspect() { + return new Map(this); + } + + $__runDeferred() { + if (!this.$__deferred) { + return; + } + + for (const keyValueObject of this.$__deferred) { + this.set(keyValueObject.key, keyValueObject.value); + } + + this.$__deferred = null; + } +} + +if (util.inspect.custom) { + Object.defineProperty(MongooseMap.prototype, util.inspect.custom, { + enumerable: false, + writable: false, + configurable: false, + value: MongooseMap.prototype.inspect + }); +} + +Object.defineProperty(MongooseMap.prototype, '$__set', { + enumerable: false, + writable: true, + configurable: false +}); + +Object.defineProperty(MongooseMap.prototype, '$__parent', { + enumerable: false, + writable: true, + configurable: false +}); + +Object.defineProperty(MongooseMap.prototype, '$__path', { + enumerable: false, + writable: true, + configurable: false +}); + +Object.defineProperty(MongooseMap.prototype, '$__schemaType', { + enumerable: false, + writable: true, + configurable: false +}); + +Object.defineProperty(MongooseMap.prototype, '$isMongooseMap', { + enumerable: false, + writable: false, + configurable: false, + value: true +}); + +Object.defineProperty(MongooseMap.prototype, '$__deferredCalls', { + enumerable: false, + writable: false, + configurable: false, + value: true +}); + +/*! + * Since maps are stored as objects under the hood, keys must be strings + * and can't contain any invalid characters + */ + +function checkValidKey(key) { + const keyType = typeof key; + if (keyType !== 'string') { + throw new TypeError(`Mongoose maps only support string keys, got ${keyType}`); + } + if (key.startsWith('$')) { + throw new Error(`Mongoose maps do not support keys that start with "$", got "${key}"`); + } + if (key.includes('.')) { + throw new Error(`Mongoose maps do not support keys that contain ".", got "${key}"`); + } + if (specialProperties.has(key)) { + throw new Error(`Mongoose maps do not support reserved key name "${key}"`); + } +} + +module.exports = MongooseMap; diff --git a/node_modules/mongoose/lib/types/objectid.js b/node_modules/mongoose/lib/types/objectid.js new file mode 100644 index 000000000..fa08503fe --- /dev/null +++ b/node_modules/mongoose/lib/types/objectid.js @@ -0,0 +1,41 @@ +/** + * ObjectId type constructor + * + * #### Example + * + * const id = new mongoose.Types.ObjectId; + * + * @constructor ObjectId + */ + +'use strict'; + +const ObjectId = require('../driver').get().ObjectId; +const objectIdSymbol = require('../helpers/symbols').objectIdSymbol; + +/*! + * Getter for convenience with populate, see gh-6115 + */ + +Object.defineProperty(ObjectId.prototype, '_id', { + enumerable: false, + configurable: true, + get: function() { + return this; + } +}); + +/*! + * Convenience `valueOf()` to allow comparing ObjectIds using double equals re: gh-7299 + */ + + +if (!ObjectId.prototype.hasOwnProperty('valueOf')) { + ObjectId.prototype.valueOf = function objectIdValueOf() { + return this.toString(); + }; +} + +ObjectId.prototype[objectIdSymbol] = true; + +module.exports = ObjectId; diff --git a/node_modules/mongoose/lib/types/subdocument.js b/node_modules/mongoose/lib/types/subdocument.js new file mode 100644 index 000000000..57c675bb4 --- /dev/null +++ b/node_modules/mongoose/lib/types/subdocument.js @@ -0,0 +1,410 @@ +'use strict'; + +const Document = require('../document'); +const immediate = require('../helpers/immediate'); +const internalToObjectOptions = require('../options').internalToObjectOptions; +const promiseOrCallback = require('../helpers/promiseOrCallback'); +const util = require('util'); +const utils = require('../utils'); + +module.exports = Subdocument; + +/** + * Subdocument constructor. + * + * @inherits Document + * @api private + */ + +function Subdocument(value, fields, parent, skipId, options) { + if (parent != null) { + // If setting a nested path, should copy isNew from parent re: gh-7048 + const parentOptions = { isNew: parent.isNew }; + if ('defaults' in parent.$__) { + parentOptions.defaults = parent.$__.defaults; + } + options = Object.assign(parentOptions, options); + } + if (options != null && options.path != null) { + this.$basePath = options.path; + } + Document.call(this, value, fields, skipId, options); + + delete this.$__.priorDoc; +} + +Subdocument.prototype = Object.create(Document.prototype); + +Object.defineProperty(Subdocument.prototype, '$isSubdocument', { + configurable: false, + writable: false, + value: true +}); + +Object.defineProperty(Subdocument.prototype, '$isSingleNested', { + configurable: false, + writable: false, + value: true +}); + +/*! + * ignore + */ + +Subdocument.prototype.toBSON = function() { + return this.toObject(internalToObjectOptions); +}; + +/** + * Used as a stub for middleware + * + * #### Note: + * + * _This is a no-op. Does not actually save the doc to the db._ + * + * @param {Function} [fn] + * @return {Promise} resolved Promise + * @api private + */ + +Subdocument.prototype.save = function(options, fn) { + if (typeof options === 'function') { + fn = options; + options = {}; + } + options = options || {}; + + if (!options.suppressWarning) { + utils.warn('mongoose: calling `save()` on a subdoc does **not** save ' + + 'the document to MongoDB, it only runs save middleware. ' + + 'Use `subdoc.save({ suppressWarning: true })` to hide this warning ' + + 'if you\'re sure this behavior is right for your app.'); + } + + return promiseOrCallback(fn, cb => { + this.$__save(cb); + }); +}; + +/*! + * Given a path relative to this document, return the path relative + * to the top-level document. + */ + +Subdocument.prototype.$__fullPath = function(path) { + if (!this.$__.fullPath) { + this.ownerDocument(); + } + + return path ? + this.$__.fullPath + '.' + path : + this.$__.fullPath; +}; + +/*! + * Given a path relative to this document, return the path relative + * to the top-level document. + */ + +Subdocument.prototype.$__pathRelativeToParent = function(p) { + if (p == null) { + return this.$basePath; + } + return [this.$basePath, p].join('.'); +}; + +/** + * Used as a stub for middleware + * + * #### Note: + * + * _This is a no-op. Does not actually save the doc to the db._ + * + * @param {Function} [fn] + * @method $__save + * @api private + */ + +Subdocument.prototype.$__save = function(fn) { + return immediate(() => fn(null, this)); +}; + +/*! + * ignore + */ + +Subdocument.prototype.$isValid = function(path) { + const parent = this.$parent(); + const fullPath = this.$__pathRelativeToParent(path); + if (parent != null && fullPath != null) { + return parent.$isValid(fullPath); + } + return Document.prototype.$isValid.call(this, path); +}; + +/*! + * ignore + */ + +Subdocument.prototype.markModified = function(path) { + Document.prototype.markModified.call(this, path); + const parent = this.$parent(); + const fullPath = this.$__pathRelativeToParent(path); + + if (parent == null || fullPath == null) { + return; + } + + const myPath = this.$__pathRelativeToParent().replace(/\.$/, ''); + if (parent.isDirectModified(myPath) || this.isNew) { + return; + } + this.$__parent.markModified(fullPath, this); +}; + +/*! + * ignore + */ + +Subdocument.prototype.isModified = function(paths, modifiedPaths) { + const parent = this.$parent(); + if (parent != null) { + if (Array.isArray(paths) || typeof paths === 'string') { + paths = (Array.isArray(paths) ? paths : paths.split(' ')); + paths = paths.map(p => this.$__pathRelativeToParent(p)).filter(p => p != null); + } else if (!paths) { + paths = this.$__pathRelativeToParent(); + } + + return parent.$isModified(paths, modifiedPaths); + } + + return Document.prototype.isModified.call(this, paths, modifiedPaths); +}; + +/** + * Marks a path as valid, removing existing validation errors. + * + * @param {String} path the field to mark as valid + * @api private + * @method $markValid + * @receiver Subdocument + */ + +Subdocument.prototype.$markValid = function(path) { + Document.prototype.$markValid.call(this, path); + const parent = this.$parent(); + const fullPath = this.$__pathRelativeToParent(path); + if (parent != null && fullPath != null) { + parent.$markValid(fullPath); + } +}; + +/*! + * ignore + */ + +Subdocument.prototype.invalidate = function(path, err, val) { + Document.prototype.invalidate.call(this, path, err, val); + + const parent = this.$parent(); + const fullPath = this.$__pathRelativeToParent(path); + if (parent != null && fullPath != null) { + parent.invalidate(fullPath, err, val); + } else if (err.kind === 'cast' || err.name === 'CastError' || fullPath == null) { + throw err; + } + + return this.ownerDocument().$__.validationError; +}; + +/*! + * ignore + */ + +Subdocument.prototype.$ignore = function(path) { + Document.prototype.$ignore.call(this, path); + const parent = this.$parent(); + const fullPath = this.$__pathRelativeToParent(path); + if (parent != null && fullPath != null) { + parent.$ignore(fullPath); + } +}; + +/** + * Returns the top level document of this sub-document. + * + * @return {Document} + */ + +Subdocument.prototype.ownerDocument = function() { + if (this.$__.ownerDocument) { + return this.$__.ownerDocument; + } + + let parent = this; // eslint-disable-line consistent-this + const paths = []; + const seenDocs = new Set([parent]); + + while (true) { + if (typeof parent.$__pathRelativeToParent !== 'function') { + break; + } + paths.unshift(parent.$__pathRelativeToParent(void 0, true)); + const _parent = parent.$parent(); + if (_parent == null) { + break; + } + parent = _parent; + if (seenDocs.has(parent)) { + throw new Error('Infinite subdocument loop: subdoc with _id ' + parent._id + ' is a parent of itself'); + } + + seenDocs.add(parent); + } + + this.$__.fullPath = paths.join('.'); + + this.$__.ownerDocument = parent; + return this.$__.ownerDocument; +}; + +/*! + * ignore + */ + +Subdocument.prototype.$__fullPathWithIndexes = function() { + let parent = this; // eslint-disable-line consistent-this + const paths = []; + const seenDocs = new Set([parent]); + + while (true) { + if (typeof parent.$__pathRelativeToParent !== 'function') { + break; + } + paths.unshift(parent.$__pathRelativeToParent(void 0, false)); + const _parent = parent.$parent(); + if (_parent == null) { + break; + } + parent = _parent; + if (seenDocs.has(parent)) { + throw new Error('Infinite subdocument loop: subdoc with _id ' + parent._id + ' is a parent of itself'); + } + + seenDocs.add(parent); + } + + return paths.join('.'); +}; + +/** + * Returns this sub-documents parent document. + * + * @api public + */ + +Subdocument.prototype.parent = function() { + return this.$__parent; +}; + +/** + * Returns this sub-documents parent document. + * + * @api public + * @method $parent + */ + +Subdocument.prototype.$parent = Subdocument.prototype.parent; + +/*! + * no-op for hooks + */ + +Subdocument.prototype.$__remove = function(cb) { + if (cb == null) { + return; + } + return cb(null, this); +}; + +Subdocument.prototype.$__removeFromParent = function() { + this.$__parent.set(this.$basePath, null); +}; + +/** + * Null-out this subdoc + * + * @param {Object} [options] + * @param {Function} [callback] optional callback for compatibility with Document.prototype.remove + */ + +Subdocument.prototype.remove = function(options, callback) { + if (typeof options === 'function') { + callback = options; + options = null; + } + registerRemoveListener(this); + + // If removing entire doc, no need to remove subdoc + if (!options || !options.noop) { + this.$__removeFromParent(); + } + + return this.$__remove(callback); +}; + +/*! + * ignore + */ + +Subdocument.prototype.populate = function() { + throw new Error('Mongoose does not support calling populate() on nested ' + + 'docs. Instead of `doc.nested.populate("path")`, use ' + + '`doc.populate("nested.path")`'); +}; + +/** + * Helper for console.log + * + * @api public + */ + +Subdocument.prototype.inspect = function() { + return this.toObject({ + transform: false, + virtuals: false, + flattenDecimals: false + }); +}; + +if (util.inspect.custom) { + /*! + * Avoid Node deprecation warning DEP0079 + */ + + Subdocument.prototype[util.inspect.custom] = Subdocument.prototype.inspect; +} + +/*! + * Registers remove event listeners for triggering + * on subdocuments. + * + * @param {Subdocument} sub + * @api private + */ + +function registerRemoveListener(sub) { + let owner = sub.ownerDocument(); + + function emitRemove() { + owner.$removeListener('save', emitRemove); + owner.$removeListener('remove', emitRemove); + sub.emit('remove', sub); + sub.constructor.emit('remove', sub); + owner = sub = null; + } + + owner.$on('save', emitRemove); + owner.$on('remove', emitRemove); +} diff --git a/node_modules/mongoose/lib/utils.js b/node_modules/mongoose/lib/utils.js new file mode 100644 index 000000000..50058acdc --- /dev/null +++ b/node_modules/mongoose/lib/utils.js @@ -0,0 +1,974 @@ +'use strict'; + +/*! + * Module dependencies. + */ + +const ms = require('ms'); +const mpath = require('mpath'); +const ObjectId = require('./types/objectid'); +const PopulateOptions = require('./options/PopulateOptions'); +const clone = require('./helpers/clone'); +const immediate = require('./helpers/immediate'); +const isObject = require('./helpers/isObject'); +const isMongooseArray = require('./types/array/isMongooseArray'); +const isMongooseDocumentArray = require('./types/DocumentArray/isMongooseDocumentArray'); +const isBsonType = require('./helpers/isBsonType'); +const getFunctionName = require('./helpers/getFunctionName'); +const isMongooseObject = require('./helpers/isMongooseObject'); +const promiseOrCallback = require('./helpers/promiseOrCallback'); +const schemaMerge = require('./helpers/schema/merge'); +const specialProperties = require('./helpers/specialProperties'); +const { trustedSymbol } = require('./helpers/query/trusted'); + +let Document; + +exports.specialProperties = specialProperties; + +exports.isMongooseArray = isMongooseArray.isMongooseArray; +exports.isMongooseDocumentArray = isMongooseDocumentArray.isMongooseDocumentArray; +exports.registerMongooseArray = isMongooseArray.registerMongooseArray; +exports.registerMongooseDocumentArray = isMongooseDocumentArray.registerMongooseDocumentArray; + +/*! + * Produces a collection name from model `name`. By default, just returns + * the model name + * + * @param {String} name a model name + * @param {Function} pluralize function that pluralizes the collection name + * @return {String} a collection name + * @api private + */ + +exports.toCollectionName = function(name, pluralize) { + if (name === 'system.profile') { + return name; + } + if (name === 'system.indexes') { + return name; + } + if (typeof pluralize === 'function') { + return pluralize(name); + } + return name; +}; + +/*! + * Determines if `a` and `b` are deep equal. + * + * Modified from node/lib/assert.js + * + * @param {any} a a value to compare to `b` + * @param {any} b a value to compare to `a` + * @return {Boolean} + * @api private + */ + +exports.deepEqual = function deepEqual(a, b) { + if (a === b) { + return true; + } + + if (typeof a !== 'object' || typeof b !== 'object') { + return a === b; + } + + if (a instanceof Date && b instanceof Date) { + return a.getTime() === b.getTime(); + } + + if ((isBsonType(a, 'ObjectID') && isBsonType(b, 'ObjectID')) || + (isBsonType(a, 'Decimal128') && isBsonType(b, 'Decimal128'))) { + return a.toString() === b.toString(); + } + + if (a instanceof RegExp && b instanceof RegExp) { + return a.source === b.source && + a.ignoreCase === b.ignoreCase && + a.multiline === b.multiline && + a.global === b.global && + a.dotAll === b.dotAll && + a.unicode === b.unicode && + a.sticky === b.sticky && + a.hasIndices === b.hasIndices; + } + + if (a == null || b == null) { + return false; + } + + if (a.prototype !== b.prototype) { + return false; + } + + if (a instanceof Map || b instanceof Map) { + if (!(a instanceof Map) || !(b instanceof Map)) { + return false; + } + return deepEqual(Array.from(a.keys()), Array.from(b.keys())) && + deepEqual(Array.from(a.values()), Array.from(b.values())); + } + + // Handle MongooseNumbers + if (a instanceof Number && b instanceof Number) { + return a.valueOf() === b.valueOf(); + } + + if (Buffer.isBuffer(a)) { + return exports.buffer.areEqual(a, b); + } + + if (Array.isArray(a) || Array.isArray(b)) { + if (!Array.isArray(a) || !Array.isArray(b)) { + return false; + } + const len = a.length; + if (len !== b.length) { + return false; + } + for (let i = 0; i < len; ++i) { + if (!deepEqual(a[i], b[i])) { + return false; + } + } + return true; + } + + if (a.$__ != null) { + a = a._doc; + } else if (isMongooseObject(a)) { + a = a.toObject(); + } + + if (b.$__ != null) { + b = b._doc; + } else if (isMongooseObject(b)) { + b = b.toObject(); + } + + const ka = Object.keys(a); + const kb = Object.keys(b); + const kaLength = ka.length; + + // having the same number of owned properties (keys incorporates + // hasOwnProperty) + if (kaLength !== kb.length) { + return false; + } + + // ~~~cheap key test + for (let i = kaLength - 1; i >= 0; i--) { + if (ka[i] !== kb[i]) { + return false; + } + } + + // equivalent values for every corresponding key, and + // ~~~possibly expensive deep test + for (const key of ka) { + if (!deepEqual(a[key], b[key])) { + return false; + } + } + + return true; +}; + +/*! + * Get the last element of an array + */ + +exports.last = function(arr) { + if (arr.length > 0) { + return arr[arr.length - 1]; + } + return void 0; +}; + +exports.clone = clone; + +/*! + * ignore + */ + +exports.promiseOrCallback = promiseOrCallback; + +/*! + * ignore + */ + +exports.cloneArrays = function cloneArrays(arr) { + if (!Array.isArray(arr)) { + return arr; + } + + return arr.map(el => exports.cloneArrays(el)); +}; + +/*! + * ignore + */ + +exports.omit = function omit(obj, keys) { + if (keys == null) { + return Object.assign({}, obj); + } + if (!Array.isArray(keys)) { + keys = [keys]; + } + + const ret = Object.assign({}, obj); + for (const key of keys) { + delete ret[key]; + } + return ret; +}; + + +/*! + * Shallow copies defaults into options. + * + * @param {Object} defaults + * @param {Object} options + * @return {Object} the merged object + * @api private + */ + +exports.options = function(defaults, options) { + const keys = Object.keys(defaults); + let i = keys.length; + let k; + + options = options || {}; + + while (i--) { + k = keys[i]; + if (!(k in options)) { + options[k] = defaults[k]; + } + } + + return options; +}; + +/*! + * Merges `from` into `to` without overwriting existing properties. + * + * @param {Object} to + * @param {Object} from + * @api private + */ + +exports.merge = function merge(to, from, options, path) { + options = options || {}; + + const keys = Object.keys(from); + let i = 0; + const len = keys.length; + let key; + + if (from[trustedSymbol]) { + to[trustedSymbol] = from[trustedSymbol]; + } + + path = path || ''; + const omitNested = options.omitNested || {}; + + while (i < len) { + key = keys[i++]; + if (options.omit && options.omit[key]) { + continue; + } + if (omitNested[path]) { + continue; + } + if (specialProperties.has(key)) { + continue; + } + if (to[key] == null) { + to[key] = from[key]; + } else if (exports.isObject(from[key])) { + if (!exports.isObject(to[key])) { + to[key] = {}; + } + if (from[key] != null) { + // Skip merging schemas if we're creating a discriminator schema and + // base schema has a given path as a single nested but discriminator schema + // has the path as a document array, or vice versa (gh-9534) + if (options.isDiscriminatorSchemaMerge && + (from[key].$isSingleNested && to[key].$isMongooseDocumentArray) || + (from[key].$isMongooseDocumentArray && to[key].$isSingleNested)) { + continue; + } else if (from[key].instanceOfSchema) { + if (to[key].instanceOfSchema) { + schemaMerge(to[key], from[key].clone(), options.isDiscriminatorSchemaMerge); + } else { + to[key] = from[key].clone(); + } + continue; + } else if (isBsonType(from[key], 'ObjectID')) { + to[key] = new ObjectId(from[key]); + continue; + } + } + merge(to[key], from[key], options, path ? path + '.' + key : key); + } else if (options.overwrite) { + to[key] = from[key]; + } + } +}; + +/*! + * Applies toObject recursively. + * + * @param {Document|Array|Object} obj + * @return {Object} + * @api private + */ + +exports.toObject = function toObject(obj) { + Document || (Document = require('./document')); + let ret; + + if (obj == null) { + return obj; + } + + if (obj instanceof Document) { + return obj.toObject(); + } + + if (Array.isArray(obj)) { + ret = []; + + for (const doc of obj) { + ret.push(toObject(doc)); + } + + return ret; + } + + if (exports.isPOJO(obj)) { + ret = {}; + + if (obj[trustedSymbol]) { + ret[trustedSymbol] = obj[trustedSymbol]; + } + + for (const k of Object.keys(obj)) { + if (specialProperties.has(k)) { + continue; + } + ret[k] = toObject(obj[k]); + } + + return ret; + } + + return obj; +}; + +exports.isObject = isObject; + +/*! + * Determines if `arg` is a plain old JavaScript object (POJO). Specifically, + * `arg` must be an object but not an instance of any special class, like String, + * ObjectId, etc. + * + * `Object.getPrototypeOf()` is part of ES5: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/getPrototypeOf + * + * @param {Object|Array|String|Function|RegExp|any} arg + * @api private + * @return {Boolean} + */ + +exports.isPOJO = function isPOJO(arg) { + if (arg == null || typeof arg !== 'object') { + return false; + } + const proto = Object.getPrototypeOf(arg); + // Prototype may be null if you used `Object.create(null)` + // Checking `proto`'s constructor is safe because `getPrototypeOf()` + // explicitly crosses the boundary from object data to object metadata + return !proto || proto.constructor.name === 'Object'; +}; + +/*! + * Determines if `arg` is an object that isn't an instance of a built-in value + * class, like Array, Buffer, ObjectId, etc. + */ + +exports.isNonBuiltinObject = function isNonBuiltinObject(val) { + return typeof val === 'object' && + !exports.isNativeObject(val) && + !exports.isMongooseType(val) && + val != null; +}; + +/*! + * Determines if `obj` is a built-in object like an array, date, boolean, + * etc. + */ + +exports.isNativeObject = function(arg) { + return Array.isArray(arg) || + arg instanceof Date || + arg instanceof Boolean || + arg instanceof Number || + arg instanceof String; +}; + +/*! + * Determines if `val` is an object that has no own keys + */ + +exports.isEmptyObject = function(val) { + return val != null && + typeof val === 'object' && + Object.keys(val).length === 0; +}; + +/*! + * Search if `obj` or any POJOs nested underneath `obj` has a property named + * `key` + */ + +exports.hasKey = function hasKey(obj, key) { + const props = Object.keys(obj); + for (const prop of props) { + if (prop === key) { + return true; + } + if (exports.isPOJO(obj[prop]) && exports.hasKey(obj[prop], key)) { + return true; + } + } + return false; +}; + +/*! + * process.nextTick helper. + * + * Wraps `callback` in a try/catch + nextTick. + * + * node-mongodb-native has a habit of state corruption when an error is immediately thrown from within a collection callback. + * + * @param {Function} callback + * @api private + */ + +exports.tick = function tick(callback) { + if (typeof callback !== 'function') { + return; + } + return function() { + try { + callback.apply(this, arguments); + } catch (err) { + // only nextTick on err to get out of + // the event loop and avoid state corruption. + immediate(function() { + throw err; + }); + } + }; +}; + +/*! + * Returns true if `v` is an object that can be serialized as a primitive in + * MongoDB + */ + +exports.isMongooseType = function(v) { + return isBsonType(v, 'ObjectID') || isBsonType(v, 'Decimal128') || v instanceof Buffer; +}; + +exports.isMongooseObject = isMongooseObject; + +/*! + * Converts `expires` options of index objects to `expiresAfterSeconds` options for MongoDB. + * + * @param {Object} object + * @api private + */ + +exports.expires = function expires(object) { + if (!(object && object.constructor.name === 'Object')) { + return; + } + if (!('expires' in object)) { + return; + } + + object.expireAfterSeconds = (typeof object.expires !== 'string') + ? object.expires + : Math.round(ms(object.expires) / 1000); + delete object.expires; +}; + +/*! + * populate helper + */ + +exports.populate = function populate(path, select, model, match, options, subPopulate, justOne, count) { + // might have passed an object specifying all arguments + let obj = null; + if (arguments.length === 1) { + if (path instanceof PopulateOptions) { + // If reusing old populate docs, avoid reusing `_docs` because that may + // lead to bugs and memory leaks. See gh-11641 + path._docs = []; + path._childDocs = []; + return [path]; + } + + if (Array.isArray(path)) { + const singles = makeSingles(path); + return singles.map(o => exports.populate(o)[0]); + } + + if (exports.isObject(path)) { + obj = Object.assign({}, path); + } else { + obj = { path: path }; + } + } else if (typeof model === 'object') { + obj = { + path: path, + select: select, + match: model, + options: match + }; + } else { + obj = { + path: path, + select: select, + model: model, + match: match, + options: options, + populate: subPopulate, + justOne: justOne, + count: count + }; + } + + if (typeof obj.path !== 'string') { + throw new TypeError('utils.populate: invalid path. Expected string. Got typeof `' + typeof path + '`'); + } + + return _populateObj(obj); + + // The order of select/conditions args is opposite Model.find but + // necessary to keep backward compatibility (select could be + // an array, string, or object literal). + function makeSingles(arr) { + const ret = []; + arr.forEach(function(obj) { + if (/[\s]/.test(obj.path)) { + const paths = obj.path.split(' '); + paths.forEach(function(p) { + const copy = Object.assign({}, obj); + copy.path = p; + ret.push(copy); + }); + } else { + ret.push(obj); + } + }); + + return ret; + } +}; + +function _populateObj(obj) { + if (Array.isArray(obj.populate)) { + const ret = []; + obj.populate.forEach(function(obj) { + if (/[\s]/.test(obj.path)) { + const copy = Object.assign({}, obj); + const paths = copy.path.split(' '); + paths.forEach(function(p) { + copy.path = p; + ret.push(exports.populate(copy)[0]); + }); + } else { + ret.push(exports.populate(obj)[0]); + } + }); + obj.populate = exports.populate(ret); + } else if (obj.populate != null && typeof obj.populate === 'object') { + obj.populate = exports.populate(obj.populate); + } + + const ret = []; + const paths = obj.path.split(' '); + if (obj.options != null) { + obj.options = exports.clone(obj.options); + } + + for (const path of paths) { + ret.push(new PopulateOptions(Object.assign({}, obj, { path: path }))); + } + + return ret; +} + +/*! + * Return the value of `obj` at the given `path`. + * + * @param {String} path + * @param {Object} obj + */ + +exports.getValue = function(path, obj, map) { + return mpath.get(path, obj, '_doc', map); +}; + +/*! + * Sets the value of `obj` at the given `path`. + * + * @param {String} path + * @param {Anything} val + * @param {Object} obj + */ + +exports.setValue = function(path, val, obj, map, _copying) { + mpath.set(path, val, obj, '_doc', map, _copying); +}; + +/*! + * Returns an array of values from object `o`. + * + * @param {Object} o + * @return {Array} + * @private + */ + +exports.object = {}; +exports.object.vals = function vals(o) { + const keys = Object.keys(o); + let i = keys.length; + const ret = []; + + while (i--) { + ret.push(o[keys[i]]); + } + + return ret; +}; + +/*! + * @see exports.options + */ + +exports.object.shallowCopy = exports.options; + +/*! + * Safer helper for hasOwnProperty checks + * + * @param {Object} obj + * @param {String} prop + */ + +const hop = Object.prototype.hasOwnProperty; +exports.object.hasOwnProperty = function(obj, prop) { + return hop.call(obj, prop); +}; + +/*! + * Determine if `val` is null or undefined + * + * @return {Boolean} + */ + +exports.isNullOrUndefined = function(val) { + return val === null || val === undefined; +}; + +/*! + * ignore + */ + +exports.array = {}; + +/*! + * Flattens an array. + * + * [ 1, [ 2, 3, [4] ]] -> [1,2,3,4] + * + * @param {Array} arr + * @param {Function} [filter] If passed, will be invoked with each item in the array. If `filter` returns a falsy value, the item will not be included in the results. + * @return {Array} + * @private + */ + +exports.array.flatten = function flatten(arr, filter, ret) { + ret || (ret = []); + + arr.forEach(function(item) { + if (Array.isArray(item)) { + flatten(item, filter, ret); + } else { + if (!filter || filter(item)) { + ret.push(item); + } + } + }); + + return ret; +}; + +/*! + * ignore + */ + +const _hasOwnProperty = Object.prototype.hasOwnProperty; + +exports.hasUserDefinedProperty = function(obj, key) { + if (obj == null) { + return false; + } + + if (Array.isArray(key)) { + for (const k of key) { + if (exports.hasUserDefinedProperty(obj, k)) { + return true; + } + } + return false; + } + + if (_hasOwnProperty.call(obj, key)) { + return true; + } + if (typeof obj === 'object' && key in obj) { + const v = obj[key]; + return v !== Object.prototype[key] && v !== Array.prototype[key]; + } + + return false; +}; + +/*! + * ignore + */ + +const MAX_ARRAY_INDEX = Math.pow(2, 32) - 1; + +exports.isArrayIndex = function(val) { + if (typeof val === 'number') { + return val >= 0 && val <= MAX_ARRAY_INDEX; + } + if (typeof val === 'string') { + if (!/^\d+$/.test(val)) { + return false; + } + val = +val; + return val >= 0 && val <= MAX_ARRAY_INDEX; + } + + return false; +}; + +/*! + * Removes duplicate values from an array + * + * [1, 2, 3, 3, 5] => [1, 2, 3, 5] + * [ ObjectId("550988ba0c19d57f697dc45e"), ObjectId("550988ba0c19d57f697dc45e") ] + * => [ObjectId("550988ba0c19d57f697dc45e")] + * + * @param {Array} arr + * @return {Array} + * @private + */ + +exports.array.unique = function(arr) { + const primitives = new Set(); + const ids = new Set(); + const ret = []; + + for (const item of arr) { + if (typeof item === 'number' || typeof item === 'string' || item == null) { + if (primitives.has(item)) { + continue; + } + ret.push(item); + primitives.add(item); + } else if (isBsonType(item, 'ObjectID')) { + if (ids.has(item.toString())) { + continue; + } + ret.push(item); + ids.add(item.toString()); + } else { + ret.push(item); + } + } + + return ret; +}; + +/*! + * Determines if two buffers are equal. + * + * @param {Buffer} a + * @param {Object} b + */ + +exports.buffer = {}; +exports.buffer.areEqual = function(a, b) { + if (!Buffer.isBuffer(a)) { + return false; + } + if (!Buffer.isBuffer(b)) { + return false; + } + if (a.length !== b.length) { + return false; + } + for (let i = 0, len = a.length; i < len; ++i) { + if (a[i] !== b[i]) { + return false; + } + } + return true; +}; + +exports.getFunctionName = getFunctionName; +/*! + * Decorate buffers + */ + +exports.decorate = function(destination, source) { + for (const key in source) { + if (specialProperties.has(key)) { + continue; + } + destination[key] = source[key]; + } +}; + +/** + * merges to with a copy of from + * + * @param {Object} to + * @param {Object} fromObj + * @api private + */ + +exports.mergeClone = function(to, fromObj) { + if (isMongooseObject(fromObj)) { + fromObj = fromObj.toObject({ + transform: false, + virtuals: false, + depopulate: true, + getters: false, + flattenDecimals: false + }); + } + const keys = Object.keys(fromObj); + const len = keys.length; + let i = 0; + let key; + + while (i < len) { + key = keys[i++]; + if (specialProperties.has(key)) { + continue; + } + if (typeof to[key] === 'undefined') { + to[key] = exports.clone(fromObj[key], { + transform: false, + virtuals: false, + depopulate: true, + getters: false, + flattenDecimals: false + }); + } else { + let val = fromObj[key]; + if (val != null && val.valueOf && !(val instanceof Date)) { + val = val.valueOf(); + } + if (exports.isObject(val)) { + let obj = val; + if (isMongooseObject(val) && !val.isMongooseBuffer) { + obj = obj.toObject({ + transform: false, + virtuals: false, + depopulate: true, + getters: false, + flattenDecimals: false + }); + } + if (val.isMongooseBuffer) { + obj = Buffer.from(obj); + } + exports.mergeClone(to[key], obj); + } else { + to[key] = exports.clone(val, { + flattenDecimals: false + }); + } + } + } +}; + +/** + * Executes a function on each element of an array (like _.each) + * + * @param {Array} arr + * @param {Function} fn + * @api private + */ + +exports.each = function(arr, fn) { + for (const item of arr) { + fn(item); + } +}; + +/*! + * ignore + */ + +exports.getOption = function(name) { + const sources = Array.prototype.slice.call(arguments, 1); + + for (const source of sources) { + if (source == null) { + continue; + } + if (source[name] != null) { + return source[name]; + } + } + + return null; +}; + +/*! + * ignore + */ + +exports.noop = function() {}; + +exports.errorToPOJO = function errorToPOJO(error) { + const isError = error instanceof Error; + if (!isError) { + throw new Error('`error` must be `instanceof Error`.'); + } + + const ret = {}; + for (const properyName of Object.getOwnPropertyNames(error)) { + ret[properyName] = error[properyName]; + } + return ret; +}; + +/*! + * ignore + */ + +exports.warn = function warn(message) { + return process.emitWarning(message, { code: 'MONGOOSE' }); +}; diff --git a/node_modules/mongoose/lib/validoptions.js b/node_modules/mongoose/lib/validoptions.js new file mode 100644 index 000000000..0f7b697c4 --- /dev/null +++ b/node_modules/mongoose/lib/validoptions.js @@ -0,0 +1,35 @@ + +/*! + * Valid mongoose options + */ + +'use strict'; + +const VALID_OPTIONS = Object.freeze([ + 'allowDiskUse', + 'applyPluginsToChildSchemas', + 'applyPluginsToDiscriminators', + 'autoCreate', + 'autoIndex', + 'bufferCommands', + 'bufferTimeoutMS', + 'cloneSchemas', + 'debug', + 'timestamps.createdAt.immutable', + 'maxTimeMS', + 'objectIdGetter', + 'overwriteModels', + 'returnOriginal', + 'runValidators', + 'sanitizeFilter', + 'sanitizeProjection', + 'selectPopulatedPaths', + 'setDefaultsOnInsert', + 'strict', + 'strictPopulate', + 'strictQuery', + 'toJSON', + 'toObject' +]); + +module.exports = VALID_OPTIONS; diff --git a/node_modules/mongoose/lib/virtualtype.js b/node_modules/mongoose/lib/virtualtype.js new file mode 100644 index 000000000..fcc1187fa --- /dev/null +++ b/node_modules/mongoose/lib/virtualtype.js @@ -0,0 +1,177 @@ +'use strict'; + +const utils = require('./utils'); + +/** + * VirtualType constructor + * + * This is what mongoose uses to define virtual attributes via `Schema.prototype.virtual`. + * + * #### Example: + * + * const fullname = schema.virtual('fullname'); + * fullname instanceof mongoose.VirtualType // true + * + * @param {Object} options + * @param {string|function} [options.ref] if `ref` is not nullish, this becomes a [populated virtual](/docs/populate.html#populate-virtuals) + * @param {string|function} [options.localField] the local field to populate on if this is a populated virtual. + * @param {string|function} [options.foreignField] the foreign field to populate on if this is a populated virtual. + * @param {boolean} [options.justOne=false] by default, a populated virtual is an array. If you set `justOne`, the populated virtual will be a single doc or `null`. + * @param {boolean} [options.getters=false] if you set this to `true`, Mongoose will call any custom getters you defined on this virtual + * @param {boolean} [options.count=false] if you set this to `true`, `populate()` will set this virtual to the number of populated documents, as opposed to the documents themselves, using [`Query#countDocuments()`](./api.html#query_Query-countDocuments) + * @param {Object|Function} [options.match=null] add an extra match condition to `populate()` + * @param {Number} [options.limit=null] add a default `limit` to the `populate()` query + * @param {Number} [options.skip=null] add a default `skip` to the `populate()` query + * @param {Number} [options.perDocumentLimit=null] For legacy reasons, `limit` with `populate()` may give incorrect results because it only executes a single query for every document being populated. If you set `perDocumentLimit`, Mongoose will ensure correct `limit` per document by executing a separate query for each document to `populate()`. For example, `.find().populate({ path: 'test', perDocumentLimit: 2 })` will execute 2 additional queries if `.find()` returns 2 documents. + * @param {Object} [options.options=null] Additional options like `limit` and `lean`. + * @param {string} name + * @api public + */ + +function VirtualType(options, name) { + this.path = name; + this.getters = []; + this.setters = []; + this.options = Object.assign({}, options); +} + +/** + * If no getters/getters, add a default + * + * @param {Function} fn + * @return {VirtualType} this + * @api private + */ + +VirtualType.prototype._applyDefaultGetters = function() { + if (this.getters.length > 0 || this.setters.length > 0) { + return; + } + + const path = this.path; + const internalProperty = '$' + path; + this.getters.push(function() { + return this[internalProperty]; + }); + this.setters.push(function(v) { + this[internalProperty] = v; + }); +}; + +/*! + * ignore + */ + +VirtualType.prototype.clone = function() { + const clone = new VirtualType(this.options, this.path); + clone.getters = [].concat(this.getters); + clone.setters = [].concat(this.setters); + return clone; +}; + +/** + * Adds a custom getter to this virtual. + * + * Mongoose calls the getter function with the below 3 parameters. + * + * - `value`: the value returned by the previous getter. If there is only one getter, `value` will be `undefined`. + * - `virtual`: the virtual object you called `.get()` on + * - `doc`: the document this virtual is attached to. Equivalent to `this`. + * + * #### Example: + * + * const virtual = schema.virtual('fullname'); + * virtual.get(function(value, virtual, doc) { + * return this.name.first + ' ' + this.name.last; + * }); + * + * @param {Function(Any, VirtualType, Document)} fn + * @return {VirtualType} this + * @api public + */ + +VirtualType.prototype.get = function(fn) { + this.getters.push(fn); + return this; +}; + +/** + * Adds a custom setter to this virtual. + * + * Mongoose calls the setter function with the below 3 parameters. + * + * - `value`: the value being set + * - `virtual`: the virtual object you're calling `.set()` on + * - `doc`: the document this virtual is attached to. Equivalent to `this`. + * + * #### Example: + * + * const virtual = schema.virtual('fullname'); + * virtual.set(function(value, virtual, doc) { + * const parts = value.split(' '); + * this.name.first = parts[0]; + * this.name.last = parts[1]; + * }); + * + * const Model = mongoose.model('Test', schema); + * const doc = new Model(); + * // Calls the setter with `value = 'Jean-Luc Picard'` + * doc.fullname = 'Jean-Luc Picard'; + * doc.name.first; // 'Jean-Luc' + * doc.name.last; // 'Picard' + * + * @param {Function(Any, VirtualType, Document)} fn + * @return {VirtualType} this + * @api public + */ + +VirtualType.prototype.set = function(fn) { + this.setters.push(fn); + return this; +}; + +/** + * Applies getters to `value`. + * + * @param {Object} value + * @param {Document} doc The document this virtual is attached to + * @return {any} the value after applying all getters + * @api public + */ + +VirtualType.prototype.applyGetters = function(value, doc) { + if (utils.hasUserDefinedProperty(this.options, ['ref', 'refPath']) && + doc.$$populatedVirtuals && + doc.$$populatedVirtuals.hasOwnProperty(this.path)) { + value = doc.$$populatedVirtuals[this.path]; + } + + let v = value; + for (const getter of this.getters) { + v = getter.call(doc, v, this, doc); + } + return v; +}; + +/** + * Applies setters to `value`. + * + * @param {Object} value + * @param {Document} doc + * @return {any} the value after applying all setters + * @api public + */ + +VirtualType.prototype.applySetters = function(value, doc) { + let v = value; + for (const setter of this.setters) { + v = setter.call(doc, v, this, doc); + } + return v; +}; + +/*! + * exports + */ + +module.exports = VirtualType; diff --git a/node_modules/mongoose/package.json b/node_modules/mongoose/package.json new file mode 100644 index 000000000..5d9923fb9 --- /dev/null +++ b/node_modules/mongoose/package.json @@ -0,0 +1,148 @@ +{ + "name": "mongoose", + "description": "Mongoose MongoDB ODM", + "version": "6.4.0", + "author": "Guillermo Rauch ", + "keywords": [ + "mongodb", + "document", + "model", + "schema", + "database", + "odm", + "data", + "datastore", + "query", + "nosql", + "orm", + "db" + ], + "license": "MIT", + "dependencies": { + "bson": "^4.6.2", + "kareem": "2.4.1", + "mongodb": "4.7.0", + "mpath": "0.9.0", + "mquery": "4.0.3", + "ms": "2.1.3", + "sift": "16.0.0" + }, + "devDependencies": { + "@babel/core": "7.18.2", + "@typescript-eslint/eslint-plugin": "5.27.0", + "@typescript-eslint/parser": "5.27.0", + "acquit": "1.2.1", + "acquit-ignore": "0.2.0", + "acquit-require": "0.1.1", + "assert-browserify": "2.0.0", + "axios": "0.27.2", + "babel-loader": "8.2.5", + "benchmark": "2.1.4", + "bluebird": "3.7.2", + "buffer": "^5.6.0", + "cheerio": "1.0.0-rc.11", + "crypto-browserify": "3.12.0", + "dox": "0.3.1", + "eslint": "8.16.0", + "eslint-plugin-mocha-no-only": "1.1.1", + "highlight.js": "11.5.1", + "lodash.isequal": "4.5.0", + "lodash.isequalwith": "4.4.0", + "marked": "4.0.16", + "mkdirp": "^1.0.4", + "mocha": "10.0.0", + "moment": "2.x", + "mongodb-memory-server": "8.6.0", + "ncp": "^2.0.0", + "nyc": "15.1.0", + "pug": "3.0.2", + "q": "1.5.1", + "serve-handler": "6.1.3", + "sinon": "14.0.0", + "stream-browserify": "3.0.0", + "ts-benchmark": "^1.0.2", + "tsd": "0.20.0", + "typescript": "4.7.2", + "uuid": "8.3.2", + "webpack": "5.72.1" + }, + "directories": { + "lib": "./lib/mongoose" + }, + "scripts": { + "docs:clean": "npm run docs:clean:stable", + "docs:clean:stable": "rimraf index.html && rimraf -rf ./docs/*.html && rimraf -rf ./docs/api && rimraf -rf ./docs/tutorials/*.html && rimraf -rf ./docs/typescript/*.html && rimraf -rf ./docs/*.html && rimraf -rf ./docs/source/_docs && rimraf -rf ./tmp", + "docs:clean:legacy": "rimraf index.html && rimraf -rf ./docs/5.x && rimraf -rf ./docs/source/_docs && rimraf -rf ./tmp", + "docs:copy:tmp": "mkdirp ./tmp/docs/css && mkdirp ./tmp/docs/js && mkdirp ./tmp/docs/images && mkdirp ./tmp/docs/tutorials && mkdirp ./tmp/docs/typescript && ncp ./docs/css ./tmp/docs/css --filter=.css$ && ncp ./docs/js ./tmp/docs/js --filter=.js$ && ncp ./docs/images ./tmp/docs/images && ncp ./docs/tutorials ./tmp/docs/tutorials && ncp ./docs/typescript ./tmp/docs/typescript && cp index.html ./tmp", + "docs:copy:tmp:legacy": "rimraf ./docs/5.x && ncp ./tmp ./docs/5.x", + "docs:checkout:gh-pages": "git checkout gh-pages", + "docs:checkout:legacy": "git checkout 5.x", + "docs:generate": "node website.js", + "docs:generate:search": "node docs/search.js", + "docs:merge:stable": "git merge master", + "docs:merge:legacy": "git merge 5.x", + "docs:test": "npm run docs:generate && npm run docs:generate:search", + "docs:view": "node website.js && node static.js", + "docs:prepare:publish:stable": "npm run docs:checkout:gh-pages && npm run docs:merge:stable && npm run docs:clean:stable && npm run docs:generate && npm run docs:generate:search", + "docs:prepare:publish:legacy": "npm run docs:checkout:legacy && npm run docs:merge:legacy && npm run docs:clean:stable && npm run docs:generate && npm run docs:copy:tmp && docs:checkout:gh-pages && docs:copy:tmp:legacy", + "lint": "eslint .", + "lint-js": "eslint . --ext .js", + "lint-ts": "eslint . --ext .ts", + "build-browser": "node build-browser.js", + "prepublishOnly": "npm run build-browser", + "release": "git pull && git push origin master --tags && npm publish", + "release-legacy": "git pull origin 5.x && git push origin 5.x --tags && npm publish --tag legacy", + "mongo": "node ./tools/repl.js", + "test": "mocha --exit ./test/*.test.js", + "test-rs": "START_REPLICA_SET=1 mocha --timeout 30000 --exit ./test/*.test.js", + "test-tsd": "node ./test/types/check-types-filename && tsd", + "tdd": "mocha ./test/*.test.js --inspect --watch --recursive --watch-files ./**/*.{js,ts}", + "test-coverage": "nyc --reporter=html --reporter=text npm test", + "ts-benchmark": "ts-benchmark -p ./benchmarks/typescript/simple -f 17 18 29 32", + "ts-benchmark-watch": "ts-benchmark -p ./benchmarks/typescript/simple -w ./types -i -s -f 17 18 29 32 -b master" + }, + "main": "./index.js", + "types": "./types/index.d.ts", + "engines": { + "node": ">=12.0.0" + }, + "bugs": { + "url": "https://github.com/Automattic/mongoose/issues/new" + }, + "repository": { + "type": "git", + "url": "git://github.com/Automattic/mongoose.git" + }, + "homepage": "https://mongoosejs.com", + "browser": "./dist/browser.umd.js", + "mocha": { + "extension": [ + "test.js" + ], + "watch-files": [ + "test/**/*.js" + ] + }, + "config": { + "mongodbMemoryServer": { + "disablePostinstall": true + } + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/mongoose" + }, + "tsd": { + "directory": "test/types", + "compilerOptions": { + "esModuleInterop": false, + "strict": true, + "allowSyntheticDefaultImports": true, + "strictPropertyInitialization": false, + "noImplicitAny": false, + "strictNullChecks": true, + "module": "commonjs", + "target": "ES2017" + } + } +} \ No newline at end of file diff --git a/node_modules/mongoose/tools/auth.js b/node_modules/mongoose/tools/auth.js new file mode 100644 index 000000000..2fddafaf7 --- /dev/null +++ b/node_modules/mongoose/tools/auth.js @@ -0,0 +1,31 @@ +'use strict'; + +const Server = require('mongodb-topology-manager').Server; +const mongodb = require('mongodb'); + +run().catch(error => { + console.error(error); + process.exit(-1); +}); + +async function run() { + // Create new instance + const server = new Server('mongod', { + auth: null, + dbpath: '/data/db/27017' + }); + + // Purge the directory + await server.purge(); + + // Start process + await server.start(); + + const db = await mongodb.MongoClient.connect('mongodb://localhost:27017/admin'); + + await db.addUser('passwordIsTaco', 'taco', { + roles: ['dbOwner'] + }); + + console.log('done'); +} \ No newline at end of file diff --git a/node_modules/mongoose/tools/repl.js b/node_modules/mongoose/tools/repl.js new file mode 100644 index 000000000..bc3d2695a --- /dev/null +++ b/node_modules/mongoose/tools/repl.js @@ -0,0 +1,35 @@ +'use strict'; + +run().catch(error => { + console.error(error); + process.exit(-1); +}); + +async function run() { + const ReplSet = require('mongodb-memory-server').MongoMemoryReplSet; + + // Create new instance + const replSet = new ReplSet({ + binary: { + version: process.argv[2] + }, + instanceOpts: [ + // Set the expiry job in MongoDB to run every second + { + port: 27017, + args: ['--setParameter', 'ttlMonitorSleepSecs=1'] + } + ], + dbName: 'mongoose_test', + replSet: { + name: 'rs0', + count: 2, + storageEngine: 'wiredTiger' + } + }); + + await replSet.start(); + await replSet.waitUntilRunning(); + console.log('MongoDB-ReplicaSet is now running.'); + console.log(replSet.getUri('mongoose_test')); +} diff --git a/node_modules/mongoose/tools/sharded.js b/node_modules/mongoose/tools/sharded.js new file mode 100644 index 000000000..39aeed3d5 --- /dev/null +++ b/node_modules/mongoose/tools/sharded.js @@ -0,0 +1,46 @@ +'use strict'; + +run().catch(error => { + console.error(error); + process.exit(-1); +}); + + +async function run() { + const Sharded = require('mongodb-topology-manager').Sharded; + + // Create new instance + const topology = new Sharded({ + mongod: 'mongod', + mongos: 'mongos' + }); + + await topology.addShard([{ + options: { + bind_ip: 'localhost', port: 31000, dbpath: '/data/db/31000', shardsvr: null + } + }], { replSet: 'rs1' }); + + await topology.addConfigurationServers([{ + options: { + bind_ip: 'localhost', port: 35000, dbpath: '/data/db/35000' + } + }], { replSet: 'rs0' }); + + await topology.addProxies([{ + bind_ip: 'localhost', port: 51000, configdb: 'localhost:35000' + }], { + binary: 'mongos' + }); + + console.log('Start...'); + // Start up topology + await topology.start(); + + console.log('Started'); + + // Shard db + await topology.enableSharding('test'); + + console.log('done'); +} \ No newline at end of file diff --git a/node_modules/mongoose/tsconfig.json b/node_modules/mongoose/tsconfig.json new file mode 100644 index 000000000..10f087f4b --- /dev/null +++ b/node_modules/mongoose/tsconfig.json @@ -0,0 +1,9 @@ +{ + "compilerOptions": { + "strict": true, + "strictNullChecks": true, + "paths": { + "mongoose" : ["./types/index.d.ts"] + } + } +} diff --git a/node_modules/mongoose/types/aggregate.d.ts b/node_modules/mongoose/types/aggregate.d.ts new file mode 100644 index 000000000..be5237e70 --- /dev/null +++ b/node_modules/mongoose/types/aggregate.d.ts @@ -0,0 +1,224 @@ +declare module 'mongoose' { + import mongodb = require('mongodb'); + + /** Extract generic type from Aggregate class */ + type AggregateExtract

= P extends Aggregate ? T : never; + + interface AggregateOptions extends + SessionOption { + /** + * If true, the MongoDB server will use the hard drive to store data during this aggregation. + */ + allowDiskUse?: boolean; + /** + * Applicable only if you specify the $out or $merge aggregation stages. + * + * Enables db.collection.aggregate() to bypass document validation during the operation. This lets you insert documents that do not meet the validation requirements. + */ + bypassDocumentValidation?: boolean; + /** + * The BSON-serializer will check if keys are valid + */ + collation?: mongodb.CollationOptions; + /** + * Users can specify an arbitrary string to help trace the operation through the database profiler, currentOp, and logs. + */ + comment?: string; + /** + * Specifies the initial batch size for the cursor. The value of the cursor field is a document with the field batchSize. + */ + cursor?: { batchSize?: number; }; + /** + * Specifies to return the information on the processing of the pipeline. See Return Information on Aggregation Pipeline Operation for an example. + * + * Not available in multi-document transactions. + */ + explain?: mongodb.ExplainVerbosityLike; + /** + * The index to use for the aggregation. The index is on the initial collection/view against which the aggregation is run. + */ + hint?: string | AnyObject; + /** + * Specifies a document with a list of variables. This allows you to improve command readability by separating the variables from the query text. + */ + let?: AnyObject; + /** + * Specifies a time limit in milliseconds for processing operations on a cursor. If you do not specify a value for maxTimeMS, operations will not time out. A value of 0 explicitly specifies the default unbounded behavior. + * + * @see https://docs.mongodb.com/manual/reference/operator/meta/maxTimeMS/ + */ + maxTimeMS?: number; + /** + * Return BSON filled buffers from operations. + */ + raw?: boolean; + /** + * Specifies the read concern. + */ + readConcern?: mongodb.ReadConcernLike; + /** + * The preferred read preference. + */ + readPreference?: mongodb.ReadPreferenceLike; + /** + * Specifies the write concern. + */ + writeConcern?: mongodb.WriteConcern; + [key: string]: any; + } + + class Aggregate implements SessionOperation { + /** + * Returns an asyncIterator for use with [`for/await/of` loops](https://thecodebarbarian.com/getting-started-with-async-iterators-in-node-js + * You do not need to call this function explicitly, the JavaScript runtime + * will call it for you. + */ + [Symbol.asyncIterator](): AsyncIterableIterator>; + + options: AggregateOptions; + + /** + * Sets an option on this aggregation. This function will be deprecated in a + * future release. + * + * @deprecated + */ + addCursorFlag(flag: CursorFlag, value: boolean): this; + + /** + * Appends a new $addFields operator to this aggregate pipeline. + * Requires MongoDB v3.4+ to work + */ + addFields(arg: PipelineStage.AddFields['$addFields']): this; + + /** Sets the allowDiskUse option for the aggregation query (ignored for < 2.6.0) */ + allowDiskUse(value: boolean): this; + + /** Appends new operators to this aggregate pipeline */ + append(...args: PipelineStage[]): this; + + /** + * Executes the query returning a `Promise` which will be + * resolved with either the doc(s) or rejected with the error. + * Like [`.then()`](#query_Query-then), but only takes a rejection handler. + */ + catch: Promise['catch']; + + /** Set the collation. */ + collation(options: mongodb.CollationOptions): this; + + /** Appends a new $count operator to this aggregate pipeline. */ + count(fieldName: PipelineStage.Count['$count']): this; + + /** + * Sets the cursor option for the aggregation query (ignored for < 2.6.0). + */ + cursor(options?: Record): Cursor; + + /** Executes the aggregate pipeline on the currently bound Model. */ + exec(callback: Callback): void; + exec(): Promise; + + /** Execute the aggregation with explain */ + explain(verbosity: mongodb.ExplainVerbosityLike, callback: Callback): void; + explain(verbosity: mongodb.ExplainVerbosityLike): Promise; + explain(callback: Callback): void; + explain(): Promise; + + /** Combines multiple aggregation pipelines. */ + facet(options: PipelineStage.Facet['$facet']): this; + + /** Appends new custom $graphLookup operator(s) to this aggregate pipeline, performing a recursive search on a collection. */ + graphLookup(options: PipelineStage.GraphLookup['$graphLookup']): this; + + /** Appends new custom $group operator to this aggregate pipeline. */ + group(arg: PipelineStage.Group['$group']): this; + + /** Sets the hint option for the aggregation query (ignored for < 3.6.0) */ + hint(value: Record | string): this; + + /** + * Appends a new $limit operator to this aggregate pipeline. + * @param num maximum number of records to pass to the next stage + */ + limit(num: PipelineStage.Limit['$limit']): this; + + /** Appends new custom $lookup operator to this aggregate pipeline. */ + lookup(options: PipelineStage.Lookup['$lookup']): this; + + /** + * Appends a new custom $match operator to this aggregate pipeline. + * @param arg $match operator contents + */ + match(arg: PipelineStage.Match['$match']): this; + + /** + * Binds this aggregate to a model. + * @param model the model to which the aggregate is to be bound + */ + model(model: Model): this; + + /** + * Append a new $near operator to this aggregation pipeline + * @param arg $near operator contents + */ + near(arg: { near?: number[]; distanceField: string; maxDistance?: number; query?: Record; includeLocs?: string; num?: number; uniqueDocs?: boolean }): this; + + /** Returns the current pipeline */ + pipeline(): PipelineStage[]; + + /** Appends a new $project operator to this aggregate pipeline. */ + project(arg: PipelineStage.Project['$project']): this; + + /** Sets the readPreference option for the aggregation query. */ + read(pref: mongodb.ReadPreferenceLike): this; + + /** Sets the readConcern level for the aggregation query. */ + readConcern(level: string): this; + + /** Appends a new $redact operator to this aggregate pipeline. */ + redact(expression: PipelineStage.Redact['$redact'], thenExpr: '$$DESCEND' | '$$PRUNE' | '$$KEEP' | AnyObject, elseExpr: '$$DESCEND' | '$$PRUNE' | '$$KEEP' | AnyObject): this; + + /** Appends a new $replaceRoot operator to this aggregate pipeline. */ + replaceRoot(newRoot: PipelineStage.ReplaceRoot['$replaceRoot']['newRoot'] | string): this; + + /** + * Helper for [Atlas Text Search](https://docs.atlas.mongodb.com/reference/atlas-search/tutorial/)'s + * `$search` stage. + */ + search(options: PipelineStage.Search['$search']): this; + + /** Lets you set arbitrary options, for middlewares or plugins. */ + option(value: AggregateOptions): this; + + /** Appends new custom $sample operator to this aggregate pipeline. */ + sample(arg: PipelineStage.Sample['$sample']['size']): this; + + /** Sets the session for this aggregation. Useful for [transactions](/docs/transactions.html). */ + session(session: mongodb.ClientSession | null): this; + + /** + * Appends a new $skip operator to this aggregate pipeline. + * @param num number of records to skip before next stage + */ + skip(num: PipelineStage.Skip['$skip']): this; + + /** Appends a new $sort operator to this aggregate pipeline. */ + sort(arg: string | Record | PipelineStage.Sort['$sort']): this; + + /** Provides promise for aggregate. */ + then: Promise['then']; + + /** + * Appends a new $sortByCount operator to this aggregate pipeline. Accepts either a string field name + * or a pipeline object. + */ + sortByCount(arg: string | PipelineStage.SortByCount['$sortByCount']): this; + + /** Appends new $unionWith operator to this aggregate pipeline. */ + unionWith(options: PipelineStage.UnionWith['$unionWith']): this; + + /** Appends new custom $unwind operator(s) to this aggregate pipeline. */ + unwind(...args: PipelineStage.Unwind['$unwind'][]): this; + } +} diff --git a/node_modules/mongoose/types/callback.d.ts b/node_modules/mongoose/types/callback.d.ts new file mode 100644 index 000000000..370379ab4 --- /dev/null +++ b/node_modules/mongoose/types/callback.d.ts @@ -0,0 +1,8 @@ +declare module 'mongoose' { + type CallbackError = NativeError | null; + + type Callback = (error: CallbackError, result: T) => void; + + type CallbackWithoutResult = (error: CallbackError) => void; + type CallbackWithoutResultAndOptionalError = (error?: CallbackError) => void; +} diff --git a/node_modules/mongoose/types/collection.d.ts b/node_modules/mongoose/types/collection.d.ts new file mode 100644 index 000000000..4eb0b13e4 --- /dev/null +++ b/node_modules/mongoose/types/collection.d.ts @@ -0,0 +1,46 @@ +declare module 'mongoose' { + import mongodb = require('mongodb'); + + /* + * section collection.js + * http://mongoosejs.com/docs/api.html#collection-js + */ + interface CollectionBase extends mongodb.Collection { + /* + * Abstract methods. Some of these are already defined on the + * mongodb.Collection interface so they've been commented out. + */ + ensureIndex(...args: any[]): any; + findAndModify(...args: any[]): any; + getIndexes(...args: any[]): any; + + /** The collection name */ + collectionName: string; + /** The Connection instance */ + conn: Connection; + /** The collection name */ + name: string; + } + + /* + * section drivers/node-mongodb-native/collection.js + * http://mongoosejs.com/docs/api.html#drivers-node-mongodb-native-collection-js + */ + interface Collection extends CollectionBase { + /** + * Collection constructor + * @param name name of the collection + * @param conn A MongooseConnection instance + * @param opts optional collection options + */ + // eslint-disable-next-line @typescript-eslint/no-misused-new + new(name: string, conn: Connection, opts?: any): Collection; + /** Formatter for debug print args */ + $format(arg: any, color?: boolean, shell?: boolean): string; + /** Debug print helper */ + $print(name: string, i: string | number, args: any[], color?: boolean, shell?: boolean): void; + /** Retrieves information about this collections indexes. */ + getIndexes(): ReturnType['indexInformation']>; + } + let Collection: Collection; +} \ No newline at end of file diff --git a/node_modules/mongoose/types/connection.d.ts b/node_modules/mongoose/types/connection.d.ts new file mode 100644 index 000000000..ac8594e5f --- /dev/null +++ b/node_modules/mongoose/types/connection.d.ts @@ -0,0 +1,236 @@ +declare module 'mongoose' { + import mongodb = require('mongodb'); + import events = require('events'); + + /** The Mongoose module's default connection. Equivalent to `mongoose.connections[0]`, see [`connections`](#mongoose_Mongoose-connections). */ + const connection: Connection; + + /** An array containing all connections associated with this Mongoose instance. */ + const connections: Connection[]; + + /** Opens Mongoose's default connection to MongoDB, see [connections docs](https://mongoosejs.com/docs/connections.html) */ + function connect(uri: string, options: ConnectOptions, callback: CallbackWithoutResult): void; + function connect(uri: string, callback: CallbackWithoutResult): void; + function connect(uri: string, options?: ConnectOptions): Promise; + + /** Creates a Connection instance. */ + function createConnection(uri: string, options: ConnectOptions, callback: Callback): void; + function createConnection(uri: string, callback: Callback): void; + function createConnection(uri: string, options?: ConnectOptions): Connection; + function createConnection(): Connection; + + function disconnect(callback: CallbackWithoutResult): void; + function disconnect(): Promise; + + /** + * Connection ready state + * + * - 0 = disconnected + * - 1 = connected + * - 2 = connecting + * - 3 = disconnecting + * - 99 = uninitialized + */ + enum ConnectionStates { + disconnected = 0, + connected = 1, + connecting = 2, + disconnecting = 3, + uninitialized = 99, + } + + /** Expose connection states for user-land */ + const STATES: typeof ConnectionStates; + + interface ConnectOptions extends mongodb.MongoClientOptions { + /** Set to false to [disable buffering](http://mongoosejs.com/docs/faq.html#callback_never_executes) on all models associated with this connection. */ + bufferCommands?: boolean; + /** The name of the database you want to use. If not provided, Mongoose uses the database name from connection string. */ + dbName?: string; + /** username for authentication, equivalent to `options.auth.user`. Maintained for backwards compatibility. */ + user?: string; + /** password for authentication, equivalent to `options.auth.password`. Maintained for backwards compatibility. */ + pass?: string; + /** Set to false to disable automatic index creation for all models associated with this connection. */ + autoIndex?: boolean; + /** Set to `true` to make Mongoose automatically call `createCollection()` on every model created on this connection. */ + autoCreate?: boolean; + } + + class Connection extends events.EventEmitter implements SessionStarter { + /** Returns a promise that resolves when this connection successfully connects to MongoDB */ + asPromise(): Promise; + + /** Closes the connection */ + close(force: boolean, callback: CallbackWithoutResult): void; + close(callback: CallbackWithoutResult): void; + close(force?: boolean): Promise; + + /** Closes and destroys the connection. Connection once destroyed cannot be reopened */ + destroy(force: boolean, callback: CallbackWithoutResult): void; + destroy(callback: CallbackWithoutResult): void; + destroy(force?: boolean): Promise; + + /** Retrieves a collection, creating it if not cached. */ + collection(name: string, options?: mongodb.CreateCollectionOptions): Collection; + + /** A hash of the collections associated with this connection */ + readonly collections: { [index: string]: Collection }; + + /** A hash of the global options that are associated with this connection */ + readonly config: any; + + /** The mongodb.Db instance, set when the connection is opened */ + readonly db: mongodb.Db; + + /** + * Helper for `createCollection()`. Will explicitly create the given collection + * with specified options. Used to create [capped collections](https://docs.mongodb.com/manual/core/capped-collections/) + * and [views](https://docs.mongodb.com/manual/core/views/) from mongoose. + */ + createCollection(name: string, options: mongodb.CreateCollectionOptions, callback: Callback>): void; + createCollection(name: string, callback: Callback>): void; + createCollection(name: string, options?: mongodb.CreateCollectionOptions): Promise>; + + /** + * Removes the model named `name` from this connection, if it exists. You can + * use this function to clean up any models you created in your tests to + * prevent OverwriteModelErrors. + */ + deleteModel(name: string | RegExp): this; + + /** + * Helper for `dropCollection()`. Will delete the given collection, including + * all documents and indexes. + */ + dropCollection(collection: string, callback: CallbackWithoutResult): void; + dropCollection(collection: string): Promise; + + /** + * Helper for `dropDatabase()`. Deletes the given database, including all + * collections, documents, and indexes. + */ + dropDatabase(callback: CallbackWithoutResult): void; + dropDatabase(): Promise; + + /** Gets the value of the option `key`. */ + get(key: string): any; + + /** + * Returns the [MongoDB driver `MongoClient`](http://mongodb.github.io/node-mongodb-native/3.5/api/MongoClient.html) instance + * that this connection uses to talk to MongoDB. + */ + getClient(): mongodb.MongoClient; + + /** + * The host name portion of the URI. If multiple hosts, such as a replica set, + * this will contain the first host name in the URI + */ + readonly host: string; + + /** + * A number identifier for this connection. Used for debugging when + * you have [multiple connections](/docs/connections.html#multiple_connections). + */ + readonly id: number; + + /** + * A [POJO](https://masteringjs.io/tutorials/fundamentals/pojo) containing + * a map from model names to models. Contains all models that have been + * added to this connection using [`Connection#model()`](/docs/api/connection.html#connection_Connection-model). + */ + readonly models: Readonly<{ [index: string]: Model }>; + + /** Defines or retrieves a model. */ + model( + name: string, + schema?: Schema, + collection?: string, + options?: CompileModelOptions + ): U; + model(name: string, schema?: Schema, collection?: string, options?: CompileModelOptions): Model; + + /** Returns an array of model names created on this connection. */ + modelNames(): Array; + + /** The name of the database this connection points to. */ + readonly name: string; + + /** Opens the connection with a URI using `MongoClient.connect()`. */ + openUri(uri: string, options: ConnectOptions, callback: Callback): Connection; + openUri(uri: string, callback: Callback): Connection; + openUri(uri: string, options?: ConnectOptions): Promise; + + /** The password specified in the URI */ + readonly pass: string; + + /** + * The port portion of the URI. If multiple hosts, such as a replica set, + * this will contain the port from the first host name in the URI. + */ + readonly port: number; + + /** Declares a plugin executed on all schemas you pass to `conn.model()` */ + plugin(fn: (schema: S, opts?: any) => void, opts?: O): Connection; + + /** The plugins that will be applied to all models created on this connection. */ + plugins: Array; + + /** + * Connection ready state + * + * - 0 = disconnected + * - 1 = connected + * - 2 = connecting + * - 3 = disconnecting + * - 99 = uninitialized + */ + readonly readyState: ConnectionStates; + + /** Sets the value of the option `key`. */ + set(key: string, value: any): any; + + /** + * Set the [MongoDB driver `MongoClient`](http://mongodb.github.io/node-mongodb-native/3.5/api/MongoClient.html) instance + * that this connection uses to talk to MongoDB. This is useful if you already have a MongoClient instance, and want to + * reuse it. + */ + setClient(client: mongodb.MongoClient): this; + + /** + * _Requires MongoDB >= 3.6.0._ Starts a [MongoDB session](https://docs.mongodb.com/manual/release-notes/3.6/#client-sessions) + * for benefits like causal consistency, [retryable writes](https://docs.mongodb.com/manual/core/retryable-writes/), + * and [transactions](http://thecodebarbarian.com/a-node-js-perspective-on-mongodb-4-transactions.html). + */ + startSession(options: ClientSessionOptions | undefined | null, callback: Callback): void; + startSession(callback: Callback): void; + startSession(options?: ClientSessionOptions): Promise; + + /** + * Makes the indexes in MongoDB match the indexes defined in every model's + * schema. This function will drop any indexes that are not defined in + * the model's schema except the `_id` index, and build any indexes that + * are in your schema but not in MongoDB. + */ + syncIndexes(options: SyncIndexesOptions | undefined | null, callback: Callback): void; + syncIndexes(options?: SyncIndexesOptions): Promise; + + /** + * _Requires MongoDB >= 3.6.0._ Executes the wrapped async function + * in a transaction. Mongoose will commit the transaction if the + * async function executes successfully and attempt to retry if + * there was a retryable error. + */ + transaction(fn: (session: mongodb.ClientSession) => Promise, options?: mongodb.TransactionOptions): Promise; + + /** Switches to a different database using the same connection pool. */ + useDb(name: string, options?: { useCache?: boolean, noListener?: boolean }): Connection; + + /** The username specified in the URI */ + readonly user: string; + + /** Watches the entire underlying database for changes. Similar to [`Model.watch()`](/docs/api/model.html#model_Model.watch). */ + watch(pipeline?: Array, options?: mongodb.ChangeStreamOptions): mongodb.ChangeStream; + } + +} diff --git a/node_modules/mongoose/types/cursor.d.ts b/node_modules/mongoose/types/cursor.d.ts new file mode 100644 index 000000000..9042818e4 --- /dev/null +++ b/node_modules/mongoose/types/cursor.d.ts @@ -0,0 +1,55 @@ +declare module 'mongoose' { + + import stream = require('stream'); + + type CursorFlag = 'tailable' | 'oplogReplay' | 'noCursorTimeout' | 'awaitData' | 'partial'; + + interface EachAsyncOptions { + parallel?: number; + batchSize?: number; + continueOnError?: boolean; + } + + class Cursor extends stream.Readable { + [Symbol.asyncIterator](): AsyncIterableIterator; + + /** + * Adds a [cursor flag](http://mongodb.github.io/node-mongodb-native/2.2/api/Cursor.html#addCursorFlag). + * Useful for setting the `noCursorTimeout` and `tailable` flags. + */ + addCursorFlag(flag: CursorFlag, value: boolean): this; + + /** + * Marks this cursor as closed. Will stop streaming and subsequent calls to + * `next()` will error. + */ + close(callback: CallbackWithoutResult): void; + close(): Promise; + + /** + * Execute `fn` for every document(s) in the cursor. If batchSize is provided + * `fn` will be executed for each batch of documents. If `fn` returns a promise, + * will wait for the promise to resolve before iterating on to the next one. + * Returns a promise that resolves when done. + */ + eachAsync(fn: (doc: DocType[]) => any, options: EachAsyncOptions & { batchSize: number }, callback: CallbackWithoutResult): void; + eachAsync(fn: (doc: DocType) => any, options: EachAsyncOptions, callback: CallbackWithoutResult): void; + eachAsync(fn: (doc: DocType[]) => any, options: EachAsyncOptions & { batchSize: number }): Promise; + eachAsync(fn: (doc: DocType) => any, options?: EachAsyncOptions): Promise; + + /** + * Registers a transform function which subsequently maps documents retrieved + * via the streams interface or `.next()` + */ + map(fn: (res: DocType) => ResultType): Cursor; + + /** + * Get the next document from this cursor. Will return `null` when there are + * no documents left. + */ + next(callback: Callback): void; + next(): Promise; + + options: Options; + } +} diff --git a/node_modules/mongoose/types/document.d.ts b/node_modules/mongoose/types/document.d.ts new file mode 100644 index 000000000..2316e3e5d --- /dev/null +++ b/node_modules/mongoose/types/document.d.ts @@ -0,0 +1,253 @@ +declare module 'mongoose' { + import mongodb = require('mongodb'); + + /** A list of paths to skip. If set, Mongoose will validate every modified path that is not in this list. */ + type pathsToSkip = string[] | string; + + /** + * Generic types for Document: + * * T - the type of _id + * * TQueryHelpers - Object with any helpers that should be mixed into the Query type + * * DocType - the type of the actual Document created + */ + class Document { + constructor(doc?: any); + + /** This documents _id. */ + _id?: T; + + /** This documents __v. */ + __v?: any; + + /** Assert that a given path or paths is populated. Throws an error if not populated. */ + $assertPopulated(paths: string | string[]): Omit & Paths; + + /* Get all subdocs (by bfs) */ + $getAllSubdocs(): Document[]; + + /** Don't run validation on this path or persist changes to this path. */ + $ignore(path: string): void; + + /** Checks if a path is set to its default. */ + $isDefault(path: string): boolean; + + /** Getter/setter, determines whether the document was removed or not. */ + $isDeleted(val?: boolean): boolean; + + /** Returns an array of all populated documents associated with the query */ + $getPopulatedDocs(): Document[]; + + /** + * Returns true if the given path is nullish or only contains empty objects. + * Useful for determining whether this subdoc will get stripped out by the + * [minimize option](/docs/guide.html#minimize). + */ + $isEmpty(path: string): boolean; + + /** Checks if a path is invalid */ + $isValid(path: string): boolean; + + /** + * Empty object that you can use for storing properties on the document. This + * is handy for passing data to middleware without conflicting with Mongoose + * internals. + */ + $locals: Record; + + /** Marks a path as valid, removing existing validation errors. */ + $markValid(path: string): void; + + /** Returns the model with the given name on this document's associated connection. */ + $model>(name: string): ModelType; + + /** + * A string containing the current operation that Mongoose is executing + * on this document. Can be `null`, `'save'`, `'validate'`, or `'remove'`. + */ + $op: 'save' | 'validate' | 'remove' | null; + + /** + * Getter/setter around the session associated with this document. Used to + * automatically set `session` if you `save()` a doc that you got from a + * query with an associated session. + */ + $session(session?: ClientSession | null): ClientSession | null; + + /** Alias for `set()`, used internally to avoid conflicts */ + $set(path: string, val: any, type: any, options?: any): this; + $set(path: string, val: any, options?: any): this; + $set(value: any): this; + + /** Set this property to add additional query filters when Mongoose saves this document and `isNew` is false. */ + $where: Record; + + /** If this is a discriminator model, `baseModelName` is the name of the base model. */ + baseModelName?: string; + + /** Collection the model uses. */ + collection: Collection; + + /** Connection the model uses. */ + db: Connection; + + /** Removes this document from the db. */ + delete(options: QueryOptions, callback: Callback): void; + delete(callback: Callback): void; + delete(options?: QueryOptions): QueryWithHelpers; + + /** Removes this document from the db. */ + deleteOne(options: QueryOptions, callback: Callback): void; + deleteOne(callback: Callback): void; + deleteOne(options?: QueryOptions): QueryWithHelpers; + + /** + * Takes a populated field and returns it to its unpopulated state. If called with + * no arguments, then all populated fields are returned to their unpopulated state. + */ + depopulate(path?: string | string[]): this; + + /** + * Returns the list of paths that have been directly modified. A direct + * modified path is a path that you explicitly set, whether via `doc.foo = 'bar'`, + * `Object.assign(doc, { foo: 'bar' })`, or `doc.set('foo', 'bar')`. + */ + directModifiedPaths(): Array; + + /** + * Returns true if this document is equal to another document. + * + * Documents are considered equal when they have matching `_id`s, unless neither + * document has an `_id`, in which case this function falls back to using + * `deepEqual()`. + */ + equals(doc: Document): boolean; + + /** Returns the current validation errors. */ + errors?: Error.ValidationError; + + /** Returns the value of a path. */ + get(path: string, type?: any, options?: any): any; + + /** + * Returns the changes that happened to the document + * in the format that will be sent to MongoDB. + */ + getChanges(): UpdateQuery; + + /** The string version of this documents _id. */ + id?: any; + + /** Signal that we desire an increment of this documents version. */ + increment(): this; + + /** + * Initializes the document without setters or marking anything modified. + * Called internally after a document is returned from mongodb. Normally, + * you do **not** need to call this function on your own. + */ + init(obj: AnyObject, opts?: AnyObject, callback?: Callback): this; + + /** Marks a path as invalid, causing validation to fail. */ + invalidate(path: string, errorMsg: string | NativeError, value?: any, kind?: string): NativeError | null; + + /** Returns true if `path` was directly set and modified, else false. */ + isDirectModified(path: string): boolean; + + /** Checks if `path` was explicitly selected. If no projection, always returns true. */ + isDirectSelected(path: string): boolean; + + /** Checks if `path` is in the `init` state, that is, it was set by `Document#init()` and not modified since. */ + isInit(path: string): boolean; + + /** + * Returns true if any of the given paths are modified, else false. If no arguments, returns `true` if any path + * in this document is modified. + */ + isModified(path?: string | Array): boolean; + + /** Boolean flag specifying if the document is new. */ + isNew: boolean; + + /** Checks if `path` was selected in the source query which initialized this document. */ + isSelected(path: string): boolean; + + /** Marks the path as having pending changes to write to the db. */ + markModified(path: string, scope?: any): void; + + /** Returns the list of paths that have been modified. */ + modifiedPaths(options?: { includeChildren?: boolean }): Array; + + /** The name of the model */ + modelName: string; + + /** + * Overwrite all values in this document with the values of `obj`, except + * for immutable properties. Behaves similarly to `set()`, except for it + * unsets all properties that aren't in `obj`. + */ + overwrite(obj: AnyObject): this; + + /** + * If this document is a subdocument or populated document, returns the + * document's parent. Returns undefined otherwise. + */ + $parent(): Document | undefined; + + /** Populates document references. */ + populate(path: string | PopulateOptions | (string | PopulateOptions)[]): Promise; + populate(path: string | PopulateOptions | (string | PopulateOptions)[], callback: Callback): void; + populate(path: string, select?: string | AnyObject, model?: Model, match?: AnyObject, options?: PopulateOptions): Promise; + populate(path: string, select?: string | AnyObject, model?: Model, match?: AnyObject, options?: PopulateOptions, callback?: Callback): void; + + /** Gets _id(s) used during population of the given `path`. If the path was not populated, returns `undefined`. */ + populated(path: string): any; + + /** Removes this document from the db. */ + remove(options: QueryOptions, callback: Callback): void; + remove(callback: Callback): void; + remove(options?: QueryOptions): Promise; + + /** Sends a replaceOne command with this document `_id` as the query selector. */ + replaceOne(replacement?: AnyObject, options?: QueryOptions | null, callback?: Callback): Query; + + /** Saves this document by inserting a new document into the database if [document.isNew](/docs/api.html#document_Document-isNew) is `true`, or sends an [updateOne](/docs/api.html#document_Document-updateOne) operation with just the modified paths if `isNew` is `false`. */ + save(options: SaveOptions, callback: Callback): void; + save(callback: Callback): void; + save(options?: SaveOptions): Promise; + + /** The document's schema. */ + schema: Schema; + + /** Sets the value of a path, or many paths. */ + set(path: string, val: any, type: any, options?: any): this; + set(path: string, val: any, options?: any): this; + set(value: any): this; + + /** The return value of this method is used in calls to JSON.stringify(doc). */ + toJSON>(options?: ToObjectOptions & { flattenMaps?: true }): FlattenMaps; + toJSON>(options: ToObjectOptions & { flattenMaps: false }): T; + + /** Converts this document into a plain-old JavaScript object ([POJO](https://masteringjs.io/tutorials/fundamentals/pojo)). */ + toObject>(options?: ToObjectOptions): Require_id; + + /** Clears the modified state on the specified path. */ + unmarkModified(path: string): void; + + /** Sends an update command with this document `_id` as the query selector. */ + update(update?: UpdateQuery | UpdateWithAggregationPipeline, options?: QueryOptions | null, callback?: Callback): Query; + + /** Sends an updateOne command with this document `_id` as the query selector. */ + updateOne(update?: UpdateQuery | UpdateWithAggregationPipeline, options?: QueryOptions | null, callback?: Callback): Query; + + /** Executes registered validation rules for this document. */ + validate(pathsToValidate: pathsToValidate, options: AnyObject, callback: CallbackWithoutResult): void; + validate(pathsToValidate: pathsToValidate, callback: CallbackWithoutResult): void; + validate(callback: CallbackWithoutResult): void; + validate(pathsToValidate?: pathsToValidate, options?: AnyObject): Promise; + validate(options: { pathsToSkip?: pathsToSkip }): Promise; + + /** Executes registered validation rules (skipping asynchronous validators) for this document. */ + validateSync(options: { pathsToSkip?: pathsToSkip, [k: string]: any }): Error.ValidationError | null; + validateSync(pathsToValidate?: pathsToValidate, options?: AnyObject): Error.ValidationError | null; + } +} diff --git a/node_modules/mongoose/types/error.d.ts b/node_modules/mongoose/types/error.d.ts new file mode 100644 index 000000000..cab55c2b9 --- /dev/null +++ b/node_modules/mongoose/types/error.d.ts @@ -0,0 +1,133 @@ +declare class NativeError extends global.Error { } + +declare module 'mongoose' { + import mongodb = require('mongodb'); + + type CastError = Error.CastError; + type SyncIndexesError = Error.SyncIndexesError; + + class MongooseError extends global.Error { + constructor(msg: string); + + /** The type of error. "MongooseError" for generic errors. */ + name: string; + + static messages: any; + + static Messages: any; + } + + class Error extends MongooseError { } + + namespace Error { + + export class CastError extends MongooseError { + name: 'CastError'; + stringValue: string; + kind: string; + value: any; + path: string; + reason?: NativeError | null; + model?: any; + + constructor(type: string, value: any, path: string, reason?: NativeError, schemaType?: SchemaType); + } + export class SyncIndexesError extends MongooseError { + name: 'SyncIndexesError'; + errors?: Record; + + constructor(type: string, value: any, path: string, reason?: NativeError, schemaType?: SchemaType); + } + + export class DisconnectedError extends MongooseError { + name: 'DisconnectedError'; + } + + export class DivergentArrayError extends MongooseError { + name: 'DivergentArrayError'; + } + + export class MissingSchemaError extends MongooseError { + name: 'MissingSchemaError'; + } + + export class DocumentNotFoundError extends MongooseError { + name: 'DocumentNotFoundError'; + result: any; + numAffected: number; + filter: any; + query: any; + } + + export class ObjectExpectedError extends MongooseError { + name: 'ObjectExpectedError'; + path: string; + } + + export class ObjectParameterError extends MongooseError { + name: 'ObjectParameterError'; + } + + export class OverwriteModelError extends MongooseError { + name: 'OverwriteModelError'; + } + + export class ParallelSaveError extends MongooseError { + name: 'ParallelSaveError'; + } + + export class ParallelValidateError extends MongooseError { + name: 'ParallelValidateError'; + } + + export class MongooseServerSelectionError extends MongooseError { + name: 'MongooseServerSelectionError'; + } + + export class StrictModeError extends MongooseError { + name: 'StrictModeError'; + isImmutableError: boolean; + path: string; + } + + export class ValidationError extends MongooseError { + name: 'ValidationError'; + + errors: { [path: string]: ValidatorError | CastError }; + addError: (path: string, error: ValidatorError | CastError) => void; + + constructor(instance?: MongooseError); + } + + export class ValidatorError extends MongooseError { + name: 'ValidatorError'; + properties: { + message: string, + type?: string, + path?: string, + value?: any, + reason?: any + }; + kind: string; + path: string; + value: any; + reason?: MongooseError | null; + + constructor(properties: { + message?: string, + type?: string, + path?: string, + value?: any, + reason?: any + }); + } + + export class VersionError extends MongooseError { + name: 'VersionError'; + version: number; + modifiedPaths: Array; + + constructor(doc: Document, currentVersion: number, modifiedPaths: Array); + } + } +} diff --git a/node_modules/mongoose/types/expressions.d.ts b/node_modules/mongoose/types/expressions.d.ts new file mode 100644 index 000000000..8d07e96f2 --- /dev/null +++ b/node_modules/mongoose/types/expressions.d.ts @@ -0,0 +1,2880 @@ +declare module 'mongoose' { + + /** + * [Expressions reference](https://docs.mongodb.com/manual/meta/aggregation-quick-reference/#expressions) + */ + type AggregationVariables = + SpecialPathVariables | + '$$NOW' | + '$$CLUSTER_TIME' | + '$$DESCEND' | + '$$PRUNE' | + '$$KEEP'; + + type SpecialPathVariables = + '$$ROOT' | + '$$CURRENT' | + '$$REMOVE'; + + export namespace Expression { + export interface Abs { + /** + * Returns the absolute value of a number. + * + * @see https://docs.mongodb.com/manual/reference/operator/aggregation/abs/#mongodb-expression-exp.-abs + */ + $abs: Path | ArithmeticExpressionOperator; + } + + export interface Add { + /** + * Adds numbers to return the sum, or adds numbers and a date to return a new date. If adding numbers and a date, treats the numbers as milliseconds. Accepts any number of argument expressions, but at most, one expression can resolve to a date. + * + * @see https://docs.mongodb.com/manual/reference/operator/aggregation/add/#mongodb-expression-exp.-add + */ + $add: (NumberExpression | DateExpression)[]; + } + + export interface Ceil { + /** + * Returns the smallest integer greater than or equal to the specified number. + * + * @see https://docs.mongodb.com/manual/reference/operator/aggregation/ceil/#mongodb-expression-exp.-ceil + */ + $ceil: NumberExpression; + } + + export interface Divide { + /** + * Returns the result of dividing the first number by the second. Accepts two argument expressions. + * + * @see https://docs.mongodb.com/manual/reference/operator/aggregation/divide/#mongodb-expression-exp.-divide + */ + $divide: NumberExpression[]; + } + + export interface Exp { + /** + * Raises e to the specified exponent. + * + * @see https://docs.mongodb.com/manual/reference/operator/aggregation/exp/#mongodb-expression-exp.-exp + */ + $exp: NumberExpression; + } + + export interface Floor { + /** + * Returns the largest integer less than or equal to the specified number. + * + * @see https://docs.mongodb.com/manual/reference/operator/aggregation/floor/#mongodb-expression-exp.-floor + */ + $floor: NumberExpression; + } + + export interface Ln { + /** + * Calculates the natural log of a number. + * + * @see https://docs.mongodb.com/manual/reference/operator/aggregation/ln/#mongodb-expression-exp.-ln + */ + $ln: NumberExpression; + } + + export interface Log { + /** + * Calculates the log of a number in the specified base. + * + * @see https://docs.mongodb.com/manual/reference/operator/aggregation/log/#mongodb-expression-exp.-log + */ + $log: [NumberExpression, NumberExpression]; + } + + export interface Log10 { + /** + * Calculates the log base 10 of a number. + * + * @see https://docs.mongodb.com/manual/reference/operator/aggregation/log10/#mongodb-expression-exp.-log10 + */ + $log10: NumberExpression; + } + + export interface Mod { + /** + * Returns the remainder of the first number divided by the second. Accepts two argument expressions. + * + * @see https://docs.mongodb.com/manual/reference/operator/aggregation/mod/#mongodb-expression-exp.-mod + */ + $mod: [NumberExpression, NumberExpression]; + } + export interface Multiply { + /** + * Multiplies numbers to return the product. Accepts any number of argument expressions. + * + * @see https://docs.mongodb.com/manual/reference/operator/aggregation/multiply/#mongodb-expression-exp.-multiply + */ + $multiply: NumberExpression[]; + } + + export interface Pow { + /** + * Raises a number to the specified exponent. + * + * @see https://docs.mongodb.com/manual/reference/operator/aggregation/pow/#mongodb-expression-exp.-pow + */ + $pow: [NumberExpression, NumberExpression]; + } + + export interface Round { + /** + * Rounds a number to to a whole integer or to a specified decimal place. + * + * @see https://docs.mongodb.com/manual/reference/operator/aggregation/round/#mongodb-expression-exp.-round + */ + $round: [NumberExpression, NumberExpression?]; + } + + export interface Sqrt { + /** + * Calculates the square root. + * + * @see https://docs.mongodb.com/manual/reference/operator/aggregation/sqrt/#mongodb-expression-exp.-sqrt + */ + $sqrt: NumberExpression; + } + + export interface Subtract { + /** + * Returns the result of subtracting the second value from the first. If the two values are numbers, return the difference. If the two values are dates, return the difference in milliseconds. If the two values are a date and a number in milliseconds, return the resulting date. Accepts two argument expressions. If the two values are a date and a number, specify the date argument first as it is not meaningful to subtract a date from a number. + * + * @see https://docs.mongodb.com/manual/reference/operator/aggregation/subtract/#mongodb-expression-exp.-subtract + */ + $subtract: (NumberExpression | DateExpression)[]; + } + + export interface Trunc { + /** + * Truncates a number to a whole integer or to a specified decimal place. + * + * @see https://docs.mongodb.com/manual/reference/operator/aggregation/trunc/#mongodb-expression-exp.-trunc + */ + $trunc: [NumberExpression, NumberExpression?]; + } + + export interface Sin { + /** + * Returns the sine of a value that is measured in radians. + * + * @see https://docs.mongodb.com/manual/reference/operator/aggregation/sin/#mongodb-expression-exp.-sin + */ + $sin: NumberExpression; + } + + export interface Cos { + /** + * Returns the cosine of a value that is measured in radians. + * + * @version 4.2 + * @see https://docs.mongodb.com/manual/reference/operator/aggregation/cos/#mongodb-expression-exp.-cos + */ + $cos: NumberExpression; + } + + export interface Tan { + /** + * Returns the tangent of a value that is measured in radians. + * + * @version 4.2 + * @see https://docs.mongodb.com/manual/reference/operator/aggregation/tan/#mongodb-expression-exp.-tan + */ + $tan: NumberExpression; + } + + export interface Asin { + /** + * Returns the inverse sin (arc sine) of a value in radians. + * + * @version 4.2 + * @see https://docs.mongodb.com/manual/reference/operator/aggregation/asin/#mongodb-expression-exp.-asin + */ + $asin: NumberExpression; + } + + export interface Acos { + /** + * Returns the inverse cosine (arc cosine) of a value in radians. + * + * @version 4.2 + * @see https://docs.mongodb.com/manual/reference/operator/aggregation/acos/#mongodb-expression-exp.-acos + */ + $acos: NumberExpression; + } + + export interface Atan { + /** + * Returns the inverse tangent (arc tangent) of a value in radians. + * + * @version 4.2 + * @see https://docs.mongodb.com/manual/reference/operator/aggregation/atan/#mongodb-expression-exp.-atan + */ + $atan: NumberExpression; + } + + export interface Atan2 { + /** + * Returns the inverse tangent (arc tangent) of y / x in radians, where y and x are the first and second values passed to the expression respectively. + * + * @version 4.2 + * @see https://docs.mongodb.com/manual/reference/operator/aggregation/atan2/#mongodb-expression-exp.-atan2 + */ + $atan2: NumberExpression; + } + + export interface Asinh { + /** + * Returns the inverse hyperbolic sine (hyperbolic arc sine) of a value in radians. + * + * @version 4.2 + * @see https://docs.mongodb.com/manual/reference/operator/aggregation/asinh/#mongodb-expression-exp.-asinh + */ + $asinh: NumberExpression; + } + + export interface Acosh { + /** + * Returns the inverse hyperbolic cosine (hyperbolic arc cosine) of a value in radians. + * + * @version 4.2 + * @see https://docs.mongodb.com/manual/reference/operator/aggregation/acosh/#mongodb-expression-exp.-acosh + */ + $acosh: NumberExpression; + } + + export interface Atanh { + + /** + * Returns the inverse hyperbolic tangent (hyperbolic arc tangent) of a value in radians. + * + * @version 4.2 + * @see https://docs.mongodb.com/manual/reference/operator/aggregation/atanh/#mongodb-expression-exp.-atanh + */ + $atanh: NumberExpression; + } + + export interface Sinh { + /** + * Returns the hyperbolic sine of a value that is measured in radians. + * + * @version 4.2 + * @see https://docs.mongodb.com/manual/reference/operator/aggregation/sinh/#mongodb-expression-exp.-sinh + */ + $sinh: NumberExpression; + } + + export interface Cosh { + /** + * Returns the hyperbolic cosine of a value that is measured in radians. + * + * @version 4.2 + * @see https://docs.mongodb.com/manual/reference/operator/aggregation/cosh/#mongodb-expression-exp.-cosh + */ + $cosh: NumberExpression; + } + + export interface Tanh { + /** + * Returns the hyperbolic tangent of a value that is measured in radians. + * + * @version 4.2 + * @see https://docs.mongodb.com/manual/reference/operator/aggregation/tanh/#mongodb-expression-exp.-tanh + */ + $tanh: NumberExpression; + } + + export interface DegreesToRadians { + /** + * Converts a value from degrees to radians. + * + * @version 4.2 + * @see https://docs.mongodb.com/manual/reference/operator/aggregation/degreesToRadians/#mongodb-expression-exp.-degreesToRadians + */ + $degreesToRadians: NumberExpression; + } + + export interface RadiansToDegrees { + /** + * Converts a value from radians to degrees. + * + * @version 4.2 + * @see https://docs.mongodb.com/manual/reference/operator/aggregation/radiansToDegrees/#mongodb-expression-exp.-radiansToDegrees + */ + $radiansToDegrees: NumberExpression; + } + + export interface Meta { + /** + * Access available per-document metadata related to the aggregation operation. + * + * @see https://docs.mongodb.com/manual/reference/operator/aggregation/meta/#mongodb-expression-exp.-meta + */ + $meta: 'textScore' | 'indexKey'; + } + + export interface DateAdd { + /** + * Adds a number of time units to a date object. + * + * @version 5.0.0 + * @see https://docs.mongodb.com/manual/reference/operator/aggregation/dateAdd/#mongodb-expression-exp.-dateAdd + */ + $dateAdd: { + /** + * The beginning date, in UTC, for the addition operation. The startDate can be any expression that resolves to a Date, a Timestamp, or an ObjectID. + */ + startDate: DateExpression; + /** + * The unit used to measure the amount of time added to the startDate. The unit is an expression that resolves to one of the following strings: + * - year + * - quarter + * - week + * - month + * - day + * - hour + * - minute + * - second + * - millisecond + */ + unit: StringExpression; + /** + * The number of units added to the startDate. The amount is an expression that resolves to an integer or long. The amount can also resolve to an integral decimal or a double if that value can be converted to a long without loss of precision. + */ + amount: NumberExpression; + /** + * The timezone to carry out the operation. must be a valid expression that resolves to a string formatted as either an Olson Timezone Identifier or a UTC Offset. If no timezone is provided, the result is displayed in UTC. + */ + timezone?: tzExpression; + }; + } + + export interface DateDiff { + /** + * Returns the difference between two dates. + * + * @version 5.0 + * @see https://docs.mongodb.com/manual/reference/operator/aggregation/dateDiff/#mongodb-expression-exp.-dateDiff + */ + $dateDiff: { + /** + * The start of the time period. The startDate can be any expression that resolves to a Date, a Timestamp, or an ObjectID. + */ + startDate: DateExpression; + /** + * The end of the time period. The endDate can be any expression that resolves to a Date, a Timestamp, or an ObjectID. + */ + endDate: DateExpression; + /** + * The time measurement unit between the startDate and endDate. It is an expression that resolves to a string: + * - year + * - quarter + * - week + * - month + * - day + * - hour + * - minute + * - second + * - millisecond + */ + unit: StringExpression; + /** + * The timezone to carry out the operation. must be a valid expression that resolves to a string formatted as either an Olson Timezone Identifier or a UTC Offset. If no timezone is provided, the result is displayed in UTC. + */ + timezone?: tzExpression; + /** + * Used when the unit is equal to week. Defaults to Sunday. The startOfWeek parameter is an expression that resolves to a case insensitive string: + * - monday (or mon) + * - tuesday (or tue) + * - wednesday (or wed) + * - thursday (or thu) + * - friday (or fri) + * - saturday (or sat) + * - sunday (or sun) + */ + startOfWeek?: StringExpression; + } + } + + // TODO: Can be done better + export interface DateFromParts { + /** + * Constructs a BSON Date object given the date's constituent parts. + * + * @version 3.6 + * @see https://docs.mongodb.com/manual/reference/operator/aggregation/dateFromParts/#mongodb-expression-exp.-dateFromParts + */ + $dateFromParts: { + /** + * ISO Week Date Year. Can be any expression that evaluates to a number. + * + * Value range: 1-9999 + * + * If the number specified is outside this range, $dateFromParts errors. Starting in MongoDB 4.4, the lower bound for this value is 1. In previous versions of MongoDB, the lower bound was 0. + */ + isoWeekYear?: NumberExpression; + /** + * Week of year. Can be any expression that evaluates to a number. + * + * Defaults to 1. + * + * Value range: 1-53 + * + * Starting in MongoDB 4.0, if the number specified is outside this range, $dateFromParts incorporates the difference in the date calculation. See Value Range for examples. + */ + isoWeek?: NumberExpression; + /** + * Day of week (Monday 1 - Sunday 7). Can be any expression that evaluates to a number. + * + * Defaults to 1. + * + * Value range: 1-7 + * + * Starting in MongoDB 4.0, if the number specified is outside this range, $dateFromParts incorporates the difference in the date calculation. See Value Range for examples. + */ + isoDayOfWeek?: NumberExpression; + /** + * Calendar year. Can be any expression that evaluates to a number. + * + * Value range: 1-9999 + * + * If the number specified is outside this range, $dateFromParts errors. Starting in MongoDB 4.4, the lower bound for this value is 1. In previous versions of MongoDB, the lower bound was 0. + */ + year?: NumberExpression; + /** + * Month. Can be any expression that evaluates to a number. + * + * Defaults to 1. + * + * Value range: 1-12 + * + * Starting in MongoDB 4.0, if the number specified is outside this range, $dateFromParts incorporates the difference in the date calculation. See Value Range for examples. + */ + month?: NumberExpression; + /** + * Day of month. Can be any expression that evaluates to a number. + * + * Defaults to 1. + * + * Value range: 1-31 + * + * Starting in MongoDB 4.0, if the number specified is outside this range, $dateFromParts incorporates the difference in the date calculation. See Value Range for examples. + */ + day?: NumberExpression; + /** + * Hour. Can be any expression that evaluates to a number. + * + * Defaults to 0. + * + * Value range: 0-23 + * + * Starting in MongoDB 4.0, if the number specified is outside this range, $dateFromParts incorporates the difference in the date calculation. See Value Range for examples. + */ + hour?: NumberExpression; + /** + * Minute. Can be any expression that evaluates to a number. + * + * Defaults to 0. + * + * Value range: 0-59 Starting in MongoDB 4.0, if the number specified is outside this range, $dateFromParts incorporates the difference in the date calculation. See Value Range for examples. + */ + minute?: NumberExpression; + /** + * Second. Can be any expression that evaluates to a number. + * + * Defaults to 0. + * + * Value range: 0-59 + * + * Starting in MongoDB 4.0, if the number specified is outside this range, $dateFromParts incorporates the difference in the date calculation. See Value Range for examples. + */ + second?: NumberExpression; + /** + * Millisecond. Can be any expression that evaluates to a number. + * + * Defaults to 0. + * + * Value range: 0-999 + * + * Starting in MongoDB 4.0, if the number specified is outside this range, $dateFromParts incorporates the difference in the date calculation. See Value Range for examples. + */ + millisecond?: NumberExpression; + /** + * The timezone to carry out the operation. must be a valid expression that resolves to a string formatted as either an Olson Timezone Identifier or a UTC Offset. If no timezone is provided, the result is displayed in UTC. + */ + timezone?: tzExpression; + }; + } + + export interface DateFromString { + /** + * Converts a date/time string to a date object. + * + * @version 3.6 + * @see https://docs.mongodb.com/manual/reference/operator/aggregation/dateFromString/#mongodb-expression-exp.-dateFromString + */ + $dateFromString: { + dateString: StringExpression; + /** + * The date format specification of the dateString. The format can be any expression that evaluates to a string literal, containing 0 or more format specifiers. For a list of specifiers available, see Format Specifiers. + * + * If unspecified, $dateFromString uses "%Y-%m-%dT%H:%M:%S.%LZ" as the default format. + * @version 4.0 + */ + format?: FormatString; + /** + * The time zone to use to format the date. + * + * Note: If the dateString argument is formatted like '2017-02-08T12:10:40.787Z', in which the 'Z' at the end indicates Zulu time (UTC time zone), you cannot specify the timezone argument. + */ + timezone?: tzExpression; + /** + * Optional. If $dateFromString encounters an error while parsing the given dateString, it outputs the result value of the provided onError expression. This result value can be of any type. + * + * If you do not specify onError, $dateFromString throws an error if it cannot parse dateString. + */ + onError?: Expression; + /** + * Optional. If the dateString provided to $dateFromString is null or missing, it outputs the result value of the provided onNull expression. This result value can be of any type. + * + * If you do not specify onNull and dateString is null or missing, then $dateFromString outputs null. + */ + onNull?: Expression; + }; + } + + export interface DateSubtract { + /** + * Subtracts a number of time units from a date object. + * + * @version 5.0 + * @see https://docs.mongodb.com/manual/reference/operator/aggregation/dateSubtract/#mongodb-expression-exp.-dateSubtract + */ + $dateSubtract: { + /** + * The beginning date, in UTC, for the subtraction operation. The startDate can be any expression that resolves to a Date, a Timestamp, or an ObjectID. + */ + startDate: DateExpression; + /** + * The unit of time, specified as an expression that must resolve to one of these strings: + * - year + * - quarter + * - week + * - month + * - day + * - hour + * - minute + * - second + * - millisecond + * + * Together, binSize and unit specify the time period used in the $dateTrunc calculation. + */ + unit: StringExpression; + /** + * The number of units subtracted from the startDate. The amount is an expression that resolves to an integer or long. The amount can also resolve to an integral decimal and or a double if that value can be converted to a long without loss of precision. + */ + amount: NumberExpression; + /** + * The timezone to carry out the operation. must be a valid expression that resolves to a string formatted as either an Olson Timezone Identifier or a UTC Offset. If no timezone is provided, the result is displayed in UTC. + */ + timezone?: tzExpression; + }; + } + + export interface DateToParts { + /** + * Returns a document containing the constituent parts of a date. + * + * @version 3.6 + * @see https://docs.mongodb.com/manual/reference/operator/aggregation/dateToParts/#mongodb-expression-exp.-dateToParts + */ + $dateToParts: { + /** + * The input date for which to return parts. can be any expression that resolves to a Date, a Timestamp, or an ObjectID. For more information on expressions, see Expressions. + */ + date: DateExpression; + /** + * The timezone of the operation result. must be a valid expression that resolves to a string formatted as either an Olson Timezone Identifier or a UTC Offset. If no timezone is provided, the result is displayed in UTC. + * + * @version 3.6 + */ + timezone?: tzExpression; + /** + * If set to true, modifies the output document to use ISO week date fields. Defaults to false. + */ + iso8601?: boolean; + }; + } + + export interface DateToString { + /** + * Returns the date as a formatted string. + * + * @version 3.6 + * @see https://docs.mongodb.com/manual/reference/operator/aggregation/dateToString/#mongodb-expression-exp.-dateToString + */ + $dateToString: { + /** + * The date to convert to string. must be a valid expression that resolves to a Date, a Timestamp, or an ObjectID. + */ + date: DateExpression; + /** + * The date format specification. can be any string literal, containing 0 or more format specifiers. For a list of specifiers available, see Format Specifiers. + * + * If unspecified, $dateToString uses "%Y-%m-%dT%H:%M:%S.%LZ" as the default format. + * + * Changed in version 4.0: The format field is optional if featureCompatibilityVersion (fCV) is set to "4.0" or greater. For more information on fCV, see setFeatureCompatibilityVersion. + */ + format?: FormatString; + /** + * The timezone of the operation result. must be a valid expression that resolves to a string formatted as either an Olson Timezone Identifier or a UTC Offset. If no timezone is provided, the result is displayed in UTC. + * + * @version 3.6 + */ + timezone?: tzExpression; + /** + * The value to return if the date is null or missing. The arguments can be any valid expression. + * + * If unspecified, $dateToString returns null if the date is null or missing. + * + * Changed in version 4.0: Requires featureCompatibilityVersion (fCV) set to "4.0" or greater. For more information on fCV, see setFeatureCompatibilityVersion. + */ + onNull?: Expression; + }; + } + + export interface DateTrunc { + /** + * Truncates a date. + * + * @version 5.0 + * @see https://docs.mongodb.com/manual/reference/operator/aggregation/dateTrunc/#mongodb-expression-exp.-dateTrunc + */ + $dateTrunc: { + /** + * The date to truncate, specified in UTC. The date can be any expression that resolves to a Date, a Timestamp, or an ObjectID. + */ + date: DateExpression; + /** + * The unit of time, specified as an expression that must resolve to one of these strings: + * - year + * - quarter + * - week + * - month + * - day + * - hour + * - minute + * - second + * - millisecond + * + * Together, binSize and unit specify the time period used in the $dateTrunc calculation. + */ + unit: StringExpression; + /** + * The numeric time value, specified as an expression that must resolve to a positive non-zero number. Defaults to 1. + * + * Together, binSize and unit specify the time period used in the $dateTrunc calculation. + */ + binSize?: NumberExpression; + /** + * The timezone of the operation result. must be a valid expression that resolves to a string formatted as either an Olson Timezone Identifier or a UTC Offset. If no timezone is provided, the result is displayed in UTC. + */ + timezone?: tzExpression; + /** + * Used when the unit is equal to week. Defaults to Sunday. The startOfWeek parameter is an expression that resolves to a case insensitive string: + * - monday (or mon) + * - tuesday (or tue) + * - wednesday (or wed) + * - thursday (or thu) + * - friday (or fri) + * - saturday (or sat) + * - sunday (or sun) + */ + startOfWeek?: StringExpression; + } + } + + export interface DayOfMonth { + /** + * Returns the day of the month for a date as a number between 1 and 31. + * + * @see https://docs.mongodb.com/manual/reference/operator/aggregation/dayOfMonth/#mongodb-expression-exp.-dayOfMonth + */ + $dayOfMonth: DateExpression | { + /** + * The date to which the operator is applied. must be a valid expression that resolves to a Date, a Timestamp, or an ObjectID. + */ + date: DateExpression; + /** + * The timezone of the operation result. must be a valid expression that resolves to a string formatted as either an Olson Timezone Identifier or a UTC Offset. If no timezone is provided, the result is displayed in UTC. + */ + timezone?: tzExpression; + }; + } + + export interface DayOfWeek { + /** + * Returns the day of the week for a date as a number between 1 (Sunday) and 7 (Saturday). + * + * @see https://docs.mongodb.com/manual/reference/operator/aggregation/dayOfWeek/#mongodb-expression-exp.-dayOfWeek + */ + $dayOfWeek: DateExpression | { + /** + * The date to which the operator is applied. must be a valid expression that resolves to a Date, a Timestamp, or an ObjectID. + */ + date: DateExpression; + /** + * The timezone of the operation result. must be a valid expression that resolves to a string formatted as either an Olson Timezone Identifier or a UTC Offset. If no timezone is provided, the result is displayed in UTC. + */ + timezone?: tzExpression; + }; + } + + export interface DayOfYear { + /** + * Returns the day of the year for a date as a number between 1 and 366 (leap year). + * + * @see https://docs.mongodb.com/manual/reference/operator/aggregation/dayOfYear/#mongodb-expression-exp.-dayOfYear + */ + $dayOfYear: DateExpression | { + /** + * The date to which the operator is applied. must be a valid expression that resolves to a Date, a Timestamp, or an ObjectID. + */ + date: DateExpression; + /** + * The timezone of the operation result. must be a valid expression that resolves to a string formatted as either an Olson Timezone Identifier or a UTC Offset. If no timezone is provided, the result is displayed in UTC. + */ + timezone?: tzExpression; + }; + } + + export interface Hour { + /** + * Returns the hour for a date as a number between 0 and 23. + * + * @see https://docs.mongodb.com/manual/reference/operator/aggregation/hour/#mongodb-expression-exp.-hour + */ + $hour: DateExpression | { + /** + * The date to which the operator is applied. must be a valid expression that resolves to a Date, a Timestamp, or an ObjectID. + */ + date: DateExpression; + /** + * The timezone of the operation result. must be a valid expression that resolves to a string formatted as either an Olson Timezone Identifier or a UTC Offset. If no timezone is provided, the result is displayed in UTC. + */ + timezone?: tzExpression; + }; + } + + export interface IsoDayOfWeek { + /** + * Returns the weekday number in ISO 8601 format, ranging from 1 (for Monday) to 7 (for Sunday). + * + * @version 3.4 + * @see https://docs.mongodb.com/manual/reference/operator/aggregation/isoDayOfWeek/#mongodb-expression-exp.-isoDayOfWeek + */ + $isoDayOfWeek: DateExpression | { + /** + * The date to which the operator is applied. must be a valid expression that resolves to a Date, a Timestamp, or an ObjectID. + */ + date: DateExpression; + /** + * The timezone of the operation result. must be a valid expression that resolves to a string formatted as either an Olson Timezone Identifier or a UTC Offset. If no timezone is provided, the result is displayed in UTC. + */ + timezone?: tzExpression; + }; + } + + export interface IsoWeek { + /** + * Returns the week number in ISO 8601 format, ranging from 1 to 53. Week numbers start at 1 with the week (Monday through Sunday) that contains the year's first Thursday. + * + * @version 3.4 + * @see https://docs.mongodb.com/manual/reference/operator/aggregation/isoWeek/#mongodb-expression-exp.-isoWeek + */ + $isoWeek: DateExpression | { + /** + * The date to which the operator is applied. must be a valid expression that resolves to a Date, a Timestamp, or an ObjectID. + */ + date: DateExpression; + /** + * The timezone of the operation result. must be a valid expression that resolves to a string formatted as either an Olson Timezone Identifier or a UTC Offset. If no timezone is provided, the result is displayed in UTC. + */ + timezone?: tzExpression; + }; + } + + export interface IsoWeekYear { + /** + * Returns the year number in ISO 8601 format. The year starts with the Monday of week 1 (ISO 8601) and ends with the Sunday of the last week (ISO 8601). + * + * @version 3.4 + * @see https://docs.mongodb.com/manual/reference/operator/aggregation/isoWeekYear/#mongodb-expression-exp.-isoWeekYear + */ + $isoWeekYear: DateExpression | { + /** + * The date to which the operator is applied. must be a valid expression that resolves to a Date, a Timestamp, or an ObjectID. + */ + date: DateExpression; + /** + * The timezone of the operation result. must be a valid expression that resolves to a string formatted as either an Olson Timezone Identifier or a UTC Offset. If no timezone is provided, the result is displayed in UTC. + */ + timezone?: tzExpression; + }; + } + + export interface Millisecond { + /** + * Returns the milliseconds of a date as a number between 0 and 999. + * + * @see https://docs.mongodb.com/manual/reference/operator/aggregation/millisecond/#mongodb-expression-exp.-millisecond + */ + $millisecond: DateExpression | { + /** + * The date to which the operator is applied. must be a valid expression that resolves to a Date, a Timestamp, or an ObjectID. + */ + date: DateExpression; + /** + * The timezone of the operation result. must be a valid expression that resolves to a string formatted as either an Olson Timezone Identifier or a UTC Offset. If no timezone is provided, the result is displayed in UTC. + */ + timezone?: tzExpression; + }; + } + + export interface Minute { + /** + * Returns the minute for a date as a number between 0 and 59. + * + * @see https://docs.mongodb.com/manual/reference/operator/aggregation/minute/#mongodb-expression-exp.-minute + */ + $minute: DateExpression | { + /** + * The date to which the operator is applied. must be a valid expression that resolves to a Date, a Timestamp, or an ObjectID. + */ + date: DateExpression; + /** + * The timezone of the operation result. must be a valid expression that resolves to a string formatted as either an Olson Timezone Identifier or a UTC Offset. If no timezone is provided, the result is displayed in UTC. + */ + timezone?: tzExpression; + }; + } + + export interface Month { + /** + * Returns the month for a date as a number between 1 (January) and 12 (December). + * + * @see https://docs.mongodb.com/manual/reference/operator/aggregation/month/#mongodb-expression-exp.-month + */ + $month: DateExpression | { + /** + * The date to which the operator is applied. must be a valid expression that resolves to a Date, a Timestamp, or an ObjectID. + */ + date: DateExpression; + /** + * The timezone of the operation result. must be a valid expression that resolves to a string formatted as either an Olson Timezone Identifier or a UTC Offset. If no timezone is provided, the result is displayed in UTC. + */ + timezone?: tzExpression; + }; + } + + export interface Second { + /** + * Returns the seconds for a date as a number between 0 and 60 (leap seconds). + * + * @see https://docs.mongodb.com/manual/reference/operator/aggregation/second/#mongodb-expression-exp.-second + */ + $second: DateExpression | { + /** + * The date to which the operator is applied. must be a valid expression that resolves to a Date, a Timestamp, or an ObjectID. + */ + date: DateExpression; + /** + * The timezone of the operation result. must be a valid expression that resolves to a string formatted as either an Olson Timezone Identifier or a UTC Offset. If no timezone is provided, the result is displayed in UTC. + */ + timezone?: tzExpression; + }; + } + + export interface ToDate { + /** + * Converts value to a Date. + * + * @version 4.0 + * @see https://docs.mongodb.com/manual/reference/operator/aggregation/toDate/#mongodb-expression-exp.-toDate + */ + $toDate: Expression; + } + + export interface Week { + /** + * Returns the week number for a date as a number between 0 (the partial week that precedes the first Sunday of the year) and 53 (leap year). + * + * @see https://docs.mongodb.com/manual/reference/operator/aggregation/week/#mongodb-expression-exp.-week + */ + $week: DateExpression | { + /** + * The date to which the operator is applied. must be a valid expression that resolves to a Date, a Timestamp, or an ObjectID. + */ + date: DateExpression; + /** + * The timezone of the operation result. must be a valid expression that resolves to a string formatted as either an Olson Timezone Identifier or a UTC Offset. If no timezone is provided, the result is displayed in UTC. + */ + timezone?: tzExpression; + }; + } + + export interface Year { + /** + * Returns the year for a date as a number (e.g. 2014). + * + * @see https://docs.mongodb.com/manual/reference/operator/aggregation/year/#mongodb-expression-exp.-year + */ + $year: DateExpression | { + /** + * The date to which the operator is applied. must be a valid expression that resolves to a Date, a Timestamp, or an ObjectID. + */ + date: DateExpression; + /** + * The timezone of the operation result. must be a valid expression that resolves to a string formatted as either an Olson Timezone Identifier or a UTC Offset. If no timezone is provided, the result is displayed in UTC. + */ + timezone?: tzExpression; + }; + } + + export interface And { + /** + * Returns true only when all its expressions evaluate to true. Accepts any number of argument expressions. + * + * @see https://docs.mongodb.com/manual/reference/operator/aggregation/and/#mongodb-expression-exp.-and + */ + $and: (Expression | Record)[]; + } + + export interface Not { + /** + * Returns the boolean value that is the opposite of its argument expression. Accepts a single argument expression. + * + * @see https://docs.mongodb.com/manual/reference/operator/aggregation/not/#mongodb-expression-exp.-not + */ + $not: [Expression]; + } + + export interface Or { + /** + * Returns true when any of its expressions evaluates to true. Accepts any number of argument expressions. + * + * @see https://docs.mongodb.com/manual/reference/operator/aggregation/or/#mongodb-expression-exp.-or + */ + $or: (Expression | Record)[]; + } + + export interface Cmp { + /** + * Returns 0 if the two values are equivalent, 1 if the first value is greater than the second, and -1 if the first value is less than the second. + * + * @see https://docs.mongodb.com/manual/reference/operator/aggregation/cmp/#mongodb-expression-exp.-cmp + */ + $cmp: [Record | Expression, Record | Expression]; + } + + export interface Eq { + /** + * Returns true if the values are equivalent. + * + * @see https://docs.mongodb.com/manual/reference/operator/aggregation/eq/#mongodb-expression-exp.-eq + */ + $eq: AnyExpression | [AnyExpression, AnyExpression]; + } + + export interface Gt { + /** + * Returns true if the first value is greater than the second. + * + * @see https://docs.mongodb.com/manual/reference/operator/aggregation/gt/#mongodb-expression-exp.-gt + */ + $gt: NumberExpression | [NumberExpression, NumberExpression]; + } + + export interface Gte { + /** + * Returns true if the first value is greater than or equal to the second. + * + * @see https://docs.mongodb.com/manual/reference/operator/aggregation/gte/#mongodb-expression-exp.-gte + */ + $gte: NumberExpression | [NumberExpression, NumberExpression]; + } + + export interface Lt { + /** + * Returns true if the first value is less than the second. + * + * @see https://docs.mongodb.com/manual/reference/operator/aggregation/lt/#mongodb-expression-exp.-lt + */ + $lt: NumberExpression | [NumberExpression, NumberExpression]; + } + + export interface Lte { + /** + * Returns true if the first value is less than or equal to the second. + * + * @see https://docs.mongodb.com/manual/reference/operator/aggregation/lte/#mongodb-expression-exp.-lte + */ + $lte: NumberExpression | [NumberExpression, NumberExpression]; + } + + export interface Ne { + /** + * Returns true if the values are not equivalent. + * + * @see https://docs.mongodb.com/manual/reference/operator/aggregation/ne/#mongodb-expression-exp.-ne + */ + $ne: Expression | [Expression, Expression]; + } + + export interface Cond { + /** + * A ternary operator that evaluates one expression, and depending on the result, returns the value of one of the other two expressions. Accepts either three expressions in an ordered list or three named parameters. + * + * @see https://docs.mongodb.com/manual/reference/operator/aggregation/cond/#mongodb-expression-exp.-cond + */ + $cond: { if: BooleanExpression, then: AnyExpression, else: AnyExpression } | [BooleanExpression, AnyExpression, AnyExpression]; + } + + export interface IfNull { + /** + * Returns either the non-null result of the first expression or the result of the second expression if the first expression results in a null result. Null result encompasses instances of undefined values or missing fields. Accepts two expressions as arguments. The result of the second expression can be null. + * + * @see https://docs.mongodb.com/manual/reference/operator/aggregation/ifNull/#mongodb-expression-exp.-ifNull + */ + $ifNull: Expression[]; + } + + export interface Switch { + /** + * Evaluates a series of case expressions. When it finds an expression which evaluates to true, $switch executes a specified expression and breaks out of the control flow. + * + * @see https://docs.mongodb.com/manual/reference/operator/aggregation/switch/#mongodb-expression-exp.-switch + */ + $switch: { + /** + * An array of control branch documents. Each branch is a document with the following fields: + * - $case + * - $then + */ + $branches: { $case: Expression, then: Expression }[]; + /** + * The path to take if no branch case expression evaluates to true. + * + * Although optional, if default is unspecified and no branch case evaluates to true, $switch returns an error. + */ + $default: Expression; + }; + } + + export interface ArrayElemAt { + /** + * Returns the element at the specified array index. + * + * @version 3.2 + * @see https://docs.mongodb.com/manual/reference/operator/aggregation/arrayElemAt/#mongodb-expression-exp.-arrayElemAt + */ + $arrayElemAt: [ArrayExpression, NumberExpression]; + } + + export interface ArrayToObject { + /** + * Converts an array of key value pairs to a document. + * + * @version 3.4.4 + * @see https://docs.mongodb.com/manual/reference/operator/aggregation/arrayToObject/#mongodb-expression-exp.-arrayToObject + */ + $arrayToObject: ArrayExpression; + } + + export interface ConcatArrays { + /** + * Concatenates arrays to return the concatenated array. + * + * @version 3.2 + * @see https://docs.mongodb.com/manual/reference/operator/aggregation/concatArrays/#mongodb-expression-exp.-concatArrays + */ + $concatArrays: ArrayExpression[]; + } + + export interface Filter { + /** + * Selects a subset of the array to return an array with only the elements that match the filter condition. + * + * @version 3.2 + * @see https://docs.mongodb.com/manual/reference/operator/aggregation/filter/#mongodb-expression-exp.-filter + */ + $filter: { + /** + * An expression that resolves to an array. + */ + input: ArrayExpression; + /** + * A name for the variable that represents each individual element of the input array. If no name is specified, the variable name defaults to this. + */ + as?: string; + /** + * An expression that resolves to a boolean value used to determine if an element should be included in the output array. The expression references each element of the input array individually with the variable name specified in as. + */ + cond: BooleanExpression; + } + } + + export interface First { + /** + * Returns the first array element. Distinct from $first accumulator. + * + * @version 5.0 + * @see https://docs.mongodb.com/manual/reference/operator/aggregation/first/#mongodb-expression-exp.-first + */ + $first: Expression; + } + + export interface In { + /** + * Returns a boolean indicating whether a specified value is in an array. + * + * @version 3.4 + * @see https://docs.mongodb.com/manual/reference/operator/aggregation/in/#mongodb-expression-exp.-in + */ + $in: [Expression, ArrayExpression]; + } + + export interface IndexOfArray { + /** + * Searches an array for an occurrence of a specified value and returns the array index of the first occurrence. If the substring is not found, returns -1. + * + * @version 3.4 + * @see https://docs.mongodb.com/manual/reference/operator/aggregation/indexOfArray/#mongodb-expression-exp.-indexOfArray + */ + $indexOfArray: [ArrayExpression, Expression] | [ArrayExpression, Expression, NumberExpression] | [ArrayExpression, Expression, NumberExpression, NumberExpression]; + } + + export interface IsArray { + /** + * Determines if the operand is an array. Returns a boolean. + * + * @version 3.2 + * @see https://docs.mongodb.com/manual/reference/operator/aggregation/isArray/#mongodb-expression-exp.-isArray + */ + $isArray: [Expression]; + } + + export interface Last { + /** + * Returns the last array element. Distinct from $last accumulator. + * + * @version 5.0 + * @see https://docs.mongodb.com/manual/reference/operator/aggregation/last/#mongodb-expression-exp.-last + */ + $last: Expression; + } + + export interface Map { + /** + * Applies a subexpression to each element of an array and returns the array of resulting values in order. Accepts named parameters. + * + * @see https://docs.mongodb.com/manual/reference/operator/aggregation/map/#mongodb-expression-exp.-map + */ + $map: { + /** + * An expression that resolves to an array. + */ + input: ArrayExpression; + /** + * A name for the variable that represents each individual element of the input array. If no name is specified, the variable name defaults to this. + */ + as?: string; + /** + * An expression that is applied to each element of the input array. The expression references each element individually with the variable name specified in as. + */ + in: Expression; + }; + } + + export interface ObjectToArray { + /** + * Converts a document to an array of documents representing key-value pairs. + * + * @version 3.4.4 + * @see https://docs.mongodb.com/manual/reference/operator/aggregation/objectToArray/#mongodb-expression-exp.-objectToArray + */ + $objectToArray: ObjectExpression; + } + + export interface Range { + /** + * Outputs an array containing a sequence of integers according to user-defined inputs. + * + * @see https://docs.mongodb.com/manual/reference/operator/aggregation/range/#mongodb-expression-exp.-range + */ + $range: [NumberExpression, NumberExpression] | [NumberExpression, NumberExpression, NumberExpression]; + } + + export interface Reduce { + /** + * Applies an expression to each element in an array and combines them into a single value. + * + * @version 3.4 + * @see https://docs.mongodb.com/manual/reference/operator/aggregation/reduce/#mongodb-expression-exp.-reduce + */ + $reduce: { + /** + * Can be any valid expression that resolves to an array. For more information on expressions, see Expressions. + * + * If the argument resolves to a value of null or refers to a missing field, $reduce returns null. + * + * If the argument does not resolve to an array or null nor refers to a missing field, $reduce returns an error. + */ + input: ArrayExpression; + /** + * The initial cumulative value set before in is applied to the first element of the input array. + */ + initialValue: Expression; + /** + * A valid expression that $reduce applies to each element in the input array in left-to-right order. Wrap the input value with $reverseArray to yield the equivalent of applying the combining expression from right-to-left. + * + * During evaluation of the in expression, two variables will be available: + * - `value` is the variable that represents the cumulative value of the expression. + * - `this` is the variable that refers to the element being processed. + */ + in: Expression; + }; + } + + export interface ReverseArray { + /** + * Returns an array with the elements in reverse order. + * + * @version 3.4 + * @see https://docs.mongodb.com/manual/reference/operator/aggregation/reverseArray/#mongodb-expression-exp.-reverseArray + */ + $reverseArray: ArrayExpression; + } + + export interface Size { + /** + * Returns the number of elements in the array. Accepts a single expression as argument. + * + * @see https://docs.mongodb.com/manual/reference/operator/aggregation/size/#mongodb-expression-exp.-size + */ + $size: ArrayExpression; + } + + export interface Slice { + /** + * Returns a subset of an array. + * + * @version 3.2 + * @see https://docs.mongodb.com/manual/reference/operator/aggregation/slice/#mongodb-expression-exp.-slice + */ + $slice: [ArrayExpression, NumberExpression] | [ArrayExpression, NumberExpression, NumberExpression]; + } + + export interface Zip { + /** + * Merge two arrays together. + * + * @version 3.4 + * @see https://docs.mongodb.com/manual/reference/operator/aggregation/zip/#mongodb-expression-exp.-zip + */ + $zip: { + /** + * An array of expressions that resolve to arrays. The elements of these input arrays combine to form the arrays of the output array. + * + * If any of the inputs arrays resolves to a value of null or refers to a missing field, $zip returns null. + * + * If any of the inputs arrays does not resolve to an array or null nor refers to a missing field, $zip returns an error. + */ + inputs: ArrayExpression[]; + /** + * A boolean which specifies whether the length of the longest array determines the number of arrays in the output array. + * + * The default value is false: the shortest array length determines the number of arrays in the output array. + */ + useLongestLength?: boolean; + /** + * An array of default element values to use if the input arrays have different lengths. You must specify useLongestLength: true along with this field, or else $zip will return an error. + * + * If useLongestLength: true but defaults is empty or not specified, $zip uses null as the default value. + * + * If specifying a non-empty defaults, you must specify a default for each input array or else $zip will return an error. + */ + defaults?: ArrayExpression; + }; + } + + export interface Concat { + /** + * Concatenates any number of strings. + * + * @see https://docs.mongodb.com/manual/reference/operator/aggregation/concat/#mongodb-expression-exp.-concat + */ + $concat: StringExpression[]; + } + + export interface IndexOfBytes { + /** + * Searches a string for an occurrence of a substring and returns the UTF-8 byte index of the first occurrence. If the substring is not found, returns -1. + * + * @version 3.4 + * @see https://docs.mongodb.com/manual/reference/operator/aggregation/indexOfBytes/#mongodb-expression-exp.-indexOfBytes + */ + $indexOfBytes: [StringExpression, StringExpression] | [StringExpression, StringExpression, NumberExpression] | [StringExpression, StringExpression, NumberExpression, NumberExpression]; + } + + export interface IndexOfCP { + /** + * Searches a string for an occurrence of a substring and returns the UTF-8 code point index of the first occurrence. If the substring is not found, returns -1 + * + * @version 3.4 + * @see https://docs.mongodb.com/manual/reference/operator/aggregation/indexOfCP/#mongodb-expression-exp.-indexOfCP + */ + $indexOfCP: [StringExpression, StringExpression] | [StringExpression, StringExpression, NumberExpression] | [StringExpression, StringExpression, NumberExpression, NumberExpression]; + } + + export interface Ltrim { + /** + * Removes whitespace or the specified characters from the beginning of a string. + * + * @version 4.0 + * @see https://docs.mongodb.com/manual/reference/operator/aggregation/ltrim/#mongodb-expression-exp.-ltrim + */ + $ltrim: { + /** + * The string to trim. The argument can be any valid expression that resolves to a string. For more information on expressions, see Expressions. + */ + input: StringExpression; + /** + * The character(s) to trim from the beginning of the input. + * + * The argument can be any valid expression that resolves to a string. The $ltrim operator breaks down the string into individual UTF code point to trim from input. + * + * If unspecified, $ltrim removes whitespace characters, including the null character. For the list of whitespace characters, see Whitespace Characters. + */ + chars?: StringExpression; + }; + } + + export interface RegexFind { + /** + * Applies a regular expression (regex) to a string and returns information on the first matched substring. + * + * @version 4.2 + * @see https://docs.mongodb.com/manual/reference/operator/aggregation/regexFind/#mongodb-expression-exp.-regexFind + */ + $regexFind: { + /** + * The string on which you wish to apply the regex pattern. Can be a string or any valid expression that resolves to a string. + */ + input: Expression; // TODO: Resolving to string, which ones? + /** + * The regex pattern to apply. Can be any valid expression that resolves to either a string or regex pattern //. When using the regex //, you can also specify the regex options i and m (but not the s or x options): + * - "pattern" + * - /pattern/ + * - /pattern/options + * + * Alternatively, you can also specify the regex options with the options field. To specify the s or x options, you must use the options field. + * + * You cannot specify options in both the regex and the options field. + */ + regex: RegExp | string; + /** + * The following are available for use with regular expression. + * + * Note: You cannot specify options in both the regex and the options field. + * + * Option Description + * + * `i` Case insensitivity to match both upper and lower cases. You can specify the option in the options field or as part of the regex field. + * + * `m` For patterns that include anchors (i.e. ^ for the start, $ for the end), match at the beginning or end of each line for strings with multiline values. Without this option, these anchors match at beginning or end of the string. + * If the pattern contains no anchors or if the string value has no newline characters (e.g. \n), the m option has no effect. + * + * `x` "Extended" capability to ignore all white space characters in the pattern unless escaped or included in a character class. + * Additionally, it ignores characters in-between and including an un-escaped hash/pound (#) character and the next new line, so that you may include comments in complicated patterns. This only applies to data characters; white space characters may never appear within special character sequences in a pattern. + * The x option does not affect the handling of the VT character (i.e. code 11). + * You can specify the option only in the options field. + * + * `s` Allows the dot character (i.e. .) to match all characters including newline characters. + * You can specify the option only in the options field. + */ + options?: RegexOptions; + }; + } + + export interface RegexFindAll { + /** + * Applies a regular expression (regex) to a string and returns information on the all matched substrings. + * + * @version 4.2 + * @see https://docs.mongodb.com/manual/reference/operator/aggregation/regexFindAll/#mongodb-expression-exp.-regexFindAll + */ + $regexFindAll: { + /** + * The string on which you wish to apply the regex pattern. Can be a string or any valid expression that resolves to a string. + */ + input: Expression; // TODO: Resolving to string, which ones? + /** + * The regex pattern to apply. Can be any valid expression that resolves to either a string or regex pattern //. When using the regex //, you can also specify the regex options i and m (but not the s or x options): + * - "pattern" + * - /pattern/ + * - /pattern/options + * + * Alternatively, you can also specify the regex options with the options field. To specify the s or x options, you must use the options field. + * + * You cannot specify options in both the regex and the options field. + */ + regex: RegExp | string; + /** + * The following are available for use with regular expression. + * + * Note: You cannot specify options in both the regex and the options field. + * + * Option Description + * + * `i` Case insensitivity to match both upper and lower cases. You can specify the option in the options field or as part of the regex field. + * + * `m` For patterns that include anchors (i.e. ^ for the start, $ for the end), match at the beginning or end of each line for strings with multiline values. Without this option, these anchors match at beginning or end of the string. + * If the pattern contains no anchors or if the string value has no newline characters (e.g. \n), the m option has no effect. + * + * `x` "Extended" capability to ignore all white space characters in the pattern unless escaped or included in a character class. + * Additionally, it ignores characters in-between and including an un-escaped hash/pound (#) character and the next new line, so that you may include comments in complicated patterns. This only applies to data characters; white space characters may never appear within special character sequences in a pattern. + * The x option does not affect the handling of the VT character (i.e. code 11). + * You can specify the option only in the options field. + * + * `s` Allows the dot character (i.e. .) to match all characters including newline characters. + * You can specify the option only in the options field. + */ + options?: RegexOptions; + }; + } + + export interface RegexMatch { + /** + * Applies a regular expression (regex) to a string and returns a boolean that indicates if a match is found or not. + * + * @version 4.2 + * @see https://docs.mongodb.com/manual/reference/operator/aggregation/regexMatch/#mongodb-expression-exp.-regexMatch + */ + $regexMatch: { + /** + * The string on which you wish to apply the regex pattern. Can be a string or any valid expression that resolves to a string. + */ + input: Expression; // TODO: Resolving to string, which ones? + /** + * The regex pattern to apply. Can be any valid expression that resolves to either a string or regex pattern //. When using the regex //, you can also specify the regex options i and m (but not the s or x options): + * - "pattern" + * - /pattern/ + * - /pattern/options + * + * Alternatively, you can also specify the regex options with the options field. To specify the s or x options, you must use the options field. + * + * You cannot specify options in both the regex and the options field. + */ + regex: RegExp | string; + /** + * The following are available for use with regular expression. + * + * Note: You cannot specify options in both the regex and the options field. + * + * Option Description + * + * `i` Case insensitivity to match both upper and lower cases. You can specify the option in the options field or as part of the regex field. + * + * `m` For patterns that include anchors (i.e. ^ for the start, $ for the end), match at the beginning or end of each line for strings with multiline values. Without this option, these anchors match at beginning or end of the string. + * If the pattern contains no anchors or if the string value has no newline characters (e.g. \n), the m option has no effect. + * + * `x` "Extended" capability to ignore all white space characters in the pattern unless escaped or included in a character class. + * Additionally, it ignores characters in-between and including an un-escaped hash/pound (#) character and the next new line, so that you may include comments in complicated patterns. This only applies to data characters; white space characters may never appear within special character sequences in a pattern. + * The x option does not affect the handling of the VT character (i.e. code 11). + * You can specify the option only in the options field. + * + * `s` Allows the dot character (i.e. .) to match all characters including newline characters. + * You can specify the option only in the options field. + */ + options?: RegexOptions; + }; + } + + export interface ReplaceOne { + /** + * Replaces the first instance of a matched string in a given input. + * + * @version 4.4 + * @see https://docs.mongodb.com/manual/reference/operator/aggregation/replaceOne/#mongodb-expression-exp.-replaceOne + */ + $replaceOne: { + /** + * The string on which you wish to apply the find. Can be any valid expression that resolves to a string or a null. If input refers to a field that is missing, $replaceOne returns null. + */ + input: StringExpression; + /** + * The string to search for within the given input. Can be any valid expression that resolves to a string or a null. If find refers to a field that is missing, $replaceOne returns null. + */ + find: StringExpression; + /** + * The string to use to replace the first matched instance of find in input. Can be any valid expression that resolves to a string or a null. + */ + replacement: StringExpression; + }; + } + + export interface ReplaceAll { + /** + * Replaces all instances of a matched string in a given input. + * + * @version 4.4 + * @see https://docs.mongodb.com/manual/reference/operator/aggregation/replaceAll/#mongodb-expression-exp.-replaceAll + */ + $replaceAll: { + /** + * The string on which you wish to apply the find. Can be any valid expression that resolves to a string or a null. If input refers to a field that is missing, $replaceAll returns null. + */ + input: StringExpression; + /** + * The string to search for within the given input. Can be any valid expression that resolves to a string or a null. If find refers to a field that is missing, $replaceAll returns null. + */ + find: StringExpression; + /** + * The string to use to replace all matched instances of find in input. Can be any valid expression that resolves to a string or a null. + */ + replacement: StringExpression; + }; + } + + export interface Rtrim { + /** + * Removes whitespace or the specified characters from the end of a string. + * + * @version 4.0 + * @see https://docs.mongodb.com/manual/reference/operator/aggregation/rtrim/#mongodb-expression-exp.-rtrim + */ + $rtrim: { + /** + * The string to trim. The argument can be any valid expression that resolves to a string. For more information on expressions, see Expressions. + */ + input: StringExpression; + /** + * The character(s) to trim from the beginning of the input. + * + * The argument can be any valid expression that resolves to a string. The $rtrim operator breaks down the string into individual UTF code point to trim from input. + * + * If unspecified, $rtrim removes whitespace characters, including the null character. For the list of whitespace characters, see Whitespace Characters. + */ + chars?: StringExpression; + }; + } + + export interface Split { + /** + * Splits a string into substrings based on a delimiter. Returns an array of substrings. If the delimiter is not found within the string, returns an array containing the original string. + * + * @version 3.4 + * @see https://docs.mongodb.com/manual/reference/operator/aggregation/split/#mongodb-expression-exp.-split + */ + $split: [StringExpression, StringExpression]; + } + + export interface StrLenBytes { + /** + * Returns the number of UTF-8 encoded bytes in a string. + * + * @version 3.4 + * @see https://docs.mongodb.com/manual/reference/operator/aggregation/strLenBytes/#mongodb-expression-exp.-strLenBytes + */ + $strLenBytes: StringExpression; + } + + export interface StrLenCP { + /** + * Returns the number of UTF-8 code points in a string. + * + * @version 3.4 + * @see https://docs.mongodb.com/manual/reference/operator/aggregation/strLenCP/#mongodb-expression-exp.-strLenCP + */ + $strLenCP: StringExpression; + } + + export interface Strcasecmp { + /** + * Performs case-insensitive string comparison and returns: 0 if two strings are equivalent, 1 if the first string is greater than the second, and -1 if the first string is less than the second. + * + * @see https://docs.mongodb.com/manual/reference/operator/aggregation/strcasecmp/#mongodb-expression-exp.-strcasecmp + */ + $strcasecmp: [StringExpression, StringExpression]; + } + + export interface Substr { + /** + * Deprecated. Use $substrBytes or $substrCP. + * + * @deprecated 3.4 + * @alias {Expression.SubstrBytes} + * @see https://docs.mongodb.com/manual/reference/operator/aggregation/substr/#mongodb-expression-exp.-substr + */ + $substr: [StringExpression, number, number]; + } + + export interface SubstrBytes { + /** + * Returns the substring of a string. Starts with the character at the specified UTF-8 byte index (zero-based) in the string and continues for the specified number of bytes. + * + * @version 3.4 + * @see https://docs.mongodb.com/manual/reference/operator/aggregation/substrBytes/#mongodb-expression-exp.-substrBytes + */ + $substrBytes: [StringExpression, number, number]; + } + + export interface SubstrCP { + /** + * Returns the substring of a string. Starts with the character at the specified UTF-8 code point (CP) index (zero-based) in the string and continues for the number of code points specified. + * + * @version 3.4 + * @see https://docs.mongodb.com/manual/reference/operator/aggregation/substrCP/#mongodb-expression-exp.-substrCP + */ + $substrCP: [StringExpression, number, number]; + } + + export interface ToLower { + /** + * Converts a string to lowercase. Accepts a single argument expression. + * + * @see https://docs.mongodb.com/manual/reference/operator/aggregation/toLower/#mongodb-expression-exp.-toLower + */ + $toLower: StringExpression; + } + + export interface ToString { + /** + * Converts value to a string. + * + * @version 4.0 + * @see https://docs.mongodb.com/manual/reference/operator/aggregation/toString/#mongodb-expression-exp.-toString + */ + $toString: Expression; + } + + export interface Trim { + /** + * Removes whitespace or the specified characters from the beginning and end of a string. + * + * @version 4.0 + * @see https://docs.mongodb.com/manual/reference/operator/aggregation/trim/#mongodb-expression-exp.-trim + */ + $trim: { + /** + * The string to trim. The argument can be any valid expression that resolves to a string. For more information on expressions, see Expressions. + */ + input: StringExpression; + /** + * The character(s) to trim from the beginning of the input. + * + * The argument can be any valid expression that resolves to a string. The $trim operator breaks down the string into individual UTF code point to trim from input. + * + * If unspecified, $trim removes whitespace characters, including the null character. For the list of whitespace characters, see Whitespace Characters. + */ + chars?: StringExpression; + }; + } + + export interface ToUpper { + /** + * Converts a string to uppercase. Accepts a single argument expression. + * + * @see https://docs.mongodb.com/manual/reference/operator/aggregation/toUpper/#mongodb-expression-exp.-toUpper + */ + $toUpper: StringExpression; + } + + export interface Literal { + + /** + * Returns a value without parsing. Use for values that the aggregation pipeline may interpret as an + * expression. + * + * @see https://docs.mongodb.com/manual/reference/operator/aggregation/literal/#mongodb-expression-exp.-literal + */ + $literal: any; + } + + export interface GetField { + + /** + * Returns the value of a specified field from a document. If you don't specify an object, $getField returns + * the value of the field from $$CURRENT. + * + * @version 4.4.2 + * @see https://docs.mongodb.com/manual/reference/operator/aggregation/getField/#mongodb-expression-exp.-getField + */ + $getField: { + /** + * Field in the input object for which you want to return a value. field can be any valid expression that + * resolves to a string constant. + */ + field: StringExpression; + /** + * A valid expression that contains the field for which you want to return a value. input must resolve to an + * object, missing, null, or undefined. If omitted, defaults to the document currently being processed in the + * pipeline ($$CURRENT). + */ + input?: ObjectExpression | SpecialPathVariables | NullExpression; + } + } + + export interface Rand { + + /** + * Returns a random float between 0 and 1 each time it is called. + * + * @version 4.4.2 + * @see https://docs.mongodb.com/manual/reference/operator/aggregation/rand/#mongodb-expression-exp.-rand + */ + $rand: Record; + } + + export interface SampleRate { + + /** + * Matches a random selection of input documents. The number of documents selected approximates the sample + * rate expressed as a percentage of the total number of documents. + * + * @version 4.4.2 + * @see https://docs.mongodb.com/manual/reference/operator/aggregation/sampleRate/#mongodb-expression-exp.-sampleRate + */ + $sampleRate: number; + } + + export interface MergeObjects { + + /** + * Combines multiple documents into a single document. + * + * @version 3.6 + * @see https://docs.mongodb.com/manual/reference/operator/aggregation/mergeObjects/#mongodb-expression-exp.-mergeObjects + */ + $mergeObjects: ObjectExpression | ObjectExpression[] | ArrayExpression; + } + + export interface SetField { + + /** + * Adds, updates, or removes a specified field in a document. + * + * @version 5.0 + * @see https://docs.mongodb.com/manual/reference/operator/aggregation/setField/#mongodb-expression-exp.-setField + */ + $setField: { + /** + * Field in the input object that you want to add, update, or remove. field can be any valid expression that + * resolves to a string constant. + */ + field: StringExpression; + /** + * Document that contains the field that you want to add or update. input must resolve to an object, missing, + * null, or undefined + */ + input?: ObjectExpression | NullExpression; + /** + * The value that you want to assign to field. value can be any valid expression. + */ + value?: Expression | SpecialPathVariables; + } + } + + export interface UnsetField { + + /** + * Removes a specified field in a document. + * + * @version 5.0 + * @see https://docs.mongodb.com/manual/reference/operator/aggregation/unsetField/#mongodb-expression-exp.-unsetField + */ + $unsetField: { + /** + * Field in the input object that you want to add, update, or remove. field can be any valid expression that + * resolves to a string constant. + */ + field: StringExpression; + /** + * Document that contains the field that you want to add or update. input must resolve to an object, missing, + * null, or undefined. + */ + input?: ObjectExpression | SpecialPathVariables | NullExpression; + } + } + + export interface Let { + + /** + * Binds variables for use in the specified expression, and returns the result of the expression. + * + * @version 5.0 + * @see https://docs.mongodb.com/manual/reference/operator/aggregation/let/#mongodb-expression-exp.-let + */ + $let: { + /** + * Assignment block for the variables accessible in the in expression. To assign a variable, specify a + * string for the variable name and assign a valid expression for the value. + */ + vars: { [key: string]: Expression; }; + /** + * The expression to evaluate. + */ + in: Expression; + } + } + + export interface AllElementsTrue { + /** + * Evaluates an array as a set and returns true if no element in the array is false. Otherwise, returns false. An + * empty array returns true. + * + * @see https://docs.mongodb.com/manual/reference/operator/aggregation/allElementsTrue/#mongodb-expression-exp.-allElementsTrue + */ + $allElementsTrue: ArrayExpression; + } + + export interface AnyElementsTrue { + /** + * Evaluates an array as a set and returns true if any of the elements are true and false otherwise. An empty + * array returns false. + * + * @see https://docs.mongodb.com/manual/reference/operator/aggregation/anyElementsTrue/#mongodb-expression-exp.-anyElementsTrue + */ + $anyElementTrue: ArrayExpression; + } + + export interface SetDifference { + /** + * Takes two sets and returns an array containing the elements that only exist in the first set; i.e. performs a + * relative complement of the second set relative to the first. + * + * @see https://docs.mongodb.com/manual/reference/operator/aggregation/setDifference/#mongodb-expression-exp.-setDifference + */ + $setDifference: [ArrayExpression, ArrayExpression]; + } + + export interface SetEquals { + /** + * Compares two or more arrays and returns true if they have the same distinct elements and false otherwise. + * + * @see https://docs.mongodb.com/manual/reference/operator/aggregation/setEquals/#mongodb-expression-exp.-setEquals + */ + $setEquals: ArrayExpression[]; + } + + export interface SetIntersection { + /** + * Takes two or more arrays and returns an array that contains the elements that appear in every input array. + * + * @see https://docs.mongodb.com/manual/reference/operator/aggregation/setIntersection/#mongodb-expression-exp.-setIntersection + */ + $setIntersection: ArrayExpression[]; + } + + export interface SetIsSubset { + /** + * Takes two arrays and returns true when the first array is a subset of the second, including when the first + * array equals the second array, and false otherwise. + * + * @see https://docs.mongodb.com/manual/reference/operator/aggregation/setIsSubset/#mongodb-expression-exp.-setIsSubset + */ + $setIsSubset: [ArrayExpression, ArrayExpression]; + } + + export interface SetUnion { + /** + * Takes two or more arrays and returns an array containing the elements that appear in any input array. + * + * @see https://docs.mongodb.com/manual/reference/operator/aggregation/setUnion/#mongodb-expression-exp.-setUnion + */ + $setUnion: ArrayExpression[]; + } + + export interface Accumulator { + /** + * Defines a custom accumulator operator. Accumulators are operators that maintain their state (e.g. totals, + * maximums, minimums, and related data) as documents progress through the pipeline. Use the $accumulator operator + * to execute your own JavaScript functions to implement behavior not supported by the MongoDB Query Language. See + * also $function. + * + * @version 4.4 + * @see https://docs.mongodb.com/manual/reference/operator/aggregation/accumulator/#mongodb-expression-exp.-accumulator + */ + $accumulator: { + /** + * Function used to initialize the state. The init function receives its arguments from the initArgs array + * expression. You can specify the function definition as either BSON type Code or String. + */ + init: CodeExpression; + /** + * Arguments passed to the init function. + */ + initArgs?: ArrayExpression; + /** + * Function used to accumulate documents. The accumulate function receives its arguments from the current state + * and accumulateArgs array expression. The result of the accumulate function becomes the new state. You can + * specify the function definition as either BSON type Code or String. + */ + accumulate: CodeExpression; + /** + * Arguments passed to the accumulate function. You can use accumulateArgs to specify what field value(s) to + * pass to the accumulate function. + */ + accumulateArgs: ArrayExpression; + /** + * Function used to merge two internal states. merge must be either a String or Code BSON type. merge returns + * the combined result of the two merged states. For information on when the merge function is called, see Merge + * Two States with $merge. + */ + merge: CodeExpression; + /** + * Function used to update the result of the accumulation. + */ + finalize?: CodeExpression; + /** + * The language used in the $accumulator code. + */ + lang: 'js'; + } + } + + export interface AddToSet { + /** + * Returns an array of all unique values that results from applying an expression to each document in a group. + * + * @version 5.0 + * @see https://docs.mongodb.com/manual/reference/operator/aggregation/addToSet/#mongodb-expression-exp.-addToSet + */ + $addToSet: ArrayExpression; + } + + export interface Avg { + /** + * Returns the average value of the numeric values. $avg ignores non-numeric values. + * + * @version 5.0 + * @see https://docs.mongodb.com/manual/reference/operator/aggregation/avg/#mongodb-expression-exp.-avg + */ + $avg: ArrayExpression; + } + + export interface Count { + /** + * Returns the number of documents in a group. + * + * @version 5.0 + * @see https://docs.mongodb.com/manual/reference/operator/aggregation/count/#mongodb-expression-exp.-count + */ + $count: Record; + } + + export interface CovariancePop { + /** + * Returns the population covariance of two numeric expressions that are evaluated using documents in the + * $setWindowFields stage window. + * + * @version 5.0 + * @see https://docs.mongodb.com/manual/reference/operator/aggregation/covariancePop/#mongodb-expression-exp.-covariancePop + */ + $covariancePop: [NumberExpression, NumberExpression]; + } + + export interface CovarianceSamp { + /** + * Returns the sample covariance of two numeric expressions that are evaluated using documents in the + * $setWindowFields stage window. + * + * @version 5.0 + * @see https://docs.mongodb.com/manual/reference/operator/aggregation/covarianceSamp/#mongodb-expression-exp.-covarianceSamp + */ + $covarianceSamp: [NumberExpression, NumberExpression]; + } + + export interface DenseRank { + /** + * Returns the document position (known as the rank) relative to other documents in the $setWindowFields stage + * partition. + * + * @version 5.0 + * @see https://docs.mongodb.com/manual/reference/operator/aggregation/denseRank/#mongodb-expression-exp.-denseRank + */ + $denseRank: Record; + } + + export interface Derivative { + /** + * Returns the average rate of change within the specified window, which is calculated using the: + * + * @version 5.0 + * @see https://docs.mongodb.com/manual/reference/operator/aggregation/derivative/#mongodb-expression-exp.-derivative + */ + $derivative: { + /** + * Specifies the expression to evaluate. The expression must evaluate to a number. + */ + input: NumberExpression; + /** + * A string that specifies the time unit. + */ + unit?: DateUnit; + } + } + + export interface DocumentNumber { + /** + * Returns the position of a document (known as the document number) in the $setWindowFields stage partition. + * + * @version 5.0 + * @see https://docs.mongodb.com/manual/reference/operator/aggregation/documentNumber/#mongodb-expression-exp.-documentNumber + */ + $documentNumber: Record; + } + + export interface ExpMovingAvg { + /** + * Returns the exponential moving average of numeric expressions applied to documents in a partition defined in + * the $setWindowFields stage. + * + * @version 5.0 + * @see https://docs.mongodb.com/manual/reference/operator/aggregation/expMovingAvg/#mongodb-expression-exp.-expMovingAvg + */ + $expMovingAvg: { + /** + * Specifies the expression to evaluate. Non-numeric expressions are ignored. + */ + input: Expression; + + /** + * An integer that specifies the number of historical documents that have a significant mathematical weight in + * the exponential moving average calculation, with the most recent documents contributing the most weight. + * + * You must specify either N or alpha. You cannot specify both. + */ + N: NumberExpression; + + /** + * A double that specifies the exponential decay value to use in the exponential moving average calculation. A + * higher alpha value assigns a lower mathematical significance to previous results from the calculation. + * + * You must specify either N or alpha. You cannot specify both. + */ + alpha?: never; + } | + { + /** + * Specifies the expression to evaluate. Non-numeric expressions are ignored. + */ + input: Expression; + + /** + * An integer that specifies the number of historical documents that have a significant mathematical weight in + * the exponential moving average calculation, with the most recent documents contributing the most weight. + * + * You must specify either N or alpha. You cannot specify both. + */ + N?: never; + + /** + * A double that specifies the exponential decay value to use in the exponential moving average calculation. A + * higher alpha value assigns a lower mathematical significance to previous results from the calculation. + * + * You must specify either N or alpha. You cannot specify both. + */ + alpha: NumberExpression; + } + } + + export interface Integral { + /** + * Returns the approximation of the area under a curve, which is calculated using the trapezoidal rule where each + * set of adjacent documents form a trapezoid using the: + * + * @version 5.0 + * @see https://docs.mongodb.com/manual/reference/operator/aggregation/integral/#mongodb-expression-exp.-integral + */ + $integral: { + /** + * Specifies the expression to evaluate. You must provide an expression that returns a number. + */ + input: NumberExpression; + + /** + * A string that specifies the time unit. + */ + unit?: DateUnit; + } + } + + export interface Max { + /** + * Returns the maximum value. $max compares both value and type, using the specified BSON comparison order for + * values of different types. + * + * @version 5.0 + * @see https://docs.mongodb.com/manual/reference/operator/aggregation/max/#mongodb-expression-exp.-max + */ + $max: Expression | Expression[]; + } + + export interface Min { + /** + * Returns the minimum value. $min compares both value and type, using the specified BSON comparison order for + * values of different types. + * + * @version 5.0 + * @see https://docs.mongodb.com/manual/reference/operator/aggregation/min/#mongodb-expression-exp.-min + */ + $min: Expression | Expression[]; + } + + export interface Push { + /** + * Returns an array of all values that result from applying an expression to documents. + * + * @version 5.0 + * @see https://docs.mongodb.com/manual/reference/operator/aggregation/push/#mongodb-expression-exp.-push + */ + $push: Expression | Record; + } + + export interface Rank { + /** + * Returns the document position (known as the rank) relative to other documents in the $setWindowFields stage + * partition. + * + * @version 5.0 + * @see https://docs.mongodb.com/manual/reference/operator/aggregation/rank/#mongodb-expression-exp.-rank + */ + $rank: Record; + } + + export interface Shift { + /** + * Returns the value from an expression applied to a document in a specified position relative to the current + * document in the $setWindowFields stage partition. + * + * @version 5.0 + * @see https://docs.mongodb.com/manual/reference/operator/aggregation/shift/#mongodb-expression-exp.-shift + */ + $shift: { + /** + * Specifies an expression to evaluate and return in the output. + */ + output: Expression; + /** + * Specifies an integer with a numeric document position relative to the current document in the output. + */ + by: number; + /** + * Specifies an optional default expression to evaluate if the document position is outside of the implicit + * $setWindowFields stage window. The implicit window contains all the documents in the partition. + */ + default?: Expression; + } + } + + export interface StdDevPop { + /** + * Calculates the population standard deviation of the input values. Use if the values encompass the entire + * population of data you want to represent and do not wish to generalize about a larger population. $stdDevPop + * ignores non-numeric values. + * + * @version 5.0 + * @see https://docs.mongodb.com/manual/reference/operator/aggregation/stdDevPop/#mongodb-expression-exp.-stdDevPop + */ + $stdDevPop: Expression; + } + + export interface StdDevSamp { + /** + * Calculates the sample standard deviation of the input values. Use if the values encompass a sample of a + * population of data from which to generalize about the population. $stdDevSamp ignores non-numeric values. + * + * @version 5.0 + * @see https://docs.mongodb.com/manual/reference/operator/aggregation/stdDevSamp/#mongodb-expression-exp.-stdDevSamp + */ + $stdDevSamp: Expression; + } + + export interface Sum { + /** + * Calculates and returns the collective sum of numeric values. $sum ignores non-numeric values. + * + * @version 5.0 + * @see https://docs.mongodb.com/manual/reference/operator/aggregation/sum/#mongodb-expression-exp.-sum + */ + $sum: number | Expression | Expression[]; + } + + export interface Convert { + /** + * Checks if the specified expression resolves to one of the following numeric + * - Integer + * - Decimal + * - Double + * - Long + * + * @version 4.4 + * @see https://docs.mongodb.com/manual/reference/operator/aggregation/convert/#mongodb-expression-exp.-convert + */ + $convert: { + input: Expression; + to: K; + onError?: Expression; + onNull?: Expression; + }; + } + + export interface IsNumber { + /** + * Checks if the specified expression resolves to one of the following numeric + * - Integer + * - Decimal + * - Double + * - Long + * + * @version 4.4 + * @see https://docs.mongodb.com/manual/reference/operator/aggregation/isNumber/#mongodb-expression-exp.-isNumber + */ + $isNumber: Expression; + } + + export interface ToBool { + /** + * Converts a value to a boolean. + * + * @version 4.0 + * @see https://docs.mongodb.com/manual/reference/operator/aggregation/toBool/#mongodb-expression-exp.-toBool + */ + $toBool: Expression; + } + + export interface ToDecimal { + /** + * Converts a value to a decimal. If the value cannot be converted to a decimal, $toDecimal errors. If the value + * is null or missing, $toDecimal returns null. + * + * @version 4.0 + * @see https://docs.mongodb.com/manual/reference/operator/aggregation/toDecimal/#mongodb-expression-exp.-toDecimal + */ + $toDecimal: Expression; + } + + export interface ToDouble { + /** + * Converts a value to a double. If the value cannot be converted to an double, $toDouble errors. If the value is + * null or missing, $toDouble returns null. + * + * @version 4.0 + * @see https://docs.mongodb.com/manual/reference/operator/aggregation/toDouble/#mongodb-expression-exp.-toDouble + */ + $toDouble: Expression; + } + + export interface ToInt { + /** + * Converts a value to a long. If the value cannot be converted to a long, $toLong errors. If the value is null or + * missing, $toLong returns null. + * + * @version 4.0 + * @see https://docs.mongodb.com/manual/reference/operator/aggregation/toInt/#mongodb-expression-exp.-toInt + */ + $toInt: Expression; + } + + export interface ToLong { + /** + * Converts a value to a long. If the value cannot be converted to a long, $toLong errors. If the value is null or + * missing, $toLong returns null. + * + * @version 4.0 + * @see https://docs.mongodb.com/manual/reference/operator/aggregation/toLong/#mongodb-expression-exp.-toLong + */ + $toLong: Expression; + } + + export interface ToObjectId { + /** + * Converts a value to an ObjectId(). If the value cannot be converted to an ObjectId, $toObjectId errors. If the + * value is null or missing, $toObjectId returns null. + * + * @version 4.0 + * @see https://docs.mongodb.com/manual/reference/operator/aggregation/toObjectId/#mongodb-expression-exp.-toObjectId + */ + $toObjectId: Expression; + } + + export interface ToString { + /** + * Converts a value to a string. If the value cannot be converted to a string, $toString errors. If the value is + * null or missing, $toString returns null. + * + * @version 4.0 + * @see https://docs.mongodb.com/manual/reference/operator/aggregation/toString/#mongodb-expression-exp.-toString + */ + $toString: Expression; + } + + export interface Type { + /** + * Returns a string that specifies the BSON type of the argument. + * + * @version 3.4 + * @see https://docs.mongodb.com/manual/reference/operator/aggregation/type/#mongodb-expression-exp.-type + */ + $type: Expression; + } + + export interface BinarySize { + /** + * Returns the size of a given string or binary data value's content in bytes. + * + * @version 4.4 + * @see https://docs.mongodb.com/manual/reference/operator/aggregation/binarySize/#mongodb-expression-exp.-binarySize + */ + $binarySize: NullExpression | StringExpression | BinaryExpression; + } + + export interface BsonSize { + /** + * Returns the size in bytes of a given document (i.e. bsontype Object) when encoded as BSON. You can use + * $bsonSize as an alternative to the Object.bsonSize() method. + * + * @version 4.4 + * @see https://docs.mongodb.com/manual/reference/operator/aggregation/bsonSize/#mongodb-expression-exp.-bsonSize + */ + $bsonSize: NullExpression | ObjectExpression; + } + + export interface Function { + /** + * Defines a custom aggregation function or expression in JavaScript. + * + * @version 4.4 + * @see https://docs.mongodb.com/manual/reference/operator/aggregation/function/#mongodb-expression-exp.-function + */ + $function: { + /** + * The function definition. You can specify the function definition as either BSON type Code or String. + */ + body: CodeExpression; + /** + * Arguments passed to the function body. If the body function does not take an argument, you can specify an + * empty array [ ] + */ + args: ArrayExpression; + /** + * The language used in the body. You must specify lang: "js". + */ + lang: 'js' + }; + } + } + + type Path = string; + + export type Expression = + Path | + ArithmeticExpressionOperator | + ArrayExpressionOperator | + BooleanExpressionOperator | + ComparisonExpressionOperator | + ConditionalExpressionOperator | + CustomAggregationExpressionOperator | + DataSizeOperator | + DateExpressionOperator | + LiteralExpressionOperator | + MiscellaneousExpressionOperator | + ObjectExpressionOperator | + SetExpressionOperator | + StringExpressionOperator | + TextExpressionOperator | + TrigonometryExpressionOperator | + TypeExpressionOperator | + AccumulatorOperator | + VariableExpressionOperator | + WindowOperator; + + export type NullExpression = null; + + export type CodeExpression = + string | + Function; + + export type BinaryExpression = + Path; + + export type FunctionExpression = + Expression.Function; + + export type AnyExpression = + ArrayExpression | + BooleanExpression | + NumberExpression | + ObjectExpression | + StringExpression | + DateExpression | + BinaryExpression | + FunctionExpression | + ObjectIdExpression; + + export type ObjectIdExpression = + TypeExpressionOperatorReturningObjectId; + + export type ArrayExpression = + T[] | + Path | + ArrayExpressionOperatorReturningAny | + ArrayExpressionOperatorReturningArray | + StringExpressionOperatorReturningArray | + ObjectExpressionOperatorReturningArray | + SetExpressionOperatorReturningArray | + LiteralExpressionOperatorReturningAny | + WindowOperatorReturningArray | + CustomAggregationExpressionOperatorReturningAny | + WindowOperatorReturningAny; + + export type BooleanExpression = + boolean | + Path | + BooleanExpressionOperator | + ArrayExpressionOperatorReturningAny | + ComparisonExpressionOperatorReturningBoolean | + StringExpressionOperatorReturningBoolean | + SetExpressionOperatorReturningBoolean | + LiteralExpressionOperatorReturningAny | + CustomAggregationExpressionOperatorReturningAny | + TypeExpressionOperatorReturningBoolean; + + export type NumberExpression = + number | + Path | + ArrayExpressionOperatorReturningAny | + ArrayExpressionOperatorReturningNumber | + ArithmeticExpressionOperator | + ComparisonExpressionOperatorReturningNumber | + TrigonometryExpressionOperator | + MiscellaneousExpressionOperatorReturningNumber | + StringExpressionOperatorReturningNumber | + LiteralExpressionOperatorReturningAny | + ObjectExpressionOperator | + SetExpressionOperator | + WindowOperatorReturningNumber | + WindowOperatorReturningAny | + DataSizeOperatorReturningNumber | + CustomAggregationExpressionOperatorReturningAny | + TypeExpressionOperatorReturningNumber | + DateExpression; + + export type ObjectExpression = + Path | + ArrayExpressionOperatorReturningAny | + DateExpressionOperatorReturningObject | + StringExpressionOperatorReturningObject | + ObjectExpressionOperatorReturningObject | + CustomAggregationExpressionOperatorReturningAny | + LiteralExpressionOperatorReturningAny; + + export type StringExpression = + Path | + ArrayExpressionOperatorReturningAny | + DateExpressionOperatorReturningString | + StringExpressionOperatorReturningString | + LiteralExpressionReturningAny | + CustomAggregationExpressionOperatorReturningAny | + TypeExpressionOperatorReturningString | + T; + + export type DateExpression = + Path | + NativeDate | + DateExpressionOperatorReturningDate | + TypeExpressionOperatorReturningDate | + LiteralExpressionReturningAny; + + export type ArithmeticExpressionOperator = + Expression.Abs | + Expression.Add | + Expression.Ceil | + Expression.Divide | + Expression.Exp | + Expression.Floor | + Expression.Ln | + Expression.Log | + Expression.Log10 | + Expression.Mod | + Expression.Multiply | + Expression.Pow | + Expression.Round | + Expression.Sqrt | + Expression.Subtract | + Expression.Trunc; + + export type ArrayExpressionOperator = + ArrayExpressionOperatorReturningAny | + ArrayExpressionOperatorReturningBoolean | + ArrayExpressionOperatorReturningNumber | + ArrayExpressionOperatorReturningObject; + + export type LiteralExpressionOperator = + Expression.Literal; + + export type LiteralExpressionReturningAny = + LiteralExpressionOperatorReturningAny; + + export type LiteralExpressionOperatorReturningAny = + Expression.Literal; + + export type MiscellaneousExpressionOperator = + Expression.Rand | + Expression.SampleRate; + + export type MiscellaneousExpressionOperatorReturningNumber = + Expression.Rand; + + export type ArrayExpressionOperatorReturningAny = + Expression.ArrayElemAt | + Expression.First | + Expression.Last | + Expression.Reduce; + + export type ArrayExpressionOperatorReturningArray = + Expression.ConcatArrays | + Expression.Filter | + Expression.Map | + Expression.ObjectToArray | + Expression.Range | + Expression.ReverseArray | + Expression.Slice | + Expression.Zip; + + export type ArrayExpressionOperatorReturningNumber = + Expression.IndexOfArray | + Expression.Size; + + export type ArrayExpressionOperatorReturningObject = + Expression.ArrayToObject; + + export type ArrayExpressionOperatorReturningBoolean = + Expression.In | + Expression.IsArray; + + export type BooleanExpressionOperator = + Expression.And | + Expression.Or | + Expression.Not; + + export type ComparisonExpressionOperator = + ComparisonExpressionOperatorReturningBoolean | + ComparisonExpressionOperatorReturningNumber; + + export type ComparisonExpressionOperatorReturningBoolean = + Expression.Eq | + Expression.Gt | + Expression.Gte | + Expression.Lt | + Expression.Lte | + Expression.Ne; + + export type ComparisonExpressionOperatorReturningNumber = + Expression.Cmp; + + export type ConditionalExpressionOperator = + Expression.Cond | + Expression.IfNull | + Expression.Switch; + + export type StringExpressionOperator = + StringExpressionOperatorReturningArray | + StringExpressionOperatorReturningBoolean | + StringExpressionOperatorReturningNumber | + StringExpressionOperatorReturningObject | + StringExpressionOperatorReturningString; + + export type StringExpressionOperatorReturningArray = + Expression.RegexFindAll | + Expression.Split; + + export type StringExpressionOperatorReturningBoolean = + Expression.RegexMatch; + + export type StringExpressionOperatorReturningNumber = + Expression.IndexOfBytes | + Expression.IndexOfCP | + Expression.Strcasecmp | + Expression.StrLenBytes | + Expression.StrLenCP; + + export type StringExpressionOperatorReturningObject = + Expression.RegexFind; + + export type StringExpressionOperatorReturningString = + Expression.Concat | + Expression.Ltrim | + Expression.Ltrim | + Expression.ReplaceOne | + Expression.ReplaceAll | + Expression.Substr | + Expression.SubstrBytes | + Expression.SubstrCP | + Expression.ToLower | + Expression.ToString | + Expression.ToUpper | + Expression.Trim; + + export type ObjectExpressionOperator = + Expression.MergeObjects | + Expression.ObjectToArray | + Expression.SetField | + Expression.UnsetField; + + export type ObjectExpressionOperatorReturningArray = + Expression.ObjectToArray; + + export type ObjectExpressionOperatorReturningObject = + Expression.MergeObjects | + Expression.SetField | + Expression.UnsetField; + + export type VariableExpressionOperator = + Expression.Let; + + export type VariableExpressionOperatorReturningAny = + Expression.Let; + + export type SetExpressionOperator = + Expression.AllElementsTrue | + Expression.AnyElementsTrue | + Expression.SetDifference | + Expression.SetEquals | + Expression.SetIntersection | + Expression.SetIsSubset | + Expression.SetUnion; + + export type SetExpressionOperatorReturningBoolean = + Expression.AllElementsTrue | + Expression.AnyElementsTrue | + Expression.SetEquals | + Expression.SetIsSubset; + + export type SetExpressionOperatorReturningArray = + Expression.SetDifference | + Expression.SetIntersection | + Expression.SetUnion; + + /** + * Trigonometry expressions perform trigonometric operations on numbers. + * Values that represent angles are always input or output in radians. + * Use $degreesToRadians and $radiansToDegrees to convert between degree + * and radian measurements. + */ + export type TrigonometryExpressionOperator = + Expression.Sin | + Expression.Cos | + Expression.Tan | + Expression.Asin | + Expression.Acos | + Expression.Atan | + Expression.Atan2 | + Expression.Asinh | + Expression.Acosh | + Expression.Atanh | + Expression.Sinh | + Expression.Cosh | + Expression.Tanh | + Expression.DegreesToRadians | + Expression.RadiansToDegrees; + + export type TextExpressionOperator = + Expression.Meta; + + export type WindowOperator = + Expression.AddToSet | + Expression.Avg | + Expression.Count | + Expression.CovariancePop | + Expression.CovarianceSamp | + Expression.DenseRank | + Expression.Derivative | + Expression.DocumentNumber | + Expression.ExpMovingAvg | + Expression.First | + Expression.Integral | + Expression.Last | + Expression.Max | + Expression.Min | + Expression.Push | + Expression.Rank | + Expression.Shift | + Expression.StdDevPop | + Expression.StdDevSamp | + Expression.Sum; + + export type WindowOperatorReturningAny = + Expression.First | + Expression.Last | + Expression.Shift; + + export type WindowOperatorReturningArray = + Expression.AddToSet | + Expression.Push; + + export type WindowOperatorReturningNumber = + Expression.Avg | + Expression.Count | + Expression.CovariancePop | + Expression.CovarianceSamp | + Expression.DenseRank | + Expression.DocumentNumber | + Expression.ExpMovingAvg | + Expression.Integral | + Expression.Max | + Expression.Min | + Expression.StdDevPop | + Expression.StdDevSamp | + Expression.Sum; + + export type TypeExpressionOperator = + Expression.Convert | + Expression.IsNumber | + Expression.ToBool | + Expression.ToDate | + Expression.ToDecimal | + Expression.ToDouble | + Expression.ToInt | + Expression.ToLong | + Expression.ToObjectId | + Expression.ToString | + Expression.Type; + + export type TypeExpressionOperatorReturningNumber = + Expression.Convert<'double' | 1 | 'int' | 16 | 'long' | 18 | 'decimal' | 19> | + Expression.ToDecimal | + Expression.ToDouble | + Expression.ToInt | + Expression.ToLong; + + export type TypeExpressionOperatorReturningBoolean = + Expression.Convert<'bool' | 8> | + Expression.IsNumber | + Expression.ToBool; + + + export type TypeExpressionOperatorReturningString = + Expression.Convert<'string' | 2> | + Expression.ToString | + Expression.Type; + + export type TypeExpressionOperatorReturningObjectId = + Expression.Convert<'objectId' | 7> | + Expression.ToObjectId; + + export type TypeExpressionOperatorReturningDate = + Expression.Convert<'date' | 9> | + Expression.ToDate; + + export type DataSizeOperator = + Expression.BinarySize | + Expression.BsonSize; + + export type DataSizeOperatorReturningNumber = + Expression.BinarySize | + Expression.BsonSize; + + export type CustomAggregationExpressionOperator = + Expression.Accumulator | + Expression.Function; + + export type CustomAggregationExpressionOperatorReturningAny = + Expression.Function; + + export type AccumulatorOperator = + Expression.Accumulator | + Expression.AddToSet | + Expression.Avg | + Expression.Count | + Expression.First | + Expression.Last | + Expression.Max | + Expression.MergeObjects | + Expression.Min | + Expression.Push | + Expression.StdDevPop | + Expression.StdDevSamp | + Expression.Sum; + + export type tzExpression = UTCOffset | StringExpressionOperatorReturningBoolean | string; + + type hh = '-00' | '-01' | '-02' | '-03' | '-04' | '-05' | '-06' | '-07' | '-08' | '-09' | '-10' | '-11' | '-12' | + '+00' | '+01' | '+02' | '+03' | '+04' | '+05' | '+06' | '+07' | '+08' | '+09' | '+10' | '+11' | '+12' | '+13' | '+14'; + type mm = '00' | '30' | '45'; + + type UTCOffset = `${hh}` | `${hh}${mm}` | `${hh}:${mm}`; + + type RegexOptions = + 'i' | 'm' | 's' | 'x' | + 'is' | 'im' | 'ix' | 'si' | 'sm' | 'sx' | 'mi' | 'ms' | 'mx' | 'xi' | 'xs' | 'xm' | + 'ism' | 'isx' | 'ims' | 'imx' | 'ixs' | 'ixm' | 'sim' | 'six' | 'smi' | 'smx' | 'sxi' | 'sxm' | 'mis' | 'mix' | 'msi' | 'msx' | 'mxi' | 'mxs' | 'xis' | 'xim' | 'xsi' | 'xsm' | 'xmi' | 'xms' | + 'ismx' | 'isxm' | 'imsx' | 'imxs' | 'ixsm' | 'ixms' | 'simx' | 'sixm' | 'smix' | 'smxi' | 'sxim' | 'sxmi' | 'misx' | 'mixs' | 'msix' | 'msxi' | 'mxis' | 'mxsi' | 'xism' | 'xims' | 'xsim' | 'xsmi' | 'xmis' | 'xmsi'; + + type StartOfWeek = + 'monday' | 'mon' | + 'tuesday' | 'tue' | + 'wednesday' | 'wed' | + 'thursday' | 'thu' | + 'friday' | 'fri' | + 'saturday' | 'sat' | + 'sunday' | 'sun'; + + type DateUnit = 'year' | 'quarter' | 'week' | 'month' | 'day' | 'hour' | 'minute' | 'second' | 'millisecond'; + + type FormatString = string; + + export type DateExpressionOperator = + DateExpressionOperatorReturningDate | + DateExpressionOperatorReturningNumber | + DateExpressionOperatorReturningString | + DateExpressionOperatorReturningObject; + + export type DateExpressionOperatorReturningObject = + Expression.DateToParts; + + export type DateExpressionOperatorReturningNumber = + Expression.DateDiff | + Expression.DayOfMonth | + Expression.DayOfWeek | + Expression.DayOfYear | + Expression.IsoDayOfWeek | + Expression.IsoWeek | + Expression.IsoWeekYear | + Expression.Millisecond | + Expression.Second | + Expression.Minute | + Expression.Hour | + Expression.Month | + Expression.Year; + + export type DateExpressionOperatorReturningDate = + Expression.DateAdd | + Expression.DateFromParts | + Expression.DateFromString | + Expression.DateSubtract | + Expression.DateTrunc | + Expression.ToDate; + + export type DateExpressionOperatorReturningString = + Expression.DateToString; + +} \ No newline at end of file diff --git a/node_modules/mongoose/types/helpers.d.ts b/node_modules/mongoose/types/helpers.d.ts new file mode 100644 index 000000000..91e2ea275 --- /dev/null +++ b/node_modules/mongoose/types/helpers.d.ts @@ -0,0 +1,32 @@ +declare module 'mongoose' { + import mongodb = require('mongodb'); + + /** + * Mongoose uses this function to get the current time when setting + * [timestamps](/docs/guide.html#timestamps). You may stub out this function + * using a tool like [Sinon](https://www.npmjs.com/package/sinon) for testing. + */ + function now(): NativeDate; + + /** + * Tells `sanitizeFilter()` to skip the given object when filtering out potential query selector injection attacks. + * Use this method when you have a known query selector that you want to use. + */ + function trusted(obj: T): T; + + /** + * Returns true if the given value is a Mongoose ObjectId (using `instanceof`) or if the + * given value is a 24 character hex string, which is the most commonly used string representation + * of an ObjectId. + */ + function isObjectIdOrHexString(v: mongodb.ObjectId): true; + function isObjectIdOrHexString(v: mongodb.ObjectId | string): boolean; + function isObjectIdOrHexString(v: any): false; + + /** + * Returns true if Mongoose can cast the given value to an ObjectId, or + * false otherwise. + */ + function isValidObjectId(v: mongodb.ObjectId | Types.ObjectId): true; + function isValidObjectId(v: any): boolean; +} diff --git a/node_modules/mongoose/types/index.d.ts b/node_modules/mongoose/types/index.d.ts new file mode 100644 index 000000000..03ec6bb20 --- /dev/null +++ b/node_modules/mongoose/types/index.d.ts @@ -0,0 +1,588 @@ +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// + +declare class NativeDate extends global.Date { } + +declare module 'mongoose' { + import events = require('events'); + import mongodb = require('mongodb'); + import mongoose = require('mongoose'); + + export type Mongoose = typeof mongoose; + + /** + * Mongoose constructor. The exports object of the `mongoose` module is an instance of this + * class. Most apps will only use this one instance. + */ + export const Mongoose: new (options?: MongooseOptions | null) => Mongoose; + + export let Promise: any; + export const PromiseProvider: any; + + /** + * Can be extended to explicitly type specific models. + */ + export interface Models { + [modelName: string]: Model + } + + /** An array containing all models associated with this Mongoose instance. */ + export const models: Models; + + /** + * Removes the model named `name` from the default connection, if it exists. + * You can use this function to clean up any models you created in your tests to + * prevent OverwriteModelErrors. + */ + export function deleteModel(name: string | RegExp): Mongoose; + + /** Gets mongoose options */ + export function get(key: K): MongooseOptions[K]; + + /* ! ignore */ + export type CompileModelOptions = { overwriteModels?: boolean, connection?: Connection }; + + export function model( + name: string, + schema?: TSchema, + collection?: string, + options?: CompileModelOptions + ): Model, ObtainSchemaGeneric, ObtainSchemaGeneric, {}, TSchema> & ObtainSchemaGeneric; + + export function model(name: string, schema?: Schema | Schema, collection?: string, options?: CompileModelOptions): Model; + + export function model( + name: string, + schema?: Schema, + collection?: string, + options?: CompileModelOptions + ): U; + + /** Returns an array of model names created on this instance of Mongoose. */ + export function modelNames(): Array; + + /** + * Overwrites the current driver used by this Mongoose instance. A driver is a + * Mongoose-specific interface that defines functions like `find()`. + */ + export function setDriver(driver: any): Mongoose; + + /** The node-mongodb-native driver Mongoose uses. */ + export const mongo: typeof mongodb; + + /** Declares a global plugin executed on all Schemas. */ + export function plugin(fn: (schema: Schema, opts?: any) => void, opts?: any): Mongoose; + + /** Getter/setter around function for pluralizing collection names. */ + export function pluralize(fn?: ((str: string) => string) | null): ((str: string) => string) | null; + + /** Sets mongoose options */ + export function set(key: K, value: MongooseOptions[K]): Mongoose; + + /** The Mongoose version */ + export const version: string; + + export type AnyKeys = { [P in keyof T]?: T[P] | any }; + export interface AnyObject { + [k: string]: any + } + + export type Require_id = T extends { _id?: infer U } + ? U extends any + ? (T & { _id: Types.ObjectId }) + : T & Required<{ _id: U }> + : T & { _id: Types.ObjectId }; + + export type RequireOnlyTypedId = T extends { _id?: infer U; } + ? Required<{ _id: U }> + : { _id: Types.ObjectId }; + + export type HydratedDocument = DocType extends Document ? Require_id : (Document & Require_id & TVirtuals & TMethodsAndOverrides); + + export interface TagSet { + [k: string]: string; + } + + export interface ToObjectOptions { + /** apply all getters (path and virtual getters) */ + getters?: boolean; + /** apply virtual getters (can override getters option) */ + virtuals?: boolean | string[]; + /** if `options.virtuals = true`, you can set `options.aliases = false` to skip applying aliases. This option is a no-op if `options.virtuals = false`. */ + aliases?: boolean; + /** remove empty objects (defaults to true) */ + minimize?: boolean; + /** if set, mongoose will call this function to allow you to transform the returned object */ + transform?: boolean | ((doc: any, ret: any, options: any) => any); + /** if true, replace any conventionally populated paths with the original id in the output. Has no affect on virtual populated paths. */ + depopulate?: boolean; + /** if false, exclude the version key (`__v` by default) from the output */ + versionKey?: boolean; + /** if true, convert Maps to POJOs. Useful if you want to `JSON.stringify()` the result of `toObject()`. */ + flattenMaps?: boolean; + /** If true, omits fields that are excluded in this document's projection. Unless you specified a projection, this will omit any field that has `select: false` in the schema. */ + useProjection?: boolean; + } + + export type DiscriminatorModel = T extends Model + ? + M extends Model + ? Model & T1, M2 | T2, M3 | T3, M4 | T4> + : M + : M; + + export type DiscriminatorSchema = T extends Schema + ? Schema & T1, DiscriminatorModel, T3 | TInstanceMethods, T4 | TQueryHelpers, T5 | TVirtuals> + : Schema; + + export class Schema, TInstanceMethods = {}, TQueryHelpers = {}, TVirtuals = any, + TStaticMethods = {}, + TPathTypeKey extends TypeKeyBaseType = DefaultTypeKey, + DocType extends ObtainDocumentType = ObtainDocumentType> + extends events.EventEmitter { + /** + * Create a new schema + */ + constructor(definition?: SchemaDefinition> | DocType, options?: SchemaOptions); + + /** Adds key path / schema type pairs to this schema. */ + add(obj: SchemaDefinition> | Schema, prefix?: string): this; + + /** + * Array of child schemas (from document arrays and single nested subdocs) + * and their corresponding compiled models. Each element of the array is + * an object with 2 properties: `schema` and `model`. + */ + childSchemas: { schema: Schema, model: any }[]; + + /** Removes all indexes on this schema */ + clearIndexes(): this; + + /** Returns a copy of this schema */ + clone(): T; + + discriminator(name: string, schema: T): DiscriminatorSchema; + + /** Returns a new schema that has the picked `paths` from this schema. */ + pick(paths: string[], options?: SchemaOptions): T; + + /** Object containing discriminators defined on this schema */ + discriminators?: { [name: string]: Schema }; + + /** Iterates the schemas paths similar to Array#forEach. */ + eachPath(fn: (path: string, type: SchemaType) => void): this; + + /** Defines an index (most likely compound) for this schema. */ + index(fields: IndexDefinition, options?: IndexOptions): this; + + /** + * Returns a list of indexes that this schema declares, via `schema.index()` + * or by `index: true` in a path's options. + */ + indexes(): Array; + + /** Gets a schema option. */ + get(key: K): SchemaOptions[K]; + + /** + * Loads an ES6 class into a schema. Maps [setters](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/set) + [getters](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/get), [static methods](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes/static), + * and [instance methods](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes#Class_body_and_method_definitions) + * to schema [virtuals](http://mongoosejs.com/docs/guide.html#virtuals), + * [statics](http://mongoosejs.com/docs/guide.html#statics), and + * [methods](http://mongoosejs.com/docs/guide.html#methods). + */ + loadClass(model: Function, onlyVirtuals?: boolean): this; + + /** Adds an instance method to documents constructed from Models compiled from this schema. */ + method(name: string, fn: (this: Context, ...args: any[]) => any, opts?: any): this; + method(obj: Partial): this; + + /** Object of currently defined methods on this schema. */ + methods: { [F in keyof TInstanceMethods]: TInstanceMethods[F] } & AnyObject; + + /** The original object passed to the schema constructor */ + obj: SchemaDefinition>; + + /** Gets/sets schema paths. */ + path(path: string): ResultType; + path(path: string, constructor: any): this; + + /** Lists all paths and their type in the schema. */ + paths: { + [key: string]: SchemaType; + }; + + /** Returns the pathType of `path` for this schema. */ + pathType(path: string): string; + + /** Registers a plugin for this schema. */ + plugin(fn: (schema: Schema, opts?: any) => void, opts?: any): this; + + /** Defines a post hook for the model. */ + post>(method: MongooseDocumentMiddleware | MongooseDocumentMiddleware[] | RegExp, fn: PostMiddlewareFunction): this; + post>(method: MongooseDocumentMiddleware | MongooseDocumentMiddleware[] | RegExp, options: SchemaPostOptions, fn: PostMiddlewareFunction): this; + post>(method: MongooseQueryMiddleware | MongooseQueryMiddleware[] | string | RegExp, fn: PostMiddlewareFunction): this; + post>(method: MongooseQueryMiddleware | MongooseQueryMiddleware[] | string | RegExp, options: SchemaPostOptions, fn: PostMiddlewareFunction): this; + post>(method: 'aggregate' | RegExp, fn: PostMiddlewareFunction>>): this; + post>(method: 'aggregate' | RegExp, options: SchemaPostOptions, fn: PostMiddlewareFunction>>): this; + post(method: 'insertMany' | RegExp, fn: PostMiddlewareFunction): this; + post(method: 'insertMany' | RegExp, options: SchemaPostOptions, fn: PostMiddlewareFunction): this; + + post>(method: MongooseDocumentMiddleware | MongooseDocumentMiddleware[] | RegExp, fn: ErrorHandlingMiddlewareFunction): this; + post>(method: MongooseDocumentMiddleware | MongooseDocumentMiddleware[] | RegExp, options: SchemaPostOptions, fn: ErrorHandlingMiddlewareFunction): this; + post>(method: MongooseQueryMiddleware | MongooseQueryMiddleware[] | string | RegExp, fn: ErrorHandlingMiddlewareFunction): this; + post>(method: MongooseQueryMiddleware | MongooseQueryMiddleware[] | string | RegExp, options: SchemaPostOptions, fn: ErrorHandlingMiddlewareFunction): this; + post>(method: 'aggregate' | RegExp, fn: ErrorHandlingMiddlewareFunction>): this; + post>(method: 'aggregate' | RegExp, options: SchemaPostOptions, fn: ErrorHandlingMiddlewareFunction>): this; + post(method: 'insertMany' | RegExp, fn: ErrorHandlingMiddlewareFunction): this; + post(method: 'insertMany' | RegExp, options: SchemaPostOptions, fn: ErrorHandlingMiddlewareFunction): this; + + /** Defines a pre hook for the model. */ + pre>(method: 'save', fn: PreSaveMiddlewareFunction): this; + pre>(method: 'save', options: SchemaPreOptions, fn: PreSaveMiddlewareFunction): this; + pre>(method: MongooseDocumentMiddleware | MongooseDocumentMiddleware[] | RegExp, fn: PreMiddlewareFunction): this; + pre>(method: MongooseDocumentMiddleware | MongooseDocumentMiddleware[] | RegExp, options: SchemaPreOptions, fn: PreMiddlewareFunction): this; + pre>(method: MongooseDocumentMiddleware | MongooseDocumentMiddleware[] | RegExp, options: SchemaPreOptions, fn: PreMiddlewareFunction): this; + pre>(method: MongooseQueryMiddleware | MongooseQueryMiddleware[] | string | RegExp, fn: PreMiddlewareFunction): this; + pre>(method: MongooseQueryMiddleware | MongooseQueryMiddleware[] | string | RegExp, options: SchemaPreOptions, fn: PreMiddlewareFunction): this; + pre>(method: 'aggregate' | RegExp, fn: PreMiddlewareFunction): this; + pre>(method: 'aggregate' | RegExp, options: SchemaPreOptions, fn: PreMiddlewareFunction): this; + pre(method: 'insertMany' | RegExp, fn: (this: T, next: (err?: CallbackError) => void, docs: any | Array) => void | Promise): this; + pre(method: 'insertMany' | RegExp, options: SchemaPreOptions, fn: (this: T, next: (err?: CallbackError) => void, docs: any | Array) => void | Promise): this; + + /** Object of currently defined query helpers on this schema. */ + query: TQueryHelpers; + + /** Adds a method call to the queue. */ + queue(name: string, args: any[]): this; + + /** Removes the given `path` (or [`paths`]). */ + remove(paths: string | Array): this; + + /** Removes index by name or index spec */ + remove(index: string | AnyObject): this; + + /** Returns an Array of path strings that are required by this schema. */ + requiredPaths(invalidate?: boolean): string[]; + + /** Sets a schema option. */ + set(key: K, value: SchemaOptions[K], _tags?: any): this; + + /** Adds static "class" methods to Models compiled from this schema. */ + static(name: string, fn: (this: M, ...args: any[]) => any): this; + static(obj: { [name: string]: (this: M, ...args: any[]) => any }): this; + + /** Object of currently defined statics on this schema. */ + statics: { [name: string]: (this: M, ...args: any[]) => any }; + + /** Creates a virtual type with the given name. */ + virtual>( + name: string, + options?: VirtualTypeOptions + ): VirtualType; + + /** Object of currently defined virtuals on this schema */ + virtuals: TVirtuals; + + /** Returns the virtual type with the given `name`. */ + virtualpath>(name: string): VirtualType | null; + } + + export type NumberSchemaDefinition = typeof Number | 'number' | 'Number' | typeof Schema.Types.Number; + export type StringSchemaDefinition = typeof String | 'string' | 'String' | typeof Schema.Types.String; + export type BooleanSchemaDefinition = typeof Boolean | 'boolean' | 'Boolean' | typeof Schema.Types.Boolean; + export type DateSchemaDefinition = typeof NativeDate | 'date' | 'Date' | typeof Schema.Types.Date; + export type ObjectIdSchemaDefinition = 'ObjectId' | 'ObjectID' | typeof Schema.Types.ObjectId; + + export type SchemaDefinitionWithBuiltInClass = T extends number + ? NumberSchemaDefinition + : T extends string + ? StringSchemaDefinition + : T extends boolean + ? BooleanSchemaDefinition + : T extends NativeDate + ? DateSchemaDefinition + : (Function | string); + + export type SchemaDefinitionProperty = SchemaDefinitionWithBuiltInClass | + SchemaTypeOptions | + typeof SchemaType | + Schema | + Schema[] | + SchemaTypeOptions>[] | + Function[] | + SchemaDefinition | + SchemaDefinition>[] | + typeof Schema.Types.Mixed | + MixedSchemaTypeOptions; + + export type SchemaDefinition = T extends undefined + ? { [path: string]: SchemaDefinitionProperty; } + : { [path in keyof T]?: SchemaDefinitionProperty; }; + + export type AnyArray = T[] | ReadonlyArray; + export type ExtractMongooseArray = T extends Types.Array ? AnyArray> : T; + + export interface MixedSchemaTypeOptions extends SchemaTypeOptions { + type: typeof Schema.Types.Mixed; + } + + export type RefType = + | number + | string + | Buffer + | undefined + | Types.ObjectId + | Types.Buffer + | typeof Schema.Types.Number + | typeof Schema.Types.String + | typeof Schema.Types.Buffer + | typeof Schema.Types.ObjectId; + + + export type InferId = T extends { _id?: any } ? T['_id'] : Types.ObjectId; + + export interface VirtualTypeOptions { + /** If `ref` is not nullish, this becomes a populated virtual. */ + ref?: string | Function; + + /** The local field to populate on if this is a populated virtual. */ + localField?: string | ((this: HydratedDocType, doc: HydratedDocType) => string); + + /** The foreign field to populate on if this is a populated virtual. */ + foreignField?: string | ((this: HydratedDocType, doc: HydratedDocType) => string); + + /** + * By default, a populated virtual is an array. If you set `justOne`, + * the populated virtual will be a single doc or `null`. + */ + justOne?: boolean; + + /** If you set this to `true`, Mongoose will call any custom getters you defined on this virtual. */ + getters?: boolean; + + /** + * If you set this to `true`, `populate()` will set this virtual to the number of populated + * documents, as opposed to the documents themselves, using `Query#countDocuments()`. + */ + count?: boolean; + + /** Add an extra match condition to `populate()`. */ + match?: FilterQuery | Function; + + /** Add a default `limit` to the `populate()` query. */ + limit?: number; + + /** Add a default `skip` to the `populate()` query. */ + skip?: number; + + /** + * For legacy reasons, `limit` with `populate()` may give incorrect results because it only + * executes a single query for every document being populated. If you set `perDocumentLimit`, + * Mongoose will ensure correct `limit` per document by executing a separate query for each + * document to `populate()`. For example, `.find().populate({ path: 'test', perDocumentLimit: 2 })` + * will execute 2 additional queries if `.find()` returns 2 documents. + */ + perDocumentLimit?: number; + + /** Additional options like `limit` and `lean`. */ + options?: QueryOptions & { match?: AnyObject }; + + /** Additional options for plugins */ + [extra: string]: any; + } + + export class VirtualType { + /** Applies getters to `value`. */ + applyGetters(value: any, doc: Document): any; + + /** Applies setters to `value`. */ + applySetters(value: any, doc: Document): any; + + /** Adds a custom getter to this virtual. */ + get(fn: (this: T, value: any, virtualType: VirtualType, doc: T) => any): this; + + /** Adds a custom setter to this virtual. */ + set(fn: (this: T, value: any, virtualType: VirtualType, doc: T) => void): this; + } + + export type ReturnsNewDoc = { new: true } | { returnOriginal: false } | { returnDocument: 'after' }; + + export type ProjectionElementType = number | string; + export type ProjectionType = { [P in keyof T]?: ProjectionElementType } | AnyObject | string; + + export type SortValues = SortOrder; + + export type SortOrder = -1 | 1 | 'asc' | 'ascending' | 'desc' | 'descending'; + + type _UpdateQuery = { + /** @see https://docs.mongodb.com/manual/reference/operator/update-field/ */ + $currentDate?: AnyKeys & AnyObject; + $inc?: AnyKeys & AnyObject; + $min?: AnyKeys & AnyObject; + $max?: AnyKeys & AnyObject; + $mul?: AnyKeys & AnyObject; + $rename?: { [key: string]: string }; + $set?: AnyKeys & AnyObject; + $setOnInsert?: AnyKeys & AnyObject; + $unset?: AnyKeys & AnyObject; + + /** @see https://docs.mongodb.com/manual/reference/operator/update-array/ */ + $addToSet?: AnyKeys & AnyObject; + $pop?: AnyKeys & AnyObject; + $pull?: AnyKeys & AnyObject; + $push?: AnyKeys & AnyObject; + $pullAll?: AnyKeys & AnyObject; + + /** @see https://docs.mongodb.com/manual/reference/operator/update-bitwise/ */ + $bit?: { + [key: string]: { [key in 'and' | 'or' | 'xor']?: number }; + }; + }; + + export type UpdateWithAggregationPipeline = UpdateAggregationStage[]; + export type UpdateAggregationStage = { $addFields: any } | + { $set: any } | + { $project: any } | + { $unset: any } | + { $replaceRoot: any } | + { $replaceWith: any }; + + export type __UpdateDefProperty = + [Extract] extends [never] ? T : + T | string; + export type _UpdateQueryDef = { + [K in keyof T]?: __UpdateDefProperty; + }; + + /** + * Update query command to perform on the document + * @example + * ```js + * { age: 30 } + * ``` + */ + export type UpdateQuery = _UpdateQuery<_UpdateQueryDef> & AnyObject; + + export type DocumentDefinition = { + [K in keyof Omit>]: + [Extract] extends [never] + ? T[K] extends TreatAsPrimitives + ? T[K] + : LeanDocumentElement + : T[K] | string; + }; + + export type FlattenMaps = { + [K in keyof T]: T[K] extends Map + ? AnyObject : T[K] extends TreatAsPrimitives + ? T[K] : FlattenMaps; + }; + + export type actualPrimitives = string | boolean | number | bigint | symbol | null | undefined; + export type TreatAsPrimitives = actualPrimitives | NativeDate | RegExp | symbol | Error | BigInt | Types.ObjectId; + + // This will -- when possible -- extract the original type of the subdocument in question + type LeanSubdocument = T extends (Types.Subdocument['_id']> & infer U) ? LeanDocument : Omit, '$isSingleNested' | 'ownerDocument' | 'parent'>; + + export type LeanType = + 0 extends (1 & T) ? T : // any + T extends TreatAsPrimitives ? T : // primitives + T extends Types.Subdocument ? LeanSubdocument : // subdocs + LeanDocument; // Documents and everything else + + // Used only when collapsing lean arrays for ts performance reasons: + type LeanTypeOrArray = T extends unknown[] ? LeanArray : LeanType; + + export type LeanArray = + // By checking if it extends Types.Array we can get the original base type before collapsing down, + // rather than trying to manually remove the old types. This matches both Array and DocumentArray + T extends Types.Array ? LeanTypeOrArray[] : + // If it isn't a custom mongoose type we fall back to "do our best" + T extends unknown[][] ? LeanArray[] : LeanType[]; + + export type _LeanDocument = { + [K in keyof T]: LeanDocumentElement; + }; + + // Keep this a separate type, to ensure that T is a naked type. + // This way, the conditional type is distributive over union types. + // This is required for PopulatedDoc. + export type LeanDocumentElement = + 0 extends (1 & T) ? T :// any + T extends unknown[] ? LeanArray : // Array + T extends Document ? LeanDocument : // Subdocument + T; + + export type SchemaDefinitionType = T extends Document ? Omit> : T; + + // Helpers to simplify checks + type IfAny = 0 extends (1 & IFTYPE) ? THENTYPE : IFTYPE; + type IfUnknown = unknown extends IFTYPE ? THENTYPE : IFTYPE; + + // tests for these two types are located in test/types/lean.test.ts + export type DocTypeFromUnion = T extends (Document & infer U) ? + [U] extends [Document & infer U] ? IfUnknown, false> : false : false; + + export type DocTypeFromGeneric = T extends Document ? + IfUnknown, false> : false; + + /** + * Helper to choose the best option between two type helpers + */ + export type _pickObject = T1 extends false ? T2 extends false ? Fallback : T2 : T1; + + /** + * There may be a better way to do this, but the goal is to return the DocType if it can be infered + * and if not to return a type which is easily identified as "not valid" so we fall back to + * "strip out known things added by extending Document" + * There are three basic ways to mix in Document -- "Document & T", "Document", + * and "T extends Document". In the last case there is no type without Document mixins, so we can only + * strip things out. In the other two cases we can infer the type, so we should + */ + export type BaseDocumentType = _pickObject, DocTypeFromGeneric, false>; + + /** + * Documents returned from queries with the lean option enabled. + * Plain old JavaScript object documents (POJO). + * @see https://mongoosejs.com/docs/tutorials/lean.html + */ + export type LeanDocument = BaseDocumentType extends Document ? _LeanDocument> : + Omit<_LeanDocument, Exclude | '$isSingleNested'>; + + export type LeanDocumentOrArray = 0 extends (1 & T) ? T : + T extends unknown[] ? LeanDocument[] : + T extends Document ? LeanDocument : + T; + + export type LeanDocumentOrArrayWithRawType = 0 extends (1 & T) ? T : + T extends unknown[] ? LeanDocument[] : + T extends Document ? LeanDocument : + T; + + /* for ts-mongoose */ + export class mquery { } + + export default mongoose; +} diff --git a/node_modules/mongoose/types/indizes.d.ts b/node_modules/mongoose/types/indizes.d.ts new file mode 100644 index 000000000..e1395865b --- /dev/null +++ b/node_modules/mongoose/types/indizes.d.ts @@ -0,0 +1,98 @@ +declare module 'mongoose' { + import mongodb = require('mongodb'); + + /** + * Makes the indexes in MongoDB match the indexes defined in every model's + * schema. This function will drop any indexes that are not defined in + * the model's schema except the `_id` index, and build any indexes that + * are in your schema but not in MongoDB. + */ + function syncIndexes(options?: SyncIndexesOptions): Promise; + function syncIndexes(options: SyncIndexesOptions | null, callback: Callback): void; + + interface IndexManager { + /** + * Similar to `ensureIndexes()`, except for it uses the [`createIndex`](http://mongodb.github.io/node-mongodb-native/2.2/api/Collection.html#createIndex) + * function. + */ + createIndexes(options: mongodb.CreateIndexesOptions, callback: CallbackWithoutResult): void; + createIndexes(callback: CallbackWithoutResult): void; + createIndexes(options?: mongodb.CreateIndexesOptions): Promise; + + /** + * Does a dry-run of Model.syncIndexes(), meaning that + * the result of this function would be the result of + * Model.syncIndexes(). + */ + diffIndexes(options: Record | null, callback: Callback): void + diffIndexes(callback: Callback): void + diffIndexes(options?: Record): Promise + + /** + * Sends `createIndex` commands to mongo for each index declared in the schema. + * The `createIndex` commands are sent in series. + */ + ensureIndexes(options: mongodb.CreateIndexesOptions, callback: CallbackWithoutResult): void; + ensureIndexes(callback: CallbackWithoutResult): void; + ensureIndexes(options?: mongodb.CreateIndexesOptions): Promise; + + /** + * Lists the indexes currently defined in MongoDB. This may or may not be + * the same as the indexes defined in your schema depending on whether you + * use the [`autoIndex` option](/docs/guide.html#autoIndex) and if you + * build indexes manually. + */ + listIndexes(callback: Callback>): void; + listIndexes(): Promise>; + + /** + * Makes the indexes in MongoDB match the indexes defined in this model's + * schema. This function will drop any indexes that are not defined in + * the model's schema except the `_id` index, and build any indexes that + * are in your schema but not in MongoDB. + */ + syncIndexes(options: mongodb.CreateIndexesOptions | null, callback: Callback>): void; + syncIndexes(options?: mongodb.CreateIndexesOptions): Promise>; + } + + interface IndexesDiff { + /** Indexes that would be created in mongodb. */ + toCreate: Array + /** Indexes that would be dropped in mongodb. */ + toDrop: Array + } + + type IndexDirection = 1 | -1 | '2d' | '2dsphere' | 'geoHaystack' | 'hashed' | 'text'; + type IndexDefinition = Record; + + interface SyncIndexesOptions extends mongodb.CreateIndexesOptions { + continueOnError?: boolean + } + type ConnectionSyncIndexesResult = Record; + type OneCollectionSyncIndexesResult = Array & mongodb.MongoServerError; + + interface IndexOptions extends mongodb.CreateIndexesOptions { + /** + * `expires` utilizes the `ms` module from [guille](https://github.com/guille/) allowing us to use a friendlier syntax: + * + * @example + * ```js + * const schema = new Schema({ prop1: Date }); + * + * // expire in 24 hours + * schema.index({ prop1: 1 }, { expires: 60*60*24 }) + * + * // expire in 24 hours + * schema.index({ prop1: 1 }, { expires: '24h' }) + * + * // expire in 1.5 hours + * schema.index({ prop1: 1 }, { expires: '1.5h' }) + * + * // expire in 7 days + * schema.index({ prop1: 1 }, { expires: '7d' }) + * ``` + */ + expires?: number | string; + weights?: AnyObject; + } +} \ No newline at end of file diff --git a/node_modules/mongoose/types/inferschematype.d.ts b/node_modules/mongoose/types/inferschematype.d.ts new file mode 100644 index 000000000..cc8c89e5c --- /dev/null +++ b/node_modules/mongoose/types/inferschematype.d.ts @@ -0,0 +1,155 @@ +import { Schema, InferSchemaType, SchemaType, SchemaTypeOptions, TypeKeyBaseType } from 'mongoose'; + +declare module 'mongoose' { + /** + * @summary Obtains document schema type. + * @description Obtains document schema type from document Definition OR returns enforced schema type if it's provided. + * @param {DocDefinition} DocDefinition A generic equals to the type of document definition "provided in as first parameter in Schema constructor". + * @param {EnforcedDocType} EnforcedDocType A generic type enforced by user "provided before schema constructor". + * @param {TypeKey} TypeKey A generic of literal string type. + */ + type ObtainDocumentType = + IsItRecordAndNotAny extends true ? EnforcedDocType : { + [K in keyof (RequiredPaths & + OptionalPaths)]: ObtainDocumentPathType; + }; + + /** + * @summary Obtains document schema type from Schema instance. + * @param {SchemaType} SchemaType A generic of schema type instance. + * @example + * const userSchema = new Schema({userName:String}); + * type UserType = InferSchemaType; + * // result + * type UserType = {userName?: string} + */ + type InferSchemaType = ObtainSchemaGeneric ; + + /** + * @summary Obtains schema Generic type by using generic alias. + * @param {TSchema} TSchema A generic of schema type instance. + * @param {alias} alias Targeted generic alias. + */ + type ObtainSchemaGeneric = + TSchema extends Schema + ? { + EnforcedDocType: EnforcedDocType; + M: M; + TInstanceMethods: TInstanceMethods; + TQueryHelpers: TQueryHelpers; + TVirtuals: TVirtuals; + TStaticMethods: TStaticMethods; + TPathTypeKey: TPathTypeKey; + DocType: DocType; + }[alias] + : unknown; +} +/** + * @summary Checks if a type is "Record" or "any". + * @description It Helps to check if user has provided schema type "EnforcedDocType" + * @param {T} T A generic type to be checked. + * @returns true if {@link T} is Record OR false if {@link T} is of any type. + */ +type IsItRecordAndNotAny = IfEquals ? true : false>; + +/** + * @summary Checks if two types are identical. + * @param {T} T The first type to be compared with {@link U}. + * @param {U} U The seconde type to be compared with {@link T}. + * @param {Y} Y A type to be returned if {@link T} & {@link U} are identical. + * @param {N} N A type to be returned if {@link T} & {@link U} are not identical. + */ +type IfEquals = + (() => G extends T ? 1 : 0) extends + (() => G extends U ? 1 : 0) ? Y : N; + +/** + * @summary Required path base type. + * @description It helps to check whereas if a path is required OR optional. + */ +type RequiredPathBaseType = { required: true | [true, string | undefined] }; + +/** + * @summary Path base type defined by using TypeKey + * @description It helps to check if a path is defined by TypeKey OR not. + * @param {TypeKey} TypeKey A literal string refers to path type property key. + */ +type PathWithTypePropertyBaseType = { [k in TypeKey]: any }; + +/** + * @summary A Utility to obtain schema's required path keys. + * @param {T} T A generic refers to document definition. + * @returns required paths keys of document definition. + */ +type RequiredPathKeys = { + [K in keyof T]: T[K] extends RequiredPathBaseType ? IfEquals : never; +}[keyof T]; + +/** + * @summary A Utility to obtain schema's required paths. + * @param {T} T A generic refers to document definition. + * @returns a record contains required paths with the corresponding type. + */ +type RequiredPaths = { + [K in RequiredPathKeys]: T[K]; +}; + +/** + * @summary A Utility to obtain schema's optional path keys. + * @param {T} T A generic refers to document definition. + * @returns optional paths keys of document definition. + */ +type OptionalPathKeys = { + [K in keyof T]: T[K] extends RequiredPathBaseType ? never : K; +}[keyof T]; + +/** + * @summary A Utility to obtain schema's optional paths. + * @param {T} T A generic refers to document definition. + * @returns a record contains optional paths with the corresponding type. + */ +type OptionalPaths = { + [K in OptionalPathKeys]?: T[K]; +}; + +/** + * @summary Obtains schema Path type. + * @description Obtains Path type by calling {@link ResolvePathType} OR by calling {@link InferSchemaType} if path of schema type. + * @param {PathValueType} PathValueType Document definition path type. + * @param {TypeKey} TypeKey A generic refers to document definition. + */ +type ObtainDocumentPathType = PathValueType extends Schema + ? InferSchemaType + : ResolvePathType< + PathValueType extends PathWithTypePropertyBaseType ? PathValueType[TypeKey] : PathValueType, + PathValueType extends PathWithTypePropertyBaseType ? Omit : {} + >; + +/** + * @param {T} T A generic refers to string path enums. + * @returns Path enum values type as literal strings or string. + */ +type PathEnumOrString['enum']> = T extends (infer E)[] ? E : T extends { values: any } ? PathEnumOrString : string; + +/** + * @summary Resolve path type by returning the corresponding type. + * @param {PathValueType} PathValueType Document definition path type. + * @param {Options} Options Document definition path options except path type. + * @returns Number, "Number" or "number" will be resolved to string type. + */ +type ResolvePathType = {}> = + PathValueType extends (infer Item)[] ? IfEquals>[] : + PathValueType extends StringConstructor | 'string' | 'String' | typeof Schema.Types.String ? PathEnumOrString : + PathValueType extends NumberConstructor | 'number' | 'Number' | typeof Schema.Types.Number ? number : + PathValueType extends DateConstructor | 'date' | 'Date' | typeof Schema.Types.Date ? Date : + PathValueType extends BufferConstructor | 'buffer' | 'Buffer' | typeof Schema.Types.Buffer ? Buffer : + PathValueType extends BooleanConstructor | 'boolean' | 'Boolean' | typeof Schema.Types.Boolean ? boolean : + PathValueType extends 'objectId' | 'ObjectId' | typeof Schema.Types.ObjectId ? Schema.Types.ObjectId : + PathValueType extends 'decimal128' | 'Decimal128' | typeof Schema.Types.Decimal128 ? Schema.Types.Decimal128 : + PathValueType extends MapConstructor ? Map> : + PathValueType extends ArrayConstructor ? any[] : + PathValueType extends typeof Schema.Types.Mixed ? any: + IfEquals extends true ? any: + IfEquals extends true ? any: + PathValueType extends typeof SchemaType ? PathValueType['prototype'] : + unknown; \ No newline at end of file diff --git a/node_modules/mongoose/types/middlewares.d.ts b/node_modules/mongoose/types/middlewares.d.ts new file mode 100644 index 000000000..3fb9d125f --- /dev/null +++ b/node_modules/mongoose/types/middlewares.d.ts @@ -0,0 +1,14 @@ +declare module 'mongoose' { + + type MongooseDocumentMiddleware = 'validate' | 'save' | 'remove' | 'updateOne' | 'deleteOne' | 'init'; + type MongooseQueryMiddleware = 'count' | 'deleteMany' | 'deleteOne' | 'distinct' | 'find' | 'findOne' | 'findOneAndDelete' | 'findOneAndRemove' | 'findOneAndUpdate' | 'remove' | 'update' | 'updateOne' | 'updateMany'; + + type MiddlewareOptions = { document?: boolean, query?: boolean }; + type SchemaPreOptions = MiddlewareOptions; + type SchemaPostOptions = MiddlewareOptions; + + type PreMiddlewareFunction = (this: ThisType, next: CallbackWithoutResultAndOptionalError) => void | Promise; + type PreSaveMiddlewareFunction = (this: ThisType, next: CallbackWithoutResultAndOptionalError, opts: SaveOptions) => void | Promise; + type PostMiddlewareFunction = (this: ThisType, res: ResType, next: CallbackWithoutResultAndOptionalError) => void | Promise; + type ErrorHandlingMiddlewareFunction = (this: ThisType, err: NativeError, res: ResType, next: CallbackWithoutResultAndOptionalError) => void; +} \ No newline at end of file diff --git a/node_modules/mongoose/types/models.d.ts b/node_modules/mongoose/types/models.d.ts new file mode 100644 index 000000000..d15675dbb --- /dev/null +++ b/node_modules/mongoose/types/models.d.ts @@ -0,0 +1,434 @@ +declare module 'mongoose' { + import mongodb = require('mongodb'); + + export interface AcceptsDiscriminator { + /** Adds a discriminator type. */ + discriminator(name: string | number, schema: Schema, value?: string | number | ObjectId): Model; + discriminator(name: string | number, schema: Schema, value?: string | number | ObjectId): U; + } + + interface MongooseBulkWriteOptions { + skipValidation?: boolean; + } + + interface InsertManyOptions extends + PopulateOption, + SessionOption { + limit?: number; + rawResult?: boolean; + ordered?: boolean; + lean?: boolean; + } + + type InsertManyResult = mongodb.InsertManyResult & { + insertedIds: { + [key: number]: InferId; + }; + mongoose?: { validationErrors?: Array }; + }; + + type UpdateWriteOpResult = mongodb.UpdateResult; + + interface MapReduceOptions { + map: Function | string; + reduce: (key: K, vals: T[]) => R; + /** query filter object. */ + query?: any; + /** sort input objects using this key */ + sort?: any; + /** max number of documents */ + limit?: number; + /** keep temporary data default: false */ + keeptemp?: boolean; + /** finalize function */ + finalize?: (key: K, val: R) => R; + /** scope variables exposed to map/reduce/finalize during execution */ + scope?: any; + /** it is possible to make the execution stay in JS. Provided in MongoDB > 2.0.X default: false */ + jsMode?: boolean; + /** provide statistics on job execution time. default: false */ + verbose?: boolean; + readPreference?: string; + /** sets the output target for the map reduce job. default: {inline: 1} */ + out?: { + /** the results are returned in an array */ + inline?: number; + /** + * {replace: 'collectionName'} add the results to collectionName: the + * results replace the collection + */ + replace?: string; + /** + * {reduce: 'collectionName'} add the results to collectionName: if + * dups are detected, uses the reducer / finalize functions + */ + reduce?: string; + /** + * {merge: 'collectionName'} add the results to collectionName: if + * dups exist the new docs overwrite the old + */ + merge?: string; + }; + } + + interface GeoSearchOptions { + /** x,y point to search for */ + near: number[]; + /** the maximum distance from the point near that a result can be */ + maxDistance: number; + /** The maximum number of results to return */ + limit?: number; + /** return the raw object instead of the Mongoose Model */ + lean?: boolean; + } + + interface ModifyResult { + value: Require_id | null; + /** see https://www.mongodb.com/docs/manual/reference/command/findAndModify/#lasterrorobject */ + lastErrorObject?: { + updatedExisting?: boolean; + upserted?: mongodb.ObjectId; + }; + ok: 0 | 1; + } + + type WriteConcern = mongodb.WriteConcern; + + /** A list of paths to validate. If set, Mongoose will validate only the modified paths that are in the given list. */ + type PathsToValidate = string[] | string; + /** + * @deprecated + */ + type pathsToValidate = PathsToValidate; + + interface SaveOptions extends + SessionOption { + checkKeys?: boolean; + j?: boolean; + safe?: boolean | WriteConcern; + timestamps?: boolean; + validateBeforeSave?: boolean; + validateModifiedOnly?: boolean; + w?: number | string; + wtimeout?: number; + } + + const Model: Model; + interface Model extends + NodeJS.EventEmitter, + AcceptsDiscriminator, + IndexManager, + SessionStarter { + new (doc?: DocType, fields?: any | null, options?: boolean | AnyObject): HydratedDocument, TMethodsAndOverrides, TVirtuals> & ObtainSchemaGeneric; + + aggregate(pipeline?: PipelineStage[], options?: mongodb.AggregateOptions, callback?: Callback): Aggregate>; + aggregate(pipeline: PipelineStage[], callback?: Callback): Aggregate>; + + /** Base Mongoose instance the model uses. */ + base: Mongoose; + + /** + * If this is a discriminator model, `baseModelName` is the name of + * the base model. + */ + baseModelName: string | undefined; + + /** + * Sends multiple `insertOne`, `updateOne`, `updateMany`, `replaceOne`, + * `deleteOne`, and/or `deleteMany` operations to the MongoDB server in one + * command. This is faster than sending multiple independent operations (e.g. + * if you use `create()`) because with `bulkWrite()` there is only one network + * round trip to the MongoDB server. + */ + bulkWrite(writes: Array, options: mongodb.BulkWriteOptions & MongooseBulkWriteOptions, callback: Callback): void; + bulkWrite(writes: Array, callback: Callback): void; + bulkWrite(writes: Array, options?: mongodb.BulkWriteOptions & MongooseBulkWriteOptions): Promise; + + /** + * Sends multiple `save()` calls in a single `bulkWrite()`. This is faster than + * sending multiple `save()` calls because with `bulkSave()` there is only one + * network round trip to the MongoDB server. + */ + bulkSave(documents: Array, options?: mongodb.BulkWriteOptions): Promise; + + /** Collection the model uses. */ + collection: Collection; + + /** Creates a `count` query: counts the number of documents that match `filter`. */ + count(callback?: Callback): QueryWithHelpers, TQueryHelpers, T>; + count(filter: FilterQuery, callback?: Callback): QueryWithHelpers, TQueryHelpers, T>; + + /** Creates a `countDocuments` query: counts the number of documents that match `filter`. */ + countDocuments(filter: FilterQuery, options?: QueryOptions, callback?: Callback): QueryWithHelpers, TQueryHelpers, T>; + countDocuments(callback?: Callback): QueryWithHelpers, TQueryHelpers, T>; + + /** Creates a new document or documents */ + create(docs: Array, options?: SaveOptions): Promise, RequireOnlyTypedId>, TMethodsAndOverrides, TVirtuals>[]>; + create(docs: Array, callback: Callback, RequireOnlyTypedId>, TMethodsAndOverrides, TVirtuals>[]>): void; + create(doc: DocContents | T): Promise, RequireOnlyTypedId>, TMethodsAndOverrides, TVirtuals>>; + create(...docs: Array): Promise, RequireOnlyTypedId>, TMethodsAndOverrides, TVirtuals>[]>; + create(doc: T | DocContents, callback: Callback, RequireOnlyTypedId>, TMethodsAndOverrides, TVirtuals>>): void; + + /** + * Create the collection for this model. By default, if no indexes are specified, + * mongoose will not create the collection for the model until any documents are + * created. Use this method to create the collection explicitly. + */ + createCollection(options: mongodb.CreateCollectionOptions & Pick | null, callback: Callback>): void; + createCollection(callback: Callback>): void; + createCollection(options?: mongodb.CreateCollectionOptions & Pick): Promise>; + + /** Connection the model uses. */ + db: Connection; + + /** + * Deletes all of the documents that match `conditions` from the collection. + * Behaves like `remove()`, but deletes all documents that match `conditions` + * regardless of the `single` option. + */ + deleteMany(filter?: FilterQuery, options?: QueryOptions, callback?: CallbackWithoutResult): QueryWithHelpers, TQueryHelpers, T>; + deleteMany(filter: FilterQuery, callback: CallbackWithoutResult): QueryWithHelpers, TQueryHelpers, T>; + deleteMany(callback: CallbackWithoutResult): QueryWithHelpers, TQueryHelpers, T>; + + /** + * Deletes the first document that matches `conditions` from the collection. + * Behaves like `remove()`, but deletes at most one document regardless of the + * `single` option. + */ + deleteOne(filter?: FilterQuery, options?: QueryOptions, callback?: CallbackWithoutResult): QueryWithHelpers, TQueryHelpers, T>; + deleteOne(filter: FilterQuery, callback: CallbackWithoutResult): QueryWithHelpers, TQueryHelpers, T>; + deleteOne(callback: CallbackWithoutResult): QueryWithHelpers, TQueryHelpers, T>; + + /** + * Event emitter that reports any errors that occurred. Useful for global error + * handling. + */ + events: NodeJS.EventEmitter; + + /** + * Finds a single document by its _id field. `findById(id)` is almost* + * equivalent to `findOne({ _id: id })`. If you want to query by a document's + * `_id`, use `findById()` instead of `findOne()`. + */ + findById>( + id: any, + projection?: ProjectionType | null, + options?: QueryOptions | null, + callback?: Callback + ): QueryWithHelpers; + findById>( + id: any, + projection?: ProjectionType | null, + callback?: Callback + ): QueryWithHelpers; + + /** Finds one document. */ + findOne>( + filter?: FilterQuery, + projection?: ProjectionType | null, + options?: QueryOptions | null, + callback?: Callback + ): QueryWithHelpers; + findOne>( + filter?: FilterQuery, + projection?: ProjectionType | null, + callback?: Callback + ): QueryWithHelpers; + findOne>( + filter?: FilterQuery, + callback?: Callback + ): QueryWithHelpers; + + /** + * Shortcut for creating a new Document from existing raw data, pre-saved in the DB. + * The document returned has no paths marked as modified initially. + */ + hydrate(obj: any): HydratedDocument; + + /** + * This function is responsible for building [indexes](https://docs.mongodb.com/manual/indexes/), + * unless [`autoIndex`](http://mongoosejs.com/docs/guide.html#autoIndex) is turned off. + * Mongoose calls this function automatically when a model is created using + * [`mongoose.model()`](/docs/api.html#mongoose_Mongoose-model) or + * [`connection.model()`](/docs/api.html#connection_Connection-model), so you + * don't need to call it. + */ + init(callback?: CallbackWithoutResult): Promise>; + + /** Inserts one or more new documents as a single `insertMany` call to the MongoDB server. */ + insertMany(docs: Array, options: InsertManyOptions & { lean: true; }, callback: Callback, RequireOnlyTypedId>>>): void; + insertMany(docs: Array, options: InsertManyOptions & { rawResult: true; }, callback: Callback>): void; + insertMany(docs: Array, callback: Callback, RequireOnlyTypedId>, TMethodsAndOverrides, TVirtuals>>>): void; + insertMany(doc: DocContents, options: InsertManyOptions & { lean: true; }, callback: Callback, RequireOnlyTypedId>>>): void; + insertMany(doc: DocContents, options: InsertManyOptions & { rawResult: true; }, callback: Callback>): void; + insertMany(doc: DocContents, options: InsertManyOptions & { lean?: false | undefined }, callback: Callback, RequireOnlyTypedId>, TMethodsAndOverrides, TVirtuals>>>): void; + insertMany(doc: DocContents, callback: Callback, RequireOnlyTypedId>, TMethodsAndOverrides, TVirtuals>>>): void; + + insertMany(docs: Array, options: InsertManyOptions & { lean: true; }): Promise, RequireOnlyTypedId>>>; + insertMany(docs: Array, options: InsertManyOptions & { rawResult: true; }): Promise>; + insertMany(docs: Array): Promise, RequireOnlyTypedId>, TMethodsAndOverrides, TVirtuals>>>; + insertMany(doc: DocContents, options: InsertManyOptions & { lean: true; }): Promise, RequireOnlyTypedId>>>; + insertMany(doc: DocContents, options: InsertManyOptions & { rawResult: true; }): Promise>; + insertMany(doc: DocContents, options: InsertManyOptions): Promise, RequireOnlyTypedId>, TMethodsAndOverrides, TVirtuals>>>; + insertMany(doc: DocContents): Promise, RequireOnlyTypedId>, TMethodsAndOverrides, TVirtuals>>>; + + /** The name of the model */ + modelName: string; + + /** Populates document references. */ + populate(docs: Array, options: PopulateOptions | Array | string, + callback?: Callback<(HydratedDocument)[]>): Promise>>; + populate(doc: any, options: PopulateOptions | Array | string, + callback?: Callback>): Promise>; + + + /** Casts and validates the given object against this model's schema, passing the given `context` to custom validators. */ + validate(callback?: CallbackWithoutResult): Promise; + validate(optional: any, callback?: CallbackWithoutResult): Promise; + validate(optional: any, pathsToValidate: PathsToValidate, callback?: CallbackWithoutResult): Promise; + + /** Watches the underlying collection for changes using [MongoDB change streams](https://docs.mongodb.com/manual/changeStreams/). */ + watch(pipeline?: Array>, options?: mongodb.ChangeStreamOptions): mongodb.ChangeStream; + + /** Adds a `$where` clause to this query */ + $where(argument: string | Function): QueryWithHelpers>, HydratedDocument, TQueryHelpers, T>; + + /** Registered discriminators for this model. */ + discriminators: { [name: string]: Model } | undefined; + + /** Translate any aliases fields/conditions so the final query or document object is pure */ + translateAliases(raw: any): any; + + /** Creates a `distinct` query: returns the distinct values of the given `field` that match `filter`. */ + distinct(field: string, filter?: FilterQuery, callback?: Callback): QueryWithHelpers, HydratedDocument, TQueryHelpers, T>; + + /** Creates a `estimatedDocumentCount` query: counts the number of documents in the collection. */ + estimatedDocumentCount(options?: QueryOptions, callback?: Callback): QueryWithHelpers, TQueryHelpers, T>; + + /** + * Returns a document with its `_id` if at least one document exists in the database that matches + * the given `filter`, and `null` otherwise. + */ + exists(filter: FilterQuery, callback: Callback, '_id'> | null>): QueryWithHelpers, '_id'> | null, HydratedDocument, TQueryHelpers, T>; + exists(filter: FilterQuery): QueryWithHelpers, '_id'> | null, HydratedDocument, TQueryHelpers, T>; + + /** Creates a `find` query: gets a list of documents that match `filter`. */ + find>( + filter: FilterQuery, + projection: ProjectionType | null, + options: QueryOptions | null, + callback?: Callback + ): QueryWithHelpers, ResultDoc, TQueryHelpers, T>; + find>( + filter: FilterQuery, + projection: ProjectionType | null, + callback?: Callback + ): QueryWithHelpers, ResultDoc, TQueryHelpers, T>; + find>( + filter: FilterQuery, + callback?: Callback + ): QueryWithHelpers, ResultDoc, TQueryHelpers, T>; + find>( + callback?: Callback + ): QueryWithHelpers, ResultDoc, TQueryHelpers, T>; + + /** Creates a `findByIdAndDelete` query, filtering by the given `_id`. */ + findByIdAndDelete>(id?: mongodb.ObjectId | any, options?: QueryOptions | null, callback?: (err: CallbackError, doc: ResultDoc | null, res: any) => void): QueryWithHelpers; + + /** Creates a `findByIdAndRemove` query, filtering by the given `_id`. */ + findByIdAndRemove>(id?: mongodb.ObjectId | any, options?: QueryOptions | null, callback?: (err: CallbackError, doc: ResultDoc | null, res: any) => void): QueryWithHelpers; + + /** Creates a `findOneAndUpdate` query, filtering by the given `_id`. */ + findByIdAndUpdate>(id: mongodb.ObjectId | any, update: UpdateQuery, options: QueryOptions & { rawResult: true }, callback?: (err: CallbackError, doc: any, res: any) => void): QueryWithHelpers, ResultDoc, TQueryHelpers, T>; + findByIdAndUpdate>(id: mongodb.ObjectId | any, update: UpdateQuery, options: QueryOptions & { upsert: true } & ReturnsNewDoc, callback?: (err: CallbackError, doc: ResultDoc, res: any) => void): QueryWithHelpers; + findByIdAndUpdate>(id?: mongodb.ObjectId | any, update?: UpdateQuery, options?: QueryOptions | null, callback?: (err: CallbackError, doc: ResultDoc | null, res: any) => void): QueryWithHelpers; + findByIdAndUpdate>(id: mongodb.ObjectId | any, update: UpdateQuery, callback: (err: CallbackError, doc: ResultDoc | null, res: any) => void): QueryWithHelpers; + + /** Creates a `findOneAndDelete` query: atomically finds the given document, deletes it, and returns the document as it was before deletion. */ + findOneAndDelete>(filter?: FilterQuery, options?: QueryOptions | null, callback?: (err: CallbackError, doc: ResultDoc | null, res: any) => void): QueryWithHelpers; + + /** Creates a `findOneAndRemove` query: atomically finds the given document and deletes it. */ + findOneAndRemove>(filter?: FilterQuery, options?: QueryOptions | null, callback?: (err: CallbackError, doc: ResultDoc | null, res: any) => void): QueryWithHelpers; + + /** Creates a `findOneAndReplace` query: atomically finds the given document and replaces it with `replacement`. */ + findOneAndReplace>(filter: FilterQuery, replacement: T | AnyObject, options: QueryOptions & { upsert: true } & ReturnsNewDoc, callback?: (err: CallbackError, doc: ResultDoc, res: any) => void): QueryWithHelpers; + findOneAndReplace>(filter?: FilterQuery, replacement?: T | AnyObject, options?: QueryOptions | null, callback?: (err: CallbackError, doc: ResultDoc | null, res: any) => void): QueryWithHelpers; + + /** Creates a `findOneAndUpdate` query: atomically find the first document that matches `filter` and apply `update`. */ + findOneAndUpdate>( + filter: FilterQuery, + update: UpdateQuery, + options: QueryOptions & { rawResult: true }, + callback?: (err: CallbackError, doc: any, res: any) => void + ): QueryWithHelpers, ResultDoc, TQueryHelpers, T>; + findOneAndUpdate>( + filter: FilterQuery, + update: UpdateQuery, + options: QueryOptions & { upsert: true } & ReturnsNewDoc, + callback?: (err: CallbackError, doc: ResultDoc, res: any) => void + ): QueryWithHelpers; + findOneAndUpdate>( + filter?: FilterQuery, + update?: UpdateQuery, + options?: QueryOptions | null, + callback?: (err: CallbackError, doc: T | null, res: any) => void + ): QueryWithHelpers; + + geoSearch>( + filter?: FilterQuery, + options?: GeoSearchOptions, + callback?: Callback> + ): QueryWithHelpers, ResultDoc, TQueryHelpers, T>; + + /** Executes a mapReduce command. */ + mapReduce( + o: MapReduceOptions, + callback?: Callback + ): Promise; + + remove>(filter?: any, callback?: CallbackWithoutResult): QueryWithHelpers; + + /** Creates a `replaceOne` query: finds the first document that matches `filter` and replaces it with `replacement`. */ + replaceOne>( + filter?: FilterQuery, + replacement?: T | AnyObject, + options?: QueryOptions | null, + callback?: Callback + ): QueryWithHelpers; + + /** Schema the model uses. */ + schema: Schema; + + /** + * @deprecated use `updateOne` or `updateMany` instead. + * Creates a `update` query: updates one or many documents that match `filter` with `update`, based on the `multi` option. + */ + update>( + filter?: FilterQuery, + update?: UpdateQuery | UpdateWithAggregationPipeline, + options?: QueryOptions | null, + callback?: Callback + ): QueryWithHelpers; + + /** Creates a `updateMany` query: updates all documents that match `filter` with `update`. */ + updateMany>( + filter?: FilterQuery, + update?: UpdateQuery | UpdateWithAggregationPipeline, + options?: QueryOptions | null, + callback?: Callback + ): QueryWithHelpers; + + /** Creates a `updateOne` query: updates the first document that matches `filter` with `update`. */ + updateOne>( + filter?: FilterQuery, + update?: UpdateQuery | UpdateWithAggregationPipeline, + options?: QueryOptions | null, + callback?: Callback + ): QueryWithHelpers; + + /** Creates a Query, applies the passed conditions, and returns the Query. */ + where>(path: string, val?: any): QueryWithHelpers, ResultDoc, TQueryHelpers, T>; + where>(obj: object): QueryWithHelpers, ResultDoc, TQueryHelpers, T>; + where>(): QueryWithHelpers, ResultDoc, TQueryHelpers, T>; + } +} \ No newline at end of file diff --git a/node_modules/mongoose/types/mongooseoptions.d.ts b/node_modules/mongoose/types/mongooseoptions.d.ts new file mode 100644 index 000000000..a84e5a154 --- /dev/null +++ b/node_modules/mongoose/types/mongooseoptions.d.ts @@ -0,0 +1,193 @@ +declare module 'mongoose' { + import stream = require('stream'); + + interface MongooseOptions { + /** + * Set to `true` to set `allowDiskUse` to true to all aggregation operations by default. + * + * @default false + */ + allowDiskUse?: boolean; + /** + * Set to `false` to skip applying global plugins to child schemas. + * + * @default true + */ + applyPluginsToChildSchemas?: boolean; + + /** + * Set to `true` to apply global plugins to discriminator schemas. + * This typically isn't necessary because plugins are applied to the base schema and + * discriminators copy all middleware, methods, statics, and properties from the base schema. + * + * @default false + */ + applyPluginsToDiscriminators?: boolean; + + /** + * autoCreate is `true` by default unless readPreference is secondary or secondaryPreferred, + * which means Mongoose will attempt to create every model's underlying collection before + * creating indexes. If readPreference is secondary or secondaryPreferred, Mongoose will + * default to false for both autoCreate and autoIndex because both createCollection() and + * createIndex() will fail when connected to a secondary. + */ + autoCreate?: boolean; + + /** + * Set to `false` to disable automatic index creation for all models associated with this Mongoose instance. + * + * @default true + */ + autoIndex?: boolean; + + /** + * enable/disable mongoose's buffering mechanism for all connections and models. + * + * @default true + */ + bufferCommands?: boolean; + + /** + * If bufferCommands is on, this option sets the maximum amount of time Mongoose + * buffering will wait before throwing an error. + * If not specified, Mongoose will use 10000 (10 seconds). + * + * @default 10000 + */ + bufferTimeoutMS?: number; + + /** + * Set to `true` to `clone()` all schemas before compiling into a model. + * + * @default false + */ + cloneSchemas?: boolean; + + /** + * If `true`, prints the operations mongoose sends to MongoDB to the console. + * If a writable stream is passed, it will log to that stream, without colorization. + * If a callback function is passed, it will receive the collection name, the method + * name, then all arguments passed to the method. For example, if you wanted to + * replicate the default logging, you could output from the callback + * `Mongoose: ${collectionName}.${methodName}(${methodArgs.join(', ')})`. + * + * @default false + */ + debug?: + | boolean + | { color?: boolean; shell?: boolean; } + | stream.Writable + | ((collectionName: string, methodName: string, ...methodArgs: any[]) => void); + + /** + * If `false`, it will change the `createdAt` field to be [`immutable: false`](https://mongoosejs.com/docs/api/schematype.html#schematype_SchemaType-immutable) + * which means you can update the `createdAt`. + * + * @default true + */ + 'timestamps.createdAt.immutable'?: boolean + + /** If set, attaches [maxTimeMS](https://docs.mongodb.com/manual/reference/operator/meta/maxTimeMS/) to every query */ + maxTimeMS?: number; + + /** + * Mongoose adds a getter to MongoDB ObjectId's called `_id` that + * returns `this` for convenience with populate. Set this to false to remove the getter. + * + * @default true + */ + objectIdGetter?: boolean; + + /** + * Set to `true` to default to overwriting models with the same name when calling + * `mongoose.model()`, as opposed to throwing an `OverwriteModelError`. + * + * @default false + */ + overwriteModels?: boolean; + + /** + * If `false`, changes the default `returnOriginal` option to `findOneAndUpdate()`, + * `findByIdAndUpdate`, and `findOneAndReplace()` to false. This is equivalent to + * setting the `new` option to `true` for `findOneAndX()` calls by default. Read our + * `findOneAndUpdate()` [tutorial](https://mongoosejs.com/docs/tutorials/findoneandupdate.html) + * for more information. + * + * @default true + */ + returnOriginal?: boolean; + + /** + * Set to true to enable [update validators]( + * https://mongoosejs.com/docs/validation.html#update-validators + * ) for all validators by default. + * + * @default false + */ + runValidators?: boolean; + + /** + * Sanitizes query filters against [query selector injection attacks]( + * https://thecodebarbarian.com/2014/09/04/defending-against-query-selector-injection-attacks.html + * ) by wrapping any nested objects that have a property whose name starts with $ in a $eq. + */ + sanitizeFilter?: boolean; + + sanitizeProjection?: boolean; + + /** + * Set to false to opt out of Mongoose adding all fields that you `populate()` + * to your `select()`. The schema-level option `selectPopulatedPaths` overwrites this one. + * + * @default true + */ + selectPopulatedPaths?: boolean; + + /** + * Mongoose also sets defaults on update() and findOneAndUpdate() when the upsert option is + * set by adding your schema's defaults to a MongoDB $setOnInsert operator. You can disable + * this behavior by setting the setDefaultsOnInsert option to false. + * + * @default true + */ + setDefaultsOnInsert?: boolean; + + /** + * Sets the default strict mode for schemas. + * May be `false`, `true`, or `'throw'`. + * + * @default true + */ + strict?: boolean | 'throw'; + + /** + * Set to `false` to allow populating paths that aren't in the schema. + * + * @default true + */ + strictPopulate?: boolean; + + /** + * Sets the default [strictQuery](https://mongoosejs.com/docs/guide.html#strictQuery) mode for schemas. + * May be `false`, `true`, or `'throw'`. + * + * @default false + */ + strictQuery?: boolean | 'throw'; + + /** + * Overwrites default objects to `toJSON()`, for determining how Mongoose + * documents get serialized by `JSON.stringify()` + * + * @default { transform: true, flattenDecimals: true } + */ + toJSON?: ToObjectOptions; + + /** + * Overwrites default objects to `toObject()` + * + * @default { transform: true, flattenDecimals: true } + */ + toObject?: ToObjectOptions; + } +} \ No newline at end of file diff --git a/node_modules/mongoose/types/pipelinestage.d.ts b/node_modules/mongoose/types/pipelinestage.d.ts new file mode 100644 index 000000000..ef5dd5827 --- /dev/null +++ b/node_modules/mongoose/types/pipelinestage.d.ts @@ -0,0 +1,268 @@ +declare module 'mongoose' { + /** + * [Stages reference](https://docs.mongodb.com/manual/reference/operator/aggregation-pipeline/#aggregation-pipeline-stages) + */ + export type PipelineStage = + | PipelineStage.AddFields + | PipelineStage.Bucket + | PipelineStage.BucketAuto + | PipelineStage.CollStats + | PipelineStage.Count + | PipelineStage.Facet + | PipelineStage.GeoNear + | PipelineStage.GraphLookup + | PipelineStage.Group + | PipelineStage.IndexStats + | PipelineStage.Limit + | PipelineStage.ListSessions + | PipelineStage.Lookup + | PipelineStage.Match + | PipelineStage.Merge + | PipelineStage.Out + | PipelineStage.PlanCacheStats + | PipelineStage.Project + | PipelineStage.Redact + | PipelineStage.ReplaceRoot + | PipelineStage.ReplaceWith + | PipelineStage.Sample + | PipelineStage.Search + | PipelineStage.Set + | PipelineStage.SetWindowFields + | PipelineStage.Skip + | PipelineStage.Sort + | PipelineStage.SortByCount + | PipelineStage.UnionWith + | PipelineStage.Unset + | PipelineStage.Unwind; + + export namespace PipelineStage { + export interface AddFields { + /** [`$addFields` reference](https://docs.mongodb.com/manual/reference/operator/aggregation/addFields/) */ + $addFields: Record + } + + export interface Bucket { + /** [`$bucket` reference](https://docs.mongodb.com/manual/reference/operator/aggregation/bucket/) */ + $bucket: { + groupBy: Expression; + boundaries: any[]; + default?: any + output?: Record + } + } + + export interface BucketAuto { + /** [`$bucketAuto` reference](https://docs.mongodb.com/manual/reference/operator/aggregation/bucketAuto/) */ + $bucketAuto: { + groupBy: Expression | Record; + buckets: number; + output?: Record; + granularity?: 'R5' | 'R10' | 'R20' | 'R40' | 'R80' | '1-2-5' | 'E6' | 'E12' | 'E24' | 'E48' | 'E96' | 'E192' | 'POWERSOF2'; + } + } + + export interface CollStats { + /** [`$collStats` reference](https://docs.mongodb.com/manual/reference/operator/aggregation/collStats/) */ + $collStats: { + latencyStats?: { histograms?: boolean }; + storageStats?: { scale?: number }; + count?: Record; + queryExecStats?: Record; + } + } + + export interface Count { + /** [`$count` reference](https://docs.mongodb.com/manual/reference/operator/aggregation/count/) */ + $count: string; + } + + export interface Facet { + /** [`$facet` reference](https://docs.mongodb.com/manual/reference/operator/aggregation/facet/) */ + $facet: Record; + } + + export type FacetPipelineStage = Exclude; + + export interface GeoNear { + /** [`$geoNear` reference](https://docs.mongodb.com/manual/reference/operator/aggregation/geoNear/) */ + $geoNear: { + near: { type: 'Point'; coordinates: [number, number] } | [number, number]; + distanceField: string; + distanceMultiplier?: number; + includeLocs?: string; + key?: string; + maxDistance?: number; + minDistance?: number; + query?: AnyObject; + spherical?: boolean; + uniqueDocs?: boolean; + } + } + + export interface GraphLookup { + /** [`$graphLookup` reference](https://docs.mongodb.com/manual/reference/operator/aggregation/graphLookup/) */ + $graphLookup: { + from: string; + startWith: any + connectFromField: string; + connectToField: string; + as: string; + maxDepth?: number; + depthField?: string; + restrictSearchWithMatch?: AnyObject; + } + } + + export interface Group { + /** [`$group` reference](https://docs.mongodb.com/manual/reference/operator/aggregation/group) */ + $group: { _id: any } | { [key: string]: AccumulatorOperator } + } + + export interface IndexStats { + /** [`$indexStats` reference](https://docs.mongodb.com/manual/reference/operator/aggregation/indexStats/) */ + $indexStats: Record; + } + + export interface Limit { + /** [`$limit` reference](https://docs.mongodb.com/manual/reference/operator/aggregation/limit/) */ + $limit: number + } + + export interface ListSessions { + /** [`$listSessions` reference](https://docs.mongodb.com/manual/reference/operator/aggregation/listSessions/) */ + $listSessions: { users?: { user: string; db: string }[] } | { allUsers?: true } + } + + export interface Lookup { + /** [`$lookup` reference](https://docs.mongodb.com/manual/reference/operator/aggregation/lookup/) */ + $lookup: { + from: string + as: string + localField?: string + foreignField?: string + let?: Record + pipeline?: Exclude[] + } + } + + export interface Match { + /** [`$match` reference](https://docs.mongodb.com/manual/reference/operator/aggregation/match/) */ + $match: Expression | Record; + } + + export interface Merge { + /** [`$merge` reference](https://docs.mongodb.com/manual/reference/operator/aggregation/merge/) */ + $merge: { + into: string | { db: string; coll: string } + on?: string | string[] + let?: Record + whenMatched?: 'replace' | 'keepExisting' | 'merge' | 'fail' | Extract[] + whenNotMatched?: 'insert' | 'discard' | 'fail' + } + } + + export interface Out { + /** [`$out` reference](https://docs.mongodb.com/manual/reference/operator/aggregation/out/) */ + $out: string | { db: string; coll: string } + } + + export interface PlanCacheStats { + /** [`$planCacheStats` reference](https://docs.mongodb.com/manual/reference/operator/aggregation/planCacheStats/) */ + $planCacheStats: Record + } + + export interface Project { + /** [`$project` reference](https://docs.mongodb.com/manual/reference/operator/aggregation/project/) */ + $project: { [field: string]: AnyExpression | Expression | Project['$project'] } + } + + export interface Redact { + /** [`$redact` reference](https://docs.mongodb.com/manual/reference/operator/aggregation/redact/) */ + $redact: Expression; + } + + export interface ReplaceRoot { + /** [`$replaceRoot` reference](https://docs.mongodb.com/manual/reference/operator/aggregation/replaceRoot/) */ + $replaceRoot: { newRoot: AnyExpression } + } + + export interface ReplaceWith { + /** [`$replaceWith` reference](https://docs.mongodb.com/manual/reference/operator/aggregation/replaceWith/) */ + $replaceWith: ObjectExpressionOperator; + } + + export interface Sample { + /** [`$sample` reference](https://docs.mongodb.com/manual/reference/operator/aggregation/sample/) */ + $sample: { size: number } + } + + export interface Search { + /** [`$search` reference](https://docs.atlas.mongodb.com/reference/atlas-search/query-syntax/) */ + $search: { + index?: string; + highlight?: { + /** [`highlightPath` reference](https://docs.atlas.mongodb.com/atlas-search/path-construction/#multiple-field-search) */ + path: string | string[] | { value: string, multi: string }; + maxCharsToExamine?: number; + maxNumPassages?: number; + }; + [operator: string]: any; + } + } + + export interface Set { + /** [`$set` reference](https://docs.mongodb.com/manual/reference/operator/aggregation/set/) */ + $set: Record + } + + export interface SetWindowFields { + /** [`$setWindowFields` reference](https://docs.mongodb.com/manual/reference/operator/aggregation/setWindowFields/) */ + $setWindowFields: { + partitionBy?: any + sortBy?: Record + output: Record< + string, + WindowOperator & { + window?: { + documents?: [string | number, string | number] + range?: [string | number, string | number] + unit?: 'year' | 'quarter' | 'month' | 'week' | 'day' | 'hour' | 'minute' | 'second' | 'millisecond' + } + } + > + } + } + + export interface Skip { + /** [`$skip` reference](https://docs.mongodb.com/manual/reference/operator/aggregation/skip/) */ + $skip: number + } + + export interface Sort { + /** [`$sort` reference](https://docs.mongodb.com/manual/reference/operator/aggregation/sort/) */ + $sort: Record + } + + export interface SortByCount { + /** [`$sortByCount` reference](https://docs.mongodb.com/manual/reference/operator/aggregation/sortByCount/) */ + $sortByCount: Expression; + } + + export interface UnionWith { + /** [`$unionWith` reference](https://docs.mongodb.com/manual/reference/operator/aggregation/unionWith/) */ + $unionWith: + | string + | { coll: string; pipeline?: Exclude[] } + } + + export interface Unset { + /** [`$unset` reference](https://docs.mongodb.com/manual/reference/operator/aggregation/unset/) */ + $unset: string | string[] + } + + export interface Unwind { + /** [`$unwind` reference](https://docs.mongodb.com/manual/reference/operator/aggregation/unwind/) */ + $unwind: string | { path: string; includeArrayIndex?: string; preserveNullAndEmptyArrays?: boolean } + } + } +} diff --git a/node_modules/mongoose/types/populate.d.ts b/node_modules/mongoose/types/populate.d.ts new file mode 100644 index 000000000..3d53cea14 --- /dev/null +++ b/node_modules/mongoose/types/populate.d.ts @@ -0,0 +1,40 @@ +declare module 'mongoose' { + + /** + * Reference another Model + */ + type PopulatedDoc< + PopulatedType, + RawId extends RefType = (PopulatedType extends { _id?: RefType; } ? NonNullable : Types.ObjectId) | undefined + > = PopulatedType | RawId; + + interface PopulateOptions { + /** space delimited path(s) to populate */ + path: string; + /** fields to select */ + select?: any; + /** query conditions to match */ + match?: any; + /** optional model to use for population */ + model?: string | Model; + /** optional query options like sort, limit, etc */ + options?: QueryOptions; + /** correct limit on populated array */ + perDocumentLimit?: number; + /** optional boolean, set to `false` to allow populating paths that aren't in the schema */ + strictPopulate?: boolean; + /** deep populate */ + populate?: string | PopulateOptions | (string | PopulateOptions)[]; + /** + * If true Mongoose will always set `path` to an array, if false Mongoose will + * always set `path` to a document. Inferred from schema by default. + */ + justOne?: boolean; + /** transform function to call on every populated doc */ + transform?: (doc: any, id: any) => any; + } + + interface PopulateOption { + populate?: string | string[] | PopulateOptions | PopulateOptions[]; + } +} diff --git a/node_modules/mongoose/types/query.d.ts b/node_modules/mongoose/types/query.d.ts new file mode 100644 index 000000000..fbb7f5048 --- /dev/null +++ b/node_modules/mongoose/types/query.d.ts @@ -0,0 +1,637 @@ +declare module 'mongoose' { + import mongodb = require('mongodb'); + + export type ApplyBasicQueryCasting = T extends any[] ? T[0] & defaultT: defaultT; + type Condition = ApplyBasicQueryCasting | QuerySelector>; + + type _FilterQuery = { + [P in keyof T]?: Condition; + } & RootQuerySelector; + + /** + * Filter query to select the documents that match the query + * @example + * ```js + * { age: { $gte: 30 } } + * ``` + */ + type FilterQuery = _FilterQuery; + + type MongooseQueryOptions = Pick, 'populate' | 'lean' | 'strict' | 'sanitizeProjection' | 'sanitizeFilter'>; + + type ProjectionFields = { [Key in keyof Omit, '__v'>]?: any } & Record; + + type QueryWithHelpers = Query & THelpers; + + type QuerySelector = { + // Comparison + $eq?: T; + $gt?: T; + $gte?: T; + $in?: [T] extends AnyArray ? Unpacked[] : T[]; + $lt?: T; + $lte?: T; + $ne?: T; + $nin?: [T] extends AnyArray ? Unpacked[] : T[]; + // Logical + $not?: T extends string ? QuerySelector | RegExp : QuerySelector; + // Element + /** + * When `true`, `$exists` matches the documents that contain the field, + * including documents where the field value is null. + */ + $exists?: boolean; + $type?: string | number; + // Evaluation + $expr?: any; + $jsonSchema?: any; + $mod?: T extends number ? [number, number] : never; + $regex?: T extends string ? RegExp | string : never; + $options?: T extends string ? string : never; + // Geospatial + // TODO: define better types for geo queries + $geoIntersects?: { $geometry: object }; + $geoWithin?: object; + $near?: object; + $nearSphere?: object; + $maxDistance?: number; + // Array + // TODO: define better types for $all and $elemMatch + $all?: T extends AnyArray ? any[] : never; + $elemMatch?: T extends AnyArray ? object : never; + $size?: T extends AnyArray ? number : never; + // Bitwise + $bitsAllClear?: number | mongodb.Binary | number[]; + $bitsAllSet?: number | mongodb.Binary | number[]; + $bitsAnyClear?: number | mongodb.Binary | number[]; + $bitsAnySet?: number | mongodb.Binary | number[]; + }; + + type RootQuerySelector = { + /** @see https://docs.mongodb.com/manual/reference/operator/query/and/#op._S_and */ + $and?: Array>; + /** @see https://docs.mongodb.com/manual/reference/operator/query/nor/#op._S_nor */ + $nor?: Array>; + /** @see https://docs.mongodb.com/manual/reference/operator/query/or/#op._S_or */ + $or?: Array>; + /** @see https://docs.mongodb.com/manual/reference/operator/query/text */ + $text?: { + $search: string; + $language?: string; + $caseSensitive?: boolean; + $diacriticSensitive?: boolean; + }; + /** @see https://docs.mongodb.com/manual/reference/operator/query/where/#op._S_where */ + $where?: string | Function; + /** @see https://docs.mongodb.com/manual/reference/operator/query/comment/#op._S_comment */ + $comment?: string; + // we could not find a proper TypeScript generic to support nested queries e.g. 'user.friends.name' + // this will mark all unrecognized properties as any (including nested queries) + [key: string]: any; + }; + + interface QueryOptions extends + PopulateOption, + SessionOption { + arrayFilters?: { [key: string]: any }[]; + batchSize?: number; + collation?: mongodb.CollationOptions; + comment?: any; + context?: string; + explain?: mongodb.ExplainVerbosityLike; + fields?: any | string; + hint?: mongodb.Hint; + /** + * If truthy, mongoose will return the document as a plain JavaScript object rather than a mongoose document. + */ + lean?: boolean | any; + limit?: number; + maxTimeMS?: number; + maxscan?: number; + multi?: boolean; + multipleCastError?: boolean; + /** + * By default, `findOneAndUpdate()` returns the document as it was **before** + * `update` was applied. If you set `new: true`, `findOneAndUpdate()` will + * instead give you the object after `update` was applied. + */ + new?: boolean; + overwrite?: boolean; + overwriteDiscriminatorKey?: boolean; + projection?: ProjectionType; + /** + * if true, returns the raw result from the MongoDB driver + */ + rawResult?: boolean; + readPreference?: string | mongodb.ReadPreferenceMode; + /** + * An alias for the `new` option. `returnOriginal: false` is equivalent to `new: true`. + */ + returnOriginal?: boolean; + /** + * Another alias for the `new` option. `returnOriginal` is deprecated so this should be used. + */ + returnDocument?: string; + runValidators?: boolean; + /* Set to `true` to automatically sanitize potentially unsafe user-generated query projections */ + sanitizeProjection?: boolean; + /** + * Set to `true` to automatically sanitize potentially unsafe query filters by stripping out query selectors that + * aren't explicitly allowed using `mongoose.trusted()`. + */ + sanitizeFilter?: boolean; + setDefaultsOnInsert?: boolean; + skip?: number; + snapshot?: any; + sort?: any; + /** overwrites the schema's strict mode option */ + strict?: boolean | string; + /** + * equal to `strict` by default, may be `false`, `true`, or `'throw'`. Sets the default + * [strictQuery](https://mongoosejs.com/docs/guide.html#strictQuery) mode for schemas. + */ + strictQuery?: boolean | 'throw'; + tailable?: number; + /** + * If set to `false` and schema-level timestamps are enabled, + * skip timestamps for this update. Note that this allows you to overwrite + * timestamps. Does nothing if schema-level timestamps are not set. + */ + timestamps?: boolean; + upsert?: boolean; + writeConcern?: mongodb.WriteConcern; + + [other: string]: any; + } + + class Query implements SessionOperation { + _mongooseOptions: MongooseQueryOptions; + + /** + * Returns a wrapper around a [mongodb driver cursor](http://mongodb.github.io/node-mongodb-native/2.1/api/Cursor.html). + * A QueryCursor exposes a Streams3 interface, as well as a `.next()` function. + * This is equivalent to calling `.cursor()` with no arguments. + */ + [Symbol.asyncIterator](): AsyncIterableIterator; + + /** Executes the query */ + exec(callback: Callback): void; + exec(): Promise; + + $where(argument: string | Function): QueryWithHelpers; + + /** Specifies an `$all` query condition. When called with one argument, the most recent path passed to `where()` is used. */ + all(path: string, val: Array): this; + all(val: Array): this; + + /** Sets the allowDiskUse option for the query (ignored for < 4.4.0) */ + allowDiskUse(value: boolean): this; + + /** Specifies arguments for an `$and` condition. */ + and(array: FilterQuery[]): this; + + /** Specifies the batchSize option. */ + batchSize(val: number): this; + + /** Specifies a `$box` condition */ + box(lower: number[], upper: number[]): this; + box(val: any): this; + + /** + * Casts this query to the schema of `model`. + * + * @param {Model} [model] the model to cast to. If not set, defaults to `this.model` + * @param {Object} [obj] If not set, defaults to this query's conditions + * @return {Object} the casted `obj` + */ + cast(model?: Model | null, obj?: any): any; + + /** + * Executes the query returning a `Promise` which will be + * resolved with either the doc(s) or rejected with the error. + * Like `.then()`, but only takes a rejection handler. + */ + catch: Promise['catch']; + + /** Specifies a `$center` or `$centerSphere` condition. */ + circle(path: string, area: any): this; + circle(area: any): this; + + /** Make a copy of this query so you can re-execute it. */ + clone(): this; + + /** Adds a collation to this op (MongoDB 3.4 and up) */ + collation(value: mongodb.CollationOptions): this; + + /** Specifies the `comment` option. */ + comment(val: string): this; + + /** Specifies this query as a `count` query. */ + count(criteria: FilterQuery, callback?: Callback): QueryWithHelpers; + count(callback?: Callback): QueryWithHelpers; + + /** Specifies this query as a `countDocuments` query. */ + countDocuments( + criteria: FilterQuery, + options?: QueryOptions, + callback?: Callback + ): QueryWithHelpers; + countDocuments(callback?: Callback): QueryWithHelpers; + + /** + * Returns a wrapper around a [mongodb driver cursor](http://mongodb.github.io/node-mongodb-native/2.1/api/Cursor.html). + * A QueryCursor exposes a Streams3 interface, as well as a `.next()` function. + */ + cursor(options?: QueryOptions): Cursor>; + + /** + * Declare and/or execute this query as a `deleteMany()` operation. Works like + * remove, except it deletes _every_ document that matches `filter` in the + * collection, regardless of the value of `single`. + */ + deleteMany(filter?: FilterQuery, options?: QueryOptions, callback?: Callback): QueryWithHelpers; + deleteMany(filter: FilterQuery, callback: Callback): QueryWithHelpers; + deleteMany(callback: Callback): QueryWithHelpers; + + /** + * Declare and/or execute this query as a `deleteOne()` operation. Works like + * remove, except it deletes at most one document regardless of the `single` + * option. + */ + deleteOne(filter?: FilterQuery, options?: QueryOptions, callback?: Callback): QueryWithHelpers; + deleteOne(filter: FilterQuery, callback: Callback): QueryWithHelpers; + deleteOne(callback: Callback): QueryWithHelpers; + + /** Creates a `distinct` query: returns the distinct values of the given `field` that match `filter`. */ + distinct(field: string, filter?: FilterQuery, callback?: Callback): QueryWithHelpers, DocType, THelpers, RawDocType>; + + /** Specifies a `$elemMatch` query condition. When called with one argument, the most recent path passed to `where()` is used. */ + elemMatch>(path: K, val: FilterQuery[K]['$elemMatch']): this; + elemMatch(val: Function | any): this; + + /** + * Gets/sets the error flag on this query. If this flag is not null or + * undefined, the `exec()` promise will reject without executing. + */ + error(): NativeError | null; + error(val: NativeError | null): this; + + /** Specifies the complementary comparison value for paths specified with `where()` */ + equals(val: any): this; + + /** Creates a `estimatedDocumentCount` query: counts the number of documents in the collection. */ + estimatedDocumentCount(options?: QueryOptions, callback?: Callback): QueryWithHelpers; + + /** Specifies a `$exists` query condition. When called with one argument, the most recent path passed to `where()` is used. */ + exists>(path: K, val: FilterQuery[K]['$exists']): this; + exists(val: boolean): this; + + /** + * Sets the [`explain` option](https://docs.mongodb.com/manual/reference/method/cursor.explain/), + * which makes this query return detailed execution stats instead of the actual + * query result. This method is useful for determining what index your queries + * use. + */ + explain(verbose?: mongodb.ExplainVerbosityLike): this; + + /** Creates a `find` query: gets a list of documents that match `filter`. */ + find( + filter: FilterQuery, + projection?: ProjectionType | null, + options?: QueryOptions | null, + callback?: Callback + ): QueryWithHelpers, DocType, THelpers, RawDocType>; + find( + filter: FilterQuery, + projection?: ProjectionType | null, + callback?: Callback + ): QueryWithHelpers, DocType, THelpers, RawDocType>; + find( + filter: FilterQuery, + callback?: Callback + ): QueryWithHelpers, DocType, THelpers, RawDocType>; + find(callback?: Callback): QueryWithHelpers, DocType, THelpers, RawDocType>; + + /** Declares the query a findOne operation. When executed, the first found document is passed to the callback. */ + findOne( + filter?: FilterQuery, + projection?: ProjectionType | null, + options?: QueryOptions | null, + callback?: Callback + ): QueryWithHelpers; + findOne( + filter?: FilterQuery, + projection?: ProjectionType | null, + callback?: Callback + ): QueryWithHelpers; + findOne( + filter?: FilterQuery, + callback?: Callback + ): QueryWithHelpers; + + /** Creates a `findOneAndDelete` query: atomically finds the given document, deletes it, and returns the document as it was before deletion. */ + findOneAndDelete( + filter?: FilterQuery, + options?: QueryOptions | null, + callback?: (err: CallbackError, doc: DocType | null, res: any) => void + ): QueryWithHelpers; + + /** Creates a `findOneAndRemove` query: atomically finds the given document and deletes it. */ + findOneAndRemove( + filter?: FilterQuery, + options?: QueryOptions | null, + callback?: (err: CallbackError, doc: DocType | null, res: any) => void + ): QueryWithHelpers; + + /** Creates a `findOneAndUpdate` query: atomically find the first document that matches `filter` and apply `update`. */ + findOneAndUpdate( + filter: FilterQuery, + update: UpdateQuery, + options: QueryOptions & { rawResult: true }, + callback?: (err: CallbackError, doc: DocType | null, res: ModifyResult) => void + ): QueryWithHelpers, DocType, THelpers, RawDocType>; + findOneAndUpdate( + filter: FilterQuery, + update: UpdateQuery, + options: QueryOptions & { upsert: true } & ReturnsNewDoc, + callback?: (err: CallbackError, doc: DocType, res: ModifyResult) => void + ): QueryWithHelpers; + findOneAndUpdate( + filter?: FilterQuery, + update?: UpdateQuery, + options?: QueryOptions | null, + callback?: (err: CallbackError, doc: DocType | null, res: ModifyResult) => void + ): QueryWithHelpers; + + /** Creates a `findByIdAndDelete` query, filtering by the given `_id`. */ + findByIdAndDelete(id?: mongodb.ObjectId | any, options?: QueryOptions | null, callback?: (err: CallbackError, doc: DocType | null, res: any) => void): QueryWithHelpers; + + /** Creates a `findOneAndUpdate` query, filtering by the given `_id`. */ + findByIdAndUpdate(id: mongodb.ObjectId | any, update: UpdateQuery, options: QueryOptions & { rawResult: true }, callback?: (err: CallbackError, doc: any, res?: any) => void): QueryWithHelpers; + findByIdAndUpdate(id: mongodb.ObjectId | any, update: UpdateQuery, options: QueryOptions & { upsert: true } & ReturnsNewDoc, callback?: (err: CallbackError, doc: DocType, res?: any) => void): QueryWithHelpers; + findByIdAndUpdate(id?: mongodb.ObjectId | any, update?: UpdateQuery, options?: QueryOptions | null, callback?: (CallbackError: any, doc: DocType | null, res?: any) => void): QueryWithHelpers; + findByIdAndUpdate(id: mongodb.ObjectId | any, update: UpdateQuery, callback: (CallbackError: any, doc: DocType | null, res?: any) => void): QueryWithHelpers; + + /** Specifies a `$geometry` condition */ + geometry(object: { type: string, coordinates: any[] }): this; + + /** + * For update operations, returns the value of a path in the update's `$set`. + * Useful for writing getters/setters that can work with both update operations + * and `save()`. + */ + get(path: string): any; + + /** Returns the current query filter (also known as conditions) as a POJO. */ + getFilter(): FilterQuery; + + /** Gets query options. */ + getOptions(): QueryOptions; + + /** Gets a list of paths to be populated by this query */ + getPopulatedPaths(): Array; + + /** Returns the current query filter. Equivalent to `getFilter()`. */ + getQuery(): FilterQuery; + + /** Returns the current update operations as a JSON object. */ + getUpdate(): UpdateQuery | UpdateWithAggregationPipeline | null; + + /** Specifies a `$gt` query condition. When called with one argument, the most recent path passed to `where()` is used. */ + gt>(path: K, val: FilterQuery[K]['$gt']): this; + gt(val: number): this; + + /** Specifies a `$gte` query condition. When called with one argument, the most recent path passed to `where()` is used. */ + gte>(path: K, val: FilterQuery[K]['$gte']): this; + gte(val: number): this; + + /** Sets query hints. */ + hint(val: any): this; + + /** Specifies an `$in` query condition. When called with one argument, the most recent path passed to `where()` is used. */ + in>(path: K, val: FilterQuery[K]['$in']): this; + in(val: Array): this; + + /** Declares an intersects query for `geometry()`. */ + intersects(arg?: any): this; + + /** Requests acknowledgement that this operation has been persisted to MongoDB's on-disk journal. */ + j(val: boolean | null): this; + + /** Sets the lean option. */ + lean : LeanDocumentOrArrayWithRawType>>(val?: boolean | any): QueryWithHelpers; + + /** Specifies the maximum number of documents the query will return. */ + limit(val: number): this; + + /** Specifies a `$lt` query condition. When called with one argument, the most recent path passed to `where()` is used. */ + lt>(path: K, val: FilterQuery[K]['$lt']): this; + lt(val: number): this; + + /** Specifies a `$lte` query condition. When called with one argument, the most recent path passed to `where()` is used. */ + lte>(path: K, val: FilterQuery[K]['$lte']): this; + lte(val: number): this; + + /** + * Runs a function `fn` and treats the return value of `fn` as the new value + * for the query to resolve to. + */ + transform(fn: (doc: ResultType) => MappedType): QueryWithHelpers; + + /** Specifies an `$maxDistance` query condition. When called with one argument, the most recent path passed to `where()` is used. */ + maxDistance(path: string, val: number): this; + maxDistance(val: number): this; + + /** Specifies the maxScan option. */ + maxScan(val: number): this; + + /** + * Sets the [maxTimeMS](https://docs.mongodb.com/manual/reference/method/cursor.maxTimeMS/) + * option. This will tell the MongoDB server to abort if the query or write op + * has been running for more than `ms` milliseconds. + */ + maxTimeMS(ms: number): this; + + /** Merges another Query or conditions object into this one. */ + merge(source: Query | FilterQuery): this; + + /** Specifies a `$mod` condition, filters documents for documents whose `path` property is a number that is equal to `remainder` modulo `divisor`. */ + mod>(path: K, val: FilterQuery[K]['$mod']): this; + mod(val: Array): this; + + /** The model this query was created from */ + model: typeof Model; + + /** + * Getter/setter around the current mongoose-specific options for this query + * Below are the current Mongoose-specific options. + */ + mongooseOptions(val?: MongooseQueryOptions): MongooseQueryOptions; + + /** Specifies a `$ne` query condition. When called with one argument, the most recent path passed to `where()` is used. */ + ne>(path: K, val: FilterQuery[K]['$ne']): this; + ne(val: any): this; + + /** Specifies a `$near` or `$nearSphere` condition */ + near>(path: K, val: FilterQuery[K]['$near']): this; + near(val: any): this; + + /** Specifies an `$nin` query condition. When called with one argument, the most recent path passed to `where()` is used. */ + nin>(path: K, val: FilterQuery[K]['$nin']): this; + nin(val: Array): this; + + /** Specifies arguments for an `$nor` condition. */ + nor(array: Array>): this; + + /** Specifies arguments for an `$or` condition. */ + or(array: Array>): this; + + /** + * Make this query throw an error if no documents match the given `filter`. + * This is handy for integrating with async/await, because `orFail()` saves you + * an extra `if` statement to check if no document was found. + */ + orFail(err?: NativeError | (() => NativeError)): QueryWithHelpers, DocType, THelpers, RawDocType>; + + /** Specifies a `$polygon` condition */ + polygon(path: string, ...coordinatePairs: number[][]): this; + polygon(...coordinatePairs: number[][]): this; + + /** Specifies paths which should be populated with other documents. */ + populate(path: string | string[], select?: string | any, model?: string | Model, match?: any): QueryWithHelpers, DocType, THelpers, UnpackedIntersection>; + populate(options: PopulateOptions | (PopulateOptions | string)[]): QueryWithHelpers, DocType, THelpers, UnpackedIntersection>; + + /** Get/set the current projection (AKA fields). Pass `null` to remove the current projection. */ + projection(fields?: ProjectionFields | string): ProjectionFields; + projection(fields: null): null; + projection(): ProjectionFields | null; + + /** Determines the MongoDB nodes from which to read. */ + read(pref: string | mongodb.ReadPreferenceMode, tags?: any[]): this; + + /** Sets the readConcern option for the query. */ + readConcern(level: string): this; + + /** Specifies a `$regex` query condition. When called with one argument, the most recent path passed to `where()` is used. */ + regex>(path: K, val: FilterQuery[K]['$regex']): this; + regex(val: string | RegExp): this; + + /** + * Declare and/or execute this query as a remove() operation. `remove()` is + * deprecated, you should use [`deleteOne()`](#query_Query-deleteOne) + * or [`deleteMany()`](#query_Query-deleteMany) instead. + */ + remove(filter?: FilterQuery, callback?: Callback): Query; + + /** + * Declare and/or execute this query as a replaceOne() operation. Same as + * `update()`, except MongoDB will replace the existing document and will + * not accept any [atomic](https://docs.mongodb.com/manual/tutorial/model-data-for-atomic-operations/#pattern) operators (`$set`, etc.) + */ + replaceOne(filter?: FilterQuery, replacement?: DocType | AnyObject, options?: QueryOptions | null, callback?: Callback): QueryWithHelpers; + + /** Specifies which document fields to include or exclude (also known as the query "projection") */ + select(arg: string | any): this; + + /** Determines if field selection has been made. */ + selected(): boolean; + + /** Determines if exclusive field selection has been made. */ + selectedExclusively(): boolean; + + /** Determines if inclusive field selection has been made. */ + selectedInclusively(): boolean; + + /** + * Sets the [MongoDB session](https://docs.mongodb.com/manual/reference/server-sessions/) + * associated with this query. Sessions are how you mark a query as part of a + * [transaction](/docs/transactions.html). + */ + session(session: mongodb.ClientSession | null): this; + + /** + * Adds a `$set` to this query's update without changing the operation. + * This is useful for query middleware so you can add an update regardless + * of whether you use `updateOne()`, `updateMany()`, `findOneAndUpdate()`, etc. + */ + set(path: string | Record, value?: any): this; + + /** Sets query options. Some options only make sense for certain operations. */ + setOptions(options: QueryOptions, overwrite?: boolean): this; + + /** Sets the query conditions to the provided JSON object. */ + setQuery(val: FilterQuery | null): void; + + setUpdate(update: UpdateQuery | UpdateWithAggregationPipeline): void; + + /** Specifies an `$size` query condition. When called with one argument, the most recent path passed to `where()` is used. */ + size>(path: K, val: FilterQuery[K]['$size']): this; + size(val: number): this; + + /** Specifies the number of documents to skip. */ + skip(val: number): this; + + /** Specifies a `$slice` projection for an array. */ + slice(path: string, val: number | Array): this; + slice(val: number | Array): this; + + /** Specifies this query as a `snapshot` query. */ + snapshot(val?: boolean): this; + + /** Sets the sort order. If an object is passed, values allowed are `asc`, `desc`, `ascending`, `descending`, `1`, and `-1`. */ + sort(arg?: string | { [key: string]: SortOrder | { $meta: 'textScore' } } | undefined | null): this; + + /** Sets the tailable option (for use with capped collections). */ + tailable(bool?: boolean, opts?: { + numberOfRetries?: number; + tailableRetryInterval?: number; + }): this; + + /** + * Executes the query returning a `Promise` which will be + * resolved with either the doc(s) or rejected with the error. + */ + then: Promise['then']; + + /** Converts this query to a customized, reusable query constructor with all arguments and options retained. */ + toConstructor(): new (...args: any[]) => QueryWithHelpers; + + /** Declare and/or execute this query as an update() operation. */ + update(filter?: FilterQuery, update?: UpdateQuery | UpdateWithAggregationPipeline, options?: QueryOptions | null, callback?: Callback): QueryWithHelpers; + + /** + * Declare and/or execute this query as an updateMany() operation. Same as + * `update()`, except MongoDB will update _all_ documents that match + * `filter` (as opposed to just the first one) regardless of the value of + * the `multi` option. + */ + updateMany(filter?: FilterQuery, update?: UpdateQuery | UpdateWithAggregationPipeline, options?: QueryOptions | null, callback?: Callback): QueryWithHelpers; + + /** + * Declare and/or execute this query as an updateOne() operation. Same as + * `update()`, except it does not support the `multi` or `overwrite` options. + */ + updateOne(filter?: FilterQuery, update?: UpdateQuery | UpdateWithAggregationPipeline, options?: QueryOptions | null, callback?: Callback): QueryWithHelpers; + + /** + * Sets the specified number of `mongod` servers, or tag set of `mongod` servers, + * that must acknowledge this write before this write is considered successful. + */ + w(val: string | number | null): this; + + /** Specifies a path for use with chaining. */ + where(path: string, val?: any): this; + where(obj: object): this; + where(): this; + + /** Defines a `$within` or `$geoWithin` argument for geo-spatial queries. */ + within(val?: any): this; + + /** + * If [`w > 1`](/docs/api.html#query_Query-w), the maximum amount of time to + * wait for this write to propagate through the replica set before this + * operation fails. The default is `0`, which means no timeout. + */ + wtimeout(ms: number): this; + } +} diff --git a/node_modules/mongoose/types/schemaoptions.d.ts b/node_modules/mongoose/types/schemaoptions.d.ts new file mode 100644 index 000000000..689383a3f --- /dev/null +++ b/node_modules/mongoose/types/schemaoptions.d.ts @@ -0,0 +1,206 @@ +declare module 'mongoose' { + import mongodb = require('mongodb'); + + interface SchemaTimestampsConfig { + createdAt?: boolean | string; + updatedAt?: boolean | string; + currentTime?: () => (NativeDate | number); + } + + type TypeKeyBaseType = string; + + type DefaultTypeKey = 'type'; + interface SchemaOptions { + /** + * By default, Mongoose's init() function creates all the indexes defined in your model's schema by + * calling Model.createIndexes() after you successfully connect to MongoDB. If you want to disable + * automatic index builds, you can set autoIndex to false. + */ + autoIndex?: boolean; + /** + * If set to `true`, Mongoose will call Model.createCollection() to create the underlying collection + * in MongoDB if autoCreate is set to true. Calling createCollection() sets the collection's default + * collation based on the collation option and establishes the collection as a capped collection if + * you set the capped schema option. + */ + autoCreate?: boolean; + /** + * By default, mongoose buffers commands when the connection goes down until the driver manages to reconnect. + * To disable buffering, set bufferCommands to false. + */ + bufferCommands?: boolean; + /** + * If bufferCommands is on, this option sets the maximum amount of time Mongoose buffering will wait before + * throwing an error. If not specified, Mongoose will use 10000 (10 seconds). + */ + bufferTimeoutMS?: number; + /** + * Mongoose supports MongoDBs capped collections. To specify the underlying MongoDB collection be capped, set + * the capped option to the maximum size of the collection in bytes. + */ + capped?: boolean | number | { size?: number; max?: number; autoIndexId?: boolean; }; + /** Sets a default collation for every query and aggregation. */ + collation?: mongodb.CollationOptions; + + /** The timeseries option to use when creating the model's collection. */ + timeseries?: mongodb.TimeSeriesCollectionOptions; + + /** The number of seconds after which a document in a timeseries collection expires. */ + expireAfterSeconds?: number; + + /** The time after which a document in a timeseries collection expires. */ + expires?: number | string; + + /** + * Mongoose by default produces a collection name by passing the model name to the utils.toCollectionName + * method. This method pluralizes the name. Set this option if you need a different name for your collection. + */ + collection?: string; + /** + * When you define a [discriminator](/docs/discriminators.html), Mongoose adds a path to your + * schema that stores which discriminator a document is an instance of. By default, Mongoose + * adds an `__t` path, but you can set `discriminatorKey` to overwrite this default. + * + * @default '__t' + */ + discriminatorKey?: string; + + /** + * Option for nested Schemas. + * + * If true, skip building indexes on this schema's path. + * + * @default false + */ + excludeIndexes?: boolean; + /** + * Mongoose assigns each of your schemas an id virtual getter by default which returns the document's _id field + * cast to a string, or in the case of ObjectIds, its hexString. + */ + id?: boolean; + /** + * Mongoose assigns each of your schemas an _id field by default if one is not passed into the Schema + * constructor. The type assigned is an ObjectId to coincide with MongoDB's default behavior. If you + * don't want an _id added to your schema at all, you may disable it using this option. + */ + _id?: boolean; + /** + * Mongoose will, by default, "minimize" schemas by removing empty objects. This behavior can be + * overridden by setting minimize option to false. It will then store empty objects. + */ + minimize?: boolean; + /** + * Optimistic concurrency is a strategy to ensure the document you're updating didn't change between when you + * loaded it using find() or findOne(), and when you update it using save(). Set to `true` to enable + * optimistic concurrency. + */ + optimisticConcurrency?: boolean; + /** + * If `plugin()` called with tags, Mongoose will only apply plugins to schemas that have + * a matching tag in `pluginTags` + */ + pluginTags?: string[]; + /** + * Allows setting query#read options at the schema level, providing us a way to apply default ReadPreferences + * to all queries derived from a model. + */ + read?: string; + /** Allows setting write concern at the schema level. */ + writeConcern?: WriteConcern; + /** defaults to true. */ + safe?: boolean | { w?: number | string; wtimeout?: number; j?: boolean }; + /** + * The shardKey option is used when we have a sharded MongoDB architecture. Each sharded collection is + * given a shard key which must be present in all insert/update operations. We just need to set this + * schema option to the same shard key and we'll be all set. + */ + shardKey?: Record; + /** + * The strict option, (enabled by default), ensures that values passed to our model constructor that were not + * specified in our schema do not get saved to the db. + */ + strict?: boolean | 'throw'; + /** + * equal to `strict` by default, may be `false`, `true`, or `'throw'`. Sets the default + * [strictQuery](https://mongoosejs.com/docs/guide.html#strictQuery) mode for schemas. + */ + strictQuery?: boolean | 'throw'; + /** Exactly the same as the toObject option but only applies when the document's toJSON method is called. */ + toJSON?: ToObjectOptions; + /** + * Documents have a toObject method which converts the mongoose document into a plain JavaScript object. + * This method accepts a few options. Instead of applying these options on a per-document basis, we may + * declare the options at the schema level and have them applied to all of the schema's documents by + * default. + */ + toObject?: ToObjectOptions; + /** + * By default, if you have an object with key 'type' in your schema, mongoose will interpret it as a + * type declaration. However, for applications like geoJSON, the 'type' property is important. If you want to + * control which key mongoose uses to find type declarations, set the 'typeKey' schema option. + */ + typeKey?: PathTypeKey; + + /** + * By default, documents are automatically validated before they are saved to the database. This is to + * prevent saving an invalid document. If you want to handle validation manually, and be able to save + * objects which don't pass validation, you can set validateBeforeSave to false. + */ + validateBeforeSave?: boolean; + /** + * The versionKey is a property set on each document when first created by Mongoose. This keys value + * contains the internal revision of the document. The versionKey option is a string that represents + * the path to use for versioning. The default is '__v'. + * + * @default '__v' + */ + versionKey?: string | boolean; + /** + * By default, Mongoose will automatically select() any populated paths for you, unless you explicitly exclude them. + * + * @default true + */ + selectPopulatedPaths?: boolean; + /** + * skipVersioning allows excluding paths from versioning (i.e., the internal revision will not be + * incremented even if these paths are updated). DO NOT do this unless you know what you're doing. + * For subdocuments, include this on the parent document using the fully qualified path. + */ + skipVersioning?: { [key: string]: boolean; }; + /** + * Validation errors in a single nested schema are reported + * both on the child and on the parent schema. + * Set storeSubdocValidationError to false on the child schema + * to make Mongoose only report the parent error. + */ + storeSubdocValidationError?: boolean; + /** + * The timestamps option tells mongoose to assign createdAt and updatedAt fields to your schema. The type + * assigned is Date. By default, the names of the fields are createdAt and updatedAt. Customize the + * field names by setting timestamps.createdAt and timestamps.updatedAt. + */ + timestamps?: boolean | SchemaTimestampsConfig; + + /** + * Using `save`, `isNew`, and other Mongoose reserved names as schema path names now triggers a warning, not an error. + * You can suppress the warning by setting { supressReservedKeysWarning: true } schema options. Keep in mind that this + * can break plugins that rely on these reserved names. + */ + supressReservedKeysWarning?: boolean, + + /** + * Model Statics methods. + */ + statics?: Record, ...args: any) => unknown> | StaticMethods, + + /** + * Document instance methods. + */ + methods?: Record, ...args: any) => unknown> | InstanceMethods, + + /** + * Query helper functions + */ + query?: Record>(this: T, ...args: any) => T> | QueryHelpers, + } +} \ No newline at end of file diff --git a/node_modules/mongoose/types/schematypes.d.ts b/node_modules/mongoose/types/schematypes.d.ts new file mode 100644 index 000000000..78ebd5ff5 --- /dev/null +++ b/node_modules/mongoose/types/schematypes.d.ts @@ -0,0 +1,427 @@ +declare module 'mongoose' { + + /** The Mongoose Date [SchemaType](/docs/schematypes.html). */ + type Date = Schema.Types.Date; + + /** + * The Mongoose Decimal128 [SchemaType](/docs/schematypes.html). Used for + * declaring paths in your schema that should be + * [128-bit decimal floating points](http://thecodebarbarian.com/a-nodejs-perspective-on-mongodb-34-decimal.html). + * Do not use this to create a new Decimal128 instance, use `mongoose.Types.Decimal128` + * instead. + */ + type Decimal128 = Schema.Types.Decimal128; + + /** + * The Mongoose Mixed [SchemaType](/docs/schematypes.html). Used for + * declaring paths in your schema that Mongoose's change tracking, casting, + * and validation should ignore. + */ + type Mixed = Schema.Types.Mixed; + + /** + * The Mongoose Number [SchemaType](/docs/schematypes.html). Used for + * declaring paths in your schema that Mongoose should cast to numbers. + */ + type Number = Schema.Types.Number; + + /** + * The Mongoose ObjectId [SchemaType](/docs/schematypes.html). Used for + * declaring paths in your schema that should be + * [MongoDB ObjectIds](https://docs.mongodb.com/manual/reference/method/ObjectId/). + * Do not use this to create a new ObjectId instance, use `mongoose.Types.ObjectId` + * instead. + */ + type ObjectId = Schema.Types.ObjectId; + + /** The various Mongoose SchemaTypes. */ + const SchemaTypes: typeof Schema.Types; + + type DefaultType = T extends Schema.Types.Mixed ? any : Partial>; + + class SchemaTypeOptions { + type?: + T extends string ? StringSchemaDefinition : + T extends number ? NumberSchemaDefinition : + T extends boolean ? BooleanSchemaDefinition : + T extends NativeDate ? DateSchemaDefinition : + T extends Map ? SchemaDefinition : + T extends Buffer ? SchemaDefinition : + T extends Types.ObjectId ? ObjectIdSchemaDefinition : + T extends Types.ObjectId[] ? AnyArray | AnyArray> : + T extends object[] ? (AnyArray> | AnyArray>> | AnyArray>>) : + T extends string[] ? AnyArray | AnyArray> : + T extends number[] ? AnyArray | AnyArray> : + T extends boolean[] ? AnyArray | AnyArray> : + T extends Function[] ? AnyArray | AnyArray>> : + T | typeof SchemaType | Schema | SchemaDefinition | Function | AnyArray; + + /** Defines a virtual with the given name that gets/sets this path. */ + alias?: string; + + /** Function or object describing how to validate this schematype. See [validation docs](https://mongoosejs.com/docs/validation.html). */ + validate?: SchemaValidator | AnyArray>; + + /** Allows overriding casting logic for this individual path. If a string, the given string overwrites Mongoose's default cast error message. */ + cast?: string; + + /** + * If true, attach a required validator to this path, which ensures this path + * path cannot be set to a nullish value. If a function, Mongoose calls the + * function and only checks for nullish values if the function returns a truthy value. + */ + required?: boolean | (() => boolean) | [boolean, string] | [() => boolean, string]; + + /** + * The default value for this path. If a function, Mongoose executes the function + * and uses the return value as the default. + */ + default?: DefaultType | ((this: any, doc: any) => DefaultType) | null; + + /** + * The model that `populate()` should use if populating this path. + */ + ref?: string | Model | ((this: any, doc: any) => string | Model); + + /** + * The path in the document that `populate()` should use to find the model + * to use. + */ + + refPath?: string | ((this: any, doc: any) => string); + + /** + * Whether to include or exclude this path by default when loading documents + * using `find()`, `findOne()`, etc. + */ + select?: boolean | number; + + /** + * If [truthy](https://masteringjs.io/tutorials/fundamentals/truthy), Mongoose will + * build an index on this path when the model is compiled. + */ + index?: boolean | number | IndexOptions | '2d' | '2dsphere' | 'hashed' | 'text'; + + /** + * If [truthy](https://masteringjs.io/tutorials/fundamentals/truthy), Mongoose + * will build a unique index on this path when the + * model is compiled. [The `unique` option is **not** a validator](/docs/validation.html#the-unique-option-is-not-a-validator). + */ + unique?: boolean | number; + + /** + * If [truthy](https://masteringjs.io/tutorials/fundamentals/truthy), Mongoose will + * disallow changes to this path once the document is saved to the database for the first time. Read more + * about [immutability in Mongoose here](http://thecodebarbarian.com/whats-new-in-mongoose-5-6-immutable-properties.html). + */ + immutable?: boolean | ((this: any, doc: any) => boolean); + + /** + * If [truthy](https://masteringjs.io/tutorials/fundamentals/truthy), Mongoose will + * build a sparse index on this path. + */ + sparse?: boolean | number; + + /** + * If [truthy](https://masteringjs.io/tutorials/fundamentals/truthy), Mongoose + * will build a text index on this path. + */ + text?: boolean | number | any; + + /** + * Define a transform function for this individual schema type. + * Only called when calling `toJSON()` or `toObject()`. + */ + transform?: (this: any, val: T) => any; + + /** defines a custom getter for this property using [`Object.defineProperty()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/defineProperty). */ + get?: (value: any, doc?: this) => T | undefined; + + /** defines a custom setter for this property using [`Object.defineProperty()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/defineProperty). */ + set?: (value: any, priorVal?: T, doc?: this) => any; + + /** array of allowed values for this path. Allowed for strings, numbers, and arrays of strings */ + enum?: Array | ReadonlyArray | { values: Array | ReadonlyArray, message?: string } | { [path: string]: string | number | null }; + + /** The default [subtype](http://bsonspec.org/spec.html) associated with this buffer when it is stored in MongoDB. Only allowed for buffer paths */ + subtype?: number; + + /** The minimum value allowed for this path. Only allowed for numbers and dates. */ + min?: number | NativeDate | [number, string] | [NativeDate, string] | readonly [number, string] | readonly [NativeDate, string]; + + /** The maximum value allowed for this path. Only allowed for numbers and dates. */ + max?: number | NativeDate | [number, string] | [NativeDate, string] | readonly [number, string] | readonly [NativeDate, string]; + + /** Defines a TTL index on this path. Only allowed for dates. */ + expires?: string | number; + + /** If `true`, Mongoose will skip gathering indexes on subpaths. Only allowed for subdocuments and subdocument arrays. */ + excludeIndexes?: boolean; + + /** If set, overrides the child schema's `_id` option. Only allowed for subdocuments and subdocument arrays. */ + _id?: boolean; + + /** If set, specifies the type of this map's values. Mongoose will cast this map's values to the given type. */ + of?: Function | SchemaDefinitionProperty; + + /** If true, uses Mongoose's default `_id` settings. Only allowed for ObjectIds */ + auto?: boolean; + + /** Attaches a validator that succeeds if the data string matches the given regular expression, and fails otherwise. */ + match?: RegExp | [RegExp, string] | readonly [RegExp, string]; + + /** If truthy, Mongoose will add a custom setter that lowercases this string using JavaScript's built-in `String#toLowerCase()`. */ + lowercase?: boolean; + + /** If truthy, Mongoose will add a custom setter that removes leading and trailing whitespace using JavaScript's built-in `String#trim()`. */ + trim?: boolean; + + /** If truthy, Mongoose will add a custom setter that uppercases this string using JavaScript's built-in `String#toUpperCase()`. */ + uppercase?: boolean; + + /** If set, Mongoose will add a custom validator that ensures the given string's `length` is at least the given number. */ + minlength?: number | [number, string] | readonly [number, string]; + + /** If set, Mongoose will add a custom validator that ensures the given string's `length` is at most the given number. */ + maxlength?: number | [number, string] | readonly [number, string]; + + [other: string]: any; + } + + class SchemaType { + /** SchemaType constructor */ + constructor(path: string, options?: AnyObject, instance?: string); + + /** Get/set the function used to cast arbitrary values to this type. */ + static cast(caster?: Function | boolean): Function; + + static checkRequired(checkRequired?: (v: any) => boolean): (v: any) => boolean; + + /** Sets a default option for this schema type. */ + static set(option: string, value: any): void; + + /** Attaches a getter for all instances of this schema type. */ + static get(getter: (value: any) => any): void; + + /** The class that Mongoose uses internally to instantiate this SchemaType's `options` property. */ + OptionsConstructor: SchemaTypeOptions; + + /** Cast `val` to this schema type. Each class that inherits from schema type should implement this function. */ + cast(val: any, doc: Document, init: boolean, prev?: any, options?: any): any; + + /** Sets a default value for this SchemaType. */ + default(val: any): any; + + /** Adds a getter to this schematype. */ + get(fn: Function): this; + + /** + * Defines this path as immutable. Mongoose prevents you from changing + * immutable paths unless the parent document has [`isNew: true`](/docs/api.html#document_Document-isNew). + */ + immutable(bool: boolean): this; + + /** Declares the index options for this schematype. */ + index(options: any): this; + + /** String representation of what type this is, like 'ObjectID' or 'Number' */ + instance: string; + + /** True if this SchemaType has a required validator. False otherwise. */ + isRequired?: boolean; + + /** The options this SchemaType was instantiated with */ + options: AnyObject; + + /** The path to this SchemaType in a Schema. */ + path: string; + + /** + * Set the model that this path refers to. This is the option that [populate](https://mongoosejs.com/docs/populate.html) + * looks at to determine the foreign collection it should query. + */ + ref(ref: string | boolean | Model): this; + + /** + * Adds a required validator to this SchemaType. The validator gets added + * to the front of this SchemaType's validators array using unshift(). + */ + required(required: boolean, message?: string): this; + + /** The schema this SchemaType instance is part of */ + schema: Schema; + + /** Sets default select() behavior for this path. */ + select(val: boolean): this; + + /** Adds a setter to this schematype. */ + set(fn: Function): this; + + /** Declares a sparse index. */ + sparse(bool: boolean): this; + + /** Declares a full text index. */ + text(bool: boolean): this; + + /** Defines a custom function for transforming this path when converting a document to JSON. */ + transform(fn: (value: any) => any): this; + + /** Declares an unique index. */ + unique(bool: boolean): this; + + /** The validators that Mongoose should run to validate properties at this SchemaType's path. */ + validators: { message?: string; type?: string; validator?: Function }[]; + + /** Adds validator(s) for this document path. */ + validate(obj: RegExp | Function | any, errorMsg?: string, type?: string): this; + } + + namespace Schema { + namespace Types { + class Array extends SchemaType implements AcceptsDiscriminator { + /** This schema type's name, to defend against minifiers that mangle function names. */ + static schemaName: 'Array'; + + static options: { castNonArrays: boolean; }; + + discriminator(name: string | number, schema: Schema, value?: string): U; + discriminator(name: string | number, schema: Schema, value?: string): Model; + + /** The schematype embedded in this array */ + caster?: SchemaType; + + /** + * Adds an enum validator if this is an array of strings or numbers. Equivalent to + * `SchemaString.prototype.enum()` or `SchemaNumber.prototype.enum()` + */ + enum(vals: string[] | number[]): this; + } + + class Boolean extends SchemaType { + /** This schema type's name, to defend against minifiers that mangle function names. */ + static schemaName: 'Boolean'; + + /** Configure which values get casted to `true`. */ + static convertToTrue: Set; + + /** Configure which values get casted to `false`. */ + static convertToFalse: Set; + } + + class Buffer extends SchemaType { + /** This schema type's name, to defend against minifiers that mangle function names. */ + static schemaName: 'Buffer'; + + /** + * Sets the default [subtype](https://studio3t.com/whats-new/best-practices-uuid-mongodb/) + * for this buffer. You can find a [list of allowed subtypes here](http://api.mongodb.com/python/current/api/bson/binary.html). + */ + subtype(subtype: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 128): this; + } + + class Date extends SchemaType { + /** This schema type's name, to defend against minifiers that mangle function names. */ + static schemaName: 'Date'; + + /** Declares a TTL index (rounded to the nearest second) for _Date_ types only. */ + expires(when: number | string): this; + + /** Sets a maximum date validator. */ + max(value: NativeDate, message: string): this; + + /** Sets a minimum date validator. */ + min(value: NativeDate, message: string): this; + } + + class Decimal128 extends SchemaType { + /** This schema type's name, to defend against minifiers that mangle function names. */ + static schemaName: 'Decimal128'; + } + + class DocumentArray extends SchemaType implements AcceptsDiscriminator { + /** This schema type's name, to defend against minifiers that mangle function names. */ + static schemaName: 'DocumentArray'; + + static options: { castNonArrays: boolean; }; + + discriminator(name: string | number, schema: Schema, value?: string): Model; + discriminator(name: string | number, schema: Schema, value?: string): U; + + /** The schema used for documents in this array */ + schema: Schema; + + /** The constructor used for subdocuments in this array */ + caster?: typeof Types.Subdocument; + } + + class Map extends SchemaType { + /** This schema type's name, to defend against minifiers that mangle function names. */ + static schemaName: 'Map'; + } + + class Mixed extends SchemaType { + /** This schema type's name, to defend against minifiers that mangle function names. */ + static schemaName: 'Mixed'; + } + + class Number extends SchemaType { + /** This schema type's name, to defend against minifiers that mangle function names. */ + static schemaName: 'Number'; + + /** Sets a enum validator */ + enum(vals: number[]): this; + + /** Sets a maximum number validator. */ + max(value: number, message: string): this; + + /** Sets a minimum number validator. */ + min(value: number, message: string): this; + } + + class ObjectId extends SchemaType { + /** This schema type's name, to defend against minifiers that mangle function names. */ + static schemaName: 'ObjectId'; + + /** Adds an auto-generated ObjectId default if turnOn is true. */ + auto(turnOn: boolean): this; + } + + class Subdocument extends SchemaType implements AcceptsDiscriminator { + /** This schema type's name, to defend against minifiers that mangle function names. */ + static schemaName: string; + + /** The document's schema */ + schema: Schema; + + discriminator(name: string | number, schema: Schema, value?: string): U; + discriminator(name: string | number, schema: Schema, value?: string): Model; + } + + class String extends SchemaType { + /** This schema type's name, to defend against minifiers that mangle function names. */ + static schemaName: 'String'; + + /** Adds an enum validator */ + enum(vals: string[] | any): this; + + /** Adds a lowercase [setter](http://mongoosejs.com/docs/api.html#schematype_SchemaType-set). */ + lowercase(shouldApply?: boolean): this; + + /** Sets a regexp validator. */ + match(value: RegExp, message: string): this; + + /** Sets a maximum length validator. */ + maxlength(value: number, message: string): this; + + /** Sets a minimum length validator. */ + minlength(value: number, message: string): this; + + /** Adds a trim [setter](http://mongoosejs.com/docs/api.html#schematype_SchemaType-set). */ + trim(shouldTrim?: boolean): this; + + /** Adds an uppercase [setter](http://mongoosejs.com/docs/api.html#schematype_SchemaType-set). */ + uppercase(shouldApply?: boolean): this; + } + } + } +} diff --git a/node_modules/mongoose/types/session.d.ts b/node_modules/mongoose/types/session.d.ts new file mode 100644 index 000000000..19339ea96 --- /dev/null +++ b/node_modules/mongoose/types/session.d.ts @@ -0,0 +1,36 @@ +declare module 'mongoose' { + import mongodb = require('mongodb'); + + type ClientSessionOptions = mongodb.ClientSessionOptions; + type ClientSession = mongodb.ClientSession; + + /** + * _Requires MongoDB >= 3.6.0._ Starts a [MongoDB session](https://docs.mongodb.com/manual/release-notes/3.6/#client-sessions) + * for benefits like causal consistency, [retryable writes](https://docs.mongodb.com/manual/core/retryable-writes/), + * and [transactions](http://thecodebarbarian.com/a-node-js-perspective-on-mongodb-4-transactions.html). + */ + function startSession(options: ClientSessionOptions | undefined | null, callback: Callback): void; + function startSession(callback: Callback): void; + function startSession(options?: ClientSessionOptions): Promise; + + interface SessionOperation { + /** Sets the session. Useful for [transactions](/docs/transactions.html). */ + session(session: mongodb.ClientSession | null): this; + } + + interface SessionStarter { + + /** + * Starts a [MongoDB session](https://docs.mongodb.com/manual/release-notes/3.6/#client-sessions) + * for benefits like causal consistency, [retryable writes](https://docs.mongodb.com/manual/core/retryable-writes/), + * and [transactions](http://thecodebarbarian.com/a-node-js-perspective-on-mongodb-4-transactions.html). + */ + startSession(options: ClientSessionOptions | undefined | null, callback: Callback): void; + startSession(callback: Callback): void; + startSession(options?: ClientSessionOptions): Promise; + } + + interface SessionOption { + session?: ClientSession | null; + } +} diff --git a/node_modules/mongoose/types/types.d.ts b/node_modules/mongoose/types/types.d.ts new file mode 100644 index 000000000..9688a8057 --- /dev/null +++ b/node_modules/mongoose/types/types.d.ts @@ -0,0 +1,102 @@ + +declare module 'mongoose' { + import mongodb = require('mongodb'); + + namespace Types { + class Array extends global.Array { + /** Pops the array atomically at most one time per document `save()`. */ + $pop(): T; + + /** Atomically shifts the array at most one time per document `save()`. */ + $shift(): T; + + /** Adds values to the array if not already present. */ + addToSet(...args: any[]): any[]; + + isMongooseArray: true; + + /** Pushes items to the array non-atomically. */ + nonAtomicPush(...args: any[]): number; + + /** Wraps [`Array#push`](https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/push) with proper change tracking. */ + push(...args: any[]): number; + + /** + * Pulls items from the array atomically. Equality is determined by casting + * the provided value to an embedded document and comparing using + * [the `Document.equals()` function.](./api.html#document_Document-equals) + */ + pull(...args: any[]): this; + + /** + * Alias of [pull](#mongoosearray_MongooseArray-pull) + */ + remove(...args: any[]): this; + + /** Sets the casted `val` at index `i` and marks the array modified. */ + set(index: number, val: T): this; + + /** Atomically shifts the array at most one time per document `save()`. */ + shift(): T; + + /** Returns a native js Array. */ + toObject(options?: ToObjectOptions): any; + toObject(options?: ToObjectOptions): T; + + /** Wraps [`Array#unshift`](https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/unshift) with proper change tracking. */ + unshift(...args: any[]): number; + } + + class Buffer extends global.Buffer { + /** Sets the subtype option and marks the buffer modified. */ + subtype(subtype: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 128 | ToObjectOptions): void; + + /** Converts this buffer to its Binary type representation. */ + toObject(subtype?: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 128): mongodb.Binary; + } + + class Decimal128 extends mongodb.Decimal128 { } + + class DocumentArray extends Types.Array> & T> { + /** DocumentArray constructor */ + constructor(values: any[]); + + isMongooseDocumentArray: true; + + /** Creates a subdocument casted to this schema. */ + create(obj: any): T extends Types.Subdocument ? T : Types.Subdocument> & T; + + /** Searches array items for the first document with a matching _id. */ + id(id: any): (T extends Types.Subdocument ? T : Types.Subdocument> & T) | null; + + push(...args: (AnyKeys & AnyObject)[]): number; + } + + class Map extends global.Map { + /** Converts a Mongoose map into a vanilla JavaScript map. */ + toObject(options?: ToObjectOptions & { flattenMaps?: boolean }): any; + } + + class ObjectId extends mongodb.ObjectId { + _id: this; + } + + class Subdocument extends Document { + $isSingleNested: true; + + /** Returns the top level document of this sub-document. */ + ownerDocument(): Document; + + /** Returns this sub-documents parent document. */ + parent(): Document; + + /** Returns this sub-documents parent document. */ + $parent(): Document; + } + + class ArraySubdocument extends Subdocument { + /** Returns this sub-documents parent array. */ + parentArray(): Types.DocumentArray; + } + } +} diff --git a/node_modules/mongoose/types/utility.d.ts b/node_modules/mongoose/types/utility.d.ts new file mode 100644 index 000000000..997dcef69 --- /dev/null +++ b/node_modules/mongoose/types/utility.d.ts @@ -0,0 +1,15 @@ +declare module 'mongoose' { + + type Unpacked = T extends (infer U)[] ? + U : + T extends ReadonlyArray ? U : T; + + type UnpackedIntersection = T extends null ? null : T extends (infer A)[] + ? (Omit & U)[] + : keyof U extends never + ? T + : Omit & U; + + type MergeType, B extends Record> = Omit & B; + +} diff --git a/node_modules/mongoose/types/validation.d.ts b/node_modules/mongoose/types/validation.d.ts new file mode 100644 index 000000000..3e6d0671a --- /dev/null +++ b/node_modules/mongoose/types/validation.d.ts @@ -0,0 +1,32 @@ +declare module 'mongoose' { + + type SchemaValidator = RegExp | [RegExp, string] | Function | [Function, string] | ValidateOpts | ValidateOpts[]; + + interface ValidatorProps { + path: string; + value: any; + } + + interface ValidatorMessageFn { + (props: ValidatorProps): string; + } + + interface ValidateFn { + (value: T): boolean; + } + + interface LegacyAsyncValidateFn { + (value: T, done: (result: boolean) => void): void; + } + + interface AsyncValidateFn { + (value: any): Promise; + } + + interface ValidateOpts { + msg?: string; + message?: string | ValidatorMessageFn; + type?: string; + validator: ValidateFn | LegacyAsyncValidateFn | AsyncValidateFn; + } +} diff --git a/node_modules/mpath/.travis.yml b/node_modules/mpath/.travis.yml new file mode 100644 index 000000000..9bdf212d6 --- /dev/null +++ b/node_modules/mpath/.travis.yml @@ -0,0 +1,9 @@ +language: node_js +node_js: + - "4" + - "5" + - "6" + - "7" + - "8" + - "9" + - "10" diff --git a/node_modules/mpath/History.md b/node_modules/mpath/History.md new file mode 100644 index 000000000..5235d689d --- /dev/null +++ b/node_modules/mpath/History.md @@ -0,0 +1,88 @@ +0.9.0 / 2022-04-17 +================== + * feat: export `stringToParts()` + +0.8.4 / 2021-09-01 +================== + * fix: throw error if `parts` contains an element that isn't a string or number #13 + +0.8.3 / 2020-12-30 +================== + * fix: use var instead of let/const for Node.js 4.x support + +0.8.2 / 2020-12-30 +================== + * fix(stringToParts): fall back to legacy treatment for square brackets if square brackets contents aren't a number Automattic/mongoose#9640 + * chore: add eslint + +0.8.1 / 2020-12-10 +================== + * fix(stringToParts): handle empty string and trailing dot the same way that `split()` does for backwards compat + +0.8.0 / 2020-11-14 +================== + * feat: support square bracket indexing for `get()`, `set()`, `has()`, and `unset()` + +0.7.0 / 2020-03-24 +================== + * BREAKING CHANGE: remove `component.json` #9 [AlexeyGrigorievBoost](https://github.com/AlexeyGrigorievBoost) + +0.6.0 / 2019-05-01 +================== + * feat: support setting dotted paths within nested arrays + +0.5.2 / 2019-04-25 +================== + * fix: avoid using subclassed array constructor when doing `map()` + +0.5.1 / 2018-08-30 +================== + * fix: prevent writing to constructor and prototype as well as __proto__ + +0.5.0 / 2018-08-30 +================== + * BREAKING CHANGE: disallow setting/unsetting __proto__ properties + * feat: re-add support for Node < 4 for this release + +0.4.1 / 2018-04-08 +================== + * fix: allow opting out of weird `$` set behavior re: Automattic/mongoose#6273 + +0.4.0 / 2018-03-27 +================== + * feat: add support for ES6 maps + * BREAKING CHANGE: drop support for Node < 4 + +0.3.0 / 2017-06-05 +================== + * feat: add has() and unset() functions + +0.2.1 / 2013-03-22 +================== + + * test; added for #5 + * fix typo that breaks set #5 [Contra](https://github.com/Contra) + +0.2.0 / 2013-03-15 +================== + + * added; adapter support for set + * added; adapter support for get + * add basic benchmarks + * add support for using module as a component #2 [Contra](https://github.com/Contra) + +0.1.1 / 2012-12-21 +================== + + * added; map support + +0.1.0 / 2012-12-13 +================== + + * added; set('array.property', val, object) support + * added; get('array.property', object) support + +0.0.1 / 2012-11-03 +================== + + * initial release diff --git a/node_modules/mpath/LICENSE b/node_modules/mpath/LICENSE new file mode 100644 index 000000000..38c529daa --- /dev/null +++ b/node_modules/mpath/LICENSE @@ -0,0 +1,22 @@ +(The MIT License) + +Copyright (c) 2012 [Aaron Heckmann](aaron.heckmann+github@gmail.com) + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/mpath/README.md b/node_modules/mpath/README.md new file mode 100644 index 000000000..9831dd066 --- /dev/null +++ b/node_modules/mpath/README.md @@ -0,0 +1,278 @@ +#mpath + +{G,S}et javascript object values using MongoDB-like path notation. + +###Getting + +```js +var mpath = require('mpath'); + +var obj = { + comments: [ + { title: 'funny' }, + { title: 'exciting!' } + ] +} + +mpath.get('comments.1.title', obj) // 'exciting!' +``` + +`mpath.get` supports array property notation as well. + +```js +var obj = { + comments: [ + { title: 'funny' }, + { title: 'exciting!' } + ] +} + +mpath.get('comments.title', obj) // ['funny', 'exciting!'] +``` + +Array property and indexing syntax, when used together, are very powerful. + +```js +var obj = { + array: [ + { o: { array: [{x: {b: [4,6,8]}}, { y: 10} ] }} + , { o: { array: [{x: {b: [1,2,3]}}, { x: {z: 10 }}, { x: 'Turkey Day' }] }} + , { o: { array: [{x: {b: null }}, { x: { b: [null, 1]}}] }} + , { o: { array: [{x: null }] }} + , { o: { array: [{y: 3 }] }} + , { o: { array: [3, 0, null] }} + , { o: { name: 'ha' }} + ]; +} + +var found = mpath.get('array.o.array.x.b.1', obj); + +console.log(found); // prints.. + + [ [6, undefined] + , [2, undefined, undefined] + , [null, 1] + , [null] + , [undefined] + , [undefined, undefined, undefined] + , undefined + ] + +``` + +#####Field selection rules: + +The following rules are iteratively applied to each `segment` in the passed `path`. For example: + +```js +var path = 'one.two.14'; // path +'one' // segment 0 +'two' // segment 1 +14 // segment 2 +``` + +- 1) when value of the segment parent is not an array, return the value of `parent.segment` +- 2) when value of the segment parent is an array + - a) if the segment is an integer, replace the parent array with the value at `parent[segment]` + - b) if not an integer, keep the array but replace each array `item` with the value returned from calling `get(remainingSegments, item)` or undefined if falsey. + +#####Maps + +`mpath.get` also accepts an optional `map` argument which receives each individual found value. The value returned from the `map` function will be used in the original found values place. + +```js +var obj = { + comments: [ + { title: 'funny' }, + { title: 'exciting!' } + ] +} + +mpath.get('comments.title', obj, function (val) { + return 'funny' == val + ? 'amusing' + : val; +}); +// ['amusing', 'exciting!'] +``` + +###Setting + +```js +var obj = { + comments: [ + { title: 'funny' }, + { title: 'exciting!' } + ] +} + +mpath.set('comments.1.title', 'hilarious', obj) +console.log(obj.comments[1].title) // 'hilarious' +``` + +`mpath.set` supports the same array property notation as `mpath.get`. + +```js +var obj = { + comments: [ + { title: 'funny' }, + { title: 'exciting!' } + ] +} + +mpath.set('comments.title', ['hilarious', 'fruity'], obj); + +console.log(obj); // prints.. + + { comments: [ + { title: 'hilarious' }, + { title: 'fruity' } + ]} +``` + +Array property and indexing syntax can be used together also when setting. + +```js +var obj = { + array: [ + { o: { array: [{x: {b: [4,6,8]}}, { y: 10} ] }} + , { o: { array: [{x: {b: [1,2,3]}}, { x: {z: 10 }}, { x: 'Turkey Day' }] }} + , { o: { array: [{x: {b: null }}, { x: { b: [null, 1]}}] }} + , { o: { array: [{x: null }] }} + , { o: { array: [{y: 3 }] }} + , { o: { array: [3, 0, null] }} + , { o: { name: 'ha' }} + ] +} + +mpath.set('array.1.o', 'this was changed', obj); + +console.log(require('util').inspect(obj, false, 1000)); // prints.. + +{ + array: [ + { o: { array: [{x: {b: [4,6,8]}}, { y: 10} ] }} + , { o: 'this was changed' } + , { o: { array: [{x: {b: null }}, { x: { b: [null, 1]}}] }} + , { o: { array: [{x: null }] }} + , { o: { array: [{y: 3 }] }} + , { o: { array: [3, 0, null] }} + , { o: { name: 'ha' }} + ]; +} + +mpath.set('array.o.array.x', 'this was changed too', obj); + +console.log(require('util').inspect(obj, false, 1000)); // prints.. + +{ + array: [ + { o: { array: [{x: 'this was changed too'}, { y: 10, x: 'this was changed too'} ] }} + , { o: 'this was changed' } + , { o: { array: [{x: 'this was changed too'}, { x: 'this was changed too'}] }} + , { o: { array: [{x: 'this was changed too'}] }} + , { o: { array: [{x: 'this was changed too', y: 3 }] }} + , { o: { array: [3, 0, null] }} + , { o: { name: 'ha' }} + ]; +} +``` + +####Setting arrays + +By default, setting a property within an array to another array results in each element of the new array being set to the item in the destination array at the matching index. An example is helpful. + +```js +var obj = { + comments: [ + { title: 'funny' }, + { title: 'exciting!' } + ] +} + +mpath.set('comments.title', ['hilarious', 'fruity'], obj); + +console.log(obj); // prints.. + + { comments: [ + { title: 'hilarious' }, + { title: 'fruity' } + ]} +``` + +If we do not desire this destructuring-like assignment behavior we may instead specify the `$` operator in the path being set to force the array to be copied directly. + +```js +var obj = { + comments: [ + { title: 'funny' }, + { title: 'exciting!' } + ] +} + +mpath.set('comments.$.title', ['hilarious', 'fruity'], obj); + +console.log(obj); // prints.. + + { comments: [ + { title: ['hilarious', 'fruity'] }, + { title: ['hilarious', 'fruity'] } + ]} +``` + +####Field assignment rules + +The rules utilized mirror those used on `mpath.get`, meaning we can take values returned from `mpath.get`, update them, and reassign them using `mpath.set`. Note that setting nested arrays of arrays can get unweildy quickly. Check out the [tests](https://github.com/aheckmann/mpath/blob/master/test/index.js) for more extreme examples. + +#####Maps + +`mpath.set` also accepts an optional `map` argument which receives each individual value being set. The value returned from the `map` function will be used in the original values place. + +```js +var obj = { + comments: [ + { title: 'funny' }, + { title: 'exciting!' } + ] +} + +mpath.set('comments.title', ['hilarious', 'fruity'], obj, function (val) { + return val.length; +}); + +console.log(obj); // prints.. + + { comments: [ + { title: 9 }, + { title: 6 } + ]} +``` + +### Custom object types + +Sometimes you may want to enact the same functionality on custom object types that store all their real data internally, say for an ODM type object. No fear, `mpath` has you covered. Simply pass the name of the property being used to store the internal data and it will be traversed instead: + +```js +var mpath = require('mpath'); + +var obj = { + comments: [ + { title: 'exciting!', _doc: { title: 'great!' }} + ] +} + +mpath.get('comments.0.title', obj, '_doc') // 'great!' +mpath.set('comments.0.title', 'nov 3rd', obj, '_doc') +mpath.get('comments.0.title', obj, '_doc') // 'nov 3rd' +mpath.get('comments.0.title', obj) // 'exciting' +``` + +When used with a `map`, the `map` argument comes last. + +```js +mpath.get(path, obj, '_doc', map); +mpath.set(path, val, obj, '_doc', map); +``` + +[LICENSE](https://github.com/aheckmann/mpath/blob/master/LICENSE) + diff --git a/node_modules/mpath/SECURITY.md b/node_modules/mpath/SECURITY.md new file mode 100644 index 000000000..1c916a34f --- /dev/null +++ b/node_modules/mpath/SECURITY.md @@ -0,0 +1,5 @@ +# Reporting a Vulnerability + +Please report suspected security vulnerabilities to val [at] karpov [dot] io. +You will receive a response from us within 72 hours. +If the issue is confirmed, we will release a patch as soon as possible depending on complexity. diff --git a/node_modules/mpath/index.js b/node_modules/mpath/index.js new file mode 100644 index 000000000..47c17cdc8 --- /dev/null +++ b/node_modules/mpath/index.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = exports = require('./lib'); diff --git a/node_modules/mpath/lib/index.js b/node_modules/mpath/lib/index.js new file mode 100644 index 000000000..3f21cdc8d --- /dev/null +++ b/node_modules/mpath/lib/index.js @@ -0,0 +1,336 @@ +/* eslint strict:off */ +/* eslint no-var: off */ +/* eslint no-redeclare: off */ + +var stringToParts = require('./stringToParts'); + +// These properties are special and can open client libraries to security +// issues +var ignoreProperties = ['__proto__', 'constructor', 'prototype']; + +/** + * Returns the value of object `o` at the given `path`. + * + * ####Example: + * + * var obj = { + * comments: [ + * { title: 'exciting!', _doc: { title: 'great!' }} + * , { title: 'number dos' } + * ] + * } + * + * mpath.get('comments.0.title', o) // 'exciting!' + * mpath.get('comments.0.title', o, '_doc') // 'great!' + * mpath.get('comments.title', o) // ['exciting!', 'number dos'] + * + * // summary + * mpath.get(path, o) + * mpath.get(path, o, special) + * mpath.get(path, o, map) + * mpath.get(path, o, special, map) + * + * @param {String} path + * @param {Object} o + * @param {String} [special] When this property name is present on any object in the path, walking will continue on the value of this property. + * @param {Function} [map] Optional function which receives each individual found value. The value returned from `map` is used in the original values place. + */ + +exports.get = function(path, o, special, map) { + var lookup; + + if ('function' == typeof special) { + if (special.length < 2) { + map = special; + special = undefined; + } else { + lookup = special; + special = undefined; + } + } + + map || (map = K); + + var parts = 'string' == typeof path + ? stringToParts(path) + : path; + + if (!Array.isArray(parts)) { + throw new TypeError('Invalid `path`. Must be either string or array'); + } + + var obj = o, + part; + + for (var i = 0; i < parts.length; ++i) { + part = parts[i]; + if (typeof parts[i] !== 'string' && typeof parts[i] !== 'number') { + throw new TypeError('Each segment of path to `get()` must be a string or number, got ' + typeof parts[i]); + } + + if (Array.isArray(obj) && !/^\d+$/.test(part)) { + // reading a property from the array items + var paths = parts.slice(i); + + // Need to `concat()` to avoid `map()` calling a constructor of an array + // subclass + return [].concat(obj).map(function(item) { + return item + ? exports.get(paths, item, special || lookup, map) + : map(undefined); + }); + } + + if (lookup) { + obj = lookup(obj, part); + } else { + var _from = special && obj[special] ? obj[special] : obj; + obj = _from instanceof Map ? + _from.get(part) : + _from[part]; + } + + if (!obj) return map(obj); + } + + return map(obj); +}; + +/** + * Returns true if `in` returns true for every piece of the path + * + * @param {String} path + * @param {Object} o + */ + +exports.has = function(path, o) { + var parts = typeof path === 'string' ? + stringToParts(path) : + path; + + if (!Array.isArray(parts)) { + throw new TypeError('Invalid `path`. Must be either string or array'); + } + + var len = parts.length; + var cur = o; + for (var i = 0; i < len; ++i) { + if (typeof parts[i] !== 'string' && typeof parts[i] !== 'number') { + throw new TypeError('Each segment of path to `has()` must be a string or number, got ' + typeof parts[i]); + } + if (cur == null || typeof cur !== 'object' || !(parts[i] in cur)) { + return false; + } + cur = cur[parts[i]]; + } + + return true; +}; + +/** + * Deletes the last piece of `path` + * + * @param {String} path + * @param {Object} o + */ + +exports.unset = function(path, o) { + var parts = typeof path === 'string' ? + stringToParts(path) : + path; + + if (!Array.isArray(parts)) { + throw new TypeError('Invalid `path`. Must be either string or array'); + } + + var len = parts.length; + var cur = o; + for (var i = 0; i < len; ++i) { + if (cur == null || typeof cur !== 'object' || !(parts[i] in cur)) { + return false; + } + if (typeof parts[i] !== 'string' && typeof parts[i] !== 'number') { + throw new TypeError('Each segment of path to `unset()` must be a string or number, got ' + typeof parts[i]); + } + // Disallow any updates to __proto__ or special properties. + if (ignoreProperties.indexOf(parts[i]) !== -1) { + return false; + } + if (i === len - 1) { + delete cur[parts[i]]; + return true; + } + cur = cur instanceof Map ? cur.get(parts[i]) : cur[parts[i]]; + } + + return true; +}; + +/** + * Sets the `val` at the given `path` of object `o`. + * + * @param {String} path + * @param {Anything} val + * @param {Object} o + * @param {String} [special] When this property name is present on any object in the path, walking will continue on the value of this property. + * @param {Function} [map] Optional function which is passed each individual value before setting it. The value returned from `map` is used in the original values place. + */ + +exports.set = function(path, val, o, special, map, _copying) { + var lookup; + + if ('function' == typeof special) { + if (special.length < 2) { + map = special; + special = undefined; + } else { + lookup = special; + special = undefined; + } + } + + map || (map = K); + + var parts = 'string' == typeof path + ? stringToParts(path) + : path; + + if (!Array.isArray(parts)) { + throw new TypeError('Invalid `path`. Must be either string or array'); + } + + if (null == o) return; + + for (var i = 0; i < parts.length; ++i) { + if (typeof parts[i] !== 'string' && typeof parts[i] !== 'number') { + throw new TypeError('Each segment of path to `set()` must be a string or number, got ' + typeof parts[i]); + } + // Silently ignore any updates to `__proto__`, these are potentially + // dangerous if using mpath with unsanitized data. + if (ignoreProperties.indexOf(parts[i]) !== -1) { + return; + } + } + + // the existance of $ in a path tells us if the user desires + // the copying of an array instead of setting each value of + // the array to the one by one to matching positions of the + // current array. Unless the user explicitly opted out by passing + // false, see Automattic/mongoose#6273 + var copy = _copying || (/\$/.test(path) && _copying !== false), + obj = o, + part; + + for (var i = 0, len = parts.length - 1; i < len; ++i) { + part = parts[i]; + + if ('$' == part) { + if (i == len - 1) { + break; + } else { + continue; + } + } + + if (Array.isArray(obj) && !/^\d+$/.test(part)) { + var paths = parts.slice(i); + if (!copy && Array.isArray(val)) { + for (var j = 0; j < obj.length && j < val.length; ++j) { + // assignment of single values of array + exports.set(paths, val[j], obj[j], special || lookup, map, copy); + } + } else { + for (var j = 0; j < obj.length; ++j) { + // assignment of entire value + exports.set(paths, val, obj[j], special || lookup, map, copy); + } + } + return; + } + + if (lookup) { + obj = lookup(obj, part); + } else { + var _to = special && obj[special] ? obj[special] : obj; + obj = _to instanceof Map ? + _to.get(part) : + _to[part]; + } + + if (!obj) return; + } + + // process the last property of the path + + part = parts[len]; + + // use the special property if exists + if (special && obj[special]) { + obj = obj[special]; + } + + // set the value on the last branch + if (Array.isArray(obj) && !/^\d+$/.test(part)) { + if (!copy && Array.isArray(val)) { + _setArray(obj, val, part, lookup, special, map); + } else { + for (var j = 0; j < obj.length; ++j) { + var item = obj[j]; + if (item) { + if (lookup) { + lookup(item, part, map(val)); + } else { + if (item[special]) item = item[special]; + item[part] = map(val); + } + } + } + } + } else { + if (lookup) { + lookup(obj, part, map(val)); + } else if (obj instanceof Map) { + obj.set(part, map(val)); + } else { + obj[part] = map(val); + } + } +}; + +/*! + * Split a string path into components delimited by '.' or + * '[\d+]' + * + * #### Example: + * stringToParts('foo[0].bar.1'); // ['foo', '0', 'bar', '1'] + */ + +exports.stringToParts = stringToParts; + +/*! + * Recursively set nested arrays + */ + +function _setArray(obj, val, part, lookup, special, map) { + for (var item, j = 0; j < obj.length && j < val.length; ++j) { + item = obj[j]; + if (Array.isArray(item) && Array.isArray(val[j])) { + _setArray(item, val[j], part, lookup, special, map); + } else if (item) { + if (lookup) { + lookup(item, part, map(val[j])); + } else { + if (item[special]) item = item[special]; + item[part] = map(val[j]); + } + } + } +} + +/*! + * Returns the value passed to it. + */ + +function K(v) { + return v; +} diff --git a/node_modules/mpath/lib/stringToParts.js b/node_modules/mpath/lib/stringToParts.js new file mode 100644 index 000000000..f70f33334 --- /dev/null +++ b/node_modules/mpath/lib/stringToParts.js @@ -0,0 +1,48 @@ +'use strict'; + +module.exports = function stringToParts(str) { + const result = []; + + let curPropertyName = ''; + let state = 'DEFAULT'; + for (let i = 0; i < str.length; ++i) { + // Fall back to treating as property name rather than bracket notation if + // square brackets contains something other than a number. + if (state === 'IN_SQUARE_BRACKETS' && !/\d/.test(str[i]) && str[i] !== ']') { + state = 'DEFAULT'; + curPropertyName = result[result.length - 1] + '[' + curPropertyName; + result.splice(result.length - 1, 1); + } + + if (str[i] === '[') { + if (state !== 'IMMEDIATELY_AFTER_SQUARE_BRACKETS') { + result.push(curPropertyName); + curPropertyName = ''; + } + state = 'IN_SQUARE_BRACKETS'; + } else if (str[i] === ']') { + if (state === 'IN_SQUARE_BRACKETS') { + state = 'IMMEDIATELY_AFTER_SQUARE_BRACKETS'; + result.push(curPropertyName); + curPropertyName = ''; + } else { + state = 'DEFAULT'; + curPropertyName += str[i]; + } + } else if (str[i] === '.') { + if (state !== 'IMMEDIATELY_AFTER_SQUARE_BRACKETS') { + result.push(curPropertyName); + curPropertyName = ''; + } + state = 'DEFAULT'; + } else { + curPropertyName += str[i]; + } + } + + if (state !== 'IMMEDIATELY_AFTER_SQUARE_BRACKETS') { + result.push(curPropertyName); + } + + return result; +}; \ No newline at end of file diff --git a/node_modules/mpath/package.json b/node_modules/mpath/package.json new file mode 100644 index 000000000..6d1242d4e --- /dev/null +++ b/node_modules/mpath/package.json @@ -0,0 +1,144 @@ +{ + "name": "mpath", + "version": "0.9.0", + "description": "{G,S}et object values using MongoDB-like path notation", + "main": "index.js", + "scripts": { + "lint": "eslint .", + "test": "mocha test/*" + }, + "engines": { + "node": ">=4.0.0" + }, + "repository": "git://github.com/aheckmann/mpath.git", + "keywords": [ + "mongodb", + "path", + "get", + "set" + ], + "author": "Aaron Heckmann ", + "license": "MIT", + "devDependencies": { + "mocha": "5.x", + "benchmark": "~1.0.0", + "eslint": "7.16.0" + }, + "eslintConfig": { + "extends": [ + "eslint:recommended" + ], + "parserOptions": { + "ecmaVersion": 2015 + }, + "env": { + "node": true, + "es6": true + }, + "rules": { + "comma-style": "error", + "indent": [ + "error", + 2, + { + "SwitchCase": 1, + "VariableDeclarator": 2 + } + ], + "keyword-spacing": "error", + "no-whitespace-before-property": "error", + "no-buffer-constructor": "warn", + "no-console": "off", + "no-multi-spaces": "error", + "no-constant-condition": "off", + "func-call-spacing": "error", + "no-trailing-spaces": "error", + "no-undef": "error", + "no-unneeded-ternary": "error", + "no-const-assign": "error", + "no-useless-rename": "error", + "no-dupe-keys": "error", + "space-in-parens": [ + "error", + "never" + ], + "spaced-comment": [ + "error", + "always", + { + "block": { + "markers": [ + "!" + ], + "balanced": true + } + } + ], + "key-spacing": [ + "error", + { + "beforeColon": false, + "afterColon": true + } + ], + "comma-spacing": [ + "error", + { + "before": false, + "after": true + } + ], + "array-bracket-spacing": 1, + "arrow-spacing": [ + "error", + { + "before": true, + "after": true + } + ], + "object-curly-spacing": [ + "error", + "always" + ], + "comma-dangle": [ + "error", + "never" + ], + "no-unreachable": "error", + "quotes": [ + "error", + "single" + ], + "quote-props": [ + "error", + "as-needed" + ], + "semi": "error", + "no-extra-semi": "error", + "semi-spacing": "error", + "no-spaced-func": "error", + "no-throw-literal": "error", + "space-before-blocks": "error", + "space-before-function-paren": [ + "error", + "never" + ], + "space-infix-ops": "error", + "space-unary-ops": "error", + "no-var": "warn", + "prefer-const": "warn", + "strict": [ + "error", + "global" + ], + "no-restricted-globals": [ + "error", + { + "name": "context", + "message": "Don't use Mocha's global context" + } + ], + "no-prototype-builtins": "off" + } + } +} diff --git a/node_modules/mpath/test/.eslintrc.yml b/node_modules/mpath/test/.eslintrc.yml new file mode 100644 index 000000000..c0c68038f --- /dev/null +++ b/node_modules/mpath/test/.eslintrc.yml @@ -0,0 +1,4 @@ +env: + mocha: true +rules: + no-unused-vars: off \ No newline at end of file diff --git a/node_modules/mpath/test/index.js b/node_modules/mpath/test/index.js new file mode 100644 index 000000000..ce07b1989 --- /dev/null +++ b/node_modules/mpath/test/index.js @@ -0,0 +1,1879 @@ +'use strict'; + +/** + * Test dependencies. + */ + +const mpath = require('../'); +const assert = require('assert'); + +/** + * logging helper + */ + +function log(o) { + console.log(); + console.log(require('util').inspect(o, false, 1000)); +} + +/** + * special path for override tests + */ + +const special = '_doc'; + +/** + * Tests + */ + +describe('mpath', function() { + + /** + * test doc creator + */ + + function doc() { + const o = { first: { second: { third: [3, { name: 'aaron' }, 9] } } }; + o.comments = [ + { name: 'one' }, + { name: 'two', _doc: { name: '2' } }, + { name: 'three', + comments: [{}, { comments: [{ val: 'twoo' }] }], + _doc: { name: '3', comments: [{}, { _doc: { comments: [{ val: 2 }] } }] } } + ]; + o.name = 'jiro'; + o.array = [ + { o: { array: [{ x: { b: [4, 6, 8] } }, { y: 10 }] } }, + { o: { array: [{ x: { b: [1, 2, 3] } }, { x: { z: 10 } }, { x: { b: 'hi' } }] } }, + { o: { array: [{ x: { b: null } }, { x: { b: [null, 1] } }] } }, + { o: { array: [{ x: null }] } }, + { o: { array: [{ y: 3 }] } }, + { o: { array: [3, 0, null] } }, + { o: { name: 'ha' } } + ]; + o.arr = [ + { arr: [{ a: { b: 47 } }, { a: { c: 48 } }, { d: 'yep' }] }, + { yep: true } + ]; + return o; + } + + describe('get', function() { + const o = doc(); + + it('`path` must be a string or array', function(done) { + assert.throws(function() { + mpath.get({}, o); + }, /Must be either string or array/); + assert.throws(function() { + mpath.get(4, o); + }, /Must be either string or array/); + assert.throws(function() { + mpath.get(function() {}, o); + }, /Must be either string or array/); + assert.throws(function() { + mpath.get(/asdf/, o); + }, /Must be either string or array/); + assert.throws(function() { + mpath.get(Math, o); + }, /Must be either string or array/); + assert.throws(function() { + mpath.get(Buffer, o); + }, /Must be either string or array/); + assert.doesNotThrow(function() { + mpath.get('string', o); + }); + assert.doesNotThrow(function() { + mpath.get([], o); + }); + done(); + }); + + describe('without `special`', function() { + it('works', function(done) { + assert.equal('jiro', mpath.get('name', o)); + + assert.deepEqual( + { second: { third: [3, { name: 'aaron' }, 9] } } + , mpath.get('first', o) + ); + + assert.deepEqual( + { third: [3, { name: 'aaron' }, 9] } + , mpath.get('first.second', o) + ); + + assert.deepEqual( + [3, { name: 'aaron' }, 9] + , mpath.get('first.second.third', o) + ); + + assert.deepEqual( + 3 + , mpath.get('first.second.third.0', o) + ); + + assert.deepEqual( + 9 + , mpath.get('first.second.third.2', o) + ); + + assert.deepEqual( + { name: 'aaron' } + , mpath.get('first.second.third.1', o) + ); + + assert.deepEqual( + 'aaron' + , mpath.get('first.second.third.1.name', o) + ); + + assert.deepEqual([ + { name: 'one' }, + { name: 'two', _doc: { name: '2' } }, + { name: 'three', + comments: [{}, { comments: [{ val: 'twoo' }] }], + _doc: { name: '3', comments: [{}, { _doc: { comments: [{ val: 2 }] } }] } }], + mpath.get('comments', o)); + + assert.deepEqual({ name: 'one' }, mpath.get('comments.0', o)); + assert.deepEqual('one', mpath.get('comments.0.name', o)); + assert.deepEqual('two', mpath.get('comments.1.name', o)); + assert.deepEqual('three', mpath.get('comments.2.name', o)); + + assert.deepEqual([{}, { comments: [{ val: 'twoo' }] }] + , mpath.get('comments.2.comments', o)); + + assert.deepEqual({ comments: [{ val: 'twoo' }] } + , mpath.get('comments.2.comments.1', o)); + + assert.deepEqual('twoo', mpath.get('comments.2.comments.1.comments.0.val', o)); + + done(); + }); + + it('handles array.property dot-notation', function(done) { + assert.deepEqual( + ['one', 'two', 'three'] + , mpath.get('comments.name', o) + ); + done(); + }); + + it('handles array.array notation', function(done) { + assert.deepEqual( + [undefined, undefined, [{}, { comments: [{ val: 'twoo' }] }]] + , mpath.get('comments.comments', o) + ); + done(); + }); + + it('handles prop.prop.prop.arrayProperty notation', function(done) { + assert.deepEqual( + [undefined, 'aaron', undefined] + , mpath.get('first.second.third.name', o) + ); + assert.deepEqual( + [1, 'aaron', 1] + , mpath.get('first.second.third.name', o, function(v) { + return undefined === v ? 1 : v; + }) + ); + done(); + }); + + it('handles array.prop.array', function(done) { + assert.deepEqual( + [[{ x: { b: [4, 6, 8] } }, { y: 10 }], + [{ x: { b: [1, 2, 3] } }, { x: { z: 10 } }, { x: { b: 'hi' } }], + [{ x: { b: null } }, { x: { b: [null, 1] } }], + [{ x: null }], + [{ y: 3 }], + [3, 0, null], + undefined + ] + , mpath.get('array.o.array', o) + ); + done(); + }); + + it('handles array.prop.array.index', function(done) { + assert.deepEqual( + [{ x: { b: [4, 6, 8] } }, + { x: { b: [1, 2, 3] } }, + { x: { b: null } }, + { x: null }, + { y: 3 }, + 3, + undefined + ] + , mpath.get('array.o.array.0', o) + ); + done(); + }); + + it('handles array.prop.array.index.prop', function(done) { + assert.deepEqual( + [{ b: [4, 6, 8] }, + { b: [1, 2, 3] }, + { b: null }, + null, + undefined, + undefined, + undefined + ] + , mpath.get('array.o.array.0.x', o) + ); + done(); + }); + + it('handles array.prop.array.prop', function(done) { + assert.deepEqual( + [[undefined, 10], + [undefined, undefined, undefined], + [undefined, undefined], + [undefined], + [3], + [undefined, undefined, undefined], + undefined + ] + , mpath.get('array.o.array.y', o) + ); + assert.deepEqual( + [[{ b: [4, 6, 8] }, undefined], + [{ b: [1, 2, 3] }, { z: 10 }, { b: 'hi' }], + [{ b: null }, { b: [null, 1] }], + [null], + [undefined], + [undefined, undefined, undefined], + undefined + ] + , mpath.get('array.o.array.x', o) + ); + done(); + }); + + it('handles array.prop.array.prop.prop', function(done) { + assert.deepEqual( + [[[4, 6, 8], undefined], + [[1, 2, 3], undefined, 'hi'], + [null, [null, 1]], + [null], + [undefined], + [undefined, undefined, undefined], + undefined + ] + , mpath.get('array.o.array.x.b', o) + ); + done(); + }); + + it('handles array.prop.array.prop.prop.index', function(done) { + assert.deepEqual( + [[6, undefined], + [2, undefined, 'i'], // undocumented feature (string indexing) + [null, 1], + [null], + [undefined], + [undefined, undefined, undefined], + undefined + ] + , mpath.get('array.o.array.x.b.1', o) + ); + assert.deepEqual( + [[6, 0], + [2, 0, 'i'], // undocumented feature (string indexing) + [null, 1], + [null], + [0], + [0, 0, 0], + 0 + ] + , mpath.get('array.o.array.x.b.1', o, function(v) { + return undefined === v ? 0 : v; + }) + ); + done(); + }); + + it('handles array.index.prop.prop', function(done) { + assert.deepEqual( + [{ x: { b: [1, 2, 3] } }, { x: { z: 10 } }, { x: { b: 'hi' } }] + , mpath.get('array.1.o.array', o) + ); + assert.deepEqual( + ['hi', 'hi', 'hi'] + , mpath.get('array.1.o.array', o, function(v) { + if (Array.isArray(v)) { + return v.map(function(val) { + return 'hi'; + }); + } + return v; + }) + ); + done(); + }); + + it('handles array.array.index', function(done) { + assert.deepEqual( + [{ a: { c: 48 } }, undefined] + , mpath.get('arr.arr.1', o) + ); + assert.deepEqual( + ['woot', undefined] + , mpath.get('arr.arr.1', o, function(v) { + if (v && v.a && v.a.c) return 'woot'; + return v; + }) + ); + done(); + }); + + it('handles array.array.index.prop', function(done) { + assert.deepEqual( + [{ c: 48 }, 'woot'] + , mpath.get('arr.arr.1.a', o, function(v) { + if (undefined === v) return 'woot'; + return v; + }) + ); + assert.deepEqual( + [{ c: 48 }, undefined] + , mpath.get('arr.arr.1.a', o) + ); + mpath.set('arr.arr.1.a', [{ c: 49 }, undefined], o); + assert.deepEqual( + [{ c: 49 }, undefined] + , mpath.get('arr.arr.1.a', o) + ); + mpath.set('arr.arr.1.a', [{ c: 48 }, undefined], o); + done(); + }); + + it('handles array.array.index.prop.prop', function(done) { + assert.deepEqual( + [48, undefined] + , mpath.get('arr.arr.1.a.c', o) + ); + assert.deepEqual( + [48, 'woot'] + , mpath.get('arr.arr.1.a.c', o, function(v) { + if (undefined === v) return 'woot'; + return v; + }) + ); + done(); + }); + + }); + + describe('with `special`', function() { + describe('that is a string', function() { + it('works', function(done) { + assert.equal('jiro', mpath.get('name', o, special)); + + assert.deepEqual( + { second: { third: [3, { name: 'aaron' }, 9] } } + , mpath.get('first', o, special) + ); + + assert.deepEqual( + { third: [3, { name: 'aaron' }, 9] } + , mpath.get('first.second', o, special) + ); + + assert.deepEqual( + [3, { name: 'aaron' }, 9] + , mpath.get('first.second.third', o, special) + ); + + assert.deepEqual( + 3 + , mpath.get('first.second.third.0', o, special) + ); + + assert.deepEqual( + 4 + , mpath.get('first.second.third.0', o, special, function(v) { + return 3 === v ? 4 : v; + }) + ); + + assert.deepEqual( + 9 + , mpath.get('first.second.third.2', o, special) + ); + + assert.deepEqual( + { name: 'aaron' } + , mpath.get('first.second.third.1', o, special) + ); + + assert.deepEqual( + 'aaron' + , mpath.get('first.second.third.1.name', o, special) + ); + + assert.deepEqual([ + { name: 'one' }, + { name: 'two', _doc: { name: '2' } }, + { name: 'three', + comments: [{}, { comments: [{ val: 'twoo' }] }], + _doc: { name: '3', comments: [{}, { _doc: { comments: [{ val: 2 }] } }] } }], + mpath.get('comments', o, special)); + + assert.deepEqual({ name: 'one' }, mpath.get('comments.0', o, special)); + assert.deepEqual('one', mpath.get('comments.0.name', o, special)); + assert.deepEqual('2', mpath.get('comments.1.name', o, special)); + assert.deepEqual('3', mpath.get('comments.2.name', o, special)); + assert.deepEqual('nice', mpath.get('comments.2.name', o, special, function(v) { + return '3' === v ? 'nice' : v; + })); + + assert.deepEqual([{}, { _doc: { comments: [{ val: 2 }] } }] + , mpath.get('comments.2.comments', o, special)); + + assert.deepEqual({ _doc: { comments: [{ val: 2 }] } } + , mpath.get('comments.2.comments.1', o, special)); + + assert.deepEqual(2, mpath.get('comments.2.comments.1.comments.0.val', o, special)); + done(); + }); + + it('handles array.property dot-notation', function(done) { + assert.deepEqual( + ['one', '2', '3'] + , mpath.get('comments.name', o, special) + ); + assert.deepEqual( + ['one', 2, '3'] + , mpath.get('comments.name', o, special, function(v) { + return '2' === v ? 2 : v; + }) + ); + done(); + }); + + it('handles array.array notation', function(done) { + assert.deepEqual( + [undefined, undefined, [{}, { _doc: { comments: [{ val: 2 }] } }]] + , mpath.get('comments.comments', o, special) + ); + done(); + }); + + it('handles array.array.index.array', function(done) { + assert.deepEqual( + [undefined, undefined, [{ val: 2 }]] + , mpath.get('comments.comments.1.comments', o, special) + ); + done(); + }); + + it('handles array.array.index.array.prop', function(done) { + assert.deepEqual( + [undefined, undefined, [2]] + , mpath.get('comments.comments.1.comments.val', o, special) + ); + assert.deepEqual( + ['nil', 'nil', [2]] + , mpath.get('comments.comments.1.comments.val', o, special, function(v) { + return undefined === v ? 'nil' : v; + }) + ); + done(); + }); + }); + + describe('that is a function', function() { + const special = function(obj, key) { + return obj[key]; + }; + + it('works', function(done) { + assert.equal('jiro', mpath.get('name', o, special)); + + assert.deepEqual( + { second: { third: [3, { name: 'aaron' }, 9] } } + , mpath.get('first', o, special) + ); + + assert.deepEqual( + { third: [3, { name: 'aaron' }, 9] } + , mpath.get('first.second', o, special) + ); + + assert.deepEqual( + [3, { name: 'aaron' }, 9] + , mpath.get('first.second.third', o, special) + ); + + assert.deepEqual( + 3 + , mpath.get('first.second.third.0', o, special) + ); + + assert.deepEqual( + 4 + , mpath.get('first.second.third.0', o, special, function(v) { + return 3 === v ? 4 : v; + }) + ); + + assert.deepEqual( + 9 + , mpath.get('first.second.third.2', o, special) + ); + + assert.deepEqual( + { name: 'aaron' } + , mpath.get('first.second.third.1', o, special) + ); + + assert.deepEqual( + 'aaron' + , mpath.get('first.second.third.1.name', o, special) + ); + + assert.deepEqual([ + { name: 'one' }, + { name: 'two', _doc: { name: '2' } }, + { name: 'three', + comments: [{}, { comments: [{ val: 'twoo' }] }], + _doc: { name: '3', comments: [{}, { _doc: { comments: [{ val: 2 }] } }] } }], + mpath.get('comments', o, special)); + + assert.deepEqual({ name: 'one' }, mpath.get('comments.0', o, special)); + assert.deepEqual('one', mpath.get('comments.0.name', o, special)); + assert.deepEqual('two', mpath.get('comments.1.name', o, special)); + assert.deepEqual('three', mpath.get('comments.2.name', o, special)); + assert.deepEqual('nice', mpath.get('comments.2.name', o, special, function(v) { + return 'three' === v ? 'nice' : v; + })); + + assert.deepEqual([{}, { comments: [{ val: 'twoo' }] }] + , mpath.get('comments.2.comments', o, special)); + + assert.deepEqual({ comments: [{ val: 'twoo' }] } + , mpath.get('comments.2.comments.1', o, special)); + + assert.deepEqual('twoo', mpath.get('comments.2.comments.1.comments.0.val', o, special)); + + let overide = false; + assert.deepEqual('twoo', mpath.get('comments.8.comments.1.comments.0.val', o, function(obj, path) { + if (Array.isArray(obj) && 8 == path) { + overide = true; + return obj[2]; + } + return obj[path]; + })); + assert.ok(overide); + + done(); + }); + + it('in combination with map', function(done) { + const special = function(obj, key) { + if (Array.isArray(obj)) return obj[key]; + return obj.mpath; + }; + const map = function(val) { + return 'convert' == val + ? 'mpath' + : val; + }; + const o = { mpath: [{ mpath: 'converse' }, { mpath: 'convert' }] }; + + assert.equal('mpath', mpath.get('something.1.kewl', o, special, map)); + done(); + }); + }); + }); + }); + + describe('set', function() { + it('prevents writing to __proto__', function() { + const obj = {}; + mpath.set('__proto__.x', 'foobar', obj); + assert.ok(!({}.x)); + + mpath.set('constructor.prototype.x', 'foobar', obj); + assert.ok(!({}.x)); + }); + + describe('without `special`', function() { + const o = doc(); + + it('works', function(done) { + mpath.set('name', 'a new val', o, function(v) { + return 'a new val' === v ? 'changed' : v; + }); + assert.deepEqual('changed', o.name); + + mpath.set('name', 'changed', o); + assert.deepEqual('changed', o.name); + + mpath.set('first.second.third', [1, { name: 'x' }, 9], o); + assert.deepEqual([1, { name: 'x' }, 9], o.first.second.third); + + mpath.set('first.second.third.1.name', 'y', o); + assert.deepEqual([1, { name: 'y' }, 9], o.first.second.third); + + mpath.set('comments.1.name', 'ttwwoo', o); + assert.deepEqual({ name: 'ttwwoo', _doc: { name: '2' } }, o.comments[1]); + + mpath.set('comments.2.comments.1.comments.0.expand', 'added', o); + assert.deepEqual( + { val: 'twoo', expand: 'added' } + , o.comments[2].comments[1].comments[0]); + + mpath.set('comments.2.comments.1.comments.2', 'added', o); + assert.equal(3, o.comments[2].comments[1].comments.length); + assert.deepEqual( + { val: 'twoo', expand: 'added' } + , o.comments[2].comments[1].comments[0]); + assert.deepEqual( + undefined + , o.comments[2].comments[1].comments[1]); + assert.deepEqual( + 'added' + , o.comments[2].comments[1].comments[2]); + + done(); + }); + + describe('array.path', function() { + describe('with single non-array value', function() { + it('works', function(done) { + mpath.set('arr.yep', false, o, function(v) { + return false === v ? true : v; + }); + assert.deepEqual([ + { yep: true, arr: [{ a: { b: 47 } }, { a: { c: 48 } }, { d: 'yep' }] }, + { yep: true } + ], o.arr); + + mpath.set('arr.yep', false, o); + + assert.deepEqual([ + { yep: false, arr: [{ a: { b: 47 } }, { a: { c: 48 } }, { d: 'yep' }] }, + { yep: false } + ], o.arr); + + done(); + }); + }); + describe('with array of values', function() { + it('that are equal in length', function(done) { + mpath.set('arr.yep', ['one', 2], o, function(v) { + return 'one' === v ? 1 : v; + }); + assert.deepEqual([ + { yep: 1, arr: [{ a: { b: 47 } }, { a: { c: 48 } }, { d: 'yep' }] }, + { yep: 2 } + ], o.arr); + mpath.set('arr.yep', ['one', 2], o); + + assert.deepEqual([ + { yep: 'one', arr: [{ a: { b: 47 } }, { a: { c: 48 } }, { d: 'yep' }] }, + { yep: 2 } + ], o.arr); + + done(); + }); + + it('that is less than length', function(done) { + mpath.set('arr.yep', [47], o, function(v) { + return 47 === v ? 4 : v; + }); + assert.deepEqual([ + { yep: 4, arr: [{ a: { b: 47 } }, { a: { c: 48 } }, { d: 'yep' }] }, + { yep: 2 } + ], o.arr); + + mpath.set('arr.yep', [47], o); + assert.deepEqual([ + { yep: 47, arr: [{ a: { b: 47 } }, { a: { c: 48 } }, { d: 'yep' }] }, + { yep: 2 } + ], o.arr); + + done(); + }); + + it('that is greater than length', function(done) { + mpath.set('arr.yep', [5, 6, 7], o, function(v) { + return 5 === v ? 'five' : v; + }); + assert.deepEqual([ + { yep: 'five', arr: [{ a: { b: 47 } }, { a: { c: 48 } }, { d: 'yep' }] }, + { yep: 6 } + ], o.arr); + + mpath.set('arr.yep', [5, 6, 7], o); + assert.deepEqual([ + { yep: 5, arr: [{ a: { b: 47 } }, { a: { c: 48 } }, { d: 'yep' }] }, + { yep: 6 } + ], o.arr); + + done(); + }); + }); + }); + + describe('array.$.path', function() { + describe('with single non-array value', function() { + it('copies the value to each item in array', function(done) { + mpath.set('arr.$.yep', { xtra: 'double good' }, o, function(v) { + return v && v.xtra ? 'hi' : v; + }); + assert.deepEqual([ + { yep: 'hi', arr: [{ a: { b: 47 } }, { a: { c: 48 } }, { d: 'yep' }] }, + { yep: 'hi' } + ], o.arr); + + mpath.set('arr.$.yep', { xtra: 'double good' }, o); + assert.deepEqual([ + { yep: { xtra: 'double good' }, arr: [{ a: { b: 47 } }, { a: { c: 48 } }, { d: 'yep' }] }, + { yep: { xtra: 'double good' } } + ], o.arr); + + done(); + }); + }); + describe('with array of values', function() { + it('copies the value to each item in array', function(done) { + mpath.set('arr.$.yep', [15], o, function(v) { + return v.length === 1 ? [] : v; + }); + assert.deepEqual([ + { yep: [], arr: [{ a: { b: 47 } }, { a: { c: 48 } }, { d: 'yep' }] }, + { yep: [] } + ], o.arr); + + mpath.set('arr.$.yep', [15], o); + assert.deepEqual([ + { yep: [15], arr: [{ a: { b: 47 } }, { a: { c: 48 } }, { d: 'yep' }] }, + { yep: [15] } + ], o.arr); + + done(); + }); + }); + }); + + describe('array.index.path', function() { + it('works', function(done) { + mpath.set('arr.1.yep', 0, o, function(v) { + return 0 === v ? 'zero' : v; + }); + assert.deepEqual([ + { yep: [15], arr: [{ a: { b: 47 } }, { a: { c: 48 } }, { d: 'yep' }] }, + { yep: 'zero' } + ], o.arr); + + mpath.set('arr.1.yep', 0, o); + assert.deepEqual([ + { yep: [15], arr: [{ a: { b: 47 } }, { a: { c: 48 } }, { d: 'yep' }] }, + { yep: 0 } + ], o.arr); + + done(); + }); + }); + + describe('array.index.array.path', function() { + it('with single value', function(done) { + mpath.set('arr.0.arr.e', 35, o, function(v) { + return 35 === v ? 3 : v; + }); + assert.deepEqual([ + { yep: [15], arr: [{ a: { b: 47 }, e: 3 }, { a: { c: 48 }, e: 3 }, { d: 'yep', e: 3 }] }, + { yep: 0 } + ], o.arr); + + mpath.set('arr.0.arr.e', 35, o); + assert.deepEqual([ + { yep: [15], arr: [{ a: { b: 47 }, e: 35 }, { a: { c: 48 }, e: 35 }, { d: 'yep', e: 35 }] }, + { yep: 0 } + ], o.arr); + + done(); + }); + it('with array', function(done) { + mpath.set('arr.0.arr.e', ['a', 'b'], o, function(v) { + return 'a' === v ? 'x' : v; + }); + assert.deepEqual([ + { yep: [15], arr: [{ a: { b: 47 }, e: 'x' }, { a: { c: 48 }, e: 'b' }, { d: 'yep', e: 35 }] }, + { yep: 0 } + ], o.arr); + + mpath.set('arr.0.arr.e', ['a', 'b'], o); + assert.deepEqual([ + { yep: [15], arr: [{ a: { b: 47 }, e: 'a' }, { a: { c: 48 }, e: 'b' }, { d: 'yep', e: 35 }] }, + { yep: 0 } + ], o.arr); + + done(); + }); + }); + + describe('array.index.array.path.path', function() { + it('with single value', function(done) { + mpath.set('arr.0.arr.a.b', 36, o, function(v) { + return 36 === v ? 3 : v; + }); + assert.deepEqual([ + { yep: [15], arr: [{ a: { b: 3 }, e: 'a' }, { a: { c: 48, b: 3 }, e: 'b' }, { d: 'yep', e: 35 }] }, + { yep: 0 } + ], o.arr); + + mpath.set('arr.0.arr.a.b', 36, o); + assert.deepEqual([ + { yep: [15], arr: [{ a: { b: 36 }, e: 'a' }, { a: { c: 48, b: 36 }, e: 'b' }, { d: 'yep', e: 35 }] }, + { yep: 0 } + ], o.arr); + + done(); + }); + it('with array', function(done) { + mpath.set('arr.0.arr.a.b', [1, 2, 3, 4], o, function(v) { + return 2 === v ? 'two' : v; + }); + assert.deepEqual([ + { yep: [15], arr: [{ a: { b: 1 }, e: 'a' }, { a: { c: 48, b: 'two' }, e: 'b' }, { d: 'yep', e: 35 }] }, + { yep: 0 } + ], o.arr); + + mpath.set('arr.0.arr.a.b', [1, 2, 3, 4], o); + assert.deepEqual([ + { yep: [15], arr: [{ a: { b: 1 }, e: 'a' }, { a: { c: 48, b: 2 }, e: 'b' }, { d: 'yep', e: 35 }] }, + { yep: 0 } + ], o.arr); + + done(); + }); + }); + + describe('array.index.array.$.path.path', function() { + it('with single value', function(done) { + mpath.set('arr.0.arr.$.a.b', '$', o, function(v) { + return '$' === v ? 'dolla billz' : v; + }); + assert.deepEqual([ + { yep: [15], arr: [{ a: { b: 'dolla billz' }, e: 'a' }, { a: { c: 48, b: 'dolla billz' }, e: 'b' }, { d: 'yep', e: 35 }] }, + { yep: 0 } + ], o.arr); + + mpath.set('arr.0.arr.$.a.b', '$', o); + assert.deepEqual([ + { yep: [15], arr: [{ a: { b: '$' }, e: 'a' }, { a: { c: 48, b: '$' }, e: 'b' }, { d: 'yep', e: 35 }] }, + { yep: 0 } + ], o.arr); + + done(); + }); + it('with array', function(done) { + mpath.set('arr.0.arr.$.a.b', [1], o, function(v) { + return Array.isArray(v) ? {} : v; + }); + assert.deepEqual([ + { yep: [15], arr: [{ a: { b: {} }, e: 'a' }, { a: { c: 48, b: {} }, e: 'b' }, { d: 'yep', e: 35 }] }, + { yep: 0 } + ], o.arr); + + mpath.set('arr.0.arr.$.a.b', [1], o); + assert.deepEqual([ + { yep: [15], arr: [{ a: { b: [1] }, e: 'a' }, { a: { c: 48, b: [1] }, e: 'b' }, { d: 'yep', e: 35 }] }, + { yep: 0 } + ], o.arr); + + done(); + }); + }); + + describe('array.array.index.path', function() { + it('with single value', function(done) { + mpath.set('arr.arr.0.a', 'single', o, function(v) { + return 'single' === v ? 'double' : v; + }); + assert.deepEqual([ + { yep: [15], arr: [{ a: 'double', e: 'a' }, { a: { c: 48, b: [1] }, e: 'b' }, { d: 'yep', e: 35 }] }, + { yep: 0 } + ], o.arr); + + mpath.set('arr.arr.0.a', 'single', o); + assert.deepEqual([ + { yep: [15], arr: [{ a: 'single', e: 'a' }, { a: { c: 48, b: [1] }, e: 'b' }, { d: 'yep', e: 35 }] }, + { yep: 0 } + ], o.arr); + + done(); + }); + it('with array', function(done) { + mpath.set('arr.arr.0.a', [4, 8, 15, 16, 23, 42], o, function(v) { + return 4 === v ? 3 : v; + }); + assert.deepEqual([ + { yep: [15], arr: [{ a: 3, e: 'a' }, { a: { c: 48, b: [1] }, e: 'b' }, { d: 'yep', e: 35 }] }, + { yep: false } + ], o.arr); + + mpath.set('arr.arr.0.a', [4, 8, 15, 16, 23, 42], o); + assert.deepEqual([ + { yep: [15], arr: [{ a: 4, e: 'a' }, { a: { c: 48, b: [1] }, e: 'b' }, { d: 'yep', e: 35 }] }, + { yep: false } + ], o.arr); + + done(); + }); + }); + + describe('array.array.$.index.path', function() { + it('with single value', function(done) { + mpath.set('arr.arr.$.0.a', 'singles', o, function(v) { + return 0; + }); + assert.deepEqual([ + { yep: [15], arr: [{ a: 0, e: 'a' }, { a: { c: 48, b: [1] }, e: 'b' }, { d: 'yep', e: 35 }] }, + { yep: 0 } + ], o.arr); + + mpath.set('arr.arr.$.0.a', 'singles', o); + assert.deepEqual([ + { yep: [15], arr: [{ a: 'singles', e: 'a' }, { a: { c: 48, b: [1] }, e: 'b' }, { d: 'yep', e: 35 }] }, + { yep: 0 } + ], o.arr); + + mpath.set('$.arr.arr.0.a', 'single', o); + assert.deepEqual([ + { yep: [15], arr: [{ a: 'single', e: 'a' }, { a: { c: 48, b: [1] }, e: 'b' }, { d: 'yep', e: 35 }] }, + { yep: 0 } + ], o.arr); + + done(); + }); + it('with array', function(done) { + mpath.set('arr.arr.$.0.a', [4, 8, 15, 16, 23, 42], o, function(v) { + return 'nope'; + }); + assert.deepEqual([ + { yep: [15], arr: [{ a: 'nope', e: 'a' }, { a: { c: 48, b: [1] }, e: 'b' }, { d: 'yep', e: 35 }] }, + { yep: 0 } + ], o.arr); + + mpath.set('arr.arr.$.0.a', [4, 8, 15, 16, 23, 42], o); + assert.deepEqual([ + { yep: [15], arr: [{ a: [4, 8, 15, 16, 23, 42], e: 'a' }, { a: { c: 48, b: [1] }, e: 'b' }, { d: 'yep', e: 35 }] }, + { yep: 0 } + ], o.arr); + + mpath.set('arr.$.arr.0.a', [4, 8, 15, 16, 23, 42, 108], o); + assert.deepEqual([ + { yep: [15], arr: [{ a: [4, 8, 15, 16, 23, 42, 108], e: 'a' }, { a: { c: 48, b: [1] }, e: 'b' }, { d: 'yep', e: 35 }] }, + { yep: 0 } + ], o.arr); + + done(); + }); + }); + + describe('array.array.path.index', function() { + it('with single value', function(done) { + mpath.set('arr.arr.a.7', 47, o, function(v) { + return 1; + }); + assert.deepEqual([ + { yep: [15], arr: [{ a: [4, 8, 15, 16, 23, 42, 108, 1], e: 'a' }, { a: { c: 48, b: [1], 7: 1 }, e: 'b' }, { d: 'yep', e: 35 }] }, + { yep: 0 } + ], o.arr); + + mpath.set('arr.arr.a.7', 47, o); + assert.deepEqual([ + { yep: [15], arr: [{ a: [4, 8, 15, 16, 23, 42, 108, 47], e: 'a' }, { a: { c: 48, b: [1], 7: 47 }, e: 'b' }, { d: 'yep', e: 35 }] }, + { yep: 0 } + ], o.arr); + + done(); + }); + it('with array', function(done) { + o.arr[1].arr = [{ a: [] }, { a: [] }, { a: null }]; + mpath.set('arr.arr.a.7', [[null, 46], [undefined, 'woot']], o); + + const a1 = []; + const a2 = []; + a1[7] = undefined; + a2[7] = 'woot'; + + assert.deepEqual([ + { yep: [15], arr: [{ a: [4, 8, 15, 16, 23, 42, 108, null], e: 'a' }, { a: { c: 48, b: [1], 7: 46 }, e: 'b' }, { d: 'yep', e: 35 }] }, + { yep: 0, arr: [{ a: a1 }, { a: a2 }, { a: null }] } + ], o.arr); + + done(); + }); + }); + + describe('handles array.array.path', function() { + it('with single', function(done) { + o.arr[1].arr = [{}, {}]; + assert.deepEqual([{}, {}], o.arr[1].arr); + o.arr.push({ arr: 'something else' }); + o.arr.push({ arr: ['something else'] }); + o.arr.push({ arr: [[]] }); + o.arr.push({ arr: [5] }); + + const weird = []; + weird.e = 'xmas'; + + // test + mpath.set('arr.arr.e', 47, o, function(v) { + return 'xmas'; + }); + assert.deepEqual([ + { yep: [15], arr: [ + { a: [4, 8, 15, 16, 23, 42, 108, null], e: 'xmas' }, + { a: { c: 48, b: [1], 7: 46 }, e: 'xmas' }, + { d: 'yep', e: 'xmas' } + ] + }, + { yep: 0, arr: [{ e: 'xmas' }, { e: 'xmas' }] }, + { arr: 'something else' }, + { arr: ['something else'] }, + { arr: [weird] }, + { arr: [5] } + ] + , o.arr); + + weird.e = 47; + + mpath.set('arr.arr.e', 47, o); + assert.deepEqual([ + { yep: [15], arr: [ + { a: [4, 8, 15, 16, 23, 42, 108, null], e: 47 }, + { a: { c: 48, b: [1], 7: 46 }, e: 47 }, + { d: 'yep', e: 47 } + ] + }, + { yep: 0, arr: [{ e: 47 }, { e: 47 }] }, + { arr: 'something else' }, + { arr: ['something else'] }, + { arr: [weird] }, + { arr: [5] } + ] + , o.arr); + + done(); + }); + it('with arrays', function(done) { + mpath.set('arr.arr.e', [[1, 2, 3], [4, 5], null, [], [6], [7, 8, 9]], o, function(v) { + return 10; + }); + + const weird = []; + weird.e = 10; + + assert.deepEqual([ + { yep: [15], arr: [ + { a: [4, 8, 15, 16, 23, 42, 108, null], e: 10 }, + { a: { c: 48, b: [1], 7: 46 }, e: 10 }, + { d: 'yep', e: 10 } + ] + }, + { yep: 0, arr: [{ e: 10 }, { e: 10 }] }, + { arr: 'something else' }, + { arr: ['something else'] }, + { arr: [weird] }, + { arr: [5] } + ] + , o.arr); + + mpath.set('arr.arr.e', [[1, 2, 3], [4, 5], null, [], [6], [7, 8, 9]], o); + + weird.e = 6; + + assert.deepEqual([ + { yep: [15], arr: [ + { a: [4, 8, 15, 16, 23, 42, 108, null], e: 1 }, + { a: { c: 48, b: [1], 7: 46 }, e: 2 }, + { d: 'yep', e: 3 } + ] + }, + { yep: 0, arr: [{ e: 4 }, { e: 5 }] }, + { arr: 'something else' }, + { arr: ['something else'] }, + { arr: [weird] }, + { arr: [5] } + ] + , o.arr); + + done(); + }); + }); + }); + + describe('with `special`', function() { + const o = doc(); + + it('works', function(done) { + mpath.set('name', 'chan', o, special, function(v) { + return 'hi'; + }); + assert.deepEqual('hi', o.name); + + mpath.set('name', 'changer', o, special); + assert.deepEqual('changer', o.name); + + mpath.set('first.second.third', [1, { name: 'y' }, 9], o, special); + assert.deepEqual([1, { name: 'y' }, 9], o.first.second.third); + + mpath.set('first.second.third.1.name', 'z', o, special); + assert.deepEqual([1, { name: 'z' }, 9], o.first.second.third); + + mpath.set('comments.1.name', 'ttwwoo', o, special); + assert.deepEqual({ name: 'two', _doc: { name: 'ttwwoo' } }, o.comments[1]); + + mpath.set('comments.2.comments.1.comments.0.expander', 'adder', o, special, function(v) { + return 'super'; + }); + assert.deepEqual( + { val: 2, expander: 'super' } + , o.comments[2]._doc.comments[1]._doc.comments[0]); + + mpath.set('comments.2.comments.1.comments.0.expander', 'adder', o, special); + assert.deepEqual( + { val: 2, expander: 'adder' } + , o.comments[2]._doc.comments[1]._doc.comments[0]); + + mpath.set('comments.2.comments.1.comments.2', 'set', o, special); + assert.equal(3, o.comments[2]._doc.comments[1]._doc.comments.length); + assert.deepEqual( + { val: 2, expander: 'adder' } + , o.comments[2]._doc.comments[1]._doc.comments[0]); + assert.deepEqual( + undefined + , o.comments[2]._doc.comments[1]._doc.comments[1]); + assert.deepEqual( + 'set' + , o.comments[2]._doc.comments[1]._doc.comments[2]); + done(); + }); + + describe('array.path', function() { + describe('with single non-array value', function() { + it('works', function(done) { + o.arr[1]._doc = { special: true }; + + mpath.set('arr.yep', false, o, special, function(v) { + return 'yes'; + }); + assert.deepEqual([ + { yep: 'yes', arr: [{ a: { b: 47 } }, { a: { c: 48 } }, { d: 'yep' }] }, + { yep: true, _doc: { special: true, yep: 'yes' } } + ], o.arr); + + mpath.set('arr.yep', false, o, special); + assert.deepEqual([ + { yep: false, arr: [{ a: { b: 47 } }, { a: { c: 48 } }, { d: 'yep' }] }, + { yep: true, _doc: { special: true, yep: false } } + ], o.arr); + + done(); + }); + }); + describe('with array of values', function() { + it('that are equal in length', function(done) { + mpath.set('arr.yep', ['one', 2], o, special, function(v) { + return 2 === v ? 20 : v; + }); + assert.deepEqual([ + { yep: 'one', arr: [{ a: { b: 47 } }, { a: { c: 48 } }, { d: 'yep' }] }, + { yep: true, _doc: { special: true, yep: 20 } } + ], o.arr); + + mpath.set('arr.yep', ['one', 2], o, special); + assert.deepEqual([ + { yep: 'one', arr: [{ a: { b: 47 } }, { a: { c: 48 } }, { d: 'yep' }] }, + { yep: true, _doc: { special: true, yep: 2 } } + ], o.arr); + + done(); + }); + + it('that is less than length', function(done) { + mpath.set('arr.yep', [47], o, special, function(v) { + return 80; + }); + assert.deepEqual([ + { yep: 80, arr: [{ a: { b: 47 } }, { a: { c: 48 } }, { d: 'yep' }] }, + { yep: true, _doc: { special: true, yep: 2 } } + ], o.arr); + + mpath.set('arr.yep', [47], o, special); + assert.deepEqual([ + { yep: 47, arr: [{ a: { b: 47 } }, { a: { c: 48 } }, { d: 'yep' }] }, + { yep: true, _doc: { special: true, yep: 2 } } + ], o.arr); + + // add _doc to first element + o.arr[0]._doc = { yep: 46, arr: [{ a: { b: 47 } }, { a: { c: 48 } }, { d: 'yep' }] }; + + mpath.set('arr.yep', [20], o, special); + assert.deepEqual([ + { yep: 47, arr: [{ a: { b: 47 } }, { a: { c: 48 } }, { d: 'yep' }], _doc: { yep: 20, arr: [{ a: { b: 47 } }, { a: { c: 48 } }, { d: 'yep' }] } }, + { yep: true, _doc: { special: true, yep: 2 } } + ], o.arr); + + done(); + }); + + it('that is greater than length', function(done) { + mpath.set('arr.yep', [5, 6, 7], o, special, function() { + return 'x'; + }); + assert.deepEqual([ + { yep: 47, arr: [{ a: { b: 47 } }, { a: { c: 48 } }, { d: 'yep' }], _doc: { yep: 'x', arr: [{ a: { b: 47 } }, { a: { c: 48 } }, { d: 'yep' }] } }, + { yep: true, _doc: { special: true, yep: 'x' } } + ], o.arr); + + mpath.set('arr.yep', [5, 6, 7], o, special); + assert.deepEqual([ + { yep: 47, arr: [{ a: { b: 47 } }, { a: { c: 48 } }, { d: 'yep' }], _doc: { yep: 5, arr: [{ a: { b: 47 } }, { a: { c: 48 } }, { d: 'yep' }] } }, + { yep: true, _doc: { special: true, yep: 6 } } + ], o.arr); + + done(); + }); + }); + }); + + describe('array.$.path', function() { + describe('with single non-array value', function() { + it('copies the value to each item in array', function(done) { + mpath.set('arr.$.yep', { xtra: 'double good' }, o, special, function(v) { + return 9; + }); + assert.deepEqual([ + { yep: 47, arr: [{ a: { b: 47 } }, { a: { c: 48 } }, { d: 'yep' }], + _doc: { yep: 9, arr: [{ a: { b: 47 } }, { a: { c: 48 } }, { d: 'yep' }] } }, + { yep: true, _doc: { special: true, yep: 9 } } + ], o.arr); + + mpath.set('arr.$.yep', { xtra: 'double good' }, o, special); + assert.deepEqual([ + { yep: 47, arr: [{ a: { b: 47 } }, { a: { c: 48 } }, { d: 'yep' }], + _doc: { yep: { xtra: 'double good' }, arr: [{ a: { b: 47 } }, { a: { c: 48 } }, { d: 'yep' }] } }, + { yep: true, _doc: { special: true, yep: { xtra: 'double good' } } } + ], o.arr); + + done(); + }); + }); + describe('with array of values', function() { + it('copies the value to each item in array', function(done) { + mpath.set('arr.$.yep', [15], o, special, function(v) { + return 'array'; + }); + assert.deepEqual([ + { yep: 47, arr: [{ a: { b: 47 } }, { a: { c: 48 } }, { d: 'yep' }], + _doc: { yep: 'array', arr: [{ a: { b: 47 } }, { a: { c: 48 } }, { d: 'yep' }] } }, + { yep: true, _doc: { special: true, yep: 'array' } } + ], o.arr); + + mpath.set('arr.$.yep', [15], o, special); + assert.deepEqual([ + { yep: 47, arr: [{ a: { b: 47 } }, { a: { c: 48 } }, { d: 'yep' }], + _doc: { yep: [15], arr: [{ a: { b: 47 } }, { a: { c: 48 } }, { d: 'yep' }] } }, + { yep: true, _doc: { special: true, yep: [15] } } + ], o.arr); + + done(); + }); + }); + }); + + describe('array.index.path', function() { + it('works', function(done) { + mpath.set('arr.1.yep', 0, o, special, function(v) { + return 1; + }); + assert.deepEqual([ + { yep: 47, arr: [{ a: { b: 47 } }, { a: { c: 48 } }, { d: 'yep' }], + _doc: { yep: [15], arr: [{ a: { b: 47 } }, { a: { c: 48 } }, { d: 'yep' }] } }, + { yep: true, _doc: { special: true, yep: 1 } } + ], o.arr); + + mpath.set('arr.1.yep', 0, o, special); + assert.deepEqual([ + { yep: 47, arr: [{ a: { b: 47 } }, { a: { c: 48 } }, { d: 'yep' }], + _doc: { yep: [15], arr: [{ a: { b: 47 } }, { a: { c: 48 } }, { d: 'yep' }] } }, + { yep: true, _doc: { special: true, yep: 0 } } + ], o.arr); + + done(); + }); + }); + + describe('array.index.array.path', function() { + it('with single value', function(done) { + mpath.set('arr.0.arr.e', 35, o, special, function(v) { + return 30; + }); + assert.deepEqual([ + { yep: 47, arr: [{ a: { b: 47 } }, { a: { c: 48 } }, { d: 'yep' }], + _doc: { yep: [15], arr: [{ a: { b: 47 }, e: 30 }, { a: { c: 48 }, e: 30 }, { d: 'yep', e: 30 }] } }, + { yep: true, _doc: { special: true, yep: 0 } } + ], o.arr); + + mpath.set('arr.0.arr.e', 35, o, special); + assert.deepEqual([ + { yep: 47, arr: [{ a: { b: 47 } }, { a: { c: 48 } }, { d: 'yep' }], + _doc: { yep: [15], arr: [{ a: { b: 47 }, e: 35 }, { a: { c: 48 }, e: 35 }, { d: 'yep', e: 35 }] } }, + { yep: true, _doc: { special: true, yep: 0 } } + ], o.arr); + + done(); + }); + it('with array', function(done) { + mpath.set('arr.0.arr.e', ['a', 'b'], o, special, function(v) { + return 'a' === v ? 'A' : v; + }); + assert.deepEqual([ + { yep: 47, arr: [{ a: { b: 47 } }, { a: { c: 48 } }, { d: 'yep' }], + _doc: { yep: [15], arr: [{ a: { b: 47 }, e: 'A' }, { a: { c: 48 }, e: 'b' }, { d: 'yep', e: 35 }] } }, + { yep: true, _doc: { special: true, yep: 0 } } + ], o.arr); + + mpath.set('arr.0.arr.e', ['a', 'b'], o, special); + assert.deepEqual([ + { yep: 47, arr: [{ a: { b: 47 } }, { a: { c: 48 } }, { d: 'yep' }], + _doc: { yep: [15], arr: [{ a: { b: 47 }, e: 'a' }, { a: { c: 48 }, e: 'b' }, { d: 'yep', e: 35 }] } }, + { yep: true, _doc: { special: true, yep: 0 } } + ], o.arr); + + done(); + }); + }); + + describe('array.index.array.path.path', function() { + it('with single value', function(done) { + mpath.set('arr.0.arr.a.b', 36, o, special, function(v) { + return 20; + }); + assert.deepEqual([ + { yep: 47, arr: [{ a: { b: 47 } }, { a: { c: 48 } }, { d: 'yep' }], + _doc: { yep: [15], arr: [{ a: { b: 20 }, e: 'a' }, { a: { c: 48, b: 20 }, e: 'b' }, { d: 'yep', e: 35 }] } }, + { yep: true, _doc: { special: true, yep: 0 } } + ], o.arr); + + mpath.set('arr.0.arr.a.b', 36, o, special); + assert.deepEqual([ + { yep: 47, arr: [{ a: { b: 47 } }, { a: { c: 48 } }, { d: 'yep' }], + _doc: { yep: [15], arr: [{ a: { b: 36 }, e: 'a' }, { a: { c: 48, b: 36 }, e: 'b' }, { d: 'yep', e: 35 }] } }, + { yep: true, _doc: { special: true, yep: 0 } } + ], o.arr); + + done(); + }); + it('with array', function(done) { + mpath.set('arr.0.arr.a.b', [1, 2, 3, 4], o, special, function(v) { + return v * 2; + }); + assert.deepEqual([ + { yep: 47, arr: [{ a: { b: 47 } }, { a: { c: 48 } }, { d: 'yep' }], + _doc: { yep: [15], arr: [{ a: { b: 2 }, e: 'a' }, { a: { c: 48, b: 4 }, e: 'b' }, { d: 'yep', e: 35 }] } }, + { yep: true, _doc: { special: true, yep: 0 } } + ], o.arr); + + mpath.set('arr.0.arr.a.b', [1, 2, 3, 4], o, special); + assert.deepEqual([ + { yep: 47, arr: [{ a: { b: 47 } }, { a: { c: 48 } }, { d: 'yep' }], + _doc: { yep: [15], arr: [{ a: { b: 1 }, e: 'a' }, { a: { c: 48, b: 2 }, e: 'b' }, { d: 'yep', e: 35 }] } }, + { yep: true, _doc: { special: true, yep: 0 } } + ], o.arr); + + done(); + }); + }); + + describe('array.index.array.$.path.path', function() { + it('with single value', function(done) { + mpath.set('arr.0.arr.$.a.b', '$', o, special, function(v) { + return 'dollaz'; + }); + assert.deepEqual([ + { yep: 47, arr: [{ a: { b: 47 } }, { a: { c: 48 } }, { d: 'yep' }], + _doc: { yep: [15], arr: [{ a: { b: 'dollaz' }, e: 'a' }, { a: { c: 48, b: 'dollaz' }, e: 'b' }, { d: 'yep', e: 35 }] } }, + { yep: true, _doc: { special: true, yep: 0 } } + ], o.arr); + + mpath.set('arr.0.arr.$.a.b', '$', o, special); + assert.deepEqual([ + { yep: 47, arr: [{ a: { b: 47 } }, { a: { c: 48 } }, { d: 'yep' }], + _doc: { yep: [15], arr: [{ a: { b: '$' }, e: 'a' }, { a: { c: 48, b: '$' }, e: 'b' }, { d: 'yep', e: 35 }] } }, + { yep: true, _doc: { special: true, yep: 0 } } + ], o.arr); + + done(); + }); + it('with array', function(done) { + mpath.set('arr.0.arr.$.a.b', [1], o, special, function(v) { + return {}; + }); + assert.deepEqual([ + { yep: 47, arr: [{ a: { b: 47 } }, { a: { c: 48 } }, { d: 'yep' }], + _doc: { yep: [15], arr: [{ a: { b: {} }, e: 'a' }, { a: { c: 48, b: {} }, e: 'b' }, { d: 'yep', e: 35 }] } }, + { yep: true, _doc: { special: true, yep: 0 } } + ], o.arr); + + mpath.set('arr.0.arr.$.a.b', [1], o, special); + assert.deepEqual([ + { yep: 47, arr: [{ a: { b: 47 } }, { a: { c: 48 } }, { d: 'yep' }], + _doc: { yep: [15], arr: [{ a: { b: [1] }, e: 'a' }, { a: { c: 48, b: [1] }, e: 'b' }, { d: 'yep', e: 35 }] } }, + { yep: true, _doc: { special: true, yep: 0 } } + ], o.arr); + + done(); + }); + }); + + describe('array.array.index.path', function() { + it('with single value', function(done) { + mpath.set('arr.arr.0.a', 'single', o, special, function(v) { + return 88; + }); + assert.deepEqual([ + { yep: 47, arr: [{ a: { b: 47 } }, { a: { c: 48 } }, { d: 'yep' }], + _doc: { yep: [15], arr: [{ a: 88, e: 'a' }, { a: { c: 48, b: [1] }, e: 'b' }, { d: 'yep', e: 35 }] } }, + { yep: true, _doc: { special: true, yep: 0 } } + ], o.arr); + + mpath.set('arr.arr.0.a', 'single', o, special); + assert.deepEqual([ + { yep: 47, arr: [{ a: { b: 47 } }, { a: { c: 48 } }, { d: 'yep' }], + _doc: { yep: [15], arr: [{ a: 'single', e: 'a' }, { a: { c: 48, b: [1] }, e: 'b' }, { d: 'yep', e: 35 }] } }, + { yep: true, _doc: { special: true, yep: 0 } } + ], o.arr); + + done(); + }); + it('with array', function(done) { + mpath.set('arr.arr.0.a', [4, 8, 15, 16, 23, 42], o, special, function(v) { + return v * 2; + }); + assert.deepEqual([ + { yep: 47, arr: [{ a: { b: 47 } }, { a: { c: 48 } }, { d: 'yep' }], + _doc: { yep: [15], arr: [{ a: 8, e: 'a' }, { a: { c: 48, b: [1] }, e: 'b' }, { d: 'yep', e: 35 }] } }, + { yep: true, _doc: { special: true, yep: 0 } } + ], o.arr); + + mpath.set('arr.arr.0.a', [4, 8, 15, 16, 23, 42], o, special); + assert.deepEqual([ + { yep: 47, arr: [{ a: { b: 47 } }, { a: { c: 48 } }, { d: 'yep' }], + _doc: { yep: [15], arr: [{ a: 4, e: 'a' }, { a: { c: 48, b: [1] }, e: 'b' }, { d: 'yep', e: 35 }] } }, + { yep: true, _doc: { special: true, yep: 0 } } + ], o.arr); + + done(); + }); + }); + + describe('array.array.$.index.path', function() { + it('with single value', function(done) { + mpath.set('arr.arr.$.0.a', 'singles', o, special, function(v) { + return v.toUpperCase(); + }); + assert.deepEqual([ + { yep: 47, arr: [{ a: { b: 47 } }, { a: { c: 48 } }, { d: 'yep' }], + _doc: { yep: [15], arr: [{ a: 'SINGLES', e: 'a' }, { a: { c: 48, b: [1] }, e: 'b' }, { d: 'yep', e: 35 }] } }, + { yep: true, _doc: { special: true, yep: 0 } } + ], o.arr); + + mpath.set('arr.arr.$.0.a', 'singles', o, special); + assert.deepEqual([ + { yep: 47, arr: [{ a: { b: 47 } }, { a: { c: 48 } }, { d: 'yep' }], + _doc: { yep: [15], arr: [{ a: 'singles', e: 'a' }, { a: { c: 48, b: [1] }, e: 'b' }, { d: 'yep', e: 35 }] } }, + { yep: true, _doc: { special: true, yep: 0 } } + ], o.arr); + + mpath.set('$.arr.arr.0.a', 'single', o, special); + assert.deepEqual([ + { yep: 47, arr: [{ a: { b: 47 } }, { a: { c: 48 } }, { d: 'yep' }], + _doc: { yep: [15], arr: [{ a: 'single', e: 'a' }, { a: { c: 48, b: [1] }, e: 'b' }, { d: 'yep', e: 35 }] } }, + { yep: true, _doc: { special: true, yep: 0 } } + ], o.arr); + + done(); + }); + it('with array', function(done) { + mpath.set('arr.arr.$.0.a', [4, 8, 15, 16, 23, 42], o, special, function(v) { + return Array; + }); + assert.deepEqual([ + { yep: 47, arr: [{ a: { b: 47 } }, { a: { c: 48 } }, { d: 'yep' }], + _doc: { yep: [15], arr: [{ a: Array, e: 'a' }, { a: { c: 48, b: [1] }, e: 'b' }, { d: 'yep', e: 35 }] } }, + { yep: true, _doc: { special: true, yep: 0 } } + ], o.arr); + + mpath.set('arr.arr.$.0.a', [4, 8, 15, 16, 23, 42], o, special); + assert.deepEqual([ + { yep: 47, arr: [{ a: { b: 47 } }, { a: { c: 48 } }, { d: 'yep' }], + _doc: { yep: [15], arr: [{ a: [4, 8, 15, 16, 23, 42], e: 'a' }, { a: { c: 48, b: [1] }, e: 'b' }, { d: 'yep', e: 35 }] } }, + { yep: true, _doc: { special: true, yep: 0 } } + ], o.arr); + + mpath.set('arr.$.arr.0.a', [4, 8, 15, 16, 23, 42, 108], o, special); + assert.deepEqual([ + { yep: 47, arr: [{ a: { b: 47 } }, { a: { c: 48 } }, { d: 'yep' }], + _doc: { yep: [15], arr: [{ a: [4, 8, 15, 16, 23, 42, 108], e: 'a' }, { a: { c: 48, b: [1] }, e: 'b' }, { d: 'yep', e: 35 }] } }, + { yep: true, _doc: { special: true, yep: 0 } } + ], o.arr); + + done(); + }); + }); + + describe('array.array.path.index', function() { + it('with single value', function(done) { + mpath.set('arr.arr.a.7', 47, o, special, function(v) { + return Object; + }); + assert.deepEqual([ + { yep: 47, arr: [{ a: { b: 47 } }, { a: { c: 48 } }, { d: 'yep' }], + _doc: { yep: [15], arr: [{ a: [4, 8, 15, 16, 23, 42, 108, Object], e: 'a' }, { a: { c: 48, b: [1], 7: Object }, e: 'b' }, { d: 'yep', e: 35 }] } }, + { yep: true, _doc: { special: true, yep: 0 } } + ], o.arr); + + mpath.set('arr.arr.a.7', 47, o, special); + assert.deepEqual([ + { yep: 47, arr: [{ a: { b: 47 } }, { a: { c: 48 } }, { d: 'yep' }], + _doc: { yep: [15], arr: [{ a: [4, 8, 15, 16, 23, 42, 108, 47], e: 'a' }, { a: { c: 48, b: [1], 7: 47 }, e: 'b' }, { d: 'yep', e: 35 }] } }, + { yep: true, _doc: { special: true, yep: 0 } } + ], o.arr); + + done(); + }); + it('with array', function(done) { + o.arr[1]._doc.arr = [{ a: [] }, { a: [] }, { a: null }]; + mpath.set('arr.arr.a.7', [[null, 46], [undefined, 'woot']], o, special, function(v) { + return undefined === v ? 'nope' : v; + }); + + const a1 = []; + const a2 = []; + a1[7] = 'nope'; + a2[7] = 'woot'; + + assert.deepEqual([ + { yep: 47, arr: [{ a: { b: 47 } }, { a: { c: 48 } }, { d: 'yep' }], + _doc: { yep: [15], arr: [{ a: [4, 8, 15, 16, 23, 42, 108, null], e: 'a' }, { a: { c: 48, b: [1], 7: 46 }, e: 'b' }, { d: 'yep', e: 35 }] } }, + { yep: true, _doc: { arr: [{ a: a1 }, { a: a2 }, { a: null }], special: true, yep: 0 } } + ], o.arr); + + mpath.set('arr.arr.a.7', [[null, 46], [undefined, 'woot']], o, special); + + a1[7] = undefined; + + assert.deepEqual([ + { yep: 47, arr: [{ a: { b: 47 } }, { a: { c: 48 } }, { d: 'yep' }], + _doc: { yep: [15], arr: [{ a: [4, 8, 15, 16, 23, 42, 108, null], e: 'a' }, { a: { c: 48, b: [1], 7: 46 }, e: 'b' }, { d: 'yep', e: 35 }] } }, + { yep: true, _doc: { arr: [{ a: a1 }, { a: a2 }, { a: null }], special: true, yep: 0 } } + ], o.arr); + + done(); + }); + }); + + describe('handles array.array.path', function() { + it('with single', function(done) { + o.arr[1]._doc.arr = [{}, {}]; + assert.deepEqual([{}, {}], o.arr[1]._doc.arr); + o.arr.push({ _doc: { arr: 'something else' } }); + o.arr.push({ _doc: { arr: ['something else'] } }); + o.arr.push({ _doc: { arr: [[]] } }); + o.arr.push({ _doc: { arr: [5] } }); + + // test + mpath.set('arr.arr.e', 47, o, special); + + const weird = []; + weird.e = 47; + + assert.deepEqual([ + { yep: 47, arr: [{ a: { b: 47 } }, { a: { c: 48 } }, { d: 'yep' }], + _doc: { + yep: [15], + arr: [ + { a: [4, 8, 15, 16, 23, 42, 108, null], e: 47 }, + { a: { c: 48, b: [1], 7: 46 }, e: 47 }, + { d: 'yep', e: 47 } + ] + } + }, + { yep: true, + _doc: { + arr: [ + { e: 47 }, + { e: 47 } + ], + special: true, + yep: 0 + } + }, + { _doc: { arr: 'something else' } }, + { _doc: { arr: ['something else'] } }, + { _doc: { arr: [weird] } }, + { _doc: { arr: [5] } } + ] + , o.arr); + + done(); + }); + it('with arrays', function(done) { + mpath.set('arr.arr.e', [[1, 2, 3], [4, 5], null, [], [6], [7, 8, 9]], o, special); + + const weird = []; + weird.e = 6; + + assert.deepEqual([ + { yep: 47, arr: [{ a: { b: 47 } }, { a: { c: 48 } }, { d: 'yep' }], + _doc: { + yep: [15], + arr: [ + { a: [4, 8, 15, 16, 23, 42, 108, null], e: 1 }, + { a: { c: 48, b: [1], 7: 46 }, e: 2 }, + { d: 'yep', e: 3 } + ] + } + }, + { yep: true, + _doc: { + arr: [ + { e: 4 }, + { e: 5 } + ], + special: true, + yep: 0 + } + }, + { _doc: { arr: 'something else' } }, + { _doc: { arr: ['something else'] } }, + { _doc: { arr: [weird] } }, + { _doc: { arr: [5] } } + ] + , o.arr); + + done(); + }); + }); + + describe('that is a function', function() { + describe('without map', function() { + it('works on array value', function(done) { + const o = { hello: { world: [{ how: 'are' }, { you: '?' }] } }; + const special = function(obj, key, val) { + if (val) { + obj[key] = val; + } else { + return 'thing' == key + ? obj.world + : obj[key]; + } + }; + mpath.set('hello.thing.how', 'arrrr', o, special); + assert.deepEqual(o, { hello: { world: [{ how: 'arrrr' }, { you: '?', how: 'arrrr' }] } }); + done(); + }); + it('works on non-array value', function(done) { + const o = { hello: { world: { how: 'are you' } } }; + const special = function(obj, key, val) { + if (val) { + obj[key] = val; + } else { + return 'thing' == key + ? obj.world + : obj[key]; + } + }; + mpath.set('hello.thing.how', 'RU', o, special); + assert.deepEqual(o, { hello: { world: { how: 'RU' } } }); + done(); + }); + }); + it('works with map', function(done) { + const o = { hello: { world: [{ how: 'are' }, { you: '?' }] } }; + const special = function(obj, key, val) { + if (val) { + obj[key] = val; + } else { + return 'thing' == key + ? obj.world + : obj[key]; + } + }; + const map = function(val) { + return 'convert' == val + ? 'ºº' + : val; + }; + mpath.set('hello.thing.how', 'convert', o, special, map); + assert.deepEqual(o, { hello: { world: [{ how: 'ºº' }, { you: '?', how: 'ºº' }] } }); + done(); + }); + }); + + }); + + describe('get/set integration', function() { + const o = doc(); + + it('works', function(done) { + const vals = mpath.get('array.o.array.x.b', o); + + vals[0][0][2] = 10; + vals[1][0][1] = 0; + vals[1][1] = 'Rambaldi'; + vals[1][2] = [12, 14]; + vals[2] = [{ changed: true }, [null, ['changed', 'to', 'array']]]; + + mpath.set('array.o.array.x.b', vals, o); + + const t = [ + { o: { array: [{ x: { b: [4, 6, 10] } }, { y: 10 }] } }, + { o: { array: [{ x: { b: [1, 0, 3] } }, { x: { b: 'Rambaldi', z: 10 } }, { x: { b: [12, 14] } }] } }, + { o: { array: [{ x: { b: { changed: true } } }, { x: { b: [null, ['changed', 'to', 'array']] } }] } }, + { o: { array: [{ x: null }] } }, + { o: { array: [{ y: 3 }] } }, + { o: { array: [3, 0, null] } }, + { o: { name: 'ha' } } + ]; + assert.deepEqual(t, o.array); + done(); + }); + + it('array.prop', function(done) { + mpath.set('comments.name', ['this', 'was', 'changed'], o); + + assert.deepEqual([ + { name: 'this' }, + { name: 'was', _doc: { name: '2' } }, + { name: 'changed', + comments: [{}, { comments: [{ val: 'twoo' }] }], + _doc: { name: '3', comments: [{}, { _doc: { comments: [{ val: 2 }] } }] } } + ], o.comments); + + mpath.set('comments.name', ['also', 'changed', 'this'], o, special); + + assert.deepEqual([ + { name: 'also' }, + { name: 'was', _doc: { name: 'changed' } }, + { name: 'changed', + comments: [{}, { comments: [{ val: 'twoo' }] }], + _doc: { name: 'this', comments: [{}, { _doc: { comments: [{ val: 2 }] } }] } } + ], o.comments); + + done(); + }); + + it('nested array', function(done) { + const obj = { arr: [[{ test: 41 }]] }; + mpath.set('arr.test', [[42]], obj); + assert.deepEqual(obj.arr, [[{ test: 42 }]]); + done(); + }); + }); + + describe('multiple $ use', function() { + const o = doc(); + it('is ok', function(done) { + assert.doesNotThrow(function() { + mpath.set('arr.$.arr.$.a', 35, o); + }); + done(); + }); + }); + + it('has', function(done) { + assert.ok(mpath.has('a', { a: 1 })); + assert.ok(mpath.has('a', { a: undefined })); + assert.ok(!mpath.has('a', {})); + assert.ok(!mpath.has('a', null)); + + assert.ok(mpath.has('a.b', { a: { b: 1 } })); + assert.ok(mpath.has('a.b', { a: { b: undefined } })); + assert.ok(!mpath.has('a.b', { a: 1 })); + assert.ok(!mpath.has('a.b', { a: null })); + + done(); + }); + + it('underneath a map', function(done) { + if (!global.Map) { + done(); + return; + } + assert.equal(mpath.get('a.b', { a: new Map([['b', 1]]) }), 1); + + const m = new Map([['b', 1]]); + const obj = { a: m }; + mpath.set('a.c', 2, obj); + assert.equal(m.get('c'), 2); + + done(); + }); + + it('unset', function(done) { + let o = { a: 1 }; + mpath.unset('a', o); + assert.deepEqual(o, {}); + + o = { a: { b: 1 } }; + mpath.unset('a.b', o); + assert.deepEqual(o, { a: {} }); + + o = { a: null }; + mpath.unset('a.b', o); + assert.deepEqual(o, { a: null }); + + done(); + }); + + it('unset with __proto__', function(done) { + // Should refuse to set __proto__ + function Clazz() {} + Clazz.prototype.foobar = true; + + mpath.unset('__proto__.foobar', new Clazz()); + assert.ok(Clazz.prototype.foobar); + + mpath.unset('constructor.prototype.foobar', new Clazz()); + assert.ok(Clazz.prototype.foobar); + + done(); + }); + + it('get() underneath subclassed array', function(done) { + class MyArray extends Array {} + + const obj = { + arr: new MyArray() + }; + obj.arr.push({ test: 2 }); + + const arr = mpath.get('arr.test', obj); + assert.equal(arr.constructor.name, 'Array'); + assert.ok(!(arr instanceof MyArray)); + + done(); + }); + + it('ignores setting a nested path that doesnt exist', function(done) { + const o = doc(); + assert.doesNotThrow(function() { + mpath.set('thing.that.is.new', 10, o); + }); + done(); + }); + }); +}); diff --git a/node_modules/mpath/test/stringToParts.js b/node_modules/mpath/test/stringToParts.js new file mode 100644 index 000000000..09940dfa9 --- /dev/null +++ b/node_modules/mpath/test/stringToParts.js @@ -0,0 +1,30 @@ +'use strict'; + +const assert = require('assert'); +const stringToParts = require('../lib/stringToParts'); + +describe('stringToParts', function() { + it('handles brackets for numbers', function() { + assert.deepEqual(stringToParts('list[0].name'), ['list', '0', 'name']); + assert.deepEqual(stringToParts('list[0][1].name'), ['list', '0', '1', 'name']); + }); + + it('handles dot notation', function() { + assert.deepEqual(stringToParts('a.b.c'), ['a', 'b', 'c']); + assert.deepEqual(stringToParts('a..b.d'), ['a', '', 'b', 'd']); + }); + + it('ignores invalid numbers in square brackets', function() { + assert.deepEqual(stringToParts('foo[1mystring]'), ['foo[1mystring]']); + assert.deepEqual(stringToParts('foo[1mystring].bar[1]'), ['foo[1mystring]', 'bar', '1']); + assert.deepEqual(stringToParts('foo[1mystring][2]'), ['foo[1mystring]', '2']); + }); + + it('handles empty string', function() { + assert.deepEqual(stringToParts(''), ['']); + }); + + it('handles trailing dot', function() { + assert.deepEqual(stringToParts('a.b.'), ['a', 'b', '']); + }); +}); \ No newline at end of file diff --git a/node_modules/mquery/.eslintignore b/node_modules/mquery/.eslintignore new file mode 100644 index 000000000..4b4d86310 --- /dev/null +++ b/node_modules/mquery/.eslintignore @@ -0,0 +1 @@ +coverage/ \ No newline at end of file diff --git a/node_modules/mquery/.eslintrc.json b/node_modules/mquery/.eslintrc.json new file mode 100644 index 000000000..8dabf1a21 --- /dev/null +++ b/node_modules/mquery/.eslintrc.json @@ -0,0 +1,123 @@ +{ + "extends": [ + "eslint:recommended" + ], + "plugins": [ + "mocha-no-only" + ], + "parserOptions": { + "ecmaVersion": 2017 + }, + "env": { + "node": true, + "es6": true + }, + "rules": { + "comma-style": "error", + "indent": [ + "error", + 2, + { + "SwitchCase": 1, + "VariableDeclarator": 2 + } + ], + "keyword-spacing": "error", + "no-whitespace-before-property": "error", + "no-buffer-constructor": "warn", + "no-console": "off", + "no-multi-spaces": "error", + "no-constant-condition": "off", + "func-call-spacing": "error", + "no-trailing-spaces": "error", + "no-undef": "error", + "no-unneeded-ternary": "error", + "no-const-assign": "error", + "no-useless-rename": "error", + "no-dupe-keys": "error", + "space-in-parens": [ + "error", + "never" + ], + "spaced-comment": [ + "error", + "always", + { + "block": { + "markers": [ + "!" + ], + "balanced": true + } + } + ], + "key-spacing": [ + "error", + { + "beforeColon": false, + "afterColon": true + } + ], + "comma-spacing": [ + "error", + { + "before": false, + "after": true + } + ], + "array-bracket-spacing": 1, + "arrow-spacing": [ + "error", + { + "before": true, + "after": true + } + ], + "object-curly-spacing": [ + "error", + "always" + ], + "comma-dangle": [ + "error", + "never" + ], + "no-unreachable": "error", + "quotes": [ + "error", + "single" + ], + "quote-props": [ + "error", + "as-needed" + ], + "semi": "error", + "no-extra-semi": "error", + "semi-spacing": "error", + "no-spaced-func": "error", + "no-throw-literal": "error", + "space-before-blocks": "error", + "space-before-function-paren": [ + "error", + "never" + ], + "space-infix-ops": "error", + "space-unary-ops": "error", + "no-var": "warn", + "prefer-const": "warn", + "strict": [ + "error", + "global" + ], + "no-restricted-globals": [ + "error", + { + "name": "context", + "message": "Don't use Mocha's global context" + } + ], + "no-prototype-builtins": "off", + "mocha-no-only/mocha-no-only": [ + "error" + ] + } +} \ No newline at end of file diff --git a/node_modules/mquery/.travis.yml b/node_modules/mquery/.travis.yml new file mode 100644 index 000000000..0aa7f1a95 --- /dev/null +++ b/node_modules/mquery/.travis.yml @@ -0,0 +1,15 @@ +language: node_js +node_js: + - "12" +matrix: + include: + - node_js: "13" + env: "NVM_NODEJS_ORG_MIRROR=https://nodejs.org/download/nightly" + allow_failures: + # Allow the nightly installs to fail + - env: "NVM_NODEJS_ORG_MIRROR=https://nodejs.org/download/nightly" +script: + - npm test + - npm run lint +services: + - mongodb diff --git a/node_modules/mquery/History.md b/node_modules/mquery/History.md new file mode 100644 index 000000000..6967c9475 --- /dev/null +++ b/node_modules/mquery/History.md @@ -0,0 +1,376 @@ +4.0.3 / 2022-05-17 +================== + * fix: allow using `comment` with `findOneAndUpdate()`, `count()`, `distinct()` and `hint` with `findOneAndUpdate()` Automattic/mongoose#11793 + +4.0.2 / 2022-01-23 +================== + * perf: replace regexp-clone with native functionality #131 [Uzlopak](https://github.com/Uzlopak) + +4.0.1 / 2022-01-20 +================== + * perf: remove sliced, add various microoptimizations #130 [Uzlopak](https://github.com/Uzlopak) + * refactor: convert NodeCollection to a class #128 [jimmywarting](https://github.com/jimmywarting) + +4.0.0 / 2021-08-24 + +4.0.0-rc0 / 2021-08-19 +====================== + * BREAKING CHANGE: drop support for Node < 12 #123 + * BREAKING CHANGE: upgrade to mongodb driver 4.x: drop support for `findAndModify()`, use native `findOneAndUpdate/Delete` #124 + * BREAKING CHANGE: rename findStream -> findCursor #124 + * BREAKING CHANGE: use native ES6 promises by default, remove bluebird dependency #123 + +3.2.5 / 2021-03-29 +================== + * fix(utils): make `mergeClone()` skip special properties like `__proto__` #121 [zpbrent](https://github.com/zpbrent) + +3.2.4 / 2021-02-12 +================== + * fix(utils): make clone() only copy own properties Automattic/mongoose#9876 + +3.2.3 / 2020-12-10 +================== + * fix(utils): avoid copying special properties like `__proto__` when merging and cloning. Fix CVE-2020-35149 + +3.2.2 / 2019-09-22 +================== + * fix: dont re-call setOptions() when pulling base class options Automattic/mongoose#8159 + +3.2.1 / 2018-08-24 +================== + * chore: upgrade deps + +3.2.0 / 2018-08-24 +================== + * feat: add $useProjection to opt in to using `projection` instead of `fields` re: MongoDB deprecation warnings Automattic/mongoose#6880 + +3.1.2 / 2018-08-01 +================== + * chore: move eslint to devDependencies #110 [jakesjews](https://github.com/jakesjews) + +3.1.1 / 2018-07-30 +================== + * chore: add eslint #107 [Fonger](https://github.com/Fonger) + * docs: clean up readConcern docs #106 [Fonger](https://github.com/Fonger) + +3.1.0 / 2018-07-29 +================== + * feat: add `readConcern()` helper #105 [Fonger](https://github.com/Fonger) + * feat: add `maxTimeMS()` as alias of `maxTime()` #105 [Fonger](https://github.com/Fonger) + * feat: add `collation()` helper #105 [Fonger](https://github.com/Fonger) + +3.0.1 / 2018-07-02 +================== + * fix: parse sort array options correctly #103 #102 [Fonger](https://github.com/Fonger) + +3.0.0 / 2018-01-20 +================== + * chore: upgrade deps and add nsp + +3.0.0-rc0 / 2017-12-06 +====================== + * BREAKING CHANGE: remove support for node < 4 + * BREAKING CHANGE: remove support for retainKeyOrder, will always be true by default re: Automattic/mongoose#2749 + +2.3.3 / 2017-11-19 +================== + * fixed; catch sync errors in cursor.toArray() re: Automattic/mongoose#5812 + +2.3.2 / 2017-09-27 +================== + * fixed; bumped debug -> 2.6.9 re: #89 + +2.3.1 / 2017-05-22 +================== + * fixed; bumped debug -> 2.6.7 re: #86 + +2.3.0 / 2017-03-05 +================== + * added; replaceOne function + * added; deleteOne and deleteMany functions + +2.2.3 / 2017-01-31 +================== + * fixed; throw correct error when passing incorrectly formatted array to sort() + +2.2.2 / 2017-01-31 +================== + * fixed; allow passing maps to sort() + +2.2.1 / 2017-01-29 +================== + * fixed; allow passing string to hint() + +2.2.0 / 2017-01-08 +================== + * added; updateOne and updateMany functions + +2.1.0 / 2016-12-22 +================== + * added; ability to pass an array to select() #81 [dciccale](https://github.com/dciccale) + +2.0.0 / 2016-09-25 +================== + * added; support for mongodb driver 2.0 streams + +1.12.0 / 2016-09-25 +=================== + * added; `retainKeyOrder` option re: Automattic/mongoose#4542 + +1.11.0 / 2016-06-04 +=================== + * added; `.minDistance()` helper and minDistance for `.near()` Automattic/mongoose#4179 + +1.10.1 / 2016-04-26 +=================== + * fixed; ensure conditions is an object before assigning #75 + +1.10.0 / 2016-03-16 +================== + + * updated; bluebird to latest 2.10.2 version #74 [matskiv](https://github.com/matskiv) + +1.9.0 / 2016-03-15 +================== + * added; `.eq` as a shortcut for `.equals` #72 [Fonger](https://github.com/Fonger) + * added; ability to use array syntax for sort re: https://jira.mongodb.org/browse/NODE-578 #67 + +1.8.0 / 2016-03-01 +================== + * fixed; dont throw an error if count used with sort or select Automattic/mongoose#3914 + +1.7.0 / 2016-02-23 +================== + * fixed; don't treat objects with a length property as argument objects #70 + * added; `.findCursor()` method #69 [nswbmw](https://github.com/nswbmw) + * added; `_compiledUpdate` property #68 [nswbmw](https://github.com/nswbmw) + +1.6.2 / 2015-07-12 +================== + + * fixed; support exec cb being called synchronously #66 + +1.6.1 / 2015-06-16 +================== + + * fixed; do not treat $meta projection as inclusive [vkarpov15](https://github.com/vkarpov15) + +1.6.0 / 2015-05-27 +================== + + * update dependencies #65 [bachp](https://github.com/bachp) + +1.5.0 / 2015-03-31 +================== + + * fixed; debug output + * fixed; allow hint usage with count #61 [trueinsider](https://github.com/trueinsider) + +1.4.0 / 2015-03-29 +================== + + * added; object support to slice() #60 [vkarpov15](https://github.com/vkarpov15) + * debug; improved output #57 [flyvictor](https://github.com/flyvictor) + +1.3.0 / 2014-11-06 +================== + + * added; setTraceFunction() #53 from [jlai](https://github.com/jlai) + +1.2.1 / 2014-09-26 +================== + + * fixed; distinct assignment in toConstructor() #51 from [esco](https://github.com/esco) + +1.2.0 / 2014-09-18 +================== + + * added; stream() support for find() + +1.1.0 / 2014-09-15 +================== + + * add #then for co / koa support + * start checking code coverage + +1.0.0 / 2014-07-07 +================== + + * Remove broken require() calls until they're actually implemented #48 [vkarpov15](https://github.com/vkarpov15) + +0.9.0 / 2014-05-22 +================== + + * added; thunk() support + * release 0.8.0 + +0.8.0 / 2014-05-15 +================== + + * added; support for maxTimeMS #44 [yoitsro](https://github.com/yoitsro) + * updated; devDependency (driver to 1.4.4) + +0.7.0 / 2014-05-02 +================== + + * fixed; pass $maxDistance in $near object as described in docs #43 [vkarpov15](https://github.com/vkarpov15) + * fixed; cloning buffers #42 [gjohnson](https://github.com/gjohnson) + * tests; a little bit more `mongodb` agnostic #34 [refack](https://github.com/refack) + +0.6.0 / 2014-04-01 +================== + + * fixed; Allow $meta args in sort() so text search sorting works #37 [vkarpov15](https://github.com/vkarpov15) + +0.5.3 / 2014-02-22 +================== + + * fixed; cloning mongodb.Binary + +0.5.2 / 2014-01-30 +================== + + * fixed; cloning ObjectId constructors + * fixed; cloning of ReadPreferences #30 [ashtuchkin](https://github.com/ashtuchkin) + * tests; use specific mongodb version #29 [AvianFlu](https://github.com/AvianFlu) + * tests; remove dependency on ObjectId #28 [refack](https://github.com/refack) + * tests; add failing ReadPref test + +0.5.1 / 2014-01-17 +================== + + * added; deprecation notice to tags parameter #27 [ashtuchkin](https://github.com/ashtuchkin) + * readme; add links + +0.5.0 / 2014-01-16 +================== + + * removed; mongodb driver dependency #26 [ashtuchkin](https://github.com/ashtuchkin) + * removed; first class support of read preference tags #26 (still supported though) [ashtuchkin](https://github.com/ashtuchkin) + * added; better ObjectId clone support + * fixed; cloning objects that have no constructor #21 + * docs; cleaned up [ashtuchkin](https://github.com/ashtuchkin) + +0.4.2 / 2014-01-08 +================== + + * updated; debug module 0.7.4 [refack](https://github.com/refack) + +0.4.1 / 2014-01-07 +================== + + * fixed; inclusive/exclusive logic + +0.4.0 / 2014-01-06 +================== + + * added; selected() + * added; selectedInclusively() + * added; selectedExclusively() + +0.3.3 / 2013-11-14 +================== + + * Fix Mongo DB Dependency #20 [rschmukler](https://github.com/rschmukler) + +0.3.2 / 2013-09-06 +================== + + * added; geometry support for near() + +0.3.1 / 2013-08-22 +================== + + * fixed; update retains key order #19 + +0.3.0 / 2013-08-22 +================== + + * less hardcoded isNode env detection #18 [vshulyak](https://github.com/vshulyak) + * added; validation of findAndModify varients + * clone update doc before execution + * stricter env checks + +0.2.7 / 2013-08-2 +================== + + * Now support GeoJSON point values for Query#near + +0.2.6 / 2013-07-30 +================== + + * internally, 'asc' and 'desc' for sorts are now converted into 1 and -1, respectively + +0.2.5 / 2013-07-30 +================== + + * updated docs + * changed internal representation of `sort` to use objects instead of arrays + +0.2.4 / 2013-07-25 +================== + + * updated; sliced to 0.0.5 + +0.2.3 / 2013-07-09 +================== + + * now using a callback in collection.find instead of directly calling toArray() on the cursor [ebensing](https://github.com/ebensing) + +0.2.2 / 2013-07-09 +================== + + * now exposing mongodb export to allow for better testing [ebensing](https://github.com/ebensing) + +0.2.1 / 2013-07-08 +================== + + * select no longer accepts arrays as parameters [ebensing](https://github.com/ebensing) + +0.2.0 / 2013-07-05 +================== + + * use $geoWithin by default + +0.1.2 / 2013-07-02 +================== + + * added use$geoWithin flag [ebensing](https://github.com/ebensing) + * fix read preferences typo [ebensing](https://github.com/ebensing) + * fix reference to old param name in exists() [ebensing](https://github.com/ebensing) + +0.1.1 / 2013-06-24 +================== + + * fixed; $intersects -> $geoIntersects #14 [ebensing](https://github.com/ebensing) + * fixed; Retain key order when copying objects #15 [ebensing](https://github.com/ebensing) + * bump mongodb dev dep + +0.1.0 / 2013-05-06 +================== + + * findAndModify; return the query + * move mquery.proto.canMerge to mquery.canMerge + * overwrite option now works with non-empty objects + * use strict mode + * validate count options + * validate distinct options + * add aggregate to base collection methods + * clone merge arguments + * clone merged update arguments + * move subclass to mquery.prototype.toConstructor + * fixed; maxScan casing + * use regexp-clone + * added; geometry/intersects support + * support $and + * near: do not use "radius" + * callbacks always fire on next turn of loop + * defined collection interface + * remove time from tests + * clarify goals + * updated docs; + +0.0.1 / 2012-12-15 +================== + + * initial release diff --git a/node_modules/mquery/LICENSE b/node_modules/mquery/LICENSE new file mode 100644 index 000000000..38c529daa --- /dev/null +++ b/node_modules/mquery/LICENSE @@ -0,0 +1,22 @@ +(The MIT License) + +Copyright (c) 2012 [Aaron Heckmann](aaron.heckmann+github@gmail.com) + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/mquery/Makefile b/node_modules/mquery/Makefile new file mode 100644 index 000000000..587655db2 --- /dev/null +++ b/node_modules/mquery/Makefile @@ -0,0 +1,26 @@ + +test: + @NODE_ENV=test ./node_modules/.bin/mocha $(T) $(TESTS) + +test-cov: + @NODE_ENV=test node \ + node_modules/.bin/istanbul cover \ + ./node_modules/.bin/_mocha \ + -- -u exports \ + +open-cov: + open coverage/lcov-report/index.html + +lint: + @NODE_ENV=test node ./node_modules/eslint/bin/eslint.js . + +test-travis: + @NODE_ENV=test node \ + node_modules/.bin/istanbul cover \ + ./node_modules/.bin/_mocha \ + --report lcovonly \ + --bail + @NODE_ENV=test node \ + ./node_modules/eslint/bin/eslint.js . + +.PHONY: test test-cov open-cov lint test-travis diff --git a/node_modules/mquery/README.md b/node_modules/mquery/README.md new file mode 100644 index 000000000..8e2136969 --- /dev/null +++ b/node_modules/mquery/README.md @@ -0,0 +1,1373 @@ +# mquery + +`mquery` is a fluent mongodb query builder designed to run in multiple environments. + +[![Build Status](https://travis-ci.org/aheckmann/mquery.svg?branch=master)](https://travis-ci.org/aheckmann/mquery) +[![NPM version](https://badge.fury.io/js/mquery.svg)](http://badge.fury.io/js/mquery) + +[![npm](https://nodei.co/npm/mquery.png)](https://www.npmjs.com/package/mquery) + +## Features + + - fluent query builder api + - custom base query support + - MongoDB 2.4 geoJSON support + - method + option combinations validation + - node.js driver compatibility + - environment detection + - [debug](https://github.com/visionmedia/debug) support + - separated collection implementations for maximum flexibility + +## Use + +```js +require('mongodb').connect(uri, function (err, db) { + if (err) return handleError(err); + + // get a collection + var collection = db.collection('artists'); + + // pass it to the constructor + mquery(collection).find({..}, callback); + + // or pass it to the collection method + mquery().find({..}).collection(collection).exec(callback) + + // or better yet, create a custom query constructor that has it always set + var Artist = mquery(collection).toConstructor(); + Artist().find(..).where(..).exec(callback) +}) +``` + +`mquery` requires a collection object to work with. In the example above we just pass the collection object created using the official [MongoDB driver](https://github.com/mongodb/node-mongodb-native). + + +## Fluent API + +- [find](#find) +- [findOne](#findOne) +- [count](#count) +- [remove](#remove) +- [update](#update) +- [findOneAndUpdate](#findoneandupdate) +- [findOneAndDelete, findOneAndRemove](#findoneandremove) +- [distinct](#distinct) +- [exec](#exec) +- [stream](#stream) +- [all](#all) +- [and](#and) +- [box](#box) +- [circle](#circle) +- [elemMatch](#elemmatch) +- [equals](#equals) +- [exists](#exists) +- [geometry](#geometry) +- [gt](#gt) +- [gte](#gte) +- [in](#in) +- [intersects](#intersects) +- [lt](#lt) +- [lte](#lte) +- [maxDistance](#maxdistance) +- [mod](#mod) +- [ne](#ne) +- [nin](#nin) +- [nor](#nor) +- [near](#near) +- [or](#or) +- [polygon](#polygon) +- [regex](#regex) +- [select](#select) +- [selected](#selected) +- [selectedInclusively](#selectedinclusively) +- [selectedExclusively](#selectedexclusively) +- [size](#size) +- [slice](#slice) +- [within](#within) +- [where](#where) +- [$where](#where-1) +- [batchSize](#batchsize) +- [collation](#collation) +- [comment](#comment) +- [hint](#hint) +- [j](#j) +- [limit](#limit) +- [maxScan](#maxscan) +- [maxTime, maxTimeMS](#maxtime) +- [skip](#skip) +- [sort](#sort) +- [read, setReadPreference](#read) +- [readConcern, r](#readconcern) +- [slaveOk](#slaveok) +- [snapshot](#snapshot) +- [tailable](#tailable) +- [writeConcern, w](#writeconcern) +- [wtimeout, wTimeout](#wtimeout) + +## Helpers + +- [collection](#collection) +- [then](#then) +- [thunk](#thunk) +- [merge](#mergeobject) +- [setOptions](#setoptionsoptions) +- [setTraceFunction](#settracefunctionfunc) +- [mquery.setGlobalTraceFunction](#mquerysetglobaltracefunctionfunc) +- [mquery.canMerge](#mquerycanmerge) +- [mquery.use$geoWithin](#mqueryusegeowithin) + +### find() + +Declares this query a _find_ query. Optionally pass a match clause and / or callback. If a callback is passed the query is executed. + +```js +mquery().find() +mquery().find(match) +mquery().find(callback) +mquery().find(match, function (err, docs) { + assert(Array.isArray(docs)); +}) +``` + +### findOne() + +Declares this query a _findOne_ query. Optionally pass a match clause and / or callback. If a callback is passed the query is executed. + +```js +mquery().findOne() +mquery().findOne(match) +mquery().findOne(callback) +mquery().findOne(match, function (err, doc) { + if (doc) { + // the document may not be found + console.log(doc); + } +}) +``` + +### count() + +Declares this query a _count_ query. Optionally pass a match clause and / or callback. If a callback is passed the query is executed. + +```js +mquery().count() +mquery().count(match) +mquery().count(callback) +mquery().count(match, function (err, number){ + console.log('we found %d matching documents', number); +}) +``` + +### remove() + +Declares this query a _remove_ query. Optionally pass a match clause and / or callback. If a callback is passed the query is executed. + +```js +mquery().remove() +mquery().remove(match) +mquery().remove(callback) +mquery().remove(match, function (err){}) +``` + +### update() + +Declares this query an _update_ query. Optionally pass an update document, match clause, options or callback. If a callback is passed, the query is executed. To force execution without passing a callback, run `update(true)`. + +```js +mquery().update() +mquery().update(match, updateDocument) +mquery().update(match, updateDocument, options) + +// the following all execute the command +mquery().update(callback) +mquery().update({$set: updateDocument, callback) +mquery().update(match, updateDocument, callback) +mquery().update(match, updateDocument, options, function (err, result){}) +mquery().update(true) // executes (unsafe write) +``` + +##### the update document + +All paths passed that are not `$atomic` operations will become `$set` ops. For example: + +```js +mquery(collection).where({ _id: id }).update({ title: 'words' }, callback) +``` + +becomes + +```js +collection.update({ _id: id }, { $set: { title: 'words' }}, callback) +``` + +This behavior can be overridden using the `overwrite` option (see below). + +##### options + +Options are passed to the `setOptions()` method. + +- overwrite + +Passing an empty object `{ }` as the update document will result in a no-op unless the `overwrite` option is passed. Without the `overwrite` option, the update operation will be ignored and the callback executed without sending the command to MongoDB to prevent accidently overwritting documents in the collection. + +```js +var q = mquery(collection).where({ _id: id }).setOptions({ overwrite: true }); +q.update({ }, callback); // overwrite with an empty doc +``` + +The `overwrite` option isn't just for empty objects, it also provides a means to override the default `$set` conversion and send the update document as is. + +```js +// create a base query +var base = mquery({ _id: 108 }).collection(collection).toConstructor(); + +base().findOne(function (err, doc) { + console.log(doc); // { _id: 108, name: 'cajon' }) + + base().setOptions({ overwrite: true }).update({ changed: true }, function (err) { + base.findOne(function (err, doc) { + console.log(doc); // { _id: 108, changed: true }) - the doc was overwritten + }); + }); +}) +``` + +- multi + +Updates only modify a single document by default. To update multiple documents, set the `multi` option to `true`. + +```js +mquery() + .collection(coll) + .update({ name: /^match/ }, { $addToSet: { arr: 4 }}, { multi: true }, callback) + +// another way of doing it +mquery({ name: /^match/ }) + .collection(coll) + .setOptions({ multi: true }) + .update({ $addToSet: { arr: 4 }}, callback) + +// update multiple documents with an empty doc +var q = mquery(collection).where({ name: /^match/ }); +q.setOptions({ multi: true, overwrite: true }) +q.update({ }); +q.update(function (err, result) { + console.log(arguments); +}); +``` + +### findOneAndUpdate() + +Declares this query a _findAndModify_ with update query. Optionally pass a match clause, update document, options, or callback. If a callback is passed, the query is executed. + +When executed, the first matching document (if found) is modified according to the update document and passed back to the callback. + +##### options + +Options are passed to the `setOptions()` method. + +- `returnDocument`: string - `'after'` to return the modified document rather than the original. defaults to `'before'` +- `upsert`: boolean - creates the object if it doesn't exist. defaults to false +- `sort`: if multiple docs are found by the match condition, sets the sort order to choose which doc to update + +```js +query.findOneAndUpdate() +query.findOneAndUpdate(updateDocument) +query.findOneAndUpdate(match, updateDocument) +query.findOneAndUpdate(match, updateDocument, options) + +// the following all execute the command +query.findOneAndUpdate(callback) +query.findOneAndUpdate(updateDocument, callback) +query.findOneAndUpdate(match, updateDocument, callback) +query.findOneAndUpdate(match, updateDocument, options, function (err, doc) { + if (doc) { + // the document may not be found + console.log(doc); + } +}) + ``` + +### findOneAndRemove() + +Declares this query a _findAndModify_ with remove query. Alias of findOneAndDelete. +Optionally pass a match clause, options, or callback. If a callback is passed, the query is executed. + +When executed, the first matching document (if found) is modified according to the update document, removed from the collection and passed to the callback. + +##### options + +Options are passed to the `setOptions()` method. + +- `sort`: if multiple docs are found by the condition, sets the sort order to choose which doc to modify and remove + +```js +A.where().findOneAndDelete() +A.where().findOneAndRemove() +A.where().findOneAndRemove(match) +A.where().findOneAndRemove(match, options) + +// the following all execute the command +A.where().findOneAndRemove(callback) +A.where().findOneAndRemove(match, callback) +A.where().findOneAndRemove(match, options, function (err, doc) { + if (doc) { + // the document may not be found + console.log(doc); + } +}) + ``` + +### distinct() + +Declares this query a _distinct_ query. Optionally pass the distinct field, a match clause or callback. If a callback is passed the query is executed. + +```js +mquery().distinct() +mquery().distinct(match) +mquery().distinct(match, field) +mquery().distinct(field) + +// the following all execute the command +mquery().distinct(callback) +mquery().distinct(field, callback) +mquery().distinct(match, callback) +mquery().distinct(match, field, function (err, result) { + console.log(result); +}) +``` + +### exec() + +Executes the query. + +```js +mquery().findOne().where('route').intersects(polygon).exec(function (err, docs){}) +``` + +### stream() + +Executes the query and returns a stream. + +```js +var stream = mquery().find().stream(options); +stream.on('data', cb); +stream.on('close', fn); +``` + +Note: this only works with `find()` operations. + +Note: returns the stream object directly from the node-mongodb-native driver. (currently streams1 type stream). Any options will be passed along to the [driver method](http://mongodb.github.io/node-mongodb-native/api-generated/cursor.html#stream). + +------------- + +### all() + +Specifies an `$all` query condition + +```js +mquery().where('permission').all(['read', 'write']) +``` + +[MongoDB documentation](http://docs.mongodb.org/manual/reference/operator/all/) + +### and() + +Specifies arguments for an `$and` condition + +```js +mquery().and([{ color: 'green' }, { status: 'ok' }]) +``` + +[MongoDB documentation](http://docs.mongodb.org/manual/reference/operator/and/) + +### box() + +Specifies a `$box` condition + +```js +var lowerLeft = [40.73083, -73.99756] +var upperRight= [40.741404, -73.988135] + +mquery().where('location').within().box(lowerLeft, upperRight) +``` + +[MongoDB Documentation](http://docs.mongodb.org/manual/reference/operator/box/) + +### circle() + +Specifies a `$center` or `$centerSphere` condition. + +```js +var area = { center: [50, 50], radius: 10, unique: true } +query.where('loc').within().circle(area) +query.circle('loc', area); + +// for spherical calculations +var area = { center: [50, 50], radius: 10, unique: true, spherical: true } +query.where('loc').within().circle(area) +query.circle('loc', area); +``` + +- [MongoDB Documentation - center](http://docs.mongodb.org/manual/reference/operator/center/) +- [MongoDB Documentation - centerSphere](http://docs.mongodb.org/manual/reference/operator/centerSphere/) + +### elemMatch() + +Specifies an `$elemMatch` condition + +```js +query.where('comment').elemMatch({ author: 'autobot', votes: {$gte: 5}}) + +query.elemMatch('comment', function (elem) { + elem.where('author').equals('autobot'); + elem.where('votes').gte(5); +}) +``` + +[MongoDB Documentation](http://docs.mongodb.org/manual/reference/operator/elemMatch/) + +### equals() + +Specifies the complementary comparison value for the path specified with `where()`. + +```js +mquery().where('age').equals(49); + +// is the same as + +mquery().where({ 'age': 49 }); +``` + +### exists() + +Specifies an `$exists` condition + +```js +// { name: { $exists: true }} +mquery().where('name').exists() +mquery().where('name').exists(true) +mquery().exists('name') + +// { name: { $exists: false }} +mquery().where('name').exists(false); +mquery().exists('name', false); +``` + +[MongoDB Documentation](http://docs.mongodb.org/manual/reference/operator/exists/) + +### geometry() + +Specifies a `$geometry` condition + +```js +var polyA = [[[ 10, 20 ], [ 10, 40 ], [ 30, 40 ], [ 30, 20 ]]] +query.where('loc').within().geometry({ type: 'Polygon', coordinates: polyA }) + +// or +var polyB = [[ 0, 0 ], [ 1, 1 ]] +query.where('loc').within().geometry({ type: 'LineString', coordinates: polyB }) + +// or +var polyC = [ 0, 0 ] +query.where('loc').within().geometry({ type: 'Point', coordinates: polyC }) + +// or +query.where('loc').intersects().geometry({ type: 'Point', coordinates: polyC }) + +// or +query.where('loc').near().geometry({ type: 'Point', coordinates: [3,5] }) +``` + +`geometry()` **must** come after `intersects()`, `within()`, or `near()`. + +The `object` argument must contain `type` and `coordinates` properties. + +- type `String` +- coordinates `Array` + +[MongoDB Documentation](http://docs.mongodb.org/manual/reference/operator/geometry/) + +### gt() + +Specifies a `$gt` query condition. + +```js +mquery().where('clicks').gt(999) +``` + +[MongoDB Documentation](http://docs.mongodb.org/manual/reference/operator/gt/) + +### gte() + +Specifies a `$gte` query condition. + +[MongoDB Documentation](http://docs.mongodb.org/manual/reference/operator/gte/) + +```js +mquery().where('clicks').gte(1000) +``` + +### in() + +Specifies an `$in` query condition. + +```js +mquery().where('author_id').in([3, 48901, 761]) +``` + +[MongoDB Documentation](http://docs.mongodb.org/manual/reference/operator/in/) + +### intersects() + +Declares an `$geoIntersects` query for `geometry()`. + +```js +query.where('path').intersects().geometry({ + type: 'LineString' + , coordinates: [[180.0, 11.0], [180, 9.0]] +}) + +// geometry arguments are supported +query.where('path').intersects({ + type: 'LineString' + , coordinates: [[180.0, 11.0], [180, 9.0]] +}) +``` + +**Must** be used after `where()`. + +[MongoDB Documentation](http://docs.mongodb.org/manual/reference/operator/geoIntersects/) + +### lt() + +Specifies a `$lt` query condition. + +```js +mquery().where('clicks').lt(50) +``` + +[MongoDB Documentation](http://docs.mongodb.org/manual/reference/operator/lt/) + +### lte() + +Specifies a `$lte` query condition. + +```js +mquery().where('clicks').lte(49) +``` + +[MongoDB Documentation](http://docs.mongodb.org/manual/reference/operator/lte/) + +### maxDistance() + +Specifies a `$maxDistance` query condition. + +```js +mquery().where('location').near({ center: [139, 74.3] }).maxDistance(5) +``` + +[MongoDB Documentation](http://docs.mongodb.org/manual/reference/operator/maxDistance/) + +### mod() + +Specifies a `$mod` condition + +```js +mquery().where('count').mod(2, 0) +``` + +[MongoDB Documentation](http://docs.mongodb.org/manual/reference/operator/mod/) + +### ne() + +Specifies a `$ne` query condition. + +```js +mquery().where('status').ne('ok') +``` + +[MongoDB Documentation](http://docs.mongodb.org/manual/reference/operator/ne/) + +### nin() + +Specifies an `$nin` query condition. + +```js +mquery().where('author_id').nin([3, 48901, 761]) +``` + +[MongoDB Documentation](http://docs.mongodb.org/manual/reference/operator/nin/) + +### nor() + +Specifies arguments for an `$nor` condition. + +```js +mquery().nor([{ color: 'green' }, { status: 'ok' }]) +``` + +[MongoDB Documentation](http://docs.mongodb.org/manual/reference/operator/nor/) + +### near() + +Specifies arguments for a `$near` or `$nearSphere` condition. + +These operators return documents sorted by distance. + +#### Example + +```js +query.where('loc').near({ center: [10, 10] }); +query.where('loc').near({ center: [10, 10], maxDistance: 5 }); +query.near('loc', { center: [10, 10], maxDistance: 5 }); + +// GeoJSON +query.where('loc').near({ center: { type: 'Point', coordinates: [10, 10] }}); +query.where('loc').near({ center: { type: 'Point', coordinates: [10, 10] }, maxDistance: 5, spherical: true }); +query.where('loc').near().geometry({ type: 'Point', coordinates: [10, 10] }); + +// For a $nearSphere condition, pass the `spherical` option. +query.near({ center: [10, 10], maxDistance: 5, spherical: true }); +``` + +[MongoDB Documentation](http://www.mongodb.org/display/DOCS/Geospatial+Indexing) + +### or() + +Specifies arguments for an `$or` condition. + +```js +mquery().or([{ color: 'red' }, { status: 'emergency' }]) +``` + +[MongoDB Documentation](http://docs.mongodb.org/manual/reference/operator/or/) + +### polygon() + +Specifies a `$polygon` condition + +```js +mquery().where('loc').within().polygon([10,20], [13, 25], [7,15]) +mquery().polygon('loc', [10,20], [13, 25], [7,15]) +``` + +[MongoDB Documentation](http://docs.mongodb.org/manual/reference/operator/polygon/) + +### regex() + +Specifies a `$regex` query condition. + +```js +mquery().where('name').regex(/^sixstepsrecords/) +``` + +[MongoDB Documentation](http://docs.mongodb.org/manual/reference/operator/regex/) + +### select() + +Specifies which document fields to include or exclude + +```js +// 1 means include, 0 means exclude +mquery().select({ name: 1, address: 1, _id: 0 }) + +// or + +mquery().select('name address -_id') +``` + +##### String syntax + +When passing a string, prefixing a path with `-` will flag that path as excluded. When a path does not have the `-` prefix, it is included. + +```js +// include a and b, exclude c +query.select('a b -c'); + +// or you may use object notation, useful when +// you have keys already prefixed with a "-" +query.select({a: 1, b: 1, c: 0}); +``` + +_Cannot be used with `distinct()`._ + +### selected() + +Determines if the query has selected any fields. + +```js +var query = mquery(); +query.selected() // false +query.select('-name'); +query.selected() // true +``` + +### selectedInclusively() + +Determines if the query has selected any fields inclusively. + +```js +var query = mquery().select('name'); +query.selectedInclusively() // true + +var query = mquery(); +query.selected() // false +query.select('-name'); +query.selectedInclusively() // false +query.selectedExclusively() // true +``` + +### selectedExclusively() + +Determines if the query has selected any fields exclusively. + +```js +var query = mquery().select('-name'); +query.selectedExclusively() // true + +var query = mquery(); +query.selected() // false +query.select('name'); +query.selectedExclusively() // false +query.selectedInclusively() // true +``` + +### size() + +Specifies a `$size` query condition. + +```js +mquery().where('someArray').size(6) +``` + +[MongoDB Documentation](http://docs.mongodb.org/manual/reference/operator/size/) + +### slice() + +Specifies a `$slice` projection for a `path` + +```js +mquery().where('comments').slice(5) +mquery().where('comments').slice(-5) +mquery().where('comments').slice([-10, 5]) +``` + +[MongoDB Documentation](http://docs.mongodb.org/manual/reference/projection/slice/) + +### within() + +Sets a `$geoWithin` or `$within` argument for geo-spatial queries. + +```js +mquery().within().box() +mquery().within().circle() +mquery().within().geometry() + +mquery().where('loc').within({ center: [50,50], radius: 10, unique: true, spherical: true }); +mquery().where('loc').within({ box: [[40.73, -73.9], [40.7, -73.988]] }); +mquery().where('loc').within({ polygon: [[],[],[],[]] }); + +mquery().where('loc').within([], [], []) // polygon +mquery().where('loc').within([], []) // box +mquery().where('loc').within({ type: 'LineString', coordinates: [...] }); // geometry +``` + +As of mquery 2.0, `$geoWithin` is used by default. This impacts you if running MongoDB < 2.4. To alter this behavior, see [mquery.use$geoWithin](#mqueryusegeowithin). + +**Must** be used after `where()`. + +[MongoDB Documentation](http://docs.mongodb.org/manual/reference/operator/geoWithin/) + +### where() + +Specifies a `path` for use with chaining + +```js +// instead of writing: +mquery().find({age: {$gte: 21, $lte: 65}}); + +// we can instead write: +mquery().where('age').gte(21).lte(65); + +// passing query conditions is permitted too +mquery().find().where({ name: 'vonderful' }) + +// chaining +mquery() +.where('age').gte(21).lte(65) +.where({ 'name': /^vonderful/i }) +.where('friends').slice(10) +.exec(callback) +``` + +### $where() + +Specifies a `$where` condition. + +Use `$where` when you need to select documents using a JavaScript expression. + +```js +query.$where('this.comments.length > 10 || this.name.length > 5').exec(callback) + +query.$where(function () { + return this.comments.length > 10 || this.name.length > 5; +}) +``` + +Only use `$where` when you have a condition that cannot be met using other MongoDB operators like `$lt`. Be sure to read about all of [its caveats](http://docs.mongodb.org/manual/reference/operator/where/) before using. + +----------- + +### batchSize() + +Specifies the batchSize option. + +```js +query.batchSize(100) +``` + +_Cannot be used with `distinct()`._ + +[MongoDB documentation](http://docs.mongodb.org/manual/reference/method/cursor.batchSize/) + +### collation() + +Specifies the collation option. + +```js +query.collation({ locale: "en_US", strength: 1 }) +``` + +[MongoDB documentation](https://docs.mongodb.com/manual/reference/method/cursor.collation/#cursor.collation) + +### comment() + +Specifies the comment option. + +```js +query.comment('login query'); +``` + +_Cannot be used with `distinct()`._ + +[MongoDB documentation](http://docs.mongodb.org/manual/reference/operator/) + +### hint() + +Sets query hints. + +```js +mquery().hint({ indexA: 1, indexB: -1 }) +``` + +_Cannot be used with `distinct()`._ + +[MongoDB documentation](http://docs.mongodb.org/manual/reference/operator/hint/) + +### j() + +Requests acknowledgement that this operation has been persisted to MongoDB's on-disk journal. + +This option is only valid for operations that write to the database: + +- `deleteOne()` +- `deleteMany()` +- `findOneAndDelete()` +- `findOneAndUpdate()` +- `remove()` +- `update()` +- `updateOne()` +- `updateMany()` + +Defaults to the `j` value if it is specified in [writeConcern](#writeconcern) + +```js +mquery().j(true); +``` + +### limit() + +Specifies the limit option. + +```js +query.limit(20) +``` + +_Cannot be used with `distinct()`._ + +[MongoDB documentation](http://docs.mongodb.org/manual/reference/method/cursor.limit/) + +### maxScan() + +Specifies the maxScan option. + +```js +query.maxScan(100) +``` + +_Cannot be used with `distinct()`._ + +[MongoDB documentation](http://docs.mongodb.org/manual/reference/operator/maxScan/) + +### maxTime() + +Specifies the maxTimeMS option. + +```js +query.maxTime(100) +query.maxTimeMS(100) +``` + +[MongoDB documentation](http://docs.mongodb.org/manual/reference/method/cursor.maxTimeMS/) + + +### skip() + +Specifies the skip option. + +```js +query.skip(100).limit(20) +``` + +_Cannot be used with `distinct()`._ + +[MongoDB documentation](http://docs.mongodb.org/manual/reference/method/cursor.skip/) + +### sort() + +Sets the query sort order. + +If an object is passed, key values allowed are `asc`, `desc`, `ascending`, `descending`, `1`, and `-1`. + +If a string is passed, it must be a space delimited list of path names. The sort order of each path is ascending unless the path name is prefixed with `-` which will be treated as descending. + +```js +// these are equivalent +query.sort({ field: 'asc', test: -1 }); +query.sort('field -test'); +``` + +_Cannot be used with `distinct()`._ + +[MongoDB documentation](http://docs.mongodb.org/manual/reference/method/cursor.sort/) + +### read() + +Sets the readPreference option for the query. + +```js +mquery().read('primary') +mquery().read('p') // same as primary + +mquery().read('primaryPreferred') +mquery().read('pp') // same as primaryPreferred + +mquery().read('secondary') +mquery().read('s') // same as secondary + +mquery().read('secondaryPreferred') +mquery().read('sp') // same as secondaryPreferred + +mquery().read('nearest') +mquery().read('n') // same as nearest + +mquery().setReadPreference('primary') // alias of .read() +``` + +##### Preferences: + +- `primary` - (default) Read from primary only. Operations will produce an error if primary is unavailable. Cannot be combined with tags. +- `secondary` - Read from secondary if available, otherwise error. +- `primaryPreferred` - Read from primary if available, otherwise a secondary. +- `secondaryPreferred` - Read from a secondary if available, otherwise read from the primary. +- `nearest` - All operations read from among the nearest candidates, but unlike other modes, this option will include both the primary and all secondaries in the random selection. + +Aliases + +- `p` primary +- `pp` primaryPreferred +- `s` secondary +- `sp` secondaryPreferred +- `n` nearest + +##### Preference Tags: + +To keep the separation of concerns between `mquery` and your driver +clean, `mquery#read()` no longer handles specifying a second `tags` argument as of version 0.5. +If you need to specify tags, pass any non-string argument as the first argument. +`mquery` will pass this argument untouched to your collections methods later. +For example: + +```js +// example of specifying tags using the Node.js driver +var ReadPref = require('mongodb').ReadPreference; +var preference = new ReadPref('secondary', [{ dc:'sf', s: 1 },{ dc:'ma', s: 2 }]); +mquery(..).read(preference).exec(); +``` + +Read more about how to use read preferences [here](http://docs.mongodb.org/manual/applications/replication/#read-preference) and [here](http://mongodb.github.com/node-mongodb-native/driver-articles/anintroductionto1_1and2_2.html#read-preferences). + + +### readConcern() + +Sets the readConcern option for the query. + +```js +// local +mquery().readConcern('local') +mquery().readConcern('l') +mquery().r('l') + +// available +mquery().readConcern('available') +mquery().readConcern('a') +mquery().r('a') + +// majority +mquery().readConcern('majority') +mquery().readConcern('m') +mquery().r('m') + +// linearizable +mquery().readConcern('linearizable') +mquery().readConcern('lz') +mquery().r('lz') + +// snapshot +mquery().readConcern('snapshot') +mquery().readConcern('s') +mquery().r('s') +``` + +##### Read Concern Level: + +- `local` - The query returns from the instance with no guarantee guarantee that the data has been written to a majority of the replica set members (i.e. may be rolled back). (MongoDB 3.2+) +- `available` - The query returns from the instance with no guarantee guarantee that the data has been written to a majority of the replica set members (i.e. may be rolled back). (MongoDB 3.6+) +- `majority` - The query returns the data that has been acknowledged by a majority of the replica set members. The documents returned by the read operation are durable, even in the event of failure. (MongoDB 3.2+) +- `linearizable` - The query returns data that reflects all successful majority-acknowledged writes that completed prior to the start of the read operation. The query may wait for concurrently executing writes to propagate to a majority of replica set members before returning results. (MongoDB 3.4+) +- `snapshot` - Only available for operations within multi-document transactions. Upon transaction commit with write concern "majority", the transaction operations are guaranteed to have read from a snapshot of majority-committed data. (MongoDB 4.0+) + +Aliases + +- `l` local +- `a` available +- `m` majority +- `lz` linearizable +- `s` snapshot + +Read more about how to use read concern [here](https://docs.mongodb.com/manual/reference/read-concern/). + +### writeConcern() + +Sets the writeConcern option for the query. + +This option is only valid for operations that write to the database: + +- `deleteOne()` +- `deleteMany()` +- `findOneAndDelete()` +- `findOneAndUpdate()` +- `remove()` +- `update()` +- `updateOne()` +- `updateMany()` + +```js +mquery().writeConcern(0) +mquery().writeConcern(1) +mquery().writeConcern({ w: 1, j: true, wtimeout: 2000 }) +mquery().writeConcern('majority') +mquery().writeConcern('m') // same as majority +mquery().writeConcern('tagSetName') // if the tag set is 'm', use .writeConcern({ w: 'm' }) instead +mquery().w(1) // w is alias of writeConcern +``` + +##### Write Concern: + +writeConcern({ w: ``, j: ``, wtimeout: `` }`) + +- the w option to request acknowledgement that the write operation has propagated to a specified number of mongod instances or to mongod instances with specified tags +- the j option to request acknowledgement that the write operation has been written to the journal +- the wtimeout option to specify a time limit to prevent write operations from blocking indefinitely + +Can be break down to use the following syntax: + +mquery().w(``).j(``).wtimeout(``) + +Read more about how to use write concern [here](https://docs.mongodb.com/manual/reference/write-concern/) + +### slaveOk() + +Sets the slaveOk option. `true` allows reading from secondaries. + +**deprecated** use [read()](#read) preferences instead if on mongodb >= 2.2 + +```js +query.slaveOk() // true +query.slaveOk(true) +query.slaveOk(false) +``` + +[MongoDB documentation](http://docs.mongodb.org/manual/reference/method/rs.slaveOk/) + +### snapshot() + +Specifies this query as a snapshot query. + +```js +mquery().snapshot() // true +mquery().snapshot(true) +mquery().snapshot(false) +``` + +_Cannot be used with `distinct()`._ + +[MongoDB documentation](http://docs.mongodb.org/manual/reference/operator/snapshot/) + +### tailable() + +Sets tailable option. + +```js +mquery().tailable() <== true +mquery().tailable(true) +mquery().tailable(false) +``` + +_Cannot be used with `distinct()`._ + +[MongoDB Documentation](http://docs.mongodb.org/manual/tutorial/create-tailable-cursor/) + +### wtimeout() + +Specifies a time limit, in milliseconds, for the write concern. If `w > 1`, it is maximum amount of time to +wait for this write to propagate through the replica set before this operation fails. The default is `0`, which means no timeout. + +This option is only valid for operations that write to the database: + +- `deleteOne()` +- `deleteMany()` +- `findOneAndDelete()` +- `findOneAndUpdate()` +- `remove()` +- `update()` +- `updateOne()` +- `updateMany()` + +Defaults to `wtimeout` value if it is specified in [writeConcern](#writeconcern) + +```js +mquery().wtimeout(2000) +mquery().wTimeout(2000) +``` + +## Helpers + +### collection() + +Sets the querys collection. + +```js +mquery().collection(aCollection) +``` + +### then() + +Executes the query and returns a promise which will be resolved with the query results or rejected if the query responds with an error. + +```js +mquery().find(..).then(success, error); +``` + +This is very useful when combined with [co](https://github.com/visionmedia/co) or [koa](https://github.com/koajs/koa), which automatically resolve promise-like objects for you. + +```js +co(function*(){ + var doc = yield mquery().findOne({ _id: 499 }); + console.log(doc); // { _id: 499, name: 'amazing', .. } +})(); +``` + +_NOTE_: +The returned promise is a [bluebird](https://github.com/petkaantonov/bluebird/) promise but this is customizable. If you want to +use your favorite promise library, simply set `mquery.Promise = YourPromiseConstructor`. +Your `Promise` must be [promises A+](http://promisesaplus.com/) compliant. + +### thunk() + +Returns a thunk which when called runs the query's `exec` method passing the results to the callback. + +```js +var thunk = mquery(collection).find({..}).thunk(); + +thunk(function(err, results) { + +}) +``` + +### merge(object) + +Merges other mquery or match condition objects into this one. When an mquery instance is passed, its match conditions, field selection and options are merged. + +```js +var drum = mquery({ type: 'drum' }).collection(instruments); +var redDrum = mquery({ color: 'red' }).merge(drum); +redDrum.count(function (err, n) { + console.log('there are %d red drums', n); +}) +``` + +Internally uses `mquery.canMerge` to determine validity. + +### setOptions(options) + +Sets query options. + +```js +mquery().setOptions({ collection: coll, limit: 20 }) +``` + +##### options + +- [tailable](#tailable) * +- [sort](#sort) * +- [limit](#limit) * +- [skip](#skip) * +- [maxScan](#maxscan) * +- [maxTime](#maxtime) * +- [batchSize](#batchSize) * +- [comment](#comment) * +- [snapshot](#snapshot) * +- [hint](#hint) * +- [collection](#collection): the collection to query against + +_* denotes a query helper method is also available_ + +### setTraceFunction(func) + +Set a function to trace this query. Useful for profiling or logging. + +```js +function traceFunction (method, queryInfo, query) { + console.log('starting ' + method + ' query'); + + return function (err, result, millis) { + console.log('finished ' + method + ' query in ' + millis + 'ms'); + }; +} + +mquery().setTraceFunction(traceFunction).findOne({name: 'Joe'}, cb); +``` + +The trace function is passed (method, queryInfo, query) + +- method is the name of the method being called (e.g. findOne) +- queryInfo contains information about the query: + - conditions: query conditions/criteria + - options: options such as sort, fields, etc + - doc: document being updated +- query is the query object + +The trace function should return a callback function which accepts: +- err: error, if any +- result: result, if any +- millis: time spent waiting for query result + +NOTE: stream requests are not traced. + +### mquery.setGlobalTraceFunction(func) + +Similar to `setTraceFunction()` but automatically applied to all queries. + +```js +mquery.setTraceFunction(traceFunction); +``` + +### mquery.canMerge(conditions) + +Determines if `conditions` can be merged using `mquery().merge()`. + +```js +var query = mquery({ type: 'drum' }); +var okToMerge = mquery.canMerge(anObject) +if (okToMerge) { + query.merge(anObject); +} +``` + +## mquery.use$geoWithin + +MongoDB 2.4 introduced the `$geoWithin` operator which replaces and is 100% backward compatible with `$within`. As of mquery 0.2, we default to using `$geoWithin` for all `within()` calls. + +If you are running MongoDB < 2.4 this will be problematic. To force `mquery` to be backward compatible and always use `$within`, set the `mquery.use$geoWithin` flag to `false`. + +```js +mquery.use$geoWithin = false; +``` + +## Custom Base Queries + +Often times we want custom base queries that encapsulate predefined criteria. With `mquery` this is easy. First create the query you want to reuse and call its `toConstructor()` method which returns a new subclass of `mquery` that retains all options and criteria of the original. + +```js +var greatMovies = mquery(movieCollection).where('rating').gte(4.5).toConstructor(); + +// use it! +greatMovies().count(function (err, n) { + console.log('There are %d great movies', n); +}); + +greatMovies().where({ name: /^Life/ }).select('name').find(function (err, docs) { + console.log(docs); +}); +``` + +## Validation + +Method and options combinations are checked for validity at runtime to prevent creation of invalid query constructs. For example, a `distinct` query does not support specifying options like `hint` or field selection. In this case an error will be thrown so you can catch these mistakes in development. + +## Debug support + +Debug mode is provided through the use of the [debug](https://github.com/visionmedia/debug) module. To enable: + + DEBUG=mquery node yourprogram.js + +Read the debug module documentation for more details. + +## General compatibility + +#### ObjectIds + +`mquery` clones query arguments before passing them to a `collection` method for execution. +This prevents accidental side-affects to the objects you pass. +To clone `ObjectIds` we need to make some assumptions. + +First, to check if an object is an `ObjectId`, we check its constructors name. If it matches either +`ObjectId` or `ObjectID` we clone it. + +To clone `ObjectIds`, we call its optional `clone` method. If a `clone` method does not exist, we fall +back to calling `new obj.constructor(obj.id)`. We assume, for compatibility with the +Node.js driver, that the `ObjectId` instance has a public `id` property and that +when creating an `ObjectId` instance we can pass that `id` as an argument. + +#### Read Preferences + +`mquery` supports specifying [Read Preferences]() to control from which MongoDB node your query will read. +The Read Preferences spec also support specifying tags. To pass tags, some +drivers (Node.js driver) require passing a special constructor that handles both the read preference and its tags. +If you need to specify tags, pass an instance of your drivers ReadPreference constructor or roll your own. `mquery` will store whatever you provide and pass later to your collection during execution. + +## Future goals + + - mongo shell compatibility + - browser compatibility + +## Installation + + $ npm install mquery + +## License + +[MIT](https://github.com/aheckmann/mquery/blob/master/LICENSE) + diff --git a/node_modules/mquery/SECURITY.md b/node_modules/mquery/SECURITY.md new file mode 100644 index 000000000..41b89d834 --- /dev/null +++ b/node_modules/mquery/SECURITY.md @@ -0,0 +1 @@ +Please follow the instructions on [Tidelift's security page](https://tidelift.com/docs/security) to report a security issue. diff --git a/node_modules/mquery/lib/collection/collection.js b/node_modules/mquery/lib/collection/collection.js new file mode 100644 index 000000000..28b69828a --- /dev/null +++ b/node_modules/mquery/lib/collection/collection.js @@ -0,0 +1,47 @@ +'use strict'; + +/** + * methods a collection must implement + */ + +const methods = [ + 'find', + 'findOne', + 'update', + 'updateMany', + 'updateOne', + 'replaceOne', + 'remove', + 'count', + 'distinct', + 'findOneAndDelete', + 'findOneAndUpdate', + 'aggregate', + 'findCursor', + 'deleteOne', + 'deleteMany' +]; + +/** + * Collection base class from which implementations inherit + */ + +function Collection() {} + +for (let i = 0, len = methods.length; i < len; ++i) { + const method = methods[i]; + Collection.prototype[method] = notImplemented(method); +} + +module.exports = exports = Collection; +Collection.methods = methods; + +/** + * creates a function which throws an implementation error + */ + +function notImplemented(method) { + return function() { + throw new Error('collection.' + method + ' not implemented'); + }; +} diff --git a/node_modules/mquery/lib/collection/index.js b/node_modules/mquery/lib/collection/index.js new file mode 100644 index 000000000..4faa03220 --- /dev/null +++ b/node_modules/mquery/lib/collection/index.js @@ -0,0 +1,13 @@ +'use strict'; + +const env = require('../env'); + +if ('unknown' == env.type) { + throw new Error('Unknown environment'); +} + +module.exports = + env.isNode ? require('./node') : + env.isMongo ? require('./collection') : + require('./collection'); + diff --git a/node_modules/mquery/lib/collection/node.js b/node_modules/mquery/lib/collection/node.js new file mode 100644 index 000000000..c84e416c6 --- /dev/null +++ b/node_modules/mquery/lib/collection/node.js @@ -0,0 +1,132 @@ +'use strict'; + +/** + * Module dependencies + */ + +const Collection = require('./collection'); + +class NodeCollection extends Collection { + constructor(col) { + super(); + + this.collection = col; + this.collectionName = col.collectionName; + } + + /** + * find(match, options, function(err, docs)) + */ + find(match, options, cb) { + const cursor = this.collection.find(match, options); + + try { + cursor.toArray(cb); + } catch (error) { + cb(error); + } + } + + /** + * findOne(match, options, function(err, doc)) + */ + findOne(match, options, cb) { + this.collection.findOne(match, options, cb); + } + + /** + * count(match, options, function(err, count)) + */ + count(match, options, cb) { + this.collection.count(match, options, cb); + } + + /** + * distinct(prop, match, options, function(err, count)) + */ + distinct(prop, match, options, cb) { + this.collection.distinct(prop, match, options, cb); + } + + /** + * update(match, update, options, function(err[, result])) + */ + update(match, update, options, cb) { + this.collection.update(match, update, options, cb); + } + + /** + * update(match, update, options, function(err[, result])) + */ + updateMany(match, update, options, cb) { + this.collection.updateMany(match, update, options, cb); + } + + /** + * update(match, update, options, function(err[, result])) + */ + updateOne(match, update, options, cb) { + this.collection.updateOne(match, update, options, cb); + } + + /** + * replaceOne(match, update, options, function(err[, result])) + */ + replaceOne(match, update, options, cb) { + this.collection.replaceOne(match, update, options, cb); + } + + /** + * deleteOne(match, options, function(err[, result]) + */ + deleteOne(match, options, cb) { + this.collection.deleteOne(match, options, cb); + } + + /** + * deleteMany(match, options, function(err[, result]) + */ + deleteMany(match, options, cb) { + this.collection.deleteMany(match, options, cb); + } + + /** + * remove(match, options, function(err[, result]) + */ + remove(match, options, cb) { + this.collection.remove(match, options, cb); + } + + /** + * findOneAndDelete(match, options, function(err[, result]) + */ + findOneAndDelete(match, options, cb) { + this.collection.findOneAndDelete(match, options, cb); + } + + /** + * findOneAndUpdate(match, update, options, function(err[, result]) + */ + findOneAndUpdate(match, update, options, cb) { + this.collection.findOneAndUpdate(match, update, options, cb); + } + + /** + * var cursor = findCursor(match, options) + */ + findCursor(match, options) { + return this.collection.find(match, options); + } + + /** + * aggregation(operators..., function(err, doc)) + * TODO + */ +} + + +/** + * Expose + */ + +module.exports = exports = NodeCollection; diff --git a/node_modules/mquery/lib/env.js b/node_modules/mquery/lib/env.js new file mode 100644 index 000000000..d3d225b7c --- /dev/null +++ b/node_modules/mquery/lib/env.js @@ -0,0 +1,22 @@ +'use strict'; + +exports.isNode = 'undefined' != typeof process + && 'object' == typeof module + && 'object' == typeof global + && 'function' == typeof Buffer + && process.argv; + +exports.isMongo = !exports.isNode + && 'function' == typeof printjson + && 'function' == typeof ObjectId + && 'function' == typeof rs + && 'function' == typeof sh; + +exports.isBrowser = !exports.isNode + && !exports.isMongo + && 'undefined' != typeof window; + +exports.type = exports.isNode ? 'node' + : exports.isMongo ? 'mongo' + : exports.isBrowser ? 'browser' + : 'unknown'; diff --git a/node_modules/mquery/lib/mquery.js b/node_modules/mquery/lib/mquery.js new file mode 100644 index 000000000..722ba3644 --- /dev/null +++ b/node_modules/mquery/lib/mquery.js @@ -0,0 +1,3198 @@ +'use strict'; + +/** + * Dependencies + */ + +const assert = require('assert'); +const util = require('util'); +const utils = require('./utils'); +const debug = require('debug')('mquery'); + +/** + * Query constructor used for building queries. + * + * ####Example: + * + * var query = new Query({ name: 'mquery' }); + * query.setOptions({ collection: moduleCollection }) + * query.where('age').gte(21).exec(callback); + * + * @param {Object} [criteria] + * @param {Object} [options] + * @api public + */ + +function Query(criteria, options) { + if (!(this instanceof Query)) + return new Query(criteria, options); + + const proto = this.constructor.prototype; + + this.op = proto.op || undefined; + + this.options = Object.assign({}, proto.options); + + this._conditions = proto._conditions + ? utils.clone(proto._conditions) + : {}; + + this._fields = proto._fields + ? utils.clone(proto._fields) + : undefined; + + this._update = proto._update + ? utils.clone(proto._update) + : undefined; + + this._path = proto._path || undefined; + this._distinct = proto._distinct || undefined; + this._collection = proto._collection || undefined; + this._traceFunction = proto._traceFunction || undefined; + + if (options) { + this.setOptions(options); + } + + if (criteria) { + if (criteria.find && criteria.remove && criteria.update) { + // quack quack! + this.collection(criteria); + } else { + this.find(criteria); + } + } +} + +/** + * This is a parameter that the user can set which determines if mquery + * uses $within or $geoWithin for queries. It defaults to true which + * means $geoWithin will be used. If using MongoDB < 2.4 you should + * set this to false. + * + * @api public + * @property use$geoWithin + */ + +let $withinCmd = '$geoWithin'; +Object.defineProperty(Query, 'use$geoWithin', { + get: function() { return $withinCmd == '$geoWithin'; }, + set: function(v) { + if (true === v) { + // mongodb >= 2.4 + $withinCmd = '$geoWithin'; + } else { + $withinCmd = '$within'; + } + } +}); + +/** + * Converts this query to a constructor function with all arguments and options retained. + * + * ####Example + * + * // Create a query that will read documents with a "video" category from + * // `aCollection` on the primary node in the replica-set unless it is down, + * // in which case we'll read from a secondary node. + * var query = mquery({ category: 'video' }) + * query.setOptions({ collection: aCollection, read: 'primaryPreferred' }); + * + * // create a constructor based off these settings + * var Video = query.toConstructor(); + * + * // Video is now a subclass of mquery() and works the same way but with the + * // default query parameters and options set. + * + * // run a query with the previous settings but filter for movies with names + * // that start with "Life". + * Video().where({ name: /^Life/ }).exec(cb); + * + * @return {Query} new Query + * @api public + */ + +Query.prototype.toConstructor = function toConstructor() { + function CustomQuery(criteria, options) { + if (!(this instanceof CustomQuery)) + return new CustomQuery(criteria, options); + Query.call(this, criteria, options); + } + + utils.inherits(CustomQuery, Query); + + // set inherited defaults + const p = CustomQuery.prototype; + + p.options = {}; + p.setOptions(this.options); + + p.op = this.op; + p._conditions = utils.clone(this._conditions); + p._fields = utils.clone(this._fields); + p._update = utils.clone(this._update); + p._path = this._path; + p._distinct = this._distinct; + p._collection = this._collection; + p._traceFunction = this._traceFunction; + + return CustomQuery; +}; + +/** + * Sets query options. + * + * ####Options: + * + * - [tailable](http://www.mongodb.org/display/DOCS/Tailable+Cursors) * + * - [sort](http://www.mongodb.org/display/DOCS/Advanced+Queries#AdvancedQueries-%7B%7Bsort(\)%7D%7D) * + * - [limit](http://www.mongodb.org/display/DOCS/Advanced+Queries#AdvancedQueries-%7B%7Blimit%28%29%7D%7D) * + * - [skip](http://www.mongodb.org/display/DOCS/Advanced+Queries#AdvancedQueries-%7B%7Bskip%28%29%7D%7D) * + * - [maxScan](http://www.mongodb.org/display/DOCS/Advanced+Queries#AdvancedQueries-%24maxScan) * + * - [maxTime](http://docs.mongodb.org/manual/reference/operator/meta/maxTimeMS/#op._S_maxTimeMS) * + * - [batchSize](http://www.mongodb.org/display/DOCS/Advanced+Queries#AdvancedQueries-%7B%7BbatchSize%28%29%7D%7D) * + * - [comment](http://www.mongodb.org/display/DOCS/Advanced+Queries#AdvancedQueries-%24comment) * + * - [snapshot](http://www.mongodb.org/display/DOCS/Advanced+Queries#AdvancedQueries-%7B%7Bsnapshot%28%29%7D%7D) * + * - [hint](http://www.mongodb.org/display/DOCS/Advanced+Queries#AdvancedQueries-%24hint) * + * - [slaveOk](http://docs.mongodb.org/manual/applications/replication/#read-preference) * + * - [safe](http://www.mongodb.org/display/DOCS/getLastError+Command) + * - collection the collection to query against + * + * _* denotes a query helper method is also available_ + * + * @param {Object} options + * @api public + */ + +Query.prototype.setOptions = function(options) { + if (!(options && utils.isObject(options))) + return this; + + // set arbitrary options + const methods = utils.keys(options); + let method; + + for (let i = 0; i < methods.length; ++i) { + method = methods[i]; + + // use methods if exist (safer option manipulation) + if ('function' == typeof this[method]) { + const args = Array.isArray(options[method]) + ? options[method] + : [options[method]]; + this[method].apply(this, args); + } else { + this.options[method] = options[method]; + } + } + + return this; +}; + +/** + * Sets this Querys collection. + * + * @param {Collection} coll + * @return {Query} this + */ + +Query.prototype.collection = function collection(coll) { + this._collection = new Query.Collection(coll); + + return this; +}; + +/** + * Adds a collation to this op (MongoDB 3.4 and up) + * + * ####Example + * + * query.find().collation({ locale: "en_US", strength: 1 }) + * + * @param {Object} value + * @return {Query} this + * @see MongoDB docs https://docs.mongodb.com/manual/reference/method/cursor.collation/#cursor.collation + * @api public + */ + +Query.prototype.collation = function(value) { + this.options.collation = value; + return this; +}; + +/** + * Specifies a `$where` condition + * + * Use `$where` when you need to select documents using a JavaScript expression. + * + * ####Example + * + * query.$where('this.comments.length > 10 || this.name.length > 5') + * + * query.$where(function () { + * return this.comments.length > 10 || this.name.length > 5; + * }) + * + * @param {String|Function} js javascript string or function + * @return {Query} this + * @memberOf Query + * @method $where + * @api public + */ + +Query.prototype.$where = function(js) { + this._conditions.$where = js; + return this; +}; + +/** + * Specifies a `path` for use with chaining. + * + * ####Example + * + * // instead of writing: + * User.find({age: {$gte: 21, $lte: 65}}, callback); + * + * // we can instead write: + * User.where('age').gte(21).lte(65); + * + * // passing query conditions is permitted + * User.find().where({ name: 'vonderful' }) + * + * // chaining + * User + * .where('age').gte(21).lte(65) + * .where('name', /^vonderful/i) + * .where('friends').slice(10) + * .exec(callback) + * + * @param {String} [path] + * @param {Object} [val] + * @return {Query} this + * @api public + */ + +Query.prototype.where = function() { + if (!arguments.length) return this; + if (!this.op) this.op = 'find'; + + const type = typeof arguments[0]; + + if ('string' == type) { + this._path = arguments[0]; + + if (2 === arguments.length) { + this._conditions[this._path] = arguments[1]; + } + + return this; + } + + if ('object' == type && !Array.isArray(arguments[0])) { + return this.merge(arguments[0]); + } + + throw new TypeError('path must be a string or object'); +}; + +/** + * Specifies the complementary comparison value for paths specified with `where()` + * + * ####Example + * + * User.where('age').equals(49); + * + * // is the same as + * + * User.where('age', 49); + * + * @param {Object} val + * @return {Query} this + * @api public + */ + +Query.prototype.equals = function equals(val) { + this._ensurePath('equals'); + const path = this._path; + this._conditions[path] = val; + return this; +}; + +/** + * Specifies the complementary comparison value for paths specified with `where()` + * This is alias of `equals` + * + * ####Example + * + * User.where('age').eq(49); + * + * // is the same as + * + * User.shere('age').equals(49); + * + * // is the same as + * + * User.where('age', 49); + * + * @param {Object} val + * @return {Query} this + * @api public + */ + +Query.prototype.eq = function eq(val) { + this._ensurePath('eq'); + const path = this._path; + this._conditions[path] = val; + return this; +}; + +/** + * Specifies arguments for an `$or` condition. + * + * ####Example + * + * query.or([{ color: 'red' }, { status: 'emergency' }]) + * + * @param {Array} array array of conditions + * @return {Query} this + * @api public + */ + +Query.prototype.or = function or(array) { + const or = this._conditions.$or || (this._conditions.$or = []); + if (!Array.isArray(array)) array = [array]; + or.push.apply(or, array); + return this; +}; + +/** + * Specifies arguments for a `$nor` condition. + * + * ####Example + * + * query.nor([{ color: 'green' }, { status: 'ok' }]) + * + * @param {Array} array array of conditions + * @return {Query} this + * @api public + */ + +Query.prototype.nor = function nor(array) { + const nor = this._conditions.$nor || (this._conditions.$nor = []); + if (!Array.isArray(array)) array = [array]; + nor.push.apply(nor, array); + return this; +}; + +/** + * Specifies arguments for a `$and` condition. + * + * ####Example + * + * query.and([{ color: 'green' }, { status: 'ok' }]) + * + * @see $and http://docs.mongodb.org/manual/reference/operator/and/ + * @param {Array} array array of conditions + * @return {Query} this + * @api public + */ + +Query.prototype.and = function and(array) { + const and = this._conditions.$and || (this._conditions.$and = []); + if (!Array.isArray(array)) array = [array]; + and.push.apply(and, array); + return this; +}; + +/** + * Specifies a $gt query condition. + * + * When called with one argument, the most recent path passed to `where()` is used. + * + * ####Example + * + * Thing.find().where('age').gt(21) + * + * // or + * Thing.find().gt('age', 21) + * + * @method gt + * @memberOf Query + * @param {String} [path] + * @param {Number} val + * @api public + */ + +/** + * Specifies a $gte query condition. + * + * When called with one argument, the most recent path passed to `where()` is used. + * + * @method gte + * @memberOf Query + * @param {String} [path] + * @param {Number} val + * @api public + */ + +/** + * Specifies a $lt query condition. + * + * When called with one argument, the most recent path passed to `where()` is used. + * + * @method lt + * @memberOf Query + * @param {String} [path] + * @param {Number} val + * @api public + */ + +/** + * Specifies a $lte query condition. + * + * When called with one argument, the most recent path passed to `where()` is used. + * + * @method lte + * @memberOf Query + * @param {String} [path] + * @param {Number} val + * @api public + */ + +/** + * Specifies a $ne query condition. + * + * When called with one argument, the most recent path passed to `where()` is used. + * + * @method ne + * @memberOf Query + * @param {String} [path] + * @param {Number} val + * @api public + */ + +/** + * Specifies an $in query condition. + * + * When called with one argument, the most recent path passed to `where()` is used. + * + * @method in + * @memberOf Query + * @param {String} [path] + * @param {Number} val + * @api public + */ + +/** + * Specifies an $nin query condition. + * + * When called with one argument, the most recent path passed to `where()` is used. + * + * @method nin + * @memberOf Query + * @param {String} [path] + * @param {Number} val + * @api public + */ + +/** + * Specifies an $all query condition. + * + * When called with one argument, the most recent path passed to `where()` is used. + * + * @method all + * @memberOf Query + * @param {String} [path] + * @param {Number} val + * @api public + */ + +/** + * Specifies a $size query condition. + * + * When called with one argument, the most recent path passed to `where()` is used. + * + * @method size + * @memberOf Query + * @param {String} [path] + * @param {Number} val + * @api public + */ + +/** + * Specifies a $regex query condition. + * + * When called with one argument, the most recent path passed to `where()` is used. + * + * @method regex + * @memberOf Query + * @param {String} [path] + * @param {String|RegExp} val + * @api public + */ + +/** + * Specifies a $maxDistance query condition. + * + * When called with one argument, the most recent path passed to `where()` is used. + * + * @method maxDistance + * @memberOf Query + * @param {String} [path] + * @param {Number} val + * @api public + */ + +/*! + * gt, gte, lt, lte, ne, in, nin, all, regex, size, maxDistance + * + * Thing.where('type').nin(array) + */ + +'gt gte lt lte ne in nin all regex size maxDistance minDistance'.split(' ').forEach(function($conditional) { + Query.prototype[$conditional] = function() { + let path, val; + + if (1 === arguments.length) { + this._ensurePath($conditional); + val = arguments[0]; + path = this._path; + } else { + val = arguments[1]; + path = arguments[0]; + } + + const conds = this._conditions[path] === null || typeof this._conditions[path] === 'object' ? + this._conditions[path] : + (this._conditions[path] = {}); + conds['$' + $conditional] = val; + return this; + }; +}); + +/** + * Specifies a `$mod` condition + * + * @param {String} [path] + * @param {Number} val + * @return {Query} this + * @api public + */ + +Query.prototype.mod = function() { + let val, path; + + if (1 === arguments.length) { + this._ensurePath('mod'); + val = arguments[0]; + path = this._path; + } else if (2 === arguments.length && !Array.isArray(arguments[1])) { + this._ensurePath('mod'); + val = [arguments[0], arguments[1]]; + path = this._path; + } else if (3 === arguments.length) { + val = [arguments[1], arguments[2]]; + path = arguments[0]; + } else { + val = arguments[1]; + path = arguments[0]; + } + + const conds = this._conditions[path] || (this._conditions[path] = {}); + conds.$mod = val; + return this; +}; + +/** + * Specifies an `$exists` condition + * + * ####Example + * + * // { name: { $exists: true }} + * Thing.where('name').exists() + * Thing.where('name').exists(true) + * Thing.find().exists('name') + * + * // { name: { $exists: false }} + * Thing.where('name').exists(false); + * Thing.find().exists('name', false); + * + * @param {String} [path] + * @param {Number} val + * @return {Query} this + * @api public + */ + +Query.prototype.exists = function() { + let path, val; + + if (0 === arguments.length) { + this._ensurePath('exists'); + path = this._path; + val = true; + } else if (1 === arguments.length) { + if ('boolean' === typeof arguments[0]) { + this._ensurePath('exists'); + path = this._path; + val = arguments[0]; + } else { + path = arguments[0]; + val = true; + } + } else if (2 === arguments.length) { + path = arguments[0]; + val = arguments[1]; + } + + const conds = this._conditions[path] || (this._conditions[path] = {}); + conds.$exists = val; + return this; +}; + +/** + * Specifies an `$elemMatch` condition + * + * ####Example + * + * query.elemMatch('comment', { author: 'autobot', votes: {$gte: 5}}) + * + * query.where('comment').elemMatch({ author: 'autobot', votes: {$gte: 5}}) + * + * query.elemMatch('comment', function (elem) { + * elem.where('author').equals('autobot'); + * elem.where('votes').gte(5); + * }) + * + * query.where('comment').elemMatch(function (elem) { + * elem.where({ author: 'autobot' }); + * elem.where('votes').gte(5); + * }) + * + * @param {String|Object|Function} path + * @param {Object|Function} criteria + * @return {Query} this + * @api public + */ + +Query.prototype.elemMatch = function() { + if (null == arguments[0]) + throw new TypeError('Invalid argument'); + + let fn, path, criteria; + + if ('function' === typeof arguments[0]) { + this._ensurePath('elemMatch'); + path = this._path; + fn = arguments[0]; + } else if (utils.isObject(arguments[0])) { + this._ensurePath('elemMatch'); + path = this._path; + criteria = arguments[0]; + } else if ('function' === typeof arguments[1]) { + path = arguments[0]; + fn = arguments[1]; + } else if (arguments[1] && utils.isObject(arguments[1])) { + path = arguments[0]; + criteria = arguments[1]; + } else { + throw new TypeError('Invalid argument'); + } + + if (fn) { + criteria = new Query; + fn(criteria); + criteria = criteria._conditions; + } + + const conds = this._conditions[path] || (this._conditions[path] = {}); + conds.$elemMatch = criteria; + return this; +}; + +// Spatial queries + +/** + * Sugar for geo-spatial queries. + * + * ####Example + * + * query.within().box() + * query.within().circle() + * query.within().geometry() + * + * query.where('loc').within({ center: [50,50], radius: 10, unique: true, spherical: true }); + * query.where('loc').within({ box: [[40.73, -73.9], [40.7, -73.988]] }); + * query.where('loc').within({ polygon: [[],[],[],[]] }); + * + * query.where('loc').within([], [], []) // polygon + * query.where('loc').within([], []) // box + * query.where('loc').within({ type: 'LineString', coordinates: [...] }); // geometry + * + * ####NOTE: + * + * Must be used after `where()`. + * + * @memberOf Query + * @return {Query} this + * @api public + */ + +Query.prototype.within = function within() { + // opinionated, must be used after where + this._ensurePath('within'); + this._geoComparison = $withinCmd; + + if (0 === arguments.length) { + return this; + } + + if (2 === arguments.length) { + return this.box.apply(this, arguments); + } else if (2 < arguments.length) { + return this.polygon.apply(this, arguments); + } + + const area = arguments[0]; + + if (!area) + throw new TypeError('Invalid argument'); + + if (area.center) + return this.circle(area); + + if (area.box) + return this.box.apply(this, area.box); + + if (area.polygon) + return this.polygon.apply(this, area.polygon); + + if (area.type && area.coordinates) + return this.geometry(area); + + throw new TypeError('Invalid argument'); +}; + +/** + * Specifies a $box condition + * + * ####Example + * + * var lowerLeft = [40.73083, -73.99756] + * var upperRight= [40.741404, -73.988135] + * + * query.where('loc').within().box(lowerLeft, upperRight) + * query.box('loc', lowerLeft, upperRight ) + * + * @see http://www.mongodb.org/display/DOCS/Geospatial+Indexing + * @see Query#within #query_Query-within + * @param {String} path + * @param {Object} val + * @return {Query} this + * @api public + */ + +Query.prototype.box = function() { + let path, box; + + if (3 === arguments.length) { + // box('loc', [], []) + path = arguments[0]; + box = [arguments[1], arguments[2]]; + } else if (2 === arguments.length) { + // box([], []) + this._ensurePath('box'); + path = this._path; + box = [arguments[0], arguments[1]]; + } else { + throw new TypeError('Invalid argument'); + } + + const conds = this._conditions[path] || (this._conditions[path] = {}); + conds[this._geoComparison || $withinCmd] = { $box: box }; + return this; +}; + +/** + * Specifies a $polygon condition + * + * ####Example + * + * query.where('loc').within().polygon([10,20], [13, 25], [7,15]) + * query.polygon('loc', [10,20], [13, 25], [7,15]) + * + * @param {String|Array} [path] + * @param {Array|Object} [val] + * @return {Query} this + * @see http://www.mongodb.org/display/DOCS/Geospatial+Indexing + * @api public + */ + +Query.prototype.polygon = function() { + let val, path; + + if ('string' == typeof arguments[0]) { + // polygon('loc', [],[],[]) + val = Array.from(arguments); + path = val.shift(); + } else { + // polygon([],[],[]) + this._ensurePath('polygon'); + path = this._path; + val = Array.from(arguments); + } + + const conds = this._conditions[path] || (this._conditions[path] = {}); + conds[this._geoComparison || $withinCmd] = { $polygon: val }; + return this; +}; + +/** + * Specifies a $center or $centerSphere condition. + * + * ####Example + * + * var area = { center: [50, 50], radius: 10, unique: true } + * query.where('loc').within().circle(area) + * query.center('loc', area); + * + * // for spherical calculations + * var area = { center: [50, 50], radius: 10, unique: true, spherical: true } + * query.where('loc').within().circle(area) + * query.center('loc', area); + * + * @param {String} [path] + * @param {Object} area + * @return {Query} this + * @see http://www.mongodb.org/display/DOCS/Geospatial+Indexing + * @api public + */ + +Query.prototype.circle = function() { + let path, val; + + if (1 === arguments.length) { + this._ensurePath('circle'); + path = this._path; + val = arguments[0]; + } else if (2 === arguments.length) { + path = arguments[0]; + val = arguments[1]; + } else { + throw new TypeError('Invalid argument'); + } + + if (!('radius' in val && val.center)) + throw new Error('center and radius are required'); + + const conds = this._conditions[path] || (this._conditions[path] = {}); + + const type = val.spherical + ? '$centerSphere' + : '$center'; + + const wKey = this._geoComparison || $withinCmd; + conds[wKey] = {}; + conds[wKey][type] = [val.center, val.radius]; + + if ('unique' in val) + conds[wKey].$uniqueDocs = !!val.unique; + + return this; +}; + +/** + * Specifies a `$near` or `$nearSphere` condition + * + * These operators return documents sorted by distance. + * + * ####Example + * + * query.where('loc').near({ center: [10, 10] }); + * query.where('loc').near({ center: [10, 10], maxDistance: 5 }); + * query.where('loc').near({ center: [10, 10], maxDistance: 5, spherical: true }); + * query.near('loc', { center: [10, 10], maxDistance: 5 }); + * query.near({ center: { type: 'Point', coordinates: [..] }}) + * query.near().geometry({ type: 'Point', coordinates: [..] }) + * + * @param {String} [path] + * @param {Object} val + * @return {Query} this + * @see http://www.mongodb.org/display/DOCS/Geospatial+Indexing + * @api public + */ + +Query.prototype.near = function near() { + let path, val; + + this._geoComparison = '$near'; + + if (0 === arguments.length) { + return this; + } else if (1 === arguments.length) { + this._ensurePath('near'); + path = this._path; + val = arguments[0]; + } else if (2 === arguments.length) { + path = arguments[0]; + val = arguments[1]; + } else { + throw new TypeError('Invalid argument'); + } + + if (!val.center) { + throw new Error('center is required'); + } + + const conds = this._conditions[path] || (this._conditions[path] = {}); + + const type = val.spherical + ? '$nearSphere' + : '$near'; + + // center could be a GeoJSON object or an Array + if (Array.isArray(val.center)) { + conds[type] = val.center; + + const radius = 'maxDistance' in val + ? val.maxDistance + : null; + + if (null != radius) { + conds.$maxDistance = radius; + } + if (null != val.minDistance) { + conds.$minDistance = val.minDistance; + } + } else { + // GeoJSON? + if (val.center.type != 'Point' || !Array.isArray(val.center.coordinates)) { + throw new Error(util.format('Invalid GeoJSON specified for %s', type)); + } + conds[type] = { $geometry: val.center }; + + // MongoDB 2.6 insists on maxDistance being in $near / $nearSphere + if ('maxDistance' in val) { + conds[type]['$maxDistance'] = val.maxDistance; + } + if ('minDistance' in val) { + conds[type]['$minDistance'] = val.minDistance; + } + } + + return this; +}; + +/** + * Declares an intersects query for `geometry()`. + * + * ####Example + * + * query.where('path').intersects().geometry({ + * type: 'LineString' + * , coordinates: [[180.0, 11.0], [180, 9.0]] + * }) + * + * query.where('path').intersects({ + * type: 'LineString' + * , coordinates: [[180.0, 11.0], [180, 9.0]] + * }) + * + * @param {Object} [arg] + * @return {Query} this + * @api public + */ + +Query.prototype.intersects = function intersects() { + // opinionated, must be used after where + this._ensurePath('intersects'); + + this._geoComparison = '$geoIntersects'; + + if (0 === arguments.length) { + return this; + } + + const area = arguments[0]; + + if (null != area && area.type && area.coordinates) + return this.geometry(area); + + throw new TypeError('Invalid argument'); +}; + +/** + * Specifies a `$geometry` condition + * + * ####Example + * + * var polyA = [[[ 10, 20 ], [ 10, 40 ], [ 30, 40 ], [ 30, 20 ]]] + * query.where('loc').within().geometry({ type: 'Polygon', coordinates: polyA }) + * + * // or + * var polyB = [[ 0, 0 ], [ 1, 1 ]] + * query.where('loc').within().geometry({ type: 'LineString', coordinates: polyB }) + * + * // or + * var polyC = [ 0, 0 ] + * query.where('loc').within().geometry({ type: 'Point', coordinates: polyC }) + * + * // or + * query.where('loc').intersects().geometry({ type: 'Point', coordinates: polyC }) + * + * ####NOTE: + * + * `geometry()` **must** come after either `intersects()` or `within()`. + * + * The `object` argument must contain `type` and `coordinates` properties. + * - type {String} + * - coordinates {Array} + * + * The most recent path passed to `where()` is used. + * + * @param {Object} object Must contain a `type` property which is a String and a `coordinates` property which is an Array. See the examples. + * @return {Query} this + * @see http://docs.mongodb.org/manual/release-notes/2.4/#new-geospatial-indexes-with-geojson-and-improved-spherical-geometry + * @see http://www.mongodb.org/display/DOCS/Geospatial+Indexing + * @see $geometry http://docs.mongodb.org/manual/reference/operator/geometry/ + * @api public + */ + +Query.prototype.geometry = function geometry() { + if (!('$within' == this._geoComparison || + '$geoWithin' == this._geoComparison || + '$near' == this._geoComparison || + '$geoIntersects' == this._geoComparison)) { + throw new Error('geometry() must come after `within()`, `intersects()`, or `near()'); + } + + let val, path; + + if (1 === arguments.length) { + this._ensurePath('geometry'); + path = this._path; + val = arguments[0]; + } else { + throw new TypeError('Invalid argument'); + } + + if (!(val.type && Array.isArray(val.coordinates))) { + throw new TypeError('Invalid argument'); + } + + const conds = this._conditions[path] || (this._conditions[path] = {}); + conds[this._geoComparison] = { $geometry: val }; + + return this; +}; + +// end spatial + +/** + * Specifies which document fields to include or exclude + * + * ####String syntax + * + * When passing a string, prefixing a path with `-` will flag that path as excluded. When a path does not have the `-` prefix, it is included. + * + * ####Example + * + * // include a and b, exclude c + * query.select('a b -c'); + * + * // or you may use object notation, useful when + * // you have keys already prefixed with a "-" + * query.select({a: 1, b: 1, c: 0}); + * + * ####Note + * + * Cannot be used with `distinct()` + * + * @param {Object|String} arg + * @return {Query} this + * @see SchemaType + * @api public + */ + +Query.prototype.select = function select() { + let arg = arguments[0]; + if (!arg) return this; + + if (arguments.length !== 1) { + throw new Error('Invalid select: select only takes 1 argument'); + } + + this._validate('select'); + + const fields = this._fields || (this._fields = {}); + const type = typeof arg; + let i, len; + + if (('string' == type || utils.isArgumentsObject(arg)) && + 'number' == typeof arg.length || Array.isArray(arg)) { + if ('string' == type) + arg = arg.split(/\s+/); + + for (i = 0, len = arg.length; i < len; ++i) { + let field = arg[i]; + if (!field) continue; + const include = '-' == field[0] ? 0 : 1; + if (include === 0) field = field.substring(1); + fields[field] = include; + } + + return this; + } + + if (utils.isObject(arg)) { + const keys = utils.keys(arg); + for (i = 0; i < keys.length; ++i) { + fields[keys[i]] = arg[keys[i]]; + } + return this; + } + + throw new TypeError('Invalid select() argument. Must be string or object.'); +}; + +/** + * Specifies a $slice condition for a `path` + * + * ####Example + * + * query.slice('comments', 5) + * query.slice('comments', -5) + * query.slice('comments', [10, 5]) + * query.where('comments').slice(5) + * query.where('comments').slice([-10, 5]) + * + * @param {String} [path] + * @param {Number} val number/range of elements to slice + * @return {Query} this + * @see mongodb http://www.mongodb.org/display/DOCS/Retrieving+a+Subset+of+Fields#RetrievingaSubsetofFields-RetrievingaSubrangeofArrayElements + * @api public + */ + +Query.prototype.slice = function() { + if (0 === arguments.length) + return this; + + this._validate('slice'); + + let path, val; + + if (1 === arguments.length) { + const arg = arguments[0]; + if (typeof arg === 'object' && !Array.isArray(arg)) { + const keys = Object.keys(arg); + const numKeys = keys.length; + for (let i = 0; i < numKeys; ++i) { + this.slice(keys[i], arg[keys[i]]); + } + return this; + } + this._ensurePath('slice'); + path = this._path; + val = arguments[0]; + } else if (2 === arguments.length) { + if ('number' === typeof arguments[0]) { + this._ensurePath('slice'); + path = this._path; + val = [arguments[0], arguments[1]]; + } else { + path = arguments[0]; + val = arguments[1]; + } + } else if (3 === arguments.length) { + path = arguments[0]; + val = [arguments[1], arguments[2]]; + } + + const myFields = this._fields || (this._fields = {}); + myFields[path] = { $slice: val }; + return this; +}; + +/** + * Sets the sort order + * + * If an object is passed, values allowed are 'asc', 'desc', 'ascending', 'descending', 1, and -1. + * + * If a string is passed, it must be a space delimited list of path names. The sort order of each path is ascending unless the path name is prefixed with `-` which will be treated as descending. + * + * ####Example + * + * // these are equivalent + * query.sort({ field: 'asc', test: -1 }); + * query.sort('field -test'); + * query.sort([['field', 1], ['test', -1]]); + * + * ####Note + * + * - The array syntax `.sort([['field', 1], ['test', -1]])` can only be used with [mongodb driver >= 2.0.46](https://github.com/mongodb/node-mongodb-native/blob/2.1/HISTORY.md#2046-2015-10-15). + * - Cannot be used with `distinct()` + * + * @param {Object|String|Array} arg + * @return {Query} this + * @api public + */ + +Query.prototype.sort = function(arg) { + if (!arg) return this; + let i, len, field; + + this._validate('sort'); + + const type = typeof arg; + + // .sort([['field', 1], ['test', -1]]) + if (Array.isArray(arg)) { + len = arg.length; + for (i = 0; i < arg.length; ++i) { + if (!Array.isArray(arg[i])) { + throw new Error('Invalid sort() argument, must be array of arrays'); + } + _pushArr(this.options, arg[i][0], arg[i][1]); + } + return this; + } + + // .sort('field -test') + if (1 === arguments.length && 'string' == type) { + arg = arg.split(/\s+/); + len = arg.length; + for (i = 0; i < len; ++i) { + field = arg[i]; + if (!field) continue; + const ascend = '-' == field[0] ? -1 : 1; + if (ascend === -1) field = field.substring(1); + push(this.options, field, ascend); + } + + return this; + } + + // .sort({ field: 1, test: -1 }) + if (utils.isObject(arg)) { + const keys = utils.keys(arg); + for (i = 0; i < keys.length; ++i) { + field = keys[i]; + push(this.options, field, arg[field]); + } + + return this; + } + + if (typeof Map !== 'undefined' && arg instanceof Map) { + _pushMap(this.options, arg); + return this; + } + throw new TypeError('Invalid sort() argument. Must be a string, object, or array.'); +}; + +/*! + * @ignore + */ + +const _validSortValue = { + 1: 1, + '-1': -1, + asc: 1, + ascending: 1, + desc: -1, + descending: -1 +}; + +function push(opts, field, value) { + if (Array.isArray(opts.sort)) { + throw new TypeError('Can\'t mix sort syntaxes. Use either array or object:' + + '\n- `.sort([[\'field\', 1], [\'test\', -1]])`' + + '\n- `.sort({ field: 1, test: -1 })`'); + } + + let s; + if (value && value.$meta) { + s = opts.sort || (opts.sort = {}); + s[field] = { $meta: value.$meta }; + return; + } + + s = opts.sort || (opts.sort = {}); + let val = String(value || 1).toLowerCase(); + val = _validSortValue[val]; + if (!val) throw new TypeError('Invalid sort value: { ' + field + ': ' + value + ' }'); + + s[field] = val; +} + +function _pushArr(opts, field, value) { + opts.sort = opts.sort || []; + if (!Array.isArray(opts.sort)) { + throw new TypeError('Can\'t mix sort syntaxes. Use either array or object:' + + '\n- `.sort([[\'field\', 1], [\'test\', -1]])`' + + '\n- `.sort({ field: 1, test: -1 })`'); + } + + let val = String(value || 1).toLowerCase(); + val = _validSortValue[val]; + if (!val) throw new TypeError('Invalid sort value: [ ' + field + ', ' + value + ' ]'); + + opts.sort.push([field, val]); +} + +function _pushMap(opts, map) { + opts.sort = opts.sort || new Map(); + if (!(opts.sort instanceof Map)) { + throw new TypeError('Can\'t mix sort syntaxes. Use either array or ' + + 'object or map consistently'); + } + map.forEach(function(value, key) { + let val = String(value || 1).toLowerCase(); + val = _validSortValue[val]; + if (!val) throw new TypeError('Invalid sort value: < ' + key + ': ' + value + ' >'); + + opts.sort.set(key, val); + }); +} + + + +/** + * Specifies the limit option. + * + * ####Example + * + * query.limit(20) + * + * ####Note + * + * Cannot be used with `distinct()` + * + * @method limit + * @memberOf Query + * @param {Number} val + * @see mongodb http://www.mongodb.org/display/DOCS/Advanced+Queries#AdvancedQueries-%7B%7Blimit%28%29%7D%7D + * @api public + */ +/** + * Specifies the skip option. + * + * ####Example + * + * query.skip(100).limit(20) + * + * ####Note + * + * Cannot be used with `distinct()` + * + * @method skip + * @memberOf Query + * @param {Number} val + * @see mongodb http://www.mongodb.org/display/DOCS/Advanced+Queries#AdvancedQueries-%7B%7Bskip%28%29%7D%7D + * @api public + */ +/** + * Specifies the maxScan option. + * + * ####Example + * + * query.maxScan(100) + * + * ####Note + * + * Cannot be used with `distinct()` + * + * @method maxScan + * @memberOf Query + * @param {Number} val + * @see mongodb http://www.mongodb.org/display/DOCS/Advanced+Queries#AdvancedQueries-%24maxScan + * @api public + */ +/** + * Specifies the batchSize option. + * + * ####Example + * + * query.batchSize(100) + * + * ####Note + * + * Cannot be used with `distinct()` + * + * @method batchSize + * @memberOf Query + * @param {Number} val + * @see mongodb http://www.mongodb.org/display/DOCS/Advanced+Queries#AdvancedQueries-%7B%7BbatchSize%28%29%7D%7D + * @api public + */ +/** + * Specifies the `comment` option. + * + * ####Example + * + * query.comment('login query') + * + * ####Note + * + * Cannot be used with `distinct()` + * + * @method comment + * @memberOf Query + * @param {Number} val + * @see mongodb http://www.mongodb.org/display/DOCS/Advanced+Queries#AdvancedQueries-%24comment + * @api public + */ + +/*! + * limit, skip, maxScan, batchSize, comment + * + * Sets these associated options. + * + * query.comment('feed query'); + */ + +['limit', 'skip', 'maxScan', 'batchSize', 'comment'].forEach(function(method) { + Query.prototype[method] = function(v) { + this._validate(method); + this.options[method] = v; + return this; + }; +}); + +/** + * Specifies the maxTimeMS option. + * + * ####Example + * + * query.maxTime(100) + * query.maxTimeMS(100) + * + * @method maxTime + * @memberOf Query + * @param {Number} ms + * @see mongodb http://docs.mongodb.org/manual/reference/operator/meta/maxTimeMS/#op._S_maxTimeMS + * @api public + */ + +Query.prototype.maxTime = Query.prototype.maxTimeMS = function(ms) { + this._validate('maxTime'); + this.options.maxTimeMS = ms; + return this; +}; + +/** + * Specifies this query as a `snapshot` query. + * + * ####Example + * + * mquery().snapshot() // true + * mquery().snapshot(true) + * mquery().snapshot(false) + * + * ####Note + * + * Cannot be used with `distinct()` + * + * @see mongodb http://www.mongodb.org/display/DOCS/Advanced+Queries#AdvancedQueries-%7B%7Bsnapshot%28%29%7D%7D + * @return {Query} this + * @api public + */ + +Query.prototype.snapshot = function() { + this._validate('snapshot'); + + this.options.snapshot = arguments.length + ? !!arguments[0] + : true; + + return this; +}; + +/** + * Sets query hints. + * + * ####Example + * + * query.hint({ indexA: 1, indexB: -1}); + * query.hint('indexA_1_indexB_1'); + * + * ####Note + * + * Cannot be used with `distinct()` + * + * @param {Object|string} val a hint object or the index name + * @return {Query} this + * @see mongodb http://www.mongodb.org/display/DOCS/Advanced+Queries#AdvancedQueries-%24hint + * @api public + */ + +Query.prototype.hint = function() { + if (0 === arguments.length) return this; + + this._validate('hint'); + + const arg = arguments[0]; + if (utils.isObject(arg)) { + const hint = this.options.hint || (this.options.hint = {}); + + // must keep object keys in order so don't use Object.keys() + for (const k in arg) { + hint[k] = arg[k]; + } + + return this; + } + if (typeof arg === 'string') { + this.options.hint = arg; + return this; + } + + throw new TypeError('Invalid hint. ' + arg); +}; + +/** + * Requests acknowledgement that this operation has been persisted to MongoDB's + * on-disk journal. + * This option is only valid for operations that write to the database: + * + * - `deleteOne()` + * - `deleteMany()` + * - `findOneAndDelete()` + * - `findOneAndUpdate()` + * - `remove()` + * - `update()` + * - `updateOne()` + * - `updateMany()` + * + * Defaults to the `j` value if it is specified in writeConcern options + * + * ####Example: + * + * mquery().w(2).j(true).wtimeout(2000); + * + * @method j + * @memberOf Query + * @instance + * @param {boolean} val + * @see mongodb https://docs.mongodb.com/manual/reference/write-concern/#j-option + * @return {Query} this + * @api public + */ + +Query.prototype.j = function j(val) { + this.options.j = val; + return this; +}; + +/** + * Sets the slaveOk option. _Deprecated_ in MongoDB 2.2 in favor of read preferences. + * + * ####Example: + * + * query.slaveOk() // true + * query.slaveOk(true) + * query.slaveOk(false) + * + * @deprecated use read() preferences instead if on mongodb >= 2.2 + * @param {Boolean} v defaults to true + * @see mongodb http://docs.mongodb.org/manual/applications/replication/#read-preference + * @see read() + * @return {Query} this + * @api public + */ + +Query.prototype.slaveOk = function(v) { + this.options.slaveOk = arguments.length ? !!v : true; + return this; +}; + +/** + * Sets the readPreference option for the query. + * + * ####Example: + * + * new Query().read('primary') + * new Query().read('p') // same as primary + * + * new Query().read('primaryPreferred') + * new Query().read('pp') // same as primaryPreferred + * + * new Query().read('secondary') + * new Query().read('s') // same as secondary + * + * new Query().read('secondaryPreferred') + * new Query().read('sp') // same as secondaryPreferred + * + * new Query().read('nearest') + * new Query().read('n') // same as nearest + * + * // you can also use mongodb.ReadPreference class to also specify tags + * new Query().read(mongodb.ReadPreference('secondary', [{ dc:'sf', s: 1 },{ dc:'ma', s: 2 }])) + * + * new Query().setReadPreference('primary') // alias of .read() + * + * ####Preferences: + * + * primary - (default) Read from primary only. Operations will produce an error if primary is unavailable. Cannot be combined with tags. + * secondary Read from secondary if available, otherwise error. + * primaryPreferred Read from primary if available, otherwise a secondary. + * secondaryPreferred Read from a secondary if available, otherwise read from the primary. + * nearest All operations read from among the nearest candidates, but unlike other modes, this option will include both the primary and all secondaries in the random selection. + * + * Aliases + * + * p primary + * pp primaryPreferred + * s secondary + * sp secondaryPreferred + * n nearest + * + * Read more about how to use read preferences [here](http://docs.mongodb.org/manual/applications/replication/#read-preference) and [here](http://mongodb.github.com/node-mongodb-native/driver-articles/anintroductionto1_1and2_2.html#read-preferences). + * + * @param {String|ReadPreference} pref one of the listed preference options or their aliases + * @see mongodb http://docs.mongodb.org/manual/applications/replication/#read-preference + * @see driver http://mongodb.github.com/node-mongodb-native/driver-articles/anintroductionto1_1and2_2.html#read-preferences + * @return {Query} this + * @api public + */ + +Query.prototype.read = Query.prototype.setReadPreference = function(pref) { + if (arguments.length > 1 && !Query.prototype.read.deprecationWarningIssued) { + console.error('Deprecation warning: \'tags\' argument is not supported anymore in Query.read() method. Please use mongodb.ReadPreference object instead.'); + Query.prototype.read.deprecationWarningIssued = true; + } + this.options.readPreference = utils.readPref(pref); + return this; +}; + +/** + * Sets the readConcern option for the query. + * + * ####Example: + * + * new Query().readConcern('local') + * new Query().readConcern('l') // same as local + * + * new Query().readConcern('available') + * new Query().readConcern('a') // same as available + * + * new Query().readConcern('majority') + * new Query().readConcern('m') // same as majority + * + * new Query().readConcern('linearizable') + * new Query().readConcern('lz') // same as linearizable + * + * new Query().readConcern('snapshot') + * new Query().readConcern('s') // same as snapshot + * + * new Query().r('s') // r is alias of readConcern + * + * + * ####Read Concern Level: + * + * local MongoDB 3.2+ The query returns from the instance with no guarantee guarantee that the data has been written to a majority of the replica set members (i.e. may be rolled back). + * available MongoDB 3.6+ The query returns from the instance with no guarantee guarantee that the data has been written to a majority of the replica set members (i.e. may be rolled back). + * majority MongoDB 3.2+ The query returns the data that has been acknowledged by a majority of the replica set members. The documents returned by the read operation are durable, even in the event of failure. + * linearizable MongoDB 3.4+ The query returns data that reflects all successful majority-acknowledged writes that completed prior to the start of the read operation. The query may wait for concurrently executing writes to propagate to a majority of replica set members before returning results. + * snapshot MongoDB 4.0+ Only available for operations within multi-document transactions. Upon transaction commit with write concern "majority", the transaction operations are guaranteed to have read from a snapshot of majority-committed data. + + + * + * + * Aliases + * + * l local + * a available + * m majority + * lz linearizable + * s snapshot + * + * Read more about how to use read concern [here](https://docs.mongodb.com/manual/reference/read-concern/). + * + * @param {String} level one of the listed read concern level or their aliases + * @see mongodb https://docs.mongodb.com/manual/reference/read-concern/ + * @return {Query} this + * @api public + */ + +Query.prototype.readConcern = Query.prototype.r = function(level) { + this.options.readConcern = utils.readConcern(level); + return this; +}; + +/** + * Sets tailable option. + * + * ####Example + * + * query.tailable() <== true + * query.tailable(true) + * query.tailable(false) + * + * ####Note + * + * Cannot be used with `distinct()` + * + * @param {Boolean} v defaults to true + * @see mongodb http://www.mongodb.org/display/DOCS/Tailable+Cursors + * @api public + */ + +Query.prototype.tailable = function() { + this._validate('tailable'); + + this.options.tailable = arguments.length + ? !!arguments[0] + : true; + + return this; +}; + +/** + * Sets the specified number of `mongod` servers, or tag set of `mongod` servers, + * that must acknowledge this write before this write is considered successful. + * This option is only valid for operations that write to the database: + * + * - `deleteOne()` + * - `deleteMany()` + * - `findOneAndDelete()` + * - `findOneAndUpdate()` + * - `remove()` + * - `update()` + * - `updateOne()` + * - `updateMany()` + * + * Defaults to the `w` value if it is specified in writeConcern options + * + * ####Example: + * + * mquery().writeConcern(0) + * mquery().writeConcern(1) + * mquery().writeConcern({ w: 1, j: true, wtimeout: 2000 }) + * mquery().writeConcern('majority') + * mquery().writeConcern('m') // same as majority + * mquery().writeConcern('tagSetName') // if the tag set is 'm', use .writeConcern({ w: 'm' }) instead + * mquery().w(1) // w is alias of writeConcern + * + * @method writeConcern + * @memberOf Query + * @instance + * @param {String|number|object} concern 0 for fire-and-forget, 1 for acknowledged by one server, 'majority' for majority of the replica set, or [any of the more advanced options](https://docs.mongodb.com/manual/reference/write-concern/#w-option). + * @see mongodb https://docs.mongodb.com/manual/reference/write-concern/#w-option + * @return {Query} this + * @api public + */ + +Query.prototype.writeConcern = Query.prototype.w = function writeConcern(concern) { + if ('object' === typeof concern) { + if ('undefined' !== typeof concern.j) this.options.j = concern.j; + if ('undefined' !== typeof concern.w) this.options.w = concern.w; + if ('undefined' !== typeof concern.wtimeout) this.options.wtimeout = concern.wtimeout; + } else { + this.options.w = 'm' === concern ? 'majority' : concern; + } + return this; +}; + +/** + * Specifies a time limit, in milliseconds, for the write concern. + * If `ms > 1`, it is maximum amount of time to wait for this write + * to propagate through the replica set before this operation fails. + * The default is `0`, which means no timeout. + * + * This option is only valid for operations that write to the database: + * + * - `deleteOne()` + * - `deleteMany()` + * - `findOneAndDelete()` + * - `findOneAndUpdate()` + * - `remove()` + * - `update()` + * - `updateOne()` + * - `updateMany()` + * + * Defaults to `wtimeout` value if it is specified in writeConcern + * + * ####Example: + * + * mquery().w(2).j(true).wtimeout(2000) + * + * @method wtimeout + * @memberOf Query + * @instance + * @param {number} ms number of milliseconds to wait + * @see mongodb https://docs.mongodb.com/manual/reference/write-concern/#wtimeout + * @return {Query} this + * @api public + */ + +Query.prototype.wtimeout = Query.prototype.wTimeout = function wtimeout(ms) { + this.options.wtimeout = ms; + return this; +}; + +/** + * Merges another Query or conditions object into this one. + * + * When a Query is passed, conditions, field selection and options are merged. + * + * @param {Query|Object} source + * @return {Query} this + */ + +Query.prototype.merge = function(source) { + if (!source) + return this; + + if (!Query.canMerge(source)) + throw new TypeError('Invalid argument. Expected instanceof mquery or plain object'); + + if (source instanceof Query) { + // if source has a feature, apply it to ourselves + + if (source._conditions) { + utils.merge(this._conditions, source._conditions); + } + + if (source._fields) { + this._fields || (this._fields = {}); + utils.merge(this._fields, source._fields); + } + + if (source.options) { + this.options || (this.options = {}); + utils.merge(this.options, source.options); + } + + if (source._update) { + this._update || (this._update = {}); + utils.mergeClone(this._update, source._update); + } + + if (source._distinct) { + this._distinct = source._distinct; + } + + return this; + } + + // plain object + utils.merge(this._conditions, source); + + return this; +}; + +/** + * Finds documents. + * + * Passing a `callback` executes the query. + * + * ####Example + * + * query.find() + * query.find(callback) + * query.find({ name: 'Burning Lights' }, callback) + * + * @param {Object} [criteria] mongodb selector + * @param {Function} [callback] + * @return {Query} this + * @api public + */ + +Query.prototype.find = function(criteria, callback) { + this.op = 'find'; + + if ('function' === typeof criteria) { + callback = criteria; + criteria = undefined; + } else if (Query.canMerge(criteria)) { + this.merge(criteria); + } + + if (!callback) return this; + + const conds = this._conditions; + const options = this._optionsForExec(); + + if (this.$useProjection) { + options.projection = this._fieldsForExec(); + } else { + options.fields = this._fieldsForExec(); + } + + debug('find', this._collection.collectionName, conds, options); + callback = this._wrapCallback('find', callback, { + conditions: conds, + options: options + }); + + this._collection.find(conds, options, utils.tick(callback)); + return this; +}; + +/** + * Returns the query cursor + * + * ####Examples + * + * query.find().cursor(); + * query.cursor({ name: 'Burning Lights' }); + * + * @param {Object} [criteria] mongodb selector + * @return {Object} cursor + * @api public + */ + +Query.prototype.cursor = function cursor(criteria) { + if (this.op) { + if (this.op !== 'find') { + throw new TypeError('.cursor only support .find method'); + } + } else { + this.find(criteria); + } + + const conds = this._conditions; + const options = this._optionsForExec(); + + if (this.$useProjection) { + options.projection = this._fieldsForExec(); + } else { + options.fields = this._fieldsForExec(); + } + + debug('findCursor', this._collection.collectionName, conds, options); + return this._collection.findCursor(conds, options); +}; + +/** + * Executes the query as a findOne() operation. + * + * Passing a `callback` executes the query. + * + * ####Example + * + * query.findOne().where('name', /^Burning/); + * + * query.findOne({ name: /^Burning/ }) + * + * query.findOne({ name: /^Burning/ }, callback); // executes + * + * query.findOne(function (err, doc) { + * if (err) return handleError(err); + * if (doc) { + * // doc may be null if no document matched + * + * } + * }); + * + * @param {Object|Query} [criteria] mongodb selector + * @param {Function} [callback] + * @return {Query} this + * @api public + */ + +Query.prototype.findOne = function(criteria, callback) { + this.op = 'findOne'; + + if ('function' === typeof criteria) { + callback = criteria; + criteria = undefined; + } else if (Query.canMerge(criteria)) { + this.merge(criteria); + } + + if (!callback) return this; + + const conds = this._conditions; + const options = this._optionsForExec(); + + if (this.$useProjection) { + options.projection = this._fieldsForExec(); + } else { + options.fields = this._fieldsForExec(); + } + + debug('findOne', this._collection.collectionName, conds, options); + callback = this._wrapCallback('findOne', callback, { + conditions: conds, + options: options + }); + + this._collection.findOne(conds, options, utils.tick(callback)); + + return this; +}; + +/** + * Exectues the query as a count() operation. + * + * Passing a `callback` executes the query. + * + * ####Example + * + * query.count().where('color', 'black').exec(callback); + * + * query.count({ color: 'black' }).count(callback) + * + * query.count({ color: 'black' }, callback) + * + * query.where('color', 'black').count(function (err, count) { + * if (err) return handleError(err); + * console.log('there are %d kittens', count); + * }) + * + * @param {Object} [criteria] mongodb selector + * @param {Function} [callback] + * @return {Query} this + * @see mongodb http://www.mongodb.org/display/DOCS/Aggregation#Aggregation-Count + * @api public + */ + +Query.prototype.count = function(criteria, callback) { + this.op = 'count'; + this._validate(); + + if ('function' === typeof criteria) { + callback = criteria; + criteria = undefined; + } else if (Query.canMerge(criteria)) { + this.merge(criteria); + } + + if (!callback) return this; + + const conds = this._conditions, + options = this._optionsForExec(); + + debug('count', this._collection.collectionName, conds, options); + callback = this._wrapCallback('count', callback, { + conditions: conds, + options: options + }); + + this._collection.count(conds, options, utils.tick(callback)); + return this; +}; + +/** + * Declares or executes a distinct() operation. + * + * Passing a `callback` executes the query. + * + * ####Example + * + * distinct(criteria, field, fn) + * distinct(criteria, field) + * distinct(field, fn) + * distinct(field) + * distinct(fn) + * distinct() + * + * @param {Object|Query} [criteria] + * @param {String} [field] + * @param {Function} [callback] + * @return {Query} this + * @see mongodb http://www.mongodb.org/display/DOCS/Aggregation#Aggregation-Distinct + * @api public + */ + +Query.prototype.distinct = function(criteria, field, callback) { + this.op = 'distinct'; + this._validate(); + + if (!callback) { + switch (typeof field) { + case 'function': + callback = field; + if ('string' == typeof criteria) { + field = criteria; + criteria = undefined; + } + break; + case 'undefined': + case 'string': + break; + default: + throw new TypeError('Invalid `field` argument. Must be string or function'); + } + + switch (typeof criteria) { + case 'function': + callback = criteria; + criteria = field = undefined; + break; + case 'string': + field = criteria; + criteria = undefined; + break; + } + } + + if ('string' == typeof field) { + this._distinct = field; + } + + if (Query.canMerge(criteria)) { + this.merge(criteria); + } + + if (!callback) { + return this; + } + + if (!this._distinct) { + throw new Error('No value for `distinct` has been declared'); + } + + const conds = this._conditions, + options = this._optionsForExec(); + + debug('distinct', this._collection.collectionName, conds, options); + callback = this._wrapCallback('distinct', callback, { + conditions: conds, + options: options + }); + + this._collection.distinct(this._distinct, conds, options, utils.tick(callback)); + + return this; +}; + +/** + * Declare and/or execute this query as an update() operation. By default, + * `update()` only modifies the _first_ document that matches `criteria`. + * + * _All paths passed that are not $atomic operations will become $set ops._ + * + * ####Example + * + * mquery({ _id: id }).update({ title: 'words' }, ...) + * + * becomes + * + * collection.update({ _id: id }, { $set: { title: 'words' }}, ...) + * + * ####Note + * + * Passing an empty object `{}` as the doc will result in a no-op unless the `overwrite` option is passed. Without the `overwrite` option set, the update operation will be ignored and the callback executed without sending the command to MongoDB so as to prevent accidently overwritting documents in the collection. + * + * ####Note + * + * The operation is only executed when a callback is passed. To force execution without a callback (which would be an unsafe write), we must first call update() and then execute it by using the `exec()` method. + * + * var q = mquery(collection).where({ _id: id }); + * q.update({ $set: { name: 'bob' }}).update(); // not executed + * + * var q = mquery(collection).where({ _id: id }); + * q.update({ $set: { name: 'bob' }}).exec(); // executed as unsafe + * + * // keys that are not $atomic ops become $set. + * // this executes the same command as the previous example. + * q.update({ name: 'bob' }).where({ _id: id }).exec(); + * + * var q = mquery(collection).update(); // not executed + * + * // overwriting with empty docs + * var q.where({ _id: id }).setOptions({ overwrite: true }) + * q.update({ }, callback); // executes + * + * // multi update with overwrite to empty doc + * var q = mquery(collection).where({ _id: id }); + * q.setOptions({ multi: true, overwrite: true }) + * q.update({ }); + * q.update(callback); // executed + * + * // multi updates + * mquery() + * .collection(coll) + * .update({ name: /^match/ }, { $set: { arr: [] }}, { multi: true }, callback) + * // more multi updates + * mquery({ }) + * .collection(coll) + * .setOptions({ multi: true }) + * .update({ $set: { arr: [] }}, callback) + * + * // single update by default + * mquery({ email: 'address@example.com' }) + * .collection(coll) + * .update({ $inc: { counter: 1 }}, callback) + * + * // summary + * update(criteria, doc, opts, cb) // executes + * update(criteria, doc, opts) + * update(criteria, doc, cb) // executes + * update(criteria, doc) + * update(doc, cb) // executes + * update(doc) + * update(cb) // executes + * update(true) // executes (unsafe write) + * update() + * + * @param {Object} [criteria] + * @param {Object} [doc] the update command + * @param {Object} [options] + * @param {Function} [callback] + * @return {Query} this + * @api public + */ + +Query.prototype.update = function update(criteria, doc, options, callback) { + let force; + + switch (arguments.length) { + case 3: + if ('function' == typeof options) { + callback = options; + options = undefined; + } + break; + case 2: + if ('function' == typeof doc) { + callback = doc; + doc = criteria; + criteria = undefined; + } + break; + case 1: + switch (typeof criteria) { + case 'function': + callback = criteria; + criteria = options = doc = undefined; + break; + case 'boolean': + // execution with no callback (unsafe write) + force = criteria; + criteria = undefined; + break; + default: + doc = criteria; + criteria = options = undefined; + break; + } + } + + return _update(this, 'update', criteria, doc, options, force, callback); +}; + +/** + * Declare and/or execute this query as an `updateMany()` operation. Identical + * to `update()` except `updateMany()` will update _all_ documents that match + * `criteria`, rather than just the first one. + * + * _All paths passed that are not $atomic operations will become $set ops._ + * + * ####Example + * + * // Update every document whose `title` contains 'test' + * mquery().updateMany({ title: /test/ }, { year: 2017 }) + * + * @param {Object} [criteria] + * @param {Object} [doc] the update command + * @param {Object} [options] + * @param {Function} [callback] + * @return {Query} this + * @api public + */ + +Query.prototype.updateMany = function updateMany(criteria, doc, options, callback) { + let force; + + switch (arguments.length) { + case 3: + if ('function' == typeof options) { + callback = options; + options = undefined; + } + break; + case 2: + if ('function' == typeof doc) { + callback = doc; + doc = criteria; + criteria = undefined; + } + break; + case 1: + switch (typeof criteria) { + case 'function': + callback = criteria; + criteria = options = doc = undefined; + break; + case 'boolean': + // execution with no callback (unsafe write) + force = criteria; + criteria = undefined; + break; + default: + doc = criteria; + criteria = options = undefined; + break; + } + } + + return _update(this, 'updateMany', criteria, doc, options, force, callback); +}; + +/** + * Declare and/or execute this query as an `updateOne()` operation. Identical + * to `update()` except `updateOne()` will _always_ update just one document, + * regardless of the `multi` option. + * + * _All paths passed that are not $atomic operations will become $set ops._ + * + * ####Example + * + * // Update the first document whose `title` contains 'test' + * mquery().updateMany({ title: /test/ }, { year: 2017 }) + * + * @param {Object} [criteria] + * @param {Object} [doc] the update command + * @param {Object} [options] + * @param {Function} [callback] + * @return {Query} this + * @api public + */ + +Query.prototype.updateOne = function updateOne(criteria, doc, options, callback) { + let force; + + switch (arguments.length) { + case 3: + if ('function' == typeof options) { + callback = options; + options = undefined; + } + break; + case 2: + if ('function' == typeof doc) { + callback = doc; + doc = criteria; + criteria = undefined; + } + break; + case 1: + switch (typeof criteria) { + case 'function': + callback = criteria; + criteria = options = doc = undefined; + break; + case 'boolean': + // execution with no callback (unsafe write) + force = criteria; + criteria = undefined; + break; + default: + doc = criteria; + criteria = options = undefined; + break; + } + } + + return _update(this, 'updateOne', criteria, doc, options, force, callback); +}; + +/** + * Declare and/or execute this query as an `replaceOne()` operation. Similar + * to `updateOne()`, except `replaceOne()` is not allowed to use atomic + * modifiers (`$set`, `$push`, etc.). Calling `replaceOne()` will always + * replace the existing doc. + * + * ####Example + * + * // Replace the document with `_id` 1 with `{ _id: 1, year: 2017 }` + * mquery().replaceOne({ _id: 1 }, { year: 2017 }) + * + * @param {Object} [criteria] + * @param {Object} [doc] the update command + * @param {Object} [options] + * @param {Function} [callback] + * @return {Query} this + * @api public + */ + +Query.prototype.replaceOne = function replaceOne(criteria, doc, options, callback) { + let force; + + switch (arguments.length) { + case 3: + if ('function' == typeof options) { + callback = options; + options = undefined; + } + break; + case 2: + if ('function' == typeof doc) { + callback = doc; + doc = criteria; + criteria = undefined; + } + break; + case 1: + switch (typeof criteria) { + case 'function': + callback = criteria; + criteria = options = doc = undefined; + break; + case 'boolean': + // execution with no callback (unsafe write) + force = criteria; + criteria = undefined; + break; + default: + doc = criteria; + criteria = options = undefined; + break; + } + } + + this.setOptions({ overwrite: true }); + return _update(this, 'replaceOne', criteria, doc, options, force, callback); +}; + + +/*! + * Internal helper for update, updateMany, updateOne + */ + +function _update(query, op, criteria, doc, options, force, callback) { + query.op = op; + + if (Query.canMerge(criteria)) { + query.merge(criteria); + } + + if (doc) { + query._mergeUpdate(doc); + } + + if (utils.isObject(options)) { + // { overwrite: true } + query.setOptions(options); + } + + // we are done if we don't have callback and they are + // not forcing an unsafe write. + if (!(force || callback)) { + return query; + } + + if (!query._update || + !query.options.overwrite && 0 === utils.keys(query._update).length) { + callback && utils.soon(callback.bind(null, null, 0)); + return query; + } + + options = query._optionsForExec(); + if (!callback) options.safe = false; + + criteria = query._conditions; + doc = query._updateForExec(); + + debug('update', query._collection.collectionName, criteria, doc, options); + callback = query._wrapCallback(op, callback, { + conditions: criteria, + doc: doc, + options: options + }); + + query._collection[op](criteria, doc, options, utils.tick(callback)); + + return query; +} + +/** + * Declare and/or execute this query as a remove() operation. + * + * ####Example + * + * mquery(collection).remove({ artist: 'Anne Murray' }, callback) + * + * ####Note + * + * The operation is only executed when a callback is passed. To force execution without a callback (which would be an unsafe write), we must first call remove() and then execute it by using the `exec()` method. + * + * // not executed + * var query = mquery(collection).remove({ name: 'Anne Murray' }) + * + * // executed + * mquery(collection).remove({ name: 'Anne Murray' }, callback) + * mquery(collection).remove({ name: 'Anne Murray' }).remove(callback) + * + * // executed without a callback (unsafe write) + * query.exec() + * + * // summary + * query.remove(conds, fn); // executes + * query.remove(conds) + * query.remove(fn) // executes + * query.remove() + * + * @param {Object|Query} [criteria] mongodb selector + * @param {Function} [callback] + * @return {Query} this + * @api public + */ + +Query.prototype.remove = function(criteria, callback) { + this.op = 'remove'; + let force; + + if ('function' === typeof criteria) { + callback = criteria; + criteria = undefined; + } else if (Query.canMerge(criteria)) { + this.merge(criteria); + } else if (true === criteria) { + force = criteria; + criteria = undefined; + } + + if (!(force || callback)) + return this; + + const options = this._optionsForExec(); + if (!callback) options.safe = false; + + const conds = this._conditions; + + debug('remove', this._collection.collectionName, conds, options); + callback = this._wrapCallback('remove', callback, { + conditions: conds, + options: options + }); + + this._collection.remove(conds, options, utils.tick(callback)); + + return this; +}; + +/** + * Declare and/or execute this query as a `deleteOne()` operation. Behaves like + * `remove()`, except for ignores the `justOne` option and always deletes at + * most one document. + * + * ####Example + * + * mquery(collection).deleteOne({ artist: 'Anne Murray' }, callback) + * + * @param {Object|Query} [criteria] mongodb selector + * @param {Function} [callback] + * @return {Query} this + * @api public + */ + +Query.prototype.deleteOne = function(criteria, callback) { + this.op = 'deleteOne'; + let force; + + if ('function' === typeof criteria) { + callback = criteria; + criteria = undefined; + } else if (Query.canMerge(criteria)) { + this.merge(criteria); + } else if (true === criteria) { + force = criteria; + criteria = undefined; + } + + if (!(force || callback)) + return this; + + const options = this._optionsForExec(); + if (!callback) options.safe = false; + delete options.justOne; + + const conds = this._conditions; + + debug('deleteOne', this._collection.collectionName, conds, options); + callback = this._wrapCallback('deleteOne', callback, { + conditions: conds, + options: options + }); + + this._collection.deleteOne(conds, options, utils.tick(callback)); + + return this; +}; + +/** + * Declare and/or execute this query as a `deleteMany()` operation. Behaves like + * `remove()`, except for ignores the `justOne` option and always deletes + * _every_ document that matches `criteria`. + * + * ####Example + * + * mquery(collection).deleteMany({ artist: 'Anne Murray' }, callback) + * + * @param {Object|Query} [criteria] mongodb selector + * @param {Function} [callback] + * @return {Query} this + * @api public + */ + +Query.prototype.deleteMany = function(criteria, callback) { + this.op = 'deleteMany'; + let force; + + if ('function' === typeof criteria) { + callback = criteria; + criteria = undefined; + } else if (Query.canMerge(criteria)) { + this.merge(criteria); + } else if (true === criteria) { + force = criteria; + criteria = undefined; + } + + if (!(force || callback)) + return this; + + const options = this._optionsForExec(); + if (!callback) options.safe = false; + delete options.justOne; + + const conds = this._conditions; + + debug('deleteOne', this._collection.collectionName, conds, options); + callback = this._wrapCallback('deleteOne', callback, { + conditions: conds, + options: options + }); + + this._collection.deleteMany(conds, options, utils.tick(callback)); + + return this; +}; + +/** + * Issues a mongodb [findAndModify](http://www.mongodb.org/display/DOCS/findAndModify+Command) update command. + * + * Finds a matching document, updates it according to the `update` arg, passing any `options`, and returns the found document (if any) to the callback. The query executes immediately if `callback` is passed. + * + * ####Available options + * + * - `new`: bool - true to return the modified document rather than the original. defaults to true + * - `upsert`: bool - creates the object if it doesn't exist. defaults to false. + * - `sort`: if multiple docs are found by the conditions, sets the sort order to choose which doc to update + * + * ####Examples + * + * query.findOneAndUpdate(conditions, update, options, callback) // executes + * query.findOneAndUpdate(conditions, update, options) // returns Query + * query.findOneAndUpdate(conditions, update, callback) // executes + * query.findOneAndUpdate(conditions, update) // returns Query + * query.findOneAndUpdate(update, callback) // returns Query + * query.findOneAndUpdate(update) // returns Query + * query.findOneAndUpdate(callback) // executes + * query.findOneAndUpdate() // returns Query + * + * @param {Object|Query} [query] + * @param {Object} [doc] + * @param {Object} [options] + * @param {Function} [callback] + * @see mongodb http://www.mongodb.org/display/DOCS/findAndModify+Command + * @return {Query} this + * @api public + */ + +Query.prototype.findOneAndUpdate = function(criteria, doc, options, callback) { + this.op = 'findOneAndUpdate'; + this._validate(); + + switch (arguments.length) { + case 3: + if ('function' == typeof options) { + callback = options; + options = {}; + } + break; + case 2: + if ('function' == typeof doc) { + callback = doc; + doc = criteria; + criteria = undefined; + } + options = undefined; + break; + case 1: + if ('function' == typeof criteria) { + callback = criteria; + criteria = options = doc = undefined; + } else { + doc = criteria; + criteria = options = undefined; + } + } + + if (Query.canMerge(criteria)) { + this.merge(criteria); + } + + // apply doc + if (doc) { + this._mergeUpdate(doc); + } + + options && this.setOptions(options); + + if (!callback) return this; + + const conds = this._conditions; + const update = this._updateForExec(); + options = this._optionsForExec(); + + return this._collection.findOneAndUpdate(conds, update, options, utils.tick(callback)); +}; + +/** + * Issues a mongodb [findAndModify](http://www.mongodb.org/display/DOCS/findAndModify+Command) remove command. + * + * Finds a matching document, removes it, passing the found document (if any) to the callback. Executes immediately if `callback` is passed. + * + * ####Available options + * + * - `sort`: if multiple docs are found by the conditions, sets the sort order to choose which doc to update + * + * ####Examples + * + * A.where().findOneAndRemove(conditions, options, callback) // executes + * A.where().findOneAndRemove(conditions, options) // return Query + * A.where().findOneAndRemove(conditions, callback) // executes + * A.where().findOneAndRemove(conditions) // returns Query + * A.where().findOneAndRemove(callback) // executes + * A.where().findOneAndRemove() // returns Query + * A.where().findOneAndDelete() // alias of .findOneAndRemove() + * + * @param {Object} [conditions] + * @param {Object} [options] + * @param {Function} [callback] + * @return {Query} this + * @see mongodb http://www.mongodb.org/display/DOCS/findAndModify+Command + * @api public + */ + +Query.prototype.findOneAndRemove = Query.prototype.findOneAndDelete = function(conditions, options, callback) { + this.op = 'findOneAndRemove'; + this._validate(); + + if ('function' == typeof options) { + callback = options; + options = undefined; + } else if ('function' == typeof conditions) { + callback = conditions; + conditions = undefined; + } + + // apply conditions + if (Query.canMerge(conditions)) { + this.merge(conditions); + } + + // apply options + options && this.setOptions(options); + + if (!callback) return this; + + options = this._optionsForExec(); + const conds = this._conditions; + + return this._collection.findOneAndDelete(conds, options, utils.tick(callback)); +}; + +/** + * Wrap callback to add tracing + * + * @param {Function} callback + * @param {Object} [queryInfo] + * @api private + */ +Query.prototype._wrapCallback = function(method, callback, queryInfo) { + const traceFunction = this._traceFunction || Query.traceFunction; + + if (traceFunction) { + queryInfo.collectionName = this._collection.collectionName; + + const traceCallback = traceFunction && + traceFunction.call(null, method, queryInfo, this); + + const startTime = new Date().getTime(); + + return function wrapperCallback(err, result) { + if (traceCallback) { + const millis = new Date().getTime() - startTime; + traceCallback.call(null, err, result, millis); + } + + if (callback) { + callback.apply(null, arguments); + } + }; + } + + return callback; +}; + +/** + * Add trace function that gets called when the query is executed. + * The function will be called with (method, queryInfo, query) and + * should return a callback function which will be called + * with (err, result, millis) when the query is complete. + * + * queryInfo is an object containing: { + * collectionName: , + * conditions: , + * options: , + * doc: [document to update, if applicable] + * } + * + * NOTE: Does not trace stream queries. + * + * @param {Function} traceFunction + * @return {Query} this + * @api public + */ +Query.prototype.setTraceFunction = function(traceFunction) { + this._traceFunction = traceFunction; + return this; +}; + +/** + * Executes the query + * + * ####Examples + * + * query.exec(); + * query.exec(callback); + * query.exec('update'); + * query.exec('find', callback); + * + * @param {String|Function} [operation] + * @param {Function} [callback] + * @api public + */ + +Query.prototype.exec = function exec(op, callback) { + switch (typeof op) { + case 'function': + callback = op; + op = null; + break; + case 'string': + this.op = op; + break; + } + + assert.ok(this.op, 'Missing query type: (find, update, etc)'); + + if ('update' == this.op || 'remove' == this.op) { + callback || (callback = true); + } + + const _this = this; + + if ('function' == typeof callback) { + this[this.op](callback); + } else { + return new Query.Promise(function(success, error) { + _this[_this.op](function(err, val) { + if (err) error(err); + else success(val); + success = error = null; + }); + }); + } +}; + +/** + * Returns a thunk which when called runs this.exec() + * + * The thunk receives a callback function which will be + * passed to `this.exec()` + * + * @return {Function} + * @api public + */ + +Query.prototype.thunk = function() { + const _this = this; + return function(cb) { + _this.exec(cb); + }; +}; + +/** + * Executes the query returning a `Promise` which will be + * resolved with either the doc(s) or rejected with the error. + * + * @param {Function} [resolve] + * @param {Function} [reject] + * @return {Promise} + * @api public + */ + +Query.prototype.then = function(resolve, reject) { + const _this = this; + const promise = new Query.Promise(function(success, error) { + _this.exec(function(err, val) { + if (err) error(err); + else success(val); + success = error = null; + }); + }); + return promise.then(resolve, reject); +}; + +/** + * Returns a cursor for the given `find` query. + * + * @throws Error if operation is not a find + * @returns {Cursor} MongoDB driver cursor + */ + +Query.prototype.cursor = function() { + if ('find' != this.op) + throw new Error('cursor() is only available for find'); + + const conds = this._conditions; + + const options = this._optionsForExec(); + if (this.$useProjection) { + options.projection = this._fieldsForExec(); + } else { + options.fields = this._fieldsForExec(); + } + + debug('cursor', this._collection.collectionName, conds, options); + + return this._collection.findCursor(conds, options); +}; + +/** + * Determines if field selection has been made. + * + * @return {Boolean} + * @api public + */ + +Query.prototype.selected = function selected() { + return !!(this._fields && Object.keys(this._fields).length > 0); +}; + +/** + * Determines if inclusive field selection has been made. + * + * query.selectedInclusively() // false + * query.select('name') + * query.selectedInclusively() // true + * query.selectedExlusively() // false + * + * @returns {Boolean} + */ + +Query.prototype.selectedInclusively = function selectedInclusively() { + if (!this._fields) return false; + + const keys = Object.keys(this._fields); + if (0 === keys.length) return false; + + for (let i = 0; i < keys.length; ++i) { + const key = keys[i]; + if (0 === this._fields[key]) return false; + if (this._fields[key] && + typeof this._fields[key] === 'object' && + this._fields[key].$meta) { + return false; + } + } + + return true; +}; + +/** + * Determines if exclusive field selection has been made. + * + * query.selectedExlusively() // false + * query.select('-name') + * query.selectedExlusively() // true + * query.selectedInclusively() // false + * + * @returns {Boolean} + */ + +Query.prototype.selectedExclusively = function selectedExclusively() { + if (!this._fields) return false; + + const keys = Object.keys(this._fields); + if (0 === keys.length) return false; + + for (let i = 0; i < keys.length; ++i) { + const key = keys[i]; + if (0 === this._fields[key]) return true; + } + + return false; +}; + +/** + * Merges `doc` with the current update object. + * + * @param {Object} doc + */ + +Query.prototype._mergeUpdate = function(doc) { + if (!this._update) this._update = {}; + if (doc instanceof Query) { + if (doc._update) { + utils.mergeClone(this._update, doc._update); + } + } else { + utils.mergeClone(this._update, doc); + } +}; + +/** + * Returns default options. + * + * @return {Object} + * @api private + */ + +Query.prototype._optionsForExec = function() { + const options = utils.clone(this.options); + return options; +}; + +/** + * Returns fields selection for this query. + * + * @return {Object} + * @api private + */ + +Query.prototype._fieldsForExec = function() { + return utils.clone(this._fields); +}; + +/** + * Return an update document with corrected $set operations. + * + * @api private + */ + +Query.prototype._updateForExec = function() { + const update = utils.clone(this._update); + const ops = utils.keys(update); + const ret = {}; + + for (const op of ops) { + if (this.options.overwrite) { + ret[op] = update[op]; + continue; + } + + if ('$' !== op[0]) { + // fix up $set sugar + if (!ret.$set) { + if (update.$set) { + ret.$set = update.$set; + } else { + ret.$set = {}; + } + } + ret.$set[op] = update[op]; + if (!~ops.indexOf('$set')) ops.push('$set'); + } else if ('$set' === op) { + if (!ret.$set) { + ret[op] = update[op]; + } + } else { + ret[op] = update[op]; + } + } + + this._compiledUpdate = ret; + return ret; +}; + +/** + * Make sure _path is set. + * + * @parmam {String} method + */ + +Query.prototype._ensurePath = function(method) { + if (!this._path) { + const msg = method + '() must be used after where() ' + + 'when called with these arguments'; + throw new Error(msg); + } +}; + +/*! + * Permissions + */ + +Query.permissions = require('./permissions'); + +Query._isPermitted = function(a, b) { + const denied = Query.permissions[b]; + if (!denied) return true; + return true !== denied[a]; +}; + +Query.prototype._validate = function(action) { + let fail; + let validator; + + if (undefined === action) { + + validator = Query.permissions[this.op]; + if ('function' != typeof validator) return true; + + fail = validator(this); + + } else if (!Query._isPermitted(action, this.op)) { + fail = action; + } + + if (fail) { + throw new Error(fail + ' cannot be used with ' + this.op); + } +}; + +/** + * Determines if `conds` can be merged using `mquery().merge()` + * + * @param {Object} conds + * @return {Boolean} + */ + +Query.canMerge = function(conds) { + return conds instanceof Query || utils.isObject(conds); +}; + +/** + * Set a trace function that will get called whenever a + * query is executed. + * + * See `setTraceFunction()` for details. + * + * @param {Object} conds + * @return {Boolean} + */ +Query.setGlobalTraceFunction = function(traceFunction) { + Query.traceFunction = traceFunction; +}; + +/*! + * Exports. + */ + +Query.utils = utils; +Query.env = require('./env'); +Query.Collection = require('./collection'); +Query.BaseCollection = require('./collection/collection'); +Query.Promise = Promise; +module.exports = exports = Query; + +// TODO +// test utils diff --git a/node_modules/mquery/lib/permissions.js b/node_modules/mquery/lib/permissions.js new file mode 100644 index 000000000..9cf9d36b8 --- /dev/null +++ b/node_modules/mquery/lib/permissions.js @@ -0,0 +1,84 @@ +'use strict'; + +const denied = exports; + +denied.distinct = function(self) { + if (self._fields && Object.keys(self._fields).length > 0) { + return 'field selection and slice'; + } + + const keys = Object.keys(denied.distinct); + let err; + + keys.every(function(option) { + if (self.options[option]) { + err = option; + return false; + } + return true; + }); + + return err; +}; +denied.distinct.select = +denied.distinct.slice = +denied.distinct.sort = +denied.distinct.limit = +denied.distinct.skip = +denied.distinct.batchSize = +denied.distinct.maxScan = +denied.distinct.snapshot = +denied.distinct.hint = +denied.distinct.tailable = true; + + +// aggregation integration + + +denied.findOneAndUpdate = +denied.findOneAndRemove = function(self) { + const keys = Object.keys(denied.findOneAndUpdate); + let err; + + keys.every(function(option) { + if (self.options[option]) { + err = option; + return false; + } + return true; + }); + + return err; +}; +denied.findOneAndUpdate.limit = +denied.findOneAndUpdate.skip = +denied.findOneAndUpdate.batchSize = +denied.findOneAndUpdate.maxScan = +denied.findOneAndUpdate.snapshot = +denied.findOneAndUpdate.tailable = true; + + +denied.count = function(self) { + if (self._fields && Object.keys(self._fields).length > 0) { + return 'field selection and slice'; + } + + const keys = Object.keys(denied.count); + let err; + + keys.every(function(option) { + if (self.options[option]) { + err = option; + return false; + } + return true; + }); + + return err; +}; + +denied.count.slice = +denied.count.batchSize = +denied.count.maxScan = +denied.count.snapshot = +denied.count.tailable = true; diff --git a/node_modules/mquery/lib/utils.js b/node_modules/mquery/lib/utils.js new file mode 100644 index 000000000..986c1a751 --- /dev/null +++ b/node_modules/mquery/lib/utils.js @@ -0,0 +1,335 @@ +'use strict'; + +/*! + * Module dependencies. + */ + +const specialProperties = ['__proto__', 'constructor', 'prototype']; + +/** + * Clones objects + * + * @param {Object} obj the object to clone + * @param {Object} options + * @return {Object} the cloned object + * @api private + */ + +const clone = exports.clone = function clone(obj, options) { + if (obj === undefined || obj === null) + return obj; + + if (Array.isArray(obj)) + return exports.cloneArray(obj, options); + + if (obj.constructor) { + if (/ObjectI[dD]$/.test(obj.constructor.name)) { + return 'function' == typeof obj.clone + ? obj.clone() + : new obj.constructor(obj.id); + } + + if (obj.constructor.name === 'ReadPreference') { + return new obj.constructor(obj.mode, clone(obj.tags, options)); + } + + if ('Binary' == obj._bsontype && obj.buffer && obj.value) { + return 'function' == typeof obj.clone + ? obj.clone() + : new obj.constructor(obj.value(true), obj.sub_type); + } + + if ('Date' === obj.constructor.name || 'Function' === obj.constructor.name) + return new obj.constructor(+obj); + + if ('RegExp' === obj.constructor.name) + return new RegExp(obj); + + if ('Buffer' === obj.constructor.name) + return Buffer.from(obj); + } + + if (isObject(obj)) + return exports.cloneObject(obj, options); + + if (obj.valueOf) + return obj.valueOf(); +}; + +/*! + * ignore + */ + +exports.cloneObject = function cloneObject(obj, options) { + const minimize = options && options.minimize, + ret = {}, + keys = Object.keys(obj), + len = keys.length; + let hasKeys = false, + val, + k = '', + i = 0; + + for (i = 0; i < len; ++i) { + k = keys[i]; + // Not technically prototype pollution because this wouldn't merge properties + // onto `Object.prototype`, but avoid properties like __proto__ as a precaution. + if (specialProperties.indexOf(k) !== -1) { + continue; + } + + val = clone(obj[k], options); + + if (!minimize || ('undefined' !== typeof val)) { + hasKeys || (hasKeys = true); + ret[k] = val; + } + } + + return minimize + ? hasKeys && ret + : ret; +}; + +exports.cloneArray = function cloneArray(arr, options) { + const ret = [], + l = arr.length; + let i = 0; + for (; i < l; i++) + ret.push(clone(arr[i], options)); + return ret; +}; + +/** + * process.nextTick helper. + * + * Wraps the given `callback` in a try/catch. If an error is + * caught it will be thrown on nextTick. + * + * node-mongodb-native had a habit of state corruption when + * an error was immediately thrown from within a collection + * method (find, update, etc) callback. + * + * @param {Function} [callback] + * @api private + */ + +exports.tick = function tick(callback) { + if ('function' !== typeof callback) return; + return function() { + // callbacks should always be fired on the next + // turn of the event loop. A side benefit is + // errors thrown from executing the callback + // will not cause drivers state to be corrupted + // which has historically been a problem. + const args = arguments; + soon(function() { + callback.apply(this, args); + }); + }; +}; + +/** + * Merges `from` into `to` without overwriting existing properties. + * + * @param {Object} to + * @param {Object} from + * @api private + */ + +exports.merge = function merge(to, from) { + const keys = Object.keys(from); + + for (const key of keys) { + if (specialProperties.indexOf(key) !== -1) { + continue; + } + if ('undefined' === typeof to[key]) { + to[key] = from[key]; + } else { + if (exports.isObject(from[key])) { + merge(to[key], from[key]); + } else { + to[key] = from[key]; + } + } + } +}; + +/** + * Same as merge but clones the assigned values. + * + * @param {Object} to + * @param {Object} from + * @api private + */ + +exports.mergeClone = function mergeClone(to, from) { + const keys = Object.keys(from); + + for (const key of keys) { + if (specialProperties.indexOf(key) !== -1) { + continue; + } + if ('undefined' === typeof to[key]) { + to[key] = clone(from[key]); + } else { + if (exports.isObject(from[key])) { + mergeClone(to[key], from[key]); + } else { + to[key] = clone(from[key]); + } + } + } +}; + +/** + * Read pref helper (mongo 2.2 drivers support this) + * + * Allows using aliases instead of full preference names: + * + * p primary + * pp primaryPreferred + * s secondary + * sp secondaryPreferred + * n nearest + * + * @param {String} pref + */ + +exports.readPref = function readPref(pref) { + switch (pref) { + case 'p': + pref = 'primary'; + break; + case 'pp': + pref = 'primaryPreferred'; + break; + case 's': + pref = 'secondary'; + break; + case 'sp': + pref = 'secondaryPreferred'; + break; + case 'n': + pref = 'nearest'; + break; + } + + return pref; +}; + + +/** + * Read Concern helper (mongo 3.2 drivers support this) + * + * Allows using string to specify read concern level: + * + * local 3.2+ + * available 3.6+ + * majority 3.2+ + * linearizable 3.4+ + * snapshot 4.0+ + * + * @param {String|Object} concern + */ + +exports.readConcern = function readConcern(concern) { + if ('string' === typeof concern) { + switch (concern) { + case 'l': + concern = 'local'; + break; + case 'a': + concern = 'available'; + break; + case 'm': + concern = 'majority'; + break; + case 'lz': + concern = 'linearizable'; + break; + case 's': + concern = 'snapshot'; + break; + } + concern = { level: concern }; + } + return concern; +}; + +/** + * Object.prototype.toString.call helper + */ + +const _toString = Object.prototype.toString; +exports.toString = function(arg) { + return _toString.call(arg); +}; + +/** + * Determines if `arg` is an object. + * + * @param {Object|Array|String|Function|RegExp|any} arg + * @return {Boolean} + */ + +const isObject = exports.isObject = function(arg) { + return '[object Object]' == exports.toString(arg); +}; + +/** + * Object.keys helper + */ + +exports.keys = Object.keys; + +/** + * Basic Object.create polyfill. + * Only one argument is supported. + * + * Based on https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Object/create + */ + +exports.create = 'function' == typeof Object.create + ? Object.create + : create; + +function create(proto) { + if (arguments.length > 1) { + throw new Error('Adding properties is not supported'); + } + + function F() { } + F.prototype = proto; + return new F; +} + +/** + * inheritance + */ + +exports.inherits = function(ctor, superCtor) { + ctor.prototype = exports.create(superCtor.prototype); + ctor.prototype.constructor = ctor; +}; + +/** + * nextTick helper + * compat with node 0.10 which behaves differently than previous versions + */ + +const soon = exports.soon = 'function' == typeof setImmediate + ? setImmediate + : process.nextTick; + +/** + * Check if this object is an arguments object + * + * @param {Any} v + * @return {Boolean} + */ + +exports.isArgumentsObject = function(v) { + return Object.prototype.toString.call(v) === '[object Arguments]'; +}; diff --git a/node_modules/mquery/package.json b/node_modules/mquery/package.json new file mode 100644 index 000000000..bf1cba187 --- /dev/null +++ b/node_modules/mquery/package.json @@ -0,0 +1,38 @@ +{ + "name": "mquery", + "version": "4.0.3", + "description": "Expressive query building for MongoDB", + "main": "lib/mquery.js", + "scripts": { + "test": "mocha test/index.js test/*.test.js", + "fix-lint": "eslint . --fix", + "lint": "eslint ." + }, + "repository": { + "type": "git", + "url": "git://github.com/aheckmann/mquery.git" + }, + "engines": { + "node": ">=12.0.0" + }, + "dependencies": { + "debug": "4.x" + }, + "devDependencies": { + "eslint": "8.x", + "eslint-plugin-mocha-no-only": "1.1.1", + "mocha": "9.x", + "mongodb": "4.x" + }, + "bugs": { + "url": "https://github.com/aheckmann/mquery/issues/new" + }, + "author": "Aaron Heckmann ", + "license": "MIT", + "keywords": [ + "mongodb", + "query", + "builder" + ], + "homepage": "https://github.com/aheckmann/mquery/" +} diff --git a/node_modules/mquery/test/.eslintrc.yml b/node_modules/mquery/test/.eslintrc.yml new file mode 100644 index 000000000..7e104dbcf --- /dev/null +++ b/node_modules/mquery/test/.eslintrc.yml @@ -0,0 +1,2 @@ +env: + mocha: true \ No newline at end of file diff --git a/node_modules/mquery/test/collection/browser.js b/node_modules/mquery/test/collection/browser.js new file mode 100644 index 000000000..e69de29bb diff --git a/node_modules/mquery/test/collection/mongo.js b/node_modules/mquery/test/collection/mongo.js new file mode 100644 index 000000000..e69de29bb diff --git a/node_modules/mquery/test/collection/node.js b/node_modules/mquery/test/collection/node.js new file mode 100644 index 000000000..a5eb875e6 --- /dev/null +++ b/node_modules/mquery/test/collection/node.js @@ -0,0 +1,29 @@ +'use strict'; + +const assert = require('assert'); +const mongo = require('mongodb'); + +const uri = process.env.MQUERY_URI || 'mongodb://localhost/mquery'; +let client; +let db; + +exports.getCollection = function(cb) { + mongo.MongoClient.connect(uri, function(err, _client) { + assert.ifError(err); + client = _client; + db = client.db(); + + const collection = db.collection('stuff'); + + // clean test db before starting + db.dropDatabase(function() { + cb(null, collection); + }); + }); +}; + +exports.dropCollection = function(cb) { + db.dropDatabase(function() { + client.close(cb); + }); +}; diff --git a/node_modules/mquery/test/env.js b/node_modules/mquery/test/env.js new file mode 100644 index 000000000..0bf8cf9ed --- /dev/null +++ b/node_modules/mquery/test/env.js @@ -0,0 +1,22 @@ +'use strict'; + +const env = require('../').env; + +console.log('environment: %s', env.type); + +let col; +switch (env.type) { + case 'node': + col = require('./collection/node'); + break; + case 'mongo': + col = require('./collection/mongo'); + break; + case 'browser': + col = require('./collection/browser'); + break; + default: + throw new Error('missing collection implementation for environment: ' + env.type); +} + +module.exports = exports = col; diff --git a/node_modules/mquery/test/index.js b/node_modules/mquery/test/index.js new file mode 100644 index 000000000..751433cd2 --- /dev/null +++ b/node_modules/mquery/test/index.js @@ -0,0 +1,2925 @@ +'use strict'; + +const mquery = require('../'); +const assert = require('assert'); + +describe('mquery', function() { + let col; + + before(function(done) { + // get the env specific collection interface + require('./env').getCollection(function(err, collection) { + assert.ifError(err); + col = collection; + done(); + }); + }); + + after(function(done) { + require('./env').dropCollection(done); + }); + + describe('mquery', function() { + it('is a function', function() { + assert.equal('function', typeof mquery); + }); + it('creates instances with the `new` keyword', function() { + assert.ok(mquery() instanceof mquery); + }); + describe('defaults', function() { + it('are set', function() { + const m = mquery(); + assert.strictEqual(undefined, m.op); + assert.deepEqual({}, m.options); + }); + }); + describe('criteria', function() { + it('if collection-like is used as collection', function() { + const m = mquery(col); + assert.equal(col, m._collection.collection); + }); + it('non-collection-like is used as criteria', function() { + const m = mquery({ works: true }); + assert.ok(!m._collection); + assert.deepEqual({ works: true }, m._conditions); + }); + }); + describe('options', function() { + it('are merged when passed', function() { + let m; + m = mquery(col, { w: 'majority' }); + assert.deepEqual({ w: 'majority' }, m.options); + m = mquery({ name: 'mquery' }, { w: 'majority' }); + assert.deepEqual({ w: 'majority' }, m.options); + }); + }); + }); + + describe('toConstructor', function() { + it('creates subclasses of mquery', function() { + const opts = { safe: { w: 'majority' }, readPreference: 'p' }; + const match = { name: 'test', count: { $gt: 101 } }; + const select = { name: 1, count: 0 }; + const update = { $set: { x: true } }; + const path = 'street'; + + const q = mquery().setOptions(opts); + q.where(match); + q.select(select); + q.updateOne(update); + q.where(path); + q.find(); + + const M = q.toConstructor(); + const m = M(); + + assert.ok(m instanceof mquery); + assert.deepEqual(opts, m.options); + assert.deepEqual(match, m._conditions); + assert.deepEqual(select, m._fields); + assert.deepEqual(update, m._update); + assert.equal(path, m._path); + assert.equal('find', m.op); + }); + }); + + describe('setOptions', function() { + it('calls associated methods', function() { + const m = mquery(); + assert.equal(m._collection, null); + m.setOptions({ collection: col }); + assert.equal(m._collection.collection, col); + }); + it('directly sets option when no method exists', function() { + const m = mquery(); + assert.equal(m.options.woot, null); + m.setOptions({ woot: 'yay' }); + assert.equal(m.options.woot, 'yay'); + }); + it('is chainable', function() { + const m = mquery(); + let n; + + n = m.setOptions(); + assert.equal(m, n); + n = m.setOptions({ x: 1 }); + assert.equal(m, n); + }); + }); + + describe('collection', function() { + it('sets the _collection', function() { + const m = mquery(); + m.collection(col); + assert.equal(m._collection.collection, col); + }); + it('is chainable', function() { + const m = mquery(); + const n = m.collection(col); + assert.equal(m, n); + }); + }); + + describe('$where', function() { + it('sets the $where condition', function() { + const m = mquery(); + function go() {} + m.$where(go); + assert.ok(go === m._conditions.$where); + }); + it('is chainable', function() { + const m = mquery(); + const n = m.$where('x'); + assert.equal(m, n); + }); + }); + + describe('where', function() { + it('without arguments', function() { + const m = mquery(); + m.where(); + assert.deepEqual({}, m._conditions); + }); + it('with non-string/object argument', function() { + const m = mquery(); + + assert.throws(function() { + m.where([]); + }, /path must be a string or object/); + }); + describe('with one argument', function() { + it('that is an object', function() { + const m = mquery(); + m.where({ name: 'flawed' }); + assert.strictEqual(m._conditions.name, 'flawed'); + }); + it('that is a query', function() { + const m = mquery({ name: 'first' }); + const n = mquery({ name: 'changed' }); + m.where(n); + assert.strictEqual(m._conditions.name, 'changed'); + }); + it('that is a string', function() { + const m = mquery(); + m.where('name'); + assert.equal('name', m._path); + assert.strictEqual(m._conditions.name, undefined); + }); + }); + it('with two arguments', function() { + const m = mquery(); + m.where('name', 'The Great Pumpkin'); + assert.equal('name', m._path); + assert.strictEqual(m._conditions.name, 'The Great Pumpkin'); + }); + it('is chainable', function() { + const m = mquery(); + + let n = m.where('x', 'y'); + assert.equal(m, n); + n = m.where(); + assert.equal(m, n); + }); + }); + describe('equals', function() { + it('must be called after where()', function() { + const m = mquery(); + assert.throws(function() { + m.equals(); + }, /must be used after where/); + }); + it('sets value of path set with where()', function() { + const m = mquery(); + m.where('age').equals(1000); + assert.deepEqual({ age: 1000 }, m._conditions); + }); + it('is chainable', function() { + const m = mquery(); + const n = m.where('x').equals(3); + assert.equal(m, n); + }); + }); + describe('eq', function() { + it('is alias of equals', function() { + const m = mquery(); + m.where('age').eq(1000); + assert.deepEqual({ age: 1000 }, m._conditions); + }); + }); + describe('or', function() { + it('pushes onto the internal $or condition', function() { + const m = mquery(); + m.or({ 'Nightmare Before Christmas': true }); + assert.deepEqual([{ 'Nightmare Before Christmas': true }], m._conditions.$or); + }); + it('allows passing arrays', function() { + const m = mquery(); + const arg = [{ 'Nightmare Before Christmas': true }, { x: 1 }]; + m.or(arg); + assert.deepEqual(arg, m._conditions.$or); + }); + it('allows calling multiple times', function() { + const m = mquery(); + const arg = [{ looper: true }, { x: 1 }]; + m.or(arg); + m.or({ y: 1 }); + m.or([{ w: 'oo' }, { z: 'oo' }]); + assert.deepEqual([{ looper: true }, { x: 1 }, { y: 1 }, { w: 'oo' }, { z: 'oo' }], m._conditions.$or); + }); + it('is chainable', function() { + const m = mquery(); + m.or({ o: 'k' }).where('name', 'table'); + assert.deepEqual({ name: 'table', $or: [{ o: 'k' }] }, m._conditions); + }); + }); + + describe('nor', function() { + it('pushes onto the internal $nor condition', function() { + const m = mquery(); + m.nor({ 'Nightmare Before Christmas': true }); + assert.deepEqual([{ 'Nightmare Before Christmas': true }], m._conditions.$nor); + }); + it('allows passing arrays', function() { + const m = mquery(); + const arg = [{ 'Nightmare Before Christmas': true }, { x: 1 }]; + m.nor(arg); + assert.deepEqual(arg, m._conditions.$nor); + }); + it('allows calling multiple times', function() { + const m = mquery(); + const arg = [{ looper: true }, { x: 1 }]; + m.nor(arg); + m.nor({ y: 1 }); + m.nor([{ w: 'oo' }, { z: 'oo' }]); + assert.deepEqual([{ looper: true }, { x: 1 }, { y: 1 }, { w: 'oo' }, { z: 'oo' }], m._conditions.$nor); + }); + it('is chainable', function() { + const m = mquery(); + m.nor({ o: 'k' }).where('name', 'table'); + assert.deepEqual({ name: 'table', $nor: [{ o: 'k' }] }, m._conditions); + }); + }); + + describe('and', function() { + it('pushes onto the internal $and condition', function() { + const m = mquery(); + m.and({ 'Nightmare Before Christmas': true }); + assert.deepEqual([{ 'Nightmare Before Christmas': true }], m._conditions.$and); + }); + it('allows passing arrays', function() { + const m = mquery(); + const arg = [{ 'Nightmare Before Christmas': true }, { x: 1 }]; + m.and(arg); + assert.deepEqual(arg, m._conditions.$and); + }); + it('allows calling multiple times', function() { + const m = mquery(); + const arg = [{ looper: true }, { x: 1 }]; + m.and(arg); + m.and({ y: 1 }); + m.and([{ w: 'oo' }, { z: 'oo' }]); + assert.deepEqual([{ looper: true }, { x: 1 }, { y: 1 }, { w: 'oo' }, { z: 'oo' }], m._conditions.$and); + }); + it('is chainable', function() { + const m = mquery(); + m.and({ o: 'k' }).where('name', 'table'); + assert.deepEqual({ name: 'table', $and: [{ o: 'k' }] }, m._conditions); + }); + }); + + function generalCondition(type) { + return function() { + it('accepts 2 args', function() { + const m = mquery()[type]('count', 3); + const check = {}; + check['$' + type] = 3; + assert.deepEqual(m._conditions.count, check); + }); + it('uses previously set `where` path if 1 arg passed', function() { + const m = mquery().where('count')[type](3); + const check = {}; + check['$' + type] = 3; + assert.deepEqual(m._conditions.count, check); + }); + it('throws if 1 arg was passed but no previous `where` was used', function() { + assert.throws(function() { + mquery()[type](3); + }, /must be used after where/); + }); + it('is chainable', function() { + const m = mquery().where('count')[type](3).where('x', 8); + const check = { x: 8, count: {} }; + check.count['$' + type] = 3; + assert.deepEqual(m._conditions, check); + }); + it('overwrites previous value', function() { + const m = mquery().where('count')[type](3)[type](8); + const check = {}; + check['$' + type] = 8; + assert.deepEqual(m._conditions.count, check); + }); + }; + } + + 'gt gte lt lte ne in nin regex size maxDistance minDistance'.split(' ').forEach(function(type) { + describe(type, generalCondition(type)); + }); + + describe('mod', function() { + describe('with 1 argument', function() { + it('requires a previous where()', function() { + assert.throws(function() { + mquery().mod([30, 10]); + }, /must be used after where/); + }); + it('works', function() { + const m = mquery().where('madmen').mod([10, 20]); + assert.deepEqual(m._conditions, { madmen: { $mod: [10, 20] } }); + }); + }); + + describe('with 2 arguments and second is non-Array', function() { + it('requires a previous where()', function() { + assert.throws(function() { + mquery().mod('x', 10); + }, /must be used after where/); + }); + it('works', function() { + const m = mquery().where('madmen').mod(10, 20); + assert.deepEqual(m._conditions, { madmen: { $mod: [10, 20] } }); + }); + }); + + it('with 2 arguments and second is an array', function() { + const m = mquery().mod('madmen', [10, 20]); + assert.deepEqual(m._conditions, { madmen: { $mod: [10, 20] } }); + }); + + it('with 3 arguments', function() { + const m = mquery().mod('madmen', 10, 20); + assert.deepEqual(m._conditions, { madmen: { $mod: [10, 20] } }); + }); + + it('is chainable', function() { + const m = mquery().mod('madmen', 10, 20).where('x', 8); + const check = { madmen: { $mod: [10, 20] }, x: 8 }; + assert.deepEqual(m._conditions, check); + }); + }); + + describe('exists', function() { + it('with 0 args', function() { + it('throws if not used after where()', function() { + assert.throws(function() { + mquery().exists(); + }, /must be used after where/); + }); + it('works', function() { + const m = mquery().where('name').exists(); + const check = { name: { $exists: true } }; + assert.deepEqual(m._conditions, check); + }); + }); + + describe('with 1 arg', function() { + describe('that is boolean', function() { + it('throws if not used after where()', function() { + assert.throws(function() { + mquery().exists(); + }, /must be used after where/); + }); + it('works', function() { + const m = mquery().exists('name', false); + const check = { name: { $exists: false } }; + assert.deepEqual(m._conditions, check); + }); + }); + describe('that is not boolean', function() { + it('sets the value to `true`', function() { + const m = mquery().where('name').exists('yummy'); + const check = { yummy: { $exists: true } }; + assert.deepEqual(m._conditions, check); + }); + }); + }); + + describe('with 2 args', function() { + it('works', function() { + const m = mquery().exists('yummy', false); + const check = { yummy: { $exists: false } }; + assert.deepEqual(m._conditions, check); + }); + }); + + it('is chainable', function() { + const m = mquery().where('name').exists().find({ x: 1 }); + const check = { name: { $exists: true }, x: 1 }; + assert.deepEqual(m._conditions, check); + }); + }); + + describe('elemMatch', function() { + describe('with null/undefined first argument', function() { + assert.throws(function() { + mquery().elemMatch(); + }, /Invalid argument/); + assert.throws(function() { + mquery().elemMatch(null); + }, /Invalid argument/); + assert.doesNotThrow(function() { + mquery().elemMatch('', {}); + }); + }); + + describe('with 1 argument', function() { + it('throws if not a function or object', function() { + assert.throws(function() { + mquery().elemMatch([]); + }, /Invalid argument/); + }); + + describe('that is an object', function() { + it('throws if no previous `where` was used', function() { + assert.throws(function() { + mquery().elemMatch({}); + }, /must be used after where/); + }); + it('works', function() { + const m = mquery().where('comment').elemMatch({ author: 'joe', votes: { $gte: 3 } }); + assert.deepEqual({ comment: { $elemMatch: { author: 'joe', votes: { $gte: 3 } } } }, m._conditions); + }); + }); + describe('that is a function', function() { + it('throws if no previous `where` was used', function() { + assert.throws(function() { + mquery().elemMatch(function() {}); + }, /must be used after where/); + }); + it('works', function() { + const m = mquery().where('comment').elemMatch(function(query) { + query.where({ author: 'joe', votes: { $gte: 3 } }); + }); + assert.deepEqual({ comment: { $elemMatch: { author: 'joe', votes: { $gte: 3 } } } }, m._conditions); + }); + }); + }); + + describe('with 2 arguments', function() { + describe('and the 2nd is an object', function() { + it('works', function() { + const m = mquery().elemMatch('comment', { author: 'joe', votes: { $gte: 3 } }); + assert.deepEqual({ comment: { $elemMatch: { author: 'joe', votes: { $gte: 3 } } } }, m._conditions); + }); + }); + describe('and the 2nd is a function', function() { + it('works', function() { + const m = mquery().elemMatch('comment', function(query) { + query.where({ author: 'joe', votes: { $gte: 3 } }); + }); + assert.deepEqual({ comment: { $elemMatch: { author: 'joe', votes: { $gte: 3 } } } }, m._conditions); + }); + }); + it('and the 2nd is not a function or object', function() { + assert.throws(function() { + mquery().elemMatch('comment', []); + }, /Invalid argument/); + }); + }); + }); + + describe('within', function() { + it('is chainable', function() { + const m = mquery(); + assert.equal(m.where('a').within(), m); + }); + describe('when called with arguments', function() { + it('must follow where()', function() { + assert.throws(function() { + mquery().within([]); + }, /must be used after where/); + }); + + describe('of length 1', function() { + it('throws if not a recognized shape', function() { + assert.throws(function() { + mquery().where('loc').within({}); + }, /Invalid argument/); + assert.throws(function() { + mquery().where('loc').within(null); + }, /Invalid argument/); + }); + it('delegates to circle when center exists', function() { + const m = mquery().where('loc').within({ center: [10, 10], radius: 3 }); + assert.deepEqual({ $geoWithin: { $center: [[10, 10], 3] } }, m._conditions.loc); + }); + it('delegates to box when exists', function() { + const m = mquery().where('loc').within({ box: [[10, 10], [11, 14]] }); + assert.deepEqual({ $geoWithin: { $box: [[10, 10], [11, 14]] } }, m._conditions.loc); + }); + it('delegates to polygon when exists', function() { + const m = mquery().where('loc').within({ polygon: [[10, 10], [11, 14], [10, 9]] }); + assert.deepEqual({ $geoWithin: { $polygon: [[10, 10], [11, 14], [10, 9]] } }, m._conditions.loc); + }); + it('delegates to geometry when exists', function() { + const m = mquery().where('loc').within({ type: 'Polygon', coordinates: [[10, 10], [11, 14], [10, 9]] }); + assert.deepEqual({ $geoWithin: { $geometry: { type: 'Polygon', coordinates: [[10, 10], [11, 14], [10, 9]] } } }, m._conditions.loc); + }); + }); + + describe('of length 2', function() { + it('delegates to box()', function() { + const m = mquery().where('loc').within([1, 2], [2, 5]); + assert.deepEqual(m._conditions.loc, { $geoWithin: { $box: [[1, 2], [2, 5]] } }); + }); + }); + + describe('of length > 2', function() { + it('delegates to polygon()', function() { + const m = mquery().where('loc').within([1, 2], [2, 5], [2, 4], [1, 3]); + assert.deepEqual(m._conditions.loc, { $geoWithin: { $polygon: [[1, 2], [2, 5], [2, 4], [1, 3]] } }); + }); + }); + }); + }); + + describe('geoWithin', function() { + before(function() { + mquery.use$geoWithin = false; + }); + after(function() { + mquery.use$geoWithin = true; + }); + describe('when called with arguments', function() { + describe('of length 1', function() { + it('delegates to circle when center exists', function() { + const m = mquery().where('loc').within({ center: [10, 10], radius: 3 }); + assert.deepEqual({ $within: { $center: [[10, 10], 3] } }, m._conditions.loc); + }); + it('delegates to box when exists', function() { + const m = mquery().where('loc').within({ box: [[10, 10], [11, 14]] }); + assert.deepEqual({ $within: { $box: [[10, 10], [11, 14]] } }, m._conditions.loc); + }); + it('delegates to polygon when exists', function() { + const m = mquery().where('loc').within({ polygon: [[10, 10], [11, 14], [10, 9]] }); + assert.deepEqual({ $within: { $polygon: [[10, 10], [11, 14], [10, 9]] } }, m._conditions.loc); + }); + it('delegates to geometry when exists', function() { + const m = mquery().where('loc').within({ type: 'Polygon', coordinates: [[10, 10], [11, 14], [10, 9]] }); + assert.deepEqual({ $within: { $geometry: { type: 'Polygon', coordinates: [[10, 10], [11, 14], [10, 9]] } } }, m._conditions.loc); + }); + }); + + describe('of length 2', function() { + it('delegates to box()', function() { + const m = mquery().where('loc').within([1, 2], [2, 5]); + assert.deepEqual(m._conditions.loc, { $within: { $box: [[1, 2], [2, 5]] } }); + }); + }); + + describe('of length > 2', function() { + it('delegates to polygon()', function() { + const m = mquery().where('loc').within([1, 2], [2, 5], [2, 4], [1, 3]); + assert.deepEqual(m._conditions.loc, { $within: { $polygon: [[1, 2], [2, 5], [2, 4], [1, 3]] } }); + }); + }); + }); + }); + + describe('box', function() { + describe('with 1 argument', function() { + it('throws', function() { + assert.throws(function() { + mquery().box('sometihng'); + }, /Invalid argument/); + }); + }); + describe('with > 3 arguments', function() { + it('throws', function() { + assert.throws(function() { + mquery().box(1, 2, 3, 4); + }, /Invalid argument/); + }); + }); + + describe('with 2 arguments', function() { + it('throws if not used after where()', function() { + assert.throws(function() { + mquery().box([], []); + }, /must be used after where/); + }); + it('works', function() { + const m = mquery().where('loc').box([1, 2], [3, 4]); + assert.deepEqual(m._conditions.loc, { $geoWithin: { $box: [[1, 2], [3, 4]] } }); + }); + }); + + describe('with 3 arguments', function() { + it('works', function() { + const m = mquery().box('loc', [1, 2], [3, 4]); + assert.deepEqual(m._conditions.loc, { $geoWithin: { $box: [[1, 2], [3, 4]] } }); + }); + }); + }); + + describe('polygon', function() { + describe('when first argument is not a string', function() { + it('throws if not used after where()', function() { + assert.throws(function() { + mquery().polygon({}); + }, /must be used after where/); + + assert.doesNotThrow(function() { + mquery().where('loc').polygon([1, 2], [2, 3], [3, 6]); + }); + }); + + it('assigns arguments to within polygon condition', function() { + const m = mquery().where('loc').polygon([1, 2], [2, 3], [3, 6]); + assert.deepEqual(m._conditions, { loc: { $geoWithin: { $polygon: [[1, 2], [2, 3], [3, 6]] } } }); + }); + }); + + describe('when first arg is a string', function() { + it('assigns remaining arguments to within polygon condition', function() { + const m = mquery().polygon('loc', [1, 2], [2, 3], [3, 6]); + assert.deepEqual(m._conditions, { loc: { $geoWithin: { $polygon: [[1, 2], [2, 3], [3, 6]] } } }); + }); + }); + }); + + describe('circle', function() { + describe('with one arg', function() { + it('must follow where()', function() { + assert.throws(function() { + mquery().circle('x'); + }, /must be used after where/); + assert.doesNotThrow(function() { + mquery().where('loc').circle({ center: [0, 0], radius: 3 }); + }); + }); + it('works', function() { + const m = mquery().where('loc').circle({ center: [0, 0], radius: 3 }); + assert.deepEqual(m._conditions, { loc: { $geoWithin: { $center: [[0, 0], 3] } } }); + }); + }); + describe('with 3 args', function() { + it('throws', function() { + assert.throws(function() { + mquery().where('loc').circle(1, 2, 3); + }, /Invalid argument/); + }); + }); + describe('requires radius and center', function() { + assert.throws(function() { + mquery().circle('loc', { center: 1 }); + }, /center and radius are required/); + assert.throws(function() { + mquery().circle('loc', { radius: 1 }); + }, /center and radius are required/); + assert.doesNotThrow(function() { + mquery().circle('loc', { center: [1, 2], radius: 1 }); + }); + }); + }); + + describe('geometry', function() { + // within + intersects + const point = { type: 'Point', coordinates: [[0, 0], [1, 1]] }; + + it('must be called after within or intersects', function(done) { + assert.throws(function() { + mquery().where('a').geometry(point); + }, /must come after/); + + assert.doesNotThrow(function() { + mquery().where('a').within().geometry(point); + }); + + assert.doesNotThrow(function() { + mquery().where('a').intersects().geometry(point); + }); + + done(); + }); + + describe('when called with one argument', function() { + describe('after within()', function() { + it('and arg quacks like geoJSON', function(done) { + const m = mquery().where('a').within().geometry(point); + assert.deepEqual({ a: { $geoWithin: { $geometry: point } } }, m._conditions); + done(); + }); + }); + + describe('after intersects()', function() { + it('and arg quacks like geoJSON', function(done) { + const m = mquery().where('a').intersects().geometry(point); + assert.deepEqual({ a: { $geoIntersects: { $geometry: point } } }, m._conditions); + done(); + }); + }); + + it('and arg does not quack like geoJSON', function(done) { + assert.throws(function() { + mquery().where('b').within().geometry({ type: 1, coordinates: 2 }); + }, /Invalid argument/); + done(); + }); + }); + + describe('when called with zero arguments', function() { + it('throws', function(done) { + assert.throws(function() { + mquery().where('a').within().geometry(); + }, /Invalid argument/); + + done(); + }); + }); + + describe('when called with more than one arguments', function() { + it('throws', function(done) { + assert.throws(function() { + mquery().where('a').within().geometry({ type: 'a', coordinates: [] }, 2); + }, /Invalid argument/); + done(); + }); + }); + }); + + describe('intersects', function() { + it('must be used after where()', function(done) { + const m = mquery(); + assert.throws(function() { + m.intersects(); + }, /must be used after where/); + done(); + }); + + it('sets geo comparison to "$intersects"', function(done) { + const n = mquery().where('a').intersects(); + assert.equal('$geoIntersects', n._geoComparison); + done(); + }); + + it('is chainable', function() { + const m = mquery(); + assert.equal(m.where('a').intersects(), m); + }); + + it('calls geometry if argument quacks like geojson', function(done) { + const m = mquery(); + const o = { type: 'LineString', coordinates: [[0, 1], [3, 40]] }; + let ran = false; + + m.geometry = function(arg) { + ran = true; + assert.deepEqual(o, arg); + }; + + m.where('a').intersects(o); + assert.ok(ran); + + done(); + }); + + it('throws if argument is not geometry-like', function(done) { + const m = mquery().where('a'); + + assert.throws(function() { + m.intersects(null); + }, /Invalid argument/); + + assert.throws(function() { + m.intersects(undefined); + }, /Invalid argument/); + + assert.throws(function() { + m.intersects(false); + }, /Invalid argument/); + + assert.throws(function() { + m.intersects({}); + }, /Invalid argument/); + + assert.throws(function() { + m.intersects([]); + }, /Invalid argument/); + + assert.throws(function() { + m.intersects(function() {}); + }, /Invalid argument/); + + assert.throws(function() { + m.intersects(NaN); + }, /Invalid argument/); + + done(); + }); + }); + + describe('near', function() { + // near nearSphere + describe('with 0 args', function() { + it('is compatible with geometry()', function(done) { + const q = mquery().where('x').near().geometry({ type: 'Point', coordinates: [180, 11] }); + assert.deepEqual({ $near: { $geometry: { type: 'Point', coordinates: [180, 11] } } }, q._conditions.x); + done(); + }); + }); + + describe('with 1 arg', function() { + it('throws if not used after where()', function() { + assert.throws(function() { + mquery().near(1); + }, /must be used after where/); + }); + it('does not throw if used after where()', function() { + assert.doesNotThrow(function() { + mquery().where('loc').near({ center: [1, 1] }); + }); + }); + }); + describe('with > 2 args', function() { + it('throws', function() { + assert.throws(function() { + mquery().near(1, 2, 3); + }, /Invalid argument/); + }); + }); + + it('creates $geometry args for GeoJSON', function() { + const m = mquery().where('loc').near({ center: { type: 'Point', coordinates: [10, 10] } }); + assert.deepEqual({ $near: { $geometry: { type: 'Point', coordinates: [10, 10] } } }, m._conditions.loc); + }); + + it('expects `center`', function() { + assert.throws(function() { + mquery().near('loc', { maxDistance: 3 }); + }, /center is required/); + assert.doesNotThrow(function() { + mquery().near('loc', { center: [3, 4] }); + }); + }); + + it('accepts spherical conditions', function() { + const m = mquery().where('loc').near({ center: [1, 2], spherical: true }); + assert.deepEqual(m._conditions, { loc: { $nearSphere: [1, 2] } }); + }); + + it('is non-spherical by default', function() { + const m = mquery().where('loc').near({ center: [1, 2] }); + assert.deepEqual(m._conditions, { loc: { $near: [1, 2] } }); + }); + + it('supports maxDistance', function() { + const m = mquery().where('loc').near({ center: [1, 2], maxDistance: 4 }); + assert.deepEqual(m._conditions, { loc: { $near: [1, 2], $maxDistance: 4 } }); + }); + + it('supports minDistance', function() { + const m = mquery().where('loc').near({ center: [1, 2], minDistance: 4 }); + assert.deepEqual(m._conditions, { loc: { $near: [1, 2], $minDistance: 4 } }); + }); + + it('is chainable', function() { + const m = mquery().where('loc').near({ center: [1, 2], maxDistance: 4 }).find({ x: 1 }); + assert.deepEqual(m._conditions, { loc: { $near: [1, 2], $maxDistance: 4 }, x: 1 }); + }); + + describe('supports passing GeoJSON, gh-13', function() { + it('with center', function() { + const m = mquery().where('loc').near({ + center: { type: 'Point', coordinates: [1, 1] }, + maxDistance: 2 + }); + + const expect = { + loc: { + $near: { + $geometry: { + type: 'Point', + coordinates: [1, 1] + }, + $maxDistance: 2 + } + } + }; + + assert.deepEqual(m._conditions, expect); + }); + }); + }); + + // fields + + describe('select', function() { + describe('with 0 args', function() { + it('is chainable', function() { + const m = mquery(); + assert.equal(m, m.select()); + }); + }); + + it('accepts an object', function() { + const o = { x: 1, y: 1 }; + const m = mquery().select(o); + assert.deepEqual(m._fields, o); + }); + + it('accepts a string', function() { + const o = 'x -y'; + const m = mquery().select(o); + assert.deepEqual(m._fields, { x: 1, y: 0 }); + }); + + it('does accept an array', function() { + const o = ['x', '-y']; + const m = mquery().select(o); + assert.deepEqual(m._fields, { x: 1, y: 0 }); + }); + + it('merges previous arguments', function() { + const o = { x: 1, y: 0, a: 1 }; + const m = mquery().select(o); + m.select('z -u w').select({ x: 0 }); + assert.deepEqual(m._fields, { + x: 0, + y: 0, + z: 1, + u: 0, + w: 1, + a: 1 + }); + }); + + it('rejects non-string, object, arrays', function() { + assert.throws(function() { + mquery().select(function() {}); + }, /Invalid select\(\) argument/); + }); + + it('accepts arguments objects', function() { + const m = mquery(); + function t() { + m.select(arguments); + assert.deepEqual(m._fields, { x: 1, y: 0 }); + } + t('x', '-y'); + }); + + noDistinct('select'); + }); + + describe('selected', function() { + it('returns true when fields have been selected', function(done) { + let m; + + m = mquery().select({ name: 1 }); + assert.ok(m.selected()); + + m = mquery().select('name'); + assert.ok(m.selected()); + + done(); + }); + + it('returns false when no fields have been selected', function(done) { + const m = mquery(); + assert.strictEqual(false, m.selected()); + done(); + }); + }); + + describe('selectedInclusively', function() { + describe('returns false', function() { + it('when no fields have been selected', function(done) { + assert.strictEqual(false, mquery().selectedInclusively()); + assert.equal(false, mquery().select({}).selectedInclusively()); + done(); + }); + it('when any fields have been excluded', function(done) { + assert.strictEqual(false, mquery().select('-name').selectedInclusively()); + assert.strictEqual(false, mquery().select({ name: 0 }).selectedInclusively()); + assert.strictEqual(false, mquery().select('name bio -_id').selectedInclusively()); + assert.strictEqual(false, mquery().select({ name: 1, _id: 0 }).selectedInclusively()); + done(); + }); + it('when using $meta', function(done) { + assert.strictEqual(false, mquery().select({ name: { $meta: 'textScore' } }).selectedInclusively()); + done(); + }); + }); + + describe('returns true', function() { + it('when fields have been included', function(done) { + assert.equal(true, mquery().select('name').selectedInclusively()); + assert.equal(true, mquery().select({ name: 1 }).selectedInclusively()); + done(); + }); + }); + }); + + describe('selectedExclusively', function() { + describe('returns false', function() { + it('when no fields have been selected', function(done) { + assert.equal(false, mquery().selectedExclusively()); + assert.equal(false, mquery().select({}).selectedExclusively()); + done(); + }); + it('when fields have only been included', function(done) { + assert.equal(false, mquery().select('name').selectedExclusively()); + assert.equal(false, mquery().select({ name: 1 }).selectedExclusively()); + done(); + }); + }); + + describe('returns true', function() { + it('when any field has been excluded', function(done) { + assert.equal(true, mquery().select('-name').selectedExclusively()); + assert.equal(true, mquery().select({ name: 0 }).selectedExclusively()); + assert.equal(true, mquery().select('-_id').selectedExclusively()); + assert.strictEqual(true, mquery().select('name bio -_id').selectedExclusively()); + assert.strictEqual(true, mquery().select({ name: 1, _id: 0 }).selectedExclusively()); + done(); + }); + }); + }); + + describe('slice', function() { + describe('with 0 args', function() { + it('is chainable', function() { + const m = mquery(); + assert.equal(m, m.slice()); + }); + it('is a noop', function() { + const m = mquery().slice(); + assert.deepEqual(m._fields, undefined); + }); + }); + + describe('with 1 arg', function() { + it('throws if not called after where()', function() { + assert.throws(function() { + mquery().slice(1); + }, /must be used after where/); + assert.doesNotThrow(function() { + mquery().where('a').slice(1); + }); + }); + it('that is a number', function() { + const query = mquery(); + query.where('collection').slice(5); + assert.deepEqual(query._fields, { collection: { $slice: 5 } }); + }); + it('that is an array', function() { + const query = mquery(); + query.where('collection').slice([5, 10]); + assert.deepEqual(query._fields, { collection: { $slice: [5, 10] } }); + }); + it('that is an object', function() { + const query = mquery(); + query.slice({ collection: [5, 10] }); + assert.deepEqual(query._fields, { collection: { $slice: [5, 10] } }); + }); + }); + + describe('with 2 args', function() { + describe('and first is a number', function() { + it('throws if not called after where', function() { + assert.throws(function() { + mquery().slice(2, 3); + }, /must be used after where/); + }); + it('does not throw if used after where', function() { + const query = mquery(); + query.where('collection').slice(2, 3); + assert.deepEqual(query._fields, { collection: { $slice: [2, 3] } }); + }); + }); + it('and first is not a number', function() { + const query = mquery().slice('collection', [-5, 2]); + assert.deepEqual(query._fields, { collection: { $slice: [-5, 2] } }); + }); + }); + + describe('with 3 args', function() { + it('works', function() { + const query = mquery(); + query.slice('collection', 14, 10); + assert.deepEqual(query._fields, { collection: { $slice: [14, 10] } }); + }); + }); + + noDistinct('slice'); + no('count', 'slice'); + }); + + // options + + describe('sort', function() { + describe('with 0 args', function() { + it('chains', function() { + const m = mquery(); + assert.equal(m, m.sort()); + }); + it('has no affect', function() { + const m = mquery(); + assert.equal(m.options.sort, undefined); + }); + }); + + it('works', function() { + let query = mquery(); + query.sort('a -c b'); + assert.deepEqual(query.options.sort, { a: 1, b: 1, c: -1 }); + + query = mquery(); + query.sort({ a: 1, c: -1, b: 'asc', e: 'descending', f: 'ascending' }); + assert.deepEqual(query.options.sort, { a: 1, c: -1, b: 1, e: -1, f: 1 }); + + query = mquery(); + query.sort([['a', -1], ['c', 1], ['b', 'desc'], ['e', 'ascending'], ['f', 'descending']]); + assert.deepEqual(query.options.sort, [['a', -1], ['c', 1], ['b', -1], ['e', 1], ['f', -1]]); + + query = mquery(); + let e = undefined; + try { + query.sort([['a', 1], { b: 5 }]); + } catch (err) { + e = err; + } + assert.ok(e, 'uh oh. no error was thrown'); + assert.equal(e.message, 'Invalid sort() argument, must be array of arrays'); + + query = mquery(); + e = undefined; + + try { + query.sort('a', 1, 'c', -1, 'b', 1); + } catch (err) { + e = err; + } + assert.ok(e, 'uh oh. no error was thrown'); + assert.equal(e.message, 'Invalid sort() argument. Must be a string, object, or array.'); + }); + + it('handles $meta sort options', function() { + const query = mquery(); + query.sort({ score: { $meta: 'textScore' } }); + assert.deepEqual(query.options.sort, { score: { $meta: 'textScore' } }); + }); + + it('array syntax', function() { + const query = mquery(); + query.sort([['field', 1], ['test', -1]]); + assert.deepEqual(query.options.sort, [['field', 1], ['test', -1]]); + }); + + it('throws with mixed array/object syntax', function() { + const query = mquery(); + assert.throws(function() { + query.sort({ field: 1 }).sort([['test', -1]]); + }, /Can't mix sort syntaxes/); + assert.throws(function() { + query.sort([['field', 1]]).sort({ test: 1 }); + }, /Can't mix sort syntaxes/); + }); + + it('works with maps', function() { + if (typeof Map === 'undefined') { + return this.skip(); + } + const query = mquery(); + query.sort(new Map().set('field', 1).set('test', -1)); + assert.deepEqual(query.options.sort, new Map().set('field', 1).set('test', -1)); + }); + }); + + function simpleOption(type, options) { + describe(type, function() { + it('sets the ' + type + ' option', function() { + const m = mquery()[type](2); + const optionName = options.name || type; + assert.equal(2, m.options[optionName]); + }); + it('is chainable', function() { + const m = mquery(); + assert.equal(m[type](3), m); + }); + + if (!options.distinct) noDistinct(type); + if (!options.count) no('count', type); + }); + } + + const negated = { + limit: { distinct: false, count: true }, + skip: { distinct: false, count: true }, + maxScan: { distinct: false, count: false }, + batchSize: { distinct: false, count: false }, + maxTime: { distinct: true, count: true, name: 'maxTimeMS' } + }; + Object.keys(negated).forEach(function(key) { + simpleOption(key, negated[key]); + }); + + describe('snapshot', function() { + it('works', function() { + let query; + + query = mquery(); + query.snapshot(); + assert.equal(true, query.options.snapshot); + + query = mquery(); + query.snapshot(true); + assert.equal(true, query.options.snapshot); + + query = mquery(); + query.snapshot(false); + assert.equal(false, query.options.snapshot); + }); + noDistinct('snapshot'); + no('count', 'snapshot'); + }); + + describe('hint', function() { + it('accepts an object', function() { + const query2 = mquery(); + query2.hint({ a: 1, b: -1 }); + assert.deepEqual(query2.options.hint, { a: 1, b: -1 }); + }); + + it('accepts a string', function() { + const query2 = mquery(); + query2.hint('a'); + assert.deepEqual(query2.options.hint, 'a'); + }); + + it('rejects everything else', function() { + assert.throws(function() { + mquery().hint(['c']); + }, /Invalid hint./); + assert.throws(function() { + mquery().hint(1); + }, /Invalid hint./); + }); + + describe('does not have side affects', function() { + it('on invalid arg', function() { + const m = mquery(); + try { + m.hint(1); + } catch (err) { + // ignore + } + assert.equal(undefined, m.options.hint); + }); + it('on missing arg', function() { + const m = mquery().hint(); + assert.equal(undefined, m.options.hint); + }); + }); + + noDistinct('hint'); + }); + + describe('j', function() { + it('works', function() { + const m = mquery().j(true); + assert.equal(true, m.options.j); + }); + }); + + describe('slaveOk', function() { + it('works', function() { + let query; + + query = mquery(); + query.slaveOk(); + assert.equal(true, query.options.slaveOk); + + query = mquery(); + query.slaveOk(true); + assert.equal(true, query.options.slaveOk); + + query = mquery(); + query.slaveOk(false); + assert.equal(false, query.options.slaveOk); + }); + }); + + describe('read', function() { + it('sets associated readPreference option', function() { + const m = mquery(); + m.read('p'); + assert.equal('primary', m.options.readPreference); + }); + it('is chainable', function() { + const m = mquery(); + assert.equal(m, m.read('sp')); + }); + }); + + describe('readConcern', function() { + it('sets associated readConcern option', function() { + let m; + + m = mquery(); + m.readConcern('s'); + assert.deepEqual({ level: 'snapshot' }, m.options.readConcern); + + m = mquery(); + m.r('local'); + assert.deepEqual({ level: 'local' }, m.options.readConcern); + }); + it('is chainable', function() { + const m = mquery(); + assert.equal(m, m.readConcern('lz')); + }); + }); + + describe('tailable', function() { + it('works', function() { + let query; + + query = mquery(); + query.tailable(); + assert.equal(true, query.options.tailable); + + query = mquery(); + query.tailable(true); + assert.equal(true, query.options.tailable); + + query = mquery(); + query.tailable(false); + assert.equal(false, query.options.tailable); + }); + it('is chainable', function() { + const m = mquery(); + assert.equal(m, m.tailable()); + }); + noDistinct('tailable'); + no('count', 'tailable'); + }); + + describe('writeConcern', function() { + it('sets associated writeConcern option', function() { + let m; + m = mquery(); + m.writeConcern('majority'); + assert.equal('majority', m.options.w); + + m = mquery(); + m.writeConcern('m'); // m is alias of majority + assert.equal('majority', m.options.w); + + m = mquery(); + m.writeConcern(1); + assert.equal(1, m.options.w); + }); + it('accepts object', function() { + let m; + + m = mquery().writeConcern({ w: 'm', j: true, wtimeout: 1000 }); + assert.equal('m', m.options.w); // check it does not convert m to majority + assert.equal(true, m.options.j); + assert.equal(1000, m.options.wtimeout); + + m = mquery().w('m').w({ j: false, wtimeout: 0 }); + assert.equal('majority', m.options.w); + assert.strictEqual(false, m.options.j); + assert.strictEqual(0, m.options.wtimeout); + }); + it('is chainable', function() { + const m = mquery(); + assert.equal(m, m.writeConcern('majority')); + }); + }); + + // query utilities + + describe('merge', function() { + describe('with falsy arg', function() { + it('returns itself', function() { + const m = mquery(); + assert.equal(m, m.merge()); + assert.equal(m, m.merge(null)); + assert.equal(m, m.merge(0)); + }); + }); + describe('with an argument', function() { + describe('that is not a query or plain object', function() { + it('throws', function() { + assert.throws(function() { + mquery().merge([]); + }, /Invalid argument/); + assert.throws(function() { + mquery().merge('merge'); + }, /Invalid argument/); + assert.doesNotThrow(function() { + mquery().merge({}); + }, /Invalid argument/); + }); + }); + + describe('that is a query', function() { + it('merges conditions, field selection, and options', function() { + const m = mquery({ x: 'hi' }, { select: 'x y', another: true }); + const n = mquery().merge(m); + assert.deepEqual(n._conditions, m._conditions); + assert.deepEqual(n._fields, m._fields); + assert.deepEqual(n.options, m.options); + }); + it('clones update arguments', function(done) { + const original = { $set: { iTerm: true } }; + const m = mquery().updateOne(original); + const n = mquery().merge(m); + m.updateOne({ $set: { x: 2 } }); + assert.notDeepEqual(m._update, n._update); + done(); + }); + it('is chainable', function() { + const m = mquery({ x: 'hi' }); + const n = mquery(); + assert.equal(n, n.merge(m)); + }); + }); + + describe('that is an object', function() { + it('merges', function() { + const m = { x: 'hi' }; + const n = mquery().merge(m); + assert.deepEqual(n._conditions, { x: 'hi' }); + }); + it('clones update arguments', function(done) { + const original = { $set: { iTerm: true } }; + const m = mquery().updateOne(original); + const n = mquery().merge(original); + m.updateOne({ $set: { x: 2 } }); + assert.notDeepEqual(m._update, n._update); + done(); + }); + it('is chainable', function() { + const m = { x: 'hi' }; + const n = mquery(); + assert.equal(n, n.merge(m)); + }); + }); + }); + }); + + // queries + + describe('find', function() { + describe('with no callback', function() { + it('does not execute', function() { + const m = mquery(); + assert.doesNotThrow(function() { + m.find(); + }); + assert.doesNotThrow(function() { + m.find({ x: 1 }); + }); + }); + }); + + it('is chainable', function() { + const m = mquery().find({ x: 1 }).find().find({ y: 2 }); + assert.deepEqual(m._conditions, { x: 1, y: 2 }); + }); + + it('merges other queries', function() { + const m = mquery({ name: 'mquery' }); + m.tailable(); + m.select('_id'); + const a = mquery().find(m); + assert.deepEqual(a._conditions, m._conditions); + assert.deepEqual(a.options, m.options); + assert.deepEqual(a._fields, m._fields); + }); + + describe('executes', function() { + before(function(done) { + col.insertOne({ name: 'mquery' }, done); + }); + + after(function(done) { + col.remove({ name: 'mquery' }, done); + }); + + it('when criteria is passed with a callback', function(done) { + mquery(col).find({ name: 'mquery' }, function(err, docs) { + assert.ifError(err); + assert.equal(1, docs.length); + done(); + }); + }); + it('when Query is passed with a callback', function(done) { + const m = mquery({ name: 'mquery' }); + mquery(col).find(m, function(err, docs) { + assert.ifError(err); + assert.equal(1, docs.length); + done(); + }); + }); + it('when just a callback is passed', function(done) { + mquery({ name: 'mquery' }).collection(col).find(function(err, docs) { + assert.ifError(err); + assert.equal(1, docs.length); + done(); + }); + }); + }); + }); + + describe('findOne', function() { + describe('with no callback', function() { + it('does not execute', function() { + const m = mquery(); + assert.doesNotThrow(function() { + m.findOne(); + }); + assert.doesNotThrow(function() { + m.findOne({ x: 1 }); + }); + }); + }); + + it('is chainable', function() { + const m = mquery(); + const n = m.findOne({ x: 1 }).findOne().findOne({ y: 2 }); + assert.equal(m, n); + assert.deepEqual(m._conditions, { x: 1, y: 2 }); + assert.equal('findOne', m.op); + }); + + it('merges other queries', function() { + const m = mquery({ name: 'mquery' }); + m.read('nearest'); + m.select('_id'); + const a = mquery().findOne(m); + assert.deepEqual(a._conditions, m._conditions); + assert.deepEqual(a.options, m.options); + assert.deepEqual(a._fields, m._fields); + }); + + describe('executes', function() { + before(function(done) { + col.insertOne({ name: 'mquery findone' }, done); + }); + + after(function(done) { + col.remove({ name: 'mquery findone' }, done); + }); + + it('when criteria is passed with a callback', function(done) { + mquery(col).findOne({ name: 'mquery findone' }, function(err, doc) { + assert.ifError(err); + assert.ok(doc); + assert.equal('mquery findone', doc.name); + done(); + }); + }); + it('when Query is passed with a callback', function(done) { + const m = mquery(col).where({ name: 'mquery findone' }); + mquery(col).findOne(m, function(err, doc) { + assert.ifError(err); + assert.ok(doc); + assert.equal('mquery findone', doc.name); + done(); + }); + }); + it('when just a callback is passed', function(done) { + mquery({ name: 'mquery findone' }).collection(col).findOne(function(err, doc) { + assert.ifError(err); + assert.ok(doc); + assert.equal('mquery findone', doc.name); + done(); + }); + }); + }); + }); + + describe('count', function() { + describe('with no callback', function() { + it('does not execute', function() { + const m = mquery(); + assert.doesNotThrow(function() { + m.count(); + }); + assert.doesNotThrow(function() { + m.count({ x: 1 }); + }); + }); + }); + + it('is chainable', function() { + const m = mquery(); + const n = m.count({ x: 1 }).count().count({ y: 2 }); + assert.equal(m, n); + assert.deepEqual(m._conditions, { x: 1, y: 2 }); + assert.equal('count', m.op); + }); + + it('merges other queries', function() { + const m = mquery({ name: 'mquery' }); + m.read('nearest'); + m.select('_id'); + const a = mquery().count(m); + assert.deepEqual(a._conditions, m._conditions); + assert.deepEqual(a.options, m.options); + assert.deepEqual(a._fields, m._fields); + }); + + describe('executes', function() { + before(function(done) { + col.insertOne({ name: 'mquery count' }, done); + }); + + after(function(done) { + col.remove({ name: 'mquery count' }, done); + }); + + it('when criteria is passed with a callback', function(done) { + mquery(col).count({ name: 'mquery count' }, function(err, count) { + assert.ifError(err); + assert.ok(count); + assert.ok(1 === count); + done(); + }); + }); + it('when Query is passed with a callback', function(done) { + const m = mquery({ name: 'mquery count' }); + mquery(col).count(m, function(err, count) { + assert.ifError(err); + assert.ok(count); + assert.ok(1 === count); + done(); + }); + }); + it('when just a callback is passed', function(done) { + mquery({ name: 'mquery count' }).collection(col).count(function(err, count) { + assert.ifError(err); + assert.ok(1 === count); + done(); + }); + }); + }); + + describe('validates its option', function() { + it('sort', function(done) { + assert.doesNotThrow(function() { + mquery().sort('x').count(); + }); + done(); + }); + + it('select', function(done) { + assert.throws(function() { + mquery().select('x').count(); + }, /field selection and slice cannot be used with count/); + done(); + }); + + it('slice', function(done) { + assert.throws(function() { + mquery().where('x').slice(-3).count(); + }, /field selection and slice cannot be used with count/); + done(); + }); + + it('limit', function(done) { + assert.doesNotThrow(function() { + mquery().limit(3).count(); + }); + done(); + }); + + it('skip', function(done) { + assert.doesNotThrow(function() { + mquery().skip(3).count(); + }); + done(); + }); + + it('batchSize', function(done) { + assert.throws(function() { + mquery({}, { batchSize: 3 }).count(); + }, /batchSize cannot be used with count/); + done(); + }); + + it('maxScan', function(done) { + assert.throws(function() { + mquery().maxScan(300).count(); + }, /maxScan cannot be used with count/); + done(); + }); + + it('snapshot', function(done) { + assert.throws(function() { + mquery().snapshot().count(); + }, /snapshot cannot be used with count/); + done(); + }); + + it('tailable', function(done) { + assert.throws(function() { + mquery().tailable().count(); + }, /tailable cannot be used with count/); + done(); + }); + }); + }); + + describe('distinct', function() { + describe('with no callback', function() { + it('does not execute', function() { + const m = mquery(); + assert.doesNotThrow(function() { + m.distinct(); + }); + assert.doesNotThrow(function() { + m.distinct('name'); + }); + assert.doesNotThrow(function() { + m.distinct({ name: 'mquery distinct' }); + }); + assert.doesNotThrow(function() { + m.distinct({ name: 'mquery distinct' }, 'name'); + }); + }); + }); + + it('is chainable', function() { + const m = mquery({ x: 1 }).distinct('name'); + const n = m.distinct({ y: 2 }); + assert.equal(m, n); + assert.deepEqual(n._conditions, { x: 1, y: 2 }); + assert.equal('name', n._distinct); + assert.equal('distinct', n.op); + }); + + it('overwrites field', function() { + const m = mquery({ name: 'mquery' }).distinct('name'); + m.distinct('rename'); + assert.equal(m._distinct, 'rename'); + m.distinct({ x: 1 }, 'renamed'); + assert.equal(m._distinct, 'renamed'); + }); + + it('merges other queries', function() { + const m = mquery().distinct({ name: 'mquery' }, 'age'); + m.read('nearest'); + const a = mquery().distinct(m); + assert.deepEqual(a._conditions, m._conditions); + assert.deepEqual(a.options, m.options); + assert.deepEqual(a._fields, m._fields); + assert.deepEqual(a._distinct, m._distinct); + }); + + describe('executes', function() { + before(function(done) { + col.insertOne({ name: 'mquery distinct', age: 1 }, done); + }); + + after(function(done) { + col.remove({ name: 'mquery distinct' }, done); + }); + + it('when distinct arg is passed with a callback', function(done) { + mquery(col).distinct('distinct', function(err, doc) { + assert.ifError(err); + assert.ok(doc); + done(); + }); + }); + describe('when criteria is passed with a callback', function() { + it('if distinct arg was declared', function(done) { + mquery(col).distinct('age').distinct({ name: 'mquery distinct' }, function(err, doc) { + assert.ifError(err); + assert.ok(doc); + done(); + }); + }); + it('but not if distinct arg was not declared', function() { + assert.throws(function() { + mquery(col).distinct({ name: 'mquery distinct' }, function() {}); + }, /No value for `distinct`/); + }); + }); + describe('when Query is passed with a callback', function() { + const m = mquery({ name: 'mquery distinct' }); + it('if distinct arg was declared', function(done) { + mquery(col).distinct('age').distinct(m, function(err, doc) { + assert.ifError(err); + assert.ok(doc); + done(); + }); + }); + it('but not if distinct arg was not declared', function() { + assert.throws(function() { + mquery(col).distinct(m, function() {}); + }, /No value for `distinct`/); + }); + }); + describe('when just a callback is passed', function() { + it('if distinct arg was declared', function(done) { + const m = mquery({ name: 'mquery distinct' }); + m.collection(col); + m.distinct('age'); + m.distinct(function(err, doc) { + assert.ifError(err); + assert.ok(doc); + done(); + }); + }); + it('but not if no distinct arg was declared', function() { + const m = mquery(); + m.collection(col); + assert.throws(function() { + m.distinct(function() {}); + }, /No value for `distinct`/); + }); + }); + }); + + describe('validates its option', function() { + it('sort', function(done) { + assert.throws(function() { + mquery().sort('x').distinct(); + }, /sort cannot be used with distinct/); + done(); + }); + + it('select', function(done) { + assert.throws(function() { + mquery().select('x').distinct(); + }, /field selection and slice cannot be used with distinct/); + done(); + }); + + it('slice', function(done) { + assert.throws(function() { + mquery().where('x').slice(-3).distinct(); + }, /field selection and slice cannot be used with distinct/); + done(); + }); + + it('limit', function(done) { + assert.throws(function() { + mquery().limit(3).distinct(); + }, /limit cannot be used with distinct/); + done(); + }); + + it('skip', function(done) { + assert.throws(function() { + mquery().skip(3).distinct(); + }, /skip cannot be used with distinct/); + done(); + }); + + it('batchSize', function(done) { + assert.throws(function() { + mquery({}, { batchSize: 3 }).distinct(); + }, /batchSize cannot be used with distinct/); + done(); + }); + + it('maxScan', function(done) { + assert.throws(function() { + mquery().maxScan(300).distinct(); + }, /maxScan cannot be used with distinct/); + done(); + }); + + it('snapshot', function(done) { + assert.throws(function() { + mquery().snapshot().distinct(); + }, /snapshot cannot be used with distinct/); + done(); + }); + + it('hint', function(done) { + assert.throws(function() { + mquery().hint({ x: 1 }).distinct(); + }, /hint cannot be used with distinct/); + done(); + }); + + it('tailable', function(done) { + assert.throws(function() { + mquery().tailable().distinct(); + }, /tailable cannot be used with distinct/); + done(); + }); + }); + }); + + describe('update', function() { + describe('with no callback', function() { + it('does not execute', function() { + const m = mquery(); + assert.doesNotThrow(function() { + m.updateOne({ name: 'old' }, { name: 'updated' }, { multi: true }); + }); + assert.doesNotThrow(function() { + m.updateOne({ name: 'old' }, { name: 'updated' }); + }); + assert.doesNotThrow(function() { + m.updateOne({ name: 'updated' }); + }); + assert.doesNotThrow(function() { + m.updateOne(); + }); + }); + }); + + it('is chainable', function() { + const m = mquery({ x: 1 }).updateOne({ y: 2 }); + const n = m.where({ y: 2 }); + assert.equal(m, n); + assert.deepEqual(n._conditions, { x: 1, y: 2 }); + assert.deepEqual({ y: 2 }, n._update); + assert.equal('updateOne', n.op); + }); + + it('merges update doc arg', function() { + const a = [1, 2]; + const m = mquery().where({ name: 'mquery' }).updateOne({ x: 'stuff', a: a }); + m.updateOne({ z: 'stuff' }); + assert.deepEqual(m._update, { z: 'stuff', x: 'stuff', a: a }); + assert.deepEqual(m._conditions, { name: 'mquery' }); + assert.ok(!m.options.overwrite); + m.updateOne({}, { z: 'renamed' }, { overwrite: true }); + assert.ok(m.options.overwrite === true); + assert.deepEqual(m._conditions, { name: 'mquery' }); + assert.deepEqual(m._update, { z: 'renamed', x: 'stuff', a: a }); + a.push(3); + assert.notDeepEqual(m._update, { z: 'renamed', x: 'stuff', a: a }); + }); + + describe('executes', function() { + let id; + before(function(done) { + col.insertOne({ name: 'mquery update', age: 1 }, function(err, res) { + id = res.insertedId; + done(); + }); + }); + + after(function(done) { + col.remove({ _id: id }, done); + }); + + describe('when conds + doc + opts + callback passed', function() { + it('works', function(done) { + const m = mquery(col).where({ _id: id }); + m.updateOne({}, { name: 'Sparky' }, {}, function(err, res) { + assert.ifError(err); + assert.equal(res.modifiedCount, 1); + m.findOne(function(err, doc) { + assert.ifError(err); + assert.equal(doc.name, 'Sparky'); + done(); + }); + }); + }); + }); + + describe('when conds + doc + callback passed', function() { + it('works', function(done) { + const m = mquery(col).updateOne({ _id: id }, { name: 'fairgrounds' }, function(err, num) { + assert.ifError(err); + assert.ok(1, num); + m.findOne(function(err, doc) { + assert.ifError(err); + assert.equal(doc.name, 'fairgrounds'); + done(); + }); + }); + }); + }); + + describe('when doc + callback passed', function() { + it('works', function(done) { + const m = mquery(col).where({ _id: id }).updateOne({ name: 'changed' }, function(err, num) { + assert.ifError(err); + assert.ok(1, num); + m.findOne(function(err, doc) { + assert.ifError(err); + assert.equal(doc.name, 'changed'); + done(); + }); + }); + }); + }); + + describe('when just callback passed', function() { + it('works', function(done) { + const m = mquery(col).where({ _id: id }); + m.updateOne({ name: 'Frankenweenie' }); + m.updateOne(function(err, res) { + assert.ifError(err); + assert.equal(res.modifiedCount, 1); + m.findOne(function(err, doc) { + assert.ifError(err); + assert.equal(doc.name, 'Frankenweenie'); + done(); + }); + }); + }); + }); + + describe('without a callback', function() { + it('when forced by exec()', function(done) { + const m = mquery(col).where({ _id: id }); + m.setOptions({ w: 'majority' }); + m.updateOne({ name: 'forced' }); + + const update = m._collection.update; + m._collection.updateOne = function(conds, doc, opts) { + m._collection.update = update; + + assert.equal(opts.w, 'majority'); + assert.equal('forced', doc.$set.name); + done(); + }; + + m.exec(); + }); + }); + + describe('except when update doc is empty and missing overwrite flag', function() { + it('works', function(done) { + const m = mquery(col).where({ _id: id }); + m.updateOne({}, function(err, num) { + assert.ifError(err); + assert.ok(0 === num); + setTimeout(function() { + m.findOne(function(err, doc) { + assert.ifError(err); + assert.equal(3, mquery.utils.keys(doc).length); + assert.equal(id, doc._id.toString()); + assert.equal('Frankenweenie', doc.name); + done(); + }); + }, 300); + }); + }); + }); + + describe('when boolean (true) - exec()', function() { + it('works', function(done) { + const m = mquery(col).where({ _id: id }); + m.updateOne({ name: 'bool' }).updateOne(true); + setTimeout(function() { + m.findOne(function(err, doc) { + assert.ifError(err); + assert.ok(doc); + assert.equal('bool', doc.name); + done(); + }); + }, 300); + }); + }); + }); + }); + + describe('remove', function() { + describe('with 0 args', function() { + const name = 'remove: no args test'; + before(function(done) { + col.insertOne({ name: name }, done); + }); + after(function(done) { + col.remove({ name: name }, done); + }); + + it('does not execute', function(done) { + const remove = col.remove; + col.remove = function() { + col.remove = remove; + done(new Error('remove executed!')); + }; + + mquery(col).where({ name: name }).remove(); + setTimeout(function() { + col.remove = remove; + done(); + }, 10); + }); + + it('chains', function() { + const m = mquery(); + assert.equal(m, m.remove()); + }); + }); + + describe('with 1 argument', function() { + const name = 'remove: 1 arg test'; + before(function(done) { + col.insertOne({ name: name }, done); + }); + after(function(done) { + col.remove({ name: name }, done); + }); + + describe('that is a', function() { + it('plain object', function() { + const m = mquery(col).remove({ name: 'Whiskers' }); + m.remove({ color: '#fff' }); + assert.deepEqual({ name: 'Whiskers', color: '#fff' }, m._conditions); + }); + + it('query', function() { + const q = mquery({ color: '#fff' }); + const m = mquery(col).remove({ name: 'Whiskers' }); + m.remove(q); + assert.deepEqual({ name: 'Whiskers', color: '#fff' }, m._conditions); + }); + + it('function', function(done) { + mquery(col).where({ name: name }).remove(function(err) { + assert.ifError(err); + mquery(col).findOne({ name: name }, function(err, doc) { + assert.ifError(err); + assert.equal(null, doc); + done(); + }); + }); + }); + + it('boolean (true) - execute', function(done) { + col.insertOne({ name: name }, function(err) { + assert.ifError(err); + mquery(col).findOne({ name: name }, function(err, doc) { + assert.ifError(err); + assert.ok(doc); + mquery(col).remove(true); + setTimeout(function() { + mquery(col).find(function(err, docs) { + assert.ifError(err); + assert.ok(docs); + assert.equal(0, docs.length); + done(); + }); + }, 300); + }); + }); + }); + }); + }); + + describe('with 2 arguments', function() { + const name = 'remove: 2 arg test'; + beforeEach(function(done) { + col.remove({}, function(err) { + assert.ifError(err); + col.insertMany([{ name: 'shelly' }, { name: name }], function(err) { + assert.ifError(err); + mquery(col).find(function(err, docs) { + assert.ifError(err); + assert.equal(2, docs.length); + done(); + }); + }); + }); + }); + + describe('plain object + callback', function() { + it('works', function(done) { + mquery(col).remove({ name: name }, function(err) { + assert.ifError(err); + mquery(col).find(function(err, docs) { + assert.ifError(err); + assert.ok(docs); + assert.equal(1, docs.length); + assert.equal('shelly', docs[0].name); + done(); + }); + }); + }); + }); + + describe('mquery + callback', function() { + it('works', function(done) { + const m = mquery({ name: name }); + mquery(col).remove(m, function(err) { + assert.ifError(err); + mquery(col).find(function(err, docs) { + assert.ifError(err); + assert.ok(docs); + assert.equal(1, docs.length); + assert.equal('shelly', docs[0].name); + done(); + }); + }); + }); + }); + }); + }); + + function validateFindAndModifyOptions(method) { + describe('validates its option', function() { + it('sort', function(done) { + assert.doesNotThrow(function() { + mquery().sort('x')[method](); + }); + done(); + }); + + it('select', function(done) { + assert.doesNotThrow(function() { + mquery().select('x')[method](); + }); + done(); + }); + + it('limit', function(done) { + assert.throws(function() { + mquery().limit(3)[method](); + }, new RegExp('limit cannot be used with ' + method)); + done(); + }); + + it('skip', function(done) { + assert.throws(function() { + mquery().skip(3)[method](); + }, new RegExp('skip cannot be used with ' + method)); + done(); + }); + + it('batchSize', function(done) { + assert.throws(function() { + mquery({}, { batchSize: 3 })[method](); + }, new RegExp('batchSize cannot be used with ' + method)); + done(); + }); + + it('maxScan', function(done) { + assert.throws(function() { + mquery().maxScan(300)[method](); + }, new RegExp('maxScan cannot be used with ' + method)); + done(); + }); + + it('snapshot', function(done) { + assert.throws(function() { + mquery().snapshot()[method](); + }, new RegExp('snapshot cannot be used with ' + method)); + done(); + }); + + it('tailable', function(done) { + assert.throws(function() { + mquery().tailable()[method](); + }, new RegExp('tailable cannot be used with ' + method)); + done(); + }); + }); + } + + describe('findOneAndUpdate', function() { + let name = 'findOneAndUpdate + fn'; + + validateFindAndModifyOptions('findOneAndUpdate'); + + describe('with 0 args', function() { + it('makes no changes', function() { + const m = mquery(); + const n = m.findOneAndUpdate(); + assert.deepEqual(m, n); + }); + }); + describe('with 1 arg', function() { + describe('that is an object', function() { + it('updates the doc', function() { + const m = mquery(); + const n = m.findOneAndUpdate({ $set: { name: '1 arg' } }); + assert.deepEqual(n._update, { $set: { name: '1 arg' } }); + }); + }); + describe('that is a query', function() { + it('updates the doc', function() { + const m = mquery({ name: name }).updateOne({ x: 1 }); + const n = mquery().findOneAndUpdate(m); + assert.deepEqual(n._update, { x: 1 }); + }); + }); + it('that is a function', function(done) { + col.insertOne({ name: name }, function(err) { + assert.ifError(err); + const m = mquery({ name: name }).collection(col); + name = '1 arg'; + const n = m.updateOne({ $set: { name: name } }).setOptions({ returnDocument: 'after' }); + n.findOneAndUpdate(function(err, res) { + assert.ifError(err); + assert.ok(res.value); + assert.equal(res.value.name, name); + done(); + }); + }); + }); + }); + describe('with 2 args', function() { + it('conditions + update', function() { + const m = mquery(col); + m.findOneAndUpdate({ name: name }, { age: 100 }); + assert.deepEqual({ name: name }, m._conditions); + assert.deepEqual({ age: 100 }, m._update); + }); + it('query + update', function() { + const n = mquery({ name: name }); + const m = mquery(col); + m.findOneAndUpdate(n, { age: 100 }); + assert.deepEqual({ name: name }, m._conditions); + assert.deepEqual({ age: 100 }, m._update); + }); + it('update + callback', function(done) { + const m = mquery(col).where({ name: name }); + m.findOneAndUpdate({}, { $inc: { age: 10 } }, { returnDocument: 'after' }, function(err, res) { + assert.ifError(err); + assert.equal(10, res.value.age); + done(); + }); + }); + }); + describe('with 3 args', function() { + it('conditions + update + options', function() { + const m = mquery(); + const n = m.findOneAndUpdate({ name: name }, { works: true }, { returnDocument: 'before' }); + assert.deepEqual({ name: name }, n._conditions); + assert.deepEqual({ works: true }, n._update); + assert.deepEqual({ returnDocument: 'before' }, n.options); + }); + it('conditions + update + callback', function(done) { + const m = mquery(col); + m.findOneAndUpdate({ name: name }, { works: true }, { returnDocument: 'after' }, function(err, res) { + assert.ifError(err); + assert.ok(res.value); + assert.equal(name, res.value.name); + assert.ok(true === res.value.works); + done(); + }); + }); + }); + describe('with 4 args', function() { + it('conditions + update + options + callback', function(done) { + const m = mquery(col); + m.findOneAndUpdate({ name: name }, { works: false }, {}, function(err, res) { + assert.ifError(err); + assert.ok(res.value); + assert.equal(name, res.value.name); + assert.ok(true === res.value.works); + done(); + }); + }); + }); + }); + + describe('findOneAndRemove', function() { + let name = 'findOneAndRemove'; + + validateFindAndModifyOptions('findOneAndRemove'); + + describe('with 0 args', function() { + it('makes no changes', function() { + const m = mquery(); + const n = m.findOneAndRemove(); + assert.deepEqual(m, n); + }); + }); + describe('with 1 arg', function() { + describe('that is an object', function() { + it('updates the doc', function() { + const m = mquery(); + const n = m.findOneAndRemove({ name: '1 arg' }); + assert.deepEqual(n._conditions, { name: '1 arg' }); + }); + }); + describe('that is a query', function() { + it('updates the doc', function() { + const m = mquery({ name: name }); + const n = m.findOneAndRemove(m); + assert.deepEqual(n._conditions, { name: name }); + }); + }); + it('that is a function', function(done) { + col.insertOne({ name: name }, function(err) { + assert.ifError(err); + const m = mquery({ name: name }).collection(col); + m.findOneAndRemove(function(err, res) { + assert.ifError(err); + assert.ok(res.value); + assert.equal(name, res.value.name); + done(); + }); + }); + }); + }); + describe('with 2 args', function() { + it('conditions + options', function() { + const m = mquery(col); + m.findOneAndRemove({ name: name }, { returnDocument: 'after' }); + assert.deepEqual({ name: name }, m._conditions); + assert.deepEqual({ returnDocument: 'after' }, m.options); + }); + it('query + options', function() { + const n = mquery({ name: name }); + const m = mquery(col); + m.findOneAndRemove(n, { sort: { x: 1 } }); + assert.deepEqual({ name: name }, m._conditions); + assert.deepEqual({ sort: { x: 1 } }, m.options); + }); + it('conditions + callback', function(done) { + col.insertOne({ name: name }, function(err) { + assert.ifError(err); + const m = mquery(col); + m.findOneAndRemove({ name: name }, function(err, res) { + assert.ifError(err); + assert.equal(name, res.value.name); + done(); + }); + }); + }); + it('query + callback', function(done) { + col.insertOne({ name: name }, function(err) { + assert.ifError(err); + const n = mquery({ name: name }); + const m = mquery(col); + m.findOneAndRemove(n, function(err, res) { + assert.ifError(err); + assert.equal(name, res.value.name); + done(); + }); + }); + }); + }); + describe('with 3 args', function() { + it('conditions + options + callback', function(done) { + name = 'findOneAndRemove + conds + options + cb'; + col.insertMany([{ name: name }, { name: 'a' }], function(err) { + assert.ifError(err); + const m = mquery(col); + m.findOneAndRemove({ name: name }, { sort: { name: 1 } }, function(err, res) { + assert.ifError(err); + assert.ok(res.value); + assert.equal(name, res.value.name); + done(); + }); + }); + }); + }); + }); + + describe('exec', function() { + beforeEach(function(done) { + col.insertMany([{ name: 'exec', age: 1 }, { name: 'exec', age: 2 }], done); + }); + + afterEach(function(done) { + mquery(col).remove(done); + }); + + it('requires an op', function() { + assert.throws(function() { + mquery().exec(); + }, /Missing query type/); + }); + + describe('find', function() { + it('works', function(done) { + const m = mquery(col).find({ name: 'exec' }); + m.exec(function(err, docs) { + assert.ifError(err); + assert.equal(2, docs.length); + done(); + }); + }); + + it('works with readPreferences', function(done) { + const m = mquery(col).find({ name: 'exec' }); + try { + const ReadPreference = require('mongodb').ReadPreference; + const rp = new ReadPreference('primary'); + m.read(rp); + } catch (e) { + done(e.code === 'MODULE_NOT_FOUND' ? null : e); + return; + } + m.exec(function(err, docs) { + assert.ifError(err); + assert.equal(2, docs.length); + done(); + }); + }); + + it('works with hint', function(done) { + mquery(col).hint({ _id: 1 }).find({ name: 'exec' }).exec(function(err, docs) { + assert.ifError(err); + assert.equal(2, docs.length); + + mquery(col).hint('_id_').find({ age: 1 }).exec(function(err, docs) { + assert.ifError(err); + assert.equal(1, docs.length); + done(); + }); + }); + }); + + it('works with readConcern', function(done) { + const m = mquery(col).find({ name: 'exec' }); + m.readConcern('l'); + m.exec(function(err, docs) { + assert.ifError(err); + assert.equal(2, docs.length); + done(); + }); + }); + + it('works with collation', function(done) { + const m = mquery(col).find({ name: 'EXEC' }); + m.collation({ locale: 'en_US', strength: 1 }); + m.exec(function(err, docs) { + assert.ifError(err); + assert.equal(2, docs.length); + done(); + }); + }); + }); + + it('findOne', function(done) { + const m = mquery(col).findOne({ age: 2 }); + m.exec(function(err, doc) { + assert.ifError(err); + assert.equal(2, doc.age); + done(); + }); + }); + + it('count', function(done) { + const m = mquery(col).count({ name: 'exec' }); + m.exec(function(err, count) { + assert.ifError(err); + assert.equal(2, count); + done(); + }); + }); + + it('distinct', function(done) { + const m = mquery({ name: 'exec' }); + m.collection(col); + m.distinct('age'); + m.exec(function(err, array) { + assert.ifError(err); + assert.ok(Array.isArray(array)); + assert.equal(2, array.length); + assert(~array.indexOf(1)); + assert(~array.indexOf(2)); + done(); + }); + }); + + describe('update', function() { + describe('updateMany', function() { + it('works', function(done) { + mquery(col).updateMany({ name: 'exec' }, { name: 'test' }). + exec(function(error) { + assert.ifError(error); + mquery(col).count({ name: 'test' }).exec(function(error, res) { + assert.ifError(error); + assert.equal(res, 2); + done(); + }); + }); + }); + it('works with write concern', function(done) { + mquery(col).updateMany({ name: 'exec' }, { name: 'test' }) + .w(1).j(true).wtimeout(1000) + .exec(function(error) { + assert.ifError(error); + mquery(col).count({ name: 'test' }).exec(function(error, res) { + assert.ifError(error); + assert.equal(res, 2); + done(); + }); + }); + }); + }); + + describe('updateOne', function() { + it('works', function(done) { + mquery(col).updateOne({ name: 'exec' }, { name: 'test' }). + exec(function(error) { + assert.ifError(error); + mquery(col).count({ name: 'test' }).exec(function(error, res) { + assert.ifError(error); + assert.equal(res, 1); + done(); + }); + }); + }); + }); + + describe('replaceOne', function() { + it('works', function(done) { + mquery(col).replaceOne({ name: 'exec' }, { name: 'test' }). + exec(function(error) { + assert.ifError(error); + mquery(col).findOne({ name: 'test' }).exec(function(error, res) { + assert.ifError(error); + assert.equal(res.name, 'test'); + assert.ok(res.age == null); + done(); + }); + }); + }); + }); + }); + + describe('remove', function() { + it('with a callback', function(done) { + const m = mquery(col).where({ age: 2 }).remove(); + m.exec(function(err, res) { + assert.ifError(err); + assert.equal(1, res.deletedCount); + done(); + }); + }); + + it('without a callback', function(done) { + const m = mquery(col).where({ age: 1 }).remove(); + m.exec(); + + setTimeout(function() { + mquery(col).where('name', 'exec').count(function(err, num) { + assert.equal(1, num); + done(); + }); + }, 200); + }); + }); + + describe('deleteOne', function() { + it('with a callback', function(done) { + const m = mquery(col).where({ age: { $gte: 0 } }).deleteOne(); + m.exec(function(err, res) { + assert.ifError(err); + assert.equal(res.deletedCount, 1); + done(); + }); + }); + + it('with justOne set', function(done) { + const m = mquery(col).where({ age: { $gte: 0 } }). + // Should ignore `justOne` + setOptions({ justOne: false }). + deleteOne(); + m.exec(function(err, res) { + assert.ifError(err); + assert.equal(res.deletedCount, 1); + done(); + }); + }); + }); + + describe('deleteMany', function() { + it('with a callback', function(done) { + const m = mquery(col).where({ age: { $gte: 0 } }).deleteMany(); + m.exec(function(err, res) { + assert.ifError(err); + assert.equal(res.deletedCount, 2); + done(); + }); + }); + }); + + describe('findOneAndUpdate', function() { + it('with a callback', function(done) { + const m = mquery(col); + m.findOneAndUpdate({ name: 'exec', age: 1 }, { $set: { name: 'findOneAndUpdate' } }, { returnDocument: 'after' }); + m.exec(function(err, res) { + assert.ifError(err); + assert.equal('findOneAndUpdate', res.value.name); + done(); + }); + }); + }); + + describe('findOneAndRemove', function() { + it('with a callback', function(done) { + const m = mquery(col); + m.findOneAndRemove({ name: 'exec', age: 2 }); + m.exec(function(err, res) { + assert.ifError(err); + assert.equal('exec', res.value.name); + assert.equal(2, res.value.age); + mquery(col).count({ name: 'exec' }, function(err, num) { + assert.ifError(err); + assert.equal(1, num); + done(); + }); + }); + }); + }); + }); + + describe('setTraceFunction', function() { + beforeEach(function(done) { + col.insertMany([{ name: 'trace', age: 93 }], done); + }); + + it('calls trace function when executing query', function(done) { + const m = mquery(col); + + let resultTraceCalled; + + m.setTraceFunction(function(method, queryInfo) { + try { + assert.equal('findOne', method); + assert.equal('trace', queryInfo.conditions.name); + } catch (e) { + done(e); + } + + return function(err, result, millis) { + try { + assert.equal(93, result.age); + assert.ok(typeof millis === 'number'); + } catch (e) { + done(e); + } + resultTraceCalled = true; + }; + }); + + m.findOne({ name: 'trace' }, function(err, doc) { + assert.ifError(err); + assert.equal(resultTraceCalled, true); + assert.equal(93, doc.age); + done(); + }); + }); + + it('inherits trace function when calling toConstructor', function(done) { + function traceFunction() { return function() {}; } + + const tracedQuery = mquery().setTraceFunction(traceFunction).toConstructor(); + + const query = tracedQuery(); + assert.equal(traceFunction, query._traceFunction); + + done(); + }); + }); + + describe('thunk', function() { + it('returns a function', function(done) { + assert.equal('function', typeof mquery().thunk()); + done(); + }); + + it('passes the fn arg to `exec`', function(done) { + function cb() {} + const m = mquery(); + + m.exec = function testing(fn) { + assert.equal(this, m); + assert.equal(cb, fn); + done(); + }; + + m.thunk()(cb); + }); + }); + + describe('then', function() { + before(function(done) { + col.insertMany([{ name: 'then', age: 1 }, { name: 'then', age: 2 }], done); + }); + + after(function(done) { + mquery(col).remove({ name: 'then' }).exec(done); + }); + + it('returns a promise A+ compat object', function(done) { + const m = mquery(col).find(); + assert.equal('function', typeof m.then); + done(); + }); + + it('creates a promise that is resolved on success', function(done) { + const promise = mquery(col).count({ name: 'then' }).then(); + promise.then(function(count) { + assert.equal(2, count); + done(); + }, done); + }); + + it('supports exec() cb being called synchronously #66', function(done) { + const query = mquery(col).count({ name: 'then' }); + query.exec = function(cb) { + cb(null, 66); + }; + + query.then(success, done); + function success(count) { + assert.equal(66, count); + done(); + } + }); + }); + + describe('stream', function() { + before(function(done) { + col.insertMany([{ name: 'stream', age: 1 }, { name: 'stream', age: 2 }], done); + }); + + after(function(done) { + mquery(col).remove({ name: 'stream' }).exec(done); + }); + + describe('throws', function() { + describe('if used with non-find operations', function() { + const ops = ['update', 'findOneAndUpdate', 'remove', 'count', 'distinct']; + + ops.forEach(function(op) { + assert.throws(function() { + mquery(col)[op]().stream(); + }); + }); + }); + }); + + it('returns a stream', function(done) { + const stream = mquery(col).find({ name: 'stream' }).cursor().stream(); + let count = 0; + let err; + + stream.on('data', function(doc) { + assert.equal('stream', doc.name); + ++count; + }); + + stream.on('error', function(er) { + err = er; + }); + + stream.on('end', function() { + if (err) return done(err); + assert.equal(2, count); + done(); + }); + }); + }); + + function noDistinct(type) { + it('cannot be used with distinct()', function(done) { + assert.throws(function() { + mquery().distinct('name')[type](4); + }, new RegExp(type + ' cannot be used with distinct')); + done(); + }); + } + + function no(method, type) { + it('cannot be used with ' + method + '()', function(done) { + assert.throws(function() { + mquery()[method]()[type](4); + }, new RegExp(type + ' cannot be used with ' + method)); + done(); + }); + } + + // query internal + + describe('_updateForExec', function() { + it('returns a clone of the update object with same key order #19', function(done) { + const update = {}; + update.$push = { n: { $each: [{ x: 10 }], $slice: -1, $sort: { x: 1 } } }; + + const q = mquery().updateOne({ x: 1 }, update); + + // capture original key order + const order = []; + let key; + for (key in q._update.$push.n) { + order.push(key); + } + + // compare output + const doc = q._updateForExec(); + let i = 0; + for (key in doc.$push.n) { + assert.equal(key, order[i]); + i++; + } + + done(); + }); + }); +}); diff --git a/node_modules/mquery/test/utils.test.js b/node_modules/mquery/test/utils.test.js new file mode 100644 index 000000000..9b21807c4 --- /dev/null +++ b/node_modules/mquery/test/utils.test.js @@ -0,0 +1,182 @@ +'use strict'; + +const utils = require('../lib/utils'); +const assert = require('assert'); +const debug = require('debug'); + +let mongo; +try { + mongo = new require('mongodb'); +} catch (e) { + debug('mongo', 'cannot construct mongodb instance'); +} + +describe('lib/utils', function() { + describe('clone', function() { + it('clones constructors named ObjectId', function(done) { + function ObjectId(id) { + this.id = id; + } + + const o1 = new ObjectId('1234'); + const o2 = utils.clone(o1); + assert.ok(o2 instanceof ObjectId); + + done(); + }); + + it('clones constructors named ObjectID', function(done) { + function ObjectID(id) { + this.id = id; + } + + const o1 = new ObjectID('1234'); + const o2 = utils.clone(o1); + + assert.ok(o2 instanceof ObjectID); + done(); + }); + + it('clones RegExp', function(done) { + const sampleRE = /a/giy; + + const clonedRE = utils.clone(sampleRE); + + assert.ok(clonedRE !== sampleRE); + assert.ok(clonedRE instanceof RegExp); + assert.ok(clonedRE.source === 'a'); + assert.ok(clonedRE.flags === 'giy'); + done(); + }); + + it('clones Buffer', function(done) { + const buf1 = Buffer.alloc(10); + + const buf2 = utils.clone(buf1); + + assert.ok(buf2 instanceof Buffer); + done(); + }); + + it('does not clone constructors named ObjectIdd', function(done) { + function ObjectIdd(id) { + this.id = id; + } + + const o1 = new ObjectIdd('1234'); + const o2 = utils.clone(o1); + assert.ok(!(o2 instanceof ObjectIdd)); + + done(); + }); + + it('optionally clones ObjectId constructors using its clone method', function(done) { + function ObjectID(id) { + this.id = id; + this.cloned = false; + } + + ObjectID.prototype.clone = function() { + const ret = new ObjectID(this.id); + ret.cloned = true; + return ret; + }; + + const id = 1234; + const o1 = new ObjectID(id); + assert.equal(id, o1.id); + assert.equal(false, o1.cloned); + + const o2 = utils.clone(o1); + assert.ok(o2 instanceof ObjectID); + assert.equal(id, o2.id); + assert.ok(o2.cloned); + done(); + }); + + it('clones mongodb.ReadPreferences', function(done) { + if (!mongo) return done(); + + const tags = [ + { dc: 'tag1' } + ]; + const prefs = [ + new mongo.ReadPreference('primary'), + new mongo.ReadPreference(mongo.ReadPreference.PRIMARY_PREFERRED), + new mongo.ReadPreference('secondary', tags) + ]; + + const prefsCloned = utils.clone(prefs); + + for (let i = 0; i < prefsCloned.length; i++) { + assert.notEqual(prefs[i], prefsCloned[i]); + if (prefs[i].tags) { + assert.ok(prefsCloned[i].tags); + assert.notEqual(prefs[i].tags, prefsCloned[i].tags); + assert.notEqual(prefs[i].tags[0], prefsCloned[i].tags[0]); + } else { + assert.equal(prefsCloned[i].tags, null); + } + } + + done(); + }); + + it('clones mongodb.Binary', function(done) { + if (!mongo) return done(); + const buf = Buffer.from('hi'); + const binary = new mongo.Binary(buf, 2); + const clone = utils.clone(binary); + assert.equal(binary.sub_type, clone.sub_type); + assert.equal(String(binary.buffer), String(buf)); + assert.ok(binary !== clone); + done(); + }); + + it('handles objects with no constructor', function(done) { + const name = '335'; + + const o = Object.create(null); + o.name = name; + + let clone; + assert.doesNotThrow(function() { + clone = utils.clone(o); + }); + + assert.equal(name, clone.name); + assert.ok(o != clone); + done(); + }); + + it('handles buffers', function(done) { + const buff = Buffer.alloc(10); + buff.fill(1); + const clone = utils.clone(buff); + + for (let i = 0; i < buff.length; i++) { + assert.equal(buff[i], clone[i]); + } + + done(); + }); + + it('skips __proto__', function() { + const payload = JSON.parse('{"__proto__": {"polluted": "vulnerable"}}'); + const res = utils.clone(payload); + + assert.strictEqual({}.polluted, void 0); + assert.strictEqual(res.__proto__, Object.prototype); + }); + }); + + describe('merge', function() { + it('avoids prototype pollution', function() { + const payload = JSON.parse('{"__proto__": {"polluted": "vulnerable"}}'); + const obj = {}; + utils.merge(obj, payload); + + assert.strictEqual({}.polluted, void 0); + }); + }); +}); diff --git a/node_modules/mumaker/lib/download/igstory.js b/node_modules/mumaker/lib/download/igstory.js new file mode 100644 index 000000000..2b238fa15 --- /dev/null +++ b/node_modules/mumaker/lib/download/igstory.js @@ -0,0 +1,53 @@ +const qs = require('qs') +const cheerio = require('cheerio') +const axios = require('axios') +const { + default: Axios +} = require('axios') +const cookie = require('cookie') +const fetch = require('node-fetch') +const FormData = require('form-data') + + +function igstory(username) { + return new Promise(async (resolve, reject) => { + axios.request({ + url: 'https://www.instagramsave.com/instagram-story-downloader.php', + method: 'GET', + headers: { + "user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36", + "cookie": "PHPSESSID=ugpgvu6fgc4592jh7ht9d18v49; _ga=GA1.2.1126798330.1625045680; _gid=GA1.2.1475525047.1625045680; __gads=ID=92b58ed9ed58d147-221917af11ca0021:T=1625045679:RT=1625045679:S=ALNI_MYnQToDW3kOUClBGEzULNjeyAqOtg" + } + }) + .then(({ + data + }) => { + const $ = cheerio.load(data) + const token = $('#token').attr('value') + let config = { + headers: { + 'content-type': 'application/x-www-form-urlencoded; charset=UTF-8', + "sec-ch-ua": '" Not;A Brand";v="99", "Google Chrome";v="91", "Chromium";v="91"', + "cookie": "PHPSESSID=ugpgvu6fgc4592jh7ht9d18v49; _ga=GA1.2.1126798330.1625045680; _gid=GA1.2.1475525047.1625045680; __gads=ID=92b58ed9ed58d147-221917af11ca0021:T=1625045679:RT=1625045679:S=ALNI_MYnQToDW3kOUClBGEzULNjeyAqOtg", + "user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36", + }, + data: { + 'url': 'https://www.instagram.com/' + username, + 'action': 'story', + 'token': token + } + } + axios.post('https://www.instagramsave.com/system/action.php', qs.stringify(config.data), { + headers: config.headers + }) + .then(({ + data + }) => { + resolve(data.medias) + }) + }) + .catch(reject) + }) +} + +module.exports = igstory; \ No newline at end of file diff --git a/node_modules/mumaker/lib/download/instagram.js b/node_modules/mumaker/lib/download/instagram.js new file mode 100644 index 000000000..41f49ced9 --- /dev/null +++ b/node_modules/mumaker/lib/download/instagram.js @@ -0,0 +1,53 @@ +const qs = require('qs') +const cheerio = require('cheerio') +const axios = require('axios') +const { + default: Axios +} = require('axios') +const cookie = require('cookie') +const fetch = require('node-fetch') +const FormData = require('form-data') + + +function instagram(url) { + return new Promise(async (resolve, reject) => { + axios.request({ + url: 'https://www.instagramsave.com/download-instagram-videos.php', + method: 'GET', + headers: { + "user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36", + "cookie": "PHPSESSID=ugpgvu6fgc4592jh7ht9d18v49; _ga=GA1.2.1126798330.1625045680; _gid=GA1.2.1475525047.1625045680; __gads=ID=92b58ed9ed58d147-221917af11ca0021:T=1625045679:RT=1625045679:S=ALNI_MYnQToDW3kOUClBGEzULNjeyAqOtg" + } + }) + .then(({ + data + }) => { + const $ = cheerio.load(data) + const token = $('#token').attr('value') + let config = { + headers: { + 'content-type': 'application/x-www-form-urlencoded; charset=UTF-8', + "sec-ch-ua": '" Not;A Brand";v="99", "Google Chrome";v="91", "Chromium";v="91"', + "cookie": "PHPSESSID=ugpgvu6fgc4592jh7ht9d18v49; _ga=GA1.2.1126798330.1625045680; _gid=GA1.2.1475525047.1625045680; __gads=ID=92b58ed9ed58d147-221917af11ca0021:T=1625045679:RT=1625045679:S=ALNI_MYnQToDW3kOUClBGEzULNjeyAqOtg", + "user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36", + }, + data: { + 'url': url, + 'action': 'post', + 'token': token + } + } + axios.post('https://www.instagramsave.com/system/action.php', qs.stringify(config.data), { + headers: config.headers + }) + .then(({ + data + }) => { + resolve(data.medias) + }) + }) + .catch(reject) + }) +} + +module.exports = instagram; \ No newline at end of file diff --git a/node_modules/mumaker/lib/download/mediafire.js b/node_modules/mumaker/lib/download/mediafire.js new file mode 100644 index 000000000..b4f2f09fd --- /dev/null +++ b/node_modules/mumaker/lib/download/mediafire.js @@ -0,0 +1,31 @@ +const qs = require('qs') +const cheerio = require('cheerio') +const axios = require('axios') +const { + default: Axios +} = require('axios') +const cookie = require('cookie') +const fetch = require('node-fetch') +const FormData = require('form-data') + + +const mediafire = async (url) => { + const res = await axios.get(url) + const $ = cheerio.load(res.data) + const hasil = [] + const link = $('a#downloadButton').attr('href') + const size = $('a#downloadButton').text().replace('Download', '').replace('(', '').replace(')', '').replace('\n', '').replace('\n', '').replace(' ', '') + const seplit = link.split('/') + const nama = seplit[5] + mime = nama.split('.') + mime = mime[1] + hasil.push({ + nama, + mime, + size, + link + }) + return hasil +} + +module.exports = mediafire; \ No newline at end of file diff --git a/node_modules/mumaker/lib/download/tiktok.js b/node_modules/mumaker/lib/download/tiktok.js new file mode 100644 index 000000000..d6a95ab06 --- /dev/null +++ b/node_modules/mumaker/lib/download/tiktok.js @@ -0,0 +1,55 @@ +const qs = require('qs') +const cheerio = require('cheerio') +const axios = require('axios') +const { + default: Axios +} = require('axios') +const cookie = require('cookie') +const fetch = require('node-fetch') +const FormData = require('form-data') + + +function tiktok(url) { + return new Promise(async (resolve, reject) => { + axios.get('https://ttdownloader.com/', { + headers: { + "accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9", + "user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36", + "cookie": "PHPSESSID=9ut8phujrprrmll6oc3bist01t; popCookie=1; _ga=GA1.2.1068750365.1625213061; _gid=GA1.2.842420949.1625213061" + } + }) + .then(({ + data + }) => { + const $ = cheerio.load(data) + let token = $('#token').attr('value') + let config = { + 'url': url, + 'format': '', + 'token': token + } + axios('https://ttdownloader.com/req/', { + method: 'POST', + data: new URLSearchParams(Object.entries(config)), + headers: { + "accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9", + "user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36", + "cookie": "PHPSESSID=9ut8phujrprrmll6oc3bist01t; popCookie=1; _ga=GA1.2.1068750365.1625213061; _gid=GA1.2.842420949.1625213061" + } + }) + .then(({ + data + }) => { + const $ = cheerio.load(data) + resolve({ + nowm: $('div:nth-child(2) > div.download > a').attr('href'), + wm: $('div:nth-child(3) > div.download > a').attr('href'), + audio: $('div:nth-child(4) > div.download > a').attr('href') + }) + }) + }) + .catch(reject) + }) +} + +module.exports = tiktok; \ No newline at end of file diff --git a/node_modules/mumaker/lib/stalk/igstalk.js b/node_modules/mumaker/lib/stalk/igstalk.js new file mode 100644 index 000000000..27dda7419 --- /dev/null +++ b/node_modules/mumaker/lib/stalk/igstalk.js @@ -0,0 +1,42 @@ +const axios = require("axios") +const cheerio = require("cheerio") + + +function igstalk(username) { + return new Promise((resolve, reject) => { + axios.get('https://www.instagram.com/' + username + '/?__a=1', { + method: 'GET', + headers: { + "user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.114 Safari/537.36", + "cookie": "mid=XBXl1AALAAEbFoAEfNjZlMMG9dwX; ig_did=91E66A48-5AA2-445D-BFE6-84DC4456DE8F; fbm_124024574287414=base_domain=.instagram.com; ig_nrcb=1; shbid=\"12737\0544008624962\0541656157971:01f72a5102dc07af6845adf923ca70eb86e81ab95fa9dbfdaf157c9eef0e82fd1f10fe23\"; shbts=\"1624621971\0544008624962\0541656157971:01f74841fba8e77a0066b47ea891dec8fba6fdf9216c0816f9fb3532292f769828800ae2\"; fbsr_124024574287414=86D8femzH4_KFW4hd3Z6XFdowU6lG-uXsXRQDNl44VM.eyJ1c2VyX2lkIjoiMTAwMDA0Njc2MDc4Nzg5IiwiY29kZSI6IkFRQngzXzVOejdwVnBwby1LRGRUdEYxUFlzcUdDQXJjcmJfb05HaWFvYkNvOGtLN2paam50bHpvMTNOakFnTzVKOHQ5M0V3U3dvNkRtZ0RiY1l1Z3dQSTIybnExOUxLd3lpZTVfZll0bkNXZXBuM1hoYWFLX0w2R0pZaUpzaDBOTDBhb3pmTVBkRTVQRC12X3FnbUgxLXZYdGVmcHhfaFU0aUZNZVMxNHhFUk5Obl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RcmlTQ2pLUE5XbVcyNWhudzIzejJBSnVURW00YWR1cmN6a3ZLWU1icTd2SnN0SVdJV09RIiwib2F1dGhfdG9rZW4iOiJFQUFCd3pMaXhuallCQUJBZmJuQ3haQzZMd3h4MDFJV2MyZ3dsQ3k3Qmp0b05UNUY0WDY2NHBrUzRQeERNVXRsdmhWWkI3SXE0MGsyZ2hJQm55RHRPcW5iVjlPbUNiWGhyTFBaQUhBQjFzVFpBdHF6RFEzVTROUkhOU1V6MFVXWkNtTEdLcDNNWDRoazVIOURLbERHN0QwUlhZNHY4dHBCdVNNYjN4dnBTRGtQcHdYRlBXVU82VCIsImFsZ29yaXRobSI6IkhNQUMtU0hBMjU2IiwiaXNzdWVkX2F0IjoxNjI0NjIxOTgxfQ; csrftoken=PpiPMEl0R2pAwThsw4NXynO6cVIXHZDo; ds_user_id=38316792800; sessionid=38316792800:rQj5Tr3g5zkg7b:4; rur=\"RVA\05438316792800\0541656158332:01f759cf624bef147397144805bb4c26f6c8b36a232e0f5738c570ee492f6b629f84f6e5\"" + } + }) + .then(({ + data + }) => { + const user = data.graphql.user + let result = { + message: 'By Hexagon', + id: user.id, + biography: user.biography, + followers: user.edge_followed_by.count, + following: user.edge_follow.count, + fullName: user.full_name, + highlightCount: user.highlight_reel_count, + isBusinessAccount: user.is_business_account, + isRecentUser: user.is_joined_recently, + accountCategory: user.business_category_name, + linkedFacebookPage: user.connected_fb_page, + isPrivate: user.is_private, + isVerified: user.is_verified, + profilePicHD: user.profile_pic_url_hd, + username: user.username, + postsCount: user.edge_owner_to_timeline_media.count + } + resolve(result) + }) + .catch(reject) + }) +} + +module.exports = igstalk; \ No newline at end of file diff --git a/node_modules/mumaker/lib/textmaker/ephoto.js b/node_modules/mumaker/lib/textmaker/ephoto.js new file mode 100644 index 000000000..15e059d52 --- /dev/null +++ b/node_modules/mumaker/lib/textmaker/ephoto.js @@ -0,0 +1,90 @@ +const fetch = require("node-fetch"); +const cheerio = require("cheerio"); +const cookie = require("cookie"); +const axios = require("axios"); +const FormData = require("form-data"); + + +function gaspost(url, form1, headers = {}) { + let e = encodeURIComponent + pormdata = form1.replace('{"radio":"', '"radio=').replace('"}', '"') + tespor = 'radio0=radio=ok' + const formdata = JSON.parse(form1) + let body = Object.keys(formdata).map(key => { + let vals = formdata[key] + let isArray = Array.isArray(vals) + let keyq = e(key + (isArray ? '[]' : '')) + if (!isArray) vals = [vals] + let out = [] + for (let valq of vals) out.push(keyq + '=' + e(valq)) + return out.join('&') + }).join('&') + body2 = body.split('radio0=%5Bobject%20Object%5D').join('radio0%5Bradio%5D='+formdata.radio0.radio) + //console.log(formdata) + return axios(url, { + method: 'POST', + headers: { + accept: '/', + 'accept-language': "en-US,en;q=0.9", + 'content-type': "application/x-www-form-urlencoded; charset=UTF-8", + 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.150 Safari/537.36', + ...headers + }, + data: body2 + }) +} +async function ephoto(url, texts = ['text'], radio0) { + if (!/^https:\/\/ephoto360\.com\/.+\.html$/.test(url)) throw new Error('Invalid URL') + let res = await axios.get(url,{ + method: 'GET', + headers: { + accept: '/', + 'accept-language': "en-US,en;q=0.9", + 'content-type': "application/x-www-form-urlencoded; charset=UTF-8", + 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.150 Safari/537.36' + }}) + let html = res.data + //console.log(res.headers) + const cfuid = res.headers['set-cookie'][0].split(',').map(v => cookie.parse(v)).reduce((a, c) => { return {...a, ...c} }, {}) + //console.log('ini cfuid == ' + cfuid) + const phpses = res.headers['set-cookie'][0].split(',').map(v => cookie.parse(v)).reduce((a, c) => { return {...a, ...c} }, {}) + cookies = { + _cfduid: cfuid._cfduid, + PHPSESSID: phpses.PHPSESSID, + } + let forms = { + submit: 'Create a photo', + token: /name="token".*value="(.+?)"/.exec(html)[1], + build_server: 'https://s1.ephoto360.com/', + build_server_id: 1, + "radio0[radio]": radio0 + } + let form = new FormData + if (typeof texts === 'string') texts = [texts] + for (let text of texts) form.append('text[]', text) + for (let key in forms) form.append(key, forms[key]) + + cookies = Object.entries(cookies).map(([ name, value ]) => cookie.serialize(name, value)).join('; ') + //console.log(cookies) + let res2 = await axios(url, { + method: 'POST', + headers: { + accept: '/', + 'accept-language': "en-US,en;q=0.9", + ...form.getHeaders(), + cookie: cookies, + 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.150 Safari/537.36' + }, + data: form.getBuffer() + }) + let html2 = res2.data + let form_value = /name="form_value_input".*value="(.+?)"/.exec(html2) + if (!form_value) throw new Error('Token invalid? ' + /No token/i.test(html2)) + let tokenval = form_value[1].split('"').join('"') + let res3 = await gaspost('https://ephoto360.com/effect/create-image', tokenval, { + cookie: cookies + }) + return await res3.data +} + +module.exports = ephoto; \ No newline at end of file diff --git a/node_modules/mumaker/lib/textmaker/ephoto2.js b/node_modules/mumaker/lib/textmaker/ephoto2.js new file mode 100644 index 000000000..53186a368 --- /dev/null +++ b/node_modules/mumaker/lib/textmaker/ephoto2.js @@ -0,0 +1,86 @@ +const fetch = require("node-fetch"); +const cheerio = require("cheerio"); +const cookie = require("cookie"); +const axios = require("axios"); +const FormData = require("form-data"); + + +function gaspost(url, form1, headers = {}) { + let e = encodeURIComponent + const formdata = JSON.parse(form1) + let body = Object.keys(formdata).map(key => { + let vals = formdata[key] + let isArray = Array.isArray(vals) + let keyq = e(key + (isArray ? '[]' : '')) + if (!isArray) vals = [vals] + let out = [] + for (let valq of vals) out.push(keyq + '=' + e(valq)) + return out.join('&') + }).join('&') + //console.log(formdata) + return axios(url, { + method: 'POST', + headers: { + accept: '/', + 'accept-language': "en-US,en;q=0.9", + 'content-type': "application/x-www-form-urlencoded; charset=UTF-8", + 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.150 Safari/537.36', + ...headers + }, + data: body + }) +} +async function ephoto2(url, texts = ['text']) { + if (!/^https:\/\/ephoto360\.com\/.+\.html$/.test(url)) throw new Error('Invalid URL') + let res = await axios.get(url,{ + method: 'GET', + headers: { + accept: '/', + 'accept-language': "en-US,en;q=0.9", + 'content-type': "application/x-www-form-urlencoded; charset=UTF-8", + 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.150 Safari/537.36' + }}) + let html = res.data + //console.log(res.headers) + const cfuid = res.headers['set-cookie'][0].split(',').map(v => cookie.parse(v)).reduce((a, c) => { return {...a, ...c} }, {}) + //console.log('ini cfuid == ' + cfuid) + const phpses = res.headers['set-cookie'][0].split(',').map(v => cookie.parse(v)).reduce((a, c) => { return {...a, ...c} }, {}) + cookies = { + _cfduid: cfuid._cfduid, + PHPSESSID: phpses.PHPSESSID, + } + let forms = { + submit: 'Create a photo', + token: /name="token".*value="(.+?)"/.exec(html)[1], + build_server: 'https://s1.ephoto360.com/', + build_server_id: 1 + } + let form = new FormData + if (typeof texts === 'string') texts = [texts] + for (let text of texts) form.append('text[]', text) + for (let key in forms) form.append(key, forms[key]) + + cookies = Object.entries(cookies).map(([ name, value ]) => cookie.serialize(name, value)).join('; ') + //console.log(cookies) + let res2 = await axios(url, { + method: 'POST', + headers: { + accept: '/', + 'accept-language': "en-US,en;q=0.9", + ...form.getHeaders(), + cookie: cookies, + 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.150 Safari/537.36' + }, + data: form.getBuffer() + }) + let html2 = res2.data + let form_value = /name="form_value_input".*value="(.+?)"/.exec(html2) + if (!form_value) throw new Error('Token invalid? ' + /No token/i.test(html2)) + let tokenval = form_value[1].split('"').join('"') + let res3 = await gaspost('https://ephoto360.com/effect/create-image', tokenval, { + cookie: cookies + }) + return await res3.data +} + +module.exports = ephoto2; \ No newline at end of file diff --git a/node_modules/mumaker/lib/textmaker/ephoto3.js b/node_modules/mumaker/lib/textmaker/ephoto3.js new file mode 100644 index 000000000..805f2fe02 --- /dev/null +++ b/node_modules/mumaker/lib/textmaker/ephoto3.js @@ -0,0 +1,86 @@ +const fetch = require("node-fetch"); +const cheerio = require("cheerio"); +const cookie = require("cookie"); +const axios = require("axios"); +const FormData = require("form-data"); + + +function gaspost(url, form1, headers = {}) { + let e = encodeURIComponent + const formdata = JSON.parse(form1) + let body = Object.keys(formdata).map(key => { + let vals = formdata[key] + let isArray = Array.isArray(vals) + let keyq = e(key + (isArray ? '[]' : '')) + if (!isArray) vals = [vals] + let out = [] + for (let valq of vals) out.push(keyq + '=' + e(valq)) + return out.join('&') + }).join('&') + //console.log(formdata) + return axios(url, { + method: 'POST', + headers: { + accept: '/', + 'accept-language': "en-US,en;q=0.9", + 'content-type': "application/x-www-form-urlencoded; charset=UTF-8", + 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.150 Safari/537.36', + ...headers + }, + data: body + }) +} +async function ephoto3(url, texts = ['text']) { + if (!/^https:\/\/en.ephoto360\.com\/.+\.html$/.test(url)) throw new Error('Invalid URL') + let res = await axios.get(url,{ + method: 'GET', + headers: { + accept: '/', + 'accept-language': "en-US,en;q=0.9", + 'content-type': "application/x-www-form-urlencoded; charset=UTF-8", + 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.150 Safari/537.36' + }}) + let html = res.data + //console.log(res.headers) + const cfuid = res.headers['set-cookie'][0].split(',').map(v => cookie.parse(v)).reduce((a, c) => { return {...a, ...c} }, {}) + //console.log('ini cfuid == ' + cfuid) + const phpses = res.headers['set-cookie'][0].split(',').map(v => cookie.parse(v)).reduce((a, c) => { return {...a, ...c} }, {}) + cookies = { + _cfduid: cfuid._cfduid, + PHPSESSID: phpses.PHPSESSID, + } + let forms = { + submit: 'Create a photo', + token: /name="token".*value="(.+?)"/.exec(html)[1], + build_server: 'https://s1.ephoto360.com/', + build_server_id: 1 + } + let form = new FormData + if (typeof texts === 'string') texts = [texts] + for (let text of texts) form.append('text[]', text) + for (let key in forms) form.append(key, forms[key]) + + cookies = Object.entries(cookies).map(([ name, value ]) => cookie.serialize(name, value)).join('; ') + //console.log(cookies) + let res2 = await axios(url, { + method: 'POST', + headers: { + accept: '/', + 'accept-language': "en-US,en;q=0.9", + ...form.getHeaders(), + cookie: cookies, + 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.150 Safari/537.36' + }, + data: form.getBuffer() + }) + let html2 = res2.data + let form_value = /name="form_value_input".*value="(.+?)"/.exec(html2) + if (!form_value) throw new Error('Token invalid? ' + /No token/i.test(html2)) + let tokenval = form_value[1].split('"').join('"') + let res3 = await gaspost('https://en.ephoto360.com/effect/create-image', tokenval, { + cookie: cookies + }) + return await res3.data +} + +module.exports = ephoto3; \ No newline at end of file diff --git a/node_modules/mumaker/lib/textmaker/ephoto4.js b/node_modules/mumaker/lib/textmaker/ephoto4.js new file mode 100644 index 000000000..e0c144641 --- /dev/null +++ b/node_modules/mumaker/lib/textmaker/ephoto4.js @@ -0,0 +1,90 @@ +const fetch = require("node-fetch"); +const cheerio = require("cheerio"); +const cookie = require("cookie"); +const axios = require("axios"); +const FormData = require("form-data"); + + +function gaspost(url, form1, headers = {}) { + let e = encodeURIComponent + pormdata = form1.replace('{"radio":"', '"radio=').replace('"}', '"') + tespor = 'radio0=radio=ok' + const formdata = JSON.parse(form1) + let body = Object.keys(formdata).map(key => { + let vals = formdata[key] + let isArray = Array.isArray(vals) + let keyq = e(key + (isArray ? '[]' : '')) + if (!isArray) vals = [vals] + let out = [] + for (let valq of vals) out.push(keyq + '=' + e(valq)) + return out.join('&') + }).join('&') + body2 = body.split('radio0=%5Bobject%20Object%5D').join('radio0%5Bradio%5D='+formdata.radio0.radio) + //console.log(formdata) + return axios(url, { + method: 'POST', + headers: { + accept: '/', + 'accept-language': "en-US,en;q=0.9", + 'content-type': "application/x-www-form-urlencoded; charset=UTF-8", + 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.150 Safari/537.36', + ...headers + }, + data: body2 + }) +} +async function ephoto4(url, texts = ['text'], radio0) { + if (!/^https:\/\/en.ephoto360\.com\/.+\.html$/.test(url)) throw new Error('Invalid URL') + let res = await axios.get(url,{ + method: 'GET', + headers: { + accept: '/', + 'accept-language': "en-US,en;q=0.9", + 'content-type': "application/x-www-form-urlencoded; charset=UTF-8", + 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.150 Safari/537.36' + }}) + let html = res.data + //console.log(res.headers) + const cfuid = res.headers['set-cookie'][0].split(',').map(v => cookie.parse(v)).reduce((a, c) => { return {...a, ...c} }, {}) + //console.log('ini cfuid == ' + cfuid) + const phpses = res.headers['set-cookie'][0].split(',').map(v => cookie.parse(v)).reduce((a, c) => { return {...a, ...c} }, {}) + cookies = { + _cfduid: cfuid._cfduid, + PHPSESSID: phpses.PHPSESSID, + } + let forms = { + submit: 'Create a photo', + token: /name="token".*value="(.+?)"/.exec(html)[1], + build_server: 'https://s1.ephoto360.com/', + build_server_id: 1, + "radio0[radio]": radio0 + } + let form = new FormData + if (typeof texts === 'string') texts = [texts] + for (let text of texts) form.append('text[]', text) + for (let key in forms) form.append(key, forms[key]) + + cookies = Object.entries(cookies).map(([ name, value ]) => cookie.serialize(name, value)).join('; ') + //console.log(cookies) + let res2 = await axios(url, { + method: 'POST', + headers: { + accept: '/', + 'accept-language': "en-US,en;q=0.9", + ...form.getHeaders(), + cookie: cookies, + 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.150 Safari/537.36' + }, + data: form.getBuffer() + }) + let html2 = res2.data + let form_value = /name="form_value_input".*value="(.+?)"/.exec(html2) + if (!form_value) throw new Error('Token invalid? ' + /No token/i.test(html2)) + let tokenval = form_value[1].split('"').join('"') + let res3 = await gaspost('https://en.ephoto360.com/effect/create-image', tokenval, { + cookie: cookies + }) + return await res3.data +} + +module.exports = ephoto4; \ No newline at end of file diff --git a/node_modules/mumaker/lib/textmaker/photooxy.js b/node_modules/mumaker/lib/textmaker/photooxy.js new file mode 100644 index 000000000..1a3c285b5 --- /dev/null +++ b/node_modules/mumaker/lib/textmaker/photooxy.js @@ -0,0 +1,42 @@ +/* + Photooxy By NaufalCream +*/ +const fetch = require("node-fetch"); +const cheerio = require("cheerio"); +const FormData = require("form-data"); + +/** + * Photooxy Scraper + * @function + * @param {String} url - Your phootoxy url, example https://photooxy.com/logo-and-text-effects/make-tik-tok-text-effect-375.html. + * @param {String[]} text - Text (required). example ["text", "text 2 if any"] + */ + +async function photooxy(url, text) { + if (!/^https:\/\/photooxy\.com\/.+\.html$/.test(url)) + throw new Error("Invalid URL"); + let nomor = 0; + const form = new FormData(); + if (typeof text === "string") text = [text]; + for (let texts of text) { + nomor += 1; + form.append(`text_${nomor}`, texts); + } + form.append("login", "OK"); + let cari = await fetch(url, { + method: "POST", + headers: { + Accept: "/", + "Accept-Language": "en-US,en;q=0.9", + "User-Agent": "GoogleBot", + ...form.getHeaders(), + }, + body: form.getBuffer(), + }); + let html = await cari.text(); + let $ = cheerio.load(html); + const hasil = $('a[class="btn btn-primary"]').attr("href"); + return hasil; +} + +module.exports = photooxy; diff --git a/node_modules/mumaker/lib/textmaker/textpro.js b/node_modules/mumaker/lib/textmaker/textpro.js new file mode 100644 index 000000000..66e566972 --- /dev/null +++ b/node_modules/mumaker/lib/textmaker/textpro.js @@ -0,0 +1,96 @@ +/* + TextPro By NaufalCream +*/ +const fetch = require("node-fetch"); +const cheerio = require("cheerio"); +const cookie = require("cookie"); +const FormData = require("form-data"); + +async function post(url, formdata = {}, cookies) { + let encode = encodeURIComponent; + let body = Object.keys(formdata) + .map((key) => { + let vals = formdata[key]; + let isArray = Array.isArray(vals); + let keys = encode(key + (isArray ? "[]" : "")); + if (!isArray) vals = [vals]; + let out = []; + for (let valq of vals) out.push(keys + "=" + encode(valq)); + return out.join("&"); + }) + .join("&"); + return await fetch(`${url}?${body}`, { + method: "GET", + headers: { + Accept: "*/*", + "Accept-Language": "en-US,en;q=0.9", + "User-Agent": "GoogleBot", + Cookie: cookies, + }, + }); +} + +/** + * TextPro Scraper + * @function + * @param {String} url - Your phootoxy url, example https://photooxy.com/logo-and-text-effects/make-tik-tok-text-effect-375.html. + * @param {String[]} text - Text (required). example ["text", "text 2 if any"] + */ + +async function textpro(url, text) { + if (!/^https:\/\/textpro\.me\/.+\.html$/.test(url)) + throw new Error("Url Salah!!"); + const geturl = await fetch(url, { + method: "GET", + headers: { + "User-Agent": "GoogleBot", + }, + }); + const caritoken = await geturl.text(); + let hasilcookie = geturl.headers + .get("set-cookie") + .split(",") + .map((v) => cookie.parse(v)) + .reduce((a, c) => { + return { ...a, ...c }; + }, {}); + hasilcookie = { + __cfduid: hasilcookie.__cfduid, + PHPSESSID: hasilcookie.PHPSESSID, + }; + hasilcookie = Object.entries(hasilcookie) + .map(([name, value]) => cookie.serialize(name, value)) + .join("; "); + const $ = cheerio.load(caritoken); + const token = $('input[name="token"]').attr("value"); + const form = new FormData(); + if (typeof text === "string") text = [text]; + for (let texts of text) form.append("text[]", texts); + form.append("submit", "Go"); + form.append("token", token); + form.append("build_server", "https://textpro.me"); + form.append("build_server_id", 1); + const geturl2 = await fetch(url, { + method: "POST", + headers: { + Accept: "*/*", + "Accept-Language": "en-US,en;q=0.9", + "User-Agent": "GoogleBot", + Cookie: hasilcookie, + ...form.getHeaders(), + }, + body: form.getBuffer(), + }); + const caritoken2 = await geturl2.text(); + const token2 = /(.*?)<\/div>/.exec(caritoken2); + if (!token2) throw new Error("Token Tidak Ditemukan!!"); + const prosesimage = await post( + "https://textpro.me/effect/create-image", + JSON.parse(token2[1]), + hasilcookie + ); + const hasil = await prosesimage.json(); + return `https://textpro.me${hasil.fullsize_image}`; +} + +module.exports = textpro diff --git a/node_modules/mumaker/package.json b/node_modules/mumaker/package.json new file mode 100644 index 000000000..6ad2e2d11 --- /dev/null +++ b/node_modules/mumaker/package.json @@ -0,0 +1,31 @@ +{ + "name": "mumaker", + "version": "1.0.0", + "description": "Unofficial API Wrapper for Textpro, Photooxy and Instagram Post.", + "main": "src/index.js", + "directories": { + "lib": "lib" + }, + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/mumaker/mumaker.git" + }, + "author": "", + "license": "GNU", + "dependencies": { + "axios": "^0.24.0", + "cheerio": "^1.0.0-rc.10", + "cookie": "^0.4.1", + "form-data": "^4.0.0", + "node-fetch": "^2.6.1", + "qs": "^6.10.2" + }, + "devDependencies": {}, + "bugs": { + "url": "https://github.com/mumaker/mumaker/issues" + }, + "homepage": "https://github.com/mumaker/mumaker#readme" +} \ No newline at end of file diff --git a/node_modules/mumaker/readme.md b/node_modules/mumaker/readme.md new file mode 100644 index 000000000..8d8d08d5a --- /dev/null +++ b/node_modules/mumaker/readme.md @@ -0,0 +1,194 @@ + ## Installation + +``` +npm i mumaker +``` + + ## Example TextMaker + + ``` +const mumaker = require("mumaker"); + + + +//TextPro + +mumaker + .textpro("https://textpro.me/create-blackpink-logo-style-online-1001.html", [ + "teks", + ]) + .then((data) => console.log(data)) + .catch((err) => console.log(err)); + + + +//TextPro with 2 text + +mumaker + .textpro( + "https://textpro.me/create-glitch-text-effect-style-tik-tok-983.html", + ["teks", "teks 2"] + ) + .then((data) => console.log(data)) + .catch((err) => console.log(err)); + + + +//Photooxy + +mumaker + .photooxy( + "https://photooxy.com/logo-and-text-effects/create-a-picture-of-love-message-377.html", + ["teks"] + ) + .then((data) => console.log(data)) + .catch((err) => console.log(err)); + + + +//Photooxy with 2 text + +mumaker + .photooxy( + "https://photooxy.com/logo-and-text-effects/make-tik-tok-text-effect-375.html", + ["teks", "Teks 2"] + ) + .then((data) => console.log(data)) + .catch((err) => console.log(err)); + + + +//Ephoto with radio https://ephoto360.com + +let radio = "e0723d60-fc0d-421f-bf8f-a9b9b61e4be6" // +mumaker + .ephoto("https://ephoto360.com/tao-hieu-ung-mui-ten-dinh-kem-chu-ky-nhieu-mau-846.html",["text"], radio) + .then((data) => console.log(data)) + .catch((err) => console.log(err)); + + + +//Ephoto with radio 2text https://ephoto360.com + +let radio = "f26629d6-5b3d-4702-beba-542a2d9f7439" +mumaker + .ephoto("https://ephoto360.com/hieu-ung-chu/tao-logo-avatar-theo-phong-cach-mascot-364.html",["text","text2"], radio) + .then((data) => console.log(data)) + .catch((err) => console.log(err)); + + + +//Ephoto no Radio https://ephoto360.com + +mumaker + .ephoto2("https://ephoto360.com/hieu-ung-chu-tren-nen-cat-trang-tuyet-dep-663.html", ["text"]) + .then((data) => console.log(data)) + .catch((err) => console.log(err)); + + + +//Ephoto No radio with 2text https://ephoto360.com + +mumaker + .ephoto2("https://ephoto360.com/tinh-yeu/viet-chu-len-bong-bay-tinh-yeu-189.html", ["text","text2"]) + .then((data) => console.log(data)) + .catch((err) => console.log(err)); + + + +//Ephoto No radio https://en.ephoto360.com + +mumaker + .ephoto3("https://en.ephoto360.com/online-blackpink-style-logo-maker-effect-711.html", ["text"]) + .then((data) => console.log(data)) + .catch((err) => console.log(err)); + + + +//Ephoto No radio with 2text https://en.ephoto360.com + +mumaker + .ephoto3("https://en.ephoto360.com/write-letters-on-the-balloons-love-189.html", ["text","text2"]) + .then((data) => console.log(data)) + .catch((err) => console.log(err)); + + + +//Ephoto with radio https://en.ephoto360.com + +let radio = "984dd03e-220d-4335-a6ba-7ac56b092240" +mumaker + .ephoto4("https://en.ephoto360.com/create-anonymous-hacker-avatars-cyan-neon-677.html", ["text"], radio) + .then((data) => console.log(data)) + .catch((err) => console.log(err)); + + + +//Ephoto with radio 2text https://en.ephoto360.com + +let radio = "1ad3c6ed-ba1e-4582-95cf-b5e2d7d1a125" +mumaker + .ephoto4("https://en.ephoto360.com/free-glitter-text-effect-maker-online-656.html", ["text","text2"], radio) + .then((data) => console.log(data)) + .catch((err) => console.log(err)); +``` + + + ## Example IgStalk + + + ``` +const mumaker = require("mumaker"); + + + +mumaker + .igstalk("jokowi") + .then((data) => console.log(data)) + .catch((err) => console.log(err)); +``` + + + ## Example Downloader + + + + ``` +const mumaker = require("mumaker"); + + + +// Ttdownloader + +mumaker + .tiktok("https://vm.tiktok.com/ZSJb2Ly6t") + .then((data) => console.log(data)) + .catch((err) => console.log(err)); + + + +// Igstory + +mumaker + .igstory("infinixid") + .then((data) => console.log(data)) + .catch((err) => console.log(err)); + + + +//Igdownloader + +mumaker + .instagram("https://www.instagram.com/p/CSnz415reLK/?utm_source=ig_web_copy_link") + .then((data) => console.log(data)) + .catch((err) => console.log(err)); + + + +//mediafire + +mumaker + .mediafire("https://www.mediafire.com/file/atxgngm36m0ytnn/example.txt/file") + .then((data) => console.log(data)) + .catch((err) => console.log(err)); +``` \ No newline at end of file diff --git a/node_modules/mumaker/snap.html b/node_modules/mumaker/snap.html new file mode 100644 index 000000000..569c267ca --- /dev/null +++ b/node_modules/mumaker/snap.html @@ -0,0 +1,486 @@ + + + + + + +

+
+
+
+ + +
+
+ +
+
+ + diff --git a/node_modules/mumaker/src/helpers/functions.js b/node_modules/mumaker/src/helpers/functions.js new file mode 100644 index 000000000..5c8842a9e --- /dev/null +++ b/node_modules/mumaker/src/helpers/functions.js @@ -0,0 +1,3 @@ +module.exports.isUrl = (url) => { + return url.match(new RegExp(/https?:\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_+.~#?&/=]*)/, 'gi')) +} \ No newline at end of file diff --git a/node_modules/mumaker/src/index.js b/node_modules/mumaker/src/index.js new file mode 100644 index 000000000..5cd8b5677 --- /dev/null +++ b/node_modules/mumaker/src/index.js @@ -0,0 +1,11 @@ +exports.tiktok = require("../lib/download/tiktok"); +exports.mediafire = require("../lib/download/mediafire"); +exports.igstory = require("../lib/download/igstory"); +exports.instagram = require("../lib/download/instagram.js"); +exports.igstalk = require("../lib/stalk/igstalk"); +exports.textpro = require("../lib/textmaker/textpro"); +exports.photooxy = require("../lib/textmaker/photooxy"); +exports.ephoto = require("../lib/textmaker/ephoto"); +exports.ephoto2 = require("../lib/textmaker/ephoto2"); +exports.ephoto3 = require("../lib/textmaker/ephoto3"); +exports.ephoto4 = require("../lib/textmaker/ephoto4"); \ No newline at end of file diff --git a/node_modules/mumaker/tes.js b/node_modules/mumaker/tes.js new file mode 100644 index 000000000..853f880b6 --- /dev/null +++ b/node_modules/mumaker/tes.js @@ -0,0 +1,6 @@ +const mintake = require("./src/index"); + +// zrapi.pastegg("Z", ) +mintake.photooxy("https://photooxy.com/logo-and-text-effects/write-text-on-burn-paper-388.html", ['Dika Ardnt.']) +.then(data => console.log(data)) +.catch(e => console.log(e)) diff --git a/node_modules/sift/MIT-LICENSE.txt b/node_modules/sift/MIT-LICENSE.txt new file mode 100644 index 000000000..c080d2eb0 --- /dev/null +++ b/node_modules/sift/MIT-LICENSE.txt @@ -0,0 +1,20 @@ +Copyright (c) 2015 Craig Condon + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/sift/README.md b/node_modules/sift/README.md new file mode 100644 index 000000000..07019da62 --- /dev/null +++ b/node_modules/sift/README.md @@ -0,0 +1,465 @@ +**Installation**: `npm install sift`, or `yarn add sift` + +## Sift is a tiny library for using MongoDB queries in Javascript + +[![Build Status](https://secure.travis-ci.org/crcn/sift.js.png)](https://secure.travis-ci.org/crcn/sift.js) + + + + +**For extended documentation, checkout http://docs.mongodb.org/manual/reference/operator/query/** + +## Features: + +- Supported operators: [\$in](#in), [\$nin](#nin), [\$exists](#exists), [\$gte](#gte), [\$gt](#gt), [\$lte](#lte), [\$lt](#lt), [\$eq](#eq), [\$ne](#ne), [\$mod](#mod), [\$all](#all), [\$and](#and), [\$or](#or), [\$nor](#nor), [\$not](#not), [\$size](#size), [\$type](#type), [\$regex](#regex), [\$where](#where), [\$elemMatch](#elemmatch) +- Regexp searches +- Supports node.js, and web +- Custom Operations +- Tree-shaking (omitting functionality from web app bundles) + +## Examples + +```javascript +import sift from "sift"; + +//intersecting arrays +const result1 = ["hello", "sifted", "array!"].filter( + sift({ $in: ["hello", "world"] }) +); //['hello'] + +//regexp filter +const result2 = ["craig", "john", "jake"].filter(sift(/^j/)); //['john','jake'] + +// function filter +const testFilter = sift({ + //you can also filter against functions + name: function(value) { + return value.length == 5; + } +}); + +const result3 = [ + { + name: "craig" + }, + { + name: "john" + }, + { + name: "jake" + } +].filter(testFilter); // filtered: [{ name: 'craig' }] + +//you can test *single values* against your custom sifter +testFilter({ name: "sarah" }); //true +testFilter({ name: "tim" }); //false +``` + +## API + +### sift(query: MongoQuery, options?: Options): Function + +Creates a filter with all of the built-in MongoDB query operations. + +- `query` - the filter to use against the target array +- `options` + - `operations` - [custom operations](#custom-operations) + - `compare` - compares difference between two values + +Example: + +```javascript +import sift from "sift"; + +const test = sift({ $gt: 5 })); + +console.log(test(6)); // true +console.log(test(4)); // false + +[3, 4, 5, 6, 7].filter(sift({ $exists: true })); // [6, 7] +``` + +### createQueryTester(query: Query, options?: Options): Function + +Creates a filter function **without** built-in MongoDB query operations. This is useful +if you're looking to omit certain operations from application bundles. See [Omitting built-in operations](#omitting-built-in-operations) for more info. + +```javascript +import { createQueryTester, $eq, $in } from "sift"; +const filter = createQueryTester({ $eq: 5 }, { operations: { $eq, $in } }); +``` + +### createEqualsOperation(params: any, ownerQuery: Query, options: Options): Operation + +Used for [custom operations](#custom-operations). + +```javascript +import { createQueryTester, createEqualsOperation, $eq, $in } from "sift"; +const filter = createQueryTester( + { $mod: 5 }, + { + operations: { + $something(mod, ownerQuery, options) { + return createEqualsOperation( + value => value % mod === 0, + ownerQuery, + options + ); + } + } + } +); +filter(10); // true +filter(11); // false +``` + +## Supported Operators + +See MongoDB's [advanced queries](http://www.mongodb.org/display/DOCS/Advanced+Queries) for more info. + +### \$in + +array value must be _\$in_ the given query: + +Intersecting two arrays: + +```javascript +//filtered: ['Brazil'] +["Brazil", "Haiti", "Peru", "Chile"].filter( + sift({ $in: ["Costa Rica", "Brazil"] }) +); +``` + +Here's another example. This acts more like the \$or operator: + +```javascript +[{ name: "Craig", location: "Brazil" }].filter( + sift({ location: { $in: ["Costa Rica", "Brazil"] } }) +); +``` + +### \$nin + +Opposite of \$in: + +```javascript +//filtered: ['Haiti','Peru','Chile'] +["Brazil", "Haiti", "Peru", "Chile"].filter( + sift({ $nin: ["Costa Rica", "Brazil"] }) +); +``` + +### \$exists + +Checks if whether a value exists: + +```javascript +//filtered: ['Craig','Tim'] +sift({ $exists: true })(["Craig", null, "Tim"]); +``` + +You can also filter out values that don't exist + +```javascript +//filtered: [{ name: "Tim" }] +[{ name: "Craig", city: "Minneapolis" }, { name: "Tim" }].filter( + sift({ city: { $exists: false } }) +); +``` + +### \$gte + +Checks if a number is >= value: + +```javascript +//filtered: [2, 3] +[0, 1, 2, 3].filter(sift({ $gte: 2 })); +``` + +### \$gt + +Checks if a number is > value: + +```javascript +//filtered: [3] +[0, 1, 2, 3].filter(sift({ $gt: 2 })); +``` + +### \$lte + +Checks if a number is <= value. + +```javascript +//filtered: [0, 1, 2] +[0, 1, 2, 3].filter(sift({ $lte: 2 })); +``` + +### \$lt + +Checks if number is < value. + +```javascript +//filtered: [0, 1] +[0, 1, 2, 3].filter(sift({ $lt: 2 })); +``` + +### \$eq + +Checks if `query === value`. Note that **\$eq can be omitted**. For **\$eq**, and **\$ne** + +```javascript +//filtered: [{ state: 'MN' }] +[{ state: "MN" }, { state: "CA" }, { state: "WI" }].filter( + sift({ state: { $eq: "MN" } }) +); +``` + +Or: + +```javascript +//filtered: [{ state: 'MN' }] +[{ state: "MN" }, { state: "CA" }, { state: "WI" }].filter( + sift({ state: "MN" }) +); +``` + +### \$ne + +Checks if `query !== value`. + +```javascript +//filtered: [{ state: 'CA' }, { state: 'WI'}] +[{ state: "MN" }, { state: "CA" }, { state: "WI" }].filter( + sift({ state: { $ne: "MN" } }) +); +``` + +### \$mod + +Modulus: + +```javascript +//filtered: [300, 600] +[100, 200, 300, 400, 500, 600].filter(sift({ $mod: [3, 0] })); +``` + +### \$all + +values must match **everything** in array: + +```javascript +//filtered: [ { tags: ['books','programming','travel' ]} ] +[ + { tags: ["books", "programming", "travel"] }, + { tags: ["travel", "cooking"] } +].filter(sift({ tags: { $all: ["books", "programming"] } })); +``` + +### \$and + +ability to use an array of expressions. All expressions must test true. + +```javascript +//filtered: [ { name: 'Craig', state: 'MN' }] + +[ + { name: "Craig", state: "MN" }, + { name: "Tim", state: "MN" }, + { name: "Joe", state: "CA" } +].filter(sift({ $and: [{ name: "Craig" }, { state: "MN" }] })); +``` + +### \$or + +OR array of expressions. + +```javascript +//filtered: [ { name: 'Craig', state: 'MN' }, { name: 'Tim', state: 'MN' }] +[ + { name: "Craig", state: "MN" }, + { name: "Tim", state: "MN" }, + { name: "Joe", state: "CA" } +].filter(sift({ $or: [{ name: "Craig" }, { state: "MN" }] })); +``` + +### \$nor + +opposite of or: + +```javascript +//filtered: [{ name: 'Joe', state: 'CA' }] +[ + { name: "Craig", state: "MN" }, + { name: "Tim", state: "MN" }, + { name: "Joe", state: "CA" } +].filter(sift({ $nor: [{ name: "Craig" }, { state: "MN" }] })); +``` + +### \$size + +Matches an array - must match given size: + +```javascript +//filtered: ['food','cooking'] +[{ tags: ["food", "cooking"] }, { tags: ["traveling"] }].filter( + sift({ tags: { $size: 2 } }) +); +``` + +### \$type + +Matches a values based on the type + +```javascript +[new Date(), 4342, "hello world"].filter(sift({ $type: Date })); //returns single date +[new Date(), 4342, "hello world"].filter(sift({ $type: String })); //returns ['hello world'] +``` + +### \$regex + +Matches values based on the given regular expression + +```javascript +["frank", "fred", "sam", "frost"].filter( + sift({ $regex: /^f/i, $nin: ["frank"] }) +); // ["fred", "frost"] +["frank", "fred", "sam", "frost"].filter( + sift({ $regex: "^f", $options: "i", $nin: ["frank"] }) +); // ["fred", "frost"] +``` + +### \$where + +Matches based on some javascript comparison + +```javascript +[{ name: "frank" }, { name: "joe" }].filter( + sift({ $where: "this.name === 'frank'" }) +); // ["frank"] +[{ name: "frank" }, { name: "joe" }].filter( + sift({ + $where: function() { + return this.name === "frank"; + } + }) +); // ["frank"] +``` + +### \$elemMatch + +Matches elements of array + +```javascript +var bills = [ + { + month: "july", + casts: [ + { + id: 1, + value: 200 + }, + { + id: 2, + value: 1000 + } + ] + }, + { + month: "august", + casts: [ + { + id: 3, + value: 1000 + }, + { + id: 4, + value: 4000 + } + ] + } +]; + +var result = bills.filter( + sift({ + casts: { + $elemMatch: { + value: { $gt: 1000 } + } + } + }) +); // {month:'august', casts:[{id:3, value: 1000},{id: 4, value: 4000}]} +``` + +### \$not + +Not expression: + +```javascript +["craig", "tim", "jake"].filter(sift({ $not: { $in: ["craig", "tim"] } })); //['jake'] +["craig", "tim", "jake"].filter(sift({ $not: { $size: 5 } })); //['tim','jake'] +``` + +### Date comparison + +Mongodb allows you to do date comparisons like so: + +```javascript +db.collection.find({ createdAt: { $gte: "2018-03-22T06:00:00Z" } }); +``` + +In Sift, you'll need to specify a Date object: + +```javascript +collection.find( + sift({ createdAt: { $gte: new Date("2018-03-22T06:00:00Z") } }) +); +``` + +## Custom behavior + +Sift works like MongoDB out of the box, but you're also able to modify the behavior to suite your needs. + +#### Custom operations + +You can register your own custom operations. Here's an example: + +```javascript +import sift, { createEqualsOperation } from "sift"; + +var filter = sift( + { + $customMod: 2 + }, + { + operations: { + $customMod(params, ownerQuery, options) { + return createEqualsOperation( + value => value % params !== 0, + ownerQuery, + options + ); + } + } + } +); + +[1, 2, 3, 4, 5].filter(filter); // 1, 3, 5 +``` + +#### Omitting built-in operations + +You can create a filter function that omits the built-in operations like so: + +```javascript +import { createQueryTester, $in, $all, $nin, $lt } from "sift"; +const test = createQueryTester( + { + $eq: 10 + }, + { operations: { $in, $all, $nin, $lt } } +); + +[1, 2, 3, 4, 10].filter(test); +``` + +For bundlers like `Webpack` and `Rollup`, operations that aren't used are omitted from application bundles via tree-shaking. diff --git a/node_modules/sift/es/index.js b/node_modules/sift/es/index.js new file mode 100644 index 000000000..22f33969c --- /dev/null +++ b/node_modules/sift/es/index.js @@ -0,0 +1,626 @@ +const typeChecker = (type) => { + const typeString = "[object " + type + "]"; + return function (value) { + return getClassName(value) === typeString; + }; +}; +const getClassName = value => Object.prototype.toString.call(value); +const comparable = (value) => { + if (value instanceof Date) { + return value.getTime(); + } + else if (isArray(value)) { + return value.map(comparable); + } + else if (value && typeof value.toJSON === "function") { + return value.toJSON(); + } + return value; +}; +const isArray = typeChecker("Array"); +const isObject = typeChecker("Object"); +const isFunction = typeChecker("Function"); +const isVanillaObject = value => { + return (value && + (value.constructor === Object || + value.constructor === Array || + value.constructor.toString() === "function Object() { [native code] }" || + value.constructor.toString() === "function Array() { [native code] }") && + !value.toJSON); +}; +const equals = (a, b) => { + if (a == null && a == b) { + return true; + } + if (a === b) { + return true; + } + if (Object.prototype.toString.call(a) !== Object.prototype.toString.call(b)) { + return false; + } + if (isArray(a)) { + if (a.length !== b.length) { + return false; + } + for (let i = 0, { length } = a; i < length; i++) { + if (!equals(a[i], b[i])) + return false; + } + return true; + } + else if (isObject(a)) { + if (Object.keys(a).length !== Object.keys(b).length) { + return false; + } + for (const key in a) { + if (!equals(a[key], b[key])) + return false; + } + return true; + } + return false; +}; + +/** + * Walks through each value given the context - used for nested operations. E.g: + * { "person.address": { $eq: "blarg" }} + */ +const walkKeyPathValues = (item, keyPath, next, depth, key, owner) => { + const currentKey = keyPath[depth]; + // if array, then try matching. Might fall through for cases like: + // { $eq: [1, 2, 3] }, [ 1, 2, 3 ]. + if (isArray(item) && isNaN(Number(currentKey))) { + for (let i = 0, { length } = item; i < length; i++) { + // if FALSE is returned, then terminate walker. For operations, this simply + // means that the search critera was met. + if (!walkKeyPathValues(item[i], keyPath, next, depth, i, item)) { + return false; + } + } + } + if (depth === keyPath.length || item == null) { + return next(item, key, owner, depth === 0); + } + return walkKeyPathValues(item[currentKey], keyPath, next, depth + 1, currentKey, item); +}; +class BaseOperation { + constructor(params, owneryQuery, options, name) { + this.params = params; + this.owneryQuery = owneryQuery; + this.options = options; + this.name = name; + this.init(); + } + init() { } + reset() { + this.done = false; + this.keep = false; + } +} +class GroupOperation extends BaseOperation { + constructor(params, owneryQuery, options, children) { + super(params, owneryQuery, options); + this.children = children; + } + /** + */ + reset() { + this.keep = false; + this.done = false; + for (let i = 0, { length } = this.children; i < length; i++) { + this.children[i].reset(); + } + } + /** + */ + childrenNext(item, key, owner, root) { + let done = true; + let keep = true; + for (let i = 0, { length } = this.children; i < length; i++) { + const childOperation = this.children[i]; + if (!childOperation.done) { + childOperation.next(item, key, owner, root); + } + if (!childOperation.keep) { + keep = false; + } + if (childOperation.done) { + if (!childOperation.keep) { + break; + } + } + else { + done = false; + } + } + this.done = done; + this.keep = keep; + } +} +class NamedGroupOperation extends GroupOperation { + constructor(params, owneryQuery, options, children, name) { + super(params, owneryQuery, options, children); + this.name = name; + } +} +class QueryOperation extends GroupOperation { + constructor() { + super(...arguments); + this.propop = true; + } + /** + */ + next(item, key, parent, root) { + this.childrenNext(item, key, parent, root); + } +} +class NestedOperation extends GroupOperation { + constructor(keyPath, params, owneryQuery, options, children) { + super(params, owneryQuery, options, children); + this.keyPath = keyPath; + this.propop = true; + /** + */ + this._nextNestedValue = (value, key, owner, root) => { + this.childrenNext(value, key, owner, root); + return !this.done; + }; + } + /** + */ + next(item, key, parent) { + walkKeyPathValues(item, this.keyPath, this._nextNestedValue, 0, key, parent); + } +} +const createTester = (a, compare) => { + if (a instanceof Function) { + return a; + } + if (a instanceof RegExp) { + return b => { + const result = typeof b === "string" && a.test(b); + a.lastIndex = 0; + return result; + }; + } + const comparableA = comparable(a); + return b => compare(comparableA, comparable(b)); +}; +class EqualsOperation extends BaseOperation { + constructor() { + super(...arguments); + this.propop = true; + } + init() { + this._test = createTester(this.params, this.options.compare); + } + next(item, key, parent) { + if (!Array.isArray(parent) || parent.hasOwnProperty(key)) { + if (this._test(item, key, parent)) { + this.done = true; + this.keep = true; + } + } + } +} +const createEqualsOperation = (params, owneryQuery, options) => new EqualsOperation(params, owneryQuery, options); +class NopeOperation extends BaseOperation { + constructor() { + super(...arguments); + this.propop = true; + } + next() { + this.done = true; + this.keep = false; + } +} +const numericalOperationCreator = (createNumericalOperation) => (params, owneryQuery, options, name) => { + if (params == null) { + return new NopeOperation(params, owneryQuery, options, name); + } + return createNumericalOperation(params, owneryQuery, options, name); +}; +const numericalOperation = (createTester) => numericalOperationCreator((params, owneryQuery, options, name) => { + const typeofParams = typeof comparable(params); + const test = createTester(params); + return new EqualsOperation(b => { + return typeof comparable(b) === typeofParams && test(b); + }, owneryQuery, options, name); +}); +const createNamedOperation = (name, params, parentQuery, options) => { + const operationCreator = options.operations[name]; + if (!operationCreator) { + throwUnsupportedOperation(name); + } + return operationCreator(params, parentQuery, options, name); +}; +const throwUnsupportedOperation = (name) => { + throw new Error(`Unsupported operation: ${name}`); +}; +const containsOperation = (query, options) => { + for (const key in query) { + if (options.operations.hasOwnProperty(key) || key.charAt(0) === "$") + return true; + } + return false; +}; +const createNestedOperation = (keyPath, nestedQuery, parentKey, owneryQuery, options) => { + if (containsOperation(nestedQuery, options)) { + const [selfOperations, nestedOperations] = createQueryOperations(nestedQuery, parentKey, options); + if (nestedOperations.length) { + throw new Error(`Property queries must contain only operations, or exact objects.`); + } + return new NestedOperation(keyPath, nestedQuery, owneryQuery, options, selfOperations); + } + return new NestedOperation(keyPath, nestedQuery, owneryQuery, options, [ + new EqualsOperation(nestedQuery, owneryQuery, options) + ]); +}; +const createQueryOperation = (query, owneryQuery = null, { compare, operations } = {}) => { + const options = { + compare: compare || equals, + operations: Object.assign({}, operations || {}) + }; + const [selfOperations, nestedOperations] = createQueryOperations(query, null, options); + const ops = []; + if (selfOperations.length) { + ops.push(new NestedOperation([], query, owneryQuery, options, selfOperations)); + } + ops.push(...nestedOperations); + if (ops.length === 1) { + return ops[0]; + } + return new QueryOperation(query, owneryQuery, options, ops); +}; +const createQueryOperations = (query, parentKey, options) => { + const selfOperations = []; + const nestedOperations = []; + if (!isVanillaObject(query)) { + selfOperations.push(new EqualsOperation(query, query, options)); + return [selfOperations, nestedOperations]; + } + for (const key in query) { + if (options.operations.hasOwnProperty(key)) { + const op = createNamedOperation(key, query[key], query, options); + if (op) { + if (!op.propop && parentKey && !options.operations[parentKey]) { + throw new Error(`Malformed query. ${key} cannot be matched against property.`); + } + } + // probably just a flag for another operation (like $options) + if (op != null) { + selfOperations.push(op); + } + } + else if (key.charAt(0) === "$") { + throwUnsupportedOperation(key); + } + else { + nestedOperations.push(createNestedOperation(key.split("."), query[key], key, query, options)); + } + } + return [selfOperations, nestedOperations]; +}; +const createOperationTester = (operation) => (item, key, owner) => { + operation.reset(); + operation.next(item, key, owner); + return operation.keep; +}; +const createQueryTester = (query, options = {}) => { + return createOperationTester(createQueryOperation(query, null, options)); +}; + +class $Ne extends BaseOperation { + constructor() { + super(...arguments); + this.propop = true; + } + init() { + this._test = createTester(this.params, this.options.compare); + } + reset() { + super.reset(); + this.keep = true; + } + next(item) { + if (this._test(item)) { + this.done = true; + this.keep = false; + } + } +} +// https://docs.mongodb.com/manual/reference/operator/query/elemMatch/ +class $ElemMatch extends BaseOperation { + constructor() { + super(...arguments); + this.propop = true; + } + init() { + if (!this.params || typeof this.params !== "object") { + throw new Error(`Malformed query. $elemMatch must by an object.`); + } + this._queryOperation = createQueryOperation(this.params, this.owneryQuery, this.options); + } + reset() { + super.reset(); + this._queryOperation.reset(); + } + next(item) { + if (isArray(item)) { + for (let i = 0, { length } = item; i < length; i++) { + // reset query operation since item being tested needs to pass _all_ query + // operations for it to be a success + this._queryOperation.reset(); + const child = item[i]; + this._queryOperation.next(child, i, item, false); + this.keep = this.keep || this._queryOperation.keep; + } + this.done = true; + } + else { + this.done = false; + this.keep = false; + } + } +} +class $Not extends BaseOperation { + constructor() { + super(...arguments); + this.propop = true; + } + init() { + this._queryOperation = createQueryOperation(this.params, this.owneryQuery, this.options); + } + reset() { + super.reset(); + this._queryOperation.reset(); + } + next(item, key, owner, root) { + this._queryOperation.next(item, key, owner, root); + this.done = this._queryOperation.done; + this.keep = !this._queryOperation.keep; + } +} +class $Size extends BaseOperation { + constructor() { + super(...arguments); + this.propop = true; + } + init() { } + next(item) { + if (isArray(item) && item.length === this.params) { + this.done = true; + this.keep = true; + } + // if (parent && parent.length === this.params) { + // this.done = true; + // this.keep = true; + // } + } +} +const assertGroupNotEmpty = (values) => { + if (values.length === 0) { + throw new Error(`$and/$or/$nor must be a nonempty array`); + } +}; +class $Or extends BaseOperation { + constructor() { + super(...arguments); + this.propop = false; + } + init() { + assertGroupNotEmpty(this.params); + this._ops = this.params.map(op => createQueryOperation(op, null, this.options)); + } + reset() { + this.done = false; + this.keep = false; + for (let i = 0, { length } = this._ops; i < length; i++) { + this._ops[i].reset(); + } + } + next(item, key, owner) { + let done = false; + let success = false; + for (let i = 0, { length } = this._ops; i < length; i++) { + const op = this._ops[i]; + op.next(item, key, owner); + if (op.keep) { + done = true; + success = op.keep; + break; + } + } + this.keep = success; + this.done = done; + } +} +class $Nor extends $Or { + constructor() { + super(...arguments); + this.propop = false; + } + next(item, key, owner) { + super.next(item, key, owner); + this.keep = !this.keep; + } +} +class $In extends BaseOperation { + constructor() { + super(...arguments); + this.propop = true; + } + init() { + this._testers = this.params.map(value => { + if (containsOperation(value, this.options)) { + throw new Error(`cannot nest $ under ${this.name.toLowerCase()}`); + } + return createTester(value, this.options.compare); + }); + } + next(item, key, owner) { + let done = false; + let success = false; + for (let i = 0, { length } = this._testers; i < length; i++) { + const test = this._testers[i]; + if (test(item)) { + done = true; + success = true; + break; + } + } + this.keep = success; + this.done = done; + } +} +class $Nin extends BaseOperation { + constructor(params, ownerQuery, options, name) { + super(params, ownerQuery, options, name); + this.propop = true; + this._in = new $In(params, ownerQuery, options, name); + } + next(item, key, owner, root) { + this._in.next(item, key, owner); + if (isArray(owner) && !root) { + if (this._in.keep) { + this.keep = false; + this.done = true; + } + else if (key == owner.length - 1) { + this.keep = true; + this.done = true; + } + } + else { + this.keep = !this._in.keep; + this.done = true; + } + } + reset() { + super.reset(); + this._in.reset(); + } +} +class $Exists extends BaseOperation { + constructor() { + super(...arguments); + this.propop = true; + } + next(item, key, owner) { + if (owner.hasOwnProperty(key) === this.params) { + this.done = true; + this.keep = true; + } + } +} +class $And extends NamedGroupOperation { + constructor(params, owneryQuery, options, name) { + super(params, owneryQuery, options, params.map(query => createQueryOperation(query, owneryQuery, options)), name); + this.propop = false; + assertGroupNotEmpty(params); + } + next(item, key, owner, root) { + this.childrenNext(item, key, owner, root); + } +} +class $All extends NamedGroupOperation { + constructor(params, owneryQuery, options, name) { + super(params, owneryQuery, options, params.map(query => createQueryOperation(query, owneryQuery, options)), name); + this.propop = true; + } + next(item, key, owner, root) { + this.childrenNext(item, key, owner, root); + } +} +const $eq = (params, owneryQuery, options) => new EqualsOperation(params, owneryQuery, options); +const $ne = (params, owneryQuery, options, name) => new $Ne(params, owneryQuery, options, name); +const $or = (params, owneryQuery, options, name) => new $Or(params, owneryQuery, options, name); +const $nor = (params, owneryQuery, options, name) => new $Nor(params, owneryQuery, options, name); +const $elemMatch = (params, owneryQuery, options, name) => new $ElemMatch(params, owneryQuery, options, name); +const $nin = (params, owneryQuery, options, name) => new $Nin(params, owneryQuery, options, name); +const $in = (params, owneryQuery, options, name) => { + return new $In(params, owneryQuery, options, name); +}; +const $lt = numericalOperation(params => b => b < params); +const $lte = numericalOperation(params => b => b <= params); +const $gt = numericalOperation(params => b => b > params); +const $gte = numericalOperation(params => b => b >= params); +const $mod = ([mod, equalsValue], owneryQuery, options) => new EqualsOperation(b => comparable(b) % mod === equalsValue, owneryQuery, options); +const $exists = (params, owneryQuery, options, name) => new $Exists(params, owneryQuery, options, name); +const $regex = (pattern, owneryQuery, options) => new EqualsOperation(new RegExp(pattern, owneryQuery.$options), owneryQuery, options); +const $not = (params, owneryQuery, options, name) => new $Not(params, owneryQuery, options, name); +const typeAliases = { + number: v => typeof v === "number", + string: v => typeof v === "string", + bool: v => typeof v === "boolean", + array: v => Array.isArray(v), + null: v => v === null, + timestamp: v => v instanceof Date +}; +const $type = (clazz, owneryQuery, options) => new EqualsOperation(b => { + if (typeof clazz === "string") { + if (!typeAliases[clazz]) { + throw new Error(`Type alias does not exist`); + } + return typeAliases[clazz](b); + } + return b != null ? b instanceof clazz || b.constructor === clazz : false; +}, owneryQuery, options); +const $and = (params, ownerQuery, options, name) => new $And(params, ownerQuery, options, name); +const $all = (params, ownerQuery, options, name) => new $All(params, ownerQuery, options, name); +const $size = (params, ownerQuery, options) => new $Size(params, ownerQuery, options, "$size"); +const $options = () => null; +const $where = (params, ownerQuery, options) => { + let test; + if (isFunction(params)) { + test = params; + } + else if (!process.env.CSP_ENABLED) { + test = new Function("obj", "return " + params); + } + else { + throw new Error(`In CSP mode, sift does not support strings in "$where" condition`); + } + return new EqualsOperation(b => test.bind(b)(b), ownerQuery, options); +}; + +var defaultOperations = /*#__PURE__*/Object.freeze({ + __proto__: null, + $Size: $Size, + $eq: $eq, + $ne: $ne, + $or: $or, + $nor: $nor, + $elemMatch: $elemMatch, + $nin: $nin, + $in: $in, + $lt: $lt, + $lte: $lte, + $gt: $gt, + $gte: $gte, + $mod: $mod, + $exists: $exists, + $regex: $regex, + $not: $not, + $type: $type, + $and: $and, + $all: $all, + $size: $size, + $options: $options, + $where: $where +}); + +const createDefaultQueryOperation = (query, ownerQuery, { compare, operations } = {}) => { + return createQueryOperation(query, ownerQuery, { + compare, + operations: Object.assign({}, defaultOperations, operations || {}) + }); +}; +const createDefaultQueryTester = (query, options = {}) => { + const op = createDefaultQueryOperation(query, null, options); + return createOperationTester(op); +}; + +export default createDefaultQueryTester; +export { $Size, $all, $and, $elemMatch, $eq, $exists, $gt, $gte, $in, $lt, $lte, $mod, $ne, $nin, $nor, $not, $options, $or, $regex, $size, $type, $where, EqualsOperation, createDefaultQueryOperation, createEqualsOperation, createOperationTester, createQueryOperation, createQueryTester }; +//# sourceMappingURL=index.js.map diff --git a/node_modules/sift/es/index.js.map b/node_modules/sift/es/index.js.map new file mode 100644 index 000000000..1a19f9b9e --- /dev/null +++ b/node_modules/sift/es/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sources":["../src/utils.ts","../src/core.ts","../src/operations.ts","../src/index.ts"],"sourcesContent":[null,null,null,null],"names":[],"mappings":"AAEO,MAAM,WAAW,GAAG,CAAQ,IAAI;IACrC,MAAM,UAAU,GAAG,UAAU,GAAG,IAAI,GAAG,GAAG,CAAC;IAC3C,OAAO,UAAS,KAAK;QACnB,OAAO,YAAY,CAAC,KAAK,CAAC,KAAK,UAAU,CAAC;KAC3C,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,YAAY,GAAG,KAAK,IAAI,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AAE7D,MAAM,UAAU,GAAG,CAAC,KAAU;IACnC,IAAI,KAAK,YAAY,IAAI,EAAE;QACzB,OAAO,KAAK,CAAC,OAAO,EAAE,CAAC;KACxB;SAAM,IAAI,OAAO,CAAC,KAAK,CAAC,EAAE;QACzB,OAAO,KAAK,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;KAC9B;SAAM,IAAI,KAAK,IAAI,OAAO,KAAK,CAAC,MAAM,KAAK,UAAU,EA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CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,OAAO,CAAC,CAAC;AACxE;;;;;;;;;;;;;;;;;;;;;;;;;;;;MC/YM,2BAA2B,GAAG,CAClC,KAAqB,EACrB,UAAe,EACf,EAAE,OAAO,EAAE,UAAU,KAAuB,EAAE;IAE9C,OAAO,oBAAoB,CAAC,KAAK,EAAE,UAAU,EAAE;QAC7C,OAAO;QACP,UAAU,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,iBAAiB,EAAE,UAAU,IAAI,EAAE,CAAC;KACnE,CAAC,CAAC;AACL,EAAE;MAEI,wBAAwB,GAAG,CAC/B,KAAqB,EACrB,UAA4B,EAAE;IAE9B,MAAM,EAAE,GAAG,2BAA2B,CAAC,KAAK,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;IAC7D,OAAO,qBAAqB,CAAC,EAAE,CAAC,CAAC;AACnC;;;;;"} \ No newline at end of file diff --git a/node_modules/sift/es5m/index.js b/node_modules/sift/es5m/index.js new file mode 100644 index 000000000..79c77a249 --- /dev/null +++ b/node_modules/sift/es5m/index.js @@ -0,0 +1,729 @@ +/*! ***************************************************************************** +Copyright (c) Microsoft Corporation. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. +***************************************************************************** */ +/* global Reflect, Promise */ + +var extendStatics = function(d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); +}; + +function __extends(d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +} + +var typeChecker = function (type) { + var typeString = "[object " + type + "]"; + return function (value) { + return getClassName(value) === typeString; + }; +}; +var getClassName = function (value) { return Object.prototype.toString.call(value); }; +var comparable = function (value) { + if (value instanceof Date) { + return value.getTime(); + } + else if (isArray(value)) { + return value.map(comparable); + } + else if (value && typeof value.toJSON === "function") { + return value.toJSON(); + } + return value; +}; +var isArray = typeChecker("Array"); +var isObject = typeChecker("Object"); +var isFunction = typeChecker("Function"); +var isVanillaObject = function (value) { + return (value && + (value.constructor === Object || + value.constructor === Array || + value.constructor.toString() === "function Object() { [native code] }" || + value.constructor.toString() === "function Array() { [native code] }") && + !value.toJSON); +}; +var equals = function (a, b) { + if (a == null && a == b) { + return true; + } + if (a === b) { + return true; + } + if (Object.prototype.toString.call(a) !== Object.prototype.toString.call(b)) { + return false; + } + if (isArray(a)) { + if (a.length !== b.length) { + return false; + } + for (var i = 0, length_1 = a.length; i < length_1; i++) { + if (!equals(a[i], b[i])) + return false; + } + return true; + } + else if (isObject(a)) { + if (Object.keys(a).length !== Object.keys(b).length) { + return false; + } + for (var key in a) { + if (!equals(a[key], b[key])) + return false; + } + return true; + } + return false; +}; + +/** + * Walks through each value given the context - used for nested operations. E.g: + * { "person.address": { $eq: "blarg" }} + */ +var walkKeyPathValues = function (item, keyPath, next, depth, key, owner) { + var currentKey = keyPath[depth]; + // if array, then try matching. Might fall through for cases like: + // { $eq: [1, 2, 3] }, [ 1, 2, 3 ]. + if (isArray(item) && isNaN(Number(currentKey))) { + for (var i = 0, length_1 = item.length; i < length_1; i++) { + // if FALSE is returned, then terminate walker. For operations, this simply + // means that the search critera was met. + if (!walkKeyPathValues(item[i], keyPath, next, depth, i, item)) { + return false; + } + } + } + if (depth === keyPath.length || item == null) { + return next(item, key, owner, depth === 0); + } + return walkKeyPathValues(item[currentKey], keyPath, next, depth + 1, currentKey, item); +}; +var BaseOperation = /** @class */ (function () { + function BaseOperation(params, owneryQuery, options, name) { + this.params = params; + this.owneryQuery = owneryQuery; + this.options = options; + this.name = name; + this.init(); + } + BaseOperation.prototype.init = function () { }; + BaseOperation.prototype.reset = function () { + this.done = false; + this.keep = false; + }; + return BaseOperation; +}()); +var GroupOperation = /** @class */ (function (_super) { + __extends(GroupOperation, _super); + function GroupOperation(params, owneryQuery, options, children) { + var _this = _super.call(this, params, owneryQuery, options) || this; + _this.children = children; + return _this; + } + /** + */ + GroupOperation.prototype.reset = function () { + this.keep = false; + this.done = false; + for (var i = 0, length_2 = this.children.length; i < length_2; i++) { + this.children[i].reset(); + } + }; + /** + */ + GroupOperation.prototype.childrenNext = function (item, key, owner, root) { + var done = true; + var keep = true; + for (var i = 0, length_3 = this.children.length; i < length_3; i++) { + var childOperation = this.children[i]; + if (!childOperation.done) { + childOperation.next(item, key, owner, root); + } + if (!childOperation.keep) { + keep = false; + } + if (childOperation.done) { + if (!childOperation.keep) { + break; + } + } + else { + done = false; + } + } + this.done = done; + this.keep = keep; + }; + return GroupOperation; +}(BaseOperation)); +var NamedGroupOperation = /** @class */ (function (_super) { + __extends(NamedGroupOperation, _super); + function NamedGroupOperation(params, owneryQuery, options, children, name) { + var _this = _super.call(this, params, owneryQuery, options, children) || this; + _this.name = name; + return _this; + } + return NamedGroupOperation; +}(GroupOperation)); +var QueryOperation = /** @class */ (function (_super) { + __extends(QueryOperation, _super); + function QueryOperation() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.propop = true; + return _this; + } + /** + */ + QueryOperation.prototype.next = function (item, key, parent, root) { + this.childrenNext(item, key, parent, root); + }; + return QueryOperation; +}(GroupOperation)); +var NestedOperation = /** @class */ (function (_super) { + __extends(NestedOperation, _super); + function NestedOperation(keyPath, params, owneryQuery, options, children) { + var _this = _super.call(this, params, owneryQuery, options, children) || this; + _this.keyPath = keyPath; + _this.propop = true; + /** + */ + _this._nextNestedValue = function (value, key, owner, root) { + _this.childrenNext(value, key, owner, root); + return !_this.done; + }; + return _this; + } + /** + */ + NestedOperation.prototype.next = function (item, key, parent) { + walkKeyPathValues(item, this.keyPath, this._nextNestedValue, 0, key, parent); + }; + return NestedOperation; +}(GroupOperation)); +var createTester = function (a, compare) { + if (a instanceof Function) { + return a; + } + if (a instanceof RegExp) { + return function (b) { + var result = typeof b === "string" && a.test(b); + a.lastIndex = 0; + return result; + }; + } + var comparableA = comparable(a); + return function (b) { return compare(comparableA, comparable(b)); }; +}; +var EqualsOperation = /** @class */ (function (_super) { + __extends(EqualsOperation, _super); + function EqualsOperation() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.propop = true; + return _this; + } + EqualsOperation.prototype.init = function () { + this._test = createTester(this.params, this.options.compare); + }; + EqualsOperation.prototype.next = function (item, key, parent) { + if (!Array.isArray(parent) || parent.hasOwnProperty(key)) { + if (this._test(item, key, parent)) { + this.done = true; + this.keep = true; + } + } + }; + return EqualsOperation; +}(BaseOperation)); +var createEqualsOperation = function (params, owneryQuery, options) { return new EqualsOperation(params, owneryQuery, options); }; +var NopeOperation = /** @class */ (function (_super) { + __extends(NopeOperation, _super); + function NopeOperation() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.propop = true; + return _this; + } + NopeOperation.prototype.next = function () { + this.done = true; + this.keep = false; + }; + return NopeOperation; +}(BaseOperation)); +var numericalOperationCreator = function (createNumericalOperation) { return function (params, owneryQuery, options, name) { + if (params == null) { + return new NopeOperation(params, owneryQuery, options, name); + } + return createNumericalOperation(params, owneryQuery, options, name); +}; }; +var numericalOperation = function (createTester) { + return numericalOperationCreator(function (params, owneryQuery, options, name) { + var typeofParams = typeof comparable(params); + var test = createTester(params); + return new EqualsOperation(function (b) { + return typeof comparable(b) === typeofParams && test(b); + }, owneryQuery, options, name); + }); +}; +var createNamedOperation = function (name, params, parentQuery, options) { + var operationCreator = options.operations[name]; + if (!operationCreator) { + throwUnsupportedOperation(name); + } + return operationCreator(params, parentQuery, options, name); +}; +var throwUnsupportedOperation = function (name) { + throw new Error("Unsupported operation: " + name); +}; +var containsOperation = function (query, options) { + for (var key in query) { + if (options.operations.hasOwnProperty(key) || key.charAt(0) === "$") + return true; + } + return false; +}; +var createNestedOperation = function (keyPath, nestedQuery, parentKey, owneryQuery, options) { + if (containsOperation(nestedQuery, options)) { + var _a = createQueryOperations(nestedQuery, parentKey, options), selfOperations = _a[0], nestedOperations = _a[1]; + if (nestedOperations.length) { + throw new Error("Property queries must contain only operations, or exact objects."); + } + return new NestedOperation(keyPath, nestedQuery, owneryQuery, options, selfOperations); + } + return new NestedOperation(keyPath, nestedQuery, owneryQuery, options, [ + new EqualsOperation(nestedQuery, owneryQuery, options) + ]); +}; +var createQueryOperation = function (query, owneryQuery, _a) { + if (owneryQuery === void 0) { owneryQuery = null; } + var _b = _a === void 0 ? {} : _a, compare = _b.compare, operations = _b.operations; + var options = { + compare: compare || equals, + operations: Object.assign({}, operations || {}) + }; + var _c = createQueryOperations(query, null, options), selfOperations = _c[0], nestedOperations = _c[1]; + var ops = []; + if (selfOperations.length) { + ops.push(new NestedOperation([], query, owneryQuery, options, selfOperations)); + } + ops.push.apply(ops, nestedOperations); + if (ops.length === 1) { + return ops[0]; + } + return new QueryOperation(query, owneryQuery, options, ops); +}; +var createQueryOperations = function (query, parentKey, options) { + var selfOperations = []; + var nestedOperations = []; + if (!isVanillaObject(query)) { + selfOperations.push(new EqualsOperation(query, query, options)); + return [selfOperations, nestedOperations]; + } + for (var key in query) { + if (options.operations.hasOwnProperty(key)) { + var op = createNamedOperation(key, query[key], query, options); + if (op) { + if (!op.propop && parentKey && !options.operations[parentKey]) { + throw new Error("Malformed query. " + key + " cannot be matched against property."); + } + } + // probably just a flag for another operation (like $options) + if (op != null) { + selfOperations.push(op); + } + } + else if (key.charAt(0) === "$") { + throwUnsupportedOperation(key); + } + else { + nestedOperations.push(createNestedOperation(key.split("."), query[key], key, query, options)); + } + } + return [selfOperations, nestedOperations]; +}; +var createOperationTester = function (operation) { return function (item, key, owner) { + operation.reset(); + operation.next(item, key, owner); + return operation.keep; +}; }; +var createQueryTester = function (query, options) { + if (options === void 0) { options = {}; } + return createOperationTester(createQueryOperation(query, null, options)); +}; + +var $Ne = /** @class */ (function (_super) { + __extends($Ne, _super); + function $Ne() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.propop = true; + return _this; + } + $Ne.prototype.init = function () { + this._test = createTester(this.params, this.options.compare); + }; + $Ne.prototype.reset = function () { + _super.prototype.reset.call(this); + this.keep = true; + }; + $Ne.prototype.next = function (item) { + if (this._test(item)) { + this.done = true; + this.keep = false; + } + }; + return $Ne; +}(BaseOperation)); +// https://docs.mongodb.com/manual/reference/operator/query/elemMatch/ +var $ElemMatch = /** @class */ (function (_super) { + __extends($ElemMatch, _super); + function $ElemMatch() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.propop = true; + return _this; + } + $ElemMatch.prototype.init = function () { + if (!this.params || typeof this.params !== "object") { + throw new Error("Malformed query. $elemMatch must by an object."); + } + this._queryOperation = createQueryOperation(this.params, this.owneryQuery, this.options); + }; + $ElemMatch.prototype.reset = function () { + _super.prototype.reset.call(this); + this._queryOperation.reset(); + }; + $ElemMatch.prototype.next = function (item) { + if (isArray(item)) { + for (var i = 0, length_1 = item.length; i < length_1; i++) { + // reset query operation since item being tested needs to pass _all_ query + // operations for it to be a success + this._queryOperation.reset(); + var child = item[i]; + this._queryOperation.next(child, i, item, false); + this.keep = this.keep || this._queryOperation.keep; + } + this.done = true; + } + else { + this.done = false; + this.keep = false; + } + }; + return $ElemMatch; +}(BaseOperation)); +var $Not = /** @class */ (function (_super) { + __extends($Not, _super); + function $Not() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.propop = true; + return _this; + } + $Not.prototype.init = function () { + this._queryOperation = createQueryOperation(this.params, this.owneryQuery, this.options); + }; + $Not.prototype.reset = function () { + _super.prototype.reset.call(this); + this._queryOperation.reset(); + }; + $Not.prototype.next = function (item, key, owner, root) { + this._queryOperation.next(item, key, owner, root); + this.done = this._queryOperation.done; + this.keep = !this._queryOperation.keep; + }; + return $Not; +}(BaseOperation)); +var $Size = /** @class */ (function (_super) { + __extends($Size, _super); + function $Size() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.propop = true; + return _this; + } + $Size.prototype.init = function () { }; + $Size.prototype.next = function (item) { + if (isArray(item) && item.length === this.params) { + this.done = true; + this.keep = true; + } + // if (parent && parent.length === this.params) { + // this.done = true; + // this.keep = true; + // } + }; + return $Size; +}(BaseOperation)); +var assertGroupNotEmpty = function (values) { + if (values.length === 0) { + throw new Error("$and/$or/$nor must be a nonempty array"); + } +}; +var $Or = /** @class */ (function (_super) { + __extends($Or, _super); + function $Or() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.propop = false; + return _this; + } + $Or.prototype.init = function () { + var _this = this; + assertGroupNotEmpty(this.params); + this._ops = this.params.map(function (op) { + return createQueryOperation(op, null, _this.options); + }); + }; + $Or.prototype.reset = function () { + this.done = false; + this.keep = false; + for (var i = 0, length_2 = this._ops.length; i < length_2; i++) { + this._ops[i].reset(); + } + }; + $Or.prototype.next = function (item, key, owner) { + var done = false; + var success = false; + for (var i = 0, length_3 = this._ops.length; i < length_3; i++) { + var op = this._ops[i]; + op.next(item, key, owner); + if (op.keep) { + done = true; + success = op.keep; + break; + } + } + this.keep = success; + this.done = done; + }; + return $Or; +}(BaseOperation)); +var $Nor = /** @class */ (function (_super) { + __extends($Nor, _super); + function $Nor() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.propop = false; + return _this; + } + $Nor.prototype.next = function (item, key, owner) { + _super.prototype.next.call(this, item, key, owner); + this.keep = !this.keep; + }; + return $Nor; +}($Or)); +var $In = /** @class */ (function (_super) { + __extends($In, _super); + function $In() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.propop = true; + return _this; + } + $In.prototype.init = function () { + var _this = this; + this._testers = this.params.map(function (value) { + if (containsOperation(value, _this.options)) { + throw new Error("cannot nest $ under " + _this.name.toLowerCase()); + } + return createTester(value, _this.options.compare); + }); + }; + $In.prototype.next = function (item, key, owner) { + var done = false; + var success = false; + for (var i = 0, length_4 = this._testers.length; i < length_4; i++) { + var test = this._testers[i]; + if (test(item)) { + done = true; + success = true; + break; + } + } + this.keep = success; + this.done = done; + }; + return $In; +}(BaseOperation)); +var $Nin = /** @class */ (function (_super) { + __extends($Nin, _super); + function $Nin(params, ownerQuery, options, name) { + var _this = _super.call(this, params, ownerQuery, options, name) || this; + _this.propop = true; + _this._in = new $In(params, ownerQuery, options, name); + return _this; + } + $Nin.prototype.next = function (item, key, owner, root) { + this._in.next(item, key, owner); + if (isArray(owner) && !root) { + if (this._in.keep) { + this.keep = false; + this.done = true; + } + else if (key == owner.length - 1) { + this.keep = true; + this.done = true; + } + } + else { + this.keep = !this._in.keep; + this.done = true; + } + }; + $Nin.prototype.reset = function () { + _super.prototype.reset.call(this); + this._in.reset(); + }; + return $Nin; +}(BaseOperation)); +var $Exists = /** @class */ (function (_super) { + __extends($Exists, _super); + function $Exists() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.propop = true; + return _this; + } + $Exists.prototype.next = function (item, key, owner) { + if (owner.hasOwnProperty(key) === this.params) { + this.done = true; + this.keep = true; + } + }; + return $Exists; +}(BaseOperation)); +var $And = /** @class */ (function (_super) { + __extends($And, _super); + function $And(params, owneryQuery, options, name) { + var _this = _super.call(this, params, owneryQuery, options, params.map(function (query) { return createQueryOperation(query, owneryQuery, options); }), name) || this; + _this.propop = false; + assertGroupNotEmpty(params); + return _this; + } + $And.prototype.next = function (item, key, owner, root) { + this.childrenNext(item, key, owner, root); + }; + return $And; +}(NamedGroupOperation)); +var $All = /** @class */ (function (_super) { + __extends($All, _super); + function $All(params, owneryQuery, options, name) { + var _this = _super.call(this, params, owneryQuery, options, params.map(function (query) { return createQueryOperation(query, owneryQuery, options); }), name) || this; + _this.propop = true; + return _this; + } + $All.prototype.next = function (item, key, owner, root) { + this.childrenNext(item, key, owner, root); + }; + return $All; +}(NamedGroupOperation)); +var $eq = function (params, owneryQuery, options) { + return new EqualsOperation(params, owneryQuery, options); +}; +var $ne = function (params, owneryQuery, options, name) { return new $Ne(params, owneryQuery, options, name); }; +var $or = function (params, owneryQuery, options, name) { return new $Or(params, owneryQuery, options, name); }; +var $nor = function (params, owneryQuery, options, name) { return new $Nor(params, owneryQuery, options, name); }; +var $elemMatch = function (params, owneryQuery, options, name) { return new $ElemMatch(params, owneryQuery, options, name); }; +var $nin = function (params, owneryQuery, options, name) { return new $Nin(params, owneryQuery, options, name); }; +var $in = function (params, owneryQuery, options, name) { + return new $In(params, owneryQuery, options, name); +}; +var $lt = numericalOperation(function (params) { return function (b) { return b < params; }; }); +var $lte = numericalOperation(function (params) { return function (b) { return b <= params; }; }); +var $gt = numericalOperation(function (params) { return function (b) { return b > params; }; }); +var $gte = numericalOperation(function (params) { return function (b) { return b >= params; }; }); +var $mod = function (_a, owneryQuery, options) { + var mod = _a[0], equalsValue = _a[1]; + return new EqualsOperation(function (b) { return comparable(b) % mod === equalsValue; }, owneryQuery, options); +}; +var $exists = function (params, owneryQuery, options, name) { return new $Exists(params, owneryQuery, options, name); }; +var $regex = function (pattern, owneryQuery, options) { + return new EqualsOperation(new RegExp(pattern, owneryQuery.$options), owneryQuery, options); +}; +var $not = function (params, owneryQuery, options, name) { return new $Not(params, owneryQuery, options, name); }; +var typeAliases = { + number: function (v) { return typeof v === "number"; }, + string: function (v) { return typeof v === "string"; }, + bool: function (v) { return typeof v === "boolean"; }, + array: function (v) { return Array.isArray(v); }, + null: function (v) { return v === null; }, + timestamp: function (v) { return v instanceof Date; } +}; +var $type = function (clazz, owneryQuery, options) { + return new EqualsOperation(function (b) { + if (typeof clazz === "string") { + if (!typeAliases[clazz]) { + throw new Error("Type alias does not exist"); + } + return typeAliases[clazz](b); + } + return b != null ? b instanceof clazz || b.constructor === clazz : false; + }, owneryQuery, options); +}; +var $and = function (params, ownerQuery, options, name) { return new $And(params, ownerQuery, options, name); }; +var $all = function (params, ownerQuery, options, name) { return new $All(params, ownerQuery, options, name); }; +var $size = function (params, ownerQuery, options) { return new $Size(params, ownerQuery, options, "$size"); }; +var $options = function () { return null; }; +var $where = function (params, ownerQuery, options) { + var test; + if (isFunction(params)) { + test = params; + } + else if (!process.env.CSP_ENABLED) { + test = new Function("obj", "return " + params); + } + else { + throw new Error("In CSP mode, sift does not support strings in \"$where\" condition"); + } + return new EqualsOperation(function (b) { return test.bind(b)(b); }, ownerQuery, options); +}; + +var defaultOperations = /*#__PURE__*/Object.freeze({ + __proto__: null, + $Size: $Size, + $eq: $eq, + $ne: $ne, + $or: $or, + $nor: $nor, + $elemMatch: $elemMatch, + $nin: $nin, + $in: $in, + $lt: $lt, + $lte: $lte, + $gt: $gt, + $gte: $gte, + $mod: $mod, + $exists: $exists, + $regex: $regex, + $not: $not, + $type: $type, + $and: $and, + $all: $all, + $size: $size, + $options: $options, + $where: $where +}); + +var createDefaultQueryOperation = function (query, ownerQuery, _a) { + var _b = _a === void 0 ? {} : _a, compare = _b.compare, operations = _b.operations; + return createQueryOperation(query, ownerQuery, { + compare: compare, + operations: Object.assign({}, defaultOperations, operations || {}) + }); +}; +var createDefaultQueryTester = function (query, options) { + if (options === void 0) { options = {}; } + var op = createDefaultQueryOperation(query, null, options); + return createOperationTester(op); +}; + +export default createDefaultQueryTester; +export { $Size, $all, $and, $elemMatch, $eq, $exists, $gt, $gte, $in, $lt, $lte, $mod, $ne, $nin, $nor, $not, $options, $or, $regex, $size, $type, $where, EqualsOperation, createDefaultQueryOperation, createEqualsOperation, createOperationTester, createQueryOperation, createQueryTester }; +//# sourceMappingURL=index.js.map diff --git a/node_modules/sift/es5m/index.js.map b/node_modules/sift/es5m/index.js.map new file mode 100644 index 000000000..1fdf01c5d --- /dev/null +++ b/node_modules/sift/es5m/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sources":["../node_modules/tslib/tslib.es6.js","../src/utils.ts","../src/core.ts","../src/operations.ts","../src/index.ts"],"sourcesContent":["/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n}\r\n\r\nexport function __spreadArray(to, from) {\r\n for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)\r\n to[j] = from[i];\r\n return to;\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n}\r\n",null,null,null,null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,aAAa,GAAG,SAAS,CAAC,EAAE,CAAC,EAAE;AACnC,IAAI,aAAa,GAAG,MAAM,CAAC,cAAc;AACzC,SAAS,EAAE,SAAS,EAAE,EAAE,EAAE,YAAY,KAAK,IAAI,UAAU,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,SAAS,GAAG,CAAC,CAAC,EAAE,CAAC;AACpF,QAAQ,UAAU,CAAC,EAAE,CAAC,EAAE,EAAE,KAAK,I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AAC,EAAE,CAAC,CAAC;AACnC;;;;;"} \ No newline at end of file diff --git a/node_modules/sift/index.d.ts b/node_modules/sift/index.d.ts new file mode 100644 index 000000000..2b8257109 --- /dev/null +++ b/node_modules/sift/index.d.ts @@ -0,0 +1,4 @@ +import sift from "./lib"; + +export default sift; +export * from "./lib"; diff --git a/node_modules/sift/index.js b/node_modules/sift/index.js new file mode 100644 index 000000000..449294a4c --- /dev/null +++ b/node_modules/sift/index.js @@ -0,0 +1,4 @@ +const lib = require("./lib"); + +module.exports = lib.default; +Object.assign(module.exports, lib); diff --git a/node_modules/sift/lib/core.d.ts b/node_modules/sift/lib/core.d.ts new file mode 100644 index 000000000..367510691 --- /dev/null +++ b/node_modules/sift/lib/core.d.ts @@ -0,0 +1,119 @@ +import { Key, Comparator } from "./utils"; +export interface Operation { + readonly keep: boolean; + readonly done: boolean; + propop: boolean; + reset(): any; + next(item: TItem, key?: Key, owner?: any, root?: boolean): any; +} +export declare type Tester = (item: any, key?: Key, owner?: any, root?: boolean) => boolean; +export interface NamedOperation { + name: string; +} +export declare type OperationCreator = (params: any, parentQuery: any, options: Options, name: string) => Operation; +declare type BasicValueQuery = { + $eq?: TValue; + $ne?: TValue; + $lt?: TValue; + $gt?: TValue; + $lte?: TValue; + $gte?: TValue; + $in?: TValue[]; + $nin?: TValue[]; + $all?: TValue[]; + $mod?: [number, number]; + $exists?: boolean; + $regex?: string | RegExp; + $size?: number; + $where?: ((this: TValue, obj: TValue) => boolean) | string; + $options?: "i" | "g" | "m" | "u"; + $type?: Function; + $not?: NestedQuery; + $or?: NestedQuery[]; + $nor?: NestedQuery[]; + $and?: NestedQuery[]; +}; +declare type ArrayValueQuery = { + $elemMatch?: Query; +} & BasicValueQuery; +declare type Unpacked = T extends (infer U)[] ? U : T; +declare type ValueQuery = TValue extends Array ? ArrayValueQuery> : BasicValueQuery; +declare type NotObject = string | number | Date | boolean | Array; +declare type ShapeQuery = TItemSchema extends NotObject ? {} : { + [k in keyof TItemSchema]?: TItemSchema[k] | ValueQuery; +}; +declare type NestedQuery = ValueQuery & ShapeQuery; +export declare type Query = TItemSchema | RegExp | NestedQuery; +export declare abstract class BaseOperation implements Operation { + readonly params: TParams; + readonly owneryQuery: any; + readonly options: Options; + readonly name?: string; + keep: boolean; + done: boolean; + abstract propop: boolean; + constructor(params: TParams, owneryQuery: any, options: Options, name?: string); + protected init(): void; + reset(): void; + abstract next(item: any, key: Key, parent: any, root: boolean): any; +} +declare abstract class GroupOperation extends BaseOperation { + readonly children: Operation[]; + keep: boolean; + done: boolean; + constructor(params: any, owneryQuery: any, options: Options, children: Operation[]); + /** + */ + reset(): void; + abstract next(item: any, key: Key, owner: any, root: boolean): any; + /** + */ + protected childrenNext(item: any, key: Key, owner: any, root: boolean): void; +} +export declare abstract class NamedGroupOperation extends GroupOperation implements NamedOperation { + readonly name: string; + abstract propop: boolean; + constructor(params: any, owneryQuery: any, options: Options, children: Operation[], name: string); +} +export declare class QueryOperation extends GroupOperation { + readonly propop = true; + /** + */ + next(item: TItem, key: Key, parent: any, root: boolean): void; +} +export declare class NestedOperation extends GroupOperation { + readonly keyPath: Key[]; + readonly propop = true; + constructor(keyPath: Key[], params: any, owneryQuery: any, options: Options, children: Operation[]); + /** + */ + next(item: any, key: Key, parent: any): void; + /** + */ + private _nextNestedValue; +} +export declare const createTester: (a: any, compare: Comparator) => any; +export declare class EqualsOperation extends BaseOperation { + readonly propop = true; + private _test; + init(): void; + next(item: any, key: Key, parent: any): void; +} +export declare const createEqualsOperation: (params: any, owneryQuery: any, options: Options) => EqualsOperation; +export declare class NopeOperation extends BaseOperation { + readonly propop = true; + next(): void; +} +export declare const numericalOperationCreator: (createNumericalOperation: OperationCreator) => (params: any, owneryQuery: any, options: Options, name: string) => Operation; +export declare const numericalOperation: (createTester: (any: any) => Tester) => (params: any, owneryQuery: any, options: Options, name: string) => Operation; +export declare type Options = { + operations: { + [identifier: string]: OperationCreator; + }; + compare: (a: any, b: any) => boolean; +}; +export declare const containsOperation: (query: any, options: Options) => boolean; +export declare const createQueryOperation: (query: Query, owneryQuery?: any, { compare, operations }?: Partial) => QueryOperation; +export declare const createOperationTester: (operation: Operation) => (item: TItem, key?: Key, owner?: any) => boolean; +export declare const createQueryTester: (query: Query, options?: Partial) => (item: TItem, key?: Key, owner?: any) => boolean; +export {}; diff --git a/node_modules/sift/lib/index.d.ts b/node_modules/sift/lib/index.d.ts new file mode 100644 index 000000000..66fc25b1c --- /dev/null +++ b/node_modules/sift/lib/index.d.ts @@ -0,0 +1,6 @@ +import { Query, Options, createQueryTester, EqualsOperation, createQueryOperation, createEqualsOperation, createOperationTester } from "./core"; +declare const createDefaultQueryOperation: (query: Query, ownerQuery: any, { compare, operations }?: Partial) => import("./core").QueryOperation; +declare const createDefaultQueryTester: (query: Query, options?: Partial) => (item: unknown, key?: import("./utils").Key, owner?: any) => boolean; +export { Query, EqualsOperation, createQueryTester, createOperationTester, createDefaultQueryOperation, createEqualsOperation, createQueryOperation }; +export * from "./operations"; +export default createDefaultQueryTester; diff --git a/node_modules/sift/lib/index.js b/node_modules/sift/lib/index.js new file mode 100644 index 000000000..3e6e078f5 --- /dev/null +++ b/node_modules/sift/lib/index.js @@ -0,0 +1,766 @@ +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : + typeof define === 'function' && define.amd ? define(['exports'], factory) : + (global = global || self, factory(global.sift = {})); +}(this, (function (exports) { 'use strict'; + + /*! ***************************************************************************** + Copyright (c) Microsoft Corporation. + + Permission to use, copy, modify, and/or distribute this software for any + purpose with or without fee is hereby granted. + + THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH + REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, + INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM + LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + PERFORMANCE OF THIS SOFTWARE. + ***************************************************************************** */ + /* global Reflect, Promise */ + + var extendStatics = function(d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + + function __extends(d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + } + + var typeChecker = function (type) { + var typeString = "[object " + type + "]"; + return function (value) { + return getClassName(value) === typeString; + }; + }; + var getClassName = function (value) { return Object.prototype.toString.call(value); }; + var comparable = function (value) { + if (value instanceof Date) { + return value.getTime(); + } + else if (isArray(value)) { + return value.map(comparable); + } + else if (value && typeof value.toJSON === "function") { + return value.toJSON(); + } + return value; + }; + var isArray = typeChecker("Array"); + var isObject = typeChecker("Object"); + var isFunction = typeChecker("Function"); + var isVanillaObject = function (value) { + return (value && + (value.constructor === Object || + value.constructor === Array || + value.constructor.toString() === "function Object() { [native code] }" || + value.constructor.toString() === "function Array() { [native code] }") && + !value.toJSON); + }; + var equals = function (a, b) { + if (a == null && a == b) { + return true; + } + if (a === b) { + return true; + } + if (Object.prototype.toString.call(a) !== Object.prototype.toString.call(b)) { + return false; + } + if (isArray(a)) { + if (a.length !== b.length) { + return false; + } + for (var i = 0, length_1 = a.length; i < length_1; i++) { + if (!equals(a[i], b[i])) + return false; + } + return true; + } + else if (isObject(a)) { + if (Object.keys(a).length !== Object.keys(b).length) { + return false; + } + for (var key in a) { + if (!equals(a[key], b[key])) + return false; + } + return true; + } + return false; + }; + + /** + * Walks through each value given the context - used for nested operations. E.g: + * { "person.address": { $eq: "blarg" }} + */ + var walkKeyPathValues = function (item, keyPath, next, depth, key, owner) { + var currentKey = keyPath[depth]; + // if array, then try matching. Might fall through for cases like: + // { $eq: [1, 2, 3] }, [ 1, 2, 3 ]. + if (isArray(item) && isNaN(Number(currentKey))) { + for (var i = 0, length_1 = item.length; i < length_1; i++) { + // if FALSE is returned, then terminate walker. For operations, this simply + // means that the search critera was met. + if (!walkKeyPathValues(item[i], keyPath, next, depth, i, item)) { + return false; + } + } + } + if (depth === keyPath.length || item == null) { + return next(item, key, owner, depth === 0); + } + return walkKeyPathValues(item[currentKey], keyPath, next, depth + 1, currentKey, item); + }; + var BaseOperation = /** @class */ (function () { + function BaseOperation(params, owneryQuery, options, name) { + this.params = params; + this.owneryQuery = owneryQuery; + this.options = options; + this.name = name; + this.init(); + } + BaseOperation.prototype.init = function () { }; + BaseOperation.prototype.reset = function () { + this.done = false; + this.keep = false; + }; + return BaseOperation; + }()); + var GroupOperation = /** @class */ (function (_super) { + __extends(GroupOperation, _super); + function GroupOperation(params, owneryQuery, options, children) { + var _this = _super.call(this, params, owneryQuery, options) || this; + _this.children = children; + return _this; + } + /** + */ + GroupOperation.prototype.reset = function () { + this.keep = false; + this.done = false; + for (var i = 0, length_2 = this.children.length; i < length_2; i++) { + this.children[i].reset(); + } + }; + /** + */ + GroupOperation.prototype.childrenNext = function (item, key, owner, root) { + var done = true; + var keep = true; + for (var i = 0, length_3 = this.children.length; i < length_3; i++) { + var childOperation = this.children[i]; + if (!childOperation.done) { + childOperation.next(item, key, owner, root); + } + if (!childOperation.keep) { + keep = false; + } + if (childOperation.done) { + if (!childOperation.keep) { + break; + } + } + else { + done = false; + } + } + this.done = done; + this.keep = keep; + }; + return GroupOperation; + }(BaseOperation)); + var NamedGroupOperation = /** @class */ (function (_super) { + __extends(NamedGroupOperation, _super); + function NamedGroupOperation(params, owneryQuery, options, children, name) { + var _this = _super.call(this, params, owneryQuery, options, children) || this; + _this.name = name; + return _this; + } + return NamedGroupOperation; + }(GroupOperation)); + var QueryOperation = /** @class */ (function (_super) { + __extends(QueryOperation, _super); + function QueryOperation() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.propop = true; + return _this; + } + /** + */ + QueryOperation.prototype.next = function (item, key, parent, root) { + this.childrenNext(item, key, parent, root); + }; + return QueryOperation; + }(GroupOperation)); + var NestedOperation = /** @class */ (function (_super) { + __extends(NestedOperation, _super); + function NestedOperation(keyPath, params, owneryQuery, options, children) { + var _this = _super.call(this, params, owneryQuery, options, children) || this; + _this.keyPath = keyPath; + _this.propop = true; + /** + */ + _this._nextNestedValue = function (value, key, owner, root) { + _this.childrenNext(value, key, owner, root); + return !_this.done; + }; + return _this; + } + /** + */ + NestedOperation.prototype.next = function (item, key, parent) { + walkKeyPathValues(item, this.keyPath, this._nextNestedValue, 0, key, parent); + }; + return NestedOperation; + }(GroupOperation)); + var createTester = function (a, compare) { + if (a instanceof Function) { + return a; + } + if (a instanceof RegExp) { + return function (b) { + var result = typeof b === "string" && a.test(b); + a.lastIndex = 0; + return result; + }; + } + var comparableA = comparable(a); + return function (b) { return compare(comparableA, comparable(b)); }; + }; + var EqualsOperation = /** @class */ (function (_super) { + __extends(EqualsOperation, _super); + function EqualsOperation() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.propop = true; + return _this; + } + EqualsOperation.prototype.init = function () { + this._test = createTester(this.params, this.options.compare); + }; + EqualsOperation.prototype.next = function (item, key, parent) { + if (!Array.isArray(parent) || parent.hasOwnProperty(key)) { + if (this._test(item, key, parent)) { + this.done = true; + this.keep = true; + } + } + }; + return EqualsOperation; + }(BaseOperation)); + var createEqualsOperation = function (params, owneryQuery, options) { return new EqualsOperation(params, owneryQuery, options); }; + var NopeOperation = /** @class */ (function (_super) { + __extends(NopeOperation, _super); + function NopeOperation() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.propop = true; + return _this; + } + NopeOperation.prototype.next = function () { + this.done = true; + this.keep = false; + }; + return NopeOperation; + }(BaseOperation)); + var numericalOperationCreator = function (createNumericalOperation) { return function (params, owneryQuery, options, name) { + if (params == null) { + return new NopeOperation(params, owneryQuery, options, name); + } + return createNumericalOperation(params, owneryQuery, options, name); + }; }; + var numericalOperation = function (createTester) { + return numericalOperationCreator(function (params, owneryQuery, options, name) { + var typeofParams = typeof comparable(params); + var test = createTester(params); + return new EqualsOperation(function (b) { + return typeof comparable(b) === typeofParams && test(b); + }, owneryQuery, options, name); + }); + }; + var createNamedOperation = function (name, params, parentQuery, options) { + var operationCreator = options.operations[name]; + if (!operationCreator) { + throwUnsupportedOperation(name); + } + return operationCreator(params, parentQuery, options, name); + }; + var throwUnsupportedOperation = function (name) { + throw new Error("Unsupported operation: " + name); + }; + var containsOperation = function (query, options) { + for (var key in query) { + if (options.operations.hasOwnProperty(key) || key.charAt(0) === "$") + return true; + } + return false; + }; + var createNestedOperation = function (keyPath, nestedQuery, parentKey, owneryQuery, options) { + if (containsOperation(nestedQuery, options)) { + var _a = createQueryOperations(nestedQuery, parentKey, options), selfOperations = _a[0], nestedOperations = _a[1]; + if (nestedOperations.length) { + throw new Error("Property queries must contain only operations, or exact objects."); + } + return new NestedOperation(keyPath, nestedQuery, owneryQuery, options, selfOperations); + } + return new NestedOperation(keyPath, nestedQuery, owneryQuery, options, [ + new EqualsOperation(nestedQuery, owneryQuery, options) + ]); + }; + var createQueryOperation = function (query, owneryQuery, _a) { + if (owneryQuery === void 0) { owneryQuery = null; } + var _b = _a === void 0 ? {} : _a, compare = _b.compare, operations = _b.operations; + var options = { + compare: compare || equals, + operations: Object.assign({}, operations || {}) + }; + var _c = createQueryOperations(query, null, options), selfOperations = _c[0], nestedOperations = _c[1]; + var ops = []; + if (selfOperations.length) { + ops.push(new NestedOperation([], query, owneryQuery, options, selfOperations)); + } + ops.push.apply(ops, nestedOperations); + if (ops.length === 1) { + return ops[0]; + } + return new QueryOperation(query, owneryQuery, options, ops); + }; + var createQueryOperations = function (query, parentKey, options) { + var selfOperations = []; + var nestedOperations = []; + if (!isVanillaObject(query)) { + selfOperations.push(new EqualsOperation(query, query, options)); + return [selfOperations, nestedOperations]; + } + for (var key in query) { + if (options.operations.hasOwnProperty(key)) { + var op = createNamedOperation(key, query[key], query, options); + if (op) { + if (!op.propop && parentKey && !options.operations[parentKey]) { + throw new Error("Malformed query. " + key + " cannot be matched against property."); + } + } + // probably just a flag for another operation (like $options) + if (op != null) { + selfOperations.push(op); + } + } + else if (key.charAt(0) === "$") { + throwUnsupportedOperation(key); + } + else { + nestedOperations.push(createNestedOperation(key.split("."), query[key], key, query, options)); + } + } + return [selfOperations, nestedOperations]; + }; + var createOperationTester = function (operation) { return function (item, key, owner) { + operation.reset(); + operation.next(item, key, owner); + return operation.keep; + }; }; + var createQueryTester = function (query, options) { + if (options === void 0) { options = {}; } + return createOperationTester(createQueryOperation(query, null, options)); + }; + + var $Ne = /** @class */ (function (_super) { + __extends($Ne, _super); + function $Ne() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.propop = true; + return _this; + } + $Ne.prototype.init = function () { + this._test = createTester(this.params, this.options.compare); + }; + $Ne.prototype.reset = function () { + _super.prototype.reset.call(this); + this.keep = true; + }; + $Ne.prototype.next = function (item) { + if (this._test(item)) { + this.done = true; + this.keep = false; + } + }; + return $Ne; + }(BaseOperation)); + // https://docs.mongodb.com/manual/reference/operator/query/elemMatch/ + var $ElemMatch = /** @class */ (function (_super) { + __extends($ElemMatch, _super); + function $ElemMatch() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.propop = true; + return _this; + } + $ElemMatch.prototype.init = function () { + if (!this.params || typeof this.params !== "object") { + throw new Error("Malformed query. $elemMatch must by an object."); + } + this._queryOperation = createQueryOperation(this.params, this.owneryQuery, this.options); + }; + $ElemMatch.prototype.reset = function () { + _super.prototype.reset.call(this); + this._queryOperation.reset(); + }; + $ElemMatch.prototype.next = function (item) { + if (isArray(item)) { + for (var i = 0, length_1 = item.length; i < length_1; i++) { + // reset query operation since item being tested needs to pass _all_ query + // operations for it to be a success + this._queryOperation.reset(); + var child = item[i]; + this._queryOperation.next(child, i, item, false); + this.keep = this.keep || this._queryOperation.keep; + } + this.done = true; + } + else { + this.done = false; + this.keep = false; + } + }; + return $ElemMatch; + }(BaseOperation)); + var $Not = /** @class */ (function (_super) { + __extends($Not, _super); + function $Not() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.propop = true; + return _this; + } + $Not.prototype.init = function () { + this._queryOperation = createQueryOperation(this.params, this.owneryQuery, this.options); + }; + $Not.prototype.reset = function () { + _super.prototype.reset.call(this); + this._queryOperation.reset(); + }; + $Not.prototype.next = function (item, key, owner, root) { + this._queryOperation.next(item, key, owner, root); + this.done = this._queryOperation.done; + this.keep = !this._queryOperation.keep; + }; + return $Not; + }(BaseOperation)); + var $Size = /** @class */ (function (_super) { + __extends($Size, _super); + function $Size() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.propop = true; + return _this; + } + $Size.prototype.init = function () { }; + $Size.prototype.next = function (item) { + if (isArray(item) && item.length === this.params) { + this.done = true; + this.keep = true; + } + // if (parent && parent.length === this.params) { + // this.done = true; + // this.keep = true; + // } + }; + return $Size; + }(BaseOperation)); + var assertGroupNotEmpty = function (values) { + if (values.length === 0) { + throw new Error("$and/$or/$nor must be a nonempty array"); + } + }; + var $Or = /** @class */ (function (_super) { + __extends($Or, _super); + function $Or() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.propop = false; + return _this; + } + $Or.prototype.init = function () { + var _this = this; + assertGroupNotEmpty(this.params); + this._ops = this.params.map(function (op) { + return createQueryOperation(op, null, _this.options); + }); + }; + $Or.prototype.reset = function () { + this.done = false; + this.keep = false; + for (var i = 0, length_2 = this._ops.length; i < length_2; i++) { + this._ops[i].reset(); + } + }; + $Or.prototype.next = function (item, key, owner) { + var done = false; + var success = false; + for (var i = 0, length_3 = this._ops.length; i < length_3; i++) { + var op = this._ops[i]; + op.next(item, key, owner); + if (op.keep) { + done = true; + success = op.keep; + break; + } + } + this.keep = success; + this.done = done; + }; + return $Or; + }(BaseOperation)); + var $Nor = /** @class */ (function (_super) { + __extends($Nor, _super); + function $Nor() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.propop = false; + return _this; + } + $Nor.prototype.next = function (item, key, owner) { + _super.prototype.next.call(this, item, key, owner); + this.keep = !this.keep; + }; + return $Nor; + }($Or)); + var $In = /** @class */ (function (_super) { + __extends($In, _super); + function $In() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.propop = true; + return _this; + } + $In.prototype.init = function () { + var _this = this; + this._testers = this.params.map(function (value) { + if (containsOperation(value, _this.options)) { + throw new Error("cannot nest $ under " + _this.name.toLowerCase()); + } + return createTester(value, _this.options.compare); + }); + }; + $In.prototype.next = function (item, key, owner) { + var done = false; + var success = false; + for (var i = 0, length_4 = this._testers.length; i < length_4; i++) { + var test = this._testers[i]; + if (test(item)) { + done = true; + success = true; + break; + } + } + this.keep = success; + this.done = done; + }; + return $In; + }(BaseOperation)); + var $Nin = /** @class */ (function (_super) { + __extends($Nin, _super); + function $Nin(params, ownerQuery, options, name) { + var _this = _super.call(this, params, ownerQuery, options, name) || this; + _this.propop = true; + _this._in = new $In(params, ownerQuery, options, name); + return _this; + } + $Nin.prototype.next = function (item, key, owner, root) { + this._in.next(item, key, owner); + if (isArray(owner) && !root) { + if (this._in.keep) { + this.keep = false; + this.done = true; + } + else if (key == owner.length - 1) { + this.keep = true; + this.done = true; + } + } + else { + this.keep = !this._in.keep; + this.done = true; + } + }; + $Nin.prototype.reset = function () { + _super.prototype.reset.call(this); + this._in.reset(); + }; + return $Nin; + }(BaseOperation)); + var $Exists = /** @class */ (function (_super) { + __extends($Exists, _super); + function $Exists() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.propop = true; + return _this; + } + $Exists.prototype.next = function (item, key, owner) { + if (owner.hasOwnProperty(key) === this.params) { + this.done = true; + this.keep = true; + } + }; + return $Exists; + }(BaseOperation)); + var $And = /** @class */ (function (_super) { + __extends($And, _super); + function $And(params, owneryQuery, options, name) { + var _this = _super.call(this, params, owneryQuery, options, params.map(function (query) { return createQueryOperation(query, owneryQuery, options); }), name) || this; + _this.propop = false; + assertGroupNotEmpty(params); + return _this; + } + $And.prototype.next = function (item, key, owner, root) { + this.childrenNext(item, key, owner, root); + }; + return $And; + }(NamedGroupOperation)); + var $All = /** @class */ (function (_super) { + __extends($All, _super); + function $All(params, owneryQuery, options, name) { + var _this = _super.call(this, params, owneryQuery, options, params.map(function (query) { return createQueryOperation(query, owneryQuery, options); }), name) || this; + _this.propop = true; + return _this; + } + $All.prototype.next = function (item, key, owner, root) { + this.childrenNext(item, key, owner, root); + }; + return $All; + }(NamedGroupOperation)); + var $eq = function (params, owneryQuery, options) { + return new EqualsOperation(params, owneryQuery, options); + }; + var $ne = function (params, owneryQuery, options, name) { return new $Ne(params, owneryQuery, options, name); }; + var $or = function (params, owneryQuery, options, name) { return new $Or(params, owneryQuery, options, name); }; + var $nor = function (params, owneryQuery, options, name) { return new $Nor(params, owneryQuery, options, name); }; + var $elemMatch = function (params, owneryQuery, options, name) { return new $ElemMatch(params, owneryQuery, options, name); }; + var $nin = function (params, owneryQuery, options, name) { return new $Nin(params, owneryQuery, options, name); }; + var $in = function (params, owneryQuery, options, name) { + return new $In(params, owneryQuery, options, name); + }; + var $lt = numericalOperation(function (params) { return function (b) { return b < params; }; }); + var $lte = numericalOperation(function (params) { return function (b) { return b <= params; }; }); + var $gt = numericalOperation(function (params) { return function (b) { return b > params; }; }); + var $gte = numericalOperation(function (params) { return function (b) { return b >= params; }; }); + var $mod = function (_a, owneryQuery, options) { + var mod = _a[0], equalsValue = _a[1]; + return new EqualsOperation(function (b) { return comparable(b) % mod === equalsValue; }, owneryQuery, options); + }; + var $exists = function (params, owneryQuery, options, name) { return new $Exists(params, owneryQuery, options, name); }; + var $regex = function (pattern, owneryQuery, options) { + return new EqualsOperation(new RegExp(pattern, owneryQuery.$options), owneryQuery, options); + }; + var $not = function (params, owneryQuery, options, name) { return new $Not(params, owneryQuery, options, name); }; + var typeAliases = { + number: function (v) { return typeof v === "number"; }, + string: function (v) { return typeof v === "string"; }, + bool: function (v) { return typeof v === "boolean"; }, + array: function (v) { return Array.isArray(v); }, + null: function (v) { return v === null; }, + timestamp: function (v) { return v instanceof Date; } + }; + var $type = function (clazz, owneryQuery, options) { + return new EqualsOperation(function (b) { + if (typeof clazz === "string") { + if (!typeAliases[clazz]) { + throw new Error("Type alias does not exist"); + } + return typeAliases[clazz](b); + } + return b != null ? b instanceof clazz || b.constructor === clazz : false; + }, owneryQuery, options); + }; + var $and = function (params, ownerQuery, options, name) { return new $And(params, ownerQuery, options, name); }; + var $all = function (params, ownerQuery, options, name) { return new $All(params, ownerQuery, options, name); }; + var $size = function (params, ownerQuery, options) { return new $Size(params, ownerQuery, options, "$size"); }; + var $options = function () { return null; }; + var $where = function (params, ownerQuery, options) { + var test; + if (isFunction(params)) { + test = params; + } + else if (!process.env.CSP_ENABLED) { + test = new Function("obj", "return " + params); + } + else { + throw new Error("In CSP mode, sift does not support strings in \"$where\" condition"); + } + return new EqualsOperation(function (b) { return test.bind(b)(b); }, ownerQuery, options); + }; + + var defaultOperations = /*#__PURE__*/Object.freeze({ + __proto__: null, + $Size: $Size, + $eq: $eq, + $ne: $ne, + $or: $or, + $nor: $nor, + $elemMatch: $elemMatch, + $nin: $nin, + $in: $in, + $lt: $lt, + $lte: $lte, + $gt: $gt, + $gte: $gte, + $mod: $mod, + $exists: $exists, + $regex: $regex, + $not: $not, + $type: $type, + $and: $and, + $all: $all, + $size: $size, + $options: $options, + $where: $where + }); + + var createDefaultQueryOperation = function (query, ownerQuery, _a) { + var _b = _a === void 0 ? {} : _a, compare = _b.compare, operations = _b.operations; + return createQueryOperation(query, ownerQuery, { + compare: compare, + operations: Object.assign({}, defaultOperations, operations || {}) + }); + }; + var createDefaultQueryTester = function (query, options) { + if (options === void 0) { options = {}; } + var op = createDefaultQueryOperation(query, null, options); + return createOperationTester(op); + }; + + exports.$Size = $Size; + exports.$all = $all; + exports.$and = $and; + exports.$elemMatch = $elemMatch; + exports.$eq = $eq; + exports.$exists = $exists; + exports.$gt = $gt; + exports.$gte = $gte; + exports.$in = $in; + exports.$lt = $lt; + exports.$lte = $lte; + exports.$mod = $mod; + exports.$ne = $ne; + exports.$nin = $nin; + exports.$nor = $nor; + exports.$not = $not; + exports.$options = $options; + exports.$or = $or; + exports.$regex = $regex; + exports.$size = $size; + exports.$type = $type; + exports.$where = $where; + exports.EqualsOperation = EqualsOperation; + exports.createDefaultQueryOperation = createDefaultQueryOperation; + exports.createEqualsOperation = createEqualsOperation; + exports.createOperationTester = createOperationTester; + exports.createQueryOperation = createQueryOperation; + exports.createQueryTester = createQueryTester; + exports.default = createDefaultQueryTester; + + Object.defineProperty(exports, '__esModule', { value: true }); + +}))); +//# sourceMappingURL=index.js.map diff --git a/node_modules/sift/lib/index.js.map b/node_modules/sift/lib/index.js.map new file mode 100644 index 000000000..d8f5fa943 --- /dev/null +++ b/node_modules/sift/lib/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sources":["../node_modules/tslib/tslib.es6.js","../src/utils.ts","../src/core.ts","../src/operations.ts","../src/index.ts"],"sourcesContent":["/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n}\r\n\r\nexport function __spreadArray(to, from) {\r\n for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)\r\n to[j] = from[i];\r\n return to;\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n}\r\n",null,null,null,null],"names":[],"mappings":";;;;;;IAAA;IACA;AACA;IACA;IACA;AACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;AACA;IACA,IAAI,aAAa,GAAG,SAAS,CAAC,EAAE,CAAC,EAAE;IACnC,IAAI,aAAa,GAAG,MAAM,CAAC,cAAc;IACzC,SAAS,EAAE,SAAS,EAAE,EAAE,EAAE,YAAY,KAAK,IAAI,UAAU,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,SAAS,GAAG,CAAC,CAAC,EAAE,CAAC;IACpF,QAAQ,UAAU,CAAC,EAAE,CAAC,EAAE,EAAE,KAAK,IAAI,CAAC,IAAI,CAAC,EAAE,IAAI,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IAC1G,IAAI,OAAO,aAAa,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IAC/B,CAAC,CAAC;AACF;IACO,SAAS,SAAS,CAAC,CAAC,EAAE,CAAC,EAAE;IAChC,IAAI,IAAI,OAAO,CAAC,KAAK,UAAU,IAAI,CAAC,KAAK,IAAI;IAC7C,QAAQ,MAAM,IAAI,SAAS,CAAC,sBAAsB,GAAG,MAAM,CAAC,CAAC,CAAC,GAAG,+BAA+B,CAAC,CAAC;IAClG,IAAI,aAAa,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IACxB,IAAI,SAAS,EAAE,GAAG,EAAE,IAAI,CAAC,WAAW,GAAG,CAAC,CAAC,EAAE;IAC3C,IAAI,CAAC,CAAC,SAAS,GAAG,CAAC,KAAK,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,EA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AC,CAAC,CAAC,GAAA,EAAE,UAAU,EAAE,OAAO,CAAC,CAAC;IACxE;;;;;;;;;;;;;;;;;;;;;;;;;;;;QC/YM,2BAA2B,GAAG,UAClC,KAAqB,EACrB,UAAe,EACf,EAA8C;YAA9C,qBAA4C,EAAE,KAAA,EAA5C,OAAO,aAAA,EAAE,UAAU,gBAAA;QAErB,OAAO,oBAAoB,CAAC,KAAK,EAAE,UAAU,EAAE;YAC7C,OAAO,SAAA;YACP,UAAU,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,iBAAiB,EAAE,UAAU,IAAI,EAAE,CAAC;SACnE,CAAC,CAAC;IACL,EAAE;QAEI,wBAAwB,GAAG,UAC/B,KAAqB,EACrB,OAA8B;QAA9B,wBAAA,EAAA,YAA8B;QAE9B,IAAM,EAAE,GAAG,2BAA2B,CAAC,KAAK,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;QAC7D,OAAO,qBAAqB,CAAC,EAAE,CAAC,CAAC;IACnC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/node_modules/sift/lib/operations.d.ts b/node_modules/sift/lib/operations.d.ts new file mode 100644 index 000000000..ea1247baa --- /dev/null +++ b/node_modules/sift/lib/operations.d.ts @@ -0,0 +1,88 @@ +import { BaseOperation, EqualsOperation, Options, Operation, Query, NamedGroupOperation } from "./core"; +import { Key } from "./utils"; +declare class $Ne extends BaseOperation { + readonly propop = true; + private _test; + init(): void; + reset(): void; + next(item: any): void; +} +declare class $ElemMatch extends BaseOperation> { + readonly propop = true; + private _queryOperation; + init(): void; + reset(): void; + next(item: any): void; +} +declare class $Not extends BaseOperation> { + readonly propop = true; + private _queryOperation; + init(): void; + reset(): void; + next(item: any, key: Key, owner: any, root: boolean): void; +} +export declare class $Size extends BaseOperation { + readonly propop = true; + init(): void; + next(item: any): void; +} +declare class $Or extends BaseOperation { + readonly propop = false; + private _ops; + init(): void; + reset(): void; + next(item: any, key: Key, owner: any): void; +} +declare class $Nor extends $Or { + readonly propop = false; + next(item: any, key: Key, owner: any): void; +} +declare class $In extends BaseOperation { + readonly propop = true; + private _testers; + init(): void; + next(item: any, key: Key, owner: any): void; +} +declare class $Nin extends BaseOperation { + readonly propop = true; + private _in; + constructor(params: any, ownerQuery: any, options: Options, name: string); + next(item: any, key: Key, owner: any, root: boolean): void; + reset(): void; +} +declare class $Exists extends BaseOperation { + readonly propop = true; + next(item: any, key: Key, owner: any): void; +} +declare class $And extends NamedGroupOperation { + readonly propop = false; + constructor(params: Query[], owneryQuery: Query, options: Options, name: string); + next(item: any, key: Key, owner: any, root: boolean): void; +} +declare class $All extends NamedGroupOperation { + readonly propop = true; + constructor(params: Query[], owneryQuery: Query, options: Options, name: string); + next(item: any, key: Key, owner: any, root: boolean): void; +} +export declare const $eq: (params: any, owneryQuery: Query, options: Options) => EqualsOperation; +export declare const $ne: (params: any, owneryQuery: Query, options: Options, name: string) => $Ne; +export declare const $or: (params: Query[], owneryQuery: Query, options: Options, name: string) => $Or; +export declare const $nor: (params: Query[], owneryQuery: Query, options: Options, name: string) => $Nor; +export declare const $elemMatch: (params: any, owneryQuery: Query, options: Options, name: string) => $ElemMatch; +export declare const $nin: (params: any, owneryQuery: Query, options: Options, name: string) => $Nin; +export declare const $in: (params: any, owneryQuery: Query, options: Options, name: string) => $In; +export declare const $lt: (params: any, owneryQuery: any, options: Options, name: string) => Operation; +export declare const $lte: (params: any, owneryQuery: any, options: Options, name: string) => Operation; +export declare const $gt: (params: any, owneryQuery: any, options: Options, name: string) => Operation; +export declare const $gte: (params: any, owneryQuery: any, options: Options, name: string) => Operation; +export declare const $mod: ([mod, equalsValue]: number[], owneryQuery: Query, options: Options) => EqualsOperation<(b: any) => boolean>; +export declare const $exists: (params: boolean, owneryQuery: Query, options: Options, name: string) => $Exists; +export declare const $regex: (pattern: string, owneryQuery: Query, options: Options) => EqualsOperation; +export declare const $not: (params: any, owneryQuery: Query, options: Options, name: string) => $Not; +export declare const $type: (clazz: Function | string, owneryQuery: Query, options: Options) => EqualsOperation<(b: any) => any>; +export declare const $and: (params: Query[], ownerQuery: Query, options: Options, name: string) => $And; +export declare const $all: (params: Query[], ownerQuery: Query, options: Options, name: string) => $All; +export declare const $size: (params: number, ownerQuery: Query, options: Options) => $Size; +export declare const $options: () => any; +export declare const $where: (params: string | Function, ownerQuery: Query, options: Options) => EqualsOperation<(b: any) => any>; +export {}; diff --git a/node_modules/sift/lib/utils.d.ts b/node_modules/sift/lib/utils.d.ts new file mode 100644 index 000000000..422a2924a --- /dev/null +++ b/node_modules/sift/lib/utils.d.ts @@ -0,0 +1,9 @@ +export declare type Key = string | number; +export declare type Comparator = (a: any, b: any) => boolean; +export declare const typeChecker: (type: any) => (value: any) => value is TType; +export declare const comparable: (value: any) => any; +export declare const isArray: (value: any) => value is any[]; +export declare const isObject: (value: any) => value is Object; +export declare const isFunction: (value: any) => value is Function; +export declare const isVanillaObject: (value: any) => boolean; +export declare const equals: (a: any, b: any) => boolean; diff --git a/node_modules/sift/package.json b/node_modules/sift/package.json new file mode 100644 index 000000000..d6ed64aec --- /dev/null +++ b/node_modules/sift/package.json @@ -0,0 +1,62 @@ +{ + "name": "sift", + "description": "MongoDB query filtering in JavaScript", + "version": "16.0.0", + "repository": "crcn/sift.js", + "sideEffects": false, + "author": { + "name": "Craig Condon", + "email": "craig.j.condon@gmail.com" + }, + "license": "MIT", + "engines": {}, + "typings": "./index.d.ts", + "husky": { + "hooks": { + "pre-commit": "pretty-quick --staged" + } + }, + "devDependencies": { + "@rollup/plugin-replace": "^2.3.2", + "@rollup/plugin-typescript": "8.2.1", + "@types/node": "^13.7.0", + "bson": "^4.0.3", + "eval": "^0.1.4", + "husky": "^1.2.1", + "immutable": "^3.7.6", + "mocha": "8.3.2", + "mongodb": "^3.6.6", + "prettier": "1.15.3", + "pretty-quick": "^1.11.1", + "rimraf": "^3.0.2", + "rollup": "^2.7.2", + "rollup-plugin-terser": "^7.0.2", + "tslib": "2.2.0", + "typescript": "4.2.4" + }, + "main": "./index.js", + "module": "./es5m/index.js", + "es2015": "./es/index.js", + "scripts": { + "clean": "rimraf lib es5m es", + "prebuild": "npm run clean && npm run build:types", + "build": "rollup -c", + "build:types": "tsc -p tsconfig.json --emitDeclarationOnly --outDir lib", + "test": "npm run test:spec && npm run test:types", + "test:spec": "mocha ./test -R spec", + "test:types": "cd test && tsc types.ts --noEmit", + "prepublishOnly": "npm run build && npm run test" + }, + "files": [ + "es", + "es5m", + "lib", + "src", + "*.d.ts", + "*.js.map", + "index.js", + "sift.csp.min.js", + "sift.min.js", + "MIT-LICENSE.txt" + ] +} diff --git a/node_modules/sift/sift.csp.min.js b/node_modules/sift/sift.csp.min.js new file mode 100644 index 000000000..ac6865c21 --- /dev/null +++ b/node_modules/sift/sift.csp.min.js @@ -0,0 +1,763 @@ +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : + typeof define === 'function' && define.amd ? define(['exports'], factory) : + (global = global || self, factory(global.sift = {})); +}(this, (function (exports) { 'use strict'; + + /*! ***************************************************************************** + Copyright (c) Microsoft Corporation. + + Permission to use, copy, modify, and/or distribute this software for any + purpose with or without fee is hereby granted. + + THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH + REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, + INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM + LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + PERFORMANCE OF THIS SOFTWARE. + ***************************************************************************** */ + /* global Reflect, Promise */ + + var extendStatics = function(d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + + function __extends(d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + } + + var typeChecker = function (type) { + var typeString = "[object " + type + "]"; + return function (value) { + return getClassName(value) === typeString; + }; + }; + var getClassName = function (value) { return Object.prototype.toString.call(value); }; + var comparable = function (value) { + if (value instanceof Date) { + return value.getTime(); + } + else if (isArray(value)) { + return value.map(comparable); + } + else if (value && typeof value.toJSON === "function") { + return value.toJSON(); + } + return value; + }; + var isArray = typeChecker("Array"); + var isObject = typeChecker("Object"); + var isFunction = typeChecker("Function"); + var isVanillaObject = function (value) { + return (value && + (value.constructor === Object || + value.constructor === Array || + value.constructor.toString() === "function Object() { [native code] }" || + value.constructor.toString() === "function Array() { [native code] }") && + !value.toJSON); + }; + var equals = function (a, b) { + if (a == null && a == b) { + return true; + } + if (a === b) { + return true; + } + if (Object.prototype.toString.call(a) !== Object.prototype.toString.call(b)) { + return false; + } + if (isArray(a)) { + if (a.length !== b.length) { + return false; + } + for (var i = 0, length_1 = a.length; i < length_1; i++) { + if (!equals(a[i], b[i])) + return false; + } + return true; + } + else if (isObject(a)) { + if (Object.keys(a).length !== Object.keys(b).length) { + return false; + } + for (var key in a) { + if (!equals(a[key], b[key])) + return false; + } + return true; + } + return false; + }; + + /** + * Walks through each value given the context - used for nested operations. E.g: + * { "person.address": { $eq: "blarg" }} + */ + var walkKeyPathValues = function (item, keyPath, next, depth, key, owner) { + var currentKey = keyPath[depth]; + // if array, then try matching. Might fall through for cases like: + // { $eq: [1, 2, 3] }, [ 1, 2, 3 ]. + if (isArray(item) && isNaN(Number(currentKey))) { + for (var i = 0, length_1 = item.length; i < length_1; i++) { + // if FALSE is returned, then terminate walker. For operations, this simply + // means that the search critera was met. + if (!walkKeyPathValues(item[i], keyPath, next, depth, i, item)) { + return false; + } + } + } + if (depth === keyPath.length || item == null) { + return next(item, key, owner, depth === 0); + } + return walkKeyPathValues(item[currentKey], keyPath, next, depth + 1, currentKey, item); + }; + var BaseOperation = /** @class */ (function () { + function BaseOperation(params, owneryQuery, options, name) { + this.params = params; + this.owneryQuery = owneryQuery; + this.options = options; + this.name = name; + this.init(); + } + BaseOperation.prototype.init = function () { }; + BaseOperation.prototype.reset = function () { + this.done = false; + this.keep = false; + }; + return BaseOperation; + }()); + var GroupOperation = /** @class */ (function (_super) { + __extends(GroupOperation, _super); + function GroupOperation(params, owneryQuery, options, children) { + var _this = _super.call(this, params, owneryQuery, options) || this; + _this.children = children; + return _this; + } + /** + */ + GroupOperation.prototype.reset = function () { + this.keep = false; + this.done = false; + for (var i = 0, length_2 = this.children.length; i < length_2; i++) { + this.children[i].reset(); + } + }; + /** + */ + GroupOperation.prototype.childrenNext = function (item, key, owner, root) { + var done = true; + var keep = true; + for (var i = 0, length_3 = this.children.length; i < length_3; i++) { + var childOperation = this.children[i]; + if (!childOperation.done) { + childOperation.next(item, key, owner, root); + } + if (!childOperation.keep) { + keep = false; + } + if (childOperation.done) { + if (!childOperation.keep) { + break; + } + } + else { + done = false; + } + } + this.done = done; + this.keep = keep; + }; + return GroupOperation; + }(BaseOperation)); + var NamedGroupOperation = /** @class */ (function (_super) { + __extends(NamedGroupOperation, _super); + function NamedGroupOperation(params, owneryQuery, options, children, name) { + var _this = _super.call(this, params, owneryQuery, options, children) || this; + _this.name = name; + return _this; + } + return NamedGroupOperation; + }(GroupOperation)); + var QueryOperation = /** @class */ (function (_super) { + __extends(QueryOperation, _super); + function QueryOperation() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.propop = true; + return _this; + } + /** + */ + QueryOperation.prototype.next = function (item, key, parent, root) { + this.childrenNext(item, key, parent, root); + }; + return QueryOperation; + }(GroupOperation)); + var NestedOperation = /** @class */ (function (_super) { + __extends(NestedOperation, _super); + function NestedOperation(keyPath, params, owneryQuery, options, children) { + var _this = _super.call(this, params, owneryQuery, options, children) || this; + _this.keyPath = keyPath; + _this.propop = true; + /** + */ + _this._nextNestedValue = function (value, key, owner, root) { + _this.childrenNext(value, key, owner, root); + return !_this.done; + }; + return _this; + } + /** + */ + NestedOperation.prototype.next = function (item, key, parent) { + walkKeyPathValues(item, this.keyPath, this._nextNestedValue, 0, key, parent); + }; + return NestedOperation; + }(GroupOperation)); + var createTester = function (a, compare) { + if (a instanceof Function) { + return a; + } + if (a instanceof RegExp) { + return function (b) { + var result = typeof b === "string" && a.test(b); + a.lastIndex = 0; + return result; + }; + } + var comparableA = comparable(a); + return function (b) { return compare(comparableA, comparable(b)); }; + }; + var EqualsOperation = /** @class */ (function (_super) { + __extends(EqualsOperation, _super); + function EqualsOperation() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.propop = true; + return _this; + } + EqualsOperation.prototype.init = function () { + this._test = createTester(this.params, this.options.compare); + }; + EqualsOperation.prototype.next = function (item, key, parent) { + if (!Array.isArray(parent) || parent.hasOwnProperty(key)) { + if (this._test(item, key, parent)) { + this.done = true; + this.keep = true; + } + } + }; + return EqualsOperation; + }(BaseOperation)); + var createEqualsOperation = function (params, owneryQuery, options) { return new EqualsOperation(params, owneryQuery, options); }; + var NopeOperation = /** @class */ (function (_super) { + __extends(NopeOperation, _super); + function NopeOperation() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.propop = true; + return _this; + } + NopeOperation.prototype.next = function () { + this.done = true; + this.keep = false; + }; + return NopeOperation; + }(BaseOperation)); + var numericalOperationCreator = function (createNumericalOperation) { return function (params, owneryQuery, options, name) { + if (params == null) { + return new NopeOperation(params, owneryQuery, options, name); + } + return createNumericalOperation(params, owneryQuery, options, name); + }; }; + var numericalOperation = function (createTester) { + return numericalOperationCreator(function (params, owneryQuery, options, name) { + var typeofParams = typeof comparable(params); + var test = createTester(params); + return new EqualsOperation(function (b) { + return typeof comparable(b) === typeofParams && test(b); + }, owneryQuery, options, name); + }); + }; + var createNamedOperation = function (name, params, parentQuery, options) { + var operationCreator = options.operations[name]; + if (!operationCreator) { + throwUnsupportedOperation(name); + } + return operationCreator(params, parentQuery, options, name); + }; + var throwUnsupportedOperation = function (name) { + throw new Error("Unsupported operation: " + name); + }; + var containsOperation = function (query, options) { + for (var key in query) { + if (options.operations.hasOwnProperty(key) || key.charAt(0) === "$") + return true; + } + return false; + }; + var createNestedOperation = function (keyPath, nestedQuery, parentKey, owneryQuery, options) { + if (containsOperation(nestedQuery, options)) { + var _a = createQueryOperations(nestedQuery, parentKey, options), selfOperations = _a[0], nestedOperations = _a[1]; + if (nestedOperations.length) { + throw new Error("Property queries must contain only operations, or exact objects."); + } + return new NestedOperation(keyPath, nestedQuery, owneryQuery, options, selfOperations); + } + return new NestedOperation(keyPath, nestedQuery, owneryQuery, options, [ + new EqualsOperation(nestedQuery, owneryQuery, options) + ]); + }; + var createQueryOperation = function (query, owneryQuery, _a) { + if (owneryQuery === void 0) { owneryQuery = null; } + var _b = _a === void 0 ? {} : _a, compare = _b.compare, operations = _b.operations; + var options = { + compare: compare || equals, + operations: Object.assign({}, operations || {}) + }; + var _c = createQueryOperations(query, null, options), selfOperations = _c[0], nestedOperations = _c[1]; + var ops = []; + if (selfOperations.length) { + ops.push(new NestedOperation([], query, owneryQuery, options, selfOperations)); + } + ops.push.apply(ops, nestedOperations); + if (ops.length === 1) { + return ops[0]; + } + return new QueryOperation(query, owneryQuery, options, ops); + }; + var createQueryOperations = function (query, parentKey, options) { + var selfOperations = []; + var nestedOperations = []; + if (!isVanillaObject(query)) { + selfOperations.push(new EqualsOperation(query, query, options)); + return [selfOperations, nestedOperations]; + } + for (var key in query) { + if (options.operations.hasOwnProperty(key)) { + var op = createNamedOperation(key, query[key], query, options); + if (op) { + if (!op.propop && parentKey && !options.operations[parentKey]) { + throw new Error("Malformed query. " + key + " cannot be matched against property."); + } + } + // probably just a flag for another operation (like $options) + if (op != null) { + selfOperations.push(op); + } + } + else if (key.charAt(0) === "$") { + throwUnsupportedOperation(key); + } + else { + nestedOperations.push(createNestedOperation(key.split("."), query[key], key, query, options)); + } + } + return [selfOperations, nestedOperations]; + }; + var createOperationTester = function (operation) { return function (item, key, owner) { + operation.reset(); + operation.next(item, key, owner); + return operation.keep; + }; }; + var createQueryTester = function (query, options) { + if (options === void 0) { options = {}; } + return createOperationTester(createQueryOperation(query, null, options)); + }; + + var $Ne = /** @class */ (function (_super) { + __extends($Ne, _super); + function $Ne() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.propop = true; + return _this; + } + $Ne.prototype.init = function () { + this._test = createTester(this.params, this.options.compare); + }; + $Ne.prototype.reset = function () { + _super.prototype.reset.call(this); + this.keep = true; + }; + $Ne.prototype.next = function (item) { + if (this._test(item)) { + this.done = true; + this.keep = false; + } + }; + return $Ne; + }(BaseOperation)); + // https://docs.mongodb.com/manual/reference/operator/query/elemMatch/ + var $ElemMatch = /** @class */ (function (_super) { + __extends($ElemMatch, _super); + function $ElemMatch() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.propop = true; + return _this; + } + $ElemMatch.prototype.init = function () { + if (!this.params || typeof this.params !== "object") { + throw new Error("Malformed query. $elemMatch must by an object."); + } + this._queryOperation = createQueryOperation(this.params, this.owneryQuery, this.options); + }; + $ElemMatch.prototype.reset = function () { + _super.prototype.reset.call(this); + this._queryOperation.reset(); + }; + $ElemMatch.prototype.next = function (item) { + if (isArray(item)) { + for (var i = 0, length_1 = item.length; i < length_1; i++) { + // reset query operation since item being tested needs to pass _all_ query + // operations for it to be a success + this._queryOperation.reset(); + var child = item[i]; + this._queryOperation.next(child, i, item, false); + this.keep = this.keep || this._queryOperation.keep; + } + this.done = true; + } + else { + this.done = false; + this.keep = false; + } + }; + return $ElemMatch; + }(BaseOperation)); + var $Not = /** @class */ (function (_super) { + __extends($Not, _super); + function $Not() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.propop = true; + return _this; + } + $Not.prototype.init = function () { + this._queryOperation = createQueryOperation(this.params, this.owneryQuery, this.options); + }; + $Not.prototype.reset = function () { + _super.prototype.reset.call(this); + this._queryOperation.reset(); + }; + $Not.prototype.next = function (item, key, owner, root) { + this._queryOperation.next(item, key, owner, root); + this.done = this._queryOperation.done; + this.keep = !this._queryOperation.keep; + }; + return $Not; + }(BaseOperation)); + var $Size = /** @class */ (function (_super) { + __extends($Size, _super); + function $Size() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.propop = true; + return _this; + } + $Size.prototype.init = function () { }; + $Size.prototype.next = function (item) { + if (isArray(item) && item.length === this.params) { + this.done = true; + this.keep = true; + } + // if (parent && parent.length === this.params) { + // this.done = true; + // this.keep = true; + // } + }; + return $Size; + }(BaseOperation)); + var assertGroupNotEmpty = function (values) { + if (values.length === 0) { + throw new Error("$and/$or/$nor must be a nonempty array"); + } + }; + var $Or = /** @class */ (function (_super) { + __extends($Or, _super); + function $Or() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.propop = false; + return _this; + } + $Or.prototype.init = function () { + var _this = this; + assertGroupNotEmpty(this.params); + this._ops = this.params.map(function (op) { + return createQueryOperation(op, null, _this.options); + }); + }; + $Or.prototype.reset = function () { + this.done = false; + this.keep = false; + for (var i = 0, length_2 = this._ops.length; i < length_2; i++) { + this._ops[i].reset(); + } + }; + $Or.prototype.next = function (item, key, owner) { + var done = false; + var success = false; + for (var i = 0, length_3 = this._ops.length; i < length_3; i++) { + var op = this._ops[i]; + op.next(item, key, owner); + if (op.keep) { + done = true; + success = op.keep; + break; + } + } + this.keep = success; + this.done = done; + }; + return $Or; + }(BaseOperation)); + var $Nor = /** @class */ (function (_super) { + __extends($Nor, _super); + function $Nor() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.propop = false; + return _this; + } + $Nor.prototype.next = function (item, key, owner) { + _super.prototype.next.call(this, item, key, owner); + this.keep = !this.keep; + }; + return $Nor; + }($Or)); + var $In = /** @class */ (function (_super) { + __extends($In, _super); + function $In() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.propop = true; + return _this; + } + $In.prototype.init = function () { + var _this = this; + this._testers = this.params.map(function (value) { + if (containsOperation(value, _this.options)) { + throw new Error("cannot nest $ under " + _this.name.toLowerCase()); + } + return createTester(value, _this.options.compare); + }); + }; + $In.prototype.next = function (item, key, owner) { + var done = false; + var success = false; + for (var i = 0, length_4 = this._testers.length; i < length_4; i++) { + var test = this._testers[i]; + if (test(item)) { + done = true; + success = true; + break; + } + } + this.keep = success; + this.done = done; + }; + return $In; + }(BaseOperation)); + var $Nin = /** @class */ (function (_super) { + __extends($Nin, _super); + function $Nin(params, ownerQuery, options, name) { + var _this = _super.call(this, params, ownerQuery, options, name) || this; + _this.propop = true; + _this._in = new $In(params, ownerQuery, options, name); + return _this; + } + $Nin.prototype.next = function (item, key, owner, root) { + this._in.next(item, key, owner); + if (isArray(owner) && !root) { + if (this._in.keep) { + this.keep = false; + this.done = true; + } + else if (key == owner.length - 1) { + this.keep = true; + this.done = true; + } + } + else { + this.keep = !this._in.keep; + this.done = true; + } + }; + $Nin.prototype.reset = function () { + _super.prototype.reset.call(this); + this._in.reset(); + }; + return $Nin; + }(BaseOperation)); + var $Exists = /** @class */ (function (_super) { + __extends($Exists, _super); + function $Exists() { + var _this = _super !== null && _super.apply(this, arguments) || this; + _this.propop = true; + return _this; + } + $Exists.prototype.next = function (item, key, owner) { + if (owner.hasOwnProperty(key) === this.params) { + this.done = true; + this.keep = true; + } + }; + return $Exists; + }(BaseOperation)); + var $And = /** @class */ (function (_super) { + __extends($And, _super); + function $And(params, owneryQuery, options, name) { + var _this = _super.call(this, params, owneryQuery, options, params.map(function (query) { return createQueryOperation(query, owneryQuery, options); }), name) || this; + _this.propop = false; + assertGroupNotEmpty(params); + return _this; + } + $And.prototype.next = function (item, key, owner, root) { + this.childrenNext(item, key, owner, root); + }; + return $And; + }(NamedGroupOperation)); + var $All = /** @class */ (function (_super) { + __extends($All, _super); + function $All(params, owneryQuery, options, name) { + var _this = _super.call(this, params, owneryQuery, options, params.map(function (query) { return createQueryOperation(query, owneryQuery, options); }), name) || this; + _this.propop = true; + return _this; + } + $All.prototype.next = function (item, key, owner, root) { + this.childrenNext(item, key, owner, root); + }; + return $All; + }(NamedGroupOperation)); + var $eq = function (params, owneryQuery, options) { + return new EqualsOperation(params, owneryQuery, options); + }; + var $ne = function (params, owneryQuery, options, name) { return new $Ne(params, owneryQuery, options, name); }; + var $or = function (params, owneryQuery, options, name) { return new $Or(params, owneryQuery, options, name); }; + var $nor = function (params, owneryQuery, options, name) { return new $Nor(params, owneryQuery, options, name); }; + var $elemMatch = function (params, owneryQuery, options, name) { return new $ElemMatch(params, owneryQuery, options, name); }; + var $nin = function (params, owneryQuery, options, name) { return new $Nin(params, owneryQuery, options, name); }; + var $in = function (params, owneryQuery, options, name) { + return new $In(params, owneryQuery, options, name); + }; + var $lt = numericalOperation(function (params) { return function (b) { return b < params; }; }); + var $lte = numericalOperation(function (params) { return function (b) { return b <= params; }; }); + var $gt = numericalOperation(function (params) { return function (b) { return b > params; }; }); + var $gte = numericalOperation(function (params) { return function (b) { return b >= params; }; }); + var $mod = function (_a, owneryQuery, options) { + var mod = _a[0], equalsValue = _a[1]; + return new EqualsOperation(function (b) { return comparable(b) % mod === equalsValue; }, owneryQuery, options); + }; + var $exists = function (params, owneryQuery, options, name) { return new $Exists(params, owneryQuery, options, name); }; + var $regex = function (pattern, owneryQuery, options) { + return new EqualsOperation(new RegExp(pattern, owneryQuery.$options), owneryQuery, options); + }; + var $not = function (params, owneryQuery, options, name) { return new $Not(params, owneryQuery, options, name); }; + var typeAliases = { + number: function (v) { return typeof v === "number"; }, + string: function (v) { return typeof v === "string"; }, + bool: function (v) { return typeof v === "boolean"; }, + array: function (v) { return Array.isArray(v); }, + null: function (v) { return v === null; }, + timestamp: function (v) { return v instanceof Date; } + }; + var $type = function (clazz, owneryQuery, options) { + return new EqualsOperation(function (b) { + if (typeof clazz === "string") { + if (!typeAliases[clazz]) { + throw new Error("Type alias does not exist"); + } + return typeAliases[clazz](b); + } + return b != null ? b instanceof clazz || b.constructor === clazz : false; + }, owneryQuery, options); + }; + var $and = function (params, ownerQuery, options, name) { return new $And(params, ownerQuery, options, name); }; + var $all = function (params, ownerQuery, options, name) { return new $All(params, ownerQuery, options, name); }; + var $size = function (params, ownerQuery, options) { return new $Size(params, ownerQuery, options, "$size"); }; + var $options = function () { return null; }; + var $where = function (params, ownerQuery, options) { + var test; + if (isFunction(params)) { + test = params; + } + else { + throw new Error("In CSP mode, sift does not support strings in \"$where\" condition"); + } + return new EqualsOperation(function (b) { return test.bind(b)(b); }, ownerQuery, options); + }; + + var defaultOperations = /*#__PURE__*/Object.freeze({ + __proto__: null, + $Size: $Size, + $eq: $eq, + $ne: $ne, + $or: $or, + $nor: $nor, + $elemMatch: $elemMatch, + $nin: $nin, + $in: $in, + $lt: $lt, + $lte: $lte, + $gt: $gt, + $gte: $gte, + $mod: $mod, + $exists: $exists, + $regex: $regex, + $not: $not, + $type: $type, + $and: $and, + $all: $all, + $size: $size, + $options: $options, + $where: $where + }); + + var createDefaultQueryOperation = function (query, ownerQuery, _a) { + var _b = _a === void 0 ? {} : _a, compare = _b.compare, operations = _b.operations; + return createQueryOperation(query, ownerQuery, { + compare: compare, + operations: Object.assign({}, defaultOperations, operations || {}) + }); + }; + var createDefaultQueryTester = function (query, options) { + if (options === void 0) { options = {}; } + var op = createDefaultQueryOperation(query, null, options); + return createOperationTester(op); + }; + + exports.$Size = $Size; + exports.$all = $all; + exports.$and = $and; + exports.$elemMatch = $elemMatch; + exports.$eq = $eq; + exports.$exists = $exists; + exports.$gt = $gt; + exports.$gte = $gte; + exports.$in = $in; + exports.$lt = $lt; + exports.$lte = $lte; + exports.$mod = $mod; + exports.$ne = $ne; + exports.$nin = $nin; + exports.$nor = $nor; + exports.$not = $not; + exports.$options = $options; + exports.$or = $or; + exports.$regex = $regex; + exports.$size = $size; + exports.$type = $type; + exports.$where = $where; + exports.EqualsOperation = EqualsOperation; + exports.createDefaultQueryOperation = createDefaultQueryOperation; + exports.createEqualsOperation = createEqualsOperation; + exports.createOperationTester = createOperationTester; + exports.createQueryOperation = createQueryOperation; + exports.createQueryTester = createQueryTester; + exports.default = createDefaultQueryTester; + + Object.defineProperty(exports, '__esModule', { value: true }); + +}))); +//# sourceMappingURL=sift.csp.min.js.map diff --git a/node_modules/sift/sift.csp.min.js.map b/node_modules/sift/sift.csp.min.js.map new file mode 100644 index 000000000..38c22323b --- /dev/null +++ b/node_modules/sift/sift.csp.min.js.map @@ -0,0 +1 @@ +{"version":3,"file":"sift.csp.min.js","sources":["node_modules/tslib/tslib.es6.js","src/utils.ts","src/core.ts","src/operations.ts","src/index.ts"],"sourcesContent":["/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n}\r\n\r\nexport function __spreadArray(to, from) {\r\n for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)\r\n to[j] = from[i];\r\n return to;\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n}\r\n",null,null,null,null],"names":[],"mappings":";;;;;;IAAA;IACA;AACA;IACA;IACA;AACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;AACA;IACA,IAAI,aAAa,GAAG,SAAS,CAAC,EAAE,CAAC,EAA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IACL,EAAE;QAEI,wBAAwB,GAAG,UAC/B,KAAqB,EACrB,OAA8B;QAA9B,wBAAA,EAAA,YAA8B;QAE9B,IAAM,EAAE,GAAG,2BAA2B,CAAC,KAAK,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;QAC7D,OAAO,qBAAqB,CAAC,EAAE,CAAC,CAAC;IACnC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/node_modules/sift/sift.min.js b/node_modules/sift/sift.min.js new file mode 100644 index 000000000..5bfaa7042 --- /dev/null +++ b/node_modules/sift/sift.min.js @@ -0,0 +1,16 @@ +!function(n,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((n=n||self).sift={})}(this,(function(n){"use strict"; +/*! ***************************************************************************** + Copyright (c) Microsoft Corporation. + + Permission to use, copy, modify, and/or distribute this software for any + purpose with or without fee is hereby granted. + + THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH + REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, + INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM + LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + PERFORMANCE OF THIS SOFTWARE. + ***************************************************************************** */var t=function(n,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])})(n,r)};function r(n,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function i(){this.constructor=n}t(n,r),n.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}var i=function(n){var t="[object "+n+"]";return function(n){return u(n)===t}},u=function(n){return Object.prototype.toString.call(n)},e=function(n){return n instanceof Date?n.getTime():o(n)?n.map(e):n&&"function"==typeof n.toJSON?n.toJSON():n},o=i("Array"),f=i("Object"),s=i("Function"),c=function(n,t){if(null==n&&n==t)return!0;if(n===t)return!0;if(Object.prototype.toString.call(n)!==Object.prototype.toString.call(t))return!1;if(o(n)){if(n.length!==t.length)return!1;for(var r=0,i=n.length;rn}})),V=d((function(n){return function(t){return t>=n}})),W=function(n,t,r){var i=n[0],u=n[1];return new y((function(n){return e(n)%i===u}),t,r)},X=function(n,t,r,i){return new D(n,t,r,i)},Y=function(n,t,r){return new y(new RegExp(n,t.$options),t,r)},Z=function(n,t,r,i){return new q(n,t,r,i)},nn={number:function(n){return"number"==typeof n},string:function(n){return"string"==typeof n},bool:function(n){return"boolean"==typeof n},array:function(n){return Array.isArray(n)},null:function(n){return null===n},timestamp:function(n){return n instanceof Date}},tn=function(n,t,r){return new y((function(t){if("string"==typeof n){if(!nn[n])throw new Error("Type alias does not exist");return nn[n](t)}return null!=t&&(t instanceof n||t.constructor===n)}),t,r)},rn=function(n,t,r,i){return new P(n,t,r,i)},un=function(n,t,r,i){return new R(n,t,r,i)},en=function(n,t,r){return new k(n,t,r,"$size")},on=function(){return null},fn=function(n,t,r){var i;if(s(n))i=n;else{if(process.env.CSP_ENABLED)throw new Error('In CSP mode, sift does not support strings in "$where" condition');i=new Function("obj","return "+n)}return new y((function(n){return i.bind(n)(n)}),t,r)},sn=Object.freeze({__proto__:null,$Size:k,$eq:T,$ne:I,$or:U,$nor:B,$elemMatch:G,$nin:H,$in:J,$lt:K,$lte:L,$gt:Q,$gte:V,$mod:W,$exists:X,$regex:Y,$not:Z,$type:tn,$and:rn,$all:un,$size:en,$options:on,$where:fn}),cn=function(n,t,r){var i=void 0===r?{}:r,u=i.compare,e=i.operations;return E(n,t,{compare:u,operations:Object.assign({},sn,e||{})})};n.$Size=k,n.$all=un,n.$and=rn,n.$elemMatch=G,n.$eq=T,n.$exists=X,n.$gt=Q,n.$gte=V,n.$in=J,n.$lt=K,n.$lte=L,n.$mod=W,n.$ne=I,n.$nin=H,n.$nor=B,n.$not=Z,n.$options=on,n.$or=U,n.$regex=Y,n.$size=en,n.$type=tn,n.$where=fn,n.EqualsOperation=y,n.createDefaultQueryOperation=cn,n.createEqualsOperation=function(n,t,r){return new y(n,t,r)},n.createOperationTester=_,n.createQueryOperation=E,n.createQueryTester=function(n,t){return void 0===t&&(t={}),_(E(n,null,t))},n.default=function(n,t){void 0===t&&(t={});var r=cn(n,null,t);return _(r)},Object.defineProperty(n,"v",{value:!0})})); +//# sourceMappingURL=sift.min.js.map diff --git a/node_modules/sift/sift.min.js.map b/node_modules/sift/sift.min.js.map new file mode 100644 index 000000000..e83ea06d4 --- /dev/null +++ b/node_modules/sift/sift.min.js.map @@ -0,0 +1 @@ +{"version":3,"file":"sift.min.js","sources":["node_modules/tslib/tslib.es6.js","src/utils.ts","src/core.ts","src/operations.ts","src/index.ts"],"sourcesContent":["/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n}\r\n\r\nexport function __spreadArray(to, from) {\r\n for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)\r\n to[j] = from[i];\r\n return to;\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n}\r\n",null,null,null,null],"names":["extendStatics","d","b","Object","setPrototypeOf","__proto__","Array","p","prototype","hasOwnProperty","call","__extends","TypeError","String","__","this","constructor","create","typeChecker","type","typeString","value","getClassName","toString","comparable","Date","getTime","isArray","map","toJSON","isObject","isFunction","equals","a","length","i","length_1","keys","key","walkKeyPathValues","item","keyPath","next","depth","owner","currentKey","isNaN","Number","params","owneryQuery","options","name","init","BaseOperation","done","keep","children","_super","_this","GroupOperation","length_2","reset","root","length_3","childOperation","QueryOperation","parent","childrenNext","NestedOperation","_nextNestedValue","createTester","compare","Function","RegExp","result","test","lastIndex","comparableA","EqualsOperation","_test","NopeOperation","numericalOperation","createNumericalOperation","typeofParams","createNamedOperation","parentQuery","operationCreator","operations","throwUnsupportedOperation","Error","containsOperation","query","charAt","createNestedOperation","nestedQuery","parentKey","_a","createQueryOperations","selfOperations","createQueryOperation","_b","assign","_c","nestedOperations","ops","push","op","propop","split","createOperationTester","operation","$Ne","$ElemMatch","_queryOperation","child","$Not","$Size","assertGroupNotEmpty","values","$Or","_ops","success","$Nor","$In","_testers","toLowerCase","length_4","ownerQuery","_in","$Nin","$Exists","$And","NamedGroupOperation","$All","$eq","$ne","$or","$nor","$elemMatch","$nin","$in","$lt","$lte","$gt","$gte","$mod","mod","equalsValue","$exists","$regex","pattern","$options","$not","typeAliases","number","v","string","bool","array","null","timestamp","$type","clazz","$and","$all","$size","$where","process","env","CSP_ENABLED","bind","createDefaultQueryOperation","defaultOperations"],"mappings":";;;;;;;;;;;;;;oFAgBA,IAAIA,EAAgB,SAASC,EAAGC,GAI5B,OAHAF,EAAgBG,OAAOC,gBAClB,CAAEC,UAAW,cAAgBC,OAAS,SAAUL,EAAGC,GAAKD,EAAEI,UAAYH,IACvE,SAAUD,EAAGC,GAAK,IAAK,IAAIK,KAAKL,EAAOC,OAAOK,UAAUC,eAAeC,KAAKR,EAAGK,KAAIN,EAAEM,GAAK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diff --git a/node_modules/sift/src/core.d.ts b/node_modules/sift/src/core.d.ts new file mode 100644 index 000000000..330c04b3a --- /dev/null +++ b/node_modules/sift/src/core.d.ts @@ -0,0 +1,123 @@ +import { Key, Comparator } from "./utils"; +export interface Operation { + readonly keep: boolean; + readonly done: boolean; + propop: boolean; + reset(): any; + next(item: TItem, key?: Key, owner?: any): any; +} +export declare type Tester = (item: any, key?: Key, owner?: any) => boolean; +export interface NamedOperation { + name: string; +} +export declare type OperationCreator = (params: any, parentQuery: any, options: Options, name: string) => Operation; +declare type BasicValueQuery = { + $eq?: TValue; + $ne?: TValue; + $lt?: TValue; + $gt?: TValue; + $lte?: TValue; + $gte?: TValue; + $in?: TValue[]; + $nin?: TValue[]; + $all?: TValue[]; + $mod?: [number, number]; + $exists?: boolean; + $regex?: string | RegExp; + $size?: number; + $where?: ((this: TValue, obj: TValue) => boolean) | string; + $options?: "i" | "g" | "m" | "u"; + $type?: Function; + $not?: NestedQuery; + $or?: NestedQuery[]; + $nor?: NestedQuery[]; + $and?: NestedQuery[]; +}; +declare type ArrayValueQuery = { + $elemMatch?: Query; +} & BasicValueQuery; +declare type Unpacked = T extends (infer U)[] ? U : T; +declare type ValueQuery = TValue extends Array ? ArrayValueQuery> : BasicValueQuery; +declare type NotObject = string | number | Date | boolean | Array; +declare type ShapeQuery = TItemSchema extends NotObject ? {} : { + [k in keyof TItemSchema]?: TItemSchema[k] | ValueQuery; +}; +declare type NestedQuery = ValueQuery & ShapeQuery; +export declare type Query = TItemSchema | RegExp | NestedQuery; +declare abstract class BaseOperation implements Operation { + readonly params: TParams; + readonly owneryQuery: any; + readonly options: Options; + keep: boolean; + done: boolean; + abstract propop: boolean; + constructor(params: TParams, owneryQuery: any, options: Options); + protected init(): void; + reset(): void; + abstract next(item: any, key: Key, parent: any): any; +} +export declare abstract class NamedBaseOperation extends BaseOperation implements NamedOperation { + readonly name: string; + abstract propop: boolean; + constructor(params: TParams, owneryQuery: any, options: Options, name: string); +} +declare abstract class GroupOperation extends BaseOperation { + readonly children: Operation[]; + keep: boolean; + done: boolean; + constructor(params: any, owneryQuery: any, options: Options, children: Operation[]); + /** + */ + reset(): void; + abstract next(item: any, key: Key, owner: any): any; + /** + */ + protected childrenNext(item: any, key: Key, owner: any): void; +} +export declare abstract class NamedGroupOperation extends GroupOperation implements NamedOperation { + readonly name: string; + abstract propop: boolean; + constructor(params: any, owneryQuery: any, options: Options, children: Operation[], name: string); +} +export declare class QueryOperation extends GroupOperation { + readonly propop = true; + /** + */ + next(item: TItem, key: Key, parent: any): void; +} +export declare class NestedOperation extends GroupOperation { + readonly keyPath: Key[]; + readonly propop = true; + constructor(keyPath: Key[], params: any, owneryQuery: any, options: Options, children: Operation[]); + /** + */ + next(item: any, key: Key, parent: any): void; + /** + */ + private _nextNestedValue; +} +export declare const createTester: (a: any, compare: Comparator) => any; +export declare class EqualsOperation extends BaseOperation { + readonly propop = true; + private _test; + init(): void; + next(item: any, key: Key, parent: any): void; +} +export declare const createEqualsOperation: (params: any, owneryQuery: any, options: Options) => EqualsOperation; +export declare class NopeOperation extends BaseOperation { + readonly propop = true; + next(): void; +} +export declare const numericalOperationCreator: (createNumericalOperation: OperationCreator) => (params: any, owneryQuery: any, options: Options, name: string) => Operation; +export declare const numericalOperation: (createTester: (any: any) => Tester) => (params: any, owneryQuery: any, options: Options, name: string) => Operation; +export declare type Options = { + operations: { + [identifier: string]: OperationCreator; + }; + compare: (a: any, b: any) => boolean; +}; +export declare const containsOperation: (query: any, options: Options) => boolean; +export declare const createQueryOperation: (query: Query, owneryQuery?: any, { compare, operations }?: Partial) => QueryOperation; +export declare const createOperationTester: (operation: Operation) => (item: TItem, key?: Key, owner?: any) => boolean; +export declare const createQueryTester: (query: Query, options?: Partial) => (item: TItem, key?: Key, owner?: any) => boolean; +export {}; diff --git a/node_modules/sift/src/core.js b/node_modules/sift/src/core.js new file mode 100644 index 000000000..5a0a28f31 --- /dev/null +++ b/node_modules/sift/src/core.js @@ -0,0 +1,270 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.createQueryTester = exports.createOperationTester = exports.createQueryOperation = exports.containsOperation = exports.numericalOperation = exports.numericalOperationCreator = exports.NopeOperation = exports.createEqualsOperation = exports.EqualsOperation = exports.createTester = exports.NestedOperation = exports.QueryOperation = exports.NamedGroupOperation = exports.NamedBaseOperation = void 0; +const utils_1 = require("./utils"); +/** + * Walks through each value given the context - used for nested operations. E.g: + * { "person.address": { $eq: "blarg" }} + */ +const walkKeyPathValues = (item, keyPath, next, depth, key, owner) => { + const currentKey = keyPath[depth]; + // if array, then try matching. Might fall through for cases like: + // { $eq: [1, 2, 3] }, [ 1, 2, 3 ]. + if (utils_1.isArray(item) && isNaN(Number(currentKey))) { + for (let i = 0, { length } = item; i < length; i++) { + // if FALSE is returned, then terminate walker. For operations, this simply + // means that the search critera was met. + if (!walkKeyPathValues(item[i], keyPath, next, depth, i, item)) { + return false; + } + } + } + if (depth === keyPath.length || item == null) { + return next(item, key, owner); + } + return walkKeyPathValues(item[currentKey], keyPath, next, depth + 1, currentKey, item); +}; +class BaseOperation { + constructor(params, owneryQuery, options) { + this.params = params; + this.owneryQuery = owneryQuery; + this.options = options; + this.init(); + } + init() { } + reset() { + this.done = false; + this.keep = false; + } +} +class NamedBaseOperation extends BaseOperation { + constructor(params, owneryQuery, options, name) { + super(params, owneryQuery, options); + this.name = name; + } +} +exports.NamedBaseOperation = NamedBaseOperation; +class GroupOperation extends BaseOperation { + constructor(params, owneryQuery, options, children) { + super(params, owneryQuery, options); + this.children = children; + } + /** + */ + reset() { + this.keep = false; + this.done = false; + for (let i = 0, { length } = this.children; i < length; i++) { + this.children[i].reset(); + } + } + /** + */ + childrenNext(item, key, owner) { + let done = true; + let keep = true; + for (let i = 0, { length } = this.children; i < length; i++) { + const childOperation = this.children[i]; + childOperation.next(item, key, owner); + if (!childOperation.keep) { + keep = false; + } + if (childOperation.done) { + if (!childOperation.keep) { + break; + } + } + else { + done = false; + } + } + this.done = done; + this.keep = keep; + } +} +class NamedGroupOperation extends GroupOperation { + constructor(params, owneryQuery, options, children, name) { + super(params, owneryQuery, options, children); + this.name = name; + } +} +exports.NamedGroupOperation = NamedGroupOperation; +class QueryOperation extends GroupOperation { + constructor() { + super(...arguments); + this.propop = true; + } + /** + */ + next(item, key, parent) { + this.childrenNext(item, key, parent); + } +} +exports.QueryOperation = QueryOperation; +class NestedOperation extends GroupOperation { + constructor(keyPath, params, owneryQuery, options, children) { + super(params, owneryQuery, options, children); + this.keyPath = keyPath; + this.propop = true; + /** + */ + this._nextNestedValue = (value, key, owner) => { + this.childrenNext(value, key, owner); + return !this.done; + }; + } + /** + */ + next(item, key, parent) { + walkKeyPathValues(item, this.keyPath, this._nextNestedValue, 0, key, parent); + } +} +exports.NestedOperation = NestedOperation; +const createTester = (a, compare) => { + if (a instanceof Function) { + return a; + } + if (a instanceof RegExp) { + return b => { + const result = typeof b === "string" && a.test(b); + a.lastIndex = 0; + return result; + }; + } + const comparableA = utils_1.comparable(a); + return b => compare(comparableA, utils_1.comparable(b)); +}; +exports.createTester = createTester; +class EqualsOperation extends BaseOperation { + constructor() { + super(...arguments); + this.propop = true; + } + init() { + this._test = exports.createTester(this.params, this.options.compare); + } + next(item, key, parent) { + if (!Array.isArray(parent) || parent.hasOwnProperty(key)) { + if (this._test(item, key, parent)) { + this.done = true; + this.keep = true; + } + } + } +} +exports.EqualsOperation = EqualsOperation; +const createEqualsOperation = (params, owneryQuery, options) => new EqualsOperation(params, owneryQuery, options); +exports.createEqualsOperation = createEqualsOperation; +class NopeOperation extends BaseOperation { + constructor() { + super(...arguments); + this.propop = true; + } + next() { + this.done = true; + this.keep = false; + } +} +exports.NopeOperation = NopeOperation; +const numericalOperationCreator = (createNumericalOperation) => (params, owneryQuery, options, name) => { + if (params == null) { + return new NopeOperation(params, owneryQuery, options); + } + return createNumericalOperation(params, owneryQuery, options, name); +}; +exports.numericalOperationCreator = numericalOperationCreator; +const numericalOperation = (createTester) => exports.numericalOperationCreator((params, owneryQuery, options) => { + const typeofParams = typeof utils_1.comparable(params); + const test = createTester(params); + return new EqualsOperation(b => { + return typeof utils_1.comparable(b) === typeofParams && test(b); + }, owneryQuery, options); +}); +exports.numericalOperation = numericalOperation; +const createNamedOperation = (name, params, parentQuery, options) => { + const operationCreator = options.operations[name]; + if (!operationCreator) { + throwUnsupportedOperation(name); + } + return operationCreator(params, parentQuery, options, name); +}; +const throwUnsupportedOperation = (name) => { + throw new Error(`Unsupported operation: ${name}`); +}; +const containsOperation = (query, options) => { + for (const key in query) { + if (options.operations.hasOwnProperty(key) || key.charAt(0) === "$") + return true; + } + return false; +}; +exports.containsOperation = containsOperation; +const createNestedOperation = (keyPath, nestedQuery, parentKey, owneryQuery, options) => { + if (exports.containsOperation(nestedQuery, options)) { + const [selfOperations, nestedOperations] = createQueryOperations(nestedQuery, parentKey, options); + if (nestedOperations.length) { + throw new Error(`Property queries must contain only operations, or exact objects.`); + } + return new NestedOperation(keyPath, nestedQuery, owneryQuery, options, selfOperations); + } + return new NestedOperation(keyPath, nestedQuery, owneryQuery, options, [ + new EqualsOperation(nestedQuery, owneryQuery, options) + ]); +}; +const createQueryOperation = (query, owneryQuery = null, { compare, operations } = {}) => { + const options = { + compare: compare || utils_1.equals, + operations: Object.assign({}, operations || {}) + }; + const [selfOperations, nestedOperations] = createQueryOperations(query, null, options); + const ops = []; + if (selfOperations.length) { + ops.push(new NestedOperation([], query, owneryQuery, options, selfOperations)); + } + ops.push(...nestedOperations); + if (ops.length === 1) { + return ops[0]; + } + return new QueryOperation(query, owneryQuery, options, ops); +}; +exports.createQueryOperation = createQueryOperation; +const createQueryOperations = (query, parentKey, options) => { + const selfOperations = []; + const nestedOperations = []; + if (!utils_1.isVanillaObject(query)) { + selfOperations.push(new EqualsOperation(query, query, options)); + return [selfOperations, nestedOperations]; + } + for (const key in query) { + if (options.operations.hasOwnProperty(key)) { + const op = createNamedOperation(key, query[key], query, options); + if (op) { + if (!op.propop && parentKey && !options.operations[parentKey]) { + throw new Error(`Malformed query. ${key} cannot be matched against property.`); + } + } + // probably just a flag for another operation (like $options) + if (op != null) { + selfOperations.push(op); + } + } + else if (key.charAt(0) === "$") { + throwUnsupportedOperation(key); + } + else { + nestedOperations.push(createNestedOperation(key.split("."), query[key], key, query, options)); + } + } + return [selfOperations, nestedOperations]; +}; +const createOperationTester = (operation) => (item, key, owner) => { + operation.reset(); + operation.next(item, key, owner); + return operation.keep; +}; +exports.createOperationTester = createOperationTester; +const createQueryTester = (query, options = {}) => { + return exports.createOperationTester(exports.createQueryOperation(query, null, options)); +}; +exports.createQueryTester = createQueryTester; +//# sourceMappingURL=core.js.map \ No newline at end of file diff --git a/node_modules/sift/src/core.js.map b/node_modules/sift/src/core.js.map new file mode 100644 index 000000000..42d5429a5 --- /dev/null +++ b/node_modules/sift/src/core.js.map @@ -0,0 +1 @@ +{"version":3,"file":"core.js","sourceRoot":"","sources":["core.ts"],"names":[],"mappings":";;;AAAA,mCAOiB;AAmEjB;;;GAGG;AAEH,MAAM,iBAAiB,GAAG,CACxB,IAAS,EACT,OAAc,EACd,IAAY,EACZ,KAAa,EACb,GAAQ,EACR,KAAU,EACV,EAAE;IACF,MAAM,UAAU,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC;IAElC,kEAAkE;IAClE,mCAAmC;IACnC,IAAI,eAAO,CAAC,IAAI,CAAC,IAAI,KAAK,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,EAAE;QAC9C,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,CAAC,GAAG,MAAM,EAAE,CAAC,EAAE,EAAE;YAClD,2EAA2E;YAC3E,yCAAyC;YACzC,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,EAAE,IAAI,CAAC,EAAE;gBAC9D,OAAO,KAAK,CAAC;aACd;SACF;KACF;IAED,IAAI,KA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CAAC;iBACH;aACF;YAED,6DAA6D;YAC7D,IAAI,EAAE,IAAI,IAAI,EAAE;gBACd,cAAc,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;aACzB;SACF;aAAM,IAAI,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,GAAG,EAAE;YAChC,yBAAyB,CAAC,GAAG,CAAC,CAAC;SAChC;aAAM;YACL,gBAAgB,CAAC,IAAI,CACnB,qBAAqB,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,EAAE,GAAG,EAAE,KAAK,EAAE,OAAO,CAAC,CACvE,CAAC;SACH;KACF;IAED,OAAO,CAAC,cAAc,EAAE,gBAAgB,CAAC,CAAC;AAC5C,CAAC,CAAC;AAEK,MAAM,qBAAqB,GAAG,CAAQ,SAA2B,EAAE,EAAE,CAAC,CAC3E,IAAW,EACX,GAAS,EACT,KAAW,EACX,EAAE;IACF,SAAS,CAAC,KAAK,EAAE,CAAC;IAClB,SAAS,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC;IACjC,OAAO,SAAS,CAAC,IAAI,CAAC;AACxB,CAAC,CAAC;AARW,QAAA,qBAAqB,yBAQhC;AAEK,MAAM,iBAAiB,GAAG,CAC/B,KAAqB,EACrB,UAA4B,EAAE,EAC9B,EAAE;IACF,OAAO,6BAAqB,CAC1B,4BAAoB,CAAiB,KAAK,EAAE,IAAI,EAAE,OAAO,CAAC,CAC3D,CAAC;AACJ,CAAC,CAAC;AAPW,QAAA,iBAAiB,qBAO5B"} \ No newline at end of file diff --git a/node_modules/sift/src/core.ts b/node_modules/sift/src/core.ts new file mode 100644 index 000000000..25c61f2eb --- /dev/null +++ b/node_modules/sift/src/core.ts @@ -0,0 +1,479 @@ +import { + isArray, + Key, + Comparator, + isVanillaObject, + comparable, + equals +} from "./utils"; + +export interface Operation { + readonly keep: boolean; + readonly done: boolean; + propop: boolean; + reset(); + next(item: TItem, key?: Key, owner?: any, root?: boolean); +} + +export type Tester = ( + item: any, + key?: Key, + owner?: any, + root?: boolean +) => boolean; + +export interface NamedOperation { + name: string; +} + +export type OperationCreator = ( + params: any, + parentQuery: any, + options: Options, + name: string +) => Operation; + +type BasicValueQuery = { + $eq?: TValue; + $ne?: TValue; + $lt?: TValue; + $gt?: TValue; + $lte?: TValue; + $gte?: TValue; + $in?: TValue[]; + $nin?: TValue[]; + $all?: TValue[]; + $mod?: [number, number]; + $exists?: boolean; + $regex?: string | RegExp; + $size?: number; + $where?: ((this: TValue, obj: TValue) => boolean) | string; + $options?: "i" | "g" | "m" | "u"; + $type?: Function; + $not?: NestedQuery; + $or?: NestedQuery[]; + $nor?: NestedQuery[]; + $and?: NestedQuery[]; +}; + +type ArrayValueQuery = { + $elemMatch?: Query; +} & BasicValueQuery; +type Unpacked = T extends (infer U)[] ? U : T; + +type ValueQuery = TValue extends Array + ? ArrayValueQuery> + : BasicValueQuery; + +type NotObject = string | number | Date | boolean | Array; +type ShapeQuery = TItemSchema extends NotObject + ? {} + : { [k in keyof TItemSchema]?: TItemSchema[k] | ValueQuery }; + +type NestedQuery = ValueQuery & + ShapeQuery; +export type Query = + | TItemSchema + | RegExp + | NestedQuery; + +/** + * Walks through each value given the context - used for nested operations. E.g: + * { "person.address": { $eq: "blarg" }} + */ + +const walkKeyPathValues = ( + item: any, + keyPath: Key[], + next: Tester, + depth: number, + key: Key, + owner: any +) => { + const currentKey = keyPath[depth]; + + // if array, then try matching. Might fall through for cases like: + // { $eq: [1, 2, 3] }, [ 1, 2, 3 ]. + if (isArray(item) && isNaN(Number(currentKey))) { + for (let i = 0, { length } = item; i < length; i++) { + // if FALSE is returned, then terminate walker. For operations, this simply + // means that the search critera was met. + if (!walkKeyPathValues(item[i], keyPath, next, depth, i, item)) { + return false; + } + } + } + + if (depth === keyPath.length || item == null) { + return next(item, key, owner, depth === 0); + } + + return walkKeyPathValues( + item[currentKey], + keyPath, + next, + depth + 1, + currentKey, + item + ); +}; + +export abstract class BaseOperation + implements Operation { + keep: boolean; + done: boolean; + abstract propop: boolean; + constructor( + readonly params: TParams, + readonly owneryQuery: any, + readonly options: Options, + readonly name?: string + ) { + this.init(); + } + protected init() {} + reset() { + this.done = false; + this.keep = false; + } + abstract next(item: any, key: Key, parent: any, root: boolean); +} + +abstract class GroupOperation extends BaseOperation { + keep: boolean; + done: boolean; + + constructor( + params: any, + owneryQuery: any, + options: Options, + public readonly children: Operation[] + ) { + super(params, owneryQuery, options); + } + + /** + */ + + reset() { + this.keep = false; + this.done = false; + for (let i = 0, { length } = this.children; i < length; i++) { + this.children[i].reset(); + } + } + + abstract next(item: any, key: Key, owner: any, root: boolean); + + /** + */ + + protected childrenNext(item: any, key: Key, owner: any, root: boolean) { + let done = true; + let keep = true; + for (let i = 0, { length } = this.children; i < length; i++) { + const childOperation = this.children[i]; + if (!childOperation.done) { + childOperation.next(item, key, owner, root); + } + if (!childOperation.keep) { + keep = false; + } + if (childOperation.done) { + if (!childOperation.keep) { + break; + } + } else { + done = false; + } + } + this.done = done; + this.keep = keep; + } +} + +export abstract class NamedGroupOperation extends GroupOperation + implements NamedOperation { + abstract propop: boolean; + constructor( + params: any, + owneryQuery: any, + options: Options, + children: Operation[], + readonly name: string + ) { + super(params, owneryQuery, options, children); + } +} + +export class QueryOperation extends GroupOperation { + readonly propop = true; + /** + */ + + next(item: TItem, key: Key, parent: any, root: boolean) { + this.childrenNext(item, key, parent, root); + } +} + +export class NestedOperation extends GroupOperation { + readonly propop = true; + constructor( + readonly keyPath: Key[], + params: any, + owneryQuery: any, + options: Options, + children: Operation[] + ) { + super(params, owneryQuery, options, children); + } + /** + */ + + next(item: any, key: Key, parent: any) { + walkKeyPathValues( + item, + this.keyPath, + this._nextNestedValue, + 0, + key, + parent + ); + } + + /** + */ + + private _nextNestedValue = ( + value: any, + key: Key, + owner: any, + root: boolean + ) => { + this.childrenNext(value, key, owner, root); + return !this.done; + }; +} + +export const createTester = (a, compare: Comparator) => { + if (a instanceof Function) { + return a; + } + if (a instanceof RegExp) { + return b => { + const result = typeof b === "string" && a.test(b); + a.lastIndex = 0; + return result; + }; + } + const comparableA = comparable(a); + return b => compare(comparableA, comparable(b)); +}; + +export class EqualsOperation extends BaseOperation { + readonly propop = true; + private _test: Tester; + init() { + this._test = createTester(this.params, this.options.compare); + } + next(item, key: Key, parent: any) { + if (!Array.isArray(parent) || parent.hasOwnProperty(key)) { + if (this._test(item, key, parent)) { + this.done = true; + this.keep = true; + } + } + } +} + +export const createEqualsOperation = ( + params: any, + owneryQuery: any, + options: Options +) => new EqualsOperation(params, owneryQuery, options); + +export class NopeOperation extends BaseOperation { + readonly propop = true; + next() { + this.done = true; + this.keep = false; + } +} + +export const numericalOperationCreator = ( + createNumericalOperation: OperationCreator +) => (params: any, owneryQuery: any, options: Options, name: string) => { + if (params == null) { + return new NopeOperation(params, owneryQuery, options, name); + } + + return createNumericalOperation(params, owneryQuery, options, name); +}; + +export const numericalOperation = (createTester: (any) => Tester) => + numericalOperationCreator( + (params: any, owneryQuery: Query, options: Options, name: string) => { + const typeofParams = typeof comparable(params); + const test = createTester(params); + return new EqualsOperation( + b => { + return typeof comparable(b) === typeofParams && test(b); + }, + owneryQuery, + options, + name + ); + } + ); + +export type Options = { + operations: { + [identifier: string]: OperationCreator; + }; + compare: (a, b) => boolean; +}; + +const createNamedOperation = ( + name: string, + params: any, + parentQuery: any, + options: Options +) => { + const operationCreator = options.operations[name]; + if (!operationCreator) { + throwUnsupportedOperation(name); + } + return operationCreator(params, parentQuery, options, name); +}; + +const throwUnsupportedOperation = (name: string) => { + throw new Error(`Unsupported operation: ${name}`); +}; + +export const containsOperation = (query: any, options: Options) => { + for (const key in query) { + if (options.operations.hasOwnProperty(key) || key.charAt(0) === "$") + return true; + } + return false; +}; +const createNestedOperation = ( + keyPath: Key[], + nestedQuery: any, + parentKey: string, + owneryQuery: any, + options: Options +) => { + if (containsOperation(nestedQuery, options)) { + const [selfOperations, nestedOperations] = createQueryOperations( + nestedQuery, + parentKey, + options + ); + if (nestedOperations.length) { + throw new Error( + `Property queries must contain only operations, or exact objects.` + ); + } + return new NestedOperation( + keyPath, + nestedQuery, + owneryQuery, + options, + selfOperations + ); + } + return new NestedOperation(keyPath, nestedQuery, owneryQuery, options, [ + new EqualsOperation(nestedQuery, owneryQuery, options) + ]); +}; + +export const createQueryOperation = ( + query: Query, + owneryQuery: any = null, + { compare, operations }: Partial = {} +): QueryOperation => { + const options = { + compare: compare || equals, + operations: Object.assign({}, operations || {}) + }; + + const [selfOperations, nestedOperations] = createQueryOperations( + query, + null, + options + ); + + const ops = []; + + if (selfOperations.length) { + ops.push( + new NestedOperation([], query, owneryQuery, options, selfOperations) + ); + } + + ops.push(...nestedOperations); + + if (ops.length === 1) { + return ops[0]; + } + return new QueryOperation(query, owneryQuery, options, ops); +}; + +const createQueryOperations = ( + query: any, + parentKey: string, + options: Options +) => { + const selfOperations = []; + const nestedOperations = []; + if (!isVanillaObject(query)) { + selfOperations.push(new EqualsOperation(query, query, options)); + return [selfOperations, nestedOperations]; + } + for (const key in query) { + if (options.operations.hasOwnProperty(key)) { + const op = createNamedOperation(key, query[key], query, options); + + if (op) { + if (!op.propop && parentKey && !options.operations[parentKey]) { + throw new Error( + `Malformed query. ${key} cannot be matched against property.` + ); + } + } + + // probably just a flag for another operation (like $options) + if (op != null) { + selfOperations.push(op); + } + } else if (key.charAt(0) === "$") { + throwUnsupportedOperation(key); + } else { + nestedOperations.push( + createNestedOperation(key.split("."), query[key], key, query, options) + ); + } + } + + return [selfOperations, nestedOperations]; +}; + +export const createOperationTester = (operation: Operation) => ( + item: TItem, + key?: Key, + owner?: any +) => { + operation.reset(); + operation.next(item, key, owner); + return operation.keep; +}; + +export const createQueryTester = ( + query: Query, + options: Partial = {} +) => { + return createOperationTester( + createQueryOperation(query, null, options) + ); +}; diff --git a/node_modules/sift/src/index.d.ts b/node_modules/sift/src/index.d.ts new file mode 100644 index 000000000..66fc25b1c --- /dev/null +++ b/node_modules/sift/src/index.d.ts @@ -0,0 +1,6 @@ +import { Query, Options, createQueryTester, EqualsOperation, createQueryOperation, createEqualsOperation, createOperationTester } from "./core"; +declare const createDefaultQueryOperation: (query: Query, ownerQuery: any, { compare, operations }?: Partial) => import("./core").QueryOperation; +declare const createDefaultQueryTester: (query: Query, options?: Partial) => (item: unknown, key?: import("./utils").Key, owner?: any) => boolean; +export { Query, EqualsOperation, createQueryTester, createOperationTester, createDefaultQueryOperation, createEqualsOperation, createQueryOperation }; +export * from "./operations"; +export default createDefaultQueryTester; diff --git a/node_modules/sift/src/index.js b/node_modules/sift/src/index.js new file mode 100644 index 000000000..2468a1922 --- /dev/null +++ b/node_modules/sift/src/index.js @@ -0,0 +1,35 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.createQueryOperation = exports.createEqualsOperation = exports.createDefaultQueryOperation = exports.createOperationTester = exports.createQueryTester = exports.EqualsOperation = void 0; +const defaultOperations = require("./operations"); +const core_1 = require("./core"); +Object.defineProperty(exports, "createQueryTester", { enumerable: true, get: function () { return core_1.createQueryTester; } }); +Object.defineProperty(exports, "EqualsOperation", { enumerable: true, get: function () { return core_1.EqualsOperation; } }); +Object.defineProperty(exports, "createQueryOperation", { enumerable: true, get: function () { return core_1.createQueryOperation; } }); +Object.defineProperty(exports, "createEqualsOperation", { enumerable: true, get: function () { return core_1.createEqualsOperation; } }); +Object.defineProperty(exports, "createOperationTester", { enumerable: true, get: function () { return core_1.createOperationTester; } }); +const createDefaultQueryOperation = (query, ownerQuery, { compare, operations } = {}) => { + return core_1.createQueryOperation(query, ownerQuery, { + compare, + operations: Object.assign({}, defaultOperations, operations || {}) + }); +}; +exports.createDefaultQueryOperation = createDefaultQueryOperation; +const createDefaultQueryTester = (query, options = {}) => { + console.log("Q", query); + const op = createDefaultQueryOperation(query, null, options); + return core_1.createOperationTester(op); +}; +__exportStar(require("./operations"), exports); +exports.default = createDefaultQueryTester; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/sift/src/index.js.map b/node_modules/sift/src/index.js.map new file mode 100644 index 000000000..51123b3e4 --- /dev/null +++ b/node_modules/sift/src/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,kDAAkD;AAClD,iCAQgB;AAyBd,kGA9BA,wBAAiB,OA8BA;AADjB,gGA5BA,sBAAe,OA4BA;AAKf,qGAhCA,2BAAoB,OAgCA;AADpB,sGA9BA,4BAAqB,OA8BA;AAFrB,sGA3BA,4BAAqB,OA2BA;AAxBvB,MAAM,2BAA2B,GAAG,CAClC,KAAqB,EACrB,UAAe,EACf,EAAE,OAAO,EAAE,UAAU,KAAuB,EAAE,EAC9C,EAAE;IACF,OAAO,2BAAoB,CAAC,KAAK,EAAE,UAAU,EAAE;QAC7C,OAAO;QACP,UAAU,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,iBAAiB,EAAE,UAAU,IAAI,EAAE,CAAC;KACnE,CAAC,CAAC;AACL,CAAC,CAAC;AAgBA,kEAA2B;AAd7B,MAAM,wBAAwB,GAAG,CAC/B,KAAqB,EACrB,UAA4B,EAAE,EAC9B,EAAE;IACF,OAAO,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;IACxB,MAAM,EAAE,GAAG,2BAA2B,CAAC,KAAK,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;IAC7D,OAAO,4BAAqB,CAAC,EAAE,CAAC,CAAC;AACnC,CAAC,CAAC;AAWF,+CAA6B;AAE7B,kBAAe,wBAAwB,CAAC"} \ No newline at end of file diff --git a/node_modules/sift/src/index.ts b/node_modules/sift/src/index.ts new file mode 100644 index 000000000..e577a17b8 --- /dev/null +++ b/node_modules/sift/src/index.ts @@ -0,0 +1,42 @@ +import * as defaultOperations from "./operations"; +import { + Query, + Options, + createQueryTester, + EqualsOperation, + createQueryOperation, + createEqualsOperation, + createOperationTester +} from "./core"; + +const createDefaultQueryOperation = ( + query: Query, + ownerQuery: any, + { compare, operations }: Partial = {} +) => { + return createQueryOperation(query, ownerQuery, { + compare, + operations: Object.assign({}, defaultOperations, operations || {}) + }); +}; + +const createDefaultQueryTester = ( + query: Query, + options: Partial = {} +) => { + const op = createDefaultQueryOperation(query, null, options); + return createOperationTester(op); +}; + +export { + Query, + EqualsOperation, + createQueryTester, + createOperationTester, + createDefaultQueryOperation, + createEqualsOperation, + createQueryOperation +}; +export * from "./operations"; + +export default createDefaultQueryTester; diff --git a/node_modules/sift/src/operations.d.ts b/node_modules/sift/src/operations.d.ts new file mode 100644 index 000000000..d16758095 --- /dev/null +++ b/node_modules/sift/src/operations.d.ts @@ -0,0 +1,85 @@ +import { NamedBaseOperation, EqualsOperation, Options, Operation, Query, NamedGroupOperation } from "./core"; +import { Key } from "./utils"; +declare class $Ne extends NamedBaseOperation { + readonly propop = true; + private _test; + init(): void; + reset(): void; + next(item: any): void; +} +declare class $ElemMatch extends NamedBaseOperation> { + readonly propop = true; + private _queryOperation; + init(): void; + reset(): void; + next(item: any): void; +} +declare class $Not extends NamedBaseOperation> { + readonly propop = true; + private _queryOperation; + init(): void; + reset(): void; + next(item: any, key: Key, owner: any): void; +} +export declare class $Size extends NamedBaseOperation { + readonly propop = true; + init(): void; + next(item: any): void; +} +declare class $Or extends NamedBaseOperation { + readonly propop = false; + private _ops; + init(): void; + reset(): void; + next(item: any, key: Key, owner: any): void; +} +declare class $Nor extends $Or { + readonly propop = false; + next(item: any, key: Key, owner: any): void; +} +declare class $In extends NamedBaseOperation { + readonly propop = true; + private _testers; + init(): void; + next(item: any, key: Key, owner: any): void; +} +declare class $Nin extends $In { + readonly propop = true; + next(item: any, key: Key, owner: any): void; +} +declare class $Exists extends NamedBaseOperation { + readonly propop = true; + next(item: any, key: Key, owner: any): void; +} +declare class $And extends NamedGroupOperation { + readonly propop = false; + constructor(params: Query[], owneryQuery: Query, options: Options, name: string); + next(item: any, key: Key, owner: any): void; +} +declare class $All extends NamedGroupOperation { + readonly propop = true; + constructor(params: Query[], owneryQuery: Query, options: Options, name: string); + next(item: any, key: Key, owner: any): void; +} +export declare const $eq: (params: any, owneryQuery: Query, options: Options) => EqualsOperation; +export declare const $ne: (params: any, owneryQuery: Query, options: Options, name: string) => $Ne; +export declare const $or: (params: Query[], owneryQuery: Query, options: Options, name: string) => $Or; +export declare const $nor: (params: Query[], owneryQuery: Query, options: Options, name: string) => $Nor; +export declare const $elemMatch: (params: any, owneryQuery: Query, options: Options, name: string) => $ElemMatch; +export declare const $nin: (params: any, owneryQuery: Query, options: Options, name: string) => $Nin; +export declare const $in: (params: any, owneryQuery: Query, options: Options, name: string) => $In; +export declare const $lt: (params: any, owneryQuery: any, options: Options, name: string) => Operation; +export declare const $lte: (params: any, owneryQuery: any, options: Options, name: string) => Operation; +export declare const $gt: (params: any, owneryQuery: any, options: Options, name: string) => Operation; +export declare const $gte: (params: any, owneryQuery: any, options: Options, name: string) => Operation; +export declare const $mod: ([mod, equalsValue]: number[], owneryQuery: Query, options: Options) => EqualsOperation<(b: any) => boolean>; +export declare const $exists: (params: boolean, owneryQuery: Query, options: Options, name: string) => $Exists; +export declare const $regex: (pattern: string, owneryQuery: Query, options: Options) => EqualsOperation; +export declare const $not: (params: any, owneryQuery: Query, options: Options, name: string) => $Not; +export declare const $type: (clazz: Function | string, owneryQuery: Query, options: Options) => EqualsOperation<(b: any) => any>; +export declare const $and: (params: Query[], ownerQuery: Query, options: Options, name: string) => $And; +export declare const $all: (params: Query[], ownerQuery: Query, options: Options, name: string) => $All; +export declare const $size: (params: number, ownerQuery: Query, options: Options) => $Size; +export declare const $options: () => any; +export declare const $where: (params: string | Function, ownerQuery: Query, options: Options) => EqualsOperation<(b: any) => any>; +export {}; diff --git a/node_modules/sift/src/operations.js b/node_modules/sift/src/operations.js new file mode 100644 index 000000000..967778243 --- /dev/null +++ b/node_modules/sift/src/operations.js @@ -0,0 +1,276 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.$where = exports.$options = exports.$size = exports.$all = exports.$and = exports.$type = exports.$not = exports.$regex = exports.$exists = exports.$mod = exports.$gte = exports.$gt = exports.$lte = exports.$lt = exports.$in = exports.$nin = exports.$elemMatch = exports.$nor = exports.$or = exports.$ne = exports.$eq = exports.$Size = void 0; +const core_1 = require("./core"); +const utils_1 = require("./utils"); +class $Ne extends core_1.NamedBaseOperation { + constructor() { + super(...arguments); + this.propop = true; + } + init() { + this._test = core_1.createTester(this.params, this.options.compare); + } + reset() { + super.reset(); + this.keep = true; + } + next(item) { + if (this._test(item)) { + this.done = true; + this.keep = false; + } + } +} +// https://docs.mongodb.com/manual/reference/operator/query/elemMatch/ +class $ElemMatch extends core_1.NamedBaseOperation { + constructor() { + super(...arguments); + this.propop = true; + } + init() { + if (!this.params || typeof this.params !== "object") { + throw new Error(`Malformed query. $elemMatch must by an object.`); + } + this._queryOperation = core_1.createQueryOperation(this.params, this.owneryQuery, this.options); + } + reset() { + super.reset(); + this._queryOperation.reset(); + } + next(item) { + if (utils_1.isArray(item)) { + for (let i = 0, { length } = item; i < length; i++) { + // reset query operation since item being tested needs to pass _all_ query + // operations for it to be a success + this._queryOperation.reset(); + const child = item[i]; + this._queryOperation.next(child, i, item); + this.keep = this.keep || this._queryOperation.keep; + } + this.done = true; + } + else { + this.done = false; + this.keep = false; + } + } +} +class $Not extends core_1.NamedBaseOperation { + constructor() { + super(...arguments); + this.propop = true; + } + init() { + this._queryOperation = core_1.createQueryOperation(this.params, this.owneryQuery, this.options); + } + reset() { + this._queryOperation.reset(); + } + next(item, key, owner) { + this._queryOperation.next(item, key, owner); + this.done = this._queryOperation.done; + this.keep = !this._queryOperation.keep; + } +} +class $Size extends core_1.NamedBaseOperation { + constructor() { + super(...arguments); + this.propop = true; + } + init() { } + next(item) { + if (utils_1.isArray(item) && item.length === this.params) { + this.done = true; + this.keep = true; + } + // if (parent && parent.length === this.params) { + // this.done = true; + // this.keep = true; + // } + } +} +exports.$Size = $Size; +const assertGroupNotEmpty = (values) => { + if (values.length === 0) { + throw new Error(`$and/$or/$nor must be a nonempty array`); + } +}; +class $Or extends core_1.NamedBaseOperation { + constructor() { + super(...arguments); + this.propop = false; + } + init() { + assertGroupNotEmpty(this.params); + this._ops = this.params.map(op => core_1.createQueryOperation(op, null, this.options)); + } + reset() { + this.done = false; + this.keep = false; + for (let i = 0, { length } = this._ops; i < length; i++) { + this._ops[i].reset(); + } + } + next(item, key, owner) { + let done = false; + let success = false; + for (let i = 0, { length } = this._ops; i < length; i++) { + const op = this._ops[i]; + op.next(item, key, owner); + if (op.keep) { + done = true; + success = op.keep; + break; + } + } + this.keep = success; + this.done = done; + } +} +class $Nor extends $Or { + constructor() { + super(...arguments); + this.propop = false; + } + next(item, key, owner) { + super.next(item, key, owner); + this.keep = !this.keep; + } +} +class $In extends core_1.NamedBaseOperation { + constructor() { + super(...arguments); + this.propop = true; + } + init() { + this._testers = this.params.map(value => { + if (core_1.containsOperation(value, this.options)) { + throw new Error(`cannot nest $ under ${this.constructor.name.toLowerCase()}`); + } + return core_1.createTester(value, this.options.compare); + }); + } + next(item, key, owner) { + let done = false; + let success = false; + for (let i = 0, { length } = this._testers; i < length; i++) { + const test = this._testers[i]; + if (test(item)) { + done = true; + success = true; + break; + } + } + this.keep = success; + this.done = done; + } +} +class $Nin extends $In { + constructor() { + super(...arguments); + this.propop = true; + } + next(item, key, owner) { + super.next(item, key, owner); + this.keep = !this.keep; + } +} +class $Exists extends core_1.NamedBaseOperation { + constructor() { + super(...arguments); + this.propop = true; + } + next(item, key, owner) { + if (owner.hasOwnProperty(key) === this.params) { + this.done = true; + this.keep = true; + } + } +} +class $And extends core_1.NamedGroupOperation { + constructor(params, owneryQuery, options, name) { + super(params, owneryQuery, options, params.map(query => core_1.createQueryOperation(query, owneryQuery, options)), name); + this.propop = false; + assertGroupNotEmpty(params); + } + next(item, key, owner) { + this.childrenNext(item, key, owner); + } +} +class $All extends core_1.NamedGroupOperation { + constructor(params, owneryQuery, options, name) { + super(params, owneryQuery, options, params.map(query => core_1.createQueryOperation(query, owneryQuery, options)), name); + this.propop = true; + } + next(item, key, owner) { + this.childrenNext(item, key, owner); + } +} +const $eq = (params, owneryQuery, options) => new core_1.EqualsOperation(params, owneryQuery, options); +exports.$eq = $eq; +const $ne = (params, owneryQuery, options, name) => new $Ne(params, owneryQuery, options, name); +exports.$ne = $ne; +const $or = (params, owneryQuery, options, name) => new $Or(params, owneryQuery, options, name); +exports.$or = $or; +const $nor = (params, owneryQuery, options, name) => new $Nor(params, owneryQuery, options, name); +exports.$nor = $nor; +const $elemMatch = (params, owneryQuery, options, name) => new $ElemMatch(params, owneryQuery, options, name); +exports.$elemMatch = $elemMatch; +const $nin = (params, owneryQuery, options, name) => new $Nin(params, owneryQuery, options, name); +exports.$nin = $nin; +const $in = (params, owneryQuery, options, name) => new $In(params, owneryQuery, options, name); +exports.$in = $in; +exports.$lt = core_1.numericalOperation(params => b => b < params); +exports.$lte = core_1.numericalOperation(params => b => b <= params); +exports.$gt = core_1.numericalOperation(params => b => b > params); +exports.$gte = core_1.numericalOperation(params => b => b >= params); +const $mod = ([mod, equalsValue], owneryQuery, options) => new core_1.EqualsOperation(b => utils_1.comparable(b) % mod === equalsValue, owneryQuery, options); +exports.$mod = $mod; +const $exists = (params, owneryQuery, options, name) => new $Exists(params, owneryQuery, options, name); +exports.$exists = $exists; +const $regex = (pattern, owneryQuery, options) => new core_1.EqualsOperation(new RegExp(pattern, owneryQuery.$options), owneryQuery, options); +exports.$regex = $regex; +const $not = (params, owneryQuery, options, name) => new $Not(params, owneryQuery, options, name); +exports.$not = $not; +const typeAliases = { + number: v => typeof v === "number", + string: v => typeof v === "string", + bool: v => typeof v === "boolean", + array: v => Array.isArray(v), + null: v => v === null, + timestamp: v => v instanceof Date +}; +const $type = (clazz, owneryQuery, options) => new core_1.EqualsOperation(b => { + if (typeof clazz === "string") { + if (!typeAliases[clazz]) { + throw new Error(`Type alias does not exist`); + } + return typeAliases[clazz](b); + } + return b != null ? b instanceof clazz || b.constructor === clazz : false; +}, owneryQuery, options); +exports.$type = $type; +const $and = (params, ownerQuery, options, name) => new $And(params, ownerQuery, options, name); +exports.$and = $and; +const $all = (params, ownerQuery, options, name) => new $All(params, ownerQuery, options, name); +exports.$all = $all; +const $size = (params, ownerQuery, options) => new $Size(params, ownerQuery, options, "$size"); +exports.$size = $size; +const $options = () => null; +exports.$options = $options; +const $where = (params, ownerQuery, options) => { + let test; + if (utils_1.isFunction(params)) { + test = params; + } + else if (!process.env.CSP_ENABLED) { + test = new Function("obj", "return " + params); + } + else { + throw new Error(`In CSP mode, sift does not support strings in "$where" condition`); + } + return new core_1.EqualsOperation(b => test.bind(b)(b), ownerQuery, options); +}; +exports.$where = $where; +//# sourceMappingURL=operations.js.map \ No newline at end of file diff --git a/node_modules/sift/src/operations.js.map b/node_modules/sift/src/operations.js.map new file mode 100644 index 000000000..ada5a9558 --- /dev/null +++ b/node_modules/sift/src/operations.js.map @@ -0,0 +1 @@ +{"version":3,"file":"operations.js","sourceRoot":"","sources":["operations.ts"],"names":[],"mappings":";;;AAAA,iCAcgB;AAChB,mCAA+D;AAE/D,MAAM,GAAI,SAAQ,yBAAuB;IAAzC;;QACW,WAAM,GAAG,IAAI,CAAC;IAezB,CAAC;IAbC,IAAI;QACF,IAAI,CAAC,KAAK,GAAG,mBAAY,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IAC/D,CAAC;IACD,KAAK;QACH,KAAK,CAAC,KAAK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AAO,CAAC,GAAG,CAAC,WAAW,EAAE;QACnC,IAAI,GAAG,IAAI,QAAQ,CAAC,KAAK,EAAE,SAAS,GAAG,MAAM,CAAC,CAAC;KAChD;SAAM;QACL,MAAM,IAAI,KAAK,CACb,kEAAkE,CACnE,CAAC;KACH;IAED,OAAO,IAAI,sBAAe,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,OAAO,CAAC,CAAC;AACxE,CAAC,CAAC;AAlBW,QAAA,MAAM,UAkBjB"} \ No newline at end of file diff --git a/node_modules/sift/src/operations.ts b/node_modules/sift/src/operations.ts new file mode 100644 index 000000000..83c5f5bdc --- /dev/null +++ b/node_modules/sift/src/operations.ts @@ -0,0 +1,411 @@ +import { + BaseOperation, + EqualsOperation, + Options, + createTester, + Tester, + createQueryOperation, + QueryOperation, + Operation, + Query, + NamedGroupOperation, + numericalOperation, + containsOperation, + NamedOperation +} from "./core"; +import { Key, comparable, isFunction, isArray } from "./utils"; + +class $Ne extends BaseOperation { + readonly propop = true; + private _test: Tester; + init() { + this._test = createTester(this.params, this.options.compare); + } + reset() { + super.reset(); + this.keep = true; + } + next(item: any) { + if (this._test(item)) { + this.done = true; + this.keep = false; + } + } +} +// https://docs.mongodb.com/manual/reference/operator/query/elemMatch/ +class $ElemMatch extends BaseOperation> { + readonly propop = true; + private _queryOperation: QueryOperation; + init() { + if (!this.params || typeof this.params !== "object") { + throw new Error(`Malformed query. $elemMatch must by an object.`); + } + this._queryOperation = createQueryOperation( + this.params, + this.owneryQuery, + this.options + ); + } + reset() { + super.reset(); + this._queryOperation.reset(); + } + next(item: any) { + if (isArray(item)) { + for (let i = 0, { length } = item; i < length; i++) { + // reset query operation since item being tested needs to pass _all_ query + // operations for it to be a success + this._queryOperation.reset(); + + const child = item[i]; + this._queryOperation.next(child, i, item, false); + this.keep = this.keep || this._queryOperation.keep; + } + this.done = true; + } else { + this.done = false; + this.keep = false; + } + } +} + +class $Not extends BaseOperation> { + readonly propop = true; + private _queryOperation: QueryOperation; + init() { + this._queryOperation = createQueryOperation( + this.params, + this.owneryQuery, + this.options + ); + } + reset() { + super.reset(); + this._queryOperation.reset(); + } + next(item: any, key: Key, owner: any, root: boolean) { + this._queryOperation.next(item, key, owner, root); + this.done = this._queryOperation.done; + this.keep = !this._queryOperation.keep; + } +} + +export class $Size extends BaseOperation { + readonly propop = true; + init() {} + next(item) { + if (isArray(item) && item.length === this.params) { + this.done = true; + this.keep = true; + } + // if (parent && parent.length === this.params) { + // this.done = true; + // this.keep = true; + // } + } +} + +const assertGroupNotEmpty = (values: any[]) => { + if (values.length === 0) { + throw new Error(`$and/$or/$nor must be a nonempty array`); + } +}; + +class $Or extends BaseOperation { + readonly propop = false; + private _ops: Operation[]; + init() { + assertGroupNotEmpty(this.params); + this._ops = this.params.map(op => + createQueryOperation(op, null, this.options) + ); + } + reset() { + this.done = false; + this.keep = false; + for (let i = 0, { length } = this._ops; i < length; i++) { + this._ops[i].reset(); + } + } + next(item: any, key: Key, owner: any) { + let done = false; + let success = false; + for (let i = 0, { length } = this._ops; i < length; i++) { + const op = this._ops[i]; + op.next(item, key, owner); + if (op.keep) { + done = true; + success = op.keep; + break; + } + } + + this.keep = success; + this.done = done; + } +} + +class $Nor extends $Or { + readonly propop = false; + next(item: any, key: Key, owner: any) { + super.next(item, key, owner); + this.keep = !this.keep; + } +} + +class $In extends BaseOperation { + readonly propop = true; + private _testers: Tester[]; + init() { + this._testers = this.params.map(value => { + if (containsOperation(value, this.options)) { + throw new Error(`cannot nest $ under ${this.name.toLowerCase()}`); + } + return createTester(value, this.options.compare); + }); + } + next(item: any, key: Key, owner: any) { + let done = false; + let success = false; + for (let i = 0, { length } = this._testers; i < length; i++) { + const test = this._testers[i]; + if (test(item)) { + done = true; + success = true; + break; + } + } + + this.keep = success; + this.done = done; + } +} + +class $Nin extends BaseOperation { + readonly propop = true; + private _in: $In; + constructor(params: any, ownerQuery: any, options: Options, name: string) { + super(params, ownerQuery, options, name); + this._in = new $In(params, ownerQuery, options, name); + } + next(item: any, key: Key, owner: any, root: boolean) { + this._in.next(item, key, owner); + + if (isArray(owner) && !root) { + if (this._in.keep) { + this.keep = false; + this.done = true; + } else if (key == owner.length - 1) { + this.keep = true; + this.done = true; + } + } else { + this.keep = !this._in.keep; + this.done = true; + } + } + reset() { + super.reset(); + this._in.reset(); + } +} + +class $Exists extends BaseOperation { + readonly propop = true; + next(item: any, key: Key, owner: any) { + if (owner.hasOwnProperty(key) === this.params) { + this.done = true; + this.keep = true; + } + } +} + +class $And extends NamedGroupOperation { + readonly propop = false; + constructor( + params: Query[], + owneryQuery: Query, + options: Options, + name: string + ) { + super( + params, + owneryQuery, + options, + params.map(query => createQueryOperation(query, owneryQuery, options)), + name + ); + + assertGroupNotEmpty(params); + } + next(item: any, key: Key, owner: any, root: boolean) { + this.childrenNext(item, key, owner, root); + } +} + +class $All extends NamedGroupOperation { + readonly propop = true; + constructor( + params: Query[], + owneryQuery: Query, + options: Options, + name: string + ) { + super( + params, + owneryQuery, + options, + params.map(query => createQueryOperation(query, owneryQuery, options)), + name + ); + } + next(item: any, key: Key, owner: any, root: boolean) { + this.childrenNext(item, key, owner, root); + } +} + +export const $eq = (params: any, owneryQuery: Query, options: Options) => + new EqualsOperation(params, owneryQuery, options); +export const $ne = ( + params: any, + owneryQuery: Query, + options: Options, + name: string +) => new $Ne(params, owneryQuery, options, name); +export const $or = ( + params: Query[], + owneryQuery: Query, + options: Options, + name: string +) => new $Or(params, owneryQuery, options, name); +export const $nor = ( + params: Query[], + owneryQuery: Query, + options: Options, + name: string +) => new $Nor(params, owneryQuery, options, name); +export const $elemMatch = ( + params: any, + owneryQuery: Query, + options: Options, + name: string +) => new $ElemMatch(params, owneryQuery, options, name); +export const $nin = ( + params: any, + owneryQuery: Query, + options: Options, + name: string +) => new $Nin(params, owneryQuery, options, name); +export const $in = ( + params: any, + owneryQuery: Query, + options: Options, + name: string +) => { + return new $In(params, owneryQuery, options, name); +}; + +export const $lt = numericalOperation(params => b => b < params); +export const $lte = numericalOperation(params => b => b <= params); +export const $gt = numericalOperation(params => b => b > params); +export const $gte = numericalOperation(params => b => b >= params); +export const $mod = ( + [mod, equalsValue]: number[], + owneryQuery: Query, + options: Options +) => + new EqualsOperation( + b => comparable(b) % mod === equalsValue, + owneryQuery, + options + ); +export const $exists = ( + params: boolean, + owneryQuery: Query, + options: Options, + name: string +) => new $Exists(params, owneryQuery, options, name); +export const $regex = ( + pattern: string, + owneryQuery: Query, + options: Options +) => + new EqualsOperation( + new RegExp(pattern, owneryQuery.$options), + owneryQuery, + options + ); +export const $not = ( + params: any, + owneryQuery: Query, + options: Options, + name: string +) => new $Not(params, owneryQuery, options, name); + +const typeAliases = { + number: v => typeof v === "number", + string: v => typeof v === "string", + bool: v => typeof v === "boolean", + array: v => Array.isArray(v), + null: v => v === null, + timestamp: v => v instanceof Date +}; + +export const $type = ( + clazz: Function | string, + owneryQuery: Query, + options: Options +) => + new EqualsOperation( + b => { + if (typeof clazz === "string") { + if (!typeAliases[clazz]) { + throw new Error(`Type alias does not exist`); + } + + return typeAliases[clazz](b); + } + + return b != null ? b instanceof clazz || b.constructor === clazz : false; + }, + owneryQuery, + options + ); +export const $and = ( + params: Query[], + ownerQuery: Query, + options: Options, + name: string +) => new $And(params, ownerQuery, options, name); + +export const $all = ( + params: Query[], + ownerQuery: Query, + options: Options, + name: string +) => new $All(params, ownerQuery, options, name); +export const $size = ( + params: number, + ownerQuery: Query, + options: Options +) => new $Size(params, ownerQuery, options, "$size"); +export const $options = () => null; +export const $where = ( + params: string | Function, + ownerQuery: Query, + options: Options +) => { + let test; + + if (isFunction(params)) { + test = params; + } else if (!process.env.CSP_ENABLED) { + test = new Function("obj", "return " + params); + } else { + throw new Error( + `In CSP mode, sift does not support strings in "$where" condition` + ); + } + + return new EqualsOperation(b => test.bind(b)(b), ownerQuery, options); +}; diff --git a/node_modules/sift/src/utils.d.ts b/node_modules/sift/src/utils.d.ts new file mode 100644 index 000000000..422a2924a --- /dev/null +++ b/node_modules/sift/src/utils.d.ts @@ -0,0 +1,9 @@ +export declare type Key = string | number; +export declare type Comparator = (a: any, b: any) => boolean; +export declare const typeChecker: (type: any) => (value: any) => value is TType; +export declare const comparable: (value: any) => any; +export declare const isArray: (value: any) => value is any[]; +export declare const isObject: (value: any) => value is Object; +export declare const isFunction: (value: any) => value is Function; +export declare const isVanillaObject: (value: any) => boolean; +export declare const equals: (a: any, b: any) => boolean; diff --git a/node_modules/sift/src/utils.js b/node_modules/sift/src/utils.js new file mode 100644 index 000000000..682fc1acf --- /dev/null +++ b/node_modules/sift/src/utils.js @@ -0,0 +1,70 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.equals = exports.isVanillaObject = exports.isFunction = exports.isObject = exports.isArray = exports.comparable = exports.typeChecker = void 0; +const typeChecker = (type) => { + const typeString = "[object " + type + "]"; + return function (value) { + return getClassName(value) === typeString; + }; +}; +exports.typeChecker = typeChecker; +const getClassName = value => Object.prototype.toString.call(value); +const comparable = (value) => { + if (value instanceof Date) { + return value.getTime(); + } + else if (exports.isArray(value)) { + return value.map(exports.comparable); + } + else if (value && typeof value.toJSON === "function") { + return value.toJSON(); + } + return value; +}; +exports.comparable = comparable; +exports.isArray = exports.typeChecker("Array"); +exports.isObject = exports.typeChecker("Object"); +exports.isFunction = exports.typeChecker("Function"); +const isVanillaObject = value => { + return (value && + (value.constructor === Object || + value.constructor === Array || + value.constructor.toString() === "function Object() { [native code] }" || + value.constructor.toString() === "function Array() { [native code] }") && + !value.toJSON); +}; +exports.isVanillaObject = isVanillaObject; +const equals = (a, b) => { + if (a == null && a == b) { + return true; + } + if (a === b) { + return true; + } + if (Object.prototype.toString.call(a) !== Object.prototype.toString.call(b)) { + return false; + } + if (exports.isArray(a)) { + if (a.length !== b.length) { + return false; + } + for (let i = 0, { length } = a; i < length; i++) { + if (!exports.equals(a[i], b[i])) + return false; + } + return true; + } + else if (exports.isObject(a)) { + if (Object.keys(a).length !== Object.keys(b).length) { + return false; + } + for (const key in a) { + if (!exports.equals(a[key], b[key])) + return false; + } + return true; + } + return false; +}; +exports.equals = equals; +//# sourceMappingURL=utils.js.map \ No newline at end of file diff --git a/node_modules/sift/src/utils.js.map b/node_modules/sift/src/utils.js.map new file mode 100644 index 000000000..696e78eee --- /dev/null +++ b/node_modules/sift/src/utils.js.map @@ -0,0 +1 @@ +{"version":3,"file":"utils.js","sourceRoot":"","sources":["utils.ts"],"names":[],"mappings":";;;AAEO,MAAM,WAAW,GAAG,CAAQ,IAAI,EAAE,EAAE;IACzC,MAAM,UAAU,GAAG,UAAU,GAAG,IAAI,GAAG,GAAG,CAAC;IAC3C,OAAO,UAAS,KAAK;QACnB,OAAO,YAAY,CAAC,KAAK,CAAC,KAAK,UAAU,CAAC;IAC5C,CAAC,CAAC;AACJ,CAAC,CAAC;AALW,QAAA,WAAW,eAKtB;AAEF,MAAM,YAAY,GAAG,KAAK,CAAC,EAAE,CAAC,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AAE7D,MAAM,UAAU,GAAG,CAAC,KAAU,EAAE,EAAE;IACvC,IAAI,KAAK,YAAY,IAAI,EAAE;QACzB,OAAO,KAAK,CAAC,OAAO,EAAE,CAAC;KACxB;SAAM,IAAI,eAAO,CAAC,KAAK,CAAC,EAAE;QACzB,OAAO,KAAK,CAAC,GAAG,CAAC,kBAAU,CAAC,CAAC;KAC9B;SAAM,IAAI,KAAK,IAAI,OAAO,KAAK,CAAC,MAAM,KAAK,UAAU,EAAE;QACtD,OAAO,KAAK,CAAC,MAAM,EAAE,CAAC;KACvB;IAED,OAAO,KAAK,CAAC;AACf,CAAC,CAAC;AAVW,QAAA,UAAU,cAUrB;AAEW,QAAA,OAAO,GAAG,mBAAW,CAAa,OAAO,CAAC,CAAC;AAC3C,QAAA,QAAQ,GAAG,mBAAW,CAAS,QAAQ,CAAC,CAA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,EAAE;QACtB,IAAI,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM,KAAK,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE;YACnD,OAAO,KAAK,CAAC;SACd;QACD,KAAK,MAAM,GAAG,IAAI,CAAC,EAAE;YACnB,IAAI,CAAC,cAAM,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC;gBAAE,OAAO,KAAK,CAAC;SAC3C;QACD,OAAO,IAAI,CAAC;KACb;IACD,OAAO,KAAK,CAAC;AACf,CAAC,CAAC;AA9BW,QAAA,MAAM,UA8BjB"} \ No newline at end of file diff --git a/node_modules/sift/src/utils.ts b/node_modules/sift/src/utils.ts new file mode 100644 index 000000000..a4ff6f97b --- /dev/null +++ b/node_modules/sift/src/utils.ts @@ -0,0 +1,68 @@ +export type Key = string | number; +export type Comparator = (a, b) => boolean; +export const typeChecker = (type) => { + const typeString = "[object " + type + "]"; + return function(value): value is TType { + return getClassName(value) === typeString; + }; +}; + +const getClassName = value => Object.prototype.toString.call(value); + +export const comparable = (value: any) => { + if (value instanceof Date) { + return value.getTime(); + } else if (isArray(value)) { + return value.map(comparable); + } else if (value && typeof value.toJSON === "function") { + return value.toJSON(); + } + + return value; +}; + +export const isArray = typeChecker>("Array"); +export const isObject = typeChecker("Object"); +export const isFunction = typeChecker("Function"); +export const isVanillaObject = value => { + return ( + value && + (value.constructor === Object || + value.constructor === Array || + value.constructor.toString() === "function Object() { [native code] }" || + value.constructor.toString() === "function Array() { [native code] }") && + !value.toJSON + ); +}; + +export const equals = (a, b) => { + if (a == null && a == b) { + return true; + } + if (a === b) { + return true; + } + + if (Object.prototype.toString.call(a) !== Object.prototype.toString.call(b)) { + return false; + } + + if (isArray(a)) { + if (a.length !== b.length) { + return false; + } + for (let i = 0, { length } = a; i < length; i++) { + if (!equals(a[i], b[i])) return false; + } + return true; + } else if (isObject(a)) { + if (Object.keys(a).length !== Object.keys(b).length) { + return false; + } + for (const key in a) { + if (!equals(a[key], b[key])) return false; + } + return true; + } + return false; +}; diff --git a/node_modules/smart-buffer/.prettierrc.yaml b/node_modules/smart-buffer/.prettierrc.yaml new file mode 100644 index 000000000..9a4f5ed75 --- /dev/null +++ b/node_modules/smart-buffer/.prettierrc.yaml @@ -0,0 +1,5 @@ +parser: typescript +printWidth: 120 +tabWidth: 2 +singleQuote: true +trailingComma: none \ No newline at end of file diff --git a/node_modules/smart-buffer/.travis.yml b/node_modules/smart-buffer/.travis.yml new file mode 100644 index 000000000..eec71ceca --- /dev/null +++ b/node_modules/smart-buffer/.travis.yml @@ -0,0 +1,13 @@ +language: node_js +node_js: + - 6 + - 8 + - 10 + - 12 + - stable + +before_script: + - npm install -g typescript + - tsc -p ./ + +script: "npm run coveralls" \ No newline at end of file diff --git a/node_modules/smart-buffer/LICENSE b/node_modules/smart-buffer/LICENSE new file mode 100644 index 000000000..aab5771a9 --- /dev/null +++ b/node_modules/smart-buffer/LICENSE @@ -0,0 +1,20 @@ +The MIT License (MIT) + +Copyright (c) 2013-2017 Josh Glazebrook + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/smart-buffer/README.md b/node_modules/smart-buffer/README.md new file mode 100644 index 000000000..6e498288e --- /dev/null +++ b/node_modules/smart-buffer/README.md @@ -0,0 +1,633 @@ +smart-buffer [![Build Status](https://travis-ci.org/JoshGlazebrook/smart-buffer.svg?branch=master)](https://travis-ci.org/JoshGlazebrook/smart-buffer) [![Coverage Status](https://coveralls.io/repos/github/JoshGlazebrook/smart-buffer/badge.svg?branch=master)](https://coveralls.io/github/JoshGlazebrook/smart-buffer?branch=master) +============= + +smart-buffer is a Buffer wrapper that adds automatic read & write offset tracking, string operations, data insertions, and more. + +![stats](https://nodei.co/npm/smart-buffer.png?downloads=true&downloadRank=true&stars=true "stats") + +**Key Features**: +* Proxies all of the Buffer write and read functions +* Keeps track of read and write offsets automatically +* Grows the internal Buffer as needed +* Useful string operations. (Null terminating strings) +* Allows for inserting values at specific points in the Buffer +* Built in TypeScript +* Type Definitions Provided +* Browser Support (using Webpack/Browserify) +* Full test coverage + +**Requirements**: +* Node v4.0+ is supported at this time. (Versions prior to 2.0 will work on node 0.10) + + + +## Breaking Changes in v4.0 + +* Old constructor patterns have been completely removed. It's now required to use the SmartBuffer.fromXXX() factory constructors. +* rewind(), skip(), moveTo() have been removed. (see [offsets](#offsets)) +* Internal private properties are now prefixed with underscores (_) +* **All** writeXXX() methods that are given an offset will now **overwrite data** instead of insert. (see [write vs insert](#write-vs-insert)) +* insertXXX() methods have been added for when you want to insert data at a specific offset (this replaces the old behavior of writeXXX() when an offset was provided) + + +## Looking for v3 docs? + +Legacy documentation for version 3 and prior can be found [here](https://github.com/JoshGlazebrook/smart-buffer/blob/master/docs/README_v3.md). + +## Installing: + +`yarn add smart-buffer` + +or + +`npm install smart-buffer` + +Note: The published NPM package includes the built javascript library. +If you cloned this repo and wish to build the library manually use: + +`npm run build` + +## Using smart-buffer + +```javascript +// Javascript +const SmartBuffer = require('smart-buffer').SmartBuffer; + +// Typescript +import { SmartBuffer, SmartBufferOptions} from 'smart-buffer'; +``` + +### Simple Example + +Building a packet that uses the following protocol specification: + +`[PacketType:2][PacketLength:2][Data:XX]` + +To build this packet using the vanilla Buffer class, you would have to count up the length of the data payload beforehand. You would also need to keep track of the current "cursor" position in your Buffer so you write everything in the right places. With smart-buffer you don't have to do either of those things. + +```javascript +function createLoginPacket(username, password, age, country) { + const packet = new SmartBuffer(); + packet.writeUInt16LE(0x0060); // Some packet type + packet.writeStringNT(username); + packet.writeStringNT(password); + packet.writeUInt8(age); + packet.writeStringNT(country); + packet.insertUInt16LE(packet.length - 2, 2); + + return packet.toBuffer(); +} +``` +With the above function, you now can do this: +```javascript +const login = createLoginPacket("Josh", "secret123", 22, "United States"); + +// +``` +Notice that the `[PacketLength:2]` value (1e 00) was inserted at position 2. + +Reading back the packet we created above is just as easy: +```javascript + +const reader = SmartBuffer.fromBuffer(login); + +const logininfo = { + packetType: reader.readUInt16LE(), + packetLength: reader.readUInt16LE(), + username: reader.readStringNT(), + password: reader.readStringNT(), + age: reader.readUInt8(), + country: reader.readStringNT() +}; + +/* +{ + packetType: 96, (0x0060) + packetLength: 30, + username: 'Josh', + password: 'secret123', + age: 22, + country: 'United States' +} +*/ +``` + + +## Write vs Insert +In prior versions of SmartBuffer, .writeXXX(value, offset) calls would insert data when an offset was provided. In version 4, this will now overwrite the data at the offset position. To insert data there are now corresponding .insertXXX(value, offset) methods. + +**SmartBuffer v3**: +```javascript +const buff = SmartBuffer.fromBuffer(new Buffer([1,2,3,4,5,6])); +buff.writeInt8(7, 2); +console.log(buff.toBuffer()) + +// +``` + +**SmartBuffer v4**: +```javascript +const buff = SmartBuffer.fromBuffer(new Buffer([1,2,3,4,5,6])); +buff.writeInt8(7, 2); +console.log(buff.toBuffer()); + +// +``` + +To insert you instead should use: +```javascript +const buff = SmartBuffer.fromBuffer(new Buffer([1,2,3,4,5,6])); +buff.insertInt8(7, 2); +console.log(buff.toBuffer()); + +// +``` + +**Note:** Insert/Writing to a position beyond the currently tracked internal Buffer will zero pad to your offset. + +## Constructing a smart-buffer + +There are a few different ways to construct a SmartBuffer instance. + +```javascript +// Creating SmartBuffer from existing Buffer +const buff = SmartBuffer.fromBuffer(buffer); // Creates instance from buffer. (Uses default utf8 encoding) +const buff = SmartBuffer.fromBuffer(buffer, 'ascii'); // Creates instance from buffer with ascii encoding for strings. + +// Creating SmartBuffer with specified internal Buffer size. (Note: this is not a hard cap, the internal buffer will grow as needed). +const buff = SmartBuffer.fromSize(1024); // Creates instance with internal Buffer size of 1024. +const buff = SmartBuffer.fromSize(1024, 'utf8'); // Creates instance with internal Buffer size of 1024, and utf8 encoding for strings. + +// Creating SmartBuffer with options object. This one specifies size and encoding. +const buff = SmartBuffer.fromOptions({ + size: 1024, + encoding: 'ascii' +}); + +// Creating SmartBuffer with options object. This one specified an existing Buffer. +const buff = SmartBuffer.fromOptions({ + buff: buffer +}); + +// Creating SmartBuffer from a string. +const buff = SmartBuffer.fromBuffer(Buffer.from('some string', 'utf8')); + +// Just want a regular SmartBuffer with all default options? +const buff = new SmartBuffer(); +``` + +# Api Reference: + +**Note:** SmartBuffer is fully documented with Typescript definitions as well as jsdocs so your favorite editor/IDE will have intellisense. + +**Table of Contents** + +1. [Constructing](#constructing) +2. **Numbers** + 1. [Integers](#integers) + 2. [Floating Points](#floating-point-numbers) +3. **Strings** + 1. [Strings](#strings) + 2. [Null Terminated Strings](#null-terminated-strings) +4. [Buffers](#buffers) +5. [Offsets](#offsets) +6. [Other](#other) + + +## Constructing + +### constructor() +### constructor([options]) +- ```options``` *{SmartBufferOptions}* An optional options object to construct a SmartBuffer with. + +Examples: +```javascript +const buff = new SmartBuffer(); +const buff = new SmartBuffer({ + size: 1024, + encoding: 'ascii' +}); +``` + +### Class Method: fromBuffer(buffer[, encoding]) +- ```buffer``` *{Buffer}* The Buffer instance to wrap. +- ```encoding``` *{string}* The string encoding to use. ```Default: 'utf8'``` + +Examples: +```javascript +const someBuffer = Buffer.from('some string'); +const buff = SmartBuffer.fromBuffer(someBuffer); // Defaults to utf8 +const buff = SmartBuffer.fromBuffer(someBuffer, 'ascii'); +``` + +### Class Method: fromSize(size[, encoding]) +- ```size``` *{number}* The size to initialize the internal Buffer. +- ```encoding``` *{string}* The string encoding to use. ```Default: 'utf8'``` + +Examples: +```javascript +const buff = SmartBuffer.fromSize(1024); // Defaults to utf8 +const buff = SmartBuffer.fromSize(1024, 'ascii'); +``` + +### Class Method: fromOptions(options) +- ```options``` *{SmartBufferOptions}* The Buffer instance to wrap. + +```typescript +interface SmartBufferOptions { + encoding?: BufferEncoding; // Defaults to utf8 + size?: number; // Defaults to 4096 + buff?: Buffer; +} +``` + +Examples: +```javascript +const buff = SmartBuffer.fromOptions({ + size: 1024 +}; +const buff = SmartBuffer.fromOptions({ + size: 1024, + encoding: 'utf8' +}); +const buff = SmartBuffer.fromOptions({ + encoding: 'utf8' +}); + +const someBuff = Buffer.from('some string', 'utf8'); +const buff = SmartBuffer.fromOptions({ + buffer: someBuff, + encoding: 'utf8' +}); +``` + +## Integers + +### buff.readInt8([offset]) +### buff.readUInt8([offset]) +- ```offset``` *{number}* Optional position to start reading data from. **Default**: ```Auto managed offset``` +- Returns *{number}* + +Read a Int8 value. + +### buff.readInt16BE([offset]) +### buff.readInt16LE([offset]) +### buff.readUInt16BE([offset]) +### buff.readUInt16LE([offset]) +- ```offset``` *{number}* Optional position to start reading data from. **Default**: ```Auto managed offset``` +- Returns *{number}* + +Read a 16 bit integer value. + +### buff.readInt32BE([offset]) +### buff.readInt32LE([offset]) +### buff.readUInt32BE([offset]) +### buff.readUInt32LE([offset]) +- ```offset``` *{number}* Optional position to start reading data from. **Default**: ```Auto managed offset``` +- Returns *{number}* + +Read a 32 bit integer value. + + +### buff.writeInt8(value[, offset]) +### buff.writeUInt8(value[, offset]) +- ```value``` *{number}* The value to write. +- ```offset``` *{number}* An optional offset to write this value to. **Default:** ```Auto managed offset``` +- Returns *{this}* + +Write a Int8 value. + +### buff.insertInt8(value, offset) +### buff.insertUInt8(value, offset) +- ```value``` *{number}* The value to insert. +- ```offset``` *{number}* The offset to insert this data at. +- Returns *{this}* + +Insert a Int8 value. + + +### buff.writeInt16BE(value[, offset]) +### buff.writeInt16LE(value[, offset]) +### buff.writeUInt16BE(value[, offset]) +### buff.writeUInt16LE(value[, offset]) +- ```value``` *{number}* The value to write. +- ```offset``` *{number}* An optional offset to write this value to. **Default:** ```Auto managed offset``` +- Returns *{this}* + +Write a 16 bit integer value. + +### buff.insertInt16BE(value, offset) +### buff.insertInt16LE(value, offset) +### buff.insertUInt16BE(value, offset) +### buff.insertUInt16LE(value, offset) +- ```value``` *{number}* The value to insert. +- ```offset``` *{number}* The offset to insert this data at. +- Returns *{this}* + +Insert a 16 bit integer value. + + +### buff.writeInt32BE(value[, offset]) +### buff.writeInt32LE(value[, offset]) +### buff.writeUInt32BE(value[, offset]) +### buff.writeUInt32LE(value[, offset]) +- ```value``` *{number}* The value to write. +- ```offset``` *{number}* An optional offset to write this value to. **Default:** ```Auto managed offset``` +- Returns *{this}* + +Write a 32 bit integer value. + +### buff.insertInt32BE(value, offset) +### buff.insertInt32LE(value, offset) +### buff.insertUInt32BE(value, offset) +### buff.nsertUInt32LE(value, offset) +- ```value``` *{number}* The value to insert. +- ```offset``` *{number}* The offset to insert this data at. +- Returns *{this}* + +Insert a 32 bit integer value. + + +## Floating Point Numbers + +### buff.readFloatBE([offset]) +### buff.readFloatLE([offset]) +- ```offset``` *{number}* Optional position to start reading data from. **Default**: ```Auto managed offset``` +- Returns *{number}* + +Read a Float value. + +### buff.readDoubleBE([offset]) +### buff.readDoubleLE([offset]) +- ```offset``` *{number}* Optional position to start reading data from. **Default**: ```Auto managed offset``` +- Returns *{number}* + +Read a Double value. + + +### buff.writeFloatBE(value[, offset]) +### buff.writeFloatLE(value[, offset]) +- ```value``` *{number}* The value to write. +- ```offset``` *{number}* An optional offset to write this value to. **Default:** ```Auto managed offset``` +- Returns *{this}* + +Write a Float value. + +### buff.insertFloatBE(value, offset) +### buff.insertFloatLE(value, offset) +- ```value``` *{number}* The value to insert. +- ```offset``` *{number}* The offset to insert this data at. +- Returns *{this}* + +Insert a Float value. + + +### buff.writeDoubleBE(value[, offset]) +### buff.writeDoubleLE(value[, offset]) +- ```value``` *{number}* The value to write. +- ```offset``` *{number}* An optional offset to write this value to. **Default:** ```Auto managed offset``` +- Returns *{this}* + +Write a Double value. + +### buff.insertDoubleBE(value, offset) +### buff.insertDoubleLE(value, offset) +- ```value``` *{number}* The value to insert. +- ```offset``` *{number}* The offset to insert this data at. +- Returns *{this}* + +Insert a Double value. + +## Strings + +### buff.readString() +### buff.readString(size[, encoding]) +### buff.readString(encoding) +- ```size``` *{number}* The number of bytes to read. **Default:** ```Reads to the end of the Buffer.``` +- ```encoding``` *{string}* The string encoding to use. **Default:** ```utf8```. + +Read a string value. + +Examples: +```javascript +const buff = SmartBuffer.fromBuffer(Buffer.from('hello there', 'utf8')); +buff.readString(); // 'hello there' +buff.readString(2); // 'he' +buff.readString(2, 'utf8'); // 'he' +buff.readString('utf8'); // 'hello there' +``` + +### buff.writeString(value) +### buff.writeString(value[, offset]) +### buff.writeString(value[, encoding]) +### buff.writeString(value[, offset[, encoding]]) +- ```value``` *{string}* The string value to write. +- ```offset``` *{number}* The offset to write this value to. **Default:** ```Auto managed offset``` +- ```encoding``` *{string}* An optional string encoding to use. **Default:** ```utf8``` + +Write a string value. + +Examples: +```javascript +buff.writeString('hello'); // Auto managed offset +buff.writeString('hello', 2); +buff.writeString('hello', 'utf8') // Auto managed offset +buff.writeString('hello', 2, 'utf8'); +``` + +### buff.insertString(value, offset[, encoding]) +- ```value``` *{string}* The string value to write. +- ```offset``` *{number}* The offset to write this value to. +- ```encoding``` *{string}* An optional string encoding to use. **Default:** ```utf8``` + +Insert a string value. + +Examples: +```javascript +buff.insertString('hello', 2); +buff.insertString('hello', 2, 'utf8'); +``` + +## Null Terminated Strings + +### buff.readStringNT() +### buff.readStringNT(encoding) +- ```encoding``` *{string}* The string encoding to use. **Default:** ```utf8```. + +Read a null terminated string value. (If a null is not found, it will read to the end of the Buffer). + +Examples: +```javascript +const buff = SmartBuffer.fromBuffer(Buffer.from('hello\0 there', 'utf8')); +buff.readStringNT(); // 'hello' + +// If we called this again: +buff.readStringNT(); // ' there' +``` + +### buff.writeStringNT(value) +### buff.writeStringNT(value[, offset]) +### buff.writeStringNT(value[, encoding]) +### buff.writeStringNT(value[, offset[, encoding]]) +- ```value``` *{string}* The string value to write. +- ```offset``` *{number}* The offset to write this value to. **Default:** ```Auto managed offset``` +- ```encoding``` *{string}* An optional string encoding to use. **Default:** ```utf8``` + +Write a null terminated string value. + +Examples: +```javascript +buff.writeStringNT('hello'); // Auto managed offset +buff.writeStringNT('hello', 2); // +buff.writeStringNT('hello', 'utf8') // Auto managed offset +buff.writeStringNT('hello', 2, 'utf8'); +``` + +### buff.insertStringNT(value, offset[, encoding]) +- ```value``` *{string}* The string value to write. +- ```offset``` *{number}* The offset to write this value to. +- ```encoding``` *{string}* An optional string encoding to use. **Default:** ```utf8``` + +Insert a null terminated string value. + +Examples: +```javascript +buff.insertStringNT('hello', 2); +buff.insertStringNT('hello', 2, 'utf8'); +``` + +## Buffers + +### buff.readBuffer([length]) +- ```length``` *{number}* The number of bytes to read into a Buffer. **Default:** ```Reads to the end of the Buffer``` + +Read a Buffer of a specified size. + +### buff.writeBuffer(value[, offset]) +- ```value``` *{Buffer}* The buffer value to write. +- ```offset``` *{number}* An optional offset to write the value to. **Default:** ```Auto managed offset``` + +### buff.insertBuffer(value, offset) +- ```value``` *{Buffer}* The buffer value to write. +- ```offset``` *{number}* The offset to write the value to. + + +### buff.readBufferNT() + +Read a null terminated Buffer. + +### buff.writeBufferNT(value[, offset]) +- ```value``` *{Buffer}* The buffer value to write. +- ```offset``` *{number}* An optional offset to write the value to. **Default:** ```Auto managed offset``` + +Write a null terminated Buffer. + + +### buff.insertBufferNT(value, offset) +- ```value``` *{Buffer}* The buffer value to write. +- ```offset``` *{number}* The offset to write the value to. + +Insert a null terminated Buffer. + + +## Offsets + +### buff.readOffset +### buff.readOffset(offset) +- ```offset``` *{number}* The new read offset value to set. +- Returns: ```The current read offset``` + +Gets or sets the current read offset. + +Examples: +```javascript +const currentOffset = buff.readOffset; // 5 + +buff.readOffset = 10; + +console.log(buff.readOffset) // 10 +``` + +### buff.writeOffset +### buff.writeOffset(offset) +- ```offset``` *{number}* The new write offset value to set. +- Returns: ```The current write offset``` + +Gets or sets the current write offset. + +Examples: +```javascript +const currentOffset = buff.writeOffset; // 5 + +buff.writeOffset = 10; + +console.log(buff.writeOffset) // 10 +``` + +### buff.encoding +### buff.encoding(encoding) +- ```encoding``` *{string}* The new string encoding to set. +- Returns: ```The current string encoding``` + +Gets or sets the current string encoding. + +Examples: +```javascript +const currentEncoding = buff.encoding; // 'utf8' + +buff.encoding = 'ascii'; + +console.log(buff.encoding) // 'ascii' +``` + +## Other + +### buff.clear() + +Clear and resets the SmartBuffer instance. + +### buff.remaining() +- Returns ```Remaining data left to be read``` + +Gets the number of remaining bytes to be read. + + +### buff.internalBuffer +- Returns: *{Buffer}* + +Gets the internally managed Buffer (Includes unmanaged data). + +Examples: +```javascript +const buff = SmartBuffer.fromSize(16); +buff.writeString('hello'); +console.log(buff.InternalBuffer); // +``` + +### buff.toBuffer() +- Returns: *{Buffer}* + +Gets a sliced Buffer instance of the internally managed Buffer. (Only includes managed data) + +Examples: +```javascript +const buff = SmartBuffer.fromSize(16); +buff.writeString('hello'); +console.log(buff.toBuffer()); // +``` + +### buff.toString([encoding]) +- ```encoding``` *{string}* The string encoding to use when converting to a string. **Default:** ```utf8``` +- Returns *{string}* + +Gets a string representation of all data in the SmartBuffer. + +### buff.destroy() + +Destroys the SmartBuffer instance. + + + +## License + +This work is licensed under the [MIT license](http://en.wikipedia.org/wiki/MIT_License). diff --git a/node_modules/smart-buffer/build/smartbuffer.js b/node_modules/smart-buffer/build/smartbuffer.js new file mode 100644 index 000000000..5353ae11d --- /dev/null +++ b/node_modules/smart-buffer/build/smartbuffer.js @@ -0,0 +1,1233 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const utils_1 = require("./utils"); +// The default Buffer size if one is not provided. +const DEFAULT_SMARTBUFFER_SIZE = 4096; +// The default string encoding to use for reading/writing strings. +const DEFAULT_SMARTBUFFER_ENCODING = 'utf8'; +class SmartBuffer { + /** + * Creates a new SmartBuffer instance. + * + * @param options { SmartBufferOptions } The SmartBufferOptions to apply to this instance. + */ + constructor(options) { + this.length = 0; + this._encoding = DEFAULT_SMARTBUFFER_ENCODING; + this._writeOffset = 0; + this._readOffset = 0; + if (SmartBuffer.isSmartBufferOptions(options)) { + // Checks for encoding + if (options.encoding) { + utils_1.checkEncoding(options.encoding); + this._encoding = options.encoding; + } + // Checks for initial size length + if (options.size) { + if (utils_1.isFiniteInteger(options.size) && options.size > 0) { + this._buff = Buffer.allocUnsafe(options.size); + } + else { + throw new Error(utils_1.ERRORS.INVALID_SMARTBUFFER_SIZE); + } + // Check for initial Buffer + } + else if (options.buff) { + if (Buffer.isBuffer(options.buff)) { + this._buff = options.buff; + this.length = options.buff.length; + } + else { + throw new Error(utils_1.ERRORS.INVALID_SMARTBUFFER_BUFFER); + } + } + else { + this._buff = Buffer.allocUnsafe(DEFAULT_SMARTBUFFER_SIZE); + } + } + else { + // If something was passed but it's not a SmartBufferOptions object + if (typeof options !== 'undefined') { + throw new Error(utils_1.ERRORS.INVALID_SMARTBUFFER_OBJECT); + } + // Otherwise default to sane options + this._buff = Buffer.allocUnsafe(DEFAULT_SMARTBUFFER_SIZE); + } + } + /** + * Creates a new SmartBuffer instance with the provided internal Buffer size and optional encoding. + * + * @param size { Number } The size of the internal Buffer. + * @param encoding { String } The BufferEncoding to use for strings. + * + * @return { SmartBuffer } + */ + static fromSize(size, encoding) { + return new this({ + size: size, + encoding: encoding + }); + } + /** + * Creates a new SmartBuffer instance with the provided Buffer and optional encoding. + * + * @param buffer { Buffer } The Buffer to use as the internal Buffer value. + * @param encoding { String } The BufferEncoding to use for strings. + * + * @return { SmartBuffer } + */ + static fromBuffer(buff, encoding) { + return new this({ + buff: buff, + encoding: encoding + }); + } + /** + * Creates a new SmartBuffer instance with the provided SmartBufferOptions options. + * + * @param options { SmartBufferOptions } The options to use when creating the SmartBuffer instance. + */ + static fromOptions(options) { + return new this(options); + } + /** + * Type checking function that determines if an object is a SmartBufferOptions object. + */ + static isSmartBufferOptions(options) { + const castOptions = options; + return (castOptions && + (castOptions.encoding !== undefined || castOptions.size !== undefined || castOptions.buff !== undefined)); + } + // Signed integers + /** + * Reads an Int8 value from the current read position or an optionally provided offset. + * + * @param offset { Number } The offset to read data from (optional) + * @return { Number } + */ + readInt8(offset) { + return this._readNumberValue(Buffer.prototype.readInt8, 1, offset); + } + /** + * Reads an Int16BE value from the current read position or an optionally provided offset. + * + * @param offset { Number } The offset to read data from (optional) + * @return { Number } + */ + readInt16BE(offset) { + return this._readNumberValue(Buffer.prototype.readInt16BE, 2, offset); + } + /** + * Reads an Int16LE value from the current read position or an optionally provided offset. + * + * @param offset { Number } The offset to read data from (optional) + * @return { Number } + */ + readInt16LE(offset) { + return this._readNumberValue(Buffer.prototype.readInt16LE, 2, offset); + } + /** + * Reads an Int32BE value from the current read position or an optionally provided offset. + * + * @param offset { Number } The offset to read data from (optional) + * @return { Number } + */ + readInt32BE(offset) { + return this._readNumberValue(Buffer.prototype.readInt32BE, 4, offset); + } + /** + * Reads an Int32LE value from the current read position or an optionally provided offset. + * + * @param offset { Number } The offset to read data from (optional) + * @return { Number } + */ + readInt32LE(offset) { + return this._readNumberValue(Buffer.prototype.readInt32LE, 4, offset); + } + /** + * Reads a BigInt64BE value from the current read position or an optionally provided offset. + * + * @param offset { Number } The offset to read data from (optional) + * @return { BigInt } + */ + readBigInt64BE(offset) { + utils_1.bigIntAndBufferInt64Check('readBigInt64BE'); + return this._readNumberValue(Buffer.prototype.readBigInt64BE, 8, offset); + } + /** + * Reads a BigInt64LE value from the current read position or an optionally provided offset. + * + * @param offset { Number } The offset to read data from (optional) + * @return { BigInt } + */ + readBigInt64LE(offset) { + utils_1.bigIntAndBufferInt64Check('readBigInt64LE'); + return this._readNumberValue(Buffer.prototype.readBigInt64LE, 8, offset); + } + /** + * Writes an Int8 value to the current write position (or at optional offset). + * + * @param value { Number } The value to write. + * @param offset { Number } The offset to write the value at. + * + * @return this + */ + writeInt8(value, offset) { + this._writeNumberValue(Buffer.prototype.writeInt8, 1, value, offset); + return this; + } + /** + * Inserts an Int8 value at the given offset value. + * + * @param value { Number } The value to insert. + * @param offset { Number } The offset to insert the value at. + * + * @return this + */ + insertInt8(value, offset) { + return this._insertNumberValue(Buffer.prototype.writeInt8, 1, value, offset); + } + /** + * Writes an Int16BE value to the current write position (or at optional offset). + * + * @param value { Number } The value to write. + * @param offset { Number } The offset to write the value at. + * + * @return this + */ + writeInt16BE(value, offset) { + return this._writeNumberValue(Buffer.prototype.writeInt16BE, 2, value, offset); + } + /** + * Inserts an Int16BE value at the given offset value. + * + * @param value { Number } The value to insert. + * @param offset { Number } The offset to insert the value at. + * + * @return this + */ + insertInt16BE(value, offset) { + return this._insertNumberValue(Buffer.prototype.writeInt16BE, 2, value, offset); + } + /** + * Writes an Int16LE value to the current write position (or at optional offset). + * + * @param value { Number } The value to write. + * @param offset { Number } The offset to write the value at. + * + * @return this + */ + writeInt16LE(value, offset) { + return this._writeNumberValue(Buffer.prototype.writeInt16LE, 2, value, offset); + } + /** + * Inserts an Int16LE value at the given offset value. + * + * @param value { Number } The value to insert. + * @param offset { Number } The offset to insert the value at. + * + * @return this + */ + insertInt16LE(value, offset) { + return this._insertNumberValue(Buffer.prototype.writeInt16LE, 2, value, offset); + } + /** + * Writes an Int32BE value to the current write position (or at optional offset). + * + * @param value { Number } The value to write. + * @param offset { Number } The offset to write the value at. + * + * @return this + */ + writeInt32BE(value, offset) { + return this._writeNumberValue(Buffer.prototype.writeInt32BE, 4, value, offset); + } + /** + * Inserts an Int32BE value at the given offset value. + * + * @param value { Number } The value to insert. + * @param offset { Number } The offset to insert the value at. + * + * @return this + */ + insertInt32BE(value, offset) { + return this._insertNumberValue(Buffer.prototype.writeInt32BE, 4, value, offset); + } + /** + * Writes an Int32LE value to the current write position (or at optional offset). + * + * @param value { Number } The value to write. + * @param offset { Number } The offset to write the value at. + * + * @return this + */ + writeInt32LE(value, offset) { + return this._writeNumberValue(Buffer.prototype.writeInt32LE, 4, value, offset); + } + /** + * Inserts an Int32LE value at the given offset value. + * + * @param value { Number } The value to insert. + * @param offset { Number } The offset to insert the value at. + * + * @return this + */ + insertInt32LE(value, offset) { + return this._insertNumberValue(Buffer.prototype.writeInt32LE, 4, value, offset); + } + /** + * Writes a BigInt64BE value to the current write position (or at optional offset). + * + * @param value { BigInt } The value to write. + * @param offset { Number } The offset to write the value at. + * + * @return this + */ + writeBigInt64BE(value, offset) { + utils_1.bigIntAndBufferInt64Check('writeBigInt64BE'); + return this._writeNumberValue(Buffer.prototype.writeBigInt64BE, 8, value, offset); + } + /** + * Inserts a BigInt64BE value at the given offset value. + * + * @param value { BigInt } The value to insert. + * @param offset { Number } The offset to insert the value at. + * + * @return this + */ + insertBigInt64BE(value, offset) { + utils_1.bigIntAndBufferInt64Check('writeBigInt64BE'); + return this._insertNumberValue(Buffer.prototype.writeBigInt64BE, 8, value, offset); + } + /** + * Writes a BigInt64LE value to the current write position (or at optional offset). + * + * @param value { BigInt } The value to write. + * @param offset { Number } The offset to write the value at. + * + * @return this + */ + writeBigInt64LE(value, offset) { + utils_1.bigIntAndBufferInt64Check('writeBigInt64LE'); + return this._writeNumberValue(Buffer.prototype.writeBigInt64LE, 8, value, offset); + } + /** + * Inserts a Int64LE value at the given offset value. + * + * @param value { BigInt } The value to insert. + * @param offset { Number } The offset to insert the value at. + * + * @return this + */ + insertBigInt64LE(value, offset) { + utils_1.bigIntAndBufferInt64Check('writeBigInt64LE'); + return this._insertNumberValue(Buffer.prototype.writeBigInt64LE, 8, value, offset); + } + // Unsigned Integers + /** + * Reads an UInt8 value from the current read position or an optionally provided offset. + * + * @param offset { Number } The offset to read data from (optional) + * @return { Number } + */ + readUInt8(offset) { + return this._readNumberValue(Buffer.prototype.readUInt8, 1, offset); + } + /** + * Reads an UInt16BE value from the current read position or an optionally provided offset. + * + * @param offset { Number } The offset to read data from (optional) + * @return { Number } + */ + readUInt16BE(offset) { + return this._readNumberValue(Buffer.prototype.readUInt16BE, 2, offset); + } + /** + * Reads an UInt16LE value from the current read position or an optionally provided offset. + * + * @param offset { Number } The offset to read data from (optional) + * @return { Number } + */ + readUInt16LE(offset) { + return this._readNumberValue(Buffer.prototype.readUInt16LE, 2, offset); + } + /** + * Reads an UInt32BE value from the current read position or an optionally provided offset. + * + * @param offset { Number } The offset to read data from (optional) + * @return { Number } + */ + readUInt32BE(offset) { + return this._readNumberValue(Buffer.prototype.readUInt32BE, 4, offset); + } + /** + * Reads an UInt32LE value from the current read position or an optionally provided offset. + * + * @param offset { Number } The offset to read data from (optional) + * @return { Number } + */ + readUInt32LE(offset) { + return this._readNumberValue(Buffer.prototype.readUInt32LE, 4, offset); + } + /** + * Reads a BigUInt64BE value from the current read position or an optionally provided offset. + * + * @param offset { Number } The offset to read data from (optional) + * @return { BigInt } + */ + readBigUInt64BE(offset) { + utils_1.bigIntAndBufferInt64Check('readBigUInt64BE'); + return this._readNumberValue(Buffer.prototype.readBigUInt64BE, 8, offset); + } + /** + * Reads a BigUInt64LE value from the current read position or an optionally provided offset. + * + * @param offset { Number } The offset to read data from (optional) + * @return { BigInt } + */ + readBigUInt64LE(offset) { + utils_1.bigIntAndBufferInt64Check('readBigUInt64LE'); + return this._readNumberValue(Buffer.prototype.readBigUInt64LE, 8, offset); + } + /** + * Writes an UInt8 value to the current write position (or at optional offset). + * + * @param value { Number } The value to write. + * @param offset { Number } The offset to write the value at. + * + * @return this + */ + writeUInt8(value, offset) { + return this._writeNumberValue(Buffer.prototype.writeUInt8, 1, value, offset); + } + /** + * Inserts an UInt8 value at the given offset value. + * + * @param value { Number } The value to insert. + * @param offset { Number } The offset to insert the value at. + * + * @return this + */ + insertUInt8(value, offset) { + return this._insertNumberValue(Buffer.prototype.writeUInt8, 1, value, offset); + } + /** + * Writes an UInt16BE value to the current write position (or at optional offset). + * + * @param value { Number } The value to write. + * @param offset { Number } The offset to write the value at. + * + * @return this + */ + writeUInt16BE(value, offset) { + return this._writeNumberValue(Buffer.prototype.writeUInt16BE, 2, value, offset); + } + /** + * Inserts an UInt16BE value at the given offset value. + * + * @param value { Number } The value to insert. + * @param offset { Number } The offset to insert the value at. + * + * @return this + */ + insertUInt16BE(value, offset) { + return this._insertNumberValue(Buffer.prototype.writeUInt16BE, 2, value, offset); + } + /** + * Writes an UInt16LE value to the current write position (or at optional offset). + * + * @param value { Number } The value to write. + * @param offset { Number } The offset to write the value at. + * + * @return this + */ + writeUInt16LE(value, offset) { + return this._writeNumberValue(Buffer.prototype.writeUInt16LE, 2, value, offset); + } + /** + * Inserts an UInt16LE value at the given offset value. + * + * @param value { Number } The value to insert. + * @param offset { Number } The offset to insert the value at. + * + * @return this + */ + insertUInt16LE(value, offset) { + return this._insertNumberValue(Buffer.prototype.writeUInt16LE, 2, value, offset); + } + /** + * Writes an UInt32BE value to the current write position (or at optional offset). + * + * @param value { Number } The value to write. + * @param offset { Number } The offset to write the value at. + * + * @return this + */ + writeUInt32BE(value, offset) { + return this._writeNumberValue(Buffer.prototype.writeUInt32BE, 4, value, offset); + } + /** + * Inserts an UInt32BE value at the given offset value. + * + * @param value { Number } The value to insert. + * @param offset { Number } The offset to insert the value at. + * + * @return this + */ + insertUInt32BE(value, offset) { + return this._insertNumberValue(Buffer.prototype.writeUInt32BE, 4, value, offset); + } + /** + * Writes an UInt32LE value to the current write position (or at optional offset). + * + * @param value { Number } The value to write. + * @param offset { Number } The offset to write the value at. + * + * @return this + */ + writeUInt32LE(value, offset) { + return this._writeNumberValue(Buffer.prototype.writeUInt32LE, 4, value, offset); + } + /** + * Inserts an UInt32LE value at the given offset value. + * + * @param value { Number } The value to insert. + * @param offset { Number } The offset to insert the value at. + * + * @return this + */ + insertUInt32LE(value, offset) { + return this._insertNumberValue(Buffer.prototype.writeUInt32LE, 4, value, offset); + } + /** + * Writes a BigUInt64BE value to the current write position (or at optional offset). + * + * @param value { Number } The value to write. + * @param offset { Number } The offset to write the value at. + * + * @return this + */ + writeBigUInt64BE(value, offset) { + utils_1.bigIntAndBufferInt64Check('writeBigUInt64BE'); + return this._writeNumberValue(Buffer.prototype.writeBigUInt64BE, 8, value, offset); + } + /** + * Inserts a BigUInt64BE value at the given offset value. + * + * @param value { Number } The value to insert. + * @param offset { Number } The offset to insert the value at. + * + * @return this + */ + insertBigUInt64BE(value, offset) { + utils_1.bigIntAndBufferInt64Check('writeBigUInt64BE'); + return this._insertNumberValue(Buffer.prototype.writeBigUInt64BE, 8, value, offset); + } + /** + * Writes a BigUInt64LE value to the current write position (or at optional offset). + * + * @param value { Number } The value to write. + * @param offset { Number } The offset to write the value at. + * + * @return this + */ + writeBigUInt64LE(value, offset) { + utils_1.bigIntAndBufferInt64Check('writeBigUInt64LE'); + return this._writeNumberValue(Buffer.prototype.writeBigUInt64LE, 8, value, offset); + } + /** + * Inserts a BigUInt64LE value at the given offset value. + * + * @param value { Number } The value to insert. + * @param offset { Number } The offset to insert the value at. + * + * @return this + */ + insertBigUInt64LE(value, offset) { + utils_1.bigIntAndBufferInt64Check('writeBigUInt64LE'); + return this._insertNumberValue(Buffer.prototype.writeBigUInt64LE, 8, value, offset); + } + // Floating Point + /** + * Reads an FloatBE value from the current read position or an optionally provided offset. + * + * @param offset { Number } The offset to read data from (optional) + * @return { Number } + */ + readFloatBE(offset) { + return this._readNumberValue(Buffer.prototype.readFloatBE, 4, offset); + } + /** + * Reads an FloatLE value from the current read position or an optionally provided offset. + * + * @param offset { Number } The offset to read data from (optional) + * @return { Number } + */ + readFloatLE(offset) { + return this._readNumberValue(Buffer.prototype.readFloatLE, 4, offset); + } + /** + * Writes a FloatBE value to the current write position (or at optional offset). + * + * @param value { Number } The value to write. + * @param offset { Number } The offset to write the value at. + * + * @return this + */ + writeFloatBE(value, offset) { + return this._writeNumberValue(Buffer.prototype.writeFloatBE, 4, value, offset); + } + /** + * Inserts a FloatBE value at the given offset value. + * + * @param value { Number } The value to insert. + * @param offset { Number } The offset to insert the value at. + * + * @return this + */ + insertFloatBE(value, offset) { + return this._insertNumberValue(Buffer.prototype.writeFloatBE, 4, value, offset); + } + /** + * Writes a FloatLE value to the current write position (or at optional offset). + * + * @param value { Number } The value to write. + * @param offset { Number } The offset to write the value at. + * + * @return this + */ + writeFloatLE(value, offset) { + return this._writeNumberValue(Buffer.prototype.writeFloatLE, 4, value, offset); + } + /** + * Inserts a FloatLE value at the given offset value. + * + * @param value { Number } The value to insert. + * @param offset { Number } The offset to insert the value at. + * + * @return this + */ + insertFloatLE(value, offset) { + return this._insertNumberValue(Buffer.prototype.writeFloatLE, 4, value, offset); + } + // Double Floating Point + /** + * Reads an DoublEBE value from the current read position or an optionally provided offset. + * + * @param offset { Number } The offset to read data from (optional) + * @return { Number } + */ + readDoubleBE(offset) { + return this._readNumberValue(Buffer.prototype.readDoubleBE, 8, offset); + } + /** + * Reads an DoubleLE value from the current read position or an optionally provided offset. + * + * @param offset { Number } The offset to read data from (optional) + * @return { Number } + */ + readDoubleLE(offset) { + return this._readNumberValue(Buffer.prototype.readDoubleLE, 8, offset); + } + /** + * Writes a DoubleBE value to the current write position (or at optional offset). + * + * @param value { Number } The value to write. + * @param offset { Number } The offset to write the value at. + * + * @return this + */ + writeDoubleBE(value, offset) { + return this._writeNumberValue(Buffer.prototype.writeDoubleBE, 8, value, offset); + } + /** + * Inserts a DoubleBE value at the given offset value. + * + * @param value { Number } The value to insert. + * @param offset { Number } The offset to insert the value at. + * + * @return this + */ + insertDoubleBE(value, offset) { + return this._insertNumberValue(Buffer.prototype.writeDoubleBE, 8, value, offset); + } + /** + * Writes a DoubleLE value to the current write position (or at optional offset). + * + * @param value { Number } The value to write. + * @param offset { Number } The offset to write the value at. + * + * @return this + */ + writeDoubleLE(value, offset) { + return this._writeNumberValue(Buffer.prototype.writeDoubleLE, 8, value, offset); + } + /** + * Inserts a DoubleLE value at the given offset value. + * + * @param value { Number } The value to insert. + * @param offset { Number } The offset to insert the value at. + * + * @return this + */ + insertDoubleLE(value, offset) { + return this._insertNumberValue(Buffer.prototype.writeDoubleLE, 8, value, offset); + } + // Strings + /** + * Reads a String from the current read position. + * + * @param arg1 { Number | String } The number of bytes to read as a String, or the BufferEncoding to use for + * the string (Defaults to instance level encoding). + * @param encoding { String } The BufferEncoding to use for the string (Defaults to instance level encoding). + * + * @return { String } + */ + readString(arg1, encoding) { + let lengthVal; + // Length provided + if (typeof arg1 === 'number') { + utils_1.checkLengthValue(arg1); + lengthVal = Math.min(arg1, this.length - this._readOffset); + } + else { + encoding = arg1; + lengthVal = this.length - this._readOffset; + } + // Check encoding + if (typeof encoding !== 'undefined') { + utils_1.checkEncoding(encoding); + } + const value = this._buff.slice(this._readOffset, this._readOffset + lengthVal).toString(encoding || this._encoding); + this._readOffset += lengthVal; + return value; + } + /** + * Inserts a String + * + * @param value { String } The String value to insert. + * @param offset { Number } The offset to insert the string at. + * @param encoding { String } The BufferEncoding to use for writing strings (defaults to instance encoding). + * + * @return this + */ + insertString(value, offset, encoding) { + utils_1.checkOffsetValue(offset); + return this._handleString(value, true, offset, encoding); + } + /** + * Writes a String + * + * @param value { String } The String value to write. + * @param arg2 { Number | String } The offset to write the string at, or the BufferEncoding to use. + * @param encoding { String } The BufferEncoding to use for writing strings (defaults to instance encoding). + * + * @return this + */ + writeString(value, arg2, encoding) { + return this._handleString(value, false, arg2, encoding); + } + /** + * Reads a null-terminated String from the current read position. + * + * @param encoding { String } The BufferEncoding to use for the string (Defaults to instance level encoding). + * + * @return { String } + */ + readStringNT(encoding) { + if (typeof encoding !== 'undefined') { + utils_1.checkEncoding(encoding); + } + // Set null character position to the end SmartBuffer instance. + let nullPos = this.length; + // Find next null character (if one is not found, default from above is used) + for (let i = this._readOffset; i < this.length; i++) { + if (this._buff[i] === 0x00) { + nullPos = i; + break; + } + } + // Read string value + const value = this._buff.slice(this._readOffset, nullPos); + // Increment internal Buffer read offset + this._readOffset = nullPos + 1; + return value.toString(encoding || this._encoding); + } + /** + * Inserts a null-terminated String. + * + * @param value { String } The String value to write. + * @param arg2 { Number | String } The offset to write the string to, or the BufferEncoding to use. + * @param encoding { String } The BufferEncoding to use for writing strings (defaults to instance encoding). + * + * @return this + */ + insertStringNT(value, offset, encoding) { + utils_1.checkOffsetValue(offset); + // Write Values + this.insertString(value, offset, encoding); + this.insertUInt8(0x00, offset + value.length); + return this; + } + /** + * Writes a null-terminated String. + * + * @param value { String } The String value to write. + * @param arg2 { Number | String } The offset to write the string to, or the BufferEncoding to use. + * @param encoding { String } The BufferEncoding to use for writing strings (defaults to instance encoding). + * + * @return this + */ + writeStringNT(value, arg2, encoding) { + // Write Values + this.writeString(value, arg2, encoding); + this.writeUInt8(0x00, typeof arg2 === 'number' ? arg2 + value.length : this.writeOffset); + return this; + } + // Buffers + /** + * Reads a Buffer from the internal read position. + * + * @param length { Number } The length of data to read as a Buffer. + * + * @return { Buffer } + */ + readBuffer(length) { + if (typeof length !== 'undefined') { + utils_1.checkLengthValue(length); + } + const lengthVal = typeof length === 'number' ? length : this.length; + const endPoint = Math.min(this.length, this._readOffset + lengthVal); + // Read buffer value + const value = this._buff.slice(this._readOffset, endPoint); + // Increment internal Buffer read offset + this._readOffset = endPoint; + return value; + } + /** + * Writes a Buffer to the current write position. + * + * @param value { Buffer } The Buffer to write. + * @param offset { Number } The offset to write the Buffer to. + * + * @return this + */ + insertBuffer(value, offset) { + utils_1.checkOffsetValue(offset); + return this._handleBuffer(value, true, offset); + } + /** + * Writes a Buffer to the current write position. + * + * @param value { Buffer } The Buffer to write. + * @param offset { Number } The offset to write the Buffer to. + * + * @return this + */ + writeBuffer(value, offset) { + return this._handleBuffer(value, false, offset); + } + /** + * Reads a null-terminated Buffer from the current read poisiton. + * + * @return { Buffer } + */ + readBufferNT() { + // Set null character position to the end SmartBuffer instance. + let nullPos = this.length; + // Find next null character (if one is not found, default from above is used) + for (let i = this._readOffset; i < this.length; i++) { + if (this._buff[i] === 0x00) { + nullPos = i; + break; + } + } + // Read value + const value = this._buff.slice(this._readOffset, nullPos); + // Increment internal Buffer read offset + this._readOffset = nullPos + 1; + return value; + } + /** + * Inserts a null-terminated Buffer. + * + * @param value { Buffer } The Buffer to write. + * @param offset { Number } The offset to write the Buffer to. + * + * @return this + */ + insertBufferNT(value, offset) { + utils_1.checkOffsetValue(offset); + // Write Values + this.insertBuffer(value, offset); + this.insertUInt8(0x00, offset + value.length); + return this; + } + /** + * Writes a null-terminated Buffer. + * + * @param value { Buffer } The Buffer to write. + * @param offset { Number } The offset to write the Buffer to. + * + * @return this + */ + writeBufferNT(value, offset) { + // Checks for valid numberic value; + if (typeof offset !== 'undefined') { + utils_1.checkOffsetValue(offset); + } + // Write Values + this.writeBuffer(value, offset); + this.writeUInt8(0x00, typeof offset === 'number' ? offset + value.length : this._writeOffset); + return this; + } + /** + * Clears the SmartBuffer instance to its original empty state. + */ + clear() { + this._writeOffset = 0; + this._readOffset = 0; + this.length = 0; + return this; + } + /** + * Gets the remaining data left to be read from the SmartBuffer instance. + * + * @return { Number } + */ + remaining() { + return this.length - this._readOffset; + } + /** + * Gets the current read offset value of the SmartBuffer instance. + * + * @return { Number } + */ + get readOffset() { + return this._readOffset; + } + /** + * Sets the read offset value of the SmartBuffer instance. + * + * @param offset { Number } - The offset value to set. + */ + set readOffset(offset) { + utils_1.checkOffsetValue(offset); + // Check for bounds. + utils_1.checkTargetOffset(offset, this); + this._readOffset = offset; + } + /** + * Gets the current write offset value of the SmartBuffer instance. + * + * @return { Number } + */ + get writeOffset() { + return this._writeOffset; + } + /** + * Sets the write offset value of the SmartBuffer instance. + * + * @param offset { Number } - The offset value to set. + */ + set writeOffset(offset) { + utils_1.checkOffsetValue(offset); + // Check for bounds. + utils_1.checkTargetOffset(offset, this); + this._writeOffset = offset; + } + /** + * Gets the currently set string encoding of the SmartBuffer instance. + * + * @return { BufferEncoding } The string Buffer encoding currently set. + */ + get encoding() { + return this._encoding; + } + /** + * Sets the string encoding of the SmartBuffer instance. + * + * @param encoding { BufferEncoding } The string Buffer encoding to set. + */ + set encoding(encoding) { + utils_1.checkEncoding(encoding); + this._encoding = encoding; + } + /** + * Gets the underlying internal Buffer. (This includes unmanaged data in the Buffer) + * + * @return { Buffer } The Buffer value. + */ + get internalBuffer() { + return this._buff; + } + /** + * Gets the value of the internal managed Buffer (Includes managed data only) + * + * @param { Buffer } + */ + toBuffer() { + return this._buff.slice(0, this.length); + } + /** + * Gets the String value of the internal managed Buffer + * + * @param encoding { String } The BufferEncoding to display the Buffer as (defaults to instance level encoding). + */ + toString(encoding) { + const encodingVal = typeof encoding === 'string' ? encoding : this._encoding; + // Check for invalid encoding. + utils_1.checkEncoding(encodingVal); + return this._buff.toString(encodingVal, 0, this.length); + } + /** + * Destroys the SmartBuffer instance. + */ + destroy() { + this.clear(); + return this; + } + /** + * Handles inserting and writing strings. + * + * @param value { String } The String value to insert. + * @param isInsert { Boolean } True if inserting a string, false if writing. + * @param arg2 { Number | String } The offset to insert the string at, or the BufferEncoding to use. + * @param encoding { String } The BufferEncoding to use for writing strings (defaults to instance encoding). + */ + _handleString(value, isInsert, arg3, encoding) { + let offsetVal = this._writeOffset; + let encodingVal = this._encoding; + // Check for offset + if (typeof arg3 === 'number') { + offsetVal = arg3; + // Check for encoding + } + else if (typeof arg3 === 'string') { + utils_1.checkEncoding(arg3); + encodingVal = arg3; + } + // Check for encoding (third param) + if (typeof encoding === 'string') { + utils_1.checkEncoding(encoding); + encodingVal = encoding; + } + // Calculate bytelength of string. + const byteLength = Buffer.byteLength(value, encodingVal); + // Ensure there is enough internal Buffer capacity. + if (isInsert) { + this.ensureInsertable(byteLength, offsetVal); + } + else { + this._ensureWriteable(byteLength, offsetVal); + } + // Write value + this._buff.write(value, offsetVal, byteLength, encodingVal); + // Increment internal Buffer write offset; + if (isInsert) { + this._writeOffset += byteLength; + } + else { + // If an offset was given, check to see if we wrote beyond the current writeOffset. + if (typeof arg3 === 'number') { + this._writeOffset = Math.max(this._writeOffset, offsetVal + byteLength); + } + else { + // If no offset was given, we wrote to the end of the SmartBuffer so increment writeOffset. + this._writeOffset += byteLength; + } + } + return this; + } + /** + * Handles writing or insert of a Buffer. + * + * @param value { Buffer } The Buffer to write. + * @param offset { Number } The offset to write the Buffer to. + */ + _handleBuffer(value, isInsert, offset) { + const offsetVal = typeof offset === 'number' ? offset : this._writeOffset; + // Ensure there is enough internal Buffer capacity. + if (isInsert) { + this.ensureInsertable(value.length, offsetVal); + } + else { + this._ensureWriteable(value.length, offsetVal); + } + // Write buffer value + value.copy(this._buff, offsetVal); + // Increment internal Buffer write offset; + if (isInsert) { + this._writeOffset += value.length; + } + else { + // If an offset was given, check to see if we wrote beyond the current writeOffset. + if (typeof offset === 'number') { + this._writeOffset = Math.max(this._writeOffset, offsetVal + value.length); + } + else { + // If no offset was given, we wrote to the end of the SmartBuffer so increment writeOffset. + this._writeOffset += value.length; + } + } + return this; + } + /** + * Ensures that the internal Buffer is large enough to read data. + * + * @param length { Number } The length of the data that needs to be read. + * @param offset { Number } The offset of the data that needs to be read. + */ + ensureReadable(length, offset) { + // Offset value defaults to managed read offset. + let offsetVal = this._readOffset; + // If an offset was provided, use it. + if (typeof offset !== 'undefined') { + // Checks for valid numberic value; + utils_1.checkOffsetValue(offset); + // Overide with custom offset. + offsetVal = offset; + } + // Checks if offset is below zero, or the offset+length offset is beyond the total length of the managed data. + if (offsetVal < 0 || offsetVal + length > this.length) { + throw new Error(utils_1.ERRORS.INVALID_READ_BEYOND_BOUNDS); + } + } + /** + * Ensures that the internal Buffer is large enough to insert data. + * + * @param dataLength { Number } The length of the data that needs to be written. + * @param offset { Number } The offset of the data to be written. + */ + ensureInsertable(dataLength, offset) { + // Checks for valid numberic value; + utils_1.checkOffsetValue(offset); + // Ensure there is enough internal Buffer capacity. + this._ensureCapacity(this.length + dataLength); + // If an offset was provided and its not the very end of the buffer, copy data into appropriate location in regards to the offset. + if (offset < this.length) { + this._buff.copy(this._buff, offset + dataLength, offset, this._buff.length); + } + // Adjust tracked smart buffer length + if (offset + dataLength > this.length) { + this.length = offset + dataLength; + } + else { + this.length += dataLength; + } + } + /** + * Ensures that the internal Buffer is large enough to write data. + * + * @param dataLength { Number } The length of the data that needs to be written. + * @param offset { Number } The offset of the data to be written (defaults to writeOffset). + */ + _ensureWriteable(dataLength, offset) { + const offsetVal = typeof offset === 'number' ? offset : this._writeOffset; + // Ensure enough capacity to write data. + this._ensureCapacity(offsetVal + dataLength); + // Adjust SmartBuffer length (if offset + length is larger than managed length, adjust length) + if (offsetVal + dataLength > this.length) { + this.length = offsetVal + dataLength; + } + } + /** + * Ensures that the internal Buffer is large enough to write at least the given amount of data. + * + * @param minLength { Number } The minimum length of the data needs to be written. + */ + _ensureCapacity(minLength) { + const oldLength = this._buff.length; + if (minLength > oldLength) { + let data = this._buff; + let newLength = (oldLength * 3) / 2 + 1; + if (newLength < minLength) { + newLength = minLength; + } + this._buff = Buffer.allocUnsafe(newLength); + data.copy(this._buff, 0, 0, oldLength); + } + } + /** + * Reads a numeric number value using the provided function. + * + * @typeparam T { number | bigint } The type of the value to be read + * + * @param func { Function(offset: number) => number } The function to read data on the internal Buffer with. + * @param byteSize { Number } The number of bytes read. + * @param offset { Number } The offset to read from (optional). When this is not provided, the managed readOffset is used instead. + * + * @returns { T } the number value + */ + _readNumberValue(func, byteSize, offset) { + this.ensureReadable(byteSize, offset); + // Call Buffer.readXXXX(); + const value = func.call(this._buff, typeof offset === 'number' ? offset : this._readOffset); + // Adjust internal read offset if an optional read offset was not provided. + if (typeof offset === 'undefined') { + this._readOffset += byteSize; + } + return value; + } + /** + * Inserts a numeric number value based on the given offset and value. + * + * @typeparam T { number | bigint } The type of the value to be written + * + * @param func { Function(offset: T, offset?) => number} The function to write data on the internal Buffer with. + * @param byteSize { Number } The number of bytes written. + * @param value { T } The number value to write. + * @param offset { Number } the offset to write the number at (REQUIRED). + * + * @returns SmartBuffer this buffer + */ + _insertNumberValue(func, byteSize, value, offset) { + // Check for invalid offset values. + utils_1.checkOffsetValue(offset); + // Ensure there is enough internal Buffer capacity. (raw offset is passed) + this.ensureInsertable(byteSize, offset); + // Call buffer.writeXXXX(); + func.call(this._buff, value, offset); + // Adjusts internally managed write offset. + this._writeOffset += byteSize; + return this; + } + /** + * Writes a numeric number value based on the given offset and value. + * + * @typeparam T { number | bigint } The type of the value to be written + * + * @param func { Function(offset: T, offset?) => number} The function to write data on the internal Buffer with. + * @param byteSize { Number } The number of bytes written. + * @param value { T } The number value to write. + * @param offset { Number } the offset to write the number at (REQUIRED). + * + * @returns SmartBuffer this buffer + */ + _writeNumberValue(func, byteSize, value, offset) { + // If an offset was provided, validate it. + if (typeof offset === 'number') { + // Check if we're writing beyond the bounds of the managed data. + if (offset < 0) { + throw new Error(utils_1.ERRORS.INVALID_WRITE_BEYOND_BOUNDS); + } + utils_1.checkOffsetValue(offset); + } + // Default to writeOffset if no offset value was given. + const offsetVal = typeof offset === 'number' ? offset : this._writeOffset; + // Ensure there is enough internal Buffer capacity. (raw offset is passed) + this._ensureWriteable(byteSize, offsetVal); + func.call(this._buff, value, offsetVal); + // If an offset was given, check to see if we wrote beyond the current writeOffset. + if (typeof offset === 'number') { + this._writeOffset = Math.max(this._writeOffset, offsetVal + byteSize); + } + else { + // If no numeric offset was given, we wrote to the end of the SmartBuffer so increment writeOffset. + this._writeOffset += byteSize; + } + return this; + } +} +exports.SmartBuffer = SmartBuffer; +//# sourceMappingURL=smartbuffer.js.map \ No newline at end of file diff --git a/node_modules/smart-buffer/build/smartbuffer.js.map b/node_modules/smart-buffer/build/smartbuffer.js.map new file mode 100644 index 000000000..37f0d6e16 --- /dev/null +++ b/node_modules/smart-buffer/build/smartbuffer.js.map @@ -0,0 +1 @@ +{"version":3,"file":"smartbuffer.js","sourceRoot":"","sources":["../src/smartbuffer.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-buffer/build/utils.js b/node_modules/smart-buffer/build/utils.js new file mode 100644 index 000000000..6d5598123 --- /dev/null +++ b/node_modules/smart-buffer/build/utils.js @@ -0,0 +1,108 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const buffer_1 = require("buffer"); +/** + * Error strings + */ +const ERRORS = { + INVALID_ENCODING: 'Invalid encoding provided. Please specify a valid encoding the internal Node.js Buffer supports.', + INVALID_SMARTBUFFER_SIZE: 'Invalid size provided. Size must be a valid integer greater than zero.', + INVALID_SMARTBUFFER_BUFFER: 'Invalid Buffer provided in SmartBufferOptions.', + INVALID_SMARTBUFFER_OBJECT: 'Invalid SmartBufferOptions object supplied to SmartBuffer constructor or factory methods.', + INVALID_OFFSET: 'An invalid offset value was provided.', + INVALID_OFFSET_NON_NUMBER: 'An invalid offset value was provided. A numeric value is required.', + INVALID_LENGTH: 'An invalid length value was provided.', + INVALID_LENGTH_NON_NUMBER: 'An invalid length value was provived. A numeric value is required.', + INVALID_TARGET_OFFSET: 'Target offset is beyond the bounds of the internal SmartBuffer data.', + INVALID_TARGET_LENGTH: 'Specified length value moves cursor beyong the bounds of the internal SmartBuffer data.', + INVALID_READ_BEYOND_BOUNDS: 'Attempted to read beyond the bounds of the managed data.', + INVALID_WRITE_BEYOND_BOUNDS: 'Attempted to write beyond the bounds of the managed data.' +}; +exports.ERRORS = ERRORS; +/** + * Checks if a given encoding is a valid Buffer encoding. (Throws an exception if check fails) + * + * @param { String } encoding The encoding string to check. + */ +function checkEncoding(encoding) { + if (!buffer_1.Buffer.isEncoding(encoding)) { + throw new Error(ERRORS.INVALID_ENCODING); + } +} +exports.checkEncoding = checkEncoding; +/** + * Checks if a given number is a finite integer. (Throws an exception if check fails) + * + * @param { Number } value The number value to check. + */ +function isFiniteInteger(value) { + return typeof value === 'number' && isFinite(value) && isInteger(value); +} +exports.isFiniteInteger = isFiniteInteger; +/** + * Checks if an offset/length value is valid. (Throws an exception if check fails) + * + * @param value The value to check. + * @param offset True if checking an offset, false if checking a length. + */ +function checkOffsetOrLengthValue(value, offset) { + if (typeof value === 'number') { + // Check for non finite/non integers + if (!isFiniteInteger(value) || value < 0) { + throw new Error(offset ? ERRORS.INVALID_OFFSET : ERRORS.INVALID_LENGTH); + } + } + else { + throw new Error(offset ? ERRORS.INVALID_OFFSET_NON_NUMBER : ERRORS.INVALID_LENGTH_NON_NUMBER); + } +} +/** + * Checks if a length value is valid. (Throws an exception if check fails) + * + * @param { Number } length The value to check. + */ +function checkLengthValue(length) { + checkOffsetOrLengthValue(length, false); +} +exports.checkLengthValue = checkLengthValue; +/** + * Checks if a offset value is valid. (Throws an exception if check fails) + * + * @param { Number } offset The value to check. + */ +function checkOffsetValue(offset) { + checkOffsetOrLengthValue(offset, true); +} +exports.checkOffsetValue = checkOffsetValue; +/** + * Checks if a target offset value is out of bounds. (Throws an exception if check fails) + * + * @param { Number } offset The offset value to check. + * @param { SmartBuffer } buff The SmartBuffer instance to check against. + */ +function checkTargetOffset(offset, buff) { + if (offset < 0 || offset > buff.length) { + throw new Error(ERRORS.INVALID_TARGET_OFFSET); + } +} +exports.checkTargetOffset = checkTargetOffset; +/** + * Determines whether a given number is a integer. + * @param value The number to check. + */ +function isInteger(value) { + return typeof value === 'number' && isFinite(value) && Math.floor(value) === value; +} +/** + * Throws if Node.js version is too low to support bigint + */ +function bigIntAndBufferInt64Check(bufferMethod) { + if (typeof BigInt === 'undefined') { + throw new Error('Platform does not support JS BigInt type.'); + } + if (typeof buffer_1.Buffer.prototype[bufferMethod] === 'undefined') { + throw new Error(`Platform does not support Buffer.prototype.${bufferMethod}.`); + } +} +exports.bigIntAndBufferInt64Check = bigIntAndBufferInt64Check; +//# sourceMappingURL=utils.js.map \ No newline at end of file diff --git a/node_modules/smart-buffer/build/utils.js.map b/node_modules/smart-buffer/build/utils.js.map new file mode 100644 index 000000000..fc7388d3b --- /dev/null +++ b/node_modules/smart-buffer/build/utils.js.map @@ -0,0 +1 @@ +{"version":3,"file":"utils.js","sourceR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M,CAAC,yBAAyB,CAAC,CAAC,CAAC,MAAM,CAAC,yBAAyB,CAAC,CAAC;KAC/F;AACH,CAAC;AAED;;;;GAIG;AACH,SAAS,gBAAgB,CAAC,MAAW;IACnC,wBAAwB,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;AAC1C,CAAC;AA0DC,4CAAgB;AAxDlB;;;;GAIG;AACH,SAAS,gBAAgB,CAAC,MAAW;IACnC,wBAAwB,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;AACzC,CAAC;AAgDyC,4CAAgB;AA9C1D;;;;;GAKG;AACH,SAAS,iBAAiB,CAAC,MAAc,EAAE,IAAiB;IAC1D,IAAI,MAAM,GAAG,CAAC,IAAI,MAAM,GAAG,IAAI,CAAC,MAAM,EAAE;QACtC,MAAM,IAAI,KAAK,CAAC,MAAM,CAAC,qBAAqB,CAAC,CAAC;KAC/C;AACH,CAAC;AAqCmB,8CAAiB;AAnCrC;;;GAGG;AACH,SAAS,SAAS,CAAC,KAAa;IAC9B,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,QAAQ,CAAC,KAAK,CAAC,IAAI,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,KAAK,CAAC;AACrF,CAAC;AAcD;;GAEG;AACH,SAAS,yBAAyB,CAAC,YAA0B;IAC3D,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE;QACjC,MAAM,IAAI,KAAK,CAAC,2CAA2C,CAAC,CAAC;KAC9D;IAED,IAAI,OAAO,eAAM,CAAC,SAAS,CAAC,YAAY,CAAC,KAAK,WAAW,EAAE;QACzD,MAAM,IAAI,KAAK,CAAC,8CAA8C,YAAY,GAAG,CAAC,CAAC;KAChF;AACH,CAAC;AAIsC,8DAAyB"} \ No newline at end of file diff --git a/node_modules/smart-buffer/docs/CHANGELOG.md b/node_modules/smart-buffer/docs/CHANGELOG.md new file mode 100644 index 000000000..1199a4d6d --- /dev/null +++ b/node_modules/smart-buffer/docs/CHANGELOG.md @@ -0,0 +1,70 @@ +# Change Log +## 4.1.0 +> Released 07/24/2019 +* Adds int64 support for node v12+ +* Drops support for node v4 + +## 4.0 +> Released 10/21/2017 +* Major breaking changes arriving in v4. + +### New Features +* Ability to read data from a specific offset. ex: readInt8(5) +* Ability to write over data when an offset is given (see breaking changes) ex: writeInt8(5, 0); +* Ability to set internal read and write offsets. + + + +### Breaking Changes + +* Old constructor patterns have been completely removed. It's now required to use the SmartBuffer.fromXXX() factory constructors. Read more on the v4 docs. +* rewind(), skip(), moveTo() have been removed. +* Internal private properties are now prefixed with underscores (_). +* **All** writeXXX() methods that are given an offset will now **overwrite data** instead of insert +* insertXXX() methods have been added for when you want to insert data at a specific offset (this replaces the old behavior of writeXXX() when an offset was provided) + + +### Other Changes +* Standardizd error messaging +* Standardized offset/length bounds and sanity checking +* General overall cleanup of code. + +## 3.0.3 +> Released 02/19/2017 +* Adds missing type definitions for some internal functions. + +## 3.0.2 +> Released 02/17/2017 + +### Bug Fixes +* Fixes a bug where using readString with a length of zero resulted in reading the remaining data instead of returning an empty string. (Fixed by Seldszar) + +## 3.0.1 +> Released 02/15/2017 + +### Bug Fixes +* Fixes a bug leftover from the TypeScript refactor where .readIntXXX() resulted in .readUIntXXX() being called by mistake. + +## 3.0 +> Released 02/12/2017 + +### Bug Fixes +* readUIntXXXX() methods will now throw an exception if they attempt to read beyond the bounds of the valid buffer data available. + * **Note** This is technically a breaking change, so version is bumped to 3.x. + +## 2.0 +> Relased 01/30/2017 + +### New Features: + +* Entire package re-written in TypeScript (2.1) +* Backwards compatibility is preserved for now +* New factory methods for creating SmartBuffer instances + * SmartBuffer.fromSize() + * SmartBuffer.fromBuffer() + * SmartBuffer.fromOptions() +* New SmartBufferOptions constructor options +* Added additional tests + +### Bug Fixes: +* Fixes a bug where reading null terminated strings may result in an exception. diff --git a/node_modules/smart-buffer/docs/README_v3.md b/node_modules/smart-buffer/docs/README_v3.md new file mode 100644 index 000000000..b7c48b8b5 --- /dev/null +++ b/node_modules/smart-buffer/docs/README_v3.md @@ -0,0 +1,367 @@ +smart-buffer [![Build Status](https://travis-ci.org/JoshGlazebrook/smart-buffer.svg?branch=master)](https://travis-ci.org/JoshGlazebrook/smart-buffer) [![Coverage Status](https://coveralls.io/repos/github/JoshGlazebrook/smart-buffer/badge.svg?branch=master)](https://coveralls.io/github/JoshGlazebrook/smart-buffer?branch=master) +============= + +smart-buffer is a light Buffer wrapper that takes away the need to keep track of what position to read and write data to and from the underlying Buffer. It also adds null terminating string operations and **grows** as you add more data. + +![stats](https://nodei.co/npm/smart-buffer.png?downloads=true&downloadRank=true&stars=true "stats") + +### What it's useful for: + +I created smart-buffer because I wanted to simplify the process of using Buffer for building and reading network packets to send over a socket. Rather than having to keep track of which position I need to write a UInt16 to after adding a string of variable length, I simply don't have to. + +Key Features: +* Proxies all of the Buffer write and read functions. +* Keeps track of read and write positions for you. +* Grows the internal Buffer as you add data to it. +* Useful string operations. (Null terminating strings) +* Allows for inserting values at specific points in the internal Buffer. +* Built in TypeScript +* Type Definitions Provided + +Requirements: +* Node v4.0+ is supported at this time. (Versions prior to 2.0 will work on node 0.10) + + +#### Note: +smart-buffer can be used for writing to an underlying buffer as well as reading from it. It however does not function correctly if you're mixing both read and write operations with each other. + +## Breaking Changes with 2.0 +The latest version (2.0+) is written in TypeScript, and are compiled to ES6 Javascript. This means the earliest Node.js it supports will be 4.x (in strict mode.) If you're using version 6 and above it will work without any issues. From an API standpoint, 2.0 is backwards compatible. The only difference is SmartBuffer is not exported directly as the root module. + +## Breaking Changes with 3.0 +Starting with 3.0, if any of the readIntXXXX() methods are called and the requested data is larger than the bounds of the internally managed valid buffer data, an exception will now be thrown. + +## Installing: + +`npm install smart-buffer` + +or + +`yarn add smart-buffer` + +Note: The published NPM package includes the built javascript library. +If you cloned this repo and wish to build the library manually use: + +`tsc -p ./` + +## Using smart-buffer + +### Example + +Say you were building a packet that had to conform to the following protocol: + +`[PacketType:2][PacketLength:2][Data:XX]` + +To build this packet using the vanilla Buffer class, you would have to count up the length of the data payload beforehand. You would also need to keep track of the current "cursor" position in your Buffer so you write everything in the right places. With smart-buffer you don't have to do either of those things. + +```javascript +// 1.x (javascript) +var SmartBuffer = require('smart-buffer'); + +// 1.x (typescript) +import SmartBuffer = require('smart-buffer'); + +// 2.x+ (javascript) +const SmartBuffer = require('smart-buffer').SmartBuffer; + +// 2.x+ (typescript) +import { SmartBuffer, SmartBufferOptions} from 'smart-buffer'; + +function createLoginPacket(username, password, age, country) { + let packet = new SmartBuffer(); + packet.writeUInt16LE(0x0060); // Login Packet Type/ID + packet.writeStringNT(username); + packet.writeStringNT(password); + packet.writeUInt8(age); + packet.writeStringNT(country); + packet.writeUInt16LE(packet.length - 2, 2); + + return packet.toBuffer(); +} +``` +With the above function, you now can do this: +```javascript +let login = createLoginPacket("Josh", "secret123", 22, "United States"); + +// +``` +Notice that the `[PacketLength:2]` part of the packet was inserted after we had added everything else, and as shown in the Buffer dump above, is in the correct location along with everything else. + +Reading back the packet we created above is just as easy: +```javascript + +let reader = SmartBuffer.fromBuffer(login); + +let logininfo = { + packetType: reader.readUInt16LE(), + packetLength: reader.readUInt16LE(), + username: reader.readStringNT(), + password: reader.readStringNT(), + age: reader.readUInt8(), + country: reader.readStringNT() +}; + +/* +{ + packetType: 96, (0x0060) + packetLength: 30, + username: 'Josh', + password: 'secret123', + age: 22, + country: 'United States' +}; +*/ +``` + +# Api Reference: + +### Constructing a smart-buffer + +smart-buffer has a few different ways to construct an instance. Starting with version 2.0, the following factory methods are preffered. + +```javascript +let SmartBuffer = require('smart-buffer'); + +// Creating SmartBuffer from existing Buffer +let buff = SmartBuffer.fromBuffer(buffer); // Creates instance from buffer. (Uses default utf8 encoding) +let buff = SmartBuffer.fromBuffer(buffer, 'ascii'); // Creates instance from buffer with ascii encoding for Strings. + +// Creating SmartBuffer with specified internal Buffer size. +let buff = SmartBuffer.fromSize(1024); // Creates instance with internal Buffer size of 1024. +let buff = SmartBuffer.fromSize(1024, 'utf8'); // Creates instance with intenral Buffer size of 1024, and utf8 encoding. + +// Creating SmartBuffer with options object. This one specifies size and encoding. +let buff = SmartBuffer.fromOptions({ + size: 1024, + encoding: 'ascii' +}); + +// Creating SmartBuffer with options object. This one specified an existing Buffer. +let buff = SmartBuffer.fromOptions({ + buff: buffer +}); + +// Just want a regular SmartBuffer with all default options? +let buff = new SmartBuffer(); +``` + +## Backwards Compatibility: + +All constructors used prior to 2.0 still are supported. However it's not recommended to use these. + +```javascript +let writer = new SmartBuffer(); // Defaults to utf8, 4096 length internal Buffer. +let writer = new SmartBuffer(1024); // Defaults to utf8, 1024 length internal Buffer. +let writer = new SmartBuffer('ascii'); // Sets to ascii encoding, 4096 length internal buffer. +let writer = new SmartBuffer(1024, 'ascii'); // Sets to ascii encoding, 1024 length internal buffer. +``` + +## Reading Data + +smart-buffer supports all of the common read functions you will find in the vanilla Buffer class. The only difference is, you do not need to specify which location to start reading from. This is possible because as you read data out of a smart-buffer, it automatically progresses an internal read offset/position to know where to pick up from on the next read. + +## Reading Numeric Values + +When numeric values, you simply need to call the function you want, and the data is returned. + +Supported Operations: +* readInt8 +* readInt16BE +* readInt16LE +* readInt32BE +* readInt32LE +* readBigInt64LE +* readBigInt64BE +* readUInt8 +* readUInt16BE +* readUInt16LE +* readUInt32BE +* readUInt32LE +* readBigUInt64LE +* readBigUInt64BE +* readFloatBE +* readFloatLE +* readDoubleBE +* readDoubleLE + +```javascript +let reader = new SmartBuffer(somebuffer); +let num = reader.readInt8(); +``` + +## Reading String Values + +When reading String values, you can either choose to read a null terminated string, or a string of a specified length. + +### SmartBuffer.readStringNT( [encoding] ) +> `String` **String encoding to use** - Defaults to the encoding set in the constructor. + +returns `String` + +> Note: When readStringNT is called and there is no null character found, smart-buffer will read to the end of the internal Buffer. + +### SmartBuffer.readString( [length] ) +### SmartBuffer.readString( [encoding] ) +### SmartBuffer.readString( [length], [encoding] ) +> `Number` **Length of the string to read** + +> `String` **String encoding to use** - Defaults to the encoding set in the constructor, or utf8. + +returns `String` + +> Note: When readString is called without a specified length, smart-buffer will read to the end of the internal Buffer. + + + +## Reading Buffer Values + +### SmartBuffer.readBuffer( length ) +> `Number` **Length of data to read into a Buffer** + +returns `Buffer` + +> Note: This function uses `slice` to retrieve the Buffer. + + +### SmartBuffer.readBufferNT() + +returns `Buffer` + +> Note: This reads the next sequence of bytes in the buffer until a null (0x00) value is found. (Null terminated buffer) +> Note: This function uses `slice` to retrieve the Buffer. + + +## Writing Data + +smart-buffer supports all of the common write functions you will find in the vanilla Buffer class. The only difference is, you do not need to specify which location to write to in your Buffer by default. You do however have the option of **inserting** a piece of data into your smart-buffer at a given location. + + +## Writing Numeric Values + + +For numeric values, you simply need to call the function you want, and the data is written at the end of the internal Buffer's current write position. You can specify a offset/position to **insert** the given value at, but keep in mind this does not override data at the given position. This feature also does not work properly when inserting a value beyond the current internal length of the smart-buffer (length being the .length property of the smart-buffer instance you're writing to) + +Supported Operations: +* writeInt8 +* writeInt16BE +* writeInt16LE +* writeInt32BE +* writeInt32LE +* writeBigInt64BE +* writeBigInt64LE +* writeUInt8 +* writeUInt16BE +* writeUInt16LE +* writeUInt32BE +* writeUInt32LE +* writeBigUInt64BE +* writeBigUInt64LE +* writeFloatBE +* writeFloatLE +* writeDoubleBE +* writeDoubleLE + +The following signature is the same for all the above functions: + +### SmartBuffer.writeInt8( value, [offset] ) +> `Number` **A valid Int8 number** + +> `Number` **The position to insert this value at** + +returns this + +> Note: All write operations return `this` to allow for chaining. + +## Writing String Values + +When reading String values, you can either choose to write a null terminated string, or a non null terminated string. + +### SmartBuffer.writeStringNT( value, [offset], [encoding] ) +### SmartBuffer.writeStringNT( value, [offset] ) +### SmartBuffer.writeStringNT( value, [encoding] ) +> `String` **String value to write** + +> `Number` **The position to insert this String at** + +> `String` **The String encoding to use.** - Defaults to the encoding set in the constructor, or utf8. + +returns this + +### SmartBuffer.writeString( value, [offset], [encoding] ) +### SmartBuffer.writeString( value, [offset] ) +### SmartBuffer.writeString( value, [encoding] ) +> `String` **String value to write** + +> `Number` **The position to insert this String at** + +> `String` **The String encoding to use** - Defaults to the encoding set in the constructor, or utf8. + +returns this + + +## Writing Buffer Values + +### SmartBuffer.writeBuffer( value, [offset] ) +> `Buffer` **Buffer value to write** + +> `Number` **The position to insert this Buffer's content at** + +returns this + +### SmartBuffer.writeBufferNT( value, [offset] ) +> `Buffer` **Buffer value to write** + +> `Number` **The position to insert this Buffer's content at** + +returns this + + +## Utility Functions + +### SmartBuffer.clear() +Resets the SmartBuffer to its default state where it can be reused for reading or writing. + +### SmartBuffer.remaining() + +returns `Number` The amount of data left to read based on the current read Position. + +### SmartBuffer.skip( value ) +> `Number` **The amount of bytes to skip ahead** + +Skips the read position ahead by the given value. + +returns this + +### SmartBuffer.rewind( value ) +> `Number` **The amount of bytes to reward backwards** + +Rewinds the read position backwards by the given value. + +returns this + +### SmartBuffer.moveTo( position ) +> `Number` **The point to skip the read position to** + +Moves the read position to the given point. +returns this + +### SmartBuffer.toBuffer() + +returns `Buffer` A Buffer containing the contents of the internal Buffer. + +> Note: This uses the slice function. + +### SmartBuffer.toString( [encoding] ) +> `String` **The String encoding to use** - Defaults to the encoding set in the constructor, or utf8. + +returns `String` The internal Buffer in String representation. + +## Properties + +### SmartBuffer.length + +returns `Number` **The length of the data that is being tracked in the internal Buffer** - Does NOT return the absolute length of the internal Buffer being written to. + +## License + +This work is licensed under the [MIT license](http://en.wikipedia.org/wiki/MIT_License). \ No newline at end of file diff --git a/node_modules/smart-buffer/docs/ROADMAP.md b/node_modules/smart-buffer/docs/ROADMAP.md new file mode 100644 index 000000000..e69de29bb diff --git a/node_modules/smart-buffer/package.json b/node_modules/smart-buffer/package.json new file mode 100644 index 000000000..2f326f248 --- /dev/null +++ b/node_modules/smart-buffer/package.json @@ -0,0 +1,79 @@ +{ + "name": "smart-buffer", + "version": "4.2.0", + "description": "smart-buffer is a Buffer wrapper that adds automatic read & write offset tracking, string operations, data insertions, and more.", + "main": "build/smartbuffer.js", + "contributors": ["syvita"], + "homepage": "https://github.com/JoshGlazebrook/smart-buffer/", + "repository": { + "type": "git", + "url": "https://github.com/JoshGlazebrook/smart-buffer.git" + }, + "bugs": { + "url": "https://github.com/JoshGlazebrook/smart-buffer/issues" + }, + "keywords": [ + "buffer", + "smart", + "packet", + "serialize", + "network", + "cursor", + "simple" + ], + "engines": { + "node": ">= 6.0.0", + "npm": ">= 3.0.0" + }, + "author": "Josh Glazebrook", + "license": "MIT", + "readmeFilename": "README.md", + "devDependencies": { + "@types/chai": "4.1.7", + "@types/mocha": "5.2.7", + "@types/node": "^12.0.0", + "chai": "4.2.0", + "coveralls": "3.0.5", + "istanbul": "^0.4.5", + "mocha": "6.2.0", + "mocha-lcov-reporter": "^1.3.0", + "nyc": "14.1.1", + "source-map-support": "0.5.12", + "ts-node": "8.3.0", + "tslint": "5.18.0", + "typescript": "^3.2.1" + }, + "typings": "typings/smartbuffer.d.ts", + "dependencies": {}, + "scripts": { + "prepublish": "npm install -g typescript && npm run build", + "test": "NODE_ENV=test mocha --recursive --require ts-node/register test/**/*.ts", + "coverage": "NODE_ENV=test nyc npm test", + "coveralls": "NODE_ENV=test nyc npm test && nyc report --reporter=text-lcov | coveralls", + "lint": "tslint --type-check --project tsconfig.json 'src/**/*.ts'", + "build": "tsc -p ./" + }, + "nyc": { + "extension": [ + ".ts", + ".tsx" + ], + "include": [ + "src/*.ts", + "src/**/*.ts" + ], + "exclude": [ + "**.*.d.ts", + "node_modules", + "typings" + ], + "require": [ + "ts-node/register" + ], + "reporter": [ + "json", + "html" + ], + "all": true + } +} diff --git a/node_modules/smart-buffer/typings/smartbuffer.d.ts b/node_modules/smart-buffer/typings/smartbuffer.d.ts new file mode 100644 index 000000000..d07379b29 --- /dev/null +++ b/node_modules/smart-buffer/typings/smartbuffer.d.ts @@ -0,0 +1,755 @@ +/// +/** + * Object interface for constructing new SmartBuffer instances. + */ +interface SmartBufferOptions { + encoding?: BufferEncoding; + size?: number; + buff?: Buffer; +} +declare class SmartBuffer { + length: number; + private _encoding; + private _buff; + private _writeOffset; + private _readOffset; + /** + * Creates a new SmartBuffer instance. + * + * @param options { SmartBufferOptions } The SmartBufferOptions to apply to this instance. + */ + constructor(options?: SmartBufferOptions); + /** + * Creates a new SmartBuffer instance with the provided internal Buffer size and optional encoding. + * + * @param size { Number } The size of the internal Buffer. + * @param encoding { String } The BufferEncoding to use for strings. + * + * @return { SmartBuffer } + */ + static fromSize(size: number, encoding?: BufferEncoding): SmartBuffer; + /** + * Creates a new SmartBuffer instance with the provided Buffer and optional encoding. + * + * @param buffer { Buffer } The Buffer to use as the internal Buffer value. + * @param encoding { String } The BufferEncoding to use for strings. + * + * @return { SmartBuffer } + */ + static fromBuffer(buff: Buffer, encoding?: BufferEncoding): SmartBuffer; + /** + * Creates a new SmartBuffer instance with the provided SmartBufferOptions options. + * + * @param options { SmartBufferOptions } The options to use when creating the SmartBuffer instance. + */ + static fromOptions(options: SmartBufferOptions): SmartBuffer; + /** + * Type checking function that determines if an object is a SmartBufferOptions object. + */ + static isSmartBufferOptions(options: SmartBufferOptions): options is SmartBufferOptions; + /** + * Reads an Int8 value from the current read position or an optionally provided offset. + * + * @param offset { Number } The offset to read data from (optional) + * @return { Number } + */ + readInt8(offset?: number): number; + /** + * Reads an Int16BE value from the current read position or an optionally provided offset. + * + * @param offset { Number } The offset to read data from (optional) + * @return { Number } + */ + readInt16BE(offset?: number): number; + /** + * Reads an Int16LE value from the current read position or an optionally provided offset. + * + * @param offset { Number } The offset to read data from (optional) + * @return { Number } + */ + readInt16LE(offset?: number): number; + /** + * Reads an Int32BE value from the current read position or an optionally provided offset. + * + * @param offset { Number } The offset to read data from (optional) + * @return { Number } + */ + readInt32BE(offset?: number): number; + /** + * Reads an Int32LE value from the current read position or an optionally provided offset. + * + * @param offset { Number } The offset to read data from (optional) + * @return { Number } + */ + readInt32LE(offset?: number): number; + /** + * Reads a BigInt64BE value from the current read position or an optionally provided offset. + * + * @param offset { Number } The offset to read data from (optional) + * @return { BigInt } + */ + readBigInt64BE(offset?: number): bigint; + /** + * Reads a BigInt64LE value from the current read position or an optionally provided offset. + * + * @param offset { Number } The offset to read data from (optional) + * @return { BigInt } + */ + readBigInt64LE(offset?: number): bigint; + /** + * Writes an Int8 value to the current write position (or at optional offset). + * + * @param value { Number } The value to write. + * @param offset { Number } The offset to write the value at. + * + * @return this + */ + writeInt8(value: number, offset?: number): SmartBuffer; + /** + * Inserts an Int8 value at the given offset value. + * + * @param value { Number } The value to insert. + * @param offset { Number } The offset to insert the value at. + * + * @return this + */ + insertInt8(value: number, offset: number): SmartBuffer; + /** + * Writes an Int16BE value to the current write position (or at optional offset). + * + * @param value { Number } The value to write. + * @param offset { Number } The offset to write the value at. + * + * @return this + */ + writeInt16BE(value: number, offset?: number): SmartBuffer; + /** + * Inserts an Int16BE value at the given offset value. + * + * @param value { Number } The value to insert. + * @param offset { Number } The offset to insert the value at. + * + * @return this + */ + insertInt16BE(value: number, offset: number): SmartBuffer; + /** + * Writes an Int16LE value to the current write position (or at optional offset). + * + * @param value { Number } The value to write. + * @param offset { Number } The offset to write the value at. + * + * @return this + */ + writeInt16LE(value: number, offset?: number): SmartBuffer; + /** + * Inserts an Int16LE value at the given offset value. + * + * @param value { Number } The value to insert. + * @param offset { Number } The offset to insert the value at. + * + * @return this + */ + insertInt16LE(value: number, offset: number): SmartBuffer; + /** + * Writes an Int32BE value to the current write position (or at optional offset). + * + * @param value { Number } The value to write. + * @param offset { Number } The offset to write the value at. + * + * @return this + */ + writeInt32BE(value: number, offset?: number): SmartBuffer; + /** + * Inserts an Int32BE value at the given offset value. + * + * @param value { Number } The value to insert. + * @param offset { Number } The offset to insert the value at. + * + * @return this + */ + insertInt32BE(value: number, offset: number): SmartBuffer; + /** + * Writes an Int32LE value to the current write position (or at optional offset). + * + * @param value { Number } The value to write. + * @param offset { Number } The offset to write the value at. + * + * @return this + */ + writeInt32LE(value: number, offset?: number): SmartBuffer; + /** + * Inserts an Int32LE value at the given offset value. + * + * @param value { Number } The value to insert. + * @param offset { Number } The offset to insert the value at. + * + * @return this + */ + insertInt32LE(value: number, offset: number): SmartBuffer; + /** + * Writes a BigInt64BE value to the current write position (or at optional offset). + * + * @param value { BigInt } The value to write. + * @param offset { Number } The offset to write the value at. + * + * @return this + */ + writeBigInt64BE(value: bigint, offset?: number): SmartBuffer; + /** + * Inserts a BigInt64BE value at the given offset value. + * + * @param value { BigInt } The value to insert. + * @param offset { Number } The offset to insert the value at. + * + * @return this + */ + insertBigInt64BE(value: bigint, offset: number): SmartBuffer; + /** + * Writes a BigInt64LE value to the current write position (or at optional offset). + * + * @param value { BigInt } The value to write. + * @param offset { Number } The offset to write the value at. + * + * @return this + */ + writeBigInt64LE(value: bigint, offset?: number): SmartBuffer; + /** + * Inserts a Int64LE value at the given offset value. + * + * @param value { BigInt } The value to insert. + * @param offset { Number } The offset to insert the value at. + * + * @return this + */ + insertBigInt64LE(value: bigint, offset: number): SmartBuffer; + /** + * Reads an UInt8 value from the current read position or an optionally provided offset. + * + * @param offset { Number } The offset to read data from (optional) + * @return { Number } + */ + readUInt8(offset?: number): number; + /** + * Reads an UInt16BE value from the current read position or an optionally provided offset. + * + * @param offset { Number } The offset to read data from (optional) + * @return { Number } + */ + readUInt16BE(offset?: number): number; + /** + * Reads an UInt16LE value from the current read position or an optionally provided offset. + * + * @param offset { Number } The offset to read data from (optional) + * @return { Number } + */ + readUInt16LE(offset?: number): number; + /** + * Reads an UInt32BE value from the current read position or an optionally provided offset. + * + * @param offset { Number } The offset to read data from (optional) + * @return { Number } + */ + readUInt32BE(offset?: number): number; + /** + * Reads an UInt32LE value from the current read position or an optionally provided offset. + * + * @param offset { Number } The offset to read data from (optional) + * @return { Number } + */ + readUInt32LE(offset?: number): number; + /** + * Reads a BigUInt64BE value from the current read position or an optionally provided offset. + * + * @param offset { Number } The offset to read data from (optional) + * @return { BigInt } + */ + readBigUInt64BE(offset?: number): bigint; + /** + * Reads a BigUInt64LE value from the current read position or an optionally provided offset. + * + * @param offset { Number } The offset to read data from (optional) + * @return { BigInt } + */ + readBigUInt64LE(offset?: number): bigint; + /** + * Writes an UInt8 value to the current write position (or at optional offset). + * + * @param value { Number } The value to write. + * @param offset { Number } The offset to write the value at. + * + * @return this + */ + writeUInt8(value: number, offset?: number): SmartBuffer; + /** + * Inserts an UInt8 value at the given offset value. + * + * @param value { Number } The value to insert. + * @param offset { Number } The offset to insert the value at. + * + * @return this + */ + insertUInt8(value: number, offset: number): SmartBuffer; + /** + * Writes an UInt16BE value to the current write position (or at optional offset). + * + * @param value { Number } The value to write. + * @param offset { Number } The offset to write the value at. + * + * @return this + */ + writeUInt16BE(value: number, offset?: number): SmartBuffer; + /** + * Inserts an UInt16BE value at the given offset value. + * + * @param value { Number } The value to insert. + * @param offset { Number } The offset to insert the value at. + * + * @return this + */ + insertUInt16BE(value: number, offset: number): SmartBuffer; + /** + * Writes an UInt16LE value to the current write position (or at optional offset). + * + * @param value { Number } The value to write. + * @param offset { Number } The offset to write the value at. + * + * @return this + */ + writeUInt16LE(value: number, offset?: number): SmartBuffer; + /** + * Inserts an UInt16LE value at the given offset value. + * + * @param value { Number } The value to insert. + * @param offset { Number } The offset to insert the value at. + * + * @return this + */ + insertUInt16LE(value: number, offset: number): SmartBuffer; + /** + * Writes an UInt32BE value to the current write position (or at optional offset). + * + * @param value { Number } The value to write. + * @param offset { Number } The offset to write the value at. + * + * @return this + */ + writeUInt32BE(value: number, offset?: number): SmartBuffer; + /** + * Inserts an UInt32BE value at the given offset value. + * + * @param value { Number } The value to insert. + * @param offset { Number } The offset to insert the value at. + * + * @return this + */ + insertUInt32BE(value: number, offset: number): SmartBuffer; + /** + * Writes an UInt32LE value to the current write position (or at optional offset). + * + * @param value { Number } The value to write. + * @param offset { Number } The offset to write the value at. + * + * @return this + */ + writeUInt32LE(value: number, offset?: number): SmartBuffer; + /** + * Inserts an UInt32LE value at the given offset value. + * + * @param value { Number } The value to insert. + * @param offset { Number } The offset to insert the value at. + * + * @return this + */ + insertUInt32LE(value: number, offset: number): SmartBuffer; + /** + * Writes a BigUInt64BE value to the current write position (or at optional offset). + * + * @param value { Number } The value to write. + * @param offset { Number } The offset to write the value at. + * + * @return this + */ + writeBigUInt64BE(value: bigint, offset?: number): SmartBuffer; + /** + * Inserts a BigUInt64BE value at the given offset value. + * + * @param value { Number } The value to insert. + * @param offset { Number } The offset to insert the value at. + * + * @return this + */ + insertBigUInt64BE(value: bigint, offset: number): SmartBuffer; + /** + * Writes a BigUInt64LE value to the current write position (or at optional offset). + * + * @param value { Number } The value to write. + * @param offset { Number } The offset to write the value at. + * + * @return this + */ + writeBigUInt64LE(value: bigint, offset?: number): SmartBuffer; + /** + * Inserts a BigUInt64LE value at the given offset value. + * + * @param value { Number } The value to insert. + * @param offset { Number } The offset to insert the value at. + * + * @return this + */ + insertBigUInt64LE(value: bigint, offset: number): SmartBuffer; + /** + * Reads an FloatBE value from the current read position or an optionally provided offset. + * + * @param offset { Number } The offset to read data from (optional) + * @return { Number } + */ + readFloatBE(offset?: number): number; + /** + * Reads an FloatLE value from the current read position or an optionally provided offset. + * + * @param offset { Number } The offset to read data from (optional) + * @return { Number } + */ + readFloatLE(offset?: number): number; + /** + * Writes a FloatBE value to the current write position (or at optional offset). + * + * @param value { Number } The value to write. + * @param offset { Number } The offset to write the value at. + * + * @return this + */ + writeFloatBE(value: number, offset?: number): SmartBuffer; + /** + * Inserts a FloatBE value at the given offset value. + * + * @param value { Number } The value to insert. + * @param offset { Number } The offset to insert the value at. + * + * @return this + */ + insertFloatBE(value: number, offset: number): SmartBuffer; + /** + * Writes a FloatLE value to the current write position (or at optional offset). + * + * @param value { Number } The value to write. + * @param offset { Number } The offset to write the value at. + * + * @return this + */ + writeFloatLE(value: number, offset?: number): SmartBuffer; + /** + * Inserts a FloatLE value at the given offset value. + * + * @param value { Number } The value to insert. + * @param offset { Number } The offset to insert the value at. + * + * @return this + */ + insertFloatLE(value: number, offset: number): SmartBuffer; + /** + * Reads an DoublEBE value from the current read position or an optionally provided offset. + * + * @param offset { Number } The offset to read data from (optional) + * @return { Number } + */ + readDoubleBE(offset?: number): number; + /** + * Reads an DoubleLE value from the current read position or an optionally provided offset. + * + * @param offset { Number } The offset to read data from (optional) + * @return { Number } + */ + readDoubleLE(offset?: number): number; + /** + * Writes a DoubleBE value to the current write position (or at optional offset). + * + * @param value { Number } The value to write. + * @param offset { Number } The offset to write the value at. + * + * @return this + */ + writeDoubleBE(value: number, offset?: number): SmartBuffer; + /** + * Inserts a DoubleBE value at the given offset value. + * + * @param value { Number } The value to insert. + * @param offset { Number } The offset to insert the value at. + * + * @return this + */ + insertDoubleBE(value: number, offset: number): SmartBuffer; + /** + * Writes a DoubleLE value to the current write position (or at optional offset). + * + * @param value { Number } The value to write. + * @param offset { Number } The offset to write the value at. + * + * @return this + */ + writeDoubleLE(value: number, offset?: number): SmartBuffer; + /** + * Inserts a DoubleLE value at the given offset value. + * + * @param value { Number } The value to insert. + * @param offset { Number } The offset to insert the value at. + * + * @return this + */ + insertDoubleLE(value: number, offset: number): SmartBuffer; + /** + * Reads a String from the current read position. + * + * @param arg1 { Number | String } The number of bytes to read as a String, or the BufferEncoding to use for + * the string (Defaults to instance level encoding). + * @param encoding { String } The BufferEncoding to use for the string (Defaults to instance level encoding). + * + * @return { String } + */ + readString(arg1?: number | BufferEncoding, encoding?: BufferEncoding): string; + /** + * Inserts a String + * + * @param value { String } The String value to insert. + * @param offset { Number } The offset to insert the string at. + * @param encoding { String } The BufferEncoding to use for writing strings (defaults to instance encoding). + * + * @return this + */ + insertString(value: string, offset: number, encoding?: BufferEncoding): SmartBuffer; + /** + * Writes a String + * + * @param value { String } The String value to write. + * @param arg2 { Number | String } The offset to write the string at, or the BufferEncoding to use. + * @param encoding { String } The BufferEncoding to use for writing strings (defaults to instance encoding). + * + * @return this + */ + writeString(value: string, arg2?: number | BufferEncoding, encoding?: BufferEncoding): SmartBuffer; + /** + * Reads a null-terminated String from the current read position. + * + * @param encoding { String } The BufferEncoding to use for the string (Defaults to instance level encoding). + * + * @return { String } + */ + readStringNT(encoding?: BufferEncoding): string; + /** + * Inserts a null-terminated String. + * + * @param value { String } The String value to write. + * @param arg2 { Number | String } The offset to write the string to, or the BufferEncoding to use. + * @param encoding { String } The BufferEncoding to use for writing strings (defaults to instance encoding). + * + * @return this + */ + insertStringNT(value: string, offset: number, encoding?: BufferEncoding): SmartBuffer; + /** + * Writes a null-terminated String. + * + * @param value { String } The String value to write. + * @param arg2 { Number | String } The offset to write the string to, or the BufferEncoding to use. + * @param encoding { String } The BufferEncoding to use for writing strings (defaults to instance encoding). + * + * @return this + */ + writeStringNT(value: string, arg2?: number | BufferEncoding, encoding?: BufferEncoding): SmartBuffer; + /** + * Reads a Buffer from the internal read position. + * + * @param length { Number } The length of data to read as a Buffer. + * + * @return { Buffer } + */ + readBuffer(length?: number): Buffer; + /** + * Writes a Buffer to the current write position. + * + * @param value { Buffer } The Buffer to write. + * @param offset { Number } The offset to write the Buffer to. + * + * @return this + */ + insertBuffer(value: Buffer, offset: number): SmartBuffer; + /** + * Writes a Buffer to the current write position. + * + * @param value { Buffer } The Buffer to write. + * @param offset { Number } The offset to write the Buffer to. + * + * @return this + */ + writeBuffer(value: Buffer, offset?: number): SmartBuffer; + /** + * Reads a null-terminated Buffer from the current read poisiton. + * + * @return { Buffer } + */ + readBufferNT(): Buffer; + /** + * Inserts a null-terminated Buffer. + * + * @param value { Buffer } The Buffer to write. + * @param offset { Number } The offset to write the Buffer to. + * + * @return this + */ + insertBufferNT(value: Buffer, offset: number): SmartBuffer; + /** + * Writes a null-terminated Buffer. + * + * @param value { Buffer } The Buffer to write. + * @param offset { Number } The offset to write the Buffer to. + * + * @return this + */ + writeBufferNT(value: Buffer, offset?: number): SmartBuffer; + /** + * Clears the SmartBuffer instance to its original empty state. + */ + clear(): SmartBuffer; + /** + * Gets the remaining data left to be read from the SmartBuffer instance. + * + * @return { Number } + */ + remaining(): number; + /** + * Gets the current read offset value of the SmartBuffer instance. + * + * @return { Number } + */ + /** + * Sets the read offset value of the SmartBuffer instance. + * + * @param offset { Number } - The offset value to set. + */ + readOffset: number; + /** + * Gets the current write offset value of the SmartBuffer instance. + * + * @return { Number } + */ + /** + * Sets the write offset value of the SmartBuffer instance. + * + * @param offset { Number } - The offset value to set. + */ + writeOffset: number; + /** + * Gets the currently set string encoding of the SmartBuffer instance. + * + * @return { BufferEncoding } The string Buffer encoding currently set. + */ + /** + * Sets the string encoding of the SmartBuffer instance. + * + * @param encoding { BufferEncoding } The string Buffer encoding to set. + */ + encoding: BufferEncoding; + /** + * Gets the underlying internal Buffer. (This includes unmanaged data in the Buffer) + * + * @return { Buffer } The Buffer value. + */ + readonly internalBuffer: Buffer; + /** + * Gets the value of the internal managed Buffer (Includes managed data only) + * + * @param { Buffer } + */ + toBuffer(): Buffer; + /** + * Gets the String value of the internal managed Buffer + * + * @param encoding { String } The BufferEncoding to display the Buffer as (defaults to instance level encoding). + */ + toString(encoding?: BufferEncoding): string; + /** + * Destroys the SmartBuffer instance. + */ + destroy(): SmartBuffer; + /** + * Handles inserting and writing strings. + * + * @param value { String } The String value to insert. + * @param isInsert { Boolean } True if inserting a string, false if writing. + * @param arg2 { Number | String } The offset to insert the string at, or the BufferEncoding to use. + * @param encoding { String } The BufferEncoding to use for writing strings (defaults to instance encoding). + */ + private _handleString; + /** + * Handles writing or insert of a Buffer. + * + * @param value { Buffer } The Buffer to write. + * @param offset { Number } The offset to write the Buffer to. + */ + private _handleBuffer; + /** + * Ensures that the internal Buffer is large enough to read data. + * + * @param length { Number } The length of the data that needs to be read. + * @param offset { Number } The offset of the data that needs to be read. + */ + private ensureReadable; + /** + * Ensures that the internal Buffer is large enough to insert data. + * + * @param dataLength { Number } The length of the data that needs to be written. + * @param offset { Number } The offset of the data to be written. + */ + private ensureInsertable; + /** + * Ensures that the internal Buffer is large enough to write data. + * + * @param dataLength { Number } The length of the data that needs to be written. + * @param offset { Number } The offset of the data to be written (defaults to writeOffset). + */ + private _ensureWriteable; + /** + * Ensures that the internal Buffer is large enough to write at least the given amount of data. + * + * @param minLength { Number } The minimum length of the data needs to be written. + */ + private _ensureCapacity; + /** + * Reads a numeric number value using the provided function. + * + * @typeparam T { number | bigint } The type of the value to be read + * + * @param func { Function(offset: number) => number } The function to read data on the internal Buffer with. + * @param byteSize { Number } The number of bytes read. + * @param offset { Number } The offset to read from (optional). When this is not provided, the managed readOffset is used instead. + * + * @returns { T } the number value + */ + private _readNumberValue; + /** + * Inserts a numeric number value based on the given offset and value. + * + * @typeparam T { number | bigint } The type of the value to be written + * + * @param func { Function(offset: T, offset?) => number} The function to write data on the internal Buffer with. + * @param byteSize { Number } The number of bytes written. + * @param value { T } The number value to write. + * @param offset { Number } the offset to write the number at (REQUIRED). + * + * @returns SmartBuffer this buffer + */ + private _insertNumberValue; + /** + * Writes a numeric number value based on the given offset and value. + * + * @typeparam T { number | bigint } The type of the value to be written + * + * @param func { Function(offset: T, offset?) => number} The function to write data on the internal Buffer with. + * @param byteSize { Number } The number of bytes written. + * @param value { T } The number value to write. + * @param offset { Number } the offset to write the number at (REQUIRED). + * + * @returns SmartBuffer this buffer + */ + private _writeNumberValue; +} +export { SmartBufferOptions, SmartBuffer }; diff --git a/node_modules/smart-buffer/typings/utils.d.ts b/node_modules/smart-buffer/typings/utils.d.ts new file mode 100644 index 000000000..b32b4d44c --- /dev/null +++ b/node_modules/smart-buffer/typings/utils.d.ts @@ -0,0 +1,66 @@ +/// +import { SmartBuffer } from './smartbuffer'; +import { Buffer } from 'buffer'; +/** + * Error strings + */ +declare const ERRORS: { + INVALID_ENCODING: string; + INVALID_SMARTBUFFER_SIZE: string; + INVALID_SMARTBUFFER_BUFFER: string; + INVALID_SMARTBUFFER_OBJECT: string; + INVALID_OFFSET: string; + INVALID_OFFSET_NON_NUMBER: string; + INVALID_LENGTH: string; + INVALID_LENGTH_NON_NUMBER: string; + INVALID_TARGET_OFFSET: string; + INVALID_TARGET_LENGTH: string; + INVALID_READ_BEYOND_BOUNDS: string; + INVALID_WRITE_BEYOND_BOUNDS: string; +}; +/** + * Checks if a given encoding is a valid Buffer encoding. (Throws an exception if check fails) + * + * @param { String } encoding The encoding string to check. + */ +declare function checkEncoding(encoding: BufferEncoding): void; +/** + * Checks if a given number is a finite integer. (Throws an exception if check fails) + * + * @param { Number } value The number value to check. + */ +declare function isFiniteInteger(value: number): boolean; +/** + * Checks if a length value is valid. (Throws an exception if check fails) + * + * @param { Number } length The value to check. + */ +declare function checkLengthValue(length: any): void; +/** + * Checks if a offset value is valid. (Throws an exception if check fails) + * + * @param { Number } offset The value to check. + */ +declare function checkOffsetValue(offset: any): void; +/** + * Checks if a target offset value is out of bounds. (Throws an exception if check fails) + * + * @param { Number } offset The offset value to check. + * @param { SmartBuffer } buff The SmartBuffer instance to check against. + */ +declare function checkTargetOffset(offset: number, buff: SmartBuffer): void; +interface Buffer { + readBigInt64BE(offset?: number): bigint; + readBigInt64LE(offset?: number): bigint; + readBigUInt64BE(offset?: number): bigint; + readBigUInt64LE(offset?: number): bigint; + writeBigInt64BE(value: bigint, offset?: number): number; + writeBigInt64LE(value: bigint, offset?: number): number; + writeBigUInt64BE(value: bigint, offset?: number): number; + writeBigUInt64LE(value: bigint, offset?: number): number; +} +/** + * Throws if Node.js version is too low to support bigint + */ +declare function bigIntAndBufferInt64Check(bufferMethod: keyof Buffer): void; +export { ERRORS, isFiniteInteger, checkEncoding, checkOffsetValue, checkLengthValue, checkTargetOffset, bigIntAndBufferInt64Check }; diff --git a/node_modules/socks/.prettierrc.yaml b/node_modules/socks/.prettierrc.yaml new file mode 100644 index 000000000..d7b733504 --- /dev/null +++ b/node_modules/socks/.prettierrc.yaml @@ -0,0 +1,7 @@ +parser: typescript +printWidth: 80 +tabWidth: 2 +singleQuote: true +trailingComma: all +arrowParens: always +bracketSpacing: false \ No newline at end of file diff --git a/node_modules/socks/.travis.yml b/node_modules/socks/.travis.yml new file mode 100644 index 000000000..2c6099bcd --- /dev/null +++ b/node_modules/socks/.travis.yml @@ -0,0 +1,11 @@ +language: node_js +node_js: + - 10 + - 12 + - 14 + - stable + +before_install: + - npm add -g typescript prettier tslint coveralls + +script: "npm run build && npm run coveralls" \ No newline at end of file diff --git a/node_modules/socks/LICENSE b/node_modules/socks/LICENSE new file mode 100644 index 000000000..b2442a9e7 --- /dev/null +++ b/node_modules/socks/LICENSE @@ -0,0 +1,20 @@ +The MIT License (MIT) + +Copyright (c) 2013 Josh Glazebrook + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/socks/README.md b/node_modules/socks/README.md new file mode 100644 index 000000000..67ecdcb29 --- /dev/null +++ b/node_modules/socks/README.md @@ -0,0 +1,684 @@ +# socks [![Build Status](https://travis-ci.org/JoshGlazebrook/socks.svg?branch=master)](https://travis-ci.org/JoshGlazebrook/socks) [![Coverage Status](https://coveralls.io/repos/github/JoshGlazebrook/socks/badge.svg?branch=master)](https://coveralls.io/github/JoshGlazebrook/socks?branch=v2) + +Fully featured SOCKS proxy client supporting SOCKSv4, SOCKSv4a, and SOCKSv5. Includes Bind and Associate functionality. + +### Features + +* Supports SOCKS v4, v4a, v5, and v5h protocols. +* Supports the CONNECT, BIND, and ASSOCIATE commands. +* Supports callbacks, promises, and events for proxy connection creation async flow control. +* Supports proxy chaining (CONNECT only). +* Supports user/password authentication. +* Supports custom authentication. +* Built in UDP frame creation & parse functions. +* Created with TypeScript, type definitions are provided. + +### Requirements + +* Node.js v10.0+ (Please use [v1](https://github.com/JoshGlazebrook/socks/tree/82d83923ad960693d8b774cafe17443ded7ed584) for older versions of Node.js) + +### Looking for v1? +* Docs for v1 are available [here](https://github.com/JoshGlazebrook/socks/tree/82d83923ad960693d8b774cafe17443ded7ed584) + +## Installation + +`yarn add socks` + +or + +`npm install --save socks` + +## Usage + +```typescript +// TypeScript +import { SocksClient, SocksClientOptions, SocksClientChainOptions } from 'socks'; + +// ES6 JavaScript +import { SocksClient } from 'socks'; + +// Legacy JavaScript +const SocksClient = require('socks').SocksClient; +``` + +## Quick Start Example + +Connect to github.com (192.30.253.113) on port 80, using a SOCKS proxy. + +```javascript +const options = { + proxy: { + host: '159.203.75.200', // ipv4 or ipv6 or hostname + port: 1080, + type: 5 // Proxy version (4 or 5) + }, + + command: 'connect', // SOCKS command (createConnection factory function only supports the connect command) + + destination: { + host: '192.30.253.113', // github.com (hostname lookups are supported with SOCKS v4a and 5) + port: 80 + } +}; + +// Async/Await +try { + const info = await SocksClient.createConnection(options); + + console.log(info.socket); + // (this is a raw net.Socket that is established to the destination host through the given proxy server) +} catch (err) { + // Handle errors +} + +// Promises +SocksClient.createConnection(options) +.then(info => { + console.log(info.socket); + // (this is a raw net.Socket that is established to the destination host through the given proxy server) +}) +.catch(err => { + // Handle errors +}); + +// Callbacks +SocksClient.createConnection(options, (err, info) => { + if (!err) { + console.log(info.socket); + // (this is a raw net.Socket that is established to the destination host through the given proxy server) + } else { + // Handle errors + } +}); +``` + +## Chaining Proxies + +**Note:** Chaining is only supported when using the SOCKS connect command, and chaining can only be done through the special factory chaining function. + +This example makes a proxy chain through two SOCKS proxies to ip-api.com. Once the connection to the destination is established it sends an HTTP request to get a JSON response that returns ip info for the requesting ip. + +```javascript +const options = { + destination: { + host: 'ip-api.com', // host names are supported with SOCKS v4a and SOCKS v5. + port: 80 + }, + command: 'connect', // Only the connect command is supported when chaining proxies. + proxies: [ // The chain order is the order in the proxies array, meaning the last proxy will establish a connection to the destination. + { + host: '159.203.75.235', // ipv4, ipv6, or hostname + port: 1081, + type: 5 + }, + { + host: '104.131.124.203', // ipv4, ipv6, or hostname + port: 1081, + type: 5 + } + ] +} + +// Async/Await +try { + const info = await SocksClient.createConnectionChain(options); + + console.log(info.socket); + // (this is a raw net.Socket that is established to the destination host through the given proxy servers) + + console.log(info.socket.remoteAddress) // The remote address of the returned socket is the first proxy in the chain. + // 159.203.75.235 + + info.socket.write('GET /json HTTP/1.1\nHost: ip-api.com\n\n'); + info.socket.on('data', (data) => { + console.log(data.toString()); // ip-api.com sees that the last proxy in the chain (104.131.124.203) is connected to it. + /* + HTTP/1.1 200 OK + Access-Control-Allow-Origin: * + Content-Type: application/json; charset=utf-8 + Date: Sun, 24 Dec 2017 03:47:51 GMT + Content-Length: 300 + + { + "as":"AS14061 Digital Ocean, Inc.", + "city":"Clifton", + "country":"United States", + "countryCode":"US", + "isp":"Digital Ocean", + "lat":40.8326, + "lon":-74.1307, + "org":"Digital Ocean", + "query":"104.131.124.203", + "region":"NJ", + "regionName":"New Jersey", + "status":"success", + "timezone":"America/New_York", + "zip":"07014" + } + */ + }); +} catch (err) { + // Handle errors +} + +// Promises +SocksClient.createConnectionChain(options) +.then(info => { + console.log(info.socket); + // (this is a raw net.Socket that is established to the destination host through the given proxy server) + + console.log(info.socket.remoteAddress) // The remote address of the returned socket is the first proxy in the chain. + // 159.203.75.235 + + info.socket.write('GET /json HTTP/1.1\nHost: ip-api.com\n\n'); + info.socket.on('data', (data) => { + console.log(data.toString()); // ip-api.com sees that the last proxy in the chain (104.131.124.203) is connected to it. + /* + HTTP/1.1 200 OK + Access-Control-Allow-Origin: * + Content-Type: application/json; charset=utf-8 + Date: Sun, 24 Dec 2017 03:47:51 GMT + Content-Length: 300 + + { + "as":"AS14061 Digital Ocean, Inc.", + "city":"Clifton", + "country":"United States", + "countryCode":"US", + "isp":"Digital Ocean", + "lat":40.8326, + "lon":-74.1307, + "org":"Digital Ocean", + "query":"104.131.124.203", + "region":"NJ", + "regionName":"New Jersey", + "status":"success", + "timezone":"America/New_York", + "zip":"07014" + } + */ + }); +}) +.catch(err => { + // Handle errors +}); + +// Callbacks +SocksClient.createConnectionChain(options, (err, info) => { + if (!err) { + console.log(info.socket); + // (this is a raw net.Socket that is established to the destination host through the given proxy server) + + console.log(info.socket.remoteAddress) // The remote address of the returned socket is the first proxy in the chain. + // 159.203.75.235 + + info.socket.write('GET /json HTTP/1.1\nHost: ip-api.com\n\n'); + info.socket.on('data', (data) => { + console.log(data.toString()); // ip-api.com sees that the last proxy in the chain (104.131.124.203) is connected to it. + /* + HTTP/1.1 200 OK + Access-Control-Allow-Origin: * + Content-Type: application/json; charset=utf-8 + Date: Sun, 24 Dec 2017 03:47:51 GMT + Content-Length: 300 + + { + "as":"AS14061 Digital Ocean, Inc.", + "city":"Clifton", + "country":"United States", + "countryCode":"US", + "isp":"Digital Ocean", + "lat":40.8326, + "lon":-74.1307, + "org":"Digital Ocean", + "query":"104.131.124.203", + "region":"NJ", + "regionName":"New Jersey", + "status":"success", + "timezone":"America/New_York", + "zip":"07014" + } + */ + }); + } else { + // Handle errors + } +}); +``` + +## Bind Example (TCP Relay) + +When the bind command is sent to a SOCKS v4/v5 proxy server, the proxy server starts listening on a new TCP port and the proxy relays then remote host information back to the client. When another remote client connects to the proxy server on this port the SOCKS proxy sends a notification that an incoming connection has been accepted to the initial client and a full duplex stream is now established to the initial client and the client that connected to that special port. + +```javascript +const options = { + proxy: { + host: '159.203.75.235', // ipv4, ipv6, or hostname + port: 1081, + type: 5 + }, + + command: 'bind', + + // When using BIND, the destination should be the remote client that is expected to connect to the SOCKS proxy. Using 0.0.0.0 makes the Proxy accept any incoming connection on that port. + destination: { + host: '0.0.0.0', + port: 0 + } +}; + +// Creates a new SocksClient instance. +const client = new SocksClient(options); + +// When the SOCKS proxy has bound a new port and started listening, this event is fired. +client.on('bound', info => { + console.log(info.remoteHost); + /* + { + host: "159.203.75.235", + port: 57362 + } + */ +}); + +// When a client connects to the newly bound port on the SOCKS proxy, this event is fired. +client.on('established', info => { + // info.remoteHost is the remote address of the client that connected to the SOCKS proxy. + console.log(info.remoteHost); + /* + host: 67.171.34.23, + port: 49823 + */ + + console.log(info.socket); + // (This is a raw net.Socket that is a connection between the initial client and the remote client that connected to the proxy) + + // Handle received data... + info.socket.on('data', data => { + console.log('recv', data); + }); +}); + +// An error occurred trying to establish this SOCKS connection. +client.on('error', err => { + console.error(err); +}); + +// Start connection to proxy +client.connect(); +``` + +## Associate Example (UDP Relay) + +When the associate command is sent to a SOCKS v5 proxy server, it sets up a UDP relay that allows the client to send UDP packets to a remote host through the proxy server, and also receive UDP packet responses back through the proxy server. + +```javascript +const options = { + proxy: { + host: '159.203.75.235', // ipv4, ipv6, or hostname + port: 1081, + type: 5 + }, + + command: 'associate', + + // When using associate, the destination should be the remote client that is expected to send UDP packets to the proxy server to be forwarded. This should be your local ip, or optionally the wildcard address (0.0.0.0) UDP Client <-> Proxy <-> UDP Client + destination: { + host: '0.0.0.0', + port: 0 + } +}; + +// Create a local UDP socket for sending packets to the proxy. +const udpSocket = dgram.createSocket('udp4'); +udpSocket.bind(); + +// Listen for incoming UDP packets from the proxy server. +udpSocket.on('message', (message, rinfo) => { + console.log(SocksClient.parseUDPFrame(message)); + /* + { frameNumber: 0, + remoteHost: { host: '165.227.108.231', port: 4444 }, // The remote host that replied with a UDP packet + data: // The data + } + */ +}); + +let client = new SocksClient(associateOptions); + +// When the UDP relay is established, this event is fired and includes the UDP relay port to send data to on the proxy server. +client.on('established', info => { + console.log(info.remoteHost); + /* + { + host: '159.203.75.235', + port: 44711 + } + */ + + // Send 'hello' to 165.227.108.231:4444 + const packet = SocksClient.createUDPFrame({ + remoteHost: { host: '165.227.108.231', port: 4444 }, + data: Buffer.from(line) + }); + udpSocket.send(packet, info.remoteHost.port, info.remoteHost.host); +}); + +// Start connection +client.connect(); +``` + +**Note:** The associate TCP connection to the proxy must remain open for the UDP relay to work. + +## Additional Examples + +[Documentation](docs/index.md) + + +## Migrating from v1 + +Looking for a guide to migrate from v1? Look [here](docs/migratingFromV1.md) + +## Api Reference: + +**Note:** socks includes full TypeScript definitions. These can even be used without using TypeScript as most IDEs (such as VS Code) will use these type definition files for auto completion intellisense even in JavaScript files. + +* Class: SocksClient + * [new SocksClient(options[, callback])](#new-socksclientoptions) + * [Class Method: SocksClient.createConnection(options[, callback])](#class-method-socksclientcreateconnectionoptions-callback) + * [Class Method: SocksClient.createConnectionChain(options[, callback])](#class-method-socksclientcreateconnectionchainoptions-callback) + * [Class Method: SocksClient.createUDPFrame(options)](#class-method-socksclientcreateudpframedetails) + * [Class Method: SocksClient.parseUDPFrame(data)](#class-method-socksclientparseudpframedata) + * [Event: 'error'](#event-error) + * [Event: 'bound'](#event-bound) + * [Event: 'established'](#event-established) + * [client.connect()](#clientconnect) + * [client.socksClientOptions](#clientconnect) + +### SocksClient + +SocksClient establishes SOCKS proxy connections to remote destination hosts. These proxy connections are fully transparent to the server and once established act as full duplex streams. SOCKS v4, v4a, v5, and v5h are supported, as well as the connect, bind, and associate commands. + +SocksClient supports creating connections using callbacks, promises, and async/await flow control using two static factory functions createConnection and createConnectionChain. It also internally extends EventEmitter which results in allowing event handling based async flow control. + +**SOCKS Compatibility Table** + +Note: When using 4a please specify type: 4, and when using 5h please specify type 5. + +| Socks Version | TCP | UDP | IPv4 | IPv6 | Hostname | +| --- | :---: | :---: | :---: | :---: | :---: | +| SOCKS v4 | ✅ | ❌ | ✅ | ❌ | ❌ | +| SOCKS v4a | ✅ | ❌ | ✅ | ❌ | ✅ | +| SOCKS v5 (includes v5h) | ✅ | ✅ | ✅ | ✅ | ✅ | + +### new SocksClient(options) + +* ```options``` {SocksClientOptions} - An object describing the SOCKS proxy to use, the command to send and establish, and the destination host to connect to. + +### SocksClientOptions + +```typescript +{ + proxy: { + host: '159.203.75.200', // ipv4, ipv6, or hostname + port: 1080, + type: 5, // Proxy version (4 or 5). For v4a use 4, for v5h use 5. + + // Optional fields + userId: 'some username', // Used for SOCKS4 userId auth, and SOCKS5 user/pass auth in conjunction with password. + password: 'some password', // Used in conjunction with userId for user/pass auth for SOCKS5 proxies. + custom_auth_method: 0x80, // If using a custom auth method, specify the type here. If this is set, ALL other custom_auth_*** options must be set as well. + custom_auth_request_handler: async () =>. { + // This will be called when it's time to send the custom auth handshake. You must return a Buffer containing the data to send as your authentication. + return Buffer.from([0x01,0x02,0x03]); + }, + // This is the expected size (bytes) of the custom auth response from the proxy server. + custom_auth_response_size: 2, + // This is called when the auth response is received. The received packet is passed in as a Buffer, and you must return a boolean indicating the response from the server said your custom auth was successful or failed. + custom_auth_response_handler: async (data) => { + return data[1] === 0x00; + } + }, + + command: 'connect', // connect, bind, associate + + destination: { + host: '192.30.253.113', // ipv4, ipv6, hostname. Hostnames work with v4a and v5. + port: 80 + }, + + // Optional fields + timeout: 30000, // How long to wait to establish a proxy connection. (defaults to 30 seconds) + + set_tcp_nodelay: true // If true, will turn on the underlying sockets TCP_NODELAY option. +} +``` + +### Class Method: SocksClient.createConnection(options[, callback]) +* ```options``` { SocksClientOptions } - An object describing the SOCKS proxy to use, the command to send and establish, and the destination host to connect to. +* ```callback``` { Function } - Optional callback function that is called when the proxy connection is established, or an error occurs. +* ```returns``` { Promise } - A Promise is returned that is resolved when the proxy connection is established, or rejected when an error occurs. + +Creates a new proxy connection through the given proxy to the given destination host. This factory function supports callbacks and promises for async flow control. + +**Note:** If a callback function is provided, the promise will always resolve regardless of an error occurring. Please be sure to exclusively use either promises or callbacks when using this factory function. + +```typescript +const options = { + proxy: { + host: '159.203.75.200', // ipv4, ipv6, or hostname + port: 1080, + type: 5 // Proxy version (4 or 5) + }, + + command: 'connect', // connect, bind, associate + + destination: { + host: '192.30.253.113', // ipv4, ipv6, or hostname + port: 80 + } +} + +// Await/Async (uses a Promise) +try { + const info = await SocksClient.createConnection(options); + console.log(info); + /* + { + socket: , // Raw net.Socket + } + */ + / (this is a raw net.Socket that is established to the destination host through the given proxy server) + +} catch (err) { + // Handle error... +} + +// Promise +SocksClient.createConnection(options) +.then(info => { + console.log(info); + /* + { + socket: , // Raw net.Socket + } + */ +}) +.catch(err => { + // Handle error... +}); + +// Callback +SocksClient.createConnection(options, (err, info) => { + if (!err) { + console.log(info); + /* + { + socket: , // Raw net.Socket + } + */ + } else { + // Handle error... + } +}); +``` + +### Class Method: SocksClient.createConnectionChain(options[, callback]) +* ```options``` { SocksClientChainOptions } - An object describing a list of SOCKS proxies to use, the command to send and establish, and the destination host to connect to. +* ```callback``` { Function } - Optional callback function that is called when the proxy connection chain is established, or an error occurs. +* ```returns``` { Promise } - A Promise is returned that is resolved when the proxy connection chain is established, or rejected when an error occurs. + +Creates a new proxy connection chain through a list of at least two SOCKS proxies to the given destination host. This factory method supports callbacks and promises for async flow control. + +**Note:** If a callback function is provided, the promise will always resolve regardless of an error occurring. Please be sure to exclusively use either promises or callbacks when using this factory function. + +**Note:** At least two proxies must be provided for the chain to be established. + +```typescript +const options = { + proxies: [ // The chain order is the order in the proxies array, meaning the last proxy will establish a connection to the destination. + { + host: '159.203.75.235', // ipv4, ipv6, or hostname + port: 1081, + type: 5 + }, + { + host: '104.131.124.203', // ipv4, ipv6, or hostname + port: 1081, + type: 5 + } + ] + + command: 'connect', // Only connect is supported in chaining mode. + + destination: { + host: '192.30.253.113', // ipv4, ipv6, hostname + port: 80 + } +} +``` + +### Class Method: SocksClient.createUDPFrame(details) +* ```details``` { SocksUDPFrameDetails } - An object containing the remote host, frame number, and frame data to use when creating a SOCKS UDP frame packet. +* ```returns``` { Buffer } - A Buffer containing all of the UDP frame data. + +Creates a SOCKS UDP frame relay packet that is sent and received via a SOCKS proxy when using the associate command for UDP packet forwarding. + +**SocksUDPFrameDetails** + +```typescript +{ + frameNumber: 0, // The frame number (used for breaking up larger packets) + + remoteHost: { // The remote host to have the proxy send data to, or the remote host that send this data. + host: '1.2.3.4', + port: 1234 + }, + + data: // A Buffer instance of data to include in the packet (actual data sent to the remote host) +} +interface SocksUDPFrameDetails { + // The frame number of the packet. + frameNumber?: number; + + // The remote host. + remoteHost: SocksRemoteHost; + + // The packet data. + data: Buffer; +} +``` + +### Class Method: SocksClient.parseUDPFrame(data) +* ```data``` { Buffer } - A Buffer instance containing SOCKS UDP frame data to parse. +* ```returns``` { SocksUDPFrameDetails } - An object containing the remote host, frame number, and frame data of the SOCKS UDP frame. + +```typescript +const frame = SocksClient.parseUDPFrame(data); +console.log(frame); +/* +{ + frameNumber: 0, + remoteHost: { + host: '1.2.3.4', + port: 1234 + }, + data: +} +*/ +``` + +Parses a Buffer instance and returns the parsed SocksUDPFrameDetails object. + +## Event: 'error' +* ```err``` { SocksClientError } - An Error object containing an error message and the original SocksClientOptions. + +This event is emitted if an error occurs when trying to establish the proxy connection. + +## Event: 'bound' +* ```info``` { SocksClientBoundEvent } An object containing a Socket and SocksRemoteHost info. + +This event is emitted when using the BIND command on a remote SOCKS proxy server. This event indicates the proxy server is now listening for incoming connections on a specified port. + +**SocksClientBoundEvent** +```typescript +{ + socket: net.Socket, // The underlying raw Socket + remoteHost: { + host: '1.2.3.4', // The remote host that is listening (usually the proxy itself) + port: 4444 // The remote port the proxy is listening on for incoming connections (when using BIND). + } +} +``` + +## Event: 'established' +* ```info``` { SocksClientEstablishedEvent } An object containing a Socket and SocksRemoteHost info. + +This event is emitted when the following conditions are met: +1. When using the CONNECT command, and a proxy connection has been established to the remote host. +2. When using the BIND command, and an incoming connection has been accepted by the proxy and a TCP relay has been established. +3. When using the ASSOCIATE command, and a UDP relay has been established. + +When using BIND, 'bound' is first emitted to indicate the SOCKS server is waiting for an incoming connection, and provides the remote port the SOCKS server is listening on. + +When using ASSOCIATE, 'established' is emitted with the remote UDP port the SOCKS server is accepting UDP frame packets on. + +**SocksClientEstablishedEvent** +```typescript +{ + socket: net.Socket, // The underlying raw Socket + remoteHost: { + host: '1.2.3.4', // The remote host that is listening (usually the proxy itself) + port: 52738 // The remote port the proxy is listening on for incoming connections (when using BIND). + } +} +``` + +## client.connect() + +Starts connecting to the remote SOCKS proxy server to establish a proxy connection to the destination host. + +## client.socksClientOptions +* ```returns``` { SocksClientOptions } The options that were passed to the SocksClient. + +Gets the options that were passed to the SocksClient when it was created. + + +**SocksClientError** +```typescript +{ // Subclassed from Error. + message: 'An error has occurred', + options: { + // SocksClientOptions + } +} +``` + +# Further Reading: + +Please read the SOCKS 5 specifications for more information on how to use BIND and Associate. +http://www.ietf.org/rfc/rfc1928.txt + +# License + +This work is licensed under the [MIT license](http://en.wikipedia.org/wiki/MIT_License). diff --git a/node_modules/socks/build/client/socksclient.js b/node_modules/socks/build/client/socksclient.js new file mode 100644 index 000000000..40a82a532 --- /dev/null +++ b/node_modules/socks/build/client/socksclient.js @@ -0,0 +1,791 @@ +"use strict"; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.SocksClientError = exports.SocksClient = void 0; +const events_1 = require("events"); +const net = require("net"); +const ip = require("ip"); +const smart_buffer_1 = require("smart-buffer"); +const constants_1 = require("../common/constants"); +const helpers_1 = require("../common/helpers"); +const receivebuffer_1 = require("../common/receivebuffer"); +const util_1 = require("../common/util"); +Object.defineProperty(exports, "SocksClientError", { enumerable: true, get: function () { return util_1.SocksClientError; } }); +class SocksClient extends events_1.EventEmitter { + constructor(options) { + super(); + this.options = Object.assign({}, options); + // Validate SocksClientOptions + (0, helpers_1.validateSocksClientOptions)(options); + // Default state + this.setState(constants_1.SocksClientState.Created); + } + /** + * Creates a new SOCKS connection. + * + * Note: Supports callbacks and promises. Only supports the connect command. + * @param options { SocksClientOptions } Options. + * @param callback { Function } An optional callback function. + * @returns { Promise } + */ + static createConnection(options, callback) { + return new Promise((resolve, reject) => { + // Validate SocksClientOptions + try { + (0, helpers_1.validateSocksClientOptions)(options, ['connect']); + } + catch (err) { + if (typeof callback === 'function') { + callback(err); + return resolve(err); // Resolves pending promise (prevents memory leaks). + } + else { + return reject(err); + } + } + const client = new SocksClient(options); + client.connect(options.existing_socket); + client.once('established', (info) => { + client.removeAllListeners(); + if (typeof callback === 'function') { + callback(null, info); + resolve(info); // Resolves pending promise (prevents memory leaks). + } + else { + resolve(info); + } + }); + // Error occurred, failed to establish connection. + client.once('error', (err) => { + client.removeAllListeners(); + if (typeof callback === 'function') { + callback(err); + resolve(err); // Resolves pending promise (prevents memory leaks). + } + else { + reject(err); + } + }); + }); + } + /** + * Creates a new SOCKS connection chain to a destination host through 2 or more SOCKS proxies. + * + * Note: Supports callbacks and promises. Only supports the connect method. + * Note: Implemented via createConnection() factory function. + * @param options { SocksClientChainOptions } Options + * @param callback { Function } An optional callback function. + * @returns { Promise } + */ + static createConnectionChain(options, callback) { + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + // Validate SocksClientChainOptions + try { + (0, helpers_1.validateSocksClientChainOptions)(options); + } + catch (err) { + if (typeof callback === 'function') { + callback(err); + return resolve(err); // Resolves pending promise (prevents memory leaks). + } + else { + return reject(err); + } + } + let sock; + // Shuffle proxies + if (options.randomizeChain) { + (0, util_1.shuffleArray)(options.proxies); + } + try { + // tslint:disable-next-line:no-increment-decrement + for (let i = 0; i < options.proxies.length; i++) { + const nextProxy = options.proxies[i]; + // If we've reached the last proxy in the chain, the destination is the actual destination, otherwise it's the next proxy. + const nextDestination = i === options.proxies.length - 1 + ? options.destination + : { + host: options.proxies[i + 1].host || + options.proxies[i + 1].ipaddress, + port: options.proxies[i + 1].port, + }; + // Creates the next connection in the chain. + const result = yield SocksClient.createConnection({ + command: 'connect', + proxy: nextProxy, + destination: nextDestination, + // Initial connection ignores this as sock is undefined. Subsequent connections re-use the first proxy socket to form a chain. + }); + // If sock is undefined, assign it here. + if (!sock) { + sock = result.socket; + } + } + if (typeof callback === 'function') { + callback(null, { socket: sock }); + resolve({ socket: sock }); // Resolves pending promise (prevents memory leaks). + } + else { + resolve({ socket: sock }); + } + } + catch (err) { + if (typeof callback === 'function') { + callback(err); + resolve(err); // Resolves pending promise (prevents memory leaks). + } + else { + reject(err); + } + } + })); + } + /** + * Creates a SOCKS UDP Frame. + * @param options + */ + static createUDPFrame(options) { + const buff = new smart_buffer_1.SmartBuffer(); + buff.writeUInt16BE(0); + buff.writeUInt8(options.frameNumber || 0); + // IPv4/IPv6/Hostname + if (net.isIPv4(options.remoteHost.host)) { + buff.writeUInt8(constants_1.Socks5HostType.IPv4); + buff.writeUInt32BE(ip.toLong(options.remoteHost.host)); + } + else if (net.isIPv6(options.remoteHost.host)) { + buff.writeUInt8(constants_1.Socks5HostType.IPv6); + buff.writeBuffer(ip.toBuffer(options.remoteHost.host)); + } + else { + buff.writeUInt8(constants_1.Socks5HostType.Hostname); + buff.writeUInt8(Buffer.byteLength(options.remoteHost.host)); + buff.writeString(options.remoteHost.host); + } + // Port + buff.writeUInt16BE(options.remoteHost.port); + // Data + buff.writeBuffer(options.data); + return buff.toBuffer(); + } + /** + * Parses a SOCKS UDP frame. + * @param data + */ + static parseUDPFrame(data) { + const buff = smart_buffer_1.SmartBuffer.fromBuffer(data); + buff.readOffset = 2; + const frameNumber = buff.readUInt8(); + const hostType = buff.readUInt8(); + let remoteHost; + if (hostType === constants_1.Socks5HostType.IPv4) { + remoteHost = ip.fromLong(buff.readUInt32BE()); + } + else if (hostType === constants_1.Socks5HostType.IPv6) { + remoteHost = ip.toString(buff.readBuffer(16)); + } + else { + remoteHost = buff.readString(buff.readUInt8()); + } + const remotePort = buff.readUInt16BE(); + return { + frameNumber, + remoteHost: { + host: remoteHost, + port: remotePort, + }, + data: buff.readBuffer(), + }; + } + /** + * Internal state setter. If the SocksClient is in an error state, it cannot be changed to a non error state. + */ + setState(newState) { + if (this.state !== constants_1.SocksClientState.Error) { + this.state = newState; + } + } + /** + * Starts the connection establishment to the proxy and destination. + * @param existingSocket Connected socket to use instead of creating a new one (internal use). + */ + connect(existingSocket) { + this.onDataReceived = (data) => this.onDataReceivedHandler(data); + this.onClose = () => this.onCloseHandler(); + this.onError = (err) => this.onErrorHandler(err); + this.onConnect = () => this.onConnectHandler(); + // Start timeout timer (defaults to 30 seconds) + const timer = setTimeout(() => this.onEstablishedTimeout(), this.options.timeout || constants_1.DEFAULT_TIMEOUT); + // check whether unref is available as it differs from browser to NodeJS (#33) + if (timer.unref && typeof timer.unref === 'function') { + timer.unref(); + } + // If an existing socket is provided, use it to negotiate SOCKS handshake. Otherwise create a new Socket. + if (existingSocket) { + this.socket = existingSocket; + } + else { + this.socket = new net.Socket(); + } + // Attach Socket error handlers. + this.socket.once('close', this.onClose); + this.socket.once('error', this.onError); + this.socket.once('connect', this.onConnect); + this.socket.on('data', this.onDataReceived); + this.setState(constants_1.SocksClientState.Connecting); + this.receiveBuffer = new receivebuffer_1.ReceiveBuffer(); + if (existingSocket) { + this.socket.emit('connect'); + } + else { + this.socket.connect(this.getSocketOptions()); + if (this.options.set_tcp_nodelay !== undefined && + this.options.set_tcp_nodelay !== null) { + this.socket.setNoDelay(!!this.options.set_tcp_nodelay); + } + } + // Listen for established event so we can re-emit any excess data received during handshakes. + this.prependOnceListener('established', (info) => { + setImmediate(() => { + if (this.receiveBuffer.length > 0) { + const excessData = this.receiveBuffer.get(this.receiveBuffer.length); + info.socket.emit('data', excessData); + } + info.socket.resume(); + }); + }); + } + // Socket options (defaults host/port to options.proxy.host/options.proxy.port) + getSocketOptions() { + return Object.assign(Object.assign({}, this.options.socket_options), { host: this.options.proxy.host || this.options.proxy.ipaddress, port: this.options.proxy.port }); + } + /** + * Handles internal Socks timeout callback. + * Note: If the Socks client is not BoundWaitingForConnection or Established, the connection will be closed. + */ + onEstablishedTimeout() { + if (this.state !== constants_1.SocksClientState.Established && + this.state !== constants_1.SocksClientState.BoundWaitingForConnection) { + this.closeSocket(constants_1.ERRORS.ProxyConnectionTimedOut); + } + } + /** + * Handles Socket connect event. + */ + onConnectHandler() { + this.setState(constants_1.SocksClientState.Connected); + // Send initial handshake. + if (this.options.proxy.type === 4) { + this.sendSocks4InitialHandshake(); + } + else { + this.sendSocks5InitialHandshake(); + } + this.setState(constants_1.SocksClientState.SentInitialHandshake); + } + /** + * Handles Socket data event. + * @param data + */ + onDataReceivedHandler(data) { + /* + All received data is appended to a ReceiveBuffer. + This makes sure that all the data we need is received before we attempt to process it. + */ + this.receiveBuffer.append(data); + // Process data that we have. + this.processData(); + } + /** + * Handles processing of the data we have received. + */ + processData() { + // If we have enough data to process the next step in the SOCKS handshake, proceed. + while (this.state !== constants_1.SocksClientState.Established && + this.state !== constants_1.SocksClientState.Error && + this.receiveBuffer.length >= this.nextRequiredPacketBufferSize) { + // Sent initial handshake, waiting for response. + if (this.state === constants_1.SocksClientState.SentInitialHandshake) { + if (this.options.proxy.type === 4) { + // Socks v4 only has one handshake response. + this.handleSocks4FinalHandshakeResponse(); + } + else { + // Socks v5 has two handshakes, handle initial one here. + this.handleInitialSocks5HandshakeResponse(); + } + // Sent auth request for Socks v5, waiting for response. + } + else if (this.state === constants_1.SocksClientState.SentAuthentication) { + this.handleInitialSocks5AuthenticationHandshakeResponse(); + // Sent final Socks v5 handshake, waiting for final response. + } + else if (this.state === constants_1.SocksClientState.SentFinalHandshake) { + this.handleSocks5FinalHandshakeResponse(); + // Socks BIND established. Waiting for remote connection via proxy. + } + else if (this.state === constants_1.SocksClientState.BoundWaitingForConnection) { + if (this.options.proxy.type === 4) { + this.handleSocks4IncomingConnectionResponse(); + } + else { + this.handleSocks5IncomingConnectionResponse(); + } + } + else { + this.closeSocket(constants_1.ERRORS.InternalError); + break; + } + } + } + /** + * Handles Socket close event. + * @param had_error + */ + onCloseHandler() { + this.closeSocket(constants_1.ERRORS.SocketClosed); + } + /** + * Handles Socket error event. + * @param err + */ + onErrorHandler(err) { + this.closeSocket(err.message); + } + /** + * Removes internal event listeners on the underlying Socket. + */ + removeInternalSocketHandlers() { + // Pauses data flow of the socket (this is internally resumed after 'established' is emitted) + this.socket.pause(); + this.socket.removeListener('data', this.onDataReceived); + this.socket.removeListener('close', this.onClose); + this.socket.removeListener('error', this.onError); + this.socket.removeListener('connect', this.onConnect); + } + /** + * Closes and destroys the underlying Socket. Emits an error event. + * @param err { String } An error string to include in error event. + */ + closeSocket(err) { + // Make sure only one 'error' event is fired for the lifetime of this SocksClient instance. + if (this.state !== constants_1.SocksClientState.Error) { + // Set internal state to Error. + this.setState(constants_1.SocksClientState.Error); + // Destroy Socket + this.socket.destroy(); + // Remove internal listeners + this.removeInternalSocketHandlers(); + // Fire 'error' event. + this.emit('error', new util_1.SocksClientError(err, this.options)); + } + } + /** + * Sends initial Socks v4 handshake request. + */ + sendSocks4InitialHandshake() { + const userId = this.options.proxy.userId || ''; + const buff = new smart_buffer_1.SmartBuffer(); + buff.writeUInt8(0x04); + buff.writeUInt8(constants_1.SocksCommand[this.options.command]); + buff.writeUInt16BE(this.options.destination.port); + // Socks 4 (IPv4) + if (net.isIPv4(this.options.destination.host)) { + buff.writeBuffer(ip.toBuffer(this.options.destination.host)); + buff.writeStringNT(userId); + // Socks 4a (hostname) + } + else { + buff.writeUInt8(0x00); + buff.writeUInt8(0x00); + buff.writeUInt8(0x00); + buff.writeUInt8(0x01); + buff.writeStringNT(userId); + buff.writeStringNT(this.options.destination.host); + } + this.nextRequiredPacketBufferSize = + constants_1.SOCKS_INCOMING_PACKET_SIZES.Socks4Response; + this.socket.write(buff.toBuffer()); + } + /** + * Handles Socks v4 handshake response. + * @param data + */ + handleSocks4FinalHandshakeResponse() { + const data = this.receiveBuffer.get(8); + if (data[1] !== constants_1.Socks4Response.Granted) { + this.closeSocket(`${constants_1.ERRORS.Socks4ProxyRejectedConnection} - (${constants_1.Socks4Response[data[1]]})`); + } + else { + // Bind response + if (constants_1.SocksCommand[this.options.command] === constants_1.SocksCommand.bind) { + const buff = smart_buffer_1.SmartBuffer.fromBuffer(data); + buff.readOffset = 2; + const remoteHost = { + port: buff.readUInt16BE(), + host: ip.fromLong(buff.readUInt32BE()), + }; + // If host is 0.0.0.0, set to proxy host. + if (remoteHost.host === '0.0.0.0') { + remoteHost.host = this.options.proxy.ipaddress; + } + this.setState(constants_1.SocksClientState.BoundWaitingForConnection); + this.emit('bound', { remoteHost, socket: this.socket }); + // Connect response + } + else { + this.setState(constants_1.SocksClientState.Established); + this.removeInternalSocketHandlers(); + this.emit('established', { socket: this.socket }); + } + } + } + /** + * Handles Socks v4 incoming connection request (BIND) + * @param data + */ + handleSocks4IncomingConnectionResponse() { + const data = this.receiveBuffer.get(8); + if (data[1] !== constants_1.Socks4Response.Granted) { + this.closeSocket(`${constants_1.ERRORS.Socks4ProxyRejectedIncomingBoundConnection} - (${constants_1.Socks4Response[data[1]]})`); + } + else { + const buff = smart_buffer_1.SmartBuffer.fromBuffer(data); + buff.readOffset = 2; + const remoteHost = { + port: buff.readUInt16BE(), + host: ip.fromLong(buff.readUInt32BE()), + }; + this.setState(constants_1.SocksClientState.Established); + this.removeInternalSocketHandlers(); + this.emit('established', { remoteHost, socket: this.socket }); + } + } + /** + * Sends initial Socks v5 handshake request. + */ + sendSocks5InitialHandshake() { + const buff = new smart_buffer_1.SmartBuffer(); + // By default we always support no auth. + const supportedAuthMethods = [constants_1.Socks5Auth.NoAuth]; + // We should only tell the proxy we support user/pass auth if auth info is actually provided. + // Note: As of Tor v0.3.5.7+, if user/pass auth is an option from the client, by default it will always take priority. + if (this.options.proxy.userId || this.options.proxy.password) { + supportedAuthMethods.push(constants_1.Socks5Auth.UserPass); + } + // Custom auth method? + if (this.options.proxy.custom_auth_method !== undefined) { + supportedAuthMethods.push(this.options.proxy.custom_auth_method); + } + // Build handshake packet + buff.writeUInt8(0x05); + buff.writeUInt8(supportedAuthMethods.length); + for (const authMethod of supportedAuthMethods) { + buff.writeUInt8(authMethod); + } + this.nextRequiredPacketBufferSize = + constants_1.SOCKS_INCOMING_PACKET_SIZES.Socks5InitialHandshakeResponse; + this.socket.write(buff.toBuffer()); + this.setState(constants_1.SocksClientState.SentInitialHandshake); + } + /** + * Handles initial Socks v5 handshake response. + * @param data + */ + handleInitialSocks5HandshakeResponse() { + const data = this.receiveBuffer.get(2); + if (data[0] !== 0x05) { + this.closeSocket(constants_1.ERRORS.InvalidSocks5IntiailHandshakeSocksVersion); + } + else if (data[1] === constants_1.SOCKS5_NO_ACCEPTABLE_AUTH) { + this.closeSocket(constants_1.ERRORS.InvalidSocks5InitialHandshakeNoAcceptedAuthType); + } + else { + // If selected Socks v5 auth method is no auth, send final handshake request. + if (data[1] === constants_1.Socks5Auth.NoAuth) { + this.socks5ChosenAuthType = constants_1.Socks5Auth.NoAuth; + this.sendSocks5CommandRequest(); + // If selected Socks v5 auth method is user/password, send auth handshake. + } + else if (data[1] === constants_1.Socks5Auth.UserPass) { + this.socks5ChosenAuthType = constants_1.Socks5Auth.UserPass; + this.sendSocks5UserPassAuthentication(); + // If selected Socks v5 auth method is the custom_auth_method, send custom handshake. + } + else if (data[1] === this.options.proxy.custom_auth_method) { + this.socks5ChosenAuthType = this.options.proxy.custom_auth_method; + this.sendSocks5CustomAuthentication(); + } + else { + this.closeSocket(constants_1.ERRORS.InvalidSocks5InitialHandshakeUnknownAuthType); + } + } + } + /** + * Sends Socks v5 user & password auth handshake. + * + * Note: No auth and user/pass are currently supported. + */ + sendSocks5UserPassAuthentication() { + const userId = this.options.proxy.userId || ''; + const password = this.options.proxy.password || ''; + const buff = new smart_buffer_1.SmartBuffer(); + buff.writeUInt8(0x01); + buff.writeUInt8(Buffer.byteLength(userId)); + buff.writeString(userId); + buff.writeUInt8(Buffer.byteLength(password)); + buff.writeString(password); + this.nextRequiredPacketBufferSize = + constants_1.SOCKS_INCOMING_PACKET_SIZES.Socks5UserPassAuthenticationResponse; + this.socket.write(buff.toBuffer()); + this.setState(constants_1.SocksClientState.SentAuthentication); + } + sendSocks5CustomAuthentication() { + return __awaiter(this, void 0, void 0, function* () { + this.nextRequiredPacketBufferSize = + this.options.proxy.custom_auth_response_size; + this.socket.write(yield this.options.proxy.custom_auth_request_handler()); + this.setState(constants_1.SocksClientState.SentAuthentication); + }); + } + handleSocks5CustomAuthHandshakeResponse(data) { + return __awaiter(this, void 0, void 0, function* () { + return yield this.options.proxy.custom_auth_response_handler(data); + }); + } + handleSocks5AuthenticationNoAuthHandshakeResponse(data) { + return __awaiter(this, void 0, void 0, function* () { + return data[1] === 0x00; + }); + } + handleSocks5AuthenticationUserPassHandshakeResponse(data) { + return __awaiter(this, void 0, void 0, function* () { + return data[1] === 0x00; + }); + } + /** + * Handles Socks v5 auth handshake response. + * @param data + */ + handleInitialSocks5AuthenticationHandshakeResponse() { + return __awaiter(this, void 0, void 0, function* () { + this.setState(constants_1.SocksClientState.ReceivedAuthenticationResponse); + let authResult = false; + if (this.socks5ChosenAuthType === constants_1.Socks5Auth.NoAuth) { + authResult = yield this.handleSocks5AuthenticationNoAuthHandshakeResponse(this.receiveBuffer.get(2)); + } + else if (this.socks5ChosenAuthType === constants_1.Socks5Auth.UserPass) { + authResult = + yield this.handleSocks5AuthenticationUserPassHandshakeResponse(this.receiveBuffer.get(2)); + } + else if (this.socks5ChosenAuthType === this.options.proxy.custom_auth_method) { + authResult = yield this.handleSocks5CustomAuthHandshakeResponse(this.receiveBuffer.get(this.options.proxy.custom_auth_response_size)); + } + if (!authResult) { + this.closeSocket(constants_1.ERRORS.Socks5AuthenticationFailed); + } + else { + this.sendSocks5CommandRequest(); + } + }); + } + /** + * Sends Socks v5 final handshake request. + */ + sendSocks5CommandRequest() { + const buff = new smart_buffer_1.SmartBuffer(); + buff.writeUInt8(0x05); + buff.writeUInt8(constants_1.SocksCommand[this.options.command]); + buff.writeUInt8(0x00); + // ipv4, ipv6, domain? + if (net.isIPv4(this.options.destination.host)) { + buff.writeUInt8(constants_1.Socks5HostType.IPv4); + buff.writeBuffer(ip.toBuffer(this.options.destination.host)); + } + else if (net.isIPv6(this.options.destination.host)) { + buff.writeUInt8(constants_1.Socks5HostType.IPv6); + buff.writeBuffer(ip.toBuffer(this.options.destination.host)); + } + else { + buff.writeUInt8(constants_1.Socks5HostType.Hostname); + buff.writeUInt8(this.options.destination.host.length); + buff.writeString(this.options.destination.host); + } + buff.writeUInt16BE(this.options.destination.port); + this.nextRequiredPacketBufferSize = + constants_1.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseHeader; + this.socket.write(buff.toBuffer()); + this.setState(constants_1.SocksClientState.SentFinalHandshake); + } + /** + * Handles Socks v5 final handshake response. + * @param data + */ + handleSocks5FinalHandshakeResponse() { + // Peek at available data (we need at least 5 bytes to get the hostname length) + const header = this.receiveBuffer.peek(5); + if (header[0] !== 0x05 || header[1] !== constants_1.Socks5Response.Granted) { + this.closeSocket(`${constants_1.ERRORS.InvalidSocks5FinalHandshakeRejected} - ${constants_1.Socks5Response[header[1]]}`); + } + else { + // Read address type + const addressType = header[3]; + let remoteHost; + let buff; + // IPv4 + if (addressType === constants_1.Socks5HostType.IPv4) { + // Check if data is available. + const dataNeeded = constants_1.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseIPv4; + if (this.receiveBuffer.length < dataNeeded) { + this.nextRequiredPacketBufferSize = dataNeeded; + return; + } + buff = smart_buffer_1.SmartBuffer.fromBuffer(this.receiveBuffer.get(dataNeeded).slice(4)); + remoteHost = { + host: ip.fromLong(buff.readUInt32BE()), + port: buff.readUInt16BE(), + }; + // If given host is 0.0.0.0, assume remote proxy ip instead. + if (remoteHost.host === '0.0.0.0') { + remoteHost.host = this.options.proxy.ipaddress; + } + // Hostname + } + else if (addressType === constants_1.Socks5HostType.Hostname) { + const hostLength = header[4]; + const dataNeeded = constants_1.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseHostname(hostLength); // header + host length + host + port + // Check if data is available. + if (this.receiveBuffer.length < dataNeeded) { + this.nextRequiredPacketBufferSize = dataNeeded; + return; + } + buff = smart_buffer_1.SmartBuffer.fromBuffer(this.receiveBuffer.get(dataNeeded).slice(5)); + remoteHost = { + host: buff.readString(hostLength), + port: buff.readUInt16BE(), + }; + // IPv6 + } + else if (addressType === constants_1.Socks5HostType.IPv6) { + // Check if data is available. + const dataNeeded = constants_1.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseIPv6; + if (this.receiveBuffer.length < dataNeeded) { + this.nextRequiredPacketBufferSize = dataNeeded; + return; + } + buff = smart_buffer_1.SmartBuffer.fromBuffer(this.receiveBuffer.get(dataNeeded).slice(4)); + remoteHost = { + host: ip.toString(buff.readBuffer(16)), + port: buff.readUInt16BE(), + }; + } + // We have everything we need + this.setState(constants_1.SocksClientState.ReceivedFinalResponse); + // If using CONNECT, the client is now in the established state. + if (constants_1.SocksCommand[this.options.command] === constants_1.SocksCommand.connect) { + this.setState(constants_1.SocksClientState.Established); + this.removeInternalSocketHandlers(); + this.emit('established', { remoteHost, socket: this.socket }); + } + else if (constants_1.SocksCommand[this.options.command] === constants_1.SocksCommand.bind) { + /* If using BIND, the Socks client is now in BoundWaitingForConnection state. + This means that the remote proxy server is waiting for a remote connection to the bound port. */ + this.setState(constants_1.SocksClientState.BoundWaitingForConnection); + this.nextRequiredPacketBufferSize = + constants_1.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseHeader; + this.emit('bound', { remoteHost, socket: this.socket }); + /* + If using Associate, the Socks client is now Established. And the proxy server is now accepting UDP packets at the + given bound port. This initial Socks TCP connection must remain open for the UDP relay to continue to work. + */ + } + else if (constants_1.SocksCommand[this.options.command] === constants_1.SocksCommand.associate) { + this.setState(constants_1.SocksClientState.Established); + this.removeInternalSocketHandlers(); + this.emit('established', { + remoteHost, + socket: this.socket, + }); + } + } + } + /** + * Handles Socks v5 incoming connection request (BIND). + */ + handleSocks5IncomingConnectionResponse() { + // Peek at available data (we need at least 5 bytes to get the hostname length) + const header = this.receiveBuffer.peek(5); + if (header[0] !== 0x05 || header[1] !== constants_1.Socks5Response.Granted) { + this.closeSocket(`${constants_1.ERRORS.Socks5ProxyRejectedIncomingBoundConnection} - ${constants_1.Socks5Response[header[1]]}`); + } + else { + // Read address type + const addressType = header[3]; + let remoteHost; + let buff; + // IPv4 + if (addressType === constants_1.Socks5HostType.IPv4) { + // Check if data is available. + const dataNeeded = constants_1.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseIPv4; + if (this.receiveBuffer.length < dataNeeded) { + this.nextRequiredPacketBufferSize = dataNeeded; + return; + } + buff = smart_buffer_1.SmartBuffer.fromBuffer(this.receiveBuffer.get(dataNeeded).slice(4)); + remoteHost = { + host: ip.fromLong(buff.readUInt32BE()), + port: buff.readUInt16BE(), + }; + // If given host is 0.0.0.0, assume remote proxy ip instead. + if (remoteHost.host === '0.0.0.0') { + remoteHost.host = this.options.proxy.ipaddress; + } + // Hostname + } + else if (addressType === constants_1.Socks5HostType.Hostname) { + const hostLength = header[4]; + const dataNeeded = constants_1.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseHostname(hostLength); // header + host length + port + // Check if data is available. + if (this.receiveBuffer.length < dataNeeded) { + this.nextRequiredPacketBufferSize = dataNeeded; + return; + } + buff = smart_buffer_1.SmartBuffer.fromBuffer(this.receiveBuffer.get(dataNeeded).slice(5)); + remoteHost = { + host: buff.readString(hostLength), + port: buff.readUInt16BE(), + }; + // IPv6 + } + else if (addressType === constants_1.Socks5HostType.IPv6) { + // Check if data is available. + const dataNeeded = constants_1.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseIPv6; + if (this.receiveBuffer.length < dataNeeded) { + this.nextRequiredPacketBufferSize = dataNeeded; + return; + } + buff = smart_buffer_1.SmartBuffer.fromBuffer(this.receiveBuffer.get(dataNeeded).slice(4)); + remoteHost = { + host: ip.toString(buff.readBuffer(16)), + port: buff.readUInt16BE(), + }; + } + this.setState(constants_1.SocksClientState.Established); + this.removeInternalSocketHandlers(); + this.emit('established', { remoteHost, socket: this.socket }); + } + } + get socksClientOptions() { + return Object.assign({}, this.options); + } +} +exports.SocksClient = SocksClient; +//# sourceMappingURL=socksclient.js.map \ No newline at end of file diff --git a/node_modules/socks/build/client/socksclient.js.map b/node_modules/socks/build/client/socksclient.js.map new file mode 100644 index 000000000..15d0b565a --- /dev/null +++ b/node_modules/socks/build/client/socksclient.js.map @@ -0,0 +1 @@ +{"version":3,"file":"socksclient.js","sourceRoot":"","sources":["../../src/client/socksclient.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,mCAAoC;AACpC,2BAA2B;AAC3B,yBAAyB;AACzB,+CAAyC;AACzC,mDAkB6B;AAC7B,+CAG2B;AAC3B,2DAAsD;AACtD,yCAA8D;AAg7B5D,iGAh7BM,uBAAgB,OAg7BN;AAt5BlB,MAAM,WAAY,SAAQ,qBAAY;IAgBpC,YAAY,OAA2B;QACrC,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,OAAO,qBACP,OAAO,CACX,CAAC;QAEF,8BAA8B;QAC9B,IAAA,oCAA0B,EAAC,OAAO,CAAC,CAAC;QAEpC,gBAAgB;QAChB,IAAI,CAAC,QAAQ,CAAC,4BAAgB,CAAC,OAAO,CAAC,CAAC;IAC1C,CAAC;IAED;;;;;;;OAOG;IACH,MAAM,CAAC,gBAAgB,CACrB,OAA2B,EAC3B,QAAmB;QAEnB,OAAO,IAAI,OAAO,CAA8B,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YAClE,8BAA8B;YAC9B,IAAI;gBACF,IAAA,oCAA0B,EAAC,OAAO,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC;aAClD;YAAC,OAAO,GAAG,EAAE;gBACZ,IAAI,OAAO,QAAQ,KAAK,UAAU,EAAE;oBAClC,QAAQ,CAAC,GAAG,CAAC,C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;AAGC,kCAAW"} \ No newline at end of file diff --git a/node_modules/socks/build/common/constants.js b/node_modules/socks/build/common/constants.js new file mode 100644 index 000000000..3c9ff90ac --- /dev/null +++ b/node_modules/socks/build/common/constants.js @@ -0,0 +1,114 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.SOCKS5_NO_ACCEPTABLE_AUTH = exports.SOCKS5_CUSTOM_AUTH_END = exports.SOCKS5_CUSTOM_AUTH_START = exports.SOCKS_INCOMING_PACKET_SIZES = exports.SocksClientState = exports.Socks5Response = exports.Socks5HostType = exports.Socks5Auth = exports.Socks4Response = exports.SocksCommand = exports.ERRORS = exports.DEFAULT_TIMEOUT = void 0; +const DEFAULT_TIMEOUT = 30000; +exports.DEFAULT_TIMEOUT = DEFAULT_TIMEOUT; +// prettier-ignore +const ERRORS = { + InvalidSocksCommand: 'An invalid SOCKS command was provided. Valid options are connect, bind, and associate.', + InvalidSocksCommandForOperation: 'An invalid SOCKS command was provided. Only a subset of commands are supported for this operation.', + InvalidSocksCommandChain: 'An invalid SOCKS command was provided. Chaining currently only supports the connect command.', + InvalidSocksClientOptionsDestination: 'An invalid destination host was provided.', + InvalidSocksClientOptionsExistingSocket: 'An invalid existing socket was provided. This should be an instance of stream.Duplex.', + InvalidSocksClientOptionsProxy: 'Invalid SOCKS proxy details were provided.', + InvalidSocksClientOptionsTimeout: 'An invalid timeout value was provided. Please enter a value above 0 (in ms).', + InvalidSocksClientOptionsProxiesLength: 'At least two socks proxies must be provided for chaining.', + InvalidSocksClientOptionsCustomAuthRange: 'Custom auth must be a value between 0x80 and 0xFE.', + InvalidSocksClientOptionsCustomAuthOptions: 'When a custom_auth_method is provided, custom_auth_request_handler, custom_auth_response_size, and custom_auth_response_handler must also be provided and valid.', + NegotiationError: 'Negotiation error', + SocketClosed: 'Socket closed', + ProxyConnectionTimedOut: 'Proxy connection timed out', + InternalError: 'SocksClient internal error (this should not happen)', + InvalidSocks4HandshakeResponse: 'Received invalid Socks4 handshake response', + Socks4ProxyRejectedConnection: 'Socks4 Proxy rejected connection', + InvalidSocks4IncomingConnectionResponse: 'Socks4 invalid incoming connection response', + Socks4ProxyRejectedIncomingBoundConnection: 'Socks4 Proxy rejected incoming bound connection', + InvalidSocks5InitialHandshakeResponse: 'Received invalid Socks5 initial handshake response', + InvalidSocks5IntiailHandshakeSocksVersion: 'Received invalid Socks5 initial handshake (invalid socks version)', + InvalidSocks5InitialHandshakeNoAcceptedAuthType: 'Received invalid Socks5 initial handshake (no accepted authentication type)', + InvalidSocks5InitialHandshakeUnknownAuthType: 'Received invalid Socks5 initial handshake (unknown authentication type)', + Socks5AuthenticationFailed: 'Socks5 Authentication failed', + InvalidSocks5FinalHandshake: 'Received invalid Socks5 final handshake response', + InvalidSocks5FinalHandshakeRejected: 'Socks5 proxy rejected connection', + InvalidSocks5IncomingConnectionResponse: 'Received invalid Socks5 incoming connection response', + Socks5ProxyRejectedIncomingBoundConnection: 'Socks5 Proxy rejected incoming bound connection', +}; +exports.ERRORS = ERRORS; +const SOCKS_INCOMING_PACKET_SIZES = { + Socks5InitialHandshakeResponse: 2, + Socks5UserPassAuthenticationResponse: 2, + // Command response + incoming connection (bind) + Socks5ResponseHeader: 5, + Socks5ResponseIPv4: 10, + Socks5ResponseIPv6: 22, + Socks5ResponseHostname: (hostNameLength) => hostNameLength + 7, + // Command response + incoming connection (bind) + Socks4Response: 8, // 2 header + 2 port + 4 ip +}; +exports.SOCKS_INCOMING_PACKET_SIZES = SOCKS_INCOMING_PACKET_SIZES; +var SocksCommand; +(function (SocksCommand) { + SocksCommand[SocksCommand["connect"] = 1] = "connect"; + SocksCommand[SocksCommand["bind"] = 2] = "bind"; + SocksCommand[SocksCommand["associate"] = 3] = "associate"; +})(SocksCommand || (SocksCommand = {})); +exports.SocksCommand = SocksCommand; +var Socks4Response; +(function (Socks4Response) { + Socks4Response[Socks4Response["Granted"] = 90] = "Granted"; + Socks4Response[Socks4Response["Failed"] = 91] = "Failed"; + Socks4Response[Socks4Response["Rejected"] = 92] = "Rejected"; + Socks4Response[Socks4Response["RejectedIdent"] = 93] = "RejectedIdent"; +})(Socks4Response || (Socks4Response = {})); +exports.Socks4Response = Socks4Response; +var Socks5Auth; +(function (Socks5Auth) { + Socks5Auth[Socks5Auth["NoAuth"] = 0] = "NoAuth"; + Socks5Auth[Socks5Auth["GSSApi"] = 1] = "GSSApi"; + Socks5Auth[Socks5Auth["UserPass"] = 2] = "UserPass"; +})(Socks5Auth || (Socks5Auth = {})); +exports.Socks5Auth = Socks5Auth; +const SOCKS5_CUSTOM_AUTH_START = 0x80; +exports.SOCKS5_CUSTOM_AUTH_START = SOCKS5_CUSTOM_AUTH_START; +const SOCKS5_CUSTOM_AUTH_END = 0xfe; +exports.SOCKS5_CUSTOM_AUTH_END = SOCKS5_CUSTOM_AUTH_END; +const SOCKS5_NO_ACCEPTABLE_AUTH = 0xff; +exports.SOCKS5_NO_ACCEPTABLE_AUTH = SOCKS5_NO_ACCEPTABLE_AUTH; +var Socks5Response; +(function (Socks5Response) { + Socks5Response[Socks5Response["Granted"] = 0] = "Granted"; + Socks5Response[Socks5Response["Failure"] = 1] = "Failure"; + Socks5Response[Socks5Response["NotAllowed"] = 2] = "NotAllowed"; + Socks5Response[Socks5Response["NetworkUnreachable"] = 3] = "NetworkUnreachable"; + Socks5Response[Socks5Response["HostUnreachable"] = 4] = "HostUnreachable"; + Socks5Response[Socks5Response["ConnectionRefused"] = 5] = "ConnectionRefused"; + Socks5Response[Socks5Response["TTLExpired"] = 6] = "TTLExpired"; + Socks5Response[Socks5Response["CommandNotSupported"] = 7] = "CommandNotSupported"; + Socks5Response[Socks5Response["AddressNotSupported"] = 8] = "AddressNotSupported"; +})(Socks5Response || (Socks5Response = {})); +exports.Socks5Response = Socks5Response; +var Socks5HostType; +(function (Socks5HostType) { + Socks5HostType[Socks5HostType["IPv4"] = 1] = "IPv4"; + Socks5HostType[Socks5HostType["Hostname"] = 3] = "Hostname"; + Socks5HostType[Socks5HostType["IPv6"] = 4] = "IPv6"; +})(Socks5HostType || (Socks5HostType = {})); +exports.Socks5HostType = Socks5HostType; +var SocksClientState; +(function (SocksClientState) { + SocksClientState[SocksClientState["Created"] = 0] = "Created"; + SocksClientState[SocksClientState["Connecting"] = 1] = "Connecting"; + SocksClientState[SocksClientState["Connected"] = 2] = "Connected"; + SocksClientState[SocksClientState["SentInitialHandshake"] = 3] = "SentInitialHandshake"; + SocksClientState[SocksClientState["ReceivedInitialHandshakeResponse"] = 4] = "ReceivedInitialHandshakeResponse"; + SocksClientState[SocksClientState["SentAuthentication"] = 5] = "SentAuthentication"; + SocksClientState[SocksClientState["ReceivedAuthenticationResponse"] = 6] = "ReceivedAuthenticationResponse"; + SocksClientState[SocksClientState["SentFinalHandshake"] = 7] = "SentFinalHandshake"; + SocksClientState[SocksClientState["ReceivedFinalResponse"] = 8] = "ReceivedFinalResponse"; + SocksClientState[SocksClientState["BoundWaitingForConnection"] = 9] = "BoundWaitingForConnection"; + SocksClientState[SocksClientState["Established"] = 10] = "Established"; + SocksClientState[SocksClientState["Disconnected"] = 11] = "Disconnected"; + SocksClientState[SocksClientState["Error"] = 99] = "Error"; +})(SocksClientState || (SocksClientState = {})); +exports.SocksClientState = SocksClientState; +//# sourceMappingURL=constants.js.map \ No newline at end of file diff --git a/node_modules/socks/build/common/constants.js.map b/node_modules/socks/build/common/constants.js.map new file mode 100644 index 000000000..c1e070dea --- /dev/null +++ b/node_modules/socks/build/common/constants.js.map @@ -0,0 +1 @@ +{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/common/constants.ts"],"names":[],"mappings":";;;AAIA,MAAM,eAAe,GAAG,KAAK,CAAC;AA4M5B,0CAAe;AAxMjB,kBAAkB;AAClB,MAAM,MAAM,GAAG;IACb,mBAAmB,EAAE,wFAAwF;IAC7G,+BAA+B,EAAE,oGAAoG;IACrI,wBAAwB,EAAE,8FAA8F;IACxH,oCAAoC,EAAE,2CAA2C;IACjF,uCAAuC,EAAE,uFAAuF;IAChI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/build/common/helpers.js b/node_modules/socks/build/common/helpers.js new file mode 100644 index 000000000..f84db8f67 --- /dev/null +++ b/node_modules/socks/build/common/helpers.js @@ -0,0 +1,128 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.validateSocksClientChainOptions = exports.validateSocksClientOptions = void 0; +const util_1 = require("./util"); +const constants_1 = require("./constants"); +const stream = require("stream"); +/** + * Validates the provided SocksClientOptions + * @param options { SocksClientOptions } + * @param acceptedCommands { string[] } A list of accepted SocksProxy commands. + */ +function validateSocksClientOptions(options, acceptedCommands = ['connect', 'bind', 'associate']) { + // Check SOCKs command option. + if (!constants_1.SocksCommand[options.command]) { + throw new util_1.SocksClientError(constants_1.ERRORS.InvalidSocksCommand, options); + } + // Check SocksCommand for acceptable command. + if (acceptedCommands.indexOf(options.command) === -1) { + throw new util_1.SocksClientError(constants_1.ERRORS.InvalidSocksCommandForOperation, options); + } + // Check destination + if (!isValidSocksRemoteHost(options.destination)) { + throw new util_1.SocksClientError(constants_1.ERRORS.InvalidSocksClientOptionsDestination, options); + } + // Check SOCKS proxy to use + if (!isValidSocksProxy(options.proxy)) { + throw new util_1.SocksClientError(constants_1.ERRORS.InvalidSocksClientOptionsProxy, options); + } + // Validate custom auth (if set) + validateCustomProxyAuth(options.proxy, options); + // Check timeout + if (options.timeout && !isValidTimeoutValue(options.timeout)) { + throw new util_1.SocksClientError(constants_1.ERRORS.InvalidSocksClientOptionsTimeout, options); + } + // Check existing_socket (if provided) + if (options.existing_socket && + !(options.existing_socket instanceof stream.Duplex)) { + throw new util_1.SocksClientError(constants_1.ERRORS.InvalidSocksClientOptionsExistingSocket, options); + } +} +exports.validateSocksClientOptions = validateSocksClientOptions; +/** + * Validates the SocksClientChainOptions + * @param options { SocksClientChainOptions } + */ +function validateSocksClientChainOptions(options) { + // Only connect is supported when chaining. + if (options.command !== 'connect') { + throw new util_1.SocksClientError(constants_1.ERRORS.InvalidSocksCommandChain, options); + } + // Check destination + if (!isValidSocksRemoteHost(options.destination)) { + throw new util_1.SocksClientError(constants_1.ERRORS.InvalidSocksClientOptionsDestination, options); + } + // Validate proxies (length) + if (!(options.proxies && + Array.isArray(options.proxies) && + options.proxies.length >= 2)) { + throw new util_1.SocksClientError(constants_1.ERRORS.InvalidSocksClientOptionsProxiesLength, options); + } + // Validate proxies + options.proxies.forEach((proxy) => { + if (!isValidSocksProxy(proxy)) { + throw new util_1.SocksClientError(constants_1.ERRORS.InvalidSocksClientOptionsProxy, options); + } + // Validate custom auth (if set) + validateCustomProxyAuth(proxy, options); + }); + // Check timeout + if (options.timeout && !isValidTimeoutValue(options.timeout)) { + throw new util_1.SocksClientError(constants_1.ERRORS.InvalidSocksClientOptionsTimeout, options); + } +} +exports.validateSocksClientChainOptions = validateSocksClientChainOptions; +function validateCustomProxyAuth(proxy, options) { + if (proxy.custom_auth_method !== undefined) { + // Invalid auth method range + if (proxy.custom_auth_method < constants_1.SOCKS5_CUSTOM_AUTH_START || + proxy.custom_auth_method > constants_1.SOCKS5_CUSTOM_AUTH_END) { + throw new util_1.SocksClientError(constants_1.ERRORS.InvalidSocksClientOptionsCustomAuthRange, options); + } + // Missing custom_auth_request_handler + if (proxy.custom_auth_request_handler === undefined || + typeof proxy.custom_auth_request_handler !== 'function') { + throw new util_1.SocksClientError(constants_1.ERRORS.InvalidSocksClientOptionsCustomAuthOptions, options); + } + // Missing custom_auth_response_size + if (proxy.custom_auth_response_size === undefined) { + throw new util_1.SocksClientError(constants_1.ERRORS.InvalidSocksClientOptionsCustomAuthOptions, options); + } + // Missing/invalid custom_auth_response_handler + if (proxy.custom_auth_response_handler === undefined || + typeof proxy.custom_auth_response_handler !== 'function') { + throw new util_1.SocksClientError(constants_1.ERRORS.InvalidSocksClientOptionsCustomAuthOptions, options); + } + } +} +/** + * Validates a SocksRemoteHost + * @param remoteHost { SocksRemoteHost } + */ +function isValidSocksRemoteHost(remoteHost) { + return (remoteHost && + typeof remoteHost.host === 'string' && + typeof remoteHost.port === 'number' && + remoteHost.port >= 0 && + remoteHost.port <= 65535); +} +/** + * Validates a SocksProxy + * @param proxy { SocksProxy } + */ +function isValidSocksProxy(proxy) { + return (proxy && + (typeof proxy.host === 'string' || typeof proxy.ipaddress === 'string') && + typeof proxy.port === 'number' && + proxy.port >= 0 && + proxy.port <= 65535 && + (proxy.type === 4 || proxy.type === 5)); +} +/** + * Validates a timeout value. + * @param value { Number } + */ +function isValidTimeoutValue(value) { + return typeof value === 'number' && value > 0; +} +//# sourceMappingURL=helpers.js.map \ No newline at end of file diff --git a/node_modules/socks/build/common/helpers.js.map b/node_modules/socks/build/common/helpers.js.map new file mode 100644 index 000000000..dae124861 --- /dev/null +++ b/node_modules/socks/build/common/helpers.js.map @@ -0,0 +1 @@ +{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../src/common/helpers.ts"],"names":[],"mappings":";;;AAKA,iCAAwC;AACxC,2CAMqB;AACrB,iCAAiC;AAEjC;;;;GAIG;AACH,SAAS,0BAA0B,CACjC,OAA2B,EAC3B,gBAAgB,GAAG,CAAC,SAAS,EAAE,MAAM,EAAE,WAAW,CAAC;IAEnD,8BAA8B;IAC9B,IAAI,CAAC,wBAAY,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE;QAClC,MAAM,IAAI,uBAAgB,CAAC,kBAAM,CAAC,mBAAmB,EAAE,OAAO,CAAC,CAAC;KACjE;IAED,6CAA6C;IAC7C,IAAI,gBAAgB,CAAC,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE;QACpD,MAAM,IAAI,uBAAgB,CAAC,kBAAM,CAAC,+BAA+B,EAAE,OAAO,CAAC,CAAC;KAC7E;IAED,oBAAoB;IACpB,IAAI,CAAC,sBAAsB,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE;QAChD,MAAM,IAAI,uBAAgB,CACxB,kBAAM,CAAC,oCAAoC,EAC3C,OAAO,CACR,CAAC;KACH;IAED,2BAA2B;IAC3B,IAAI,CAAC,iBAAiB,C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,MAAM,IAAI,uBAAgB,CACxB,kBAAM,CAAC,0CAA0C,EACjD,OAAO,CACR,CAAC;SACH;KACF;AACH,CAAC;AAED;;;GAGG;AACH,SAAS,sBAAsB,CAAC,UAA2B;IACzD,OAAO,CACL,UAAU;QACV,OAAO,UAAU,CAAC,IAAI,KAAK,QAAQ;QACnC,OAAO,UAAU,CAAC,IAAI,KAAK,QAAQ;QACnC,UAAU,CAAC,IAAI,IAAI,CAAC;QACpB,UAAU,CAAC,IAAI,IAAI,KAAK,CACzB,CAAC;AACJ,CAAC;AAED;;;GAGG;AACH,SAAS,iBAAiB,CAAC,KAAiB;IAC1C,OAAO,CACL,KAAK;QACL,CAAC,OAAO,KAAK,CAAC,IAAI,KAAK,QAAQ,IAAI,OAAO,KAAK,CAAC,SAAS,KAAK,QAAQ,CAAC;QACvE,OAAO,KAAK,CAAC,IAAI,KAAK,QAAQ;QAC9B,KAAK,CAAC,IAAI,IAAI,CAAC;QACf,KAAK,CAAC,IAAI,IAAI,KAAK;QACnB,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,IAAI,KAAK,CAAC,IAAI,KAAK,CAAC,CAAC,CACvC,CAAC;AACJ,CAAC;AAED;;;GAGG;AACH,SAAS,mBAAmB,CAAC,KAAa;IACxC,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,GAAG,CAAC,CAAC;AAChD,CAAC"} \ No newline at end of file diff --git a/node_modules/socks/build/common/receivebuffer.js b/node_modules/socks/build/common/receivebuffer.js new file mode 100644 index 000000000..3dacbf9b9 --- /dev/null +++ b/node_modules/socks/build/common/receivebuffer.js @@ -0,0 +1,43 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ReceiveBuffer = void 0; +class ReceiveBuffer { + constructor(size = 4096) { + this.buffer = Buffer.allocUnsafe(size); + this.offset = 0; + this.originalSize = size; + } + get length() { + return this.offset; + } + append(data) { + if (!Buffer.isBuffer(data)) { + throw new Error('Attempted to append a non-buffer instance to ReceiveBuffer.'); + } + if (this.offset + data.length >= this.buffer.length) { + const tmp = this.buffer; + this.buffer = Buffer.allocUnsafe(Math.max(this.buffer.length + this.originalSize, this.buffer.length + data.length)); + tmp.copy(this.buffer); + } + data.copy(this.buffer, this.offset); + return (this.offset += data.length); + } + peek(length) { + if (length > this.offset) { + throw new Error('Attempted to read beyond the bounds of the managed internal data.'); + } + return this.buffer.slice(0, length); + } + get(length) { + if (length > this.offset) { + throw new Error('Attempted to read beyond the bounds of the managed internal data.'); + } + const value = Buffer.allocUnsafe(length); + this.buffer.slice(0, length).copy(value); + this.buffer.copyWithin(0, length, length + this.offset - length); + this.offset -= length; + return value; + } +} +exports.ReceiveBuffer = ReceiveBuffer; +//# sourceMappingURL=receivebuffer.js.map \ No newline at end of file diff --git a/node_modules/socks/build/common/receivebuffer.js.map b/node_modules/socks/build/common/receivebuffer.js.map new file mode 100644 index 000000000..144edb0b9 --- /dev/null +++ b/node_modules/socks/build/common/receivebuffer.js.map @@ -0,0 +1 @@ +{"version":3,"file":"receivebuffer.js","sourceRoot":"","sources":["../../src/common/receivebuffer.ts"],"names":[],"mappings":";;;AAAA,MAAM,aAAa;IAKjB,YAAY,OAAe,IAAI;QAC7B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;QACvC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC;QAChB,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC;IAC3B,CAAC;IAED,IAAI,MAAM;QACR,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;IAED,MAAM,CAAC,IAAY;QACjB,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE;YAC1B,MAAM,IAAI,KAAK,CACb,6DAA6D,CAC9D,CAAC;SACH;QAED,IAAI,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE;YACnD,MAAM,GAAG,GA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node_modules/socks/build/common/util.js new file mode 100644 index 000000000..283314a0d --- /dev/null +++ b/node_modules/socks/build/common/util.js @@ -0,0 +1,26 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.shuffleArray = exports.SocksClientError = void 0; +/** + * Error wrapper for SocksClient + */ +class SocksClientError extends Error { + constructor(message, options) { + super(message); + this.options = options; + } +} +exports.SocksClientError = SocksClientError; +/** + * Shuffles a given array. + * @param array The array to shuffle. + */ +function shuffleArray(array) { + // tslint:disable-next-line:no-increment-decrement + for (let i = array.length - 1; i > 0; i--) { + const j = Math.floor(Math.random() * (i + 1)); + [array[i], array[j]] = [array[j], array[i]]; + } +} +exports.shuffleArray = shuffleArray; +//# sourceMappingURL=util.js.map \ No newline at end of file diff --git a/node_modules/socks/build/common/util.js.map b/node_modules/socks/build/common/util.js.map new file mode 100644 index 000000000..8d94a2ace --- /dev/null +++ b/node_modules/socks/build/common/util.js.map @@ -0,0 +1 @@ +{"version":3,"file":"util.js","sourceRoot":"","sources":["../../src/common/util.ts"],"names":[],"mappings":";;;AAEA;;GAEG;AACH,MAAM,gBAAiB,SAAQ,KAAK;IAClC,YACE,OAAe,EACR,OAAqD;QAE5D,KAAK,CAAC,OAAO,CAAC,CAAC;QAFR,YAAO,GAAP,OAAO,CAA8C;IAG9D,CAAC;CACF;AAwBuB,4CAAgB;AAtBxC;;;GAGG;AACH,SAAS,YAAY,CAAC,KAAY;IAChC,kDAAkD;IAClD,KAAK,IAAI,CAAC,GAAG,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;QACzC,MAAM,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;QAC9C,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;KAC7C;AACH,CAAC;AAYyC,oCAAY"} \ No newline at end of file diff --git a/node_modules/socks/build/index.js b/node_modules/socks/build/index.js new file mode 100644 index 000000000..17b6f42df --- /dev/null +++ b/node_modules/socks/build/index.js @@ -0,0 +1,14 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +__exportStar(require("./client/socksclient"), exports); +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/socks/build/index.js.map b/node_modules/socks/build/index.js.map new file mode 100644 index 000000000..ff654a08e --- /dev/null +++ b/node_modules/socks/build/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,uDAAqC"} \ No newline at end of file diff --git a/node_modules/socks/docs/examples/index.md b/node_modules/socks/docs/examples/index.md new file mode 100644 index 000000000..87bfe250e --- /dev/null +++ b/node_modules/socks/docs/examples/index.md @@ -0,0 +1,17 @@ +# socks examples + +## TypeScript Examples + +[Connect command](typescript/connectExample.md) + +[Bind command](typescript/bindExample.md) + +[Associate command](typescript/associateExample.md) + +## JavaScript Examples + +[Connect command](javascript/connectExample.md) + +[Bind command](javascript/bindExample.md) + +[Associate command](javascript/associateExample.md) \ No newline at end of file diff --git a/node_modules/socks/docs/examples/javascript/associateExample.md b/node_modules/socks/docs/examples/javascript/associateExample.md new file mode 100644 index 000000000..c2c7b17b7 --- /dev/null +++ b/node_modules/socks/docs/examples/javascript/associateExample.md @@ -0,0 +1,90 @@ +# socks examples + +## Example for SOCKS 'associate' command + +The associate command tells the SOCKS proxy server to establish a UDP relay. The server binds to a new UDP port and communicates the newly opened port back to the origin client. From here, any SOCKS UDP frame packets sent to this special UDP port on the Proxy server will be forwarded to the desired destination, and any responses will be forwarded back to the origin client (you). + +This can be used for things such as DNS queries, and other UDP communicates. + +**Connection Steps** + +1. Client -(associate)-> Proxy (Tells the proxy to create a UDP relay and bind on a new port) +2. Client <-(port)- Proxy (Tells the origin client which port it opened and is accepting UDP frame packets on) + +At this point the proxy is accepting UDP frames on the specified port. + +3. Client --(udp frame) -> Proxy -> Destination (The origin client sends a UDP frame to the proxy on the UDP port, and the proxy then forwards it to the destination specified in the UDP frame.) +4. Client <--(udp frame) <-- Proxy <-- Destination (The destination client responds to the udp packet sent in #3) + +## Usage + +The 'associate' command can only be used by creating a new SocksClient instance and listening for the 'established' event. + +**Note:** UDP packets relayed through the proxy servers are encompassed in a special Socks UDP frame format. SocksClient.createUDPFrame() and SocksClient.parseUDPFrame() create and parse these special UDP packets. + +```typescript +const dgram = require('dgram'); +const SocksClient = require('socks').SocksClient; + +// Create a local UDP socket for sending/receiving packets to/from the proxy. +const udpSocket = dgram.createSocket('udp4'); +udpSocket.bind(); + +// Listen for incoming UDP packets from the proxy server. +udpSocket.on('message', (message, rinfo) => { + console.log(SocksClient.parseUDPFrame(message)); + /* + { frameNumber: 0, + remoteHost: { host: '8.8.8.8', port: 53 }, // The remote host that replied with a UDP packet + data: // The data + } + */ +}); + +const options = { + proxy: { + host: '104.131.124.203', + port: 1081, + type: 5 + }, + + // This should be the ip and port of the expected client that will be sending UDP frames to the newly opened UDP port on the server. + // Most SOCKS servers accept 0.0.0.0 as a wildcard address to accept UDP frames from any source. + destination: { + host: '0.0.0.0', + port: 0 + }, + + command: 'associate' +}; + +const client = new SocksClient(options); + +// This event is fired when the SOCKS server has started listening on a new UDP port for UDP relaying. +client.on('established', info => { + console.log(info); + /* + { + socket: , + remoteHost: { // This is the remote port on the SOCKS proxy server to send UDP frame packets to. + host: '104.131.124.203', + port: 58232 + } + } + */ + + // Send a udp frame to 8.8.8.8 on port 53 through the proxy. + const packet = SocksClient.createUDPFrame({ + remoteHost: { host: '8.8.8.8', port: 53 }, + data: Buffer.from('hello') // A DNS lookup in the real world. + }); + + // Send packet. + udpSocket.send(packet, info.remoteHost.port, info.remoteHost.host); +}); + +// SOCKS proxy failed to bind. +client.on('error', () => { + // Handle errors +}); +``` diff --git a/node_modules/socks/docs/examples/javascript/bindExample.md b/node_modules/socks/docs/examples/javascript/bindExample.md new file mode 100644 index 000000000..be601d522 --- /dev/null +++ b/node_modules/socks/docs/examples/javascript/bindExample.md @@ -0,0 +1,83 @@ +# socks examples + +## Example for SOCKS 'bind' command + +The bind command tells the SOCKS proxy server to bind and listen on a new TCP port for an incoming connection. It communicates the newly opened port back to the origin client. Once a incoming connection is accepted by the SOCKS proxy server it then communicates the remote host that connected to the SOCKS proxy back through the same initial connection via the origin client. + +This can be used for things such as FTP clients which require incoming TCP connections, etc. + +**Connection Steps** + +1. Client -(bind)-> Proxy (Tells the proxy to bind to a new port) +2. Client <-(port)- Proxy (Tells the origin client which port it opened) +3. Client2 --> Proxy (Other client connects to the proxy on this port) +4. Client <--(client2's host info) (Proxy tells the origin client who connected to it) +5. Original connection to the proxy is now a full TCP stream between client (you) and client2. +6. Client <--> Proxy <--> Client2 + + +## Usage + +The 'bind' command can only be used by creating a new SocksClient instance and listening for 'bound' and 'established' events. + + +```typescript +const SocksClient = require('socks').SocksClient; + +const options = { + proxy: { + host: '104.131.124.203', + port: 1081, + type: 5 + }, + + // This should be the ip and port of the expected client that will connect to the SOCKS proxy server on the newly bound port. + // Most SOCKS servers accept 0.0.0.0 as a wildcard address to accept any client. + destination: { + host: '0.0.0.0', + port: 0 + }, + + command: 'bind' +}; + +const client = new SocksClient(options); + +// This event is fired when the SOCKS server has started listening on a new port for incoming connections. +client.on('bound', (info) => { + console.log(info); + /* + { + socket: , + remoteHost: { // This is the remote ip and port of the SOCKS proxy that is now accepting incoming connections. + host: '104.131.124.203', + port: 49928 + } + } + */ +}); + +// This event is fired when the SOCKS server has accepted an incoming connection on the newly bound port. +client.on('established', (info) => { + console.log(info); + /* + { + socket: , + remoteHost: { // This is the remote ip and port that connected to the SOCKS proxy on the newly bound port. + host: '1.2.3.4', + port: 58232 + } + } + */ + + // At this point info.socket is a regular net.Socket TCP connection between client and client2 (1.2.3.4) (the client which connected to the proxy on the newly bound port.) + + console.log(info.socket); + // (this is a raw net.Socket that is established to the destination host through the given proxy servers) +}); + +// SOCKS proxy failed to bind. +client.on('error', () => { + // Handle errors +}); +``` \ No newline at end of file diff --git a/node_modules/socks/docs/examples/javascript/connectExample.md b/node_modules/socks/docs/examples/javascript/connectExample.md new file mode 100644 index 000000000..66244c5b8 --- /dev/null +++ b/node_modules/socks/docs/examples/javascript/connectExample.md @@ -0,0 +1,258 @@ +# socks examples + +## Example for SOCKS 'connect' command + +The connect command is the most common use-case for a SOCKS proxy. This establishes a direct connection to a destination host through a proxy server. The destination host only has knowledge of the proxy server connecting to it and does not know about the origin client (you). + +**Origin Client (you) <-> Proxy Server <-> Destination Server** + +In this example, we are connecting to a web server on port 80, and sending a very basic HTTP request to receive a response. It's worth noting that there are many socks-http-agents that can be used with the node http module (and libraries such as request.js) to make this easier. This HTTP request is used as a simple example. + +The 'connect' command can be used via the SocksClient.createConnection() factory function as well as by creating a SocksClient instance and using event handlers. + +### Using createConnection with async/await + +Since SocksClient.createConnection returns a Promise, we can easily use async/await for flow control. + +```typescript +const SocksClient = require('socks').SocksClient; + +const options = { + proxy: { + host: '104.131.124.203', + port: 1081, + type: 5 + }, + + destination: { + host: 'ip-api.com', // host names are supported with SOCKS v4a and SOCKS v5. + port: 80 + }, + + command: 'connect' +}; + +async function start() { + try { + const info = await SocksClient.createConnection(options); + + console.log(info.socket); + // (this is a raw net.Socket that is established to the destination host through the given proxy servers) + + info.socket.write('GET /json HTTP/1.1\nHost: ip-api.com\n\n'); + info.socket.on('data', (data) => { + console.log(data.toString()); // ip-api.com sees that the last proxy (104.131.124.203) is connected to it and not the origin client (you). + /* + HTTP/1.1 200 OK + Access-Control-Allow-Origin: * + Content-Type: application/json; charset=utf-8 + Date: Sun, 24 Dec 2017 03:47:51 GMT + Content-Length: 300 + + { + "as":"AS14061 Digital Ocean, Inc.", + "city":"Clifton", + "country":"United States", + "countryCode":"US", + "isp":"Digital Ocean", + "lat":40.8326, + "lon":-74.1307, + "org":"Digital Ocean", + "query":"104.131.124.203", + "region":"NJ", + "regionName":"New Jersey", + "status":"success", + "timezone":"America/New_York", + "zip":"07014" + } + */ + } catch (err) { + // Handle errors + } +} + +start(); +``` + +### Using createConnection with Promises + +```typescript +const SocksClient = require('socks').SocksClient; + +const options = { + proxy: { + ipaddress: '104.131.124.203', + port: 1081, + type: 5 + }, + + destination: { + host: 'ip-api.com', // host names are supported with SOCKS v4a and SOCKS v5. + port: 80 + }, + + command: 'connect' +}; + +SocksClient.createConnection(options) +.then(info => { + console.log(info.socket); + // (this is a raw net.Socket that is established to the destination host through the given proxy servers) + + info.socket.write('GET /json HTTP/1.1\nHost: ip-api.com\n\n'); + info.socket.on('data', (data) => { + console.log(data.toString()); // ip-api.com sees that the last proxy (104.131.124.203) is connected to it and not the origin client (you). + /* + HTTP/1.1 200 OK + Access-Control-Allow-Origin: * + Content-Type: application/json; charset=utf-8 + Date: Sun, 24 Dec 2017 03:47:51 GMT + Content-Length: 300 + + { + "as":"AS14061 Digital Ocean, Inc.", + "city":"Clifton", + "country":"United States", + "countryCode":"US", + "isp":"Digital Ocean", + "lat":40.8326, + "lon":-74.1307, + "org":"Digital Ocean", + "query":"104.131.124.203", + "region":"NJ", + "regionName":"New Jersey", + "status":"success", + "timezone":"America/New_York", + "zip":"07014" + } + */ +}) +.catch(err => { + // handle errors +}); +``` + +### Using createConnection with callbacks + +SocksClient.createConnection() optionally accepts a callback function as a second parameter. + +**Note:** If a callback function is provided, a Promise is still returned from the function, but the promise will always resolve regardless of if there was en error. (tldr: Do not mix callbacks and Promises). + +```typescript +const SocksClient = require('socks').SocksClient; + +const options = { + proxy: { + ipaddress: '104.131.124.203', + port: 1081, + type: 5 + }, + + destination: { + host: 'ip-api.com', // host names are supported with SOCKS v4a and SOCKS v5. + port: 80 + }, + + command: 'connect' +}; + +SocksClient.createConnection(options, (err, info) => { + if (err) { + // handle errors + } else { + console.log(info.socket); + // (this is a raw net.Socket that is established to the destination host through the given proxy servers) + + info.socket.write('GET /json HTTP/1.1\nHost: ip-api.com\n\n'); + info.socket.on('data', (data) => { + console.log(data.toString()); // ip-api.com sees that the last proxy (104.131.124.203) is connected to it and not the origin client (you). + /* + HTTP/1.1 200 OK + Access-Control-Allow-Origin: * + Content-Type: application/json; charset=utf-8 + Date: Sun, 24 Dec 2017 03:47:51 GMT + Content-Length: 300 + + { + "as":"AS14061 Digital Ocean, Inc.", + "city":"Clifton", + "country":"United States", + "countryCode":"US", + "isp":"Digital Ocean", + "lat":40.8326, + "lon":-74.1307, + "org":"Digital Ocean", + "query":"104.131.124.203", + "region":"NJ", + "regionName":"New Jersey", + "status":"success", + "timezone":"America/New_York", + "zip":"07014" + } + */ + } +}) +``` + +### Using event handlers + +SocksClient also supports instance creation of a SocksClient. This allows for event based flow control. + +```typescript +const SocksClient = require('socks').SocksClient; + +const options = { + proxy: { + ipaddress: '104.131.124.203', + port: 1081, + type: 5 + }, + + destination: { + host: 'ip-api.com', // host names are supported with SOCKS v4a and SOCKS v5. + port: 80 + }, + + command: 'connect' +}; + +const client = new SocksClient(options); + +client.on('established', (info) => { + console.log(info.socket); + // (this is a raw net.Socket that is established to the destination host through the given proxy servers) + + info.socket.write('GET /json HTTP/1.1\nHost: ip-api.com\n\n'); + info.socket.on('data', (data) => { + console.log(data.toString()); // ip-api.com sees that the last proxy (104.131.124.203) is connected to it and not the origin client (you). + /* + HTTP/1.1 200 OK + Access-Control-Allow-Origin: * + Content-Type: application/json; charset=utf-8 + Date: Sun, 24 Dec 2017 03:47:51 GMT + Content-Length: 300 + + { + "as":"AS14061 Digital Ocean, Inc.", + "city":"Clifton", + "country":"United States", + "countryCode":"US", + "isp":"Digital Ocean", + "lat":40.8326, + "lon":-74.1307, + "org":"Digital Ocean", + "query":"104.131.124.203", + "region":"NJ", + "regionName":"New Jersey", + "status":"success", + "timezone":"America/New_York", + "zip":"07014" + } + */ +}); + +// Failed to establish proxy connection to destination. +client.on('error', () => { + // Handle errors +}); +``` \ No newline at end of file diff --git a/node_modules/socks/docs/examples/typescript/associateExample.md b/node_modules/socks/docs/examples/typescript/associateExample.md new file mode 100644 index 000000000..e8ca19344 --- /dev/null +++ b/node_modules/socks/docs/examples/typescript/associateExample.md @@ -0,0 +1,93 @@ +# socks examples + +## Example for SOCKS 'associate' command + +The associate command tells the SOCKS proxy server to establish a UDP relay. The server binds to a new UDP port and communicates the newly opened port back to the origin client. From here, any SOCKS UDP frame packets sent to this special UDP port on the Proxy server will be forwarded to the desired destination, and any responses will be forwarded back to the origin client (you). + +This can be used for things such as DNS queries, and other UDP communicates. + +**Connection Steps** + +1. Client -(associate)-> Proxy (Tells the proxy to create a UDP relay and bind on a new port) +2. Client <-(port)- Proxy (Tells the origin client which port it opened and is accepting UDP frame packets on) + +At this point the proxy is accepting UDP frames on the specified port. + +3. Client --(udp frame) -> Proxy -> Destination (The origin client sends a UDP frame to the proxy on the UDP port, and the proxy then forwards it to the destination specified in the UDP frame.) +4. Client <--(udp frame) <-- Proxy <-- Destination (The destination client responds to the udp packet sent in #3) + +## Usage + +The 'associate' command can only be used by creating a new SocksClient instance and listening for the 'established' event. + +**Note:** UDP packets relayed through the proxy servers are packaged in a special Socks UDP frame format. SocksClient.createUDPFrame() and SocksClient.parseUDPFrame() create and parse these special UDP packets. + +```typescript +import * as dgram from 'dgram'; +import { SocksClient, SocksClientOptions } from 'socks'; + +// Create a local UDP socket for sending/receiving packets to/from the proxy. +const udpSocket = dgram.createSocket('udp4'); +udpSocket.bind(); + +// Listen for incoming UDP packets from the proxy server. +udpSocket.on('message', (message, rinfo) => { + console.log(SocksClient.parseUDPFrame(message)); + /* + { frameNumber: 0, + remoteHost: { host: '8.8.8.8', port: 53 }, // The remote host that replied with a UDP packet + data: // The data + } + */ +}); + +const options: SocksClientOptions = { + proxy: { + host: '104.131.124.203', + port: 1081, + type: 5 + }, + + // This should be the ip and port of the expected client that will be sending UDP frames to the newly opened UDP port on the server. + // Most SOCKS servers accept 0.0.0.0 as a wildcard address to accept UDP frames from any source. + destination: { + host: '0.0.0.0', + port: 0 + }, + + command: 'associate' +}; + +const client = new SocksClient(options); + +// This event is fired when the SOCKS server has started listening on a new UDP port for UDP relaying. +client.on('established', info => { + console.log(info); + /* + { + socket: , + remoteHost: { // This is the remote port on the SOCKS proxy server to send UDP frame packets to. + host: '104.131.124.203', + port: 58232 + } + } + */ + + // Send a udp frame to 8.8.8.8 on port 53 through the proxy. + const packet = SocksClient.createUDPFrame({ + remoteHost: { host: '8.8.8.8', port: 53 }, + data: Buffer.from('hello') // A DNS lookup in the real world. + }); + + // Send packet. + udpSocket.send(packet, info.remoteHost.port, info.remoteHost.host); +}); + +// SOCKS proxy failed to bind. +client.on('error', () => { + // Handle errors +}); + +// Start connection +client.connect(); +``` diff --git a/node_modules/socks/docs/examples/typescript/bindExample.md b/node_modules/socks/docs/examples/typescript/bindExample.md new file mode 100644 index 000000000..6b7607df7 --- /dev/null +++ b/node_modules/socks/docs/examples/typescript/bindExample.md @@ -0,0 +1,86 @@ +# socks examples + +## Example for SOCKS 'bind' command + +The bind command tells the SOCKS proxy server to bind and listen on a new TCP port for an incoming connection. It communicates the newly opened port back to the origin client. Once a incoming connection is accepted by the SOCKS proxy server it then communicates the remote host that connected to the SOCKS proxy back through the same initial connection via the origin client. + +This can be used for things such as FTP clients which require incoming TCP connections, etc. + +**Connection Steps** + +1. Client -(bind)-> Proxy (Tells the proxy to bind to a new port) +2. Client <-(port)- Proxy (Tells the origin client which port it opened) +3. Client2 --> Proxy (Other client connects to the proxy on this port) +4. Client <--(client2's host info) (Proxy tells the origin client who connected to it) +5. Original connection to the proxy is now a full TCP stream between client (you) and client2. +6. Client <--> Proxy <--> Client2 + + +## Usage + +The 'bind' command can only be used by creating a new SocksClient instance and listening for 'bound' and 'established' events. + + +```typescript +import { SocksClient, SocksClientOptions } from 'socks'; + +const options: SocksClientOptions = { + proxy: { + host: '104.131.124.203', + port: 1081, + type: 5 + }, + + // This should be the ip and port of the expected client that will connect to the SOCKS proxy server on the newly bound port. + // Most SOCKS servers accept 0.0.0.0 as a wildcard address to accept any client. + destination: { + host: '0.0.0.0', + port: 0 + }, + + command: 'bind' +}; + +const client = new SocksClient(options); + +// This event is fired when the SOCKS server has started listening on a new port for incoming connections. +client.on('bound', (info) => { + console.log(info); + /* + { + socket: , + remoteHost: { // This is the remote ip and port of the SOCKS proxy that is now accepting incoming connections. + host: '104.131.124.203', + port: 49928 + } + } + */ +}); + +// This event is fired when the SOCKS server has accepted an incoming connection on the newly bound port. +client.on('established', (info) => { + console.log(info); + /* + { + socket: , + remoteHost: { // This is the remote ip and port that connected to the SOCKS proxy on the newly bound port. + host: '1.2.3.4', + port: 58232 + } + } + */ + + // At this point info.socket is a regular net.Socket TCP connection between client and client2 (1.2.3.4) (the client which connected to the proxy on the newly bound port.) + + console.log(info.socket); + // (this is a raw net.Socket that is established to the destination host through the given proxy servers) +}); + +// SOCKS proxy failed to bind. +client.on('error', () => { + // Handle errors +}); + +// Start connection +client.connect(); +``` \ No newline at end of file diff --git a/node_modules/socks/docs/examples/typescript/connectExample.md b/node_modules/socks/docs/examples/typescript/connectExample.md new file mode 100644 index 000000000..30606d0ba --- /dev/null +++ b/node_modules/socks/docs/examples/typescript/connectExample.md @@ -0,0 +1,265 @@ +# socks examples + +## Example for SOCKS 'connect' command + +The connect command is the most common use-case for a SOCKS proxy. This establishes a direct connection to a destination host through a proxy server. The destination host only has knowledge of the proxy server connecting to it and does not know about the origin client (you). + +**Origin Client (you) <-> Proxy Server <-> Destination Server** + +In this example, we are connecting to a web server on port 80, and sending a very basic HTTP request to receive a response. It's worth noting that there are many socks-http-agents that can be used with the node http module (and libraries such as request.js) to make this easier. This HTTP request is used as a simple example. + +The 'connect' command can be used via the SocksClient.createConnection() factory function as well as by creating a SocksClient instance and using event handlers. + +### Using createConnection with async/await + +Since SocksClient.createConnection returns a Promise, we can easily use async/await for flow control. + +```typescript +import { SocksClient, SocksClientOptions } from 'socks'; + +const options: SocksClientOptions = { + proxy: { + host: '104.131.124.203', + port: 1081, + type: 5 + }, + + destination: { + host: 'ip-api.com', // host names are supported with SOCKS v4a and SOCKS v5. + port: 80 + }, + + command: 'connect' +}; + +async function start() { + try { + const info = await SocksClient.createConnection(options); + + console.log(info.socket); + // (this is a raw net.Socket that is established to the destination host through the given proxy servers) + + info.socket.write('GET /json HTTP/1.1\nHost: ip-api.com\n\n'); + info.socket.on('data', (data) => { + console.log(data.toString()); // ip-api.com sees that the last proxy (104.131.124.203) is connected to it and not the origin client (you). + /* + HTTP/1.1 200 OK + Access-Control-Allow-Origin: * + Content-Type: application/json; charset=utf-8 + Date: Sun, 24 Dec 2017 03:47:51 GMT + Content-Length: 300 + + { + "as":"AS14061 Digital Ocean, Inc.", + "city":"Clifton", + "country":"United States", + "countryCode":"US", + "isp":"Digital Ocean", + "lat":40.8326, + "lon":-74.1307, + "org":"Digital Ocean", + "query":"104.131.124.203", + "region":"NJ", + "regionName":"New Jersey", + "status":"success", + "timezone":"America/New_York", + "zip":"07014" + } + */ + }); + } catch (err) { + // Handle errors + } +} + +start(); +``` + +### Using createConnection with Promises + +```typescript +import { SocksClient, SocksClientOptions } from 'socks'; + +const options: SocksClientOptions = { + proxy: { + ipaddress: '104.131.124.203', + port: 1081, + type: 5 + }, + + destination: { + host: 'ip-api.com', // host names are supported with SOCKS v4a and SOCKS v5. + port: 80 + }, + + command: 'connect' +}; + +SocksClient.createConnection(options) +.then(info => { + console.log(info.socket); + // (this is a raw net.Socket that is established to the destination host through the given proxy servers) + + info.socket.write('GET /json HTTP/1.1\nHost: ip-api.com\n\n'); + info.socket.on('data', (data) => { + console.log(data.toString()); // ip-api.com sees that the last proxy (104.131.124.203) is connected to it and not the origin client (you). + /* + HTTP/1.1 200 OK + Access-Control-Allow-Origin: * + Content-Type: application/json; charset=utf-8 + Date: Sun, 24 Dec 2017 03:47:51 GMT + Content-Length: 300 + + { + "as":"AS14061 Digital Ocean, Inc.", + "city":"Clifton", + "country":"United States", + "countryCode":"US", + "isp":"Digital Ocean", + "lat":40.8326, + "lon":-74.1307, + "org":"Digital Ocean", + "query":"104.131.124.203", + "region":"NJ", + "regionName":"New Jersey", + "status":"success", + "timezone":"America/New_York", + "zip":"07014" + } + */ + }); +}) +.catch(err => { + // handle errors +}); +``` + +### Using createConnection with callbacks + +SocksClient.createConnection() optionally accepts a callback function as a second parameter. + +**Note:** If a callback function is provided, a Promise is still returned from the function, but the promise will always resolve regardless of if there was en error. (tldr: Do not mix callbacks and Promises). + +```typescript +import { SocksClient, SocksClientOptions } from 'socks'; + +const options: SocksClientOptions = { + proxy: { + ipaddress: '104.131.124.203', + port: 1081, + type: 5 + }, + + destination: { + host: 'ip-api.com', // host names are supported with SOCKS v4a and SOCKS v5. + port: 80 + }, + + command: 'connect' +}; + +SocksClient.createConnection(options, (err, info) => { + if (err) { + // handle errors + } else { + console.log(info.socket); + // (this is a raw net.Socket that is established to the destination host through the given proxy servers) + + info.socket.write('GET /json HTTP/1.1\nHost: ip-api.com\n\n'); + info.socket.on('data', (data) => { + console.log(data.toString()); // ip-api.com sees that the last proxy (104.131.124.203) is connected to it and not the origin client (you). + /* + HTTP/1.1 200 OK + Access-Control-Allow-Origin: * + Content-Type: application/json; charset=utf-8 + Date: Sun, 24 Dec 2017 03:47:51 GMT + Content-Length: 300 + + { + "as":"AS14061 Digital Ocean, Inc.", + "city":"Clifton", + "country":"United States", + "countryCode":"US", + "isp":"Digital Ocean", + "lat":40.8326, + "lon":-74.1307, + "org":"Digital Ocean", + "query":"104.131.124.203", + "region":"NJ", + "regionName":"New Jersey", + "status":"success", + "timezone":"America/New_York", + "zip":"07014" + } + */ + }); + } +}) +``` + +### Using event handlers + +SocksClient also supports instance creation of a SocksClient. This allows for event based flow control. + +```typescript +import { SocksClient, SocksClientOptions } from 'socks'; + +const options: SocksClientOptions = { + proxy: { + ipaddress: '104.131.124.203', + port: 1081, + type: 5 + }, + + destination: { + host: 'ip-api.com', // host names are supported with SOCKS v4a and SOCKS v5. + port: 80 + }, + + command: 'connect' +}; + +const client = new SocksClient(options); + +client.on('established', (info) => { + console.log(info.socket); + // (this is a raw net.Socket that is established to the destination host through the given proxy servers) + + info.socket.write('GET /json HTTP/1.1\nHost: ip-api.com\n\n'); + info.socket.on('data', (data) => { + console.log(data.toString()); // ip-api.com sees that the last proxy (104.131.124.203) is connected to it and not the origin client (you). + /* + HTTP/1.1 200 OK + Access-Control-Allow-Origin: * + Content-Type: application/json; charset=utf-8 + Date: Sun, 24 Dec 2017 03:47:51 GMT + Content-Length: 300 + + { + "as":"AS14061 Digital Ocean, Inc.", + "city":"Clifton", + "country":"United States", + "countryCode":"US", + "isp":"Digital Ocean", + "lat":40.8326, + "lon":-74.1307, + "org":"Digital Ocean", + "query":"104.131.124.203", + "region":"NJ", + "regionName":"New Jersey", + "status":"success", + "timezone":"America/New_York", + "zip":"07014" + } + */ + }); +}); + +// Failed to establish proxy connection to destination. +client.on('error', () => { + // Handle errors +}); + +// Start connection +client.connect(); +``` \ No newline at end of file diff --git a/node_modules/socks/docs/index.md b/node_modules/socks/docs/index.md new file mode 100644 index 000000000..3eb1d7118 --- /dev/null +++ b/node_modules/socks/docs/index.md @@ -0,0 +1,5 @@ +# Documentation + +- [API Reference](https://github.com/JoshGlazebrook/socks#api-reference) + +- [Code Examples](./examples/index.md) \ No newline at end of file diff --git a/node_modules/socks/docs/migratingFromV1.md b/node_modules/socks/docs/migratingFromV1.md new file mode 100644 index 000000000..dd008384b --- /dev/null +++ b/node_modules/socks/docs/migratingFromV1.md @@ -0,0 +1,86 @@ +# socks + +## Migrating from v1 + +For the most part, migrating from v1 takes minimal effort as v2 still supports factory creation of proxy connections with callback support. + +### Notable breaking changes + +- In an options object, the proxy 'command' is now required and does not default to 'connect'. +- **In an options object, 'target' is now known as 'destination'.** +- Sockets are no longer paused after a SOCKS connection is made, so socket.resume() is no longer required. (Please be sure to attach data handlers immediately to the Socket to avoid losing data). +- In v2, only the 'connect' command is supported via the factory SocksClient.createConnection function. (BIND and ASSOCIATE must be used with a SocksClient instance via event handlers). +- In v2, the factory SocksClient.createConnection function callback is called with a single object rather than separate socket and info object. +- A SOCKS http/https agent is no longer bundled into the library. + +For informational purposes, here is the original getting started example from v1 converted to work with v2. + +### Before (v1) + +```javascript +var Socks = require('socks'); + +var options = { + proxy: { + ipaddress: "202.101.228.108", + port: 1080, + type: 5 + }, + target: { + host: "google.com", + port: 80 + }, + command: 'connect' +}; + +Socks.createConnection(options, function(err, socket, info) { + if (err) + console.log(err); + else { + socket.write("GET / HTTP/1.1\nHost: google.com\n\n"); + socket.on('data', function(data) { + console.log(data.length); + console.log(data); + }); + + // PLEASE NOTE: sockets need to be resumed before any data will come in or out as they are paused right before this callback is fired. + socket.resume(); + + // 569 + // = 10.13.0", + "npm": ">= 3.0.0" + }, + "author": "Josh Glazebrook", + "contributors": [ + "castorw" + ], + "license": "MIT", + "readmeFilename": "README.md", + "devDependencies": { + "@types/ip": "1.1.0", + "@types/mocha": "^9.1.0", + "@types/node": "^17.0.15", + "coveralls": "^3.1.1", + "mocha": "^9.2.0", + "nyc": "15.1.0", + "prettier": "^2.5.1", + "socks5-server": "^0.1.1", + "ts-node": "^10.4.0", + "typescript": "^4.5.5" + }, + "dependencies": { + "ip": "^1.1.5", + "smart-buffer": "^4.2.0" + }, + "scripts": { + "prepublish": "npm install -g typescript && npm run build", + "test": "NODE_ENV=test mocha --recursive --require ts-node/register test/**/*.ts", + "prettier": "prettier --write ./src/**/*.ts --config .prettierrc.yaml", + "coverage": "NODE_ENV=test nyc npm test", + "coveralls": "NODE_ENV=test nyc npm test && nyc report --reporter=text-lcov | coveralls", + "lint": "tslint --project tsconfig.json 'src/**/*.ts'", + "build": "rm -rf build typings && prettier --write ./src/**/*.ts --config .prettierrc.yaml && tsc -p ." + }, + "nyc": { + "extension": [ + ".ts", + ".tsx" + ], + "include": [ + "src/*.ts", + "src/**/*.ts" + ], + "exclude": [ + "**.*.d.ts", + "node_modules", + "typings" + ], + "require": [ + "ts-node/register" + ], + "reporter": [ + "json", + "html" + ], + "all": true + } +} diff --git a/node_modules/socks/typings/client/socksclient.d.ts b/node_modules/socks/typings/client/socksclient.d.ts new file mode 100644 index 000000000..d8ce1b965 --- /dev/null +++ b/node_modules/socks/typings/client/socksclient.d.ts @@ -0,0 +1,160 @@ +/// +import { EventEmitter } from 'events'; +import { SocksClientOptions, SocksClientChainOptions, SocksRemoteHost, SocksProxy, SocksClientBoundEvent, SocksClientEstablishedEvent, SocksUDPFrameDetails } from '../common/constants'; +import { SocksClientError } from '../common/util'; +import { Duplex } from 'stream'; +declare interface SocksClient { + on(event: 'error', listener: (err: SocksClientError) => void): this; + on(event: 'bound', listener: (info: SocksClientBoundEvent) => void): this; + on(event: 'established', listener: (info: SocksClientEstablishedEvent) => void): this; + once(event: string, listener: (...args: any[]) => void): this; + once(event: 'error', listener: (err: SocksClientError) => void): this; + once(event: 'bound', listener: (info: SocksClientBoundEvent) => void): this; + once(event: 'established', listener: (info: SocksClientEstablishedEvent) => void): this; + emit(event: string | symbol, ...args: any[]): boolean; + emit(event: 'error', err: SocksClientError): boolean; + emit(event: 'bound', info: SocksClientBoundEvent): boolean; + emit(event: 'established', info: SocksClientEstablishedEvent): boolean; +} +declare class SocksClient extends EventEmitter implements SocksClient { + private options; + private socket; + private state; + private receiveBuffer; + private nextRequiredPacketBufferSize; + private socks5ChosenAuthType; + private onDataReceived; + private onClose; + private onError; + private onConnect; + constructor(options: SocksClientOptions); + /** + * Creates a new SOCKS connection. + * + * Note: Supports callbacks and promises. Only supports the connect command. + * @param options { SocksClientOptions } Options. + * @param callback { Function } An optional callback function. + * @returns { Promise } + */ + static createConnection(options: SocksClientOptions, callback?: Function): Promise; + /** + * Creates a new SOCKS connection chain to a destination host through 2 or more SOCKS proxies. + * + * Note: Supports callbacks and promises. Only supports the connect method. + * Note: Implemented via createConnection() factory function. + * @param options { SocksClientChainOptions } Options + * @param callback { Function } An optional callback function. + * @returns { Promise } + */ + static createConnectionChain(options: SocksClientChainOptions, callback?: Function): Promise; + /** + * Creates a SOCKS UDP Frame. + * @param options + */ + static createUDPFrame(options: SocksUDPFrameDetails): Buffer; + /** + * Parses a SOCKS UDP frame. + * @param data + */ + static parseUDPFrame(data: Buffer): SocksUDPFrameDetails; + /** + * Internal state setter. If the SocksClient is in an error state, it cannot be changed to a non error state. + */ + private setState; + /** + * Starts the connection establishment to the proxy and destination. + * @param existingSocket Connected socket to use instead of creating a new one (internal use). + */ + connect(existingSocket?: Duplex): void; + private getSocketOptions; + /** + * Handles internal Socks timeout callback. + * Note: If the Socks client is not BoundWaitingForConnection or Established, the connection will be closed. + */ + private onEstablishedTimeout; + /** + * Handles Socket connect event. + */ + private onConnectHandler; + /** + * Handles Socket data event. + * @param data + */ + private onDataReceivedHandler; + /** + * Handles processing of the data we have received. + */ + private processData; + /** + * Handles Socket close event. + * @param had_error + */ + private onCloseHandler; + /** + * Handles Socket error event. + * @param err + */ + private onErrorHandler; + /** + * Removes internal event listeners on the underlying Socket. + */ + private removeInternalSocketHandlers; + /** + * Closes and destroys the underlying Socket. Emits an error event. + * @param err { String } An error string to include in error event. + */ + private closeSocket; + /** + * Sends initial Socks v4 handshake request. + */ + private sendSocks4InitialHandshake; + /** + * Handles Socks v4 handshake response. + * @param data + */ + private handleSocks4FinalHandshakeResponse; + /** + * Handles Socks v4 incoming connection request (BIND) + * @param data + */ + private handleSocks4IncomingConnectionResponse; + /** + * Sends initial Socks v5 handshake request. + */ + private sendSocks5InitialHandshake; + /** + * Handles initial Socks v5 handshake response. + * @param data + */ + private handleInitialSocks5HandshakeResponse; + /** + * Sends Socks v5 user & password auth handshake. + * + * Note: No auth and user/pass are currently supported. + */ + private sendSocks5UserPassAuthentication; + private sendSocks5CustomAuthentication; + private handleSocks5CustomAuthHandshakeResponse; + private handleSocks5AuthenticationNoAuthHandshakeResponse; + private handleSocks5AuthenticationUserPassHandshakeResponse; + /** + * Handles Socks v5 auth handshake response. + * @param data + */ + private handleInitialSocks5AuthenticationHandshakeResponse; + /** + * Sends Socks v5 final handshake request. + */ + private sendSocks5CommandRequest; + /** + * Handles Socks v5 final handshake response. + * @param data + */ + private handleSocks5FinalHandshakeResponse; + /** + * Handles Socks v5 incoming connection request (BIND). + */ + private handleSocks5IncomingConnectionResponse; + get socksClientOptions(): SocksClientOptions; +} +export { SocksClient, SocksClientOptions, SocksClientChainOptions, SocksClientError, SocksRemoteHost, SocksProxy, SocksUDPFrameDetails, }; diff --git a/node_modules/socks/typings/common/constants.d.ts b/node_modules/socks/typings/common/constants.d.ts new file mode 100644 index 000000000..664795cb1 --- /dev/null +++ b/node_modules/socks/typings/common/constants.d.ts @@ -0,0 +1,150 @@ +/// +import { Duplex } from 'stream'; +import { Socket, SocketConnectOpts } from 'net'; +import { RequireOnlyOne } from './util'; +declare const DEFAULT_TIMEOUT = 30000; +declare type SocksProxyType = 4 | 5; +declare const ERRORS: { + InvalidSocksCommand: string; + InvalidSocksCommandForOperation: string; + InvalidSocksCommandChain: string; + InvalidSocksClientOptionsDestination: string; + InvalidSocksClientOptionsExistingSocket: string; + InvalidSocksClientOptionsProxy: string; + InvalidSocksClientOptionsTimeout: string; + InvalidSocksClientOptionsProxiesLength: string; + InvalidSocksClientOptionsCustomAuthRange: string; + InvalidSocksClientOptionsCustomAuthOptions: string; + NegotiationError: string; + SocketClosed: string; + ProxyConnectionTimedOut: string; + InternalError: string; + InvalidSocks4HandshakeResponse: string; + Socks4ProxyRejectedConnection: string; + InvalidSocks4IncomingConnectionResponse: string; + Socks4ProxyRejectedIncomingBoundConnection: string; + InvalidSocks5InitialHandshakeResponse: string; + InvalidSocks5IntiailHandshakeSocksVersion: string; + InvalidSocks5InitialHandshakeNoAcceptedAuthType: string; + InvalidSocks5InitialHandshakeUnknownAuthType: string; + Socks5AuthenticationFailed: string; + InvalidSocks5FinalHandshake: string; + InvalidSocks5FinalHandshakeRejected: string; + InvalidSocks5IncomingConnectionResponse: string; + Socks5ProxyRejectedIncomingBoundConnection: string; +}; +declare const SOCKS_INCOMING_PACKET_SIZES: { + Socks5InitialHandshakeResponse: number; + Socks5UserPassAuthenticationResponse: number; + Socks5ResponseHeader: number; + Socks5ResponseIPv4: number; + Socks5ResponseIPv6: number; + Socks5ResponseHostname: (hostNameLength: number) => number; + Socks4Response: number; +}; +declare type SocksCommandOption = 'connect' | 'bind' | 'associate'; +declare enum SocksCommand { + connect = 1, + bind = 2, + associate = 3 +} +declare enum Socks4Response { + Granted = 90, + Failed = 91, + Rejected = 92, + RejectedIdent = 93 +} +declare enum Socks5Auth { + NoAuth = 0, + GSSApi = 1, + UserPass = 2 +} +declare const SOCKS5_CUSTOM_AUTH_START = 128; +declare const SOCKS5_CUSTOM_AUTH_END = 254; +declare const SOCKS5_NO_ACCEPTABLE_AUTH = 255; +declare enum Socks5Response { + Granted = 0, + Failure = 1, + NotAllowed = 2, + NetworkUnreachable = 3, + HostUnreachable = 4, + ConnectionRefused = 5, + TTLExpired = 6, + CommandNotSupported = 7, + AddressNotSupported = 8 +} +declare enum Socks5HostType { + IPv4 = 1, + Hostname = 3, + IPv6 = 4 +} +declare enum SocksClientState { + Created = 0, + Connecting = 1, + Connected = 2, + SentInitialHandshake = 3, + ReceivedInitialHandshakeResponse = 4, + SentAuthentication = 5, + ReceivedAuthenticationResponse = 6, + SentFinalHandshake = 7, + ReceivedFinalResponse = 8, + BoundWaitingForConnection = 9, + Established = 10, + Disconnected = 11, + Error = 99 +} +/** + * Represents a SocksProxy + */ +declare type SocksProxy = RequireOnlyOne<{ + ipaddress?: string; + host?: string; + port: number; + type: SocksProxyType; + userId?: string; + password?: string; + custom_auth_method?: number; + custom_auth_request_handler?: () => Promise; + custom_auth_response_size?: number; + custom_auth_response_handler?: (data: Buffer) => Promise; +}, 'host' | 'ipaddress'>; +/** + * Represents a remote host + */ +interface SocksRemoteHost { + host: string; + port: number; +} +/** + * SocksClient connection options. + */ +interface SocksClientOptions { + command: SocksCommandOption; + destination: SocksRemoteHost; + proxy: SocksProxy; + timeout?: number; + existing_socket?: Duplex; + set_tcp_nodelay?: boolean; + socket_options?: SocketConnectOpts; +} +/** + * SocksClient chain connection options. + */ +interface SocksClientChainOptions { + command: 'connect'; + destination: SocksRemoteHost; + proxies: SocksProxy[]; + timeout?: number; + randomizeChain?: false; +} +interface SocksClientEstablishedEvent { + socket: Socket; + remoteHost?: SocksRemoteHost; +} +declare type SocksClientBoundEvent = SocksClientEstablishedEvent; +interface SocksUDPFrameDetails { + frameNumber?: number; + remoteHost: SocksRemoteHost; + data: Buffer; +} +export { DEFAULT_TIMEOUT, ERRORS, SocksProxyType, SocksCommand, Socks4Response, Socks5Auth, Socks5HostType, Socks5Response, SocksClientState, SocksProxy, SocksRemoteHost, SocksCommandOption, SocksClientOptions, SocksClientChainOptions, SocksClientEstablishedEvent, SocksClientBoundEvent, SocksUDPFrameDetails, SOCKS_INCOMING_PACKET_SIZES, SOCKS5_CUSTOM_AUTH_START, SOCKS5_CUSTOM_AUTH_END, SOCKS5_NO_ACCEPTABLE_AUTH, }; diff --git a/node_modules/socks/typings/common/helpers.d.ts b/node_modules/socks/typings/common/helpers.d.ts new file mode 100644 index 000000000..8c3a10697 --- /dev/null +++ b/node_modules/socks/typings/common/helpers.d.ts @@ -0,0 +1,13 @@ +import { SocksClientOptions, SocksClientChainOptions } from '../client/socksclient'; +/** + * Validates the provided SocksClientOptions + * @param options { SocksClientOptions } + * @param acceptedCommands { string[] } A list of accepted SocksProxy commands. + */ +declare function validateSocksClientOptions(options: SocksClientOptions, acceptedCommands?: string[]): void; +/** + * Validates the SocksClientChainOptions + * @param options { SocksClientChainOptions } + */ +declare function validateSocksClientChainOptions(options: SocksClientChainOptions): void; +export { validateSocksClientOptions, validateSocksClientChainOptions }; diff --git a/node_modules/socks/typings/common/receivebuffer.d.ts b/node_modules/socks/typings/common/receivebuffer.d.ts new file mode 100644 index 000000000..756e98b58 --- /dev/null +++ b/node_modules/socks/typings/common/receivebuffer.d.ts @@ -0,0 +1,12 @@ +/// +declare class ReceiveBuffer { + private buffer; + private offset; + private originalSize; + constructor(size?: number); + get length(): number; + append(data: Buffer): number; + peek(length: number): Buffer; + get(length: number): Buffer; +} +export { ReceiveBuffer }; diff --git a/node_modules/socks/typings/common/util.d.ts b/node_modules/socks/typings/common/util.d.ts new file mode 100644 index 000000000..29c539ada --- /dev/null +++ b/node_modules/socks/typings/common/util.d.ts @@ -0,0 +1,17 @@ +import { SocksClientOptions, SocksClientChainOptions } from './constants'; +/** + * Error wrapper for SocksClient + */ +declare class SocksClientError extends Error { + options: SocksClientOptions | SocksClientChainOptions; + constructor(message: string, options: SocksClientOptions | SocksClientChainOptions); +} +/** + * Shuffles a given array. + * @param array The array to shuffle. + */ +declare function shuffleArray(array: any[]): void; +declare type RequireOnlyOne = Pick> & { + [K in Keys]?: Required> & Partial, undefined>>; +}[Keys]; +export { RequireOnlyOne, SocksClientError, shuffleArray }; diff --git a/node_modules/socks/typings/index.d.ts b/node_modules/socks/typings/index.d.ts new file mode 100644 index 000000000..fbf9006ef --- /dev/null +++ b/node_modules/socks/typings/index.d.ts @@ -0,0 +1 @@ +export * from './client/socksclient'; diff --git a/node_modules/steno/LICENSE b/node_modules/steno/LICENSE new file mode 100644 index 000000000..d7e0e57ac --- /dev/null +++ b/node_modules/steno/LICENSE @@ -0,0 +1,22 @@ +The MIT License (MIT) + +Copyright (c) 2014 + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + diff --git a/node_modules/steno/README.md b/node_modules/steno/README.md new file mode 100644 index 000000000..206d17a3c --- /dev/null +++ b/node_modules/steno/README.md @@ -0,0 +1,50 @@ +# steno [![](http://img.shields.io/npm/dm/steno.svg?style=flat)](https://www.npmjs.org/package/steno) [![Node.js CI](https://github.com/typicode/steno/actions/workflows/node.js.yml/badge.svg)](https://github.com/typicode/steno/actions/workflows/node.js.yml) + +> Specialized fast async file writer + +**Steno** makes writing to the same file often/concurrently fast and safe. + +Used in [lowdb](https://github.com/typicode/lowdb). + +_https://en.wikipedia.org/wiki/Stenotype_ + +## Features + +- Fast +- Lightweight +- Promise-based +- Atomic write +- No race condition +- TypeScript definitions + +## Usage + +```javascript +import { Writer } from 'steno' + +// Create a singleton writer +const file = new Writer('file.txt') + +// Use it in the rest of your code +async function save() { + await file.write('some data') +} +``` + +## Benchmark + +`npm run benchmark` + +``` +Write 1KB data to the same file x 1000 + fs : 68.464ms + steno: 0.578ms + +Write 1MB data to the same file x 1000 + fs : 2.166s + steno: 1.153ms +``` + +## License + +MIT - [Typicode](https://github.com/typicode) diff --git a/node_modules/steno/lib/index.d.ts b/node_modules/steno/lib/index.d.ts new file mode 100644 index 000000000..f17ae97e2 --- /dev/null +++ b/node_modules/steno/lib/index.d.ts @@ -0,0 +1,13 @@ +export declare class Writer { + private filename; + private tempFilename; + private locked; + private prev; + private next; + private nextPromise; + private nextData; + private _add; + private _write; + constructor(filename: string); + write(data: string): Promise; +} diff --git a/node_modules/steno/lib/index.js b/node_modules/steno/lib/index.js new file mode 100644 index 000000000..ba24053b4 --- /dev/null +++ b/node_modules/steno/lib/index.js @@ -0,0 +1,59 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Writer = void 0; +const fs_1 = __importDefault(require("fs")); +const path_1 = __importDefault(require("path")); +function getTempFilename(file) { + return path_1.default.join(path_1.default.dirname(file), '.' + path_1.default.basename(file) + '.tmp'); +} +class Writer { + constructor(filename) { + this.locked = false; + this.prev = null; + this.next = null; + this.nextPromise = null; + this.nextData = null; + this.filename = filename; + this.tempFilename = getTempFilename(filename); + } + _add(data) { + this.nextData = data; + this.nextPromise || (this.nextPromise = new Promise((resolve, reject) => { + this.next = [resolve, reject]; + })); + return new Promise((resolve, reject) => { + var _a; + (_a = this.nextPromise) === null || _a === void 0 ? void 0 : _a.then(resolve).catch(reject); + }); + } + async _write(data) { + var _a, _b; + this.locked = true; + try { + await fs_1.default.promises.writeFile(this.tempFilename, data, 'utf-8'); + await fs_1.default.promises.rename(this.tempFilename, this.filename); + (_a = this.prev) === null || _a === void 0 ? void 0 : _a[0](); + } + catch (err) { + (_b = this.prev) === null || _b === void 0 ? void 0 : _b[1](err); + throw err; + } + finally { + this.locked = false; + this.prev = this.next; + this.next = this.nextPromise = null; + if (this.nextData !== null) { + const nextData = this.nextData; + this.nextData = null; + await this.write(nextData); + } + } + } + async write(data) { + return this.locked ? this._add(data) : this._write(data); + } +} +exports.Writer = Writer; diff --git a/node_modules/steno/package.json b/node_modules/steno/package.json new file mode 100644 index 000000000..59484c8e5 --- /dev/null +++ b/node_modules/steno/package.json @@ -0,0 +1,66 @@ +{ + "name": "steno", + "version": "1.0.0", + "description": "Fast file writer with race condition prevention and atomic writing", + "main": "lib/index.js", + "types": "lib/index.d.ts", + "files": [ + "lib/index.js", + "lib/index.d.ts" + ], + "scripts": { + "test": "jest", + "build": "del-cli lib && tsc", + "prepare": "husky install", + "prepublishOnly": "npm run build", + "postversion": "git push && git push --tags && npm publish", + "benchmark": "ts-node src/benchmark.ts" + }, + "repository": { + "type": "git", + "url": "https://github.com/typicode/steno.git" + }, + "keywords": [ + "fs", + "file", + "write", + "writer", + "asynchronous", + "fast", + "race", + "condition", + "atomic", + "writing", + "safe" + ], + "author": "Typicode ", + "license": "MIT", + "bugs": { + "url": "https://github.com/typicode/steno/issues" + }, + "homepage": "https://github.com/typicode/steno", + "devDependencies": { + "@commitlint/cli": "^12.0.1", + "@commitlint/config-conventional": "^12.0.1", + "@commitlint/prompt-cli": "^12.0.1", + "@tsconfig/node10": "^1.0.7", + "@types/jest": "^26.0.20", + "@types/node": "^14.14.31", + "@typicode/eslint-config": "^0.1.0", + "del-cli": "^3.0.1", + "husky": "^5.1.3", + "jest": "^26.6.3", + "prettier": "^2.2.1", + "ts-jest": "^26.5.3", + "ts-node": "^9.1.1", + "typescript": "^4.2.2" + }, + "eslintConfig": { + "extends": "@typicode", + "parserOptions": { + "project": [ + "./tsconfig.lint.json" + ] + } + } +} diff --git a/node_modules/textmaker-thiccy/.github/dependabot.yml b/node_modules/textmaker-thiccy/.github/dependabot.yml new file mode 100644 index 000000000..b2aaf2278 --- /dev/null +++ b/node_modules/textmaker-thiccy/.github/dependabot.yml @@ -0,0 +1,11 @@ +# To get started with Dependabot version updates, you'll need to specify which +# package ecosystems to update and where the package manifests are located. +# Please see the documentation for all configuration options: +# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates + +version: 2 +updates: + - package-ecosystem: "github-actions" # See documentation for possible values + directory: "/" # Location of package manifests + schedule: + interval: "daily" diff --git a/node_modules/textmaker-thiccy/.github/workflows/main.yml b/node_modules/textmaker-thiccy/.github/workflows/main.yml new file mode 100644 index 000000000..e5fe3b2e5 --- /dev/null +++ b/node_modules/textmaker-thiccy/.github/workflows/main.yml @@ -0,0 +1,19 @@ +name: Publish + +on: + release: + types: [published] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + - uses: actions/setup-node@v1 + with: + node-version: 12 + registry-url: https://registry.npmjs.org/ + - run: yarn install + - run: npm publish --access public + env: + NODE_AUTH_TOKEN: ${{secrets.NPM}} diff --git a/node_modules/textmaker-thiccy/LICENSE b/node_modules/textmaker-thiccy/LICENSE new file mode 100644 index 000000000..f288702d2 --- /dev/null +++ b/node_modules/textmaker-thiccy/LICENSE @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. diff --git a/node_modules/textmaker-thiccy/README.md b/node_modules/textmaker-thiccy/README.md new file mode 100644 index 000000000..4a237ad95 --- /dev/null +++ b/node_modules/textmaker-thiccy/README.md @@ -0,0 +1,138 @@ +# Textpro - Photooxy - Unlimited API + +## +This api can handle thousands of requests. Also its completely free +and unlimited resources. + +## + +## 📦 NPM Installation + +`npm i textmaker-thiccy` + +## + +## 🧾 Examples + +### Textpro 1 + +```js +const thiccysapi = require('textmaker-thiccy'); // Import NPM Package + +thiccysapi.textpro("", + // "Message One" (One Message) + // ["Message One"], ["Message Two"] (Two Message) + ).then(async (data) => { + try { + console.log(data) + } catch(err) { + console.log(err) + } +}); +``` + +### Textpro 2 ( Real Usage With One Message ) + +```js +const thiccysapi = require('textmaker-thiccy'); + +thiccysapi.textpro("https://textpro.me/create-neon-devil-wings-text-effect-online-free-1014.html", + "Phaticusthiccy" + ).then(async (data) => { + try { + console.log(data) + } catch(err) { + console.log(err) + } +}); +``` + +### Textpro 3 ( Real Usage With Two Message ) + +```js +const thiccysapi = require('textmaker-thiccy'); + +thiccysapi.textpro("https://textpro.me/create-realistic-vintage-style-light-bulb-1000.html", + ["Developer"], ["Phaticusthiccy"] + ).then(async (data) => { + try { + console.log(data) + } catch(err) { + console.log(err) + } +}); +``` + +#### Interest More Textpro Examples? Check [Here!](https://github.com/phaticusthiccy/EPhoto-360/blob/e473cce16294794d967d10362b9a848b69387ace/textpro-examples/textpro-ex.js) + +## + +### Photooxy 1 + +```js +const thiccysapi = require('textmaker-thiccy'); // Import NPM Package + +thiccysapi.photooxy("", + // "Message One" (One Message) + // ["Message One"], ["Message Two"] (Two Message) + ).then(async (data) => { + try { + console.log(data) + } catch(err) { + console.log(err) + } +}); +``` + +### Photooxy 2 ( Real Usage With One Message ) + +```js +const thiccysapi = require('textmaker-thiccy'); + +thiccysapi.photooxy("https://photooxy.com/logo-and-text-effects/shadow-text-effect-in-the-sky-394.html", + "Phaticusthiccy" + ).then(async (data) => { + try { + console.log(data) + } catch(err) { + console.log(err) + } +}); +``` + +### Photooxy 3 ( Real Usage With Two Message ) + +```js +const thiccysapi = require('textmaker-thiccy'); + +thiccysapi.photooxy("https://photooxy.com/logo-and-text-effects/make-tik-tok-text-effect-375.html", + ["Developer"], ["Phaticusthiccy"] + ).then(async (data) => { + try { + console.log(data) + } catch(err) { + console.log(err) + } +}); +``` + +#### Interest More Photooxy Examples? Check [Here!](https://github.com/phaticusthiccy/EPhoto-360/blob/2ca3c79fb6330f9dea2b1401f63a3e409e197f34/photooxy-examples/photooxy-ex.js) + +## + +### [ Warranty - Lifetime ] 🎦 +```bash +This API not affiliated with any organization or foundation. +All code is available as open source. +Development belongs to Phaticusthiccy. +Every user has unlimited rights. +Do not use for illegal situations. +``` +## + +### [ Contribution ] 💻 +```json +Any additions that do not impair functionality are accepted. +A Any suggestions or additions that go against the code of ethics and GitHub policies will not be accepted. +All suggestions for personalization purposes will not be accepted. +``` diff --git a/node_modules/textmaker-thiccy/lib/textmaker/photooxy.js b/node_modules/textmaker-thiccy/lib/textmaker/photooxy.js new file mode 100644 index 000000000..bbf708e93 --- /dev/null +++ b/node_modules/textmaker-thiccy/lib/textmaker/photooxy.js @@ -0,0 +1,42 @@ +const fetch = require("node-fetch"); +const cheerio = require("cheerio"); +const FormData = require("form-data"); +const exec = require('child_process').exec; +const os = require("os"); + +/** + * Photooxy Scraper + * @function + * @param {String} url - Your phootoxy url, example https://photooxy.com/logo-and-text-effects/make-tik-tok-text-effect-375.html. + * @param {String[]} text - Text (required). example ["text", "text 2 if any"] + */ + +async function photooxy(url, text) { + if (!/^https:\/\/photooxy\.com\/.+\.html$/.test(url)) { + throw new Error("Enter a Valid URL"); + } + let num = 0; + const form = new FormData(); + if (typeof text === "string") text = [text]; + for (let texts of text) { + num += 1; + form.append(`text_${num}`, texts); + } + form.append("login", "OK"); + var procc = await fetch(url, { + method: "POST", + headers: { + Accept: "/", + "Accept-Language": "en-US,en;q=0.9", + "User-Agent": "GoogleBot", + ...form.getHeaders(), + }, + body: form.getBuffer(), + }); + let html = await procc.text(); + let $ = cheerio.load(html); + const img = $('a[class="btn btn-primary"]').attr("href"); + return img; +} + +module.exports = photooxy; diff --git a/node_modules/textmaker-thiccy/lib/textmaker/textpro.js b/node_modules/textmaker-thiccy/lib/textmaker/textpro.js new file mode 100644 index 000000000..6cc5d1513 --- /dev/null +++ b/node_modules/textmaker-thiccy/lib/textmaker/textpro.js @@ -0,0 +1,96 @@ +const fetch = require("node-fetch"); +const cheerio = require("cheerio"); +const cookie = require("cookie"); +const FormData = require("form-data"); +const exec = require('child_process').exec; +const os = require("os"); + +async function post(url, formdata = {}, cookies) { + let encode = encodeURIComponent; + let body = Object.keys(formdata) + .map((key) => { + let vals = formdata[key]; + let isArray = Array.isArray(vals); + let keys = encode(key + (isArray ? "[]" : "")); + if (!isArray) vals = [vals]; + let out = []; + for (let valq of vals) out.push(keys + "=" + encode(valq)); + return out.join("&"); + }) + .join("&"); + return await fetch(`${url}?${body}`, { + method: "GET", + headers: { + Accept: "*/*", + "Accept-Language": "en-US,en;q=0.9", + "User-Agent": "GoogleBot", + Cookie: cookies, + }, + }); +} + +/** + * TextPro Scraper + * @function + * @param {String} url - Your phootoxy url, example https://photooxy.com/logo-and-text-effects/make-tik-tok-text-effect-375.html. + * @param {String[]} text - Text (required). example ["text", "text 2 if any"] + */ + +async function textpro(url, text) { + if (!/^https:\/\/textpro\.me\/.+\.html$/.test(url)) + throw new Error("Enter a Valid URL"); + const geturl = await fetch(url, { + method: "GET", + headers: { + "User-Agent": "GoogleBot", + }, + }); + const load_token = await geturl.text(); + let cookies = geturl.headers.get("set-cookie").split(",").map((v) => cookie.parse(v)).reduce((a, c) => { + return { ...a, ...c }; + }, {}); + cookies = { + __cfduid: cookies.__cfduid, + PHPSESSID: cookies.PHPSESSID + }; + cookies = Object.entries(cookies) + .map(([name, value]) => cookie.serialize(name, value)) + .join("; "); + const $ = cheerio.load(load_token); + const token = $('input[name="token"]').attr("value"); + const form = new FormData(); + if (typeof text === "string") text = [text]; + for (let texts of text) form.append("text[]", texts); + form.append("submit", "Go"); + form.append("token", token); + form.append("build_server", "https://textpro.me"); + form.append("build_server_id", 1); + const geturl2 = await fetch(url, { + method: "POST", + headers: { + Accept: "*/*", + "Accept-Language": "en-US,en;q=0.9", + "User-Agent": "GoogleBot", + Cookie: cookies, + ...form.getHeaders(), + }, + body: form.getBuffer(), + }); + const atoken = await geturl2.text(); + const token2 = /(.*?)<\/div>/.exec(atoken); + if (!token2) { + var status_err = new Object(); + status_err.status = false + status_err.error = "Error! This token is not acceptable!" + return status_err; + } + const prosesimage = await post( + "https://textpro.me/effect/create-image", + JSON.parse(token2[1]), + cookies + ); + const image_ret = await prosesimage.json(); + return `https://textpro.me${image_ret.fullsize_image}`; +} + +module.exports = textpro; diff --git a/node_modules/textmaker-thiccy/node_modules/axios/CHANGELOG.md b/node_modules/textmaker-thiccy/node_modules/axios/CHANGELOG.md new file mode 100644 index 000000000..5e2b3d079 --- /dev/null +++ b/node_modules/textmaker-thiccy/node_modules/axios/CHANGELOG.md @@ -0,0 +1,775 @@ +# Changelog + +### 0.21.4 (September 6, 2021) + +Fixes and Functionality: +- Fixing JSON transform when data is stringified. Providing backward compatibility and complying to the JSON RFC standard ([#4020](https://github.com/axios/axios/pull/4020)) + +Huge thanks to everyone who contributed to this release via code (authors listed below) or via reviews and triaging on GitHub: + +- [Jay](mailto:jasonsaayman@gmail.com) +- [Guillaume Fortaine](https://github.com/gfortaine) +- [Yusuke Kawasaki](https://github.com/kawanet) +- [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS) + +### 0.21.3 (September 4, 2021) + +Fixes and Functionality: +- Fixing response interceptor not being called when request interceptor is attached ([#4013](https://github.com/axios/axios/pull/4013)) + +Huge thanks to everyone who contributed to this release via code (authors listed below) or via reviews and triaging on GitHub: + +- [Jay](mailto:jasonsaayman@gmail.com) +- [Julian Hollmann](https://github.com/nerdbeere) + +### 0.21.2 (September 4, 2021) + +Fixes and Functionality: + +- Updating axios requests to be delayed by pre-emptive promise creation ([#2702](https://github.com/axios/axios/pull/2702)) +- Adding "synchronous" and "runWhen" options to interceptors api ([#2702](https://github.com/axios/axios/pull/2702)) +- Updating of transformResponse ([#3377](https://github.com/axios/axios/pull/3377)) +- Adding ability to omit User-Agent header ([#3703](https://github.com/axios/axios/pull/3703)) +- Adding multiple JSON improvements ([#3688](https://github.com/axios/axios/pull/3688), [#3763](https://github.com/axios/axios/pull/3763)) +- Fixing quadratic runtime and extra memory usage when setting a maxContentLength ([#3738](https://github.com/axios/axios/pull/3738)) +- Adding parseInt to config.timeout ([#3781](https://github.com/axios/axios/pull/3781)) +- Adding custom return type support to interceptor ([#3783](https://github.com/axios/axios/pull/3783)) +- Adding security fix for ReDoS vulnerability ([#3980](https://github.com/axios/axios/pull/3980)) + +Internal and Tests: + +- Updating build dev dependancies ([#3401](https://github.com/axios/axios/pull/3401)) +- Fixing builds running on Travis CI ([#3538](https://github.com/axios/axios/pull/3538)) +- Updating follow rediect version ([#3694](https://github.com/axios/axios/pull/3694), [#3771](https://github.com/axios/axios/pull/3771)) +- Updating karma sauce launcher to fix failing sauce tests ([#3712](https://github.com/axios/axios/pull/3712), [#3717](https://github.com/axios/axios/pull/3717)) +- Updating content-type header for application/json to not contain charset field, according do RFC 8259 ([#2154](https://github.com/axios/axios/pull/2154)) +- Fixing tests by bumping karma-sauce-launcher version ([#3813](https://github.com/axios/axios/pull/3813)) +- Changing testing process from Travis CI to GitHub Actions ([#3938](https://github.com/axios/axios/pull/3938)) + +Documentation: + +- Updating documentation around the use of `AUTH_TOKEN` with multiple domain endpoints ([#3539](https://github.com/axios/axios/pull/3539)) +- Remove duplication of item in changelog ([#3523](https://github.com/axios/axios/pull/3523)) +- Fixing gramatical errors ([#2642](https://github.com/axios/axios/pull/2642)) +- Fixing spelling error ([#3567](https://github.com/axios/axios/pull/3567)) +- Moving gitpod metion ([#2637](https://github.com/axios/axios/pull/2637)) +- Adding new axios documentation website link ([#3681](https://github.com/axios/axios/pull/3681), [#3707](https://github.com/axios/axios/pull/3707)) +- Updating documentation around dispatching requests ([#3772](https://github.com/axios/axios/pull/3772)) +- Adding documentation for the type guard isAxiosError ([#3767](https://github.com/axios/axios/pull/3767)) +- Adding explanation of cancel token ([#3803](https://github.com/axios/axios/pull/3803)) +- Updating CI status badge ([#3953](https://github.com/axios/axios/pull/3953)) +- Fixing errors with JSON documentation ([#3936](https://github.com/axios/axios/pull/3936)) +- Fixing README typo under Request Config ([#3825](https://github.com/axios/axios/pull/3825)) +- Adding axios-multi-api to the ecosystem file ([#3817](https://github.com/axios/axios/pull/3817)) +- Adding SECURITY.md to properly disclose security vulnerabilities ([#3981](https://github.com/axios/axios/pull/3981)) + +Huge thanks to everyone who contributed to this release via code (authors listed below) or via reviews and triaging on GitHub: + +- [Jay](mailto:jasonsaayman@gmail.com) +- [Sasha Korotkov](https://github.com/SashaKoro) +- [Daniel Lopretto](https://github.com/timemachine3030) +- [Mike Bishop](https://github.com/MikeBishop) +- [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS) +- [Mark](https://github.com/bimbiltu) +- [Philipe Gouveia Paixão](https://github.com/piiih) +- [hippo](https://github.com/hippo2cat) +- [ready-research](https://github.com/ready-research) +- [Xianming Zhong](https://github.com/chinesedfan) +- [Christopher Chrapka](https://github.com/OJezu) +- [Brian Anglin](https://github.com/anglinb) +- [Kohta Ito](https://github.com/koh110) +- [Ali Clark](https://github.com/aliclark) +- [caikan](https://github.com/caikan) +- [Elina Gorshkova](https://github.com/elinagorshkova) +- [Ryota Ikezawa](https://github.com/paveg) +- [Nisar Hassan Naqvi](https://github.com/nisarhassan12) +- [Jake](https://github.com/codemaster138) +- [TagawaHirotaka](https://github.com/wafuwafu13) +- [Johannes Jarbratt](https://github.com/johachi) +- [Mo Sattler](https://github.com/MoSattler) +- [Sam Carlton](https://github.com/ThatGuySam) +- [Matt Czapliński](https://github.com/MattCCC) +- [Ziding Zhang](https://github.com/zidingz) + +### 0.21.1 (December 21, 2020) + +Fixes and Functionality: + +- Hotfix: Prevent SSRF ([#3410](https://github.com/axios/axios/pull/3410)) +- Protocol not parsed when setting proxy config from env vars ([#3070](https://github.com/axios/axios/pull/3070)) +- Updating axios in types to be lower case ([#2797](https://github.com/axios/axios/pull/2797)) +- Adding a type guard for `AxiosError` ([#2949](https://github.com/axios/axios/pull/2949)) + +Internal and Tests: + +- Remove the skipping of the `socket` http test ([#3364](https://github.com/axios/axios/pull/3364)) +- Use different socket for Win32 test ([#3375](https://github.com/axios/axios/pull/3375)) + +Huge thanks to everyone who contributed to this release via code (authors listed below) or via reviews and triaging on GitHub: + +- Daniel Lopretto +- Jason Kwok +- Jay +- Jonathan Foster +- Remco Haszing +- Xianming Zhong + +### 0.21.0 (October 23, 2020) + +Fixes and Functionality: + +- Fixing requestHeaders.Authorization ([#3287](https://github.com/axios/axios/pull/3287)) +- Fixing node types ([#3237](https://github.com/axios/axios/pull/3237)) +- Fixing axios.delete ignores config.data ([#3282](https://github.com/axios/axios/pull/3282)) +- Revert "Fixing overwrite Blob/File type as Content-Type in browser. (#1773)" ([#3289](https://github.com/axios/axios/pull/3289)) +- Fixing an issue that type 'null' and 'undefined' is not assignable to validateStatus when typescript strict option is enabled ([#3200](https://github.com/axios/axios/pull/3200)) + +Internal and Tests: + +- Lock travis to not use node v15 ([#3361](https://github.com/axios/axios/pull/3361)) + +Documentation: + +- Fixing simple typo, existant -> existent ([#3252](https://github.com/axios/axios/pull/3252)) +- Fixing typos ([#3309](https://github.com/axios/axios/pull/3309)) + +Huge thanks to everyone who contributed to this release via code (authors listed below) or via reviews and triaging on GitHub: + +- Allan Cruz <57270969+Allanbcruz@users.noreply.github.com> +- George Cheng +- Jay +- Kevin Kirsche +- Remco Haszing +- Taemin Shin +- Tim Gates +- Xianming Zhong + +### 0.20.0 (August 20, 2020) + +Release of 0.20.0-pre as a full release with no other changes. + +### 0.20.0-pre (July 15, 2020) + +Fixes and Functionality: + +- Fixing response with utf-8 BOM can not parse to json ([#2419](https://github.com/axios/axios/pull/2419)) + - fix: remove byte order marker (UTF-8 BOM) when transform response + - fix: remove BOM only utf-8 + - test: utf-8 BOM + - fix: incorrect param name +- Refactor mergeConfig without utils.deepMerge ([#2844](https://github.com/axios/axios/pull/2844)) + - Adding failing test + - Fixing #2587 default custom config persisting + - Adding Concat keys and filter duplicates + - Fixed value from CPE + - update for review feedbacks + - no deepMerge + - only merge between plain objects + - fix rename + - always merge config by mergeConfig + - extract function mergeDeepProperties + - refactor mergeConfig with all keys, and add special logic for validateStatus + - add test for resetting headers + - add lots of tests and fix a bug + - should not inherit `data` + - use simple toString +- Fixing overwrite Blob/File type as Content-Type in browser. ([#1773](https://github.com/axios/axios/pull/1773)) +- Fixing an issue that type 'null' is not assignable to validateStatus ([#2773](https://github.com/axios/axios/pull/2773)) +- Fixing special char encoding ([#1671](https://github.com/axios/axios/pull/1671)) + - removing @ character from replacement list since it is a reserved character + - Updating buildURL test to not include the @ character + - Removing console logs +- Fixing password encoding with special characters in basic authentication ([#1492](https://github.com/axios/axios/pull/1492)) + - Fixing password encoding with special characters in basic authentication + - Adding test to check if password with non-Latin1 characters pass +- Fixing 'Network Error' in react native android ([#1487](https://github.com/axios/axios/pull/1487)) + There is a bug in react native Android platform when using get method. It will trigger a 'Network Error' when passing the requestData which is an empty string to request.send function. So if the requestData is an empty string we can set it to null as well to fix the bug. +- Fixing Cookie Helper with Async Components ([#1105](https://github.com/axios/axios/pull/1105)) ([#1107](https://github.com/axios/axios/pull/1107)) +- Fixing 'progressEvent' type ([#2851](https://github.com/axios/axios/pull/2851)) + - Fix 'progressEvent' type + - Update axios.ts +- Fixing getting local files (file://) failed ([#2470](https://github.com/axios/axios/pull/2470)) + - fix issue #2416, #2396 + - fix Eslint warn + - Modify judgment conditions + - add unit test + - update unit test + - update unit test +- Allow PURGE method in typings ([#2191](https://github.com/axios/axios/pull/2191)) +- Adding option to disable automatic decompression ([#2661](https://github.com/axios/axios/pull/2661)) + - Adding ability to disable auto decompression + - Updating decompress documentation in README + - Fixing test\unit\adapters\http.js lint errors + - Adding test for disabling auto decompression + - Removing changes that fixed lint errors in tests + - Removing formatting change to unit test +- Add independent `maxBodyLength` option ([#2781](https://github.com/axios/axios/pull/2781)) + - Add independent option to set the maximum size of the request body + - Remove maxBodyLength check + - Update README + - Assert for error code and message +- Adding responseEncoding to mergeConfig ([#1745](https://github.com/axios/axios/pull/1745)) +- Compatible with follow-redirect aborts the request ([#2689](https://github.com/axios/axios/pull/2689)) + - Compatible with follow-redirect aborts the request + - Use the error code +- Fix merging of params ([#2656](https://github.com/axios/axios/pull/2656)) + - Name function to avoid ESLint func-names warning + - Switch params config to merge list and update tests + - Restore testing of both false and null + - Restore test cases for keys without defaults + - Include test for non-object values that aren't false-y. +- Revert `finally` as `then` ([#2683](https://github.com/axios/axios/pull/2683)) + +Internal and Tests: + +- Fix stale bot config ([#3049](https://github.com/axios/axios/pull/3049)) + - fix stale bot config + - fix multiple lines +- Add days and change name to work ([#3035](https://github.com/axios/axios/pull/3035)) +- Update close-issues.yml ([#3031](https://github.com/axios/axios/pull/3031)) + - Update close-issues.yml + Update close message to read better 😄 + - Fix use of quotations + Use single quotes as per other .yml files + - Remove user name form message +- Add GitHub actions to close stale issues/prs ([#3029](https://github.com/axios/axios/pull/3029)) + - prepare stale actions + - update messages + - Add exempt labels and lighten up comments +- Add GitHub actions to close invalid issues ([#3022](https://github.com/axios/axios/pull/3022)) + - add close actions + - fix with checkout + - update issue templates + - add reminder + - update close message +- Add test with Node.js 12 ([#2860](https://github.com/axios/axios/pull/2860)) + - test with Node.js 12 + - test with latest +- Adding console log on sandbox server startup ([#2210](https://github.com/axios/axios/pull/2210)) + - Adding console log on sandbox server startup + - Update server.js + Add server error handling + - Update server.js + Better error message, remove retry. +- Adding tests for method `options` type definitions ([#1996](https://github.com/axios/axios/pull/1996)) + Update tests. +- Add test for redirecting with too large response ([#2695](https://github.com/axios/axios/pull/2695)) +- Fixing unit test failure in Windows OS ([#2601](https://github.com/axios/axios/pull/2601)) +- Fixing issue for HEAD method and gzipped response ([#2666](https://github.com/axios/axios/pull/2666)) +- Fix tests in browsers ([#2748](https://github.com/axios/axios/pull/2748)) +- chore: add `jsdelivr` and `unpkg` support ([#2443](https://github.com/axios/axios/pull/2443)) + +Documentation: + +- Adding support for URLSearchParams in node ([#1900](https://github.com/axios/axios/pull/1900)) + - Adding support for URLSearchParams in node + - Remove un-needed code + - Update utils.js + - Make changes as suggested +- Adding table of content (preview) ([#3050](https://github.com/axios/axios/pull/3050)) + - add toc (preview) + - remove toc in toc + Signed-off-by: Moni + - fix sublinks + - fix indentation + - remove redundant table links + - update caps and indent + - remove axios +- Replace 'blacklist' with 'blocklist' ([#3006](https://github.com/axios/axios/pull/3006)) +- docs(): Detailed config options environment. ([#2088](https://github.com/axios/axios/pull/2088)) + - docs(): Detailed config options environment. + - Update README.md +- Include axios-data-unpacker in ECOSYSTEM.md ([#2080](https://github.com/axios/axios/pull/2080)) +- Allow opening examples in Gitpod ([#1958](https://github.com/axios/axios/pull/1958)) +- Remove axios.all() and axios.spread() from Readme.md ([#2727](https://github.com/axios/axios/pull/2727)) + - remove axios.all(), axios.spread() + - replace example + - axios.all() -> Promise.all() + - axios.spread(function (acct, perms)) -> function (acct, perms) + - add deprecated mark +- Update README.md ([#2887](https://github.com/axios/axios/pull/2887)) + Small change to the data attribute doc of the config. A request body can also be set for DELETE methods but this wasn't mentioned in the documentation (it only mentioned POST, PUT and PATCH). Took my some 10-20 minutes until I realized that I don't need to manipulate the request body with transformRequest in the case of DELETE. +- Include swagger-taxos-codegen in ECOSYSTEM.md ([#2162](https://github.com/axios/axios/pull/2162)) +- Add CDNJS version badge in README.md ([#878](https://github.com/axios/axios/pull/878)) + This badge will show the version on CDNJS! +- Documentation update to clear up ambiguity in code examples ([#2928](https://github.com/axios/axios/pull/2928)) + - Made an adjustment to the documentation to clear up any ambiguity around the use of "fs". This should help clear up that the code examples with "fs" cannot be used on the client side. +- Update README.md about validateStatus ([#2912](https://github.com/axios/axios/pull/2912)) + Rewrote the comment from "Reject only if the status code is greater than or equal to 500" to "Resolve only if the status code is less than 500" +- Updating documentation for usage form-data ([#2805](https://github.com/axios/axios/pull/2805)) + Closes #2049 +- Fixing CHANGELOG.md issue link ([#2784](https://github.com/axios/axios/pull/2784)) +- Include axios-hooks in ECOSYSTEM.md ([#2003](https://github.com/axios/axios/pull/2003)) +- Added Response header access instructions ([#1901](https://github.com/axios/axios/pull/1901)) + - Added Response header access instructions + - Added note about using bracket notation +- Add `onUploadProgress` and `onDownloadProgress` are browser only ([#2763](https://github.com/axios/axios/pull/2763)) + Saw in #928 and #1966 that `onUploadProgress` and `onDownloadProgress` only work in the browser and was missing that from the README. +- Update ' sign to ` in proxy spec ([#2778](https://github.com/axios/axios/pull/2778)) +- Adding jsDelivr link in README ([#1110](https://github.com/axios/axios/pull/1110)) + - Adding jsDelivr link + - Add SRI + - Remove SRI + +Huge thanks to everyone who contributed to this release via code (authors listed +below) or via reviews and triaging on GitHub: + +- Alan Wang +- Alexandru Ungureanu +- Anubhav Srivastava +- Benny Neugebauer +- Cr <631807682@qq.com> +- David +- David Ko +- David Tanner +- Emily Morehouse +- Felipe Martins +- Fonger <5862369+Fonger@users.noreply.github.com> +- Frostack +- George Cheng +- grumblerchester +- Gustavo López +- hexaez <45806662+hexaez@users.noreply.github.com> +- huangzuizui +- Ian Wijma +- Jay +- jeffjing +- jennynju <46782518+jennynju@users.noreply.github.com> +- Jimmy Liao <52391190+jimmy-liao-gogoro@users.noreply.github.com> +- Jonathan Sharpe +- JounQin +- Justin Beckwith +- Kamil Posiadała <3dcreator.pl@gmail.com> +- Lukas Drgon +- marcinx +- Martti Laine +- Michał Zarach +- Moni +- Motonori Iwata <121048+iwata@users.noreply.github.com> +- Nikita Galkin +- Petr Mares +- Philippe Recto +- Remco Haszing +- rockcs1992 +- Ryan Bown +- Samina Fu +- Simone Busoli +- Spencer von der Ohe +- Sven Efftinge +- Taegyeoung Oh +- Taemin Shin +- Thibault Ehrhart <1208424+ehrhart@users.noreply.github.com> +- Xianming Zhong +- Yasu Flores +- Zac Delventhal + +### 0.19.2 (Jan 20, 2020) + +- Remove unnecessary XSS check ([#2679](https://github.com/axios/axios/pull/2679)) (see ([#2646](https://github.com/axios/axios/issues/2646)) for discussion) + +### 0.19.1 (Jan 7, 2020) + +Fixes and Functionality: + +- Fixing invalid agent issue ([#1904](https://github.com/axios/axios/pull/1904)) +- Fix ignore set withCredentials false ([#2582](https://github.com/axios/axios/pull/2582)) +- Delete useless default to hash ([#2458](https://github.com/axios/axios/pull/2458)) +- Fix HTTP/HTTPs agents passing to follow-redirect ([#1904](https://github.com/axios/axios/pull/1904)) +- Fix ignore set withCredentials false ([#2582](https://github.com/axios/axios/pull/2582)) +- Fix CI build failure ([#2570](https://github.com/axios/axios/pull/2570)) +- Remove dependency on is-buffer from package.json ([#1816](https://github.com/axios/axios/pull/1816)) +- Adding options typings ([#2341](https://github.com/axios/axios/pull/2341)) +- Adding Typescript HTTP method definition for LINK and UNLINK. ([#2444](https://github.com/axios/axios/pull/2444)) +- Update dist with newest changes, fixes Custom Attributes issue +- Change syntax to see if build passes ([#2488](https://github.com/axios/axios/pull/2488)) +- Update Webpack + deps, remove now unnecessary polyfills ([#2410](https://github.com/axios/axios/pull/2410)) +- Fix to prevent XSS, throw an error when the URL contains a JS script ([#2464](https://github.com/axios/axios/pull/2464)) +- Add custom timeout error copy in config ([#2275](https://github.com/axios/axios/pull/2275)) +- Add error toJSON example ([#2466](https://github.com/axios/axios/pull/2466)) +- Fixing Vulnerability A Fortify Scan finds a critical Cross-Site Scrip… ([#2451](https://github.com/axios/axios/pull/2451)) +- Fixing subdomain handling on no_proxy ([#2442](https://github.com/axios/axios/pull/2442)) +- Make redirection from HTTP to HTTPS work ([#2426](https://github.com/axios/axios/pull/2426)) and ([#2547](https://github.com/axios/axios/pull/2547)) +- Add toJSON property to AxiosError type ([#2427](https://github.com/axios/axios/pull/2427)) +- Fixing socket hang up error on node side for slow response. ([#1752](https://github.com/axios/axios/pull/1752)) +- Alternative syntax to send data into the body ([#2317](https://github.com/axios/axios/pull/2317)) +- Fixing custom config options ([#2207](https://github.com/axios/axios/pull/2207)) +- Fixing set `config.method` after mergeConfig for Axios.prototype.request ([#2383](https://github.com/axios/axios/pull/2383)) +- Axios create url bug ([#2290](https://github.com/axios/axios/pull/2290)) +- Do not modify config.url when using a relative baseURL (resolves [#1628](https://github.com/axios/axios/issues/1098)) ([#2391](https://github.com/axios/axios/pull/2391)) + +Internal: + +- Revert "Update Webpack + deps, remove now unnecessary polyfills" ([#2479](https://github.com/axios/axios/pull/2479)) +- Order of if/else blocks is causing unit tests mocking XHR. ([#2201](https://github.com/axios/axios/pull/2201)) +- Add license badge ([#2446](https://github.com/axios/axios/pull/2446)) +- Fix travis CI build [#2386](https://github.com/axios/axios/pull/2386) +- Fix cancellation error on build master. #2290 #2207 ([#2407](https://github.com/axios/axios/pull/2407)) + +Documentation: + +- Fixing typo in CHANGELOG.md: s/Functionallity/Functionality ([#2639](https://github.com/axios/axios/pull/2639)) +- Fix badge, use master branch ([#2538](https://github.com/axios/axios/pull/2538)) +- Fix typo in changelog [#2193](https://github.com/axios/axios/pull/2193) +- Document fix ([#2514](https://github.com/axios/axios/pull/2514)) +- Update docs with no_proxy change, issue #2484 ([#2513](https://github.com/axios/axios/pull/2513)) +- Fixing missing words in docs template ([#2259](https://github.com/axios/axios/pull/2259)) +- 🐛Fix request finally documentation in README ([#2189](https://github.com/axios/axios/pull/2189)) +- updating spelling and adding link to docs ([#2212](https://github.com/axios/axios/pull/2212)) +- docs: minor tweak ([#2404](https://github.com/axios/axios/pull/2404)) +- Update response interceptor docs ([#2399](https://github.com/axios/axios/pull/2399)) +- Update README.md ([#2504](https://github.com/axios/axios/pull/2504)) +- Fix word 'sintaxe' to 'syntax' in README.md ([#2432](https://github.com/axios/axios/pull/2432)) +- updating README: notes on CommonJS autocomplete ([#2256](https://github.com/axios/axios/pull/2256)) +- Fix grammar in README.md ([#2271](https://github.com/axios/axios/pull/2271)) +- Doc fixes, minor examples cleanup ([#2198](https://github.com/axios/axios/pull/2198)) + +### 0.19.0 (May 30, 2019) + +Fixes and Functionality: + +- Added support for no_proxy env variable ([#1693](https://github.com/axios/axios/pull/1693/files)) - Chance Dickson +- Unzip response body only for statuses != 204 ([#1129](https://github.com/axios/axios/pull/1129)) - drawski +- Destroy stream on exceeding maxContentLength (fixes [#1098](https://github.com/axios/axios/issues/1098)) ([#1485](https://github.com/axios/axios/pull/1485)) - Gadzhi Gadzhiev +- Makes Axios error generic to use AxiosResponse ([#1738](https://github.com/axios/axios/pull/1738)) - Suman Lama +- Fixing Mocha tests by locking follow-redirects version to 1.5.10 ([#1993](https://github.com/axios/axios/pull/1993)) - grumblerchester +- Allow uppercase methods in typings. ([#1781](https://github.com/axios/axios/pull/1781)) - Ken Powers +- Fixing building url with hash mark ([#1771](https://github.com/axios/axios/pull/1771)) - Anatoly Ryabov +- This commit fix building url with hash map (fragment identifier) when parameters are present: they must not be added after `#`, because client cut everything after `#` +- Preserve HTTP method when following redirect ([#1758](https://github.com/axios/axios/pull/1758)) - Rikki Gibson +- Add `getUri` signature to TypeScript definition. ([#1736](https://github.com/axios/axios/pull/1736)) - Alexander Trauzzi +- Adding isAxiosError flag to errors thrown by axios ([#1419](https://github.com/axios/axios/pull/1419)) - Ayush Gupta + +Internal: + +- Fixing .eslintrc without extension ([#1789](https://github.com/axios/axios/pull/1789)) - Manoel +- Fix failing SauceLabs tests by updating configuration - Emily Morehouse +- Add issue templates - Emily Morehouse + +Documentation: + +- Consistent coding style in README ([#1787](https://github.com/axios/axios/pull/1787)) - Ali Servet Donmez +- Add information about auth parameter to README ([#2166](https://github.com/axios/axios/pull/2166)) - xlaguna +- Add DELETE to list of methods that allow data as a config option ([#2169](https://github.com/axios/axios/pull/2169)) - Daniela Borges Matos de Carvalho +- Update ECOSYSTEM.md - Add Axios Endpoints ([#2176](https://github.com/axios/axios/pull/2176)) - Renan +- Add r2curl in ECOSYSTEM ([#2141](https://github.com/axios/axios/pull/2141)) - 유용우 / CX +- Update README.md - Add instructions for installing with yarn ([#2036](https://github.com/axios/axios/pull/2036)) - Victor Hermes +- Fixing spacing for README.md ([#2066](https://github.com/axios/axios/pull/2066)) - Josh McCarty +- Update README.md. - Change `.then` to `.finally` in example code ([#2090](https://github.com/axios/axios/pull/2090)) - Omar Cai +- Clarify what values responseType can have in Node ([#2121](https://github.com/axios/axios/pull/2121)) - Tyler Breisacher +- docs(ECOSYSTEM): add axios-api-versioning ([#2020](https://github.com/axios/axios/pull/2020)) - Weffe +- It seems that `responseType: 'blob'` doesn't actually work in Node (when I tried using it, response.data was a string, not a Blob, since Node doesn't have Blobs), so this clarifies that this option should only be used in the browser +- Update README.md. - Add Querystring library note ([#1896](https://github.com/axios/axios/pull/1896)) - Dmitriy Eroshenko +- Add react-hooks-axios to Libraries section of ECOSYSTEM.md ([#1925](https://github.com/axios/axios/pull/1925)) - Cody Chan +- Clarify in README that default timeout is 0 (no timeout) ([#1750](https://github.com/axios/axios/pull/1750)) - Ben Standefer + +### 0.19.0-beta.1 (Aug 9, 2018) + +**NOTE:** This is a beta version of this release. There may be functionality that is broken in +certain browsers, though we suspect that builds are hanging and not erroring. See +https://saucelabs.com/u/axios for the most up-to-date information. + +New Functionality: + +- Add getUri method ([#1712](https://github.com/axios/axios/issues/1712)) +- Add support for no_proxy env variable ([#1693](https://github.com/axios/axios/issues/1693)) +- Add toJSON to decorated Axios errors to facilitate serialization ([#1625](https://github.com/axios/axios/issues/1625)) +- Add second then on axios call ([#1623](https://github.com/axios/axios/issues/1623)) +- Typings: allow custom return types +- Add option to specify character set in responses (with http adapter) + +Fixes: + +- Fix Keep defaults local to instance ([#385](https://github.com/axios/axios/issues/385)) +- Correctly catch exception in http test ([#1475](https://github.com/axios/axios/issues/1475)) +- Fix accept header normalization ([#1698](https://github.com/axios/axios/issues/1698)) +- Fix http adapter to allow HTTPS connections via HTTP ([#959](https://github.com/axios/axios/issues/959)) +- Fix Removes usage of deprecated Buffer constructor. ([#1555](https://github.com/axios/axios/issues/1555), [#1622](https://github.com/axios/axios/issues/1622)) +- Fix defaults to use httpAdapter if available ([#1285](https://github.com/axios/axios/issues/1285)) + - Fixing defaults to use httpAdapter if available + - Use a safer, cross-platform method to detect the Node environment +- Fix Reject promise if request is cancelled by the browser ([#537](https://github.com/axios/axios/issues/537)) +- [Typescript] Fix missing type parameters on delete/head methods +- [NS]: Send `false` flag isStandardBrowserEnv for Nativescript +- Fix missing type parameters on delete/head +- Fix Default method for an instance always overwritten by get +- Fix type error when socketPath option in AxiosRequestConfig +- Capture errors on request data streams +- Decorate resolve and reject to clear timeout in all cases + +Huge thanks to everyone who contributed to this release via code (authors listed +below) or via reviews and triaging on GitHub: + +- Andrew Scott +- Anthony Gauthier +- arpit +- ascott18 +- Benedikt Rötsch +- Chance Dickson +- Dave Stewart +- Deric Cain +- Guillaume Briday +- Jacob Wejendorp +- Jim Lynch +- johntron +- Justin Beckwith +- Justin Beckwith +- Khaled Garbaya +- Lim Jing Rong +- Mark van den Broek +- Martti Laine +- mattridley +- mattridley +- Nicolas Del Valle +- Nilegfx +- pbarbiero +- Rikki Gibson +- Sako Hartounian +- Shane Fitzpatrick +- Stephan Schneider +- Steven +- Tim Garthwaite +- Tim Johns +- Yutaro Miyazaki + +### 0.18.0 (Feb 19, 2018) + +- Adding support for UNIX Sockets when running with Node.js ([#1070](https://github.com/axios/axios/pull/1070)) +- Fixing typings ([#1177](https://github.com/axios/axios/pull/1177)): + - AxiosRequestConfig.proxy: allows type false + - AxiosProxyConfig: added auth field +- Adding function signature in AxiosInstance interface so AxiosInstance can be invoked ([#1192](https://github.com/axios/axios/pull/1192), [#1254](https://github.com/axios/axios/pull/1254)) +- Allowing maxContentLength to pass through to redirected calls as maxBodyLength in follow-redirects config ([#1287](https://github.com/axios/axios/pull/1287)) +- Fixing configuration when using an instance - method can now be set ([#1342](https://github.com/axios/axios/pull/1342)) + +### 0.17.1 (Nov 11, 2017) + +- Fixing issue with web workers ([#1160](https://github.com/axios/axios/pull/1160)) +- Allowing overriding transport ([#1080](https://github.com/axios/axios/pull/1080)) +- Updating TypeScript typings ([#1165](https://github.com/axios/axios/pull/1165), [#1125](https://github.com/axios/axios/pull/1125), [#1131](https://github.com/axios/axios/pull/1131)) + +### 0.17.0 (Oct 21, 2017) + +- **BREAKING** Fixing issue with `baseURL` and interceptors ([#950](https://github.com/axios/axios/pull/950)) +- **BREAKING** Improving handing of duplicate headers ([#874](https://github.com/axios/axios/pull/874)) +- Adding support for disabling proxies ([#691](https://github.com/axios/axios/pull/691)) +- Updating TypeScript typings with generic type parameters ([#1061](https://github.com/axios/axios/pull/1061)) + +### 0.16.2 (Jun 3, 2017) + +- Fixing issue with including `buffer` in bundle ([#887](https://github.com/axios/axios/pull/887)) +- Including underlying request in errors ([#830](https://github.com/axios/axios/pull/830)) +- Convert `method` to lowercase ([#930](https://github.com/axios/axios/pull/930)) + +### 0.16.1 (Apr 8, 2017) + +- Improving HTTP adapter to return last request in case of redirects ([#828](https://github.com/axios/axios/pull/828)) +- Updating `follow-redirects` dependency ([#829](https://github.com/axios/axios/pull/829)) +- Adding support for passing `Buffer` in node ([#773](https://github.com/axios/axios/pull/773)) + +### 0.16.0 (Mar 31, 2017) + +- **BREAKING** Removing `Promise` from axios typings in favor of built-in type declarations ([#480](https://github.com/axios/axios/issues/480)) +- Adding `options` shortcut method ([#461](https://github.com/axios/axios/pull/461)) +- Fixing issue with using `responseType: 'json'` in browsers incompatible with XHR Level 2 ([#654](https://github.com/axios/axios/pull/654)) +- Improving React Native detection ([#731](https://github.com/axios/axios/pull/731)) +- Fixing `combineURLs` to support empty `relativeURL` ([#581](https://github.com/axios/axios/pull/581)) +- Removing `PROTECTION_PREFIX` support ([#561](https://github.com/axios/axios/pull/561)) + +### 0.15.3 (Nov 27, 2016) + +- Fixing issue with custom instances and global defaults ([#443](https://github.com/axios/axios/issues/443)) +- Renaming `axios.d.ts` to `index.d.ts` ([#519](https://github.com/axios/axios/issues/519)) +- Adding `get`, `head`, and `delete` to `defaults.headers` ([#509](https://github.com/axios/axios/issues/509)) +- Fixing issue with `btoa` and IE ([#507](https://github.com/axios/axios/issues/507)) +- Adding support for proxy authentication ([#483](https://github.com/axios/axios/pull/483)) +- Improving HTTP adapter to use `http` protocol by default ([#493](https://github.com/axios/axios/pull/493)) +- Fixing proxy issues ([#491](https://github.com/axios/axios/pull/491)) + +### 0.15.2 (Oct 17, 2016) + +- Fixing issue with calling `cancel` after response has been received ([#482](https://github.com/axios/axios/issues/482)) + +### 0.15.1 (Oct 14, 2016) + +- Fixing issue with UMD ([#485](https://github.com/axios/axios/issues/485)) + +### 0.15.0 (Oct 10, 2016) + +- Adding cancellation support ([#452](https://github.com/axios/axios/pull/452)) +- Moving default adapter to global defaults ([#437](https://github.com/axios/axios/pull/437)) +- Fixing issue with `file` URI scheme ([#440](https://github.com/axios/axios/pull/440)) +- Fixing issue with `params` objects that have no prototype ([#445](https://github.com/axios/axios/pull/445)) + +### 0.14.0 (Aug 27, 2016) + +- **BREAKING** Updating TypeScript definitions ([#419](https://github.com/axios/axios/pull/419)) +- **BREAKING** Replacing `agent` option with `httpAgent` and `httpsAgent` ([#387](https://github.com/axios/axios/pull/387)) +- **BREAKING** Splitting `progress` event handlers into `onUploadProgress` and `onDownloadProgress` ([#423](https://github.com/axios/axios/pull/423)) +- Adding support for `http_proxy` and `https_proxy` environment variables ([#366](https://github.com/axios/axios/pull/366)) +- Fixing issue with `auth` config option and `Authorization` header ([#397](https://github.com/axios/axios/pull/397)) +- Don't set XSRF header if `xsrfCookieName` is `null` ([#406](https://github.com/axios/axios/pull/406)) + +### 0.13.1 (Jul 16, 2016) + +- Fixing issue with response data not being transformed on error ([#378](https://github.com/axios/axios/issues/378)) + +### 0.13.0 (Jul 13, 2016) + +- **BREAKING** Improved error handling ([#345](https://github.com/axios/axios/pull/345)) +- **BREAKING** Response transformer now invoked in dispatcher not adapter ([10eb238](https://github.com/axios/axios/commit/10eb23865101f9347570552c04e9d6211376e25e)) +- **BREAKING** Request adapters now return a `Promise` ([157efd5](https://github.com/axios/axios/commit/157efd5615890301824e3121cc6c9d2f9b21f94a)) +- Fixing issue with `withCredentials` not being overwritten ([#343](https://github.com/axios/axios/issues/343)) +- Fixing regression with request transformer being called before request interceptor ([#352](https://github.com/axios/axios/issues/352)) +- Fixing custom instance defaults ([#341](https://github.com/axios/axios/issues/341)) +- Fixing instances created from `axios.create` to have same API as default axios ([#217](https://github.com/axios/axios/issues/217)) + +### 0.12.0 (May 31, 2016) + +- Adding support for `URLSearchParams` ([#317](https://github.com/axios/axios/pull/317)) +- Adding `maxRedirects` option ([#307](https://github.com/axios/axios/pull/307)) + +### 0.11.1 (May 17, 2016) + +- Fixing IE CORS support ([#313](https://github.com/axios/axios/pull/313)) +- Fixing detection of `FormData` ([#325](https://github.com/axios/axios/pull/325)) +- Adding `Axios` class to exports ([#321](https://github.com/axios/axios/pull/321)) + +### 0.11.0 (Apr 26, 2016) + +- Adding support for Stream with HTTP adapter ([#296](https://github.com/axios/axios/pull/296)) +- Adding support for custom HTTP status code error ranges ([#308](https://github.com/axios/axios/pull/308)) +- Fixing issue with ArrayBuffer ([#299](https://github.com/axios/axios/pull/299)) + +### 0.10.0 (Apr 20, 2016) + +- Fixing issue with some requests sending `undefined` instead of `null` ([#250](https://github.com/axios/axios/pull/250)) +- Fixing basic auth for HTTP adapter ([#252](https://github.com/axios/axios/pull/252)) +- Fixing request timeout for XHR adapter ([#227](https://github.com/axios/axios/pull/227)) +- Fixing IE8 support by using `onreadystatechange` instead of `onload` ([#249](https://github.com/axios/axios/pull/249)) +- Fixing IE9 cross domain requests ([#251](https://github.com/axios/axios/pull/251)) +- Adding `maxContentLength` option ([#275](https://github.com/axios/axios/pull/275)) +- Fixing XHR support for WebWorker environment ([#279](https://github.com/axios/axios/pull/279)) +- Adding request instance to response ([#200](https://github.com/axios/axios/pull/200)) + +### 0.9.1 (Jan 24, 2016) + +- Improving handling of request timeout in node ([#124](https://github.com/axios/axios/issues/124)) +- Fixing network errors not rejecting ([#205](https://github.com/axios/axios/pull/205)) +- Fixing issue with IE rejecting on HTTP 204 ([#201](https://github.com/axios/axios/issues/201)) +- Fixing host/port when following redirects ([#198](https://github.com/axios/axios/pull/198)) + +### 0.9.0 (Jan 18, 2016) + +- Adding support for custom adapters +- Fixing Content-Type header being removed when data is false ([#195](https://github.com/axios/axios/pull/195)) +- Improving XDomainRequest implementation ([#185](https://github.com/axios/axios/pull/185)) +- Improving config merging and order of precedence ([#183](https://github.com/axios/axios/pull/183)) +- Fixing XDomainRequest support for only <= IE9 ([#182](https://github.com/axios/axios/pull/182)) + +### 0.8.1 (Dec 14, 2015) + +- Adding support for passing XSRF token for cross domain requests when using `withCredentials` ([#168](https://github.com/axios/axios/pull/168)) +- Fixing error with format of basic auth header ([#178](https://github.com/axios/axios/pull/173)) +- Fixing error with JSON payloads throwing `InvalidStateError` in some cases ([#174](https://github.com/axios/axios/pull/174)) + +### 0.8.0 (Dec 11, 2015) + +- Adding support for creating instances of axios ([#123](https://github.com/axios/axios/pull/123)) +- Fixing http adapter to use `Buffer` instead of `String` in case of `responseType === 'arraybuffer'` ([#128](https://github.com/axios/axios/pull/128)) +- Adding support for using custom parameter serializer with `paramsSerializer` option ([#121](https://github.com/axios/axios/pull/121)) +- Fixing issue in IE8 caused by `forEach` on `arguments` ([#127](https://github.com/axios/axios/pull/127)) +- Adding support for following redirects in node ([#146](https://github.com/axios/axios/pull/146)) +- Adding support for transparent decompression if `content-encoding` is set ([#149](https://github.com/axios/axios/pull/149)) +- Adding support for transparent XDomainRequest to handle cross domain requests in IE9 ([#140](https://github.com/axios/axios/pull/140)) +- Adding support for HTTP basic auth via Authorization header ([#167](https://github.com/axios/axios/pull/167)) +- Adding support for baseURL option ([#160](https://github.com/axios/axios/pull/160)) + +### 0.7.0 (Sep 29, 2015) + +- Fixing issue with minified bundle in IE8 ([#87](https://github.com/axios/axios/pull/87)) +- Adding support for passing agent in node ([#102](https://github.com/axios/axios/pull/102)) +- Adding support for returning result from `axios.spread` for chaining ([#106](https://github.com/axios/axios/pull/106)) +- Fixing typescript definition ([#105](https://github.com/axios/axios/pull/105)) +- Fixing default timeout config for node ([#112](https://github.com/axios/axios/pull/112)) +- Adding support for use in web workers, and react-native ([#70](https://github.com/axios/axios/issue/70)), ([#98](https://github.com/axios/axios/pull/98)) +- Adding support for fetch like API `axios(url[, config])` ([#116](https://github.com/axios/axios/issues/116)) + +### 0.6.0 (Sep 21, 2015) + +- Removing deprecated success/error aliases +- Fixing issue with array params not being properly encoded ([#49](https://github.com/axios/axios/pull/49)) +- Fixing issue with User-Agent getting overridden ([#69](https://github.com/axios/axios/issues/69)) +- Adding support for timeout config ([#56](https://github.com/axios/axios/issues/56)) +- Removing es6-promise dependency +- Fixing issue preventing `length` to be used as a parameter ([#91](https://github.com/axios/axios/pull/91)) +- Fixing issue with IE8 ([#85](https://github.com/axios/axios/pull/85)) +- Converting build to UMD + +### 0.5.4 (Apr 08, 2015) + +- Fixing issue with FormData not being sent ([#53](https://github.com/axios/axios/issues/53)) + +### 0.5.3 (Apr 07, 2015) + +- Using JSON.parse unconditionally when transforming response string ([#55](https://github.com/axios/axios/issues/55)) + +### 0.5.2 (Mar 13, 2015) + +- Adding support for `statusText` in response ([#46](https://github.com/axios/axios/issues/46)) + +### 0.5.1 (Mar 10, 2015) + +- Fixing issue using strict mode ([#45](https://github.com/axios/axios/issues/45)) +- Fixing issue with standalone build ([#47](https://github.com/axios/axios/issues/47)) + +### 0.5.0 (Jan 23, 2015) + +- Adding support for intercepetors ([#14](https://github.com/axios/axios/issues/14)) +- Updating es6-promise dependency + +### 0.4.2 (Dec 10, 2014) + +- Fixing issue with `Content-Type` when using `FormData` ([#22](https://github.com/axios/axios/issues/22)) +- Adding support for TypeScript ([#25](https://github.com/axios/axios/issues/25)) +- Fixing issue with standalone build ([#29](https://github.com/axios/axios/issues/29)) +- Fixing issue with verbs needing to be capitalized in some browsers ([#30](https://github.com/axios/axios/issues/30)) + +### 0.4.1 (Oct 15, 2014) + +- Adding error handling to request for node.js ([#18](https://github.com/axios/axios/issues/18)) + +### 0.4.0 (Oct 03, 2014) + +- Adding support for `ArrayBuffer` and `ArrayBufferView` ([#10](https://github.com/axios/axios/issues/10)) +- Adding support for utf-8 for node.js ([#13](https://github.com/axios/axios/issues/13)) +- Adding support for SSL for node.js ([#12](https://github.com/axios/axios/issues/12)) +- Fixing incorrect `Content-Type` header ([#9](https://github.com/axios/axios/issues/9)) +- Adding standalone build without bundled es6-promise ([#11](https://github.com/axios/axios/issues/11)) +- Deprecating `success`/`error` in favor of `then`/`catch` + +### 0.3.1 (Sep 16, 2014) + +- Fixing missing post body when using node.js ([#3](https://github.com/axios/axios/issues/3)) + +### 0.3.0 (Sep 16, 2014) + +- Fixing `success` and `error` to properly receive response data as individual arguments ([#8](https://github.com/axios/axios/issues/8)) +- Updating `then` and `catch` to receive response data as a single object ([#6](https://github.com/axios/axios/issues/6)) +- Fixing issue with `all` not working ([#7](https://github.com/axios/axios/issues/7)) + +### 0.2.2 (Sep 14, 2014) + +- Fixing bundling with browserify ([#4](https://github.com/axios/axios/issues/4)) + +### 0.2.1 (Sep 12, 2014) + +- Fixing build problem causing ridiculous file sizes + +### 0.2.0 (Sep 12, 2014) + +- Adding support for `all` and `spread` +- Adding support for node.js ([#1](https://github.com/axios/axios/issues/1)) + +### 0.1.0 (Aug 29, 2014) + +- Initial release diff --git a/node_modules/textmaker-thiccy/node_modules/axios/LICENSE b/node_modules/textmaker-thiccy/node_modules/axios/LICENSE new file mode 100644 index 000000000..d36c80ef2 --- /dev/null +++ b/node_modules/textmaker-thiccy/node_modules/axios/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2014-present Matt Zabriskie + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/textmaker-thiccy/node_modules/axios/README.md b/node_modules/textmaker-thiccy/node_modules/axios/README.md new file mode 100644 index 000000000..b8c019a78 --- /dev/null +++ b/node_modules/textmaker-thiccy/node_modules/axios/README.md @@ -0,0 +1,868 @@ +# axios + +[![npm version](https://img.shields.io/npm/v/axios.svg?style=flat-square)](https://www.npmjs.org/package/axios) +[![CDNJS](https://img.shields.io/cdnjs/v/axios.svg?style=flat-square)](https://cdnjs.com/libraries/axios) +![Build status](https://github.com/axios/axios/actions/workflows/ci.yml/badge.svg) +[![Gitpod Ready-to-Code](https://img.shields.io/badge/Gitpod-Ready--to--Code-blue?logo=gitpod)](https://gitpod.io/#https://github.com/axios/axios) +[![code coverage](https://img.shields.io/coveralls/mzabriskie/axios.svg?style=flat-square)](https://coveralls.io/r/mzabriskie/axios) +[![install size](https://packagephobia.now.sh/badge?p=axios)](https://packagephobia.now.sh/result?p=axios) +[![npm downloads](https://img.shields.io/npm/dm/axios.svg?style=flat-square)](http://npm-stat.com/charts.html?package=axios) +[![gitter chat](https://img.shields.io/gitter/room/mzabriskie/axios.svg?style=flat-square)](https://gitter.im/mzabriskie/axios) +[![code helpers](https://www.codetriage.com/axios/axios/badges/users.svg)](https://www.codetriage.com/axios/axios) + +Promise based HTTP client for the browser and node.js + +> New axios docs website: [click here](https://axios-http.com/) + +## Table of Contents + + - [Features](#features) + - [Browser Support](#browser-support) + - [Installing](#installing) + - [Example](#example) + - [Axios API](#axios-api) + - [Request method aliases](#request-method-aliases) + - [Concurrency (Deprecated)](#concurrency-deprecated) + - [Creating an instance](#creating-an-instance) + - [Instance methods](#instance-methods) + - [Request Config](#request-config) + - [Response Schema](#response-schema) + - [Config Defaults](#config-defaults) + - [Global axios defaults](#global-axios-defaults) + - [Custom instance defaults](#custom-instance-defaults) + - [Config order of precedence](#config-order-of-precedence) + - [Interceptors](#interceptors) + - [Handling Errors](#handling-errors) + - [Cancellation](#cancellation) + - [Using application/x-www-form-urlencoded format](#using-applicationx-www-form-urlencoded-format) + - [Browser](#browser) + - [Node.js](#nodejs) + - [Query string](#query-string) + - [Form data](#form-data) + - [Semver](#semver) + - [Promises](#promises) + - [TypeScript](#typescript) + - [Resources](#resources) + - [Credits](#credits) + - [License](#license) + +## Features + +- Make [XMLHttpRequests](https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest) from the browser +- Make [http](http://nodejs.org/api/http.html) requests from node.js +- Supports the [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) API +- Intercept request and response +- Transform request and response data +- Cancel requests +- Automatic transforms for JSON data +- Client side support for protecting against [XSRF](http://en.wikipedia.org/wiki/Cross-site_request_forgery) + +## Browser Support + +![Chrome](https://raw.github.com/alrra/browser-logos/master/src/chrome/chrome_48x48.png) | ![Firefox](https://raw.github.com/alrra/browser-logos/master/src/firefox/firefox_48x48.png) | ![Safari](https://raw.github.com/alrra/browser-logos/master/src/safari/safari_48x48.png) | ![Opera](https://raw.github.com/alrra/browser-logos/master/src/opera/opera_48x48.png) | ![Edge](https://raw.github.com/alrra/browser-logos/master/src/edge/edge_48x48.png) | ![IE](https://raw.github.com/alrra/browser-logos/master/src/archive/internet-explorer_9-11/internet-explorer_9-11_48x48.png) | +--- | --- | --- | --- | --- | --- | +Latest ✔ | Latest ✔ | Latest ✔ | Latest ✔ | Latest ✔ | 11 ✔ | + +[![Browser Matrix](https://saucelabs.com/open_sauce/build_matrix/axios.svg)](https://saucelabs.com/u/axios) + +## Installing + +Using npm: + +```bash +$ npm install axios +``` + +Using bower: + +```bash +$ bower install axios +``` + +Using yarn: + +```bash +$ yarn add axios +``` + +Using jsDelivr CDN: + +```html + +``` + +Using unpkg CDN: + +```html + +``` + +## Example + +### note: CommonJS usage +In order to gain the TypeScript typings (for intellisense / autocomplete) while using CommonJS imports with `require()` use the following approach: + +```js +const axios = require('axios').default; + +// axios. will now provide autocomplete and parameter typings +``` + +Performing a `GET` request + +```js +const axios = require('axios'); + +// Make a request for a user with a given ID +axios.get('/user?ID=12345') + .then(function (response) { + // handle success + console.log(response); + }) + .catch(function (error) { + // handle error + console.log(error); + }) + .then(function () { + // always executed + }); + +// Optionally the request above could also be done as +axios.get('/user', { + params: { + ID: 12345 + } + }) + .then(function (response) { + console.log(response); + }) + .catch(function (error) { + console.log(error); + }) + .then(function () { + // always executed + }); + +// Want to use async/await? Add the `async` keyword to your outer function/method. +async function getUser() { + try { + const response = await axios.get('/user?ID=12345'); + console.log(response); + } catch (error) { + console.error(error); + } +} +``` + +> **NOTE:** `async/await` is part of ECMAScript 2017 and is not supported in Internet +> Explorer and older browsers, so use with caution. + +Performing a `POST` request + +```js +axios.post('/user', { + firstName: 'Fred', + lastName: 'Flintstone' + }) + .then(function (response) { + console.log(response); + }) + .catch(function (error) { + console.log(error); + }); +``` + +Performing multiple concurrent requests + +```js +function getUserAccount() { + return axios.get('/user/12345'); +} + +function getUserPermissions() { + return axios.get('/user/12345/permissions'); +} + +Promise.all([getUserAccount(), getUserPermissions()]) + .then(function (results) { + const acct = results[0]; + const perm = results[1]; + }); +``` + +## axios API + +Requests can be made by passing the relevant config to `axios`. + +##### axios(config) + +```js +// Send a POST request +axios({ + method: 'post', + url: '/user/12345', + data: { + firstName: 'Fred', + lastName: 'Flintstone' + } +}); +``` + +```js +// GET request for remote image in node.js +axios({ + method: 'get', + url: 'http://bit.ly/2mTM3nY', + responseType: 'stream' +}) + .then(function (response) { + response.data.pipe(fs.createWriteStream('ada_lovelace.jpg')) + }); +``` + +##### axios(url[, config]) + +```js +// Send a GET request (default method) +axios('/user/12345'); +``` + +### Request method aliases + +For convenience aliases have been provided for all supported request methods. + +##### axios.request(config) +##### axios.get(url[, config]) +##### axios.delete(url[, config]) +##### axios.head(url[, config]) +##### axios.options(url[, config]) +##### axios.post(url[, data[, config]]) +##### axios.put(url[, data[, config]]) +##### axios.patch(url[, data[, config]]) + +###### NOTE +When using the alias methods `url`, `method`, and `data` properties don't need to be specified in config. + +### Concurrency (Deprecated) +Please use `Promise.all` to replace the below functions. + +Helper functions for dealing with concurrent requests. + +axios.all(iterable) +axios.spread(callback) + +### Creating an instance + +You can create a new instance of axios with a custom config. + +##### axios.create([config]) + +```js +const instance = axios.create({ + baseURL: 'https://some-domain.com/api/', + timeout: 1000, + headers: {'X-Custom-Header': 'foobar'} +}); +``` + +### Instance methods + +The available instance methods are listed below. The specified config will be merged with the instance config. + +##### axios#request(config) +##### axios#get(url[, config]) +##### axios#delete(url[, config]) +##### axios#head(url[, config]) +##### axios#options(url[, config]) +##### axios#post(url[, data[, config]]) +##### axios#put(url[, data[, config]]) +##### axios#patch(url[, data[, config]]) +##### axios#getUri([config]) + +## Request Config + +These are the available config options for making requests. Only the `url` is required. Requests will default to `GET` if `method` is not specified. + +```js +{ + // `url` is the server URL that will be used for the request + url: '/user', + + // `method` is the request method to be used when making the request + method: 'get', // default + + // `baseURL` will be prepended to `url` unless `url` is absolute. + // It can be convenient to set `baseURL` for an instance of axios to pass relative URLs + // to methods of that instance. + baseURL: 'https://some-domain.com/api/', + + // `transformRequest` allows changes to the request data before it is sent to the server + // This is only applicable for request methods 'PUT', 'POST', 'PATCH' and 'DELETE' + // The last function in the array must return a string or an instance of Buffer, ArrayBuffer, + // FormData or Stream + // You may modify the headers object. + transformRequest: [function (data, headers) { + // Do whatever you want to transform the data + + return data; + }], + + // `transformResponse` allows changes to the response data to be made before + // it is passed to then/catch + transformResponse: [function (data) { + // Do whatever you want to transform the data + + return data; + }], + + // `headers` are custom headers to be sent + headers: {'X-Requested-With': 'XMLHttpRequest'}, + + // `params` are the URL parameters to be sent with the request + // Must be a plain object or a URLSearchParams object + params: { + ID: 12345 + }, + + // `paramsSerializer` is an optional function in charge of serializing `params` + // (e.g. https://www.npmjs.com/package/qs, http://api.jquery.com/jquery.param/) + paramsSerializer: function (params) { + return Qs.stringify(params, {arrayFormat: 'brackets'}) + }, + + // `data` is the data to be sent as the request body + // Only applicable for request methods 'PUT', 'POST', 'DELETE , and 'PATCH' + // When no `transformRequest` is set, must be of one of the following types: + // - string, plain object, ArrayBuffer, ArrayBufferView, URLSearchParams + // - Browser only: FormData, File, Blob + // - Node only: Stream, Buffer + data: { + firstName: 'Fred' + }, + + // syntax alternative to send data into the body + // method post + // only the value is sent, not the key + data: 'Country=Brasil&City=Belo Horizonte', + + // `timeout` specifies the number of milliseconds before the request times out. + // If the request takes longer than `timeout`, the request will be aborted. + timeout: 1000, // default is `0` (no timeout) + + // `withCredentials` indicates whether or not cross-site Access-Control requests + // should be made using credentials + withCredentials: false, // default + + // `adapter` allows custom handling of requests which makes testing easier. + // Return a promise and supply a valid response (see lib/adapters/README.md). + adapter: function (config) { + /* ... */ + }, + + // `auth` indicates that HTTP Basic auth should be used, and supplies credentials. + // This will set an `Authorization` header, overwriting any existing + // `Authorization` custom headers you have set using `headers`. + // Please note that only HTTP Basic auth is configurable through this parameter. + // For Bearer tokens and such, use `Authorization` custom headers instead. + auth: { + username: 'janedoe', + password: 's00pers3cret' + }, + + // `responseType` indicates the type of data that the server will respond with + // options are: 'arraybuffer', 'document', 'json', 'text', 'stream' + // browser only: 'blob' + responseType: 'json', // default + + // `responseEncoding` indicates encoding to use for decoding responses (Node.js only) + // Note: Ignored for `responseType` of 'stream' or client-side requests + responseEncoding: 'utf8', // default + + // `xsrfCookieName` is the name of the cookie to use as a value for xsrf token + xsrfCookieName: 'XSRF-TOKEN', // default + + // `xsrfHeaderName` is the name of the http header that carries the xsrf token value + xsrfHeaderName: 'X-XSRF-TOKEN', // default + + // `onUploadProgress` allows handling of progress events for uploads + // browser only + onUploadProgress: function (progressEvent) { + // Do whatever you want with the native progress event + }, + + // `onDownloadProgress` allows handling of progress events for downloads + // browser only + onDownloadProgress: function (progressEvent) { + // Do whatever you want with the native progress event + }, + + // `maxContentLength` defines the max size of the http response content in bytes allowed in node.js + maxContentLength: 2000, + + // `maxBodyLength` (Node only option) defines the max size of the http request content in bytes allowed + maxBodyLength: 2000, + + // `validateStatus` defines whether to resolve or reject the promise for a given + // HTTP response status code. If `validateStatus` returns `true` (or is set to `null` + // or `undefined`), the promise will be resolved; otherwise, the promise will be + // rejected. + validateStatus: function (status) { + return status >= 200 && status < 300; // default + }, + + // `maxRedirects` defines the maximum number of redirects to follow in node.js. + // If set to 0, no redirects will be followed. + maxRedirects: 5, // default + + // `socketPath` defines a UNIX Socket to be used in node.js. + // e.g. '/var/run/docker.sock' to send requests to the docker daemon. + // Only either `socketPath` or `proxy` can be specified. + // If both are specified, `socketPath` is used. + socketPath: null, // default + + // `httpAgent` and `httpsAgent` define a custom agent to be used when performing http + // and https requests, respectively, in node.js. This allows options to be added like + // `keepAlive` that are not enabled by default. + httpAgent: new http.Agent({ keepAlive: true }), + httpsAgent: new https.Agent({ keepAlive: true }), + + // `proxy` defines the hostname, port, and protocol of the proxy server. + // You can also define your proxy using the conventional `http_proxy` and + // `https_proxy` environment variables. If you are using environment variables + // for your proxy configuration, you can also define a `no_proxy` environment + // variable as a comma-separated list of domains that should not be proxied. + // Use `false` to disable proxies, ignoring environment variables. + // `auth` indicates that HTTP Basic auth should be used to connect to the proxy, and + // supplies credentials. + // This will set an `Proxy-Authorization` header, overwriting any existing + // `Proxy-Authorization` custom headers you have set using `headers`. + // If the proxy server uses HTTPS, then you must set the protocol to `https`. + proxy: { + protocol: 'https', + host: '127.0.0.1', + port: 9000, + auth: { + username: 'mikeymike', + password: 'rapunz3l' + } + }, + + // `cancelToken` specifies a cancel token that can be used to cancel the request + // (see Cancellation section below for details) + cancelToken: new CancelToken(function (cancel) { + }), + + // `decompress` indicates whether or not the response body should be decompressed + // automatically. If set to `true` will also remove the 'content-encoding' header + // from the responses objects of all decompressed responses + // - Node only (XHR cannot turn off decompression) + decompress: true, // default + + // transitional options for backward compatibility that may be removed in the newer versions + transitional: { + // silent JSON parsing mode + // `true` - ignore JSON parsing errors and set response.data to null if parsing failed (old behaviour) + // `false` - throw SyntaxError if JSON parsing failed (Note: responseType must be set to 'json') + silentJSONParsing: true, // default value for the current Axios version + + // try to parse the response string as JSON even if `responseType` is not 'json' + forcedJSONParsing: true, + + // throw ETIMEDOUT error instead of generic ECONNABORTED on request timeouts + clarifyTimeoutError: false, + } +} +``` + +## Response Schema + +The response for a request contains the following information. + +```js +{ + // `data` is the response that was provided by the server + data: {}, + + // `status` is the HTTP status code from the server response + status: 200, + + // `statusText` is the HTTP status message from the server response + statusText: 'OK', + + // `headers` the HTTP headers that the server responded with + // All header names are lower cased and can be accessed using the bracket notation. + // Example: `response.headers['content-type']` + headers: {}, + + // `config` is the config that was provided to `axios` for the request + config: {}, + + // `request` is the request that generated this response + // It is the last ClientRequest instance in node.js (in redirects) + // and an XMLHttpRequest instance in the browser + request: {} +} +``` + +When using `then`, you will receive the response as follows: + +```js +axios.get('/user/12345') + .then(function (response) { + console.log(response.data); + console.log(response.status); + console.log(response.statusText); + console.log(response.headers); + console.log(response.config); + }); +``` + +When using `catch`, or passing a [rejection callback](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/then) as second parameter of `then`, the response will be available through the `error` object as explained in the [Handling Errors](#handling-errors) section. + +## Config Defaults + +You can specify config defaults that will be applied to every request. + +### Global axios defaults + +```js +axios.defaults.baseURL = 'https://api.example.com'; + +// Important: If axios is used with multiple domains, the AUTH_TOKEN will be sent to all of them. +// See below for an example using Custom instance defaults instead. +axios.defaults.headers.common['Authorization'] = AUTH_TOKEN; + +axios.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded'; +``` + +### Custom instance defaults + +```js +// Set config defaults when creating the instance +const instance = axios.create({ + baseURL: 'https://api.example.com' +}); + +// Alter defaults after instance has been created +instance.defaults.headers.common['Authorization'] = AUTH_TOKEN; +``` + +### Config order of precedence + +Config will be merged with an order of precedence. The order is library defaults found in [lib/defaults.js](https://github.com/axios/axios/blob/master/lib/defaults.js#L28), then `defaults` property of the instance, and finally `config` argument for the request. The latter will take precedence over the former. Here's an example. + +```js +// Create an instance using the config defaults provided by the library +// At this point the timeout config value is `0` as is the default for the library +const instance = axios.create(); + +// Override timeout default for the library +// Now all requests using this instance will wait 2.5 seconds before timing out +instance.defaults.timeout = 2500; + +// Override timeout for this request as it's known to take a long time +instance.get('/longRequest', { + timeout: 5000 +}); +``` + +## Interceptors + +You can intercept requests or responses before they are handled by `then` or `catch`. + +```js +// Add a request interceptor +axios.interceptors.request.use(function (config) { + // Do something before request is sent + return config; + }, function (error) { + // Do something with request error + return Promise.reject(error); + }); + +// Add a response interceptor +axios.interceptors.response.use(function (response) { + // Any status code that lie within the range of 2xx cause this function to trigger + // Do something with response data + return response; + }, function (error) { + // Any status codes that falls outside the range of 2xx cause this function to trigger + // Do something with response error + return Promise.reject(error); + }); +``` + +If you need to remove an interceptor later you can. + +```js +const myInterceptor = axios.interceptors.request.use(function () {/*...*/}); +axios.interceptors.request.eject(myInterceptor); +``` + +You can add interceptors to a custom instance of axios. + +```js +const instance = axios.create(); +instance.interceptors.request.use(function () {/*...*/}); +``` + +When you add request interceptors, they are presumed to be asynchronous by default. This can cause a delay +in the execution of your axios request when the main thread is blocked (a promise is created under the hood for +the interceptor and your request gets put on the bottom of the call stack). If your request interceptors are synchronous you can add a flag +to the options object that will tell axios to run the code synchronously and avoid any delays in request execution. + +```js +axios.interceptors.request.use(function (config) { + config.headers.test = 'I am only a header!'; + return config; +}, null, { synchronous: true }); +``` + +If you want to execute a particular interceptor based on a runtime check, +you can add a `runWhen` function to the options object. The interceptor will not be executed **if and only if** the return +of `runWhen` is `false`. The function will be called with the config +object (don't forget that you can bind your own arguments to it as well.) This can be handy when you have an +asynchronous request interceptor that only needs to run at certain times. + +```js +function onGetCall(config) { + return config.method === 'get'; +} +axios.interceptors.request.use(function (config) { + config.headers.test = 'special get headers'; + return config; +}, null, { runWhen: onGetCall }); +``` + +## Handling Errors + +```js +axios.get('/user/12345') + .catch(function (error) { + if (error.response) { + // The request was made and the server responded with a status code + // that falls out of the range of 2xx + console.log(error.response.data); + console.log(error.response.status); + console.log(error.response.headers); + } else if (error.request) { + // The request was made but no response was received + // `error.request` is an instance of XMLHttpRequest in the browser and an instance of + // http.ClientRequest in node.js + console.log(error.request); + } else { + // Something happened in setting up the request that triggered an Error + console.log('Error', error.message); + } + console.log(error.config); + }); +``` + +Using the `validateStatus` config option, you can define HTTP code(s) that should throw an error. + +```js +axios.get('/user/12345', { + validateStatus: function (status) { + return status < 500; // Resolve only if the status code is less than 500 + } +}) +``` + +Using `toJSON` you get an object with more information about the HTTP error. + +```js +axios.get('/user/12345') + .catch(function (error) { + console.log(error.toJSON()); + }); +``` + +## Cancellation + +You can cancel a request using a *cancel token*. + +> The axios cancel token API is based on the withdrawn [cancelable promises proposal](https://github.com/tc39/proposal-cancelable-promises). + +You can create a cancel token using the `CancelToken.source` factory as shown below: + +```js +const CancelToken = axios.CancelToken; +const source = CancelToken.source(); + +axios.get('/user/12345', { + cancelToken: source.token +}).catch(function (thrown) { + if (axios.isCancel(thrown)) { + console.log('Request canceled', thrown.message); + } else { + // handle error + } +}); + +axios.post('/user/12345', { + name: 'new name' +}, { + cancelToken: source.token +}) + +// cancel the request (the message parameter is optional) +source.cancel('Operation canceled by the user.'); +``` + +You can also create a cancel token by passing an executor function to the `CancelToken` constructor: + +```js +const CancelToken = axios.CancelToken; +let cancel; + +axios.get('/user/12345', { + cancelToken: new CancelToken(function executor(c) { + // An executor function receives a cancel function as a parameter + cancel = c; + }) +}); + +// cancel the request +cancel(); +``` + +> Note: you can cancel several requests with the same cancel token. +> If a cancellation token is already cancelled at the moment of starting an Axios request, then the request is cancelled immediately, without any attempts to make real request. + +## Using application/x-www-form-urlencoded format + +By default, axios serializes JavaScript objects to `JSON`. To send data in the `application/x-www-form-urlencoded` format instead, you can use one of the following options. + +### Browser + +In a browser, you can use the [`URLSearchParams`](https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams) API as follows: + +```js +const params = new URLSearchParams(); +params.append('param1', 'value1'); +params.append('param2', 'value2'); +axios.post('/foo', params); +``` + +> Note that `URLSearchParams` is not supported by all browsers (see [caniuse.com](http://www.caniuse.com/#feat=urlsearchparams)), but there is a [polyfill](https://github.com/WebReflection/url-search-params) available (make sure to polyfill the global environment). + +Alternatively, you can encode data using the [`qs`](https://github.com/ljharb/qs) library: + +```js +const qs = require('qs'); +axios.post('/foo', qs.stringify({ 'bar': 123 })); +``` + +Or in another way (ES6), + +```js +import qs from 'qs'; +const data = { 'bar': 123 }; +const options = { + method: 'POST', + headers: { 'content-type': 'application/x-www-form-urlencoded' }, + data: qs.stringify(data), + url, +}; +axios(options); +``` + +### Node.js + +#### Query string + +In node.js, you can use the [`querystring`](https://nodejs.org/api/querystring.html) module as follows: + +```js +const querystring = require('querystring'); +axios.post('http://something.com/', querystring.stringify({ foo: 'bar' })); +``` + +or ['URLSearchParams'](https://nodejs.org/api/url.html#url_class_urlsearchparams) from ['url module'](https://nodejs.org/api/url.html) as follows: + +```js +const url = require('url'); +const params = new url.URLSearchParams({ foo: 'bar' }); +axios.post('http://something.com/', params.toString()); +``` + +You can also use the [`qs`](https://github.com/ljharb/qs) library. + +###### NOTE +The `qs` library is preferable if you need to stringify nested objects, as the `querystring` method has known issues with that use case (https://github.com/nodejs/node-v0.x-archive/issues/1665). + +#### Form data + +In node.js, you can use the [`form-data`](https://github.com/form-data/form-data) library as follows: + +```js +const FormData = require('form-data'); + +const form = new FormData(); +form.append('my_field', 'my value'); +form.append('my_buffer', new Buffer(10)); +form.append('my_file', fs.createReadStream('/foo/bar.jpg')); + +axios.post('https://example.com', form, { headers: form.getHeaders() }) +``` + +Alternatively, use an interceptor: + +```js +axios.interceptors.request.use(config => { + if (config.data instanceof FormData) { + Object.assign(config.headers, config.data.getHeaders()); + } + return config; +}); +``` + +## Semver + +Until axios reaches a `1.0` release, breaking changes will be released with a new minor version. For example `0.5.1`, and `0.5.4` will have the same API, but `0.6.0` will have breaking changes. + +## Promises + +axios depends on a native ES6 Promise implementation to be [supported](http://caniuse.com/promises). +If your environment doesn't support ES6 Promises, you can [polyfill](https://github.com/jakearchibald/es6-promise). + +## TypeScript + +axios includes [TypeScript](http://typescriptlang.org) definitions and a type guard for axios errors. + +```typescript +let user: User = null; +try { + const { data } = await axios.get('/user?ID=12345'); + user = data.userDetails; +} catch (error) { + if (axios.isAxiosError(error)) { + handleAxiosError(error); + } else { + handleUnexpectedError(error); + } +} +``` + +## Online one-click setup + +You can use Gitpod an online IDE(which is free for Open Source) for contributing or running the examples online. + +[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/axios/axios/blob/master/examples/server.js) + + +## Resources + +* [Changelog](https://github.com/axios/axios/blob/master/CHANGELOG.md) +* [Upgrade Guide](https://github.com/axios/axios/blob/master/UPGRADE_GUIDE.md) +* [Ecosystem](https://github.com/axios/axios/blob/master/ECOSYSTEM.md) +* [Contributing Guide](https://github.com/axios/axios/blob/master/CONTRIBUTING.md) +* [Code of Conduct](https://github.com/axios/axios/blob/master/CODE_OF_CONDUCT.md) + +## Credits + +axios is heavily inspired by the [$http service](https://docs.angularjs.org/api/ng/service/$http) provided in [Angular](https://angularjs.org/). Ultimately axios is an effort to provide a standalone `$http`-like service for use outside of Angular. + +## License + +[MIT](LICENSE) diff --git a/node_modules/textmaker-thiccy/node_modules/axios/SECURITY.md b/node_modules/textmaker-thiccy/node_modules/axios/SECURITY.md new file mode 100644 index 000000000..353df9a2f --- /dev/null +++ b/node_modules/textmaker-thiccy/node_modules/axios/SECURITY.md @@ -0,0 +1,5 @@ +# Security Policy + +## Reporting a Vulnerability + +Please report security issues to jasonsaayman@gmail.com diff --git a/node_modules/textmaker-thiccy/node_modules/axios/UPGRADE_GUIDE.md b/node_modules/textmaker-thiccy/node_modules/axios/UPGRADE_GUIDE.md new file mode 100644 index 000000000..745e80492 --- /dev/null +++ b/node_modules/textmaker-thiccy/node_modules/axios/UPGRADE_GUIDE.md @@ -0,0 +1,162 @@ +# Upgrade Guide + +### 0.15.x -> 0.16.0 + +#### `Promise` Type Declarations + +The `Promise` type declarations have been removed from the axios typings in favor of the built-in type declarations. If you use axios in a TypeScript project that targets `ES5`, please make sure to include the `es2015.promise` lib. Please see [this post](https://blog.mariusschulz.com/2016/11/25/typescript-2-0-built-in-type-declarations) for details. + +### 0.13.x -> 0.14.0 + +#### TypeScript Definitions + +The axios TypeScript definitions have been updated to match the axios API and use the ES2015 module syntax. + +Please use the following `import` statement to import axios in TypeScript: + +```typescript +import axios from 'axios'; + +axios.get('/foo') + .then(response => console.log(response)) + .catch(error => console.log(error)); +``` + +#### `agent` Config Option + +The `agent` config option has been replaced with two new options: `httpAgent` and `httpsAgent`. Please use them instead. + +```js +{ + // Define a custom agent for HTTP + httpAgent: new http.Agent({ keepAlive: true }), + // Define a custom agent for HTTPS + httpsAgent: new https.Agent({ keepAlive: true }) +} +``` + +#### `progress` Config Option + +The `progress` config option has been replaced with the `onUploadProgress` and `onDownloadProgress` options. + +```js +{ + // Define a handler for upload progress events + onUploadProgress: function (progressEvent) { + // ... + }, + + // Define a handler for download progress events + onDownloadProgress: function (progressEvent) { + // ... + } +} +``` + +### 0.12.x -> 0.13.0 + +The `0.13.0` release contains several changes to custom adapters and error handling. + +#### Error Handling + +Previous to this release an error could either be a server response with bad status code or an actual `Error`. With this release Promise will always reject with an `Error`. In the case that a response was received, the `Error` will also include the response. + +```js +axios.get('/user/12345') + .catch((error) => { + console.log(error.message); + console.log(error.code); // Not always specified + console.log(error.config); // The config that was used to make the request + console.log(error.response); // Only available if response was received from the server + }); +``` + +#### Request Adapters + +This release changes a few things about how request adapters work. Please take note if you are using your own custom adapter. + +1. Response transformer is now called outside of adapter. +2. Request adapter returns a `Promise`. + +This means that you no longer need to invoke `transformData` on response data. You will also no longer receive `resolve` and `reject` as arguments in your adapter. + +Previous code: + +```js +function myAdapter(resolve, reject, config) { + var response = { + data: transformData( + responseData, + responseHeaders, + config.transformResponse + ), + status: request.status, + statusText: request.statusText, + headers: responseHeaders + }; + settle(resolve, reject, response); +} +``` + +New code: + +```js +function myAdapter(config) { + return new Promise(function (resolve, reject) { + var response = { + data: responseData, + status: request.status, + statusText: request.statusText, + headers: responseHeaders + }; + settle(resolve, reject, response); + }); +} +``` + +See the related commits for more details: +- [Response transformers](https://github.com/axios/axios/commit/10eb23865101f9347570552c04e9d6211376e25e) +- [Request adapter Promise](https://github.com/axios/axios/commit/157efd5615890301824e3121cc6c9d2f9b21f94a) + +### 0.5.x -> 0.6.0 + +The `0.6.0` release contains mostly bug fixes, but there are a couple things to be aware of when upgrading. + +#### ES6 Promise Polyfill + +Up until the `0.6.0` release ES6 `Promise` was being polyfilled using [es6-promise](https://github.com/jakearchibald/es6-promise). With this release, the polyfill has been removed, and you will need to supply it yourself if your environment needs it. + +```js +require('es6-promise').polyfill(); +var axios = require('axios'); +``` + +This will polyfill the global environment, and only needs to be done once. + +#### `axios.success`/`axios.error` + +The `success`, and `error` aliases were deprecated in [0.4.0](https://github.com/axios/axios/blob/master/CHANGELOG.md#040-oct-03-2014). As of this release they have been removed entirely. Instead please use `axios.then`, and `axios.catch` respectively. + +```js +axios.get('some/url') + .then(function (res) { + /* ... */ + }) + .catch(function (err) { + /* ... */ + }); +``` + +#### UMD + +Previous versions of axios shipped with an AMD, CommonJS, and Global build. This has all been rolled into a single UMD build. + +```js +// AMD +require(['bower_components/axios/dist/axios'], function (axios) { + /* ... */ +}); + +// CommonJS +var axios = require('axios/dist/axios'); +``` diff --git a/node_modules/textmaker-thiccy/node_modules/axios/dist/axios.js b/node_modules/textmaker-thiccy/node_modules/axios/dist/axios.js new file mode 100644 index 000000000..f25391064 --- /dev/null +++ b/node_modules/textmaker-thiccy/node_modules/axios/dist/axios.js @@ -0,0 +1,2193 @@ +/* axios v0.21.4 | (c) 2021 by Matt Zabriskie */ +(function webpackUniversalModuleDefinition(root, factory) { + if(typeof exports === 'object' && typeof module === 'object') + module.exports = factory(); + else if(typeof define === 'function' && define.amd) + define([], factory); + else if(typeof exports === 'object') + exports["axios"] = factory(); + else + root["axios"] = factory(); +})(window, function() { +return /******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) { +/******/ return installedModules[moduleId].exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ i: moduleId, +/******/ l: false, +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __webpack_require__.c = installedModules; +/******/ +/******/ // define getter function for harmony exports +/******/ __webpack_require__.d = function(exports, name, getter) { +/******/ if(!__webpack_require__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); +/******/ } +/******/ }; +/******/ +/******/ // define __esModule on exports +/******/ __webpack_require__.r = function(exports) { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ +/******/ // create a fake namespace object +/******/ // mode & 1: value is a module id, require it +/******/ // mode & 2: merge all properties of value into the ns +/******/ // mode & 4: return value when already ns object +/******/ // mode & 8|1: behave like require +/******/ __webpack_require__.t = function(value, mode) { +/******/ if(mode & 1) value = __webpack_require__(value); +/******/ if(mode & 8) return value; +/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; +/******/ var ns = Object.create(null); +/******/ __webpack_require__.r(ns); +/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); +/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); +/******/ return ns; +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __webpack_require__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __webpack_require__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = ""; +/******/ +/******/ +/******/ // Load entry module and return exports +/******/ return __webpack_require__(__webpack_require__.s = "./index.js"); +/******/ }) +/************************************************************************/ +/******/ ({ + +/***/ "./index.js": +/*!******************!*\ + !*** ./index.js ***! + \******************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +module.exports = __webpack_require__(/*! ./lib/axios */ "./lib/axios.js"); + +/***/ }), + +/***/ "./lib/adapters/xhr.js": +/*!*****************************!*\ + !*** ./lib/adapters/xhr.js ***! + \*****************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var utils = __webpack_require__(/*! ./../utils */ "./lib/utils.js"); +var settle = __webpack_require__(/*! ./../core/settle */ "./lib/core/settle.js"); +var cookies = __webpack_require__(/*! ./../helpers/cookies */ "./lib/helpers/cookies.js"); +var buildURL = __webpack_require__(/*! ./../helpers/buildURL */ "./lib/helpers/buildURL.js"); +var buildFullPath = __webpack_require__(/*! ../core/buildFullPath */ "./lib/core/buildFullPath.js"); +var parseHeaders = __webpack_require__(/*! ./../helpers/parseHeaders */ "./lib/helpers/parseHeaders.js"); +var isURLSameOrigin = __webpack_require__(/*! ./../helpers/isURLSameOrigin */ "./lib/helpers/isURLSameOrigin.js"); +var createError = __webpack_require__(/*! ../core/createError */ "./lib/core/createError.js"); + +module.exports = function xhrAdapter(config) { + return new Promise(function dispatchXhrRequest(resolve, reject) { + var requestData = config.data; + var requestHeaders = config.headers; + var responseType = config.responseType; + + if (utils.isFormData(requestData)) { + delete requestHeaders['Content-Type']; // Let the browser set it + } + + var request = new XMLHttpRequest(); + + // HTTP basic authentication + if (config.auth) { + var username = config.auth.username || ''; + var password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : ''; + requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password); + } + + var fullPath = buildFullPath(config.baseURL, config.url); + request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true); + + // Set the request timeout in MS + request.timeout = config.timeout; + + function onloadend() { + if (!request) { + return; + } + // Prepare the response + var responseHeaders = 'getAllResponseHeaders' in request ? parseHeaders(request.getAllResponseHeaders()) : null; + var responseData = !responseType || responseType === 'text' || responseType === 'json' ? + request.responseText : request.response; + var response = { + data: responseData, + status: request.status, + statusText: request.statusText, + headers: responseHeaders, + config: config, + request: request + }; + + settle(resolve, reject, response); + + // Clean up request + request = null; + } + + if ('onloadend' in request) { + // Use onloadend if available + request.onloadend = onloadend; + } else { + // Listen for ready state to emulate onloadend + request.onreadystatechange = function handleLoad() { + if (!request || request.readyState !== 4) { + return; + } + + // The request errored out and we didn't get a response, this will be + // handled by onerror instead + // With one exception: request that using file: protocol, most browsers + // will return status as 0 even though it's a successful request + if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) { + return; + } + // readystate handler is calling before onerror or ontimeout handlers, + // so we should call onloadend on the next 'tick' + setTimeout(onloadend); + }; + } + + // Handle browser request cancellation (as opposed to a manual cancellation) + request.onabort = function handleAbort() { + if (!request) { + return; + } + + reject(createError('Request aborted', config, 'ECONNABORTED', request)); + + // Clean up request + request = null; + }; + + // Handle low level network errors + request.onerror = function handleError() { + // Real errors are hidden from us by the browser + // onerror should only fire if it's a network error + reject(createError('Network Error', config, null, request)); + + // Clean up request + request = null; + }; + + // Handle timeout + request.ontimeout = function handleTimeout() { + var timeoutErrorMessage = 'timeout of ' + config.timeout + 'ms exceeded'; + if (config.timeoutErrorMessage) { + timeoutErrorMessage = config.timeoutErrorMessage; + } + reject(createError( + timeoutErrorMessage, + config, + config.transitional && config.transitional.clarifyTimeoutError ? 'ETIMEDOUT' : 'ECONNABORTED', + request)); + + // Clean up request + request = null; + }; + + // Add xsrf header + // This is only done if running in a standard browser environment. + // Specifically not if we're in a web worker, or react-native. + if (utils.isStandardBrowserEnv()) { + // Add xsrf header + var xsrfValue = (config.withCredentials || isURLSameOrigin(fullPath)) && config.xsrfCookieName ? + cookies.read(config.xsrfCookieName) : + undefined; + + if (xsrfValue) { + requestHeaders[config.xsrfHeaderName] = xsrfValue; + } + } + + // Add headers to the request + if ('setRequestHeader' in request) { + utils.forEach(requestHeaders, function setRequestHeader(val, key) { + if (typeof requestData === 'undefined' && key.toLowerCase() === 'content-type') { + // Remove Content-Type if data is undefined + delete requestHeaders[key]; + } else { + // Otherwise add header to the request + request.setRequestHeader(key, val); + } + }); + } + + // Add withCredentials to request if needed + if (!utils.isUndefined(config.withCredentials)) { + request.withCredentials = !!config.withCredentials; + } + + // Add responseType to request if needed + if (responseType && responseType !== 'json') { + request.responseType = config.responseType; + } + + // Handle progress if needed + if (typeof config.onDownloadProgress === 'function') { + request.addEventListener('progress', config.onDownloadProgress); + } + + // Not all browsers support upload events + if (typeof config.onUploadProgress === 'function' && request.upload) { + request.upload.addEventListener('progress', config.onUploadProgress); + } + + if (config.cancelToken) { + // Handle cancellation + config.cancelToken.promise.then(function onCanceled(cancel) { + if (!request) { + return; + } + + request.abort(); + reject(cancel); + // Clean up request + request = null; + }); + } + + if (!requestData) { + requestData = null; + } + + // Send the request + request.send(requestData); + }); +}; + + +/***/ }), + +/***/ "./lib/axios.js": +/*!**********************!*\ + !*** ./lib/axios.js ***! + \**********************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var utils = __webpack_require__(/*! ./utils */ "./lib/utils.js"); +var bind = __webpack_require__(/*! ./helpers/bind */ "./lib/helpers/bind.js"); +var Axios = __webpack_require__(/*! ./core/Axios */ "./lib/core/Axios.js"); +var mergeConfig = __webpack_require__(/*! ./core/mergeConfig */ "./lib/core/mergeConfig.js"); +var defaults = __webpack_require__(/*! ./defaults */ "./lib/defaults.js"); + +/** + * Create an instance of Axios + * + * @param {Object} defaultConfig The default config for the instance + * @return {Axios} A new instance of Axios + */ +function createInstance(defaultConfig) { + var context = new Axios(defaultConfig); + var instance = bind(Axios.prototype.request, context); + + // Copy axios.prototype to instance + utils.extend(instance, Axios.prototype, context); + + // Copy context to instance + utils.extend(instance, context); + + return instance; +} + +// Create the default instance to be exported +var axios = createInstance(defaults); + +// Expose Axios class to allow class inheritance +axios.Axios = Axios; + +// Factory for creating new instances +axios.create = function create(instanceConfig) { + return createInstance(mergeConfig(axios.defaults, instanceConfig)); +}; + +// Expose Cancel & CancelToken +axios.Cancel = __webpack_require__(/*! ./cancel/Cancel */ "./lib/cancel/Cancel.js"); +axios.CancelToken = __webpack_require__(/*! ./cancel/CancelToken */ "./lib/cancel/CancelToken.js"); +axios.isCancel = __webpack_require__(/*! ./cancel/isCancel */ "./lib/cancel/isCancel.js"); + +// Expose all/spread +axios.all = function all(promises) { + return Promise.all(promises); +}; +axios.spread = __webpack_require__(/*! ./helpers/spread */ "./lib/helpers/spread.js"); + +// Expose isAxiosError +axios.isAxiosError = __webpack_require__(/*! ./helpers/isAxiosError */ "./lib/helpers/isAxiosError.js"); + +module.exports = axios; + +// Allow use of default import syntax in TypeScript +module.exports.default = axios; + + +/***/ }), + +/***/ "./lib/cancel/Cancel.js": +/*!******************************!*\ + !*** ./lib/cancel/Cancel.js ***! + \******************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +/** + * A `Cancel` is an object that is thrown when an operation is canceled. + * + * @class + * @param {string=} message The message. + */ +function Cancel(message) { + this.message = message; +} + +Cancel.prototype.toString = function toString() { + return 'Cancel' + (this.message ? ': ' + this.message : ''); +}; + +Cancel.prototype.__CANCEL__ = true; + +module.exports = Cancel; + + +/***/ }), + +/***/ "./lib/cancel/CancelToken.js": +/*!***********************************!*\ + !*** ./lib/cancel/CancelToken.js ***! + \***********************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var Cancel = __webpack_require__(/*! ./Cancel */ "./lib/cancel/Cancel.js"); + +/** + * A `CancelToken` is an object that can be used to request cancellation of an operation. + * + * @class + * @param {Function} executor The executor function. + */ +function CancelToken(executor) { + if (typeof executor !== 'function') { + throw new TypeError('executor must be a function.'); + } + + var resolvePromise; + this.promise = new Promise(function promiseExecutor(resolve) { + resolvePromise = resolve; + }); + + var token = this; + executor(function cancel(message) { + if (token.reason) { + // Cancellation has already been requested + return; + } + + token.reason = new Cancel(message); + resolvePromise(token.reason); + }); +} + +/** + * Throws a `Cancel` if cancellation has been requested. + */ +CancelToken.prototype.throwIfRequested = function throwIfRequested() { + if (this.reason) { + throw this.reason; + } +}; + +/** + * Returns an object that contains a new `CancelToken` and a function that, when called, + * cancels the `CancelToken`. + */ +CancelToken.source = function source() { + var cancel; + var token = new CancelToken(function executor(c) { + cancel = c; + }); + return { + token: token, + cancel: cancel + }; +}; + +module.exports = CancelToken; + + +/***/ }), + +/***/ "./lib/cancel/isCancel.js": +/*!********************************!*\ + !*** ./lib/cancel/isCancel.js ***! + \********************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +module.exports = function isCancel(value) { + return !!(value && value.__CANCEL__); +}; + + +/***/ }), + +/***/ "./lib/core/Axios.js": +/*!***************************!*\ + !*** ./lib/core/Axios.js ***! + \***************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var utils = __webpack_require__(/*! ./../utils */ "./lib/utils.js"); +var buildURL = __webpack_require__(/*! ../helpers/buildURL */ "./lib/helpers/buildURL.js"); +var InterceptorManager = __webpack_require__(/*! ./InterceptorManager */ "./lib/core/InterceptorManager.js"); +var dispatchRequest = __webpack_require__(/*! ./dispatchRequest */ "./lib/core/dispatchRequest.js"); +var mergeConfig = __webpack_require__(/*! ./mergeConfig */ "./lib/core/mergeConfig.js"); +var validator = __webpack_require__(/*! ../helpers/validator */ "./lib/helpers/validator.js"); + +var validators = validator.validators; +/** + * Create a new instance of Axios + * + * @param {Object} instanceConfig The default config for the instance + */ +function Axios(instanceConfig) { + this.defaults = instanceConfig; + this.interceptors = { + request: new InterceptorManager(), + response: new InterceptorManager() + }; +} + +/** + * Dispatch a request + * + * @param {Object} config The config specific for this request (merged with this.defaults) + */ +Axios.prototype.request = function request(config) { + /*eslint no-param-reassign:0*/ + // Allow for axios('example/url'[, config]) a la fetch API + if (typeof config === 'string') { + config = arguments[1] || {}; + config.url = arguments[0]; + } else { + config = config || {}; + } + + config = mergeConfig(this.defaults, config); + + // Set config.method + if (config.method) { + config.method = config.method.toLowerCase(); + } else if (this.defaults.method) { + config.method = this.defaults.method.toLowerCase(); + } else { + config.method = 'get'; + } + + var transitional = config.transitional; + + if (transitional !== undefined) { + validator.assertOptions(transitional, { + silentJSONParsing: validators.transitional(validators.boolean, '1.0.0'), + forcedJSONParsing: validators.transitional(validators.boolean, '1.0.0'), + clarifyTimeoutError: validators.transitional(validators.boolean, '1.0.0') + }, false); + } + + // filter out skipped interceptors + var requestInterceptorChain = []; + var synchronousRequestInterceptors = true; + this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) { + if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) { + return; + } + + synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous; + + requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected); + }); + + var responseInterceptorChain = []; + this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) { + responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected); + }); + + var promise; + + if (!synchronousRequestInterceptors) { + var chain = [dispatchRequest, undefined]; + + Array.prototype.unshift.apply(chain, requestInterceptorChain); + chain = chain.concat(responseInterceptorChain); + + promise = Promise.resolve(config); + while (chain.length) { + promise = promise.then(chain.shift(), chain.shift()); + } + + return promise; + } + + + var newConfig = config; + while (requestInterceptorChain.length) { + var onFulfilled = requestInterceptorChain.shift(); + var onRejected = requestInterceptorChain.shift(); + try { + newConfig = onFulfilled(newConfig); + } catch (error) { + onRejected(error); + break; + } + } + + try { + promise = dispatchRequest(newConfig); + } catch (error) { + return Promise.reject(error); + } + + while (responseInterceptorChain.length) { + promise = promise.then(responseInterceptorChain.shift(), responseInterceptorChain.shift()); + } + + return promise; +}; + +Axios.prototype.getUri = function getUri(config) { + config = mergeConfig(this.defaults, config); + return buildURL(config.url, config.params, config.paramsSerializer).replace(/^\?/, ''); +}; + +// Provide aliases for supported request methods +utils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) { + /*eslint func-names:0*/ + Axios.prototype[method] = function(url, config) { + return this.request(mergeConfig(config || {}, { + method: method, + url: url, + data: (config || {}).data + })); + }; +}); + +utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) { + /*eslint func-names:0*/ + Axios.prototype[method] = function(url, data, config) { + return this.request(mergeConfig(config || {}, { + method: method, + url: url, + data: data + })); + }; +}); + +module.exports = Axios; + + +/***/ }), + +/***/ "./lib/core/InterceptorManager.js": +/*!****************************************!*\ + !*** ./lib/core/InterceptorManager.js ***! + \****************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var utils = __webpack_require__(/*! ./../utils */ "./lib/utils.js"); + +function InterceptorManager() { + this.handlers = []; +} + +/** + * Add a new interceptor to the stack + * + * @param {Function} fulfilled The function to handle `then` for a `Promise` + * @param {Function} rejected The function to handle `reject` for a `Promise` + * + * @return {Number} An ID used to remove interceptor later + */ +InterceptorManager.prototype.use = function use(fulfilled, rejected, options) { + this.handlers.push({ + fulfilled: fulfilled, + rejected: rejected, + synchronous: options ? options.synchronous : false, + runWhen: options ? options.runWhen : null + }); + return this.handlers.length - 1; +}; + +/** + * Remove an interceptor from the stack + * + * @param {Number} id The ID that was returned by `use` + */ +InterceptorManager.prototype.eject = function eject(id) { + if (this.handlers[id]) { + this.handlers[id] = null; + } +}; + +/** + * Iterate over all the registered interceptors + * + * This method is particularly useful for skipping over any + * interceptors that may have become `null` calling `eject`. + * + * @param {Function} fn The function to call for each interceptor + */ +InterceptorManager.prototype.forEach = function forEach(fn) { + utils.forEach(this.handlers, function forEachHandler(h) { + if (h !== null) { + fn(h); + } + }); +}; + +module.exports = InterceptorManager; + + +/***/ }), + +/***/ "./lib/core/buildFullPath.js": +/*!***********************************!*\ + !*** ./lib/core/buildFullPath.js ***! + \***********************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var isAbsoluteURL = __webpack_require__(/*! ../helpers/isAbsoluteURL */ "./lib/helpers/isAbsoluteURL.js"); +var combineURLs = __webpack_require__(/*! ../helpers/combineURLs */ "./lib/helpers/combineURLs.js"); + +/** + * Creates a new URL by combining the baseURL with the requestedURL, + * only when the requestedURL is not already an absolute URL. + * If the requestURL is absolute, this function returns the requestedURL untouched. + * + * @param {string} baseURL The base URL + * @param {string} requestedURL Absolute or relative URL to combine + * @returns {string} The combined full path + */ +module.exports = function buildFullPath(baseURL, requestedURL) { + if (baseURL && !isAbsoluteURL(requestedURL)) { + return combineURLs(baseURL, requestedURL); + } + return requestedURL; +}; + + +/***/ }), + +/***/ "./lib/core/createError.js": +/*!*********************************!*\ + !*** ./lib/core/createError.js ***! + \*********************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var enhanceError = __webpack_require__(/*! ./enhanceError */ "./lib/core/enhanceError.js"); + +/** + * Create an Error with the specified message, config, error code, request and response. + * + * @param {string} message The error message. + * @param {Object} config The config. + * @param {string} [code] The error code (for example, 'ECONNABORTED'). + * @param {Object} [request] The request. + * @param {Object} [response] The response. + * @returns {Error} The created error. + */ +module.exports = function createError(message, config, code, request, response) { + var error = new Error(message); + return enhanceError(error, config, code, request, response); +}; + + +/***/ }), + +/***/ "./lib/core/dispatchRequest.js": +/*!*************************************!*\ + !*** ./lib/core/dispatchRequest.js ***! + \*************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var utils = __webpack_require__(/*! ./../utils */ "./lib/utils.js"); +var transformData = __webpack_require__(/*! ./transformData */ "./lib/core/transformData.js"); +var isCancel = __webpack_require__(/*! ../cancel/isCancel */ "./lib/cancel/isCancel.js"); +var defaults = __webpack_require__(/*! ../defaults */ "./lib/defaults.js"); + +/** + * Throws a `Cancel` if cancellation has been requested. + */ +function throwIfCancellationRequested(config) { + if (config.cancelToken) { + config.cancelToken.throwIfRequested(); + } +} + +/** + * Dispatch a request to the server using the configured adapter. + * + * @param {object} config The config that is to be used for the request + * @returns {Promise} The Promise to be fulfilled + */ +module.exports = function dispatchRequest(config) { + throwIfCancellationRequested(config); + + // Ensure headers exist + config.headers = config.headers || {}; + + // Transform request data + config.data = transformData.call( + config, + config.data, + config.headers, + config.transformRequest + ); + + // Flatten headers + config.headers = utils.merge( + config.headers.common || {}, + config.headers[config.method] || {}, + config.headers + ); + + utils.forEach( + ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'], + function cleanHeaderConfig(method) { + delete config.headers[method]; + } + ); + + var adapter = config.adapter || defaults.adapter; + + return adapter(config).then(function onAdapterResolution(response) { + throwIfCancellationRequested(config); + + // Transform response data + response.data = transformData.call( + config, + response.data, + response.headers, + config.transformResponse + ); + + return response; + }, function onAdapterRejection(reason) { + if (!isCancel(reason)) { + throwIfCancellationRequested(config); + + // Transform response data + if (reason && reason.response) { + reason.response.data = transformData.call( + config, + reason.response.data, + reason.response.headers, + config.transformResponse + ); + } + } + + return Promise.reject(reason); + }); +}; + + +/***/ }), + +/***/ "./lib/core/enhanceError.js": +/*!**********************************!*\ + !*** ./lib/core/enhanceError.js ***! + \**********************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +/** + * Update an Error with the specified config, error code, and response. + * + * @param {Error} error The error to update. + * @param {Object} config The config. + * @param {string} [code] The error code (for example, 'ECONNABORTED'). + * @param {Object} [request] The request. + * @param {Object} [response] The response. + * @returns {Error} The error. + */ +module.exports = function enhanceError(error, config, code, request, response) { + error.config = config; + if (code) { + error.code = code; + } + + error.request = request; + error.response = response; + error.isAxiosError = true; + + error.toJSON = function toJSON() { + return { + // Standard + message: this.message, + name: this.name, + // Microsoft + description: this.description, + number: this.number, + // Mozilla + fileName: this.fileName, + lineNumber: this.lineNumber, + columnNumber: this.columnNumber, + stack: this.stack, + // Axios + config: this.config, + code: this.code + }; + }; + return error; +}; + + +/***/ }), + +/***/ "./lib/core/mergeConfig.js": +/*!*********************************!*\ + !*** ./lib/core/mergeConfig.js ***! + \*********************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var utils = __webpack_require__(/*! ../utils */ "./lib/utils.js"); + +/** + * Config-specific merge-function which creates a new config-object + * by merging two configuration objects together. + * + * @param {Object} config1 + * @param {Object} config2 + * @returns {Object} New object resulting from merging config2 to config1 + */ +module.exports = function mergeConfig(config1, config2) { + // eslint-disable-next-line no-param-reassign + config2 = config2 || {}; + var config = {}; + + var valueFromConfig2Keys = ['url', 'method', 'data']; + var mergeDeepPropertiesKeys = ['headers', 'auth', 'proxy', 'params']; + var defaultToConfig2Keys = [ + 'baseURL', 'transformRequest', 'transformResponse', 'paramsSerializer', + 'timeout', 'timeoutMessage', 'withCredentials', 'adapter', 'responseType', 'xsrfCookieName', + 'xsrfHeaderName', 'onUploadProgress', 'onDownloadProgress', 'decompress', + 'maxContentLength', 'maxBodyLength', 'maxRedirects', 'transport', 'httpAgent', + 'httpsAgent', 'cancelToken', 'socketPath', 'responseEncoding' + ]; + var directMergeKeys = ['validateStatus']; + + function getMergedValue(target, source) { + if (utils.isPlainObject(target) && utils.isPlainObject(source)) { + return utils.merge(target, source); + } else if (utils.isPlainObject(source)) { + return utils.merge({}, source); + } else if (utils.isArray(source)) { + return source.slice(); + } + return source; + } + + function mergeDeepProperties(prop) { + if (!utils.isUndefined(config2[prop])) { + config[prop] = getMergedValue(config1[prop], config2[prop]); + } else if (!utils.isUndefined(config1[prop])) { + config[prop] = getMergedValue(undefined, config1[prop]); + } + } + + utils.forEach(valueFromConfig2Keys, function valueFromConfig2(prop) { + if (!utils.isUndefined(config2[prop])) { + config[prop] = getMergedValue(undefined, config2[prop]); + } + }); + + utils.forEach(mergeDeepPropertiesKeys, mergeDeepProperties); + + utils.forEach(defaultToConfig2Keys, function defaultToConfig2(prop) { + if (!utils.isUndefined(config2[prop])) { + config[prop] = getMergedValue(undefined, config2[prop]); + } else if (!utils.isUndefined(config1[prop])) { + config[prop] = getMergedValue(undefined, config1[prop]); + } + }); + + utils.forEach(directMergeKeys, function merge(prop) { + if (prop in config2) { + config[prop] = getMergedValue(config1[prop], config2[prop]); + } else if (prop in config1) { + config[prop] = getMergedValue(undefined, config1[prop]); + } + }); + + var axiosKeys = valueFromConfig2Keys + .concat(mergeDeepPropertiesKeys) + .concat(defaultToConfig2Keys) + .concat(directMergeKeys); + + var otherKeys = Object + .keys(config1) + .concat(Object.keys(config2)) + .filter(function filterAxiosKeys(key) { + return axiosKeys.indexOf(key) === -1; + }); + + utils.forEach(otherKeys, mergeDeepProperties); + + return config; +}; + + +/***/ }), + +/***/ "./lib/core/settle.js": +/*!****************************!*\ + !*** ./lib/core/settle.js ***! + \****************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var createError = __webpack_require__(/*! ./createError */ "./lib/core/createError.js"); + +/** + * Resolve or reject a Promise based on response status. + * + * @param {Function} resolve A function that resolves the promise. + * @param {Function} reject A function that rejects the promise. + * @param {object} response The response. + */ +module.exports = function settle(resolve, reject, response) { + var validateStatus = response.config.validateStatus; + if (!response.status || !validateStatus || validateStatus(response.status)) { + resolve(response); + } else { + reject(createError( + 'Request failed with status code ' + response.status, + response.config, + null, + response.request, + response + )); + } +}; + + +/***/ }), + +/***/ "./lib/core/transformData.js": +/*!***********************************!*\ + !*** ./lib/core/transformData.js ***! + \***********************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var utils = __webpack_require__(/*! ./../utils */ "./lib/utils.js"); +var defaults = __webpack_require__(/*! ./../defaults */ "./lib/defaults.js"); + +/** + * Transform the data for a request or a response + * + * @param {Object|String} data The data to be transformed + * @param {Array} headers The headers for the request or response + * @param {Array|Function} fns A single function or Array of functions + * @returns {*} The resulting transformed data + */ +module.exports = function transformData(data, headers, fns) { + var context = this || defaults; + /*eslint no-param-reassign:0*/ + utils.forEach(fns, function transform(fn) { + data = fn.call(context, data, headers); + }); + + return data; +}; + + +/***/ }), + +/***/ "./lib/defaults.js": +/*!*************************!*\ + !*** ./lib/defaults.js ***! + \*************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var utils = __webpack_require__(/*! ./utils */ "./lib/utils.js"); +var normalizeHeaderName = __webpack_require__(/*! ./helpers/normalizeHeaderName */ "./lib/helpers/normalizeHeaderName.js"); +var enhanceError = __webpack_require__(/*! ./core/enhanceError */ "./lib/core/enhanceError.js"); + +var DEFAULT_CONTENT_TYPE = { + 'Content-Type': 'application/x-www-form-urlencoded' +}; + +function setContentTypeIfUnset(headers, value) { + if (!utils.isUndefined(headers) && utils.isUndefined(headers['Content-Type'])) { + headers['Content-Type'] = value; + } +} + +function getDefaultAdapter() { + var adapter; + if (typeof XMLHttpRequest !== 'undefined') { + // For browsers use XHR adapter + adapter = __webpack_require__(/*! ./adapters/xhr */ "./lib/adapters/xhr.js"); + } else if (typeof process !== 'undefined' && Object.prototype.toString.call(process) === '[object process]') { + // For node use HTTP adapter + adapter = __webpack_require__(/*! ./adapters/http */ "./lib/adapters/xhr.js"); + } + return adapter; +} + +function stringifySafely(rawValue, parser, encoder) { + if (utils.isString(rawValue)) { + try { + (parser || JSON.parse)(rawValue); + return utils.trim(rawValue); + } catch (e) { + if (e.name !== 'SyntaxError') { + throw e; + } + } + } + + return (encoder || JSON.stringify)(rawValue); +} + +var defaults = { + + transitional: { + silentJSONParsing: true, + forcedJSONParsing: true, + clarifyTimeoutError: false + }, + + adapter: getDefaultAdapter(), + + transformRequest: [function transformRequest(data, headers) { + normalizeHeaderName(headers, 'Accept'); + normalizeHeaderName(headers, 'Content-Type'); + + if (utils.isFormData(data) || + utils.isArrayBuffer(data) || + utils.isBuffer(data) || + utils.isStream(data) || + utils.isFile(data) || + utils.isBlob(data) + ) { + return data; + } + if (utils.isArrayBufferView(data)) { + return data.buffer; + } + if (utils.isURLSearchParams(data)) { + setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8'); + return data.toString(); + } + if (utils.isObject(data) || (headers && headers['Content-Type'] === 'application/json')) { + setContentTypeIfUnset(headers, 'application/json'); + return stringifySafely(data); + } + return data; + }], + + transformResponse: [function transformResponse(data) { + var transitional = this.transitional; + var silentJSONParsing = transitional && transitional.silentJSONParsing; + var forcedJSONParsing = transitional && transitional.forcedJSONParsing; + var strictJSONParsing = !silentJSONParsing && this.responseType === 'json'; + + if (strictJSONParsing || (forcedJSONParsing && utils.isString(data) && data.length)) { + try { + return JSON.parse(data); + } catch (e) { + if (strictJSONParsing) { + if (e.name === 'SyntaxError') { + throw enhanceError(e, this, 'E_JSON_PARSE'); + } + throw e; + } + } + } + + return data; + }], + + /** + * A timeout in milliseconds to abort a request. If set to 0 (default) a + * timeout is not created. + */ + timeout: 0, + + xsrfCookieName: 'XSRF-TOKEN', + xsrfHeaderName: 'X-XSRF-TOKEN', + + maxContentLength: -1, + maxBodyLength: -1, + + validateStatus: function validateStatus(status) { + return status >= 200 && status < 300; + } +}; + +defaults.headers = { + common: { + 'Accept': 'application/json, text/plain, */*' + } +}; + +utils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) { + defaults.headers[method] = {}; +}); + +utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) { + defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE); +}); + +module.exports = defaults; + + +/***/ }), + +/***/ "./lib/helpers/bind.js": +/*!*****************************!*\ + !*** ./lib/helpers/bind.js ***! + \*****************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +module.exports = function bind(fn, thisArg) { + return function wrap() { + var args = new Array(arguments.length); + for (var i = 0; i < args.length; i++) { + args[i] = arguments[i]; + } + return fn.apply(thisArg, args); + }; +}; + + +/***/ }), + +/***/ "./lib/helpers/buildURL.js": +/*!*********************************!*\ + !*** ./lib/helpers/buildURL.js ***! + \*********************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var utils = __webpack_require__(/*! ./../utils */ "./lib/utils.js"); + +function encode(val) { + return encodeURIComponent(val). + replace(/%3A/gi, ':'). + replace(/%24/g, '$'). + replace(/%2C/gi, ','). + replace(/%20/g, '+'). + replace(/%5B/gi, '['). + replace(/%5D/gi, ']'); +} + +/** + * Build a URL by appending params to the end + * + * @param {string} url The base of the url (e.g., http://www.google.com) + * @param {object} [params] The params to be appended + * @returns {string} The formatted url + */ +module.exports = function buildURL(url, params, paramsSerializer) { + /*eslint no-param-reassign:0*/ + if (!params) { + return url; + } + + var serializedParams; + if (paramsSerializer) { + serializedParams = paramsSerializer(params); + } else if (utils.isURLSearchParams(params)) { + serializedParams = params.toString(); + } else { + var parts = []; + + utils.forEach(params, function serialize(val, key) { + if (val === null || typeof val === 'undefined') { + return; + } + + if (utils.isArray(val)) { + key = key + '[]'; + } else { + val = [val]; + } + + utils.forEach(val, function parseValue(v) { + if (utils.isDate(v)) { + v = v.toISOString(); + } else if (utils.isObject(v)) { + v = JSON.stringify(v); + } + parts.push(encode(key) + '=' + encode(v)); + }); + }); + + serializedParams = parts.join('&'); + } + + if (serializedParams) { + var hashmarkIndex = url.indexOf('#'); + if (hashmarkIndex !== -1) { + url = url.slice(0, hashmarkIndex); + } + + url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams; + } + + return url; +}; + + +/***/ }), + +/***/ "./lib/helpers/combineURLs.js": +/*!************************************!*\ + !*** ./lib/helpers/combineURLs.js ***! + \************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +/** + * Creates a new URL by combining the specified URLs + * + * @param {string} baseURL The base URL + * @param {string} relativeURL The relative URL + * @returns {string} The combined URL + */ +module.exports = function combineURLs(baseURL, relativeURL) { + return relativeURL + ? baseURL.replace(/\/+$/, '') + '/' + relativeURL.replace(/^\/+/, '') + : baseURL; +}; + + +/***/ }), + +/***/ "./lib/helpers/cookies.js": +/*!********************************!*\ + !*** ./lib/helpers/cookies.js ***! + \********************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var utils = __webpack_require__(/*! ./../utils */ "./lib/utils.js"); + +module.exports = ( + utils.isStandardBrowserEnv() ? + + // Standard browser envs support document.cookie + (function standardBrowserEnv() { + return { + write: function write(name, value, expires, path, domain, secure) { + var cookie = []; + cookie.push(name + '=' + encodeURIComponent(value)); + + if (utils.isNumber(expires)) { + cookie.push('expires=' + new Date(expires).toGMTString()); + } + + if (utils.isString(path)) { + cookie.push('path=' + path); + } + + if (utils.isString(domain)) { + cookie.push('domain=' + domain); + } + + if (secure === true) { + cookie.push('secure'); + } + + document.cookie = cookie.join('; '); + }, + + read: function read(name) { + var match = document.cookie.match(new RegExp('(^|;\\s*)(' + name + ')=([^;]*)')); + return (match ? decodeURIComponent(match[3]) : null); + }, + + remove: function remove(name) { + this.write(name, '', Date.now() - 86400000); + } + }; + })() : + + // Non standard browser env (web workers, react-native) lack needed support. + (function nonStandardBrowserEnv() { + return { + write: function write() {}, + read: function read() { return null; }, + remove: function remove() {} + }; + })() +); + + +/***/ }), + +/***/ "./lib/helpers/isAbsoluteURL.js": +/*!**************************************!*\ + !*** ./lib/helpers/isAbsoluteURL.js ***! + \**************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +/** + * Determines whether the specified URL is absolute + * + * @param {string} url The URL to test + * @returns {boolean} True if the specified URL is absolute, otherwise false + */ +module.exports = function isAbsoluteURL(url) { + // A URL is considered absolute if it begins with "://" or "//" (protocol-relative URL). + // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed + // by any combination of letters, digits, plus, period, or hyphen. + return /^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(url); +}; + + +/***/ }), + +/***/ "./lib/helpers/isAxiosError.js": +/*!*************************************!*\ + !*** ./lib/helpers/isAxiosError.js ***! + \*************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +/** + * Determines whether the payload is an error thrown by Axios + * + * @param {*} payload The value to test + * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false + */ +module.exports = function isAxiosError(payload) { + return (typeof payload === 'object') && (payload.isAxiosError === true); +}; + + +/***/ }), + +/***/ "./lib/helpers/isURLSameOrigin.js": +/*!****************************************!*\ + !*** ./lib/helpers/isURLSameOrigin.js ***! + \****************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var utils = __webpack_require__(/*! ./../utils */ "./lib/utils.js"); + +module.exports = ( + utils.isStandardBrowserEnv() ? + + // Standard browser envs have full support of the APIs needed to test + // whether the request URL is of the same origin as current location. + (function standardBrowserEnv() { + var msie = /(msie|trident)/i.test(navigator.userAgent); + var urlParsingNode = document.createElement('a'); + var originURL; + + /** + * Parse a URL to discover it's components + * + * @param {String} url The URL to be parsed + * @returns {Object} + */ + function resolveURL(url) { + var href = url; + + if (msie) { + // IE needs attribute set twice to normalize properties + urlParsingNode.setAttribute('href', href); + href = urlParsingNode.href; + } + + urlParsingNode.setAttribute('href', href); + + // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils + return { + href: urlParsingNode.href, + protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '', + host: urlParsingNode.host, + search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, '') : '', + hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '', + hostname: urlParsingNode.hostname, + port: urlParsingNode.port, + pathname: (urlParsingNode.pathname.charAt(0) === '/') ? + urlParsingNode.pathname : + '/' + urlParsingNode.pathname + }; + } + + originURL = resolveURL(window.location.href); + + /** + * Determine if a URL shares the same origin as the current location + * + * @param {String} requestURL The URL to test + * @returns {boolean} True if URL shares the same origin, otherwise false + */ + return function isURLSameOrigin(requestURL) { + var parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL; + return (parsed.protocol === originURL.protocol && + parsed.host === originURL.host); + }; + })() : + + // Non standard browser envs (web workers, react-native) lack needed support. + (function nonStandardBrowserEnv() { + return function isURLSameOrigin() { + return true; + }; + })() +); + + +/***/ }), + +/***/ "./lib/helpers/normalizeHeaderName.js": +/*!********************************************!*\ + !*** ./lib/helpers/normalizeHeaderName.js ***! + \********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var utils = __webpack_require__(/*! ../utils */ "./lib/utils.js"); + +module.exports = function normalizeHeaderName(headers, normalizedName) { + utils.forEach(headers, function processHeader(value, name) { + if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) { + headers[normalizedName] = value; + delete headers[name]; + } + }); +}; + + +/***/ }), + +/***/ "./lib/helpers/parseHeaders.js": +/*!*************************************!*\ + !*** ./lib/helpers/parseHeaders.js ***! + \*************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var utils = __webpack_require__(/*! ./../utils */ "./lib/utils.js"); + +// Headers whose duplicates are ignored by node +// c.f. https://nodejs.org/api/http.html#http_message_headers +var ignoreDuplicateOf = [ + 'age', 'authorization', 'content-length', 'content-type', 'etag', + 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since', + 'last-modified', 'location', 'max-forwards', 'proxy-authorization', + 'referer', 'retry-after', 'user-agent' +]; + +/** + * Parse headers into an object + * + * ``` + * Date: Wed, 27 Aug 2014 08:58:49 GMT + * Content-Type: application/json + * Connection: keep-alive + * Transfer-Encoding: chunked + * ``` + * + * @param {String} headers Headers needing to be parsed + * @returns {Object} Headers parsed into an object + */ +module.exports = function parseHeaders(headers) { + var parsed = {}; + var key; + var val; + var i; + + if (!headers) { return parsed; } + + utils.forEach(headers.split('\n'), function parser(line) { + i = line.indexOf(':'); + key = utils.trim(line.substr(0, i)).toLowerCase(); + val = utils.trim(line.substr(i + 1)); + + if (key) { + if (parsed[key] && ignoreDuplicateOf.indexOf(key) >= 0) { + return; + } + if (key === 'set-cookie') { + parsed[key] = (parsed[key] ? parsed[key] : []).concat([val]); + } else { + parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val; + } + } + }); + + return parsed; +}; + + +/***/ }), + +/***/ "./lib/helpers/spread.js": +/*!*******************************!*\ + !*** ./lib/helpers/spread.js ***! + \*******************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +/** + * Syntactic sugar for invoking a function and expanding an array for arguments. + * + * Common use case would be to use `Function.prototype.apply`. + * + * ```js + * function f(x, y, z) {} + * var args = [1, 2, 3]; + * f.apply(null, args); + * ``` + * + * With `spread` this example can be re-written. + * + * ```js + * spread(function(x, y, z) {})([1, 2, 3]); + * ``` + * + * @param {Function} callback + * @returns {Function} + */ +module.exports = function spread(callback) { + return function wrap(arr) { + return callback.apply(null, arr); + }; +}; + + +/***/ }), + +/***/ "./lib/helpers/validator.js": +/*!**********************************!*\ + !*** ./lib/helpers/validator.js ***! + \**********************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var pkg = __webpack_require__(/*! ./../../package.json */ "./package.json"); + +var validators = {}; + +// eslint-disable-next-line func-names +['object', 'boolean', 'number', 'function', 'string', 'symbol'].forEach(function(type, i) { + validators[type] = function validator(thing) { + return typeof thing === type || 'a' + (i < 1 ? 'n ' : ' ') + type; + }; +}); + +var deprecatedWarnings = {}; +var currentVerArr = pkg.version.split('.'); + +/** + * Compare package versions + * @param {string} version + * @param {string?} thanVersion + * @returns {boolean} + */ +function isOlderVersion(version, thanVersion) { + var pkgVersionArr = thanVersion ? thanVersion.split('.') : currentVerArr; + var destVer = version.split('.'); + for (var i = 0; i < 3; i++) { + if (pkgVersionArr[i] > destVer[i]) { + return true; + } else if (pkgVersionArr[i] < destVer[i]) { + return false; + } + } + return false; +} + +/** + * Transitional option validator + * @param {function|boolean?} validator + * @param {string?} version + * @param {string} message + * @returns {function} + */ +validators.transitional = function transitional(validator, version, message) { + var isDeprecated = version && isOlderVersion(version); + + function formatMessage(opt, desc) { + return '[Axios v' + pkg.version + '] Transitional option \'' + opt + '\'' + desc + (message ? '. ' + message : ''); + } + + // eslint-disable-next-line func-names + return function(value, opt, opts) { + if (validator === false) { + throw new Error(formatMessage(opt, ' has been removed in ' + version)); + } + + if (isDeprecated && !deprecatedWarnings[opt]) { + deprecatedWarnings[opt] = true; + // eslint-disable-next-line no-console + console.warn( + formatMessage( + opt, + ' has been deprecated since v' + version + ' and will be removed in the near future' + ) + ); + } + + return validator ? validator(value, opt, opts) : true; + }; +}; + +/** + * Assert object's properties type + * @param {object} options + * @param {object} schema + * @param {boolean?} allowUnknown + */ + +function assertOptions(options, schema, allowUnknown) { + if (typeof options !== 'object') { + throw new TypeError('options must be an object'); + } + var keys = Object.keys(options); + var i = keys.length; + while (i-- > 0) { + var opt = keys[i]; + var validator = schema[opt]; + if (validator) { + var value = options[opt]; + var result = value === undefined || validator(value, opt, options); + if (result !== true) { + throw new TypeError('option ' + opt + ' must be ' + result); + } + continue; + } + if (allowUnknown !== true) { + throw Error('Unknown option ' + opt); + } + } +} + +module.exports = { + isOlderVersion: isOlderVersion, + assertOptions: assertOptions, + validators: validators +}; + + +/***/ }), + +/***/ "./lib/utils.js": +/*!**********************!*\ + !*** ./lib/utils.js ***! + \**********************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var bind = __webpack_require__(/*! ./helpers/bind */ "./lib/helpers/bind.js"); + +// utils is a library of generic helper functions non-specific to axios + +var toString = Object.prototype.toString; + +/** + * Determine if a value is an Array + * + * @param {Object} val The value to test + * @returns {boolean} True if value is an Array, otherwise false + */ +function isArray(val) { + return toString.call(val) === '[object Array]'; +} + +/** + * Determine if a value is undefined + * + * @param {Object} val The value to test + * @returns {boolean} True if the value is undefined, otherwise false + */ +function isUndefined(val) { + return typeof val === 'undefined'; +} + +/** + * Determine if a value is a Buffer + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a Buffer, otherwise false + */ +function isBuffer(val) { + return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor) + && typeof val.constructor.isBuffer === 'function' && val.constructor.isBuffer(val); +} + +/** + * Determine if a value is an ArrayBuffer + * + * @param {Object} val The value to test + * @returns {boolean} True if value is an ArrayBuffer, otherwise false + */ +function isArrayBuffer(val) { + return toString.call(val) === '[object ArrayBuffer]'; +} + +/** + * Determine if a value is a FormData + * + * @param {Object} val The value to test + * @returns {boolean} True if value is an FormData, otherwise false + */ +function isFormData(val) { + return (typeof FormData !== 'undefined') && (val instanceof FormData); +} + +/** + * Determine if a value is a view on an ArrayBuffer + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false + */ +function isArrayBufferView(val) { + var result; + if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) { + result = ArrayBuffer.isView(val); + } else { + result = (val) && (val.buffer) && (val.buffer instanceof ArrayBuffer); + } + return result; +} + +/** + * Determine if a value is a String + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a String, otherwise false + */ +function isString(val) { + return typeof val === 'string'; +} + +/** + * Determine if a value is a Number + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a Number, otherwise false + */ +function isNumber(val) { + return typeof val === 'number'; +} + +/** + * Determine if a value is an Object + * + * @param {Object} val The value to test + * @returns {boolean} True if value is an Object, otherwise false + */ +function isObject(val) { + return val !== null && typeof val === 'object'; +} + +/** + * Determine if a value is a plain Object + * + * @param {Object} val The value to test + * @return {boolean} True if value is a plain Object, otherwise false + */ +function isPlainObject(val) { + if (toString.call(val) !== '[object Object]') { + return false; + } + + var prototype = Object.getPrototypeOf(val); + return prototype === null || prototype === Object.prototype; +} + +/** + * Determine if a value is a Date + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a Date, otherwise false + */ +function isDate(val) { + return toString.call(val) === '[object Date]'; +} + +/** + * Determine if a value is a File + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a File, otherwise false + */ +function isFile(val) { + return toString.call(val) === '[object File]'; +} + +/** + * Determine if a value is a Blob + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a Blob, otherwise false + */ +function isBlob(val) { + return toString.call(val) === '[object Blob]'; +} + +/** + * Determine if a value is a Function + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a Function, otherwise false + */ +function isFunction(val) { + return toString.call(val) === '[object Function]'; +} + +/** + * Determine if a value is a Stream + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a Stream, otherwise false + */ +function isStream(val) { + return isObject(val) && isFunction(val.pipe); +} + +/** + * Determine if a value is a URLSearchParams object + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a URLSearchParams object, otherwise false + */ +function isURLSearchParams(val) { + return typeof URLSearchParams !== 'undefined' && val instanceof URLSearchParams; +} + +/** + * Trim excess whitespace off the beginning and end of a string + * + * @param {String} str The String to trim + * @returns {String} The String freed of excess whitespace + */ +function trim(str) { + return str.trim ? str.trim() : str.replace(/^\s+|\s+$/g, ''); +} + +/** + * Determine if we're running in a standard browser environment + * + * This allows axios to run in a web worker, and react-native. + * Both environments support XMLHttpRequest, but not fully standard globals. + * + * web workers: + * typeof window -> undefined + * typeof document -> undefined + * + * react-native: + * navigator.product -> 'ReactNative' + * nativescript + * navigator.product -> 'NativeScript' or 'NS' + */ +function isStandardBrowserEnv() { + if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' || + navigator.product === 'NativeScript' || + navigator.product === 'NS')) { + return false; + } + return ( + typeof window !== 'undefined' && + typeof document !== 'undefined' + ); +} + +/** + * Iterate over an Array or an Object invoking a function for each item. + * + * If `obj` is an Array callback will be called passing + * the value, index, and complete array for each item. + * + * If 'obj' is an Object callback will be called passing + * the value, key, and complete object for each property. + * + * @param {Object|Array} obj The object to iterate + * @param {Function} fn The callback to invoke for each item + */ +function forEach(obj, fn) { + // Don't bother if no value provided + if (obj === null || typeof obj === 'undefined') { + return; + } + + // Force an array if not already something iterable + if (typeof obj !== 'object') { + /*eslint no-param-reassign:0*/ + obj = [obj]; + } + + if (isArray(obj)) { + // Iterate over array values + for (var i = 0, l = obj.length; i < l; i++) { + fn.call(null, obj[i], i, obj); + } + } else { + // Iterate over object keys + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) { + fn.call(null, obj[key], key, obj); + } + } + } +} + +/** + * Accepts varargs expecting each argument to be an object, then + * immutably merges the properties of each object and returns result. + * + * When multiple objects contain the same key the later object in + * the arguments list will take precedence. + * + * Example: + * + * ```js + * var result = merge({foo: 123}, {foo: 456}); + * console.log(result.foo); // outputs 456 + * ``` + * + * @param {Object} obj1 Object to merge + * @returns {Object} Result of all merge properties + */ +function merge(/* obj1, obj2, obj3, ... */) { + var result = {}; + function assignValue(val, key) { + if (isPlainObject(result[key]) && isPlainObject(val)) { + result[key] = merge(result[key], val); + } else if (isPlainObject(val)) { + result[key] = merge({}, val); + } else if (isArray(val)) { + result[key] = val.slice(); + } else { + result[key] = val; + } + } + + for (var i = 0, l = arguments.length; i < l; i++) { + forEach(arguments[i], assignValue); + } + return result; +} + +/** + * Extends object a by mutably adding to it the properties of object b. + * + * @param {Object} a The object to be extended + * @param {Object} b The object to copy properties from + * @param {Object} thisArg The object to bind function to + * @return {Object} The resulting value of object a + */ +function extend(a, b, thisArg) { + forEach(b, function assignValue(val, key) { + if (thisArg && typeof val === 'function') { + a[key] = bind(val, thisArg); + } else { + a[key] = val; + } + }); + return a; +} + +/** + * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM) + * + * @param {string} content with BOM + * @return {string} content value without BOM + */ +function stripBOM(content) { + if (content.charCodeAt(0) === 0xFEFF) { + content = content.slice(1); + } + return content; +} + +module.exports = { + isArray: isArray, + isArrayBuffer: isArrayBuffer, + isBuffer: isBuffer, + isFormData: isFormData, + isArrayBufferView: isArrayBufferView, + isString: isString, + isNumber: isNumber, + isObject: isObject, + isPlainObject: isPlainObject, + isUndefined: isUndefined, + isDate: isDate, + isFile: isFile, + isBlob: isBlob, + isFunction: isFunction, + isStream: isStream, + isURLSearchParams: isURLSearchParams, + isStandardBrowserEnv: isStandardBrowserEnv, + forEach: forEach, + merge: merge, + extend: extend, + trim: trim, + stripBOM: stripBOM +}; + + +/***/ }), + +/***/ "./package.json": +/*!**********************!*\ + !*** ./package.json ***! + \**********************/ +/*! exports provided: name, version, description, main, scripts, repository, keywords, author, license, bugs, homepage, devDependencies, browser, jsdelivr, unpkg, typings, dependencies, bundlesize, default */ +/***/ (function(module) { + +module.exports = JSON.parse("{\"name\":\"axios\",\"version\":\"0.21.4\",\"description\":\"Promise based HTTP client for the browser and node.js\",\"main\":\"index.js\",\"scripts\":{\"test\":\"grunt test\",\"start\":\"node ./sandbox/server.js\",\"build\":\"NODE_ENV=production grunt build\",\"preversion\":\"npm test\",\"version\":\"npm run build && grunt version && git add -A dist && git add CHANGELOG.md bower.json package.json\",\"postversion\":\"git push && git push --tags\",\"examples\":\"node ./examples/server.js\",\"coveralls\":\"cat coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js\",\"fix\":\"eslint --fix lib/**/*.js\"},\"repository\":{\"type\":\"git\",\"url\":\"https://github.com/axios/axios.git\"},\"keywords\":[\"xhr\",\"http\",\"ajax\",\"promise\",\"node\"],\"author\":\"Matt Zabriskie\",\"license\":\"MIT\",\"bugs\":{\"url\":\"https://github.com/axios/axios/issues\"},\"homepage\":\"https://axios-http.com\",\"devDependencies\":{\"coveralls\":\"^3.0.0\",\"es6-promise\":\"^4.2.4\",\"grunt\":\"^1.3.0\",\"grunt-banner\":\"^0.6.0\",\"grunt-cli\":\"^1.2.0\",\"grunt-contrib-clean\":\"^1.1.0\",\"grunt-contrib-watch\":\"^1.0.0\",\"grunt-eslint\":\"^23.0.0\",\"grunt-karma\":\"^4.0.0\",\"grunt-mocha-test\":\"^0.13.3\",\"grunt-ts\":\"^6.0.0-beta.19\",\"grunt-webpack\":\"^4.0.2\",\"istanbul-instrumenter-loader\":\"^1.0.0\",\"jasmine-core\":\"^2.4.1\",\"karma\":\"^6.3.2\",\"karma-chrome-launcher\":\"^3.1.0\",\"karma-firefox-launcher\":\"^2.1.0\",\"karma-jasmine\":\"^1.1.1\",\"karma-jasmine-ajax\":\"^0.1.13\",\"karma-safari-launcher\":\"^1.0.0\",\"karma-sauce-launcher\":\"^4.3.6\",\"karma-sinon\":\"^1.0.5\",\"karma-sourcemap-loader\":\"^0.3.8\",\"karma-webpack\":\"^4.0.2\",\"load-grunt-tasks\":\"^3.5.2\",\"minimist\":\"^1.2.0\",\"mocha\":\"^8.2.1\",\"sinon\":\"^4.5.0\",\"terser-webpack-plugin\":\"^4.2.3\",\"typescript\":\"^4.0.5\",\"url-search-params\":\"^0.10.0\",\"webpack\":\"^4.44.2\",\"webpack-dev-server\":\"^3.11.0\"},\"browser\":{\"./lib/adapters/http.js\":\"./lib/adapters/xhr.js\"},\"jsdelivr\":\"dist/axios.min.js\",\"unpkg\":\"dist/axios.min.js\",\"typings\":\"./index.d.ts\",\"dependencies\":{\"follow-redirects\":\"^1.14.0\"},\"bundlesize\":[{\"path\":\"./dist/axios.min.js\",\"threshold\":\"5kB\"}]}"); + +/***/ }) + +/******/ }); +}); +//# sourceMappingURL=axios.map \ No newline at end of file diff --git a/node_modules/textmaker-thiccy/node_modules/axios/dist/axios.map b/node_modules/textmaker-thiccy/node_modules/axios/dist/axios.map new file mode 100644 index 000000000..4aadb219e --- /dev/null +++ b/node_modules/textmaker-thiccy/node_modules/axios/dist/axios.map @@ -0,0 +1 @@ +{"version":3,"sources":["webpack://axios/webpack/universalModuleDefinition","webpack://axios/webpack/bootstrap","webpack://axios/./index.js","webpack://axios/./lib/adapters/xhr.js","webpack://axios/./lib/axios.js","webpack://axios/./lib/cancel/Cancel.js","webpack://axios/./lib/cancel/CancelToken.js","webpack://axios/./lib/cancel/isCancel.js","webpack://axios/./lib/core/Axios.js","webpack://axios/./lib/core/InterceptorManager.js","webpack://axios/./lib/core/buildFullPath.js","webpack://axios/./lib/core/createError.js","webpack://axios/./lib/core/dispatchRequest.js","webpack://axios/./lib/core/enhanceError.js","webpack://axios/./lib/core/mergeConfig.js","webpack://axios/./lib/core/settle.js","webpack://axios/./lib/core/transformData.js","webpack://axios/./lib/defaults.js","webpack://axios/./lib/helpers/bind.js","webpack://axios/./lib/helpers/buildURL.js","webpack://axios/./lib/helpers/combineURLs.js","webpack://axios/./lib/helpers/cookies.js","webpack://axios/./lib/helpers/isAbsoluteURL.js","webpack://axios/./lib/helpers/isAxiosError.js","webpack://axios/./lib/helpers/isURLSameOrigin.js","webpack://axios/./lib/helpers/normalizeHeaderName.js","webpack://axios/./lib/helpers/parseHeaders.js","webpack://axios/./lib/helpers/spread.js","webpack://axios/./lib/helpers/validator.js","webpack://axios/./lib/utils.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,O;QCVA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA,0CAA0C,gCAAgC;QAC1E;QACA;;QAEA;QACA;QACA;QACA,wDAAwD,kBAAkB;QAC1E;QACA,iDAAiD,cAAc;QAC/D;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA,yCAAyC,iCAAiC;QAC1E,gHAAgH,mBAAmB,EAAE;QACrI;QACA;;QAEA;QACA;QACA;QACA,2BAA2B,0BAA0B,EAAE;QACvD,iCAAiC,eAAe;QAChD;QACA;QACA;;QAEA;QACA,sDAAsD,+DAA+D;;QAErH;QACA;;;QAGA;QACA;;;;;;;;;;;;AClFA,iBAAiB,mBAAO,CAAC,mCAAa,E;;;;;;;;;;;;ACAzB;;AAEb,YAAY,mBAAO,CAAC,kCAAY;AAChC,aAAa,mBAAO,CAAC,8CAAkB;AACvC,cAAc,mBAAO,CAAC,sDAAsB;AAC5C,eAAe,mBAAO,CAAC,wDAAuB;AAC9C,oBAAoB,mBAAO,CAAC,0DAAuB;AACnD,mBAAmB,mBAAO,CAAC,gEAA2B;AACtD,sBAAsB,mBAAO,CAAC,sEAA8B;AAC5D,kBAAkB,mBAAO,CAAC,sDAAqB;;AAE/C;AACA;AACA;AACA;AACA;;AAEA;AACA,4CAA4C;AAC5C;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;;;;;;;;;;;;;AC5La;;AAEb,YAAY,mBAAO,CAAC,+BAAS;AAC7B,WAAW,mBAAO,CAAC,6CAAgB;AACnC,YAAY,mBAAO,CAAC,yCAAc;AAClC,kBAAkB,mBAAO,CAAC,qDAAoB;AAC9C,eAAe,mBAAO,CAAC,qCAAY;;AAEnC;AACA;AACA;AACA,WAAW,OAAO;AAClB,YAAY,MAAM;AAClB;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,eAAe,mBAAO,CAAC,+CAAiB;AACxC,oBAAoB,mBAAO,CAAC,yDAAsB;AAClD,iBAAiB,mBAAO,CAAC,mDAAmB;;AAE5C;AACA;AACA;AACA;AACA,eAAe,mBAAO,CAAC,iDAAkB;;AAEzC;AACA,qBAAqB,mBAAO,CAAC,6DAAwB;;AAErD;;AAEA;AACA;;;;;;;;;;;;;ACvDa;;AAEb;AACA;AACA;AACA;AACA,WAAW,QAAQ;AACnB;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;;;;;;;;;;;;;AClBa;;AAEb,aAAa,mBAAO,CAAC,wCAAU;;AAE/B;AACA;AACA;AACA;AACA,WAAW,SAAS;AACpB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;;ACxDa;;AAEb;AACA;AACA;;;;;;;;;;;;;ACJa;;AAEb,YAAY,mBAAO,CAAC,kCAAY;AAChC,eAAe,mBAAO,CAAC,sDAAqB;AAC5C,yBAAyB,mBAAO,CAAC,8DAAsB;AACvD,sBAAsB,mBAAO,CAAC,wDAAmB;AACjD,kBAAkB,mBAAO,CAAC,gDAAe;AACzC,gBAAgB,mBAAO,CAAC,wDAAsB;;AAE9C;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA,GAAG;;AAEH;AACA;AACA;AACA,GAAG;;AAEH;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,gDAAgD;AAChD;AACA;AACA,yBAAyB;AACzB,KAAK;AACL;AACA,CAAC;;AAED;AACA;AACA;AACA,gDAAgD;AAChD;AACA;AACA;AACA,KAAK;AACL;AACA,CAAC;;AAED;;;;;;;;;;;;;ACnJa;;AAEb,YAAY,mBAAO,CAAC,kCAAY;;AAEhC;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,SAAS;AACpB,WAAW,SAAS;AACpB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,SAAS;AACpB;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;AAEA;;;;;;;;;;;;;ACrDa;;AAEb,oBAAoB,mBAAO,CAAC,gEAA0B;AACtD,kBAAkB,mBAAO,CAAC,4DAAwB;;AAElD;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACnBa;;AAEb,mBAAmB,mBAAO,CAAC,kDAAgB;;AAE3C;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,MAAM;AACnB;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACjBa;;AAEb,YAAY,mBAAO,CAAC,kCAAY;AAChC,oBAAoB,mBAAO,CAAC,oDAAiB;AAC7C,eAAe,mBAAO,CAAC,oDAAoB;AAC3C,eAAe,mBAAO,CAAC,sCAAa;;AAEpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,+BAA+B;AAC/B,uCAAuC;AACvC;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,GAAG;AACH;;;;;;;;;;;;;ACjFa;;AAEb;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,MAAM;AACnB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACzCa;;AAEb,YAAY,mBAAO,CAAC,gCAAU;;AAE9B;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL,2BAA2B;AAC3B,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;;AAEH;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;;AAEA;AACA;;;;;;;;;;;;;ACtFa;;AAEb,kBAAkB,mBAAO,CAAC,gDAAe;;AAEzC;AACA;AACA;AACA,WAAW,SAAS;AACpB,WAAW,SAAS;AACpB,WAAW,OAAO;AAClB;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACxBa;;AAEb,YAAY,mBAAO,CAAC,kCAAY;AAChC,eAAe,mBAAO,CAAC,wCAAe;;AAEtC;AACA;AACA;AACA,WAAW,cAAc;AACzB,WAAW,MAAM;AACjB,WAAW,eAAe;AAC1B,aAAa,EAAE;AACf;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;;;;;;;;;;;;;ACrBa;;AAEb,YAAY,mBAAO,CAAC,+BAAS;AAC7B,0BAA0B,mBAAO,CAAC,2EAA+B;AACjE,mBAAmB,mBAAO,CAAC,uDAAqB;;AAEhD;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc,mBAAO,CAAC,6CAAgB;AACtC,GAAG;AACH;AACA,cAAc,mBAAO,CAAC,8CAAiB;AACvC;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,GAAG;;AAEH;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wEAAwE;AACxE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,CAAC;;AAED;AACA;AACA,CAAC;;AAED;;;;;;;;;;;;;ACrIa;;AAEb;AACA;AACA;AACA,mBAAmB,iBAAiB;AACpC;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACVa;;AAEb,YAAY,mBAAO,CAAC,kCAAY;;AAEhC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,OAAO;AACP,KAAK;;AAEL;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;;;;;;;;;;;;ACrEa;;AAEb;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACba;;AAEb,YAAY,mBAAO,CAAC,kCAAY;;AAEhC;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,0CAA0C;AAC1C,SAAS;;AAET;AACA,4DAA4D,wBAAwB;AACpF;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,kCAAkC;AAClC,+BAA+B,aAAa,EAAE;AAC9C;AACA;AACA,KAAK;AACL;;;;;;;;;;;;;ACpDa;;AAEb;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACba;;AAEb;AACA;AACA;AACA,WAAW,EAAE;AACb,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;;;;;;;;;;;;ACVa;;AAEb,YAAY,mBAAO,CAAC,kCAAY;;AAEhC;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,cAAc,OAAO;AACrB,gBAAgB;AAChB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,cAAc,OAAO;AACrB,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;;;;;;;;;;;;ACnEa;;AAEb,YAAY,mBAAO,CAAC,gCAAU;;AAE9B;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;;;;;;;;;;;;ACXa;;AAEb,YAAY,mBAAO,CAAC,kCAAY;;AAEhC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;;AAEA,iBAAiB,eAAe;;AAEhC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,GAAG;;AAEH;AACA;;;;;;;;;;;;;ACpDa;;AAEb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B;AAC/B;AACA;AACA,WAAW,SAAS;AACpB,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;AC1Ba;;AAEb,UAAU,mBAAO,CAAC,4CAAsB;;AAExC;;AAEA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;;AAEA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,QAAQ;AACnB,aAAa;AACb;AACA;AACA;AACA;AACA,iBAAiB,OAAO;AACxB;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,WAAW,kBAAkB;AAC7B,WAAW,QAAQ;AACnB,WAAW,OAAO;AAClB,aAAa;AACb;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,SAAS;AACpB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACxGa;;AAEb,WAAW,mBAAO,CAAC,6CAAgB;;AAEnC;;AAEA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,YAAY,QAAQ;AACpB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,OAAO;AACpB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,SAAS;AACpB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,mCAAmC,OAAO;AAC1C;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,SAAS,GAAG,SAAS;AAC5C,2BAA2B;AAC3B;AACA;AACA,WAAW,OAAO;AAClB,aAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,4BAA4B;AAC5B,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;;AAEA,uCAAuC,OAAO;AAC9C;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"axios.js","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[\"axios\"] = factory();\n\telse\n\t\troot[\"axios\"] = factory();\n})(window, function() {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = \"./index.js\");\n","module.exports = require('./lib/axios');","'use strict';\n\nvar utils = require('./../utils');\nvar settle = require('./../core/settle');\nvar cookies = require('./../helpers/cookies');\nvar buildURL = require('./../helpers/buildURL');\nvar buildFullPath = require('../core/buildFullPath');\nvar parseHeaders = require('./../helpers/parseHeaders');\nvar isURLSameOrigin = require('./../helpers/isURLSameOrigin');\nvar createError = require('../core/createError');\n\nmodule.exports = function xhrAdapter(config) {\n return new Promise(function dispatchXhrRequest(resolve, reject) {\n var requestData = config.data;\n var requestHeaders = config.headers;\n var responseType = config.responseType;\n\n if (utils.isFormData(requestData)) {\n delete requestHeaders['Content-Type']; // Let the browser set it\n }\n\n var request = new XMLHttpRequest();\n\n // HTTP basic authentication\n if (config.auth) {\n var username = config.auth.username || '';\n var password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : '';\n requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password);\n }\n\n var fullPath = buildFullPath(config.baseURL, config.url);\n request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true);\n\n // Set the request timeout in MS\n request.timeout = config.timeout;\n\n function onloadend() {\n if (!request) {\n return;\n }\n // Prepare the response\n var responseHeaders = 'getAllResponseHeaders' in request ? parseHeaders(request.getAllResponseHeaders()) : null;\n var responseData = !responseType || responseType === 'text' || responseType === 'json' ?\n request.responseText : request.response;\n var response = {\n data: responseData,\n status: request.status,\n statusText: request.statusText,\n headers: responseHeaders,\n config: config,\n request: request\n };\n\n settle(resolve, reject, response);\n\n // Clean up request\n request = null;\n }\n\n if ('onloadend' in request) {\n // Use onloadend if available\n request.onloadend = onloadend;\n } else {\n // Listen for ready state to emulate onloadend\n request.onreadystatechange = function handleLoad() {\n if (!request || request.readyState !== 4) {\n return;\n }\n\n // The request errored out and we didn't get a response, this will be\n // handled by onerror instead\n // With one exception: request that using file: protocol, most browsers\n // will return status as 0 even though it's a successful request\n if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {\n return;\n }\n // readystate handler is calling before onerror or ontimeout handlers,\n // so we should call onloadend on the next 'tick'\n setTimeout(onloadend);\n };\n }\n\n // Handle browser request cancellation (as opposed to a manual cancellation)\n request.onabort = function handleAbort() {\n if (!request) {\n return;\n }\n\n reject(createError('Request aborted', config, 'ECONNABORTED', request));\n\n // Clean up request\n request = null;\n };\n\n // Handle low level network errors\n request.onerror = function handleError() {\n // Real errors are hidden from us by the browser\n // onerror should only fire if it's a network error\n reject(createError('Network Error', config, null, request));\n\n // Clean up request\n request = null;\n };\n\n // Handle timeout\n request.ontimeout = function handleTimeout() {\n var timeoutErrorMessage = 'timeout of ' + config.timeout + 'ms exceeded';\n if (config.timeoutErrorMessage) {\n timeoutErrorMessage = config.timeoutErrorMessage;\n }\n reject(createError(\n timeoutErrorMessage,\n config,\n config.transitional && config.transitional.clarifyTimeoutError ? 'ETIMEDOUT' : 'ECONNABORTED',\n request));\n\n // Clean up request\n request = null;\n };\n\n // Add xsrf header\n // This is only done if running in a standard browser environment.\n // Specifically not if we're in a web worker, or react-native.\n if (utils.isStandardBrowserEnv()) {\n // Add xsrf header\n var xsrfValue = (config.withCredentials || isURLSameOrigin(fullPath)) && config.xsrfCookieName ?\n cookies.read(config.xsrfCookieName) :\n undefined;\n\n if (xsrfValue) {\n requestHeaders[config.xsrfHeaderName] = xsrfValue;\n }\n }\n\n // Add headers to the request\n if ('setRequestHeader' in request) {\n utils.forEach(requestHeaders, function setRequestHeader(val, key) {\n if (typeof requestData === 'undefined' && key.toLowerCase() === 'content-type') {\n // Remove Content-Type if data is undefined\n delete requestHeaders[key];\n } else {\n // Otherwise add header to the request\n request.setRequestHeader(key, val);\n }\n });\n }\n\n // Add withCredentials to request if needed\n if (!utils.isUndefined(config.withCredentials)) {\n request.withCredentials = !!config.withCredentials;\n }\n\n // Add responseType to request if needed\n if (responseType && responseType !== 'json') {\n request.responseType = config.responseType;\n }\n\n // Handle progress if needed\n if (typeof config.onDownloadProgress === 'function') {\n request.addEventListener('progress', config.onDownloadProgress);\n }\n\n // Not all browsers support upload events\n if (typeof config.onUploadProgress === 'function' && request.upload) {\n request.upload.addEventListener('progress', config.onUploadProgress);\n }\n\n if (config.cancelToken) {\n // Handle cancellation\n config.cancelToken.promise.then(function onCanceled(cancel) {\n if (!request) {\n return;\n }\n\n request.abort();\n reject(cancel);\n // Clean up request\n request = null;\n });\n }\n\n if (!requestData) {\n requestData = null;\n }\n\n // Send the request\n request.send(requestData);\n });\n};\n","'use strict';\n\nvar utils = require('./utils');\nvar bind = require('./helpers/bind');\nvar Axios = require('./core/Axios');\nvar mergeConfig = require('./core/mergeConfig');\nvar defaults = require('./defaults');\n\n/**\n * Create an instance of Axios\n *\n * @param {Object} defaultConfig The default config for the instance\n * @return {Axios} A new instance of Axios\n */\nfunction createInstance(defaultConfig) {\n var context = new Axios(defaultConfig);\n var instance = bind(Axios.prototype.request, context);\n\n // Copy axios.prototype to instance\n utils.extend(instance, Axios.prototype, context);\n\n // Copy context to instance\n utils.extend(instance, context);\n\n return instance;\n}\n\n// Create the default instance to be exported\nvar axios = createInstance(defaults);\n\n// Expose Axios class to allow class inheritance\naxios.Axios = Axios;\n\n// Factory for creating new instances\naxios.create = function create(instanceConfig) {\n return createInstance(mergeConfig(axios.defaults, instanceConfig));\n};\n\n// Expose Cancel & CancelToken\naxios.Cancel = require('./cancel/Cancel');\naxios.CancelToken = require('./cancel/CancelToken');\naxios.isCancel = require('./cancel/isCancel');\n\n// Expose all/spread\naxios.all = function all(promises) {\n return Promise.all(promises);\n};\naxios.spread = require('./helpers/spread');\n\n// Expose isAxiosError\naxios.isAxiosError = require('./helpers/isAxiosError');\n\nmodule.exports = axios;\n\n// Allow use of default import syntax in TypeScript\nmodule.exports.default = axios;\n","'use strict';\n\n/**\n * A `Cancel` is an object that is thrown when an operation is canceled.\n *\n * @class\n * @param {string=} message The message.\n */\nfunction Cancel(message) {\n this.message = message;\n}\n\nCancel.prototype.toString = function toString() {\n return 'Cancel' + (this.message ? ': ' + this.message : '');\n};\n\nCancel.prototype.__CANCEL__ = true;\n\nmodule.exports = Cancel;\n","'use strict';\n\nvar Cancel = require('./Cancel');\n\n/**\n * A `CancelToken` is an object that can be used to request cancellation of an operation.\n *\n * @class\n * @param {Function} executor The executor function.\n */\nfunction CancelToken(executor) {\n if (typeof executor !== 'function') {\n throw new TypeError('executor must be a function.');\n }\n\n var resolvePromise;\n this.promise = new Promise(function promiseExecutor(resolve) {\n resolvePromise = resolve;\n });\n\n var token = this;\n executor(function cancel(message) {\n if (token.reason) {\n // Cancellation has already been requested\n return;\n }\n\n token.reason = new Cancel(message);\n resolvePromise(token.reason);\n });\n}\n\n/**\n * Throws a `Cancel` if cancellation has been requested.\n */\nCancelToken.prototype.throwIfRequested = function throwIfRequested() {\n if (this.reason) {\n throw this.reason;\n }\n};\n\n/**\n * Returns an object that contains a new `CancelToken` and a function that, when called,\n * cancels the `CancelToken`.\n */\nCancelToken.source = function source() {\n var cancel;\n var token = new CancelToken(function executor(c) {\n cancel = c;\n });\n return {\n token: token,\n cancel: cancel\n };\n};\n\nmodule.exports = CancelToken;\n","'use strict';\n\nmodule.exports = function isCancel(value) {\n return !!(value && value.__CANCEL__);\n};\n","'use strict';\n\nvar utils = require('./../utils');\nvar buildURL = require('../helpers/buildURL');\nvar InterceptorManager = require('./InterceptorManager');\nvar dispatchRequest = require('./dispatchRequest');\nvar mergeConfig = require('./mergeConfig');\nvar validator = require('../helpers/validator');\n\nvar validators = validator.validators;\n/**\n * Create a new instance of Axios\n *\n * @param {Object} instanceConfig The default config for the instance\n */\nfunction Axios(instanceConfig) {\n this.defaults = instanceConfig;\n this.interceptors = {\n request: new InterceptorManager(),\n response: new InterceptorManager()\n };\n}\n\n/**\n * Dispatch a request\n *\n * @param {Object} config The config specific for this request (merged with this.defaults)\n */\nAxios.prototype.request = function request(config) {\n /*eslint no-param-reassign:0*/\n // Allow for axios('example/url'[, config]) a la fetch API\n if (typeof config === 'string') {\n config = arguments[1] || {};\n config.url = arguments[0];\n } else {\n config = config || {};\n }\n\n config = mergeConfig(this.defaults, config);\n\n // Set config.method\n if (config.method) {\n config.method = config.method.toLowerCase();\n } else if (this.defaults.method) {\n config.method = this.defaults.method.toLowerCase();\n } else {\n config.method = 'get';\n }\n\n var transitional = config.transitional;\n\n if (transitional !== undefined) {\n validator.assertOptions(transitional, {\n silentJSONParsing: validators.transitional(validators.boolean, '1.0.0'),\n forcedJSONParsing: validators.transitional(validators.boolean, '1.0.0'),\n clarifyTimeoutError: validators.transitional(validators.boolean, '1.0.0')\n }, false);\n }\n\n // filter out skipped interceptors\n var requestInterceptorChain = [];\n var synchronousRequestInterceptors = true;\n this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {\n if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) {\n return;\n }\n\n synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;\n\n requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);\n });\n\n var responseInterceptorChain = [];\n this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {\n responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);\n });\n\n var promise;\n\n if (!synchronousRequestInterceptors) {\n var chain = [dispatchRequest, undefined];\n\n Array.prototype.unshift.apply(chain, requestInterceptorChain);\n chain = chain.concat(responseInterceptorChain);\n\n promise = Promise.resolve(config);\n while (chain.length) {\n promise = promise.then(chain.shift(), chain.shift());\n }\n\n return promise;\n }\n\n\n var newConfig = config;\n while (requestInterceptorChain.length) {\n var onFulfilled = requestInterceptorChain.shift();\n var onRejected = requestInterceptorChain.shift();\n try {\n newConfig = onFulfilled(newConfig);\n } catch (error) {\n onRejected(error);\n break;\n }\n }\n\n try {\n promise = dispatchRequest(newConfig);\n } catch (error) {\n return Promise.reject(error);\n }\n\n while (responseInterceptorChain.length) {\n promise = promise.then(responseInterceptorChain.shift(), responseInterceptorChain.shift());\n }\n\n return promise;\n};\n\nAxios.prototype.getUri = function getUri(config) {\n config = mergeConfig(this.defaults, config);\n return buildURL(config.url, config.params, config.paramsSerializer).replace(/^\\?/, '');\n};\n\n// Provide aliases for supported request methods\nutils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, config) {\n return this.request(mergeConfig(config || {}, {\n method: method,\n url: url,\n data: (config || {}).data\n }));\n };\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, data, config) {\n return this.request(mergeConfig(config || {}, {\n method: method,\n url: url,\n data: data\n }));\n };\n});\n\nmodule.exports = Axios;\n","'use strict';\n\nvar utils = require('./../utils');\n\nfunction InterceptorManager() {\n this.handlers = [];\n}\n\n/**\n * Add a new interceptor to the stack\n *\n * @param {Function} fulfilled The function to handle `then` for a `Promise`\n * @param {Function} rejected The function to handle `reject` for a `Promise`\n *\n * @return {Number} An ID used to remove interceptor later\n */\nInterceptorManager.prototype.use = function use(fulfilled, rejected, options) {\n this.handlers.push({\n fulfilled: fulfilled,\n rejected: rejected,\n synchronous: options ? options.synchronous : false,\n runWhen: options ? options.runWhen : null\n });\n return this.handlers.length - 1;\n};\n\n/**\n * Remove an interceptor from the stack\n *\n * @param {Number} id The ID that was returned by `use`\n */\nInterceptorManager.prototype.eject = function eject(id) {\n if (this.handlers[id]) {\n this.handlers[id] = null;\n }\n};\n\n/**\n * Iterate over all the registered interceptors\n *\n * This method is particularly useful for skipping over any\n * interceptors that may have become `null` calling `eject`.\n *\n * @param {Function} fn The function to call for each interceptor\n */\nInterceptorManager.prototype.forEach = function forEach(fn) {\n utils.forEach(this.handlers, function forEachHandler(h) {\n if (h !== null) {\n fn(h);\n }\n });\n};\n\nmodule.exports = InterceptorManager;\n","'use strict';\n\nvar isAbsoluteURL = require('../helpers/isAbsoluteURL');\nvar combineURLs = require('../helpers/combineURLs');\n\n/**\n * Creates a new URL by combining the baseURL with the requestedURL,\n * only when the requestedURL is not already an absolute URL.\n * If the requestURL is absolute, this function returns the requestedURL untouched.\n *\n * @param {string} baseURL The base URL\n * @param {string} requestedURL Absolute or relative URL to combine\n * @returns {string} The combined full path\n */\nmodule.exports = function buildFullPath(baseURL, requestedURL) {\n if (baseURL && !isAbsoluteURL(requestedURL)) {\n return combineURLs(baseURL, requestedURL);\n }\n return requestedURL;\n};\n","'use strict';\n\nvar enhanceError = require('./enhanceError');\n\n/**\n * Create an Error with the specified message, config, error code, request and response.\n *\n * @param {string} message The error message.\n * @param {Object} config The config.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n * @returns {Error} The created error.\n */\nmodule.exports = function createError(message, config, code, request, response) {\n var error = new Error(message);\n return enhanceError(error, config, code, request, response);\n};\n","'use strict';\n\nvar utils = require('./../utils');\nvar transformData = require('./transformData');\nvar isCancel = require('../cancel/isCancel');\nvar defaults = require('../defaults');\n\n/**\n * Throws a `Cancel` if cancellation has been requested.\n */\nfunction throwIfCancellationRequested(config) {\n if (config.cancelToken) {\n config.cancelToken.throwIfRequested();\n }\n}\n\n/**\n * Dispatch a request to the server using the configured adapter.\n *\n * @param {object} config The config that is to be used for the request\n * @returns {Promise} The Promise to be fulfilled\n */\nmodule.exports = function dispatchRequest(config) {\n throwIfCancellationRequested(config);\n\n // Ensure headers exist\n config.headers = config.headers || {};\n\n // Transform request data\n config.data = transformData.call(\n config,\n config.data,\n config.headers,\n config.transformRequest\n );\n\n // Flatten headers\n config.headers = utils.merge(\n config.headers.common || {},\n config.headers[config.method] || {},\n config.headers\n );\n\n utils.forEach(\n ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],\n function cleanHeaderConfig(method) {\n delete config.headers[method];\n }\n );\n\n var adapter = config.adapter || defaults.adapter;\n\n return adapter(config).then(function onAdapterResolution(response) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n response.data = transformData.call(\n config,\n response.data,\n response.headers,\n config.transformResponse\n );\n\n return response;\n }, function onAdapterRejection(reason) {\n if (!isCancel(reason)) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n if (reason && reason.response) {\n reason.response.data = transformData.call(\n config,\n reason.response.data,\n reason.response.headers,\n config.transformResponse\n );\n }\n }\n\n return Promise.reject(reason);\n });\n};\n","'use strict';\n\n/**\n * Update an Error with the specified config, error code, and response.\n *\n * @param {Error} error The error to update.\n * @param {Object} config The config.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n * @returns {Error} The error.\n */\nmodule.exports = function enhanceError(error, config, code, request, response) {\n error.config = config;\n if (code) {\n error.code = code;\n }\n\n error.request = request;\n error.response = response;\n error.isAxiosError = true;\n\n error.toJSON = function toJSON() {\n return {\n // Standard\n message: this.message,\n name: this.name,\n // Microsoft\n description: this.description,\n number: this.number,\n // Mozilla\n fileName: this.fileName,\n lineNumber: this.lineNumber,\n columnNumber: this.columnNumber,\n stack: this.stack,\n // Axios\n config: this.config,\n code: this.code\n };\n };\n return error;\n};\n","'use strict';\n\nvar utils = require('../utils');\n\n/**\n * Config-specific merge-function which creates a new config-object\n * by merging two configuration objects together.\n *\n * @param {Object} config1\n * @param {Object} config2\n * @returns {Object} New object resulting from merging config2 to config1\n */\nmodule.exports = function mergeConfig(config1, config2) {\n // eslint-disable-next-line no-param-reassign\n config2 = config2 || {};\n var config = {};\n\n var valueFromConfig2Keys = ['url', 'method', 'data'];\n var mergeDeepPropertiesKeys = ['headers', 'auth', 'proxy', 'params'];\n var defaultToConfig2Keys = [\n 'baseURL', 'transformRequest', 'transformResponse', 'paramsSerializer',\n 'timeout', 'timeoutMessage', 'withCredentials', 'adapter', 'responseType', 'xsrfCookieName',\n 'xsrfHeaderName', 'onUploadProgress', 'onDownloadProgress', 'decompress',\n 'maxContentLength', 'maxBodyLength', 'maxRedirects', 'transport', 'httpAgent',\n 'httpsAgent', 'cancelToken', 'socketPath', 'responseEncoding'\n ];\n var directMergeKeys = ['validateStatus'];\n\n function getMergedValue(target, source) {\n if (utils.isPlainObject(target) && utils.isPlainObject(source)) {\n return utils.merge(target, source);\n } else if (utils.isPlainObject(source)) {\n return utils.merge({}, source);\n } else if (utils.isArray(source)) {\n return source.slice();\n }\n return source;\n }\n\n function mergeDeepProperties(prop) {\n if (!utils.isUndefined(config2[prop])) {\n config[prop] = getMergedValue(config1[prop], config2[prop]);\n } else if (!utils.isUndefined(config1[prop])) {\n config[prop] = getMergedValue(undefined, config1[prop]);\n }\n }\n\n utils.forEach(valueFromConfig2Keys, function valueFromConfig2(prop) {\n if (!utils.isUndefined(config2[prop])) {\n config[prop] = getMergedValue(undefined, config2[prop]);\n }\n });\n\n utils.forEach(mergeDeepPropertiesKeys, mergeDeepProperties);\n\n utils.forEach(defaultToConfig2Keys, function defaultToConfig2(prop) {\n if (!utils.isUndefined(config2[prop])) {\n config[prop] = getMergedValue(undefined, config2[prop]);\n } else if (!utils.isUndefined(config1[prop])) {\n config[prop] = getMergedValue(undefined, config1[prop]);\n }\n });\n\n utils.forEach(directMergeKeys, function merge(prop) {\n if (prop in config2) {\n config[prop] = getMergedValue(config1[prop], config2[prop]);\n } else if (prop in config1) {\n config[prop] = getMergedValue(undefined, config1[prop]);\n }\n });\n\n var axiosKeys = valueFromConfig2Keys\n .concat(mergeDeepPropertiesKeys)\n .concat(defaultToConfig2Keys)\n .concat(directMergeKeys);\n\n var otherKeys = Object\n .keys(config1)\n .concat(Object.keys(config2))\n .filter(function filterAxiosKeys(key) {\n return axiosKeys.indexOf(key) === -1;\n });\n\n utils.forEach(otherKeys, mergeDeepProperties);\n\n return config;\n};\n","'use strict';\n\nvar createError = require('./createError');\n\n/**\n * Resolve or reject a Promise based on response status.\n *\n * @param {Function} resolve A function that resolves the promise.\n * @param {Function} reject A function that rejects the promise.\n * @param {object} response The response.\n */\nmodule.exports = function settle(resolve, reject, response) {\n var validateStatus = response.config.validateStatus;\n if (!response.status || !validateStatus || validateStatus(response.status)) {\n resolve(response);\n } else {\n reject(createError(\n 'Request failed with status code ' + response.status,\n response.config,\n null,\n response.request,\n response\n ));\n }\n};\n","'use strict';\n\nvar utils = require('./../utils');\nvar defaults = require('./../defaults');\n\n/**\n * Transform the data for a request or a response\n *\n * @param {Object|String} data The data to be transformed\n * @param {Array} headers The headers for the request or response\n * @param {Array|Function} fns A single function or Array of functions\n * @returns {*} The resulting transformed data\n */\nmodule.exports = function transformData(data, headers, fns) {\n var context = this || defaults;\n /*eslint no-param-reassign:0*/\n utils.forEach(fns, function transform(fn) {\n data = fn.call(context, data, headers);\n });\n\n return data;\n};\n","'use strict';\n\nvar utils = require('./utils');\nvar normalizeHeaderName = require('./helpers/normalizeHeaderName');\nvar enhanceError = require('./core/enhanceError');\n\nvar DEFAULT_CONTENT_TYPE = {\n 'Content-Type': 'application/x-www-form-urlencoded'\n};\n\nfunction setContentTypeIfUnset(headers, value) {\n if (!utils.isUndefined(headers) && utils.isUndefined(headers['Content-Type'])) {\n headers['Content-Type'] = value;\n }\n}\n\nfunction getDefaultAdapter() {\n var adapter;\n if (typeof XMLHttpRequest !== 'undefined') {\n // For browsers use XHR adapter\n adapter = require('./adapters/xhr');\n } else if (typeof process !== 'undefined' && Object.prototype.toString.call(process) === '[object process]') {\n // For node use HTTP adapter\n adapter = require('./adapters/http');\n }\n return adapter;\n}\n\nfunction stringifySafely(rawValue, parser, encoder) {\n if (utils.isString(rawValue)) {\n try {\n (parser || JSON.parse)(rawValue);\n return utils.trim(rawValue);\n } catch (e) {\n if (e.name !== 'SyntaxError') {\n throw e;\n }\n }\n }\n\n return (encoder || JSON.stringify)(rawValue);\n}\n\nvar defaults = {\n\n transitional: {\n silentJSONParsing: true,\n forcedJSONParsing: true,\n clarifyTimeoutError: false\n },\n\n adapter: getDefaultAdapter(),\n\n transformRequest: [function transformRequest(data, headers) {\n normalizeHeaderName(headers, 'Accept');\n normalizeHeaderName(headers, 'Content-Type');\n\n if (utils.isFormData(data) ||\n utils.isArrayBuffer(data) ||\n utils.isBuffer(data) ||\n utils.isStream(data) ||\n utils.isFile(data) ||\n utils.isBlob(data)\n ) {\n return data;\n }\n if (utils.isArrayBufferView(data)) {\n return data.buffer;\n }\n if (utils.isURLSearchParams(data)) {\n setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8');\n return data.toString();\n }\n if (utils.isObject(data) || (headers && headers['Content-Type'] === 'application/json')) {\n setContentTypeIfUnset(headers, 'application/json');\n return stringifySafely(data);\n }\n return data;\n }],\n\n transformResponse: [function transformResponse(data) {\n var transitional = this.transitional;\n var silentJSONParsing = transitional && transitional.silentJSONParsing;\n var forcedJSONParsing = transitional && transitional.forcedJSONParsing;\n var strictJSONParsing = !silentJSONParsing && this.responseType === 'json';\n\n if (strictJSONParsing || (forcedJSONParsing && utils.isString(data) && data.length)) {\n try {\n return JSON.parse(data);\n } catch (e) {\n if (strictJSONParsing) {\n if (e.name === 'SyntaxError') {\n throw enhanceError(e, this, 'E_JSON_PARSE');\n }\n throw e;\n }\n }\n }\n\n return data;\n }],\n\n /**\n * A timeout in milliseconds to abort a request. If set to 0 (default) a\n * timeout is not created.\n */\n timeout: 0,\n\n xsrfCookieName: 'XSRF-TOKEN',\n xsrfHeaderName: 'X-XSRF-TOKEN',\n\n maxContentLength: -1,\n maxBodyLength: -1,\n\n validateStatus: function validateStatus(status) {\n return status >= 200 && status < 300;\n }\n};\n\ndefaults.headers = {\n common: {\n 'Accept': 'application/json, text/plain, */*'\n }\n};\n\nutils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) {\n defaults.headers[method] = {};\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE);\n});\n\nmodule.exports = defaults;\n","'use strict';\n\nmodule.exports = function bind(fn, thisArg) {\n return function wrap() {\n var args = new Array(arguments.length);\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i];\n }\n return fn.apply(thisArg, args);\n };\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\nfunction encode(val) {\n return encodeURIComponent(val).\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%20/g, '+').\n replace(/%5B/gi, '[').\n replace(/%5D/gi, ']');\n}\n\n/**\n * Build a URL by appending params to the end\n *\n * @param {string} url The base of the url (e.g., http://www.google.com)\n * @param {object} [params] The params to be appended\n * @returns {string} The formatted url\n */\nmodule.exports = function buildURL(url, params, paramsSerializer) {\n /*eslint no-param-reassign:0*/\n if (!params) {\n return url;\n }\n\n var serializedParams;\n if (paramsSerializer) {\n serializedParams = paramsSerializer(params);\n } else if (utils.isURLSearchParams(params)) {\n serializedParams = params.toString();\n } else {\n var parts = [];\n\n utils.forEach(params, function serialize(val, key) {\n if (val === null || typeof val === 'undefined') {\n return;\n }\n\n if (utils.isArray(val)) {\n key = key + '[]';\n } else {\n val = [val];\n }\n\n utils.forEach(val, function parseValue(v) {\n if (utils.isDate(v)) {\n v = v.toISOString();\n } else if (utils.isObject(v)) {\n v = JSON.stringify(v);\n }\n parts.push(encode(key) + '=' + encode(v));\n });\n });\n\n serializedParams = parts.join('&');\n }\n\n if (serializedParams) {\n var hashmarkIndex = url.indexOf('#');\n if (hashmarkIndex !== -1) {\n url = url.slice(0, hashmarkIndex);\n }\n\n url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;\n }\n\n return url;\n};\n","'use strict';\n\n/**\n * Creates a new URL by combining the specified URLs\n *\n * @param {string} baseURL The base URL\n * @param {string} relativeURL The relative URL\n * @returns {string} The combined URL\n */\nmodule.exports = function combineURLs(baseURL, relativeURL) {\n return relativeURL\n ? baseURL.replace(/\\/+$/, '') + '/' + relativeURL.replace(/^\\/+/, '')\n : baseURL;\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\nmodule.exports = (\n utils.isStandardBrowserEnv() ?\n\n // Standard browser envs support document.cookie\n (function standardBrowserEnv() {\n return {\n write: function write(name, value, expires, path, domain, secure) {\n var cookie = [];\n cookie.push(name + '=' + encodeURIComponent(value));\n\n if (utils.isNumber(expires)) {\n cookie.push('expires=' + new Date(expires).toGMTString());\n }\n\n if (utils.isString(path)) {\n cookie.push('path=' + path);\n }\n\n if (utils.isString(domain)) {\n cookie.push('domain=' + domain);\n }\n\n if (secure === true) {\n cookie.push('secure');\n }\n\n document.cookie = cookie.join('; ');\n },\n\n read: function read(name) {\n var match = document.cookie.match(new RegExp('(^|;\\\\s*)(' + name + ')=([^;]*)'));\n return (match ? decodeURIComponent(match[3]) : null);\n },\n\n remove: function remove(name) {\n this.write(name, '', Date.now() - 86400000);\n }\n };\n })() :\n\n // Non standard browser env (web workers, react-native) lack needed support.\n (function nonStandardBrowserEnv() {\n return {\n write: function write() {},\n read: function read() { return null; },\n remove: function remove() {}\n };\n })()\n);\n","'use strict';\n\n/**\n * Determines whether the specified URL is absolute\n *\n * @param {string} url The URL to test\n * @returns {boolean} True if the specified URL is absolute, otherwise false\n */\nmodule.exports = function isAbsoluteURL(url) {\n // A URL is considered absolute if it begins with \"://\" or \"//\" (protocol-relative URL).\n // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed\n // by any combination of letters, digits, plus, period, or hyphen.\n return /^([a-z][a-z\\d\\+\\-\\.]*:)?\\/\\//i.test(url);\n};\n","'use strict';\n\n/**\n * Determines whether the payload is an error thrown by Axios\n *\n * @param {*} payload The value to test\n * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false\n */\nmodule.exports = function isAxiosError(payload) {\n return (typeof payload === 'object') && (payload.isAxiosError === true);\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\nmodule.exports = (\n utils.isStandardBrowserEnv() ?\n\n // Standard browser envs have full support of the APIs needed to test\n // whether the request URL is of the same origin as current location.\n (function standardBrowserEnv() {\n var msie = /(msie|trident)/i.test(navigator.userAgent);\n var urlParsingNode = document.createElement('a');\n var originURL;\n\n /**\n * Parse a URL to discover it's components\n *\n * @param {String} url The URL to be parsed\n * @returns {Object}\n */\n function resolveURL(url) {\n var href = url;\n\n if (msie) {\n // IE needs attribute set twice to normalize properties\n urlParsingNode.setAttribute('href', href);\n href = urlParsingNode.href;\n }\n\n urlParsingNode.setAttribute('href', href);\n\n // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils\n return {\n href: urlParsingNode.href,\n protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',\n host: urlParsingNode.host,\n search: urlParsingNode.search ? urlParsingNode.search.replace(/^\\?/, '') : '',\n hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',\n hostname: urlParsingNode.hostname,\n port: urlParsingNode.port,\n pathname: (urlParsingNode.pathname.charAt(0) === '/') ?\n urlParsingNode.pathname :\n '/' + urlParsingNode.pathname\n };\n }\n\n originURL = resolveURL(window.location.href);\n\n /**\n * Determine if a URL shares the same origin as the current location\n *\n * @param {String} requestURL The URL to test\n * @returns {boolean} True if URL shares the same origin, otherwise false\n */\n return function isURLSameOrigin(requestURL) {\n var parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL;\n return (parsed.protocol === originURL.protocol &&\n parsed.host === originURL.host);\n };\n })() :\n\n // Non standard browser envs (web workers, react-native) lack needed support.\n (function nonStandardBrowserEnv() {\n return function isURLSameOrigin() {\n return true;\n };\n })()\n);\n","'use strict';\n\nvar utils = require('../utils');\n\nmodule.exports = function normalizeHeaderName(headers, normalizedName) {\n utils.forEach(headers, function processHeader(value, name) {\n if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) {\n headers[normalizedName] = value;\n delete headers[name];\n }\n });\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\n// Headers whose duplicates are ignored by node\n// c.f. https://nodejs.org/api/http.html#http_message_headers\nvar ignoreDuplicateOf = [\n 'age', 'authorization', 'content-length', 'content-type', 'etag',\n 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',\n 'last-modified', 'location', 'max-forwards', 'proxy-authorization',\n 'referer', 'retry-after', 'user-agent'\n];\n\n/**\n * Parse headers into an object\n *\n * ```\n * Date: Wed, 27 Aug 2014 08:58:49 GMT\n * Content-Type: application/json\n * Connection: keep-alive\n * Transfer-Encoding: chunked\n * ```\n *\n * @param {String} headers Headers needing to be parsed\n * @returns {Object} Headers parsed into an object\n */\nmodule.exports = function parseHeaders(headers) {\n var parsed = {};\n var key;\n var val;\n var i;\n\n if (!headers) { return parsed; }\n\n utils.forEach(headers.split('\\n'), function parser(line) {\n i = line.indexOf(':');\n key = utils.trim(line.substr(0, i)).toLowerCase();\n val = utils.trim(line.substr(i + 1));\n\n if (key) {\n if (parsed[key] && ignoreDuplicateOf.indexOf(key) >= 0) {\n return;\n }\n if (key === 'set-cookie') {\n parsed[key] = (parsed[key] ? parsed[key] : []).concat([val]);\n } else {\n parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;\n }\n }\n });\n\n return parsed;\n};\n","'use strict';\n\n/**\n * Syntactic sugar for invoking a function and expanding an array for arguments.\n *\n * Common use case would be to use `Function.prototype.apply`.\n *\n * ```js\n * function f(x, y, z) {}\n * var args = [1, 2, 3];\n * f.apply(null, args);\n * ```\n *\n * With `spread` this example can be re-written.\n *\n * ```js\n * spread(function(x, y, z) {})([1, 2, 3]);\n * ```\n *\n * @param {Function} callback\n * @returns {Function}\n */\nmodule.exports = function spread(callback) {\n return function wrap(arr) {\n return callback.apply(null, arr);\n };\n};\n","'use strict';\n\nvar pkg = require('./../../package.json');\n\nvar validators = {};\n\n// eslint-disable-next-line func-names\n['object', 'boolean', 'number', 'function', 'string', 'symbol'].forEach(function(type, i) {\n validators[type] = function validator(thing) {\n return typeof thing === type || 'a' + (i < 1 ? 'n ' : ' ') + type;\n };\n});\n\nvar deprecatedWarnings = {};\nvar currentVerArr = pkg.version.split('.');\n\n/**\n * Compare package versions\n * @param {string} version\n * @param {string?} thanVersion\n * @returns {boolean}\n */\nfunction isOlderVersion(version, thanVersion) {\n var pkgVersionArr = thanVersion ? thanVersion.split('.') : currentVerArr;\n var destVer = version.split('.');\n for (var i = 0; i < 3; i++) {\n if (pkgVersionArr[i] > destVer[i]) {\n return true;\n } else if (pkgVersionArr[i] < destVer[i]) {\n return false;\n }\n }\n return false;\n}\n\n/**\n * Transitional option validator\n * @param {function|boolean?} validator\n * @param {string?} version\n * @param {string} message\n * @returns {function}\n */\nvalidators.transitional = function transitional(validator, version, message) {\n var isDeprecated = version && isOlderVersion(version);\n\n function formatMessage(opt, desc) {\n return '[Axios v' + pkg.version + '] Transitional option \\'' + opt + '\\'' + desc + (message ? '. ' + message : '');\n }\n\n // eslint-disable-next-line func-names\n return function(value, opt, opts) {\n if (validator === false) {\n throw new Error(formatMessage(opt, ' has been removed in ' + version));\n }\n\n if (isDeprecated && !deprecatedWarnings[opt]) {\n deprecatedWarnings[opt] = true;\n // eslint-disable-next-line no-console\n console.warn(\n formatMessage(\n opt,\n ' has been deprecated since v' + version + ' and will be removed in the near future'\n )\n );\n }\n\n return validator ? validator(value, opt, opts) : true;\n };\n};\n\n/**\n * Assert object's properties type\n * @param {object} options\n * @param {object} schema\n * @param {boolean?} allowUnknown\n */\n\nfunction assertOptions(options, schema, allowUnknown) {\n if (typeof options !== 'object') {\n throw new TypeError('options must be an object');\n }\n var keys = Object.keys(options);\n var i = keys.length;\n while (i-- > 0) {\n var opt = keys[i];\n var validator = schema[opt];\n if (validator) {\n var value = options[opt];\n var result = value === undefined || validator(value, opt, options);\n if (result !== true) {\n throw new TypeError('option ' + opt + ' must be ' + result);\n }\n continue;\n }\n if (allowUnknown !== true) {\n throw Error('Unknown option ' + opt);\n }\n }\n}\n\nmodule.exports = {\n isOlderVersion: isOlderVersion,\n assertOptions: assertOptions,\n validators: validators\n};\n","'use strict';\n\nvar bind = require('./helpers/bind');\n\n// utils is a library of generic helper functions non-specific to axios\n\nvar toString = Object.prototype.toString;\n\n/**\n * Determine if a value is an Array\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an Array, otherwise false\n */\nfunction isArray(val) {\n return toString.call(val) === '[object Array]';\n}\n\n/**\n * Determine if a value is undefined\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if the value is undefined, otherwise false\n */\nfunction isUndefined(val) {\n return typeof val === 'undefined';\n}\n\n/**\n * Determine if a value is a Buffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Buffer, otherwise false\n */\nfunction isBuffer(val) {\n return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor)\n && typeof val.constructor.isBuffer === 'function' && val.constructor.isBuffer(val);\n}\n\n/**\n * Determine if a value is an ArrayBuffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an ArrayBuffer, otherwise false\n */\nfunction isArrayBuffer(val) {\n return toString.call(val) === '[object ArrayBuffer]';\n}\n\n/**\n * Determine if a value is a FormData\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an FormData, otherwise false\n */\nfunction isFormData(val) {\n return (typeof FormData !== 'undefined') && (val instanceof FormData);\n}\n\n/**\n * Determine if a value is a view on an ArrayBuffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false\n */\nfunction isArrayBufferView(val) {\n var result;\n if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {\n result = ArrayBuffer.isView(val);\n } else {\n result = (val) && (val.buffer) && (val.buffer instanceof ArrayBuffer);\n }\n return result;\n}\n\n/**\n * Determine if a value is a String\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a String, otherwise false\n */\nfunction isString(val) {\n return typeof val === 'string';\n}\n\n/**\n * Determine if a value is a Number\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Number, otherwise false\n */\nfunction isNumber(val) {\n return typeof val === 'number';\n}\n\n/**\n * Determine if a value is an Object\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an Object, otherwise false\n */\nfunction isObject(val) {\n return val !== null && typeof val === 'object';\n}\n\n/**\n * Determine if a value is a plain Object\n *\n * @param {Object} val The value to test\n * @return {boolean} True if value is a plain Object, otherwise false\n */\nfunction isPlainObject(val) {\n if (toString.call(val) !== '[object Object]') {\n return false;\n }\n\n var prototype = Object.getPrototypeOf(val);\n return prototype === null || prototype === Object.prototype;\n}\n\n/**\n * Determine if a value is a Date\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Date, otherwise false\n */\nfunction isDate(val) {\n return toString.call(val) === '[object Date]';\n}\n\n/**\n * Determine if a value is a File\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a File, otherwise false\n */\nfunction isFile(val) {\n return toString.call(val) === '[object File]';\n}\n\n/**\n * Determine if a value is a Blob\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Blob, otherwise false\n */\nfunction isBlob(val) {\n return toString.call(val) === '[object Blob]';\n}\n\n/**\n * Determine if a value is a Function\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Function, otherwise false\n */\nfunction isFunction(val) {\n return toString.call(val) === '[object Function]';\n}\n\n/**\n * Determine if a value is a Stream\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Stream, otherwise false\n */\nfunction isStream(val) {\n return isObject(val) && isFunction(val.pipe);\n}\n\n/**\n * Determine if a value is a URLSearchParams object\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a URLSearchParams object, otherwise false\n */\nfunction isURLSearchParams(val) {\n return typeof URLSearchParams !== 'undefined' && val instanceof URLSearchParams;\n}\n\n/**\n * Trim excess whitespace off the beginning and end of a string\n *\n * @param {String} str The String to trim\n * @returns {String} The String freed of excess whitespace\n */\nfunction trim(str) {\n return str.trim ? str.trim() : str.replace(/^\\s+|\\s+$/g, '');\n}\n\n/**\n * Determine if we're running in a standard browser environment\n *\n * This allows axios to run in a web worker, and react-native.\n * Both environments support XMLHttpRequest, but not fully standard globals.\n *\n * web workers:\n * typeof window -> undefined\n * typeof document -> undefined\n *\n * react-native:\n * navigator.product -> 'ReactNative'\n * nativescript\n * navigator.product -> 'NativeScript' or 'NS'\n */\nfunction isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}\n\n/**\n * Iterate over an Array or an Object invoking a function for each item.\n *\n * If `obj` is an Array callback will be called passing\n * the value, index, and complete array for each item.\n *\n * If 'obj' is an Object callback will be called passing\n * the value, key, and complete object for each property.\n *\n * @param {Object|Array} obj The object to iterate\n * @param {Function} fn The callback to invoke for each item\n */\nfunction forEach(obj, fn) {\n // Don't bother if no value provided\n if (obj === null || typeof obj === 'undefined') {\n return;\n }\n\n // Force an array if not already something iterable\n if (typeof obj !== 'object') {\n /*eslint no-param-reassign:0*/\n obj = [obj];\n }\n\n if (isArray(obj)) {\n // Iterate over array values\n for (var i = 0, l = obj.length; i < l; i++) {\n fn.call(null, obj[i], i, obj);\n }\n } else {\n // Iterate over object keys\n for (var key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key)) {\n fn.call(null, obj[key], key, obj);\n }\n }\n }\n}\n\n/**\n * Accepts varargs expecting each argument to be an object, then\n * immutably merges the properties of each object and returns result.\n *\n * When multiple objects contain the same key the later object in\n * the arguments list will take precedence.\n *\n * Example:\n *\n * ```js\n * var result = merge({foo: 123}, {foo: 456});\n * console.log(result.foo); // outputs 456\n * ```\n *\n * @param {Object} obj1 Object to merge\n * @returns {Object} Result of all merge properties\n */\nfunction merge(/* obj1, obj2, obj3, ... */) {\n var result = {};\n function assignValue(val, key) {\n if (isPlainObject(result[key]) && isPlainObject(val)) {\n result[key] = merge(result[key], val);\n } else if (isPlainObject(val)) {\n result[key] = merge({}, val);\n } else if (isArray(val)) {\n result[key] = val.slice();\n } else {\n result[key] = val;\n }\n }\n\n for (var i = 0, l = arguments.length; i < l; i++) {\n forEach(arguments[i], assignValue);\n }\n return result;\n}\n\n/**\n * Extends object a by mutably adding to it the properties of object b.\n *\n * @param {Object} a The object to be extended\n * @param {Object} b The object to copy properties from\n * @param {Object} thisArg The object to bind function to\n * @return {Object} The resulting value of object a\n */\nfunction extend(a, b, thisArg) {\n forEach(b, function assignValue(val, key) {\n if (thisArg && typeof val === 'function') {\n a[key] = bind(val, thisArg);\n } else {\n a[key] = val;\n }\n });\n return a;\n}\n\n/**\n * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM)\n *\n * @param {string} content with BOM\n * @return {string} content value without BOM\n */\nfunction stripBOM(content) {\n if (content.charCodeAt(0) === 0xFEFF) {\n content = content.slice(1);\n }\n return content;\n}\n\nmodule.exports = {\n isArray: isArray,\n isArrayBuffer: isArrayBuffer,\n isBuffer: isBuffer,\n isFormData: isFormData,\n isArrayBufferView: isArrayBufferView,\n isString: isString,\n isNumber: isNumber,\n isObject: isObject,\n isPlainObject: isPlainObject,\n isUndefined: isUndefined,\n isDate: isDate,\n isFile: isFile,\n isBlob: isBlob,\n isFunction: isFunction,\n isStream: isStream,\n isURLSearchParams: isURLSearchParams,\n isStandardBrowserEnv: isStandardBrowserEnv,\n forEach: forEach,\n merge: merge,\n extend: extend,\n trim: trim,\n stripBOM: stripBOM\n};\n"],"sourceRoot":""} \ No newline at end of file diff --git a/node_modules/textmaker-thiccy/node_modules/axios/dist/axios.min.js b/node_modules/textmaker-thiccy/node_modules/axios/dist/axios.min.js new file mode 100644 index 000000000..d5b138ad0 --- /dev/null +++ b/node_modules/textmaker-thiccy/node_modules/axios/dist/axios.min.js @@ -0,0 +1,3 @@ +/* axios v0.21.4 | (c) 2021 by Matt Zabriskie */ +!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.axios=t():e.axios=t()}(window,(function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=10)}([function(e,t,r){"use strict";var n=r(2),o=Object.prototype.toString;function i(e){return"[object Array]"===o.call(e)}function s(e){return void 0===e}function a(e){return null!==e&&"object"==typeof e}function u(e){if("[object Object]"!==o.call(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}function c(e){return"[object Function]"===o.call(e)}function f(e,t){if(null!=e)if("object"!=typeof e&&(e=[e]),i(e))for(var r=0,n=e.length;r=200&&e<300}};c.headers={common:{Accept:"application/json, text/plain, */*"}},n.forEach(["delete","get","head"],(function(e){c.headers[e]={}})),n.forEach(["post","put","patch"],(function(e){c.headers[e]=n.merge(s)})),e.exports=c},function(e,t,r){"use strict";e.exports=function(e,t){return function(){for(var r=new Array(arguments.length),n=0;n=0)return;s[t]="set-cookie"===t?(s[t]?s[t]:[]).concat([r]):s[t]?s[t]+", "+r:r}})),s):s}},function(e,t,r){"use strict";var n=r(0);e.exports=n.isStandardBrowserEnv()?function(){var e,t=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a");function o(e){var n=e;return t&&(r.setAttribute("href",n),n=r.href),r.setAttribute("href",n),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:"/"===r.pathname.charAt(0)?r.pathname:"/"+r.pathname}}return e=o(window.location.href),function(t){var r=n.isString(t)?o(t):t;return r.protocol===e.protocol&&r.host===e.host}}():function(){return!0}},function(e,t,r){"use strict";var n=r(25),o={};["object","boolean","number","function","string","symbol"].forEach((function(e,t){o[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}}));var i={},s=n.version.split(".");function a(e,t){for(var r=t?t.split("."):s,n=e.split("."),o=0;o<3;o++){if(r[o]>n[o])return!0;if(r[o]0;){var i=n[o],s=t[i];if(s){var a=e[i],u=void 0===a||s(a,i,e);if(!0!==u)throw new TypeError("option "+i+" must be "+u)}else if(!0!==r)throw Error("Unknown option "+i)}},validators:o}},function(e){e.exports=JSON.parse('{"name":"axios","version":"0.21.4","description":"Promise based HTTP client for the browser and node.js","main":"index.js","scripts":{"test":"grunt test","start":"node ./sandbox/server.js","build":"NODE_ENV=production grunt build","preversion":"npm test","version":"npm run build && grunt version && git add -A dist && git add CHANGELOG.md bower.json package.json","postversion":"git push && git push --tags","examples":"node ./examples/server.js","coveralls":"cat coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js","fix":"eslint --fix lib/**/*.js"},"repository":{"type":"git","url":"https://github.com/axios/axios.git"},"keywords":["xhr","http","ajax","promise","node"],"author":"Matt Zabriskie","license":"MIT","bugs":{"url":"https://github.com/axios/axios/issues"},"homepage":"https://axios-http.com","devDependencies":{"coveralls":"^3.0.0","es6-promise":"^4.2.4","grunt":"^1.3.0","grunt-banner":"^0.6.0","grunt-cli":"^1.2.0","grunt-contrib-clean":"^1.1.0","grunt-contrib-watch":"^1.0.0","grunt-eslint":"^23.0.0","grunt-karma":"^4.0.0","grunt-mocha-test":"^0.13.3","grunt-ts":"^6.0.0-beta.19","grunt-webpack":"^4.0.2","istanbul-instrumenter-loader":"^1.0.0","jasmine-core":"^2.4.1","karma":"^6.3.2","karma-chrome-launcher":"^3.1.0","karma-firefox-launcher":"^2.1.0","karma-jasmine":"^1.1.1","karma-jasmine-ajax":"^0.1.13","karma-safari-launcher":"^1.0.0","karma-sauce-launcher":"^4.3.6","karma-sinon":"^1.0.5","karma-sourcemap-loader":"^0.3.8","karma-webpack":"^4.0.2","load-grunt-tasks":"^3.5.2","minimist":"^1.2.0","mocha":"^8.2.1","sinon":"^4.5.0","terser-webpack-plugin":"^4.2.3","typescript":"^4.0.5","url-search-params":"^0.10.0","webpack":"^4.44.2","webpack-dev-server":"^3.11.0"},"browser":{"./lib/adapters/http.js":"./lib/adapters/xhr.js"},"jsdelivr":"dist/axios.min.js","unpkg":"dist/axios.min.js","typings":"./index.d.ts","dependencies":{"follow-redirects":"^1.14.0"},"bundlesize":[{"path":"./dist/axios.min.js","threshold":"5kB"}]}')},function(e,t,r){"use strict";var n=r(9);function o(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise((function(e){t=e}));var r=this;e((function(e){r.reason||(r.reason=new n(e),t(r.reason))}))}o.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},o.source=function(){var e;return{token:new o((function(t){e=t})),cancel:e}},e.exports=o},function(e,t,r){"use strict";e.exports=function(e){return function(t){return e.apply(null,t)}}},function(e,t,r){"use strict";e.exports=function(e){return"object"==typeof e&&!0===e.isAxiosError}}])})); +//# sourceMappingURL=axios.min.map \ No newline at end of file diff --git a/node_modules/textmaker-thiccy/node_modules/axios/dist/axios.min.map b/node_modules/textmaker-thiccy/node_modules/axios/dist/axios.min.map new file mode 100644 index 000000000..468a5babc --- /dev/null +++ b/node_modules/textmaker-thiccy/node_modules/axios/dist/axios.min.map @@ -0,0 +1 @@ +{"version":3,"sources":["webpack://axios/webpack/universalModuleDefinition","webpack://axios/webpack/bootstrap","webpack://axios/./lib/utils.js","webpack://axios/./lib/defaults.js","webpack://axios/./lib/helpers/bind.js","webpack://axios/./lib/helpers/buildURL.js","webpack://axios/./lib/core/enhanceError.js","webpack://axios/./lib/adapters/xhr.js","webpack://axios/./lib/core/createError.js","webpack://axios/./lib/cancel/isCancel.js","webpack://axios/./lib/core/mergeConfig.js","webpack://axios/./lib/cancel/Cancel.js","webpack://axios/./index.js","webpack://axios/./lib/axios.js","webpack://axios/./lib/core/Axios.js","webpack://axios/./lib/core/InterceptorManager.js","webpack://axios/./lib/core/dispatchRequest.js","webpack://axios/./lib/core/transformData.js","webpack://axios/./lib/helpers/normalizeHeaderName.js","webpack://axios/./lib/core/settle.js","webpack://axios/./lib/helpers/cookies.js","webpack://axios/./lib/core/buildFullPath.js","webpack://axios/./lib/helpers/isAbsoluteURL.js","webpack://axios/./lib/helpers/combineURLs.js","webpack://axios/./lib/helpers/parseHeaders.js","webpack://axios/./lib/helpers/isURLSameOrigin.js","webpack://axios/./lib/helpers/validator.js","webpack://axios/./lib/cancel/CancelToken.js","webpack://axios/./lib/helpers/spread.js","webpack://axios/./lib/helpers/isAxiosError.js"],"names":["root","factory","exports","module","define","amd","window","installedModules","__webpack_require__","moduleId","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","toString","isArray","val","isUndefined","isObject","isPlainObject","getPrototypeOf","isFunction","forEach","obj","fn","length","isArrayBuffer","isBuffer","constructor","isFormData","FormData","isArrayBufferView","ArrayBuffer","isView","buffer","isString","isNumber","isDate","isFile","isBlob","isStream","pipe","isURLSearchParams","URLSearchParams","isStandardBrowserEnv","navigator","product","document","merge","result","assignValue","slice","arguments","extend","a","b","thisArg","trim","str","replace","stripBOM","content","charCodeAt","utils","normalizeHeaderName","enhanceError","DEFAULT_CONTENT_TYPE","setContentTypeIfUnset","headers","adapter","defaults","transitional","silentJSONParsing","forcedJSONParsing","clarifyTimeoutError","XMLHttpRequest","process","transformRequest","data","rawValue","parser","encoder","JSON","parse","e","stringify","stringifySafely","transformResponse","this","strictJSONParsing","responseType","timeout","xsrfCookieName","xsrfHeaderName","maxContentLength","maxBodyLength","validateStatus","status","common","method","args","Array","apply","encode","encodeURIComponent","url","params","paramsSerializer","serializedParams","parts","v","toISOString","push","join","hashmarkIndex","indexOf","error","config","code","request","response","isAxiosError","toJSON","message","description","number","fileName","lineNumber","columnNumber","stack","settle","cookies","buildURL","buildFullPath","parseHeaders","isURLSameOrigin","createError","Promise","resolve","reject","requestData","requestHeaders","auth","username","password","unescape","Authorization","btoa","fullPath","baseURL","onloadend","responseHeaders","getAllResponseHeaders","responseText","statusText","open","toUpperCase","onreadystatechange","readyState","responseURL","setTimeout","onabort","onerror","ontimeout","timeoutErrorMessage","xsrfValue","withCredentials","read","undefined","toLowerCase","setRequestHeader","onDownloadProgress","addEventListener","onUploadProgress","upload","cancelToken","promise","then","cancel","abort","send","Error","__CANCEL__","config1","config2","valueFromConfig2Keys","mergeDeepPropertiesKeys","defaultToConfig2Keys","directMergeKeys","getMergedValue","target","source","mergeDeepProperties","prop","axiosKeys","concat","otherKeys","keys","filter","Cancel","Axios","mergeConfig","createInstance","defaultConfig","context","instance","axios","instanceConfig","CancelToken","isCancel","all","promises","spread","default","InterceptorManager","dispatchRequest","validator","validators","interceptors","assertOptions","boolean","requestInterceptorChain","synchronousRequestInterceptors","interceptor","runWhen","synchronous","unshift","fulfilled","rejected","responseInterceptorChain","chain","shift","newConfig","onFulfilled","onRejected","getUri","handlers","use","options","eject","id","h","transformData","throwIfCancellationRequested","throwIfRequested","reason","fns","normalizedName","write","expires","path","domain","secure","cookie","Date","toGMTString","match","RegExp","decodeURIComponent","remove","now","isAbsoluteURL","combineURLs","requestedURL","test","relativeURL","ignoreDuplicateOf","parsed","split","line","substr","originURL","msie","userAgent","urlParsingNode","createElement","resolveURL","href","setAttribute","protocol","host","search","hash","hostname","port","pathname","charAt","location","requestURL","pkg","type","thing","deprecatedWarnings","currentVerArr","version","isOlderVersion","thanVersion","pkgVersionArr","destVer","isDeprecated","formatMessage","opt","desc","opts","console","warn","schema","allowUnknown","TypeError","executor","resolvePromise","token","callback","arr","payload"],"mappings":"CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,IACQ,mBAAXG,QAAyBA,OAAOC,IAC9CD,OAAO,GAAIH,GACe,iBAAZC,QACdA,QAAe,MAAID,IAEnBD,EAAY,MAAIC,IARlB,CASGK,QAAQ,WACX,O,YCTE,IAAIC,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUP,QAGnC,IAAIC,EAASI,EAAiBE,GAAY,CACzCC,EAAGD,EACHE,GAAG,EACHT,QAAS,IAUV,OANAU,EAAQH,GAAUI,KAAKV,EAAOD,QAASC,EAAQA,EAAOD,QAASM,GAG/DL,EAAOQ,GAAI,EAGJR,EAAOD,QA0Df,OArDAM,EAAoBM,EAAIF,EAGxBJ,EAAoBO,EAAIR,EAGxBC,EAAoBQ,EAAI,SAASd,EAASe,EAAMC,GAC3CV,EAAoBW,EAAEjB,EAASe,IAClCG,OAAOC,eAAenB,EAASe,EAAM,CAAEK,YAAY,EAAMC,IAAKL,KAKhEV,EAAoBgB,EAAI,SAAStB,GACX,oBAAXuB,QAA0BA,OAAOC,aAC1CN,OAAOC,eAAenB,EAASuB,OAAOC,YAAa,CAAEC,MAAO,WAE7DP,OAAOC,eAAenB,EAAS,aAAc,CAAEyB,OAAO,KAQvDnB,EAAoBoB,EAAI,SAASD,EAAOE,GAEvC,GAD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Q,UAAU,UAAYP,EAAM,YAAc5P,QAIxD,IAAqB,IAAjBkQ,EACF,MAAM9H,MAAM,kBAAoBwH,KAQpCpF,WAAYA,I,0+DCrGd,IAAIlB,EAAS,EAAQ,GAQrB,SAASS,EAAYqG,GACnB,GAAwB,mBAAbA,EACT,MAAM,IAAID,UAAU,gCAGtB,IAAIE,EACJ9N,KAAKwF,QAAU,IAAIvC,SAAQ,SAAyBC,GAClD4K,EAAiB5K,KAGnB,IAAI6K,EAAQ/N,KACZ6N,GAAS,SAAgB1L,GACnB4L,EAAMlE,SAKVkE,EAAMlE,OAAS,IAAI9C,EAAO5E,GAC1B2L,EAAeC,EAAMlE,YAOzBrC,EAAYtM,UAAU0O,iBAAmB,WACvC,GAAI5J,KAAK6J,OACP,MAAM7J,KAAK6J,QAQfrC,EAAYjB,OAAS,WACnB,IAAIb,EAIJ,MAAO,CACLqI,MAJU,IAAIvG,GAAY,SAAkB7N,GAC5C+L,EAAS/L,KAIT+L,OAAQA,IAIZ3M,EAAOD,QAAU0O,G,6BClCjBzO,EAAOD,QAAU,SAAgBkV,GAC/B,OAAO,SAAcC,GACnB,OAAOD,EAASlN,MAAM,KAAMmN,M,6BChBhClV,EAAOD,QAAU,SAAsBoV,GACrC,MAA2B,iBAAZA,IAAmD,IAAzBA,EAAQjM","file":"axios.min.js","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[\"axios\"] = factory();\n\telse\n\t\troot[\"axios\"] = factory();\n})(window, function() {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 10);\n","'use strict';\n\nvar bind = require('./helpers/bind');\n\n// utils is a library of generic helper functions non-specific to axios\n\nvar toString = Object.prototype.toString;\n\n/**\n * Determine if a value is an Array\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an Array, otherwise false\n */\nfunction isArray(val) {\n return toString.call(val) === '[object Array]';\n}\n\n/**\n * Determine if a value is undefined\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if the value is undefined, otherwise false\n */\nfunction isUndefined(val) {\n return typeof val === 'undefined';\n}\n\n/**\n * Determine if a value is a Buffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Buffer, otherwise false\n */\nfunction isBuffer(val) {\n return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor)\n && typeof val.constructor.isBuffer === 'function' && val.constructor.isBuffer(val);\n}\n\n/**\n * Determine if a value is an ArrayBuffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an ArrayBuffer, otherwise false\n */\nfunction isArrayBuffer(val) {\n return toString.call(val) === '[object ArrayBuffer]';\n}\n\n/**\n * Determine if a value is a FormData\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an FormData, otherwise false\n */\nfunction isFormData(val) {\n return (typeof FormData !== 'undefined') && (val instanceof FormData);\n}\n\n/**\n * Determine if a value is a view on an ArrayBuffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false\n */\nfunction isArrayBufferView(val) {\n var result;\n if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {\n result = ArrayBuffer.isView(val);\n } else {\n result = (val) && (val.buffer) && (val.buffer instanceof ArrayBuffer);\n }\n return result;\n}\n\n/**\n * Determine if a value is a String\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a String, otherwise false\n */\nfunction isString(val) {\n return typeof val === 'string';\n}\n\n/**\n * Determine if a value is a Number\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Number, otherwise false\n */\nfunction isNumber(val) {\n return typeof val === 'number';\n}\n\n/**\n * Determine if a value is an Object\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an Object, otherwise false\n */\nfunction isObject(val) {\n return val !== null && typeof val === 'object';\n}\n\n/**\n * Determine if a value is a plain Object\n *\n * @param {Object} val The value to test\n * @return {boolean} True if value is a plain Object, otherwise false\n */\nfunction isPlainObject(val) {\n if (toString.call(val) !== '[object Object]') {\n return false;\n }\n\n var prototype = Object.getPrototypeOf(val);\n return prototype === null || prototype === Object.prototype;\n}\n\n/**\n * Determine if a value is a Date\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Date, otherwise false\n */\nfunction isDate(val) {\n return toString.call(val) === '[object Date]';\n}\n\n/**\n * Determine if a value is a File\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a File, otherwise false\n */\nfunction isFile(val) {\n return toString.call(val) === '[object File]';\n}\n\n/**\n * Determine if a value is a Blob\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Blob, otherwise false\n */\nfunction isBlob(val) {\n return toString.call(val) === '[object Blob]';\n}\n\n/**\n * Determine if a value is a Function\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Function, otherwise false\n */\nfunction isFunction(val) {\n return toString.call(val) === '[object Function]';\n}\n\n/**\n * Determine if a value is a Stream\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Stream, otherwise false\n */\nfunction isStream(val) {\n return isObject(val) && isFunction(val.pipe);\n}\n\n/**\n * Determine if a value is a URLSearchParams object\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a URLSearchParams object, otherwise false\n */\nfunction isURLSearchParams(val) {\n return typeof URLSearchParams !== 'undefined' && val instanceof URLSearchParams;\n}\n\n/**\n * Trim excess whitespace off the beginning and end of a string\n *\n * @param {String} str The String to trim\n * @returns {String} The String freed of excess whitespace\n */\nfunction trim(str) {\n return str.trim ? str.trim() : str.replace(/^\\s+|\\s+$/g, '');\n}\n\n/**\n * Determine if we're running in a standard browser environment\n *\n * This allows axios to run in a web worker, and react-native.\n * Both environments support XMLHttpRequest, but not fully standard globals.\n *\n * web workers:\n * typeof window -> undefined\n * typeof document -> undefined\n *\n * react-native:\n * navigator.product -> 'ReactNative'\n * nativescript\n * navigator.product -> 'NativeScript' or 'NS'\n */\nfunction isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}\n\n/**\n * Iterate over an Array or an Object invoking a function for each item.\n *\n * If `obj` is an Array callback will be called passing\n * the value, index, and complete array for each item.\n *\n * If 'obj' is an Object callback will be called passing\n * the value, key, and complete object for each property.\n *\n * @param {Object|Array} obj The object to iterate\n * @param {Function} fn The callback to invoke for each item\n */\nfunction forEach(obj, fn) {\n // Don't bother if no value provided\n if (obj === null || typeof obj === 'undefined') {\n return;\n }\n\n // Force an array if not already something iterable\n if (typeof obj !== 'object') {\n /*eslint no-param-reassign:0*/\n obj = [obj];\n }\n\n if (isArray(obj)) {\n // Iterate over array values\n for (var i = 0, l = obj.length; i < l; i++) {\n fn.call(null, obj[i], i, obj);\n }\n } else {\n // Iterate over object keys\n for (var key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key)) {\n fn.call(null, obj[key], key, obj);\n }\n }\n }\n}\n\n/**\n * Accepts varargs expecting each argument to be an object, then\n * immutably merges the properties of each object and returns result.\n *\n * When multiple objects contain the same key the later object in\n * the arguments list will take precedence.\n *\n * Example:\n *\n * ```js\n * var result = merge({foo: 123}, {foo: 456});\n * console.log(result.foo); // outputs 456\n * ```\n *\n * @param {Object} obj1 Object to merge\n * @returns {Object} Result of all merge properties\n */\nfunction merge(/* obj1, obj2, obj3, ... */) {\n var result = {};\n function assignValue(val, key) {\n if (isPlainObject(result[key]) && isPlainObject(val)) {\n result[key] = merge(result[key], val);\n } else if (isPlainObject(val)) {\n result[key] = merge({}, val);\n } else if (isArray(val)) {\n result[key] = val.slice();\n } else {\n result[key] = val;\n }\n }\n\n for (var i = 0, l = arguments.length; i < l; i++) {\n forEach(arguments[i], assignValue);\n }\n return result;\n}\n\n/**\n * Extends object a by mutably adding to it the properties of object b.\n *\n * @param {Object} a The object to be extended\n * @param {Object} b The object to copy properties from\n * @param {Object} thisArg The object to bind function to\n * @return {Object} The resulting value of object a\n */\nfunction extend(a, b, thisArg) {\n forEach(b, function assignValue(val, key) {\n if (thisArg && typeof val === 'function') {\n a[key] = bind(val, thisArg);\n } else {\n a[key] = val;\n }\n });\n return a;\n}\n\n/**\n * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM)\n *\n * @param {string} content with BOM\n * @return {string} content value without BOM\n */\nfunction stripBOM(content) {\n if (content.charCodeAt(0) === 0xFEFF) {\n content = content.slice(1);\n }\n return content;\n}\n\nmodule.exports = {\n isArray: isArray,\n isArrayBuffer: isArrayBuffer,\n isBuffer: isBuffer,\n isFormData: isFormData,\n isArrayBufferView: isArrayBufferView,\n isString: isString,\n isNumber: isNumber,\n isObject: isObject,\n isPlainObject: isPlainObject,\n isUndefined: isUndefined,\n isDate: isDate,\n isFile: isFile,\n isBlob: isBlob,\n isFunction: isFunction,\n isStream: isStream,\n isURLSearchParams: isURLSearchParams,\n isStandardBrowserEnv: isStandardBrowserEnv,\n forEach: forEach,\n merge: merge,\n extend: extend,\n trim: trim,\n stripBOM: stripBOM\n};\n","'use strict';\n\nvar utils = require('./utils');\nvar normalizeHeaderName = require('./helpers/normalizeHeaderName');\nvar enhanceError = require('./core/enhanceError');\n\nvar DEFAULT_CONTENT_TYPE = {\n 'Content-Type': 'application/x-www-form-urlencoded'\n};\n\nfunction setContentTypeIfUnset(headers, value) {\n if (!utils.isUndefined(headers) && utils.isUndefined(headers['Content-Type'])) {\n headers['Content-Type'] = value;\n }\n}\n\nfunction getDefaultAdapter() {\n var adapter;\n if (typeof XMLHttpRequest !== 'undefined') {\n // For browsers use XHR adapter\n adapter = require('./adapters/xhr');\n } else if (typeof process !== 'undefined' && Object.prototype.toString.call(process) === '[object process]') {\n // For node use HTTP adapter\n adapter = require('./adapters/http');\n }\n return adapter;\n}\n\nfunction stringifySafely(rawValue, parser, encoder) {\n if (utils.isString(rawValue)) {\n try {\n (parser || JSON.parse)(rawValue);\n return utils.trim(rawValue);\n } catch (e) {\n if (e.name !== 'SyntaxError') {\n throw e;\n }\n }\n }\n\n return (encoder || JSON.stringify)(rawValue);\n}\n\nvar defaults = {\n\n transitional: {\n silentJSONParsing: true,\n forcedJSONParsing: true,\n clarifyTimeoutError: false\n },\n\n adapter: getDefaultAdapter(),\n\n transformRequest: [function transformRequest(data, headers) {\n normalizeHeaderName(headers, 'Accept');\n normalizeHeaderName(headers, 'Content-Type');\n\n if (utils.isFormData(data) ||\n utils.isArrayBuffer(data) ||\n utils.isBuffer(data) ||\n utils.isStream(data) ||\n utils.isFile(data) ||\n utils.isBlob(data)\n ) {\n return data;\n }\n if (utils.isArrayBufferView(data)) {\n return data.buffer;\n }\n if (utils.isURLSearchParams(data)) {\n setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8');\n return data.toString();\n }\n if (utils.isObject(data) || (headers && headers['Content-Type'] === 'application/json')) {\n setContentTypeIfUnset(headers, 'application/json');\n return stringifySafely(data);\n }\n return data;\n }],\n\n transformResponse: [function transformResponse(data) {\n var transitional = this.transitional;\n var silentJSONParsing = transitional && transitional.silentJSONParsing;\n var forcedJSONParsing = transitional && transitional.forcedJSONParsing;\n var strictJSONParsing = !silentJSONParsing && this.responseType === 'json';\n\n if (strictJSONParsing || (forcedJSONParsing && utils.isString(data) && data.length)) {\n try {\n return JSON.parse(data);\n } catch (e) {\n if (strictJSONParsing) {\n if (e.name === 'SyntaxError') {\n throw enhanceError(e, this, 'E_JSON_PARSE');\n }\n throw e;\n }\n }\n }\n\n return data;\n }],\n\n /**\n * A timeout in milliseconds to abort a request. If set to 0 (default) a\n * timeout is not created.\n */\n timeout: 0,\n\n xsrfCookieName: 'XSRF-TOKEN',\n xsrfHeaderName: 'X-XSRF-TOKEN',\n\n maxContentLength: -1,\n maxBodyLength: -1,\n\n validateStatus: function validateStatus(status) {\n return status >= 200 && status < 300;\n }\n};\n\ndefaults.headers = {\n common: {\n 'Accept': 'application/json, text/plain, */*'\n }\n};\n\nutils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) {\n defaults.headers[method] = {};\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE);\n});\n\nmodule.exports = defaults;\n","'use strict';\n\nmodule.exports = function bind(fn, thisArg) {\n return function wrap() {\n var args = new Array(arguments.length);\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i];\n }\n return fn.apply(thisArg, args);\n };\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\nfunction encode(val) {\n return encodeURIComponent(val).\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%20/g, '+').\n replace(/%5B/gi, '[').\n replace(/%5D/gi, ']');\n}\n\n/**\n * Build a URL by appending params to the end\n *\n * @param {string} url The base of the url (e.g., http://www.google.com)\n * @param {object} [params] The params to be appended\n * @returns {string} The formatted url\n */\nmodule.exports = function buildURL(url, params, paramsSerializer) {\n /*eslint no-param-reassign:0*/\n if (!params) {\n return url;\n }\n\n var serializedParams;\n if (paramsSerializer) {\n serializedParams = paramsSerializer(params);\n } else if (utils.isURLSearchParams(params)) {\n serializedParams = params.toString();\n } else {\n var parts = [];\n\n utils.forEach(params, function serialize(val, key) {\n if (val === null || typeof val === 'undefined') {\n return;\n }\n\n if (utils.isArray(val)) {\n key = key + '[]';\n } else {\n val = [val];\n }\n\n utils.forEach(val, function parseValue(v) {\n if (utils.isDate(v)) {\n v = v.toISOString();\n } else if (utils.isObject(v)) {\n v = JSON.stringify(v);\n }\n parts.push(encode(key) + '=' + encode(v));\n });\n });\n\n serializedParams = parts.join('&');\n }\n\n if (serializedParams) {\n var hashmarkIndex = url.indexOf('#');\n if (hashmarkIndex !== -1) {\n url = url.slice(0, hashmarkIndex);\n }\n\n url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;\n }\n\n return url;\n};\n","'use strict';\n\n/**\n * Update an Error with the specified config, error code, and response.\n *\n * @param {Error} error The error to update.\n * @param {Object} config The config.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n * @returns {Error} The error.\n */\nmodule.exports = function enhanceError(error, config, code, request, response) {\n error.config = config;\n if (code) {\n error.code = code;\n }\n\n error.request = request;\n error.response = response;\n error.isAxiosError = true;\n\n error.toJSON = function toJSON() {\n return {\n // Standard\n message: this.message,\n name: this.name,\n // Microsoft\n description: this.description,\n number: this.number,\n // Mozilla\n fileName: this.fileName,\n lineNumber: this.lineNumber,\n columnNumber: this.columnNumber,\n stack: this.stack,\n // Axios\n config: this.config,\n code: this.code\n };\n };\n return error;\n};\n","'use strict';\n\nvar utils = require('./../utils');\nvar settle = require('./../core/settle');\nvar cookies = require('./../helpers/cookies');\nvar buildURL = require('./../helpers/buildURL');\nvar buildFullPath = require('../core/buildFullPath');\nvar parseHeaders = require('./../helpers/parseHeaders');\nvar isURLSameOrigin = require('./../helpers/isURLSameOrigin');\nvar createError = require('../core/createError');\n\nmodule.exports = function xhrAdapter(config) {\n return new Promise(function dispatchXhrRequest(resolve, reject) {\n var requestData = config.data;\n var requestHeaders = config.headers;\n var responseType = config.responseType;\n\n if (utils.isFormData(requestData)) {\n delete requestHeaders['Content-Type']; // Let the browser set it\n }\n\n var request = new XMLHttpRequest();\n\n // HTTP basic authentication\n if (config.auth) {\n var username = config.auth.username || '';\n var password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : '';\n requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password);\n }\n\n var fullPath = buildFullPath(config.baseURL, config.url);\n request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true);\n\n // Set the request timeout in MS\n request.timeout = config.timeout;\n\n function onloadend() {\n if (!request) {\n return;\n }\n // Prepare the response\n var responseHeaders = 'getAllResponseHeaders' in request ? parseHeaders(request.getAllResponseHeaders()) : null;\n var responseData = !responseType || responseType === 'text' || responseType === 'json' ?\n request.responseText : request.response;\n var response = {\n data: responseData,\n status: request.status,\n statusText: request.statusText,\n headers: responseHeaders,\n config: config,\n request: request\n };\n\n settle(resolve, reject, response);\n\n // Clean up request\n request = null;\n }\n\n if ('onloadend' in request) {\n // Use onloadend if available\n request.onloadend = onloadend;\n } else {\n // Listen for ready state to emulate onloadend\n request.onreadystatechange = function handleLoad() {\n if (!request || request.readyState !== 4) {\n return;\n }\n\n // The request errored out and we didn't get a response, this will be\n // handled by onerror instead\n // With one exception: request that using file: protocol, most browsers\n // will return status as 0 even though it's a successful request\n if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {\n return;\n }\n // readystate handler is calling before onerror or ontimeout handlers,\n // so we should call onloadend on the next 'tick'\n setTimeout(onloadend);\n };\n }\n\n // Handle browser request cancellation (as opposed to a manual cancellation)\n request.onabort = function handleAbort() {\n if (!request) {\n return;\n }\n\n reject(createError('Request aborted', config, 'ECONNABORTED', request));\n\n // Clean up request\n request = null;\n };\n\n // Handle low level network errors\n request.onerror = function handleError() {\n // Real errors are hidden from us by the browser\n // onerror should only fire if it's a network error\n reject(createError('Network Error', config, null, request));\n\n // Clean up request\n request = null;\n };\n\n // Handle timeout\n request.ontimeout = function handleTimeout() {\n var timeoutErrorMessage = 'timeout of ' + config.timeout + 'ms exceeded';\n if (config.timeoutErrorMessage) {\n timeoutErrorMessage = config.timeoutErrorMessage;\n }\n reject(createError(\n timeoutErrorMessage,\n config,\n config.transitional && config.transitional.clarifyTimeoutError ? 'ETIMEDOUT' : 'ECONNABORTED',\n request));\n\n // Clean up request\n request = null;\n };\n\n // Add xsrf header\n // This is only done if running in a standard browser environment.\n // Specifically not if we're in a web worker, or react-native.\n if (utils.isStandardBrowserEnv()) {\n // Add xsrf header\n var xsrfValue = (config.withCredentials || isURLSameOrigin(fullPath)) && config.xsrfCookieName ?\n cookies.read(config.xsrfCookieName) :\n undefined;\n\n if (xsrfValue) {\n requestHeaders[config.xsrfHeaderName] = xsrfValue;\n }\n }\n\n // Add headers to the request\n if ('setRequestHeader' in request) {\n utils.forEach(requestHeaders, function setRequestHeader(val, key) {\n if (typeof requestData === 'undefined' && key.toLowerCase() === 'content-type') {\n // Remove Content-Type if data is undefined\n delete requestHeaders[key];\n } else {\n // Otherwise add header to the request\n request.setRequestHeader(key, val);\n }\n });\n }\n\n // Add withCredentials to request if needed\n if (!utils.isUndefined(config.withCredentials)) {\n request.withCredentials = !!config.withCredentials;\n }\n\n // Add responseType to request if needed\n if (responseType && responseType !== 'json') {\n request.responseType = config.responseType;\n }\n\n // Handle progress if needed\n if (typeof config.onDownloadProgress === 'function') {\n request.addEventListener('progress', config.onDownloadProgress);\n }\n\n // Not all browsers support upload events\n if (typeof config.onUploadProgress === 'function' && request.upload) {\n request.upload.addEventListener('progress', config.onUploadProgress);\n }\n\n if (config.cancelToken) {\n // Handle cancellation\n config.cancelToken.promise.then(function onCanceled(cancel) {\n if (!request) {\n return;\n }\n\n request.abort();\n reject(cancel);\n // Clean up request\n request = null;\n });\n }\n\n if (!requestData) {\n requestData = null;\n }\n\n // Send the request\n request.send(requestData);\n });\n};\n","'use strict';\n\nvar enhanceError = require('./enhanceError');\n\n/**\n * Create an Error with the specified message, config, error code, request and response.\n *\n * @param {string} message The error message.\n * @param {Object} config The config.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n * @returns {Error} The created error.\n */\nmodule.exports = function createError(message, config, code, request, response) {\n var error = new Error(message);\n return enhanceError(error, config, code, request, response);\n};\n","'use strict';\n\nmodule.exports = function isCancel(value) {\n return !!(value && value.__CANCEL__);\n};\n","'use strict';\n\nvar utils = require('../utils');\n\n/**\n * Config-specific merge-function which creates a new config-object\n * by merging two configuration objects together.\n *\n * @param {Object} config1\n * @param {Object} config2\n * @returns {Object} New object resulting from merging config2 to config1\n */\nmodule.exports = function mergeConfig(config1, config2) {\n // eslint-disable-next-line no-param-reassign\n config2 = config2 || {};\n var config = {};\n\n var valueFromConfig2Keys = ['url', 'method', 'data'];\n var mergeDeepPropertiesKeys = ['headers', 'auth', 'proxy', 'params'];\n var defaultToConfig2Keys = [\n 'baseURL', 'transformRequest', 'transformResponse', 'paramsSerializer',\n 'timeout', 'timeoutMessage', 'withCredentials', 'adapter', 'responseType', 'xsrfCookieName',\n 'xsrfHeaderName', 'onUploadProgress', 'onDownloadProgress', 'decompress',\n 'maxContentLength', 'maxBodyLength', 'maxRedirects', 'transport', 'httpAgent',\n 'httpsAgent', 'cancelToken', 'socketPath', 'responseEncoding'\n ];\n var directMergeKeys = ['validateStatus'];\n\n function getMergedValue(target, source) {\n if (utils.isPlainObject(target) && utils.isPlainObject(source)) {\n return utils.merge(target, source);\n } else if (utils.isPlainObject(source)) {\n return utils.merge({}, source);\n } else if (utils.isArray(source)) {\n return source.slice();\n }\n return source;\n }\n\n function mergeDeepProperties(prop) {\n if (!utils.isUndefined(config2[prop])) {\n config[prop] = getMergedValue(config1[prop], config2[prop]);\n } else if (!utils.isUndefined(config1[prop])) {\n config[prop] = getMergedValue(undefined, config1[prop]);\n }\n }\n\n utils.forEach(valueFromConfig2Keys, function valueFromConfig2(prop) {\n if (!utils.isUndefined(config2[prop])) {\n config[prop] = getMergedValue(undefined, config2[prop]);\n }\n });\n\n utils.forEach(mergeDeepPropertiesKeys, mergeDeepProperties);\n\n utils.forEach(defaultToConfig2Keys, function defaultToConfig2(prop) {\n if (!utils.isUndefined(config2[prop])) {\n config[prop] = getMergedValue(undefined, config2[prop]);\n } else if (!utils.isUndefined(config1[prop])) {\n config[prop] = getMergedValue(undefined, config1[prop]);\n }\n });\n\n utils.forEach(directMergeKeys, function merge(prop) {\n if (prop in config2) {\n config[prop] = getMergedValue(config1[prop], config2[prop]);\n } else if (prop in config1) {\n config[prop] = getMergedValue(undefined, config1[prop]);\n }\n });\n\n var axiosKeys = valueFromConfig2Keys\n .concat(mergeDeepPropertiesKeys)\n .concat(defaultToConfig2Keys)\n .concat(directMergeKeys);\n\n var otherKeys = Object\n .keys(config1)\n .concat(Object.keys(config2))\n .filter(function filterAxiosKeys(key) {\n return axiosKeys.indexOf(key) === -1;\n });\n\n utils.forEach(otherKeys, mergeDeepProperties);\n\n return config;\n};\n","'use strict';\n\n/**\n * A `Cancel` is an object that is thrown when an operation is canceled.\n *\n * @class\n * @param {string=} message The message.\n */\nfunction Cancel(message) {\n this.message = message;\n}\n\nCancel.prototype.toString = function toString() {\n return 'Cancel' + (this.message ? ': ' + this.message : '');\n};\n\nCancel.prototype.__CANCEL__ = true;\n\nmodule.exports = Cancel;\n","module.exports = require('./lib/axios');","'use strict';\n\nvar utils = require('./utils');\nvar bind = require('./helpers/bind');\nvar Axios = require('./core/Axios');\nvar mergeConfig = require('./core/mergeConfig');\nvar defaults = require('./defaults');\n\n/**\n * Create an instance of Axios\n *\n * @param {Object} defaultConfig The default config for the instance\n * @return {Axios} A new instance of Axios\n */\nfunction createInstance(defaultConfig) {\n var context = new Axios(defaultConfig);\n var instance = bind(Axios.prototype.request, context);\n\n // Copy axios.prototype to instance\n utils.extend(instance, Axios.prototype, context);\n\n // Copy context to instance\n utils.extend(instance, context);\n\n return instance;\n}\n\n// Create the default instance to be exported\nvar axios = createInstance(defaults);\n\n// Expose Axios class to allow class inheritance\naxios.Axios = Axios;\n\n// Factory for creating new instances\naxios.create = function create(instanceConfig) {\n return createInstance(mergeConfig(axios.defaults, instanceConfig));\n};\n\n// Expose Cancel & CancelToken\naxios.Cancel = require('./cancel/Cancel');\naxios.CancelToken = require('./cancel/CancelToken');\naxios.isCancel = require('./cancel/isCancel');\n\n// Expose all/spread\naxios.all = function all(promises) {\n return Promise.all(promises);\n};\naxios.spread = require('./helpers/spread');\n\n// Expose isAxiosError\naxios.isAxiosError = require('./helpers/isAxiosError');\n\nmodule.exports = axios;\n\n// Allow use of default import syntax in TypeScript\nmodule.exports.default = axios;\n","'use strict';\n\nvar utils = require('./../utils');\nvar buildURL = require('../helpers/buildURL');\nvar InterceptorManager = require('./InterceptorManager');\nvar dispatchRequest = require('./dispatchRequest');\nvar mergeConfig = require('./mergeConfig');\nvar validator = require('../helpers/validator');\n\nvar validators = validator.validators;\n/**\n * Create a new instance of Axios\n *\n * @param {Object} instanceConfig The default config for the instance\n */\nfunction Axios(instanceConfig) {\n this.defaults = instanceConfig;\n this.interceptors = {\n request: new InterceptorManager(),\n response: new InterceptorManager()\n };\n}\n\n/**\n * Dispatch a request\n *\n * @param {Object} config The config specific for this request (merged with this.defaults)\n */\nAxios.prototype.request = function request(config) {\n /*eslint no-param-reassign:0*/\n // Allow for axios('example/url'[, config]) a la fetch API\n if (typeof config === 'string') {\n config = arguments[1] || {};\n config.url = arguments[0];\n } else {\n config = config || {};\n }\n\n config = mergeConfig(this.defaults, config);\n\n // Set config.method\n if (config.method) {\n config.method = config.method.toLowerCase();\n } else if (this.defaults.method) {\n config.method = this.defaults.method.toLowerCase();\n } else {\n config.method = 'get';\n }\n\n var transitional = config.transitional;\n\n if (transitional !== undefined) {\n validator.assertOptions(transitional, {\n silentJSONParsing: validators.transitional(validators.boolean, '1.0.0'),\n forcedJSONParsing: validators.transitional(validators.boolean, '1.0.0'),\n clarifyTimeoutError: validators.transitional(validators.boolean, '1.0.0')\n }, false);\n }\n\n // filter out skipped interceptors\n var requestInterceptorChain = [];\n var synchronousRequestInterceptors = true;\n this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {\n if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) {\n return;\n }\n\n synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;\n\n requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);\n });\n\n var responseInterceptorChain = [];\n this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {\n responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);\n });\n\n var promise;\n\n if (!synchronousRequestInterceptors) {\n var chain = [dispatchRequest, undefined];\n\n Array.prototype.unshift.apply(chain, requestInterceptorChain);\n chain = chain.concat(responseInterceptorChain);\n\n promise = Promise.resolve(config);\n while (chain.length) {\n promise = promise.then(chain.shift(), chain.shift());\n }\n\n return promise;\n }\n\n\n var newConfig = config;\n while (requestInterceptorChain.length) {\n var onFulfilled = requestInterceptorChain.shift();\n var onRejected = requestInterceptorChain.shift();\n try {\n newConfig = onFulfilled(newConfig);\n } catch (error) {\n onRejected(error);\n break;\n }\n }\n\n try {\n promise = dispatchRequest(newConfig);\n } catch (error) {\n return Promise.reject(error);\n }\n\n while (responseInterceptorChain.length) {\n promise = promise.then(responseInterceptorChain.shift(), responseInterceptorChain.shift());\n }\n\n return promise;\n};\n\nAxios.prototype.getUri = function getUri(config) {\n config = mergeConfig(this.defaults, config);\n return buildURL(config.url, config.params, config.paramsSerializer).replace(/^\\?/, '');\n};\n\n// Provide aliases for supported request methods\nutils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, config) {\n return this.request(mergeConfig(config || {}, {\n method: method,\n url: url,\n data: (config || {}).data\n }));\n };\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, data, config) {\n return this.request(mergeConfig(config || {}, {\n method: method,\n url: url,\n data: data\n }));\n };\n});\n\nmodule.exports = Axios;\n","'use strict';\n\nvar utils = require('./../utils');\n\nfunction InterceptorManager() {\n this.handlers = [];\n}\n\n/**\n * Add a new interceptor to the stack\n *\n * @param {Function} fulfilled The function to handle `then` for a `Promise`\n * @param {Function} rejected The function to handle `reject` for a `Promise`\n *\n * @return {Number} An ID used to remove interceptor later\n */\nInterceptorManager.prototype.use = function use(fulfilled, rejected, options) {\n this.handlers.push({\n fulfilled: fulfilled,\n rejected: rejected,\n synchronous: options ? options.synchronous : false,\n runWhen: options ? options.runWhen : null\n });\n return this.handlers.length - 1;\n};\n\n/**\n * Remove an interceptor from the stack\n *\n * @param {Number} id The ID that was returned by `use`\n */\nInterceptorManager.prototype.eject = function eject(id) {\n if (this.handlers[id]) {\n this.handlers[id] = null;\n }\n};\n\n/**\n * Iterate over all the registered interceptors\n *\n * This method is particularly useful for skipping over any\n * interceptors that may have become `null` calling `eject`.\n *\n * @param {Function} fn The function to call for each interceptor\n */\nInterceptorManager.prototype.forEach = function forEach(fn) {\n utils.forEach(this.handlers, function forEachHandler(h) {\n if (h !== null) {\n fn(h);\n }\n });\n};\n\nmodule.exports = InterceptorManager;\n","'use strict';\n\nvar utils = require('./../utils');\nvar transformData = require('./transformData');\nvar isCancel = require('../cancel/isCancel');\nvar defaults = require('../defaults');\n\n/**\n * Throws a `Cancel` if cancellation has been requested.\n */\nfunction throwIfCancellationRequested(config) {\n if (config.cancelToken) {\n config.cancelToken.throwIfRequested();\n }\n}\n\n/**\n * Dispatch a request to the server using the configured adapter.\n *\n * @param {object} config The config that is to be used for the request\n * @returns {Promise} The Promise to be fulfilled\n */\nmodule.exports = function dispatchRequest(config) {\n throwIfCancellationRequested(config);\n\n // Ensure headers exist\n config.headers = config.headers || {};\n\n // Transform request data\n config.data = transformData.call(\n config,\n config.data,\n config.headers,\n config.transformRequest\n );\n\n // Flatten headers\n config.headers = utils.merge(\n config.headers.common || {},\n config.headers[config.method] || {},\n config.headers\n );\n\n utils.forEach(\n ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],\n function cleanHeaderConfig(method) {\n delete config.headers[method];\n }\n );\n\n var adapter = config.adapter || defaults.adapter;\n\n return adapter(config).then(function onAdapterResolution(response) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n response.data = transformData.call(\n config,\n response.data,\n response.headers,\n config.transformResponse\n );\n\n return response;\n }, function onAdapterRejection(reason) {\n if (!isCancel(reason)) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n if (reason && reason.response) {\n reason.response.data = transformData.call(\n config,\n reason.response.data,\n reason.response.headers,\n config.transformResponse\n );\n }\n }\n\n return Promise.reject(reason);\n });\n};\n","'use strict';\n\nvar utils = require('./../utils');\nvar defaults = require('./../defaults');\n\n/**\n * Transform the data for a request or a response\n *\n * @param {Object|String} data The data to be transformed\n * @param {Array} headers The headers for the request or response\n * @param {Array|Function} fns A single function or Array of functions\n * @returns {*} The resulting transformed data\n */\nmodule.exports = function transformData(data, headers, fns) {\n var context = this || defaults;\n /*eslint no-param-reassign:0*/\n utils.forEach(fns, function transform(fn) {\n data = fn.call(context, data, headers);\n });\n\n return data;\n};\n","'use strict';\n\nvar utils = require('../utils');\n\nmodule.exports = function normalizeHeaderName(headers, normalizedName) {\n utils.forEach(headers, function processHeader(value, name) {\n if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) {\n headers[normalizedName] = value;\n delete headers[name];\n }\n });\n};\n","'use strict';\n\nvar createError = require('./createError');\n\n/**\n * Resolve or reject a Promise based on response status.\n *\n * @param {Function} resolve A function that resolves the promise.\n * @param {Function} reject A function that rejects the promise.\n * @param {object} response The response.\n */\nmodule.exports = function settle(resolve, reject, response) {\n var validateStatus = response.config.validateStatus;\n if (!response.status || !validateStatus || validateStatus(response.status)) {\n resolve(response);\n } else {\n reject(createError(\n 'Request failed with status code ' + response.status,\n response.config,\n null,\n response.request,\n response\n ));\n }\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\nmodule.exports = (\n utils.isStandardBrowserEnv() ?\n\n // Standard browser envs support document.cookie\n (function standardBrowserEnv() {\n return {\n write: function write(name, value, expires, path, domain, secure) {\n var cookie = [];\n cookie.push(name + '=' + encodeURIComponent(value));\n\n if (utils.isNumber(expires)) {\n cookie.push('expires=' + new Date(expires).toGMTString());\n }\n\n if (utils.isString(path)) {\n cookie.push('path=' + path);\n }\n\n if (utils.isString(domain)) {\n cookie.push('domain=' + domain);\n }\n\n if (secure === true) {\n cookie.push('secure');\n }\n\n document.cookie = cookie.join('; ');\n },\n\n read: function read(name) {\n var match = document.cookie.match(new RegExp('(^|;\\\\s*)(' + name + ')=([^;]*)'));\n return (match ? decodeURIComponent(match[3]) : null);\n },\n\n remove: function remove(name) {\n this.write(name, '', Date.now() - 86400000);\n }\n };\n })() :\n\n // Non standard browser env (web workers, react-native) lack needed support.\n (function nonStandardBrowserEnv() {\n return {\n write: function write() {},\n read: function read() { return null; },\n remove: function remove() {}\n };\n })()\n);\n","'use strict';\n\nvar isAbsoluteURL = require('../helpers/isAbsoluteURL');\nvar combineURLs = require('../helpers/combineURLs');\n\n/**\n * Creates a new URL by combining the baseURL with the requestedURL,\n * only when the requestedURL is not already an absolute URL.\n * If the requestURL is absolute, this function returns the requestedURL untouched.\n *\n * @param {string} baseURL The base URL\n * @param {string} requestedURL Absolute or relative URL to combine\n * @returns {string} The combined full path\n */\nmodule.exports = function buildFullPath(baseURL, requestedURL) {\n if (baseURL && !isAbsoluteURL(requestedURL)) {\n return combineURLs(baseURL, requestedURL);\n }\n return requestedURL;\n};\n","'use strict';\n\n/**\n * Determines whether the specified URL is absolute\n *\n * @param {string} url The URL to test\n * @returns {boolean} True if the specified URL is absolute, otherwise false\n */\nmodule.exports = function isAbsoluteURL(url) {\n // A URL is considered absolute if it begins with \"://\" or \"//\" (protocol-relative URL).\n // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed\n // by any combination of letters, digits, plus, period, or hyphen.\n return /^([a-z][a-z\\d\\+\\-\\.]*:)?\\/\\//i.test(url);\n};\n","'use strict';\n\n/**\n * Creates a new URL by combining the specified URLs\n *\n * @param {string} baseURL The base URL\n * @param {string} relativeURL The relative URL\n * @returns {string} The combined URL\n */\nmodule.exports = function combineURLs(baseURL, relativeURL) {\n return relativeURL\n ? baseURL.replace(/\\/+$/, '') + '/' + relativeURL.replace(/^\\/+/, '')\n : baseURL;\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\n// Headers whose duplicates are ignored by node\n// c.f. https://nodejs.org/api/http.html#http_message_headers\nvar ignoreDuplicateOf = [\n 'age', 'authorization', 'content-length', 'content-type', 'etag',\n 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',\n 'last-modified', 'location', 'max-forwards', 'proxy-authorization',\n 'referer', 'retry-after', 'user-agent'\n];\n\n/**\n * Parse headers into an object\n *\n * ```\n * Date: Wed, 27 Aug 2014 08:58:49 GMT\n * Content-Type: application/json\n * Connection: keep-alive\n * Transfer-Encoding: chunked\n * ```\n *\n * @param {String} headers Headers needing to be parsed\n * @returns {Object} Headers parsed into an object\n */\nmodule.exports = function parseHeaders(headers) {\n var parsed = {};\n var key;\n var val;\n var i;\n\n if (!headers) { return parsed; }\n\n utils.forEach(headers.split('\\n'), function parser(line) {\n i = line.indexOf(':');\n key = utils.trim(line.substr(0, i)).toLowerCase();\n val = utils.trim(line.substr(i + 1));\n\n if (key) {\n if (parsed[key] && ignoreDuplicateOf.indexOf(key) >= 0) {\n return;\n }\n if (key === 'set-cookie') {\n parsed[key] = (parsed[key] ? parsed[key] : []).concat([val]);\n } else {\n parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;\n }\n }\n });\n\n return parsed;\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\nmodule.exports = (\n utils.isStandardBrowserEnv() ?\n\n // Standard browser envs have full support of the APIs needed to test\n // whether the request URL is of the same origin as current location.\n (function standardBrowserEnv() {\n var msie = /(msie|trident)/i.test(navigator.userAgent);\n var urlParsingNode = document.createElement('a');\n var originURL;\n\n /**\n * Parse a URL to discover it's components\n *\n * @param {String} url The URL to be parsed\n * @returns {Object}\n */\n function resolveURL(url) {\n var href = url;\n\n if (msie) {\n // IE needs attribute set twice to normalize properties\n urlParsingNode.setAttribute('href', href);\n href = urlParsingNode.href;\n }\n\n urlParsingNode.setAttribute('href', href);\n\n // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils\n return {\n href: urlParsingNode.href,\n protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',\n host: urlParsingNode.host,\n search: urlParsingNode.search ? urlParsingNode.search.replace(/^\\?/, '') : '',\n hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',\n hostname: urlParsingNode.hostname,\n port: urlParsingNode.port,\n pathname: (urlParsingNode.pathname.charAt(0) === '/') ?\n urlParsingNode.pathname :\n '/' + urlParsingNode.pathname\n };\n }\n\n originURL = resolveURL(window.location.href);\n\n /**\n * Determine if a URL shares the same origin as the current location\n *\n * @param {String} requestURL The URL to test\n * @returns {boolean} True if URL shares the same origin, otherwise false\n */\n return function isURLSameOrigin(requestURL) {\n var parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL;\n return (parsed.protocol === originURL.protocol &&\n parsed.host === originURL.host);\n };\n })() :\n\n // Non standard browser envs (web workers, react-native) lack needed support.\n (function nonStandardBrowserEnv() {\n return function isURLSameOrigin() {\n return true;\n };\n })()\n);\n","'use strict';\n\nvar pkg = require('./../../package.json');\n\nvar validators = {};\n\n// eslint-disable-next-line func-names\n['object', 'boolean', 'number', 'function', 'string', 'symbol'].forEach(function(type, i) {\n validators[type] = function validator(thing) {\n return typeof thing === type || 'a' + (i < 1 ? 'n ' : ' ') + type;\n };\n});\n\nvar deprecatedWarnings = {};\nvar currentVerArr = pkg.version.split('.');\n\n/**\n * Compare package versions\n * @param {string} version\n * @param {string?} thanVersion\n * @returns {boolean}\n */\nfunction isOlderVersion(version, thanVersion) {\n var pkgVersionArr = thanVersion ? thanVersion.split('.') : currentVerArr;\n var destVer = version.split('.');\n for (var i = 0; i < 3; i++) {\n if (pkgVersionArr[i] > destVer[i]) {\n return true;\n } else if (pkgVersionArr[i] < destVer[i]) {\n return false;\n }\n }\n return false;\n}\n\n/**\n * Transitional option validator\n * @param {function|boolean?} validator\n * @param {string?} version\n * @param {string} message\n * @returns {function}\n */\nvalidators.transitional = function transitional(validator, version, message) {\n var isDeprecated = version && isOlderVersion(version);\n\n function formatMessage(opt, desc) {\n return '[Axios v' + pkg.version + '] Transitional option \\'' + opt + '\\'' + desc + (message ? '. ' + message : '');\n }\n\n // eslint-disable-next-line func-names\n return function(value, opt, opts) {\n if (validator === false) {\n throw new Error(formatMessage(opt, ' has been removed in ' + version));\n }\n\n if (isDeprecated && !deprecatedWarnings[opt]) {\n deprecatedWarnings[opt] = true;\n // eslint-disable-next-line no-console\n console.warn(\n formatMessage(\n opt,\n ' has been deprecated since v' + version + ' and will be removed in the near future'\n )\n );\n }\n\n return validator ? validator(value, opt, opts) : true;\n };\n};\n\n/**\n * Assert object's properties type\n * @param {object} options\n * @param {object} schema\n * @param {boolean?} allowUnknown\n */\n\nfunction assertOptions(options, schema, allowUnknown) {\n if (typeof options !== 'object') {\n throw new TypeError('options must be an object');\n }\n var keys = Object.keys(options);\n var i = keys.length;\n while (i-- > 0) {\n var opt = keys[i];\n var validator = schema[opt];\n if (validator) {\n var value = options[opt];\n var result = value === undefined || validator(value, opt, options);\n if (result !== true) {\n throw new TypeError('option ' + opt + ' must be ' + result);\n }\n continue;\n }\n if (allowUnknown !== true) {\n throw Error('Unknown option ' + opt);\n }\n }\n}\n\nmodule.exports = {\n isOlderVersion: isOlderVersion,\n assertOptions: assertOptions,\n validators: validators\n};\n","'use strict';\n\nvar Cancel = require('./Cancel');\n\n/**\n * A `CancelToken` is an object that can be used to request cancellation of an operation.\n *\n * @class\n * @param {Function} executor The executor function.\n */\nfunction CancelToken(executor) {\n if (typeof executor !== 'function') {\n throw new TypeError('executor must be a function.');\n }\n\n var resolvePromise;\n this.promise = new Promise(function promiseExecutor(resolve) {\n resolvePromise = resolve;\n });\n\n var token = this;\n executor(function cancel(message) {\n if (token.reason) {\n // Cancellation has already been requested\n return;\n }\n\n token.reason = new Cancel(message);\n resolvePromise(token.reason);\n });\n}\n\n/**\n * Throws a `Cancel` if cancellation has been requested.\n */\nCancelToken.prototype.throwIfRequested = function throwIfRequested() {\n if (this.reason) {\n throw this.reason;\n }\n};\n\n/**\n * Returns an object that contains a new `CancelToken` and a function that, when called,\n * cancels the `CancelToken`.\n */\nCancelToken.source = function source() {\n var cancel;\n var token = new CancelToken(function executor(c) {\n cancel = c;\n });\n return {\n token: token,\n cancel: cancel\n };\n};\n\nmodule.exports = CancelToken;\n","'use strict';\n\n/**\n * Syntactic sugar for invoking a function and expanding an array for arguments.\n *\n * Common use case would be to use `Function.prototype.apply`.\n *\n * ```js\n * function f(x, y, z) {}\n * var args = [1, 2, 3];\n * f.apply(null, args);\n * ```\n *\n * With `spread` this example can be re-written.\n *\n * ```js\n * spread(function(x, y, z) {})([1, 2, 3]);\n * ```\n *\n * @param {Function} callback\n * @returns {Function}\n */\nmodule.exports = function spread(callback) {\n return function wrap(arr) {\n return callback.apply(null, arr);\n };\n};\n","'use strict';\n\n/**\n * Determines whether the payload is an error thrown by Axios\n *\n * @param {*} payload The value to test\n * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false\n */\nmodule.exports = function isAxiosError(payload) {\n return (typeof payload === 'object') && (payload.isAxiosError === true);\n};\n"],"sourceRoot":""} \ No newline at end of file diff --git a/node_modules/textmaker-thiccy/node_modules/axios/index.d.ts b/node_modules/textmaker-thiccy/node_modules/axios/index.d.ts new file mode 100644 index 000000000..78f733f89 --- /dev/null +++ b/node_modules/textmaker-thiccy/node_modules/axios/index.d.ts @@ -0,0 +1,168 @@ +export interface AxiosTransformer { + (data: any, headers?: any): any; +} + +export interface AxiosAdapter { + (config: AxiosRequestConfig): AxiosPromise; +} + +export interface AxiosBasicCredentials { + username: string; + password: string; +} + +export interface AxiosProxyConfig { + host: string; + port: number; + auth?: { + username: string; + password:string; + }; + protocol?: string; +} + +export type Method = + | 'get' | 'GET' + | 'delete' | 'DELETE' + | 'head' | 'HEAD' + | 'options' | 'OPTIONS' + | 'post' | 'POST' + | 'put' | 'PUT' + | 'patch' | 'PATCH' + | 'purge' | 'PURGE' + | 'link' | 'LINK' + | 'unlink' | 'UNLINK' + +export type ResponseType = + | 'arraybuffer' + | 'blob' + | 'document' + | 'json' + | 'text' + | 'stream' + +export interface TransitionalOptions{ + silentJSONParsing: boolean; + forcedJSONParsing: boolean; + clarifyTimeoutError: boolean; +} + +export interface AxiosRequestConfig { + url?: string; + method?: Method; + baseURL?: string; + transformRequest?: AxiosTransformer | AxiosTransformer[]; + transformResponse?: AxiosTransformer | AxiosTransformer[]; + headers?: any; + params?: any; + paramsSerializer?: (params: any) => string; + data?: any; + timeout?: number; + timeoutErrorMessage?: string; + withCredentials?: boolean; + adapter?: AxiosAdapter; + auth?: AxiosBasicCredentials; + responseType?: ResponseType; + xsrfCookieName?: string; + xsrfHeaderName?: string; + onUploadProgress?: (progressEvent: any) => void; + onDownloadProgress?: (progressEvent: any) => void; + maxContentLength?: number; + validateStatus?: ((status: number) => boolean) | null; + maxBodyLength?: number; + maxRedirects?: number; + socketPath?: string | null; + httpAgent?: any; + httpsAgent?: any; + proxy?: AxiosProxyConfig | false; + cancelToken?: CancelToken; + decompress?: boolean; + transitional?: TransitionalOptions +} + +export interface AxiosResponse { + data: T; + status: number; + statusText: string; + headers: any; + config: AxiosRequestConfig; + request?: any; +} + +export interface AxiosError extends Error { + config: AxiosRequestConfig; + code?: string; + request?: any; + response?: AxiosResponse; + isAxiosError: boolean; + toJSON: () => object; +} + +export interface AxiosPromise extends Promise> { +} + +export interface CancelStatic { + new (message?: string): Cancel; +} + +export interface Cancel { + message: string; +} + +export interface Canceler { + (message?: string): void; +} + +export interface CancelTokenStatic { + new (executor: (cancel: Canceler) => void): CancelToken; + source(): CancelTokenSource; +} + +export interface CancelToken { + promise: Promise; + reason?: Cancel; + throwIfRequested(): void; +} + +export interface CancelTokenSource { + token: CancelToken; + cancel: Canceler; +} + +export interface AxiosInterceptorManager { + use(onFulfilled?: (value: V) => T | Promise, onRejected?: (error: any) => any): number; + eject(id: number): void; +} + +export interface AxiosInstance { + (config: AxiosRequestConfig): AxiosPromise; + (url: string, config?: AxiosRequestConfig): AxiosPromise; + defaults: AxiosRequestConfig; + interceptors: { + request: AxiosInterceptorManager; + response: AxiosInterceptorManager; + }; + getUri(config?: AxiosRequestConfig): string; + request> (config: AxiosRequestConfig): Promise; + get>(url: string, config?: AxiosRequestConfig): Promise; + delete>(url: string, config?: AxiosRequestConfig): Promise; + head>(url: string, config?: AxiosRequestConfig): Promise; + options>(url: string, config?: AxiosRequestConfig): Promise; + post>(url: string, data?: any, config?: AxiosRequestConfig): Promise; + put>(url: string, data?: any, config?: AxiosRequestConfig): Promise; + patch>(url: string, data?: any, config?: AxiosRequestConfig): Promise; +} + +export interface AxiosStatic extends AxiosInstance { + create(config?: AxiosRequestConfig): AxiosInstance; + Cancel: CancelStatic; + CancelToken: CancelTokenStatic; + isCancel(value: any): boolean; + all(values: (T | Promise)[]): Promise; + spread(callback: (...args: T[]) => R): (array: T[]) => R; + isAxiosError(payload: any): payload is AxiosError; +} + +declare const axios: AxiosStatic; + +export default axios; diff --git a/node_modules/textmaker-thiccy/node_modules/axios/index.js b/node_modules/textmaker-thiccy/node_modules/axios/index.js new file mode 100644 index 000000000..79dfd09dd --- /dev/null +++ b/node_modules/textmaker-thiccy/node_modules/axios/index.js @@ -0,0 +1 @@ +module.exports = require('./lib/axios'); \ No newline at end of file diff --git a/node_modules/textmaker-thiccy/node_modules/axios/lib/adapters/README.md b/node_modules/textmaker-thiccy/node_modules/axios/lib/adapters/README.md new file mode 100644 index 000000000..68f111895 --- /dev/null +++ b/node_modules/textmaker-thiccy/node_modules/axios/lib/adapters/README.md @@ -0,0 +1,37 @@ +# axios // adapters + +The modules under `adapters/` are modules that handle dispatching a request and settling a returned `Promise` once a response is received. + +## Example + +```js +var settle = require('./../core/settle'); + +module.exports = function myAdapter(config) { + // At this point: + // - config has been merged with defaults + // - request transformers have already run + // - request interceptors have already run + + // Make the request using config provided + // Upon response settle the Promise + + return new Promise(function(resolve, reject) { + + var response = { + data: responseData, + status: request.status, + statusText: request.statusText, + headers: responseHeaders, + config: config, + request: request + }; + + settle(resolve, reject, response); + + // From here: + // - response transformers will run + // - response interceptors will run + }); +} +``` diff --git a/node_modules/textmaker-thiccy/node_modules/axios/lib/adapters/http.js b/node_modules/textmaker-thiccy/node_modules/axios/lib/adapters/http.js new file mode 100644 index 000000000..0cca3bdfb --- /dev/null +++ b/node_modules/textmaker-thiccy/node_modules/axios/lib/adapters/http.js @@ -0,0 +1,331 @@ +'use strict'; + +var utils = require('./../utils'); +var settle = require('./../core/settle'); +var buildFullPath = require('../core/buildFullPath'); +var buildURL = require('./../helpers/buildURL'); +var http = require('http'); +var https = require('https'); +var httpFollow = require('follow-redirects').http; +var httpsFollow = require('follow-redirects').https; +var url = require('url'); +var zlib = require('zlib'); +var pkg = require('./../../package.json'); +var createError = require('../core/createError'); +var enhanceError = require('../core/enhanceError'); + +var isHttps = /https:?/; + +/** + * + * @param {http.ClientRequestArgs} options + * @param {AxiosProxyConfig} proxy + * @param {string} location + */ +function setProxy(options, proxy, location) { + options.hostname = proxy.host; + options.host = proxy.host; + options.port = proxy.port; + options.path = location; + + // Basic proxy authorization + if (proxy.auth) { + var base64 = Buffer.from(proxy.auth.username + ':' + proxy.auth.password, 'utf8').toString('base64'); + options.headers['Proxy-Authorization'] = 'Basic ' + base64; + } + + // If a proxy is used, any redirects must also pass through the proxy + options.beforeRedirect = function beforeRedirect(redirection) { + redirection.headers.host = redirection.host; + setProxy(redirection, proxy, redirection.href); + }; +} + +/*eslint consistent-return:0*/ +module.exports = function httpAdapter(config) { + return new Promise(function dispatchHttpRequest(resolvePromise, rejectPromise) { + var resolve = function resolve(value) { + resolvePromise(value); + }; + var reject = function reject(value) { + rejectPromise(value); + }; + var data = config.data; + var headers = config.headers; + + // Set User-Agent (required by some servers) + // See https://github.com/axios/axios/issues/69 + if ('User-Agent' in headers || 'user-agent' in headers) { + // User-Agent is specified; handle case where no UA header is desired + if (!headers['User-Agent'] && !headers['user-agent']) { + delete headers['User-Agent']; + delete headers['user-agent']; + } + // Otherwise, use specified value + } else { + // Only set header if it hasn't been set in config + headers['User-Agent'] = 'axios/' + pkg.version; + } + + if (data && !utils.isStream(data)) { + if (Buffer.isBuffer(data)) { + // Nothing to do... + } else if (utils.isArrayBuffer(data)) { + data = Buffer.from(new Uint8Array(data)); + } else if (utils.isString(data)) { + data = Buffer.from(data, 'utf-8'); + } else { + return reject(createError( + 'Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream', + config + )); + } + + // Add Content-Length header if data exists + headers['Content-Length'] = data.length; + } + + // HTTP basic authentication + var auth = undefined; + if (config.auth) { + var username = config.auth.username || ''; + var password = config.auth.password || ''; + auth = username + ':' + password; + } + + // Parse url + var fullPath = buildFullPath(config.baseURL, config.url); + var parsed = url.parse(fullPath); + var protocol = parsed.protocol || 'http:'; + + if (!auth && parsed.auth) { + var urlAuth = parsed.auth.split(':'); + var urlUsername = urlAuth[0] || ''; + var urlPassword = urlAuth[1] || ''; + auth = urlUsername + ':' + urlPassword; + } + + if (auth) { + delete headers.Authorization; + } + + var isHttpsRequest = isHttps.test(protocol); + var agent = isHttpsRequest ? config.httpsAgent : config.httpAgent; + + var options = { + path: buildURL(parsed.path, config.params, config.paramsSerializer).replace(/^\?/, ''), + method: config.method.toUpperCase(), + headers: headers, + agent: agent, + agents: { http: config.httpAgent, https: config.httpsAgent }, + auth: auth + }; + + if (config.socketPath) { + options.socketPath = config.socketPath; + } else { + options.hostname = parsed.hostname; + options.port = parsed.port; + } + + var proxy = config.proxy; + if (!proxy && proxy !== false) { + var proxyEnv = protocol.slice(0, -1) + '_proxy'; + var proxyUrl = process.env[proxyEnv] || process.env[proxyEnv.toUpperCase()]; + if (proxyUrl) { + var parsedProxyUrl = url.parse(proxyUrl); + var noProxyEnv = process.env.no_proxy || process.env.NO_PROXY; + var shouldProxy = true; + + if (noProxyEnv) { + var noProxy = noProxyEnv.split(',').map(function trim(s) { + return s.trim(); + }); + + shouldProxy = !noProxy.some(function proxyMatch(proxyElement) { + if (!proxyElement) { + return false; + } + if (proxyElement === '*') { + return true; + } + if (proxyElement[0] === '.' && + parsed.hostname.substr(parsed.hostname.length - proxyElement.length) === proxyElement) { + return true; + } + + return parsed.hostname === proxyElement; + }); + } + + if (shouldProxy) { + proxy = { + host: parsedProxyUrl.hostname, + port: parsedProxyUrl.port, + protocol: parsedProxyUrl.protocol + }; + + if (parsedProxyUrl.auth) { + var proxyUrlAuth = parsedProxyUrl.auth.split(':'); + proxy.auth = { + username: proxyUrlAuth[0], + password: proxyUrlAuth[1] + }; + } + } + } + } + + if (proxy) { + options.headers.host = parsed.hostname + (parsed.port ? ':' + parsed.port : ''); + setProxy(options, proxy, protocol + '//' + parsed.hostname + (parsed.port ? ':' + parsed.port : '') + options.path); + } + + var transport; + var isHttpsProxy = isHttpsRequest && (proxy ? isHttps.test(proxy.protocol) : true); + if (config.transport) { + transport = config.transport; + } else if (config.maxRedirects === 0) { + transport = isHttpsProxy ? https : http; + } else { + if (config.maxRedirects) { + options.maxRedirects = config.maxRedirects; + } + transport = isHttpsProxy ? httpsFollow : httpFollow; + } + + if (config.maxBodyLength > -1) { + options.maxBodyLength = config.maxBodyLength; + } + + // Create the request + var req = transport.request(options, function handleResponse(res) { + if (req.aborted) return; + + // uncompress the response body transparently if required + var stream = res; + + // return the last request in case of redirects + var lastRequest = res.req || req; + + + // if no content, is HEAD request or decompress disabled we should not decompress + if (res.statusCode !== 204 && lastRequest.method !== 'HEAD' && config.decompress !== false) { + switch (res.headers['content-encoding']) { + /*eslint default-case:0*/ + case 'gzip': + case 'compress': + case 'deflate': + // add the unzipper to the body stream processing pipeline + stream = stream.pipe(zlib.createUnzip()); + + // remove the content-encoding in order to not confuse downstream operations + delete res.headers['content-encoding']; + break; + } + } + + var response = { + status: res.statusCode, + statusText: res.statusMessage, + headers: res.headers, + config: config, + request: lastRequest + }; + + if (config.responseType === 'stream') { + response.data = stream; + settle(resolve, reject, response); + } else { + var responseBuffer = []; + var totalResponseBytes = 0; + stream.on('data', function handleStreamData(chunk) { + responseBuffer.push(chunk); + totalResponseBytes += chunk.length; + + // make sure the content length is not over the maxContentLength if specified + if (config.maxContentLength > -1 && totalResponseBytes > config.maxContentLength) { + stream.destroy(); + reject(createError('maxContentLength size of ' + config.maxContentLength + ' exceeded', + config, null, lastRequest)); + } + }); + + stream.on('error', function handleStreamError(err) { + if (req.aborted) return; + reject(enhanceError(err, config, null, lastRequest)); + }); + + stream.on('end', function handleStreamEnd() { + var responseData = Buffer.concat(responseBuffer); + if (config.responseType !== 'arraybuffer') { + responseData = responseData.toString(config.responseEncoding); + if (!config.responseEncoding || config.responseEncoding === 'utf8') { + responseData = utils.stripBOM(responseData); + } + } + + response.data = responseData; + settle(resolve, reject, response); + }); + } + }); + + // Handle errors + req.on('error', function handleRequestError(err) { + if (req.aborted && err.code !== 'ERR_FR_TOO_MANY_REDIRECTS') return; + reject(enhanceError(err, config, null, req)); + }); + + // Handle request timeout + if (config.timeout) { + // This is forcing a int timeout to avoid problems if the `req` interface doesn't handle other types. + var timeout = parseInt(config.timeout, 10); + + if (isNaN(timeout)) { + reject(createError( + 'error trying to parse `config.timeout` to int', + config, + 'ERR_PARSE_TIMEOUT', + req + )); + + return; + } + + // Sometime, the response will be very slow, and does not respond, the connect event will be block by event loop system. + // And timer callback will be fired, and abort() will be invoked before connection, then get "socket hang up" and code ECONNRESET. + // At this time, if we have a large number of request, nodejs will hang up some socket on background. and the number will up and up. + // And then these socket which be hang up will devoring CPU little by little. + // ClientRequest.setTimeout will be fired on the specify milliseconds, and can make sure that abort() will be fired after connect. + req.setTimeout(timeout, function handleRequestTimeout() { + req.abort(); + reject(createError( + 'timeout of ' + timeout + 'ms exceeded', + config, + config.transitional && config.transitional.clarifyTimeoutError ? 'ETIMEDOUT' : 'ECONNABORTED', + req + )); + }); + } + + if (config.cancelToken) { + // Handle cancellation + config.cancelToken.promise.then(function onCanceled(cancel) { + if (req.aborted) return; + + req.abort(); + reject(cancel); + }); + } + + // Send the request + if (utils.isStream(data)) { + data.on('error', function handleStreamError(err) { + reject(enhanceError(err, config, null, req)); + }).pipe(req); + } else { + req.end(data); + } + }); +}; diff --git a/node_modules/textmaker-thiccy/node_modules/axios/lib/adapters/xhr.js b/node_modules/textmaker-thiccy/node_modules/axios/lib/adapters/xhr.js new file mode 100644 index 000000000..a386dd24a --- /dev/null +++ b/node_modules/textmaker-thiccy/node_modules/axios/lib/adapters/xhr.js @@ -0,0 +1,189 @@ +'use strict'; + +var utils = require('./../utils'); +var settle = require('./../core/settle'); +var cookies = require('./../helpers/cookies'); +var buildURL = require('./../helpers/buildURL'); +var buildFullPath = require('../core/buildFullPath'); +var parseHeaders = require('./../helpers/parseHeaders'); +var isURLSameOrigin = require('./../helpers/isURLSameOrigin'); +var createError = require('../core/createError'); + +module.exports = function xhrAdapter(config) { + return new Promise(function dispatchXhrRequest(resolve, reject) { + var requestData = config.data; + var requestHeaders = config.headers; + var responseType = config.responseType; + + if (utils.isFormData(requestData)) { + delete requestHeaders['Content-Type']; // Let the browser set it + } + + var request = new XMLHttpRequest(); + + // HTTP basic authentication + if (config.auth) { + var username = config.auth.username || ''; + var password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : ''; + requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password); + } + + var fullPath = buildFullPath(config.baseURL, config.url); + request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true); + + // Set the request timeout in MS + request.timeout = config.timeout; + + function onloadend() { + if (!request) { + return; + } + // Prepare the response + var responseHeaders = 'getAllResponseHeaders' in request ? parseHeaders(request.getAllResponseHeaders()) : null; + var responseData = !responseType || responseType === 'text' || responseType === 'json' ? + request.responseText : request.response; + var response = { + data: responseData, + status: request.status, + statusText: request.statusText, + headers: responseHeaders, + config: config, + request: request + }; + + settle(resolve, reject, response); + + // Clean up request + request = null; + } + + if ('onloadend' in request) { + // Use onloadend if available + request.onloadend = onloadend; + } else { + // Listen for ready state to emulate onloadend + request.onreadystatechange = function handleLoad() { + if (!request || request.readyState !== 4) { + return; + } + + // The request errored out and we didn't get a response, this will be + // handled by onerror instead + // With one exception: request that using file: protocol, most browsers + // will return status as 0 even though it's a successful request + if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) { + return; + } + // readystate handler is calling before onerror or ontimeout handlers, + // so we should call onloadend on the next 'tick' + setTimeout(onloadend); + }; + } + + // Handle browser request cancellation (as opposed to a manual cancellation) + request.onabort = function handleAbort() { + if (!request) { + return; + } + + reject(createError('Request aborted', config, 'ECONNABORTED', request)); + + // Clean up request + request = null; + }; + + // Handle low level network errors + request.onerror = function handleError() { + // Real errors are hidden from us by the browser + // onerror should only fire if it's a network error + reject(createError('Network Error', config, null, request)); + + // Clean up request + request = null; + }; + + // Handle timeout + request.ontimeout = function handleTimeout() { + var timeoutErrorMessage = 'timeout of ' + config.timeout + 'ms exceeded'; + if (config.timeoutErrorMessage) { + timeoutErrorMessage = config.timeoutErrorMessage; + } + reject(createError( + timeoutErrorMessage, + config, + config.transitional && config.transitional.clarifyTimeoutError ? 'ETIMEDOUT' : 'ECONNABORTED', + request)); + + // Clean up request + request = null; + }; + + // Add xsrf header + // This is only done if running in a standard browser environment. + // Specifically not if we're in a web worker, or react-native. + if (utils.isStandardBrowserEnv()) { + // Add xsrf header + var xsrfValue = (config.withCredentials || isURLSameOrigin(fullPath)) && config.xsrfCookieName ? + cookies.read(config.xsrfCookieName) : + undefined; + + if (xsrfValue) { + requestHeaders[config.xsrfHeaderName] = xsrfValue; + } + } + + // Add headers to the request + if ('setRequestHeader' in request) { + utils.forEach(requestHeaders, function setRequestHeader(val, key) { + if (typeof requestData === 'undefined' && key.toLowerCase() === 'content-type') { + // Remove Content-Type if data is undefined + delete requestHeaders[key]; + } else { + // Otherwise add header to the request + request.setRequestHeader(key, val); + } + }); + } + + // Add withCredentials to request if needed + if (!utils.isUndefined(config.withCredentials)) { + request.withCredentials = !!config.withCredentials; + } + + // Add responseType to request if needed + if (responseType && responseType !== 'json') { + request.responseType = config.responseType; + } + + // Handle progress if needed + if (typeof config.onDownloadProgress === 'function') { + request.addEventListener('progress', config.onDownloadProgress); + } + + // Not all browsers support upload events + if (typeof config.onUploadProgress === 'function' && request.upload) { + request.upload.addEventListener('progress', config.onUploadProgress); + } + + if (config.cancelToken) { + // Handle cancellation + config.cancelToken.promise.then(function onCanceled(cancel) { + if (!request) { + return; + } + + request.abort(); + reject(cancel); + // Clean up request + request = null; + }); + } + + if (!requestData) { + requestData = null; + } + + // Send the request + request.send(requestData); + }); +}; diff --git a/node_modules/textmaker-thiccy/node_modules/axios/lib/axios.js b/node_modules/textmaker-thiccy/node_modules/axios/lib/axios.js new file mode 100644 index 000000000..c6357b005 --- /dev/null +++ b/node_modules/textmaker-thiccy/node_modules/axios/lib/axios.js @@ -0,0 +1,56 @@ +'use strict'; + +var utils = require('./utils'); +var bind = require('./helpers/bind'); +var Axios = require('./core/Axios'); +var mergeConfig = require('./core/mergeConfig'); +var defaults = require('./defaults'); + +/** + * Create an instance of Axios + * + * @param {Object} defaultConfig The default config for the instance + * @return {Axios} A new instance of Axios + */ +function createInstance(defaultConfig) { + var context = new Axios(defaultConfig); + var instance = bind(Axios.prototype.request, context); + + // Copy axios.prototype to instance + utils.extend(instance, Axios.prototype, context); + + // Copy context to instance + utils.extend(instance, context); + + return instance; +} + +// Create the default instance to be exported +var axios = createInstance(defaults); + +// Expose Axios class to allow class inheritance +axios.Axios = Axios; + +// Factory for creating new instances +axios.create = function create(instanceConfig) { + return createInstance(mergeConfig(axios.defaults, instanceConfig)); +}; + +// Expose Cancel & CancelToken +axios.Cancel = require('./cancel/Cancel'); +axios.CancelToken = require('./cancel/CancelToken'); +axios.isCancel = require('./cancel/isCancel'); + +// Expose all/spread +axios.all = function all(promises) { + return Promise.all(promises); +}; +axios.spread = require('./helpers/spread'); + +// Expose isAxiosError +axios.isAxiosError = require('./helpers/isAxiosError'); + +module.exports = axios; + +// Allow use of default import syntax in TypeScript +module.exports.default = axios; diff --git a/node_modules/textmaker-thiccy/node_modules/axios/lib/cancel/Cancel.js b/node_modules/textmaker-thiccy/node_modules/axios/lib/cancel/Cancel.js new file mode 100644 index 000000000..e0de4003f --- /dev/null +++ b/node_modules/textmaker-thiccy/node_modules/axios/lib/cancel/Cancel.js @@ -0,0 +1,19 @@ +'use strict'; + +/** + * A `Cancel` is an object that is thrown when an operation is canceled. + * + * @class + * @param {string=} message The message. + */ +function Cancel(message) { + this.message = message; +} + +Cancel.prototype.toString = function toString() { + return 'Cancel' + (this.message ? ': ' + this.message : ''); +}; + +Cancel.prototype.__CANCEL__ = true; + +module.exports = Cancel; diff --git a/node_modules/textmaker-thiccy/node_modules/axios/lib/cancel/CancelToken.js b/node_modules/textmaker-thiccy/node_modules/axios/lib/cancel/CancelToken.js new file mode 100644 index 000000000..6b46e6662 --- /dev/null +++ b/node_modules/textmaker-thiccy/node_modules/axios/lib/cancel/CancelToken.js @@ -0,0 +1,57 @@ +'use strict'; + +var Cancel = require('./Cancel'); + +/** + * A `CancelToken` is an object that can be used to request cancellation of an operation. + * + * @class + * @param {Function} executor The executor function. + */ +function CancelToken(executor) { + if (typeof executor !== 'function') { + throw new TypeError('executor must be a function.'); + } + + var resolvePromise; + this.promise = new Promise(function promiseExecutor(resolve) { + resolvePromise = resolve; + }); + + var token = this; + executor(function cancel(message) { + if (token.reason) { + // Cancellation has already been requested + return; + } + + token.reason = new Cancel(message); + resolvePromise(token.reason); + }); +} + +/** + * Throws a `Cancel` if cancellation has been requested. + */ +CancelToken.prototype.throwIfRequested = function throwIfRequested() { + if (this.reason) { + throw this.reason; + } +}; + +/** + * Returns an object that contains a new `CancelToken` and a function that, when called, + * cancels the `CancelToken`. + */ +CancelToken.source = function source() { + var cancel; + var token = new CancelToken(function executor(c) { + cancel = c; + }); + return { + token: token, + cancel: cancel + }; +}; + +module.exports = CancelToken; diff --git a/node_modules/textmaker-thiccy/node_modules/axios/lib/cancel/isCancel.js b/node_modules/textmaker-thiccy/node_modules/axios/lib/cancel/isCancel.js new file mode 100644 index 000000000..051f3ae4c --- /dev/null +++ b/node_modules/textmaker-thiccy/node_modules/axios/lib/cancel/isCancel.js @@ -0,0 +1,5 @@ +'use strict'; + +module.exports = function isCancel(value) { + return !!(value && value.__CANCEL__); +}; diff --git a/node_modules/textmaker-thiccy/node_modules/axios/lib/core/Axios.js b/node_modules/textmaker-thiccy/node_modules/axios/lib/core/Axios.js new file mode 100644 index 000000000..42ea75e7e --- /dev/null +++ b/node_modules/textmaker-thiccy/node_modules/axios/lib/core/Axios.js @@ -0,0 +1,148 @@ +'use strict'; + +var utils = require('./../utils'); +var buildURL = require('../helpers/buildURL'); +var InterceptorManager = require('./InterceptorManager'); +var dispatchRequest = require('./dispatchRequest'); +var mergeConfig = require('./mergeConfig'); +var validator = require('../helpers/validator'); + +var validators = validator.validators; +/** + * Create a new instance of Axios + * + * @param {Object} instanceConfig The default config for the instance + */ +function Axios(instanceConfig) { + this.defaults = instanceConfig; + this.interceptors = { + request: new InterceptorManager(), + response: new InterceptorManager() + }; +} + +/** + * Dispatch a request + * + * @param {Object} config The config specific for this request (merged with this.defaults) + */ +Axios.prototype.request = function request(config) { + /*eslint no-param-reassign:0*/ + // Allow for axios('example/url'[, config]) a la fetch API + if (typeof config === 'string') { + config = arguments[1] || {}; + config.url = arguments[0]; + } else { + config = config || {}; + } + + config = mergeConfig(this.defaults, config); + + // Set config.method + if (config.method) { + config.method = config.method.toLowerCase(); + } else if (this.defaults.method) { + config.method = this.defaults.method.toLowerCase(); + } else { + config.method = 'get'; + } + + var transitional = config.transitional; + + if (transitional !== undefined) { + validator.assertOptions(transitional, { + silentJSONParsing: validators.transitional(validators.boolean, '1.0.0'), + forcedJSONParsing: validators.transitional(validators.boolean, '1.0.0'), + clarifyTimeoutError: validators.transitional(validators.boolean, '1.0.0') + }, false); + } + + // filter out skipped interceptors + var requestInterceptorChain = []; + var synchronousRequestInterceptors = true; + this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) { + if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) { + return; + } + + synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous; + + requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected); + }); + + var responseInterceptorChain = []; + this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) { + responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected); + }); + + var promise; + + if (!synchronousRequestInterceptors) { + var chain = [dispatchRequest, undefined]; + + Array.prototype.unshift.apply(chain, requestInterceptorChain); + chain = chain.concat(responseInterceptorChain); + + promise = Promise.resolve(config); + while (chain.length) { + promise = promise.then(chain.shift(), chain.shift()); + } + + return promise; + } + + + var newConfig = config; + while (requestInterceptorChain.length) { + var onFulfilled = requestInterceptorChain.shift(); + var onRejected = requestInterceptorChain.shift(); + try { + newConfig = onFulfilled(newConfig); + } catch (error) { + onRejected(error); + break; + } + } + + try { + promise = dispatchRequest(newConfig); + } catch (error) { + return Promise.reject(error); + } + + while (responseInterceptorChain.length) { + promise = promise.then(responseInterceptorChain.shift(), responseInterceptorChain.shift()); + } + + return promise; +}; + +Axios.prototype.getUri = function getUri(config) { + config = mergeConfig(this.defaults, config); + return buildURL(config.url, config.params, config.paramsSerializer).replace(/^\?/, ''); +}; + +// Provide aliases for supported request methods +utils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) { + /*eslint func-names:0*/ + Axios.prototype[method] = function(url, config) { + return this.request(mergeConfig(config || {}, { + method: method, + url: url, + data: (config || {}).data + })); + }; +}); + +utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) { + /*eslint func-names:0*/ + Axios.prototype[method] = function(url, data, config) { + return this.request(mergeConfig(config || {}, { + method: method, + url: url, + data: data + })); + }; +}); + +module.exports = Axios; diff --git a/node_modules/textmaker-thiccy/node_modules/axios/lib/core/InterceptorManager.js b/node_modules/textmaker-thiccy/node_modules/axios/lib/core/InterceptorManager.js new file mode 100644 index 000000000..900f44880 --- /dev/null +++ b/node_modules/textmaker-thiccy/node_modules/axios/lib/core/InterceptorManager.js @@ -0,0 +1,54 @@ +'use strict'; + +var utils = require('./../utils'); + +function InterceptorManager() { + this.handlers = []; +} + +/** + * Add a new interceptor to the stack + * + * @param {Function} fulfilled The function to handle `then` for a `Promise` + * @param {Function} rejected The function to handle `reject` for a `Promise` + * + * @return {Number} An ID used to remove interceptor later + */ +InterceptorManager.prototype.use = function use(fulfilled, rejected, options) { + this.handlers.push({ + fulfilled: fulfilled, + rejected: rejected, + synchronous: options ? options.synchronous : false, + runWhen: options ? options.runWhen : null + }); + return this.handlers.length - 1; +}; + +/** + * Remove an interceptor from the stack + * + * @param {Number} id The ID that was returned by `use` + */ +InterceptorManager.prototype.eject = function eject(id) { + if (this.handlers[id]) { + this.handlers[id] = null; + } +}; + +/** + * Iterate over all the registered interceptors + * + * This method is particularly useful for skipping over any + * interceptors that may have become `null` calling `eject`. + * + * @param {Function} fn The function to call for each interceptor + */ +InterceptorManager.prototype.forEach = function forEach(fn) { + utils.forEach(this.handlers, function forEachHandler(h) { + if (h !== null) { + fn(h); + } + }); +}; + +module.exports = InterceptorManager; diff --git a/node_modules/textmaker-thiccy/node_modules/axios/lib/core/README.md b/node_modules/textmaker-thiccy/node_modules/axios/lib/core/README.md new file mode 100644 index 000000000..84559ce7c --- /dev/null +++ b/node_modules/textmaker-thiccy/node_modules/axios/lib/core/README.md @@ -0,0 +1,8 @@ +# axios // core + +The modules found in `core/` should be modules that are specific to the domain logic of axios. These modules would most likely not make sense to be consumed outside of the axios module, as their logic is too specific. Some examples of core modules are: + +- Dispatching requests + - Requests sent via `adapters/` (see lib/adapters/README.md) +- Managing interceptors +- Handling config diff --git a/node_modules/textmaker-thiccy/node_modules/axios/lib/core/buildFullPath.js b/node_modules/textmaker-thiccy/node_modules/axios/lib/core/buildFullPath.js new file mode 100644 index 000000000..00b2b050a --- /dev/null +++ b/node_modules/textmaker-thiccy/node_modules/axios/lib/core/buildFullPath.js @@ -0,0 +1,20 @@ +'use strict'; + +var isAbsoluteURL = require('../helpers/isAbsoluteURL'); +var combineURLs = require('../helpers/combineURLs'); + +/** + * Creates a new URL by combining the baseURL with the requestedURL, + * only when the requestedURL is not already an absolute URL. + * If the requestURL is absolute, this function returns the requestedURL untouched. + * + * @param {string} baseURL The base URL + * @param {string} requestedURL Absolute or relative URL to combine + * @returns {string} The combined full path + */ +module.exports = function buildFullPath(baseURL, requestedURL) { + if (baseURL && !isAbsoluteURL(requestedURL)) { + return combineURLs(baseURL, requestedURL); + } + return requestedURL; +}; diff --git a/node_modules/textmaker-thiccy/node_modules/axios/lib/core/createError.js b/node_modules/textmaker-thiccy/node_modules/axios/lib/core/createError.js new file mode 100644 index 000000000..933680f69 --- /dev/null +++ b/node_modules/textmaker-thiccy/node_modules/axios/lib/core/createError.js @@ -0,0 +1,18 @@ +'use strict'; + +var enhanceError = require('./enhanceError'); + +/** + * Create an Error with the specified message, config, error code, request and response. + * + * @param {string} message The error message. + * @param {Object} config The config. + * @param {string} [code] The error code (for example, 'ECONNABORTED'). + * @param {Object} [request] The request. + * @param {Object} [response] The response. + * @returns {Error} The created error. + */ +module.exports = function createError(message, config, code, request, response) { + var error = new Error(message); + return enhanceError(error, config, code, request, response); +}; diff --git a/node_modules/textmaker-thiccy/node_modules/axios/lib/core/dispatchRequest.js b/node_modules/textmaker-thiccy/node_modules/axios/lib/core/dispatchRequest.js new file mode 100644 index 000000000..9ce3b96e6 --- /dev/null +++ b/node_modules/textmaker-thiccy/node_modules/axios/lib/core/dispatchRequest.js @@ -0,0 +1,82 @@ +'use strict'; + +var utils = require('./../utils'); +var transformData = require('./transformData'); +var isCancel = require('../cancel/isCancel'); +var defaults = require('../defaults'); + +/** + * Throws a `Cancel` if cancellation has been requested. + */ +function throwIfCancellationRequested(config) { + if (config.cancelToken) { + config.cancelToken.throwIfRequested(); + } +} + +/** + * Dispatch a request to the server using the configured adapter. + * + * @param {object} config The config that is to be used for the request + * @returns {Promise} The Promise to be fulfilled + */ +module.exports = function dispatchRequest(config) { + throwIfCancellationRequested(config); + + // Ensure headers exist + config.headers = config.headers || {}; + + // Transform request data + config.data = transformData.call( + config, + config.data, + config.headers, + config.transformRequest + ); + + // Flatten headers + config.headers = utils.merge( + config.headers.common || {}, + config.headers[config.method] || {}, + config.headers + ); + + utils.forEach( + ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'], + function cleanHeaderConfig(method) { + delete config.headers[method]; + } + ); + + var adapter = config.adapter || defaults.adapter; + + return adapter(config).then(function onAdapterResolution(response) { + throwIfCancellationRequested(config); + + // Transform response data + response.data = transformData.call( + config, + response.data, + response.headers, + config.transformResponse + ); + + return response; + }, function onAdapterRejection(reason) { + if (!isCancel(reason)) { + throwIfCancellationRequested(config); + + // Transform response data + if (reason && reason.response) { + reason.response.data = transformData.call( + config, + reason.response.data, + reason.response.headers, + config.transformResponse + ); + } + } + + return Promise.reject(reason); + }); +}; diff --git a/node_modules/textmaker-thiccy/node_modules/axios/lib/core/enhanceError.js b/node_modules/textmaker-thiccy/node_modules/axios/lib/core/enhanceError.js new file mode 100644 index 000000000..b6bc4444e --- /dev/null +++ b/node_modules/textmaker-thiccy/node_modules/axios/lib/core/enhanceError.js @@ -0,0 +1,42 @@ +'use strict'; + +/** + * Update an Error with the specified config, error code, and response. + * + * @param {Error} error The error to update. + * @param {Object} config The config. + * @param {string} [code] The error code (for example, 'ECONNABORTED'). + * @param {Object} [request] The request. + * @param {Object} [response] The response. + * @returns {Error} The error. + */ +module.exports = function enhanceError(error, config, code, request, response) { + error.config = config; + if (code) { + error.code = code; + } + + error.request = request; + error.response = response; + error.isAxiosError = true; + + error.toJSON = function toJSON() { + return { + // Standard + message: this.message, + name: this.name, + // Microsoft + description: this.description, + number: this.number, + // Mozilla + fileName: this.fileName, + lineNumber: this.lineNumber, + columnNumber: this.columnNumber, + stack: this.stack, + // Axios + config: this.config, + code: this.code + }; + }; + return error; +}; diff --git a/node_modules/textmaker-thiccy/node_modules/axios/lib/core/mergeConfig.js b/node_modules/textmaker-thiccy/node_modules/axios/lib/core/mergeConfig.js new file mode 100644 index 000000000..5a2c10cb0 --- /dev/null +++ b/node_modules/textmaker-thiccy/node_modules/axios/lib/core/mergeConfig.js @@ -0,0 +1,87 @@ +'use strict'; + +var utils = require('../utils'); + +/** + * Config-specific merge-function which creates a new config-object + * by merging two configuration objects together. + * + * @param {Object} config1 + * @param {Object} config2 + * @returns {Object} New object resulting from merging config2 to config1 + */ +module.exports = function mergeConfig(config1, config2) { + // eslint-disable-next-line no-param-reassign + config2 = config2 || {}; + var config = {}; + + var valueFromConfig2Keys = ['url', 'method', 'data']; + var mergeDeepPropertiesKeys = ['headers', 'auth', 'proxy', 'params']; + var defaultToConfig2Keys = [ + 'baseURL', 'transformRequest', 'transformResponse', 'paramsSerializer', + 'timeout', 'timeoutMessage', 'withCredentials', 'adapter', 'responseType', 'xsrfCookieName', + 'xsrfHeaderName', 'onUploadProgress', 'onDownloadProgress', 'decompress', + 'maxContentLength', 'maxBodyLength', 'maxRedirects', 'transport', 'httpAgent', + 'httpsAgent', 'cancelToken', 'socketPath', 'responseEncoding' + ]; + var directMergeKeys = ['validateStatus']; + + function getMergedValue(target, source) { + if (utils.isPlainObject(target) && utils.isPlainObject(source)) { + return utils.merge(target, source); + } else if (utils.isPlainObject(source)) { + return utils.merge({}, source); + } else if (utils.isArray(source)) { + return source.slice(); + } + return source; + } + + function mergeDeepProperties(prop) { + if (!utils.isUndefined(config2[prop])) { + config[prop] = getMergedValue(config1[prop], config2[prop]); + } else if (!utils.isUndefined(config1[prop])) { + config[prop] = getMergedValue(undefined, config1[prop]); + } + } + + utils.forEach(valueFromConfig2Keys, function valueFromConfig2(prop) { + if (!utils.isUndefined(config2[prop])) { + config[prop] = getMergedValue(undefined, config2[prop]); + } + }); + + utils.forEach(mergeDeepPropertiesKeys, mergeDeepProperties); + + utils.forEach(defaultToConfig2Keys, function defaultToConfig2(prop) { + if (!utils.isUndefined(config2[prop])) { + config[prop] = getMergedValue(undefined, config2[prop]); + } else if (!utils.isUndefined(config1[prop])) { + config[prop] = getMergedValue(undefined, config1[prop]); + } + }); + + utils.forEach(directMergeKeys, function merge(prop) { + if (prop in config2) { + config[prop] = getMergedValue(config1[prop], config2[prop]); + } else if (prop in config1) { + config[prop] = getMergedValue(undefined, config1[prop]); + } + }); + + var axiosKeys = valueFromConfig2Keys + .concat(mergeDeepPropertiesKeys) + .concat(defaultToConfig2Keys) + .concat(directMergeKeys); + + var otherKeys = Object + .keys(config1) + .concat(Object.keys(config2)) + .filter(function filterAxiosKeys(key) { + return axiosKeys.indexOf(key) === -1; + }); + + utils.forEach(otherKeys, mergeDeepProperties); + + return config; +}; diff --git a/node_modules/textmaker-thiccy/node_modules/axios/lib/core/settle.js b/node_modules/textmaker-thiccy/node_modules/axios/lib/core/settle.js new file mode 100644 index 000000000..886adb0c1 --- /dev/null +++ b/node_modules/textmaker-thiccy/node_modules/axios/lib/core/settle.js @@ -0,0 +1,25 @@ +'use strict'; + +var createError = require('./createError'); + +/** + * Resolve or reject a Promise based on response status. + * + * @param {Function} resolve A function that resolves the promise. + * @param {Function} reject A function that rejects the promise. + * @param {object} response The response. + */ +module.exports = function settle(resolve, reject, response) { + var validateStatus = response.config.validateStatus; + if (!response.status || !validateStatus || validateStatus(response.status)) { + resolve(response); + } else { + reject(createError( + 'Request failed with status code ' + response.status, + response.config, + null, + response.request, + response + )); + } +}; diff --git a/node_modules/textmaker-thiccy/node_modules/axios/lib/core/transformData.js b/node_modules/textmaker-thiccy/node_modules/axios/lib/core/transformData.js new file mode 100644 index 000000000..c584d12bc --- /dev/null +++ b/node_modules/textmaker-thiccy/node_modules/axios/lib/core/transformData.js @@ -0,0 +1,22 @@ +'use strict'; + +var utils = require('./../utils'); +var defaults = require('./../defaults'); + +/** + * Transform the data for a request or a response + * + * @param {Object|String} data The data to be transformed + * @param {Array} headers The headers for the request or response + * @param {Array|Function} fns A single function or Array of functions + * @returns {*} The resulting transformed data + */ +module.exports = function transformData(data, headers, fns) { + var context = this || defaults; + /*eslint no-param-reassign:0*/ + utils.forEach(fns, function transform(fn) { + data = fn.call(context, data, headers); + }); + + return data; +}; diff --git a/node_modules/textmaker-thiccy/node_modules/axios/lib/defaults.js b/node_modules/textmaker-thiccy/node_modules/axios/lib/defaults.js new file mode 100644 index 000000000..55e69d9ae --- /dev/null +++ b/node_modules/textmaker-thiccy/node_modules/axios/lib/defaults.js @@ -0,0 +1,134 @@ +'use strict'; + +var utils = require('./utils'); +var normalizeHeaderName = require('./helpers/normalizeHeaderName'); +var enhanceError = require('./core/enhanceError'); + +var DEFAULT_CONTENT_TYPE = { + 'Content-Type': 'application/x-www-form-urlencoded' +}; + +function setContentTypeIfUnset(headers, value) { + if (!utils.isUndefined(headers) && utils.isUndefined(headers['Content-Type'])) { + headers['Content-Type'] = value; + } +} + +function getDefaultAdapter() { + var adapter; + if (typeof XMLHttpRequest !== 'undefined') { + // For browsers use XHR adapter + adapter = require('./adapters/xhr'); + } else if (typeof process !== 'undefined' && Object.prototype.toString.call(process) === '[object process]') { + // For node use HTTP adapter + adapter = require('./adapters/http'); + } + return adapter; +} + +function stringifySafely(rawValue, parser, encoder) { + if (utils.isString(rawValue)) { + try { + (parser || JSON.parse)(rawValue); + return utils.trim(rawValue); + } catch (e) { + if (e.name !== 'SyntaxError') { + throw e; + } + } + } + + return (encoder || JSON.stringify)(rawValue); +} + +var defaults = { + + transitional: { + silentJSONParsing: true, + forcedJSONParsing: true, + clarifyTimeoutError: false + }, + + adapter: getDefaultAdapter(), + + transformRequest: [function transformRequest(data, headers) { + normalizeHeaderName(headers, 'Accept'); + normalizeHeaderName(headers, 'Content-Type'); + + if (utils.isFormData(data) || + utils.isArrayBuffer(data) || + utils.isBuffer(data) || + utils.isStream(data) || + utils.isFile(data) || + utils.isBlob(data) + ) { + return data; + } + if (utils.isArrayBufferView(data)) { + return data.buffer; + } + if (utils.isURLSearchParams(data)) { + setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8'); + return data.toString(); + } + if (utils.isObject(data) || (headers && headers['Content-Type'] === 'application/json')) { + setContentTypeIfUnset(headers, 'application/json'); + return stringifySafely(data); + } + return data; + }], + + transformResponse: [function transformResponse(data) { + var transitional = this.transitional; + var silentJSONParsing = transitional && transitional.silentJSONParsing; + var forcedJSONParsing = transitional && transitional.forcedJSONParsing; + var strictJSONParsing = !silentJSONParsing && this.responseType === 'json'; + + if (strictJSONParsing || (forcedJSONParsing && utils.isString(data) && data.length)) { + try { + return JSON.parse(data); + } catch (e) { + if (strictJSONParsing) { + if (e.name === 'SyntaxError') { + throw enhanceError(e, this, 'E_JSON_PARSE'); + } + throw e; + } + } + } + + return data; + }], + + /** + * A timeout in milliseconds to abort a request. If set to 0 (default) a + * timeout is not created. + */ + timeout: 0, + + xsrfCookieName: 'XSRF-TOKEN', + xsrfHeaderName: 'X-XSRF-TOKEN', + + maxContentLength: -1, + maxBodyLength: -1, + + validateStatus: function validateStatus(status) { + return status >= 200 && status < 300; + } +}; + +defaults.headers = { + common: { + 'Accept': 'application/json, text/plain, */*' + } +}; + +utils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) { + defaults.headers[method] = {}; +}); + +utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) { + defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE); +}); + +module.exports = defaults; diff --git a/node_modules/textmaker-thiccy/node_modules/axios/lib/helpers/README.md b/node_modules/textmaker-thiccy/node_modules/axios/lib/helpers/README.md new file mode 100644 index 000000000..4ae34193a --- /dev/null +++ b/node_modules/textmaker-thiccy/node_modules/axios/lib/helpers/README.md @@ -0,0 +1,7 @@ +# axios // helpers + +The modules found in `helpers/` should be generic modules that are _not_ specific to the domain logic of axios. These modules could theoretically be published to npm on their own and consumed by other modules or apps. Some examples of generic modules are things like: + +- Browser polyfills +- Managing cookies +- Parsing HTTP headers diff --git a/node_modules/textmaker-thiccy/node_modules/axios/lib/helpers/bind.js b/node_modules/textmaker-thiccy/node_modules/axios/lib/helpers/bind.js new file mode 100644 index 000000000..6147c608e --- /dev/null +++ b/node_modules/textmaker-thiccy/node_modules/axios/lib/helpers/bind.js @@ -0,0 +1,11 @@ +'use strict'; + +module.exports = function bind(fn, thisArg) { + return function wrap() { + var args = new Array(arguments.length); + for (var i = 0; i < args.length; i++) { + args[i] = arguments[i]; + } + return fn.apply(thisArg, args); + }; +}; diff --git a/node_modules/textmaker-thiccy/node_modules/axios/lib/helpers/buildURL.js b/node_modules/textmaker-thiccy/node_modules/axios/lib/helpers/buildURL.js new file mode 100644 index 000000000..31595c33a --- /dev/null +++ b/node_modules/textmaker-thiccy/node_modules/axios/lib/helpers/buildURL.js @@ -0,0 +1,70 @@ +'use strict'; + +var utils = require('./../utils'); + +function encode(val) { + return encodeURIComponent(val). + replace(/%3A/gi, ':'). + replace(/%24/g, '$'). + replace(/%2C/gi, ','). + replace(/%20/g, '+'). + replace(/%5B/gi, '['). + replace(/%5D/gi, ']'); +} + +/** + * Build a URL by appending params to the end + * + * @param {string} url The base of the url (e.g., http://www.google.com) + * @param {object} [params] The params to be appended + * @returns {string} The formatted url + */ +module.exports = function buildURL(url, params, paramsSerializer) { + /*eslint no-param-reassign:0*/ + if (!params) { + return url; + } + + var serializedParams; + if (paramsSerializer) { + serializedParams = paramsSerializer(params); + } else if (utils.isURLSearchParams(params)) { + serializedParams = params.toString(); + } else { + var parts = []; + + utils.forEach(params, function serialize(val, key) { + if (val === null || typeof val === 'undefined') { + return; + } + + if (utils.isArray(val)) { + key = key + '[]'; + } else { + val = [val]; + } + + utils.forEach(val, function parseValue(v) { + if (utils.isDate(v)) { + v = v.toISOString(); + } else if (utils.isObject(v)) { + v = JSON.stringify(v); + } + parts.push(encode(key) + '=' + encode(v)); + }); + }); + + serializedParams = parts.join('&'); + } + + if (serializedParams) { + var hashmarkIndex = url.indexOf('#'); + if (hashmarkIndex !== -1) { + url = url.slice(0, hashmarkIndex); + } + + url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams; + } + + return url; +}; diff --git a/node_modules/textmaker-thiccy/node_modules/axios/lib/helpers/combineURLs.js b/node_modules/textmaker-thiccy/node_modules/axios/lib/helpers/combineURLs.js new file mode 100644 index 000000000..f1b58a586 --- /dev/null +++ b/node_modules/textmaker-thiccy/node_modules/axios/lib/helpers/combineURLs.js @@ -0,0 +1,14 @@ +'use strict'; + +/** + * Creates a new URL by combining the specified URLs + * + * @param {string} baseURL The base URL + * @param {string} relativeURL The relative URL + * @returns {string} The combined URL + */ +module.exports = function combineURLs(baseURL, relativeURL) { + return relativeURL + ? baseURL.replace(/\/+$/, '') + '/' + relativeURL.replace(/^\/+/, '') + : baseURL; +}; diff --git a/node_modules/textmaker-thiccy/node_modules/axios/lib/helpers/cookies.js b/node_modules/textmaker-thiccy/node_modules/axios/lib/helpers/cookies.js new file mode 100644 index 000000000..5a8a66661 --- /dev/null +++ b/node_modules/textmaker-thiccy/node_modules/axios/lib/helpers/cookies.js @@ -0,0 +1,53 @@ +'use strict'; + +var utils = require('./../utils'); + +module.exports = ( + utils.isStandardBrowserEnv() ? + + // Standard browser envs support document.cookie + (function standardBrowserEnv() { + return { + write: function write(name, value, expires, path, domain, secure) { + var cookie = []; + cookie.push(name + '=' + encodeURIComponent(value)); + + if (utils.isNumber(expires)) { + cookie.push('expires=' + new Date(expires).toGMTString()); + } + + if (utils.isString(path)) { + cookie.push('path=' + path); + } + + if (utils.isString(domain)) { + cookie.push('domain=' + domain); + } + + if (secure === true) { + cookie.push('secure'); + } + + document.cookie = cookie.join('; '); + }, + + read: function read(name) { + var match = document.cookie.match(new RegExp('(^|;\\s*)(' + name + ')=([^;]*)')); + return (match ? decodeURIComponent(match[3]) : null); + }, + + remove: function remove(name) { + this.write(name, '', Date.now() - 86400000); + } + }; + })() : + + // Non standard browser env (web workers, react-native) lack needed support. + (function nonStandardBrowserEnv() { + return { + write: function write() {}, + read: function read() { return null; }, + remove: function remove() {} + }; + })() +); diff --git a/node_modules/textmaker-thiccy/node_modules/axios/lib/helpers/deprecatedMethod.js b/node_modules/textmaker-thiccy/node_modules/axios/lib/helpers/deprecatedMethod.js new file mode 100644 index 000000000..ed40965ba --- /dev/null +++ b/node_modules/textmaker-thiccy/node_modules/axios/lib/helpers/deprecatedMethod.js @@ -0,0 +1,24 @@ +'use strict'; + +/*eslint no-console:0*/ + +/** + * Supply a warning to the developer that a method they are using + * has been deprecated. + * + * @param {string} method The name of the deprecated method + * @param {string} [instead] The alternate method to use if applicable + * @param {string} [docs] The documentation URL to get further details + */ +module.exports = function deprecatedMethod(method, instead, docs) { + try { + console.warn( + 'DEPRECATED method `' + method + '`.' + + (instead ? ' Use `' + instead + '` instead.' : '') + + ' This method will be removed in a future release.'); + + if (docs) { + console.warn('For more information about usage see ' + docs); + } + } catch (e) { /* Ignore */ } +}; diff --git a/node_modules/textmaker-thiccy/node_modules/axios/lib/helpers/isAbsoluteURL.js b/node_modules/textmaker-thiccy/node_modules/axios/lib/helpers/isAbsoluteURL.js new file mode 100644 index 000000000..d33e99275 --- /dev/null +++ b/node_modules/textmaker-thiccy/node_modules/axios/lib/helpers/isAbsoluteURL.js @@ -0,0 +1,14 @@ +'use strict'; + +/** + * Determines whether the specified URL is absolute + * + * @param {string} url The URL to test + * @returns {boolean} True if the specified URL is absolute, otherwise false + */ +module.exports = function isAbsoluteURL(url) { + // A URL is considered absolute if it begins with "://" or "//" (protocol-relative URL). + // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed + // by any combination of letters, digits, plus, period, or hyphen. + return /^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(url); +}; diff --git a/node_modules/textmaker-thiccy/node_modules/axios/lib/helpers/isAxiosError.js b/node_modules/textmaker-thiccy/node_modules/axios/lib/helpers/isAxiosError.js new file mode 100644 index 000000000..29ff41af8 --- /dev/null +++ b/node_modules/textmaker-thiccy/node_modules/axios/lib/helpers/isAxiosError.js @@ -0,0 +1,11 @@ +'use strict'; + +/** + * Determines whether the payload is an error thrown by Axios + * + * @param {*} payload The value to test + * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false + */ +module.exports = function isAxiosError(payload) { + return (typeof payload === 'object') && (payload.isAxiosError === true); +}; diff --git a/node_modules/textmaker-thiccy/node_modules/axios/lib/helpers/isURLSameOrigin.js b/node_modules/textmaker-thiccy/node_modules/axios/lib/helpers/isURLSameOrigin.js new file mode 100644 index 000000000..f1d89ad19 --- /dev/null +++ b/node_modules/textmaker-thiccy/node_modules/axios/lib/helpers/isURLSameOrigin.js @@ -0,0 +1,68 @@ +'use strict'; + +var utils = require('./../utils'); + +module.exports = ( + utils.isStandardBrowserEnv() ? + + // Standard browser envs have full support of the APIs needed to test + // whether the request URL is of the same origin as current location. + (function standardBrowserEnv() { + var msie = /(msie|trident)/i.test(navigator.userAgent); + var urlParsingNode = document.createElement('a'); + var originURL; + + /** + * Parse a URL to discover it's components + * + * @param {String} url The URL to be parsed + * @returns {Object} + */ + function resolveURL(url) { + var href = url; + + if (msie) { + // IE needs attribute set twice to normalize properties + urlParsingNode.setAttribute('href', href); + href = urlParsingNode.href; + } + + urlParsingNode.setAttribute('href', href); + + // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils + return { + href: urlParsingNode.href, + protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '', + host: urlParsingNode.host, + search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, '') : '', + hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '', + hostname: urlParsingNode.hostname, + port: urlParsingNode.port, + pathname: (urlParsingNode.pathname.charAt(0) === '/') ? + urlParsingNode.pathname : + '/' + urlParsingNode.pathname + }; + } + + originURL = resolveURL(window.location.href); + + /** + * Determine if a URL shares the same origin as the current location + * + * @param {String} requestURL The URL to test + * @returns {boolean} True if URL shares the same origin, otherwise false + */ + return function isURLSameOrigin(requestURL) { + var parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL; + return (parsed.protocol === originURL.protocol && + parsed.host === originURL.host); + }; + })() : + + // Non standard browser envs (web workers, react-native) lack needed support. + (function nonStandardBrowserEnv() { + return function isURLSameOrigin() { + return true; + }; + })() +); diff --git a/node_modules/textmaker-thiccy/node_modules/axios/lib/helpers/normalizeHeaderName.js b/node_modules/textmaker-thiccy/node_modules/axios/lib/helpers/normalizeHeaderName.js new file mode 100644 index 000000000..738c9fe40 --- /dev/null +++ b/node_modules/textmaker-thiccy/node_modules/axios/lib/helpers/normalizeHeaderName.js @@ -0,0 +1,12 @@ +'use strict'; + +var utils = require('../utils'); + +module.exports = function normalizeHeaderName(headers, normalizedName) { + utils.forEach(headers, function processHeader(value, name) { + if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) { + headers[normalizedName] = value; + delete headers[name]; + } + }); +}; diff --git a/node_modules/textmaker-thiccy/node_modules/axios/lib/helpers/parseHeaders.js b/node_modules/textmaker-thiccy/node_modules/axios/lib/helpers/parseHeaders.js new file mode 100644 index 000000000..8af2cc7f1 --- /dev/null +++ b/node_modules/textmaker-thiccy/node_modules/axios/lib/helpers/parseHeaders.js @@ -0,0 +1,53 @@ +'use strict'; + +var utils = require('./../utils'); + +// Headers whose duplicates are ignored by node +// c.f. https://nodejs.org/api/http.html#http_message_headers +var ignoreDuplicateOf = [ + 'age', 'authorization', 'content-length', 'content-type', 'etag', + 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since', + 'last-modified', 'location', 'max-forwards', 'proxy-authorization', + 'referer', 'retry-after', 'user-agent' +]; + +/** + * Parse headers into an object + * + * ``` + * Date: Wed, 27 Aug 2014 08:58:49 GMT + * Content-Type: application/json + * Connection: keep-alive + * Transfer-Encoding: chunked + * ``` + * + * @param {String} headers Headers needing to be parsed + * @returns {Object} Headers parsed into an object + */ +module.exports = function parseHeaders(headers) { + var parsed = {}; + var key; + var val; + var i; + + if (!headers) { return parsed; } + + utils.forEach(headers.split('\n'), function parser(line) { + i = line.indexOf(':'); + key = utils.trim(line.substr(0, i)).toLowerCase(); + val = utils.trim(line.substr(i + 1)); + + if (key) { + if (parsed[key] && ignoreDuplicateOf.indexOf(key) >= 0) { + return; + } + if (key === 'set-cookie') { + parsed[key] = (parsed[key] ? parsed[key] : []).concat([val]); + } else { + parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val; + } + } + }); + + return parsed; +}; diff --git a/node_modules/textmaker-thiccy/node_modules/axios/lib/helpers/spread.js b/node_modules/textmaker-thiccy/node_modules/axios/lib/helpers/spread.js new file mode 100644 index 000000000..25e3cdd39 --- /dev/null +++ b/node_modules/textmaker-thiccy/node_modules/axios/lib/helpers/spread.js @@ -0,0 +1,27 @@ +'use strict'; + +/** + * Syntactic sugar for invoking a function and expanding an array for arguments. + * + * Common use case would be to use `Function.prototype.apply`. + * + * ```js + * function f(x, y, z) {} + * var args = [1, 2, 3]; + * f.apply(null, args); + * ``` + * + * With `spread` this example can be re-written. + * + * ```js + * spread(function(x, y, z) {})([1, 2, 3]); + * ``` + * + * @param {Function} callback + * @returns {Function} + */ +module.exports = function spread(callback) { + return function wrap(arr) { + return callback.apply(null, arr); + }; +}; diff --git a/node_modules/textmaker-thiccy/node_modules/axios/lib/helpers/validator.js b/node_modules/textmaker-thiccy/node_modules/axios/lib/helpers/validator.js new file mode 100644 index 000000000..7f1bc7dfa --- /dev/null +++ b/node_modules/textmaker-thiccy/node_modules/axios/lib/helpers/validator.js @@ -0,0 +1,105 @@ +'use strict'; + +var pkg = require('./../../package.json'); + +var validators = {}; + +// eslint-disable-next-line func-names +['object', 'boolean', 'number', 'function', 'string', 'symbol'].forEach(function(type, i) { + validators[type] = function validator(thing) { + return typeof thing === type || 'a' + (i < 1 ? 'n ' : ' ') + type; + }; +}); + +var deprecatedWarnings = {}; +var currentVerArr = pkg.version.split('.'); + +/** + * Compare package versions + * @param {string} version + * @param {string?} thanVersion + * @returns {boolean} + */ +function isOlderVersion(version, thanVersion) { + var pkgVersionArr = thanVersion ? thanVersion.split('.') : currentVerArr; + var destVer = version.split('.'); + for (var i = 0; i < 3; i++) { + if (pkgVersionArr[i] > destVer[i]) { + return true; + } else if (pkgVersionArr[i] < destVer[i]) { + return false; + } + } + return false; +} + +/** + * Transitional option validator + * @param {function|boolean?} validator + * @param {string?} version + * @param {string} message + * @returns {function} + */ +validators.transitional = function transitional(validator, version, message) { + var isDeprecated = version && isOlderVersion(version); + + function formatMessage(opt, desc) { + return '[Axios v' + pkg.version + '] Transitional option \'' + opt + '\'' + desc + (message ? '. ' + message : ''); + } + + // eslint-disable-next-line func-names + return function(value, opt, opts) { + if (validator === false) { + throw new Error(formatMessage(opt, ' has been removed in ' + version)); + } + + if (isDeprecated && !deprecatedWarnings[opt]) { + deprecatedWarnings[opt] = true; + // eslint-disable-next-line no-console + console.warn( + formatMessage( + opt, + ' has been deprecated since v' + version + ' and will be removed in the near future' + ) + ); + } + + return validator ? validator(value, opt, opts) : true; + }; +}; + +/** + * Assert object's properties type + * @param {object} options + * @param {object} schema + * @param {boolean?} allowUnknown + */ + +function assertOptions(options, schema, allowUnknown) { + if (typeof options !== 'object') { + throw new TypeError('options must be an object'); + } + var keys = Object.keys(options); + var i = keys.length; + while (i-- > 0) { + var opt = keys[i]; + var validator = schema[opt]; + if (validator) { + var value = options[opt]; + var result = value === undefined || validator(value, opt, options); + if (result !== true) { + throw new TypeError('option ' + opt + ' must be ' + result); + } + continue; + } + if (allowUnknown !== true) { + throw Error('Unknown option ' + opt); + } + } +} + +module.exports = { + isOlderVersion: isOlderVersion, + assertOptions: assertOptions, + validators: validators +}; diff --git a/node_modules/textmaker-thiccy/node_modules/axios/lib/utils.js b/node_modules/textmaker-thiccy/node_modules/axios/lib/utils.js new file mode 100644 index 000000000..5d966f444 --- /dev/null +++ b/node_modules/textmaker-thiccy/node_modules/axios/lib/utils.js @@ -0,0 +1,349 @@ +'use strict'; + +var bind = require('./helpers/bind'); + +// utils is a library of generic helper functions non-specific to axios + +var toString = Object.prototype.toString; + +/** + * Determine if a value is an Array + * + * @param {Object} val The value to test + * @returns {boolean} True if value is an Array, otherwise false + */ +function isArray(val) { + return toString.call(val) === '[object Array]'; +} + +/** + * Determine if a value is undefined + * + * @param {Object} val The value to test + * @returns {boolean} True if the value is undefined, otherwise false + */ +function isUndefined(val) { + return typeof val === 'undefined'; +} + +/** + * Determine if a value is a Buffer + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a Buffer, otherwise false + */ +function isBuffer(val) { + return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor) + && typeof val.constructor.isBuffer === 'function' && val.constructor.isBuffer(val); +} + +/** + * Determine if a value is an ArrayBuffer + * + * @param {Object} val The value to test + * @returns {boolean} True if value is an ArrayBuffer, otherwise false + */ +function isArrayBuffer(val) { + return toString.call(val) === '[object ArrayBuffer]'; +} + +/** + * Determine if a value is a FormData + * + * @param {Object} val The value to test + * @returns {boolean} True if value is an FormData, otherwise false + */ +function isFormData(val) { + return (typeof FormData !== 'undefined') && (val instanceof FormData); +} + +/** + * Determine if a value is a view on an ArrayBuffer + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false + */ +function isArrayBufferView(val) { + var result; + if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) { + result = ArrayBuffer.isView(val); + } else { + result = (val) && (val.buffer) && (val.buffer instanceof ArrayBuffer); + } + return result; +} + +/** + * Determine if a value is a String + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a String, otherwise false + */ +function isString(val) { + return typeof val === 'string'; +} + +/** + * Determine if a value is a Number + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a Number, otherwise false + */ +function isNumber(val) { + return typeof val === 'number'; +} + +/** + * Determine if a value is an Object + * + * @param {Object} val The value to test + * @returns {boolean} True if value is an Object, otherwise false + */ +function isObject(val) { + return val !== null && typeof val === 'object'; +} + +/** + * Determine if a value is a plain Object + * + * @param {Object} val The value to test + * @return {boolean} True if value is a plain Object, otherwise false + */ +function isPlainObject(val) { + if (toString.call(val) !== '[object Object]') { + return false; + } + + var prototype = Object.getPrototypeOf(val); + return prototype === null || prototype === Object.prototype; +} + +/** + * Determine if a value is a Date + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a Date, otherwise false + */ +function isDate(val) { + return toString.call(val) === '[object Date]'; +} + +/** + * Determine if a value is a File + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a File, otherwise false + */ +function isFile(val) { + return toString.call(val) === '[object File]'; +} + +/** + * Determine if a value is a Blob + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a Blob, otherwise false + */ +function isBlob(val) { + return toString.call(val) === '[object Blob]'; +} + +/** + * Determine if a value is a Function + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a Function, otherwise false + */ +function isFunction(val) { + return toString.call(val) === '[object Function]'; +} + +/** + * Determine if a value is a Stream + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a Stream, otherwise false + */ +function isStream(val) { + return isObject(val) && isFunction(val.pipe); +} + +/** + * Determine if a value is a URLSearchParams object + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a URLSearchParams object, otherwise false + */ +function isURLSearchParams(val) { + return typeof URLSearchParams !== 'undefined' && val instanceof URLSearchParams; +} + +/** + * Trim excess whitespace off the beginning and end of a string + * + * @param {String} str The String to trim + * @returns {String} The String freed of excess whitespace + */ +function trim(str) { + return str.trim ? str.trim() : str.replace(/^\s+|\s+$/g, ''); +} + +/** + * Determine if we're running in a standard browser environment + * + * This allows axios to run in a web worker, and react-native. + * Both environments support XMLHttpRequest, but not fully standard globals. + * + * web workers: + * typeof window -> undefined + * typeof document -> undefined + * + * react-native: + * navigator.product -> 'ReactNative' + * nativescript + * navigator.product -> 'NativeScript' or 'NS' + */ +function isStandardBrowserEnv() { + if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' || + navigator.product === 'NativeScript' || + navigator.product === 'NS')) { + return false; + } + return ( + typeof window !== 'undefined' && + typeof document !== 'undefined' + ); +} + +/** + * Iterate over an Array or an Object invoking a function for each item. + * + * If `obj` is an Array callback will be called passing + * the value, index, and complete array for each item. + * + * If 'obj' is an Object callback will be called passing + * the value, key, and complete object for each property. + * + * @param {Object|Array} obj The object to iterate + * @param {Function} fn The callback to invoke for each item + */ +function forEach(obj, fn) { + // Don't bother if no value provided + if (obj === null || typeof obj === 'undefined') { + return; + } + + // Force an array if not already something iterable + if (typeof obj !== 'object') { + /*eslint no-param-reassign:0*/ + obj = [obj]; + } + + if (isArray(obj)) { + // Iterate over array values + for (var i = 0, l = obj.length; i < l; i++) { + fn.call(null, obj[i], i, obj); + } + } else { + // Iterate over object keys + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) { + fn.call(null, obj[key], key, obj); + } + } + } +} + +/** + * Accepts varargs expecting each argument to be an object, then + * immutably merges the properties of each object and returns result. + * + * When multiple objects contain the same key the later object in + * the arguments list will take precedence. + * + * Example: + * + * ```js + * var result = merge({foo: 123}, {foo: 456}); + * console.log(result.foo); // outputs 456 + * ``` + * + * @param {Object} obj1 Object to merge + * @returns {Object} Result of all merge properties + */ +function merge(/* obj1, obj2, obj3, ... */) { + var result = {}; + function assignValue(val, key) { + if (isPlainObject(result[key]) && isPlainObject(val)) { + result[key] = merge(result[key], val); + } else if (isPlainObject(val)) { + result[key] = merge({}, val); + } else if (isArray(val)) { + result[key] = val.slice(); + } else { + result[key] = val; + } + } + + for (var i = 0, l = arguments.length; i < l; i++) { + forEach(arguments[i], assignValue); + } + return result; +} + +/** + * Extends object a by mutably adding to it the properties of object b. + * + * @param {Object} a The object to be extended + * @param {Object} b The object to copy properties from + * @param {Object} thisArg The object to bind function to + * @return {Object} The resulting value of object a + */ +function extend(a, b, thisArg) { + forEach(b, function assignValue(val, key) { + if (thisArg && typeof val === 'function') { + a[key] = bind(val, thisArg); + } else { + a[key] = val; + } + }); + return a; +} + +/** + * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM) + * + * @param {string} content with BOM + * @return {string} content value without BOM + */ +function stripBOM(content) { + if (content.charCodeAt(0) === 0xFEFF) { + content = content.slice(1); + } + return content; +} + +module.exports = { + isArray: isArray, + isArrayBuffer: isArrayBuffer, + isBuffer: isBuffer, + isFormData: isFormData, + isArrayBufferView: isArrayBufferView, + isString: isString, + isNumber: isNumber, + isObject: isObject, + isPlainObject: isPlainObject, + isUndefined: isUndefined, + isDate: isDate, + isFile: isFile, + isBlob: isBlob, + isFunction: isFunction, + isStream: isStream, + isURLSearchParams: isURLSearchParams, + isStandardBrowserEnv: isStandardBrowserEnv, + forEach: forEach, + merge: merge, + extend: extend, + trim: trim, + stripBOM: stripBOM +}; diff --git a/node_modules/textmaker-thiccy/node_modules/axios/package.json b/node_modules/textmaker-thiccy/node_modules/axios/package.json new file mode 100644 index 000000000..7c895b3a9 --- /dev/null +++ b/node_modules/textmaker-thiccy/node_modules/axios/package.json @@ -0,0 +1,84 @@ +{ + "name": "axios", + "version": "0.21.4", + "description": "Promise based HTTP client for the browser and node.js", + "main": "index.js", + "scripts": { + "test": "grunt test", + "start": "node ./sandbox/server.js", + "build": "NODE_ENV=production grunt build", + "preversion": "npm test", + "version": "npm run build && grunt version && git add -A dist && git add CHANGELOG.md bower.json package.json", + "postversion": "git push && git push --tags", + "examples": "node ./examples/server.js", + "coveralls": "cat coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js", + "fix": "eslint --fix lib/**/*.js" + }, + "repository": { + "type": "git", + "url": "https://github.com/axios/axios.git" + }, + "keywords": [ + "xhr", + "http", + "ajax", + "promise", + "node" + ], + "author": "Matt Zabriskie", + "license": "MIT", + "bugs": { + "url": "https://github.com/axios/axios/issues" + }, + "homepage": "https://axios-http.com", + "devDependencies": { + "coveralls": "^3.0.0", + "es6-promise": "^4.2.4", + "grunt": "^1.3.0", + "grunt-banner": "^0.6.0", + "grunt-cli": "^1.2.0", + "grunt-contrib-clean": "^1.1.0", + "grunt-contrib-watch": "^1.0.0", + "grunt-eslint": "^23.0.0", + "grunt-karma": "^4.0.0", + "grunt-mocha-test": "^0.13.3", + "grunt-ts": "^6.0.0-beta.19", + "grunt-webpack": "^4.0.2", + "istanbul-instrumenter-loader": "^1.0.0", + "jasmine-core": "^2.4.1", + "karma": "^6.3.2", + "karma-chrome-launcher": "^3.1.0", + "karma-firefox-launcher": "^2.1.0", + "karma-jasmine": "^1.1.1", + "karma-jasmine-ajax": "^0.1.13", + "karma-safari-launcher": "^1.0.0", + "karma-sauce-launcher": "^4.3.6", + "karma-sinon": "^1.0.5", + "karma-sourcemap-loader": "^0.3.8", + "karma-webpack": "^4.0.2", + "load-grunt-tasks": "^3.5.2", + "minimist": "^1.2.0", + "mocha": "^8.2.1", + "sinon": "^4.5.0", + "terser-webpack-plugin": "^4.2.3", + "typescript": "^4.0.5", + "url-search-params": "^0.10.0", + "webpack": "^4.44.2", + "webpack-dev-server": "^3.11.0" + }, + "browser": { + "./lib/adapters/http.js": "./lib/adapters/xhr.js" + }, + "jsdelivr": "dist/axios.min.js", + "unpkg": "dist/axios.min.js", + "typings": "./index.d.ts", + "dependencies": { + "follow-redirects": "^1.14.0" + }, + "bundlesize": [ + { + "path": "./dist/axios.min.js", + "threshold": "5kB" + } + ] +} diff --git a/node_modules/textmaker-thiccy/package.json b/node_modules/textmaker-thiccy/package.json new file mode 100644 index 000000000..02d893f8c --- /dev/null +++ b/node_modules/textmaker-thiccy/package.json @@ -0,0 +1,31 @@ +{ + "name": "textmaker-thiccy", + "version": "1.3.1", + "description": "Unofficial API Wrapper for Textpro and Photooxy", + "main": "src/index.js", + "directories": { + "lib": "lib" + }, + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/phaticusthiccy/TextMaker-Unlimited.git" + }, + "author": "", + "license": "GNU", + "dependencies": { + "axios": "^0.21.1", + "cheerio": "^1.0.0-rc.5", + "cookie": "^0.4.1", + "form-data": "^4.0.0", + "moment-timezone": "^0.5.33", + "node-fetch": "^2.6.1" + }, + "devDependencies": {}, + "bugs": { + "url": "https://github.com/phaticusthiccy/TextMaker-Unlimited/issues" + }, + "homepage": "https://github.com/phaticusthiccy/TextMaker-Unlimited#readme" +} diff --git a/node_modules/textmaker-thiccy/photooxy-examples/photooxy-ex.js b/node_modules/textmaker-thiccy/photooxy-examples/photooxy-ex.js new file mode 100644 index 000000000..7e013c393 --- /dev/null +++ b/node_modules/textmaker-thiccy/photooxy-examples/photooxy-ex.js @@ -0,0 +1,89 @@ +const thiccysapi = require('textmaker-thiccy'); // Import NPM Package + +// Some Examples + +thiccysapi.photooxy("https://photooxy.com/logo-and-text-effects/8-bit-text-on-arcade-rift-175.html", + ["Developer"], ["Phaticusthiccy"] + ).then(async (data) => { + try { + console.log(data) + } catch(err) { + console.log(err) + } +}); +thiccysapi.photooxy("https://photooxy.com/battlegrounds/make-wallpaper-battlegrounds-logo-text-146.html", + ["Developer"], ["Phaticusthiccy"] + ).then(async (data) => { + try { + console.log(data) + } catch(err) { + console.log(err) + } +}); +thiccysapi.photooxy("https://photooxy.com/fps-game-effect/create-battlefield-4-rising-effect-152.html", + ["Developer"], ["Phaticusthiccy"] + ).then(async (data) => { + try { + console.log(data) + } catch(err) { + console.log(err) + } +}); +thiccysapi.photooxy("https://photooxy.com/logo-and-text-effects/text-on-scary-cemetery-gate-172.html", + "Phaticusthiccy" + ).then(async (data) => { + try { + console.log(data) + } catch(err) { + console.log(err) + } +}); +thiccysapi.photooxy("https://photooxy.com/logo-and-text-effects/text-under-flower-165.html", + "Phaticusthiccy" + ).then(async (data) => { + try { + console.log(data) + } catch(err) { + console.log(err) + } +}); +thiccysapi.photooxy("https://photooxy.com/other-design/create-metallic-text-glow-online-188.html", + "Phaticusthiccy" + ).then(async (data) => { + try { + console.log(data) + } catch(err) { + console.log(err) + } +}); +thiccysapi.photooxy("https://photooxy.com/logo-and-text-effects/realistic-flaming-text-effect-online-197.html", + "Phaticusthiccy" + ).then(async (data) => { + try { + console.log(data) + } catch(err) { + console.log(err) + } +}); +thiccysapi.photooxy("https://photooxy.com/logo-and-text-effects/make-smoky-neon-glow-effect-343.html", + "Phaticusthiccy" + ).then(async (data) => { + try { + console.log(data) + } catch(err) { + console.log(err) + } +}); +thiccysapi.photooxy("https://photooxy.com/other-design/create-an-easy-smoke-type-effect-390.html", + "Phaticusthiccy" + ).then(async (data) => { + try { + console.log(data) + } catch(err) { + console.log(err) + } +}); + +/* + And Usually all of the others support :) +*/ diff --git a/node_modules/textmaker-thiccy/src/helpers/functions.js b/node_modules/textmaker-thiccy/src/helpers/functions.js new file mode 100644 index 000000000..7f7206eb3 --- /dev/null +++ b/node_modules/textmaker-thiccy/src/helpers/functions.js @@ -0,0 +1,3 @@ +module.exports.isUrl = (url) => { + return url.match(new RegExp(/https?:\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_+.~#?&/=]*)/, 'gi')) +} diff --git a/node_modules/textmaker-thiccy/src/index.js b/node_modules/textmaker-thiccy/src/index.js new file mode 100644 index 000000000..738072feb --- /dev/null +++ b/node_modules/textmaker-thiccy/src/index.js @@ -0,0 +1,2 @@ +exports.textpro = require("../lib/textmaker/textpro"); +exports.photooxy = require("../lib/textmaker/photooxy"); diff --git a/node_modules/textmaker-thiccy/textpro-examples/textpro-ex.js b/node_modules/textmaker-thiccy/textpro-examples/textpro-ex.js new file mode 100644 index 000000000..e57766fb2 --- /dev/null +++ b/node_modules/textmaker-thiccy/textpro-examples/textpro-ex.js @@ -0,0 +1,116 @@ +const thiccysapi = require('textmaker-thiccy'); // Import NPM Package + +// Some Examples + +thiccysapi.textpro("https://textpro.me/create-realistic-vintage-style-light-bulb-1000.html", + ["Developer"], ["Phaticusthiccy"] + ).then(async (data) => { + try { + console.log(data) + } catch(err) { + console.log(err) + } +}); +thiccysapi.textpro("https://textpro.me/create-cool-wall-graffiti-text-effect-online-1009.html", + ["Developer"], ["Phaticusthiccy"] + ).then(async (data) => { + try { + console.log(data) + } catch(err) { + console.log(err) + } +}); +thiccysapi.textpro("https://textpro.me/create-3d-avengers-logo-online-974.html", + ["Developer"], ["Phaticusthiccy"] + ).then(async (data) => { + try { + console.log(data) + } catch(err) { + console.log(err) + } +}); +thiccysapi.textpro("https://textpro.me/create-logo-style-marvel-studios-ver-metal-972.html", + ["Developer"], ["Phaticusthiccy"] + ).then(async (data) => { + try { + console.log(data) + } catch(err) { + console.log(err) + } +}); +thiccysapi.textpro("https://textpro.me/create-logo-style-marvel-studios-online-971.html", + ["Developer"], ["Phaticusthiccy"] + ).then(async (data) => { + try { + console.log(data) + } catch(err) { + console.log(err) + } +}); +thiccysapi.textpro("https://textpro.me/pornhub-style-logo-online-generator-free-977.html", + ["Developer"], ["Phaticusthiccy"] + ).then(async (data) => { + try { + console.log(data) + } catch(err) { + console.log(err) + } +}); +thiccysapi.textpro("https://textpro.me/thunder-text-effect-online-881.html", + "Phaticusthiccy" + ).then(async (data) => { + try { + console.log(data) + } catch(err) { + console.log(err) + } +}); +thiccysapi.textpro("https://textpro.me/advanced-glow-text-effect-873.html", + "Phaticusthiccy" + ).then(async (data) => { + try { + console.log(data) + } catch(err) { + console.log(err) + } +}); +thiccysapi.textpro("https://textpro.me/create-a-futuristic-technology-neon-light-text-effect-1006.html", + "Phaticusthiccy" + ).then(async (data) => { + try { + console.log(data) + } catch(err) { + console.log(err) + } +}); +thiccysapi.textpro("https://textpro.me/bokeh-text-effect-876.html", + "Phaticusthiccy" + ).then(async (data) => { + try { + console.log(data) + } catch(err) { + console.log(err) + } +}); +thiccysapi.textpro("https://textpro.me/neon-light-text-effect-with-galaxy-style-981.html", + "Phaticusthiccy" + ).then(async (data) => { + try { + console.log(data) + } catch(err) { + console.log(err) + } +}); +thiccysapi.textpro("https://textpro.me/neon-light-text-effect-online-882.html", + "Phaticusthiccy" + ).then(async (data) => { + try { + console.log(data) + } catch(err) { + console.log(err) + } +}); + +/* + And Nearly all the others support :) +*/ diff --git a/node_modules/tod-api/README.md b/node_modules/tod-api/README.md new file mode 100644 index 000000000..1c19503bf --- /dev/null +++ b/node_modules/tod-api/README.md @@ -0,0 +1,164 @@ +
+YOGI + +## YOGIPW-API + +
+ +

+ +

+

+ +

+

+ +

+ +## ```INSTALL And UNINSTALL``` +> npm install tod-api +> +> npm uninstall tod-api + + +## ```Palingmurah``` +``` +const tod = require('tod-api'); +const query = 'rdp' + +tod.palingmurah(query) + .then(result => { + console.log(result) +}); +``` +## ```Moddroid``` +``` +const tod = require('tod-api'); +const query = 'freefire' + +tod.moddroid(query) + .then(result => { + console.log(result) +}); +``` +## ```Happymod``` +``` +const tod = require('tod-api'); +const query = 'freefire' + +tod.happymod(query) + .then(result => { + console.log(result) +}); +``` +## ```Apkmody``` +``` +const tod = require('tod-api'); +const query = 'freefire' + +tod.apkmody(query) + .then(result => { + console.log(result) +}); +``` +## ```Wallpaper Search``` +``` +const tod = require('tod-api'); +const query = 'naruto' + +tod.wpsearch(query) + .then(result => { + console.log(result) +}); +``` +## ```Mui Halal``` +``` +const tod = require('tod-api'); +const query = 'indomie' +const page = '2' + +tod.muihalal(query, page) + .then(result => { + console.log(result) +}); +``` +## ```MCPEdl``` +``` +const tod = require('tod-api'); +const query = 'naruto' + +tod.mcpedl(query) + .then(result => { + console.log(result) +}); +``` +## ```Sfile Search``` +``` +const tod = require('tod-api'); +const query = 'vpn' + +tod.sfilesearch(query) + .then(result => { + console.log(result) +}); +``` +## ```Turnbackhoax``` +``` +const tod = require('tod-api'); + +tod.turnbackhoax() + .then(result => { + console.log(result) +}); +``` +## ```Server Minecraft Indo``` +``` +const tod = require('tod-api'); + +tod.servermc() + .then(result => { + console.log(result) +}); +``` +## ```P-STORE``` +``` +const tod = require('tod-api'); +const query = 'rdp' + +tod.pstore(query) + .then(result => { + console.log(result) +}); +``` +## ```JalanTikus``` +``` +const tod = require('tod-api'); +const query = 'naruto' + +tod.jalantikus(query) + .then(result => { + console.log(result) +}); +``` +## ```Tribun News``` +``` +const tod = require('tod-api'); + +tod.tribunnews() + .then(result => { + console.log(result) +}); +``` +## ```Kompas News``` +``` +const tod = require('tod-api'); + +tod.kompasnews() + .then(result => { + console.log(result) +}); +``` + # Thanks To +* [`Iam Ra`](https://github.com/rayyreall) + + \ No newline at end of file diff --git a/node_modules/tod-api/index.js b/node_modules/tod-api/index.js new file mode 100644 index 000000000..e00fc3844 --- /dev/null +++ b/node_modules/tod-api/index.js @@ -0,0 +1,451 @@ +const cheerio = require("cheerio"); +const axios = require("axios"); + +function palingmurah(query) { +return new Promise((resolve, reject) => { + axios.get(`https://palingmurah.net/pencarian-produk/?term=${query}`).then(async tod => { + const $ = cheerio.load(tod.data) + + hasil = [] + + $("div.ui.card.wpj-card-style-2").each(function(c, d) { + //INFO BARANG + name = $(d).find("div.content.wpj-small.list-70-right > a.list-header").text().trim(); + link = $(d).find("div.content.wpj-small.list-70-right > a.list-header").attr('href'); + img = $(d).find("div.card-image-helper > img").attr('data-src'); + harga = $(d).find("div.flex-master.card-job-price.text-right.text-vertical-center").text().trim(); + //user + usernamepenjual = $(d).find("strong").text().trim(); + linkpenjual = $(d).find("a.ui.wpj-big.avatar.image").attr('href'); + iconpenjual = $(d).find("a.ui.wpj-big.avatar.image > img").attr('data-src'); + const Data = { + author: "YogiPw", + name: name, + harga: harga, + img: img, + link: link, + usernamepenjual: usernamepenjual, + linkpenjual: linkpenjual, + iconpenjual: iconpenjual + } + hasil.push(Data) + }) + resolve(hasil) + }).catch(reject) + }); +} +function moddroid(query) { +return new Promise((resolve, reject) => { + axios.get(`https://moddroid.com/?s=${query}`).then( tod => { + const $ = cheerio.load(tod.data) + + hasil = [] + + $("div.col-12.col-md-6.mb-4").each(function(c, d) { + link = $(d).find("a.d-flex.position-relative.archive-post").attr('href'); + name = $(d).find("div > h3.h5.font-weight-semibold.text-truncate.text-primary.w-100").text().trim(); + img = $(d).find("div.flex-shrink-0.mr-2 > img").attr('src'); + desc = $(d).find("div.text-truncate.text-muted > span.align-middle").text(); + const Data = { + author: "YogiPw", + img: img, + name: name, + desc: desc, + link: link + } + hasil.push(Data) + }) + resolve(hasil) + }).catch(reject) + }); +} +function apkmody(query) { +return new Promise((resolve, reject) => { + axios.get(`https://apkmody.io/?s=${query}`).then( tod => { + const $ = cheerio.load(tod.data) + + hasil = [] + + $("div.flex-item").each(function(c, d) { + name = $(d).find("div.card-title > h2.truncate").text(); + desc = $(d).find("div.card-body > p.card-excerpt.has-small-font-size.truncate").text().trim(); + img = $(d).find("div.card-image > img").attr('src'); + link = $(d).find("article.card.has-shadow.clickable > a").attr('href'); + const Data = { + author: "YogiPw", + img: img, + name: name, + desc: desc, + link: link + } + hasil.push(Data) + }) + resolve(hasil) + }).catch(reject) + }); +} +function wpsearch(query) { +return new Promise((resolve, reject) => { + axios.get(`https://www.wallpaperflare.com/search?wallpaper=${query}`).then(async tod => { + const $ = cheerio.load(tod.data) + + hasil = [] + + $("#gallery > li > figure> a").each(function(i, cuk) { + const img = $(cuk).find("img").attr('data-src'); + hasil.push(img) + }) + resolve(hasil) + }).catch(reject); + }); +} +function happymod(query) { + return new Promise((resolve, reject) => { + axios.get(`https://www.happymod.com/search.html?q=${query}`).then(async tod => { + const $ = cheerio.load(tod.data) + + hasil = [] + + $("div.pdt-app-box").each(function(c, d) { + + + name = $(d).find("a").text().trim(); + icon = $(d).find("img.lazy").attr('data-original'); + link = $(d).find("a").attr('href'); + link2 = `https://www.happymod.com${link}` + const Data = { + author: "YogiPw", + icon: icon, + name: name, + link: link2 + } + hasil.push(Data) + }) + resolve(hasil); + }).catch(reject) + }); + } + function muihalal(query, page) { + return new Promise((resolve, reject) => { + axios.get(`https://www.halalmui.org/mui14/searchproduk/search/?kategori=nama_produk&katakunci=${query}&page=${page}`).then( tod => { + const $ = cheerio.load(tod.data) + + hasil = [] + + $("tr > td").each(function(c, d) { + name = $(d).find("span").eq(0).text() + namee = name.replace('Nama Produk :', '') + nmr = $(d).find("span").eq(1).text() + nmrr = nmr.replace('Nomor Sertifikat :', '') + const Data = { + author: "YogiPw", + title: namee, + nomorsertifikat: nmrr + } + hasil.push(Data) + resolve(hasil) + }).catch(reject) + }) + }) +} + function mcpedl(query) { + return new Promise((resolve, reject) => { + axios.get(`https://mcpedl.com/?s=${query}`).then(async tod => { + const $ = cheerio.load(tod.data) + + hasil = [] + + $("div.post").each(function(c, d) { + + name = $(d).find("h2.post__title").text().trim(); + date = $(d).find("div.post__date").text().trim(); + desc = $(d).find("p.post__text").text().trim(); + category = $(d).find("div.post__category > a").text().trim(); + link = $(d).find("a").attr('href') + link2 = `https://mcpedl.com${link}` + const Data = { + author: "YogiPw", + name: name, + category: category, + date: date, + desc: desc, + link: link2 + } + hasil.push(Data) + + }) + resolve(hasil) + }).catch(reject) + }); + } +function sfilesearch(query) { +return new Promise((resolve, reject) => { +axios.get(`https://sfile.mobi/search.php?q=${query}&search=Search`).then(async tod => { +const $ = cheerio.load(tod.data) + +hasil = [] + + $("div.list").each(function(i, cuk) { + ico = $(cuk).find("img").attr("src"); + lin = $(cuk).find("a").attr("href"); + name = $(cuk).find("a").text(); + const Data = { + author: "YogiPw", + icon: ico, + name: name, + link: lin + } + hasil.push(Data) + +}) +resolve(hasil) +}); +}); +} +function turnbackhoax() { +return new Promise((resolve, reject) => { + axios.get(`https://turnbackhoax.id/`).then( tod => { + const $ = cheerio.load(tod.data) + + hasil = [] + + $("figure.mh-loop-thumb").each(function(a, b) { + $("div.mh-loop-content.mh-clearfix").each(function(c, d) { + link = $(d).find("h3.entry-title.mh-loop-title > a").attr('href'); + img = $(b).find("img.attachment-mh-magazine-lite-medium.size-mh-magazine-lite-medium.wp-post-image").attr('src'); + title = $(d).find("h3.entry-title.mh-loop-title > a").text().trim(); + desc = $(d).find("div.mh-excerpt > p").text().trim(); + date = $(d).find("span.mh-meta-date.updated").text().trim(); + const Data = { + author: "YogiPw", + title: title, + thumbnail: img, + desc: desc, + date: date, + link: link + } + hasil.push(Data) + }) + }) + resolve(hasil) + }).catch(reject) + }); +} +function igvideo(link) { + return new Promise(async(resolve, reject) => { + let config = { + 'url': link, + 'submit': '' + } + axios('https://downloadgram.org/video-downloader.php',{ + method: 'POST', + data : new URLSearchParams(Object.entries(config)), + headers: { + "cookie": "_ga=GA1.2.623704211.1625264926; __gads=ID=a078e4fc2781b47b-22330cd520ca006e:T=1625264920:RT=1625264920:S=ALNI_MYS-jyPCjNa94DU8n-sX4aNF-ODOg; __atssc=google%3B3; _gid=GA1.2.1953813019.1625397379; __atuvc=4%7C26%2C6%7C27; __atuvs=60e2ab6d67a322ec003", + "accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9", + "user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36" + } + }) + .then(tod => { + const $ = cheerio.load(tod.data) + resolve({ + link: $('#downloadBox > a').attr('href') + }) + }) + }) + } + function igfoto(link) { + return new Promise(async(resolve, reject) => { + let config = { + 'url': link, + 'submit': '' + } + axios('https://downloadgram.org/photo-downloader.php',{ + method: 'POST', + data : new URLSearchParams(Object.entries(config)), + headers: { + "cookie": "_ga=GA1.2.623704211.1625264926; __gads=ID=a078e4fc2781b47b-22330cd520ca006e:T=1625264920:RT=1625264920:S=ALNI_MYS-jyPCjNa94DU8n-sX4aNF-ODOg; __atssc=google%3B3; _gid=GA1.2.1953813019.1625397379; __atuvc=4%7C26%2C6%7C27; __atuvs=60e2ab6d67a322ec003", + "accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9", + "user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36" + } + }) + .then(tod => { + const $ = cheerio.load(tod.data) + resolve({ + link: $('#downloadBox > a').attr('href') + }) + }) + }) + } + function igtv(link) { + return new Promise(async(resolve, reject) => { + let config = { + 'url': link, + 'submit': '' + } + axios('https://downloadgram.org/igtv-downloader.php',{ + method: 'POST', + data : new URLSearchParams(Object.entries(config)), + headers: { + "cookie": "_ga=GA1.2.623704211.1625264926; __gads=ID=a078e4fc2781b47b-22330cd520ca006e:T=1625264920:RT=1625264920:S=ALNI_MYS-jyPCjNa94DU8n-sX4aNF-ODOg; __atssc=google%3B3; _gid=GA1.2.1953813019.1625397379; __atuvc=4%7C26%2C6%7C27; __atuvs=60e2ab6d67a322ec003", + "accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9", + "user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36" + } + }) + .then(tod => { + const $ = cheerio.load(tod.data) + resolve({ + link: $('#downloadBox > a').attr('href') + }) + }) + }) + } + function servermc() { + return new Promise((resolve, reject) => { + axios.get(`https://minecraftpocket-servers.com/country/indonesia/`).then( tod => { + const $ = cheerio.load(tod.data) + + hasil = [] + + $("tr").each(function(c, d) { + ip = $(d).find("button.btn.btn-secondary.btn-sm").eq(1).text().trim().replace(':19132', '') + port = '19132' + versi = $(d).find("a.btn.btn-info.btn-sm").text() + player = $(d).find("td.d-none.d-md-table-cell > strong").eq(1).text().trim() + const Data = { + author: "YogiPw", + ip: ip, + port: port, + versi: versi, + player: player + } + hasil.push(Data) + }) + resolve(hasil) + }).catch(reject) + }) + } + function pstore(query, page) { + return new Promise((resolve, reject) => { + axios.get(`https://p-store.net/search?query=${query}&page=${page}`).then(async tod => { + const $ = cheerio.load(tod.data) + + hasil = [] + + $("div.col-xs-6.col-md-4.col-cusong").each(function(i, cuk) { + title = $(cuk).find("p > a").text(); + thumb = $(cuk).find("a > img").attr("src"); + link = $(cuk).find("p > a").attr("href"); + harga = $(cuk).find("div.price").text(); + const Data = { + author: "YogiPw", + title: title, + thumb: thumb, + link: link, + harga: harga + } + hasil.push(Data) + + }) + resolve(hasil) + }); + }); + } + function jalantikus(query) { + return new Promise((resolve, reject) => { + axios.get(`https://jalantikus.com/search/articles/${query}/`).then( tod => { + const $ = cheerio.load(tod.data) + + hasil = [] + + $("div.post-block-with-category").each(function(c, d) { + title = $(d).find("a.post-block-with-category__link").text() + category = $(d).find("a.post-info__category-link").text() + date = $(d).find("time").text() + link = `https://jalantikus.com${$(d).find("a").attr('href')}` + const Data = { + author: "YogiPw", + title: title, + category: category, + date: date, + link: link + } + hasil.push(Data) + }) + resolve(hasil) + }).catch(reject) + }) + } +//BERITA API +function tribunnews() { + return new Promise((resolve, reject) => { + axios.get(`https://www.tribunnews.com/news`).then( tod => { + const $ = cheerio.load(tod.data) + + hasil = [] + + $("li.p1520.art-list.pos_rel").each(function(c, d) { + title = $(d).find("div.mr140 > h3 > a.f20.ln24.fbo.txt-oev-2").text().trim() + thumb = $(d).find("div.fr.mt5.pos_rel > a > img.shou2.bgwhite").attr('src') + desc = $(d).find("div.grey2.pt5.f13.ln18.txt-oev-3").text().trim() + date = $(d).find("div.grey.pt5 > time.foot.timeago").text().trim() + link = $(d).find("div.fr.mt5.pos_rel > a").attr('href') + const Data = { + author: "YogiPw", + title: title, + thumb: thumb, + desc: desc, + date: date, + link: link + } + hasil.push(Data) + }) + resolve(hasil) + }).catch(reject) + }) +} +function kompasnews() { + return new Promise((resolve, reject) => { + axios.get(`https://news.kompas.com/`).then( tod => { + const $ = cheerio.load(tod.data) + + hasil = [] + + $("div.col-bs9-3").each(function(c, d) { + title = $(d).find("h3.article__title > a.article__link").text() + desc = $(d).find("div.article__lead").text().trim() + date = $(d).find("div.article__date").text().trim() + link = $(d).find("h3.article__title > a.article__link").attr('href') + const Data = { + author: "YogiPw", + title: title, + desc: desc, + date: date, + link: link + } + hasil.push(Data) + }) + resolve(hasil) + }).catch(reject) + }) + } + + + + module.exports.palingmurah = palingmurah + module.exports.moddroid = moddroid + module.exports.apkmody = apkmody + module.exports.happymod = happymod + module.exports.wpsearch = wpsearch + module.exports.muihalal = muihalal + module.exports.mcpedl = mcpedl + module.exports.servermc = servermc + module.exports.pstore = pstore + module.exports.jalantikus = jalantikus + module.exports.sfilesearch = sfilesearch + module.exports.turnbackhoax = turnbackhoax + module.exports.igfoto = igfoto + module.exports.igvideo = igvideo + module.exports.igtv = igtv + module.exports.tribunnews = tribunnews + module.exports.kompasnews = kompasnews \ No newline at end of file diff --git a/node_modules/tod-api/node_modules/axios/CHANGELOG.md b/node_modules/tod-api/node_modules/axios/CHANGELOG.md new file mode 100644 index 000000000..5e2b3d079 --- /dev/null +++ b/node_modules/tod-api/node_modules/axios/CHANGELOG.md @@ -0,0 +1,775 @@ +# Changelog + +### 0.21.4 (September 6, 2021) + +Fixes and Functionality: +- Fixing JSON transform when data is stringified. Providing backward compatibility and complying to the JSON RFC standard ([#4020](https://github.com/axios/axios/pull/4020)) + +Huge thanks to everyone who contributed to this release via code (authors listed below) or via reviews and triaging on GitHub: + +- [Jay](mailto:jasonsaayman@gmail.com) +- [Guillaume Fortaine](https://github.com/gfortaine) +- [Yusuke Kawasaki](https://github.com/kawanet) +- [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS) + +### 0.21.3 (September 4, 2021) + +Fixes and Functionality: +- Fixing response interceptor not being called when request interceptor is attached ([#4013](https://github.com/axios/axios/pull/4013)) + +Huge thanks to everyone who contributed to this release via code (authors listed below) or via reviews and triaging on GitHub: + +- [Jay](mailto:jasonsaayman@gmail.com) +- [Julian Hollmann](https://github.com/nerdbeere) + +### 0.21.2 (September 4, 2021) + +Fixes and Functionality: + +- Updating axios requests to be delayed by pre-emptive promise creation ([#2702](https://github.com/axios/axios/pull/2702)) +- Adding "synchronous" and "runWhen" options to interceptors api ([#2702](https://github.com/axios/axios/pull/2702)) +- Updating of transformResponse ([#3377](https://github.com/axios/axios/pull/3377)) +- Adding ability to omit User-Agent header ([#3703](https://github.com/axios/axios/pull/3703)) +- Adding multiple JSON improvements ([#3688](https://github.com/axios/axios/pull/3688), [#3763](https://github.com/axios/axios/pull/3763)) +- Fixing quadratic runtime and extra memory usage when setting a maxContentLength ([#3738](https://github.com/axios/axios/pull/3738)) +- Adding parseInt to config.timeout ([#3781](https://github.com/axios/axios/pull/3781)) +- Adding custom return type support to interceptor ([#3783](https://github.com/axios/axios/pull/3783)) +- Adding security fix for ReDoS vulnerability ([#3980](https://github.com/axios/axios/pull/3980)) + +Internal and Tests: + +- Updating build dev dependancies ([#3401](https://github.com/axios/axios/pull/3401)) +- Fixing builds running on Travis CI ([#3538](https://github.com/axios/axios/pull/3538)) +- Updating follow rediect version ([#3694](https://github.com/axios/axios/pull/3694), [#3771](https://github.com/axios/axios/pull/3771)) +- Updating karma sauce launcher to fix failing sauce tests ([#3712](https://github.com/axios/axios/pull/3712), [#3717](https://github.com/axios/axios/pull/3717)) +- Updating content-type header for application/json to not contain charset field, according do RFC 8259 ([#2154](https://github.com/axios/axios/pull/2154)) +- Fixing tests by bumping karma-sauce-launcher version ([#3813](https://github.com/axios/axios/pull/3813)) +- Changing testing process from Travis CI to GitHub Actions ([#3938](https://github.com/axios/axios/pull/3938)) + +Documentation: + +- Updating documentation around the use of `AUTH_TOKEN` with multiple domain endpoints ([#3539](https://github.com/axios/axios/pull/3539)) +- Remove duplication of item in changelog ([#3523](https://github.com/axios/axios/pull/3523)) +- Fixing gramatical errors ([#2642](https://github.com/axios/axios/pull/2642)) +- Fixing spelling error ([#3567](https://github.com/axios/axios/pull/3567)) +- Moving gitpod metion ([#2637](https://github.com/axios/axios/pull/2637)) +- Adding new axios documentation website link ([#3681](https://github.com/axios/axios/pull/3681), [#3707](https://github.com/axios/axios/pull/3707)) +- Updating documentation around dispatching requests ([#3772](https://github.com/axios/axios/pull/3772)) +- Adding documentation for the type guard isAxiosError ([#3767](https://github.com/axios/axios/pull/3767)) +- Adding explanation of cancel token ([#3803](https://github.com/axios/axios/pull/3803)) +- Updating CI status badge ([#3953](https://github.com/axios/axios/pull/3953)) +- Fixing errors with JSON documentation ([#3936](https://github.com/axios/axios/pull/3936)) +- Fixing README typo under Request Config ([#3825](https://github.com/axios/axios/pull/3825)) +- Adding axios-multi-api to the ecosystem file ([#3817](https://github.com/axios/axios/pull/3817)) +- Adding SECURITY.md to properly disclose security vulnerabilities ([#3981](https://github.com/axios/axios/pull/3981)) + +Huge thanks to everyone who contributed to this release via code (authors listed below) or via reviews and triaging on GitHub: + +- [Jay](mailto:jasonsaayman@gmail.com) +- [Sasha Korotkov](https://github.com/SashaKoro) +- [Daniel Lopretto](https://github.com/timemachine3030) +- [Mike Bishop](https://github.com/MikeBishop) +- [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS) +- [Mark](https://github.com/bimbiltu) +- [Philipe Gouveia Paixão](https://github.com/piiih) +- [hippo](https://github.com/hippo2cat) +- [ready-research](https://github.com/ready-research) +- [Xianming Zhong](https://github.com/chinesedfan) +- [Christopher Chrapka](https://github.com/OJezu) +- [Brian Anglin](https://github.com/anglinb) +- [Kohta Ito](https://github.com/koh110) +- [Ali Clark](https://github.com/aliclark) +- [caikan](https://github.com/caikan) +- [Elina Gorshkova](https://github.com/elinagorshkova) +- [Ryota Ikezawa](https://github.com/paveg) +- [Nisar Hassan Naqvi](https://github.com/nisarhassan12) +- [Jake](https://github.com/codemaster138) +- [TagawaHirotaka](https://github.com/wafuwafu13) +- [Johannes Jarbratt](https://github.com/johachi) +- [Mo Sattler](https://github.com/MoSattler) +- [Sam Carlton](https://github.com/ThatGuySam) +- [Matt Czapliński](https://github.com/MattCCC) +- [Ziding Zhang](https://github.com/zidingz) + +### 0.21.1 (December 21, 2020) + +Fixes and Functionality: + +- Hotfix: Prevent SSRF ([#3410](https://github.com/axios/axios/pull/3410)) +- Protocol not parsed when setting proxy config from env vars ([#3070](https://github.com/axios/axios/pull/3070)) +- Updating axios in types to be lower case ([#2797](https://github.com/axios/axios/pull/2797)) +- Adding a type guard for `AxiosError` ([#2949](https://github.com/axios/axios/pull/2949)) + +Internal and Tests: + +- Remove the skipping of the `socket` http test ([#3364](https://github.com/axios/axios/pull/3364)) +- Use different socket for Win32 test ([#3375](https://github.com/axios/axios/pull/3375)) + +Huge thanks to everyone who contributed to this release via code (authors listed below) or via reviews and triaging on GitHub: + +- Daniel Lopretto +- Jason Kwok +- Jay +- Jonathan Foster +- Remco Haszing +- Xianming Zhong + +### 0.21.0 (October 23, 2020) + +Fixes and Functionality: + +- Fixing requestHeaders.Authorization ([#3287](https://github.com/axios/axios/pull/3287)) +- Fixing node types ([#3237](https://github.com/axios/axios/pull/3237)) +- Fixing axios.delete ignores config.data ([#3282](https://github.com/axios/axios/pull/3282)) +- Revert "Fixing overwrite Blob/File type as Content-Type in browser. (#1773)" ([#3289](https://github.com/axios/axios/pull/3289)) +- Fixing an issue that type 'null' and 'undefined' is not assignable to validateStatus when typescript strict option is enabled ([#3200](https://github.com/axios/axios/pull/3200)) + +Internal and Tests: + +- Lock travis to not use node v15 ([#3361](https://github.com/axios/axios/pull/3361)) + +Documentation: + +- Fixing simple typo, existant -> existent ([#3252](https://github.com/axios/axios/pull/3252)) +- Fixing typos ([#3309](https://github.com/axios/axios/pull/3309)) + +Huge thanks to everyone who contributed to this release via code (authors listed below) or via reviews and triaging on GitHub: + +- Allan Cruz <57270969+Allanbcruz@users.noreply.github.com> +- George Cheng +- Jay +- Kevin Kirsche +- Remco Haszing +- Taemin Shin +- Tim Gates +- Xianming Zhong + +### 0.20.0 (August 20, 2020) + +Release of 0.20.0-pre as a full release with no other changes. + +### 0.20.0-pre (July 15, 2020) + +Fixes and Functionality: + +- Fixing response with utf-8 BOM can not parse to json ([#2419](https://github.com/axios/axios/pull/2419)) + - fix: remove byte order marker (UTF-8 BOM) when transform response + - fix: remove BOM only utf-8 + - test: utf-8 BOM + - fix: incorrect param name +- Refactor mergeConfig without utils.deepMerge ([#2844](https://github.com/axios/axios/pull/2844)) + - Adding failing test + - Fixing #2587 default custom config persisting + - Adding Concat keys and filter duplicates + - Fixed value from CPE + - update for review feedbacks + - no deepMerge + - only merge between plain objects + - fix rename + - always merge config by mergeConfig + - extract function mergeDeepProperties + - refactor mergeConfig with all keys, and add special logic for validateStatus + - add test for resetting headers + - add lots of tests and fix a bug + - should not inherit `data` + - use simple toString +- Fixing overwrite Blob/File type as Content-Type in browser. ([#1773](https://github.com/axios/axios/pull/1773)) +- Fixing an issue that type 'null' is not assignable to validateStatus ([#2773](https://github.com/axios/axios/pull/2773)) +- Fixing special char encoding ([#1671](https://github.com/axios/axios/pull/1671)) + - removing @ character from replacement list since it is a reserved character + - Updating buildURL test to not include the @ character + - Removing console logs +- Fixing password encoding with special characters in basic authentication ([#1492](https://github.com/axios/axios/pull/1492)) + - Fixing password encoding with special characters in basic authentication + - Adding test to check if password with non-Latin1 characters pass +- Fixing 'Network Error' in react native android ([#1487](https://github.com/axios/axios/pull/1487)) + There is a bug in react native Android platform when using get method. It will trigger a 'Network Error' when passing the requestData which is an empty string to request.send function. So if the requestData is an empty string we can set it to null as well to fix the bug. +- Fixing Cookie Helper with Async Components ([#1105](https://github.com/axios/axios/pull/1105)) ([#1107](https://github.com/axios/axios/pull/1107)) +- Fixing 'progressEvent' type ([#2851](https://github.com/axios/axios/pull/2851)) + - Fix 'progressEvent' type + - Update axios.ts +- Fixing getting local files (file://) failed ([#2470](https://github.com/axios/axios/pull/2470)) + - fix issue #2416, #2396 + - fix Eslint warn + - Modify judgment conditions + - add unit test + - update unit test + - update unit test +- Allow PURGE method in typings ([#2191](https://github.com/axios/axios/pull/2191)) +- Adding option to disable automatic decompression ([#2661](https://github.com/axios/axios/pull/2661)) + - Adding ability to disable auto decompression + - Updating decompress documentation in README + - Fixing test\unit\adapters\http.js lint errors + - Adding test for disabling auto decompression + - Removing changes that fixed lint errors in tests + - Removing formatting change to unit test +- Add independent `maxBodyLength` option ([#2781](https://github.com/axios/axios/pull/2781)) + - Add independent option to set the maximum size of the request body + - Remove maxBodyLength check + - Update README + - Assert for error code and message +- Adding responseEncoding to mergeConfig ([#1745](https://github.com/axios/axios/pull/1745)) +- Compatible with follow-redirect aborts the request ([#2689](https://github.com/axios/axios/pull/2689)) + - Compatible with follow-redirect aborts the request + - Use the error code +- Fix merging of params ([#2656](https://github.com/axios/axios/pull/2656)) + - Name function to avoid ESLint func-names warning + - Switch params config to merge list and update tests + - Restore testing of both false and null + - Restore test cases for keys without defaults + - Include test for non-object values that aren't false-y. +- Revert `finally` as `then` ([#2683](https://github.com/axios/axios/pull/2683)) + +Internal and Tests: + +- Fix stale bot config ([#3049](https://github.com/axios/axios/pull/3049)) + - fix stale bot config + - fix multiple lines +- Add days and change name to work ([#3035](https://github.com/axios/axios/pull/3035)) +- Update close-issues.yml ([#3031](https://github.com/axios/axios/pull/3031)) + - Update close-issues.yml + Update close message to read better 😄 + - Fix use of quotations + Use single quotes as per other .yml files + - Remove user name form message +- Add GitHub actions to close stale issues/prs ([#3029](https://github.com/axios/axios/pull/3029)) + - prepare stale actions + - update messages + - Add exempt labels and lighten up comments +- Add GitHub actions to close invalid issues ([#3022](https://github.com/axios/axios/pull/3022)) + - add close actions + - fix with checkout + - update issue templates + - add reminder + - update close message +- Add test with Node.js 12 ([#2860](https://github.com/axios/axios/pull/2860)) + - test with Node.js 12 + - test with latest +- Adding console log on sandbox server startup ([#2210](https://github.com/axios/axios/pull/2210)) + - Adding console log on sandbox server startup + - Update server.js + Add server error handling + - Update server.js + Better error message, remove retry. +- Adding tests for method `options` type definitions ([#1996](https://github.com/axios/axios/pull/1996)) + Update tests. +- Add test for redirecting with too large response ([#2695](https://github.com/axios/axios/pull/2695)) +- Fixing unit test failure in Windows OS ([#2601](https://github.com/axios/axios/pull/2601)) +- Fixing issue for HEAD method and gzipped response ([#2666](https://github.com/axios/axios/pull/2666)) +- Fix tests in browsers ([#2748](https://github.com/axios/axios/pull/2748)) +- chore: add `jsdelivr` and `unpkg` support ([#2443](https://github.com/axios/axios/pull/2443)) + +Documentation: + +- Adding support for URLSearchParams in node ([#1900](https://github.com/axios/axios/pull/1900)) + - Adding support for URLSearchParams in node + - Remove un-needed code + - Update utils.js + - Make changes as suggested +- Adding table of content (preview) ([#3050](https://github.com/axios/axios/pull/3050)) + - add toc (preview) + - remove toc in toc + Signed-off-by: Moni + - fix sublinks + - fix indentation + - remove redundant table links + - update caps and indent + - remove axios +- Replace 'blacklist' with 'blocklist' ([#3006](https://github.com/axios/axios/pull/3006)) +- docs(): Detailed config options environment. ([#2088](https://github.com/axios/axios/pull/2088)) + - docs(): Detailed config options environment. + - Update README.md +- Include axios-data-unpacker in ECOSYSTEM.md ([#2080](https://github.com/axios/axios/pull/2080)) +- Allow opening examples in Gitpod ([#1958](https://github.com/axios/axios/pull/1958)) +- Remove axios.all() and axios.spread() from Readme.md ([#2727](https://github.com/axios/axios/pull/2727)) + - remove axios.all(), axios.spread() + - replace example + - axios.all() -> Promise.all() + - axios.spread(function (acct, perms)) -> function (acct, perms) + - add deprecated mark +- Update README.md ([#2887](https://github.com/axios/axios/pull/2887)) + Small change to the data attribute doc of the config. A request body can also be set for DELETE methods but this wasn't mentioned in the documentation (it only mentioned POST, PUT and PATCH). Took my some 10-20 minutes until I realized that I don't need to manipulate the request body with transformRequest in the case of DELETE. +- Include swagger-taxos-codegen in ECOSYSTEM.md ([#2162](https://github.com/axios/axios/pull/2162)) +- Add CDNJS version badge in README.md ([#878](https://github.com/axios/axios/pull/878)) + This badge will show the version on CDNJS! +- Documentation update to clear up ambiguity in code examples ([#2928](https://github.com/axios/axios/pull/2928)) + - Made an adjustment to the documentation to clear up any ambiguity around the use of "fs". This should help clear up that the code examples with "fs" cannot be used on the client side. +- Update README.md about validateStatus ([#2912](https://github.com/axios/axios/pull/2912)) + Rewrote the comment from "Reject only if the status code is greater than or equal to 500" to "Resolve only if the status code is less than 500" +- Updating documentation for usage form-data ([#2805](https://github.com/axios/axios/pull/2805)) + Closes #2049 +- Fixing CHANGELOG.md issue link ([#2784](https://github.com/axios/axios/pull/2784)) +- Include axios-hooks in ECOSYSTEM.md ([#2003](https://github.com/axios/axios/pull/2003)) +- Added Response header access instructions ([#1901](https://github.com/axios/axios/pull/1901)) + - Added Response header access instructions + - Added note about using bracket notation +- Add `onUploadProgress` and `onDownloadProgress` are browser only ([#2763](https://github.com/axios/axios/pull/2763)) + Saw in #928 and #1966 that `onUploadProgress` and `onDownloadProgress` only work in the browser and was missing that from the README. +- Update ' sign to ` in proxy spec ([#2778](https://github.com/axios/axios/pull/2778)) +- Adding jsDelivr link in README ([#1110](https://github.com/axios/axios/pull/1110)) + - Adding jsDelivr link + - Add SRI + - Remove SRI + +Huge thanks to everyone who contributed to this release via code (authors listed +below) or via reviews and triaging on GitHub: + +- Alan Wang +- Alexandru Ungureanu +- Anubhav Srivastava +- Benny Neugebauer +- Cr <631807682@qq.com> +- David +- David Ko +- David Tanner +- Emily Morehouse +- Felipe Martins +- Fonger <5862369+Fonger@users.noreply.github.com> +- Frostack +- George Cheng +- grumblerchester +- Gustavo López +- hexaez <45806662+hexaez@users.noreply.github.com> +- huangzuizui +- Ian Wijma +- Jay +- jeffjing +- jennynju <46782518+jennynju@users.noreply.github.com> +- Jimmy Liao <52391190+jimmy-liao-gogoro@users.noreply.github.com> +- Jonathan Sharpe +- JounQin +- Justin Beckwith +- Kamil Posiadała <3dcreator.pl@gmail.com> +- Lukas Drgon +- marcinx +- Martti Laine +- Michał Zarach +- Moni +- Motonori Iwata <121048+iwata@users.noreply.github.com> +- Nikita Galkin +- Petr Mares +- Philippe Recto +- Remco Haszing +- rockcs1992 +- Ryan Bown +- Samina Fu +- Simone Busoli +- Spencer von der Ohe +- Sven Efftinge +- Taegyeoung Oh +- Taemin Shin +- Thibault Ehrhart <1208424+ehrhart@users.noreply.github.com> +- Xianming Zhong +- Yasu Flores +- Zac Delventhal + +### 0.19.2 (Jan 20, 2020) + +- Remove unnecessary XSS check ([#2679](https://github.com/axios/axios/pull/2679)) (see ([#2646](https://github.com/axios/axios/issues/2646)) for discussion) + +### 0.19.1 (Jan 7, 2020) + +Fixes and Functionality: + +- Fixing invalid agent issue ([#1904](https://github.com/axios/axios/pull/1904)) +- Fix ignore set withCredentials false ([#2582](https://github.com/axios/axios/pull/2582)) +- Delete useless default to hash ([#2458](https://github.com/axios/axios/pull/2458)) +- Fix HTTP/HTTPs agents passing to follow-redirect ([#1904](https://github.com/axios/axios/pull/1904)) +- Fix ignore set withCredentials false ([#2582](https://github.com/axios/axios/pull/2582)) +- Fix CI build failure ([#2570](https://github.com/axios/axios/pull/2570)) +- Remove dependency on is-buffer from package.json ([#1816](https://github.com/axios/axios/pull/1816)) +- Adding options typings ([#2341](https://github.com/axios/axios/pull/2341)) +- Adding Typescript HTTP method definition for LINK and UNLINK. ([#2444](https://github.com/axios/axios/pull/2444)) +- Update dist with newest changes, fixes Custom Attributes issue +- Change syntax to see if build passes ([#2488](https://github.com/axios/axios/pull/2488)) +- Update Webpack + deps, remove now unnecessary polyfills ([#2410](https://github.com/axios/axios/pull/2410)) +- Fix to prevent XSS, throw an error when the URL contains a JS script ([#2464](https://github.com/axios/axios/pull/2464)) +- Add custom timeout error copy in config ([#2275](https://github.com/axios/axios/pull/2275)) +- Add error toJSON example ([#2466](https://github.com/axios/axios/pull/2466)) +- Fixing Vulnerability A Fortify Scan finds a critical Cross-Site Scrip… ([#2451](https://github.com/axios/axios/pull/2451)) +- Fixing subdomain handling on no_proxy ([#2442](https://github.com/axios/axios/pull/2442)) +- Make redirection from HTTP to HTTPS work ([#2426](https://github.com/axios/axios/pull/2426)) and ([#2547](https://github.com/axios/axios/pull/2547)) +- Add toJSON property to AxiosError type ([#2427](https://github.com/axios/axios/pull/2427)) +- Fixing socket hang up error on node side for slow response. ([#1752](https://github.com/axios/axios/pull/1752)) +- Alternative syntax to send data into the body ([#2317](https://github.com/axios/axios/pull/2317)) +- Fixing custom config options ([#2207](https://github.com/axios/axios/pull/2207)) +- Fixing set `config.method` after mergeConfig for Axios.prototype.request ([#2383](https://github.com/axios/axios/pull/2383)) +- Axios create url bug ([#2290](https://github.com/axios/axios/pull/2290)) +- Do not modify config.url when using a relative baseURL (resolves [#1628](https://github.com/axios/axios/issues/1098)) ([#2391](https://github.com/axios/axios/pull/2391)) + +Internal: + +- Revert "Update Webpack + deps, remove now unnecessary polyfills" ([#2479](https://github.com/axios/axios/pull/2479)) +- Order of if/else blocks is causing unit tests mocking XHR. ([#2201](https://github.com/axios/axios/pull/2201)) +- Add license badge ([#2446](https://github.com/axios/axios/pull/2446)) +- Fix travis CI build [#2386](https://github.com/axios/axios/pull/2386) +- Fix cancellation error on build master. #2290 #2207 ([#2407](https://github.com/axios/axios/pull/2407)) + +Documentation: + +- Fixing typo in CHANGELOG.md: s/Functionallity/Functionality ([#2639](https://github.com/axios/axios/pull/2639)) +- Fix badge, use master branch ([#2538](https://github.com/axios/axios/pull/2538)) +- Fix typo in changelog [#2193](https://github.com/axios/axios/pull/2193) +- Document fix ([#2514](https://github.com/axios/axios/pull/2514)) +- Update docs with no_proxy change, issue #2484 ([#2513](https://github.com/axios/axios/pull/2513)) +- Fixing missing words in docs template ([#2259](https://github.com/axios/axios/pull/2259)) +- 🐛Fix request finally documentation in README ([#2189](https://github.com/axios/axios/pull/2189)) +- updating spelling and adding link to docs ([#2212](https://github.com/axios/axios/pull/2212)) +- docs: minor tweak ([#2404](https://github.com/axios/axios/pull/2404)) +- Update response interceptor docs ([#2399](https://github.com/axios/axios/pull/2399)) +- Update README.md ([#2504](https://github.com/axios/axios/pull/2504)) +- Fix word 'sintaxe' to 'syntax' in README.md ([#2432](https://github.com/axios/axios/pull/2432)) +- updating README: notes on CommonJS autocomplete ([#2256](https://github.com/axios/axios/pull/2256)) +- Fix grammar in README.md ([#2271](https://github.com/axios/axios/pull/2271)) +- Doc fixes, minor examples cleanup ([#2198](https://github.com/axios/axios/pull/2198)) + +### 0.19.0 (May 30, 2019) + +Fixes and Functionality: + +- Added support for no_proxy env variable ([#1693](https://github.com/axios/axios/pull/1693/files)) - Chance Dickson +- Unzip response body only for statuses != 204 ([#1129](https://github.com/axios/axios/pull/1129)) - drawski +- Destroy stream on exceeding maxContentLength (fixes [#1098](https://github.com/axios/axios/issues/1098)) ([#1485](https://github.com/axios/axios/pull/1485)) - Gadzhi Gadzhiev +- Makes Axios error generic to use AxiosResponse ([#1738](https://github.com/axios/axios/pull/1738)) - Suman Lama +- Fixing Mocha tests by locking follow-redirects version to 1.5.10 ([#1993](https://github.com/axios/axios/pull/1993)) - grumblerchester +- Allow uppercase methods in typings. ([#1781](https://github.com/axios/axios/pull/1781)) - Ken Powers +- Fixing building url with hash mark ([#1771](https://github.com/axios/axios/pull/1771)) - Anatoly Ryabov +- This commit fix building url with hash map (fragment identifier) when parameters are present: they must not be added after `#`, because client cut everything after `#` +- Preserve HTTP method when following redirect ([#1758](https://github.com/axios/axios/pull/1758)) - Rikki Gibson +- Add `getUri` signature to TypeScript definition. ([#1736](https://github.com/axios/axios/pull/1736)) - Alexander Trauzzi +- Adding isAxiosError flag to errors thrown by axios ([#1419](https://github.com/axios/axios/pull/1419)) - Ayush Gupta + +Internal: + +- Fixing .eslintrc without extension ([#1789](https://github.com/axios/axios/pull/1789)) - Manoel +- Fix failing SauceLabs tests by updating configuration - Emily Morehouse +- Add issue templates - Emily Morehouse + +Documentation: + +- Consistent coding style in README ([#1787](https://github.com/axios/axios/pull/1787)) - Ali Servet Donmez +- Add information about auth parameter to README ([#2166](https://github.com/axios/axios/pull/2166)) - xlaguna +- Add DELETE to list of methods that allow data as a config option ([#2169](https://github.com/axios/axios/pull/2169)) - Daniela Borges Matos de Carvalho +- Update ECOSYSTEM.md - Add Axios Endpoints ([#2176](https://github.com/axios/axios/pull/2176)) - Renan +- Add r2curl in ECOSYSTEM ([#2141](https://github.com/axios/axios/pull/2141)) - 유용우 / CX +- Update README.md - Add instructions for installing with yarn ([#2036](https://github.com/axios/axios/pull/2036)) - Victor Hermes +- Fixing spacing for README.md ([#2066](https://github.com/axios/axios/pull/2066)) - Josh McCarty +- Update README.md. - Change `.then` to `.finally` in example code ([#2090](https://github.com/axios/axios/pull/2090)) - Omar Cai +- Clarify what values responseType can have in Node ([#2121](https://github.com/axios/axios/pull/2121)) - Tyler Breisacher +- docs(ECOSYSTEM): add axios-api-versioning ([#2020](https://github.com/axios/axios/pull/2020)) - Weffe +- It seems that `responseType: 'blob'` doesn't actually work in Node (when I tried using it, response.data was a string, not a Blob, since Node doesn't have Blobs), so this clarifies that this option should only be used in the browser +- Update README.md. - Add Querystring library note ([#1896](https://github.com/axios/axios/pull/1896)) - Dmitriy Eroshenko +- Add react-hooks-axios to Libraries section of ECOSYSTEM.md ([#1925](https://github.com/axios/axios/pull/1925)) - Cody Chan +- Clarify in README that default timeout is 0 (no timeout) ([#1750](https://github.com/axios/axios/pull/1750)) - Ben Standefer + +### 0.19.0-beta.1 (Aug 9, 2018) + +**NOTE:** This is a beta version of this release. There may be functionality that is broken in +certain browsers, though we suspect that builds are hanging and not erroring. See +https://saucelabs.com/u/axios for the most up-to-date information. + +New Functionality: + +- Add getUri method ([#1712](https://github.com/axios/axios/issues/1712)) +- Add support for no_proxy env variable ([#1693](https://github.com/axios/axios/issues/1693)) +- Add toJSON to decorated Axios errors to facilitate serialization ([#1625](https://github.com/axios/axios/issues/1625)) +- Add second then on axios call ([#1623](https://github.com/axios/axios/issues/1623)) +- Typings: allow custom return types +- Add option to specify character set in responses (with http adapter) + +Fixes: + +- Fix Keep defaults local to instance ([#385](https://github.com/axios/axios/issues/385)) +- Correctly catch exception in http test ([#1475](https://github.com/axios/axios/issues/1475)) +- Fix accept header normalization ([#1698](https://github.com/axios/axios/issues/1698)) +- Fix http adapter to allow HTTPS connections via HTTP ([#959](https://github.com/axios/axios/issues/959)) +- Fix Removes usage of deprecated Buffer constructor. ([#1555](https://github.com/axios/axios/issues/1555), [#1622](https://github.com/axios/axios/issues/1622)) +- Fix defaults to use httpAdapter if available ([#1285](https://github.com/axios/axios/issues/1285)) + - Fixing defaults to use httpAdapter if available + - Use a safer, cross-platform method to detect the Node environment +- Fix Reject promise if request is cancelled by the browser ([#537](https://github.com/axios/axios/issues/537)) +- [Typescript] Fix missing type parameters on delete/head methods +- [NS]: Send `false` flag isStandardBrowserEnv for Nativescript +- Fix missing type parameters on delete/head +- Fix Default method for an instance always overwritten by get +- Fix type error when socketPath option in AxiosRequestConfig +- Capture errors on request data streams +- Decorate resolve and reject to clear timeout in all cases + +Huge thanks to everyone who contributed to this release via code (authors listed +below) or via reviews and triaging on GitHub: + +- Andrew Scott +- Anthony Gauthier +- arpit +- ascott18 +- Benedikt Rötsch +- Chance Dickson +- Dave Stewart +- Deric Cain +- Guillaume Briday +- Jacob Wejendorp +- Jim Lynch +- johntron +- Justin Beckwith +- Justin Beckwith +- Khaled Garbaya +- Lim Jing Rong +- Mark van den Broek +- Martti Laine +- mattridley +- mattridley +- Nicolas Del Valle +- Nilegfx +- pbarbiero +- Rikki Gibson +- Sako Hartounian +- Shane Fitzpatrick +- Stephan Schneider +- Steven +- Tim Garthwaite +- Tim Johns +- Yutaro Miyazaki + +### 0.18.0 (Feb 19, 2018) + +- Adding support for UNIX Sockets when running with Node.js ([#1070](https://github.com/axios/axios/pull/1070)) +- Fixing typings ([#1177](https://github.com/axios/axios/pull/1177)): + - AxiosRequestConfig.proxy: allows type false + - AxiosProxyConfig: added auth field +- Adding function signature in AxiosInstance interface so AxiosInstance can be invoked ([#1192](https://github.com/axios/axios/pull/1192), [#1254](https://github.com/axios/axios/pull/1254)) +- Allowing maxContentLength to pass through to redirected calls as maxBodyLength in follow-redirects config ([#1287](https://github.com/axios/axios/pull/1287)) +- Fixing configuration when using an instance - method can now be set ([#1342](https://github.com/axios/axios/pull/1342)) + +### 0.17.1 (Nov 11, 2017) + +- Fixing issue with web workers ([#1160](https://github.com/axios/axios/pull/1160)) +- Allowing overriding transport ([#1080](https://github.com/axios/axios/pull/1080)) +- Updating TypeScript typings ([#1165](https://github.com/axios/axios/pull/1165), [#1125](https://github.com/axios/axios/pull/1125), [#1131](https://github.com/axios/axios/pull/1131)) + +### 0.17.0 (Oct 21, 2017) + +- **BREAKING** Fixing issue with `baseURL` and interceptors ([#950](https://github.com/axios/axios/pull/950)) +- **BREAKING** Improving handing of duplicate headers ([#874](https://github.com/axios/axios/pull/874)) +- Adding support for disabling proxies ([#691](https://github.com/axios/axios/pull/691)) +- Updating TypeScript typings with generic type parameters ([#1061](https://github.com/axios/axios/pull/1061)) + +### 0.16.2 (Jun 3, 2017) + +- Fixing issue with including `buffer` in bundle ([#887](https://github.com/axios/axios/pull/887)) +- Including underlying request in errors ([#830](https://github.com/axios/axios/pull/830)) +- Convert `method` to lowercase ([#930](https://github.com/axios/axios/pull/930)) + +### 0.16.1 (Apr 8, 2017) + +- Improving HTTP adapter to return last request in case of redirects ([#828](https://github.com/axios/axios/pull/828)) +- Updating `follow-redirects` dependency ([#829](https://github.com/axios/axios/pull/829)) +- Adding support for passing `Buffer` in node ([#773](https://github.com/axios/axios/pull/773)) + +### 0.16.0 (Mar 31, 2017) + +- **BREAKING** Removing `Promise` from axios typings in favor of built-in type declarations ([#480](https://github.com/axios/axios/issues/480)) +- Adding `options` shortcut method ([#461](https://github.com/axios/axios/pull/461)) +- Fixing issue with using `responseType: 'json'` in browsers incompatible with XHR Level 2 ([#654](https://github.com/axios/axios/pull/654)) +- Improving React Native detection ([#731](https://github.com/axios/axios/pull/731)) +- Fixing `combineURLs` to support empty `relativeURL` ([#581](https://github.com/axios/axios/pull/581)) +- Removing `PROTECTION_PREFIX` support ([#561](https://github.com/axios/axios/pull/561)) + +### 0.15.3 (Nov 27, 2016) + +- Fixing issue with custom instances and global defaults ([#443](https://github.com/axios/axios/issues/443)) +- Renaming `axios.d.ts` to `index.d.ts` ([#519](https://github.com/axios/axios/issues/519)) +- Adding `get`, `head`, and `delete` to `defaults.headers` ([#509](https://github.com/axios/axios/issues/509)) +- Fixing issue with `btoa` and IE ([#507](https://github.com/axios/axios/issues/507)) +- Adding support for proxy authentication ([#483](https://github.com/axios/axios/pull/483)) +- Improving HTTP adapter to use `http` protocol by default ([#493](https://github.com/axios/axios/pull/493)) +- Fixing proxy issues ([#491](https://github.com/axios/axios/pull/491)) + +### 0.15.2 (Oct 17, 2016) + +- Fixing issue with calling `cancel` after response has been received ([#482](https://github.com/axios/axios/issues/482)) + +### 0.15.1 (Oct 14, 2016) + +- Fixing issue with UMD ([#485](https://github.com/axios/axios/issues/485)) + +### 0.15.0 (Oct 10, 2016) + +- Adding cancellation support ([#452](https://github.com/axios/axios/pull/452)) +- Moving default adapter to global defaults ([#437](https://github.com/axios/axios/pull/437)) +- Fixing issue with `file` URI scheme ([#440](https://github.com/axios/axios/pull/440)) +- Fixing issue with `params` objects that have no prototype ([#445](https://github.com/axios/axios/pull/445)) + +### 0.14.0 (Aug 27, 2016) + +- **BREAKING** Updating TypeScript definitions ([#419](https://github.com/axios/axios/pull/419)) +- **BREAKING** Replacing `agent` option with `httpAgent` and `httpsAgent` ([#387](https://github.com/axios/axios/pull/387)) +- **BREAKING** Splitting `progress` event handlers into `onUploadProgress` and `onDownloadProgress` ([#423](https://github.com/axios/axios/pull/423)) +- Adding support for `http_proxy` and `https_proxy` environment variables ([#366](https://github.com/axios/axios/pull/366)) +- Fixing issue with `auth` config option and `Authorization` header ([#397](https://github.com/axios/axios/pull/397)) +- Don't set XSRF header if `xsrfCookieName` is `null` ([#406](https://github.com/axios/axios/pull/406)) + +### 0.13.1 (Jul 16, 2016) + +- Fixing issue with response data not being transformed on error ([#378](https://github.com/axios/axios/issues/378)) + +### 0.13.0 (Jul 13, 2016) + +- **BREAKING** Improved error handling ([#345](https://github.com/axios/axios/pull/345)) +- **BREAKING** Response transformer now invoked in dispatcher not adapter ([10eb238](https://github.com/axios/axios/commit/10eb23865101f9347570552c04e9d6211376e25e)) +- **BREAKING** Request adapters now return a `Promise` ([157efd5](https://github.com/axios/axios/commit/157efd5615890301824e3121cc6c9d2f9b21f94a)) +- Fixing issue with `withCredentials` not being overwritten ([#343](https://github.com/axios/axios/issues/343)) +- Fixing regression with request transformer being called before request interceptor ([#352](https://github.com/axios/axios/issues/352)) +- Fixing custom instance defaults ([#341](https://github.com/axios/axios/issues/341)) +- Fixing instances created from `axios.create` to have same API as default axios ([#217](https://github.com/axios/axios/issues/217)) + +### 0.12.0 (May 31, 2016) + +- Adding support for `URLSearchParams` ([#317](https://github.com/axios/axios/pull/317)) +- Adding `maxRedirects` option ([#307](https://github.com/axios/axios/pull/307)) + +### 0.11.1 (May 17, 2016) + +- Fixing IE CORS support ([#313](https://github.com/axios/axios/pull/313)) +- Fixing detection of `FormData` ([#325](https://github.com/axios/axios/pull/325)) +- Adding `Axios` class to exports ([#321](https://github.com/axios/axios/pull/321)) + +### 0.11.0 (Apr 26, 2016) + +- Adding support for Stream with HTTP adapter ([#296](https://github.com/axios/axios/pull/296)) +- Adding support for custom HTTP status code error ranges ([#308](https://github.com/axios/axios/pull/308)) +- Fixing issue with ArrayBuffer ([#299](https://github.com/axios/axios/pull/299)) + +### 0.10.0 (Apr 20, 2016) + +- Fixing issue with some requests sending `undefined` instead of `null` ([#250](https://github.com/axios/axios/pull/250)) +- Fixing basic auth for HTTP adapter ([#252](https://github.com/axios/axios/pull/252)) +- Fixing request timeout for XHR adapter ([#227](https://github.com/axios/axios/pull/227)) +- Fixing IE8 support by using `onreadystatechange` instead of `onload` ([#249](https://github.com/axios/axios/pull/249)) +- Fixing IE9 cross domain requests ([#251](https://github.com/axios/axios/pull/251)) +- Adding `maxContentLength` option ([#275](https://github.com/axios/axios/pull/275)) +- Fixing XHR support for WebWorker environment ([#279](https://github.com/axios/axios/pull/279)) +- Adding request instance to response ([#200](https://github.com/axios/axios/pull/200)) + +### 0.9.1 (Jan 24, 2016) + +- Improving handling of request timeout in node ([#124](https://github.com/axios/axios/issues/124)) +- Fixing network errors not rejecting ([#205](https://github.com/axios/axios/pull/205)) +- Fixing issue with IE rejecting on HTTP 204 ([#201](https://github.com/axios/axios/issues/201)) +- Fixing host/port when following redirects ([#198](https://github.com/axios/axios/pull/198)) + +### 0.9.0 (Jan 18, 2016) + +- Adding support for custom adapters +- Fixing Content-Type header being removed when data is false ([#195](https://github.com/axios/axios/pull/195)) +- Improving XDomainRequest implementation ([#185](https://github.com/axios/axios/pull/185)) +- Improving config merging and order of precedence ([#183](https://github.com/axios/axios/pull/183)) +- Fixing XDomainRequest support for only <= IE9 ([#182](https://github.com/axios/axios/pull/182)) + +### 0.8.1 (Dec 14, 2015) + +- Adding support for passing XSRF token for cross domain requests when using `withCredentials` ([#168](https://github.com/axios/axios/pull/168)) +- Fixing error with format of basic auth header ([#178](https://github.com/axios/axios/pull/173)) +- Fixing error with JSON payloads throwing `InvalidStateError` in some cases ([#174](https://github.com/axios/axios/pull/174)) + +### 0.8.0 (Dec 11, 2015) + +- Adding support for creating instances of axios ([#123](https://github.com/axios/axios/pull/123)) +- Fixing http adapter to use `Buffer` instead of `String` in case of `responseType === 'arraybuffer'` ([#128](https://github.com/axios/axios/pull/128)) +- Adding support for using custom parameter serializer with `paramsSerializer` option ([#121](https://github.com/axios/axios/pull/121)) +- Fixing issue in IE8 caused by `forEach` on `arguments` ([#127](https://github.com/axios/axios/pull/127)) +- Adding support for following redirects in node ([#146](https://github.com/axios/axios/pull/146)) +- Adding support for transparent decompression if `content-encoding` is set ([#149](https://github.com/axios/axios/pull/149)) +- Adding support for transparent XDomainRequest to handle cross domain requests in IE9 ([#140](https://github.com/axios/axios/pull/140)) +- Adding support for HTTP basic auth via Authorization header ([#167](https://github.com/axios/axios/pull/167)) +- Adding support for baseURL option ([#160](https://github.com/axios/axios/pull/160)) + +### 0.7.0 (Sep 29, 2015) + +- Fixing issue with minified bundle in IE8 ([#87](https://github.com/axios/axios/pull/87)) +- Adding support for passing agent in node ([#102](https://github.com/axios/axios/pull/102)) +- Adding support for returning result from `axios.spread` for chaining ([#106](https://github.com/axios/axios/pull/106)) +- Fixing typescript definition ([#105](https://github.com/axios/axios/pull/105)) +- Fixing default timeout config for node ([#112](https://github.com/axios/axios/pull/112)) +- Adding support for use in web workers, and react-native ([#70](https://github.com/axios/axios/issue/70)), ([#98](https://github.com/axios/axios/pull/98)) +- Adding support for fetch like API `axios(url[, config])` ([#116](https://github.com/axios/axios/issues/116)) + +### 0.6.0 (Sep 21, 2015) + +- Removing deprecated success/error aliases +- Fixing issue with array params not being properly encoded ([#49](https://github.com/axios/axios/pull/49)) +- Fixing issue with User-Agent getting overridden ([#69](https://github.com/axios/axios/issues/69)) +- Adding support for timeout config ([#56](https://github.com/axios/axios/issues/56)) +- Removing es6-promise dependency +- Fixing issue preventing `length` to be used as a parameter ([#91](https://github.com/axios/axios/pull/91)) +- Fixing issue with IE8 ([#85](https://github.com/axios/axios/pull/85)) +- Converting build to UMD + +### 0.5.4 (Apr 08, 2015) + +- Fixing issue with FormData not being sent ([#53](https://github.com/axios/axios/issues/53)) + +### 0.5.3 (Apr 07, 2015) + +- Using JSON.parse unconditionally when transforming response string ([#55](https://github.com/axios/axios/issues/55)) + +### 0.5.2 (Mar 13, 2015) + +- Adding support for `statusText` in response ([#46](https://github.com/axios/axios/issues/46)) + +### 0.5.1 (Mar 10, 2015) + +- Fixing issue using strict mode ([#45](https://github.com/axios/axios/issues/45)) +- Fixing issue with standalone build ([#47](https://github.com/axios/axios/issues/47)) + +### 0.5.0 (Jan 23, 2015) + +- Adding support for intercepetors ([#14](https://github.com/axios/axios/issues/14)) +- Updating es6-promise dependency + +### 0.4.2 (Dec 10, 2014) + +- Fixing issue with `Content-Type` when using `FormData` ([#22](https://github.com/axios/axios/issues/22)) +- Adding support for TypeScript ([#25](https://github.com/axios/axios/issues/25)) +- Fixing issue with standalone build ([#29](https://github.com/axios/axios/issues/29)) +- Fixing issue with verbs needing to be capitalized in some browsers ([#30](https://github.com/axios/axios/issues/30)) + +### 0.4.1 (Oct 15, 2014) + +- Adding error handling to request for node.js ([#18](https://github.com/axios/axios/issues/18)) + +### 0.4.0 (Oct 03, 2014) + +- Adding support for `ArrayBuffer` and `ArrayBufferView` ([#10](https://github.com/axios/axios/issues/10)) +- Adding support for utf-8 for node.js ([#13](https://github.com/axios/axios/issues/13)) +- Adding support for SSL for node.js ([#12](https://github.com/axios/axios/issues/12)) +- Fixing incorrect `Content-Type` header ([#9](https://github.com/axios/axios/issues/9)) +- Adding standalone build without bundled es6-promise ([#11](https://github.com/axios/axios/issues/11)) +- Deprecating `success`/`error` in favor of `then`/`catch` + +### 0.3.1 (Sep 16, 2014) + +- Fixing missing post body when using node.js ([#3](https://github.com/axios/axios/issues/3)) + +### 0.3.0 (Sep 16, 2014) + +- Fixing `success` and `error` to properly receive response data as individual arguments ([#8](https://github.com/axios/axios/issues/8)) +- Updating `then` and `catch` to receive response data as a single object ([#6](https://github.com/axios/axios/issues/6)) +- Fixing issue with `all` not working ([#7](https://github.com/axios/axios/issues/7)) + +### 0.2.2 (Sep 14, 2014) + +- Fixing bundling with browserify ([#4](https://github.com/axios/axios/issues/4)) + +### 0.2.1 (Sep 12, 2014) + +- Fixing build problem causing ridiculous file sizes + +### 0.2.0 (Sep 12, 2014) + +- Adding support for `all` and `spread` +- Adding support for node.js ([#1](https://github.com/axios/axios/issues/1)) + +### 0.1.0 (Aug 29, 2014) + +- Initial release diff --git a/node_modules/tod-api/node_modules/axios/LICENSE b/node_modules/tod-api/node_modules/axios/LICENSE new file mode 100644 index 000000000..d36c80ef2 --- /dev/null +++ b/node_modules/tod-api/node_modules/axios/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2014-present Matt Zabriskie + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/tod-api/node_modules/axios/README.md b/node_modules/tod-api/node_modules/axios/README.md new file mode 100644 index 000000000..b8c019a78 --- /dev/null +++ b/node_modules/tod-api/node_modules/axios/README.md @@ -0,0 +1,868 @@ +# axios + +[![npm version](https://img.shields.io/npm/v/axios.svg?style=flat-square)](https://www.npmjs.org/package/axios) +[![CDNJS](https://img.shields.io/cdnjs/v/axios.svg?style=flat-square)](https://cdnjs.com/libraries/axios) +![Build status](https://github.com/axios/axios/actions/workflows/ci.yml/badge.svg) +[![Gitpod Ready-to-Code](https://img.shields.io/badge/Gitpod-Ready--to--Code-blue?logo=gitpod)](https://gitpod.io/#https://github.com/axios/axios) +[![code coverage](https://img.shields.io/coveralls/mzabriskie/axios.svg?style=flat-square)](https://coveralls.io/r/mzabriskie/axios) +[![install size](https://packagephobia.now.sh/badge?p=axios)](https://packagephobia.now.sh/result?p=axios) +[![npm downloads](https://img.shields.io/npm/dm/axios.svg?style=flat-square)](http://npm-stat.com/charts.html?package=axios) +[![gitter chat](https://img.shields.io/gitter/room/mzabriskie/axios.svg?style=flat-square)](https://gitter.im/mzabriskie/axios) +[![code helpers](https://www.codetriage.com/axios/axios/badges/users.svg)](https://www.codetriage.com/axios/axios) + +Promise based HTTP client for the browser and node.js + +> New axios docs website: [click here](https://axios-http.com/) + +## Table of Contents + + - [Features](#features) + - [Browser Support](#browser-support) + - [Installing](#installing) + - [Example](#example) + - [Axios API](#axios-api) + - [Request method aliases](#request-method-aliases) + - [Concurrency (Deprecated)](#concurrency-deprecated) + - [Creating an instance](#creating-an-instance) + - [Instance methods](#instance-methods) + - [Request Config](#request-config) + - [Response Schema](#response-schema) + - [Config Defaults](#config-defaults) + - [Global axios defaults](#global-axios-defaults) + - [Custom instance defaults](#custom-instance-defaults) + - [Config order of precedence](#config-order-of-precedence) + - [Interceptors](#interceptors) + - [Handling Errors](#handling-errors) + - [Cancellation](#cancellation) + - [Using application/x-www-form-urlencoded format](#using-applicationx-www-form-urlencoded-format) + - [Browser](#browser) + - [Node.js](#nodejs) + - [Query string](#query-string) + - [Form data](#form-data) + - [Semver](#semver) + - [Promises](#promises) + - [TypeScript](#typescript) + - [Resources](#resources) + - [Credits](#credits) + - [License](#license) + +## Features + +- Make [XMLHttpRequests](https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest) from the browser +- Make [http](http://nodejs.org/api/http.html) requests from node.js +- Supports the [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) API +- Intercept request and response +- Transform request and response data +- Cancel requests +- Automatic transforms for JSON data +- Client side support for protecting against [XSRF](http://en.wikipedia.org/wiki/Cross-site_request_forgery) + +## Browser Support + +![Chrome](https://raw.github.com/alrra/browser-logos/master/src/chrome/chrome_48x48.png) | ![Firefox](https://raw.github.com/alrra/browser-logos/master/src/firefox/firefox_48x48.png) | ![Safari](https://raw.github.com/alrra/browser-logos/master/src/safari/safari_48x48.png) | ![Opera](https://raw.github.com/alrra/browser-logos/master/src/opera/opera_48x48.png) | ![Edge](https://raw.github.com/alrra/browser-logos/master/src/edge/edge_48x48.png) | ![IE](https://raw.github.com/alrra/browser-logos/master/src/archive/internet-explorer_9-11/internet-explorer_9-11_48x48.png) | +--- | --- | --- | --- | --- | --- | +Latest ✔ | Latest ✔ | Latest ✔ | Latest ✔ | Latest ✔ | 11 ✔ | + +[![Browser Matrix](https://saucelabs.com/open_sauce/build_matrix/axios.svg)](https://saucelabs.com/u/axios) + +## Installing + +Using npm: + +```bash +$ npm install axios +``` + +Using bower: + +```bash +$ bower install axios +``` + +Using yarn: + +```bash +$ yarn add axios +``` + +Using jsDelivr CDN: + +```html + +``` + +Using unpkg CDN: + +```html + +``` + +## Example + +### note: CommonJS usage +In order to gain the TypeScript typings (for intellisense / autocomplete) while using CommonJS imports with `require()` use the following approach: + +```js +const axios = require('axios').default; + +// axios. will now provide autocomplete and parameter typings +``` + +Performing a `GET` request + +```js +const axios = require('axios'); + +// Make a request for a user with a given ID +axios.get('/user?ID=12345') + .then(function (response) { + // handle success + console.log(response); + }) + .catch(function (error) { + // handle error + console.log(error); + }) + .then(function () { + // always executed + }); + +// Optionally the request above could also be done as +axios.get('/user', { + params: { + ID: 12345 + } + }) + .then(function (response) { + console.log(response); + }) + .catch(function (error) { + console.log(error); + }) + .then(function () { + // always executed + }); + +// Want to use async/await? Add the `async` keyword to your outer function/method. +async function getUser() { + try { + const response = await axios.get('/user?ID=12345'); + console.log(response); + } catch (error) { + console.error(error); + } +} +``` + +> **NOTE:** `async/await` is part of ECMAScript 2017 and is not supported in Internet +> Explorer and older browsers, so use with caution. + +Performing a `POST` request + +```js +axios.post('/user', { + firstName: 'Fred', + lastName: 'Flintstone' + }) + .then(function (response) { + console.log(response); + }) + .catch(function (error) { + console.log(error); + }); +``` + +Performing multiple concurrent requests + +```js +function getUserAccount() { + return axios.get('/user/12345'); +} + +function getUserPermissions() { + return axios.get('/user/12345/permissions'); +} + +Promise.all([getUserAccount(), getUserPermissions()]) + .then(function (results) { + const acct = results[0]; + const perm = results[1]; + }); +``` + +## axios API + +Requests can be made by passing the relevant config to `axios`. + +##### axios(config) + +```js +// Send a POST request +axios({ + method: 'post', + url: '/user/12345', + data: { + firstName: 'Fred', + lastName: 'Flintstone' + } +}); +``` + +```js +// GET request for remote image in node.js +axios({ + method: 'get', + url: 'http://bit.ly/2mTM3nY', + responseType: 'stream' +}) + .then(function (response) { + response.data.pipe(fs.createWriteStream('ada_lovelace.jpg')) + }); +``` + +##### axios(url[, config]) + +```js +// Send a GET request (default method) +axios('/user/12345'); +``` + +### Request method aliases + +For convenience aliases have been provided for all supported request methods. + +##### axios.request(config) +##### axios.get(url[, config]) +##### axios.delete(url[, config]) +##### axios.head(url[, config]) +##### axios.options(url[, config]) +##### axios.post(url[, data[, config]]) +##### axios.put(url[, data[, config]]) +##### axios.patch(url[, data[, config]]) + +###### NOTE +When using the alias methods `url`, `method`, and `data` properties don't need to be specified in config. + +### Concurrency (Deprecated) +Please use `Promise.all` to replace the below functions. + +Helper functions for dealing with concurrent requests. + +axios.all(iterable) +axios.spread(callback) + +### Creating an instance + +You can create a new instance of axios with a custom config. + +##### axios.create([config]) + +```js +const instance = axios.create({ + baseURL: 'https://some-domain.com/api/', + timeout: 1000, + headers: {'X-Custom-Header': 'foobar'} +}); +``` + +### Instance methods + +The available instance methods are listed below. The specified config will be merged with the instance config. + +##### axios#request(config) +##### axios#get(url[, config]) +##### axios#delete(url[, config]) +##### axios#head(url[, config]) +##### axios#options(url[, config]) +##### axios#post(url[, data[, config]]) +##### axios#put(url[, data[, config]]) +##### axios#patch(url[, data[, config]]) +##### axios#getUri([config]) + +## Request Config + +These are the available config options for making requests. Only the `url` is required. Requests will default to `GET` if `method` is not specified. + +```js +{ + // `url` is the server URL that will be used for the request + url: '/user', + + // `method` is the request method to be used when making the request + method: 'get', // default + + // `baseURL` will be prepended to `url` unless `url` is absolute. + // It can be convenient to set `baseURL` for an instance of axios to pass relative URLs + // to methods of that instance. + baseURL: 'https://some-domain.com/api/', + + // `transformRequest` allows changes to the request data before it is sent to the server + // This is only applicable for request methods 'PUT', 'POST', 'PATCH' and 'DELETE' + // The last function in the array must return a string or an instance of Buffer, ArrayBuffer, + // FormData or Stream + // You may modify the headers object. + transformRequest: [function (data, headers) { + // Do whatever you want to transform the data + + return data; + }], + + // `transformResponse` allows changes to the response data to be made before + // it is passed to then/catch + transformResponse: [function (data) { + // Do whatever you want to transform the data + + return data; + }], + + // `headers` are custom headers to be sent + headers: {'X-Requested-With': 'XMLHttpRequest'}, + + // `params` are the URL parameters to be sent with the request + // Must be a plain object or a URLSearchParams object + params: { + ID: 12345 + }, + + // `paramsSerializer` is an optional function in charge of serializing `params` + // (e.g. https://www.npmjs.com/package/qs, http://api.jquery.com/jquery.param/) + paramsSerializer: function (params) { + return Qs.stringify(params, {arrayFormat: 'brackets'}) + }, + + // `data` is the data to be sent as the request body + // Only applicable for request methods 'PUT', 'POST', 'DELETE , and 'PATCH' + // When no `transformRequest` is set, must be of one of the following types: + // - string, plain object, ArrayBuffer, ArrayBufferView, URLSearchParams + // - Browser only: FormData, File, Blob + // - Node only: Stream, Buffer + data: { + firstName: 'Fred' + }, + + // syntax alternative to send data into the body + // method post + // only the value is sent, not the key + data: 'Country=Brasil&City=Belo Horizonte', + + // `timeout` specifies the number of milliseconds before the request times out. + // If the request takes longer than `timeout`, the request will be aborted. + timeout: 1000, // default is `0` (no timeout) + + // `withCredentials` indicates whether or not cross-site Access-Control requests + // should be made using credentials + withCredentials: false, // default + + // `adapter` allows custom handling of requests which makes testing easier. + // Return a promise and supply a valid response (see lib/adapters/README.md). + adapter: function (config) { + /* ... */ + }, + + // `auth` indicates that HTTP Basic auth should be used, and supplies credentials. + // This will set an `Authorization` header, overwriting any existing + // `Authorization` custom headers you have set using `headers`. + // Please note that only HTTP Basic auth is configurable through this parameter. + // For Bearer tokens and such, use `Authorization` custom headers instead. + auth: { + username: 'janedoe', + password: 's00pers3cret' + }, + + // `responseType` indicates the type of data that the server will respond with + // options are: 'arraybuffer', 'document', 'json', 'text', 'stream' + // browser only: 'blob' + responseType: 'json', // default + + // `responseEncoding` indicates encoding to use for decoding responses (Node.js only) + // Note: Ignored for `responseType` of 'stream' or client-side requests + responseEncoding: 'utf8', // default + + // `xsrfCookieName` is the name of the cookie to use as a value for xsrf token + xsrfCookieName: 'XSRF-TOKEN', // default + + // `xsrfHeaderName` is the name of the http header that carries the xsrf token value + xsrfHeaderName: 'X-XSRF-TOKEN', // default + + // `onUploadProgress` allows handling of progress events for uploads + // browser only + onUploadProgress: function (progressEvent) { + // Do whatever you want with the native progress event + }, + + // `onDownloadProgress` allows handling of progress events for downloads + // browser only + onDownloadProgress: function (progressEvent) { + // Do whatever you want with the native progress event + }, + + // `maxContentLength` defines the max size of the http response content in bytes allowed in node.js + maxContentLength: 2000, + + // `maxBodyLength` (Node only option) defines the max size of the http request content in bytes allowed + maxBodyLength: 2000, + + // `validateStatus` defines whether to resolve or reject the promise for a given + // HTTP response status code. If `validateStatus` returns `true` (or is set to `null` + // or `undefined`), the promise will be resolved; otherwise, the promise will be + // rejected. + validateStatus: function (status) { + return status >= 200 && status < 300; // default + }, + + // `maxRedirects` defines the maximum number of redirects to follow in node.js. + // If set to 0, no redirects will be followed. + maxRedirects: 5, // default + + // `socketPath` defines a UNIX Socket to be used in node.js. + // e.g. '/var/run/docker.sock' to send requests to the docker daemon. + // Only either `socketPath` or `proxy` can be specified. + // If both are specified, `socketPath` is used. + socketPath: null, // default + + // `httpAgent` and `httpsAgent` define a custom agent to be used when performing http + // and https requests, respectively, in node.js. This allows options to be added like + // `keepAlive` that are not enabled by default. + httpAgent: new http.Agent({ keepAlive: true }), + httpsAgent: new https.Agent({ keepAlive: true }), + + // `proxy` defines the hostname, port, and protocol of the proxy server. + // You can also define your proxy using the conventional `http_proxy` and + // `https_proxy` environment variables. If you are using environment variables + // for your proxy configuration, you can also define a `no_proxy` environment + // variable as a comma-separated list of domains that should not be proxied. + // Use `false` to disable proxies, ignoring environment variables. + // `auth` indicates that HTTP Basic auth should be used to connect to the proxy, and + // supplies credentials. + // This will set an `Proxy-Authorization` header, overwriting any existing + // `Proxy-Authorization` custom headers you have set using `headers`. + // If the proxy server uses HTTPS, then you must set the protocol to `https`. + proxy: { + protocol: 'https', + host: '127.0.0.1', + port: 9000, + auth: { + username: 'mikeymike', + password: 'rapunz3l' + } + }, + + // `cancelToken` specifies a cancel token that can be used to cancel the request + // (see Cancellation section below for details) + cancelToken: new CancelToken(function (cancel) { + }), + + // `decompress` indicates whether or not the response body should be decompressed + // automatically. If set to `true` will also remove the 'content-encoding' header + // from the responses objects of all decompressed responses + // - Node only (XHR cannot turn off decompression) + decompress: true, // default + + // transitional options for backward compatibility that may be removed in the newer versions + transitional: { + // silent JSON parsing mode + // `true` - ignore JSON parsing errors and set response.data to null if parsing failed (old behaviour) + // `false` - throw SyntaxError if JSON parsing failed (Note: responseType must be set to 'json') + silentJSONParsing: true, // default value for the current Axios version + + // try to parse the response string as JSON even if `responseType` is not 'json' + forcedJSONParsing: true, + + // throw ETIMEDOUT error instead of generic ECONNABORTED on request timeouts + clarifyTimeoutError: false, + } +} +``` + +## Response Schema + +The response for a request contains the following information. + +```js +{ + // `data` is the response that was provided by the server + data: {}, + + // `status` is the HTTP status code from the server response + status: 200, + + // `statusText` is the HTTP status message from the server response + statusText: 'OK', + + // `headers` the HTTP headers that the server responded with + // All header names are lower cased and can be accessed using the bracket notation. + // Example: `response.headers['content-type']` + headers: {}, + + // `config` is the config that was provided to `axios` for the request + config: {}, + + // `request` is the request that generated this response + // It is the last ClientRequest instance in node.js (in redirects) + // and an XMLHttpRequest instance in the browser + request: {} +} +``` + +When using `then`, you will receive the response as follows: + +```js +axios.get('/user/12345') + .then(function (response) { + console.log(response.data); + console.log(response.status); + console.log(response.statusText); + console.log(response.headers); + console.log(response.config); + }); +``` + +When using `catch`, or passing a [rejection callback](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/then) as second parameter of `then`, the response will be available through the `error` object as explained in the [Handling Errors](#handling-errors) section. + +## Config Defaults + +You can specify config defaults that will be applied to every request. + +### Global axios defaults + +```js +axios.defaults.baseURL = 'https://api.example.com'; + +// Important: If axios is used with multiple domains, the AUTH_TOKEN will be sent to all of them. +// See below for an example using Custom instance defaults instead. +axios.defaults.headers.common['Authorization'] = AUTH_TOKEN; + +axios.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded'; +``` + +### Custom instance defaults + +```js +// Set config defaults when creating the instance +const instance = axios.create({ + baseURL: 'https://api.example.com' +}); + +// Alter defaults after instance has been created +instance.defaults.headers.common['Authorization'] = AUTH_TOKEN; +``` + +### Config order of precedence + +Config will be merged with an order of precedence. The order is library defaults found in [lib/defaults.js](https://github.com/axios/axios/blob/master/lib/defaults.js#L28), then `defaults` property of the instance, and finally `config` argument for the request. The latter will take precedence over the former. Here's an example. + +```js +// Create an instance using the config defaults provided by the library +// At this point the timeout config value is `0` as is the default for the library +const instance = axios.create(); + +// Override timeout default for the library +// Now all requests using this instance will wait 2.5 seconds before timing out +instance.defaults.timeout = 2500; + +// Override timeout for this request as it's known to take a long time +instance.get('/longRequest', { + timeout: 5000 +}); +``` + +## Interceptors + +You can intercept requests or responses before they are handled by `then` or `catch`. + +```js +// Add a request interceptor +axios.interceptors.request.use(function (config) { + // Do something before request is sent + return config; + }, function (error) { + // Do something with request error + return Promise.reject(error); + }); + +// Add a response interceptor +axios.interceptors.response.use(function (response) { + // Any status code that lie within the range of 2xx cause this function to trigger + // Do something with response data + return response; + }, function (error) { + // Any status codes that falls outside the range of 2xx cause this function to trigger + // Do something with response error + return Promise.reject(error); + }); +``` + +If you need to remove an interceptor later you can. + +```js +const myInterceptor = axios.interceptors.request.use(function () {/*...*/}); +axios.interceptors.request.eject(myInterceptor); +``` + +You can add interceptors to a custom instance of axios. + +```js +const instance = axios.create(); +instance.interceptors.request.use(function () {/*...*/}); +``` + +When you add request interceptors, they are presumed to be asynchronous by default. This can cause a delay +in the execution of your axios request when the main thread is blocked (a promise is created under the hood for +the interceptor and your request gets put on the bottom of the call stack). If your request interceptors are synchronous you can add a flag +to the options object that will tell axios to run the code synchronously and avoid any delays in request execution. + +```js +axios.interceptors.request.use(function (config) { + config.headers.test = 'I am only a header!'; + return config; +}, null, { synchronous: true }); +``` + +If you want to execute a particular interceptor based on a runtime check, +you can add a `runWhen` function to the options object. The interceptor will not be executed **if and only if** the return +of `runWhen` is `false`. The function will be called with the config +object (don't forget that you can bind your own arguments to it as well.) This can be handy when you have an +asynchronous request interceptor that only needs to run at certain times. + +```js +function onGetCall(config) { + return config.method === 'get'; +} +axios.interceptors.request.use(function (config) { + config.headers.test = 'special get headers'; + return config; +}, null, { runWhen: onGetCall }); +``` + +## Handling Errors + +```js +axios.get('/user/12345') + .catch(function (error) { + if (error.response) { + // The request was made and the server responded with a status code + // that falls out of the range of 2xx + console.log(error.response.data); + console.log(error.response.status); + console.log(error.response.headers); + } else if (error.request) { + // The request was made but no response was received + // `error.request` is an instance of XMLHttpRequest in the browser and an instance of + // http.ClientRequest in node.js + console.log(error.request); + } else { + // Something happened in setting up the request that triggered an Error + console.log('Error', error.message); + } + console.log(error.config); + }); +``` + +Using the `validateStatus` config option, you can define HTTP code(s) that should throw an error. + +```js +axios.get('/user/12345', { + validateStatus: function (status) { + return status < 500; // Resolve only if the status code is less than 500 + } +}) +``` + +Using `toJSON` you get an object with more information about the HTTP error. + +```js +axios.get('/user/12345') + .catch(function (error) { + console.log(error.toJSON()); + }); +``` + +## Cancellation + +You can cancel a request using a *cancel token*. + +> The axios cancel token API is based on the withdrawn [cancelable promises proposal](https://github.com/tc39/proposal-cancelable-promises). + +You can create a cancel token using the `CancelToken.source` factory as shown below: + +```js +const CancelToken = axios.CancelToken; +const source = CancelToken.source(); + +axios.get('/user/12345', { + cancelToken: source.token +}).catch(function (thrown) { + if (axios.isCancel(thrown)) { + console.log('Request canceled', thrown.message); + } else { + // handle error + } +}); + +axios.post('/user/12345', { + name: 'new name' +}, { + cancelToken: source.token +}) + +// cancel the request (the message parameter is optional) +source.cancel('Operation canceled by the user.'); +``` + +You can also create a cancel token by passing an executor function to the `CancelToken` constructor: + +```js +const CancelToken = axios.CancelToken; +let cancel; + +axios.get('/user/12345', { + cancelToken: new CancelToken(function executor(c) { + // An executor function receives a cancel function as a parameter + cancel = c; + }) +}); + +// cancel the request +cancel(); +``` + +> Note: you can cancel several requests with the same cancel token. +> If a cancellation token is already cancelled at the moment of starting an Axios request, then the request is cancelled immediately, without any attempts to make real request. + +## Using application/x-www-form-urlencoded format + +By default, axios serializes JavaScript objects to `JSON`. To send data in the `application/x-www-form-urlencoded` format instead, you can use one of the following options. + +### Browser + +In a browser, you can use the [`URLSearchParams`](https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams) API as follows: + +```js +const params = new URLSearchParams(); +params.append('param1', 'value1'); +params.append('param2', 'value2'); +axios.post('/foo', params); +``` + +> Note that `URLSearchParams` is not supported by all browsers (see [caniuse.com](http://www.caniuse.com/#feat=urlsearchparams)), but there is a [polyfill](https://github.com/WebReflection/url-search-params) available (make sure to polyfill the global environment). + +Alternatively, you can encode data using the [`qs`](https://github.com/ljharb/qs) library: + +```js +const qs = require('qs'); +axios.post('/foo', qs.stringify({ 'bar': 123 })); +``` + +Or in another way (ES6), + +```js +import qs from 'qs'; +const data = { 'bar': 123 }; +const options = { + method: 'POST', + headers: { 'content-type': 'application/x-www-form-urlencoded' }, + data: qs.stringify(data), + url, +}; +axios(options); +``` + +### Node.js + +#### Query string + +In node.js, you can use the [`querystring`](https://nodejs.org/api/querystring.html) module as follows: + +```js +const querystring = require('querystring'); +axios.post('http://something.com/', querystring.stringify({ foo: 'bar' })); +``` + +or ['URLSearchParams'](https://nodejs.org/api/url.html#url_class_urlsearchparams) from ['url module'](https://nodejs.org/api/url.html) as follows: + +```js +const url = require('url'); +const params = new url.URLSearchParams({ foo: 'bar' }); +axios.post('http://something.com/', params.toString()); +``` + +You can also use the [`qs`](https://github.com/ljharb/qs) library. + +###### NOTE +The `qs` library is preferable if you need to stringify nested objects, as the `querystring` method has known issues with that use case (https://github.com/nodejs/node-v0.x-archive/issues/1665). + +#### Form data + +In node.js, you can use the [`form-data`](https://github.com/form-data/form-data) library as follows: + +```js +const FormData = require('form-data'); + +const form = new FormData(); +form.append('my_field', 'my value'); +form.append('my_buffer', new Buffer(10)); +form.append('my_file', fs.createReadStream('/foo/bar.jpg')); + +axios.post('https://example.com', form, { headers: form.getHeaders() }) +``` + +Alternatively, use an interceptor: + +```js +axios.interceptors.request.use(config => { + if (config.data instanceof FormData) { + Object.assign(config.headers, config.data.getHeaders()); + } + return config; +}); +``` + +## Semver + +Until axios reaches a `1.0` release, breaking changes will be released with a new minor version. For example `0.5.1`, and `0.5.4` will have the same API, but `0.6.0` will have breaking changes. + +## Promises + +axios depends on a native ES6 Promise implementation to be [supported](http://caniuse.com/promises). +If your environment doesn't support ES6 Promises, you can [polyfill](https://github.com/jakearchibald/es6-promise). + +## TypeScript + +axios includes [TypeScript](http://typescriptlang.org) definitions and a type guard for axios errors. + +```typescript +let user: User = null; +try { + const { data } = await axios.get('/user?ID=12345'); + user = data.userDetails; +} catch (error) { + if (axios.isAxiosError(error)) { + handleAxiosError(error); + } else { + handleUnexpectedError(error); + } +} +``` + +## Online one-click setup + +You can use Gitpod an online IDE(which is free for Open Source) for contributing or running the examples online. + +[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/axios/axios/blob/master/examples/server.js) + + +## Resources + +* [Changelog](https://github.com/axios/axios/blob/master/CHANGELOG.md) +* [Upgrade Guide](https://github.com/axios/axios/blob/master/UPGRADE_GUIDE.md) +* [Ecosystem](https://github.com/axios/axios/blob/master/ECOSYSTEM.md) +* [Contributing Guide](https://github.com/axios/axios/blob/master/CONTRIBUTING.md) +* [Code of Conduct](https://github.com/axios/axios/blob/master/CODE_OF_CONDUCT.md) + +## Credits + +axios is heavily inspired by the [$http service](https://docs.angularjs.org/api/ng/service/$http) provided in [Angular](https://angularjs.org/). Ultimately axios is an effort to provide a standalone `$http`-like service for use outside of Angular. + +## License + +[MIT](LICENSE) diff --git a/node_modules/tod-api/node_modules/axios/SECURITY.md b/node_modules/tod-api/node_modules/axios/SECURITY.md new file mode 100644 index 000000000..353df9a2f --- /dev/null +++ b/node_modules/tod-api/node_modules/axios/SECURITY.md @@ -0,0 +1,5 @@ +# Security Policy + +## Reporting a Vulnerability + +Please report security issues to jasonsaayman@gmail.com diff --git a/node_modules/tod-api/node_modules/axios/UPGRADE_GUIDE.md b/node_modules/tod-api/node_modules/axios/UPGRADE_GUIDE.md new file mode 100644 index 000000000..745e80492 --- /dev/null +++ b/node_modules/tod-api/node_modules/axios/UPGRADE_GUIDE.md @@ -0,0 +1,162 @@ +# Upgrade Guide + +### 0.15.x -> 0.16.0 + +#### `Promise` Type Declarations + +The `Promise` type declarations have been removed from the axios typings in favor of the built-in type declarations. If you use axios in a TypeScript project that targets `ES5`, please make sure to include the `es2015.promise` lib. Please see [this post](https://blog.mariusschulz.com/2016/11/25/typescript-2-0-built-in-type-declarations) for details. + +### 0.13.x -> 0.14.0 + +#### TypeScript Definitions + +The axios TypeScript definitions have been updated to match the axios API and use the ES2015 module syntax. + +Please use the following `import` statement to import axios in TypeScript: + +```typescript +import axios from 'axios'; + +axios.get('/foo') + .then(response => console.log(response)) + .catch(error => console.log(error)); +``` + +#### `agent` Config Option + +The `agent` config option has been replaced with two new options: `httpAgent` and `httpsAgent`. Please use them instead. + +```js +{ + // Define a custom agent for HTTP + httpAgent: new http.Agent({ keepAlive: true }), + // Define a custom agent for HTTPS + httpsAgent: new https.Agent({ keepAlive: true }) +} +``` + +#### `progress` Config Option + +The `progress` config option has been replaced with the `onUploadProgress` and `onDownloadProgress` options. + +```js +{ + // Define a handler for upload progress events + onUploadProgress: function (progressEvent) { + // ... + }, + + // Define a handler for download progress events + onDownloadProgress: function (progressEvent) { + // ... + } +} +``` + +### 0.12.x -> 0.13.0 + +The `0.13.0` release contains several changes to custom adapters and error handling. + +#### Error Handling + +Previous to this release an error could either be a server response with bad status code or an actual `Error`. With this release Promise will always reject with an `Error`. In the case that a response was received, the `Error` will also include the response. + +```js +axios.get('/user/12345') + .catch((error) => { + console.log(error.message); + console.log(error.code); // Not always specified + console.log(error.config); // The config that was used to make the request + console.log(error.response); // Only available if response was received from the server + }); +``` + +#### Request Adapters + +This release changes a few things about how request adapters work. Please take note if you are using your own custom adapter. + +1. Response transformer is now called outside of adapter. +2. Request adapter returns a `Promise`. + +This means that you no longer need to invoke `transformData` on response data. You will also no longer receive `resolve` and `reject` as arguments in your adapter. + +Previous code: + +```js +function myAdapter(resolve, reject, config) { + var response = { + data: transformData( + responseData, + responseHeaders, + config.transformResponse + ), + status: request.status, + statusText: request.statusText, + headers: responseHeaders + }; + settle(resolve, reject, response); +} +``` + +New code: + +```js +function myAdapter(config) { + return new Promise(function (resolve, reject) { + var response = { + data: responseData, + status: request.status, + statusText: request.statusText, + headers: responseHeaders + }; + settle(resolve, reject, response); + }); +} +``` + +See the related commits for more details: +- [Response transformers](https://github.com/axios/axios/commit/10eb23865101f9347570552c04e9d6211376e25e) +- [Request adapter Promise](https://github.com/axios/axios/commit/157efd5615890301824e3121cc6c9d2f9b21f94a) + +### 0.5.x -> 0.6.0 + +The `0.6.0` release contains mostly bug fixes, but there are a couple things to be aware of when upgrading. + +#### ES6 Promise Polyfill + +Up until the `0.6.0` release ES6 `Promise` was being polyfilled using [es6-promise](https://github.com/jakearchibald/es6-promise). With this release, the polyfill has been removed, and you will need to supply it yourself if your environment needs it. + +```js +require('es6-promise').polyfill(); +var axios = require('axios'); +``` + +This will polyfill the global environment, and only needs to be done once. + +#### `axios.success`/`axios.error` + +The `success`, and `error` aliases were deprecated in [0.4.0](https://github.com/axios/axios/blob/master/CHANGELOG.md#040-oct-03-2014). As of this release they have been removed entirely. Instead please use `axios.then`, and `axios.catch` respectively. + +```js +axios.get('some/url') + .then(function (res) { + /* ... */ + }) + .catch(function (err) { + /* ... */ + }); +``` + +#### UMD + +Previous versions of axios shipped with an AMD, CommonJS, and Global build. This has all been rolled into a single UMD build. + +```js +// AMD +require(['bower_components/axios/dist/axios'], function (axios) { + /* ... */ +}); + +// CommonJS +var axios = require('axios/dist/axios'); +``` diff --git a/node_modules/tod-api/node_modules/axios/dist/axios.js b/node_modules/tod-api/node_modules/axios/dist/axios.js new file mode 100644 index 000000000..f25391064 --- /dev/null +++ b/node_modules/tod-api/node_modules/axios/dist/axios.js @@ -0,0 +1,2193 @@ +/* axios v0.21.4 | (c) 2021 by Matt Zabriskie */ +(function webpackUniversalModuleDefinition(root, factory) { + if(typeof exports === 'object' && typeof module === 'object') + module.exports = factory(); + else if(typeof define === 'function' && define.amd) + define([], factory); + else if(typeof exports === 'object') + exports["axios"] = factory(); + else + root["axios"] = factory(); +})(window, function() { +return /******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) { +/******/ return installedModules[moduleId].exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ i: moduleId, +/******/ l: false, +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __webpack_require__.c = installedModules; +/******/ +/******/ // define getter function for harmony exports +/******/ __webpack_require__.d = function(exports, name, getter) { +/******/ if(!__webpack_require__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); +/******/ } +/******/ }; +/******/ +/******/ // define __esModule on exports +/******/ __webpack_require__.r = function(exports) { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ +/******/ // create a fake namespace object +/******/ // mode & 1: value is a module id, require it +/******/ // mode & 2: merge all properties of value into the ns +/******/ // mode & 4: return value when already ns object +/******/ // mode & 8|1: behave like require +/******/ __webpack_require__.t = function(value, mode) { +/******/ if(mode & 1) value = __webpack_require__(value); +/******/ if(mode & 8) return value; +/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; +/******/ var ns = Object.create(null); +/******/ __webpack_require__.r(ns); +/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); +/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); +/******/ return ns; +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __webpack_require__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __webpack_require__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = ""; +/******/ +/******/ +/******/ // Load entry module and return exports +/******/ return __webpack_require__(__webpack_require__.s = "./index.js"); +/******/ }) +/************************************************************************/ +/******/ ({ + +/***/ "./index.js": +/*!******************!*\ + !*** ./index.js ***! + \******************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +module.exports = __webpack_require__(/*! ./lib/axios */ "./lib/axios.js"); + +/***/ }), + +/***/ "./lib/adapters/xhr.js": +/*!*****************************!*\ + !*** ./lib/adapters/xhr.js ***! + \*****************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var utils = __webpack_require__(/*! ./../utils */ "./lib/utils.js"); +var settle = __webpack_require__(/*! ./../core/settle */ "./lib/core/settle.js"); +var cookies = __webpack_require__(/*! ./../helpers/cookies */ "./lib/helpers/cookies.js"); +var buildURL = __webpack_require__(/*! ./../helpers/buildURL */ "./lib/helpers/buildURL.js"); +var buildFullPath = __webpack_require__(/*! ../core/buildFullPath */ "./lib/core/buildFullPath.js"); +var parseHeaders = __webpack_require__(/*! ./../helpers/parseHeaders */ "./lib/helpers/parseHeaders.js"); +var isURLSameOrigin = __webpack_require__(/*! ./../helpers/isURLSameOrigin */ "./lib/helpers/isURLSameOrigin.js"); +var createError = __webpack_require__(/*! ../core/createError */ "./lib/core/createError.js"); + +module.exports = function xhrAdapter(config) { + return new Promise(function dispatchXhrRequest(resolve, reject) { + var requestData = config.data; + var requestHeaders = config.headers; + var responseType = config.responseType; + + if (utils.isFormData(requestData)) { + delete requestHeaders['Content-Type']; // Let the browser set it + } + + var request = new XMLHttpRequest(); + + // HTTP basic authentication + if (config.auth) { + var username = config.auth.username || ''; + var password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : ''; + requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password); + } + + var fullPath = buildFullPath(config.baseURL, config.url); + request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true); + + // Set the request timeout in MS + request.timeout = config.timeout; + + function onloadend() { + if (!request) { + return; + } + // Prepare the response + var responseHeaders = 'getAllResponseHeaders' in request ? parseHeaders(request.getAllResponseHeaders()) : null; + var responseData = !responseType || responseType === 'text' || responseType === 'json' ? + request.responseText : request.response; + var response = { + data: responseData, + status: request.status, + statusText: request.statusText, + headers: responseHeaders, + config: config, + request: request + }; + + settle(resolve, reject, response); + + // Clean up request + request = null; + } + + if ('onloadend' in request) { + // Use onloadend if available + request.onloadend = onloadend; + } else { + // Listen for ready state to emulate onloadend + request.onreadystatechange = function handleLoad() { + if (!request || request.readyState !== 4) { + return; + } + + // The request errored out and we didn't get a response, this will be + // handled by onerror instead + // With one exception: request that using file: protocol, most browsers + // will return status as 0 even though it's a successful request + if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) { + return; + } + // readystate handler is calling before onerror or ontimeout handlers, + // so we should call onloadend on the next 'tick' + setTimeout(onloadend); + }; + } + + // Handle browser request cancellation (as opposed to a manual cancellation) + request.onabort = function handleAbort() { + if (!request) { + return; + } + + reject(createError('Request aborted', config, 'ECONNABORTED', request)); + + // Clean up request + request = null; + }; + + // Handle low level network errors + request.onerror = function handleError() { + // Real errors are hidden from us by the browser + // onerror should only fire if it's a network error + reject(createError('Network Error', config, null, request)); + + // Clean up request + request = null; + }; + + // Handle timeout + request.ontimeout = function handleTimeout() { + var timeoutErrorMessage = 'timeout of ' + config.timeout + 'ms exceeded'; + if (config.timeoutErrorMessage) { + timeoutErrorMessage = config.timeoutErrorMessage; + } + reject(createError( + timeoutErrorMessage, + config, + config.transitional && config.transitional.clarifyTimeoutError ? 'ETIMEDOUT' : 'ECONNABORTED', + request)); + + // Clean up request + request = null; + }; + + // Add xsrf header + // This is only done if running in a standard browser environment. + // Specifically not if we're in a web worker, or react-native. + if (utils.isStandardBrowserEnv()) { + // Add xsrf header + var xsrfValue = (config.withCredentials || isURLSameOrigin(fullPath)) && config.xsrfCookieName ? + cookies.read(config.xsrfCookieName) : + undefined; + + if (xsrfValue) { + requestHeaders[config.xsrfHeaderName] = xsrfValue; + } + } + + // Add headers to the request + if ('setRequestHeader' in request) { + utils.forEach(requestHeaders, function setRequestHeader(val, key) { + if (typeof requestData === 'undefined' && key.toLowerCase() === 'content-type') { + // Remove Content-Type if data is undefined + delete requestHeaders[key]; + } else { + // Otherwise add header to the request + request.setRequestHeader(key, val); + } + }); + } + + // Add withCredentials to request if needed + if (!utils.isUndefined(config.withCredentials)) { + request.withCredentials = !!config.withCredentials; + } + + // Add responseType to request if needed + if (responseType && responseType !== 'json') { + request.responseType = config.responseType; + } + + // Handle progress if needed + if (typeof config.onDownloadProgress === 'function') { + request.addEventListener('progress', config.onDownloadProgress); + } + + // Not all browsers support upload events + if (typeof config.onUploadProgress === 'function' && request.upload) { + request.upload.addEventListener('progress', config.onUploadProgress); + } + + if (config.cancelToken) { + // Handle cancellation + config.cancelToken.promise.then(function onCanceled(cancel) { + if (!request) { + return; + } + + request.abort(); + reject(cancel); + // Clean up request + request = null; + }); + } + + if (!requestData) { + requestData = null; + } + + // Send the request + request.send(requestData); + }); +}; + + +/***/ }), + +/***/ "./lib/axios.js": +/*!**********************!*\ + !*** ./lib/axios.js ***! + \**********************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var utils = __webpack_require__(/*! ./utils */ "./lib/utils.js"); +var bind = __webpack_require__(/*! ./helpers/bind */ "./lib/helpers/bind.js"); +var Axios = __webpack_require__(/*! ./core/Axios */ "./lib/core/Axios.js"); +var mergeConfig = __webpack_require__(/*! ./core/mergeConfig */ "./lib/core/mergeConfig.js"); +var defaults = __webpack_require__(/*! ./defaults */ "./lib/defaults.js"); + +/** + * Create an instance of Axios + * + * @param {Object} defaultConfig The default config for the instance + * @return {Axios} A new instance of Axios + */ +function createInstance(defaultConfig) { + var context = new Axios(defaultConfig); + var instance = bind(Axios.prototype.request, context); + + // Copy axios.prototype to instance + utils.extend(instance, Axios.prototype, context); + + // Copy context to instance + utils.extend(instance, context); + + return instance; +} + +// Create the default instance to be exported +var axios = createInstance(defaults); + +// Expose Axios class to allow class inheritance +axios.Axios = Axios; + +// Factory for creating new instances +axios.create = function create(instanceConfig) { + return createInstance(mergeConfig(axios.defaults, instanceConfig)); +}; + +// Expose Cancel & CancelToken +axios.Cancel = __webpack_require__(/*! ./cancel/Cancel */ "./lib/cancel/Cancel.js"); +axios.CancelToken = __webpack_require__(/*! ./cancel/CancelToken */ "./lib/cancel/CancelToken.js"); +axios.isCancel = __webpack_require__(/*! ./cancel/isCancel */ "./lib/cancel/isCancel.js"); + +// Expose all/spread +axios.all = function all(promises) { + return Promise.all(promises); +}; +axios.spread = __webpack_require__(/*! ./helpers/spread */ "./lib/helpers/spread.js"); + +// Expose isAxiosError +axios.isAxiosError = __webpack_require__(/*! ./helpers/isAxiosError */ "./lib/helpers/isAxiosError.js"); + +module.exports = axios; + +// Allow use of default import syntax in TypeScript +module.exports.default = axios; + + +/***/ }), + +/***/ "./lib/cancel/Cancel.js": +/*!******************************!*\ + !*** ./lib/cancel/Cancel.js ***! + \******************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +/** + * A `Cancel` is an object that is thrown when an operation is canceled. + * + * @class + * @param {string=} message The message. + */ +function Cancel(message) { + this.message = message; +} + +Cancel.prototype.toString = function toString() { + return 'Cancel' + (this.message ? ': ' + this.message : ''); +}; + +Cancel.prototype.__CANCEL__ = true; + +module.exports = Cancel; + + +/***/ }), + +/***/ "./lib/cancel/CancelToken.js": +/*!***********************************!*\ + !*** ./lib/cancel/CancelToken.js ***! + \***********************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var Cancel = __webpack_require__(/*! ./Cancel */ "./lib/cancel/Cancel.js"); + +/** + * A `CancelToken` is an object that can be used to request cancellation of an operation. + * + * @class + * @param {Function} executor The executor function. + */ +function CancelToken(executor) { + if (typeof executor !== 'function') { + throw new TypeError('executor must be a function.'); + } + + var resolvePromise; + this.promise = new Promise(function promiseExecutor(resolve) { + resolvePromise = resolve; + }); + + var token = this; + executor(function cancel(message) { + if (token.reason) { + // Cancellation has already been requested + return; + } + + token.reason = new Cancel(message); + resolvePromise(token.reason); + }); +} + +/** + * Throws a `Cancel` if cancellation has been requested. + */ +CancelToken.prototype.throwIfRequested = function throwIfRequested() { + if (this.reason) { + throw this.reason; + } +}; + +/** + * Returns an object that contains a new `CancelToken` and a function that, when called, + * cancels the `CancelToken`. + */ +CancelToken.source = function source() { + var cancel; + var token = new CancelToken(function executor(c) { + cancel = c; + }); + return { + token: token, + cancel: cancel + }; +}; + +module.exports = CancelToken; + + +/***/ }), + +/***/ "./lib/cancel/isCancel.js": +/*!********************************!*\ + !*** ./lib/cancel/isCancel.js ***! + \********************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +module.exports = function isCancel(value) { + return !!(value && value.__CANCEL__); +}; + + +/***/ }), + +/***/ "./lib/core/Axios.js": +/*!***************************!*\ + !*** ./lib/core/Axios.js ***! + \***************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var utils = __webpack_require__(/*! ./../utils */ "./lib/utils.js"); +var buildURL = __webpack_require__(/*! ../helpers/buildURL */ "./lib/helpers/buildURL.js"); +var InterceptorManager = __webpack_require__(/*! ./InterceptorManager */ "./lib/core/InterceptorManager.js"); +var dispatchRequest = __webpack_require__(/*! ./dispatchRequest */ "./lib/core/dispatchRequest.js"); +var mergeConfig = __webpack_require__(/*! ./mergeConfig */ "./lib/core/mergeConfig.js"); +var validator = __webpack_require__(/*! ../helpers/validator */ "./lib/helpers/validator.js"); + +var validators = validator.validators; +/** + * Create a new instance of Axios + * + * @param {Object} instanceConfig The default config for the instance + */ +function Axios(instanceConfig) { + this.defaults = instanceConfig; + this.interceptors = { + request: new InterceptorManager(), + response: new InterceptorManager() + }; +} + +/** + * Dispatch a request + * + * @param {Object} config The config specific for this request (merged with this.defaults) + */ +Axios.prototype.request = function request(config) { + /*eslint no-param-reassign:0*/ + // Allow for axios('example/url'[, config]) a la fetch API + if (typeof config === 'string') { + config = arguments[1] || {}; + config.url = arguments[0]; + } else { + config = config || {}; + } + + config = mergeConfig(this.defaults, config); + + // Set config.method + if (config.method) { + config.method = config.method.toLowerCase(); + } else if (this.defaults.method) { + config.method = this.defaults.method.toLowerCase(); + } else { + config.method = 'get'; + } + + var transitional = config.transitional; + + if (transitional !== undefined) { + validator.assertOptions(transitional, { + silentJSONParsing: validators.transitional(validators.boolean, '1.0.0'), + forcedJSONParsing: validators.transitional(validators.boolean, '1.0.0'), + clarifyTimeoutError: validators.transitional(validators.boolean, '1.0.0') + }, false); + } + + // filter out skipped interceptors + var requestInterceptorChain = []; + var synchronousRequestInterceptors = true; + this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) { + if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) { + return; + } + + synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous; + + requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected); + }); + + var responseInterceptorChain = []; + this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) { + responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected); + }); + + var promise; + + if (!synchronousRequestInterceptors) { + var chain = [dispatchRequest, undefined]; + + Array.prototype.unshift.apply(chain, requestInterceptorChain); + chain = chain.concat(responseInterceptorChain); + + promise = Promise.resolve(config); + while (chain.length) { + promise = promise.then(chain.shift(), chain.shift()); + } + + return promise; + } + + + var newConfig = config; + while (requestInterceptorChain.length) { + var onFulfilled = requestInterceptorChain.shift(); + var onRejected = requestInterceptorChain.shift(); + try { + newConfig = onFulfilled(newConfig); + } catch (error) { + onRejected(error); + break; + } + } + + try { + promise = dispatchRequest(newConfig); + } catch (error) { + return Promise.reject(error); + } + + while (responseInterceptorChain.length) { + promise = promise.then(responseInterceptorChain.shift(), responseInterceptorChain.shift()); + } + + return promise; +}; + +Axios.prototype.getUri = function getUri(config) { + config = mergeConfig(this.defaults, config); + return buildURL(config.url, config.params, config.paramsSerializer).replace(/^\?/, ''); +}; + +// Provide aliases for supported request methods +utils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) { + /*eslint func-names:0*/ + Axios.prototype[method] = function(url, config) { + return this.request(mergeConfig(config || {}, { + method: method, + url: url, + data: (config || {}).data + })); + }; +}); + +utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) { + /*eslint func-names:0*/ + Axios.prototype[method] = function(url, data, config) { + return this.request(mergeConfig(config || {}, { + method: method, + url: url, + data: data + })); + }; +}); + +module.exports = Axios; + + +/***/ }), + +/***/ "./lib/core/InterceptorManager.js": +/*!****************************************!*\ + !*** ./lib/core/InterceptorManager.js ***! + \****************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var utils = __webpack_require__(/*! ./../utils */ "./lib/utils.js"); + +function InterceptorManager() { + this.handlers = []; +} + +/** + * Add a new interceptor to the stack + * + * @param {Function} fulfilled The function to handle `then` for a `Promise` + * @param {Function} rejected The function to handle `reject` for a `Promise` + * + * @return {Number} An ID used to remove interceptor later + */ +InterceptorManager.prototype.use = function use(fulfilled, rejected, options) { + this.handlers.push({ + fulfilled: fulfilled, + rejected: rejected, + synchronous: options ? options.synchronous : false, + runWhen: options ? options.runWhen : null + }); + return this.handlers.length - 1; +}; + +/** + * Remove an interceptor from the stack + * + * @param {Number} id The ID that was returned by `use` + */ +InterceptorManager.prototype.eject = function eject(id) { + if (this.handlers[id]) { + this.handlers[id] = null; + } +}; + +/** + * Iterate over all the registered interceptors + * + * This method is particularly useful for skipping over any + * interceptors that may have become `null` calling `eject`. + * + * @param {Function} fn The function to call for each interceptor + */ +InterceptorManager.prototype.forEach = function forEach(fn) { + utils.forEach(this.handlers, function forEachHandler(h) { + if (h !== null) { + fn(h); + } + }); +}; + +module.exports = InterceptorManager; + + +/***/ }), + +/***/ "./lib/core/buildFullPath.js": +/*!***********************************!*\ + !*** ./lib/core/buildFullPath.js ***! + \***********************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var isAbsoluteURL = __webpack_require__(/*! ../helpers/isAbsoluteURL */ "./lib/helpers/isAbsoluteURL.js"); +var combineURLs = __webpack_require__(/*! ../helpers/combineURLs */ "./lib/helpers/combineURLs.js"); + +/** + * Creates a new URL by combining the baseURL with the requestedURL, + * only when the requestedURL is not already an absolute URL. + * If the requestURL is absolute, this function returns the requestedURL untouched. + * + * @param {string} baseURL The base URL + * @param {string} requestedURL Absolute or relative URL to combine + * @returns {string} The combined full path + */ +module.exports = function buildFullPath(baseURL, requestedURL) { + if (baseURL && !isAbsoluteURL(requestedURL)) { + return combineURLs(baseURL, requestedURL); + } + return requestedURL; +}; + + +/***/ }), + +/***/ "./lib/core/createError.js": +/*!*********************************!*\ + !*** ./lib/core/createError.js ***! + \*********************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var enhanceError = __webpack_require__(/*! ./enhanceError */ "./lib/core/enhanceError.js"); + +/** + * Create an Error with the specified message, config, error code, request and response. + * + * @param {string} message The error message. + * @param {Object} config The config. + * @param {string} [code] The error code (for example, 'ECONNABORTED'). + * @param {Object} [request] The request. + * @param {Object} [response] The response. + * @returns {Error} The created error. + */ +module.exports = function createError(message, config, code, request, response) { + var error = new Error(message); + return enhanceError(error, config, code, request, response); +}; + + +/***/ }), + +/***/ "./lib/core/dispatchRequest.js": +/*!*************************************!*\ + !*** ./lib/core/dispatchRequest.js ***! + \*************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var utils = __webpack_require__(/*! ./../utils */ "./lib/utils.js"); +var transformData = __webpack_require__(/*! ./transformData */ "./lib/core/transformData.js"); +var isCancel = __webpack_require__(/*! ../cancel/isCancel */ "./lib/cancel/isCancel.js"); +var defaults = __webpack_require__(/*! ../defaults */ "./lib/defaults.js"); + +/** + * Throws a `Cancel` if cancellation has been requested. + */ +function throwIfCancellationRequested(config) { + if (config.cancelToken) { + config.cancelToken.throwIfRequested(); + } +} + +/** + * Dispatch a request to the server using the configured adapter. + * + * @param {object} config The config that is to be used for the request + * @returns {Promise} The Promise to be fulfilled + */ +module.exports = function dispatchRequest(config) { + throwIfCancellationRequested(config); + + // Ensure headers exist + config.headers = config.headers || {}; + + // Transform request data + config.data = transformData.call( + config, + config.data, + config.headers, + config.transformRequest + ); + + // Flatten headers + config.headers = utils.merge( + config.headers.common || {}, + config.headers[config.method] || {}, + config.headers + ); + + utils.forEach( + ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'], + function cleanHeaderConfig(method) { + delete config.headers[method]; + } + ); + + var adapter = config.adapter || defaults.adapter; + + return adapter(config).then(function onAdapterResolution(response) { + throwIfCancellationRequested(config); + + // Transform response data + response.data = transformData.call( + config, + response.data, + response.headers, + config.transformResponse + ); + + return response; + }, function onAdapterRejection(reason) { + if (!isCancel(reason)) { + throwIfCancellationRequested(config); + + // Transform response data + if (reason && reason.response) { + reason.response.data = transformData.call( + config, + reason.response.data, + reason.response.headers, + config.transformResponse + ); + } + } + + return Promise.reject(reason); + }); +}; + + +/***/ }), + +/***/ "./lib/core/enhanceError.js": +/*!**********************************!*\ + !*** ./lib/core/enhanceError.js ***! + \**********************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +/** + * Update an Error with the specified config, error code, and response. + * + * @param {Error} error The error to update. + * @param {Object} config The config. + * @param {string} [code] The error code (for example, 'ECONNABORTED'). + * @param {Object} [request] The request. + * @param {Object} [response] The response. + * @returns {Error} The error. + */ +module.exports = function enhanceError(error, config, code, request, response) { + error.config = config; + if (code) { + error.code = code; + } + + error.request = request; + error.response = response; + error.isAxiosError = true; + + error.toJSON = function toJSON() { + return { + // Standard + message: this.message, + name: this.name, + // Microsoft + description: this.description, + number: this.number, + // Mozilla + fileName: this.fileName, + lineNumber: this.lineNumber, + columnNumber: this.columnNumber, + stack: this.stack, + // Axios + config: this.config, + code: this.code + }; + }; + return error; +}; + + +/***/ }), + +/***/ "./lib/core/mergeConfig.js": +/*!*********************************!*\ + !*** ./lib/core/mergeConfig.js ***! + \*********************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var utils = __webpack_require__(/*! ../utils */ "./lib/utils.js"); + +/** + * Config-specific merge-function which creates a new config-object + * by merging two configuration objects together. + * + * @param {Object} config1 + * @param {Object} config2 + * @returns {Object} New object resulting from merging config2 to config1 + */ +module.exports = function mergeConfig(config1, config2) { + // eslint-disable-next-line no-param-reassign + config2 = config2 || {}; + var config = {}; + + var valueFromConfig2Keys = ['url', 'method', 'data']; + var mergeDeepPropertiesKeys = ['headers', 'auth', 'proxy', 'params']; + var defaultToConfig2Keys = [ + 'baseURL', 'transformRequest', 'transformResponse', 'paramsSerializer', + 'timeout', 'timeoutMessage', 'withCredentials', 'adapter', 'responseType', 'xsrfCookieName', + 'xsrfHeaderName', 'onUploadProgress', 'onDownloadProgress', 'decompress', + 'maxContentLength', 'maxBodyLength', 'maxRedirects', 'transport', 'httpAgent', + 'httpsAgent', 'cancelToken', 'socketPath', 'responseEncoding' + ]; + var directMergeKeys = ['validateStatus']; + + function getMergedValue(target, source) { + if (utils.isPlainObject(target) && utils.isPlainObject(source)) { + return utils.merge(target, source); + } else if (utils.isPlainObject(source)) { + return utils.merge({}, source); + } else if (utils.isArray(source)) { + return source.slice(); + } + return source; + } + + function mergeDeepProperties(prop) { + if (!utils.isUndefined(config2[prop])) { + config[prop] = getMergedValue(config1[prop], config2[prop]); + } else if (!utils.isUndefined(config1[prop])) { + config[prop] = getMergedValue(undefined, config1[prop]); + } + } + + utils.forEach(valueFromConfig2Keys, function valueFromConfig2(prop) { + if (!utils.isUndefined(config2[prop])) { + config[prop] = getMergedValue(undefined, config2[prop]); + } + }); + + utils.forEach(mergeDeepPropertiesKeys, mergeDeepProperties); + + utils.forEach(defaultToConfig2Keys, function defaultToConfig2(prop) { + if (!utils.isUndefined(config2[prop])) { + config[prop] = getMergedValue(undefined, config2[prop]); + } else if (!utils.isUndefined(config1[prop])) { + config[prop] = getMergedValue(undefined, config1[prop]); + } + }); + + utils.forEach(directMergeKeys, function merge(prop) { + if (prop in config2) { + config[prop] = getMergedValue(config1[prop], config2[prop]); + } else if (prop in config1) { + config[prop] = getMergedValue(undefined, config1[prop]); + } + }); + + var axiosKeys = valueFromConfig2Keys + .concat(mergeDeepPropertiesKeys) + .concat(defaultToConfig2Keys) + .concat(directMergeKeys); + + var otherKeys = Object + .keys(config1) + .concat(Object.keys(config2)) + .filter(function filterAxiosKeys(key) { + return axiosKeys.indexOf(key) === -1; + }); + + utils.forEach(otherKeys, mergeDeepProperties); + + return config; +}; + + +/***/ }), + +/***/ "./lib/core/settle.js": +/*!****************************!*\ + !*** ./lib/core/settle.js ***! + \****************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var createError = __webpack_require__(/*! ./createError */ "./lib/core/createError.js"); + +/** + * Resolve or reject a Promise based on response status. + * + * @param {Function} resolve A function that resolves the promise. + * @param {Function} reject A function that rejects the promise. + * @param {object} response The response. + */ +module.exports = function settle(resolve, reject, response) { + var validateStatus = response.config.validateStatus; + if (!response.status || !validateStatus || validateStatus(response.status)) { + resolve(response); + } else { + reject(createError( + 'Request failed with status code ' + response.status, + response.config, + null, + response.request, + response + )); + } +}; + + +/***/ }), + +/***/ "./lib/core/transformData.js": +/*!***********************************!*\ + !*** ./lib/core/transformData.js ***! + \***********************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var utils = __webpack_require__(/*! ./../utils */ "./lib/utils.js"); +var defaults = __webpack_require__(/*! ./../defaults */ "./lib/defaults.js"); + +/** + * Transform the data for a request or a response + * + * @param {Object|String} data The data to be transformed + * @param {Array} headers The headers for the request or response + * @param {Array|Function} fns A single function or Array of functions + * @returns {*} The resulting transformed data + */ +module.exports = function transformData(data, headers, fns) { + var context = this || defaults; + /*eslint no-param-reassign:0*/ + utils.forEach(fns, function transform(fn) { + data = fn.call(context, data, headers); + }); + + return data; +}; + + +/***/ }), + +/***/ "./lib/defaults.js": +/*!*************************!*\ + !*** ./lib/defaults.js ***! + \*************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var utils = __webpack_require__(/*! ./utils */ "./lib/utils.js"); +var normalizeHeaderName = __webpack_require__(/*! ./helpers/normalizeHeaderName */ "./lib/helpers/normalizeHeaderName.js"); +var enhanceError = __webpack_require__(/*! ./core/enhanceError */ "./lib/core/enhanceError.js"); + +var DEFAULT_CONTENT_TYPE = { + 'Content-Type': 'application/x-www-form-urlencoded' +}; + +function setContentTypeIfUnset(headers, value) { + if (!utils.isUndefined(headers) && utils.isUndefined(headers['Content-Type'])) { + headers['Content-Type'] = value; + } +} + +function getDefaultAdapter() { + var adapter; + if (typeof XMLHttpRequest !== 'undefined') { + // For browsers use XHR adapter + adapter = __webpack_require__(/*! ./adapters/xhr */ "./lib/adapters/xhr.js"); + } else if (typeof process !== 'undefined' && Object.prototype.toString.call(process) === '[object process]') { + // For node use HTTP adapter + adapter = __webpack_require__(/*! ./adapters/http */ "./lib/adapters/xhr.js"); + } + return adapter; +} + +function stringifySafely(rawValue, parser, encoder) { + if (utils.isString(rawValue)) { + try { + (parser || JSON.parse)(rawValue); + return utils.trim(rawValue); + } catch (e) { + if (e.name !== 'SyntaxError') { + throw e; + } + } + } + + return (encoder || JSON.stringify)(rawValue); +} + +var defaults = { + + transitional: { + silentJSONParsing: true, + forcedJSONParsing: true, + clarifyTimeoutError: false + }, + + adapter: getDefaultAdapter(), + + transformRequest: [function transformRequest(data, headers) { + normalizeHeaderName(headers, 'Accept'); + normalizeHeaderName(headers, 'Content-Type'); + + if (utils.isFormData(data) || + utils.isArrayBuffer(data) || + utils.isBuffer(data) || + utils.isStream(data) || + utils.isFile(data) || + utils.isBlob(data) + ) { + return data; + } + if (utils.isArrayBufferView(data)) { + return data.buffer; + } + if (utils.isURLSearchParams(data)) { + setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8'); + return data.toString(); + } + if (utils.isObject(data) || (headers && headers['Content-Type'] === 'application/json')) { + setContentTypeIfUnset(headers, 'application/json'); + return stringifySafely(data); + } + return data; + }], + + transformResponse: [function transformResponse(data) { + var transitional = this.transitional; + var silentJSONParsing = transitional && transitional.silentJSONParsing; + var forcedJSONParsing = transitional && transitional.forcedJSONParsing; + var strictJSONParsing = !silentJSONParsing && this.responseType === 'json'; + + if (strictJSONParsing || (forcedJSONParsing && utils.isString(data) && data.length)) { + try { + return JSON.parse(data); + } catch (e) { + if (strictJSONParsing) { + if (e.name === 'SyntaxError') { + throw enhanceError(e, this, 'E_JSON_PARSE'); + } + throw e; + } + } + } + + return data; + }], + + /** + * A timeout in milliseconds to abort a request. If set to 0 (default) a + * timeout is not created. + */ + timeout: 0, + + xsrfCookieName: 'XSRF-TOKEN', + xsrfHeaderName: 'X-XSRF-TOKEN', + + maxContentLength: -1, + maxBodyLength: -1, + + validateStatus: function validateStatus(status) { + return status >= 200 && status < 300; + } +}; + +defaults.headers = { + common: { + 'Accept': 'application/json, text/plain, */*' + } +}; + +utils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) { + defaults.headers[method] = {}; +}); + +utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) { + defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE); +}); + +module.exports = defaults; + + +/***/ }), + +/***/ "./lib/helpers/bind.js": +/*!*****************************!*\ + !*** ./lib/helpers/bind.js ***! + \*****************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +module.exports = function bind(fn, thisArg) { + return function wrap() { + var args = new Array(arguments.length); + for (var i = 0; i < args.length; i++) { + args[i] = arguments[i]; + } + return fn.apply(thisArg, args); + }; +}; + + +/***/ }), + +/***/ "./lib/helpers/buildURL.js": +/*!*********************************!*\ + !*** ./lib/helpers/buildURL.js ***! + \*********************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var utils = __webpack_require__(/*! ./../utils */ "./lib/utils.js"); + +function encode(val) { + return encodeURIComponent(val). + replace(/%3A/gi, ':'). + replace(/%24/g, '$'). + replace(/%2C/gi, ','). + replace(/%20/g, '+'). + replace(/%5B/gi, '['). + replace(/%5D/gi, ']'); +} + +/** + * Build a URL by appending params to the end + * + * @param {string} url The base of the url (e.g., http://www.google.com) + * @param {object} [params] The params to be appended + * @returns {string} The formatted url + */ +module.exports = function buildURL(url, params, paramsSerializer) { + /*eslint no-param-reassign:0*/ + if (!params) { + return url; + } + + var serializedParams; + if (paramsSerializer) { + serializedParams = paramsSerializer(params); + } else if (utils.isURLSearchParams(params)) { + serializedParams = params.toString(); + } else { + var parts = []; + + utils.forEach(params, function serialize(val, key) { + if (val === null || typeof val === 'undefined') { + return; + } + + if (utils.isArray(val)) { + key = key + '[]'; + } else { + val = [val]; + } + + utils.forEach(val, function parseValue(v) { + if (utils.isDate(v)) { + v = v.toISOString(); + } else if (utils.isObject(v)) { + v = JSON.stringify(v); + } + parts.push(encode(key) + '=' + encode(v)); + }); + }); + + serializedParams = parts.join('&'); + } + + if (serializedParams) { + var hashmarkIndex = url.indexOf('#'); + if (hashmarkIndex !== -1) { + url = url.slice(0, hashmarkIndex); + } + + url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams; + } + + return url; +}; + + +/***/ }), + +/***/ "./lib/helpers/combineURLs.js": +/*!************************************!*\ + !*** ./lib/helpers/combineURLs.js ***! + \************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +/** + * Creates a new URL by combining the specified URLs + * + * @param {string} baseURL The base URL + * @param {string} relativeURL The relative URL + * @returns {string} The combined URL + */ +module.exports = function combineURLs(baseURL, relativeURL) { + return relativeURL + ? baseURL.replace(/\/+$/, '') + '/' + relativeURL.replace(/^\/+/, '') + : baseURL; +}; + + +/***/ }), + +/***/ "./lib/helpers/cookies.js": +/*!********************************!*\ + !*** ./lib/helpers/cookies.js ***! + \********************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var utils = __webpack_require__(/*! ./../utils */ "./lib/utils.js"); + +module.exports = ( + utils.isStandardBrowserEnv() ? + + // Standard browser envs support document.cookie + (function standardBrowserEnv() { + return { + write: function write(name, value, expires, path, domain, secure) { + var cookie = []; + cookie.push(name + '=' + encodeURIComponent(value)); + + if (utils.isNumber(expires)) { + cookie.push('expires=' + new Date(expires).toGMTString()); + } + + if (utils.isString(path)) { + cookie.push('path=' + path); + } + + if (utils.isString(domain)) { + cookie.push('domain=' + domain); + } + + if (secure === true) { + cookie.push('secure'); + } + + document.cookie = cookie.join('; '); + }, + + read: function read(name) { + var match = document.cookie.match(new RegExp('(^|;\\s*)(' + name + ')=([^;]*)')); + return (match ? decodeURIComponent(match[3]) : null); + }, + + remove: function remove(name) { + this.write(name, '', Date.now() - 86400000); + } + }; + })() : + + // Non standard browser env (web workers, react-native) lack needed support. + (function nonStandardBrowserEnv() { + return { + write: function write() {}, + read: function read() { return null; }, + remove: function remove() {} + }; + })() +); + + +/***/ }), + +/***/ "./lib/helpers/isAbsoluteURL.js": +/*!**************************************!*\ + !*** ./lib/helpers/isAbsoluteURL.js ***! + \**************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +/** + * Determines whether the specified URL is absolute + * + * @param {string} url The URL to test + * @returns {boolean} True if the specified URL is absolute, otherwise false + */ +module.exports = function isAbsoluteURL(url) { + // A URL is considered absolute if it begins with "://" or "//" (protocol-relative URL). + // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed + // by any combination of letters, digits, plus, period, or hyphen. + return /^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(url); +}; + + +/***/ }), + +/***/ "./lib/helpers/isAxiosError.js": +/*!*************************************!*\ + !*** ./lib/helpers/isAxiosError.js ***! + \*************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +/** + * Determines whether the payload is an error thrown by Axios + * + * @param {*} payload The value to test + * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false + */ +module.exports = function isAxiosError(payload) { + return (typeof payload === 'object') && (payload.isAxiosError === true); +}; + + +/***/ }), + +/***/ "./lib/helpers/isURLSameOrigin.js": +/*!****************************************!*\ + !*** ./lib/helpers/isURLSameOrigin.js ***! + \****************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var utils = __webpack_require__(/*! ./../utils */ "./lib/utils.js"); + +module.exports = ( + utils.isStandardBrowserEnv() ? + + // Standard browser envs have full support of the APIs needed to test + // whether the request URL is of the same origin as current location. + (function standardBrowserEnv() { + var msie = /(msie|trident)/i.test(navigator.userAgent); + var urlParsingNode = document.createElement('a'); + var originURL; + + /** + * Parse a URL to discover it's components + * + * @param {String} url The URL to be parsed + * @returns {Object} + */ + function resolveURL(url) { + var href = url; + + if (msie) { + // IE needs attribute set twice to normalize properties + urlParsingNode.setAttribute('href', href); + href = urlParsingNode.href; + } + + urlParsingNode.setAttribute('href', href); + + // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils + return { + href: urlParsingNode.href, + protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '', + host: urlParsingNode.host, + search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, '') : '', + hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '', + hostname: urlParsingNode.hostname, + port: urlParsingNode.port, + pathname: (urlParsingNode.pathname.charAt(0) === '/') ? + urlParsingNode.pathname : + '/' + urlParsingNode.pathname + }; + } + + originURL = resolveURL(window.location.href); + + /** + * Determine if a URL shares the same origin as the current location + * + * @param {String} requestURL The URL to test + * @returns {boolean} True if URL shares the same origin, otherwise false + */ + return function isURLSameOrigin(requestURL) { + var parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL; + return (parsed.protocol === originURL.protocol && + parsed.host === originURL.host); + }; + })() : + + // Non standard browser envs (web workers, react-native) lack needed support. + (function nonStandardBrowserEnv() { + return function isURLSameOrigin() { + return true; + }; + })() +); + + +/***/ }), + +/***/ "./lib/helpers/normalizeHeaderName.js": +/*!********************************************!*\ + !*** ./lib/helpers/normalizeHeaderName.js ***! + \********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var utils = __webpack_require__(/*! ../utils */ "./lib/utils.js"); + +module.exports = function normalizeHeaderName(headers, normalizedName) { + utils.forEach(headers, function processHeader(value, name) { + if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) { + headers[normalizedName] = value; + delete headers[name]; + } + }); +}; + + +/***/ }), + +/***/ "./lib/helpers/parseHeaders.js": +/*!*************************************!*\ + !*** ./lib/helpers/parseHeaders.js ***! + \*************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var utils = __webpack_require__(/*! ./../utils */ "./lib/utils.js"); + +// Headers whose duplicates are ignored by node +// c.f. https://nodejs.org/api/http.html#http_message_headers +var ignoreDuplicateOf = [ + 'age', 'authorization', 'content-length', 'content-type', 'etag', + 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since', + 'last-modified', 'location', 'max-forwards', 'proxy-authorization', + 'referer', 'retry-after', 'user-agent' +]; + +/** + * Parse headers into an object + * + * ``` + * Date: Wed, 27 Aug 2014 08:58:49 GMT + * Content-Type: application/json + * Connection: keep-alive + * Transfer-Encoding: chunked + * ``` + * + * @param {String} headers Headers needing to be parsed + * @returns {Object} Headers parsed into an object + */ +module.exports = function parseHeaders(headers) { + var parsed = {}; + var key; + var val; + var i; + + if (!headers) { return parsed; } + + utils.forEach(headers.split('\n'), function parser(line) { + i = line.indexOf(':'); + key = utils.trim(line.substr(0, i)).toLowerCase(); + val = utils.trim(line.substr(i + 1)); + + if (key) { + if (parsed[key] && ignoreDuplicateOf.indexOf(key) >= 0) { + return; + } + if (key === 'set-cookie') { + parsed[key] = (parsed[key] ? parsed[key] : []).concat([val]); + } else { + parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val; + } + } + }); + + return parsed; +}; + + +/***/ }), + +/***/ "./lib/helpers/spread.js": +/*!*******************************!*\ + !*** ./lib/helpers/spread.js ***! + \*******************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +/** + * Syntactic sugar for invoking a function and expanding an array for arguments. + * + * Common use case would be to use `Function.prototype.apply`. + * + * ```js + * function f(x, y, z) {} + * var args = [1, 2, 3]; + * f.apply(null, args); + * ``` + * + * With `spread` this example can be re-written. + * + * ```js + * spread(function(x, y, z) {})([1, 2, 3]); + * ``` + * + * @param {Function} callback + * @returns {Function} + */ +module.exports = function spread(callback) { + return function wrap(arr) { + return callback.apply(null, arr); + }; +}; + + +/***/ }), + +/***/ "./lib/helpers/validator.js": +/*!**********************************!*\ + !*** ./lib/helpers/validator.js ***! + \**********************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var pkg = __webpack_require__(/*! ./../../package.json */ "./package.json"); + +var validators = {}; + +// eslint-disable-next-line func-names +['object', 'boolean', 'number', 'function', 'string', 'symbol'].forEach(function(type, i) { + validators[type] = function validator(thing) { + return typeof thing === type || 'a' + (i < 1 ? 'n ' : ' ') + type; + }; +}); + +var deprecatedWarnings = {}; +var currentVerArr = pkg.version.split('.'); + +/** + * Compare package versions + * @param {string} version + * @param {string?} thanVersion + * @returns {boolean} + */ +function isOlderVersion(version, thanVersion) { + var pkgVersionArr = thanVersion ? thanVersion.split('.') : currentVerArr; + var destVer = version.split('.'); + for (var i = 0; i < 3; i++) { + if (pkgVersionArr[i] > destVer[i]) { + return true; + } else if (pkgVersionArr[i] < destVer[i]) { + return false; + } + } + return false; +} + +/** + * Transitional option validator + * @param {function|boolean?} validator + * @param {string?} version + * @param {string} message + * @returns {function} + */ +validators.transitional = function transitional(validator, version, message) { + var isDeprecated = version && isOlderVersion(version); + + function formatMessage(opt, desc) { + return '[Axios v' + pkg.version + '] Transitional option \'' + opt + '\'' + desc + (message ? '. ' + message : ''); + } + + // eslint-disable-next-line func-names + return function(value, opt, opts) { + if (validator === false) { + throw new Error(formatMessage(opt, ' has been removed in ' + version)); + } + + if (isDeprecated && !deprecatedWarnings[opt]) { + deprecatedWarnings[opt] = true; + // eslint-disable-next-line no-console + console.warn( + formatMessage( + opt, + ' has been deprecated since v' + version + ' and will be removed in the near future' + ) + ); + } + + return validator ? validator(value, opt, opts) : true; + }; +}; + +/** + * Assert object's properties type + * @param {object} options + * @param {object} schema + * @param {boolean?} allowUnknown + */ + +function assertOptions(options, schema, allowUnknown) { + if (typeof options !== 'object') { + throw new TypeError('options must be an object'); + } + var keys = Object.keys(options); + var i = keys.length; + while (i-- > 0) { + var opt = keys[i]; + var validator = schema[opt]; + if (validator) { + var value = options[opt]; + var result = value === undefined || validator(value, opt, options); + if (result !== true) { + throw new TypeError('option ' + opt + ' must be ' + result); + } + continue; + } + if (allowUnknown !== true) { + throw Error('Unknown option ' + opt); + } + } +} + +module.exports = { + isOlderVersion: isOlderVersion, + assertOptions: assertOptions, + validators: validators +}; + + +/***/ }), + +/***/ "./lib/utils.js": +/*!**********************!*\ + !*** ./lib/utils.js ***! + \**********************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var bind = __webpack_require__(/*! ./helpers/bind */ "./lib/helpers/bind.js"); + +// utils is a library of generic helper functions non-specific to axios + +var toString = Object.prototype.toString; + +/** + * Determine if a value is an Array + * + * @param {Object} val The value to test + * @returns {boolean} True if value is an Array, otherwise false + */ +function isArray(val) { + return toString.call(val) === '[object Array]'; +} + +/** + * Determine if a value is undefined + * + * @param {Object} val The value to test + * @returns {boolean} True if the value is undefined, otherwise false + */ +function isUndefined(val) { + return typeof val === 'undefined'; +} + +/** + * Determine if a value is a Buffer + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a Buffer, otherwise false + */ +function isBuffer(val) { + return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor) + && typeof val.constructor.isBuffer === 'function' && val.constructor.isBuffer(val); +} + +/** + * Determine if a value is an ArrayBuffer + * + * @param {Object} val The value to test + * @returns {boolean} True if value is an ArrayBuffer, otherwise false + */ +function isArrayBuffer(val) { + return toString.call(val) === '[object ArrayBuffer]'; +} + +/** + * Determine if a value is a FormData + * + * @param {Object} val The value to test + * @returns {boolean} True if value is an FormData, otherwise false + */ +function isFormData(val) { + return (typeof FormData !== 'undefined') && (val instanceof FormData); +} + +/** + * Determine if a value is a view on an ArrayBuffer + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false + */ +function isArrayBufferView(val) { + var result; + if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) { + result = ArrayBuffer.isView(val); + } else { + result = (val) && (val.buffer) && (val.buffer instanceof ArrayBuffer); + } + return result; +} + +/** + * Determine if a value is a String + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a String, otherwise false + */ +function isString(val) { + return typeof val === 'string'; +} + +/** + * Determine if a value is a Number + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a Number, otherwise false + */ +function isNumber(val) { + return typeof val === 'number'; +} + +/** + * Determine if a value is an Object + * + * @param {Object} val The value to test + * @returns {boolean} True if value is an Object, otherwise false + */ +function isObject(val) { + return val !== null && typeof val === 'object'; +} + +/** + * Determine if a value is a plain Object + * + * @param {Object} val The value to test + * @return {boolean} True if value is a plain Object, otherwise false + */ +function isPlainObject(val) { + if (toString.call(val) !== '[object Object]') { + return false; + } + + var prototype = Object.getPrototypeOf(val); + return prototype === null || prototype === Object.prototype; +} + +/** + * Determine if a value is a Date + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a Date, otherwise false + */ +function isDate(val) { + return toString.call(val) === '[object Date]'; +} + +/** + * Determine if a value is a File + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a File, otherwise false + */ +function isFile(val) { + return toString.call(val) === '[object File]'; +} + +/** + * Determine if a value is a Blob + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a Blob, otherwise false + */ +function isBlob(val) { + return toString.call(val) === '[object Blob]'; +} + +/** + * Determine if a value is a Function + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a Function, otherwise false + */ +function isFunction(val) { + return toString.call(val) === '[object Function]'; +} + +/** + * Determine if a value is a Stream + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a Stream, otherwise false + */ +function isStream(val) { + return isObject(val) && isFunction(val.pipe); +} + +/** + * Determine if a value is a URLSearchParams object + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a URLSearchParams object, otherwise false + */ +function isURLSearchParams(val) { + return typeof URLSearchParams !== 'undefined' && val instanceof URLSearchParams; +} + +/** + * Trim excess whitespace off the beginning and end of a string + * + * @param {String} str The String to trim + * @returns {String} The String freed of excess whitespace + */ +function trim(str) { + return str.trim ? str.trim() : str.replace(/^\s+|\s+$/g, ''); +} + +/** + * Determine if we're running in a standard browser environment + * + * This allows axios to run in a web worker, and react-native. + * Both environments support XMLHttpRequest, but not fully standard globals. + * + * web workers: + * typeof window -> undefined + * typeof document -> undefined + * + * react-native: + * navigator.product -> 'ReactNative' + * nativescript + * navigator.product -> 'NativeScript' or 'NS' + */ +function isStandardBrowserEnv() { + if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' || + navigator.product === 'NativeScript' || + navigator.product === 'NS')) { + return false; + } + return ( + typeof window !== 'undefined' && + typeof document !== 'undefined' + ); +} + +/** + * Iterate over an Array or an Object invoking a function for each item. + * + * If `obj` is an Array callback will be called passing + * the value, index, and complete array for each item. + * + * If 'obj' is an Object callback will be called passing + * the value, key, and complete object for each property. + * + * @param {Object|Array} obj The object to iterate + * @param {Function} fn The callback to invoke for each item + */ +function forEach(obj, fn) { + // Don't bother if no value provided + if (obj === null || typeof obj === 'undefined') { + return; + } + + // Force an array if not already something iterable + if (typeof obj !== 'object') { + /*eslint no-param-reassign:0*/ + obj = [obj]; + } + + if (isArray(obj)) { + // Iterate over array values + for (var i = 0, l = obj.length; i < l; i++) { + fn.call(null, obj[i], i, obj); + } + } else { + // Iterate over object keys + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) { + fn.call(null, obj[key], key, obj); + } + } + } +} + +/** + * Accepts varargs expecting each argument to be an object, then + * immutably merges the properties of each object and returns result. + * + * When multiple objects contain the same key the later object in + * the arguments list will take precedence. + * + * Example: + * + * ```js + * var result = merge({foo: 123}, {foo: 456}); + * console.log(result.foo); // outputs 456 + * ``` + * + * @param {Object} obj1 Object to merge + * @returns {Object} Result of all merge properties + */ +function merge(/* obj1, obj2, obj3, ... */) { + var result = {}; + function assignValue(val, key) { + if (isPlainObject(result[key]) && isPlainObject(val)) { + result[key] = merge(result[key], val); + } else if (isPlainObject(val)) { + result[key] = merge({}, val); + } else if (isArray(val)) { + result[key] = val.slice(); + } else { + result[key] = val; + } + } + + for (var i = 0, l = arguments.length; i < l; i++) { + forEach(arguments[i], assignValue); + } + return result; +} + +/** + * Extends object a by mutably adding to it the properties of object b. + * + * @param {Object} a The object to be extended + * @param {Object} b The object to copy properties from + * @param {Object} thisArg The object to bind function to + * @return {Object} The resulting value of object a + */ +function extend(a, b, thisArg) { + forEach(b, function assignValue(val, key) { + if (thisArg && typeof val === 'function') { + a[key] = bind(val, thisArg); + } else { + a[key] = val; + } + }); + return a; +} + +/** + * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM) + * + * @param {string} content with BOM + * @return {string} content value without BOM + */ +function stripBOM(content) { + if (content.charCodeAt(0) === 0xFEFF) { + content = content.slice(1); + } + return content; +} + +module.exports = { + isArray: isArray, + isArrayBuffer: isArrayBuffer, + isBuffer: isBuffer, + isFormData: isFormData, + isArrayBufferView: isArrayBufferView, + isString: isString, + isNumber: isNumber, + isObject: isObject, + isPlainObject: isPlainObject, + isUndefined: isUndefined, + isDate: isDate, + isFile: isFile, + isBlob: isBlob, + isFunction: isFunction, + isStream: isStream, + isURLSearchParams: isURLSearchParams, + isStandardBrowserEnv: isStandardBrowserEnv, + forEach: forEach, + merge: merge, + extend: extend, + trim: trim, + stripBOM: stripBOM +}; + + +/***/ }), + +/***/ "./package.json": +/*!**********************!*\ + !*** ./package.json ***! + \**********************/ +/*! exports provided: name, version, description, main, scripts, repository, keywords, author, license, bugs, homepage, devDependencies, browser, jsdelivr, unpkg, typings, dependencies, bundlesize, default */ +/***/ (function(module) { + +module.exports = JSON.parse("{\"name\":\"axios\",\"version\":\"0.21.4\",\"description\":\"Promise based HTTP client for the browser and node.js\",\"main\":\"index.js\",\"scripts\":{\"test\":\"grunt test\",\"start\":\"node ./sandbox/server.js\",\"build\":\"NODE_ENV=production grunt build\",\"preversion\":\"npm test\",\"version\":\"npm run build && grunt version && git add -A dist && git add CHANGELOG.md bower.json package.json\",\"postversion\":\"git push && git push --tags\",\"examples\":\"node ./examples/server.js\",\"coveralls\":\"cat coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js\",\"fix\":\"eslint --fix lib/**/*.js\"},\"repository\":{\"type\":\"git\",\"url\":\"https://github.com/axios/axios.git\"},\"keywords\":[\"xhr\",\"http\",\"ajax\",\"promise\",\"node\"],\"author\":\"Matt Zabriskie\",\"license\":\"MIT\",\"bugs\":{\"url\":\"https://github.com/axios/axios/issues\"},\"homepage\":\"https://axios-http.com\",\"devDependencies\":{\"coveralls\":\"^3.0.0\",\"es6-promise\":\"^4.2.4\",\"grunt\":\"^1.3.0\",\"grunt-banner\":\"^0.6.0\",\"grunt-cli\":\"^1.2.0\",\"grunt-contrib-clean\":\"^1.1.0\",\"grunt-contrib-watch\":\"^1.0.0\",\"grunt-eslint\":\"^23.0.0\",\"grunt-karma\":\"^4.0.0\",\"grunt-mocha-test\":\"^0.13.3\",\"grunt-ts\":\"^6.0.0-beta.19\",\"grunt-webpack\":\"^4.0.2\",\"istanbul-instrumenter-loader\":\"^1.0.0\",\"jasmine-core\":\"^2.4.1\",\"karma\":\"^6.3.2\",\"karma-chrome-launcher\":\"^3.1.0\",\"karma-firefox-launcher\":\"^2.1.0\",\"karma-jasmine\":\"^1.1.1\",\"karma-jasmine-ajax\":\"^0.1.13\",\"karma-safari-launcher\":\"^1.0.0\",\"karma-sauce-launcher\":\"^4.3.6\",\"karma-sinon\":\"^1.0.5\",\"karma-sourcemap-loader\":\"^0.3.8\",\"karma-webpack\":\"^4.0.2\",\"load-grunt-tasks\":\"^3.5.2\",\"minimist\":\"^1.2.0\",\"mocha\":\"^8.2.1\",\"sinon\":\"^4.5.0\",\"terser-webpack-plugin\":\"^4.2.3\",\"typescript\":\"^4.0.5\",\"url-search-params\":\"^0.10.0\",\"webpack\":\"^4.44.2\",\"webpack-dev-server\":\"^3.11.0\"},\"browser\":{\"./lib/adapters/http.js\":\"./lib/adapters/xhr.js\"},\"jsdelivr\":\"dist/axios.min.js\",\"unpkg\":\"dist/axios.min.js\",\"typings\":\"./index.d.ts\",\"dependencies\":{\"follow-redirects\":\"^1.14.0\"},\"bundlesize\":[{\"path\":\"./dist/axios.min.js\",\"threshold\":\"5kB\"}]}"); + +/***/ }) + +/******/ }); +}); +//# sourceMappingURL=axios.map \ No newline at end of file diff --git a/node_modules/tod-api/node_modules/axios/dist/axios.map b/node_modules/tod-api/node_modules/axios/dist/axios.map new file mode 100644 index 000000000..4aadb219e --- /dev/null +++ b/node_modules/tod-api/node_modules/axios/dist/axios.map @@ -0,0 +1 @@ +{"version":3,"sources":["webpack://axios/webpack/universalModuleDefinition","webpack://axios/webpack/bootstrap","webpack://axios/./index.js","webpack://axios/./lib/adapters/xhr.js","webpack://axios/./lib/axios.js","webpack://axios/./lib/cancel/Cancel.js","webpack://axios/./lib/cancel/CancelToken.js","webpack://axios/./lib/cancel/isCancel.js","webpack://axios/./lib/core/Axios.js","webpack://axios/./lib/core/InterceptorManager.js","webpack://axios/./lib/core/buildFullPath.js","webpack://axios/./lib/core/createError.js","webpack://axios/./lib/core/dispatchRequest.js","webpack://axios/./lib/core/enhanceError.js","webpack://axios/./lib/core/mergeConfig.js","webpack://axios/./lib/core/settle.js","webpack://axios/./lib/core/transformData.js","webpack://axios/./lib/defaults.js","webpack://axios/./lib/helpers/bind.js","webpack://axios/./lib/helpers/buildURL.js","webpack://axios/./lib/helpers/combineURLs.js","webpack://axios/./lib/helpers/cookies.js","webpack://axios/./lib/helpers/isAbsoluteURL.js","webpack://axios/./lib/helpers/isAxiosError.js","webpack://axios/./lib/helpers/isURLSameOrigin.js","webpack://axios/./lib/helpers/normalizeHeaderName.js","webpack://axios/./lib/helpers/parseHeaders.js","webpack://axios/./lib/helpers/spread.js","webpack://axios/./lib/helpers/validator.js","webpack://axios/./lib/utils.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,O;QCVA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA,0CAA0C,gCAAgC;QAC1E;QACA;;QAEA;QACA;QACA;QACA,wDAAwD,kBAAkB;QAC1E;QACA,iDAAiD,cAAc;QAC/D;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA,yCAAyC,iCAAiC;QAC1E,gHAAgH,mBAAmB,EAAE;QACrI;QACA;;QAEA;QACA;QACA;QACA,2BAA2B,0BAA0B,EAAE;QACvD,iCAAiC,eAAe;QAChD;QACA;QACA;;QAEA;QACA,sDAAsD,+DAA+D;;QAErH;QACA;;;QAGA;QACA;;;;;;;;;;;;AClFA,iBAAiB,mBAAO,CAAC,mCAAa,E;;;;;;;;;;;;ACAzB;;AAEb,YAAY,mBAAO,CAAC,kCAAY;AAChC,aAAa,mBAAO,CAAC,8CAAkB;AACvC,cAAc,mBAAO,CAAC,sDAAsB;AAC5C,eAAe,mBAAO,CAAC,wDAAuB;AAC9C,oBAAoB,mBAAO,CAAC,0DAAuB;AACnD,mBAAmB,mBAAO,CAAC,gEAA2B;AACtD,sBAAsB,mBAAO,CAAC,sEAA8B;AAC5D,kBAAkB,mBAAO,CAAC,sDAAqB;;AAE/C;AACA;AACA;AACA;AACA;;AAEA;AACA,4CAA4C;AAC5C;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;;;;;;;;;;;;;AC5La;;AAEb,YAAY,mBAAO,CAAC,+BAAS;AAC7B,WAAW,mBAAO,CAAC,6CAAgB;AACnC,YAAY,mBAAO,CAAC,yCAAc;AAClC,kBAAkB,mBAAO,CAAC,qDAAoB;AAC9C,eAAe,mBAAO,CAAC,qCAAY;;AAEnC;AACA;AACA;AACA,WAAW,OAAO;AAClB,YAAY,MAAM;AAClB;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,eAAe,mBAAO,CAAC,+CAAiB;AACxC,oBAAoB,mBAAO,CAAC,yDAAsB;AAClD,iBAAiB,mBAAO,CAAC,mDAAmB;;AAE5C;AACA;AACA;AACA;AACA,eAAe,mBAAO,CAAC,iDAAkB;;AAEzC;AACA,qBAAqB,mBAAO,CAAC,6DAAwB;;AAErD;;AAEA;AACA;;;;;;;;;;;;;ACvDa;;AAEb;AACA;AACA;AACA;AACA,WAAW,QAAQ;AACnB;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;;;;;;;;;;;;;AClBa;;AAEb,aAAa,mBAAO,CAAC,wCAAU;;AAE/B;AACA;AACA;AACA;AACA,WAAW,SAAS;AACpB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;;ACxDa;;AAEb;AACA;AACA;;;;;;;;;;;;;ACJa;;AAEb,YAAY,mBAAO,CAAC,kCAAY;AAChC,eAAe,mBAAO,CAAC,sDAAqB;AAC5C,yBAAyB,mBAAO,CAAC,8DAAsB;AACvD,sBAAsB,mBAAO,CAAC,wDAAmB;AACjD,kBAAkB,mBAAO,CAAC,gDAAe;AACzC,gBAAgB,mBAAO,CAAC,wDAAsB;;AAE9C;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA,GAAG;;AAEH;AACA;AACA;AACA,GAAG;;AAEH;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,gDAAgD;AAChD;AACA;AACA,yBAAyB;AACzB,KAAK;AACL;AACA,CAAC;;AAED;AACA;AACA;AACA,gDAAgD;AAChD;AACA;AACA;AACA,KAAK;AACL;AACA,CAAC;;AAED;;;;;;;;;;;;;ACnJa;;AAEb,YAAY,mBAAO,CAAC,kCAAY;;AAEhC;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,SAAS;AACpB,WAAW,SAAS;AACpB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,SAAS;AACpB;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;AAEA;;;;;;;;;;;;;ACrDa;;AAEb,oBAAoB,mBAAO,CAAC,gEAA0B;AACtD,kBAAkB,mBAAO,CAAC,4DAAwB;;AAElD;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACnBa;;AAEb,mBAAmB,mBAAO,CAAC,kDAAgB;;AAE3C;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,MAAM;AACnB;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACjBa;;AAEb,YAAY,mBAAO,CAAC,kCAAY;AAChC,oBAAoB,mBAAO,CAAC,oDAAiB;AAC7C,eAAe,mBAAO,CAAC,oDAAoB;AAC3C,eAAe,mBAAO,CAAC,sCAAa;;AAEpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,+BAA+B;AAC/B,uCAAuC;AACvC;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,GAAG;AACH;;;;;;;;;;;;;ACjFa;;AAEb;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,MAAM;AACnB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACzCa;;AAEb,YAAY,mBAAO,CAAC,gCAAU;;AAE9B;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL,2BAA2B;AAC3B,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;;AAEH;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;;AAEA;AACA;;;;;;;;;;;;;ACtFa;;AAEb,kBAAkB,mBAAO,CAAC,gDAAe;;AAEzC;AACA;AACA;AACA,WAAW,SAAS;AACpB,WAAW,SAAS;AACpB,WAAW,OAAO;AAClB;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACxBa;;AAEb,YAAY,mBAAO,CAAC,kCAAY;AAChC,eAAe,mBAAO,CAAC,wCAAe;;AAEtC;AACA;AACA;AACA,WAAW,cAAc;AACzB,WAAW,MAAM;AACjB,WAAW,eAAe;AAC1B,aAAa,EAAE;AACf;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;;;;;;;;;;;;;ACrBa;;AAEb,YAAY,mBAAO,CAAC,+BAAS;AAC7B,0BAA0B,mBAAO,CAAC,2EAA+B;AACjE,mBAAmB,mBAAO,CAAC,uDAAqB;;AAEhD;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc,mBAAO,CAAC,6CAAgB;AACtC,GAAG;AACH;AACA,cAAc,mBAAO,CAAC,8CAAiB;AACvC;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,GAAG;;AAEH;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wEAAwE;AACxE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,CAAC;;AAED;AACA;AACA,CAAC;;AAED;;;;;;;;;;;;;ACrIa;;AAEb;AACA;AACA;AACA,mBAAmB,iBAAiB;AACpC;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACVa;;AAEb,YAAY,mBAAO,CAAC,kCAAY;;AAEhC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,OAAO;AACP,KAAK;;AAEL;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;;;;;;;;;;;;ACrEa;;AAEb;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACba;;AAEb,YAAY,mBAAO,CAAC,kCAAY;;AAEhC;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,0CAA0C;AAC1C,SAAS;;AAET;AACA,4DAA4D,wBAAwB;AACpF;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,kCAAkC;AAClC,+BAA+B,aAAa,EAAE;AAC9C;AACA;AACA,KAAK;AACL;;;;;;;;;;;;;ACpDa;;AAEb;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACba;;AAEb;AACA;AACA;AACA,WAAW,EAAE;AACb,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;;;;;;;;;;;;ACVa;;AAEb,YAAY,mBAAO,CAAC,kCAAY;;AAEhC;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,cAAc,OAAO;AACrB,gBAAgB;AAChB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,cAAc,OAAO;AACrB,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;;;;;;;;;;;;ACnEa;;AAEb,YAAY,mBAAO,CAAC,gCAAU;;AAE9B;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;;;;;;;;;;;;ACXa;;AAEb,YAAY,mBAAO,CAAC,kCAAY;;AAEhC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;;AAEA,iBAAiB,eAAe;;AAEhC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,GAAG;;AAEH;AACA;;;;;;;;;;;;;ACpDa;;AAEb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B;AAC/B;AACA;AACA,WAAW,SAAS;AACpB,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;AC1Ba;;AAEb,UAAU,mBAAO,CAAC,4CAAsB;;AAExC;;AAEA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;;AAEA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,QAAQ;AACnB,aAAa;AACb;AACA;AACA;AACA;AACA,iBAAiB,OAAO;AACxB;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,WAAW,kBAAkB;AAC7B,WAAW,QAAQ;AACnB,WAAW,OAAO;AAClB,aAAa;AACb;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,SAAS;AACpB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACxGa;;AAEb,WAAW,mBAAO,CAAC,6CAAgB;;AAEnC;;AAEA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,YAAY,QAAQ;AACpB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,OAAO;AACpB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,SAAS;AACpB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,mCAAmC,OAAO;AAC1C;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,SAAS,GAAG,SAAS;AAC5C,2BAA2B;AAC3B;AACA;AACA,WAAW,OAAO;AAClB,aAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,4BAA4B;AAC5B,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;;AAEA,uCAAuC,OAAO;AAC9C;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"axios.js","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[\"axios\"] = factory();\n\telse\n\t\troot[\"axios\"] = factory();\n})(window, function() {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = \"./index.js\");\n","module.exports = require('./lib/axios');","'use strict';\n\nvar utils = require('./../utils');\nvar settle = require('./../core/settle');\nvar cookies = require('./../helpers/cookies');\nvar buildURL = require('./../helpers/buildURL');\nvar buildFullPath = require('../core/buildFullPath');\nvar parseHeaders = require('./../helpers/parseHeaders');\nvar isURLSameOrigin = require('./../helpers/isURLSameOrigin');\nvar createError = require('../core/createError');\n\nmodule.exports = function xhrAdapter(config) {\n return new Promise(function dispatchXhrRequest(resolve, reject) {\n var requestData = config.data;\n var requestHeaders = config.headers;\n var responseType = config.responseType;\n\n if (utils.isFormData(requestData)) {\n delete requestHeaders['Content-Type']; // Let the browser set it\n }\n\n var request = new XMLHttpRequest();\n\n // HTTP basic authentication\n if (config.auth) {\n var username = config.auth.username || '';\n var password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : '';\n requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password);\n }\n\n var fullPath = buildFullPath(config.baseURL, config.url);\n request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true);\n\n // Set the request timeout in MS\n request.timeout = config.timeout;\n\n function onloadend() {\n if (!request) {\n return;\n }\n // Prepare the response\n var responseHeaders = 'getAllResponseHeaders' in request ? parseHeaders(request.getAllResponseHeaders()) : null;\n var responseData = !responseType || responseType === 'text' || responseType === 'json' ?\n request.responseText : request.response;\n var response = {\n data: responseData,\n status: request.status,\n statusText: request.statusText,\n headers: responseHeaders,\n config: config,\n request: request\n };\n\n settle(resolve, reject, response);\n\n // Clean up request\n request = null;\n }\n\n if ('onloadend' in request) {\n // Use onloadend if available\n request.onloadend = onloadend;\n } else {\n // Listen for ready state to emulate onloadend\n request.onreadystatechange = function handleLoad() {\n if (!request || request.readyState !== 4) {\n return;\n }\n\n // The request errored out and we didn't get a response, this will be\n // handled by onerror instead\n // With one exception: request that using file: protocol, most browsers\n // will return status as 0 even though it's a successful request\n if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {\n return;\n }\n // readystate handler is calling before onerror or ontimeout handlers,\n // so we should call onloadend on the next 'tick'\n setTimeout(onloadend);\n };\n }\n\n // Handle browser request cancellation (as opposed to a manual cancellation)\n request.onabort = function handleAbort() {\n if (!request) {\n return;\n }\n\n reject(createError('Request aborted', config, 'ECONNABORTED', request));\n\n // Clean up request\n request = null;\n };\n\n // Handle low level network errors\n request.onerror = function handleError() {\n // Real errors are hidden from us by the browser\n // onerror should only fire if it's a network error\n reject(createError('Network Error', config, null, request));\n\n // Clean up request\n request = null;\n };\n\n // Handle timeout\n request.ontimeout = function handleTimeout() {\n var timeoutErrorMessage = 'timeout of ' + config.timeout + 'ms exceeded';\n if (config.timeoutErrorMessage) {\n timeoutErrorMessage = config.timeoutErrorMessage;\n }\n reject(createError(\n timeoutErrorMessage,\n config,\n config.transitional && config.transitional.clarifyTimeoutError ? 'ETIMEDOUT' : 'ECONNABORTED',\n request));\n\n // Clean up request\n request = null;\n };\n\n // Add xsrf header\n // This is only done if running in a standard browser environment.\n // Specifically not if we're in a web worker, or react-native.\n if (utils.isStandardBrowserEnv()) {\n // Add xsrf header\n var xsrfValue = (config.withCredentials || isURLSameOrigin(fullPath)) && config.xsrfCookieName ?\n cookies.read(config.xsrfCookieName) :\n undefined;\n\n if (xsrfValue) {\n requestHeaders[config.xsrfHeaderName] = xsrfValue;\n }\n }\n\n // Add headers to the request\n if ('setRequestHeader' in request) {\n utils.forEach(requestHeaders, function setRequestHeader(val, key) {\n if (typeof requestData === 'undefined' && key.toLowerCase() === 'content-type') {\n // Remove Content-Type if data is undefined\n delete requestHeaders[key];\n } else {\n // Otherwise add header to the request\n request.setRequestHeader(key, val);\n }\n });\n }\n\n // Add withCredentials to request if needed\n if (!utils.isUndefined(config.withCredentials)) {\n request.withCredentials = !!config.withCredentials;\n }\n\n // Add responseType to request if needed\n if (responseType && responseType !== 'json') {\n request.responseType = config.responseType;\n }\n\n // Handle progress if needed\n if (typeof config.onDownloadProgress === 'function') {\n request.addEventListener('progress', config.onDownloadProgress);\n }\n\n // Not all browsers support upload events\n if (typeof config.onUploadProgress === 'function' && request.upload) {\n request.upload.addEventListener('progress', config.onUploadProgress);\n }\n\n if (config.cancelToken) {\n // Handle cancellation\n config.cancelToken.promise.then(function onCanceled(cancel) {\n if (!request) {\n return;\n }\n\n request.abort();\n reject(cancel);\n // Clean up request\n request = null;\n });\n }\n\n if (!requestData) {\n requestData = null;\n }\n\n // Send the request\n request.send(requestData);\n });\n};\n","'use strict';\n\nvar utils = require('./utils');\nvar bind = require('./helpers/bind');\nvar Axios = require('./core/Axios');\nvar mergeConfig = require('./core/mergeConfig');\nvar defaults = require('./defaults');\n\n/**\n * Create an instance of Axios\n *\n * @param {Object} defaultConfig The default config for the instance\n * @return {Axios} A new instance of Axios\n */\nfunction createInstance(defaultConfig) {\n var context = new Axios(defaultConfig);\n var instance = bind(Axios.prototype.request, context);\n\n // Copy axios.prototype to instance\n utils.extend(instance, Axios.prototype, context);\n\n // Copy context to instance\n utils.extend(instance, context);\n\n return instance;\n}\n\n// Create the default instance to be exported\nvar axios = createInstance(defaults);\n\n// Expose Axios class to allow class inheritance\naxios.Axios = Axios;\n\n// Factory for creating new instances\naxios.create = function create(instanceConfig) {\n return createInstance(mergeConfig(axios.defaults, instanceConfig));\n};\n\n// Expose Cancel & CancelToken\naxios.Cancel = require('./cancel/Cancel');\naxios.CancelToken = require('./cancel/CancelToken');\naxios.isCancel = require('./cancel/isCancel');\n\n// Expose all/spread\naxios.all = function all(promises) {\n return Promise.all(promises);\n};\naxios.spread = require('./helpers/spread');\n\n// Expose isAxiosError\naxios.isAxiosError = require('./helpers/isAxiosError');\n\nmodule.exports = axios;\n\n// Allow use of default import syntax in TypeScript\nmodule.exports.default = axios;\n","'use strict';\n\n/**\n * A `Cancel` is an object that is thrown when an operation is canceled.\n *\n * @class\n * @param {string=} message The message.\n */\nfunction Cancel(message) {\n this.message = message;\n}\n\nCancel.prototype.toString = function toString() {\n return 'Cancel' + (this.message ? ': ' + this.message : '');\n};\n\nCancel.prototype.__CANCEL__ = true;\n\nmodule.exports = Cancel;\n","'use strict';\n\nvar Cancel = require('./Cancel');\n\n/**\n * A `CancelToken` is an object that can be used to request cancellation of an operation.\n *\n * @class\n * @param {Function} executor The executor function.\n */\nfunction CancelToken(executor) {\n if (typeof executor !== 'function') {\n throw new TypeError('executor must be a function.');\n }\n\n var resolvePromise;\n this.promise = new Promise(function promiseExecutor(resolve) {\n resolvePromise = resolve;\n });\n\n var token = this;\n executor(function cancel(message) {\n if (token.reason) {\n // Cancellation has already been requested\n return;\n }\n\n token.reason = new Cancel(message);\n resolvePromise(token.reason);\n });\n}\n\n/**\n * Throws a `Cancel` if cancellation has been requested.\n */\nCancelToken.prototype.throwIfRequested = function throwIfRequested() {\n if (this.reason) {\n throw this.reason;\n }\n};\n\n/**\n * Returns an object that contains a new `CancelToken` and a function that, when called,\n * cancels the `CancelToken`.\n */\nCancelToken.source = function source() {\n var cancel;\n var token = new CancelToken(function executor(c) {\n cancel = c;\n });\n return {\n token: token,\n cancel: cancel\n };\n};\n\nmodule.exports = CancelToken;\n","'use strict';\n\nmodule.exports = function isCancel(value) {\n return !!(value && value.__CANCEL__);\n};\n","'use strict';\n\nvar utils = require('./../utils');\nvar buildURL = require('../helpers/buildURL');\nvar InterceptorManager = require('./InterceptorManager');\nvar dispatchRequest = require('./dispatchRequest');\nvar mergeConfig = require('./mergeConfig');\nvar validator = require('../helpers/validator');\n\nvar validators = validator.validators;\n/**\n * Create a new instance of Axios\n *\n * @param {Object} instanceConfig The default config for the instance\n */\nfunction Axios(instanceConfig) {\n this.defaults = instanceConfig;\n this.interceptors = {\n request: new InterceptorManager(),\n response: new InterceptorManager()\n };\n}\n\n/**\n * Dispatch a request\n *\n * @param {Object} config The config specific for this request (merged with this.defaults)\n */\nAxios.prototype.request = function request(config) {\n /*eslint no-param-reassign:0*/\n // Allow for axios('example/url'[, config]) a la fetch API\n if (typeof config === 'string') {\n config = arguments[1] || {};\n config.url = arguments[0];\n } else {\n config = config || {};\n }\n\n config = mergeConfig(this.defaults, config);\n\n // Set config.method\n if (config.method) {\n config.method = config.method.toLowerCase();\n } else if (this.defaults.method) {\n config.method = this.defaults.method.toLowerCase();\n } else {\n config.method = 'get';\n }\n\n var transitional = config.transitional;\n\n if (transitional !== undefined) {\n validator.assertOptions(transitional, {\n silentJSONParsing: validators.transitional(validators.boolean, '1.0.0'),\n forcedJSONParsing: validators.transitional(validators.boolean, '1.0.0'),\n clarifyTimeoutError: validators.transitional(validators.boolean, '1.0.0')\n }, false);\n }\n\n // filter out skipped interceptors\n var requestInterceptorChain = [];\n var synchronousRequestInterceptors = true;\n this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {\n if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) {\n return;\n }\n\n synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;\n\n requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);\n });\n\n var responseInterceptorChain = [];\n this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {\n responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);\n });\n\n var promise;\n\n if (!synchronousRequestInterceptors) {\n var chain = [dispatchRequest, undefined];\n\n Array.prototype.unshift.apply(chain, requestInterceptorChain);\n chain = chain.concat(responseInterceptorChain);\n\n promise = Promise.resolve(config);\n while (chain.length) {\n promise = promise.then(chain.shift(), chain.shift());\n }\n\n return promise;\n }\n\n\n var newConfig = config;\n while (requestInterceptorChain.length) {\n var onFulfilled = requestInterceptorChain.shift();\n var onRejected = requestInterceptorChain.shift();\n try {\n newConfig = onFulfilled(newConfig);\n } catch (error) {\n onRejected(error);\n break;\n }\n }\n\n try {\n promise = dispatchRequest(newConfig);\n } catch (error) {\n return Promise.reject(error);\n }\n\n while (responseInterceptorChain.length) {\n promise = promise.then(responseInterceptorChain.shift(), responseInterceptorChain.shift());\n }\n\n return promise;\n};\n\nAxios.prototype.getUri = function getUri(config) {\n config = mergeConfig(this.defaults, config);\n return buildURL(config.url, config.params, config.paramsSerializer).replace(/^\\?/, '');\n};\n\n// Provide aliases for supported request methods\nutils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, config) {\n return this.request(mergeConfig(config || {}, {\n method: method,\n url: url,\n data: (config || {}).data\n }));\n };\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, data, config) {\n return this.request(mergeConfig(config || {}, {\n method: method,\n url: url,\n data: data\n }));\n };\n});\n\nmodule.exports = Axios;\n","'use strict';\n\nvar utils = require('./../utils');\n\nfunction InterceptorManager() {\n this.handlers = [];\n}\n\n/**\n * Add a new interceptor to the stack\n *\n * @param {Function} fulfilled The function to handle `then` for a `Promise`\n * @param {Function} rejected The function to handle `reject` for a `Promise`\n *\n * @return {Number} An ID used to remove interceptor later\n */\nInterceptorManager.prototype.use = function use(fulfilled, rejected, options) {\n this.handlers.push({\n fulfilled: fulfilled,\n rejected: rejected,\n synchronous: options ? options.synchronous : false,\n runWhen: options ? options.runWhen : null\n });\n return this.handlers.length - 1;\n};\n\n/**\n * Remove an interceptor from the stack\n *\n * @param {Number} id The ID that was returned by `use`\n */\nInterceptorManager.prototype.eject = function eject(id) {\n if (this.handlers[id]) {\n this.handlers[id] = null;\n }\n};\n\n/**\n * Iterate over all the registered interceptors\n *\n * This method is particularly useful for skipping over any\n * interceptors that may have become `null` calling `eject`.\n *\n * @param {Function} fn The function to call for each interceptor\n */\nInterceptorManager.prototype.forEach = function forEach(fn) {\n utils.forEach(this.handlers, function forEachHandler(h) {\n if (h !== null) {\n fn(h);\n }\n });\n};\n\nmodule.exports = InterceptorManager;\n","'use strict';\n\nvar isAbsoluteURL = require('../helpers/isAbsoluteURL');\nvar combineURLs = require('../helpers/combineURLs');\n\n/**\n * Creates a new URL by combining the baseURL with the requestedURL,\n * only when the requestedURL is not already an absolute URL.\n * If the requestURL is absolute, this function returns the requestedURL untouched.\n *\n * @param {string} baseURL The base URL\n * @param {string} requestedURL Absolute or relative URL to combine\n * @returns {string} The combined full path\n */\nmodule.exports = function buildFullPath(baseURL, requestedURL) {\n if (baseURL && !isAbsoluteURL(requestedURL)) {\n return combineURLs(baseURL, requestedURL);\n }\n return requestedURL;\n};\n","'use strict';\n\nvar enhanceError = require('./enhanceError');\n\n/**\n * Create an Error with the specified message, config, error code, request and response.\n *\n * @param {string} message The error message.\n * @param {Object} config The config.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n * @returns {Error} The created error.\n */\nmodule.exports = function createError(message, config, code, request, response) {\n var error = new Error(message);\n return enhanceError(error, config, code, request, response);\n};\n","'use strict';\n\nvar utils = require('./../utils');\nvar transformData = require('./transformData');\nvar isCancel = require('../cancel/isCancel');\nvar defaults = require('../defaults');\n\n/**\n * Throws a `Cancel` if cancellation has been requested.\n */\nfunction throwIfCancellationRequested(config) {\n if (config.cancelToken) {\n config.cancelToken.throwIfRequested();\n }\n}\n\n/**\n * Dispatch a request to the server using the configured adapter.\n *\n * @param {object} config The config that is to be used for the request\n * @returns {Promise} The Promise to be fulfilled\n */\nmodule.exports = function dispatchRequest(config) {\n throwIfCancellationRequested(config);\n\n // Ensure headers exist\n config.headers = config.headers || {};\n\n // Transform request data\n config.data = transformData.call(\n config,\n config.data,\n config.headers,\n config.transformRequest\n );\n\n // Flatten headers\n config.headers = utils.merge(\n config.headers.common || {},\n config.headers[config.method] || {},\n config.headers\n );\n\n utils.forEach(\n ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],\n function cleanHeaderConfig(method) {\n delete config.headers[method];\n }\n );\n\n var adapter = config.adapter || defaults.adapter;\n\n return adapter(config).then(function onAdapterResolution(response) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n response.data = transformData.call(\n config,\n response.data,\n response.headers,\n config.transformResponse\n );\n\n return response;\n }, function onAdapterRejection(reason) {\n if (!isCancel(reason)) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n if (reason && reason.response) {\n reason.response.data = transformData.call(\n config,\n reason.response.data,\n reason.response.headers,\n config.transformResponse\n );\n }\n }\n\n return Promise.reject(reason);\n });\n};\n","'use strict';\n\n/**\n * Update an Error with the specified config, error code, and response.\n *\n * @param {Error} error The error to update.\n * @param {Object} config The config.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n * @returns {Error} The error.\n */\nmodule.exports = function enhanceError(error, config, code, request, response) {\n error.config = config;\n if (code) {\n error.code = code;\n }\n\n error.request = request;\n error.response = response;\n error.isAxiosError = true;\n\n error.toJSON = function toJSON() {\n return {\n // Standard\n message: this.message,\n name: this.name,\n // Microsoft\n description: this.description,\n number: this.number,\n // Mozilla\n fileName: this.fileName,\n lineNumber: this.lineNumber,\n columnNumber: this.columnNumber,\n stack: this.stack,\n // Axios\n config: this.config,\n code: this.code\n };\n };\n return error;\n};\n","'use strict';\n\nvar utils = require('../utils');\n\n/**\n * Config-specific merge-function which creates a new config-object\n * by merging two configuration objects together.\n *\n * @param {Object} config1\n * @param {Object} config2\n * @returns {Object} New object resulting from merging config2 to config1\n */\nmodule.exports = function mergeConfig(config1, config2) {\n // eslint-disable-next-line no-param-reassign\n config2 = config2 || {};\n var config = {};\n\n var valueFromConfig2Keys = ['url', 'method', 'data'];\n var mergeDeepPropertiesKeys = ['headers', 'auth', 'proxy', 'params'];\n var defaultToConfig2Keys = [\n 'baseURL', 'transformRequest', 'transformResponse', 'paramsSerializer',\n 'timeout', 'timeoutMessage', 'withCredentials', 'adapter', 'responseType', 'xsrfCookieName',\n 'xsrfHeaderName', 'onUploadProgress', 'onDownloadProgress', 'decompress',\n 'maxContentLength', 'maxBodyLength', 'maxRedirects', 'transport', 'httpAgent',\n 'httpsAgent', 'cancelToken', 'socketPath', 'responseEncoding'\n ];\n var directMergeKeys = ['validateStatus'];\n\n function getMergedValue(target, source) {\n if (utils.isPlainObject(target) && utils.isPlainObject(source)) {\n return utils.merge(target, source);\n } else if (utils.isPlainObject(source)) {\n return utils.merge({}, source);\n } else if (utils.isArray(source)) {\n return source.slice();\n }\n return source;\n }\n\n function mergeDeepProperties(prop) {\n if (!utils.isUndefined(config2[prop])) {\n config[prop] = getMergedValue(config1[prop], config2[prop]);\n } else if (!utils.isUndefined(config1[prop])) {\n config[prop] = getMergedValue(undefined, config1[prop]);\n }\n }\n\n utils.forEach(valueFromConfig2Keys, function valueFromConfig2(prop) {\n if (!utils.isUndefined(config2[prop])) {\n config[prop] = getMergedValue(undefined, config2[prop]);\n }\n });\n\n utils.forEach(mergeDeepPropertiesKeys, mergeDeepProperties);\n\n utils.forEach(defaultToConfig2Keys, function defaultToConfig2(prop) {\n if (!utils.isUndefined(config2[prop])) {\n config[prop] = getMergedValue(undefined, config2[prop]);\n } else if (!utils.isUndefined(config1[prop])) {\n config[prop] = getMergedValue(undefined, config1[prop]);\n }\n });\n\n utils.forEach(directMergeKeys, function merge(prop) {\n if (prop in config2) {\n config[prop] = getMergedValue(config1[prop], config2[prop]);\n } else if (prop in config1) {\n config[prop] = getMergedValue(undefined, config1[prop]);\n }\n });\n\n var axiosKeys = valueFromConfig2Keys\n .concat(mergeDeepPropertiesKeys)\n .concat(defaultToConfig2Keys)\n .concat(directMergeKeys);\n\n var otherKeys = Object\n .keys(config1)\n .concat(Object.keys(config2))\n .filter(function filterAxiosKeys(key) {\n return axiosKeys.indexOf(key) === -1;\n });\n\n utils.forEach(otherKeys, mergeDeepProperties);\n\n return config;\n};\n","'use strict';\n\nvar createError = require('./createError');\n\n/**\n * Resolve or reject a Promise based on response status.\n *\n * @param {Function} resolve A function that resolves the promise.\n * @param {Function} reject A function that rejects the promise.\n * @param {object} response The response.\n */\nmodule.exports = function settle(resolve, reject, response) {\n var validateStatus = response.config.validateStatus;\n if (!response.status || !validateStatus || validateStatus(response.status)) {\n resolve(response);\n } else {\n reject(createError(\n 'Request failed with status code ' + response.status,\n response.config,\n null,\n response.request,\n response\n ));\n }\n};\n","'use strict';\n\nvar utils = require('./../utils');\nvar defaults = require('./../defaults');\n\n/**\n * Transform the data for a request or a response\n *\n * @param {Object|String} data The data to be transformed\n * @param {Array} headers The headers for the request or response\n * @param {Array|Function} fns A single function or Array of functions\n * @returns {*} The resulting transformed data\n */\nmodule.exports = function transformData(data, headers, fns) {\n var context = this || defaults;\n /*eslint no-param-reassign:0*/\n utils.forEach(fns, function transform(fn) {\n data = fn.call(context, data, headers);\n });\n\n return data;\n};\n","'use strict';\n\nvar utils = require('./utils');\nvar normalizeHeaderName = require('./helpers/normalizeHeaderName');\nvar enhanceError = require('./core/enhanceError');\n\nvar DEFAULT_CONTENT_TYPE = {\n 'Content-Type': 'application/x-www-form-urlencoded'\n};\n\nfunction setContentTypeIfUnset(headers, value) {\n if (!utils.isUndefined(headers) && utils.isUndefined(headers['Content-Type'])) {\n headers['Content-Type'] = value;\n }\n}\n\nfunction getDefaultAdapter() {\n var adapter;\n if (typeof XMLHttpRequest !== 'undefined') {\n // For browsers use XHR adapter\n adapter = require('./adapters/xhr');\n } else if (typeof process !== 'undefined' && Object.prototype.toString.call(process) === '[object process]') {\n // For node use HTTP adapter\n adapter = require('./adapters/http');\n }\n return adapter;\n}\n\nfunction stringifySafely(rawValue, parser, encoder) {\n if (utils.isString(rawValue)) {\n try {\n (parser || JSON.parse)(rawValue);\n return utils.trim(rawValue);\n } catch (e) {\n if (e.name !== 'SyntaxError') {\n throw e;\n }\n }\n }\n\n return (encoder || JSON.stringify)(rawValue);\n}\n\nvar defaults = {\n\n transitional: {\n silentJSONParsing: true,\n forcedJSONParsing: true,\n clarifyTimeoutError: false\n },\n\n adapter: getDefaultAdapter(),\n\n transformRequest: [function transformRequest(data, headers) {\n normalizeHeaderName(headers, 'Accept');\n normalizeHeaderName(headers, 'Content-Type');\n\n if (utils.isFormData(data) ||\n utils.isArrayBuffer(data) ||\n utils.isBuffer(data) ||\n utils.isStream(data) ||\n utils.isFile(data) ||\n utils.isBlob(data)\n ) {\n return data;\n }\n if (utils.isArrayBufferView(data)) {\n return data.buffer;\n }\n if (utils.isURLSearchParams(data)) {\n setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8');\n return data.toString();\n }\n if (utils.isObject(data) || (headers && headers['Content-Type'] === 'application/json')) {\n setContentTypeIfUnset(headers, 'application/json');\n return stringifySafely(data);\n }\n return data;\n }],\n\n transformResponse: [function transformResponse(data) {\n var transitional = this.transitional;\n var silentJSONParsing = transitional && transitional.silentJSONParsing;\n var forcedJSONParsing = transitional && transitional.forcedJSONParsing;\n var strictJSONParsing = !silentJSONParsing && this.responseType === 'json';\n\n if (strictJSONParsing || (forcedJSONParsing && utils.isString(data) && data.length)) {\n try {\n return JSON.parse(data);\n } catch (e) {\n if (strictJSONParsing) {\n if (e.name === 'SyntaxError') {\n throw enhanceError(e, this, 'E_JSON_PARSE');\n }\n throw e;\n }\n }\n }\n\n return data;\n }],\n\n /**\n * A timeout in milliseconds to abort a request. If set to 0 (default) a\n * timeout is not created.\n */\n timeout: 0,\n\n xsrfCookieName: 'XSRF-TOKEN',\n xsrfHeaderName: 'X-XSRF-TOKEN',\n\n maxContentLength: -1,\n maxBodyLength: -1,\n\n validateStatus: function validateStatus(status) {\n return status >= 200 && status < 300;\n }\n};\n\ndefaults.headers = {\n common: {\n 'Accept': 'application/json, text/plain, */*'\n }\n};\n\nutils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) {\n defaults.headers[method] = {};\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE);\n});\n\nmodule.exports = defaults;\n","'use strict';\n\nmodule.exports = function bind(fn, thisArg) {\n return function wrap() {\n var args = new Array(arguments.length);\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i];\n }\n return fn.apply(thisArg, args);\n };\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\nfunction encode(val) {\n return encodeURIComponent(val).\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%20/g, '+').\n replace(/%5B/gi, '[').\n replace(/%5D/gi, ']');\n}\n\n/**\n * Build a URL by appending params to the end\n *\n * @param {string} url The base of the url (e.g., http://www.google.com)\n * @param {object} [params] The params to be appended\n * @returns {string} The formatted url\n */\nmodule.exports = function buildURL(url, params, paramsSerializer) {\n /*eslint no-param-reassign:0*/\n if (!params) {\n return url;\n }\n\n var serializedParams;\n if (paramsSerializer) {\n serializedParams = paramsSerializer(params);\n } else if (utils.isURLSearchParams(params)) {\n serializedParams = params.toString();\n } else {\n var parts = [];\n\n utils.forEach(params, function serialize(val, key) {\n if (val === null || typeof val === 'undefined') {\n return;\n }\n\n if (utils.isArray(val)) {\n key = key + '[]';\n } else {\n val = [val];\n }\n\n utils.forEach(val, function parseValue(v) {\n if (utils.isDate(v)) {\n v = v.toISOString();\n } else if (utils.isObject(v)) {\n v = JSON.stringify(v);\n }\n parts.push(encode(key) + '=' + encode(v));\n });\n });\n\n serializedParams = parts.join('&');\n }\n\n if (serializedParams) {\n var hashmarkIndex = url.indexOf('#');\n if (hashmarkIndex !== -1) {\n url = url.slice(0, hashmarkIndex);\n }\n\n url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;\n }\n\n return url;\n};\n","'use strict';\n\n/**\n * Creates a new URL by combining the specified URLs\n *\n * @param {string} baseURL The base URL\n * @param {string} relativeURL The relative URL\n * @returns {string} The combined URL\n */\nmodule.exports = function combineURLs(baseURL, relativeURL) {\n return relativeURL\n ? baseURL.replace(/\\/+$/, '') + '/' + relativeURL.replace(/^\\/+/, '')\n : baseURL;\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\nmodule.exports = (\n utils.isStandardBrowserEnv() ?\n\n // Standard browser envs support document.cookie\n (function standardBrowserEnv() {\n return {\n write: function write(name, value, expires, path, domain, secure) {\n var cookie = [];\n cookie.push(name + '=' + encodeURIComponent(value));\n\n if (utils.isNumber(expires)) {\n cookie.push('expires=' + new Date(expires).toGMTString());\n }\n\n if (utils.isString(path)) {\n cookie.push('path=' + path);\n }\n\n if (utils.isString(domain)) {\n cookie.push('domain=' + domain);\n }\n\n if (secure === true) {\n cookie.push('secure');\n }\n\n document.cookie = cookie.join('; ');\n },\n\n read: function read(name) {\n var match = document.cookie.match(new RegExp('(^|;\\\\s*)(' + name + ')=([^;]*)'));\n return (match ? decodeURIComponent(match[3]) : null);\n },\n\n remove: function remove(name) {\n this.write(name, '', Date.now() - 86400000);\n }\n };\n })() :\n\n // Non standard browser env (web workers, react-native) lack needed support.\n (function nonStandardBrowserEnv() {\n return {\n write: function write() {},\n read: function read() { return null; },\n remove: function remove() {}\n };\n })()\n);\n","'use strict';\n\n/**\n * Determines whether the specified URL is absolute\n *\n * @param {string} url The URL to test\n * @returns {boolean} True if the specified URL is absolute, otherwise false\n */\nmodule.exports = function isAbsoluteURL(url) {\n // A URL is considered absolute if it begins with \"://\" or \"//\" (protocol-relative URL).\n // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed\n // by any combination of letters, digits, plus, period, or hyphen.\n return /^([a-z][a-z\\d\\+\\-\\.]*:)?\\/\\//i.test(url);\n};\n","'use strict';\n\n/**\n * Determines whether the payload is an error thrown by Axios\n *\n * @param {*} payload The value to test\n * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false\n */\nmodule.exports = function isAxiosError(payload) {\n return (typeof payload === 'object') && (payload.isAxiosError === true);\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\nmodule.exports = (\n utils.isStandardBrowserEnv() ?\n\n // Standard browser envs have full support of the APIs needed to test\n // whether the request URL is of the same origin as current location.\n (function standardBrowserEnv() {\n var msie = /(msie|trident)/i.test(navigator.userAgent);\n var urlParsingNode = document.createElement('a');\n var originURL;\n\n /**\n * Parse a URL to discover it's components\n *\n * @param {String} url The URL to be parsed\n * @returns {Object}\n */\n function resolveURL(url) {\n var href = url;\n\n if (msie) {\n // IE needs attribute set twice to normalize properties\n urlParsingNode.setAttribute('href', href);\n href = urlParsingNode.href;\n }\n\n urlParsingNode.setAttribute('href', href);\n\n // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils\n return {\n href: urlParsingNode.href,\n protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',\n host: urlParsingNode.host,\n search: urlParsingNode.search ? urlParsingNode.search.replace(/^\\?/, '') : '',\n hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',\n hostname: urlParsingNode.hostname,\n port: urlParsingNode.port,\n pathname: (urlParsingNode.pathname.charAt(0) === '/') ?\n urlParsingNode.pathname :\n '/' + urlParsingNode.pathname\n };\n }\n\n originURL = resolveURL(window.location.href);\n\n /**\n * Determine if a URL shares the same origin as the current location\n *\n * @param {String} requestURL The URL to test\n * @returns {boolean} True if URL shares the same origin, otherwise false\n */\n return function isURLSameOrigin(requestURL) {\n var parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL;\n return (parsed.protocol === originURL.protocol &&\n parsed.host === originURL.host);\n };\n })() :\n\n // Non standard browser envs (web workers, react-native) lack needed support.\n (function nonStandardBrowserEnv() {\n return function isURLSameOrigin() {\n return true;\n };\n })()\n);\n","'use strict';\n\nvar utils = require('../utils');\n\nmodule.exports = function normalizeHeaderName(headers, normalizedName) {\n utils.forEach(headers, function processHeader(value, name) {\n if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) {\n headers[normalizedName] = value;\n delete headers[name];\n }\n });\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\n// Headers whose duplicates are ignored by node\n// c.f. https://nodejs.org/api/http.html#http_message_headers\nvar ignoreDuplicateOf = [\n 'age', 'authorization', 'content-length', 'content-type', 'etag',\n 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',\n 'last-modified', 'location', 'max-forwards', 'proxy-authorization',\n 'referer', 'retry-after', 'user-agent'\n];\n\n/**\n * Parse headers into an object\n *\n * ```\n * Date: Wed, 27 Aug 2014 08:58:49 GMT\n * Content-Type: application/json\n * Connection: keep-alive\n * Transfer-Encoding: chunked\n * ```\n *\n * @param {String} headers Headers needing to be parsed\n * @returns {Object} Headers parsed into an object\n */\nmodule.exports = function parseHeaders(headers) {\n var parsed = {};\n var key;\n var val;\n var i;\n\n if (!headers) { return parsed; }\n\n utils.forEach(headers.split('\\n'), function parser(line) {\n i = line.indexOf(':');\n key = utils.trim(line.substr(0, i)).toLowerCase();\n val = utils.trim(line.substr(i + 1));\n\n if (key) {\n if (parsed[key] && ignoreDuplicateOf.indexOf(key) >= 0) {\n return;\n }\n if (key === 'set-cookie') {\n parsed[key] = (parsed[key] ? parsed[key] : []).concat([val]);\n } else {\n parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;\n }\n }\n });\n\n return parsed;\n};\n","'use strict';\n\n/**\n * Syntactic sugar for invoking a function and expanding an array for arguments.\n *\n * Common use case would be to use `Function.prototype.apply`.\n *\n * ```js\n * function f(x, y, z) {}\n * var args = [1, 2, 3];\n * f.apply(null, args);\n * ```\n *\n * With `spread` this example can be re-written.\n *\n * ```js\n * spread(function(x, y, z) {})([1, 2, 3]);\n * ```\n *\n * @param {Function} callback\n * @returns {Function}\n */\nmodule.exports = function spread(callback) {\n return function wrap(arr) {\n return callback.apply(null, arr);\n };\n};\n","'use strict';\n\nvar pkg = require('./../../package.json');\n\nvar validators = {};\n\n// eslint-disable-next-line func-names\n['object', 'boolean', 'number', 'function', 'string', 'symbol'].forEach(function(type, i) {\n validators[type] = function validator(thing) {\n return typeof thing === type || 'a' + (i < 1 ? 'n ' : ' ') + type;\n };\n});\n\nvar deprecatedWarnings = {};\nvar currentVerArr = pkg.version.split('.');\n\n/**\n * Compare package versions\n * @param {string} version\n * @param {string?} thanVersion\n * @returns {boolean}\n */\nfunction isOlderVersion(version, thanVersion) {\n var pkgVersionArr = thanVersion ? thanVersion.split('.') : currentVerArr;\n var destVer = version.split('.');\n for (var i = 0; i < 3; i++) {\n if (pkgVersionArr[i] > destVer[i]) {\n return true;\n } else if (pkgVersionArr[i] < destVer[i]) {\n return false;\n }\n }\n return false;\n}\n\n/**\n * Transitional option validator\n * @param {function|boolean?} validator\n * @param {string?} version\n * @param {string} message\n * @returns {function}\n */\nvalidators.transitional = function transitional(validator, version, message) {\n var isDeprecated = version && isOlderVersion(version);\n\n function formatMessage(opt, desc) {\n return '[Axios v' + pkg.version + '] Transitional option \\'' + opt + '\\'' + desc + (message ? '. ' + message : '');\n }\n\n // eslint-disable-next-line func-names\n return function(value, opt, opts) {\n if (validator === false) {\n throw new Error(formatMessage(opt, ' has been removed in ' + version));\n }\n\n if (isDeprecated && !deprecatedWarnings[opt]) {\n deprecatedWarnings[opt] = true;\n // eslint-disable-next-line no-console\n console.warn(\n formatMessage(\n opt,\n ' has been deprecated since v' + version + ' and will be removed in the near future'\n )\n );\n }\n\n return validator ? validator(value, opt, opts) : true;\n };\n};\n\n/**\n * Assert object's properties type\n * @param {object} options\n * @param {object} schema\n * @param {boolean?} allowUnknown\n */\n\nfunction assertOptions(options, schema, allowUnknown) {\n if (typeof options !== 'object') {\n throw new TypeError('options must be an object');\n }\n var keys = Object.keys(options);\n var i = keys.length;\n while (i-- > 0) {\n var opt = keys[i];\n var validator = schema[opt];\n if (validator) {\n var value = options[opt];\n var result = value === undefined || validator(value, opt, options);\n if (result !== true) {\n throw new TypeError('option ' + opt + ' must be ' + result);\n }\n continue;\n }\n if (allowUnknown !== true) {\n throw Error('Unknown option ' + opt);\n }\n }\n}\n\nmodule.exports = {\n isOlderVersion: isOlderVersion,\n assertOptions: assertOptions,\n validators: validators\n};\n","'use strict';\n\nvar bind = require('./helpers/bind');\n\n// utils is a library of generic helper functions non-specific to axios\n\nvar toString = Object.prototype.toString;\n\n/**\n * Determine if a value is an Array\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an Array, otherwise false\n */\nfunction isArray(val) {\n return toString.call(val) === '[object Array]';\n}\n\n/**\n * Determine if a value is undefined\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if the value is undefined, otherwise false\n */\nfunction isUndefined(val) {\n return typeof val === 'undefined';\n}\n\n/**\n * Determine if a value is a Buffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Buffer, otherwise false\n */\nfunction isBuffer(val) {\n return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor)\n && typeof val.constructor.isBuffer === 'function' && val.constructor.isBuffer(val);\n}\n\n/**\n * Determine if a value is an ArrayBuffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an ArrayBuffer, otherwise false\n */\nfunction isArrayBuffer(val) {\n return toString.call(val) === '[object ArrayBuffer]';\n}\n\n/**\n * Determine if a value is a FormData\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an FormData, otherwise false\n */\nfunction isFormData(val) {\n return (typeof FormData !== 'undefined') && (val instanceof FormData);\n}\n\n/**\n * Determine if a value is a view on an ArrayBuffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false\n */\nfunction isArrayBufferView(val) {\n var result;\n if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {\n result = ArrayBuffer.isView(val);\n } else {\n result = (val) && (val.buffer) && (val.buffer instanceof ArrayBuffer);\n }\n return result;\n}\n\n/**\n * Determine if a value is a String\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a String, otherwise false\n */\nfunction isString(val) {\n return typeof val === 'string';\n}\n\n/**\n * Determine if a value is a Number\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Number, otherwise false\n */\nfunction isNumber(val) {\n return typeof val === 'number';\n}\n\n/**\n * Determine if a value is an Object\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an Object, otherwise false\n */\nfunction isObject(val) {\n return val !== null && typeof val === 'object';\n}\n\n/**\n * Determine if a value is a plain Object\n *\n * @param {Object} val The value to test\n * @return {boolean} True if value is a plain Object, otherwise false\n */\nfunction isPlainObject(val) {\n if (toString.call(val) !== '[object Object]') {\n return false;\n }\n\n var prototype = Object.getPrototypeOf(val);\n return prototype === null || prototype === Object.prototype;\n}\n\n/**\n * Determine if a value is a Date\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Date, otherwise false\n */\nfunction isDate(val) {\n return toString.call(val) === '[object Date]';\n}\n\n/**\n * Determine if a value is a File\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a File, otherwise false\n */\nfunction isFile(val) {\n return toString.call(val) === '[object File]';\n}\n\n/**\n * Determine if a value is a Blob\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Blob, otherwise false\n */\nfunction isBlob(val) {\n return toString.call(val) === '[object Blob]';\n}\n\n/**\n * Determine if a value is a Function\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Function, otherwise false\n */\nfunction isFunction(val) {\n return toString.call(val) === '[object Function]';\n}\n\n/**\n * Determine if a value is a Stream\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Stream, otherwise false\n */\nfunction isStream(val) {\n return isObject(val) && isFunction(val.pipe);\n}\n\n/**\n * Determine if a value is a URLSearchParams object\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a URLSearchParams object, otherwise false\n */\nfunction isURLSearchParams(val) {\n return typeof URLSearchParams !== 'undefined' && val instanceof URLSearchParams;\n}\n\n/**\n * Trim excess whitespace off the beginning and end of a string\n *\n * @param {String} str The String to trim\n * @returns {String} The String freed of excess whitespace\n */\nfunction trim(str) {\n return str.trim ? str.trim() : str.replace(/^\\s+|\\s+$/g, '');\n}\n\n/**\n * Determine if we're running in a standard browser environment\n *\n * This allows axios to run in a web worker, and react-native.\n * Both environments support XMLHttpRequest, but not fully standard globals.\n *\n * web workers:\n * typeof window -> undefined\n * typeof document -> undefined\n *\n * react-native:\n * navigator.product -> 'ReactNative'\n * nativescript\n * navigator.product -> 'NativeScript' or 'NS'\n */\nfunction isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}\n\n/**\n * Iterate over an Array or an Object invoking a function for each item.\n *\n * If `obj` is an Array callback will be called passing\n * the value, index, and complete array for each item.\n *\n * If 'obj' is an Object callback will be called passing\n * the value, key, and complete object for each property.\n *\n * @param {Object|Array} obj The object to iterate\n * @param {Function} fn The callback to invoke for each item\n */\nfunction forEach(obj, fn) {\n // Don't bother if no value provided\n if (obj === null || typeof obj === 'undefined') {\n return;\n }\n\n // Force an array if not already something iterable\n if (typeof obj !== 'object') {\n /*eslint no-param-reassign:0*/\n obj = [obj];\n }\n\n if (isArray(obj)) {\n // Iterate over array values\n for (var i = 0, l = obj.length; i < l; i++) {\n fn.call(null, obj[i], i, obj);\n }\n } else {\n // Iterate over object keys\n for (var key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key)) {\n fn.call(null, obj[key], key, obj);\n }\n }\n }\n}\n\n/**\n * Accepts varargs expecting each argument to be an object, then\n * immutably merges the properties of each object and returns result.\n *\n * When multiple objects contain the same key the later object in\n * the arguments list will take precedence.\n *\n * Example:\n *\n * ```js\n * var result = merge({foo: 123}, {foo: 456});\n * console.log(result.foo); // outputs 456\n * ```\n *\n * @param {Object} obj1 Object to merge\n * @returns {Object} Result of all merge properties\n */\nfunction merge(/* obj1, obj2, obj3, ... */) {\n var result = {};\n function assignValue(val, key) {\n if (isPlainObject(result[key]) && isPlainObject(val)) {\n result[key] = merge(result[key], val);\n } else if (isPlainObject(val)) {\n result[key] = merge({}, val);\n } else if (isArray(val)) {\n result[key] = val.slice();\n } else {\n result[key] = val;\n }\n }\n\n for (var i = 0, l = arguments.length; i < l; i++) {\n forEach(arguments[i], assignValue);\n }\n return result;\n}\n\n/**\n * Extends object a by mutably adding to it the properties of object b.\n *\n * @param {Object} a The object to be extended\n * @param {Object} b The object to copy properties from\n * @param {Object} thisArg The object to bind function to\n * @return {Object} The resulting value of object a\n */\nfunction extend(a, b, thisArg) {\n forEach(b, function assignValue(val, key) {\n if (thisArg && typeof val === 'function') {\n a[key] = bind(val, thisArg);\n } else {\n a[key] = val;\n }\n });\n return a;\n}\n\n/**\n * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM)\n *\n * @param {string} content with BOM\n * @return {string} content value without BOM\n */\nfunction stripBOM(content) {\n if (content.charCodeAt(0) === 0xFEFF) {\n content = content.slice(1);\n }\n return content;\n}\n\nmodule.exports = {\n isArray: isArray,\n isArrayBuffer: isArrayBuffer,\n isBuffer: isBuffer,\n isFormData: isFormData,\n isArrayBufferView: isArrayBufferView,\n isString: isString,\n isNumber: isNumber,\n isObject: isObject,\n isPlainObject: isPlainObject,\n isUndefined: isUndefined,\n isDate: isDate,\n isFile: isFile,\n isBlob: isBlob,\n isFunction: isFunction,\n isStream: isStream,\n isURLSearchParams: isURLSearchParams,\n isStandardBrowserEnv: isStandardBrowserEnv,\n forEach: forEach,\n merge: merge,\n extend: extend,\n trim: trim,\n stripBOM: stripBOM\n};\n"],"sourceRoot":""} \ No newline at end of file diff --git a/node_modules/tod-api/node_modules/axios/dist/axios.min.js b/node_modules/tod-api/node_modules/axios/dist/axios.min.js new file mode 100644 index 000000000..d5b138ad0 --- /dev/null +++ b/node_modules/tod-api/node_modules/axios/dist/axios.min.js @@ -0,0 +1,3 @@ +/* axios v0.21.4 | (c) 2021 by Matt Zabriskie */ +!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.axios=t():e.axios=t()}(window,(function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=10)}([function(e,t,r){"use strict";var n=r(2),o=Object.prototype.toString;function i(e){return"[object Array]"===o.call(e)}function s(e){return void 0===e}function a(e){return null!==e&&"object"==typeof e}function u(e){if("[object Object]"!==o.call(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}function c(e){return"[object Function]"===o.call(e)}function f(e,t){if(null!=e)if("object"!=typeof e&&(e=[e]),i(e))for(var r=0,n=e.length;r=200&&e<300}};c.headers={common:{Accept:"application/json, text/plain, */*"}},n.forEach(["delete","get","head"],(function(e){c.headers[e]={}})),n.forEach(["post","put","patch"],(function(e){c.headers[e]=n.merge(s)})),e.exports=c},function(e,t,r){"use strict";e.exports=function(e,t){return function(){for(var r=new Array(arguments.length),n=0;n=0)return;s[t]="set-cookie"===t?(s[t]?s[t]:[]).concat([r]):s[t]?s[t]+", "+r:r}})),s):s}},function(e,t,r){"use strict";var n=r(0);e.exports=n.isStandardBrowserEnv()?function(){var e,t=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a");function o(e){var n=e;return t&&(r.setAttribute("href",n),n=r.href),r.setAttribute("href",n),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:"/"===r.pathname.charAt(0)?r.pathname:"/"+r.pathname}}return e=o(window.location.href),function(t){var r=n.isString(t)?o(t):t;return r.protocol===e.protocol&&r.host===e.host}}():function(){return!0}},function(e,t,r){"use strict";var n=r(25),o={};["object","boolean","number","function","string","symbol"].forEach((function(e,t){o[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}}));var i={},s=n.version.split(".");function a(e,t){for(var r=t?t.split("."):s,n=e.split("."),o=0;o<3;o++){if(r[o]>n[o])return!0;if(r[o]0;){var i=n[o],s=t[i];if(s){var a=e[i],u=void 0===a||s(a,i,e);if(!0!==u)throw new TypeError("option "+i+" must be "+u)}else if(!0!==r)throw Error("Unknown option "+i)}},validators:o}},function(e){e.exports=JSON.parse('{"name":"axios","version":"0.21.4","description":"Promise based HTTP client for the browser and node.js","main":"index.js","scripts":{"test":"grunt test","start":"node ./sandbox/server.js","build":"NODE_ENV=production grunt build","preversion":"npm test","version":"npm run build && grunt version && git add -A dist && git add CHANGELOG.md bower.json package.json","postversion":"git push && git push --tags","examples":"node ./examples/server.js","coveralls":"cat coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js","fix":"eslint --fix lib/**/*.js"},"repository":{"type":"git","url":"https://github.com/axios/axios.git"},"keywords":["xhr","http","ajax","promise","node"],"author":"Matt Zabriskie","license":"MIT","bugs":{"url":"https://github.com/axios/axios/issues"},"homepage":"https://axios-http.com","devDependencies":{"coveralls":"^3.0.0","es6-promise":"^4.2.4","grunt":"^1.3.0","grunt-banner":"^0.6.0","grunt-cli":"^1.2.0","grunt-contrib-clean":"^1.1.0","grunt-contrib-watch":"^1.0.0","grunt-eslint":"^23.0.0","grunt-karma":"^4.0.0","grunt-mocha-test":"^0.13.3","grunt-ts":"^6.0.0-beta.19","grunt-webpack":"^4.0.2","istanbul-instrumenter-loader":"^1.0.0","jasmine-core":"^2.4.1","karma":"^6.3.2","karma-chrome-launcher":"^3.1.0","karma-firefox-launcher":"^2.1.0","karma-jasmine":"^1.1.1","karma-jasmine-ajax":"^0.1.13","karma-safari-launcher":"^1.0.0","karma-sauce-launcher":"^4.3.6","karma-sinon":"^1.0.5","karma-sourcemap-loader":"^0.3.8","karma-webpack":"^4.0.2","load-grunt-tasks":"^3.5.2","minimist":"^1.2.0","mocha":"^8.2.1","sinon":"^4.5.0","terser-webpack-plugin":"^4.2.3","typescript":"^4.0.5","url-search-params":"^0.10.0","webpack":"^4.44.2","webpack-dev-server":"^3.11.0"},"browser":{"./lib/adapters/http.js":"./lib/adapters/xhr.js"},"jsdelivr":"dist/axios.min.js","unpkg":"dist/axios.min.js","typings":"./index.d.ts","dependencies":{"follow-redirects":"^1.14.0"},"bundlesize":[{"path":"./dist/axios.min.js","threshold":"5kB"}]}')},function(e,t,r){"use strict";var n=r(9);function o(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise((function(e){t=e}));var r=this;e((function(e){r.reason||(r.reason=new n(e),t(r.reason))}))}o.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},o.source=function(){var e;return{token:new o((function(t){e=t})),cancel:e}},e.exports=o},function(e,t,r){"use strict";e.exports=function(e){return function(t){return e.apply(null,t)}}},function(e,t,r){"use strict";e.exports=function(e){return"object"==typeof e&&!0===e.isAxiosError}}])})); +//# sourceMappingURL=axios.min.map \ No newline at end of file diff --git a/node_modules/tod-api/node_modules/axios/dist/axios.min.map b/node_modules/tod-api/node_modules/axios/dist/axios.min.map new file mode 100644 index 000000000..468a5babc --- /dev/null +++ b/node_modules/tod-api/node_modules/axios/dist/axios.min.map @@ -0,0 +1 @@ +{"version":3,"sources":["webpack://axios/webpack/universalModuleDefinition","webpack://axios/webpack/bootstrap","webpack://axios/./lib/utils.js","webpack://axios/./lib/defaults.js","webpack://axios/./lib/helpers/bind.js","webpack://axios/./lib/helpers/buildURL.js","webpack://axios/./lib/core/enhanceError.js","webpack://axios/./lib/adapters/xhr.js","webpack://axios/./lib/core/createError.js","webpack://axios/./lib/cancel/isCancel.js","webpack://axios/./lib/core/mergeConfig.js","webpack://axios/./lib/cancel/Cancel.js","webpack://axios/./index.js","webpack://axios/./lib/axios.js","webpack://axios/./lib/core/Axios.js","webpack://axios/./lib/core/InterceptorManager.js","webpack://axios/./lib/core/dispatchRequest.js","webpack://axios/./lib/core/transformData.js","webpack://axios/./lib/helpers/normalizeHeaderName.js","webpack://axios/./lib/core/settle.js","webpack://axios/./lib/helpers/cookies.js","webpack://axios/./lib/core/buildFullPath.js","webpack://axios/./lib/helpers/isAbsoluteURL.js","webpack://axios/./lib/helpers/combineURLs.js","webpack://axios/./lib/helpers/parseHeaders.js","webpack://axios/./lib/helpers/isURLSameOrigin.js","webpack://axios/./lib/helpers/validator.js","webpack://axios/./lib/cancel/CancelToken.js","webpack://axios/./lib/helpers/spread.js","webpack://axios/./lib/helpers/isAxiosError.js"],"names":["root","factory","exports","module","define","amd","window","installedModules","__webpack_require__","moduleId","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","toString","isArray","val","isUndefined","isObject","isPlainObject","getPrototypeOf","isFunction","forEach","obj","fn","length","isArrayBuffer","isBuffer","constructor","isFormData","FormData","isArrayBufferView","ArrayBuffer","isView","buffer","isString","isNumber","isDate","isFile","isBlob","isStream","pipe","isURLSearchParams","URLSearchParams","isStandardBrowserEnv","navigator","product","document","merge","result","assignValue","slice","arguments","extend","a","b","thisArg","trim","str","replace","stripBOM","content","charCodeAt","utils","normalizeHeaderName","enhanceError","DEFAULT_CONTENT_TYPE","setContentTypeIfUnset","headers","adapter","defaults","transitional","silentJSONParsing","forcedJSONParsing","clarifyTimeoutError","XMLHttpRequest","process","transformRequest","data","rawValue","parser","encoder","JSON","parse","e","stringify","stringifySafely","transformResponse","this","strictJSONParsing","responseType","timeout","xsrfCookieName","xsrfHeaderName","maxContentLength","maxBodyLength","validateStatus","status","common","method","args","Array","apply","encode","encodeURIComponent","url","params","paramsSerializer","serializedParams","parts","v","toISOString","push","join","hashmarkIndex","indexOf","error","config","code","request","response","isAxiosError","toJSON","message","description","number","fileName","lineNumber","columnNumber","stack","settle","cookies","buildURL","buildFullPath","parseHeaders","isURLSameOrigin","createError","Promise","resolve","reject","requestData","requestHeaders","auth","username","password","unescape","Authorization","btoa","fullPath","baseURL","onloadend","responseHeaders","getAllResponseHeaders","responseText","statusText","open","toUpperCase","onreadystatechange","readyState","responseURL","setTimeout","onabort","onerror","ontimeout","timeoutErrorMessage","xsrfValue","withCredentials","read","undefined","toLowerCase","setRequestHeader","onDownloadProgress","addEventListener","onUploadProgress","upload","cancelToken","promise","then","cancel","abort","send","Error","__CANCEL__","config1","config2","valueFromConfig2Keys","mergeDeepPropertiesKeys","defaultToConfig2Keys","directMergeKeys","getMergedValue","target","source","mergeDeepProperties","prop","axiosKeys","concat","otherKeys","keys","filter","Cancel","Axios","mergeConfig","createInstance","defaultConfig","context","instance","axios","instanceConfig","CancelToken","isCancel","all","promises","spread","default","InterceptorManager","dispatchRequest","validator","validators","interceptors","assertOptions","boolean","requestInterceptorChain","synchronousRequestInterceptors","interceptor","runWhen","synchronous","unshift","fulfilled","rejected","responseInterceptorChain","chain","shift","newConfig","onFulfilled","onRejected","getUri","handlers","use","options","eject","id","h","transformData","throwIfCancellationRequested","throwIfRequested","reason","fns","normalizedName","write","expires","path","domain","secure","cookie","Date","toGMTString","match","RegExp","decodeURIComponent","remove","now","isAbsoluteURL","combineURLs","requestedURL","test","relativeURL","ignoreDuplicateOf","parsed","split","line","substr","originURL","msie","userAgent","urlParsingNode","createElement","resolveURL","href","setAttribute","protocol","host","search","hash","hostname","port","pathname","charAt","location","requestURL","pkg","type","thing","deprecatedWarnings","currentVerArr","version","isOlderVersion","thanVersion","pkgVersionArr","destVer","isDeprecated","formatMessage","opt","desc","opts","console","warn","schema","allowUnknown","TypeError","executor","resolvePromise","token","callback","arr","payload"],"mappings":"CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,IACQ,mBAAXG,QAAyBA,OAAOC,IAC9CD,OAAO,GAAIH,GACe,iBAAZC,QACdA,QAAe,MAAID,IAEnBD,EAAY,MAAIC,IARlB,CASGK,QAAQ,WACX,O,YCTE,IAAIC,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUP,QAGnC,IAAIC,EAASI,EAAiBE,GAAY,CACzCC,EAAGD,EACHE,GAAG,EACHT,QAAS,IAUV,OANAU,EAAQH,GAAUI,KAAKV,EAAOD,QAASC,EAAQA,EAAOD,QAASM,GAG/DL,EAAOQ,GAAI,EAGJR,EAAOD,QA0Df,OArDAM,EAAoBM,EAAIF,EAGxBJ,EAAoBO,EAAIR,EAGxBC,EAAoBQ,EAAI,SAASd,EAASe,EAAMC,GAC3CV,EAAoBW,EAAEjB,EAASe,IAClCG,OAAOC,eAAenB,EAASe,EAAM,CAAEK,YAAY,EAAMC,IAAKL,KAKhEV,EAAoBgB,EAAI,SAAStB,GACX,oBAAXuB,QAA0BA,OAAOC,aAC1CN,OAAOC,eAAenB,EAASuB,OAAOC,YAAa,CAAEC,MAAO,WAE7DP,OAAOC,eAAenB,EAAS,aAAc,CAAEyB,OAAO,KAQvDnB,EAAoBoB,EAAI,SAASD,EAAOE,GAEvC,GADU,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,UAAU,UAAYP,EAAM,YAAc5P,QAIxD,IAAqB,IAAjBkQ,EACF,MAAM9H,MAAM,kBAAoBwH,KAQpCpF,WAAYA,I,0+DCrGd,IAAIlB,EAAS,EAAQ,GAQrB,SAASS,EAAYqG,GACnB,GAAwB,mBAAbA,EACT,MAAM,IAAID,UAAU,gCAGtB,IAAIE,EACJ9N,KAAKwF,QAAU,IAAIvC,SAAQ,SAAyBC,GAClD4K,EAAiB5K,KAGnB,IAAI6K,EAAQ/N,KACZ6N,GAAS,SAAgB1L,GACnB4L,EAAMlE,SAKVkE,EAAMlE,OAAS,IAAI9C,EAAO5E,GAC1B2L,EAAeC,EAAMlE,YAOzBrC,EAAYtM,UAAU0O,iBAAmB,WACvC,GAAI5J,KAAK6J,OACP,MAAM7J,KAAK6J,QAQfrC,EAAYjB,OAAS,WACnB,IAAIb,EAIJ,MAAO,CACLqI,MAJU,IAAIvG,GAAY,SAAkB7N,GAC5C+L,EAAS/L,KAIT+L,OAAQA,IAIZ3M,EAAOD,QAAU0O,G,6BClCjBzO,EAAOD,QAAU,SAAgBkV,GAC/B,OAAO,SAAcC,GACnB,OAAOD,EAASlN,MAAM,KAAMmN,M,6BChBhClV,EAAOD,QAAU,SAAsBoV,GACrC,MAA2B,iBAAZA,IAAmD,IAAzBA,EAAQjM","file":"axios.min.js","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[\"axios\"] = factory();\n\telse\n\t\troot[\"axios\"] = factory();\n})(window, function() {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 10);\n","'use strict';\n\nvar bind = require('./helpers/bind');\n\n// utils is a library of generic helper functions non-specific to axios\n\nvar toString = Object.prototype.toString;\n\n/**\n * Determine if a value is an Array\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an Array, otherwise false\n */\nfunction isArray(val) {\n return toString.call(val) === '[object Array]';\n}\n\n/**\n * Determine if a value is undefined\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if the value is undefined, otherwise false\n */\nfunction isUndefined(val) {\n return typeof val === 'undefined';\n}\n\n/**\n * Determine if a value is a Buffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Buffer, otherwise false\n */\nfunction isBuffer(val) {\n return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor)\n && typeof val.constructor.isBuffer === 'function' && val.constructor.isBuffer(val);\n}\n\n/**\n * Determine if a value is an ArrayBuffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an ArrayBuffer, otherwise false\n */\nfunction isArrayBuffer(val) {\n return toString.call(val) === '[object ArrayBuffer]';\n}\n\n/**\n * Determine if a value is a FormData\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an FormData, otherwise false\n */\nfunction isFormData(val) {\n return (typeof FormData !== 'undefined') && (val instanceof FormData);\n}\n\n/**\n * Determine if a value is a view on an ArrayBuffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false\n */\nfunction isArrayBufferView(val) {\n var result;\n if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {\n result = ArrayBuffer.isView(val);\n } else {\n result = (val) && (val.buffer) && (val.buffer instanceof ArrayBuffer);\n }\n return result;\n}\n\n/**\n * Determine if a value is a String\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a String, otherwise false\n */\nfunction isString(val) {\n return typeof val === 'string';\n}\n\n/**\n * Determine if a value is a Number\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Number, otherwise false\n */\nfunction isNumber(val) {\n return typeof val === 'number';\n}\n\n/**\n * Determine if a value is an Object\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an Object, otherwise false\n */\nfunction isObject(val) {\n return val !== null && typeof val === 'object';\n}\n\n/**\n * Determine if a value is a plain Object\n *\n * @param {Object} val The value to test\n * @return {boolean} True if value is a plain Object, otherwise false\n */\nfunction isPlainObject(val) {\n if (toString.call(val) !== '[object Object]') {\n return false;\n }\n\n var prototype = Object.getPrototypeOf(val);\n return prototype === null || prototype === Object.prototype;\n}\n\n/**\n * Determine if a value is a Date\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Date, otherwise false\n */\nfunction isDate(val) {\n return toString.call(val) === '[object Date]';\n}\n\n/**\n * Determine if a value is a File\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a File, otherwise false\n */\nfunction isFile(val) {\n return toString.call(val) === '[object File]';\n}\n\n/**\n * Determine if a value is a Blob\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Blob, otherwise false\n */\nfunction isBlob(val) {\n return toString.call(val) === '[object Blob]';\n}\n\n/**\n * Determine if a value is a Function\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Function, otherwise false\n */\nfunction isFunction(val) {\n return toString.call(val) === '[object Function]';\n}\n\n/**\n * Determine if a value is a Stream\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Stream, otherwise false\n */\nfunction isStream(val) {\n return isObject(val) && isFunction(val.pipe);\n}\n\n/**\n * Determine if a value is a URLSearchParams object\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a URLSearchParams object, otherwise false\n */\nfunction isURLSearchParams(val) {\n return typeof URLSearchParams !== 'undefined' && val instanceof URLSearchParams;\n}\n\n/**\n * Trim excess whitespace off the beginning and end of a string\n *\n * @param {String} str The String to trim\n * @returns {String} The String freed of excess whitespace\n */\nfunction trim(str) {\n return str.trim ? str.trim() : str.replace(/^\\s+|\\s+$/g, '');\n}\n\n/**\n * Determine if we're running in a standard browser environment\n *\n * This allows axios to run in a web worker, and react-native.\n * Both environments support XMLHttpRequest, but not fully standard globals.\n *\n * web workers:\n * typeof window -> undefined\n * typeof document -> undefined\n *\n * react-native:\n * navigator.product -> 'ReactNative'\n * nativescript\n * navigator.product -> 'NativeScript' or 'NS'\n */\nfunction isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}\n\n/**\n * Iterate over an Array or an Object invoking a function for each item.\n *\n * If `obj` is an Array callback will be called passing\n * the value, index, and complete array for each item.\n *\n * If 'obj' is an Object callback will be called passing\n * the value, key, and complete object for each property.\n *\n * @param {Object|Array} obj The object to iterate\n * @param {Function} fn The callback to invoke for each item\n */\nfunction forEach(obj, fn) {\n // Don't bother if no value provided\n if (obj === null || typeof obj === 'undefined') {\n return;\n }\n\n // Force an array if not already something iterable\n if (typeof obj !== 'object') {\n /*eslint no-param-reassign:0*/\n obj = [obj];\n }\n\n if (isArray(obj)) {\n // Iterate over array values\n for (var i = 0, l = obj.length; i < l; i++) {\n fn.call(null, obj[i], i, obj);\n }\n } else {\n // Iterate over object keys\n for (var key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key)) {\n fn.call(null, obj[key], key, obj);\n }\n }\n }\n}\n\n/**\n * Accepts varargs expecting each argument to be an object, then\n * immutably merges the properties of each object and returns result.\n *\n * When multiple objects contain the same key the later object in\n * the arguments list will take precedence.\n *\n * Example:\n *\n * ```js\n * var result = merge({foo: 123}, {foo: 456});\n * console.log(result.foo); // outputs 456\n * ```\n *\n * @param {Object} obj1 Object to merge\n * @returns {Object} Result of all merge properties\n */\nfunction merge(/* obj1, obj2, obj3, ... */) {\n var result = {};\n function assignValue(val, key) {\n if (isPlainObject(result[key]) && isPlainObject(val)) {\n result[key] = merge(result[key], val);\n } else if (isPlainObject(val)) {\n result[key] = merge({}, val);\n } else if (isArray(val)) {\n result[key] = val.slice();\n } else {\n result[key] = val;\n }\n }\n\n for (var i = 0, l = arguments.length; i < l; i++) {\n forEach(arguments[i], assignValue);\n }\n return result;\n}\n\n/**\n * Extends object a by mutably adding to it the properties of object b.\n *\n * @param {Object} a The object to be extended\n * @param {Object} b The object to copy properties from\n * @param {Object} thisArg The object to bind function to\n * @return {Object} The resulting value of object a\n */\nfunction extend(a, b, thisArg) {\n forEach(b, function assignValue(val, key) {\n if (thisArg && typeof val === 'function') {\n a[key] = bind(val, thisArg);\n } else {\n a[key] = val;\n }\n });\n return a;\n}\n\n/**\n * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM)\n *\n * @param {string} content with BOM\n * @return {string} content value without BOM\n */\nfunction stripBOM(content) {\n if (content.charCodeAt(0) === 0xFEFF) {\n content = content.slice(1);\n }\n return content;\n}\n\nmodule.exports = {\n isArray: isArray,\n isArrayBuffer: isArrayBuffer,\n isBuffer: isBuffer,\n isFormData: isFormData,\n isArrayBufferView: isArrayBufferView,\n isString: isString,\n isNumber: isNumber,\n isObject: isObject,\n isPlainObject: isPlainObject,\n isUndefined: isUndefined,\n isDate: isDate,\n isFile: isFile,\n isBlob: isBlob,\n isFunction: isFunction,\n isStream: isStream,\n isURLSearchParams: isURLSearchParams,\n isStandardBrowserEnv: isStandardBrowserEnv,\n forEach: forEach,\n merge: merge,\n extend: extend,\n trim: trim,\n stripBOM: stripBOM\n};\n","'use strict';\n\nvar utils = require('./utils');\nvar normalizeHeaderName = require('./helpers/normalizeHeaderName');\nvar enhanceError = require('./core/enhanceError');\n\nvar DEFAULT_CONTENT_TYPE = {\n 'Content-Type': 'application/x-www-form-urlencoded'\n};\n\nfunction setContentTypeIfUnset(headers, value) {\n if (!utils.isUndefined(headers) && utils.isUndefined(headers['Content-Type'])) {\n headers['Content-Type'] = value;\n }\n}\n\nfunction getDefaultAdapter() {\n var adapter;\n if (typeof XMLHttpRequest !== 'undefined') {\n // For browsers use XHR adapter\n adapter = require('./adapters/xhr');\n } else if (typeof process !== 'undefined' && Object.prototype.toString.call(process) === '[object process]') {\n // For node use HTTP adapter\n adapter = require('./adapters/http');\n }\n return adapter;\n}\n\nfunction stringifySafely(rawValue, parser, encoder) {\n if (utils.isString(rawValue)) {\n try {\n (parser || JSON.parse)(rawValue);\n return utils.trim(rawValue);\n } catch (e) {\n if (e.name !== 'SyntaxError') {\n throw e;\n }\n }\n }\n\n return (encoder || JSON.stringify)(rawValue);\n}\n\nvar defaults = {\n\n transitional: {\n silentJSONParsing: true,\n forcedJSONParsing: true,\n clarifyTimeoutError: false\n },\n\n adapter: getDefaultAdapter(),\n\n transformRequest: [function transformRequest(data, headers) {\n normalizeHeaderName(headers, 'Accept');\n normalizeHeaderName(headers, 'Content-Type');\n\n if (utils.isFormData(data) ||\n utils.isArrayBuffer(data) ||\n utils.isBuffer(data) ||\n utils.isStream(data) ||\n utils.isFile(data) ||\n utils.isBlob(data)\n ) {\n return data;\n }\n if (utils.isArrayBufferView(data)) {\n return data.buffer;\n }\n if (utils.isURLSearchParams(data)) {\n setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8');\n return data.toString();\n }\n if (utils.isObject(data) || (headers && headers['Content-Type'] === 'application/json')) {\n setContentTypeIfUnset(headers, 'application/json');\n return stringifySafely(data);\n }\n return data;\n }],\n\n transformResponse: [function transformResponse(data) {\n var transitional = this.transitional;\n var silentJSONParsing = transitional && transitional.silentJSONParsing;\n var forcedJSONParsing = transitional && transitional.forcedJSONParsing;\n var strictJSONParsing = !silentJSONParsing && this.responseType === 'json';\n\n if (strictJSONParsing || (forcedJSONParsing && utils.isString(data) && data.length)) {\n try {\n return JSON.parse(data);\n } catch (e) {\n if (strictJSONParsing) {\n if (e.name === 'SyntaxError') {\n throw enhanceError(e, this, 'E_JSON_PARSE');\n }\n throw e;\n }\n }\n }\n\n return data;\n }],\n\n /**\n * A timeout in milliseconds to abort a request. If set to 0 (default) a\n * timeout is not created.\n */\n timeout: 0,\n\n xsrfCookieName: 'XSRF-TOKEN',\n xsrfHeaderName: 'X-XSRF-TOKEN',\n\n maxContentLength: -1,\n maxBodyLength: -1,\n\n validateStatus: function validateStatus(status) {\n return status >= 200 && status < 300;\n }\n};\n\ndefaults.headers = {\n common: {\n 'Accept': 'application/json, text/plain, */*'\n }\n};\n\nutils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) {\n defaults.headers[method] = {};\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE);\n});\n\nmodule.exports = defaults;\n","'use strict';\n\nmodule.exports = function bind(fn, thisArg) {\n return function wrap() {\n var args = new Array(arguments.length);\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i];\n }\n return fn.apply(thisArg, args);\n };\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\nfunction encode(val) {\n return encodeURIComponent(val).\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%20/g, '+').\n replace(/%5B/gi, '[').\n replace(/%5D/gi, ']');\n}\n\n/**\n * Build a URL by appending params to the end\n *\n * @param {string} url The base of the url (e.g., http://www.google.com)\n * @param {object} [params] The params to be appended\n * @returns {string} The formatted url\n */\nmodule.exports = function buildURL(url, params, paramsSerializer) {\n /*eslint no-param-reassign:0*/\n if (!params) {\n return url;\n }\n\n var serializedParams;\n if (paramsSerializer) {\n serializedParams = paramsSerializer(params);\n } else if (utils.isURLSearchParams(params)) {\n serializedParams = params.toString();\n } else {\n var parts = [];\n\n utils.forEach(params, function serialize(val, key) {\n if (val === null || typeof val === 'undefined') {\n return;\n }\n\n if (utils.isArray(val)) {\n key = key + '[]';\n } else {\n val = [val];\n }\n\n utils.forEach(val, function parseValue(v) {\n if (utils.isDate(v)) {\n v = v.toISOString();\n } else if (utils.isObject(v)) {\n v = JSON.stringify(v);\n }\n parts.push(encode(key) + '=' + encode(v));\n });\n });\n\n serializedParams = parts.join('&');\n }\n\n if (serializedParams) {\n var hashmarkIndex = url.indexOf('#');\n if (hashmarkIndex !== -1) {\n url = url.slice(0, hashmarkIndex);\n }\n\n url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;\n }\n\n return url;\n};\n","'use strict';\n\n/**\n * Update an Error with the specified config, error code, and response.\n *\n * @param {Error} error The error to update.\n * @param {Object} config The config.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n * @returns {Error} The error.\n */\nmodule.exports = function enhanceError(error, config, code, request, response) {\n error.config = config;\n if (code) {\n error.code = code;\n }\n\n error.request = request;\n error.response = response;\n error.isAxiosError = true;\n\n error.toJSON = function toJSON() {\n return {\n // Standard\n message: this.message,\n name: this.name,\n // Microsoft\n description: this.description,\n number: this.number,\n // Mozilla\n fileName: this.fileName,\n lineNumber: this.lineNumber,\n columnNumber: this.columnNumber,\n stack: this.stack,\n // Axios\n config: this.config,\n code: this.code\n };\n };\n return error;\n};\n","'use strict';\n\nvar utils = require('./../utils');\nvar settle = require('./../core/settle');\nvar cookies = require('./../helpers/cookies');\nvar buildURL = require('./../helpers/buildURL');\nvar buildFullPath = require('../core/buildFullPath');\nvar parseHeaders = require('./../helpers/parseHeaders');\nvar isURLSameOrigin = require('./../helpers/isURLSameOrigin');\nvar createError = require('../core/createError');\n\nmodule.exports = function xhrAdapter(config) {\n return new Promise(function dispatchXhrRequest(resolve, reject) {\n var requestData = config.data;\n var requestHeaders = config.headers;\n var responseType = config.responseType;\n\n if (utils.isFormData(requestData)) {\n delete requestHeaders['Content-Type']; // Let the browser set it\n }\n\n var request = new XMLHttpRequest();\n\n // HTTP basic authentication\n if (config.auth) {\n var username = config.auth.username || '';\n var password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : '';\n requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password);\n }\n\n var fullPath = buildFullPath(config.baseURL, config.url);\n request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true);\n\n // Set the request timeout in MS\n request.timeout = config.timeout;\n\n function onloadend() {\n if (!request) {\n return;\n }\n // Prepare the response\n var responseHeaders = 'getAllResponseHeaders' in request ? parseHeaders(request.getAllResponseHeaders()) : null;\n var responseData = !responseType || responseType === 'text' || responseType === 'json' ?\n request.responseText : request.response;\n var response = {\n data: responseData,\n status: request.status,\n statusText: request.statusText,\n headers: responseHeaders,\n config: config,\n request: request\n };\n\n settle(resolve, reject, response);\n\n // Clean up request\n request = null;\n }\n\n if ('onloadend' in request) {\n // Use onloadend if available\n request.onloadend = onloadend;\n } else {\n // Listen for ready state to emulate onloadend\n request.onreadystatechange = function handleLoad() {\n if (!request || request.readyState !== 4) {\n return;\n }\n\n // The request errored out and we didn't get a response, this will be\n // handled by onerror instead\n // With one exception: request that using file: protocol, most browsers\n // will return status as 0 even though it's a successful request\n if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {\n return;\n }\n // readystate handler is calling before onerror or ontimeout handlers,\n // so we should call onloadend on the next 'tick'\n setTimeout(onloadend);\n };\n }\n\n // Handle browser request cancellation (as opposed to a manual cancellation)\n request.onabort = function handleAbort() {\n if (!request) {\n return;\n }\n\n reject(createError('Request aborted', config, 'ECONNABORTED', request));\n\n // Clean up request\n request = null;\n };\n\n // Handle low level network errors\n request.onerror = function handleError() {\n // Real errors are hidden from us by the browser\n // onerror should only fire if it's a network error\n reject(createError('Network Error', config, null, request));\n\n // Clean up request\n request = null;\n };\n\n // Handle timeout\n request.ontimeout = function handleTimeout() {\n var timeoutErrorMessage = 'timeout of ' + config.timeout + 'ms exceeded';\n if (config.timeoutErrorMessage) {\n timeoutErrorMessage = config.timeoutErrorMessage;\n }\n reject(createError(\n timeoutErrorMessage,\n config,\n config.transitional && config.transitional.clarifyTimeoutError ? 'ETIMEDOUT' : 'ECONNABORTED',\n request));\n\n // Clean up request\n request = null;\n };\n\n // Add xsrf header\n // This is only done if running in a standard browser environment.\n // Specifically not if we're in a web worker, or react-native.\n if (utils.isStandardBrowserEnv()) {\n // Add xsrf header\n var xsrfValue = (config.withCredentials || isURLSameOrigin(fullPath)) && config.xsrfCookieName ?\n cookies.read(config.xsrfCookieName) :\n undefined;\n\n if (xsrfValue) {\n requestHeaders[config.xsrfHeaderName] = xsrfValue;\n }\n }\n\n // Add headers to the request\n if ('setRequestHeader' in request) {\n utils.forEach(requestHeaders, function setRequestHeader(val, key) {\n if (typeof requestData === 'undefined' && key.toLowerCase() === 'content-type') {\n // Remove Content-Type if data is undefined\n delete requestHeaders[key];\n } else {\n // Otherwise add header to the request\n request.setRequestHeader(key, val);\n }\n });\n }\n\n // Add withCredentials to request if needed\n if (!utils.isUndefined(config.withCredentials)) {\n request.withCredentials = !!config.withCredentials;\n }\n\n // Add responseType to request if needed\n if (responseType && responseType !== 'json') {\n request.responseType = config.responseType;\n }\n\n // Handle progress if needed\n if (typeof config.onDownloadProgress === 'function') {\n request.addEventListener('progress', config.onDownloadProgress);\n }\n\n // Not all browsers support upload events\n if (typeof config.onUploadProgress === 'function' && request.upload) {\n request.upload.addEventListener('progress', config.onUploadProgress);\n }\n\n if (config.cancelToken) {\n // Handle cancellation\n config.cancelToken.promise.then(function onCanceled(cancel) {\n if (!request) {\n return;\n }\n\n request.abort();\n reject(cancel);\n // Clean up request\n request = null;\n });\n }\n\n if (!requestData) {\n requestData = null;\n }\n\n // Send the request\n request.send(requestData);\n });\n};\n","'use strict';\n\nvar enhanceError = require('./enhanceError');\n\n/**\n * Create an Error with the specified message, config, error code, request and response.\n *\n * @param {string} message The error message.\n * @param {Object} config The config.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n * @returns {Error} The created error.\n */\nmodule.exports = function createError(message, config, code, request, response) {\n var error = new Error(message);\n return enhanceError(error, config, code, request, response);\n};\n","'use strict';\n\nmodule.exports = function isCancel(value) {\n return !!(value && value.__CANCEL__);\n};\n","'use strict';\n\nvar utils = require('../utils');\n\n/**\n * Config-specific merge-function which creates a new config-object\n * by merging two configuration objects together.\n *\n * @param {Object} config1\n * @param {Object} config2\n * @returns {Object} New object resulting from merging config2 to config1\n */\nmodule.exports = function mergeConfig(config1, config2) {\n // eslint-disable-next-line no-param-reassign\n config2 = config2 || {};\n var config = {};\n\n var valueFromConfig2Keys = ['url', 'method', 'data'];\n var mergeDeepPropertiesKeys = ['headers', 'auth', 'proxy', 'params'];\n var defaultToConfig2Keys = [\n 'baseURL', 'transformRequest', 'transformResponse', 'paramsSerializer',\n 'timeout', 'timeoutMessage', 'withCredentials', 'adapter', 'responseType', 'xsrfCookieName',\n 'xsrfHeaderName', 'onUploadProgress', 'onDownloadProgress', 'decompress',\n 'maxContentLength', 'maxBodyLength', 'maxRedirects', 'transport', 'httpAgent',\n 'httpsAgent', 'cancelToken', 'socketPath', 'responseEncoding'\n ];\n var directMergeKeys = ['validateStatus'];\n\n function getMergedValue(target, source) {\n if (utils.isPlainObject(target) && utils.isPlainObject(source)) {\n return utils.merge(target, source);\n } else if (utils.isPlainObject(source)) {\n return utils.merge({}, source);\n } else if (utils.isArray(source)) {\n return source.slice();\n }\n return source;\n }\n\n function mergeDeepProperties(prop) {\n if (!utils.isUndefined(config2[prop])) {\n config[prop] = getMergedValue(config1[prop], config2[prop]);\n } else if (!utils.isUndefined(config1[prop])) {\n config[prop] = getMergedValue(undefined, config1[prop]);\n }\n }\n\n utils.forEach(valueFromConfig2Keys, function valueFromConfig2(prop) {\n if (!utils.isUndefined(config2[prop])) {\n config[prop] = getMergedValue(undefined, config2[prop]);\n }\n });\n\n utils.forEach(mergeDeepPropertiesKeys, mergeDeepProperties);\n\n utils.forEach(defaultToConfig2Keys, function defaultToConfig2(prop) {\n if (!utils.isUndefined(config2[prop])) {\n config[prop] = getMergedValue(undefined, config2[prop]);\n } else if (!utils.isUndefined(config1[prop])) {\n config[prop] = getMergedValue(undefined, config1[prop]);\n }\n });\n\n utils.forEach(directMergeKeys, function merge(prop) {\n if (prop in config2) {\n config[prop] = getMergedValue(config1[prop], config2[prop]);\n } else if (prop in config1) {\n config[prop] = getMergedValue(undefined, config1[prop]);\n }\n });\n\n var axiosKeys = valueFromConfig2Keys\n .concat(mergeDeepPropertiesKeys)\n .concat(defaultToConfig2Keys)\n .concat(directMergeKeys);\n\n var otherKeys = Object\n .keys(config1)\n .concat(Object.keys(config2))\n .filter(function filterAxiosKeys(key) {\n return axiosKeys.indexOf(key) === -1;\n });\n\n utils.forEach(otherKeys, mergeDeepProperties);\n\n return config;\n};\n","'use strict';\n\n/**\n * A `Cancel` is an object that is thrown when an operation is canceled.\n *\n * @class\n * @param {string=} message The message.\n */\nfunction Cancel(message) {\n this.message = message;\n}\n\nCancel.prototype.toString = function toString() {\n return 'Cancel' + (this.message ? ': ' + this.message : '');\n};\n\nCancel.prototype.__CANCEL__ = true;\n\nmodule.exports = Cancel;\n","module.exports = require('./lib/axios');","'use strict';\n\nvar utils = require('./utils');\nvar bind = require('./helpers/bind');\nvar Axios = require('./core/Axios');\nvar mergeConfig = require('./core/mergeConfig');\nvar defaults = require('./defaults');\n\n/**\n * Create an instance of Axios\n *\n * @param {Object} defaultConfig The default config for the instance\n * @return {Axios} A new instance of Axios\n */\nfunction createInstance(defaultConfig) {\n var context = new Axios(defaultConfig);\n var instance = bind(Axios.prototype.request, context);\n\n // Copy axios.prototype to instance\n utils.extend(instance, Axios.prototype, context);\n\n // Copy context to instance\n utils.extend(instance, context);\n\n return instance;\n}\n\n// Create the default instance to be exported\nvar axios = createInstance(defaults);\n\n// Expose Axios class to allow class inheritance\naxios.Axios = Axios;\n\n// Factory for creating new instances\naxios.create = function create(instanceConfig) {\n return createInstance(mergeConfig(axios.defaults, instanceConfig));\n};\n\n// Expose Cancel & CancelToken\naxios.Cancel = require('./cancel/Cancel');\naxios.CancelToken = require('./cancel/CancelToken');\naxios.isCancel = require('./cancel/isCancel');\n\n// Expose all/spread\naxios.all = function all(promises) {\n return Promise.all(promises);\n};\naxios.spread = require('./helpers/spread');\n\n// Expose isAxiosError\naxios.isAxiosError = require('./helpers/isAxiosError');\n\nmodule.exports = axios;\n\n// Allow use of default import syntax in TypeScript\nmodule.exports.default = axios;\n","'use strict';\n\nvar utils = require('./../utils');\nvar buildURL = require('../helpers/buildURL');\nvar InterceptorManager = require('./InterceptorManager');\nvar dispatchRequest = require('./dispatchRequest');\nvar mergeConfig = require('./mergeConfig');\nvar validator = require('../helpers/validator');\n\nvar validators = validator.validators;\n/**\n * Create a new instance of Axios\n *\n * @param {Object} instanceConfig The default config for the instance\n */\nfunction Axios(instanceConfig) {\n this.defaults = instanceConfig;\n this.interceptors = {\n request: new InterceptorManager(),\n response: new InterceptorManager()\n };\n}\n\n/**\n * Dispatch a request\n *\n * @param {Object} config The config specific for this request (merged with this.defaults)\n */\nAxios.prototype.request = function request(config) {\n /*eslint no-param-reassign:0*/\n // Allow for axios('example/url'[, config]) a la fetch API\n if (typeof config === 'string') {\n config = arguments[1] || {};\n config.url = arguments[0];\n } else {\n config = config || {};\n }\n\n config = mergeConfig(this.defaults, config);\n\n // Set config.method\n if (config.method) {\n config.method = config.method.toLowerCase();\n } else if (this.defaults.method) {\n config.method = this.defaults.method.toLowerCase();\n } else {\n config.method = 'get';\n }\n\n var transitional = config.transitional;\n\n if (transitional !== undefined) {\n validator.assertOptions(transitional, {\n silentJSONParsing: validators.transitional(validators.boolean, '1.0.0'),\n forcedJSONParsing: validators.transitional(validators.boolean, '1.0.0'),\n clarifyTimeoutError: validators.transitional(validators.boolean, '1.0.0')\n }, false);\n }\n\n // filter out skipped interceptors\n var requestInterceptorChain = [];\n var synchronousRequestInterceptors = true;\n this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {\n if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) {\n return;\n }\n\n synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;\n\n requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);\n });\n\n var responseInterceptorChain = [];\n this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {\n responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);\n });\n\n var promise;\n\n if (!synchronousRequestInterceptors) {\n var chain = [dispatchRequest, undefined];\n\n Array.prototype.unshift.apply(chain, requestInterceptorChain);\n chain = chain.concat(responseInterceptorChain);\n\n promise = Promise.resolve(config);\n while (chain.length) {\n promise = promise.then(chain.shift(), chain.shift());\n }\n\n return promise;\n }\n\n\n var newConfig = config;\n while (requestInterceptorChain.length) {\n var onFulfilled = requestInterceptorChain.shift();\n var onRejected = requestInterceptorChain.shift();\n try {\n newConfig = onFulfilled(newConfig);\n } catch (error) {\n onRejected(error);\n break;\n }\n }\n\n try {\n promise = dispatchRequest(newConfig);\n } catch (error) {\n return Promise.reject(error);\n }\n\n while (responseInterceptorChain.length) {\n promise = promise.then(responseInterceptorChain.shift(), responseInterceptorChain.shift());\n }\n\n return promise;\n};\n\nAxios.prototype.getUri = function getUri(config) {\n config = mergeConfig(this.defaults, config);\n return buildURL(config.url, config.params, config.paramsSerializer).replace(/^\\?/, '');\n};\n\n// Provide aliases for supported request methods\nutils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, config) {\n return this.request(mergeConfig(config || {}, {\n method: method,\n url: url,\n data: (config || {}).data\n }));\n };\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, data, config) {\n return this.request(mergeConfig(config || {}, {\n method: method,\n url: url,\n data: data\n }));\n };\n});\n\nmodule.exports = Axios;\n","'use strict';\n\nvar utils = require('./../utils');\n\nfunction InterceptorManager() {\n this.handlers = [];\n}\n\n/**\n * Add a new interceptor to the stack\n *\n * @param {Function} fulfilled The function to handle `then` for a `Promise`\n * @param {Function} rejected The function to handle `reject` for a `Promise`\n *\n * @return {Number} An ID used to remove interceptor later\n */\nInterceptorManager.prototype.use = function use(fulfilled, rejected, options) {\n this.handlers.push({\n fulfilled: fulfilled,\n rejected: rejected,\n synchronous: options ? options.synchronous : false,\n runWhen: options ? options.runWhen : null\n });\n return this.handlers.length - 1;\n};\n\n/**\n * Remove an interceptor from the stack\n *\n * @param {Number} id The ID that was returned by `use`\n */\nInterceptorManager.prototype.eject = function eject(id) {\n if (this.handlers[id]) {\n this.handlers[id] = null;\n }\n};\n\n/**\n * Iterate over all the registered interceptors\n *\n * This method is particularly useful for skipping over any\n * interceptors that may have become `null` calling `eject`.\n *\n * @param {Function} fn The function to call for each interceptor\n */\nInterceptorManager.prototype.forEach = function forEach(fn) {\n utils.forEach(this.handlers, function forEachHandler(h) {\n if (h !== null) {\n fn(h);\n }\n });\n};\n\nmodule.exports = InterceptorManager;\n","'use strict';\n\nvar utils = require('./../utils');\nvar transformData = require('./transformData');\nvar isCancel = require('../cancel/isCancel');\nvar defaults = require('../defaults');\n\n/**\n * Throws a `Cancel` if cancellation has been requested.\n */\nfunction throwIfCancellationRequested(config) {\n if (config.cancelToken) {\n config.cancelToken.throwIfRequested();\n }\n}\n\n/**\n * Dispatch a request to the server using the configured adapter.\n *\n * @param {object} config The config that is to be used for the request\n * @returns {Promise} The Promise to be fulfilled\n */\nmodule.exports = function dispatchRequest(config) {\n throwIfCancellationRequested(config);\n\n // Ensure headers exist\n config.headers = config.headers || {};\n\n // Transform request data\n config.data = transformData.call(\n config,\n config.data,\n config.headers,\n config.transformRequest\n );\n\n // Flatten headers\n config.headers = utils.merge(\n config.headers.common || {},\n config.headers[config.method] || {},\n config.headers\n );\n\n utils.forEach(\n ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],\n function cleanHeaderConfig(method) {\n delete config.headers[method];\n }\n );\n\n var adapter = config.adapter || defaults.adapter;\n\n return adapter(config).then(function onAdapterResolution(response) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n response.data = transformData.call(\n config,\n response.data,\n response.headers,\n config.transformResponse\n );\n\n return response;\n }, function onAdapterRejection(reason) {\n if (!isCancel(reason)) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n if (reason && reason.response) {\n reason.response.data = transformData.call(\n config,\n reason.response.data,\n reason.response.headers,\n config.transformResponse\n );\n }\n }\n\n return Promise.reject(reason);\n });\n};\n","'use strict';\n\nvar utils = require('./../utils');\nvar defaults = require('./../defaults');\n\n/**\n * Transform the data for a request or a response\n *\n * @param {Object|String} data The data to be transformed\n * @param {Array} headers The headers for the request or response\n * @param {Array|Function} fns A single function or Array of functions\n * @returns {*} The resulting transformed data\n */\nmodule.exports = function transformData(data, headers, fns) {\n var context = this || defaults;\n /*eslint no-param-reassign:0*/\n utils.forEach(fns, function transform(fn) {\n data = fn.call(context, data, headers);\n });\n\n return data;\n};\n","'use strict';\n\nvar utils = require('../utils');\n\nmodule.exports = function normalizeHeaderName(headers, normalizedName) {\n utils.forEach(headers, function processHeader(value, name) {\n if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) {\n headers[normalizedName] = value;\n delete headers[name];\n }\n });\n};\n","'use strict';\n\nvar createError = require('./createError');\n\n/**\n * Resolve or reject a Promise based on response status.\n *\n * @param {Function} resolve A function that resolves the promise.\n * @param {Function} reject A function that rejects the promise.\n * @param {object} response The response.\n */\nmodule.exports = function settle(resolve, reject, response) {\n var validateStatus = response.config.validateStatus;\n if (!response.status || !validateStatus || validateStatus(response.status)) {\n resolve(response);\n } else {\n reject(createError(\n 'Request failed with status code ' + response.status,\n response.config,\n null,\n response.request,\n response\n ));\n }\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\nmodule.exports = (\n utils.isStandardBrowserEnv() ?\n\n // Standard browser envs support document.cookie\n (function standardBrowserEnv() {\n return {\n write: function write(name, value, expires, path, domain, secure) {\n var cookie = [];\n cookie.push(name + '=' + encodeURIComponent(value));\n\n if (utils.isNumber(expires)) {\n cookie.push('expires=' + new Date(expires).toGMTString());\n }\n\n if (utils.isString(path)) {\n cookie.push('path=' + path);\n }\n\n if (utils.isString(domain)) {\n cookie.push('domain=' + domain);\n }\n\n if (secure === true) {\n cookie.push('secure');\n }\n\n document.cookie = cookie.join('; ');\n },\n\n read: function read(name) {\n var match = document.cookie.match(new RegExp('(^|;\\\\s*)(' + name + ')=([^;]*)'));\n return (match ? decodeURIComponent(match[3]) : null);\n },\n\n remove: function remove(name) {\n this.write(name, '', Date.now() - 86400000);\n }\n };\n })() :\n\n // Non standard browser env (web workers, react-native) lack needed support.\n (function nonStandardBrowserEnv() {\n return {\n write: function write() {},\n read: function read() { return null; },\n remove: function remove() {}\n };\n })()\n);\n","'use strict';\n\nvar isAbsoluteURL = require('../helpers/isAbsoluteURL');\nvar combineURLs = require('../helpers/combineURLs');\n\n/**\n * Creates a new URL by combining the baseURL with the requestedURL,\n * only when the requestedURL is not already an absolute URL.\n * If the requestURL is absolute, this function returns the requestedURL untouched.\n *\n * @param {string} baseURL The base URL\n * @param {string} requestedURL Absolute or relative URL to combine\n * @returns {string} The combined full path\n */\nmodule.exports = function buildFullPath(baseURL, requestedURL) {\n if (baseURL && !isAbsoluteURL(requestedURL)) {\n return combineURLs(baseURL, requestedURL);\n }\n return requestedURL;\n};\n","'use strict';\n\n/**\n * Determines whether the specified URL is absolute\n *\n * @param {string} url The URL to test\n * @returns {boolean} True if the specified URL is absolute, otherwise false\n */\nmodule.exports = function isAbsoluteURL(url) {\n // A URL is considered absolute if it begins with \"://\" or \"//\" (protocol-relative URL).\n // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed\n // by any combination of letters, digits, plus, period, or hyphen.\n return /^([a-z][a-z\\d\\+\\-\\.]*:)?\\/\\//i.test(url);\n};\n","'use strict';\n\n/**\n * Creates a new URL by combining the specified URLs\n *\n * @param {string} baseURL The base URL\n * @param {string} relativeURL The relative URL\n * @returns {string} The combined URL\n */\nmodule.exports = function combineURLs(baseURL, relativeURL) {\n return relativeURL\n ? baseURL.replace(/\\/+$/, '') + '/' + relativeURL.replace(/^\\/+/, '')\n : baseURL;\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\n// Headers whose duplicates are ignored by node\n// c.f. https://nodejs.org/api/http.html#http_message_headers\nvar ignoreDuplicateOf = [\n 'age', 'authorization', 'content-length', 'content-type', 'etag',\n 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',\n 'last-modified', 'location', 'max-forwards', 'proxy-authorization',\n 'referer', 'retry-after', 'user-agent'\n];\n\n/**\n * Parse headers into an object\n *\n * ```\n * Date: Wed, 27 Aug 2014 08:58:49 GMT\n * Content-Type: application/json\n * Connection: keep-alive\n * Transfer-Encoding: chunked\n * ```\n *\n * @param {String} headers Headers needing to be parsed\n * @returns {Object} Headers parsed into an object\n */\nmodule.exports = function parseHeaders(headers) {\n var parsed = {};\n var key;\n var val;\n var i;\n\n if (!headers) { return parsed; }\n\n utils.forEach(headers.split('\\n'), function parser(line) {\n i = line.indexOf(':');\n key = utils.trim(line.substr(0, i)).toLowerCase();\n val = utils.trim(line.substr(i + 1));\n\n if (key) {\n if (parsed[key] && ignoreDuplicateOf.indexOf(key) >= 0) {\n return;\n }\n if (key === 'set-cookie') {\n parsed[key] = (parsed[key] ? parsed[key] : []).concat([val]);\n } else {\n parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;\n }\n }\n });\n\n return parsed;\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\nmodule.exports = (\n utils.isStandardBrowserEnv() ?\n\n // Standard browser envs have full support of the APIs needed to test\n // whether the request URL is of the same origin as current location.\n (function standardBrowserEnv() {\n var msie = /(msie|trident)/i.test(navigator.userAgent);\n var urlParsingNode = document.createElement('a');\n var originURL;\n\n /**\n * Parse a URL to discover it's components\n *\n * @param {String} url The URL to be parsed\n * @returns {Object}\n */\n function resolveURL(url) {\n var href = url;\n\n if (msie) {\n // IE needs attribute set twice to normalize properties\n urlParsingNode.setAttribute('href', href);\n href = urlParsingNode.href;\n }\n\n urlParsingNode.setAttribute('href', href);\n\n // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils\n return {\n href: urlParsingNode.href,\n protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',\n host: urlParsingNode.host,\n search: urlParsingNode.search ? urlParsingNode.search.replace(/^\\?/, '') : '',\n hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',\n hostname: urlParsingNode.hostname,\n port: urlParsingNode.port,\n pathname: (urlParsingNode.pathname.charAt(0) === '/') ?\n urlParsingNode.pathname :\n '/' + urlParsingNode.pathname\n };\n }\n\n originURL = resolveURL(window.location.href);\n\n /**\n * Determine if a URL shares the same origin as the current location\n *\n * @param {String} requestURL The URL to test\n * @returns {boolean} True if URL shares the same origin, otherwise false\n */\n return function isURLSameOrigin(requestURL) {\n var parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL;\n return (parsed.protocol === originURL.protocol &&\n parsed.host === originURL.host);\n };\n })() :\n\n // Non standard browser envs (web workers, react-native) lack needed support.\n (function nonStandardBrowserEnv() {\n return function isURLSameOrigin() {\n return true;\n };\n })()\n);\n","'use strict';\n\nvar pkg = require('./../../package.json');\n\nvar validators = {};\n\n// eslint-disable-next-line func-names\n['object', 'boolean', 'number', 'function', 'string', 'symbol'].forEach(function(type, i) {\n validators[type] = function validator(thing) {\n return typeof thing === type || 'a' + (i < 1 ? 'n ' : ' ') + type;\n };\n});\n\nvar deprecatedWarnings = {};\nvar currentVerArr = pkg.version.split('.');\n\n/**\n * Compare package versions\n * @param {string} version\n * @param {string?} thanVersion\n * @returns {boolean}\n */\nfunction isOlderVersion(version, thanVersion) {\n var pkgVersionArr = thanVersion ? thanVersion.split('.') : currentVerArr;\n var destVer = version.split('.');\n for (var i = 0; i < 3; i++) {\n if (pkgVersionArr[i] > destVer[i]) {\n return true;\n } else if (pkgVersionArr[i] < destVer[i]) {\n return false;\n }\n }\n return false;\n}\n\n/**\n * Transitional option validator\n * @param {function|boolean?} validator\n * @param {string?} version\n * @param {string} message\n * @returns {function}\n */\nvalidators.transitional = function transitional(validator, version, message) {\n var isDeprecated = version && isOlderVersion(version);\n\n function formatMessage(opt, desc) {\n return '[Axios v' + pkg.version + '] Transitional option \\'' + opt + '\\'' + desc + (message ? '. ' + message : '');\n }\n\n // eslint-disable-next-line func-names\n return function(value, opt, opts) {\n if (validator === false) {\n throw new Error(formatMessage(opt, ' has been removed in ' + version));\n }\n\n if (isDeprecated && !deprecatedWarnings[opt]) {\n deprecatedWarnings[opt] = true;\n // eslint-disable-next-line no-console\n console.warn(\n formatMessage(\n opt,\n ' has been deprecated since v' + version + ' and will be removed in the near future'\n )\n );\n }\n\n return validator ? validator(value, opt, opts) : true;\n };\n};\n\n/**\n * Assert object's properties type\n * @param {object} options\n * @param {object} schema\n * @param {boolean?} allowUnknown\n */\n\nfunction assertOptions(options, schema, allowUnknown) {\n if (typeof options !== 'object') {\n throw new TypeError('options must be an object');\n }\n var keys = Object.keys(options);\n var i = keys.length;\n while (i-- > 0) {\n var opt = keys[i];\n var validator = schema[opt];\n if (validator) {\n var value = options[opt];\n var result = value === undefined || validator(value, opt, options);\n if (result !== true) {\n throw new TypeError('option ' + opt + ' must be ' + result);\n }\n continue;\n }\n if (allowUnknown !== true) {\n throw Error('Unknown option ' + opt);\n }\n }\n}\n\nmodule.exports = {\n isOlderVersion: isOlderVersion,\n assertOptions: assertOptions,\n validators: validators\n};\n","'use strict';\n\nvar Cancel = require('./Cancel');\n\n/**\n * A `CancelToken` is an object that can be used to request cancellation of an operation.\n *\n * @class\n * @param {Function} executor The executor function.\n */\nfunction CancelToken(executor) {\n if (typeof executor !== 'function') {\n throw new TypeError('executor must be a function.');\n }\n\n var resolvePromise;\n this.promise = new Promise(function promiseExecutor(resolve) {\n resolvePromise = resolve;\n });\n\n var token = this;\n executor(function cancel(message) {\n if (token.reason) {\n // Cancellation has already been requested\n return;\n }\n\n token.reason = new Cancel(message);\n resolvePromise(token.reason);\n });\n}\n\n/**\n * Throws a `Cancel` if cancellation has been requested.\n */\nCancelToken.prototype.throwIfRequested = function throwIfRequested() {\n if (this.reason) {\n throw this.reason;\n }\n};\n\n/**\n * Returns an object that contains a new `CancelToken` and a function that, when called,\n * cancels the `CancelToken`.\n */\nCancelToken.source = function source() {\n var cancel;\n var token = new CancelToken(function executor(c) {\n cancel = c;\n });\n return {\n token: token,\n cancel: cancel\n };\n};\n\nmodule.exports = CancelToken;\n","'use strict';\n\n/**\n * Syntactic sugar for invoking a function and expanding an array for arguments.\n *\n * Common use case would be to use `Function.prototype.apply`.\n *\n * ```js\n * function f(x, y, z) {}\n * var args = [1, 2, 3];\n * f.apply(null, args);\n * ```\n *\n * With `spread` this example can be re-written.\n *\n * ```js\n * spread(function(x, y, z) {})([1, 2, 3]);\n * ```\n *\n * @param {Function} callback\n * @returns {Function}\n */\nmodule.exports = function spread(callback) {\n return function wrap(arr) {\n return callback.apply(null, arr);\n };\n};\n","'use strict';\n\n/**\n * Determines whether the payload is an error thrown by Axios\n *\n * @param {*} payload The value to test\n * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false\n */\nmodule.exports = function isAxiosError(payload) {\n return (typeof payload === 'object') && (payload.isAxiosError === true);\n};\n"],"sourceRoot":""} \ No newline at end of file diff --git a/node_modules/tod-api/node_modules/axios/index.d.ts b/node_modules/tod-api/node_modules/axios/index.d.ts new file mode 100644 index 000000000..78f733f89 --- /dev/null +++ b/node_modules/tod-api/node_modules/axios/index.d.ts @@ -0,0 +1,168 @@ +export interface AxiosTransformer { + (data: any, headers?: any): any; +} + +export interface AxiosAdapter { + (config: AxiosRequestConfig): AxiosPromise; +} + +export interface AxiosBasicCredentials { + username: string; + password: string; +} + +export interface AxiosProxyConfig { + host: string; + port: number; + auth?: { + username: string; + password:string; + }; + protocol?: string; +} + +export type Method = + | 'get' | 'GET' + | 'delete' | 'DELETE' + | 'head' | 'HEAD' + | 'options' | 'OPTIONS' + | 'post' | 'POST' + | 'put' | 'PUT' + | 'patch' | 'PATCH' + | 'purge' | 'PURGE' + | 'link' | 'LINK' + | 'unlink' | 'UNLINK' + +export type ResponseType = + | 'arraybuffer' + | 'blob' + | 'document' + | 'json' + | 'text' + | 'stream' + +export interface TransitionalOptions{ + silentJSONParsing: boolean; + forcedJSONParsing: boolean; + clarifyTimeoutError: boolean; +} + +export interface AxiosRequestConfig { + url?: string; + method?: Method; + baseURL?: string; + transformRequest?: AxiosTransformer | AxiosTransformer[]; + transformResponse?: AxiosTransformer | AxiosTransformer[]; + headers?: any; + params?: any; + paramsSerializer?: (params: any) => string; + data?: any; + timeout?: number; + timeoutErrorMessage?: string; + withCredentials?: boolean; + adapter?: AxiosAdapter; + auth?: AxiosBasicCredentials; + responseType?: ResponseType; + xsrfCookieName?: string; + xsrfHeaderName?: string; + onUploadProgress?: (progressEvent: any) => void; + onDownloadProgress?: (progressEvent: any) => void; + maxContentLength?: number; + validateStatus?: ((status: number) => boolean) | null; + maxBodyLength?: number; + maxRedirects?: number; + socketPath?: string | null; + httpAgent?: any; + httpsAgent?: any; + proxy?: AxiosProxyConfig | false; + cancelToken?: CancelToken; + decompress?: boolean; + transitional?: TransitionalOptions +} + +export interface AxiosResponse { + data: T; + status: number; + statusText: string; + headers: any; + config: AxiosRequestConfig; + request?: any; +} + +export interface AxiosError extends Error { + config: AxiosRequestConfig; + code?: string; + request?: any; + response?: AxiosResponse; + isAxiosError: boolean; + toJSON: () => object; +} + +export interface AxiosPromise extends Promise> { +} + +export interface CancelStatic { + new (message?: string): Cancel; +} + +export interface Cancel { + message: string; +} + +export interface Canceler { + (message?: string): void; +} + +export interface CancelTokenStatic { + new (executor: (cancel: Canceler) => void): CancelToken; + source(): CancelTokenSource; +} + +export interface CancelToken { + promise: Promise; + reason?: Cancel; + throwIfRequested(): void; +} + +export interface CancelTokenSource { + token: CancelToken; + cancel: Canceler; +} + +export interface AxiosInterceptorManager { + use(onFulfilled?: (value: V) => T | Promise, onRejected?: (error: any) => any): number; + eject(id: number): void; +} + +export interface AxiosInstance { + (config: AxiosRequestConfig): AxiosPromise; + (url: string, config?: AxiosRequestConfig): AxiosPromise; + defaults: AxiosRequestConfig; + interceptors: { + request: AxiosInterceptorManager; + response: AxiosInterceptorManager; + }; + getUri(config?: AxiosRequestConfig): string; + request> (config: AxiosRequestConfig): Promise; + get>(url: string, config?: AxiosRequestConfig): Promise; + delete>(url: string, config?: AxiosRequestConfig): Promise; + head>(url: string, config?: AxiosRequestConfig): Promise; + options>(url: string, config?: AxiosRequestConfig): Promise; + post>(url: string, data?: any, config?: AxiosRequestConfig): Promise; + put>(url: string, data?: any, config?: AxiosRequestConfig): Promise; + patch>(url: string, data?: any, config?: AxiosRequestConfig): Promise; +} + +export interface AxiosStatic extends AxiosInstance { + create(config?: AxiosRequestConfig): AxiosInstance; + Cancel: CancelStatic; + CancelToken: CancelTokenStatic; + isCancel(value: any): boolean; + all(values: (T | Promise)[]): Promise; + spread(callback: (...args: T[]) => R): (array: T[]) => R; + isAxiosError(payload: any): payload is AxiosError; +} + +declare const axios: AxiosStatic; + +export default axios; diff --git a/node_modules/tod-api/node_modules/axios/index.js b/node_modules/tod-api/node_modules/axios/index.js new file mode 100644 index 000000000..79dfd09dd --- /dev/null +++ b/node_modules/tod-api/node_modules/axios/index.js @@ -0,0 +1 @@ +module.exports = require('./lib/axios'); \ No newline at end of file diff --git a/node_modules/tod-api/node_modules/axios/lib/adapters/README.md b/node_modules/tod-api/node_modules/axios/lib/adapters/README.md new file mode 100644 index 000000000..68f111895 --- /dev/null +++ b/node_modules/tod-api/node_modules/axios/lib/adapters/README.md @@ -0,0 +1,37 @@ +# axios // adapters + +The modules under `adapters/` are modules that handle dispatching a request and settling a returned `Promise` once a response is received. + +## Example + +```js +var settle = require('./../core/settle'); + +module.exports = function myAdapter(config) { + // At this point: + // - config has been merged with defaults + // - request transformers have already run + // - request interceptors have already run + + // Make the request using config provided + // Upon response settle the Promise + + return new Promise(function(resolve, reject) { + + var response = { + data: responseData, + status: request.status, + statusText: request.statusText, + headers: responseHeaders, + config: config, + request: request + }; + + settle(resolve, reject, response); + + // From here: + // - response transformers will run + // - response interceptors will run + }); +} +``` diff --git a/node_modules/tod-api/node_modules/axios/lib/adapters/http.js b/node_modules/tod-api/node_modules/axios/lib/adapters/http.js new file mode 100644 index 000000000..0cca3bdfb --- /dev/null +++ b/node_modules/tod-api/node_modules/axios/lib/adapters/http.js @@ -0,0 +1,331 @@ +'use strict'; + +var utils = require('./../utils'); +var settle = require('./../core/settle'); +var buildFullPath = require('../core/buildFullPath'); +var buildURL = require('./../helpers/buildURL'); +var http = require('http'); +var https = require('https'); +var httpFollow = require('follow-redirects').http; +var httpsFollow = require('follow-redirects').https; +var url = require('url'); +var zlib = require('zlib'); +var pkg = require('./../../package.json'); +var createError = require('../core/createError'); +var enhanceError = require('../core/enhanceError'); + +var isHttps = /https:?/; + +/** + * + * @param {http.ClientRequestArgs} options + * @param {AxiosProxyConfig} proxy + * @param {string} location + */ +function setProxy(options, proxy, location) { + options.hostname = proxy.host; + options.host = proxy.host; + options.port = proxy.port; + options.path = location; + + // Basic proxy authorization + if (proxy.auth) { + var base64 = Buffer.from(proxy.auth.username + ':' + proxy.auth.password, 'utf8').toString('base64'); + options.headers['Proxy-Authorization'] = 'Basic ' + base64; + } + + // If a proxy is used, any redirects must also pass through the proxy + options.beforeRedirect = function beforeRedirect(redirection) { + redirection.headers.host = redirection.host; + setProxy(redirection, proxy, redirection.href); + }; +} + +/*eslint consistent-return:0*/ +module.exports = function httpAdapter(config) { + return new Promise(function dispatchHttpRequest(resolvePromise, rejectPromise) { + var resolve = function resolve(value) { + resolvePromise(value); + }; + var reject = function reject(value) { + rejectPromise(value); + }; + var data = config.data; + var headers = config.headers; + + // Set User-Agent (required by some servers) + // See https://github.com/axios/axios/issues/69 + if ('User-Agent' in headers || 'user-agent' in headers) { + // User-Agent is specified; handle case where no UA header is desired + if (!headers['User-Agent'] && !headers['user-agent']) { + delete headers['User-Agent']; + delete headers['user-agent']; + } + // Otherwise, use specified value + } else { + // Only set header if it hasn't been set in config + headers['User-Agent'] = 'axios/' + pkg.version; + } + + if (data && !utils.isStream(data)) { + if (Buffer.isBuffer(data)) { + // Nothing to do... + } else if (utils.isArrayBuffer(data)) { + data = Buffer.from(new Uint8Array(data)); + } else if (utils.isString(data)) { + data = Buffer.from(data, 'utf-8'); + } else { + return reject(createError( + 'Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream', + config + )); + } + + // Add Content-Length header if data exists + headers['Content-Length'] = data.length; + } + + // HTTP basic authentication + var auth = undefined; + if (config.auth) { + var username = config.auth.username || ''; + var password = config.auth.password || ''; + auth = username + ':' + password; + } + + // Parse url + var fullPath = buildFullPath(config.baseURL, config.url); + var parsed = url.parse(fullPath); + var protocol = parsed.protocol || 'http:'; + + if (!auth && parsed.auth) { + var urlAuth = parsed.auth.split(':'); + var urlUsername = urlAuth[0] || ''; + var urlPassword = urlAuth[1] || ''; + auth = urlUsername + ':' + urlPassword; + } + + if (auth) { + delete headers.Authorization; + } + + var isHttpsRequest = isHttps.test(protocol); + var agent = isHttpsRequest ? config.httpsAgent : config.httpAgent; + + var options = { + path: buildURL(parsed.path, config.params, config.paramsSerializer).replace(/^\?/, ''), + method: config.method.toUpperCase(), + headers: headers, + agent: agent, + agents: { http: config.httpAgent, https: config.httpsAgent }, + auth: auth + }; + + if (config.socketPath) { + options.socketPath = config.socketPath; + } else { + options.hostname = parsed.hostname; + options.port = parsed.port; + } + + var proxy = config.proxy; + if (!proxy && proxy !== false) { + var proxyEnv = protocol.slice(0, -1) + '_proxy'; + var proxyUrl = process.env[proxyEnv] || process.env[proxyEnv.toUpperCase()]; + if (proxyUrl) { + var parsedProxyUrl = url.parse(proxyUrl); + var noProxyEnv = process.env.no_proxy || process.env.NO_PROXY; + var shouldProxy = true; + + if (noProxyEnv) { + var noProxy = noProxyEnv.split(',').map(function trim(s) { + return s.trim(); + }); + + shouldProxy = !noProxy.some(function proxyMatch(proxyElement) { + if (!proxyElement) { + return false; + } + if (proxyElement === '*') { + return true; + } + if (proxyElement[0] === '.' && + parsed.hostname.substr(parsed.hostname.length - proxyElement.length) === proxyElement) { + return true; + } + + return parsed.hostname === proxyElement; + }); + } + + if (shouldProxy) { + proxy = { + host: parsedProxyUrl.hostname, + port: parsedProxyUrl.port, + protocol: parsedProxyUrl.protocol + }; + + if (parsedProxyUrl.auth) { + var proxyUrlAuth = parsedProxyUrl.auth.split(':'); + proxy.auth = { + username: proxyUrlAuth[0], + password: proxyUrlAuth[1] + }; + } + } + } + } + + if (proxy) { + options.headers.host = parsed.hostname + (parsed.port ? ':' + parsed.port : ''); + setProxy(options, proxy, protocol + '//' + parsed.hostname + (parsed.port ? ':' + parsed.port : '') + options.path); + } + + var transport; + var isHttpsProxy = isHttpsRequest && (proxy ? isHttps.test(proxy.protocol) : true); + if (config.transport) { + transport = config.transport; + } else if (config.maxRedirects === 0) { + transport = isHttpsProxy ? https : http; + } else { + if (config.maxRedirects) { + options.maxRedirects = config.maxRedirects; + } + transport = isHttpsProxy ? httpsFollow : httpFollow; + } + + if (config.maxBodyLength > -1) { + options.maxBodyLength = config.maxBodyLength; + } + + // Create the request + var req = transport.request(options, function handleResponse(res) { + if (req.aborted) return; + + // uncompress the response body transparently if required + var stream = res; + + // return the last request in case of redirects + var lastRequest = res.req || req; + + + // if no content, is HEAD request or decompress disabled we should not decompress + if (res.statusCode !== 204 && lastRequest.method !== 'HEAD' && config.decompress !== false) { + switch (res.headers['content-encoding']) { + /*eslint default-case:0*/ + case 'gzip': + case 'compress': + case 'deflate': + // add the unzipper to the body stream processing pipeline + stream = stream.pipe(zlib.createUnzip()); + + // remove the content-encoding in order to not confuse downstream operations + delete res.headers['content-encoding']; + break; + } + } + + var response = { + status: res.statusCode, + statusText: res.statusMessage, + headers: res.headers, + config: config, + request: lastRequest + }; + + if (config.responseType === 'stream') { + response.data = stream; + settle(resolve, reject, response); + } else { + var responseBuffer = []; + var totalResponseBytes = 0; + stream.on('data', function handleStreamData(chunk) { + responseBuffer.push(chunk); + totalResponseBytes += chunk.length; + + // make sure the content length is not over the maxContentLength if specified + if (config.maxContentLength > -1 && totalResponseBytes > config.maxContentLength) { + stream.destroy(); + reject(createError('maxContentLength size of ' + config.maxContentLength + ' exceeded', + config, null, lastRequest)); + } + }); + + stream.on('error', function handleStreamError(err) { + if (req.aborted) return; + reject(enhanceError(err, config, null, lastRequest)); + }); + + stream.on('end', function handleStreamEnd() { + var responseData = Buffer.concat(responseBuffer); + if (config.responseType !== 'arraybuffer') { + responseData = responseData.toString(config.responseEncoding); + if (!config.responseEncoding || config.responseEncoding === 'utf8') { + responseData = utils.stripBOM(responseData); + } + } + + response.data = responseData; + settle(resolve, reject, response); + }); + } + }); + + // Handle errors + req.on('error', function handleRequestError(err) { + if (req.aborted && err.code !== 'ERR_FR_TOO_MANY_REDIRECTS') return; + reject(enhanceError(err, config, null, req)); + }); + + // Handle request timeout + if (config.timeout) { + // This is forcing a int timeout to avoid problems if the `req` interface doesn't handle other types. + var timeout = parseInt(config.timeout, 10); + + if (isNaN(timeout)) { + reject(createError( + 'error trying to parse `config.timeout` to int', + config, + 'ERR_PARSE_TIMEOUT', + req + )); + + return; + } + + // Sometime, the response will be very slow, and does not respond, the connect event will be block by event loop system. + // And timer callback will be fired, and abort() will be invoked before connection, then get "socket hang up" and code ECONNRESET. + // At this time, if we have a large number of request, nodejs will hang up some socket on background. and the number will up and up. + // And then these socket which be hang up will devoring CPU little by little. + // ClientRequest.setTimeout will be fired on the specify milliseconds, and can make sure that abort() will be fired after connect. + req.setTimeout(timeout, function handleRequestTimeout() { + req.abort(); + reject(createError( + 'timeout of ' + timeout + 'ms exceeded', + config, + config.transitional && config.transitional.clarifyTimeoutError ? 'ETIMEDOUT' : 'ECONNABORTED', + req + )); + }); + } + + if (config.cancelToken) { + // Handle cancellation + config.cancelToken.promise.then(function onCanceled(cancel) { + if (req.aborted) return; + + req.abort(); + reject(cancel); + }); + } + + // Send the request + if (utils.isStream(data)) { + data.on('error', function handleStreamError(err) { + reject(enhanceError(err, config, null, req)); + }).pipe(req); + } else { + req.end(data); + } + }); +}; diff --git a/node_modules/tod-api/node_modules/axios/lib/adapters/xhr.js b/node_modules/tod-api/node_modules/axios/lib/adapters/xhr.js new file mode 100644 index 000000000..a386dd24a --- /dev/null +++ b/node_modules/tod-api/node_modules/axios/lib/adapters/xhr.js @@ -0,0 +1,189 @@ +'use strict'; + +var utils = require('./../utils'); +var settle = require('./../core/settle'); +var cookies = require('./../helpers/cookies'); +var buildURL = require('./../helpers/buildURL'); +var buildFullPath = require('../core/buildFullPath'); +var parseHeaders = require('./../helpers/parseHeaders'); +var isURLSameOrigin = require('./../helpers/isURLSameOrigin'); +var createError = require('../core/createError'); + +module.exports = function xhrAdapter(config) { + return new Promise(function dispatchXhrRequest(resolve, reject) { + var requestData = config.data; + var requestHeaders = config.headers; + var responseType = config.responseType; + + if (utils.isFormData(requestData)) { + delete requestHeaders['Content-Type']; // Let the browser set it + } + + var request = new XMLHttpRequest(); + + // HTTP basic authentication + if (config.auth) { + var username = config.auth.username || ''; + var password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : ''; + requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password); + } + + var fullPath = buildFullPath(config.baseURL, config.url); + request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true); + + // Set the request timeout in MS + request.timeout = config.timeout; + + function onloadend() { + if (!request) { + return; + } + // Prepare the response + var responseHeaders = 'getAllResponseHeaders' in request ? parseHeaders(request.getAllResponseHeaders()) : null; + var responseData = !responseType || responseType === 'text' || responseType === 'json' ? + request.responseText : request.response; + var response = { + data: responseData, + status: request.status, + statusText: request.statusText, + headers: responseHeaders, + config: config, + request: request + }; + + settle(resolve, reject, response); + + // Clean up request + request = null; + } + + if ('onloadend' in request) { + // Use onloadend if available + request.onloadend = onloadend; + } else { + // Listen for ready state to emulate onloadend + request.onreadystatechange = function handleLoad() { + if (!request || request.readyState !== 4) { + return; + } + + // The request errored out and we didn't get a response, this will be + // handled by onerror instead + // With one exception: request that using file: protocol, most browsers + // will return status as 0 even though it's a successful request + if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) { + return; + } + // readystate handler is calling before onerror or ontimeout handlers, + // so we should call onloadend on the next 'tick' + setTimeout(onloadend); + }; + } + + // Handle browser request cancellation (as opposed to a manual cancellation) + request.onabort = function handleAbort() { + if (!request) { + return; + } + + reject(createError('Request aborted', config, 'ECONNABORTED', request)); + + // Clean up request + request = null; + }; + + // Handle low level network errors + request.onerror = function handleError() { + // Real errors are hidden from us by the browser + // onerror should only fire if it's a network error + reject(createError('Network Error', config, null, request)); + + // Clean up request + request = null; + }; + + // Handle timeout + request.ontimeout = function handleTimeout() { + var timeoutErrorMessage = 'timeout of ' + config.timeout + 'ms exceeded'; + if (config.timeoutErrorMessage) { + timeoutErrorMessage = config.timeoutErrorMessage; + } + reject(createError( + timeoutErrorMessage, + config, + config.transitional && config.transitional.clarifyTimeoutError ? 'ETIMEDOUT' : 'ECONNABORTED', + request)); + + // Clean up request + request = null; + }; + + // Add xsrf header + // This is only done if running in a standard browser environment. + // Specifically not if we're in a web worker, or react-native. + if (utils.isStandardBrowserEnv()) { + // Add xsrf header + var xsrfValue = (config.withCredentials || isURLSameOrigin(fullPath)) && config.xsrfCookieName ? + cookies.read(config.xsrfCookieName) : + undefined; + + if (xsrfValue) { + requestHeaders[config.xsrfHeaderName] = xsrfValue; + } + } + + // Add headers to the request + if ('setRequestHeader' in request) { + utils.forEach(requestHeaders, function setRequestHeader(val, key) { + if (typeof requestData === 'undefined' && key.toLowerCase() === 'content-type') { + // Remove Content-Type if data is undefined + delete requestHeaders[key]; + } else { + // Otherwise add header to the request + request.setRequestHeader(key, val); + } + }); + } + + // Add withCredentials to request if needed + if (!utils.isUndefined(config.withCredentials)) { + request.withCredentials = !!config.withCredentials; + } + + // Add responseType to request if needed + if (responseType && responseType !== 'json') { + request.responseType = config.responseType; + } + + // Handle progress if needed + if (typeof config.onDownloadProgress === 'function') { + request.addEventListener('progress', config.onDownloadProgress); + } + + // Not all browsers support upload events + if (typeof config.onUploadProgress === 'function' && request.upload) { + request.upload.addEventListener('progress', config.onUploadProgress); + } + + if (config.cancelToken) { + // Handle cancellation + config.cancelToken.promise.then(function onCanceled(cancel) { + if (!request) { + return; + } + + request.abort(); + reject(cancel); + // Clean up request + request = null; + }); + } + + if (!requestData) { + requestData = null; + } + + // Send the request + request.send(requestData); + }); +}; diff --git a/node_modules/tod-api/node_modules/axios/lib/axios.js b/node_modules/tod-api/node_modules/axios/lib/axios.js new file mode 100644 index 000000000..c6357b005 --- /dev/null +++ b/node_modules/tod-api/node_modules/axios/lib/axios.js @@ -0,0 +1,56 @@ +'use strict'; + +var utils = require('./utils'); +var bind = require('./helpers/bind'); +var Axios = require('./core/Axios'); +var mergeConfig = require('./core/mergeConfig'); +var defaults = require('./defaults'); + +/** + * Create an instance of Axios + * + * @param {Object} defaultConfig The default config for the instance + * @return {Axios} A new instance of Axios + */ +function createInstance(defaultConfig) { + var context = new Axios(defaultConfig); + var instance = bind(Axios.prototype.request, context); + + // Copy axios.prototype to instance + utils.extend(instance, Axios.prototype, context); + + // Copy context to instance + utils.extend(instance, context); + + return instance; +} + +// Create the default instance to be exported +var axios = createInstance(defaults); + +// Expose Axios class to allow class inheritance +axios.Axios = Axios; + +// Factory for creating new instances +axios.create = function create(instanceConfig) { + return createInstance(mergeConfig(axios.defaults, instanceConfig)); +}; + +// Expose Cancel & CancelToken +axios.Cancel = require('./cancel/Cancel'); +axios.CancelToken = require('./cancel/CancelToken'); +axios.isCancel = require('./cancel/isCancel'); + +// Expose all/spread +axios.all = function all(promises) { + return Promise.all(promises); +}; +axios.spread = require('./helpers/spread'); + +// Expose isAxiosError +axios.isAxiosError = require('./helpers/isAxiosError'); + +module.exports = axios; + +// Allow use of default import syntax in TypeScript +module.exports.default = axios; diff --git a/node_modules/tod-api/node_modules/axios/lib/cancel/Cancel.js b/node_modules/tod-api/node_modules/axios/lib/cancel/Cancel.js new file mode 100644 index 000000000..e0de4003f --- /dev/null +++ b/node_modules/tod-api/node_modules/axios/lib/cancel/Cancel.js @@ -0,0 +1,19 @@ +'use strict'; + +/** + * A `Cancel` is an object that is thrown when an operation is canceled. + * + * @class + * @param {string=} message The message. + */ +function Cancel(message) { + this.message = message; +} + +Cancel.prototype.toString = function toString() { + return 'Cancel' + (this.message ? ': ' + this.message : ''); +}; + +Cancel.prototype.__CANCEL__ = true; + +module.exports = Cancel; diff --git a/node_modules/tod-api/node_modules/axios/lib/cancel/CancelToken.js b/node_modules/tod-api/node_modules/axios/lib/cancel/CancelToken.js new file mode 100644 index 000000000..6b46e6662 --- /dev/null +++ b/node_modules/tod-api/node_modules/axios/lib/cancel/CancelToken.js @@ -0,0 +1,57 @@ +'use strict'; + +var Cancel = require('./Cancel'); + +/** + * A `CancelToken` is an object that can be used to request cancellation of an operation. + * + * @class + * @param {Function} executor The executor function. + */ +function CancelToken(executor) { + if (typeof executor !== 'function') { + throw new TypeError('executor must be a function.'); + } + + var resolvePromise; + this.promise = new Promise(function promiseExecutor(resolve) { + resolvePromise = resolve; + }); + + var token = this; + executor(function cancel(message) { + if (token.reason) { + // Cancellation has already been requested + return; + } + + token.reason = new Cancel(message); + resolvePromise(token.reason); + }); +} + +/** + * Throws a `Cancel` if cancellation has been requested. + */ +CancelToken.prototype.throwIfRequested = function throwIfRequested() { + if (this.reason) { + throw this.reason; + } +}; + +/** + * Returns an object that contains a new `CancelToken` and a function that, when called, + * cancels the `CancelToken`. + */ +CancelToken.source = function source() { + var cancel; + var token = new CancelToken(function executor(c) { + cancel = c; + }); + return { + token: token, + cancel: cancel + }; +}; + +module.exports = CancelToken; diff --git a/node_modules/tod-api/node_modules/axios/lib/cancel/isCancel.js b/node_modules/tod-api/node_modules/axios/lib/cancel/isCancel.js new file mode 100644 index 000000000..051f3ae4c --- /dev/null +++ b/node_modules/tod-api/node_modules/axios/lib/cancel/isCancel.js @@ -0,0 +1,5 @@ +'use strict'; + +module.exports = function isCancel(value) { + return !!(value && value.__CANCEL__); +}; diff --git a/node_modules/tod-api/node_modules/axios/lib/core/Axios.js b/node_modules/tod-api/node_modules/axios/lib/core/Axios.js new file mode 100644 index 000000000..42ea75e7e --- /dev/null +++ b/node_modules/tod-api/node_modules/axios/lib/core/Axios.js @@ -0,0 +1,148 @@ +'use strict'; + +var utils = require('./../utils'); +var buildURL = require('../helpers/buildURL'); +var InterceptorManager = require('./InterceptorManager'); +var dispatchRequest = require('./dispatchRequest'); +var mergeConfig = require('./mergeConfig'); +var validator = require('../helpers/validator'); + +var validators = validator.validators; +/** + * Create a new instance of Axios + * + * @param {Object} instanceConfig The default config for the instance + */ +function Axios(instanceConfig) { + this.defaults = instanceConfig; + this.interceptors = { + request: new InterceptorManager(), + response: new InterceptorManager() + }; +} + +/** + * Dispatch a request + * + * @param {Object} config The config specific for this request (merged with this.defaults) + */ +Axios.prototype.request = function request(config) { + /*eslint no-param-reassign:0*/ + // Allow for axios('example/url'[, config]) a la fetch API + if (typeof config === 'string') { + config = arguments[1] || {}; + config.url = arguments[0]; + } else { + config = config || {}; + } + + config = mergeConfig(this.defaults, config); + + // Set config.method + if (config.method) { + config.method = config.method.toLowerCase(); + } else if (this.defaults.method) { + config.method = this.defaults.method.toLowerCase(); + } else { + config.method = 'get'; + } + + var transitional = config.transitional; + + if (transitional !== undefined) { + validator.assertOptions(transitional, { + silentJSONParsing: validators.transitional(validators.boolean, '1.0.0'), + forcedJSONParsing: validators.transitional(validators.boolean, '1.0.0'), + clarifyTimeoutError: validators.transitional(validators.boolean, '1.0.0') + }, false); + } + + // filter out skipped interceptors + var requestInterceptorChain = []; + var synchronousRequestInterceptors = true; + this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) { + if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) { + return; + } + + synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous; + + requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected); + }); + + var responseInterceptorChain = []; + this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) { + responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected); + }); + + var promise; + + if (!synchronousRequestInterceptors) { + var chain = [dispatchRequest, undefined]; + + Array.prototype.unshift.apply(chain, requestInterceptorChain); + chain = chain.concat(responseInterceptorChain); + + promise = Promise.resolve(config); + while (chain.length) { + promise = promise.then(chain.shift(), chain.shift()); + } + + return promise; + } + + + var newConfig = config; + while (requestInterceptorChain.length) { + var onFulfilled = requestInterceptorChain.shift(); + var onRejected = requestInterceptorChain.shift(); + try { + newConfig = onFulfilled(newConfig); + } catch (error) { + onRejected(error); + break; + } + } + + try { + promise = dispatchRequest(newConfig); + } catch (error) { + return Promise.reject(error); + } + + while (responseInterceptorChain.length) { + promise = promise.then(responseInterceptorChain.shift(), responseInterceptorChain.shift()); + } + + return promise; +}; + +Axios.prototype.getUri = function getUri(config) { + config = mergeConfig(this.defaults, config); + return buildURL(config.url, config.params, config.paramsSerializer).replace(/^\?/, ''); +}; + +// Provide aliases for supported request methods +utils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) { + /*eslint func-names:0*/ + Axios.prototype[method] = function(url, config) { + return this.request(mergeConfig(config || {}, { + method: method, + url: url, + data: (config || {}).data + })); + }; +}); + +utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) { + /*eslint func-names:0*/ + Axios.prototype[method] = function(url, data, config) { + return this.request(mergeConfig(config || {}, { + method: method, + url: url, + data: data + })); + }; +}); + +module.exports = Axios; diff --git a/node_modules/tod-api/node_modules/axios/lib/core/InterceptorManager.js b/node_modules/tod-api/node_modules/axios/lib/core/InterceptorManager.js new file mode 100644 index 000000000..900f44880 --- /dev/null +++ b/node_modules/tod-api/node_modules/axios/lib/core/InterceptorManager.js @@ -0,0 +1,54 @@ +'use strict'; + +var utils = require('./../utils'); + +function InterceptorManager() { + this.handlers = []; +} + +/** + * Add a new interceptor to the stack + * + * @param {Function} fulfilled The function to handle `then` for a `Promise` + * @param {Function} rejected The function to handle `reject` for a `Promise` + * + * @return {Number} An ID used to remove interceptor later + */ +InterceptorManager.prototype.use = function use(fulfilled, rejected, options) { + this.handlers.push({ + fulfilled: fulfilled, + rejected: rejected, + synchronous: options ? options.synchronous : false, + runWhen: options ? options.runWhen : null + }); + return this.handlers.length - 1; +}; + +/** + * Remove an interceptor from the stack + * + * @param {Number} id The ID that was returned by `use` + */ +InterceptorManager.prototype.eject = function eject(id) { + if (this.handlers[id]) { + this.handlers[id] = null; + } +}; + +/** + * Iterate over all the registered interceptors + * + * This method is particularly useful for skipping over any + * interceptors that may have become `null` calling `eject`. + * + * @param {Function} fn The function to call for each interceptor + */ +InterceptorManager.prototype.forEach = function forEach(fn) { + utils.forEach(this.handlers, function forEachHandler(h) { + if (h !== null) { + fn(h); + } + }); +}; + +module.exports = InterceptorManager; diff --git a/node_modules/tod-api/node_modules/axios/lib/core/README.md b/node_modules/tod-api/node_modules/axios/lib/core/README.md new file mode 100644 index 000000000..84559ce7c --- /dev/null +++ b/node_modules/tod-api/node_modules/axios/lib/core/README.md @@ -0,0 +1,8 @@ +# axios // core + +The modules found in `core/` should be modules that are specific to the domain logic of axios. These modules would most likely not make sense to be consumed outside of the axios module, as their logic is too specific. Some examples of core modules are: + +- Dispatching requests + - Requests sent via `adapters/` (see lib/adapters/README.md) +- Managing interceptors +- Handling config diff --git a/node_modules/tod-api/node_modules/axios/lib/core/buildFullPath.js b/node_modules/tod-api/node_modules/axios/lib/core/buildFullPath.js new file mode 100644 index 000000000..00b2b050a --- /dev/null +++ b/node_modules/tod-api/node_modules/axios/lib/core/buildFullPath.js @@ -0,0 +1,20 @@ +'use strict'; + +var isAbsoluteURL = require('../helpers/isAbsoluteURL'); +var combineURLs = require('../helpers/combineURLs'); + +/** + * Creates a new URL by combining the baseURL with the requestedURL, + * only when the requestedURL is not already an absolute URL. + * If the requestURL is absolute, this function returns the requestedURL untouched. + * + * @param {string} baseURL The base URL + * @param {string} requestedURL Absolute or relative URL to combine + * @returns {string} The combined full path + */ +module.exports = function buildFullPath(baseURL, requestedURL) { + if (baseURL && !isAbsoluteURL(requestedURL)) { + return combineURLs(baseURL, requestedURL); + } + return requestedURL; +}; diff --git a/node_modules/tod-api/node_modules/axios/lib/core/createError.js b/node_modules/tod-api/node_modules/axios/lib/core/createError.js new file mode 100644 index 000000000..933680f69 --- /dev/null +++ b/node_modules/tod-api/node_modules/axios/lib/core/createError.js @@ -0,0 +1,18 @@ +'use strict'; + +var enhanceError = require('./enhanceError'); + +/** + * Create an Error with the specified message, config, error code, request and response. + * + * @param {string} message The error message. + * @param {Object} config The config. + * @param {string} [code] The error code (for example, 'ECONNABORTED'). + * @param {Object} [request] The request. + * @param {Object} [response] The response. + * @returns {Error} The created error. + */ +module.exports = function createError(message, config, code, request, response) { + var error = new Error(message); + return enhanceError(error, config, code, request, response); +}; diff --git a/node_modules/tod-api/node_modules/axios/lib/core/dispatchRequest.js b/node_modules/tod-api/node_modules/axios/lib/core/dispatchRequest.js new file mode 100644 index 000000000..9ce3b96e6 --- /dev/null +++ b/node_modules/tod-api/node_modules/axios/lib/core/dispatchRequest.js @@ -0,0 +1,82 @@ +'use strict'; + +var utils = require('./../utils'); +var transformData = require('./transformData'); +var isCancel = require('../cancel/isCancel'); +var defaults = require('../defaults'); + +/** + * Throws a `Cancel` if cancellation has been requested. + */ +function throwIfCancellationRequested(config) { + if (config.cancelToken) { + config.cancelToken.throwIfRequested(); + } +} + +/** + * Dispatch a request to the server using the configured adapter. + * + * @param {object} config The config that is to be used for the request + * @returns {Promise} The Promise to be fulfilled + */ +module.exports = function dispatchRequest(config) { + throwIfCancellationRequested(config); + + // Ensure headers exist + config.headers = config.headers || {}; + + // Transform request data + config.data = transformData.call( + config, + config.data, + config.headers, + config.transformRequest + ); + + // Flatten headers + config.headers = utils.merge( + config.headers.common || {}, + config.headers[config.method] || {}, + config.headers + ); + + utils.forEach( + ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'], + function cleanHeaderConfig(method) { + delete config.headers[method]; + } + ); + + var adapter = config.adapter || defaults.adapter; + + return adapter(config).then(function onAdapterResolution(response) { + throwIfCancellationRequested(config); + + // Transform response data + response.data = transformData.call( + config, + response.data, + response.headers, + config.transformResponse + ); + + return response; + }, function onAdapterRejection(reason) { + if (!isCancel(reason)) { + throwIfCancellationRequested(config); + + // Transform response data + if (reason && reason.response) { + reason.response.data = transformData.call( + config, + reason.response.data, + reason.response.headers, + config.transformResponse + ); + } + } + + return Promise.reject(reason); + }); +}; diff --git a/node_modules/tod-api/node_modules/axios/lib/core/enhanceError.js b/node_modules/tod-api/node_modules/axios/lib/core/enhanceError.js new file mode 100644 index 000000000..b6bc4444e --- /dev/null +++ b/node_modules/tod-api/node_modules/axios/lib/core/enhanceError.js @@ -0,0 +1,42 @@ +'use strict'; + +/** + * Update an Error with the specified config, error code, and response. + * + * @param {Error} error The error to update. + * @param {Object} config The config. + * @param {string} [code] The error code (for example, 'ECONNABORTED'). + * @param {Object} [request] The request. + * @param {Object} [response] The response. + * @returns {Error} The error. + */ +module.exports = function enhanceError(error, config, code, request, response) { + error.config = config; + if (code) { + error.code = code; + } + + error.request = request; + error.response = response; + error.isAxiosError = true; + + error.toJSON = function toJSON() { + return { + // Standard + message: this.message, + name: this.name, + // Microsoft + description: this.description, + number: this.number, + // Mozilla + fileName: this.fileName, + lineNumber: this.lineNumber, + columnNumber: this.columnNumber, + stack: this.stack, + // Axios + config: this.config, + code: this.code + }; + }; + return error; +}; diff --git a/node_modules/tod-api/node_modules/axios/lib/core/mergeConfig.js b/node_modules/tod-api/node_modules/axios/lib/core/mergeConfig.js new file mode 100644 index 000000000..5a2c10cb0 --- /dev/null +++ b/node_modules/tod-api/node_modules/axios/lib/core/mergeConfig.js @@ -0,0 +1,87 @@ +'use strict'; + +var utils = require('../utils'); + +/** + * Config-specific merge-function which creates a new config-object + * by merging two configuration objects together. + * + * @param {Object} config1 + * @param {Object} config2 + * @returns {Object} New object resulting from merging config2 to config1 + */ +module.exports = function mergeConfig(config1, config2) { + // eslint-disable-next-line no-param-reassign + config2 = config2 || {}; + var config = {}; + + var valueFromConfig2Keys = ['url', 'method', 'data']; + var mergeDeepPropertiesKeys = ['headers', 'auth', 'proxy', 'params']; + var defaultToConfig2Keys = [ + 'baseURL', 'transformRequest', 'transformResponse', 'paramsSerializer', + 'timeout', 'timeoutMessage', 'withCredentials', 'adapter', 'responseType', 'xsrfCookieName', + 'xsrfHeaderName', 'onUploadProgress', 'onDownloadProgress', 'decompress', + 'maxContentLength', 'maxBodyLength', 'maxRedirects', 'transport', 'httpAgent', + 'httpsAgent', 'cancelToken', 'socketPath', 'responseEncoding' + ]; + var directMergeKeys = ['validateStatus']; + + function getMergedValue(target, source) { + if (utils.isPlainObject(target) && utils.isPlainObject(source)) { + return utils.merge(target, source); + } else if (utils.isPlainObject(source)) { + return utils.merge({}, source); + } else if (utils.isArray(source)) { + return source.slice(); + } + return source; + } + + function mergeDeepProperties(prop) { + if (!utils.isUndefined(config2[prop])) { + config[prop] = getMergedValue(config1[prop], config2[prop]); + } else if (!utils.isUndefined(config1[prop])) { + config[prop] = getMergedValue(undefined, config1[prop]); + } + } + + utils.forEach(valueFromConfig2Keys, function valueFromConfig2(prop) { + if (!utils.isUndefined(config2[prop])) { + config[prop] = getMergedValue(undefined, config2[prop]); + } + }); + + utils.forEach(mergeDeepPropertiesKeys, mergeDeepProperties); + + utils.forEach(defaultToConfig2Keys, function defaultToConfig2(prop) { + if (!utils.isUndefined(config2[prop])) { + config[prop] = getMergedValue(undefined, config2[prop]); + } else if (!utils.isUndefined(config1[prop])) { + config[prop] = getMergedValue(undefined, config1[prop]); + } + }); + + utils.forEach(directMergeKeys, function merge(prop) { + if (prop in config2) { + config[prop] = getMergedValue(config1[prop], config2[prop]); + } else if (prop in config1) { + config[prop] = getMergedValue(undefined, config1[prop]); + } + }); + + var axiosKeys = valueFromConfig2Keys + .concat(mergeDeepPropertiesKeys) + .concat(defaultToConfig2Keys) + .concat(directMergeKeys); + + var otherKeys = Object + .keys(config1) + .concat(Object.keys(config2)) + .filter(function filterAxiosKeys(key) { + return axiosKeys.indexOf(key) === -1; + }); + + utils.forEach(otherKeys, mergeDeepProperties); + + return config; +}; diff --git a/node_modules/tod-api/node_modules/axios/lib/core/settle.js b/node_modules/tod-api/node_modules/axios/lib/core/settle.js new file mode 100644 index 000000000..886adb0c1 --- /dev/null +++ b/node_modules/tod-api/node_modules/axios/lib/core/settle.js @@ -0,0 +1,25 @@ +'use strict'; + +var createError = require('./createError'); + +/** + * Resolve or reject a Promise based on response status. + * + * @param {Function} resolve A function that resolves the promise. + * @param {Function} reject A function that rejects the promise. + * @param {object} response The response. + */ +module.exports = function settle(resolve, reject, response) { + var validateStatus = response.config.validateStatus; + if (!response.status || !validateStatus || validateStatus(response.status)) { + resolve(response); + } else { + reject(createError( + 'Request failed with status code ' + response.status, + response.config, + null, + response.request, + response + )); + } +}; diff --git a/node_modules/tod-api/node_modules/axios/lib/core/transformData.js b/node_modules/tod-api/node_modules/axios/lib/core/transformData.js new file mode 100644 index 000000000..c584d12bc --- /dev/null +++ b/node_modules/tod-api/node_modules/axios/lib/core/transformData.js @@ -0,0 +1,22 @@ +'use strict'; + +var utils = require('./../utils'); +var defaults = require('./../defaults'); + +/** + * Transform the data for a request or a response + * + * @param {Object|String} data The data to be transformed + * @param {Array} headers The headers for the request or response + * @param {Array|Function} fns A single function or Array of functions + * @returns {*} The resulting transformed data + */ +module.exports = function transformData(data, headers, fns) { + var context = this || defaults; + /*eslint no-param-reassign:0*/ + utils.forEach(fns, function transform(fn) { + data = fn.call(context, data, headers); + }); + + return data; +}; diff --git a/node_modules/tod-api/node_modules/axios/lib/defaults.js b/node_modules/tod-api/node_modules/axios/lib/defaults.js new file mode 100644 index 000000000..55e69d9ae --- /dev/null +++ b/node_modules/tod-api/node_modules/axios/lib/defaults.js @@ -0,0 +1,134 @@ +'use strict'; + +var utils = require('./utils'); +var normalizeHeaderName = require('./helpers/normalizeHeaderName'); +var enhanceError = require('./core/enhanceError'); + +var DEFAULT_CONTENT_TYPE = { + 'Content-Type': 'application/x-www-form-urlencoded' +}; + +function setContentTypeIfUnset(headers, value) { + if (!utils.isUndefined(headers) && utils.isUndefined(headers['Content-Type'])) { + headers['Content-Type'] = value; + } +} + +function getDefaultAdapter() { + var adapter; + if (typeof XMLHttpRequest !== 'undefined') { + // For browsers use XHR adapter + adapter = require('./adapters/xhr'); + } else if (typeof process !== 'undefined' && Object.prototype.toString.call(process) === '[object process]') { + // For node use HTTP adapter + adapter = require('./adapters/http'); + } + return adapter; +} + +function stringifySafely(rawValue, parser, encoder) { + if (utils.isString(rawValue)) { + try { + (parser || JSON.parse)(rawValue); + return utils.trim(rawValue); + } catch (e) { + if (e.name !== 'SyntaxError') { + throw e; + } + } + } + + return (encoder || JSON.stringify)(rawValue); +} + +var defaults = { + + transitional: { + silentJSONParsing: true, + forcedJSONParsing: true, + clarifyTimeoutError: false + }, + + adapter: getDefaultAdapter(), + + transformRequest: [function transformRequest(data, headers) { + normalizeHeaderName(headers, 'Accept'); + normalizeHeaderName(headers, 'Content-Type'); + + if (utils.isFormData(data) || + utils.isArrayBuffer(data) || + utils.isBuffer(data) || + utils.isStream(data) || + utils.isFile(data) || + utils.isBlob(data) + ) { + return data; + } + if (utils.isArrayBufferView(data)) { + return data.buffer; + } + if (utils.isURLSearchParams(data)) { + setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8'); + return data.toString(); + } + if (utils.isObject(data) || (headers && headers['Content-Type'] === 'application/json')) { + setContentTypeIfUnset(headers, 'application/json'); + return stringifySafely(data); + } + return data; + }], + + transformResponse: [function transformResponse(data) { + var transitional = this.transitional; + var silentJSONParsing = transitional && transitional.silentJSONParsing; + var forcedJSONParsing = transitional && transitional.forcedJSONParsing; + var strictJSONParsing = !silentJSONParsing && this.responseType === 'json'; + + if (strictJSONParsing || (forcedJSONParsing && utils.isString(data) && data.length)) { + try { + return JSON.parse(data); + } catch (e) { + if (strictJSONParsing) { + if (e.name === 'SyntaxError') { + throw enhanceError(e, this, 'E_JSON_PARSE'); + } + throw e; + } + } + } + + return data; + }], + + /** + * A timeout in milliseconds to abort a request. If set to 0 (default) a + * timeout is not created. + */ + timeout: 0, + + xsrfCookieName: 'XSRF-TOKEN', + xsrfHeaderName: 'X-XSRF-TOKEN', + + maxContentLength: -1, + maxBodyLength: -1, + + validateStatus: function validateStatus(status) { + return status >= 200 && status < 300; + } +}; + +defaults.headers = { + common: { + 'Accept': 'application/json, text/plain, */*' + } +}; + +utils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) { + defaults.headers[method] = {}; +}); + +utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) { + defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE); +}); + +module.exports = defaults; diff --git a/node_modules/tod-api/node_modules/axios/lib/helpers/README.md b/node_modules/tod-api/node_modules/axios/lib/helpers/README.md new file mode 100644 index 000000000..4ae34193a --- /dev/null +++ b/node_modules/tod-api/node_modules/axios/lib/helpers/README.md @@ -0,0 +1,7 @@ +# axios // helpers + +The modules found in `helpers/` should be generic modules that are _not_ specific to the domain logic of axios. These modules could theoretically be published to npm on their own and consumed by other modules or apps. Some examples of generic modules are things like: + +- Browser polyfills +- Managing cookies +- Parsing HTTP headers diff --git a/node_modules/tod-api/node_modules/axios/lib/helpers/bind.js b/node_modules/tod-api/node_modules/axios/lib/helpers/bind.js new file mode 100644 index 000000000..6147c608e --- /dev/null +++ b/node_modules/tod-api/node_modules/axios/lib/helpers/bind.js @@ -0,0 +1,11 @@ +'use strict'; + +module.exports = function bind(fn, thisArg) { + return function wrap() { + var args = new Array(arguments.length); + for (var i = 0; i < args.length; i++) { + args[i] = arguments[i]; + } + return fn.apply(thisArg, args); + }; +}; diff --git a/node_modules/tod-api/node_modules/axios/lib/helpers/buildURL.js b/node_modules/tod-api/node_modules/axios/lib/helpers/buildURL.js new file mode 100644 index 000000000..31595c33a --- /dev/null +++ b/node_modules/tod-api/node_modules/axios/lib/helpers/buildURL.js @@ -0,0 +1,70 @@ +'use strict'; + +var utils = require('./../utils'); + +function encode(val) { + return encodeURIComponent(val). + replace(/%3A/gi, ':'). + replace(/%24/g, '$'). + replace(/%2C/gi, ','). + replace(/%20/g, '+'). + replace(/%5B/gi, '['). + replace(/%5D/gi, ']'); +} + +/** + * Build a URL by appending params to the end + * + * @param {string} url The base of the url (e.g., http://www.google.com) + * @param {object} [params] The params to be appended + * @returns {string} The formatted url + */ +module.exports = function buildURL(url, params, paramsSerializer) { + /*eslint no-param-reassign:0*/ + if (!params) { + return url; + } + + var serializedParams; + if (paramsSerializer) { + serializedParams = paramsSerializer(params); + } else if (utils.isURLSearchParams(params)) { + serializedParams = params.toString(); + } else { + var parts = []; + + utils.forEach(params, function serialize(val, key) { + if (val === null || typeof val === 'undefined') { + return; + } + + if (utils.isArray(val)) { + key = key + '[]'; + } else { + val = [val]; + } + + utils.forEach(val, function parseValue(v) { + if (utils.isDate(v)) { + v = v.toISOString(); + } else if (utils.isObject(v)) { + v = JSON.stringify(v); + } + parts.push(encode(key) + '=' + encode(v)); + }); + }); + + serializedParams = parts.join('&'); + } + + if (serializedParams) { + var hashmarkIndex = url.indexOf('#'); + if (hashmarkIndex !== -1) { + url = url.slice(0, hashmarkIndex); + } + + url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams; + } + + return url; +}; diff --git a/node_modules/tod-api/node_modules/axios/lib/helpers/combineURLs.js b/node_modules/tod-api/node_modules/axios/lib/helpers/combineURLs.js new file mode 100644 index 000000000..f1b58a586 --- /dev/null +++ b/node_modules/tod-api/node_modules/axios/lib/helpers/combineURLs.js @@ -0,0 +1,14 @@ +'use strict'; + +/** + * Creates a new URL by combining the specified URLs + * + * @param {string} baseURL The base URL + * @param {string} relativeURL The relative URL + * @returns {string} The combined URL + */ +module.exports = function combineURLs(baseURL, relativeURL) { + return relativeURL + ? baseURL.replace(/\/+$/, '') + '/' + relativeURL.replace(/^\/+/, '') + : baseURL; +}; diff --git a/node_modules/tod-api/node_modules/axios/lib/helpers/cookies.js b/node_modules/tod-api/node_modules/axios/lib/helpers/cookies.js new file mode 100644 index 000000000..5a8a66661 --- /dev/null +++ b/node_modules/tod-api/node_modules/axios/lib/helpers/cookies.js @@ -0,0 +1,53 @@ +'use strict'; + +var utils = require('./../utils'); + +module.exports = ( + utils.isStandardBrowserEnv() ? + + // Standard browser envs support document.cookie + (function standardBrowserEnv() { + return { + write: function write(name, value, expires, path, domain, secure) { + var cookie = []; + cookie.push(name + '=' + encodeURIComponent(value)); + + if (utils.isNumber(expires)) { + cookie.push('expires=' + new Date(expires).toGMTString()); + } + + if (utils.isString(path)) { + cookie.push('path=' + path); + } + + if (utils.isString(domain)) { + cookie.push('domain=' + domain); + } + + if (secure === true) { + cookie.push('secure'); + } + + document.cookie = cookie.join('; '); + }, + + read: function read(name) { + var match = document.cookie.match(new RegExp('(^|;\\s*)(' + name + ')=([^;]*)')); + return (match ? decodeURIComponent(match[3]) : null); + }, + + remove: function remove(name) { + this.write(name, '', Date.now() - 86400000); + } + }; + })() : + + // Non standard browser env (web workers, react-native) lack needed support. + (function nonStandardBrowserEnv() { + return { + write: function write() {}, + read: function read() { return null; }, + remove: function remove() {} + }; + })() +); diff --git a/node_modules/tod-api/node_modules/axios/lib/helpers/deprecatedMethod.js b/node_modules/tod-api/node_modules/axios/lib/helpers/deprecatedMethod.js new file mode 100644 index 000000000..ed40965ba --- /dev/null +++ b/node_modules/tod-api/node_modules/axios/lib/helpers/deprecatedMethod.js @@ -0,0 +1,24 @@ +'use strict'; + +/*eslint no-console:0*/ + +/** + * Supply a warning to the developer that a method they are using + * has been deprecated. + * + * @param {string} method The name of the deprecated method + * @param {string} [instead] The alternate method to use if applicable + * @param {string} [docs] The documentation URL to get further details + */ +module.exports = function deprecatedMethod(method, instead, docs) { + try { + console.warn( + 'DEPRECATED method `' + method + '`.' + + (instead ? ' Use `' + instead + '` instead.' : '') + + ' This method will be removed in a future release.'); + + if (docs) { + console.warn('For more information about usage see ' + docs); + } + } catch (e) { /* Ignore */ } +}; diff --git a/node_modules/tod-api/node_modules/axios/lib/helpers/isAbsoluteURL.js b/node_modules/tod-api/node_modules/axios/lib/helpers/isAbsoluteURL.js new file mode 100644 index 000000000..d33e99275 --- /dev/null +++ b/node_modules/tod-api/node_modules/axios/lib/helpers/isAbsoluteURL.js @@ -0,0 +1,14 @@ +'use strict'; + +/** + * Determines whether the specified URL is absolute + * + * @param {string} url The URL to test + * @returns {boolean} True if the specified URL is absolute, otherwise false + */ +module.exports = function isAbsoluteURL(url) { + // A URL is considered absolute if it begins with "://" or "//" (protocol-relative URL). + // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed + // by any combination of letters, digits, plus, period, or hyphen. + return /^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(url); +}; diff --git a/node_modules/tod-api/node_modules/axios/lib/helpers/isAxiosError.js b/node_modules/tod-api/node_modules/axios/lib/helpers/isAxiosError.js new file mode 100644 index 000000000..29ff41af8 --- /dev/null +++ b/node_modules/tod-api/node_modules/axios/lib/helpers/isAxiosError.js @@ -0,0 +1,11 @@ +'use strict'; + +/** + * Determines whether the payload is an error thrown by Axios + * + * @param {*} payload The value to test + * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false + */ +module.exports = function isAxiosError(payload) { + return (typeof payload === 'object') && (payload.isAxiosError === true); +}; diff --git a/node_modules/tod-api/node_modules/axios/lib/helpers/isURLSameOrigin.js b/node_modules/tod-api/node_modules/axios/lib/helpers/isURLSameOrigin.js new file mode 100644 index 000000000..f1d89ad19 --- /dev/null +++ b/node_modules/tod-api/node_modules/axios/lib/helpers/isURLSameOrigin.js @@ -0,0 +1,68 @@ +'use strict'; + +var utils = require('./../utils'); + +module.exports = ( + utils.isStandardBrowserEnv() ? + + // Standard browser envs have full support of the APIs needed to test + // whether the request URL is of the same origin as current location. + (function standardBrowserEnv() { + var msie = /(msie|trident)/i.test(navigator.userAgent); + var urlParsingNode = document.createElement('a'); + var originURL; + + /** + * Parse a URL to discover it's components + * + * @param {String} url The URL to be parsed + * @returns {Object} + */ + function resolveURL(url) { + var href = url; + + if (msie) { + // IE needs attribute set twice to normalize properties + urlParsingNode.setAttribute('href', href); + href = urlParsingNode.href; + } + + urlParsingNode.setAttribute('href', href); + + // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils + return { + href: urlParsingNode.href, + protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '', + host: urlParsingNode.host, + search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, '') : '', + hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '', + hostname: urlParsingNode.hostname, + port: urlParsingNode.port, + pathname: (urlParsingNode.pathname.charAt(0) === '/') ? + urlParsingNode.pathname : + '/' + urlParsingNode.pathname + }; + } + + originURL = resolveURL(window.location.href); + + /** + * Determine if a URL shares the same origin as the current location + * + * @param {String} requestURL The URL to test + * @returns {boolean} True if URL shares the same origin, otherwise false + */ + return function isURLSameOrigin(requestURL) { + var parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL; + return (parsed.protocol === originURL.protocol && + parsed.host === originURL.host); + }; + })() : + + // Non standard browser envs (web workers, react-native) lack needed support. + (function nonStandardBrowserEnv() { + return function isURLSameOrigin() { + return true; + }; + })() +); diff --git a/node_modules/tod-api/node_modules/axios/lib/helpers/normalizeHeaderName.js b/node_modules/tod-api/node_modules/axios/lib/helpers/normalizeHeaderName.js new file mode 100644 index 000000000..738c9fe40 --- /dev/null +++ b/node_modules/tod-api/node_modules/axios/lib/helpers/normalizeHeaderName.js @@ -0,0 +1,12 @@ +'use strict'; + +var utils = require('../utils'); + +module.exports = function normalizeHeaderName(headers, normalizedName) { + utils.forEach(headers, function processHeader(value, name) { + if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) { + headers[normalizedName] = value; + delete headers[name]; + } + }); +}; diff --git a/node_modules/tod-api/node_modules/axios/lib/helpers/parseHeaders.js b/node_modules/tod-api/node_modules/axios/lib/helpers/parseHeaders.js new file mode 100644 index 000000000..8af2cc7f1 --- /dev/null +++ b/node_modules/tod-api/node_modules/axios/lib/helpers/parseHeaders.js @@ -0,0 +1,53 @@ +'use strict'; + +var utils = require('./../utils'); + +// Headers whose duplicates are ignored by node +// c.f. https://nodejs.org/api/http.html#http_message_headers +var ignoreDuplicateOf = [ + 'age', 'authorization', 'content-length', 'content-type', 'etag', + 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since', + 'last-modified', 'location', 'max-forwards', 'proxy-authorization', + 'referer', 'retry-after', 'user-agent' +]; + +/** + * Parse headers into an object + * + * ``` + * Date: Wed, 27 Aug 2014 08:58:49 GMT + * Content-Type: application/json + * Connection: keep-alive + * Transfer-Encoding: chunked + * ``` + * + * @param {String} headers Headers needing to be parsed + * @returns {Object} Headers parsed into an object + */ +module.exports = function parseHeaders(headers) { + var parsed = {}; + var key; + var val; + var i; + + if (!headers) { return parsed; } + + utils.forEach(headers.split('\n'), function parser(line) { + i = line.indexOf(':'); + key = utils.trim(line.substr(0, i)).toLowerCase(); + val = utils.trim(line.substr(i + 1)); + + if (key) { + if (parsed[key] && ignoreDuplicateOf.indexOf(key) >= 0) { + return; + } + if (key === 'set-cookie') { + parsed[key] = (parsed[key] ? parsed[key] : []).concat([val]); + } else { + parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val; + } + } + }); + + return parsed; +}; diff --git a/node_modules/tod-api/node_modules/axios/lib/helpers/spread.js b/node_modules/tod-api/node_modules/axios/lib/helpers/spread.js new file mode 100644 index 000000000..25e3cdd39 --- /dev/null +++ b/node_modules/tod-api/node_modules/axios/lib/helpers/spread.js @@ -0,0 +1,27 @@ +'use strict'; + +/** + * Syntactic sugar for invoking a function and expanding an array for arguments. + * + * Common use case would be to use `Function.prototype.apply`. + * + * ```js + * function f(x, y, z) {} + * var args = [1, 2, 3]; + * f.apply(null, args); + * ``` + * + * With `spread` this example can be re-written. + * + * ```js + * spread(function(x, y, z) {})([1, 2, 3]); + * ``` + * + * @param {Function} callback + * @returns {Function} + */ +module.exports = function spread(callback) { + return function wrap(arr) { + return callback.apply(null, arr); + }; +}; diff --git a/node_modules/tod-api/node_modules/axios/lib/helpers/validator.js b/node_modules/tod-api/node_modules/axios/lib/helpers/validator.js new file mode 100644 index 000000000..7f1bc7dfa --- /dev/null +++ b/node_modules/tod-api/node_modules/axios/lib/helpers/validator.js @@ -0,0 +1,105 @@ +'use strict'; + +var pkg = require('./../../package.json'); + +var validators = {}; + +// eslint-disable-next-line func-names +['object', 'boolean', 'number', 'function', 'string', 'symbol'].forEach(function(type, i) { + validators[type] = function validator(thing) { + return typeof thing === type || 'a' + (i < 1 ? 'n ' : ' ') + type; + }; +}); + +var deprecatedWarnings = {}; +var currentVerArr = pkg.version.split('.'); + +/** + * Compare package versions + * @param {string} version + * @param {string?} thanVersion + * @returns {boolean} + */ +function isOlderVersion(version, thanVersion) { + var pkgVersionArr = thanVersion ? thanVersion.split('.') : currentVerArr; + var destVer = version.split('.'); + for (var i = 0; i < 3; i++) { + if (pkgVersionArr[i] > destVer[i]) { + return true; + } else if (pkgVersionArr[i] < destVer[i]) { + return false; + } + } + return false; +} + +/** + * Transitional option validator + * @param {function|boolean?} validator + * @param {string?} version + * @param {string} message + * @returns {function} + */ +validators.transitional = function transitional(validator, version, message) { + var isDeprecated = version && isOlderVersion(version); + + function formatMessage(opt, desc) { + return '[Axios v' + pkg.version + '] Transitional option \'' + opt + '\'' + desc + (message ? '. ' + message : ''); + } + + // eslint-disable-next-line func-names + return function(value, opt, opts) { + if (validator === false) { + throw new Error(formatMessage(opt, ' has been removed in ' + version)); + } + + if (isDeprecated && !deprecatedWarnings[opt]) { + deprecatedWarnings[opt] = true; + // eslint-disable-next-line no-console + console.warn( + formatMessage( + opt, + ' has been deprecated since v' + version + ' and will be removed in the near future' + ) + ); + } + + return validator ? validator(value, opt, opts) : true; + }; +}; + +/** + * Assert object's properties type + * @param {object} options + * @param {object} schema + * @param {boolean?} allowUnknown + */ + +function assertOptions(options, schema, allowUnknown) { + if (typeof options !== 'object') { + throw new TypeError('options must be an object'); + } + var keys = Object.keys(options); + var i = keys.length; + while (i-- > 0) { + var opt = keys[i]; + var validator = schema[opt]; + if (validator) { + var value = options[opt]; + var result = value === undefined || validator(value, opt, options); + if (result !== true) { + throw new TypeError('option ' + opt + ' must be ' + result); + } + continue; + } + if (allowUnknown !== true) { + throw Error('Unknown option ' + opt); + } + } +} + +module.exports = { + isOlderVersion: isOlderVersion, + assertOptions: assertOptions, + validators: validators +}; diff --git a/node_modules/tod-api/node_modules/axios/lib/utils.js b/node_modules/tod-api/node_modules/axios/lib/utils.js new file mode 100644 index 000000000..5d966f444 --- /dev/null +++ b/node_modules/tod-api/node_modules/axios/lib/utils.js @@ -0,0 +1,349 @@ +'use strict'; + +var bind = require('./helpers/bind'); + +// utils is a library of generic helper functions non-specific to axios + +var toString = Object.prototype.toString; + +/** + * Determine if a value is an Array + * + * @param {Object} val The value to test + * @returns {boolean} True if value is an Array, otherwise false + */ +function isArray(val) { + return toString.call(val) === '[object Array]'; +} + +/** + * Determine if a value is undefined + * + * @param {Object} val The value to test + * @returns {boolean} True if the value is undefined, otherwise false + */ +function isUndefined(val) { + return typeof val === 'undefined'; +} + +/** + * Determine if a value is a Buffer + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a Buffer, otherwise false + */ +function isBuffer(val) { + return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor) + && typeof val.constructor.isBuffer === 'function' && val.constructor.isBuffer(val); +} + +/** + * Determine if a value is an ArrayBuffer + * + * @param {Object} val The value to test + * @returns {boolean} True if value is an ArrayBuffer, otherwise false + */ +function isArrayBuffer(val) { + return toString.call(val) === '[object ArrayBuffer]'; +} + +/** + * Determine if a value is a FormData + * + * @param {Object} val The value to test + * @returns {boolean} True if value is an FormData, otherwise false + */ +function isFormData(val) { + return (typeof FormData !== 'undefined') && (val instanceof FormData); +} + +/** + * Determine if a value is a view on an ArrayBuffer + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false + */ +function isArrayBufferView(val) { + var result; + if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) { + result = ArrayBuffer.isView(val); + } else { + result = (val) && (val.buffer) && (val.buffer instanceof ArrayBuffer); + } + return result; +} + +/** + * Determine if a value is a String + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a String, otherwise false + */ +function isString(val) { + return typeof val === 'string'; +} + +/** + * Determine if a value is a Number + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a Number, otherwise false + */ +function isNumber(val) { + return typeof val === 'number'; +} + +/** + * Determine if a value is an Object + * + * @param {Object} val The value to test + * @returns {boolean} True if value is an Object, otherwise false + */ +function isObject(val) { + return val !== null && typeof val === 'object'; +} + +/** + * Determine if a value is a plain Object + * + * @param {Object} val The value to test + * @return {boolean} True if value is a plain Object, otherwise false + */ +function isPlainObject(val) { + if (toString.call(val) !== '[object Object]') { + return false; + } + + var prototype = Object.getPrototypeOf(val); + return prototype === null || prototype === Object.prototype; +} + +/** + * Determine if a value is a Date + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a Date, otherwise false + */ +function isDate(val) { + return toString.call(val) === '[object Date]'; +} + +/** + * Determine if a value is a File + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a File, otherwise false + */ +function isFile(val) { + return toString.call(val) === '[object File]'; +} + +/** + * Determine if a value is a Blob + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a Blob, otherwise false + */ +function isBlob(val) { + return toString.call(val) === '[object Blob]'; +} + +/** + * Determine if a value is a Function + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a Function, otherwise false + */ +function isFunction(val) { + return toString.call(val) === '[object Function]'; +} + +/** + * Determine if a value is a Stream + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a Stream, otherwise false + */ +function isStream(val) { + return isObject(val) && isFunction(val.pipe); +} + +/** + * Determine if a value is a URLSearchParams object + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a URLSearchParams object, otherwise false + */ +function isURLSearchParams(val) { + return typeof URLSearchParams !== 'undefined' && val instanceof URLSearchParams; +} + +/** + * Trim excess whitespace off the beginning and end of a string + * + * @param {String} str The String to trim + * @returns {String} The String freed of excess whitespace + */ +function trim(str) { + return str.trim ? str.trim() : str.replace(/^\s+|\s+$/g, ''); +} + +/** + * Determine if we're running in a standard browser environment + * + * This allows axios to run in a web worker, and react-native. + * Both environments support XMLHttpRequest, but not fully standard globals. + * + * web workers: + * typeof window -> undefined + * typeof document -> undefined + * + * react-native: + * navigator.product -> 'ReactNative' + * nativescript + * navigator.product -> 'NativeScript' or 'NS' + */ +function isStandardBrowserEnv() { + if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' || + navigator.product === 'NativeScript' || + navigator.product === 'NS')) { + return false; + } + return ( + typeof window !== 'undefined' && + typeof document !== 'undefined' + ); +} + +/** + * Iterate over an Array or an Object invoking a function for each item. + * + * If `obj` is an Array callback will be called passing + * the value, index, and complete array for each item. + * + * If 'obj' is an Object callback will be called passing + * the value, key, and complete object for each property. + * + * @param {Object|Array} obj The object to iterate + * @param {Function} fn The callback to invoke for each item + */ +function forEach(obj, fn) { + // Don't bother if no value provided + if (obj === null || typeof obj === 'undefined') { + return; + } + + // Force an array if not already something iterable + if (typeof obj !== 'object') { + /*eslint no-param-reassign:0*/ + obj = [obj]; + } + + if (isArray(obj)) { + // Iterate over array values + for (var i = 0, l = obj.length; i < l; i++) { + fn.call(null, obj[i], i, obj); + } + } else { + // Iterate over object keys + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) { + fn.call(null, obj[key], key, obj); + } + } + } +} + +/** + * Accepts varargs expecting each argument to be an object, then + * immutably merges the properties of each object and returns result. + * + * When multiple objects contain the same key the later object in + * the arguments list will take precedence. + * + * Example: + * + * ```js + * var result = merge({foo: 123}, {foo: 456}); + * console.log(result.foo); // outputs 456 + * ``` + * + * @param {Object} obj1 Object to merge + * @returns {Object} Result of all merge properties + */ +function merge(/* obj1, obj2, obj3, ... */) { + var result = {}; + function assignValue(val, key) { + if (isPlainObject(result[key]) && isPlainObject(val)) { + result[key] = merge(result[key], val); + } else if (isPlainObject(val)) { + result[key] = merge({}, val); + } else if (isArray(val)) { + result[key] = val.slice(); + } else { + result[key] = val; + } + } + + for (var i = 0, l = arguments.length; i < l; i++) { + forEach(arguments[i], assignValue); + } + return result; +} + +/** + * Extends object a by mutably adding to it the properties of object b. + * + * @param {Object} a The object to be extended + * @param {Object} b The object to copy properties from + * @param {Object} thisArg The object to bind function to + * @return {Object} The resulting value of object a + */ +function extend(a, b, thisArg) { + forEach(b, function assignValue(val, key) { + if (thisArg && typeof val === 'function') { + a[key] = bind(val, thisArg); + } else { + a[key] = val; + } + }); + return a; +} + +/** + * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM) + * + * @param {string} content with BOM + * @return {string} content value without BOM + */ +function stripBOM(content) { + if (content.charCodeAt(0) === 0xFEFF) { + content = content.slice(1); + } + return content; +} + +module.exports = { + isArray: isArray, + isArrayBuffer: isArrayBuffer, + isBuffer: isBuffer, + isFormData: isFormData, + isArrayBufferView: isArrayBufferView, + isString: isString, + isNumber: isNumber, + isObject: isObject, + isPlainObject: isPlainObject, + isUndefined: isUndefined, + isDate: isDate, + isFile: isFile, + isBlob: isBlob, + isFunction: isFunction, + isStream: isStream, + isURLSearchParams: isURLSearchParams, + isStandardBrowserEnv: isStandardBrowserEnv, + forEach: forEach, + merge: merge, + extend: extend, + trim: trim, + stripBOM: stripBOM +}; diff --git a/node_modules/tod-api/node_modules/axios/package.json b/node_modules/tod-api/node_modules/axios/package.json new file mode 100644 index 000000000..7c895b3a9 --- /dev/null +++ b/node_modules/tod-api/node_modules/axios/package.json @@ -0,0 +1,84 @@ +{ + "name": "axios", + "version": "0.21.4", + "description": "Promise based HTTP client for the browser and node.js", + "main": "index.js", + "scripts": { + "test": "grunt test", + "start": "node ./sandbox/server.js", + "build": "NODE_ENV=production grunt build", + "preversion": "npm test", + "version": "npm run build && grunt version && git add -A dist && git add CHANGELOG.md bower.json package.json", + "postversion": "git push && git push --tags", + "examples": "node ./examples/server.js", + "coveralls": "cat coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js", + "fix": "eslint --fix lib/**/*.js" + }, + "repository": { + "type": "git", + "url": "https://github.com/axios/axios.git" + }, + "keywords": [ + "xhr", + "http", + "ajax", + "promise", + "node" + ], + "author": "Matt Zabriskie", + "license": "MIT", + "bugs": { + "url": "https://github.com/axios/axios/issues" + }, + "homepage": "https://axios-http.com", + "devDependencies": { + "coveralls": "^3.0.0", + "es6-promise": "^4.2.4", + "grunt": "^1.3.0", + "grunt-banner": "^0.6.0", + "grunt-cli": "^1.2.0", + "grunt-contrib-clean": "^1.1.0", + "grunt-contrib-watch": "^1.0.0", + "grunt-eslint": "^23.0.0", + "grunt-karma": "^4.0.0", + "grunt-mocha-test": "^0.13.3", + "grunt-ts": "^6.0.0-beta.19", + "grunt-webpack": "^4.0.2", + "istanbul-instrumenter-loader": "^1.0.0", + "jasmine-core": "^2.4.1", + "karma": "^6.3.2", + "karma-chrome-launcher": "^3.1.0", + "karma-firefox-launcher": "^2.1.0", + "karma-jasmine": "^1.1.1", + "karma-jasmine-ajax": "^0.1.13", + "karma-safari-launcher": "^1.0.0", + "karma-sauce-launcher": "^4.3.6", + "karma-sinon": "^1.0.5", + "karma-sourcemap-loader": "^0.3.8", + "karma-webpack": "^4.0.2", + "load-grunt-tasks": "^3.5.2", + "minimist": "^1.2.0", + "mocha": "^8.2.1", + "sinon": "^4.5.0", + "terser-webpack-plugin": "^4.2.3", + "typescript": "^4.0.5", + "url-search-params": "^0.10.0", + "webpack": "^4.44.2", + "webpack-dev-server": "^3.11.0" + }, + "browser": { + "./lib/adapters/http.js": "./lib/adapters/xhr.js" + }, + "jsdelivr": "dist/axios.min.js", + "unpkg": "dist/axios.min.js", + "typings": "./index.d.ts", + "dependencies": { + "follow-redirects": "^1.14.0" + }, + "bundlesize": [ + { + "path": "./dist/axios.min.js", + "threshold": "5kB" + } + ] +} diff --git a/node_modules/tod-api/package.json b/node_modules/tod-api/package.json new file mode 100644 index 000000000..4de47d3af --- /dev/null +++ b/node_modules/tod-api/package.json @@ -0,0 +1,30 @@ +{ + "name": "tod-api", + "version": "1.0.5", + "description": "tod-api", + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/yogipw/tod-api.git" + }, + "keywords": [ + "gk tau" + ], + "author": "yogipw", + "license": "ISC", + "bugs": { + "url": "https://github.com/yogipw/tod-api/issues" + }, + "homepage": "https://github.com/yogipw/tod-api#readme", + "dependencies": { + "axios": "^0.21.1", + "cheerio": "^1.0.0-rc.10", + "qs": "^6.10.1" + }, + "directories": { + "lib": "lib" + } +} \ No newline at end of file diff --git a/node_modules/tod-api/tes.js b/node_modules/tod-api/tes.js new file mode 100644 index 000000000..e69de29bb diff --git a/node_modules/xfarr-api/README.md b/node_modules/xfarr-api/README.md new file mode 100644 index 000000000..3e16419c7 --- /dev/null +++ b/node_modules/xfarr-api/README.md @@ -0,0 +1,211 @@ +
XFar +

+

+ + +

+ + + + +

+ +## Penginstalan +> npm install xfarr-api +> +> npm uninstall xfarr-api + +## ```Downloader``` +```js +const xa = require('xfarr-api'); + +const url_youtube = 'https://youtu.be/zXiSTrOQhxM' +const url_tiktok = 'https://vt.tiktok.com/ZSehyjVW9/' +const url_instagram = 'https://www.instagram.com/p/CJFsOsKJMHa6FCRkbjn0mR3jJ0KwHOCCMaW7_Q0/?utm_medium=copy_link' +const url_facebook = 'http://www.facebook.com/groups/526909968570398/permalink/571916620736399/' +const url_twitter = 'https://twitter.com/LucuLucuVideo/status/1454834787382816775?s=20' +const url_soundcloud = 'https://soundcloud.com/enggak-tau-829795349/tri-suaka-aku-bukan-jodohnya?utm_campaign=social_sharing&utm_source=mobi&utm_terms=social_sharing_on_mobi.control%2Ctop_curators.top_curators' +const url_imgur = 'https://imgur.com/gallery/rK8ppvC' +const url_imdb = 'https://www.imdb.com/video/vi146981657?listId=ls053181649' +const url_telesticker = 'https://t.me/addstickers/c1129234339_by_HarukaAyaBot' + +// youtube +xa.Youtube(url_youtube) + .then(data => {console.log(data) +}); + +// tiktok +xa.Tiktok(url_tiktok) + .then(data => {console.log(data) +}); + +// instagram +xa.Instagram(url_instagram) + .then(data => {console.log(data) +}); + +// facebook +xa.Facebook(url_facebook) + .then(data => {console.log(data) +}); + +// twitter +xa.Twitter(url_twitter) + .then(data => {console.log(data) +}); + +// soundcloud +xa.SoundCloud(url_soundcloud) + .then(data => {console.log(data) +}); + +// imgur +xa.Imgur(url_imgur) + .then(data => {console.log(data) +}); + +// imdb +xa.Imdb(url_imdb) + .then(data => {console.log(data) +}); + +// telesticker +xa.Telesticker(url_telesticker) + .then(data => {console.log(data) +}); +``` + +## ```Anime``` +```js +const xa = require('xfarr-api'); + +const query = 'naruto' + +// anime +xa.Anime(query) + .then(data => {console.log(data) +}); + +// manga +xa.Manga(query) + .then(data => {console.log(data) +}); + +// character +xa.Character(query) + .then(data => {console.log(data) +}); +``` + +## ```Search``` +```js +const xa = require('xfarr-api'); + +const query_pinterest = 'elaina' +const query_film = 'love' +const query_wattpad = 'love' +const query_webtoons = 'love' +const query_mangatoons = 'love' +const query_drakor = 'love' +const query_stickersearch = 'patrick' + +// pinterest +xa.Pinterest(query_pinterest) + .then(data => {console.log(data) +}); + +// film +xa.Film(query_film) + .then(data => {console.log(data) +}); + +// wattpad +xa.Wattpad(query_wattpad) + .then(data => {console.log(data) +}); + +// webtoons +xa.Webtoons(query_webtoons) + .then(data => {console.log(data) +}); + +// mangatoons +xa.Mangatoons(query_mangatoons) + .then(data => {console.log(data) +}); + +// drakor +xa.Drakor(query_drakor) + .then(data => {console.log(data) +}); + +// stickersearch +xa.StickerSearch(query_stickersearch) + .then(data => {console.log(data) +}); +``` + +## ```Islami``` +```js +const xa = require('xfarr-api'); + +const query = 'luqman' + +// listsurah +xa.ListSurah() + .then(data => {console.log(data) +}); + +// surah +xa.Surah(query) + .then(data => {console.log(data) +}); + +// tafsirsurah +xa.TafsirSurah(query) + .then(data => {console.log(data) +}); +``` + +## ```Information && News``` +```js +const xa = require('xfarr-api'); + +const username = 'WattpadRomanceIN' + +// jadwalbola +xa.JadwalBola() + .then(data => {console.log(data) +}); + +// jadwaltv +xa.JadwalTv() + .then(data => {console.log(data) +}); + +// jadwalsholat +xa.JadwalSholat() + .then(data => {console.log(data) +}); + +// kompasnews +xa.KompasNews() + .then(data => {console.log(data) +}); + +// inews +xa.Inews() + .then(data => {console.log(data) +}); + +// wattpaduser +xa.WattpadUser(username) + .then(data => {console.log(data) +}); +``` + +# THANKS TO 🎉 + | [![Fajar](http://github.com/Zynfinity.png?size=100)](http://github.com/Zynfinity) | [![Hexa](http://github.com/hexagonz.png?size=100)](http://github.com/hexagonz) +----|----|---- +[ProviderXploit](https://github.com/providerxploit) | [Fajar](http://github.com/Zynfinity) | [Hexa](http://github.com/hexagonz) +My team (pedo) | Fajar insana | Hexagonz (pedo) \ No newline at end of file diff --git a/node_modules/xfarr-api/index.js b/node_modules/xfarr-api/index.js new file mode 100644 index 000000000..21834761d --- /dev/null +++ b/node_modules/xfarr-api/index.js @@ -0,0 +1,536 @@ +const axios = require('axios') +const cheerio = require('cheerio') +const request = require('request') +const author = "#𝑿𝑭𝒂𝒓" + +const film = (query) => { + return new Promise((resolve, reject) => { + axios.get(`http://167.99.31.48/?s=${query}`) + .then(({ + data + }) => { + const $ = cheerio.load(data) + const hasil = []; + $('#content > div > div.los').each(function (a, b) { + $(b).find('article').each(function (c, d) { + const judul = $(d).find('div > a > div.addinfox > header > h2').text() + const quality = $(d).find('div > a > div > div > span').text() + const type = $(d).find('div > a > div.addinfox > div > i.type').text() + const upload = $(d).find('div > a > div.addinfox > div > span').text() + const link = $(d).find('div > a').attr('href'); + const thumb = $(d).find('div > a > div > img').attr('src'); + const result = { + status: 200, + author: author, + judul: judul, + quality: quality, + type: type, + upload: upload, + link: link, + thumb: thumb, + }; + hasil.push(result); + }); + }); + resolve(hasil) + }) + .catch(reject) + }) +} +const anime = (query) => { + return new Promise((resolve, reject) => { + axios.get(`https://www.anime-planet.com/anime/all?name=${query}`) + .then(({ + data + }) => { + const hasil = [] + const $ = cheerio.load(data) + $('#siteContainer > ul.cardDeck.cardGrid > li ').each(function (a, b) { + result = { + status: 200, + author: author, + judul: $(b).find('> a > h3').text(), + link: 'https://www.anime-planet.com' + $(b).find('> a').attr('href'), + thumbnail: 'https://www.anime-planet.com' + $(b).find('> a > div.crop > img').attr('src') + }; + hasil.push(result); + }); + resolve(hasil) + }) + .catch(reject) + }) +} +const manga = (query) => { + return new Promise((resolve, reject) => { + axios.get(`https://www.anime-planet.com/manga/all?name=${query}`) + .then(({ + data + }) => { + const hasil = [] + const $ = cheerio.load(data) + $('#siteContainer > ul.cardDeck.cardGrid > li ').each(function (a, b) { + result = { + status: 200, + author: author, + judul: $(b).find('> a > h3').text(), + link: 'https://www.anime-planet.com' + $(b).find('> a').attr('href'), + thumbnail: 'https://www.anime-planet.com' + $(b).find('> a > div.crop > img').attr('src') + }; + hasil.push(result); + }); + resolve(hasil) + }) + .catch(reject) + }) +} +const character = (query) => { + return new Promise((resolve, reject) => { + axios.get(`https://www.anime-planet.com/characters/all?name=${query}`) + .then(({ + data + }) => { + const hasil = [] + const $ = cheerio.load(data) + $('#siteContainer > table > tbody > tr').each(function (a, b) { + result = { + status: 200, + author: author, + character: $(b).find('> td.tableCharInfo > a').text(), + link: 'https://www.anime-planet.com' + $(b).find('> td.tableCharInfo > a').attr('href'), + thumbnail: $(b).find('> td.tableAvatar > a > img').attr('src').startsWith('https://') ? $(b).find('> td.tableAvatar > a > img').attr('src') : 'https://www.anime.planet.com' + $(b).find('> td.tableAvatar > a > img').attr('src') + }; + hasil.push(result); + }); + resolve(hasil) + }) + .catch(reject) + }) +} +const jadwalbola = () => { + return new Promise((resolve, reject) => { + axios.get('https://m.bola.net/jadwal_televisi/') + .then(({ + data + }) => { + const $ = cheerio.load(data) + const hasil = []; + $('#main_mid_headline_sub_topic').each(function(a, b) { + result = { + status: 200, + author: author, + jadwal: $(b).find(' > div.main_mid_headline_topic > div > a').text(), + tanggal: $(b).find(' > div.main_mid_headline_topic_grouped_time_list').text().split('\n')[1].split(' ')[1], + jam: $(b).find(' > div.main_mid_headline_topic > span').text(), + url: $(b).find(' > div.main_mid_headline_topic > div > a').attr('href'), + thumb: $(b).find(' > div.main_mid_headline_topic > img').attr('src') + } + hasil.push(result) + }) + resolve(hasil) + }) + .catch(reject) + }) +} +const jadwaltv = () => { + return new Promise((resolve, reject) => { + axios.get('http://www.dokitv.com/jadwal-acara-tv') + .then(({ + data + }) => { + const $ = cheerio.load(data) + const hasil = []; + $('#tabeljadwaltv > tbody > tr ').each(function(a, b) { + result = { + status: 200, + author: author, + acara: $(b).find('> td:nth-child(2)').text(), + channel: $(b).find('> td > a').text(), + jam: $(b).find('> td.jfx').text(), + source: $(b).find('> td > a').attr('href') + } + hasil.push(result) + }) + resolve(hasil) + }) + .catch(reject) + }) +} +const jadwalsholat = (query) => { + return new Promise((resolve, reject) => { + axios.get(`https://umrotix.com/jadwal-sholat/${query}`) + .then(({ + data + }) => { + const $ = cheerio.load(data) + $('body > div > div.main-wrapper.scrollspy-action > div:nth-child(3) ').each(function(a, b) { + result = { + status: 200, + author: author, + tanggal: $(b).find('> div:nth-child(2)').text(), + imsyak: $(b).find('> div.panel.daily > div > div > div > div > div:nth-child(1) > p:nth-child(2)').text(), + subuh: $(b).find('> div.panel.daily > div > div > div > div > div:nth-child(2) > p:nth-child(2)').text(), + dzuhur: $(b).find('> div.panel.daily > div > div > div > div > div:nth-child(3) > p:nth-child(2)').text(), + ashar: $(b).find('> div.panel.daily > div > div > div > div > div:nth-child(4) > p:nth-child(2)').text(), + maghrib: $(b).find('> div.panel.daily > div > div > div > div > div:nth-child(5) > p:nth-child(2)').text(), + isya: $(b).find('> div.panel.daily > div > div > div > div > div:nth-child(6) > p:nth-child(2)').text() + } + resolve(result) + }) + }) + .catch(reject) + }) +} +const wattpad = (query) => { + return new Promise((resolve, reject) => { + axios.get(`https://www.wattpad.com/search/${query}`) + .then(({ + data + }) => { + const $ = cheerio.load(data) + const hasil = []; + $('div.story-card-data.hidden-xxs > div.story-info ').each(function(a, b) { + $('ul.list-group > li.list-group-item').each(function(c,d) { + result = { + status: 200, + author: author, + judul: $(b).find('> div.title').text(), + dibaca: $(b).find('> ul > li:nth-child(1) > div.icon-container > div > span.stats-value').text(), + divote: $(b).find('> ul > li:nth-child(2) > div.icon-container > div > span.stats-value').text(), + bab: $(b).find('> ul > li:nth-child(3) > div.icon-container > div > span.stats-value').text(), + waktu: $(b).find('> ul > li:nth-child(4) > div.icon-container > div > span.stats-value').text(), + url:'https://www.wattpad.com' + $(d).find('a').attr('href'), + thumb: $(d).find('img').attr('src'), + description: $(b).find('> div.description').text().replace(/\n/g,'') + } + hasil.push(result) + }) + }) + resolve(hasil) + }) + .catch(reject) + }) +} +const wattpaduser = (query) => { + return new Promise((resolve, reject) => { + axios.get(`https://www.wattpad.com/user/${query}`) + .then(({ + data + }) => { + const $ = cheerio.load(data) + $('#app-container > div > header ').each(function(a, b) { + $('#profile-about > div > div ').each(function(c, d) { + result = { + status: 200, + author: author, + username: $(b).find('> div.badges > h1').text().trim(), + works: $(b).find('> div.row.header-metadata > div:nth-child(1) > p:nth-child(1)').text(), + reading_list: $(b).find('> div.row.header-metadata > div.col-xs-4.scroll-to-element > p:nth-child(1)').text(), + followers: $(b).find('> div.row.header-metadata > div.col-xs-4.on-followers > p.followers-count').text(), + joined: $(d).find('> ul > li.date.col-xs-12.col-sm-12 > span').text().trim().replace('Joined',''), + pp_picture: `https://img.wattpad.com/useravatar/${query}.128.851744.jpg`, + about: $(d).find('> div.description > pre').text() ? $(d).find('> div.description > pre').text() : 'Not found' + } + resolve(result) + }) + }) + }) + .catch(reject) + }) +} +const mangatoons = (query) => { + return new Promise((resolve, reject) => { + axios.get(`https://mangatoon.mobi/en/search?word=${query}`) + .then(({ + data + }) => { + const $ = cheerio.load(data) + const hasil = []; + $('#page-content > div.search-page > div > div.comics-result > div.recommended-wrap > div > div ').each(function(a, b) { + result = { + status: 200, + author: author, + judul: $(b).find('> div.recommend-comics-title > span').text(), + genre: $(b).find('> div.comics-type > span').text().trim(), + link: 'https://mangatoon.mobi' + $(b).find('> a').attr('href'), + thumbnail: $(b).find('> a > div > img').attr('src') + } + hasil.push(result) + }) + resolve(hasil) + }) + .catch(reject) + }) +} +const webtoons = (query) => { + return new Promise((resolve, reject) => { + axios.get(`https://www.webtoons.com/id/search?keyword=${query}`) + .then(({ + data + }) => { + const $ = cheerio.load(data) + const hasil = []; + $('#content > div.card_wrap.search._searchResult > ul > li ').each(function(a, b) { + result = { + status: 200, + author: author, + judul: $(b).find('> a > div > p.subj').text(), + like: $(b).find('> a > div > p.grade_area > em').text(), + creator: $(b).find('> a > div > p.author').text(), + genre: $(b).find('> a > span').text(), + thumbnail: $(b).find('> a > img').attr('src'), + url: 'https://www.webtoons.com' + $(b).find('> a').attr('href') + } + hasil.push(result) + }) + resolve(hasil) + }) + .catch(reject) + }) +} +const drakor = (query) => { + return new Promise((resolve, reject) => { + axios.get(`https://drakorasia.blog//?s=${query}&post_type=post`) + .then(({ + data + }) => { + const $ = cheerio.load(data) + const hasil = []; + $('#post > div ').each(function(a, b) { + result = { + status: 200, + author: author, + judul: $(b).find('> div.title.text-center.absolute.bottom-0.w-full.py-2.pb-4.px-3 > a > h2').text().trim(), + years: $(b).find('> div.title.text-center.absolute.bottom-0.w-full.py-2.pb-4.px-3 > div.category.text-gray.font-normal.text-white.text-xs.truncate > a').text(), + genre: $(b).find('> div.title.text-center.absolute.bottom-0.w-full.py-2.pb-4.px-3 > div.genrenya.text-center.text-white.text-opacity-75.text-xs.mt-1').text().trim(), + thumbnail: $(b).find('> div.thumbnail > a > img').attr('src'), + url: $(b).find('> div.title.text-center.absolute.bottom-0.w-full.py-2.pb-4.px-3 > a').attr('href') + } + hasil.push(result) + }) + resolve(hasil) + }) + .catch(reject) + }) +} +const telesticker = async (url) => { + return new Promise(async (resolve, reject) => { + packName = url.replace("https://t.me/addstickers/", "") + data = await axios(`https://api.telegram.org/bot891038791:AAHWB1dQd-vi0IbH2NjKYUk-hqQ8rQuzPD4/getStickerSet?name=${encodeURIComponent(packName)}`, {method: "GET",headers: {"User-Agent": "GoogleBot"}}) + const hasil = [] + for (let i = 0; i < data.data.result.stickers.length; i++) { + fileId = data.data.result.stickers[i].thumb.file_id + data2 = await axios(`https://api.telegram.org/bot891038791:AAHWB1dQd-vi0IbH2NjKYUk-hqQ8rQuzPD4/getFile?file_id=${fileId}`) + result = { + status: 200, + author: author, + url: "https://api.telegram.org/file/bot891038791:AAHWB1dQd-vi0IbH2NjKYUk-hqQ8rQuzPD4/" + data2.data.result.file_path + } + hasil.push(result) + } + resolve(hasil) + }) +} +const stickersearch = (query) => { + return new Promise((resolve, reject) => { + axios.get(`https://getstickerpack.com/stickers?query=${query}`) + .then(({ + data + }) => { + const $ = cheerio.load(data) + const source = []; + const link = []; + $('#stickerPacks > div > div:nth-child(3) > div > a').each(function(a, b) { + source.push($(b).attr('href')) + }) + axios.get(source[Math.floor(Math.random() * source.length)]) + .then(({ + data + }) => { + const $$ = cheerio.load(data) + $$('#stickerPack > div > div.row > div > img').each(function(c, d) { + link.push($$(d).attr('src').replace(/&d=200x200/g,'')) + }) + result = { + status: 200, + author: author, + title: $$('#intro > div > div > h1').text(), + sticker_url: link + } + resolve(result) + }) + }).catch(reject) + }) +} +const listsurah = () => { + return new Promise((resolve, reject) => { + axios.get('https://litequran.net/') + .then(({ data }) => { + const $ = cheerio.load(data) + let listsurah = [] + $('body > main > section > ol > li > a').each(function(a, b) { + listsurah.push($(b).text()) + }) + result = { + status: 200, + author: author, + listsurah: listsurah + } + resolve(result) + }).catch(reject) + }) + } +const surah = (query) => { + return new Promise((resolve, reject) => { + axios.get(`https://litequran.net/${query}`) + .then(({ + data + }) => { + const $ = cheerio.load(data) + const hasil = [] + $('body > main > article > ol > li').each(function(a, b) { + result = { + status: 200, + author: author, + arab: $(b).find('> span.ayat').text(), + latin: $(b).find('> span.bacaan').text(), + translate: $(b).find('> span.arti').text() + } + hasil.push(result) + }) + resolve(hasil) + }) + .catch(reject) + }) +} +const tafsirsurah = (query) => { + return new Promise((resolve, reject) => { + axios.get(`https://tafsirq.com/topik/${query}`) + .then(({ + data + }) => { + const $ = cheerio.load(data) + const hasil = [] + $('body > div:nth-child(4) > div > div.col-md-6 > div ').each(function(a, b) { + result = { + status: 200, + author: author, + surah: $(b).find('> div.panel-heading.panel-choco > div > div > a').text(), + tafsir: $(b).find('> div.panel-body.excerpt').text().trim(), + type: $(b).find('> div.panel-heading.panel-choco > div > div > span').text(), + source: $(b).find('> div.panel-heading.panel-choco > div > div > a').attr('href') + } + hasil.push(result) + }) + resolve(hasil) + }) + .catch(reject) + }) +} +const downloader = async (url) => { + return new Promise((resolve, reject) => { + axios({url: 'https://aiovideodl.ml/',method: 'GET',headers: {"user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36","cookie": "PHPSESSID=3893d5f173e91261118a1d8b2dc985c3; _ga=GA1.2.792478743.1635388171;"}}).then((data) => { + let a = cheerio.load(data.data) + let token = a('#token').attr('value') + const options = { + method: 'POST', + url: `https://aiovideodl.ml/wp-json/aio-dl/video-data/`, + headers: {"content-type": "application/x-www-form-urlencoded; charset=UTF-8","user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36","cookie": "PHPSESSID=3893d5f173e91261118a1d8b2dc985c3; _ga=GA1.2.792478743.1635388171;" + }, + formData: {url: url,token: token} + }; + request(options, async function(error, response, body) { + if (error) throw new Error(error) + res = JSON.parse(body) + res.status = 200 + res.author = author + resolve(res); + }); + }) + }) +} +const pinterest = (query) => { + return new Promise((resolve, reject) => { + axios(`https://www.pinterest.com/resource/BaseSearchResource/get/?source_url=%2Fsearch%2Fpins%2F%3Fq%3D${query}&data=%7B%22options%22%3A%7B%22isPrefetch%22%3Afalse%2C%22query%22%3A%22${query}%22%2C%22scope%22%3A%22pins%22%2C%22no_fetch_context_on_resource%22%3Afalse%7D%2C%22context%22%3A%7B%7D%7D&_=1619980301559`).then((data) => { + const random = data.data.resource_response.data.results[Math.floor(Math.random() * (data.data.resource_response.data.results.length))] + var result = []; + result = { + status: 200, + author: author, + url: random.images.orig.url + } + resolve(result) + }).catch(reject) + }) + } +const kompasnews = () => { + return new Promise((resolve, reject) => { + axios.get(`https://news.kompas.com/`) + .then(({ + data + }) => { + const $ = cheerio.load(data) + const hasil = []; + $('body > div > div.container.clearfix > div:nth-child(3) > div.col-bs10-7 > div:nth-child(3) > div.latest.ga--latest.mt2.clearfix > div > div ').each(function(a, b) { + result = { + status: 200, + author: author, + berita: $(b).find('> div > div.article__box > h3').text(), + upload_time: $(b).find('> div > div.article__box > div.article__date').text(), + type_berita: $(b).find('> div > div.article__boxsubtitle > h2').text(), + link: $(b).find('> div > div.article__box > h3 > a').attr('href'), + thumbnail: $(b).find('> div > div.article__asset > a > img').attr('data-src'), + info_berita: $(b).find('> div > div.article__box > div.article__lead').text() + } + hasil.push(result) + }) + resolve(hasil) + }) + .catch(reject) + }) +} +const inews = () => { + return new Promise((resolve, reject) => { + axios.get(`https://www.inews.id/news`) + .then(({ + data + }) => { + const $ = cheerio.load(data) + const hasil = []; + $('#news-list > li ').each(function(a, b) { + result = { + status: 200, + author: author, + berita: $(b).find('> a > div > div > div.float-left.width-400px.margin-130px-left > h3').text().trim(), + upload_time: $(b).find('> a > div > div > div.float-left.width-400px.margin-130px-left > div.date.margin-10px-left').text().trim().split('|')[0], + link: $(b).find('> a').attr('href'), + thumbnail: $(b).find('> a > div > div > div.float-left.width-130px.position-absolute > img').attr('data-original'), + info_berita: $(b).find('> a > div > div > div.float-left.width-400px.margin-130px-left > p').text() + } + hasil.push(result) + }) + resolve(hasil) + }) + .catch(reject) + }) +} +module.exports.Downloader = downloader +module.exports.Anime = anime +module.exports.Manga = manga +module.exports.Character = character +module.exports.JadwalBola = jadwalbola +module.exports.JadwalTv = jadwaltv +module.exports.JadwalSholat = jadwalsholat +module.exports.Pinterest = pinterest +module.exports.Film = film +module.exports.Wattpad = wattpad +module.exports.WattpadUser = wattpaduser +module.exports.Webtoons = webtoons +module.exports.Mangatoons = mangatoons +module.exports.Drakor = drakor +module.exports.Telesticker = telesticker +module.exports.StickerSearch = stickersearch +module.exports.ListSurah = listsurah +module.exports.Surah = surah +module.exports.TafsirSurah = tafsirsurah +module.exports.KompasNews = kompasnews +module.exports.INews = inews \ No newline at end of file diff --git a/node_modules/xfarr-api/main.js b/node_modules/xfarr-api/main.js new file mode 100644 index 000000000..f846d6b15 --- /dev/null +++ b/node_modules/xfarr-api/main.js @@ -0,0 +1,30 @@ +const xa = require('./index.js') + +module.exports.Youtube = xa.Downloader +module.exports.Tiktok = xa.Downloader +module.exports.Instagram = xa.Downloader +module.exports.Facebook = xa.Downloader +module.exports.Twitter = xa.Downloader +module.exports.SoundCloud = xa.Downloader +module.exports.Imgur = xa.Downloader +module.exports.Imdb = xa.Downloader +module.exports.Anime = xa.Anime +module.exports.Manga = xa.Manga +module.exports.Character = xa.Character +module.exports.JadwalBola = xa.JadwalBola +module.exports.JadwalTv = xa.JadwalTv +module.exports.JadwalSholat = xa.JadwalSholat +module.exports.Pinterest = xa.Pinterest +module.exports.Film = xa.Film +module.exports.Wattpad = xa.Wattpad +module.exports.WattpadUser = xa.WattpadUser +module.exports.Webtoons = xa.Webtoons +module.exports.Mangatoons = xa.Mangatoons +module.exports.Drakor = xa.Drakor +module.exports.Telesticker = xa.Telesticker +module.exports.StickerSearch = xa.StickerSearch +module.exports.ListSurah = xa.ListSurah +module.exports.Surah = xa.Surah +module.exports.TafsirSurah = xa.TafsirSurah +module.exports.KompasNews = xa.KompasNews +module.exports.INews = xa.INews \ No newline at end of file diff --git a/node_modules/xfarr-api/node_modules/axios/CHANGELOG.md b/node_modules/xfarr-api/node_modules/axios/CHANGELOG.md new file mode 100644 index 000000000..5e2b3d079 --- /dev/null +++ b/node_modules/xfarr-api/node_modules/axios/CHANGELOG.md @@ -0,0 +1,775 @@ +# Changelog + +### 0.21.4 (September 6, 2021) + +Fixes and Functionality: +- Fixing JSON transform when data is stringified. Providing backward compatibility and complying to the JSON RFC standard ([#4020](https://github.com/axios/axios/pull/4020)) + +Huge thanks to everyone who contributed to this release via code (authors listed below) or via reviews and triaging on GitHub: + +- [Jay](mailto:jasonsaayman@gmail.com) +- [Guillaume Fortaine](https://github.com/gfortaine) +- [Yusuke Kawasaki](https://github.com/kawanet) +- [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS) + +### 0.21.3 (September 4, 2021) + +Fixes and Functionality: +- Fixing response interceptor not being called when request interceptor is attached ([#4013](https://github.com/axios/axios/pull/4013)) + +Huge thanks to everyone who contributed to this release via code (authors listed below) or via reviews and triaging on GitHub: + +- [Jay](mailto:jasonsaayman@gmail.com) +- [Julian Hollmann](https://github.com/nerdbeere) + +### 0.21.2 (September 4, 2021) + +Fixes and Functionality: + +- Updating axios requests to be delayed by pre-emptive promise creation ([#2702](https://github.com/axios/axios/pull/2702)) +- Adding "synchronous" and "runWhen" options to interceptors api ([#2702](https://github.com/axios/axios/pull/2702)) +- Updating of transformResponse ([#3377](https://github.com/axios/axios/pull/3377)) +- Adding ability to omit User-Agent header ([#3703](https://github.com/axios/axios/pull/3703)) +- Adding multiple JSON improvements ([#3688](https://github.com/axios/axios/pull/3688), [#3763](https://github.com/axios/axios/pull/3763)) +- Fixing quadratic runtime and extra memory usage when setting a maxContentLength ([#3738](https://github.com/axios/axios/pull/3738)) +- Adding parseInt to config.timeout ([#3781](https://github.com/axios/axios/pull/3781)) +- Adding custom return type support to interceptor ([#3783](https://github.com/axios/axios/pull/3783)) +- Adding security fix for ReDoS vulnerability ([#3980](https://github.com/axios/axios/pull/3980)) + +Internal and Tests: + +- Updating build dev dependancies ([#3401](https://github.com/axios/axios/pull/3401)) +- Fixing builds running on Travis CI ([#3538](https://github.com/axios/axios/pull/3538)) +- Updating follow rediect version ([#3694](https://github.com/axios/axios/pull/3694), [#3771](https://github.com/axios/axios/pull/3771)) +- Updating karma sauce launcher to fix failing sauce tests ([#3712](https://github.com/axios/axios/pull/3712), [#3717](https://github.com/axios/axios/pull/3717)) +- Updating content-type header for application/json to not contain charset field, according do RFC 8259 ([#2154](https://github.com/axios/axios/pull/2154)) +- Fixing tests by bumping karma-sauce-launcher version ([#3813](https://github.com/axios/axios/pull/3813)) +- Changing testing process from Travis CI to GitHub Actions ([#3938](https://github.com/axios/axios/pull/3938)) + +Documentation: + +- Updating documentation around the use of `AUTH_TOKEN` with multiple domain endpoints ([#3539](https://github.com/axios/axios/pull/3539)) +- Remove duplication of item in changelog ([#3523](https://github.com/axios/axios/pull/3523)) +- Fixing gramatical errors ([#2642](https://github.com/axios/axios/pull/2642)) +- Fixing spelling error ([#3567](https://github.com/axios/axios/pull/3567)) +- Moving gitpod metion ([#2637](https://github.com/axios/axios/pull/2637)) +- Adding new axios documentation website link ([#3681](https://github.com/axios/axios/pull/3681), [#3707](https://github.com/axios/axios/pull/3707)) +- Updating documentation around dispatching requests ([#3772](https://github.com/axios/axios/pull/3772)) +- Adding documentation for the type guard isAxiosError ([#3767](https://github.com/axios/axios/pull/3767)) +- Adding explanation of cancel token ([#3803](https://github.com/axios/axios/pull/3803)) +- Updating CI status badge ([#3953](https://github.com/axios/axios/pull/3953)) +- Fixing errors with JSON documentation ([#3936](https://github.com/axios/axios/pull/3936)) +- Fixing README typo under Request Config ([#3825](https://github.com/axios/axios/pull/3825)) +- Adding axios-multi-api to the ecosystem file ([#3817](https://github.com/axios/axios/pull/3817)) +- Adding SECURITY.md to properly disclose security vulnerabilities ([#3981](https://github.com/axios/axios/pull/3981)) + +Huge thanks to everyone who contributed to this release via code (authors listed below) or via reviews and triaging on GitHub: + +- [Jay](mailto:jasonsaayman@gmail.com) +- [Sasha Korotkov](https://github.com/SashaKoro) +- [Daniel Lopretto](https://github.com/timemachine3030) +- [Mike Bishop](https://github.com/MikeBishop) +- [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS) +- [Mark](https://github.com/bimbiltu) +- [Philipe Gouveia Paixão](https://github.com/piiih) +- [hippo](https://github.com/hippo2cat) +- [ready-research](https://github.com/ready-research) +- [Xianming Zhong](https://github.com/chinesedfan) +- [Christopher Chrapka](https://github.com/OJezu) +- [Brian Anglin](https://github.com/anglinb) +- [Kohta Ito](https://github.com/koh110) +- [Ali Clark](https://github.com/aliclark) +- [caikan](https://github.com/caikan) +- [Elina Gorshkova](https://github.com/elinagorshkova) +- [Ryota Ikezawa](https://github.com/paveg) +- [Nisar Hassan Naqvi](https://github.com/nisarhassan12) +- [Jake](https://github.com/codemaster138) +- [TagawaHirotaka](https://github.com/wafuwafu13) +- [Johannes Jarbratt](https://github.com/johachi) +- [Mo Sattler](https://github.com/MoSattler) +- [Sam Carlton](https://github.com/ThatGuySam) +- [Matt Czapliński](https://github.com/MattCCC) +- [Ziding Zhang](https://github.com/zidingz) + +### 0.21.1 (December 21, 2020) + +Fixes and Functionality: + +- Hotfix: Prevent SSRF ([#3410](https://github.com/axios/axios/pull/3410)) +- Protocol not parsed when setting proxy config from env vars ([#3070](https://github.com/axios/axios/pull/3070)) +- Updating axios in types to be lower case ([#2797](https://github.com/axios/axios/pull/2797)) +- Adding a type guard for `AxiosError` ([#2949](https://github.com/axios/axios/pull/2949)) + +Internal and Tests: + +- Remove the skipping of the `socket` http test ([#3364](https://github.com/axios/axios/pull/3364)) +- Use different socket for Win32 test ([#3375](https://github.com/axios/axios/pull/3375)) + +Huge thanks to everyone who contributed to this release via code (authors listed below) or via reviews and triaging on GitHub: + +- Daniel Lopretto +- Jason Kwok +- Jay +- Jonathan Foster +- Remco Haszing +- Xianming Zhong + +### 0.21.0 (October 23, 2020) + +Fixes and Functionality: + +- Fixing requestHeaders.Authorization ([#3287](https://github.com/axios/axios/pull/3287)) +- Fixing node types ([#3237](https://github.com/axios/axios/pull/3237)) +- Fixing axios.delete ignores config.data ([#3282](https://github.com/axios/axios/pull/3282)) +- Revert "Fixing overwrite Blob/File type as Content-Type in browser. (#1773)" ([#3289](https://github.com/axios/axios/pull/3289)) +- Fixing an issue that type 'null' and 'undefined' is not assignable to validateStatus when typescript strict option is enabled ([#3200](https://github.com/axios/axios/pull/3200)) + +Internal and Tests: + +- Lock travis to not use node v15 ([#3361](https://github.com/axios/axios/pull/3361)) + +Documentation: + +- Fixing simple typo, existant -> existent ([#3252](https://github.com/axios/axios/pull/3252)) +- Fixing typos ([#3309](https://github.com/axios/axios/pull/3309)) + +Huge thanks to everyone who contributed to this release via code (authors listed below) or via reviews and triaging on GitHub: + +- Allan Cruz <57270969+Allanbcruz@users.noreply.github.com> +- George Cheng +- Jay +- Kevin Kirsche +- Remco Haszing +- Taemin Shin +- Tim Gates +- Xianming Zhong + +### 0.20.0 (August 20, 2020) + +Release of 0.20.0-pre as a full release with no other changes. + +### 0.20.0-pre (July 15, 2020) + +Fixes and Functionality: + +- Fixing response with utf-8 BOM can not parse to json ([#2419](https://github.com/axios/axios/pull/2419)) + - fix: remove byte order marker (UTF-8 BOM) when transform response + - fix: remove BOM only utf-8 + - test: utf-8 BOM + - fix: incorrect param name +- Refactor mergeConfig without utils.deepMerge ([#2844](https://github.com/axios/axios/pull/2844)) + - Adding failing test + - Fixing #2587 default custom config persisting + - Adding Concat keys and filter duplicates + - Fixed value from CPE + - update for review feedbacks + - no deepMerge + - only merge between plain objects + - fix rename + - always merge config by mergeConfig + - extract function mergeDeepProperties + - refactor mergeConfig with all keys, and add special logic for validateStatus + - add test for resetting headers + - add lots of tests and fix a bug + - should not inherit `data` + - use simple toString +- Fixing overwrite Blob/File type as Content-Type in browser. ([#1773](https://github.com/axios/axios/pull/1773)) +- Fixing an issue that type 'null' is not assignable to validateStatus ([#2773](https://github.com/axios/axios/pull/2773)) +- Fixing special char encoding ([#1671](https://github.com/axios/axios/pull/1671)) + - removing @ character from replacement list since it is a reserved character + - Updating buildURL test to not include the @ character + - Removing console logs +- Fixing password encoding with special characters in basic authentication ([#1492](https://github.com/axios/axios/pull/1492)) + - Fixing password encoding with special characters in basic authentication + - Adding test to check if password with non-Latin1 characters pass +- Fixing 'Network Error' in react native android ([#1487](https://github.com/axios/axios/pull/1487)) + There is a bug in react native Android platform when using get method. It will trigger a 'Network Error' when passing the requestData which is an empty string to request.send function. So if the requestData is an empty string we can set it to null as well to fix the bug. +- Fixing Cookie Helper with Async Components ([#1105](https://github.com/axios/axios/pull/1105)) ([#1107](https://github.com/axios/axios/pull/1107)) +- Fixing 'progressEvent' type ([#2851](https://github.com/axios/axios/pull/2851)) + - Fix 'progressEvent' type + - Update axios.ts +- Fixing getting local files (file://) failed ([#2470](https://github.com/axios/axios/pull/2470)) + - fix issue #2416, #2396 + - fix Eslint warn + - Modify judgment conditions + - add unit test + - update unit test + - update unit test +- Allow PURGE method in typings ([#2191](https://github.com/axios/axios/pull/2191)) +- Adding option to disable automatic decompression ([#2661](https://github.com/axios/axios/pull/2661)) + - Adding ability to disable auto decompression + - Updating decompress documentation in README + - Fixing test\unit\adapters\http.js lint errors + - Adding test for disabling auto decompression + - Removing changes that fixed lint errors in tests + - Removing formatting change to unit test +- Add independent `maxBodyLength` option ([#2781](https://github.com/axios/axios/pull/2781)) + - Add independent option to set the maximum size of the request body + - Remove maxBodyLength check + - Update README + - Assert for error code and message +- Adding responseEncoding to mergeConfig ([#1745](https://github.com/axios/axios/pull/1745)) +- Compatible with follow-redirect aborts the request ([#2689](https://github.com/axios/axios/pull/2689)) + - Compatible with follow-redirect aborts the request + - Use the error code +- Fix merging of params ([#2656](https://github.com/axios/axios/pull/2656)) + - Name function to avoid ESLint func-names warning + - Switch params config to merge list and update tests + - Restore testing of both false and null + - Restore test cases for keys without defaults + - Include test for non-object values that aren't false-y. +- Revert `finally` as `then` ([#2683](https://github.com/axios/axios/pull/2683)) + +Internal and Tests: + +- Fix stale bot config ([#3049](https://github.com/axios/axios/pull/3049)) + - fix stale bot config + - fix multiple lines +- Add days and change name to work ([#3035](https://github.com/axios/axios/pull/3035)) +- Update close-issues.yml ([#3031](https://github.com/axios/axios/pull/3031)) + - Update close-issues.yml + Update close message to read better 😄 + - Fix use of quotations + Use single quotes as per other .yml files + - Remove user name form message +- Add GitHub actions to close stale issues/prs ([#3029](https://github.com/axios/axios/pull/3029)) + - prepare stale actions + - update messages + - Add exempt labels and lighten up comments +- Add GitHub actions to close invalid issues ([#3022](https://github.com/axios/axios/pull/3022)) + - add close actions + - fix with checkout + - update issue templates + - add reminder + - update close message +- Add test with Node.js 12 ([#2860](https://github.com/axios/axios/pull/2860)) + - test with Node.js 12 + - test with latest +- Adding console log on sandbox server startup ([#2210](https://github.com/axios/axios/pull/2210)) + - Adding console log on sandbox server startup + - Update server.js + Add server error handling + - Update server.js + Better error message, remove retry. +- Adding tests for method `options` type definitions ([#1996](https://github.com/axios/axios/pull/1996)) + Update tests. +- Add test for redirecting with too large response ([#2695](https://github.com/axios/axios/pull/2695)) +- Fixing unit test failure in Windows OS ([#2601](https://github.com/axios/axios/pull/2601)) +- Fixing issue for HEAD method and gzipped response ([#2666](https://github.com/axios/axios/pull/2666)) +- Fix tests in browsers ([#2748](https://github.com/axios/axios/pull/2748)) +- chore: add `jsdelivr` and `unpkg` support ([#2443](https://github.com/axios/axios/pull/2443)) + +Documentation: + +- Adding support for URLSearchParams in node ([#1900](https://github.com/axios/axios/pull/1900)) + - Adding support for URLSearchParams in node + - Remove un-needed code + - Update utils.js + - Make changes as suggested +- Adding table of content (preview) ([#3050](https://github.com/axios/axios/pull/3050)) + - add toc (preview) + - remove toc in toc + Signed-off-by: Moni + - fix sublinks + - fix indentation + - remove redundant table links + - update caps and indent + - remove axios +- Replace 'blacklist' with 'blocklist' ([#3006](https://github.com/axios/axios/pull/3006)) +- docs(): Detailed config options environment. ([#2088](https://github.com/axios/axios/pull/2088)) + - docs(): Detailed config options environment. + - Update README.md +- Include axios-data-unpacker in ECOSYSTEM.md ([#2080](https://github.com/axios/axios/pull/2080)) +- Allow opening examples in Gitpod ([#1958](https://github.com/axios/axios/pull/1958)) +- Remove axios.all() and axios.spread() from Readme.md ([#2727](https://github.com/axios/axios/pull/2727)) + - remove axios.all(), axios.spread() + - replace example + - axios.all() -> Promise.all() + - axios.spread(function (acct, perms)) -> function (acct, perms) + - add deprecated mark +- Update README.md ([#2887](https://github.com/axios/axios/pull/2887)) + Small change to the data attribute doc of the config. A request body can also be set for DELETE methods but this wasn't mentioned in the documentation (it only mentioned POST, PUT and PATCH). Took my some 10-20 minutes until I realized that I don't need to manipulate the request body with transformRequest in the case of DELETE. +- Include swagger-taxos-codegen in ECOSYSTEM.md ([#2162](https://github.com/axios/axios/pull/2162)) +- Add CDNJS version badge in README.md ([#878](https://github.com/axios/axios/pull/878)) + This badge will show the version on CDNJS! +- Documentation update to clear up ambiguity in code examples ([#2928](https://github.com/axios/axios/pull/2928)) + - Made an adjustment to the documentation to clear up any ambiguity around the use of "fs". This should help clear up that the code examples with "fs" cannot be used on the client side. +- Update README.md about validateStatus ([#2912](https://github.com/axios/axios/pull/2912)) + Rewrote the comment from "Reject only if the status code is greater than or equal to 500" to "Resolve only if the status code is less than 500" +- Updating documentation for usage form-data ([#2805](https://github.com/axios/axios/pull/2805)) + Closes #2049 +- Fixing CHANGELOG.md issue link ([#2784](https://github.com/axios/axios/pull/2784)) +- Include axios-hooks in ECOSYSTEM.md ([#2003](https://github.com/axios/axios/pull/2003)) +- Added Response header access instructions ([#1901](https://github.com/axios/axios/pull/1901)) + - Added Response header access instructions + - Added note about using bracket notation +- Add `onUploadProgress` and `onDownloadProgress` are browser only ([#2763](https://github.com/axios/axios/pull/2763)) + Saw in #928 and #1966 that `onUploadProgress` and `onDownloadProgress` only work in the browser and was missing that from the README. +- Update ' sign to ` in proxy spec ([#2778](https://github.com/axios/axios/pull/2778)) +- Adding jsDelivr link in README ([#1110](https://github.com/axios/axios/pull/1110)) + - Adding jsDelivr link + - Add SRI + - Remove SRI + +Huge thanks to everyone who contributed to this release via code (authors listed +below) or via reviews and triaging on GitHub: + +- Alan Wang +- Alexandru Ungureanu +- Anubhav Srivastava +- Benny Neugebauer +- Cr <631807682@qq.com> +- David +- David Ko +- David Tanner +- Emily Morehouse +- Felipe Martins +- Fonger <5862369+Fonger@users.noreply.github.com> +- Frostack +- George Cheng +- grumblerchester +- Gustavo López +- hexaez <45806662+hexaez@users.noreply.github.com> +- huangzuizui +- Ian Wijma +- Jay +- jeffjing +- jennynju <46782518+jennynju@users.noreply.github.com> +- Jimmy Liao <52391190+jimmy-liao-gogoro@users.noreply.github.com> +- Jonathan Sharpe +- JounQin +- Justin Beckwith +- Kamil Posiadała <3dcreator.pl@gmail.com> +- Lukas Drgon +- marcinx +- Martti Laine +- Michał Zarach +- Moni +- Motonori Iwata <121048+iwata@users.noreply.github.com> +- Nikita Galkin +- Petr Mares +- Philippe Recto +- Remco Haszing +- rockcs1992 +- Ryan Bown +- Samina Fu +- Simone Busoli +- Spencer von der Ohe +- Sven Efftinge +- Taegyeoung Oh +- Taemin Shin +- Thibault Ehrhart <1208424+ehrhart@users.noreply.github.com> +- Xianming Zhong +- Yasu Flores +- Zac Delventhal + +### 0.19.2 (Jan 20, 2020) + +- Remove unnecessary XSS check ([#2679](https://github.com/axios/axios/pull/2679)) (see ([#2646](https://github.com/axios/axios/issues/2646)) for discussion) + +### 0.19.1 (Jan 7, 2020) + +Fixes and Functionality: + +- Fixing invalid agent issue ([#1904](https://github.com/axios/axios/pull/1904)) +- Fix ignore set withCredentials false ([#2582](https://github.com/axios/axios/pull/2582)) +- Delete useless default to hash ([#2458](https://github.com/axios/axios/pull/2458)) +- Fix HTTP/HTTPs agents passing to follow-redirect ([#1904](https://github.com/axios/axios/pull/1904)) +- Fix ignore set withCredentials false ([#2582](https://github.com/axios/axios/pull/2582)) +- Fix CI build failure ([#2570](https://github.com/axios/axios/pull/2570)) +- Remove dependency on is-buffer from package.json ([#1816](https://github.com/axios/axios/pull/1816)) +- Adding options typings ([#2341](https://github.com/axios/axios/pull/2341)) +- Adding Typescript HTTP method definition for LINK and UNLINK. ([#2444](https://github.com/axios/axios/pull/2444)) +- Update dist with newest changes, fixes Custom Attributes issue +- Change syntax to see if build passes ([#2488](https://github.com/axios/axios/pull/2488)) +- Update Webpack + deps, remove now unnecessary polyfills ([#2410](https://github.com/axios/axios/pull/2410)) +- Fix to prevent XSS, throw an error when the URL contains a JS script ([#2464](https://github.com/axios/axios/pull/2464)) +- Add custom timeout error copy in config ([#2275](https://github.com/axios/axios/pull/2275)) +- Add error toJSON example ([#2466](https://github.com/axios/axios/pull/2466)) +- Fixing Vulnerability A Fortify Scan finds a critical Cross-Site Scrip… ([#2451](https://github.com/axios/axios/pull/2451)) +- Fixing subdomain handling on no_proxy ([#2442](https://github.com/axios/axios/pull/2442)) +- Make redirection from HTTP to HTTPS work ([#2426](https://github.com/axios/axios/pull/2426)) and ([#2547](https://github.com/axios/axios/pull/2547)) +- Add toJSON property to AxiosError type ([#2427](https://github.com/axios/axios/pull/2427)) +- Fixing socket hang up error on node side for slow response. ([#1752](https://github.com/axios/axios/pull/1752)) +- Alternative syntax to send data into the body ([#2317](https://github.com/axios/axios/pull/2317)) +- Fixing custom config options ([#2207](https://github.com/axios/axios/pull/2207)) +- Fixing set `config.method` after mergeConfig for Axios.prototype.request ([#2383](https://github.com/axios/axios/pull/2383)) +- Axios create url bug ([#2290](https://github.com/axios/axios/pull/2290)) +- Do not modify config.url when using a relative baseURL (resolves [#1628](https://github.com/axios/axios/issues/1098)) ([#2391](https://github.com/axios/axios/pull/2391)) + +Internal: + +- Revert "Update Webpack + deps, remove now unnecessary polyfills" ([#2479](https://github.com/axios/axios/pull/2479)) +- Order of if/else blocks is causing unit tests mocking XHR. ([#2201](https://github.com/axios/axios/pull/2201)) +- Add license badge ([#2446](https://github.com/axios/axios/pull/2446)) +- Fix travis CI build [#2386](https://github.com/axios/axios/pull/2386) +- Fix cancellation error on build master. #2290 #2207 ([#2407](https://github.com/axios/axios/pull/2407)) + +Documentation: + +- Fixing typo in CHANGELOG.md: s/Functionallity/Functionality ([#2639](https://github.com/axios/axios/pull/2639)) +- Fix badge, use master branch ([#2538](https://github.com/axios/axios/pull/2538)) +- Fix typo in changelog [#2193](https://github.com/axios/axios/pull/2193) +- Document fix ([#2514](https://github.com/axios/axios/pull/2514)) +- Update docs with no_proxy change, issue #2484 ([#2513](https://github.com/axios/axios/pull/2513)) +- Fixing missing words in docs template ([#2259](https://github.com/axios/axios/pull/2259)) +- 🐛Fix request finally documentation in README ([#2189](https://github.com/axios/axios/pull/2189)) +- updating spelling and adding link to docs ([#2212](https://github.com/axios/axios/pull/2212)) +- docs: minor tweak ([#2404](https://github.com/axios/axios/pull/2404)) +- Update response interceptor docs ([#2399](https://github.com/axios/axios/pull/2399)) +- Update README.md ([#2504](https://github.com/axios/axios/pull/2504)) +- Fix word 'sintaxe' to 'syntax' in README.md ([#2432](https://github.com/axios/axios/pull/2432)) +- updating README: notes on CommonJS autocomplete ([#2256](https://github.com/axios/axios/pull/2256)) +- Fix grammar in README.md ([#2271](https://github.com/axios/axios/pull/2271)) +- Doc fixes, minor examples cleanup ([#2198](https://github.com/axios/axios/pull/2198)) + +### 0.19.0 (May 30, 2019) + +Fixes and Functionality: + +- Added support for no_proxy env variable ([#1693](https://github.com/axios/axios/pull/1693/files)) - Chance Dickson +- Unzip response body only for statuses != 204 ([#1129](https://github.com/axios/axios/pull/1129)) - drawski +- Destroy stream on exceeding maxContentLength (fixes [#1098](https://github.com/axios/axios/issues/1098)) ([#1485](https://github.com/axios/axios/pull/1485)) - Gadzhi Gadzhiev +- Makes Axios error generic to use AxiosResponse ([#1738](https://github.com/axios/axios/pull/1738)) - Suman Lama +- Fixing Mocha tests by locking follow-redirects version to 1.5.10 ([#1993](https://github.com/axios/axios/pull/1993)) - grumblerchester +- Allow uppercase methods in typings. ([#1781](https://github.com/axios/axios/pull/1781)) - Ken Powers +- Fixing building url with hash mark ([#1771](https://github.com/axios/axios/pull/1771)) - Anatoly Ryabov +- This commit fix building url with hash map (fragment identifier) when parameters are present: they must not be added after `#`, because client cut everything after `#` +- Preserve HTTP method when following redirect ([#1758](https://github.com/axios/axios/pull/1758)) - Rikki Gibson +- Add `getUri` signature to TypeScript definition. ([#1736](https://github.com/axios/axios/pull/1736)) - Alexander Trauzzi +- Adding isAxiosError flag to errors thrown by axios ([#1419](https://github.com/axios/axios/pull/1419)) - Ayush Gupta + +Internal: + +- Fixing .eslintrc without extension ([#1789](https://github.com/axios/axios/pull/1789)) - Manoel +- Fix failing SauceLabs tests by updating configuration - Emily Morehouse +- Add issue templates - Emily Morehouse + +Documentation: + +- Consistent coding style in README ([#1787](https://github.com/axios/axios/pull/1787)) - Ali Servet Donmez +- Add information about auth parameter to README ([#2166](https://github.com/axios/axios/pull/2166)) - xlaguna +- Add DELETE to list of methods that allow data as a config option ([#2169](https://github.com/axios/axios/pull/2169)) - Daniela Borges Matos de Carvalho +- Update ECOSYSTEM.md - Add Axios Endpoints ([#2176](https://github.com/axios/axios/pull/2176)) - Renan +- Add r2curl in ECOSYSTEM ([#2141](https://github.com/axios/axios/pull/2141)) - 유용우 / CX +- Update README.md - Add instructions for installing with yarn ([#2036](https://github.com/axios/axios/pull/2036)) - Victor Hermes +- Fixing spacing for README.md ([#2066](https://github.com/axios/axios/pull/2066)) - Josh McCarty +- Update README.md. - Change `.then` to `.finally` in example code ([#2090](https://github.com/axios/axios/pull/2090)) - Omar Cai +- Clarify what values responseType can have in Node ([#2121](https://github.com/axios/axios/pull/2121)) - Tyler Breisacher +- docs(ECOSYSTEM): add axios-api-versioning ([#2020](https://github.com/axios/axios/pull/2020)) - Weffe +- It seems that `responseType: 'blob'` doesn't actually work in Node (when I tried using it, response.data was a string, not a Blob, since Node doesn't have Blobs), so this clarifies that this option should only be used in the browser +- Update README.md. - Add Querystring library note ([#1896](https://github.com/axios/axios/pull/1896)) - Dmitriy Eroshenko +- Add react-hooks-axios to Libraries section of ECOSYSTEM.md ([#1925](https://github.com/axios/axios/pull/1925)) - Cody Chan +- Clarify in README that default timeout is 0 (no timeout) ([#1750](https://github.com/axios/axios/pull/1750)) - Ben Standefer + +### 0.19.0-beta.1 (Aug 9, 2018) + +**NOTE:** This is a beta version of this release. There may be functionality that is broken in +certain browsers, though we suspect that builds are hanging and not erroring. See +https://saucelabs.com/u/axios for the most up-to-date information. + +New Functionality: + +- Add getUri method ([#1712](https://github.com/axios/axios/issues/1712)) +- Add support for no_proxy env variable ([#1693](https://github.com/axios/axios/issues/1693)) +- Add toJSON to decorated Axios errors to facilitate serialization ([#1625](https://github.com/axios/axios/issues/1625)) +- Add second then on axios call ([#1623](https://github.com/axios/axios/issues/1623)) +- Typings: allow custom return types +- Add option to specify character set in responses (with http adapter) + +Fixes: + +- Fix Keep defaults local to instance ([#385](https://github.com/axios/axios/issues/385)) +- Correctly catch exception in http test ([#1475](https://github.com/axios/axios/issues/1475)) +- Fix accept header normalization ([#1698](https://github.com/axios/axios/issues/1698)) +- Fix http adapter to allow HTTPS connections via HTTP ([#959](https://github.com/axios/axios/issues/959)) +- Fix Removes usage of deprecated Buffer constructor. ([#1555](https://github.com/axios/axios/issues/1555), [#1622](https://github.com/axios/axios/issues/1622)) +- Fix defaults to use httpAdapter if available ([#1285](https://github.com/axios/axios/issues/1285)) + - Fixing defaults to use httpAdapter if available + - Use a safer, cross-platform method to detect the Node environment +- Fix Reject promise if request is cancelled by the browser ([#537](https://github.com/axios/axios/issues/537)) +- [Typescript] Fix missing type parameters on delete/head methods +- [NS]: Send `false` flag isStandardBrowserEnv for Nativescript +- Fix missing type parameters on delete/head +- Fix Default method for an instance always overwritten by get +- Fix type error when socketPath option in AxiosRequestConfig +- Capture errors on request data streams +- Decorate resolve and reject to clear timeout in all cases + +Huge thanks to everyone who contributed to this release via code (authors listed +below) or via reviews and triaging on GitHub: + +- Andrew Scott +- Anthony Gauthier +- arpit +- ascott18 +- Benedikt Rötsch +- Chance Dickson +- Dave Stewart +- Deric Cain +- Guillaume Briday +- Jacob Wejendorp +- Jim Lynch +- johntron +- Justin Beckwith +- Justin Beckwith +- Khaled Garbaya +- Lim Jing Rong +- Mark van den Broek +- Martti Laine +- mattridley +- mattridley +- Nicolas Del Valle +- Nilegfx +- pbarbiero +- Rikki Gibson +- Sako Hartounian +- Shane Fitzpatrick +- Stephan Schneider +- Steven +- Tim Garthwaite +- Tim Johns +- Yutaro Miyazaki + +### 0.18.0 (Feb 19, 2018) + +- Adding support for UNIX Sockets when running with Node.js ([#1070](https://github.com/axios/axios/pull/1070)) +- Fixing typings ([#1177](https://github.com/axios/axios/pull/1177)): + - AxiosRequestConfig.proxy: allows type false + - AxiosProxyConfig: added auth field +- Adding function signature in AxiosInstance interface so AxiosInstance can be invoked ([#1192](https://github.com/axios/axios/pull/1192), [#1254](https://github.com/axios/axios/pull/1254)) +- Allowing maxContentLength to pass through to redirected calls as maxBodyLength in follow-redirects config ([#1287](https://github.com/axios/axios/pull/1287)) +- Fixing configuration when using an instance - method can now be set ([#1342](https://github.com/axios/axios/pull/1342)) + +### 0.17.1 (Nov 11, 2017) + +- Fixing issue with web workers ([#1160](https://github.com/axios/axios/pull/1160)) +- Allowing overriding transport ([#1080](https://github.com/axios/axios/pull/1080)) +- Updating TypeScript typings ([#1165](https://github.com/axios/axios/pull/1165), [#1125](https://github.com/axios/axios/pull/1125), [#1131](https://github.com/axios/axios/pull/1131)) + +### 0.17.0 (Oct 21, 2017) + +- **BREAKING** Fixing issue with `baseURL` and interceptors ([#950](https://github.com/axios/axios/pull/950)) +- **BREAKING** Improving handing of duplicate headers ([#874](https://github.com/axios/axios/pull/874)) +- Adding support for disabling proxies ([#691](https://github.com/axios/axios/pull/691)) +- Updating TypeScript typings with generic type parameters ([#1061](https://github.com/axios/axios/pull/1061)) + +### 0.16.2 (Jun 3, 2017) + +- Fixing issue with including `buffer` in bundle ([#887](https://github.com/axios/axios/pull/887)) +- Including underlying request in errors ([#830](https://github.com/axios/axios/pull/830)) +- Convert `method` to lowercase ([#930](https://github.com/axios/axios/pull/930)) + +### 0.16.1 (Apr 8, 2017) + +- Improving HTTP adapter to return last request in case of redirects ([#828](https://github.com/axios/axios/pull/828)) +- Updating `follow-redirects` dependency ([#829](https://github.com/axios/axios/pull/829)) +- Adding support for passing `Buffer` in node ([#773](https://github.com/axios/axios/pull/773)) + +### 0.16.0 (Mar 31, 2017) + +- **BREAKING** Removing `Promise` from axios typings in favor of built-in type declarations ([#480](https://github.com/axios/axios/issues/480)) +- Adding `options` shortcut method ([#461](https://github.com/axios/axios/pull/461)) +- Fixing issue with using `responseType: 'json'` in browsers incompatible with XHR Level 2 ([#654](https://github.com/axios/axios/pull/654)) +- Improving React Native detection ([#731](https://github.com/axios/axios/pull/731)) +- Fixing `combineURLs` to support empty `relativeURL` ([#581](https://github.com/axios/axios/pull/581)) +- Removing `PROTECTION_PREFIX` support ([#561](https://github.com/axios/axios/pull/561)) + +### 0.15.3 (Nov 27, 2016) + +- Fixing issue with custom instances and global defaults ([#443](https://github.com/axios/axios/issues/443)) +- Renaming `axios.d.ts` to `index.d.ts` ([#519](https://github.com/axios/axios/issues/519)) +- Adding `get`, `head`, and `delete` to `defaults.headers` ([#509](https://github.com/axios/axios/issues/509)) +- Fixing issue with `btoa` and IE ([#507](https://github.com/axios/axios/issues/507)) +- Adding support for proxy authentication ([#483](https://github.com/axios/axios/pull/483)) +- Improving HTTP adapter to use `http` protocol by default ([#493](https://github.com/axios/axios/pull/493)) +- Fixing proxy issues ([#491](https://github.com/axios/axios/pull/491)) + +### 0.15.2 (Oct 17, 2016) + +- Fixing issue with calling `cancel` after response has been received ([#482](https://github.com/axios/axios/issues/482)) + +### 0.15.1 (Oct 14, 2016) + +- Fixing issue with UMD ([#485](https://github.com/axios/axios/issues/485)) + +### 0.15.0 (Oct 10, 2016) + +- Adding cancellation support ([#452](https://github.com/axios/axios/pull/452)) +- Moving default adapter to global defaults ([#437](https://github.com/axios/axios/pull/437)) +- Fixing issue with `file` URI scheme ([#440](https://github.com/axios/axios/pull/440)) +- Fixing issue with `params` objects that have no prototype ([#445](https://github.com/axios/axios/pull/445)) + +### 0.14.0 (Aug 27, 2016) + +- **BREAKING** Updating TypeScript definitions ([#419](https://github.com/axios/axios/pull/419)) +- **BREAKING** Replacing `agent` option with `httpAgent` and `httpsAgent` ([#387](https://github.com/axios/axios/pull/387)) +- **BREAKING** Splitting `progress` event handlers into `onUploadProgress` and `onDownloadProgress` ([#423](https://github.com/axios/axios/pull/423)) +- Adding support for `http_proxy` and `https_proxy` environment variables ([#366](https://github.com/axios/axios/pull/366)) +- Fixing issue with `auth` config option and `Authorization` header ([#397](https://github.com/axios/axios/pull/397)) +- Don't set XSRF header if `xsrfCookieName` is `null` ([#406](https://github.com/axios/axios/pull/406)) + +### 0.13.1 (Jul 16, 2016) + +- Fixing issue with response data not being transformed on error ([#378](https://github.com/axios/axios/issues/378)) + +### 0.13.0 (Jul 13, 2016) + +- **BREAKING** Improved error handling ([#345](https://github.com/axios/axios/pull/345)) +- **BREAKING** Response transformer now invoked in dispatcher not adapter ([10eb238](https://github.com/axios/axios/commit/10eb23865101f9347570552c04e9d6211376e25e)) +- **BREAKING** Request adapters now return a `Promise` ([157efd5](https://github.com/axios/axios/commit/157efd5615890301824e3121cc6c9d2f9b21f94a)) +- Fixing issue with `withCredentials` not being overwritten ([#343](https://github.com/axios/axios/issues/343)) +- Fixing regression with request transformer being called before request interceptor ([#352](https://github.com/axios/axios/issues/352)) +- Fixing custom instance defaults ([#341](https://github.com/axios/axios/issues/341)) +- Fixing instances created from `axios.create` to have same API as default axios ([#217](https://github.com/axios/axios/issues/217)) + +### 0.12.0 (May 31, 2016) + +- Adding support for `URLSearchParams` ([#317](https://github.com/axios/axios/pull/317)) +- Adding `maxRedirects` option ([#307](https://github.com/axios/axios/pull/307)) + +### 0.11.1 (May 17, 2016) + +- Fixing IE CORS support ([#313](https://github.com/axios/axios/pull/313)) +- Fixing detection of `FormData` ([#325](https://github.com/axios/axios/pull/325)) +- Adding `Axios` class to exports ([#321](https://github.com/axios/axios/pull/321)) + +### 0.11.0 (Apr 26, 2016) + +- Adding support for Stream with HTTP adapter ([#296](https://github.com/axios/axios/pull/296)) +- Adding support for custom HTTP status code error ranges ([#308](https://github.com/axios/axios/pull/308)) +- Fixing issue with ArrayBuffer ([#299](https://github.com/axios/axios/pull/299)) + +### 0.10.0 (Apr 20, 2016) + +- Fixing issue with some requests sending `undefined` instead of `null` ([#250](https://github.com/axios/axios/pull/250)) +- Fixing basic auth for HTTP adapter ([#252](https://github.com/axios/axios/pull/252)) +- Fixing request timeout for XHR adapter ([#227](https://github.com/axios/axios/pull/227)) +- Fixing IE8 support by using `onreadystatechange` instead of `onload` ([#249](https://github.com/axios/axios/pull/249)) +- Fixing IE9 cross domain requests ([#251](https://github.com/axios/axios/pull/251)) +- Adding `maxContentLength` option ([#275](https://github.com/axios/axios/pull/275)) +- Fixing XHR support for WebWorker environment ([#279](https://github.com/axios/axios/pull/279)) +- Adding request instance to response ([#200](https://github.com/axios/axios/pull/200)) + +### 0.9.1 (Jan 24, 2016) + +- Improving handling of request timeout in node ([#124](https://github.com/axios/axios/issues/124)) +- Fixing network errors not rejecting ([#205](https://github.com/axios/axios/pull/205)) +- Fixing issue with IE rejecting on HTTP 204 ([#201](https://github.com/axios/axios/issues/201)) +- Fixing host/port when following redirects ([#198](https://github.com/axios/axios/pull/198)) + +### 0.9.0 (Jan 18, 2016) + +- Adding support for custom adapters +- Fixing Content-Type header being removed when data is false ([#195](https://github.com/axios/axios/pull/195)) +- Improving XDomainRequest implementation ([#185](https://github.com/axios/axios/pull/185)) +- Improving config merging and order of precedence ([#183](https://github.com/axios/axios/pull/183)) +- Fixing XDomainRequest support for only <= IE9 ([#182](https://github.com/axios/axios/pull/182)) + +### 0.8.1 (Dec 14, 2015) + +- Adding support for passing XSRF token for cross domain requests when using `withCredentials` ([#168](https://github.com/axios/axios/pull/168)) +- Fixing error with format of basic auth header ([#178](https://github.com/axios/axios/pull/173)) +- Fixing error with JSON payloads throwing `InvalidStateError` in some cases ([#174](https://github.com/axios/axios/pull/174)) + +### 0.8.0 (Dec 11, 2015) + +- Adding support for creating instances of axios ([#123](https://github.com/axios/axios/pull/123)) +- Fixing http adapter to use `Buffer` instead of `String` in case of `responseType === 'arraybuffer'` ([#128](https://github.com/axios/axios/pull/128)) +- Adding support for using custom parameter serializer with `paramsSerializer` option ([#121](https://github.com/axios/axios/pull/121)) +- Fixing issue in IE8 caused by `forEach` on `arguments` ([#127](https://github.com/axios/axios/pull/127)) +- Adding support for following redirects in node ([#146](https://github.com/axios/axios/pull/146)) +- Adding support for transparent decompression if `content-encoding` is set ([#149](https://github.com/axios/axios/pull/149)) +- Adding support for transparent XDomainRequest to handle cross domain requests in IE9 ([#140](https://github.com/axios/axios/pull/140)) +- Adding support for HTTP basic auth via Authorization header ([#167](https://github.com/axios/axios/pull/167)) +- Adding support for baseURL option ([#160](https://github.com/axios/axios/pull/160)) + +### 0.7.0 (Sep 29, 2015) + +- Fixing issue with minified bundle in IE8 ([#87](https://github.com/axios/axios/pull/87)) +- Adding support for passing agent in node ([#102](https://github.com/axios/axios/pull/102)) +- Adding support for returning result from `axios.spread` for chaining ([#106](https://github.com/axios/axios/pull/106)) +- Fixing typescript definition ([#105](https://github.com/axios/axios/pull/105)) +- Fixing default timeout config for node ([#112](https://github.com/axios/axios/pull/112)) +- Adding support for use in web workers, and react-native ([#70](https://github.com/axios/axios/issue/70)), ([#98](https://github.com/axios/axios/pull/98)) +- Adding support for fetch like API `axios(url[, config])` ([#116](https://github.com/axios/axios/issues/116)) + +### 0.6.0 (Sep 21, 2015) + +- Removing deprecated success/error aliases +- Fixing issue with array params not being properly encoded ([#49](https://github.com/axios/axios/pull/49)) +- Fixing issue with User-Agent getting overridden ([#69](https://github.com/axios/axios/issues/69)) +- Adding support for timeout config ([#56](https://github.com/axios/axios/issues/56)) +- Removing es6-promise dependency +- Fixing issue preventing `length` to be used as a parameter ([#91](https://github.com/axios/axios/pull/91)) +- Fixing issue with IE8 ([#85](https://github.com/axios/axios/pull/85)) +- Converting build to UMD + +### 0.5.4 (Apr 08, 2015) + +- Fixing issue with FormData not being sent ([#53](https://github.com/axios/axios/issues/53)) + +### 0.5.3 (Apr 07, 2015) + +- Using JSON.parse unconditionally when transforming response string ([#55](https://github.com/axios/axios/issues/55)) + +### 0.5.2 (Mar 13, 2015) + +- Adding support for `statusText` in response ([#46](https://github.com/axios/axios/issues/46)) + +### 0.5.1 (Mar 10, 2015) + +- Fixing issue using strict mode ([#45](https://github.com/axios/axios/issues/45)) +- Fixing issue with standalone build ([#47](https://github.com/axios/axios/issues/47)) + +### 0.5.0 (Jan 23, 2015) + +- Adding support for intercepetors ([#14](https://github.com/axios/axios/issues/14)) +- Updating es6-promise dependency + +### 0.4.2 (Dec 10, 2014) + +- Fixing issue with `Content-Type` when using `FormData` ([#22](https://github.com/axios/axios/issues/22)) +- Adding support for TypeScript ([#25](https://github.com/axios/axios/issues/25)) +- Fixing issue with standalone build ([#29](https://github.com/axios/axios/issues/29)) +- Fixing issue with verbs needing to be capitalized in some browsers ([#30](https://github.com/axios/axios/issues/30)) + +### 0.4.1 (Oct 15, 2014) + +- Adding error handling to request for node.js ([#18](https://github.com/axios/axios/issues/18)) + +### 0.4.0 (Oct 03, 2014) + +- Adding support for `ArrayBuffer` and `ArrayBufferView` ([#10](https://github.com/axios/axios/issues/10)) +- Adding support for utf-8 for node.js ([#13](https://github.com/axios/axios/issues/13)) +- Adding support for SSL for node.js ([#12](https://github.com/axios/axios/issues/12)) +- Fixing incorrect `Content-Type` header ([#9](https://github.com/axios/axios/issues/9)) +- Adding standalone build without bundled es6-promise ([#11](https://github.com/axios/axios/issues/11)) +- Deprecating `success`/`error` in favor of `then`/`catch` + +### 0.3.1 (Sep 16, 2014) + +- Fixing missing post body when using node.js ([#3](https://github.com/axios/axios/issues/3)) + +### 0.3.0 (Sep 16, 2014) + +- Fixing `success` and `error` to properly receive response data as individual arguments ([#8](https://github.com/axios/axios/issues/8)) +- Updating `then` and `catch` to receive response data as a single object ([#6](https://github.com/axios/axios/issues/6)) +- Fixing issue with `all` not working ([#7](https://github.com/axios/axios/issues/7)) + +### 0.2.2 (Sep 14, 2014) + +- Fixing bundling with browserify ([#4](https://github.com/axios/axios/issues/4)) + +### 0.2.1 (Sep 12, 2014) + +- Fixing build problem causing ridiculous file sizes + +### 0.2.0 (Sep 12, 2014) + +- Adding support for `all` and `spread` +- Adding support for node.js ([#1](https://github.com/axios/axios/issues/1)) + +### 0.1.0 (Aug 29, 2014) + +- Initial release diff --git a/node_modules/xfarr-api/node_modules/axios/LICENSE b/node_modules/xfarr-api/node_modules/axios/LICENSE new file mode 100644 index 000000000..d36c80ef2 --- /dev/null +++ b/node_modules/xfarr-api/node_modules/axios/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2014-present Matt Zabriskie + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/xfarr-api/node_modules/axios/README.md b/node_modules/xfarr-api/node_modules/axios/README.md new file mode 100644 index 000000000..b8c019a78 --- /dev/null +++ b/node_modules/xfarr-api/node_modules/axios/README.md @@ -0,0 +1,868 @@ +# axios + +[![npm version](https://img.shields.io/npm/v/axios.svg?style=flat-square)](https://www.npmjs.org/package/axios) +[![CDNJS](https://img.shields.io/cdnjs/v/axios.svg?style=flat-square)](https://cdnjs.com/libraries/axios) +![Build status](https://github.com/axios/axios/actions/workflows/ci.yml/badge.svg) +[![Gitpod Ready-to-Code](https://img.shields.io/badge/Gitpod-Ready--to--Code-blue?logo=gitpod)](https://gitpod.io/#https://github.com/axios/axios) +[![code coverage](https://img.shields.io/coveralls/mzabriskie/axios.svg?style=flat-square)](https://coveralls.io/r/mzabriskie/axios) +[![install size](https://packagephobia.now.sh/badge?p=axios)](https://packagephobia.now.sh/result?p=axios) +[![npm downloads](https://img.shields.io/npm/dm/axios.svg?style=flat-square)](http://npm-stat.com/charts.html?package=axios) +[![gitter chat](https://img.shields.io/gitter/room/mzabriskie/axios.svg?style=flat-square)](https://gitter.im/mzabriskie/axios) +[![code helpers](https://www.codetriage.com/axios/axios/badges/users.svg)](https://www.codetriage.com/axios/axios) + +Promise based HTTP client for the browser and node.js + +> New axios docs website: [click here](https://axios-http.com/) + +## Table of Contents + + - [Features](#features) + - [Browser Support](#browser-support) + - [Installing](#installing) + - [Example](#example) + - [Axios API](#axios-api) + - [Request method aliases](#request-method-aliases) + - [Concurrency (Deprecated)](#concurrency-deprecated) + - [Creating an instance](#creating-an-instance) + - [Instance methods](#instance-methods) + - [Request Config](#request-config) + - [Response Schema](#response-schema) + - [Config Defaults](#config-defaults) + - [Global axios defaults](#global-axios-defaults) + - [Custom instance defaults](#custom-instance-defaults) + - [Config order of precedence](#config-order-of-precedence) + - [Interceptors](#interceptors) + - [Handling Errors](#handling-errors) + - [Cancellation](#cancellation) + - [Using application/x-www-form-urlencoded format](#using-applicationx-www-form-urlencoded-format) + - [Browser](#browser) + - [Node.js](#nodejs) + - [Query string](#query-string) + - [Form data](#form-data) + - [Semver](#semver) + - [Promises](#promises) + - [TypeScript](#typescript) + - [Resources](#resources) + - [Credits](#credits) + - [License](#license) + +## Features + +- Make [XMLHttpRequests](https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest) from the browser +- Make [http](http://nodejs.org/api/http.html) requests from node.js +- Supports the [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) API +- Intercept request and response +- Transform request and response data +- Cancel requests +- Automatic transforms for JSON data +- Client side support for protecting against [XSRF](http://en.wikipedia.org/wiki/Cross-site_request_forgery) + +## Browser Support + +![Chrome](https://raw.github.com/alrra/browser-logos/master/src/chrome/chrome_48x48.png) | ![Firefox](https://raw.github.com/alrra/browser-logos/master/src/firefox/firefox_48x48.png) | ![Safari](https://raw.github.com/alrra/browser-logos/master/src/safari/safari_48x48.png) | ![Opera](https://raw.github.com/alrra/browser-logos/master/src/opera/opera_48x48.png) | ![Edge](https://raw.github.com/alrra/browser-logos/master/src/edge/edge_48x48.png) | ![IE](https://raw.github.com/alrra/browser-logos/master/src/archive/internet-explorer_9-11/internet-explorer_9-11_48x48.png) | +--- | --- | --- | --- | --- | --- | +Latest ✔ | Latest ✔ | Latest ✔ | Latest ✔ | Latest ✔ | 11 ✔ | + +[![Browser Matrix](https://saucelabs.com/open_sauce/build_matrix/axios.svg)](https://saucelabs.com/u/axios) + +## Installing + +Using npm: + +```bash +$ npm install axios +``` + +Using bower: + +```bash +$ bower install axios +``` + +Using yarn: + +```bash +$ yarn add axios +``` + +Using jsDelivr CDN: + +```html + +``` + +Using unpkg CDN: + +```html + +``` + +## Example + +### note: CommonJS usage +In order to gain the TypeScript typings (for intellisense / autocomplete) while using CommonJS imports with `require()` use the following approach: + +```js +const axios = require('axios').default; + +// axios. will now provide autocomplete and parameter typings +``` + +Performing a `GET` request + +```js +const axios = require('axios'); + +// Make a request for a user with a given ID +axios.get('/user?ID=12345') + .then(function (response) { + // handle success + console.log(response); + }) + .catch(function (error) { + // handle error + console.log(error); + }) + .then(function () { + // always executed + }); + +// Optionally the request above could also be done as +axios.get('/user', { + params: { + ID: 12345 + } + }) + .then(function (response) { + console.log(response); + }) + .catch(function (error) { + console.log(error); + }) + .then(function () { + // always executed + }); + +// Want to use async/await? Add the `async` keyword to your outer function/method. +async function getUser() { + try { + const response = await axios.get('/user?ID=12345'); + console.log(response); + } catch (error) { + console.error(error); + } +} +``` + +> **NOTE:** `async/await` is part of ECMAScript 2017 and is not supported in Internet +> Explorer and older browsers, so use with caution. + +Performing a `POST` request + +```js +axios.post('/user', { + firstName: 'Fred', + lastName: 'Flintstone' + }) + .then(function (response) { + console.log(response); + }) + .catch(function (error) { + console.log(error); + }); +``` + +Performing multiple concurrent requests + +```js +function getUserAccount() { + return axios.get('/user/12345'); +} + +function getUserPermissions() { + return axios.get('/user/12345/permissions'); +} + +Promise.all([getUserAccount(), getUserPermissions()]) + .then(function (results) { + const acct = results[0]; + const perm = results[1]; + }); +``` + +## axios API + +Requests can be made by passing the relevant config to `axios`. + +##### axios(config) + +```js +// Send a POST request +axios({ + method: 'post', + url: '/user/12345', + data: { + firstName: 'Fred', + lastName: 'Flintstone' + } +}); +``` + +```js +// GET request for remote image in node.js +axios({ + method: 'get', + url: 'http://bit.ly/2mTM3nY', + responseType: 'stream' +}) + .then(function (response) { + response.data.pipe(fs.createWriteStream('ada_lovelace.jpg')) + }); +``` + +##### axios(url[, config]) + +```js +// Send a GET request (default method) +axios('/user/12345'); +``` + +### Request method aliases + +For convenience aliases have been provided for all supported request methods. + +##### axios.request(config) +##### axios.get(url[, config]) +##### axios.delete(url[, config]) +##### axios.head(url[, config]) +##### axios.options(url[, config]) +##### axios.post(url[, data[, config]]) +##### axios.put(url[, data[, config]]) +##### axios.patch(url[, data[, config]]) + +###### NOTE +When using the alias methods `url`, `method`, and `data` properties don't need to be specified in config. + +### Concurrency (Deprecated) +Please use `Promise.all` to replace the below functions. + +Helper functions for dealing with concurrent requests. + +axios.all(iterable) +axios.spread(callback) + +### Creating an instance + +You can create a new instance of axios with a custom config. + +##### axios.create([config]) + +```js +const instance = axios.create({ + baseURL: 'https://some-domain.com/api/', + timeout: 1000, + headers: {'X-Custom-Header': 'foobar'} +}); +``` + +### Instance methods + +The available instance methods are listed below. The specified config will be merged with the instance config. + +##### axios#request(config) +##### axios#get(url[, config]) +##### axios#delete(url[, config]) +##### axios#head(url[, config]) +##### axios#options(url[, config]) +##### axios#post(url[, data[, config]]) +##### axios#put(url[, data[, config]]) +##### axios#patch(url[, data[, config]]) +##### axios#getUri([config]) + +## Request Config + +These are the available config options for making requests. Only the `url` is required. Requests will default to `GET` if `method` is not specified. + +```js +{ + // `url` is the server URL that will be used for the request + url: '/user', + + // `method` is the request method to be used when making the request + method: 'get', // default + + // `baseURL` will be prepended to `url` unless `url` is absolute. + // It can be convenient to set `baseURL` for an instance of axios to pass relative URLs + // to methods of that instance. + baseURL: 'https://some-domain.com/api/', + + // `transformRequest` allows changes to the request data before it is sent to the server + // This is only applicable for request methods 'PUT', 'POST', 'PATCH' and 'DELETE' + // The last function in the array must return a string or an instance of Buffer, ArrayBuffer, + // FormData or Stream + // You may modify the headers object. + transformRequest: [function (data, headers) { + // Do whatever you want to transform the data + + return data; + }], + + // `transformResponse` allows changes to the response data to be made before + // it is passed to then/catch + transformResponse: [function (data) { + // Do whatever you want to transform the data + + return data; + }], + + // `headers` are custom headers to be sent + headers: {'X-Requested-With': 'XMLHttpRequest'}, + + // `params` are the URL parameters to be sent with the request + // Must be a plain object or a URLSearchParams object + params: { + ID: 12345 + }, + + // `paramsSerializer` is an optional function in charge of serializing `params` + // (e.g. https://www.npmjs.com/package/qs, http://api.jquery.com/jquery.param/) + paramsSerializer: function (params) { + return Qs.stringify(params, {arrayFormat: 'brackets'}) + }, + + // `data` is the data to be sent as the request body + // Only applicable for request methods 'PUT', 'POST', 'DELETE , and 'PATCH' + // When no `transformRequest` is set, must be of one of the following types: + // - string, plain object, ArrayBuffer, ArrayBufferView, URLSearchParams + // - Browser only: FormData, File, Blob + // - Node only: Stream, Buffer + data: { + firstName: 'Fred' + }, + + // syntax alternative to send data into the body + // method post + // only the value is sent, not the key + data: 'Country=Brasil&City=Belo Horizonte', + + // `timeout` specifies the number of milliseconds before the request times out. + // If the request takes longer than `timeout`, the request will be aborted. + timeout: 1000, // default is `0` (no timeout) + + // `withCredentials` indicates whether or not cross-site Access-Control requests + // should be made using credentials + withCredentials: false, // default + + // `adapter` allows custom handling of requests which makes testing easier. + // Return a promise and supply a valid response (see lib/adapters/README.md). + adapter: function (config) { + /* ... */ + }, + + // `auth` indicates that HTTP Basic auth should be used, and supplies credentials. + // This will set an `Authorization` header, overwriting any existing + // `Authorization` custom headers you have set using `headers`. + // Please note that only HTTP Basic auth is configurable through this parameter. + // For Bearer tokens and such, use `Authorization` custom headers instead. + auth: { + username: 'janedoe', + password: 's00pers3cret' + }, + + // `responseType` indicates the type of data that the server will respond with + // options are: 'arraybuffer', 'document', 'json', 'text', 'stream' + // browser only: 'blob' + responseType: 'json', // default + + // `responseEncoding` indicates encoding to use for decoding responses (Node.js only) + // Note: Ignored for `responseType` of 'stream' or client-side requests + responseEncoding: 'utf8', // default + + // `xsrfCookieName` is the name of the cookie to use as a value for xsrf token + xsrfCookieName: 'XSRF-TOKEN', // default + + // `xsrfHeaderName` is the name of the http header that carries the xsrf token value + xsrfHeaderName: 'X-XSRF-TOKEN', // default + + // `onUploadProgress` allows handling of progress events for uploads + // browser only + onUploadProgress: function (progressEvent) { + // Do whatever you want with the native progress event + }, + + // `onDownloadProgress` allows handling of progress events for downloads + // browser only + onDownloadProgress: function (progressEvent) { + // Do whatever you want with the native progress event + }, + + // `maxContentLength` defines the max size of the http response content in bytes allowed in node.js + maxContentLength: 2000, + + // `maxBodyLength` (Node only option) defines the max size of the http request content in bytes allowed + maxBodyLength: 2000, + + // `validateStatus` defines whether to resolve or reject the promise for a given + // HTTP response status code. If `validateStatus` returns `true` (or is set to `null` + // or `undefined`), the promise will be resolved; otherwise, the promise will be + // rejected. + validateStatus: function (status) { + return status >= 200 && status < 300; // default + }, + + // `maxRedirects` defines the maximum number of redirects to follow in node.js. + // If set to 0, no redirects will be followed. + maxRedirects: 5, // default + + // `socketPath` defines a UNIX Socket to be used in node.js. + // e.g. '/var/run/docker.sock' to send requests to the docker daemon. + // Only either `socketPath` or `proxy` can be specified. + // If both are specified, `socketPath` is used. + socketPath: null, // default + + // `httpAgent` and `httpsAgent` define a custom agent to be used when performing http + // and https requests, respectively, in node.js. This allows options to be added like + // `keepAlive` that are not enabled by default. + httpAgent: new http.Agent({ keepAlive: true }), + httpsAgent: new https.Agent({ keepAlive: true }), + + // `proxy` defines the hostname, port, and protocol of the proxy server. + // You can also define your proxy using the conventional `http_proxy` and + // `https_proxy` environment variables. If you are using environment variables + // for your proxy configuration, you can also define a `no_proxy` environment + // variable as a comma-separated list of domains that should not be proxied. + // Use `false` to disable proxies, ignoring environment variables. + // `auth` indicates that HTTP Basic auth should be used to connect to the proxy, and + // supplies credentials. + // This will set an `Proxy-Authorization` header, overwriting any existing + // `Proxy-Authorization` custom headers you have set using `headers`. + // If the proxy server uses HTTPS, then you must set the protocol to `https`. + proxy: { + protocol: 'https', + host: '127.0.0.1', + port: 9000, + auth: { + username: 'mikeymike', + password: 'rapunz3l' + } + }, + + // `cancelToken` specifies a cancel token that can be used to cancel the request + // (see Cancellation section below for details) + cancelToken: new CancelToken(function (cancel) { + }), + + // `decompress` indicates whether or not the response body should be decompressed + // automatically. If set to `true` will also remove the 'content-encoding' header + // from the responses objects of all decompressed responses + // - Node only (XHR cannot turn off decompression) + decompress: true, // default + + // transitional options for backward compatibility that may be removed in the newer versions + transitional: { + // silent JSON parsing mode + // `true` - ignore JSON parsing errors and set response.data to null if parsing failed (old behaviour) + // `false` - throw SyntaxError if JSON parsing failed (Note: responseType must be set to 'json') + silentJSONParsing: true, // default value for the current Axios version + + // try to parse the response string as JSON even if `responseType` is not 'json' + forcedJSONParsing: true, + + // throw ETIMEDOUT error instead of generic ECONNABORTED on request timeouts + clarifyTimeoutError: false, + } +} +``` + +## Response Schema + +The response for a request contains the following information. + +```js +{ + // `data` is the response that was provided by the server + data: {}, + + // `status` is the HTTP status code from the server response + status: 200, + + // `statusText` is the HTTP status message from the server response + statusText: 'OK', + + // `headers` the HTTP headers that the server responded with + // All header names are lower cased and can be accessed using the bracket notation. + // Example: `response.headers['content-type']` + headers: {}, + + // `config` is the config that was provided to `axios` for the request + config: {}, + + // `request` is the request that generated this response + // It is the last ClientRequest instance in node.js (in redirects) + // and an XMLHttpRequest instance in the browser + request: {} +} +``` + +When using `then`, you will receive the response as follows: + +```js +axios.get('/user/12345') + .then(function (response) { + console.log(response.data); + console.log(response.status); + console.log(response.statusText); + console.log(response.headers); + console.log(response.config); + }); +``` + +When using `catch`, or passing a [rejection callback](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/then) as second parameter of `then`, the response will be available through the `error` object as explained in the [Handling Errors](#handling-errors) section. + +## Config Defaults + +You can specify config defaults that will be applied to every request. + +### Global axios defaults + +```js +axios.defaults.baseURL = 'https://api.example.com'; + +// Important: If axios is used with multiple domains, the AUTH_TOKEN will be sent to all of them. +// See below for an example using Custom instance defaults instead. +axios.defaults.headers.common['Authorization'] = AUTH_TOKEN; + +axios.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded'; +``` + +### Custom instance defaults + +```js +// Set config defaults when creating the instance +const instance = axios.create({ + baseURL: 'https://api.example.com' +}); + +// Alter defaults after instance has been created +instance.defaults.headers.common['Authorization'] = AUTH_TOKEN; +``` + +### Config order of precedence + +Config will be merged with an order of precedence. The order is library defaults found in [lib/defaults.js](https://github.com/axios/axios/blob/master/lib/defaults.js#L28), then `defaults` property of the instance, and finally `config` argument for the request. The latter will take precedence over the former. Here's an example. + +```js +// Create an instance using the config defaults provided by the library +// At this point the timeout config value is `0` as is the default for the library +const instance = axios.create(); + +// Override timeout default for the library +// Now all requests using this instance will wait 2.5 seconds before timing out +instance.defaults.timeout = 2500; + +// Override timeout for this request as it's known to take a long time +instance.get('/longRequest', { + timeout: 5000 +}); +``` + +## Interceptors + +You can intercept requests or responses before they are handled by `then` or `catch`. + +```js +// Add a request interceptor +axios.interceptors.request.use(function (config) { + // Do something before request is sent + return config; + }, function (error) { + // Do something with request error + return Promise.reject(error); + }); + +// Add a response interceptor +axios.interceptors.response.use(function (response) { + // Any status code that lie within the range of 2xx cause this function to trigger + // Do something with response data + return response; + }, function (error) { + // Any status codes that falls outside the range of 2xx cause this function to trigger + // Do something with response error + return Promise.reject(error); + }); +``` + +If you need to remove an interceptor later you can. + +```js +const myInterceptor = axios.interceptors.request.use(function () {/*...*/}); +axios.interceptors.request.eject(myInterceptor); +``` + +You can add interceptors to a custom instance of axios. + +```js +const instance = axios.create(); +instance.interceptors.request.use(function () {/*...*/}); +``` + +When you add request interceptors, they are presumed to be asynchronous by default. This can cause a delay +in the execution of your axios request when the main thread is blocked (a promise is created under the hood for +the interceptor and your request gets put on the bottom of the call stack). If your request interceptors are synchronous you can add a flag +to the options object that will tell axios to run the code synchronously and avoid any delays in request execution. + +```js +axios.interceptors.request.use(function (config) { + config.headers.test = 'I am only a header!'; + return config; +}, null, { synchronous: true }); +``` + +If you want to execute a particular interceptor based on a runtime check, +you can add a `runWhen` function to the options object. The interceptor will not be executed **if and only if** the return +of `runWhen` is `false`. The function will be called with the config +object (don't forget that you can bind your own arguments to it as well.) This can be handy when you have an +asynchronous request interceptor that only needs to run at certain times. + +```js +function onGetCall(config) { + return config.method === 'get'; +} +axios.interceptors.request.use(function (config) { + config.headers.test = 'special get headers'; + return config; +}, null, { runWhen: onGetCall }); +``` + +## Handling Errors + +```js +axios.get('/user/12345') + .catch(function (error) { + if (error.response) { + // The request was made and the server responded with a status code + // that falls out of the range of 2xx + console.log(error.response.data); + console.log(error.response.status); + console.log(error.response.headers); + } else if (error.request) { + // The request was made but no response was received + // `error.request` is an instance of XMLHttpRequest in the browser and an instance of + // http.ClientRequest in node.js + console.log(error.request); + } else { + // Something happened in setting up the request that triggered an Error + console.log('Error', error.message); + } + console.log(error.config); + }); +``` + +Using the `validateStatus` config option, you can define HTTP code(s) that should throw an error. + +```js +axios.get('/user/12345', { + validateStatus: function (status) { + return status < 500; // Resolve only if the status code is less than 500 + } +}) +``` + +Using `toJSON` you get an object with more information about the HTTP error. + +```js +axios.get('/user/12345') + .catch(function (error) { + console.log(error.toJSON()); + }); +``` + +## Cancellation + +You can cancel a request using a *cancel token*. + +> The axios cancel token API is based on the withdrawn [cancelable promises proposal](https://github.com/tc39/proposal-cancelable-promises). + +You can create a cancel token using the `CancelToken.source` factory as shown below: + +```js +const CancelToken = axios.CancelToken; +const source = CancelToken.source(); + +axios.get('/user/12345', { + cancelToken: source.token +}).catch(function (thrown) { + if (axios.isCancel(thrown)) { + console.log('Request canceled', thrown.message); + } else { + // handle error + } +}); + +axios.post('/user/12345', { + name: 'new name' +}, { + cancelToken: source.token +}) + +// cancel the request (the message parameter is optional) +source.cancel('Operation canceled by the user.'); +``` + +You can also create a cancel token by passing an executor function to the `CancelToken` constructor: + +```js +const CancelToken = axios.CancelToken; +let cancel; + +axios.get('/user/12345', { + cancelToken: new CancelToken(function executor(c) { + // An executor function receives a cancel function as a parameter + cancel = c; + }) +}); + +// cancel the request +cancel(); +``` + +> Note: you can cancel several requests with the same cancel token. +> If a cancellation token is already cancelled at the moment of starting an Axios request, then the request is cancelled immediately, without any attempts to make real request. + +## Using application/x-www-form-urlencoded format + +By default, axios serializes JavaScript objects to `JSON`. To send data in the `application/x-www-form-urlencoded` format instead, you can use one of the following options. + +### Browser + +In a browser, you can use the [`URLSearchParams`](https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams) API as follows: + +```js +const params = new URLSearchParams(); +params.append('param1', 'value1'); +params.append('param2', 'value2'); +axios.post('/foo', params); +``` + +> Note that `URLSearchParams` is not supported by all browsers (see [caniuse.com](http://www.caniuse.com/#feat=urlsearchparams)), but there is a [polyfill](https://github.com/WebReflection/url-search-params) available (make sure to polyfill the global environment). + +Alternatively, you can encode data using the [`qs`](https://github.com/ljharb/qs) library: + +```js +const qs = require('qs'); +axios.post('/foo', qs.stringify({ 'bar': 123 })); +``` + +Or in another way (ES6), + +```js +import qs from 'qs'; +const data = { 'bar': 123 }; +const options = { + method: 'POST', + headers: { 'content-type': 'application/x-www-form-urlencoded' }, + data: qs.stringify(data), + url, +}; +axios(options); +``` + +### Node.js + +#### Query string + +In node.js, you can use the [`querystring`](https://nodejs.org/api/querystring.html) module as follows: + +```js +const querystring = require('querystring'); +axios.post('http://something.com/', querystring.stringify({ foo: 'bar' })); +``` + +or ['URLSearchParams'](https://nodejs.org/api/url.html#url_class_urlsearchparams) from ['url module'](https://nodejs.org/api/url.html) as follows: + +```js +const url = require('url'); +const params = new url.URLSearchParams({ foo: 'bar' }); +axios.post('http://something.com/', params.toString()); +``` + +You can also use the [`qs`](https://github.com/ljharb/qs) library. + +###### NOTE +The `qs` library is preferable if you need to stringify nested objects, as the `querystring` method has known issues with that use case (https://github.com/nodejs/node-v0.x-archive/issues/1665). + +#### Form data + +In node.js, you can use the [`form-data`](https://github.com/form-data/form-data) library as follows: + +```js +const FormData = require('form-data'); + +const form = new FormData(); +form.append('my_field', 'my value'); +form.append('my_buffer', new Buffer(10)); +form.append('my_file', fs.createReadStream('/foo/bar.jpg')); + +axios.post('https://example.com', form, { headers: form.getHeaders() }) +``` + +Alternatively, use an interceptor: + +```js +axios.interceptors.request.use(config => { + if (config.data instanceof FormData) { + Object.assign(config.headers, config.data.getHeaders()); + } + return config; +}); +``` + +## Semver + +Until axios reaches a `1.0` release, breaking changes will be released with a new minor version. For example `0.5.1`, and `0.5.4` will have the same API, but `0.6.0` will have breaking changes. + +## Promises + +axios depends on a native ES6 Promise implementation to be [supported](http://caniuse.com/promises). +If your environment doesn't support ES6 Promises, you can [polyfill](https://github.com/jakearchibald/es6-promise). + +## TypeScript + +axios includes [TypeScript](http://typescriptlang.org) definitions and a type guard for axios errors. + +```typescript +let user: User = null; +try { + const { data } = await axios.get('/user?ID=12345'); + user = data.userDetails; +} catch (error) { + if (axios.isAxiosError(error)) { + handleAxiosError(error); + } else { + handleUnexpectedError(error); + } +} +``` + +## Online one-click setup + +You can use Gitpod an online IDE(which is free for Open Source) for contributing or running the examples online. + +[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/axios/axios/blob/master/examples/server.js) + + +## Resources + +* [Changelog](https://github.com/axios/axios/blob/master/CHANGELOG.md) +* [Upgrade Guide](https://github.com/axios/axios/blob/master/UPGRADE_GUIDE.md) +* [Ecosystem](https://github.com/axios/axios/blob/master/ECOSYSTEM.md) +* [Contributing Guide](https://github.com/axios/axios/blob/master/CONTRIBUTING.md) +* [Code of Conduct](https://github.com/axios/axios/blob/master/CODE_OF_CONDUCT.md) + +## Credits + +axios is heavily inspired by the [$http service](https://docs.angularjs.org/api/ng/service/$http) provided in [Angular](https://angularjs.org/). Ultimately axios is an effort to provide a standalone `$http`-like service for use outside of Angular. + +## License + +[MIT](LICENSE) diff --git a/node_modules/xfarr-api/node_modules/axios/SECURITY.md b/node_modules/xfarr-api/node_modules/axios/SECURITY.md new file mode 100644 index 000000000..353df9a2f --- /dev/null +++ b/node_modules/xfarr-api/node_modules/axios/SECURITY.md @@ -0,0 +1,5 @@ +# Security Policy + +## Reporting a Vulnerability + +Please report security issues to jasonsaayman@gmail.com diff --git a/node_modules/xfarr-api/node_modules/axios/UPGRADE_GUIDE.md b/node_modules/xfarr-api/node_modules/axios/UPGRADE_GUIDE.md new file mode 100644 index 000000000..745e80492 --- /dev/null +++ b/node_modules/xfarr-api/node_modules/axios/UPGRADE_GUIDE.md @@ -0,0 +1,162 @@ +# Upgrade Guide + +### 0.15.x -> 0.16.0 + +#### `Promise` Type Declarations + +The `Promise` type declarations have been removed from the axios typings in favor of the built-in type declarations. If you use axios in a TypeScript project that targets `ES5`, please make sure to include the `es2015.promise` lib. Please see [this post](https://blog.mariusschulz.com/2016/11/25/typescript-2-0-built-in-type-declarations) for details. + +### 0.13.x -> 0.14.0 + +#### TypeScript Definitions + +The axios TypeScript definitions have been updated to match the axios API and use the ES2015 module syntax. + +Please use the following `import` statement to import axios in TypeScript: + +```typescript +import axios from 'axios'; + +axios.get('/foo') + .then(response => console.log(response)) + .catch(error => console.log(error)); +``` + +#### `agent` Config Option + +The `agent` config option has been replaced with two new options: `httpAgent` and `httpsAgent`. Please use them instead. + +```js +{ + // Define a custom agent for HTTP + httpAgent: new http.Agent({ keepAlive: true }), + // Define a custom agent for HTTPS + httpsAgent: new https.Agent({ keepAlive: true }) +} +``` + +#### `progress` Config Option + +The `progress` config option has been replaced with the `onUploadProgress` and `onDownloadProgress` options. + +```js +{ + // Define a handler for upload progress events + onUploadProgress: function (progressEvent) { + // ... + }, + + // Define a handler for download progress events + onDownloadProgress: function (progressEvent) { + // ... + } +} +``` + +### 0.12.x -> 0.13.0 + +The `0.13.0` release contains several changes to custom adapters and error handling. + +#### Error Handling + +Previous to this release an error could either be a server response with bad status code or an actual `Error`. With this release Promise will always reject with an `Error`. In the case that a response was received, the `Error` will also include the response. + +```js +axios.get('/user/12345') + .catch((error) => { + console.log(error.message); + console.log(error.code); // Not always specified + console.log(error.config); // The config that was used to make the request + console.log(error.response); // Only available if response was received from the server + }); +``` + +#### Request Adapters + +This release changes a few things about how request adapters work. Please take note if you are using your own custom adapter. + +1. Response transformer is now called outside of adapter. +2. Request adapter returns a `Promise`. + +This means that you no longer need to invoke `transformData` on response data. You will also no longer receive `resolve` and `reject` as arguments in your adapter. + +Previous code: + +```js +function myAdapter(resolve, reject, config) { + var response = { + data: transformData( + responseData, + responseHeaders, + config.transformResponse + ), + status: request.status, + statusText: request.statusText, + headers: responseHeaders + }; + settle(resolve, reject, response); +} +``` + +New code: + +```js +function myAdapter(config) { + return new Promise(function (resolve, reject) { + var response = { + data: responseData, + status: request.status, + statusText: request.statusText, + headers: responseHeaders + }; + settle(resolve, reject, response); + }); +} +``` + +See the related commits for more details: +- [Response transformers](https://github.com/axios/axios/commit/10eb23865101f9347570552c04e9d6211376e25e) +- [Request adapter Promise](https://github.com/axios/axios/commit/157efd5615890301824e3121cc6c9d2f9b21f94a) + +### 0.5.x -> 0.6.0 + +The `0.6.0` release contains mostly bug fixes, but there are a couple things to be aware of when upgrading. + +#### ES6 Promise Polyfill + +Up until the `0.6.0` release ES6 `Promise` was being polyfilled using [es6-promise](https://github.com/jakearchibald/es6-promise). With this release, the polyfill has been removed, and you will need to supply it yourself if your environment needs it. + +```js +require('es6-promise').polyfill(); +var axios = require('axios'); +``` + +This will polyfill the global environment, and only needs to be done once. + +#### `axios.success`/`axios.error` + +The `success`, and `error` aliases were deprecated in [0.4.0](https://github.com/axios/axios/blob/master/CHANGELOG.md#040-oct-03-2014). As of this release they have been removed entirely. Instead please use `axios.then`, and `axios.catch` respectively. + +```js +axios.get('some/url') + .then(function (res) { + /* ... */ + }) + .catch(function (err) { + /* ... */ + }); +``` + +#### UMD + +Previous versions of axios shipped with an AMD, CommonJS, and Global build. This has all been rolled into a single UMD build. + +```js +// AMD +require(['bower_components/axios/dist/axios'], function (axios) { + /* ... */ +}); + +// CommonJS +var axios = require('axios/dist/axios'); +``` diff --git a/node_modules/xfarr-api/node_modules/axios/dist/axios.js b/node_modules/xfarr-api/node_modules/axios/dist/axios.js new file mode 100644 index 000000000..f25391064 --- /dev/null +++ b/node_modules/xfarr-api/node_modules/axios/dist/axios.js @@ -0,0 +1,2193 @@ +/* axios v0.21.4 | (c) 2021 by Matt Zabriskie */ +(function webpackUniversalModuleDefinition(root, factory) { + if(typeof exports === 'object' && typeof module === 'object') + module.exports = factory(); + else if(typeof define === 'function' && define.amd) + define([], factory); + else if(typeof exports === 'object') + exports["axios"] = factory(); + else + root["axios"] = factory(); +})(window, function() { +return /******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) { +/******/ return installedModules[moduleId].exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ i: moduleId, +/******/ l: false, +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __webpack_require__.c = installedModules; +/******/ +/******/ // define getter function for harmony exports +/******/ __webpack_require__.d = function(exports, name, getter) { +/******/ if(!__webpack_require__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); +/******/ } +/******/ }; +/******/ +/******/ // define __esModule on exports +/******/ __webpack_require__.r = function(exports) { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ +/******/ // create a fake namespace object +/******/ // mode & 1: value is a module id, require it +/******/ // mode & 2: merge all properties of value into the ns +/******/ // mode & 4: return value when already ns object +/******/ // mode & 8|1: behave like require +/******/ __webpack_require__.t = function(value, mode) { +/******/ if(mode & 1) value = __webpack_require__(value); +/******/ if(mode & 8) return value; +/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; +/******/ var ns = Object.create(null); +/******/ __webpack_require__.r(ns); +/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); +/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); +/******/ return ns; +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __webpack_require__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __webpack_require__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = ""; +/******/ +/******/ +/******/ // Load entry module and return exports +/******/ return __webpack_require__(__webpack_require__.s = "./index.js"); +/******/ }) +/************************************************************************/ +/******/ ({ + +/***/ "./index.js": +/*!******************!*\ + !*** ./index.js ***! + \******************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +module.exports = __webpack_require__(/*! ./lib/axios */ "./lib/axios.js"); + +/***/ }), + +/***/ "./lib/adapters/xhr.js": +/*!*****************************!*\ + !*** ./lib/adapters/xhr.js ***! + \*****************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var utils = __webpack_require__(/*! ./../utils */ "./lib/utils.js"); +var settle = __webpack_require__(/*! ./../core/settle */ "./lib/core/settle.js"); +var cookies = __webpack_require__(/*! ./../helpers/cookies */ "./lib/helpers/cookies.js"); +var buildURL = __webpack_require__(/*! ./../helpers/buildURL */ "./lib/helpers/buildURL.js"); +var buildFullPath = __webpack_require__(/*! ../core/buildFullPath */ "./lib/core/buildFullPath.js"); +var parseHeaders = __webpack_require__(/*! ./../helpers/parseHeaders */ "./lib/helpers/parseHeaders.js"); +var isURLSameOrigin = __webpack_require__(/*! ./../helpers/isURLSameOrigin */ "./lib/helpers/isURLSameOrigin.js"); +var createError = __webpack_require__(/*! ../core/createError */ "./lib/core/createError.js"); + +module.exports = function xhrAdapter(config) { + return new Promise(function dispatchXhrRequest(resolve, reject) { + var requestData = config.data; + var requestHeaders = config.headers; + var responseType = config.responseType; + + if (utils.isFormData(requestData)) { + delete requestHeaders['Content-Type']; // Let the browser set it + } + + var request = new XMLHttpRequest(); + + // HTTP basic authentication + if (config.auth) { + var username = config.auth.username || ''; + var password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : ''; + requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password); + } + + var fullPath = buildFullPath(config.baseURL, config.url); + request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true); + + // Set the request timeout in MS + request.timeout = config.timeout; + + function onloadend() { + if (!request) { + return; + } + // Prepare the response + var responseHeaders = 'getAllResponseHeaders' in request ? parseHeaders(request.getAllResponseHeaders()) : null; + var responseData = !responseType || responseType === 'text' || responseType === 'json' ? + request.responseText : request.response; + var response = { + data: responseData, + status: request.status, + statusText: request.statusText, + headers: responseHeaders, + config: config, + request: request + }; + + settle(resolve, reject, response); + + // Clean up request + request = null; + } + + if ('onloadend' in request) { + // Use onloadend if available + request.onloadend = onloadend; + } else { + // Listen for ready state to emulate onloadend + request.onreadystatechange = function handleLoad() { + if (!request || request.readyState !== 4) { + return; + } + + // The request errored out and we didn't get a response, this will be + // handled by onerror instead + // With one exception: request that using file: protocol, most browsers + // will return status as 0 even though it's a successful request + if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) { + return; + } + // readystate handler is calling before onerror or ontimeout handlers, + // so we should call onloadend on the next 'tick' + setTimeout(onloadend); + }; + } + + // Handle browser request cancellation (as opposed to a manual cancellation) + request.onabort = function handleAbort() { + if (!request) { + return; + } + + reject(createError('Request aborted', config, 'ECONNABORTED', request)); + + // Clean up request + request = null; + }; + + // Handle low level network errors + request.onerror = function handleError() { + // Real errors are hidden from us by the browser + // onerror should only fire if it's a network error + reject(createError('Network Error', config, null, request)); + + // Clean up request + request = null; + }; + + // Handle timeout + request.ontimeout = function handleTimeout() { + var timeoutErrorMessage = 'timeout of ' + config.timeout + 'ms exceeded'; + if (config.timeoutErrorMessage) { + timeoutErrorMessage = config.timeoutErrorMessage; + } + reject(createError( + timeoutErrorMessage, + config, + config.transitional && config.transitional.clarifyTimeoutError ? 'ETIMEDOUT' : 'ECONNABORTED', + request)); + + // Clean up request + request = null; + }; + + // Add xsrf header + // This is only done if running in a standard browser environment. + // Specifically not if we're in a web worker, or react-native. + if (utils.isStandardBrowserEnv()) { + // Add xsrf header + var xsrfValue = (config.withCredentials || isURLSameOrigin(fullPath)) && config.xsrfCookieName ? + cookies.read(config.xsrfCookieName) : + undefined; + + if (xsrfValue) { + requestHeaders[config.xsrfHeaderName] = xsrfValue; + } + } + + // Add headers to the request + if ('setRequestHeader' in request) { + utils.forEach(requestHeaders, function setRequestHeader(val, key) { + if (typeof requestData === 'undefined' && key.toLowerCase() === 'content-type') { + // Remove Content-Type if data is undefined + delete requestHeaders[key]; + } else { + // Otherwise add header to the request + request.setRequestHeader(key, val); + } + }); + } + + // Add withCredentials to request if needed + if (!utils.isUndefined(config.withCredentials)) { + request.withCredentials = !!config.withCredentials; + } + + // Add responseType to request if needed + if (responseType && responseType !== 'json') { + request.responseType = config.responseType; + } + + // Handle progress if needed + if (typeof config.onDownloadProgress === 'function') { + request.addEventListener('progress', config.onDownloadProgress); + } + + // Not all browsers support upload events + if (typeof config.onUploadProgress === 'function' && request.upload) { + request.upload.addEventListener('progress', config.onUploadProgress); + } + + if (config.cancelToken) { + // Handle cancellation + config.cancelToken.promise.then(function onCanceled(cancel) { + if (!request) { + return; + } + + request.abort(); + reject(cancel); + // Clean up request + request = null; + }); + } + + if (!requestData) { + requestData = null; + } + + // Send the request + request.send(requestData); + }); +}; + + +/***/ }), + +/***/ "./lib/axios.js": +/*!**********************!*\ + !*** ./lib/axios.js ***! + \**********************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var utils = __webpack_require__(/*! ./utils */ "./lib/utils.js"); +var bind = __webpack_require__(/*! ./helpers/bind */ "./lib/helpers/bind.js"); +var Axios = __webpack_require__(/*! ./core/Axios */ "./lib/core/Axios.js"); +var mergeConfig = __webpack_require__(/*! ./core/mergeConfig */ "./lib/core/mergeConfig.js"); +var defaults = __webpack_require__(/*! ./defaults */ "./lib/defaults.js"); + +/** + * Create an instance of Axios + * + * @param {Object} defaultConfig The default config for the instance + * @return {Axios} A new instance of Axios + */ +function createInstance(defaultConfig) { + var context = new Axios(defaultConfig); + var instance = bind(Axios.prototype.request, context); + + // Copy axios.prototype to instance + utils.extend(instance, Axios.prototype, context); + + // Copy context to instance + utils.extend(instance, context); + + return instance; +} + +// Create the default instance to be exported +var axios = createInstance(defaults); + +// Expose Axios class to allow class inheritance +axios.Axios = Axios; + +// Factory for creating new instances +axios.create = function create(instanceConfig) { + return createInstance(mergeConfig(axios.defaults, instanceConfig)); +}; + +// Expose Cancel & CancelToken +axios.Cancel = __webpack_require__(/*! ./cancel/Cancel */ "./lib/cancel/Cancel.js"); +axios.CancelToken = __webpack_require__(/*! ./cancel/CancelToken */ "./lib/cancel/CancelToken.js"); +axios.isCancel = __webpack_require__(/*! ./cancel/isCancel */ "./lib/cancel/isCancel.js"); + +// Expose all/spread +axios.all = function all(promises) { + return Promise.all(promises); +}; +axios.spread = __webpack_require__(/*! ./helpers/spread */ "./lib/helpers/spread.js"); + +// Expose isAxiosError +axios.isAxiosError = __webpack_require__(/*! ./helpers/isAxiosError */ "./lib/helpers/isAxiosError.js"); + +module.exports = axios; + +// Allow use of default import syntax in TypeScript +module.exports.default = axios; + + +/***/ }), + +/***/ "./lib/cancel/Cancel.js": +/*!******************************!*\ + !*** ./lib/cancel/Cancel.js ***! + \******************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +/** + * A `Cancel` is an object that is thrown when an operation is canceled. + * + * @class + * @param {string=} message The message. + */ +function Cancel(message) { + this.message = message; +} + +Cancel.prototype.toString = function toString() { + return 'Cancel' + (this.message ? ': ' + this.message : ''); +}; + +Cancel.prototype.__CANCEL__ = true; + +module.exports = Cancel; + + +/***/ }), + +/***/ "./lib/cancel/CancelToken.js": +/*!***********************************!*\ + !*** ./lib/cancel/CancelToken.js ***! + \***********************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var Cancel = __webpack_require__(/*! ./Cancel */ "./lib/cancel/Cancel.js"); + +/** + * A `CancelToken` is an object that can be used to request cancellation of an operation. + * + * @class + * @param {Function} executor The executor function. + */ +function CancelToken(executor) { + if (typeof executor !== 'function') { + throw new TypeError('executor must be a function.'); + } + + var resolvePromise; + this.promise = new Promise(function promiseExecutor(resolve) { + resolvePromise = resolve; + }); + + var token = this; + executor(function cancel(message) { + if (token.reason) { + // Cancellation has already been requested + return; + } + + token.reason = new Cancel(message); + resolvePromise(token.reason); + }); +} + +/** + * Throws a `Cancel` if cancellation has been requested. + */ +CancelToken.prototype.throwIfRequested = function throwIfRequested() { + if (this.reason) { + throw this.reason; + } +}; + +/** + * Returns an object that contains a new `CancelToken` and a function that, when called, + * cancels the `CancelToken`. + */ +CancelToken.source = function source() { + var cancel; + var token = new CancelToken(function executor(c) { + cancel = c; + }); + return { + token: token, + cancel: cancel + }; +}; + +module.exports = CancelToken; + + +/***/ }), + +/***/ "./lib/cancel/isCancel.js": +/*!********************************!*\ + !*** ./lib/cancel/isCancel.js ***! + \********************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +module.exports = function isCancel(value) { + return !!(value && value.__CANCEL__); +}; + + +/***/ }), + +/***/ "./lib/core/Axios.js": +/*!***************************!*\ + !*** ./lib/core/Axios.js ***! + \***************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var utils = __webpack_require__(/*! ./../utils */ "./lib/utils.js"); +var buildURL = __webpack_require__(/*! ../helpers/buildURL */ "./lib/helpers/buildURL.js"); +var InterceptorManager = __webpack_require__(/*! ./InterceptorManager */ "./lib/core/InterceptorManager.js"); +var dispatchRequest = __webpack_require__(/*! ./dispatchRequest */ "./lib/core/dispatchRequest.js"); +var mergeConfig = __webpack_require__(/*! ./mergeConfig */ "./lib/core/mergeConfig.js"); +var validator = __webpack_require__(/*! ../helpers/validator */ "./lib/helpers/validator.js"); + +var validators = validator.validators; +/** + * Create a new instance of Axios + * + * @param {Object} instanceConfig The default config for the instance + */ +function Axios(instanceConfig) { + this.defaults = instanceConfig; + this.interceptors = { + request: new InterceptorManager(), + response: new InterceptorManager() + }; +} + +/** + * Dispatch a request + * + * @param {Object} config The config specific for this request (merged with this.defaults) + */ +Axios.prototype.request = function request(config) { + /*eslint no-param-reassign:0*/ + // Allow for axios('example/url'[, config]) a la fetch API + if (typeof config === 'string') { + config = arguments[1] || {}; + config.url = arguments[0]; + } else { + config = config || {}; + } + + config = mergeConfig(this.defaults, config); + + // Set config.method + if (config.method) { + config.method = config.method.toLowerCase(); + } else if (this.defaults.method) { + config.method = this.defaults.method.toLowerCase(); + } else { + config.method = 'get'; + } + + var transitional = config.transitional; + + if (transitional !== undefined) { + validator.assertOptions(transitional, { + silentJSONParsing: validators.transitional(validators.boolean, '1.0.0'), + forcedJSONParsing: validators.transitional(validators.boolean, '1.0.0'), + clarifyTimeoutError: validators.transitional(validators.boolean, '1.0.0') + }, false); + } + + // filter out skipped interceptors + var requestInterceptorChain = []; + var synchronousRequestInterceptors = true; + this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) { + if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) { + return; + } + + synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous; + + requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected); + }); + + var responseInterceptorChain = []; + this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) { + responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected); + }); + + var promise; + + if (!synchronousRequestInterceptors) { + var chain = [dispatchRequest, undefined]; + + Array.prototype.unshift.apply(chain, requestInterceptorChain); + chain = chain.concat(responseInterceptorChain); + + promise = Promise.resolve(config); + while (chain.length) { + promise = promise.then(chain.shift(), chain.shift()); + } + + return promise; + } + + + var newConfig = config; + while (requestInterceptorChain.length) { + var onFulfilled = requestInterceptorChain.shift(); + var onRejected = requestInterceptorChain.shift(); + try { + newConfig = onFulfilled(newConfig); + } catch (error) { + onRejected(error); + break; + } + } + + try { + promise = dispatchRequest(newConfig); + } catch (error) { + return Promise.reject(error); + } + + while (responseInterceptorChain.length) { + promise = promise.then(responseInterceptorChain.shift(), responseInterceptorChain.shift()); + } + + return promise; +}; + +Axios.prototype.getUri = function getUri(config) { + config = mergeConfig(this.defaults, config); + return buildURL(config.url, config.params, config.paramsSerializer).replace(/^\?/, ''); +}; + +// Provide aliases for supported request methods +utils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) { + /*eslint func-names:0*/ + Axios.prototype[method] = function(url, config) { + return this.request(mergeConfig(config || {}, { + method: method, + url: url, + data: (config || {}).data + })); + }; +}); + +utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) { + /*eslint func-names:0*/ + Axios.prototype[method] = function(url, data, config) { + return this.request(mergeConfig(config || {}, { + method: method, + url: url, + data: data + })); + }; +}); + +module.exports = Axios; + + +/***/ }), + +/***/ "./lib/core/InterceptorManager.js": +/*!****************************************!*\ + !*** ./lib/core/InterceptorManager.js ***! + \****************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var utils = __webpack_require__(/*! ./../utils */ "./lib/utils.js"); + +function InterceptorManager() { + this.handlers = []; +} + +/** + * Add a new interceptor to the stack + * + * @param {Function} fulfilled The function to handle `then` for a `Promise` + * @param {Function} rejected The function to handle `reject` for a `Promise` + * + * @return {Number} An ID used to remove interceptor later + */ +InterceptorManager.prototype.use = function use(fulfilled, rejected, options) { + this.handlers.push({ + fulfilled: fulfilled, + rejected: rejected, + synchronous: options ? options.synchronous : false, + runWhen: options ? options.runWhen : null + }); + return this.handlers.length - 1; +}; + +/** + * Remove an interceptor from the stack + * + * @param {Number} id The ID that was returned by `use` + */ +InterceptorManager.prototype.eject = function eject(id) { + if (this.handlers[id]) { + this.handlers[id] = null; + } +}; + +/** + * Iterate over all the registered interceptors + * + * This method is particularly useful for skipping over any + * interceptors that may have become `null` calling `eject`. + * + * @param {Function} fn The function to call for each interceptor + */ +InterceptorManager.prototype.forEach = function forEach(fn) { + utils.forEach(this.handlers, function forEachHandler(h) { + if (h !== null) { + fn(h); + } + }); +}; + +module.exports = InterceptorManager; + + +/***/ }), + +/***/ "./lib/core/buildFullPath.js": +/*!***********************************!*\ + !*** ./lib/core/buildFullPath.js ***! + \***********************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var isAbsoluteURL = __webpack_require__(/*! ../helpers/isAbsoluteURL */ "./lib/helpers/isAbsoluteURL.js"); +var combineURLs = __webpack_require__(/*! ../helpers/combineURLs */ "./lib/helpers/combineURLs.js"); + +/** + * Creates a new URL by combining the baseURL with the requestedURL, + * only when the requestedURL is not already an absolute URL. + * If the requestURL is absolute, this function returns the requestedURL untouched. + * + * @param {string} baseURL The base URL + * @param {string} requestedURL Absolute or relative URL to combine + * @returns {string} The combined full path + */ +module.exports = function buildFullPath(baseURL, requestedURL) { + if (baseURL && !isAbsoluteURL(requestedURL)) { + return combineURLs(baseURL, requestedURL); + } + return requestedURL; +}; + + +/***/ }), + +/***/ "./lib/core/createError.js": +/*!*********************************!*\ + !*** ./lib/core/createError.js ***! + \*********************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var enhanceError = __webpack_require__(/*! ./enhanceError */ "./lib/core/enhanceError.js"); + +/** + * Create an Error with the specified message, config, error code, request and response. + * + * @param {string} message The error message. + * @param {Object} config The config. + * @param {string} [code] The error code (for example, 'ECONNABORTED'). + * @param {Object} [request] The request. + * @param {Object} [response] The response. + * @returns {Error} The created error. + */ +module.exports = function createError(message, config, code, request, response) { + var error = new Error(message); + return enhanceError(error, config, code, request, response); +}; + + +/***/ }), + +/***/ "./lib/core/dispatchRequest.js": +/*!*************************************!*\ + !*** ./lib/core/dispatchRequest.js ***! + \*************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var utils = __webpack_require__(/*! ./../utils */ "./lib/utils.js"); +var transformData = __webpack_require__(/*! ./transformData */ "./lib/core/transformData.js"); +var isCancel = __webpack_require__(/*! ../cancel/isCancel */ "./lib/cancel/isCancel.js"); +var defaults = __webpack_require__(/*! ../defaults */ "./lib/defaults.js"); + +/** + * Throws a `Cancel` if cancellation has been requested. + */ +function throwIfCancellationRequested(config) { + if (config.cancelToken) { + config.cancelToken.throwIfRequested(); + } +} + +/** + * Dispatch a request to the server using the configured adapter. + * + * @param {object} config The config that is to be used for the request + * @returns {Promise} The Promise to be fulfilled + */ +module.exports = function dispatchRequest(config) { + throwIfCancellationRequested(config); + + // Ensure headers exist + config.headers = config.headers || {}; + + // Transform request data + config.data = transformData.call( + config, + config.data, + config.headers, + config.transformRequest + ); + + // Flatten headers + config.headers = utils.merge( + config.headers.common || {}, + config.headers[config.method] || {}, + config.headers + ); + + utils.forEach( + ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'], + function cleanHeaderConfig(method) { + delete config.headers[method]; + } + ); + + var adapter = config.adapter || defaults.adapter; + + return adapter(config).then(function onAdapterResolution(response) { + throwIfCancellationRequested(config); + + // Transform response data + response.data = transformData.call( + config, + response.data, + response.headers, + config.transformResponse + ); + + return response; + }, function onAdapterRejection(reason) { + if (!isCancel(reason)) { + throwIfCancellationRequested(config); + + // Transform response data + if (reason && reason.response) { + reason.response.data = transformData.call( + config, + reason.response.data, + reason.response.headers, + config.transformResponse + ); + } + } + + return Promise.reject(reason); + }); +}; + + +/***/ }), + +/***/ "./lib/core/enhanceError.js": +/*!**********************************!*\ + !*** ./lib/core/enhanceError.js ***! + \**********************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +/** + * Update an Error with the specified config, error code, and response. + * + * @param {Error} error The error to update. + * @param {Object} config The config. + * @param {string} [code] The error code (for example, 'ECONNABORTED'). + * @param {Object} [request] The request. + * @param {Object} [response] The response. + * @returns {Error} The error. + */ +module.exports = function enhanceError(error, config, code, request, response) { + error.config = config; + if (code) { + error.code = code; + } + + error.request = request; + error.response = response; + error.isAxiosError = true; + + error.toJSON = function toJSON() { + return { + // Standard + message: this.message, + name: this.name, + // Microsoft + description: this.description, + number: this.number, + // Mozilla + fileName: this.fileName, + lineNumber: this.lineNumber, + columnNumber: this.columnNumber, + stack: this.stack, + // Axios + config: this.config, + code: this.code + }; + }; + return error; +}; + + +/***/ }), + +/***/ "./lib/core/mergeConfig.js": +/*!*********************************!*\ + !*** ./lib/core/mergeConfig.js ***! + \*********************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var utils = __webpack_require__(/*! ../utils */ "./lib/utils.js"); + +/** + * Config-specific merge-function which creates a new config-object + * by merging two configuration objects together. + * + * @param {Object} config1 + * @param {Object} config2 + * @returns {Object} New object resulting from merging config2 to config1 + */ +module.exports = function mergeConfig(config1, config2) { + // eslint-disable-next-line no-param-reassign + config2 = config2 || {}; + var config = {}; + + var valueFromConfig2Keys = ['url', 'method', 'data']; + var mergeDeepPropertiesKeys = ['headers', 'auth', 'proxy', 'params']; + var defaultToConfig2Keys = [ + 'baseURL', 'transformRequest', 'transformResponse', 'paramsSerializer', + 'timeout', 'timeoutMessage', 'withCredentials', 'adapter', 'responseType', 'xsrfCookieName', + 'xsrfHeaderName', 'onUploadProgress', 'onDownloadProgress', 'decompress', + 'maxContentLength', 'maxBodyLength', 'maxRedirects', 'transport', 'httpAgent', + 'httpsAgent', 'cancelToken', 'socketPath', 'responseEncoding' + ]; + var directMergeKeys = ['validateStatus']; + + function getMergedValue(target, source) { + if (utils.isPlainObject(target) && utils.isPlainObject(source)) { + return utils.merge(target, source); + } else if (utils.isPlainObject(source)) { + return utils.merge({}, source); + } else if (utils.isArray(source)) { + return source.slice(); + } + return source; + } + + function mergeDeepProperties(prop) { + if (!utils.isUndefined(config2[prop])) { + config[prop] = getMergedValue(config1[prop], config2[prop]); + } else if (!utils.isUndefined(config1[prop])) { + config[prop] = getMergedValue(undefined, config1[prop]); + } + } + + utils.forEach(valueFromConfig2Keys, function valueFromConfig2(prop) { + if (!utils.isUndefined(config2[prop])) { + config[prop] = getMergedValue(undefined, config2[prop]); + } + }); + + utils.forEach(mergeDeepPropertiesKeys, mergeDeepProperties); + + utils.forEach(defaultToConfig2Keys, function defaultToConfig2(prop) { + if (!utils.isUndefined(config2[prop])) { + config[prop] = getMergedValue(undefined, config2[prop]); + } else if (!utils.isUndefined(config1[prop])) { + config[prop] = getMergedValue(undefined, config1[prop]); + } + }); + + utils.forEach(directMergeKeys, function merge(prop) { + if (prop in config2) { + config[prop] = getMergedValue(config1[prop], config2[prop]); + } else if (prop in config1) { + config[prop] = getMergedValue(undefined, config1[prop]); + } + }); + + var axiosKeys = valueFromConfig2Keys + .concat(mergeDeepPropertiesKeys) + .concat(defaultToConfig2Keys) + .concat(directMergeKeys); + + var otherKeys = Object + .keys(config1) + .concat(Object.keys(config2)) + .filter(function filterAxiosKeys(key) { + return axiosKeys.indexOf(key) === -1; + }); + + utils.forEach(otherKeys, mergeDeepProperties); + + return config; +}; + + +/***/ }), + +/***/ "./lib/core/settle.js": +/*!****************************!*\ + !*** ./lib/core/settle.js ***! + \****************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var createError = __webpack_require__(/*! ./createError */ "./lib/core/createError.js"); + +/** + * Resolve or reject a Promise based on response status. + * + * @param {Function} resolve A function that resolves the promise. + * @param {Function} reject A function that rejects the promise. + * @param {object} response The response. + */ +module.exports = function settle(resolve, reject, response) { + var validateStatus = response.config.validateStatus; + if (!response.status || !validateStatus || validateStatus(response.status)) { + resolve(response); + } else { + reject(createError( + 'Request failed with status code ' + response.status, + response.config, + null, + response.request, + response + )); + } +}; + + +/***/ }), + +/***/ "./lib/core/transformData.js": +/*!***********************************!*\ + !*** ./lib/core/transformData.js ***! + \***********************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var utils = __webpack_require__(/*! ./../utils */ "./lib/utils.js"); +var defaults = __webpack_require__(/*! ./../defaults */ "./lib/defaults.js"); + +/** + * Transform the data for a request or a response + * + * @param {Object|String} data The data to be transformed + * @param {Array} headers The headers for the request or response + * @param {Array|Function} fns A single function or Array of functions + * @returns {*} The resulting transformed data + */ +module.exports = function transformData(data, headers, fns) { + var context = this || defaults; + /*eslint no-param-reassign:0*/ + utils.forEach(fns, function transform(fn) { + data = fn.call(context, data, headers); + }); + + return data; +}; + + +/***/ }), + +/***/ "./lib/defaults.js": +/*!*************************!*\ + !*** ./lib/defaults.js ***! + \*************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var utils = __webpack_require__(/*! ./utils */ "./lib/utils.js"); +var normalizeHeaderName = __webpack_require__(/*! ./helpers/normalizeHeaderName */ "./lib/helpers/normalizeHeaderName.js"); +var enhanceError = __webpack_require__(/*! ./core/enhanceError */ "./lib/core/enhanceError.js"); + +var DEFAULT_CONTENT_TYPE = { + 'Content-Type': 'application/x-www-form-urlencoded' +}; + +function setContentTypeIfUnset(headers, value) { + if (!utils.isUndefined(headers) && utils.isUndefined(headers['Content-Type'])) { + headers['Content-Type'] = value; + } +} + +function getDefaultAdapter() { + var adapter; + if (typeof XMLHttpRequest !== 'undefined') { + // For browsers use XHR adapter + adapter = __webpack_require__(/*! ./adapters/xhr */ "./lib/adapters/xhr.js"); + } else if (typeof process !== 'undefined' && Object.prototype.toString.call(process) === '[object process]') { + // For node use HTTP adapter + adapter = __webpack_require__(/*! ./adapters/http */ "./lib/adapters/xhr.js"); + } + return adapter; +} + +function stringifySafely(rawValue, parser, encoder) { + if (utils.isString(rawValue)) { + try { + (parser || JSON.parse)(rawValue); + return utils.trim(rawValue); + } catch (e) { + if (e.name !== 'SyntaxError') { + throw e; + } + } + } + + return (encoder || JSON.stringify)(rawValue); +} + +var defaults = { + + transitional: { + silentJSONParsing: true, + forcedJSONParsing: true, + clarifyTimeoutError: false + }, + + adapter: getDefaultAdapter(), + + transformRequest: [function transformRequest(data, headers) { + normalizeHeaderName(headers, 'Accept'); + normalizeHeaderName(headers, 'Content-Type'); + + if (utils.isFormData(data) || + utils.isArrayBuffer(data) || + utils.isBuffer(data) || + utils.isStream(data) || + utils.isFile(data) || + utils.isBlob(data) + ) { + return data; + } + if (utils.isArrayBufferView(data)) { + return data.buffer; + } + if (utils.isURLSearchParams(data)) { + setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8'); + return data.toString(); + } + if (utils.isObject(data) || (headers && headers['Content-Type'] === 'application/json')) { + setContentTypeIfUnset(headers, 'application/json'); + return stringifySafely(data); + } + return data; + }], + + transformResponse: [function transformResponse(data) { + var transitional = this.transitional; + var silentJSONParsing = transitional && transitional.silentJSONParsing; + var forcedJSONParsing = transitional && transitional.forcedJSONParsing; + var strictJSONParsing = !silentJSONParsing && this.responseType === 'json'; + + if (strictJSONParsing || (forcedJSONParsing && utils.isString(data) && data.length)) { + try { + return JSON.parse(data); + } catch (e) { + if (strictJSONParsing) { + if (e.name === 'SyntaxError') { + throw enhanceError(e, this, 'E_JSON_PARSE'); + } + throw e; + } + } + } + + return data; + }], + + /** + * A timeout in milliseconds to abort a request. If set to 0 (default) a + * timeout is not created. + */ + timeout: 0, + + xsrfCookieName: 'XSRF-TOKEN', + xsrfHeaderName: 'X-XSRF-TOKEN', + + maxContentLength: -1, + maxBodyLength: -1, + + validateStatus: function validateStatus(status) { + return status >= 200 && status < 300; + } +}; + +defaults.headers = { + common: { + 'Accept': 'application/json, text/plain, */*' + } +}; + +utils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) { + defaults.headers[method] = {}; +}); + +utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) { + defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE); +}); + +module.exports = defaults; + + +/***/ }), + +/***/ "./lib/helpers/bind.js": +/*!*****************************!*\ + !*** ./lib/helpers/bind.js ***! + \*****************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +module.exports = function bind(fn, thisArg) { + return function wrap() { + var args = new Array(arguments.length); + for (var i = 0; i < args.length; i++) { + args[i] = arguments[i]; + } + return fn.apply(thisArg, args); + }; +}; + + +/***/ }), + +/***/ "./lib/helpers/buildURL.js": +/*!*********************************!*\ + !*** ./lib/helpers/buildURL.js ***! + \*********************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var utils = __webpack_require__(/*! ./../utils */ "./lib/utils.js"); + +function encode(val) { + return encodeURIComponent(val). + replace(/%3A/gi, ':'). + replace(/%24/g, '$'). + replace(/%2C/gi, ','). + replace(/%20/g, '+'). + replace(/%5B/gi, '['). + replace(/%5D/gi, ']'); +} + +/** + * Build a URL by appending params to the end + * + * @param {string} url The base of the url (e.g., http://www.google.com) + * @param {object} [params] The params to be appended + * @returns {string} The formatted url + */ +module.exports = function buildURL(url, params, paramsSerializer) { + /*eslint no-param-reassign:0*/ + if (!params) { + return url; + } + + var serializedParams; + if (paramsSerializer) { + serializedParams = paramsSerializer(params); + } else if (utils.isURLSearchParams(params)) { + serializedParams = params.toString(); + } else { + var parts = []; + + utils.forEach(params, function serialize(val, key) { + if (val === null || typeof val === 'undefined') { + return; + } + + if (utils.isArray(val)) { + key = key + '[]'; + } else { + val = [val]; + } + + utils.forEach(val, function parseValue(v) { + if (utils.isDate(v)) { + v = v.toISOString(); + } else if (utils.isObject(v)) { + v = JSON.stringify(v); + } + parts.push(encode(key) + '=' + encode(v)); + }); + }); + + serializedParams = parts.join('&'); + } + + if (serializedParams) { + var hashmarkIndex = url.indexOf('#'); + if (hashmarkIndex !== -1) { + url = url.slice(0, hashmarkIndex); + } + + url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams; + } + + return url; +}; + + +/***/ }), + +/***/ "./lib/helpers/combineURLs.js": +/*!************************************!*\ + !*** ./lib/helpers/combineURLs.js ***! + \************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +/** + * Creates a new URL by combining the specified URLs + * + * @param {string} baseURL The base URL + * @param {string} relativeURL The relative URL + * @returns {string} The combined URL + */ +module.exports = function combineURLs(baseURL, relativeURL) { + return relativeURL + ? baseURL.replace(/\/+$/, '') + '/' + relativeURL.replace(/^\/+/, '') + : baseURL; +}; + + +/***/ }), + +/***/ "./lib/helpers/cookies.js": +/*!********************************!*\ + !*** ./lib/helpers/cookies.js ***! + \********************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var utils = __webpack_require__(/*! ./../utils */ "./lib/utils.js"); + +module.exports = ( + utils.isStandardBrowserEnv() ? + + // Standard browser envs support document.cookie + (function standardBrowserEnv() { + return { + write: function write(name, value, expires, path, domain, secure) { + var cookie = []; + cookie.push(name + '=' + encodeURIComponent(value)); + + if (utils.isNumber(expires)) { + cookie.push('expires=' + new Date(expires).toGMTString()); + } + + if (utils.isString(path)) { + cookie.push('path=' + path); + } + + if (utils.isString(domain)) { + cookie.push('domain=' + domain); + } + + if (secure === true) { + cookie.push('secure'); + } + + document.cookie = cookie.join('; '); + }, + + read: function read(name) { + var match = document.cookie.match(new RegExp('(^|;\\s*)(' + name + ')=([^;]*)')); + return (match ? decodeURIComponent(match[3]) : null); + }, + + remove: function remove(name) { + this.write(name, '', Date.now() - 86400000); + } + }; + })() : + + // Non standard browser env (web workers, react-native) lack needed support. + (function nonStandardBrowserEnv() { + return { + write: function write() {}, + read: function read() { return null; }, + remove: function remove() {} + }; + })() +); + + +/***/ }), + +/***/ "./lib/helpers/isAbsoluteURL.js": +/*!**************************************!*\ + !*** ./lib/helpers/isAbsoluteURL.js ***! + \**************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +/** + * Determines whether the specified URL is absolute + * + * @param {string} url The URL to test + * @returns {boolean} True if the specified URL is absolute, otherwise false + */ +module.exports = function isAbsoluteURL(url) { + // A URL is considered absolute if it begins with "://" or "//" (protocol-relative URL). + // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed + // by any combination of letters, digits, plus, period, or hyphen. + return /^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(url); +}; + + +/***/ }), + +/***/ "./lib/helpers/isAxiosError.js": +/*!*************************************!*\ + !*** ./lib/helpers/isAxiosError.js ***! + \*************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +/** + * Determines whether the payload is an error thrown by Axios + * + * @param {*} payload The value to test + * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false + */ +module.exports = function isAxiosError(payload) { + return (typeof payload === 'object') && (payload.isAxiosError === true); +}; + + +/***/ }), + +/***/ "./lib/helpers/isURLSameOrigin.js": +/*!****************************************!*\ + !*** ./lib/helpers/isURLSameOrigin.js ***! + \****************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var utils = __webpack_require__(/*! ./../utils */ "./lib/utils.js"); + +module.exports = ( + utils.isStandardBrowserEnv() ? + + // Standard browser envs have full support of the APIs needed to test + // whether the request URL is of the same origin as current location. + (function standardBrowserEnv() { + var msie = /(msie|trident)/i.test(navigator.userAgent); + var urlParsingNode = document.createElement('a'); + var originURL; + + /** + * Parse a URL to discover it's components + * + * @param {String} url The URL to be parsed + * @returns {Object} + */ + function resolveURL(url) { + var href = url; + + if (msie) { + // IE needs attribute set twice to normalize properties + urlParsingNode.setAttribute('href', href); + href = urlParsingNode.href; + } + + urlParsingNode.setAttribute('href', href); + + // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils + return { + href: urlParsingNode.href, + protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '', + host: urlParsingNode.host, + search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, '') : '', + hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '', + hostname: urlParsingNode.hostname, + port: urlParsingNode.port, + pathname: (urlParsingNode.pathname.charAt(0) === '/') ? + urlParsingNode.pathname : + '/' + urlParsingNode.pathname + }; + } + + originURL = resolveURL(window.location.href); + + /** + * Determine if a URL shares the same origin as the current location + * + * @param {String} requestURL The URL to test + * @returns {boolean} True if URL shares the same origin, otherwise false + */ + return function isURLSameOrigin(requestURL) { + var parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL; + return (parsed.protocol === originURL.protocol && + parsed.host === originURL.host); + }; + })() : + + // Non standard browser envs (web workers, react-native) lack needed support. + (function nonStandardBrowserEnv() { + return function isURLSameOrigin() { + return true; + }; + })() +); + + +/***/ }), + +/***/ "./lib/helpers/normalizeHeaderName.js": +/*!********************************************!*\ + !*** ./lib/helpers/normalizeHeaderName.js ***! + \********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var utils = __webpack_require__(/*! ../utils */ "./lib/utils.js"); + +module.exports = function normalizeHeaderName(headers, normalizedName) { + utils.forEach(headers, function processHeader(value, name) { + if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) { + headers[normalizedName] = value; + delete headers[name]; + } + }); +}; + + +/***/ }), + +/***/ "./lib/helpers/parseHeaders.js": +/*!*************************************!*\ + !*** ./lib/helpers/parseHeaders.js ***! + \*************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var utils = __webpack_require__(/*! ./../utils */ "./lib/utils.js"); + +// Headers whose duplicates are ignored by node +// c.f. https://nodejs.org/api/http.html#http_message_headers +var ignoreDuplicateOf = [ + 'age', 'authorization', 'content-length', 'content-type', 'etag', + 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since', + 'last-modified', 'location', 'max-forwards', 'proxy-authorization', + 'referer', 'retry-after', 'user-agent' +]; + +/** + * Parse headers into an object + * + * ``` + * Date: Wed, 27 Aug 2014 08:58:49 GMT + * Content-Type: application/json + * Connection: keep-alive + * Transfer-Encoding: chunked + * ``` + * + * @param {String} headers Headers needing to be parsed + * @returns {Object} Headers parsed into an object + */ +module.exports = function parseHeaders(headers) { + var parsed = {}; + var key; + var val; + var i; + + if (!headers) { return parsed; } + + utils.forEach(headers.split('\n'), function parser(line) { + i = line.indexOf(':'); + key = utils.trim(line.substr(0, i)).toLowerCase(); + val = utils.trim(line.substr(i + 1)); + + if (key) { + if (parsed[key] && ignoreDuplicateOf.indexOf(key) >= 0) { + return; + } + if (key === 'set-cookie') { + parsed[key] = (parsed[key] ? parsed[key] : []).concat([val]); + } else { + parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val; + } + } + }); + + return parsed; +}; + + +/***/ }), + +/***/ "./lib/helpers/spread.js": +/*!*******************************!*\ + !*** ./lib/helpers/spread.js ***! + \*******************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +/** + * Syntactic sugar for invoking a function and expanding an array for arguments. + * + * Common use case would be to use `Function.prototype.apply`. + * + * ```js + * function f(x, y, z) {} + * var args = [1, 2, 3]; + * f.apply(null, args); + * ``` + * + * With `spread` this example can be re-written. + * + * ```js + * spread(function(x, y, z) {})([1, 2, 3]); + * ``` + * + * @param {Function} callback + * @returns {Function} + */ +module.exports = function spread(callback) { + return function wrap(arr) { + return callback.apply(null, arr); + }; +}; + + +/***/ }), + +/***/ "./lib/helpers/validator.js": +/*!**********************************!*\ + !*** ./lib/helpers/validator.js ***! + \**********************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var pkg = __webpack_require__(/*! ./../../package.json */ "./package.json"); + +var validators = {}; + +// eslint-disable-next-line func-names +['object', 'boolean', 'number', 'function', 'string', 'symbol'].forEach(function(type, i) { + validators[type] = function validator(thing) { + return typeof thing === type || 'a' + (i < 1 ? 'n ' : ' ') + type; + }; +}); + +var deprecatedWarnings = {}; +var currentVerArr = pkg.version.split('.'); + +/** + * Compare package versions + * @param {string} version + * @param {string?} thanVersion + * @returns {boolean} + */ +function isOlderVersion(version, thanVersion) { + var pkgVersionArr = thanVersion ? thanVersion.split('.') : currentVerArr; + var destVer = version.split('.'); + for (var i = 0; i < 3; i++) { + if (pkgVersionArr[i] > destVer[i]) { + return true; + } else if (pkgVersionArr[i] < destVer[i]) { + return false; + } + } + return false; +} + +/** + * Transitional option validator + * @param {function|boolean?} validator + * @param {string?} version + * @param {string} message + * @returns {function} + */ +validators.transitional = function transitional(validator, version, message) { + var isDeprecated = version && isOlderVersion(version); + + function formatMessage(opt, desc) { + return '[Axios v' + pkg.version + '] Transitional option \'' + opt + '\'' + desc + (message ? '. ' + message : ''); + } + + // eslint-disable-next-line func-names + return function(value, opt, opts) { + if (validator === false) { + throw new Error(formatMessage(opt, ' has been removed in ' + version)); + } + + if (isDeprecated && !deprecatedWarnings[opt]) { + deprecatedWarnings[opt] = true; + // eslint-disable-next-line no-console + console.warn( + formatMessage( + opt, + ' has been deprecated since v' + version + ' and will be removed in the near future' + ) + ); + } + + return validator ? validator(value, opt, opts) : true; + }; +}; + +/** + * Assert object's properties type + * @param {object} options + * @param {object} schema + * @param {boolean?} allowUnknown + */ + +function assertOptions(options, schema, allowUnknown) { + if (typeof options !== 'object') { + throw new TypeError('options must be an object'); + } + var keys = Object.keys(options); + var i = keys.length; + while (i-- > 0) { + var opt = keys[i]; + var validator = schema[opt]; + if (validator) { + var value = options[opt]; + var result = value === undefined || validator(value, opt, options); + if (result !== true) { + throw new TypeError('option ' + opt + ' must be ' + result); + } + continue; + } + if (allowUnknown !== true) { + throw Error('Unknown option ' + opt); + } + } +} + +module.exports = { + isOlderVersion: isOlderVersion, + assertOptions: assertOptions, + validators: validators +}; + + +/***/ }), + +/***/ "./lib/utils.js": +/*!**********************!*\ + !*** ./lib/utils.js ***! + \**********************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var bind = __webpack_require__(/*! ./helpers/bind */ "./lib/helpers/bind.js"); + +// utils is a library of generic helper functions non-specific to axios + +var toString = Object.prototype.toString; + +/** + * Determine if a value is an Array + * + * @param {Object} val The value to test + * @returns {boolean} True if value is an Array, otherwise false + */ +function isArray(val) { + return toString.call(val) === '[object Array]'; +} + +/** + * Determine if a value is undefined + * + * @param {Object} val The value to test + * @returns {boolean} True if the value is undefined, otherwise false + */ +function isUndefined(val) { + return typeof val === 'undefined'; +} + +/** + * Determine if a value is a Buffer + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a Buffer, otherwise false + */ +function isBuffer(val) { + return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor) + && typeof val.constructor.isBuffer === 'function' && val.constructor.isBuffer(val); +} + +/** + * Determine if a value is an ArrayBuffer + * + * @param {Object} val The value to test + * @returns {boolean} True if value is an ArrayBuffer, otherwise false + */ +function isArrayBuffer(val) { + return toString.call(val) === '[object ArrayBuffer]'; +} + +/** + * Determine if a value is a FormData + * + * @param {Object} val The value to test + * @returns {boolean} True if value is an FormData, otherwise false + */ +function isFormData(val) { + return (typeof FormData !== 'undefined') && (val instanceof FormData); +} + +/** + * Determine if a value is a view on an ArrayBuffer + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false + */ +function isArrayBufferView(val) { + var result; + if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) { + result = ArrayBuffer.isView(val); + } else { + result = (val) && (val.buffer) && (val.buffer instanceof ArrayBuffer); + } + return result; +} + +/** + * Determine if a value is a String + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a String, otherwise false + */ +function isString(val) { + return typeof val === 'string'; +} + +/** + * Determine if a value is a Number + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a Number, otherwise false + */ +function isNumber(val) { + return typeof val === 'number'; +} + +/** + * Determine if a value is an Object + * + * @param {Object} val The value to test + * @returns {boolean} True if value is an Object, otherwise false + */ +function isObject(val) { + return val !== null && typeof val === 'object'; +} + +/** + * Determine if a value is a plain Object + * + * @param {Object} val The value to test + * @return {boolean} True if value is a plain Object, otherwise false + */ +function isPlainObject(val) { + if (toString.call(val) !== '[object Object]') { + return false; + } + + var prototype = Object.getPrototypeOf(val); + return prototype === null || prototype === Object.prototype; +} + +/** + * Determine if a value is a Date + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a Date, otherwise false + */ +function isDate(val) { + return toString.call(val) === '[object Date]'; +} + +/** + * Determine if a value is a File + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a File, otherwise false + */ +function isFile(val) { + return toString.call(val) === '[object File]'; +} + +/** + * Determine if a value is a Blob + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a Blob, otherwise false + */ +function isBlob(val) { + return toString.call(val) === '[object Blob]'; +} + +/** + * Determine if a value is a Function + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a Function, otherwise false + */ +function isFunction(val) { + return toString.call(val) === '[object Function]'; +} + +/** + * Determine if a value is a Stream + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a Stream, otherwise false + */ +function isStream(val) { + return isObject(val) && isFunction(val.pipe); +} + +/** + * Determine if a value is a URLSearchParams object + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a URLSearchParams object, otherwise false + */ +function isURLSearchParams(val) { + return typeof URLSearchParams !== 'undefined' && val instanceof URLSearchParams; +} + +/** + * Trim excess whitespace off the beginning and end of a string + * + * @param {String} str The String to trim + * @returns {String} The String freed of excess whitespace + */ +function trim(str) { + return str.trim ? str.trim() : str.replace(/^\s+|\s+$/g, ''); +} + +/** + * Determine if we're running in a standard browser environment + * + * This allows axios to run in a web worker, and react-native. + * Both environments support XMLHttpRequest, but not fully standard globals. + * + * web workers: + * typeof window -> undefined + * typeof document -> undefined + * + * react-native: + * navigator.product -> 'ReactNative' + * nativescript + * navigator.product -> 'NativeScript' or 'NS' + */ +function isStandardBrowserEnv() { + if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' || + navigator.product === 'NativeScript' || + navigator.product === 'NS')) { + return false; + } + return ( + typeof window !== 'undefined' && + typeof document !== 'undefined' + ); +} + +/** + * Iterate over an Array or an Object invoking a function for each item. + * + * If `obj` is an Array callback will be called passing + * the value, index, and complete array for each item. + * + * If 'obj' is an Object callback will be called passing + * the value, key, and complete object for each property. + * + * @param {Object|Array} obj The object to iterate + * @param {Function} fn The callback to invoke for each item + */ +function forEach(obj, fn) { + // Don't bother if no value provided + if (obj === null || typeof obj === 'undefined') { + return; + } + + // Force an array if not already something iterable + if (typeof obj !== 'object') { + /*eslint no-param-reassign:0*/ + obj = [obj]; + } + + if (isArray(obj)) { + // Iterate over array values + for (var i = 0, l = obj.length; i < l; i++) { + fn.call(null, obj[i], i, obj); + } + } else { + // Iterate over object keys + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) { + fn.call(null, obj[key], key, obj); + } + } + } +} + +/** + * Accepts varargs expecting each argument to be an object, then + * immutably merges the properties of each object and returns result. + * + * When multiple objects contain the same key the later object in + * the arguments list will take precedence. + * + * Example: + * + * ```js + * var result = merge({foo: 123}, {foo: 456}); + * console.log(result.foo); // outputs 456 + * ``` + * + * @param {Object} obj1 Object to merge + * @returns {Object} Result of all merge properties + */ +function merge(/* obj1, obj2, obj3, ... */) { + var result = {}; + function assignValue(val, key) { + if (isPlainObject(result[key]) && isPlainObject(val)) { + result[key] = merge(result[key], val); + } else if (isPlainObject(val)) { + result[key] = merge({}, val); + } else if (isArray(val)) { + result[key] = val.slice(); + } else { + result[key] = val; + } + } + + for (var i = 0, l = arguments.length; i < l; i++) { + forEach(arguments[i], assignValue); + } + return result; +} + +/** + * Extends object a by mutably adding to it the properties of object b. + * + * @param {Object} a The object to be extended + * @param {Object} b The object to copy properties from + * @param {Object} thisArg The object to bind function to + * @return {Object} The resulting value of object a + */ +function extend(a, b, thisArg) { + forEach(b, function assignValue(val, key) { + if (thisArg && typeof val === 'function') { + a[key] = bind(val, thisArg); + } else { + a[key] = val; + } + }); + return a; +} + +/** + * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM) + * + * @param {string} content with BOM + * @return {string} content value without BOM + */ +function stripBOM(content) { + if (content.charCodeAt(0) === 0xFEFF) { + content = content.slice(1); + } + return content; +} + +module.exports = { + isArray: isArray, + isArrayBuffer: isArrayBuffer, + isBuffer: isBuffer, + isFormData: isFormData, + isArrayBufferView: isArrayBufferView, + isString: isString, + isNumber: isNumber, + isObject: isObject, + isPlainObject: isPlainObject, + isUndefined: isUndefined, + isDate: isDate, + isFile: isFile, + isBlob: isBlob, + isFunction: isFunction, + isStream: isStream, + isURLSearchParams: isURLSearchParams, + isStandardBrowserEnv: isStandardBrowserEnv, + forEach: forEach, + merge: merge, + extend: extend, + trim: trim, + stripBOM: stripBOM +}; + + +/***/ }), + +/***/ "./package.json": +/*!**********************!*\ + !*** ./package.json ***! + \**********************/ +/*! exports provided: name, version, description, main, scripts, repository, keywords, author, license, bugs, homepage, devDependencies, browser, jsdelivr, unpkg, typings, dependencies, bundlesize, default */ +/***/ (function(module) { + +module.exports = JSON.parse("{\"name\":\"axios\",\"version\":\"0.21.4\",\"description\":\"Promise based HTTP client for the browser and node.js\",\"main\":\"index.js\",\"scripts\":{\"test\":\"grunt test\",\"start\":\"node ./sandbox/server.js\",\"build\":\"NODE_ENV=production grunt build\",\"preversion\":\"npm test\",\"version\":\"npm run build && grunt version && git add -A dist && git add CHANGELOG.md bower.json package.json\",\"postversion\":\"git push && git push --tags\",\"examples\":\"node ./examples/server.js\",\"coveralls\":\"cat coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js\",\"fix\":\"eslint --fix lib/**/*.js\"},\"repository\":{\"type\":\"git\",\"url\":\"https://github.com/axios/axios.git\"},\"keywords\":[\"xhr\",\"http\",\"ajax\",\"promise\",\"node\"],\"author\":\"Matt Zabriskie\",\"license\":\"MIT\",\"bugs\":{\"url\":\"https://github.com/axios/axios/issues\"},\"homepage\":\"https://axios-http.com\",\"devDependencies\":{\"coveralls\":\"^3.0.0\",\"es6-promise\":\"^4.2.4\",\"grunt\":\"^1.3.0\",\"grunt-banner\":\"^0.6.0\",\"grunt-cli\":\"^1.2.0\",\"grunt-contrib-clean\":\"^1.1.0\",\"grunt-contrib-watch\":\"^1.0.0\",\"grunt-eslint\":\"^23.0.0\",\"grunt-karma\":\"^4.0.0\",\"grunt-mocha-test\":\"^0.13.3\",\"grunt-ts\":\"^6.0.0-beta.19\",\"grunt-webpack\":\"^4.0.2\",\"istanbul-instrumenter-loader\":\"^1.0.0\",\"jasmine-core\":\"^2.4.1\",\"karma\":\"^6.3.2\",\"karma-chrome-launcher\":\"^3.1.0\",\"karma-firefox-launcher\":\"^2.1.0\",\"karma-jasmine\":\"^1.1.1\",\"karma-jasmine-ajax\":\"^0.1.13\",\"karma-safari-launcher\":\"^1.0.0\",\"karma-sauce-launcher\":\"^4.3.6\",\"karma-sinon\":\"^1.0.5\",\"karma-sourcemap-loader\":\"^0.3.8\",\"karma-webpack\":\"^4.0.2\",\"load-grunt-tasks\":\"^3.5.2\",\"minimist\":\"^1.2.0\",\"mocha\":\"^8.2.1\",\"sinon\":\"^4.5.0\",\"terser-webpack-plugin\":\"^4.2.3\",\"typescript\":\"^4.0.5\",\"url-search-params\":\"^0.10.0\",\"webpack\":\"^4.44.2\",\"webpack-dev-server\":\"^3.11.0\"},\"browser\":{\"./lib/adapters/http.js\":\"./lib/adapters/xhr.js\"},\"jsdelivr\":\"dist/axios.min.js\",\"unpkg\":\"dist/axios.min.js\",\"typings\":\"./index.d.ts\",\"dependencies\":{\"follow-redirects\":\"^1.14.0\"},\"bundlesize\":[{\"path\":\"./dist/axios.min.js\",\"threshold\":\"5kB\"}]}"); + +/***/ }) + +/******/ }); +}); +//# sourceMappingURL=axios.map \ No newline at end of file diff --git a/node_modules/xfarr-api/node_modules/axios/dist/axios.map b/node_modules/xfarr-api/node_modules/axios/dist/axios.map new file mode 100644 index 000000000..4aadb219e --- /dev/null +++ b/node_modules/xfarr-api/node_modules/axios/dist/axios.map @@ -0,0 +1 @@ +{"version":3,"sources":["webpack://axios/webpack/universalModuleDefinition","webpack://axios/webpack/bootstrap","webpack://axios/./index.js","webpack://axios/./lib/adapters/xhr.js","webpack://axios/./lib/axios.js","webpack://axios/./lib/cancel/Cancel.js","webpack://axios/./lib/cancel/CancelToken.js","webpack://axios/./lib/cancel/isCancel.js","webpack://axios/./lib/core/Axios.js","webpack://axios/./lib/core/InterceptorManager.js","webpack://axios/./lib/core/buildFullPath.js","webpack://axios/./lib/core/createError.js","webpack://axios/./lib/core/dispatchRequest.js","webpack://axios/./lib/core/enhanceError.js","webpack://axios/./lib/core/mergeConfig.js","webpack://axios/./lib/core/settle.js","webpack://axios/./lib/core/transformData.js","webpack://axios/./lib/defaults.js","webpack://axios/./lib/helpers/bind.js","webpack://axios/./lib/helpers/buildURL.js","webpack://axios/./lib/helpers/combineURLs.js","webpack://axios/./lib/helpers/cookies.js","webpack://axios/./lib/helpers/isAbsoluteURL.js","webpack://axios/./lib/helpers/isAxiosError.js","webpack://axios/./lib/helpers/isURLSameOrigin.js","webpack://axios/./lib/helpers/normalizeHeaderName.js","webpack://axios/./lib/helpers/parseHeaders.js","webpack://axios/./lib/helpers/spread.js","webpack://axios/./lib/helpers/validator.js","webpack://axios/./lib/utils.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,O;QCVA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA,0CAA0C,gCAAgC;QAC1E;QACA;;QAEA;QACA;QACA;QACA,wDAAwD,kBAAkB;QAC1E;QACA,iDAAiD,cAAc;QAC/D;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA,yCAAyC,iCAAiC;QAC1E,gHAAgH,mBAAmB,EAAE;QACrI;QACA;;QAEA;QACA;QACA;QACA,2BAA2B,0BAA0B,EAAE;QACvD,iCAAiC,eAAe;QAChD;QACA;QACA;;QAEA;QACA,sDAAsD,+DAA+D;;QAErH;QACA;;;QAGA;QACA;;;;;;;;;;;;AClFA,iBAAiB,mBAAO,CAAC,mCAAa,E;;;;;;;;;;;;ACAzB;;AAEb,YAAY,mBAAO,CAAC,kCAAY;AAChC,aAAa,mBAAO,CAAC,8CAAkB;AACvC,cAAc,mBAAO,CAAC,sDAAsB;AAC5C,eAAe,mBAAO,CAAC,wDAAuB;AAC9C,oBAAoB,mBAAO,CAAC,0DAAuB;AACnD,mBAAmB,mBAAO,CAAC,gEAA2B;AACtD,sBAAsB,mBAAO,CAAC,sEAA8B;AAC5D,kBAAkB,mBAAO,CAAC,sDAAqB;;AAE/C;AACA;AACA;AACA;AACA;;AAEA;AACA,4CAA4C;AAC5C;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;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AAC5C,yBAAyB,mBAAO,CAAC,8DAAsB;AACvD,sBAAsB,mBAAO,CAAC,wDAAmB;AACjD,kBAAkB,mBAAO,CAAC,gDAAe;AACzC,gBAAgB,mBAAO,CAAC,wDAAsB;;AAE9C;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA,GAAG;;AAEH;AACA;AACA;AACA,GAAG;;AAEH;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,gDAAgD;AAChD;AACA;AACA,yBAAyB;AACzB,KAAK;AACL;AACA,CAAC;;AAED;AACA;AACA;AACA,gDAAgD;AAChD;AACA;AACA;AACA,KAAK;AACL;AACA,CAAC;;AAED;;;;;;;;;;;;;ACnJa;;AAEb,YAAY,mBAAO,CAAC,kCAAY;;AAEhC;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,SAAS;AACpB,WAAW,SAAS;AACpB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,SAAS;AACpB;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;AAEA;;;;;;;;;;;;;ACrDa;;AAEb,oBAAoB,mBAAO,CAAC,gEAA0B;AACtD,kBAAkB,mBAAO,CAAC,4DAAwB;;AAElD;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACnBa;;AAEb,mBAAmB,mBAAO,CAAC,kDAAgB;;AAE3C;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,MAAM;AACnB;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACjBa;;AAEb,YAAY,mBAAO,CAAC,kCAAY;AAChC,oBAAoB,mBAAO,CAAC,oDAAiB;AAC7C,eAAe,mBAAO,CAAC,oDAAoB;AAC3C,eAAe,mBAAO,CAAC,sCAAa;;AAEpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,+BAA+B;AAC/B,uCAAuC;AACvC;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,GAAG;AACH;;;;;;;;;;;;;ACjFa;;AAEb;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,MAAM;AACnB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACzCa;;AAEb,YAAY,mBAAO,CAAC,gCAAU;;AAE9B;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL,2BAA2B;AAC3B,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;;AAEH;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;;AAEA;AACA;;;;;;;;;;;;;ACtFa;;AAEb,kBAAkB,mBAAO,CAAC,gDAAe;;AAEzC;AACA;AACA;AACA,WAAW,SAAS;AACpB,WAAW,SAAS;AACpB,WAAW,OAAO;AAClB;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACxBa;;AAEb,YAAY,mBAAO,CAAC,kCAAY;AAChC,eAAe,mBAAO,CAAC,wCAAe;;AAEtC;AACA;AACA;AACA,WAAW,cAAc;AACzB,WAAW,MAAM;AACjB,WAAW,eAAe;AAC1B,aAAa,EAAE;AACf;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;;;;;;;;;;;;;ACrBa;;AAEb,YAAY,mBAAO,CAAC,+BAAS;AAC7B,0BAA0B,mBAAO,CAAC,2EAA+B;AACjE,mBAAmB,mBAAO,CAAC,uDAAqB;;AAEhD;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc,mBAAO,CAAC,6CAAgB;AACtC,GAAG;AACH;AACA,cAAc,mBAAO,CAAC,8CAAiB;AACvC;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,GAAG;;AAEH;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wEAAwE;AACxE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,CAAC;;AAED;AACA;AACA,CAAC;;AAED;;;;;;;;;;;;;ACrIa;;AAEb;AACA;AACA;AACA,mBAAmB,iBAAiB;AACpC;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACVa;;AAEb,YAAY,mBAAO,CAAC,kCAAY;;AAEhC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,OAAO;AACP,KAAK;;AAEL;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;;;;;;;;;;;;ACrEa;;AAEb;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,aAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACba;;AAEb,YAAY,mBAAO,CAAC,kCAAY;;AAEhC;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,0CAA0C;AAC1C,SAAS;;AAET;AACA,4DAA4D,wBAAwB;AACpF;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,kCAAkC;AAClC,+BAA+B,aAAa,EAAE;AAC9C;AACA;AACA,KAAK;AACL;;;;;;;;;;;;;ACpDa;;AAEb;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACba;;AAEb;AACA;AACA;AACA,WAAW,EAAE;AACb,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;;;;;;;;;;;;ACVa;;AAEb,YAAY,mBAAO,CAAC,kCAAY;;AAEhC;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,cAAc,OAAO;AACrB,gBAAgB;AAChB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,cAAc,OAAO;AACrB,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;;;;;;;;;;;;ACnEa;;AAEb,YAAY,mBAAO,CAAC,gCAAU;;AAE9B;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;;;;;;;;;;;;ACXa;;AAEb,YAAY,mBAAO,CAAC,kCAAY;;AAEhC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;;AAEA,iBAAiB,eAAe;;AAEhC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,GAAG;;AAEH;AACA;;;;;;;;;;;;;ACpDa;;AAEb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B;AAC/B;AACA;AACA,WAAW,SAAS;AACpB,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;AC1Ba;;AAEb,UAAU,mBAAO,CAAC,4CAAsB;;AAExC;;AAEA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;;AAEA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,QAAQ;AACnB,aAAa;AACb;AACA;AACA;AACA;AACA,iBAAiB,OAAO;AACxB;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,WAAW,kBAAkB;AAC7B,WAAW,QAAQ;AACnB,WAAW,OAAO;AAClB,aAAa;AACb;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,SAAS;AACpB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACxGa;;AAEb,WAAW,mBAAO,CAAC,6CAAgB;;AAEnC;;AAEA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,YAAY,QAAQ;AACpB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,aAAa,OAAO;AACpB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,SAAS;AACpB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,mCAAmC,OAAO;AAC1C;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,SAAS,GAAG,SAAS;AAC5C,2BAA2B;AAC3B;AACA;AACA,WAAW,OAAO;AAClB,aAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,4BAA4B;AAC5B,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;;AAEA,uCAAuC,OAAO;AAC9C;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"axios.js","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[\"axios\"] = factory();\n\telse\n\t\troot[\"axios\"] = factory();\n})(window, function() {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = \"./index.js\");\n","module.exports = require('./lib/axios');","'use strict';\n\nvar utils = require('./../utils');\nvar settle = require('./../core/settle');\nvar cookies = require('./../helpers/cookies');\nvar buildURL = require('./../helpers/buildURL');\nvar buildFullPath = require('../core/buildFullPath');\nvar parseHeaders = require('./../helpers/parseHeaders');\nvar isURLSameOrigin = require('./../helpers/isURLSameOrigin');\nvar createError = require('../core/createError');\n\nmodule.exports = function xhrAdapter(config) {\n return new Promise(function dispatchXhrRequest(resolve, reject) {\n var requestData = config.data;\n var requestHeaders = config.headers;\n var responseType = config.responseType;\n\n if (utils.isFormData(requestData)) {\n delete requestHeaders['Content-Type']; // Let the browser set it\n }\n\n var request = new XMLHttpRequest();\n\n // HTTP basic authentication\n if (config.auth) {\n var username = config.auth.username || '';\n var password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : '';\n requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password);\n }\n\n var fullPath = buildFullPath(config.baseURL, config.url);\n request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true);\n\n // Set the request timeout in MS\n request.timeout = config.timeout;\n\n function onloadend() {\n if (!request) {\n return;\n }\n // Prepare the response\n var responseHeaders = 'getAllResponseHeaders' in request ? parseHeaders(request.getAllResponseHeaders()) : null;\n var responseData = !responseType || responseType === 'text' || responseType === 'json' ?\n request.responseText : request.response;\n var response = {\n data: responseData,\n status: request.status,\n statusText: request.statusText,\n headers: responseHeaders,\n config: config,\n request: request\n };\n\n settle(resolve, reject, response);\n\n // Clean up request\n request = null;\n }\n\n if ('onloadend' in request) {\n // Use onloadend if available\n request.onloadend = onloadend;\n } else {\n // Listen for ready state to emulate onloadend\n request.onreadystatechange = function handleLoad() {\n if (!request || request.readyState !== 4) {\n return;\n }\n\n // The request errored out and we didn't get a response, this will be\n // handled by onerror instead\n // With one exception: request that using file: protocol, most browsers\n // will return status as 0 even though it's a successful request\n if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {\n return;\n }\n // readystate handler is calling before onerror or ontimeout handlers,\n // so we should call onloadend on the next 'tick'\n setTimeout(onloadend);\n };\n }\n\n // Handle browser request cancellation (as opposed to a manual cancellation)\n request.onabort = function handleAbort() {\n if (!request) {\n return;\n }\n\n reject(createError('Request aborted', config, 'ECONNABORTED', request));\n\n // Clean up request\n request = null;\n };\n\n // Handle low level network errors\n request.onerror = function handleError() {\n // Real errors are hidden from us by the browser\n // onerror should only fire if it's a network error\n reject(createError('Network Error', config, null, request));\n\n // Clean up request\n request = null;\n };\n\n // Handle timeout\n request.ontimeout = function handleTimeout() {\n var timeoutErrorMessage = 'timeout of ' + config.timeout + 'ms exceeded';\n if (config.timeoutErrorMessage) {\n timeoutErrorMessage = config.timeoutErrorMessage;\n }\n reject(createError(\n timeoutErrorMessage,\n config,\n config.transitional && config.transitional.clarifyTimeoutError ? 'ETIMEDOUT' : 'ECONNABORTED',\n request));\n\n // Clean up request\n request = null;\n };\n\n // Add xsrf header\n // This is only done if running in a standard browser environment.\n // Specifically not if we're in a web worker, or react-native.\n if (utils.isStandardBrowserEnv()) {\n // Add xsrf header\n var xsrfValue = (config.withCredentials || isURLSameOrigin(fullPath)) && config.xsrfCookieName ?\n cookies.read(config.xsrfCookieName) :\n undefined;\n\n if (xsrfValue) {\n requestHeaders[config.xsrfHeaderName] = xsrfValue;\n }\n }\n\n // Add headers to the request\n if ('setRequestHeader' in request) {\n utils.forEach(requestHeaders, function setRequestHeader(val, key) {\n if (typeof requestData === 'undefined' && key.toLowerCase() === 'content-type') {\n // Remove Content-Type if data is undefined\n delete requestHeaders[key];\n } else {\n // Otherwise add header to the request\n request.setRequestHeader(key, val);\n }\n });\n }\n\n // Add withCredentials to request if needed\n if (!utils.isUndefined(config.withCredentials)) {\n request.withCredentials = !!config.withCredentials;\n }\n\n // Add responseType to request if needed\n if (responseType && responseType !== 'json') {\n request.responseType = config.responseType;\n }\n\n // Handle progress if needed\n if (typeof config.onDownloadProgress === 'function') {\n request.addEventListener('progress', config.onDownloadProgress);\n }\n\n // Not all browsers support upload events\n if (typeof config.onUploadProgress === 'function' && request.upload) {\n request.upload.addEventListener('progress', config.onUploadProgress);\n }\n\n if (config.cancelToken) {\n // Handle cancellation\n config.cancelToken.promise.then(function onCanceled(cancel) {\n if (!request) {\n return;\n }\n\n request.abort();\n reject(cancel);\n // Clean up request\n request = null;\n });\n }\n\n if (!requestData) {\n requestData = null;\n }\n\n // Send the request\n request.send(requestData);\n });\n};\n","'use strict';\n\nvar utils = require('./utils');\nvar bind = require('./helpers/bind');\nvar Axios = require('./core/Axios');\nvar mergeConfig = require('./core/mergeConfig');\nvar defaults = require('./defaults');\n\n/**\n * Create an instance of Axios\n *\n * @param {Object} defaultConfig The default config for the instance\n * @return {Axios} A new instance of Axios\n */\nfunction createInstance(defaultConfig) {\n var context = new Axios(defaultConfig);\n var instance = bind(Axios.prototype.request, context);\n\n // Copy axios.prototype to instance\n utils.extend(instance, Axios.prototype, context);\n\n // Copy context to instance\n utils.extend(instance, context);\n\n return instance;\n}\n\n// Create the default instance to be exported\nvar axios = createInstance(defaults);\n\n// Expose Axios class to allow class inheritance\naxios.Axios = Axios;\n\n// Factory for creating new instances\naxios.create = function create(instanceConfig) {\n return createInstance(mergeConfig(axios.defaults, instanceConfig));\n};\n\n// Expose Cancel & CancelToken\naxios.Cancel = require('./cancel/Cancel');\naxios.CancelToken = require('./cancel/CancelToken');\naxios.isCancel = require('./cancel/isCancel');\n\n// Expose all/spread\naxios.all = function all(promises) {\n return Promise.all(promises);\n};\naxios.spread = require('./helpers/spread');\n\n// Expose isAxiosError\naxios.isAxiosError = require('./helpers/isAxiosError');\n\nmodule.exports = axios;\n\n// Allow use of default import syntax in TypeScript\nmodule.exports.default = axios;\n","'use strict';\n\n/**\n * A `Cancel` is an object that is thrown when an operation is canceled.\n *\n * @class\n * @param {string=} message The message.\n */\nfunction Cancel(message) {\n this.message = message;\n}\n\nCancel.prototype.toString = function toString() {\n return 'Cancel' + (this.message ? ': ' + this.message : '');\n};\n\nCancel.prototype.__CANCEL__ = true;\n\nmodule.exports = Cancel;\n","'use strict';\n\nvar Cancel = require('./Cancel');\n\n/**\n * A `CancelToken` is an object that can be used to request cancellation of an operation.\n *\n * @class\n * @param {Function} executor The executor function.\n */\nfunction CancelToken(executor) {\n if (typeof executor !== 'function') {\n throw new TypeError('executor must be a function.');\n }\n\n var resolvePromise;\n this.promise = new Promise(function promiseExecutor(resolve) {\n resolvePromise = resolve;\n });\n\n var token = this;\n executor(function cancel(message) {\n if (token.reason) {\n // Cancellation has already been requested\n return;\n }\n\n token.reason = new Cancel(message);\n resolvePromise(token.reason);\n });\n}\n\n/**\n * Throws a `Cancel` if cancellation has been requested.\n */\nCancelToken.prototype.throwIfRequested = function throwIfRequested() {\n if (this.reason) {\n throw this.reason;\n }\n};\n\n/**\n * Returns an object that contains a new `CancelToken` and a function that, when called,\n * cancels the `CancelToken`.\n */\nCancelToken.source = function source() {\n var cancel;\n var token = new CancelToken(function executor(c) {\n cancel = c;\n });\n return {\n token: token,\n cancel: cancel\n };\n};\n\nmodule.exports = CancelToken;\n","'use strict';\n\nmodule.exports = function isCancel(value) {\n return !!(value && value.__CANCEL__);\n};\n","'use strict';\n\nvar utils = require('./../utils');\nvar buildURL = require('../helpers/buildURL');\nvar InterceptorManager = require('./InterceptorManager');\nvar dispatchRequest = require('./dispatchRequest');\nvar mergeConfig = require('./mergeConfig');\nvar validator = require('../helpers/validator');\n\nvar validators = validator.validators;\n/**\n * Create a new instance of Axios\n *\n * @param {Object} instanceConfig The default config for the instance\n */\nfunction Axios(instanceConfig) {\n this.defaults = instanceConfig;\n this.interceptors = {\n request: new InterceptorManager(),\n response: new InterceptorManager()\n };\n}\n\n/**\n * Dispatch a request\n *\n * @param {Object} config The config specific for this request (merged with this.defaults)\n */\nAxios.prototype.request = function request(config) {\n /*eslint no-param-reassign:0*/\n // Allow for axios('example/url'[, config]) a la fetch API\n if (typeof config === 'string') {\n config = arguments[1] || {};\n config.url = arguments[0];\n } else {\n config = config || {};\n }\n\n config = mergeConfig(this.defaults, config);\n\n // Set config.method\n if (config.method) {\n config.method = config.method.toLowerCase();\n } else if (this.defaults.method) {\n config.method = this.defaults.method.toLowerCase();\n } else {\n config.method = 'get';\n }\n\n var transitional = config.transitional;\n\n if (transitional !== undefined) {\n validator.assertOptions(transitional, {\n silentJSONParsing: validators.transitional(validators.boolean, '1.0.0'),\n forcedJSONParsing: validators.transitional(validators.boolean, '1.0.0'),\n clarifyTimeoutError: validators.transitional(validators.boolean, '1.0.0')\n }, false);\n }\n\n // filter out skipped interceptors\n var requestInterceptorChain = [];\n var synchronousRequestInterceptors = true;\n this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {\n if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) {\n return;\n }\n\n synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;\n\n requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);\n });\n\n var responseInterceptorChain = [];\n this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {\n responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);\n });\n\n var promise;\n\n if (!synchronousRequestInterceptors) {\n var chain = [dispatchRequest, undefined];\n\n Array.prototype.unshift.apply(chain, requestInterceptorChain);\n chain = chain.concat(responseInterceptorChain);\n\n promise = Promise.resolve(config);\n while (chain.length) {\n promise = promise.then(chain.shift(), chain.shift());\n }\n\n return promise;\n }\n\n\n var newConfig = config;\n while (requestInterceptorChain.length) {\n var onFulfilled = requestInterceptorChain.shift();\n var onRejected = requestInterceptorChain.shift();\n try {\n newConfig = onFulfilled(newConfig);\n } catch (error) {\n onRejected(error);\n break;\n }\n }\n\n try {\n promise = dispatchRequest(newConfig);\n } catch (error) {\n return Promise.reject(error);\n }\n\n while (responseInterceptorChain.length) {\n promise = promise.then(responseInterceptorChain.shift(), responseInterceptorChain.shift());\n }\n\n return promise;\n};\n\nAxios.prototype.getUri = function getUri(config) {\n config = mergeConfig(this.defaults, config);\n return buildURL(config.url, config.params, config.paramsSerializer).replace(/^\\?/, '');\n};\n\n// Provide aliases for supported request methods\nutils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, config) {\n return this.request(mergeConfig(config || {}, {\n method: method,\n url: url,\n data: (config || {}).data\n }));\n };\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, data, config) {\n return this.request(mergeConfig(config || {}, {\n method: method,\n url: url,\n data: data\n }));\n };\n});\n\nmodule.exports = Axios;\n","'use strict';\n\nvar utils = require('./../utils');\n\nfunction InterceptorManager() {\n this.handlers = [];\n}\n\n/**\n * Add a new interceptor to the stack\n *\n * @param {Function} fulfilled The function to handle `then` for a `Promise`\n * @param {Function} rejected The function to handle `reject` for a `Promise`\n *\n * @return {Number} An ID used to remove interceptor later\n */\nInterceptorManager.prototype.use = function use(fulfilled, rejected, options) {\n this.handlers.push({\n fulfilled: fulfilled,\n rejected: rejected,\n synchronous: options ? options.synchronous : false,\n runWhen: options ? options.runWhen : null\n });\n return this.handlers.length - 1;\n};\n\n/**\n * Remove an interceptor from the stack\n *\n * @param {Number} id The ID that was returned by `use`\n */\nInterceptorManager.prototype.eject = function eject(id) {\n if (this.handlers[id]) {\n this.handlers[id] = null;\n }\n};\n\n/**\n * Iterate over all the registered interceptors\n *\n * This method is particularly useful for skipping over any\n * interceptors that may have become `null` calling `eject`.\n *\n * @param {Function} fn The function to call for each interceptor\n */\nInterceptorManager.prototype.forEach = function forEach(fn) {\n utils.forEach(this.handlers, function forEachHandler(h) {\n if (h !== null) {\n fn(h);\n }\n });\n};\n\nmodule.exports = InterceptorManager;\n","'use strict';\n\nvar isAbsoluteURL = require('../helpers/isAbsoluteURL');\nvar combineURLs = require('../helpers/combineURLs');\n\n/**\n * Creates a new URL by combining the baseURL with the requestedURL,\n * only when the requestedURL is not already an absolute URL.\n * If the requestURL is absolute, this function returns the requestedURL untouched.\n *\n * @param {string} baseURL The base URL\n * @param {string} requestedURL Absolute or relative URL to combine\n * @returns {string} The combined full path\n */\nmodule.exports = function buildFullPath(baseURL, requestedURL) {\n if (baseURL && !isAbsoluteURL(requestedURL)) {\n return combineURLs(baseURL, requestedURL);\n }\n return requestedURL;\n};\n","'use strict';\n\nvar enhanceError = require('./enhanceError');\n\n/**\n * Create an Error with the specified message, config, error code, request and response.\n *\n * @param {string} message The error message.\n * @param {Object} config The config.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n * @returns {Error} The created error.\n */\nmodule.exports = function createError(message, config, code, request, response) {\n var error = new Error(message);\n return enhanceError(error, config, code, request, response);\n};\n","'use strict';\n\nvar utils = require('./../utils');\nvar transformData = require('./transformData');\nvar isCancel = require('../cancel/isCancel');\nvar defaults = require('../defaults');\n\n/**\n * Throws a `Cancel` if cancellation has been requested.\n */\nfunction throwIfCancellationRequested(config) {\n if (config.cancelToken) {\n config.cancelToken.throwIfRequested();\n }\n}\n\n/**\n * Dispatch a request to the server using the configured adapter.\n *\n * @param {object} config The config that is to be used for the request\n * @returns {Promise} The Promise to be fulfilled\n */\nmodule.exports = function dispatchRequest(config) {\n throwIfCancellationRequested(config);\n\n // Ensure headers exist\n config.headers = config.headers || {};\n\n // Transform request data\n config.data = transformData.call(\n config,\n config.data,\n config.headers,\n config.transformRequest\n );\n\n // Flatten headers\n config.headers = utils.merge(\n config.headers.common || {},\n config.headers[config.method] || {},\n config.headers\n );\n\n utils.forEach(\n ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],\n function cleanHeaderConfig(method) {\n delete config.headers[method];\n }\n );\n\n var adapter = config.adapter || defaults.adapter;\n\n return adapter(config).then(function onAdapterResolution(response) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n response.data = transformData.call(\n config,\n response.data,\n response.headers,\n config.transformResponse\n );\n\n return response;\n }, function onAdapterRejection(reason) {\n if (!isCancel(reason)) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n if (reason && reason.response) {\n reason.response.data = transformData.call(\n config,\n reason.response.data,\n reason.response.headers,\n config.transformResponse\n );\n }\n }\n\n return Promise.reject(reason);\n });\n};\n","'use strict';\n\n/**\n * Update an Error with the specified config, error code, and response.\n *\n * @param {Error} error The error to update.\n * @param {Object} config The config.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n * @returns {Error} The error.\n */\nmodule.exports = function enhanceError(error, config, code, request, response) {\n error.config = config;\n if (code) {\n error.code = code;\n }\n\n error.request = request;\n error.response = response;\n error.isAxiosError = true;\n\n error.toJSON = function toJSON() {\n return {\n // Standard\n message: this.message,\n name: this.name,\n // Microsoft\n description: this.description,\n number: this.number,\n // Mozilla\n fileName: this.fileName,\n lineNumber: this.lineNumber,\n columnNumber: this.columnNumber,\n stack: this.stack,\n // Axios\n config: this.config,\n code: this.code\n };\n };\n return error;\n};\n","'use strict';\n\nvar utils = require('../utils');\n\n/**\n * Config-specific merge-function which creates a new config-object\n * by merging two configuration objects together.\n *\n * @param {Object} config1\n * @param {Object} config2\n * @returns {Object} New object resulting from merging config2 to config1\n */\nmodule.exports = function mergeConfig(config1, config2) {\n // eslint-disable-next-line no-param-reassign\n config2 = config2 || {};\n var config = {};\n\n var valueFromConfig2Keys = ['url', 'method', 'data'];\n var mergeDeepPropertiesKeys = ['headers', 'auth', 'proxy', 'params'];\n var defaultToConfig2Keys = [\n 'baseURL', 'transformRequest', 'transformResponse', 'paramsSerializer',\n 'timeout', 'timeoutMessage', 'withCredentials', 'adapter', 'responseType', 'xsrfCookieName',\n 'xsrfHeaderName', 'onUploadProgress', 'onDownloadProgress', 'decompress',\n 'maxContentLength', 'maxBodyLength', 'maxRedirects', 'transport', 'httpAgent',\n 'httpsAgent', 'cancelToken', 'socketPath', 'responseEncoding'\n ];\n var directMergeKeys = ['validateStatus'];\n\n function getMergedValue(target, source) {\n if (utils.isPlainObject(target) && utils.isPlainObject(source)) {\n return utils.merge(target, source);\n } else if (utils.isPlainObject(source)) {\n return utils.merge({}, source);\n } else if (utils.isArray(source)) {\n return source.slice();\n }\n return source;\n }\n\n function mergeDeepProperties(prop) {\n if (!utils.isUndefined(config2[prop])) {\n config[prop] = getMergedValue(config1[prop], config2[prop]);\n } else if (!utils.isUndefined(config1[prop])) {\n config[prop] = getMergedValue(undefined, config1[prop]);\n }\n }\n\n utils.forEach(valueFromConfig2Keys, function valueFromConfig2(prop) {\n if (!utils.isUndefined(config2[prop])) {\n config[prop] = getMergedValue(undefined, config2[prop]);\n }\n });\n\n utils.forEach(mergeDeepPropertiesKeys, mergeDeepProperties);\n\n utils.forEach(defaultToConfig2Keys, function defaultToConfig2(prop) {\n if (!utils.isUndefined(config2[prop])) {\n config[prop] = getMergedValue(undefined, config2[prop]);\n } else if (!utils.isUndefined(config1[prop])) {\n config[prop] = getMergedValue(undefined, config1[prop]);\n }\n });\n\n utils.forEach(directMergeKeys, function merge(prop) {\n if (prop in config2) {\n config[prop] = getMergedValue(config1[prop], config2[prop]);\n } else if (prop in config1) {\n config[prop] = getMergedValue(undefined, config1[prop]);\n }\n });\n\n var axiosKeys = valueFromConfig2Keys\n .concat(mergeDeepPropertiesKeys)\n .concat(defaultToConfig2Keys)\n .concat(directMergeKeys);\n\n var otherKeys = Object\n .keys(config1)\n .concat(Object.keys(config2))\n .filter(function filterAxiosKeys(key) {\n return axiosKeys.indexOf(key) === -1;\n });\n\n utils.forEach(otherKeys, mergeDeepProperties);\n\n return config;\n};\n","'use strict';\n\nvar createError = require('./createError');\n\n/**\n * Resolve or reject a Promise based on response status.\n *\n * @param {Function} resolve A function that resolves the promise.\n * @param {Function} reject A function that rejects the promise.\n * @param {object} response The response.\n */\nmodule.exports = function settle(resolve, reject, response) {\n var validateStatus = response.config.validateStatus;\n if (!response.status || !validateStatus || validateStatus(response.status)) {\n resolve(response);\n } else {\n reject(createError(\n 'Request failed with status code ' + response.status,\n response.config,\n null,\n response.request,\n response\n ));\n }\n};\n","'use strict';\n\nvar utils = require('./../utils');\nvar defaults = require('./../defaults');\n\n/**\n * Transform the data for a request or a response\n *\n * @param {Object|String} data The data to be transformed\n * @param {Array} headers The headers for the request or response\n * @param {Array|Function} fns A single function or Array of functions\n * @returns {*} The resulting transformed data\n */\nmodule.exports = function transformData(data, headers, fns) {\n var context = this || defaults;\n /*eslint no-param-reassign:0*/\n utils.forEach(fns, function transform(fn) {\n data = fn.call(context, data, headers);\n });\n\n return data;\n};\n","'use strict';\n\nvar utils = require('./utils');\nvar normalizeHeaderName = require('./helpers/normalizeHeaderName');\nvar enhanceError = require('./core/enhanceError');\n\nvar DEFAULT_CONTENT_TYPE = {\n 'Content-Type': 'application/x-www-form-urlencoded'\n};\n\nfunction setContentTypeIfUnset(headers, value) {\n if (!utils.isUndefined(headers) && utils.isUndefined(headers['Content-Type'])) {\n headers['Content-Type'] = value;\n }\n}\n\nfunction getDefaultAdapter() {\n var adapter;\n if (typeof XMLHttpRequest !== 'undefined') {\n // For browsers use XHR adapter\n adapter = require('./adapters/xhr');\n } else if (typeof process !== 'undefined' && Object.prototype.toString.call(process) === '[object process]') {\n // For node use HTTP adapter\n adapter = require('./adapters/http');\n }\n return adapter;\n}\n\nfunction stringifySafely(rawValue, parser, encoder) {\n if (utils.isString(rawValue)) {\n try {\n (parser || JSON.parse)(rawValue);\n return utils.trim(rawValue);\n } catch (e) {\n if (e.name !== 'SyntaxError') {\n throw e;\n }\n }\n }\n\n return (encoder || JSON.stringify)(rawValue);\n}\n\nvar defaults = {\n\n transitional: {\n silentJSONParsing: true,\n forcedJSONParsing: true,\n clarifyTimeoutError: false\n },\n\n adapter: getDefaultAdapter(),\n\n transformRequest: [function transformRequest(data, headers) {\n normalizeHeaderName(headers, 'Accept');\n normalizeHeaderName(headers, 'Content-Type');\n\n if (utils.isFormData(data) ||\n utils.isArrayBuffer(data) ||\n utils.isBuffer(data) ||\n utils.isStream(data) ||\n utils.isFile(data) ||\n utils.isBlob(data)\n ) {\n return data;\n }\n if (utils.isArrayBufferView(data)) {\n return data.buffer;\n }\n if (utils.isURLSearchParams(data)) {\n setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8');\n return data.toString();\n }\n if (utils.isObject(data) || (headers && headers['Content-Type'] === 'application/json')) {\n setContentTypeIfUnset(headers, 'application/json');\n return stringifySafely(data);\n }\n return data;\n }],\n\n transformResponse: [function transformResponse(data) {\n var transitional = this.transitional;\n var silentJSONParsing = transitional && transitional.silentJSONParsing;\n var forcedJSONParsing = transitional && transitional.forcedJSONParsing;\n var strictJSONParsing = !silentJSONParsing && this.responseType === 'json';\n\n if (strictJSONParsing || (forcedJSONParsing && utils.isString(data) && data.length)) {\n try {\n return JSON.parse(data);\n } catch (e) {\n if (strictJSONParsing) {\n if (e.name === 'SyntaxError') {\n throw enhanceError(e, this, 'E_JSON_PARSE');\n }\n throw e;\n }\n }\n }\n\n return data;\n }],\n\n /**\n * A timeout in milliseconds to abort a request. If set to 0 (default) a\n * timeout is not created.\n */\n timeout: 0,\n\n xsrfCookieName: 'XSRF-TOKEN',\n xsrfHeaderName: 'X-XSRF-TOKEN',\n\n maxContentLength: -1,\n maxBodyLength: -1,\n\n validateStatus: function validateStatus(status) {\n return status >= 200 && status < 300;\n }\n};\n\ndefaults.headers = {\n common: {\n 'Accept': 'application/json, text/plain, */*'\n }\n};\n\nutils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) {\n defaults.headers[method] = {};\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE);\n});\n\nmodule.exports = defaults;\n","'use strict';\n\nmodule.exports = function bind(fn, thisArg) {\n return function wrap() {\n var args = new Array(arguments.length);\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i];\n }\n return fn.apply(thisArg, args);\n };\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\nfunction encode(val) {\n return encodeURIComponent(val).\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%20/g, '+').\n replace(/%5B/gi, '[').\n replace(/%5D/gi, ']');\n}\n\n/**\n * Build a URL by appending params to the end\n *\n * @param {string} url The base of the url (e.g., http://www.google.com)\n * @param {object} [params] The params to be appended\n * @returns {string} The formatted url\n */\nmodule.exports = function buildURL(url, params, paramsSerializer) {\n /*eslint no-param-reassign:0*/\n if (!params) {\n return url;\n }\n\n var serializedParams;\n if (paramsSerializer) {\n serializedParams = paramsSerializer(params);\n } else if (utils.isURLSearchParams(params)) {\n serializedParams = params.toString();\n } else {\n var parts = [];\n\n utils.forEach(params, function serialize(val, key) {\n if (val === null || typeof val === 'undefined') {\n return;\n }\n\n if (utils.isArray(val)) {\n key = key + '[]';\n } else {\n val = [val];\n }\n\n utils.forEach(val, function parseValue(v) {\n if (utils.isDate(v)) {\n v = v.toISOString();\n } else if (utils.isObject(v)) {\n v = JSON.stringify(v);\n }\n parts.push(encode(key) + '=' + encode(v));\n });\n });\n\n serializedParams = parts.join('&');\n }\n\n if (serializedParams) {\n var hashmarkIndex = url.indexOf('#');\n if (hashmarkIndex !== -1) {\n url = url.slice(0, hashmarkIndex);\n }\n\n url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;\n }\n\n return url;\n};\n","'use strict';\n\n/**\n * Creates a new URL by combining the specified URLs\n *\n * @param {string} baseURL The base URL\n * @param {string} relativeURL The relative URL\n * @returns {string} The combined URL\n */\nmodule.exports = function combineURLs(baseURL, relativeURL) {\n return relativeURL\n ? baseURL.replace(/\\/+$/, '') + '/' + relativeURL.replace(/^\\/+/, '')\n : baseURL;\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\nmodule.exports = (\n utils.isStandardBrowserEnv() ?\n\n // Standard browser envs support document.cookie\n (function standardBrowserEnv() {\n return {\n write: function write(name, value, expires, path, domain, secure) {\n var cookie = [];\n cookie.push(name + '=' + encodeURIComponent(value));\n\n if (utils.isNumber(expires)) {\n cookie.push('expires=' + new Date(expires).toGMTString());\n }\n\n if (utils.isString(path)) {\n cookie.push('path=' + path);\n }\n\n if (utils.isString(domain)) {\n cookie.push('domain=' + domain);\n }\n\n if (secure === true) {\n cookie.push('secure');\n }\n\n document.cookie = cookie.join('; ');\n },\n\n read: function read(name) {\n var match = document.cookie.match(new RegExp('(^|;\\\\s*)(' + name + ')=([^;]*)'));\n return (match ? decodeURIComponent(match[3]) : null);\n },\n\n remove: function remove(name) {\n this.write(name, '', Date.now() - 86400000);\n }\n };\n })() :\n\n // Non standard browser env (web workers, react-native) lack needed support.\n (function nonStandardBrowserEnv() {\n return {\n write: function write() {},\n read: function read() { return null; },\n remove: function remove() {}\n };\n })()\n);\n","'use strict';\n\n/**\n * Determines whether the specified URL is absolute\n *\n * @param {string} url The URL to test\n * @returns {boolean} True if the specified URL is absolute, otherwise false\n */\nmodule.exports = function isAbsoluteURL(url) {\n // A URL is considered absolute if it begins with \"://\" or \"//\" (protocol-relative URL).\n // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed\n // by any combination of letters, digits, plus, period, or hyphen.\n return /^([a-z][a-z\\d\\+\\-\\.]*:)?\\/\\//i.test(url);\n};\n","'use strict';\n\n/**\n * Determines whether the payload is an error thrown by Axios\n *\n * @param {*} payload The value to test\n * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false\n */\nmodule.exports = function isAxiosError(payload) {\n return (typeof payload === 'object') && (payload.isAxiosError === true);\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\nmodule.exports = (\n utils.isStandardBrowserEnv() ?\n\n // Standard browser envs have full support of the APIs needed to test\n // whether the request URL is of the same origin as current location.\n (function standardBrowserEnv() {\n var msie = /(msie|trident)/i.test(navigator.userAgent);\n var urlParsingNode = document.createElement('a');\n var originURL;\n\n /**\n * Parse a URL to discover it's components\n *\n * @param {String} url The URL to be parsed\n * @returns {Object}\n */\n function resolveURL(url) {\n var href = url;\n\n if (msie) {\n // IE needs attribute set twice to normalize properties\n urlParsingNode.setAttribute('href', href);\n href = urlParsingNode.href;\n }\n\n urlParsingNode.setAttribute('href', href);\n\n // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils\n return {\n href: urlParsingNode.href,\n protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',\n host: urlParsingNode.host,\n search: urlParsingNode.search ? urlParsingNode.search.replace(/^\\?/, '') : '',\n hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',\n hostname: urlParsingNode.hostname,\n port: urlParsingNode.port,\n pathname: (urlParsingNode.pathname.charAt(0) === '/') ?\n urlParsingNode.pathname :\n '/' + urlParsingNode.pathname\n };\n }\n\n originURL = resolveURL(window.location.href);\n\n /**\n * Determine if a URL shares the same origin as the current location\n *\n * @param {String} requestURL The URL to test\n * @returns {boolean} True if URL shares the same origin, otherwise false\n */\n return function isURLSameOrigin(requestURL) {\n var parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL;\n return (parsed.protocol === originURL.protocol &&\n parsed.host === originURL.host);\n };\n })() :\n\n // Non standard browser envs (web workers, react-native) lack needed support.\n (function nonStandardBrowserEnv() {\n return function isURLSameOrigin() {\n return true;\n };\n })()\n);\n","'use strict';\n\nvar utils = require('../utils');\n\nmodule.exports = function normalizeHeaderName(headers, normalizedName) {\n utils.forEach(headers, function processHeader(value, name) {\n if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) {\n headers[normalizedName] = value;\n delete headers[name];\n }\n });\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\n// Headers whose duplicates are ignored by node\n// c.f. https://nodejs.org/api/http.html#http_message_headers\nvar ignoreDuplicateOf = [\n 'age', 'authorization', 'content-length', 'content-type', 'etag',\n 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',\n 'last-modified', 'location', 'max-forwards', 'proxy-authorization',\n 'referer', 'retry-after', 'user-agent'\n];\n\n/**\n * Parse headers into an object\n *\n * ```\n * Date: Wed, 27 Aug 2014 08:58:49 GMT\n * Content-Type: application/json\n * Connection: keep-alive\n * Transfer-Encoding: chunked\n * ```\n *\n * @param {String} headers Headers needing to be parsed\n * @returns {Object} Headers parsed into an object\n */\nmodule.exports = function parseHeaders(headers) {\n var parsed = {};\n var key;\n var val;\n var i;\n\n if (!headers) { return parsed; }\n\n utils.forEach(headers.split('\\n'), function parser(line) {\n i = line.indexOf(':');\n key = utils.trim(line.substr(0, i)).toLowerCase();\n val = utils.trim(line.substr(i + 1));\n\n if (key) {\n if (parsed[key] && ignoreDuplicateOf.indexOf(key) >= 0) {\n return;\n }\n if (key === 'set-cookie') {\n parsed[key] = (parsed[key] ? parsed[key] : []).concat([val]);\n } else {\n parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;\n }\n }\n });\n\n return parsed;\n};\n","'use strict';\n\n/**\n * Syntactic sugar for invoking a function and expanding an array for arguments.\n *\n * Common use case would be to use `Function.prototype.apply`.\n *\n * ```js\n * function f(x, y, z) {}\n * var args = [1, 2, 3];\n * f.apply(null, args);\n * ```\n *\n * With `spread` this example can be re-written.\n *\n * ```js\n * spread(function(x, y, z) {})([1, 2, 3]);\n * ```\n *\n * @param {Function} callback\n * @returns {Function}\n */\nmodule.exports = function spread(callback) {\n return function wrap(arr) {\n return callback.apply(null, arr);\n };\n};\n","'use strict';\n\nvar pkg = require('./../../package.json');\n\nvar validators = {};\n\n// eslint-disable-next-line func-names\n['object', 'boolean', 'number', 'function', 'string', 'symbol'].forEach(function(type, i) {\n validators[type] = function validator(thing) {\n return typeof thing === type || 'a' + (i < 1 ? 'n ' : ' ') + type;\n };\n});\n\nvar deprecatedWarnings = {};\nvar currentVerArr = pkg.version.split('.');\n\n/**\n * Compare package versions\n * @param {string} version\n * @param {string?} thanVersion\n * @returns {boolean}\n */\nfunction isOlderVersion(version, thanVersion) {\n var pkgVersionArr = thanVersion ? thanVersion.split('.') : currentVerArr;\n var destVer = version.split('.');\n for (var i = 0; i < 3; i++) {\n if (pkgVersionArr[i] > destVer[i]) {\n return true;\n } else if (pkgVersionArr[i] < destVer[i]) {\n return false;\n }\n }\n return false;\n}\n\n/**\n * Transitional option validator\n * @param {function|boolean?} validator\n * @param {string?} version\n * @param {string} message\n * @returns {function}\n */\nvalidators.transitional = function transitional(validator, version, message) {\n var isDeprecated = version && isOlderVersion(version);\n\n function formatMessage(opt, desc) {\n return '[Axios v' + pkg.version + '] Transitional option \\'' + opt + '\\'' + desc + (message ? '. ' + message : '');\n }\n\n // eslint-disable-next-line func-names\n return function(value, opt, opts) {\n if (validator === false) {\n throw new Error(formatMessage(opt, ' has been removed in ' + version));\n }\n\n if (isDeprecated && !deprecatedWarnings[opt]) {\n deprecatedWarnings[opt] = true;\n // eslint-disable-next-line no-console\n console.warn(\n formatMessage(\n opt,\n ' has been deprecated since v' + version + ' and will be removed in the near future'\n )\n );\n }\n\n return validator ? validator(value, opt, opts) : true;\n };\n};\n\n/**\n * Assert object's properties type\n * @param {object} options\n * @param {object} schema\n * @param {boolean?} allowUnknown\n */\n\nfunction assertOptions(options, schema, allowUnknown) {\n if (typeof options !== 'object') {\n throw new TypeError('options must be an object');\n }\n var keys = Object.keys(options);\n var i = keys.length;\n while (i-- > 0) {\n var opt = keys[i];\n var validator = schema[opt];\n if (validator) {\n var value = options[opt];\n var result = value === undefined || validator(value, opt, options);\n if (result !== true) {\n throw new TypeError('option ' + opt + ' must be ' + result);\n }\n continue;\n }\n if (allowUnknown !== true) {\n throw Error('Unknown option ' + opt);\n }\n }\n}\n\nmodule.exports = {\n isOlderVersion: isOlderVersion,\n assertOptions: assertOptions,\n validators: validators\n};\n","'use strict';\n\nvar bind = require('./helpers/bind');\n\n// utils is a library of generic helper functions non-specific to axios\n\nvar toString = Object.prototype.toString;\n\n/**\n * Determine if a value is an Array\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an Array, otherwise false\n */\nfunction isArray(val) {\n return toString.call(val) === '[object Array]';\n}\n\n/**\n * Determine if a value is undefined\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if the value is undefined, otherwise false\n */\nfunction isUndefined(val) {\n return typeof val === 'undefined';\n}\n\n/**\n * Determine if a value is a Buffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Buffer, otherwise false\n */\nfunction isBuffer(val) {\n return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor)\n && typeof val.constructor.isBuffer === 'function' && val.constructor.isBuffer(val);\n}\n\n/**\n * Determine if a value is an ArrayBuffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an ArrayBuffer, otherwise false\n */\nfunction isArrayBuffer(val) {\n return toString.call(val) === '[object ArrayBuffer]';\n}\n\n/**\n * Determine if a value is a FormData\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an FormData, otherwise false\n */\nfunction isFormData(val) {\n return (typeof FormData !== 'undefined') && (val instanceof FormData);\n}\n\n/**\n * Determine if a value is a view on an ArrayBuffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false\n */\nfunction isArrayBufferView(val) {\n var result;\n if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {\n result = ArrayBuffer.isView(val);\n } else {\n result = (val) && (val.buffer) && (val.buffer instanceof ArrayBuffer);\n }\n return result;\n}\n\n/**\n * Determine if a value is a String\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a String, otherwise false\n */\nfunction isString(val) {\n return typeof val === 'string';\n}\n\n/**\n * Determine if a value is a Number\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Number, otherwise false\n */\nfunction isNumber(val) {\n return typeof val === 'number';\n}\n\n/**\n * Determine if a value is an Object\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an Object, otherwise false\n */\nfunction isObject(val) {\n return val !== null && typeof val === 'object';\n}\n\n/**\n * Determine if a value is a plain Object\n *\n * @param {Object} val The value to test\n * @return {boolean} True if value is a plain Object, otherwise false\n */\nfunction isPlainObject(val) {\n if (toString.call(val) !== '[object Object]') {\n return false;\n }\n\n var prototype = Object.getPrototypeOf(val);\n return prototype === null || prototype === Object.prototype;\n}\n\n/**\n * Determine if a value is a Date\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Date, otherwise false\n */\nfunction isDate(val) {\n return toString.call(val) === '[object Date]';\n}\n\n/**\n * Determine if a value is a File\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a File, otherwise false\n */\nfunction isFile(val) {\n return toString.call(val) === '[object File]';\n}\n\n/**\n * Determine if a value is a Blob\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Blob, otherwise false\n */\nfunction isBlob(val) {\n return toString.call(val) === '[object Blob]';\n}\n\n/**\n * Determine if a value is a Function\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Function, otherwise false\n */\nfunction isFunction(val) {\n return toString.call(val) === '[object Function]';\n}\n\n/**\n * Determine if a value is a Stream\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Stream, otherwise false\n */\nfunction isStream(val) {\n return isObject(val) && isFunction(val.pipe);\n}\n\n/**\n * Determine if a value is a URLSearchParams object\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a URLSearchParams object, otherwise false\n */\nfunction isURLSearchParams(val) {\n return typeof URLSearchParams !== 'undefined' && val instanceof URLSearchParams;\n}\n\n/**\n * Trim excess whitespace off the beginning and end of a string\n *\n * @param {String} str The String to trim\n * @returns {String} The String freed of excess whitespace\n */\nfunction trim(str) {\n return str.trim ? str.trim() : str.replace(/^\\s+|\\s+$/g, '');\n}\n\n/**\n * Determine if we're running in a standard browser environment\n *\n * This allows axios to run in a web worker, and react-native.\n * Both environments support XMLHttpRequest, but not fully standard globals.\n *\n * web workers:\n * typeof window -> undefined\n * typeof document -> undefined\n *\n * react-native:\n * navigator.product -> 'ReactNative'\n * nativescript\n * navigator.product -> 'NativeScript' or 'NS'\n */\nfunction isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}\n\n/**\n * Iterate over an Array or an Object invoking a function for each item.\n *\n * If `obj` is an Array callback will be called passing\n * the value, index, and complete array for each item.\n *\n * If 'obj' is an Object callback will be called passing\n * the value, key, and complete object for each property.\n *\n * @param {Object|Array} obj The object to iterate\n * @param {Function} fn The callback to invoke for each item\n */\nfunction forEach(obj, fn) {\n // Don't bother if no value provided\n if (obj === null || typeof obj === 'undefined') {\n return;\n }\n\n // Force an array if not already something iterable\n if (typeof obj !== 'object') {\n /*eslint no-param-reassign:0*/\n obj = [obj];\n }\n\n if (isArray(obj)) {\n // Iterate over array values\n for (var i = 0, l = obj.length; i < l; i++) {\n fn.call(null, obj[i], i, obj);\n }\n } else {\n // Iterate over object keys\n for (var key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key)) {\n fn.call(null, obj[key], key, obj);\n }\n }\n }\n}\n\n/**\n * Accepts varargs expecting each argument to be an object, then\n * immutably merges the properties of each object and returns result.\n *\n * When multiple objects contain the same key the later object in\n * the arguments list will take precedence.\n *\n * Example:\n *\n * ```js\n * var result = merge({foo: 123}, {foo: 456});\n * console.log(result.foo); // outputs 456\n * ```\n *\n * @param {Object} obj1 Object to merge\n * @returns {Object} Result of all merge properties\n */\nfunction merge(/* obj1, obj2, obj3, ... */) {\n var result = {};\n function assignValue(val, key) {\n if (isPlainObject(result[key]) && isPlainObject(val)) {\n result[key] = merge(result[key], val);\n } else if (isPlainObject(val)) {\n result[key] = merge({}, val);\n } else if (isArray(val)) {\n result[key] = val.slice();\n } else {\n result[key] = val;\n }\n }\n\n for (var i = 0, l = arguments.length; i < l; i++) {\n forEach(arguments[i], assignValue);\n }\n return result;\n}\n\n/**\n * Extends object a by mutably adding to it the properties of object b.\n *\n * @param {Object} a The object to be extended\n * @param {Object} b The object to copy properties from\n * @param {Object} thisArg The object to bind function to\n * @return {Object} The resulting value of object a\n */\nfunction extend(a, b, thisArg) {\n forEach(b, function assignValue(val, key) {\n if (thisArg && typeof val === 'function') {\n a[key] = bind(val, thisArg);\n } else {\n a[key] = val;\n }\n });\n return a;\n}\n\n/**\n * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM)\n *\n * @param {string} content with BOM\n * @return {string} content value without BOM\n */\nfunction stripBOM(content) {\n if (content.charCodeAt(0) === 0xFEFF) {\n content = content.slice(1);\n }\n return content;\n}\n\nmodule.exports = {\n isArray: isArray,\n isArrayBuffer: isArrayBuffer,\n isBuffer: isBuffer,\n isFormData: isFormData,\n isArrayBufferView: isArrayBufferView,\n isString: isString,\n isNumber: isNumber,\n isObject: isObject,\n isPlainObject: isPlainObject,\n isUndefined: isUndefined,\n isDate: isDate,\n isFile: isFile,\n isBlob: isBlob,\n isFunction: isFunction,\n isStream: isStream,\n isURLSearchParams: isURLSearchParams,\n isStandardBrowserEnv: isStandardBrowserEnv,\n forEach: forEach,\n merge: merge,\n extend: extend,\n trim: trim,\n stripBOM: stripBOM\n};\n"],"sourceRoot":""} \ No newline at end of file diff --git a/node_modules/xfarr-api/node_modules/axios/dist/axios.min.js b/node_modules/xfarr-api/node_modules/axios/dist/axios.min.js new file mode 100644 index 000000000..d5b138ad0 --- /dev/null +++ b/node_modules/xfarr-api/node_modules/axios/dist/axios.min.js @@ -0,0 +1,3 @@ +/* axios v0.21.4 | (c) 2021 by Matt Zabriskie */ +!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.axios=t():e.axios=t()}(window,(function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=10)}([function(e,t,r){"use strict";var n=r(2),o=Object.prototype.toString;function i(e){return"[object Array]"===o.call(e)}function s(e){return void 0===e}function a(e){return null!==e&&"object"==typeof e}function u(e){if("[object Object]"!==o.call(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}function c(e){return"[object Function]"===o.call(e)}function f(e,t){if(null!=e)if("object"!=typeof e&&(e=[e]),i(e))for(var r=0,n=e.length;r=200&&e<300}};c.headers={common:{Accept:"application/json, text/plain, */*"}},n.forEach(["delete","get","head"],(function(e){c.headers[e]={}})),n.forEach(["post","put","patch"],(function(e){c.headers[e]=n.merge(s)})),e.exports=c},function(e,t,r){"use strict";e.exports=function(e,t){return function(){for(var r=new Array(arguments.length),n=0;n=0)return;s[t]="set-cookie"===t?(s[t]?s[t]:[]).concat([r]):s[t]?s[t]+", "+r:r}})),s):s}},function(e,t,r){"use strict";var n=r(0);e.exports=n.isStandardBrowserEnv()?function(){var e,t=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a");function o(e){var n=e;return t&&(r.setAttribute("href",n),n=r.href),r.setAttribute("href",n),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:"/"===r.pathname.charAt(0)?r.pathname:"/"+r.pathname}}return e=o(window.location.href),function(t){var r=n.isString(t)?o(t):t;return r.protocol===e.protocol&&r.host===e.host}}():function(){return!0}},function(e,t,r){"use strict";var n=r(25),o={};["object","boolean","number","function","string","symbol"].forEach((function(e,t){o[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}}));var i={},s=n.version.split(".");function a(e,t){for(var r=t?t.split("."):s,n=e.split("."),o=0;o<3;o++){if(r[o]>n[o])return!0;if(r[o]0;){var i=n[o],s=t[i];if(s){var a=e[i],u=void 0===a||s(a,i,e);if(!0!==u)throw new TypeError("option "+i+" must be "+u)}else if(!0!==r)throw Error("Unknown option "+i)}},validators:o}},function(e){e.exports=JSON.parse('{"name":"axios","version":"0.21.4","description":"Promise based HTTP client for the browser and node.js","main":"index.js","scripts":{"test":"grunt test","start":"node ./sandbox/server.js","build":"NODE_ENV=production grunt build","preversion":"npm test","version":"npm run build && grunt version && git add -A dist && git add CHANGELOG.md bower.json package.json","postversion":"git push && git push --tags","examples":"node ./examples/server.js","coveralls":"cat coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js","fix":"eslint --fix lib/**/*.js"},"repository":{"type":"git","url":"https://github.com/axios/axios.git"},"keywords":["xhr","http","ajax","promise","node"],"author":"Matt Zabriskie","license":"MIT","bugs":{"url":"https://github.com/axios/axios/issues"},"homepage":"https://axios-http.com","devDependencies":{"coveralls":"^3.0.0","es6-promise":"^4.2.4","grunt":"^1.3.0","grunt-banner":"^0.6.0","grunt-cli":"^1.2.0","grunt-contrib-clean":"^1.1.0","grunt-contrib-watch":"^1.0.0","grunt-eslint":"^23.0.0","grunt-karma":"^4.0.0","grunt-mocha-test":"^0.13.3","grunt-ts":"^6.0.0-beta.19","grunt-webpack":"^4.0.2","istanbul-instrumenter-loader":"^1.0.0","jasmine-core":"^2.4.1","karma":"^6.3.2","karma-chrome-launcher":"^3.1.0","karma-firefox-launcher":"^2.1.0","karma-jasmine":"^1.1.1","karma-jasmine-ajax":"^0.1.13","karma-safari-launcher":"^1.0.0","karma-sauce-launcher":"^4.3.6","karma-sinon":"^1.0.5","karma-sourcemap-loader":"^0.3.8","karma-webpack":"^4.0.2","load-grunt-tasks":"^3.5.2","minimist":"^1.2.0","mocha":"^8.2.1","sinon":"^4.5.0","terser-webpack-plugin":"^4.2.3","typescript":"^4.0.5","url-search-params":"^0.10.0","webpack":"^4.44.2","webpack-dev-server":"^3.11.0"},"browser":{"./lib/adapters/http.js":"./lib/adapters/xhr.js"},"jsdelivr":"dist/axios.min.js","unpkg":"dist/axios.min.js","typings":"./index.d.ts","dependencies":{"follow-redirects":"^1.14.0"},"bundlesize":[{"path":"./dist/axios.min.js","threshold":"5kB"}]}')},function(e,t,r){"use strict";var n=r(9);function o(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise((function(e){t=e}));var r=this;e((function(e){r.reason||(r.reason=new n(e),t(r.reason))}))}o.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},o.source=function(){var e;return{token:new o((function(t){e=t})),cancel:e}},e.exports=o},function(e,t,r){"use strict";e.exports=function(e){return function(t){return e.apply(null,t)}}},function(e,t,r){"use strict";e.exports=function(e){return"object"==typeof e&&!0===e.isAxiosError}}])})); +//# sourceMappingURL=axios.min.map \ No newline at end of file diff --git a/node_modules/xfarr-api/node_modules/axios/dist/axios.min.map b/node_modules/xfarr-api/node_modules/axios/dist/axios.min.map new file mode 100644 index 000000000..468a5babc --- /dev/null +++ b/node_modules/xfarr-api/node_modules/axios/dist/axios.min.map @@ -0,0 +1 @@ +{"version":3,"sources":["webpack://axios/webpack/universalModuleDefinition","webpack://axios/webpack/bootstrap","webpack://axios/./lib/utils.js","webpack://axios/./lib/defaults.js","webpack://axios/./lib/helpers/bind.js","webpack://axios/./lib/helpers/buildURL.js","webpack://axios/./lib/core/enhanceError.js","webpack://axios/./lib/adapters/xhr.js","webpack://axios/./lib/core/createError.js","webpack://axios/./lib/cancel/isCancel.js","webpack://axios/./lib/core/mergeConfig.js","webpack://axios/./lib/cancel/Cancel.js","webpack://axios/./index.js","webpack://axios/./lib/axios.js","webpack://axios/./lib/core/Axios.js","webpack://axios/./lib/core/InterceptorManager.js","webpack://axios/./lib/core/dispatchRequest.js","webpack://axios/./lib/core/transformData.js","webpack://axios/./lib/helpers/normalizeHeaderName.js","webpack://axios/./lib/core/settle.js","webpack://axios/./lib/helpers/cookies.js","webpack://axios/./lib/core/buildFullPath.js","webpack://axios/./lib/helpers/isAbsoluteURL.js","webpack://axios/./lib/helpers/combineURLs.js","webpack://axios/./lib/helpers/parseHeaders.js","webpack://axios/./lib/helpers/isURLSameOrigin.js","webpack://axios/./lib/helpers/validator.js","webpack://axios/./lib/cancel/CancelToken.js","webpack://axios/./lib/helpers/spread.js","webpack://axios/./lib/helpers/isAxiosError.js"],"names":["root","factory","exports","module","define","amd","window","installedModules","__webpack_require__","moduleId","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","toString","isArray","val","isUndefined","isObject","isPlainObject","getPrototypeOf","isFunction","forEach","obj","fn","length","isArrayBuffer","isBuffer","constructor","isFormData","FormData","isArrayBufferView","ArrayBuffer","isView","buffer","isString","isNumber","isDate","isFile","isBlob","isStream","pipe","isURLSearchParams","URLSearchParams","isStandardBrowserEnv","navigator","product","document","merge","result","assignValue","slice","arguments","extend","a","b","thisArg","trim","str","replace","stripBOM","content","charCodeAt","utils","normalizeHeaderName","enhanceError","DEFAULT_CONTENT_TYPE","setContentTypeIfUnset","headers","adapter","defaults","transitional","silentJSONParsing","forcedJSONParsing","clarifyTimeoutError","XMLHttpRequest","process","transformRequest","data","rawValue","parser","encoder","JSON","parse","e","stringify","stringifySafely","transformResponse","this","strictJSONParsing","responseType","timeout","xsrfCookieName","xsrfHeaderName","maxContentLength","maxBodyLength","validateStatus","status","common","method","args","Array","apply","encode","encodeURIComponent","url","params","paramsSerializer","serializedParams","parts","v","toISOString","push","join","hashmarkIndex","indexOf","error","config","code","request","response","isAxiosError","toJSON","message","description","number","fileName","lineNumber","columnNumber","stack","settle","cookies","buildURL","buildFullPath","parseHeaders","isURLSameOrigin","createError","Promise","resolve","reject","requestData","requestHeaders","auth","username","password","unescape","Authorization","btoa","fullPath","baseURL","onloadend","responseHeaders","getAllResponseHeaders","responseText","statusText","open","toUpperCase","onreadystatechange","readyState","responseURL","setTimeout","onabort","onerror","ontimeout","timeoutErrorMessage","xsrfValue","withCredentials","read","undefined","toLowerCase","setRequestHeader","onDownloadProgress","addEventListener","onUploadProgress","upload","cancelToken","promise","then","cancel","abort","send","Error","__CANCEL__","config1","config2","valueFromConfig2Keys","mergeDeepPropertiesKeys","defaultToConfig2Keys","directMergeKeys","getMergedValue","target","source","mergeDeepProperties","prop","axiosKeys","concat","otherKeys","keys","filter","Cancel","Axios","mergeConfig","createInstance","defaultConfig","context","instance","axios","instanceConfig","CancelToken","isCancel","all","promises","spread","default","InterceptorManager","dispatchRequest","validator","validators","interceptors","assertOptions","boolean","requestInterceptorChain","synchronousRequestInterceptors","interceptor","runWhen","synchronous","unshift","fulfilled","rejected","responseInterceptorChain","chain","shift","newConfig","onFulfilled","onRejected","getUri","handlers","use","options","eject","id","h","transformData","throwIfCancellationRequested","throwIfRequested","reason","fns","normalizedName","write","expires","path","domain","secure","cookie","Date","toGMTString","match","RegExp","decodeURIComponent","remove","now","isAbsoluteURL","combineURLs","requestedURL","test","relativeURL","ignoreDuplicateOf","parsed","split","line","substr","originURL","msie","userAgent","urlParsingNode","createElement","resolveURL","href","setAttribute","protocol","host","search","hash","hostname","port","pathname","charAt","location","requestURL","pkg","type","thing","deprecatedWarnings","currentVerArr","version","isOlderVersion","thanVersion","pkgVersionArr","destVer","isDeprecated","formatMessage","opt","desc","opts","console","warn","schema","allowUnknown","TypeError","executor","resolvePromise","token","callback","arr","payload"],"mappings":"CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,IACQ,mBAAXG,QAAyBA,OAAOC,IAC9CD,OAAO,GAAIH,GACe,iBAAZC,QACdA,QAAe,MAAID,IAEnBD,EAAY,MAAIC,IARlB,CASGK,QAAQ,WACX,O,YCTE,IAAIC,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUP,QAGnC,IAAIC,EAASI,EAAiBE,GAAY,CACzCC,EAAGD,EACHE,GAAG,EACHT,QAAS,IAUV,OANAU,EAAQH,GAAUI,KAAKV,EAAOD,QAASC,EAAQA,EAAOD,QAASM,GAG/DL,EAAOQ,GAAI,EAGJR,EAAOD,QA0Df,OArDAM,EAAoBM,EAAIF,EAGxBJ,EAAoBO,EAAIR,EAGxBC,EAAoBQ,EAAI,SAASd,EAASe,EAAMC,GAC3CV,EAAoBW,EAAEjB,EAASe,IAClCG,OAAOC,eAAenB,EAASe,EAAM,CAAEK,YAAY,EAAMC,IAAKL,KAKhEV,EAAoBgB,EAAI,SAAStB,GACX,oBAAXuB,QAA0BA,OAAOC,aAC1CN,OAAOC,eAAenB,EAASuB,OAAOC,YAAa,CAAEC,MAAO,WAE7DP,OAAOC,eAAenB,EAAS,aAAc,CAAEyB,OAAO,KAQvDnB,EAAoBoB,EAAI,SAASD,EAAOE,GAEvC,GADU,EAAPA,IAAUF,EAAQnB,EAAoBmB,IAC/B,EAAPE,EAAU,OAAOF,EACpB,GAAW,EAAPE,GAA8B,iBAAVF,GAAsBA,GA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DCrGd,IAAIlB,EAAS,EAAQ,GAQrB,SAASS,EAAYqG,GACnB,GAAwB,mBAAbA,EACT,MAAM,IAAID,UAAU,gCAGtB,IAAIE,EACJ9N,KAAKwF,QAAU,IAAIvC,SAAQ,SAAyBC,GAClD4K,EAAiB5K,KAGnB,IAAI6K,EAAQ/N,KACZ6N,GAAS,SAAgB1L,GACnB4L,EAAMlE,SAKVkE,EAAMlE,OAAS,IAAI9C,EAAO5E,GAC1B2L,EAAeC,EAAMlE,YAOzBrC,EAAYtM,UAAU0O,iBAAmB,WACvC,GAAI5J,KAAK6J,OACP,MAAM7J,KAAK6J,QAQfrC,EAAYjB,OAAS,WACnB,IAAIb,EAIJ,MAAO,CACLqI,MAJU,IAAIvG,GAAY,SAAkB7N,GAC5C+L,EAAS/L,KAIT+L,OAAQA,IAIZ3M,EAAOD,QAAU0O,G,6BClCjBzO,EAAOD,QAAU,SAAgBkV,GAC/B,OAAO,SAAcC,GACnB,OAAOD,EAASlN,MAAM,KAAMmN,M,6BChBhClV,EAAOD,QAAU,SAAsBoV,GACrC,MAA2B,iBAAZA,IAAmD,IAAzBA,EAAQjM","file":"axios.min.js","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[\"axios\"] = factory();\n\telse\n\t\troot[\"axios\"] = factory();\n})(window, function() {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 10);\n","'use strict';\n\nvar bind = require('./helpers/bind');\n\n// utils is a library of generic helper functions non-specific to axios\n\nvar toString = Object.prototype.toString;\n\n/**\n * Determine if a value is an Array\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an Array, otherwise false\n */\nfunction isArray(val) {\n return toString.call(val) === '[object Array]';\n}\n\n/**\n * Determine if a value is undefined\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if the value is undefined, otherwise false\n */\nfunction isUndefined(val) {\n return typeof val === 'undefined';\n}\n\n/**\n * Determine if a value is a Buffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Buffer, otherwise false\n */\nfunction isBuffer(val) {\n return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor)\n && typeof val.constructor.isBuffer === 'function' && val.constructor.isBuffer(val);\n}\n\n/**\n * Determine if a value is an ArrayBuffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an ArrayBuffer, otherwise false\n */\nfunction isArrayBuffer(val) {\n return toString.call(val) === '[object ArrayBuffer]';\n}\n\n/**\n * Determine if a value is a FormData\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an FormData, otherwise false\n */\nfunction isFormData(val) {\n return (typeof FormData !== 'undefined') && (val instanceof FormData);\n}\n\n/**\n * Determine if a value is a view on an ArrayBuffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false\n */\nfunction isArrayBufferView(val) {\n var result;\n if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {\n result = ArrayBuffer.isView(val);\n } else {\n result = (val) && (val.buffer) && (val.buffer instanceof ArrayBuffer);\n }\n return result;\n}\n\n/**\n * Determine if a value is a String\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a String, otherwise false\n */\nfunction isString(val) {\n return typeof val === 'string';\n}\n\n/**\n * Determine if a value is a Number\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Number, otherwise false\n */\nfunction isNumber(val) {\n return typeof val === 'number';\n}\n\n/**\n * Determine if a value is an Object\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an Object, otherwise false\n */\nfunction isObject(val) {\n return val !== null && typeof val === 'object';\n}\n\n/**\n * Determine if a value is a plain Object\n *\n * @param {Object} val The value to test\n * @return {boolean} True if value is a plain Object, otherwise false\n */\nfunction isPlainObject(val) {\n if (toString.call(val) !== '[object Object]') {\n return false;\n }\n\n var prototype = Object.getPrototypeOf(val);\n return prototype === null || prototype === Object.prototype;\n}\n\n/**\n * Determine if a value is a Date\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Date, otherwise false\n */\nfunction isDate(val) {\n return toString.call(val) === '[object Date]';\n}\n\n/**\n * Determine if a value is a File\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a File, otherwise false\n */\nfunction isFile(val) {\n return toString.call(val) === '[object File]';\n}\n\n/**\n * Determine if a value is a Blob\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Blob, otherwise false\n */\nfunction isBlob(val) {\n return toString.call(val) === '[object Blob]';\n}\n\n/**\n * Determine if a value is a Function\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Function, otherwise false\n */\nfunction isFunction(val) {\n return toString.call(val) === '[object Function]';\n}\n\n/**\n * Determine if a value is a Stream\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Stream, otherwise false\n */\nfunction isStream(val) {\n return isObject(val) && isFunction(val.pipe);\n}\n\n/**\n * Determine if a value is a URLSearchParams object\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a URLSearchParams object, otherwise false\n */\nfunction isURLSearchParams(val) {\n return typeof URLSearchParams !== 'undefined' && val instanceof URLSearchParams;\n}\n\n/**\n * Trim excess whitespace off the beginning and end of a string\n *\n * @param {String} str The String to trim\n * @returns {String} The String freed of excess whitespace\n */\nfunction trim(str) {\n return str.trim ? str.trim() : str.replace(/^\\s+|\\s+$/g, '');\n}\n\n/**\n * Determine if we're running in a standard browser environment\n *\n * This allows axios to run in a web worker, and react-native.\n * Both environments support XMLHttpRequest, but not fully standard globals.\n *\n * web workers:\n * typeof window -> undefined\n * typeof document -> undefined\n *\n * react-native:\n * navigator.product -> 'ReactNative'\n * nativescript\n * navigator.product -> 'NativeScript' or 'NS'\n */\nfunction isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}\n\n/**\n * Iterate over an Array or an Object invoking a function for each item.\n *\n * If `obj` is an Array callback will be called passing\n * the value, index, and complete array for each item.\n *\n * If 'obj' is an Object callback will be called passing\n * the value, key, and complete object for each property.\n *\n * @param {Object|Array} obj The object to iterate\n * @param {Function} fn The callback to invoke for each item\n */\nfunction forEach(obj, fn) {\n // Don't bother if no value provided\n if (obj === null || typeof obj === 'undefined') {\n return;\n }\n\n // Force an array if not already something iterable\n if (typeof obj !== 'object') {\n /*eslint no-param-reassign:0*/\n obj = [obj];\n }\n\n if (isArray(obj)) {\n // Iterate over array values\n for (var i = 0, l = obj.length; i < l; i++) {\n fn.call(null, obj[i], i, obj);\n }\n } else {\n // Iterate over object keys\n for (var key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key)) {\n fn.call(null, obj[key], key, obj);\n }\n }\n }\n}\n\n/**\n * Accepts varargs expecting each argument to be an object, then\n * immutably merges the properties of each object and returns result.\n *\n * When multiple objects contain the same key the later object in\n * the arguments list will take precedence.\n *\n * Example:\n *\n * ```js\n * var result = merge({foo: 123}, {foo: 456});\n * console.log(result.foo); // outputs 456\n * ```\n *\n * @param {Object} obj1 Object to merge\n * @returns {Object} Result of all merge properties\n */\nfunction merge(/* obj1, obj2, obj3, ... */) {\n var result = {};\n function assignValue(val, key) {\n if (isPlainObject(result[key]) && isPlainObject(val)) {\n result[key] = merge(result[key], val);\n } else if (isPlainObject(val)) {\n result[key] = merge({}, val);\n } else if (isArray(val)) {\n result[key] = val.slice();\n } else {\n result[key] = val;\n }\n }\n\n for (var i = 0, l = arguments.length; i < l; i++) {\n forEach(arguments[i], assignValue);\n }\n return result;\n}\n\n/**\n * Extends object a by mutably adding to it the properties of object b.\n *\n * @param {Object} a The object to be extended\n * @param {Object} b The object to copy properties from\n * @param {Object} thisArg The object to bind function to\n * @return {Object} The resulting value of object a\n */\nfunction extend(a, b, thisArg) {\n forEach(b, function assignValue(val, key) {\n if (thisArg && typeof val === 'function') {\n a[key] = bind(val, thisArg);\n } else {\n a[key] = val;\n }\n });\n return a;\n}\n\n/**\n * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM)\n *\n * @param {string} content with BOM\n * @return {string} content value without BOM\n */\nfunction stripBOM(content) {\n if (content.charCodeAt(0) === 0xFEFF) {\n content = content.slice(1);\n }\n return content;\n}\n\nmodule.exports = {\n isArray: isArray,\n isArrayBuffer: isArrayBuffer,\n isBuffer: isBuffer,\n isFormData: isFormData,\n isArrayBufferView: isArrayBufferView,\n isString: isString,\n isNumber: isNumber,\n isObject: isObject,\n isPlainObject: isPlainObject,\n isUndefined: isUndefined,\n isDate: isDate,\n isFile: isFile,\n isBlob: isBlob,\n isFunction: isFunction,\n isStream: isStream,\n isURLSearchParams: isURLSearchParams,\n isStandardBrowserEnv: isStandardBrowserEnv,\n forEach: forEach,\n merge: merge,\n extend: extend,\n trim: trim,\n stripBOM: stripBOM\n};\n","'use strict';\n\nvar utils = require('./utils');\nvar normalizeHeaderName = require('./helpers/normalizeHeaderName');\nvar enhanceError = require('./core/enhanceError');\n\nvar DEFAULT_CONTENT_TYPE = {\n 'Content-Type': 'application/x-www-form-urlencoded'\n};\n\nfunction setContentTypeIfUnset(headers, value) {\n if (!utils.isUndefined(headers) && utils.isUndefined(headers['Content-Type'])) {\n headers['Content-Type'] = value;\n }\n}\n\nfunction getDefaultAdapter() {\n var adapter;\n if (typeof XMLHttpRequest !== 'undefined') {\n // For browsers use XHR adapter\n adapter = require('./adapters/xhr');\n } else if (typeof process !== 'undefined' && Object.prototype.toString.call(process) === '[object process]') {\n // For node use HTTP adapter\n adapter = require('./adapters/http');\n }\n return adapter;\n}\n\nfunction stringifySafely(rawValue, parser, encoder) {\n if (utils.isString(rawValue)) {\n try {\n (parser || JSON.parse)(rawValue);\n return utils.trim(rawValue);\n } catch (e) {\n if (e.name !== 'SyntaxError') {\n throw e;\n }\n }\n }\n\n return (encoder || JSON.stringify)(rawValue);\n}\n\nvar defaults = {\n\n transitional: {\n silentJSONParsing: true,\n forcedJSONParsing: true,\n clarifyTimeoutError: false\n },\n\n adapter: getDefaultAdapter(),\n\n transformRequest: [function transformRequest(data, headers) {\n normalizeHeaderName(headers, 'Accept');\n normalizeHeaderName(headers, 'Content-Type');\n\n if (utils.isFormData(data) ||\n utils.isArrayBuffer(data) ||\n utils.isBuffer(data) ||\n utils.isStream(data) ||\n utils.isFile(data) ||\n utils.isBlob(data)\n ) {\n return data;\n }\n if (utils.isArrayBufferView(data)) {\n return data.buffer;\n }\n if (utils.isURLSearchParams(data)) {\n setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8');\n return data.toString();\n }\n if (utils.isObject(data) || (headers && headers['Content-Type'] === 'application/json')) {\n setContentTypeIfUnset(headers, 'application/json');\n return stringifySafely(data);\n }\n return data;\n }],\n\n transformResponse: [function transformResponse(data) {\n var transitional = this.transitional;\n var silentJSONParsing = transitional && transitional.silentJSONParsing;\n var forcedJSONParsing = transitional && transitional.forcedJSONParsing;\n var strictJSONParsing = !silentJSONParsing && this.responseType === 'json';\n\n if (strictJSONParsing || (forcedJSONParsing && utils.isString(data) && data.length)) {\n try {\n return JSON.parse(data);\n } catch (e) {\n if (strictJSONParsing) {\n if (e.name === 'SyntaxError') {\n throw enhanceError(e, this, 'E_JSON_PARSE');\n }\n throw e;\n }\n }\n }\n\n return data;\n }],\n\n /**\n * A timeout in milliseconds to abort a request. If set to 0 (default) a\n * timeout is not created.\n */\n timeout: 0,\n\n xsrfCookieName: 'XSRF-TOKEN',\n xsrfHeaderName: 'X-XSRF-TOKEN',\n\n maxContentLength: -1,\n maxBodyLength: -1,\n\n validateStatus: function validateStatus(status) {\n return status >= 200 && status < 300;\n }\n};\n\ndefaults.headers = {\n common: {\n 'Accept': 'application/json, text/plain, */*'\n }\n};\n\nutils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) {\n defaults.headers[method] = {};\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE);\n});\n\nmodule.exports = defaults;\n","'use strict';\n\nmodule.exports = function bind(fn, thisArg) {\n return function wrap() {\n var args = new Array(arguments.length);\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i];\n }\n return fn.apply(thisArg, args);\n };\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\nfunction encode(val) {\n return encodeURIComponent(val).\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%20/g, '+').\n replace(/%5B/gi, '[').\n replace(/%5D/gi, ']');\n}\n\n/**\n * Build a URL by appending params to the end\n *\n * @param {string} url The base of the url (e.g., http://www.google.com)\n * @param {object} [params] The params to be appended\n * @returns {string} The formatted url\n */\nmodule.exports = function buildURL(url, params, paramsSerializer) {\n /*eslint no-param-reassign:0*/\n if (!params) {\n return url;\n }\n\n var serializedParams;\n if (paramsSerializer) {\n serializedParams = paramsSerializer(params);\n } else if (utils.isURLSearchParams(params)) {\n serializedParams = params.toString();\n } else {\n var parts = [];\n\n utils.forEach(params, function serialize(val, key) {\n if (val === null || typeof val === 'undefined') {\n return;\n }\n\n if (utils.isArray(val)) {\n key = key + '[]';\n } else {\n val = [val];\n }\n\n utils.forEach(val, function parseValue(v) {\n if (utils.isDate(v)) {\n v = v.toISOString();\n } else if (utils.isObject(v)) {\n v = JSON.stringify(v);\n }\n parts.push(encode(key) + '=' + encode(v));\n });\n });\n\n serializedParams = parts.join('&');\n }\n\n if (serializedParams) {\n var hashmarkIndex = url.indexOf('#');\n if (hashmarkIndex !== -1) {\n url = url.slice(0, hashmarkIndex);\n }\n\n url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;\n }\n\n return url;\n};\n","'use strict';\n\n/**\n * Update an Error with the specified config, error code, and response.\n *\n * @param {Error} error The error to update.\n * @param {Object} config The config.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n * @returns {Error} The error.\n */\nmodule.exports = function enhanceError(error, config, code, request, response) {\n error.config = config;\n if (code) {\n error.code = code;\n }\n\n error.request = request;\n error.response = response;\n error.isAxiosError = true;\n\n error.toJSON = function toJSON() {\n return {\n // Standard\n message: this.message,\n name: this.name,\n // Microsoft\n description: this.description,\n number: this.number,\n // Mozilla\n fileName: this.fileName,\n lineNumber: this.lineNumber,\n columnNumber: this.columnNumber,\n stack: this.stack,\n // Axios\n config: this.config,\n code: this.code\n };\n };\n return error;\n};\n","'use strict';\n\nvar utils = require('./../utils');\nvar settle = require('./../core/settle');\nvar cookies = require('./../helpers/cookies');\nvar buildURL = require('./../helpers/buildURL');\nvar buildFullPath = require('../core/buildFullPath');\nvar parseHeaders = require('./../helpers/parseHeaders');\nvar isURLSameOrigin = require('./../helpers/isURLSameOrigin');\nvar createError = require('../core/createError');\n\nmodule.exports = function xhrAdapter(config) {\n return new Promise(function dispatchXhrRequest(resolve, reject) {\n var requestData = config.data;\n var requestHeaders = config.headers;\n var responseType = config.responseType;\n\n if (utils.isFormData(requestData)) {\n delete requestHeaders['Content-Type']; // Let the browser set it\n }\n\n var request = new XMLHttpRequest();\n\n // HTTP basic authentication\n if (config.auth) {\n var username = config.auth.username || '';\n var password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : '';\n requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password);\n }\n\n var fullPath = buildFullPath(config.baseURL, config.url);\n request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true);\n\n // Set the request timeout in MS\n request.timeout = config.timeout;\n\n function onloadend() {\n if (!request) {\n return;\n }\n // Prepare the response\n var responseHeaders = 'getAllResponseHeaders' in request ? parseHeaders(request.getAllResponseHeaders()) : null;\n var responseData = !responseType || responseType === 'text' || responseType === 'json' ?\n request.responseText : request.response;\n var response = {\n data: responseData,\n status: request.status,\n statusText: request.statusText,\n headers: responseHeaders,\n config: config,\n request: request\n };\n\n settle(resolve, reject, response);\n\n // Clean up request\n request = null;\n }\n\n if ('onloadend' in request) {\n // Use onloadend if available\n request.onloadend = onloadend;\n } else {\n // Listen for ready state to emulate onloadend\n request.onreadystatechange = function handleLoad() {\n if (!request || request.readyState !== 4) {\n return;\n }\n\n // The request errored out and we didn't get a response, this will be\n // handled by onerror instead\n // With one exception: request that using file: protocol, most browsers\n // will return status as 0 even though it's a successful request\n if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {\n return;\n }\n // readystate handler is calling before onerror or ontimeout handlers,\n // so we should call onloadend on the next 'tick'\n setTimeout(onloadend);\n };\n }\n\n // Handle browser request cancellation (as opposed to a manual cancellation)\n request.onabort = function handleAbort() {\n if (!request) {\n return;\n }\n\n reject(createError('Request aborted', config, 'ECONNABORTED', request));\n\n // Clean up request\n request = null;\n };\n\n // Handle low level network errors\n request.onerror = function handleError() {\n // Real errors are hidden from us by the browser\n // onerror should only fire if it's a network error\n reject(createError('Network Error', config, null, request));\n\n // Clean up request\n request = null;\n };\n\n // Handle timeout\n request.ontimeout = function handleTimeout() {\n var timeoutErrorMessage = 'timeout of ' + config.timeout + 'ms exceeded';\n if (config.timeoutErrorMessage) {\n timeoutErrorMessage = config.timeoutErrorMessage;\n }\n reject(createError(\n timeoutErrorMessage,\n config,\n config.transitional && config.transitional.clarifyTimeoutError ? 'ETIMEDOUT' : 'ECONNABORTED',\n request));\n\n // Clean up request\n request = null;\n };\n\n // Add xsrf header\n // This is only done if running in a standard browser environment.\n // Specifically not if we're in a web worker, or react-native.\n if (utils.isStandardBrowserEnv()) {\n // Add xsrf header\n var xsrfValue = (config.withCredentials || isURLSameOrigin(fullPath)) && config.xsrfCookieName ?\n cookies.read(config.xsrfCookieName) :\n undefined;\n\n if (xsrfValue) {\n requestHeaders[config.xsrfHeaderName] = xsrfValue;\n }\n }\n\n // Add headers to the request\n if ('setRequestHeader' in request) {\n utils.forEach(requestHeaders, function setRequestHeader(val, key) {\n if (typeof requestData === 'undefined' && key.toLowerCase() === 'content-type') {\n // Remove Content-Type if data is undefined\n delete requestHeaders[key];\n } else {\n // Otherwise add header to the request\n request.setRequestHeader(key, val);\n }\n });\n }\n\n // Add withCredentials to request if needed\n if (!utils.isUndefined(config.withCredentials)) {\n request.withCredentials = !!config.withCredentials;\n }\n\n // Add responseType to request if needed\n if (responseType && responseType !== 'json') {\n request.responseType = config.responseType;\n }\n\n // Handle progress if needed\n if (typeof config.onDownloadProgress === 'function') {\n request.addEventListener('progress', config.onDownloadProgress);\n }\n\n // Not all browsers support upload events\n if (typeof config.onUploadProgress === 'function' && request.upload) {\n request.upload.addEventListener('progress', config.onUploadProgress);\n }\n\n if (config.cancelToken) {\n // Handle cancellation\n config.cancelToken.promise.then(function onCanceled(cancel) {\n if (!request) {\n return;\n }\n\n request.abort();\n reject(cancel);\n // Clean up request\n request = null;\n });\n }\n\n if (!requestData) {\n requestData = null;\n }\n\n // Send the request\n request.send(requestData);\n });\n};\n","'use strict';\n\nvar enhanceError = require('./enhanceError');\n\n/**\n * Create an Error with the specified message, config, error code, request and response.\n *\n * @param {string} message The error message.\n * @param {Object} config The config.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n * @returns {Error} The created error.\n */\nmodule.exports = function createError(message, config, code, request, response) {\n var error = new Error(message);\n return enhanceError(error, config, code, request, response);\n};\n","'use strict';\n\nmodule.exports = function isCancel(value) {\n return !!(value && value.__CANCEL__);\n};\n","'use strict';\n\nvar utils = require('../utils');\n\n/**\n * Config-specific merge-function which creates a new config-object\n * by merging two configuration objects together.\n *\n * @param {Object} config1\n * @param {Object} config2\n * @returns {Object} New object resulting from merging config2 to config1\n */\nmodule.exports = function mergeConfig(config1, config2) {\n // eslint-disable-next-line no-param-reassign\n config2 = config2 || {};\n var config = {};\n\n var valueFromConfig2Keys = ['url', 'method', 'data'];\n var mergeDeepPropertiesKeys = ['headers', 'auth', 'proxy', 'params'];\n var defaultToConfig2Keys = [\n 'baseURL', 'transformRequest', 'transformResponse', 'paramsSerializer',\n 'timeout', 'timeoutMessage', 'withCredentials', 'adapter', 'responseType', 'xsrfCookieName',\n 'xsrfHeaderName', 'onUploadProgress', 'onDownloadProgress', 'decompress',\n 'maxContentLength', 'maxBodyLength', 'maxRedirects', 'transport', 'httpAgent',\n 'httpsAgent', 'cancelToken', 'socketPath', 'responseEncoding'\n ];\n var directMergeKeys = ['validateStatus'];\n\n function getMergedValue(target, source) {\n if (utils.isPlainObject(target) && utils.isPlainObject(source)) {\n return utils.merge(target, source);\n } else if (utils.isPlainObject(source)) {\n return utils.merge({}, source);\n } else if (utils.isArray(source)) {\n return source.slice();\n }\n return source;\n }\n\n function mergeDeepProperties(prop) {\n if (!utils.isUndefined(config2[prop])) {\n config[prop] = getMergedValue(config1[prop], config2[prop]);\n } else if (!utils.isUndefined(config1[prop])) {\n config[prop] = getMergedValue(undefined, config1[prop]);\n }\n }\n\n utils.forEach(valueFromConfig2Keys, function valueFromConfig2(prop) {\n if (!utils.isUndefined(config2[prop])) {\n config[prop] = getMergedValue(undefined, config2[prop]);\n }\n });\n\n utils.forEach(mergeDeepPropertiesKeys, mergeDeepProperties);\n\n utils.forEach(defaultToConfig2Keys, function defaultToConfig2(prop) {\n if (!utils.isUndefined(config2[prop])) {\n config[prop] = getMergedValue(undefined, config2[prop]);\n } else if (!utils.isUndefined(config1[prop])) {\n config[prop] = getMergedValue(undefined, config1[prop]);\n }\n });\n\n utils.forEach(directMergeKeys, function merge(prop) {\n if (prop in config2) {\n config[prop] = getMergedValue(config1[prop], config2[prop]);\n } else if (prop in config1) {\n config[prop] = getMergedValue(undefined, config1[prop]);\n }\n });\n\n var axiosKeys = valueFromConfig2Keys\n .concat(mergeDeepPropertiesKeys)\n .concat(defaultToConfig2Keys)\n .concat(directMergeKeys);\n\n var otherKeys = Object\n .keys(config1)\n .concat(Object.keys(config2))\n .filter(function filterAxiosKeys(key) {\n return axiosKeys.indexOf(key) === -1;\n });\n\n utils.forEach(otherKeys, mergeDeepProperties);\n\n return config;\n};\n","'use strict';\n\n/**\n * A `Cancel` is an object that is thrown when an operation is canceled.\n *\n * @class\n * @param {string=} message The message.\n */\nfunction Cancel(message) {\n this.message = message;\n}\n\nCancel.prototype.toString = function toString() {\n return 'Cancel' + (this.message ? ': ' + this.message : '');\n};\n\nCancel.prototype.__CANCEL__ = true;\n\nmodule.exports = Cancel;\n","module.exports = require('./lib/axios');","'use strict';\n\nvar utils = require('./utils');\nvar bind = require('./helpers/bind');\nvar Axios = require('./core/Axios');\nvar mergeConfig = require('./core/mergeConfig');\nvar defaults = require('./defaults');\n\n/**\n * Create an instance of Axios\n *\n * @param {Object} defaultConfig The default config for the instance\n * @return {Axios} A new instance of Axios\n */\nfunction createInstance(defaultConfig) {\n var context = new Axios(defaultConfig);\n var instance = bind(Axios.prototype.request, context);\n\n // Copy axios.prototype to instance\n utils.extend(instance, Axios.prototype, context);\n\n // Copy context to instance\n utils.extend(instance, context);\n\n return instance;\n}\n\n// Create the default instance to be exported\nvar axios = createInstance(defaults);\n\n// Expose Axios class to allow class inheritance\naxios.Axios = Axios;\n\n// Factory for creating new instances\naxios.create = function create(instanceConfig) {\n return createInstance(mergeConfig(axios.defaults, instanceConfig));\n};\n\n// Expose Cancel & CancelToken\naxios.Cancel = require('./cancel/Cancel');\naxios.CancelToken = require('./cancel/CancelToken');\naxios.isCancel = require('./cancel/isCancel');\n\n// Expose all/spread\naxios.all = function all(promises) {\n return Promise.all(promises);\n};\naxios.spread = require('./helpers/spread');\n\n// Expose isAxiosError\naxios.isAxiosError = require('./helpers/isAxiosError');\n\nmodule.exports = axios;\n\n// Allow use of default import syntax in TypeScript\nmodule.exports.default = axios;\n","'use strict';\n\nvar utils = require('./../utils');\nvar buildURL = require('../helpers/buildURL');\nvar InterceptorManager = require('./InterceptorManager');\nvar dispatchRequest = require('./dispatchRequest');\nvar mergeConfig = require('./mergeConfig');\nvar validator = require('../helpers/validator');\n\nvar validators = validator.validators;\n/**\n * Create a new instance of Axios\n *\n * @param {Object} instanceConfig The default config for the instance\n */\nfunction Axios(instanceConfig) {\n this.defaults = instanceConfig;\n this.interceptors = {\n request: new InterceptorManager(),\n response: new InterceptorManager()\n };\n}\n\n/**\n * Dispatch a request\n *\n * @param {Object} config The config specific for this request (merged with this.defaults)\n */\nAxios.prototype.request = function request(config) {\n /*eslint no-param-reassign:0*/\n // Allow for axios('example/url'[, config]) a la fetch API\n if (typeof config === 'string') {\n config = arguments[1] || {};\n config.url = arguments[0];\n } else {\n config = config || {};\n }\n\n config = mergeConfig(this.defaults, config);\n\n // Set config.method\n if (config.method) {\n config.method = config.method.toLowerCase();\n } else if (this.defaults.method) {\n config.method = this.defaults.method.toLowerCase();\n } else {\n config.method = 'get';\n }\n\n var transitional = config.transitional;\n\n if (transitional !== undefined) {\n validator.assertOptions(transitional, {\n silentJSONParsing: validators.transitional(validators.boolean, '1.0.0'),\n forcedJSONParsing: validators.transitional(validators.boolean, '1.0.0'),\n clarifyTimeoutError: validators.transitional(validators.boolean, '1.0.0')\n }, false);\n }\n\n // filter out skipped interceptors\n var requestInterceptorChain = [];\n var synchronousRequestInterceptors = true;\n this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {\n if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) {\n return;\n }\n\n synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;\n\n requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);\n });\n\n var responseInterceptorChain = [];\n this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {\n responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);\n });\n\n var promise;\n\n if (!synchronousRequestInterceptors) {\n var chain = [dispatchRequest, undefined];\n\n Array.prototype.unshift.apply(chain, requestInterceptorChain);\n chain = chain.concat(responseInterceptorChain);\n\n promise = Promise.resolve(config);\n while (chain.length) {\n promise = promise.then(chain.shift(), chain.shift());\n }\n\n return promise;\n }\n\n\n var newConfig = config;\n while (requestInterceptorChain.length) {\n var onFulfilled = requestInterceptorChain.shift();\n var onRejected = requestInterceptorChain.shift();\n try {\n newConfig = onFulfilled(newConfig);\n } catch (error) {\n onRejected(error);\n break;\n }\n }\n\n try {\n promise = dispatchRequest(newConfig);\n } catch (error) {\n return Promise.reject(error);\n }\n\n while (responseInterceptorChain.length) {\n promise = promise.then(responseInterceptorChain.shift(), responseInterceptorChain.shift());\n }\n\n return promise;\n};\n\nAxios.prototype.getUri = function getUri(config) {\n config = mergeConfig(this.defaults, config);\n return buildURL(config.url, config.params, config.paramsSerializer).replace(/^\\?/, '');\n};\n\n// Provide aliases for supported request methods\nutils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, config) {\n return this.request(mergeConfig(config || {}, {\n method: method,\n url: url,\n data: (config || {}).data\n }));\n };\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, data, config) {\n return this.request(mergeConfig(config || {}, {\n method: method,\n url: url,\n data: data\n }));\n };\n});\n\nmodule.exports = Axios;\n","'use strict';\n\nvar utils = require('./../utils');\n\nfunction InterceptorManager() {\n this.handlers = [];\n}\n\n/**\n * Add a new interceptor to the stack\n *\n * @param {Function} fulfilled The function to handle `then` for a `Promise`\n * @param {Function} rejected The function to handle `reject` for a `Promise`\n *\n * @return {Number} An ID used to remove interceptor later\n */\nInterceptorManager.prototype.use = function use(fulfilled, rejected, options) {\n this.handlers.push({\n fulfilled: fulfilled,\n rejected: rejected,\n synchronous: options ? options.synchronous : false,\n runWhen: options ? options.runWhen : null\n });\n return this.handlers.length - 1;\n};\n\n/**\n * Remove an interceptor from the stack\n *\n * @param {Number} id The ID that was returned by `use`\n */\nInterceptorManager.prototype.eject = function eject(id) {\n if (this.handlers[id]) {\n this.handlers[id] = null;\n }\n};\n\n/**\n * Iterate over all the registered interceptors\n *\n * This method is particularly useful for skipping over any\n * interceptors that may have become `null` calling `eject`.\n *\n * @param {Function} fn The function to call for each interceptor\n */\nInterceptorManager.prototype.forEach = function forEach(fn) {\n utils.forEach(this.handlers, function forEachHandler(h) {\n if (h !== null) {\n fn(h);\n }\n });\n};\n\nmodule.exports = InterceptorManager;\n","'use strict';\n\nvar utils = require('./../utils');\nvar transformData = require('./transformData');\nvar isCancel = require('../cancel/isCancel');\nvar defaults = require('../defaults');\n\n/**\n * Throws a `Cancel` if cancellation has been requested.\n */\nfunction throwIfCancellationRequested(config) {\n if (config.cancelToken) {\n config.cancelToken.throwIfRequested();\n }\n}\n\n/**\n * Dispatch a request to the server using the configured adapter.\n *\n * @param {object} config The config that is to be used for the request\n * @returns {Promise} The Promise to be fulfilled\n */\nmodule.exports = function dispatchRequest(config) {\n throwIfCancellationRequested(config);\n\n // Ensure headers exist\n config.headers = config.headers || {};\n\n // Transform request data\n config.data = transformData.call(\n config,\n config.data,\n config.headers,\n config.transformRequest\n );\n\n // Flatten headers\n config.headers = utils.merge(\n config.headers.common || {},\n config.headers[config.method] || {},\n config.headers\n );\n\n utils.forEach(\n ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],\n function cleanHeaderConfig(method) {\n delete config.headers[method];\n }\n );\n\n var adapter = config.adapter || defaults.adapter;\n\n return adapter(config).then(function onAdapterResolution(response) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n response.data = transformData.call(\n config,\n response.data,\n response.headers,\n config.transformResponse\n );\n\n return response;\n }, function onAdapterRejection(reason) {\n if (!isCancel(reason)) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n if (reason && reason.response) {\n reason.response.data = transformData.call(\n config,\n reason.response.data,\n reason.response.headers,\n config.transformResponse\n );\n }\n }\n\n return Promise.reject(reason);\n });\n};\n","'use strict';\n\nvar utils = require('./../utils');\nvar defaults = require('./../defaults');\n\n/**\n * Transform the data for a request or a response\n *\n * @param {Object|String} data The data to be transformed\n * @param {Array} headers The headers for the request or response\n * @param {Array|Function} fns A single function or Array of functions\n * @returns {*} The resulting transformed data\n */\nmodule.exports = function transformData(data, headers, fns) {\n var context = this || defaults;\n /*eslint no-param-reassign:0*/\n utils.forEach(fns, function transform(fn) {\n data = fn.call(context, data, headers);\n });\n\n return data;\n};\n","'use strict';\n\nvar utils = require('../utils');\n\nmodule.exports = function normalizeHeaderName(headers, normalizedName) {\n utils.forEach(headers, function processHeader(value, name) {\n if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) {\n headers[normalizedName] = value;\n delete headers[name];\n }\n });\n};\n","'use strict';\n\nvar createError = require('./createError');\n\n/**\n * Resolve or reject a Promise based on response status.\n *\n * @param {Function} resolve A function that resolves the promise.\n * @param {Function} reject A function that rejects the promise.\n * @param {object} response The response.\n */\nmodule.exports = function settle(resolve, reject, response) {\n var validateStatus = response.config.validateStatus;\n if (!response.status || !validateStatus || validateStatus(response.status)) {\n resolve(response);\n } else {\n reject(createError(\n 'Request failed with status code ' + response.status,\n response.config,\n null,\n response.request,\n response\n ));\n }\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\nmodule.exports = (\n utils.isStandardBrowserEnv() ?\n\n // Standard browser envs support document.cookie\n (function standardBrowserEnv() {\n return {\n write: function write(name, value, expires, path, domain, secure) {\n var cookie = [];\n cookie.push(name + '=' + encodeURIComponent(value));\n\n if (utils.isNumber(expires)) {\n cookie.push('expires=' + new Date(expires).toGMTString());\n }\n\n if (utils.isString(path)) {\n cookie.push('path=' + path);\n }\n\n if (utils.isString(domain)) {\n cookie.push('domain=' + domain);\n }\n\n if (secure === true) {\n cookie.push('secure');\n }\n\n document.cookie = cookie.join('; ');\n },\n\n read: function read(name) {\n var match = document.cookie.match(new RegExp('(^|;\\\\s*)(' + name + ')=([^;]*)'));\n return (match ? decodeURIComponent(match[3]) : null);\n },\n\n remove: function remove(name) {\n this.write(name, '', Date.now() - 86400000);\n }\n };\n })() :\n\n // Non standard browser env (web workers, react-native) lack needed support.\n (function nonStandardBrowserEnv() {\n return {\n write: function write() {},\n read: function read() { return null; },\n remove: function remove() {}\n };\n })()\n);\n","'use strict';\n\nvar isAbsoluteURL = require('../helpers/isAbsoluteURL');\nvar combineURLs = require('../helpers/combineURLs');\n\n/**\n * Creates a new URL by combining the baseURL with the requestedURL,\n * only when the requestedURL is not already an absolute URL.\n * If the requestURL is absolute, this function returns the requestedURL untouched.\n *\n * @param {string} baseURL The base URL\n * @param {string} requestedURL Absolute or relative URL to combine\n * @returns {string} The combined full path\n */\nmodule.exports = function buildFullPath(baseURL, requestedURL) {\n if (baseURL && !isAbsoluteURL(requestedURL)) {\n return combineURLs(baseURL, requestedURL);\n }\n return requestedURL;\n};\n","'use strict';\n\n/**\n * Determines whether the specified URL is absolute\n *\n * @param {string} url The URL to test\n * @returns {boolean} True if the specified URL is absolute, otherwise false\n */\nmodule.exports = function isAbsoluteURL(url) {\n // A URL is considered absolute if it begins with \"://\" or \"//\" (protocol-relative URL).\n // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed\n // by any combination of letters, digits, plus, period, or hyphen.\n return /^([a-z][a-z\\d\\+\\-\\.]*:)?\\/\\//i.test(url);\n};\n","'use strict';\n\n/**\n * Creates a new URL by combining the specified URLs\n *\n * @param {string} baseURL The base URL\n * @param {string} relativeURL The relative URL\n * @returns {string} The combined URL\n */\nmodule.exports = function combineURLs(baseURL, relativeURL) {\n return relativeURL\n ? baseURL.replace(/\\/+$/, '') + '/' + relativeURL.replace(/^\\/+/, '')\n : baseURL;\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\n// Headers whose duplicates are ignored by node\n// c.f. https://nodejs.org/api/http.html#http_message_headers\nvar ignoreDuplicateOf = [\n 'age', 'authorization', 'content-length', 'content-type', 'etag',\n 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',\n 'last-modified', 'location', 'max-forwards', 'proxy-authorization',\n 'referer', 'retry-after', 'user-agent'\n];\n\n/**\n * Parse headers into an object\n *\n * ```\n * Date: Wed, 27 Aug 2014 08:58:49 GMT\n * Content-Type: application/json\n * Connection: keep-alive\n * Transfer-Encoding: chunked\n * ```\n *\n * @param {String} headers Headers needing to be parsed\n * @returns {Object} Headers parsed into an object\n */\nmodule.exports = function parseHeaders(headers) {\n var parsed = {};\n var key;\n var val;\n var i;\n\n if (!headers) { return parsed; }\n\n utils.forEach(headers.split('\\n'), function parser(line) {\n i = line.indexOf(':');\n key = utils.trim(line.substr(0, i)).toLowerCase();\n val = utils.trim(line.substr(i + 1));\n\n if (key) {\n if (parsed[key] && ignoreDuplicateOf.indexOf(key) >= 0) {\n return;\n }\n if (key === 'set-cookie') {\n parsed[key] = (parsed[key] ? parsed[key] : []).concat([val]);\n } else {\n parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;\n }\n }\n });\n\n return parsed;\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\nmodule.exports = (\n utils.isStandardBrowserEnv() ?\n\n // Standard browser envs have full support of the APIs needed to test\n // whether the request URL is of the same origin as current location.\n (function standardBrowserEnv() {\n var msie = /(msie|trident)/i.test(navigator.userAgent);\n var urlParsingNode = document.createElement('a');\n var originURL;\n\n /**\n * Parse a URL to discover it's components\n *\n * @param {String} url The URL to be parsed\n * @returns {Object}\n */\n function resolveURL(url) {\n var href = url;\n\n if (msie) {\n // IE needs attribute set twice to normalize properties\n urlParsingNode.setAttribute('href', href);\n href = urlParsingNode.href;\n }\n\n urlParsingNode.setAttribute('href', href);\n\n // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils\n return {\n href: urlParsingNode.href,\n protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',\n host: urlParsingNode.host,\n search: urlParsingNode.search ? urlParsingNode.search.replace(/^\\?/, '') : '',\n hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',\n hostname: urlParsingNode.hostname,\n port: urlParsingNode.port,\n pathname: (urlParsingNode.pathname.charAt(0) === '/') ?\n urlParsingNode.pathname :\n '/' + urlParsingNode.pathname\n };\n }\n\n originURL = resolveURL(window.location.href);\n\n /**\n * Determine if a URL shares the same origin as the current location\n *\n * @param {String} requestURL The URL to test\n * @returns {boolean} True if URL shares the same origin, otherwise false\n */\n return function isURLSameOrigin(requestURL) {\n var parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL;\n return (parsed.protocol === originURL.protocol &&\n parsed.host === originURL.host);\n };\n })() :\n\n // Non standard browser envs (web workers, react-native) lack needed support.\n (function nonStandardBrowserEnv() {\n return function isURLSameOrigin() {\n return true;\n };\n })()\n);\n","'use strict';\n\nvar pkg = require('./../../package.json');\n\nvar validators = {};\n\n// eslint-disable-next-line func-names\n['object', 'boolean', 'number', 'function', 'string', 'symbol'].forEach(function(type, i) {\n validators[type] = function validator(thing) {\n return typeof thing === type || 'a' + (i < 1 ? 'n ' : ' ') + type;\n };\n});\n\nvar deprecatedWarnings = {};\nvar currentVerArr = pkg.version.split('.');\n\n/**\n * Compare package versions\n * @param {string} version\n * @param {string?} thanVersion\n * @returns {boolean}\n */\nfunction isOlderVersion(version, thanVersion) {\n var pkgVersionArr = thanVersion ? thanVersion.split('.') : currentVerArr;\n var destVer = version.split('.');\n for (var i = 0; i < 3; i++) {\n if (pkgVersionArr[i] > destVer[i]) {\n return true;\n } else if (pkgVersionArr[i] < destVer[i]) {\n return false;\n }\n }\n return false;\n}\n\n/**\n * Transitional option validator\n * @param {function|boolean?} validator\n * @param {string?} version\n * @param {string} message\n * @returns {function}\n */\nvalidators.transitional = function transitional(validator, version, message) {\n var isDeprecated = version && isOlderVersion(version);\n\n function formatMessage(opt, desc) {\n return '[Axios v' + pkg.version + '] Transitional option \\'' + opt + '\\'' + desc + (message ? '. ' + message : '');\n }\n\n // eslint-disable-next-line func-names\n return function(value, opt, opts) {\n if (validator === false) {\n throw new Error(formatMessage(opt, ' has been removed in ' + version));\n }\n\n if (isDeprecated && !deprecatedWarnings[opt]) {\n deprecatedWarnings[opt] = true;\n // eslint-disable-next-line no-console\n console.warn(\n formatMessage(\n opt,\n ' has been deprecated since v' + version + ' and will be removed in the near future'\n )\n );\n }\n\n return validator ? validator(value, opt, opts) : true;\n };\n};\n\n/**\n * Assert object's properties type\n * @param {object} options\n * @param {object} schema\n * @param {boolean?} allowUnknown\n */\n\nfunction assertOptions(options, schema, allowUnknown) {\n if (typeof options !== 'object') {\n throw new TypeError('options must be an object');\n }\n var keys = Object.keys(options);\n var i = keys.length;\n while (i-- > 0) {\n var opt = keys[i];\n var validator = schema[opt];\n if (validator) {\n var value = options[opt];\n var result = value === undefined || validator(value, opt, options);\n if (result !== true) {\n throw new TypeError('option ' + opt + ' must be ' + result);\n }\n continue;\n }\n if (allowUnknown !== true) {\n throw Error('Unknown option ' + opt);\n }\n }\n}\n\nmodule.exports = {\n isOlderVersion: isOlderVersion,\n assertOptions: assertOptions,\n validators: validators\n};\n","'use strict';\n\nvar Cancel = require('./Cancel');\n\n/**\n * A `CancelToken` is an object that can be used to request cancellation of an operation.\n *\n * @class\n * @param {Function} executor The executor function.\n */\nfunction CancelToken(executor) {\n if (typeof executor !== 'function') {\n throw new TypeError('executor must be a function.');\n }\n\n var resolvePromise;\n this.promise = new Promise(function promiseExecutor(resolve) {\n resolvePromise = resolve;\n });\n\n var token = this;\n executor(function cancel(message) {\n if (token.reason) {\n // Cancellation has already been requested\n return;\n }\n\n token.reason = new Cancel(message);\n resolvePromise(token.reason);\n });\n}\n\n/**\n * Throws a `Cancel` if cancellation has been requested.\n */\nCancelToken.prototype.throwIfRequested = function throwIfRequested() {\n if (this.reason) {\n throw this.reason;\n }\n};\n\n/**\n * Returns an object that contains a new `CancelToken` and a function that, when called,\n * cancels the `CancelToken`.\n */\nCancelToken.source = function source() {\n var cancel;\n var token = new CancelToken(function executor(c) {\n cancel = c;\n });\n return {\n token: token,\n cancel: cancel\n };\n};\n\nmodule.exports = CancelToken;\n","'use strict';\n\n/**\n * Syntactic sugar for invoking a function and expanding an array for arguments.\n *\n * Common use case would be to use `Function.prototype.apply`.\n *\n * ```js\n * function f(x, y, z) {}\n * var args = [1, 2, 3];\n * f.apply(null, args);\n * ```\n *\n * With `spread` this example can be re-written.\n *\n * ```js\n * spread(function(x, y, z) {})([1, 2, 3]);\n * ```\n *\n * @param {Function} callback\n * @returns {Function}\n */\nmodule.exports = function spread(callback) {\n return function wrap(arr) {\n return callback.apply(null, arr);\n };\n};\n","'use strict';\n\n/**\n * Determines whether the payload is an error thrown by Axios\n *\n * @param {*} payload The value to test\n * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false\n */\nmodule.exports = function isAxiosError(payload) {\n return (typeof payload === 'object') && (payload.isAxiosError === true);\n};\n"],"sourceRoot":""} \ No newline at end of file diff --git a/node_modules/xfarr-api/node_modules/axios/index.d.ts b/node_modules/xfarr-api/node_modules/axios/index.d.ts new file mode 100644 index 000000000..78f733f89 --- /dev/null +++ b/node_modules/xfarr-api/node_modules/axios/index.d.ts @@ -0,0 +1,168 @@ +export interface AxiosTransformer { + (data: any, headers?: any): any; +} + +export interface AxiosAdapter { + (config: AxiosRequestConfig): AxiosPromise; +} + +export interface AxiosBasicCredentials { + username: string; + password: string; +} + +export interface AxiosProxyConfig { + host: string; + port: number; + auth?: { + username: string; + password:string; + }; + protocol?: string; +} + +export type Method = + | 'get' | 'GET' + | 'delete' | 'DELETE' + | 'head' | 'HEAD' + | 'options' | 'OPTIONS' + | 'post' | 'POST' + | 'put' | 'PUT' + | 'patch' | 'PATCH' + | 'purge' | 'PURGE' + | 'link' | 'LINK' + | 'unlink' | 'UNLINK' + +export type ResponseType = + | 'arraybuffer' + | 'blob' + | 'document' + | 'json' + | 'text' + | 'stream' + +export interface TransitionalOptions{ + silentJSONParsing: boolean; + forcedJSONParsing: boolean; + clarifyTimeoutError: boolean; +} + +export interface AxiosRequestConfig { + url?: string; + method?: Method; + baseURL?: string; + transformRequest?: AxiosTransformer | AxiosTransformer[]; + transformResponse?: AxiosTransformer | AxiosTransformer[]; + headers?: any; + params?: any; + paramsSerializer?: (params: any) => string; + data?: any; + timeout?: number; + timeoutErrorMessage?: string; + withCredentials?: boolean; + adapter?: AxiosAdapter; + auth?: AxiosBasicCredentials; + responseType?: ResponseType; + xsrfCookieName?: string; + xsrfHeaderName?: string; + onUploadProgress?: (progressEvent: any) => void; + onDownloadProgress?: (progressEvent: any) => void; + maxContentLength?: number; + validateStatus?: ((status: number) => boolean) | null; + maxBodyLength?: number; + maxRedirects?: number; + socketPath?: string | null; + httpAgent?: any; + httpsAgent?: any; + proxy?: AxiosProxyConfig | false; + cancelToken?: CancelToken; + decompress?: boolean; + transitional?: TransitionalOptions +} + +export interface AxiosResponse { + data: T; + status: number; + statusText: string; + headers: any; + config: AxiosRequestConfig; + request?: any; +} + +export interface AxiosError extends Error { + config: AxiosRequestConfig; + code?: string; + request?: any; + response?: AxiosResponse; + isAxiosError: boolean; + toJSON: () => object; +} + +export interface AxiosPromise extends Promise> { +} + +export interface CancelStatic { + new (message?: string): Cancel; +} + +export interface Cancel { + message: string; +} + +export interface Canceler { + (message?: string): void; +} + +export interface CancelTokenStatic { + new (executor: (cancel: Canceler) => void): CancelToken; + source(): CancelTokenSource; +} + +export interface CancelToken { + promise: Promise; + reason?: Cancel; + throwIfRequested(): void; +} + +export interface CancelTokenSource { + token: CancelToken; + cancel: Canceler; +} + +export interface AxiosInterceptorManager { + use(onFulfilled?: (value: V) => T | Promise, onRejected?: (error: any) => any): number; + eject(id: number): void; +} + +export interface AxiosInstance { + (config: AxiosRequestConfig): AxiosPromise; + (url: string, config?: AxiosRequestConfig): AxiosPromise; + defaults: AxiosRequestConfig; + interceptors: { + request: AxiosInterceptorManager; + response: AxiosInterceptorManager; + }; + getUri(config?: AxiosRequestConfig): string; + request> (config: AxiosRequestConfig): Promise; + get>(url: string, config?: AxiosRequestConfig): Promise; + delete>(url: string, config?: AxiosRequestConfig): Promise; + head>(url: string, config?: AxiosRequestConfig): Promise; + options>(url: string, config?: AxiosRequestConfig): Promise; + post>(url: string, data?: any, config?: AxiosRequestConfig): Promise; + put>(url: string, data?: any, config?: AxiosRequestConfig): Promise; + patch>(url: string, data?: any, config?: AxiosRequestConfig): Promise; +} + +export interface AxiosStatic extends AxiosInstance { + create(config?: AxiosRequestConfig): AxiosInstance; + Cancel: CancelStatic; + CancelToken: CancelTokenStatic; + isCancel(value: any): boolean; + all(values: (T | Promise)[]): Promise; + spread(callback: (...args: T[]) => R): (array: T[]) => R; + isAxiosError(payload: any): payload is AxiosError; +} + +declare const axios: AxiosStatic; + +export default axios; diff --git a/node_modules/xfarr-api/node_modules/axios/index.js b/node_modules/xfarr-api/node_modules/axios/index.js new file mode 100644 index 000000000..79dfd09dd --- /dev/null +++ b/node_modules/xfarr-api/node_modules/axios/index.js @@ -0,0 +1 @@ +module.exports = require('./lib/axios'); \ No newline at end of file diff --git a/node_modules/xfarr-api/node_modules/axios/lib/adapters/README.md b/node_modules/xfarr-api/node_modules/axios/lib/adapters/README.md new file mode 100644 index 000000000..68f111895 --- /dev/null +++ b/node_modules/xfarr-api/node_modules/axios/lib/adapters/README.md @@ -0,0 +1,37 @@ +# axios // adapters + +The modules under `adapters/` are modules that handle dispatching a request and settling a returned `Promise` once a response is received. + +## Example + +```js +var settle = require('./../core/settle'); + +module.exports = function myAdapter(config) { + // At this point: + // - config has been merged with defaults + // - request transformers have already run + // - request interceptors have already run + + // Make the request using config provided + // Upon response settle the Promise + + return new Promise(function(resolve, reject) { + + var response = { + data: responseData, + status: request.status, + statusText: request.statusText, + headers: responseHeaders, + config: config, + request: request + }; + + settle(resolve, reject, response); + + // From here: + // - response transformers will run + // - response interceptors will run + }); +} +``` diff --git a/node_modules/xfarr-api/node_modules/axios/lib/adapters/http.js b/node_modules/xfarr-api/node_modules/axios/lib/adapters/http.js new file mode 100644 index 000000000..0cca3bdfb --- /dev/null +++ b/node_modules/xfarr-api/node_modules/axios/lib/adapters/http.js @@ -0,0 +1,331 @@ +'use strict'; + +var utils = require('./../utils'); +var settle = require('./../core/settle'); +var buildFullPath = require('../core/buildFullPath'); +var buildURL = require('./../helpers/buildURL'); +var http = require('http'); +var https = require('https'); +var httpFollow = require('follow-redirects').http; +var httpsFollow = require('follow-redirects').https; +var url = require('url'); +var zlib = require('zlib'); +var pkg = require('./../../package.json'); +var createError = require('../core/createError'); +var enhanceError = require('../core/enhanceError'); + +var isHttps = /https:?/; + +/** + * + * @param {http.ClientRequestArgs} options + * @param {AxiosProxyConfig} proxy + * @param {string} location + */ +function setProxy(options, proxy, location) { + options.hostname = proxy.host; + options.host = proxy.host; + options.port = proxy.port; + options.path = location; + + // Basic proxy authorization + if (proxy.auth) { + var base64 = Buffer.from(proxy.auth.username + ':' + proxy.auth.password, 'utf8').toString('base64'); + options.headers['Proxy-Authorization'] = 'Basic ' + base64; + } + + // If a proxy is used, any redirects must also pass through the proxy + options.beforeRedirect = function beforeRedirect(redirection) { + redirection.headers.host = redirection.host; + setProxy(redirection, proxy, redirection.href); + }; +} + +/*eslint consistent-return:0*/ +module.exports = function httpAdapter(config) { + return new Promise(function dispatchHttpRequest(resolvePromise, rejectPromise) { + var resolve = function resolve(value) { + resolvePromise(value); + }; + var reject = function reject(value) { + rejectPromise(value); + }; + var data = config.data; + var headers = config.headers; + + // Set User-Agent (required by some servers) + // See https://github.com/axios/axios/issues/69 + if ('User-Agent' in headers || 'user-agent' in headers) { + // User-Agent is specified; handle case where no UA header is desired + if (!headers['User-Agent'] && !headers['user-agent']) { + delete headers['User-Agent']; + delete headers['user-agent']; + } + // Otherwise, use specified value + } else { + // Only set header if it hasn't been set in config + headers['User-Agent'] = 'axios/' + pkg.version; + } + + if (data && !utils.isStream(data)) { + if (Buffer.isBuffer(data)) { + // Nothing to do... + } else if (utils.isArrayBuffer(data)) { + data = Buffer.from(new Uint8Array(data)); + } else if (utils.isString(data)) { + data = Buffer.from(data, 'utf-8'); + } else { + return reject(createError( + 'Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream', + config + )); + } + + // Add Content-Length header if data exists + headers['Content-Length'] = data.length; + } + + // HTTP basic authentication + var auth = undefined; + if (config.auth) { + var username = config.auth.username || ''; + var password = config.auth.password || ''; + auth = username + ':' + password; + } + + // Parse url + var fullPath = buildFullPath(config.baseURL, config.url); + var parsed = url.parse(fullPath); + var protocol = parsed.protocol || 'http:'; + + if (!auth && parsed.auth) { + var urlAuth = parsed.auth.split(':'); + var urlUsername = urlAuth[0] || ''; + var urlPassword = urlAuth[1] || ''; + auth = urlUsername + ':' + urlPassword; + } + + if (auth) { + delete headers.Authorization; + } + + var isHttpsRequest = isHttps.test(protocol); + var agent = isHttpsRequest ? config.httpsAgent : config.httpAgent; + + var options = { + path: buildURL(parsed.path, config.params, config.paramsSerializer).replace(/^\?/, ''), + method: config.method.toUpperCase(), + headers: headers, + agent: agent, + agents: { http: config.httpAgent, https: config.httpsAgent }, + auth: auth + }; + + if (config.socketPath) { + options.socketPath = config.socketPath; + } else { + options.hostname = parsed.hostname; + options.port = parsed.port; + } + + var proxy = config.proxy; + if (!proxy && proxy !== false) { + var proxyEnv = protocol.slice(0, -1) + '_proxy'; + var proxyUrl = process.env[proxyEnv] || process.env[proxyEnv.toUpperCase()]; + if (proxyUrl) { + var parsedProxyUrl = url.parse(proxyUrl); + var noProxyEnv = process.env.no_proxy || process.env.NO_PROXY; + var shouldProxy = true; + + if (noProxyEnv) { + var noProxy = noProxyEnv.split(',').map(function trim(s) { + return s.trim(); + }); + + shouldProxy = !noProxy.some(function proxyMatch(proxyElement) { + if (!proxyElement) { + return false; + } + if (proxyElement === '*') { + return true; + } + if (proxyElement[0] === '.' && + parsed.hostname.substr(parsed.hostname.length - proxyElement.length) === proxyElement) { + return true; + } + + return parsed.hostname === proxyElement; + }); + } + + if (shouldProxy) { + proxy = { + host: parsedProxyUrl.hostname, + port: parsedProxyUrl.port, + protocol: parsedProxyUrl.protocol + }; + + if (parsedProxyUrl.auth) { + var proxyUrlAuth = parsedProxyUrl.auth.split(':'); + proxy.auth = { + username: proxyUrlAuth[0], + password: proxyUrlAuth[1] + }; + } + } + } + } + + if (proxy) { + options.headers.host = parsed.hostname + (parsed.port ? ':' + parsed.port : ''); + setProxy(options, proxy, protocol + '//' + parsed.hostname + (parsed.port ? ':' + parsed.port : '') + options.path); + } + + var transport; + var isHttpsProxy = isHttpsRequest && (proxy ? isHttps.test(proxy.protocol) : true); + if (config.transport) { + transport = config.transport; + } else if (config.maxRedirects === 0) { + transport = isHttpsProxy ? https : http; + } else { + if (config.maxRedirects) { + options.maxRedirects = config.maxRedirects; + } + transport = isHttpsProxy ? httpsFollow : httpFollow; + } + + if (config.maxBodyLength > -1) { + options.maxBodyLength = config.maxBodyLength; + } + + // Create the request + var req = transport.request(options, function handleResponse(res) { + if (req.aborted) return; + + // uncompress the response body transparently if required + var stream = res; + + // return the last request in case of redirects + var lastRequest = res.req || req; + + + // if no content, is HEAD request or decompress disabled we should not decompress + if (res.statusCode !== 204 && lastRequest.method !== 'HEAD' && config.decompress !== false) { + switch (res.headers['content-encoding']) { + /*eslint default-case:0*/ + case 'gzip': + case 'compress': + case 'deflate': + // add the unzipper to the body stream processing pipeline + stream = stream.pipe(zlib.createUnzip()); + + // remove the content-encoding in order to not confuse downstream operations + delete res.headers['content-encoding']; + break; + } + } + + var response = { + status: res.statusCode, + statusText: res.statusMessage, + headers: res.headers, + config: config, + request: lastRequest + }; + + if (config.responseType === 'stream') { + response.data = stream; + settle(resolve, reject, response); + } else { + var responseBuffer = []; + var totalResponseBytes = 0; + stream.on('data', function handleStreamData(chunk) { + responseBuffer.push(chunk); + totalResponseBytes += chunk.length; + + // make sure the content length is not over the maxContentLength if specified + if (config.maxContentLength > -1 && totalResponseBytes > config.maxContentLength) { + stream.destroy(); + reject(createError('maxContentLength size of ' + config.maxContentLength + ' exceeded', + config, null, lastRequest)); + } + }); + + stream.on('error', function handleStreamError(err) { + if (req.aborted) return; + reject(enhanceError(err, config, null, lastRequest)); + }); + + stream.on('end', function handleStreamEnd() { + var responseData = Buffer.concat(responseBuffer); + if (config.responseType !== 'arraybuffer') { + responseData = responseData.toString(config.responseEncoding); + if (!config.responseEncoding || config.responseEncoding === 'utf8') { + responseData = utils.stripBOM(responseData); + } + } + + response.data = responseData; + settle(resolve, reject, response); + }); + } + }); + + // Handle errors + req.on('error', function handleRequestError(err) { + if (req.aborted && err.code !== 'ERR_FR_TOO_MANY_REDIRECTS') return; + reject(enhanceError(err, config, null, req)); + }); + + // Handle request timeout + if (config.timeout) { + // This is forcing a int timeout to avoid problems if the `req` interface doesn't handle other types. + var timeout = parseInt(config.timeout, 10); + + if (isNaN(timeout)) { + reject(createError( + 'error trying to parse `config.timeout` to int', + config, + 'ERR_PARSE_TIMEOUT', + req + )); + + return; + } + + // Sometime, the response will be very slow, and does not respond, the connect event will be block by event loop system. + // And timer callback will be fired, and abort() will be invoked before connection, then get "socket hang up" and code ECONNRESET. + // At this time, if we have a large number of request, nodejs will hang up some socket on background. and the number will up and up. + // And then these socket which be hang up will devoring CPU little by little. + // ClientRequest.setTimeout will be fired on the specify milliseconds, and can make sure that abort() will be fired after connect. + req.setTimeout(timeout, function handleRequestTimeout() { + req.abort(); + reject(createError( + 'timeout of ' + timeout + 'ms exceeded', + config, + config.transitional && config.transitional.clarifyTimeoutError ? 'ETIMEDOUT' : 'ECONNABORTED', + req + )); + }); + } + + if (config.cancelToken) { + // Handle cancellation + config.cancelToken.promise.then(function onCanceled(cancel) { + if (req.aborted) return; + + req.abort(); + reject(cancel); + }); + } + + // Send the request + if (utils.isStream(data)) { + data.on('error', function handleStreamError(err) { + reject(enhanceError(err, config, null, req)); + }).pipe(req); + } else { + req.end(data); + } + }); +}; diff --git a/node_modules/xfarr-api/node_modules/axios/lib/adapters/xhr.js b/node_modules/xfarr-api/node_modules/axios/lib/adapters/xhr.js new file mode 100644 index 000000000..a386dd24a --- /dev/null +++ b/node_modules/xfarr-api/node_modules/axios/lib/adapters/xhr.js @@ -0,0 +1,189 @@ +'use strict'; + +var utils = require('./../utils'); +var settle = require('./../core/settle'); +var cookies = require('./../helpers/cookies'); +var buildURL = require('./../helpers/buildURL'); +var buildFullPath = require('../core/buildFullPath'); +var parseHeaders = require('./../helpers/parseHeaders'); +var isURLSameOrigin = require('./../helpers/isURLSameOrigin'); +var createError = require('../core/createError'); + +module.exports = function xhrAdapter(config) { + return new Promise(function dispatchXhrRequest(resolve, reject) { + var requestData = config.data; + var requestHeaders = config.headers; + var responseType = config.responseType; + + if (utils.isFormData(requestData)) { + delete requestHeaders['Content-Type']; // Let the browser set it + } + + var request = new XMLHttpRequest(); + + // HTTP basic authentication + if (config.auth) { + var username = config.auth.username || ''; + var password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : ''; + requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password); + } + + var fullPath = buildFullPath(config.baseURL, config.url); + request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true); + + // Set the request timeout in MS + request.timeout = config.timeout; + + function onloadend() { + if (!request) { + return; + } + // Prepare the response + var responseHeaders = 'getAllResponseHeaders' in request ? parseHeaders(request.getAllResponseHeaders()) : null; + var responseData = !responseType || responseType === 'text' || responseType === 'json' ? + request.responseText : request.response; + var response = { + data: responseData, + status: request.status, + statusText: request.statusText, + headers: responseHeaders, + config: config, + request: request + }; + + settle(resolve, reject, response); + + // Clean up request + request = null; + } + + if ('onloadend' in request) { + // Use onloadend if available + request.onloadend = onloadend; + } else { + // Listen for ready state to emulate onloadend + request.onreadystatechange = function handleLoad() { + if (!request || request.readyState !== 4) { + return; + } + + // The request errored out and we didn't get a response, this will be + // handled by onerror instead + // With one exception: request that using file: protocol, most browsers + // will return status as 0 even though it's a successful request + if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) { + return; + } + // readystate handler is calling before onerror or ontimeout handlers, + // so we should call onloadend on the next 'tick' + setTimeout(onloadend); + }; + } + + // Handle browser request cancellation (as opposed to a manual cancellation) + request.onabort = function handleAbort() { + if (!request) { + return; + } + + reject(createError('Request aborted', config, 'ECONNABORTED', request)); + + // Clean up request + request = null; + }; + + // Handle low level network errors + request.onerror = function handleError() { + // Real errors are hidden from us by the browser + // onerror should only fire if it's a network error + reject(createError('Network Error', config, null, request)); + + // Clean up request + request = null; + }; + + // Handle timeout + request.ontimeout = function handleTimeout() { + var timeoutErrorMessage = 'timeout of ' + config.timeout + 'ms exceeded'; + if (config.timeoutErrorMessage) { + timeoutErrorMessage = config.timeoutErrorMessage; + } + reject(createError( + timeoutErrorMessage, + config, + config.transitional && config.transitional.clarifyTimeoutError ? 'ETIMEDOUT' : 'ECONNABORTED', + request)); + + // Clean up request + request = null; + }; + + // Add xsrf header + // This is only done if running in a standard browser environment. + // Specifically not if we're in a web worker, or react-native. + if (utils.isStandardBrowserEnv()) { + // Add xsrf header + var xsrfValue = (config.withCredentials || isURLSameOrigin(fullPath)) && config.xsrfCookieName ? + cookies.read(config.xsrfCookieName) : + undefined; + + if (xsrfValue) { + requestHeaders[config.xsrfHeaderName] = xsrfValue; + } + } + + // Add headers to the request + if ('setRequestHeader' in request) { + utils.forEach(requestHeaders, function setRequestHeader(val, key) { + if (typeof requestData === 'undefined' && key.toLowerCase() === 'content-type') { + // Remove Content-Type if data is undefined + delete requestHeaders[key]; + } else { + // Otherwise add header to the request + request.setRequestHeader(key, val); + } + }); + } + + // Add withCredentials to request if needed + if (!utils.isUndefined(config.withCredentials)) { + request.withCredentials = !!config.withCredentials; + } + + // Add responseType to request if needed + if (responseType && responseType !== 'json') { + request.responseType = config.responseType; + } + + // Handle progress if needed + if (typeof config.onDownloadProgress === 'function') { + request.addEventListener('progress', config.onDownloadProgress); + } + + // Not all browsers support upload events + if (typeof config.onUploadProgress === 'function' && request.upload) { + request.upload.addEventListener('progress', config.onUploadProgress); + } + + if (config.cancelToken) { + // Handle cancellation + config.cancelToken.promise.then(function onCanceled(cancel) { + if (!request) { + return; + } + + request.abort(); + reject(cancel); + // Clean up request + request = null; + }); + } + + if (!requestData) { + requestData = null; + } + + // Send the request + request.send(requestData); + }); +}; diff --git a/node_modules/xfarr-api/node_modules/axios/lib/axios.js b/node_modules/xfarr-api/node_modules/axios/lib/axios.js new file mode 100644 index 000000000..c6357b005 --- /dev/null +++ b/node_modules/xfarr-api/node_modules/axios/lib/axios.js @@ -0,0 +1,56 @@ +'use strict'; + +var utils = require('./utils'); +var bind = require('./helpers/bind'); +var Axios = require('./core/Axios'); +var mergeConfig = require('./core/mergeConfig'); +var defaults = require('./defaults'); + +/** + * Create an instance of Axios + * + * @param {Object} defaultConfig The default config for the instance + * @return {Axios} A new instance of Axios + */ +function createInstance(defaultConfig) { + var context = new Axios(defaultConfig); + var instance = bind(Axios.prototype.request, context); + + // Copy axios.prototype to instance + utils.extend(instance, Axios.prototype, context); + + // Copy context to instance + utils.extend(instance, context); + + return instance; +} + +// Create the default instance to be exported +var axios = createInstance(defaults); + +// Expose Axios class to allow class inheritance +axios.Axios = Axios; + +// Factory for creating new instances +axios.create = function create(instanceConfig) { + return createInstance(mergeConfig(axios.defaults, instanceConfig)); +}; + +// Expose Cancel & CancelToken +axios.Cancel = require('./cancel/Cancel'); +axios.CancelToken = require('./cancel/CancelToken'); +axios.isCancel = require('./cancel/isCancel'); + +// Expose all/spread +axios.all = function all(promises) { + return Promise.all(promises); +}; +axios.spread = require('./helpers/spread'); + +// Expose isAxiosError +axios.isAxiosError = require('./helpers/isAxiosError'); + +module.exports = axios; + +// Allow use of default import syntax in TypeScript +module.exports.default = axios; diff --git a/node_modules/xfarr-api/node_modules/axios/lib/cancel/Cancel.js b/node_modules/xfarr-api/node_modules/axios/lib/cancel/Cancel.js new file mode 100644 index 000000000..e0de4003f --- /dev/null +++ b/node_modules/xfarr-api/node_modules/axios/lib/cancel/Cancel.js @@ -0,0 +1,19 @@ +'use strict'; + +/** + * A `Cancel` is an object that is thrown when an operation is canceled. + * + * @class + * @param {string=} message The message. + */ +function Cancel(message) { + this.message = message; +} + +Cancel.prototype.toString = function toString() { + return 'Cancel' + (this.message ? ': ' + this.message : ''); +}; + +Cancel.prototype.__CANCEL__ = true; + +module.exports = Cancel; diff --git a/node_modules/xfarr-api/node_modules/axios/lib/cancel/CancelToken.js b/node_modules/xfarr-api/node_modules/axios/lib/cancel/CancelToken.js new file mode 100644 index 000000000..6b46e6662 --- /dev/null +++ b/node_modules/xfarr-api/node_modules/axios/lib/cancel/CancelToken.js @@ -0,0 +1,57 @@ +'use strict'; + +var Cancel = require('./Cancel'); + +/** + * A `CancelToken` is an object that can be used to request cancellation of an operation. + * + * @class + * @param {Function} executor The executor function. + */ +function CancelToken(executor) { + if (typeof executor !== 'function') { + throw new TypeError('executor must be a function.'); + } + + var resolvePromise; + this.promise = new Promise(function promiseExecutor(resolve) { + resolvePromise = resolve; + }); + + var token = this; + executor(function cancel(message) { + if (token.reason) { + // Cancellation has already been requested + return; + } + + token.reason = new Cancel(message); + resolvePromise(token.reason); + }); +} + +/** + * Throws a `Cancel` if cancellation has been requested. + */ +CancelToken.prototype.throwIfRequested = function throwIfRequested() { + if (this.reason) { + throw this.reason; + } +}; + +/** + * Returns an object that contains a new `CancelToken` and a function that, when called, + * cancels the `CancelToken`. + */ +CancelToken.source = function source() { + var cancel; + var token = new CancelToken(function executor(c) { + cancel = c; + }); + return { + token: token, + cancel: cancel + }; +}; + +module.exports = CancelToken; diff --git a/node_modules/xfarr-api/node_modules/axios/lib/cancel/isCancel.js b/node_modules/xfarr-api/node_modules/axios/lib/cancel/isCancel.js new file mode 100644 index 000000000..051f3ae4c --- /dev/null +++ b/node_modules/xfarr-api/node_modules/axios/lib/cancel/isCancel.js @@ -0,0 +1,5 @@ +'use strict'; + +module.exports = function isCancel(value) { + return !!(value && value.__CANCEL__); +}; diff --git a/node_modules/xfarr-api/node_modules/axios/lib/core/Axios.js b/node_modules/xfarr-api/node_modules/axios/lib/core/Axios.js new file mode 100644 index 000000000..42ea75e7e --- /dev/null +++ b/node_modules/xfarr-api/node_modules/axios/lib/core/Axios.js @@ -0,0 +1,148 @@ +'use strict'; + +var utils = require('./../utils'); +var buildURL = require('../helpers/buildURL'); +var InterceptorManager = require('./InterceptorManager'); +var dispatchRequest = require('./dispatchRequest'); +var mergeConfig = require('./mergeConfig'); +var validator = require('../helpers/validator'); + +var validators = validator.validators; +/** + * Create a new instance of Axios + * + * @param {Object} instanceConfig The default config for the instance + */ +function Axios(instanceConfig) { + this.defaults = instanceConfig; + this.interceptors = { + request: new InterceptorManager(), + response: new InterceptorManager() + }; +} + +/** + * Dispatch a request + * + * @param {Object} config The config specific for this request (merged with this.defaults) + */ +Axios.prototype.request = function request(config) { + /*eslint no-param-reassign:0*/ + // Allow for axios('example/url'[, config]) a la fetch API + if (typeof config === 'string') { + config = arguments[1] || {}; + config.url = arguments[0]; + } else { + config = config || {}; + } + + config = mergeConfig(this.defaults, config); + + // Set config.method + if (config.method) { + config.method = config.method.toLowerCase(); + } else if (this.defaults.method) { + config.method = this.defaults.method.toLowerCase(); + } else { + config.method = 'get'; + } + + var transitional = config.transitional; + + if (transitional !== undefined) { + validator.assertOptions(transitional, { + silentJSONParsing: validators.transitional(validators.boolean, '1.0.0'), + forcedJSONParsing: validators.transitional(validators.boolean, '1.0.0'), + clarifyTimeoutError: validators.transitional(validators.boolean, '1.0.0') + }, false); + } + + // filter out skipped interceptors + var requestInterceptorChain = []; + var synchronousRequestInterceptors = true; + this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) { + if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) { + return; + } + + synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous; + + requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected); + }); + + var responseInterceptorChain = []; + this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) { + responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected); + }); + + var promise; + + if (!synchronousRequestInterceptors) { + var chain = [dispatchRequest, undefined]; + + Array.prototype.unshift.apply(chain, requestInterceptorChain); + chain = chain.concat(responseInterceptorChain); + + promise = Promise.resolve(config); + while (chain.length) { + promise = promise.then(chain.shift(), chain.shift()); + } + + return promise; + } + + + var newConfig = config; + while (requestInterceptorChain.length) { + var onFulfilled = requestInterceptorChain.shift(); + var onRejected = requestInterceptorChain.shift(); + try { + newConfig = onFulfilled(newConfig); + } catch (error) { + onRejected(error); + break; + } + } + + try { + promise = dispatchRequest(newConfig); + } catch (error) { + return Promise.reject(error); + } + + while (responseInterceptorChain.length) { + promise = promise.then(responseInterceptorChain.shift(), responseInterceptorChain.shift()); + } + + return promise; +}; + +Axios.prototype.getUri = function getUri(config) { + config = mergeConfig(this.defaults, config); + return buildURL(config.url, config.params, config.paramsSerializer).replace(/^\?/, ''); +}; + +// Provide aliases for supported request methods +utils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) { + /*eslint func-names:0*/ + Axios.prototype[method] = function(url, config) { + return this.request(mergeConfig(config || {}, { + method: method, + url: url, + data: (config || {}).data + })); + }; +}); + +utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) { + /*eslint func-names:0*/ + Axios.prototype[method] = function(url, data, config) { + return this.request(mergeConfig(config || {}, { + method: method, + url: url, + data: data + })); + }; +}); + +module.exports = Axios; diff --git a/node_modules/xfarr-api/node_modules/axios/lib/core/InterceptorManager.js b/node_modules/xfarr-api/node_modules/axios/lib/core/InterceptorManager.js new file mode 100644 index 000000000..900f44880 --- /dev/null +++ b/node_modules/xfarr-api/node_modules/axios/lib/core/InterceptorManager.js @@ -0,0 +1,54 @@ +'use strict'; + +var utils = require('./../utils'); + +function InterceptorManager() { + this.handlers = []; +} + +/** + * Add a new interceptor to the stack + * + * @param {Function} fulfilled The function to handle `then` for a `Promise` + * @param {Function} rejected The function to handle `reject` for a `Promise` + * + * @return {Number} An ID used to remove interceptor later + */ +InterceptorManager.prototype.use = function use(fulfilled, rejected, options) { + this.handlers.push({ + fulfilled: fulfilled, + rejected: rejected, + synchronous: options ? options.synchronous : false, + runWhen: options ? options.runWhen : null + }); + return this.handlers.length - 1; +}; + +/** + * Remove an interceptor from the stack + * + * @param {Number} id The ID that was returned by `use` + */ +InterceptorManager.prototype.eject = function eject(id) { + if (this.handlers[id]) { + this.handlers[id] = null; + } +}; + +/** + * Iterate over all the registered interceptors + * + * This method is particularly useful for skipping over any + * interceptors that may have become `null` calling `eject`. + * + * @param {Function} fn The function to call for each interceptor + */ +InterceptorManager.prototype.forEach = function forEach(fn) { + utils.forEach(this.handlers, function forEachHandler(h) { + if (h !== null) { + fn(h); + } + }); +}; + +module.exports = InterceptorManager; diff --git a/node_modules/xfarr-api/node_modules/axios/lib/core/README.md b/node_modules/xfarr-api/node_modules/axios/lib/core/README.md new file mode 100644 index 000000000..84559ce7c --- /dev/null +++ b/node_modules/xfarr-api/node_modules/axios/lib/core/README.md @@ -0,0 +1,8 @@ +# axios // core + +The modules found in `core/` should be modules that are specific to the domain logic of axios. These modules would most likely not make sense to be consumed outside of the axios module, as their logic is too specific. Some examples of core modules are: + +- Dispatching requests + - Requests sent via `adapters/` (see lib/adapters/README.md) +- Managing interceptors +- Handling config diff --git a/node_modules/xfarr-api/node_modules/axios/lib/core/buildFullPath.js b/node_modules/xfarr-api/node_modules/axios/lib/core/buildFullPath.js new file mode 100644 index 000000000..00b2b050a --- /dev/null +++ b/node_modules/xfarr-api/node_modules/axios/lib/core/buildFullPath.js @@ -0,0 +1,20 @@ +'use strict'; + +var isAbsoluteURL = require('../helpers/isAbsoluteURL'); +var combineURLs = require('../helpers/combineURLs'); + +/** + * Creates a new URL by combining the baseURL with the requestedURL, + * only when the requestedURL is not already an absolute URL. + * If the requestURL is absolute, this function returns the requestedURL untouched. + * + * @param {string} baseURL The base URL + * @param {string} requestedURL Absolute or relative URL to combine + * @returns {string} The combined full path + */ +module.exports = function buildFullPath(baseURL, requestedURL) { + if (baseURL && !isAbsoluteURL(requestedURL)) { + return combineURLs(baseURL, requestedURL); + } + return requestedURL; +}; diff --git a/node_modules/xfarr-api/node_modules/axios/lib/core/createError.js b/node_modules/xfarr-api/node_modules/axios/lib/core/createError.js new file mode 100644 index 000000000..933680f69 --- /dev/null +++ b/node_modules/xfarr-api/node_modules/axios/lib/core/createError.js @@ -0,0 +1,18 @@ +'use strict'; + +var enhanceError = require('./enhanceError'); + +/** + * Create an Error with the specified message, config, error code, request and response. + * + * @param {string} message The error message. + * @param {Object} config The config. + * @param {string} [code] The error code (for example, 'ECONNABORTED'). + * @param {Object} [request] The request. + * @param {Object} [response] The response. + * @returns {Error} The created error. + */ +module.exports = function createError(message, config, code, request, response) { + var error = new Error(message); + return enhanceError(error, config, code, request, response); +}; diff --git a/node_modules/xfarr-api/node_modules/axios/lib/core/dispatchRequest.js b/node_modules/xfarr-api/node_modules/axios/lib/core/dispatchRequest.js new file mode 100644 index 000000000..9ce3b96e6 --- /dev/null +++ b/node_modules/xfarr-api/node_modules/axios/lib/core/dispatchRequest.js @@ -0,0 +1,82 @@ +'use strict'; + +var utils = require('./../utils'); +var transformData = require('./transformData'); +var isCancel = require('../cancel/isCancel'); +var defaults = require('../defaults'); + +/** + * Throws a `Cancel` if cancellation has been requested. + */ +function throwIfCancellationRequested(config) { + if (config.cancelToken) { + config.cancelToken.throwIfRequested(); + } +} + +/** + * Dispatch a request to the server using the configured adapter. + * + * @param {object} config The config that is to be used for the request + * @returns {Promise} The Promise to be fulfilled + */ +module.exports = function dispatchRequest(config) { + throwIfCancellationRequested(config); + + // Ensure headers exist + config.headers = config.headers || {}; + + // Transform request data + config.data = transformData.call( + config, + config.data, + config.headers, + config.transformRequest + ); + + // Flatten headers + config.headers = utils.merge( + config.headers.common || {}, + config.headers[config.method] || {}, + config.headers + ); + + utils.forEach( + ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'], + function cleanHeaderConfig(method) { + delete config.headers[method]; + } + ); + + var adapter = config.adapter || defaults.adapter; + + return adapter(config).then(function onAdapterResolution(response) { + throwIfCancellationRequested(config); + + // Transform response data + response.data = transformData.call( + config, + response.data, + response.headers, + config.transformResponse + ); + + return response; + }, function onAdapterRejection(reason) { + if (!isCancel(reason)) { + throwIfCancellationRequested(config); + + // Transform response data + if (reason && reason.response) { + reason.response.data = transformData.call( + config, + reason.response.data, + reason.response.headers, + config.transformResponse + ); + } + } + + return Promise.reject(reason); + }); +}; diff --git a/node_modules/xfarr-api/node_modules/axios/lib/core/enhanceError.js b/node_modules/xfarr-api/node_modules/axios/lib/core/enhanceError.js new file mode 100644 index 000000000..b6bc4444e --- /dev/null +++ b/node_modules/xfarr-api/node_modules/axios/lib/core/enhanceError.js @@ -0,0 +1,42 @@ +'use strict'; + +/** + * Update an Error with the specified config, error code, and response. + * + * @param {Error} error The error to update. + * @param {Object} config The config. + * @param {string} [code] The error code (for example, 'ECONNABORTED'). + * @param {Object} [request] The request. + * @param {Object} [response] The response. + * @returns {Error} The error. + */ +module.exports = function enhanceError(error, config, code, request, response) { + error.config = config; + if (code) { + error.code = code; + } + + error.request = request; + error.response = response; + error.isAxiosError = true; + + error.toJSON = function toJSON() { + return { + // Standard + message: this.message, + name: this.name, + // Microsoft + description: this.description, + number: this.number, + // Mozilla + fileName: this.fileName, + lineNumber: this.lineNumber, + columnNumber: this.columnNumber, + stack: this.stack, + // Axios + config: this.config, + code: this.code + }; + }; + return error; +}; diff --git a/node_modules/xfarr-api/node_modules/axios/lib/core/mergeConfig.js b/node_modules/xfarr-api/node_modules/axios/lib/core/mergeConfig.js new file mode 100644 index 000000000..5a2c10cb0 --- /dev/null +++ b/node_modules/xfarr-api/node_modules/axios/lib/core/mergeConfig.js @@ -0,0 +1,87 @@ +'use strict'; + +var utils = require('../utils'); + +/** + * Config-specific merge-function which creates a new config-object + * by merging two configuration objects together. + * + * @param {Object} config1 + * @param {Object} config2 + * @returns {Object} New object resulting from merging config2 to config1 + */ +module.exports = function mergeConfig(config1, config2) { + // eslint-disable-next-line no-param-reassign + config2 = config2 || {}; + var config = {}; + + var valueFromConfig2Keys = ['url', 'method', 'data']; + var mergeDeepPropertiesKeys = ['headers', 'auth', 'proxy', 'params']; + var defaultToConfig2Keys = [ + 'baseURL', 'transformRequest', 'transformResponse', 'paramsSerializer', + 'timeout', 'timeoutMessage', 'withCredentials', 'adapter', 'responseType', 'xsrfCookieName', + 'xsrfHeaderName', 'onUploadProgress', 'onDownloadProgress', 'decompress', + 'maxContentLength', 'maxBodyLength', 'maxRedirects', 'transport', 'httpAgent', + 'httpsAgent', 'cancelToken', 'socketPath', 'responseEncoding' + ]; + var directMergeKeys = ['validateStatus']; + + function getMergedValue(target, source) { + if (utils.isPlainObject(target) && utils.isPlainObject(source)) { + return utils.merge(target, source); + } else if (utils.isPlainObject(source)) { + return utils.merge({}, source); + } else if (utils.isArray(source)) { + return source.slice(); + } + return source; + } + + function mergeDeepProperties(prop) { + if (!utils.isUndefined(config2[prop])) { + config[prop] = getMergedValue(config1[prop], config2[prop]); + } else if (!utils.isUndefined(config1[prop])) { + config[prop] = getMergedValue(undefined, config1[prop]); + } + } + + utils.forEach(valueFromConfig2Keys, function valueFromConfig2(prop) { + if (!utils.isUndefined(config2[prop])) { + config[prop] = getMergedValue(undefined, config2[prop]); + } + }); + + utils.forEach(mergeDeepPropertiesKeys, mergeDeepProperties); + + utils.forEach(defaultToConfig2Keys, function defaultToConfig2(prop) { + if (!utils.isUndefined(config2[prop])) { + config[prop] = getMergedValue(undefined, config2[prop]); + } else if (!utils.isUndefined(config1[prop])) { + config[prop] = getMergedValue(undefined, config1[prop]); + } + }); + + utils.forEach(directMergeKeys, function merge(prop) { + if (prop in config2) { + config[prop] = getMergedValue(config1[prop], config2[prop]); + } else if (prop in config1) { + config[prop] = getMergedValue(undefined, config1[prop]); + } + }); + + var axiosKeys = valueFromConfig2Keys + .concat(mergeDeepPropertiesKeys) + .concat(defaultToConfig2Keys) + .concat(directMergeKeys); + + var otherKeys = Object + .keys(config1) + .concat(Object.keys(config2)) + .filter(function filterAxiosKeys(key) { + return axiosKeys.indexOf(key) === -1; + }); + + utils.forEach(otherKeys, mergeDeepProperties); + + return config; +}; diff --git a/node_modules/xfarr-api/node_modules/axios/lib/core/settle.js b/node_modules/xfarr-api/node_modules/axios/lib/core/settle.js new file mode 100644 index 000000000..886adb0c1 --- /dev/null +++ b/node_modules/xfarr-api/node_modules/axios/lib/core/settle.js @@ -0,0 +1,25 @@ +'use strict'; + +var createError = require('./createError'); + +/** + * Resolve or reject a Promise based on response status. + * + * @param {Function} resolve A function that resolves the promise. + * @param {Function} reject A function that rejects the promise. + * @param {object} response The response. + */ +module.exports = function settle(resolve, reject, response) { + var validateStatus = response.config.validateStatus; + if (!response.status || !validateStatus || validateStatus(response.status)) { + resolve(response); + } else { + reject(createError( + 'Request failed with status code ' + response.status, + response.config, + null, + response.request, + response + )); + } +}; diff --git a/node_modules/xfarr-api/node_modules/axios/lib/core/transformData.js b/node_modules/xfarr-api/node_modules/axios/lib/core/transformData.js new file mode 100644 index 000000000..c584d12bc --- /dev/null +++ b/node_modules/xfarr-api/node_modules/axios/lib/core/transformData.js @@ -0,0 +1,22 @@ +'use strict'; + +var utils = require('./../utils'); +var defaults = require('./../defaults'); + +/** + * Transform the data for a request or a response + * + * @param {Object|String} data The data to be transformed + * @param {Array} headers The headers for the request or response + * @param {Array|Function} fns A single function or Array of functions + * @returns {*} The resulting transformed data + */ +module.exports = function transformData(data, headers, fns) { + var context = this || defaults; + /*eslint no-param-reassign:0*/ + utils.forEach(fns, function transform(fn) { + data = fn.call(context, data, headers); + }); + + return data; +}; diff --git a/node_modules/xfarr-api/node_modules/axios/lib/defaults.js b/node_modules/xfarr-api/node_modules/axios/lib/defaults.js new file mode 100644 index 000000000..55e69d9ae --- /dev/null +++ b/node_modules/xfarr-api/node_modules/axios/lib/defaults.js @@ -0,0 +1,134 @@ +'use strict'; + +var utils = require('./utils'); +var normalizeHeaderName = require('./helpers/normalizeHeaderName'); +var enhanceError = require('./core/enhanceError'); + +var DEFAULT_CONTENT_TYPE = { + 'Content-Type': 'application/x-www-form-urlencoded' +}; + +function setContentTypeIfUnset(headers, value) { + if (!utils.isUndefined(headers) && utils.isUndefined(headers['Content-Type'])) { + headers['Content-Type'] = value; + } +} + +function getDefaultAdapter() { + var adapter; + if (typeof XMLHttpRequest !== 'undefined') { + // For browsers use XHR adapter + adapter = require('./adapters/xhr'); + } else if (typeof process !== 'undefined' && Object.prototype.toString.call(process) === '[object process]') { + // For node use HTTP adapter + adapter = require('./adapters/http'); + } + return adapter; +} + +function stringifySafely(rawValue, parser, encoder) { + if (utils.isString(rawValue)) { + try { + (parser || JSON.parse)(rawValue); + return utils.trim(rawValue); + } catch (e) { + if (e.name !== 'SyntaxError') { + throw e; + } + } + } + + return (encoder || JSON.stringify)(rawValue); +} + +var defaults = { + + transitional: { + silentJSONParsing: true, + forcedJSONParsing: true, + clarifyTimeoutError: false + }, + + adapter: getDefaultAdapter(), + + transformRequest: [function transformRequest(data, headers) { + normalizeHeaderName(headers, 'Accept'); + normalizeHeaderName(headers, 'Content-Type'); + + if (utils.isFormData(data) || + utils.isArrayBuffer(data) || + utils.isBuffer(data) || + utils.isStream(data) || + utils.isFile(data) || + utils.isBlob(data) + ) { + return data; + } + if (utils.isArrayBufferView(data)) { + return data.buffer; + } + if (utils.isURLSearchParams(data)) { + setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8'); + return data.toString(); + } + if (utils.isObject(data) || (headers && headers['Content-Type'] === 'application/json')) { + setContentTypeIfUnset(headers, 'application/json'); + return stringifySafely(data); + } + return data; + }], + + transformResponse: [function transformResponse(data) { + var transitional = this.transitional; + var silentJSONParsing = transitional && transitional.silentJSONParsing; + var forcedJSONParsing = transitional && transitional.forcedJSONParsing; + var strictJSONParsing = !silentJSONParsing && this.responseType === 'json'; + + if (strictJSONParsing || (forcedJSONParsing && utils.isString(data) && data.length)) { + try { + return JSON.parse(data); + } catch (e) { + if (strictJSONParsing) { + if (e.name === 'SyntaxError') { + throw enhanceError(e, this, 'E_JSON_PARSE'); + } + throw e; + } + } + } + + return data; + }], + + /** + * A timeout in milliseconds to abort a request. If set to 0 (default) a + * timeout is not created. + */ + timeout: 0, + + xsrfCookieName: 'XSRF-TOKEN', + xsrfHeaderName: 'X-XSRF-TOKEN', + + maxContentLength: -1, + maxBodyLength: -1, + + validateStatus: function validateStatus(status) { + return status >= 200 && status < 300; + } +}; + +defaults.headers = { + common: { + 'Accept': 'application/json, text/plain, */*' + } +}; + +utils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) { + defaults.headers[method] = {}; +}); + +utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) { + defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE); +}); + +module.exports = defaults; diff --git a/node_modules/xfarr-api/node_modules/axios/lib/helpers/README.md b/node_modules/xfarr-api/node_modules/axios/lib/helpers/README.md new file mode 100644 index 000000000..4ae34193a --- /dev/null +++ b/node_modules/xfarr-api/node_modules/axios/lib/helpers/README.md @@ -0,0 +1,7 @@ +# axios // helpers + +The modules found in `helpers/` should be generic modules that are _not_ specific to the domain logic of axios. These modules could theoretically be published to npm on their own and consumed by other modules or apps. Some examples of generic modules are things like: + +- Browser polyfills +- Managing cookies +- Parsing HTTP headers diff --git a/node_modules/xfarr-api/node_modules/axios/lib/helpers/bind.js b/node_modules/xfarr-api/node_modules/axios/lib/helpers/bind.js new file mode 100644 index 000000000..6147c608e --- /dev/null +++ b/node_modules/xfarr-api/node_modules/axios/lib/helpers/bind.js @@ -0,0 +1,11 @@ +'use strict'; + +module.exports = function bind(fn, thisArg) { + return function wrap() { + var args = new Array(arguments.length); + for (var i = 0; i < args.length; i++) { + args[i] = arguments[i]; + } + return fn.apply(thisArg, args); + }; +}; diff --git a/node_modules/xfarr-api/node_modules/axios/lib/helpers/buildURL.js b/node_modules/xfarr-api/node_modules/axios/lib/helpers/buildURL.js new file mode 100644 index 000000000..31595c33a --- /dev/null +++ b/node_modules/xfarr-api/node_modules/axios/lib/helpers/buildURL.js @@ -0,0 +1,70 @@ +'use strict'; + +var utils = require('./../utils'); + +function encode(val) { + return encodeURIComponent(val). + replace(/%3A/gi, ':'). + replace(/%24/g, '$'). + replace(/%2C/gi, ','). + replace(/%20/g, '+'). + replace(/%5B/gi, '['). + replace(/%5D/gi, ']'); +} + +/** + * Build a URL by appending params to the end + * + * @param {string} url The base of the url (e.g., http://www.google.com) + * @param {object} [params] The params to be appended + * @returns {string} The formatted url + */ +module.exports = function buildURL(url, params, paramsSerializer) { + /*eslint no-param-reassign:0*/ + if (!params) { + return url; + } + + var serializedParams; + if (paramsSerializer) { + serializedParams = paramsSerializer(params); + } else if (utils.isURLSearchParams(params)) { + serializedParams = params.toString(); + } else { + var parts = []; + + utils.forEach(params, function serialize(val, key) { + if (val === null || typeof val === 'undefined') { + return; + } + + if (utils.isArray(val)) { + key = key + '[]'; + } else { + val = [val]; + } + + utils.forEach(val, function parseValue(v) { + if (utils.isDate(v)) { + v = v.toISOString(); + } else if (utils.isObject(v)) { + v = JSON.stringify(v); + } + parts.push(encode(key) + '=' + encode(v)); + }); + }); + + serializedParams = parts.join('&'); + } + + if (serializedParams) { + var hashmarkIndex = url.indexOf('#'); + if (hashmarkIndex !== -1) { + url = url.slice(0, hashmarkIndex); + } + + url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams; + } + + return url; +}; diff --git a/node_modules/xfarr-api/node_modules/axios/lib/helpers/combineURLs.js b/node_modules/xfarr-api/node_modules/axios/lib/helpers/combineURLs.js new file mode 100644 index 000000000..f1b58a586 --- /dev/null +++ b/node_modules/xfarr-api/node_modules/axios/lib/helpers/combineURLs.js @@ -0,0 +1,14 @@ +'use strict'; + +/** + * Creates a new URL by combining the specified URLs + * + * @param {string} baseURL The base URL + * @param {string} relativeURL The relative URL + * @returns {string} The combined URL + */ +module.exports = function combineURLs(baseURL, relativeURL) { + return relativeURL + ? baseURL.replace(/\/+$/, '') + '/' + relativeURL.replace(/^\/+/, '') + : baseURL; +}; diff --git a/node_modules/xfarr-api/node_modules/axios/lib/helpers/cookies.js b/node_modules/xfarr-api/node_modules/axios/lib/helpers/cookies.js new file mode 100644 index 000000000..5a8a66661 --- /dev/null +++ b/node_modules/xfarr-api/node_modules/axios/lib/helpers/cookies.js @@ -0,0 +1,53 @@ +'use strict'; + +var utils = require('./../utils'); + +module.exports = ( + utils.isStandardBrowserEnv() ? + + // Standard browser envs support document.cookie + (function standardBrowserEnv() { + return { + write: function write(name, value, expires, path, domain, secure) { + var cookie = []; + cookie.push(name + '=' + encodeURIComponent(value)); + + if (utils.isNumber(expires)) { + cookie.push('expires=' + new Date(expires).toGMTString()); + } + + if (utils.isString(path)) { + cookie.push('path=' + path); + } + + if (utils.isString(domain)) { + cookie.push('domain=' + domain); + } + + if (secure === true) { + cookie.push('secure'); + } + + document.cookie = cookie.join('; '); + }, + + read: function read(name) { + var match = document.cookie.match(new RegExp('(^|;\\s*)(' + name + ')=([^;]*)')); + return (match ? decodeURIComponent(match[3]) : null); + }, + + remove: function remove(name) { + this.write(name, '', Date.now() - 86400000); + } + }; + })() : + + // Non standard browser env (web workers, react-native) lack needed support. + (function nonStandardBrowserEnv() { + return { + write: function write() {}, + read: function read() { return null; }, + remove: function remove() {} + }; + })() +); diff --git a/node_modules/xfarr-api/node_modules/axios/lib/helpers/deprecatedMethod.js b/node_modules/xfarr-api/node_modules/axios/lib/helpers/deprecatedMethod.js new file mode 100644 index 000000000..ed40965ba --- /dev/null +++ b/node_modules/xfarr-api/node_modules/axios/lib/helpers/deprecatedMethod.js @@ -0,0 +1,24 @@ +'use strict'; + +/*eslint no-console:0*/ + +/** + * Supply a warning to the developer that a method they are using + * has been deprecated. + * + * @param {string} method The name of the deprecated method + * @param {string} [instead] The alternate method to use if applicable + * @param {string} [docs] The documentation URL to get further details + */ +module.exports = function deprecatedMethod(method, instead, docs) { + try { + console.warn( + 'DEPRECATED method `' + method + '`.' + + (instead ? ' Use `' + instead + '` instead.' : '') + + ' This method will be removed in a future release.'); + + if (docs) { + console.warn('For more information about usage see ' + docs); + } + } catch (e) { /* Ignore */ } +}; diff --git a/node_modules/xfarr-api/node_modules/axios/lib/helpers/isAbsoluteURL.js b/node_modules/xfarr-api/node_modules/axios/lib/helpers/isAbsoluteURL.js new file mode 100644 index 000000000..d33e99275 --- /dev/null +++ b/node_modules/xfarr-api/node_modules/axios/lib/helpers/isAbsoluteURL.js @@ -0,0 +1,14 @@ +'use strict'; + +/** + * Determines whether the specified URL is absolute + * + * @param {string} url The URL to test + * @returns {boolean} True if the specified URL is absolute, otherwise false + */ +module.exports = function isAbsoluteURL(url) { + // A URL is considered absolute if it begins with "://" or "//" (protocol-relative URL). + // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed + // by any combination of letters, digits, plus, period, or hyphen. + return /^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(url); +}; diff --git a/node_modules/xfarr-api/node_modules/axios/lib/helpers/isAxiosError.js b/node_modules/xfarr-api/node_modules/axios/lib/helpers/isAxiosError.js new file mode 100644 index 000000000..29ff41af8 --- /dev/null +++ b/node_modules/xfarr-api/node_modules/axios/lib/helpers/isAxiosError.js @@ -0,0 +1,11 @@ +'use strict'; + +/** + * Determines whether the payload is an error thrown by Axios + * + * @param {*} payload The value to test + * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false + */ +module.exports = function isAxiosError(payload) { + return (typeof payload === 'object') && (payload.isAxiosError === true); +}; diff --git a/node_modules/xfarr-api/node_modules/axios/lib/helpers/isURLSameOrigin.js b/node_modules/xfarr-api/node_modules/axios/lib/helpers/isURLSameOrigin.js new file mode 100644 index 000000000..f1d89ad19 --- /dev/null +++ b/node_modules/xfarr-api/node_modules/axios/lib/helpers/isURLSameOrigin.js @@ -0,0 +1,68 @@ +'use strict'; + +var utils = require('./../utils'); + +module.exports = ( + utils.isStandardBrowserEnv() ? + + // Standard browser envs have full support of the APIs needed to test + // whether the request URL is of the same origin as current location. + (function standardBrowserEnv() { + var msie = /(msie|trident)/i.test(navigator.userAgent); + var urlParsingNode = document.createElement('a'); + var originURL; + + /** + * Parse a URL to discover it's components + * + * @param {String} url The URL to be parsed + * @returns {Object} + */ + function resolveURL(url) { + var href = url; + + if (msie) { + // IE needs attribute set twice to normalize properties + urlParsingNode.setAttribute('href', href); + href = urlParsingNode.href; + } + + urlParsingNode.setAttribute('href', href); + + // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils + return { + href: urlParsingNode.href, + protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '', + host: urlParsingNode.host, + search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, '') : '', + hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '', + hostname: urlParsingNode.hostname, + port: urlParsingNode.port, + pathname: (urlParsingNode.pathname.charAt(0) === '/') ? + urlParsingNode.pathname : + '/' + urlParsingNode.pathname + }; + } + + originURL = resolveURL(window.location.href); + + /** + * Determine if a URL shares the same origin as the current location + * + * @param {String} requestURL The URL to test + * @returns {boolean} True if URL shares the same origin, otherwise false + */ + return function isURLSameOrigin(requestURL) { + var parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL; + return (parsed.protocol === originURL.protocol && + parsed.host === originURL.host); + }; + })() : + + // Non standard browser envs (web workers, react-native) lack needed support. + (function nonStandardBrowserEnv() { + return function isURLSameOrigin() { + return true; + }; + })() +); diff --git a/node_modules/xfarr-api/node_modules/axios/lib/helpers/normalizeHeaderName.js b/node_modules/xfarr-api/node_modules/axios/lib/helpers/normalizeHeaderName.js new file mode 100644 index 000000000..738c9fe40 --- /dev/null +++ b/node_modules/xfarr-api/node_modules/axios/lib/helpers/normalizeHeaderName.js @@ -0,0 +1,12 @@ +'use strict'; + +var utils = require('../utils'); + +module.exports = function normalizeHeaderName(headers, normalizedName) { + utils.forEach(headers, function processHeader(value, name) { + if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) { + headers[normalizedName] = value; + delete headers[name]; + } + }); +}; diff --git a/node_modules/xfarr-api/node_modules/axios/lib/helpers/parseHeaders.js b/node_modules/xfarr-api/node_modules/axios/lib/helpers/parseHeaders.js new file mode 100644 index 000000000..8af2cc7f1 --- /dev/null +++ b/node_modules/xfarr-api/node_modules/axios/lib/helpers/parseHeaders.js @@ -0,0 +1,53 @@ +'use strict'; + +var utils = require('./../utils'); + +// Headers whose duplicates are ignored by node +// c.f. https://nodejs.org/api/http.html#http_message_headers +var ignoreDuplicateOf = [ + 'age', 'authorization', 'content-length', 'content-type', 'etag', + 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since', + 'last-modified', 'location', 'max-forwards', 'proxy-authorization', + 'referer', 'retry-after', 'user-agent' +]; + +/** + * Parse headers into an object + * + * ``` + * Date: Wed, 27 Aug 2014 08:58:49 GMT + * Content-Type: application/json + * Connection: keep-alive + * Transfer-Encoding: chunked + * ``` + * + * @param {String} headers Headers needing to be parsed + * @returns {Object} Headers parsed into an object + */ +module.exports = function parseHeaders(headers) { + var parsed = {}; + var key; + var val; + var i; + + if (!headers) { return parsed; } + + utils.forEach(headers.split('\n'), function parser(line) { + i = line.indexOf(':'); + key = utils.trim(line.substr(0, i)).toLowerCase(); + val = utils.trim(line.substr(i + 1)); + + if (key) { + if (parsed[key] && ignoreDuplicateOf.indexOf(key) >= 0) { + return; + } + if (key === 'set-cookie') { + parsed[key] = (parsed[key] ? parsed[key] : []).concat([val]); + } else { + parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val; + } + } + }); + + return parsed; +}; diff --git a/node_modules/xfarr-api/node_modules/axios/lib/helpers/spread.js b/node_modules/xfarr-api/node_modules/axios/lib/helpers/spread.js new file mode 100644 index 000000000..25e3cdd39 --- /dev/null +++ b/node_modules/xfarr-api/node_modules/axios/lib/helpers/spread.js @@ -0,0 +1,27 @@ +'use strict'; + +/** + * Syntactic sugar for invoking a function and expanding an array for arguments. + * + * Common use case would be to use `Function.prototype.apply`. + * + * ```js + * function f(x, y, z) {} + * var args = [1, 2, 3]; + * f.apply(null, args); + * ``` + * + * With `spread` this example can be re-written. + * + * ```js + * spread(function(x, y, z) {})([1, 2, 3]); + * ``` + * + * @param {Function} callback + * @returns {Function} + */ +module.exports = function spread(callback) { + return function wrap(arr) { + return callback.apply(null, arr); + }; +}; diff --git a/node_modules/xfarr-api/node_modules/axios/lib/helpers/validator.js b/node_modules/xfarr-api/node_modules/axios/lib/helpers/validator.js new file mode 100644 index 000000000..7f1bc7dfa --- /dev/null +++ b/node_modules/xfarr-api/node_modules/axios/lib/helpers/validator.js @@ -0,0 +1,105 @@ +'use strict'; + +var pkg = require('./../../package.json'); + +var validators = {}; + +// eslint-disable-next-line func-names +['object', 'boolean', 'number', 'function', 'string', 'symbol'].forEach(function(type, i) { + validators[type] = function validator(thing) { + return typeof thing === type || 'a' + (i < 1 ? 'n ' : ' ') + type; + }; +}); + +var deprecatedWarnings = {}; +var currentVerArr = pkg.version.split('.'); + +/** + * Compare package versions + * @param {string} version + * @param {string?} thanVersion + * @returns {boolean} + */ +function isOlderVersion(version, thanVersion) { + var pkgVersionArr = thanVersion ? thanVersion.split('.') : currentVerArr; + var destVer = version.split('.'); + for (var i = 0; i < 3; i++) { + if (pkgVersionArr[i] > destVer[i]) { + return true; + } else if (pkgVersionArr[i] < destVer[i]) { + return false; + } + } + return false; +} + +/** + * Transitional option validator + * @param {function|boolean?} validator + * @param {string?} version + * @param {string} message + * @returns {function} + */ +validators.transitional = function transitional(validator, version, message) { + var isDeprecated = version && isOlderVersion(version); + + function formatMessage(opt, desc) { + return '[Axios v' + pkg.version + '] Transitional option \'' + opt + '\'' + desc + (message ? '. ' + message : ''); + } + + // eslint-disable-next-line func-names + return function(value, opt, opts) { + if (validator === false) { + throw new Error(formatMessage(opt, ' has been removed in ' + version)); + } + + if (isDeprecated && !deprecatedWarnings[opt]) { + deprecatedWarnings[opt] = true; + // eslint-disable-next-line no-console + console.warn( + formatMessage( + opt, + ' has been deprecated since v' + version + ' and will be removed in the near future' + ) + ); + } + + return validator ? validator(value, opt, opts) : true; + }; +}; + +/** + * Assert object's properties type + * @param {object} options + * @param {object} schema + * @param {boolean?} allowUnknown + */ + +function assertOptions(options, schema, allowUnknown) { + if (typeof options !== 'object') { + throw new TypeError('options must be an object'); + } + var keys = Object.keys(options); + var i = keys.length; + while (i-- > 0) { + var opt = keys[i]; + var validator = schema[opt]; + if (validator) { + var value = options[opt]; + var result = value === undefined || validator(value, opt, options); + if (result !== true) { + throw new TypeError('option ' + opt + ' must be ' + result); + } + continue; + } + if (allowUnknown !== true) { + throw Error('Unknown option ' + opt); + } + } +} + +module.exports = { + isOlderVersion: isOlderVersion, + assertOptions: assertOptions, + validators: validators +}; diff --git a/node_modules/xfarr-api/node_modules/axios/lib/utils.js b/node_modules/xfarr-api/node_modules/axios/lib/utils.js new file mode 100644 index 000000000..5d966f444 --- /dev/null +++ b/node_modules/xfarr-api/node_modules/axios/lib/utils.js @@ -0,0 +1,349 @@ +'use strict'; + +var bind = require('./helpers/bind'); + +// utils is a library of generic helper functions non-specific to axios + +var toString = Object.prototype.toString; + +/** + * Determine if a value is an Array + * + * @param {Object} val The value to test + * @returns {boolean} True if value is an Array, otherwise false + */ +function isArray(val) { + return toString.call(val) === '[object Array]'; +} + +/** + * Determine if a value is undefined + * + * @param {Object} val The value to test + * @returns {boolean} True if the value is undefined, otherwise false + */ +function isUndefined(val) { + return typeof val === 'undefined'; +} + +/** + * Determine if a value is a Buffer + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a Buffer, otherwise false + */ +function isBuffer(val) { + return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor) + && typeof val.constructor.isBuffer === 'function' && val.constructor.isBuffer(val); +} + +/** + * Determine if a value is an ArrayBuffer + * + * @param {Object} val The value to test + * @returns {boolean} True if value is an ArrayBuffer, otherwise false + */ +function isArrayBuffer(val) { + return toString.call(val) === '[object ArrayBuffer]'; +} + +/** + * Determine if a value is a FormData + * + * @param {Object} val The value to test + * @returns {boolean} True if value is an FormData, otherwise false + */ +function isFormData(val) { + return (typeof FormData !== 'undefined') && (val instanceof FormData); +} + +/** + * Determine if a value is a view on an ArrayBuffer + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false + */ +function isArrayBufferView(val) { + var result; + if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) { + result = ArrayBuffer.isView(val); + } else { + result = (val) && (val.buffer) && (val.buffer instanceof ArrayBuffer); + } + return result; +} + +/** + * Determine if a value is a String + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a String, otherwise false + */ +function isString(val) { + return typeof val === 'string'; +} + +/** + * Determine if a value is a Number + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a Number, otherwise false + */ +function isNumber(val) { + return typeof val === 'number'; +} + +/** + * Determine if a value is an Object + * + * @param {Object} val The value to test + * @returns {boolean} True if value is an Object, otherwise false + */ +function isObject(val) { + return val !== null && typeof val === 'object'; +} + +/** + * Determine if a value is a plain Object + * + * @param {Object} val The value to test + * @return {boolean} True if value is a plain Object, otherwise false + */ +function isPlainObject(val) { + if (toString.call(val) !== '[object Object]') { + return false; + } + + var prototype = Object.getPrototypeOf(val); + return prototype === null || prototype === Object.prototype; +} + +/** + * Determine if a value is a Date + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a Date, otherwise false + */ +function isDate(val) { + return toString.call(val) === '[object Date]'; +} + +/** + * Determine if a value is a File + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a File, otherwise false + */ +function isFile(val) { + return toString.call(val) === '[object File]'; +} + +/** + * Determine if a value is a Blob + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a Blob, otherwise false + */ +function isBlob(val) { + return toString.call(val) === '[object Blob]'; +} + +/** + * Determine if a value is a Function + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a Function, otherwise false + */ +function isFunction(val) { + return toString.call(val) === '[object Function]'; +} + +/** + * Determine if a value is a Stream + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a Stream, otherwise false + */ +function isStream(val) { + return isObject(val) && isFunction(val.pipe); +} + +/** + * Determine if a value is a URLSearchParams object + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a URLSearchParams object, otherwise false + */ +function isURLSearchParams(val) { + return typeof URLSearchParams !== 'undefined' && val instanceof URLSearchParams; +} + +/** + * Trim excess whitespace off the beginning and end of a string + * + * @param {String} str The String to trim + * @returns {String} The String freed of excess whitespace + */ +function trim(str) { + return str.trim ? str.trim() : str.replace(/^\s+|\s+$/g, ''); +} + +/** + * Determine if we're running in a standard browser environment + * + * This allows axios to run in a web worker, and react-native. + * Both environments support XMLHttpRequest, but not fully standard globals. + * + * web workers: + * typeof window -> undefined + * typeof document -> undefined + * + * react-native: + * navigator.product -> 'ReactNative' + * nativescript + * navigator.product -> 'NativeScript' or 'NS' + */ +function isStandardBrowserEnv() { + if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' || + navigator.product === 'NativeScript' || + navigator.product === 'NS')) { + return false; + } + return ( + typeof window !== 'undefined' && + typeof document !== 'undefined' + ); +} + +/** + * Iterate over an Array or an Object invoking a function for each item. + * + * If `obj` is an Array callback will be called passing + * the value, index, and complete array for each item. + * + * If 'obj' is an Object callback will be called passing + * the value, key, and complete object for each property. + * + * @param {Object|Array} obj The object to iterate + * @param {Function} fn The callback to invoke for each item + */ +function forEach(obj, fn) { + // Don't bother if no value provided + if (obj === null || typeof obj === 'undefined') { + return; + } + + // Force an array if not already something iterable + if (typeof obj !== 'object') { + /*eslint no-param-reassign:0*/ + obj = [obj]; + } + + if (isArray(obj)) { + // Iterate over array values + for (var i = 0, l = obj.length; i < l; i++) { + fn.call(null, obj[i], i, obj); + } + } else { + // Iterate over object keys + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) { + fn.call(null, obj[key], key, obj); + } + } + } +} + +/** + * Accepts varargs expecting each argument to be an object, then + * immutably merges the properties of each object and returns result. + * + * When multiple objects contain the same key the later object in + * the arguments list will take precedence. + * + * Example: + * + * ```js + * var result = merge({foo: 123}, {foo: 456}); + * console.log(result.foo); // outputs 456 + * ``` + * + * @param {Object} obj1 Object to merge + * @returns {Object} Result of all merge properties + */ +function merge(/* obj1, obj2, obj3, ... */) { + var result = {}; + function assignValue(val, key) { + if (isPlainObject(result[key]) && isPlainObject(val)) { + result[key] = merge(result[key], val); + } else if (isPlainObject(val)) { + result[key] = merge({}, val); + } else if (isArray(val)) { + result[key] = val.slice(); + } else { + result[key] = val; + } + } + + for (var i = 0, l = arguments.length; i < l; i++) { + forEach(arguments[i], assignValue); + } + return result; +} + +/** + * Extends object a by mutably adding to it the properties of object b. + * + * @param {Object} a The object to be extended + * @param {Object} b The object to copy properties from + * @param {Object} thisArg The object to bind function to + * @return {Object} The resulting value of object a + */ +function extend(a, b, thisArg) { + forEach(b, function assignValue(val, key) { + if (thisArg && typeof val === 'function') { + a[key] = bind(val, thisArg); + } else { + a[key] = val; + } + }); + return a; +} + +/** + * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM) + * + * @param {string} content with BOM + * @return {string} content value without BOM + */ +function stripBOM(content) { + if (content.charCodeAt(0) === 0xFEFF) { + content = content.slice(1); + } + return content; +} + +module.exports = { + isArray: isArray, + isArrayBuffer: isArrayBuffer, + isBuffer: isBuffer, + isFormData: isFormData, + isArrayBufferView: isArrayBufferView, + isString: isString, + isNumber: isNumber, + isObject: isObject, + isPlainObject: isPlainObject, + isUndefined: isUndefined, + isDate: isDate, + isFile: isFile, + isBlob: isBlob, + isFunction: isFunction, + isStream: isStream, + isURLSearchParams: isURLSearchParams, + isStandardBrowserEnv: isStandardBrowserEnv, + forEach: forEach, + merge: merge, + extend: extend, + trim: trim, + stripBOM: stripBOM +}; diff --git a/node_modules/xfarr-api/node_modules/axios/package.json b/node_modules/xfarr-api/node_modules/axios/package.json new file mode 100644 index 000000000..7c895b3a9 --- /dev/null +++ b/node_modules/xfarr-api/node_modules/axios/package.json @@ -0,0 +1,84 @@ +{ + "name": "axios", + "version": "0.21.4", + "description": "Promise based HTTP client for the browser and node.js", + "main": "index.js", + "scripts": { + "test": "grunt test", + "start": "node ./sandbox/server.js", + "build": "NODE_ENV=production grunt build", + "preversion": "npm test", + "version": "npm run build && grunt version && git add -A dist && git add CHANGELOG.md bower.json package.json", + "postversion": "git push && git push --tags", + "examples": "node ./examples/server.js", + "coveralls": "cat coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js", + "fix": "eslint --fix lib/**/*.js" + }, + "repository": { + "type": "git", + "url": "https://github.com/axios/axios.git" + }, + "keywords": [ + "xhr", + "http", + "ajax", + "promise", + "node" + ], + "author": "Matt Zabriskie", + "license": "MIT", + "bugs": { + "url": "https://github.com/axios/axios/issues" + }, + "homepage": "https://axios-http.com", + "devDependencies": { + "coveralls": "^3.0.0", + "es6-promise": "^4.2.4", + "grunt": "^1.3.0", + "grunt-banner": "^0.6.0", + "grunt-cli": "^1.2.0", + "grunt-contrib-clean": "^1.1.0", + "grunt-contrib-watch": "^1.0.0", + "grunt-eslint": "^23.0.0", + "grunt-karma": "^4.0.0", + "grunt-mocha-test": "^0.13.3", + "grunt-ts": "^6.0.0-beta.19", + "grunt-webpack": "^4.0.2", + "istanbul-instrumenter-loader": "^1.0.0", + "jasmine-core": "^2.4.1", + "karma": "^6.3.2", + "karma-chrome-launcher": "^3.1.0", + "karma-firefox-launcher": "^2.1.0", + "karma-jasmine": "^1.1.1", + "karma-jasmine-ajax": "^0.1.13", + "karma-safari-launcher": "^1.0.0", + "karma-sauce-launcher": "^4.3.6", + "karma-sinon": "^1.0.5", + "karma-sourcemap-loader": "^0.3.8", + "karma-webpack": "^4.0.2", + "load-grunt-tasks": "^3.5.2", + "minimist": "^1.2.0", + "mocha": "^8.2.1", + "sinon": "^4.5.0", + "terser-webpack-plugin": "^4.2.3", + "typescript": "^4.0.5", + "url-search-params": "^0.10.0", + "webpack": "^4.44.2", + "webpack-dev-server": "^3.11.0" + }, + "browser": { + "./lib/adapters/http.js": "./lib/adapters/xhr.js" + }, + "jsdelivr": "dist/axios.min.js", + "unpkg": "dist/axios.min.js", + "typings": "./index.d.ts", + "dependencies": { + "follow-redirects": "^1.14.0" + }, + "bundlesize": [ + { + "path": "./dist/axios.min.js", + "threshold": "5kB" + } + ] +} diff --git a/node_modules/xfarr-api/package.json b/node_modules/xfarr-api/package.json new file mode 100644 index 000000000..8799cd4e8 --- /dev/null +++ b/node_modules/xfarr-api/package.json @@ -0,0 +1,27 @@ +{ + "name": "xfarr-api", + "version": "1.0.3", + "description": "YNTKTS", + "main": "main.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "dependencies": { + "axios": "^0.21.1", + "cheerio": "^1.0.0-rc.10", + "request": "^2.88.2" + }, + "keywords": [ + "xfar-api" + ], + "repository": { + "type": "git", + "url": "git+https://github.com/xfar05/xfarr-api.git" + }, + "author": "XFar", + "license": "MIT", + "bugs": { + "url": "https://github.com/xfar05/xfarr-api/issues" + }, + "homepage": "https://github.com/xfar05/xfarr-api#readme" +} diff --git a/package.json b/package.json index 342c44c30..f3a33a463 100644 --- a/package.json +++ b/package.json @@ -1,74 +1,84 @@ -{ - "name": "Red-Dragon-Bot", - "version": "2.0.0", - "description": "WhatsApp Using Lib Baileys Multi Device", - "main": "index.js", - "type": "commonjs", - "scripts": { - "start": "node index.js" - }, - "keywords": [ - "termux", - "whatsapp", - "2022", - "RedDragon", - "base", - "baileys-md", - "bot", - "bot-md", - "multi-device" - ], - "author": "NexusNw", - "license": "MIT", - "dependencies": { - "@adiwajshing/baileys": "^4.0.1", - "@adiwajshing/keyed-db": "^0.2.4", - "awesome-phonenumber": "^2.64.0", - "axios": "^0.24.0", - "chalk": "^4.1.2", - "cheerio": "^1.0.0-rc.10", - "child_process": "^1.0.2", - "crypto": "^1.0.1", - "file-type": "^16.5.3", - "fluent-ffmpeg": "^2.1.2", - "fs": "0.0.1-security", - "got": "^11.8.3", - "g-i-s": "^2.1.6", - "google-it": "^1.6.2", - "human-readable": "^0.2.1", - "jimp": "^0.16.1", - "jsdom": "^16.4.0", - "lowdb": "^2.1.0", - "mongoose": "^6.2.1", - "moment-timezone": "^0.5.34", - "mumaker": "^1.0.0", - "node-cron": "^3.0.0", - "node-fetch": "^2.6.1", - "node-webpmux": "^3.1.0", - "os": "^0.1.2", - "path": "^0.12.7", - "perf_hooks": "0.0.1", - "pino": "^7.0.5", - "qrcode-terminal": "^0.12.0", - "request": "^2.88.2", - "remove.bg": "^1.3.0", - "scrape-primbon": "^1.1.0", - "util": "^0.12.4", - "yargs": "^17.2.1", - "xfarr-api": "^1.0.2", - "yt-search": "^2.10.2" - }, - "directories": { - "lib": "lib", - "src": "src" - }, - "devDependencies": {}, - "repository": { - "type": "git", - "url": "git+https://github.com/nexusNw/Gojo-Satoru.git" - }, - "bugs": { - "url": "https://github.com/nexusNw/Gojo-Satoru/issues" - }, - "homepage": "https://github.com/nexusNw/Gojo-Satoru#readme" -} +{ + "name": "Red-Dragon-MD", + "version": "4.0.0", + "description": "Automated whatsapp md bot created using nodejs", + "main": "boot.js", + "type": "commonjs", + "scripts": { + "start": "node boot.js" + }, + "keywords": [ + "termux", + "whatsapp", + "red-dragon", + "base", + "baileys-md", + "bot", + "bot-md", + "multi-device" + ], + "author": "Xeon", + "license": "MIT", + "dependencies": { + "@adiwajshing/baileys": "github:prabhasha2006/baileys", + "@adiwajshing/keyed-db": "^0.2.4", + "@bochilteam/scraper": "^2.0.0", + "@shineiichijo/marika": "^2.0.2", + "@develoka/angka-terbilang-js": "^1.4.2", + "@shineiichijo/nhentai-pdf": "^1.0.5", + "awesome-phonenumber": "^2.64.0", + "axios": "^0.24.0", + "chalk": "^4.1.2", + "cheerio": "^1.0.0-rc.10", + "child_process": "^1.0.2", + "crypto": "^1.0.1", + "tod-api": "^1.0.5", + "file-type": "^16.5.3", + "fluent-ffmpeg": "^2.1.2", + "fs": "0.0.1-security", + "got": "^11.8.3", + "dhn-api": "^1.1.3", + "emoji-api": "^1.0.2", + "textmaker-thiccy": "^1.3.1", + "g-i-s": "^2.1.6", + "google-it": "^1.6.2", + "human-readable": "^0.2.1", + "jimp": "^0.16.1", + "jsdom": "^16.4.0", + "lowdb": "^2.1.0", + "mongoose": "^6.2.1", + "moment-timezone": "^0.5.34", + "mumaker": "^1.0.0", + "node-cron": "^3.0.0", + "anime-wallpaper": "^1.0.2", + "node-fetch": "^2.6.1", + "node-webpmux": "^3.1.0", + "os": "^0.1.2", + "hxz-api": "^1.0.1", + "minecraft-query": "^1.0.13", + "path": "^0.12.7", + "perf_hooks": "0.0.1", + "pino": "^7.0.5", + "qrcode-terminal": "^0.12.0", + "request": "^2.88.2", + "remove.bg": "^1.3.0", + "scrape-primbon": "^1.1.0", + "util": "^0.12.4", + "yargs": "^17.2.1", + "xfarr-api": "^1.0.2", + "yt-search": "^2.10.2" + }, + "directories": { + "lib": "lib", + "src": "src" + }, + "devDependencies": {}, + "repository": { + "type": "git", + "url": "git+https://github.com/DGXeon/CheemsBot-MD4.git" + }, + "bugs": { + "url": "https://github.com/DGXeon/CheemsBot-MD4/issues" + }, + "homepage": "https://github.com/DGXeon/CheemsBot-MD4#readme" +} diff --git a/settings.js b/settings.js index 525807c12..16c7b3e97 100644 --- a/settings.js +++ b/settings.js @@ -1,9 +1,3 @@ -//════════════(00)════════════════\\ -// -// RED DRAGON v6.0 -// -//════════════(00)════════════════\\ - const fs = require('fs') const chalk = require('chalk') @@ -14,39 +8,62 @@ global.APIs = { //Api Key\\ global.APIKeys = { - 'https://zenzapis.xyz': 'sanzychan01', //credit goes to sanzy yt, if api key expire, buy it and put it here?\\ + 'https://zenzapis.xyz': 'your key', } -//customize settings\\ +global.alivemsg = `📤I am alive now😇 +🤷‍♀️How can I help you?😉` //Costomize Alive Message (type your message in `` ) -global.alivemsg = `My name is RED DRAGON🔥 -My Creator is Kumuthu Prabhasha😎` //Costomize Alive Message (type your message in `` ) -global.owner = ['+380944814219'] //Owner number in aive msg -global.premium = ['+380944814219'] //Owner Number info -global.ownernomer = '+380944814219' //Owner Number <<< +global.autoTyping = false //auto tying in gc (true to on, false to off) +global.autoreadpmngc = false //auto reading in gc and pm (true to on, false to off) +global.autoReadGc = false //auto reading in gc (true to on, false to off) +global.autoRecord = false //auto recording (true to on, false to off) +global.available = true //auto available (true to on, false to off) -global.ownername = '😎𝙆.𝙋𝙧𝙖𝙗𝙝𝙖𝙨𝙝𝙖' //Owner Name -global.botname = ' ☬RED༒DRAGON࿐' //Bot Name +global.doc1 = 'application/vnd.openxmlformats-officedocument.presentationml.presentation' +global.doc2 = 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' +global.doc3 = 'application/vnd.openxmlformats-officedocument.wordprocessingml.document' +global.doc4 = 'application/zip' +global.doc5 = 'application/pdf' +global.doc6 = 'application/vnd.android.package-archive' -global.button = '🤭Youtube📍' //Costomize A Button Name In Alive Message -global.btnurl = 'https://youtu.be/E5C-lrl_g9I' //Change Your Button's URL +//owner v card +global.vcardowner = ['+380944814219'] // owner number +global.ownername = "😎𝙆.𝙋𝙧𝙖𝙗𝙝𝙖𝙨𝙝𝙖❯❯" // owner name +global.ytname = "" // yt chanel name +global.socialm = "GitHub: prabhasha2006" // github or insta name +global.location = "India, Mizoram, Aizawl" // location -global.region = 'India, South India, Kerala' //Country Region +//bot body +global.alivepic = `https://i.ibb.co/cyyCjN7/20220803-081426.png` // alive picture \\ use "https://ibb.com" to upload photos. < 1 MB -global.packname = '☬RED༒DRAGON࿐' //Bot Pacage Name -global.author = '😎𝙆.𝙋𝙧𝙖𝙗𝙝𝙖𝙨𝙝𝙖❯❯' //Author Name -global.prefa = ['','!','.','😂','❤️','💠'] //Command Prefix eg:(.alive ,alive 😂alive) -global.sessionName = 'session' //Session Name! -global.sp = '⭔' //A Charactor +global.dragonchat = "false" // chat bot "true" / "false" (200 auto replies in this) +global.callblock = "false" // call block "true" / "false" ("true" to block callers) +global.antibad = "false" // To remove bad word senders +global.antispam = "true" // To remove or block spammers +global.antilink = "false" // To remove group link sharing peoples +global.upsongvoice = "false" // true/false \\ bot can upload song as voice note (it use your data and storage bacause auto download) you can put "false" (anyone can't get songs as voice note / your data is not wasted) +global.welcom_msg = "true" // Welcome / Goodbye [true/false] + + +global.owner = ['+380944814219'] +global.ownertag = '+380944814219' //your tag number +global.botname = '𝙍𝙀𝘿╺ 𝘿𝙍𝘼𝙂𝙊𝙉 - 𝘉𝘖𝘛' //ur bot name +global.packname = "Bot Sticker" // sticker packname +global.author = "𝙍𝙀𝘿╺ 𝘿𝙍𝘼𝙂𝙊𝙉" // sticker author global.dragonemoji = '🧩' // Menu emoji -global.footer = '©_Kumuthu.' //In list menu -global.chatbotpre = 'true' // Chat bot true/false +global.footer = '[ ◉ ʀᴇᴅ-ᴅʀᴀɢᴏɴ-ᴍᴅ ]' // -global.ig = 'https://github.com/prabhasha2006' //Github Account! +//database +global.premium = ['+380944814219'] //ur premium numbers -global.mess = { // COSTOMIZE WITH YOUR LANGUAGE - +//other +global.sessionName = 'session' +global.antitags = false +global.prefa = ['','!','.','😂','❤️','💠'] //Command Prefix eg:(.alive ,alive 😂alive) +global.sp = '💠' +global.mess = { success: 'Done ✅', admin: 'Only Admins can use it!😉', botAdmin: 'Bot wants to be an Admin😥', @@ -57,8 +74,13 @@ global.mess = { // COSTOMIZE WITH YOUR LANGUAGE wait: '👉👈Pleas Wait...', error: 'Error!!! Maybe Api Key Is Expired🤔!', endLimit: 'Your Daily Limit Has Expired, The Limit Will Be Reset Every 12 Hours', -} -// DO NOT CHANGE \\ + linkm: 'Where is the link?', + nsfw: 'The nsfw feature has not been activated, please contact the admin to activate', + banChat: 'The bot was banned in this group, please contact the owner to unban', + badwords: '*🚫Bad Words Not Allowed Here !*\n\n⚠️ Warning... ⚠️', + spam: '⚠️ [SPAM] Detected ⚠️\n\nThe emergency security system was activated.\n\nPowered By: *ʀᴇᴅ-ᴅʀᴀɢᴏɴ*', + caption: 'Generated by: ◉ *ʀᴇᴅ-ᴅʀᴀɢᴏɴ-ʙᴏᴛ*' +} // END \\ global.limitawal = { premium: "Infinity", free: 12, @@ -72,11 +94,228 @@ global.mess = { // COSTOMIZE WITH YOUR LANGUAGE umpanawal: 5, potionawal: 1 } -global.thumb = fs.readFileSync('./DragonMedia/image/red-_-dragon-kumuthu.jpg') +global.thum = fs.readFileSync("./Android/AllData/theme/repl.jpg") //ur thumb pic +global.log0 = fs.readFileSync("./Android/AllData/theme/repl.jpg") //ur logo pic +global.err4r = fs.readFileSync("./Android/AllData/theme/repl.jpg") //ur error pic +global.thumb = fs.readFileSync("./Android/AllData/theme/repl.jpg") //ur thumb pic + +global.thumb = fs.readFileSync('./Android/AllData/theme/repl.jpg') global.flaming = 'https://www6.flamingtext.com/net-fu/proxy_form.cgi?&imageoutput=true&script=sketch-name&doScale=true&scaleWidth=800&scaleHeight=500&fontsize=100&text=' global.fluming = 'https://www6.flamingtext.com/net-fu/proxy_form.cgi?&imageoutput=true&script=fluffy-logo&doScale=true&scaleWidth=800&scaleHeight=500&fontsize=100&text=' global.flarun = 'https://www6.flamingtext.com/net-fu/proxy_form.cgi?&imageoutput=true&script=runner-logo&doScale=true&scaleWidth=800&scaleHeight=500&fontsize=100&text=' global.flasmurf = 'https://www6.flamingtext.com/net-fu/proxy_form.cgi?&imageoutput=true&script=smurfs-logo&doScale=true&scaleWidth=800&scaleHeight=500&fontsize=100&text=' + +global.ntilinkytvid = [] +global.ntilinkytch = [] +global.ntilinkig = [] +global.ntilinkfb = [] +global.ntilinktg = [] +global.ntilinktt = [] +global.ntilinktwt = [] +global.ntilinkall = [] +global.nticall = [] +global.ntwame = [] +global.nttoxic = [] +global.ntnsfw = [] +global.ntvirtex = [] +global.rkyt = [] +global.wlcm = [] +global.gcrevoke = [] +global.autorep = [] +global.ntilink = [] + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +// DO NOT CHANGE THIS. ERROR WARNING දාන්න තැනක් නැතුව මෙතන දැම්මෙ. +global.rep = { // All Replies = 145 + K1: '🫢හායි😁❤️', + K2: '🤭හූයි✌️💞🫶', + K3: '😉🫶හායි😂', + K4: '🥴හූයි😊', + K5: '😂හේයි, හව් ආ යූ🥴✌️', + K6: '😁Hey there💝 I am WhatsApp Bot😏', + K7: '❣️ඇයි හලෝ😌', + K8: '🙃මොකෝ හලෝ🥲', + K9: '😒මොකෝ?', + K10: '🥺ඇයි අනේ?❤️🫢', + K11: '🌝❤️', + K12: '😜හී හී😁හූ හූ', + K13: '😁හී හී💞', + K14: '😊හූ...', + K15: 'ඇයි🥲', + K16: '😂😂✌️', + K17: '😐ආහ්', + K18: 'චූටී තමයි😇', + K19: '🥺🥺ඇයි සුදූ❤️💓', + K20: 'කොහොමවත් නෑ ඉතිං😒', + K21: '😁මන් දන්නෑ🥲', + K22: 'හොඳයි තමා😌', + K23: '😂😂මරු හැබැයි', + K24: 'මලු🙃', + K25: '😘😇❤️', + K26: '😘😘මෙන්න ඔයාට💕', + K27: '😊ඇත්තමද?❤️', + K28: '☺️👻ඔය ඇත්තමද❤️', + K29: 'ඇයි🙄', + K30: '🥺✌️සිදෙනවද?', + K31: '😐💔ඕවට එන්න එපා හරිත😒', + K32: '😏අනේ මේ😒 යනෝ යන්න💔', + K33: 'ඔයා තමයි හොරා😒 මගෙ හිත හොරකම් කළානෙ ඉතිං😌', + K34: '😇මොකො හූම් ගාන්නෙ😒 බකමූනා', + K35: '​😁😁මොකෝ හලෝ හූම් හූම් ගාන්නෙ?', + K36: '😉නෑ අනේ මුකුත් නෑ😐🫠', + K37: '😒ආහ්', + K38: '✌️ඔව් නං එච්චරයි😌', + K39: '😐හේ හේ නැද්ද?🫣', + K40: '🙄මොනවටද ආස?', + K41: '😌මාත් ආසයි😊💞', + K42: 'එල😌', + K43: 'බැරි නං නිකං ඉන්න😏', + K44: '😂😂💔', + K45: 'සුදුයි තමයි ඇයි මොකද?🙄', + K46: '😇තාම කෑවෙ නෑ අනේ🥺', + K47: 'බොන්නෑ😒', + K48: 'නිදිමත නං දිදාගන්නකො වද දෙන්නැතුව😒😌❤️', + K49: '😇දැම්ම නිදාගන්න බෑ අනේ😜 නිදිමත නෑ😁💞', + K50: '😉මුකුත් නෑ අනේ🫡', + K51: 'මොකද්ද දන්නෑ🥲', + K52: '😝මම නං මුකුත් කරන්නෑ අනේ😁 ඔයාලා දිහා බලන් ඉන්නවා😌', + K53: '🥺පාලුයි අනේ. අපි සෙල්ලමක් කරමුද?😊✌️', + K54: '😌😁ආදරෙයි❤️', + K55: '😌ආදලෙයි ඉතිං❤️❤️', + K56: '🥺🥺ඇත්තද?', + K57: '🥺අනේ ඒ මොකද?🥴', + K58: '😒මටත් දුකයි ඒ ගැන😕', + K59: '🤭ඉන්න බෑ අනේ😜', + K60: '🫡මොකද අඬන්නෙ?😒', + K61: '😉මොකද අයියෝ😂', + K62: '😐මුකුත් දන්නැති අහින්සක මම😕💔', + K63: '🚲හා යමු යමු😌', + K64: '🥴දෙන්න බෑ😒', + K65: '🙏පස්සෙ දෙන්නං🥲', + K66: '😁බඩගිනි නෑ❤️😒', + K67: '😳අම්මෝ හා හා🙏', + K68: '😂ඇයි යකෝ😉😈', + K69: '👻ඇයි හුයි😁 කෝං ගහේ නයි😂', + K70: '🥲දන්නැත්තං නිකං ඉන්න😜', + K71: '😂අපි තමයි හොඳටම කරේ🥲\n🤧රෙද්ද තමයි😂', + K72: '🙄ආ හා 😏ගහපන් බලන්න💔👎', + K73: 'හී😂😂😂💓', + K74: 'වන්ඩර්පුල්🥲😂', + K75: '😂ඕං බලන්නකො ඒකෙත් හැටි නේද🥴😂', + K76: '😌එල', + K77: '🥲මොකෝ ඩෝ😉❣️', + K78: 'අඩෙහ්🙃😹', + K79: 'ඔය කිව්වට ලොකු නෑ හොඳේ😏', + K80: '😹මම නං පොඩී තමයි ඉතිං😌', + K81: '🥴ටිකයි ද?😂', + K82: '🥴ඒකි එහෙම නෑ බන්😅', + K83: '🥲ඌ මොකද්ද කරේ?', + K84: '😂එහෙම කියන්න එපා එයාලා පව්නෙ😐🤭', + K85: 'හුම්ම්😌 පව් ඉතිං😂', + K86: 'හා😒 කියනකං තමයි හිටියෙ🙏❣️', + K87: 'මන් දන්නෑ🥲', + K88: ' 👀 ', + K89: '🥺ගිහින් බේත් ගන්න', + K90: '🥺ගොඩක් අමාරුද?☝️', + K91: 'DSI පාරක් කන්න ආසද?😂', + K92: 'කලිසම ගලවනෝකො ඉතිං😒', + K93: 'අත ලෙප්ට්🥲', + K94: '🫢🫢හරි නරකයි😒', + K95: '😌මම නං කොහොමත් අහින්සකයි රටක් වටී😁❤️', + K96: 'අතේ...🥲🥲🥲🥲🥲🥲', + K97: '😐දාන්න බෑ😒', + K98: '📱🔌පෝන එක චාජ් එකට ගහලා ඔය ළමයා ගිහින් වැඩක් කරගන්න😉', + K99: '🫢🤭ඇයි? අසහනේ ද?🤨😏💔', + K100: '💔පෙම් සිත රිදුනා සත්තලනේ🥺🤧', + K101: '😹😹☝️', + K102: 'බල්ලා පූසා මීයා හාවා නරියා අලියා😒', + K103: '🥲උරුලා ගති තමා', + K104: '😐කියන්න බෑ😒 ඇයි මොකෝ?🙄', + K105: '😐අපි පැනල යමුද?🤭🫢', + K106: '☝️ගියා නං ආයි එන්නෙපා😒', + K107: '😅✌️😝', + K108: '😂😂විහිලු නං කමක් නෑ😌', + K109: 'මං තරහයි😒 ඇයි මොකෝ?👎', + K110: 'ඇයි පකෝ🥲', + K111: 'ලබ්බ😒', + K112: 'මොන හුම්තක්ද යකෝ?🙄', + K113: '😒පලෑන්න පොන්නය💔', + K114: '🥲💔🙏', + K115: '🥲🥲💔☝️', + K116: '😏😑එන්නෙපා ගෑනි ගාගෙන🤨💔💔💔', + K117: 'දැන්ම බෑ ළමයෝ🤭🤭 පස්සෙ දෙන්නං😝😒', + K118: 'මොන පකක්ද?😒', + K119: '😒👎', + K120: 'එහෙම කියන්නෙපා පව්නෙ😒', + K121: '🫢🙄', + K122: 'අනේ තෝ හුකාගනිං🙂💔', + K123: '😐උක්කමු😒😂😂', + K124: 'ඇයි🙄 පුකද බලන්නෙ?', + K125: 'උබේ දෙක ද?😂', + K126: 'උබේ ද?😂', + K127: '🥲මං ඇවිත් කටට ගන්නද?😒😝', + K128: '😂😂හමෝ', + K129: '😏ඕන්නැත්තං නිකං ඉන්න', + K130: '🤭නිකං ඉන්න එපා ඇඳුමක් ඇඳගන්න😂❤️', + K131: '😂😂🙏', + K132: '😂🤭', + K133: '😁', + K134: '😏☝️', + K135: 'අඬන්න එපා ඉතිං😒😝', + K136: '🥴පිත්තු', + K137: '🙂', + K138: '😌😌', + K139: '🥲🥲💔', + K140: '😍🥰😘💞💕💓💗💖❣️❤️', + K141: '😐🙄', + K142: '🥺දුක් වෙන්න එපා ඉතිං❤️', + K143: '🥺🥺😐', + K144: '❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️', + K145: '🫡🫠🤝', + K146: '🎤දහසක් මල්🌸 විකසිත වන😊 මේ හිමිදිරි උදෑසනේ🌄 පතන්නම් ඔබ සැමට🙏 සුභම සුභ උදෑසනක් කියා...😃', + K147: 'ලබන්නාවූ රාත්‍රිය හීනෙන් හොල්මන් පෙනෙන, මහ රෑ දාඩියෙන් තෙමී ඇහැරෙන, පෙරේතයන් ඇද යටට එන, කුම්භාණ්ඩයින් ජනෙල් වලින් එබී බලන, භයානක රාත්‍රියක් වේවා😂👻👻❤️' + } + + + + + + let file = require.resolve(__filename) fs.watchFile(file, () => { fs.unwatchFile(file) diff --git a/src/nexus b/src/nexus deleted file mode 100644 index d3f5a12fa..000000000 --- a/src/nexus +++ /dev/null @@ -1 +0,0 @@ - diff --git a/storage/N3XU5-53R b/storage/N3XU5-53R deleted file mode 100644 index 8b1378917..000000000 --- a/storage/N3XU5-53R +++ /dev/null @@ -1 +0,0 @@ - diff --git "a/storage/image/\360\237\220\246" "b/storage/image/\360\237\220\246" deleted file mode 100644 index 8b1378917..000000000 --- "a/storage/image/\360\237\220\246" +++ /dev/null @@ -1 +0,0 @@ - diff --git a/storage/user/N3XU5-53R b/storage/user/N3XU5-53R deleted file mode 100644 index 8b1378917..000000000 --- a/storage/user/N3XU5-53R +++ /dev/null @@ -1 +0,0 @@ - diff --git a/storage/user/limit.json b/storage/user/limit.json deleted file mode 100644 index 032cf8746..000000000 --- a/storage/user/limit.json +++ /dev/null @@ -1 +0,0 @@ -[{"id":"6281575886399@s.whatsapp.net","limit":35022}] \ No newline at end of file